MK3_lang_base: file format elf32-avr Disassembly of section .text: 00000000 <__vectors>: 0: 0c 94 ce 56 jmp 0xad9c ; 0xad9c <__dtors_end> 4: 0c 94 ff 56 jmp 0xadfe ; 0xadfe <__bad_interrupt> 8: 0c 94 ff 56 jmp 0xadfe ; 0xadfe <__bad_interrupt> c: 0c 94 ff 56 jmp 0xadfe ; 0xadfe <__bad_interrupt> 10: 0c 94 ff 56 jmp 0xadfe ; 0xadfe <__bad_interrupt> 14: 0d 94 f2 5e jmp 0x2bde4 ; 0x2bde4 <__vector_5> 18: 0c 94 ff 56 jmp 0xadfe ; 0xadfe <__bad_interrupt> 1c: 0c 94 ff 56 jmp 0xadfe ; 0xadfe <__bad_interrupt> 20: 0c 94 06 75 jmp 0xea0c ; 0xea0c <__vector_8> 24: 0c 94 ff 56 jmp 0xadfe ; 0xadfe <__bad_interrupt> 28: 0c 94 ff 56 jmp 0xadfe ; 0xadfe <__bad_interrupt> 2c: 0c 94 ff 56 jmp 0xadfe ; 0xadfe <__bad_interrupt> 30: 0c 94 8b 67 jmp 0xcf16 ; 0xcf16 <__vector_12> 34: 0c 94 ff 56 jmp 0xadfe ; 0xadfe <__bad_interrupt> 38: 0d 94 a8 32 jmp 0x26550 ; 0x26550 <__vector_14> 3c: 0d 94 39 2c jmp 0x25872 ; 0x25872 <__vector_15> 40: 0c 94 ff 56 jmp 0xadfe ; 0xadfe <__bad_interrupt> 44: 0d 94 19 43 jmp 0x28632 ; 0x28632 <__vector_17> 48: 0c 94 ff 56 jmp 0xadfe ; 0xadfe <__bad_interrupt> 4c: 0c 94 ff 56 jmp 0xadfe ; 0xadfe <__bad_interrupt> 50: 0c 94 ff 56 jmp 0xadfe ; 0xadfe <__bad_interrupt> 54: 0c 94 ff 56 jmp 0xadfe ; 0xadfe <__bad_interrupt> 58: 0c 94 ff 56 jmp 0xadfe ; 0xadfe <__bad_interrupt> 5c: 0c 94 3a 74 jmp 0xe874 ; 0xe874 <__vector_23> 60: 0c 94 ff 56 jmp 0xadfe ; 0xadfe <__bad_interrupt> 64: 0d 94 1f d6 jmp 0x3ac3e ; 0x3ac3e <__vector_25> 68: 0c 94 ff 56 jmp 0xadfe ; 0xadfe <__bad_interrupt> 6c: 0c 94 ff 56 jmp 0xadfe ; 0xadfe <__bad_interrupt> 70: 0c 94 ff 56 jmp 0xadfe ; 0xadfe <__bad_interrupt> 74: 0c 94 57 8d jmp 0x11aae ; 0x11aae <__vector_29> 78: 0c 94 ff 56 jmp 0xadfe ; 0xadfe <__bad_interrupt> 7c: 0c 94 ff 56 jmp 0xadfe ; 0xadfe <__bad_interrupt> 80: 0c 94 ff 56 jmp 0xadfe ; 0xadfe <__bad_interrupt> 84: 0c 94 ff 56 jmp 0xadfe ; 0xadfe <__bad_interrupt> 88: 0c 94 ff 56 jmp 0xadfe ; 0xadfe <__bad_interrupt> 8c: 0c 94 ff 56 jmp 0xadfe ; 0xadfe <__bad_interrupt> 90: 0d 94 db d5 jmp 0x3abb6 ; 0x3abb6 <__vector_36> 94: 0c 94 ff 56 jmp 0xadfe ; 0xadfe <__bad_interrupt> 98: 0c 94 ff 56 jmp 0xadfe ; 0xadfe <__bad_interrupt> 9c: 0c 94 ff 56 jmp 0xadfe ; 0xadfe <__bad_interrupt> a0: 0c 94 ff 56 jmp 0xadfe ; 0xadfe <__bad_interrupt> a4: 0c 94 ff 56 jmp 0xadfe ; 0xadfe <__bad_interrupt> a8: 0d 94 53 22 jmp 0x244a6 ; 0x244a6 <__vector_42> ac: 0c 94 ff 56 jmp 0xadfe ; 0xadfe <__bad_interrupt> b0: 0c 94 ff 56 jmp 0xadfe ; 0xadfe <__bad_interrupt> b4: 0d 94 35 22 jmp 0x2446a ; 0x2446a <__vector_45> b8: 0c 94 ff 56 jmp 0xadfe ; 0xadfe <__bad_interrupt> bc: 0d 94 f2 37 jmp 0x26fe4 ; 0x26fe4 <__vector_47> c0: 0c 94 ff 56 jmp 0xadfe ; 0xadfe <__bad_interrupt> c4: 0c 94 ff 56 jmp 0xadfe ; 0xadfe <__bad_interrupt> c8: 0c 94 ff 56 jmp 0xadfe ; 0xadfe <__bad_interrupt> cc: 0d 94 f5 21 jmp 0x243ea ; 0x243ea <__vector_51> d0: 0c 94 ff 56 jmp 0xadfe ; 0xadfe <__bad_interrupt> d4: 0c 94 ff 56 jmp 0xadfe ; 0xadfe <__bad_interrupt> d8: 0c 94 ff 56 jmp 0xadfe ; 0xadfe <__bad_interrupt> dc: 0c 94 ff 56 jmp 0xadfe ; 0xadfe <__bad_interrupt> e0: 0c 94 ff 56 jmp 0xadfe ; 0xadfe <__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: 43 72 andi r20, 0x23 ; 35 3604: 61 73 andi r22, 0x31 ; 49 3606: 68 20 and r6, r8 3608: 64 65 ori r22, 0x54 ; 84 360a: 74 65 ori r23, 0x54 ; 84 360c: 63 74 andi r22, 0x43 ; 67 360e: 65 64 ori r22, 0x45 ; 69 3610: 2e 00 .word 0x002e ; ???? 00003612 : 3612: ff ff 53 6f 6d 65 20 70 72 6f 62 6c 65 6d 20 65 ..Some problem e 3622: 6e 63 6f 75 6e 74 65 72 65 64 2c 20 5a 2d 6c 65 ncountered, Z-le 3632: 76 65 6c 69 6e 67 20 65 6e 66 6f 72 63 65 64 20 veling enforced 3642: 2e 2e 2e 00 .... 00003646 : 3646: ff ff 4d 65 73 68 20 62 65 64 20 6c 65 76 65 6c ..Mesh bed level 3656: 69 6e 67 20 66 61 69 6c 65 64 2e 20 50 72 69 6e ing failed. Prin 3666: 74 20 63 61 6e 63 65 6c 65 64 2e 00 t canceled.. 00003672 : 3672: ff ff 48 65 61 74 69 6e 67 20 64 69 73 61 62 6c ..Heating disabl 3682: 65 64 20 62 79 20 73 61 66 65 74 79 20 74 69 6d ed by safety tim 3692: 65 72 2e 00 er.. 00003696 : 3696: ff ff 53 54 4f 50 50 45 44 2e 00 ..STOPPED.. 000036a1 : 36a1: ff ff 50 41 55 53 45 44 20 54 48 45 52 4d 41 4c ..PAUSED THERMAL 36b1: 20 45 52 52 4f 52 00 ERROR. 000036b8 : 36b8: ff ff 47 2d 63 6f 64 65 20 73 6c 69 63 65 64 20 ..G-code sliced 36c8: 66 6f 72 20 61 20 64 69 66 66 65 72 65 6e 74 20 for a different 36d8: 6c 65 76 65 6c 2e 20 43 6f 6e 74 69 6e 75 65 3f level. Continue? ... 000036e9 : 36e9: ff ff 47 2d 63 6f 64 65 20 73 6c 69 63 65 64 20 ..G-code sliced 36f9: 66 6f 72 20 61 20 64 69 66 66 65 72 65 6e 74 20 for a different 3709: 6c 65 76 65 6c 2e 20 50 6c 65 61 73 65 20 72 65 level. Please re 3719: 2d 73 6c 69 63 65 20 74 68 65 20 6d 6f 64 65 6c -slice the model 3729: 20 61 67 61 69 6e 2e 20 50 72 69 6e 74 20 63 61 again. Print ca 3739: 6e 63 65 6c 6c 65 64 2e 00 ncelled.. 00003742 : 3742: ff ff 47 2d 63 6f 64 65 20 73 6c 69 63 65 64 20 ..G-code sliced 3752: 66 6f 72 20 61 20 6e 65 77 65 72 20 66 69 72 6d for a newer firm 3762: 77 61 72 65 2e 20 43 6f 6e 74 69 6e 75 65 3f 00 ware. Continue?. 00003772 : 3772: ff ff 47 2d 63 6f 64 65 20 73 6c 69 63 65 64 20 ..G-code sliced 3782: 66 6f 72 20 61 20 6e 65 77 65 72 20 66 69 72 6d for a newer firm 3792: 77 61 72 65 2e 20 50 6c 65 61 73 65 20 75 70 64 ware. Please upd 37a2: 61 74 65 20 74 68 65 20 66 69 72 6d 77 61 72 65 ate the firmware 37b2: 2e 20 50 72 69 6e 74 20 63 61 6e 63 65 6c 6c 65 . Print cancelle 37c2: 64 2e 00 d.. 000037c5 : 37c5: ff ff 47 2d 63 6f 64 65 20 73 6c 69 63 65 64 20 ..G-code sliced 37d5: 66 6f 72 20 61 20 64 69 66 66 65 72 65 6e 74 20 for a different 37e5: 70 72 69 6e 74 65 72 20 74 79 70 65 2e 20 43 6f printer type. Co 37f5: 6e 74 69 6e 75 65 3f 00 ntinue?. 000037fd : 37fd: ff ff 47 2d 63 6f 64 65 20 73 6c 69 63 65 64 20 ..G-code sliced 380d: 66 6f 72 20 61 20 64 69 66 66 65 72 65 6e 74 20 for a different 381d: 70 72 69 6e 74 65 72 20 74 79 70 65 2e 20 50 6c printer type. Pl 382d: 65 61 73 65 20 72 65 2d 73 6c 69 63 65 20 74 68 ease re-slice th 383d: 65 20 6d 6f 64 65 6c 20 61 67 61 69 6e 2e 20 50 e model again. P 384d: 72 69 6e 74 20 63 61 6e 63 65 6c 6c 65 64 2e 00 rint cancelled.. 0000385d : 385d: ff ff 50 72 65 73 73 20 74 68 65 20 6b 6e 6f 62 ..Press the knob 386d: 20 74 6f 20 70 72 65 68 65 61 74 20 6e 6f 7a 7a to preheat nozz 387d: 6c 65 20 61 6e 64 20 63 6f 6e 74 69 6e 75 65 2e le and continue. ... 0000388e : 388e: ff ff 50 6c 65 61 73 65 20 70 72 65 73 73 20 74 ..Please press t 389e: 68 65 20 6b 6e 6f 62 20 74 6f 20 75 6e 6c 6f 61 he knob to unloa 38ae: 64 20 66 69 6c 61 6d 65 6e 74 00 d filament. 000038b9 : 38b9: ff ff 61 6e 64 20 70 72 65 73 73 20 74 68 65 20 ..and press the 38c9: 6b 6e 6f 62 00 knob. 000038ce : 38ce: ff ff 49 6e 73 65 72 74 20 66 69 6c 61 6d 65 6e ..Insert filamen 38de: 74 00 t. 000038e0 : 38e0: ff ff 43 6f 6c 6f 72 20 6e 6f 74 20 63 6f 72 72 ..Color not corr 38f0: 65 63 74 00 ect. 000038f4 : 38f4: ff ff 46 69 6c 61 6d 65 6e 74 20 6e 6f 74 20 6c ..Filament not l 3904: 6f 61 64 65 64 00 oaded. 0000390a : 390a: ff ff 43 68 61 6e 67 65 64 20 63 6f 72 72 65 63 ..Changed correc 391a: 74 6c 79 00 tly. 0000391e : 391e: ff ff 4c 6f 61 64 69 6e 67 20 63 6f 6c 6f 72 00 ..Loading color. 0000392e : 392e: ff ff 43 68 61 6e 67 65 20 73 75 63 63 65 73 73 ..Change success 393e: 21 00 !. 00003940 : 3940: ff ff 50 6c 65 61 73 65 20 6f 70 65 6e 20 69 64 ..Please open id 3950: 6c 65 72 20 61 6e 64 20 72 65 6d 6f 76 65 20 66 ler and remove f 3960: 69 6c 61 6d 65 6e 74 20 6d 61 6e 75 61 6c 6c 79 ilament manually 3970: 2e 00 .. 00003972 : 3972: ff ff 57 61 73 20 66 69 6c 61 6d 65 6e 74 20 75 ..Was filament u 3982: 6e 6c 6f 61 64 20 73 75 63 63 65 73 73 66 75 6c nload successful 3992: 3f 00 ?. 00003994 : 3994: ff ff 50 6c 65 61 73 65 20 75 70 67 72 61 64 65 ..Please upgrade 39a4: 2e 00 .. 000039a6 : 39a6: ff ff 4e 65 77 20 66 69 72 6d 77 61 72 65 20 76 ..New firmware v 39b6: 65 72 73 69 6f 6e 20 61 76 61 69 6c 61 62 6c 65 ersion available 39c6: 3a 00 :. 000039c8 : 39c8: ff ff 57 61 69 74 69 6e 67 20 66 6f 72 20 50 49 ..Waiting for PI 39d8: 4e 44 41 20 70 72 6f 62 65 20 63 6f 6f 6c 69 6e NDA probe coolin 39e8: 67 00 g. 000039ea : 39ea: ff ff 50 6c 65 61 73 65 20 77 61 69 74 00 ..Please wait. 000039f8 : 39f8: ff ff 4e 6f 20 6d 6f 76 65 2e 00 ..No move.. 00003a03 : 3a03: ff ff 57 61 69 74 20 66 6f 72 20 75 73 65 72 2e ..Wait for user. 3a13: 2e 2e 00 ... 00003a16 : 3a16: ff ff 53 74 61 62 6c 65 20 61 6d 62 69 65 6e 74 ..Stable ambient 3a26: 20 74 65 6d 70 65 72 61 74 75 72 65 20 32 31 2d temperature 21- 3a36: 32 36 43 20 69 73 20 6e 65 65 64 65 64 20 61 20 26C is needed a 3a46: 72 69 67 69 64 20 73 74 61 6e 64 20 69 73 20 72 rigid stand is r 3a56: 65 71 75 69 72 65 64 2e 00 equired.. 00003a5f : 3a5f: ff ff 50 6c 65 61 73 65 20 72 75 6e 20 58 59 5a ..Please run XYZ 3a6f: 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 66 69 72 calibration fir 3a7f: 73 74 2e 00 st.. 00003a83 : 3a83: ff ff 45 78 74 72 75 64 65 72 00 ..Extruder. 00003a8e : 3a8e: ff ff 4d 6f 76 65 20 5a 00 ..Move Z. 00003a97 : 3a97: ff ff 4d 6f 76 65 20 59 00 ..Move Y. 00003aa0 : 3aa0: ff ff 4d 6f 76 65 20 58 00 ..Move X. 00003aa9 : 3aa9: ff ff 43 72 61 73 68 20 64 65 74 65 63 74 69 6f ..Crash detectio 3ab9: 6e 20 63 61 6e 0a 62 65 20 74 75 72 6e 65 64 20 n can.be turned 3ac9: 6f 6e 20 6f 6e 6c 79 20 69 6e 0a 4e 6f 72 6d 61 on only in.Norma 3ad9: 6c 20 6d 6f 64 65 00 l mode. 00003ae0 : 3ae0: ff ff 57 41 52 4e 49 4e 47 3a 0a 43 72 61 73 68 ..WARNING:.Crash 3af0: 20 64 65 74 65 63 74 69 6f 6e 0a 64 69 73 61 62 detection.disab 3b00: 6c 65 64 20 69 6e 0a 53 74 65 61 6c 74 68 20 6d led in.Stealth m 3b10: 6f 64 65 00 ode. 00003b14 : 3b14: ff ff 4d 6f 64 65 20 63 68 61 6e 67 65 20 69 6e ..Mode change in 3b24: 20 70 72 6f 67 72 65 73 73 2e 2e 2e 00 progress.... 00003b31 : 3b31: ff ff 43 6f 70 79 20 73 65 6c 65 63 74 65 64 20 ..Copy selected 3b41: 6c 61 6e 67 75 61 67 65 3f 00 language?. 00003b4b : 3b4b: ff ff 43 6f 6d 6d 75 6e 69 74 79 20 6d 61 64 65 ..Community made ... 00003b5c : 3b5c: ff ff 53 68 65 65 74 20 25 2e 37 73 0a 5a 20 6f ..Sheet %.7s.Z o 3b6c: 66 66 73 65 74 3a 20 25 2b 31 2e 33 66 6d 6d 0a ffset: %+1.3fmm. 3b7c: 25 63 43 6f 6e 74 69 6e 75 65 0a 25 63 52 65 73 %cContinue.%cRes 3b8c: 65 74 00 et. 00003b8f : 3b8f: ff ff 50 6c 65 61 73 65 20 6c 6f 61 64 20 66 69 ..Please load fi 3b9f: 6c 61 6d 65 6e 74 20 66 69 72 73 74 2e 00 lament first.. 00003bad : 3bad: ff ff 53 65 6c 65 63 74 20 66 69 6c 61 6d 65 6e ..Select filamen 3bbd: 74 3a 00 t:. 00003bc0 : 3bc0: ff ff 3e 43 61 6e 63 65 6c 00 ..>Cancel. 00003bca : 3bca: ff ff 52 75 6e 6e 69 6e 67 20 57 69 7a 61 72 64 ..Running Wizard 3bda: 20 77 69 6c 6c 20 64 65 6c 65 74 65 20 63 75 72 will delete cur 3bea: 72 65 6e 74 20 63 61 6c 69 62 72 61 74 69 6f 6e rent calibration 3bfa: 20 72 65 73 75 6c 74 73 20 61 6e 64 20 73 74 61 results and sta 3c0a: 72 74 20 66 72 6f 6d 20 74 68 65 20 62 65 67 69 rt from the begi 3c1a: 6e 6e 69 6e 67 2e 20 43 6f 6e 74 69 6e 75 65 3f nning. Continue? ... 00003c2b : 3c2b: ff ff 50 72 65 68 65 61 74 69 6e 67 20 6e 6f 7a ..Preheating noz 3c3b: 7a 6c 65 2e 20 50 6c 65 61 73 65 20 77 61 69 74 zle. Please wait 3c4b: 2e 00 .. 00003c4d : 3c4d: ff ff 50 6c 65 61 73 65 20 69 6e 73 65 72 74 20 ..Please insert 3c5d: 66 69 6c 61 6d 65 6e 74 20 69 6e 74 6f 20 74 68 filament into th 3c6d: 65 20 65 78 74 72 75 64 65 72 2c 20 74 68 65 6e e extruder, then 3c7d: 20 70 72 65 73 73 20 74 68 65 20 6b 6e 6f 62 20 press the knob 3c8d: 74 6f 20 6c 6f 61 64 20 69 74 2e 00 to load it.. 00003c99 : 3c99: ff ff 50 6c 65 61 73 65 20 69 6e 73 65 72 74 20 ..Please insert 3ca9: 66 69 6c 61 6d 65 6e 74 20 69 6e 74 6f 20 74 68 filament into th 3cb9: 65 20 66 69 72 73 74 20 74 75 62 65 20 6f 66 20 e first tube of 3cc9: 74 68 65 20 4d 4d 55 2c 20 74 68 65 6e 20 70 72 the MMU, then pr 3cd9: 65 73 73 20 74 68 65 20 6b 6e 6f 62 20 74 6f 20 ess the knob to 3ce9: 6c 6f 61 64 20 69 74 2e 00 load it.. 00003cf2 : 3cf2: ff ff 54 68 65 20 70 72 69 6e 74 65 72 20 77 69 ..The printer wi 3d02: 6c 6c 20 73 74 61 72 74 20 70 72 69 6e 74 69 6e ll start printin 3d12: 67 20 61 20 7a 69 67 2d 7a 61 67 20 6c 69 6e 65 g a zig-zag line 3d22: 2e 20 52 6f 74 61 74 65 20 74 68 65 20 6b 6e 6f . Rotate the kno 3d32: 62 20 75 6e 74 69 6c 20 79 6f 75 20 72 65 61 63 b until you reac 3d42: 68 20 74 68 65 20 6f 70 74 69 6d 61 6c 20 68 65 h the optimal he 3d52: 69 67 68 74 2e 20 43 68 65 63 6b 20 74 68 65 20 ight. Check the 3d62: 70 69 63 74 75 72 65 73 20 69 6e 20 74 68 65 20 pictures in the 3d72: 68 61 6e 64 62 6f 6f 6b 20 28 43 61 6c 69 62 72 handbook (Calibr 3d82: 61 74 69 6f 6e 20 63 68 61 70 74 65 72 29 2e 00 ation chapter).. 00003d92 : 3d92: ff ff 53 65 6c 65 63 74 20 74 65 6d 70 65 72 61 ..Select tempera 3da2: 74 75 72 65 20 77 68 69 63 68 20 6d 61 74 63 68 ture which match 3db2: 65 73 20 79 6f 75 72 20 6d 61 74 65 72 69 61 6c es your material 3dc2: 2e 00 .. 00003dc4 : 3dc4: ff ff 53 65 6c 65 63 74 20 61 20 66 69 6c 61 6d ..Select a filam 3dd4: 65 6e 74 20 66 6f 72 20 74 68 65 20 46 69 72 73 ent for the Firs 3de4: 74 20 4c 61 79 65 72 20 43 61 6c 69 62 72 61 74 t Layer Calibrat 3df4: 69 6f 6e 20 61 6e 64 20 73 65 6c 65 63 74 20 69 ion and select i 3e04: 74 20 69 6e 20 74 68 65 20 6f 6e 2d 73 63 72 65 t in the on-scre 3e14: 65 6e 20 6d 65 6e 75 2e 00 en menu.. 00003e1d : 3e1d: ff ff 4e 6f 77 20 49 20 77 69 6c 6c 20 63 61 6c ..Now I will cal 3e2d: 69 62 72 61 74 65 20 64 69 73 74 61 6e 63 65 20 ibrate distance 3e3d: 62 65 74 77 65 65 6e 20 74 69 70 20 6f 66 20 74 between tip of t 3e4d: 68 65 20 6e 6f 7a 7a 6c 65 20 61 6e 64 20 68 65 he nozzle and he 3e5d: 61 74 62 65 64 20 73 75 72 66 61 63 65 2e 00 atbed surface.. 00003e6c : 3e6c: ff ff 5a 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 ..Z calibration 3e7c: 72 65 63 6f 6d 6d 65 6e 64 65 64 2e 20 52 75 6e recommended. Run 3e8c: 20 69 74 20 6e 6f 77 3f 00 it now?. 00003e95 : 3e95: ff ff 50 6c 65 61 73 65 20 72 65 6d 6f 76 65 20 ..Please remove 3ea5: 73 74 65 65 6c 20 73 68 65 65 74 20 66 72 6f 6d steel sheet from 3eb5: 20 68 65 61 74 62 65 64 2e 00 heatbed.. 00003ebf : 3ebf: ff ff 49 73 20 73 74 65 65 6c 20 73 68 65 65 74 ..Is steel sheet 3ecf: 20 6f 6e 20 68 65 61 74 62 65 64 3f 00 on heatbed?. 00003edc : 3edc: ff ff 50 6c 65 61 73 65 20 63 68 65 63 6b 20 6f ..Please check o 3eec: 75 72 20 68 61 6e 64 62 6f 6f 6b 20 61 6e 64 20 ur handbook and 3efc: 66 69 78 20 74 68 65 20 70 72 6f 62 6c 65 6d 2e fix the problem. 3f0c: 20 54 68 65 6e 20 72 65 73 75 6d 65 20 74 68 65 Then resume the 3f1c: 20 57 69 7a 61 72 64 20 62 79 20 72 65 62 6f 6f Wizard by reboo 3f2c: 74 69 6e 67 20 74 68 65 20 70 72 69 6e 74 65 72 ting the printer 3f3c: 2e 00 .. 00003f3e : 3f3e: ff ff 41 6c 6c 20 69 73 20 64 6f 6e 65 2e 20 48 ..All is done. H 3f4e: 61 70 70 79 20 70 72 69 6e 74 69 6e 67 21 00 appy printing!. 00003f5d : 3f5d: ff ff 59 6f 75 20 63 61 6e 20 61 6c 77 61 79 73 ..You can always 3f6d: 20 72 65 73 75 6d 65 20 74 68 65 20 57 69 7a 61 resume the Wiza 3f7d: 72 64 20 66 72 6f 6d 20 43 61 6c 69 62 72 61 74 rd from Calibrat 3f8d: 69 6f 6e 20 2d 3e 20 57 69 7a 61 72 64 2e 00 ion -> Wizard.. 00003f9c : 3f9c: ff ff 49 66 20 79 6f 75 20 68 61 76 65 20 61 64 ..If you have ad 3fac: 64 69 74 69 6f 6e 61 6c 20 73 74 65 65 6c 20 73 ditional steel s 3fbc: 68 65 65 74 73 2c 20 63 61 6c 69 62 72 61 74 65 heets, calibrate 3fcc: 20 74 68 65 69 72 20 70 72 65 73 65 74 73 20 69 their presets i 3fdc: 6e 20 53 65 74 74 69 6e 67 73 20 2d 20 48 57 20 n Settings - HW 3fec: 53 65 74 75 70 20 2d 20 53 74 65 65 6c 20 73 68 Setup - Steel sh 3ffc: 65 65 74 73 2e 00 eets.. 00004002 : 4002: ff ff 50 6c 65 61 73 65 20 63 6c 65 61 6e 20 68 ..Please clean h 4012: 65 61 74 62 65 64 20 61 6e 64 20 74 68 65 6e 20 eatbed and then 4022: 70 72 65 73 73 20 74 68 65 20 6b 6e 6f 62 2e 00 press the knob.. 00004032 : 4032: ff ff 44 6f 20 79 6f 75 20 77 61 6e 74 20 74 6f ..Do you want to 4042: 20 72 65 70 65 61 74 20 6c 61 73 74 20 73 74 65 repeat last ste 4052: 70 20 74 6f 20 72 65 61 64 6a 75 73 74 20 64 69 p to readjust di 4062: 73 74 61 6e 63 65 20 62 65 74 77 65 65 6e 20 6e stance between n 4072: 6f 7a 7a 6c 65 20 61 6e 64 20 68 65 61 74 62 65 ozzle and heatbe 4082: 64 3f 00 d?. 00004085 : 4085: ff ff 53 65 6c 65 63 74 20 6e 6f 7a 7a 6c 65 20 ..Select nozzle 4095: 70 72 65 68 65 61 74 20 74 65 6d 70 65 72 61 74 preheat temperat 40a5: 75 72 65 20 77 68 69 63 68 20 6d 61 74 63 68 65 ure which matche 40b5: 73 20 79 6f 75 72 20 6d 61 74 65 72 69 61 6c 2e s your material. ... 000040c6 : 40c6: ff ff 49 73 20 66 69 6c 61 6d 65 6e 74 20 6c 6f ..Is filament lo 40d6: 61 64 65 64 3f 00 aded?. 000040dc : 40dc: ff ff 54 68 65 72 6d 61 6c 20 6d 6f 64 65 6c 20 ..Thermal model 40ec: 63 61 6c 2e 20 74 61 6b 65 73 20 61 70 70 72 6f cal. takes appro 40fc: 78 2e 20 31 32 20 6d 69 6e 73 2e 20 53 65 65 0a x. 12 mins. See. 410c: 70 72 75 73 61 2e 69 6f 2f 74 6d 2d 63 61 6c 00 prusa.io/tm-cal. 0000411c : 411c: ff ff 4e 6f 77 20 49 20 77 69 6c 6c 20 70 72 65 ..Now I will pre 412c: 68 65 61 74 20 6e 6f 7a 7a 6c 65 20 66 6f 72 20 heat nozzle for 413c: 50 4c 41 2e 00 PLA.. 00004141 : 4141: ff ff 49 20 77 69 6c 6c 20 72 75 6e 20 7a 20 63 ..I will run z c 4151: 61 6c 69 62 72 61 74 69 6f 6e 20 6e 6f 77 2e 00 alibration now.. 00004161 : 4161: ff ff 4e 6f 77 20 72 65 6d 6f 76 65 20 74 68 65 ..Now remove the 4171: 20 74 65 73 74 20 70 72 69 6e 74 20 66 72 6f 6d test print from 4181: 20 73 74 65 65 6c 20 73 68 65 65 74 2e 00 steel sheet.. 0000418f : 418f: ff ff 50 6c 65 61 73 65 20 72 65 6d 6f 76 65 20 ..Please remove 419f: 73 68 69 70 70 69 6e 67 20 68 65 6c 70 65 72 73 shipping helpers 41af: 20 66 69 72 73 74 2e 00 first.. 000041b7 : 41b7: ff ff 49 20 77 69 6c 6c 20 72 75 6e 20 78 79 7a ..I will run xyz 41c7: 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 6e 6f 77 calibration now 41d7: 2e 20 49 74 20 77 69 6c 6c 20 74 61 6b 65 20 75 . It will take u 41e7: 70 20 74 6f 20 32 34 20 6d 69 6e 73 2e 00 p to 24 mins.. 000041f5 : 41f5: ff ff 46 69 72 73 74 2c 20 49 20 77 69 6c 6c 20 ..First, I will 4205: 72 75 6e 20 74 68 65 20 73 65 6c 66 74 65 73 74 run the selftest 4215: 20 74 6f 20 63 68 65 63 6b 20 6d 6f 73 74 20 63 to check most c 4225: 6f 6d 6d 6f 6e 20 61 73 73 65 6d 62 6c 79 20 70 ommon assembly p 4235: 72 6f 62 6c 65 6d 73 2e 00 roblems.. 0000423e : 423e: ff ff 48 69 2c 20 49 20 61 6d 20 79 6f 75 72 20 ..Hi, I am your 424e: 4f 72 69 67 69 6e 61 6c 20 50 72 75 73 61 20 69 Original Prusa i 425e: 33 20 70 72 69 6e 74 65 72 2e 20 57 6f 75 6c 64 3 printer. Would 426e: 20 79 6f 75 20 6c 69 6b 65 20 6d 65 20 74 6f 20 you like me to 427e: 67 75 69 64 65 20 79 6f 75 20 74 68 72 6f 75 67 guide you throug 428e: 68 20 74 68 65 20 73 65 74 75 70 20 70 72 6f 63 h the setup proc 429e: 65 73 73 3f 00 ess?. 000042a3 : 42a3: ff ff 48 69 2c 20 49 20 61 6d 20 79 6f 75 72 20 ..Hi, I am your 42b3: 4f 72 69 67 69 6e 61 6c 20 50 72 75 73 61 20 69 Original Prusa i 42c3: 33 20 70 72 69 6e 74 65 72 2e 20 49 20 77 69 6c 3 printer. I wil 42d3: 6c 20 67 75 69 64 65 20 79 6f 75 20 74 68 72 6f l guide you thro 42e3: 75 67 68 20 61 20 73 68 6f 72 74 20 73 65 74 75 ugh a short setu 42f3: 70 20 70 72 6f 63 65 73 73 2c 20 69 6e 20 77 68 p process, in wh 4303: 69 63 68 20 74 68 65 20 5a 2d 61 78 69 73 20 77 ich the Z-axis w 4313: 69 6c 6c 20 62 65 20 63 61 6c 69 62 72 61 74 65 ill be calibrate 4323: 64 2e 20 54 68 65 6e 2c 20 79 6f 75 20 77 69 6c d. Then, you wil 4333: 6c 20 62 65 20 72 65 61 64 79 20 74 6f 20 70 72 l be ready to pr 4343: 69 6e 74 2e 00 int.. 00004348 : 4348: ff ff 45 2d 63 6f 72 72 65 63 74 00 ..E-correct. 00004354 : 4354: ff ff 5a 2d 63 6f 72 72 65 63 74 00 ..Z-correct. 00004360 : 4360: ff ff 59 2d 63 6f 72 72 65 63 74 00 ..Y-correct. 0000436c : 436c: ff ff 58 2d 63 6f 72 72 65 63 74 00 ..X-correct. 00004378 : 4378: ff ff 50 61 75 73 65 00 ..Pause. 00004380 : 4380: ff ff 46 53 20 41 63 74 69 6f 6e 00 ..FS Action. 0000438c : 438c: ff ff 43 6f 6e 74 2e 00 ..Cont.. 00004394 : 4394: ff ff 46 2e 20 6a 61 6d 20 64 65 74 65 63 74 00 ..F. jam detect. 000043a4 : 43a4: ff ff 46 2e 20 61 75 74 6f 6c 6f 61 64 00 ..F. autoload. 000043b2 : 43b2: ff ff 46 2e 20 72 75 6e 6f 75 74 00 ..F. runout. 000043be : 43be: ff ff 4d 4d 55 20 4d 6f 64 65 00 ..MMU Mode. 000043c9 : 43c9: ff ff 43 75 74 74 65 72 00 ..Cutter. 000043d2 : 43d2: ff ff 53 74 65 61 6c 74 68 00 ..Stealth. 000043dc : 43dc: ff ff 43 72 61 73 68 20 64 65 74 2e 00 ..Crash det.. 000043e9 : 43e9: ff ff 46 61 6e 20 73 70 65 65 64 00 ..Fan speed. 000043f5 : 43f5: ff ff 42 65 64 00 ..Bed. 000043fb : 43fb: ff ff 46 61 6e 73 20 63 68 65 63 6b 00 ..Fans check. 00004408 : 4408: ff ff 4d 6f 64 65 6c 00 ..Model. 00004410 : 4410: ff ff 4e 6f 7a 7a 6c 65 00 ..Nozzle. 00004419 : 4419: ff ff 50 6c 65 61 73 65 20 75 6e 6c 6f 61 64 20 ..Please unload 4429: 74 68 65 20 66 69 6c 61 6d 65 6e 74 20 66 69 72 the filament fir 4439: 73 74 2c 20 74 68 65 6e 20 72 65 70 65 61 74 20 st, then repeat 4449: 74 68 69 73 20 61 63 74 69 6f 6e 2e 00 this action.. 00004456 : 4456: ff ff 43 68 65 63 6b 73 00 ..Checks. 0000445f : 445f: ff ff 4e 6f 7a 7a 6c 65 20 63 68 61 6e 67 65 00 ..Nozzle change. 0000446f : 446f: ff ff 4e 6f 7a 7a 6c 65 20 64 2e 00 ..Nozzle d.. 0000447b : 447b: ff ff 41 6c 70 68 61 62 65 74 00 ..Alphabet. 00004486 : 4486: ff ff 53 6f 72 74 00 ..Sort. 0000448d : 448d: ff ff 54 69 6d 65 00 ..Time. 00004494 : 4494: ff ff 4e 6f 72 6d 61 6c 00 ..Normal. 0000449d : 449d: ff ff 53 44 20 63 61 72 64 00 ..SD card. 000044a7 : 44a7: ff ff 53 65 6c 65 63 74 20 6c 61 6e 67 75 61 67 ..Select languag 44b7: 65 00 e. 000044b9 : 44b9: ff ff 52 50 69 20 70 6f 72 74 00 ..RPi port. 000044c4 : 44c4: ff ff 4c 69 6e 2e 20 63 6f 72 72 65 63 74 69 6f ..Lin. correctio 44d4: 6e 00 n. 000044d6 : 44d6: ff ff 48 57 20 53 65 74 75 70 00 ..HW Setup. 000044e1 : 44e1: ff ff 4c 6f 61 64 69 6e 67 20 54 65 73 74 00 ..Loading Test. 000044f0 : 44f0: ff ff 44 69 73 61 62 6c 65 20 73 74 65 70 70 65 ..Disable steppe 4500: 72 73 00 rs. 00004503 : 4503: ff ff 4d 6f 76 65 20 61 78 69 73 00 ..Move axis. 0000450f : 450f: ff ff 54 65 6d 70 65 72 61 74 75 72 65 00 ..Temperature. 0000451d : 451d: ff ff 50 49 4e 44 41 20 63 61 6c 2e 00 ..PINDA cal.. 0000452a : 452a: ff ff 52 65 73 65 74 20 58 59 5a 20 63 61 6c 69 ..Reset XYZ cali 453a: 62 72 2e 00 br.. 0000453e : 453e: ff ff 50 49 44 20 63 61 6c 69 62 72 61 74 69 6f ..PID calibratio 454e: 6e 00 n. 00004550 : 4550: ff ff 42 65 64 20 6c 65 76 65 6c 20 63 6f 72 72 ..Bed level corr 4560: 65 63 74 00 ect. 00004564 : 4564: ff ff 4d 65 73 68 20 42 65 64 20 4c 65 76 65 6c ..Mesh Bed Level 4574: 69 6e 67 00 ing. 00004578 : 4578: ff ff 43 61 6c 69 62 72 61 74 65 20 5a 00 ..Calibrate Z. 00004586 : 4586: ff ff 43 61 6c 69 62 72 61 74 65 20 58 59 5a 00 ..Calibrate XYZ. 00004596 : 4596: ff ff 53 65 6c 66 74 65 73 74 00 ..Selftest. 000045a1 : 45a1: ff ff 42 65 6c 74 20 74 65 73 74 00 ..Belt test. 000045ad : 45ad: ff ff 57 69 7a 61 72 64 00 ..Wizard. 000045b6 : 45b6: ff ff 54 65 73 74 69 6e 67 20 66 69 6c 61 6d 65 ..Testing filame 45c6: 6e 74 00 nt. 000045c9 : 45c9: ff ff 4c 6f 61 64 20 41 6c 6c 00 ..Load All. 000045d4 : 45d4: ff ff 50 6c 65 61 73 65 20 70 75 6c 6c 20 6f 75 ..Please pull ou 45e4: 74 20 66 69 6c 61 6d 65 6e 74 20 69 6d 6d 65 64 t filament immed 45f4: 69 61 74 65 6c 79 00 iately. 000045fb : 45fb: ff ff 52 65 73 65 74 00 ..Reset. 00004603 : 4603: ff ff 52 65 6e 61 6d 65 00 ..Rename. 0000460c : 460c: ff ff 46 69 72 73 74 20 6c 61 79 65 72 20 63 61 ..First layer ca 461c: 6c 2e 00 l.. 0000461f : 461f: ff ff 53 65 6c 65 63 74 00 ..Select. 00004628 : 4628: ff ff 53 74 65 65 6c 20 73 68 65 65 74 73 00 ..Steel sheets. 00004637 : 4637: ff ff 53 75 70 70 6f 72 74 00 ..Support. 00004641 : 4641: ff ff 46 61 69 6c 20 73 74 61 74 73 20 4d 4d 55 ..Fail stats MMU ... 00004652 : 4652: ff ff 46 61 69 6c 20 73 74 61 74 73 00 ..Fail stats. 0000465f : 465f: ff ff 53 74 61 74 69 73 74 69 63 73 00 ..Statistics. 0000466c : 466c: ff ff 43 61 6c 69 62 72 61 74 69 6f 6e 00 ..Calibration. 0000467a : 467a: ff ff 41 75 74 6f 4c 6f 61 64 20 66 69 6c 61 6d ..AutoLoad filam 468a: 65 6e 74 00 ent. 0000468e : 468e: ff ff 4c 6f 61 64 20 66 69 6c 61 6d 65 6e 74 00 ..Load filament. 0000469e : 469e: ff ff 55 6e 6c 6f 61 64 20 66 69 6c 61 6d 65 6e ..Unload filamen 46ae: 74 00 t. 000046b0 : 46b0: ff ff 4c 6f 61 64 20 74 6f 20 6e 6f 7a 7a 6c 65 ..Load to nozzle ... 000046c1 : 46c1: ff ff 50 72 65 6c 6f 61 64 20 74 6f 20 4d 4d 55 ..Preload to MMU ... 000046d2 : 46d2: ff ff 4e 6f 20 53 44 20 63 61 72 64 00 ..No SD card. 000046df : 46df: ff ff 50 72 69 6e 74 20 66 72 6f 6d 20 53 44 00 ..Print from SD. 000046ef : 46ef: ff ff 43 6c 65 61 72 20 54 4d 20 65 72 72 6f 72 ..Clear TM error ... 00004700 : 4700: ff ff 52 65 73 75 6d 65 20 70 72 69 6e 74 00 ..Resume print. 0000470f : 470f: ff ff 50 61 75 73 65 20 70 72 69 6e 74 00 ..Pause print. 0000471d : 471d: ff ff 53 65 74 20 52 65 61 64 79 00 ..Set Ready. 00004729 : 4729: ff ff 53 65 74 20 6e 6f 74 20 52 65 61 64 79 00 ..Set not Ready. 00004739 : 4739: ff ff 50 72 65 68 65 61 74 00 ..Preheat. 00004743 : 4743: ff ff 54 75 6e 65 00 ..Tune. 0000474a : 474a: ff ff 4c 69 76 65 20 61 64 6a 75 73 74 20 5a 00 ..Live adjust Z. 0000475a : 475a: ff ff 52 65 70 72 69 6e 74 00 ..Reprint. 00004764 : 4764: ff ff 49 6e 66 6f 20 73 63 72 65 65 6e 00 ..Info screen. 00004772 : 4772: ff ff 42 72 69 67 68 74 6e 65 73 73 00 ..Brightness. 0000477f : 477f: ff ff 41 73 73 69 73 74 00 ..Assist. 00004788 : 4788: ff ff 53 69 6c 65 6e 74 00 ..Silent. 00004791 : 4791: ff ff 4f 6e 63 65 00 ..Once. 00004798 : 4798: ff ff 53 6f 75 6e 64 00 ..Sound. 000047a0 : 47a0: ff ff 4c 6f 75 64 00 ..Loud. 000047a7 : 47a7: ff ff 46 69 6c 2e 20 73 65 6e 73 6f 72 00 ..Fil. sensor. 000047b5 : 47b5: ff ff 43 68 61 6e 67 65 20 66 69 6c 61 6d 65 6e ..Change filamen 47c5: 74 00 t. 000047c7 : 47c7: ff ff 46 6c 6f 77 00 ..Flow. 000047ce : 47ce: ff ff 53 70 65 65 64 00 ..Speed. 000047d6 : 47d6: ff ff 4d 61 67 6e 65 74 73 20 63 6f 6d 70 2e 00 ..Magnets comp.. 000047e6 : 47e6: ff ff 4e 2f 41 00 ..N/A. 000047ec : 47ec: ff ff 5a 2d 70 72 6f 62 65 20 6e 72 2e 00 ..Z-probe nr.. 000047fa : 47fa: ff ff 4d 65 73 68 00 ..Mesh. 00004801 : 4801: ff ff 54 69 6d 65 6f 75 74 00 ..Timeout. 0000480b : 480b: ff ff 4d 6f 64 65 00 ..Mode. 00004812 : 4812: ff ff 41 75 74 6f 00 ..Auto. 00004819 : 4819: ff ff 44 69 6d 00 ..Dim. 0000481f : 481f: ff ff 42 72 69 67 68 74 00 ..Bright. 00004828 : 4828: ff ff 4c 65 76 65 6c 20 44 69 6d 6d 65 64 00 ..Level Dimmed. 00004837 : 4837: ff ff 4c 65 76 65 6c 20 42 72 69 67 68 74 00 ..Level Bright. 00004846 : 4846: ff ff 53 65 74 74 69 6e 67 73 00 ..Settings. 00004851 : 4851: ff ff 59 65 73 00 ..Yes. 00004857 : 4857: ff ff 4e 6f 00 ..No. 0000485c : 485c: ff ff 53 74 6f 70 20 70 72 69 6e 74 00 ..Stop print. 00004869 : 4869: ff ff 43 68 65 63 6b 69 6e 67 20 66 69 6c 65 00 ..Checking file. 00004879 : 4879: ff ff 46 69 6c 65 20 69 6e 63 6f 6d 70 6c 65 74 ..File incomplet 4889: 65 2e 20 43 6f 6e 74 69 6e 75 65 20 61 6e 79 77 e. Continue anyw 4899: 61 79 3f 00 ay?. 0000489d : 489d: ff ff 84 52 65 66 72 65 73 68 00 ...Refresh. 000048a8 : 48a8: ff ff 4d 61 69 6e 00 ..Main. 000048af : 48af: ff ff 57 61 69 74 69 6e 67 20 66 6f 72 20 6e 6f ..Waiting for no 48bf: 7a 7a 6c 65 20 61 6e 64 20 62 65 64 20 63 6f 6f zzle and bed coo 48cf: 6c 69 6e 67 00 ling. 000048d4 : 48d4: ff ff 53 65 6c 66 74 65 73 74 20 4f 4b 00 ..Selftest OK. 000048e2 : 48e2: ff ff 53 65 6c 66 74 65 73 74 20 73 74 61 72 74 ..Selftest start ... 000048f3 : 48f3: ff ff 50 72 69 6e 74 20 66 61 6e 3a 00 ..Print fan:. 00004900 : 4900: ff ff 48 6f 74 65 6e 64 20 66 61 6e 3a 00 ..Hotend fan:. 0000490e : 490e: ff ff 43 61 6c 69 62 72 61 74 69 6e 67 20 68 6f ..Calibrating ho 491e: 6d 65 00 me. 00004921 : 4921: ff ff 41 6c 6c 20 63 6f 72 72 65 63 74 00 ..All correct. 0000492f : 492f: ff ff 43 68 65 63 6b 69 6e 67 20 73 65 6e 73 6f ..Checking senso 493f: 72 73 00 rs. 00004942 : 4942: ff ff 43 68 65 63 6b 69 6e 67 20 68 6f 74 65 6e ..Checking hoten 4952: 64 00 d. 00004954 : 4954: ff ff 43 68 65 63 6b 69 6e 67 20 62 65 64 00 ..Checking bed. 00004963 : 4963: ff ff 43 68 65 63 6b 69 6e 67 20 5a 20 61 78 69 ..Checking Z axi 4973: 73 00 s. 00004975 : 4975: ff ff 43 68 65 63 6b 69 6e 67 20 59 20 61 78 69 ..Checking Y axi 4985: 73 00 s. 00004987 : 4987: ff ff 43 68 65 63 6b 69 6e 67 20 58 20 61 78 69 ..Checking X axi 4997: 73 00 s. 00004999 : 4999: ff ff 43 68 65 63 6b 69 6e 67 20 65 6e 64 73 74 ..Checking endst 49a9: 6f 70 73 00 ops. 000049ad : 49ad: ff ff 43 61 72 64 20 72 65 6d 6f 76 65 64 00 ..Card removed. 000049bc : 49bc: ff ff 42 61 63 6b 00 ..Back. 000049c3 : 49c3: ff ff 53 74 72 69 63 74 00 ..Strict. 000049cc : 49cc: ff ff 57 61 72 6e 00 ..Warn. 000049d3 : 49d3: ff ff 4e 6f 6e 65 00 ..None. 000049da : 49da: ff ff 48 6f 74 65 6e 64 20 61 74 20 32 38 30 43 ..Hotend at 280C 49ea: 21 20 4e 6f 7a 7a 6c 65 20 63 68 61 6e 67 65 64 ! Nozzle changed 49fa: 20 61 6e 64 20 74 69 67 68 74 65 6e 65 64 20 74 and tightened t 4a0a: 6f 20 73 70 65 63 73 3f 00 o specs?. 00004a13 : 4a13: ff ff 46 6f 72 20 61 20 4e 6f 7a 7a 6c 65 20 63 ..For a Nozzle c 4a23: 68 61 6e 67 65 20 70 6c 65 61 73 65 20 72 65 61 hange please rea 4a33: 64 0a 70 72 75 73 61 2e 69 6f 2f 6e 6f 7a 7a 6c d.prusa.io/nozzl 4a43: 65 2d 6d 6b 33 73 00 e-mk3s. 00004a4a : 4a4a: ff ff 50 49 44 20 63 61 6c 2e 20 66 69 6e 69 73 ..PID cal. finis 4a5a: 68 65 64 00 hed. 00004a5e : 4a5e: ff ff 50 49 44 20 63 61 6c 2e 00 ..PID cal.. 00004a69 : 4a69: ff ff 50 72 69 6e 74 20 70 61 75 73 65 64 00 ..Print paused. 00004a78 : 4a78: ff ff 50 72 69 6e 74 20 61 62 6f 72 74 65 64 00 ..Print aborted. 00004a88 : 4a88: ff ff 4e 6f 7a 7a 6c 65 20 64 69 61 6d 65 74 65 ..Nozzle diamete 4a98: 72 20 64 69 66 66 65 72 73 20 66 72 6f 6d 20 74 r differs from t 4aa8: 68 65 20 47 2d 63 6f 64 65 2e 20 43 6f 6e 74 69 he G-code. Conti 4ab8: 6e 75 65 3f 00 nue?. 00004abd : 4abd: ff ff 4e 6f 7a 7a 6c 65 20 64 69 61 6d 65 74 65 ..Nozzle diamete 4acd: 72 20 64 69 66 66 65 72 73 20 66 72 6f 6d 20 74 r differs from t 4add: 68 65 20 47 2d 63 6f 64 65 2e 20 50 6c 65 61 73 he G-code. Pleas 4aed: 65 20 63 68 65 63 6b 20 74 68 65 20 76 61 6c 75 e check the valu 4afd: 65 20 69 6e 20 73 65 74 74 69 6e 67 73 2e 20 50 e in settings. P 4b0d: 72 69 6e 74 20 63 61 6e 63 65 6c 6c 65 64 2e 00 rint cancelled.. 00004b1d : 4b1d: ff ff 54 68 65 72 65 20 69 73 20 6e 6f 20 66 69 ..There is no fi 4b2d: 6c 61 6d 65 6e 74 20 6c 6f 61 64 65 64 2e 20 43 lament loaded. C 4b3d: 6f 6e 74 69 6e 75 65 3f 00 ontinue?. 00004b46 : 4b46: ff ff 54 68 65 72 65 20 69 73 20 6e 6f 20 66 69 ..There is no fi 4b56: 6c 61 6d 65 6e 74 20 6c 6f 61 64 65 64 2e 20 50 lament loaded. P 4b66: 72 69 6e 74 20 63 61 6e 63 65 6c 6c 65 64 2e 00 rint cancelled.. 00004b76 : 4b76: ff ff 4d 4b 33 20 66 69 72 6d 77 61 72 65 20 64 ..MK3 firmware d 4b86: 65 74 65 63 74 65 64 20 6f 6e 20 4d 4b 33 53 20 etected on MK3S 4b96: 70 72 69 6e 74 65 72 00 printer. 00004b9e : 4b9e: ff ff 42 6c 61 63 6b 6f 75 74 20 6f 63 63 75 72 ..Blackout occur 4bae: 72 65 64 2e 20 52 65 63 6f 76 65 72 20 70 72 69 red. Recover pri 4bbe: 6e 74 3f 00 nt?. 00004bc2 : 4bc2: ff ff 54 68 65 72 6d 61 6c 20 6d 6f 64 65 6c 20 ..Thermal model 4bd2: 6e 6f 74 20 63 61 6c 69 62 72 61 74 65 64 20 79 not calibrated y 4be2: 65 74 2e 00 et.. 00004be6 : 4be6: ff ff 54 68 65 72 65 20 69 73 20 73 74 69 6c 6c ..There is still 4bf6: 20 61 20 6e 65 65 64 20 74 6f 20 6d 61 6b 65 20 a need to make 4c06: 5a 20 63 61 6c 69 62 72 61 74 69 6f 6e 2e 20 50 Z calibration. P 4c16: 6c 65 61 73 65 20 66 6f 6c 6c 6f 77 20 74 68 65 lease follow the 4c26: 20 6d 61 6e 75 61 6c 2c 20 63 68 61 70 74 65 72 manual, chapter 4c36: 20 46 69 72 73 74 20 73 74 65 70 73 2c 20 73 65 First steps, se 4c46: 63 74 69 6f 6e 20 43 61 6c 69 62 72 61 74 69 6f ction Calibratio 4c56: 6e 20 66 6c 6f 77 2e 00 n flow.. 00004c5e : 4c5e: ff ff 50 72 69 6e 74 65 72 20 68 61 73 20 6e 6f ..Printer has no 4c6e: 74 20 62 65 65 6e 20 63 61 6c 69 62 72 61 74 65 t been calibrate 4c7e: 64 20 79 65 74 2e 20 50 6c 65 61 73 65 20 66 6f d yet. Please fo 4c8e: 6c 6c 6f 77 20 74 68 65 20 6d 61 6e 75 61 6c 2c llow the manual, 4c9e: 20 63 68 61 70 74 65 72 20 46 69 72 73 74 20 73 chapter First s 4cae: 74 65 70 73 2c 20 73 65 63 74 69 6f 6e 20 43 61 teps, section Ca 4cbe: 6c 69 62 72 61 74 69 6f 6e 20 66 6c 6f 77 2e 00 libration flow.. 00004cce : 4cce: ff ff 53 65 6c 66 74 65 73 74 20 77 69 6c 6c 20 ..Selftest will 4cde: 62 65 20 72 75 6e 20 74 6f 20 63 61 6c 69 62 72 be run to calibr 4cee: 61 74 65 20 61 63 63 75 72 61 74 65 20 73 65 6e ate accurate sen 4cfe: 73 6f 72 6c 65 73 73 20 72 65 68 6f 6d 69 6e 67 sorless rehoming 4d0e: 2e 00 .. 00004d10 : 4d10: ff ff 4f 6c 64 20 73 65 74 74 69 6e 67 73 20 66 ..Old settings f 4d20: 6f 75 6e 64 2e 20 44 65 66 61 75 6c 74 20 50 49 ound. Default PI 4d30: 44 2c 20 45 73 74 65 70 73 20 65 74 63 2e 20 77 D, Esteps etc. w 4d40: 69 6c 6c 20 62 65 20 73 65 74 2e 00 ill be set.. 00004d4c : 4d4c: ff ff 57 61 72 6e 69 6e 67 3a 20 62 6f 74 68 20 ..Warning: both 4d5c: 70 72 69 6e 74 65 72 20 74 79 70 65 20 61 6e 64 printer type and 4d6c: 20 6d 6f 74 68 65 72 62 6f 61 72 64 20 74 79 70 motherboard typ 4d7c: 65 20 63 68 61 6e 67 65 64 2e 00 e changed.. 00004d87 : 4d87: ff ff 57 61 72 6e 69 6e 67 3a 20 70 72 69 6e 74 ..Warning: print 4d97: 65 72 20 74 79 70 65 20 63 68 61 6e 67 65 64 2e er type changed. ... 00004da8 : 4da8: ff ff 57 61 72 6e 69 6e 67 3a 20 6d 6f 74 68 65 ..Warning: mothe 4db8: 72 62 6f 61 72 64 20 74 79 70 65 20 63 68 61 6e rboard type chan 4dc8: 67 65 64 2e 00 ged.. 00004dcd : 4dcd: ff ff 53 68 65 65 74 00 ..Sheet. 00004dd5 : 4dd5: ff ff 52 65 63 6f 76 65 72 69 6e 67 20 70 72 69 ..Recovering pri 4de5: 6e 74 00 nt. 00004de8 : 4de8: ff ff 54 48 45 52 4d 41 4c 20 41 4e 4f 4d 41 4c ..THERMAL ANOMAL 4df8: 59 00 Y. 00004dfa : 4dfa: ff ff 52 65 73 75 6d 69 6e 67 20 70 72 69 6e 74 ..Resuming print ... 00004e0b : 4e0b: ff ff 50 49 4e 44 41 20 48 65 61 74 69 6e 67 00 ..PINDA Heating. 00004e1b : 4e1b: ff ff 43 61 6c 69 62 72 61 74 69 6f 6e 20 64 6f ..Calibration do 4e2b: 6e 65 00 ne. 00004e2e : 4e2e: ff ff 43 61 6c 69 62 72 61 74 69 6e 67 20 5a 00 ..Calibrating Z. 00004e3e : 4e3e: ff ff 42 65 64 20 64 6f 6e 65 00 ..Bed done. 00004e49 : 4e49: ff ff 42 65 64 20 48 65 61 74 69 6e 67 00 ..Bed Heating. 00004e57 : 4e57: ff ff 48 65 61 74 69 6e 67 20 64 6f 6e 65 2e 00 ..Heating done.. 00004e67 : 4e67: ff ff 48 65 61 74 69 6e 67 00 ..Heating. 00004e71 : 4e71: ff ff 4d 4d 55 20 66 61 69 6c 73 00 ..MMU fails. 00004e7d : 4e7d: ff ff 4d 4d 55 20 6c 6f 61 64 20 66 61 69 6c 73 ..MMU load fails ... 00004e8e : 4e8e: ff ff 4d 4d 55 20 70 6f 77 65 72 20 66 61 69 6c ..MMU power fail 4e9e: 73 00 s. 00004ea0 : 4ea0: ff ff 4d 61 74 65 72 69 61 6c 20 63 68 61 6e 67 ..Material chang 4eb0: 65 73 00 es. 00004eb3 : 4eb3: ff ff 54 6f 74 61 6c 20 66 61 69 6c 75 72 65 73 ..Total failures ... 00004ec4 : 4ec4: ff ff 4c 61 73 74 20 70 72 69 6e 74 20 66 61 69 ..Last print fai 4ed4: 6c 75 72 65 73 00 lures. 00004eda : 4eda: ff ff 50 6f 77 65 72 20 66 61 69 6c 75 72 65 73 ..Power failures ... 00004eeb : 4eeb: ff ff 46 69 6c 2e 20 72 75 6e 6f 75 74 73 00 ..Fil. runouts. 00004efa : 4efa: ff ff 43 72 61 73 68 00 ..Crash. 00004f02 : 4f02: ff ff 54 6f 74 61 6c 00 ..Total. 00004f0a : 4f0a: ff ff 4c 61 73 74 20 70 72 69 6e 74 00 ..Last print. 00004f17 : 4f17: ff ff 41 6d 62 69 65 6e 74 00 ..Ambient. 00004f21 : 4f21: ff ff 56 6f 6c 74 61 67 65 73 00 ..Voltages. 00004f2c : 4f2c: ff ff 54 65 6d 70 65 72 61 74 75 72 65 73 00 ..Temperatures. 00004f3b : 4f3b: ff ff 42 65 6c 74 20 73 74 61 74 75 73 00 ..Belt status. 00004f49 : 4f49: ff ff 53 65 6e 73 6f 72 20 69 6e 66 6f 00 ..Sensor info. 00004f57 : 4f57: ff ff 45 78 74 72 75 64 65 72 20 69 6e 66 6f 00 ..Extruder info. 00004f67 : 4f67: ff ff 58 59 5a 20 63 61 6c 2e 20 64 65 74 61 69 ..XYZ cal. detai 4f77: 6c 73 00 ls. 00004f7a : 4f7a: ff ff 50 72 69 6e 74 65 72 20 49 50 20 41 64 64 ..Printer IP Add 4f8a: 72 3a 00 r:. 00004f8d : 4f8d: ff ff 75 6e 6b 6e 6f 77 6e 00 ..unknown. 00004f97 : 4f97: ff ff 4d 4d 55 20 63 6f 6e 6e 65 63 74 65 64 00 ..MMU connected. 00004fa7 : 4fa7: ff ff 44 61 74 65 3a 00 ..Date:. 00004faf : 4faf: ff ff 74 6f 20 75 6e 6c 6f 61 64 20 66 69 6c 61 ..to unload fila 4fbf: 6d 65 6e 74 00 ment. 00004fc4 : 4fc4: ff ff 74 6f 20 6c 6f 61 64 20 66 69 6c 61 6d 65 ..to load filame 4fd4: 6e 74 00 nt. 00004fd7 : 4fd7: ff ff 50 72 65 73 73 20 74 68 65 20 6b 6e 6f 62 ..Press the knob ... 00004fe8 : 4fe8: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 4ff8: 63 75 74 00 cut. 00004ffc : 4ffc: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 500c: 65 6a 65 63 74 00 eject. 00005012 : 5012: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 5022: 75 6e 6c 6f 61 64 00 unload. 00005029 : 5029: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 5039: 6c 6f 61 64 00 load. 0000503e : 503e: ff ff 43 6f 6f 6c 64 6f 77 6e 00 ..Cooldown. 00005049 : 5049: ff ff 46 69 6c 61 6d 65 6e 74 20 65 78 74 72 75 ..Filament extru 5059: 64 69 6e 67 20 26 20 77 69 74 68 20 63 6f 72 72 ding & with corr 5069: 65 63 74 20 63 6f 6c 6f 72 3f 00 ect color?. 00005074 : 5074: ff ff 45 6a 65 63 74 00 ..Eject. 0000507c : 507c: ff ff 41 75 74 6f 6c 6f 61 64 69 6e 67 20 66 69 ..Autoloading fi 508c: 6c 61 6d 65 6e 74 20 69 73 20 61 63 74 69 76 65 lament is active 509c: 2c 20 6a 75 73 74 20 70 72 65 73 73 20 74 68 65 , just press the 50ac: 20 6b 6e 6f 62 20 61 6e 64 20 69 6e 73 65 72 74 knob and insert 50bc: 20 66 69 6c 61 6d 65 6e 74 2e 2e 2e 00 filament.... 000050c9 : 50c9: ff ff 54 6f 74 61 6c 20 66 69 6c 61 6d 65 6e 74 ..Total filament ... 000050da : 50da: ff ff 54 6f 74 61 6c 20 70 72 69 6e 74 20 74 69 ..Total print ti 50ea: 6d 65 00 me. 000050ed : 50ed: ff ff 46 69 6c 61 6d 65 6e 74 20 75 73 65 64 00 ..Filament used. 000050fd : 50fd: ff ff 50 72 69 6e 74 20 74 69 6d 65 00 ..Print time. 0000510a : 510a: ff ff 50 72 65 68 65 61 74 20 74 68 65 20 6e 6f ..Preheat the no 511a: 7a 7a 6c 65 21 00 zzle!. 00005120 : 5120: ff ff 45 52 52 4f 52 3a 00 ..ERROR:. 00005129 : 5129: ff ff 59 20 64 69 73 74 61 6e 63 65 20 66 72 6f ..Y distance fro 5139: 6d 20 6d 69 6e 00 m min. 0000513f : 513f: ff ff 4c 65 66 74 00 ..Left. 00005146 : 5146: ff ff 52 69 67 68 74 00 ..Right. 0000514e : 514e: ff ff 4d 65 61 73 75 72 65 64 20 73 6b 65 77 00 ..Measured skew. 0000515e : 515e: ff ff 53 6c 69 67 68 74 20 73 6b 65 77 00 ..Slight skew. 0000516c : 516c: ff ff 53 65 76 65 72 65 20 73 6b 65 77 00 ..Severe skew. 0000517a : 517a: ff ff 5b 30 3b 30 5d 20 70 6f 69 6e 74 20 6f 66 ..[0;0] point of 518a: 66 73 65 74 00 fset. 0000518f : 518f: ff ff 41 64 6a 75 73 74 69 6e 67 20 5a 00 ..Adjusting Z. 0000519d : 519d: ff ff 52 65 61 72 20 73 69 64 65 20 5b e4 6d 5d ..Rear side [.m] ... 000051ae : 51ae: ff ff 46 72 6f 6e 74 20 73 69 64 65 5b e4 6d 5d ..Front side[.m] ... 000051bf : 51bf: ff ff 52 69 67 68 74 20 73 69 64 65 5b e4 6d 5d ..Right side[.m] ... 000051d0 : 51d0: ff ff 4c 65 66 74 20 73 69 64 65 20 5b e4 6d 5d ..Left side [.m] ... 000051e1 : 51e1: ff ff 53 65 74 20 74 65 6d 70 65 72 61 74 75 72 ..Set temperatur 51f1: 65 3a 00 e:. 000051f4 : 51f4: ff ff 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 ..PINDA calibrat 5204: 69 6f 6e 20 66 61 69 6c 65 64 00 ion failed. 0000520f : 520f: ff ff 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 ..PINDA calibrat 521f: 69 6f 6e 20 69 73 20 66 69 6e 69 73 68 65 64 20 ion is finished 522f: 61 6e 64 20 61 63 74 69 76 65 2e 20 49 74 20 63 and active. It c 523f: 61 6e 20 62 65 20 64 69 73 61 62 6c 65 64 20 69 an be disabled i 524f: 6e 20 6d 65 6e 75 20 53 65 74 74 69 6e 67 73 2d n menu Settings- 525f: 3e 50 49 4e 44 41 20 63 61 6c 2e 00 >PINDA cal.. 0000526b : 526b: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 46 53 65 ..Feeding to FSe 527b: 6e 73 6f 72 00 nsor. 00005280 : 5280: ff ff 4d 6f 76 69 6e 67 20 73 65 6c 65 63 74 6f ..Moving selecto 5290: 72 00 r. 00005292 : 5292: ff ff 48 6f 6d 69 6e 67 00 ..Homing. 0000529b : 529b: ff ff 52 65 74 72 61 63 74 20 66 72 6f 6d 20 46 ..Retract from F 52ab: 49 4e 44 41 00 INDA. 000052b0 : 52b0: ff ff 45 6a 65 63 74 69 6e 67 20 66 69 6c 61 6d ..Ejecting filam 52c0: 65 6e 74 00 ent. 000052c4 : 52c4: ff ff 50 61 72 6b 69 6e 67 20 73 65 6c 65 63 74 ..Parking select 52d4: 6f 72 00 or. 000052d7 : 52d7: ff ff 52 65 74 75 72 6e 69 6e 67 20 73 65 6c 65 ..Returning sele 52e7: 63 74 6f 72 00 ctor. 000052ec : 52ec: ff ff 50 65 72 66 6f 72 6d 69 6e 67 20 63 75 74 ..Performing cut ... 000052fd : 52fd: ff ff 50 75 73 68 69 6e 67 20 66 69 6c 61 6d 65 ..Pushing filame 530d: 6e 74 00 nt. 00005310 : 5310: ff ff 50 72 65 70 61 72 69 6e 67 20 62 6c 61 64 ..Preparing blad 5320: 65 00 e. 00005322 : 5322: ff ff 53 65 6c 65 63 74 69 6e 67 20 66 69 6c 2e ..Selecting fil. 5332: 20 73 6c 6f 74 00 slot. 00005338 : 5338: ff ff 55 6e 6c 6f 61 64 69 6e 67 20 66 69 6c 61 ..Unloading fila 5348: 6d 65 6e 74 00 ment. 0000534d : 534d: ff ff 45 52 52 20 54 4d 43 20 66 61 69 6c 65 64 ..ERR TMC failed ... 0000535e : 535e: ff ff 45 52 52 20 48 65 6c 70 20 66 69 6c 61 6d ..ERR Help filam 536e: 65 6e 74 00 ent. 00005372 : 5372: ff ff 45 52 52 20 49 6e 74 65 72 6e 61 6c 00 ..ERR Internal. 00005381 : 5381: ff ff 45 52 52 20 57 61 69 74 20 66 6f 72 20 55 ..ERR Wait for U 5391: 73 65 72 00 ser. 00005395 : 5395: ff ff 46 69 6e 69 73 68 69 6e 67 20 6d 6f 76 65 ..Finishing move 53a5: 6d 65 6e 74 73 00 ments. 000053ab : 53ab: ff ff 41 76 6f 69 64 69 6e 67 20 67 72 69 6e 64 ..Avoiding grind ... 000053bc : 53bc: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 6e 6f 7a ..Feeding to noz 53cc: 7a 6c 65 00 zle. 000053d0 : 53d0: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 65 78 74 ..Feeding to ext 53e0: 72 75 64 65 72 00 ruder. 000053e6 : 53e6: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 46 49 4e ..Feeding to FIN 53f6: 44 41 00 DA. 000053f9 : 53f9: ff ff 55 6e 6c 6f 61 64 69 6e 67 20 74 6f 20 70 ..Unloading to p 5409: 75 6c 6c 65 79 00 ulley. 0000540f : 540f: ff ff 55 6e 6c 6f 61 64 69 6e 67 20 74 6f 20 46 ..Unloading to F 541f: 49 4e 44 41 00 INDA. 00005424 : 5424: ff ff 44 69 73 65 6e 67 61 67 69 6e 67 20 69 64 ..Disengaging id 5434: 6c 65 72 00 ler. 00005438 : 5438: ff ff 45 6e 67 61 67 69 6e 67 20 69 64 6c 65 72 ..Engaging idler ... 00005449 : 5449: ff ff 4f 4b 00 ..OK. 0000544e <_ZN4MMU2L23MSG_TITLE_UNKNOWN_ERRORE.lto_priv.528>: 544e: ff ff 55 4e 4b 4e 4f 57 4e 20 45 52 52 4f 52 00 ..UNKNOWN ERROR. 0000545e <_ZN4MMU2L25MSG_TITLE_FILAMENT_CHANGEE.lto_priv.527>: 545e: ff ff 46 49 4c 41 4d 45 4e 54 20 43 48 41 4e 47 ..FILAMENT CHANG 546e: 45 00 E. 00005470 <_ZN4MMU2L26MSG_TITLE_FILAMENT_EJECTEDE.lto_priv.526>: 5470: ff ff 46 49 4c 41 4d 45 4e 54 20 45 4a 45 43 54 ..FILAMENT EJECT 5480: 45 44 00 ED. 00005483 <_ZN4MMU2L25MSG_TITLE_UNLOAD_MANUALLYE.lto_priv.525>: 5483: ff ff 55 4e 4c 4f 41 44 20 4d 41 4e 55 41 4c 4c ..UNLOAD MANUALL 5493: 59 00 Y. 00005495 <_ZN4MMU2L26MSG_TITLE_FW_RUNTIME_ERRORE.lto_priv.524>: 5495: ff ff 46 57 20 52 55 4e 54 49 4d 45 20 45 52 52 ..FW RUNTIME ERR 54a5: 4f 52 00 OR. 000054a8 <_ZN4MMU2L26MSG_TITLE_FW_UPDATE_NEEDEDE.lto_priv.523>: 54a8: ff ff 4d 4d 55 20 46 57 20 55 50 44 41 54 45 20 ..MMU FW UPDATE 54b8: 4e 45 45 44 45 44 00 NEEDED. 000054bf <_ZN4MMU2L20MSG_TITLE_QUEUE_FULLE.lto_priv.522>: 54bf: ff ff 51 55 45 55 45 20 46 55 4c 4c 00 ..QUEUE FULL. 000054cc <_ZN4MMU2L22MSG_TITLE_INVALID_TOOLE.lto_priv.521>: 54cc: ff ff 49 4e 56 41 4c 49 44 20 54 4f 4f 4c 00 ..INVALID TOOL. 000054db <_ZN4MMU2L33MSG_TITLE_FILAMENT_ALREADY_LOADEDE.lto_priv.520>: 54db: ff ff 46 49 4c 2e 20 41 4c 52 45 41 44 59 20 4c ..FIL. ALREADY L 54eb: 4f 41 44 45 44 00 OADED. 000054f1 <_ZN4MMU2L29MSG_TITLE_COMMUNICATION_ERRORE.lto_priv.519>: 54f1: ff ff 43 4f 4d 4d 55 4e 49 43 41 54 49 4f 4e 20 ..COMMUNICATION 5501: 45 52 52 4f 52 00 ERROR. 00005507 <_ZN4MMU2L28MSG_TITLE_MMU_NOT_RESPONDINGE.lto_priv.518>: 5507: ff ff 4d 4d 55 20 4e 4f 54 20 52 45 53 50 4f 4e ..MMU NOT RESPON 5517: 44 49 4e 47 00 DING. 0000551c <_ZN4MMU2L23MSG_TITLE_MMU_MCU_ERRORE.lto_priv.517>: 551c: ff ff 4d 4d 55 20 4d 43 55 20 45 52 52 4f 52 00 ..MMU MCU ERROR. 0000552c <_ZN4MMU2L25MSG_TITLE_SELFTEST_FAILEDE.lto_priv.516>: 552c: ff ff 4d 4d 55 20 53 45 4c 46 54 45 53 54 20 46 ..MMU SELFTEST F 553c: 41 49 4c 45 44 00 AILED. 00005542 <_ZN4MMU2L28MSG_TITLE_TMC_DRIVER_SHORTEDE.lto_priv.515>: 5542: ff ff 54 4d 43 20 44 52 49 56 45 52 20 53 48 4f ..TMC DRIVER SHO 5552: 52 54 45 44 00 RTED. 00005557 <_ZN4MMU2L32MSG_TITLE_TMC_UNDERVOLTAGE_ERRORE.lto_priv.514>: 5557: ff ff 54 4d 43 20 55 4e 44 45 52 56 4f 4c 54 41 ..TMC UNDERVOLTA 5567: 47 45 20 45 52 52 00 GE ERR. 0000556e <_ZN4MMU2L26MSG_TITLE_TMC_DRIVER_RESETE.lto_priv.513>: 556e: ff ff 54 4d 43 20 44 52 49 56 45 52 20 52 45 53 ..TMC DRIVER RES 557e: 45 54 00 ET. 00005581 <_ZN4MMU2L26MSG_TITLE_TMC_DRIVER_ERRORE.lto_priv.512>: 5581: ff ff 54 4d 43 20 44 52 49 56 45 52 20 45 52 52 ..TMC DRIVER ERR 5591: 4f 52 00 OR. 00005594 <_ZN4MMU2L28MSG_TITLE_TMC_OVERHEAT_ERRORE.lto_priv.511>: 5594: ff ff 54 4d 43 20 4f 56 45 52 48 45 41 54 20 45 ..TMC OVERHEAT E 55a4: 52 52 4f 52 00 RROR. 000055a9 <_ZN4MMU2L33MSG_TITLE_TMC_WARNING_TMC_TOO_HOTE.lto_priv.510>: 55a9: ff ff 57 41 52 4e 49 4e 47 20 54 4d 43 20 54 4f ..WARNING TMC TO 55b9: 4f 20 48 4f 54 00 O HOT. 000055bf <_ZN4MMU2L27MSG_TITLE_IDLER_CANNOT_MOVEE.lto_priv.509>: 55bf: ff ff 49 44 4c 45 52 20 43 41 4e 4e 4f 54 20 4d ..IDLER CANNOT M 55cf: 4f 56 45 00 OVE. 000055d3 <_ZN4MMU2L27MSG_TITLE_IDLER_CANNOT_HOMEE.lto_priv.508>: 55d3: ff ff 49 44 4c 45 52 20 43 41 4e 4e 4f 54 20 48 ..IDLER CANNOT H 55e3: 4f 4d 45 00 OME. 000055e7 <_ZN4MMU2L30MSG_TITLE_SELECTOR_CANNOT_MOVEE.lto_priv.507>: 55e7: ff ff 53 45 4c 45 43 54 4f 52 20 43 41 4e 4e 4f ..SELECTOR CANNO 55f7: 54 20 4d 4f 56 45 00 T MOVE. 000055fe <_ZN4MMU2L30MSG_TITLE_SELECTOR_CANNOT_HOMEE.lto_priv.506>: 55fe: ff ff 53 45 4c 45 43 54 4f 52 20 43 41 4e 4e 4f ..SELECTOR CANNO 560e: 54 20 48 4f 4d 45 00 T HOME. 00005615 <_ZN4MMU2L33MSG_TITLE_LOAD_TO_EXTRUDER_FAILEDE.lto_priv.505>: 5615: ff ff 4c 4f 41 44 20 54 4f 20 45 58 54 52 2e 20 ..LOAD TO EXTR. 5625: 46 41 49 4c 45 44 00 FAILED. 0000562c <_ZN4MMU2L23MSG_TITLE_INSPECT_FINDAE.lto_priv.504>: 562c: ff ff 49 4e 53 50 45 43 54 20 46 49 4e 44 41 00 ..INSPECT FINDA. 0000563c <_ZN4MMU2L27MSG_TITLE_FSENSOR_TOO_EARLYE.lto_priv.503>: 563c: ff ff 46 53 45 4e 53 4f 52 20 54 4f 4f 20 45 41 ..FSENSOR TOO EA 564c: 52 4c 59 00 RLY. 00005650 <_ZN4MMU2L28MSG_TITLE_PULLEY_CANNOT_MOVEE.lto_priv.502>: 5650: ff ff 50 55 4c 4c 45 59 20 43 41 4e 4e 4f 54 20 ..PULLEY CANNOT 5660: 4d 4f 56 45 00 MOVE. 00005665 <_ZN4MMU2L32MSG_TITLE_FSENSOR_FILAMENT_STUCKE.lto_priv.501>: 5665: ff ff 46 53 45 4e 53 4f 52 20 46 49 4c 2e 20 53 ..FSENSOR FIL. S 5675: 54 55 43 4b 00 TUCK. 0000567a <_ZN4MMU2L31MSG_TITLE_FSENSOR_DIDNT_TRIGGERE.lto_priv.500>: 567a: ff ff 46 53 45 4e 53 4f 52 20 44 49 44 4e 54 20 ..FSENSOR DIDNT 568a: 54 52 49 47 47 2e 00 TRIGG.. 00005691 <_ZN4MMU2L30MSG_TITLE_FINDA_FILAMENT_STUCKE.lto_priv.499>: 5691: ff ff 46 49 4e 44 41 20 46 49 4c 41 4d 2e 20 53 ..FINDA FILAM. S 56a1: 54 55 43 4b 00 TUCK. 000056a6 <_ZN4MMU2L29MSG_TITLE_FINDA_DIDNT_TRIGGERE.lto_priv.498>: 56a6: ff ff 46 49 4e 44 41 20 44 49 44 4e 54 20 54 52 ..FINDA DIDNT TR 56b6: 49 47 47 45 52 00 IGGER. 000056bc : 56bc: ff ff 4e 6f 74 20 73 70 69 6e 6e 69 6e 67 00 ..Not spinning. 000056cb : 56cb: ff ff 53 70 69 6e 6e 69 6e 67 00 ..Spinning. 000056d6 : 56d6: ff ff 46 61 6e 20 74 65 73 74 00 ..Fan test. 000056e1 : 56e1: ff ff 53 65 6c 66 74 65 73 74 20 66 61 69 6c 65 ..Selftest faile 56f1: 64 00 d. 000056f3 : 56f3: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 5703: 72 00 r. 00005705 : 5705: ff ff 53 77 61 70 70 65 64 00 ..Swapped. 0000570f : 570f: ff ff 46 72 6f 6e 74 2f 6c 65 66 74 20 66 61 6e ..Front/left fan 571f: 73 00 s. 00005721 : 5721: ff ff 41 78 69 73 00 ..Axis. 00005728 : 5728: ff ff 41 78 69 73 20 6c 65 6e 67 74 68 00 ..Axis length. 00005736 : 5736: ff ff 4c 6f 6f 73 65 20 70 75 6c 6c 65 79 00 ..Loose pulley. 00005745 : 5745: ff ff 4c 65 66 74 20 68 6f 74 65 6e 64 20 66 61 ..Left hotend fa 5755: 6e 3f 00 n?. 00005758 : 5758: ff ff 46 72 6f 6e 74 20 70 72 69 6e 74 20 66 61 ..Front print fa 5768: 6e 3f 00 n?. 0000576b : 576b: ff ff 45 6e 64 73 74 6f 70 20 6e 6f 74 20 68 69 ..Endstop not hi 577b: 74 00 t. 0000577d : 577d: ff ff 45 6e 64 73 74 6f 70 00 ..Endstop. 00005787 : 5787: ff ff 4d 6f 74 6f 72 00 ..Motor. 0000578f : 578f: ff ff 45 6e 64 73 74 6f 70 73 00 ..Endstops. 0000579a : 579a: ff ff 57 69 72 69 6e 67 20 65 72 72 6f 72 00 ..Wiring error. 000057a9 : 57a9: ff ff 42 65 64 2f 48 65 61 74 65 72 00 ..Bed/Heater. 000057b6 : 57b6: ff ff 4e 6f 74 20 63 6f 6e 6e 65 63 74 65 64 00 ..Not connected. 000057c6 : 57c6: ff ff 48 65 61 74 65 72 2f 54 68 65 72 6d 69 73 ..Heater/Thermis 57d6: 74 6f 72 00 tor. 000057da : 57da: ff ff 50 6c 65 61 73 65 20 63 68 65 63 6b 3a 00 ..Please check:. 000057ea : 57ea: ff ff 53 65 6c 66 74 65 73 74 20 65 72 72 6f 72 ..Selftest error 57fa: 21 00 !. 000057fc : 57fc: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 580c: 6e 20 61 6c 6c 20 72 69 67 68 74 2e 20 53 6b 65 n all right. Ske 581c: 77 20 77 69 6c 6c 20 62 65 20 63 6f 72 72 65 63 w will be correc 582c: 74 65 64 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c ted automaticall 583c: 79 2e 00 y.. 0000583f : 583f: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 584f: 6e 20 61 6c 6c 20 72 69 67 68 74 2e 20 58 2f 59 n all right. X/Y 585f: 20 61 78 65 73 20 61 72 65 20 73 6c 69 67 68 74 axes are slight 586f: 6c 79 20 73 6b 65 77 65 64 2e 20 47 6f 6f 64 20 ly skewed. Good 587f: 6a 6f 62 21 00 job!. 00005884 : 5884: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 5894: 6e 20 6f 6b 2e 20 58 2f 59 20 61 78 65 73 20 61 n ok. X/Y axes a 58a4: 72 65 20 70 65 72 70 65 6e 64 69 63 75 6c 61 72 re perpendicular 58b4: 2e 20 43 6f 6e 67 72 61 74 75 6c 61 74 69 6f 6e . Congratulation 58c4: 73 21 00 s!. 000058c7 : 58c7: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 58d7: 6e 20 63 6f 6d 70 72 6f 6d 69 73 65 64 2e 20 52 n compromised. R 58e7: 69 67 68 74 20 66 72 6f 6e 74 20 63 61 6c 69 62 ight front calib 58f7: 72 61 74 69 6f 6e 20 70 6f 69 6e 74 20 6e 6f 74 ration point not 5907: 20 72 65 61 63 68 61 62 6c 65 2e 00 reachable.. 00005913 : 5913: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 5923: 6e 20 63 6f 6d 70 72 6f 6d 69 73 65 64 2e 20 46 n compromised. F 5933: 72 6f 6e 74 20 63 61 6c 69 62 72 61 74 69 6f 6e ront calibration 5943: 20 70 6f 69 6e 74 73 20 6e 6f 74 20 72 65 61 63 points not reac 5953: 68 61 62 6c 65 2e 00 hable.. 0000595a : 595a: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 596a: 6e 20 66 61 69 6c 65 64 2e 20 52 69 67 68 74 20 n failed. Right 597a: 66 72 6f 6e 74 20 63 61 6c 69 62 72 61 74 69 6f front calibratio 598a: 6e 20 70 6f 69 6e 74 20 6e 6f 74 20 72 65 61 63 n point not reac 599a: 68 61 62 6c 65 2e 00 hable.. 000059a1 : 59a1: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 59b1: 6e 20 66 61 69 6c 65 64 2e 20 46 72 6f 6e 74 20 n failed. Front 59c1: 63 61 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e calibration poin 59d1: 74 73 20 6e 6f 74 20 72 65 61 63 68 61 62 6c 65 ts not reachable 59e1: 2e 00 .. 000059e3 : 59e3: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 59f3: 6e 20 66 61 69 6c 65 64 2e 20 50 6c 65 61 73 65 n failed. Please 5a03: 20 63 6f 6e 73 75 6c 74 20 74 68 65 20 6d 61 6e consult the man 5a13: 75 61 6c 2e 00 ual.. 00005a18 : 5a18: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 5a28: 6e 20 66 61 69 6c 65 64 2e 20 42 65 64 20 63 61 n failed. Bed ca 5a38: 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e 74 20 libration point 5a48: 77 61 73 20 6e 6f 74 20 66 6f 75 6e 64 2e 00 was not found.. 00005a57 : 5a57: ff ff 50 6c 65 61 73 65 20 70 6c 61 63 65 20 73 ..Please place s 5a67: 74 65 65 6c 20 73 68 65 65 74 20 6f 6e 20 68 65 teel sheet on he 5a77: 61 74 62 65 64 2e 00 atbed.. 00005a7e : 5a7e: ff ff 44 69 73 74 61 6e 63 65 20 62 65 74 77 65 ..Distance betwe 5a8e: 65 6e 20 74 69 70 20 6f 66 20 74 68 65 20 6e 6f en tip of the no 5a9e: 7a 7a 6c 65 20 61 6e 64 20 74 68 65 20 62 65 64 zzle and the bed 5aae: 20 73 75 72 66 61 63 65 20 68 61 73 20 6e 6f 74 surface has not 5abe: 20 62 65 65 6e 20 73 65 74 20 79 65 74 2e 20 50 been set yet. P 5ace: 6c 65 61 73 65 20 66 6f 6c 6c 6f 77 20 74 68 65 lease follow the 5ade: 20 6d 61 6e 75 61 6c 2c 20 63 68 61 70 74 65 72 manual, chapter 5aee: 20 46 69 72 73 74 20 73 74 65 70 73 2c 20 73 65 First steps, se 5afe: 63 74 69 6f 6e 20 46 69 72 73 74 20 6c 61 79 65 ction First laye 5b0e: 72 20 63 61 6c 69 62 72 61 74 69 6f 6e 2e 00 r calibration.. 00005b1d : 5b1d: ff ff 50 6c 61 63 65 20 61 20 73 68 65 65 74 20 ..Place a sheet 5b2d: 6f 66 20 70 61 70 65 72 20 75 6e 64 65 72 20 74 of paper under t 5b3d: 68 65 20 6e 6f 7a 7a 6c 65 20 64 75 72 69 6e 67 he nozzle during 5b4d: 20 74 68 65 20 63 61 6c 69 62 72 61 74 69 6f 6e the calibration 5b5d: 20 6f 66 20 66 69 72 73 74 20 34 20 70 6f 69 6e of first 4 poin 5b6d: 74 73 2e 20 49 66 20 74 68 65 20 6e 6f 7a 7a 6c ts. If the nozzl 5b7d: 65 20 63 61 74 63 68 65 73 20 74 68 65 20 70 61 e catches the pa 5b8d: 70 65 72 2c 20 70 6f 77 65 72 20 6f 66 66 20 74 per, power off t 5b9d: 68 65 20 70 72 69 6e 74 65 72 20 69 6d 6d 65 64 he printer immed 5bad: 69 61 74 65 6c 79 2e 00 iately.. 00005bb5 : 5bb5: ff ff 53 65 61 72 63 68 69 6e 67 20 62 65 64 20 ..Searching bed 5bc5: 63 61 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e calibration poin 5bd5: 74 00 t. 00005bd7 : 5bd7: ff ff 4d 65 61 73 75 72 69 6e 67 20 72 65 66 65 ..Measuring refe 5be7: 72 65 6e 63 65 20 68 65 69 67 68 74 20 6f 66 20 rence height of 5bf7: 63 61 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e calibration poin 5c07: 74 00 t. 00005c09 : 5c09: ff ff 50 6c 65 61 73 65 20 63 6c 65 61 6e 20 74 ..Please clean t 5c19: 68 65 20 6e 6f 7a 7a 6c 65 20 66 6f 72 20 63 61 he nozzle for ca 5c29: 6c 69 62 72 61 74 69 6f 6e 2e 20 43 6c 69 63 6b libration. Click 5c39: 20 77 68 65 6e 20 64 6f 6e 65 2e 00 when done.. 00005c45 : 5c45: ff ff 41 75 74 6f 20 68 6f 6d 65 00 ..Auto home. 00005c51 : 5c51: ff ff 43 75 74 20 66 69 6c 61 6d 65 6e 74 00 ..Cut filament. 00005c60 : 5c60: ff ff 45 6a 65 63 74 20 66 72 6f 6d 20 4d 4d 55 ..Eject from MMU ... 00005c71 : 5c71: ff ff 4c 6f 61 64 69 6e 67 20 66 69 6c 61 6d 65 ..Loading filame 5c81: 6e 74 00 nt. 00005c84 : 5c84: ff ff 4d 4d 55 20 52 65 74 72 79 3a 20 52 65 73 ..MMU Retry: Res 5c94: 74 6f 72 69 6e 67 20 74 65 6d 70 65 72 61 74 75 toring temperatu 5ca4: 72 65 2e 2e 2e 00 re.... 00005caa : 5caa: ff ff 53 6f 72 74 69 6e 67 20 66 69 6c 65 73 00 ..Sorting files. 00005cba : 5cba: ff ff 53 6f 6d 65 20 66 69 6c 65 73 20 77 69 6c ..Some files wil 5cca: 6c 20 6e 6f 74 20 62 65 20 73 6f 72 74 65 64 2e l not be sorted. 5cda: 20 4d 61 78 2e 20 4e 6f 2e 20 6f 66 20 66 69 6c Max. No. of fil 5cea: 65 73 20 69 6e 20 31 20 66 6f 6c 64 65 72 20 66 es in 1 folder f 5cfa: 6f 72 20 73 6f 72 74 69 6e 67 20 69 73 20 31 30 or sorting is 10 5d0a: 30 2e 00 0.. 00005d0d : 5d0d: ff ff 4f 66 66 00 ..Off. 00005d13 : 5d13: ff ff 4f 6e 00 ..On. 00005d18 : 5d18: ff ff 55 6e 65 78 70 65 63 74 65 64 20 65 72 72 ..Unexpected err 5d28: 6f 72 20 6f 63 63 75 72 72 65 64 2e 00 or occurred.. 00005d35 : 5d35: ff ff 4d 36 30 30 20 46 69 6c 61 6d 65 6e 74 20 ..M600 Filament 5d45: 43 68 61 6e 67 65 2e 20 4c 6f 61 64 20 61 20 6e Change. Load a n 5d55: 65 77 20 66 69 6c 61 6d 65 6e 74 20 6f 72 20 65 ew filament or e 5d65: 6a 65 63 74 20 74 68 65 20 6f 6c 64 20 6f 6e 65 ject the old one 5d75: 2e 00 .. 00005d77 : 5d77: ff ff 52 65 6d 6f 76 65 20 74 68 65 20 65 6a 65 ..Remove the eje 5d87: 63 74 65 64 20 66 69 6c 61 6d 65 6e 74 20 66 72 cted filament fr 5d97: 6f 6d 20 74 68 65 20 66 72 6f 6e 74 20 6f 66 20 om the front of 5da7: 74 68 65 20 4d 4d 55 2e 00 the MMU.. 00005db0 : 5db0: ff ff 46 69 6c 61 6d 65 6e 74 20 64 65 74 65 63 ..Filament detec 5dc0: 74 65 64 20 75 6e 65 78 70 65 63 74 65 64 6c 79 ted unexpectedly 5dd0: 2e 20 45 6e 73 75 72 65 20 6e 6f 20 66 69 6c 61 . Ensure no fila 5de0: 6d 65 6e 74 20 69 73 20 6c 6f 61 64 65 64 2e 20 ment is loaded. 5df0: 43 68 65 63 6b 20 74 68 65 20 73 65 6e 73 6f 72 Check the sensor 5e00: 73 20 61 6e 64 20 77 69 72 69 6e 67 2e 00 s and wiring.. 00005e0e : 5e0e: ff ff 49 6e 74 65 72 6e 61 6c 20 72 75 6e 74 69 ..Internal runti 5e1e: 6d 65 20 65 72 72 6f 72 2e 20 54 72 79 20 72 65 me error. Try re 5e2e: 73 65 74 74 69 6e 67 20 74 68 65 20 4d 4d 55 20 setting the MMU 5e3e: 6f 72 20 75 70 64 61 74 69 6e 67 20 74 68 65 20 or updating the 5e4e: 66 69 72 6d 77 61 72 65 2e 00 firmware.. 00005e58 : 5e58: ff ff 4d 4d 55 20 46 57 20 76 65 72 73 69 6f 6e ..MMU FW version 5e68: 20 69 73 20 69 6e 63 6f 6d 70 61 74 69 62 6c 65 is incompatible 5e78: 20 77 69 74 68 20 70 72 69 6e 74 65 72 20 46 57 with printer FW 5e88: 2e 55 70 64 61 74 65 20 74 6f 20 76 65 72 73 69 .Update to versi 5e98: 6f 6e 20 33 2e 30 2e 33 2e 00 on 3.0.3.. 00005ea2 : 5ea2: ff ff 4d 4d 55 20 46 69 72 6d 77 61 72 65 20 69 ..MMU Firmware i 5eb2: 6e 74 65 72 6e 61 6c 20 65 72 72 6f 72 2c 20 70 nternal error, p 5ec2: 6c 65 61 73 65 20 72 65 73 65 74 20 74 68 65 20 lease reset the 5ed2: 4d 4d 55 2e 00 MMU.. 00005ed7 : 5ed7: ff ff 52 65 71 75 65 73 74 65 64 20 66 69 6c 61 ..Requested fila 5ee7: 6d 65 6e 74 20 74 6f 6f 6c 20 69 73 20 6e 6f 74 ment tool is not 5ef7: 20 61 76 61 69 6c 61 62 6c 65 20 6f 6e 20 74 68 available on th 5f07: 69 73 20 68 61 72 64 77 61 72 65 2e 20 43 68 65 is hardware. Che 5f17: 63 6b 20 74 68 65 20 47 2d 63 6f 64 65 20 66 6f ck the G-code fo 5f27: 72 20 74 6f 6f 6c 20 69 6e 64 65 78 20 6f 75 74 r tool index out 5f37: 20 6f 66 20 72 61 6e 67 65 20 28 54 30 2d 54 34 of range (T0-T4 5f47: 29 2e 00 ).. 00005f4a : 5f4a: ff ff 43 61 6e 6e 6f 74 20 70 65 72 66 6f 72 6d ..Cannot perform 5f5a: 20 74 68 65 20 61 63 74 69 6f 6e 2c 20 66 69 6c the action, fil 5f6a: 61 6d 65 6e 74 20 69 73 20 61 6c 72 65 61 64 79 ament is already 5f7a: 20 6c 6f 61 64 65 64 2e 20 55 6e 6c 6f 61 64 20 loaded. Unload 5f8a: 69 74 20 66 69 72 73 74 2e 00 it first.. 00005f94 : 5f94: ff ff 4d 4d 55 20 6e 6f 74 20 72 65 73 70 6f 6e ..MMU not respon 5fa4: 64 69 6e 67 20 63 6f 72 72 65 63 74 6c 79 2e 20 ding correctly. 5fb4: 43 68 65 63 6b 20 74 68 65 20 77 69 72 69 6e 67 Check the wiring 5fc4: 20 61 6e 64 20 63 6f 6e 6e 65 63 74 6f 72 73 2e and connectors. ... 00005fd5 : 5fd5: ff ff 4d 4d 55 20 6e 6f 74 20 72 65 73 70 6f 6e ..MMU not respon 5fe5: 64 69 6e 67 2e 20 43 68 65 63 6b 20 74 68 65 20 ding. Check the 5ff5: 77 69 72 69 6e 67 20 61 6e 64 20 63 6f 6e 6e 65 wiring and conne 6005: 63 74 6f 72 73 2e 00 ctors.. 0000600c : 600c: ff ff 4d 6f 72 65 20 64 65 74 61 69 6c 73 20 6f ..More details o 601c: 6e 6c 69 6e 65 2e 00 nline.. 00006023 : 6023: ff ff 54 68 65 20 49 64 6c 65 72 20 63 61 6e 6e ..The Idler cann 6033: 6f 74 20 68 6f 6d 65 20 70 72 6f 70 65 72 6c 79 ot home properly 6043: 2e 20 43 68 65 63 6b 20 66 6f 72 20 61 6e 79 74 . Check for anyt 6053: 68 69 6e 67 20 62 6c 6f 63 6b 69 6e 67 20 69 74 hing blocking it 6063: 73 20 6d 6f 76 65 6d 65 6e 74 2e 00 s movement.. 0000606f : 606f: ff ff 43 61 6e 27 74 20 6d 6f 76 65 20 53 65 6c ..Can't move Sel 607f: 65 63 74 6f 72 20 6f 72 20 49 64 6c 65 72 2e 00 ector or Idler.. 0000608f : 608f: ff ff 54 68 65 20 53 65 6c 65 63 74 6f 72 20 63 ..The Selector c 609f: 61 6e 6e 6f 74 20 68 6f 6d 65 20 70 72 6f 70 65 annot home prope 60af: 72 6c 79 2e 20 43 68 65 63 6b 20 66 6f 72 20 61 rly. Check for a 60bf: 6e 79 74 68 69 6e 67 20 62 6c 6f 63 6b 69 6e 67 nything blocking 60cf: 20 69 74 73 20 6d 6f 76 65 6d 65 6e 74 2e 00 its movement.. 000060de : 60de: ff ff 4c 6f 61 64 69 6e 67 20 74 6f 20 65 78 74 ..Loading to ext 60ee: 72 75 64 65 72 20 66 61 69 6c 65 64 2e 20 49 6e ruder failed. In 60fe: 73 70 65 63 74 20 74 68 65 20 66 69 6c 61 6d 65 spect the filame 610e: 6e 74 20 74 69 70 20 73 68 61 70 65 2e 20 52 65 nt tip shape. Re 611e: 66 69 6e 65 20 74 68 65 20 73 65 6e 73 6f 72 20 fine the sensor 612e: 63 61 6c 69 62 72 61 74 69 6f 6e 2c 20 69 66 20 calibration, if 613e: 6e 65 65 64 65 64 2e 00 needed.. 00006146 : 6146: ff ff 53 65 6c 65 63 74 6f 72 20 63 61 6e 27 74 ..Selector can't 6156: 20 6d 6f 76 65 20 64 75 65 20 74 6f 20 46 49 4e move due to FIN 6166: 44 41 20 64 65 74 65 63 74 69 6e 67 20 61 20 66 DA detecting a f 6176: 69 6c 61 6d 65 6e 74 2e 20 4d 61 6b 65 20 73 75 ilament. Make su 6186: 72 65 20 6e 6f 20 66 69 6c 61 6d 65 6e 74 20 69 re no filament i 6196: 73 20 69 6e 20 53 65 6c 65 63 74 6f 72 20 61 6e s in Selector an 61a6: 64 20 46 49 4e 44 41 20 77 6f 72 6b 73 20 70 72 d FINDA works pr 61b6: 6f 70 65 72 6c 79 2e 00 operly.. 000061be : 61be: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 61ce: 72 20 74 72 69 67 67 65 72 65 64 20 74 6f 6f 20 r triggered too 61de: 65 61 72 6c 79 20 77 68 69 6c 65 20 6c 6f 61 64 early while load 61ee: 69 6e 67 20 74 6f 20 65 78 74 72 75 64 65 72 2e ing to extruder. 61fe: 20 43 68 65 63 6b 20 74 68 65 72 65 20 69 73 6e Check there isn 620e: 27 74 20 61 6e 79 74 68 69 6e 67 20 73 74 75 63 't anything stuc 621e: 6b 20 69 6e 20 50 54 46 45 20 74 75 62 65 2e 20 k in PTFE tube. 622e: 43 68 65 63 6b 20 74 68 61 74 20 73 65 6e 73 6f Check that senso 623e: 72 20 72 65 61 64 73 20 70 72 6f 70 65 72 6c 79 r reads properly 624e: 2e 00 .. 00006250 : 6250: ff ff 50 75 6c 6c 65 79 20 6d 6f 74 6f 72 20 73 ..Pulley motor s 6260: 74 61 6c 6c 65 64 2e 20 45 6e 73 75 72 65 20 74 talled. Ensure t 6270: 68 65 20 70 75 6c 6c 65 79 20 63 61 6e 20 6d 6f he pulley can mo 6280: 76 65 20 61 6e 64 20 63 68 65 63 6b 20 74 68 65 ve and check the 6290: 20 77 69 72 69 6e 67 2e 00 wiring.. 00006299 : 6299: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 62a9: 72 20 64 69 64 6e 27 74 20 73 77 69 74 63 68 20 r didn't switch 62b9: 6f 66 66 20 77 68 69 6c 65 20 75 6e 6c 6f 61 64 off while unload 62c9: 69 6e 67 20 66 69 6c 61 6d 65 6e 74 2e 20 45 6e ing filament. En 62d9: 73 75 72 65 20 66 69 6c 61 6d 65 6e 74 20 63 61 sure filament ca 62e9: 6e 20 6d 6f 76 65 20 61 6e 64 20 74 68 65 20 73 n move and the s 62f9: 65 6e 73 6f 72 20 77 6f 72 6b 73 2e 00 ensor works.. 00006306 : 6306: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 6316: 72 20 64 69 64 6e 27 74 20 74 72 69 67 67 65 72 r didn't trigger 6326: 20 77 68 69 6c 65 20 6c 6f 61 64 69 6e 67 20 74 while loading t 6336: 68 65 20 66 69 6c 61 6d 65 6e 74 2e 20 45 6e 73 he filament. Ens 6346: 75 72 65 20 74 68 65 20 73 65 6e 73 6f 72 20 69 ure the sensor i 6356: 73 20 63 61 6c 69 62 72 61 74 65 64 20 61 6e 64 s calibrated and 6366: 20 74 68 65 20 66 69 6c 61 6d 65 6e 74 20 72 65 the filament re 6376: 61 63 68 65 64 20 69 74 2e 00 ached it.. 00006380 : 6380: ff ff 46 49 4e 44 41 20 64 69 64 6e 27 74 20 73 ..FINDA didn't s 6390: 77 69 74 63 68 20 6f 66 66 20 77 68 69 6c 65 20 witch off while 63a0: 75 6e 6c 6f 61 64 69 6e 67 20 66 69 6c 61 6d 65 unloading filame 63b0: 6e 74 2e 20 54 72 79 20 75 6e 6c 6f 61 64 69 6e nt. Try unloadin 63c0: 67 20 6d 61 6e 75 61 6c 6c 79 2e 20 45 6e 73 75 g manually. Ensu 63d0: 72 65 20 66 69 6c 61 6d 65 6e 74 20 63 61 6e 20 re filament can 63e0: 6d 6f 76 65 20 61 6e 64 20 46 49 4e 44 41 20 77 move and FINDA w 63f0: 6f 72 6b 73 2e 00 orks.. 000063f6 : 63f6: ff ff 46 49 4e 44 41 20 64 69 64 6e 27 74 20 74 ..FINDA didn't t 6406: 72 69 67 67 65 72 20 77 68 69 6c 65 20 6c 6f 61 rigger while loa 6416: 64 69 6e 67 20 74 68 65 20 66 69 6c 61 6d 65 6e ding the filamen 6426: 74 2e 20 45 6e 73 75 72 65 20 74 68 65 20 66 69 t. Ensure the fi 6436: 6c 61 6d 65 6e 74 20 63 61 6e 20 6d 6f 76 65 20 lament can move 6446: 61 6e 64 20 46 49 4e 44 41 20 77 6f 72 6b 73 2e and FINDA works. ... 00006457 : 6457: ff ff 44 69 73 61 62 6c 65 00 ..Disable. 00006461 : 6461: ff ff 53 74 6f 70 00 ..Stop. 00006468 : 6468: ff ff 4c 6f 61 64 00 ..Load. 0000646f : 646f: ff ff 55 6e 6c 6f 61 64 00 ..Unload. 00006478 : 6478: ff ff 52 65 73 65 74 4d 4d 55 00 ..ResetMMU. 00006483 : 6483: ff ff 52 65 74 72 79 00 ..Retry. 0000648b : 648b: ff ff 42 65 64 20 6c 65 76 65 6c 69 6e 67 20 66 ..Bed leveling f 649b: 61 69 6c 65 64 2e 20 53 65 6e 73 6f 72 20 64 69 ailed. Sensor di 64ab: 64 6e 27 74 20 74 72 69 67 67 65 72 2e 20 44 65 dn't trigger. De 64bb: 62 72 69 73 20 6f 6e 20 6e 6f 7a 7a 6c 65 3f 20 bris on nozzle? 64cb: 57 61 69 74 69 6e 67 20 66 6f 72 20 72 65 73 65 Waiting for rese 64db: 74 2e 00 t.. 000064de : 64de: ff ff 53 65 6e 73 69 74 69 76 69 74 79 00 ..Sensitivity. 000064ec : 64ec: ff ff 44 6f 6e 65 00 ..Done. 000064f3 <__loc_pri_end>: 64f3: 65 6e ori r22, 0xE5 ; 229 64f5: 71 75 andi r23, 0x51 ; 81 64f7: 65 69 ori r22, 0x95 ; 149 64f9: 6e 67 ori r22, 0x7E ; 126 64fb: 20 22 and r2, r16 ... 000064fe : 64fe: 44 6f 6e 65 20 70 72 69 6e 74 69 6e 67 20 66 69 Done printing fi 650e: 6c 65 00 le. 00006511 : 6511: 4e 6f 20 4c 69 6e 65 20 4e 75 6d 62 65 72 20 77 No Line Number w 6521: 69 74 68 20 63 68 65 63 6b 73 75 6d 2c 20 4c 61 ith checksum, La 6531: 73 74 20 4c 69 6e 65 3a 20 00 st Line: . 0000653b : 653b: 4e 6f 20 43 68 65 63 6b 73 75 6d 20 77 69 74 68 No Checksum with 654b: 20 6c 69 6e 65 20 6e 75 6d 62 65 72 2c 20 4c 61 line number, La 655b: 73 74 20 4c 69 6e 65 3a 20 00 st Line: . 00006565 : 6565: 63 68 65 63 6b 73 75 6d 20 6d 69 73 6d 61 74 63 checksum mismatc 6575: 68 2c 20 4c 61 73 74 20 4c 69 6e 65 3a 20 00 h, Last Line: . 00006584 : 6584: 4c 69 6e 65 20 4e 75 6d 62 65 72 20 69 73 20 6e Line Number is n 6594: 6f 74 20 4c 61 73 74 20 4c 69 6e 65 20 4e 75 6d ot Last Line Num 65a4: 62 65 72 2b 31 2c 20 4c 61 73 74 20 4c 69 6e 65 ber+1, Last Line 65b4: 3a 20 00 : . 000065b7 : 65b7: 25 6c 75 20 62 79 74 65 73 20 77 72 69 74 74 65 %lu bytes writte 65c7: 6e 20 74 6f 20 25 53 20 61 74 20 61 64 64 72 65 n to %S at addre 65d7: 73 73 20 30 78 25 30 34 6c 78 0a 00 ss 0x%04lx.. 000065e3 : 65e3: 44 25 64 20 2d 20 52 65 61 64 2f 57 72 69 74 65 D%d - Read/Write 65f3: 20 25 53 0a 00 %S.. 000065f8 <__c.2366>: 65f8: 3f 3f 00 ??. 000065fb <__c.2364>: 65fb: 52 6f 6d 61 6e 61 00 Romana. 00006602 <__c.2361>: 6602: 48 72 76 61 74 73 6b 69 00 Hrvatski. 0000660b <__c.2358>: 660b: 4d 61 67 79 61 72 00 Magyar. 00006612 <__c.2355>: 6612: 53 6c 6f 76 65 6e 63 69 6e 61 00 Slovencina. 0000661d <__c.2352>: 661d: 4e 6f 72 73 6b 00 Norsk. 00006623 <__c.2349>: 6623: 53 76 65 6e 73 6b 61 00 Svenska. 0000662b <__c.2346>: 662b: 4e 65 64 65 72 6c 61 6e 64 73 00 Nederlands. 00006636 <__c.2343>: 6636: 50 6f 6c 73 6b 69 00 Polski. 0000663d <__c.2340>: 663d: 49 74 61 6c 69 61 6e 6f 00 Italiano. 00006646 <__c.2337>: 6646: 46 72 61 6e 63 61 69 73 00 Francais. 0000664f <__c.2334>: 664f: 45 73 70 61 6e 6f 6c 00 Espanol. 00006657 <__c.2331>: 6657: 44 65 75 74 73 63 68 00 Deutsch. 0000665f <__c.2328>: 665f: 43 65 73 74 69 6e 61 00 Cestina. 00006667 <__c.2325>: 6667: 45 6e 67 6c 69 73 68 00 English. 0000666f : 666f: 20 43 6f 75 6e 74 20 58 3a 20 00 Count X: . 0000667a : 667a: 45 30 3a 25 64 20 52 50 4d 20 50 52 4e 31 3a 25 E0:%d RPM PRN1:% 668a: 64 20 52 50 4d 20 45 30 40 3a 25 75 20 50 52 4e d RPM E0@:%u PRN 669a: 31 40 3a 25 75 0a 00 1@:%u.. 000066a1 : 66a1: 52 65 73 65 6e 64 00 Resend. 000066a8 : 66a8: 25 53 3a 20 25 6c 64 0a 25 53 0a 00 %S: %ld.%S.. 000066b4 : 66b4: 2f 2f 61 63 74 69 6f 6e 3a 6e 6f 74 69 66 69 63 //action:notific 66c4: 61 74 69 6f 6e 20 25 53 0a 00 ation %S.. 000066ce : 66ce: 46 69 6c 61 6d 65 6e 74 20 72 75 6e 6f 75 74 20 Filament runout 66de: 64 65 74 65 63 74 65 64 21 00 detected!. 000066e8 : 66e8: 50 72 69 6e 74 65 72 20 73 74 6f 70 70 65 64 20 Printer stopped 66f8: 64 75 65 20 74 6f 20 65 72 72 6f 72 73 2e 20 53 due to errors. S 6708: 75 70 65 72 76 69 73 69 6f 6e 20 72 65 71 75 69 upervision requi 6718: 72 65 64 2e 00 red.. 0000671d : 671d: 64 75 6d 70 20 63 6c 65 61 72 65 64 0a 00 dump cleared.. 0000672b : 672b: 6e 6f 20 64 75 6d 70 20 61 76 61 69 6c 61 62 6c no dump availabl 673b: 65 0a 00 e.. 0000673e : 673e: 44 32 31 20 2d 20 72 65 61 64 20 63 72 61 73 68 D21 - read crash 674e: 20 64 75 6d 70 0a 00 dump.. 00006755 : 6755: 6e 6f 20 64 75 6d 70 20 61 76 61 69 6c 61 62 6c no dump availabl 6765: 65 0a 00 e.. 00006768 : 6768: 64 75 6d 70 20 63 6f 6d 70 6c 65 74 65 64 20 69 dump completed i 6778: 6e 20 25 6c 75 6d 73 0a 00 n %lums.. 00006781 : 6781: 58 46 4c 41 53 48 00 XFLASH. 00006788 : 6788: 45 45 50 52 4f 4d 00 EEPROM. 0000678f : 678f: 53 52 41 4d 00 SRAM. 00006794 : 6794: 44 2d 31 20 2d 20 45 6e 64 6c 65 73 73 20 6c 6f D-1 - Endless lo 67a4: 6f 70 0a 00 op.. 000067a8 : 67a8: 41 63 74 69 76 65 20 45 78 74 72 75 64 65 72 3a Active Extruder: 67b8: 20 30 00 0. 000067bb : 67bb: 49 6e 76 61 6c 69 64 20 65 78 74 72 75 64 65 72 Invalid extruder ... 000067cc : 67cc: 74 6d 63 32 31 33 30 5f 70 72 69 6e 74 5f 63 75 tmc2130_print_cu 67dc: 72 72 65 6e 74 73 28 29 0a 09 48 09 52 0a 58 09 rrents()..H.R.X. 67ec: 25 64 09 25 64 0a 59 09 25 64 09 25 64 0a 5a 09 %d.%d.Y.%d.%d.Z. 67fc: 25 64 09 25 64 0a 45 09 25 64 09 25 64 0a 00 %d.%d.E.%d.%d.. 0000680b : 680b: 53 44 20 70 72 69 6e 74 69 6e 67 20 62 79 74 65 SD printing byte 681b: 20 00 . 0000681d : 681d: 55 6e 6b 6e 6f 77 6e 20 63 6f 6d 6d 61 6e 64 3a Unknown command: 682d: 20 22 00 ". 00006830 <_ZZ16process_commandsvE3__c__67_>: 6830: 4d 32 30 30 20 49 6e 76 61 6c 69 64 20 65 78 74 M200 Invalid ext 6840: 72 75 64 65 72 20 00 ruder . 00006847 : 6847: 7a 5f 6d 61 78 3a 20 00 z_max: . 0000684f : 684f: 7a 5f 6d 69 6e 3a 20 00 z_min: . 00006857 <_ZZ16process_commandsvE3__c__66_>: 6857: 79 5f 6d 61 78 3a 20 00 y_max: . 0000685f <_ZZ16process_commandsvE3__c__65_>: 685f: 79 5f 6d 69 6e 3a 20 00 y_min: . 00006867 <_ZZ16process_commandsvE3__c__64_>: 6867: 78 5f 6d 61 78 3a 20 00 x_max: . 0000686f : 686f: 54 52 49 47 47 45 52 45 44 00 TRIGGERED. 00006879 : 6879: 6f 70 65 6e 00 open. 0000687e <_ZZ16process_commandsvE3__c__63_>: 687e: 78 5f 6d 69 6e 3a 20 00 x_min: . 00006886 <_ZZ16process_commandsvE3__c__62_>: 6886: 52 65 70 6f 72 74 69 6e 67 20 65 6e 64 73 74 6f Reporting endsto 6896: 70 20 73 74 61 74 75 73 00 p status. 0000689f : 689f: 4d 31 31 32 20 63 61 6c 6c 65 64 2e 20 45 6d 65 M112 called. Eme 68af: 72 67 65 6e 63 79 20 53 74 6f 70 2e 00 rgency Stop.. 000068bc : 68bc: 2f 2f 61 63 74 69 6f 6e 3a 75 76 6c 6f 5f 72 65 //action:uvlo_re 68cc: 63 6f 76 65 72 79 5f 72 65 61 64 79 00 covery_ready. 000068d9 : 68d9: 2f 2f 61 63 74 69 6f 6e 3a 75 76 6c 6f 5f 61 75 //action:uvlo_au 68e9: 74 6f 5f 72 65 63 6f 76 65 72 79 5f 72 65 61 64 to_recovery_read 68f9: 79 00 y. 000068fb <_ZZ16process_commandsvE3__c__45_>: 68fb: 53 49 4c 45 4e 54 00 SILENT. 00006902 <_ZZ16process_commandsvE3__c__44_>: 6902: 4e 4f 52 4d 41 4c 00 NORMAL. 00006909 <_ZZ16process_commandsvE3__c__43_>: 6909: 25 53 20 4d 4f 44 45 3a 20 50 65 72 63 65 6e 74 %S MODE: Percent 6919: 20 64 6f 6e 65 3a 20 25 68 68 64 3b 20 70 72 69 done: %hhd; pri 6929: 6e 74 20 74 69 6d 65 20 72 65 6d 61 69 6e 69 6e nt time remainin 6939: 67 20 69 6e 20 6d 69 6e 73 3a 20 25 64 3b 20 43 g in mins: %d; C 6949: 68 61 6e 67 65 20 69 6e 20 6d 69 6e 73 3a 20 25 hange in mins: % 6959: 64 0a 00 d.. 0000695c <_ZZ16process_commandsvE3__c__42_>: 695c: 50 72 69 6e 74 65 72 53 74 61 74 65 3a 20 25 64 PrinterState: %d 696c: 0a 00 .. 0000696e <_ZZ16process_commandsvE3__c__38_>: 696e: 45 6e 64 20 66 69 6c 65 20 6c 69 73 74 00 End file list. 0000697c <_ZZ16process_commandsvE3__c__37_>: 697c: 42 65 67 69 6e 20 66 69 6c 65 20 6c 69 73 74 00 Begin file list. 0000698c : 698c: 55 6e 6b 6e 6f 77 6e 20 25 63 20 63 6f 64 65 3a Unknown %c code: 699c: 20 25 73 0a 00 %s.. 000069a1 <_ZZ16process_commandsvE3__c__35_>: 69a1: 0a 50 49 4e 44 41 20 74 65 6d 70 65 72 61 74 75 .PINDA temperatu 69b1: 72 65 3a 20 25 2e 31 66 20 5a 20 73 68 69 66 74 re: %.1f Z shift 69c1: 20 28 6d 6d 29 3a 20 25 2e 33 66 00 (mm): %.3f. 000069cd <_ZZ16process_commandsvE3__c__34_>: 69cd: 0a 53 74 65 70 3a 20 25 64 2f 36 0a 00 .Step: %d/6.. 000069da <_ZZ16process_commandsvE3__c__33_>: 69da: 0a 53 74 65 70 3a 20 25 64 2f 36 20 28 73 6b 69 .Step: %d/6 (ski 69ea: 70 70 65 64 29 0a 50 49 4e 44 41 20 74 65 6d 70 pped).PINDA temp 69fa: 65 72 61 74 75 72 65 3a 20 25 64 20 5a 20 73 68 erature: %d Z sh 6a0a: 69 66 74 20 28 6d 6d 29 3a 30 0a 00 ift (mm):0.. 00006a16 <_ZZ16process_commandsvE3__c__32_>: 6a16: 0a 5a 45 52 4f 3a 20 25 2e 33 66 0a 00 .ZERO: %.3f.. 00006a23 <_ZZ16process_commandsvE3__c__31_>: 6a23: 73 74 61 72 74 20 74 65 6d 70 65 72 61 74 75 72 start temperatur 6a33: 65 3a 20 25 2e 31 66 0a 00 e: %.1f.. 00006a3c <_ZZ16process_commandsvE3__c__28_>: 6a3c: 25 64 20 20 25 2e 32 66 00 %d %.2f. 00006a45 <_ZZ16process_commandsvE3__c__27_>: 6a45: 25 53 20 58 3a 20 25 2e 35 66 20 59 3a 20 25 2e %S X: %.5f Y: %. 6a55: 35 66 20 5a 3a 20 25 2e 35 66 0a 00 5f Z: %.5f.. 00006a61 <_ZZ16process_commandsvE3__c__26_>: 6a61: 53 6c 65 65 70 2e 2e 2e 00 Sleep.... 00006a6a <_ZZ16process_commandsvE3__c__10_>: 6a6a: 45 30 3a 25 64 20 52 50 4d 0a 50 52 4e 30 3a 25 E0:%d RPM.PRN0:% 6a7a: 64 20 52 50 4d 0a 00 d RPM.. 00006a81 : 6a81: 4d 31 30 37 00 M107. 00006a86 : 6a86: 42 3a 20 25 33 64 20 20 20 20 20 58 64 3a 25 36 B: %3d Xd:%6 6a96: 64 0a 53 3a 20 25 33 64 20 20 20 20 20 59 64 3a d.S: %3d Yd: 6aa6: 25 36 64 00 %6d. 00006aaa : 6aaa: 46 49 4e 44 41 00 FINDA. 00006ab0 : 6ab0: 50 49 4e 44 41 00 PINDA. 00006ab6 : 6ab6: 57 69 7a 61 72 64 20 65 6e 64 20 73 74 61 74 65 Wizard end state 6ac6: 3a 20 25 64 0a 00 : %d.. 00006acc : 6acc: 53 70 6f 6f 6c 4a 6f 69 6e 00 SpoolJoin. 00006ad6 : 6ad6: 46 69 72 6d 77 61 72 65 00 Firmware. 00006adf : 6adf: 48 42 65 64 20 6f 6e 20 6c 6f 61 64 00 HBed on load. 00006aec : 6aec: 46 6c 61 73 68 41 69 72 00 FlashAir. 00006af5 : 6af5: 54 68 65 72 6d 61 6c 20 4d 6f 64 65 6c 20 63 61 Thermal Model ca 6b05: 6c 2e 00 l.. 00006b08 : 6b08: 45 72 72 3a 50 52 49 4e 54 20 46 41 4e 20 45 52 Err:PRINT FAN ER 6b18: 52 4f 52 00 ROR. 00006b1c : 6b1c: 45 72 72 3a 48 4f 54 45 4e 44 20 46 41 4e 20 45 Err:HOTEND FAN E 6b2c: 52 52 4f 52 00 RROR. 00006b31 : 6b31: 2f 2f 61 63 74 69 6f 6e 3a 72 65 73 75 6d 65 64 //action:resumed ... 00006b42 : 6b42: 2f 2f 61 63 74 69 6f 6e 3a 72 65 73 75 6d 65 00 //action:resume. 00006b52 : 6b52: 2f 2f 61 63 74 69 6f 6e 3a 72 65 61 64 79 00 //action:ready. 00006b61 : 6b61: 2f 2f 61 63 74 69 6f 6e 3a 6e 6f 74 5f 72 65 61 //action:not_rea 6b71: 64 79 00 dy. 00006b74 : 6b74: 2f 2f 61 63 74 69 6f 6e 3a 63 61 6e 63 65 6c 00 //action:cancel. 00006b84 : 6b84: 41 78 69 73 20 6c 65 6e 67 74 68 20 64 69 66 66 Axis length diff 6b94: 65 72 65 6e 63 65 3a 25 2e 33 66 0a 00 erence:%.3f.. 00006ba1 : 6ba1: 4d 65 61 73 75 72 65 64 20 61 78 69 73 20 6c 65 Measured axis le 6bb1: 6e 67 74 68 3a 25 2e 33 66 0a 00 ngth:%.3f.. 00006bbc : 6bbc: 4f 4b 00 OK. 00006bbf : 6bbf: 4c 43 44 20 73 74 61 74 75 73 20 63 68 61 6e 67 LCD status chang 6bcf: 65 64 00 ed. 00006bd2 <_ZZN10CardReader7releaseEvE3__c.lto_priv.534>: 6bd2: 53 44 20 63 61 72 64 20 72 65 6c 65 61 73 65 64 SD card released ... 00006be3 : 6be3: 46 61 6b 65 20 73 65 72 69 61 6c 20 6e 75 6d 62 Fake serial numb 6bf3: 65 72 00 er. 00006bf6 : 6bf6: 45 2d 63 6f 6f 6c 20 6d 6f 64 65 00 E-cool mode. 00006c02 : 6c02: 2f 2f 61 63 74 69 6f 6e 3a 73 74 61 72 74 00 //action:start. 00006c11 : 6c11: 4d 38 34 00 M84. 00006c15 : 6c15: 4d 37 30 32 00 M702. 00006c1a : 6c1a: 4d 38 33 00 M83. 00006c1e : 6c1e: 47 32 38 20 57 00 G28 W. 00006c24 : 6c24: 4d 35 30 30 00 M500. 00006c29 : 6c29: 45 78 74 65 72 6e 61 6c 20 53 50 49 20 66 6c 61 External SPI fla 6c39: 73 68 0a 58 46 4c 41 53 48 20 69 73 20 6e 6f 74 sh.XFLASH is not 6c49: 20 72 65 73 2d 0a 70 6f 6e 64 69 6e 67 2e 20 4c res-.ponding. L 6c59: 61 6e 67 75 61 67 65 0a 73 77 69 74 63 68 20 75 anguage.switch u 6c69: 6e 61 76 61 69 6c 61 62 6c 65 2e 00 navailable.. 00006c75 : 6c75: 58 46 4c 41 53 48 20 6e 6f 74 20 72 65 73 70 6f XFLASH not respo 6c85: 6e 64 69 6e 67 2e 00 nding.. 00006c8c : 6c8c: 46 57 20 63 72 61 73 68 20 64 65 74 65 63 74 65 FW crash detecte 6c9c: 64 21 20 59 6f 75 20 63 61 6e 20 63 6f 6e 74 69 d! You can conti 6cac: 6e 75 65 20 70 72 69 6e 74 69 6e 67 2e 20 44 65 nue printing. De 6cbc: 62 75 67 20 64 61 74 61 20 61 76 61 69 6c 61 62 bug data availab 6ccc: 6c 65 20 66 6f 72 20 61 6e 61 6c 79 73 69 73 2e le for analysis. 6cdc: 20 43 6f 6e 74 61 63 74 20 73 75 70 70 6f 72 74 Contact support 6cec: 20 74 6f 20 73 75 62 6d 69 74 20 64 65 74 61 69 to submit detai 6cfc: 6c 73 2e 00 ls.. 00006d00 : 6d00: 2f 2f 61 63 74 69 6f 6e 3a 64 75 6d 70 5f 61 76 //action:dump_av 6d10: 61 69 6c 61 62 6c 65 00 ailable. 00006d18 <_ZZ5setupE3__c__11_>: 6d18: 43 72 61 73 68 44 65 74 65 63 74 20 44 49 53 41 CrashDetect DISA 6d28: 42 4c 45 44 00 BLED. 00006d2d <_ZZ5setupE3__c__10_>: 6d2d: 43 72 61 73 68 44 65 74 65 63 74 20 45 4e 41 42 CrashDetect ENAB 6d3d: 4c 45 44 21 00 LED!. 00006d42 : 6d42: 20 20 50 6c 61 6e 6e 65 72 42 75 66 66 65 72 42 PlannerBufferB 6d52: 79 74 65 73 3a 20 00 ytes: . 00006d59 : 6d59: 20 46 72 65 65 20 4d 65 6d 6f 72 79 3a 20 00 Free Memory: . 00006d68 : 6d68: 20 7c 20 41 75 74 68 6f 72 3a 20 00 | Author: . 00006d74 : 6d74: 20 4c 61 73 74 20 55 70 64 61 74 65 64 3a 20 00 Last Updated: . 00006d84 : 6d84: 20 53 6f 66 74 77 61 72 65 20 52 65 73 65 74 00 Software Reset. 00006d94 : 6d94: 20 57 61 74 63 68 64 6f 67 20 52 65 73 65 74 00 Watchdog Reset. 00006da4 : 6da4: 20 42 72 6f 77 6e 20 6f 75 74 20 52 65 73 65 74 Brown out Reset ... 00006db5 : 6db5: 20 45 78 74 65 72 6e 61 6c 20 52 65 73 65 74 00 External Reset. 00006dc5 : 6dc5: 50 6f 77 65 72 55 70 00 PowerUp. 00006dcd : 6dcd: 65 72 72 6f 72 20 77 72 69 74 69 6e 67 20 74 6f error writing to 6ddd: 20 66 69 6c 65 00 file. 00006de3 : 6de3: 44 6f 6e 65 20 73 61 76 69 6e 67 20 66 69 6c 65 Done saving file 6df3: 2e 00 .. 00006df5 : 6df5: 6f 6b 00 ok. 00006df8 : 6df8: 46 69 6c 61 6d 65 6e 74 00 Filament. 00006e01 : 6e01: 50 4f 57 45 52 20 50 41 4e 49 43 20 44 45 54 45 POWER PANIC DETE 6e11: 43 54 45 44 00 CTED. 00006e16 : 6e16: 55 56 4c 4f 20 2d 20 65 6e 64 20 25 64 0a 00 UVLO - end %d.. 00006e25 : 6e25: 55 56 4c 4f 5f 54 49 4e 59 20 2d 20 65 6e 64 20 UVLO_TINY - end 6e35: 25 64 0a 00 %d.. 00006e39 : 6e39: 77 6f 72 6c 64 20 63 6f 6f 72 64 69 6e 61 74 65 world coordinate 6e49: 73 3a 20 28 25 2e 33 66 2c 20 25 2e 33 66 2c 20 s: (%.3f, %.3f, 6e59: 25 2e 33 66 29 0a 00 %.3f).. 00006e60 : 6e60: 4d 32 32 30 20 53 25 64 00 M220 S%d. 00006e69 : 6e69: 44 6f 6e 65 20 72 65 61 64 69 6e 67 20 45 45 50 Done reading EEP 6e79: 52 4f 4d 0a 00 ROM.. 00006e7e : 6e7e: 54 65 6d 70 65 72 61 74 75 72 65 20 52 65 73 74 Temperature Rest 6e8e: 6f 72 65 64 0a 00 ored.. 00006e94 : 6e94: 47 31 20 45 25 2d 2e 33 66 20 46 32 37 30 30 00 G1 E%-.3f F2700. 00006ea4 : 6ea4: 54 4d 43 20 44 52 49 56 45 52 20 4f 56 45 52 54 TMC DRIVER OVERT 6eb4: 45 4d 50 00 EMP. 00006eb8 : 6eb8: 48 6f 6c 64 20 63 75 72 72 65 6e 74 20 74 72 75 Hold current tru 6ec8: 6e 63 61 74 65 64 20 74 6f 20 52 75 6e 20 63 75 ncated to Run cu 6ed8: 72 72 65 6e 74 00 rrent. 00006ede : 6ede: 25 63 25 33 64 2f 25 64 81 00 %c%3d/%d.. 00006ee8 : 6ee8: 5a 25 36 2e 32 66 25 63 00 Z%6.2f%c. 00006ef1 : 6ef1: 5a 20 20 20 2d 2d 2d 20 00 Z --- . 00006efa : 6efa: 86 25 33 64 25 25 00 .%3d%%. 00006f01 : 6f01: 2d 2d 2d 25 25 00 ---%%. 00006f07 : 6f07: 25 33 64 25 25 00 %3d%%. 00006f0d : 6f0d: 20 53 44 00 SD. 00006f11 : 6f11: 20 20 20 00 . 00006f15 : 6f15: 20 48 4f 00 HO. 00006f19 : 6f19: 87 2d 2d 3a 2d 2d 20 20 00 .--:-- . 00006f22 : 6f22: 87 25 33 75 68 20 25 63 25 63 00 .%3uh %c%c. 00006f2d : 6f2d: 87 25 30 32 75 3a 25 30 32 75 25 63 25 63 00 .%02u:%02u%c%c. 00006f3c : 6f3c: 2f 2f 61 63 74 69 6f 6e 3a 70 61 75 73 65 64 00 //action:paused. 00006f4c : 6f4c: 2f 2f 61 63 74 69 6f 6e 3a 70 61 75 73 65 00 //action:pause. 00006f5b <_ZZL16lcd_support_menuvE3__c__16_>: 6f5b: 44 75 6d 70 20 6d 65 6d 6f 72 79 00 Dump memory. 00006f67 : 6f67: 68 65 6c 70 2e 70 72 75 73 61 33 64 2e 63 6f 6d help.prusa3d.com ... 00006f78 : 6f78: 66 6f 72 75 6d 2e 70 72 75 73 61 33 64 2e 63 6f forum.prusa3d.co 6f88: 6d 00 m. 00006f8a : 6f8a: 70 72 75 73 61 33 64 2e 63 6f 6d 00 prusa3d.com. 00006f96 : 6f96: 4d 37 30 31 00 M701. 00006f9b : 6f9b: 25 53 3a 0a 25 31 38 2e 32 66 6d 20 0a 25 53 3a %S:.%18.2fm .%S: 6fab: 0a 25 31 30 6c 64 64 20 25 30 32 64 68 20 25 30 .%10ldd %02dh %0 6fbb: 32 64 6d 00 2dm. 00006fbf : 6fbf: 25 53 3a 0a 25 31 38 2e 32 66 6d 20 0a 25 53 3a %S:.%18.2fm .%S: 6fcf: 0a 25 31 30 6c 64 68 20 25 30 32 64 6d 20 25 30 .%10ldh %02dm %0 6fdf: 32 64 73 00 2ds. 00006fe3 : 6fe3: 25 36 2e 32 66 6d 6d 00 %6.2fmm. 00006feb : 6feb: 25 53 0a 25 53 0a 25 53 3a 0a 25 53 3a 00 %S.%S.%S:.%S:. 00006ff9 : 6ff9: 25 33 2e 32 66 81 00 %3.2f.. 00007000 : 7000: 25 2d 31 34 2e 31 34 53 3a 0a 25 53 0a 25 2d 31 %-14.14S:.%S.%-1 7010: 34 2e 31 34 53 3a 25 33 2e 32 66 81 0a 25 2d 31 4.14S:%3.2f..%-1 7020: 34 2e 31 34 53 3a 25 33 2e 32 66 81 00 4.14S:%3.2f.. 0000702d : 702d: 20 20 30 00 0. 00007031 : 7031: 20 20 31 00 1. 00007035 : 7035: 4d 65 61 73 75 72 65 64 20 73 6b 65 77 73 3a 20 Measured skews: 7045: 25 66 20 25 66 0a 00 %f %f.. 0000704c : 704c: 46 69 74 74 69 6e 67 20 66 61 69 6c 65 64 20 3d Fitting failed = 705c: 3e 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 66 61 > calibration fa 706c: 69 6c 65 64 2e 0a 00 iled... 00007073 : 7073: 43 61 6c 69 62 72 61 74 69 6f 6e 20 73 75 63 63 Calibration succ 7083: 65 73 73 2e 0a 00 ess... 00007089 : 7089: 41 6c 6c 20 34 20 63 61 6c 69 62 72 61 74 69 6f All 4 calibratio 7099: 6e 20 70 6f 69 6e 74 73 20 66 6f 75 6e 64 2e 0a n points found.. ... 000070aa : 70aa: 31 2f 34 00 1/4. 000070ae : 70ae: 31 2f 34 00 1/4. 000070b2 : 70b2: 31 2f 39 00 1/9. 000070b6 : 70b6: 50 72 75 73 61 20 69 33 20 4d 4b 33 20 4f 4b 2e Prusa i3 MK3 OK. ... 000070c7 : 70c7: 53 44 20 63 61 72 64 20 6f 6b 00 SD card ok. 000070d2 : 70d2: 6f 70 65 6e 52 6f 6f 74 20 66 61 69 6c 65 64 00 openRoot failed. 000070e2 : 70e2: 76 6f 6c 75 6d 65 2e 69 6e 69 74 20 66 61 69 6c volume.init fail 70f2: 65 64 00 ed. 000070f5 : 70f5: 53 44 20 69 6e 69 74 20 66 61 69 6c 00 SD init fail. 00007102 : 7102: 6f 70 65 6e 20 66 61 69 6c 65 64 2c 20 46 69 6c open failed, Fil 7112: 65 3a 20 00 e: . 00007116 : 7116: 43 61 6e 6e 6f 74 20 65 6e 74 65 72 20 73 75 62 Cannot enter sub 7126: 64 69 72 3a 20 00 dir: . 0000712c : 712c: 4d 36 30 30 00 M600. 00007131 : 7131: 4d 32 34 00 M24. 00007135 : 7135: 4d 32 33 20 25 73 00 M23 %s. 0000713c : 713c: 31 2f 39 00 1/9. 00007140 : 7140: 88 00 .. 00007142 : 7142: 20 74 6f 6f 20 6c 6f 6e 67 20 65 78 74 72 75 73 too long extrus 7152: 69 6f 6e 20 70 72 65 76 65 6e 74 65 64 00 ion prevented. 00007160 : 7160: 20 63 6f 6c 64 20 65 78 74 72 75 73 69 6f 6e 20 cold extrusion 7170: 70 72 65 76 65 6e 74 65 64 00 prevented. 0000717a : 717a: 4d 6f 76 65 20 61 62 6f 72 74 65 64 00 Move aborted. 00007187 <__noloc_end>: 7187: 08 4a sbci r16, 0xA8 ; 168 7189: d7 3b cpi r29, 0xB7 ; 183 718b: 3b ce rjmp .-906 ; 0x6e03 718d: 01 6e ori r16, 0xE1 ; 225 718f: 84 bc out 0x24, r8 ; 36 7191: bf fd .word 0xfdbf ; ???? 7193: c1 2f mov r28, r17 7195: 3d 6c ori r19, 0xCD ; 205 7197: 74 31 cpi r23, 0x14 ; 20 7199: 9a bd out 0x2a, r25 ; 42 719b: 56 83 std Z+6, r21 ; 0x06 719d: 3d da rcall .-2950 ; 0x6619 <__c.2355+0x7> 719f: 3d 00 .word 0x003d ; ???? 71a1: c7 7f andi r28, 0xF7 ; 247 71a3: 11 be out 0x31, r1 ; 49 71a5: d9 e4 ldi r29, 0x49 ; 73 71a7: bb 4c sbci r27, 0xCB ; 203 71a9: 3e 91 ld r19, -X 71ab: 6b aa std Y+51, r6 ; 0x33 71ad: aa be out 0x3a, r10 ; 58 71af: 00 00 nop 71b1: 00 80 ld r0, Z 71b3: 3f 05 cpc r19, r15 71b5: a8 4c sbci r26, 0xC8 ; 200 71b7: cd b2 in r12, 0x1d ; 29 71b9: d4 4e sbci r29, 0xE4 ; 228 71bb: b9 38 cpi r27, 0x89 ; 137 71bd: 36 a9 ldd r19, Z+54 ; 0x36 71bf: 02 0c add r0, r2 71c1: 50 b9 out 0x00, r21 ; 0 71c3: 91 86 std Z+9, r9 ; 0x09 71c5: 88 08 sbc r8, r8 71c7: 3c a6 std Y+44, r3 ; 0x2c 71c9: aa aa std Y+50, r10 ; 0x32 71cb: 2a be out 0x3a, r2 ; 58 71cd: 00 00 nop 71cf: 00 80 ld r0, Z 71d1: 3f 07 cpc r19, r31 71d3: 63 42 sbci r22, 0x23 ; 35 71d5: 36 b7 in r19, 0x36 ; 54 71d7: 9b d8 rcall .-3786 ; 0x630f 71d9: a7 1a sub r10, r23 71db: 39 68 ori r19, 0x89 ; 137 71dd: 56 18 sub r5, r6 71df: ae ba out 0x1e, r10 ; 30 71e1: ab 55 subi r26, 0x5B ; 91 71e3: 8c 1d adc r24, r12 71e5: 3c b7 in r19, 0x3c ; 60 71e7: cc 57 subi r28, 0x7C ; 124 71e9: 63 bd out 0x23, r22 ; 35 71eb: 6d ed ldi r22, 0xDD ; 221 71ed: fd 75 andi r31, 0x5D ; 93 71ef: 3e f6 brtc .-114 ; 0x717f 71f1: 17 72 andi r17, 0x27 ; 39 71f3: 31 bf out 0x31, r19 ; 49 71f5: 00 00 nop 71f7: 00 80 ld r0, Z 71f9: 3f 08 sbc r3, r15 71fb: 00 00 nop 71fd: 00 be out 0x30, r0 ; 48 71ff: 92 24 eor r9, r2 7201: 49 12 cpse r4, r25 7203: 3e ab std Y+54, r19 ; 0x36 7205: aa aa std Y+50, r10 ; 0x32 7207: 2a be out 0x3a, r2 ; 58 7209: cd cc rjmp .-1638 ; 0x6ba5 720b: cc 4c sbci r28, 0xCC ; 204 720d: 3e 00 .word 0x003e ; ???? 720f: 00 00 nop 7211: 80 be out 0x30, r8 ; 48 7213: ab aa std Y+51, r10 ; 0x33 7215: aa aa std Y+50, r10 ; 0x32 7217: 3e 00 .word 0x003e ; ???? 7219: 00 00 nop 721b: 00 bf out 0x30, r16 ; 48 721d: 00 00 nop 721f: 00 80 ld r0, Z 7221: 3f 00 .word 0x003f ; ???? 7223: 00 00 nop 7225: 00 00 nop 7227: 08 41 sbci r16, 0x18 ; 24 7229: 78 d3 rcall .+1776 ; 0x791b 722b: bb 43 sbci r27, 0x3B ; 59 722d: 87 d1 rcall .+782 ; 0x753d <__trampolines_start+0x2e9> 722f: 13 3d cpi r17, 0xD3 ; 211 7231: 19 0e add r1, r25 7233: 3c c3 rjmp .+1656 ; 0x78ad 7235: bd 42 sbci r27, 0x2D ; 45 7237: 82 ad ldd r24, Z+58 ; 0x3a 7239: 2b 3e cpi r18, 0xEB ; 235 723b: 68 ec ldi r22, 0xC8 ; 200 723d: 82 76 andi r24, 0x62 ; 98 723f: be d9 rcall .-3204 ; 0x65bd 7241: 8f e1 ldi r24, 0x1F ; 31 7243: a9 3e cpi r26, 0xE9 ; 233 7245: 4c 80 ldd r4, Y+4 ; 0x04 7247: ef ff .word 0xffef ; ???? 7249: be 01 movw r22, r28 724b: c4 ff sbrs r28, 4 724d: 7f 3f cpi r23, 0xFF ; 255 724f: 00 00 nop 7251: 00 00 nop ... 00007254 <__trampolines_start>: 7254: 0c 94 fd cc jmp 0x199fa ; 0x199fa 7258: 0c 94 c5 d0 jmp 0x1a18a ; 0x1a18a 725c: 0c 94 26 ee jmp 0x1dc4c ; 0x1dc4c 7260: 0d 94 41 50 jmp 0x2a082 ; 0x2a082 7264: 0d 94 08 10 jmp 0x22010 ; 0x22010 7268: 0c 94 cc d0 jmp 0x1a198 ; 0x1a198 726c: 0c 94 10 cd jmp 0x19a20 ; 0x19a20 7270: 0c 94 14 cd jmp 0x19a28 ; 0x19a28 7274: 0c 94 f1 cc jmp 0x199e2 ; 0x199e2 7278: 0c 94 32 e1 jmp 0x1c264 ; 0x1c264 727c: 0c 94 0f df jmp 0x1be1e ; 0x1be1e 7280: 0c 94 05 f0 jmp 0x1e00a ; 0x1e00a 7284: 0d 94 19 21 jmp 0x24232 ; 0x24232 7288: 0c 94 af e9 jmp 0x1d35e ; 0x1d35e 728c: 0c 94 54 e9 jmp 0x1d2a8 ; 0x1d2a8 7290: 0c 94 23 df jmp 0x1be46 ; 0x1be46 7294: 0c 94 8d 64 jmp 0xc91a ; 0xc91a <_GLOBAL__sub_D_card> 7298: 0c 94 4a e9 jmp 0x1d294 ; 0x1d294 729c: 0c 94 f0 cf jmp 0x19fe0 ; 0x19fe0 72a0: 0d 94 a1 9f jmp 0x33f42 ; 0x33f42 72a4: 0d 94 a6 2b jmp 0x2574c ; 0x2574c 72a8: 0c 94 50 f4 jmp 0x1e8a0 ; 0x1e8a0 72ac: 0c 94 19 d4 jmp 0x1a832 ; 0x1a832 72b0: 0d 94 41 17 jmp 0x22e82 ; 0x22e82 72b4: 0d 94 a1 0a jmp 0x21542 ; 0x21542 72b8: 0c 94 a9 e1 jmp 0x1c352 ; 0x1c352 72bc: 0d 94 93 0a jmp 0x21526 ; 0x21526 72c0: 0c 94 1b fa jmp 0x1f436 ; 0x1f436 72c4: 0c 94 68 db jmp 0x1b6d0 ; 0x1b6d0 72c8: 0c 94 a2 74 jmp 0xe944 ; 0xe944 <__vector_23+0xd0> 72cc: 0c 94 74 d8 jmp 0x1b0e8 ; 0x1b0e8 72d0: 0c 94 ce cd jmp 0x19b9c ; 0x19b9c 72d4: 0c 94 7e 74 jmp 0xe8fc ; 0xe8fc <__vector_23+0x88> 72d8: 0d 94 a9 a6 jmp 0x34d52 ; 0x34d52 72dc: 0c 94 e8 d0 jmp 0x1a1d0 ; 0x1a1d0 72e0: 0d 94 d6 16 jmp 0x22dac ; 0x22dac 72e4: 0d 94 b8 ac jmp 0x35970 ; 0x35970 72e8: 0c 94 2b cd jmp 0x19a56 ; 0x19a56 72ec: 0d 94 ab ac jmp 0x35956 ; 0x35956 72f0: 0d 94 73 14 jmp 0x228e6 ; 0x228e6 72f4: 0d 94 5c 27 jmp 0x24eb8 ; 0x24eb8 72f8: 0c 94 de cf jmp 0x19fbc ; 0x19fbc 72fc: 0c 94 cd d3 jmp 0x1a79a ; 0x1a79a ()> 7300: 0d 94 da 50 jmp 0x2a1b4 ; 0x2a1b4 7304: 0c 94 c3 e9 jmp 0x1d386 ; 0x1d386 7308: 0c 94 66 d9 jmp 0x1b2cc ; 0x1b2cc 730c: 0c 94 6e e9 jmp 0x1d2dc ; 0x1d2dc 7310: 0c 94 4e e1 jmp 0x1c29c ; 0x1c29c 7314: 0d 94 01 50 jmp 0x2a002 ; 0x2a002 7318: 0d 94 6d 50 jmp 0x2a0da ; 0x2a0da 731c: 0c 94 21 f8 jmp 0x1f042 ; 0x1f042 7320: 0d 94 6e 0f jmp 0x21edc ; 0x21edc 7324: 0c 94 68 e1 jmp 0x1c2d0 ; 0x1c2d0 7328: 0c 94 59 e1 jmp 0x1c2b2 ; 0x1c2b2 732c: 0c 94 49 f0 jmp 0x1e092 ; 0x1e092 7330: 0c 94 b4 cf jmp 0x19f68 ; 0x19f68 7334: 0d 94 3a d2 jmp 0x3a474 ; 0x3a474 <_menu_edit_P()> 7338: 0d 94 d6 19 jmp 0x233ac ; 0x233ac 733c: 0d 94 31 16 jmp 0x22c62 ; 0x22c62 7340: 0c 94 36 fa jmp 0x1f46c ; 0x1f46c 7344: 0c 94 0a cd jmp 0x19a14 ; 0x19a14 7348: 0c 94 31 e9 jmp 0x1d262 ; 0x1d262 734c: 0d 94 62 2b jmp 0x256c4 ; 0x256c4 7350: 0c 94 a5 e0 jmp 0x1c14a ; 0x1c14a 7354: 0c 94 c8 d3 jmp 0x1a790 ; 0x1a790 ()> 7358: 0c 94 73 74 jmp 0xe8e6 ; 0xe8e6 <__vector_23+0x72> 735c: 0c 94 9a f9 jmp 0x1f334 ; 0x1f334 7360: 0d 94 73 50 jmp 0x2a0e6 ; 0x2a0e6 7364: 0c 94 f9 cc jmp 0x199f2 ; 0x199f2 7368: 0c 94 3d cd jmp 0x19a7a ; 0x19a7a 736c: 0c 94 be d3 jmp 0x1a77c ; 0x1a77c ()> 7370: 0d 94 99 09 jmp 0x21332 ; 0x21332 7374: 0d 94 95 2b jmp 0x2572a ; 0x2572a 7378: 0c 94 b9 e9 jmp 0x1d372 ; 0x1d372 737c: 0d 94 51 15 jmp 0x22aa2 ; 0x22aa2 7380: 0c 94 78 e9 jmp 0x1d2f0 ; 0x1d2f0 7384: 0d 94 a2 17 jmp 0x22f44 ; 0x22f44 7388: 0c 94 81 cf jmp 0x19f02 ; 0x19f02 738c: 0c 94 25 d0 jmp 0x1a04a ; 0x1a04a 7390: 0c 94 9c e0 jmp 0x1c138 ; 0x1c138 7394: 0c 94 a0 d2 jmp 0x1a540 ; 0x1a540 7398: 0c 94 01 d7 jmp 0x1ae02 ; 0x1ae02 739c: 0d 94 8c ac jmp 0x35918 ; 0x35918 73a0: 0c 94 5d d4 jmp 0x1a8ba ; 0x1a8ba 73a4: 0c 94 e1 e1 jmp 0x1c3c2 ; 0x1c3c2 73a8: 0c 94 d7 d3 jmp 0x1a7ae ; 0x1a7ae ()> 73ac: 0c 94 e0 74 jmp 0xe9c0 ; 0xe9c0 <__vector_23+0x14c> 73b0: 0d 94 ac a6 jmp 0x34d58 ; 0x34d58 73b4: 0d 94 ea 72 jmp 0x2e5d4 ; 0x2e5d4 73b8: 0c 94 46 d9 jmp 0x1b28c ; 0x1b28c 73bc: 0c 94 3a e1 jmp 0x1c274 ; 0x1c274 73c0: 0c 94 42 e1 jmp 0x1c284 ; 0x1c284 73c4: 0d 94 20 18 jmp 0x23040 ; 0x23040 73c8: 0c 94 44 ef jmp 0x1de88 ; 0x1de88 73cc: 0c 94 53 cf jmp 0x19ea6 ; 0x19ea6 73d0: 0c 94 55 e0 jmp 0x1c0aa ; 0x1c0aa 73d4: 0c 94 2c cd jmp 0x19a58 ; 0x19a58 73d8: 0c 94 2d fa jmp 0x1f45a ; 0x1f45a 73dc: 0c 94 d2 d3 jmp 0x1a7a4 ; 0x1a7a4 ()> 73e0: 0c 94 dc df jmp 0x1bfb8 ; 0x1bfb8 73e4: 0d 94 31 a6 jmp 0x34c62 ; 0x34c62 73e8: 0c 94 12 d0 jmp 0x1a024 ; 0x1a024 73ec: 0c 94 db d3 jmp 0x1a7b6 ; 0x1a7b6 73f0: 0d 94 3e 16 jmp 0x22c7c ; 0x22c7c 73f4: 0c 94 1e cd jmp 0x19a3c ; 0x19a3c 73f8: 0c 94 c8 f4 jmp 0x1e990 ; 0x1e990 73fc: 0d 94 f8 9f jmp 0x33ff0 ; 0x33ff0 7400: 0d 94 ca 50 jmp 0x2a194 ; 0x2a194 7404: 0d 94 d2 50 jmp 0x2a1a4 ; 0x2a1a4 7408: 0d 94 af a6 jmp 0x34d5e ; 0x34d5e 740c: 0d 94 95 09 jmp 0x2132a ; 0x2132a 7410: 0d 94 c4 4f jmp 0x29f88 ; 0x29f88 7414: 0c 94 1b cf jmp 0x19e36 ; 0x19e36 7418: 0c 94 4a fa jmp 0x1f494 ; 0x1f494 741c: 0c 94 ce 74 jmp 0xe99c ; 0xe99c <__vector_23+0x128> 7420: 0d 94 a7 3e jmp 0x27d4e ; 0x27d4e 7424: 0d 94 e2 50 jmp 0x2a1c4 ; 0x2a1c4 7428: 0c 94 a5 ce jmp 0x19d4a ; 0x19d4a 742c: 0d 94 7c 1e jmp 0x23cf8 ; 0x23cf8 7430: 0d 94 7d 9f jmp 0x33efa ; 0x33efa 7434: 0d 94 c2 50 jmp 0x2a184 ; 0x2a184 7438: 0c 94 7b 76 jmp 0xecf6 ; 0xecf6 743c: 0c 94 8c cf jmp 0x19f18 ; 0x19f18 7440: 0d 94 99 0a jmp 0x21532 ; 0x21532 7444: 0d 94 f5 9f jmp 0x33fea ; 0x33fea 7448: 0c 94 d4 cf jmp 0x19fa8 ; 0x19fa8 744c: 0d 94 5d 1e jmp 0x23cba ; 0x23cba 7450: 0d 94 bb 0e jmp 0x21d76 ; 0x21d76 7454: 0c 94 96 cf jmp 0x19f2c ; 0x19f2c 7458: 0d 94 a1 50 jmp 0x2a142 ; 0x2a142 745c: 0d 94 9d 0c jmp 0x2193a ; 0x2193a 7460: 0c 94 30 cd jmp 0x19a60 ; 0x19a60 7464: 0d 94 a0 1c jmp 0x23940 ; 0x23940 7468: 0d 94 4a a6 jmp 0x34c94 ; 0x34c94 746c: 0c 94 91 e9 jmp 0x1d322 ; 0x1d322 7470: 0c 94 68 f9 jmp 0x1f2d0 ; 0x1f2d0 7474: 0c 94 36 e9 jmp 0x1d26c ; 0x1d26c 7478: 0c 94 00 e3 jmp 0x1c600 ; 0x1c600 747c: 0d 94 a4 50 jmp 0x2a148 ; 0x2a148 7480: 0d 94 8c a6 jmp 0x34d18 ; 0x34d18 7484: 0c 94 c7 e3 jmp 0x1c78e ; 0x1c78e 7488: 0c 94 8c 74 jmp 0xe918 ; 0xe918 <__vector_23+0xa4> 748c: 0d 94 87 3f jmp 0x27f0e ; 0x27f0e 7490: 0d 94 25 16 jmp 0x22c4a ; 0x22c4a 7494: 0d 94 fc 18 jmp 0x231f8 ; 0x231f8 7498: 0c 94 ac ce jmp 0x19d58 ; 0x19d58 749c: 0c 94 ee d4 jmp 0x1a9dc ; 0x1a9dc 74a0: 0d 94 d1 07 jmp 0x20fa2 ; 0x20fa2 74a4: 0c 94 66 d4 jmp 0x1a8cc ; 0x1a8cc 74a8: 0d 94 84 16 jmp 0x22d08 ; 0x22d08 74ac: 0c 94 c1 ce jmp 0x19d82 ; 0x19d82 74b0: 0d 94 fb 9f jmp 0x33ff6 ; 0x33ff6 74b4: 0d 94 20 10 jmp 0x22040 ; 0x22040 74b8: 0c 94 aa e2 jmp 0x1c554 ; 0x1c554 74bc: 0c 94 c0 cf jmp 0x19f80 ; 0x19f80 74c0: 0c 94 a0 cf jmp 0x19f40 ; 0x19f40 74c4: 0d 94 13 a0 jmp 0x34026 ; 0x34026 74c8: 0d 94 33 1c jmp 0x23866 ; 0x23866 74cc: 0d 94 6f 14 jmp 0x228de ; 0x228de 74d0: 0c 94 e0 cd jmp 0x19bc0 ; 0x19bc0 74d4: 0d 94 0b 50 jmp 0x2a016 ; 0x2a016 74d8: 0c 94 bc ef jmp 0x1df78 ; 0x1df78 74dc: 0c 94 87 ee jmp 0x1dd0e ; 0x1dd0e 74e0: 0c 94 ca cf jmp 0x19f94 ; 0x19f94 74e4: 0c 94 ba ce jmp 0x19d74 ; 0x19d74 74e8: 0c 94 a4 f9 jmp 0x1f348 ; 0x1f348 74ec: 0d 94 ea 50 jmp 0x2a1d4 ; 0x2a1d4 74f0: 0d 94 a2 21 jmp 0x24344 ; 0x24344 74f4: 0c 94 b4 d3 jmp 0x1a768 ; 0x1a768 ()> 74f8: 0c 94 49 f1 jmp 0x1e292 ; 0x1e292 74fc: 0c 94 59 74 jmp 0xe8b2 ; 0xe8b2 <__vector_23+0x3e> 7500: 0d 94 f2 50 jmp 0x2a1e4 ; 0x2a1e4 7504: 0d 94 52 0c jmp 0x218a4 ; 0x218a4 7508: 0c 94 65 e0 jmp 0x1c0ca ; 0x1c0ca 750c: 0c 94 29 e9 jmp 0x1d252 ; 0x1d252 7510: 0c 94 22 cd jmp 0x19a44 ; 0x19a44 7514: 0c 94 f5 cc jmp 0x199ea ; 0x199ea 7518: 0c 94 ab e0 jmp 0x1c156 ; 0x1c156 751c: 0c 94 64 e9 jmp 0x1d2c8 ; 0x1d2c8 7520: 0c 94 f3 ef jmp 0x1dfe6 ; 0x1dfe6 7524: 0c 94 15 fa jmp 0x1f42a ; 0x1f42a 7528: 0d 94 19 2b jmp 0x25632 ; 0x25632 752c: 0d 94 6c 20 jmp 0x240d8 ; 0x240d8 7530: 0c 94 18 cd jmp 0x19a30 ; 0x19a30 7534: 0c 94 26 cd jmp 0x19a4c ; 0x19a4c 7538: 0c 94 82 e9 jmp 0x1d304 ; 0x1d304 753c: 0d 94 06 2b jmp 0x2560c ; 0x2560c 7540: 0c 94 9f e0 jmp 0x1c13e ; 0x1c13e 7544: 0d 94 6d 0b jmp 0x216da ; 0x216da 7548: 0d 94 61 1c jmp 0x238c2 ; 0x238c2 754c: 0d 94 f1 17 jmp 0x22fe2 ; 0x22fe2 7550: 0d 94 b2 50 jmp 0x2a164 ; 0x2a164 7554: 0c 94 aa cf jmp 0x19f54 ; 0x19f54 7558: 0c 94 63 77 jmp 0xeec6 ; 0xeec6 755c: 0c 94 06 cd jmp 0x19a0c ; 0x19a0c 7560: 0d 94 ba 50 jmp 0x2a174 ; 0x2a174 7564: 0c 94 63 d2 jmp 0x1a4c6 ; 0x1a4c6 7568: 0d 94 fa 50 jmp 0x2a1f4 ; 0x2a1f4 756c: 0c 94 75 cf jmp 0x19eea ; 0x19eea 7570: 0d 94 3a 0f jmp 0x21e74 ; 0x21e74 7574: 0d 94 a8 ac jmp 0x35950 ; 0x35950 7578: 0d 94 07 a0 jmp 0x3400e ; 0x3400e 757c: 0c 94 00 cd jmp 0x19a00 ; 0x19a00 7580: 0d 94 2e 29 jmp 0x2525c ; 0x2525c 7584: 0c 94 34 cd jmp 0x19a68 ; 0x19a68 7588: 0c 94 ab 74 jmp 0xe956 ; 0xe956 <__vector_23+0xe2> 758c: 0c 94 09 df jmp 0x1be12 ; 0x1be12 7590: 0c 94 eb cc jmp 0x199d6 ; 0x199d6 7594: 0d 94 c2 2b jmp 0x25784 ; 0x25784 7598: 0d 94 a7 50 jmp 0x2a14e ; 0x2a14e 759c: 0c 94 66 cf jmp 0x19ecc ; 0x19ecc 75a0: 0c 94 fb cf jmp 0x19ff6 ; 0x19ff6 75a4: 0c 94 b9 d3 jmp 0x1a772 ; 0x1a772 ()> 75a8: 0d 94 0e 50 jmp 0x2a01c ; 0x2a01c 75ac: 0d 94 1e 0a jmp 0x2143c ; 0x2143c 75b0: 0c 94 c3 d3 jmp 0x1a786 ; 0x1a786 ()> 75b4: 0d 94 bd ac jmp 0x3597a ; 0x3597a 75b8: 0c 94 19 df jmp 0x1be32 ; 0x1be32 75bc: 0c 94 1f fa jmp 0x1f43e ; 0x1f43e 75c0: 0d 94 41 d4 jmp 0x3a882 ; 0x3a882 75c4: 0c 94 a5 e9 jmp 0x1d34a ; 0x1d34a 75c8: 0c 94 b1 df jmp 0x1bf62 ; 0x1bf62 75cc: 0c 94 9b e9 jmp 0x1d336 ; 0x1d336 75d0: 0d 94 bb 0a jmp 0x21576 ; 0x21576 75d4: 0d 94 19 16 jmp 0x22c32 ; 0x22c32 75d8: 0d 94 aa 50 jmp 0x2a154 ; 0x2a154 75dc: 0d 94 2e 09 jmp 0x2125c ; 0x2125c 75e0: 0c 94 a2 e0 jmp 0x1c144 ; 0x1c144 75e4: 0d 94 70 50 jmp 0x2a0e0 ; 0x2a0e0 75e8: 0c 94 04 fa jmp 0x1f408 ; 0x1f408 75ec: 0d 94 2a 1c jmp 0x23854 ; 0x23854 75f0: 0d 94 03 2f jmp 0x25e06 ; 0x25e06 75f4: 0c 94 aa f7 jmp 0x1ef54 ; 0x1ef54 75f8: 0d 94 41 19 jmp 0x23282 ; 0x23282 75fc: 0d 94 21 1c jmp 0x23842 ; 0x23842 7600: 0c 94 de f9 jmp 0x1f3bc ; 0x1f3bc 7604: 0d 94 8d 28 jmp 0x2511a ; 0x2511a 7608: 0c 94 40 e9 jmp 0x1d280 ; 0x1d280 760c: 0c 94 a7 df jmp 0x1bf4e ; 0x1bf4e 7610: 0c 94 a8 e0 jmp 0x1c150 ; 0x1c150 7614: 0c 94 18 f9 jmp 0x1f230 ; 0x1f230 7618: 0c 94 b4 e0 jmp 0x1c168 ; 0x1c168 761c: 0c 94 f2 f7 jmp 0x1efe4 ; 0x1efe4 7620: 0d 94 36 16 jmp 0x22c6c ; 0x22c6c 7624: 0c 94 ea f9 jmp 0x1f3d4 ; 0x1f3d4 7628: 0c 94 b0 e4 jmp 0x1c960 ; 0x1c960 762c: 0d 94 af ac jmp 0x3595e ; 0x3595e 7630: 0d 94 f2 9f jmp 0x33fe4 ; 0x33fe4 7634: 0d 94 8d 1e jmp 0x23d1a ; 0x23d1a 7638: 0c 94 47 cf jmp 0x19e8e ; 0x19e8e 763c: 0c 94 8e f9 jmp 0x1f31c ; 0x1f31c 7640: 0d 94 25 0f jmp 0x21e4a ; 0x21e4a 7644: 0d 94 e6 9f jmp 0x33fcc ; 0x33fcc 7648: 0d 94 18 1c jmp 0x23830 ; 0x23830 764c: 0d 94 46 ac jmp 0x3588c ; 0x3588c 7650: 0d 94 dc 4f jmp 0x29fb8 ; 0x29fb8 7654: 0c 94 2a da jmp 0x1b454 ; 0x1b454 7658: 0c 94 e6 cd jmp 0x19bcc ; 0x19bcc 765c: 0d 94 04 50 jmp 0x2a008 ; 0x2a008 7660: 0d 94 95 18 jmp 0x2312a ; 0x2312a 7664: 0c 94 2a e1 jmp 0x1c254 ; 0x1c254 7668: 0c 94 5c e9 jmp 0x1d2b8 ; 0x1d2b8 766c: 0c 94 38 cd jmp 0x19a70 ; 0x19a70 7670: 0d 94 cb 07 jmp 0x20f96 ; 0x20f96 7674: 0d 94 9d 0a jmp 0x2153a ; 0x2153a 7678: 0d 94 89 9f jmp 0x33f12 ; 0x33f12 767c: 0d 94 a5 0a jmp 0x2154a ; 0x2154a 7680: 0c 94 b3 ce jmp 0x19d66 ; 0x19d66 7684: 0c 94 0b 71 jmp 0xe216 ; 0xe216 7688: 0c 94 d1 d1 jmp 0x1a3a2 ; 0x1a3a2 0000768c <__trampolines_end>: 768c: 6e 61 ori r22, 0x1E ; 30 768e: 6e 00 .word 0x006e ; ???? 00007690 <__c.2228>: 7690: 69 6e 66 00 00 40 7a 10 f3 5a 00 a0 72 4e 18 09 inf..@z..Z..rN.. 76a0: 00 10 a5 d4 e8 00 00 e8 76 48 17 00 00 e4 0b 54 ........vH.....T 76b0: 02 00 00 ca 9a 3b 00 00 00 e1 f5 05 00 00 80 96 .....;.......... 76c0: 98 00 00 00 40 42 0f 00 00 00 a0 86 01 00 00 00 ....@B.......... 76d0: 10 27 00 00 00 00 e8 03 00 00 00 00 64 00 00 00 .'..........d... 76e0: 00 00 0a 00 00 00 00 00 01 00 00 00 00 00 2c 76 ..............,v 76f0: d8 88 dc 67 4f 08 23 df c1 df ae 59 e1 b1 b7 96 ...gO.#....Y.... 7700: e5 e3 e4 53 c6 3a e6 51 99 76 96 e8 e6 c2 84 26 ...S.:.Q.v.....& 7710: eb 89 8c 9b 62 ed 40 7c 6f fc ef bc 9c 9f 40 f2 ....b.@|o.....@. 7720: ba a5 6f a5 f4 90 05 5a 2a f7 5c 93 6b 6c f9 67 ..o....Z*.\.kl.g 7730: 6d c1 1b fc e0 e4 0d 47 fe f5 20 e6 b5 00 d0 ed m......G.. ..... 7740: 90 2e 03 00 94 35 77 05 00 80 84 1e 08 00 00 20 .....5w........ 7750: 4e 0a 00 00 00 c8 0c 33 33 33 33 0f 98 6e 12 83 N......3333..n.. 7760: 11 41 ef 8d 21 14 89 3b e6 55 16 cf fe e6 db 18 .A..!..;.U...... 7770: d1 84 4b 38 1b f7 7c 1d 90 1d a4 bb e4 24 20 32 ..K8..|......$ 2 7780: 84 72 5e 22 81 00 c9 f1 24 ec a1 e5 3d 27 .r^"....$...=' 0000778e : 778e: 22 00 ". 00007790 : ... 00007791 : 7791: 20 45 53 50 00 ESP. 00007796 : 7796: 20 4e 53 50 00 NSP. 0000779b : 779b: 20 4f 46 46 00 OFF. 000077a0 : 77a0: 20 4f 4e 00 ON. 000077a4 : 77a4: 50 56 30 31 00 PV01. 000077a9 : 77a9: 20 5b 4d 50 5d 20 00 [MP] . 000077b0 : 77b0: 25 69 20 68 6f 75 72 73 20 25 69 20 6d 69 6e 75 %i hours %i minu 77c0: 74 65 73 00 tes. 000077c4 : 77c4: 52 58 20 74 69 6d 65 6f 75 74 00 RX timeout. 000077cf : 77cf: 4d 33 31 30 00 M310. 000077d4 : 77d4: 4d 31 31 32 00 M112. 000077d9 : 77d9: 4d 31 31 30 00 M110. 000077de : 77de: 46 75 6c 6c 20 52 58 20 42 75 66 66 65 72 00 Full RX Buffer. 000077ed : 77ed: 53 65 74 74 69 6e 67 73 20 53 74 6f 72 65 64 00 Settings Stored. 000077fd : 77fd: 54 4d 3a 20 73 74 6f 72 65 64 20 63 61 6c 69 62 TM: stored calib 780d: 72 61 74 69 6f 6e 20 69 6e 76 61 6c 69 64 2c 20 ration invalid, 781d: 72 65 73 65 74 74 69 6e 67 00 resetting. 00007827 : 7827: 53 74 6f 72 65 64 20 73 65 74 74 69 6e 67 73 20 Stored settings 7837: 72 65 74 72 69 65 76 65 64 00 retrieved. 00007841 : 7841: 48 61 72 64 63 6f 64 65 64 20 44 65 66 61 75 6c Hardcoded Defaul 7851: 74 20 53 65 74 74 69 6e 67 73 20 4c 6f 61 64 65 t Settings Loade 7861: 64 00 d. 00007863 : 7863: 56 32 00 00 00 00 c8 42 00 00 c8 42 00 00 c8 43 V2.....B...B...C 7873: 00 00 8c 43 00 00 48 43 00 00 48 43 00 00 40 41 ...C..HC..HC..@A 7883: 00 00 f0 42 e8 03 00 00 e8 03 00 00 c8 00 00 00 ...B............ 7893: 88 13 00 00 00 40 9c 44 00 40 9c 44 00 00 00 00 .....@.D.@.D.... 78a3: 00 00 00 00 20 4e 00 00 00 00 20 41 00 00 20 41 .... N.... A.. A 78b3: cd cc cc 3e 00 00 90 40 00 00 00 00 00 00 00 00 ...>...@........ 78c3: 00 00 00 00 cd cc cc 3e 3d 0a 81 41 ff 08 43 3e .......>=..A..C> 78d3: b0 99 ab 43 8f 42 fc 42 e6 5a 34 3f 4c 62 b0 45 ...C.B.B.Z4?Lb.E 78e3: 00 00 00 00 00 40 40 00 00 34 42 00 00 00 00 00 .....@@..4B..... 78f3: 00 00 00 00 00 00 41 00 00 00 e0 3f 00 00 c8 42 ......A....?...B 7903: 00 00 c8 42 00 00 40 41 00 00 f0 42 c0 03 00 00 ...B..@A...B.... 7913: c0 03 00 00 c8 00 00 00 88 13 00 00 10 10 10 20 ............... 7923: 00 40 9c 44 00 00 80 3f 00 00 00 3f 19 14 00 00 .@.D...?...?.... ... 00007934 : 7934: 43 75 73 74 6f 6d 00 Custom. 0000793b : 793b: 4e 79 6c 6f 6e 50 41 00 NylonPA. 00007943 : 7943: 53 61 74 69 6e 20 20 00 Satin . 0000794b : 794b: 54 65 78 74 75 72 00 Textur. 00007952 : 7952: 53 6d 6f 6f 74 68 00 Smooth. 00007959 : 7959: 48 6f 74 65 6e 64 20 66 61 6e 20 73 70 65 65 64 Hotend fan speed 7969: 20 69 73 20 6c 6f 77 65 72 20 74 68 61 6e 20 65 is lower than e 7979: 78 70 65 63 74 65 64 00 xpected. 00007981 : 7981: 50 72 69 6e 74 20 66 61 6e 20 73 70 65 65 64 20 Print fan speed 7991: 69 73 20 6c 6f 77 65 72 20 74 68 61 6e 20 65 78 is lower than ex 79a1: 70 65 63 74 65 64 00 pected. 000079a8 : 79a8: 31 2e 30 00 1.0. 000079ac : 79ac: 31 2e 35 00 1.5. 000079b0 : 79b0: 55 4e 4b 4e 4f 57 4e 00 UNKNOWN. 000079b8 : 79b8: 4c 41 31 30 43 3a 20 4c 69 6e 65 61 72 20 41 64 LA10C: Linear Ad 79c8: 76 61 6e 63 65 20 6d 6f 64 65 3a 20 00 vance mode: . 000079d5 : 79d5: 4c 41 31 30 43 3a 20 41 64 6a 75 73 74 65 64 20 LA10C: Adjusted 79e5: 45 2d 4a 65 72 6b 3a 20 00 E-Jerk: . 000079ee <_PRI_LANG_SIGNATURE>: 79ee: ff ff ff ff .... 000079f2 : 79f2: 3e 0f a8 af 00 48 00 69 96 00 00 df 60 25 55 58 >....H.i....`%UX 7a02: 87 68 04 27 f2 e0 00 5e 34 03 cc 19 60 f3 3c 0e .h.'...^4...`.<. 7a12: f8 8f 00 db 08 02 94 92 00 3e 1c 07 9a 87 00 e5 .........>...... 7a22: 24 00 85 28 52 7e 06 00 1b e4 00 7e 78 12 70 78 $..(R~.....~x.px 7a32: 70 61 f8 12 78 8f 88 41 78 42 70 78 70 61 78 25 pa..x..AxBpxpax% 7a42: 70 78 70 61 f8 50 78 8f 88 d1 f0 25 27 07 87 61 pxpa.Px....%'..a 7a52: f0 25 27 8f 88 41 2c 0d 27 aa 50 d1 bc 07 07 87 .%'..A,.'.P..... 7a62: 11 61 be 78 8f 88 11 41 78 52 70 78 70 61 f8 52 .a.x...AxRpxpa.R 7a72: 78 8f 88 41 20 12 78 88 70 63 20 52 78 88 70 63 x..A .x.pc Rx.pc 7a82: 48 52 78 88 87 43 03 11 17 99 70 64 18 12 78 f8 HRx..C....pd..x. 7a92: 70 65 44 12 f8 f8 f0 45 18 42 78 f8 70 65 18 25 peD....E.Bx.pe.% 7aa2: 78 f8 70 65 18 52 78 f8 70 65 18 50 78 f8 70 65 x.pe.Rx.pe.Px.pe 7ab2: 0c 07 8f 87 23 65 a2 0f 8f 8f 11 45 00 12 06 22 ....#e.....E..." 7ac2: 70 69 00 12 07 22 27 49 00 25 06 22 70 69 00 25 pi..."'I.%."pi.% 7ad2: 07 22 27 49 00 12 06 22 27 6c 02 62 36 a2 70 6c ."'I..."'l.b6.pl 7ae2: 40 45 6c 44 70 4c 03 62 22 22 70 6c 43 88 88 88 @ElDpL.b""plC... 7af2: f0 4c 78 12 bc 88 80 6e 78 52 bc 88 80 6e 38 12 .Lx....nxR...n8. 7b02: 78 88 70 6f 78 12 78 88 87 4f 38 42 78 88 70 6f x.pox.x..O8Bx.po 7b12: 38 25 78 88 70 6f 3a 00 79 ac 78 6f 3d 07 9a ac 8%x.po:.y.xo=... 7b22: 78 6f 78 50 78 88 87 ef 39 49 78 88 70 6f 08 52 xoxPx...9Ix.po.R 7b32: bc 88 80 72 98 52 f8 8f 98 52 20 12 78 70 f0 73 ...r.R...R .xp.s 7b42: 48 12 78 63 87 53 20 52 78 70 f0 73 48 52 78 63 H.xc.S Rxp.sHRxc 7b52: 87 53 10 07 87 0f 24 73 12 78 63 87 24 53 60 69 .S....$s.xc.$S`i 7b62: 9a 98 8b e2 23 04 e4 44 30 74 10 4e 44 43 24 74 ....#..D0t.NDC$t 7b72: 7c 12 88 89 60 75 3c 50 88 88 70 55 78 25 28 89 |...`u: 7bae: 00 40 14 54 .@.T 00007bb2 : 7bb2: cd cc cc 3d 0a d7 23 3c 17 b7 d1 38 77 cc 2b 32 ...=..#<...8w.+2 7bc2: 95 95 e6 24 1f b1 4f 0a ...$..O. 00007bca : 7bca: 00 00 20 41 00 00 c8 42 00 40 1c 46 20 bc be 4c .. A...B.@.F ..L 7bda: ca 1b 0e 5a ae c5 9d 74 ...Z...t 00007be2 : 7be2: 4e 41 4e NAN 00007be5 : 7be5: 49 4e 46 INF 00007be8 : 7be8: 62 75 73 79 3a 20 70 61 75 73 65 64 20 66 6f 72 busy: paused for 7bf8: 20 69 6e 70 75 74 00 input. 00007bff : 7bff: 62 75 73 79 3a 20 70 61 75 73 65 64 20 66 6f 72 busy: paused for 7c0f: 20 75 73 65 72 00 user. 00007c15 : 7c15: 62 75 73 79 3a 20 70 72 6f 63 65 73 73 69 6e 67 busy: processing ... 00007c26 : 7c26: 00 00 7f 43 00 80 54 43 00 00 52 43 ...C..TC..RC 00007c32 : 7c32: 00 00 00 00 00 00 80 c0 9a 99 19 3e ...........> 00007c3e : 7c3e: 00 00 00 00 00 00 80 c0 9a 99 19 3e ...........> 00007c4a : 7c4a: 00 00 a0 40 00 00 a0 40 00 00 00 40 ...@...@...@ 00007c56 : 7c56: 25 33 64 20 73 74 65 70 3d 25 32 64 20 6d 73 63 %3d step=%2d msc 7c66: 6e 74 3d 25 34 64 0a 00 nt=%4d.. 00007c6e : 7c6e: 00 00 7f 43 00 80 58 43 9a d9 51 43 ...C..XC..QC 00007c7a : 7c7a: ff ff ff ... 00007c7d : 7c7d: 20 41 3a 00 A:. 00007c81 : 7c81: 20 50 3a 00 P:. 00007c85 : 7c85: 20 42 40 3a 00 B@:. 00007c8a : 7c8a: 20 40 3a 00 @:. 00007c8e : 7c8e: 20 2f 00 /. 00007c91 : 7c91: 20 54 30 3a 00 T0:. 00007c96 : 7c96: 20 2f 00 /. 00007c99 : 7c99: 20 42 3a 00 B:. 00007c9d : 7c9d: 20 2f 00 /. 00007ca0 : 7ca0: 54 3a 00 T:. 00007ca3 : 7ca3: 25 53 45 78 63 65 73 73 69 76 65 20 62 65 64 20 %SExcessive bed 7cb3: 6c 65 76 65 6c 69 6e 67 20 63 6f 72 72 65 63 74 leveling correct 7cc3: 69 6f 6e 3a 20 25 69 20 6d 69 63 72 6f 6e 73 0a ion: %i microns. ... 00007cd4 : 7cd4: 42 65 64 20 6c 65 76 65 6c 69 6e 67 20 66 61 69 Bed leveling fai 7ce4: 6c 65 64 2e 20 54 6f 6f 20 6d 75 63 68 20 76 61 led. Too much va 7cf4: 72 69 61 74 69 6f 6e 20 66 72 6f 6d 20 65 65 70 riation from eep 7d04: 72 6f 6d 20 6d 65 73 68 00 rom mesh. 00007d0d : 7d0d: 42 65 64 20 6c 65 76 65 6c 69 6e 67 20 66 61 69 Bed leveling fai 7d1d: 6c 65 64 2e 20 53 65 6e 73 6f 72 20 74 72 69 67 led. Sensor trig 7d2d: 67 65 72 65 64 20 74 6f 6f 20 73 6f 6f 6e 00 gered too soon. 00007d3c : 7d3c: 20 20 00 . 00007d3f : 7d3f: 4d 65 61 73 75 72 65 64 20 70 6f 69 6e 74 73 3a Measured points: ... 00007d50 : 7d50: 5a 20 73 65 61 72 63 68 20 68 65 69 67 68 74 3a Z search height: 7d60: 20 35 2e 30 66 00 5.0f. 00007d66 : 7d66: 4e 75 6d 20 58 2c 59 3a 20 37 2c 37 00 Num X,Y: 7,7. 00007d73 : 7d73: 4d 65 73 68 20 62 65 64 20 6c 65 76 65 6c 69 6e Mesh bed levelin 7d83: 67 20 6e 6f 74 20 61 63 74 69 76 65 2e 00 g not active.. 00007d91 : 7d91: 20 45 3a 00 E:. 00007d95 : 7d95: 20 5a 3a 00 Z:. 00007d99 : 7d99: 20 59 3a 00 Y:. 00007d9d : 7d9d: 20 45 3a 00 E:. 00007da1 : 7da1: 20 5a 3a 00 Z:. 00007da5 : 7da5: 20 59 3a 00 Y:. 00007da9 : 7da9: 58 3a 00 X:. 00007dac : 7dac: 20 2d 3e 20 00 -> . 00007db1 : 7db1: 53 70 6f 6f 6c 4a 6f 69 6e 3a 20 00 SpoolJoin: . 00007dbd : 7dbd: 2c 20 00 , . 00007dc0 : 7dc0: 49 6e 61 63 74 69 76 69 74 79 20 53 68 75 74 64 Inactivity Shutd 7dd0: 6f 77 6e 00 own. 00007dd4 : 7dd4: 4b 49 4c 4c 45 44 2e 00 KILLED.. 00007ddc : 7ddc: 50 72 69 6e 74 65 72 20 68 61 6c 74 65 64 2e 20 Printer halted. 7dec: 6b 69 6c 6c 28 29 20 63 61 6c 6c 65 64 21 00 kill() called!. 00007dfb : 7dfb: 5a 20 6c 69 76 65 20 61 64 6a 75 73 74 20 6f 75 Z live adjust ou 7e0b: 74 20 6f 66 20 72 61 6e 67 65 2e 20 53 65 74 74 t of range. Sett 7e1b: 69 6e 67 20 74 6f 20 30 2e 20 43 6c 69 63 6b 20 ing to 0. Click 7e2b: 74 6f 20 63 6f 6e 74 69 6e 75 65 2e 00 to continue.. 00007e38 : 7e38: 5a 20 6c 69 76 65 20 61 64 6a 75 73 74 20 6f 75 Z live adjust ou 7e48: 74 20 6f 66 20 72 61 6e 67 65 2e 20 53 65 74 74 t of range. Sett 7e58: 69 6e 67 20 74 6f 20 30 00 ing to 0. 00007e61 : 7e61: 20 45 3a 30 20 42 3a 00 E:0 B:. 00007e69 : 7e69: 54 3a 00 T:. 00007e6c : 7e6c: 47 31 20 5a 25 2d 2e 33 66 20 46 25 2d 2e 33 66 G1 Z%-.3f F%-.3f ... 00007e7d : 7e7d: 49 6e 76 61 6c 69 64 20 54 20 63 6f 64 65 2e 00 Invalid T code.. 00007e8d : 7e8d: 44 75 70 6c 69 63 61 74 65 20 54 2d 63 6f 64 65 Duplicate T-code 7e9d: 20 69 67 6e 6f 72 65 64 2e 00 ignored.. 00007ea7 : 7ea7: 41 64 76 61 6e 63 65 20 4b 3d 00 Advance K=. 00007eb2 : 7eb2: 4b 20 6f 75 74 20 6f 66 20 61 6c 6c 6f 77 65 64 K out of allowed 7ec2: 20 72 61 6e 67 65 21 00 range!. 00007eca <_sPrinterName>: 7eca: 4d 4b 33 00 MK3. 00007ece <_sPrinterMmuName>: 7ece: 4d 4b 33 4d 4d 55 33 00 MK3MMU3. 00007ed6 <_nPrinterMmuType>: 7ed6: 5c 76 \v 00007ed8 <_nPrinterType>: 7ed8: 2c 01 ,. 00007eda : 7eda: 25 33 64 2f 25 33 64 00 %3d/%3d. 00007ee2 : 7ee2: 25 33 64 00 %3d. 00007ee6 : 7ee6: 20 0a 20 0a 20 0a 20 00 . . . . 00007eee : 7eee: 25 53 41 72 63 20 53 65 74 74 69 6e 67 73 3a 20 %SArc Settings: 7efe: 50 3a 4d 61 78 20 6c 65 6e 67 74 68 28 6d 6d 29 P:Max length(mm) 7f0e: 20 53 3a 4d 69 6e 20 6c 65 6e 67 74 68 20 28 6d S:Min length (m 7f1e: 6d 29 20 4e 3a 43 6f 72 72 65 63 74 69 6f 6e 73 m) N:Corrections 7f2e: 20 52 3a 4d 69 6e 20 73 65 67 6d 65 6e 74 73 20 R:Min segments 7f3e: 46 3a 53 65 67 6d 65 6e 74 73 2f 73 65 63 2e 0a F:Segments/sec.. 7f4e: 25 53 20 20 4d 32 31 34 20 50 25 2e 32 66 20 53 %S M214 P%.2f S 7f5e: 25 2e 32 66 20 4e 25 64 20 52 25 64 20 46 25 64 %.2f N%d R%d F%d 7f6e: 0a 00 .. 00007f70 : 7f70: 25 53 46 69 6c 61 6d 65 6e 74 20 73 65 74 74 69 %SFilament setti 7f80: 6e 67 73 3a 20 44 69 73 61 62 6c 65 64 0a 00 ngs: Disabled.. 00007f8f : 7f8f: 25 53 46 69 6c 61 6d 65 6e 74 20 73 65 74 74 69 %SFilament setti 7f9f: 6e 67 73 3a 0a 25 53 20 20 20 4d 32 30 30 20 44 ngs:.%S M200 D 7faf: 25 2e 32 66 0a 00 %.2f.. 00007fb5 : 7fb5: 25 53 52 65 74 72 61 63 74 3a 20 53 3d 4c 65 6e %SRetract: S=Len 7fc5: 67 74 68 20 28 6d 6d 29 20 46 3a 53 70 65 65 64 gth (mm) F:Speed 7fd5: 20 28 6d 6d 2f 6d 29 20 5a 3a 20 5a 4c 69 66 74 (mm/m) Z: ZLift 7fe5: 20 28 6d 6d 29 0a 25 53 20 20 20 4d 32 30 37 20 (mm).%S M207 7ff5: 53 25 2e 32 66 20 46 25 2e 32 66 20 5a 25 2e 32 S%.2f F%.2f Z%.2 8005: 66 0a 25 53 52 65 63 6f 76 65 72 3a 20 53 3d 45 f.%SRecover: S=E 8015: 78 74 72 61 20 6c 65 6e 67 74 68 20 28 6d 6d 29 xtra length (mm) 8025: 20 46 3a 53 70 65 65 64 20 28 6d 6d 2f 6d 29 0a F:Speed (mm/m). 8035: 25 53 20 20 20 4d 32 30 38 20 53 25 2e 32 66 20 %S M208 S%.2f 8045: 46 25 2e 32 66 0a 25 53 41 75 74 6f 2d 52 65 74 F%.2f.%SAuto-Ret 8055: 72 61 63 74 3a 20 53 3d 30 20 74 6f 20 64 69 73 ract: S=0 to dis 8065: 61 62 6c 65 2c 20 31 20 74 6f 20 69 6e 74 65 72 able, 1 to inter 8075: 70 72 65 74 20 65 78 74 72 75 64 65 2d 6f 6e 6c pret extrude-onl 8085: 79 20 6d 6f 76 65 73 20 61 73 20 72 65 74 72 61 y moves as retra 8095: 63 74 73 20 6f 72 20 72 65 63 6f 76 65 72 69 65 cts or recoverie 80a5: 73 0a 25 53 20 20 20 4d 32 30 39 20 53 25 64 0a s.%S M209 S%d. ... 000080b6 : 80b6: 25 53 50 49 44 20 68 65 61 74 62 65 64 20 73 65 %SPID heatbed se 80c6: 74 74 69 6e 67 73 3a 0a 25 53 20 20 20 4d 33 30 ttings:.%S M30 80d6: 34 20 50 25 2e 32 66 20 49 25 2e 32 66 20 44 25 4 P%.2f I%.2f D% 80e6: 2e 32 66 0a 00 .2f.. 000080eb : 80eb: 25 53 50 49 44 20 73 65 74 74 69 6e 67 73 3a 0a %SPID settings:. 80fb: 25 53 20 20 20 4d 33 30 31 20 50 25 2e 32 66 20 %S M301 P%.2f 810b: 49 25 2e 32 66 20 44 25 2e 32 66 0a 00 I%.2f D%.2f.. 00008118 : 8118: 25 53 53 74 65 70 73 20 70 65 72 20 75 6e 69 74 %SSteps per unit 8128: 3a 0a 25 53 20 20 4d 39 32 20 58 25 2e 32 66 20 :.%S M92 X%.2f 8138: 59 25 2e 32 66 20 5a 25 2e 32 66 20 45 25 2e 32 Y%.2f Z%.2f E%.2 8148: 66 0a 25 53 55 53 74 65 70 20 72 65 73 6f 6c 75 f.%SUStep resolu 8158: 74 69 6f 6e 3a 20 0a 25 53 20 4d 33 35 30 20 58 tion: .%S M350 X 8168: 25 64 20 59 25 64 20 5a 25 64 20 45 25 64 0a 25 %d Y%d Z%d E%d.% 8178: 53 4d 61 78 69 6d 75 6d 20 66 65 65 64 72 61 74 SMaximum feedrat 8188: 65 73 20 2d 20 6e 6f 72 6d 61 6c 20 28 6d 6d 2f es - normal (mm/ 8198: 73 29 3a 0a 25 53 20 20 4d 32 30 33 20 58 25 2e s):.%S M203 X%. 81a8: 32 66 20 59 25 2e 32 66 20 5a 25 2e 32 66 20 45 2f Y%.2f Z%.2f E 81b8: 25 2e 32 66 0a 25 53 4d 61 78 69 6d 75 6d 20 66 %.2f.%SMaximum f 81c8: 65 65 64 72 61 74 65 73 20 2d 20 73 74 65 61 6c eedrates - steal 81d8: 74 68 20 28 6d 6d 2f 73 29 3a 0a 25 53 20 20 4d th (mm/s):.%S M 81e8: 32 30 33 20 58 25 2e 32 66 20 59 25 2e 32 66 20 203 X%.2f Y%.2f 81f8: 5a 25 2e 32 66 20 45 25 2e 32 66 0a 25 53 4d 61 Z%.2f E%.2f.%SMa 8208: 78 69 6d 75 6d 20 61 63 63 65 6c 65 72 61 74 69 ximum accelerati 8218: 6f 6e 20 2d 20 6e 6f 72 6d 61 6c 20 28 6d 6d 2f on - normal (mm/ 8228: 73 32 29 3a 0a 25 53 20 20 4d 32 30 31 20 58 25 s2):.%S M201 X% 8238: 6c 75 20 59 25 6c 75 20 5a 25 6c 75 20 45 25 6c lu Y%lu Z%lu E%l 8248: 75 0a 25 53 4d 61 78 69 6d 75 6d 20 61 63 63 65 u.%SMaximum acce 8258: 6c 65 72 61 74 69 6f 6e 20 2d 20 73 74 65 61 6c leration - steal 8268: 74 68 20 28 6d 6d 2f 73 32 29 3a 0a 25 53 20 20 th (mm/s2):.%S 8278: 4d 32 30 31 20 58 25 6c 75 20 59 25 6c 75 20 5a M201 X%lu Y%lu Z 8288: 25 6c 75 20 45 25 6c 75 0a 25 53 41 63 63 65 6c %lu E%lu.%SAccel 8298: 65 72 61 74 69 6f 6e 3a 20 50 3d 70 72 69 6e 74 eration: P=print 82a8: 2c 20 52 3d 72 65 74 72 61 63 74 2c 20 54 3d 74 , R=retract, T=t 82b8: 72 61 76 65 6c 0a 25 53 20 20 4d 32 30 34 20 50 ravel.%S M204 P 82c8: 25 2e 32 66 20 52 25 2e 32 66 20 54 25 2e 32 66 %.2f R%.2f T%.2f 82d8: 0a 25 53 41 64 76 61 6e 63 65 64 20 76 61 72 69 .%SAdvanced vari 82e8: 61 62 6c 65 73 3a 20 53 3d 4d 69 6e 20 66 65 65 ables: S=Min fee 82f8: 64 72 61 74 65 20 28 6d 6d 2f 73 29 2c 20 54 3d drate (mm/s), T= 8308: 4d 69 6e 20 74 72 61 76 65 6c 20 66 65 65 64 72 Min travel feedr 8318: 61 74 65 20 28 6d 6d 2f 73 29 2c 20 42 3d 6d 69 ate (mm/s), B=mi 8328: 6e 69 6d 75 6d 20 73 65 67 6d 65 6e 74 20 74 69 nimum segment ti 8338: 6d 65 20 28 75 73 29 2c 20 58 3d 6d 61 78 69 6d me (us), X=maxim 8348: 75 6d 20 58 59 20 6a 65 72 6b 20 28 6d 6d 2f 73 um XY jerk (mm/s 8358: 29 2c 20 20 5a 3d 6d 61 78 69 6d 75 6d 20 5a 20 ), Z=maximum Z 8368: 6a 65 72 6b 20 28 6d 6d 2f 73 29 2c 20 20 45 3d jerk (mm/s), E= 8378: 6d 61 78 69 6d 75 6d 20 45 20 6a 65 72 6b 20 28 maximum E jerk ( 8388: 6d 6d 2f 73 29 0a 25 53 20 20 4d 32 30 35 20 53 mm/s).%S M205 S 8398: 25 2e 32 66 20 54 25 2e 32 66 20 42 25 6c 75 20 %.2f T%.2f B%lu 83a8: 58 25 2e 32 66 20 59 25 2e 32 66 20 5a 25 2e 32 X%.2f Y%.2f Z%.2 83b8: 66 20 45 25 2e 32 66 0a 25 53 48 6f 6d 65 20 6f f E%.2f.%SHome o 83c8: 66 66 73 65 74 20 28 6d 6d 29 3a 0a 25 53 20 20 ffset (mm):.%S 83d8: 4d 32 30 36 20 58 25 2e 32 66 20 59 25 2e 32 66 M206 X%.2f Y%.2f 83e8: 20 5a 25 2e 32 66 0a 00 Z%.2f.. 000083f0 : 83f0: 54 4d 3a 20 52 5b 25 75 5d 20 65 73 74 69 6d 61 TM: R[%u] estima 8400: 74 65 2e 00 te.. 00008404 : 8404: 54 4d 3a 20 25 53 20 52 20 25 64 43 00 TM: %S R %dC. 00008411 : 8411: 54 4d 3a 20 25 53 20 43 20 65 73 74 2e 00 TM: %S C est.. 0000841f : 841f: 54 4d 3a 20 63 6f 6f 6c 20 64 6f 77 6e 20 3c 25 TM: cool down <% 842f: 64 43 00 dC. 00008432 : 8432: 72 65 66 69 6e 65 00 refine. 00008439 : 8439: 69 6e 69 74 69 61 6c 00 initial. 00008441 : 8441: 54 4d 3a 20 63 61 6c 69 62 72 2e 20 66 61 69 6c TM: calibr. fail 8451: 65 64 21 00 ed!. 00008455 : 8455: 54 4d 3a 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 TM: calibration 8465: 73 74 61 72 74 00 start. 0000846b : 846b: 54 4d 3a 20 43 61 6c 2e 20 4e 4f 54 20 49 44 4c TM: Cal. NOT IDL 847b: 45 00 E. 0000847d : 847d: 43 61 70 3a 25 53 3a 25 63 0a 00 Cap:%S:%c.. 00008488 : 8488: 50 52 55 53 41 5f 4d 4d 55 32 00 PRUSA_MMU2. 00008493 : 8493: 45 58 54 45 4e 44 45 44 5f 4d 32 30 00 EXTENDED_M20. 000084a0 : 84a0: 41 55 54 4f 52 45 50 4f 52 54 5f 50 4f 53 49 54 AUTOREPORT_POSIT 84b0: 49 4f 4e 00 ION. 000084b4 : 84b4: 41 55 54 4f 52 45 50 4f 52 54 5f 46 41 4e 53 00 AUTOREPORT_FANS. 000084c4 : 84c4: 41 55 54 4f 52 45 50 4f 52 54 5f 54 45 4d 50 00 AUTOREPORT_TEMP. 000084d4 : ... 000084d5 : 84d5: 33 2e 31 34 2e 31 00 3.14.1. 000084dc : 84dc: 44 65 6c 65 74 69 6f 6e 20 66 61 69 6c 65 64 2c Deletion failed, 84ec: 20 46 69 6c 65 3a 20 00 File: . 000084f4 : 84f4: 46 69 6c 65 20 64 65 6c 65 74 65 64 3a 00 File deleted:. 00008502 : 8502: 4e 6f 74 20 53 44 20 70 72 69 6e 74 69 6e 67 00 Not SD printing. 00008512 : 8512: 50 72 69 6e 74 20 73 61 76 65 64 00 Print saved. 0000851e : 851e: 53 44 20 70 72 69 6e 74 20 70 61 75 73 65 64 00 SD print paused. 0000852e : 852e: 25 33 64 2f 25 33 64 00 %3d/%3d. 00008536 : 8536: 4f 4b 00 OK. 00008539 : 8539: 42 41 44 00 BAD. 0000853d : 853d: 52 41 4d 42 6f 20 46 41 4e 20 00 RAMBo FAN . 00008548 : 8548: 43 52 41 53 48 5f 43 41 4e 43 45 4c 00 CRASH_CANCEL. 00008555 : 8555: 43 52 41 53 48 5f 52 45 43 4f 56 45 52 00 CRASH_RECOVER. 00008563 : 8563: 43 52 41 53 48 5f 52 45 43 4f 56 45 52 00 CRASH_RECOVER. 00008571 <_ZZ16process_commandsvE3__c__98_>: 8571: 22 28 32 29 00 "(2). 00008576 <_ZZ16process_commandsvE3__c__97_>: 8576: 25 53 3a 20 25 53 0a 00 %S: %S.. 0000857e <_ZZ16process_commandsvE3__c__96_>: 857e: 2c 20 4d 39 30 37 20 45 20 69 67 6e 6f 72 65 64 , M907 E ignored ... 0000858f <_ZZ16process_commandsvE3__c__95_>: 858f: 6e 6f 20 76 61 6c 69 64 20 63 6f 6d 6d 61 6e 64 no valid command ... 000085a0 <_ZZ16process_commandsvE3__c__94_>: 85a0: 7a 65 72 6f 72 69 7a 65 64 00 zerorized. 000085aa <_ZZ16process_commandsvE3__c__93_>: 85aa: 66 61 63 74 6f 72 79 20 72 65 73 74 6f 72 65 64 factory restored ... 000085bb <_ZZ16process_commandsvE3__c__91_>: 85bb: 69 6e 64 65 78 2c 20 74 65 6d 70 2c 20 75 73 74 index, temp, ust 85cb: 65 70 2c 20 75 6d 00 ep, um. 000085d2 <_ZZ16process_commandsvE3__c__92_>: 85d2: 50 49 4e 44 41 20 63 61 6c 20 73 74 61 74 75 73 PINDA cal status 85e2: 3a 20 00 : . 000085e5 <_ZZ16process_commandsvE3__c__90_>: 85e5: 50 3a 00 P:. 000085e8 <_ZZ16process_commandsvE3__c__89_>: 85e8: 57 61 69 74 20 66 6f 72 20 50 49 4e 44 41 20 74 Wait for PINDA t 85f8: 61 72 67 65 74 20 74 65 6d 70 65 72 61 74 75 72 arget temperatur 8608: 65 3a 00 e:. 0000860b <_ZZ16process_commandsvE3__c__88_>: 860b: 20 41 00 A. 0000860e <_ZZ16process_commandsvE3__c__87_>: 860e: 20 50 00 P. 00008611 <_ZZ16process_commandsvE3__c__86_>: 8611: 20 42 00 B. 00008614 <_ZZ16process_commandsvE3__c__85_>: 8614: 20 4c 00 L. 00008617 <_ZZ16process_commandsvE3__c__84_>: 8617: 20 52 00 R. 0000861a <_ZZ16process_commandsvE3__c__83_>: 861a: 20 5a 00 Z. 0000861d <_ZZ16process_commandsvE3__c__82_>: 861d: 20 4e 4f 54 20 49 4e 49 54 49 41 4c 49 5a 45 44 NOT INITIALIZED ... 0000862e <_ZZ16process_commandsvE3__c__81_>: 862e: 53 68 65 65 74 20 00 Sheet . 00008635 <_ZZ16process_commandsvE3__c__80_>: 8635: 20 5a 20 56 41 4c 55 45 20 4f 55 54 20 4f 46 20 Z VALUE OUT OF 8645: 52 41 4e 47 45 00 RANGE. 0000864b <_ZZ16process_commandsvE3__c__79_>: 864b: 49 6e 76 61 6c 69 64 20 73 68 65 65 74 20 49 44 Invalid sheet ID 865b: 2e 20 41 6c 6c 6f 77 65 64 3a 20 30 2e 2e 00 . Allowed: 0... 0000866a <_ZZ16process_commandsvE3__c__78_>: 866a: 41 55 54 4f 00 AUTO. 0000866f <_ZZ16process_commandsvE3__c__77_>: 866f: 4c 41 4e 47 20 53 45 4c 20 46 4f 52 43 45 44 00 LANG SEL FORCED. 0000867f <_ZZ16process_commandsvE3__c__76_>: 867f: 20 64 3a 00 d:. 00008683 <_ZZ16process_commandsvE3__c__75_>: 8683: 20 69 3a 00 i:. 00008687 <_ZZ16process_commandsvE3__c__74_>: 8687: 20 70 3a 00 p:. 0000868b <_ZZ16process_commandsvE3__c__73_>: 868b: 20 64 3a 00 d:. 0000868f <_ZZ16process_commandsvE3__c__72_>: 868f: 20 69 3a 00 i:. 00008693 <_ZZ16process_commandsvE3__c__71_>: 8693: 20 70 3a 00 p:. 00008697 <_ZZ16process_commandsvE3__c__70_>: 8697: 25 69 25 25 0a 00 %i%%.. 0000869d <_ZZ16process_commandsvE3__c__69_>: 869d: 25 69 25 25 0a 00 %i%%.. 000086a3 <_ZZ16process_commandsvE3__c__68_>: 86a3: 22 28 31 29 00 "(1). 000086a8 <_ZZ16process_commandsvE3__c__61_>: 86a8: 2f 2f 00 //. 000086ab <_ZZ16process_commandsvE3__c__60_>: ... 000086ac <_ZZ16process_commandsvE3__c__59_>: 86ac: 20 45 58 54 52 55 44 45 52 5f 43 4f 55 4e 54 3a EXTRUDER_COUNT: 86bc: 31 00 1. 000086be <_ZZ16process_commandsvE3__c__58_>: 86be: 20 4d 41 43 48 49 4e 45 5f 54 59 50 45 3a 00 MACHINE_TYPE:. 000086cd <_ZZ16process_commandsvE3__c__57_>: 86cd: 31 2e 30 00 1.0. 000086d1 <_ZZ16process_commandsvE3__c__56_>: 86d1: 20 62 61 73 65 64 20 6f 6e 20 4d 61 72 6c 69 6e based on Marlin 86e1: 20 46 49 52 4d 57 41 52 45 5f 55 52 4c 3a 68 74 FIRMWARE_URL:ht 86f1: 74 70 73 3a 2f 2f 67 69 74 68 75 62 2e 63 6f 6d tps://github.com 8701: 2f 70 72 75 73 61 33 64 2f 50 72 75 73 61 2d 46 /prusa3d/Prusa-F 8711: 69 72 6d 77 61 72 65 20 50 52 4f 54 4f 43 4f 4c irmware PROTOCOL 8721: 5f 56 45 52 53 49 4f 4e 3a 00 _VERSION:. 0000872b <_ZZ16process_commandsvE3__c__55_>: 872b: 30 30 30 30 30 30 30 30 30 00 000000000. 00008735 <_ZZ16process_commandsvE3__c__54_>: 8735: 5f 00 _. 00008737 <_ZZ16process_commandsvE3__c__53_>: 8737: 38 32 33 37 00 8237. 0000873c <_ZZ16process_commandsvE3__c__52_>: 873c: 2b 00 +. 0000873e <_ZZ16process_commandsvE3__c__51_>: 873e: 46 49 52 4d 57 41 52 45 5f 4e 41 4d 45 3a 50 72 FIRMWARE_NAME:Pr 874e: 75 73 61 2d 46 69 72 6d 77 61 72 65 20 00 usa-Firmware . 0000875c <_ZZ16process_commandsvE3__c__50_>: 875c: 4d 31 31 33 20 53 00 M113 S. 00008763 <_ZZ16process_commandsvE3__c__49_>: 8763: 6f 6b 20 00 ok . 00008767 <_ZZ16process_commandsvE3__c__48_>: 8767: 20 63 6d 2e 00 cm.. 0000876c <_ZZ16process_commandsvE3__c__47_>: 876c: 20 6d 69 6e 20 00 min . 00008772 <_ZZ16process_commandsvE3__c__46_>: 8772: 53 54 41 54 53 20 00 STATS . 00008779 <_ZZ16process_commandsvE3__c__41_>: 8779: 6e 2f 61 00 n/a. 0000877d <_ZZ16process_commandsvE3__c__40_>: 877d: 3f 54 6f 73 68 69 62 61 20 46 6c 61 73 68 41 69 ?Toshiba FlashAi 878d: 72 20 47 65 74 49 50 20 66 61 69 6c 65 64 0a 00 r GetIP failed.. 0000879d : 879d: 00 01 25 31 1d 0c 40 24 30 1c 0b 45 23 2f 1b 0a ..%1..@$0..E#/.. 87ad: 17 ff 04 06 22 2b 1a 03 36 37 35 38 ...."+..6758 000087b9 <_ZZ16process_commandsvE3__c__39_>: 87b9: 25 69 20 6d 69 6e 2c 20 25 69 20 73 65 63 00 %i min, %i sec. 000087c8 <_ZZ16process_commandsvE3__c__36_>: 87c8: 49 6e 76 61 6c 69 64 20 4d 20 63 6f 64 65 3a 20 Invalid M code: 87d8: 25 73 0a 00 %s.. 000087dc <_ZZ16process_commandsvE3__c__30_>: 87dc: 50 49 4e 44 41 20 70 72 6f 62 65 20 63 61 6c 69 PINDA probe cali 87ec: 62 72 61 74 69 6f 6e 20 73 74 61 72 74 00 bration start. 000087fa <_ZZ16process_commandsvE3__c__29_>: 87fa: 4e 6f 20 50 49 4e 44 41 20 74 68 65 72 6d 69 73 No PINDA thermis 880a: 74 6f 72 00 tor. 0000880e <_ZZ16process_commandsvE3__c__25_>: 880e: 73 65 74 00 set. 00008812 <_ZZ16process_commandsvE3__c__24_>: 8812: 6e 6f 7a 7a 6c 65 00 nozzle. 00008819 <_ZZ16process_commandsvE3__c__23_>: 8819: 4d 42 4c 00 MBL. 0000881d <_ZZ16process_commandsvE3__c__22_>: 881d: 46 52 00 FR. 00008820 <_ZZ16process_commandsvE3__c__21_>: 8820: 4c 7a 00 Lz. 00008823 <_ZZ16process_commandsvE3__c__20_>: 8823: 4c 61 6e 67 00 Lang. 00008828 <_ZZ16process_commandsvE3__c__19_>: 8828: 31 5f 37 35 6d 6d 5f 4d 4b 33 2d 45 49 4e 53 79 1_75mm_MK3-EINSy 8838: 5f 31 30 61 2d 45 33 44 76 36 66 75 6c 6c 00 _10a-E3Dv6full. 00008847 <_ZZ16process_commandsvE3__c__18_>: 8847: 52 65 76 00 Rev. 0000884b <_ZZ16process_commandsvE3__c__17_>: 884b: 33 2e 31 34 2e 31 2d 38 32 33 37 00 3.14.1-8237. 00008857 <_ZZ16process_commandsvE3__c__16_>: 8857: 46 69 72 00 Fir. 0000885b <_ZZ16process_commandsvE3__c__15_>: 885b: 53 4e 20 69 6e 76 61 6c 69 64 00 SN invalid. 00008866 <_ZZ16process_commandsvE3__c__14_>: 8866: 53 4e 00 SN. 00008869 <_ZZ16process_commandsvE3__c__13_>: 8869: 52 45 53 45 54 00 RESET. 0000886f <_ZZ16process_commandsvE3__c__12_>: 886f: 4d 4d 55 52 45 53 00 MMURES. 00008876 <_ZZ16process_commandsvE3__c__11_>: 8876: 75 76 6c 6f 00 uvlo. 0000887b : 887b: 46 41 4e 00 FAN. 0000887f : 887f: 46 41 4e 50 49 4e 54 53 54 00 FANPINTST. 00008889 : 8889: 50 52 55 53 41 00 PRUSA. 0000888f : 888f: 53 45 54 5f 43 48 4f 50 5f 00 SET_CHOP_. 00008899 : 8899: 53 45 54 5f 53 54 45 50 5f 00 SET_STEP_. 000088a3 : 88a3: 53 45 54 5f 57 41 56 45 5f 00 SET_WAVE_. 000088ad : 88ad: 54 4d 43 5f 00 TMC_. 000088b2 : 88b2: 43 52 41 53 48 5f 43 41 4e 43 45 4c 00 CRASH_CANCEL. 000088bf : 88bf: 43 52 41 53 48 5f 52 45 43 4f 56 45 52 00 CRASH_RECOVER. 000088cd : 88cd: 43 52 41 53 48 5f 44 45 54 45 43 54 45 44 00 CRASH_DETECTED. 000088dc : 88dc: 43 52 41 53 48 5f 00 CRASH_. 000088e3 : 88e3: 47 31 20 58 31 30 20 59 31 38 30 20 46 34 30 30 G1 X10 Y180 F400 88f3: 30 00 0. 000088f5 : 88f5: 47 31 20 5a 31 30 20 46 31 33 30 30 00 G1 Z10 F1300. 00008902 : 8902: 4d 31 34 30 20 53 30 00 M140 S0. 0000890a : 890a: 4d 31 30 34 20 53 30 00 M104 S0. 00008912 : 8912: 47 31 20 45 2d 30 2e 30 37 35 20 46 32 31 30 30 G1 E-0.075 F2100 ... 00008923 : 8923: 47 31 20 46 34 30 30 30 00 G1 F4000. 0000892c : 892c: 4d 32 30 34 20 53 31 30 30 30 00 M204 S1000. 00008937 : 8937: 47 31 20 5a 35 20 46 37 32 30 30 00 G1 Z5 F7200. 00008943 : 8943: 47 31 20 45 2d 31 2e 35 20 46 32 31 30 30 00 G1 E-1.5 F2100. 00008952 : 8952: 47 39 30 00 G90. 00008956 : 8956: 47 31 20 58 35 20 45 34 20 46 31 30 30 30 00 G1 X5 E4 F1000. 00008965 : 8965: 47 31 20 5a 30 2e 32 20 46 31 30 30 30 00 G1 Z0.2 F1000. 00008973 : 8973: 47 31 20 58 35 35 20 45 32 35 20 46 31 34 30 30 G1 X55 E25 F1400 ... 00008984 : 8984: 47 31 20 59 2d 32 20 46 31 30 30 30 00 G1 Y-2 F1000. 00008991 : 8991: 47 31 20 58 32 34 30 20 45 32 35 20 20 46 32 32 G1 X240 E25 F22 89a1: 30 30 00 00. 000089a4 : 89a4: 47 31 20 5a 30 2e 33 20 46 31 30 30 30 00 G1 Z0.3 F1000. 000089b2 : 89b2: 47 31 20 58 35 35 20 45 38 20 46 32 30 30 30 00 G1 X55 E8 F2000. 000089c2 : 89c2: 47 31 20 58 35 20 45 32 39 20 46 31 38 30 30 00 G1 X5 E29 F1800. 000089d2 : 89d2: 47 31 20 58 35 35 20 45 32 39 20 46 31 30 37 33 G1 X55 E29 F1073 ... 000089e3 : 89e3: 47 39 32 20 45 30 00 G92 E0. 000089ea : 89ea: 47 32 38 00 G28. 000089ee : 89ee: 4d 31 30 39 00 M109. 000089f3 : 89f3: 4d 31 39 30 00 M190. 000089f8 : 89f8: 47 38 30 00 G80. 000089fc : 89fc: 4d 34 35 00 M45. 00008a00 : 8a00: 4d 34 35 20 5a 00 M45 Z. 00008a06 : 8a06: 47 37 36 00 G76. 00008a0a : 8a0a: 4d 37 30 31 20 50 30 00 M701 P0. 00008a12 : 8a12: 57 69 7a 61 72 64 20 73 74 61 74 65 3a 20 25 64 Wizard state: %d 8a22: 0a 00 .. 00008a24 : 8a24: 4d 39 31 34 00 M914. 00008a29 : 8a29: 4d 39 31 35 00 M915. 00008a2e : 8a2e: 45 78 70 65 72 69 6d 65 6e 74 61 6c 00 Experimental. 00008a3b : 8a3b: 30 2e 38 30 00 0.80. 00008a40 : 8a40: 30 2e 36 30 00 0.60. 00008a45 : 8a45: 30 2e 34 30 00 0.40. 00008a4a : 8a4a: 30 2e 32 35 00 0.25. 00008a4f : 8a4f: 52 65 73 65 74 20 4d 4d 55 00 Reset MMU. 00008a59 : 8a59: 4d 4d 55 00 MMU. 00008a5d : 8a5d: 4d 34 34 00 M44. 00008a61 : 8a61: 47 32 38 20 58 59 00 G28 XY. 00008a68 : 8a68: 4d 20 38 34 00 M 84. 00008a6d : 8a6d: 85 2e 2e 00 .... 00008a71 : 8a71: 59 3a 20 25 75 20 2d 3e 20 2e 2e 2e 00 Y: %u -> .... 00008a7e : 8a7e: 58 3a 20 25 75 20 2d 3e 20 2e 2e 2e 00 X: %u -> .... 00008a8b : 8a8b: 25 33 64 2f 30 00 %3d/0. 00008a91 : 8a91: 25 33 64 2f 30 00 %3d/0. 00008a97 : 8a97: 25 63 20 41 58 49 53 20 53 47 31 3d 25 64 0a 00 %c AXIS SG1=%d.. 00008aa7 : 8aa7: 48 6f 74 65 6e 64 00 Hotend. 00008aae : 8aae: 42 65 64 00 Bed. 00008ab2 : 8ab2: 5a 00 Z. 00008ab4 : 8ab4: 59 00 Y. 00008ab6 : 8ab6: 58 00 X. 00008ab8 <_ZL13STR_SEPARATOR.lto_priv.442>: 8ab8: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ---------------- 8ac8: 2d 2d 2d 2d 00 ----. 00008acd : 8acd: 43 5a 50 58 49 6e 76 61 6c 69 64 53 65 72 69 61 CZPXInvalidSeria 8add: 6c 4e 72 00 lNr. 00008ae1 : 8ae1: 81 6a 12 89 0a 89 02 89 f5 88 e3 88 .j.......... 00008aed : 8aed: 47 31 20 58 25 64 20 59 25 64 20 45 25 2d 2e 35 G1 X%d Y%d E%-.5 8afd: 66 00 f. 00008aff : 8aff: 47 31 20 46 31 30 38 30 00 G1 F1080. 00008b08 : 8b08: 47 31 20 5a 25 2d 2e 33 66 20 46 37 32 30 30 00 G1 Z%-.3f F7200. 00008b18 : 8b18: 47 31 20 58 35 30 20 59 31 35 35 00 G1 X50 Y155. 00008b24 : 8b24: e3 89 52 89 1a 6c 43 89 37 89 2c 89 23 89 ..R..lC.7.,.#. 00008b32 : 8b32: 47 31 20 58 25 64 20 45 25 2d 2e 33 66 20 46 31 G1 X%d E%-.3f F1 8b42: 30 30 30 00 000. 00008b46 : 8b46: d2 89 c2 89 b2 89 a4 89 e3 89 91 89 84 89 73 89 ..............s. 8b56: 65 89 56 89 e.V. 00008b5a : 8b5a: 54 25 64 00 T%d. 00008b5e : 8b5e: 47 31 20 5a 30 2e 34 20 46 31 30 30 30 00 G1 Z0.4 F1000. 00008b6c : 8b6c: 47 31 20 59 2d 33 20 46 31 30 30 30 00 G1 Y-3 F1000. 00008b79 : 8b79: 81 6a f3 89 ee 89 ea 89 e3 89 .j........ 00008b83 : 8b83: 4d 38 34 20 58 59 00 M84 XY. 00008b8a : 8b8a: 4d 31 30 39 20 53 32 38 30 00 M109 S280. 00008b94 : 8b94: 47 31 20 58 31 32 35 20 5a 32 30 30 20 46 31 30 G1 X125 Z200 F10 8ba4: 30 30 00 00. 00008ba7 : 8ba7: 4d 33 31 30 20 41 20 46 31 00 M310 A F1. 00008bb1 : 8bb1: 47 31 20 58 31 32 35 20 59 31 30 35 20 5a 31 20 G1 X125 Y105 Z1 8bc1: 46 38 30 30 30 00 F8000. 00008bc7 : 8bc7: 49 6e 76 61 6c 69 64 20 50 49 44 20 63 61 6c 2e Invalid PID cal. 8bd7: 20 72 65 73 75 6c 74 73 2e 20 4e 6f 74 20 73 74 results. Not st 8be7: 6f 72 65 64 20 74 6f 20 45 45 50 52 4f 4d 2e 00 ored to EEPROM.. 00008bf7 : 8bf7: 4d 33 30 31 20 50 25 2e 32 66 20 49 25 2e 32 66 M301 P%.2f I%.2f 8c07: 20 44 25 2e 32 66 00 D%.2f. 00008c0e : 8c0e: 4d 33 30 33 20 45 30 20 53 25 33 75 00 M303 E0 S%3u. 00008c1b : 8c1b: 52 43 00 RC. 00008c1e : 8c1e: 44 45 56 00 DEV. 00008c22 : 8c22: 42 45 54 41 00 BETA. 00008c27 : 8c27: 41 4c 50 48 41 00 ALPHA. 00008c2d : 8c2d: 00 00 21 00 24 00 27 00 2a 00 2d 00 30 00 33 00 ..!.$.'.*.-.0.3. 8c3d: 01 01 00 00 04 01 07 01 0a 01 .......... 00008c47 : 8c47: 00 00 22 00 25 00 28 00 2b 00 2e 00 31 00 34 00 ..".%.(.+...1.4. 8c57: 02 01 00 00 05 01 08 01 0b 01 .......... 00008c61 : 8c61: 00 00 20 00 23 00 26 00 29 00 2c 00 2f 00 32 00 .. .#.&.).,./.2. 8c71: 00 01 00 00 03 01 06 01 09 01 .......... 00008c7b : 8c7b: 05 05 05 05 07 05 08 08 08 08 02 02 02 02 0a 0a ................ 8c8b: 08 08 04 04 04 04 01 01 01 01 01 01 01 01 03 03 ................ 8c9b: 03 03 03 03 03 03 04 07 07 07 0c 0c 0c 0c 0c 0c ................ 8cab: 0c 0c 02 02 02 02 06 06 06 06 06 06 06 06 0b 0b ................ 8cbb: 0b 0b 0b 0b 0b 0b 07 07 0a 0a 0a 0a 0a 0a 05 05 ................ 8ccb: 05 04 04 04 08 08 ...... 00008cd1 : 8cd1: 01 02 10 20 20 08 08 10 20 40 10 20 40 80 02 01 ... ... @. @... 8ce1: 02 01 08 04 02 01 01 02 04 08 10 20 40 80 80 40 ........... @..@ 8cf1: 20 10 08 04 02 01 80 04 02 01 80 40 20 10 08 04 ..........@ ... 8d01: 02 01 08 04 02 01 01 02 04 08 10 20 40 80 01 02 ........... @... 8d11: 04 08 10 20 40 80 10 08 04 08 80 10 20 40 04 40 ... @....... @.@ 8d21: 80 10 20 40 04 80 .. @.. 00008d27 : 8d27: 00 00 0a 0b 02 09 0c 0d 0e 08 07 03 04 01 00 00 ................ ... 8d53: 12 11 10 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ ... 00008d7d : 8d7d: 33 2e 31 34 2e 31 00 3.14.1. 00008d84 : 8d84: 0a 20 4f 72 69 67 69 6e 61 6c 20 50 72 75 73 61 . Original Prusa 8d94: 20 69 33 0a 20 20 20 50 72 75 73 61 20 52 65 73 i3. Prusa Res 8da4: 65 61 72 63 68 0a 25 32 30 2e 32 30 53 00 earch.%20.20S. 00008db2 : 8db2: 4c 61 6e 67 75 61 67 65 20 75 70 64 61 74 65 00 Language update. 00008dc2 : 8dc2: 43 5a 50 58 00 CZPX. 00008dc7 : 8dc7: 3b 53 00 ;S. 00008dca : 8dca: 53 70 6f 6f 6c 4a 6f 69 6e 20 69 73 20 00 SpoolJoin is . 00008dd8 : 8dd8: 61 64 63 5f 69 6e 69 74 00 adc_init. 00008de1 : 8de1: 20 0a 20 0a 20 0a 20 00 . . . . 00008de9 : 8de9: 41 6c 6c 20 44 61 74 61 00 All Data. 00008df2 : 8df2: 53 65 72 76 69 63 65 20 70 72 65 70 00 Service prep. 00008dff : 8dff: 53 68 69 70 70 69 6e 67 20 70 72 65 70 00 Shipping prep. 00008e0d : 8e0d: 53 74 61 74 69 73 74 69 63 73 00 Statistics. 00008e18 : 8e18: 4c 61 6e 67 75 61 67 65 00 Language. 00008e21 <_ZZL13factory_resetcE3__c.lto_priv.533>: 8e21: 45 52 41 53 49 4e 47 20 61 6c 6c 20 64 61 74 61 ERASING all data ... 00008e32 : 8e32: 46 61 63 74 6f 72 79 20 52 45 53 45 54 00 Factory RESET. 00008e40 : 8e40: 50 52 55 53 41 33 44 46 57 00 PRUSA3DFW. 00008e4a <_ZL8MSG_INT4.lto_priv.482>: 8e4a: 49 4e 54 34 00 INT4. 00008e4f : 8e4f: 03 00 0e 00 01 00 40 00 ......@. 00008e57 : 8e57: 03 00 02 00 00 00 04 00 ........ 00008e5f : 8e5f: 55 6e 6b 6e 6f 77 6e 00 Unknown. 00008e67 : 8e67: 31 39 37 30 2d 30 31 2d 30 31 20 30 31 3a 30 30 1970-01-01 01:00 8e77: 3a 30 30 00 :00. 00008e7b : 8e7b: 20 33 2e 31 34 2e 31 2d 38 32 33 37 5f 30 30 30 3.14.1-8237_000 8e8b: 30 30 30 30 30 30 00 000000. 00008e92 : 8e92: 73 74 61 72 74 00 start. 00008e98 : 8e98: 53 4e 20 75 70 64 61 74 65 20 66 61 69 6c 65 64 SN update failed ... 00008ea9 : 8ea9: 53 4e 20 75 70 64 61 74 65 64 00 SN updated. 00008eb4 : 8eb4: 43 5a 50 58 00 CZPX. 00008eb9 : 8eb9: 43 52 41 53 48 5f 44 45 54 45 43 54 45 44 58 59 CRASH_DETECTEDXY ... 00008eca : 8eca: 43 52 41 53 48 5f 44 45 54 45 43 54 45 44 59 00 CRASH_DETECTEDY. 00008eda : 8eda: 43 52 41 53 48 5f 44 45 54 45 43 54 45 44 58 00 CRASH_DETECTEDX. 00008eea : 8eea: 4d 32 39 00 M29. 00008eee : 8eee: 25 2d 39 2e 39 53 5b 00 %-9.9S[. 00008ef6 : 8ef6: 54 4d 20 65 73 74 69 6d 61 74 69 6f 6e 20 64 69 TM estimation di 8f06: 64 20 6e 6f 74 20 63 6f 6e 76 65 72 67 65 00 d not converge. 00008f15 : 8f15: 54 4d 20 69 74 65 72 3a 25 75 20 76 3a 25 2e 32 TM iter:%u v:%.2 8f25: 66 20 65 3a 25 2e 33 66 0a 00 f e:%.3f.. 00008f2f : 8f2f: 20 0a 20 0a 20 00 . . . 00008f35 : 8f35: 00 00 48 42 00 00 58 41 9a 99 8d 41 33 33 53 40 ..HB..XA...A33S@ 00008f45 : 8f45: 4d 4d 55 32 3a 00 MMU2:. 00008f4b : 8f4b: 4d 49 4e 54 45 4d 50 20 42 45 44 20 66 69 78 65 MINTEMP BED fixe 8f5b: 64 00 d. 00008f5d : 8f5d: 4d 49 4e 54 45 4d 50 20 48 4f 54 45 4e 44 20 66 MINTEMP HOTEND f 8f6d: 69 78 65 64 00 ixed. 00008f72 : 8f72: 72 65 63 6f 76 65 72 5f 6d 61 63 68 69 6e 65 5f recover_machine_ 8f82: 73 74 61 74 65 5f 61 66 74 65 72 5f 70 6f 77 65 state_after_powe 8f92: 72 5f 70 61 6e 69 63 2c 20 69 6e 69 74 69 61 6c r_panic, initial 8fa2: 20 00 . 00008fa4 <_ZZL25restore_print_from_eeprombE3__c__12_>: 8fa4: 50 52 55 53 41 20 75 76 6c 6f 00 PRUSA uvlo. 00008faf <_ZZL25restore_print_from_eeprombE3__c__11_>: 8faf: 47 34 20 53 30 00 G4 S0. 00008fb5 <_ZZL25restore_print_from_eeprombE3__c__10_>: 8fb5: 4d 31 31 30 20 4e 25 6c 75 00 M110 N%lu. 00008fbf : 8fbf: 4d 32 36 20 53 25 6c 75 00 M26 S%lu. 00008fc8 : 8fc8: 4d 31 30 36 20 53 25 75 00 M106 S%u. 00008fd1 : 8fd1: 47 31 20 46 25 64 00 G1 F%d. 00008fd8 : 8fd8: 4d 38 32 00 M82. 00008fdc : 8fdc: 47 39 32 20 45 25 2d 2e 33 66 00 G92 E%-.3f. 00008fe7 : 8fe7: 4d 32 30 34 20 50 25 2d 2e 31 66 20 52 25 2d 2e M204 P%-.1f R%-. 8ff7: 31 66 20 54 25 2d 2e 31 66 00 1f T%-.1f. 00009001 : 9001: 47 31 20 5a 25 2d 2e 33 66 00 G1 Z%-.3f. 0000900b : 900b: 50 52 55 53 41 20 4d 42 4c 20 56 31 00 PRUSA MBL V1. 00009018 : 9018: 47 31 20 58 25 2d 2e 33 66 20 59 25 2d 2e 33 66 G1 X%-.3f Y%-.3f 9028: 20 46 33 30 30 30 00 F3000. 0000902f : 902f: 2c 20 66 65 65 64 6d 75 6c 74 69 70 6c 79 3a 00 , feedmultiply:. 0000903f : 903f: 46 65 65 64 72 61 74 65 3a 00 Feedrate:. 00009049 : 9049: 47 31 20 45 35 20 46 31 32 30 00 G1 E5 F120. 00009054 : 9054: 4d 31 30 39 20 53 25 64 00 M109 S%d. 0000905d : 905d: 4d 31 34 30 20 53 25 64 00 M140 S%d. 00009066 : 9066: 4d 31 30 34 20 53 25 64 00 M104 S%d. 0000906f : 906f: 47 32 38 20 58 20 59 00 G28 X Y. 00009077 : 9077: 47 31 20 5a 25 2e 33 66 20 46 38 30 30 00 G1 Z%.3f F800. 00009085 : 9085: 00 00 21 10 42 20 63 30 84 40 a5 50 c6 60 e7 70 ..!.B c0.@.P.`.p 9095: 08 81 29 91 4a a1 6b b1 8c c1 ad d1 ce e1 ef f1 ..).J.k......... 90a5: 31 12 10 02 73 32 52 22 b5 52 94 42 f7 72 d6 62 1...s2R".R.B.r.b 90b5: 39 93 18 83 7b b3 5a a3 bd d3 9c c3 ff f3 de e3 9...{.Z......... 90c5: 62 24 43 34 20 04 01 14 e6 64 c7 74 a4 44 85 54 b$C4 ....d.t.D.T 90d5: 6a a5 4b b5 28 85 09 95 ee e5 cf f5 ac c5 8d d5 j.K.(........... 90e5: 53 36 72 26 11 16 30 06 d7 76 f6 66 95 56 b4 46 S6r&..0..v.f.V.F 90f5: 5b b7 7a a7 19 97 38 87 df f7 fe e7 9d d7 bc c7 [.z...8......... 9105: c4 48 e5 58 86 68 a7 78 40 08 61 18 02 28 23 38 .H.X.h.x@.a..(#8 9115: cc c9 ed d9 8e e9 af f9 48 89 69 99 0a a9 2b b9 ........H.i...+. 9125: f5 5a d4 4a b7 7a 96 6a 71 1a 50 0a 33 3a 12 2a .Z.J.z.jq.P.3:.* 9135: fd db dc cb bf fb 9e eb 79 9b 58 8b 3b bb 1a ab ........y.X.;... 9145: a6 6c 87 7c e4 4c c5 5c 22 2c 03 3c 60 0c 41 1c .l.|.L.\",.<`.A. 9155: ae ed 8f fd ec cd cd dd 2a ad 0b bd 68 8d 49 9d ........*...h.I. 9165: 97 7e b6 6e d5 5e f4 4e 13 3e 32 2e 51 1e 70 0e .~.n.^.N.>2.Q.p. 9175: 9f ff be ef dd df fc cf 1b bf 3a af 59 9f 78 8f ..........:.Y.x. 9185: 88 91 a9 81 ca b1 eb a1 0c d1 2d c1 4e f1 6f e1 ..........-.N.o. 9195: 80 10 a1 00 c2 30 e3 20 04 50 25 40 46 70 67 60 .....0. .P%@Fpg` 91a5: b9 83 98 93 fb a3 da b3 3d c3 1c d3 7f e3 5e f3 ........=.....^. 91b5: b1 02 90 12 f3 22 d2 32 35 42 14 52 77 62 56 72 .....".25B.RwbVr 91c5: ea b5 cb a5 a8 95 89 85 6e f5 4f e5 2c d5 0d c5 ........n.O.,... 91d5: e2 34 c3 24 a0 14 81 04 66 74 47 64 24 54 05 44 .4.$....ftGd$T.D 91e5: db a7 fa b7 99 87 b8 97 5f e7 7e f7 1d c7 3c d7 ........_.~...<. 91f5: d3 26 f2 36 91 06 b0 16 57 66 76 76 15 46 34 56 .&.6....Wfvv.F4V 9205: 4c d9 6d c9 0e f9 2f e9 c8 99 e9 89 8a b9 ab a9 L.m.../......... 9215: 44 58 65 48 06 78 27 68 c0 18 e1 08 82 38 a3 28 DXeH.x'h.....8.( 9225: 7d cb 5c db 3f eb 1e fb f9 8b d8 9b bb ab 9a bb }.\.?........... 9235: 75 4a 54 5a 37 6a 16 7a f1 0a d0 1a b3 2a 92 3a uJTZ7j.z.....*.: 9245: 2e fd 0f ed 6c dd 4d cd aa bd 8b ad e8 9d c9 8d ....l.M......... 9255: 26 7c 07 6c 64 5c 45 4c a2 3c 83 2c e0 1c c1 0c &|.ld\EL.<.,.... 9265: 1f ef 3e ff 5d cf 7c df 9b af ba bf d9 8f f8 9f ..>.].|......... 9275: 17 6e 36 7e 55 4e 74 5e 93 2e b2 3e d1 0e f0 1e .n6~UNt^...>.... 00009285 : 9285: 7c 3c 3e 3f 2f 2a 22 5c 00 |<>?/*"\. 0000928e : 928e: 24 f4 d4 30 50 c3 8e 20 c2 a2 40 17 82 8b 70 11 $..0P.. ..@...p. 929e: 12 7a 91 0d 81 6c d9 0a a8 61 e1 08 c7 58 66 07 .z...l...a...Xf. 92ae: 61 51 43 06 1e 4b 5d 05 c1 45 a7 04 1a 41 11 04 aQC..K]..E...A.. 92be: 09 3d 98 03 71 39 31 03 40 36 db 02 65 33 91 02 .=..q91.@6..e3.. 92ce: d4 30 54 02 80 2e 1d 02 63 2c ee 01 75 2a c5 01 .0T.....c,..u*.. 92de: b0 28 a0 01 10 27 81 01 8f 25 64 01 2b 24 4b 01 .(...'...%d.+$K. 92ee: e0 22 34 01 ac 21 1f 01 8d 20 0d 01 80 1f fc 00 ."4..!... ...... 92fe: 84 1e ed 00 97 1d df 00 b8 1c d2 00 e6 1b c6 00 ................ 930e: 20 1b bc 00 64 1a b2 00 b2 19 a8 00 0a 19 a0 00 ...d........... 931e: 6a 18 99 00 d1 17 91 00 40 17 8b 00 b5 16 84 00 j.......@....... 932e: 31 16 7e 00 b3 15 79 00 3a 15 73 00 c7 14 6f 00 1.~...y.:.s...o. 933e: 58 14 6a 00 ee 13 66 00 88 13 63 00 25 13 5e 00 X.j...f...c.%.^. 934e: c7 12 5b 00 6c 12 57 00 15 12 54 00 c1 11 51 00 ..[.l.W...T...Q. 935e: 70 11 4f 00 21 11 4b 00 d6 10 49 00 8d 10 47 00 p.O.!.K...I...G. 936e: 46 10 44 00 02 10 42 00 c0 0f 40 00 80 0f 3e 00 F.D...B...@...>. 937e: 42 0f 3c 00 06 0f 3b 00 cb 0e 38 00 93 0e 37 00 B.<...;...8...7. 938e: 5c 0e 35 00 27 0e 34 00 f3 0d 32 00 c1 0d 31 00 \.5.'.4...2...1. 939e: 90 0d 30 00 60 0d 2e 00 32 0d 2d 00 05 0d 2c 00 ..0.`...2.-...,. 93ae: d9 0c 2b 00 ae 0c 29 00 85 0c 29 00 5c 0c 27 00 ..+...)...).\.'. 93be: 35 0c 27 00 0e 0c 26 00 e8 0b 24 00 c4 0b 24 00 5.'...&...$...$. 93ce: a0 0b 23 00 7d 0b 23 00 5a 0b 21 00 39 0b 21 00 ..#.}.#.Z.!.9.!. 93de: 18 0b 20 00 f8 0a 1f 00 d9 0a 1e 00 bb 0a 1e 00 .. ............. 93ee: 9d 0a 1d 00 80 0a 1d 00 63 0a 1c 00 47 0a 1b 00 ........c...G... 93fe: 2c 0a 1b 00 11 0a 1a 00 f7 09 1a 00 dd 09 19 00 ,............... 940e: c4 09 19 00 ab 09 19 00 92 09 17 00 7b 09 18 00 ............{... 941e: 63 09 17 00 4c 09 16 00 36 09 16 00 20 09 16 00 c...L...6... ... 942e: 0a 09 15 00 f5 08 15 00 e0 08 14 00 cc 08 14 00 ................ 943e: b8 08 14 00 a4 08 14 00 90 08 13 00 7d 08 12 00 ............}... 944e: 6b 08 13 00 58 08 12 00 46 08 12 00 34 08 11 00 k...X...F...4... 945e: 23 08 11 00 12 08 11 00 01 08 11 00 f0 07 10 00 #............... 946e: e0 07 10 00 d0 07 10 00 c0 07 10 00 b0 07 0f 00 ................ 947e: a1 07 10 00 91 07 0e 00 83 07 0f 00 74 07 0f 00 ............t... 948e: 65 07 0e 00 57 07 0e 00 49 07 0e 00 3b 07 0d 00 e...W...I...;... 949e: 2e 07 0e 00 20 07 0d 00 13 07 0d 00 06 07 0d 00 .... ........... 94ae: f9 06 0c 00 ed 06 0d 00 e0 06 0c 00 d4 06 0c 00 ................ 94be: c8 06 0c 00 bc 06 0c 00 b0 06 0c 00 a4 06 0b 00 ................ 94ce: 99 06 0c 00 8d 06 0b 00 82 06 0b 00 77 06 0b 00 ............w... 94de: 6c 06 0b 00 61 06 0a 00 57 06 0b 00 4c 06 0a 00 l...a...W...L... 94ee: 42 06 0a 00 38 06 0a 00 2e 06 0a 00 24 06 0a 00 B...8.......$... 94fe: 1a 06 0a 00 10 06 09 00 07 06 0a 00 fd 05 09 00 ................ 950e: f4 05 09 00 eb 05 09 00 e2 05 09 00 d9 05 09 00 ................ 951e: d0 05 09 00 c7 05 09 00 be 05 09 00 b5 05 08 00 ................ 952e: ad 05 08 00 a5 05 09 00 9c 05 08 00 94 05 08 00 ................ 953e: 8c 05 08 00 84 05 08 00 7c 05 08 00 74 05 08 00 ........|...t... 954e: 6c 05 07 00 65 05 08 00 5d 05 07 00 56 05 08 00 l...e...]...V... 955e: 4e 05 07 00 47 05 07 00 40 05 08 00 38 05 07 00 N...G...@...8... 956e: 31 05 07 00 2a 05 07 00 23 05 07 00 1c 05 06 00 1...*...#....... 957e: 16 05 07 00 0f 05 07 00 08 05 06 00 02 05 07 00 ................ 958e: fb 04 06 00 f5 04 07 00 ee 04 06 00 e8 04 06 00 ................ 959e: e2 04 07 00 db 04 06 00 d5 04 06 00 cf 04 06 00 ................ 95ae: c9 04 06 00 c3 04 06 00 bd 04 06 00 b7 04 06 00 ................ 95be: b1 04 05 00 ac 04 06 00 a6 04 06 00 a0 04 05 00 ................ 95ce: 9b 04 06 00 95 04 05 00 90 04 06 00 8a 04 05 00 ................ 95de: 85 04 05 00 80 04 06 00 7a 04 05 00 75 04 05 00 ........z...u... 95ee: 70 04 05 00 6b 04 05 00 66 04 05 00 61 04 05 00 p...k...f...a... 95fe: 5c 04 05 00 57 04 05 00 52 04 05 00 4d 04 05 00 \...W...R...M... 960e: 48 04 05 00 43 04 05 00 3e 04 04 00 3a 04 05 00 H...C...>...:... 961e: 35 04 05 00 30 04 04 00 2c 04 05 00 27 04 04 00 5...0...,...'... 962e: 23 04 05 00 1e 04 04 00 1a 04 04 00 16 04 05 00 #............... 963e: 11 04 04 00 0d 04 04 00 09 04 05 00 04 04 04 00 ................ 964e: 00 04 04 00 fc 03 04 00 f8 03 04 00 f4 03 04 00 ................ 965e: f0 03 04 00 ec 03 04 00 e8 03 04 00 e4 03 04 00 ................ 966e: e0 03 04 00 dc 03 04 00 d8 03 04 00 d4 03 04 00 ................ 967e: d0 03 04 00 cc 03 04 00 c8 03 03 00 c5 03 03 00 ................ 0000968e : 968e: 24 f4 04 d9 20 1b c4 0c 5c 0e 98 04 c4 09 5f 02 $... ...\....._. 969e: 65 07 71 01 f4 05 f9 00 fb 04 b3 00 48 04 87 00 e.q.........H... 96ae: c1 03 69 00 58 03 55 00 03 03 45 00 be 02 3a 00 ..i.X.U...E...:. 96be: 84 02 31 00 53 02 2a 00 29 02 25 00 04 02 20 00 ..1.S.*.).%... . 96ce: e4 01 1c 00 c8 01 19 00 af 01 17 00 98 01 14 00 ................ 96de: 84 01 13 00 71 01 10 00 61 01 10 00 51 01 0e 00 ....q...a...Q... 96ee: 43 01 0d 00 36 01 0b 00 2b 01 0b 00 20 01 0b 00 C...6...+... ... 96fe: 15 01 09 00 0c 01 09 00 03 01 08 00 fb 00 08 00 ................ 970e: f3 00 08 00 eb 00 07 00 e4 00 06 00 de 00 06 00 ................ 971e: d8 00 06 00 d2 00 06 00 cc 00 05 00 c7 00 05 00 ................ 972e: c2 00 05 00 bd 00 04 00 b9 00 04 00 b5 00 04 00 ................ 973e: b1 00 04 00 ad 00 04 00 a9 00 04 00 a5 00 03 00 ................ 974e: a2 00 03 00 9f 00 04 00 9b 00 03 00 98 00 03 00 ................ 975e: 95 00 02 00 93 00 03 00 90 00 03 00 8d 00 02 00 ................ 976e: 8b 00 03 00 88 00 02 00 86 00 02 00 84 00 03 00 ................ 977e: 81 00 02 00 7f 00 02 00 7d 00 02 00 7b 00 02 00 ........}...{... 978e: 79 00 02 00 77 00 01 00 76 00 02 00 74 00 02 00 y...w...v...t... 979e: 72 00 01 00 71 00 02 00 6f 00 02 00 6d 00 01 00 r...q...o...m... 97ae: 6c 00 02 00 6a 00 01 00 69 00 02 00 67 00 01 00 l...j...i...g... 97be: 66 00 01 00 65 00 01 00 64 00 02 00 62 00 01 00 f...e...d...b... 97ce: 61 00 01 00 60 00 01 00 5f 00 02 00 5d 00 01 00 a...`..._...]... 97de: 5c 00 01 00 5b 00 01 00 5a 00 01 00 59 00 01 00 \...[...Z...Y... 97ee: 58 00 01 00 57 00 01 00 56 00 01 00 55 00 01 00 X...W...V...U... 97fe: 54 00 01 00 53 00 00 00 53 00 01 00 52 00 01 00 T...S...S...R... 980e: 51 00 01 00 50 00 01 00 4f 00 01 00 4e 00 00 00 Q...P...O...N... 981e: 4e 00 01 00 4d 00 01 00 4c 00 01 00 4b 00 00 00 N...M...L...K... 982e: 4b 00 01 00 4a 00 01 00 49 00 01 00 48 00 00 00 K...J...I...H... 983e: 48 00 01 00 47 00 01 00 46 00 00 00 46 00 01 00 H...G...F...F... 984e: 45 00 00 00 45 00 01 00 44 00 01 00 43 00 00 00 E...E...D...C... 985e: 43 00 01 00 42 00 00 00 42 00 01 00 41 00 00 00 C...B...B...A... 986e: 41 00 01 00 40 00 01 00 3f 00 00 00 3f 00 01 00 A...@...?...?... 987e: 3e 00 00 00 3e 00 01 00 3d 00 00 00 3d 00 01 00 >...>...=...=... 988e: 3c 00 00 00 3c 00 00 00 3c 00 01 00 3b 00 00 00 <...<...<...;... 989e: 3b 00 01 00 3a 00 00 00 3a 00 01 00 39 00 00 00 ;...:...:...9... 98ae: 39 00 01 00 38 00 00 00 38 00 00 00 38 00 01 00 9...8...8...8... 98be: 37 00 00 00 37 00 01 00 36 00 00 00 36 00 00 00 7...7...6...6... 98ce: 36 00 01 00 35 00 00 00 35 00 00 00 35 00 01 00 6...5...5...5... 98de: 34 00 00 00 34 00 00 00 34 00 01 00 33 00 00 00 4...4...4...3... 98ee: 33 00 00 00 33 00 01 00 32 00 00 00 32 00 00 00 3...3...2...2... 98fe: 32 00 01 00 31 00 00 00 31 00 00 00 31 00 01 00 2...1...1...1... 990e: 30 00 00 00 30 00 00 00 30 00 01 00 2f 00 00 00 0...0...0.../... 991e: 2f 00 00 00 2f 00 00 00 2f 00 01 00 2e 00 00 00 /.../.../....... 992e: 2e 00 00 00 2e 00 01 00 2d 00 00 00 2d 00 00 00 ........-...-... 993e: 2d 00 00 00 2d 00 01 00 2c 00 00 00 2c 00 00 00 -...-...,...,... 994e: 2c 00 00 00 2c 00 01 00 2b 00 00 00 2b 00 00 00 ,...,...+...+... 995e: 2b 00 00 00 2b 00 01 00 2a 00 00 00 2a 00 00 00 +...+...*...*... 996e: 2a 00 00 00 2a 00 01 00 29 00 00 00 29 00 00 00 *...*...)...)... 997e: 29 00 00 00 29 00 00 00 29 00 01 00 28 00 00 00 )...)...)...(... 998e: 28 00 00 00 28 00 00 00 28 00 00 00 28 00 01 00 (...(...(...(... 999e: 27 00 00 00 27 00 00 00 27 00 00 00 27 00 00 00 '...'...'...'... 99ae: 27 00 01 00 26 00 00 00 26 00 00 00 26 00 00 00 '...&...&...&... 99be: 26 00 00 00 26 00 01 00 25 00 00 00 25 00 00 00 &...&...%...%... 99ce: 25 00 00 00 25 00 00 00 25 00 00 00 25 00 01 00 %...%...%...%... 99de: 24 00 00 00 24 00 00 00 24 00 00 00 24 00 00 00 $...$...$...$... 99ee: 24 00 01 00 23 00 00 00 23 00 00 00 23 00 00 00 $...#...#...#... 99fe: 23 00 00 00 23 00 00 00 23 00 00 00 23 00 01 00 #...#...#...#... 9a0e: 22 00 00 00 22 00 00 00 22 00 00 00 22 00 00 00 "..."..."..."... 9a1e: 22 00 00 00 22 00 01 00 21 00 00 00 21 00 00 00 "..."...!...!... 9a2e: 21 00 00 00 21 00 00 00 21 00 00 00 21 00 00 00 !...!...!...!... 9a3e: 21 00 01 00 20 00 00 00 20 00 00 00 20 00 00 00 !... ... ... ... 9a4e: 20 00 00 00 20 00 00 00 20 00 00 00 20 00 00 00 ... ... ... ... 9a5e: 20 00 01 00 1f 00 00 00 1f 00 00 00 1f 00 00 00 ............... 9a6e: 1f 00 00 00 1f 00 00 00 1f 00 00 00 1f 00 01 00 ................ 9a7e: 1e 00 00 00 1e 00 00 00 1e 00 00 00 1e 00 00 00 ................ 00009a8e <_ZZ12PID_autotunefiiE3__c__16_>: 9a8e: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 69 6e PID Autotune fin 9a9e: 69 73 68 65 64 21 20 50 75 74 20 74 68 65 20 6c ished! Put the l 9aae: 61 73 74 20 4b 70 2c 20 4b 69 20 61 6e 64 20 4b ast Kp, Ki and K 9abe: 64 20 63 6f 6e 73 74 61 6e 74 73 20 66 72 6f 6d d constants from 9ace: 20 61 62 6f 76 65 20 69 6e 74 6f 20 43 6f 6e 66 above into Conf 9ade: 69 67 75 72 61 74 69 6f 6e 2e 68 00 iguration.h. 00009aea <_ZZ12PID_autotunefiiE3__c__15_>: 9aea: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 61 69 PID Autotune fai 9afa: 6c 65 64 21 20 74 69 6d 65 6f 75 74 00 led! timeout. 00009b07 <_ZZ12PID_autotunefiiE3__c__14_>: 9b07: 20 40 3a 00 @:. 00009b0b <_ZZ12PID_autotunefiiE3__c__13_>: 9b0b: 54 3a 00 T:. 00009b0e <_ZZ12PID_autotunefiiE3__c__12_>: 9b0e: 42 3a 00 B:. 00009b11 <_ZZ12PID_autotunefiiE3__c__11_>: 9b11: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 61 69 PID Autotune fai 9b21: 6c 65 64 21 20 54 65 6d 70 65 72 61 74 75 72 65 led! Temperature 9b31: 20 74 6f 6f 20 68 69 67 68 00 too high. 00009b3b <_ZZ12PID_autotunefiiE3__c__10_>: 9b3b: 20 4b 64 3a 20 00 Kd: . 00009b41 : 9b41: 20 4b 69 3a 20 00 Ki: . 00009b47 : 9b47: 20 4b 70 3a 20 00 Kp: . 00009b4d : 9b4d: 20 43 6c 61 73 73 69 63 20 50 49 44 20 00 Classic PID . 00009b5b : 9b5b: 20 54 75 3a 20 00 Tu: . 00009b61 : 9b61: 20 4b 75 3a 20 00 Ku: . 00009b67 : 9b67: 20 6d 61 78 3a 20 00 max: . 00009b6e : 9b6e: 20 6d 69 6e 3a 20 00 min: . 00009b75 : 9b75: 20 64 3a 20 00 d: . 00009b7a : 9b7a: 20 62 69 61 73 3a 20 00 bias: . 00009b82 : 9b82: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 73 74 61 PID Autotune sta 9b92: 72 74 00 rt. 00009b95 : 9b95: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 61 69 PID Autotune fai 9ba5: 6c 65 64 2e 20 42 61 64 20 65 78 74 72 75 64 65 led. Bad extrude 9bb5: 72 20 6e 75 6d 62 65 72 2e 00 r number.. 00009bbf : 9bbf: 54 4d 4c 20 25 64 20 25 64 20 25 78 20 25 6c 78 TML %d %d %x %lx 9bcf: 20 25 6c 78 0a 00 %lx.. 00009bd5 : 9bd5: 4d 49 4e 54 45 4d 50 00 MINTEMP. 00009bdd : 9bdd: 4d 49 4e 54 45 4d 50 20 42 45 44 00 MINTEMP BED. 00009be9 : 9be9: 4d 49 4e 54 45 4d 50 20 41 4d 42 00 MINTEMP AMB. 00009bf5 : 9bf5: 4d 41 58 54 45 4d 50 00 MAXTEMP. 00009bfd : 9bfd: 4d 41 58 54 45 4d 50 20 42 45 44 00 MAXTEMP BED. 00009c09 : 9c09: 4d 41 58 54 45 4d 50 20 41 4d 42 00 MAXTEMP AMB. 00009c15 : 9c15: 54 4d 3a 20 65 72 72 6f 72 20 63 6c 65 61 72 65 TM: error cleare 9c25: 64 00 d. 00009c27 : 9c27: 54 4d 3a 20 65 72 72 6f 72 20 74 72 69 67 67 65 TM: error trigge 9c37: 72 65 64 21 00 red!. 00009c3c : 9c3c: 54 4d 3a 20 65 72 72 6f 72 20 7c 25 66 7c 3e 25 TM: error |%f|>% 9c4c: 66 0a 00 f.. 00009c4f : 9c4f: 70 01 2c 01 90 01 27 01 b0 01 22 01 c0 01 1d 01 p.,...'..."..... 9c5f: f0 01 18 01 10 02 13 01 30 02 0e 01 60 02 09 01 ........0...`... 9c6f: 90 02 04 01 c0 02 ff 00 00 03 fa 00 40 03 f5 00 ............@... 9c7f: 80 03 f0 00 d0 03 eb 00 20 04 e6 00 70 04 e1 00 ........ ...p... 9c8f: e0 04 dc 00 40 05 d7 00 c0 05 d2 00 40 06 cd 00 ....@.......@... 9c9f: d0 06 c8 00 80 07 c3 00 30 08 be 00 f0 08 b9 00 ........0....... 9caf: c0 09 b4 00 b0 0a af 00 b0 0b aa 00 d0 0c a5 00 ................ 9cbf: 00 0e a0 00 50 0f 9b 00 c0 10 96 00 50 12 91 00 ....P.......P... 9ccf: 00 14 8c 00 c0 15 87 00 b0 17 82 00 b0 19 7d 00 ..............}. 9cdf: d0 1b 78 00 00 1e 73 00 40 20 6e 00 90 22 69 00 ..x...s.@ n.."i. 9cef: f0 24 64 00 40 27 5f 00 90 29 5a 00 e0 2b 55 00 .$d.@'_..)Z..+U. 9cff: 10 2e 50 00 20 30 4b 00 10 32 46 00 e0 33 41 00 ..P. 0K..2F..3A. 9d0f: 90 35 3c 00 10 37 37 00 70 38 32 00 a0 39 2d 00 .5<..77.p82..9-. 9d1f: b0 3a 28 00 a0 3b 23 00 60 3c 1e 00 10 3d 19 00 .:(..;#.`<...=.. 9d2f: 90 3d 14 00 10 3e 0f 00 70 3e 0a 00 c0 3e 05 00 .=...>..p>...>.. 9d3f: 00 3f 00 00 .?.. 00009d43 : 9d43: 90 13 7d 00 b0 15 78 00 f0 17 73 00 60 1a 6e 00 ..}...x...s.`.n. 9d53: f0 1c 69 00 a0 1f 64 00 50 22 5f 00 20 25 5a 00 ..i...d.P"_. %Z. 9d63: e0 27 55 00 90 2a 50 00 20 2d 4b 00 a0 2f 46 00 .'U..*P. -K../F. 9d73: f0 31 41 00 10 34 3c 00 f0 35 37 00 a0 37 32 00 .1A..4<..57..72. 9d83: 20 39 2d 00 60 3a 28 00 70 3b 23 00 60 3c 1e 00 9-.`:(.p;#.`<.. 9d93: 20 3d 19 00 c0 3d 14 00 40 3e 0f 00 a0 3e 0a 00 =...=..@>...>.. 9da3: f0 3e 05 00 40 3f 00 00 70 3f fb ff 90 3f f6 ff .>..@?..p?...?.. 9db3: b0 3f f1 ff c0 3f ec ff d0 3f e7 ff e0 3f e2 ff .?...?...?...?.. 9dc3: f0 3f dd ff f0 3f d8 ff .?...?.. 00009dcb : 9dcb: 20 48 4f 54 45 4e 44 20 54 48 45 52 4d 41 4c 20 HOTEND THERMAL 9ddb: 52 55 4e 41 57 41 59 00 RUNAWAY. 00009de3 : 9de3: 20 48 45 41 54 42 45 44 20 54 48 45 52 4d 41 4c HEATBED THERMAL 9df3: 20 52 55 4e 41 57 41 59 00 RUNAWAY. 00009dfc : 9dfc: 54 48 45 52 4d 41 4c 20 52 55 4e 41 57 41 59 00 THERMAL RUNAWAY. 00009e0c : 9e0c: 42 45 44 20 54 48 45 52 4d 41 4c 20 52 55 4e 41 BED THERMAL RUNA 9e1c: 57 41 59 00 WAY. 00009e20 : 9e20: 20 54 48 45 52 4d 41 4c 20 52 55 4e 41 57 41 59 THERMAL RUNAWAY 9e30: 20 28 50 52 45 48 45 41 54 20 48 4f 54 45 4e 44 (PREHEAT HOTEND 9e40: 29 00 ). 00009e42 : 9e42: 20 54 48 45 52 4d 41 4c 20 52 55 4e 41 57 41 59 THERMAL RUNAWAY 9e52: 20 28 50 52 45 48 45 41 54 20 48 45 41 54 42 45 (PREHEAT HEATBE 9e62: 44 29 00 D). 00009e65 : 9e65: 50 52 45 48 45 41 54 20 45 52 52 4f 52 00 PREHEAT ERROR. 00009e73 : 9e73: 42 45 44 20 50 52 45 48 45 41 54 20 45 52 52 4f BED PREHEAT ERRO 9e83: 52 00 R. 00009e85 : 9e85: 20 74 72 69 67 67 65 72 65 64 21 00 triggered!. 00009e91 : 9e91: 48 65 61 74 65 72 73 20 73 77 69 74 63 68 65 64 Heaters switched 9ea1: 20 6f 66 66 2e 20 00 off. . 00009ea8 : 9ea8: 3a 20 00 : . 00009eab : 9eab: 45 72 72 3a 20 00 Err: . 00009eb1 : 9eb1: 00 ff 01 02 01 00 02 ff ff fe 00 01 fe 01 ff 00 ................ 00009ec1 : 9ec1: 50 6c 65 61 73 65 20 72 65 73 74 61 72 74 00 Please restart. 00009ed0 : 9ed0: 54 4d 3a 20 69 6e 76 61 6c 69 64 20 70 61 72 61 TM: invalid para 9ee0: 6d 65 74 65 72 73 2c 20 63 61 6e 6e 6f 74 20 65 meters, cannot e 9ef0: 6e 61 62 6c 65 00 nable. 00009ef6 : 9ef6: 25 53 20 20 4d 33 31 30 20 50 25 2e 32 66 20 55 %S M310 P%.2f U 9f06: 25 2e 34 66 20 56 25 2e 32 66 20 43 25 2e 32 66 %.4f V%.2f C%.2f 9f16: 20 44 25 2e 34 66 20 4c 25 75 20 53 25 75 20 42 D%.4f L%u S%u B 9f26: 25 75 20 45 25 2e 32 66 20 57 25 2e 32 66 20 54 %u E%.2f W%.2f T 9f36: 25 2e 32 66 0a 00 %.2f.. 00009f3c : 9f3c: 25 53 20 20 4d 33 31 30 20 49 25 75 20 52 25 2e %S M310 I%u R%. 9f4c: 32 66 0a 00 2f.. 00009f50 : 9f50: 54 68 65 72 6d 61 6c 20 4d 6f 64 65 6c 20 73 65 Thermal Model se 9f60: 74 74 69 6e 67 73 3a 00 ttings:. 00009f68 : 9f68: 00 00 a4 41 33 33 93 41 9a 99 85 41 33 33 73 41 ...A33.A...A33sA 9f78: 9a 99 61 41 cd cc 54 41 33 33 4b 41 9a 99 41 41 ..aA..TA33KA..AA 9f88: 33 33 3b 41 cd cc 34 41 00 00 30 41 cd cc 2c 41 33;A..4A..0A..,A 9f98: 9a 99 29 41 66 66 26 41 33 33 23 41 9a 99 21 41 ..)Aff&A33#A..!A 00009fa8 : 9fa8: 45 2d 6d 6f 74 6f 72 20 63 75 72 72 65 6e 74 20 E-motor current 9fb8: 73 63 61 6c 69 6e 67 20 65 6e 61 62 6c 65 64 00 scaling enabled. 00009fc8 : 9fc8: 01 08 08 01 0a 0a 01 14 14 01 12 12 ............ 00009fd4 : 9fd4: 74 6d 63 32 31 33 30 5f 68 6f 6d 65 5f 65 6e 74 tmc2130_home_ent 9fe4: 65 72 28 61 78 65 73 5f 6d 61 73 6b 3d 30 78 25 er(axes_mask=0x% 9ff4: 30 32 78 29 0a 00 02x).. 00009ffa : 9ffa: 74 6d 63 32 31 33 30 5f 68 6f 6d 65 5f 65 78 69 tmc2130_home_exi a00a: 74 20 74 6d 63 32 31 33 30 5f 73 67 5f 68 6f 6d t tmc2130_sg_hom a01a: 69 6e 67 5f 61 78 65 73 5f 6d 61 73 6b 3d 30 78 ing_axes_mask=0x a02a: 25 30 32 78 0a 00 %02x.. 0000a030 : a030: 72 65 73 75 6c 74 20 76 61 6c 75 65 3a 20 25 64 result value: %d a040: 0a 00 .. 0000a042 : a042: 20 69 3d 25 32 64 20 63 6e 74 3d 25 32 64 20 76 i=%2d cnt=%2d v a052: 61 6c 3d 25 32 64 0a 00 al=%2d.. 0000a05a : a05a: 63 6c 75 73 74 65 72 73 3a 00 clusters:. 0000a064 : a064: 20 69 3d 25 32 64 20 73 74 65 70 3d 25 32 64 0a i=%2d step=%2d. ... 0000a075 : a075: 73 6f 72 74 65 64 20 73 61 6d 70 6c 65 73 3a 00 sorted samples:. 0000a085 <__c.1906>: a085: 55 53 41 52 54 32 20 72 78 20 46 75 6c 6c 21 21 USART2 rx Full!! a095: 21 00 !. 0000a097 : a097: 3a 20 00 : . 0000a09a : a09a: 25 2d 31 32 2e 31 32 53 25 2d 64 2f 36 00 %-12.12S%-d/6. 0000a0a8 : a0a8: 25 33 64 2f 25 2d 33 64 00 %3d/%-3d. 0000a0b1 : a0b1: 20 3a 20 00 : . 0000a0b5 : a0b5: 25 33 53 00 %3S. 0000a0b9 : a0b9: 25 2d 37 73 00 %-7s. 0000a0be : a0be: 25 2d 31 35 2e 31 35 53 25 2d 35 64 0a 25 2d 31 %-15.15S%-5d.%-1 a0ce: 35 2e 31 35 53 25 2d 35 64 0a 00 5.15S%-5d.. 0000a0d9 : a0d9: 25 53 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 %S. %-16.16S%-3d a0e9: 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 00 . %-16.16S%-3d. 0000a0f8 : a0f8: 25 53 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 %S. %-16.16S%-3d a108: 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 0a 20 . %-16.16S%-3d. a118: 25 2d 31 36 2e 31 36 53 25 2d 33 64 00 %-16.16S%-3d. 0000a125 : a125: 25 53 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 %S. %-16.16S%-3d a135: 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 0a 20 . %-16.16S%-3d. a145: 25 2d 37 2e 37 53 58 20 25 2d 33 64 20 20 59 20 %-7.7SX %-3d Y a155: 25 2d 33 64 00 %-3d. 0000a15a : a15a: 20 25 73 25 33 64 81 20 0a 00 %s%3d. .. 0000a164 : a164: 20 50 57 52 3a 20 20 20 20 20 20 25 34 2e 31 66 PWR: %4.1f a174: 56 0a 20 42 45 44 3a 20 20 20 20 20 20 25 34 2e V. BED: %4. a184: 31 66 56 00 1fV. 0000a188 : a188: 25 53 0a 20 58 20 25 64 0a 20 59 20 25 64 00 %S. X %d. Y %d. 0000a197 : a197: 25 75 2e 25 75 2e 25 75 2e 25 75 00 %u.%u.%u.%u. 0000a1a3 <_ZZL16lcd_support_menuvE3__c__15_>: a1a3: 20 00 . 0000a1a5 <_ZZL16lcd_support_menuvE3__c__14_>: a1a5: 20 00 . 0000a1a7 <_ZZL16lcd_support_menuvE3__c__13_>: a1a7: 46 6c 61 73 68 41 69 72 20 49 50 20 41 64 64 72 FlashAir IP Addr a1b7: 3a 00 :. 0000a1b9 <_ZZL16lcd_support_menuvE3__c__12_>: a1b9: 4d 4d 55 20 20 20 20 20 20 20 20 4e 2f 41 00 MMU N/A. 0000a1c8 <_ZZL16lcd_support_menuvE3__c__11_>: a1c8: 25 64 2e 25 64 2e 25 64 00 %d.%d.%d. 0000a1d1 <_ZZL16lcd_support_menuvE3__c__10_>: a1d1: 20 46 57 3a 00 FW:. 0000a1d6 : a1d6: 31 39 37 30 2d 30 31 2d 30 31 00 1970-01-01. 0000a1e1 : a1e1: 45 33 44 76 36 66 75 6c 6c 00 E3Dv6full. 0000a1eb : a1eb: 45 49 4e 53 79 5f 31 30 61 00 EINSy_10a. 0000a1f5 : a1f5: 31 5f 37 35 6d 6d 5f 4d 4b 33 00 1_75mm_MK3. 0000a200 : a200: 20 48 61 73 68 3a 30 30 30 30 30 30 30 30 30 00 Hash:000000000. 0000a210 : a210: 20 52 65 70 6f 3a 55 6e 6b 6e 6f 77 6e 00 Repo:Unknown. 0000a21e : a21e: 20 33 2e 31 34 2e 31 2d 38 32 33 37 00 3.14.1-8237. 0000a22b : a22b: 46 69 72 6d 77 61 72 65 3a 00 Firmware:. 0000a235 <_ZZ24lcd_generic_preheat_menuvE3__c__20_>: a235: 46 4c 45 58 20 2d 20 20 32 34 30 2f 35 30 00 FLEX - 240/50. 0000a244 <_ZZ24lcd_generic_preheat_menuvE3__c__19_>: a244: 46 4c 45 58 20 2d 20 20 32 34 30 00 FLEX - 240. 0000a250 <_ZZ24lcd_generic_preheat_menuvE3__c__18_>: a250: 50 50 20 20 20 2d 20 20 32 35 34 2f 31 30 30 00 PP - 254/100. 0000a260 <_ZZ24lcd_generic_preheat_menuvE3__c__17_>: a260: 50 50 20 20 20 2d 20 20 32 35 34 00 PP - 254. 0000a26c <_ZZ24lcd_generic_preheat_menuvE3__c__16_>: a26c: 48 49 50 53 20 2d 20 20 32 32 30 2f 31 30 30 00 HIPS - 220/100. 0000a27c <_ZZ24lcd_generic_preheat_menuvE3__c__15_>: a27c: 48 49 50 53 20 2d 20 20 32 32 30 00 HIPS - 220. 0000a288 <_ZZ24lcd_generic_preheat_menuvE3__c__14_>: a288: 41 42 53 20 20 2d 20 20 32 35 35 2f 31 30 30 00 ABS - 255/100. 0000a298 <_ZZ24lcd_generic_preheat_menuvE3__c__13_>: a298: 41 42 53 20 20 2d 20 20 32 35 35 00 ABS - 255. 0000a2a4 <_ZZ24lcd_generic_preheat_menuvE3__c__12_>: a2a4: 50 41 20 20 20 2d 20 20 32 37 35 2f 39 30 00 PA - 275/90. 0000a2b3 <_ZZ24lcd_generic_preheat_menuvE3__c__11_>: a2b3: 50 41 20 20 20 2d 20 20 32 37 35 00 PA - 275. 0000a2bf <_ZZ24lcd_generic_preheat_menuvE3__c__10_>: a2bf: 50 56 42 20 20 2d 20 20 32 31 35 2f 37 35 00 PVB - 215/75. 0000a2ce : a2ce: 50 56 42 20 20 2d 20 20 32 31 35 00 PVB - 215. 0000a2da : a2da: 50 43 20 20 20 2d 20 20 32 37 35 2f 31 31 30 00 PC - 275/110. 0000a2ea : a2ea: 50 43 20 20 20 2d 20 20 32 37 35 00 PC - 275. 0000a2f6 : a2f6: 41 53 41 20 20 2d 20 20 32 36 30 2f 31 30 35 00 ASA - 260/105. 0000a306 : a306: 41 53 41 20 20 2d 20 20 32 36 30 00 ASA - 260. 0000a312 : a312: 50 45 54 20 20 2d 20 20 32 33 30 2f 38 35 00 PET - 230/85. 0000a321 : a321: 50 45 54 20 20 2d 20 20 32 33 30 00 PET - 230. 0000a32d : a32d: 50 4c 41 20 20 2d 20 20 32 31 35 2f 36 30 00 PLA - 215/60. 0000a33c : a33c: 50 4c 41 20 20 2d 20 20 32 31 35 00 PLA - 215. 0000a348 : a348: 25 2d 31 32 2e 31 32 53 25 2b 38 2e 31 66 00 %-12.12S%+8.1f. 0000a357 : a357: 45 78 74 72 75 64 65 72 3a 00 Extruder:. 0000a361 : a361: 25 63 25 31 37 2e 32 66 6d 6d 00 %c%17.2fmm. 0000a36c : a36c: 58 3a 00 X:. 0000a36f : a36f: 59 3a 00 Y:. 0000a372 : a372: 5a 3a 00 Z:. 0000a375 : a375: 25 63 25 2d 31 33 2e 31 33 53 25 2b 35 2e 33 66 %c%-13.13S%+5.3f ... 0000a386 : a386: 25 33 75 00 %3u. 0000a38a : a38a: 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 69 6f PINDA calibratio a39a: 6e 20 66 61 69 6c 65 64 2e 20 43 6f 6e 74 69 6e n failed. Contin a3aa: 75 65 20 77 69 74 68 20 70 72 65 73 73 69 6e 67 ue with pressing a3ba: 20 74 68 65 20 6b 6e 6f 62 2e 00 the knob.. 0000a3c5 : a3c5: 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 69 6f PINDA calibratio a3d5: 6e 20 64 6f 6e 65 2e 20 43 6f 6e 74 69 6e 75 65 n done. Continue a3e5: 20 77 69 74 68 20 70 72 65 73 73 69 6e 67 20 74 with pressing t a3f5: 68 65 20 6b 6e 6f 62 2e 00 he knob.. 0000a3fe : a3fe: 10 00 c9 02 10 01 2c 01 40 01 22 01 70 01 18 01 ......,.@.".p... a40e: b0 01 0e 01 f0 01 04 01 50 02 fa 00 b0 02 f0 00 ........P....... a41e: 30 03 e6 00 d0 03 dc 00 90 04 d2 00 70 05 c8 00 0...........p... a42e: a0 06 be 00 00 08 b4 00 b0 09 aa 00 d0 0b a0 00 ................ a43e: 60 0e 96 00 60 11 8c 00 00 15 82 00 20 19 78 00 `...`....... .x. a44e: c0 1d 6e 00 a0 22 64 00 b0 27 5a 00 90 2c 50 00 ..n.."d..'Z..,P. a45e: 00 31 46 00 e0 34 3c 00 10 38 32 00 90 3a 28 00 .1F..4<..82..:(. a46e: 60 3c 1e 00 a0 3d 14 00 80 3e 0a 00 20 3f 00 00 `<...=...>.. ?.. 0000a47e : a47e: 4d 65 61 73 75 72 65 20 63 65 6e 74 65 72 20 20 Measure center ... 0000a48f : a48f: 78 79 7a 63 61 6c 5f 6d 65 61 73 75 72 65 5f 65 xyzcal_measure_e a49f: 6e 74 65 72 0a 00 nter.. 0000a4a5 : a4a5: 78 79 7a 63 61 6c 5f 73 70 69 72 61 6c 38 20 63 xyzcal_spiral8 c a4b5: 78 3d 25 64 20 63 79 3d 25 64 20 7a 30 3d 25 64 x=%d cy=%d z0=%d a4c5: 20 64 7a 3d 25 64 20 72 61 64 69 75 73 3d 25 64 dz=%d radius=%d a4d5: 20 61 64 3d 25 64 0a 00 ad=%d.. 0000a4dd : a4dd: 78 79 7a 63 61 6c 5f 73 65 61 72 63 68 5a 20 6e xyzcal_searchZ n a4ed: 6f 20 73 69 67 6e 61 6c 0a 20 78 3d 25 6c 64 20 o signal. x=%ld a4fd: 79 3d 25 6c 64 20 7a 3d 25 6c 64 0a 00 y=%ld z=%ld.. 0000a50a : a50a: 20 4f 4e 2d 53 49 47 4e 41 4c 20 61 74 20 78 3d ON-SIGNAL at x= a51a: 25 64 20 79 3d 25 64 20 7a 3d 25 64 20 61 64 3d %d y=%d z=%d ad= a52a: 25 64 0a 00 %d.. 0000a52e : a52e: 78 79 7a 63 61 6c 5f 73 65 61 72 63 68 5a 20 78 xyzcal_searchZ x a53e: 3d 25 6c 64 20 79 3d 25 6c 64 20 7a 3d 25 6c 64 =%ld y=%ld z=%ld a54e: 0a 00 .. 0000a550 : a550: 25 30 32 78 00 %02x. 0000a555 : a555: 20 5b 25 66 20 25 66 5d 20 6d 6d 20 70 61 74 74 [%f %f] mm patt a565: 65 72 6e 20 63 65 6e 74 65 72 0a 00 ern center.. 0000a571 : a571: 20 5b 25 66 20 25 66 5d 5b 25 66 5d 20 6d 6d 20 [%f %f][%f] mm a581: 64 69 76 65 72 67 65 6e 63 65 0a 00 divergence.. 0000a58d : a58d: 00 00 f0 00 f8 01 fc 03 fe 07 fe 07 fe 07 fe 07 ................ a59d: fc 03 f8 01 f0 00 00 00 ........ 0000a5a5 : a5a5: 00 00 00 00 f0 00 f8 01 fc 03 fc 03 fc 03 fc 03 ................ a5b5: f8 01 f0 00 00 00 00 00 ........ 0000a5bd : a5bd: 78 79 7a 63 61 6c 5f 6d 65 61 73 75 72 65 5f 6c xyzcal_measure_l a5cd: 65 61 76 65 0a 00 eave.. 0000a5d3 : a5d3: 20 3c 20 00 < . 0000a5d7 : a5d7: 57 41 52 4e 49 4e 47 3a 20 46 72 6f 6e 74 20 70 WARNING: Front p a5e7: 6f 69 6e 74 20 6e 6f 74 20 72 65 61 63 68 61 62 oint not reachab a5f7: 6c 65 2e 20 59 20 63 6f 6f 72 64 69 6e 61 74 65 le. Y coordinate a607: 3a 00 :. 0000a609 : ... 0000a60a : a60a: 00 00 40 41 00 00 c0 40 00 00 5c 43 00 00 c0 40 ..@A...@..\C...@ a61a: 00 00 5c 43 00 00 46 43 00 00 40 41 00 00 46 43 ..\C..FC..@A..FC 0000a62a : a62a: 25 64 2f 34 00 %d/4. 0000a62f : a62f: 49 74 65 72 61 74 69 6f 6e 3a 20 00 Iteration: . 0000a63b : a63b: 43 61 6c 69 62 72 61 74 69 6f 6e 20 66 61 69 6c Calibration fail a64b: 65 64 21 20 43 68 65 63 6b 20 74 68 65 20 61 78 ed! Check the ax a65b: 65 73 20 61 6e 64 20 72 75 6e 20 61 67 61 69 6e es and run again a66b: 2e 00 .. 0000a66d : a66d: 78 79 7a 63 61 6c 5f 73 70 69 72 61 6c 32 20 63 xyzcal_spiral2 c a67d: 78 3d 25 64 20 63 79 3d 25 64 20 7a 30 3d 25 64 x=%d cy=%d z0=%d a68d: 20 64 7a 3d 25 64 20 72 61 64 69 75 73 3d 25 64 dz=%d radius=%d a69d: 20 61 64 3d 25 64 0a 00 ad=%d.. 0000a6a5 : a6a5: 0a 00 .. 0000a6a7 : a6a7: 43 6f 75 6e 74 64 6f 77 6e 3a 20 25 64 20 00 Countdown: %d . 0000a6b6 : a6b6: 25 64 0a 00 %d.. 0000a6ba : a6ba: 53 63 61 6e 20 63 6f 75 6e 74 64 6f 77 6e 3a 20 Scan countdown: ... 0000a6cb : a6cb: 50 61 74 74 65 72 6e 20 63 65 6e 74 65 72 20 5b Pattern center [ a6db: 25 66 20 25 66 5d 2c 20 6d 61 74 63 68 20 25 66 %f %f], match %f a6eb: 25 25 0a 00 %%.. 0000a6ef : a6ef: 20 5b 25 66 2c 20 25 66 5d 5b 25 66 5d 20 66 69 [%f, %f][%f] fi a6ff: 6e 61 6c 20 63 69 72 63 6c 65 0a 00 nal circle.. 0000a70b : a70b: 74 6d 63 32 31 33 30 5f 67 6f 74 6f 5f 73 74 65 tmc2130_goto_ste a71b: 70 20 25 64 20 25 64 20 25 64 20 25 64 20 0a 00 p %d %d %d %d .. 0000a72b <_ZL16ramming_sequence.lto_priv.399>: a72b: e0 2d 90 3e 89 88 b2 41 11 36 9c 3e 77 77 c1 41 .-.>...A.6.>ww.A a73b: 29 cb b0 3e ef ee da 41 ba 49 cc 3e ef ee fc 41 )..>...A.I.>...A a74b: 61 c3 f3 3e ef ee 16 42 9c a2 13 3f cd cc 36 42 a..>...B...?..6B a75b: 8a b0 11 3f ab aa 56 42 88 63 dd 3d ab aa 56 42 ...?..VB.c.=..VB a76b: b8 af 43 3f 55 55 72 42 18 26 53 3f 33 b3 82 42 ..C?UUrB.&S?3..B a77b: 30 2a 59 3f ef 6e 86 42 00 00 70 c1 00 00 c8 42 0*Y?.n.B..p....B a78b: 00 00 c4 c1 00 00 a0 41 00 00 e0 c0 00 00 20 41 .......A...... A a79b: 00 00 60 c0 00 00 c0 40 00 00 a0 41 22 22 f2 40 ..`....@...A"".@ a7ab: 00 00 a0 c1 9a 99 a1 40 00 00 0c c2 55 55 05 42 .......@....UU.B 0000a7bb <_ZZN4MMU213ProtocolLogic18ResetRetryAttemptsEvE3__c.lto_priv.397>: a7bb: 52 65 73 65 74 52 65 74 72 79 41 74 74 65 6d 70 ResetRetryAttemp a7cb: 74 73 00 ts. 0000a7ce : a7ce: 43 6f 6f 6c 69 6e 67 20 74 69 6d 65 72 20 73 74 Cooling timer st a7de: 6f 70 70 65 64 00 opped. 0000a7e4 : a7e4: 48 65 61 74 65 72 20 63 6f 6f 6c 64 6f 77 6e 00 Heater cooldown. 0000a7f4 : a7f4: 43 6f 6f 6c 69 6e 67 20 54 69 6d 65 6f 75 74 20 Cooling Timeout a804: 73 74 61 72 74 65 64 00 started. 0000a80c : a80c: 53 61 76 69 6e 67 20 61 6e 64 20 70 61 72 6b 69 Saving and parki a81c: 6e 67 00 ng. 0000a81f : a81f: 48 65 61 74 65 72 20 63 6f 6f 6c 64 6f 77 6e 20 Heater cooldown a82f: 70 65 6e 64 69 6e 67 00 pending. 0000a837 : a837: 52 65 73 75 6d 69 6e 67 20 58 59 5a 00 Resuming XYZ. 0000a844 : a844: 4d 4d 55 32 74 6f 6f 6c 3d 00 MMU2tool=. 0000a84e <_ZL9mmu2Magic.lto_priv.374>: a84e: 4d 4d 55 32 3a 00 MMU2:. 0000a854 : a854: 47 31 20 58 25 64 20 59 25 2d 2e 32 66 20 45 25 G1 X%d Y%-.2f E% a864: 2d 2e 33 66 00 -.3f. 0000a869 : a869: 57 72 69 74 69 6e 67 20 74 6f 20 66 69 6c 65 3a Writing to file: a879: 20 00 . 0000a87b : a87b: 46 69 6c 65 20 61 6c 72 65 61 64 79 20 6f 70 65 File already ope a88b: 6e 65 64 00 ned. 0000a88f : a88f: 49 54 38 54 24 54 0f 54 f9 53 e6 53 d0 53 bc 53 IT8T$T.T.S.S.S.S a89f: ab 53 95 53 24 54 38 54 81 53 72 53 5e 53 4d 53 .S.S$T8T.SrS^SMS a8af: 38 53 71 5c 22 53 10 53 fd 52 ec 52 d7 52 c4 52 8Sq\"S.S.R.R.R.R a8bf: b0 52 9b 52 92 52 80 52 6b 52 .R.R.R.RkR 0000a8c9 : a8c9: 4d 36 30 30 20 41 55 54 4f 00 M600 AUTO. 0000a8d3 : a8d3: 46 49 4e 44 41 20 66 69 6c 61 6d 65 6e 74 20 72 FINDA filament r a8e3: 75 6e 6f 75 74 21 00 unout!. 0000a8ea : a8ea: 43 6f 6d 6d 75 6e 69 63 61 74 69 6f 6e 20 74 69 Communication ti a8fa: 6d 65 6f 75 74 00 meout. 0000a900 : a900: 50 72 6f 74 6f 63 6f 6c 20 45 72 72 6f 72 00 Protocol Error. 0000a90f : a90f: 03 00 03 ... 0000a912 : a912: 56 65 72 73 69 6f 6e 20 6d 69 73 6d 61 74 63 68 Version mismatch ... 0000a923 : a923: 43 6f 6d 6d 61 6e 64 20 45 72 72 6f 72 00 Command Error. 0000a931 : a931: 43 6f 6d 6d 61 6e 64 20 72 65 6a 65 63 74 65 64 Command rejected ... 0000a942 : a942: 4d 4d 55 20 42 75 74 74 6f 6e 20 70 75 73 68 65 MMU Button pushe a952: 64 00 d. 0000a954 : a954: 52 65 74 72 79 42 75 74 74 6f 6e 50 72 65 73 73 RetryButtonPress a964: 65 64 00 ed. 0000a967 <_ZN4MMU2L11errorTitlesE.lto_priv.492>: a967: a6 56 91 56 7a 56 65 56 50 56 3c 56 2c 56 15 56 .V.VzVeVPV: a9c1: 42 75 74 74 6f 6e 00 Button. 0000a9c8 : a9c8: 43 68 65 63 6b 55 73 65 72 49 6e 70 75 74 2d 62 CheckUserInput-b a9d8: 74 6e 4c 4d 52 20 00 tnLMR . 0000a9df <_ZZN4MMU231ReportErrorHookSensorLineRenderEvE3__c.lto_priv.491>: a9df: 46 49 3a 20 20 46 53 3a 20 20 20 20 3e 20 20 82 FI: FS: > . a9ef: 20 20 20 81 00 .. 0000a9f4 : a9f4: 48 6f 74 65 6e 64 20 74 65 6d 70 65 72 61 74 75 Hotend temperatu aa04: 72 65 20 72 65 61 63 68 65 64 00 re reached. 0000aa0f : aa0f: 52 65 73 75 6d 69 6e 67 20 54 65 6d 70 00 Resuming Temp. 0000aa1d : aa1d: 43 6f 6f 6c 64 6f 77 6e 20 66 6c 61 67 20 63 6c Cooldown flag cl aa2d: 65 61 72 65 64 00 eared. 0000aa33 : aa33: 20 57 3a 00 W:. 0000aa37 : aa37: 20 45 3a 00 E:. 0000aa3b : aa3b: 54 3a 00 T:. 0000aa3e : aa3e: 4e 6f 20 30 78 46 46 20 72 65 63 65 69 76 65 64 No 0xFF received ... 0000aa4f : aa4f: 53 65 6e 64 69 6e 67 20 30 78 46 46 00 Sending 0xFF. 0000aa5c : aa5c: 46 69 6c 65 20 73 65 6c 65 63 74 65 64 00 File selected. 0000aa6a : aa6a: 20 53 69 7a 65 3a 20 00 Size: . 0000aa72 : aa72: 46 69 6c 65 20 6f 70 65 6e 65 64 3a 20 00 File opened: . 0000aa80 : aa80: 4e 6f 77 20 66 72 65 73 68 20 66 69 6c 65 3a 20 Now fresh file: ... 0000aa91 : aa91: 4e 6f 77 20 64 6f 69 6e 67 20 66 69 6c 65 3a 20 Now doing file: ... 0000aaa2 : aaa2: 22 20 70 6f 73 00 " pos. 0000aaa8 : aaa8: 22 20 70 61 72 65 6e 74 3a 22 00 " parent:". 0000aab3 : aab3: 53 55 42 52 4f 55 54 49 4e 45 20 43 41 4c 4c 20 SUBROUTINE CALL aac3: 74 61 72 67 65 74 3a 22 00 target:". 0000aacc : aacc: 74 72 79 69 6e 67 20 74 6f 20 63 61 6c 6c 20 73 trying to call s aadc: 75 62 2d 67 63 6f 64 65 20 66 69 6c 65 73 20 77 ub-gcode files w aaec: 69 74 68 20 74 6f 6f 20 6d 61 6e 79 20 6c 65 76 ith too many lev aafc: 65 6c 73 2e 00 els.. 0000ab01 : ab01: 06 28 33 d0 36 c2 3e 01 3f 15 41 32 42 3b 43 f2 .(3.6.>.?.A2B;C. ab11: 44 3b 45 f2 46 22 47 3b 48 f2 49 3b 4a f0 58 98 D;E.F"G;H.I;J.X. ab21: 59 0c 5a 08 5b 0c 5c 08 61 10 67 9b 6e 22 71 07 Y.Z.[.\.a.g.n"q. ab31: 72 08 ff r.. 0000ab34 : ab34: 09 5a 0d 00 0e f0 19 14 5e 08 20 64 2b 6d 32 2f .Z......^. d+m2/ ab44: ff . 0000ab45 : ab45: 20 22 25 73 22 00 "%s". 0000ab4b : ab4b: 20 25 23 6c 78 00 %#lx. 0000ab51 : ab51: 44 49 52 5f 45 58 49 54 00 DIR_EXIT. 0000ab5a : ab5a: 44 49 52 5f 45 4e 54 45 52 3a 20 25 73 20 22 25 DIR_ENTER: %s "% ab6a: 73 22 0a 00 s".. 0000ab6e : ab6e: 61 75 74 6f 25 69 2e 67 00 auto%i.g. 0000ab77 : ab77: 04 1a .. 0000ab79 : ab79: 44 65 63 72 65 6d 65 6e 74 52 65 74 72 79 41 74 DecrementRetryAt ab89: 74 65 6d 70 74 73 00 tempts. 0000ab90 : ab90: 08 1b 1c ... 0000ab93 : ab93: 0b 14 .. 0000ab95 <_ZZN4MMU213ProtocolLogic33ResetCommunicationTimeoutAttemptsEvE3__c.lto_priv.398>: ab95: 52 53 54 43 6f 6d 6d 54 69 6d 65 6f 75 74 00 RSTCommTimeout. 0000aba4 : aba4: 2c 20 6c 61 73 74 20 62 79 74 65 73 3a 20 00 , last bytes: . 0000abb3 <_ZL10bufferFull.lto_priv.552>: abb3: 22 20 66 61 69 6c 65 64 3a 20 42 75 66 66 65 72 " failed: Buffer abc3: 20 66 75 6c 6c 21 00 full!. 0000abca : abca: 45 72 72 6f 72 3a 00 Error:. 0000abd1 : abd1: 22 00 ". 0000abd3 : abd3: 45 6e 71 75 65 69 6e 67 20 74 6f 20 74 68 65 20 Enqueing to the abe3: 66 72 6f 6e 74 3a 20 22 00 front: ". 0000abec <_ZL9mmu2Magic.lto_priv.375>: abec: 4d 4d 55 32 3a 00 MMU2:. 0000abf2 : abf2: 65 63 68 6f 3a 00 echo:. 0000abf8 : abf8: 3e 53 30 2a 63 36 2e 00 >S0*c6.. 0000ac00 : ac00: 4d 4d 55 20 69 73 20 00 MMU is . 0000ac08 : ac08: 25 2e 31 30 53 20 00 %.10S . 0000ac0f : ac0f: 25 34 64 00 %4d. 0000ac13 : ac13: 45 78 72 65 6d 65 20 73 70 61 6e 20 6f 66 20 74 Exreme span of t ac23: 68 65 20 5a 20 76 61 6c 75 65 73 21 00 he Z values!. 0000ac30 : ac30: 25 64 2f 39 00 %d/9. 0000ac35 : ac35: 4d 4d 55 32 3a 00 MMU2:. 0000ac3b : ac3b: 25 33 64 00 %3d. 0000ac3f : ac3f: 18 01 04 19 02 0a ...... 0000ac45 : ac45: f6 63 80 63 06 63 99 62 50 62 be 61 46 61 de 60 .c.c.c.bPb.aFa.` ac55: 8f 60 6f 60 23 60 6f 60 0c 60 0c 60 0c 60 0c 60 .`o`#`o`.`.`.`.` ac65: 0c 60 0c 60 0c 60 0c 60 0c 60 0c 60 0c 60 0c 60 .`.`.`.`.`.`.`.` ac75: 0c 60 0c 60 0c 60 0c 60 0c 60 0c 60 0c 60 0c 60 .`.`.`.`.`.`.`.` ac85: 0c 60 0c 60 d5 5f 94 5f 4a 5f d7 5e a2 5e 58 5e .`.`._._J_.^.^X^ ac95: 0e 5e b0 5d 77 5d 35 5d 18 5d .^.]w]5].] 0000ac9f : ac9f: 01 01 01 01 01 01 01 02 71 01 71 01 32 32 32 03 ........q.q.222. acaf: 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 ................ acbf: 03 03 93 93 24 38 03 93 03 01 02 56 03 ....$8.....V. 0000accc : accc: 65 00 66 00 67 00 68 00 69 00 6a 00 6b 00 6c 00 e.f.g.h.i.j.k.l. acdc: 73 00 74 00 7d 00 7e 00 c9 00 d3 00 dd 00 ca 00 s.t.}.~......... acec: d4 00 de 00 2d 01 37 01 41 01 2e 01 38 01 42 01 ....-.7.A...8.B. acfc: 2f 01 39 01 43 01 30 01 3a 01 44 01 31 01 3b 01 /.9.C.0.:.D.1.;. ad0c: 45 01 32 01 91 01 92 01 f5 01 f6 01 f7 01 f8 01 E.2............. ad1c: f9 01 fa 01 fb 01 fc 01 84 03 .......... 0000ad26 : ad26: 83 64 ec 64 78 64 6f 64 68 64 74 50 43 47 61 64 .d.dxdodhdtPCGad ad36: 57 64 Wd 0000ad38 : ad38: 25 2e 32 30 53 0a 70 72 75 73 61 2e 69 6f 2f 30 %.20S.prusa.io/0 ad48: 34 25 68 75 00 4%hu. 0000ad4d : ad4d: 20 55 70 67 72 61 64 69 6e 67 20 78 66 6c 61 73 Upgrading xflas ad5d: 68 0a 20 44 6f 20 6e 6f 74 20 64 69 73 63 6f 6e h. Do not discon ad6d: 6e 65 63 74 21 00 nect!. 0000ad73 : ad73: 77 32 35 78 32 30 63 6c 5f 63 66 6d 0a 00 w25x20cl_cfm.. 0000ad81 : ad81: 77 32 35 78 32 30 63 6c 5f 65 6e 74 65 72 0a 00 w25x20cl_enter.. 0000ad91 : ad91: 73 74 61 72 74 0a 00 start.. 0000ad98 <__ctors_start>: ad98: da 39 cpi r29, 0x9A ; 154 0000ad9a <__ctors_end>: ad9a: 8d 64 ori r24, 0x4D ; 77 0000ad9c <__dtors_end>: ad9c: 11 24 eor r1, r1 ad9e: 1f be out 0x3f, r1 ; 63 ada0: cf ef ldi r28, 0xFF ; 255 ada2: d1 e2 ldi r29, 0x21 ; 33 ada4: de bf out 0x3e, r29 ; 62 ada6: cd bf out 0x3d, r28 ; 61 ada8: 00 e0 ldi r16, 0x00 ; 0 adaa: 0c bf out 0x3c, r16 ; 60 0000adac <__do_copy_data>: adac: 13 e0 ldi r17, 0x03 ; 3 adae: a0 e0 ldi r26, 0x00 ; 0 adb0: b2 e0 ldi r27, 0x02 ; 2 adb2: e6 e4 ldi r30, 0x46 ; 70 adb4: f5 ec ldi r31, 0xC5 ; 197 adb6: 03 e0 ldi r16, 0x03 ; 3 adb8: 0b bf out 0x3b, r16 ; 59 adba: 02 c0 rjmp .+4 ; 0xadc0 <__do_copy_data+0x14> adbc: 07 90 elpm r0, Z+ adbe: 0d 92 st X+, r0 adc0: a2 32 cpi r26, 0x22 ; 34 adc2: b1 07 cpc r27, r17 adc4: d9 f7 brne .-10 ; 0xadbc <__do_copy_data+0x10> 0000adc6 <__do_clear_bss>: adc6: 28 e1 ldi r18, 0x18 ; 24 adc8: a2 e2 ldi r26, 0x22 ; 34 adca: b3 e0 ldi r27, 0x03 ; 3 adcc: 01 c0 rjmp .+2 ; 0xadd0 <.do_clear_bss_start> 0000adce <.do_clear_bss_loop>: adce: 1d 92 st X+, r1 0000add0 <.do_clear_bss_start>: add0: af 31 cpi r26, 0x1F ; 31 add2: b2 07 cpc r27, r18 add4: e1 f7 brne .-8 ; 0xadce <.do_clear_bss_loop> 0000add6 <__do_global_ctors>: add6: 16 e5 ldi r17, 0x56 ; 86 add8: cd ec ldi r28, 0xCD ; 205 adda: d6 e5 ldi r29, 0x56 ; 86 addc: 00 e0 ldi r16, 0x00 ; 0 adde: 06 c0 rjmp .+12 ; 0xadec <__do_global_ctors+0x16> ade0: 21 97 sbiw r28, 0x01 ; 1 ade2: 01 09 sbc r16, r1 ade4: 80 2f mov r24, r16 ade6: fe 01 movw r30, r28 ade8: 0f 94 e7 dc call 0x3b9ce ; 0x3b9ce <__tablejump2__> adec: cc 3c cpi r28, 0xCC ; 204 adee: d1 07 cpc r29, r17 adf0: 80 e0 ldi r24, 0x00 ; 0 adf2: 08 07 cpc r16, r24 adf4: a9 f7 brne .-22 ; 0xade0 <__do_global_ctors+0xa> adf6: 0e 94 6b fa call 0x1f4d6 ; 0x1f4d6
adfa: 0d 94 91 e2 jmp 0x3c522 ; 0x3c522 <__do_global_dtors> 0000adfe <__bad_interrupt>: adfe: 0c 94 83 67 jmp 0xcf06 ; 0xcf06 <__vector_default> 0000ae02 : ae02: 2f 92 push r2 ae04: 3f 92 push r3 ae06: 4f 92 push r4 ae08: 5f 92 push r5 ae0a: 6f 92 push r6 ae0c: 7f 92 push r7 ae0e: 8f 92 push r8 ae10: 9f 92 push r9 ae12: af 92 push r10 ae14: bf 92 push r11 ae16: cf 92 push r12 ae18: df 92 push r13 ae1a: ef 92 push r14 ae1c: ff 92 push r15 ae1e: 0f 93 push r16 ae20: 1f 93 push r17 ae22: cf 93 push r28 ae24: df 93 push r29 ae26: cd b7 in r28, 0x3d ; 61 ae28: de b7 in r29, 0x3e ; 62 ae2a: 2f 97 sbiw r28, 0x0f ; 15 ae2c: 0f b6 in r0, 0x3f ; 63 ae2e: f8 94 cli ae30: de bf out 0x3e, r29 ; 62 ae32: 0f be out 0x3f, r0 ; 63 ae34: cd bf out 0x3d, r28 ; 61 ae36: 6c 01 movw r12, r24 ae38: 1b 01 movw r2, r22 ae3a: 5a 01 movw r10, r20 ae3c: fc 01 movw r30, r24 ae3e: 17 82 std Z+7, r1 ; 0x07 ae40: 16 82 std Z+6, r1 ; 0x06 ae42: 83 81 ldd r24, Z+3 ; 0x03 ae44: 9e 01 movw r18, r28 ae46: 2f 5f subi r18, 0xFF ; 255 ae48: 3f 4f sbci r19, 0xFF ; 255 ae4a: 49 01 movw r8, r18 ae4c: 81 fd sbrc r24, 1 ae4e: d2 c0 rjmp .+420 ; 0xaff4 ae50: 8f ef ldi r24, 0xFF ; 255 ae52: 9f ef ldi r25, 0xFF ; 255 ae54: ee c2 rjmp .+1500 ; 0xb432 ae56: f1 2c mov r15, r1 ae58: 51 2c mov r5, r1 ae5a: 00 e0 ldi r16, 0x00 ; 0 ae5c: 00 32 cpi r16, 0x20 ; 32 ae5e: 38 f4 brcc .+14 ; 0xae6e ae60: 8b 32 cpi r24, 0x2B ; 43 ae62: 09 f1 breq .+66 ; 0xaea6 ae64: 90 f4 brcc .+36 ; 0xae8a ae66: 80 32 cpi r24, 0x20 ; 32 ae68: f9 f0 breq .+62 ; 0xaea8 ae6a: 83 32 cpi r24, 0x23 ; 35 ae6c: 09 f1 breq .+66 ; 0xaeb0 ae6e: 07 fd sbrc r16, 7 ae70: 34 c0 rjmp .+104 ; 0xaeda ae72: 20 ed ldi r18, 0xD0 ; 208 ae74: 28 0f add r18, r24 ae76: 2a 30 cpi r18, 0x0A ; 10 ae78: 20 f5 brcc .+72 ; 0xaec2 ae7a: 06 ff sbrs r16, 6 ae7c: 1b c0 rjmp .+54 ; 0xaeb4 ae7e: fa e0 ldi r31, 0x0A ; 10 ae80: ff 9e mul r15, r31 ae82: 20 0d add r18, r0 ae84: 11 24 eor r1, r1 ae86: f2 2e mov r15, r18 ae88: 05 c0 rjmp .+10 ; 0xae94 ae8a: 8d 32 cpi r24, 0x2D ; 45 ae8c: 79 f0 breq .+30 ; 0xaeac ae8e: 80 33 cpi r24, 0x30 ; 48 ae90: 71 f7 brne .-36 ; 0xae6e ae92: 01 60 ori r16, 0x01 ; 1 ae94: f1 01 movw r30, r2 ae96: 93 fd sbrc r25, 3 ae98: 85 91 lpm r24, Z+ ae9a: 93 ff sbrs r25, 3 ae9c: 81 91 ld r24, Z+ ae9e: 1f 01 movw r2, r30 aea0: 81 11 cpse r24, r1 aea2: dc cf rjmp .-72 ; 0xae5c aea4: 1a c0 rjmp .+52 ; 0xaeda aea6: 02 60 ori r16, 0x02 ; 2 aea8: 04 60 ori r16, 0x04 ; 4 aeaa: f4 cf rjmp .-24 ; 0xae94 aeac: 08 60 ori r16, 0x08 ; 8 aeae: f2 cf rjmp .-28 ; 0xae94 aeb0: 00 61 ori r16, 0x10 ; 16 aeb2: f0 cf rjmp .-32 ; 0xae94 aeb4: 3a e0 ldi r19, 0x0A ; 10 aeb6: 53 9e mul r5, r19 aeb8: 20 0d add r18, r0 aeba: 11 24 eor r1, r1 aebc: 52 2e mov r5, r18 aebe: 00 62 ori r16, 0x20 ; 32 aec0: e9 cf rjmp .-46 ; 0xae94 aec2: 8e 32 cpi r24, 0x2E ; 46 aec4: 21 f4 brne .+8 ; 0xaece aec6: 06 fd sbrc r16, 6 aec8: b1 c2 rjmp .+1378 ; 0xb42c aeca: 00 64 ori r16, 0x40 ; 64 aecc: e3 cf rjmp .-58 ; 0xae94 aece: 8c 36 cpi r24, 0x6C ; 108 aed0: 11 f4 brne .+4 ; 0xaed6 aed2: 00 68 ori r16, 0x80 ; 128 aed4: df cf rjmp .-66 ; 0xae94 aed6: 88 36 cpi r24, 0x68 ; 104 aed8: e9 f2 breq .-70 ; 0xae94 aeda: 9b eb ldi r25, 0xBB ; 187 aedc: 98 0f add r25, r24 aede: 93 30 cpi r25, 0x03 ; 3 aee0: 08 f0 brcs .+2 ; 0xaee4 aee2: 5f c0 rjmp .+190 ; 0xafa2 aee4: 00 61 ori r16, 0x10 ; 16 aee6: 80 5e subi r24, 0xE0 ; 224 aee8: 06 fd sbrc r16, 6 aeea: 02 c0 rjmp .+4 ; 0xaef0 aeec: 46 e0 ldi r20, 0x06 ; 6 aeee: f4 2e mov r15, r20 aef0: 10 2f mov r17, r16 aef2: 1f 73 andi r17, 0x3F ; 63 aef4: 85 36 cpi r24, 0x65 ; 101 aef6: 09 f0 breq .+2 ; 0xaefa aef8: 5b c0 rjmp .+182 ; 0xafb0 aefa: 10 64 ori r17, 0x40 ; 64 aefc: 17 ff sbrs r17, 7 aefe: 61 c0 rjmp .+194 ; 0xafc2 af00: 8f 2d mov r24, r15 af02: 9b e3 ldi r25, 0x3B ; 59 af04: 9f 15 cp r25, r15 af06: 08 f4 brcc .+2 ; 0xaf0a af08: 8b e3 ldi r24, 0x3B ; 59 af0a: 44 24 eor r4, r4 af0c: 43 94 inc r4 af0e: 48 0e add r4, r24 af10: 27 e0 ldi r18, 0x07 ; 7 af12: 35 01 movw r6, r10 af14: f4 e0 ldi r31, 0x04 ; 4 af16: 6f 0e add r6, r31 af18: 71 1c adc r7, r1 af1a: f5 01 movw r30, r10 af1c: 60 81 ld r22, Z af1e: 71 81 ldd r23, Z+1 ; 0x01 af20: 82 81 ldd r24, Z+2 ; 0x02 af22: 93 81 ldd r25, Z+3 ; 0x03 af24: 04 2d mov r16, r4 af26: a4 01 movw r20, r8 af28: 0f 94 90 d8 call 0x3b120 ; 0x3b120 <__ftoa_engine> af2c: 5c 01 movw r10, r24 af2e: f9 81 ldd r31, Y+1 ; 0x01 af30: fc 87 std Y+12, r31 ; 0x0c af32: f0 ff sbrs r31, 0 af34: 03 c0 rjmp .+6 ; 0xaf3c af36: 0d e2 ldi r16, 0x2D ; 45 af38: f3 ff sbrs r31, 3 af3a: 07 c0 rjmp .+14 ; 0xaf4a af3c: 0b e2 ldi r16, 0x2B ; 43 af3e: 11 fd sbrc r17, 1 af40: 04 c0 rjmp .+8 ; 0xaf4a af42: 01 2f mov r16, r17 af44: 04 70 andi r16, 0x04 ; 4 af46: 12 fd sbrc r17, 2 af48: 00 e2 ldi r16, 0x20 ; 32 af4a: 2c 85 ldd r18, Y+12 ; 0x0c af4c: 2c 70 andi r18, 0x0C ; 12 af4e: e2 2e mov r14, r18 af50: 09 f4 brne .+2 ; 0xaf54 af52: 6b c0 rjmp .+214 ; 0xb02a af54: 01 11 cpse r16, r1 af56: d8 c2 rjmp .+1456 ; 0xb508 af58: f3 e0 ldi r31, 0x03 ; 3 af5a: e1 2c mov r14, r1 af5c: f5 15 cp r31, r5 af5e: a0 f4 brcc .+40 ; 0xaf88 af60: 83 e0 ldi r24, 0x03 ; 3 af62: e5 2c mov r14, r5 af64: e8 1a sub r14, r24 af66: 13 fd sbrc r17, 3 af68: 08 c0 rjmp .+16 ; 0xaf7a af6a: b6 01 movw r22, r12 af6c: 80 e2 ldi r24, 0x20 ; 32 af6e: 90 e0 ldi r25, 0x00 ; 0 af70: 0f 94 3f da call 0x3b47e ; 0x3b47e af74: ea 94 dec r14 af76: e1 10 cpse r14, r1 af78: f8 cf rjmp .-16 ; 0xaf6a af7a: 00 23 and r16, r16 af7c: 29 f0 breq .+10 ; 0xaf88 af7e: b6 01 movw r22, r12 af80: 80 2f mov r24, r16 af82: 90 e0 ldi r25, 0x00 ; 0 af84: 0f 94 3f da call 0x3b47e ; 0x3b47e af88: 3c 85 ldd r19, Y+12 ; 0x0c af8a: 2c e8 ldi r18, 0x8C ; 140 af8c: a2 2e mov r10, r18 af8e: 26 e7 ldi r18, 0x76 ; 118 af90: b2 2e mov r11, r18 af92: 33 fd sbrc r19, 3 af94: 04 c0 rjmp .+8 ; 0xaf9e af96: 90 e9 ldi r25, 0x90 ; 144 af98: a9 2e mov r10, r25 af9a: 96 e7 ldi r25, 0x76 ; 118 af9c: b9 2e mov r11, r25 af9e: 10 71 andi r17, 0x10 ; 16 afa0: 22 c0 rjmp .+68 ; 0xafe6 afa2: 9b e9 ldi r25, 0x9B ; 155 afa4: 98 0f add r25, r24 afa6: 93 30 cpi r25, 0x03 ; 3 afa8: 08 f0 brcs .+2 ; 0xafac afaa: 47 c1 rjmp .+654 ; 0xb23a afac: 0f 7e andi r16, 0xEF ; 239 afae: 9c cf rjmp .-200 ; 0xaee8 afb0: 86 36 cpi r24, 0x66 ; 102 afb2: 11 f4 brne .+4 ; 0xafb8 afb4: 10 68 ori r17, 0x80 ; 128 afb6: a2 cf rjmp .-188 ; 0xaefc afb8: ff 20 and r15, r15 afba: 09 f4 brne .+2 ; 0xafbe afbc: 9f cf rjmp .-194 ; 0xaefc afbe: fa 94 dec r15 afc0: 9d cf rjmp .-198 ; 0xaefc afc2: e7 e0 ldi r30, 0x07 ; 7 afc4: 2f 2d mov r18, r15 afc6: ef 15 cp r30, r15 afc8: 18 f4 brcc .+6 ; 0xafd0 afca: 27 e0 ldi r18, 0x07 ; 7 afcc: 37 e0 ldi r19, 0x07 ; 7 afce: f3 2e mov r15, r19 afd0: 41 2c mov r4, r1 afd2: 9f cf rjmp .-194 ; 0xaf12 afd4: 11 11 cpse r17, r1 afd6: 80 52 subi r24, 0x20 ; 32 afd8: b6 01 movw r22, r12 afda: 90 e0 ldi r25, 0x00 ; 0 afdc: 0f 94 3f da call 0x3b47e ; 0x3b47e afe0: 8f ef ldi r24, 0xFF ; 255 afe2: a8 1a sub r10, r24 afe4: b8 0a sbc r11, r24 afe6: f5 01 movw r30, r10 afe8: 84 91 lpm r24, Z afea: 81 11 cpse r24, r1 afec: f3 cf rjmp .-26 ; 0xafd4 afee: e1 10 cpse r14, r1 aff0: 84 c2 rjmp .+1288 ; 0xb4fa aff2: 53 01 movw r10, r6 aff4: f6 01 movw r30, r12 aff6: 93 81 ldd r25, Z+3 ; 0x03 aff8: f1 01 movw r30, r2 affa: 93 fd sbrc r25, 3 affc: 85 91 lpm r24, Z+ affe: 93 ff sbrs r25, 3 b000: 81 91 ld r24, Z+ b002: 1f 01 movw r2, r30 b004: 88 23 and r24, r24 b006: 09 f4 brne .+2 ; 0xb00a b008: 11 c2 rjmp .+1058 ; 0xb42c b00a: 85 32 cpi r24, 0x25 ; 37 b00c: 41 f4 brne .+16 ; 0xb01e b00e: 93 fd sbrc r25, 3 b010: 85 91 lpm r24, Z+ b012: 93 ff sbrs r25, 3 b014: 81 91 ld r24, Z+ b016: 1f 01 movw r2, r30 b018: 85 32 cpi r24, 0x25 ; 37 b01a: 09 f0 breq .+2 ; 0xb01e b01c: 1c cf rjmp .-456 ; 0xae56 b01e: b6 01 movw r22, r12 b020: 90 e0 ldi r25, 0x00 ; 0 b022: 0f 94 3f da call 0x3b47e ; 0x3b47e b026: 35 01 movw r6, r10 b028: e4 cf rjmp .-56 ; 0xaff2 b02a: 17 ff sbrs r17, 7 b02c: 6f c0 rjmp .+222 ; 0xb10c b02e: 4a 0c add r4, r10 b030: fc 85 ldd r31, Y+12 ; 0x0c b032: f4 ff sbrs r31, 4 b034: 04 c0 rjmp .+8 ; 0xb03e b036: 8a 81 ldd r24, Y+2 ; 0x02 b038: 81 33 cpi r24, 0x31 ; 49 b03a: 09 f4 brne .+2 ; 0xb03e b03c: 4a 94 dec r4 b03e: 14 14 cp r1, r4 b040: 0c f0 brlt .+2 ; 0xb044 b042: 86 c0 rjmp .+268 ; 0xb150 b044: 28 e0 ldi r18, 0x08 ; 8 b046: 24 15 cp r18, r4 b048: 10 f4 brcc .+4 ; 0xb04e b04a: 88 e0 ldi r24, 0x08 ; 8 b04c: 48 2e mov r4, r24 b04e: 85 e0 ldi r24, 0x05 ; 5 b050: 90 e0 ldi r25, 0x00 ; 0 b052: 17 ff sbrs r17, 7 b054: 06 c0 rjmp .+12 ; 0xb062 b056: c5 01 movw r24, r10 b058: b7 fe sbrs r11, 7 b05a: 02 c0 rjmp .+4 ; 0xb060 b05c: 90 e0 ldi r25, 0x00 ; 0 b05e: 80 e0 ldi r24, 0x00 ; 0 b060: 01 96 adiw r24, 0x01 ; 1 b062: 01 11 cpse r16, r1 b064: 01 96 adiw r24, 0x01 ; 1 b066: ff 20 and r15, r15 b068: 31 f0 breq .+12 ; 0xb076 b06a: 2f 2d mov r18, r15 b06c: 30 e0 ldi r19, 0x00 ; 0 b06e: 2f 5f subi r18, 0xFF ; 255 b070: 3f 4f sbci r19, 0xFF ; 255 b072: 82 0f add r24, r18 b074: 93 1f adc r25, r19 b076: 58 16 cp r5, r24 b078: 19 06 cpc r1, r25 b07a: 19 f0 breq .+6 ; 0xb082 b07c: 14 f0 brlt .+4 ; 0xb082 b07e: e5 2c mov r14, r5 b080: e8 1a sub r14, r24 b082: 81 2f mov r24, r17 b084: 89 70 andi r24, 0x09 ; 9 b086: 11 f4 brne .+4 ; 0xb08c b088: e1 10 cpse r14, r1 b08a: 67 c0 rjmp .+206 ; 0xb15a b08c: 00 23 and r16, r16 b08e: 29 f0 breq .+10 ; 0xb09a b090: b6 01 movw r22, r12 b092: 80 2f mov r24, r16 b094: 90 e0 ldi r25, 0x00 ; 0 b096: 0f 94 3f da call 0x3b47e ; 0x3b47e b09a: 13 fd sbrc r17, 3 b09c: 02 c0 rjmp .+4 ; 0xb0a2 b09e: e1 10 cpse r14, r1 b0a0: 63 c0 rjmp .+198 ; 0xb168 b0a2: 17 ff sbrs r17, 7 b0a4: 7c c0 rjmp .+248 ; 0xb19e b0a6: 85 01 movw r16, r10 b0a8: b7 fe sbrs r11, 7 b0aa: 02 c0 rjmp .+4 ; 0xb0b0 b0ac: 10 e0 ldi r17, 0x00 ; 0 b0ae: 00 e0 ldi r16, 0x00 ; 0 b0b0: c5 01 movw r24, r10 b0b2: 84 19 sub r24, r4 b0b4: 91 09 sbc r25, r1 b0b6: 2c 01 movw r4, r24 b0b8: 6f 2d mov r22, r15 b0ba: 70 e0 ldi r23, 0x00 ; 0 b0bc: ee 27 eor r30, r30 b0be: ff 27 eor r31, r31 b0c0: e6 1b sub r30, r22 b0c2: f7 0b sbc r31, r23 b0c4: ff 87 std Y+15, r31 ; 0x0f b0c6: ee 87 std Y+14, r30 ; 0x0e b0c8: 0f 3f cpi r16, 0xFF ; 255 b0ca: 10 07 cpc r17, r16 b0cc: 29 f4 brne .+10 ; 0xb0d8 b0ce: b6 01 movw r22, r12 b0d0: 8e e2 ldi r24, 0x2E ; 46 b0d2: 90 e0 ldi r25, 0x00 ; 0 b0d4: 0f 94 3f da call 0x3b47e ; 0x3b47e b0d8: a0 16 cp r10, r16 b0da: b1 06 cpc r11, r17 b0dc: 0c f4 brge .+2 ; 0xb0e0 b0de: 4b c0 rjmp .+150 ; 0xb176 b0e0: 40 16 cp r4, r16 b0e2: 51 06 cpc r5, r17 b0e4: 0c f0 brlt .+2 ; 0xb0e8 b0e6: 47 c0 rjmp .+142 ; 0xb176 b0e8: f5 01 movw r30, r10 b0ea: e0 1b sub r30, r16 b0ec: f1 0b sbc r31, r17 b0ee: e8 0d add r30, r8 b0f0: f9 1d adc r31, r9 b0f2: 81 81 ldd r24, Z+1 ; 0x01 b0f4: 01 50 subi r16, 0x01 ; 1 b0f6: 11 09 sbc r17, r1 b0f8: 2e 85 ldd r18, Y+14 ; 0x0e b0fa: 3f 85 ldd r19, Y+15 ; 0x0f b0fc: 02 17 cp r16, r18 b0fe: 13 07 cpc r17, r19 b100: e4 f1 brlt .+120 ; 0xb17a b102: b6 01 movw r22, r12 b104: 90 e0 ldi r25, 0x00 ; 0 b106: 0f 94 3f da call 0x3b47e ; 0x3b47e b10a: de cf rjmp .-68 ; 0xb0c8 b10c: 16 fd sbrc r17, 6 b10e: 9f cf rjmp .-194 ; 0xb04e b110: ef 2d mov r30, r15 b112: f0 e0 ldi r31, 0x00 ; 0 b114: ea 15 cp r30, r10 b116: fb 05 cpc r31, r11 b118: 34 f0 brlt .+12 ; 0xb126 b11a: 3c ef ldi r19, 0xFC ; 252 b11c: a3 16 cp r10, r19 b11e: 3f ef ldi r19, 0xFF ; 255 b120: b3 06 cpc r11, r19 b122: 0c f0 brlt .+2 ; 0xb126 b124: 10 68 ori r17, 0x80 ; 128 b126: 32 96 adiw r30, 0x02 ; 2 b128: e8 0d add r30, r8 b12a: f9 1d adc r31, r9 b12c: 01 c0 rjmp .+2 ; 0xb130 b12e: fa 94 dec r15 b130: ff 20 and r15, r15 b132: 19 f0 breq .+6 ; 0xb13a b134: 82 91 ld r24, -Z b136: 80 33 cpi r24, 0x30 ; 48 b138: d1 f3 breq .-12 ; 0xb12e b13a: 17 ff sbrs r17, 7 b13c: 88 cf rjmp .-240 ; 0xb04e b13e: 44 24 eor r4, r4 b140: 43 94 inc r4 b142: 4f 0c add r4, r15 b144: fa 14 cp r15, r10 b146: 1b 04 cpc r1, r11 b148: 31 f0 breq .+12 ; 0xb156 b14a: 2c f0 brlt .+10 ; 0xb156 b14c: fa 18 sub r15, r10 b14e: 7f cf rjmp .-258 ; 0xb04e b150: 44 24 eor r4, r4 b152: 43 94 inc r4 b154: 7c cf rjmp .-264 ; 0xb04e b156: f1 2c mov r15, r1 b158: 7a cf rjmp .-268 ; 0xb04e b15a: b6 01 movw r22, r12 b15c: 80 e2 ldi r24, 0x20 ; 32 b15e: 90 e0 ldi r25, 0x00 ; 0 b160: 0f 94 3f da call 0x3b47e ; 0x3b47e b164: ea 94 dec r14 b166: 90 cf rjmp .-224 ; 0xb088 b168: b6 01 movw r22, r12 b16a: 80 e3 ldi r24, 0x30 ; 48 b16c: 90 e0 ldi r25, 0x00 ; 0 b16e: 0f 94 3f da call 0x3b47e ; 0x3b47e b172: ea 94 dec r14 b174: 94 cf rjmp .-216 ; 0xb09e b176: 80 e3 ldi r24, 0x30 ; 48 b178: bd cf rjmp .-134 ; 0xb0f4 b17a: a0 16 cp r10, r16 b17c: b1 06 cpc r11, r17 b17e: 41 f4 brne .+16 ; 0xb190 b180: 9a 81 ldd r25, Y+2 ; 0x02 b182: 96 33 cpi r25, 0x36 ; 54 b184: 50 f4 brcc .+20 ; 0xb19a b186: 95 33 cpi r25, 0x35 ; 53 b188: 19 f4 brne .+6 ; 0xb190 b18a: 3c 85 ldd r19, Y+12 ; 0x0c b18c: 34 ff sbrs r19, 4 b18e: 05 c0 rjmp .+10 ; 0xb19a b190: b6 01 movw r22, r12 b192: 90 e0 ldi r25, 0x00 ; 0 b194: 0f 94 3f da call 0x3b47e ; 0x3b47e b198: 2a cf rjmp .-428 ; 0xafee b19a: 81 e3 ldi r24, 0x31 ; 49 b19c: f9 cf rjmp .-14 ; 0xb190 b19e: 8a 81 ldd r24, Y+2 ; 0x02 b1a0: 81 33 cpi r24, 0x31 ; 49 b1a2: 19 f0 breq .+6 ; 0xb1aa b1a4: 9c 85 ldd r25, Y+12 ; 0x0c b1a6: 9f 7e andi r25, 0xEF ; 239 b1a8: 9c 87 std Y+12, r25 ; 0x0c b1aa: b6 01 movw r22, r12 b1ac: 90 e0 ldi r25, 0x00 ; 0 b1ae: 0f 94 3f da call 0x3b47e ; 0x3b47e b1b2: ff 20 and r15, r15 b1b4: a9 f0 breq .+42 ; 0xb1e0 b1b6: b6 01 movw r22, r12 b1b8: 8e e2 ldi r24, 0x2E ; 46 b1ba: 90 e0 ldi r25, 0x00 ; 0 b1bc: 0f 94 3f da call 0x3b47e ; 0x3b47e b1c0: f3 94 inc r15 b1c2: f3 94 inc r15 b1c4: e2 e0 ldi r30, 0x02 ; 2 b1c6: 01 e0 ldi r16, 0x01 ; 1 b1c8: 0e 0f add r16, r30 b1ca: e8 0d add r30, r8 b1cc: f9 2d mov r31, r9 b1ce: f1 1d adc r31, r1 b1d0: 80 81 ld r24, Z b1d2: b6 01 movw r22, r12 b1d4: 90 e0 ldi r25, 0x00 ; 0 b1d6: 0f 94 3f da call 0x3b47e ; 0x3b47e b1da: e0 2f mov r30, r16 b1dc: 0f 11 cpse r16, r15 b1de: f3 cf rjmp .-26 ; 0xb1c6 b1e0: 85 e6 ldi r24, 0x65 ; 101 b1e2: 90 e0 ldi r25, 0x00 ; 0 b1e4: 14 ff sbrs r17, 4 b1e6: 02 c0 rjmp .+4 ; 0xb1ec b1e8: 85 e4 ldi r24, 0x45 ; 69 b1ea: 90 e0 ldi r25, 0x00 ; 0 b1ec: b6 01 movw r22, r12 b1ee: 0f 94 3f da call 0x3b47e ; 0x3b47e b1f2: b7 fc sbrc r11, 7 b1f4: 06 c0 rjmp .+12 ; 0xb202 b1f6: a1 14 cp r10, r1 b1f8: b1 04 cpc r11, r1 b1fa: c1 f4 brne .+48 ; 0xb22c b1fc: ec 85 ldd r30, Y+12 ; 0x0c b1fe: e4 ff sbrs r30, 4 b200: 15 c0 rjmp .+42 ; 0xb22c b202: b1 94 neg r11 b204: a1 94 neg r10 b206: b1 08 sbc r11, r1 b208: 8d e2 ldi r24, 0x2D ; 45 b20a: b6 01 movw r22, r12 b20c: 90 e0 ldi r25, 0x00 ; 0 b20e: 0f 94 3f da call 0x3b47e ; 0x3b47e b212: 80 e3 ldi r24, 0x30 ; 48 b214: 2a e0 ldi r18, 0x0A ; 10 b216: a2 16 cp r10, r18 b218: b1 04 cpc r11, r1 b21a: 54 f4 brge .+20 ; 0xb230 b21c: b6 01 movw r22, r12 b21e: 90 e0 ldi r25, 0x00 ; 0 b220: 0f 94 3f da call 0x3b47e ; 0x3b47e b224: b6 01 movw r22, r12 b226: c5 01 movw r24, r10 b228: c0 96 adiw r24, 0x30 ; 48 b22a: b4 cf rjmp .-152 ; 0xb194 b22c: 8b e2 ldi r24, 0x2B ; 43 b22e: ed cf rjmp .-38 ; 0xb20a b230: 8f 5f subi r24, 0xFF ; 255 b232: fa e0 ldi r31, 0x0A ; 10 b234: af 1a sub r10, r31 b236: b1 08 sbc r11, r1 b238: ed cf rjmp .-38 ; 0xb214 b23a: 83 36 cpi r24, 0x63 ; 99 b23c: c9 f0 breq .+50 ; 0xb270 b23e: 83 37 cpi r24, 0x73 ; 115 b240: 71 f1 breq .+92 ; 0xb29e b242: 83 35 cpi r24, 0x53 ; 83 b244: 09 f0 breq .+2 ; 0xb248 b246: 5b c0 rjmp .+182 ; 0xb2fe b248: 35 01 movw r6, r10 b24a: f2 e0 ldi r31, 0x02 ; 2 b24c: 6f 0e add r6, r31 b24e: 71 1c adc r7, r1 b250: f5 01 movw r30, r10 b252: a0 80 ld r10, Z b254: b1 80 ldd r11, Z+1 ; 0x01 b256: 6f 2d mov r22, r15 b258: 70 e0 ldi r23, 0x00 ; 0 b25a: 06 fd sbrc r16, 6 b25c: 02 c0 rjmp .+4 ; 0xb262 b25e: 6f ef ldi r22, 0xFF ; 255 b260: 7f ef ldi r23, 0xFF ; 255 b262: c5 01 movw r24, r10 b264: 0f 94 d3 d9 call 0x3b3a6 ; 0x3b3a6 b268: 9d 87 std Y+13, r25 ; 0x0d b26a: 8c 87 std Y+12, r24 ; 0x0c b26c: 00 68 ori r16, 0x80 ; 128 b26e: 0d c0 rjmp .+26 ; 0xb28a b270: 35 01 movw r6, r10 b272: 32 e0 ldi r19, 0x02 ; 2 b274: 63 0e add r6, r19 b276: 71 1c adc r7, r1 b278: f5 01 movw r30, r10 b27a: 80 81 ld r24, Z b27c: 89 83 std Y+1, r24 ; 0x01 b27e: 21 e0 ldi r18, 0x01 ; 1 b280: 30 e0 ldi r19, 0x00 ; 0 b282: 3d 87 std Y+13, r19 ; 0x0d b284: 2c 87 std Y+12, r18 ; 0x0c b286: 54 01 movw r10, r8 b288: 0f 77 andi r16, 0x7F ; 127 b28a: 03 fd sbrc r16, 3 b28c: 06 c0 rjmp .+12 ; 0xb29a b28e: 2c 85 ldd r18, Y+12 ; 0x0c b290: 3d 85 ldd r19, Y+13 ; 0x0d b292: 52 16 cp r5, r18 b294: 13 06 cpc r1, r19 b296: 09 f0 breq .+2 ; 0xb29a b298: a8 f4 brcc .+42 ; 0xb2c4 b29a: e5 2c mov r14, r5 b29c: 2b c0 rjmp .+86 ; 0xb2f4 b29e: 35 01 movw r6, r10 b2a0: 32 e0 ldi r19, 0x02 ; 2 b2a2: 63 0e add r6, r19 b2a4: 71 1c adc r7, r1 b2a6: f5 01 movw r30, r10 b2a8: a0 80 ld r10, Z b2aa: b1 80 ldd r11, Z+1 ; 0x01 b2ac: 6f 2d mov r22, r15 b2ae: 70 e0 ldi r23, 0x00 ; 0 b2b0: 06 fd sbrc r16, 6 b2b2: 02 c0 rjmp .+4 ; 0xb2b8 b2b4: 6f ef ldi r22, 0xFF ; 255 b2b6: 7f ef ldi r23, 0xFF ; 255 b2b8: c5 01 movw r24, r10 b2ba: 0f 94 f8 d9 call 0x3b3f0 ; 0x3b3f0 b2be: 9d 87 std Y+13, r25 ; 0x0d b2c0: 8c 87 std Y+12, r24 ; 0x0c b2c2: e2 cf rjmp .-60 ; 0xb288 b2c4: b6 01 movw r22, r12 b2c6: 80 e2 ldi r24, 0x20 ; 32 b2c8: 90 e0 ldi r25, 0x00 ; 0 b2ca: 0f 94 3f da call 0x3b47e ; 0x3b47e b2ce: 5a 94 dec r5 b2d0: de cf rjmp .-68 ; 0xb28e b2d2: f5 01 movw r30, r10 b2d4: 07 fd sbrc r16, 7 b2d6: 85 91 lpm r24, Z+ b2d8: 07 ff sbrs r16, 7 b2da: 81 91 ld r24, Z+ b2dc: 5f 01 movw r10, r30 b2de: b6 01 movw r22, r12 b2e0: 90 e0 ldi r25, 0x00 ; 0 b2e2: 0f 94 3f da call 0x3b47e ; 0x3b47e b2e6: e1 10 cpse r14, r1 b2e8: ea 94 dec r14 b2ea: 8c 85 ldd r24, Y+12 ; 0x0c b2ec: 9d 85 ldd r25, Y+13 ; 0x0d b2ee: 01 97 sbiw r24, 0x01 ; 1 b2f0: 9d 87 std Y+13, r25 ; 0x0d b2f2: 8c 87 std Y+12, r24 ; 0x0c b2f4: ec 85 ldd r30, Y+12 ; 0x0c b2f6: fd 85 ldd r31, Y+13 ; 0x0d b2f8: ef 2b or r30, r31 b2fa: 59 f7 brne .-42 ; 0xb2d2 b2fc: 78 ce rjmp .-784 ; 0xafee b2fe: 84 36 cpi r24, 0x64 ; 100 b300: 19 f0 breq .+6 ; 0xb308 b302: 89 36 cpi r24, 0x69 ; 105 b304: 09 f0 breq .+2 ; 0xb308 b306: 74 c0 rjmp .+232 ; 0xb3f0 b308: 35 01 movw r6, r10 b30a: 07 ff sbrs r16, 7 b30c: 66 c0 rjmp .+204 ; 0xb3da b30e: f4 e0 ldi r31, 0x04 ; 4 b310: 6f 0e add r6, r31 b312: 71 1c adc r7, r1 b314: f5 01 movw r30, r10 b316: 60 81 ld r22, Z b318: 71 81 ldd r23, Z+1 ; 0x01 b31a: 82 81 ldd r24, Z+2 ; 0x02 b31c: 93 81 ldd r25, Z+3 ; 0x03 b31e: 10 2f mov r17, r16 b320: 1f 76 andi r17, 0x6F ; 111 b322: 97 ff sbrs r25, 7 b324: 08 c0 rjmp .+16 ; 0xb336 b326: 90 95 com r25 b328: 80 95 com r24 b32a: 70 95 com r23 b32c: 61 95 neg r22 b32e: 7f 4f sbci r23, 0xFF ; 255 b330: 8f 4f sbci r24, 0xFF ; 255 b332: 9f 4f sbci r25, 0xFF ; 255 b334: 10 68 ori r17, 0x80 ; 128 b336: 2a e0 ldi r18, 0x0A ; 10 b338: 30 e0 ldi r19, 0x00 ; 0 b33a: a4 01 movw r20, r8 b33c: 0f 94 66 db call 0x3b6cc ; 0x3b6cc <__ultoa_invert> b340: a8 2e mov r10, r24 b342: a8 18 sub r10, r8 b344: ba 2c mov r11, r10 b346: 01 2f mov r16, r17 b348: 16 ff sbrs r17, 6 b34a: 0a c0 rjmp .+20 ; 0xb360 b34c: 0e 7f andi r16, 0xFE ; 254 b34e: af 14 cp r10, r15 b350: 38 f4 brcc .+14 ; 0xb360 b352: 14 ff sbrs r17, 4 b354: 04 c0 rjmp .+8 ; 0xb35e b356: 12 fd sbrc r17, 2 b358: 02 c0 rjmp .+4 ; 0xb35e b35a: 01 2f mov r16, r17 b35c: 0e 7e andi r16, 0xEE ; 238 b35e: bf 2c mov r11, r15 b360: 04 ff sbrs r16, 4 b362: a3 c0 rjmp .+326 ; 0xb4aa b364: fe 01 movw r30, r28 b366: ea 0d add r30, r10 b368: f1 1d adc r31, r1 b36a: 80 81 ld r24, Z b36c: 80 33 cpi r24, 0x30 ; 48 b36e: 09 f0 breq .+2 ; 0xb372 b370: 95 c0 rjmp .+298 ; 0xb49c b372: 09 7e andi r16, 0xE9 ; 233 b374: f0 2f mov r31, r16 b376: f8 70 andi r31, 0x08 ; 8 b378: ef 2e mov r14, r31 b37a: 03 fd sbrc r16, 3 b37c: a5 c0 rjmp .+330 ; 0xb4c8 b37e: 00 ff sbrs r16, 0 b380: 9f c0 rjmp .+318 ; 0xb4c0 b382: fa 2c mov r15, r10 b384: b5 14 cp r11, r5 b386: 10 f4 brcc .+4 ; 0xb38c b388: f5 0c add r15, r5 b38a: fb 18 sub r15, r11 b38c: 04 ff sbrs r16, 4 b38e: a2 c0 rjmp .+324 ; 0xb4d4 b390: b6 01 movw r22, r12 b392: 80 e3 ldi r24, 0x30 ; 48 b394: 90 e0 ldi r25, 0x00 ; 0 b396: 0f 94 3f da call 0x3b47e ; 0x3b47e b39a: 02 ff sbrs r16, 2 b39c: 09 c0 rjmp .+18 ; 0xb3b0 b39e: 88 e7 ldi r24, 0x78 ; 120 b3a0: 90 e0 ldi r25, 0x00 ; 0 b3a2: 01 ff sbrs r16, 1 b3a4: 02 c0 rjmp .+4 ; 0xb3aa b3a6: 88 e5 ldi r24, 0x58 ; 88 b3a8: 90 e0 ldi r25, 0x00 ; 0 b3aa: b6 01 movw r22, r12 b3ac: 0f 94 3f da call 0x3b47e ; 0x3b47e b3b0: af 14 cp r10, r15 b3b2: 08 f4 brcc .+2 ; 0xb3b6 b3b4: 9b c0 rjmp .+310 ; 0xb4ec b3b6: aa 94 dec r10 b3b8: 0a 2d mov r16, r10 b3ba: 10 e0 ldi r17, 0x00 ; 0 b3bc: 0f 5f subi r16, 0xFF ; 255 b3be: 1f 4f sbci r17, 0xFF ; 255 b3c0: 08 0d add r16, r8 b3c2: 19 1d adc r17, r9 b3c4: f8 01 movw r30, r16 b3c6: 82 91 ld r24, -Z b3c8: 8f 01 movw r16, r30 b3ca: b6 01 movw r22, r12 b3cc: 90 e0 ldi r25, 0x00 ; 0 b3ce: 0f 94 3f da call 0x3b47e ; 0x3b47e b3d2: 80 16 cp r8, r16 b3d4: 91 06 cpc r9, r17 b3d6: b1 f7 brne .-20 ; 0xb3c4 b3d8: 0a ce rjmp .-1004 ; 0xafee b3da: f2 e0 ldi r31, 0x02 ; 2 b3dc: 6f 0e add r6, r31 b3de: 71 1c adc r7, r1 b3e0: f5 01 movw r30, r10 b3e2: 60 81 ld r22, Z b3e4: 71 81 ldd r23, Z+1 ; 0x01 b3e6: 07 2e mov r0, r23 b3e8: 00 0c add r0, r0 b3ea: 88 0b sbc r24, r24 b3ec: 99 0b sbc r25, r25 b3ee: 97 cf rjmp .-210 ; 0xb31e b3f0: 10 2f mov r17, r16 b3f2: 85 37 cpi r24, 0x75 ; 117 b3f4: a9 f4 brne .+42 ; 0xb420 b3f6: 1f 7e andi r17, 0xEF ; 239 b3f8: 2a e0 ldi r18, 0x0A ; 10 b3fa: 30 e0 ldi r19, 0x00 ; 0 b3fc: 35 01 movw r6, r10 b3fe: 17 ff sbrs r17, 7 b400: 44 c0 rjmp .+136 ; 0xb48a b402: f4 e0 ldi r31, 0x04 ; 4 b404: 6f 0e add r6, r31 b406: 71 1c adc r7, r1 b408: f5 01 movw r30, r10 b40a: 60 81 ld r22, Z b40c: 71 81 ldd r23, Z+1 ; 0x01 b40e: 82 81 ldd r24, Z+2 ; 0x02 b410: 93 81 ldd r25, Z+3 ; 0x03 b412: a4 01 movw r20, r8 b414: 0f 94 66 db call 0x3b6cc ; 0x3b6cc <__ultoa_invert> b418: a8 2e mov r10, r24 b41a: a8 18 sub r10, r8 b41c: 1f 77 andi r17, 0x7F ; 127 b41e: 92 cf rjmp .-220 ; 0xb344 b420: 19 7f andi r17, 0xF9 ; 249 b422: 8f 36 cpi r24, 0x6F ; 111 b424: 79 f1 breq .+94 ; 0xb484 b426: f0 f4 brcc .+60 ; 0xb464 b428: 88 35 cpi r24, 0x58 ; 88 b42a: 39 f1 breq .+78 ; 0xb47a b42c: f6 01 movw r30, r12 b42e: 86 81 ldd r24, Z+6 ; 0x06 b430: 97 81 ldd r25, Z+7 ; 0x07 b432: 2f 96 adiw r28, 0x0f ; 15 b434: 0f b6 in r0, 0x3f ; 63 b436: f8 94 cli b438: de bf out 0x3e, r29 ; 62 b43a: 0f be out 0x3f, r0 ; 63 b43c: cd bf out 0x3d, r28 ; 61 b43e: df 91 pop r29 b440: cf 91 pop r28 b442: 1f 91 pop r17 b444: 0f 91 pop r16 b446: ff 90 pop r15 b448: ef 90 pop r14 b44a: df 90 pop r13 b44c: cf 90 pop r12 b44e: bf 90 pop r11 b450: af 90 pop r10 b452: 9f 90 pop r9 b454: 8f 90 pop r8 b456: 7f 90 pop r7 b458: 6f 90 pop r6 b45a: 5f 90 pop r5 b45c: 4f 90 pop r4 b45e: 3f 90 pop r3 b460: 2f 90 pop r2 b462: 08 95 ret b464: 80 37 cpi r24, 0x70 ; 112 b466: 39 f0 breq .+14 ; 0xb476 b468: 88 37 cpi r24, 0x78 ; 120 b46a: 01 f7 brne .-64 ; 0xb42c b46c: 14 fd sbrc r17, 4 b46e: 14 60 ori r17, 0x04 ; 4 b470: 20 e1 ldi r18, 0x10 ; 16 b472: 30 e0 ldi r19, 0x00 ; 0 b474: c3 cf rjmp .-122 ; 0xb3fc b476: 10 61 ori r17, 0x10 ; 16 b478: f9 cf rjmp .-14 ; 0xb46c b47a: 04 fd sbrc r16, 4 b47c: 16 60 ori r17, 0x06 ; 6 b47e: 20 e1 ldi r18, 0x10 ; 16 b480: 32 e0 ldi r19, 0x02 ; 2 b482: bc cf rjmp .-136 ; 0xb3fc b484: 28 e0 ldi r18, 0x08 ; 8 b486: 30 e0 ldi r19, 0x00 ; 0 b488: b9 cf rjmp .-142 ; 0xb3fc b48a: f2 e0 ldi r31, 0x02 ; 2 b48c: 6f 0e add r6, r31 b48e: 71 1c adc r7, r1 b490: f5 01 movw r30, r10 b492: 60 81 ld r22, Z b494: 71 81 ldd r23, Z+1 ; 0x01 b496: 90 e0 ldi r25, 0x00 ; 0 b498: 80 e0 ldi r24, 0x00 ; 0 b49a: bb cf rjmp .-138 ; 0xb412 b49c: 02 fd sbrc r16, 2 b49e: 02 c0 rjmp .+4 ; 0xb4a4 b4a0: b3 94 inc r11 b4a2: 68 cf rjmp .-304 ; 0xb374 b4a4: b3 94 inc r11 b4a6: b3 94 inc r11 b4a8: 65 cf rjmp .-310 ; 0xb374 b4aa: 80 2f mov r24, r16 b4ac: 86 78 andi r24, 0x86 ; 134 b4ae: 09 f4 brne .+2 ; 0xb4b2 b4b0: 61 cf rjmp .-318 ; 0xb374 b4b2: f6 cf rjmp .-20 ; 0xb4a0 b4b4: b6 01 movw r22, r12 b4b6: 80 e2 ldi r24, 0x20 ; 32 b4b8: 90 e0 ldi r25, 0x00 ; 0 b4ba: 0f 94 3f da call 0x3b47e ; 0x3b47e b4be: b3 94 inc r11 b4c0: b5 14 cp r11, r5 b4c2: c0 f3 brcs .-16 ; 0xb4b4 b4c4: e1 2c mov r14, r1 b4c6: 62 cf rjmp .-316 ; 0xb38c b4c8: e5 2c mov r14, r5 b4ca: eb 18 sub r14, r11 b4cc: b5 14 cp r11, r5 b4ce: 08 f4 brcc .+2 ; 0xb4d2 b4d0: 5d cf rjmp .-326 ; 0xb38c b4d2: f8 cf rjmp .-16 ; 0xb4c4 b4d4: 80 2f mov r24, r16 b4d6: 86 78 andi r24, 0x86 ; 134 b4d8: 09 f4 brne .+2 ; 0xb4dc b4da: 6a cf rjmp .-300 ; 0xb3b0 b4dc: 8b e2 ldi r24, 0x2B ; 43 b4de: 01 ff sbrs r16, 1 b4e0: 80 e2 ldi r24, 0x20 ; 32 b4e2: 07 fd sbrc r16, 7 b4e4: 8d e2 ldi r24, 0x2D ; 45 b4e6: b6 01 movw r22, r12 b4e8: 90 e0 ldi r25, 0x00 ; 0 b4ea: 60 cf rjmp .-320 ; 0xb3ac b4ec: b6 01 movw r22, r12 b4ee: 80 e3 ldi r24, 0x30 ; 48 b4f0: 90 e0 ldi r25, 0x00 ; 0 b4f2: 0f 94 3f da call 0x3b47e ; 0x3b47e b4f6: fa 94 dec r15 b4f8: 5b cf rjmp .-330 ; 0xb3b0 b4fa: b6 01 movw r22, r12 b4fc: 80 e2 ldi r24, 0x20 ; 32 b4fe: 90 e0 ldi r25, 0x00 ; 0 b500: 0f 94 3f da call 0x3b47e ; 0x3b47e b504: ea 94 dec r14 b506: 73 cd rjmp .-1306 ; 0xafee b508: 24 e0 ldi r18, 0x04 ; 4 b50a: e1 2c mov r14, r1 b50c: 25 15 cp r18, r5 b50e: 08 f0 brcs .+2 ; 0xb512 b510: 36 cd rjmp .-1428 ; 0xaf7e b512: 84 e0 ldi r24, 0x04 ; 4 b514: 26 cd rjmp .-1460 ; 0xaf62 0000b516 : 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 ( b516: 20 e0 ldi r18, 0x00 ; 0 b518: 30 e0 ldi r19, 0x00 ; 0 b51a: 40 e8 ldi r20, 0x80 ; 128 b51c: 5f eb ldi r21, 0xBF ; 191 b51e: 60 91 83 02 lds r22, 0x0283 ; 0x800283 b522: 70 91 84 02 lds r23, 0x0284 ; 0x800284 b526: 80 91 85 02 lds r24, 0x0285 ; 0x800285 b52a: 90 91 86 02 lds r25, 0x0286 ; 0x800286 b52e: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> b532: 88 23 and r24, r24 b534: 21 f1 breq .+72 ; 0xb57e (saved_start_position[0] != SAVED_START_POSITION_UNSET) && ( (CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_SDCARD) || b536: e0 91 91 12 lds r30, 0x1291 ; 0x801291 b53a: f0 91 92 12 lds r31, 0x1292 ; 0x801292 b53e: ec 55 subi r30, 0x5C ; 92 b540: ff 4e sbci r31, 0xEF ; 239 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) && ( b542: 80 81 ld r24, Z b544: 8b 7f andi r24, 0xFB ; 251 b546: 82 30 cpi r24, 0x02 ; 2 b548: d1 f4 brne .+52 ; 0xb57e (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)); b54a: 80 e1 ldi r24, 0x10 ; 16 b54c: e3 e8 ldi r30, 0x83 ; 131 b54e: f2 e0 ldi r31, 0x02 ; 2 b550: a1 e9 ldi r26, 0x91 ; 145 b552: b6 e0 ldi r27, 0x06 ; 6 b554: 01 90 ld r0, Z+ b556: 0d 92 st X+, r0 b558: 8a 95 dec r24 b55a: e1 f7 brne .-8 ; 0xb554 saved_start_position[0] = SAVED_START_POSITION_UNSET; b55c: 80 e0 ldi r24, 0x00 ; 0 b55e: 90 e0 ldi r25, 0x00 ; 0 b560: a0 e8 ldi r26, 0x80 ; 128 b562: bf eb ldi r27, 0xBF ; 191 b564: 80 93 83 02 sts 0x0283, r24 ; 0x800283 b568: 90 93 84 02 sts 0x0284, r25 ; 0x800284 b56c: a0 93 85 02 sts 0x0285, r26 ; 0x800285 b570: b0 93 86 02 sts 0x0286, r27 ; 0x800286 return saved_segment_idx; b574: 80 91 68 05 lds r24, 0x0568 ; 0x800568 b578: 90 91 69 05 lds r25, 0x0569 ; 0x800569 b57c: 08 95 ret } else return 1; //begin with the first segment b57e: 81 e0 ldi r24, 0x01 ; 1 b580: 90 e0 ldi r25, 0x00 ; 0 } b582: 08 95 ret 0000b584 : 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) { b584: cf 92 push r12 b586: df 92 push r13 b588: ef 92 push r14 b58a: ff 92 push r15 b58c: 0f 93 push r16 b58e: 1f 93 push r17 b590: cf 93 push r28 b592: 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); b594: 90 e0 ldi r25, 0x00 ; 0 b596: ec 01 movw r28, r24 b598: cc 0f add r28, r28 b59a: dd 1f adc r29, r29 b59c: cc 0f add r28, r28 b59e: dd 1f adc r29, r29 b5a0: fe 01 movw r30, r28 b5a2: e2 5c subi r30, 0xC2 ; 194 b5a4: f3 48 sbci r31, 0x83 ; 131 #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); b5a6: 25 91 lpm r18, Z+ b5a8: 35 91 lpm r19, Z+ b5aa: 45 91 lpm r20, Z+ b5ac: 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]; b5ae: fe 01 movw r30, r28 b5b0: eb 5e subi r30, 0xEB ; 235 b5b2: f1 4f sbci r31, 0xF1 ; 241 b5b4: c0 80 ld r12, Z b5b6: d1 80 ldd r13, Z+1 ; 0x01 b5b8: e2 80 ldd r14, Z+2 ; 0x02 b5ba: f3 80 ldd r15, Z+3 ; 0x03 b5bc: 8e 01 movw r16, r28 b5be: 0f 56 subi r16, 0x6F ; 111 b5c0: 19 4f sbci r17, 0xF9 ; 249 b5c2: c7 01 movw r24, r14 b5c4: b6 01 movw r22, r12 b5c6: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> b5ca: f8 01 movw r30, r16 b5cc: 60 83 st Z, r22 b5ce: 71 83 std Z+1, r23 ; 0x01 b5d0: 82 83 std Z+2, r24 ; 0x02 b5d2: 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); b5d4: fe 01 movw r30, r28 b5d6: ee 5c subi r30, 0xCE ; 206 b5d8: f3 48 sbci r31, 0x83 ; 131 #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); b5da: 25 91 lpm r18, Z+ b5dc: 35 91 lpm r19, Z+ b5de: 45 91 lpm r20, Z+ b5e0: 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]; b5e2: 8e 01 movw r16, r28 b5e4: 0f 5d subi r16, 0xDF ; 223 b5e6: 1d 4f sbci r17, 0xFD ; 253 b5e8: c7 01 movw r24, r14 b5ea: b6 01 movw r22, r12 b5ec: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> b5f0: f8 01 movw r30, r16 b5f2: 60 83 st Z, r22 b5f4: 71 83 std Z+1, r23 ; 0x01 b5f6: 82 83 std Z+2, r24 ; 0x02 b5f8: 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); b5fa: fe 01 movw r30, r28 b5fc: ea 5d subi r30, 0xDA ; 218 b5fe: f3 48 sbci r31, 0x83 ; 131 #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); b600: 25 91 lpm r18, Z+ b602: 35 91 lpm r19, Z+ b604: 45 91 lpm r20, Z+ b606: 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]; b608: cb 5e subi r28, 0xEB ; 235 b60a: dd 4f sbci r29, 0xFD ; 253 b60c: c7 01 movw r24, r14 b60e: b6 01 movw r22, r12 b610: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> b614: 68 83 st Y, r22 b616: 79 83 std Y+1, r23 ; 0x01 b618: 8a 83 std Y+2, r24 ; 0x02 b61a: 9b 83 std Y+3, r25 ; 0x03 } b61c: df 91 pop r29 b61e: cf 91 pop r28 b620: 1f 91 pop r17 b622: 0f 91 pop r16 b624: ff 90 pop r15 b626: ef 90 pop r14 b628: df 90 pop r13 b62a: cf 90 pop r12 b62c: 08 95 ret 0000b62e : 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)); } b62e: 80 e1 ldi r24, 0x10 ; 16 b630: e3 e7 ldi r30, 0x73 ; 115 b632: f6 e0 ldi r31, 0x06 ; 6 b634: a1 e9 ldi r26, 0x91 ; 145 b636: b6 e0 ldi r27, 0x06 ; 6 b638: 01 90 ld r0, Z+ b63a: 0d 92 st X+, r0 b63c: 8a 95 dec r24 b63e: e1 f7 brne .-8 ; 0xb638 b640: 08 95 ret 0000b642 : /// @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)); b642: e1 eb ldi r30, 0xB1 ; 177 b644: fb e7 ldi r31, 0x7B ; 123 b646: 83 30 cpi r24, 0x03 ; 3 b648: 21 f0 breq .+8 ; 0xb652 b64a: e8 2f mov r30, r24 b64c: f0 e0 ldi r31, 0x00 ; 0 b64e: e2 55 subi r30, 0x52 ; 82 b650: f4 48 sbci r31, 0x84 ; 132 b652: 84 91 lpm r24, Z } b654: 08 95 ret 0000b656 : #endif //SDSUPPORT } uint16_t cmdqueue_calc_sd_length() { if (buflen == 0) b656: 40 91 a2 10 lds r20, 0x10A2 ; 0x8010a2 b65a: 50 91 a3 10 lds r21, 0x10A3 ; 0x8010a3 return 0; b65e: 90 e0 ldi r25, 0x00 ; 0 b660: 80 e0 ldi r24, 0x00 ; 0 #endif //SDSUPPORT } uint16_t cmdqueue_calc_sd_length() { if (buflen == 0) b662: 41 15 cp r20, r1 b664: 51 05 cpc r21, r1 b666: b1 f1 breq .+108 ; 0xb6d4 char hi; } lohi; uint16_t value; } sdlen_single; uint16_t sdlen = 0; for (size_t _buflen = buflen, _bufindr = bufindr;;) { b668: 20 91 91 12 lds r18, 0x1291 ; 0x801291 b66c: 30 91 92 12 lds r19, 0x1292 ; 0x801292 char lo; char hi; } lohi; uint16_t value; } sdlen_single; uint16_t sdlen = 0; b670: 90 e0 ldi r25, 0x00 ; 0 b672: 80 e0 ldi r24, 0x00 ; 0 for (size_t _buflen = buflen, _bufindr = bufindr;;) { if (cmdbuffer[_bufindr] == CMDBUFFER_CURRENT_TYPE_SDCARD) { b674: f9 01 movw r30, r18 b676: ec 55 subi r30, 0x5C ; 92 b678: ff 4e sbci r31, 0xEF ; 239 b67a: a0 81 ld r26, Z b67c: a2 30 cpi r26, 0x02 ; 2 b67e: 21 f4 brne .+8 ; 0xb688 sdlen_single.lohi.lo = cmdbuffer[_bufindr + 1]; b680: 61 81 ldd r22, Z+1 ; 0x01 sdlen_single.lohi.hi = cmdbuffer[_bufindr + 2]; b682: 72 81 ldd r23, Z+2 ; 0x02 sdlen += sdlen_single.value; b684: 86 0f add r24, r22 b686: 97 1f adc r25, r23 } if (-- _buflen == 0) b688: 41 50 subi r20, 0x01 ; 1 b68a: 51 09 sbc r21, r1 b68c: 19 f1 breq .+70 ; 0xb6d4 b68e: f9 01 movw r30, r18 b690: e9 55 subi r30, 0x59 ; 89 b692: ff 4e sbci r31, 0xEF ; 239 break; // First skip the current command ID and iterate up to the end of the string. for (_bufindr += CMDHDRSIZE; cmdbuffer[_bufindr] != 0; ++ _bufindr) ; b694: a1 91 ld r26, Z+ b696: 9f 01 movw r18, r30 b698: 24 5a subi r18, 0xA4 ; 164 b69a: 30 41 sbci r19, 0x10 ; 16 b69c: a1 11 cpse r26, r1 b69e: fa cf rjmp .-12 ; 0xb694 b6a0: f9 01 movw r30, r18 b6a2: ec 55 subi r30, 0x5C ; 92 b6a4: ff 4e sbci r31, 0xEF ; 239 // 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) ; b6a6: 2d 3e cpi r18, 0xED ; 237 b6a8: a1 e0 ldi r26, 0x01 ; 1 b6aa: 3a 07 cpc r19, r26 b6ac: 30 f4 brcc .+12 ; 0xb6ba b6ae: a1 91 ld r26, Z+ b6b0: a1 11 cpse r26, r1 b6b2: e0 cf rjmp .-64 ; 0xb674 b6b4: 2f 5f subi r18, 0xFF ; 255 b6b6: 3f 4f sbci r19, 0xFF ; 255 b6b8: f6 cf rjmp .-20 ; 0xb6a6 // If the end of the buffer was empty, if (_bufindr == sizeof(cmdbuffer)) { b6ba: 2d 3e cpi r18, 0xED ; 237 b6bc: e1 e0 ldi r30, 0x01 ; 1 b6be: 3e 07 cpc r19, r30 b6c0: c9 f6 brne .-78 ; 0xb674 b6c2: e4 ea ldi r30, 0xA4 ; 164 b6c4: f0 e1 ldi r31, 0x10 ; 16 b6c6: 9f 01 movw r18, r30 b6c8: 24 5a subi r18, 0xA4 ; 164 b6ca: 30 41 sbci r19, 0x10 ; 16 // skip to the start and find the nonzero command. for (_bufindr = 0; cmdbuffer[_bufindr] == 0; ++ _bufindr) ; b6cc: a1 91 ld r26, Z+ b6ce: aa 23 and r26, r26 b6d0: d1 f3 breq .-12 ; 0xb6c6 b6d2: d0 cf rjmp .-96 ; 0xb674 } } return sdlen; } b6d4: 08 95 ret 0000b6d6 : memset((void*)adc_values, 0, sizeof(adc_values)); } static void adc_setmux(uint8_t ch) { ch &= 0x0f; b6d6: 98 2f mov r25, r24 b6d8: 9f 70 andi r25, 0x0F ; 15 if (ch & 0x08) ADCSRB |= (1 << MUX5); b6da: 83 ff sbrs r24, 3 b6dc: 0d c0 rjmp .+26 ; 0xb6f8 b6de: 80 91 7b 00 lds r24, 0x007B ; 0x80007b <__TEXT_REGION_LENGTH__+0x7c207b> b6e2: 88 60 ori r24, 0x08 ; 8 else ADCSRB &= ~(1 << MUX5); b6e4: 80 93 7b 00 sts 0x007B, r24 ; 0x80007b <__TEXT_REGION_LENGTH__+0x7c207b> ADMUX = (ADMUX & ~(0x07)) | (ch & 0x07); b6e8: 80 91 7c 00 lds r24, 0x007C ; 0x80007c <__TEXT_REGION_LENGTH__+0x7c207c> b6ec: 88 7f andi r24, 0xF8 ; 248 b6ee: 97 70 andi r25, 0x07 ; 7 b6f0: 89 2b or r24, r25 b6f2: 80 93 7c 00 sts 0x007C, r24 ; 0x80007c <__TEXT_REGION_LENGTH__+0x7c207c> } b6f6: 08 95 ret static void adc_setmux(uint8_t ch) { ch &= 0x0f; if (ch & 0x08) ADCSRB |= (1 << MUX5); else ADCSRB &= ~(1 << MUX5); b6f8: 80 91 7b 00 lds r24, 0x007B ; 0x80007b <__TEXT_REGION_LENGTH__+0x7c207b> b6fc: 87 7f andi r24, 0xF7 ; 247 b6fe: f2 cf rjmp .-28 ; 0xb6e4 0000b700 : 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)); }; static inline uint8_t code_value_uint8() { return uint8_t(strtol(strchr_pointer+1, NULL, 10)); }; b700: 80 91 93 03 lds r24, 0x0393 ; 0x800393 b704: 90 91 94 03 lds r25, 0x0394 ; 0x800394 b708: 4a e0 ldi r20, 0x0A ; 10 b70a: 50 e0 ldi r21, 0x00 ; 0 b70c: 70 e0 ldi r23, 0x00 ; 0 b70e: 60 e0 ldi r22, 0x00 ; 0 b710: 01 96 adiw r24, 0x01 ; 1 b712: 0f 94 62 d7 call 0x3aec4 ; 0x3aec4 b716: 86 2f mov r24, r22 b718: 08 95 ret 0000b71a : // 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)); }; b71a: 80 91 93 03 lds r24, 0x0393 ; 0x800393 b71e: 90 91 94 03 lds r25, 0x0394 ; 0x800394 b722: 4a e0 ldi r20, 0x0A ; 10 b724: 50 e0 ldi r21, 0x00 ; 0 b726: 70 e0 ldi r23, 0x00 ; 0 b728: 60 e0 ldi r22, 0x00 ; 0 b72a: 01 96 adiw r24, 0x01 ; 1 b72c: 0f 94 62 d7 call 0x3aec4 ; 0x3aec4 b730: cb 01 movw r24, r22 b732: 08 95 ret 0000b734 : // 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); } b734: 80 91 93 03 lds r24, 0x0393 ; 0x800393 b738: 90 91 94 03 lds r25, 0x0394 ; 0x800394 b73c: 4a e0 ldi r20, 0x0A ; 10 b73e: 50 e0 ldi r21, 0x00 ; 0 b740: 70 e0 ldi r23, 0x00 ; 0 b742: 60 e0 ldi r22, 0x00 ; 0 b744: 01 96 adiw r24, 0x01 ; 1 b746: 0d 94 62 d7 jmp 0x3aec4 ; 0x3aec4 0000b74a : // 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; b74a: 80 91 9a 04 lds r24, 0x049A ; 0x80049a b74e: 90 91 9b 04 lds r25, 0x049B ; 0x80049b b752: 90 93 99 04 sts 0x0499, r25 ; 0x800499 b756: 80 93 98 04 sts 0x0498, r24 ; 0x800498 void FlushSerialRequestResend() { //char cmdbuffer[bufindr][100]="Resend:"; MYSERIAL.flush(); printf_P(_N("%S: %ld\n%S\n"), _n("Resend"), gcode_LastN + 1, MSG_OK); b75a: 85 ef ldi r24, 0xF5 ; 245 b75c: 9d e6 ldi r25, 0x6D ; 109 b75e: 9f 93 push r25 b760: 8f 93 push r24 b762: 80 91 78 03 lds r24, 0x0378 ; 0x800378 b766: 90 91 79 03 lds r25, 0x0379 ; 0x800379 b76a: a0 91 7a 03 lds r26, 0x037A ; 0x80037a b76e: b0 91 7b 03 lds r27, 0x037B ; 0x80037b b772: 01 96 adiw r24, 0x01 ; 1 b774: a1 1d adc r26, r1 b776: b1 1d adc r27, r1 b778: bf 93 push r27 b77a: af 93 push r26 b77c: 9f 93 push r25 b77e: 8f 93 push r24 b780: 81 ea ldi r24, 0xA1 ; 161 b782: 96 e6 ldi r25, 0x66 ; 102 b784: 9f 93 push r25 b786: 8f 93 push r24 b788: 88 ea ldi r24, 0xA8 ; 168 b78a: 96 e6 ldi r25, 0x66 ; 102 b78c: 9f 93 push r25 b78e: 8f 93 push r24 b790: 0f 94 99 da call 0x3b532 ; 0x3b532 b794: 8d b7 in r24, 0x3d ; 61 b796: 9e b7 in r25, 0x3e ; 62 b798: 0a 96 adiw r24, 0x0a ; 10 b79a: 0f b6 in r0, 0x3f ; 63 b79c: f8 94 cli b79e: 9e bf out 0x3e, r25 ; 62 b7a0: 0f be out 0x3f, r0 ; 63 b7a2: 8d bf out 0x3d, r24 ; 61 } b7a4: 08 95 ret 0000b7a6 : 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) { b7a6: 0f 93 push r16 b7a8: 1f 93 push r17 b7aa: cf 93 push r28 b7ac: df 93 push r29 b7ae: ec 01 movw r28, r24 b7b0: c6 0f add r28, r22 b7b2: d7 1f adc r29, r23 const uint8_t *p = (const uint8_t*)__p; while (__n--) { b7b4: 8c 17 cp r24, r28 b7b6: 9d 07 cpc r25, r29 b7b8: 79 f0 breq .+30 ; 0xb7d8 if (eeprom_read_byte(p++) != EEPROM_EMPTY_VALUE) b7ba: 8c 01 movw r16, r24 b7bc: 0f 5f subi r16, 0xFF ; 255 b7be: 1f 4f sbci r17, 0xFF ; 255 b7c0: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae b7c4: 8f 3f cpi r24, 0xFF ; 255 b7c6: 31 f0 breq .+12 ; 0xb7d4 return true; b7c8: 81 e0 ldi r24, 0x01 ; 1 } return false; } b7ca: df 91 pop r29 b7cc: cf 91 pop r28 b7ce: 1f 91 pop r17 b7d0: 0f 91 pop r16 b7d2: 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) b7d4: c8 01 movw r24, r16 b7d6: ee cf rjmp .-36 ; 0xb7b4 return true; } return false; b7d8: 80 e0 ldi r24, 0x00 ; 0 b7da: f7 cf rjmp .-18 ; 0xb7ca 0000b7dc : #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; } b7dc: 68 2f mov r22, r24 b7de: 88 0f add r24, r24 b7e0: 77 0b sbc r23, r23 b7e2: 80 91 91 12 lds r24, 0x1291 ; 0x801291 b7e6: 90 91 92 12 lds r25, 0x1292 ; 0x801292 b7ea: 89 55 subi r24, 0x59 ; 89 b7ec: 9f 4e sbci r25, 0xEF ; 239 b7ee: 0f 94 2e e2 call 0x3c45c ; 0x3c45c b7f2: 9c 01 movw r18, r24 b7f4: 90 93 94 03 sts 0x0394, r25 ; 0x800394 b7f8: 80 93 93 03 sts 0x0393, r24 ; 0x800393 b7fc: 81 e0 ldi r24, 0x01 ; 1 b7fe: 23 2b or r18, r19 b800: 09 f4 brne .+2 ; 0xb804 b802: 80 e0 ldi r24, 0x00 ; 0 b804: 08 95 ret 0000b806 : #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 { b806: 0f 93 push r16 b808: 1f 93 push r17 b80a: cf 93 push r28 b80c: df 93 push r29 b80e: 8c 01 movw r16, r24 b810: 86 2f mov r24, r22 b812: ea 01 movw r28, r20 if (code_seen(code)) { b814: 0e 94 ee 5b call 0xb7dc ; 0xb7dc b818: 88 23 and r24, r24 b81a: 19 f1 breq .+70 ; 0xb862 // Verify value is within allowed range int16_t temp = code_value_short(); b81c: 0e 94 8d 5b call 0xb71a ; 0xb71a if (abs(temp) > BED_ADJUSTMENT_UM_MAX) { b820: 9c 01 movw r18, r24 b822: 97 ff sbrs r25, 7 b824: 03 c0 rjmp .+6 ; 0xb82c b826: 31 95 neg r19 b828: 21 95 neg r18 b82a: 31 09 sbc r19, r1 b82c: 25 36 cpi r18, 0x65 ; 101 b82e: 31 05 cpc r19, r1 b830: 9c f0 brlt .+38 ; 0xb858 printf_P(PSTR("%SExcessive bed leveling correction: %i microns\n"), errormagic, temp); b832: 9f 93 push r25 b834: 8f 93 push r24 b836: 8a ec ldi r24, 0xCA ; 202 b838: 9b ea ldi r25, 0xAB ; 171 b83a: 9f 93 push r25 b83c: 8f 93 push r24 b83e: 83 ea ldi r24, 0xA3 ; 163 b840: 9c e7 ldi r25, 0x7C ; 124 b842: 9f 93 push r25 b844: 8f 93 push r24 b846: 0f 94 99 da call 0x3b532 ; 0x3b532 b84a: 0f 90 pop r0 b84c: 0f 90 pop r0 b84e: 0f 90 pop r0 b850: 0f 90 pop r0 b852: 0f 90 pop r0 b854: 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; b856: 80 e0 ldi r24, 0x00 ; 0 }; b858: df 91 pop r29 b85a: cf 91 pop r28 b85c: 1f 91 pop r17 b85e: 0f 91 pop r16 b860: 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) { b862: f8 01 movw r30, r16 b864: 80 81 ld r24, Z b866: 88 23 and r24, r24 b868: b1 f3 breq .-20 ; 0xb856 return (int8_t)eeprom_read_byte(eep_address); b86a: ce 01 movw r24, r28 } return 0; }; b86c: df 91 pop r29 b86e: cf 91 pop r28 b870: 1f 91 pop r17 b872: 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); b874: 0d 94 d7 db jmp 0x3b7ae ; 0x3b7ae 0000b878 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); b878: 60 e0 ldi r22, 0x00 ; 0 b87a: 86 e6 ldi r24, 0x66 ; 102 b87c: 9f e0 ldi r25, 0x0F ; 15 b87e: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 b882: 60 e0 ldi r22, 0x00 ; 0 b884: 88 e6 ldi r24, 0x68 ; 104 b886: 9f e0 ldi r25, 0x0F ; 15 b888: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 b88c: 60 e0 ldi r22, 0x00 ; 0 b88e: 85 e6 ldi r24, 0x65 ; 101 b890: 9f e0 ldi r25, 0x0F ; 15 b892: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 b896: 60 e0 ldi r22, 0x00 ; 0 b898: 84 e6 ldi r24, 0x64 ; 100 b89a: 9f e0 ldi r25, 0x0F ; 15 b89c: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 b8a0: 60 e0 ldi r22, 0x00 ; 0 b8a2: 82 ed ldi r24, 0xD2 ; 210 b8a4: 9e e0 ldi r25, 0x0E ; 14 b8a6: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 b8aa: 60 e0 ldi r22, 0x00 ; 0 b8ac: 8f ec ldi r24, 0xCF ; 207 b8ae: 9e e0 ldi r25, 0x0E ; 14 b8b0: 0d 94 fb db jmp 0x3b7f6 ; 0x3b7f6 0000b8b4 : // 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) b8b4: 80 36 cpi r24, 0x60 ; 96 b8b6: 91 05 cpc r25, r1 b8b8: f8 f4 brcc .+62 ; 0xb8f8 return false; if (bufindr == bufindw && buflen > 0) b8ba: 40 91 91 12 lds r20, 0x1291 ; 0x801291 b8be: 50 91 92 12 lds r21, 0x1292 ; 0x801292 b8c2: 20 91 9f 10 lds r18, 0x109F ; 0x80109f <_ZL7bufindw.lto_priv.550> b8c6: 30 91 a0 10 lds r19, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.550+0x1> b8ca: 42 17 cp r20, r18 b8cc: 53 07 cpc r21, r19 b8ce: 39 f4 brne .+14 ; 0xb8de b8d0: 60 91 a2 10 lds r22, 0x10A2 ; 0x8010a2 b8d4: 70 91 a3 10 lds r23, 0x10A3 ; 0x8010a3 b8d8: 16 16 cp r1, r22 b8da: 17 06 cpc r1, r23 b8dc: 6c f0 brlt .+26 ; 0xb8f8 // 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); b8de: b9 01 movw r22, r18 b8e0: 68 0f add r22, r24 b8e2: 79 1f adc r23, r25 b8e4: fb 01 movw r30, r22 b8e6: e3 59 subi r30, 0x93 ; 147 b8e8: ff 4f sbci r31, 0xFF ; 255 if (bufindw < bufindr) b8ea: 24 17 cp r18, r20 b8ec: 35 07 cpc r19, r21 b8ee: 30 f4 brcc .+12 ; 0xb8fc // Simple case. There is a contiguous space between the write buffer and the read buffer. return endw + CMDBUFFER_RESERVE_FRONT <= bufindr; b8f0: 81 e0 ldi r24, 0x01 ; 1 b8f2: 4e 17 cp r20, r30 b8f4: 5f 07 cpc r21, r31 b8f6: 08 f4 brcc .+2 ; 0xb8fa // 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; b8f8: 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; } b8fa: 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? b8fc: ee 3e cpi r30, 0xEE ; 238 b8fe: f1 40 sbci r31, 0x01 ; 1 b900: f8 f0 brcs .+62 ; 0xb940 // 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); b902: 6c 5f subi r22, 0xFC ; 252 b904: 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) || b906: 6e 3e cpi r22, 0xEE ; 238 b908: 71 40 sbci r23, 0x01 ; 1 b90a: 18 f4 brcc .+6 ; 0xb912 // Could one fit to the end, and the reserve to the start? (endw <= sizeof(cmdbuffer) && CMDBUFFER_RESERVE_FRONT <= bufindr)) b90c: 49 36 cpi r20, 0x69 ; 105 b90e: 51 05 cpc r21, r1 b910: b8 f4 brcc .+46 ; 0xb940 return true; // Could one fit both to the start? if (len_asked + (1 + CMDHDRSIZE) + CMDBUFFER_RESERVE_FRONT <= bufindr) { b912: 83 59 subi r24, 0x93 ; 147 b914: 9f 4f sbci r25, 0xFF ; 255 b916: 48 17 cp r20, r24 b918: 59 07 cpc r21, r25 b91a: 70 f3 brcs .-36 ; 0xb8f8 // Mark the rest of the buffer as used. memset(cmdbuffer+bufindw, 0, sizeof(cmdbuffer)-bufindw); b91c: 4d ee ldi r20, 0xED ; 237 b91e: 51 e0 ldi r21, 0x01 ; 1 b920: 42 1b sub r20, r18 b922: 53 0b sbc r21, r19 b924: 70 e0 ldi r23, 0x00 ; 0 b926: 60 e0 ldi r22, 0x00 ; 0 b928: c9 01 movw r24, r18 b92a: 8c 55 subi r24, 0x5C ; 92 b92c: 9f 4e sbci r25, 0xEF ; 239 b92e: 0f 94 09 e2 call 0x3c412 ; 0x3c412 // 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; } b932: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); b934: f8 94 cli b936: 10 92 a0 10 sts 0x10A0, r1 ; 0x8010a0 <_ZL7bufindw.lto_priv.550+0x1> b93a: 10 92 9f 10 sts 0x109F, r1 ; 0x80109f <_ZL7bufindw.lto_priv.550> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; b93e: 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; b940: 81 e0 ldi r24, 0x01 ; 1 b942: 08 95 ret 0000b944 : //we have no temp compensation data } } #endif //ndef PINDA_THERMISTOR float temp_comp_interpolation(float inp_temperature) { b944: 2f 92 push r2 b946: 3f 92 push r3 b948: 4f 92 push r4 b94a: 5f 92 push r5 b94c: 6f 92 push r6 b94e: 7f 92 push r7 b950: 8f 92 push r8 b952: 9f 92 push r9 b954: af 92 push r10 b956: bf 92 push r11 b958: cf 92 push r12 b95a: df 92 push r13 b95c: ef 92 push r14 b95e: ff 92 push r15 b960: 0f 93 push r16 b962: 1f 93 push r17 b964: cf 93 push r28 b966: df 93 push r29 b968: cd b7 in r28, 0x3d ; 61 b96a: de b7 in r29, 0x3e ; 62 b96c: cc 58 subi r28, 0x8C ; 140 b96e: d2 40 sbci r29, 0x02 ; 2 b970: 0f b6 in r0, 0x3f ; 63 b972: f8 94 cli b974: de bf out 0x3e, r29 ; 62 b976: 0f be out 0x3f, r0 ; 63 b978: cd bf out 0x3d, r28 ; 61 b97a: cb 58 subi r28, 0x8B ; 139 b97c: dd 4f sbci r29, 0xFD ; 253 b97e: 68 83 st Y, r22 b980: 79 83 std Y+1, r23 ; 0x01 b982: 8a 83 std Y+2, r24 ; 0x02 b984: 9b 83 std Y+3, r25 ; 0x03 b986: c5 57 subi r28, 0x75 ; 117 b988: 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; b98a: fe 01 movw r30, r28 b98c: e7 54 subi r30, 0x47 ; 71 b98e: fe 4f sbci r31, 0xFE ; 254 b990: 88 e2 ldi r24, 0x28 ; 40 b992: df 01 movw r26, r30 b994: 1d 92 st X+, r1 b996: 8a 95 dec r24 b998: e9 f7 brne .-6 ; 0xb994 b99a: e8 5b subi r30, 0xB8 ; 184 b99c: f1 40 sbci r31, 0x01 ; 1 b99e: 1f 01 movw r2, r30 b9a0: 80 e9 ldi r24, 0x90 ; 144 b9a2: 91 e0 ldi r25, 0x01 ; 1 b9a4: df 01 movw r26, r30 b9a6: fc 01 movw r30, r24 b9a8: 1d 92 st X+, r1 b9aa: 31 97 sbiw r30, 0x01 ; 1 b9ac: e9 f7 brne .-6 ; 0xb9a8 int shift[10]; int temp_C[10]; n = 6; //number of measured points shift[0] = 0; b9ae: c7 5a subi r28, 0xA7 ; 167 b9b0: dd 4f sbci r29, 0xFD ; 253 b9b2: 19 82 std Y+1, r1 ; 0x01 b9b4: 18 82 st Y, r1 b9b6: c9 55 subi r28, 0x59 ; 89 b9b8: d2 40 sbci r29, 0x02 ; 2 b9ba: 9e 01 movw r18, r28 b9bc: 2f 51 subi r18, 0x1F ; 31 b9be: 3e 4f sbci r19, 0xFE ; 254 b9c0: c1 59 subi r28, 0x91 ; 145 b9c2: dd 4f sbci r29, 0xFD ; 253 b9c4: 39 83 std Y+1, r19 ; 0x01 b9c6: 28 83 st Y, r18 b9c8: cf 56 subi r28, 0x6F ; 111 b9ca: d2 40 sbci r29, 0x02 ; 2 b9cc: 8e 01 movw r16, r28 b9ce: 07 5a subi r16, 0xA7 ; 167 b9d0: 1d 4f sbci r17, 0xFD ; 253 b9d2: ce 01 movw r24, r28 b9d4: 8f 5c subi r24, 0xCF ; 207 b9d6: 9d 4f sbci r25, 0xFD ; 253 b9d8: c3 59 subi r28, 0x93 ; 147 b9da: dd 4f sbci r29, 0xFD ; 253 b9dc: 99 83 std Y+1, r25 ; 0x01 b9de: 88 83 st Y, r24 b9e0: cd 56 subi r28, 0x6D ; 109 b9e2: d2 40 sbci r29, 0x02 ; 2 b9e4: 3c 01 movw r6, r24 b9e6: 49 01 movw r8, r18 b9e8: 40 eb ldi r20, 0xB0 ; 176 b9ea: a4 2e mov r10, r20 b9ec: 4f e0 ldi r20, 0x0F ; 15 b9ee: b4 2e mov r11, r20 b9f0: 53 e2 ldi r21, 0x23 ; 35 b9f2: c5 2e mov r12, r21 b9f4: d1 2c mov r13, r1 for (i = 0; i < n; i++) { b9f6: f1 2c mov r15, r1 b9f8: 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]; b9fa: b6 01 movw r22, r12 b9fc: 0d 2c mov r0, r13 b9fe: 00 0c add r0, r0 ba00: 88 0b sbc r24, r24 ba02: 99 0b sbc r25, r25 ba04: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> ba08: d4 01 movw r26, r8 ba0a: 6d 93 st X+, r22 ba0c: 7d 93 st X+, r23 ba0e: 8d 93 st X+, r24 ba10: 9d 93 st X+, r25 ba12: 4d 01 movw r8, r26 f[i] = (float)shift[i]; ba14: f8 01 movw r30, r16 ba16: 61 91 ld r22, Z+ ba18: 71 91 ld r23, Z+ ba1a: 8f 01 movw r16, r30 ba1c: 07 2e mov r0, r23 ba1e: 00 0c add r0, r0 ba20: 88 0b sbc r24, r24 ba22: 99 0b sbc r25, r25 ba24: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> ba28: d3 01 movw r26, r6 ba2a: 6d 93 st X+, r22 ba2c: 7d 93 st X+, r23 ba2e: 8d 93 st X+, r24 ba30: 9d 93 st X+, r25 ba32: 3d 01 movw r6, r26 int temp_C[10]; n = 6; //number of measured points shift[0] = 0; for (i = 0; i < n; i++) { ba34: bf ef ldi r27, 0xFF ; 255 ba36: eb 1a sub r14, r27 ba38: fb 0a sbc r15, r27 ba3a: e6 e0 ldi r30, 0x06 ; 6 ba3c: ee 16 cp r14, r30 ba3e: f1 04 cpc r15, r1 ba40: 09 f0 breq .+2 ; 0xba44 ba42: 38 c3 rjmp .+1648 ; 0xc0b4 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; ba44: cb 58 subi r28, 0x8B ; 139 ba46: dd 4f sbci r29, 0xFD ; 253 ba48: 28 81 ld r18, Y ba4a: 39 81 ldd r19, Y+1 ; 0x01 ba4c: 4a 81 ldd r20, Y+2 ; 0x02 ba4e: 5b 81 ldd r21, Y+3 ; 0x03 ba50: c5 57 subi r28, 0x75 ; 117 ba52: d2 40 sbci r29, 0x02 ; 2 ba54: c1 59 subi r28, 0x91 ; 145 ba56: dd 4f sbci r29, 0xFD ; 253 ba58: a8 81 ld r26, Y ba5a: b9 81 ldd r27, Y+1 ; 0x01 ba5c: cf 56 subi r28, 0x6F ; 111 ba5e: d2 40 sbci r29, 0x02 ; 2 ba60: 6d 91 ld r22, X+ ba62: 7d 91 ld r23, X+ ba64: 8d 91 ld r24, X+ ba66: 9c 91 ld r25, X ba68: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> ba6c: 41 2c mov r4, r1 ba6e: 51 2c mov r5, r1 ba70: 32 01 movw r6, r4 ba72: 18 16 cp r1, r24 ba74: 0c f4 brge .+2 ; 0xba78 ba76: 02 c3 rjmp .+1540 ; 0xc07c ba78: c3 59 subi r28, 0x93 ; 147 ba7a: dd 4f sbci r29, 0xFD ; 253 ba7c: 08 81 ld r16, Y ba7e: 19 81 ldd r17, Y+1 ; 0x01 ba80: cd 56 subi r28, 0x6D ; 109 ba82: d2 40 sbci r29, 0x02 ; 2 ba84: 0c 5e subi r16, 0xEC ; 236 ba86: 1f 4f sbci r17, 0xFF ; 255 ba88: c1 59 subi r28, 0x91 ; 145 ba8a: dd 4f sbci r29, 0xFD ; 253 ba8c: e8 80 ld r14, Y ba8e: f9 80 ldd r15, Y+1 ; 0x01 ba90: cf 56 subi r28, 0x6F ; 111 ba92: d2 40 sbci r29, 0x02 ; 2 ba94: b4 e1 ldi r27, 0x14 ; 20 ba96: eb 0e add r14, r27 ba98: f1 1c adc r15, r1 ba9a: 6e 01 movw r12, r28 ba9c: ef ed ldi r30, 0xDF ; 223 ba9e: ce 1a sub r12, r30 baa0: ed ef ldi r30, 0xFD ; 253 baa2: de 0a sbc r13, r30 baa4: 9e 01 movw r18, r28 baa6: 2b 55 subi r18, 0x5B ; 91 baa8: 3e 4f sbci r19, 0xFE ; 254 baaa: cf 58 subi r28, 0x8F ; 143 baac: dd 4f sbci r29, 0xFD ; 253 baae: 39 83 std Y+1, r19 ; 0x01 bab0: 28 83 st Y, r18 bab2: c1 57 subi r28, 0x71 ; 113 bab4: 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]); bab6: d8 01 movw r26, r16 bab8: 4d 90 ld r4, X+ baba: 5d 90 ld r5, X+ babc: 6d 90 ld r6, X+ babe: 7c 90 ld r7, X bac0: f7 01 movw r30, r14 bac2: 60 81 ld r22, Z bac4: 71 81 ldd r23, Z+1 ; 0x01 bac6: 82 81 ldd r24, Z+2 ; 0x02 bac8: 93 81 ldd r25, Z+3 ; 0x03 baca: d7 01 movw r26, r14 bacc: 5e 91 ld r21, -X bace: 4e 91 ld r20, -X bad0: 3e 91 ld r19, -X bad2: 2e 91 ld r18, -X bad4: 7d 01 movw r14, r26 bad6: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> bada: 4b 01 movw r8, r22 badc: 5c 01 movw r10, r24 bade: f8 01 movw r30, r16 bae0: 52 91 ld r21, -Z bae2: 42 91 ld r20, -Z bae4: 32 91 ld r19, -Z bae6: 22 91 ld r18, -Z bae8: 8f 01 movw r16, r30 baea: c3 01 movw r24, r6 baec: b2 01 movw r22, r4 baee: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> baf2: a5 01 movw r20, r10 baf4: 94 01 movw r18, r8 baf6: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> bafa: d6 01 movw r26, r12 bafc: 9e 93 st -X, r25 bafe: 8e 93 st -X, r24 bb00: 7e 93 st -X, r23 bb02: 6e 93 st -X, r22 bb04: 6d 01 movw r12, r26 h[i - 1] = x[i] - x[i - 1]; bb06: cf 58 subi r28, 0x8F ; 143 bb08: dd 4f sbci r29, 0xFD ; 253 bb0a: e8 81 ld r30, Y bb0c: f9 81 ldd r31, Y+1 ; 0x01 bb0e: c1 57 subi r28, 0x71 ; 113 bb10: d2 40 sbci r29, 0x02 ; 2 bb12: b2 92 st -Z, r11 bb14: a2 92 st -Z, r10 bb16: 92 92 st -Z, r9 bb18: 82 92 st -Z, r8 bb1a: cf 58 subi r28, 0x8F ; 143 bb1c: dd 4f sbci r29, 0xFD ; 253 bb1e: f9 83 std Y+1, r31 ; 0x01 bb20: e8 83 st Y, r30 bb22: c1 57 subi r28, 0x71 ; 113 bb24: 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--) { bb26: c3 59 subi r28, 0x93 ; 147 bb28: dd 4f sbci r29, 0xFD ; 253 bb2a: 28 81 ld r18, Y bb2c: 39 81 ldd r19, Y+1 ; 0x01 bb2e: cd 56 subi r28, 0x6D ; 109 bb30: d2 40 sbci r29, 0x02 ; 2 bb32: 02 17 cp r16, r18 bb34: 13 07 cpc r17, r19 bb36: 09 f0 breq .+2 ; 0xbb3a bb38: be cf rjmp .-132 ; 0xbab6 bb3a: 4e 01 movw r8, r28 bb3c: 3f e6 ldi r19, 0x6F ; 111 bb3e: 83 1a sub r8, r19 bb40: 3e ef ldi r19, 0xFE ; 254 bb42: 93 0a sbc r9, r19 bb44: 5e 01 movw r10, r28 bb46: 83 ef ldi r24, 0xF3 ; 243 bb48: a8 1a sub r10, r24 bb4a: 8d ef ldi r24, 0xFD ; 253 bb4c: b8 0a sbc r11, r24 bb4e: 61 01 movw r12, r2 bb50: 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 bb74: 9b 01 movw r18, r22 bb76: ac 01 movw r20, r24 bb78: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> bb7c: f8 01 movw r30, r16 bb7e: 64 a7 std Z+44, r22 ; 0x2c bb80: 75 a7 std Z+45, r23 ; 0x2d bb82: 86 a7 std Z+46, r24 ; 0x2e bb84: 97 a7 std Z+47, r25 ; 0x2f if (i != 1) { bb86: f1 e0 ldi r31, 0x01 ; 1 bb88: ef 16 cp r14, r31 bb8a: f1 04 cpc r15, r1 bb8c: 61 f0 breq .+24 ; 0xbba6 m[i][i - 1] = h[i - 1]; bb8e: d8 01 movw r26, r16 bb90: 98 96 adiw r26, 0x28 ; 40 bb92: 4d 92 st X+, r4 bb94: 5d 92 st X+, r5 bb96: 6d 92 st X+, r6 bb98: 7c 92 st X, r7 bb9a: 9b 97 sbiw r26, 0x2b ; 43 m[i - 1][i] = h[i - 1]; bb9c: f8 01 movw r30, r16 bb9e: 44 82 std Z+4, r4 ; 0x04 bba0: 55 82 std Z+5, r5 ; 0x05 bba2: 66 82 std Z+6, r6 ; 0x06 bba4: 77 82 std Z+7, r7 ; 0x07 } m[i][n - 1] = 6 * (F[i + 1] - F[i]); bba6: ff ef ldi r31, 0xFF ; 255 bba8: ef 1a sub r14, r31 bbaa: ff 0a sbc r15, r31 bbac: f5 01 movw r30, r10 bbae: 20 81 ld r18, Z bbb0: 31 81 ldd r19, Z+1 ; 0x01 bbb2: 42 81 ldd r20, Z+2 ; 0x02 bbb4: 53 81 ldd r21, Z+3 ; 0x03 bbb6: 84 e0 ldi r24, 0x04 ; 4 bbb8: a8 0e add r10, r24 bbba: b1 1c adc r11, r1 bbbc: 64 81 ldd r22, Z+4 ; 0x04 bbbe: 75 81 ldd r23, Z+5 ; 0x05 bbc0: 86 81 ldd r24, Z+6 ; 0x06 bbc2: 97 81 ldd r25, Z+7 ; 0x07 bbc4: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> bbc8: 20 e0 ldi r18, 0x00 ; 0 bbca: 30 e0 ldi r19, 0x00 ; 0 bbcc: 40 ec ldi r20, 0xC0 ; 192 bbce: 50 e4 ldi r21, 0x40 ; 64 bbd0: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> bbd4: d6 01 movw r26, r12 bbd6: dc 96 adiw r26, 0x3c ; 60 bbd8: 6d 93 st X+, r22 bbda: 7d 93 st X+, r23 bbdc: 8d 93 st X+, r24 bbde: 9c 93 st X, r25 bbe0: df 97 sbiw r26, 0x3f ; 63 bbe2: 04 5d subi r16, 0xD4 ; 212 bbe4: 1f 4f sbci r17, 0xFF ; 255 bbe6: b8 e2 ldi r27, 0x28 ; 40 bbe8: cb 0e add r12, r27 bbea: 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 bbf4: b1 cf rjmp .-158 ; 0xbb58 bbf6: 7e 01 movw r14, r28 bbf8: fd e2 ldi r31, 0x2D ; 45 bbfa: ef 0e add r14, r31 bbfc: f1 1c adc r15, r1 bbfe: 28 e2 ldi r18, 0x28 ; 40 bc00: a2 2e mov r10, r18 bc02: b1 2c mov r11, r1 bc04: 00 eb ldi r16, 0xB0 ; 176 bc06: 1f ef ldi r17, 0xFF ; 255 bc08: 24 e0 ldi r18, 0x04 ; 4 bc0a: 22 0e add r2, r18 bc0c: 31 1c adc r3, r1 } m[i][n - 1] = 6 * (F[i + 1] - F[i]); } //*********** forward elimination ************** for (i = 1; i bc2a: 2b 01 movw r4, r22 bc2c: 3c 01 movw r6, r24 bc2e: 61 01 movw r12, r2 bc30: c0 1a sub r12, r16 bc32: d1 0a sbc r13, r17 for (j = 1; j <= n - 1; j++) bc34: 88 24 eor r8, r8 bc36: 83 94 inc r8 bc38: 91 2c mov r9, r1 m[i + 1][j] -= temp*m[i][j]; bc3a: f6 01 movw r30, r12 bc3c: e0 0f add r30, r16 bc3e: f1 1f adc r31, r17 bc40: ea 0d add r30, r10 bc42: fb 1d adc r31, r11 bc44: 20 81 ld r18, Z bc46: 31 81 ldd r19, Z+1 ; 0x01 bc48: 42 81 ldd r20, Z+2 ; 0x02 bc4a: 53 81 ldd r21, Z+3 ; 0x03 bc4c: c3 01 movw r24, r6 bc4e: b2 01 movw r22, r4 bc50: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> bc54: 9b 01 movw r18, r22 bc56: ac 01 movw r20, r24 bc58: f6 01 movw r30, r12 bc5a: 60 81 ld r22, Z bc5c: 71 81 ldd r23, Z+1 ; 0x01 bc5e: 82 81 ldd r24, Z+2 ; 0x02 bc60: 93 81 ldd r25, Z+3 ; 0x03 bc62: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> bc66: d6 01 movw r26, r12 bc68: 6d 93 st X+, r22 bc6a: 7d 93 st X+, r23 bc6c: 8d 93 st X+, r24 bc6e: 9d 93 st X+, r25 bc70: 6d 01 movw r12, r26 m[i][n - 1] = 6 * (F[i + 1] - F[i]); } //*********** forward elimination ************** for (i = 1; i bc80: 3c e2 ldi r19, 0x2C ; 44 bc82: e3 0e add r14, r19 bc84: f1 1c adc r15, r1 bc86: 08 52 subi r16, 0x28 ; 40 bc88: 11 09 sbc r17, r1 bc8a: 88 e2 ldi r24, 0x28 ; 40 bc8c: a8 0e add r10, r24 bc8e: 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 bc98: ba cf rjmp .-140 ; 0xbc0e bc9a: 1e 01 movw r2, r28 bc9c: f5 eb ldi r31, 0xB5 ; 181 bc9e: 2f 0e add r2, r31 bca0: 31 1c adc r3, r1 bca2: 6e 01 movw r12, r28 bca4: 21 eb ldi r18, 0xB1 ; 177 bca6: c2 0e add r12, r18 bca8: d1 1c adc r13, r1 bcaa: 7e 01 movw r14, r28 bcac: 37 e3 ldi r19, 0x37 ; 55 bcae: e3 1a sub r14, r19 bcb0: 3e ef ldi r19, 0xFE ; 254 bcb2: 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--) { bcb4: 04 e0 ldi r16, 0x04 ; 4 bcb6: 10 e0 ldi r17, 0x00 ; 0 bcb8: 48 01 movw r8, r16 bcba: b1 2c mov r11, r1 bcbc: a1 2c mov r10, r1 sum = 0; bcbe: 41 2c mov r4, r1 bcc0: 51 2c mov r5, r1 bcc2: 32 01 movw r6, r4 for (j = i; j <= n - 2; j++) sum += m[i][j] * s[j]; bcc4: f6 01 movw r30, r12 bcc6: ea 0d add r30, r10 bcc8: fb 1d adc r31, r11 bcca: d7 01 movw r26, r14 bccc: aa 0d add r26, r10 bcce: bb 1d adc r27, r11 bcd0: 2d 91 ld r18, X+ bcd2: 3d 91 ld r19, X+ bcd4: 4d 91 ld r20, X+ bcd6: 5c 91 ld r21, X bcd8: 60 81 ld r22, Z bcda: 71 81 ldd r23, Z+1 ; 0x01 bcdc: 82 81 ldd r24, Z+2 ; 0x02 bcde: 93 81 ldd r25, Z+3 ; 0x03 bce0: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> bce4: 9b 01 movw r18, r22 bce6: ac 01 movw r20, r24 bce8: c3 01 movw r24, r6 bcea: b2 01 movw r22, r4 bcec: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> bcf0: 2b 01 movw r4, r22 bcf2: 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++) bcf4: 8f ef ldi r24, 0xFF ; 255 bcf6: 88 1a sub r8, r24 bcf8: 98 0a sbc r9, r24 bcfa: 94 e0 ldi r25, 0x04 ; 4 bcfc: a9 0e add r10, r25 bcfe: b1 1c adc r11, r1 bd00: a5 e0 ldi r26, 0x05 ; 5 bd02: 8a 16 cp r8, r26 bd04: 91 04 cpc r9, r1 bd06: f1 f6 brne .-68 ; 0xbcc4 sum += m[i][j] * s[j]; s[i] = (m[i][n - 1] - sum) / m[i][i]; bd08: a3 01 movw r20, r6 bd0a: 92 01 movw r18, r4 bd0c: f1 01 movw r30, r2 bd0e: 60 81 ld r22, Z bd10: 71 81 ldd r23, Z+1 ; 0x01 bd12: 82 81 ldd r24, Z+2 ; 0x02 bd14: 93 81 ldd r25, Z+3 ; 0x03 bd16: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> bd1a: d6 01 movw r26, r12 bd1c: 2d 91 ld r18, X+ bd1e: 3d 91 ld r19, X+ bd20: 4d 91 ld r20, X+ bd22: 5c 91 ld r21, X bd24: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> bd28: f7 01 movw r30, r14 bd2a: 60 83 st Z, r22 bd2c: 71 83 std Z+1, r23 ; 0x01 bd2e: 82 83 std Z+2, r24 ; 0x02 bd30: 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--) { bd32: 01 50 subi r16, 0x01 ; 1 bd34: 11 09 sbc r17, r1 bd36: f8 e2 ldi r31, 0x28 ; 40 bd38: 2f 1a sub r2, r31 bd3a: 31 08 sbc r3, r1 bd3c: 2c e2 ldi r18, 0x2C ; 44 bd3e: c2 1a sub r12, r18 bd40: d1 08 sbc r13, r1 bd42: 34 e0 ldi r19, 0x04 ; 4 bd44: e3 1a sub r14, r19 bd46: f1 08 sbc r15, r1 bd48: 01 15 cp r16, r1 bd4a: 11 05 cpc r17, r1 bd4c: 09 f0 breq .+2 ; 0xbd50 bd4e: b4 cf rjmp .-152 ; 0xbcb8 sum += m[i][j] * s[j]; s[i] = (m[i][n - 1] - sum) / m[i][i]; } for (i = 0; i x[i + 1])) { bd50: cb 50 subi r28, 0x0B ; 11 bd52: de 4f sbci r29, 0xFE ; 254 bd54: 88 81 ld r24, Y bd56: 99 81 ldd r25, Y+1 ; 0x01 bd58: aa 81 ldd r26, Y+2 ; 0x02 bd5a: bb 81 ldd r27, Y+3 ; 0x03 bd5c: c5 5f subi r28, 0xF5 ; 245 bd5e: d1 40 sbci r29, 0x01 ; 1 bd60: cf 57 subi r28, 0x7F ; 127 bd62: dd 4f sbci r29, 0xFD ; 253 bd64: 88 83 st Y, r24 bd66: 99 83 std Y+1, r25 ; 0x01 bd68: aa 83 std Y+2, r26 ; 0x02 bd6a: bb 83 std Y+3, r27 ; 0x03 bd6c: c1 58 subi r28, 0x81 ; 129 bd6e: d2 40 sbci r29, 0x02 ; 2 bd70: 1e 01 movw r2, r28 bd72: 97 e4 ldi r25, 0x47 ; 71 bd74: 29 1a sub r2, r25 bd76: 9e ef ldi r25, 0xFE ; 254 bd78: 39 0a sbc r3, r25 bd7a: 10 e0 ldi r17, 0x00 ; 0 bd7c: 00 e0 ldi r16, 0x00 ; 0 bd7e: c1 59 subi r28, 0x91 ; 145 bd80: dd 4f sbci r29, 0xFD ; 253 bd82: a8 81 ld r26, Y bd84: b9 81 ldd r27, Y+1 ; 0x01 bd86: cf 56 subi r28, 0x6F ; 111 bd88: d2 40 sbci r29, 0x02 ; 2 bd8a: cd 90 ld r12, X+ bd8c: dd 90 ld r13, X+ bd8e: ed 90 ld r14, X+ bd90: fd 90 ld r15, X+ bd92: c1 59 subi r28, 0x91 ; 145 bd94: dd 4f sbci r29, 0xFD ; 253 bd96: b9 83 std Y+1, r27 ; 0x01 bd98: a8 83 st Y, r26 bd9a: cf 56 subi r28, 0x6F ; 111 bd9c: d2 40 sbci r29, 0x02 ; 2 bd9e: cb 58 subi r28, 0x8B ; 139 bda0: dd 4f sbci r29, 0xFD ; 253 bda2: 28 81 ld r18, Y bda4: 39 81 ldd r19, Y+1 ; 0x01 bda6: 4a 81 ldd r20, Y+2 ; 0x02 bda8: 5b 81 ldd r21, Y+3 ; 0x03 bdaa: c5 57 subi r28, 0x75 ; 117 bdac: d2 40 sbci r29, 0x02 ; 2 bdae: c7 01 movw r24, r14 bdb0: b6 01 movw r22, r12 bdb2: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> bdb6: 18 16 cp r1, r24 bdb8: b4 f0 brlt .+44 ; 0xbde6 bdba: cb 58 subi r28, 0x8B ; 139 bdbc: dd 4f sbci r29, 0xFD ; 253 bdbe: 28 81 ld r18, Y bdc0: 39 81 ldd r19, Y+1 ; 0x01 bdc2: 4a 81 ldd r20, Y+2 ; 0x02 bdc4: 5b 81 ldd r21, Y+3 ; 0x03 bdc6: c5 57 subi r28, 0x75 ; 117 bdc8: d2 40 sbci r29, 0x02 ; 2 bdca: c1 59 subi r28, 0x91 ; 145 bdcc: dd 4f sbci r29, 0xFD ; 253 bdce: e8 81 ld r30, Y bdd0: f9 81 ldd r31, Y+1 ; 0x01 bdd2: cf 56 subi r28, 0x6F ; 111 bdd4: d2 40 sbci r29, 0x02 ; 2 bdd6: 60 81 ld r22, Z bdd8: 71 81 ldd r23, Z+1 ; 0x01 bdda: 82 81 ldd r24, Z+2 ; 0x02 bddc: 93 81 ldd r25, Z+3 ; 0x03 bdde: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> bde2: 87 ff sbrs r24, 7 bde4: 18 c0 rjmp .+48 ; 0xbe16 bde6: 04 30 cpi r16, 0x04 ; 4 bde8: 11 05 cpc r17, r1 bdea: 09 f0 breq .+2 ; 0xbdee bdec: 30 c1 rjmp .+608 ; 0xc04e bdee: cb 58 subi r28, 0x8B ; 139 bdf0: dd 4f sbci r29, 0xFD ; 253 bdf2: 28 81 ld r18, Y bdf4: 39 81 ldd r19, Y+1 ; 0x01 bdf6: 4a 81 ldd r20, Y+2 ; 0x02 bdf8: 5b 81 ldd r21, Y+3 ; 0x03 bdfa: c5 57 subi r28, 0x75 ; 117 bdfc: d2 40 sbci r29, 0x02 ; 2 bdfe: cf 57 subi r28, 0x7F ; 127 be00: dd 4f sbci r29, 0xFD ; 253 be02: 68 81 ld r22, Y be04: 79 81 ldd r23, Y+1 ; 0x01 be06: 8a 81 ldd r24, Y+2 ; 0x02 be08: 9b 81 ldd r25, Y+3 ; 0x03 be0a: c1 58 subi r28, 0x81 ; 129 be0c: d2 40 sbci r29, 0x02 ; 2 be0e: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> be12: 87 ff sbrs r24, 7 be14: 1c c1 rjmp .+568 ; 0xc04e a = (s[i + 1] - s[i]) / (6 * h[i]); be16: d1 01 movw r26, r2 be18: 14 96 adiw r26, 0x04 ; 4 be1a: 8d 90 ld r8, X+ be1c: 9d 90 ld r9, X+ be1e: ad 90 ld r10, X+ be20: bc 90 ld r11, X be22: 17 97 sbiw r26, 0x07 ; 7 be24: 8d 91 ld r24, X+ be26: 9d 91 ld r25, X+ be28: 0d 90 ld r0, X+ be2a: bc 91 ld r27, X be2c: a0 2d mov r26, r0 be2e: cf 58 subi r28, 0x8F ; 143 be30: dd 4f sbci r29, 0xFD ; 253 be32: 88 83 st Y, r24 be34: 99 83 std Y+1, r25 ; 0x01 be36: aa 83 std Y+2, r26 ; 0x02 be38: bb 83 std Y+3, r27 ; 0x03 be3a: c1 57 subi r28, 0x71 ; 113 be3c: d2 40 sbci r29, 0x02 ; 2 be3e: f8 01 movw r30, r16 be40: ee 0f add r30, r30 be42: ff 1f adc r31, r31 be44: ee 0f add r30, r30 be46: ff 1f adc r31, r31 be48: 21 e9 ldi r18, 0x91 ; 145 be4a: 31 e0 ldi r19, 0x01 ; 1 be4c: 2c 0f add r18, r28 be4e: 3d 1f adc r19, r29 be50: e2 0f add r30, r18 be52: f3 1f adc r31, r19 be54: 40 80 ld r4, Z be56: 51 80 ldd r5, Z+1 ; 0x01 be58: 62 80 ldd r6, Z+2 ; 0x02 be5a: 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; be5c: c3 59 subi r28, 0x93 ; 147 be5e: dd 4f sbci r29, 0xFD ; 253 be60: a8 81 ld r26, Y be62: b9 81 ldd r27, Y+1 ; 0x01 be64: cd 56 subi r28, 0x6D ; 109 be66: d2 40 sbci r29, 0x02 ; 2 be68: 8d 91 ld r24, X+ be6a: 9d 91 ld r25, X+ be6c: 0d 90 ld r0, X+ be6e: bc 91 ld r27, X be70: a0 2d mov r26, r0 be72: c3 58 subi r28, 0x83 ; 131 be74: dd 4f sbci r29, 0xFD ; 253 be76: 88 83 st Y, r24 be78: 99 83 std Y+1, r25 ; 0x01 be7a: aa 83 std Y+2, r26 ; 0x02 be7c: bb 83 std Y+3, r27 ; 0x03 be7e: cd 57 subi r28, 0x7D ; 125 be80: 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; be82: a7 01 movw r20, r14 be84: 96 01 movw r18, r12 be86: cb 58 subi r28, 0x8B ; 139 be88: dd 4f sbci r29, 0xFD ; 253 be8a: 68 81 ld r22, Y be8c: 79 81 ldd r23, Y+1 ; 0x01 be8e: 8a 81 ldd r24, Y+2 ; 0x02 be90: 9b 81 ldd r25, Y+3 ; 0x03 be92: c5 57 subi r28, 0x75 ; 117 be94: d2 40 sbci r29, 0x02 ; 2 be96: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> be9a: 6b 01 movw r12, r22 be9c: 7c 01 movw r14, r24 be9e: 20 e0 ldi r18, 0x00 ; 0 bea0: 30 e0 ldi r19, 0x00 ; 0 bea2: 40 e4 ldi r20, 0x40 ; 64 bea4: 50 e4 ldi r21, 0x40 ; 64 bea6: 0f 94 6f e0 call 0x3c0de ; 0x3c0de beaa: cb 57 subi r28, 0x7B ; 123 beac: dd 4f sbci r29, 0xFD ; 253 beae: 68 83 st Y, r22 beb0: 79 83 std Y+1, r23 ; 0x01 beb2: 8a 83 std Y+2, r24 ; 0x02 beb4: 9b 83 std Y+3, r25 ; 0x03 beb6: c5 58 subi r28, 0x85 ; 133 beb8: 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; beba: c3 58 subi r28, 0x83 ; 131 bebc: dd 4f sbci r29, 0xFD ; 253 bebe: 28 81 ld r18, Y bec0: 39 81 ldd r19, Y+1 ; 0x01 bec2: 4a 81 ldd r20, Y+2 ; 0x02 bec4: 5b 81 ldd r21, Y+3 ; 0x03 bec6: cd 57 subi r28, 0x7D ; 125 bec8: d2 40 sbci r29, 0x02 ; 2 beca: c3 59 subi r28, 0x93 ; 147 becc: dd 4f sbci r29, 0xFD ; 253 bece: e8 81 ld r30, Y bed0: f9 81 ldd r31, Y+1 ; 0x01 bed2: cd 56 subi r28, 0x6D ; 109 bed4: d2 40 sbci r29, 0x02 ; 2 bed6: 64 81 ldd r22, Z+4 ; 0x04 bed8: 75 81 ldd r23, Z+5 ; 0x05 beda: 86 81 ldd r24, Z+6 ; 0x06 bedc: 97 81 ldd r25, Z+7 ; 0x07 bede: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> bee2: a3 01 movw r20, r6 bee4: 92 01 movw r18, r4 bee6: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> beea: c7 58 subi r28, 0x87 ; 135 beec: dd 4f sbci r29, 0xFD ; 253 beee: 68 83 st Y, r22 bef0: 79 83 std Y+1, r23 ; 0x01 bef2: 8a 83 std Y+2, r24 ; 0x02 bef4: 9b 83 std Y+3, r25 ; 0x03 bef6: c9 57 subi r28, 0x79 ; 121 bef8: d2 40 sbci r29, 0x02 ; 2 befa: a3 01 movw r20, r6 befc: 92 01 movw r18, r4 befe: c3 01 movw r24, r6 bf00: b2 01 movw r22, r4 bf02: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> bf06: cf 58 subi r28, 0x8F ; 143 bf08: dd 4f sbci r29, 0xFD ; 253 bf0a: 28 81 ld r18, Y bf0c: 39 81 ldd r19, Y+1 ; 0x01 bf0e: 4a 81 ldd r20, Y+2 ; 0x02 bf10: 5b 81 ldd r21, Y+3 ; 0x03 bf12: c1 57 subi r28, 0x71 ; 113 bf14: d2 40 sbci r29, 0x02 ; 2 bf16: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> bf1a: c7 57 subi r28, 0x77 ; 119 bf1c: dd 4f sbci r29, 0xFD ; 253 bf1e: 68 83 st Y, r22 bf20: 79 83 std Y+1, r23 ; 0x01 bf22: 8a 83 std Y+2, r24 ; 0x02 bf24: 9b 83 std Y+3, r25 ; 0x03 bf26: c9 58 subi r28, 0x89 ; 137 bf28: d2 40 sbci r29, 0x02 ; 2 bf2a: a3 01 movw r20, r6 bf2c: 92 01 movw r18, r4 bf2e: c5 01 movw r24, r10 bf30: b4 01 movw r22, r8 bf32: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> bf36: 9b 01 movw r18, r22 bf38: ac 01 movw r20, r24 bf3a: c7 57 subi r28, 0x77 ; 119 bf3c: dd 4f sbci r29, 0xFD ; 253 bf3e: 68 81 ld r22, Y bf40: 79 81 ldd r23, Y+1 ; 0x01 bf42: 8a 81 ldd r24, Y+2 ; 0x02 bf44: 9b 81 ldd r25, Y+3 ; 0x03 bf46: c9 58 subi r28, 0x89 ; 137 bf48: d2 40 sbci r29, 0x02 ; 2 bf4a: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> bf4e: 20 e0 ldi r18, 0x00 ; 0 bf50: 30 e0 ldi r19, 0x00 ; 0 bf52: 40 ec ldi r20, 0xC0 ; 192 bf54: 50 e4 ldi r21, 0x40 ; 64 bf56: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> bf5a: 9b 01 movw r18, r22 bf5c: ac 01 movw r20, r24 bf5e: c7 58 subi r28, 0x87 ; 135 bf60: dd 4f sbci r29, 0xFD ; 253 bf62: 68 81 ld r22, Y bf64: 79 81 ldd r23, Y+1 ; 0x01 bf66: 8a 81 ldd r24, Y+2 ; 0x02 bf68: 9b 81 ldd r25, Y+3 ; 0x03 bf6a: c9 57 subi r28, 0x79 ; 121 bf6c: d2 40 sbci r29, 0x02 ; 2 bf6e: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__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; bf72: a7 01 movw r20, r14 bf74: 96 01 movw r18, r12 bf76: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> bf7a: c7 58 subi r28, 0x87 ; 135 bf7c: dd 4f sbci r29, 0xFD ; 253 bf7e: 68 83 st Y, r22 bf80: 79 83 std Y+1, r23 ; 0x01 bf82: 8a 83 std Y+2, r24 ; 0x02 bf84: 9b 83 std Y+3, r25 ; 0x03 bf86: c9 57 subi r28, 0x79 ; 121 bf88: 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]); bf8a: cf 58 subi r28, 0x8F ; 143 bf8c: dd 4f sbci r29, 0xFD ; 253 bf8e: 28 81 ld r18, Y bf90: 39 81 ldd r19, Y+1 ; 0x01 bf92: 4a 81 ldd r20, Y+2 ; 0x02 bf94: 5b 81 ldd r21, Y+3 ; 0x03 bf96: c1 57 subi r28, 0x71 ; 113 bf98: d2 40 sbci r29, 0x02 ; 2 bf9a: c5 01 movw r24, r10 bf9c: b4 01 movw r22, r8 bf9e: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> bfa2: 4b 01 movw r8, r22 bfa4: 5c 01 movw r10, r24 bfa6: 20 e0 ldi r18, 0x00 ; 0 bfa8: 30 e0 ldi r19, 0x00 ; 0 bfaa: 40 ec ldi r20, 0xC0 ; 192 bfac: 50 e4 ldi r21, 0x40 ; 64 bfae: c3 01 movw r24, r6 bfb0: b2 01 movw r22, r4 bfb2: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> bfb6: 9b 01 movw r18, r22 bfb8: ac 01 movw r20, r24 bfba: c5 01 movw r24, r10 bfbc: b4 01 movw r22, r8 bfbe: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__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; bfc2: cb 57 subi r28, 0x7B ; 123 bfc4: dd 4f sbci r29, 0xFD ; 253 bfc6: 28 81 ld r18, Y bfc8: 39 81 ldd r19, Y+1 ; 0x01 bfca: 4a 81 ldd r20, Y+2 ; 0x02 bfcc: 5b 81 ldd r21, Y+3 ; 0x03 bfce: c5 58 subi r28, 0x85 ; 133 bfd0: d2 40 sbci r29, 0x02 ; 2 bfd2: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> bfd6: 4b 01 movw r8, r22 bfd8: 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; bfda: 20 e0 ldi r18, 0x00 ; 0 bfdc: 30 e0 ldi r19, 0x00 ; 0 bfde: 40 e0 ldi r20, 0x00 ; 0 bfe0: 5f e3 ldi r21, 0x3F ; 63 bfe2: cf 58 subi r28, 0x8F ; 143 bfe4: dd 4f sbci r29, 0xFD ; 253 bfe6: 68 81 ld r22, Y bfe8: 79 81 ldd r23, Y+1 ; 0x01 bfea: 8a 81 ldd r24, Y+2 ; 0x02 bfec: 9b 81 ldd r25, Y+3 ; 0x03 bfee: c1 57 subi r28, 0x71 ; 113 bff0: d2 40 sbci r29, 0x02 ; 2 bff2: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> bff6: 2b 01 movw r4, r22 bff8: 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; bffa: a7 01 movw r20, r14 bffc: 96 01 movw r18, r12 bffe: c7 01 movw r24, r14 c000: b6 01 movw r22, r12 c002: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> c006: 9b 01 movw r18, r22 c008: ac 01 movw r20, r24 c00a: c3 01 movw r24, r6 c00c: b2 01 movw r22, r4 c00e: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> c012: 9b 01 movw r18, r22 c014: ac 01 movw r20, r24 c016: c5 01 movw r24, r10 c018: b4 01 movw r22, r8 c01a: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> c01e: 9b 01 movw r18, r22 c020: ac 01 movw r20, r24 c022: c7 58 subi r28, 0x87 ; 135 c024: dd 4f sbci r29, 0xFD ; 253 c026: 68 81 ld r22, Y c028: 79 81 ldd r23, Y+1 ; 0x01 c02a: 8a 81 ldd r24, Y+2 ; 0x02 c02c: 9b 81 ldd r25, Y+3 ; 0x03 c02e: c9 57 subi r28, 0x79 ; 121 c030: d2 40 sbci r29, 0x02 ; 2 c032: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> c036: c3 58 subi r28, 0x83 ; 131 c038: dd 4f sbci r29, 0xFD ; 253 c03a: 28 81 ld r18, Y c03c: 39 81 ldd r19, Y+1 ; 0x01 c03e: 4a 81 ldd r20, Y+2 ; 0x02 c040: 5b 81 ldd r21, Y+3 ; 0x03 c042: cd 57 subi r28, 0x7D ; 125 c044: d2 40 sbci r29, 0x02 ; 2 c046: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> c04a: 2b 01 movw r4, r22 c04c: 3c 01 movw r6, r24 c04e: 0f 5f subi r16, 0xFF ; 255 c050: 1f 4f sbci r17, 0xFF ; 255 c052: f4 e0 ldi r31, 0x04 ; 4 c054: 2f 0e add r2, r31 c056: 31 1c adc r3, r1 c058: c3 59 subi r28, 0x93 ; 147 c05a: dd 4f sbci r29, 0xFD ; 253 c05c: 28 81 ld r18, Y c05e: 39 81 ldd r19, Y+1 ; 0x01 c060: cd 56 subi r28, 0x6D ; 109 c062: d2 40 sbci r29, 0x02 ; 2 c064: 2c 5f subi r18, 0xFC ; 252 c066: 3f 4f sbci r19, 0xFF ; 255 c068: c3 59 subi r28, 0x93 ; 147 c06a: dd 4f sbci r29, 0xFD ; 253 c06c: 39 83 std Y+1, r19 ; 0x01 c06e: 28 83 st Y, r18 c070: cd 56 subi r28, 0x6D ; 109 c072: 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 c07a: 81 ce rjmp .-766 ; 0xbd7e sum = a*pow((inp_temperature - x[i]), 3) + b*pow((inp_temperature - x[i]), 2) + c*(inp_temperature - x[i]) + d; } return sum; } c07c: c3 01 movw r24, r6 c07e: b2 01 movw r22, r4 c080: c4 57 subi r28, 0x74 ; 116 c082: dd 4f sbci r29, 0xFD ; 253 c084: 0f b6 in r0, 0x3f ; 63 c086: f8 94 cli c088: de bf out 0x3e, r29 ; 62 c08a: 0f be out 0x3f, r0 ; 63 c08c: cd bf out 0x3d, r28 ; 61 c08e: df 91 pop r29 c090: cf 91 pop r28 c092: 1f 91 pop r17 c094: 0f 91 pop r16 c096: ff 90 pop r15 c098: ef 90 pop r14 c09a: df 90 pop r13 c09c: cf 90 pop r12 c09e: bf 90 pop r11 c0a0: af 90 pop r10 c0a2: 9f 90 pop r9 c0a4: 8f 90 pop r8 c0a6: 7f 90 pop r7 c0a8: 6f 90 pop r6 c0aa: 5f 90 pop r5 c0ac: 4f 90 pop r4 c0ae: 3f 90 pop r3 c0b0: 2f 90 pop r2 c0b2: 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)); c0b4: c5 01 movw r24, r10 c0b6: 0f 94 e5 db call 0x3b7ca ; 0x3b7ca c0ba: d8 01 movw r26, r16 c0bc: 8d 93 st X+, r24 c0be: 9c 93 st X, r25 c0c0: b5 e0 ldi r27, 0x05 ; 5 c0c2: cb 0e add r12, r27 c0c4: d1 1c adc r13, r1 c0c6: e2 e0 ldi r30, 0x02 ; 2 c0c8: ae 0e add r10, r30 c0ca: b1 1c adc r11, r1 c0cc: 96 cc rjmp .-1748 ; 0xb9fa 0000c0ce : eFilamentAction = FilamentAction::None; } // Common gcode shared by the gcodes. This saves some flash memory static void gcodes_M704_M705_M706(uint16_t gcode) { c0ce: 0f 93 push r16 c0d0: 1f 93 push r17 c0d2: cf 93 push r28 uint8_t mmuSlotIndex = 0xffU; if (MMU2::mmu2.Enabled() && code_seen('P')) c0d4: 20 91 b9 13 lds r18, 0x13B9 ; 0x8013b9 c0d8: 21 30 cpi r18, 0x01 ; 1 c0da: 79 f5 brne .+94 ; 0xc13a c0dc: 8c 01 movw r16, r24 c0de: 80 e5 ldi r24, 0x50 ; 80 c0e0: 0e 94 ee 5b call 0xb7dc ; 0xb7dc c0e4: 88 23 and r24, r24 c0e6: 49 f1 breq .+82 ; 0xc13a { mmuSlotIndex = code_value_uint8(); c0e8: 0e 94 80 5b call 0xb700 ; 0xb700 c0ec: c8 2f mov r28, r24 if (mmuSlotIndex < MMU_FILAMENT_COUNT) { c0ee: 85 30 cpi r24, 0x05 ; 5 c0f0: 20 f5 brcc .+72 ; 0xc13a switch (gcode) c0f2: 01 3c cpi r16, 0xC1 ; 193 c0f4: 82 e0 ldi r24, 0x02 ; 2 c0f6: 18 07 cpc r17, r24 c0f8: 49 f0 breq .+18 ; 0xc10c c0fa: 02 3c cpi r16, 0xC2 ; 194 c0fc: 12 40 sbci r17, 0x02 ; 2 c0fe: 69 f0 breq .+26 ; 0xc11a { case 704: MMU2::mmu2.load_filament(mmuSlotIndex); c100: 8c 2f mov r24, r28 default: break; } } } } c102: cf 91 pop r28 c104: 1f 91 pop r17 c106: 0f 91 pop r16 mmuSlotIndex = code_value_uint8(); if (mmuSlotIndex < MMU_FILAMENT_COUNT) { switch (gcode) { case 704: MMU2::mmu2.load_filament(mmuSlotIndex); c108: 0d 94 10 ad jmp 0x35a20 ; 0x35a20 break; case 705: MMU2::mmu2.eject_filament(mmuSlotIndex, false); c10c: 60 e0 ldi r22, 0x00 ; 0 c10e: 8c 2f mov r24, r28 default: break; } } } } c110: cf 91 pop r28 c112: 1f 91 pop r17 c114: 0f 91 pop r16 { case 704: MMU2::mmu2.load_filament(mmuSlotIndex); break; case 705: MMU2::mmu2.eject_filament(mmuSlotIndex, false); c116: 0d 94 53 ad jmp 0x35aa6 ; 0x35aa6 break; case 706: #ifdef MMU_HAS_CUTTER if (eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED) != 0){ c11a: 8e ec ldi r24, 0xCE ; 206 c11c: 9e e0 ldi r25, 0x0E ; 14 c11e: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae c122: 88 23 and r24, r24 c124: 51 f0 breq .+20 ; 0xc13a IncrementMMUFails(); } } bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) { if (!WaitForMMUReady()) { c126: 0f 94 3f 88 call 0x3107e ; 0x3107e c12a: 88 23 and r24, r24 c12c: 31 f0 breq .+12 ; 0xc13a c12e: 8c 2f mov r24, r28 default: break; } } } } c130: cf 91 pop r28 c132: 1f 91 pop r17 c134: 0f 91 pop r16 c136: 0d 94 d0 ad jmp 0x35ba0 ; 0x35ba0 c13a: cf 91 pop r28 c13c: 1f 91 pop r17 c13e: 0f 91 pop r16 c140: 08 95 ret 0000c142 : #ifdef TMC2130 void change_power_mode_live(uint8_t mode) { c142: cf 93 push r28 c144: c8 2f mov r28, r24 // Wait for the planner queue to drain and for the stepper timer routine to reach an idle state. st_synchronize(); c146: 0f 94 a3 42 call 0x28546 ; 0x28546 cli(); c14a: f8 94 cli tmc2130_mode = mode; c14c: c0 93 8b 06 sts 0x068B, r28 ; 0x80068b update_mode_profile(); c150: 0f 94 5c 63 call 0x2c6b8 ; 0x2c6b8 return ( eeprom_read_byte((uint8_t *)EEPROM_ECOOL_ENABLE) == EEPROM_ECOOL_MAGIC_NUMBER ) && ( eeprom_read_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY) == 1 ); } bool FarmOrUserECool(){ return farm_mode || UserECoolEnabled(); c154: 0e 94 ac ef call 0x1df58 ; 0x1df58 1 #else 0 #endif ) , enableECool(enableECool) { } c158: 88 0f add r24, r24 tmc2130_init(TMCInitParams(FarmOrUserECool())); c15a: 82 70 andi r24, 0x02 ; 2 c15c: 0f 94 36 26 call 0x24c6c ; 0x24c6c // We may have missed a stepper timer interrupt due to the time spent in the tmc2130_init() routine. // Be safe than sorry, reset the stepper timer before re-enabling interrupts. st_reset_timer(); c160: 0f 94 fd 42 call 0x285fa ; 0x285fa sei(); c164: 78 94 sei } c166: cf 91 pop r28 c168: 08 95 ret 0000c16a : 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);} c16a: 8f 92 push r8 c16c: 9f 92 push r9 c16e: af 92 push r10 c170: bf 92 push r11 c172: cf 92 push r12 c174: df 92 push r13 c176: ef 92 push r14 c178: ff 92 push r15 c17a: 0f 93 push r16 c17c: 1f 93 push r17 c17e: cf 93 push r28 c180: df 93 push r29 c182: 00 91 93 03 lds r16, 0x0393 ; 0x800393 c186: 10 91 94 03 lds r17, 0x0394 ; 0x800394 c18a: 0f 5f subi r16, 0xFF ; 255 c18c: 1f 4f sbci r17, 0xFF ; 255 if (endptr) *endptr = (char*)nptr; do { c = *nptr++; c18e: 68 01 movw r12, r16 c190: 8f ef ldi r24, 0xFF ; 255 c192: c8 1a sub r12, r24 c194: d8 0a sbc r13, r24 c196: d8 01 movw r26, r16 c198: dc 91 ld r29, X } while (isspace(c)); c19a: 8d 2f mov r24, r29 c19c: 90 e0 ldi r25, 0x00 ; 0 c19e: 0f 94 68 d9 call 0x3b2d0 ; 0x3b2d0 c1a2: 7c 01 movw r14, r24 c1a4: 89 2b or r24, r25 c1a6: 01 f5 brne .+64 ; 0xc1e8 flag = 0; if (c == '-') { c1a8: dd 32 cpi r29, 0x2D ; 45 c1aa: 01 f5 brne .+64 ; 0xc1ec flag = FL_MINUS; c = *nptr++; c1ac: 68 01 movw r12, r16 c1ae: b2 e0 ldi r27, 0x02 ; 2 c1b0: cb 0e add r12, r27 c1b2: d1 1c adc r13, r1 c1b4: f8 01 movw r30, r16 c1b6: d1 81 ldd r29, Z+1 ; 0x01 c = *nptr++; } while (isspace(c)); flag = 0; if (c == '-') { flag = FL_MINUS; c1b8: c1 e0 ldi r28, 0x01 ; 1 } else if (c == '+') { c = *nptr++; } if (!strncasecmp_P(nptr - 1, pstr_inf, 3)) { c1ba: 86 01 movw r16, r12 c1bc: 01 50 subi r16, 0x01 ; 1 c1be: 11 09 sbc r17, r1 c1c0: 43 e0 ldi r20, 0x03 ; 3 c1c2: 50 e0 ldi r21, 0x00 ; 0 c1c4: 65 ee ldi r22, 0xE5 ; 229 c1c6: 7b e7 ldi r23, 0x7B ; 123 c1c8: c8 01 movw r24, r16 c1ca: 0f 94 9e d9 call 0x3b33c ; 0x3b33c c1ce: 89 2b or r24, r25 c1d0: c1 f4 brne .+48 ; 0xc202 nptr += 2; if (!strncasecmp_P(nptr, pstr_inity, 5)) nptr += 5; if (endptr) *endptr = (char*)nptr; return flag & FL_MINUS ? -INFINITY : +INFINITY; c1d2: 60 e0 ldi r22, 0x00 ; 0 c1d4: 70 e0 ldi r23, 0x00 ; 0 c1d6: 80 e8 ldi r24, 0x80 ; 128 c1d8: 9f ef ldi r25, 0xFF ; 255 c1da: c1 11 cpse r28, r1 c1dc: db c0 rjmp .+438 ; 0xc394 c1de: 60 e0 ldi r22, 0x00 ; 0 c1e0: 70 e0 ldi r23, 0x00 ; 0 c1e2: 80 e8 ldi r24, 0x80 ; 128 c1e4: 9f e7 ldi r25, 0x7F ; 127 c1e6: d6 c0 rjmp .+428 ; 0xc394 if (endptr) *endptr = (char*)nptr; do { c = *nptr++; c1e8: 86 01 movw r16, r12 c1ea: d1 cf rjmp .-94 ; 0xc18e flag = 0; if (c == '-') { flag = FL_MINUS; c = *nptr++; } else if (c == '+') { c1ec: db 32 cpi r29, 0x2B ; 43 c1ee: 39 f4 brne .+14 ; 0xc1fe c = *nptr++; c1f0: 68 01 movw r12, r16 c1f2: f2 e0 ldi r31, 0x02 ; 2 c1f4: cf 0e add r12, r31 c1f6: d1 1c adc r13, r1 c1f8: d8 01 movw r26, r16 c1fa: 11 96 adiw r26, 0x01 ; 1 c1fc: dc 91 ld r29, X do { c = *nptr++; } while (isspace(c)); flag = 0; c1fe: c0 e0 ldi r28, 0x00 ; 0 c200: dc cf rjmp .-72 ; 0xc1ba 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)) { c202: 43 e0 ldi r20, 0x03 ; 3 c204: 50 e0 ldi r21, 0x00 ; 0 c206: 62 ee ldi r22, 0xE2 ; 226 c208: 7b e7 ldi r23, 0x7B ; 123 c20a: c8 01 movw r24, r16 c20c: 0f 94 9e d9 call 0x3b33c ; 0x3b33c c210: 89 2b or r24, r25 c212: 09 f4 brne .+2 ; 0xc216 c214: cc c0 rjmp .+408 ; 0xc3ae c216: f6 01 movw r30, r12 *endptr = (char*)nptr + 2; return NAN; } x.u32 = 0; exp = 0; c218: 10 e0 ldi r17, 0x00 ; 0 c21a: 00 e0 ldi r16, 0x00 ; 0 if (endptr) *endptr = (char*)nptr + 2; return NAN; } x.u32 = 0; c21c: 20 e0 ldi r18, 0x00 ; 0 c21e: 30 e0 ldi r19, 0x00 ; 0 c220: a9 01 movw r20, r18 c222: 6f 01 movw r12, r30 exp = 0; while (1) { c -= '0'; c224: d0 53 subi r29, 0x30 ; 48 if (c <= 9) { c226: da 30 cpi r29, 0x0A ; 10 c228: 60 f5 brcc .+88 ; 0xc282 flag |= FL_ANY; c22a: bc 2e mov r11, r28 c22c: 68 94 set c22e: b1 f8 bld r11, 1 c230: 8c 2f mov r24, r28 c232: 88 70 andi r24, 0x08 ; 8 if (flag & FL_OVFL) { c234: c2 ff sbrs r28, 2 c236: 09 c0 rjmp .+18 ; 0xc24a if (!(flag & FL_DOT)) c238: 81 11 cpse r24, r1 c23a: 02 c0 rjmp .+4 ; 0xc240 exp += 1; c23c: 0f 5f subi r16, 0xFF ; 255 c23e: 1f 4f sbci r17, 0xFF ; 255 c240: 31 96 adiw r30, 0x01 ; 1 flag |= FL_DOT; } else { break; } c = *nptr++; c242: d6 01 movw r26, r12 c244: dc 91 ld r29, X c246: cb 2d mov r28, r11 c248: ec cf rjmp .-40 ; 0xc222 if (flag & FL_OVFL) { if (!(flag & FL_DOT)) exp += 1; } else { if (flag & FL_DOT) c24a: 88 23 and r24, r24 c24c: 11 f0 breq .+4 ; 0xc252 exp -= 1; c24e: 01 50 subi r16, 0x01 ; 1 c250: 11 09 sbc r17, r1 /* x.u32 = x.u32 * 10 + c */ x.u32 = (((x.u32 << 2) + x.u32) << 1) + c; c252: a5 e0 ldi r26, 0x05 ; 5 c254: b0 e0 ldi r27, 0x00 ; 0 c256: 0f 94 6c dc call 0x3b8d8 ; 0x3b8d8 <__muluhisi3> c25a: 9b 01 movw r18, r22 c25c: ac 01 movw r20, r24 c25e: 22 0f add r18, r18 c260: 33 1f adc r19, r19 c262: 44 1f adc r20, r20 c264: 55 1f adc r21, r21 c266: 2d 0f add r18, r29 c268: 31 1d adc r19, r1 c26a: 41 1d adc r20, r1 c26c: 51 1d adc r21, r1 if (x.u32 >= (ULONG_MAX - 9) / 10) c26e: 28 39 cpi r18, 0x98 ; 152 c270: b9 e9 ldi r27, 0x99 ; 153 c272: 3b 07 cpc r19, r27 c274: 4b 07 cpc r20, r27 c276: b9 e1 ldi r27, 0x19 ; 25 c278: 5b 07 cpc r21, r27 c27a: 10 f3 brcs .-60 ; 0xc240 flag |= FL_OVFL; c27c: c6 60 ori r28, 0x06 ; 6 c27e: bc 2e mov r11, r28 c280: df cf rjmp .-66 ; 0xc240 } } else if (c == (('.' - '0') & 0xff) && !(flag & FL_DOT)) { c282: de 3f cpi r29, 0xFE ; 254 c284: 31 f4 brne .+12 ; 0xc292 c286: c3 fd sbrc r28, 3 c288: 33 c0 rjmp .+102 ; 0xc2f0 flag |= FL_DOT; c28a: bc 2e mov r11, r28 c28c: 68 94 set c28e: b3 f8 bld r11, 3 c290: d7 cf rjmp .-82 ; 0xc240 } c = *nptr++; } // Check for exponent "E", but disable capital E if (c == (('e' - '0') & 0xff) /*|| c == (('E' - '0') & 0xff)*/) c292: d5 33 cpi r29, 0x35 ; 53 c294: 69 f5 brne .+90 ; 0xc2f0 { int i; c = *nptr++; c296: 80 81 ld r24, Z i = 2; if (c == '-') { c298: 8d 32 cpi r24, 0x2D ; 45 c29a: 31 f4 brne .+12 ; 0xc2a8 flag |= FL_MEXP; c29c: c0 61 ori r28, 0x10 ; 16 c = *nptr++; c29e: bf 01 movw r22, r30 } else if (c == '+') { c = *nptr++; c2a0: 6e 5f subi r22, 0xFE ; 254 c2a2: 7f 4f sbci r23, 0xFF ; 255 c2a4: 81 81 ldd r24, Z+1 ; 0x01 c2a6: 05 c0 rjmp .+10 ; 0xc2b2 c2a8: bf 01 movw r22, r30 i = 2; if (c == '-') { flag |= FL_MEXP; c = *nptr++; } else if (c == '+') { c2aa: 8b 32 cpi r24, 0x2B ; 43 c2ac: c9 f3 breq .-14 ; 0xc2a0 // Check for exponent "E", but disable capital E if (c == (('e' - '0') & 0xff) /*|| c == (('E' - '0') & 0xff)*/) { int i; c = *nptr++; c2ae: 6f 5f subi r22, 0xFF ; 255 c2b0: 7f 4f sbci r23, 0xFF ; 255 c = *nptr++; } else { i = 1; } c -= '0'; c2b2: 80 53 subi r24, 0x30 ; 48 if (c > 9) { c2b4: 8a 30 cpi r24, 0x0A ; 10 c2b6: e0 f4 brcc .+56 ; 0xc2f0 c2b8: fb 01 movw r30, r22 nptr -= i; } else { i = 0; do { if (i < 3200) c2ba: b0 e8 ldi r27, 0x80 ; 128 c2bc: eb 16 cp r14, r27 c2be: bc e0 ldi r27, 0x0C ; 12 c2c0: fb 06 cpc r15, r27 c2c2: 5c f4 brge .+22 ; 0xc2da i = (((i << 2) + i) << 1) + c; /* i = 10*i + c */ c2c4: b7 01 movw r22, r14 c2c6: 66 0f add r22, r22 c2c8: 77 1f adc r23, r23 c2ca: 66 0f add r22, r22 c2cc: 77 1f adc r23, r23 c2ce: e6 0e add r14, r22 c2d0: f7 1e adc r15, r23 c2d2: ee 0c add r14, r14 c2d4: ff 1c adc r15, r15 c2d6: e8 0e add r14, r24 c2d8: f1 1c adc r15, r1 c = *nptr++ - '0'; c2da: 81 91 ld r24, Z+ c2dc: 80 53 subi r24, 0x30 ; 48 } while (c <= 9); c2de: 8a 30 cpi r24, 0x0A ; 10 c2e0: 60 f3 brcs .-40 ; 0xc2ba if (flag & FL_MEXP) c2e2: c4 ff sbrs r28, 4 c2e4: 03 c0 rjmp .+6 ; 0xc2ec i = -i; c2e6: f1 94 neg r15 c2e8: e1 94 neg r14 c2ea: f1 08 sbc r15, r1 exp += i; c2ec: 0e 0d add r16, r14 c2ee: 1f 1d adc r17, r15 } if ((flag & FL_ANY) && endptr) *endptr = (char*)nptr - 1; x.flt = __floatunsisf(x.u32); /* manually */ c2f0: ca 01 movw r24, r20 c2f2: b9 01 movw r22, r18 c2f4: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> if ((flag & FL_MINUS) && (flag & FL_ANY)) c2f8: c3 70 andi r28, 0x03 ; 3 c2fa: c3 30 cpi r28, 0x03 ; 3 c2fc: 09 f4 brne .+2 ; 0xc300 x.flt = -x.flt; c2fe: 90 58 subi r25, 0x80 ; 128 c300: 4b 01 movw r8, r22 c302: 5c 01 movw r10, r24 if (x.flt != 0) { c304: 20 e0 ldi r18, 0x00 ; 0 c306: 30 e0 ldi r19, 0x00 ; 0 c308: a9 01 movw r20, r18 c30a: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> c30e: 88 23 and r24, r24 c310: 09 f4 brne .+2 ; 0xc314 c312: 3e c0 rjmp .+124 ; 0xc390 if (exp < 0) { nptr = (void*)(pwr_m10 + 5); exp = -exp; } else { nptr = (void*)(pwr_p10 + 5); c314: ce ed ldi r28, 0xDE ; 222 c316: db e7 ldi r29, 0x7B ; 123 if ((flag & FL_MINUS) && (flag & FL_ANY)) x.flt = -x.flt; if (x.flt != 0) { int pwr; if (exp < 0) { c318: 17 ff sbrs r17, 7 c31a: 05 c0 rjmp .+10 ; 0xc326 nptr = (void*)(pwr_m10 + 5); exp = -exp; c31c: 11 95 neg r17 c31e: 01 95 neg r16 c320: 11 09 sbc r17, r1 x.flt = -x.flt; if (x.flt != 0) { int pwr; if (exp < 0) { nptr = (void*)(pwr_m10 + 5); c322: c6 ec ldi r28, 0xC6 ; 198 c324: db e7 ldi r29, 0x7B ; 123 c326: 6e 01 movw r12, r28 c328: e8 e1 ldi r30, 0x18 ; 24 c32a: ce 1a sub r12, r30 c32c: d1 08 sbc r13, r1 exp = -exp; } else { nptr = (void*)(pwr_p10 + 5); c32e: 80 e2 ldi r24, 0x20 ; 32 c330: e8 2e mov r14, r24 c332: f1 2c mov r15, r1 c334: 0d c0 rjmp .+26 ; 0xc350 for (; exp >= pwr; exp -= pwr) { union { unsigned long u32; float flt; } y; y.u32 = pgm_read_dword((float*)nptr); c336: fe 01 movw r30, r28 c338: 25 91 lpm r18, Z+ c33a: 35 91 lpm r19, Z+ c33c: 45 91 lpm r20, Z+ c33e: 54 91 lpm r21, Z } else { nptr = (void*)(pwr_p10 + 5); } for (pwr = 32; pwr; pwr >>= 1) { for (; exp >= pwr; exp -= pwr) { c340: 0e 19 sub r16, r14 c342: 1f 09 sbc r17, r15 union { unsigned long u32; float flt; } y; y.u32 = pgm_read_dword((float*)nptr); x.flt *= y.flt; c344: c5 01 movw r24, r10 c346: b4 01 movw r22, r8 c348: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> c34c: 4b 01 movw r8, r22 c34e: 5c 01 movw r10, r24 c350: d5 01 movw r26, r10 c352: c4 01 movw r24, r8 } else { nptr = (void*)(pwr_p10 + 5); } for (pwr = 32; pwr; pwr >>= 1) { for (; exp >= pwr; exp -= pwr) { c354: 0e 15 cp r16, r14 c356: 1f 05 cpc r17, r15 c358: 74 f7 brge .-36 ; 0xc336 float flt; } y; y.u32 = pgm_read_dword((float*)nptr); x.flt *= y.flt; } nptr -= sizeof(float); c35a: 24 97 sbiw r28, 0x04 ; 4 exp = -exp; } else { nptr = (void*)(pwr_p10 + 5); } for (pwr = 32; pwr; pwr >>= 1) { c35c: f5 94 asr r15 c35e: e7 94 ror r14 c360: cc 16 cp r12, r28 c362: dd 06 cpc r13, r29 c364: a9 f7 brne .-22 ; 0xc350 not plus or minus infinity, and not NaN. */ __ATTR_CONST__ static inline int isfinite (double __x) { unsigned char __exp; __asm__ ( c366: 8a 2f mov r24, r26 c368: 88 0f add r24, r24 c36a: 8b 2f mov r24, r27 c36c: 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) c36e: 8f 3f cpi r24, 0xFF ; 255 c370: 49 f0 breq .+18 ; 0xc384 c372: 20 e0 ldi r18, 0x00 ; 0 c374: 30 e0 ldi r19, 0x00 ; 0 c376: a9 01 movw r20, r18 c378: c5 01 movw r24, r10 c37a: b4 01 movw r22, r8 c37c: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> c380: 81 11 cpse r24, r1 c382: 06 c0 rjmp .+12 ; 0xc390 errno = ERANGE; c384: 82 e2 ldi r24, 0x22 ; 34 c386: 90 e0 ldi r25, 0x00 ; 0 c388: 90 93 14 18 sts 0x1814, r25 ; 0x801814 c38c: 80 93 13 18 sts 0x1813, r24 ; 0x801813 } return x.flt; c390: c5 01 movw r24, r10 c392: b4 01 movw r22, r8 c394: df 91 pop r29 c396: cf 91 pop r28 c398: 1f 91 pop r17 c39a: 0f 91 pop r16 c39c: ff 90 pop r15 c39e: ef 90 pop r14 c3a0: df 90 pop r13 c3a2: cf 90 pop r12 c3a4: bf 90 pop r11 c3a6: af 90 pop r10 c3a8: 9f 90 pop r9 c3aa: 8f 90 pop r8 c3ac: 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; c3ae: 60 e0 ldi r22, 0x00 ; 0 c3b0: 70 e0 ldi r23, 0x00 ; 0 c3b2: 80 ec ldi r24, 0xC0 ; 192 c3b4: 9f e7 ldi r25, 0x7F ; 127 c3b6: ee cf rjmp .-36 ; 0xc394 0000c3b8 : } } } #endif //MOTHERBOARD == BOARD_RAMBO_MINI_1_0 || MOTHERBOARD == BOARD_RAMBO_MINI_1_3 void get_coordinates() { c3b8: 2f 92 push r2 c3ba: 3f 92 push r3 c3bc: 4f 92 push r4 c3be: 5f 92 push r5 c3c0: 6f 92 push r6 c3c2: 7f 92 push r7 c3c4: 8f 92 push r8 c3c6: 9f 92 push r9 c3c8: af 92 push r10 c3ca: bf 92 push r11 c3cc: cf 92 push r12 c3ce: df 92 push r13 c3d0: ef 92 push r14 c3d2: ff 92 push r15 c3d4: 0f 93 push r16 c3d6: 1f 93 push r17 c3d8: cf 93 push r28 c3da: df 93 push r29 c3dc: 00 d0 rcall .+0 ; 0xc3de c3de: cd b7 in r28, 0x3d ; 61 c3e0: de b7 in r29, 0x3e ; 62 c3e2: 8d ed ldi r24, 0xDD ; 221 c3e4: c8 2e mov r12, r24 c3e6: 82 e0 ldi r24, 0x02 ; 2 c3e8: d8 2e mov r13, r24 c3ea: 83 e7 ldi r24, 0x73 ; 115 c3ec: 96 e0 ldi r25, 0x06 ; 6 c3ee: 9b 83 std Y+3, r25 ; 0x03 c3f0: 8a 83 std Y+2, r24 ; 0x02 c3f2: 91 e9 ldi r25, 0x91 ; 145 c3f4: e9 2e mov r14, r25 c3f6: 96 e0 ldi r25, 0x06 ; 6 c3f8: f9 2e mov r15, r25 for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i < NUM_AXIS; i++, mask <<= 1) { c3fa: 33 24 eor r3, r3 c3fc: 33 94 inc r3 c3fe: 00 e0 ldi r16, 0x00 ; 0 if(code_seen(axis_codes[i])) c400: f6 01 movw r30, r12 c402: 81 91 ld r24, Z+ c404: 6f 01 movw r12, r30 c406: 0e 94 ee 5b call 0xb7dc ; 0xb7dc c40a: 28 2e mov r2, r24 c40c: 88 23 and r24, r24 c40e: 09 f4 brne .+2 ; 0xc412 c410: a6 c0 rjmp .+332 ; 0xc55e { bool relative = axis_relative_modes & mask; c412: 10 91 e3 03 lds r17, 0x03E3 ; 0x8003e3 c416: 13 21 and r17, r3 destination[i] = code_value(); c418: 0e 94 b5 60 call 0xc16a ; 0xc16a c41c: 2b 01 movw r4, r22 c41e: 3c 01 movw r6, r24 c420: ea 81 ldd r30, Y+2 ; 0x02 c422: fb 81 ldd r31, Y+3 ; 0x03 c424: 40 82 st Z, r4 c426: 51 82 std Z+1, r5 ; 0x01 c428: 62 82 std Z+2, r6 ; 0x02 c42a: 73 82 std Z+3, r7 ; 0x03 if (i == E_AXIS) { c42c: 03 30 cpi r16, 0x03 ; 3 c42e: 09 f0 breq .+2 ; 0xc432 c430: 46 c0 rjmp .+140 ; 0xc4be 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; c432: f1 e0 ldi r31, 0x01 ; 1 c434: f9 83 std Y+1, r31 ; 0x01 c436: 11 11 cpse r17, r1 c438: 01 c0 rjmp .+2 ; 0xc43c c43a: 19 82 std Y+1, r1 ; 0x01 destination[i] = code_value(); if (i == E_AXIS) { float emult = extruder_multiplier[active_extruder]; c43c: 80 90 93 02 lds r8, 0x0293 ; 0x800293 c440: 90 90 94 02 lds r9, 0x0294 ; 0x800294 c444: a0 90 95 02 lds r10, 0x0295 ; 0x800295 c448: b0 90 96 02 lds r11, 0x0296 ; 0x800296 if (emult != 1.) { c44c: 20 e0 ldi r18, 0x00 ; 0 c44e: 30 e0 ldi r19, 0x00 ; 0 c450: 40 e8 ldi r20, 0x80 ; 128 c452: 5f e3 ldi r21, 0x3F ; 63 c454: c5 01 movw r24, r10 c456: b4 01 movw r22, r8 c458: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> c45c: 88 23 and r24, r24 c45e: 59 f1 breq .+86 ; 0xc4b6 if (! relative) { c460: 11 11 cpse r17, r1 c462: 15 c0 rjmp .+42 ; 0xc48e destination[i] -= current_position[i]; c464: 20 91 9d 06 lds r18, 0x069D ; 0x80069d c468: 30 91 9e 06 lds r19, 0x069E ; 0x80069e c46c: 40 91 9f 06 lds r20, 0x069F ; 0x80069f c470: 50 91 a0 06 lds r21, 0x06A0 ; 0x8006a0 c474: c3 01 movw r24, r6 c476: b2 01 movw r22, r4 c478: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> c47c: 60 93 7f 06 sts 0x067F, r22 ; 0x80067f c480: 70 93 80 06 sts 0x0680, r23 ; 0x800680 c484: 80 93 81 06 sts 0x0681, r24 ; 0x800681 c488: 90 93 82 06 sts 0x0682, r25 ; 0x800682 relative = true; c48c: 29 82 std Y+1, r2 ; 0x01 } destination[i] *= emult; c48e: a5 01 movw r20, r10 c490: 94 01 movw r18, r8 c492: 60 91 7f 06 lds r22, 0x067F ; 0x80067f c496: 70 91 80 06 lds r23, 0x0680 ; 0x800680 c49a: 80 91 81 06 lds r24, 0x0681 ; 0x800681 c49e: 90 91 82 06 lds r25, 0x0682 ; 0x800682 c4a2: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> c4a6: 60 93 7f 06 sts 0x067F, r22 ; 0x80067f c4aa: 70 93 80 06 sts 0x0680, r23 ; 0x800680 c4ae: 80 93 81 06 sts 0x0681, r24 ; 0x800681 c4b2: 90 93 82 06 sts 0x0682, r25 ; 0x800682 } } if (relative) c4b6: e9 81 ldd r30, Y+1 ; 0x01 c4b8: e1 11 cpse r30, r1 c4ba: 03 c0 rjmp .+6 ; 0xc4c2 c4bc: 22 c0 rjmp .+68 ; 0xc502 c4be: 11 23 and r17, r17 c4c0: 99 f0 breq .+38 ; 0xc4e8 destination[i] += current_position[i]; c4c2: f7 01 movw r30, r14 c4c4: 20 81 ld r18, Z c4c6: 31 81 ldd r19, Z+1 ; 0x01 c4c8: 42 81 ldd r20, Z+2 ; 0x02 c4ca: 53 81 ldd r21, Z+3 ; 0x03 c4cc: ea 81 ldd r30, Y+2 ; 0x02 c4ce: fb 81 ldd r31, Y+3 ; 0x03 c4d0: 60 81 ld r22, Z c4d2: 71 81 ldd r23, Z+1 ; 0x01 c4d4: 82 81 ldd r24, Z+2 ; 0x02 c4d6: 93 81 ldd r25, Z+3 ; 0x03 c4d8: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> c4dc: ea 81 ldd r30, Y+2 ; 0x02 c4de: fb 81 ldd r31, Y+3 ; 0x03 c4e0: 60 83 st Z, r22 c4e2: 71 83 std Z+1, r23 ; 0x01 c4e4: 82 83 std Z+2, r24 ; 0x02 c4e6: 93 83 std Z+3, r25 ; 0x03 } } #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) { c4e8: 0f 5f subi r16, 0xFF ; 255 c4ea: 33 0c add r3, r3 c4ec: 8a 81 ldd r24, Y+2 ; 0x02 c4ee: 9b 81 ldd r25, Y+3 ; 0x03 c4f0: 04 96 adiw r24, 0x04 ; 4 c4f2: 9b 83 std Y+3, r25 ; 0x03 c4f4: 8a 83 std Y+2, r24 ; 0x02 c4f6: 94 e0 ldi r25, 0x04 ; 4 c4f8: e9 0e add r14, r25 c4fa: f1 1c adc r15, r1 c4fc: 04 30 cpi r16, 0x04 ; 4 c4fe: 09 f0 breq .+2 ; 0xc502 c500: 7f cf rjmp .-258 ; 0xc400 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')) { c502: 86 e4 ldi r24, 0x46 ; 70 c504: 0e 94 ee 5b call 0xb7dc ; 0xb7dc c508: 88 23 and r24, r24 c50a: 99 f0 breq .+38 ; 0xc532 const float next_feedrate = code_value(); c50c: 0e 94 b5 60 call 0xc16a ; 0xc16a c510: 6b 01 movw r12, r22 c512: 7c 01 movw r14, r24 if(next_feedrate > 0.f) feedrate = next_feedrate; c514: 20 e0 ldi r18, 0x00 ; 0 c516: 30 e0 ldi r19, 0x00 ; 0 c518: a9 01 movw r20, r18 c51a: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> c51e: 18 16 cp r1, r24 c520: 44 f4 brge .+16 ; 0xc532 c522: c0 92 b8 02 sts 0x02B8, r12 ; 0x8002b8 c526: d0 92 b9 02 sts 0x02B9, r13 ; 0x8002b9 c52a: e0 92 ba 02 sts 0x02BA, r14 ; 0x8002ba c52e: f0 92 bb 02 sts 0x02BB, r15 ; 0x8002bb } } c532: 0f 90 pop r0 c534: 0f 90 pop r0 c536: 0f 90 pop r0 c538: df 91 pop r29 c53a: cf 91 pop r28 c53c: 1f 91 pop r17 c53e: 0f 91 pop r16 c540: ff 90 pop r15 c542: ef 90 pop r14 c544: df 90 pop r13 c546: cf 90 pop r12 c548: bf 90 pop r11 c54a: af 90 pop r10 c54c: 9f 90 pop r9 c54e: 8f 90 pop r8 c550: 7f 90 pop r7 c552: 6f 90 pop r6 c554: 5f 90 pop r5 c556: 4f 90 pop r4 c558: 3f 90 pop r3 c55a: 2f 90 pop r2 c55c: 08 95 ret 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? c55e: f7 01 movw r30, r14 c560: 80 81 ld r24, Z c562: 91 81 ldd r25, Z+1 ; 0x01 c564: a2 81 ldd r26, Z+2 ; 0x02 c566: b3 81 ldd r27, Z+3 ; 0x03 c568: ea 81 ldd r30, Y+2 ; 0x02 c56a: fb 81 ldd r31, Y+3 ; 0x03 c56c: 80 83 st Z, r24 c56e: 91 83 std Z+1, r25 ; 0x01 c570: a2 83 std Z+2, r26 ; 0x02 c572: b3 83 std Z+3, r27 ; 0x03 c574: b9 cf rjmp .-142 ; 0xc4e8 0000c576 : } } void dcode_core(daddr_t addr_start, const daddr_t addr_end, const dcode_mem_t type, uint8_t dcode, const char* type_desc) { c576: 2f 92 push r2 c578: 3f 92 push r3 c57a: 4f 92 push r4 c57c: 5f 92 push r5 c57e: 6f 92 push r6 c580: 7f 92 push r7 c582: 8f 92 push r8 c584: 9f 92 push r9 c586: af 92 push r10 c588: bf 92 push r11 c58a: cf 92 push r12 c58c: df 92 push r13 c58e: ef 92 push r14 c590: ff 92 push r15 c592: 0f 93 push r16 c594: 1f 93 push r17 c596: cf 93 push r28 c598: df 93 push r29 c59a: cd b7 in r28, 0x3d ; 61 c59c: de b7 in r29, 0x3e ; 62 c59e: 65 97 sbiw r28, 0x15 ; 21 c5a0: 0f b6 in r0, 0x3f ; 63 c5a2: f8 94 cli c5a4: de bf out 0x3e, r29 ; 62 c5a6: 0f be out 0x3f, r0 ; 63 c5a8: cd bf out 0x3d, r28 ; 61 c5aa: 69 8b std Y+17, r22 ; 0x11 c5ac: 7a 8b std Y+18, r23 ; 0x12 c5ae: 8b 8b std Y+19, r24 ; 0x13 c5b0: 9c 8b std Y+20, r25 ; 0x14 c5b2: 49 01 movw r8, r18 c5b4: 5a 01 movw r10, r20 c5b6: 30 2e mov r3, r16 c5b8: cd 8a std Y+21, r12 ; 0x15 c5ba: 2d 2c mov r2, r13 KEEPALIVE_STATE(NOT_BUSY); c5bc: 81 e0 ldi r24, 0x01 ; 1 c5be: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be DBG(_N("D%d - Read/Write %S\n"), dcode, type_desc); c5c2: df 92 push r13 c5c4: 2d 89 ldd r18, Y+21 ; 0x15 c5c6: 2f 93 push r18 c5c8: 1f 92 push r1 c5ca: ef 92 push r14 c5cc: 83 ee ldi r24, 0xE3 ; 227 c5ce: 95 e6 ldi r25, 0x65 ; 101 c5d0: 9f 93 push r25 c5d2: 8f 93 push r24 c5d4: 0f 94 99 da call 0x3b532 ; 0x3b532 daddr_t count = -1; // RW the entire space by default if (code_seen('A')) c5d8: 81 e4 ldi r24, 0x41 ; 65 c5da: 0e 94 ee 5b call 0xb7dc ; 0xb7dc c5de: 0f 90 pop r0 c5e0: 0f 90 pop r0 c5e2: 0f 90 pop r0 c5e4: 0f 90 pop r0 c5e6: 0f 90 pop r0 c5e8: 0f 90 pop r0 c5ea: 88 23 and r24, r24 c5ec: a1 f0 breq .+40 ; 0xc616 addr_start = (strchr_pointer[1] == 'x')?strtol(strchr_pointer + 2, 0, 16):(int)code_value(); c5ee: 80 91 93 03 lds r24, 0x0393 ; 0x800393 c5f2: 90 91 94 03 lds r25, 0x0394 ; 0x800394 c5f6: fc 01 movw r30, r24 c5f8: 21 81 ldd r18, Z+1 ; 0x01 c5fa: 28 37 cpi r18, 0x78 ; 120 c5fc: 09 f0 breq .+2 ; 0xc600 c5fe: 69 c0 rjmp .+210 ; 0xc6d2 c600: 40 e1 ldi r20, 0x10 ; 16 c602: 50 e0 ldi r21, 0x00 ; 0 c604: 70 e0 ldi r23, 0x00 ; 0 c606: 60 e0 ldi r22, 0x00 ; 0 c608: 02 96 adiw r24, 0x02 ; 2 c60a: 0f 94 62 d7 call 0x3aec4 ; 0x3aec4 c60e: 69 8b std Y+17, r22 ; 0x11 c610: 7a 8b std Y+18, r23 ; 0x12 c612: 8b 8b std Y+19, r24 ; 0x13 c614: 9c 8b std Y+20, r25 ; 0x14 if (code_seen('C')) c616: 83 e4 ldi r24, 0x43 ; 67 c618: 0e 94 ee 5b call 0xb7dc ; 0xb7dc c61c: 88 23 and r24, r24 c61e: 09 f4 brne .+2 ; 0xc622 c620: 65 c0 rjmp .+202 ; 0xc6ec count = code_value_long(); c622: 0e 94 9a 5b call 0xb734 ; 0xb734 c626: 2b 01 movw r4, r22 c628: 3c 01 movw r6, r24 c62a: c9 88 ldd r12, Y+17 ; 0x11 c62c: da 88 ldd r13, Y+18 ; 0x12 c62e: eb 88 ldd r14, Y+19 ; 0x13 c630: fc 88 ldd r15, Y+20 ; 0x14 c632: 8c 14 cp r8, r12 c634: 9d 04 cpc r9, r13 c636: ae 04 cpc r10, r14 c638: bf 04 cpc r11, r15 c63a: 10 f4 brcc .+4 ; 0xc640 c63c: 75 01 movw r14, r10 c63e: 64 01 movw r12, r8 if (addr_start > addr_end) addr_start = addr_end; if ((addr_start + count) > addr_end || (addr_start + count) < addr_start) c640: d3 01 movw r26, r6 c642: c2 01 movw r24, r4 c644: 8c 0d add r24, r12 c646: 9d 1d adc r25, r13 c648: ae 1d adc r26, r14 c64a: bf 1d adc r27, r15 c64c: 88 16 cp r8, r24 c64e: 99 06 cpc r9, r25 c650: aa 06 cpc r10, r26 c652: bb 06 cpc r11, r27 c654: 28 f0 brcs .+10 ; 0xc660 c656: 8c 15 cp r24, r12 c658: 9d 05 cpc r25, r13 c65a: ae 05 cpc r26, r14 c65c: bf 05 cpc r27, r15 c65e: 30 f4 brcc .+12 ; 0xc66c count = addr_end - addr_start; c660: 24 01 movw r4, r8 c662: 35 01 movw r6, r10 c664: 4c 18 sub r4, r12 c666: 5d 08 sbc r5, r13 c668: 6e 08 sbc r6, r14 c66a: 7f 08 sbc r7, r15 if (code_seen('X')) c66c: 88 e5 ldi r24, 0x58 ; 88 c66e: 0e 94 ee 5b call 0xb7dc ; 0xb7dc c672: 88 23 and r24, r24 c674: 09 f4 brne .+2 ; 0xc678 c676: 91 c0 rjmp .+290 ; 0xc79a { uint8_t data[16]; count = parse_hex(strchr_pointer + 1, data, 16); c678: 20 91 93 03 lds r18, 0x0393 ; 0x800393 c67c: 30 91 94 03 lds r19, 0x0394 ; 0x800394 c680: 2f 5f subi r18, 0xFF ; 255 c682: 3f 4f sbci r19, 0xFF ; 255 c684: fe 01 movw r30, r28 c686: 31 96 adiw r30, 0x01 ; 1 print_hex_byte(val & 0xFF); } int parse_hex(const char* hex, uint8_t* data, int count) { int parsed = 0; c688: 10 e0 ldi r17, 0x00 ; 0 c68a: 00 e0 ldi r16, 0x00 ; 0 c68c: 4f 01 movw r8, r30 c68e: d9 01 movw r26, r18 while (*hex) c690: 8c 91 ld r24, X c692: 2f 5f subi r18, 0xFF ; 255 c694: 3f 4f sbci r19, 0xFF ; 255 c696: 88 23 and r24, r24 c698: 09 f4 brne .+2 ; 0xc69c c69a: 3f c0 rjmp .+126 ; 0xc71a { if (count && (parsed >= count)) break; c69c: 00 31 cpi r16, 0x10 ; 16 c69e: 11 05 cpc r17, r1 c6a0: e1 f1 breq .+120 ; 0xc71a char c = *(hex++); if (c == ' ') continue; c6a2: 80 32 cpi r24, 0x20 ; 32 c6a4: a1 f3 breq .-24 ; 0xc68e if (c == '\n') break; c6a6: 8a 30 cpi r24, 0x0A ; 10 c6a8: c1 f1 breq .+112 ; 0xc71a uint8_t val = 0x00; if ((c >= '0') && (c <= '9')) val |= ((c - '0') << 4); c6aa: 90 ed ldi r25, 0xD0 ; 208 c6ac: 98 0f add r25, r24 c6ae: 9a 30 cpi r25, 0x0A ; 10 c6b0: 10 f5 brcc .+68 ; 0xc6f6 c6b2: 82 95 swap r24 c6b4: 80 7f andi r24, 0xF0 ; 240 else if ((c >= 'a') && (c <= 'f')) val |= ((c - 'a' + 10) << 4); else return -parsed; c = *(hex++); c6b6: 9d 01 movw r18, r26 c6b8: 2e 5f subi r18, 0xFE ; 254 c6ba: 3f 4f sbci r19, 0xFF ; 255 if ((c >= '0') && (c <= '9')) val |= (c - '0'); c6bc: 11 96 adiw r26, 0x01 ; 1 c6be: 9c 91 ld r25, X c6c0: 40 ed ldi r20, 0xD0 ; 208 c6c2: 49 0f add r20, r25 c6c4: 4a 30 cpi r20, 0x0A ; 10 c6c6: f8 f4 brcc .+62 ; 0xc706 c6c8: 84 2b or r24, r20 else if ((c >= 'a') && (c <= 'f')) val |= (c - 'a' + 10); else return -parsed; data[parsed] = val; c6ca: 81 93 st Z+, r24 parsed++; c6cc: 0f 5f subi r16, 0xFF ; 255 c6ce: 1f 4f sbci r17, 0xFF ; 255 c6d0: de cf rjmp .-68 ; 0xc68e { 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(); c6d2: 0e 94 b5 60 call 0xc16a ; 0xc16a c6d6: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> c6da: 9b 01 movw r18, r22 c6dc: 77 0f add r23, r23 c6de: 44 0b sbc r20, r20 c6e0: 55 0b sbc r21, r21 c6e2: 29 8b std Y+17, r18 ; 0x11 c6e4: 3a 8b std Y+18, r19 ; 0x12 c6e6: 4b 8b std Y+19, r20 ; 0x13 c6e8: 5c 8b std Y+20, r21 ; 0x14 c6ea: 95 cf rjmp .-214 ; 0xc616 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 c6ec: 44 24 eor r4, r4 c6ee: 4a 94 dec r4 c6f0: 54 2c mov r5, r4 c6f2: 32 01 movw r6, r4 c6f4: 9a cf rjmp .-204 ; 0xc62a 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); c6f6: 9f e9 ldi r25, 0x9F ; 159 c6f8: 98 0f add r25, r24 c6fa: 96 30 cpi r25, 0x06 ; 6 c6fc: 58 f4 brcc .+22 ; 0xc714 c6fe: 82 95 swap r24 c700: 80 7f andi r24, 0xF0 ; 240 c702: 80 57 subi r24, 0x70 ; 112 c704: d8 cf rjmp .-80 ; 0xc6b6 else return -parsed; c = *(hex++); if ((c >= '0') && (c <= '9')) val |= (c - '0'); else if ((c >= 'a') && (c <= 'f')) val |= (c - 'a' + 10); c706: 4f e9 ldi r20, 0x9F ; 159 c708: 49 0f add r20, r25 c70a: 46 30 cpi r20, 0x06 ; 6 c70c: 18 f4 brcc .+6 ; 0xc714 c70e: 97 55 subi r25, 0x57 ; 87 c710: 89 2b or r24, r25 c712: db cf rjmp .-74 ; 0xc6ca else return -parsed; c714: 11 95 neg r17 c716: 01 95 neg r16 c718: 11 09 sbc r17, r1 if ((addr_start + count) > addr_end || (addr_start + count) < addr_start) count = addr_end - addr_start; if (code_seen('X')) { uint8_t data[16]; count = parse_hex(strchr_pointer + 1, data, 16); c71a: 28 01 movw r4, r16 c71c: 01 2e mov r0, r17 c71e: 00 0c add r0, r0 c720: 66 08 sbc r6, r6 c722: 77 08 sbc r7, r7 write_mem(addr_start, count, data, type); c724: da 8a std Y+18, r13 ; 0x12 c726: c9 8a std Y+17, r12 ; 0x11 } // 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++) c728: b1 2c mov r11, r1 c72a: a1 2c mov r10, r1 c72c: 0a 15 cp r16, r10 c72e: 1b 05 cpc r17, r11 c730: f1 f0 breq .+60 ; 0xc76e { switch (type) c732: 33 20 and r3, r3 c734: 39 f0 breq .+14 ; 0xc744 c736: 31 e0 ldi r19, 0x01 ; 1 c738: 33 16 cp r3, r19 c73a: 71 f0 breq .+28 ; 0xc758 } // 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++) c73c: 4f ef ldi r20, 0xFF ; 255 c73e: a4 1a sub r10, r20 c740: b4 0a sbc r11, r20 c742: f4 cf rjmp .-24 ; 0xc72c { switch (type) { case dcode_mem_t::sram: *((uint8_t*)address) = data[i]; break; c744: f4 01 movw r30, r8 c746: ea 0d add r30, r10 c748: fb 1d adc r31, r11 c74a: 80 81 ld r24, Z c74c: e9 89 ldd r30, Y+17 ; 0x11 c74e: fa 89 ldd r31, Y+18 ; 0x12 c750: ea 0d add r30, r10 c752: fb 1d adc r31, r11 c754: 80 83 st Z, r24 c756: f2 cf rjmp .-28 ; 0xc73c case dcode_mem_t::eeprom: eeprom_write_byte_notify((uint8_t*)address, data[i]); break; c758: f4 01 movw r30, r8 c75a: ea 0d add r30, r10 c75c: fb 1d adc r31, r11 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); c75e: 60 81 ld r22, Z c760: 89 89 ldd r24, Y+17 ; 0x11 c762: 9a 89 ldd r25, Y+18 ; 0x12 c764: 8a 0d add r24, r10 c766: 9b 1d adc r25, r11 c768: 0f 94 1f dc call 0x3b83e ; 0x3b83e c76c: e7 cf rjmp .-50 ; 0xc73c { uint8_t data[16]; 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); c76e: ff 92 push r15 c770: ef 92 push r14 c772: df 92 push r13 c774: cf 92 push r12 c776: 2f 92 push r2 c778: 5d 89 ldd r21, Y+21 ; 0x15 c77a: 5f 93 push r21 c77c: 7f 92 push r7 c77e: 6f 92 push r6 c780: 5f 92 push r5 c782: 4f 92 push r4 c784: 87 eb ldi r24, 0xB7 ; 183 c786: 95 e6 ldi r25, 0x65 ; 101 c788: 9f 93 push r25 c78a: 8f 93 push r24 c78c: 0f 94 99 da call 0x3b532 ; 0x3b532 c790: 0f b6 in r0, 0x3f ; 63 c792: f8 94 cli c794: de bf out 0x3e, r29 ; 62 c796: 0f be out 0x3f, r0 ; 63 c798: cd bf out 0x3d, r28 ; 61 #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); c79a: 03 2d mov r16, r3 c79c: a3 01 movw r20, r6 c79e: 92 01 movw r18, r4 c7a0: c7 01 movw r24, r14 c7a2: b6 01 movw r22, r12 c7a4: 0f 94 e4 85 call 0x30bc8 ; 0x30bc8 } c7a8: 65 96 adiw r28, 0x15 ; 21 c7aa: 0f b6 in r0, 0x3f ; 63 c7ac: f8 94 cli c7ae: de bf out 0x3e, r29 ; 62 c7b0: 0f be out 0x3f, r0 ; 63 c7b2: cd bf out 0x3d, r28 ; 61 c7b4: df 91 pop r29 c7b6: cf 91 pop r28 c7b8: 1f 91 pop r17 c7ba: 0f 91 pop r16 c7bc: ff 90 pop r15 c7be: ef 90 pop r14 c7c0: df 90 pop r13 c7c2: cf 90 pop r12 c7c4: bf 90 pop r11 c7c6: af 90 pop r10 c7c8: 9f 90 pop r9 c7ca: 8f 90 pop r8 c7cc: 7f 90 pop r7 c7ce: 6f 90 pop r6 c7d0: 5f 90 pop r5 c7d2: 4f 90 pop r4 c7d4: 3f 90 pop r3 c7d6: 2f 90 pop r2 c7d8: 08 95 ret 0000c7da : #define DBG(args...) printf_P(args) inline void print_hex_nibble(uint8_t val) { putchar((val > 9)?(val - 10 + 'a'):(val + '0')); c7da: 60 91 1b 18 lds r22, 0x181B ; 0x80181b <__iob+0x2> c7de: 70 91 1c 18 lds r23, 0x181C ; 0x80181c <__iob+0x3> c7e2: 90 e0 ldi r25, 0x00 ; 0 c7e4: 8a 30 cpi r24, 0x0A ; 10 c7e6: 20 f0 brcs .+8 ; 0xc7f0 c7e8: 89 5a subi r24, 0xA9 ; 169 c7ea: 9f 4f sbci r25, 0xFF ; 255 c7ec: 0d 94 3f da jmp 0x3b47e ; 0x3b47e c7f0: c0 96 adiw r24, 0x30 ; 48 c7f2: fc cf rjmp .-8 ; 0xc7ec 0000c7f4 : 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); c7f4: 84 ff sbrs r24, 4 c7f6: 18 c0 rjmp .+48 ; 0xc828 c7f8: 8d 9a sbi 0x11, 5 ; 17 WRITE(LCD_PINS_D5, value & 0x20); c7fa: 85 ff sbrs r24, 5 c7fc: 17 c0 rjmp .+46 ; 0xc82c c7fe: a4 9a sbi 0x14, 4 ; 20 WRITE(LCD_PINS_D6, value & 0x40); c800: 2f b7 in r18, 0x3f ; 63 c802: 86 ff sbrs r24, 6 c804: 15 c0 rjmp .+42 ; 0xc830 c806: f8 94 cli c808: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> c80c: 90 68 ori r25, 0x80 ; 128 c80e: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> c812: 2f bf out 0x3f, r18 ; 63 WRITE(LCD_PINS_D7, value & 0x80); c814: 87 ff sbrs r24, 7 c816: 11 c0 rjmp .+34 ; 0xc83a c818: a3 9a sbi 0x14, 3 ; 20 static void lcd_print_custom(uint8_t c); static void lcd_invalidate_custom_characters(); static void lcd_pulseEnable(void) { WRITE(LCD_PINS_ENABLE,HIGH); c81a: 8f 9a sbi 0x11, 7 ; 17 #else //round up by default __ticks_dc = (uint32_t)(ceil(fabs(__tmp))); #endif __builtin_avr_delay_cycles(__ticks_dc); c81c: 85 e0 ldi r24, 0x05 ; 5 c81e: 8a 95 dec r24 c820: f1 f7 brne .-4 ; 0xc81e c822: 00 00 nop _delay_us(1); // enable pulse must be >450ns WRITE(LCD_PINS_ENABLE,LOW); c824: 8f 98 cbi 0x11, 7 ; 17 WRITE(LCD_PINS_D5, value & 0x20); WRITE(LCD_PINS_D6, value & 0x40); WRITE(LCD_PINS_D7, value & 0x80); lcd_pulseEnable(); } c826: 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); c828: 8d 98 cbi 0x11, 5 ; 17 c82a: e7 cf rjmp .-50 ; 0xc7fa WRITE(LCD_PINS_D5, value & 0x20); c82c: a4 98 cbi 0x14, 4 ; 20 c82e: e8 cf rjmp .-48 ; 0xc800 WRITE(LCD_PINS_D6, value & 0x40); c830: f8 94 cli c832: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> c836: 9f 77 andi r25, 0x7F ; 127 c838: ea cf rjmp .-44 ; 0xc80e WRITE(LCD_PINS_D7, value & 0x80); c83a: a3 98 cbi 0x14, 3 ; 20 c83c: ee cf rjmp .-36 ; 0xc81a 0000c83e : lcd_pulseEnable(); } static void lcd_send(uint8_t data, uint8_t flags, uint16_t duration = LCD_DEFAULT_DELAY) { c83e: 0f 93 push r16 c840: 1f 93 push r17 c842: cf 93 push r28 c844: df 93 push r29 c846: c8 2f mov r28, r24 c848: d6 2f mov r29, r22 c84a: 8a 01 movw r16, r20 WRITE(LCD_PINS_RS,flags&LCD_RS_FLAG); c84c: 60 ff sbrs r22, 0 c84e: 15 c0 rjmp .+42 ; 0xc87a c850: 5d 9a sbi 0x0b, 5 ; 11 c852: 8a e1 ldi r24, 0x1A ; 26 c854: 8a 95 dec r24 c856: f1 f7 brne .-4 ; 0xc854 c858: 00 c0 rjmp .+0 ; 0xc85a _delay_us(5); lcd_writebits(data); c85a: 8c 2f mov r24, r28 c85c: 0e 94 fa 63 call 0xc7f4 ; 0xc7f4 #ifndef LCD_8BIT if (!(flags & LCD_HALF_FLAG)) { c860: d1 fd sbrc r29, 1 c862: 04 c0 rjmp .+8 ; 0xc86c // _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 c864: 8c 2f mov r24, r28 c866: 82 95 swap r24 c868: 0e 94 fa 63 call 0xc7f4 ; 0xc7f4 } #endif delayMicroseconds(duration); c86c: c8 01 movw r24, r16 } c86e: df 91 pop r29 c870: cf 91 pop r28 c872: 1f 91 pop r17 c874: 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); c876: 0c 94 5e e8 jmp 0x1d0bc ; 0x1d0bc 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); c87a: 5d 98 cbi 0x0b, 5 ; 11 c87c: ea cf rjmp .-44 ; 0xc852 0000c87e : return def; } return val; } void __attribute__((noinline)) eeprom_init_default_float(float *__p, float def) { c87e: cf 92 push r12 c880: df 92 push r13 c882: ef 92 push r14 c884: ff 92 push r15 c886: cf 93 push r28 c888: df 93 push r29 c88a: ec 01 movw r28, r24 c88c: 6a 01 movw r12, r20 c88e: 7b 01 movw r14, r22 if (eeprom_read_dword((uint32_t*)__p) == EEPROM_EMPTY_VALUE32) c890: 0f 94 df db call 0x3b7be ; 0x3b7be c894: 6f 3f cpi r22, 0xFF ; 255 c896: 7f 4f sbci r23, 0xFF ; 255 c898: 8f 4f sbci r24, 0xFF ; 255 c89a: 9f 4f sbci r25, 0xFF ; 255 c89c: 59 f4 brne .+22 ; 0xc8b4 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); c89e: b7 01 movw r22, r14 c8a0: a6 01 movw r20, r12 c8a2: 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); } c8a4: df 91 pop r29 c8a6: cf 91 pop r28 c8a8: ff 90 pop r15 c8aa: ef 90 pop r14 c8ac: df 90 pop r13 c8ae: 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); c8b0: 0d 94 2d dc jmp 0x3b85a ; 0x3b85a } 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); } c8b4: df 91 pop r29 c8b6: cf 91 pop r28 c8b8: ff 90 pop r15 c8ba: ef 90 pop r14 c8bc: df 90 pop r13 c8be: cf 90 pop r12 c8c0: 08 95 ret 0000c8c2 : /// 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)); c8c2: 80 e1 ldi r24, 0x10 ; 16 c8c4: e1 e9 ldi r30, 0x91 ; 145 c8c6: f6 e0 ldi r31, 0x06 ; 6 c8c8: a3 e7 ldi r26, 0x73 ; 115 c8ca: b2 e0 ldi r27, 0x02 ; 2 c8cc: 01 90 ld r0, Z+ c8ce: 0d 92 st X+, r0 c8d0: 8a 95 dec r24 c8d2: e1 f7 brne .-8 ; 0xc8cc saved_feedmultiply2 = feedmultiply; //save feedmultiply c8d4: 80 91 39 02 lds r24, 0x0239 ; 0x800239 c8d8: 90 91 3a 02 lds r25, 0x023A ; 0x80023a c8dc: 90 93 70 03 sts 0x0370, r25 ; 0x800370 c8e0: 80 93 6f 03 sts 0x036F, r24 ; 0x80036f saved_extruder_temperature = (uint16_t)degTargetHotend(active_extruder); c8e4: 80 91 b5 0d lds r24, 0x0DB5 ; 0x800db5 c8e8: 90 91 b6 0d lds r25, 0x0DB6 ; 0x800db6 c8ec: 90 93 ac 05 sts 0x05AC, r25 ; 0x8005ac c8f0: 80 93 ab 05 sts 0x05AB, r24 ; 0x8005ab saved_bed_temperature = (uint8_t)degTargetBed(); c8f4: 80 91 71 06 lds r24, 0x0671 ; 0x800671 c8f8: 80 93 ad 05 sts 0x05AD, r24 ; 0x8005ad saved_extruder_relative_mode = axis_relative_modes & E_AXIS_MASK; c8fc: 80 91 e3 03 lds r24, 0x03E3 ; 0x8003e3 c900: 83 fb bst r24, 3 c902: 88 27 eor r24, r24 c904: 80 f9 bld r24, 0 c906: 80 93 63 05 sts 0x0563, r24 ; 0x800563 saved_fan_speed = fanSpeed; c90a: 80 91 e5 03 lds r24, 0x03E5 ; 0x8003e5 c90e: 80 93 aa 05 sts 0x05AA, r24 ; 0x8005aa isPartialBackupAvailable = true; c912: 81 e0 ldi r24, 0x01 ; 1 c914: 80 93 a1 06 sts 0x06A1, r24 ; 0x8006a1 } c918: 08 95 ret 0000c91a <_GLOBAL__sub_D_card>: while(!lcd_clicked()) { delay_keep_alive(0); } KEEPALIVE_STATE(busy_state_backup); } c91a: cf 93 push r28 c91c: df 93 push r29 //------------------------------------------------------------------------------ /** * \class SdFile * \brief SdBaseFile with Print. */ class SdFile : public SdBaseFile/*, public Print*/ { c91e: 8f e1 ldi r24, 0x1F ; 31 c920: 97 e1 ldi r25, 0x17 ; 23 c922: 0e 94 49 77 call 0xee92 ; 0xee92 #ifdef SDSUPPORT #define MAX_DIR_DEPTH 6 #include "SdFile.h" class CardReader c926: 8d e5 ldi r24, 0x5D ; 93 c928: 95 e1 ldi r25, 0x15 ; 21 c92a: 89 2b or r24, r25 c92c: 51 f0 breq .+20 ; 0xc942 <_GLOBAL__sub_D_card+0x28> c92e: cf e2 ldi r28, 0x2F ; 47 c930: d6 e1 ldi r29, 0x16 ; 22 c932: a3 97 sbiw r28, 0x23 ; 35 c934: ce 01 movw r24, r28 c936: 0e 94 49 77 call 0xee92 ; 0xee92 c93a: 85 e1 ldi r24, 0x15 ; 21 c93c: cd 35 cpi r28, 0x5D ; 93 c93e: d8 07 cpc r29, r24 c940: c1 f7 brne .-16 ; 0xc932 <_GLOBAL__sub_D_card+0x18> c942: 8a e3 ldi r24, 0x3A ; 58 c944: 95 e1 ldi r25, 0x15 ; 21 c946: 0e 94 49 77 call 0xee92 ; 0xee92 c94a: 85 e1 ldi r24, 0x15 ; 21 c94c: 95 e1 ldi r25, 0x15 ; 21 c94e: df 91 pop r29 c950: cf 91 pop r28 c952: 0c 94 49 77 jmp 0xee92 ; 0xee92 0000c956 : print_time_to_change_normal = PRINT_TIME_REMAINING_INIT; print_time_to_change_silent = PRINT_TIME_REMAINING_INIT; } void load_filament_final_feed() { c956: cf 93 push r28 c958: df 93 push r29 current_position[E_AXIS]+= FILAMENTCHANGE_FINALFEED; c95a: c1 e9 ldi r28, 0x91 ; 145 c95c: d6 e0 ldi r29, 0x06 ; 6 c95e: 20 e0 ldi r18, 0x00 ; 0 c960: 30 e0 ldi r19, 0x00 ; 0 c962: 48 ec ldi r20, 0xC8 ; 200 c964: 51 e4 ldi r21, 0x41 ; 65 c966: 6c 85 ldd r22, Y+12 ; 0x0c c968: 7d 85 ldd r23, Y+13 ; 0x0d c96a: 8e 85 ldd r24, Y+14 ; 0x0e c96c: 9f 85 ldd r25, Y+15 ; 0x0f c96e: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> c972: 6c 87 std Y+12, r22 ; 0x0c c974: 7d 87 std Y+13, r23 ; 0x0d c976: 8e 87 std Y+14, r24 ; 0x0e c978: 9f 87 std Y+15, r25 ; 0x0f plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FINAL); c97a: 63 e3 ldi r22, 0x33 ; 51 c97c: 73 e3 ldi r23, 0x33 ; 51 c97e: 83 e5 ldi r24, 0x53 ; 83 c980: 90 e4 ldi r25, 0x40 ; 64 } c982: df 91 pop r29 c984: cf 91 pop r28 } void load_filament_final_feed() { current_position[E_AXIS]+= FILAMENTCHANGE_FINALFEED; plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FINAL); c986: 0d 94 04 c0 jmp 0x38008 ; 0x38008 0000c98a : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); c98a: 60 e0 ldi r22, 0x00 ; 0 c98c: 85 ea ldi r24, 0xA5 ; 165 c98e: 9f e0 ldi r25, 0x0F ; 15 c990: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 c994: 60 e0 ldi r22, 0x00 ; 0 c996: 8f e7 ldi r24, 0x7F ; 127 c998: 9c e0 ldi r25, 0x0C ; 12 c99a: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 // 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; c99e: 80 e0 ldi r24, 0x00 ; 0 c9a0: 90 e0 ldi r25, 0x00 ; 0 c9a2: a0 e8 ldi r26, 0x80 ; 128 c9a4: bf eb ldi r27, 0xBF ; 191 c9a6: 80 93 83 02 sts 0x0283, r24 ; 0x800283 c9aa: 90 93 84 02 sts 0x0284, r25 ; 0x800284 c9ae: a0 93 85 02 sts 0x0285, r26 ; 0x800285 c9b2: b0 93 86 02 sts 0x0286, r27 ; 0x800286 saved_printing_type = PowerPanic::PRINT_TYPE_NONE; c9b6: 82 e0 ldi r24, 0x02 ; 2 c9b8: 80 93 6a 02 sts 0x026A, r24 ; 0x80026a saved_printing = false; c9bc: 10 92 a8 0d sts 0x0DA8, r1 ; 0x800da8 } c9c0: 08 95 ret 0000c9c2 : enquecommandf_P(MSG_M23, filename); } void restore_extruder_temperature_from_ram() { if ((uint16_t)degTargetHotend(active_extruder) != saved_extruder_temperature) c9c2: 80 91 ab 05 lds r24, 0x05AB ; 0x8005ab c9c6: 90 91 ac 05 lds r25, 0x05AC ; 0x8005ac c9ca: 20 91 b5 0d lds r18, 0x0DB5 ; 0x800db5 c9ce: 30 91 b6 0d lds r19, 0x0DB6 ; 0x800db6 c9d2: 28 17 cp r18, r24 c9d4: 39 07 cpc r19, r25 c9d6: 71 f0 breq .+28 ; 0xc9f4 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; c9d8: 90 93 b6 0d sts 0x0DB6, r25 ; 0x800db6 c9dc: 80 93 b5 0d sts 0x0DB5, r24 ; 0x800db5 { setTargetHotend(saved_extruder_temperature); heating_status = HeatingStatus::EXTRUDER_HEATING; c9e0: 81 e0 ldi r24, 0x01 ; 1 c9e2: 80 93 e1 03 sts 0x03E1, r24 ; 0x8003e1 wait_for_heater(_millis(), active_extruder); c9e6: 0f 94 22 29 call 0x25244 ; 0x25244 c9ea: 0f 94 9c 81 call 0x30338 ; 0x30338 heating_status = HeatingStatus::EXTRUDER_HEATING_COMPLETE; c9ee: 82 e0 ldi r24, 0x02 ; 2 c9f0: 80 93 e1 03 sts 0x03E1, r24 ; 0x8003e1 } } c9f4: 08 95 ret 0000c9f6 : saved_fan_speed = fanSpeed; isPartialBackupAvailable = true; } void __attribute__((noinline)) refresh_saved_feedrate_multiplier_in_ram() { if (!saved_printing) { c9f6: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 c9fa: 88 23 and r24, r24 c9fc: 41 f0 breq .+16 ; 0xca0e // There is no saved print, therefore nothing to refresh return; } saved_feedmultiply2 = feedmultiply; c9fe: 80 91 39 02 lds r24, 0x0239 ; 0x800239 ca02: 90 91 3a 02 lds r25, 0x023A ; 0x80023a ca06: 90 93 70 03 sts 0x0370, r25 ; 0x800370 ca0a: 80 93 6f 03 sts 0x036F, r24 ; 0x80036f } ca0e: 08 95 ret 0000ca10 : //not sd printing nor usb printing } } void save_planner_global_state() { if (current_block && !(mesh_bed_leveling_flag || homing_flag)) ca10: 80 91 a0 05 lds r24, 0x05A0 ; 0x8005a0 ca14: 90 91 a1 05 lds r25, 0x05A1 ; 0x8005a1 ca18: 00 97 sbiw r24, 0x00 ; 0 ca1a: 29 f1 breq .+74 ; 0xca66 ca1c: 20 91 a7 0d lds r18, 0x0DA7 ; 0x800da7 ca20: 21 11 cpse r18, r1 ca22: 21 c0 rjmp .+66 ; 0xca66 ca24: 20 91 a6 0d lds r18, 0x0DA6 ; 0x800da6 ca28: 21 11 cpse r18, r1 ca2a: 1d c0 rjmp .+58 ; 0xca66 { memcpy(saved_start_position, current_block->gcode_start_position, sizeof(saved_start_position)); ca2c: fc 01 movw r30, r24 ca2e: e8 5a subi r30, 0xA8 ; 168 ca30: ff 4f sbci r31, 0xFF ; 255 ca32: 20 e1 ldi r18, 0x10 ; 16 ca34: a3 e8 ldi r26, 0x83 ; 131 ca36: b2 e0 ldi r27, 0x02 ; 2 ca38: 01 90 ld r0, Z+ ca3a: 0d 92 st X+, r0 ca3c: 2a 95 dec r18 ca3e: e1 f7 brne .-8 ; 0xca38 saved_feedrate2 = current_block->gcode_feedrate; ca40: fc 01 movw r30, r24 ca42: e6 59 subi r30, 0x96 ; 150 ca44: ff 4f sbci r31, 0xFF ; 255 ca46: 20 81 ld r18, Z ca48: 31 81 ldd r19, Z+1 ; 0x01 ca4a: 30 93 5e 05 sts 0x055E, r19 ; 0x80055e ca4e: 20 93 5d 05 sts 0x055D, r18 ; 0x80055d saved_segment_idx = current_block->segment_idx; ca52: 88 59 subi r24, 0x98 ; 152 ca54: 9f 4f sbci r25, 0xFF ; 255 ca56: fc 01 movw r30, r24 ca58: 80 81 ld r24, Z ca5a: 91 81 ldd r25, Z+1 ; 0x01 ca5c: 90 93 69 05 sts 0x0569, r25 ; 0x800569 ca60: 80 93 68 05 sts 0x0568, r24 ; 0x800568 ca64: 08 95 ret } else { saved_start_position[0] = SAVED_START_POSITION_UNSET; ca66: 80 e0 ldi r24, 0x00 ; 0 ca68: 90 e0 ldi r25, 0x00 ; 0 ca6a: a0 e8 ldi r26, 0x80 ; 128 ca6c: bf eb ldi r27, 0xBF ; 191 ca6e: 80 93 83 02 sts 0x0283, r24 ; 0x800283 ca72: 90 93 84 02 sts 0x0284, r25 ; 0x800284 ca76: a0 93 85 02 sts 0x0285, r26 ; 0x800285 ca7a: b0 93 86 02 sts 0x0286, r27 ; 0x800286 saved_feedrate2 = feedrate; ca7e: 60 91 b8 02 lds r22, 0x02B8 ; 0x8002b8 ca82: 70 91 b9 02 lds r23, 0x02B9 ; 0x8002b9 ca86: 80 91 ba 02 lds r24, 0x02BA ; 0x8002ba ca8a: 90 91 bb 02 lds r25, 0x02BB ; 0x8002bb ca8e: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> ca92: 70 93 5e 05 sts 0x055E, r23 ; 0x80055e ca96: 60 93 5d 05 sts 0x055D, r22 ; 0x80055d saved_segment_idx = 0; ca9a: 10 92 69 05 sts 0x0569, r1 ; 0x800569 ca9e: 10 92 68 05 sts 0x0568, r1 ; 0x800568 } } caa2: 08 95 ret 0000caa4 : SERIAL_PROTOCOLPGM(" E:0 B:"); SERIAL_PROTOCOL_F(degBed(), 1); SERIAL_PROTOCOLLN(); } void save_print_file_state() { caa4: cf 92 push r12 caa6: df 92 push r13 caa8: ef 92 push r14 caaa: ff 92 push r15 uint8_t nlines; uint16_t sdlen_cmdqueue; uint16_t sdlen_planner; if (card.sdprinting) { caac: 80 91 8f 14 lds r24, 0x148F ; 0x80148f cab0: 88 23 and r24, r24 cab2: d9 f1 breq .+118 ; 0xcb2a saved_sdpos = sdpos_atomic; //atomic sd position of last command added in queue cab4: 80 91 80 03 lds r24, 0x0380 ; 0x800380 cab8: 90 91 81 03 lds r25, 0x0381 ; 0x800381 cabc: a0 91 82 03 lds r26, 0x0382 ; 0x800382 cac0: b0 91 83 03 lds r27, 0x0383 ; 0x800383 cac4: 80 93 5f 05 sts 0x055F, r24 ; 0x80055f cac8: 90 93 60 05 sts 0x0560, r25 ; 0x800560 cacc: a0 93 61 05 sts 0x0561, r26 ; 0x800561 cad0: b0 93 62 05 sts 0x0562, r27 ; 0x800562 sdlen_planner = planner_calc_sd_length(); //length of sd commands in planner cad4: 0f 94 ea 62 call 0x2c5d4 ; 0x2c5d4 saved_sdpos -= sdlen_planner; cad8: c0 90 5f 05 lds r12, 0x055F ; 0x80055f cadc: d0 90 60 05 lds r13, 0x0560 ; 0x800560 cae0: e0 90 61 05 lds r14, 0x0561 ; 0x800561 cae4: f0 90 62 05 lds r15, 0x0562 ; 0x800562 cae8: c8 1a sub r12, r24 caea: d9 0a sbc r13, r25 caec: e1 08 sbc r14, r1 caee: f1 08 sbc r15, r1 caf0: c0 92 5f 05 sts 0x055F, r12 ; 0x80055f caf4: d0 92 60 05 sts 0x0560, r13 ; 0x800560 caf8: e0 92 61 05 sts 0x0561, r14 ; 0x800561 cafc: f0 92 62 05 sts 0x0562, r15 ; 0x800562 sdlen_cmdqueue = cmdqueue_calc_sd_length(); //length of sd commands in cmdqueue cb00: 0e 94 2b 5b call 0xb656 ; 0xb656 saved_sdpos -= sdlen_cmdqueue; cb04: c8 1a sub r12, r24 cb06: d9 0a sbc r13, r25 cb08: e1 08 sbc r14, r1 cb0a: f1 08 sbc r15, r1 cb0c: c0 92 5f 05 sts 0x055F, r12 ; 0x80055f cb10: d0 92 60 05 sts 0x0560, r13 ; 0x800560 cb14: e0 92 61 05 sts 0x0561, r14 ; 0x800561 cb18: f0 92 62 05 sts 0x0562, r15 ; 0x800562 saved_printing_type = PowerPanic::PRINT_TYPE_SD; cb1c: 10 92 6a 02 sts 0x026A, r1 ; 0x80026a } else { saved_printing_type = PowerPanic::PRINT_TYPE_NONE; //not sd printing nor usb printing } } cb20: ff 90 pop r15 cb22: ef 90 pop r14 cb24: df 90 pop r13 cb26: cf 90 pop r12 cb28: 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 cb2a: 80 91 0d 05 lds r24, 0x050D ; 0x80050d cb2e: 88 23 and r24, r24 cb30: b1 f1 breq .+108 ; 0xcb9e saved_sdpos = gcode_LastN; //start with line number of command added recently to cmd queue cb32: 80 91 78 03 lds r24, 0x0378 ; 0x800378 cb36: 90 91 79 03 lds r25, 0x0379 ; 0x800379 cb3a: a0 91 7a 03 lds r26, 0x037A ; 0x80037a cb3e: b0 91 7b 03 lds r27, 0x037B ; 0x80037b cb42: 80 93 5f 05 sts 0x055F, r24 ; 0x80055f cb46: 90 93 60 05 sts 0x0560, r25 ; 0x800560 cb4a: a0 93 61 05 sts 0x0561, r26 ; 0x800561 cb4e: b0 93 62 05 sts 0x0562, r27 ; 0x800562 //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 cb52: 0f 94 ea 62 call 0x2c5d4 ; 0x2c5d4 saved_sdpos -= nlines; cb56: 40 91 5f 05 lds r20, 0x055F ; 0x80055f cb5a: 50 91 60 05 lds r21, 0x0560 ; 0x800560 cb5e: 60 91 61 05 lds r22, 0x0561 ; 0x800561 cb62: 70 91 62 05 lds r23, 0x0562 ; 0x800562 cb66: 48 1b sub r20, r24 cb68: 51 09 sbc r21, r1 cb6a: 61 09 sbc r22, r1 cb6c: 71 09 sbc r23, r1 saved_sdpos -= buflen; //number of blocks in cmd buffer cb6e: 80 91 a2 10 lds r24, 0x10A2 ; 0x8010a2 cb72: 90 91 a3 10 lds r25, 0x10A3 ; 0x8010a3 cb76: 09 2e mov r0, r25 cb78: 00 0c add r0, r0 cb7a: aa 0b sbc r26, r26 cb7c: bb 0b sbc r27, r27 cb7e: 48 1b sub r20, r24 cb80: 59 0b sbc r21, r25 cb82: 6a 0b sbc r22, r26 cb84: 7b 0b sbc r23, r27 cb86: 40 93 5f 05 sts 0x055F, r20 ; 0x80055f cb8a: 50 93 60 05 sts 0x0560, r21 ; 0x800560 cb8e: 60 93 61 05 sts 0x0561, r22 ; 0x800561 cb92: 70 93 62 05 sts 0x0562, r23 ; 0x800562 saved_printing_type = PowerPanic::PRINT_TYPE_HOST; cb96: 81 e0 ldi r24, 0x01 ; 1 } else { saved_printing_type = PowerPanic::PRINT_TYPE_NONE; cb98: 80 93 6a 02 sts 0x026A, r24 ; 0x80026a cb9c: c1 cf rjmp .-126 ; 0xcb20 cb9e: 82 e0 ldi r24, 0x02 ; 2 cba0: fb cf rjmp .-10 ; 0xcb98 0000cba2 : if (extrudemultiply != 100) out *= float(extrudemultiply) * 0.01f; return out; } void calculate_extruder_multipliers() { cba2: cf 92 push r12 cba4: df 92 push r13 cba6: ef 92 push r14 cba8: ff 92 push r15 extruder_multiplier[0] = calculate_extruder_multiplier(cs.filament_size[0]); cbaa: c0 90 55 0e lds r12, 0x0E55 ; 0x800e55 cbae: d0 90 56 0e lds r13, 0x0E56 ; 0x800e56 cbb2: e0 90 57 0e lds r14, 0x0E57 ; 0x800e57 cbb6: f0 90 58 0e lds r15, 0x0E58 ; 0x800e58 } } float calculate_extruder_multiplier(float diameter) { float out = 1.f; if (cs.volumetric_enabled && diameter > 0.f) { cbba: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 cbbe: 88 23 and r24, r24 cbc0: 09 f4 brne .+2 ; 0xcbc4 cbc2: 4e c0 rjmp .+156 ; 0xcc60 cbc4: 20 e0 ldi r18, 0x00 ; 0 cbc6: 30 e0 ldi r19, 0x00 ; 0 cbc8: a9 01 movw r20, r18 cbca: c7 01 movw r24, r14 cbcc: b6 01 movw r22, r12 cbce: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> cbd2: 18 16 cp r1, r24 cbd4: 0c f0 brlt .+2 ; 0xcbd8 cbd6: 44 c0 rjmp .+136 ; 0xcc60 float area = M_PI * diameter * diameter * 0.25; cbd8: 2b ed ldi r18, 0xDB ; 219 cbda: 3f e0 ldi r19, 0x0F ; 15 cbdc: 49 e4 ldi r20, 0x49 ; 73 cbde: 50 e4 ldi r21, 0x40 ; 64 cbe0: c7 01 movw r24, r14 cbe2: b6 01 movw r22, r12 cbe4: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> cbe8: a7 01 movw r20, r14 cbea: 96 01 movw r18, r12 cbec: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> cbf0: 20 e0 ldi r18, 0x00 ; 0 cbf2: 30 e0 ldi r19, 0x00 ; 0 cbf4: 40 e8 ldi r20, 0x80 ; 128 cbf6: 5e e3 ldi r21, 0x3E ; 62 cbf8: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> cbfc: 9b 01 movw r18, r22 cbfe: ac 01 movw r20, r24 out = 1.f / area; cc00: 60 e0 ldi r22, 0x00 ; 0 cc02: 70 e0 ldi r23, 0x00 ; 0 cc04: 80 e8 ldi r24, 0x80 ; 128 cc06: 9f e3 ldi r25, 0x3F ; 63 cc08: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> cc0c: 6b 01 movw r12, r22 cc0e: 7c 01 movw r14, r24 } if (extrudemultiply != 100) cc10: 60 91 bc 02 lds r22, 0x02BC ; 0x8002bc cc14: 70 91 bd 02 lds r23, 0x02BD ; 0x8002bd cc18: 64 36 cpi r22, 0x64 ; 100 cc1a: 71 05 cpc r23, r1 cc1c: a1 f0 breq .+40 ; 0xcc46 out *= float(extrudemultiply) * 0.01f; cc1e: 07 2e mov r0, r23 cc20: 00 0c add r0, r0 cc22: 88 0b sbc r24, r24 cc24: 99 0b sbc r25, r25 cc26: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> cc2a: 2a e0 ldi r18, 0x0A ; 10 cc2c: 37 ed ldi r19, 0xD7 ; 215 cc2e: 43 e2 ldi r20, 0x23 ; 35 cc30: 5c e3 ldi r21, 0x3C ; 60 cc32: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> cc36: 9b 01 movw r18, r22 cc38: ac 01 movw r20, r24 cc3a: c7 01 movw r24, r14 cc3c: b6 01 movw r22, r12 cc3e: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> cc42: 6b 01 movw r12, r22 cc44: 7c 01 movw r14, r24 return out; } void calculate_extruder_multipliers() { extruder_multiplier[0] = calculate_extruder_multiplier(cs.filament_size[0]); cc46: c0 92 93 02 sts 0x0293, r12 ; 0x800293 cc4a: d0 92 94 02 sts 0x0294, r13 ; 0x800294 cc4e: e0 92 95 02 sts 0x0295, r14 ; 0x800295 cc52: f0 92 96 02 sts 0x0296, r15 ; 0x800296 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 } cc56: ff 90 pop r15 cc58: ef 90 pop r14 cc5a: df 90 pop r13 cc5c: cf 90 pop r12 cc5e: 08 95 ret MMU2::mmu2.ClearTMCFailures(); // not stored into EEPROM } } float calculate_extruder_multiplier(float diameter) { float out = 1.f; cc60: c1 2c mov r12, r1 cc62: d1 2c mov r13, r1 cc64: 80 e8 ldi r24, 0x80 ; 128 cc66: e8 2e mov r14, r24 cc68: 8f e3 ldi r24, 0x3F ; 63 cc6a: f8 2e mov r15, r24 cc6c: d1 cf rjmp .-94 ; 0xcc10 0000cc6e : } } #endif //FAST_PWM_FAN void save_statistics() { cc6e: 8f 92 push r8 cc70: 9f 92 push r9 cc72: af 92 push r10 cc74: bf 92 push r11 cc76: cf 92 push r12 cc78: df 92 push r13 cc7a: ef 92 push r14 cc7c: ff 92 push r15 uint32_t _previous_filament = eeprom_init_default_dword((uint32_t *)EEPROM_FILAMENTUSED, 0); //_previous_filament unit: meter cc7e: 81 ef ldi r24, 0xF1 ; 241 cc80: 9f e0 ldi r25, 0x0F ; 15 cc82: 0f 94 18 7a call 0x2f430 ; 0x2f430 cc86: 6b 01 movw r12, r22 cc88: 7c 01 movw r14, r24 uint32_t _previous_time = eeprom_init_default_dword((uint32_t *)EEPROM_TOTALTIME, 0); //_previous_time unit: min cc8a: 8d ee ldi r24, 0xED ; 237 cc8c: 9f e0 ldi r25, 0x0F ; 15 cc8e: 0f 94 18 7a call 0x2f430 ; 0x2f430 cc92: 4b 01 movw r8, r22 cc94: 5c 01 movw r10, r24 uint32_t time_minutes = print_job_timer.duration() / 60; cc96: 0f 94 75 3e call 0x27cea ; 0x27cea cc9a: 2c e3 ldi r18, 0x3C ; 60 cc9c: 30 e0 ldi r19, 0x00 ; 0 cc9e: 40 e0 ldi r20, 0x00 ; 0 cca0: 50 e0 ldi r21, 0x00 ; 0 cca2: 0f 94 4a dc call 0x3b894 ; 0x3b894 <__udivmodsi4> eeprom_update_dword_notify((uint32_t *)EEPROM_TOTALTIME, _previous_time + time_minutes); // EEPROM_TOTALTIME unit: min cca6: ba 01 movw r22, r20 cca8: a9 01 movw r20, r18 ccaa: 48 0d add r20, r8 ccac: 59 1d adc r21, r9 ccae: 6a 1d adc r22, r10 ccb0: 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); ccb2: 8d ee ldi r24, 0xED ; 237 ccb4: 9f e0 ldi r25, 0x0F ; 15 ccb6: 0f 94 0d dc call 0x3b81a ; 0x3b81a eeprom_update_dword_notify((uint32_t *)EEPROM_FILAMENTUSED, _previous_filament + (total_filament_used / 1000)); ccba: 60 91 64 06 lds r22, 0x0664 ; 0x800664 ccbe: 70 91 65 06 lds r23, 0x0665 ; 0x800665 ccc2: 80 91 66 06 lds r24, 0x0666 ; 0x800666 ccc6: 90 91 67 06 lds r25, 0x0667 ; 0x800667 ccca: 28 ee ldi r18, 0xE8 ; 232 cccc: 33 e0 ldi r19, 0x03 ; 3 ccce: 40 e0 ldi r20, 0x00 ; 0 ccd0: 50 e0 ldi r21, 0x00 ; 0 ccd2: 0f 94 4a dc call 0x3b894 ; 0x3b894 <__udivmodsi4> ccd6: ba 01 movw r22, r20 ccd8: a9 01 movw r20, r18 ccda: 4c 0d add r20, r12 ccdc: 5d 1d adc r21, r13 ccde: 6e 1d adc r22, r14 cce0: 7f 1d adc r23, r15 cce2: 81 ef ldi r24, 0xF1 ; 241 cce4: 9f e0 ldi r25, 0x0F ; 15 cce6: 0f 94 0d dc call 0x3b81a ; 0x3b81a print_job_timer.reset(); ccea: 0f 94 2d 42 call 0x2845a ; 0x2845a total_filament_used = 0; ccee: 10 92 64 06 sts 0x0664, r1 ; 0x800664 ccf2: 10 92 65 06 sts 0x0665, r1 ; 0x800665 ccf6: 10 92 66 06 sts 0x0666, r1 ; 0x800666 ccfa: 10 92 67 06 sts 0x0667, r1 ; 0x800667 if (MMU2::mmu2.Enabled()) { ccfe: 80 91 b9 13 lds r24, 0x13B9 ; 0x8013b9 cd02: 81 30 cpi r24, 0x01 ; 1 cd04: 81 f4 brne .+32 ; 0xcd26 eeprom_add_dword((uint32_t *)EEPROM_MMU_MATERIAL_CHANGES, MMU2::mmu2.ToolChangeCounter()); cd06: 60 91 bd 13 lds r22, 0x13BD ; 0x8013bd cd0a: 70 91 be 13 lds r23, 0x13BE ; 0x8013be cd0e: 90 e0 ldi r25, 0x00 ; 0 cd10: 80 e0 ldi r24, 0x00 ; 0 cd12: 0f 94 00 7a call 0x2f400 ; 0x2f400 /// @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; }; cd16: 10 92 be 13 sts 0x13BE, r1 ; 0x8013be cd1a: 10 92 bd 13 sts 0x13BD, r1 ; 0x8013bd inline uint16_t TMCFailures() const { return tmcFailures; } inline void IncrementTMCFailures() { ++tmcFailures; } inline void ClearTMCFailures() { tmcFailures = 0; } cd1e: 10 92 c0 13 sts 0x13C0, r1 ; 0x8013c0 cd22: 10 92 bf 13 sts 0x13BF, r1 ; 0x8013bf // @@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 } } cd26: ff 90 pop r15 cd28: ef 90 pop r14 cd2a: df 90 pop r13 cd2c: cf 90 pop r12 cd2e: bf 90 pop r11 cd30: af 90 pop r10 cd32: 9f 90 pop r9 cd34: 8f 90 pop r8 cd36: 08 95 ret 0000cd38 : } #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); cd38: 80 91 e5 03 lds r24, 0x03E5 ; 0x8003e5 cd3c: 1f 92 push r1 cd3e: 8f 93 push r24 cd40: 80 91 69 03 lds r24, 0x0369 ; 0x800369 cd44: 1f 92 push r1 cd46: 8f 93 push r24 cd48: e7 ec ldi r30, 0xC7 ; 199 cd4a: f3 e0 ldi r31, 0x03 ; 3 cd4c: 42 81 ldd r20, Z+2 ; 0x02 cd4e: 53 81 ldd r21, Z+3 ; 0x03 cd50: 2c e3 ldi r18, 0x3C ; 60 cd52: 24 9f mul r18, r20 cd54: c0 01 movw r24, r0 cd56: 25 9f mul r18, r21 cd58: 90 0d add r25, r0 cd5a: 11 24 eor r1, r1 cd5c: 9f 93 push r25 cd5e: 8f 93 push r24 cd60: 40 81 ld r20, Z cd62: 51 81 ldd r21, Z+1 ; 0x01 cd64: 24 9f mul r18, r20 cd66: c0 01 movw r24, r0 cd68: 25 9f mul r18, r21 cd6a: 90 0d add r25, r0 cd6c: 11 24 eor r1, r1 cd6e: 9f 93 push r25 cd70: 8f 93 push r24 cd72: 8a e7 ldi r24, 0x7A ; 122 cd74: 96 e6 ldi r25, 0x66 ; 102 cd76: 9f 93 push r25 cd78: 8f 93 push r24 cd7a: 0f 94 99 da call 0x3b532 ; 0x3b532 cd7e: 8d b7 in r24, 0x3d ; 61 cd80: 9e b7 in r25, 0x3e ; 62 cd82: 0a 96 adiw r24, 0x0a ; 10 cd84: 0f b6 in r0, 0x3f ; 63 cd86: f8 94 cli cd88: 9e bf out 0x3e, r25 ; 62 cd8a: 0f be out 0x3f, r0 ; 63 cd8c: 8d bf out 0x3d, r24 ; 61 } cd8e: 08 95 ret 0000cd90 : // Be safe than sorry, reset the stepper timer before re-enabling interrupts. st_reset_timer(); sei(); } void force_high_power_mode(bool start_high_power_section) { cd90: cf 93 push r28 cd92: c8 2f mov r28, r24 #ifdef PSU_Delta if (start_high_power_section == true) enable_force_z(); #endif //PSU_Delta uint8_t silent; silent = eeprom_read_byte((uint8_t*)EEPROM_SILENT); cd94: 8f ef ldi r24, 0xFF ; 255 cd96: 9f e0 ldi r25, 0x0F ; 15 cd98: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae if (silent == 1 || tmc2130_mode == TMC2130_MODE_SILENT) { cd9c: 81 30 cpi r24, 0x01 ; 1 cd9e: 21 f0 breq .+8 ; 0xcda8 cda0: 80 91 8b 06 lds r24, 0x068B ; 0x80068b cda4: 81 30 cpi r24, 0x01 ; 1 cda6: 29 f4 brne .+10 ; 0xcdb2 //we are in silent mode, set to normal mode to enable crash detection change_power_mode_live((start_high_power_section == true) ? TMC2130_MODE_NORMAL : TMC2130_MODE_SILENT); cda8: 81 e0 ldi r24, 0x01 ; 1 cdaa: 8c 27 eor r24, r28 } } cdac: cf 91 pop r28 #endif //PSU_Delta uint8_t silent; silent = eeprom_read_byte((uint8_t*)EEPROM_SILENT); if (silent == 1 || tmc2130_mode == TMC2130_MODE_SILENT) { //we are in silent mode, set to normal mode to enable crash detection change_power_mode_live((start_high_power_section == true) ? TMC2130_MODE_NORMAL : TMC2130_MODE_SILENT); cdae: 0c 94 a1 60 jmp 0xc142 ; 0xc142 } } cdb2: cf 91 pop r28 cdb4: 08 95 ret 0000cdb6 : endstops_hit_on_purpose(); } void refresh_cmd_timeout(void) { previous_millis_cmd.start(); cdb6: 84 e8 ldi r24, 0x84 ; 132 cdb8: 93 e0 ldi r25, 0x03 ; 3 cdba: 0d 94 c5 2b jmp 0x2578a ; 0x2578a ::start()> 0000cdbe : } } #endif //TMC2130 float __attribute__((noinline)) get_feedrate_mm_s(const float feedrate_mm_min) { return feedrate_mm_min / 60.f; cdbe: 20 e0 ldi r18, 0x00 ; 0 cdc0: 30 e0 ldi r19, 0x00 ; 0 cdc2: 40 e7 ldi r20, 0x70 ; 112 cdc4: 52 e4 ldi r21, 0x42 ; 66 cdc6: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> } cdca: 08 95 ret 0000cdcc : } bool enable_endstops(bool check) { bool old = check_endstops; check_endstops = check; cdcc: 10 92 b7 02 sts 0x02B7, r1 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> //! @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; cdd0: 40 91 64 03 lds r20, 0x0364 ; 0x800364 cdd4: 50 91 65 03 lds r21, 0x0365 ; 0x800365 cdd8: 60 91 66 03 lds r22, 0x0366 ; 0x800366 cddc: 70 91 67 03 lds r23, 0x0367 ; 0x800367 cde0: 40 93 b8 02 sts 0x02B8, r20 ; 0x8002b8 cde4: 50 93 b9 02 sts 0x02B9, r21 ; 0x8002b9 cde8: 60 93 ba 02 sts 0x02BA, r22 ; 0x8002ba cdec: 70 93 bb 02 sts 0x02BB, r23 ; 0x8002bb feedmultiply = original_feedmultiply; cdf0: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a cdf4: 80 93 39 02 sts 0x0239, r24 ; 0x800239 previous_millis_cmd.start(); cdf8: 84 e8 ldi r24, 0x84 ; 132 cdfa: 93 e0 ldi r25, 0x03 ; 3 cdfc: 0d 94 c5 2b jmp 0x2578a ; 0x2578a ::start()> 0000ce00 : 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) { ce00: 1f 93 push r17 ce02: cf 93 push r28 ce04: df 93 push r29 ce06: 18 2f mov r17, r24 saved_feedrate = feedrate; ce08: 80 91 b8 02 lds r24, 0x02B8 ; 0x8002b8 ce0c: 90 91 b9 02 lds r25, 0x02B9 ; 0x8002b9 ce10: a0 91 ba 02 lds r26, 0x02BA ; 0x8002ba ce14: b0 91 bb 02 lds r27, 0x02BB ; 0x8002bb ce18: 80 93 64 03 sts 0x0364, r24 ; 0x800364 ce1c: 90 93 65 03 sts 0x0365, r25 ; 0x800365 ce20: a0 93 66 03 sts 0x0366, r26 ; 0x800366 ce24: b0 93 67 03 sts 0x0367, r27 ; 0x800367 int l_feedmultiply = feedmultiply; ce28: c0 91 39 02 lds r28, 0x0239 ; 0x800239 ce2c: d0 91 3a 02 lds r29, 0x023A ; 0x80023a feedmultiply = 100; ce30: 84 e6 ldi r24, 0x64 ; 100 ce32: 90 e0 ldi r25, 0x00 ; 0 ce34: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a ce38: 80 93 39 02 sts 0x0239, r24 ; 0x800239 previous_millis_cmd.start(); ce3c: 84 e8 ldi r24, 0x84 ; 132 ce3e: 93 e0 ldi r25, 0x03 ; 3 ce40: 0f 94 c5 2b call 0x2578a ; 0x2578a ::start()> ce44: 10 93 b7 02 sts 0x02B7, r17 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> enable_endstops(enable_endstops_now); return l_feedmultiply; } ce48: ce 01 movw r24, r28 ce4a: df 91 pop r29 ce4c: cf 91 pop r28 ce4e: 1f 91 pop r17 ce50: 08 95 ret 0000ce52 : ce52: 40 e0 ldi r20, 0x00 ; 0 ce54: 50 e0 ldi r21, 0x00 ; 0 ce56: ba 01 movw r22, r20 ce58: 8d ee ldi r24, 0xED ; 237 ce5a: 9f e0 ldi r25, 0x0F ; 15 ce5c: 0f 94 0d dc call 0x3b81a ; 0x3b81a ce60: 40 e0 ldi r20, 0x00 ; 0 ce62: 50 e0 ldi r21, 0x00 ; 0 ce64: ba 01 movw r22, r20 ce66: 81 ef ldi r24, 0xF1 ; 241 ce68: 9f e0 ldi r25, 0x0F ; 15 ce6a: 0f 94 0d dc call 0x3b81a ; 0x3b81a 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(); ce6e: 0e 94 3c 5c call 0xb878 ; 0xb878 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); ce72: 70 e0 ldi r23, 0x00 ; 0 ce74: 60 e0 ldi r22, 0x00 ; 0 ce76: 85 e0 ldi r24, 0x05 ; 5 ce78: 9f e0 ldi r25, 0x0F ; 15 ce7a: 0f 94 19 dc call 0x3b832 ; 0x3b832 ce7e: 70 e0 ldi r23, 0x00 ; 0 ce80: 60 e0 ldi r22, 0x00 ; 0 ce82: 83 e0 ldi r24, 0x03 ; 3 ce84: 9f e0 ldi r25, 0x0F ; 15 ce86: 0f 94 19 dc call 0x3b832 ; 0x3b832 ce8a: 70 e0 ldi r23, 0x00 ; 0 ce8c: 60 e0 ldi r22, 0x00 ; 0 ce8e: 81 e0 ldi r24, 0x01 ; 1 ce90: 9f e0 ldi r25, 0x0F ; 15 ce92: 0f 94 19 dc call 0x3b832 ; 0x3b832 ce96: 70 e0 ldi r23, 0x00 ; 0 ce98: 60 e0 ldi r22, 0x00 ; 0 ce9a: 8f ef ldi r24, 0xFF ; 255 ce9c: 9e e0 ldi r25, 0x0E ; 14 ce9e: 0f 94 19 dc call 0x3b832 ; 0x3b832 cea2: 70 e0 ldi r23, 0x00 ; 0 cea4: 60 e0 ldi r22, 0x00 ; 0 cea6: 83 ed ldi r24, 0xD3 ; 211 cea8: 9e e0 ldi r25, 0x0E ; 14 ceaa: 0f 94 19 dc call 0x3b832 ; 0x3b832 ceae: 70 e0 ldi r23, 0x00 ; 0 ceb0: 60 e0 ldi r22, 0x00 ; 0 ceb2: 80 ed ldi r24, 0xD0 ; 208 ceb4: 9e e0 ldi r25, 0x0E ; 14 ceb6: 0f 94 19 dc call 0x3b832 ; 0x3b832 if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); ceba: 40 e0 ldi r20, 0x00 ; 0 cebc: 50 e0 ldi r21, 0x00 ; 0 cebe: ba 01 movw r22, r20 cec0: 88 ea ldi r24, 0xA8 ; 168 cec2: 9c e0 ldi r25, 0x0C ; 12 cec4: 0d 94 0d dc jmp 0x3b81a ; 0x3b81a 0000cec8 : wdt_disable(); } } void softReset(void) { cli(); cec8: 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" ); ceca: 88 e1 ldi r24, 0x18 ; 24 cecc: 98 e0 ldi r25, 0x08 ; 8 cece: 0f b6 in r0, 0x3f ; 63 ced0: f8 94 cli ced2: a8 95 wdr ced4: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> ced8: 0f be out 0x3f, r0 ; 63 ceda: 90 93 60 00 sts 0x0060, r25 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> cede: ff cf rjmp .-2 ; 0xcede 0000cee0 : #endif //EMERGENCY_HANDLERS #endif //WATCHDOG } static inline void crash_and_burn(dump_crash_reason reason) { cee0: c8 2f mov r28, r24 WRITE(BEEPER, HIGH); cee2: 9f b7 in r25, 0x3f ; 63 cee4: f8 94 cli cee6: e2 e0 ldi r30, 0x02 ; 2 cee8: f1 e0 ldi r31, 0x01 ; 1 ceea: 80 81 ld r24, Z ceec: 84 60 ori r24, 0x04 ; 4 ceee: 80 83 st Z, r24 cef0: 9f bf out 0x3f, r25 ; 63 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); cef2: 6c 2f mov r22, r28 cef4: 83 e0 ldi r24, 0x03 ; 3 cef6: 9d e0 ldi r25, 0x0D ; 13 cef8: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 eeprom_update_byte_notify((uint8_t*)EEPROM_FW_CRASH_FLAG, (uint8_t)reason); #ifdef EMERGENCY_DUMP xfdump_full_dump_and_reset(reason); cefc: 8c 2f mov r24, r28 cefe: 0e 94 97 ed call 0x1db2e ; 0x1db2e #elif defined(EMERGENCY_SERIAL_DUMP) if(emergency_serial_dump) serial_dump_and_reset(reason); #endif softReset(); cf02: 0e 94 64 67 call 0xcec8 ; 0xcec8 0000cf06 <__vector_default>: crash_and_burn(dump_crash_reason::watchdog); } #endif ISR(BADISR_vect) { cf06: 1f 92 push r1 cf08: 0f 92 push r0 cf0a: 0f b6 in r0, 0x3f ; 63 cf0c: 0f 92 push r0 cf0e: 11 24 eor r1, r1 crash_and_burn(dump_crash_reason::bad_isr); cf10: 83 e0 ldi r24, 0x03 ; 3 cf12: 0e 94 70 67 call 0xcee0 ; 0xcee0 0000cf16 <__vector_12>: } #ifdef EMERGENCY_HANDLERS #ifdef WATCHDOG ISR(WDT_vect) { cf16: 1f 92 push r1 cf18: 0f 92 push r0 cf1a: 0f b6 in r0, 0x3f ; 63 cf1c: 0f 92 push r0 cf1e: 11 24 eor r1, r1 crash_and_burn(dump_crash_reason::watchdog); cf20: 82 e0 ldi r24, 0x02 ; 2 cf22: 0e 94 70 67 call 0xcee0 ; 0xcee0 0000cf26 : } #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); cf26: 85 ea ldi r24, 0xA5 ; 165 cf28: 9f e0 ldi r25, 0x0F ; 15 cf2a: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae cf2e: 91 e0 ldi r25, 0x01 ; 1 cf30: 81 11 cpse r24, r1 cf32: 01 c0 rjmp .+2 ; 0xcf36 cf34: 90 e0 ldi r25, 0x00 ; 0 } cf36: 89 2f mov r24, r25 cf38: 08 95 ret 0000cf3a : 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(); cf3a: 80 91 e2 03 lds r24, 0x03E2 ; 0x8003e2 cf3e: 81 11 cpse r24, r1 cf40: 06 c0 rjmp .+12 ; 0xcf4e cf42: 81 e0 ldi r24, 0x01 ; 1 cf44: 90 91 9b 03 lds r25, 0x039B ; 0x80039b cf48: 92 30 cpi r25, 0x02 ; 2 cf4a: 09 f0 breq .+2 ; 0xcf4e cf4c: 80 e0 ldi r24, 0x00 ; 0 } cf4e: 08 95 ret 0000cf50 : WRITE(SUICIDE_PIN, LOW); #endif } bool __attribute__((noinline)) printJobOngoing() { return (IS_SD_PRINTING || usb_timer.running() || print_job_timer.isRunning()); cf50: 80 91 8f 14 lds r24, 0x148F ; 0x80148f cf54: 81 11 cpse r24, r1 cf56: 0a c0 rjmp .+20 ; 0xcf6c cf58: 80 91 0d 05 lds r24, 0x050D ; 0x80050d cf5c: 81 11 cpse r24, r1 cf5e: 06 c0 rjmp .+12 ; 0xcf6c cf60: 81 e0 ldi r24, 0x01 ; 1 cf62: 90 91 9b 03 lds r25, 0x039B ; 0x80039b cf66: 91 30 cpi r25, 0x01 ; 1 cf68: 09 f0 breq .+2 ; 0xcf6c cf6a: 80 e0 ldi r24, 0x00 ; 0 } cf6c: 08 95 ret 0000cf6e : && !mesh_bed_leveling_flag && !homing_flag && e_active(); } bool __attribute__((noinline)) babystep_allowed() { cf6e: cf 93 push r28 cf70: df 93 push r29 return ( !homing_flag cf72: c0 91 a6 0d lds r28, 0x0DA6 ; 0x800da6 && !mesh_bed_leveling_flag && !printingIsPaused() && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) cf76: c1 11 cpse r28, r1 cf78: 1f c0 rjmp .+62 ; 0xcfb8 && e_active(); } bool __attribute__((noinline)) babystep_allowed() { return ( !homing_flag && !mesh_bed_leveling_flag cf7a: 80 91 a7 0d lds r24, 0x0DA7 ; 0x800da7 cf7e: 81 11 cpse r24, r1 cf80: 1c c0 rjmp .+56 ; 0xcfba && !printingIsPaused() cf82: 0e 94 9d 67 call 0xcf3a ; 0xcf3a cf86: 81 11 cpse r24, r1 cf88: 18 c0 rjmp .+48 ; 0xcfba && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) cf8a: d0 91 b3 0d lds r29, 0x0DB3 ; 0x800db3 cf8e: d4 30 cpi r29, 0x04 ; 4 cf90: 61 f4 brne .+24 ; 0xcfaa cf92: 80 91 b5 0d lds r24, 0x0DB5 ; 0x800db5 cf96: 90 91 b6 0d lds r25, 0x0DB6 ; 0x800db6 cf9a: 89 2b or r24, r25 cf9c: 91 f4 brne .+36 ; 0xcfc2 cf9e: 80 91 71 06 lds r24, 0x0671 ; 0x800671 cfa2: 90 91 72 06 lds r25, 0x0672 ; 0x800672 cfa6: 89 2b or r24, r25 cfa8: 61 f4 brne .+24 ; 0xcfc2 || printJobOngoing() cfaa: 0e 94 a8 67 call 0xcf50 ; 0xcf50 cfae: c8 2f mov r28, r24 cfb0: 81 11 cpse r24, r1 cfb2: 03 c0 rjmp .+6 ; 0xcfba || lcd_commands_type == LcdCommands::Idle cfb4: c1 e0 ldi r28, 0x01 ; 1 cfb6: 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) cfb8: c0 e0 ldi r28, 0x00 ; 0 || printJobOngoing() || lcd_commands_type == LcdCommands::Idle ) ); } cfba: 8c 2f mov r24, r28 cfbc: df 91 pop r29 cfbe: cf 91 pop r28 cfc0: 08 95 ret bool __attribute__((noinline)) babystep_allowed() { return ( !homing_flag && !mesh_bed_leveling_flag && !printingIsPaused() && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) cfc2: c1 e0 ldi r28, 0x01 ; 1 cfc4: fa cf rjmp .-12 ; 0xcfba 0000cfc6 : ) ); } bool __attribute__((noinline)) babystep_allowed_strict() { return ( babystep_allowed() && current_position[Z_AXIS] < Z_HEIGHT_HIDE_LIVE_ADJUST_MENU); cfc6: 0e 94 b7 67 call 0xcf6e ; 0xcf6e cfca: 88 23 and r24, r24 cfcc: 89 f0 breq .+34 ; 0xcff0 cfce: 20 e0 ldi r18, 0x00 ; 0 cfd0: 30 e0 ldi r19, 0x00 ; 0 cfd2: 40 e0 ldi r20, 0x00 ; 0 cfd4: 50 e4 ldi r21, 0x40 ; 64 cfd6: 60 91 99 06 lds r22, 0x0699 ; 0x800699 cfda: 70 91 9a 06 lds r23, 0x069A ; 0x80069a cfde: 80 91 9b 06 lds r24, 0x069B ; 0x80069b cfe2: 90 91 9c 06 lds r25, 0x069C ; 0x80069c cfe6: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> cfea: 88 1f adc r24, r24 cfec: 88 27 eor r24, r24 cfee: 88 1f adc r24, r24 } cff0: 08 95 ret 0000cff2 : bool printingIsPaused() { return did_pause_print || print_job_timer.isPaused(); } bool __attribute__((noinline)) printer_active() { return printJobOngoing() cff2: 0e 94 a8 67 call 0xcf50 ; 0xcf50 || printingIsPaused() || saved_printing || (lcd_commands_type != LcdCommands::Idle) || MMU2::mmu2.MMU_PRINT_SAVED() || homing_flag || mesh_bed_leveling_flag; cff6: 81 11 cpse r24, r1 cff8: 18 c0 rjmp .+48 ; 0xd02a return did_pause_print || print_job_timer.isPaused(); } bool __attribute__((noinline)) printer_active() { return printJobOngoing() || printingIsPaused() cffa: 0e 94 9d 67 call 0xcf3a ; 0xcf3a cffe: 81 11 cpse r24, r1 d000: 14 c0 rjmp .+40 ; 0xd02a || saved_printing d002: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 d006: 81 11 cpse r24, r1 d008: 10 c0 rjmp .+32 ; 0xd02a || (lcd_commands_type != LcdCommands::Idle) d00a: 80 91 b3 0d lds r24, 0x0DB3 ; 0x800db3 d00e: 81 11 cpse r24, r1 d010: 0b c0 rjmp .+22 ; 0xd028 || MMU2::mmu2.MMU_PRINT_SAVED() d012: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba d016: 81 11 cpse r24, r1 d018: 07 c0 rjmp .+14 ; 0xd028 || homing_flag d01a: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 d01e: 81 11 cpse r24, r1 d020: 04 c0 rjmp .+8 ; 0xd02a || mesh_bed_leveling_flag; d022: 80 91 a7 0d lds r24, 0x0DA7 ; 0x800da7 d026: 08 95 ret d028: 81 e0 ldi r24, 0x01 ; 1 } d02a: 08 95 ret 0000d02c : // accordingly refreshCurrentScaling(); } void __attribute__((noinline)) setiHold(uint8_t ih) { iHold = vSense ? ih : ih >> 1; d02c: fc 01 movw r30, r24 d02e: 20 81 ld r18, Z d030: 21 11 cpse r18, r1 d032: 01 c0 rjmp .+2 ; 0xd036 d034: 66 95 lsr r22 d036: fc 01 movw r30, r24 d038: 62 83 std Z+2, r22 ; 0x02 // Note that iHold cannot change the vSense bit. If iHold is larger // than iRun, then iHold is truncated later in SetCurrents() } d03a: 08 95 ret 0000d03c : inline uint8_t getOriginaliRun() const { return vSense ? iRun : iRun << 1; } inline uint8_t getOriginaliHold() const { return min(vSense ? iHold : iHold << 1, getOriginaliRun()); } inline bool iHoldIsClamped() const { return iHold > iRun; } inline uint8_t getvSense() const { return vSense; } void __attribute__((noinline)) setiRun(uint8_t ir) { d03c: fc 01 movw r30, r24 iRun = ir; d03e: 61 83 std Z+1, r22 ; 0x01 void refreshCurrentScaling() { // IMPORTANT: iRun must have range 0 to 63 (2^6) so we can properly // update the current scaling back and forth // Detect new vSense value const bool newvSense = (iRun < 32); d040: 21 e0 ldi r18, 0x01 ; 1 d042: 60 32 cpi r22, 0x20 ; 32 d044: 08 f0 brcs .+2 ; 0xd048 d046: 20 e0 ldi r18, 0x00 ; 0 if (vSense != newvSense) { d048: 90 81 ld r25, Z d04a: 29 17 cp r18, r25 d04c: 81 f0 breq .+32 ; 0xd06e d04e: 82 81 ldd r24, Z+2 ; 0x02 // Update currents to match current scaling if (vSense) { d050: 99 23 and r25, r25 d052: 51 f0 breq .+20 ; 0xd068 // vSense was 1 [V_FS = 0.32V] but is changing to 0 [V_FS = 0.18V] // Half both current values to be in sync with current scale range iHold >>= 1; d054: 90 e0 ldi r25, 0x00 ; 0 d056: 95 95 asr r25 d058: 87 95 ror r24 d05a: 82 83 std Z+2, r24 ; 0x02 iRun >>= 1; d05c: 70 e0 ldi r23, 0x00 ; 0 d05e: 75 95 asr r23 d060: 67 95 ror r22 d062: 61 83 std Z+1, r22 ; 0x01 // Keep in mind, only a change in iRun can change vSense. iHold <<= 1; } // Update vSense vSense = newvSense; d064: 20 83 st Z, r18 d066: 08 95 ret } else { // vSense was 0 [V_FS = 0.18V], but is changing to 1 [V_FS = 0.32V] // double the Hold current value // iRun is expected to already be correct so no shift needed. // Keep in mind, only a change in iRun can change vSense. iHold <<= 1; d068: 88 0f add r24, r24 d06a: 82 83 std Z+2, r24 ; 0x02 d06c: fb cf rjmp .-10 ; 0xd064 } // Update vSense vSense = newvSense; } else if (!vSense) { d06e: 21 11 cpse r18, r1 d070: 04 c0 rjmp .+8 ; 0xd07a // No change in vSense, but vSense = 0, which means we must scale down the iRun value // from range [0, 63] to range [0, 31] iRun >>= 1; d072: 70 e0 ldi r23, 0x00 ; 0 d074: 75 95 asr r23 d076: 67 95 ror r22 d078: 61 83 std Z+1, r22 ; 0x01 iRun = ir; // Refresh the vSense bit and take care of updating Hold/Run currents // accordingly refreshCurrentScaling(); } d07a: 08 95 ret 0000d07c : } #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; } d07c: 20 91 91 12 lds r18, 0x1291 ; 0x801291 d080: 30 91 92 12 lds r19, 0x1292 ; 0x801292 d084: bc 01 movw r22, r24 d086: c9 01 movw r24, r18 d088: 89 55 subi r24, 0x59 ; 89 d08a: 9f 4e sbci r25, 0xEF ; 239 d08c: 0f 94 de d9 call 0x3b3bc ; 0x3b3bc d090: 9c 01 movw r18, r24 d092: 90 93 94 03 sts 0x0394, r25 ; 0x800394 d096: 80 93 93 03 sts 0x0393, r24 ; 0x800393 d09a: 81 e0 ldi r24, 0x01 ; 1 d09c: 23 2b or r18, r19 d09e: 09 f4 brne .+2 ; 0xd0a2 d0a0: 80 e0 ldi r24, 0x00 ; 0 d0a2: 08 95 ret 0000d0a4 : inline void set_destination_to_current() { memcpy(destination, current_position, sizeof(destination)); } d0a4: 80 e1 ldi r24, 0x10 ; 16 d0a6: e1 e9 ldi r30, 0x91 ; 145 d0a8: f6 e0 ldi r31, 0x06 ; 6 d0aa: a3 e7 ldi r26, 0x73 ; 115 d0ac: b6 e0 ldi r27, 0x06 ; 6 d0ae: 01 90 ld r0, Z+ d0b0: 0d 92 st X+, r0 d0b2: 8a 95 dec r24 d0b4: e1 f7 brne .-8 ; 0xd0ae d0b6: 08 95 ret 0000d0b8 : //! //! Internally lcd_update() is called by wait_for_heater(). //! //! @param e_move void restore_print_from_ram_and_continue(float e_move) { d0b8: 4f 92 push r4 d0ba: 5f 92 push r5 d0bc: 6f 92 push r6 d0be: 7f 92 push r7 d0c0: 8f 92 push r8 d0c2: 9f 92 push r9 d0c4: af 92 push r10 d0c6: bf 92 push r11 d0c8: cf 92 push r12 d0ca: df 92 push r13 d0cc: ef 92 push r14 d0ce: ff 92 push r15 d0d0: 0f 93 push r16 d0d2: 1f 93 push r17 d0d4: cf 93 push r28 d0d6: df 93 push r29 d0d8: 00 d0 rcall .+0 ; 0xd0da d0da: 00 d0 rcall .+0 ; 0xd0dc d0dc: 1f 92 push r1 d0de: 1f 92 push r1 d0e0: cd b7 in r28, 0x3d ; 61 d0e2: de b7 in r29, 0x3e ; 62 if (!saved_printing) return; d0e4: 20 91 a8 0d lds r18, 0x0DA8 ; 0x800da8 d0e8: 22 23 and r18, r18 d0ea: 09 f4 brne .+2 ; 0xd0ee d0ec: 73 c1 rjmp .+742 ; 0xd3d4 #ifdef FANCHECK // Do not allow resume printing if fans are still not ok if (fan_check_error == EFCE_REPORTED) return; d0ee: 20 91 e4 03 lds r18, 0x03E4 ; 0x8003e4 d0f2: 22 30 cpi r18, 0x02 ; 2 d0f4: 09 f4 brne .+2 ; 0xd0f8 d0f6: 6e c1 rjmp .+732 ; 0xd3d4 if (fan_check_error == EFCE_FIXED) fan_check_error = EFCE_OK; //reenable serial stream processing if printing from usb d0f8: 20 91 e4 03 lds r18, 0x03E4 ; 0x8003e4 d0fc: 21 30 cpi r18, 0x01 ; 1 d0fe: 11 f4 brne .+4 ; 0xd104 d100: 10 92 e4 03 sts 0x03E4, r1 ; 0x8003e4 d104: 2b 01 movw r4, r22 d106: 3c 01 movw r6, r24 #endif // Make sure fan is turned off fanSpeed = 0; d108: 10 92 e5 03 sts 0x03E5, r1 ; 0x8003e5 // restore bed temperature (bed can be disabled during a thermal warning) if ((uint8_t)degBed() != saved_bed_temperature) d10c: 10 91 ad 05 lds r17, 0x05AD ; 0x8005ad d110: 60 91 ed 04 lds r22, 0x04ED ; 0x8004ed d114: 70 91 ee 04 lds r23, 0x04EE ; 0x8004ee d118: 80 91 ef 04 lds r24, 0x04EF ; 0x8004ef d11c: 90 91 f0 04 lds r25, 0x04F0 ; 0x8004f0 d120: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> d124: 61 17 cp r22, r17 d126: 31 f0 breq .+12 ; 0xd134 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; d128: 81 2f mov r24, r17 d12a: 90 e0 ldi r25, 0x00 ; 0 d12c: 90 93 72 06 sts 0x0672, r25 ; 0x800672 d130: 80 93 71 06 sts 0x0671, r24 ; 0x800671 setTargetBed(saved_bed_temperature); restore_extruder_temperature_from_ram(); d134: 0e 94 e1 64 call 0xc9c2 ; 0xc9c2 // Restore saved fan speed fanSpeed = saved_fan_speed; d138: 80 91 aa 05 lds r24, 0x05AA ; 0x8005aa d13c: 80 93 e5 03 sts 0x03E5, r24 ; 0x8003e5 axis_relative_modes ^= (-saved_extruder_relative_mode ^ axis_relative_modes) & E_AXIS_MASK; d140: 90 91 e3 03 lds r25, 0x03E3 ; 0x8003e3 d144: 80 91 63 05 lds r24, 0x0563 ; 0x800563 d148: 81 95 neg r24 d14a: 89 27 eor r24, r25 d14c: 88 70 andi r24, 0x08 ; 8 d14e: 89 27 eor r24, r25 d150: 80 93 e3 03 sts 0x03E3, r24 ; 0x8003e3 float e = saved_pos[E_AXIS] - e_move; d154: a3 01 movw r20, r6 d156: 92 01 movw r18, r4 d158: 60 91 7f 02 lds r22, 0x027F ; 0x80027f d15c: 70 91 80 02 lds r23, 0x0280 ; 0x800280 d160: 80 91 81 02 lds r24, 0x0281 ; 0x800281 d164: 90 91 82 02 lds r25, 0x0282 ; 0x800282 d168: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> d16c: 6d 83 std Y+5, r22 ; 0x05 d16e: 7e 83 std Y+6, r23 ; 0x06 d170: 8f 83 std Y+7, r24 ; 0x07 d172: 98 87 std Y+8, r25 ; 0x08 plan_set_e_position(e); d174: ce 01 movw r24, r28 d176: 05 96 adiw r24, 0x05 ; 5 d178: 0f 94 79 63 call 0x2c6f2 ; 0x2c6f2 #ifdef FANCHECK fans_check_enabled = false; d17c: 10 92 38 02 sts 0x0238, r1 ; 0x800238 #endif // do not restore XY for commands that do not require that if (saved_pos[X_AXIS] == X_COORD_INVALID) d180: 20 e0 ldi r18, 0x00 ; 0 d182: 30 e0 ldi r19, 0x00 ; 0 d184: 40 e8 ldi r20, 0x80 ; 128 d186: 5f eb ldi r21, 0xBF ; 191 d188: 60 91 73 02 lds r22, 0x0273 ; 0x800273 d18c: 70 91 74 02 lds r23, 0x0274 ; 0x800274 d190: 80 91 75 02 lds r24, 0x0275 ; 0x800275 d194: 90 91 76 02 lds r25, 0x0276 ; 0x800276 d198: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> d19c: 81 11 cpse r24, r1 d19e: 20 c0 rjmp .+64 ; 0xd1e0 { saved_pos[X_AXIS] = current_position[X_AXIS]; d1a0: 80 91 91 06 lds r24, 0x0691 ; 0x800691 d1a4: 90 91 92 06 lds r25, 0x0692 ; 0x800692 d1a8: a0 91 93 06 lds r26, 0x0693 ; 0x800693 d1ac: b0 91 94 06 lds r27, 0x0694 ; 0x800694 d1b0: 80 93 73 02 sts 0x0273, r24 ; 0x800273 d1b4: 90 93 74 02 sts 0x0274, r25 ; 0x800274 d1b8: a0 93 75 02 sts 0x0275, r26 ; 0x800275 d1bc: b0 93 76 02 sts 0x0276, r27 ; 0x800276 saved_pos[Y_AXIS] = current_position[Y_AXIS]; d1c0: 80 91 95 06 lds r24, 0x0695 ; 0x800695 d1c4: 90 91 96 06 lds r25, 0x0696 ; 0x800696 d1c8: a0 91 97 06 lds r26, 0x0697 ; 0x800697 d1cc: b0 91 98 06 lds r27, 0x0698 ; 0x800698 d1d0: 80 93 77 02 sts 0x0277, r24 ; 0x800277 d1d4: 90 93 78 02 sts 0x0278, r25 ; 0x800278 d1d8: a0 93 79 02 sts 0x0279, r26 ; 0x800279 d1dc: b0 93 7a 02 sts 0x027A, r27 ; 0x80027a } //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); d1e0: a3 01 movw r20, r6 d1e2: 92 01 movw r18, r4 d1e4: 60 91 7f 02 lds r22, 0x027F ; 0x80027f d1e8: 70 91 80 02 lds r23, 0x0280 ; 0x800280 d1ec: 80 91 81 02 lds r24, 0x0281 ; 0x800281 d1f0: 90 91 82 02 lds r25, 0x0282 ; 0x800282 d1f4: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> d1f8: 69 83 std Y+1, r22 ; 0x01 d1fa: 7a 83 std Y+2, r23 ; 0x02 d1fc: 8b 83 std Y+3, r24 ; 0x03 d1fe: 9c 83 std Y+4, r25 ; 0x04 d200: e0 90 99 06 lds r14, 0x0699 ; 0x800699 d204: f0 90 9a 06 lds r15, 0x069A ; 0x80069a d208: 00 91 9b 06 lds r16, 0x069B ; 0x80069b d20c: 10 91 9c 06 lds r17, 0x069C ; 0x80069c d210: 20 91 77 02 lds r18, 0x0277 ; 0x800277 d214: 30 91 78 02 lds r19, 0x0278 ; 0x800278 d218: 40 91 79 02 lds r20, 0x0279 ; 0x800279 d21c: 50 91 7a 02 lds r21, 0x027A ; 0x80027a d220: 60 91 73 02 lds r22, 0x0273 ; 0x800273 d224: 70 91 74 02 lds r23, 0x0274 ; 0x800274 d228: 80 91 75 02 lds r24, 0x0275 ; 0x800275 d22c: 90 91 76 02 lds r25, 0x0276 ; 0x800276 d230: 1f 92 push r1 d232: 1f 92 push r1 d234: 1f 92 push r1 d236: 1f 92 push r1 d238: e2 e6 ldi r30, 0x62 ; 98 d23a: 8e 2e mov r8, r30 d23c: e7 e2 ldi r30, 0x27 ; 39 d23e: 9e 2e mov r9, r30 d240: e6 e7 ldi r30, 0x76 ; 118 d242: ae 2e mov r10, r30 d244: e2 e4 ldi r30, 0x42 ; 66 d246: be 2e mov r11, r30 d248: fe 01 movw r30, r28 d24a: 31 96 adiw r30, 0x01 ; 1 d24c: 6f 01 movw r12, r30 d24e: 0f 94 af b0 call 0x3615e ; 0x3615e //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); d252: a3 01 movw r20, r6 d254: 92 01 movw r18, r4 d256: 60 91 7f 02 lds r22, 0x027F ; 0x80027f d25a: 70 91 80 02 lds r23, 0x0280 ; 0x800280 d25e: 80 91 81 02 lds r24, 0x0281 ; 0x800281 d262: 90 91 82 02 lds r25, 0x0282 ; 0x800282 d266: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> d26a: 69 83 std Y+1, r22 ; 0x01 d26c: 7a 83 std Y+2, r23 ; 0x02 d26e: 8b 83 std Y+3, r24 ; 0x03 d270: 9c 83 std Y+4, r25 ; 0x04 d272: e0 90 7b 02 lds r14, 0x027B ; 0x80027b d276: f0 90 7c 02 lds r15, 0x027C ; 0x80027c d27a: 00 91 7d 02 lds r16, 0x027D ; 0x80027d d27e: 10 91 7e 02 lds r17, 0x027E ; 0x80027e d282: 20 91 77 02 lds r18, 0x0277 ; 0x800277 d286: 30 91 78 02 lds r19, 0x0278 ; 0x800278 d28a: 40 91 79 02 lds r20, 0x0279 ; 0x800279 d28e: 50 91 7a 02 lds r21, 0x027A ; 0x80027a d292: 60 91 73 02 lds r22, 0x0273 ; 0x800273 d296: 70 91 74 02 lds r23, 0x0274 ; 0x800274 d29a: 80 91 75 02 lds r24, 0x0275 ; 0x800275 d29e: 90 91 76 02 lds r25, 0x0276 ; 0x800276 d2a2: 1f 92 push r1 d2a4: 1f 92 push r1 d2a6: 1f 92 push r1 d2a8: 1f 92 push r1 d2aa: 0f 94 af b0 call 0x3615e ; 0x3615e //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); d2ae: e0 90 7b 02 lds r14, 0x027B ; 0x80027b d2b2: f0 90 7c 02 lds r15, 0x027C ; 0x80027c d2b6: 00 91 7d 02 lds r16, 0x027D ; 0x80027d d2ba: 10 91 7e 02 lds r17, 0x027E ; 0x80027e d2be: 20 91 77 02 lds r18, 0x0277 ; 0x800277 d2c2: 30 91 78 02 lds r19, 0x0278 ; 0x800278 d2c6: 40 91 79 02 lds r20, 0x0279 ; 0x800279 d2ca: 50 91 7a 02 lds r21, 0x027A ; 0x80027a d2ce: 60 91 73 02 lds r22, 0x0273 ; 0x800273 d2d2: 70 91 74 02 lds r23, 0x0274 ; 0x800274 d2d6: 80 91 75 02 lds r24, 0x0275 ; 0x800275 d2da: 90 91 76 02 lds r25, 0x0276 ; 0x800276 d2de: 1f 92 push r1 d2e0: 1f 92 push r1 d2e2: 1f 92 push r1 d2e4: 1f 92 push r1 d2e6: 81 2c mov r8, r1 d2e8: 91 2c mov r9, r1 d2ea: f8 ee ldi r31, 0xE8 ; 232 d2ec: af 2e mov r10, r31 d2ee: f2 e4 ldi r31, 0x42 ; 66 d2f0: bf 2e mov r11, r31 d2f2: af e7 ldi r26, 0x7F ; 127 d2f4: ca 2e mov r12, r26 d2f6: a2 e0 ldi r26, 0x02 ; 2 d2f8: da 2e mov r13, r26 d2fa: 0f 94 af b0 call 0x3615e ; 0x3615e st_synchronize(); d2fe: 0f 94 a3 42 call 0x28546 ; 0x28546 #ifdef FANCHECK fans_check_enabled = true; d302: 11 e0 ldi r17, 0x01 ; 1 d304: 10 93 38 02 sts 0x0238, r17 ; 0x800238 #endif // restore original feedrate/feedmultiply _after_ restoring the extruder position feedrate = saved_feedrate2; d308: 60 91 5d 05 lds r22, 0x055D ; 0x80055d d30c: 70 91 5e 05 lds r23, 0x055E ; 0x80055e d310: 90 e0 ldi r25, 0x00 ; 0 d312: 80 e0 ldi r24, 0x00 ; 0 d314: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> d318: 60 93 b8 02 sts 0x02B8, r22 ; 0x8002b8 d31c: 70 93 b9 02 sts 0x02B9, r23 ; 0x8002b9 d320: 80 93 ba 02 sts 0x02BA, r24 ; 0x8002ba d324: 90 93 bb 02 sts 0x02BB, r25 ; 0x8002bb feedmultiply = saved_feedmultiply2; d328: 80 91 6f 03 lds r24, 0x036F ; 0x80036f d32c: 90 91 70 03 lds r25, 0x0370 ; 0x800370 d330: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a d334: 80 93 39 02 sts 0x0239, r24 ; 0x800239 memcpy(current_position, saved_pos, sizeof(saved_pos)); d338: 80 e1 ldi r24, 0x10 ; 16 d33a: e3 e7 ldi r30, 0x73 ; 115 d33c: f2 e0 ldi r31, 0x02 ; 2 d33e: a1 e9 ldi r26, 0x91 ; 145 d340: b6 e0 ldi r27, 0x06 ; 6 d342: 01 90 ld r0, Z+ d344: 0d 92 st X+, r0 d346: 8a 95 dec r24 d348: e1 f7 brne .-8 ; 0xd342 set_destination_to_current(); d34a: 0e 94 52 68 call 0xd0a4 ; 0xd0a4 //not sd printing nor usb printing } } void restore_print_file_state() { if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) { //was sd printing d34e: 80 91 6a 02 lds r24, 0x026A ; 0x80026a d352: 0f b6 in r0, 0x3f ; 63 d354: f8 94 cli d356: de bf out 0x3e, r29 ; 62 d358: 0f be out 0x3f, r0 ; 63 d35a: cd bf out 0x3d, r28 ; 61 d35c: 81 11 cpse r24, r1 d35e: 51 c0 rjmp .+162 ; 0xd402 card.setIndex(saved_sdpos); d360: 60 91 5f 05 lds r22, 0x055F ; 0x80055f d364: 70 91 60 05 lds r23, 0x0560 ; 0x800560 d368: 80 91 61 05 lds r24, 0x0561 ; 0x800561 d36c: 90 91 62 05 lds r25, 0x0562 ; 0x800562 { int16_t c = (int16_t)file.readFilteredGcode(); sdpos = file.curPosition(); return c; }; void setIndex(long index) {sdpos = index;file.seekSetFilteredGcode(index);}; d370: 60 93 a3 17 sts 0x17A3, r22 ; 0x8017a3 d374: 70 93 a4 17 sts 0x17A4, r23 ; 0x8017a4 d378: 80 93 a5 17 sts 0x17A5, r24 ; 0x8017a5 d37c: 90 93 a6 17 sts 0x17A6, r25 ; 0x8017a6 d380: 0f 94 57 75 call 0x2eaae ; 0x2eaae sdpos_atomic = saved_sdpos; d384: 80 91 5f 05 lds r24, 0x055F ; 0x80055f d388: 90 91 60 05 lds r25, 0x0560 ; 0x800560 d38c: a0 91 61 05 lds r26, 0x0561 ; 0x800561 d390: b0 91 62 05 lds r27, 0x0562 ; 0x800562 d394: 80 93 80 03 sts 0x0380, r24 ; 0x800380 d398: 90 93 81 03 sts 0x0381, r25 ; 0x800381 d39c: a0 93 82 03 sts 0x0382, r26 ; 0x800382 d3a0: b0 93 83 03 sts 0x0383, r27 ; 0x800383 card.sdprinting = true; d3a4: 10 93 8f 14 sts 0x148F, r17 ; 0x80148f d3a8: 60 e0 ldi r22, 0x00 ; 0 d3aa: 85 ea ldi r24, 0xA5 ; 165 d3ac: 9f e0 ldi r25, 0x0F ; 15 d3ae: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 d3b2: 60 e0 ldi r22, 0x00 ; 0 d3b4: 8f e7 ldi r24, 0x7F ; 127 d3b6: 9c e0 ldi r25, 0x0C ; 12 d3b8: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 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); d3bc: 86 eb ldi r24, 0xB6 ; 182 d3be: 90 e7 ldi r25, 0x70 ; 112 d3c0: 0e 94 38 f1 call 0x1e270 ; 0x1e270 saved_printing_type = PowerPanic::PRINT_TYPE_NONE; d3c4: 82 e0 ldi r24, 0x02 ; 2 d3c6: 80 93 6a 02 sts 0x026A, r24 ; 0x80026a saved_printing = false; d3ca: 10 92 a8 0d sts 0x0DA8, r1 ; 0x800da8 planner_aborted = true; // unroll the stack d3ce: 81 e0 ldi r24, 0x01 ; 1 d3d0: 80 93 ab 0d sts 0x0DAB, r24 ; 0x800dab } d3d4: 28 96 adiw r28, 0x08 ; 8 d3d6: 0f b6 in r0, 0x3f ; 63 d3d8: f8 94 cli d3da: de bf out 0x3e, r29 ; 62 d3dc: 0f be out 0x3f, r0 ; 63 d3de: cd bf out 0x3d, r28 ; 61 d3e0: df 91 pop r29 d3e2: cf 91 pop r28 d3e4: 1f 91 pop r17 d3e6: 0f 91 pop r16 d3e8: ff 90 pop r15 d3ea: ef 90 pop r14 d3ec: df 90 pop r13 d3ee: cf 90 pop r12 d3f0: bf 90 pop r11 d3f2: af 90 pop r10 d3f4: 9f 90 pop r9 d3f6: 8f 90 pop r8 d3f8: 7f 90 pop r7 d3fa: 6f 90 pop r6 d3fc: 5f 90 pop r5 d3fe: 4f 90 pop r4 d400: 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 d402: 81 30 cpi r24, 0x01 ; 1 d404: 89 f6 brne .-94 ; 0xd3a8 gcode_LastN = saved_sdpos; //saved_sdpos was reused for storing line number when usb printing d406: 80 91 5f 05 lds r24, 0x055F ; 0x80055f d40a: 90 91 60 05 lds r25, 0x0560 ; 0x800560 d40e: a0 91 61 05 lds r26, 0x0561 ; 0x800561 d412: b0 91 62 05 lds r27, 0x0562 ; 0x800562 d416: 80 93 78 03 sts 0x0378, r24 ; 0x800378 d41a: 90 93 79 03 sts 0x0379, r25 ; 0x800379 d41e: a0 93 7a 03 sts 0x037A, r26 ; 0x80037a d422: b0 93 7b 03 sts 0x037B, r27 ; 0x80037b serial_count = 0; d426: 10 92 9e 10 sts 0x109E, r1 ; 0x80109e d42a: 10 92 9d 10 sts 0x109D, r1 ; 0x80109d FlushSerialRequestResend(); d42e: 0e 94 a5 5b call 0xb74a ; 0xb74a d432: ba cf rjmp .-140 ; 0xd3a8 0000d434 : 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) { d434: 3f 92 push r3 d436: 4f 92 push r4 d438: 5f 92 push r5 d43a: 6f 92 push r6 d43c: 7f 92 push r7 d43e: 8f 92 push r8 d440: 9f 92 push r9 d442: af 92 push r10 d444: bf 92 push r11 d446: cf 92 push r12 d448: df 92 push r13 d44a: ef 92 push r14 d44c: ff 92 push r15 d44e: 0f 93 push r16 d450: 1f 93 push r17 d452: cf 93 push r28 d454: df 93 push r29 if (world2machine_correction_mode == WORLD2MACHINE_CORRECTION_NONE) { d456: 30 90 0e 18 lds r3, 0x180E ; 0x80180e d45a: 33 20 and r3, r3 d45c: 09 f4 brne .+2 ; 0xd460 d45e: 80 c0 rjmp .+256 ; 0xd560 d460: 8b 01 movw r16, r22 d462: ec 01 movw r28, r24 // No correction. } else { if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { d464: 31 fe sbrs r3, 1 d466: 54 c0 rjmp .+168 ; 0xd510 // Firs the skew & rotation correction. float out_x = world2machine_rotation_and_skew[0][0] * x + world2machine_rotation_and_skew[0][1] * y; d468: 88 80 ld r8, Y d46a: 99 80 ldd r9, Y+1 ; 0x01 d46c: aa 80 ldd r10, Y+2 ; 0x02 d46e: bb 80 ldd r11, Y+3 ; 0x03 d470: fb 01 movw r30, r22 d472: c0 80 ld r12, Z d474: d1 80 ldd r13, Z+1 ; 0x01 d476: e2 80 ldd r14, Z+2 ; 0x02 d478: f3 80 ldd r15, Z+3 ; 0x03 float out_y = world2machine_rotation_and_skew[1][0] * x + world2machine_rotation_and_skew[1][1] * y; d47a: 20 91 e3 17 lds r18, 0x17E3 ; 0x8017e3 d47e: 30 91 e4 17 lds r19, 0x17E4 ; 0x8017e4 d482: 40 91 e5 17 lds r20, 0x17E5 ; 0x8017e5 d486: 50 91 e6 17 lds r21, 0x17E6 ; 0x8017e6 d48a: c5 01 movw r24, r10 d48c: b4 01 movw r22, r8 d48e: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> d492: 2b 01 movw r4, r22 d494: 3c 01 movw r6, r24 d496: 20 91 e7 17 lds r18, 0x17E7 ; 0x8017e7 d49a: 30 91 e8 17 lds r19, 0x17E8 ; 0x8017e8 d49e: 40 91 e9 17 lds r20, 0x17E9 ; 0x8017e9 d4a2: 50 91 ea 17 lds r21, 0x17EA ; 0x8017ea d4a6: c7 01 movw r24, r14 d4a8: b6 01 movw r22, r12 d4aa: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> d4ae: 9b 01 movw r18, r22 d4b0: ac 01 movw r20, r24 d4b2: c3 01 movw r24, r6 d4b4: b2 01 movw r22, r4 d4b6: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> d4ba: 2b 01 movw r4, r22 d4bc: 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; d4be: 20 91 db 17 lds r18, 0x17DB ; 0x8017db d4c2: 30 91 dc 17 lds r19, 0x17DC ; 0x8017dc d4c6: 40 91 dd 17 lds r20, 0x17DD ; 0x8017dd d4ca: 50 91 de 17 lds r21, 0x17DE ; 0x8017de d4ce: c5 01 movw r24, r10 d4d0: b4 01 movw r22, r8 d4d2: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> d4d6: 4b 01 movw r8, r22 d4d8: 5c 01 movw r10, r24 d4da: 20 91 df 17 lds r18, 0x17DF ; 0x8017df d4de: 30 91 e0 17 lds r19, 0x17E0 ; 0x8017e0 d4e2: 40 91 e1 17 lds r20, 0x17E1 ; 0x8017e1 d4e6: 50 91 e2 17 lds r21, 0x17E2 ; 0x8017e2 d4ea: c7 01 movw r24, r14 d4ec: b6 01 movw r22, r12 d4ee: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> d4f2: 9b 01 movw r18, r22 d4f4: ac 01 movw r20, r24 d4f6: c5 01 movw r24, r10 d4f8: b4 01 movw r22, r8 d4fa: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> float out_y = world2machine_rotation_and_skew[1][0] * x + world2machine_rotation_and_skew[1][1] * y; x = out_x; d4fe: 68 83 st Y, r22 d500: 79 83 std Y+1, r23 ; 0x01 d502: 8a 83 std Y+2, r24 ; 0x02 d504: 9b 83 std Y+3, r25 ; 0x03 y = out_y; d506: f8 01 movw r30, r16 d508: 40 82 st Z, r4 d50a: 51 82 std Z+1, r5 ; 0x01 d50c: 62 82 std Z+2, r6 ; 0x02 d50e: 73 82 std Z+3, r7 ; 0x03 } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SHIFT) { d510: 30 fe sbrs r3, 0 d512: 26 c0 rjmp .+76 ; 0xd560 // Then add the offset. x += world2machine_shift[0]; d514: 20 91 06 18 lds r18, 0x1806 ; 0x801806 d518: 30 91 07 18 lds r19, 0x1807 ; 0x801807 d51c: 40 91 08 18 lds r20, 0x1808 ; 0x801808 d520: 50 91 09 18 lds r21, 0x1809 ; 0x801809 d524: 68 81 ld r22, Y d526: 79 81 ldd r23, Y+1 ; 0x01 d528: 8a 81 ldd r24, Y+2 ; 0x02 d52a: 9b 81 ldd r25, Y+3 ; 0x03 d52c: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> d530: 68 83 st Y, r22 d532: 79 83 std Y+1, r23 ; 0x01 d534: 8a 83 std Y+2, r24 ; 0x02 d536: 9b 83 std Y+3, r25 ; 0x03 y += world2machine_shift[1]; d538: 20 91 0a 18 lds r18, 0x180A ; 0x80180a d53c: 30 91 0b 18 lds r19, 0x180B ; 0x80180b d540: 40 91 0c 18 lds r20, 0x180C ; 0x80180c d544: 50 91 0d 18 lds r21, 0x180D ; 0x80180d d548: f8 01 movw r30, r16 d54a: 60 81 ld r22, Z d54c: 71 81 ldd r23, Z+1 ; 0x01 d54e: 82 81 ldd r24, Z+2 ; 0x02 d550: 93 81 ldd r25, Z+3 ; 0x03 d552: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> d556: f8 01 movw r30, r16 d558: 60 83 st Z, r22 d55a: 71 83 std Z+1, r23 ; 0x01 d55c: 82 83 std Z+2, r24 ; 0x02 d55e: 93 83 std Z+3, r25 ; 0x03 } } } d560: df 91 pop r29 d562: cf 91 pop r28 d564: 1f 91 pop r17 d566: 0f 91 pop r16 d568: ff 90 pop r15 d56a: ef 90 pop r14 d56c: df 90 pop r13 d56e: cf 90 pop r12 d570: bf 90 pop r11 d572: af 90 pop r10 d574: 9f 90 pop r9 d576: 8f 90 pop r8 d578: 7f 90 pop r7 d57a: 6f 90 pop r6 d57c: 5f 90 pop r5 d57e: 4f 90 pop r4 d580: 3f 90 pop r3 d582: 08 95 ret 0000d584 : } } } inline bool world2machine_clamp(float &x, float &y) { d584: 2f 92 push r2 d586: 3f 92 push r3 d588: 4f 92 push r4 d58a: 5f 92 push r5 d58c: 6f 92 push r6 d58e: 7f 92 push r7 d590: 8f 92 push r8 d592: 9f 92 push r9 d594: af 92 push r10 d596: bf 92 push r11 d598: cf 92 push r12 d59a: df 92 push r13 d59c: ef 92 push r14 d59e: ff 92 push r15 d5a0: 0f 93 push r16 d5a2: 1f 93 push r17 d5a4: cf 93 push r28 d5a6: df 93 push r29 d5a8: 00 d0 rcall .+0 ; 0xd5aa d5aa: 00 d0 rcall .+0 ; 0xd5ac d5ac: 1f 92 push r1 d5ae: 1f 92 push r1 d5b0: cd b7 in r28, 0x3d ; 61 d5b2: de b7 in r29, 0x3e ; 62 d5b4: 8c 01 movw r16, r24 d5b6: 1b 01 movw r2, r22 } } inline void world2machine(const float &x, const float &y, float &out_x, float &out_y) { out_x = x; d5b8: fc 01 movw r30, r24 d5ba: 80 81 ld r24, Z d5bc: 91 81 ldd r25, Z+1 ; 0x01 d5be: a2 81 ldd r26, Z+2 ; 0x02 d5c0: b3 81 ldd r27, Z+3 ; 0x03 d5c2: 89 83 std Y+1, r24 ; 0x01 d5c4: 9a 83 std Y+2, r25 ; 0x02 d5c6: ab 83 std Y+3, r26 ; 0x03 d5c8: bc 83 std Y+4, r27 ; 0x04 out_y = y; d5ca: fb 01 movw r30, r22 d5cc: 80 81 ld r24, Z d5ce: 91 81 ldd r25, Z+1 ; 0x01 d5d0: a2 81 ldd r26, Z+2 ; 0x02 d5d2: b3 81 ldd r27, Z+3 ; 0x03 d5d4: 8d 83 std Y+5, r24 ; 0x05 d5d6: 9e 83 std Y+6, r25 ; 0x06 d5d8: af 83 std Y+7, r26 ; 0x07 d5da: b8 87 std Y+8, r27 ; 0x08 world2machine(out_x, out_y); d5dc: be 01 movw r22, r28 d5de: 6b 5f subi r22, 0xFB ; 251 d5e0: 7f 4f sbci r23, 0xFF ; 255 d5e2: ce 01 movw r24, r28 d5e4: 01 96 adiw r24, 0x01 ; 1 d5e6: 0e 94 1a 6a call 0xd434 ; 0xd434 inline bool world2machine_clamp(float &x, float &y) { bool clamped = false; float tmpx, tmpy; world2machine(x, y, tmpx, tmpy); if (tmpx < X_MIN_POS) { d5ea: c9 80 ldd r12, Y+1 ; 0x01 d5ec: da 80 ldd r13, Y+2 ; 0x02 d5ee: eb 80 ldd r14, Y+3 ; 0x03 d5f0: fc 80 ldd r15, Y+4 ; 0x04 d5f2: 20 e0 ldi r18, 0x00 ; 0 d5f4: 30 e0 ldi r19, 0x00 ; 0 d5f6: a9 01 movw r20, r18 d5f8: c7 01 movw r24, r14 d5fa: b6 01 movw r22, r12 d5fc: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> d600: 87 ff sbrs r24, 7 d602: 35 c0 rjmp .+106 ; 0xd66e tmpx = X_MIN_POS; d604: 19 82 std Y+1, r1 ; 0x01 d606: 1a 82 std Y+2, r1 ; 0x02 d608: 1b 82 std Y+3, r1 ; 0x03 d60a: 1c 82 std Y+4, r1 ; 0x04 clamped = true; } else if (tmpx > X_MAX_POS) { tmpx = X_MAX_POS; clamped = true; d60c: ff 24 eor r15, r15 d60e: f3 94 inc r15 } if (tmpy < Y_MIN_POS) { d610: 8d 80 ldd r8, Y+5 ; 0x05 d612: 9e 80 ldd r9, Y+6 ; 0x06 d614: af 80 ldd r10, Y+7 ; 0x07 d616: b8 84 ldd r11, Y+8 ; 0x08 d618: 20 e0 ldi r18, 0x00 ; 0 d61a: 30 e0 ldi r19, 0x00 ; 0 d61c: 40 e8 ldi r20, 0x80 ; 128 d61e: 50 ec ldi r21, 0xC0 ; 192 d620: c5 01 movw r24, r10 d622: b4 01 movw r22, r8 d624: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> d628: 87 ff sbrs r24, 7 d62a: 35 c0 rjmp .+106 ; 0xd696 tmpy = Y_MIN_POS; d62c: 80 e0 ldi r24, 0x00 ; 0 d62e: 90 e0 ldi r25, 0x00 ; 0 d630: a0 e8 ldi r26, 0x80 ; 128 d632: b0 ec ldi r27, 0xC0 ; 192 clamped = true; } else if (tmpy > Y_MAX_POS) { tmpy = Y_MAX_POS; d634: 8d 83 std Y+5, r24 ; 0x05 d636: 9e 83 std Y+6, r25 ; 0x06 d638: af 83 std Y+7, r26 ; 0x07 d63a: b8 87 std Y+8, r27 ; 0x08 clamped = true; } if (clamped) machine2world(tmpx, tmpy, x, y); d63c: cd 80 ldd r12, Y+5 ; 0x05 d63e: de 80 ldd r13, Y+6 ; 0x06 d640: ef 80 ldd r14, Y+7 ; 0x07 d642: f8 84 ldd r15, Y+8 ; 0x08 d644: 89 80 ldd r8, Y+1 ; 0x01 d646: 9a 80 ldd r9, Y+2 ; 0x02 d648: ab 80 ldd r10, Y+3 ; 0x03 d64a: 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) { d64c: 70 90 0e 18 lds r7, 0x180E ; 0x80180e d650: 71 10 cpse r7, r1 d652: 4c c0 rjmp .+152 ; 0xd6ec // No correction. out_x = x; d654: f8 01 movw r30, r16 d656: 80 82 st Z, r8 d658: 91 82 std Z+1, r9 ; 0x01 d65a: a2 82 std Z+2, r10 ; 0x02 d65c: b3 82 std Z+3, r11 ; 0x03 out_y = y; d65e: f1 01 movw r30, r2 d660: c0 82 st Z, r12 d662: d1 82 std Z+1, r13 ; 0x01 d664: e2 82 std Z+2, r14 ; 0x02 d666: 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) { d668: ff 24 eor r15, r15 d66a: f3 94 inc r15 d66c: 25 c0 rjmp .+74 ; 0xd6b8 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) { d66e: 20 e0 ldi r18, 0x00 ; 0 d670: 30 e0 ldi r19, 0x00 ; 0 d672: 4f e7 ldi r20, 0x7F ; 127 d674: 53 e4 ldi r21, 0x43 ; 67 d676: c7 01 movw r24, r14 d678: b6 01 movw r22, r12 d67a: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> } } inline bool world2machine_clamp(float &x, float &y) { bool clamped = false; d67e: 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) { d680: 18 16 cp r1, r24 d682: 34 f6 brge .-116 ; 0xd610 tmpx = X_MAX_POS; d684: 80 e0 ldi r24, 0x00 ; 0 d686: 90 e0 ldi r25, 0x00 ; 0 d688: af e7 ldi r26, 0x7F ; 127 d68a: b3 e4 ldi r27, 0x43 ; 67 d68c: 89 83 std Y+1, r24 ; 0x01 d68e: 9a 83 std Y+2, r25 ; 0x02 d690: ab 83 std Y+3, r26 ; 0x03 d692: bc 83 std Y+4, r27 ; 0x04 d694: bb cf rjmp .-138 ; 0xd60c } if (tmpy < Y_MIN_POS) { tmpy = Y_MIN_POS; clamped = true; } else if (tmpy > Y_MAX_POS) { d696: 20 e0 ldi r18, 0x00 ; 0 d698: 30 e8 ldi r19, 0x80 ; 128 d69a: 44 e5 ldi r20, 0x54 ; 84 d69c: 53 e4 ldi r21, 0x43 ; 67 d69e: c5 01 movw r24, r10 d6a0: b4 01 movw r22, r8 d6a2: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> d6a6: 18 16 cp r1, r24 d6a8: 2c f4 brge .+10 ; 0xd6b4 tmpy = Y_MAX_POS; d6aa: 80 e0 ldi r24, 0x00 ; 0 d6ac: 90 e8 ldi r25, 0x80 ; 128 d6ae: a4 e5 ldi r26, 0x54 ; 84 d6b0: b3 e4 ldi r27, 0x43 ; 67 d6b2: c0 cf rjmp .-128 ; 0xd634 clamped = true; } if (clamped) d6b4: f1 10 cpse r15, r1 d6b6: c2 cf rjmp .-124 ; 0xd63c machine2world(tmpx, tmpy, x, y); return clamped; } d6b8: 8f 2d mov r24, r15 d6ba: 28 96 adiw r28, 0x08 ; 8 d6bc: 0f b6 in r0, 0x3f ; 63 d6be: f8 94 cli d6c0: de bf out 0x3e, r29 ; 62 d6c2: 0f be out 0x3f, r0 ; 63 d6c4: cd bf out 0x3d, r28 ; 61 d6c6: df 91 pop r29 d6c8: cf 91 pop r28 d6ca: 1f 91 pop r17 d6cc: 0f 91 pop r16 d6ce: ff 90 pop r15 d6d0: ef 90 pop r14 d6d2: df 90 pop r13 d6d4: cf 90 pop r12 d6d6: bf 90 pop r11 d6d8: af 90 pop r10 d6da: 9f 90 pop r9 d6dc: 8f 90 pop r8 d6de: 7f 90 pop r7 d6e0: 6f 90 pop r6 d6e2: 5f 90 pop r5 d6e4: 4f 90 pop r4 d6e6: 3f 90 pop r3 d6e8: 2f 90 pop r2 d6ea: 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) { d6ec: 70 fe sbrs r7, 0 d6ee: 1c c0 rjmp .+56 ; 0xd728 // Then add the offset. x -= world2machine_shift[0]; d6f0: 20 91 06 18 lds r18, 0x1806 ; 0x801806 d6f4: 30 91 07 18 lds r19, 0x1807 ; 0x801807 d6f8: 40 91 08 18 lds r20, 0x1808 ; 0x801808 d6fc: 50 91 09 18 lds r21, 0x1809 ; 0x801809 d700: c5 01 movw r24, r10 d702: b4 01 movw r22, r8 d704: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> d708: 4b 01 movw r8, r22 d70a: 5c 01 movw r10, r24 y -= world2machine_shift[1]; d70c: 20 91 0a 18 lds r18, 0x180A ; 0x80180a d710: 30 91 0b 18 lds r19, 0x180B ; 0x80180b d714: 40 91 0c 18 lds r20, 0x180C ; 0x80180c d718: 50 91 0d 18 lds r21, 0x180D ; 0x80180d d71c: c7 01 movw r24, r14 d71e: b6 01 movw r22, r12 d720: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> d724: 6b 01 movw r12, r22 d726: 7c 01 movw r14, r24 } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { d728: 71 fe sbrs r7, 1 d72a: 9e cf rjmp .-196 ; 0xd668 // Firs the skew & rotation correction. out_x = world2machine_rotation_and_skew_inv[0][0] * x + world2machine_rotation_and_skew_inv[0][1] * y; d72c: 20 91 f6 17 lds r18, 0x17F6 ; 0x8017f6 d730: 30 91 f7 17 lds r19, 0x17F7 ; 0x8017f7 d734: 40 91 f8 17 lds r20, 0x17F8 ; 0x8017f8 d738: 50 91 f9 17 lds r21, 0x17F9 ; 0x8017f9 d73c: c5 01 movw r24, r10 d73e: b4 01 movw r22, r8 d740: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> d744: 2b 01 movw r4, r22 d746: 3c 01 movw r6, r24 d748: 20 91 fa 17 lds r18, 0x17FA ; 0x8017fa d74c: 30 91 fb 17 lds r19, 0x17FB ; 0x8017fb d750: 40 91 fc 17 lds r20, 0x17FC ; 0x8017fc d754: 50 91 fd 17 lds r21, 0x17FD ; 0x8017fd d758: c7 01 movw r24, r14 d75a: b6 01 movw r22, r12 d75c: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> d760: 9b 01 movw r18, r22 d762: ac 01 movw r20, r24 d764: c3 01 movw r24, r6 d766: b2 01 movw r22, r4 d768: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> d76c: f8 01 movw r30, r16 d76e: 60 83 st Z, r22 d770: 71 83 std Z+1, r23 ; 0x01 d772: 82 83 std Z+2, r24 ; 0x02 d774: 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; d776: 20 91 fe 17 lds r18, 0x17FE ; 0x8017fe d77a: 30 91 ff 17 lds r19, 0x17FF ; 0x8017ff d77e: 40 91 00 18 lds r20, 0x1800 ; 0x801800 d782: 50 91 01 18 lds r21, 0x1801 ; 0x801801 d786: c5 01 movw r24, r10 d788: b4 01 movw r22, r8 d78a: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> d78e: 4b 01 movw r8, r22 d790: 5c 01 movw r10, r24 d792: 20 91 02 18 lds r18, 0x1802 ; 0x801802 d796: 30 91 03 18 lds r19, 0x1803 ; 0x801803 d79a: 40 91 04 18 lds r20, 0x1804 ; 0x801804 d79e: 50 91 05 18 lds r21, 0x1805 ; 0x801805 d7a2: c7 01 movw r24, r14 d7a4: b6 01 movw r22, r12 d7a6: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> d7aa: 9b 01 movw r18, r22 d7ac: ac 01 movw r20, r24 d7ae: c5 01 movw r24, r10 d7b0: b4 01 movw r22, r8 d7b2: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> d7b6: f1 01 movw r30, r2 d7b8: 60 83 st Z, r22 d7ba: 71 83 std Z+1, r23 ; 0x01 d7bc: 82 83 std Z+2, r24 ; 0x02 d7be: 93 83 std Z+3, r25 ; 0x03 d7c0: 53 cf rjmp .-346 ; 0xd668 0000d7c2 : if(next_feedrate > 0.f) feedrate = next_feedrate; } } void clamp_to_software_endstops(float target[3]) { d7c2: cf 92 push r12 d7c4: df 92 push r13 d7c6: ef 92 push r14 d7c8: ff 92 push r15 d7ca: cf 93 push r28 d7cc: df 93 push r29 d7ce: ec 01 movw r28, r24 #ifdef DEBUG_DISABLE_SWLIMITS return; #endif //DEBUG_DISABLE_SWLIMITS world2machine_clamp(target[0], target[1]); d7d0: bc 01 movw r22, r24 d7d2: 6c 5f subi r22, 0xFC ; 252 d7d4: 7f 4f sbci r23, 0xFF ; 255 d7d6: 0e 94 c2 6a call 0xd584 ; 0xd584 // Clamp the Z coordinate. if (min_software_endstops) { if (target[Z_AXIS] < min_pos[Z_AXIS]) target[Z_AXIS] = min_pos[Z_AXIS]; d7da: c0 90 29 02 lds r12, 0x0229 ; 0x800229 d7de: d0 90 2a 02 lds r13, 0x022A ; 0x80022a d7e2: e0 90 2b 02 lds r14, 0x022B ; 0x80022b d7e6: f0 90 2c 02 lds r15, 0x022C ; 0x80022c d7ea: a7 01 movw r20, r14 d7ec: 96 01 movw r18, r12 d7ee: 68 85 ldd r22, Y+8 ; 0x08 d7f0: 79 85 ldd r23, Y+9 ; 0x09 d7f2: 8a 85 ldd r24, Y+10 ; 0x0a d7f4: 9b 85 ldd r25, Y+11 ; 0x0b d7f6: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> d7fa: 87 ff sbrs r24, 7 d7fc: 04 c0 rjmp .+8 ; 0xd806 d7fe: c8 86 std Y+8, r12 ; 0x08 d800: d9 86 std Y+9, r13 ; 0x09 d802: ea 86 std Y+10, r14 ; 0x0a d804: 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]; d806: c0 90 1d 02 lds r12, 0x021D ; 0x80021d d80a: d0 90 1e 02 lds r13, 0x021E ; 0x80021e d80e: e0 90 1f 02 lds r14, 0x021F ; 0x80021f d812: f0 90 20 02 lds r15, 0x0220 ; 0x800220 d816: a7 01 movw r20, r14 d818: 96 01 movw r18, r12 d81a: 68 85 ldd r22, Y+8 ; 0x08 d81c: 79 85 ldd r23, Y+9 ; 0x09 d81e: 8a 85 ldd r24, Y+10 ; 0x0a d820: 9b 85 ldd r25, Y+11 ; 0x0b d822: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> d826: 18 16 cp r1, r24 d828: 24 f4 brge .+8 ; 0xd832 d82a: c8 86 std Y+8, r12 ; 0x08 d82c: d9 86 std Y+9, r13 ; 0x09 d82e: ea 86 std Y+10, r14 ; 0x0a d830: fb 86 std Y+11, r15 ; 0x0b } } d832: df 91 pop r29 d834: cf 91 pop r28 d836: ff 90 pop r15 d838: ef 90 pop r14 d83a: df 90 pop r13 d83c: cf 90 pop r12 d83e: 08 95 ret 0000d840 : plan_buffer_line(x, y, z, e, feed_rate, current_position); } #endif // MESH_BED_LEVELING void prepare_move(uint16_t start_segment_idx) { d840: 2f 92 push r2 d842: 3f 92 push r3 d844: 4f 92 push r4 d846: 5f 92 push r5 d848: 6f 92 push r6 d84a: 7f 92 push r7 d84c: 8f 92 push r8 d84e: 9f 92 push r9 d850: af 92 push r10 d852: bf 92 push r11 d854: cf 92 push r12 d856: df 92 push r13 d858: ef 92 push r14 d85a: ff 92 push r15 d85c: 0f 93 push r16 d85e: 1f 93 push r17 d860: cf 93 push r28 d862: df 93 push r29 d864: cd b7 in r28, 0x3d ; 61 d866: de b7 in r29, 0x3e ; 62 d868: a2 97 sbiw r28, 0x22 ; 34 d86a: 0f b6 in r0, 0x3f ; 63 d86c: f8 94 cli d86e: de bf out 0x3e, r29 ; 62 d870: 0f be out 0x3f, r0 ; 63 d872: cd bf out 0x3d, r28 ; 61 d874: 1c 01 movw r2, r24 clamp_to_software_endstops(destination); d876: 83 e7 ldi r24, 0x73 ; 115 d878: 96 e0 ldi r25, 0x06 ; 6 d87a: 0e 94 e1 6b call 0xd7c2 ; 0xd7c2 previous_millis_cmd.start(); d87e: 84 e8 ldi r24, 0x84 ; 132 d880: 93 e0 ldi r25, 0x03 ; 3 d882: 0f 94 c5 2b call 0x2578a ; 0x2578a ::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])) { d886: 40 90 91 06 lds r4, 0x0691 ; 0x800691 d88a: 50 90 92 06 lds r5, 0x0692 ; 0x800692 d88e: 60 90 93 06 lds r6, 0x0693 ; 0x800693 d892: 70 90 94 06 lds r7, 0x0694 ; 0x800694 d896: c0 90 73 06 lds r12, 0x0673 ; 0x800673 d89a: d0 90 74 06 lds r13, 0x0674 ; 0x800674 d89e: e0 90 75 06 lds r14, 0x0675 ; 0x800675 d8a2: f0 90 76 06 lds r15, 0x0676 ; 0x800676 d8a6: a7 01 movw r20, r14 d8a8: 96 01 movw r18, r12 d8aa: c3 01 movw r24, r6 d8ac: b2 01 movw r22, r4 d8ae: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> d8b2: 81 11 cpse r24, r1 d8b4: 3f c0 rjmp .+126 ; 0xd934 d8b6: 20 91 77 06 lds r18, 0x0677 ; 0x800677 d8ba: 30 91 78 06 lds r19, 0x0678 ; 0x800678 d8be: 40 91 79 06 lds r20, 0x0679 ; 0x800679 d8c2: 50 91 7a 06 lds r21, 0x067A ; 0x80067a d8c6: 60 91 95 06 lds r22, 0x0695 ; 0x800695 d8ca: 70 91 96 06 lds r23, 0x0696 ; 0x800696 d8ce: 80 91 97 06 lds r24, 0x0697 ; 0x800697 d8d2: 90 91 98 06 lds r25, 0x0698 ; 0x800698 d8d6: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> d8da: 81 11 cpse r24, r1 d8dc: 2b c0 rjmp .+86 ; 0xd934 plan_buffer_line_destinationXYZE(feedrate/60); d8de: 20 e0 ldi r18, 0x00 ; 0 d8e0: 30 e0 ldi r19, 0x00 ; 0 d8e2: 40 e7 ldi r20, 0x70 ; 112 d8e4: 52 e4 ldi r21, 0x42 ; 66 d8e6: 60 91 b8 02 lds r22, 0x02B8 ; 0x8002b8 d8ea: 70 91 b9 02 lds r23, 0x02B9 ; 0x8002b9 d8ee: 80 91 ba 02 lds r24, 0x02BA ; 0x8002ba d8f2: 90 91 bb 02 lds r25, 0x02BB ; 0x8002bb d8f6: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> d8fa: 0f 94 d1 bf call 0x37fa2 ; 0x37fa2 #else plan_buffer_line_destinationXYZE(feedrate*feedmultiply*(1./(60.f*100.f))); #endif } set_current_to_destination(); d8fe: 0e 94 17 5b call 0xb62e ; 0xb62e } d902: a2 96 adiw r28, 0x22 ; 34 d904: 0f b6 in r0, 0x3f ; 63 d906: f8 94 cli d908: de bf out 0x3e, r29 ; 62 d90a: 0f be out 0x3f, r0 ; 63 d90c: cd bf out 0x3d, r28 ; 61 d90e: df 91 pop r29 d910: cf 91 pop r28 d912: 1f 91 pop r17 d914: 0f 91 pop r16 d916: ff 90 pop r15 d918: ef 90 pop r14 d91a: df 90 pop r13 d91c: cf 90 pop r12 d91e: bf 90 pop r11 d920: af 90 pop r10 d922: 9f 90 pop r9 d924: 8f 90 pop r8 d926: 7f 90 pop r7 d928: 6f 90 pop r6 d92a: 5f 90 pop r5 d92c: 4f 90 pop r4 d92e: 3f 90 pop r3 d930: 2f 90 pop r2 d932: 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); d934: 60 91 39 02 lds r22, 0x0239 ; 0x800239 d938: 70 91 3a 02 lds r23, 0x023A ; 0x80023a d93c: 07 2e mov r0, r23 d93e: 00 0c add r0, r0 d940: 88 0b sbc r24, r24 d942: 99 0b sbc r25, r25 d944: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> d948: 20 91 b8 02 lds r18, 0x02B8 ; 0x8002b8 d94c: 30 91 b9 02 lds r19, 0x02B9 ; 0x8002b9 d950: 40 91 ba 02 lds r20, 0x02BA ; 0x8002ba d954: 50 91 bb 02 lds r21, 0x02BB ; 0x8002bb d958: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> d95c: 2e e3 ldi r18, 0x3E ; 62 d95e: 33 ec ldi r19, 0xC3 ; 195 d960: 4e e2 ldi r20, 0x2E ; 46 d962: 59 e3 ldi r21, 0x39 ; 57 d964: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> d968: 6f 83 std Y+7, r22 ; 0x07 d96a: 78 87 std Y+8, r23 ; 0x08 d96c: 89 87 std Y+9, r24 ; 0x09 d96e: 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) { d970: 80 91 c1 13 lds r24, 0x13C1 ; 0x8013c1 d974: 88 23 and r24, r24 d976: 09 f4 brne .+2 ; 0xd97a d978: 0f c1 rjmp .+542 ; 0xdb98 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]; d97a: a3 01 movw r20, r6 d97c: 92 01 movw r18, r4 d97e: c7 01 movw r24, r14 d980: b6 01 movw r22, r12 d982: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> d986: 2b 01 movw r4, r22 d988: 3c 01 movw r6, r24 float dy = y - current_position[Y_AXIS]; d98a: 20 91 95 06 lds r18, 0x0695 ; 0x800695 d98e: 30 91 96 06 lds r19, 0x0696 ; 0x800696 d992: 40 91 97 06 lds r20, 0x0697 ; 0x800697 d996: 50 91 98 06 lds r21, 0x0698 ; 0x800698 d99a: 60 91 77 06 lds r22, 0x0677 ; 0x800677 d99e: 70 91 78 06 lds r23, 0x0678 ; 0x800678 d9a2: 80 91 79 06 lds r24, 0x0679 ; 0x800679 d9a6: 90 91 7a 06 lds r25, 0x067A ; 0x80067a d9aa: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> d9ae: 6b 87 std Y+11, r22 ; 0x0b d9b0: 7c 87 std Y+12, r23 ; 0x0c d9b2: 8d 87 std Y+13, r24 ; 0x0d d9b4: 9e 87 std Y+14, r25 ; 0x0e uint16_t n_segments = 0; if (mbl.active) { float len = fabs(dx) + fabs(dy); d9b6: c3 01 movw r24, r6 d9b8: b2 01 movw r22, r4 d9ba: 9f 77 andi r25, 0x7F ; 127 d9bc: 2b 85 ldd r18, Y+11 ; 0x0b d9be: 3c 85 ldd r19, Y+12 ; 0x0c d9c0: 4d 85 ldd r20, Y+13 ; 0x0d d9c2: 5e 85 ldd r21, Y+14 ; 0x0e d9c4: 5f 77 andi r21, 0x7F ; 127 d9c6: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> d9ca: 6b 01 movw r12, r22 d9cc: 7c 01 movw r14, r24 if (len > 0) d9ce: 20 e0 ldi r18, 0x00 ; 0 d9d0: 30 e0 ldi r19, 0x00 ; 0 d9d2: a9 01 movw r20, r18 d9d4: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> d9d8: 18 16 cp r1, r24 d9da: 0c f0 brlt .+2 ; 0xd9de d9dc: dd c0 rjmp .+442 ; 0xdb98 // Split to 3cm segments or shorter. n_segments = uint16_t(ceil(len / 30.f)); d9de: 20 e0 ldi r18, 0x00 ; 0 d9e0: 30 e0 ldi r19, 0x00 ; 0 d9e2: 40 ef ldi r20, 0xF0 ; 240 d9e4: 51 e4 ldi r21, 0x41 ; 65 d9e6: c7 01 movw r24, r14 d9e8: b6 01 movw r22, r12 d9ea: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> d9ee: 0f 94 dd dd call 0x3bbba ; 0x3bbba d9f2: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> d9f6: 7e 83 std Y+6, r23 ; 0x06 d9f8: 6d 83 std Y+5, r22 ; 0x05 } if (n_segments > 1 && start_segment_idx) { d9fa: 62 30 cpi r22, 0x02 ; 2 d9fc: 71 05 cpc r23, r1 d9fe: 08 f4 brcc .+2 ; 0xda02 da00: cb c0 rjmp .+406 ; 0xdb98 da02: 21 14 cp r2, r1 da04: 31 04 cpc r3, r1 da06: 09 f4 brne .+2 ; 0xda0a da08: c7 c0 rjmp .+398 ; 0xdb98 float dz = z - current_position[Z_AXIS]; da0a: 20 91 99 06 lds r18, 0x0699 ; 0x800699 da0e: 30 91 9a 06 lds r19, 0x069A ; 0x80069a da12: 40 91 9b 06 lds r20, 0x069B ; 0x80069b da16: 50 91 9c 06 lds r21, 0x069C ; 0x80069c da1a: 60 91 7b 06 lds r22, 0x067B ; 0x80067b da1e: 70 91 7c 06 lds r23, 0x067C ; 0x80067c da22: 80 91 7d 06 lds r24, 0x067D ; 0x80067d da26: 90 91 7e 06 lds r25, 0x067E ; 0x80067e da2a: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> da2e: 6f 87 std Y+15, r22 ; 0x0f da30: 78 8b std Y+16, r23 ; 0x10 da32: 89 8b std Y+17, r24 ; 0x11 da34: 9a 8b std Y+18, r25 ; 0x12 float de = e - current_position[E_AXIS]; da36: 20 91 9d 06 lds r18, 0x069D ; 0x80069d da3a: 30 91 9e 06 lds r19, 0x069E ; 0x80069e da3e: 40 91 9f 06 lds r20, 0x069F ; 0x80069f da42: 50 91 a0 06 lds r21, 0x06A0 ; 0x8006a0 da46: 60 91 7f 06 lds r22, 0x067F ; 0x80067f da4a: 70 91 80 06 lds r23, 0x0680 ; 0x800680 da4e: 80 91 81 06 lds r24, 0x0681 ; 0x800681 da52: 90 91 82 06 lds r25, 0x0682 ; 0x800682 da56: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> da5a: 6b 8b std Y+19, r22 ; 0x13 da5c: 7c 8b std Y+20, r23 ; 0x14 da5e: 8d 8b std Y+21, r24 ; 0x15 da60: 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); da62: ad 81 ldd r26, Y+5 ; 0x05 da64: be 81 ldd r27, Y+6 ; 0x06 da66: cd 01 movw r24, r26 da68: b0 e0 ldi r27, 0x00 ; 0 da6a: a0 e0 ldi r26, 0x00 ; 0 da6c: 8f 8f std Y+31, r24 ; 0x1f da6e: 98 a3 std Y+32, r25 ; 0x20 da70: a9 a3 std Y+33, r26 ; 0x21 da72: 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) { da74: 2d 81 ldd r18, Y+5 ; 0x05 da76: 3e 81 ldd r19, Y+6 ; 0x06 da78: 22 16 cp r2, r18 da7a: 33 06 cpc r3, r19 da7c: 08 f0 brcs .+2 ; 0xda80 da7e: 8c c0 rjmp .+280 ; 0xdb98 float t = float(i) / float(n_segments); da80: b1 01 movw r22, r2 da82: 90 e0 ldi r25, 0x00 ; 0 da84: 80 e0 ldi r24, 0x00 ; 0 da86: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> da8a: 6b 01 movw r12, r22 da8c: 7c 01 movw r14, r24 da8e: 6f 8d ldd r22, Y+31 ; 0x1f da90: 78 a1 ldd r23, Y+32 ; 0x20 da92: 89 a1 ldd r24, Y+33 ; 0x21 da94: 9a a1 ldd r25, Y+34 ; 0x22 da96: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> da9a: 9b 01 movw r18, r22 da9c: ac 01 movw r20, r24 da9e: c7 01 movw r24, r14 daa0: b6 01 movw r22, r12 daa2: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> daa6: 6b 01 movw r12, r22 daa8: 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, daaa: ac 01 movw r20, r24 daac: 9b 01 movw r18, r22 daae: 6b 89 ldd r22, Y+19 ; 0x13 dab0: 7c 89 ldd r23, Y+20 ; 0x14 dab2: 8d 89 ldd r24, Y+21 ; 0x15 dab4: 9e 89 ldd r25, Y+22 ; 0x16 dab6: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> daba: 9b 01 movw r18, r22 dabc: ac 01 movw r20, r24 dabe: 60 91 9d 06 lds r22, 0x069D ; 0x80069d dac2: 70 91 9e 06 lds r23, 0x069E ; 0x80069e dac6: 80 91 9f 06 lds r24, 0x069F ; 0x80069f daca: 90 91 a0 06 lds r25, 0x06A0 ; 0x8006a0 dace: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> dad2: 69 83 std Y+1, r22 ; 0x01 dad4: 7a 83 std Y+2, r23 ; 0x02 dad6: 8b 83 std Y+3, r24 ; 0x03 dad8: 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, dada: a7 01 movw r20, r14 dadc: 96 01 movw r18, r12 dade: 6f 85 ldd r22, Y+15 ; 0x0f dae0: 78 89 ldd r23, Y+16 ; 0x10 dae2: 89 89 ldd r24, Y+17 ; 0x11 dae4: 9a 89 ldd r25, Y+18 ; 0x12 dae6: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__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, daea: 20 91 99 06 lds r18, 0x0699 ; 0x800699 daee: 30 91 9a 06 lds r19, 0x069A ; 0x80069a daf2: 40 91 9b 06 lds r20, 0x069B ; 0x80069b daf6: 50 91 9c 06 lds r21, 0x069C ; 0x80069c dafa: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> dafe: 6f 8b std Y+23, r22 ; 0x17 db00: 78 8f std Y+24, r23 ; 0x18 db02: 89 8f std Y+25, r24 ; 0x19 db04: 9a 8f std Y+26, r25 ; 0x1a current_position[Y_AXIS] + t * dy, db06: a7 01 movw r20, r14 db08: 96 01 movw r18, r12 db0a: 6b 85 ldd r22, Y+11 ; 0x0b db0c: 7c 85 ldd r23, Y+12 ; 0x0c db0e: 8d 85 ldd r24, Y+13 ; 0x0d db10: 9e 85 ldd r25, Y+14 ; 0x0e db12: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__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, db16: 20 91 95 06 lds r18, 0x0695 ; 0x800695 db1a: 30 91 96 06 lds r19, 0x0696 ; 0x800696 db1e: 40 91 97 06 lds r20, 0x0697 ; 0x800697 db22: 50 91 98 06 lds r21, 0x0698 ; 0x800698 db26: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> db2a: 6b 8f std Y+27, r22 ; 0x1b db2c: 7c 8f std Y+28, r23 ; 0x1c db2e: 8d 8f std Y+29, r24 ; 0x1d db30: 9e 8f std Y+30, r25 ; 0x1e db32: a7 01 movw r20, r14 db34: 96 01 movw r18, r12 db36: c3 01 movw r24, r6 db38: b2 01 movw r22, r4 db3a: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> db3e: 20 91 91 06 lds r18, 0x0691 ; 0x800691 db42: 30 91 92 06 lds r19, 0x0692 ; 0x800692 db46: 40 91 93 06 lds r20, 0x0693 ; 0x800693 db4a: 50 91 94 06 lds r21, 0x0694 ; 0x800694 db4e: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> db52: 3f 92 push r3 db54: 2f 92 push r2 db56: a1 e9 ldi r26, 0x91 ; 145 db58: b6 e0 ldi r27, 0x06 ; 6 db5a: bf 93 push r27 db5c: af 93 push r26 db5e: 8f 80 ldd r8, Y+7 ; 0x07 db60: 98 84 ldd r9, Y+8 ; 0x08 db62: a9 84 ldd r10, Y+9 ; 0x09 db64: ba 84 ldd r11, Y+10 ; 0x0a db66: de 01 movw r26, r28 db68: 11 96 adiw r26, 0x01 ; 1 db6a: 6d 01 movw r12, r26 db6c: ef 88 ldd r14, Y+23 ; 0x17 db6e: f8 8c ldd r15, Y+24 ; 0x18 db70: 09 8d ldd r16, Y+25 ; 0x19 db72: 1a 8d ldd r17, Y+26 ; 0x1a db74: 2b 8d ldd r18, Y+27 ; 0x1b db76: 3c 8d ldd r19, Y+28 ; 0x1c db78: 4d 8d ldd r20, Y+29 ; 0x1d db7a: 5e 8d ldd r21, Y+30 ; 0x1e db7c: 0f 94 af b0 call 0x3615e ; 0x3615e 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) db80: 0f 90 pop r0 db82: 0f 90 pop r0 db84: 0f 90 pop r0 db86: 0f 90 pop r0 db88: 80 91 ab 0d lds r24, 0x0DAB ; 0x800dab db8c: 81 11 cpse r24, r1 db8e: b7 ce rjmp .-658 ; 0xd8fe 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) { db90: bf ef ldi r27, 0xFF ; 255 db92: 2b 1a sub r2, r27 db94: 3b 0a sbc r3, r27 db96: 6e cf rjmp .-292 ; 0xda74 if (planner_aborted) return; } } // The rest of the path. plan_buffer_line(x, y, z, e, feed_rate, current_position); db98: e0 90 7b 06 lds r14, 0x067B ; 0x80067b db9c: f0 90 7c 06 lds r15, 0x067C ; 0x80067c dba0: 00 91 7d 06 lds r16, 0x067D ; 0x80067d dba4: 10 91 7e 06 lds r17, 0x067E ; 0x80067e dba8: 20 91 77 06 lds r18, 0x0677 ; 0x800677 dbac: 30 91 78 06 lds r19, 0x0678 ; 0x800678 dbb0: 40 91 79 06 lds r20, 0x0679 ; 0x800679 dbb4: 50 91 7a 06 lds r21, 0x067A ; 0x80067a dbb8: 60 91 73 06 lds r22, 0x0673 ; 0x800673 dbbc: 70 91 74 06 lds r23, 0x0674 ; 0x800674 dbc0: 80 91 75 06 lds r24, 0x0675 ; 0x800675 dbc4: 90 91 76 06 lds r25, 0x0676 ; 0x800676 dbc8: 1f 92 push r1 dbca: 1f 92 push r1 dbcc: e1 e9 ldi r30, 0x91 ; 145 dbce: f6 e0 ldi r31, 0x06 ; 6 dbd0: ff 93 push r31 dbd2: ef 93 push r30 dbd4: 8f 80 ldd r8, Y+7 ; 0x07 dbd6: 98 84 ldd r9, Y+8 ; 0x08 dbd8: a9 84 ldd r10, Y+9 ; 0x09 dbda: ba 84 ldd r11, Y+10 ; 0x0a dbdc: ef e7 ldi r30, 0x7F ; 127 dbde: ce 2e mov r12, r30 dbe0: e6 e0 ldi r30, 0x06 ; 6 dbe2: de 2e mov r13, r30 dbe4: 0f 94 af b0 call 0x3615e ; 0x3615e dbe8: 0f 90 pop r0 dbea: 0f 90 pop r0 dbec: 0f 90 pop r0 dbee: 0f 90 pop r0 dbf0: 86 ce rjmp .-756 ; 0xd8fe 0000dbf2 : /// @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) { dbf2: cf 92 push r12 dbf4: df 92 push r13 dbf6: ef 92 push r14 dbf8: ff 92 push r15 dbfa: cf 93 push r28 dbfc: 9b 01 movw r18, r22 dbfe: ac 01 movw r20, r24 float travel_z = current_position[Z_AXIS]; dc00: c0 90 99 06 lds r12, 0x0699 ; 0x800699 dc04: d0 90 9a 06 lds r13, 0x069A ; 0x80069a dc08: e0 90 9b 06 lds r14, 0x069B ; 0x80069b dc0c: f0 90 9c 06 lds r15, 0x069C ; 0x80069c // Prepare to move Z axis current_position[Z_AXIS] += delta; dc10: c7 01 movw r24, r14 dc12: b6 01 movw r22, r12 dc14: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> dc18: 60 93 99 06 sts 0x0699, r22 ; 0x800699 dc1c: 70 93 9a 06 sts 0x069A, r23 ; 0x80069a dc20: 80 93 9b 06 sts 0x069B, r24 ; 0x80069b dc24: 90 93 9c 06 sts 0x069C, r25 ; 0x80069c #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); dc28: 83 b1 in r24, 0x03 ; 3 #else bool z_min_endstop = false; #endif if (axis_known_position[Z_AXIS] || z_min_endstop) dc2a: 90 91 90 06 lds r25, 0x0690 ; 0x800690 dc2e: 91 11 cpse r25, r1 dc30: 02 c0 rjmp .+4 ; 0xdc36 dc32: 84 ff sbrs r24, 4 dc34: 26 c0 rjmp .+76 ; 0xdc82 { // current position is known or very low, it's safe to raise Z clamp_to_software_endstops(current_position); dc36: 81 e9 ldi r24, 0x91 ; 145 dc38: 96 e0 ldi r25, 0x06 ; 6 dc3a: 0e 94 e1 6b call 0xd7c2 ; 0xd7c2 plan_buffer_line_curposXYZE(max_feedrate[Z_AXIS]); dc3e: e0 91 71 02 lds r30, 0x0271 ; 0x800271 dc42: f0 91 72 02 lds r31, 0x0272 ; 0x800272 dc46: 60 85 ldd r22, Z+8 ; 0x08 dc48: 71 85 ldd r23, Z+9 ; 0x09 dc4a: 82 85 ldd r24, Z+10 ; 0x0a dc4c: 93 85 ldd r25, Z+11 ; 0x0b dc4e: 0f 94 04 c0 call 0x38008 ; 0x38008 st_synchronize(); dc52: 0f 94 a3 42 call 0x28546 ; 0x28546 // Get the final travel distance travel_z = current_position[Z_AXIS] - travel_z; dc56: a7 01 movw r20, r14 dc58: 96 01 movw r18, r12 dc5a: 60 91 99 06 lds r22, 0x0699 ; 0x800699 dc5e: 70 91 9a 06 lds r23, 0x069A ; 0x80069a dc62: 80 91 9b 06 lds r24, 0x069B ; 0x80069b dc66: 90 91 9c 06 lds r25, 0x069C ; 0x80069c dc6a: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> dc6e: 6b 01 movw r12, r22 dc70: 7c 01 movw r14, r24 #endif //TMC2130 enable_z_endstop(z_endstop_enabled); } return travel_z; } dc72: c7 01 movw r24, r14 dc74: b6 01 movw r22, r12 dc76: cf 91 pop r28 dc78: ff 90 pop r15 dc7a: ef 90 pop r14 dc7c: df 90 pop r13 dc7e: cf 90 pop r12 dc80: 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(); dc82: 15 98 cbi 0x02, 5 ; 2 st_synchronize(); dc84: 0f 94 a3 42 call 0x28546 ; 0x28546 // rely on crashguard to limit damage bool z_endstop_enabled = enable_z_endstop(true); dc88: 81 e0 ldi r24, 0x01 ; 1 dc8a: 0f 94 9d 4d call 0x29b3a ; 0x29b3a dc8e: c8 2f mov r28, r24 #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); dc90: 84 e0 ldi r24, 0x04 ; 4 dc92: 0f 94 ae 25 call 0x24b5c ; 0x24b5c #endif //TMC2130 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); dc96: 65 e5 ldi r22, 0x55 ; 85 dc98: 75 e5 ldi r23, 0x55 ; 85 dc9a: 85 e5 ldi r24, 0x55 ; 85 dc9c: 91 e4 ldi r25, 0x41 ; 65 dc9e: 0f 94 04 c0 call 0x38008 ; 0x38008 st_synchronize(); dca2: 0f 94 a3 42 call 0x28546 ; 0x28546 // Get the final travel distance travel_z = st_get_position_mm(Z_AXIS) - travel_z; dca6: 82 e0 ldi r24, 0x02 ; 2 dca8: 0f 94 8f 42 call 0x2851e ; 0x2851e dcac: a7 01 movw r20, r14 dcae: 96 01 movw r18, r12 dcb0: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> dcb4: 6b 01 movw r12, r22 dcb6: 7c 01 movw r14, r24 #ifdef TMC2130 if (endstop_z_hit_on_purpose()) dcb8: 0f 94 ab 4d call 0x29b56 ; 0x29b56 dcbc: 88 23 and r24, r24 dcbe: 91 f0 breq .+36 ; 0xdce4 { // not necessarily exact, but will avoid further vertical moves current_position[Z_AXIS] = max_pos[Z_AXIS]; dcc0: 80 91 1d 02 lds r24, 0x021D ; 0x80021d dcc4: 90 91 1e 02 lds r25, 0x021E ; 0x80021e dcc8: a0 91 1f 02 lds r26, 0x021F ; 0x80021f dccc: b0 91 20 02 lds r27, 0x0220 ; 0x800220 dcd0: 80 93 99 06 sts 0x0699, r24 ; 0x800699 dcd4: 90 93 9a 06 sts 0x069A, r25 ; 0x80069a dcd8: a0 93 9b 06 sts 0x069B, r26 ; 0x80069b dcdc: b0 93 9c 06 sts 0x069C, r27 ; 0x80069c plan_set_position_curposXYZE(); dce0: 0f 94 c4 be call 0x37d88 ; 0x37d88 } tmc2130_home_exit(); dce4: 0f 94 7f 25 call 0x24afe ; 0x24afe #endif //TMC2130 enable_z_endstop(z_endstop_enabled); dce8: 8c 2f mov r24, r28 dcea: 0f 94 9d 4d call 0x29b3a ; 0x29b3a dcee: c1 cf rjmp .-126 ; 0xdc72 0000dcf0 : // // 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) { dcf0: 8f 92 push r8 dcf2: 9f 92 push r9 dcf4: af 92 push r10 dcf6: bf 92 push r11 dcf8: cf 92 push r12 dcfa: df 92 push r13 dcfc: ef 92 push r14 dcfe: ff 92 push r15 dd00: 4b 01 movw r8, r22 dd02: 5c 01 movw r10, r24 if (current_position[Z_AXIS] >= target) dd04: c0 90 99 06 lds r12, 0x0699 ; 0x800699 dd08: d0 90 9a 06 lds r13, 0x069A ; 0x80069a dd0c: e0 90 9b 06 lds r14, 0x069B ; 0x80069b dd10: f0 90 9c 06 lds r15, 0x069C ; 0x80069c dd14: ac 01 movw r20, r24 dd16: 9b 01 movw r18, r22 dd18: c7 01 movw r24, r14 dd1a: b6 01 movw r22, r12 dd1c: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> dd20: 87 ff sbrs r24, 7 dd22: 11 c0 rjmp .+34 ; 0xdd46 return; // Use absolute value in case the current position is unknown raise_z(fabs(current_position[Z_AXIS] - target)); dd24: a5 01 movw r20, r10 dd26: 94 01 movw r18, r8 dd28: c7 01 movw r24, r14 dd2a: b6 01 movw r22, r12 dd2c: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> dd30: 9f 77 andi r25, 0x7F ; 127 } dd32: ff 90 pop r15 dd34: ef 90 pop r14 dd36: df 90 pop r13 dd38: cf 90 pop r12 dd3a: bf 90 pop r11 dd3c: af 90 pop r10 dd3e: 9f 90 pop r9 dd40: 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)); dd42: 0c 94 f9 6d jmp 0xdbf2 ; 0xdbf2 } dd46: ff 90 pop r15 dd48: ef 90 pop r14 dd4a: df 90 pop r13 dd4c: cf 90 pop r12 dd4e: bf 90 pop r11 dd50: af 90 pop r10 dd52: 9f 90 pop r9 dd54: 8f 90 pop r8 dd56: 08 95 ret 0000dd58 : static void lcd_invalidate_custom_characters() { memset(lcd_custom_characters, 0x7F, sizeof(lcd_custom_characters)); } void lcd_frame_start() { dd58: ec e5 ldi r30, 0x5C ; 92 dd5a: 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; dd5c: 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]; dd5e: 81 91 ld r24, Z+ if (c == 0x7F) { //slot empty dd60: 8f 37 cpi r24, 0x7F ; 127 dd62: 31 f0 breq .+12 ; 0xdd70 dd64: df 01 movw r26, r30 dd66: 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 dd68: 87 ff sbrs r24, 7 dd6a: 07 c0 rjmp .+14 ; 0xdd7a lcd_custom_characters[i] = c & 0x7F; dd6c: 8f 77 andi r24, 0x7F ; 127 dd6e: 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++) { dd70: 83 e0 ldi r24, 0x03 ; 3 dd72: e4 36 cpi r30, 0x64 ; 100 dd74: f8 07 cpc r31, r24 dd76: 99 f7 brne .-26 ; 0xdd5e for (uint8_t i = 0; i < 8; i++) { printf_P(PSTR(" %02x"), lcd_custom_characters[i]); } printf_P(PSTR("\n")); #endif // DEBUG_CUSTOM_CHARACTERS } dd78: 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; dd7a: 9c 93 st X, r25 dd7c: f9 cf rjmp .-14 ; 0xdd70 0000dd7e : } } void lcd_update(uint8_t lcdDrawUpdateOverride) { if (lcd_draw_update < lcdDrawUpdateOverride) dd7e: 90 91 6d 02 lds r25, 0x026D ; 0x80026d dd82: 98 17 cp r25, r24 dd84: 10 f4 brcc .+4 ; 0xdd8a lcd_draw_update = lcdDrawUpdateOverride; dd86: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d if (!lcd_update_enabled) return; dd8a: 80 91 6e 02 lds r24, 0x026E ; 0x80026e dd8e: 88 23 and r24, r24 dd90: 39 f0 breq .+14 ; 0xdda0 if (lcd_lcdupdate_func) dd92: e0 91 14 04 lds r30, 0x0414 ; 0x800414 dd96: f0 91 15 04 lds r31, 0x0415 ; 0x800415 dd9a: 30 97 sbiw r30, 0x00 ; 0 dd9c: 09 f0 breq .+2 ; 0xdda0 lcd_lcdupdate_func(); dd9e: 19 94 eijmp } dda0: 08 95 ret 0000dda2 : lcd_set_cursor(c, r); return fputs_P(str, lcdout); } int lcd_printf_P(const char* format, ...) { dda2: cf 93 push r28 dda4: df 93 push r29 dda6: cd b7 in r28, 0x3d ; 61 dda8: de b7 in r29, 0x3e ; 62 ddaa: ae 01 movw r20, r28 ddac: 4a 5f subi r20, 0xFA ; 250 ddae: 5f 4f sbci r21, 0xFF ; 255 ddb0: fa 01 movw r30, r20 ddb2: 61 91 ld r22, Z+ ddb4: 71 91 ld r23, Z+ ddb6: af 01 movw r20, r30 va_list args; va_start(args, format); int ret = vfprintf_P(lcdout, format, args); ddb8: 82 e0 ldi r24, 0x02 ; 2 ddba: 94 e0 ldi r25, 0x04 ; 4 ddbc: 0f 94 1e db call 0x3b63c ; 0x3b63c va_end(args); return ret; } ddc0: df 91 pop r29 ddc2: cf 91 pop r28 ddc4: 08 95 ret 0000ddc6 : return fputc(ch, lcdout); } int lcd_puts_P(const char* str) { return fputs_P(str, lcdout); ddc6: 62 e0 ldi r22, 0x02 ; 2 ddc8: 74 e0 ldi r23, 0x04 ; 4 ddca: 0d 94 6f da jmp 0x3b4de ; 0x3b4de 0000ddce : lcd_command(LCD_SETDDRAMADDR | lcd_ddram_address); // no need for masking the address } int lcd_putc(char c) { return fputc(c, lcdout); ddce: 62 e0 ldi r22, 0x02 ; 2 ddd0: 74 e0 ldi r23, 0x04 ; 4 ddd2: 08 2e mov r0, r24 ddd4: 00 0c add r0, r0 ddd6: 99 0b sbc r25, r25 ddd8: 0d 94 3f da jmp 0x3b47e ; 0x3b47e 0000dddc : va_end(args); return ret; } void lcd_space(uint8_t n) { dddc: cf 93 push r28 ddde: c8 2f mov r28, r24 while (n--) lcd_putc(' '); dde0: c1 50 subi r28, 0x01 ; 1 dde2: 20 f0 brcs .+8 ; 0xddec dde4: 80 e2 ldi r24, 0x20 ; 32 dde6: 0e 94 e7 6e call 0xddce ; 0xddce ddea: fa cf rjmp .-12 ; 0xdde0 } ddec: cf 91 pop r28 ddee: 08 95 ret 0000ddf0 : { return pgm_read_byte(row_offsets + min(row, LCD_HEIGHT - 1)); } void lcd_set_cursor(uint8_t col, uint8_t row) { ddf0: cf 93 push r28 ddf2: c8 2f mov r28, r24 ddf4: 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); ddf6: 64 30 cpi r22, 0x04 ; 4 ddf8: 08 f0 brcs .+2 ; 0xddfc ddfa: 83 e0 ldi r24, 0x03 ; 3 ddfc: 80 93 5b 03 sts 0x035B, r24 ; 0x80035b } 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); de00: 0e 94 21 5b call 0xb642 ; 0xb642 de04: 8c 0f add r24, r28 lcd_ddram_address = addr; de06: 80 93 5a 03 sts 0x035A, r24 ; 0x80035a delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); de0a: 44 e6 ldi r20, 0x64 ; 100 de0c: 50 e0 ldi r21, 0x00 ; 0 de0e: 60 e0 ldi r22, 0x00 ; 0 de10: 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); } de12: cf 91 pop r28 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); de14: 0c 94 1f 64 jmp 0xc83e ; 0xc83e 0000de18 : { return fputs_P(str, lcdout); } int lcd_puts_at_P(uint8_t c, uint8_t r, const char* str) { de18: cf 93 push r28 de1a: df 93 push r29 de1c: ea 01 movw r28, r20 lcd_set_cursor(c, r); de1e: 0e 94 f8 6e call 0xddf0 ; 0xddf0 return fputs_P(str, lcdout); de22: 62 e0 ldi r22, 0x02 ; 2 de24: 74 e0 ldi r23, 0x04 ; 4 de26: ce 01 movw r24, r28 } de28: df 91 pop r29 de2a: 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); de2c: 0d 94 6f da jmp 0x3b4de ; 0x3b4de 0000de30 : { return fputc(c, lcdout); } int lcd_putc_at(uint8_t c, uint8_t r, char ch) { de30: cf 93 push r28 de32: c4 2f mov r28, r20 lcd_set_cursor(c, r); de34: 0e 94 f8 6e call 0xddf0 ; 0xddf0 return fputc(ch, lcdout); de38: 62 e0 ldi r22, 0x02 ; 2 de3a: 74 e0 ldi r23, 0x04 ; 4 de3c: 8c 2f mov r24, r28 de3e: cc 0f add r28, r28 de40: 99 0b sbc r25, r25 } de42: 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); de44: 0d 94 3f da jmp 0x3b47e ; 0x3b47e 0000de48 : } // Set cursor position to zero and in DDRAM. It does not unshift the display. void lcd_home(void) { lcd_set_cursor(0, 0); de48: 60 e0 ldi r22, 0x00 ; 0 de4a: 80 e0 ldi r24, 0x00 ; 0 de4c: 0e 94 f8 6e call 0xddf0 ; 0xddf0 lcd_ddram_address = 0; de50: 10 92 5a 03 sts 0x035A, r1 ; 0x80035a } de54: 08 95 ret 0000de56 : delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); de56: 40 e4 ldi r20, 0x40 ; 64 de58: 56 e0 ldi r21, 0x06 ; 6 de5a: 60 e0 ldi r22, 0x00 ; 0 de5c: 81 e0 ldi r24, 0x01 ; 1 de5e: 0e 94 1f 64 call 0xc83e ; 0xc83e // 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; de62: 10 92 5b 03 sts 0x035B, r1 ; 0x80035b lcd_ddram_address = 0; de66: 10 92 5a 03 sts 0x035A, r1 ; 0x80035a 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)); de6a: 48 e0 ldi r20, 0x08 ; 8 de6c: 50 e0 ldi r21, 0x00 ; 0 de6e: 6f e7 ldi r22, 0x7F ; 127 de70: 70 e0 ldi r23, 0x00 ; 0 de72: 8c e5 ldi r24, 0x5C ; 92 de74: 93 e0 ldi r25, 0x03 ; 3 de76: 0d 94 09 e2 jmp 0x3c412 ; 0x3c412 0000de7a : } 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) de7a: 90 91 6e 02 lds r25, 0x026E ; 0x80026e de7e: 98 17 cp r25, r24 de80: 09 f1 breq .+66 ; 0xdec4 { lcd_update_enabled = enabled; de82: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e if (enabled) de86: 88 23 and r24, r24 de88: e9 f0 breq .+58 ; 0xdec4 { // Reset encoder position. This is equivalent to re-entering a menu. lcd_encoder = 0; de8a: 10 92 70 06 sts 0x0670, r1 ; 0x800670 de8e: 10 92 6f 06 sts 0x066F, r1 ; 0x80066f lcd_encoder_diff = 0; de92: 10 92 d0 05 sts 0x05D0, r1 ; 0x8005d0 <_ZL16lcd_encoder_diff.lto_priv.539> // Enabling the normal LCD update procedure. // Reset the timeout interval. lcd_timeoutToStatus.start(); de96: 8a ed ldi r24, 0xDA ; 218 de98: 93 e0 ldi r25, 0x03 ; 3 de9a: 0f 94 c5 2b call 0x2578a ; 0x2578a ::start()> // Force the keypad update now. lcd_next_update_millis = _millis() - 1; de9e: 0f 94 22 29 call 0x25244 ; 0x25244 dea2: 61 50 subi r22, 0x01 ; 1 dea4: 71 09 sbc r23, r1 dea6: 81 09 sbc r24, r1 dea8: 91 09 sbc r25, r1 deaa: 60 93 d6 03 sts 0x03D6, r22 ; 0x8003d6 deae: 70 93 d7 03 sts 0x03D7, r23 ; 0x8003d7 deb2: 80 93 d8 03 sts 0x03D8, r24 ; 0x8003d8 deb6: 90 93 d9 03 sts 0x03D9, r25 ; 0x8003d9 // Full update. lcd_clear(); deba: 0e 94 2b 6f call 0xde56 ; 0xde56 lcd_update(2); debe: 82 e0 ldi r24, 0x02 ; 2 dec0: 0c 94 bf 6e jmp 0xdd7e ; 0xdd7e } else { // Clear the LCD always, or let it to the caller? } } } dec4: 08 95 ret 0000dec6 : lcd_ddram_address++; // no need for preventing ddram overflow } } static void lcd_begin(uint8_t clear) { dec6: cf 93 push r28 dec8: c8 2f mov r28, r24 lcd_currline = 0; deca: 10 92 5b 03 sts 0x035B, r1 ; 0x80035b lcd_ddram_address = 0; dece: 10 92 5a 03 sts 0x035A, r1 ; 0x80035a 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)); ded2: 48 e0 ldi r20, 0x08 ; 8 ded4: 50 e0 ldi r21, 0x00 ; 0 ded6: 6f e7 ldi r22, 0x7F ; 127 ded8: 70 e0 ldi r23, 0x00 ; 0 deda: 8c e5 ldi r24, 0x5C ; 92 dedc: 93 e0 ldi r25, 0x03 ; 3 dede: 0f 94 09 e2 call 0x3c412 ; 0x3c412 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 dee2: 44 e9 ldi r20, 0x94 ; 148 dee4: 51 e1 ldi r21, 0x11 ; 17 dee6: 62 e0 ldi r22, 0x02 ; 2 dee8: 80 e3 ldi r24, 0x30 ; 48 deea: 0e 94 1f 64 call 0xc83e ; 0xc83e // second try lcd_send(LCD_FUNCTIONSET | LCD_8BITMODE, LOW | LCD_HALF_FLAG, 150); deee: 46 e9 ldi r20, 0x96 ; 150 def0: 50 e0 ldi r21, 0x00 ; 0 def2: 62 e0 ldi r22, 0x02 ; 2 def4: 80 e3 ldi r24, 0x30 ; 48 def6: 0e 94 1f 64 call 0xc83e ; 0xc83e // third go! lcd_send(LCD_FUNCTIONSET | LCD_8BITMODE, LOW | LCD_HALF_FLAG, 150); defa: 46 e9 ldi r20, 0x96 ; 150 defc: 50 e0 ldi r21, 0x00 ; 0 defe: 62 e0 ldi r22, 0x02 ; 2 df00: 80 e3 ldi r24, 0x30 ; 48 df02: 0e 94 1f 64 call 0xc83e ; 0xc83e #ifndef LCD_8BIT // set to 4-bit interface lcd_send(LCD_FUNCTIONSET | LCD_4BITMODE, LOW | LCD_HALF_FLAG, 150); df06: 46 e9 ldi r20, 0x96 ; 150 df08: 50 e0 ldi r21, 0x00 ; 0 df0a: 62 e0 ldi r22, 0x02 ; 2 df0c: 80 e2 ldi r24, 0x20 ; 32 df0e: 0e 94 1f 64 call 0xc83e ; 0xc83e #endif // finally, set # lines, font size, etc.0 lcd_command(LCD_FUNCTIONSET | lcd_displayfunction); df12: 80 91 10 04 lds r24, 0x0410 ; 0x800410 <_ZL19lcd_displayfunction.lto_priv.549> delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); df16: 44 e6 ldi r20, 0x64 ; 100 df18: 50 e0 ldi r21, 0x00 ; 0 df1a: 60 e0 ldi r22, 0x00 ; 0 df1c: 80 62 ori r24, 0x20 ; 32 df1e: 0e 94 1f 64 call 0xc83e ; 0xc83e } // Turn the display on/off (quickly) void lcd_display(void) { lcd_displaycontrol |= LCD_DISPLAYON; df22: 84 e0 ldi r24, 0x04 ; 4 df24: 80 93 59 03 sts 0x0359, r24 ; 0x800359 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); df28: 44 e6 ldi r20, 0x64 ; 100 df2a: 50 e0 ldi r21, 0x00 ; 0 df2c: 60 e0 ldi r22, 0x00 ; 0 df2e: 8c e0 ldi r24, 0x0C ; 12 df30: 0e 94 1f 64 call 0xc83e ; 0xc83e 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(); df34: c1 11 cpse r28, r1 df36: 0e 94 2b 6f call 0xde56 ; 0xde56 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); df3a: 44 e6 ldi r20, 0x64 ; 100 df3c: 50 e0 ldi r21, 0x00 ; 0 df3e: 60 e0 ldi r22, 0x00 ; 0 df40: 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); } df42: cf 91 pop r28 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); df44: 0c 94 1f 64 jmp 0xc83e ; 0xc83e 0000df48 : fdev_setup_stream(lcdout, lcd_putchar, NULL, _FDEV_SETUP_WRITE); //setup lcdout stream } void lcd_refresh(void) { lcd_begin(1); df48: 81 e0 ldi r24, 0x01 ; 1 df4a: 0c 94 63 6f jmp 0xdec6 ; 0xdec6 0000df4e : { lcd_send(value, LOW, duration); } static void lcd_write(uint8_t value) { df4e: cf 92 push r12 df50: df 92 push r13 df52: ff 92 push r15 df54: 0f 93 push r16 df56: 1f 93 push r17 df58: cf 93 push r28 df5a: df 93 push r29 df5c: 00 d0 rcall .+0 ; 0xdf5e df5e: 00 d0 rcall .+0 ; 0xdf60 df60: 1f 92 push r1 df62: 1f 92 push r1 df64: cd b7 in r28, 0x3d ; 61 df66: de b7 in r29, 0x3e ; 62 if (value == '\n') { df68: 8a 30 cpi r24, 0x0A ; 10 df6a: d9 f4 brne .+54 ; 0xdfa2 if (lcd_currline > 3) lcd_currline = -1; df6c: 80 91 5b 03 lds r24, 0x035B ; 0x80035b df70: 84 30 cpi r24, 0x04 ; 4 df72: 18 f0 brcs .+6 ; 0xdf7a df74: 8f ef ldi r24, 0xFF ; 255 df76: 80 93 5b 03 sts 0x035B, r24 ; 0x80035b lcd_set_cursor(0, lcd_currline + 1); // LF df7a: 60 91 5b 03 lds r22, 0x035B ; 0x80035b df7e: 6f 5f subi r22, 0xFF ; 255 df80: 80 e0 ldi r24, 0x00 ; 0 df82: 0e 94 f8 6e call 0xddf0 ; 0xddf0 lcd_print_custom(value); } else { lcd_send(value, HIGH); lcd_ddram_address++; // no need for preventing ddram overflow } } df86: 28 96 adiw r28, 0x08 ; 8 df88: 0f b6 in r0, 0x3f ; 63 df8a: f8 94 cli df8c: de bf out 0x3e, r29 ; 62 df8e: 0f be out 0x3f, r0 ; 63 df90: cd bf out 0x3d, r28 ; 61 df92: df 91 pop r29 df94: cf 91 pop r28 df96: 1f 91 pop r17 df98: 0f 91 pop r16 df9a: ff 90 pop r15 df9c: df 90 pop r13 df9e: cf 90 pop r12 dfa0: 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))) { dfa2: 90 e8 ldi r25, 0x80 ; 128 dfa4: 98 0f add r25, r24 lcd_print_custom(value); } else { lcd_send(value, HIGH); dfa6: 44 e6 ldi r20, 0x64 ; 100 dfa8: 50 e0 ldi r21, 0x00 ; 0 dfaa: 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))) { dfac: 9a 34 cpi r25, 0x4A ; 74 dfae: 08 f5 brcc .+66 ; 0xdff2 // 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. dfb0: 48 2f mov r20, r24 dfb2: 40 58 subi r20, 0x80 ; 128 dfb4: 55 0b sbc r21, r21 dfb6: 9a 01 movw r18, r20 dfb8: 96 e0 ldi r25, 0x06 ; 6 dfba: 92 9f mul r25, r18 dfbc: a0 01 movw r20, r0 dfbe: 93 9f mul r25, r19 dfc0: 50 0d add r21, r0 dfc2: 11 24 eor r1, r1 dfc4: fa 01 movw r30, r20 dfc6: e9 50 subi r30, 0x09 ; 9 dfc8: f6 48 sbci r31, 0x86 ; 134 dfca: f4 90 lpm r15, Z dfcc: ec e5 ldi r30, 0x5C ; 92 dfce: f3 e0 ldi r31, 0x03 ; 3 dfd0: 30 e0 ldi r19, 0x00 ; 0 dfd2: 20 e0 ldi r18, 0x00 ; 0 int8_t slotToUse = -1; dfd4: 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)) { dfd6: 61 91 ld r22, Z+ dfd8: 78 2f mov r23, r24 dfda: 76 27 eor r23, r22 dfdc: 7f 77 andi r23, 0x7F ; 127 dfde: 89 f4 brne .+34 ; 0xe002 lcd_custom_characters[i] = c; // mark the custom character as used dfe0: f9 01 movw r30, r18 dfe2: e4 5a subi r30, 0xA4 ; 164 dfe4: fc 4f sbci r31, 0xFC ; 252 dfe6: 80 83 st Z, r24 dfe8: 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); dfea: 44 e6 ldi r20, 0x64 ; 100 dfec: 50 e0 ldi r21, 0x00 ; 0 dfee: 61 e0 ldi r22, 0x01 ; 1 dff0: 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); dff2: 0e 94 1f 64 call 0xc83e ; 0xc83e lcd_ddram_address++; // no need for preventing ddram overflow dff6: 80 91 5a 03 lds r24, 0x035A ; 0x80035a dffa: 8f 5f subi r24, 0xFF ; 255 dffc: 80 93 5a 03 sts 0x035A, r24 ; 0x80035a e000: c2 cf rjmp .-124 ; 0xdf86 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 e002: 6f 37 cpi r22, 0x7F ; 127 e004: 09 f0 breq .+2 ; 0xe008 e006: 3c c0 rjmp .+120 ; 0xe080 lcd_custom_characters[i] = c; // mark the custom character as used e008: f9 01 movw r30, r18 e00a: e4 5a subi r30, 0xA4 ; 164 e00c: fc 4f sbci r31, 0xFC ; 252 e00e: 80 83 st Z, r24 slotToUse = i; e010: 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; e012: f9 2e mov r15, r25 lcd_createChar_P(slotToUse, &Font[c - 0x80]); e014: fa 01 movw r30, r20 e016: ee 50 subi r30, 0x0E ; 14 e018: f6 48 sbci r31, 0x86 ; 134 "dec __zero_reg__" "\n\t" "brne forBegin_%=" "\n\t" : "=&d" (temp), "=&r" (colByte) : "z" (char_p), "e" (charmap) ); e01a: 8e 01 movw r16, r28 e01c: 0f 5f subi r16, 0xFF ; 255 e01e: 1f 4f sbci r17, 0xFF ; 255 e020: d8 01 movw r26, r16 e022: 95 91 lpm r25, Z+ e024: 88 e0 ldi r24, 0x08 ; 8 e026: 18 2e mov r1, r24 0000e028 : e028: 10 fe sbrs r1, 0 e02a: 05 90 lpm r0, Z+ e02c: 02 94 swap r0 e02e: 80 2d mov r24, r0 e030: 97 95 ror r25 e032: 88 1f adc r24, r24 e034: 8d 93 st X+, r24 e036: 1a 94 dec r1 e038: b9 f7 brne .-18 ; 0xe028 lcd_command(LCD_SETCGRAMADDR | (location << 3)); e03a: bf 2d mov r27, r15 e03c: e8 e0 ldi r30, 0x08 ; 8 e03e: be 02 muls r27, r30 e040: c0 01 movw r24, r0 e042: 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); e044: 44 e6 ldi r20, 0x64 ; 100 e046: 50 e0 ldi r21, 0x00 ; 0 e048: 60 e0 ldi r22, 0x00 ; 0 e04a: 80 64 ori r24, 0x40 ; 64 e04c: 0e 94 1f 64 call 0xc83e ; 0xc83e e050: 6e 01 movw r12, r28 e052: f9 e0 ldi r31, 0x09 ; 9 e054: cf 0e add r12, r31 e056: 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); e058: 44 e6 ldi r20, 0x64 ; 100 e05a: 50 e0 ldi r21, 0x00 ; 0 e05c: 61 e0 ldi r22, 0x01 ; 1 e05e: d8 01 movw r26, r16 e060: 8d 91 ld r24, X+ e062: 8d 01 movw r16, r26 e064: 0e 94 1f 64 call 0xc83e ; 0xc83e : "=&d" (temp), "=&r" (colByte) : "z" (char_p), "e" (charmap) ); lcd_command(LCD_SETCGRAMADDR | (location << 3)); for (uint8_t i = 0; i < 8; i++) { e068: c0 16 cp r12, r16 e06a: d1 06 cpc r13, r17 e06c: a9 f7 brne .-22 ; 0xe058 lcd_send(charmap[i], HIGH); } lcd_command(LCD_SETDDRAMADDR | lcd_ddram_address); // no need for masking the address e06e: 80 91 5a 03 lds r24, 0x035A ; 0x80035a delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); e072: 44 e6 ldi r20, 0x64 ; 100 e074: 50 e0 ldi r21, 0x00 ; 0 e076: 60 e0 ldi r22, 0x00 ; 0 e078: 80 68 ori r24, 0x80 ; 128 e07a: 0e 94 1f 64 call 0xc83e ; 0xc83e e07e: b5 cf rjmp .-150 ; 0xdfea 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 e080: 67 ff sbrs r22, 7 slotToUse = i; e082: 92 2f mov r25, r18 e084: 2f 5f subi r18, 0xFF ; 255 e086: 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++) { e088: 28 30 cpi r18, 0x08 ; 8 e08a: 31 05 cpc r19, r1 e08c: 09 f0 breq .+2 ; 0xe090 e08e: a3 cf rjmp .-186 ; 0xdfd6 } // 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) { e090: 9f 3f cpi r25, 0xFF ; 255 e092: 09 f0 breq .+2 ; 0xe096 e094: be cf rjmp .-132 ; 0xe012 e096: a9 cf rjmp .-174 ; 0xdfea 0000e098 : else lcd_printNumber(n, base); } void lcd_printNumber(unsigned long n, uint8_t base) { e098: 8f 92 push r8 e09a: 9f 92 push r9 e09c: af 92 push r10 e09e: bf 92 push r11 e0a0: ef 92 push r14 e0a2: ff 92 push r15 e0a4: 0f 93 push r16 e0a6: 1f 93 push r17 e0a8: cf 93 push r28 e0aa: df 93 push r29 e0ac: cd b7 in r28, 0x3d ; 61 e0ae: de b7 in r29, 0x3e ; 62 e0b0: a0 97 sbiw r28, 0x20 ; 32 e0b2: 0f b6 in r0, 0x3f ; 63 e0b4: f8 94 cli e0b6: de bf out 0x3e, r29 ; 62 e0b8: 0f be out 0x3f, r0 ; 63 e0ba: cd bf out 0x3d, r28 ; 61 unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; if (n == 0) e0bc: 61 15 cp r22, r1 e0be: 71 05 cpc r23, r1 e0c0: 81 05 cpc r24, r1 e0c2: 91 05 cpc r25, r1 e0c4: 99 f4 brne .+38 ; 0xe0ec } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e0c6: 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)); } e0c8: a0 96 adiw r28, 0x20 ; 32 e0ca: 0f b6 in r0, 0x3f ; 63 e0cc: f8 94 cli e0ce: de bf out 0x3e, r29 ; 62 e0d0: 0f be out 0x3f, r0 ; 63 e0d2: cd bf out 0x3d, r28 ; 61 e0d4: df 91 pop r29 e0d6: cf 91 pop r28 e0d8: 1f 91 pop r17 e0da: 0f 91 pop r16 e0dc: ff 90 pop r15 e0de: ef 90 pop r14 e0e0: bf 90 pop r11 e0e2: af 90 pop r10 e0e4: 9f 90 pop r9 e0e6: 8f 90 pop r8 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e0e8: 0c 94 a7 6f jmp 0xdf4e ; 0xdf4e } void lcd_printNumber(unsigned long n, uint8_t base) { unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; e0ec: 00 e0 ldi r16, 0x00 ; 0 lcd_print('0'); return; } while (n > 0) { buf[i++] = n % base; e0ee: 84 2e mov r8, r20 e0f0: 91 2c mov r9, r1 e0f2: b1 2c mov r11, r1 e0f4: a1 2c mov r10, r1 e0f6: 9e 01 movw r18, r28 e0f8: 2f 5f subi r18, 0xFF ; 255 e0fa: 3f 4f sbci r19, 0xFF ; 255 e0fc: 79 01 movw r14, r18 e0fe: a5 01 movw r20, r10 e100: 94 01 movw r18, r8 e102: 0f 94 4a dc call 0x3b894 ; 0x3b894 <__udivmodsi4> e106: f7 01 movw r30, r14 e108: e0 0f add r30, r16 e10a: f1 1d adc r31, r1 e10c: 60 83 st Z, r22 n /= base; e10e: b9 01 movw r22, r18 e110: ca 01 movw r24, r20 lcd_print('0'); return; } while (n > 0) { buf[i++] = n % base; e112: 0f 5f subi r16, 0xFF ; 255 if (n == 0) { lcd_print('0'); return; } while (n > 0) e114: 61 15 cp r22, r1 e116: 71 05 cpc r23, r1 e118: 81 05 cpc r24, r1 e11a: 91 05 cpc r25, r1 e11c: 81 f7 brne .-32 ; 0xe0fe e11e: 0e 0d add r16, r14 e120: 1f 2d mov r17, r15 e122: 11 1d adc r17, r1 { buf[i++] = n % base; n /= base; } for (; i > 0; i--) e124: e0 16 cp r14, r16 e126: f1 06 cpc r15, r17 e128: 59 f0 breq .+22 ; 0xe140 lcd_print((char) (buf[i - 1] < 10 ? '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); e12a: f8 01 movw r30, r16 e12c: 82 91 ld r24, -Z e12e: 8f 01 movw r16, r30 e130: 8a 30 cpi r24, 0x0A ; 10 e132: 20 f4 brcc .+8 ; 0xe13c e134: 80 5d subi r24, 0xD0 ; 208 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e136: 0e 94 a7 6f call 0xdf4e ; 0xdf4e e13a: f4 cf rjmp .-24 ; 0xe124 { 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)); e13c: 89 5c subi r24, 0xC9 ; 201 e13e: fb cf rjmp .-10 ; 0xe136 } e140: a0 96 adiw r28, 0x20 ; 32 e142: 0f b6 in r0, 0x3f ; 63 e144: f8 94 cli e146: de bf out 0x3e, r29 ; 62 e148: 0f be out 0x3f, r0 ; 63 e14a: cd bf out 0x3d, r28 ; 61 e14c: df 91 pop r29 e14e: cf 91 pop r28 e150: 1f 91 pop r17 e152: 0f 91 pop r16 e154: ff 90 pop r15 e156: ef 90 pop r14 e158: bf 90 pop r11 e15a: af 90 pop r10 e15c: 9f 90 pop r9 e15e: 8f 90 pop r8 e160: 08 95 ret 0000e162 : void lcd_print(unsigned int n, int base) { lcd_print((unsigned long) n, base); } void lcd_print(long n, int base) e162: cf 92 push r12 e164: df 92 push r13 e166: ef 92 push r14 e168: ff 92 push r15 e16a: 6b 01 movw r12, r22 e16c: 7c 01 movw r14, r24 { if (base == 0) lcd_write(n); else if (base == 10) { if (n < 0) e16e: f7 fe sbrs r15, 7 e170: 0b c0 rjmp .+22 ; 0xe188 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e172: 8d e2 ldi r24, 0x2D ; 45 e174: 0e 94 a7 6f call 0xdf4e ; 0xdf4e else if (base == 10) { if (n < 0) { lcd_print('-'); n = -n; e178: f0 94 com r15 e17a: e0 94 com r14 e17c: d0 94 com r13 e17e: c0 94 com r12 e180: c1 1c adc r12, r1 e182: d1 1c adc r13, r1 e184: e1 1c adc r14, r1 e186: f1 1c adc r15, r1 } lcd_printNumber(n, 10); e188: 4a e0 ldi r20, 0x0A ; 10 e18a: c7 01 movw r24, r14 e18c: b6 01 movw r22, r12 } else lcd_printNumber(n, base); } e18e: ff 90 pop r15 e190: ef 90 pop r14 e192: df 90 pop r13 e194: cf 90 pop r12 if (n < 0) { lcd_print('-'); n = -n; } lcd_printNumber(n, 10); e196: 0c 94 4c 70 jmp 0xe098 ; 0xe098 0000e19a : lcd_space(len); return len; } uint8_t lcd_print_pad_P(const char* s, uint8_t len) { e19a: 0f 93 push r16 e19c: 1f 93 push r17 e19e: cf 93 push r28 e1a0: 8c 01 movw r16, r24 e1a2: c6 2f mov r28, r22 while (len && pgm_read_byte(s)) { e1a4: cc 23 and r28, r28 e1a6: 59 f0 breq .+22 ; 0xe1be e1a8: f8 01 movw r30, r16 e1aa: 24 91 lpm r18, Z e1ac: 22 23 and r18, r18 e1ae: 39 f0 breq .+14 ; 0xe1be lcd_write(pgm_read_byte(s++)); e1b0: 0f 5f subi r16, 0xFF ; 255 e1b2: 1f 4f sbci r17, 0xFF ; 255 e1b4: 84 91 lpm r24, Z e1b6: 0e 94 a7 6f call 0xdf4e ; 0xdf4e --len; e1ba: c1 50 subi r28, 0x01 ; 1 e1bc: f3 cf rjmp .-26 ; 0xe1a4 } lcd_space(len); e1be: 8c 2f mov r24, r28 e1c0: 0e 94 ee 6e call 0xdddc ; 0xdddc return len; } e1c4: 8c 2f mov r24, r28 e1c6: cf 91 pop r28 e1c8: 1f 91 pop r17 e1ca: 0f 91 pop r16 e1cc: 08 95 ret 0000e1ce : { while (*s) lcd_write(*(s++)); } uint8_t lcd_print_pad(const char* s, uint8_t len) { e1ce: 0f 93 push r16 e1d0: 1f 93 push r17 e1d2: cf 93 push r28 e1d4: 8c 01 movw r16, r24 e1d6: c6 2f mov r28, r22 while (len && *s) { e1d8: cc 23 and r28, r28 e1da: 49 f0 breq .+18 ; 0xe1ee e1dc: f8 01 movw r30, r16 e1de: 81 91 ld r24, Z+ e1e0: 8f 01 movw r16, r30 e1e2: 88 23 and r24, r24 e1e4: 21 f0 breq .+8 ; 0xe1ee lcd_write(*(s++)); e1e6: 0e 94 a7 6f call 0xdf4e ; 0xdf4e --len; e1ea: c1 50 subi r28, 0x01 ; 1 e1ec: f5 cf rjmp .-22 ; 0xe1d8 } lcd_space(len); e1ee: 8c 2f mov r24, r28 e1f0: 0e 94 ee 6e call 0xdddc ; 0xdddc return len; } e1f4: 8c 2f mov r24, r28 e1f6: cf 91 pop r28 e1f8: 1f 91 pop r17 e1fa: 0f 91 pop r16 e1fc: 08 95 ret 0000e1fe : while (n--) lcd_putc(' '); } void lcd_print(const char* s) { e1fe: cf 93 push r28 e200: df 93 push r29 e202: ec 01 movw r28, r24 while (*s) lcd_write(*(s++)); e204: 89 91 ld r24, Y+ e206: 88 23 and r24, r24 e208: 19 f0 breq .+6 ; 0xe210 e20a: 0e 94 a7 6f call 0xdf4e ; 0xdf4e e20e: fa cf rjmp .-12 ; 0xe204 } e210: df 91 pop r29 e212: cf 91 pop r28 e214: 08 95 ret 0000e216 : lcd_command(LCD_ENTRYMODESET | lcd_displaymode); } static int lcd_putchar(char c, FILE *) { lcd_write(c); e216: 0e 94 a7 6f call 0xdf4e ; 0xdf4e return 0; } e21a: 90 e0 ldi r25, 0x00 ; 0 e21c: 80 e0 ldi r24, 0x00 ; 0 e21e: 08 95 ret 0000e220 : extern void lcd_frame_start(); //! @brief Consume click and longpress event inline void lcd_consume_click() { lcd_click_trigger = 0; e220: 10 92 a6 03 sts 0x03A6, r1 ; 0x8003a6 lcd_longpress_trigger = 0; e224: 10 92 d3 05 sts 0x05D3, r1 ; 0x8005d3 } e228: 08 95 ret 0000e22a : //! Generally is used in modal dialogs. //! //! @retval 0 not clicked //! @retval nonzero clicked uint8_t lcd_clicked(void) { e22a: cf 93 push r28 bool clicked = LCD_CLICKED; e22c: 80 91 a6 03 lds r24, 0x03A6 ; 0x8003a6 e230: c1 e0 ldi r28, 0x01 ; 1 e232: 81 11 cpse r24, r1 e234: 04 c0 rjmp .+8 ; 0xe23e e236: c0 e0 ldi r28, 0x00 ; 0 if(clicked) { lcd_consume_click(); } return clicked; } e238: 8c 2f mov r24, r28 e23a: cf 91 pop r28 e23c: 08 95 ret uint8_t lcd_clicked(void) { bool clicked = LCD_CLICKED; if(clicked) { lcd_consume_click(); e23e: 0e 94 10 71 call 0xe220 ; 0xe220 e242: fa cf rjmp .-12 ; 0xe238 0000e244 : if (lang == LANG_ID_PRI) return LANG_CODE_EN; //primary lang = EN #ifdef XFLASH if (lang == LANG_ID_SEC) { uint16_t ui = _SEC_LANG_TABLE; //table pointer if (pgm_read_dword(((uint32_t*)(ui + 0))) != LANG_MAGIC) return LANG_CODE_XX; //magic not valid e244: e0 e0 ldi r30, 0x00 ; 0 e246: f1 e0 ldi r31, 0x01 ; 1 e248: 85 91 lpm r24, Z+ e24a: 95 91 lpm r25, Z+ e24c: a5 91 lpm r26, Z+ e24e: b4 91 lpm r27, Z e250: 85 3a cpi r24, 0xA5 ; 165 e252: 9a 45 sbci r25, 0x5A ; 90 e254: a4 4b sbci r26, 0xB4 ; 180 e256: bb 44 sbci r27, 0x4B ; 75 e258: 29 f4 brne .+10 ; 0xe264 return pgm_read_word(((uint32_t*)(ui + 10))); //return lang code from progmem e25a: ea e0 ldi r30, 0x0A ; 10 e25c: f1 e0 ldi r31, 0x01 ; 1 e25e: 85 91 lpm r24, Z+ e260: 94 91 lpm r25, Z e262: 08 95 ret if (lang == LANG_ID_PRI) return LANG_CODE_EN; //primary lang = EN #ifdef XFLASH if (lang == LANG_ID_SEC) { uint16_t ui = _SEC_LANG_TABLE; //table pointer if (pgm_read_dword(((uint32_t*)(ui + 0))) != LANG_MAGIC) return LANG_CODE_XX; //magic not valid e264: 8f e3 ldi r24, 0x3F ; 63 e266: 9f e3 ldi r25, 0x3F ; 63 table += pgm_read_word((uint16_t*)(table + 4)); count++; } #endif //XFLASH return LANG_CODE_XX; } e268: 08 95 ret 0000e26a : 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); e26a: 8e ef ldi r24, 0xFE ; 254 e26c: 9f e0 ldi r25, 0x0F ; 15 e26e: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae return (lang_eeprom != LANG_ID_FORCE_SELECTION) && (lang_eeprom == lang_selected); e272: 8e 3f cpi r24, 0xFE ; 254 e274: 39 f0 breq .+14 ; 0xe284 e276: 91 e0 ldi r25, 0x01 ; 1 e278: 20 91 58 03 lds r18, 0x0358 ; 0x800358 e27c: 28 13 cpse r18, r24 e27e: 90 e0 ldi r25, 0x00 ; 0 e280: 89 2f mov r24, r25 e282: 08 95 ret e284: 80 e0 ldi r24, 0x00 ; 0 } e286: 08 95 ret 0000e288 : return _n("??"); } void lang_reset(void) { lang_selected = 0; e288: 10 92 58 03 sts 0x0358, r1 ; 0x800358 eeprom_update_byte((unsigned char*)EEPROM_LANG, LANG_ID_FORCE_SELECTION); e28c: 6e ef ldi r22, 0xFE ; 254 e28e: 8e ef ldi r24, 0xFE ; 254 e290: 9f e0 ldi r25, 0x0F ; 15 e292: 0d 94 fb db jmp 0x3b7f6 ; 0x3b7f6 0000e296 : return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e296: 85 37 cpi r24, 0x75 ; 117 e298: 28 e6 ldi r18, 0x68 ; 104 e29a: 92 07 cpc r25, r18 e29c: 09 f4 brne .+2 ; 0xe2a0 e29e: 59 c0 rjmp .+178 ; 0xe352 e2a0: f8 f4 brcc .+62 ; 0xe2e0 e2a2: 8e 36 cpi r24, 0x6E ; 110 e2a4: 25 e6 ldi r18, 0x65 ; 101 e2a6: 92 07 cpc r25, r18 e2a8: 09 f4 brne .+2 ; 0xe2ac e2aa: 59 c0 rjmp .+178 ; 0xe35e e2ac: 50 f4 brcc .+20 ; 0xe2c2 e2ae: 83 37 cpi r24, 0x73 ; 115 e2b0: 23 e6 ldi r18, 0x63 ; 99 e2b2: 92 07 cpc r25, r18 e2b4: b1 f1 breq .+108 ; 0xe322 e2b6: 85 36 cpi r24, 0x65 ; 101 e2b8: 94 46 sbci r25, 0x64 ; 100 e2ba: b1 f1 breq .+108 ; 0xe328 //#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("??"); e2bc: 88 ef ldi r24, 0xF8 ; 248 e2be: 95 e6 ldi r25, 0x65 ; 101 e2c0: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e2c2: 82 37 cpi r24, 0x72 ; 114 e2c4: 26 e6 ldi r18, 0x66 ; 102 e2c6: 92 07 cpc r25, r18 e2c8: 91 f1 breq .+100 ; 0xe32e e2ca: 82 37 cpi r24, 0x72 ; 114 e2cc: 28 e6 ldi r18, 0x68 ; 104 e2ce: 92 07 cpc r25, r18 e2d0: 09 f4 brne .+2 ; 0xe2d4 e2d2: 42 c0 rjmp .+132 ; 0xe358 e2d4: 83 37 cpi r24, 0x73 ; 115 e2d6: 95 46 sbci r25, 0x65 ; 101 e2d8: 89 f7 brne .-30 ; 0xe2bc { 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"); e2da: 8f e4 ldi r24, 0x4F ; 79 e2dc: 96 e6 ldi r25, 0x66 ; 102 e2de: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e2e0: 8c 36 cpi r24, 0x6C ; 108 e2e2: 20 e7 ldi r18, 0x70 ; 112 e2e4: 92 07 cpc r25, r18 e2e6: 31 f1 breq .+76 ; 0xe334 e2e8: 70 f4 brcc .+28 ; 0xe306 e2ea: 8c 36 cpi r24, 0x6C ; 108 e2ec: 2e e6 ldi r18, 0x6E ; 110 e2ee: 92 07 cpc r25, r18 e2f0: 21 f1 breq .+72 ; 0xe33a e2f2: 8f 36 cpi r24, 0x6F ; 111 e2f4: 2e e6 ldi r18, 0x6E ; 110 e2f6: 92 07 cpc r25, r18 e2f8: 31 f1 breq .+76 ; 0xe346 e2fa: 84 37 cpi r24, 0x74 ; 116 e2fc: 99 46 sbci r25, 0x69 ; 105 e2fe: f1 f6 brne .-68 ; 0xe2bc 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"); e300: 8d e3 ldi r24, 0x3D ; 61 e302: 96 e6 ldi r25, 0x66 ; 102 e304: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e306: 8b 36 cpi r24, 0x6B ; 107 e308: 23 e7 ldi r18, 0x73 ; 115 e30a: 92 07 cpc r25, r18 e30c: f9 f0 breq .+62 ; 0xe34c e30e: 86 37 cpi r24, 0x76 ; 118 e310: 23 e7 ldi r18, 0x73 ; 115 e312: 92 07 cpc r25, r18 e314: a9 f0 breq .+42 ; 0xe340 e316: 8f 36 cpi r24, 0x6F ; 111 e318: 92 47 sbci r25, 0x72 ; 114 e31a: 81 f6 brne .-96 ; 0xe2bc #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 e31c: 8b ef ldi r24, 0xFB ; 251 e31e: 95 e6 ldi r25, 0x65 ; 101 e320: 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"); e322: 8f e5 ldi r24, 0x5F ; 95 e324: 96 e6 ldi r25, 0x66 ; 102 e326: 08 95 ret case LANG_CODE_DE: return _n("Deutsch"); e328: 87 e5 ldi r24, 0x57 ; 87 e32a: 96 e6 ldi r25, 0x66 ; 102 e32c: 08 95 ret case LANG_CODE_ES: return _n("Espanol"); case LANG_CODE_FR: return _n("Francais"); e32e: 86 e4 ldi r24, 0x46 ; 70 e330: 96 e6 ldi r25, 0x66 ; 102 e332: 08 95 ret case LANG_CODE_IT: return _n("Italiano"); case LANG_CODE_PL: return _n("Polski"); e334: 86 e3 ldi r24, 0x36 ; 54 e336: 96 e6 ldi r25, 0x66 ; 102 e338: 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 e33a: 8b e2 ldi r24, 0x2B ; 43 e33c: 96 e6 ldi r25, 0x66 ; 102 e33e: 08 95 ret #endif // COMMUNITY_LANG_GROUP1_NL #ifdef COMMUNITY_LANG_GROUP1_SV case LANG_CODE_SV: return _n("Svenska"); //community Swedish contribution e340: 83 e2 ldi r24, 0x23 ; 35 e342: 96 e6 ldi r25, 0x66 ; 102 e344: 08 95 ret #endif // COMMUNITY_LANG_GROUP1_SV #ifdef COMMUNITY_LANG_GROUP1_NO case LANG_CODE_NO: return _n("Norsk"); //community Swedish contribution e346: 8d e1 ldi r24, 0x1D ; 29 e348: 96 e6 ldi r25, 0x66 ; 102 e34a: 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 e34c: 82 e1 ldi r24, 0x12 ; 18 e34e: 96 e6 ldi r25, 0x66 ; 102 e350: 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 e352: 8b e0 ldi r24, 0x0B ; 11 e354: 96 e6 ldi r25, 0x66 ; 102 e356: 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 e358: 82 e0 ldi r24, 0x02 ; 2 e35a: 96 e6 ldi r25, 0x66 ; 102 e35c: 08 95 ret const char* lang_get_name_by_code(uint16_t code) { switch (code) { case LANG_CODE_EN: return _n("English"); e35e: 87 e6 ldi r24, 0x67 ; 103 e360: 96 e6 ldi r25, 0x66 ; 102 // case LANG_CODE_QR: return _n("New language"); //community contribution //#endif // COMMUNITY_LANG_GROUP1_QR #endif // COMMUNITY_LANGUAGE_SUPPORT } return _n("??"); } e362: 08 95 ret 0000e364 : #endif //XFLASH return 0; } uint16_t lang_get_code(uint8_t lang) { e364: cf 92 push r12 e366: df 92 push r13 e368: ef 92 push r14 e36a: ff 92 push r15 e36c: 1f 93 push r17 e36e: cf 93 push r28 e370: df 93 push r29 e372: cd b7 in r28, 0x3d ; 61 e374: de b7 in r29, 0x3e ; 62 e376: 60 97 sbiw r28, 0x10 ; 16 e378: 0f b6 in r0, 0x3f ; 63 e37a: f8 94 cli e37c: de bf out 0x3e, r29 ; 62 e37e: 0f be out 0x3f, r0 ; 63 e380: cd bf out 0x3d, r28 ; 61 if (lang == LANG_ID_PRI) return LANG_CODE_EN; //primary lang = EN e382: 88 23 and r24, r24 e384: c1 f1 breq .+112 ; 0xe3f6 e386: 18 2f mov r17, r24 #ifdef XFLASH if (lang == LANG_ID_SEC) e388: 81 30 cpi r24, 0x01 ; 1 e38a: 81 f4 brne .+32 ; 0xe3ac e38c: 0e 94 22 71 call 0xe244 ; 0xe244 table += pgm_read_word((uint16_t*)(table + 4)); count++; } #endif //XFLASH return LANG_CODE_XX; } e390: 60 96 adiw r28, 0x10 ; 16 e392: 0f b6 in r0, 0x3f ; 63 e394: f8 94 cli e396: de bf out 0x3e, r29 ; 62 e398: 0f be out 0x3f, r0 ; 63 e39a: cd bf out 0x3d, r28 ; 61 e39c: df 91 pop r29 e39e: cf 91 pop r28 e3a0: 1f 91 pop r17 e3a2: ff 90 pop r15 e3a4: ef 90 pop r14 e3a6: df 90 pop r13 e3a8: cf 90 pop r12 e3aa: 08 95 ret SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; e3ac: 8c e5 ldi r24, 0x5C ; 92 e3ae: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; e3b0: 1d bc out 0x2d, r1 ; 45 return pgm_read_word(((uint32_t*)(ui + 10))); //return lang code from progmem } XFLASH_SPI_ENTER(); uint32_t addr = LANG_OFFSET; lang_table_header_t header; //table header structure lang--; e3b2: 11 50 subi r17, 0x01 ; 1 uint16_t ui = _SEC_LANG_TABLE; //table pointer if (pgm_read_dword(((uint32_t*)(ui + 0))) != LANG_MAGIC) return LANG_CODE_XX; //magic not valid return pgm_read_word(((uint32_t*)(ui + 10))); //return lang code from progmem } XFLASH_SPI_ENTER(); uint32_t addr = LANG_OFFSET; e3b4: c1 2c mov r12, r1 e3b6: d1 2c mov r13, r1 e3b8: 76 01 movw r14, r12 lang_table_header_t header; //table header structure lang--; while (1) { xflash_rd_data(addr, (uint8_t*)&header, sizeof(lang_table_header_t)); //read table header from xflash e3ba: 20 e1 ldi r18, 0x10 ; 16 e3bc: 30 e0 ldi r19, 0x00 ; 0 e3be: ae 01 movw r20, r28 e3c0: 4f 5f subi r20, 0xFF ; 255 e3c2: 5f 4f sbci r21, 0xFF ; 255 e3c4: c7 01 movw r24, r14 e3c6: b6 01 movw r22, r12 e3c8: 0e 94 c2 ec call 0x1d984 ; 0x1d984 if (header.magic != LANG_MAGIC) break; //break if not valid e3cc: 89 81 ldd r24, Y+1 ; 0x01 e3ce: 9a 81 ldd r25, Y+2 ; 0x02 e3d0: ab 81 ldd r26, Y+3 ; 0x03 e3d2: bc 81 ldd r27, Y+4 ; 0x04 e3d4: 85 3a cpi r24, 0xA5 ; 165 e3d6: 9a 45 sbci r25, 0x5A ; 90 e3d8: a4 4b sbci r26, 0xB4 ; 180 e3da: bb 44 sbci r27, 0x4B ; 75 e3dc: 79 f4 brne .+30 ; 0xe3fc if (--lang == 0) return header.code; e3de: 11 50 subi r17, 0x01 ; 1 e3e0: 19 f4 brne .+6 ; 0xe3e8 e3e2: 8b 85 ldd r24, Y+11 ; 0x0b e3e4: 9c 85 ldd r25, Y+12 ; 0x0c e3e6: d4 cf rjmp .-88 ; 0xe390 addr += header.size; //calc address of next table e3e8: 8d 81 ldd r24, Y+5 ; 0x05 e3ea: 9e 81 ldd r25, Y+6 ; 0x06 e3ec: c8 0e add r12, r24 e3ee: d9 1e adc r13, r25 e3f0: e1 1c adc r14, r1 e3f2: f1 1c adc r15, r1 e3f4: e2 cf rjmp .-60 ; 0xe3ba return 0; } uint16_t lang_get_code(uint8_t lang) { if (lang == LANG_ID_PRI) return LANG_CODE_EN; //primary lang = EN e3f6: 8e e6 ldi r24, 0x6E ; 110 e3f8: 95 e6 ldi r25, 0x65 ; 101 e3fa: ca cf rjmp .-108 ; 0xe390 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; e3fc: 8f e3 ldi r24, 0x3F ; 63 e3fe: 9f e3 ldi r25, 0x3F ; 63 e400: c7 cf rjmp .-114 ; 0xe390 0000e402 : sum = (sum >> 8) | ((sum & 0xff) << 8); //swap bytes return (sum == lt_sum); } uint8_t lang_get_count() { e402: cf 92 push r12 e404: df 92 push r13 e406: ef 92 push r14 e408: ff 92 push r15 e40a: 1f 93 push r17 e40c: cf 93 push r28 e40e: df 93 push r29 e410: cd b7 in r28, 0x3d ; 61 e412: de b7 in r29, 0x3e ; 62 e414: 60 97 sbiw r28, 0x10 ; 16 e416: 0f b6 in r0, 0x3f ; 63 e418: f8 94 cli e41a: de bf out 0x3e, r29 ; 62 e41c: 0f be out 0x3f, r0 ; 63 e41e: cd bf out 0x3d, r28 ; 61 if (pgm_read_dword(((uint32_t*)(_PRI_LANG_SIGNATURE))) == 0xffffffff) e420: ee ee ldi r30, 0xEE ; 238 e422: f9 e7 ldi r31, 0x79 ; 121 e424: 85 91 lpm r24, Z+ e426: 95 91 lpm r25, Z+ e428: a5 91 lpm r26, Z+ e42a: b4 91 lpm r27, Z return 1; //signature not set - only primary language will be available e42c: 11 e0 ldi r17, 0x01 ; 1 return (sum == lt_sum); } uint8_t lang_get_count() { if (pgm_read_dword(((uint32_t*)(_PRI_LANG_SIGNATURE))) == 0xffffffff) e42e: 8f 3f cpi r24, 0xFF ; 255 e430: 9f 4f sbci r25, 0xFF ; 255 e432: af 4f sbci r26, 0xFF ; 255 e434: bf 4f sbci r27, 0xFF ; 255 e436: 09 f1 breq .+66 ; 0xe47a SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; e438: 8c e5 ldi r24, 0x5C ; 92 e43a: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; e43c: 1d bc out 0x2d, r1 ; 45 return 1; //signature not set - only primary language will be available #ifdef XFLASH XFLASH_SPI_ENTER(); uint8_t count = 2; //count = 1+n (primary + secondary + all in xflash) uint32_t addr = LANG_OFFSET; e43e: c1 2c mov r12, r1 e440: d1 2c mov r13, r1 e442: 76 01 movw r14, r12 { if (pgm_read_dword(((uint32_t*)(_PRI_LANG_SIGNATURE))) == 0xffffffff) return 1; //signature not set - only primary language will be available #ifdef XFLASH XFLASH_SPI_ENTER(); uint8_t count = 2; //count = 1+n (primary + secondary + all in xflash) e444: 12 e0 ldi r17, 0x02 ; 2 uint32_t addr = LANG_OFFSET; lang_table_header_t header; //table header structure while (1) { xflash_rd_data(addr, (uint8_t*)&header, sizeof(lang_table_header_t)); //read table header from xflash e446: 20 e1 ldi r18, 0x10 ; 16 e448: 30 e0 ldi r19, 0x00 ; 0 e44a: ae 01 movw r20, r28 e44c: 4f 5f subi r20, 0xFF ; 255 e44e: 5f 4f sbci r21, 0xFF ; 255 e450: c7 01 movw r24, r14 e452: b6 01 movw r22, r12 e454: 0e 94 c2 ec call 0x1d984 ; 0x1d984 if (header.magic != LANG_MAGIC) break; //break if magic not valid e458: 89 81 ldd r24, Y+1 ; 0x01 e45a: 9a 81 ldd r25, Y+2 ; 0x02 e45c: ab 81 ldd r26, Y+3 ; 0x03 e45e: bc 81 ldd r27, Y+4 ; 0x04 e460: 85 3a cpi r24, 0xA5 ; 165 e462: 9a 45 sbci r25, 0x5A ; 90 e464: a4 4b sbci r26, 0xB4 ; 180 e466: bb 44 sbci r27, 0x4B ; 75 e468: 41 f4 brne .+16 ; 0xe47a addr += header.size; //calc address of next table e46a: 8d 81 ldd r24, Y+5 ; 0x05 e46c: 9e 81 ldd r25, Y+6 ; 0x06 e46e: c8 0e add r12, r24 e470: d9 1e adc r13, r25 e472: e1 1c adc r14, r1 e474: f1 1c adc r15, r1 count++; //inc counter e476: 1f 5f subi r17, 0xFF ; 255 e478: e6 cf rjmp .-52 ; 0xe446 table += pgm_read_word((uint16_t*)(table + 4)); count++; } #endif //XFLASH return count; } e47a: 81 2f mov r24, r17 e47c: 60 96 adiw r28, 0x10 ; 16 e47e: 0f b6 in r0, 0x3f ; 63 e480: f8 94 cli e482: de bf out 0x3e, r29 ; 62 e484: 0f be out 0x3f, r0 ; 63 e486: cd bf out 0x3d, r28 ; 61 e488: df 91 pop r29 e48a: cf 91 pop r28 e48c: 1f 91 pop r17 e48e: ff 90 pop r15 e490: ef 90 pop r14 e492: df 90 pop r13 e494: cf 90 pop r12 e496: 08 95 ret 0000e498 : 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) { e498: 0f 93 push r16 e49a: 1f 93 push r17 e49c: cf 93 push r28 e49e: c8 2f mov r28, r24 if (lang == LANG_ID_PRI) //primary language e4a0: 81 11 cpse r24, r1 e4a2: 06 c0 rjmp .+12 ; 0xe4b0 { lang_table = 0; e4a4: 10 92 57 03 sts 0x0357, r1 ; 0x800357 e4a8: 10 92 56 03 sts 0x0356, r1 ; 0x800356 lang_selected = lang; e4ac: 10 92 58 03 sts 0x0358, r1 ; 0x800358 } #ifdef XFLASH if (lang_get_code(lang) == lang_get_code(LANG_ID_SEC)) lang = LANG_ID_SEC; e4b0: 8c 2f mov r24, r28 e4b2: 0e 94 b2 71 call 0xe364 ; 0xe364 e4b6: 8c 01 movw r16, r24 e4b8: 0e 94 22 71 call 0xe244 ; 0xe244 e4bc: 08 17 cp r16, r24 e4be: 19 07 cpc r17, r25 e4c0: 19 f0 breq .+6 ; 0xe4c8 if (lang == LANG_ID_SEC) //current secondary language e4c2: c1 30 cpi r28, 0x01 ; 1 e4c4: 09 f0 breq .+2 ; 0xe4c8 e4c6: 3e c0 rjmp .+124 ; 0xe544 { if (pgm_read_dword(((uint32_t*)_SEC_LANG_TABLE)) == LANG_MAGIC) //magic valid e4c8: e0 e0 ldi r30, 0x00 ; 0 e4ca: f1 e0 ldi r31, 0x01 ; 1 e4cc: 85 91 lpm r24, Z+ e4ce: 95 91 lpm r25, Z+ e4d0: a5 91 lpm r26, Z+ e4d2: b4 91 lpm r27, Z e4d4: 85 3a cpi r24, 0xA5 ; 165 e4d6: 9a 45 sbci r25, 0x5A ; 90 e4d8: a4 4b sbci r26, 0xB4 ; 180 e4da: bb 44 sbci r27, 0x4B ; 75 e4dc: 09 f0 breq .+2 ; 0xe4e0 e4de: 31 c0 rjmp .+98 ; 0xe542 } uint8_t lang_check(uint16_t addr) { uint16_t sum = 0; uint16_t size = pgm_read_word((uint16_t*)(addr + 4)); e4e0: e4 e0 ldi r30, 0x04 ; 4 e4e2: f1 e0 ldi r31, 0x01 ; 1 e4e4: 65 91 lpm r22, Z+ e4e6: 74 91 lpm r23, Z uint16_t lt_sum = pgm_read_word((uint16_t*)(addr + 8)); e4e8: e8 e0 ldi r30, 0x08 ; 8 e4ea: f1 e0 ldi r31, 0x01 ; 1 e4ec: 45 91 lpm r20, Z+ e4ee: 54 91 lpm r21, Z uint16_t i; for (i = 0; i < size; i++) e4f0: 30 e0 ldi r19, 0x00 ; 0 e4f2: 20 e0 ldi r18, 0x00 ; 0 return 0; } uint8_t lang_check(uint16_t addr) { uint16_t sum = 0; e4f4: 90 e0 ldi r25, 0x00 ; 0 e4f6: 80 e0 ldi r24, 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++) e4f8: 62 17 cp r22, r18 e4fa: 73 07 cpc r23, r19 e4fc: 89 f5 brne .+98 ; 0xe560 sum += (uint16_t)pgm_read_byte((uint8_t*)(addr + i)) << ((i & 1)?0:8); sum -= lt_sum; //subtract checksum e4fe: 84 1b sub r24, r20 e500: 95 0b sbc r25, r21 sum = (sum >> 8) | ((sum & 0xff) << 8); //swap bytes e502: 98 27 eor r25, r24 e504: 89 27 eor r24, r25 e506: 98 27 eor r25, r24 if (lang_get_code(lang) == lang_get_code(LANG_ID_SEC)) lang = LANG_ID_SEC; if (lang == LANG_ID_SEC) //current secondary language { if (pgm_read_dword(((uint32_t*)_SEC_LANG_TABLE)) == LANG_MAGIC) //magic valid { if (lang_check(_SEC_LANG_TABLE)) e508: 48 17 cp r20, r24 e50a: 59 07 cpc r21, r25 e50c: d1 f4 brne .+52 ; 0xe542 if (pgm_read_dword(((uint32_t*)(_SEC_LANG_TABLE + 12))) == pgm_read_dword(((uint32_t*)(_PRI_LANG_SIGNATURE)))) //signature valid e50e: ec e0 ldi r30, 0x0C ; 12 e510: f1 e0 ldi r31, 0x01 ; 1 e512: 45 91 lpm r20, Z+ e514: 55 91 lpm r21, Z+ e516: 65 91 lpm r22, Z+ e518: 74 91 lpm r23, Z e51a: ee ee ldi r30, 0xEE ; 238 e51c: f9 e7 ldi r31, 0x79 ; 121 e51e: 85 91 lpm r24, Z+ e520: 95 91 lpm r25, Z+ e522: a5 91 lpm r26, Z+ e524: b4 91 lpm r27, Z e526: 48 17 cp r20, r24 e528: 59 07 cpc r21, r25 e52a: 6a 07 cpc r22, r26 e52c: 7b 07 cpc r23, r27 e52e: 49 f4 brne .+18 ; 0xe542 { lang_table = (lang_table_t*)(_SEC_LANG_TABLE); // set table pointer e530: 80 e0 ldi r24, 0x00 ; 0 e532: 91 e0 ldi r25, 0x01 ; 1 e534: 90 93 57 03 sts 0x0357, r25 ; 0x800357 e538: 80 93 56 03 sts 0x0356, r24 ; 0x800356 lang_selected = lang; // set language id e53c: 81 e0 ldi r24, 0x01 ; 1 e53e: 80 93 58 03 sts 0x0358, r24 ; 0x800358 if (lang == LANG_ID_SEC) //current secondary language { if (pgm_read_dword(((uint32_t*)_SEC_LANG_TABLE)) == LANG_MAGIC) //magic valid { if (lang_check(_SEC_LANG_TABLE)) if (pgm_read_dword(((uint32_t*)(_SEC_LANG_TABLE + 12))) == pgm_read_dword(((uint32_t*)(_PRI_LANG_SIGNATURE)))) //signature valid e542: c1 e0 ldi r28, 0x01 ; 1 lang_selected = lang; // set language id } } } #endif //XFLASH if (lang_selected == lang) e544: 80 91 58 03 lds r24, 0x0358 ; 0x800358 e548: 8c 13 cpse r24, r28 e54a: 1c c0 rjmp .+56 ; 0xe584 { eeprom_update_byte((unsigned char*)EEPROM_LANG, lang_selected); e54c: 6c 2f mov r22, r28 e54e: 8e ef ldi r24, 0xFE ; 254 e550: 9f e0 ldi r25, 0x0F ; 15 e552: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 return 1; e556: 81 e0 ldi r24, 0x01 ; 1 } return 0; } e558: cf 91 pop r28 e55a: 1f 91 pop r17 e55c: 0f 91 pop r16 e55e: 08 95 ret { 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); e560: f9 01 movw r30, r18 e562: e0 50 subi r30, 0x00 ; 0 e564: ff 4f sbci r31, 0xFF ; 255 e566: e4 91 lpm r30, Z e568: f0 e0 ldi r31, 0x00 ; 0 e56a: a8 e0 ldi r26, 0x08 ; 8 e56c: 20 fd sbrc r18, 0 e56e: a0 e0 ldi r26, 0x00 ; 0 e570: 02 c0 rjmp .+4 ; 0xe576 e572: ee 0f add r30, r30 e574: ff 1f adc r31, r31 e576: aa 95 dec r26 e578: e2 f7 brpl .-8 ; 0xe572 e57a: 8e 0f add r24, r30 e57c: 9f 1f adc r25, 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++) e57e: 2f 5f subi r18, 0xFF ; 255 e580: 3f 4f sbci r19, 0xFF ; 255 e582: ba cf rjmp .-140 ; 0xe4f8 if (lang_selected == lang) { eeprom_update_byte((unsigned char*)EEPROM_LANG, lang_selected); return 1; } return 0; e584: 80 e0 ldi r24, 0x00 ; 0 e586: e8 cf rjmp .-48 ; 0xe558 0000e588 : //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. e588: 20 91 58 03 lds r18, 0x0358 ; 0x800358 e58c: 21 11 cpse r18, r1 e58e: 04 c0 rjmp .+8 ; 0xe598 e590: fc 01 movw r30, r24 e592: 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 } e594: cf 01 movw r24, r30 e596: 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. e598: 40 91 56 03 lds r20, 0x0356 ; 0x800356 e59c: 50 91 57 03 lds r21, 0x0357 ; 0x800357 e5a0: 41 15 cp r20, r1 e5a2: 51 05 cpc r21, r1 e5a4: a9 f3 breq .-22 ; 0xe590 uint16_t ui = pgm_read_word(((uint16_t*)s)); //read string id e5a6: fc 01 movw r30, r24 e5a8: 25 91 lpm r18, Z+ e5aa: 34 91 lpm r19, Z if (ui == 0xffff) return s + 2; //id not assigned, return orig. str. e5ac: 2f 3f cpi r18, 0xFF ; 255 e5ae: 32 07 cpc r19, r18 e5b0: 79 f3 breq .-34 ; 0xe590 ui = pgm_read_word(((uint16_t*)(((char*)lang_table + 16 + ui*2)))); //read relative offset e5b2: f9 01 movw r30, r18 e5b4: 38 96 adiw r30, 0x08 ; 8 e5b6: ee 0f add r30, r30 e5b8: ff 1f adc r31, r31 e5ba: e4 0f add r30, r20 e5bc: f5 1f adc r31, r21 e5be: 25 91 lpm r18, Z+ e5c0: 34 91 lpm r19, Z if (pgm_read_byte(((uint8_t*)((char*)lang_table + ui))) == 0) //read first character e5c2: fa 01 movw r30, r20 e5c4: e2 0f add r30, r18 e5c6: f3 1f adc r31, r19 e5c8: 24 91 lpm r18, Z e5ca: 22 23 and r18, r18 e5cc: 09 f3 breq .-62 ; 0xe590 e5ce: e2 cf rjmp .-60 ; 0xe594 0000e5d0 : } sound_wait_for_user_reset(); } void M600_load_filament_movements(const char* filament_name) { e5d0: cf 93 push r28 e5d2: df 93 push r29 e5d4: ec 01 movw r28, r24 current_position[E_AXIS]+= FILAMENTCHANGE_FIRSTFEED; e5d6: 20 e0 ldi r18, 0x00 ; 0 e5d8: 30 e0 ldi r19, 0x00 ; 0 e5da: 4c e8 ldi r20, 0x8C ; 140 e5dc: 52 e4 ldi r21, 0x42 ; 66 e5de: 60 91 9d 06 lds r22, 0x069D ; 0x80069d e5e2: 70 91 9e 06 lds r23, 0x069E ; 0x80069e e5e6: 80 91 9f 06 lds r24, 0x069F ; 0x80069f e5ea: 90 91 a0 06 lds r25, 0x06A0 ; 0x8006a0 e5ee: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> e5f2: 60 93 9d 06 sts 0x069D, r22 ; 0x80069d e5f6: 70 93 9e 06 sts 0x069E, r23 ; 0x80069e e5fa: 80 93 9f 06 sts 0x069F, r24 ; 0x80069f e5fe: 90 93 a0 06 sts 0x06A0, r25 ; 0x8006a0 plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FIRST); e602: 60 e0 ldi r22, 0x00 ; 0 e604: 70 e0 ldi r23, 0x00 ; 0 e606: 80 ea ldi r24, 0xA0 ; 160 e608: 91 e4 ldi r25, 0x41 ; 65 e60a: 0f 94 04 c0 call 0x38008 ; 0x38008 load_filament_final_feed(); e60e: 0e 94 ab 64 call 0xc956 ; 0xc956 } void lcd_loading_filament(const char* filament_name) { lcd_clear(); e612: 0e 94 2b 6f call 0xde56 ; 0xde56 lcd_puts_at_P(0, 0, _T(MSG_LOADING_FILAMENT)); e616: 81 e7 ldi r24, 0x71 ; 113 e618: 9c e5 ldi r25, 0x5C ; 92 e61a: 0e 94 c4 72 call 0xe588 ; 0xe588 e61e: ac 01 movw r20, r24 e620: 60 e0 ldi r22, 0x00 ; 0 e622: 80 e0 ldi r24, 0x00 ; 0 e624: 0e 94 0c 6f call 0xde18 ; 0xde18 if (filament_name[0]) { e628: 88 81 ld r24, Y e62a: 88 23 and r24, r24 e62c: 39 f0 breq .+14 ; 0xe63c lcd_set_cursor(0, 1); e62e: 61 e0 ldi r22, 0x01 ; 1 e630: 80 e0 ldi r24, 0x00 ; 0 e632: 0e 94 f8 6e call 0xddf0 ; 0xddf0 lcd_print(filament_name); e636: ce 01 movw r24, r28 e638: 0e 94 ff 70 call 0xe1fe ; 0xe1fe } lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); e63c: 8a ee ldi r24, 0xEA ; 234 e63e: 99 e3 ldi r25, 0x39 ; 57 e640: 0e 94 c4 72 call 0xe588 ; 0xe588 e644: ac 01 movw r20, r24 e646: 62 e0 ldi r22, 0x02 ; 2 e648: 80 e0 ldi r24, 0x00 ; 0 e64a: 0e 94 0c 6f call 0xde18 ; 0xde18 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 e64e: 83 e4 ldi r24, 0x43 ; 67 e650: 9b e2 ldi r25, 0x2B ; 43 e652: 0f 94 45 20 call 0x2408a ; 0x2408a lcd_loading_filament(filament_name); st_synchronize(); } e656: df 91 pop r29 e658: 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(); e65a: 0d 94 a3 42 jmp 0x28546 ; 0x28546 0000e65e : * 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; e65e: 0f 94 74 74 call 0x2e8e8 ; 0x2e8e8 e662: 8f 3f cpi r24, 0xFF ; 255 e664: 11 f1 breq .+68 ; 0xe6aa lcd_update_enable(false); e666: 80 e0 ldi r24, 0x00 ; 0 e668: 0e 94 3d 6f call 0xde7a ; 0xde7a lcd_clear(); e66c: 0e 94 2b 6f call 0xde56 ; 0xde56 lcd_puts_at_P(0, 1, _T(MSG_UNLOADING_FILAMENT)); e670: 88 e3 ldi r24, 0x38 ; 56 e672: 93 e5 ldi r25, 0x53 ; 83 e674: 0e 94 c4 72 call 0xe588 ; 0xe588 e678: ac 01 movw r20, r24 e67a: 61 e0 ldi r22, 0x01 ; 1 e67c: 80 e0 ldi r24, 0x00 ; 0 e67e: 0e 94 0c 6f call 0xde18 ; 0xde18 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e682: 80 e2 ldi r24, 0x20 ; 32 e684: 0e 94 a7 6f call 0xdf4e ; 0xdf4e lcd_print(' '); lcd_print(MMU2::mmu2.get_current_tool() + 1); e688: 0f 94 74 74 call 0x2e8e8 ; 0x2e8e8 e68c: 68 2f mov r22, r24 e68e: 70 e0 ldi r23, 0x00 ; 0 e690: 6f 5f subi r22, 0xFF ; 255 e692: 7f 4f sbci r23, 0xFF ; 255 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); e694: 07 2e mov r0, r23 e696: 00 0c add r0, r0 e698: 88 0b sbc r24, r24 e69a: 99 0b sbc r25, r25 e69c: 0e 94 b1 70 call 0xe162 ; 0xe162 // unload just current filament for multimaterial printers (used also in M702) MMU2::mmu2.unload(); e6a0: 0f 94 f8 ac call 0x359f0 ; 0x359f0 lcd_update_enable(true); e6a4: 81 e0 ldi r24, 0x01 ; 1 e6a6: 0c 94 3d 6f jmp 0xde7a ; 0xde7a } e6aa: 08 95 ret 0000e6ac : } #ifdef TMC2130 bool calibrate_z_auto() { e6ac: 4f 92 push r4 e6ae: 5f 92 push r5 e6b0: 6f 92 push r6 e6b2: 7f 92 push r7 e6b4: 8f 92 push r8 e6b6: 9f 92 push r9 e6b8: af 92 push r10 e6ba: bf 92 push r11 e6bc: ef 92 push r14 e6be: ff 92 push r15 e6c0: 0f 93 push r16 e6c2: 1f 93 push r17 e6c4: cf 93 push r28 e6c6: df 93 push r29 //lcd_display_message_fullscreen_P(_T(MSG_CALIBRATE_Z_AUTO)); lcd_clear(); e6c8: 0e 94 2b 6f call 0xde56 ; 0xde56 lcd_puts_at_P(0, 1, _T(MSG_CALIBRATE_Z_AUTO)); e6cc: 8e e2 ldi r24, 0x2E ; 46 e6ce: 9e e4 ldi r25, 0x4E ; 78 e6d0: 0e 94 c4 72 call 0xe588 ; 0xe588 e6d4: ac 01 movw r20, r24 e6d6: 61 e0 ldi r22, 0x01 ; 1 e6d8: 80 e0 ldi r24, 0x00 ; 0 e6da: 0e 94 0c 6f call 0xde18 ; 0xde18 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; e6de: d0 91 b7 02 lds r29, 0x02B7 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> check_endstops = check; e6e2: 81 e0 ldi r24, 0x01 ; 1 e6e4: 80 93 b7 02 sts 0x02B7, r24 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> #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); e6e8: ec e7 ldi r30, 0x7C ; 124 e6ea: fc e7 ldi r31, 0x7C ; 124 e6ec: c4 91 lpm r28, Z //lcd_display_message_fullscreen_P(_T(MSG_CALIBRATE_Z_AUTO)); lcd_clear(); lcd_puts_at_P(0, 1, _T(MSG_CALIBRATE_Z_AUTO)); bool endstops_enabled = enable_endstops(true); int axis_up_dir = -home_dir(Z_AXIS); tmc2130_home_enter(Z_AXIS_MASK); e6ee: 84 e0 ldi r24, 0x04 ; 4 e6f0: 0f 94 ae 25 call 0x24b5c ; 0x24b5c current_position[Z_AXIS] = 0; e6f4: 81 e9 ldi r24, 0x91 ; 145 e6f6: e8 2e mov r14, r24 e6f8: 86 e0 ldi r24, 0x06 ; 6 e6fa: f8 2e mov r15, r24 e6fc: f7 01 movw r30, r14 e6fe: 10 86 std Z+8, r1 ; 0x08 e700: 11 86 std Z+9, r1 ; 0x09 e702: 12 86 std Z+10, r1 ; 0x0a e704: 13 86 std Z+11, r1 ; 0x0b plan_set_position_curposXYZE(); e706: 0f 94 c4 be call 0x37d88 ; 0x37d88 set_destination_to_current(); e70a: 0e 94 52 68 call 0xd0a4 ; 0xd0a4 #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); e70e: e6 e7 ldi r30, 0x76 ; 118 e710: fc e7 ldi r31, 0x7C ; 124 e712: 85 90 lpm r8, Z+ e714: 95 90 lpm r9, Z+ e716: a5 90 lpm r10, Z+ e718: b4 90 lpm r11, Z int axis_up_dir = -home_dir(Z_AXIS); tmc2130_home_enter(Z_AXIS_MASK); current_position[Z_AXIS] = 0; plan_set_position_curposXYZE(); set_destination_to_current(); destination[Z_AXIS] += (1.1 * max_length(Z_AXIS) * axis_up_dir); e71a: 03 e7 ldi r16, 0x73 ; 115 e71c: 16 e0 ldi r17, 0x06 ; 6 { //lcd_display_message_fullscreen_P(_T(MSG_CALIBRATE_Z_AUTO)); lcd_clear(); lcd_puts_at_P(0, 1, _T(MSG_CALIBRATE_Z_AUTO)); bool endstops_enabled = enable_endstops(true); int axis_up_dir = -home_dir(Z_AXIS); e71e: 8c 2f mov r24, r28 e720: 99 27 eor r25, r25 e722: 81 95 neg r24 e724: 0c f4 brge .+2 ; 0xe728 e726: 90 95 com r25 e728: bc 01 movw r22, r24 tmc2130_home_enter(Z_AXIS_MASK); current_position[Z_AXIS] = 0; plan_set_position_curposXYZE(); set_destination_to_current(); destination[Z_AXIS] += (1.1 * max_length(Z_AXIS) * axis_up_dir); e72a: 07 2e mov r0, r23 e72c: 00 0c add r0, r0 e72e: 88 0b sbc r24, r24 e730: 99 0b sbc r25, r25 e732: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> e736: 2b 01 movw r4, r22 e738: 3c 01 movw r6, r24 e73a: 2d ec ldi r18, 0xCD ; 205 e73c: 3c ec ldi r19, 0xCC ; 204 e73e: 4c e8 ldi r20, 0x8C ; 140 e740: 5f e3 ldi r21, 0x3F ; 63 e742: c5 01 movw r24, r10 e744: b4 01 movw r22, r8 e746: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> e74a: 9b 01 movw r18, r22 e74c: ac 01 movw r20, r24 e74e: c3 01 movw r24, r6 e750: b2 01 movw r22, r4 e752: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> e756: f8 01 movw r30, r16 e758: 20 85 ldd r18, Z+8 ; 0x08 e75a: 31 85 ldd r19, Z+9 ; 0x09 e75c: 42 85 ldd r20, Z+10 ; 0x0a e75e: 53 85 ldd r21, Z+11 ; 0x0b e760: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> e764: f8 01 movw r30, r16 e766: 60 87 std Z+8, r22 ; 0x08 e768: 71 87 std Z+9, r23 ; 0x09 e76a: 82 87 std Z+10, r24 ; 0x0a e76c: 93 87 std Z+11, r25 ; 0x0b feedrate = homing_feedrate[Z_AXIS]; e76e: 80 e0 ldi r24, 0x00 ; 0 e770: 90 e0 ldi r25, 0x00 ; 0 e772: a8 e4 ldi r26, 0x48 ; 72 e774: b4 e4 ldi r27, 0x44 ; 68 e776: 80 93 b8 02 sts 0x02B8, r24 ; 0x8002b8 e77a: 90 93 b9 02 sts 0x02B9, r25 ; 0x8002b9 e77e: a0 93 ba 02 sts 0x02BA, r26 ; 0x8002ba e782: b0 93 bb 02 sts 0x02BB, r27 ; 0x8002bb plan_buffer_line_destinationXYZE(feedrate / 60); e786: 65 e5 ldi r22, 0x55 ; 85 e788: 75 e5 ldi r23, 0x55 ; 85 e78a: 85 e5 ldi r24, 0x55 ; 85 e78c: 91 e4 ldi r25, 0x41 ; 65 e78e: 0f 94 d1 bf call 0x37fa2 ; 0x37fa2 st_synchronize(); e792: 0f 94 a3 42 call 0x28546 ; 0x28546 // current_position[axis] = 0; // plan_set_position_curposXYZE(); tmc2130_home_exit(); e796: 0f 94 7f 25 call 0x24afe ; 0x24afe e79a: 10 92 b7 02 sts 0x02B7, r1 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> enable_endstops(false); current_position[Z_AXIS] = 0; e79e: f7 01 movw r30, r14 e7a0: 10 86 std Z+8, r1 ; 0x08 e7a2: 11 86 std Z+9, r1 ; 0x09 e7a4: 12 86 std Z+10, r1 ; 0x0a e7a6: 13 86 std Z+11, r1 ; 0x0b plan_set_position_curposXYZE(); e7a8: 0f 94 c4 be call 0x37d88 ; 0x37d88 set_destination_to_current(); e7ac: 0e 94 52 68 call 0xd0a4 ; 0xd0a4 destination[Z_AXIS] += 10 * axis_up_dir; //10mm up e7b0: f6 ef ldi r31, 0xF6 ; 246 e7b2: cf 02 muls r28, r31 e7b4: b0 01 movw r22, r0 e7b6: 11 24 eor r1, r1 e7b8: 07 2e mov r0, r23 e7ba: 00 0c add r0, r0 e7bc: 88 0b sbc r24, r24 e7be: 99 0b sbc r25, r25 e7c0: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> e7c4: 9b 01 movw r18, r22 e7c6: ac 01 movw r20, r24 e7c8: f8 01 movw r30, r16 e7ca: 60 85 ldd r22, Z+8 ; 0x08 e7cc: 71 85 ldd r23, Z+9 ; 0x09 e7ce: 82 85 ldd r24, Z+10 ; 0x0a e7d0: 93 85 ldd r25, Z+11 ; 0x0b e7d2: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> e7d6: f8 01 movw r30, r16 e7d8: 60 87 std Z+8, r22 ; 0x08 e7da: 71 87 std Z+9, r23 ; 0x09 e7dc: 82 87 std Z+10, r24 ; 0x0a e7de: 93 87 std Z+11, r25 ; 0x0b feedrate = homing_feedrate[Z_AXIS] / 2; e7e0: 80 e0 ldi r24, 0x00 ; 0 e7e2: 90 e0 ldi r25, 0x00 ; 0 e7e4: a8 ec ldi r26, 0xC8 ; 200 e7e6: b3 e4 ldi r27, 0x43 ; 67 e7e8: 80 93 b8 02 sts 0x02B8, r24 ; 0x8002b8 e7ec: 90 93 b9 02 sts 0x02B9, r25 ; 0x8002b9 e7f0: a0 93 ba 02 sts 0x02BA, r26 ; 0x8002ba e7f4: b0 93 bb 02 sts 0x02BB, r27 ; 0x8002bb plan_buffer_line_destinationXYZE(feedrate / 60); e7f8: 65 e5 ldi r22, 0x55 ; 85 e7fa: 75 e5 ldi r23, 0x55 ; 85 e7fc: 85 ed ldi r24, 0xD5 ; 213 e7fe: 90 e4 ldi r25, 0x40 ; 64 e800: 0f 94 d1 bf call 0x37fa2 ; 0x37fa2 st_synchronize(); e804: 0f 94 a3 42 call 0x28546 ; 0x28546 e808: d0 93 b7 02 sts 0x02B7, r29 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> enable_endstops(endstops_enabled); current_position[Z_AXIS] = Z_MAX_POS + Z_MAX_POS_XYZ_CALIBRATION_CORRECTION; e80c: 80 e0 ldi r24, 0x00 ; 0 e80e: 90 e0 ldi r25, 0x00 ; 0 e810: a4 e5 ldi r26, 0x54 ; 84 e812: b3 e4 ldi r27, 0x43 ; 67 e814: f7 01 movw r30, r14 e816: 80 87 std Z+8, r24 ; 0x08 e818: 91 87 std Z+9, r25 ; 0x09 e81a: a2 87 std Z+10, r26 ; 0x0a e81c: b3 87 std Z+11, r27 ; 0x0b plan_set_position_curposXYZE(); e81e: 0f 94 c4 be call 0x37d88 ; 0x37d88 return true; } e822: 81 e0 ldi r24, 0x01 ; 1 e824: df 91 pop r29 e826: cf 91 pop r28 e828: 1f 91 pop r17 e82a: 0f 91 pop r16 e82c: ff 90 pop r15 e82e: ef 90 pop r14 e830: bf 90 pop r11 e832: af 90 pop r10 e834: 9f 90 pop r9 e836: 8f 90 pop r8 e838: 7f 90 pop r7 e83a: 6f 90 pop r6 e83c: 5f 90 pop r5 e83e: 4f 90 pop r4 e840: 08 95 ret 0000e842 : restore_print_from_ram_and_continue(default_retraction); //XYZ = orig, E +1mm unretract //babystep_apply(); } void crashdet_fmt_error(char* buf, uint8_t mask) { e842: cf 93 push r28 e844: df 93 push r29 e846: ec 01 movw r28, r24 if(mask & X_AXIS_MASK) *buf++ = axis_codes[X_AXIS]; e848: 60 ff sbrs r22, 0 e84a: 03 c0 rjmp .+6 ; 0xe852 e84c: 28 e5 ldi r18, 0x58 ; 88 e84e: 28 83 st Y, r18 e850: 21 96 adiw r28, 0x01 ; 1 if(mask & Y_AXIS_MASK) *buf++ = axis_codes[Y_AXIS]; e852: 61 ff sbrs r22, 1 e854: 03 c0 rjmp .+6 ; 0xe85c e856: 29 e5 ldi r18, 0x59 ; 89 e858: 28 83 st Y, r18 e85a: 21 96 adiw r28, 0x01 ; 1 *buf++ = ' '; e85c: 80 e2 ldi r24, 0x20 ; 32 e85e: 89 93 st Y+, r24 strcpy_P(buf, _T(MSG_CRASH_DETECTED)); e860: 80 e0 ldi r24, 0x00 ; 0 e862: 96 e3 ldi r25, 0x36 ; 54 e864: 0e 94 c4 72 call 0xe588 ; 0xe588 e868: bc 01 movw r22, r24 e86a: ce 01 movw r24, r28 } e86c: df 91 pop r29 e86e: cf 91 pop r28 void crashdet_fmt_error(char* buf, uint8_t mask) { if(mask & X_AXIS_MASK) *buf++ = axis_codes[X_AXIS]; if(mask & Y_AXIS_MASK) *buf++ = axis_codes[Y_AXIS]; *buf++ = ' '; strcpy_P(buf, _T(MSG_CRASH_DETECTED)); e870: 0d 94 8e d9 jmp 0x3b31c ; 0x3b31c 0000e874 <__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 { e874: 1f 92 push r1 e876: 0f 92 push r0 e878: 0f b6 in r0, 0x3f ; 63 e87a: 0f 92 push r0 e87c: 11 24 eor r1, r1 e87e: 0b b6 in r0, 0x3b ; 59 e880: 0f 92 push r0 e882: 2f 93 push r18 e884: 8f 93 push r24 e886: 9f 93 push r25 e888: ef 93 push r30 e88a: ff 93 push r31 switch(state){ e88c: e0 91 51 03 lds r30, 0x0351 ; 0x800351 e890: e8 30 cpi r30, 0x08 ; 8 e892: e8 f4 brcc .+58 ; 0xe8ce <__vector_23+0x5a> e894: f0 e0 ldi r31, 0x00 ; 0 e896: 88 27 eor r24, r24 e898: ef 5a subi r30, 0xAF ; 175 e89a: fb 48 sbci r31, 0x8B ; 139 e89c: 8f 4f sbci r24, 0xFF ; 255 e89e: 0d 94 e7 dc jmp 0x3b9ce ; 0x3b9ce <__tablejump2__> e8a2: 59 74 andi r21, 0x49 ; 73 e8a4: 73 74 andi r23, 0x43 ; 67 e8a6: 7e 74 andi r23, 0x4E ; 78 e8a8: 8c 74 andi r24, 0x4C ; 76 e8aa: a2 74 andi r26, 0x42 ; 66 e8ac: ab 74 andi r26, 0x4B ; 75 e8ae: ce 74 andi r28, 0x4E ; 78 e8b0: e0 74 andi r30, 0x40 ; 64 case States::ZERO_START: if (bedPWMDisabled) return; // stay in the OFF state and do not change the output pin e8b2: 80 91 8c 06 lds r24, 0x068C ; 0x80068c e8b6: 81 11 cpse r24, r1 e8b8: 0a c0 rjmp .+20 ; 0xe8ce <__vector_23+0x5a> pwm = soft_pwm_bed << 1;// expecting soft_pwm_bed to be 7bit! e8ba: 80 91 1c 06 lds r24, 0x061C ; 0x80061c e8be: 88 0f add r24, r24 e8c0: 80 93 50 03 sts 0x0350, r24 ; 0x800350 if( pwm != 0 ){ e8c4: 88 23 and r24, r24 e8c6: 19 f0 breq .+6 ; 0xe8ce <__vector_23+0x5a> state = States::ZERO; // do nothing, let it tick once again after the 30Hz period e8c8: 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 e8ca: 80 93 51 03 sts 0x0351, r24 ; 0x800351 TCNT0 = 128; OCR0B = 255; TCCR0B = (1 << CS01); // change prescaler to 8, i.e. 7.8kHz break; } } e8ce: ff 91 pop r31 e8d0: ef 91 pop r30 e8d2: 9f 91 pop r25 e8d4: 8f 91 pop r24 e8d6: 2f 91 pop r18 e8d8: 0f 90 pop r0 e8da: 0b be out 0x3b, r0 ; 59 e8dc: 0f 90 pop r0 e8de: 0f be out 0x3f, r0 ; 63 e8e0: 0f 90 pop r0 e8e2: 1f 90 pop r1 e8e4: 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) e8e6: 80 91 4f 03 lds r24, 0x034F ; 0x80034f e8ea: 8f 5f subi r24, 0xFF ; 255 e8ec: 80 93 4f 03 sts 0x034F, r24 ; 0x80034f if( slowCounter > pwm ){ e8f0: 90 91 50 03 lds r25, 0x0350 ; 0x800350 e8f4: 98 17 cp r25, r24 e8f6: 58 f3 brcs .-42 ; 0xe8ce <__vector_23+0x5a> return; } // otherwise moving towards RISE state = States::ZERO_TO_RISE; // and finalize the change in a transitional state RISE0 e8f8: 82 e0 ldi r24, 0x02 ; 2 e8fa: e7 cf rjmp .-50 ; 0xe8ca <__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 e8fc: 83 e0 ldi r24, 0x03 ; 3 e8fe: 80 93 51 03 sts 0x0351, r24 ; 0x800351 fastCounter = fastMax - 1;// we'll do 16-1 cycles of RISE e902: 8f e0 ldi r24, 0x0F ; 15 e904: 80 93 4e 03 sts 0x034E, r24 ; 0x80034e TCNT0 = 255; // force overflow on the next clock cycle e908: 8f ef ldi r24, 0xFF ; 255 e90a: 86 bd out 0x26, r24 ; 38 TCCR0B = (1 << CS00); // change prescaler to 1, i.e. 62.5kHz e90c: 81 e0 ldi r24, 0x01 ; 1 e90e: 85 bd out 0x25, r24 ; 37 TCCR0A &= ~(1 << COM0B0); // Clear OC0B on Compare Match, set OC0B at BOTTOM (non-inverting mode) e910: 84 b5 in r24, 0x24 ; 36 e912: 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 e914: 84 bd out 0x24, r24 ; 36 e916: db cf rjmp .-74 ; 0xe8ce <__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; e918: 80 91 4e 03 lds r24, 0x034E ; 0x80034e e91c: 82 95 swap r24 e91e: 80 7f andi r24, 0xF0 ; 240 e920: 81 95 neg r24 e922: 88 bd out 0x28, r24 ; 40 if( fastCounter ){ e924: 80 91 4e 03 lds r24, 0x034E ; 0x80034e e928: 88 23 and r24, r24 e92a: 21 f0 breq .+8 ; 0xe934 <__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; e92c: 81 50 subi r24, 0x01 ; 1 e92e: 80 93 4e 03 sts 0x034E, r24 ; 0x80034e e932: cd cf rjmp .-102 ; 0xe8ce <__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; e934: 84 e0 ldi r24, 0x04 ; 4 e936: 80 93 51 03 sts 0x0351, r24 ; 0x800351 OCR0B = 255; // full duty e93a: 8f ef ldi r24, 0xFF ; 255 e93c: 88 bd out 0x28, r24 ; 40 TCNT0 = 254; // make the timer overflow in the next cycle e93e: 8e ef ldi r24, 0xFE ; 254 e940: 86 bd out 0x26, r24 ; 38 e942: c5 cf rjmp .-118 ; 0xe8ce <__vector_23+0x5a> // @@TODO these constants are still subject to investigation } break; case States::RISE_TO_ONE: state = States::ONE; e944: 85 e0 ldi r24, 0x05 ; 5 e946: 80 93 51 03 sts 0x0351, r24 ; 0x800351 OCR0B = 255; // full duty e94a: 8f ef ldi r24, 0xFF ; 255 e94c: 88 bd out 0x28, r24 ; 40 TCNT0 = 255; // make the timer overflow in the next cycle e94e: 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 e950: 82 e0 ldi r24, 0x02 ; 2 e952: 85 bd out 0x25, r24 ; 37 e954: bc cf rjmp .-136 ; 0xe8ce <__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; e956: 2f ef ldi r18, 0xFF ; 255 e958: 28 bd out 0x28, r18 ; 40 if (bedPWMDisabled) return; // stay in the ON state and do not change the output pin e95a: 80 91 8c 06 lds r24, 0x068C ; 0x80068c e95e: 81 11 cpse r24, r1 e960: b6 cf rjmp .-148 ; 0xe8ce <__vector_23+0x5a> slowCounter += slowInc; // this does software timer_clk/256 or less e962: 80 91 4f 03 lds r24, 0x034F ; 0x80034f e966: 8f 5f subi r24, 0xFF ; 255 e968: 80 93 4f 03 sts 0x034F, r24 ; 0x80034f if( slowCounter < pwm ){ e96c: 90 91 50 03 lds r25, 0x0350 ; 0x800350 e970: 89 17 cp r24, r25 e972: 08 f4 brcc .+2 ; 0xe976 <__vector_23+0x102> e974: ac cf rjmp .-168 ; 0xe8ce <__vector_23+0x5a> return; } if( (soft_pwm_bed << 1) >= (255 - slowInc - 1) ){ //@@TODO simplify & explain e976: 80 91 1c 06 lds r24, 0x061C ; 0x80061c e97a: 90 e0 ldi r25, 0x00 ; 0 e97c: 8f 37 cpi r24, 0x7F ; 127 e97e: 91 05 cpc r25, r1 e980: 0c f0 brlt .+2 ; 0xe984 <__vector_23+0x110> e982: a5 cf rjmp .-182 ; 0xe8ce <__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; e984: 86 e0 ldi r24, 0x06 ; 6 e986: 80 93 51 03 sts 0x0351, r24 ; 0x800351 fastCounter = fastMax - 1;// we'll do 16-1 cycles of RISE e98a: 8f e0 ldi r24, 0x0F ; 15 e98c: 80 93 4e 03 sts 0x034E, r24 ; 0x80034e TCNT0 = 255; // force overflow on the next clock cycle e990: 26 bd out 0x26, r18 ; 38 TCCR0B = (1 << CS00); // change prescaler to 1, i.e. 62.5kHz e992: 81 e0 ldi r24, 0x01 ; 1 e994: 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 e996: 84 b5 in r24, 0x24 ; 36 e998: 80 61 ori r24, 0x10 ; 16 e99a: bc cf rjmp .-136 ; 0xe914 <__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 e99c: 80 91 4e 03 lds r24, 0x034E ; 0x80034e e9a0: 82 95 swap r24 e9a2: 80 7f andi r24, 0xF0 ; 240 e9a4: 81 95 neg r24 e9a6: 88 bd out 0x28, r24 ; 40 //TCCR0A |= (1 << COM0B0); // already set in ONE_TO_FALL if( fastCounter ){ e9a8: 80 91 4e 03 lds r24, 0x034E ; 0x80034e e9ac: 81 11 cpse r24, r1 e9ae: be cf rjmp .-132 ; 0xe92c <__vector_23+0xb8> --fastCounter; } else { // end of FALL cycles, changing into state ZERO state = States::FALL_TO_ZERO; e9b0: 87 e0 ldi r24, 0x07 ; 7 e9b2: 80 93 51 03 sts 0x0351, r24 ; 0x800351 TCNT0 = 128; //@@TODO again - need to wait long enough to propagate the timer state changes e9b6: 80 e8 ldi r24, 0x80 ; 128 e9b8: 86 bd out 0x26, r24 ; 38 OCR0B = 255; e9ba: 8f ef ldi r24, 0xFF ; 255 e9bc: 88 bd out 0x28, r24 ; 40 e9be: 87 cf rjmp .-242 ; 0xe8ce <__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 e9c0: 10 92 51 03 sts 0x0351, r1 ; 0x800351 TCNT0 = 128; e9c4: 80 e8 ldi r24, 0x80 ; 128 e9c6: 86 bd out 0x26, r24 ; 38 OCR0B = 255; e9c8: 8f ef ldi r24, 0xFF ; 255 e9ca: 88 bd out 0x28, r24 ; 40 e9cc: c1 cf rjmp .-126 ; 0xe950 <__vector_23+0xdc> 0000e9ce : #else // FILAMENT_SENSOR FSensorBlockRunout::FSensorBlockRunout() { } FSensorBlockRunout::~FSensorBlockRunout() { } #endif // FILAMENT_SENSOR void Filament_sensor::setEnabled(bool enabled) { e9ce: cf 93 push r28 e9d0: c8 2f mov r28, r24 e9d2: 68 2f mov r22, r24 e9d4: 87 e6 ldi r24, 0x67 ; 103 e9d6: 9f e0 ldi r25, 0x0F ; 15 e9d8: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENSOR, enabled); if (enabled) { e9dc: cc 23 and r28, r28 e9de: 19 f0 breq .+6 ; 0xe9e6 fsensor.init(); } else { fsensor.deinit(); } } e9e0: 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(); e9e2: 0d 94 f4 7a jmp 0x2f5e8 ; 0x2f5e8 } void PAT9125_sensor::deinit() { // puts_P(PSTR("fsensor::deinit()")); ; // state = State::disabled; e9e6: 10 92 a9 17 sts 0x17A9, r1 ; 0x8017a9 filter = 0; e9ea: 10 92 b5 17 sts 0x17B5, r1 ; 0x8017b5 if (enabled) { fsensor.init(); } else { fsensor.deinit(); } } e9ee: cf 91 pop r28 e9f0: 08 95 ret 0000e9f2 : #endif #endif //DEBUG_DISABLE_FANCHECK } void resetFanCheck() { fan_measuring = false; e9f2: 10 92 6e 06 sts 0x066E, r1 ; 0x80066e extruder_autofan_last_check = _millis(); e9f6: 0f 94 22 29 call 0x25244 ; 0x25244 e9fa: 60 93 bf 17 sts 0x17BF, r22 ; 0x8017bf e9fe: 70 93 c0 17 sts 0x17C0, r23 ; 0x8017c0 ea02: 80 93 c1 17 sts 0x17C1, r24 ; 0x8017c1 ea06: 90 93 c2 17 sts 0x17C2, r25 ; 0x8017c2 } ea0a: 08 95 ret 0000ea0c <__vector_8>: EIMSK |= (1 << 7); } // The fan interrupt is triggered at maximum 325Hz (may be a bit more due to component tollerances), // and it takes 4.24 us to process (the interrupt invocation overhead not taken into account). ISR(INT7_vect) { ea0c: 1f 92 push r1 ea0e: 0f 92 push r0 ea10: 0f b6 in r0, 0x3f ; 63 ea12: 0f 92 push r0 ea14: 11 24 eor r1, r1 ea16: 2f 93 push r18 ea18: 4f 93 push r20 ea1a: 5f 93 push r21 ea1c: 6f 93 push r22 ea1e: 7f 93 push r23 ea20: 8f 93 push r24 ea22: 9f 93 push r25 ea24: af 93 push r26 ea26: bf 93 push r27 //measuring speed now works for fanSpeed > 18 (approximately), which is sufficient because MIN_PRINT_FAN_SPEED is higher #ifdef FAN_SOFT_PWM if (!fan_measuring || (fanSpeedSoftPwm < MIN_PRINT_FAN_SPEED)) return; ea28: 80 91 6e 06 lds r24, 0x066E ; 0x80066e ea2c: 88 23 and r24, r24 ea2e: f1 f0 breq .+60 ; 0xea6c <__vector_8+0x60> ea30: 80 91 a5 04 lds r24, 0x04A5 ; 0x8004a5 ea34: 8b 34 cpi r24, 0x4B ; 75 ea36: d0 f0 brcs .+52 ; 0xea6c <__vector_8+0x60> #else //FAN_SOFT_PWM if (fanSpeed < MIN_PRINT_FAN_SPEED) return; #endif //FAN_SOFT_PWM if ((1 << 6) & EICRB) { //interrupt was triggered by rising edge ea38: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> ea3c: 86 ff sbrs r24, 6 ea3e: 24 c0 rjmp .+72 ; 0xea88 <__vector_8+0x7c> // An unsynchronized equivalent to a standard Arduino _millis() function. // To be used inside an interrupt routine. FORCE_INLINE unsigned long millis_nc() { #ifdef SYSTEM_TIMER_2 return timer2_millis; ea40: 80 91 3a 06 lds r24, 0x063A ; 0x80063a ea44: 90 91 3b 06 lds r25, 0x063B ; 0x80063b ea48: a0 91 3c 06 lds r26, 0x063C ; 0x80063c ea4c: b0 91 3d 06 lds r27, 0x063D ; 0x80063d t_fan_rising_edge = millis_nc(); ea50: 80 93 47 03 sts 0x0347, r24 ; 0x800347 ea54: 90 93 48 03 sts 0x0348, r25 ; 0x800348 ea58: a0 93 49 03 sts 0x0349, r26 ; 0x800349 ea5c: b0 93 4a 03 sts 0x034A, r27 ; 0x80034a else { //interrupt was triggered by falling edge if ((millis_nc() - t_fan_rising_edge) >= FAN_PULSE_WIDTH_LIMIT) {//this pulse was from sensor and not from pwm fan_edge_counter[1] += 2; //we are currently counting all edges so lets count two edges for one pulse } } EICRB ^= (1 << 6); //change edge ea60: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> ea64: 90 e4 ldi r25, 0x40 ; 64 ea66: 89 27 eor r24, r25 ea68: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> } ea6c: bf 91 pop r27 ea6e: af 91 pop r26 ea70: 9f 91 pop r25 ea72: 8f 91 pop r24 ea74: 7f 91 pop r23 ea76: 6f 91 pop r22 ea78: 5f 91 pop r21 ea7a: 4f 91 pop r20 ea7c: 2f 91 pop r18 ea7e: 0f 90 pop r0 ea80: 0f be out 0x3f, r0 ; 63 ea82: 0f 90 pop r0 ea84: 1f 90 pop r1 ea86: 18 95 reti ea88: 80 91 3a 06 lds r24, 0x063A ; 0x80063a ea8c: 90 91 3b 06 lds r25, 0x063B ; 0x80063b ea90: a0 91 3c 06 lds r26, 0x063C ; 0x80063c ea94: b0 91 3d 06 lds r27, 0x063D ; 0x80063d if ((1 << 6) & EICRB) { //interrupt was triggered by rising edge t_fan_rising_edge = millis_nc(); } else { //interrupt was triggered by falling edge if ((millis_nc() - t_fan_rising_edge) >= FAN_PULSE_WIDTH_LIMIT) {//this pulse was from sensor and not from pwm ea98: 40 91 47 03 lds r20, 0x0347 ; 0x800347 ea9c: 50 91 48 03 lds r21, 0x0348 ; 0x800348 eaa0: 60 91 49 03 lds r22, 0x0349 ; 0x800349 eaa4: 70 91 4a 03 lds r23, 0x034A ; 0x80034a eaa8: 84 1b sub r24, r20 eaaa: 95 0b sbc r25, r21 eaac: a6 0b sbc r26, r22 eaae: b7 0b sbc r27, r23 eab0: 20 91 e5 03 lds r18, 0x03E5 ; 0x8003e5 eab4: 44 e0 ldi r20, 0x04 ; 4 eab6: 50 e0 ldi r21, 0x00 ; 0 eab8: 60 e0 ldi r22, 0x00 ; 0 eaba: 70 e0 ldi r23, 0x00 ; 0 eabc: 25 36 cpi r18, 0x65 ; 101 eabe: 20 f0 brcs .+8 ; 0xeac8 <__vector_8+0xbc> eac0: 43 e0 ldi r20, 0x03 ; 3 eac2: 50 e0 ldi r21, 0x00 ; 0 eac4: 60 e0 ldi r22, 0x00 ; 0 eac6: 70 e0 ldi r23, 0x00 ; 0 eac8: 84 17 cp r24, r20 eaca: 95 07 cpc r25, r21 eacc: a6 07 cpc r26, r22 eace: b7 07 cpc r27, r23 ead0: 38 f2 brcs .-114 ; 0xea60 <__vector_8+0x54> fan_edge_counter[1] += 2; //we are currently counting all edges so lets count two edges for one pulse ead2: 80 91 e3 05 lds r24, 0x05E3 ; 0x8005e3 ead6: 90 91 e4 05 lds r25, 0x05E4 ; 0x8005e4 eada: 02 96 adiw r24, 0x02 ; 2 eadc: 90 93 e4 05 sts 0x05E4, r25 ; 0x8005e4 eae0: 80 93 e3 05 sts 0x05E3, r24 ; 0x8005e3 eae4: bd cf rjmp .-134 ; 0xea60 <__vector_8+0x54> 0000eae6 : 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; eae6: 80 93 4b 03 sts 0x034B, r24 ; 0x80034b newFanSpeed = 0; if (fanState & 0x01) eaea: 80 fd sbrc r24, 0 eaec: 1c c0 rjmp .+56 ; 0xeb26 { //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; eaee: 10 92 69 03 sts 0x0369, r1 ; 0x800369 else newFanSpeed = EXTRUDER_AUTO_FAN_SPEED; #else //EXTRUDER_ALTFAN_DETECT newFanSpeed = EXTRUDER_AUTO_FAN_SPEED; #endif //EXTRUDER_ALTFAN_DETECT } timer4_set_fan0(newFanSpeed); eaf2: 20 91 69 03 lds r18, 0x0369 ; 0x800369 } #ifdef EXTRUDER_0_AUTO_FAN_PIN void timer4_set_fan0(uint8_t duty) { if (duty == 0 || duty == 255) eaf6: 8f ef ldi r24, 0xFF ; 255 eaf8: 82 0f add r24, r18 eafa: 8e 3f cpi r24, 0xFE ; 254 eafc: e8 f0 brcs .+58 ; 0xeb38 { // We use digital logic if the duty cycle is 0% or 100% TCCR4A &= ~_BV(COM4C1); eafe: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> eb02: 87 7f andi r24, 0xF7 ; 247 eb04: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = 0; eb08: 10 92 ad 00 sts 0x00AD, r1 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> eb0c: 10 92 ac 00 sts 0x00AC, r1 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> WRITE(EXTRUDER_0_AUTO_FAN_PIN, duty); eb10: 9f b7 in r25, 0x3f ; 63 eb12: 22 23 and r18, r18 eb14: 61 f0 breq .+24 ; 0xeb2e eb16: f8 94 cli eb18: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> eb1c: 80 62 ori r24, 0x20 ; 32 eb1e: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> eb22: 9f bf out 0x3f, r25 ; 63 eb24: 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; eb26: 8f ef ldi r24, 0xFF ; 255 eb28: 80 93 69 03 sts 0x0369, r24 ; 0x800369 eb2c: e2 cf rjmp .-60 ; 0xeaf2 eb2e: f8 94 cli eb30: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> eb34: 8f 7d andi r24, 0xDF ; 223 eb36: f3 cf rjmp .-26 ; 0xeb1e 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; eb38: ef b7 in r30, 0x3f ; 63 eb3a: f8 94 cli // Enable the PWM output on the fan pin. TCCR4A |= _BV(COM4C1); eb3c: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> eb40: 88 60 ori r24, 0x08 ; 8 eb42: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = (((uint16_t)duty) * ((uint16_t)((TIMSK4 & _BV(OCIE4A)) ? OCR4A : 255U))) / 255U; eb46: 30 e0 ldi r19, 0x00 ; 0 eb48: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> eb4c: 4f ef ldi r20, 0xFF ; 255 eb4e: 50 e0 ldi r21, 0x00 ; 0 eb50: 81 ff sbrs r24, 1 eb52: 04 c0 rjmp .+8 ; 0xeb5c eb54: 40 91 a8 00 lds r20, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> eb58: 50 91 a9 00 lds r21, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> eb5c: 24 9f mul r18, r20 eb5e: c0 01 movw r24, r0 eb60: 25 9f mul r18, r21 eb62: 90 0d add r25, r0 eb64: 34 9f mul r19, r20 eb66: 90 0d add r25, r0 eb68: 11 24 eor r1, r1 eb6a: 6f ef ldi r22, 0xFF ; 255 eb6c: 70 e0 ldi r23, 0x00 ; 0 eb6e: 0f 94 a0 dc call 0x3b940 ; 0x3b940 <__udivmodhi4> eb72: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> eb76: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> CRITICAL_SECTION_END; eb7a: ef bf out 0x3f, r30 ; 63 #endif //EXTRUDER_ALTFAN_DETECT } timer4_set_fan0(newFanSpeed); } eb7c: 08 95 ret 0000eb7e : } #endif //EXTRUDER_ALTFAN_DETECT void checkExtruderAutoFans() { eb7e: 1f 93 push r17 eb80: cf 93 push r28 eb82: df 93 push r29 #if defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN > -1 if (!(fanState & 0x02)) eb84: d0 91 4b 03 lds r29, 0x034B ; 0x80034b eb88: d1 fd sbrc r29, 1 eb8a: 1d c0 rjmp .+58 ; 0xebc6 temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; eb8c: 10 91 1a 05 lds r17, 0x051A ; 0x80051a <_ZL16temp_error_state.lto_priv.454> { fanState &= ~1; fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; eb90: c1 e0 ldi r28, 0x01 ; 1 eb92: 20 e0 ldi r18, 0x00 ; 0 eb94: 30 e0 ldi r19, 0x00 ; 0 eb96: 48 e4 ldi r20, 0x48 ; 72 eb98: 52 e4 ldi r21, 0x42 ; 66 eb9a: 60 91 af 0d lds r22, 0x0DAF ; 0x800daf eb9e: 70 91 b0 0d lds r23, 0x0DB0 ; 0x800db0 eba2: 80 91 b1 0d lds r24, 0x0DB1 ; 0x800db1 eba6: 90 91 b2 0d lds r25, 0x0DB2 ; 0x800db2 ebaa: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> ebae: 18 16 cp r1, r24 ebb0: 0c f0 brlt .+2 ; 0xebb4 ebb2: 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; ebb4: de 7f andi r29, 0xFE ; 254 fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; ebb6: cd 2b or r28, r29 ebb8: 81 e0 ldi r24, 0x01 ; 1 ebba: 11 11 cpse r17, r1 ebbc: 01 c0 rjmp .+2 ; 0xebc0 ebbe: 80 e0 ldi r24, 0x00 ; 0 fanState |= get_temp_error(); ebc0: c8 2b or r28, r24 ebc2: c0 93 4b 03 sts 0x034B, r28 ; 0x80034b } setExtruderAutoFanState(fanState); ebc6: 80 91 4b 03 lds r24, 0x034B ; 0x80034b #endif } ebca: df 91 pop r29 ebcc: cf 91 pop r28 ebce: 1f 91 pop r17 { fanState &= ~1; fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; fanState |= get_temp_error(); } setExtruderAutoFanState(fanState); ebd0: 0c 94 73 75 jmp 0xeae6 ; 0xeae6 0000ebd4 : 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) { ebd4: ef 92 push r14 ebd6: ff 92 push r15 ebd8: 0f 93 push r16 ebda: 1f 93 push r17 ebdc: cf 93 push r28 ebde: df 93 push r29 ebe0: ec 01 movw r28, r24 ebe2: 8b 01 movw r16, r22 ebe4: 7a 01 movw r14, r20 if (!eeprom_is_initialized_block(__p, __n)) ebe6: 0e 94 d3 5b call 0xb7a6 ; 0xb7a6 ebea: 81 11 cpse r24, r1 ebec: 0b c0 rjmp .+22 ; 0xec04 #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); ebee: a8 01 movw r20, r16 ebf0: be 01 movw r22, r28 ebf2: 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); } ebf4: df 91 pop r29 ebf6: cf 91 pop r28 ebf8: 1f 91 pop r17 ebfa: 0f 91 pop r16 ebfc: ff 90 pop r15 ebfe: 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); ec00: 0d 94 eb db jmp 0x3b7d6 ; 0x3b7d6 } 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); } ec04: df 91 pop r29 ec06: cf 91 pop r28 ec08: 1f 91 pop r17 ec0a: 0f 91 pop r16 ec0c: ff 90 pop r15 ec0e: ef 90 pop r14 ec10: 08 95 ret 0000ec12 : return def; } return val; } uint16_t __attribute__((noinline)) eeprom_init_default_word(uint16_t *__p, uint16_t def) { ec12: 0f 93 push r16 ec14: 1f 93 push r17 ec16: cf 93 push r28 ec18: df 93 push r29 ec1a: 8c 01 movw r16, r24 ec1c: d6 2f mov r29, r22 ec1e: c7 2f mov r28, r23 uint16_t val = eeprom_read_word(__p); ec20: 0f 94 e5 db call 0x3b7ca ; 0x3b7ca if (val == EEPROM_EMPTY_VALUE16) { ec24: 8f 3f cpi r24, 0xFF ; 255 ec26: 98 07 cpc r25, r24 ec28: 39 f4 brne .+14 ; 0xec38 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); ec2a: 6d 2f mov r22, r29 ec2c: 7c 2f mov r23, r28 ec2e: c8 01 movw r24, r16 ec30: 0f 94 35 dc call 0x3b86a ; 0x3b86a 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; ec34: 8d 2f mov r24, r29 ec36: 9c 2f mov r25, r28 } return val; } ec38: df 91 pop r29 ec3a: cf 91 pop r28 ec3c: 1f 91 pop r17 ec3e: 0f 91 pop r16 ec40: 08 95 ret 0000ec42 : 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) { ec42: 0f 93 push r16 ec44: 1f 93 push r17 ec46: cf 93 push r28 ec48: 8c 01 movw r16, r24 ec4a: c6 2f mov r28, r22 uint8_t val = eeprom_read_byte(__p); ec4c: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae if (val == EEPROM_EMPTY_VALUE) { ec50: 8f 3f cpi r24, 0xFF ; 255 ec52: 29 f4 brne .+10 ; 0xec5e 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); ec54: 6c 2f mov r22, r28 ec56: c8 01 movw r24, r16 ec58: 0f 94 1f dc call 0x3b83e ; 0x3b83e 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; ec5c: 8c 2f mov r24, r28 } return val; } ec5e: cf 91 pop r28 ec60: 1f 91 pop r17 ec62: 0f 91 pop r16 ec64: 08 95 ret 0000ec66 : 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) { ec66: cf 93 push r28 ec68: df 93 push r29 ec6a: ec 01 movw r28, r24 eeprom_write_word_notify(__p, eeprom_read_word(__p) + 1); ec6c: 0f 94 e5 db call 0x3b7ca ; 0x3b7ca ec70: bc 01 movw r22, r24 ec72: 6f 5f subi r22, 0xFF ; 255 ec74: 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); ec76: 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); } ec78: df 91 pop r29 ec7a: 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); ec7c: 0d 94 35 dc jmp 0x3b86a ; 0x3b86a 0000ec80 : void eeprom_toggle(uint8_t *__p) { eeprom_write_byte_notify(__p, !eeprom_read_byte(__p)); } void __attribute__((noinline)) eeprom_increment_byte(uint8_t *__p) { ec80: cf 93 push r28 ec82: df 93 push r29 ec84: ec 01 movw r28, r24 eeprom_write_byte_notify(__p, eeprom_read_byte(__p) + 1); ec86: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae ec8a: 61 e0 ldi r22, 0x01 ; 1 ec8c: 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); ec8e: 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); } ec90: df 91 pop r29 ec92: 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); ec94: 0d 94 1f dc jmp 0x3b83e ; 0x3b83e 0000ec98 : while (__n--) { eeprom_update_byte_notify(dst++, pgm_read_byte(src++)); } } void eeprom_toggle(uint8_t *__p) { ec98: cf 93 push r28 ec9a: df 93 push r29 ec9c: ec 01 movw r28, r24 eeprom_write_byte_notify(__p, !eeprom_read_byte(__p)); ec9e: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae eca2: 61 e0 ldi r22, 0x01 ; 1 eca4: 81 11 cpse r24, r1 eca6: 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); eca8: ce 01 movw r24, r28 } } void eeprom_toggle(uint8_t *__p) { eeprom_write_byte_notify(__p, !eeprom_read_byte(__p)); } ecaa: df 91 pop r29 ecac: 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); ecae: 0d 94 1f dc jmp 0x3b83e ; 0x3b83e 0000ecb2 : 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); ecb2: 2b e0 ldi r18, 0x0B ; 11 ecb4: 82 9f mul r24, r18 ecb6: c0 01 movw r24, r0 ecb8: 11 24 eor r1, r1 ecba: 80 5b subi r24, 0xB0 ; 176 ecbc: 92 4f sbci r25, 0xF2 ; 242 ecbe: 0f 94 e5 db call 0x3b7ca ; 0x3b7ca ecc2: 21 e0 ldi r18, 0x01 ; 1 ecc4: 01 96 adiw r24, 0x01 ; 1 ecc6: 09 f4 brne .+2 ; 0xecca ecc8: 20 e0 ldi r18, 0x00 ; 0 } ecca: 82 2f mov r24, r18 eccc: 08 95 ret 0000ecce : //! //! @param sheet Current sheet //! @return next initialized sheet //! @retval -1 no sheet is initialized int8_t eeprom_next_initialized_sheet(int8_t sheet) { ecce: cf 93 push r28 ecd0: df 93 push r29 ecd2: c8 2f mov r28, r24 ecd4: d8 e0 ldi r29, 0x08 ; 8 for (int8_t i = 0; i < static_cast(sizeof(Sheets::s)/sizeof(Sheet)); ++i) { ++sheet; ecd6: cf 5f subi r28, 0xFF ; 255 if (sheet >= static_cast(sizeof(Sheets::s)/sizeof(Sheet))) sheet = 0; ecd8: c8 30 cpi r28, 0x08 ; 8 ecda: 0c f0 brlt .+2 ; 0xecde ecdc: c0 e0 ldi r28, 0x00 ; 0 if (eeprom_is_sheet_initialized(sheet)) return sheet; ecde: 8c 2f mov r24, r28 ece0: 0e 94 59 76 call 0xecb2 ; 0xecb2 ece4: 81 11 cpse r24, r1 ece6: 03 c0 rjmp .+6 ; 0xecee ece8: 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) ecea: a9 f7 brne .-22 ; 0xecd6 { ++sheet; if (sheet >= static_cast(sizeof(Sheets::s)/sizeof(Sheet))) sheet = 0; if (eeprom_is_sheet_initialized(sheet)) return sheet; } return -1; ecec: cf ef ldi r28, 0xFF ; 255 } ecee: 8c 2f mov r24, r28 ecf0: df 91 pop r29 ecf2: cf 91 pop r28 ecf4: 08 95 ret 0000ecf6 : #endif //DEBUG_EEPROM_CHANGES } void eeprom_switch_to_next_sheet() { int8_t sheet = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); ecf6: 81 ea ldi r24, 0xA1 ; 161 ecf8: 9d e0 ldi r25, 0x0D ; 13 ecfa: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae sheet = eeprom_next_initialized_sheet(sheet); ecfe: 0e 94 67 76 call 0xecce ; 0xecce if (sheet >= 0) eeprom_update_byte_notify(&(EEPROM_Sheets_base->active_sheet), sheet); ed02: 87 fd sbrc r24, 7 ed04: 05 c0 rjmp .+10 ; 0xed10 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); ed06: 68 2f mov r22, r24 ed08: 81 ea ldi r24, 0xA1 ; 161 ed0a: 9d e0 ldi r25, 0x0D ; 13 ed0c: 0d 94 fb db jmp 0x3b7f6 ; 0x3b7f6 { 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); } ed10: 08 95 ret 0000ed12 : //! | 7 | Custom2 | //! //! @param[in] index //! @param[out] sheetName void eeprom_default_sheet_name(uint8_t index, SheetName &sheetName) { ed12: 0f 93 push r16 ed14: 1f 93 push r17 ed16: cf 93 push r28 ed18: c8 2f mov r28, r24 ed1a: 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")); ed1c: 62 e5 ldi r22, 0x52 ; 82 ed1e: 79 e7 ldi r23, 0x79 ; 121 //! @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) ed20: 82 30 cpi r24, 0x02 ; 2 ed22: 70 f0 brcs .+28 ; 0xed40 { strcpy_P(sheetName.c, PSTR("Smooth")); } else if (index < 4) { strcpy_P(sheetName.c, PSTR("Textur")); ed24: 6b e4 ldi r22, 0x4B ; 75 ed26: 79 e7 ldi r23, 0x79 ; 121 if (index < 2) { strcpy_P(sheetName.c, PSTR("Smooth")); } else if (index < 4) ed28: 84 30 cpi r24, 0x04 ; 4 ed2a: 50 f0 brcs .+20 ; 0xed40 { strcpy_P(sheetName.c, PSTR("Textur")); } else if (index < 5) { strcpy_P(sheetName.c, PSTR("Satin ")); ed2c: 63 e4 ldi r22, 0x43 ; 67 ed2e: 79 e7 ldi r23, 0x79 ; 121 } else if (index < 4) { strcpy_P(sheetName.c, PSTR("Textur")); } else if (index < 5) ed30: 84 30 cpi r24, 0x04 ; 4 ed32: 31 f0 breq .+12 ; 0xed40 { strcpy_P(sheetName.c, PSTR("Satin ")); } else if (index < 6) { strcpy_P(sheetName.c, PSTR("NylonPA")); ed34: 6b e3 ldi r22, 0x3B ; 59 ed36: 79 e7 ldi r23, 0x79 ; 121 } else if (index < 5) { strcpy_P(sheetName.c, PSTR("Satin ")); } else if (index < 6) ed38: 85 30 cpi r24, 0x05 ; 5 ed3a: 11 f0 breq .+4 ; 0xed40 { strcpy_P(sheetName.c, PSTR("NylonPA")); } else { strcpy_P(sheetName.c, PSTR("Custom")); ed3c: 64 e3 ldi r22, 0x34 ; 52 ed3e: 79 e7 ldi r23, 0x79 ; 121 ed40: c8 01 movw r24, r16 ed42: 0f 94 8e d9 call 0x3b31c ; 0x3b31c } if (index <4 || index >5) ed46: 8c ef ldi r24, 0xFC ; 252 ed48: 8c 0f add r24, r28 ed4a: 82 30 cpi r24, 0x02 ; 2 ed4c: 28 f0 brcs .+10 ; 0xed58 { sheetName.c[6] = '0' + ((index % 2)+1); ed4e: c1 70 andi r28, 0x01 ; 1 ed50: cf 5c subi r28, 0xCF ; 207 ed52: f8 01 movw r30, r16 ed54: c6 83 std Z+6, r28 ; 0x06 sheetName.c[7] = '\0'; ed56: 17 82 std Z+7, r1 ; 0x07 } } ed58: cf 91 pop r28 ed5a: 1f 91 pop r17 ed5c: 0f 91 pop r16 ed5e: 08 95 ret 0000ed60 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); ed60: 61 e0 ldi r22, 0x01 ; 1 ed62: 80 ec ldi r24, 0xC0 ; 192 ed64: 9f e0 ldi r25, 0x0F ; 15 ed66: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 ed6a: 60 e0 ldi r22, 0x00 ; 0 ed6c: 8f eb ldi r24, 0xBF ; 191 ed6e: 9f e0 ldi r25, 0x0F ; 15 ed70: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 ed74: 60 e0 ldi r22, 0x00 ; 0 ed76: 8e eb ldi r24, 0xBE ; 190 ed78: 9f e0 ldi r25, 0x0F ; 15 ed7a: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 ed7e: 60 e0 ldi r22, 0x00 ; 0 ed80: 8d eb ldi r24, 0xBD ; 189 ed82: 9f e0 ldi r25, 0x0F ; 15 ed84: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 ed88: 60 e0 ldi r22, 0x00 ; 0 ed8a: 8c eb ldi r24, 0xBC ; 188 ed8c: 9f e0 ldi r25, 0x0F ; 15 ed8e: 0d 94 fb db jmp 0x3b7f6 ; 0x3b7f6 0000ed92 : } void print_hex_byte(uint8_t val) { ed92: cf 93 push r28 ed94: c8 2f mov r28, r24 print_hex_nibble(val >> 4); ed96: 82 95 swap r24 ed98: 8f 70 andi r24, 0x0F ; 15 ed9a: 0e 94 ed 63 call 0xc7da ; 0xc7da print_hex_nibble(val & 15); ed9e: 8c 2f mov r24, r28 eda0: 8f 70 andi r24, 0x0F ; 15 } eda2: cf 91 pop r28 } void print_hex_byte(uint8_t val) { print_hex_nibble(val >> 4); print_hex_nibble(val & 15); eda4: 0c 94 ed 63 jmp 0xc7da ; 0xc7da 0000eda8 : // 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) { eda8: 80 91 a2 10 lds r24, 0x10A2 ; 0x8010a2 edac: 90 91 a3 10 lds r25, 0x10A3 ; 0x8010a3 edb0: 18 16 cp r1, r24 edb2: 19 06 cpc r1, r25 edb4: 0c f0 brlt .+2 ; 0xedb8 edb6: 43 c0 rjmp .+134 ; 0xee3e SERIAL_ECHO(serial_count); SERIAL_ECHOPGM(", bufsize "); SERIAL_ECHO(sizeof(cmdbuffer)); SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ if (-- buflen == 0) { edb8: 01 97 sbiw r24, 0x01 ; 1 edba: 90 93 a3 10 sts 0x10A3, r25 ; 0x8010a3 edbe: 80 93 a2 10 sts 0x10A2, r24 ; 0x8010a2 edc2: 89 2b or r24, r25 edc4: a1 f4 brne .+40 ; 0xedee // Empty buffer. if (serial_count == 0) edc6: 80 91 9d 10 lds r24, 0x109D ; 0x80109d edca: 90 91 9e 10 lds r25, 0x109E ; 0x80109e edce: 89 2b or r24, r25 edd0: 21 f4 brne .+8 ; 0xedda // No serial communication is pending. Reset both pointers to zero. bufindw = 0; edd2: 10 92 a0 10 sts 0x10A0, r1 ; 0x8010a0 <_ZL7bufindw.lto_priv.550+0x1> edd6: 10 92 9f 10 sts 0x109F, r1 ; 0x80109f <_ZL7bufindw.lto_priv.550> bufindr = bufindw; edda: 80 91 9f 10 lds r24, 0x109F ; 0x80109f <_ZL7bufindw.lto_priv.550> edde: 90 91 a0 10 lds r25, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.550+0x1> ede2: 90 93 92 12 sts 0x1292, r25 ; 0x801292 ede6: 80 93 91 12 sts 0x1291, r24 ; 0x801291 SERIAL_ECHOPGM(" new command on the top: "); SERIAL_ECHO(cmdbuffer+bufindr+CMDHDRSIZE); SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ } return true; edea: 81 e0 ldi r24, 0x01 ; 1 edec: 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) ; edee: 80 91 91 12 lds r24, 0x1291 ; 0x801291 edf2: 90 91 92 12 lds r25, 0x1292 ; 0x801292 edf6: 03 96 adiw r24, 0x03 ; 3 edf8: fc 01 movw r30, r24 edfa: ec 55 subi r30, 0x5C ; 92 edfc: ff 4e sbci r31, 0xEF ; 239 edfe: 20 81 ld r18, Z ee00: 01 96 adiw r24, 0x01 ; 1 ee02: 21 11 cpse r18, r1 ee04: f9 cf rjmp .-14 ; 0xedf8 ee06: fc 01 movw r30, r24 ee08: ec 55 subi r30, 0x5C ; 92 ee0a: ff 4e sbci r31, 0xEF ; 239 // 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) ; ee0c: 8d 3e cpi r24, 0xED ; 237 ee0e: 21 e0 ldi r18, 0x01 ; 1 ee10: 92 07 cpc r25, r18 ee12: 40 f4 brcc .+16 ; 0xee24 ee14: 41 91 ld r20, Z+ ee16: 9c 01 movw r18, r24 ee18: 2f 5f subi r18, 0xFF ; 255 ee1a: 3f 4f sbci r19, 0xFF ; 255 ee1c: 41 11 cpse r20, r1 ee1e: e1 cf rjmp .-62 ; 0xede2 ee20: c9 01 movw r24, r18 ee22: f4 cf rjmp .-24 ; 0xee0c // If the end of the buffer was empty, if (bufindr == sizeof(cmdbuffer)) { ee24: e4 ea ldi r30, 0xA4 ; 164 ee26: f0 e1 ldi r31, 0x10 ; 16 ee28: 8d 3e cpi r24, 0xED ; 237 ee2a: 21 e0 ldi r18, 0x01 ; 1 ee2c: 92 07 cpc r25, r18 ee2e: c9 f6 brne .-78 ; 0xede2 ee30: cf 01 movw r24, r30 ee32: 84 5a subi r24, 0xA4 ; 164 ee34: 90 41 sbci r25, 0x10 ; 16 // skip to the start and find the nonzero command. for (bufindr = 0; cmdbuffer[bufindr] == 0; ++ bufindr) ; ee36: 21 91 ld r18, Z+ ee38: 22 23 and r18, r18 ee3a: d1 f3 breq .-12 ; 0xee30 ee3c: d2 cf rjmp .-92 ; 0xede2 SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ } return true; } return false; ee3e: 80 e0 ldi r24, 0x00 ; 0 } ee40: 08 95 ret 0000ee42 : 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; ee42: 80 91 98 04 lds r24, 0x0498 ; 0x800498 ee46: 90 91 99 04 lds r25, 0x0499 ; 0x800499 ee4a: 20 91 9a 04 lds r18, 0x049A ; 0x80049a ee4e: 30 91 9b 04 lds r19, 0x049B ; 0x80049b ee52: 82 1b sub r24, r18 ee54: 93 0b sbc r25, r19 } ee56: 8f 77 andi r24, 0x7F ; 127 ee58: 99 27 eor r25, r25 ee5a: 08 95 ret 0000ee5c : autostart_atmillis.start(); // reset timer } char *createFilename(char *buffer,const dir_t &p) //buffer>12characters { char *pos=buffer; ee5c: fc 01 movw r30, r24 for (uint8_t i = 0; i < 11; i++) ee5e: 20 e0 ldi r18, 0x00 ; 0 { if (p.name[i] == ' ')continue; if (i == 8) { *pos++='.'; ee60: 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; ee62: db 01 movw r26, r22 ee64: 4d 91 ld r20, X+ ee66: bd 01 movw r22, r26 ee68: 40 32 cpi r20, 0x20 ; 32 ee6a: 49 f0 breq .+18 ; 0xee7e if (i == 8) ee6c: 28 30 cpi r18, 0x08 ; 8 ee6e: 11 f4 brne .+4 ; 0xee74 { *pos++='.'; ee70: 30 83 st Z, r19 ee72: 31 96 adiw r30, 0x01 ; 1 } *pos++=p.name[i]; ee74: db 01 movw r26, r22 ee76: 11 97 sbiw r26, 0x01 ; 1 ee78: 4c 91 ld r20, X ee7a: 40 83 st Z, r20 ee7c: 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++) ee7e: 2f 5f subi r18, 0xFF ; 255 ee80: 2b 30 cpi r18, 0x0B ; 11 ee82: 79 f7 brne .-34 ; 0xee62 { *pos++='.'; } *pos++=p.name[i]; } *pos++=0; ee84: 10 82 st Z, r1 return buffer; } ee86: 08 95 ret 0000ee88 : 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);} ee88: 40 e0 ldi r20, 0x00 ; 0 ee8a: 50 e0 ldi r21, 0x00 ; 0 ee8c: ba 01 movw r22, r20 ee8e: 0d 94 4d 56 jmp 0x2ac9a ; 0x2ac9a 0000ee92 : 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();} ee92: fc 01 movw r30, r24 ee94: 23 81 ldd r18, Z+3 ; 0x03 ee96: 21 11 cpse r18, r1 ee98: 0d 94 2b 58 jmp 0x2b056 ; 0x2b056 ee9c: 08 95 ret 0000ee9e : M_UDRx = c; } */ static void write(uint8_t c) { if (selectedSerialPort == 0) ee9e: 90 91 38 05 lds r25, 0x0538 ; 0x800538 eea2: 91 11 cpse r25, r1 eea4: 07 c0 rjmp .+14 ; 0xeeb4 { while (!((M_UCSRxA) & (1 << M_UDREx))); eea6: 90 91 c0 00 lds r25, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> eeaa: 95 ff sbrs r25, 5 eeac: fc cf rjmp .-8 ; 0xeea6 M_UDRx = c; eeae: 80 93 c6 00 sts 0x00C6, r24 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> eeb2: 08 95 ret } else if (selectedSerialPort == 1) eeb4: 91 30 cpi r25, 0x01 ; 1 eeb6: 31 f4 brne .+12 ; 0xeec4 { while (!((UCSR1A) & (1 << UDRE1))); eeb8: 90 91 c8 00 lds r25, 0x00C8 ; 0x8000c8 <__TEXT_REGION_LENGTH__+0x7c20c8> eebc: 95 ff sbrs r25, 5 eebe: fc cf rjmp .-8 ; 0xeeb8 UDR1 = c; eec0: 80 93 ce 00 sts 0x00CE, r24 ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> } } eec4: 08 95 ret 0000eec6 : static FILE _uartout; #define uartout (&_uartout) int uart_putchar(char c, FILE *) { MYSERIAL.write(c); eec6: 0e 94 4f 77 call 0xee9e ; 0xee9e return 0; } eeca: 90 e0 ldi r25, 0x00 ; 0 eecc: 80 e0 ldi r24, 0x00 ; 0 eece: 08 95 ret 0000eed0 : 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) { eed0: cf 93 push r28 eed2: df 93 push r29 eed4: ec 01 movw r28, r24 while(uint8_t ch = pgm_read_byte(str)) { eed6: fe 01 movw r30, r28 eed8: 84 91 lpm r24, Z eeda: 88 23 and r24, r24 eedc: 21 f0 breq .+8 ; 0xeee6 MYSERIAL.write((char)ch); eede: 0e 94 4f 77 call 0xee9e ; 0xee9e ++str; eee2: 21 96 adiw r28, 0x01 ; 1 eee4: f8 cf rjmp .-16 ; 0xeed6 } } eee6: df 91 pop r29 eee8: cf 91 pop r28 eeea: 08 95 ret 0000eeec : // Turn off the print fan fanSpeed = 0; } } void serialecho_temperatures() { eeec: cf 92 push r12 eeee: df 92 push r13 eef0: ef 92 push r14 eef2: 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]; eef4: c0 90 af 0d lds r12, 0x0DAF ; 0x800daf eef8: d0 90 b0 0d lds r13, 0x0DB0 ; 0x800db0 eefc: e0 90 b1 0d lds r14, 0x0DB1 ; 0x800db1 ef00: f0 90 b2 0d lds r15, 0x0DB2 ; 0x800db2 float tt = degHotend(active_extruder); SERIAL_PROTOCOLPGM("T:"); ef04: 89 e6 ldi r24, 0x69 ; 105 ef06: 9e e7 ldi r25, 0x7E ; 126 ef08: 0e 94 68 77 call 0xeed0 ; 0xeed0 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); ef0c: 42 e0 ldi r20, 0x02 ; 2 ef0e: c7 01 movw r24, r14 ef10: b6 01 movw r22, r12 ef12: 0f 94 42 d5 call 0x3aa84 ; 0x3aa84 SERIAL_PROTOCOL(tt); SERIAL_PROTOCOLPGM(" E:0 B:"); ef16: 81 e6 ldi r24, 0x61 ; 97 ef18: 9e e7 ldi r25, 0x7E ; 126 ef1a: 0e 94 68 77 call 0xeed0 ; 0xeed0 ef1e: 60 91 ed 04 lds r22, 0x04ED ; 0x8004ed ef22: 70 91 ee 04 lds r23, 0x04EE ; 0x8004ee ef26: 80 91 ef 04 lds r24, 0x04EF ; 0x8004ef ef2a: 90 91 f0 04 lds r25, 0x04F0 ; 0x8004f0 ef2e: 41 e0 ldi r20, 0x01 ; 1 ef30: 0f 94 42 d5 call 0x3aa84 ; 0x3aa84 SERIAL_PROTOCOL_F(degBed(), 1); SERIAL_PROTOCOLLN(); } ef34: ff 90 pop r15 ef36: ef 90 pop r14 ef38: df 90 pop r13 ef3a: 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(); ef3c: 0d 94 b8 d5 jmp 0x3ab70 ; 0x3ab70 0000ef40 : } } /// @brief Helper function to reduce code size in M861 /// by extracting common code into one function static void gcode_M861_print_pinda_cal_eeprom() { ef40: 4f 92 push r4 ef42: 5f 92 push r5 ef44: 6f 92 push r6 ef46: 7f 92 push r7 ef48: 8f 92 push r8 ef4a: 9f 92 push r9 ef4c: af 92 push r10 ef4e: bf 92 push r11 ef50: cf 92 push r12 ef52: df 92 push r13 ef54: ef 92 push r14 ef56: ff 92 push r15 ef58: 0f 93 push r16 ef5a: 1f 93 push r17 ef5c: cf 93 push r28 ef5e: df 93 push r29 ef60: cc 24 eor r12, r12 ef62: ca 94 dec r12 ef64: dc 2c mov r13, r12 ef66: 76 01 movw r14, r12 ef68: 0e ea ldi r16, 0xAE ; 174 ef6a: 1f e0 ldi r17, 0x0F ; 15 ef6c: 93 e2 ldi r25, 0x23 ; 35 ef6e: 89 2e mov r8, r25 ef70: 91 2c mov r9, r1 ef72: a1 2c mov r10, r1 ef74: b1 2c mov r11, r1 int16_t usteps = 0; float mm = 0; ef76: 41 2c mov r4, r1 ef78: 51 2c mov r5, r1 ef7a: 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; ef7c: d0 e0 ldi r29, 0x00 ; 0 ef7e: 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) { ef80: 8f ef ldi r24, 0xFF ; 255 ef82: c8 16 cp r12, r24 ef84: 09 f4 brne .+2 ; 0xef88 ef86: 5d c0 rjmp .+186 ; 0xf042 usteps = eeprom_read_word((uint16_t*) EEPROM_PROBE_TEMP_SHIFT + (i - 1)); ef88: c8 01 movw r24, r16 ef8a: 0f 94 e5 db call 0x3b7ca ; 0x3b7ca ef8e: ec 01 movw r28, r24 mm = ((float)usteps) / cs.axis_steps_per_mm[Z_AXIS]; ef90: bc 01 movw r22, r24 ef92: 99 0f add r25, r25 ef94: 88 0b sbc r24, r24 ef96: 99 0b sbc r25, r25 ef98: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> ef9c: 20 91 c9 0d lds r18, 0x0DC9 ; 0x800dc9 efa0: 30 91 ca 0d lds r19, 0x0DCA ; 0x800dca efa4: 40 91 cb 0d lds r20, 0x0DCB ; 0x800dcb efa8: 50 91 cc 0d lds r21, 0x0DCC ; 0x800dcc efac: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> efb0: 2b 01 movw r4, r22 efb2: 3c 01 movw r6, r24 efb4: c7 01 movw r24, r14 efb6: b6 01 movw r22, r12 efb8: 0f 94 26 d5 call 0x3aa4c ; 0x3aa4c SERIAL_PROTOCOL(i - 1); } else { SERIAL_PROTOCOLRPGM(MSG_NA); } SERIAL_PROTOCOLRPGM(comma_sep); efbc: 8d eb ldi r24, 0xBD ; 189 efbe: 9d e7 ldi r25, 0x7D ; 125 efc0: 0e 94 68 77 call 0xeed0 ; 0xeed0 efc4: c5 01 movw r24, r10 efc6: b4 01 movw r22, r8 efc8: 0f 94 26 d5 call 0x3aa4c ; 0x3aa4c SERIAL_PROTOCOL(35 + (i * 5)); SERIAL_PROTOCOLRPGM(comma_sep); efcc: 8d eb ldi r24, 0xBD ; 189 efce: 9d e7 ldi r25, 0x7D ; 125 efd0: 0e 94 68 77 call 0xeed0 ; 0xeed0 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); efd4: be 01 movw r22, r28 efd6: 0d 2e mov r0, r29 efd8: 00 0c add r0, r0 efda: 88 0b sbc r24, r24 efdc: 99 0b sbc r25, r25 efde: 0f 94 26 d5 call 0x3aa4c ; 0x3aa4c SERIAL_PROTOCOL(usteps); SERIAL_PROTOCOLRPGM(comma_sep); efe2: 8d eb ldi r24, 0xBD ; 189 efe4: 9d e7 ldi r25, 0x7D ; 125 efe6: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_PROTOCOLLN(mm * 1000); efea: 20 e0 ldi r18, 0x00 ; 0 efec: 30 e0 ldi r19, 0x00 ; 0 efee: 4a e7 ldi r20, 0x7A ; 122 eff0: 54 e4 ldi r21, 0x44 ; 68 eff2: c3 01 movw r24, r6 eff4: b2 01 movw r22, r4 eff6: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> effa: 0f 94 6f 74 call 0x2e8de ; 0x2e8de effe: 85 e0 ldi r24, 0x05 ; 5 f000: 88 0e add r8, r24 f002: 91 1c adc r9, r1 f004: a1 1c adc r10, r1 f006: b1 1c adc r11, r1 f008: 0e 5f subi r16, 0xFE ; 254 f00a: 1f 4f sbci r17, 0xFF ; 255 f00c: 8f ef ldi r24, 0xFF ; 255 f00e: c8 1a sub r12, r24 f010: d8 0a sbc r13, r24 f012: e8 0a sbc r14, r24 f014: 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++) { f016: 0a 3b cpi r16, 0xBA ; 186 f018: 8f e0 ldi r24, 0x0F ; 15 f01a: 18 07 cpc r17, r24 f01c: 09 f0 breq .+2 ; 0xf020 f01e: b0 cf rjmp .-160 ; 0xef80 SERIAL_PROTOCOLRPGM(comma_sep); SERIAL_PROTOCOL(usteps); SERIAL_PROTOCOLRPGM(comma_sep); SERIAL_PROTOCOLLN(mm * 1000); } } f020: df 91 pop r29 f022: cf 91 pop r28 f024: 1f 91 pop r17 f026: 0f 91 pop r16 f028: ff 90 pop r15 f02a: ef 90 pop r14 f02c: df 90 pop r13 f02e: cf 90 pop r12 f030: bf 90 pop r11 f032: af 90 pop r10 f034: 9f 90 pop r9 f036: 8f 90 pop r8 f038: 7f 90 pop r7 f03a: 6f 90 pop r6 f03c: 5f 90 pop r5 f03e: 4f 90 pop r4 f040: 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); f042: 86 ee ldi r24, 0xE6 ; 230 f044: 97 e4 ldi r25, 0x47 ; 71 f046: 0e 94 68 77 call 0xeed0 ; 0xeed0 f04a: b8 cf rjmp .-144 ; 0xefbc 0000f04c : /// @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) { f04c: 88 23 and r24, r24 f04e: 71 f1 breq .+92 ; 0xf0ac currentMMUSlot = slot; } uint8_t SpoolJoin::nextSlot() { SERIAL_ECHOPGM("SpoolJoin: "); f050: 81 eb ldi r24, 0xB1 ; 177 f052: 9d e7 ldi r25, 0x7D ; 125 f054: 0e 94 68 77 call 0xeed0 ; 0xeed0 f058: 60 91 48 13 lds r22, 0x1348 ; 0x801348 f05c: 70 e0 ldi r23, 0x00 ; 0 f05e: 90 e0 ldi r25, 0x00 ; 0 f060: 80 e0 ldi r24, 0x00 ; 0 f062: 0f 94 26 d5 call 0x3aa4c ; 0x3aa4c SERIAL_ECHO((int)currentMMUSlot); if (currentMMUSlot >= 4) currentMMUSlot = 0; f066: 80 91 48 13 lds r24, 0x1348 ; 0x801348 f06a: 84 30 cpi r24, 0x04 ; 4 f06c: d8 f0 brcs .+54 ; 0xf0a4 f06e: 10 92 48 13 sts 0x1348, r1 ; 0x801348 else currentMMUSlot++; SERIAL_ECHOPGM(" -> "); f072: 8c ea ldi r24, 0xAC ; 172 f074: 9d e7 ldi r25, 0x7D ; 125 f076: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHOLN((int)currentMMUSlot); f07a: 80 91 48 13 lds r24, 0x1348 ; 0x801348 f07e: 90 e0 ldi r25, 0x00 ; 0 f080: 0f 94 b0 74 call 0x2e960 ; 0x2e960 return currentMMUSlot; f084: 80 91 48 13 lds r24, 0x1348 ; 0x801348 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; f088: 20 91 ab 05 lds r18, 0x05AB ; 0x8005ab f08c: 30 91 ac 05 lds r19, 0x05AC ; 0x8005ac f090: 30 93 b6 0d sts 0x0DB6, r19 ; 0x800db6 f094: 20 93 b5 0d sts 0x0DB5, r18 ; 0x800db5 slot = choose_menu_P(_T(MSG_SELECT_FILAMENT), MSG_FILAMENT); } setTargetHotend(saved_extruder_temperature); MMU2::mmu2.load_filament_to_nozzle(slot); f098: 0f 94 86 0e call 0x21d0c ; 0x21d0c load_filament_final_feed(); // @@TODO verify f09c: 0e 94 ab 64 call 0xc956 ; 0xc956 st_synchronize(); f0a0: 0d 94 a3 42 jmp 0x28546 ; 0x28546 { SERIAL_ECHOPGM("SpoolJoin: "); SERIAL_ECHO((int)currentMMUSlot); if (currentMMUSlot >= 4) currentMMUSlot = 0; else currentMMUSlot++; f0a4: 8f 5f subi r24, 0xFF ; 255 f0a6: 80 93 48 13 sts 0x1348, r24 ; 0x801348 f0aa: e3 cf rjmp .-58 ; 0xf072 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); f0ac: 8d ea ldi r24, 0xAD ; 173 f0ae: 9b e3 ldi r25, 0x3B ; 59 f0b0: 0e 94 c4 72 call 0xe588 ; 0xe588 f0b4: 70 e0 ldi r23, 0x00 ; 0 f0b6: 60 e0 ldi r22, 0x00 ; 0 f0b8: 0e 94 dc e3 call 0x1c7b8 ; 0x1c7b8 f0bc: e5 cf rjmp .-54 ; 0xf088 0000f0be : return final_result; } void gcode_M114() { f0be: cf 93 push r28 f0c0: df 93 push r29 SERIAL_PROTOCOLPGM("X:"); f0c2: 89 ea ldi r24, 0xA9 ; 169 f0c4: 9d e7 ldi r25, 0x7D ; 125 f0c6: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_PROTOCOL(current_position[X_AXIS]); f0ca: c1 e9 ldi r28, 0x91 ; 145 f0cc: d6 e0 ldi r29, 0x06 ; 6 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); f0ce: 68 81 ld r22, Y f0d0: 79 81 ldd r23, Y+1 ; 0x01 f0d2: 8a 81 ldd r24, Y+2 ; 0x02 f0d4: 9b 81 ldd r25, Y+3 ; 0x03 f0d6: 42 e0 ldi r20, 0x02 ; 2 f0d8: 0f 94 42 d5 call 0x3aa84 ; 0x3aa84 SERIAL_PROTOCOLPGM(" Y:"); f0dc: 85 ea ldi r24, 0xA5 ; 165 f0de: 9d e7 ldi r25, 0x7D ; 125 f0e0: 0e 94 68 77 call 0xeed0 ; 0xeed0 f0e4: 6c 81 ldd r22, Y+4 ; 0x04 f0e6: 7d 81 ldd r23, Y+5 ; 0x05 f0e8: 8e 81 ldd r24, Y+6 ; 0x06 f0ea: 9f 81 ldd r25, Y+7 ; 0x07 f0ec: 42 e0 ldi r20, 0x02 ; 2 f0ee: 0f 94 42 d5 call 0x3aa84 ; 0x3aa84 SERIAL_PROTOCOL(current_position[Y_AXIS]); SERIAL_PROTOCOLPGM(" Z:"); f0f2: 81 ea ldi r24, 0xA1 ; 161 f0f4: 9d e7 ldi r25, 0x7D ; 125 f0f6: 0e 94 68 77 call 0xeed0 ; 0xeed0 f0fa: 68 85 ldd r22, Y+8 ; 0x08 f0fc: 79 85 ldd r23, Y+9 ; 0x09 f0fe: 8a 85 ldd r24, Y+10 ; 0x0a f100: 9b 85 ldd r25, Y+11 ; 0x0b f102: 42 e0 ldi r20, 0x02 ; 2 f104: 0f 94 42 d5 call 0x3aa84 ; 0x3aa84 SERIAL_PROTOCOL(current_position[Z_AXIS]); SERIAL_PROTOCOLPGM(" E:"); f108: 8d e9 ldi r24, 0x9D ; 157 f10a: 9d e7 ldi r25, 0x7D ; 125 f10c: 0e 94 68 77 call 0xeed0 ; 0xeed0 f110: 6c 85 ldd r22, Y+12 ; 0x0c f112: 7d 85 ldd r23, Y+13 ; 0x0d f114: 8e 85 ldd r24, Y+14 ; 0x0e f116: 9f 85 ldd r25, Y+15 ; 0x0f f118: 42 e0 ldi r20, 0x02 ; 2 f11a: 0f 94 42 d5 call 0x3aa84 ; 0x3aa84 SERIAL_PROTOCOL(current_position[E_AXIS]); SERIAL_PROTOCOLRPGM(_n(" Count X: "));////MSG_COUNT_X f11e: 8f e6 ldi r24, 0x6F ; 111 f120: 96 e6 ldi r25, 0x66 ; 102 f122: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_PROTOCOL(float(st_get_position(X_AXIS)) / cs.axis_steps_per_mm[X_AXIS]); f126: 80 e0 ldi r24, 0x00 ; 0 f128: 0f 94 81 42 call 0x28502 ; 0x28502 f12c: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> f130: cd eb ldi r28, 0xBD ; 189 f132: dd e0 ldi r29, 0x0D ; 13 f134: 2c 81 ldd r18, Y+4 ; 0x04 f136: 3d 81 ldd r19, Y+5 ; 0x05 f138: 4e 81 ldd r20, Y+6 ; 0x06 f13a: 5f 81 ldd r21, Y+7 ; 0x07 f13c: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> f140: 42 e0 ldi r20, 0x02 ; 2 f142: 0f 94 42 d5 call 0x3aa84 ; 0x3aa84 SERIAL_PROTOCOLPGM(" Y:"); f146: 89 e9 ldi r24, 0x99 ; 153 f148: 9d e7 ldi r25, 0x7D ; 125 f14a: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_PROTOCOL(float(st_get_position(Y_AXIS)) / cs.axis_steps_per_mm[Y_AXIS]); f14e: 81 e0 ldi r24, 0x01 ; 1 f150: 0f 94 81 42 call 0x28502 ; 0x28502 f154: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> f158: 28 85 ldd r18, Y+8 ; 0x08 f15a: 39 85 ldd r19, Y+9 ; 0x09 f15c: 4a 85 ldd r20, Y+10 ; 0x0a f15e: 5b 85 ldd r21, Y+11 ; 0x0b f160: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> f164: 42 e0 ldi r20, 0x02 ; 2 f166: 0f 94 42 d5 call 0x3aa84 ; 0x3aa84 SERIAL_PROTOCOLPGM(" Z:"); f16a: 85 e9 ldi r24, 0x95 ; 149 f16c: 9d e7 ldi r25, 0x7D ; 125 f16e: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_PROTOCOL(float(st_get_position(Z_AXIS)) / cs.axis_steps_per_mm[Z_AXIS]); f172: 82 e0 ldi r24, 0x02 ; 2 f174: 0f 94 81 42 call 0x28502 ; 0x28502 f178: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> f17c: 2c 85 ldd r18, Y+12 ; 0x0c f17e: 3d 85 ldd r19, Y+13 ; 0x0d f180: 4e 85 ldd r20, Y+14 ; 0x0e f182: 5f 85 ldd r21, Y+15 ; 0x0f f184: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> f188: 42 e0 ldi r20, 0x02 ; 2 f18a: 0f 94 42 d5 call 0x3aa84 ; 0x3aa84 SERIAL_PROTOCOLPGM(" E:"); f18e: 81 e9 ldi r24, 0x91 ; 145 f190: 9d e7 ldi r25, 0x7D ; 125 f192: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_PROTOCOLLN(float(st_get_position(E_AXIS)) / cs.axis_steps_per_mm[E_AXIS]); f196: 83 e0 ldi r24, 0x03 ; 3 f198: 0f 94 81 42 call 0x28502 ; 0x28502 f19c: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> f1a0: 28 89 ldd r18, Y+16 ; 0x10 f1a2: 39 89 ldd r19, Y+17 ; 0x11 f1a4: 4a 89 ldd r20, Y+18 ; 0x12 f1a6: 5b 89 ldd r21, Y+19 ; 0x13 f1a8: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> } f1ac: df 91 pop r29 f1ae: 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]); f1b0: 0d 94 6f 74 jmp 0x2e8de ; 0x2e8de 0000f1b4 : #endif //TMC2130 void gcode_M105() { #if defined(TEMP_0_PIN) && TEMP_0_PIN > -1 SERIAL_PROTOCOLPGM("T:"); f1b4: 80 ea ldi r24, 0xA0 ; 160 f1b6: 9c e7 ldi r25, 0x7C ; 124 f1b8: 0e 94 68 77 call 0xeed0 ; 0xeed0 f1bc: 60 91 af 0d lds r22, 0x0DAF ; 0x800daf f1c0: 70 91 b0 0d lds r23, 0x0DB0 ; 0x800db0 f1c4: 80 91 b1 0d lds r24, 0x0DB1 ; 0x800db1 f1c8: 90 91 b2 0d lds r25, 0x0DB2 ; 0x800db2 f1cc: 41 e0 ldi r20, 0x01 ; 1 f1ce: 0f 94 42 d5 call 0x3aa84 ; 0x3aa84 SERIAL_PROTOCOL_F(degHotend(active_extruder),1); SERIAL_PROTOCOLPGM(" /"); f1d2: 8d e9 ldi r24, 0x9D ; 157 f1d4: 9c e7 ldi r25, 0x7C ; 124 f1d6: 0e 94 68 77 call 0xeed0 ; 0xeed0 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; f1da: 60 91 b5 0d lds r22, 0x0DB5 ; 0x800db5 f1de: 70 91 b6 0d lds r23, 0x0DB6 ; 0x800db6 f1e2: 07 2e mov r0, r23 f1e4: 00 0c add r0, r0 f1e6: 88 0b sbc r24, r24 f1e8: 99 0b sbc r25, r25 f1ea: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> f1ee: 41 e0 ldi r20, 0x01 ; 1 f1f0: 0f 94 42 d5 call 0x3aa84 ; 0x3aa84 SERIAL_PROTOCOL_F(degTargetHotend(active_extruder),1); #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1 SERIAL_PROTOCOLPGM(" B:"); f1f4: 89 e9 ldi r24, 0x99 ; 153 f1f6: 9c e7 ldi r25, 0x7C ; 124 f1f8: 0e 94 68 77 call 0xeed0 ; 0xeed0 f1fc: 60 91 ed 04 lds r22, 0x04ED ; 0x8004ed f200: 70 91 ee 04 lds r23, 0x04EE ; 0x8004ee f204: 80 91 ef 04 lds r24, 0x04EF ; 0x8004ef f208: 90 91 f0 04 lds r25, 0x04F0 ; 0x8004f0 f20c: 41 e0 ldi r20, 0x01 ; 1 f20e: 0f 94 42 d5 call 0x3aa84 ; 0x3aa84 SERIAL_PROTOCOL_F(degBed(),1); SERIAL_PROTOCOLPGM(" /"); f212: 86 e9 ldi r24, 0x96 ; 150 f214: 9c e7 ldi r25, 0x7C ; 124 f216: 0e 94 68 77 call 0xeed0 ; 0xeed0 }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; f21a: 60 91 71 06 lds r22, 0x0671 ; 0x800671 f21e: 70 91 72 06 lds r23, 0x0672 ; 0x800672 f222: 07 2e mov r0, r23 f224: 00 0c add r0, r0 f226: 88 0b sbc r24, r24 f228: 99 0b sbc r25, r25 f22a: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> f22e: 41 e0 ldi r20, 0x01 ; 1 f230: 0f 94 42 d5 call 0x3aa84 ; 0x3aa84 SERIAL_PROTOCOL_F(degTargetBed(),1); #endif //TEMP_BED_PIN SERIAL_PROTOCOLPGM(" T0:"); f234: 81 e9 ldi r24, 0x91 ; 145 f236: 9c e7 ldi r25, 0x7C ; 124 f238: 0e 94 68 77 call 0xeed0 ; 0xeed0 f23c: 60 91 af 0d lds r22, 0x0DAF ; 0x800daf f240: 70 91 b0 0d lds r23, 0x0DB0 ; 0x800db0 f244: 80 91 b1 0d lds r24, 0x0DB1 ; 0x800db1 f248: 90 91 b2 0d lds r25, 0x0DB2 ; 0x800db2 f24c: 41 e0 ldi r20, 0x01 ; 1 f24e: 0f 94 42 d5 call 0x3aa84 ; 0x3aa84 SERIAL_PROTOCOL_F(degHotend(active_extruder),1); SERIAL_PROTOCOLPGM(" /"); f252: 8e e8 ldi r24, 0x8E ; 142 f254: 9c e7 ldi r25, 0x7C ; 124 f256: 0e 94 68 77 call 0xeed0 ; 0xeed0 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; f25a: 60 91 b5 0d lds r22, 0x0DB5 ; 0x800db5 f25e: 70 91 b6 0d lds r23, 0x0DB6 ; 0x800db6 f262: 07 2e mov r0, r23 f264: 00 0c add r0, r0 f266: 88 0b sbc r24, r24 f268: 99 0b sbc r25, r25 f26a: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> f26e: 41 e0 ldi r20, 0x01 ; 1 f270: 0f 94 42 d5 call 0x3aa84 ; 0x3aa84 #else SERIAL_ERROR_START; SERIAL_ERRORLNRPGM(_n("No thermistors - no temperature"));////MSG_ERR_NO_THERMISTORS #endif SERIAL_PROTOCOLPGM(" @:"); f274: 8a e8 ldi r24, 0x8A ; 138 f276: 9c e7 ldi r25, 0x7C ; 124 f278: 0e 94 68 77 call 0xeed0 ; 0xeed0 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); f27c: 60 91 15 05 lds r22, 0x0515 ; 0x800515 <_ZL8soft_pwm.lto_priv.459> f280: 70 e0 ldi r23, 0x00 ; 0 f282: 90 e0 ldi r25, 0x00 ; 0 f284: 80 e0 ldi r24, 0x00 ; 0 f286: 0f 94 26 d5 call 0x3aa4c ; 0x3aa4c SERIAL_PROTOCOLPGM("W"); #else SERIAL_PROTOCOL(getHeaterPower(active_extruder)); #endif SERIAL_PROTOCOLPGM(" B@:"); f28a: 85 e8 ldi r24, 0x85 ; 133 f28c: 9c e7 ldi r25, 0x7C ; 124 f28e: 0e 94 68 77 call 0xeed0 ; 0xeed0 f292: 60 91 1c 06 lds r22, 0x061C ; 0x80061c f296: 70 e0 ldi r23, 0x00 ; 0 f298: 90 e0 ldi r25, 0x00 ; 0 f29a: 80 e0 ldi r24, 0x00 ; 0 f29c: 0f 94 26 d5 call 0x3aa4c ; 0x3aa4c #else SERIAL_PROTOCOL(getHeaterPower(-1)); #endif #ifdef PINDA_THERMISTOR SERIAL_PROTOCOLPGM(" P:"); f2a0: 81 e8 ldi r24, 0x81 ; 129 f2a2: 9c e7 ldi r25, 0x7C ; 124 f2a4: 0e 94 68 77 call 0xeed0 ; 0xeed0 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); f2a8: 60 91 97 03 lds r22, 0x0397 ; 0x800397 f2ac: 70 91 98 03 lds r23, 0x0398 ; 0x800398 f2b0: 80 91 99 03 lds r24, 0x0399 ; 0x800399 f2b4: 90 91 9a 03 lds r25, 0x039A ; 0x80039a f2b8: 41 e0 ldi r20, 0x01 ; 1 f2ba: 0f 94 42 d5 call 0x3aa84 ; 0x3aa84 SERIAL_PROTOCOL_F(current_temperature_pinda,1); #endif //PINDA_THERMISTOR #ifdef AMBIENT_THERMISTOR SERIAL_PROTOCOLPGM(" A:"); f2be: 8d e7 ldi r24, 0x7D ; 125 f2c0: 9c e7 ldi r25, 0x7C ; 124 f2c2: 0e 94 68 77 call 0xeed0 ; 0xeed0 f2c6: 60 91 55 06 lds r22, 0x0655 ; 0x800655 f2ca: 70 91 56 06 lds r23, 0x0656 ; 0x800656 f2ce: 80 91 57 06 lds r24, 0x0657 ; 0x800657 f2d2: 90 91 58 06 lds r25, 0x0658 ; 0x800658 f2d6: 41 e0 ldi r20, 0x01 ; 1 f2d8: 0f 94 42 d5 call 0x3aa84 ; 0x3aa84 SERIAL_PROTOCOL_F(100 * (1 + (PtA * (raw/OVERSAMPLENR)) + (PtB * sq((raw/OVERSAMPLENR)))), 5); SERIAL_PROTOCOLPGM(" Rx0->"); SERIAL_PROTOCOL_F(raw, 5); } #endif SERIAL_PROTOCOLLN(); f2dc: 0d 94 b8 d5 jmp 0x3ab70 ; 0x3ab70 0000f2e0 : } } 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); } f2e0: 20 91 87 14 lds r18, 0x1487 ; 0x801487 f2e4: 30 e0 ldi r19, 0x00 ; 0 f2e6: a8 ee ldi r26, 0xE8 ; 232 f2e8: b3 e0 ldi r27, 0x03 ; 3 f2ea: 0f 94 77 dc call 0x3b8ee ; 0x3b8ee <__umulhisi3> f2ee: ab 01 movw r20, r22 f2f0: bc 01 movw r22, r24 f2f2: 88 e8 ldi r24, 0x88 ; 136 f2f4: 94 e1 ldi r25, 0x14 ; 20 f2f6: 0f 94 06 2a call 0x2540c ; 0x2540c ::expired(unsigned long)> * Output autoreport values according to features requested in M155 */ #if defined(AUTO_REPORT) void host_autoreport() { if (autoReportFeatures.TimerExpired()) f2fa: 88 23 and r24, r24 f2fc: 99 f0 breq .+38 ; 0xf324 f2fe: 80 91 86 14 lds r24, 0x1486 ; 0x801486 { if(autoReportFeatures.Temp()){ f302: 80 fd sbrc r24, 0 gcode_M105(); f304: 0e 94 da 78 call 0xf1b4 ; 0xf1b4 f308: 80 91 86 14 lds r24, 0x1486 ; 0x801486 } if(autoReportFeatures.Pos()){ f30c: 82 fd sbrc r24, 2 gcode_M114(); f30e: 0e 94 5f 78 call 0xf0be ; 0xf0be f312: 80 91 86 14 lds r24, 0x1486 ; 0x801486 } #if defined(AUTO_REPORT) && (defined(FANCHECK) && (((defined(TACH_0) && (TACH_0 >-1)) || (defined(TACH_1) && (TACH_1 > -1))))) if(autoReportFeatures.Fans()){ f316: 81 fd sbrc r24, 1 gcode_M123(); f318: 0e 94 9c 66 call 0xcd38 ; 0xcd38 } else{ auto_report_timer.stop(); } } inline void TimerStart() { auto_report_timer.start(); } f31c: 88 e8 ldi r24, 0x88 ; 136 f31e: 94 e1 ldi r25, 0x14 ; 20 f320: 0d 94 c5 2b jmp 0x2578a ; 0x2578a ::start()> gcode_M123(); } #endif //AUTO_REPORT and (FANCHECK and TACH_0 or TACH_1) autoReportFeatures.TimerStart(); } } f324: 08 95 ret 0000f326 : ++str; } } void serialprintlnPGM(const char *str) { serialprintPGM(str); f326: 0e 94 68 77 call 0xeed0 ; 0xeed0 MYSERIAL.println(); f32a: 0d 94 b8 d5 jmp 0x3ab70 ; 0x3ab70 0000f32e : #endif //TEMP_RESIDENCY_TIME } } void check_babystep() { f32e: 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))); f330: 81 ea ldi r24, 0xA1 ; 161 f332: 9d e0 ldi r25, 0x0D ; 13 f334: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae } } void check_babystep() { int babystep_z = eeprom_read_word(reinterpret_cast(&(EEPROM_Sheets_base-> f338: cb e0 ldi r28, 0x0B ; 11 f33a: 8c 9f mul r24, r28 f33c: c0 01 movw r24, r0 f33e: 11 24 eor r1, r1 f340: 80 5b subi r24, 0xB0 ; 176 f342: 92 4f sbci r25, 0xF2 ; 242 f344: 0f 94 e5 db call 0x3b7ca ; 0x3b7ca s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset))); if ((babystep_z < Z_BABYSTEP_MIN) || (babystep_z > Z_BABYSTEP_MAX)) { f348: 81 56 subi r24, 0x61 ; 97 f34a: 90 4f sbci r25, 0xF0 ; 240 f34c: 80 3a cpi r24, 0xA0 ; 160 f34e: 9f 40 sbci r25, 0x0F ; 15 f350: c8 f0 brcs .+50 ; 0xf384 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"); f352: 88 e3 ldi r24, 0x38 ; 56 f354: 9e e7 ldi r25, 0x7E ; 126 f356: 0e 94 93 79 call 0xf326 ; 0xf326 eeprom_write_word_notify(reinterpret_cast(&(EEPROM_Sheets_base-> s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)), f35a: 81 ea ldi r24, 0xA1 ; 161 f35c: 9d e0 ldi r25, 0x0D ; 13 f35e: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 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-> f362: 8c 9f mul r24, r28 f364: c0 01 movw r24, r0 f366: 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); f368: 70 e0 ldi r23, 0x00 ; 0 f36a: 60 e0 ldi r22, 0x00 ; 0 f36c: 80 5b subi r24, 0xB0 ; 176 f36e: 92 4f sbci r25, 0xF2 ; 242 f370: 0f 94 35 dc call 0x3b86a ; 0x3b86a 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.")); f374: 8b ef ldi r24, 0xFB ; 251 f376: 9d e7 ldi r25, 0x7D ; 125 f378: 0f 94 c7 1f call 0x23f8e ; 0x23f8e lcd_update_enable(true); f37c: 81 e0 ldi r24, 0x01 ; 1 } } f37e: 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); f380: 0c 94 3d 6f jmp 0xde7a ; 0xde7a } } f384: cf 91 pop r28 f386: 08 95 ret 0000f388 : // This either pauses (for thermal model errors) or stops *without recovery* depending on // "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) { f388: ff 92 push r15 f38a: 0f 93 push r16 f38c: 1f 93 push r17 f38e: cf 93 push r28 f390: df 93 push r29 if(Stopped == false) { f392: 90 91 10 05 lds r25, 0x0510 ; 0x800510 f396: 91 11 cpse r25, r1 f398: 4f c0 rjmp .+158 ; 0xf438 f39a: c8 2f mov r28, r24 Stopped = true; f39c: 81 e0 ldi r24, 0x01 ; 1 f39e: 80 93 10 05 sts 0x0510, r24 ; 0x800510 // Either pause or stop the print if(allow_recovery && printJobOngoing()) { f3a2: cc 23 and r28, r28 f3a4: 11 f1 breq .+68 ; 0xf3ea f3a6: 0e 94 a8 67 call 0xcf50 ; 0xcf50 f3aa: 88 23 and r24, r24 f3ac: f1 f0 breq .+60 ; 0xf3ea if (!printingIsPaused()) { f3ae: 0e 94 9d 67 call 0xcf3a ; 0xcf3a f3b2: 81 11 cpse r24, r1 f3b4: 22 c0 rjmp .+68 ; 0xf3fa lcd_setalertstatuspgm(_T(MSG_PAUSED_THERMAL_ERROR), LCD_STATUS_CRITICAL); f3b6: 81 ea ldi r24, 0xA1 ; 161 f3b8: 96 e3 ldi r25, 0x36 ; 54 f3ba: 0e 94 c4 72 call 0xe588 ; 0xe588 f3be: 63 e0 ldi r22, 0x03 ; 3 f3c0: 0e 94 f8 f0 call 0x1e1f0 ; 0x1e1f0 // we cannot make a distinction for the host here, the pause must be instantaneous // so we call the lcd_pause_print to save the print state internally. Thermal errors // disable heaters and save the original temperatures to saved_*, which will get // overwritten by stop_and_save_print_to_ram. For this corner-case, re-instate the // original values after the pause handler is called. uint8_t bed_temp = saved_bed_temperature; f3c4: f0 90 ad 05 lds r15, 0x05AD ; 0x8005ad uint16_t ext_temp = saved_extruder_temperature; f3c8: 00 91 ab 05 lds r16, 0x05AB ; 0x8005ab f3cc: 10 91 ac 05 lds r17, 0x05AC ; 0x8005ac uint8_t fan_speed = saved_fan_speed; f3d0: d0 91 aa 05 lds r29, 0x05AA ; 0x8005aa lcd_pause_print(); f3d4: 0f 94 2e 29 call 0x2525c ; 0x2525c saved_bed_temperature = bed_temp; f3d8: f0 92 ad 05 sts 0x05AD, r15 ; 0x8005ad saved_extruder_temperature = ext_temp; f3dc: 10 93 ac 05 sts 0x05AC, r17 ; 0x8005ac f3e0: 00 93 ab 05 sts 0x05AB, r16 ; 0x8005ab saved_fan_speed = fan_speed; f3e4: d0 93 aa 05 sts 0x05AA, r29 ; 0x8005aa f3e8: 08 c0 rjmp .+16 ; 0xf3fa } } else { // We got a hard thermal error and/or there is no print going on. Just stop. print_stop(false, true); f3ea: 61 e0 ldi r22, 0x01 ; 1 f3ec: 80 e0 ldi r24, 0x00 ; 0 f3ee: 0e 94 75 f4 call 0x1e8ea ; 0x1e8ea } // Report the error on the serial serialprintPGM(allow_recovery ? echomagic : errormagic); f3f2: 8a ec ldi r24, 0xCA ; 202 f3f4: 9b ea ldi r25, 0xAB ; 171 f3f6: cc 23 and r28, r28 f3f8: 11 f0 breq .+4 ; 0xf3fe f3fa: 82 ef ldi r24, 0xF2 ; 242 f3fc: 9b ea ldi r25, 0xAB ; 171 f3fe: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ERRORLNRPGM(MSG_ERR_STOPPED); f402: 88 ee ldi r24, 0xE8 ; 232 f404: 96 e6 ldi r25, 0x66 ; 102 f406: 0e 94 93 79 call 0xf326 ; 0xf326 // 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)); f40a: 86 e9 ldi r24, 0x96 ; 150 f40c: 96 e3 ldi r25, 0x36 ; 54 f40e: 0e 94 c4 72 call 0xe588 ; 0xe588 f412: 0e 94 38 f1 call 0x1e270 ; 0x1e270 // 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); f416: 9f b7 in r25, 0x3f ; 63 f418: f8 94 cli f41a: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> f41e: 84 60 ori r24, 0x04 ; 4 f420: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> f424: 9f bf out 0x3f, r25 ; 63 // Always return to the status screen to ensure the NEW error is immediately shown. lcd_return_to_status(); f426: 0f 94 7c 1e call 0x23cf8 ; 0x23cf8 if(!allow_recovery) { f42a: c1 11 cpse r28, r1 f42c: 05 c0 rjmp .+10 ; 0xf438 // prevent menu access for all fatal errors menu_set_block(MENU_BLOCK_THERMAL_ERROR); f42e: 80 91 d4 03 lds r24, 0x03D4 ; 0x8003d4 f432: 81 60 ori r24, 0x01 ; 1 f434: 80 93 d4 03 sts 0x03D4, r24 ; 0x8003d4 } } } f438: df 91 pop r29 f43a: cf 91 pop r28 f43c: 1f 91 pop r17 f43e: 0f 91 pop r16 f440: ff 90 pop r15 f442: 08 95 ret 0000f444 : #endif //AUTO_REPORT host_keepalive(); M79_timer_update_status(); } void kill(const char *full_screen_message) { f444: ec 01 movw r28, r24 cli(); // Stop interrupts f446: f8 94 cli disable_heater(); f448: 0f 94 ee 2e call 0x25ddc ; 0x25ddc disable_x(); f44c: 17 9a sbi 0x02, 7 ; 2 f44e: 10 92 8e 06 sts 0x068E, r1 ; 0x80068e disable_y(); f452: 16 9a sbi 0x02, 6 ; 2 f454: 10 92 8f 06 sts 0x068F, r1 ; 0x80068f poweroff_z(); disable_e0(); f458: 14 9a sbi 0x02, 4 ; 2 SERIAL_ERROR_START; f45a: 8a ec ldi r24, 0xCA ; 202 f45c: 9b ea ldi r25, 0xAB ; 171 f45e: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ERRORLNRPGM(PSTR("Printer halted. kill() called!")); f462: 8c ed ldi r24, 0xDC ; 220 f464: 9d e7 ldi r25, 0x7D ; 125 f466: 0e 94 93 79 call 0xf326 ; 0xf326 if (full_screen_message != NULL) { f46a: 20 97 sbiw r28, 0x00 ; 0 f46c: 79 f0 breq .+30 ; 0xf48c SERIAL_ERRORLNRPGM(full_screen_message); f46e: ce 01 movw r24, r28 f470: 0e 94 93 79 call 0xf326 ; 0xf326 f474: be 01 movw r22, r28 f476: 85 e9 ldi r24, 0x95 ; 149 f478: 9c e0 ldi r25, 0x0C ; 12 f47a: 0f 94 35 dc call 0x3b86a ; 0x3b86a 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); f47e: 62 e4 ldi r22, 0x42 ; 66 f480: 84 e9 ldi r24, 0x94 ; 148 f482: 9c e0 ldi r25, 0x0C ; 12 f484: 0f 94 1f dc call 0x3b83e ; 0x3b83e // 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(); f488: 0e 94 64 67 call 0xcec8 ; 0xcec8 SERIAL_ERRORLNRPGM(PSTR("Printer halted. kill() called!")); if (full_screen_message != NULL) { SERIAL_ERRORLNRPGM(full_screen_message); } else { full_screen_message = PSTR("KILLED."); f48c: c4 ed ldi r28, 0xD4 ; 212 f48e: dd e7 ldi r29, 0x7D ; 125 f490: f1 cf rjmp .-30 ; 0xf474 0000f492 : #endif //TMC2130 #ifdef TMC2130 void check_Z_crash(void) { if (!READ(Z_TMC2130_DIAG)) { //Z crash f492: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> f496: 86 fd sbrc r24, 6 f498: 35 c0 rjmp .+106 ; 0xf504 FORCE_HIGH_POWER_END; f49a: 80 e0 ldi r24, 0x00 ; 0 f49c: 0e 94 c8 66 call 0xcd90 ; 0xcd90 current_position[Z_AXIS] = 0; f4a0: 10 92 99 06 sts 0x0699, r1 ; 0x800699 f4a4: 10 92 9a 06 sts 0x069A, r1 ; 0x80069a f4a8: 10 92 9b 06 sts 0x069B, r1 ; 0x80069b f4ac: 10 92 9c 06 sts 0x069C, r1 ; 0x80069c plan_set_position_curposXYZE(); f4b0: 0f 94 c4 be call 0x37d88 ; 0x37d88 current_position[Z_AXIS] += MESH_HOME_Z_SEARCH; f4b4: 20 e0 ldi r18, 0x00 ; 0 f4b6: 30 e0 ldi r19, 0x00 ; 0 f4b8: 40 ea ldi r20, 0xA0 ; 160 f4ba: 50 e4 ldi r21, 0x40 ; 64 f4bc: 60 91 99 06 lds r22, 0x0699 ; 0x800699 f4c0: 70 91 9a 06 lds r23, 0x069A ; 0x80069a f4c4: 80 91 9b 06 lds r24, 0x069B ; 0x80069b f4c8: 90 91 9c 06 lds r25, 0x069C ; 0x80069c f4cc: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> f4d0: 60 93 99 06 sts 0x0699, r22 ; 0x800699 f4d4: 70 93 9a 06 sts 0x069A, r23 ; 0x80069a f4d8: 80 93 9b 06 sts 0x069B, r24 ; 0x80069b f4dc: 90 93 9c 06 sts 0x069C, r25 ; 0x80069c plan_buffer_line_curposXYZE(max_feedrate[Z_AXIS]); f4e0: e0 91 71 02 lds r30, 0x0271 ; 0x800271 f4e4: f0 91 72 02 lds r31, 0x0272 ; 0x800272 f4e8: 60 85 ldd r22, Z+8 ; 0x08 f4ea: 71 85 ldd r23, Z+9 ; 0x09 f4ec: 82 85 ldd r24, Z+10 ; 0x0a f4ee: 93 85 ldd r25, Z+11 ; 0x0b f4f0: 0f 94 04 c0 call 0x38008 ; 0x38008 st_synchronize(); f4f4: 0f 94 a3 42 call 0x28546 ; 0x28546 kill(_T(MSG_BED_LEVELING_FAILED_POINT_LOW)); f4f8: 8b e8 ldi r24, 0x8B ; 139 f4fa: 94 e6 ldi r25, 0x64 ; 100 f4fc: 0e 94 c4 72 call 0xe588 ; 0xe588 f500: 0e 94 22 7a call 0xf444 ; 0xf444 } } f504: 08 95 ret 0000f506 : #ifdef TMC2130 void homeaxis(uint8_t axis, uint8_t cnt, uint8_t* pstep) #else void homeaxis(uint8_t axis, uint8_t cnt) #endif //TMC2130 { f506: 2f 92 push r2 f508: 3f 92 push r3 f50a: 4f 92 push r4 f50c: 5f 92 push r5 f50e: 6f 92 push r6 f510: 7f 92 push r7 f512: 8f 92 push r8 f514: 9f 92 push r9 f516: af 92 push r10 f518: bf 92 push r11 f51a: cf 92 push r12 f51c: df 92 push r13 f51e: ef 92 push r14 f520: ff 92 push r15 f522: 0f 93 push r16 f524: 1f 93 push r17 f526: cf 93 push r28 f528: df 93 push r29 f52a: cd b7 in r28, 0x3d ; 61 f52c: de b7 in r29, 0x3e ; 62 f52e: 60 97 sbiw r28, 0x10 ; 16 f530: 0f b6 in r0, 0x3f ; 63 f532: f8 94 cli f534: de bf out 0x3e, r29 ; 62 f536: 0f be out 0x3f, r0 ; 63 f538: cd bf out 0x3d, r28 ; 61 f53a: 28 2e mov r2, r24 f53c: 6e 87 std Y+14, r22 ; 0x0e f53e: 5a 87 std Y+10, r21 ; 0x0a f540: 49 87 std Y+9, r20 ; 0x09 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; f542: 20 91 b7 02 lds r18, 0x02B7 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> f546: 2d 87 std Y+13, r18 ; 0x0d check_endstops = check; f548: 77 24 eor r7, r7 f54a: 73 94 inc r7 f54c: 70 92 b7 02 sts 0x02B7, r7 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> 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) f550: 42 e0 ldi r20, 0x02 ; 2 f552: 84 17 cp r24, r20 f554: 09 f4 brne .+2 ; 0xf558 f556: d4 c1 rjmp .+936 ; 0xf900 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); f558: 08 2f mov r16, r24 f55a: 10 e0 ldi r17, 0x00 ; 0 f55c: f8 01 movw r30, r16 f55e: e6 58 subi r30, 0x86 ; 134 f560: f3 48 sbci r31, 0x83 ; 131 #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); f562: 34 90 lpm r3, Z 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) { int axis_home_dir = home_dir(axis); f564: 83 2d mov r24, r3 f566: 03 2c mov r0, r3 f568: 00 0c add r0, r0 f56a: 99 0b sbc r25, r25 f56c: 9c 87 std Y+12, r25 ; 0x0c f56e: 8b 87 std Y+11, r24 ; 0x0b feedrate = homing_feedrate[axis]; f570: d8 01 movw r26, r16 f572: aa 0f add r26, r26 f574: bb 1f adc r27, r27 f576: aa 0f add r26, r26 f578: bb 1f adc r27, r27 f57a: ba 83 std Y+2, r27 ; 0x02 f57c: a9 83 std Y+1, r26 ; 0x01 f57e: fd 01 movw r30, r26 f580: e3 53 subi r30, 0x33 ; 51 f582: fd 4f sbci r31, 0xFD ; 253 f584: 80 81 ld r24, Z f586: 91 81 ldd r25, Z+1 ; 0x01 f588: a2 81 ldd r26, Z+2 ; 0x02 f58a: b3 81 ldd r27, Z+3 ; 0x03 f58c: 8b 83 std Y+3, r24 ; 0x03 f58e: 9c 83 std Y+4, r25 ; 0x04 f590: ad 83 std Y+5, r26 ; 0x05 f592: be 83 std Y+6, r27 ; 0x06 f594: 80 93 b8 02 sts 0x02B8, r24 ; 0x8002b8 f598: 90 93 b9 02 sts 0x02B9, r25 ; 0x8002b9 f59c: a0 93 ba 02 sts 0x02BA, r26 ; 0x8002ba f5a0: b0 93 bb 02 sts 0x02BB, r27 ; 0x8002bb float feedrate_mm_s = get_feedrate_mm_s(feedrate); f5a4: bc 01 movw r22, r24 f5a6: cd 01 movw r24, r26 f5a8: 0e 94 df 66 call 0xcdbe ; 0xcdbe f5ac: 6b 01 movw r12, r22 f5ae: 7c 01 movw r14, r24 #ifdef TMC2130 tmc2130_home_enter(X_AXIS_MASK << axis); f5b0: 81 e0 ldi r24, 0x01 ; 1 f5b2: 02 2c mov r0, r2 f5b4: 01 c0 rjmp .+2 ; 0xf5b8 f5b6: 88 0f add r24, r24 f5b8: 0a 94 dec r0 f5ba: ea f7 brpl .-6 ; 0xf5b6 f5bc: 0f 94 ae 25 call 0x24b5c ; 0x24b5c // 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; f5c0: a9 81 ldd r26, Y+1 ; 0x01 f5c2: ba 81 ldd r27, Y+2 ; 0x02 f5c4: af 56 subi r26, 0x6F ; 111 f5c6: b9 4f sbci r27, 0xF9 ; 249 f5c8: b8 87 std Y+8, r27 ; 0x08 f5ca: af 83 std Y+7, r26 ; 0x07 f5cc: fd 01 movw r30, r26 f5ce: 10 82 st Z, r1 f5d0: 11 82 std Z+1, r1 ; 0x01 f5d2: 12 82 std Z+2, r1 ; 0x02 f5d4: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); f5d6: 0f 94 c4 be call 0x37d88 ; 0x37d88 set_destination_to_current(); f5da: 0e 94 52 68 call 0xd0a4 ; 0xd0a4 // destination[axis] = 11.f; destination[axis] = -3.f * axis_home_dir; f5de: 63 2d mov r22, r3 f5e0: 03 2c mov r0, r3 f5e2: 00 0c add r0, r0 f5e4: 77 0b sbc r23, r23 f5e6: 88 0b sbc r24, r24 f5e8: 99 0b sbc r25, r25 f5ea: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> f5ee: 4b 01 movw r8, r22 f5f0: 5c 01 movw r10, r24 f5f2: 49 81 ldd r20, Y+1 ; 0x01 f5f4: 5a 81 ldd r21, Y+2 ; 0x02 f5f6: 4d 58 subi r20, 0x8D ; 141 f5f8: 59 4f sbci r21, 0xF9 ; 249 f5fa: 58 8b std Y+16, r21 ; 0x10 f5fc: 4f 87 std Y+15, r20 ; 0x0f f5fe: 20 e0 ldi r18, 0x00 ; 0 f600: 30 e0 ldi r19, 0x00 ; 0 f602: 40 e4 ldi r20, 0x40 ; 64 f604: 50 ec ldi r21, 0xC0 ; 192 f606: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> f60a: af 85 ldd r26, Y+15 ; 0x0f f60c: b8 89 ldd r27, Y+16 ; 0x10 f60e: 6d 93 st X+, r22 f610: 7d 93 st X+, r23 f612: 8d 93 st X+, r24 f614: 9c 93 st X, r25 f616: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(feedrate_mm_s); f618: c7 01 movw r24, r14 f61a: b6 01 movw r22, r12 f61c: 0f 94 d1 bf call 0x37fa2 ; 0x37fa2 st_synchronize(); f620: 0f 94 a3 42 call 0x28546 ; 0x28546 // Move away from the possible collision with opposite endstop with the collision detection disabled. endstops_hit_on_purpose(); f624: 0f 94 b9 4d call 0x29b72 ; 0x29b72 f628: 10 92 b7 02 sts 0x02B7, r1 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> enable_endstops(false); current_position[axis] = 0; f62c: ef 81 ldd r30, Y+7 ; 0x07 f62e: f8 85 ldd r31, Y+8 ; 0x08 f630: 10 82 st Z, r1 f632: 11 82 std Z+1, r1 ; 0x01 f634: 12 82 std Z+2, r1 ; 0x02 f636: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); f638: 0f 94 c4 be call 0x37d88 ; 0x37d88 destination[axis] = 1. * axis_home_dir; f63c: af 85 ldd r26, Y+15 ; 0x0f f63e: b8 89 ldd r27, Y+16 ; 0x10 f640: 8d 92 st X+, r8 f642: 9d 92 st X+, r9 f644: ad 92 st X+, r10 f646: bc 92 st X, r11 f648: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(feedrate_mm_s); f64a: c7 01 movw r24, r14 f64c: b6 01 movw r22, r12 f64e: 0f 94 d1 bf call 0x37fa2 ; 0x37fa2 st_synchronize(); f652: 0f 94 a3 42 call 0x28546 ; 0x28546 f656: 70 92 b7 02 sts 0x02B7, r7 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> { 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); f65a: e9 81 ldd r30, Y+1 ; 0x01 f65c: fa 81 ldd r31, Y+2 ; 0x02 f65e: e2 59 subi r30, 0x92 ; 146 f660: f3 48 sbci r31, 0x83 ; 131 #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); f662: 45 90 lpm r4, Z+ f664: 55 90 lpm r5, Z+ f666: 65 90 lpm r6, Z+ f668: 74 90 lpm r7, Z 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); f66a: 2d ec ldi r18, 0xCD ; 205 f66c: 3c ec ldi r19, 0xCC ; 204 f66e: 4c e8 ldi r20, 0x8C ; 140 f670: 5f e3 ldi r21, 0x3F ; 63 f672: c5 01 movw r24, r10 f674: b4 01 movw r22, r8 f676: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> f67a: a3 01 movw r20, r6 f67c: 92 01 movw r18, r4 f67e: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> f682: ef 85 ldd r30, Y+15 ; 0x0f f684: f8 89 ldd r31, Y+16 ; 0x10 f686: 60 83 st Z, r22 f688: 71 83 std Z+1, r23 ; 0x01 f68a: 82 83 std Z+2, r24 ; 0x02 f68c: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_destinationXYZE(feedrate_mm_s); f68e: c7 01 movw r24, r14 f690: b6 01 movw r22, r12 f692: 0f 94 d1 bf call 0x37fa2 ; 0x37fa2 st_synchronize(); f696: 0f 94 a3 42 call 0x28546 ; 0x28546 f69a: 71 2c mov r7, r1 f69c: 61 2c mov r6, r1 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(); enable_endstops(false); current_position[axis] = 0; f69e: 4f 80 ldd r4, Y+7 ; 0x07 f6a0: 58 84 ldd r5, Y+8 ; 0x08 plan_buffer_line_destinationXYZE(feedrate_mm_s); st_synchronize(); 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(); f6a2: 0f 94 b9 4d call 0x29b72 ; 0x29b72 f6a6: 10 92 b7 02 sts 0x02B7, r1 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> enable_endstops(false); current_position[axis] = 0; f6aa: d2 01 movw r26, r4 f6ac: 1d 92 st X+, r1 f6ae: 1d 92 st X+, r1 f6b0: 1d 92 st X+, r1 f6b2: 1c 92 st X, r1 f6b4: 13 97 sbiw r26, 0x03 ; 3 plan_set_position_curposXYZE(); f6b6: 0f 94 c4 be call 0x37d88 ; 0x37d88 destination[axis] = -10.f * axis_home_dir; f6ba: 20 e0 ldi r18, 0x00 ; 0 f6bc: 30 e0 ldi r19, 0x00 ; 0 f6be: 40 e2 ldi r20, 0x20 ; 32 f6c0: 51 ec ldi r21, 0xC1 ; 193 f6c2: c5 01 movw r24, r10 f6c4: b4 01 movw r22, r8 f6c6: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> f6ca: ef 85 ldd r30, Y+15 ; 0x0f f6cc: f8 89 ldd r31, Y+16 ; 0x10 f6ce: 60 83 st Z, r22 f6d0: 71 83 std Z+1, r23 ; 0x01 f6d2: 82 83 std Z+2, r24 ; 0x02 f6d4: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_destinationXYZE(feedrate_mm_s); f6d6: c7 01 movw r24, r14 f6d8: b6 01 movw r22, r12 f6da: 0f 94 d1 bf call 0x37fa2 ; 0x37fa2 st_synchronize(); f6de: 0f 94 a3 42 call 0x28546 ; 0x28546 endstops_hit_on_purpose(); f6e2: 0f 94 b9 4d call 0x29b72 ; 0x29b72 f6e6: f1 e0 ldi r31, 0x01 ; 1 f6e8: f0 93 b7 02 sts 0x02B7, r31 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> // Now move left up to the collision, this time with a repeatable velocity. enable_endstops(true); destination[axis] = 11.f * axis_home_dir; f6ec: 20 e0 ldi r18, 0x00 ; 0 f6ee: 30 e0 ldi r19, 0x00 ; 0 f6f0: 40 e3 ldi r20, 0x30 ; 48 f6f2: 51 e4 ldi r21, 0x41 ; 65 f6f4: c5 01 movw r24, r10 f6f6: b4 01 movw r22, r8 f6f8: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> f6fc: af 85 ldd r26, Y+15 ; 0x0f f6fe: b8 89 ldd r27, Y+16 ; 0x10 f700: 6d 93 st X+, r22 f702: 7d 93 st X+, r23 f704: 8d 93 st X+, r24 f706: 9c 93 st X, r25 f708: 13 97 sbiw r26, 0x03 ; 3 #ifdef TMC2130 feedrate = homing_feedrate[axis]; f70a: 8b 81 ldd r24, Y+3 ; 0x03 f70c: 9c 81 ldd r25, Y+4 ; 0x04 f70e: ad 81 ldd r26, Y+5 ; 0x05 f710: be 81 ldd r27, Y+6 ; 0x06 f712: 80 93 b8 02 sts 0x02B8, r24 ; 0x8002b8 f716: 90 93 b9 02 sts 0x02B9, r25 ; 0x8002b9 f71a: a0 93 ba 02 sts 0x02BA, r26 ; 0x8002ba f71e: b0 93 bb 02 sts 0x02BB, r27 ; 0x8002bb #else //TMC2130 feedrate = homing_feedrate[axis] / 2; feedrate_mm_s = get_feedrate_mm_s(feedrate); #endif //TMC2130 plan_buffer_line_destinationXYZE(feedrate_mm_s); f722: c7 01 movw r24, r14 f724: b6 01 movw r22, r12 f726: 0f 94 d1 bf call 0x37fa2 ; 0x37fa2 st_synchronize(); f72a: 0f 94 a3 42 call 0x28546 ; 0x28546 #ifdef TMC2130 uint16_t mscnt = tmc2130_rd_MSCNT(axis); f72e: 82 2d mov r24, r2 f730: 0f 94 4b 24 call 0x24896 ; 0x24896 f734: 9c 01 movw r18, r24 f736: 44 e0 ldi r20, 0x04 ; 4 f738: 36 95 lsr r19 f73a: 27 95 ror r18 f73c: 4a 95 dec r20 f73e: e1 f7 brne .-8 ; 0xf738 if (pstep) pstep[i] = mscnt >> 4; f740: a9 85 ldd r26, Y+9 ; 0x09 f742: ba 85 ldd r27, Y+10 ; 0x0a f744: 10 97 sbiw r26, 0x00 ; 0 f746: 21 f0 breq .+8 ; 0xf750 f748: fd 01 movw r30, r26 f74a: e6 0d add r30, r6 f74c: f7 1d adc r31, r7 f74e: 20 83 st Z, r18 printf_P(PSTR("%3d step=%2d mscnt=%4d\n"), i, mscnt >> 4, mscnt); f750: 9f 93 push r25 f752: 8f 93 push r24 f754: 3f 93 push r19 f756: 2f 93 push r18 f758: 7f 92 push r7 f75a: 6f 92 push r6 f75c: e6 e5 ldi r30, 0x56 ; 86 f75e: fc e7 ldi r31, 0x7C ; 124 f760: ff 93 push r31 f762: ef 93 push r30 f764: 0f 94 99 da call 0x3b532 ; 0x3b532 f768: 4f ef ldi r20, 0xFF ; 255 f76a: 64 1a sub r6, r20 f76c: 74 0a sbc r7, r20 // 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); plan_buffer_line_destinationXYZE(feedrate_mm_s); st_synchronize(); for (uint8_t i = 0; i < cnt; i++) f76e: 0f b6 in r0, 0x3f ; 63 f770: f8 94 cli f772: de bf out 0x3e, r29 ; 62 f774: 0f be out 0x3f, r0 ; 63 f776: cd bf out 0x3d, r28 ; 61 f778: 9e 85 ldd r25, Y+14 ; 0x0e f77a: 69 16 cp r6, r25 f77c: 08 f4 brcc .+2 ; 0xf780 f77e: 91 cf rjmp .-222 ; 0xf6a2 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(); f780: 0f 94 b9 4d call 0x29b72 ; 0x29b72 f784: 10 92 b7 02 sts 0x02B7, r1 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> enable_endstops(false); #ifdef TMC2130 uint8_t orig = tmc2130_home_origin[axis]; uint8_t back = tmc2130_home_bsteps[axis]; if (tmc2130_home_enabled && (orig <= 63)) f788: 80 91 f1 04 lds r24, 0x04F1 ; 0x8004f1 f78c: 88 23 and r24, r24 f78e: 09 f4 brne .+2 ; 0xf792 f790: b2 c0 rjmp .+356 ; 0xf8f6 } endstops_hit_on_purpose(); enable_endstops(false); #ifdef TMC2130 uint8_t orig = tmc2130_home_origin[axis]; f792: f8 01 movw r30, r16 f794: ee 50 subi r30, 0x0E ; 14 f796: fb 4f sbci r31, 0xFB ; 251 f798: 60 81 ld r22, Z uint8_t back = tmc2130_home_bsteps[axis]; if (tmc2130_home_enabled && (orig <= 63)) f79a: 60 34 cpi r22, 0x40 ; 64 f79c: 08 f0 brcs .+2 ; 0xf7a0 f79e: ab c0 rjmp .+342 ; 0xf8f6 endstops_hit_on_purpose(); enable_endstops(false); #ifdef TMC2130 uint8_t orig = tmc2130_home_origin[axis]; uint8_t back = tmc2130_home_bsteps[axis]; f7a0: f8 01 movw r30, r16 f7a2: e6 5a subi r30, 0xA6 ; 166 f7a4: fd 4f sbci r31, 0xFD ; 253 f7a6: a0 81 ld r26, Z f7a8: ab 83 std Y+3, r26 ; 0x03 return stat; } uint16_t tmc2130_get_res(uint8_t axis) { return tmc2130_mres2usteps(tmc2130_mres[axis]); f7aa: f8 01 movw r30, r16 f7ac: ec 50 subi r30, 0x0C ; 12 f7ae: fb 4f sbci r31, 0xFB ; 251 f7b0: 80 81 ld r24, Z f7b2: 40 e0 ldi r20, 0x00 ; 0 f7b4: 51 e0 ldi r21, 0x01 ; 1 f7b6: 02 c0 rjmp .+4 ; 0xf7bc f7b8: 56 95 lsr r21 f7ba: 47 95 ror r20 f7bc: 8a 95 dec r24 f7be: e2 f7 brpl .-8 ; 0xf7b8 if (tmc2130_home_enabled && (orig <= 63)) { tmc2130_goto_step(axis, orig, 2, 1000, tmc2130_get_res(axis)); f7c0: 82 2d mov r24, r2 f7c2: 0f 94 5e 8b call 0x316bc ; 0x316bc if (back > 0) f7c6: bb 81 ldd r27, Y+3 ; 0x03 f7c8: bb 23 and r27, r27 f7ca: 39 f0 breq .+14 ; 0xf7da tmc2130_do_steps(axis, back, -axis_home_dir, 1000); f7cc: 43 2d mov r20, r3 f7ce: 41 95 neg r20 f7d0: 6b 2f mov r22, r27 f7d2: 70 e0 ldi r23, 0x00 ; 0 } else tmc2130_do_steps(axis, 8, -axis_home_dir, 1000); f7d4: 82 2d mov r24, r2 f7d6: 0f 94 2f 8b call 0x3165e ; 0x3165e tmc2130_home_exit(); f7da: 0f 94 7f 25 call 0x24afe ; 0x24afe #endif //TMC2130 axis_is_at_home(axis); f7de: 82 2d mov r24, r2 f7e0: 0e 94 c2 5a call 0xb584 ; 0xb584 axis_known_position[axis] = true; f7e4: f8 01 movw r30, r16 f7e6: e2 57 subi r30, 0x72 ; 114 f7e8: f9 4f sbci r31, 0xF9 ; 249 f7ea: 81 e0 ldi r24, 0x01 ; 1 f7ec: 80 83 st Z, r24 // Move from minimum #ifdef TMC2130 float dist = - axis_home_dir * 0.01f * tmc2130_home_fsteps[axis]; f7ee: 6b 85 ldd r22, Y+11 ; 0x0b f7f0: 7c 85 ldd r23, Y+12 ; 0x0c f7f2: 71 95 neg r23 f7f4: 61 95 neg r22 f7f6: 71 09 sbc r23, r1 f7f8: 07 2e mov r0, r23 f7fa: 00 0c add r0, r0 f7fc: 88 0b sbc r24, r24 f7fe: 99 0b sbc r25, r25 f800: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> f804: 2a e0 ldi r18, 0x0A ; 10 f806: 37 ed ldi r19, 0xD7 ; 215 f808: 43 e2 ldi r20, 0x23 ; 35 f80a: 5c e3 ldi r21, 0x3C ; 60 f80c: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> f810: 4b 01 movw r8, r22 f812: 5c 01 movw r10, r24 f814: f8 01 movw r30, r16 f816: e8 5a subi r30, 0xA8 ; 168 f818: fd 4f sbci r31, 0xFD ; 253 f81a: 60 81 ld r22, Z f81c: 70 e0 ldi r23, 0x00 ; 0 f81e: 90 e0 ldi r25, 0x00 ; 0 f820: 80 e0 ldi r24, 0x00 ; 0 f822: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> f826: 9b 01 movw r18, r22 f828: ac 01 movw r20, r24 f82a: c5 01 movw r24, r10 f82c: b4 01 movw r22, r8 f82e: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> f832: 4b 01 movw r8, r22 f834: 5c 01 movw r10, r24 #else //TMC2130 float dist = - axis_home_dir * 0.01f * 64; #endif //TMC2130 current_position[axis] -= dist; f836: e9 81 ldd r30, Y+1 ; 0x01 f838: fa 81 ldd r31, Y+2 ; 0x02 f83a: ef 56 subi r30, 0x6F ; 111 f83c: f9 4f sbci r31, 0xF9 ; 249 f83e: fc 83 std Y+4, r31 ; 0x04 f840: eb 83 std Y+3, r30 ; 0x03 f842: ac 01 movw r20, r24 f844: 9b 01 movw r18, r22 f846: 60 81 ld r22, Z f848: 71 81 ldd r23, Z+1 ; 0x01 f84a: 82 81 ldd r24, Z+2 ; 0x02 f84c: 93 81 ldd r25, Z+3 ; 0x03 f84e: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> f852: ab 81 ldd r26, Y+3 ; 0x03 f854: bc 81 ldd r27, Y+4 ; 0x04 f856: 6d 93 st X+, r22 f858: 7d 93 st X+, r23 f85a: 8d 93 st X+, r24 f85c: 9c 93 st X, r25 f85e: 13 97 sbiw r26, 0x03 ; 3 plan_set_position_curposXYZE(); f860: 0f 94 c4 be call 0x37d88 ; 0x37d88 current_position[axis] += dist; f864: eb 81 ldd r30, Y+3 ; 0x03 f866: fc 81 ldd r31, Y+4 ; 0x04 f868: 20 81 ld r18, Z f86a: 31 81 ldd r19, Z+1 ; 0x01 f86c: 42 81 ldd r20, Z+2 ; 0x02 f86e: 53 81 ldd r21, Z+3 ; 0x03 f870: c5 01 movw r24, r10 f872: b4 01 movw r22, r8 f874: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> f878: ab 81 ldd r26, Y+3 ; 0x03 f87a: bc 81 ldd r27, Y+4 ; 0x04 f87c: 6d 93 st X+, r22 f87e: 7d 93 st X+, r23 f880: 8d 93 st X+, r24 f882: 9c 93 st X, r25 f884: 13 97 sbiw r26, 0x03 ; 3 destination[axis] = current_position[axis]; f886: e9 81 ldd r30, Y+1 ; 0x01 f888: fa 81 ldd r31, Y+2 ; 0x02 f88a: ed 58 subi r30, 0x8D ; 141 f88c: f9 4f sbci r31, 0xF9 ; 249 f88e: 60 83 st Z, r22 f890: 71 83 std Z+1, r23 ; 0x01 f892: 82 83 std Z+2, r24 ; 0x02 f894: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_destinationXYZE(0.5f*feedrate_mm_s); f896: 20 e0 ldi r18, 0x00 ; 0 f898: 30 e0 ldi r19, 0x00 ; 0 f89a: 40 e0 ldi r20, 0x00 ; 0 f89c: 5f e3 ldi r21, 0x3F ; 63 f89e: c7 01 movw r24, r14 f8a0: b6 01 movw r22, r12 f8a2: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> f8a6: 0f 94 d1 bf call 0x37fa2 ; 0x37fa2 st_synchronize(); f8aa: 0f 94 a3 42 call 0x28546 ; 0x28546 feedrate = 0.0; f8ae: 10 92 b8 02 sts 0x02B8, r1 ; 0x8002b8 f8b2: 10 92 b9 02 sts 0x02B9, r1 ; 0x8002b9 f8b6: 10 92 ba 02 sts 0x02BA, r1 ; 0x8002ba f8ba: 10 92 bb 02 sts 0x02BB, r1 ; 0x8002bb f8be: fd 85 ldd r31, Y+13 ; 0x0d f8c0: f0 93 b7 02 sts 0x02B7, r31 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> #ifdef TMC2130 FORCE_HIGH_POWER_END; #endif } enable_endstops(endstops_enabled); } f8c4: 60 96 adiw r28, 0x10 ; 16 f8c6: 0f b6 in r0, 0x3f ; 63 f8c8: f8 94 cli f8ca: de bf out 0x3e, r29 ; 62 f8cc: 0f be out 0x3f, r0 ; 63 f8ce: cd bf out 0x3d, r28 ; 61 f8d0: df 91 pop r29 f8d2: cf 91 pop r28 f8d4: 1f 91 pop r17 f8d6: 0f 91 pop r16 f8d8: ff 90 pop r15 f8da: ef 90 pop r14 f8dc: df 90 pop r13 f8de: cf 90 pop r12 f8e0: bf 90 pop r11 f8e2: af 90 pop r10 f8e4: 9f 90 pop r9 f8e6: 8f 90 pop r8 f8e8: 7f 90 pop r7 f8ea: 6f 90 pop r6 f8ec: 5f 90 pop r5 f8ee: 4f 90 pop r4 f8f0: 3f 90 pop r3 f8f2: 2f 90 pop r2 f8f4: 08 95 ret tmc2130_goto_step(axis, orig, 2, 1000, tmc2130_get_res(axis)); if (back > 0) tmc2130_do_steps(axis, back, -axis_home_dir, 1000); } else tmc2130_do_steps(axis, 8, -axis_home_dir, 1000); f8f6: 43 2d mov r20, r3 f8f8: 41 95 neg r20 f8fa: 68 e0 ldi r22, 0x08 ; 8 f8fc: 70 e0 ldi r23, 0x00 ; 0 f8fe: 6a cf rjmp .-300 ; 0xf7d4 feedrate = 0.0; } else if ((axis==Z_AXIS)?HOMEAXIS_DO(Z):0) { #ifdef TMC2130 FORCE_HIGH_POWER_START; f900: 81 e0 ldi r24, 0x01 ; 1 f902: 0e 94 c8 66 call 0xcd90 ; 0xcd90 #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); f906: ec e7 ldi r30, 0x7C ; 124 f908: fc e7 ldi r31, 0x7C ; 124 f90a: b4 91 lpm r27, Z f90c: 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; f90e: 10 92 99 06 sts 0x0699, r1 ; 0x800699 f912: 10 92 9a 06 sts 0x069A, r1 ; 0x80069a f916: 10 92 9b 06 sts 0x069B, r1 ; 0x80069b f91a: 10 92 9c 06 sts 0x069C, r1 ; 0x80069c plan_set_position_curposXYZE(); f91e: 0f 94 c4 be call 0x37d88 ; 0x37d88 #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); f922: e6 e7 ldi r30, 0x76 ; 118 f924: fc e7 ldi r31, 0x7C ; 124 f926: 85 90 lpm r8, Z+ f928: 95 90 lpm r9, Z+ f92a: a5 90 lpm r10, Z+ f92c: 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; f92e: e9 81 ldd r30, Y+1 ; 0x01 f930: 6e 2f mov r22, r30 f932: ee 0f add r30, r30 f934: 77 0b sbc r23, r23 f936: 88 0b sbc r24, r24 f938: 99 0b sbc r25, r25 f93a: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> f93e: 6b 01 movw r12, r22 f940: 7c 01 movw r14, r24 f942: 20 e0 ldi r18, 0x00 ; 0 f944: 30 e0 ldi r19, 0x00 ; 0 f946: 40 ec ldi r20, 0xC0 ; 192 f948: 5f e3 ldi r21, 0x3F ; 63 f94a: c5 01 movw r24, r10 f94c: b4 01 movw r22, r8 f94e: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> f952: a7 01 movw r20, r14 f954: 96 01 movw r18, r12 f956: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> f95a: 60 93 7b 06 sts 0x067B, r22 ; 0x80067b f95e: 70 93 7c 06 sts 0x067C, r23 ; 0x80067c f962: 80 93 7d 06 sts 0x067D, r24 ; 0x80067d f966: 90 93 7e 06 sts 0x067E, r25 ; 0x80067e feedrate = homing_feedrate[axis]; f96a: 80 e0 ldi r24, 0x00 ; 0 f96c: 90 e0 ldi r25, 0x00 ; 0 f96e: a8 e4 ldi r26, 0x48 ; 72 f970: b4 e4 ldi r27, 0x44 ; 68 f972: 80 93 b8 02 sts 0x02B8, r24 ; 0x8002b8 f976: 90 93 b9 02 sts 0x02B9, r25 ; 0x8002b9 f97a: a0 93 ba 02 sts 0x02BA, r26 ; 0x8002ba f97e: b0 93 bb 02 sts 0x02BB, r27 ; 0x8002bb float feedrate_mm_s = get_feedrate_mm_s(feedrate); f982: bc 01 movw r22, r24 f984: cd 01 movw r24, r26 f986: 0e 94 df 66 call 0xcdbe ; 0xcdbe f98a: 4b 01 movw r8, r22 f98c: 5c 01 movw r10, r24 plan_buffer_line_destinationXYZE(feedrate_mm_s); f98e: 0f 94 d1 bf call 0x37fa2 ; 0x37fa2 st_synchronize(); f992: 0f 94 a3 42 call 0x28546 ; 0x28546 #ifdef TMC2130 check_Z_crash(); f996: 0e 94 49 7a call 0xf492 ; 0xf492 #endif //TMC2130 current_position[axis] = 0; f99a: 10 92 99 06 sts 0x0699, r1 ; 0x800699 f99e: 10 92 9a 06 sts 0x069A, r1 ; 0x80069a f9a2: 10 92 9b 06 sts 0x069B, r1 ; 0x80069b f9a6: 10 92 9c 06 sts 0x069C, r1 ; 0x80069c plan_set_position_curposXYZE(); f9aa: 0f 94 c4 be call 0x37d88 ; 0x37d88 #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); f9ae: e2 e5 ldi r30, 0x52 ; 82 f9b0: fc e7 ldi r31, 0x7C ; 124 f9b2: 65 91 lpm r22, Z+ f9b4: 75 91 lpm r23, Z+ f9b6: 85 91 lpm r24, Z+ f9b8: 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; f9ba: 90 58 subi r25, 0x80 ; 128 f9bc: a7 01 movw r20, r14 f9be: 96 01 movw r18, r12 f9c0: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> f9c4: 60 93 7b 06 sts 0x067B, r22 ; 0x80067b f9c8: 70 93 7c 06 sts 0x067C, r23 ; 0x80067c f9cc: 80 93 7d 06 sts 0x067D, r24 ; 0x80067d f9d0: 90 93 7e 06 sts 0x067E, r25 ; 0x80067e plan_buffer_line_destinationXYZE(feedrate_mm_s); f9d4: c5 01 movw r24, r10 f9d6: b4 01 movw r22, r8 f9d8: 0f 94 d1 bf call 0x37fa2 ; 0x37fa2 st_synchronize(); f9dc: 0f 94 a3 42 call 0x28546 ; 0x28546 #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); f9e0: e2 e5 ldi r30, 0x52 ; 82 f9e2: fc e7 ldi r31, 0x7C ; 124 f9e4: 65 91 lpm r22, Z+ f9e6: 75 91 lpm r23, Z+ f9e8: 85 91 lpm r24, Z+ f9ea: 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; f9ec: 9b 01 movw r18, r22 f9ee: ac 01 movw r20, r24 f9f0: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> f9f4: a7 01 movw r20, r14 f9f6: 96 01 movw r18, r12 f9f8: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> f9fc: 60 93 7b 06 sts 0x067B, r22 ; 0x80067b fa00: 70 93 7c 06 sts 0x067C, r23 ; 0x80067c fa04: 80 93 7d 06 sts 0x067D, r24 ; 0x80067d fa08: 90 93 7e 06 sts 0x067E, r25 ; 0x80067e feedrate = homing_feedrate[axis] / 2; fa0c: 80 e0 ldi r24, 0x00 ; 0 fa0e: 90 e0 ldi r25, 0x00 ; 0 fa10: a8 ec ldi r26, 0xC8 ; 200 fa12: b3 e4 ldi r27, 0x43 ; 67 fa14: 80 93 b8 02 sts 0x02B8, r24 ; 0x8002b8 fa18: 90 93 b9 02 sts 0x02B9, r25 ; 0x8002b9 fa1c: a0 93 ba 02 sts 0x02BA, r26 ; 0x8002ba fa20: b0 93 bb 02 sts 0x02BB, r27 ; 0x8002bb feedrate_mm_s = get_feedrate_mm_s(feedrate); fa24: bc 01 movw r22, r24 fa26: cd 01 movw r24, r26 fa28: 0e 94 df 66 call 0xcdbe ; 0xcdbe plan_buffer_line_destinationXYZE(feedrate_mm_s); fa2c: 0f 94 d1 bf call 0x37fa2 ; 0x37fa2 st_synchronize(); fa30: 0f 94 a3 42 call 0x28546 ; 0x28546 #ifdef TMC2130 check_Z_crash(); fa34: 0e 94 49 7a call 0xf492 ; 0xf492 #endif //TMC2130 axis_is_at_home(axis); fa38: 82 e0 ldi r24, 0x02 ; 2 fa3a: 0e 94 c2 5a call 0xb584 ; 0xb584 destination[axis] = current_position[axis]; fa3e: 80 91 99 06 lds r24, 0x0699 ; 0x800699 fa42: 90 91 9a 06 lds r25, 0x069A ; 0x80069a fa46: a0 91 9b 06 lds r26, 0x069B ; 0x80069b fa4a: b0 91 9c 06 lds r27, 0x069C ; 0x80069c fa4e: 80 93 7b 06 sts 0x067B, r24 ; 0x80067b fa52: 90 93 7c 06 sts 0x067C, r25 ; 0x80067c fa56: a0 93 7d 06 sts 0x067D, r26 ; 0x80067d fa5a: b0 93 7e 06 sts 0x067E, r27 ; 0x80067e feedrate = 0.0; fa5e: 10 92 b8 02 sts 0x02B8, r1 ; 0x8002b8 fa62: 10 92 b9 02 sts 0x02B9, r1 ; 0x8002b9 fa66: 10 92 ba 02 sts 0x02BA, r1 ; 0x8002ba fa6a: 10 92 bb 02 sts 0x02BB, r1 ; 0x8002bb endstops_hit_on_purpose(); fa6e: 0f 94 b9 4d call 0x29b72 ; 0x29b72 axis_known_position[axis] = true; fa72: 70 92 90 06 sts 0x0690, r7 ; 0x800690 #ifdef TMC2130 FORCE_HIGH_POWER_END; fa76: 80 e0 ldi r24, 0x00 ; 0 fa78: 0e 94 c8 66 call 0xcd90 ; 0xcd90 fa7c: 20 cf rjmp .-448 ; 0xf8be 0000fa7e : #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 { fa7e: 2f 92 push r2 fa80: 3f 92 push r3 fa82: 4f 92 push r4 fa84: 5f 92 push r5 fa86: 6f 92 push r6 fa88: 7f 92 push r7 fa8a: 8f 92 push r8 fa8c: 9f 92 push r9 fa8e: af 92 push r10 fa90: bf 92 push r11 fa92: cf 92 push r12 fa94: df 92 push r13 fa96: ef 92 push r14 fa98: ff 92 push r15 fa9a: 0f 93 push r16 fa9c: 1f 93 push r17 fa9e: cf 93 push r28 faa0: df 93 push r29 faa2: 00 d0 rcall .+0 ; 0xfaa4 faa4: 1f 92 push r1 faa6: 1f 92 push r1 faa8: cd b7 in r28, 0x3d ; 61 faaa: de b7 in r29, 0x3e ; 62 faac: d8 2e mov r13, r24 faae: 2a 01 movw r4, r20 fab0: 3b 01 movw r6, r22 fab2: 32 2e mov r3, r18 fab4: e9 82 std Y+1, r14 ; 0x01 fab6: fa 82 std Y+2, r15 ; 0x02 fab8: 0b 83 std Y+3, r16 ; 0x03 faba: 1c 83 std Y+4, r17 ; 0x04 // Flag for the display update routine and to disable the print cancelation during homing. st_synchronize(); fabc: 0f 94 a3 42 call 0x28546 ; 0x28546 homing_flag = true; fac0: 81 e0 ldi r24, 0x01 ; 1 fac2: 80 93 a6 0d sts 0x0DA6, r24 ; 0x800da6 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; fac6: fc 2c mov r15, r12 fac8: e3 2c mov r14, r3 faca: d3 10 cpse r13, r3 facc: 10 c0 rjmp .+32 ; 0xfaee face: ed 2c mov r14, r13 fad0: dc 10 cpse r13, r12 fad2: 0d c0 rjmp .+26 ; 0xfaee // 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); fad4: 60 e0 ldi r22, 0x00 ; 0 fad6: 70 e0 ldi r23, 0x00 ; 0 fad8: 80 ea ldi r24, 0xA0 ; 160 fada: 90 e4 ldi r25, 0x40 ; 64 fadc: 0e 94 78 6e call 0xdcf0 ; 0xdcf0 // 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; fae0: ff 24 eor r15, r15 fae2: f3 94 inc r15 fae4: ee 24 eor r14, r14 fae6: e3 94 inc r14 fae8: 22 24 eor r2, r2 faea: 23 94 inc r2 faec: 01 c0 rjmp .+2 ; 0xfaf0 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; faee: 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(); faf0: 0f 94 f1 cd call 0x39be2 ; 0x39be2 // 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; faf4: 80 91 c1 13 lds r24, 0x13C1 ; 0x8013c1 faf8: 8d 83 std Y+5, r24 ; 0x05 mbl.active = 0; fafa: 10 92 c1 13 sts 0x13C1, r1 ; 0x8013c1 current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); fafe: 82 e0 ldi r24, 0x02 ; 2 fb00: 0f 94 8f 42 call 0x2851e ; 0x2851e fb04: 60 93 99 06 sts 0x0699, r22 ; 0x800699 fb08: 70 93 9a 06 sts 0x069A, r23 ; 0x80069a fb0c: 80 93 9b 06 sts 0x069B, r24 ; 0x80069b fb10: 90 93 9c 06 sts 0x069C, r25 ; 0x80069c #endif // Reset baby stepping to zero, if the babystepping has already been loaded before. if (home_z) fb14: f1 10 cpse r15, r1 babystep_undo(); fb16: 0f 94 96 c9 call 0x3932c ; 0x3932c int l_feedmultiply = setup_for_endstop_move(); fb1a: 81 e0 ldi r24, 0x01 ; 1 fb1c: 0e 94 00 67 call 0xce00 ; 0xce00 fb20: 8c 01 movw r16, r24 set_destination_to_current(); fb22: 0e 94 52 68 call 0xd0a4 ; 0xd0a4 feedrate = 0.0; fb26: 10 92 b8 02 sts 0x02B8, r1 ; 0x8002b8 fb2a: 10 92 b9 02 sts 0x02B9, r1 ; 0x8002b9 fb2e: 10 92 ba 02 sts 0x02BA, r1 ; 0x8002ba fb32: 10 92 bb 02 sts 0x02BB, r1 ; 0x8002bb current_position[Z_AXIS] = destination[Z_AXIS]; } #endif /* QUICK_HOME */ #ifdef TMC2130 if(home_x) fb36: 22 20 and r2, r2 fb38: 09 f4 brne .+2 ; 0xfb3c fb3a: 77 c1 rjmp .+750 ; 0xfe2a { if (!calib) fb3c: 9b 8d ldd r25, Y+27 ; 0x1b fb3e: 91 11 cpse r25, r1 fb40: 6a c1 rjmp .+724 ; 0xfe16 homeaxis(X_AXIS); fb42: 50 e0 ldi r21, 0x00 ; 0 fb44: 40 e0 ldi r20, 0x00 ; 0 fb46: 61 e0 ldi r22, 0x01 ; 1 fb48: 80 e0 ldi r24, 0x00 ; 0 fb4a: 0e 94 83 7a call 0xf506 ; 0xf506 else tmc2130_home_calibrate(X_AXIS); } if(home_y) fb4e: ee 20 and r14, r14 fb50: 31 f0 breq .+12 ; 0xfb5e { if (!calib) homeaxis(Y_AXIS); fb52: 50 e0 ldi r21, 0x00 ; 0 fb54: 40 e0 ldi r20, 0x00 ; 0 fb56: 61 e0 ldi r22, 0x01 ; 1 fb58: 81 e0 ldi r24, 0x01 ; 1 fb5a: 0e 94 83 7a call 0xf506 ; 0xf506 if(home_x) homeaxis(X_AXIS); if(home_y) homeaxis(Y_AXIS); #endif //TMC2130 if(home_x_axis && home_x_value != 0) fb5e: dd 20 and r13, r13 fb60: e9 f0 breq .+58 ; 0xfb9c fb62: 41 14 cp r4, r1 fb64: 51 04 cpc r5, r1 fb66: 61 04 cpc r6, r1 fb68: 71 04 cpc r7, r1 fb6a: c1 f0 breq .+48 ; 0xfb9c current_position[X_AXIS]=home_x_value+cs.add_homing[X_AXIS]; fb6c: c3 01 movw r24, r6 fb6e: b2 01 movw r22, r4 fb70: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> fb74: 9b 01 movw r18, r22 fb76: ac 01 movw r20, r24 fb78: 60 91 15 0e lds r22, 0x0E15 ; 0x800e15 fb7c: 70 91 16 0e lds r23, 0x0E16 ; 0x800e16 fb80: 80 91 17 0e lds r24, 0x0E17 ; 0x800e17 fb84: 90 91 18 0e lds r25, 0x0E18 ; 0x800e18 fb88: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> fb8c: 60 93 91 06 sts 0x0691, r22 ; 0x800691 fb90: 70 93 92 06 sts 0x0692, r23 ; 0x800692 fb94: 80 93 93 06 sts 0x0693, r24 ; 0x800693 fb98: 90 93 94 06 sts 0x0694, r25 ; 0x800694 if(home_y_axis && home_y_value != 0) fb9c: 33 20 and r3, r3 fb9e: 01 f1 breq .+64 ; 0xfbe0 fba0: 89 81 ldd r24, Y+1 ; 0x01 fba2: 9a 81 ldd r25, Y+2 ; 0x02 fba4: ab 81 ldd r26, Y+3 ; 0x03 fba6: bc 81 ldd r27, Y+4 ; 0x04 fba8: 00 97 sbiw r24, 0x00 ; 0 fbaa: a1 05 cpc r26, r1 fbac: b1 05 cpc r27, r1 fbae: c1 f0 breq .+48 ; 0xfbe0 current_position[Y_AXIS]=home_y_value+cs.add_homing[Y_AXIS]; fbb0: bc 01 movw r22, r24 fbb2: cd 01 movw r24, r26 fbb4: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> fbb8: 9b 01 movw r18, r22 fbba: ac 01 movw r20, r24 fbbc: 60 91 19 0e lds r22, 0x0E19 ; 0x800e19 fbc0: 70 91 1a 0e lds r23, 0x0E1A ; 0x800e1a fbc4: 80 91 1b 0e lds r24, 0x0E1B ; 0x800e1b fbc8: 90 91 1c 0e lds r25, 0x0E1C ; 0x800e1c fbcc: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> fbd0: 60 93 95 06 sts 0x0695, r22 ; 0x800695 fbd4: 70 93 96 06 sts 0x0696, r23 ; 0x800696 fbd8: 80 93 97 06 sts 0x0697, r24 ; 0x800697 fbdc: 90 93 98 06 sts 0x0698, r25 ; 0x800698 #if Z_HOME_DIR < 0 // If homing towards BED do Z last if(home_z) { fbe0: ff 20 and r15, r15 fbe2: 09 f4 brne .+2 ; 0xfbe6 fbe4: a2 c0 rjmp .+324 ; 0xfd2a #ifdef MESH_BED_LEVELING // If Mesh bed leveling, move X&Y to safe position for home raise_z_above(MESH_HOME_Z_SEARCH); fbe6: 60 e0 ldi r22, 0x00 ; 0 fbe8: 70 e0 ldi r23, 0x00 ; 0 fbea: 80 ea ldi r24, 0xA0 ; 160 fbec: 90 e4 ldi r25, 0x40 ; 64 fbee: 0e 94 78 6e call 0xdcf0 ; 0xdcf0 if (!axis_known_position[X_AXIS]) homeaxis(X_AXIS); fbf2: 80 91 8e 06 lds r24, 0x068E ; 0x80068e fbf6: 81 11 cpse r24, r1 fbf8: 05 c0 rjmp .+10 ; 0xfc04 fbfa: 50 e0 ldi r21, 0x00 ; 0 fbfc: 40 e0 ldi r20, 0x00 ; 0 fbfe: 61 e0 ldi r22, 0x01 ; 1 fc00: 0e 94 83 7a call 0xf506 ; 0xf506 if (!axis_known_position[Y_AXIS]) homeaxis(Y_AXIS); fc04: 80 91 8f 06 lds r24, 0x068F ; 0x80068f fc08: 81 11 cpse r24, r1 fc0a: 06 c0 rjmp .+12 ; 0xfc18 fc0c: 50 e0 ldi r21, 0x00 ; 0 fc0e: 40 e0 ldi r20, 0x00 ; 0 fc10: 61 e0 ldi r22, 0x01 ; 1 fc12: 81 e0 ldi r24, 0x01 ; 1 fc14: 0e 94 83 7a call 0xf506 ; 0xf506 // 1st mesh bed leveling measurement point, corrected. world2machine_initialize(); fc18: 0f 94 56 ce call 0x39cac ; 0x39cac world2machine(pgm_read_float(bed_ref_points_4), pgm_read_float(bed_ref_points_4+1), destination[X_AXIS], destination[Y_AXIS]); fc1c: ee e0 ldi r30, 0x0E ; 14 fc1e: f6 ea ldi r31, 0xA6 ; 166 fc20: 85 91 lpm r24, Z+ fc22: 95 91 lpm r25, Z+ fc24: a5 91 lpm r26, Z+ fc26: b4 91 lpm r27, Z fc28: ea e0 ldi r30, 0x0A ; 10 fc2a: f6 ea ldi r31, 0xA6 ; 166 fc2c: 45 91 lpm r20, Z+ fc2e: 55 91 lpm r21, Z+ fc30: 65 91 lpm r22, Z+ fc32: 74 91 lpm r23, Z } } inline void world2machine(const float &x, const float &y, float &out_x, float &out_y) { out_x = x; fc34: 40 93 73 06 sts 0x0673, r20 ; 0x800673 fc38: 50 93 74 06 sts 0x0674, r21 ; 0x800674 fc3c: 60 93 75 06 sts 0x0675, r22 ; 0x800675 fc40: 70 93 76 06 sts 0x0676, r23 ; 0x800676 out_y = y; fc44: 80 93 77 06 sts 0x0677, r24 ; 0x800677 fc48: 90 93 78 06 sts 0x0678, r25 ; 0x800678 fc4c: a0 93 79 06 sts 0x0679, r26 ; 0x800679 fc50: b0 93 7a 06 sts 0x067A, r27 ; 0x80067a world2machine(out_x, out_y); fc54: 67 e7 ldi r22, 0x77 ; 119 fc56: 76 e0 ldi r23, 0x06 ; 6 fc58: 83 e7 ldi r24, 0x73 ; 115 fc5a: 96 e0 ldi r25, 0x06 ; 6 fc5c: 0e 94 1a 6a call 0xd434 ; 0xd434 world2machine_reset(); fc60: 0f 94 b8 cd call 0x39b70 ; 0x39b70 if (destination[Y_AXIS] < Y_MIN_POS) fc64: 20 e0 ldi r18, 0x00 ; 0 fc66: 30 e0 ldi r19, 0x00 ; 0 fc68: 40 e8 ldi r20, 0x80 ; 128 fc6a: 50 ec ldi r21, 0xC0 ; 192 fc6c: 60 91 77 06 lds r22, 0x0677 ; 0x800677 fc70: 70 91 78 06 lds r23, 0x0678 ; 0x800678 fc74: 80 91 79 06 lds r24, 0x0679 ; 0x800679 fc78: 90 91 7a 06 lds r25, 0x067A ; 0x80067a fc7c: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> fc80: 87 ff sbrs r24, 7 fc82: 0c c0 rjmp .+24 ; 0xfc9c destination[Y_AXIS] = Y_MIN_POS; fc84: 80 e0 ldi r24, 0x00 ; 0 fc86: 90 e0 ldi r25, 0x00 ; 0 fc88: a0 e8 ldi r26, 0x80 ; 128 fc8a: b0 ec ldi r27, 0xC0 ; 192 fc8c: 80 93 77 06 sts 0x0677, r24 ; 0x800677 fc90: 90 93 78 06 sts 0x0678, r25 ; 0x800678 fc94: a0 93 79 06 sts 0x0679, r26 ; 0x800679 fc98: b0 93 7a 06 sts 0x067A, r27 ; 0x80067a feedrate = homing_feedrate[X_AXIS] / 20; fc9c: 80 e0 ldi r24, 0x00 ; 0 fc9e: 90 e0 ldi r25, 0x00 ; 0 fca0: a6 e1 ldi r26, 0x16 ; 22 fca2: b3 e4 ldi r27, 0x43 ; 67 fca4: 80 93 b8 02 sts 0x02B8, r24 ; 0x8002b8 fca8: 90 93 b9 02 sts 0x02B9, r25 ; 0x8002b9 fcac: a0 93 ba 02 sts 0x02BA, r26 ; 0x8002ba fcb0: b0 93 bb 02 sts 0x02BB, r27 ; 0x8002bb fcb4: 10 92 b7 02 sts 0x02B7, r1 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> #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(); fcb8: 0f 94 c4 be call 0x37d88 ; 0x37d88 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); fcbc: 60 91 b8 02 lds r22, 0x02B8 ; 0x8002b8 fcc0: 70 91 b9 02 lds r23, 0x02B9 ; 0x8002b9 fcc4: 80 91 ba 02 lds r24, 0x02BA ; 0x8002ba fcc8: 90 91 bb 02 lds r25, 0x02BB ; 0x8002bb fccc: 0f 94 d1 bf call 0x37fa2 ; 0x37fa2 st_synchronize(); fcd0: 0f 94 a3 42 call 0x28546 ; 0x28546 current_position[X_AXIS] = destination[X_AXIS]; fcd4: 80 91 73 06 lds r24, 0x0673 ; 0x800673 fcd8: 90 91 74 06 lds r25, 0x0674 ; 0x800674 fcdc: a0 91 75 06 lds r26, 0x0675 ; 0x800675 fce0: b0 91 76 06 lds r27, 0x0676 ; 0x800676 fce4: 80 93 91 06 sts 0x0691, r24 ; 0x800691 fce8: 90 93 92 06 sts 0x0692, r25 ; 0x800692 fcec: a0 93 93 06 sts 0x0693, r26 ; 0x800693 fcf0: b0 93 94 06 sts 0x0694, r27 ; 0x800694 current_position[Y_AXIS] = destination[Y_AXIS]; fcf4: 80 91 77 06 lds r24, 0x0677 ; 0x800677 fcf8: 90 91 78 06 lds r25, 0x0678 ; 0x800678 fcfc: a0 91 79 06 lds r26, 0x0679 ; 0x800679 fd00: b0 91 7a 06 lds r27, 0x067A ; 0x80067a fd04: 80 93 95 06 sts 0x0695, r24 ; 0x800695 fd08: 90 93 96 06 sts 0x0696, r25 ; 0x800696 fd0c: a0 93 97 06 sts 0x0697, r26 ; 0x800697 fd10: b0 93 98 06 sts 0x0698, r27 ; 0x800698 fd14: 81 e0 ldi r24, 0x01 ; 1 fd16: 80 93 b7 02 sts 0x02B7, r24 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> enable_endstops(true); endstops_hit_on_purpose(); fd1a: 0f 94 b9 4d call 0x29b72 ; 0x29b72 homeaxis(Z_AXIS); fd1e: 50 e0 ldi r21, 0x00 ; 0 fd20: 40 e0 ldi r20, 0x00 ; 0 fd22: 61 e0 ldi r22, 0x01 ; 1 fd24: 82 e0 ldi r24, 0x02 ; 2 fd26: 0e 94 83 7a call 0xf506 ; 0xf506 homeaxis(Z_AXIS); #endif // MESH_BED_LEVELING } #endif // Z_HOME_DIR < 0 if(home_z_axis && home_z_value != 0) fd2a: cc 20 and r12, r12 fd2c: e9 f0 breq .+58 ; 0xfd68 fd2e: 81 14 cp r8, r1 fd30: 91 04 cpc r9, r1 fd32: a1 04 cpc r10, r1 fd34: b1 04 cpc r11, r1 fd36: c1 f0 breq .+48 ; 0xfd68 current_position[Z_AXIS]=home_z_value+cs.add_homing[Z_AXIS]; fd38: c5 01 movw r24, r10 fd3a: b4 01 movw r22, r8 fd3c: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> fd40: 9b 01 movw r18, r22 fd42: ac 01 movw r20, r24 fd44: 60 91 1d 0e lds r22, 0x0E1D ; 0x800e1d fd48: 70 91 1e 0e lds r23, 0x0E1E ; 0x800e1e fd4c: 80 91 1f 0e lds r24, 0x0E1F ; 0x800e1f fd50: 90 91 20 0e lds r25, 0x0E20 ; 0x800e20 fd54: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> fd58: 60 93 99 06 sts 0x0699, r22 ; 0x800699 fd5c: 70 93 9a 06 sts 0x069A, r23 ; 0x80069a fd60: 80 93 9b 06 sts 0x069B, r24 ; 0x80069b fd64: 90 93 9c 06 sts 0x069C, r25 ; 0x80069c // 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(); fd68: 0f 94 c4 be call 0x37d88 ; 0x37d88 clean_up_after_endstop_move(l_feedmultiply); fd6c: c8 01 movw r24, r16 fd6e: 0e 94 e6 66 call 0xcdcc ; 0xcdcc endstops_hit_on_purpose(); fd72: 0f 94 b9 4d call 0x29b72 ; 0x29b72 // Load the machine correction matrix world2machine_initialize(); fd76: 0f 94 56 ce call 0x39cac ; 0x39cac // and correct the current_position XY axes to match the transformed coordinate system. world2machine_update_current(); fd7a: 0f 94 f4 cb call 0x397e8 ; 0x397e8 #ifdef MESH_BED_LEVELING if (home_x_axis || home_y_axis || without_mbl || home_z_axis) fd7e: d1 10 cpse r13, r1 fd80: 07 c0 rjmp .+14 ; 0xfd90 fd82: 31 10 cpse r3, r1 fd84: 05 c0 rjmp .+10 ; 0xfd90 fd86: 8c 8d ldd r24, Y+28 ; 0x1c fd88: 81 11 cpse r24, r1 fd8a: 02 c0 rjmp .+4 ; 0xfd90 fd8c: cc 20 and r12, r12 fd8e: 39 f1 breq .+78 ; 0xfdde { if (! home_z && mbl_was_active) { fd90: f1 10 cpse r15, r1 fd92: 25 c0 rjmp .+74 ; 0xfdde fd94: 9d 81 ldd r25, Y+5 ; 0x05 fd96: 99 23 and r25, r25 fd98: 11 f1 breq .+68 ; 0xfdde // Re-enable the mesh bed leveling if only the X and Y axes were re-homed. mbl.active = true; fd9a: 81 e0 ldi r24, 0x01 ; 1 fd9c: 80 93 c1 13 sts 0x13C1, r24 ; 0x8013c1 // 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)); fda0: 0f 94 8f 42 call 0x2851e ; 0x2851e fda4: 6b 01 movw r12, r22 fda6: 7c 01 movw r14, r24 fda8: 80 e0 ldi r24, 0x00 ; 0 fdaa: 0f 94 8f 42 call 0x2851e ; 0x2851e fdae: a7 01 movw r20, r14 fdb0: 96 01 movw r18, r12 fdb2: 0f 94 6c a1 call 0x342d8 ; 0x342d8 fdb6: 9b 01 movw r18, r22 fdb8: ac 01 movw r20, r24 fdba: 60 91 99 06 lds r22, 0x0699 ; 0x800699 fdbe: 70 91 9a 06 lds r23, 0x069A ; 0x80069a fdc2: 80 91 9b 06 lds r24, 0x069B ; 0x80069b fdc6: 90 91 9c 06 lds r25, 0x069C ; 0x80069c fdca: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> fdce: 60 93 99 06 sts 0x0699, r22 ; 0x800699 fdd2: 70 93 9a 06 sts 0x069A, r23 ; 0x80069a fdd6: 80 93 9b 06 sts 0x069B, r24 ; 0x80069b fdda: 90 93 9c 06 sts 0x069C, r25 ; 0x80069c } #endif prusa_statistics(20); st_synchronize(); fdde: 0f 94 a3 42 call 0x28546 ; 0x28546 homing_flag = false; fde2: 10 92 a6 0d sts 0x0DA6, r1 ; 0x800da6 #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 } fde6: 0f 90 pop r0 fde8: 0f 90 pop r0 fdea: 0f 90 pop r0 fdec: 0f 90 pop r0 fdee: 0f 90 pop r0 fdf0: df 91 pop r29 fdf2: cf 91 pop r28 fdf4: 1f 91 pop r17 fdf6: 0f 91 pop r16 fdf8: ff 90 pop r15 fdfa: ef 90 pop r14 fdfc: df 90 pop r13 fdfe: cf 90 pop r12 fe00: bf 90 pop r11 fe02: af 90 pop r10 fe04: 9f 90 pop r9 fe06: 8f 90 pop r8 fe08: 7f 90 pop r7 fe0a: 6f 90 pop r6 fe0c: 5f 90 pop r5 fe0e: 4f 90 pop r4 fe10: 3f 90 pop r3 fe12: 2f 90 pop r2 fe14: 08 95 ret if(home_x) { if (!calib) homeaxis(X_AXIS); else tmc2130_home_calibrate(X_AXIS); fe16: 80 e0 ldi r24, 0x00 ; 0 fe18: 0f 94 71 22 call 0x244e2 ; 0x244e2 } if(home_y) fe1c: ee 20 and r14, r14 fe1e: 09 f4 brne .+2 ; 0xfe22 fe20: 9e ce rjmp .-708 ; 0xfb5e { if (!calib) homeaxis(Y_AXIS); else tmc2130_home_calibrate(Y_AXIS); fe22: 81 e0 ldi r24, 0x01 ; 1 fe24: 0f 94 71 22 call 0x244e2 ; 0x244e2 fe28: 9a ce rjmp .-716 ; 0xfb5e homeaxis(X_AXIS); else tmc2130_home_calibrate(X_AXIS); } if(home_y) fe2a: ee 20 and r14, r14 fe2c: 09 f4 brne .+2 ; 0xfe30 fe2e: 97 ce rjmp .-722 ; 0xfb5e { if (!calib) fe30: ab 8d ldd r26, Y+27 ; 0x1b fe32: aa 23 and r26, r26 fe34: 09 f4 brne .+2 ; 0xfe38 fe36: 8d ce rjmp .-742 ; 0xfb52 fe38: f4 cf rjmp .-24 ; 0xfe22 0000fe3a : SERIAL_ECHOPGM("G28, final "); print_mesh_bed_leveling_table(); #endif } static void gcode_G28(bool home_x_axis, bool home_y_axis, bool home_z_axis) { fe3a: 8f 92 push r8 fe3c: 9f 92 push r9 fe3e: af 92 push r10 fe40: bf 92 push r11 fe42: cf 92 push r12 fe44: ef 92 push r14 fe46: ff 92 push r15 fe48: 0f 93 push r16 fe4a: 1f 93 push r17 fe4c: 26 2f mov r18, r22 #ifdef TMC2130 gcode_G28(home_x_axis, 0, home_y_axis, 0, home_z_axis, 0, false, true); fe4e: 91 e0 ldi r25, 0x01 ; 1 fe50: 9f 93 push r25 fe52: 1f 92 push r1 fe54: 81 2c mov r8, r1 fe56: 91 2c mov r9, r1 fe58: 54 01 movw r10, r8 fe5a: c4 2e mov r12, r20 fe5c: e1 2c mov r14, r1 fe5e: f1 2c mov r15, r1 fe60: 87 01 movw r16, r14 fe62: 40 e0 ldi r20, 0x00 ; 0 fe64: 50 e0 ldi r21, 0x00 ; 0 fe66: ba 01 movw r22, r20 fe68: 0e 94 3f 7d call 0xfa7e ; 0xfa7e fe6c: 0f 90 pop r0 fe6e: 0f 90 pop r0 #else gcode_G28(home_x_axis, 0, home_y_axis, 0, home_z_axis, 0, true); #endif //TMC2130 } fe70: 1f 91 pop r17 fe72: 0f 91 pop r16 fe74: ff 90 pop r15 fe76: ef 90 pop r14 fe78: cf 90 pop r12 fe7a: bf 90 pop r11 fe7c: af 90 pop r10 fe7e: 9f 90 pop r9 fe80: 8f 90 pop r8 fe82: 08 95 ret 0000fe84 : // 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(); fe84: 84 e8 ldi r24, 0x84 ; 132 fe86: 93 e0 ldi r25, 0x03 ; 3 fe88: 0f 94 c5 2b call 0x2578a ; 0x2578a ::start()> if (buflen && ((CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_USB) || (CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_USB_WITH_LINENR))) fe8c: 80 91 a2 10 lds r24, 0x10A2 ; 0x8010a2 fe90: 90 91 a3 10 lds r25, 0x10A3 ; 0x8010a3 fe94: 89 2b or r24, r25 fe96: 79 f0 breq .+30 ; 0xfeb6 fe98: e0 91 91 12 lds r30, 0x1291 ; 0x801291 fe9c: f0 91 92 12 lds r31, 0x1292 ; 0x801292 fea0: ec 55 subi r30, 0x5C ; 92 fea2: ff 4e sbci r31, 0xEF ; 239 fea4: 80 81 ld r24, Z fea6: 81 30 cpi r24, 0x01 ; 1 fea8: 11 f0 breq .+4 ; 0xfeae feaa: 86 30 cpi r24, 0x06 ; 6 feac: 21 f4 brne .+8 ; 0xfeb6 SERIAL_PROTOCOLLNRPGM(MSG_OK); feae: 85 ef ldi r24, 0xF5 ; 245 feb0: 9d e6 ldi r25, 0x6D ; 109 feb2: 0c 94 93 79 jmp 0xf326 ; 0xf326 } feb6: 08 95 ret 0000feb8 : void cmdqueue_reset() { while (buflen) feb8: 80 91 a2 10 lds r24, 0x10A2 ; 0x8010a2 febc: 90 91 a3 10 lds r25, 0x10A3 ; 0x8010a3 fec0: 89 2b or r24, r25 fec2: 29 f0 breq .+10 ; 0xfece { // printf_P(PSTR("dumping: \"%s\" of type %u\n"), cmdbuffer+bufindr+CMDHDRSIZE, CMDBUFFER_CURRENT_TYPE); ClearToSend(); fec4: 0e 94 42 7f call 0xfe84 ; 0xfe84 cmdqueue_pop_front(); fec8: 0e 94 d4 76 call 0xeda8 ; 0xeda8 fecc: f5 cf rjmp .-22 ; 0xfeb8 } bufindr = 0; fece: 10 92 92 12 sts 0x1292, r1 ; 0x801292 fed2: 10 92 91 12 sts 0x1291, r1 ; 0x801291 bufindw = 0; fed6: 10 92 a0 10 sts 0x10A0, r1 ; 0x8010a0 <_ZL7bufindw.lto_priv.550+0x1> feda: 10 92 9f 10 sts 0x109F, r1 ; 0x80109f <_ZL7bufindw.lto_priv.550> //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; fede: 81 e0 ldi r24, 0x01 ; 1 fee0: 80 93 a1 10 sts 0x10A1, r24 ; 0x8010a1 } fee4: 08 95 ret 0000fee6 : } // G81_M420 Mesh bed leveling status static void gcode_G81_M420() { fee6: ef 92 push r14 fee8: ff 92 push r15 feea: 0f 93 push r16 feec: 1f 93 push r17 feee: cf 93 push r28 fef0: df 93 push r29 if (mbl.active) { fef2: 80 91 c1 13 lds r24, 0x13C1 ; 0x8013c1 fef6: 88 23 and r24, r24 fef8: 89 f1 breq .+98 ; 0xff5c } } } void mesh_bed_leveling::print() { SERIAL_PROTOCOLLNPGM("Num X,Y: " STRINGIFY(MESH_NUM_X_POINTS) "," STRINGIFY(MESH_NUM_Y_POINTS)); fefa: 86 e6 ldi r24, 0x66 ; 102 fefc: 9d e7 ldi r25, 0x7D ; 125 fefe: 0e 94 93 79 call 0xf326 ; 0xf326 SERIAL_PROTOCOLLNPGM("Z search height: " STRINGIFY(MESH_HOME_Z_SEARCH)); ff02: 80 e5 ldi r24, 0x50 ; 80 ff04: 9d e7 ldi r25, 0x7D ; 125 ff06: 0e 94 93 79 call 0xf326 ; 0xf326 SERIAL_PROTOCOLLNPGM("Measured points:"); ff0a: 8f e3 ldi r24, 0x3F ; 63 ff0c: 9d e7 ldi r25, 0x7D ; 125 ff0e: 0e 94 93 79 call 0xf326 ; 0xf326 for (uint8_t y = MESH_NUM_Y_POINTS; y-- > 0;) { ff12: c7 e0 ldi r28, 0x07 ; 7 ff14: dc e1 ldi r29, 0x1C ; 28 ff16: c1 50 subi r28, 0x01 ; 1 ff18: 58 f1 brcs .+86 ; 0xff70 ff1a: cd 9f mul r28, r29 ff1c: 70 01 movw r14, r0 ff1e: 11 24 eor r1, r1 ff20: 01 e0 ldi r16, 0x01 ; 1 ff22: 10 e0 ldi r17, 0x00 ; 0 for (uint8_t x = 0; x < MESH_NUM_X_POINTS; x++) { SERIAL_PROTOCOLPGM(" "); ff24: 8c e3 ldi r24, 0x3C ; 60 ff26: 9d e7 ldi r25, 0x7D ; 125 ff28: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_PROTOCOL_F(z_values[y][x], 5); ff2c: f8 01 movw r30, r16 ff2e: ee 0f add r30, r30 ff30: ff 1f adc r31, r31 ff32: ee 0f add r30, r30 ff34: ff 1f adc r31, r31 ff36: ee 0d add r30, r14 ff38: ff 1d adc r31, r15 ff3a: e2 54 subi r30, 0x42 ; 66 ff3c: fc 4e sbci r31, 0xEC ; 236 ff3e: 60 81 ld r22, Z ff40: 71 81 ldd r23, Z+1 ; 0x01 ff42: 82 81 ldd r24, Z+2 ; 0x02 ff44: 93 81 ldd r25, Z+3 ; 0x03 ff46: 45 e0 ldi r20, 0x05 ; 5 ff48: 0f 94 42 d5 call 0x3aa84 ; 0x3aa84 ff4c: 0f 5f subi r16, 0xFF ; 255 ff4e: 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++) { ff50: 08 30 cpi r16, 0x08 ; 8 ff52: 11 05 cpc r17, r1 ff54: 39 f7 brne .-50 ; 0xff24 SERIAL_PROTOCOLPGM(" "); SERIAL_PROTOCOL_F(z_values[y][x], 5); } SERIAL_PROTOCOLLN(); ff56: 0f 94 b8 d5 call 0x3ab70 ; 0x3ab70 ff5a: dd cf rjmp .-70 ; 0xff16 mbl.print(); } else SERIAL_PROTOCOLLNPGM("Mesh bed leveling not active."); ff5c: 83 e7 ldi r24, 0x73 ; 115 ff5e: 9d e7 ldi r25, 0x7D ; 125 return; } ff60: df 91 pop r29 ff62: cf 91 pop r28 ff64: 1f 91 pop r17 ff66: 0f 91 pop r16 ff68: ff 90 pop r15 ff6a: ef 90 pop r14 static void gcode_G81_M420() { if (mbl.active) { mbl.print(); } else SERIAL_PROTOCOLLNPGM("Mesh bed leveling not active."); ff6c: 0c 94 93 79 jmp 0xf326 ; 0xf326 return; } ff70: df 91 pop r29 ff72: cf 91 pop r28 ff74: 1f 91 pop r17 ff76: 0f 91 pop r16 ff78: ff 90 pop r15 ff7a: ef 90 pop r14 ff7c: 08 95 ret 0000ff7e : /** * Output a "busy" message at regular intervals * while the machine is not accepting commands. */ void host_keepalive() { ff7e: 8f 92 push r8 ff80: 9f 92 push r9 ff82: af 92 push r10 ff84: bf 92 push r11 ff86: cf 92 push r12 ff88: df 92 push r13 ff8a: ef 92 push r14 ff8c: ff 92 push r15 #ifndef HOST_KEEPALIVE_FEATURE return; #endif //HOST_KEEPALIVE_FEATURE if (farm_mode) return; long ms = _millis(); ff8e: 0f 94 22 29 call 0x25244 ; 0x25244 ff92: 6b 01 movw r12, r22 ff94: 7c 01 movw r14, r24 if (host_keepalive_interval && busy_state != NOT_BUSY) { ff96: 20 91 2f 02 lds r18, 0x022F ; 0x80022f ff9a: 22 23 and r18, r18 ff9c: 09 f1 breq .+66 ; 0xffe0 ff9e: 40 91 be 02 lds r20, 0x02BE ; 0x8002be ffa2: 41 30 cpi r20, 0x01 ; 1 ffa4: e9 f0 breq .+58 ; 0xffe0 if ((ms - prev_busy_signal_ms) < (long)(1000L * host_keepalive_interval)) return; ffa6: 80 91 10 02 lds r24, 0x0210 ; 0x800210 ffaa: 90 91 11 02 lds r25, 0x0211 ; 0x800211 ffae: a0 91 12 02 lds r26, 0x0212 ; 0x800212 ffb2: b0 91 13 02 lds r27, 0x0213 ; 0x800213 ffb6: 46 01 movw r8, r12 ffb8: 57 01 movw r10, r14 ffba: 88 1a sub r8, r24 ffbc: 99 0a sbc r9, r25 ffbe: aa 0a sbc r10, r26 ffc0: bb 0a sbc r11, r27 ffc2: 30 e0 ldi r19, 0x00 ; 0 ffc4: a8 ee ldi r26, 0xE8 ; 232 ffc6: b3 e0 ldi r27, 0x03 ; 3 ffc8: 0f 94 77 dc call 0x3b8ee ; 0x3b8ee <__umulhisi3> ffcc: 86 16 cp r8, r22 ffce: 97 06 cpc r9, r23 ffd0: a8 06 cpc r10, r24 ffd2: b9 06 cpc r11, r25 ffd4: 6c f0 brlt .+26 ; 0xfff0 switch (busy_state) { ffd6: 44 30 cpi r20, 0x04 ; 4 ffd8: 31 f1 breq .+76 ; 0x10026 ffda: 9c f4 brge .+38 ; 0x10002 ffdc: 42 30 cpi r20, 0x02 ; 2 ffde: d4 f4 brge .+52 ; 0x10014 break; default: break; } } prev_busy_signal_ms = ms; ffe0: c0 92 10 02 sts 0x0210, r12 ; 0x800210 ffe4: d0 92 11 02 sts 0x0211, r13 ; 0x800211 ffe8: e0 92 12 02 sts 0x0212, r14 ; 0x800212 ffec: f0 92 13 02 sts 0x0213, r15 ; 0x800213 } fff0: ff 90 pop r15 fff2: ef 90 pop r14 fff4: df 90 pop r13 fff6: cf 90 pop r12 fff8: bf 90 pop r11 fffa: af 90 pop r10 fffc: 9f 90 pop r9 fffe: 8f 90 pop r8 10000: 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) { 10002: 45 30 cpi r20, 0x05 ; 5 10004: 69 f7 brne .-38 ; 0xffe0 case PAUSED_FOR_USER: SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: paused for user"); break; case PAUSED_FOR_INPUT: SERIAL_ECHO_START; 10006: 82 ef ldi r24, 0xF2 ; 242 10008: 9b ea ldi r25, 0xAB ; 171 1000a: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHOLNPGM("busy: paused for input"); 1000e: 88 ee ldi r24, 0xE8 ; 232 10010: 9b e7 ldi r25, 0x7B ; 123 10012: 06 c0 rjmp .+12 ; 0x10020 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; 10014: 82 ef ldi r24, 0xF2 ; 242 10016: 9b ea ldi r25, 0xAB ; 171 10018: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHOLNPGM("busy: processing"); 1001c: 85 e1 ldi r24, 0x15 ; 21 1001e: 9c e7 ldi r25, 0x7C ; 124 SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: paused for user"); break; case PAUSED_FOR_INPUT: SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: paused for input"); 10020: 0e 94 93 79 call 0xf326 ; 0xf326 10024: dd cf rjmp .-70 ; 0xffe0 case IN_PROCESS: SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: processing"); break; case PAUSED_FOR_USER: SERIAL_ECHO_START; 10026: 82 ef ldi r24, 0xF2 ; 242 10028: 9b ea ldi r25, 0xAB ; 171 1002a: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHOLNPGM("busy: paused for user"); 1002e: 8f ef ldi r24, 0xFF ; 255 10030: 9b e7 ldi r25, 0x7B ; 123 10032: f6 cf rjmp .-20 ; 0x10020 00010034 : //} } #endif //TACH_0 void checkFans() { 10034: cf 92 push r12 10036: df 92 push r13 10038: ef 92 push r14 1003a: ff 92 push r15 1003c: 0f 93 push r16 1003e: 1f 93 push r17 10040: cf 93 push r28 10042: df 93 push r29 10044: 1f 92 push r1 10046: 1f 92 push r1 10048: cd b7 in r28, 0x3d ; 61 1004a: de b7 in r29, 0x3e ; 62 #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)) { 1004c: 0f 94 22 29 call 0x25244 ; 0x25244 10050: 00 91 bf 17 lds r16, 0x17BF ; 0x8017bf 10054: 10 91 c0 17 lds r17, 0x17C0 ; 0x8017c0 10058: 20 91 c1 17 lds r18, 0x17C1 ; 0x8017c1 1005c: 30 91 c2 17 lds r19, 0x17C2 ; 0x8017c2 10060: 60 1b sub r22, r16 10062: 71 0b sbc r23, r17 10064: 82 0b sbc r24, r18 10066: 93 0b sbc r25, r19 10068: 69 38 cpi r22, 0x89 ; 137 1006a: 73 41 sbci r23, 0x13 ; 19 1006c: 81 05 cpc r24, r1 1006e: 91 05 cpc r25, r1 10070: d0 f0 brcs .+52 ; 0x100a6 10072: 80 91 6e 06 lds r24, 0x066E ; 0x80066e 10076: 81 11 cpse r24, r1 10078: 16 c0 rjmp .+44 ; 0x100a6 extruder_autofan_last_check = _millis(); 1007a: 0f 94 22 29 call 0x25244 ; 0x25244 1007e: 60 93 bf 17 sts 0x17BF, r22 ; 0x8017bf 10082: 70 93 c0 17 sts 0x17C0, r23 ; 0x8017c0 10086: 80 93 c1 17 sts 0x17C1, r24 ; 0x8017c1 1008a: 90 93 c2 17 sts 0x17C2, r25 ; 0x8017c2 fanSpeedBckp = fanSpeedSoftPwm; 1008e: 80 91 a5 04 lds r24, 0x04A5 ; 0x8004a5 10092: 80 93 14 02 sts 0x0214, r24 ; 0x800214 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 10096: 8b 34 cpi r24, 0x4B ; 75 10098: 18 f0 brcs .+6 ; 0x100a0 // printf_P(PSTR("fanSpeedSoftPwm 1: %d\n"), fanSpeedSoftPwm); fanSpeedSoftPwm = 255; 1009a: 8f ef ldi r24, 0xFF ; 255 1009c: 80 93 a5 04 sts 0x04A5, r24 ; 0x8004a5 } fan_measuring = true; 100a0: 81 e0 ldi r24, 0x01 ; 1 100a2: 80 93 6e 06 sts 0x066E, r24 ; 0x80066e } if ((_millis() - extruder_autofan_last_check > FAN_CHECK_DURATION) && (fan_measuring)) { 100a6: 0f 94 22 29 call 0x25244 ; 0x25244 100aa: 00 91 bf 17 lds r16, 0x17BF ; 0x8017bf 100ae: 10 91 c0 17 lds r17, 0x17C0 ; 0x8017c0 100b2: 20 91 c1 17 lds r18, 0x17C1 ; 0x8017c1 100b6: 30 91 c2 17 lds r19, 0x17C2 ; 0x8017c2 100ba: 60 1b sub r22, r16 100bc: 71 0b sbc r23, r17 100be: 82 0b sbc r24, r18 100c0: 93 0b sbc r25, r19 100c2: 65 36 cpi r22, 0x65 ; 101 100c4: 71 05 cpc r23, r1 100c6: 81 05 cpc r24, r1 100c8: 91 05 cpc r25, r1 100ca: 08 f4 brcc .+2 ; 0x100ce 100cc: 57 c1 rjmp .+686 ; 0x1037c 100ce: 80 91 6e 06 lds r24, 0x066E ; 0x80066e 100d2: 88 23 and r24, r24 100d4: 09 f4 brne .+2 ; 0x100d8 100d6: 52 c1 rjmp .+676 ; 0x1037c #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))); 100d8: 60 91 e1 05 lds r22, 0x05E1 ; 0x8005e1 100dc: 70 91 e2 05 lds r23, 0x05E2 ; 0x8005e2 100e0: 07 2e mov r0, r23 100e2: 00 0c add r0, r0 100e4: 88 0b sbc r24, r24 100e6: 99 0b sbc r25, r25 100e8: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 100ec: 6b 01 movw r12, r22 100ee: 7c 01 movw r14, r24 100f0: 0f 94 22 29 call 0x25244 ; 0x25244 100f4: 00 91 bf 17 lds r16, 0x17BF ; 0x8017bf 100f8: 10 91 c0 17 lds r17, 0x17C0 ; 0x8017c0 100fc: 20 91 c1 17 lds r18, 0x17C1 ; 0x8017c1 10100: 30 91 c2 17 lds r19, 0x17C2 ; 0x8017c2 10104: 60 1b sub r22, r16 10106: 71 0b sbc r23, r17 10108: 82 0b sbc r24, r18 1010a: 93 0b sbc r25, r19 1010c: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 10110: 9b 01 movw r18, r22 10112: ac 01 movw r20, r24 10114: 60 e0 ldi r22, 0x00 ; 0 10116: 70 e0 ldi r23, 0x00 ; 0 10118: 8a e7 ldi r24, 0x7A ; 122 1011a: 93 e4 ldi r25, 0x43 ; 67 1011c: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 10120: a7 01 movw r20, r14 10122: 96 01 movw r18, r12 10124: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 10128: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> 1012c: 70 93 c8 03 sts 0x03C8, r23 ; 0x8003c8 10130: 60 93 c7 03 sts 0x03C7, r22 ; 0x8003c7 fan_speed[1] = (fan_edge_counter[1] * (float(250) / (_millis() - extruder_autofan_last_check))); 10134: 60 91 e3 05 lds r22, 0x05E3 ; 0x8005e3 10138: 70 91 e4 05 lds r23, 0x05E4 ; 0x8005e4 1013c: 07 2e mov r0, r23 1013e: 00 0c add r0, r0 10140: 88 0b sbc r24, r24 10142: 99 0b sbc r25, r25 10144: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 10148: 6b 01 movw r12, r22 1014a: 7c 01 movw r14, r24 1014c: 0f 94 22 29 call 0x25244 ; 0x25244 10150: 00 91 bf 17 lds r16, 0x17BF ; 0x8017bf 10154: 10 91 c0 17 lds r17, 0x17C0 ; 0x8017c0 10158: 20 91 c1 17 lds r18, 0x17C1 ; 0x8017c1 1015c: 30 91 c2 17 lds r19, 0x17C2 ; 0x8017c2 10160: 60 1b sub r22, r16 10162: 71 0b sbc r23, r17 10164: 82 0b sbc r24, r18 10166: 93 0b sbc r25, r19 10168: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 1016c: 9b 01 movw r18, r22 1016e: ac 01 movw r20, r24 10170: 60 e0 ldi r22, 0x00 ; 0 10172: 70 e0 ldi r23, 0x00 ; 0 10174: 8a e7 ldi r24, 0x7A ; 122 10176: 93 e4 ldi r25, 0x43 ; 67 10178: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 1017c: a7 01 movw r20, r14 1017e: 96 01 movw r18, r12 10180: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 10184: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> 10188: 8b 01 movw r16, r22 1018a: 70 93 ca 03 sts 0x03CA, r23 ; 0x8003ca 1018e: 60 93 c9 03 sts 0x03C9, r22 ; 0x8003c9 /*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; 10192: 10 92 e2 05 sts 0x05E2, r1 ; 0x8005e2 10196: 10 92 e1 05 sts 0x05E1, r1 ; 0x8005e1 fan_edge_counter[1] = 0; 1019a: 10 92 e4 05 sts 0x05E4, r1 ; 0x8005e4 1019e: 10 92 e3 05 sts 0x05E3, r1 ; 0x8005e3 void checkFanSpeed() { uint8_t max_fan_errors[2]; #ifdef FAN_SOFT_PWM max_fan_errors[1] = 3; // 15 seconds (Print fan) 101a2: 83 e0 ldi r24, 0x03 ; 3 101a4: 8a 83 std Y+2, r24 ; 0x02 max_fan_errors[0] = 2; // 10 seconds (Hotend fan) 101a6: 82 e0 ldi r24, 0x02 ; 2 101a8: 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) 101aa: 80 91 38 02 lds r24, 0x0238 ; 0x800238 101ae: 88 23 and r24, r24 101b0: 51 f0 breq .+20 ; 0x101c6 fans_check_enabled = (eeprom_read_byte((uint8_t*)EEPROM_FAN_CHECK_ENABLED) > 0); 101b2: 87 e8 ldi r24, 0x87 ; 135 101b4: 9f e0 ldi r25, 0x0F ; 15 101b6: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 101ba: 91 e0 ldi r25, 0x01 ; 1 101bc: 81 11 cpse r24, r1 101be: 01 c0 rjmp .+2 ; 0x101c2 101c0: 90 e0 ldi r25, 0x00 ; 0 101c2: 90 93 38 02 sts 0x0238, r25 ; 0x800238 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]++;} 101c6: 80 91 c7 03 lds r24, 0x03C7 ; 0x8003c7 101ca: 90 91 c8 03 lds r25, 0x03C8 ; 0x8003c8 101ce: 44 97 sbiw r24, 0x14 ; 20 101d0: 0c f0 brlt .+2 ; 0x101d4 101d2: 9d c0 rjmp .+314 ; 0x1030e 101d4: 20 e0 ldi r18, 0x00 ; 0 101d6: 30 e0 ldi r19, 0x00 ; 0 101d8: 48 e4 ldi r20, 0x48 ; 72 101da: 52 e4 ldi r21, 0x42 ; 66 101dc: 60 91 af 0d lds r22, 0x0DAF ; 0x800daf 101e0: 70 91 b0 0d lds r23, 0x0DB0 ; 0x800db0 101e4: 80 91 b1 0d lds r24, 0x0DB1 ; 0x800db1 101e8: 90 91 b2 0d lds r25, 0x0DB2 ; 0x800db2 101ec: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 101f0: 18 16 cp r1, r24 101f2: 0c f0 brlt .+2 ; 0x101f6 101f4: 8c c0 rjmp .+280 ; 0x1030e 101f6: 80 91 4c 03 lds r24, 0x034C ; 0x80034c 101fa: 8f 5f subi r24, 0xFF ; 255 101fc: 80 93 4c 03 sts 0x034C, r24 ; 0x80034c else fan_speed_errors[0] = 0; #endif #if (defined(FANCHECK) && defined(TACH_1) && (TACH_1 >-1)) if ((fan_speed[1] < 5) && ((blocks_queued() ? block_buffer[block_buffer_tail].fan_speed : fanSpeed) > MIN_PRINT_FAN_SPEED)) fan_speed_errors[1]++; 10200: 05 30 cpi r16, 0x05 ; 5 10202: 11 05 cpc r17, r1 10204: 0c f0 brlt .+2 ; 0x10208 10206: 89 c0 rjmp .+274 ; 0x1031a 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); 10208: 90 91 a4 0d lds r25, 0x0DA4 ; 0x800da4 1020c: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 10210: 98 17 cp r25, r24 10212: 09 f4 brne .+2 ; 0x10216 10214: 7f c0 rjmp .+254 ; 0x10314 10216: e0 91 a5 0d lds r30, 0x0DA5 ; 0x800da5 1021a: 8e e6 ldi r24, 0x6E ; 110 1021c: e8 9f mul r30, r24 1021e: f0 01 movw r30, r0 10220: 11 24 eor r1, r1 10222: e6 5f subi r30, 0xF6 ; 246 10224: f8 4f sbci r31, 0xF8 ; 248 10226: 80 81 ld r24, Z 10228: 8c 34 cpi r24, 0x4C ; 76 1022a: 08 f4 brcc .+2 ; 0x1022e 1022c: 76 c0 rjmp .+236 ; 0x1031a 1022e: 80 91 4d 03 lds r24, 0x034D ; 0x80034d 10232: 8f 5f subi r24, 0xFF ; 255 10234: 80 93 4d 03 sts 0x034D, r24 ; 0x80034d 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){ 10238: 80 91 4c 03 lds r24, 0x034C ; 0x80034c 1023c: 81 11 cpse r24, r1 1023e: 0b c0 rjmp .+22 ; 0x10256 10240: 80 91 4d 03 lds r24, 0x034D ; 0x80034d 10244: 81 11 cpse r24, r1 10246: 07 c0 rjmp .+14 ; 0x10256 10248: 80 91 e4 03 lds r24, 0x03E4 ; 0x8003e4 1024c: 82 30 cpi r24, 0x02 ; 2 1024e: 19 f4 brne .+6 ; 0x10256 // we may even send some info to the LCD from here fan_check_error = EFCE_FIXED; 10250: 81 e0 ldi r24, 0x01 ; 1 10252: 80 93 e4 03 sts 0x03E4, r24 ; 0x8003e4 } if ((fan_check_error == EFCE_FIXED) && !printer_active()){ 10256: 80 91 e4 03 lds r24, 0x03E4 ; 0x8003e4 1025a: 81 30 cpi r24, 0x01 ; 1 1025c: 61 f4 brne .+24 ; 0x10276 1025e: 0e 94 f9 67 call 0xcff2 ; 0xcff2 10262: 81 11 cpse r24, r1 10264: 08 c0 rjmp .+16 ; 0x10276 fan_check_error = EFCE_OK; //if the issue is fixed while the printer is doing nothing, reenable processing immediately. 10266: 10 92 e4 03 sts 0x03E4, r1 ; 0x8003e4 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 1026a: 10 92 d3 03 sts 0x03D3, r1 ; 0x8003d3 <_ZL24lcd_status_message_level.lto_priv.451> 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 1026e: 86 eb ldi r24, 0xB6 ; 182 10270: 90 e7 ldi r25, 0x70 ; 112 10272: 0e 94 38 f1 call 0x1e270 ; 0x1e270 } if (fans_check_enabled && (fan_check_error != EFCE_REPORTED)) 10276: 80 91 38 02 lds r24, 0x0238 ; 0x800238 1027a: 88 23 and r24, r24 1027c: 09 f4 brne .+2 ; 0x10280 1027e: 6e c0 rjmp .+220 ; 0x1035c 10280: 80 91 e4 03 lds r24, 0x03E4 ; 0x8003e4 10284: 82 30 cpi r24, 0x02 ; 2 10286: 09 f4 brne .+2 ; 0x1028a 10288: 69 c0 rjmp .+210 ; 0x1035c 1028a: 8c e4 ldi r24, 0x4C ; 76 1028c: e8 2e mov r14, r24 1028e: 83 e0 ldi r24, 0x03 ; 3 10290: f8 2e mov r15, r24 10292: fe 01 movw r30, r28 10294: 31 96 adiw r30, 0x01 ; 1 10296: 6f 01 movw r12, r30 { for (uint8_t fan = 0; fan < 2; fan++) 10298: 10 e0 ldi r17, 0x00 ; 0 } } void fanSpeedError(unsigned char _fan) { if (fan_check_error == EFCE_REPORTED) return; fan_check_error = EFCE_REPORTED; 1029a: 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]) 1029c: f7 01 movw r30, r14 1029e: 91 91 ld r25, Z+ 102a0: 7f 01 movw r14, r30 102a2: f6 01 movw r30, r12 102a4: 81 91 ld r24, Z+ 102a6: 6f 01 movw r12, r30 102a8: 89 17 cp r24, r25 102aa: 68 f5 brcc .+90 ; 0x10306 { fan_speed_errors[fan] = 0; 102ac: f7 01 movw r30, r14 102ae: 31 97 sbiw r30, 0x01 ; 1 102b0: 10 82 st Z, r1 LCD_ALERTMESSAGERPGM(lcdMsg); } } void fanSpeedError(unsigned char _fan) { if (fan_check_error == EFCE_REPORTED) return; 102b2: 80 91 e4 03 lds r24, 0x03E4 ; 0x8003e4 102b6: 82 30 cpi r24, 0x02 ; 2 102b8: 31 f1 breq .+76 ; 0x10306 fan_check_error = EFCE_REPORTED; 102ba: 00 93 e4 03 sts 0x03E4, r16 ; 0x8003e4 if (printJobOngoing()) { 102be: 0e 94 a8 67 call 0xcf50 ; 0xcf50 102c2: 88 23 and r24, r24 102c4: 81 f1 breq .+96 ; 0x10326 // A print is ongoing, pause the print normally if(!printingIsPaused()) { 102c6: 0e 94 9d 67 call 0xcf3a ; 0xcf3a 102ca: 81 11 cpse r24, r1 102cc: 06 c0 rjmp .+12 ; 0x102da if (usb_timer.running()) 102ce: 80 91 0d 05 lds r24, 0x050D ; 0x80050d 102d2: 88 23 and r24, r24 102d4: 29 f1 breq .+74 ; 0x10320 lcd_pause_usb_print(); 102d6: 0f 94 6f 14 call 0x228de ; 0x228de else { // Nothing is going on, but still turn off heaters and report the error setTargetHotend(0); heating_status = HeatingStatus::NO_HEATING; } switch (_fan) { 102da: 11 30 cpi r17, 0x01 ; 1 102dc: 59 f1 breq .+86 ; 0x10334 //! 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); 102de: 89 e5 ldi r24, 0x59 ; 89 102e0: 99 e7 ldi r25, 0x79 ; 121 102e2: 0e 94 93 79 call 0xf326 ; 0xf326 if (get_message_level() == 0) { 102e6: 80 91 d3 03 lds r24, 0x03D3 ; 0x8003d3 <_ZL24lcd_status_message_level.lto_priv.451> 102ea: 81 11 cpse r24, r1 102ec: 0c c0 rjmp .+24 ; 0x10306 Sound_MakeCustom(200,0,true); 102ee: 41 e0 ldi r20, 0x01 ; 1 102f0: 70 e0 ldi r23, 0x00 ; 0 102f2: 60 e0 ldi r22, 0x00 ; 0 102f4: 88 ec ldi r24, 0xC8 ; 200 102f6: 90 e0 ldi r25, 0x00 ; 0 102f8: 0f 94 01 51 call 0x2a202 ; 0x2a202 LCD_ALERTMESSAGERPGM(lcdMsg); 102fc: 62 e0 ldi r22, 0x02 ; 2 102fe: 8c e1 ldi r24, 0x1C ; 28 10300: 9b e6 ldi r25, 0x6B ; 107 10302: 0e 94 f8 f0 call 0x1e1f0 ; 0x1e1f0 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++) 10306: 11 30 cpi r17, 0x01 ; 1 10308: 49 f1 breq .+82 ; 0x1035c 1030a: 11 e0 ldi r17, 0x01 ; 1 1030c: c7 cf rjmp .-114 ; 0x1029c 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; 1030e: 10 92 4c 03 sts 0x034C, r1 ; 0x80034c 10312: 76 cf rjmp .-276 ; 0x10200 #endif #if (defined(FANCHECK) && defined(TACH_1) && (TACH_1 >-1)) if ((fan_speed[1] < 5) && ((blocks_queued() ? block_buffer[block_buffer_tail].fan_speed : fanSpeed) > MIN_PRINT_FAN_SPEED)) fan_speed_errors[1]++; 10314: 80 91 e5 03 lds r24, 0x03E5 ; 0x8003e5 10318: 87 cf rjmp .-242 ; 0x10228 else fan_speed_errors[1] = 0; 1031a: 10 92 4d 03 sts 0x034D, r1 ; 0x80034d 1031e: 8c cf rjmp .-232 ; 0x10238 // A print is ongoing, pause the print normally if(!printingIsPaused()) { if (usb_timer.running()) lcd_pause_usb_print(); else lcd_pause_print(); 10320: 0f 94 2e 29 call 0x2525c ; 0x2525c 10324: da cf rjmp .-76 ; 0x102da return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 10326: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 1032a: 10 92 b5 0d sts 0x0DB5, r1 ; 0x800db5 } } else { // Nothing is going on, but still turn off heaters and report the error setTargetHotend(0); heating_status = HeatingStatus::NO_HEATING; 1032e: 10 92 e1 03 sts 0x03E1, r1 ; 0x8003e1 10332: d3 cf rjmp .-90 ; 0x102da //! 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); 10334: 81 e8 ldi r24, 0x81 ; 129 10336: 99 e7 ldi r25, 0x79 ; 121 10338: 0e 94 93 79 call 0xf326 ; 0xf326 if (get_message_level() == 0) { 1033c: 80 91 d3 03 lds r24, 0x03D3 ; 0x8003d3 <_ZL24lcd_status_message_level.lto_priv.451> 10340: 81 11 cpse r24, r1 10342: 0c c0 rjmp .+24 ; 0x1035c Sound_MakeCustom(200,0,true); 10344: 41 e0 ldi r20, 0x01 ; 1 10346: 70 e0 ldi r23, 0x00 ; 0 10348: 60 e0 ldi r22, 0x00 ; 0 1034a: 88 ec ldi r24, 0xC8 ; 200 1034c: 90 e0 ldi r25, 0x00 ; 0 1034e: 0f 94 01 51 call 0x2a202 ; 0x2a202 LCD_ALERTMESSAGERPGM(lcdMsg); 10352: 62 e0 ldi r22, 0x02 ; 2 10354: 88 e0 ldi r24, 0x08 ; 8 10356: 9b e6 ldi r25, 0x6B ; 107 10358: 0e 94 f8 f0 call 0x1e1f0 ; 0x1e1f0 } if ((_millis() - extruder_autofan_last_check > FAN_CHECK_DURATION) && (fan_measuring)) { countFanSpeed(); checkFanSpeed(); //printf_P(PSTR("fanSpeedSoftPwm 1: %d\n"), fanSpeedSoftPwm); fanSpeedSoftPwm = fanSpeedBckp; 1035c: 80 91 14 02 lds r24, 0x0214 ; 0x800214 10360: 80 93 a5 04 sts 0x04A5, r24 ; 0x8004a5 //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(); 10364: 0f 94 22 29 call 0x25244 ; 0x25244 10368: 60 93 bf 17 sts 0x17BF, r22 ; 0x8017bf 1036c: 70 93 c0 17 sts 0x17C0, r23 ; 0x8017c0 10370: 80 93 c1 17 sts 0x17C1, r24 ; 0x8017c1 10374: 90 93 c2 17 sts 0x17C2, r25 ; 0x8017c2 fan_measuring = false; 10378: 10 92 6e 06 sts 0x066E, r1 ; 0x80066e } #endif //FAN_SOFT_PWM #endif #endif //DEBUG_DISABLE_FANCHECK } 1037c: 0f 90 pop r0 1037e: 0f 90 pop r0 10380: df 91 pop r29 10382: cf 91 pop r28 10384: 1f 91 pop r17 10386: 0f 91 pop r16 10388: ff 90 pop r15 1038a: ef 90 pop r14 1038c: df 90 pop r13 1038e: cf 90 pop r12 //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(); fan_measuring = false; } #endif //FANCHECK checkExtruderAutoFans(); 10390: 0c 94 bf 75 jmp 0xeb7e ; 0xeb7e 00010394 : return (k >= 0? la10c_convert(k): -1); } float la10c_jerk(float j) { 10394: cf 92 push r12 10396: df 92 push r13 10398: ef 92 push r14 1039a: ff 92 push r15 1039c: 6b 01 movw r12, r22 1039e: 7c 01 movw r14, r24 la10c_orig_jerk = j; 103a0: c0 92 52 03 sts 0x0352, r12 ; 0x800352 103a4: d0 92 53 03 sts 0x0353, r13 ; 0x800353 103a8: e0 92 54 03 sts 0x0354, r14 ; 0x800354 103ac: f0 92 55 03 sts 0x0355, r15 ; 0x800355 if(la10c_mode != LA10C_LA10) 103b0: 80 91 6e 03 lds r24, 0x036E ; 0x80036e 103b4: 82 30 cpi r24, 0x02 ; 2 103b6: b1 f4 brne .+44 ; 0x103e4 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) 103b8: 20 e0 ldi r18, 0x00 ; 0 103ba: 30 e0 ldi r19, 0x00 ; 0 103bc: 40 e9 ldi r20, 0x90 ; 144 103be: 50 e4 ldi r21, 0x40 ; 64 103c0: c7 01 movw r24, r14 103c2: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 103c6: 87 ff sbrs r24, 7 103c8: 14 c0 rjmp .+40 ; 0x103f2 103ca: 80 91 ed 0d lds r24, 0x0DED ; 0x800ded 103ce: 90 91 ee 0d lds r25, 0x0DEE ; 0x800dee 103d2: a0 91 ef 0d lds r26, 0x0DEF ; 0x800def 103d6: b0 91 f0 0d lds r27, 0x0DF0 ; 0x800df0 103da: 80 3d cpi r24, 0xD0 ; 208 103dc: 97 40 sbci r25, 0x07 ; 7 103de: a1 05 cpc r26, r1 103e0: b1 05 cpc r27, r1 103e2: 20 f5 brcc .+72 ; 0x1042c j; SERIAL_ECHOPGM("LA10C: Adjusted E-Jerk: "); SERIAL_ECHOLN(j); return j; } 103e4: c7 01 movw r24, r14 103e6: b6 01 movw r22, r12 103e8: ff 90 pop r15 103ea: ef 90 pop r14 103ec: df 90 pop r13 103ee: cf 90 pop r12 103f0: 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: 103f2: 2a e9 ldi r18, 0x9A ; 154 103f4: 39 e9 ldi r19, 0x99 ; 153 103f6: 49 e9 ldi r20, 0x99 ; 153 103f8: 5e e3 ldi r21, 0x3E ; 62 103fa: c7 01 movw r24, r14 103fc: b6 01 movw r22, r12 103fe: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 10402: 87 ff sbrs r24, 7 10404: 0a c0 rjmp .+20 ; 0x1041a 10406: 20 e0 ldi r18, 0x00 ; 0 10408: 30 e0 ldi r19, 0x00 ; 0 1040a: 48 e3 ldi r20, 0x38 ; 56 1040c: 51 e4 ldi r21, 0x41 ; 65 1040e: c7 01 movw r24, r14 10410: b6 01 movw r22, r12 10412: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 10416: 6b 01 movw r12, r22 10418: 7c 01 movw r14, r24 j < 4.5? j * 0.25 + 3.375: j; SERIAL_ECHOPGM("LA10C: Adjusted E-Jerk: "); 1041a: 85 ed ldi r24, 0xD5 ; 213 1041c: 99 e7 ldi r25, 0x79 ; 121 1041e: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHOLN(j); 10422: c7 01 movw r24, r14 10424: b6 01 movw r22, r12 10426: 0f 94 6f 74 call 0x2e8de ; 0x2e8de 1042a: dc cf rjmp .-72 ; 0x103e4 // 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: 1042c: 2a e9 ldi r18, 0x9A ; 154 1042e: 39 e9 ldi r19, 0x99 ; 153 10430: 49 e9 ldi r20, 0x99 ; 153 10432: 5e e3 ldi r21, 0x3E ; 62 10434: c7 01 movw r24, r14 10436: b6 01 movw r22, r12 10438: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 1043c: 87 fd sbrc r24, 7 1043e: e3 cf rjmp .-58 ; 0x10406 j < 4.5? j * 0.25 + 3.375: 10440: 20 e0 ldi r18, 0x00 ; 0 10442: 30 e0 ldi r19, 0x00 ; 0 10444: 40 e8 ldi r20, 0x80 ; 128 10446: 5e e3 ldi r21, 0x3E ; 62 10448: c7 01 movw r24, r14 1044a: b6 01 movw r22, r12 1044c: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__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: 10450: 20 e0 ldi r18, 0x00 ; 0 10452: 30 e0 ldi r19, 0x00 ; 0 10454: 48 e5 ldi r20, 0x58 ; 88 10456: 50 e4 ldi r21, 0x40 ; 64 10458: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 1045c: dc cf rjmp .-72 ; 0x10416 0001045e : return la10c_mode; } void la10c_mode_change(LA10C_MODE mode) { 1045e: cf 92 push r12 10460: df 92 push r13 10462: ef 92 push r14 10464: ff 92 push r15 10466: cf 93 push r28 if(mode == la10c_mode) return; 10468: 90 91 6e 03 lds r25, 0x036E ; 0x80036e 1046c: 98 17 cp r25, r24 1046e: b9 f1 breq .+110 ; 0x104de 10470: c8 2f mov r28, r24 // always restore to the last unadjusted E-jerk value if(la10c_orig_jerk) 10472: c0 90 52 03 lds r12, 0x0352 ; 0x800352 10476: d0 90 53 03 lds r13, 0x0353 ; 0x800353 1047a: e0 90 54 03 lds r14, 0x0354 ; 0x800354 1047e: f0 90 55 03 lds r15, 0x0355 ; 0x800355 10482: 20 e0 ldi r18, 0x00 ; 0 10484: 30 e0 ldi r19, 0x00 ; 0 10486: a9 01 movw r20, r18 10488: c7 01 movw r24, r14 1048a: b6 01 movw r22, r12 1048c: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 10490: 88 23 and r24, r24 10492: 41 f0 breq .+16 ; 0x104a4 cs.max_jerk[E_AXIS] = la10c_orig_jerk; 10494: c0 92 11 0e sts 0x0E11, r12 ; 0x800e11 10498: d0 92 12 0e sts 0x0E12, r13 ; 0x800e12 1049c: e0 92 13 0e sts 0x0E13, r14 ; 0x800e13 104a0: f0 92 14 0e sts 0x0E14, r15 ; 0x800e14 SERIAL_ECHOPGM("LA10C: Linear Advance mode: "); 104a4: 88 eb ldi r24, 0xB8 ; 184 104a6: 99 e7 ldi r25, 0x79 ; 121 104a8: 0e 94 68 77 call 0xeed0 ; 0xeed0 switch(mode) 104ac: c1 30 cpi r28, 0x01 ; 1 104ae: 11 f1 breq .+68 ; 0x104f4 104b0: e0 f0 brcs .+56 ; 0x104ea 104b2: c2 30 cpi r28, 0x02 ; 2 104b4: 11 f1 breq .+68 ; 0x104fa { 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; 104b6: c0 93 6e 03 sts 0x036E, r28 ; 0x80036e // adjust the E-jerk if needed cs.max_jerk[E_AXIS] = la10c_jerk(cs.max_jerk[E_AXIS]); 104ba: 60 91 11 0e lds r22, 0x0E11 ; 0x800e11 104be: 70 91 12 0e lds r23, 0x0E12 ; 0x800e12 104c2: 80 91 13 0e lds r24, 0x0E13 ; 0x800e13 104c6: 90 91 14 0e lds r25, 0x0E14 ; 0x800e14 104ca: 0e 94 ca 81 call 0x10394 ; 0x10394 104ce: 60 93 11 0e sts 0x0E11, r22 ; 0x800e11 104d2: 70 93 12 0e sts 0x0E12, r23 ; 0x800e12 104d6: 80 93 13 0e sts 0x0E13, r24 ; 0x800e13 104da: 90 93 14 0e sts 0x0E14, r25 ; 0x800e14 } 104de: cf 91 pop r28 104e0: ff 90 pop r15 104e2: ef 90 pop r14 104e4: df 90 pop r13 104e6: cf 90 pop r12 104e8: 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; 104ea: 80 eb ldi r24, 0xB0 ; 176 104ec: 99 e7 ldi r25, 0x79 ; 121 case LA10C_LA15: SERIAL_ECHOLNPGM("1.5"); break; case LA10C_LA10: SERIAL_ECHOLNPGM("1.0"); break; 104ee: 0e 94 93 79 call 0xf326 ; 0xf326 104f2: e1 cf rjmp .-62 ; 0x104b6 SERIAL_ECHOPGM("LA10C: Linear Advance mode: "); switch(mode) { case LA10C_UNKNOWN: SERIAL_ECHOLNPGM("UNKNOWN"); break; case LA10C_LA15: SERIAL_ECHOLNPGM("1.5"); break; 104f4: 8c ea ldi r24, 0xAC ; 172 104f6: 99 e7 ldi r25, 0x79 ; 121 104f8: fa cf rjmp .-12 ; 0x104ee case LA10C_LA10: SERIAL_ECHOLNPGM("1.0"); break; 104fa: 88 ea ldi r24, 0xA8 ; 168 104fc: 99 e7 ldi r25, 0x79 ; 121 104fe: f7 cf rjmp .-18 ; 0x104ee 00010500 : bool IsStopped() { return Stopped; }; void finishAndDisableSteppers() { st_synchronize(); 10500: 0f 94 a3 42 call 0x28546 ; 0x28546 disable_x(); 10504: 17 9a sbi 0x02, 7 ; 2 10506: ee e8 ldi r30, 0x8E ; 142 10508: f6 e0 ldi r31, 0x06 ; 6 1050a: 10 82 st Z, r1 disable_y(); 1050c: 16 9a sbi 0x02, 6 ; 2 1050e: 11 82 std Z+1, r1 ; 0x01 disable_z(); disable_e0(); 10510: 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); } 10512: 80 e0 ldi r24, 0x00 ; 0 10514: 0e 94 2f 82 call 0x1045e ; 0x1045e return percent_done; } static void print_time_remaining_init() { print_time_remaining_normal = PRINT_TIME_REMAINING_INIT; 10518: 8f ef ldi r24, 0xFF ; 255 1051a: 9f ef ldi r25, 0xFF ; 255 1051c: 90 93 b2 02 sts 0x02B2, r25 ; 0x8002b2 10520: 80 93 b1 02 sts 0x02B1, r24 ; 0x8002b1 print_percent_done_normal = PRINT_PERCENT_DONE_INIT; 10524: 2f ef ldi r18, 0xFF ; 255 10526: 20 93 ae 02 sts 0x02AE, r18 ; 0x8002ae print_time_remaining_silent = PRINT_TIME_REMAINING_INIT; 1052a: 90 93 b6 02 sts 0x02B6, r25 ; 0x8002b6 1052e: 80 93 b5 02 sts 0x02B5, r24 ; 0x8002b5 print_percent_done_silent = PRINT_PERCENT_DONE_INIT; 10532: 20 93 ad 02 sts 0x02AD, r18 ; 0x8002ad print_time_to_change_normal = PRINT_TIME_REMAINING_INIT; 10536: 90 93 b0 02 sts 0x02B0, r25 ; 0x8002b0 1053a: 80 93 af 02 sts 0x02AF, r24 ; 0x8002af print_time_to_change_silent = PRINT_TIME_REMAINING_INIT; 1053e: 90 93 b4 02 sts 0x02B4, r25 ; 0x8002b4 10542: 80 93 b3 02 sts 0x02B3, r24 ; 0x8002b3 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(); } 10546: 08 95 ret 00010548 : } #endif void Config_ResetDefault() { memcpy_P(&cs,&default_conf, sizeof(cs)); 10548: 41 ed ldi r20, 0xD1 ; 209 1054a: 50 e0 ldi r21, 0x00 ; 0 1054c: 63 e6 ldi r22, 0x63 ; 99 1054e: 78 e7 ldi r23, 0x78 ; 120 10550: 8d eb ldi r24, 0xBD ; 189 10552: 9d e0 ldi r25, 0x0D ; 13 10554: 0f 94 71 d9 call 0x3b2e2 ; 0x3b2e2 // steps per sq second need to be updated to agree with the units per sq second reset_acceleration_rates(); 10558: 0f 94 1a 63 call 0x2c634 ; 0x2c634 #ifdef PIDTEMP updatePID(); 1055c: 0f 94 a5 3a call 0x2754a ; 0x2754a #endif//PIDTEMP #ifdef THERMAL_MODEL thermal_model_reset_settings(); 10560: 0f 94 7e 31 call 0x262fc ; 0x262fc #endif calculate_extruder_multipliers(); 10564: 0e 94 d1 65 call 0xcba2 ; 0xcba2 SERIAL_ECHO_START; 10568: 82 ef ldi r24, 0xF2 ; 242 1056a: 9b ea ldi r25, 0xAB ; 171 1056c: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHOLNPGM("Hardcoded Default Settings Loaded"); 10570: 81 e4 ldi r24, 0x41 ; 65 10572: 98 e7 ldi r25, 0x78 ; 120 10574: 0c 94 93 79 jmp 0xf326 ; 0xf326 00010578 : DEFAULT_ARC_SEGMENTS_PER_SEC }; void Config_StoreSettings() { 10578: cf 93 push r28 1057a: df 93 push r29 strcpy_P(cs.version, default_conf.version); 1057c: 63 e6 ldi r22, 0x63 ; 99 1057e: 78 e7 ldi r23, 0x78 ; 120 10580: 8d eb ldi r24, 0xBD ; 189 10582: 9d e0 ldi r25, 0x0D ; 13 10584: 0f 94 8e d9 call 0x3b31c ; 0x3b31c #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); 10588: 41 ed ldi r20, 0xD1 ; 209 1058a: 50 e0 ldi r21, 0x00 ; 0 1058c: 64 e1 ldi r22, 0x14 ; 20 1058e: 70 e0 ldi r23, 0x00 ; 0 10590: 8d eb ldi r24, 0xBD ; 189 10592: 9d e0 ldi r25, 0x0D ; 13 10594: 0f 94 eb db call 0x3b7d6 ; 0x3b7d6 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 10598: 60 91 1c 05 lds r22, 0x051C ; 0x80051c <_ZN13thermal_modelL7enabledE.lto_priv.456> 1059c: 82 e0 ldi r24, 0x02 ; 2 1059e: 9d e0 ldi r25, 0x0D ; 13 105a0: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 } void thermal_model_save_settings() { eeprom_update_byte_notify((uint8_t*)EEPROM_THERMAL_MODEL_ENABLE, thermal_model::enabled); eeprom_update_float_notify((float*)EEPROM_THERMAL_MODEL_P, thermal_model::data.P); 105a4: cf ea ldi r28, 0xAF ; 175 105a6: d2 e1 ldi r29, 0x12 ; 18 if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 105a8: 4a a5 ldd r20, Y+42 ; 0x2a 105aa: 5b a5 ldd r21, Y+43 ; 0x2b 105ac: 6c a5 ldd r22, Y+44 ; 0x2c 105ae: 7d a5 ldd r23, Y+45 ; 0x2d 105b0: 8e ef ldi r24, 0xFE ; 254 105b2: 9c e0 ldi r25, 0x0C ; 12 105b4: 0f 94 0d dc call 0x3b81a ; 0x3b81a 105b8: 4e a5 ldd r20, Y+46 ; 0x2e 105ba: 5f a5 ldd r21, Y+47 ; 0x2f 105bc: 68 a9 ldd r22, Y+48 ; 0x30 105be: 79 a9 ldd r23, Y+49 ; 0x31 105c0: 82 ea ldi r24, 0xA2 ; 162 105c2: 9c e0 ldi r25, 0x0C ; 12 105c4: 0f 94 0d dc call 0x3b81a ; 0x3b81a 105c8: 4a a9 ldd r20, Y+50 ; 0x32 105ca: 5b a9 ldd r21, Y+51 ; 0x33 105cc: 6c a9 ldd r22, Y+52 ; 0x34 105ce: 7d a9 ldd r23, Y+53 ; 0x35 105d0: 8e e9 ldi r24, 0x9E ; 158 105d2: 9c e0 ldi r25, 0x0C ; 12 105d4: 0f 94 0d dc call 0x3b81a ; 0x3b81a 105d8: 4e a9 ldd r20, Y+54 ; 0x36 105da: 5f a9 ldd r21, Y+55 ; 0x37 105dc: 68 ad ldd r22, Y+56 ; 0x38 105de: 79 ad ldd r23, Y+57 ; 0x39 105e0: 8a ef ldi r24, 0xFA ; 250 105e2: 9c e0 ldi r25, 0x0C ; 12 105e4: 0f 94 0d dc call 0x3b81a ; 0x3b81a 105e8: 4a ad ldd r20, Y+58 ; 0x3a 105ea: 5b ad ldd r21, Y+59 ; 0x3b 105ec: 6c ad ldd r22, Y+60 ; 0x3c 105ee: 7d ad ldd r23, Y+61 ; 0x3d 105f0: 8a e9 ldi r24, 0x9A ; 154 105f2: 9c e0 ldi r25, 0x0C ; 12 105f4: 0f 94 0d dc call 0x3b81a ; 0x3b81a if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 105f8: 6e ad ldd r22, Y+62 ; 0x3e 105fa: 7f ad ldd r23, Y+63 ; 0x3f 105fc: 88 e9 ldi r24, 0x98 ; 152 105fe: 9c e0 ldi r25, 0x0C ; 12 10600: 0f 94 19 dc call 0x3b832 ; 0x3b832 #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); 10604: 40 e4 ldi r20, 0x40 ; 64 10606: 50 e0 ldi r21, 0x00 ; 0 10608: 6a eb ldi r22, 0xBA ; 186 1060a: 7c e0 ldi r23, 0x0C ; 12 1060c: 8f ee ldi r24, 0xEF ; 239 1060e: 92 e1 ldi r25, 0x12 ; 18 10610: 0f 94 eb db call 0x3b7d6 ; 0x3b7d6 if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 10614: 40 91 2f 13 lds r20, 0x132F ; 0x80132f <_ZN13thermal_modelL4dataE.lto_priv.400+0x80> 10618: 50 91 30 13 lds r21, 0x1330 ; 0x801330 <_ZN13thermal_modelL4dataE.lto_priv.400+0x81> 1061c: 60 91 31 13 lds r22, 0x1331 ; 0x801331 <_ZN13thermal_modelL4dataE.lto_priv.400+0x82> 10620: 70 91 32 13 lds r23, 0x1332 ; 0x801332 <_ZN13thermal_modelL4dataE.lto_priv.400+0x83> 10624: 86 eb ldi r24, 0xB6 ; 182 10626: 9c e0 ldi r25, 0x0C ; 12 10628: 0f 94 0d dc call 0x3b81a ; 0x3b81a 1062c: 40 91 33 13 lds r20, 0x1333 ; 0x801333 <_ZN13thermal_modelL4dataE.lto_priv.400+0x84> 10630: 50 91 34 13 lds r21, 0x1334 ; 0x801334 <_ZN13thermal_modelL4dataE.lto_priv.400+0x85> 10634: 60 91 35 13 lds r22, 0x1335 ; 0x801335 <_ZN13thermal_modelL4dataE.lto_priv.400+0x86> 10638: 70 91 36 13 lds r23, 0x1336 ; 0x801336 <_ZN13thermal_modelL4dataE.lto_priv.400+0x87> 1063c: 82 eb ldi r24, 0xB2 ; 178 1063e: 9c e0 ldi r25, 0x0C ; 12 10640: 0f 94 0d dc call 0x3b81a ; 0x3b81a 10644: 40 91 37 13 lds r20, 0x1337 ; 0x801337 <_ZN13thermal_modelL4dataE.lto_priv.400+0x88> 10648: 50 91 38 13 lds r21, 0x1338 ; 0x801338 <_ZN13thermal_modelL4dataE.lto_priv.400+0x89> 1064c: 60 91 39 13 lds r22, 0x1339 ; 0x801339 <_ZN13thermal_modelL4dataE.lto_priv.400+0x8a> 10650: 70 91 3a 13 lds r23, 0x133A ; 0x80133a <_ZN13thermal_modelL4dataE.lto_priv.400+0x8b> 10654: 8e ea ldi r24, 0xAE ; 174 10656: 9c e0 ldi r25, 0x0C ; 12 10658: 0f 94 0d dc call 0x3b81a ; 0x3b81a 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; 1065c: 82 ef ldi r24, 0xF2 ; 242 1065e: 9b ea ldi r25, 0xAB ; 171 10660: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHOLNPGM("Settings Stored"); 10664: 8d ee ldi r24, 0xED ; 237 10666: 97 e7 ldi r25, 0x77 ; 119 } 10668: df 91 pop r29 1066a: cf 91 pop r28 #ifdef THERMAL_MODEL thermal_model_save_settings(); #endif SERIAL_ECHO_START; SERIAL_ECHOLNPGM("Settings Stored"); 1066c: 0c 94 93 79 jmp 0xf326 ; 0xf326 00010670 : { cmdbuffer_front_already_processed = true; } void get_command() { 10670: 2f 92 push r2 10672: 3f 92 push r3 10674: 4f 92 push r4 10676: 5f 92 push r5 10678: 6f 92 push r6 1067a: 7f 92 push r7 1067c: 8f 92 push r8 1067e: 9f 92 push r9 10680: af 92 push r10 10682: bf 92 push r11 10684: cf 92 push r12 10686: df 92 push r13 10688: ef 92 push r14 1068a: ff 92 push r15 1068c: 0f 93 push r16 1068e: 1f 93 push r17 10690: cf 93 push r28 10692: df 93 push r29 10694: cd b7 in r28, 0x3d ; 61 10696: de b7 in r29, 0x3e ; 62 10698: a2 97 sbiw r28, 0x22 ; 34 1069a: 0f b6 in r0, 0x3f ; 63 1069c: f8 94 cli 1069e: de bf out 0x3e, r29 ; 62 106a0: 0f be out 0x3f, r0 ; 63 106a2: cd bf out 0x3d, r28 ; 61 // Test and reserve space for the new command string. if (! cmdqueue_could_enqueue_back(MAX_CMD_SIZE - 1)) 106a4: 8f e5 ldi r24, 0x5F ; 95 106a6: 90 e0 ldi r25, 0x00 ; 0 106a8: 0e 94 5a 5c call 0xb8b4 ; 0xb8b4 106ac: 88 23 and r24, r24 106ae: 09 f4 brne .+2 ; 0x106b2 106b0: 91 c0 rjmp .+290 ; 0x107d4 return; if (MYSERIAL.available() == RX_BUFFER_SIZE - 1) { //compare number of chars buffered in rx buffer with rx buffer size 106b2: 0e 94 21 77 call 0xee42 ; 0xee42 106b6: 8f 37 cpi r24, 0x7F ; 127 106b8: 91 05 cpc r25, r1 106ba: 61 f4 brne .+24 ; 0x106d4 // 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; 106bc: 80 91 9a 04 lds r24, 0x049A ; 0x80049a 106c0: 90 91 9b 04 lds r25, 0x049B ; 0x80049b 106c4: 90 93 99 04 sts 0x0499, r25 ; 0x800499 106c8: 80 93 98 04 sts 0x0498, r24 ; 0x800498 MYSERIAL.flush(); SERIAL_ECHOLNPGM("Full RX Buffer"); //if buffer was full, there is danger that reading of last gcode will not be completed 106cc: 8e ed ldi r24, 0xDE ; 222 106ce: 97 e7 ldi r25, 0x77 ; 119 106d0: 0e 94 93 79 call 0xf326 ; 0xf326 106d4: 1e 01 movw r2, r28 106d6: 2f e1 ldi r18, 0x1F ; 31 106d8: 22 0e add r2, r18 106da: 31 1c adc r3, 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; 106dc: dd 24 eor r13, r13 106de: d3 94 inc r13 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 106e0: 0e 94 21 77 call 0xee42 ; 0xee42 106e4: 18 16 cp r1, r24 106e6: 19 06 cpc r1, r25 106e8: 0c f0 brlt .+2 ; 0x106ec 106ea: 68 c0 rjmp .+208 ; 0x107bc 106ec: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 106f0: 88 23 and r24, r24 106f2: 29 f0 breq .+10 ; 0x106fe 106f4: 0e 94 9d 67 call 0xcf3a ; 0xcf3a 106f8: 88 23 and r24, r24 106fa: 09 f4 brne .+2 ; 0x106fe 106fc: 5f c0 rjmp .+190 ; 0x107bc 106fe: 80 91 a4 03 lds r24, 0x03A4 ; 0x8003a4 10702: 81 11 cpse r24, r1 10704: 5b c0 rjmp .+182 ; 0x107bc #ifdef ENABLE_MEATPACK // MeatPack Changes // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - const int rec = MYSERIAL.read(); 10706: 0f 94 bf d5 call 0x3ab7e ; 0x3ab7e if (rec < 0) continue; 1070a: 97 fd sbrc r25, 7 1070c: e9 cf rjmp .-46 ; 0x106e0 mp_handle_rx_char((uint8_t)rec); 1070e: 28 2f mov r18, r24 //========================================================================== void mp_handle_rx_char(const uint8_t c) { // Check for commit complete // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (c == (uint8_t)(MeatPack_CommandByte)) { 10710: 8f 3f cpi r24, 0xFF ; 255 10712: 09 f0 breq .+2 ; 0x10716 10714: 7b c0 rjmp .+246 ; 0x1080c if (mp_cmd_count > 0) { 10716: 80 91 3e 03 lds r24, 0x033E ; 0x80033e 1071a: 88 23 and r24, r24 1071c: 09 f4 brne .+2 ; 0x10720 1071e: 73 c0 rjmp .+230 ; 0x10806 mp_cmd_active = 1; 10720: d0 92 3d 03 sts 0x033D, r13 ; 0x80033d mp_cmd_count = 0; 10724: 10 92 3e 03 sts 0x033E, r1 ; 0x80033e char c_res[2] = {0, 0}; 10728: 1f 8e std Y+31, r1 ; 0x1f 1072a: 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) { 1072c: c0 90 41 03 lds r12, 0x0341 ; 0x800341 10730: cc 20 and r12, r12 10732: b1 f2 breq .-84 ; 0x106e0 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]; 10734: 80 91 3f 03 lds r24, 0x033F ; 0x80033f 10738: 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) 1073a: 91 e0 ldi r25, 0x01 ; 1 1073c: 9c 15 cp r25, r12 1073e: 18 f4 brcc .+6 ; 0x10746 out[i] = (char)mp_char_out_buf[i]; 10740: 80 91 40 03 lds r24, 0x0340 ; 0x800340 10744: 88 a3 std Y+32, r24 ; 0x20 mp_char_out_count = 0; 10746: 10 92 41 03 sts 0x0341, r1 ; 0x800341 1074a: 3a a2 std Y+34, r3 ; 0x22 1074c: 29 a2 std Y+33, r2 ; 0x21 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]; 1074e: 89 a1 ldd r24, Y+33 ; 0x21 10750: 82 19 sub r24, r2 10752: 8c 15 cp r24, r12 10754: 28 f6 brcc .-118 ; 0x106e0 10756: e9 a1 ldd r30, Y+33 ; 0x21 10758: fa a1 ldd r31, Y+34 ; 0x22 1075a: 11 91 ld r17, Z+ 1075c: fa a3 std Y+34, r31 ; 0x22 1075e: e9 a3 std Y+33, r30 ; 0x21 #else char serial_char = MYSERIAL.read(); #endif serialTimeoutTimer.start(); 10760: 84 e4 ldi r24, 0x44 ; 68 10762: 93 e0 ldi r25, 0x03 ; 3 10764: 0f 94 83 29 call 0x25306 ; 0x25306 ::start()> if (serial_char < 0) 10768: 17 fd sbrc r17, 7 1076a: f1 cf rjmp .-30 ; 0x1074e 1076c: 80 91 9d 10 lds r24, 0x109D ; 0x80109d 10770: 90 91 9e 10 lds r25, 0x109E ; 0x80109e // 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' || 10774: 1a 30 cpi r17, 0x0A ; 10 10776: 09 f4 brne .+2 ; 0x1077a 10778: 4a c1 rjmp .+660 ; 0x10a0e 1077a: 1d 30 cpi r17, 0x0D ; 13 1077c: 09 f4 brne .+2 ; 0x10780 1077e: 47 c1 rjmp .+654 ; 0x10a0e serial_char == '\r' || 10780: 8f 35 cpi r24, 0x5F ; 95 10782: 91 05 cpc r25, r1 10784: 0c f0 brlt .+2 ; 0x10788 10786: 48 c1 rjmp .+656 ; 0x10a18 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; 10788: 1b 33 cpi r17, 0x3B ; 59 1078a: 11 f4 brne .+4 ; 0x10790 1078c: d0 92 43 03 sts 0x0343, r13 ; 0x800343 if(!comment_mode) cmdbuffer[bufindw+CMDHDRSIZE+serial_count++] = serial_char; 10790: 20 91 43 03 lds r18, 0x0343 ; 0x800343 10794: 21 11 cpse r18, r1 10796: db cf rjmp .-74 ; 0x1074e 10798: 9c 01 movw r18, r24 1079a: 2f 5f subi r18, 0xFF ; 255 1079c: 3f 4f sbci r19, 0xFF ; 255 1079e: 30 93 9e 10 sts 0x109E, r19 ; 0x80109e 107a2: 20 93 9d 10 sts 0x109D, r18 ; 0x80109d 107a6: 20 91 9f 10 lds r18, 0x109F ; 0x80109f <_ZL7bufindw.lto_priv.550> 107aa: 30 91 a0 10 lds r19, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.550+0x1> 107ae: 2c 55 subi r18, 0x5C ; 92 107b0: 3f 4e sbci r19, 0xEF ; 239 107b2: 82 0f add r24, r18 107b4: 93 1f adc r25, r19 107b6: fc 01 movw r30, r24 107b8: 13 83 std Z+3, r17 ; 0x03 107ba: c9 cf rjmp .-110 ; 0x1074e #ifdef ENABLE_MEATPACK } #endif } // end of serial line processing loop if (serial_count > 0 && serialTimeoutTimer.expired(farm_mode ? 800 : 2000)) { 107bc: 80 91 9d 10 lds r24, 0x109D ; 0x80109d 107c0: 90 91 9e 10 lds r25, 0x109E ; 0x80109e 107c4: 18 16 cp r1, r24 107c6: 19 06 cpc r1, r25 107c8: 0c f4 brge .+2 ; 0x107cc 107ca: 56 c2 rjmp .+1196 ; 0x10c78 SERIAL_ECHOLNPGM("RX timeout"); return; } #ifdef SDSUPPORT if(!card.sdprinting || !card.isFileOpen() || serial_count!=0){ 107cc: 80 91 8f 14 lds r24, 0x148F ; 0x80148f 107d0: 81 11 cpse r24, r1 107d2: 66 c2 rjmp .+1228 ; 0x10ca0 prusa_statistics(6); } } #endif //SDSUPPORT } 107d4: a2 96 adiw r28, 0x22 ; 34 107d6: 0f b6 in r0, 0x3f ; 63 107d8: f8 94 cli 107da: de bf out 0x3e, r29 ; 62 107dc: 0f be out 0x3f, r0 ; 63 107de: cd bf out 0x3d, r28 ; 61 107e0: df 91 pop r29 107e2: cf 91 pop r28 107e4: 1f 91 pop r17 107e6: 0f 91 pop r16 107e8: ff 90 pop r15 107ea: ef 90 pop r14 107ec: df 90 pop r13 107ee: cf 90 pop r12 107f0: bf 90 pop r11 107f2: af 90 pop r10 107f4: 9f 90 pop r9 107f6: 8f 90 pop r8 107f8: 7f 90 pop r7 107fa: 6f 90 pop r6 107fc: 5f 90 pop r5 107fe: 4f 90 pop r4 10800: 3f 90 pop r3 10802: 2f 90 pop r2 10804: 08 95 ret if (mp_cmd_count > 0) { mp_cmd_active = 1; mp_cmd_count = 0; } else ++mp_cmd_count; 10806: d0 92 3e 03 sts 0x033E, r13 ; 0x80033e 1080a: 8e cf rjmp .-228 ; 0x10728 return; } if (mp_cmd_active > 0) { 1080c: 30 91 3d 03 lds r19, 0x033D ; 0x80033d 10810: 33 23 and r19, r19 10812: 09 f4 brne .+2 ; 0x10816 10814: 57 c0 rjmp .+174 ; 0x108c4 } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { 10816: 89 3f cpi r24, 0xF9 ; 249 10818: 09 f4 brne .+2 ; 0x1081c 1081a: 3f c0 rjmp .+126 ; 0x1089a 1081c: 80 f5 brcc .+96 ; 0x1087e 1081e: 86 3f cpi r24, 0xF6 ; 246 10820: 09 f4 brne .+2 ; 0x10824 10822: 48 c0 rjmp .+144 ; 0x108b4 #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] RESET REC"); #endif } break; case MPCommand_EnableNoSpaces: { mp_config |= MPConfig_NoSpaces; 10824: 80 91 3c 03 lds r24, 0x033C ; 0x80033c 10828: 82 60 ori r24, 0x02 ; 2 } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { 1082a: 27 3f cpi r18, 0xF7 ; 247 1082c: 79 f1 breq .+94 ; 0x1088c 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. 1082e: 89 ea ldi r24, 0xA9 ; 169 10830: 97 e7 ldi r25, 0x77 ; 119 10832: 0e 94 68 77 call 0xeed0 ; 0xeed0 // 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); 10836: 84 ea ldi r24, 0xA4 ; 164 10838: 97 e7 ldi r25, 0x77 ; 119 1083a: 0e 94 68 77 call 0xeed0 ; 0xeed0 // Echo current state if (mp_config & MPConfig_Active) 1083e: 10 91 3c 03 lds r17, 0x033C ; 0x80033c SERIAL_ECHOPGM(" ON"); 10842: 80 ea ldi r24, 0xA0 ; 160 10844: 97 e7 ldi r25, 0x77 ; 119 // 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) 10846: 10 fd sbrc r17, 0 10848: 02 c0 rjmp .+4 ; 0x1084e SERIAL_ECHOPGM(" ON"); else SERIAL_ECHOPGM(" OFF"); 1084a: 8b e9 ldi r24, 0x9B ; 155 1084c: 97 e7 ldi r25, 0x77 ; 119 1084e: 0e 94 68 77 call 0xeed0 ; 0xeed0 if (mp_config & MPConfig_NoSpaces) 10852: 01 2f mov r16, r17 10854: 02 70 andi r16, 0x02 ; 2 SERIAL_ECHOPGM(" NSP"); // [N]o [SP]aces 10856: 86 e9 ldi r24, 0x96 ; 150 10858: 97 e7 ldi r25, 0x77 ; 119 if (mp_config & MPConfig_Active) SERIAL_ECHOPGM(" ON"); else SERIAL_ECHOPGM(" OFF"); if (mp_config & MPConfig_NoSpaces) 1085a: 11 fd sbrc r17, 1 1085c: 02 c0 rjmp .+4 ; 0x10862 SERIAL_ECHOPGM(" NSP"); // [N]o [SP]aces else SERIAL_ECHOPGM(" ESP"); // [E]nabled [SP]aces 1085e: 81 e9 ldi r24, 0x91 ; 145 10860: 97 e7 ldi r25, 0x77 ; 119 10862: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHOLNPGM(""); 10866: 80 e9 ldi r24, 0x90 ; 144 10868: 97 e7 ldi r25, 0x77 ; 119 1086a: 0e 94 93 79 call 0xf326 ; 0xf326 // Validate config vars #ifdef USE_LOOKUP_TABLE if (mp_config & MPConfig_NoSpaces) 1086e: 00 23 and r16, r16 10870: 29 f1 breq .+74 ; 0x108bc MeatPackLookupTbl[MeatPack_SpaceCharIdx] = (uint8_t)(MeatPack_SpaceCharReplace); 10872: 45 e4 ldi r20, 0x45 ; 69 10874: 40 93 0b 02 sts 0x020B, r20 ; 0x80020b <__DATA_REGION_ORIGIN__+0xb> return; } if (mp_cmd_active > 0) { mp_handle_cmd((MeatPack_Command)c); mp_cmd_active = 0; 10878: 10 92 3d 03 sts 0x033D, r1 ; 0x80033d 1087c: 55 cf rjmp .-342 ; 0x10728 } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { 1087e: 8a 3f cpi r24, 0xFA ; 250 10880: 41 f0 breq .+16 ; 0x10892 case MPCommand_EnablePacking: { mp_config |= MPConfig_Active; 10882: 80 91 3c 03 lds r24, 0x033C ; 0x80033c 10886: 81 60 ori r24, 0x01 ; 1 } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { 10888: 2b 3f cpi r18, 0xFB ; 251 1088a: 89 f6 brne .-94 ; 0x1082e #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL NSP"); #endif } break; case MPCommand_DisableNoSpaces: { mp_config &= ~(MPConfig_NoSpaces); 1088c: 80 93 3c 03 sts 0x033C, r24 ; 0x80033c 10890: ce cf rjmp .-100 ; 0x1082e #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL REC"); #endif } break; case MPCommand_DisablePacking: { mp_config &= ~(MPConfig_Active); 10892: 80 91 3c 03 lds r24, 0x033C ; 0x80033c 10896: 8e 7f andi r24, 0xFE ; 254 10898: f9 cf rjmp .-14 ; 0x1088c return out; } //============================================================================== void FORCE_INLINE mp_reset_state() { mp_char_out_count = 0; 1089a: 10 92 41 03 sts 0x0341, r1 ; 0x800341 mp_cmd_active = MPCommand_None; 1089e: 10 92 3d 03 sts 0x033D, r1 ; 0x80033d mp_config = MPConfig_None; 108a2: 10 92 3c 03 sts 0x033C, r1 ; 0x80033c mp_char_buf = 0; 108a6: 10 92 3b 03 sts 0x033B, r1 ; 0x80033b mp_cmd_count = 0; 108aa: 10 92 3e 03 sts 0x033E, r1 ; 0x80033e mp_cmd_active = 0; mp_full_char_queue = 0; 108ae: 10 92 3a 03 sts 0x033A, r1 ; 0x80033a 108b2: bd cf rjmp .-134 ; 0x1082e #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL NSP"); #endif } break; case MPCommand_DisableNoSpaces: { mp_config &= ~(MPConfig_NoSpaces); 108b4: 80 91 3c 03 lds r24, 0x033C ; 0x80033c 108b8: 8d 7f andi r24, 0xFD ; 253 108ba: e8 cf rjmp .-48 ; 0x1088c // Validate config vars #ifdef USE_LOOKUP_TABLE if (mp_config & MPConfig_NoSpaces) MeatPackLookupTbl[MeatPack_SpaceCharIdx] = (uint8_t)(MeatPack_SpaceCharReplace); else MeatPackLookupTbl[MeatPack_SpaceCharIdx] = ' '; 108bc: 50 e2 ldi r21, 0x20 ; 32 108be: 50 93 0b 02 sts 0x020B, r21 ; 0x80020b <__DATA_REGION_ORIGIN__+0xb> 108c2: da cf rjmp .-76 ; 0x10878 mp_handle_cmd((MeatPack_Command)c); mp_cmd_active = 0; return; } if (mp_cmd_count > 0) { 108c4: 20 91 3e 03 lds r18, 0x033E ; 0x80033e 108c8: 40 91 3c 03 lds r20, 0x033C ; 0x80033c 108cc: 22 23 and r18, r18 108ce: 31 f1 breq .+76 ; 0x1091c 108d0: e0 91 41 03 lds r30, 0x0341 ; 0x800341 //========================================================================== 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) { 108d4: 40 ff sbrs r20, 0 108d6: 49 c0 rjmp .+146 ; 0x1096a if (mp_full_char_queue > 0) { 108d8: 30 91 3a 03 lds r19, 0x033A ; 0x80033a 108dc: 33 23 and r19, r19 108de: 09 f4 brne .+2 ; 0x108e2 108e0: 40 c0 rjmp .+128 ; 0x10962 #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; 108e2: 21 e0 ldi r18, 0x01 ; 1 108e4: 2e 0f add r18, r30 108e6: 20 93 41 03 sts 0x0341, r18 ; 0x800341 108ea: ae 2f mov r26, r30 108ec: b0 e0 ldi r27, 0x00 ; 0 108ee: a1 5c subi r26, 0xC1 ; 193 108f0: bc 4f sbci r27, 0xFC ; 252 108f2: ff ef ldi r31, 0xFF ; 255 108f4: 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) { 108f6: 50 91 3b 03 lds r21, 0x033B ; 0x80033b 108fa: 55 23 and r21, r21 108fc: 51 f0 breq .+20 ; 0x10912 #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; 108fe: ee 5f subi r30, 0xFE ; 254 10900: e0 93 41 03 sts 0x0341, r30 ; 0x800341 10904: e2 2f mov r30, r18 10906: f0 e0 ldi r31, 0x00 ; 0 10908: e1 5c subi r30, 0xC1 ; 193 1090a: fc 4f sbci r31, 0xFC ; 252 1090c: 50 83 st Z, r21 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; 1090e: 10 92 3b 03 sts 0x033B, r1 ; 0x80033b } --mp_full_char_queue; 10912: 31 50 subi r19, 0x01 ; 1 10914: 30 93 3a 03 sts 0x033A, r19 ; 0x80033a return; } if (mp_cmd_count > 0) { mp_handle_rx_char_inner((uint8_t)(MeatPack_CommandByte)); mp_cmd_count = 0; 10918: 10 92 3e 03 sts 0x033E, r1 ; 0x80033e 1091c: e0 91 41 03 lds r30, 0x0341 ; 0x800341 //========================================================================== 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) { 10920: 40 ff sbrs r20, 0 10922: 6c c0 rjmp .+216 ; 0x109fc if (mp_full_char_queue > 0) { 10924: 20 91 3a 03 lds r18, 0x033A ; 0x80033a 10928: 22 23 and r18, r18 1092a: 49 f1 breq .+82 ; 0x1097e #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; 1092c: 91 e0 ldi r25, 0x01 ; 1 1092e: 9e 0f add r25, r30 10930: 90 93 41 03 sts 0x0341, r25 ; 0x800341 10934: ae 2f mov r26, r30 10936: b0 e0 ldi r27, 0x00 ; 0 10938: a1 5c subi r26, 0xC1 ; 193 1093a: bc 4f sbci r27, 0xFC ; 252 1093c: 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) { 1093e: 80 91 3b 03 lds r24, 0x033B ; 0x80033b 10942: 88 23 and r24, r24 10944: 51 f0 breq .+20 ; 0x1095a #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; 10946: ee 5f subi r30, 0xFE ; 254 10948: e0 93 41 03 sts 0x0341, r30 ; 0x800341 1094c: e9 2f mov r30, r25 1094e: f0 e0 ldi r31, 0x00 ; 0 10950: e1 5c subi r30, 0xC1 ; 193 10952: fc 4f sbci r31, 0xFC ; 252 10954: 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; 10956: 10 92 3b 03 sts 0x033B, r1 ; 0x80033b } --mp_full_char_queue; 1095a: 21 50 subi r18, 0x01 ; 1 1095c: 20 93 3a 03 sts 0x033A, r18 ; 0x80033a 10960: e3 ce rjmp .-570 ; 0x10728 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; 10962: 22 e0 ldi r18, 0x02 ; 2 10964: 20 93 3a 03 sts 0x033A, r18 ; 0x80033a 10968: d7 cf rjmp .-82 ; 0x10918 #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; 1096a: 21 e0 ldi r18, 0x01 ; 1 1096c: 2e 0f add r18, r30 1096e: 20 93 41 03 sts 0x0341, r18 ; 0x800341 10972: f0 e0 ldi r31, 0x00 ; 0 10974: e1 5c subi r30, 0xC1 ; 193 10976: fc 4f sbci r31, 0xFC ; 252 10978: 5f ef ldi r21, 0xFF ; 255 1097a: 50 83 st Z, r21 1097c: cd cf rjmp .-102 ; 0x10918 1097e: a8 2f mov r26, r24 10980: af 70 andi r26, 0x0F ; 15 mp_char_buf = 0; } --mp_full_char_queue; } else { uint8_t buf[2] = { 0,0 }; 10982: 40 e0 ldi r20, 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; 10984: 31 e0 ldi r19, 0x01 ; 1 10986: af 30 cpi r26, 0x0F ; 15 10988: 29 f0 breq .+10 ; 0x10994 1098a: b0 e0 ldi r27, 0x00 ; 0 else chars_out[0] = MeatPackLookupTbl[(pk & 0xF)]; // Assign lower char 1098c: a0 50 subi r26, 0x00 ; 0 1098e: be 4f sbci r27, 0xFE ; 254 10990: 4c 91 ld r20, 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; 10992: 30 e0 ldi r19, 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; 10994: 58 2f mov r21, r24 10996: 50 7f andi r21, 0xF0 ; 240 10998: 50 3f cpi r21, 0xF0 ; 240 1099a: 59 f4 brne .+22 ; 0x109b2 1099c: 32 60 ori r19, 0x02 ; 2 } else { uint8_t buf[2] = { 0,0 }; const uint8_t res = mp_unpack_chars(c, buf); if (res & MeatPack_NextPackedFirst) { 1099e: 30 ff sbrs r19, 0 109a0: 13 c0 rjmp .+38 ; 0x109c8 ++mp_full_char_queue; 109a2: d0 92 3a 03 sts 0x033A, r13 ; 0x80033a if (res & MeatPack_NextPackedSecond) ++mp_full_char_queue; 109a6: 31 ff sbrs r19, 1 109a8: 0c c0 rjmp .+24 ; 0x109c2 109aa: 82 e0 ldi r24, 0x02 ; 2 109ac: 80 93 3a 03 sts 0x033A, r24 ; 0x80033a 109b0: bb ce rjmp .-650 ; 0x10728 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 109b2: 82 95 swap r24 109b4: 8f 70 andi r24, 0x0F ; 15 109b6: a8 2f mov r26, r24 109b8: b0 e0 ldi r27, 0x00 ; 0 109ba: a0 50 subi r26, 0x00 ; 0 109bc: be 4f sbci r27, 0xFE ; 254 109be: 2c 91 ld r18, X 109c0: ee cf rjmp .-36 ; 0x1099e 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]; 109c2: 20 93 3b 03 sts 0x033B, r18 ; 0x80033b 109c6: b0 ce rjmp .-672 ; 0x10728 #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; 109c8: 81 e0 ldi r24, 0x01 ; 1 109ca: 8e 0f add r24, r30 109cc: 80 93 41 03 sts 0x0341, r24 ; 0x800341 109d0: ae 2f mov r26, r30 109d2: b0 e0 ldi r27, 0x00 ; 0 109d4: a1 5c subi r26, 0xC1 ; 193 109d6: bc 4f sbci r27, 0xFC ; 252 109d8: 4c 93 st X, r20 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') { 109da: 4a 30 cpi r20, 0x0A ; 10 109dc: 09 f4 brne .+2 ; 0x109e0 109de: a4 ce rjmp .-696 ; 0x10728 if (res & MeatPack_NextPackedSecond) ++mp_full_char_queue; 109e0: 31 ff sbrs r19, 1 109e2: 03 c0 rjmp .+6 ; 0x109ea 109e4: d0 92 3a 03 sts 0x033A, r13 ; 0x80033a 109e8: 9f ce rjmp .-706 ; 0x10728 #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; 109ea: ee 5f subi r30, 0xFE ; 254 109ec: e0 93 41 03 sts 0x0341, r30 ; 0x800341 109f0: e8 2f mov r30, r24 109f2: f0 e0 ldi r31, 0x00 ; 0 109f4: e1 5c subi r30, 0xC1 ; 193 109f6: fc 4f sbci r31, 0xFC ; 252 109f8: 20 83 st Z, r18 109fa: 96 ce rjmp .-724 ; 0x10728 109fc: 91 e0 ldi r25, 0x01 ; 1 109fe: 9e 0f add r25, r30 10a00: 90 93 41 03 sts 0x0341, r25 ; 0x800341 10a04: f0 e0 ldi r31, 0x00 ; 0 10a06: e1 5c subi r30, 0xC1 ; 193 10a08: fc 4f sbci r31, 0xFC ; 252 10a0a: 80 83 st Z, r24 10a0c: 8d ce rjmp .-742 ; 0x10728 continue; if(serial_char == '\n' || serial_char == '\r' || serial_count >= (MAX_CMD_SIZE - 1) ) { if(!serial_count) { //if empty line 10a0e: 00 97 sbiw r24, 0x00 ; 0 10a10: 19 f4 brne .+6 ; 0x10a18 comment_mode = false; //for new command 10a12: 10 92 43 03 sts 0x0343, r1 ; 0x800343 10a16: de ce rjmp .-580 ; 0x107d4 10a18: 00 91 9f 10 lds r16, 0x109F ; 0x80109f <_ZL7bufindw.lto_priv.550> 10a1c: 10 91 a0 10 lds r17, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.550+0x1> return; } cmdbuffer[bufindw+serial_count+CMDHDRSIZE] = 0; // terminate string 10a20: 09 55 subi r16, 0x59 ; 89 10a22: 1f 4e sbci r17, 0xEF ; 239 10a24: 80 0f add r24, r16 10a26: 91 1f adc r25, r17 10a28: fc 01 movw r30, r24 10a2a: 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) 10a2c: 1a 83 std Y+2, r17 ; 0x02 10a2e: 09 83 std Y+1, r16 ; 0x01 if(!comment_mode){ 10a30: 80 91 43 03 lds r24, 0x0343 ; 0x800343 10a34: 81 11 cpse r24, r1 10a36: 03 c1 rjmp .+518 ; 0x10c3e long gcode_N = -1; // seen line number // Line numbers must be first in buffer if (*cmd_head == 'N') { 10a38: f8 01 movw r30, r16 10a3a: 80 81 ld r24, Z 10a3c: 8e 34 cpi r24, 0x4E ; 78 10a3e: 09 f0 breq .+2 ; 0x10a42 10a40: 8a c0 rjmp .+276 ; 0x10b56 // Line number met: decode the number, then move cmd_start past all spaces. gcode_N = (strtol(cmd_head+1, &cmd_start, 10)); 10a42: 4a e0 ldi r20, 0x0A ; 10 10a44: 50 e0 ldi r21, 0x00 ; 0 10a46: be 01 movw r22, r28 10a48: 6f 5f subi r22, 0xFF ; 255 10a4a: 7f 4f sbci r23, 0xFF ; 255 10a4c: c8 01 movw r24, r16 10a4e: 01 96 adiw r24, 0x01 ; 1 10a50: 0f 94 62 d7 call 0x3aec4 ; 0x3aec4 10a54: 2b 01 movw r4, r22 10a56: 3c 01 movw r6, r24 while (*cmd_start == ' ') ++cmd_start; 10a58: e9 80 ldd r14, Y+1 ; 0x01 10a5a: fa 80 ldd r15, Y+2 ; 0x02 10a5c: f7 01 movw r30, r14 10a5e: 80 81 ld r24, Z 10a60: 80 32 cpi r24, 0x20 ; 32 10a62: 31 f4 brne .+12 ; 0x10a70 10a64: ff ef ldi r31, 0xFF ; 255 10a66: ef 1a sub r14, r31 10a68: ff 0a sbc r15, r31 10a6a: fa 82 std Y+2, r15 ; 0x02 10a6c: e9 82 std Y+1, r14 ; 0x01 10a6e: f4 cf rjmp .-24 ; 0x10a58 // 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)) { 10a70: 80 90 78 03 lds r8, 0x0378 ; 0x800378 10a74: 90 90 79 03 lds r9, 0x0379 ; 0x800379 10a78: a0 90 7a 03 lds r10, 0x037A ; 0x80037a 10a7c: b0 90 7b 03 lds r11, 0x037B ; 0x80037b 10a80: d5 01 movw r26, r10 10a82: c4 01 movw r24, r8 10a84: 01 96 adiw r24, 0x01 ; 1 10a86: a1 1d adc r26, r1 10a88: b1 1d adc r27, r1 10a8a: 84 15 cp r24, r4 10a8c: 95 05 cpc r25, r5 10a8e: a6 05 cpc r26, r6 10a90: b7 05 cpc r27, r7 10a92: 49 f0 breq .+18 ; 0x10aa6 10a94: 44 e0 ldi r20, 0x04 ; 4 10a96: 50 e0 ldi r21, 0x00 ; 0 10a98: 69 ed ldi r22, 0xD9 ; 217 10a9a: 77 e7 ldi r23, 0x77 ; 119 10a9c: c7 01 movw r24, r14 10a9e: 0f 94 b6 d9 call 0x3b36c ; 0x3b36c 10aa2: 89 2b or r24, r25 10aa4: a1 f4 brne .+40 ; 0x10ace FlushSerialRequestResend(); serial_count = 0; return; } if((strchr_pointer = strchr(cmd_start, '*')) != NULL) 10aa6: 6a e2 ldi r22, 0x2A ; 42 10aa8: 70 e0 ldi r23, 0x00 ; 0 10aaa: c7 01 movw r24, r14 10aac: 0f 94 2e e2 call 0x3c45c ; 0x3c45c 10ab0: 90 93 94 03 sts 0x0394, r25 ; 0x800394 10ab4: 80 93 93 03 sts 0x0393, r24 ; 0x800393 10ab8: 00 97 sbiw r24, 0x00 ; 0 10aba: 09 f4 brne .+2 ; 0x10abe 10abc: 45 c0 rjmp .+138 ; 0x10b48 10abe: f8 01 movw r30, r16 { byte checksum = 0; 10ac0: f1 2c mov r15, r1 char *p = cmd_head; while (p != strchr_pointer) 10ac2: e8 17 cp r30, r24 10ac4: f9 07 cpc r31, r25 10ac6: 71 f0 breq .+28 ; 0x10ae4 checksum = checksum^(*p++); 10ac8: 21 91 ld r18, Z+ 10aca: f2 26 eor r15, r18 10acc: fa cf rjmp .-12 ; 0x10ac2 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; 10ace: 8a ec ldi r24, 0xCA ; 202 10ad0: 9b ea ldi r25, 0xAB ; 171 10ad2: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ERRORRPGM(_n("Line Number is not Last Line Number+1, Last Line: "));////MSG_ERR_LINE_NO 10ad6: 84 e8 ldi r24, 0x84 ; 132 10ad8: 95 e6 ldi r25, 0x65 ; 101 *strchr_pointer = 0; } else { SERIAL_ERROR_START; SERIAL_ERRORRPGM(_n("No Checksum with line number, Last Line: "));////MSG_ERR_NO_CHECKSUM 10ada: 0e 94 68 77 call 0xeed0 ; 0xeed0 10ade: c5 01 movw r24, r10 10ae0: b4 01 movw r22, r8 10ae2: 15 c0 rjmp .+42 ; 0x10b0e { byte checksum = 0; char *p = cmd_head; while (p != strchr_pointer) checksum = checksum^(*p++); if (code_value_short() != (int16_t)checksum) { 10ae4: 0e 94 8d 5b call 0xb71a ; 0xb71a 10ae8: f8 16 cp r15, r24 10aea: 19 06 cpc r1, r25 10aec: d9 f0 breq .+54 ; 0x10b24 SERIAL_ERROR_START; 10aee: 8a ec ldi r24, 0xCA ; 202 10af0: 9b ea ldi r25, 0xAB ; 171 10af2: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ERRORRPGM(_n("checksum mismatch, Last Line: "));////MSG_ERR_CHECKSUM_MISMATCH 10af6: 85 e6 ldi r24, 0x65 ; 101 10af8: 95 e6 ldi r25, 0x65 ; 101 10afa: 0e 94 68 77 call 0xeed0 ; 0xeed0 10afe: 60 91 78 03 lds r22, 0x0378 ; 0x800378 10b02: 70 91 79 03 lds r23, 0x0379 ; 0x800379 10b06: 80 91 7a 03 lds r24, 0x037A ; 0x80037a 10b0a: 90 91 7b 03 lds r25, 0x037B ; 0x80037b 10b0e: 0f 94 26 d5 call 0x3aa4c ; 0x3aa4c } void MarlinSerial::println(long n, int base) { print(n, base); println(); 10b12: 0f 94 b8 d5 call 0x3ab70 ; 0x3ab70 SERIAL_ERRORLN(gcode_LastN); FlushSerialRequestResend(); 10b16: 0e 94 a5 5b call 0xb74a ; 0xb74a serial_count = 0; 10b1a: 10 92 9e 10 sts 0x109E, r1 ; 0x80109e 10b1e: 10 92 9d 10 sts 0x109D, r1 ; 0x80109d 10b22: 58 ce rjmp .-848 ; 0x107d4 return; } // If no errors, remove the checksum and continue parsing. *strchr_pointer = 0; 10b24: e0 91 93 03 lds r30, 0x0393 ; 0x800393 10b28: f0 91 94 03 lds r31, 0x0394 ; 0x800394 10b2c: 10 82 st Z, r1 return; } } // Handle KILL early, even when Stopped if(strcmp_P(cmd_start, PSTR("M112")) == 0) 10b2e: e9 80 ldd r14, Y+1 ; 0x01 10b30: fa 80 ldd r15, Y+2 ; 0x02 10b32: 64 ed ldi r22, 0xD4 ; 212 10b34: 77 e7 ldi r23, 0x77 ; 119 10b36: c7 01 movw r24, r14 10b38: 0f 94 85 d9 call 0x3b30a ; 0x3b30a 10b3c: 89 2b or r24, r25 10b3e: 39 f5 brne .+78 ; 0x10b8e kill(MSG_M112_KILL); 10b40: 8f e9 ldi r24, 0x9F ; 159 10b42: 98 e6 ldi r25, 0x68 ; 104 10b44: 0e 94 22 7a call 0xf444 ; 0xf444 // If no errors, remove the checksum and continue parsing. *strchr_pointer = 0; } else { SERIAL_ERROR_START; 10b48: 8a ec ldi r24, 0xCA ; 202 10b4a: 9b ea ldi r25, 0xAB ; 171 10b4c: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ERRORRPGM(_n("No Checksum with line number, Last Line: "));////MSG_ERR_NO_CHECKSUM 10b50: 8b e3 ldi r24, 0x3B ; 59 10b52: 95 e6 ldi r25, 0x65 ; 101 10b54: c2 cf rjmp .-124 ; 0x10ada } } else { // move cmd_start past all spaces while (*cmd_start == ' ') ++cmd_start; 10b56: 89 81 ldd r24, Y+1 ; 0x01 10b58: 9a 81 ldd r25, Y+2 ; 0x02 10b5a: fc 01 movw r30, r24 10b5c: 20 81 ld r18, Z 10b5e: 20 32 cpi r18, 0x20 ; 32 10b60: 21 f4 brne .+8 ; 0x10b6a 10b62: 01 96 adiw r24, 0x01 ; 1 10b64: 9a 83 std Y+2, r25 ; 0x02 10b66: 89 83 std Y+1, r24 ; 0x01 10b68: f6 cf rjmp .-20 ; 0x10b56 // if we didn't receive 'N' but still see '*' if (strchr(cmd_start, '*') != NULL) 10b6a: 6a e2 ldi r22, 0x2A ; 42 10b6c: 70 e0 ldi r23, 0x00 ; 0 10b6e: 0f 94 2e e2 call 0x3c45c ; 0x3c45c 10b72: 89 2b or r24, r25 10b74: 39 f0 breq .+14 ; 0x10b84 { SERIAL_ERROR_START; 10b76: 8a ec ldi r24, 0xCA ; 202 10b78: 9b ea ldi r25, 0xAB ; 171 10b7a: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ERRORRPGM(_n("No Line Number with checksum, Last Line: "));////MSG_ERR_NO_LINENUMBER_WITH_CHECKSUM 10b7e: 81 e1 ldi r24, 0x11 ; 17 10b80: 95 e6 ldi r25, 0x65 ; 101 10b82: bb cf rjmp .-138 ; 0x10afa 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 10b84: 44 24 eor r4, r4 10b86: 4a 94 dec r4 10b88: 54 2c mov r5, r4 10b8a: 32 01 movw r6, r4 10b8c: d0 cf rjmp .-96 ; 0x10b2e 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) 10b8e: 44 e0 ldi r20, 0x04 ; 4 10b90: 50 e0 ldi r21, 0x00 ; 0 10b92: 6f ec ldi r22, 0xCF ; 207 10b94: 77 e7 ldi r23, 0x77 ; 119 10b96: c7 01 movw r24, r14 10b98: 0f 94 b6 d9 call 0x3b36c ; 0x3b36c 10b9c: 5c 01 movw r10, r24 allow_when_stopped = true; // Handle the USB timer if ((*cmd_start == 'G') && (GetPrinterState() != PrinterState::IsSDPrinting)) { 10b9e: f7 01 movw r30, r14 10ba0: 80 81 ld r24, Z 10ba2: 87 34 cpi r24, 0x47 ; 71 10ba4: 81 f4 brne .+32 ; 0x10bc6 10ba6: 80 91 b7 0d lds r24, 0x0DB7 ; 0x800db7 <_ZL13printer_state.lto_priv.401> 10baa: 85 30 cpi r24, 0x05 ; 5 10bac: 61 f0 breq .+24 ; 0x10bc6 usb_timer.start(); 10bae: 8d e0 ldi r24, 0x0D ; 13 10bb0: 95 e0 ldi r25, 0x05 ; 5 10bb2: 0f 94 83 29 call 0x25306 ; 0x25306 ::start()> PrinterState GetPrinterState() { return printer_state; } PrinterState SetPrinterState(PrinterState status) { return printer_state = status; 10bb6: f6 e0 ldi r31, 0x06 ; 6 10bb8: f0 93 b7 0d sts 0x0DB7, r31 ; 0x800db7 <_ZL13printer_state.lto_priv.401> if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 10bbc: 60 e0 ldi r22, 0x00 ; 0 10bbe: 85 ea ldi r24, 0xA5 ; 165 10bc0: 9f e0 ldi r25, 0x0F ; 15 10bc2: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 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) { 10bc6: ab 28 or r10, r11 10bc8: 21 f0 breq .+8 ; 0x10bd2 10bca: 80 91 10 05 lds r24, 0x0510 ; 0x800510 10bce: 81 11 cpse r24, r1 10bd0: a4 cf rjmp .-184 ; 0x10b1a } // 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; 10bd2: 26 e0 ldi r18, 0x06 ; 6 10bd4: 77 fc sbrc r7, 7 10bd6: 21 e0 ldi r18, 0x01 ; 1 10bd8: 80 91 9f 10 lds r24, 0x109F ; 0x80109f <_ZL7bufindw.lto_priv.550> 10bdc: 90 91 a0 10 lds r25, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.550+0x1> 10be0: fc 01 movw r30, r24 10be2: ec 55 subi r30, 0x5C ; 92 10be4: ff 4e sbci r31, 0xEF ; 239 10be6: 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) 10be8: 49 81 ldd r20, Y+1 ; 0x01 10bea: 5a 81 ldd r21, Y+2 ; 0x02 cmd_len = strlen(cmd_start) + 1; 10bec: 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) 10bee: da 01 movw r26, r20 10bf0: 40 17 cp r20, r16 10bf2: 51 07 cpc r21, r17 10bf4: a1 f5 brne .+104 ; 0x10c5e cmd_len = strlen(cmd_start) + 1; 10bf6: 01 90 ld r0, Z+ 10bf8: 00 20 and r0, r0 10bfa: e9 f7 brne .-6 ; 0x10bf6 10bfc: 9f 01 movw r18, r30 10bfe: 20 1b sub r18, r16 10c00: 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; 10c02: 03 96 adiw r24, 0x03 ; 3 10c04: 28 0f add r18, r24 10c06: 39 1f adc r19, r25 if (bufindw == sizeof(cmdbuffer)) 10c08: 2d 3e cpi r18, 0xED ; 237 10c0a: f1 e0 ldi r31, 0x01 ; 1 10c0c: 3f 07 cpc r19, r31 10c0e: 79 f1 breq .+94 ; 0x10c6e // 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; 10c10: 30 93 a0 10 sts 0x10A0, r19 ; 0x8010a0 <_ZL7bufindw.lto_priv.550+0x1> 10c14: 20 93 9f 10 sts 0x109F, r18 ; 0x80109f <_ZL7bufindw.lto_priv.550> if (bufindw == sizeof(cmdbuffer)) bufindw = 0; ++ buflen; 10c18: 80 91 a2 10 lds r24, 0x10A2 ; 0x8010a2 10c1c: 90 91 a3 10 lds r25, 0x10A3 ; 0x8010a3 10c20: 01 96 adiw r24, 0x01 ; 1 10c22: 90 93 a3 10 sts 0x10A3, r25 ; 0x8010a3 10c26: 80 93 a2 10 sts 0x10A2, r24 ; 0x8010a2 // Update the processed gcode line if (gcode_N >= 0) 10c2a: 77 fc sbrc r7, 7 10c2c: 08 c0 rjmp .+16 ; 0x10c3e gcode_LastN = gcode_N; 10c2e: 40 92 78 03 sts 0x0378, r4 ; 0x800378 10c32: 50 92 79 03 sts 0x0379, r5 ; 0x800379 10c36: 60 92 7a 03 sts 0x037A, r6 ; 0x80037a 10c3a: 70 92 7b 03 sts 0x037B, r7 ; 0x80037b 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 10c3e: 10 92 9e 10 sts 0x109E, r1 ; 0x80109e 10c42: 10 92 9d 10 sts 0x109D, r1 ; 0x80109d // 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)) 10c46: 0e 94 21 77 call 0xee42 ; 0xee42 10c4a: 89 2b or r24, r25 10c4c: 09 f4 brne .+2 ; 0x10c50 10c4e: c2 cd rjmp .-1148 ; 0x107d4 10c50: 8f e5 ldi r24, 0x5F ; 95 10c52: 90 e0 ldi r25, 0x00 ; 0 10c54: 0e 94 5a 5c call 0xb8b4 ; 0xb8b4 10c58: 81 11 cpse r24, r1 10c5a: 79 cd rjmp .-1294 ; 0x1074e 10c5c: bb cd rjmp .-1162 ; 0x107d4 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]; } 10c5e: 6d 91 ld r22, X+ 10c60: 61 93 st Z+, r22 10c62: 9d 01 movw r18, r26 10c64: 24 1b sub r18, r20 10c66: 35 0b sbc r19, r21 while (cmd_head[cmd_len++]); 10c68: 61 11 cpse r22, r1 10c6a: f9 cf rjmp .-14 ; 0x10c5e 10c6c: ca cf rjmp .-108 ; 0x10c02 } bufindw += cmd_len + CMDHDRSIZE; if (bufindw == sizeof(cmdbuffer)) bufindw = 0; 10c6e: 10 92 a0 10 sts 0x10A0, r1 ; 0x8010a0 <_ZL7bufindw.lto_priv.550+0x1> 10c72: 10 92 9f 10 sts 0x109F, r1 ; 0x80109f <_ZL7bufindw.lto_priv.550> 10c76: d0 cf rjmp .-96 ; 0x10c18 #ifdef ENABLE_MEATPACK } #endif } // end of serial line processing loop if (serial_count > 0 && serialTimeoutTimer.expired(farm_mode ? 800 : 2000)) { 10c78: 60 ed ldi r22, 0xD0 ; 208 10c7a: 77 e0 ldi r23, 0x07 ; 7 10c7c: 84 e4 ldi r24, 0x44 ; 68 10c7e: 93 e0 ldi r25, 0x03 ; 3 10c80: 0f 94 54 29 call 0x252a8 ; 0x252a8 ::expired(unsigned short)> 10c84: 88 23 and r24, r24 10c86: 09 f4 brne .+2 ; 0x10c8a 10c88: a1 cd rjmp .-1214 ; 0x107cc comment_mode = false; 10c8a: 10 92 43 03 sts 0x0343, r1 ; 0x800343 serial_count = 0; 10c8e: 10 92 9e 10 sts 0x109E, r1 ; 0x80109e 10c92: 10 92 9d 10 sts 0x109D, r1 ; 0x80109d SERIAL_ECHOLNPGM("RX timeout"); 10c96: 84 ec ldi r24, 0xC4 ; 196 10c98: 97 e7 ldi r25, 0x77 ; 119 10c9a: 0e 94 93 79 call 0xf326 ; 0xf326 10c9e: 9a cd rjmp .-1228 ; 0x107d4 return; } #ifdef SDSUPPORT if(!card.sdprinting || !card.isFileOpen() || serial_count!=0){ 10ca0: 80 91 22 17 lds r24, 0x1722 ; 0x801722 10ca4: 88 23 and r24, r24 10ca6: 09 f4 brne .+2 ; 0x10caa 10ca8: 95 cd rjmp .-1238 ; 0x107d4 10caa: 80 91 9d 10 lds r24, 0x109D ; 0x80109d 10cae: 90 91 9e 10 lds r25, 0x109E ; 0x80109e 10cb2: 89 2b or r24, r25 10cb4: 09 f0 breq .+2 ; 0x10cb8 10cb6: 8e cd rjmp .-1252 ; 0x107d4 //'#' 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; 10cb8: 80 91 a2 10 lds r24, 0x10A2 ; 0x8010a2 10cbc: 90 91 a3 10 lds r25, 0x10A3 ; 0x8010a3 10cc0: 89 2b or r24, r25 10cc2: 11 f4 brne .+4 ; 0x10cc8 10cc4: 10 92 42 03 sts 0x0342, r1 ; 0x800342 } eof_or_fail: // make the rdptr point to a safe location - end of file gfReadPtr = gfBlockBuffBegin() + 512; 10cc8: 2c e9 ldi r18, 0x9C ; 156 10cca: e2 2e mov r14, r18 10ccc: 20 e1 ldi r18, 0x10 ; 16 10cce: f2 2e mov r15, r18 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; 10cd0: 32 e0 ldi r19, 0x02 ; 2 10cd2: d3 2e mov r13, r19 || serial_char == '#' || serial_count >= (MAX_CMD_SIZE - 1) || n==-1 ){ if(serial_char=='#') stop_buffering=true; 10cd4: cc 24 eor r12, r12 10cd6: c3 94 inc r12 } 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) { 10cd8: 40 91 a3 17 lds r20, 0x17A3 ; 0x8017a3 10cdc: 50 91 a4 17 lds r21, 0x17A4 ; 0x8017a4 10ce0: 60 91 a5 17 lds r22, 0x17A5 ; 0x8017a5 10ce4: 70 91 a6 17 lds r23, 0x17A6 ; 0x8017a6 10ce8: 80 91 9c 17 lds r24, 0x179C ; 0x80179c 10cec: 90 91 9d 17 lds r25, 0x179D ; 0x80179d 10cf0: a0 91 9e 17 lds r26, 0x179E ; 0x80179e 10cf4: b0 91 9f 17 lds r27, 0x179F ; 0x80179f 10cf8: 48 17 cp r20, r24 10cfa: 59 07 cpc r21, r25 10cfc: 6a 07 cpc r22, r26 10cfe: 7b 07 cpc r23, r27 10d00: 08 f0 brcs .+2 ; 0x10d04 10d02: 2f c1 rjmp .+606 ; 0x10f62 10d04: 80 91 42 03 lds r24, 0x0342 ; 0x800342 10d08: 81 11 cpse r24, r1 10d0a: 2b c1 rjmp .+598 ; 0x10f62 : "r22" /* modifying register R22 - so that the compiler knows */ \ ) // avoid calling the default heavy-weight read() for just one byte int16_t SdFile::readFilteredGcode(){ if( ! gfEnsureBlock() ){ 10d0c: 0f 94 3e 7a call 0x2f47c ; 0x2f47c 10d10: 88 23 and r24, r24 10d12: 49 f1 breq .+82 ; 0x10d66 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; 10d14: 20 91 3a 17 lds r18, 0x173A ; 0x80173a 10d18: 30 91 3b 17 lds r19, 0x173B ; 0x80173b // 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; 10d1c: 89 01 movw r16, 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; 10d1e: 9b ef ldi r25, 0xFB ; 251 10d20: b9 2e mov r11, r25 // the same applies to gfXBegin, codesize dropped another 100B! const uint8_t *blockBuffBegin = gfBlockBuffBegin(); uint8_t consecutiveCommentLines = 0; while( *rdPtr == ';' ){ 10d22: f8 01 movw r30, r16 10d24: 80 81 ld r24, Z 10d26: 8b 33 cpi r24, 0x3B ; 59 10d28: 51 f5 brne .+84 ; 0x10d7e // 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); 10d2a: f8 01 movw r30, r16 00010d2c : 10d2c: 61 91 ld r22, Z+ 10d2e: 6a 30 cpi r22, 0x0A ; 10 10d30: e9 f7 brne .-6 ; 0x10d2c 10d32: 8f 01 movw r16, r30 // found a newline, prepare the next block if block cache end reached if( rdPtr - blockBuffBegin > 512 ){ 10d34: cf 01 movw r24, r30 10d36: 8c 59 subi r24, 0x9C ; 156 10d38: 9e 40 sbci r25, 0x0E ; 14 10d3a: 81 30 cpi r24, 0x01 ; 1 10d3c: 92 40 sbci r25, 0x02 ; 2 10d3e: d4 f0 brlt .+52 ; 0x10d74 // at the end of block cache, fill new data in gfUpdateCurrentPosition( rdPtr - start - 1 ); 10d40: c8 01 movw r24, r16 10d42: 82 1b sub r24, r18 10d44: 93 0b sbc r25, r19 10d46: 01 97 sbiw r24, 0x01 ; 1 10d48: 0f 94 2f 7a call 0x2f45e ; 0x2f45e if( ! gfComputeNextFileBlock() )goto eof_or_fail; 10d4c: 8f e1 ldi r24, 0x1F ; 31 10d4e: 97 e1 ldi r25, 0x17 ; 23 10d50: 0f 94 d4 55 call 0x2aba8 ; 0x2aba8 10d54: 88 23 and r24, r24 10d56: 39 f0 breq .+14 ; 0x10d66 if( ! gfEnsureBlock() )goto eof_or_fail; // fetch it into RAM 10d58: 0f 94 3e 7a call 0x2f47c ; 0x2f47c rdPtr = start = blockBuffBegin; 10d5c: 2c e9 ldi r18, 0x9C ; 156 10d5e: 3e e0 ldi r19, 0x0E ; 14 10d60: 89 01 movw r16, 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 10d62: 81 11 cpse r24, r1 10d64: e2 cf rjmp .-60 ; 0x10d2a } eof_or_fail: // make the rdptr point to a safe location - end of file gfReadPtr = gfBlockBuffBegin() + 512; 10d66: f0 92 3b 17 sts 0x173B, r15 ; 0x80173b 10d6a: e0 92 3a 17 sts 0x173A, r14 ; 0x80173a return -1; 10d6e: 0f ef ldi r16, 0xFF ; 255 10d70: 1f ef ldi r17, 0xFF ; 255 10d72: 37 c0 rjmp .+110 ; 0x10de2 10d74: ba 94 dec r11 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){ 10d76: b1 10 cpse r11, r1 10d78: d5 c0 rjmp .+426 ; 0x10f24 // 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 10d7a: 01 50 subi r16, 0x01 ; 1 10d7c: 11 09 sbc r17, r1 } } } emit_char: { gfUpdateCurrentPosition( rdPtr - start + 1 ); 10d7e: c8 01 movw r24, r16 10d80: 82 1b sub r24, r18 10d82: 93 0b sbc r25, r19 10d84: 01 96 adiw r24, 0x01 ; 1 10d86: 0f 94 2f 7a call 0x2f45e ; 0x2f45e int16_t rv = *rdPtr++; 10d8a: c8 01 movw r24, r16 10d8c: 01 96 adiw r24, 0x01 ; 1 10d8e: f8 01 movw r30, r16 10d90: 00 81 ld r16, Z 10d92: 10 e0 ldi r17, 0x00 ; 0 if( curPosition_ >= fileSize_ ){ 10d94: 80 90 27 17 lds r8, 0x1727 ; 0x801727 10d98: 90 90 28 17 lds r9, 0x1728 ; 0x801728 10d9c: a0 90 29 17 lds r10, 0x1729 ; 0x801729 10da0: b0 90 2a 17 lds r11, 0x172A ; 0x80172a 10da4: 40 91 30 17 lds r20, 0x1730 ; 0x801730 10da8: 50 91 31 17 lds r21, 0x1731 ; 0x801731 10dac: 60 91 32 17 lds r22, 0x1732 ; 0x801732 10db0: 70 91 33 17 lds r23, 0x1733 ; 0x801733 10db4: 84 16 cp r8, r20 10db6: 95 06 cpc r9, r21 10db8: a6 06 cpc r10, r22 10dba: b7 06 cpc r11, r23 10dbc: a0 f6 brcc .-88 ; 0x10d66 // past the end of file goto eof_or_fail; } else if( rdPtr - blockBuffBegin >= 512 ){ 10dbe: 9c 01 movw r18, r24 10dc0: 2c 59 subi r18, 0x9C ; 156 10dc2: 3e 40 sbci r19, 0x0E ; 14 10dc4: 21 15 cp r18, r1 10dc6: 32 40 sbci r19, 0x02 ; 2 10dc8: 44 f0 brlt .+16 ; 0x10dda // past the end of current bufferred block - prepare the next one... if( ! gfComputeNextFileBlock() )goto eof_or_fail; 10dca: 8f e1 ldi r24, 0x1F ; 31 10dcc: 97 e1 ldi r25, 0x17 ; 23 10dce: 0f 94 d4 55 call 0x2aba8 ; 0x2aba8 10dd2: 88 23 and r24, r24 10dd4: 41 f2 breq .-112 ; 0x10d66 // don't need to force fetch the block here, it will get loaded on the next call rdPtr = blockBuffBegin; 10dd6: 8c e9 ldi r24, 0x9C ; 156 10dd8: 9e e0 ldi r25, 0x0E ; 14 } // save the current read ptr for the next run gfReadPtr = rdPtr; 10dda: 90 93 3b 17 sts 0x173B, r25 ; 0x80173b 10dde: 80 93 3a 17 sts 0x173A, r24 ; 0x80173a 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_;} 10de2: 40 91 27 17 lds r20, 0x1727 ; 0x801727 10de6: 50 91 28 17 lds r21, 0x1728 ; 0x801728 10dea: 60 91 29 17 lds r22, 0x1729 ; 0x801729 10dee: 70 91 2a 17 lds r23, 0x172A ; 0x80172a FORCE_INLINE bool isFileOpen() { return file.isOpen(); } bool eof() { return sdpos>=filesize; } FORCE_INLINE int16_t getFilteredGcodeChar() { int16_t c = (int16_t)file.readFilteredGcode(); sdpos = file.curPosition(); 10df2: 40 93 a3 17 sts 0x17A3, r20 ; 0x8017a3 10df6: 50 93 a4 17 sts 0x17A4, r21 ; 0x8017a4 10dfa: 60 93 a5 17 sts 0x17A5, r22 ; 0x8017a5 10dfe: 70 93 a6 17 sts 0x17A6, r23 ; 0x8017a6 10e02: 80 91 9d 10 lds r24, 0x109D ; 0x80109d 10e06: 90 91 9e 10 lds r25, 0x109E ; 0x80109e int16_t n=card.getFilteredGcodeChar(); char serial_char = (char)n; if( serial_char == '\n' 10e0a: 0a 30 cpi r16, 0x0A ; 10 10e0c: 61 f0 breq .+24 ; 0x10e26 || serial_char == '\r' 10e0e: 0d 30 cpi r16, 0x0D ; 13 10e10: 51 f0 breq .+20 ; 0x10e26 || serial_char == '#' 10e12: 03 32 cpi r16, 0x23 ; 35 10e14: 09 f4 brne .+2 ; 0x10e18 10e16: 8c c0 rjmp .+280 ; 0x10f30 || serial_count >= (MAX_CMD_SIZE - 1) 10e18: 8f 35 cpi r24, 0x5F ; 95 10e1a: 91 05 cpc r25, r1 10e1c: 3c f4 brge .+14 ; 0x10e2c || n==-1 10e1e: 0f 3f cpi r16, 0xFF ; 255 10e20: 10 07 cpc r17, r16 10e22: 09 f0 breq .+2 ; 0x10e26 10e24: 8c c0 rjmp .+280 ; 0x10f3e ){ if(serial_char=='#') stop_buffering=true; if(!serial_count) 10e26: 00 97 sbiw r24, 0x00 ; 0 10e28: 09 f4 brne .+2 ; 0x10e2c 10e2a: d4 cc rjmp .-1624 ; 0x107d4 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); }; 10e2c: 20 91 22 17 lds r18, 0x1722 ; 0x801722 10e30: 21 11 cpse r18, r1 10e32: 03 c0 rjmp .+6 ; 0x10e3a 10e34: 40 e0 ldi r20, 0x00 ; 0 10e36: 50 e0 ldi r21, 0x00 ; 0 10e38: 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; 10e3a: 20 91 80 03 lds r18, 0x0380 ; 0x800380 10e3e: 30 91 81 03 lds r19, 0x0381 ; 0x800381 10e42: 42 1b sub r20, r18 10e44: 53 0b sbc r21, r19 cmdbuffer[bufindw] = CMDBUFFER_CURRENT_TYPE_SDCARD; 10e46: a0 91 9f 10 lds r26, 0x109F ; 0x80109f <_ZL7bufindw.lto_priv.550> 10e4a: b0 91 a0 10 lds r27, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.550+0x1> 10e4e: fd 01 movw r30, r26 10e50: ec 55 subi r30, 0x5C ; 92 10e52: ff 4e sbci r31, 0xEF ; 239 10e54: d0 82 st Z, r13 cmdbuffer[bufindw+1] = sd_count.lohi.lo; 10e56: 41 83 std Z+1, r20 ; 0x01 cmdbuffer[bufindw+2] = sd_count.lohi.hi; 10e58: 52 83 std Z+2, r21 ; 0x02 10e5a: 13 96 adiw r26, 0x03 ; 3 cmdbuffer[bufindw+serial_count+CMDHDRSIZE] = 0; //terminate string 10e5c: 8c 55 subi r24, 0x5C ; 92 10e5e: 9f 4e sbci r25, 0xEF ; 239 10e60: fc 01 movw r30, r24 10e62: ea 0f add r30, r26 10e64: fb 1f adc r31, r27 10e66: 10 82 st Z, r1 // Calculate the length before disabling the interrupts. uint8_t len = strlen(cmdbuffer+bufindw+CMDHDRSIZE) + (1 + CMDHDRSIZE); 10e68: ac 55 subi r26, 0x5C ; 92 10e6a: bf 4e sbci r27, 0xEF ; 239 10e6c: fd 01 movw r30, r26 10e6e: 01 90 ld r0, Z+ 10e70: 00 20 and r0, r0 10e72: e9 f7 brne .-6 ; 0x10e6e 10e74: 31 97 sbiw r30, 0x01 ; 1 10e76: ea 1b sub r30, r26 10e78: fb 0b sbc r31, r27 // MYSERIAL.print(cmdbuffer); // SERIAL_ECHOPGM("buflen:"); // MYSERIAL.print(buflen+1); sd_count.value = 0; cli(); 10e7a: 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; 10e7c: 80 91 a2 10 lds r24, 0x10A2 ; 0x8010a2 10e80: 90 91 a3 10 lds r25, 0x10A3 ; 0x8010a3 10e84: 01 96 adiw r24, 0x01 ; 1 10e86: 90 93 a3 10 sts 0x10A3, r25 ; 0x8010a3 10e8a: 80 93 a2 10 sts 0x10A2, r24 ; 0x8010a2 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); 10e8e: 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; 10e90: 80 91 9f 10 lds r24, 0x109F ; 0x80109f <_ZL7bufindw.lto_priv.550> 10e94: 90 91 a0 10 lds r25, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.550+0x1> 10e98: e8 0f add r30, r24 10e9a: f9 2f mov r31, r25 10e9c: f1 1d adc r31, r1 10e9e: f0 93 a0 10 sts 0x10A0, r31 ; 0x8010a0 <_ZL7bufindw.lto_priv.550+0x1> 10ea2: e0 93 9f 10 sts 0x109F, r30 ; 0x80109f <_ZL7bufindw.lto_priv.550> 10ea6: 80 91 22 17 lds r24, 0x1722 ; 0x801722 10eaa: 88 23 and r24, r24 10eac: 09 f4 brne .+2 ; 0x10eb0 10eae: 43 c0 rjmp .+134 ; 0x10f36 10eb0: 80 91 a3 17 lds r24, 0x17A3 ; 0x8017a3 10eb4: 90 91 a4 17 lds r25, 0x17A4 ; 0x8017a4 10eb8: a0 91 a5 17 lds r26, 0x17A5 ; 0x8017a5 10ebc: b0 91 a6 17 lds r27, 0x17A6 ; 0x8017a6 sdpos_atomic = card.get_sdpos(); 10ec0: 80 93 80 03 sts 0x0380, r24 ; 0x800380 10ec4: 90 93 81 03 sts 0x0381, r25 ; 0x800381 10ec8: a0 93 82 03 sts 0x0382, r26 ; 0x800382 10ecc: b0 93 83 03 sts 0x0383, r27 ; 0x800383 if (bufindw == sizeof(cmdbuffer)) 10ed0: ed 3e cpi r30, 0xED ; 237 10ed2: f1 40 sbci r31, 0x01 ; 1 10ed4: 21 f4 brne .+8 ; 0x10ede bufindw = 0; 10ed6: 10 92 a0 10 sts 0x10A0, r1 ; 0x8010a0 <_ZL7bufindw.lto_priv.550+0x1> 10eda: 10 92 9f 10 sts 0x109F, r1 ; 0x80109f <_ZL7bufindw.lto_priv.550> sei(); 10ede: 78 94 sei comment_mode = false; //for new command 10ee0: 10 92 43 03 sts 0x0343, r1 ; 0x800343 serial_count = 0; //clear buffer 10ee4: 10 92 9e 10 sts 0x109E, r1 ; 0x80109e 10ee8: 10 92 9d 10 sts 0x109D, r1 ; 0x80109d if(card.eof()) break; 10eec: 40 91 a3 17 lds r20, 0x17A3 ; 0x8017a3 10ef0: 50 91 a4 17 lds r21, 0x17A4 ; 0x8017a4 10ef4: 60 91 a5 17 lds r22, 0x17A5 ; 0x8017a5 10ef8: 70 91 a6 17 lds r23, 0x17A6 ; 0x8017a6 10efc: 80 91 9c 17 lds r24, 0x179C ; 0x80179c 10f00: 90 91 9d 17 lds r25, 0x179D ; 0x80179d 10f04: a0 91 9e 17 lds r26, 0x179E ; 0x80179e 10f08: b0 91 9f 17 lds r27, 0x179F ; 0x80179f 10f0c: 48 17 cp r20, r24 10f0e: 59 07 cpc r21, r25 10f10: 6a 07 cpc r22, r26 10f12: 7b 07 cpc r23, r27 10f14: 30 f5 brcc .+76 ; 0x10f62 // The following line will reserve buffer space if available. if (! cmdqueue_could_enqueue_back(MAX_CMD_SIZE-1)) 10f16: 8f e5 ldi r24, 0x5F ; 95 10f18: 90 e0 ldi r25, 0x00 ; 0 10f1a: 0e 94 5a 5c call 0xb8b4 ; 0xb8b4 10f1e: 81 11 cpse r24, r1 10f20: db ce rjmp .-586 ; 0x10cd8 10f22: 58 cc rjmp .-1872 ; 0x107d4 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 == ';' ){ 10f24: f8 01 movw r30, r16 10f26: 80 81 ld r24, Z 10f28: 8b 33 cpi r24, 0x3B ; 59 10f2a: 09 f4 brne .+2 ; 0x10f2e 10f2c: fa ce rjmp .-524 ; 0x10d22 10f2e: 25 cf rjmp .-438 ; 0x10d7a || serial_char == '#' || serial_count >= (MAX_CMD_SIZE - 1) || n==-1 ){ if(serial_char=='#') stop_buffering=true; 10f30: c0 92 42 03 sts 0x0342, r12 ; 0x800342 10f34: 78 cf rjmp .-272 ; 0x10e26 10f36: 80 e0 ldi r24, 0x00 ; 0 10f38: 90 e0 ldi r25, 0x00 ; 0 10f3a: dc 01 movw r26, r24 10f3c: c1 cf rjmp .-126 ; 0x10ec0 return; } else { // there are no comments coming from the filtered file cmdbuffer[bufindw+CMDHDRSIZE+serial_count++] = serial_char; 10f3e: 9c 01 movw r18, r24 10f40: 2f 5f subi r18, 0xFF ; 255 10f42: 3f 4f sbci r19, 0xFF ; 255 10f44: 30 93 9e 10 sts 0x109E, r19 ; 0x80109e 10f48: 20 93 9d 10 sts 0x109D, r18 ; 0x80109d 10f4c: 20 91 9f 10 lds r18, 0x109F ; 0x80109f <_ZL7bufindw.lto_priv.550> 10f50: 30 91 a0 10 lds r19, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.550+0x1> 10f54: 2c 55 subi r18, 0x5C ; 92 10f56: 3f 4e sbci r19, 0xEF ; 239 10f58: 82 0f add r24, r18 10f5a: 93 1f adc r25, r19 10f5c: fc 01 movw r30, r24 10f5e: 03 83 std Z+3, r16 ; 0x03 10f60: bb ce rjmp .-650 ; 0x10cd8 } } if(card.eof()) 10f62: 40 91 a3 17 lds r20, 0x17A3 ; 0x8017a3 10f66: 50 91 a4 17 lds r21, 0x17A4 ; 0x8017a4 10f6a: 60 91 a5 17 lds r22, 0x17A5 ; 0x8017a5 10f6e: 70 91 a6 17 lds r23, 0x17A6 ; 0x8017a6 10f72: 80 91 9c 17 lds r24, 0x179C ; 0x80179c 10f76: 90 91 9d 17 lds r25, 0x179D ; 0x80179d 10f7a: a0 91 9e 17 lds r26, 0x179E ; 0x80179e 10f7e: b0 91 9f 17 lds r27, 0x179F ; 0x80179f 10f82: 48 17 cp r20, r24 10f84: 59 07 cpc r21, r25 10f86: 6a 07 cpc r22, r26 10f88: 7b 07 cpc r23, r27 10f8a: 08 f4 brcc .+2 ; 0x10f8e 10f8c: 23 cc rjmp .-1978 ; 0x107d4 { // 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()) 10f8e: 0e 94 2b 5b call 0xb656 ; 0xb656 10f92: 89 2b or r24, r25 10f94: 09 f0 breq .+2 ; 0x10f98 10f96: 1e cc rjmp .-1988 ; 0x107d4 lastnr++; } void CardReader::closefile(bool store_location) { file.sync(); 10f98: 8f e1 ldi r24, 0x1F ; 31 10f9a: 97 e1 ldi r25, 0x17 ; 23 10f9c: 0f 94 f6 57 call 0x2afec ; 0x2afec file.close(); 10fa0: 8f e1 ldi r24, 0x1F ; 31 10fa2: 97 e1 ldi r25, 0x17 ; 23 10fa4: 0f 94 2b 58 call 0x2b056 ; 0x2b056 saving = false; 10fa8: 10 92 8d 14 sts 0x148D, r1 ; 0x80148d logging = false; 10fac: 10 92 8e 14 sts 0x148E, r1 ; 0x80148e { // queue is complete, but before we process EOF commands prevent // re-entry by disabling SD processing from any st_synchronize call card.closefile(); SERIAL_PROTOCOLLNRPGM(_n("Done printing file"));////MSG_FILE_PRINTED 10fb0: 8e ef ldi r24, 0xFE ; 254 10fb2: 94 e6 ldi r25, 0x64 ; 100 10fb4: 0e 94 93 79 call 0xf326 ; 0xf326 char time[30]; uint32_t t = print_job_timer.duration() / 60; 10fb8: 0f 94 75 3e call 0x27cea ; 0x27cea 10fbc: 6b 01 movw r12, r22 10fbe: 7c 01 movw r14, r24 int hours, minutes; minutes = t % 60; hours = t / 60; save_statistics(); 10fc0: 0e 94 37 66 call 0xcc6e ; 0xcc6e // 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; 10fc4: 8c e3 ldi r24, 0x3C ; 60 10fc6: 88 2e mov r8, r24 10fc8: 91 2c mov r9, r1 10fca: a1 2c mov r10, r1 10fcc: b1 2c mov r11, r1 10fce: c7 01 movw r24, r14 10fd0: b6 01 movw r22, r12 10fd2: a5 01 movw r20, r10 10fd4: 94 01 movw r18, r8 10fd6: 0f 94 4a dc call 0x3b894 ; 0x3b894 <__udivmodsi4> int hours, minutes; minutes = t % 60; 10fda: ca 01 movw r24, r20 10fdc: b9 01 movw r22, r18 10fde: a5 01 movw r20, r10 10fe0: 94 01 movw r18, r8 10fe2: 0f 94 4a dc call 0x3b894 ; 0x3b894 <__udivmodsi4> hours = t / 60; save_statistics(); sprintf_P(time, PSTR("%i hours %i minutes"),hours, minutes); 10fe6: 7f 93 push r23 10fe8: 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; 10fea: c7 01 movw r24, r14 10fec: b6 01 movw r22, r12 10fee: 20 e1 ldi r18, 0x10 ; 16 10ff0: 3e e0 ldi r19, 0x0E ; 14 10ff2: 40 e0 ldi r20, 0x00 ; 0 10ff4: 50 e0 ldi r21, 0x00 ; 0 10ff6: 0f 94 4a dc call 0x3b894 ; 0x3b894 <__udivmodsi4> save_statistics(); sprintf_P(time, PSTR("%i hours %i minutes"),hours, minutes); 10ffa: 3f 93 push r19 10ffc: 2f 93 push r18 10ffe: 80 eb ldi r24, 0xB0 ; 176 11000: 97 e7 ldi r25, 0x77 ; 119 11002: 9f 93 push r25 11004: 8f 93 push r24 11006: 8e 01 movw r16, r28 11008: 0f 5f subi r16, 0xFF ; 255 1100a: 1f 4f sbci r17, 0xFF ; 255 1100c: 1f 93 push r17 1100e: 0f 93 push r16 11010: 0f 94 ee da call 0x3b5dc ; 0x3b5dc SERIAL_ECHO_START; 11014: 82 ef ldi r24, 0xF2 ; 242 11016: 9b ea ldi r25, 0xAB ; 171 11018: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHOLN(time); 1101c: c8 01 movw r24, r16 1101e: 0f 94 bb d5 call 0x3ab76 ; 0x3ab76 lcd_setstatus(time); 11022: c8 01 movw r24, r16 11024: 0e 94 64 f4 call 0x1e8c8 ; 0x1e8c8 card.printingHasFinished(); 11028: 0f 94 3e 80 call 0x3007c ; 0x3007c if(!autostart_stilltocheck) return; if(autostart_atmillis.expired(5000)) return; } autostart_stilltocheck = false; 1102c: 10 92 69 02 sts 0x0269, r1 ; 0x800269 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.551> if(!mounted) 11030: 0f b6 in r0, 0x3f ; 63 11032: f8 94 cli 11034: de bf out 0x3e, r29 ; 62 11036: 0f be out 0x3f, r0 ; 63 11038: cd bf out 0x3d, r28 ; 61 1103a: 80 91 90 14 lds r24, 0x1490 ; 0x801490 1103e: 88 23 and r24, r24 11040: 19 f0 breq .+6 ; 0x11048 11042: 0f 94 72 75 call 0x2eae4 ; 0x2eae4 11046: c6 cb rjmp .-2164 ; 0x107d4 { mount(); 11048: 81 e0 ldi r24, 0x01 ; 1 1104a: 0f 94 7d 80 call 0x300fa ; 0x300fa if(!mounted) //fail 1104e: 80 91 90 14 lds r24, 0x1490 ; 0x801490 11052: 81 11 cpse r24, r1 11054: f6 cf rjmp .-20 ; 0x11042 11056: be cb rjmp .-2180 ; 0x107d4 00011058 : static void printFloat(double, uint8_t); public: static /*FORCE_INLINE*/ void write(const char *str) 11058: cf 93 push r28 1105a: df 93 push r29 1105c: ec 01 movw r28, r24 { while (*str) 1105e: 89 91 ld r24, Y+ 11060: 88 23 and r24, r24 11062: 19 f0 breq .+6 ; 0x1106a write(*str++); 11064: 0e 94 4f 77 call 0xee9e ; 0xee9e 11068: fa cf rjmp .-12 ; 0x1105e } 1106a: df 91 pop r29 1106c: cf 91 pop r28 1106e: 08 95 ret 00011070 : //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) { 11070: ff 92 push r15 11072: 0f 93 push r16 11074: 1f 93 push r17 11076: cf 93 push r28 11078: df 93 push r29 1107a: ec 01 movw r28, r24 1107c: f6 2e mov r15, r22 size_t len = from_progmem ? strlen_P(cmd) : strlen(cmd); 1107e: 66 23 and r22, r22 11080: 09 f4 brne .+2 ; 0x11084 11082: 4b c0 rjmp .+150 ; 0x1111a #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); 11084: 0f 94 95 d9 call 0x3b32a ; 0x3b32a <__strlen_P> 11088: 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)) { 1108a: c8 01 movw r24, r16 1108c: 0e 94 5a 5c call 0xb8b4 ; 0xb8b4 11090: 88 23 and r24, r24 11092: 09 f4 brne .+2 ; 0x11096 11094: 53 c0 rjmp .+166 ; 0x1113c // 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; 11096: 80 91 9f 10 lds r24, 0x109F ; 0x80109f <_ZL7bufindw.lto_priv.550> 1109a: 90 91 a0 10 lds r25, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.550+0x1> 1109e: fc 01 movw r30, r24 110a0: ec 55 subi r30, 0x5C ; 92 110a2: ff 4e sbci r31, 0xEF ; 239 110a4: 23 e0 ldi r18, 0x03 ; 3 110a6: 20 83 st Z, r18 110a8: 89 55 subi r24, 0x59 ; 89 110aa: 9f 4e sbci r25, 0xEF ; 239 if (from_progmem) strcpy_P(cmdbuffer + bufindw + CMDHDRSIZE, cmd); 110ac: 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) 110ae: ff 20 and r15, r15 110b0: e9 f1 breq .+122 ; 0x1112c strcpy_P(cmdbuffer + bufindw + CMDHDRSIZE, cmd); 110b2: 0f 94 8e d9 call 0x3b31c ; 0x3b31c else strcpy(cmdbuffer + bufindw + CMDHDRSIZE, cmd); SERIAL_ECHO_START; 110b6: 82 ef ldi r24, 0xF2 ; 242 110b8: 9b ea ldi r25, 0xAB ; 171 110ba: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHORPGM(MSG_Enqueing); 110be: 83 ef ldi r24, 0xF3 ; 243 110c0: 94 e6 ldi r25, 0x64 ; 100 110c2: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); 110c6: 80 91 9f 10 lds r24, 0x109F ; 0x80109f <_ZL7bufindw.lto_priv.550> 110ca: 90 91 a0 10 lds r25, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.550+0x1> } }*/ static FORCE_INLINE void print(const char *str) { write(str); 110ce: 89 55 subi r24, 0x59 ; 89 110d0: 9f 4e sbci r25, 0xEF ; 239 110d2: 0e 94 2c 88 call 0x11058 ; 0x11058 SERIAL_ECHOLNPGM("\""); 110d6: 8e e8 ldi r24, 0x8E ; 142 110d8: 97 e7 ldi r25, 0x77 ; 119 110da: 0e 94 93 79 call 0xf326 ; 0xf326 bufindw += len + (CMDHDRSIZE + 1); 110de: 80 91 9f 10 lds r24, 0x109F ; 0x80109f <_ZL7bufindw.lto_priv.550> 110e2: 90 91 a0 10 lds r25, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.550+0x1> 110e6: 04 96 adiw r24, 0x04 ; 4 110e8: 08 0f add r16, r24 110ea: 19 1f adc r17, r25 if (bufindw == sizeof(cmdbuffer)) 110ec: 0d 3e cpi r16, 0xED ; 237 110ee: 81 e0 ldi r24, 0x01 ; 1 110f0: 18 07 cpc r17, r24 110f2: f9 f0 breq .+62 ; 0x11132 strcpy(cmdbuffer + bufindw + CMDHDRSIZE, cmd); SERIAL_ECHO_START; SERIAL_ECHORPGM(MSG_Enqueing); SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); SERIAL_ECHOLNPGM("\""); bufindw += len + (CMDHDRSIZE + 1); 110f4: 10 93 a0 10 sts 0x10A0, r17 ; 0x8010a0 <_ZL7bufindw.lto_priv.550+0x1> 110f8: 00 93 9f 10 sts 0x109F, r16 ; 0x80109f <_ZL7bufindw.lto_priv.550> if (bufindw == sizeof(cmdbuffer)) bufindw = 0; ++ buflen; 110fc: 80 91 a2 10 lds r24, 0x10A2 ; 0x8010a2 11100: 90 91 a3 10 lds r25, 0x10A3 ; 0x8010a3 11104: 01 96 adiw r24, 0x01 ; 1 11106: 90 93 a3 10 sts 0x10A3, r25 ; 0x8010a3 1110a: 80 93 a2 10 sts 0x10A2, r24 ; 0x8010a2 SERIAL_ECHOLNRPGM(bufferFull); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } 1110e: df 91 pop r29 11110: cf 91 pop r28 11112: 1f 91 pop r17 11114: 0f 91 pop r16 11116: ff 90 pop r15 11118: 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); 1111a: fc 01 movw r30, r24 1111c: 01 90 ld r0, Z+ 1111e: 00 20 and r0, r0 11120: e9 f7 brne .-6 ; 0x1111c 11122: 31 97 sbiw r30, 0x01 ; 1 11124: 8f 01 movw r16, r30 11126: 08 1b sub r16, r24 11128: 19 0b sbc r17, r25 1112a: af cf rjmp .-162 ; 0x1108a // 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); 1112c: 0f 94 42 e2 call 0x3c484 ; 0x3c484 11130: c2 cf rjmp .-124 ; 0x110b6 SERIAL_ECHORPGM(MSG_Enqueing); SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); SERIAL_ECHOLNPGM("\""); bufindw += len + (CMDHDRSIZE + 1); if (bufindw == sizeof(cmdbuffer)) bufindw = 0; 11132: 10 92 a0 10 sts 0x10A0, r1 ; 0x8010a0 <_ZL7bufindw.lto_priv.550+0x1> 11136: 10 92 9f 10 sts 0x109F, r1 ; 0x80109f <_ZL7bufindw.lto_priv.550> 1113a: e0 cf rjmp .-64 ; 0x110fc ++ buflen; #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; 1113c: 8a ec ldi r24, 0xCA ; 202 1113e: 9b ea ldi r25, 0xAB ; 171 11140: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHORPGM(MSG_Enqueing); 11144: 83 ef ldi r24, 0xF3 ; 243 11146: 94 e6 ldi r25, 0x64 ; 100 11148: 0e 94 68 77 call 0xeed0 ; 0xeed0 if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); 1114c: ce 01 movw r24, r28 cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; SERIAL_ECHORPGM(MSG_Enqueing); if (from_progmem) 1114e: ff 20 and r15, r15 11150: 59 f0 breq .+22 ; 0x11168 SERIAL_PROTOCOLRPGM(cmd); 11152: 0e 94 68 77 call 0xeed0 ; 0xeed0 else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 11156: 83 eb ldi r24, 0xB3 ; 179 11158: 9b ea ldi r25, 0xAB ; 171 #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } 1115a: df 91 pop r29 1115c: cf 91 pop r28 1115e: 1f 91 pop r17 11160: 0f 91 pop r16 11162: ff 90 pop r15 SERIAL_ECHORPGM(MSG_Enqueing); if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 11164: 0c 94 93 79 jmp 0xf326 ; 0xf326 11168: 0e 94 2c 88 call 0x11058 ; 0x11058 1116c: f4 cf rjmp .-24 ; 0x11156 0001116e : { 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) { 1116e: 0f 93 push r16 11170: 1f 93 push r17 11172: cf 93 push r28 11174: df 93 push r29 11176: d6 2f mov r29, r22 11178: 8c 01 movw r16, r24 for (uint8_t i = 0; i < steps; ++i) 1117a: c0 e0 ldi r28, 0x00 ; 0 { enquecommand_P(static_cast(pgm_read_ptr(cmd_sequence + i))); 1117c: f8 01 movw r30, r16 1117e: 85 91 lpm r24, Z+ 11180: 94 91 lpm r25, Z 11182: 61 e0 ldi r22, 0x01 ; 1 11184: 0e 94 38 88 call 0x11070 ; 0x11070 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) 11188: cf 5f subi r28, 0xFF ; 255 1118a: 0e 5f subi r16, 0xFE ; 254 1118c: 1f 4f sbci r17, 0xFF ; 255 1118e: dc 13 cpse r29, r28 11190: f5 cf rjmp .-22 ; 0x1117c { enquecommand_P(static_cast(pgm_read_ptr(cmd_sequence + i))); } } 11192: df 91 pop r29 11194: cf 91 pop r28 11196: 1f 91 pop r17 11198: 0f 91 pop r16 1119a: 08 95 ret 0001119c : static const char bufferFull[] PROGMEM = "\" failed: Buffer full!"; static const char enqueingFront[] PROGMEM = "Enqueing to the front: \""; void enquecommandf_P(const char *fmt, ...) { 1119c: cf 93 push r28 1119e: df 93 push r29 111a0: cd b7 in r28, 0x3d ; 61 111a2: de b7 in r29, 0x3e ; 62 111a4: 6e 97 sbiw r28, 0x1e ; 30 111a6: 0f b6 in r0, 0x3f ; 63 111a8: f8 94 cli 111aa: de bf out 0x3e, r29 ; 62 111ac: 0f be out 0x3f, r0 ; 63 111ae: cd bf out 0x3d, r28 ; 61 111b0: 9e 01 movw r18, r28 111b2: 2c 5d subi r18, 0xDC ; 220 111b4: 3f 4f sbci r19, 0xFF ; 255 111b6: f9 01 movw r30, r18 111b8: 41 91 ld r20, Z+ 111ba: 51 91 ld r21, Z+ 111bc: 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); 111be: 6e e1 ldi r22, 0x1E ; 30 111c0: 70 e0 ldi r23, 0x00 ; 0 111c2: ce 01 movw r24, r28 111c4: 01 96 adiw r24, 0x01 ; 1 111c6: 0f 94 2d db call 0x3b65a ; 0x3b65a va_end(ap); enquecommand(cmd_buffer, false); 111ca: 60 e0 ldi r22, 0x00 ; 0 111cc: ce 01 movw r24, r28 111ce: 01 96 adiw r24, 0x01 ; 1 111d0: 0e 94 38 88 call 0x11070 ; 0x11070 } 111d4: 6e 96 adiw r28, 0x1e ; 30 111d6: 0f b6 in r0, 0x3f ; 63 111d8: f8 94 cli 111da: de bf out 0x3e, r29 ; 62 111dc: 0f be out 0x3f, r0 ; 63 111de: cd bf out 0x3d, r28 ; 61 111e0: df 91 pop r29 111e2: cf 91 pop r28 111e4: 08 95 ret 000111e6 : } } /// @brief Read saved filename from EEPROM and send g-code command: M23 void restore_file_from_sd() { 111e6: ef 92 push r14 111e8: ff 92 push r15 111ea: 0f 93 push r16 111ec: 1f 93 push r17 111ee: cf 93 push r28 111f0: df 93 push r29 111f2: cd b7 in r28, 0x3d ; 61 111f4: de b7 in r29, 0x3e ; 62 111f6: 6b 97 sbiw r28, 0x1b ; 27 111f8: 0f b6 in r0, 0x3f ; 63 111fa: f8 94 cli 111fc: de bf out 0x3e, r29 ; 62 111fe: 0f be out 0x3f, r0 ; 63 11200: cd bf out 0x3d, r28 ; 61 char filename[FILENAME_LENGTH]; char dir_name[9]; char extension_ptr[5]; uint8_t depth = eeprom_read_byte((uint8_t*)EEPROM_DIR_DEPTH); 11202: 8a e5 ldi r24, 0x5A ; 90 11204: 9f e0 ldi r25, 0x0F ; 15 11206: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 1120a: e8 2e mov r14, r24 1120c: 0a e0 ldi r16, 0x0A ; 10 1120e: 1f e0 ldi r17, 0x0F ; 15 for (uint8_t i = 0; i < depth; i++) { 11210: 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); 11212: 48 e0 ldi r20, 0x08 ; 8 11214: 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++) { 11216: fe 14 cp r15, r14 11218: 79 f0 breq .+30 ; 0x11238 eeprom_read_block(dir_name, (const char *)EEPROM_DIRS + 8 * i, 8); 1121a: b8 01 movw r22, r16 1121c: ce 01 movw r24, r28 1121e: 0e 96 adiw r24, 0x0e ; 14 11220: 0f 94 c7 db call 0x3b78e ; 0x3b78e dir_name[8] = '\0'; 11224: 1e 8a std Y+22, r1 ; 0x16 card.chdir(dir_name, false); 11226: 60 e0 ldi r22, 0x00 ; 0 11228: ce 01 movw r24, r28 1122a: 0e 96 adiw r24, 0x0e ; 14 1122c: 0f 94 cf 7d call 0x2fb9e ; 0x2fb9e 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++) { 11230: f3 94 inc r15 11232: 08 5f subi r16, 0xF8 ; 248 11234: 1f 4f sbci r17, 0xFF ; 255 11236: ed cf rjmp .-38 ; 0x11212 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); 11238: 65 e9 ldi r22, 0x95 ; 149 1123a: 7f e0 ldi r23, 0x0F ; 15 1123c: 8e 01 movw r16, r28 1123e: 0f 5f subi r16, 0xFF ; 255 11240: 1f 4f sbci r17, 0xFF ; 255 11242: c8 01 movw r24, r16 11244: 0f 94 c7 db call 0x3b78e ; 0x3b78e // Add null delimiter in case all 8 characters were not NULL filename[8] = '\0'; 11248: 19 86 std Y+9, r1 ; 0x09 // Add extension to complete the DOS 8.3 filename e.g. ".gco" or ".g" extension_ptr[0] = '.'; 1124a: 8e e2 ldi r24, 0x2E ; 46 1124c: 8f 8b std Y+23, r24 ; 0x17 eeprom_read_block(&extension_ptr[1], (const char *)EEPROM_FILENAME_EXTENSION, 3); 1124e: 43 e0 ldi r20, 0x03 ; 3 11250: 50 e0 ldi r21, 0x00 ; 0 11252: 61 e9 ldi r22, 0x91 ; 145 11254: 7c e0 ldi r23, 0x0C ; 12 11256: ce 01 movw r24, r28 11258: 48 96 adiw r24, 0x18 ; 24 1125a: 0f 94 c7 db call 0x3b78e ; 0x3b78e extension_ptr[4] = '\0'; 1125e: 1b 8e std Y+27, r1 ; 0x1b strcat(filename, extension_ptr); 11260: be 01 movw r22, r28 11262: 69 5e subi r22, 0xE9 ; 233 11264: 7f 4f sbci r23, 0xFF ; 255 11266: c8 01 movw r24, r16 11268: 0f 94 23 e2 call 0x3c446 ; 0x3c446 enquecommandf_P(MSG_M23, filename); 1126c: 1f 93 push r17 1126e: 0f 93 push r16 11270: 85 e3 ldi r24, 0x35 ; 53 11272: 91 e7 ldi r25, 0x71 ; 113 11274: 9f 93 push r25 11276: 8f 93 push r24 11278: 0e 94 ce 88 call 0x1119c ; 0x1119c 1127c: 0f 90 pop r0 1127e: 0f 90 pop r0 11280: 0f 90 pop r0 11282: 0f 90 pop r0 } 11284: 6b 96 adiw r28, 0x1b ; 27 11286: 0f b6 in r0, 0x3f ; 63 11288: f8 94 cli 1128a: de bf out 0x3e, r29 ; 62 1128c: 0f be out 0x3f, r0 ; 63 1128e: cd bf out 0x3d, r28 ; 61 11290: df 91 pop r29 11292: cf 91 pop r28 11294: 1f 91 pop r17 11296: 0f 91 pop r16 11298: ff 90 pop r15 1129a: ef 90 pop r14 1129c: 08 95 ret 0001129e : //! 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) { 1129e: bf 92 push r11 112a0: cf 92 push r12 112a2: df 92 push r13 112a4: ef 92 push r14 112a6: ff 92 push r15 112a8: 0f 93 push r16 112aa: 1f 93 push r17 112ac: cf 93 push r28 112ae: df 93 push r29 if (saved_printing) return; 112b0: e0 91 a8 0d lds r30, 0x0DA8 ; 0x800da8 112b4: e1 11 cpse r30, r1 112b6: b1 c0 rjmp .+354 ; 0x1141a 112b8: 05 2f mov r16, r21 112ba: 14 2f mov r17, r20 112bc: e9 01 movw r28, r18 112be: 6b 01 movw r12, r22 112c0: 7c 01 movw r14, r24 cli(); 112c2: f8 94 cli save_print_file_state(); 112c4: 0e 94 52 65 call 0xcaa4 ; 0xcaa4 // save the global state at planning time const bool pos_invalid = mesh_bed_leveling_flag || homing_flag; 112c8: b0 90 a7 0d lds r11, 0x0DA7 ; 0x800da7 112cc: b1 10 cpse r11, r1 112ce: 02 c0 rjmp .+4 ; 0x112d4 112d0: b0 90 a6 0d lds r11, 0x0DA6 ; 0x800da6 save_planner_global_state(); 112d4: 0e 94 08 65 call 0xca10 ; 0xca10 planner_abort_hard(); //abort printing 112d8: 0f 94 7e c1 call 0x382fc ; 0x382fc memcpy(saved_pos, current_position, sizeof(saved_pos)); 112dc: 80 e1 ldi r24, 0x10 ; 16 112de: e1 e9 ldi r30, 0x91 ; 145 112e0: f6 e0 ldi r31, 0x06 ; 6 112e2: a3 e7 ldi r26, 0x73 ; 115 112e4: b2 e0 ldi r27, 0x02 ; 2 112e6: 01 90 ld r0, Z+ 112e8: 0d 92 st X+, r0 112ea: 8a 95 dec r24 112ec: e1 f7 brne .-8 ; 0x112e6 if (pos_invalid) saved_pos[X_AXIS] = X_COORD_INVALID; 112ee: bb 20 and r11, r11 112f0: 61 f0 breq .+24 ; 0x1130a 112f2: 80 e0 ldi r24, 0x00 ; 0 112f4: 90 e0 ldi r25, 0x00 ; 0 112f6: a0 e8 ldi r26, 0x80 ; 128 112f8: bf eb ldi r27, 0xBF ; 191 112fa: 80 93 73 02 sts 0x0273, r24 ; 0x800273 112fe: 90 93 74 02 sts 0x0274, r25 ; 0x800274 11302: a0 93 75 02 sts 0x0275, r26 ; 0x800275 11306: b0 93 76 02 sts 0x0276, r27 ; 0x800276 saved_feedmultiply2 = feedmultiply; //save feedmultiply 1130a: 80 91 39 02 lds r24, 0x0239 ; 0x800239 1130e: 90 91 3a 02 lds r25, 0x023A ; 0x80023a 11312: 90 93 70 03 sts 0x0370, r25 ; 0x800370 11316: 80 93 6f 03 sts 0x036F, r24 ; 0x80036f saved_extruder_temperature = (uint16_t)degTargetHotend(active_extruder); 1131a: 80 91 b5 0d lds r24, 0x0DB5 ; 0x800db5 1131e: 90 91 b6 0d lds r25, 0x0DB6 ; 0x800db6 11322: 90 93 ac 05 sts 0x05AC, r25 ; 0x8005ac 11326: 80 93 ab 05 sts 0x05AB, r24 ; 0x8005ab saved_bed_temperature = (uint8_t)degTargetBed(); 1132a: 80 91 71 06 lds r24, 0x0671 ; 0x800671 1132e: 80 93 ad 05 sts 0x05AD, r24 ; 0x8005ad saved_extruder_relative_mode = axis_relative_modes & E_AXIS_MASK; 11332: 80 91 e3 03 lds r24, 0x03E3 ; 0x8003e3 11336: 83 fb bst r24, 3 11338: 88 27 eor r24, r24 1133a: 80 f9 bld r24, 0 1133c: 80 93 63 05 sts 0x0563, r24 ; 0x800563 saved_fan_speed = fanSpeed; 11340: 80 91 e5 03 lds r24, 0x03E5 ; 0x8003e5 11344: 80 93 aa 05 sts 0x05AA, r24 ; 0x8005aa cmdqueue_reset(); //empty cmdqueue 11348: 0e 94 5c 7f call 0xfeb8 ; 0xfeb8 card.sdprinting = false; 1134c: 10 92 8f 14 sts 0x148F, r1 ; 0x80148f // card.closefile(); saved_printing = true; 11350: 81 e0 ldi r24, 0x01 ; 1 11352: 80 93 a8 0d sts 0x0DA8, r24 ; 0x800da8 // We may have missed a stepper timer interrupt. Be safe than sorry, reset the stepper timer before re-enabling interrupts. st_reset_timer(); 11356: 0f 94 fd 42 call 0x285fa ; 0x285fa sei(); 1135a: 78 94 sei if ((z_move != 0) || (e_move != 0)) { // extruder or z move 1135c: 20 e0 ldi r18, 0x00 ; 0 1135e: 30 e0 ldi r19, 0x00 ; 0 11360: a9 01 movw r20, r18 11362: c7 01 movw r24, r14 11364: b6 01 movw r22, r12 11366: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> // Rather than calling plan_buffer_line directly, push the move into the command queue so that // the caller can continue processing. This is used during powerpanic to save the state as we // move away from the print. if(e_move) 1136a: 20 e0 ldi r18, 0x00 ; 0 1136c: 30 e0 ldi r19, 0x00 ; 0 1136e: a9 01 movw r20, r18 11370: f8 01 movw r30, r16 11372: 6c 2f mov r22, r28 11374: 7d 2f mov r23, r29 // card.closefile(); saved_printing = true; // We may have missed a stepper timer interrupt. Be safe than sorry, reset the stepper timer before re-enabling interrupts. st_reset_timer(); sei(); if ((z_move != 0) || (e_move != 0)) { // extruder or z move 11376: 81 11 cpse r24, r1 11378: 5a c0 rjmp .+180 ; 0x1142e 1137a: 8f 2f mov r24, r31 1137c: 90 2f mov r25, r16 1137e: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 11382: 88 23 and r24, r24 11384: 09 f4 brne .+2 ; 0x11388 11386: 49 c0 rjmp .+146 ; 0x1141a // move away from the print. if(e_move) { // First unretract (relative extrusion) if(!saved_extruder_relative_mode){ 11388: 80 91 63 05 lds r24, 0x0563 ; 0x800563 1138c: 81 11 cpse r24, r1 1138e: 05 c0 rjmp .+10 ; 0x1139a enquecommand_P(MSG_M83); 11390: 61 e0 ldi r22, 0x01 ; 1 11392: 8a e1 ldi r24, 0x1A ; 26 11394: 9c e6 ldi r25, 0x6C ; 108 11396: 0e 94 38 88 call 0x11070 ; 0x11070 // 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); 1139a: 0f 93 push r16 1139c: 1f 93 push r17 1139e: df 93 push r29 113a0: cf 93 push r28 113a2: 84 e9 ldi r24, 0x94 ; 148 113a4: 9e e6 ldi r25, 0x6E ; 110 113a6: 9f 93 push r25 113a8: 8f 93 push r24 113aa: 0e 94 ce 88 call 0x1119c ; 0x1119c } if(z_move) 113ae: 0f 90 pop r0 113b0: 0f 90 pop r0 113b2: 0f 90 pop r0 113b4: 0f 90 pop r0 113b6: 0f 90 pop r0 113b8: 0f 90 pop r0 113ba: 20 e0 ldi r18, 0x00 ; 0 113bc: 30 e0 ldi r19, 0x00 ; 0 113be: a9 01 movw r20, r18 113c0: c7 01 movw r24, r14 113c2: b6 01 movw r22, r12 113c4: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 113c8: 88 23 and r24, r24 113ca: 21 f1 breq .+72 ; 0x11414 { // Then lift Z axis enquecommandf_P(PSTR("G1 Z%-.3f F%-.3f"), saved_pos[Z_AXIS] + z_move, homing_feedrate[Z_AXIS]); 113cc: 84 e4 ldi r24, 0x44 ; 68 113ce: 8f 93 push r24 113d0: 88 e4 ldi r24, 0x48 ; 72 113d2: 8f 93 push r24 113d4: 1f 92 push r1 113d6: 1f 92 push r1 113d8: 20 91 7b 02 lds r18, 0x027B ; 0x80027b 113dc: 30 91 7c 02 lds r19, 0x027C ; 0x80027c 113e0: 40 91 7d 02 lds r20, 0x027D ; 0x80027d 113e4: 50 91 7e 02 lds r21, 0x027E ; 0x80027e 113e8: c7 01 movw r24, r14 113ea: b6 01 movw r22, r12 113ec: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 113f0: 9f 93 push r25 113f2: 8f 93 push r24 113f4: 7f 93 push r23 113f6: 6f 93 push r22 113f8: 8c e6 ldi r24, 0x6C ; 108 113fa: 9e e7 ldi r25, 0x7E ; 126 113fc: 9f 93 push r25 113fe: 8f 93 push r24 11400: 0e 94 ce 88 call 0x1119c ; 0x1119c 11404: 8d b7 in r24, 0x3d ; 61 11406: 9e b7 in r25, 0x3e ; 62 11408: 0a 96 adiw r24, 0x0a ; 10 1140a: 0f b6 in r0, 0x3f ; 63 1140c: f8 94 cli 1140e: 9e bf out 0x3e, r25 ; 62 11410: 0f be out 0x3f, r0 ; 63 11412: 8d bf out 0x3d, r24 ; 61 // 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; 11414: 81 e0 ldi r24, 0x01 ; 1 11416: 80 93 a1 10 sts 0x10A1, r24 ; 0x8010a1 // 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(); } } 1141a: df 91 pop r29 1141c: cf 91 pop r28 1141e: 1f 91 pop r17 11420: 0f 91 pop r16 11422: ff 90 pop r15 11424: ef 90 pop r14 11426: df 90 pop r13 11428: cf 90 pop r12 1142a: bf 90 pop r11 1142c: 08 95 ret // Rather than calling plan_buffer_line directly, push the move into the command queue so that // the caller can continue processing. This is used during powerpanic to save the state as we // move away from the print. if(e_move) 1142e: 8f 2f mov r24, r31 11430: 90 2f mov r25, r16 11432: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 11436: 88 23 and r24, r24 11438: 49 f2 breq .-110 ; 0x113cc 1143a: a6 cf rjmp .-180 ; 0x11388 0001143c : eeprom_update_word_notify((uint16_t *)EEPROM_BACKLIGHT_TIMEOUT, backlightTimer_period); } void backlight_update() { if (!backlightSupport) return; 1143c: 80 91 01 04 lds r24, 0x0401 ; 0x800401 11440: 88 23 and r24, r24 11442: 21 f1 breq .+72 ; 0x1148c if (backlightMode == BACKLIGHT_MODE_AUTO) 11444: 80 91 4f 02 lds r24, 0x024F ; 0x80024f 11448: 82 30 cpi r24, 0x02 ; 2 1144a: e9 f4 brne .+58 ; 0x11486 { if (backlightTimer.expired((uint32_t)backlightTimer_period * 1000ul)) analogWrite(LCD_BL_PIN, backlightLevel_LOW); 1144c: a0 91 4d 02 lds r26, 0x024D ; 0x80024d 11450: b0 91 4e 02 lds r27, 0x024E ; 0x80024e 11454: 28 ee ldi r18, 0xE8 ; 232 11456: 33 e0 ldi r19, 0x03 ; 3 11458: 0f 94 f7 dc call 0x3b9ee ; 0x3b9ee <__usmulhisi3> 1145c: ab 01 movw r20, r22 1145e: bc 01 movw r22, r24 11460: 85 e3 ldi r24, 0x35 ; 53 11462: 93 e0 ldi r25, 0x03 ; 3 11464: 0f 94 06 2a call 0x2540c ; 0x2540c ::expired(unsigned long)> 11468: 88 23 and r24, r24 1146a: 31 f0 breq .+12 ; 0x11478 else if (backlightTimer.running()) analogWrite(LCD_BL_PIN, backlightLevel_HIGH); else {/*do nothing*/;} //display is dimmed. } else if (backlightMode == BACKLIGHT_MODE_DIM) analogWrite(LCD_BL_PIN, backlightLevel_LOW); 1146c: 60 91 ff 03 lds r22, 0x03FF ; 0x8003ff else analogWrite(LCD_BL_PIN, backlightLevel_HIGH); 11470: 70 e0 ldi r23, 0x00 ; 0 11472: 85 e0 ldi r24, 0x05 ; 5 11474: 0c 94 f1 e8 jmp 0x1d1e2 ; 0x1d1e2 if (!backlightSupport) return; if (backlightMode == BACKLIGHT_MODE_AUTO) { if (backlightTimer.expired((uint32_t)backlightTimer_period * 1000ul)) analogWrite(LCD_BL_PIN, backlightLevel_LOW); else if (backlightTimer.running()) analogWrite(LCD_BL_PIN, backlightLevel_HIGH); 11478: 80 91 35 03 lds r24, 0x0335 ; 0x800335 1147c: 88 23 and r24, r24 1147e: 31 f0 breq .+12 ; 0x1148c else {/*do nothing*/;} //display is dimmed. } else if (backlightMode == BACKLIGHT_MODE_DIM) analogWrite(LCD_BL_PIN, backlightLevel_LOW); else analogWrite(LCD_BL_PIN, backlightLevel_HIGH); 11480: 60 91 00 04 lds r22, 0x0400 ; 0x800400 11484: f5 cf rjmp .-22 ; 0x11470 { if (backlightTimer.expired((uint32_t)backlightTimer_period * 1000ul)) analogWrite(LCD_BL_PIN, backlightLevel_LOW); else if (backlightTimer.running()) analogWrite(LCD_BL_PIN, backlightLevel_HIGH); else {/*do nothing*/;} //display is dimmed. } else if (backlightMode == BACKLIGHT_MODE_DIM) analogWrite(LCD_BL_PIN, backlightLevel_LOW); 11486: 81 11 cpse r24, r1 11488: fb cf rjmp .-10 ; 0x11480 1148a: f0 cf rjmp .-32 ; 0x1146c else analogWrite(LCD_BL_PIN, backlightLevel_HIGH); } 1148c: 08 95 ret 0001148e : 1148e: 60 91 00 04 lds r22, 0x0400 ; 0x800400 11492: 84 e3 ldi r24, 0x34 ; 52 11494: 9d e0 ldi r25, 0x0D ; 13 11496: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 1149a: 60 91 ff 03 lds r22, 0x03FF ; 0x8003ff 1149e: 83 e3 ldi r24, 0x33 ; 51 114a0: 9d e0 ldi r25, 0x0D ; 13 114a2: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 114a6: 60 91 4f 02 lds r22, 0x024F ; 0x80024f 114aa: 82 e3 ldi r24, 0x32 ; 50 114ac: 9d e0 ldi r25, 0x0D ; 13 114ae: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 114b2: 60 91 4d 02 lds r22, 0x024D ; 0x80024d 114b6: 70 91 4e 02 lds r23, 0x024E ; 0x80024e 114ba: 80 e3 ldi r24, 0x30 ; 48 114bc: 9d e0 ldi r25, 0x0D ; 13 114be: 0d 94 19 dc jmp 0x3b832 ; 0x3b832 000114c2 : backlight_update(); } void force_bl_on(bool section_start) { if (section_start) 114c2: 88 23 and r24, r24 114c4: 61 f0 breq .+24 ; 0x114de { backlightMode = BACKLIGHT_MODE_BRIGHT; 114c6: 81 e0 ldi r24, 0x01 ; 1 114c8: 80 93 4f 02 sts 0x024F, r24 ; 0x80024f if (backlightLevel_HIGH < 30) backlightLevel_HIGH = 30; 114cc: 80 91 00 04 lds r24, 0x0400 ; 0x800400 114d0: 8e 31 cpi r24, 0x1E ; 30 114d2: 18 f4 brcc .+6 ; 0x114da 114d4: 8e e1 ldi r24, 0x1E ; 30 } else { backlightMode = eeprom_read_byte((uint8_t *)EEPROM_BACKLIGHT_MODE); backlightLevel_HIGH = eeprom_read_byte((uint8_t *)EEPROM_BACKLIGHT_LEVEL_HIGH); 114d6: 80 93 00 04 sts 0x0400, r24 ; 0x800400 } backlight_update(); 114da: 0c 94 1e 8a jmp 0x1143c ; 0x1143c backlightMode = BACKLIGHT_MODE_BRIGHT; if (backlightLevel_HIGH < 30) backlightLevel_HIGH = 30; } else { backlightMode = eeprom_read_byte((uint8_t *)EEPROM_BACKLIGHT_MODE); 114de: 82 e3 ldi r24, 0x32 ; 50 114e0: 9d e0 ldi r25, 0x0D ; 13 114e2: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 114e6: 80 93 4f 02 sts 0x024F, r24 ; 0x80024f backlightLevel_HIGH = eeprom_read_byte((uint8_t *)EEPROM_BACKLIGHT_LEVEL_HIGH); 114ea: 84 e3 ldi r24, 0x34 ; 52 114ec: 9d e0 ldi r25, 0x0D ; 13 114ee: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 114f2: f1 cf rjmp .-30 ; 0x114d6 000114f4 : int16_t backlightTimer_period = 10; LongTimer backlightTimer; static void backlightTimer_reset() //used for resetting the timer and waking the display. Triggered on user interactions. { if (!backlightSupport) return; 114f4: 80 91 01 04 lds r24, 0x0401 ; 0x800401 114f8: 88 23 and r24, r24 114fa: 31 f0 breq .+12 ; 0x11508 backlightTimer.start(); 114fc: 85 e3 ldi r24, 0x35 ; 53 114fe: 93 e0 ldi r25, 0x03 ; 3 11500: 0f 94 c5 2b call 0x2578a ; 0x2578a ::start()> backlight_update(); 11504: 0c 94 1e 8a jmp 0x1143c ; 0x1143c } 11508: 08 95 ret 0001150a : } backlight_update(); } void backlight_wake(const uint8_t flashNo) { 1150a: ff 92 push r15 1150c: 0f 93 push r16 1150e: 1f 93 push r17 11510: cf 93 push r28 11512: df 93 push r29 if (!backlightSupport) return; 11514: 90 91 01 04 lds r25, 0x0401 ; 0x800401 11518: 99 23 and r25, r25 1151a: 99 f1 breq .+102 ; 0x11582 if (flashNo) 1151c: 88 23 and r24, r24 1151e: 51 f1 breq .+84 ; 0x11574 { uint8_t backlightMode_bck = backlightMode; 11520: 00 91 4f 02 lds r16, 0x024F ; 0x80024f for (uint8_t i = 0; i < (((backlightMode_bck == BACKLIGHT_MODE_AUTO) && !backlightTimer.running()) + (flashNo * 2)); i++) 11524: c8 2f mov r28, r24 11526: d0 e0 ldi r29, 0x00 ; 0 11528: cc 0f add r28, r28 1152a: dd 1f adc r29, r29 1152c: 10 e0 ldi r17, 0x00 ; 0 1152e: ff 24 eor r15, r15 11530: f3 94 inc r15 11532: 21 2f mov r18, r17 11534: 30 e0 ldi r19, 0x00 ; 0 11536: 80 91 35 03 lds r24, 0x0335 ; 0x800335 1153a: 8f 25 eor r24, r15 1153c: 02 30 cpi r16, 0x02 ; 2 1153e: 09 f0 breq .+2 ; 0x11542 11540: 80 e0 ldi r24, 0x00 ; 0 11542: 8c 0f add r24, r28 11544: 9d 2f mov r25, r29 11546: 91 1d adc r25, r1 11548: 28 17 cp r18, r24 1154a: 39 07 cpc r19, r25 1154c: 8c f4 brge .+34 ; 0x11570 { backlightMode = !backlightMode; //toggles between BACKLIGHT_MODE_BRIGHT and BACKLIGHT_MODE_DIM 1154e: 81 e0 ldi r24, 0x01 ; 1 11550: 90 91 4f 02 lds r25, 0x024F ; 0x80024f 11554: 91 11 cpse r25, r1 11556: 80 e0 ldi r24, 0x00 ; 0 11558: 80 93 4f 02 sts 0x024F, r24 ; 0x80024f backlight_update(); 1155c: 0e 94 1e 8a call 0x1143c ; 0x1143c _delay(BL_FLASH_DELAY_MS); 11560: 69 e1 ldi r22, 0x19 ; 25 11562: 70 e0 ldi r23, 0x00 ; 0 11564: 80 e0 ldi r24, 0x00 ; 0 11566: 90 e0 ldi r25, 0x00 ; 0 11568: 0f 94 29 27 call 0x24e52 ; 0x24e52 if (!backlightSupport) return; if (flashNo) { uint8_t backlightMode_bck = backlightMode; for (uint8_t i = 0; i < (((backlightMode_bck == BACKLIGHT_MODE_AUTO) && !backlightTimer.running()) + (flashNo * 2)); i++) 1156c: 1f 5f subi r17, 0xFF ; 255 1156e: e1 cf rjmp .-62 ; 0x11532 { backlightMode = !backlightMode; //toggles between BACKLIGHT_MODE_BRIGHT and BACKLIGHT_MODE_DIM backlight_update(); _delay(BL_FLASH_DELAY_MS); } backlightMode = backlightMode_bck; 11570: 00 93 4f 02 sts 0x024F, r16 ; 0x80024f } backlightTimer_reset(); } 11574: df 91 pop r29 11576: cf 91 pop r28 11578: 1f 91 pop r17 1157a: 0f 91 pop r16 1157c: ff 90 pop r15 backlight_update(); _delay(BL_FLASH_DELAY_MS); } backlightMode = backlightMode_bck; } backlightTimer_reset(); 1157e: 0c 94 7a 8a jmp 0x114f4 ; 0x114f4 } 11582: df 91 pop r29 11584: cf 91 pop r28 11586: 1f 91 pop r17 11588: 0f 91 pop r16 1158a: ff 90 pop r15 1158c: 08 95 ret 0001158e : } } #endif //SAFETYTIMER void manage_inactivity(bool ignore_stepper_queue/*=false*/) //default argument set in Marlin.h { 1158e: 0f 93 push r16 11590: 1f 93 push r17 11592: cf 93 push r28 11594: df 93 push r29 11596: c8 2f mov r28, r24 state = State::disabled; filter = 0; } bool PAT9125_sensor::update() { switch (state) { 11598: 80 91 a9 17 lds r24, 0x17A9 ; 0x8017a9 1159c: 81 30 cpi r24, 0x01 ; 1 1159e: 09 f4 brne .+2 ; 0x115a2 115a0: 41 c0 rjmp .+130 ; 0x11624 115a2: 82 30 cpi r24, 0x02 ; 2 115a4: 09 f4 brne .+2 ; 0x115a8 115a6: 57 c0 rjmp .+174 ; 0x11656 * * 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) 115a8: 0e 94 f9 67 call 0xcff2 ; 0xcff2 115ac: 81 11 cpse r24, r1 115ae: f9 c0 rjmp .+498 ; 0x117a2 115b0: 80 91 b5 0d lds r24, 0x0DB5 ; 0x800db5 115b4: 90 91 b6 0d lds r25, 0x0DB6 ; 0x800db6 115b8: 00 97 sbiw r24, 0x00 ; 0 115ba: 39 f4 brne .+14 ; 0x115ca 115bc: 20 91 71 06 lds r18, 0x0671 ; 0x800671 115c0: 30 91 72 06 lds r19, 0x0672 ; 0x800672 115c4: 23 2b or r18, r19 115c6: 09 f4 brne .+2 ; 0x115ca 115c8: ec c0 rjmp .+472 ; 0x117a2 115ca: 40 91 30 02 lds r20, 0x0230 ; 0x800230 115ce: 50 91 31 02 lds r21, 0x0231 ; 0x800231 115d2: 60 91 32 02 lds r22, 0x0232 ; 0x800232 115d6: 70 91 33 02 lds r23, 0x0233 ; 0x800233 115da: 41 15 cp r20, r1 115dc: 51 05 cpc r21, r1 115de: 61 05 cpc r22, r1 115e0: 71 05 cpc r23, r1 115e2: 09 f4 brne .+2 ; 0x115e6 115e4: de c0 rjmp .+444 ; 0x117a2 { safetyTimer.stop(); } else if ((CHECK_ALL_HEATERS) && !safetyTimer.running()) 115e6: 89 2b or r24, r25 115e8: 31 f4 brne .+12 ; 0x115f6 115ea: 80 91 71 06 lds r24, 0x0671 ; 0x800671 115ee: 90 91 72 06 lds r25, 0x0672 ; 0x800672 115f2: 89 2b or r24, r25 115f4: 29 f0 breq .+10 ; 0x11600 115f6: 80 91 d9 05 lds r24, 0x05D9 ; 0x8005d9 115fa: 88 23 and r24, r24 115fc: 09 f4 brne .+2 ; 0x11600 115fe: 39 c1 rjmp .+626 ; 0x11872 { safetyTimer.start(); } else if (safetyTimer.expired(farm_mode?FARM_DEFAULT_SAFETYTIMER_TIME_ms:safetytimer_inactive_time)) 11600: 89 ed ldi r24, 0xD9 ; 217 11602: 95 e0 ldi r25, 0x05 ; 5 11604: 0f 94 06 2a call 0x2540c ; 0x2540c ::expired(unsigned long)> 11608: 88 23 and r24, r24 1160a: 09 f4 brne .+2 ; 0x1160e 1160c: cc c0 rjmp .+408 ; 0x117a6 { disable_heater(); 1160e: 0f 94 ee 2e call 0x25ddc ; 0x25ddc lcd_show_fullscreen_message_and_wait_P(_T(MSG_BED_HEATING_SAFETY_DISABLED)); 11612: 82 e7 ldi r24, 0x72 ; 114 11614: 96 e3 ldi r25, 0x36 ; 54 11616: 0e 94 c4 72 call 0xe588 ; 0xe588 1161a: 0f 94 c7 1f call 0x23f8e ; 0x23f8e lcd_return_to_status(); 1161e: 0f 94 7c 1e call 0x23cf8 ; 0x23cf8 11622: c1 c0 rjmp .+386 ; 0x117a6 case State::initializing: if (!updatePAT9125()) { 11624: 0f 94 a3 7b call 0x2f746 ; 0x2f746 11628: 88 23 and r24, r24 1162a: 09 f4 brne .+2 ; 0x1162e 1162c: bd cf rjmp .-134 ; 0x115a8 class PAT9125_sensor: public Filament_sensor { public: void init(); void deinit(); bool update(); bool getFilamentPresent() const { return filterFilPresent; } 1162e: 81 e0 ldi r24, 0x01 ; 1 11630: 90 91 b6 17 lds r25, 0x17B6 ; 0x8017b6 11634: 91 11 cpse r25, r1 11636: 01 c0 rjmp .+2 ; 0x1163a 11638: 80 e0 ldi r24, 0x00 ; 0 break; // still not stable. Stay in the initialization state. } oldFilamentPresent = 1163a: 80 93 ac 17 sts 0x17AC, r24 ; 0x8017ac getFilamentPresent(); // initialize the current filament state so that we don't create a switching event right after the sensor is ready. oldPos = pat9125_y; 1163e: 80 91 8e 0e lds r24, 0x0E8E ; 0x800e8e 11642: 90 91 8f 0e lds r25, 0x0E8F ; 0x800e8f 11646: 90 93 b9 17 sts 0x17B9, r25 ; 0x8017b9 1164a: 80 93 b8 17 sts 0x17B8, r24 ; 0x8017b8 state = State::ready; 1164e: 82 e0 ldi r24, 0x02 ; 2 11650: 80 93 a9 17 sts 0x17A9, r24 ; 0x8017a9 11654: a9 cf rjmp .-174 ; 0x115a8 break; case State::ready: { updatePAT9125(); 11656: 0f 94 a3 7b call 0x2f746 ; 0x2f746 postponedLoadEvent = false; 1165a: 10 92 ad 17 sts 0x17AD, r1 ; 0x8017ad sensorActionOnError = SensorActionOnError::_Continue; } } bool Filament_sensor::checkFilamentEvents() { if (state != State::ready) 1165e: 80 91 a9 17 lds r24, 0x17A9 ; 0x8017a9 11662: 82 30 cpi r24, 0x02 ; 2 11664: 09 f0 breq .+2 ; 0x11668 11666: a0 cf rjmp .-192 ; 0x115a8 return false; if (eventBlankingTimer.running() && !eventBlankingTimer.expired(100)) { // event blanking for 100ms 11668: 80 91 ae 17 lds r24, 0x17AE ; 0x8017ae 1166c: 81 11 cpse r24, r1 1166e: 40 c0 rjmp .+128 ; 0x116f0 11670: d0 91 b6 17 lds r29, 0x17B6 ; 0x8017b6 11674: 81 e0 ldi r24, 0x01 ; 1 11676: d1 11 cpse r29, r1 11678: 01 c0 rjmp .+2 ; 0x1167c 1167a: 80 e0 ldi r24, 0x00 ; 0 return false; } bool newFilamentPresent = fsensor.getFilamentPresent(); if (oldFilamentPresent != newFilamentPresent) { 1167c: 90 91 ac 17 lds r25, 0x17AC ; 0x8017ac 11680: 89 17 cp r24, r25 11682: 09 f4 brne .+2 ; 0x11686 11684: 91 cf rjmp .-222 ; 0x115a8 oldFilamentPresent = newFilamentPresent; 11686: 80 93 ac 17 sts 0x17AC, r24 ; 0x8017ac eventBlankingTimer.start(); 1168a: 8e ea ldi r24, 0xAE ; 174 1168c: 97 e1 ldi r25, 0x17 ; 23 1168e: 0f 94 83 29 call 0x25306 ; 0x25306 ::start()> if (newFilamentPresent) { // filament insertion 11692: dd 23 and r29, r29 11694: b1 f1 breq .+108 ; 0x11702 } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) && !( 11696: 80 91 aa 17 lds r24, 0x17AA ; 0x8017aa 1169a: 88 23 and r24, r24 1169c: 11 f1 breq .+68 ; 0x116e2 return false; } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) 1169e: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 116a2: 81 11 cpse r24, r1 116a4: 1e c0 rjmp .+60 ; 0x116e2 && !( 116a6: 80 91 b9 13 lds r24, 0x13B9 ; 0x8013b9 116aa: 81 30 cpi r24, 0x01 ; 1 116ac: d1 f0 breq .+52 ; 0x116e2 } //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); 116ae: 80 91 a4 0d lds r24, 0x0DA4 ; 0x800da4 116b2: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 116b6: 89 1b sub r24, r25 116b8: 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 116ba: 99 f4 brne .+38 ; 0x116e2 || printJobOngoing() 116bc: 0e 94 a8 67 call 0xcf50 ; 0xcf50 116c0: 81 11 cpse r24, r1 116c2: 0f c0 rjmp .+30 ; 0x116e2 || (lcd_commands_type == LcdCommands::Layer1Cal) 116c4: 80 91 b3 0d lds r24, 0x0DB3 ; 0x800db3 116c8: 84 30 cpi r24, 0x04 ; 4 116ca: 59 f0 breq .+22 ; 0x116e2 || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) 116cc: 8f e5 ldi r24, 0x5F ; 95 116ce: 9f e0 ldi r25, 0x0F ; 15 116d0: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) && !( 116d4: 81 11 cpse r24, r1 116d6: 05 c0 rjmp .+10 ; 0x116e2 || printJobOngoing() || (lcd_commands_type == LcdCommands::Layer1Cal) || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) ) ) { menu_submenu(lcd_AutoLoadFilament, true); 116d8: 61 e0 ldi r22, 0x01 ; 1 116da: 8c e2 ldi r24, 0x2C ; 44 116dc: 9a e3 ldi r25, 0x3A ; 58 116de: 0f 94 be d2 call 0x3a57c ; 0x3a57c oldFilamentPresent = newFilamentPresent; eventBlankingTimer.start(); if (newFilamentPresent) { // filament insertion // puts_P(PSTR("filament inserted")); triggerFilamentInserted(); postponedLoadEvent = true; 116e2: 81 e0 ldi r24, 0x01 ; 1 116e4: 80 93 ad 17 sts 0x17AD, r24 ; 0x8017ad 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. 116e8: 81 e0 ldi r24, 0x01 ; 1 116ea: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d 116ee: 5c cf rjmp .-328 ; 0x115a8 } bool Filament_sensor::checkFilamentEvents() { if (state != State::ready) return false; if (eventBlankingTimer.running() && !eventBlankingTimer.expired(100)) { // event blanking for 100ms 116f0: 64 e6 ldi r22, 0x64 ; 100 116f2: 70 e0 ldi r23, 0x00 ; 0 116f4: 8e ea ldi r24, 0xAE ; 174 116f6: 97 e1 ldi r25, 0x17 ; 23 116f8: 0f 94 54 29 call 0x252a8 ; 0x252a8 ::expired(unsigned short)> 116fc: 81 11 cpse r24, r1 116fe: b8 cf rjmp .-144 ; 0x11670 11700: 53 cf rjmp .-346 ; 0x115a8 && (eFilamentAction == FilamentAction::None) && ( moves_planned() != 0 || printJobOngoing() ) && !( 11702: 80 91 ab 17 lds r24, 0x17AB ; 0x8017ab 11706: 88 23 and r24, r24 11708: 79 f3 breq .-34 ; 0x116e8 } void Filament_sensor::triggerFilamentRemoved() { // SERIAL_ECHOLNPGM("triggerFilamentRemoved"); if (runoutEnabled && (eFilamentAction == FilamentAction::None) 1170a: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 1170e: 81 11 cpse r24, r1 11710: eb cf rjmp .-42 ; 0x116e8 11712: 80 91 a4 0d lds r24, 0x0DA4 ; 0x800da4 11716: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 1171a: 89 1b sub r24, r25 1171c: 8f 70 andi r24, 0x0F ; 15 && ( 1171e: 21 f4 brne .+8 ; 0x11728 moves_planned() != 0 || printJobOngoing() 11720: 0e 94 a8 67 call 0xcf50 ; 0xcf50 11724: 88 23 and r24, r24 11726: 01 f3 breq .-64 ; 0x116e8 ) && !( 11728: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 1172c: 81 11 cpse r24, r1 1172e: dc cf rjmp .-72 ; 0x116e8 saved_printing || MMU2::mmu2.Enabled() // quick and dirty hack to prevent spurious runouts just before the toolchange 11730: 80 91 b9 13 lds r24, 0x13B9 ; 0x8013b9 11734: 81 30 cpi r24, 0x01 ; 1 11736: c1 f2 breq .-80 ; 0x116e8 || (lcd_commands_type == LcdCommands::Layer1Cal) 11738: 80 91 b3 0d lds r24, 0x0DB3 ; 0x800db3 1173c: 84 30 cpi r24, 0x04 ; 4 1173e: a1 f2 breq .-88 ; 0x116e8 || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) 11740: 8f e5 ldi r24, 0x5F ; 95 11742: 9f e0 ldi r25, 0x0F ; 15 11744: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae && (eFilamentAction == FilamentAction::None) && ( moves_planned() != 0 || printJobOngoing() ) && !( 11748: 81 11 cpse r24, r1 1174a: ce cf rjmp .-100 ; 0x116e8 } //! @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); 1174c: 8e ec ldi r24, 0xCE ; 206 1174e: 96 e6 ldi r25, 0x66 ; 102 11750: 9f 93 push r25 11752: 8f 93 push r24 11754: 84 eb ldi r24, 0xB4 ; 180 11756: 96 e6 ldi r25, 0x66 ; 102 11758: 9f 93 push r25 1175a: 8f 93 push r24 1175c: 0f 94 99 da call 0x3b532 ; 0x3b532 void Filament_sensor::filRunout() { // SERIAL_ECHOLNPGM("filRunout"); sendHostNotification_P(MSG_FILAMENT_RUNOUT_DETECTED); runoutEnabled = false; 11760: 10 92 ab 17 sts 0x17AB, r1 ; 0x8017ab autoLoadEnabled = false; 11764: 10 92 aa 17 sts 0x17AA, r1 ; 0x8017aa stop_and_save_print_to_ram(0, 0); 11768: 20 e0 ldi r18, 0x00 ; 0 1176a: 30 e0 ldi r19, 0x00 ; 0 1176c: a9 01 movw r20, r18 1176e: ca 01 movw r24, r20 11770: b9 01 movw r22, r18 11772: 0e 94 4f 89 call 0x1129e ; 0x1129e restore_print_from_ram_and_continue(0); 11776: 60 e0 ldi r22, 0x00 ; 0 11778: 70 e0 ldi r23, 0x00 ; 0 1177a: cb 01 movw r24, r22 1177c: 0e 94 5c 68 call 0xd0b8 ; 0xd0b8 eeprom_increment_byte((uint8_t *)EEPROM_FERROR_COUNT); 11780: 85 e6 ldi r24, 0x65 ; 101 11782: 9f e0 ldi r25, 0x0F ; 15 11784: 0e 94 40 76 call 0xec80 ; 0xec80 eeprom_increment_word((uint16_t *)EEPROM_FERROR_COUNT_TOT); 11788: 81 e0 ldi r24, 0x01 ; 1 1178a: 9f e0 ldi r25, 0x0F ; 15 1178c: 0e 94 33 76 call 0xec66 ; 0xec66 enquecommand_front_P(MSG_M600); 11790: 8c e2 ldi r24, 0x2C ; 44 11792: 91 e7 ldi r25, 0x71 ; 113 11794: 0f 94 b8 74 call 0x2e970 ; 0x2e970 11798: 0f 90 pop r0 1179a: 0f 90 pop r0 1179c: 0f 90 pop r0 1179e: 0f 90 pop r0 117a0: a3 cf rjmp .-186 ; 0x116e8 inline constexpr Timer() : m_isRunning(false) , m_started(0) {}; void start(); void stop(){m_isRunning = false;} 117a2: 10 92 d9 05 sts 0x05D9, r1 ; 0x8005d9 #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)){ 117a6: 80 91 a2 10 lds r24, 0x10A2 ; 0x8010a2 117aa: 90 91 a3 10 lds r25, 0x10A3 ; 0x8010a3 117ae: 03 97 sbiw r24, 0x03 ; 3 117b0: 14 f4 brge .+4 ; 0x117b6 get_command(); 117b2: 0e 94 38 83 call 0x10670 ; 0x10670 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); 117b6: 90 91 a4 0d lds r25, 0x0DA4 ; 0x800da4 117ba: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 } if (blocks_queued() && GetPrinterState() == PrinterState::IsHostPrinting && usb_timer.expired((USB_TIMER_TIMEOUT) / 2)) 117be: 98 17 cp r25, r24 117c0: 81 f0 breq .+32 ; 0x117e2 117c2: 80 91 b7 0d lds r24, 0x0DB7 ; 0x800db7 <_ZL13printer_state.lto_priv.401> 117c6: 86 30 cpi r24, 0x06 ; 6 117c8: 61 f4 brne .+24 ; 0x117e2 117ca: 68 e8 ldi r22, 0x88 ; 136 117cc: 73 e1 ldi r23, 0x13 ; 19 117ce: 8d e0 ldi r24, 0x0D ; 13 117d0: 95 e0 ldi r25, 0x05 ; 5 117d2: 0f 94 54 29 call 0x252a8 ; 0x252a8 ::expired(unsigned short)> 117d6: 88 23 and r24, r24 117d8: 21 f0 breq .+8 ; 0x117e2 { // 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(); 117da: 8d e0 ldi r24, 0x0D ; 13 117dc: 95 e0 ldi r25, 0x05 ; 5 117de: 0f 94 83 29 call 0x25306 ; 0x25306 ::start()> } if(max_inactive_time && previous_millis_cmd.expired(max_inactive_time)) 117e2: 40 91 7c 03 lds r20, 0x037C ; 0x80037c 117e6: 50 91 7d 03 lds r21, 0x037D ; 0x80037d 117ea: 60 91 7e 03 lds r22, 0x037E ; 0x80037e 117ee: 70 91 7f 03 lds r23, 0x037F ; 0x80037f 117f2: 41 15 cp r20, r1 117f4: 51 05 cpc r21, r1 117f6: 61 05 cpc r22, r1 117f8: 71 05 cpc r23, r1 117fa: 09 f0 breq .+2 ; 0x117fe 117fc: 3f c0 rjmp .+126 ; 0x1187c kill(PSTR("Inactivity Shutdown")); if(stepper_inactive_time && previous_millis_cmd.expired(stepper_inactive_time)) { 117fe: 40 91 34 02 lds r20, 0x0234 ; 0x800234 11802: 50 91 35 02 lds r21, 0x0235 ; 0x800235 11806: 60 91 36 02 lds r22, 0x0236 ; 0x800236 1180a: 70 91 37 02 lds r23, 0x0237 ; 0x800237 1180e: 41 15 cp r20, r1 11810: 51 05 cpc r21, r1 11812: 61 05 cpc r22, r1 11814: 71 05 cpc r23, r1 11816: a9 f0 breq .+42 ; 0x11842 11818: 84 e8 ldi r24, 0x84 ; 132 1181a: 93 e0 ldi r25, 0x03 ; 3 1181c: 0f 94 06 2a call 0x2540c ; 0x2540c ::expired(unsigned long)> 11820: 88 23 and r24, r24 11822: 79 f0 breq .+30 ; 0x11842 11824: 90 91 a4 0d lds r25, 0x0DA4 ; 0x800da4 11828: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 if(blocks_queued() == false && ignore_stepper_queue == false) { 1182c: 98 13 cpse r25, r24 1182e: 09 c0 rjmp .+18 ; 0x11842 11830: c1 11 cpse r28, r1 11832: 07 c0 rjmp .+14 ; 0x11842 disable_x(); 11834: 17 9a sbi 0x02, 7 ; 2 11836: 10 92 8e 06 sts 0x068E, r1 ; 0x80068e disable_y(); 1183a: 16 9a sbi 0x02, 6 ; 2 1183c: 10 92 8f 06 sts 0x068F, r1 ; 0x80068f disable_z(); disable_e0(); 11840: 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; 11842: c0 91 e5 03 lds r28, 0x03E5 ; 0x8003e5 block_t *block; if(block_buffer_tail != block_buffer_head) 11846: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 1184a: 80 91 a4 0d lds r24, 0x0DA4 ; 0x800da4 1184e: 98 17 cp r25, r24 11850: 01 f1 breq .+64 ; 0x11892 { uint8_t block_index = block_buffer_tail; 11852: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 tail_fan_speed = block_buffer[block_index].fan_speed; 11856: 9e e6 ldi r25, 0x6E ; 110 11858: 89 9f mul r24, r25 1185a: f0 01 movw r30, r0 1185c: 11 24 eor r1, r1 1185e: e6 5f subi r30, 0xF6 ; 246 11860: f8 4f sbci r31, 0xF8 ; 248 11862: c0 81 ld r28, Z while(block_index != block_buffer_head) 11864: 90 91 a4 0d lds r25, 0x0DA4 ; 0x800da4 11868: 98 17 cp r25, r24 1186a: 99 f0 breq .+38 ; 0x11892 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); 1186c: 8f 5f subi r24, 0xFF ; 255 1186e: 8f 70 andi r24, 0x0F ; 15 11870: f9 cf rjmp .-14 ; 0x11864 { safetyTimer.stop(); } else if ((CHECK_ALL_HEATERS) && !safetyTimer.running()) { safetyTimer.start(); 11872: 89 ed ldi r24, 0xD9 ; 217 11874: 95 e0 ldi r25, 0x05 ; 5 11876: 0f 94 c5 2b call 0x2578a ; 0x2578a ::start()> 1187a: 95 cf rjmp .-214 ; 0x117a6 // 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)) 1187c: 84 e8 ldi r24, 0x84 ; 132 1187e: 93 e0 ldi r25, 0x03 ; 3 11880: 0f 94 06 2a call 0x2540c ; 0x2540c ::expired(unsigned long)> 11884: 88 23 and r24, r24 11886: 09 f4 brne .+2 ; 0x1188a 11888: ba cf rjmp .-140 ; 0x117fe kill(PSTR("Inactivity Shutdown")); 1188a: 80 ec ldi r24, 0xC0 ; 192 1188c: 9d e7 ldi r25, 0x7D ; 125 1188e: 0e 94 22 7a call 0xf444 ; 0xf444 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) { 11892: cc 23 and r28, r28 11894: 09 f4 brne .+2 ; 0x11898 11896: 9f c0 rjmp .+318 ; 0x119d6 if (fan_kick_end == 0) { 11898: 80 91 6a 03 lds r24, 0x036A ; 0x80036a 1189c: 90 91 6b 03 lds r25, 0x036B ; 0x80036b 118a0: a0 91 6c 03 lds r26, 0x036C ; 0x80036c 118a4: b0 91 6d 03 lds r27, 0x036D ; 0x80036d 118a8: 89 2b or r24, r25 118aa: 8a 2b or r24, r26 118ac: 8b 2b or r24, r27 118ae: 81 f4 brne .+32 ; 0x118d0 // Just starting up fan - run at full power. fan_kick_end = _millis() + FAN_KICKSTART_TIME; 118b0: 0f 94 22 29 call 0x25244 ; 0x25244 118b4: 60 5e subi r22, 0xE0 ; 224 118b6: 7c 4f sbci r23, 0xFC ; 252 118b8: 8f 4f sbci r24, 0xFF ; 255 118ba: 9f 4f sbci r25, 0xFF ; 255 118bc: 60 93 6a 03 sts 0x036A, r22 ; 0x80036a 118c0: 70 93 6b 03 sts 0x036B, r23 ; 0x80036b 118c4: 80 93 6c 03 sts 0x036C, r24 ; 0x80036c 118c8: 90 93 6d 03 sts 0x036D, r25 ; 0x80036d tail_fan_speed = 255; } else if (fan_kick_end > _millis()) // Fan still spinning up. tail_fan_speed = 255; 118cc: cf ef ldi r28, 0xFF ; 255 118ce: 0f c0 rjmp .+30 ; 0x118ee 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()) 118d0: 0f 94 22 29 call 0x25244 ; 0x25244 118d4: 00 91 6a 03 lds r16, 0x036A ; 0x80036a 118d8: 10 91 6b 03 lds r17, 0x036B ; 0x80036b 118dc: 20 91 6c 03 lds r18, 0x036C ; 0x80036c 118e0: 30 91 6d 03 lds r19, 0x036D ; 0x80036d 118e4: 60 17 cp r22, r16 118e6: 71 07 cpc r23, r17 118e8: 82 07 cpc r24, r18 118ea: 93 07 cpc r25, r19 118ec: 78 f3 brcs .-34 ; 0x118cc } 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 118ee: 80 91 6e 06 lds r24, 0x066E ; 0x80066e 118f2: 88 23 and r24, r24 118f4: 09 f4 brne .+2 ; 0x118f8 118f6: 78 c0 rjmp .+240 ; 0x119e8 fanSpeedBckp = tail_fan_speed; 118f8: c0 93 14 02 sts 0x0214, r28 ; 0x800214 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) { 118fc: 80 91 0b 05 lds r24, 0x050B ; 0x80050b <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.540> 11900: 81 11 cpse r24, r1 11902: 07 c0 rjmp .+14 ; 0x11912 return; } avoidRecursion = true; 11904: 81 e0 ldi r24, 0x01 ; 1 11906: 80 93 0b 05 sts 0x050B, r24 ; 0x80050b <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.540> mmu_loop_inner(true); 1190a: 0f 94 bd a6 call 0x34d7a ; 0x34d7a avoidRecursion = false; 1190e: 10 92 0b 05 sts 0x050B, r1 ; 0x80050b <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.540> lcd_draw_update = 2; lcd_beeper_quick_feedback(); } void lcd_knob_update() { if (lcd_backlight_wake_trigger) { 11912: 80 91 d2 05 lds r24, 0x05D2 ; 0x8005d2 <_ZL26lcd_backlight_wake_trigger.lto_priv.538> 11916: 88 23 and r24, r24 11918: e1 f1 breq .+120 ; 0x11992 lcd_backlight_wake_trigger = false; 1191a: 10 92 d2 05 sts 0x05D2, r1 ; 0x8005d2 <_ZL26lcd_backlight_wake_trigger.lto_priv.538> backlight_wake(); 1191e: 80 e0 ldi r24, 0x00 ; 0 11920: 0e 94 85 8a call 0x1150a ; 0x1150a bool did_rotate = false; ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 11924: 4f b7 in r20, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 11926: f8 94 cli if (abs(lcd_encoder_diff) >= ENCODER_PULSES_PER_STEP) { 11928: 80 91 d0 05 lds r24, 0x05D0 ; 0x8005d0 <_ZL16lcd_encoder_diff.lto_priv.539> 1192c: 28 2f mov r18, r24 1192e: 08 2e mov r0, r24 11930: 00 0c add r0, r0 11932: 33 0b sbc r19, r19 11934: 37 ff sbrs r19, 7 11936: 03 c0 rjmp .+6 ; 0x1193e 11938: 31 95 neg r19 1193a: 21 95 neg r18 1193c: 31 09 sbc r19, r1 1193e: 24 30 cpi r18, 0x04 ; 4 11940: 31 05 cpc r19, r1 11942: 0c f4 brge .+2 ; 0x11946 11944: 54 c0 rjmp .+168 ; 0x119ee lcd_encoder += lcd_encoder_diff / ENCODER_PULSES_PER_STEP; 11946: 98 2f mov r25, r24 11948: 87 ff sbrs r24, 7 1194a: 02 c0 rjmp .+4 ; 0x11950 1194c: 93 e0 ldi r25, 0x03 ; 3 1194e: 98 0f add r25, r24 11950: 95 95 asr r25 11952: 95 95 asr r25 11954: 20 91 6f 06 lds r18, 0x066F ; 0x80066f 11958: 30 91 70 06 lds r19, 0x0670 ; 0x800670 1195c: 29 0f add r18, r25 1195e: 31 1d adc r19, r1 11960: 97 fd sbrc r25, 7 11962: 3a 95 dec r19 11964: 30 93 70 06 sts 0x0670, r19 ; 0x800670 11968: 20 93 6f 06 sts 0x066F, r18 ; 0x80066f lcd_encoder_diff %= ENCODER_PULSES_PER_STEP; 1196c: 83 78 andi r24, 0x83 ; 131 1196e: 87 ff sbrs r24, 7 11970: 03 c0 rjmp .+6 ; 0x11978 11972: 81 50 subi r24, 0x01 ; 1 11974: 8c 6f ori r24, 0xFC ; 252 11976: 8f 5f subi r24, 0xFF ; 255 11978: 80 93 d0 05 sts 0x05D0, r24 ; 0x8005d0 <_ZL16lcd_encoder_diff.lto_priv.539> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 1197c: 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); 1197e: 86 e0 ldi r24, 0x06 ; 6 11980: 0f 94 c2 4d call 0x29b84 ; 0x29b84 if (lcd_draw_update == 0) { 11984: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 11988: 81 11 cpse r24, r1 1198a: 03 c0 rjmp .+6 ; 0x11992 // Update LCD rendering at minimum lcd_draw_update = 1; 1198c: 81 e0 ldi r24, 0x01 ; 1 1198e: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d #endif check_axes_activity(); MMU2::mmu2.mmu_loop(); lcd_knob_update(); backlight_update(); 11992: 0e 94 1e 8a call 0x1143c ; 0x1143c // handle longpress if(lcd_longpress_trigger) 11996: 80 91 d3 05 lds r24, 0x05D3 ; 0x8005d3 1199a: 88 23 and r24, r24 1199c: 61 f0 breq .+24 ; 0x119b6 { lcd_consume_click(); // Reset trigger to prevent recursion 1199e: 0e 94 10 71 call 0xe220 ; 0xe220 // long press is not possible in modal mode, wait until ready if (lcd_longpress_func && lcd_update_enabled) 119a2: e0 91 16 04 lds r30, 0x0416 ; 0x800416 119a6: f0 91 17 04 lds r31, 0x0417 ; 0x800417 119aa: 30 97 sbiw r30, 0x00 ; 0 119ac: 21 f0 breq .+8 ; 0x119b6 119ae: 80 91 6e 02 lds r24, 0x026E ; 0x80026e 119b2: 81 11 cpse r24, r1 { lcd_longpress_func(); 119b4: 19 95 eicall } } #if defined(AUTO_REPORT) host_autoreport(); 119b6: 0e 94 70 79 call 0xf2e0 ; 0xf2e0 #endif //AUTO_REPORT host_keepalive(); 119ba: 0e 94 bf 7f call 0xff7e ; 0xff7e bool M79_timer_get_status() { return M79_timer.running(); } void M79_timer_update_status() { M79_timer.expired(M79_TIMEOUT); 119be: 40 e3 ldi r20, 0x30 ; 48 119c0: 55 e7 ldi r21, 0x75 ; 117 119c2: 60 e0 ldi r22, 0x00 ; 0 119c4: 70 e0 ldi r23, 0x00 ; 0 119c6: 8c e9 ldi r24, 0x9C ; 156 119c8: 93 e0 ldi r25, 0x03 ; 3 M79_timer_update_status(); } 119ca: df 91 pop r29 119cc: cf 91 pop r28 119ce: 1f 91 pop r17 119d0: 0f 91 pop r16 119d2: 0d 94 06 2a jmp 0x2540c ; 0x2540c ::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; 119d6: 10 92 6a 03 sts 0x036A, r1 ; 0x80036a 119da: 10 92 6b 03 sts 0x036B, r1 ; 0x80036b 119de: 10 92 6c 03 sts 0x036C, r1 ; 0x80036c 119e2: 10 92 6d 03 sts 0x036D, r1 ; 0x80036d 119e6: 83 cf rjmp .-250 ; 0x118ee #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; 119e8: c0 93 a5 04 sts 0x04A5, r28 ; 0x8004a5 119ec: 87 cf rjmp .-242 ; 0x118fc 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; 119ee: 10 92 d0 05 sts 0x05D0, r1 ; 0x8005d0 <_ZL16lcd_encoder_diff.lto_priv.539> 119f2: 4f bf out 0x3f, r20 ; 63 } } Sound_MakeSound(did_rotate ? e_SOUND_TYPE_EncoderMove : e_SOUND_TYPE_ButtonEcho); 119f4: 80 e0 ldi r24, 0x00 ; 0 119f6: c4 cf rjmp .-120 ; 0x11980 000119f8 : #endif #endif } void delay_keep_alive(unsigned int ms) { 119f8: cf 93 push r28 119fa: df 93 push r29 119fc: ec 01 movw r28, r24 for (;;) { manage_heater(); 119fe: 0f 94 2e 38 call 0x2705c ; 0x2705c // Manage inactivity, but don't disable steppers on timeout. manage_inactivity(true); 11a02: 81 e0 ldi r24, 0x01 ; 1 11a04: 0e 94 c7 8a call 0x1158e ; 0x1158e lcd_update(0); 11a08: 80 e0 ldi r24, 0x00 ; 0 11a0a: 0e 94 bf 6e call 0xdd7e ; 0xdd7e if (ms == 0) 11a0e: 20 97 sbiw r28, 0x00 ; 0 11a10: 99 f0 breq .+38 ; 0x11a38 break; else if (ms >= 50) { 11a12: c2 33 cpi r28, 0x32 ; 50 11a14: d1 05 cpc r29, r1 11a16: 40 f0 brcs .+16 ; 0x11a28 _delay(50); 11a18: 62 e3 ldi r22, 0x32 ; 50 11a1a: 70 e0 ldi r23, 0x00 ; 0 11a1c: 80 e0 ldi r24, 0x00 ; 0 11a1e: 90 e0 ldi r25, 0x00 ; 0 11a20: 0f 94 29 27 call 0x24e52 ; 0x24e52 ms -= 50; 11a24: e2 97 sbiw r28, 0x32 ; 50 11a26: eb cf rjmp .-42 ; 0x119fe } else { _delay(ms); 11a28: be 01 movw r22, r28 11a2a: 90 e0 ldi r25, 0x00 ; 0 11a2c: 80 e0 ldi r24, 0x00 ; 0 11a2e: 0f 94 29 27 call 0x24e52 ; 0x24e52 ms = 0; 11a32: d0 e0 ldi r29, 0x00 ; 0 11a34: c0 e0 ldi r28, 0x00 ; 0 11a36: e3 cf rjmp .-58 ; 0x119fe } } } 11a38: df 91 pop r29 11a3a: cf 91 pop r28 11a3c: 08 95 ret 00011a3e : /// @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) { 11a3e: cf 93 push r28 11a40: df 93 push r29 11a42: c8 2f mov r28, r24 inline Buttons GetPrinterButtonOperation() { return printerButtonOperation; } inline void ClearPrinterButtonOperation() { printerButtonOperation = Buttons::NoButton; 11a44: df ef ldi r29, 0xFF ; 255 MMU2::Buttons btn; for(;;) { manage_heater(); 11a46: 0f 94 2e 38 call 0x2705c ; 0x2705c manage_inactivity(true); 11a4a: 81 e0 ldi r24, 0x01 ; 1 11a4c: 0e 94 c7 8a call 0x1158e ; 0x1158e 11a50: 80 91 b7 13 lds r24, 0x13B7 ; 0x8013b7 btn = MMU2::mmu2.GetPrinterButtonOperation(); if (btn != MMU2::Buttons::NoButton) 11a54: 8f 3f cpi r24, 0xFF ; 255 11a56: d9 f4 brne .+54 ; 0x11a8e // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { 11a58: 80 91 4c 13 lds r24, 0x134C ; 0x80134c 11a5c: 84 30 cpi r24, 0x04 ; 4 11a5e: 21 f4 brne .+8 ; 0x11a68 }; 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 11a60: 80 91 4f 13 lds r24, 0x134F ; 0x80134f 11a64: 81 11 cpse r24, r1 11a66: ef cf rjmp .-34 ; 0x11a46 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 11a68: 80 91 8a 13 lds r24, 0x138A ; 0x80138a 11a6c: 90 91 8b 13 lds r25, 0x138B ; 0x80138b 11a70: 01 97 sbiw r24, 0x01 ; 1 11a72: 49 f7 brne .-46 ; 0x11a46 && lastErrorCode != ec) // The error code is not a duplicate 11a74: 80 91 b1 13 lds r24, 0x13B1 ; 0x8013b1 11a78: 90 91 b2 13 lds r25, 0x13B2 ; 0x8013b2 11a7c: 89 32 cpi r24, 0x29 ; 41 11a7e: 90 48 sbci r25, 0x80 ; 128 11a80: 11 f3 breq .-60 ; 0x11a46 { ReportError(ec, ErrorSource::ErrorSourcePrinter); 11a82: 60 e0 ldi r22, 0x00 ; 0 11a84: 89 e2 ldi r24, 0x29 ; 41 11a86: 90 e8 ldi r25, 0x80 ; 128 11a88: 0f 94 a9 82 call 0x30552 ; 0x30552 11a8c: dc cf rjmp .-72 ; 0x11a46 inline Buttons GetPrinterButtonOperation() { return printerButtonOperation; } inline void ClearPrinterButtonOperation() { printerButtonOperation = Buttons::NoButton; 11a8e: d0 93 b7 13 sts 0x13B7, r29 ; 0x8013b7 { MMU2::mmu2.ClearPrinterButtonOperation(); if (btn == MMU2::Buttons::Eject) { 11a92: 85 30 cpi r24, 0x05 ; 5 11a94: 39 f4 brne .+14 ; 0x11aa4 if (eject_slot != (uint8_t)MMU2::FILAMENT_UNKNOWN) { 11a96: cf 3f cpi r28, 0xFF ; 255 11a98: f9 f2 breq .-66 ; 0x11a58 MMU2::mmu2.eject_filament(eject_slot, true); 11a9a: 61 e0 ldi r22, 0x01 ; 1 11a9c: 8c 2f mov r24, r28 11a9e: 0f 94 53 ad call 0x35aa6 ; 0x35aa6 11aa2: d1 cf rjmp .-94 ; 0x11a46 // the operation is done. We must be careful to not raise FILAMENT_CHANGE // screen too quickly continue; } } else if (btn == MMU2::Buttons::Load) 11aa4: 84 30 cpi r24, 0x04 ; 4 11aa6: c1 f6 brne .-80 ; 0x11a58 } } MMU2::mmu2.InvokeErrorScreen(ErrorCode::FILAMENT_CHANGE); } } 11aa8: df 91 pop r29 11aaa: cf 91 pop r28 11aac: 08 95 ret 00011aae <__vector_29>: #ifdef ADC_CALLBACK extern void ADC_CALLBACK(); #endif //ADC_CALLBACK ISR(ADC_vect) { 11aae: 1f 92 push r1 11ab0: 0f 92 push r0 11ab2: 0f b6 in r0, 0x3f ; 63 11ab4: 0f 92 push r0 11ab6: 11 24 eor r1, r1 11ab8: 0b b6 in r0, 0x3b ; 59 11aba: 0f 92 push r0 11abc: 2f 93 push r18 11abe: 3f 93 push r19 11ac0: 4f 93 push r20 11ac2: 5f 93 push r21 11ac4: 6f 93 push r22 11ac6: 7f 93 push r23 11ac8: 8f 93 push r24 11aca: 9f 93 push r25 11acc: af 93 push r26 11ace: bf 93 push r27 11ad0: ef 93 push r30 11ad2: ff 93 push r31 adc_values[adc_channel] += ADC; 11ad4: 20 91 78 00 lds r18, 0x0078 ; 0x800078 <__TEXT_REGION_LENGTH__+0x7c2078> 11ad8: 30 91 79 00 lds r19, 0x0079 ; 0x800079 <__TEXT_REGION_LENGTH__+0x7c2079> 11adc: e0 91 34 03 lds r30, 0x0334 ; 0x800334 11ae0: f0 e0 ldi r31, 0x00 ; 0 11ae2: ee 0f add r30, r30 11ae4: ff 1f adc r31, r31 11ae6: ec 5d subi r30, 0xDC ; 220 11ae8: fc 4f sbci r31, 0xFC ; 252 11aea: 80 81 ld r24, Z 11aec: 91 81 ldd r25, Z+1 ; 0x01 11aee: 82 0f add r24, r18 11af0: 93 1f adc r25, r19 11af2: 91 83 std Z+1, r25 ; 0x01 11af4: 80 83 st Z, r24 if (++adc_count == ADC_OVRSAMPL) 11af6: 80 91 23 03 lds r24, 0x0323 ; 0x800323 11afa: 8f 5f subi r24, 0xFF ; 255 11afc: 80 93 23 03 sts 0x0323, r24 ; 0x800323 11b00: 80 31 cpi r24, 0x10 ; 16 11b02: 09 f0 breq .+2 ; 0x11b06 <__vector_29+0x58> 11b04: 56 c0 rjmp .+172 ; 0x11bb2 <__vector_29+0x104> { // go to the next channel if (++adc_channel == ADC_CHAN_CNT) { 11b06: 80 91 34 03 lds r24, 0x0334 ; 0x800334 11b0a: 8f 5f subi r24, 0xFF ; 255 11b0c: 80 93 34 03 sts 0x0334, r24 ; 0x800334 11b10: 88 30 cpi r24, 0x08 ; 8 11b12: 09 f0 breq .+2 ; 0x11b16 <__vector_29+0x68> 11b14: 46 c0 rjmp .+140 ; 0x11ba2 <__vector_29+0xf4> #endif // ISR callback from adc when sampling finished void adc_callback() { current_temperature_raw[0] = adc_values[ADC_PIN_IDX(TEMP_0_PIN)]; //heater 11b16: 80 91 24 03 lds r24, 0x0324 ; 0x800324 11b1a: 90 91 25 03 lds r25, 0x0325 ; 0x800325 11b1e: 90 93 0b 06 sts 0x060B, r25 ; 0x80060b 11b22: 80 93 0a 06 sts 0x060A, r24 ; 0x80060a current_temperature_bed_raw = adc_values[ADC_PIN_IDX(TEMP_BED_PIN)]; 11b26: 80 91 28 03 lds r24, 0x0328 ; 0x800328 11b2a: 90 91 29 03 lds r25, 0x0329 ; 0x800329 11b2e: 90 93 09 06 sts 0x0609, r25 ; 0x800609 11b32: 80 93 08 06 sts 0x0608, r24 ; 0x800608 #ifdef PINDA_THERMISTOR current_temperature_raw_pinda = adc_values[ADC_PIN_IDX(TEMP_PINDA_PIN)]; 11b36: 80 91 2a 03 lds r24, 0x032A ; 0x80032a 11b3a: 90 91 2b 03 lds r25, 0x032B ; 0x80032b 11b3e: 90 93 07 06 sts 0x0607, r25 ; 0x800607 11b42: 80 93 06 06 sts 0x0606, r24 ; 0x800606 #endif //PINDA_THERMISTOR #ifdef AMBIENT_THERMISTOR current_temperature_raw_ambient = adc_values[ADC_PIN_IDX(TEMP_AMBIENT_PIN)]; // 5->6 11b46: 80 91 2e 03 lds r24, 0x032E ; 0x80032e 11b4a: 90 91 2f 03 lds r25, 0x032F ; 0x80032f 11b4e: 90 93 15 06 sts 0x0615, r25 ; 0x800615 11b52: 80 93 14 06 sts 0x0614, r24 ; 0x800614 #endif //AMBIENT_THERMISTOR #ifdef VOLT_PWR_PIN current_voltage_raw_pwr = adc_values[ADC_PIN_IDX(VOLT_PWR_PIN)]; 11b56: 80 91 2c 03 lds r24, 0x032C ; 0x80032c 11b5a: 90 91 2d 03 lds r25, 0x032D ; 0x80032d 11b5e: 90 93 5c 06 sts 0x065C, r25 ; 0x80065c 11b62: 80 93 5b 06 sts 0x065B, r24 ; 0x80065b #endif #ifdef VOLT_BED_PIN current_voltage_raw_bed = adc_values[ADC_PIN_IDX(VOLT_BED_PIN)]; // 6->9 11b66: 80 91 32 03 lds r24, 0x0332 ; 0x800332 11b6a: 90 91 33 03 lds r25, 0x0333 ; 0x800333 11b6e: 90 93 5a 06 sts 0x065A, r25 ; 0x80065a 11b72: 80 93 59 06 sts 0x0659, r24 ; 0x800659 #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; 11b76: 81 e0 ldi r24, 0x01 ; 1 11b78: 80 93 1b 05 sts 0x051B, r24 ; 0x80051b <_ZL16adc_values_ready.lto_priv.457> break; } } } ADCSRA |= (1 << ADSC); //start conversion } 11b7c: ff 91 pop r31 11b7e: ef 91 pop r30 11b80: bf 91 pop r27 11b82: af 91 pop r26 11b84: 9f 91 pop r25 11b86: 8f 91 pop r24 11b88: 7f 91 pop r23 11b8a: 6f 91 pop r22 11b8c: 5f 91 pop r21 11b8e: 4f 91 pop r20 11b90: 3f 91 pop r19 11b92: 2f 91 pop r18 11b94: 0f 90 pop r0 11b96: 0b be out 0x3b, r0 ; 59 11b98: 0f 90 pop r0 11b9a: 0f be out 0x3f, r0 ; 63 11b9c: 0f 90 pop r0 11b9e: 1f 90 pop r1 11ba0: 18 95 reti 11ba2: 80 91 22 03 lds r24, 0x0322 ; 0x800322 <__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)) { 11ba6: 4f e5 ldi r20, 0x5F ; 95 11ba8: 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) { 11baa: 8f 5f subi r24, 0xFF ; 255 11bac: 41 f4 brne .+16 ; 0x11bbe <__vector_29+0x110> 11bae: 10 92 22 03 sts 0x0322, r1 ; 0x800322 <__data_end> adc_count = 0; break; } } } ADCSRA |= (1 << ADSC); //start conversion 11bb2: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 11bb6: 80 64 ori r24, 0x40 ; 64 11bb8: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 11bbc: df cf rjmp .-66 ; 0x11b7c <__vector_29+0xce> 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)) { 11bbe: 9a 01 movw r18, r20 11bc0: 08 2e mov r0, r24 11bc2: 02 c0 rjmp .+4 ; 0x11bc8 <__vector_29+0x11a> 11bc4: 35 95 asr r19 11bc6: 27 95 ror r18 11bc8: 0a 94 dec r0 11bca: e2 f7 brpl .-8 ; 0x11bc4 <__vector_29+0x116> 11bcc: 20 ff sbrs r18, 0 11bce: ed cf rjmp .-38 ; 0x11baa <__vector_29+0xfc> 11bd0: 80 93 22 03 sts 0x0322, r24 ; 0x800322 <__data_end> adc_setmux(adc_channel_idx); 11bd4: 0e 94 6b 5b call 0xb6d6 ; 0xb6d6 adc_count = 0; 11bd8: 10 92 23 03 sts 0x0323, r1 ; 0x800323 11bdc: ea cf rjmp .-44 ; 0x11bb2 <__vector_29+0x104> 00011bde : if (ch & 0x08) ADCSRB |= (1 << MUX5); else ADCSRB &= ~(1 << MUX5); ADMUX = (ADMUX & ~(0x07)) | (ch & 0x07); } void adc_start_cycle() { 11bde: cf 93 push r28 11be0: 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 11be2: ca e7 ldi r28, 0x7A ; 122 11be4: d0 e0 ldi r29, 0x00 ; 0 11be6: 88 81 ld r24, Y 11be8: 8f 7b andi r24, 0xBF ; 191 11bea: 88 83 st Y, r24 adc_count = 0; 11bec: 10 92 23 03 sts 0x0323, r1 ; 0x800323 adc_channel = 0; 11bf0: 10 92 34 03 sts 0x0334, r1 ; 0x800334 adc_channel_idx = first_channel_idx; 11bf4: 10 92 22 03 sts 0x0322, r1 ; 0x800322 <__data_end> adc_setmux(adc_channel_idx); 11bf8: 80 e0 ldi r24, 0x00 ; 0 11bfa: 0e 94 6b 5b call 0xb6d6 ; 0xb6d6 memset((void*)adc_values, 0, sizeof(adc_values)); 11bfe: e4 e2 ldi r30, 0x24 ; 36 11c00: f3 e0 ldi r31, 0x03 ; 3 11c02: 80 e1 ldi r24, 0x10 ; 16 11c04: df 01 movw r26, r30 11c06: 1d 92 st X+, r1 11c08: 8a 95 dec r24 11c0a: e9 f7 brne .-6 ; 0x11c06 ADMUX = (ADMUX & ~(0x07)) | (ch & 0x07); } void adc_start_cycle() { adc_reset(); ADCSRA |= (1 << ADSC); //start conversion 11c0c: 88 81 ld r24, Y 11c0e: 80 64 ori r24, 0x40 ; 64 11c10: 88 83 st Y, r24 } 11c12: df 91 pop r29 11c14: cf 91 pop r28 11c16: 08 95 ret 00011c18 : } // G80 - Automatic mesh bed leveling static void gcode_G80() { 11c18: 2f 92 push r2 11c1a: 3f 92 push r3 11c1c: 4f 92 push r4 11c1e: 5f 92 push r5 11c20: 6f 92 push r6 11c22: 7f 92 push r7 11c24: 8f 92 push r8 11c26: 9f 92 push r9 11c28: af 92 push r10 11c2a: bf 92 push r11 11c2c: cf 92 push r12 11c2e: df 92 push r13 11c30: ef 92 push r14 11c32: ff 92 push r15 11c34: 0f 93 push r16 11c36: 1f 93 push r17 11c38: cf 93 push r28 11c3a: df 93 push r29 11c3c: cd b7 in r28, 0x3d ; 61 11c3e: de b7 in r29, 0x3e ; 62 11c40: a4 97 sbiw r28, 0x24 ; 36 11c42: 0f b6 in r0, 0x3f ; 63 11c44: f8 94 cli 11c46: de bf out 0x3e, r29 ; 62 11c48: 0f be out 0x3f, r0 ; 63 11c4a: 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(); 11c4c: 0f 94 a3 42 call 0x28546 ; 0x28546 if (planner_aborted) 11c50: 80 91 ab 0d lds r24, 0x0DAB ; 0x800dab 11c54: 81 11 cpse r24, r1 11c56: 17 c0 rjmp .+46 ; 0x11c86 return; mesh_bed_leveling_flag = true; 11c58: 81 e0 ldi r24, 0x01 ; 1 11c5a: 80 93 a7 0d sts 0x0DA7, r24 ; 0x800da7 // Firstly check if we know where we are if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS])) { 11c5e: 80 91 8e 06 lds r24, 0x068E ; 0x80068e 11c62: 88 23 and r24, r24 11c64: 49 f0 breq .+18 ; 0x11c78 11c66: 80 91 8f 06 lds r24, 0x068F ; 0x80068f 11c6a: 88 23 and r24, r24 11c6c: 29 f0 breq .+10 ; 0x11c78 11c6e: 20 91 90 06 lds r18, 0x0690 ; 0x800690 11c72: 2f 83 std Y+7, r18 ; 0x07 11c74: 21 11 cpse r18, r1 11c76: 20 c0 rjmp .+64 ; 0x11cb8 11c78: 81 e0 ldi r24, 0x01 ; 1 11c7a: 80 93 a1 10 sts 0x10A1, r24 ; 0x8010a1 // 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); 11c7e: 8e e1 ldi r24, 0x1E ; 30 11c80: 9c e6 ldi r25, 0x6C ; 108 11c82: 0f 94 b8 74 call 0x2e970 ; 0x2e970 custom_message_state = custom_message_state_old; lcd_update(2); st_synchronize(); mesh_bed_leveling_flag = false; } 11c86: a4 96 adiw r28, 0x24 ; 36 11c88: 0f b6 in r0, 0x3f ; 63 11c8a: f8 94 cli 11c8c: de bf out 0x3e, r29 ; 62 11c8e: 0f be out 0x3f, r0 ; 63 11c90: cd bf out 0x3d, r28 ; 61 11c92: df 91 pop r29 11c94: cf 91 pop r28 11c96: 1f 91 pop r17 11c98: 0f 91 pop r16 11c9a: ff 90 pop r15 11c9c: ef 90 pop r14 11c9e: df 90 pop r13 11ca0: cf 90 pop r12 11ca2: bf 90 pop r11 11ca4: af 90 pop r10 11ca6: 9f 90 pop r9 11ca8: 8f 90 pop r8 11caa: 7f 90 pop r7 11cac: 6f 90 pop r6 11cae: 5f 90 pop r5 11cb0: 4f 90 pop r4 11cb2: 3f 90 pop r3 11cb4: 2f 90 pop r2 11cb6: 08 95 ret return; } run = false; #endif //PINDA_THERMISTOR uint8_t nMeasPoints = eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR); 11cb8: 8b ea ldi r24, 0xAB ; 171 11cba: 9d e0 ldi r25, 0x0D ; 13 11cbc: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 11cc0: 18 2f mov r17, r24 if (uint8_t codeSeen = code_seen('N'), value = code_value_uint8(); codeSeen && (value == 7 || value == 3)) 11cc2: 8e e4 ldi r24, 0x4E ; 78 11cc4: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 11cc8: 08 2f mov r16, r24 11cca: 0e 94 80 5b call 0xb700 ; 0xb700 11cce: 8e 83 std Y+6, r24 ; 0x06 11cd0: 00 23 and r16, r16 11cd2: 29 f0 breq .+10 ; 0x11cde 11cd4: 87 30 cpi r24, 0x07 ; 7 11cd6: 09 f4 brne .+2 ; 0x11cda 11cd8: c9 c0 rjmp .+402 ; 0x11e6c 11cda: 83 30 cpi r24, 0x03 ; 3 11cdc: 29 f0 breq .+10 ; 0x11ce8 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; 11cde: 13 30 cpi r17, 0x03 ; 3 11ce0: 09 f0 breq .+2 ; 0x11ce4 11ce2: c3 c0 rjmp .+390 ; 0x11e6a 11ce4: 63 e0 ldi r22, 0x03 ; 3 11ce6: 6e 83 std Y+6, r22 ; 0x06 11ce8: 80 e0 ldi r24, 0x00 ; 0 11cea: 90 e0 ldi r25, 0x00 ; 0 11cec: a0 e8 ldi r26, 0x80 ; 128 11cee: bf e3 ldi r27, 0x3F ; 63 11cf0: 8a 83 std Y+2, r24 ; 0x02 11cf2: 9b 83 std Y+3, r25 ; 0x03 11cf4: ac 83 std Y+4, r26 ; 0x04 11cf6: bd 83 std Y+5, r27 ; 0x05 uint8_t nProbeRetryCount = eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR); 11cf8: 8a ea ldi r24, 0xAA ; 170 11cfa: 9d e0 ldi r25, 0x0D ; 13 11cfc: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 11d00: 88 8f std Y+24, r24 ; 0x18 if (uint8_t codeSeen = code_seen('C'), value = code_value_uint8(); codeSeen && value >= 1 && value <= 10) 11d02: 83 e4 ldi r24, 0x43 ; 67 11d04: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 11d08: 18 2f mov r17, r24 11d0a: 0e 94 80 5b call 0xb700 ; 0xb700 11d0e: 11 23 and r17, r17 11d10: 29 f0 breq .+10 ; 0x11d1c 11d12: 88 23 and r24, r24 11d14: 19 f0 breq .+6 ; 0x11d1c 11d16: 8b 30 cpi r24, 0x0B ; 11 11d18: 08 f4 brcc .+2 ; 0x11d1c 11d1a: 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; 11d1c: 88 e5 ldi r24, 0x58 ; 88 11d1e: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 11d22: 88 23 and r24, r24 11d24: 09 f4 brne .+2 ; 0x11d28 11d26: ab c0 rjmp .+342 ; 0x11e7e 11d28: 0e 94 b5 60 call 0xc16a ; 0xc16a 11d2c: 20 e0 ldi r18, 0x00 ; 0 11d2e: 30 e0 ldi r19, 0x00 ; 0 11d30: 48 e0 ldi r20, 0x08 ; 8 11d32: 52 e4 ldi r21, 0x42 ; 66 11d34: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 11d38: 20 e0 ldi r18, 0x00 ; 0 11d3a: 30 e0 ldi r19, 0x00 ; 0 11d3c: 48 eb ldi r20, 0xB8 ; 184 11d3e: 51 e4 ldi r21, 0x41 ; 65 11d40: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 11d44: 6a 87 std Y+10, r22 ; 0x0a 11d46: 7b 87 std Y+11, r23 ; 0x0b 11d48: 8c 87 std Y+12, r24 ; 0x0c 11d4a: 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; 11d4c: 89 e5 ldi r24, 0x59 ; 89 11d4e: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 11d52: 88 23 and r24, r24 11d54: 09 f4 brne .+2 ; 0x11d58 11d56: 9c c0 rjmp .+312 ; 0x11e90 11d58: 0e 94 b5 60 call 0xc16a ; 0xc16a 11d5c: 20 e0 ldi r18, 0x00 ; 0 11d5e: 30 e0 ldi r19, 0x00 ; 0 11d60: 48 e0 ldi r20, 0x08 ; 8 11d62: 52 e4 ldi r21, 0x42 ; 66 11d64: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 11d68: 20 e0 ldi r18, 0x00 ; 0 11d6a: 30 e0 ldi r19, 0x00 ; 0 11d6c: 40 ea ldi r20, 0xA0 ; 160 11d6e: 50 e4 ldi r21, 0x40 ; 64 11d70: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 11d74: 6c 8b std Y+20, r22 ; 0x14 11d76: 7d 8b std Y+21, r23 ; 0x15 11d78: 8e 8b std Y+22, r24 ; 0x16 11d7a: 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; 11d7c: 87 e5 ldi r24, 0x57 ; 87 11d7e: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 11d82: 88 23 and r24, r24 11d84: 09 f4 brne .+2 ; 0x11d88 11d86: 89 c0 rjmp .+274 ; 0x11e9a 11d88: 0e 94 b5 60 call 0xc16a ; 0xc16a 11d8c: 2a 85 ldd r18, Y+10 ; 0x0a 11d8e: 3b 85 ldd r19, Y+11 ; 0x0b 11d90: 4c 85 ldd r20, Y+12 ; 0x0c 11d92: 5d 85 ldd r21, Y+13 ; 0x0d 11d94: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 11d98: 20 e0 ldi r18, 0x00 ; 0 11d9a: 30 e0 ldi r19, 0x00 ; 0 11d9c: 48 e8 ldi r20, 0x88 ; 136 11d9e: 52 e4 ldi r21, 0x42 ; 66 11da0: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 11da4: 69 8f std Y+25, r22 ; 0x19 11da6: 7a 8f std Y+26, r23 ; 0x1a 11da8: 8b 8f std Y+27, r24 ; 0x1b 11daa: 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; 11dac: 88 e4 ldi r24, 0x48 ; 72 11dae: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 11db2: 88 23 and r24, r24 11db4: 09 f4 brne .+2 ; 0x11db8 11db6: 7a c0 rjmp .+244 ; 0x11eac 11db8: 0e 94 b5 60 call 0xc16a ; 0xc16a 11dbc: 2c 89 ldd r18, Y+20 ; 0x14 11dbe: 3d 89 ldd r19, Y+21 ; 0x15 11dc0: 4e 89 ldd r20, Y+22 ; 0x16 11dc2: 5f 89 ldd r21, Y+23 ; 0x17 11dc4: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 11dc8: 20 e0 ldi r18, 0x00 ; 0 11dca: 30 e0 ldi r19, 0x00 ; 0 11dcc: 48 e8 ldi r20, 0x88 ; 136 11dce: 52 e4 ldi r21, 0x42 ; 66 11dd0: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 11dd4: 6d 8f std Y+29, r22 ; 0x1d 11dd6: 7e 8f std Y+30, r23 ; 0x1e 11dd8: 8f 8f std Y+31, r24 ; 0x1f 11dda: 98 a3 std Y+32, r25 ; 0x20 mbl.reset(); //reset mesh bed leveling 11ddc: 0f 94 08 8c call 0x31810 ; 0x31810 mbl.z_values[0][0] = min_pos[Z_AXIS]; 11de0: 80 91 29 02 lds r24, 0x0229 ; 0x800229 11de4: 90 91 2a 02 lds r25, 0x022A ; 0x80022a 11de8: a0 91 2b 02 lds r26, 0x022B ; 0x80022b 11dec: b0 91 2c 02 lds r27, 0x022C ; 0x80022c 11df0: 80 93 c2 13 sts 0x13C2, r24 ; 0x8013c2 11df4: 90 93 c3 13 sts 0x13C3, r25 ; 0x8013c3 11df8: a0 93 c4 13 sts 0x13C4, r26 ; 0x8013c4 11dfc: b0 93 c5 13 sts 0x13C5, r27 ; 0x8013c5 // Reset baby stepping to zero, if the babystepping has already been loaded before. babystep_undo(); 11e00: 0f 94 96 c9 call 0x3932c ; 0x3932c 11e04: 05 ec ldi r16, 0xC5 ; 197 11e06: 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) 11e08: c8 01 movw r24, r16 11e0a: 0f 94 e5 db call 0x3b7ca ; 0x3b7ca 11e0e: 01 96 adiw r24, 0x01 ; 1 11e10: 09 f0 breq .+2 ; 0x11e14 11e12: 51 c0 rjmp .+162 ; 0x11eb6 11e14: 0e 5f subi r16, 0xFE ; 254 11e16: 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) { 11e18: 05 3d cpi r16, 0xD5 ; 213 11e1a: 8f e0 ldi r24, 0x0F ; 15 11e1c: 18 07 cpc r17, r24 11e1e: a1 f7 brne .-24 ; 0x11e08 if (eeprom_read_word((uint16_t*)(EEPROM_BED_CALIBRATION_Z_JITTER + i * 2)) != 0x0FFFF) return true; } return false; 11e20: 21 2c mov r2, r1 11e22: a1 ec ldi r26, 0xC1 ; 193 11e24: b3 e1 ldi r27, 0x13 ; 19 11e26: ba a3 std Y+34, r27 ; 0x22 11e28: 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; 11e2a: b9 87 std Y+9, r27 ; 0x09 11e2c: a8 87 std Y+8, r26 ; 0x08 11e2e: 51 2c mov r5, r1 11e30: 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; 11e32: 31 2c mov r3, r1 11e34: 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)); 11e36: 84 2d mov r24, r4 11e38: 63 e0 ldi r22, 0x03 ; 3 11e3a: 0f 94 86 dc call 0x3b90c ; 0x3b90c <__udivmodqi4> 11e3e: 98 8b std Y+16, r25 ; 0x10 11e40: 68 84 ldd r6, Y+8 ; 0x08 11e42: 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++) { 11e44: 10 e0 ldi r17, 0x00 ; 0 bool isOn3x3Mesh = ((row % 3 == 0) && (col % 3 == 0)); 11e46: f8 89 ldd r31, Y+16 ; 0x10 11e48: f1 11 cpse r31, r1 11e4a: 37 c0 rjmp .+110 ; 0x11eba 11e4c: 81 2f mov r24, r17 11e4e: 63 e0 ldi r22, 0x03 ; 3 11e50: 0f 94 86 dc call 0x3b90c ; 0x3b90c <__udivmodqi4> 11e54: 91 11 cpse r25, r1 11e56: 31 c0 rjmp .+98 ; 0x11eba if (isOn3x3Mesh) { if (has_z && (row || col)) { 11e58: 21 10 cpse r2, r1 11e5a: 3f c1 rjmp .+638 ; 0x120da } else { mbl.set_z(col, row, NAN); } // check for points that are skipped if (nMeasPoints == 3) { 11e5c: 7e 81 ldd r23, Y+6 ; 0x06 11e5e: 73 30 cpi r23, 0x03 ; 3 11e60: 09 f4 brne .+2 ; 0x11e64 11e62: 70 c0 rjmp .+224 ; 0x11f44 11e64: 8f 81 ldd r24, Y+7 ; 0x07 11e66: 8e 87 std Y+14, r24 ; 0x0e 11e68: 37 c0 rjmp .+110 ; 0x11ed8 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; 11e6a: 1e 83 std Y+6, r17 ; 0x06 11e6c: 6a e9 ldi r22, 0x9A ; 154 11e6e: 79 e9 ldi r23, 0x99 ; 153 11e70: 89 e1 ldi r24, 0x19 ; 25 11e72: 9f e3 ldi r25, 0x3F ; 63 11e74: 6a 83 std Y+2, r22 ; 0x02 11e76: 7b 83 std Y+3, r23 ; 0x03 11e78: 8c 83 std Y+4, r24 ; 0x04 11e7a: 9d 83 std Y+5, r25 ; 0x05 11e7c: 3d cf rjmp .-390 ; 0x11cf8 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; 11e7e: 80 e0 ldi r24, 0x00 ; 0 11e80: 90 e0 ldi r25, 0x00 ; 0 11e82: a0 e8 ldi r26, 0x80 ; 128 11e84: bf ef ldi r27, 0xFF ; 255 11e86: 8a 87 std Y+10, r24 ; 0x0a 11e88: 9b 87 std Y+11, r25 ; 0x0b 11e8a: ac 87 std Y+12, r26 ; 0x0c 11e8c: bd 87 std Y+13, r27 ; 0x0d 11e8e: 5e cf rjmp .-324 ; 0x11d4c const float area_min_y = code_seen('Y') ? code_value() - y_mesh_density - Y_PROBE_OFFSET_FROM_EXTRUDER : -INFINITY; 11e90: 60 e0 ldi r22, 0x00 ; 0 11e92: 70 e0 ldi r23, 0x00 ; 0 11e94: 80 e8 ldi r24, 0x80 ; 128 11e96: 9f ef ldi r25, 0xFF ; 255 11e98: 6d cf rjmp .-294 ; 0x11d74 const float area_max_x = code_seen('W') ? area_min_x + code_value() + 2 * x_mesh_density : INFINITY; 11e9a: 80 e0 ldi r24, 0x00 ; 0 11e9c: 90 e0 ldi r25, 0x00 ; 0 11e9e: a0 e8 ldi r26, 0x80 ; 128 11ea0: bf e7 ldi r27, 0x7F ; 127 11ea2: 89 8f std Y+25, r24 ; 0x19 11ea4: 9a 8f std Y+26, r25 ; 0x1a 11ea6: ab 8f std Y+27, r26 ; 0x1b 11ea8: bc 8f std Y+28, r27 ; 0x1c 11eaa: 80 cf rjmp .-256 ; 0x11dac const float area_max_y = code_seen('H') ? area_min_y + code_value() + 2 * y_mesh_density : INFINITY; 11eac: 60 e0 ldi r22, 0x00 ; 0 11eae: 70 e0 ldi r23, 0x00 ; 0 11eb0: 80 e8 ldi r24, 0x80 ; 128 11eb2: 9f e7 ldi r25, 0x7F ; 127 11eb4: 8f cf rjmp .-226 ; 0x11dd4 11eb6: 2f 80 ldd r2, Y+7 ; 0x07 11eb8: b4 cf rjmp .-152 ; 0x11e22 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; } 11eba: 60 e0 ldi r22, 0x00 ; 0 11ebc: 70 e0 ldi r23, 0x00 ; 0 11ebe: 80 ec ldi r24, 0xC0 ; 192 11ec0: 9f e7 ldi r25, 0x7F ; 127 11ec2: d3 01 movw r26, r6 11ec4: 11 96 adiw r26, 0x01 ; 1 11ec6: 6d 93 st X+, r22 11ec8: 7d 93 st X+, r23 11eca: 8d 93 st X+, r24 11ecc: 9c 93 st X, r25 11ece: 14 97 sbiw r26, 0x04 ; 4 } else { mbl.set_z(col, row, NAN); } // check for points that are skipped if (nMeasPoints == 3) { 11ed0: be 81 ldd r27, Y+6 ; 0x06 11ed2: b3 30 cpi r27, 0x03 ; 3 11ed4: c1 f1 breq .+112 ; 0x11f46 11ed6: 1e 86 std Y+14, r1 ; 0x0e if (!isOn3x3Mesh) continue; } else { const float x_pos = BED_X(col); 11ed8: 81 2f mov r24, r17 11eda: 0f 94 f0 c9 call 0x393e0 ; 0x393e0 11ede: 4b 01 movw r8, r22 11ee0: 5c 01 movw r10, r24 const float y_pos = BED_Y(row); 11ee2: 80 2f mov r24, r16 11ee4: 0f 94 f0 c9 call 0x393e0 ; 0x393e0 11ee8: 6b 01 movw r12, r22 11eea: 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)) { 11eec: a5 01 movw r20, r10 11eee: 94 01 movw r18, r8 11ef0: 6a 85 ldd r22, Y+10 ; 0x0a 11ef2: 7b 85 ldd r23, Y+11 ; 0x0b 11ef4: 8c 85 ldd r24, Y+12 ; 0x0c 11ef6: 9d 85 ldd r25, Y+13 ; 0x0d 11ef8: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 11efc: 18 16 cp r1, r24 11efe: 0c f4 brge .+2 ; 0x11f02 11f00: 1c c1 rjmp .+568 ; 0x1213a 11f02: 29 8d ldd r18, Y+25 ; 0x19 11f04: 3a 8d ldd r19, Y+26 ; 0x1a 11f06: 4b 8d ldd r20, Y+27 ; 0x1b 11f08: 5c 8d ldd r21, Y+28 ; 0x1c 11f0a: c5 01 movw r24, r10 11f0c: b4 01 movw r22, r8 11f0e: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 11f12: 18 16 cp r1, r24 11f14: 0c f4 brge .+2 ; 0x11f18 11f16: 11 c1 rjmp .+546 ; 0x1213a 11f18: a7 01 movw r20, r14 11f1a: 96 01 movw r18, r12 11f1c: 6c 89 ldd r22, Y+20 ; 0x14 11f1e: 7d 89 ldd r23, Y+21 ; 0x15 11f20: 8e 89 ldd r24, Y+22 ; 0x16 11f22: 9f 89 ldd r25, Y+23 ; 0x17 11f24: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 11f28: 18 16 cp r1, r24 11f2a: 0c f4 brge .+2 ; 0x11f2e 11f2c: 06 c1 rjmp .+524 ; 0x1213a 11f2e: 2d 8d ldd r18, Y+29 ; 0x1d 11f30: 3e 8d ldd r19, Y+30 ; 0x1e 11f32: 4f 8d ldd r20, Y+31 ; 0x1f 11f34: 58 a1 ldd r21, Y+32 ; 0x20 11f36: c7 01 movw r24, r14 11f38: b6 01 movw r22, r12 11f3a: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 11f3e: 18 16 cp r1, r24 11f40: 0c f4 brge .+2 ; 0x11f44 11f42: fb c0 rjmp .+502 ; 0x1213a continue; } } // increment the total point counter if the points are not skipped meshPointsToProbe++; 11f44: 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++) { 11f46: 1f 5f subi r17, 0xFF ; 255 11f48: 24 e0 ldi r18, 0x04 ; 4 11f4a: 62 0e add r6, r18 11f4c: 71 1c adc r7, r1 11f4e: 17 30 cpi r17, 0x07 ; 7 11f50: 09 f0 breq .+2 ; 0x11f54 11f52: 79 cf rjmp .-270 ; 0x11e46 11f54: 6f ef ldi r22, 0xFF ; 255 11f56: 46 1a sub r4, r22 11f58: 56 0a sbc r5, r22 11f5a: 88 85 ldd r24, Y+8 ; 0x08 11f5c: 99 85 ldd r25, Y+9 ; 0x09 11f5e: 4c 96 adiw r24, 0x1c ; 28 11f60: 99 87 std Y+9, r25 ; 0x09 11f62: 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++) { 11f64: 97 e0 ldi r25, 0x07 ; 7 11f66: 49 16 cp r4, r25 11f68: 51 04 cpc r5, r1 11f6a: 09 f0 breq .+2 ; 0x11f6e 11f6c: 63 cf rjmp .-314 ; 0x11e34 // increment the total point counter if the points are not skipped meshPointsToProbe++; } } mbl.upsample_3x3(); //upsample the default mesh 11f6e: 0f 94 b1 a2 call 0x34562 ; 0x34562 // Save custom message state, set a new custom message state to display: Calibrating point 9. CustomMsg custom_message_type_old = custom_message_type; 11f72: a0 91 c3 06 lds r26, 0x06C3 ; 0x8006c3 11f76: af 83 std Y+7, r26 ; 0x07 uint8_t custom_message_state_old = custom_message_state; 11f78: b0 91 f6 03 lds r27, 0x03F6 ; 0x8003f6 11f7c: b8 87 std Y+8, r27 ; 0x08 custom_message_type = CustomMsg::MeshBedLeveling; 11f7e: 81 e0 ldi r24, 0x01 ; 1 11f80: 80 93 c3 06 sts 0x06C3, r24 ; 0x8006c3 custom_message_state = meshPointsToProbe + 10; 11f84: 8a e0 ldi r24, 0x0A ; 10 11f86: 83 0d add r24, r3 11f88: 80 93 f6 03 sts 0x03F6, r24 ; 0x8003f6 lcd_update(1); 11f8c: 81 e0 ldi r24, 0x01 ; 1 11f8e: 0e 94 bf 6e call 0xdd7e ; 0xdd7e // Lift Z to a safe position before probing the first point current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 11f92: 80 e0 ldi r24, 0x00 ; 0 11f94: 90 e0 ldi r25, 0x00 ; 0 11f96: a0 ea ldi r26, 0xA0 ; 160 11f98: b0 e4 ldi r27, 0x40 ; 64 11f9a: 80 93 99 06 sts 0x0699, r24 ; 0x800699 11f9e: 90 93 9a 06 sts 0x069A, r25 ; 0x80069a 11fa2: a0 93 9b 06 sts 0x069B, r26 ; 0x80069b 11fa6: b0 93 9c 06 sts 0x069C, r27 ; 0x80069c plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 11faa: 65 e5 ldi r22, 0x55 ; 85 11fac: 75 e5 ldi r23, 0x55 ; 85 11fae: 85 e5 ldi r24, 0x55 ; 85 11fb0: 91 e4 ldi r25, 0x41 ; 65 11fb2: 0f 94 04 c0 call 0x38008 ; 0x38008 // Cycle through all points and probe them int l_feedmultiply = setup_for_endstop_move(false); //save feedrate and feedmultiply, sets feedmultiply to 100 11fb6: 80 e0 ldi r24, 0x00 ; 0 11fb8: 0e 94 00 67 call 0xce00 ; 0xce00 11fbc: 9c a3 std Y+36, r25 ; 0x24 11fbe: 8b a3 std Y+35, r24 ; 0x23 11fc0: 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 11fc2: 83 2d mov r24, r3 11fc4: 67 e0 ldi r22, 0x07 ; 7 11fc6: 0f 94 86 dc call 0x3b90c ; 0x3b90c <__udivmodqi4> 11fca: f8 2e mov r15, r24 11fcc: 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 11fce: 68 2f mov r22, r24 11fd0: 70 e0 ldi r23, 0x00 ; 0 11fd2: 7f 87 std Y+15, r23 ; 0x0f 11fd4: 6e 87 std Y+14, r22 ; 0x0e 11fd6: 80 ff sbrs r24, 0 11fd8: 03 c0 rjmp .+6 ; 0x11fe0 11fda: 76 e0 ldi r23, 0x06 ; 6 11fdc: 79 1b sub r23, r25 11fde: 07 2f mov r16, r23 bool isOn3x3Mesh = ((ix % 3 == 0) && (iy % 3 == 0)); 11fe0: 80 2f mov r24, r16 11fe2: 63 e0 ldi r22, 0x03 ; 3 11fe4: 0f 94 86 dc call 0x3b90c ; 0x3b90c <__udivmodqi4> 11fe8: 91 11 cpse r25, r1 11fea: 05 c0 rjmp .+10 ; 0x11ff6 11fec: 8f 2d mov r24, r15 11fee: 0f 94 86 dc call 0x3b90c ; 0x3b90c <__udivmodqi4> 11ff2: 11 e0 ldi r17, 0x01 ; 1 11ff4: 91 11 cpse r25, r1 11ff6: 10 e0 ldi r17, 0x00 ; 0 float x_pos = BED_X(ix); 11ff8: 80 2f mov r24, r16 11ffa: 0f 94 f0 c9 call 0x393e0 ; 0x393e0 11ffe: 68 8b std Y+16, r22 ; 0x10 12000: 79 8b std Y+17, r23 ; 0x11 12002: 8a 8b std Y+18, r24 ; 0x12 12004: 9b 8b std Y+19, r25 ; 0x13 float y_pos = BED_Y(iy); 12006: 8f 2d mov r24, r15 12008: 0f 94 f0 c9 call 0x393e0 ; 0x393e0 1200c: 4b 01 movw r8, r22 1200e: 5c 01 movw r10, r24 if (nMeasPoints == 3) { 12010: 8e 81 ldd r24, Y+6 ; 0x06 12012: 83 30 cpi r24, 0x03 ; 3 12014: 09 f0 breq .+2 ; 0x12018 12016: 99 c0 rjmp .+306 ; 0x1214a if (!isOn3x3Mesh) { 12018: 11 11 cpse r17, r1 1201a: c8 c0 rjmp .+400 ; 0x121ac 1201c: 27 e0 ldi r18, 0x07 ; 7 1201e: ae 85 ldd r26, Y+14 ; 0x0e 12020: bf 85 ldd r27, Y+15 ; 0x0f 12022: 2a 9f mul r18, r26 12024: f0 01 movw r30, r0 12026: 2b 9f mul r18, r27 12028: f0 0d add r31, r0 1202a: 11 24 eor r1, r1 1202c: e0 0f add r30, r16 1202e: f1 1d adc r31, r1 12030: ee 0f add r30, r30 12032: ff 1f adc r31, r31 12034: ee 0f add r30, r30 12036: ff 1f adc r31, r31 12038: ef 53 subi r30, 0x3F ; 63 1203a: fc 4e sbci r31, 0xEC ; 236 1203c: 60 e0 ldi r22, 0x00 ; 0 1203e: 70 e0 ldi r23, 0x00 ; 0 12040: 80 ec ldi r24, 0xC0 ; 192 12042: 9f e7 ldi r25, 0x7F ; 127 12044: 61 83 std Z+1, r22 ; 0x01 12046: 72 83 std Z+2, r23 ; 0x02 12048: 83 83 std Z+3, r24 ; 0x03 1204a: 94 83 std Z+4, r25 ; 0x04 1204c: 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) { 1204e: e1 e3 ldi r30, 0x31 ; 49 12050: 3e 12 cpse r3, r30 12052: b7 cf rjmp .-146 ; 0x11fc2 custom_message_state--; mesh_point++; lcd_update(1); } current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 12054: 80 e0 ldi r24, 0x00 ; 0 12056: 90 e0 ldi r25, 0x00 ; 0 12058: a0 ea ldi r26, 0xA0 ; 160 1205a: b0 e4 ldi r27, 0x40 ; 64 1205c: 80 93 99 06 sts 0x0699, r24 ; 0x800699 12060: 90 93 9a 06 sts 0x069A, r25 ; 0x80069a 12064: a0 93 9b 06 sts 0x069B, r26 ; 0x80069b 12068: b0 93 9c 06 sts 0x069C, r27 ; 0x80069c plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 1206c: 65 e5 ldi r22, 0x55 ; 85 1206e: 75 e5 ldi r23, 0x55 ; 85 12070: 85 e5 ldi r24, 0x55 ; 85 12072: 91 e4 ldi r25, 0x41 ; 65 12074: 0f 94 04 c0 call 0x38008 ; 0x38008 st_synchronize(); 12078: 0f 94 a3 42 call 0x28546 ; 0x28546 static uint8_t g80_fail_cnt = 0; if (mesh_point != MESH_NUM_X_POINTS * MESH_NUM_Y_POINTS) { 1207c: b1 e3 ldi r27, 0x31 ; 49 1207e: 3b 16 cp r3, r27 12080: 09 f4 brne .+2 ; 0x12084 12082: 33 c2 rjmp .+1126 ; 0x124ea if (g80_fail_cnt++ >= 1) { 12084: 80 91 68 03 lds r24, 0x0368 ; 0x800368 12088: 91 e0 ldi r25, 0x01 ; 1 1208a: 98 0f add r25, r24 1208c: 90 93 68 03 sts 0x0368, r25 ; 0x800368 12090: 88 23 and r24, r24 12092: 09 f4 brne .+2 ; 0x12096 12094: d3 c1 rjmp .+934 ; 0x1243c print_stop(); 12096: 60 e0 ldi r22, 0x00 ; 0 12098: 80 e0 ldi r24, 0x00 ; 0 1209a: 0e 94 75 f4 call 0x1e8ea ; 0x1e8ea lcd_show_fullscreen_message_and_wait_P(_T(MSG_MBL_FAILED)); 1209e: 86 e4 ldi r24, 0x46 ; 70 120a0: 96 e3 ldi r25, 0x36 ; 54 120a2: 0e 94 c4 72 call 0xe588 ; 0xe588 120a6: 0f 94 c7 1f call 0x23f8e ; 0x23f8e lcd_z_calibration_prompt(false); 120aa: 80 e0 ldi r24, 0x00 ; 0 120ac: 0f 94 8c 0c call 0x21918 ; 0x21918 current_position[E_AXIS] += default_retraction; plan_buffer_line_curposXYZE(400); } #endif // !PINDA_THERMISTOR exit: KEEPALIVE_STATE(NOT_BUSY); 120b0: 81 e0 ldi r24, 0x01 ; 1 120b2: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be // Restore custom message state lcd_setstatuspgm(MSG_WELCOME); 120b6: 86 eb ldi r24, 0xB6 ; 182 120b8: 90 e7 ldi r25, 0x70 ; 112 120ba: 0e 94 38 f1 call 0x1e270 ; 0x1e270 custom_message_type = custom_message_type_old; 120be: 2f 81 ldd r18, Y+7 ; 0x07 120c0: 20 93 c3 06 sts 0x06C3, r18 ; 0x8006c3 custom_message_state = custom_message_state_old; 120c4: 68 85 ldd r22, Y+8 ; 0x08 120c6: 60 93 f6 03 sts 0x03F6, r22 ; 0x8003f6 lcd_update(2); 120ca: 82 e0 ldi r24, 0x02 ; 2 120cc: 0e 94 bf 6e call 0xdd7e ; 0xdd7e st_synchronize(); 120d0: 0f 94 a3 42 call 0x28546 ; 0x28546 mesh_bed_leveling_flag = false; 120d4: 10 92 a7 0d sts 0x0DA7, r1 ; 0x800da7 120d8: d6 cd rjmp .-1108 ; 0x11c86 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)) { 120da: 01 11 cpse r16, r1 120dc: 03 c0 rjmp .+6 ; 0x120e4 120de: 11 23 and r17, r17 120e0: 09 f4 brne .+2 ; 0x120e4 120e2: bc ce rjmp .-648 ; 0x11e5c // 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))); 120e4: 81 2f mov r24, r17 120e6: 63 e0 ldi r22, 0x03 ; 3 120e8: 0f 94 92 dc call 0x3b924 ; 0x3b924 <__divmodqi4> 120ec: 84 0d add r24, r4 120ee: 95 2d mov r25, r5 120f0: 91 1d adc r25, r1 120f2: 88 0f add r24, r24 120f4: 99 1f adc r25, r25 120f6: 8d 53 subi r24, 0x3D ; 61 120f8: 90 4f sbci r25, 0xF0 ; 240 120fa: 0f 94 e5 db call 0x3b7ca ; 0x3b7ca const float z0 = mbl.z_values[0][0] + *reinterpret_cast(&z_offset_u) * 0.01; 120fe: bc 01 movw r22, r24 12100: 99 0f add r25, r25 12102: 88 0b sbc r24, r24 12104: 99 0b sbc r25, r25 12106: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 1210a: 2a e0 ldi r18, 0x0A ; 10 1210c: 37 ed ldi r19, 0xD7 ; 215 1210e: 43 e2 ldi r20, 0x23 ; 35 12110: 5c e3 ldi r21, 0x3C ; 60 12112: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 12116: 9b 01 movw r18, r22 12118: ac 01 movw r20, r24 1211a: 60 91 c2 13 lds r22, 0x13C2 ; 0x8013c2 1211e: 70 91 c3 13 lds r23, 0x13C3 ; 0x8013c3 12122: 80 91 c4 13 lds r24, 0x13C4 ; 0x8013c4 12126: 90 91 c5 13 lds r25, 0x13C5 ; 0x8013c5 1212a: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 1212e: f3 01 movw r30, r6 12130: 61 83 std Z+1, r22 ; 0x01 12132: 72 83 std Z+2, r23 ; 0x02 12134: 83 83 std Z+3, r24 ; 0x03 12136: 94 83 std Z+4, r25 ; 0x04 12138: 91 ce rjmp .-734 ; 0x11e5c 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)) { 1213a: fe 85 ldd r31, Y+14 ; 0x0e 1213c: ff 23 and r31, r31 1213e: 09 f4 brne .+2 ; 0x12142 12140: 02 cf rjmp .-508 ; 0x11f46 12142: 22 20 and r2, r2 12144: 09 f4 brne .+2 ; 0x12148 12146: fe ce rjmp .-516 ; 0x11f44 12148: fe ce rjmp .-516 ; 0x11f46 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)) { 1214a: 28 89 ldd r18, Y+16 ; 0x10 1214c: 39 89 ldd r19, Y+17 ; 0x11 1214e: 4a 89 ldd r20, Y+18 ; 0x12 12150: 5b 89 ldd r21, Y+19 ; 0x13 12152: 6a 85 ldd r22, Y+10 ; 0x0a 12154: 7b 85 ldd r23, Y+11 ; 0x0b 12156: 8c 85 ldd r24, Y+12 ; 0x0c 12158: 9d 85 ldd r25, Y+13 ; 0x0d 1215a: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 1215e: 18 16 cp r1, r24 12160: 04 f1 brlt .+64 ; 0x121a2 12162: 28 89 ldd r18, Y+16 ; 0x10 12164: 39 89 ldd r19, Y+17 ; 0x11 12166: 4a 89 ldd r20, Y+18 ; 0x12 12168: 5b 89 ldd r21, Y+19 ; 0x13 1216a: 69 8d ldd r22, Y+25 ; 0x19 1216c: 7a 8d ldd r23, Y+26 ; 0x1a 1216e: 8b 8d ldd r24, Y+27 ; 0x1b 12170: 9c 8d ldd r25, Y+28 ; 0x1c 12172: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 12176: 87 fd sbrc r24, 7 12178: 14 c0 rjmp .+40 ; 0x121a2 1217a: a5 01 movw r20, r10 1217c: 94 01 movw r18, r8 1217e: 6c 89 ldd r22, Y+20 ; 0x14 12180: 7d 89 ldd r23, Y+21 ; 0x15 12182: 8e 89 ldd r24, Y+22 ; 0x16 12184: 9f 89 ldd r25, Y+23 ; 0x17 12186: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 1218a: 18 16 cp r1, r24 1218c: 54 f0 brlt .+20 ; 0x121a2 1218e: a5 01 movw r20, r10 12190: 94 01 movw r18, r8 12192: 6d 8d ldd r22, Y+29 ; 0x1d 12194: 7e 8d ldd r23, Y+30 ; 0x1e 12196: 8f 8d ldd r24, Y+31 ; 0x1f 12198: 98 a1 ldd r25, Y+32 ; 0x20 1219a: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 1219e: 87 ff sbrs r24, 7 121a0: 05 c0 rjmp .+10 ; 0x121ac 121a2: 11 23 and r17, r17 121a4: 09 f4 brne .+2 ; 0x121a8 121a6: 52 cf rjmp .-348 ; 0x1204c 121a8: 21 10 cpse r2, r1 121aa: 50 cf rjmp .-352 ; 0x1204c mesh_point++; continue; //skip } // Move Z up to the probe height of the current Z point. const float z0 = mbl.z_values[iy][ix]; 121ac: 10 e0 ldi r17, 0x00 ; 0 121ae: a7 e0 ldi r26, 0x07 ; 7 121b0: 8e 85 ldd r24, Y+14 ; 0x0e 121b2: 9f 85 ldd r25, Y+15 ; 0x0f 121b4: a8 9f mul r26, r24 121b6: f0 01 movw r30, r0 121b8: a9 9f mul r26, r25 121ba: f0 0d add r31, r0 121bc: 11 24 eor r1, r1 121be: e0 0f add r30, r16 121c0: f1 1f adc r31, r17 121c2: ee 0f add r30, r30 121c4: ff 1f adc r31, r31 121c6: ee 0f add r30, r30 121c8: ff 1f adc r31, r31 121ca: ef 53 subi r30, 0x3F ; 63 121cc: fc 4e sbci r31, 0xEC ; 236 121ce: 41 80 ldd r4, Z+1 ; 0x01 121d0: 52 80 ldd r5, Z+2 ; 0x02 121d2: 63 80 ldd r6, Z+3 ; 0x03 121d4: 74 80 ldd r7, Z+4 ; 0x04 const float init_z_bckp = !has_z ? MESH_HOME_Z_SEARCH : z0 + MESH_HOME_Z_SEARCH_FAST; 121d6: c1 2c mov r12, r1 121d8: d1 2c mov r13, r1 121da: e0 ea ldi r30, 0xA0 ; 160 121dc: ee 2e mov r14, r30 121de: e0 e4 ldi r30, 0x40 ; 64 121e0: fe 2e mov r15, r30 121e2: 22 20 and r2, r2 121e4: 51 f0 breq .+20 ; 0x121fa 121e6: 23 e3 ldi r18, 0x33 ; 51 121e8: 33 e3 ldi r19, 0x33 ; 51 121ea: 43 eb ldi r20, 0xB3 ; 179 121ec: 5e e3 ldi r21, 0x3E ; 62 121ee: c3 01 movw r24, r6 121f0: b2 01 movw r22, r4 121f2: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 121f6: 6b 01 movw r12, r22 121f8: 7c 01 movw r14, r24 if (init_z_bckp > current_position[Z_AXIS]) { 121fa: a7 01 movw r20, r14 121fc: 96 01 movw r18, r12 121fe: 60 91 99 06 lds r22, 0x0699 ; 0x800699 12202: 70 91 9a 06 lds r23, 0x069A ; 0x80069a 12206: 80 91 9b 06 lds r24, 0x069B ; 0x80069b 1220a: 90 91 9c 06 lds r25, 0x069C ; 0x80069c 1220e: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 12212: 87 ff sbrs r24, 7 12214: 10 c0 rjmp .+32 ; 0x12236 current_position[Z_AXIS] = init_z_bckp; 12216: c0 92 99 06 sts 0x0699, r12 ; 0x800699 1221a: d0 92 9a 06 sts 0x069A, r13 ; 0x80069a 1221e: e0 92 9b 06 sts 0x069B, r14 ; 0x80069b 12222: f0 92 9c 06 sts 0x069C, r15 ; 0x80069c plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 12226: 65 e5 ldi r22, 0x55 ; 85 12228: 75 e5 ldi r23, 0x55 ; 85 1222a: 85 e5 ldi r24, 0x55 ; 85 1222c: 91 e4 ldi r25, 0x41 ; 65 1222e: 0f 94 04 c0 call 0x38008 ; 0x38008 st_synchronize(); 12232: 0f 94 a3 42 call 0x28546 ; 0x28546 } // Move to XY position of the sensor point. current_position[X_AXIS] = x_pos; 12236: 68 89 ldd r22, Y+16 ; 0x10 12238: 79 89 ldd r23, Y+17 ; 0x11 1223a: 8a 89 ldd r24, Y+18 ; 0x12 1223c: 9b 89 ldd r25, Y+19 ; 0x13 1223e: 60 93 91 06 sts 0x0691, r22 ; 0x800691 12242: 70 93 92 06 sts 0x0692, r23 ; 0x800692 12246: 80 93 93 06 sts 0x0693, r24 ; 0x800693 1224a: 90 93 94 06 sts 0x0694, r25 ; 0x800694 current_position[Y_AXIS] = y_pos; 1224e: 80 92 95 06 sts 0x0695, r8 ; 0x800695 12252: 90 92 96 06 sts 0x0696, r9 ; 0x800696 12256: a0 92 97 06 sts 0x0697, r10 ; 0x800697 1225a: b0 92 98 06 sts 0x0698, r11 ; 0x800698 world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 1225e: 65 e9 ldi r22, 0x95 ; 149 12260: 76 e0 ldi r23, 0x06 ; 6 12262: 81 e9 ldi r24, 0x91 ; 145 12264: 96 e0 ldi r25, 0x06 ; 6 12266: 0e 94 c2 6a call 0xd584 ; 0xd584 plan_buffer_line_curposXYZE(XY_AXIS_FEEDRATE); 1226a: 60 e0 ldi r22, 0x00 ; 0 1226c: 70 e0 ldi r23, 0x00 ; 0 1226e: 86 e1 ldi r24, 0x16 ; 22 12270: 93 e4 ldi r25, 0x43 ; 67 12272: 0f 94 04 c0 call 0x38008 ; 0x38008 st_synchronize(); 12276: 0f 94 a3 42 call 0x28546 ; 0x28546 if (planner_aborted) 1227a: 80 91 ab 0d lds r24, 0x0DAB ; 0x800dab 1227e: 88 23 and r24, r24 12280: 39 f0 breq .+14 ; 0x12290 { custom_message_type = custom_message_type_old; 12282: 7f 81 ldd r23, Y+7 ; 0x07 12284: 70 93 c3 06 sts 0x06C3, r23 ; 0x8006c3 custom_message_state = custom_message_state_old; 12288: 88 85 ldd r24, Y+8 ; 0x08 1228a: 80 93 f6 03 sts 0x03F6, r24 ; 0x8003f6 1228e: fb cc rjmp .-1546 ; 0x11c86 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 12290: 81 2c mov r8, r1 12292: 91 2c mov r9, r1 12294: 70 e2 ldi r23, 0x20 ; 32 12296: a7 2e mov r10, r23 12298: 71 ec ldi r23, 0xC1 ; 193 1229a: b7 2e mov r11, r23 1229c: 22 20 and r2, r2 1229e: 51 f0 breq .+20 ; 0x122b4 122a0: 2a 81 ldd r18, Y+2 ; 0x02 122a2: 3b 81 ldd r19, Y+3 ; 0x03 122a4: 4c 81 ldd r20, Y+4 ; 0x04 122a6: 5d 81 ldd r21, Y+5 ; 0x05 122a8: c3 01 movw r24, r6 122aa: b2 01 movw r22, r4 122ac: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 122b0: 4b 01 movw r8, r22 122b2: 5c 01 movw r10, r24 122b4: 48 8d ldd r20, Y+24 ; 0x18 122b6: c5 01 movw r24, r10 122b8: b4 01 movw r22, r8 122ba: 0f 94 12 8c call 0x31824 ; 0x31824 122be: 81 11 cpse r24, r1 122c0: 0b c0 rjmp .+22 ; 0x122d8 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)); 122c2: 8b e8 ldi r24, 0x8B ; 139 122c4: 94 e6 ldi r25, 0x64 ; 100 122c6: 0e 94 c4 72 call 0xe588 ; 0xe588 122ca: 9f 93 push r25 122cc: 8f 93 push r24 122ce: 0f 94 99 da call 0x3b532 ; 0x3b532 122d2: 0f 90 pop r0 122d4: 0f 90 pop r0 122d6: be ce rjmp .-644 ; 0x12054 // 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. 122d8: 20 91 99 06 lds r18, 0x0699 ; 0x800699 122dc: 30 91 9a 06 lds r19, 0x069A ; 0x80069a 122e0: 40 91 9b 06 lds r20, 0x069B ; 0x80069b 122e4: 50 91 9c 06 lds r21, 0x069C ; 0x80069c 122e8: c7 01 movw r24, r14 122ea: b6 01 movw r22, r12 122ec: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 122f0: 20 e0 ldi r18, 0x00 ; 0 122f2: 30 e0 ldi r19, 0x00 ; 0 122f4: a9 01 movw r20, r18 122f6: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 122fa: 87 ff sbrs r24, 7 122fc: 36 c0 rjmp .+108 ; 0x1236a current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 122fe: 60 e0 ldi r22, 0x00 ; 0 12300: 70 e0 ldi r23, 0x00 ; 0 12302: 80 ea ldi r24, 0xA0 ; 160 12304: 90 e4 ldi r25, 0x40 ; 64 12306: 60 93 99 06 sts 0x0699, r22 ; 0x800699 1230a: 70 93 9a 06 sts 0x069A, r23 ; 0x80069a 1230e: 80 93 9b 06 sts 0x069B, r24 ; 0x80069b 12312: 90 93 9c 06 sts 0x069C, r25 ; 0x80069c plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 12316: 65 e5 ldi r22, 0x55 ; 85 12318: 75 e5 ldi r23, 0x55 ; 85 1231a: 85 e5 ldi r24, 0x55 ; 85 1231c: 91 e4 ldi r25, 0x41 ; 65 1231e: 0f 94 04 c0 call 0x38008 ; 0x38008 st_synchronize(); 12322: 0f 94 a3 42 call 0x28546 ; 0x28546 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 12326: 48 8d ldd r20, Y+24 ; 0x18 12328: c5 01 movw r24, r10 1232a: b4 01 movw r22, r8 1232c: 0f 94 12 8c call 0x31824 ; 0x31824 12330: 88 23 and r24, r24 12332: 39 f2 breq .-114 ; 0x122c2 printf_P(_T(MSG_BED_LEVELING_FAILED_POINT_LOW)); break; } if (MESH_HOME_Z_SEARCH - current_position[Z_AXIS] < 0.1f) { 12334: 20 91 99 06 lds r18, 0x0699 ; 0x800699 12338: 30 91 9a 06 lds r19, 0x069A ; 0x80069a 1233c: 40 91 9b 06 lds r20, 0x069B ; 0x80069b 12340: 50 91 9c 06 lds r21, 0x069C ; 0x80069c 12344: 60 e0 ldi r22, 0x00 ; 0 12346: 70 e0 ldi r23, 0x00 ; 0 12348: 80 ea ldi r24, 0xA0 ; 160 1234a: 90 e4 ldi r25, 0x40 ; 64 1234c: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 12350: 2d ec ldi r18, 0xCD ; 205 12352: 3c ec ldi r19, 0xCC ; 204 12354: 4c ec ldi r20, 0xCC ; 204 12356: 5d e3 ldi r21, 0x3D ; 61 12358: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 1235c: 87 ff sbrs r24, 7 1235e: 05 c0 rjmp .+10 ; 0x1236a puts_P(PSTR("Bed leveling failed. Sensor triggered too soon")); 12360: 8d e0 ldi r24, 0x0D ; 13 12362: 9d e7 ldi r25, 0x7D ; 125 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")); 12364: 0f 94 c0 da call 0x3b580 ; 0x3b580 12368: 75 ce rjmp .-790 ; 0x12054 1236a: c0 90 99 06 lds r12, 0x0699 ; 0x800699 1236e: d0 90 9a 06 lds r13, 0x069A ; 0x80069a 12372: e0 90 9b 06 lds r14, 0x069B ; 0x80069b 12376: f0 90 9c 06 lds r15, 0x069C ; 0x80069c 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 1237a: 22 20 and r2, r2 1237c: a1 f0 breq .+40 ; 0x123a6 1237e: a7 01 movw r20, r14 12380: 96 01 movw r18, r12 12382: c3 01 movw r24, r6 12384: b2 01 movw r22, r4 12386: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 1238a: 9b 01 movw r18, r22 1238c: ac 01 movw r20, r24 1238e: 5f 77 andi r21, 0x7F ; 127 12390: 6a 81 ldd r22, Y+2 ; 0x02 12392: 7b 81 ldd r23, Y+3 ; 0x03 12394: 8c 81 ldd r24, Y+4 ; 0x04 12396: 9d 81 ldd r25, Y+5 ; 0x05 12398: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 1239c: 87 ff sbrs r24, 7 1239e: 03 c0 rjmp .+6 ; 0x123a6 puts_P(PSTR("Bed leveling failed. Too much variation from eeprom mesh")); 123a0: 84 ed ldi r24, 0xD4 ; 212 123a2: 9c e7 ldi r25, 0x7C ; 124 123a4: df cf rjmp .-66 ; 0x12364 } #ifdef PINDA_THERMISTOR float temp_compensation_pinda_thermistor_offset(float temperature_pinda) { if (!eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE)) return 0; 123a6: 8f ea ldi r24, 0xAF ; 175 123a8: 9f e0 ldi r25, 0x0F ; 15 123aa: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 123ae: 88 23 and r24, r24 123b0: 09 f4 brne .+2 ; 0x123b4 123b2: 40 c0 rjmp .+128 ; 0x12434 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); } 123b4: 86 ea ldi r24, 0xA6 ; 166 123b6: 9f e0 ldi r25, 0x0F ; 15 123b8: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae if (!calibration_status_pinda()) return 0; 123bc: 88 23 and r24, r24 123be: d1 f1 breq .+116 ; 0x12434 return temp_comp_interpolation(temperature_pinda) / cs.axis_steps_per_mm[Z_AXIS]; 123c0: 60 91 97 03 lds r22, 0x0397 ; 0x800397 123c4: 70 91 98 03 lds r23, 0x0398 ; 0x800398 123c8: 80 91 99 03 lds r24, 0x0399 ; 0x800399 123cc: 90 91 9a 03 lds r25, 0x039A ; 0x80039a 123d0: 0e 94 a2 5c call 0xb944 ; 0xb944 123d4: 20 91 c9 0d lds r18, 0x0DC9 ; 0x800dc9 123d8: 30 91 ca 0d lds r19, 0x0DCA ; 0x800dca 123dc: 40 91 cb 0d lds r20, 0x0DCB ; 0x800dcb 123e0: 50 91 cc 0d lds r21, 0x0DCC ; 0x800dcc 123e4: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 123e8: 9b 01 movw r18, r22 123ea: ac 01 movw r20, r24 123ec: e7 e0 ldi r30, 0x07 ; 7 123ee: ae 85 ldd r26, Y+14 ; 0x0e 123f0: bf 85 ldd r27, Y+15 ; 0x0f 123f2: ea 9f mul r30, r26 123f4: c0 01 movw r24, r0 123f6: eb 9f mul r30, r27 123f8: 90 0d add r25, r0 123fa: 11 24 eor r1, r1 123fc: 08 0f add r16, r24 123fe: 19 1f adc r17, r25 12400: 00 0f add r16, r16 12402: 11 1f adc r17, r17 12404: 00 0f add r16, r16 12406: 11 1f adc r17, r17 12408: 0f 53 subi r16, 0x3F ; 63 1240a: 1c 4e sbci r17, 0xEC ; 236 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; 1240c: c7 01 movw r24, r14 1240e: b6 01 movw r22, r12 12410: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 12414: d8 01 movw r26, r16 12416: 11 96 adiw r26, 0x01 ; 1 12418: 6d 93 st X+, r22 1241a: 7d 93 st X+, r23 1241c: 8d 93 st X+, r24 1241e: 9c 93 st X, r25 12420: 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--; 12422: 80 91 f6 03 lds r24, 0x03F6 ; 0x8003f6 12426: 81 50 subi r24, 0x01 ; 1 12428: 80 93 f6 03 sts 0x03F6, r24 ; 0x8003f6 mesh_point++; lcd_update(1); 1242c: 81 e0 ldi r24, 0x01 ; 1 1242e: 0e 94 bf 6e call 0xdd7e ; 0xdd7e 12432: 0c ce rjmp .-1000 ; 0x1204c } #ifdef PINDA_THERMISTOR float temp_compensation_pinda_thermistor_offset(float temperature_pinda) { if (!eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE)) return 0; 12434: 20 e0 ldi r18, 0x00 ; 0 12436: 30 e0 ldi r19, 0x00 ; 0 12438: a9 01 movw r20, r18 1243a: d8 cf rjmp .-80 ; 0x123ec 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); 1243c: 85 e0 ldi r24, 0x05 ; 5 1243e: 0f 94 c2 4d call 0x29b84 ; 0x29b84 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; 12442: c1 2c mov r12, r1 12444: d1 2c mov r13, r1 12446: 90 ea ldi r25, 0xA0 ; 160 12448: e9 2e mov r14, r25 1244a: 90 e4 ldi r25, 0x40 ; 64 1244c: 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)); 1244e: 82 e1 ldi r24, 0x12 ; 18 12450: 96 e3 ldi r25, 0x36 ; 54 12452: 0e 94 c4 72 call 0xe588 ; 0xe588 12456: 0f 94 ba 1f call 0x23f74 ; 0x23f74 #ifdef TMC2130 lcd_wait_for_click_delay(MSG_BED_LEVELING_FAILED_TIMEOUT); 1245a: 8e e1 ldi r24, 0x1E ; 30 1245c: 90 e0 ldi r25, 0x00 ; 0 1245e: 0f 94 01 3a call 0x27402 ; 0x27402 calibrate_z_auto(); // Z-leveling (X-assembly stay up!!!) 12462: 0e 94 56 73 call 0xe6ac ; 0xe6ac #else // TMC2130 lcd_wait_for_click_delay(0); // ~ no timeout lcd_calibrate_z_end_stop_manual(true); // Z-leveling (X-assembly stay up!!!) #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); 12466: 80 e0 ldi r24, 0x00 ; 0 12468: 0f 94 9d 4d call 0x29b3a ; 0x29b3a 1246c: 18 2f mov r17, r24 raise_z(-1); 1246e: 60 e0 ldi r22, 0x00 ; 0 12470: 70 e0 ldi r23, 0x00 ; 0 12472: 80 e8 ldi r24, 0x80 ; 128 12474: 9f eb ldi r25, 0xBF ; 191 12476: 0e 94 f9 6d call 0xdbf2 ; 0xdbf2 enable_z_endstop(true); 1247a: 81 e0 ldi r24, 0x01 ; 1 1247c: 0f 94 9d 4d call 0x29b3a ; 0x29b3a #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); 12480: 84 e0 ldi r24, 0x04 ; 4 12482: 0f 94 ae 25 call 0x24b5c ; 0x24b5c #endif // TMC2130 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 12486: c0 92 99 06 sts 0x0699, r12 ; 0x800699 1248a: d0 92 9a 06 sts 0x069A, r13 ; 0x80069a 1248e: e0 92 9b 06 sts 0x069B, r14 ; 0x80069b 12492: f0 92 9c 06 sts 0x069C, r15 ; 0x80069c plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 12496: 65 e5 ldi r22, 0x55 ; 85 12498: 75 e5 ldi r23, 0x55 ; 85 1249a: 85 e5 ldi r24, 0x55 ; 85 1249c: 91 e4 ldi r25, 0x41 ; 65 1249e: 0f 94 04 c0 call 0x38008 ; 0x38008 st_synchronize(); 124a2: 0f 94 a3 42 call 0x28546 ; 0x28546 #ifdef TMC2130 tmc2130_home_exit(); 124a6: 0f 94 7f 25 call 0x24afe ; 0x24afe #endif // TMC2130 enable_z_endstop(bState); 124aa: 81 2f mov r24, r17 124ac: 0f 94 9d 4d call 0x29b3a ; 0x29b3a } while (st_get_position_mm(Z_AXIS) > MESH_HOME_Z_SEARCH); // i.e. Z-leveling not o.k. 124b0: 82 e0 ldi r24, 0x02 ; 2 124b2: 0f 94 8f 42 call 0x2851e ; 0x2851e 124b6: 20 e0 ldi r18, 0x00 ; 0 124b8: 30 e0 ldi r19, 0x00 ; 0 124ba: 40 ea ldi r20, 0xA0 ; 160 124bc: 50 e4 ldi r21, 0x40 ; 64 124be: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 124c2: 18 16 cp r1, r24 124c4: 24 f2 brlt .-120 ; 0x1244e custom_message_type = custom_message_type_old; 124c6: ef 81 ldd r30, Y+7 ; 0x07 124c8: e0 93 c3 06 sts 0x06C3, r30 ; 0x8006c3 custom_message_state = custom_message_state_old; 124cc: f8 85 ldd r31, Y+8 ; 0x08 124ce: f0 93 f6 03 sts 0x03F6, r31 ; 0x8003f6 lcd_update_enable(true); // display / status-line recovery 124d2: 81 e0 ldi r24, 0x01 ; 1 124d4: 0e 94 3d 6f call 0xde7a ; 0xde7a gcode_G28(true, true, true); // X & Y & Z-homing (must be after individual Z-homing (problem with spool-holder)!) 124d8: 41 e0 ldi r20, 0x01 ; 1 124da: 61 e0 ldi r22, 0x01 ; 1 124dc: 81 e0 ldi r24, 0x01 ; 1 124de: 0e 94 1d 7f call 0xfe3a ; 0xfe3a 124e2: 81 e0 ldi r24, 0x01 ; 1 124e4: 80 93 a1 10 sts 0x10A1, r24 ; 0x8010a1 124e8: ce cb rjmp .-2148 ; 0x11c86 repeatcommand_front(); // re-run (i.e. of "G80") return; } g80_fail_cnt = 0; // no fail was detected. Reset the error counter. 124ea: 10 92 68 03 sts 0x0368, r1 ; 0x800368 clean_up_after_endstop_move(l_feedmultiply); 124ee: 8b a1 ldd r24, Y+35 ; 0x23 124f0: 9c a1 ldd r25, Y+36 ; 0x24 124f2: 0e 94 e6 66 call 0xcdcc ; 0xcdcc } } void babystep_apply() { babystep_load(); 124f6: 0f 94 40 c9 call 0x39280 ; 0x39280 shift_z(- float(babystepLoadZ) / float(cs.axis_steps_per_mm[Z_AXIS])); 124fa: 60 91 89 06 lds r22, 0x0689 ; 0x800689 <_ZL13babystepLoadZ.lto_priv.497> 124fe: 70 91 8a 06 lds r23, 0x068A ; 0x80068a <_ZL13babystepLoadZ.lto_priv.497+0x1> 12502: 07 2e mov r0, r23 12504: 00 0c add r0, r0 12506: 88 0b sbc r24, r24 12508: 99 0b sbc r25, r25 1250a: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 1250e: 90 58 subi r25, 0x80 ; 128 12510: 20 91 c9 0d lds r18, 0x0DC9 ; 0x800dc9 12514: 30 91 ca 0d lds r19, 0x0DCA ; 0x800dca 12518: 40 91 cb 0d lds r20, 0x0DCB ; 0x800dcb 1251c: 50 91 cc 0d lds r21, 0x0DCC ; 0x800dcc 12520: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 12524: 0f 94 5c c9 call 0x392b8 ; 0x392b8 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; 12528: 80 ec ldi r24, 0xC0 ; 192 1252a: 9f e0 ldi r25, 0x0F ; 15 1252c: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 12530: 91 e0 ldi r25, 0x01 ; 1 12532: 81 30 cpi r24, 0x01 ; 1 12534: 09 f0 breq .+2 ; 0x12538 12536: 90 e0 ldi r25, 0x00 ; 0 } } else if (eeprom_bed_correction_valid) { return (int8_t)eeprom_read_byte(eep_address); } return 0; }; 12538: 99 83 std Y+1, r25 ; 0x01 const int8_t correction[4] = { bedCorrectHelper('L', (uint8_t*)EEPROM_BED_CORRECTION_LEFT), 1253a: 4f eb ldi r20, 0xBF ; 191 1253c: 5f e0 ldi r21, 0x0F ; 15 1253e: 6c e4 ldi r22, 0x4C ; 76 12540: ce 01 movw r24, r28 12542: 01 96 adiw r24, 0x01 ; 1 12544: 0e 94 03 5c call 0xb806 ; 0xb806 12548: f8 2e mov r15, r24 bedCorrectHelper('R', (uint8_t*)EEPROM_BED_CORRECTION_RIGHT), 1254a: 4e eb ldi r20, 0xBE ; 190 1254c: 5f e0 ldi r21, 0x0F ; 15 1254e: 62 e5 ldi r22, 0x52 ; 82 12550: ce 01 movw r24, r28 12552: 01 96 adiw r24, 0x01 ; 1 12554: 0e 94 03 5c call 0xb806 ; 0xb806 12558: 08 2f mov r16, r24 bedCorrectHelper('F', (uint8_t*)EEPROM_BED_CORRECTION_FRONT), 1255a: 4d eb ldi r20, 0xBD ; 189 1255c: 5f e0 ldi r21, 0x0F ; 15 1255e: 66 e4 ldi r22, 0x46 ; 70 12560: ce 01 movw r24, r28 12562: 01 96 adiw r24, 0x01 ; 1 12564: 0e 94 03 5c call 0xb806 ; 0xb806 12568: 18 2f mov r17, r24 bedCorrectHelper('B', (uint8_t*)EEPROM_BED_CORRECTION_REAR), 1256a: 4c eb ldi r20, 0xBC ; 188 1256c: 5f e0 ldi r21, 0x0F ; 15 1256e: 62 e4 ldi r22, 0x42 ; 66 12570: ce 01 movw r24, r28 12572: 01 96 adiw r24, 0x01 ; 1 12574: 0e 94 03 5c call 0xb806 ; 0xb806 12578: 21 2f mov r18, r17 1257a: 11 0f add r17, r17 1257c: 33 0b sbc r19, r19 1257e: 08 2e mov r0, r24 12580: 00 0c add r0, r0 12582: 99 0b sbc r25, r25 12584: 5c 01 movw r10, r24 12586: a2 1a sub r10, r18 12588: b3 0a sbc r11, r19 1258a: 8f 2d mov r24, r15 1258c: ff 0c add r15, r15 1258e: 99 0b sbc r25, r25 12590: 28 0f add r18, r24 12592: 39 1f adc r19, r25 12594: 46 e0 ldi r20, 0x06 ; 6 12596: 42 9f mul r20, r18 12598: 60 01 movw r12, r0 1259a: 43 9f mul r20, r19 1259c: d0 0c add r13, r0 1259e: 11 24 eor r1, r1 125a0: f1 2c mov r15, r1 125a2: e1 2c mov r14, r1 125a4: 00 2e mov r0, r16 125a6: 00 0c add r0, r0 125a8: 11 0b sbc r17, r17 125aa: 08 1b sub r16, r24 125ac: 19 0b sbc r17, r25 125ae: b7 01 movw r22, r14 125b0: 6e 53 subi r22, 0x3E ; 62 125b2: 7c 4e sbci r23, 0xEC ; 236 125b4: 3b 01 movw r6, r22 125b6: 46 01 movw r8, r12 125b8: 77 e0 ldi r23, 0x07 ; 7 125ba: 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 * ( 125bc: d3 01 movw r26, r6 125be: 2d 90 ld r2, X+ 125c0: 3d 90 ld r3, X+ 125c2: 4d 90 ld r4, X+ 125c4: 5d 90 ld r5, X+ 125c6: 3d 01 movw r6, r26 125c8: fd 01 movw r30, r26 125ca: 34 97 sbiw r30, 0x04 ; 4 125cc: fb 87 std Y+11, r31 ; 0x0b 125ce: ea 87 std Y+10, r30 ; 0x0a 125d0: b4 01 movw r22, r8 125d2: 09 2c mov r0, r9 125d4: 00 0c add r0, r0 125d6: 88 0b sbc r24, r24 125d8: 99 0b sbc r25, r25 125da: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 125de: 2f e3 ldi r18, 0x3F ; 63 125e0: 33 ec ldi r19, 0xC3 ; 195 125e2: 4e e2 ldi r20, 0x2E ; 46 125e4: 59 e3 ldi r21, 0x39 ; 57 125e6: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 125ea: a2 01 movw r20, r4 125ec: 91 01 movw r18, r2 125ee: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 125f2: aa 85 ldd r26, Y+10 ; 0x0a 125f4: bb 85 ldd r27, Y+11 ; 0x0b 125f6: 6d 93 st X+, r22 125f8: 7d 93 st X+, r23 125fa: 8d 93 st X+, r24 125fc: 9c 93 st X, r25 125fe: 13 97 sbiw r26, 0x03 ; 3 12600: ba 81 ldd r27, Y+2 ; 0x02 12602: b1 50 subi r27, 0x01 ; 1 12604: ba 83 std Y+2, r27 ; 0x02 12606: 80 0e add r8, r16 12608: 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++) { 1260a: b1 11 cpse r27, r1 1260c: d7 cf rjmp .-82 ; 0x125bc 1260e: ca 0c add r12, r10 12610: db 1c adc r13, r11 12612: ec e1 ldi r30, 0x1C ; 28 12614: ee 0e add r14, r30 12616: 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++) { 12618: f4 ec ldi r31, 0xC4 ; 196 1261a: ef 16 cp r14, r31 1261c: f1 04 cpc r15, r1 1261e: 39 f6 brne .-114 ; 0x125ae + 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) 12620: 0f 94 b1 a2 call 0x34562 ; 0x34562 { // apply magnet compensation uint8_t useMagnetCompensation = code_seen('M') ? code_value_uint8() : eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION); 12624: 8d e4 ldi r24, 0x4D ; 77 12626: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 1262a: 88 23 and r24, r24 1262c: 09 f4 brne .+2 ; 0x12630 1262e: 84 c0 rjmp .+264 ; 0x12738 12630: 0e 94 80 5b call 0xb700 ; 0xb700 if (nMeasPoints == 7 && useMagnetCompensation) { 12634: 2e 81 ldd r18, Y+6 ; 0x06 12636: 27 30 cpi r18, 0x07 ; 7 12638: 09 f0 breq .+2 ; 0x1263c 1263a: 94 c0 rjmp .+296 ; 0x12764 1263c: 88 23 and r24, r24 1263e: 09 f4 brne .+2 ; 0x12642 12640: 91 c0 rjmp .+290 ; 0x12764 12642: bb 24 eor r11, r11 12644: b3 94 inc r11 12646: aa 24 eor r10, r10 12648: aa 94 dec r10 1264a: ab 0c add r10, r11 1264c: 09 a1 ldd r16, Y+33 ; 0x21 1264e: 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++) { 12650: 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++; } 12652: 8e ef ldi r24, 0xFE ; 254 12654: 88 2e mov r8, r24 12656: 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)) { 12658: 6a 2d mov r22, r10 1265a: 86 2d mov r24, r6 1265c: 0f 94 0b c9 call 0x39216 ; 0x39216 12660: 99 24 eor r9, r9 12662: 93 94 inc r9 12664: 96 0c add r9, r6 12666: 81 11 cpse r24, r1 12668: 6e c0 rjmp .+220 ; 0x12746 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++; } 1266a: 6b 2d mov r22, r11 1266c: 86 2d mov r24, r6 1266e: 0f 94 0b c9 call 0x39216 ; 0x39216 } 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; 12672: c1 2c mov r12, r1 12674: d1 2c mov r13, r1 12676: 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; 12678: 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++; } 1267a: 88 23 and r24, r24 1267c: 81 f0 breq .+32 ; 0x1269e 1267e: 20 e0 ldi r18, 0x00 ; 0 12680: 30 e0 ldi r19, 0x00 ; 0 12682: a9 01 movw r20, r18 12684: d8 01 movw r26, r16 12686: 5d 96 adiw r26, 0x1d ; 29 12688: 6d 91 ld r22, X+ 1268a: 7d 91 ld r23, X+ 1268c: 8d 91 ld r24, X+ 1268e: 9c 91 ld r25, X 12690: 90 97 sbiw r26, 0x20 ; 32 12692: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 12696: 6b 01 movw r12, r22 12698: 7c 01 movw r14, r24 1269a: 77 24 eor r7, r7 1269c: 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++; } 1269e: 68 2d mov r22, r8 126a0: 86 2d mov r24, r6 126a2: 0f 94 0b c9 call 0x39216 ; 0x39216 126a6: 88 23 and r24, r24 126a8: 69 f0 breq .+26 ; 0x126c4 126aa: f8 01 movw r30, r16 126ac: 7b 97 sbiw r30, 0x1b ; 27 126ae: 20 81 ld r18, Z 126b0: 31 81 ldd r19, Z+1 ; 0x01 126b2: 42 81 ldd r20, Z+2 ; 0x02 126b4: 53 81 ldd r21, Z+3 ; 0x03 126b6: c7 01 movw r24, r14 126b8: b6 01 movw r22, r12 126ba: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 126be: 6b 01 movw r12, r22 126c0: 7c 01 movw r14, r24 126c2: 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++; } 126c4: 6a 2d mov r22, r10 126c6: 89 2d mov r24, r9 126c8: 0f 94 0b c9 call 0x39216 ; 0x39216 126cc: 88 23 and r24, r24 126ce: 61 f0 breq .+24 ; 0x126e8 126d0: f8 01 movw r30, r16 126d2: 25 81 ldd r18, Z+5 ; 0x05 126d4: 36 81 ldd r19, Z+6 ; 0x06 126d6: 47 81 ldd r20, Z+7 ; 0x07 126d8: 50 85 ldd r21, Z+8 ; 0x08 126da: c7 01 movw r24, r14 126dc: b6 01 movw r22, r12 126de: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 126e2: 6b 01 movw r12, r22 126e4: 7c 01 movw r14, r24 126e6: 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++; } 126e8: 6a 2d mov r22, r10 126ea: 8f ef ldi r24, 0xFF ; 255 126ec: 86 0d add r24, r6 126ee: 0f 94 0b c9 call 0x39216 ; 0x39216 126f2: 88 23 and r24, r24 126f4: 31 f1 breq .+76 ; 0x12742 126f6: f8 01 movw r30, r16 126f8: 33 97 sbiw r30, 0x03 ; 3 126fa: 20 81 ld r18, Z 126fc: 31 81 ldd r19, Z+1 ; 0x01 126fe: 42 81 ldd r20, Z+2 ; 0x02 12700: 53 81 ldd r21, Z+3 ; 0x03 12702: c7 01 movw r24, r14 12704: b6 01 movw r22, r12 12706: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 1270a: 6b 01 movw r12, r22 1270c: 7c 01 movw r14, r24 1270e: 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 12710: 67 2d mov r22, r7 12712: 70 e0 ldi r23, 0x00 ; 0 12714: 90 e0 ldi r25, 0x00 ; 0 12716: 80 e0 ldi r24, 0x00 ; 0 12718: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 1271c: 9b 01 movw r18, r22 1271e: ac 01 movw r20, r24 12720: c7 01 movw r24, r14 12722: b6 01 movw r22, r12 12724: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 12728: d8 01 movw r26, r16 1272a: 11 96 adiw r26, 0x01 ; 1 1272c: 6d 93 st X+, r22 1272e: 7d 93 st X+, r23 12730: 8d 93 st X+, r24 12732: 9c 93 st X, r25 12734: 14 97 sbiw r26, 0x04 ; 4 12736: 07 c0 rjmp .+14 ; 0x12746 } 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); 12738: 8c ea ldi r24, 0xAC ; 172 1273a: 9d e0 ldi r25, 0x0D ; 13 1273c: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 12740: 79 cf rjmp .-270 ; 0x12634 12742: 71 10 cpse r7, r1 12744: e5 cf rjmp .-54 ; 0x12710 //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++) { 12746: 69 2c mov r6, r9 12748: 0c 5f subi r16, 0xFC ; 252 1274a: 1f 4f sbci r17, 0xFF ; 255 1274c: b7 e0 ldi r27, 0x07 ; 7 1274e: 9b 12 cpse r9, r27 12750: 83 cf rjmp .-250 ; 0x12658 12752: b3 94 inc r11 12754: e9 a1 ldd r30, Y+33 ; 0x21 12756: fa a1 ldd r31, Y+34 ; 0x22 12758: 7c 96 adiw r30, 0x1c ; 28 1275a: fa a3 std Y+34, r31 ; 0x22 1275c: 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++) { 1275e: f8 e0 ldi r31, 0x08 ; 8 12760: bf 12 cpse r11, r31 12762: 71 cf rjmp .-286 ; 0x12646 if (nMeasPoints == 7 && useMagnetCompensation) { mbl_magnet_elimination(); } } mbl.active = 1; //activate mesh bed leveling 12764: 81 e0 ldi r24, 0x01 ; 1 12766: 80 93 c1 13 sts 0x13C1, r24 ; 0x8013c1 if (code_seen('O') && !code_value_uint8()) { 1276a: 8f e4 ldi r24, 0x4F ; 79 1276c: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 12770: 81 11 cpse r24, r1 12772: 03 c0 rjmp .+6 ; 0x1277a // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); } else { go_home_with_z_lift(); 12774: 0f 94 b1 c9 call 0x39362 ; 0x39362 12778: 9b cc rjmp .-1738 ; 0x120b0 } } mbl.active = 1; //activate mesh bed leveling if (code_seen('O') && !code_value_uint8()) { 1277a: 0e 94 80 5b call 0xb700 ; 0xb700 1277e: 81 11 cpse r24, r1 12780: f9 cf rjmp .-14 ; 0x12774 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 12782: 0e 94 db 66 call 0xcdb6 ; 0xcdb6 12786: 94 cc rjmp .-1752 ; 0x120b0 00012788 : //! @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() { 12788: 4f 92 push r4 1278a: 5f 92 push r5 1278c: 6f 92 push r6 1278e: 7f 92 push r7 12790: 8f 92 push r8 12792: 9f 92 push r9 12794: af 92 push r10 12796: bf 92 push r11 12798: ef 92 push r14 1279a: ff 92 push r15 1279c: 0f 93 push r16 1279e: 1f 93 push r17 127a0: cf 93 push r28 127a2: df 93 push r29 127a4: 1f 92 push r1 127a6: cd b7 in r28, 0x3d ; 61 127a8: de b7 in r29, 0x3e ; 62 eeprom_read_block(reinterpret_cast(cs.version), reinterpret_cast(EEPROM_M500_base->version), sizeof(cs.version)); 127aa: 44 e0 ldi r20, 0x04 ; 4 127ac: 50 e0 ldi r21, 0x00 ; 0 127ae: 64 e1 ldi r22, 0x14 ; 20 127b0: 70 e0 ldi r23, 0x00 ; 0 127b2: 8d eb ldi r24, 0xBD ; 189 127b4: 9d e0 ldi r25, 0x0D ; 13 127b6: 0f 94 c7 db call 0x3b78e ; 0x3b78e // SERIAL_ECHOLN("Version: [" << ver << "] Stored version: [" << cs.version << "]"); if (strncmp_P(cs.version, default_conf.version, sizeof(EEPROM_VERSION)) == 0) // version number match 127ba: 43 e0 ldi r20, 0x03 ; 3 127bc: 50 e0 ldi r21, 0x00 ; 0 127be: 63 e6 ldi r22, 0x63 ; 99 127c0: 78 e7 ldi r23, 0x78 ; 120 127c2: 8d eb ldi r24, 0xBD ; 189 127c4: 9d e0 ldi r25, 0x0D ; 13 127c6: 0f 94 b6 d9 call 0x3b36c ; 0x3b36c 127ca: 89 2b or r24, r25 127cc: 09 f0 breq .+2 ; 0x127d0 127ce: 9f c1 rjmp .+830 ; 0x12b0e { // 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)); 127d0: e7 e2 ldi r30, 0x27 ; 39 127d2: f9 e7 ldi r31, 0x79 ; 121 127d4: 45 91 lpm r20, Z+ 127d6: 55 91 lpm r21, Z+ 127d8: 65 91 lpm r22, Z+ 127da: 74 91 lpm r23, Z 127dc: 88 ed ldi r24, 0xD8 ; 216 127de: 90 e0 ldi r25, 0x00 ; 0 127e0: 0e 94 3f 64 call 0xc87e ; 0xc87e eeprom_init_default_float(&EEPROM_M500_base->min_mm_per_arc_segment, pgm_read_float(&default_conf.min_mm_per_arc_segment)); 127e4: eb e2 ldi r30, 0x2B ; 43 127e6: f9 e7 ldi r31, 0x79 ; 121 127e8: 45 91 lpm r20, Z+ 127ea: 55 91 lpm r21, Z+ 127ec: 65 91 lpm r22, Z+ 127ee: 74 91 lpm r23, Z 127f0: 8c ed ldi r24, 0xDC ; 220 127f2: 90 e0 ldi r25, 0x00 ; 0 127f4: 0e 94 3f 64 call 0xc87e ; 0xc87e eeprom_init_default_byte(&EEPROM_M500_base->n_arc_correction, pgm_read_byte(&default_conf.n_arc_correction)); 127f8: ef e2 ldi r30, 0x2F ; 47 127fa: f9 e7 ldi r31, 0x79 ; 121 127fc: 64 91 lpm r22, Z 127fe: 80 ee ldi r24, 0xE0 ; 224 12800: 90 e0 ldi r25, 0x00 ; 0 12802: 0e 94 21 76 call 0xec42 ; 0xec42 eeprom_init_default_word(&EEPROM_M500_base->min_arc_segments, pgm_read_word(&default_conf.min_arc_segments)); 12806: e0 e3 ldi r30, 0x30 ; 48 12808: f9 e7 ldi r31, 0x79 ; 121 1280a: 65 91 lpm r22, Z+ 1280c: 74 91 lpm r23, Z 1280e: 81 ee ldi r24, 0xE1 ; 225 12810: 90 e0 ldi r25, 0x00 ; 0 12812: 0e 94 09 76 call 0xec12 ; 0xec12 eeprom_init_default_word(&EEPROM_M500_base->arc_segments_per_sec, pgm_read_word(&default_conf.arc_segments_per_sec)); 12816: e2 e3 ldi r30, 0x32 ; 50 12818: f9 e7 ldi r31, 0x79 ; 121 1281a: 65 91 lpm r22, Z+ 1281c: 74 91 lpm r23, Z 1281e: 83 ee ldi r24, 0xE3 ; 227 12820: 90 e0 ldi r25, 0x00 ; 0 12822: 0e 94 09 76 call 0xec12 ; 0xec12 // 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)); 12826: e3 e2 ldi r30, 0x23 ; 35 12828: f9 e7 ldi r31, 0x79 ; 121 1282a: 45 91 lpm r20, Z+ 1282c: 55 91 lpm r21, Z+ 1282e: 65 91 lpm r22, Z+ 12830: 74 91 lpm r23, Z 12832: 84 ed ldi r24, 0xD4 ; 212 12834: 90 e0 ldi r25, 0x00 ; 0 12836: 0e 94 3f 64 call 0xc87e ; 0xc87e // 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); 1283a: 4f ef ldi r20, 0xFF ; 255 1283c: 58 e7 ldi r21, 0x78 ; 120 1283e: 60 e1 ldi r22, 0x10 ; 16 12840: 70 e0 ldi r23, 0x00 ; 0 12842: 80 eb ldi r24, 0xB0 ; 176 12844: 90 e0 ldi r25, 0x00 ; 0 12846: 0e 94 ea 75 call 0xebd4 ; 0xebd4 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); 1284a: 4f e0 ldi r20, 0x0F ; 15 1284c: 59 e7 ldi r21, 0x79 ; 121 1284e: 60 e1 ldi r22, 0x10 ; 16 12850: 70 e0 ldi r23, 0x00 ; 0 12852: 80 ec ldi r24, 0xC0 ; 192 12854: 90 e0 ldi r25, 0x00 ; 0 12856: 0e 94 ea 75 call 0xebd4 ; 0xebd4 #ifdef TMC2130 eeprom_init_default_block(&EEPROM_M500_base->axis_ustep_resolution, sizeof(EEPROM_M500_base->axis_ustep_resolution), default_conf.axis_ustep_resolution); 1285a: 4f e1 ldi r20, 0x1F ; 31 1285c: 59 e7 ldi r21, 0x79 ; 121 1285e: 64 e0 ldi r22, 0x04 ; 4 12860: 70 e0 ldi r23, 0x00 ; 0 12862: 80 ed ldi r24, 0xD0 ; 208 12864: 90 e0 ldi r25, 0x00 ; 0 12866: 0e 94 ea 75 call 0xebd4 ; 0xebd4 #endif // TMC2130 // load the CS to RAM eeprom_read_block(reinterpret_cast(&cs), reinterpret_cast(EEPROM_M500_base), sizeof(cs)); 1286a: 41 ed ldi r20, 0xD1 ; 209 1286c: 50 e0 ldi r21, 0x00 ; 0 1286e: 64 e1 ldi r22, 0x14 ; 20 12870: 70 e0 ldi r23, 0x00 ; 0 12872: 8d eb ldi r24, 0xBD ; 189 12874: 9d e0 ldi r25, 0x0D ; 13 12876: 0f 94 c7 db call 0x3b78e ; 0x3b78e calculate_extruder_multipliers(); 1287a: 0e 94 d1 65 call 0xcba2 ; 0xcba2 1287e: 0d eb ldi r16, 0xBD ; 189 12880: 1d e0 ldi r17, 0x0D ; 13 12882: 89 e5 ldi r24, 0x59 ; 89 12884: e8 2e mov r14, r24 12886: 8e e0 ldi r24, 0x0E ; 14 12888: f8 2e mov r15, r24 if (cs.max_feedrate_normal[j] > NORMAL_MAX_FEEDRATE_XY) cs.max_feedrate_normal[j] = NORMAL_MAX_FEEDRATE_XY; if (cs.max_feedrate_silent[j] > SILENT_MAX_FEEDRATE_XY) cs.max_feedrate_silent[j] = SILENT_MAX_FEEDRATE_XY; if (cs.max_acceleration_mm_per_s2_normal[j] > NORMAL_MAX_ACCEL_XY) cs.max_acceleration_mm_per_s2_normal[j] = NORMAL_MAX_ACCEL_XY; 1288a: 94 ec ldi r25, 0xC4 ; 196 1288c: 89 2e mov r8, r25 1288e: 99 e0 ldi r25, 0x09 ; 9 12890: 99 2e mov r9, r25 12892: a1 2c mov r10, r1 12894: b1 2c mov r11, r1 if (cs.max_acceleration_mm_per_s2_silent[j] > SILENT_MAX_ACCEL_XY) cs.max_acceleration_mm_per_s2_silent[j] = SILENT_MAX_ACCEL_XY; 12896: 20 ec ldi r18, 0xC0 ; 192 12898: 42 2e mov r4, r18 1289a: 23 e0 ldi r18, 0x03 ; 3 1289c: 52 2e mov r5, r18 1289e: 61 2c mov r6, r1 128a0: 71 2c mov r7, r1 calculate_extruder_multipliers(); #ifdef TMC2130 for (uint8_t j = X_AXIS; j <= Y_AXIS; j++) { if (cs.max_feedrate_normal[j] > NORMAL_MAX_FEEDRATE_XY) 128a2: 20 e0 ldi r18, 0x00 ; 0 128a4: 30 e0 ldi r19, 0x00 ; 0 128a6: 48 e4 ldi r20, 0x48 ; 72 128a8: 53 e4 ldi r21, 0x43 ; 67 128aa: f8 01 movw r30, r16 128ac: 64 89 ldd r22, Z+20 ; 0x14 128ae: 75 89 ldd r23, Z+21 ; 0x15 128b0: 86 89 ldd r24, Z+22 ; 0x16 128b2: 97 89 ldd r25, Z+23 ; 0x17 128b4: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 128b8: 18 16 cp r1, r24 128ba: 4c f4 brge .+18 ; 0x128ce cs.max_feedrate_normal[j] = NORMAL_MAX_FEEDRATE_XY; 128bc: 80 e0 ldi r24, 0x00 ; 0 128be: 90 e0 ldi r25, 0x00 ; 0 128c0: a8 e4 ldi r26, 0x48 ; 72 128c2: b3 e4 ldi r27, 0x43 ; 67 128c4: f8 01 movw r30, r16 128c6: 84 8b std Z+20, r24 ; 0x14 128c8: 95 8b std Z+21, r25 ; 0x15 128ca: a6 8b std Z+22, r26 ; 0x16 128cc: b7 8b std Z+23, r27 ; 0x17 if (cs.max_feedrate_silent[j] > SILENT_MAX_FEEDRATE_XY) 128ce: f7 01 movw r30, r14 128d0: 61 91 ld r22, Z+ 128d2: 71 91 ld r23, Z+ 128d4: 81 91 ld r24, Z+ 128d6: 91 91 ld r25, Z+ 128d8: 7f 01 movw r14, r30 128da: 20 e0 ldi r18, 0x00 ; 0 128dc: 30 e0 ldi r19, 0x00 ; 0 128de: 48 ec ldi r20, 0xC8 ; 200 128e0: 52 e4 ldi r21, 0x42 ; 66 128e2: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 128e6: 18 16 cp r1, r24 128e8: 54 f4 brge .+20 ; 0x128fe cs.max_feedrate_silent[j] = SILENT_MAX_FEEDRATE_XY; 128ea: 80 e0 ldi r24, 0x00 ; 0 128ec: 90 e0 ldi r25, 0x00 ; 0 128ee: a8 ec ldi r26, 0xC8 ; 200 128f0: b2 e4 ldi r27, 0x42 ; 66 128f2: f7 01 movw r30, r14 128f4: 34 97 sbiw r30, 0x04 ; 4 128f6: 80 83 st Z, r24 128f8: 91 83 std Z+1, r25 ; 0x01 128fa: a2 83 std Z+2, r26 ; 0x02 128fc: b3 83 std Z+3, r27 ; 0x03 if (cs.max_acceleration_mm_per_s2_normal[j] > NORMAL_MAX_ACCEL_XY) 128fe: f8 01 movw r30, r16 12900: 84 a1 ldd r24, Z+36 ; 0x24 12902: 95 a1 ldd r25, Z+37 ; 0x25 12904: a6 a1 ldd r26, Z+38 ; 0x26 12906: b7 a1 ldd r27, Z+39 ; 0x27 12908: 85 3c cpi r24, 0xC5 ; 197 1290a: 99 40 sbci r25, 0x09 ; 9 1290c: a1 05 cpc r26, r1 1290e: b1 05 cpc r27, r1 12910: 28 f0 brcs .+10 ; 0x1291c cs.max_acceleration_mm_per_s2_normal[j] = NORMAL_MAX_ACCEL_XY; 12912: f8 01 movw r30, r16 12914: 84 a2 std Z+36, r8 ; 0x24 12916: 95 a2 std Z+37, r9 ; 0x25 12918: a6 a2 std Z+38, r10 ; 0x26 1291a: b7 a2 std Z+39, r11 ; 0x27 if (cs.max_acceleration_mm_per_s2_silent[j] > SILENT_MAX_ACCEL_XY) 1291c: f7 01 movw r30, r14 1291e: 84 85 ldd r24, Z+12 ; 0x0c 12920: 95 85 ldd r25, Z+13 ; 0x0d 12922: a6 85 ldd r26, Z+14 ; 0x0e 12924: b7 85 ldd r27, Z+15 ; 0x0f 12926: 81 3c cpi r24, 0xC1 ; 193 12928: 93 40 sbci r25, 0x03 ; 3 1292a: a1 05 cpc r26, r1 1292c: b1 05 cpc r27, r1 1292e: 28 f0 brcs .+10 ; 0x1293a cs.max_acceleration_mm_per_s2_silent[j] = SILENT_MAX_ACCEL_XY; 12930: f7 01 movw r30, r14 12932: 44 86 std Z+12, r4 ; 0x0c 12934: 55 86 std Z+13, r5 ; 0x0d 12936: 66 86 std Z+14, r6 ; 0x0e 12938: 77 86 std Z+15, r7 ; 0x0f 1293a: 0c 5f subi r16, 0xFC ; 252 1293c: 1f 4f sbci r17, 0xFF ; 255 // load the CS to RAM eeprom_read_block(reinterpret_cast(&cs), reinterpret_cast(EEPROM_M500_base), sizeof(cs)); calculate_extruder_multipliers(); #ifdef TMC2130 for (uint8_t j = X_AXIS; j <= Y_AXIS; j++) 1293e: fd e0 ldi r31, 0x0D ; 13 12940: 05 3c cpi r16, 0xC5 ; 197 12942: 1f 07 cpc r17, r31 12944: 09 f0 breq .+2 ; 0x12948 12946: ad cf rjmp .-166 ; 0x128a2 cs.max_acceleration_mm_per_s2_normal[j] = NORMAL_MAX_ACCEL_XY; if (cs.max_acceleration_mm_per_s2_silent[j] > SILENT_MAX_ACCEL_XY) cs.max_acceleration_mm_per_s2_silent[j] = SILENT_MAX_ACCEL_XY; } tmc2130_set_res(X_AXIS, cs.axis_ustep_resolution[X_AXIS]); 12948: 60 91 79 0e lds r22, 0x0E79 ; 0x800e79 1294c: 70 e0 ldi r23, 0x00 ; 0 1294e: 80 e0 ldi r24, 0x00 ; 0 12950: 0f 94 d0 24 call 0x249a0 ; 0x249a0 tmc2130_set_res(Y_AXIS, cs.axis_ustep_resolution[Y_AXIS]); 12954: 60 91 7a 0e lds r22, 0x0E7A ; 0x800e7a 12958: 70 e0 ldi r23, 0x00 ; 0 1295a: 81 e0 ldi r24, 0x01 ; 1 1295c: 0f 94 d0 24 call 0x249a0 ; 0x249a0 tmc2130_set_res(Z_AXIS, cs.axis_ustep_resolution[Z_AXIS]); 12960: 60 91 7b 0e lds r22, 0x0E7B ; 0x800e7b 12964: 70 e0 ldi r23, 0x00 ; 0 12966: 82 e0 ldi r24, 0x02 ; 2 12968: 0f 94 d0 24 call 0x249a0 ; 0x249a0 tmc2130_set_res(E_AXIS, cs.axis_ustep_resolution[E_AXIS]); 1296c: 60 91 7c 0e lds r22, 0x0E7C ; 0x800e7c 12970: 70 e0 ldi r23, 0x00 ; 0 12972: 83 e0 ldi r24, 0x03 ; 3 12974: 0f 94 d0 24 call 0x249a0 ; 0x249a0 #endif //TMC2130 reset_acceleration_rates(); 12978: 0f 94 1a 63 call 0x2c634 ; 0x2c634 // Call updatePID (similar to when we have processed M301) updatePID(); 1297c: 0f 94 a5 3a call 0x2754a ; 0x2754a } void thermal_model_load_settings() { static_assert(THERMAL_MODEL_R_SIZE == 16); // ensure we don't desync with the eeprom table TempMgrGuard temp_mgr_guard; 12980: ce 01 movw r24, r28 12982: 01 96 adiw r24, 0x01 ; 1 12984: 0f 94 70 31 call 0x262e0 ; 0x262e0 // handle upgrade from a model without UVDL (FW<3.13, TM VER<1): model is retro-compatible, // reset UV to an identity without doing any special handling eeprom_init_default_float((float*)EEPROM_THERMAL_MODEL_U, THERMAL_MODEL_DEF(U)); 12988: 40 e0 ldi r20, 0x00 ; 0 1298a: 50 e0 ldi r21, 0x00 ; 0 1298c: ba 01 movw r22, r20 1298e: 82 ea ldi r24, 0xA2 ; 162 12990: 9c e0 ldi r25, 0x0C ; 12 12992: 0e 94 3f 64 call 0xc87e ; 0xc87e eeprom_init_default_float((float*)EEPROM_THERMAL_MODEL_V, THERMAL_MODEL_DEF(V)); 12996: 40 e0 ldi r20, 0x00 ; 0 12998: 50 e0 ldi r21, 0x00 ; 0 1299a: 60 e8 ldi r22, 0x80 ; 128 1299c: 7f e3 ldi r23, 0x3F ; 63 1299e: 8e e9 ldi r24, 0x9E ; 158 129a0: 9c e0 ldi r25, 0x0C ; 12 129a2: 0e 94 3f 64 call 0xc87e ; 0xc87e eeprom_init_default_float((float*)EEPROM_THERMAL_MODEL_D, THERMAL_MODEL_DEF(fS)); 129a6: 48 eb ldi r20, 0xB8 ; 184 129a8: 5e e1 ldi r21, 0x1E ; 30 129aa: 65 e8 ldi r22, 0x85 ; 133 129ac: 7d e3 ldi r23, 0x3D ; 61 129ae: 8a e9 ldi r24, 0x9A ; 154 129b0: 9c e0 ldi r25, 0x0C ; 12 129b2: 0e 94 3f 64 call 0xc87e ; 0xc87e eeprom_init_default_word((uint16_t*)EEPROM_THERMAL_MODEL_L, THERMAL_MODEL_DEF(LAG)); 129b6: 64 e3 ldi r22, 0x34 ; 52 129b8: 78 e0 ldi r23, 0x08 ; 8 129ba: 88 e9 ldi r24, 0x98 ; 152 129bc: 9c e0 ldi r25, 0x0C ; 12 129be: 0e 94 09 76 call 0xec12 ; 0xec12 eeprom_init_default_byte((uint8_t*)EEPROM_THERMAL_MODEL_VER, THERMAL_MODEL_DEF(VER)); 129c2: 61 e0 ldi r22, 0x01 ; 1 129c4: 87 e9 ldi r24, 0x97 ; 151 129c6: 9c e0 ldi r25, 0x0C ; 12 129c8: 0e 94 21 76 call 0xec42 ; 0xec42 thermal_model::enabled = eeprom_read_byte((uint8_t*)EEPROM_THERMAL_MODEL_ENABLE); 129cc: 82 e0 ldi r24, 0x02 ; 2 129ce: 9d e0 ldi r25, 0x0D ; 13 129d0: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 129d4: 91 e0 ldi r25, 0x01 ; 1 129d6: 81 11 cpse r24, r1 129d8: 01 c0 rjmp .+2 ; 0x129dc 129da: 90 e0 ldi r25, 0x00 ; 0 129dc: 90 93 1c 05 sts 0x051C, r25 ; 0x80051c <_ZN13thermal_modelL7enabledE.lto_priv.456> thermal_model::data.P = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_P); 129e0: 8e ef ldi r24, 0xFE ; 254 129e2: 9c e0 ldi r25, 0x0C ; 12 129e4: 0f 94 df db call 0x3b7be ; 0x3b7be 129e8: 60 93 d9 12 sts 0x12D9, r22 ; 0x8012d9 <_ZN13thermal_modelL4dataE.lto_priv.400+0x2a> 129ec: 70 93 da 12 sts 0x12DA, r23 ; 0x8012da <_ZN13thermal_modelL4dataE.lto_priv.400+0x2b> 129f0: 80 93 db 12 sts 0x12DB, r24 ; 0x8012db <_ZN13thermal_modelL4dataE.lto_priv.400+0x2c> 129f4: 90 93 dc 12 sts 0x12DC, r25 ; 0x8012dc <_ZN13thermal_modelL4dataE.lto_priv.400+0x2d> thermal_model::data.U = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_U); 129f8: 82 ea ldi r24, 0xA2 ; 162 129fa: 9c e0 ldi r25, 0x0C ; 12 129fc: 0f 94 df db call 0x3b7be ; 0x3b7be 12a00: 60 93 dd 12 sts 0x12DD, r22 ; 0x8012dd <_ZN13thermal_modelL4dataE.lto_priv.400+0x2e> 12a04: 70 93 de 12 sts 0x12DE, r23 ; 0x8012de <_ZN13thermal_modelL4dataE.lto_priv.400+0x2f> 12a08: 80 93 df 12 sts 0x12DF, r24 ; 0x8012df <_ZN13thermal_modelL4dataE.lto_priv.400+0x30> 12a0c: 90 93 e0 12 sts 0x12E0, r25 ; 0x8012e0 <_ZN13thermal_modelL4dataE.lto_priv.400+0x31> thermal_model::data.V = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_V); 12a10: 8e e9 ldi r24, 0x9E ; 158 12a12: 9c e0 ldi r25, 0x0C ; 12 12a14: 0f 94 df db call 0x3b7be ; 0x3b7be 12a18: 60 93 e1 12 sts 0x12E1, r22 ; 0x8012e1 <_ZN13thermal_modelL4dataE.lto_priv.400+0x32> 12a1c: 70 93 e2 12 sts 0x12E2, r23 ; 0x8012e2 <_ZN13thermal_modelL4dataE.lto_priv.400+0x33> 12a20: 80 93 e3 12 sts 0x12E3, r24 ; 0x8012e3 <_ZN13thermal_modelL4dataE.lto_priv.400+0x34> 12a24: 90 93 e4 12 sts 0x12E4, r25 ; 0x8012e4 <_ZN13thermal_modelL4dataE.lto_priv.400+0x35> thermal_model::data.C = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_C); 12a28: 8a ef ldi r24, 0xFA ; 250 12a2a: 9c e0 ldi r25, 0x0C ; 12 12a2c: 0f 94 df db call 0x3b7be ; 0x3b7be 12a30: 60 93 e5 12 sts 0x12E5, r22 ; 0x8012e5 <_ZN13thermal_modelL4dataE.lto_priv.400+0x36> 12a34: 70 93 e6 12 sts 0x12E6, r23 ; 0x8012e6 <_ZN13thermal_modelL4dataE.lto_priv.400+0x37> 12a38: 80 93 e7 12 sts 0x12E7, r24 ; 0x8012e7 <_ZN13thermal_modelL4dataE.lto_priv.400+0x38> 12a3c: 90 93 e8 12 sts 0x12E8, r25 ; 0x8012e8 <_ZN13thermal_modelL4dataE.lto_priv.400+0x39> thermal_model::data.fS = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_D); 12a40: 8a e9 ldi r24, 0x9A ; 154 12a42: 9c e0 ldi r25, 0x0C ; 12 12a44: 0f 94 df db call 0x3b7be ; 0x3b7be 12a48: 60 93 e9 12 sts 0x12E9, r22 ; 0x8012e9 <_ZN13thermal_modelL4dataE.lto_priv.400+0x3a> 12a4c: 70 93 ea 12 sts 0x12EA, r23 ; 0x8012ea <_ZN13thermal_modelL4dataE.lto_priv.400+0x3b> 12a50: 80 93 eb 12 sts 0x12EB, r24 ; 0x8012eb <_ZN13thermal_modelL4dataE.lto_priv.400+0x3c> 12a54: 90 93 ec 12 sts 0x12EC, r25 ; 0x8012ec <_ZN13thermal_modelL4dataE.lto_priv.400+0x3d> thermal_model_set_lag(eeprom_read_word((uint16_t*)EEPROM_THERMAL_MODEL_L)); 12a58: 88 e9 ldi r24, 0x98 ; 152 12a5a: 9c e0 ldi r25, 0x0C ; 12 12a5c: 0f 94 e5 db call 0x3b7ca ; 0x3b7ca 12a60: 0f 94 58 2e call 0x25cb0 ; 0x25cb0 eeprom_read_block(&thermal_model::data.R[0], (float*)EEPROM_THERMAL_MODEL_R, THERMAL_MODEL_R_SIZE * sizeof(float)); 12a64: 40 e4 ldi r20, 0x40 ; 64 12a66: 50 e0 ldi r21, 0x00 ; 0 12a68: 6a eb ldi r22, 0xBA ; 186 12a6a: 7c e0 ldi r23, 0x0C ; 12 12a6c: 8f ee ldi r24, 0xEF ; 239 12a6e: 92 e1 ldi r25, 0x12 ; 18 12a70: 0f 94 c7 db call 0x3b78e ; 0x3b78e thermal_model::data.Ta_corr = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_Ta_corr); 12a74: 86 eb ldi r24, 0xB6 ; 182 12a76: 9c e0 ldi r25, 0x0C ; 12 12a78: 0f 94 df db call 0x3b7be ; 0x3b7be 12a7c: 60 93 2f 13 sts 0x132F, r22 ; 0x80132f <_ZN13thermal_modelL4dataE.lto_priv.400+0x80> 12a80: 70 93 30 13 sts 0x1330, r23 ; 0x801330 <_ZN13thermal_modelL4dataE.lto_priv.400+0x81> 12a84: 80 93 31 13 sts 0x1331, r24 ; 0x801331 <_ZN13thermal_modelL4dataE.lto_priv.400+0x82> 12a88: 90 93 32 13 sts 0x1332, r25 ; 0x801332 <_ZN13thermal_modelL4dataE.lto_priv.400+0x83> thermal_model::data.warn = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_W); 12a8c: 82 eb ldi r24, 0xB2 ; 178 12a8e: 9c e0 ldi r25, 0x0C ; 12 12a90: 0f 94 df db call 0x3b7be ; 0x3b7be 12a94: 60 93 33 13 sts 0x1333, r22 ; 0x801333 <_ZN13thermal_modelL4dataE.lto_priv.400+0x84> 12a98: 70 93 34 13 sts 0x1334, r23 ; 0x801334 <_ZN13thermal_modelL4dataE.lto_priv.400+0x85> 12a9c: 80 93 35 13 sts 0x1335, r24 ; 0x801335 <_ZN13thermal_modelL4dataE.lto_priv.400+0x86> 12aa0: 90 93 36 13 sts 0x1336, r25 ; 0x801336 <_ZN13thermal_modelL4dataE.lto_priv.400+0x87> thermal_model::data.err = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_E); 12aa4: 8e ea ldi r24, 0xAE ; 174 12aa6: 9c e0 ldi r25, 0x0C ; 12 12aa8: 0f 94 df db call 0x3b7be ; 0x3b7be 12aac: 60 93 37 13 sts 0x1337, r22 ; 0x801337 <_ZN13thermal_modelL4dataE.lto_priv.400+0x88> 12ab0: 70 93 38 13 sts 0x1338, r23 ; 0x801338 <_ZN13thermal_modelL4dataE.lto_priv.400+0x89> 12ab4: 80 93 39 13 sts 0x1339, r24 ; 0x801339 <_ZN13thermal_modelL4dataE.lto_priv.400+0x8a> 12ab8: 90 93 3a 13 sts 0x133A, r25 ; 0x80133a <_ZN13thermal_modelL4dataE.lto_priv.400+0x8b> if(!thermal_model::calibrated()) { 12abc: 0f 94 77 2e call 0x25cee ; 0x25cee 12ac0: 81 11 cpse r24, r1 12ac2: 06 c0 rjmp .+12 ; 0x12ad0 SERIAL_ECHOLNPGM("TM: stored calibration invalid, resetting"); 12ac4: 8d ef ldi r24, 0xFD ; 253 12ac6: 97 e7 ldi r25, 0x77 ; 119 12ac8: 0e 94 93 79 call 0xf326 ; 0xf326 thermal_model_reset_settings(); 12acc: 0f 94 7e 31 call 0x262fc ; 0x262fc } thermal_model::setup(); 12ad0: 0f 94 df 2e call 0x25dbe ; 0x25dbe } void thermal_model_load_settings() { static_assert(THERMAL_MODEL_R_SIZE == 16); // ensure we don't desync with the eeprom table TempMgrGuard temp_mgr_guard; 12ad4: ce 01 movw r24, r28 12ad6: 01 96 adiw r24, 0x01 ; 1 12ad8: 0f 94 63 31 call 0x262c6 ; 0x262c6 #ifdef THERMAL_MODEL thermal_model_load_settings(); #endif SERIAL_ECHO_START; 12adc: 82 ef ldi r24, 0xF2 ; 242 12ade: 9b ea ldi r25, 0xAB ; 171 12ae0: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHOLNPGM("Stored settings retrieved"); 12ae4: 87 e2 ldi r24, 0x27 ; 39 12ae6: 98 e7 ldi r25, 0x78 ; 120 12ae8: 0e 94 93 79 call 0xf326 ; 0xf326 12aec: 81 e0 ldi r24, 0x01 ; 1 if (eeprom_is_initialized_block(EEPROM_M500_base->version, sizeof(EEPROM_M500_base->version))) { return false; } } return true; } 12aee: 0f 90 pop r0 12af0: df 91 pop r29 12af2: cf 91 pop r28 12af4: 1f 91 pop r17 12af6: 0f 91 pop r16 12af8: ff 90 pop r15 12afa: ef 90 pop r14 12afc: bf 90 pop r11 12afe: af 90 pop r10 12b00: 9f 90 pop r9 12b02: 8f 90 pop r8 12b04: 7f 90 pop r7 12b06: 6f 90 pop r6 12b08: 5f 90 pop r5 12b0a: 4f 90 pop r4 12b0c: 08 95 ret SERIAL_ECHO_START; SERIAL_ECHOLNPGM("Stored settings retrieved"); } else { Config_ResetDefault(); 12b0e: 0e 94 a4 82 call 0x10548 ; 0x10548 //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))) { 12b12: 64 e0 ldi r22, 0x04 ; 4 12b14: 70 e0 ldi r23, 0x00 ; 0 12b16: 84 e1 ldi r24, 0x14 ; 20 12b18: 90 e0 ldi r25, 0x00 ; 0 12b1a: 0e 94 d3 5b call 0xb7a6 ; 0xb7a6 12b1e: 91 e0 ldi r25, 0x01 ; 1 12b20: 89 27 eor r24, r25 12b22: e5 cf rjmp .-54 ; 0x12aee 00012b24 : 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() 12b24: 2f 92 push r2 12b26: 3f 92 push r3 12b28: 4f 92 push r4 12b2a: 5f 92 push r5 12b2c: 6f 92 push r6 12b2e: 7f 92 push r7 12b30: 8f 92 push r8 12b32: 9f 92 push r9 12b34: af 92 push r10 12b36: bf 92 push r11 12b38: cf 92 push r12 12b3a: df 92 push r13 12b3c: ef 92 push r14 12b3e: ff 92 push r15 12b40: 0f 93 push r16 12b42: 1f 93 push r17 12b44: cf 93 push r28 12b46: df 93 push r29 12b48: cd b7 in r28, 0x3d ; 61 12b4a: de b7 in r29, 0x3e ; 62 12b4c: cf 58 subi r28, 0x8F ; 143 12b4e: d1 09 sbc r29, r1 12b50: 0f b6 in r0, 0x3f ; 63 12b52: f8 94 cli 12b54: de bf out 0x3e, r29 ; 62 12b56: 0f be out 0x3f, r0 ; 63 12b58: cd bf out 0x3d, r28 ; 61 #endif /* CMDBUFFER_DEBUG */ unsigned long codenum; //throw away variable // PRUSA GCODES KEEPALIVE_STATE(IN_HANDLER); 12b5a: 82 e0 ldi r24, 0x02 ; 2 12b5c: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be - TMC_SET_STEP - TMC_SET_CHOP */ if (false) {} // allow chaining of optional next else if blocks #ifdef TMC2130 else if (strncmp_P(CMDBUFFER_CURRENT_STRING, PSTR("CRASH_"), 6) == 0) 12b60: a0 90 91 12 lds r10, 0x1291 ; 0x801291 12b64: b0 90 92 12 lds r11, 0x1292 ; 0x801292 12b68: 85 01 movw r16, r10 12b6a: 09 55 subi r16, 0x59 ; 89 12b6c: 1f 4e sbci r17, 0xEF ; 239 12b6e: 46 e0 ldi r20, 0x06 ; 6 12b70: 50 e0 ldi r21, 0x00 ; 0 12b72: 6c ed ldi r22, 0xDC ; 220 12b74: 78 e8 ldi r23, 0x88 ; 136 12b76: c8 01 movw r24, r16 12b78: 0f 94 b6 d9 call 0x3b36c ; 0x3b36c 12b7c: 89 2b or r24, r25 12b7e: 09 f0 breq .+2 ; 0x12b82 12b80: b8 c0 rjmp .+368 ; 0x12cf2 { // ### CRASH_DETECTED - TMC2130 // --------------------------------- if(code_seen_P(PSTR("CRASH_DETECTED"))) 12b82: 8d ec ldi r24, 0xCD ; 205 12b84: 98 e8 ldi r25, 0x88 ; 136 12b86: 0e 94 3e 68 call 0xd07c ; 0xd07c 12b8a: 88 23 and r24, r24 12b8c: 09 f4 brne .+2 ; 0x12b90 12b8e: 91 c0 rjmp .+290 ; 0x12cb2 { uint8_t mask = 0; if (code_seen('X')) mask |= X_AXIS_MASK; 12b90: 88 e5 ldi r24, 0x58 ; 88 12b92: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 12b96: 18 2f mov r17, r24 if (code_seen('Y')) mask |= Y_AXIS_MASK; 12b98: 89 e5 ldi r24, 0x59 ; 89 12b9a: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 12b9e: 81 11 cpse r24, r1 12ba0: 12 60 ori r17, 0x02 ; 2 strcpy_P(buf, _T(MSG_CRASH_DETECTED)); } void crashdet_detected(uint8_t mask) { st_synchronize(); 12ba2: 0f 94 a3 42 call 0x28546 ; 0x28546 static uint8_t crashDet_counter = 0; static uint8_t crashDet_axes = 0; bool automatic_recovery_after_crash = true; char msg[LCD_WIDTH+1] = ""; 12ba6: 1a 82 std Y+2, r1 ; 0x02 12ba8: 19 82 std Y+1, r1 ; 0x01 12baa: fe 01 movw r30, r28 12bac: 33 96 adiw r30, 0x03 ; 3 12bae: 83 e1 ldi r24, 0x13 ; 19 12bb0: df 01 movw r26, r30 12bb2: 1d 92 st X+, r1 12bb4: 8a 95 dec r24 12bb6: e9 f7 brne .-6 ; 0x12bb2 if (crashDetTimer.expired(CRASHDET_TIMER * 1000ul)) { 12bb8: 48 ec ldi r20, 0xC8 ; 200 12bba: 5f ea ldi r21, 0xAF ; 175 12bbc: 60 e0 ldi r22, 0x00 ; 0 12bbe: 70 e0 ldi r23, 0x00 ; 0 12bc0: 83 e7 ldi r24, 0x73 ; 115 12bc2: 93 e0 ldi r25, 0x03 ; 3 12bc4: 0f 94 06 2a call 0x2540c ; 0x2540c ::expired(unsigned long)> 12bc8: 81 11 cpse r24, r1 crashDet_counter = 0; 12bca: 10 92 72 03 sts 0x0372, r1 ; 0x800372 } if(++crashDet_counter >= CRASHDET_COUNTER_MAX) { 12bce: 00 91 72 03 lds r16, 0x0372 ; 0x800372 12bd2: 0f 5f subi r16, 0xFF ; 255 12bd4: 00 93 72 03 sts 0x0372, r16 ; 0x800372 automatic_recovery_after_crash = false; } crashDetTimer.start(); 12bd8: 83 e7 ldi r24, 0x73 ; 115 12bda: 93 e0 ldi r25, 0x03 ; 3 12bdc: 0f 94 c5 2b call 0x2578a ; 0x2578a ::start()> crashDet_axes |= mask; 12be0: 80 91 71 03 lds r24, 0x0371 ; 0x800371 12be4: 81 2b or r24, r17 12be6: 80 93 71 03 sts 0x0371, r24 ; 0x800371 if (mask & X_AXIS_MASK) { 12bea: 10 ff sbrs r17, 0 12bec: 08 c0 rjmp .+16 ; 0x12bfe eeprom_increment_byte((uint8_t*)EEPROM_CRASH_COUNT_X); 12bee: 86 e6 ldi r24, 0x66 ; 102 12bf0: 9f e0 ldi r25, 0x0F ; 15 12bf2: 0e 94 40 76 call 0xec80 ; 0xec80 eeprom_increment_word((uint16_t*)EEPROM_CRASH_COUNT_X_TOT); 12bf6: 85 e0 ldi r24, 0x05 ; 5 12bf8: 9f e0 ldi r25, 0x0F ; 15 12bfa: 0e 94 33 76 call 0xec66 ; 0xec66 } if (mask & Y_AXIS_MASK) { 12bfe: 11 ff sbrs r17, 1 12c00: 08 c0 rjmp .+16 ; 0x12c12 eeprom_increment_byte((uint8_t*)EEPROM_CRASH_COUNT_Y); 12c02: 88 e6 ldi r24, 0x68 ; 104 12c04: 9f e0 ldi r25, 0x0F ; 15 12c06: 0e 94 40 76 call 0xec80 ; 0xec80 eeprom_increment_word((uint16_t*)EEPROM_CRASH_COUNT_Y_TOT); 12c0a: 83 e0 ldi r24, 0x03 ; 3 12c0c: 9f e0 ldi r25, 0x0F ; 15 12c0e: 0e 94 33 76 call 0xec66 ; 0xec66 } lcd_update_enable(true); 12c12: 81 e0 ldi r24, 0x01 ; 1 12c14: 0e 94 3d 6f call 0xde7a ; 0xde7a lcd_update(2); 12c18: 82 e0 ldi r24, 0x02 ; 2 12c1a: 0e 94 bf 6e call 0xdd7e ; 0xdd7e // prepare the status message with the _current_ axes status crashdet_fmt_error(msg, mask); 12c1e: 61 2f mov r22, r17 12c20: ce 01 movw r24, r28 12c22: 01 96 adiw r24, 0x01 ; 1 12c24: 0e 94 21 74 call 0xe842 ; 0xe842 lcd_setstatus(msg); 12c28: ce 01 movw r24, r28 12c2a: 01 96 adiw r24, 0x01 ; 1 12c2c: 0e 94 64 f4 call 0x1e8c8 ; 0x1e8c8 gcode_G28(true, true, false); //home X and Y 12c30: 40 e0 ldi r20, 0x00 ; 0 12c32: 61 e0 ldi r22, 0x01 ; 1 12c34: 81 e0 ldi r24, 0x01 ; 1 12c36: 0e 94 1d 7f call 0xfe3a ; 0xfe3a if (automatic_recovery_after_crash) { enquecommand_P(PSTR("CRASH_RECOVER")); 12c3a: 61 e0 ldi r22, 0x01 ; 1 12c3c: 83 e6 ldi r24, 0x63 ; 99 12c3e: 95 e8 ldi r25, 0x85 ; 133 crashdet_fmt_error(msg, mask); lcd_setstatus(msg); gcode_G28(true, true, false); //home X and Y if (automatic_recovery_after_crash) { 12c40: 03 30 cpi r16, 0x03 ; 3 12c42: 60 f1 brcs .+88 ; 0x12c9c 12c44: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 12c48: 10 92 b5 0d sts 0x0DB5, r1 ; 0x800db5 enquecommand_P(PSTR("CRASH_RECOVER")); }else{ setTargetHotend(0); // notify the user of *all* the axes previously affected, not just the last one lcd_update_enable(false); 12c4c: 80 e0 ldi r24, 0x00 ; 0 12c4e: 0e 94 3d 6f call 0xde7a ; 0xde7a lcd_clear(); 12c52: 0e 94 2b 6f call 0xde56 ; 0xde56 crashdet_fmt_error(msg, crashDet_axes); 12c56: 60 91 71 03 lds r22, 0x0371 ; 0x800371 12c5a: ce 01 movw r24, r28 12c5c: 01 96 adiw r24, 0x01 ; 1 12c5e: 0e 94 21 74 call 0xe842 ; 0xe842 crashDet_axes = 0; 12c62: 10 92 71 03 sts 0x0371, r1 ; 0x800371 lcd_print(msg); 12c66: ce 01 movw r24, r28 12c68: 01 96 adiw r24, 0x01 ; 1 12c6a: 0e 94 ff 70 call 0xe1fe ; 0xe1fe // ask whether to resume printing lcd_puts_at_P(0, 1, _T(MSG_RESUME_PRINT)); 12c6e: 80 e0 ldi r24, 0x00 ; 0 12c70: 97 e4 ldi r25, 0x47 ; 71 12c72: 0e 94 c4 72 call 0xe588 ; 0xe588 12c76: ac 01 movw r20, r24 12c78: 61 e0 ldi r22, 0x01 ; 1 12c7a: 80 e0 ldi r24, 0x00 ; 0 12c7c: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_putc('?'); 12c80: 8f e3 ldi r24, 0x3F ; 63 12c82: 0e 94 e7 6e call 0xddce ; 0xddce //! @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_yes_no_and_wait(bool allow_timeouting, uint8_t default_selection) { return lcd_show_multiscreen_message_yes_no_and_wait_P(NULL, allow_timeouting, default_selection); 12c86: 40 e0 ldi r20, 0x00 ; 0 12c88: 60 e0 ldi r22, 0x00 ; 0 12c8a: 90 e0 ldi r25, 0x00 ; 0 12c8c: 80 e0 ldi r24, 0x00 ; 0 12c8e: 0f 94 fb 4e call 0x29df6 ; 0x29df6 uint8_t yesno = lcd_show_yes_no_and_wait(false, LCD_LEFT_BUTTON_CHOICE); if (yesno == LCD_LEFT_BUTTON_CHOICE) { enquecommand_P(PSTR("CRASH_RECOVER")); 12c92: 61 e0 ldi r22, 0x01 ; 1 // ask whether to resume printing lcd_puts_at_P(0, 1, _T(MSG_RESUME_PRINT)); lcd_putc('?'); uint8_t yesno = lcd_show_yes_no_and_wait(false, LCD_LEFT_BUTTON_CHOICE); if (yesno == LCD_LEFT_BUTTON_CHOICE) 12c94: 81 11 cpse r24, r1 12c96: 0a c0 rjmp .+20 ; 0x12cac { enquecommand_P(PSTR("CRASH_RECOVER")); 12c98: 85 e5 ldi r24, 0x55 ; 85 12c9a: 95 e8 ldi r25, 0x85 ; 133 } else // LCD_MIDDLE_BUTTON_CHOICE { enquecommand_P(PSTR("CRASH_CANCEL")); 12c9c: 0e 94 38 88 call 0x11070 ; 0x11070 SERIAL_ECHO_START; SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); SERIAL_ECHOLNPGM("\"(2)"); } KEEPALIVE_STATE(NOT_BUSY); 12ca0: 81 e0 ldi r24, 0x01 ; 1 12ca2: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be ClearToSend(); 12ca6: 0e 94 42 7f call 0xfe84 ; 0xfe84 12caa: 5e c3 rjmp .+1724 ; 0x13368 { enquecommand_P(PSTR("CRASH_RECOVER")); } else // LCD_MIDDLE_BUTTON_CHOICE { enquecommand_P(PSTR("CRASH_CANCEL")); 12cac: 88 e4 ldi r24, 0x48 ; 72 12cae: 95 e8 ldi r25, 0x85 ; 133 12cb0: f5 cf rjmp .-22 ; 0x12c9c crashdet_detected(mask); } // ### CRASH_RECOVER - TMC2130 // ---------------------------------- else if(code_seen_P(PSTR("CRASH_RECOVER"))) 12cb2: 8f eb ldi r24, 0xBF ; 191 12cb4: 98 e8 ldi r25, 0x88 ; 136 12cb6: 0e 94 3e 68 call 0xd07c ; 0xd07c 12cba: 88 23 and r24, r24 12cbc: 69 f0 breq .+26 ; 0x12cd8 } } void crashdet_recover() { if (!printingIsPaused()) crashdet_restore_print_and_continue(); 12cbe: 0e 94 9d 67 call 0xcf3a ; 0xcf3a 12cc2: 81 11 cpse r24, r1 12cc4: 06 c0 rjmp .+12 ; 0x12cd2 stop_and_save_print_to_ram(pause_position[Z_AXIS], -default_retraction); //XY - no change, Pause Z LIFT mm up, E -1mm retract } void crashdet_restore_print_and_continue() { restore_print_from_ram_and_continue(default_retraction); //XYZ = orig, E +1mm unretract 12cc6: 60 e0 ldi r22, 0x00 ; 0 12cc8: 70 e0 ldi r23, 0x00 ; 0 12cca: 80 e8 ldi r24, 0x80 ; 128 12ccc: 9f e3 ldi r25, 0x3F ; 63 12cce: 0e 94 5c 68 call 0xd0b8 ; 0xd0b8 } void crashdet_recover() { if (!printingIsPaused()) crashdet_restore_print_and_continue(); crashdet_use_eeprom_setting(); 12cd2: 0f 94 2b 26 call 0x24c56 ; 0x24c56 12cd6: e4 cf rjmp .-56 ; 0x12ca0 else if(code_seen_P(PSTR("CRASH_RECOVER"))) crashdet_recover(); // ### CRASH_CANCEL - TMC2130 // ---------------------------------- else if(code_seen_P(PSTR("CRASH_CANCEL"))) 12cd8: 82 eb ldi r24, 0xB2 ; 178 12cda: 98 e8 ldi r25, 0x88 ; 136 12cdc: 0e 94 3e 68 call 0xd07c ; 0xd07c 12ce0: 88 23 and r24, r24 12ce2: f1 f2 breq .-68 ; 0x12ca0 } /// Crash detection cancels the print void crashdet_cancel() { // Restore crash detection crashdet_use_eeprom_setting(); 12ce4: 0f 94 2b 26 call 0x24c56 ; 0x24c56 // Abort the print print_stop(); 12ce8: 60 e0 ldi r22, 0x00 ; 0 12cea: 80 e0 ldi r24, 0x00 ; 0 12cec: 0e 94 75 f4 call 0x1e8ea ; 0x1e8ea 12cf0: d7 cf rjmp .-82 ; 0x12ca0 // ### CRASH_CANCEL - TMC2130 // ---------------------------------- else if(code_seen_P(PSTR("CRASH_CANCEL"))) crashdet_cancel(); } else if (strncmp_P(CMDBUFFER_CURRENT_STRING, PSTR("TMC_"), 4) == 0) 12cf2: 44 e0 ldi r20, 0x04 ; 4 12cf4: 50 e0 ldi r21, 0x00 ; 0 12cf6: 6d ea ldi r22, 0xAD ; 173 12cf8: 78 e8 ldi r23, 0x88 ; 136 12cfa: c8 01 movw r24, r16 12cfc: 0f 94 b6 d9 call 0x3b36c ; 0x3b36c 12d00: 89 2b or r24, r25 12d02: 09 f0 breq .+2 ; 0x12d06 12d04: fc c0 rjmp .+504 ; 0x12efe { // ### TMC_SET_WAVE_ // -------------------- if (strncmp_P(CMDBUFFER_CURRENT_STRING + 4, PSTR("SET_WAVE_"), 9) == 0) 12d06: 85 01 movw r16, r10 12d08: 05 55 subi r16, 0x55 ; 85 12d0a: 1f 4e sbci r17, 0xEF ; 239 12d0c: 49 e0 ldi r20, 0x09 ; 9 12d0e: 50 e0 ldi r21, 0x00 ; 0 12d10: 63 ea ldi r22, 0xA3 ; 163 12d12: 78 e8 ldi r23, 0x88 ; 136 12d14: c8 01 movw r24, r16 12d16: 0f 94 b6 d9 call 0x3b36c ; 0x3b36c 12d1a: 89 2b or r24, r25 12d1c: c9 f4 brne .+50 ; 0x12d50 { uint8_t axis = *(CMDBUFFER_CURRENT_STRING + 13); 12d1e: f5 01 movw r30, r10 12d20: ec 54 subi r30, 0x4C ; 76 12d22: ff 4e sbci r31, 0xEF ; 239 12d24: 10 81 ld r17, Z axis = (axis == 'E')?3:(axis - 'X'); 12d26: 15 34 cpi r17, 0x45 ; 69 12d28: 89 f0 breq .+34 ; 0x12d4c 12d2a: 18 55 subi r17, 0x58 ; 88 if (axis < 4) 12d2c: 14 30 cpi r17, 0x04 ; 4 12d2e: 08 f0 brcs .+2 ; 0x12d32 12d30: b7 cf rjmp .-146 ; 0x12ca0 { uint8_t fac = (uint8_t)strtol(CMDBUFFER_CURRENT_STRING + 14, NULL, 10); 12d32: 4a e0 ldi r20, 0x0A ; 10 12d34: 50 e0 ldi r21, 0x00 ; 0 12d36: 70 e0 ldi r23, 0x00 ; 0 12d38: 60 e0 ldi r22, 0x00 ; 0 12d3a: c5 01 movw r24, r10 12d3c: 8b 54 subi r24, 0x4B ; 75 12d3e: 9f 4e sbci r25, 0xEF ; 239 12d40: 0f 94 62 d7 call 0x3aec4 ; 0x3aec4 tmc2130_set_wave(axis, 247, fac); 12d44: 81 2f mov r24, r17 12d46: 0f 94 47 88 call 0x3108e ; 0x3108e 12d4a: aa cf rjmp .-172 ; 0x12ca0 // ### TMC_SET_WAVE_ // -------------------- if (strncmp_P(CMDBUFFER_CURRENT_STRING + 4, PSTR("SET_WAVE_"), 9) == 0) { uint8_t axis = *(CMDBUFFER_CURRENT_STRING + 13); axis = (axis == 'E')?3:(axis - 'X'); 12d4c: 13 e0 ldi r17, 0x03 ; 3 12d4e: f1 cf rjmp .-30 ; 0x12d32 } } // ### TMC_SET_STEP_ // ------------------ else if (strncmp_P(CMDBUFFER_CURRENT_STRING + 4, PSTR("SET_STEP_"), 9) == 0) 12d50: 49 e0 ldi r20, 0x09 ; 9 12d52: 50 e0 ldi r21, 0x00 ; 0 12d54: 69 e9 ldi r22, 0x99 ; 153 12d56: 78 e8 ldi r23, 0x88 ; 136 12d58: c8 01 movw r24, r16 12d5a: 0f 94 b6 d9 call 0x3b36c ; 0x3b36c 12d5e: 89 2b or r24, r25 12d60: 51 f5 brne .+84 ; 0x12db6 { uint8_t axis = *(CMDBUFFER_CURRENT_STRING + 13); 12d62: f5 01 movw r30, r10 12d64: ec 54 subi r30, 0x4C ; 76 12d66: ff 4e sbci r31, 0xEF ; 239 12d68: 10 81 ld r17, Z axis = (axis == 'E')?3:(axis - 'X'); 12d6a: 15 34 cpi r17, 0x45 ; 69 12d6c: 11 f1 breq .+68 ; 0x12db2 12d6e: 18 55 subi r17, 0x58 ; 88 if (axis < 4) 12d70: 14 30 cpi r17, 0x04 ; 4 12d72: 08 f0 brcs .+2 ; 0x12d76 12d74: 95 cf rjmp .-214 ; 0x12ca0 { uint8_t step = (uint8_t)strtol(CMDBUFFER_CURRENT_STRING + 14, NULL, 10); 12d76: 4a e0 ldi r20, 0x0A ; 10 12d78: 50 e0 ldi r21, 0x00 ; 0 12d7a: 70 e0 ldi r23, 0x00 ; 0 12d7c: 60 e0 ldi r22, 0x00 ; 0 12d7e: c5 01 movw r24, r10 12d80: 8b 54 subi r24, 0x4B ; 75 12d82: 9f 4e sbci r25, 0xEF ; 239 12d84: 0f 94 62 d7 call 0x3aec4 ; 0x3aec4 12d88: e1 2f mov r30, r17 12d8a: f0 e0 ldi r31, 0x00 ; 0 12d8c: ec 50 subi r30, 0x0C ; 12 12d8e: fb 4f sbci r31, 0xFB ; 251 12d90: 80 81 ld r24, Z 12d92: 40 e0 ldi r20, 0x00 ; 0 12d94: 51 e0 ldi r21, 0x01 ; 1 12d96: 02 c0 rjmp .+4 ; 0x12d9c 12d98: 56 95 lsr r21 12d9a: 47 95 ror r20 12d9c: 8a 95 dec r24 12d9e: e2 f7 brpl .-8 ; 0x12d98 uint16_t res = tmc2130_get_res(axis); tmc2130_goto_step(axis, step & (4*res - 1), 2, 1000, res); 12da0: 84 2f mov r24, r20 12da2: 88 0f add r24, r24 12da4: 88 0f add r24, r24 12da6: 81 50 subi r24, 0x01 ; 1 12da8: 68 23 and r22, r24 12daa: 81 2f mov r24, r17 12dac: 0f 94 5e 8b call 0x316bc ; 0x316bc 12db0: 77 cf rjmp .-274 ; 0x12ca0 // ### TMC_SET_STEP_ // ------------------ else if (strncmp_P(CMDBUFFER_CURRENT_STRING + 4, PSTR("SET_STEP_"), 9) == 0) { uint8_t axis = *(CMDBUFFER_CURRENT_STRING + 13); axis = (axis == 'E')?3:(axis - 'X'); 12db2: 13 e0 ldi r17, 0x03 ; 3 12db4: e0 cf rjmp .-64 ; 0x12d76 } } // ### TMC_SET_CHOP_ // ------------------- else if (strncmp_P(CMDBUFFER_CURRENT_STRING + 4, PSTR("SET_CHOP_"), 9) == 0) 12db6: 49 e0 ldi r20, 0x09 ; 9 12db8: 50 e0 ldi r21, 0x00 ; 0 12dba: 6f e8 ldi r22, 0x8F ; 143 12dbc: 78 e8 ldi r23, 0x88 ; 136 12dbe: c8 01 movw r24, r16 12dc0: 0f 94 b6 d9 call 0x3b36c ; 0x3b36c 12dc4: 89 2b or r24, r25 12dc6: 09 f0 breq .+2 ; 0x12dca 12dc8: 6b cf rjmp .-298 ; 0x12ca0 { uint8_t axis = *(CMDBUFFER_CURRENT_STRING + 13); 12dca: f5 01 movw r30, r10 12dcc: ec 54 subi r30, 0x4C ; 76 12dce: ff 4e sbci r31, 0xEF ; 239 12dd0: 80 81 ld r24, Z axis = (axis == 'E')?3:(axis - 'X'); 12dd2: 85 34 cpi r24, 0x45 ; 69 12dd4: 09 f4 brne .+2 ; 0x12dd8 12dd6: 90 c0 rjmp .+288 ; 0x12ef8 12dd8: 98 ea ldi r25, 0xA8 ; 168 12dda: c9 2e mov r12, r25 12ddc: c8 0e add r12, r24 if (axis < 4) 12dde: b3 e0 ldi r27, 0x03 ; 3 12de0: bc 15 cp r27, r12 12de2: 08 f4 brcc .+2 ; 0x12de6 12de4: 5d cf rjmp .-326 ; 0x12ca0 { uint8_t chop0 = tmc2130_chopper_config[axis].toff; 12de6: ec 2c mov r14, r12 12de8: f1 2c mov r15, r1 12dea: 47 01 movw r8, r14 12dec: 88 0c add r8, r8 12dee: 99 1c adc r9, r9 12df0: f4 01 movw r30, r8 12df2: eb 55 subi r30, 0x5B ; 91 12df4: fd 4f sbci r31, 0xFD ; 253 12df6: 00 81 ld r16, Z 12df8: 20 2f mov r18, r16 12dfa: 2f 70 andi r18, 0x0F ; 15 uint8_t chop1 = tmc2130_chopper_config[axis].hstr; 12dfc: 10 2f mov r17, r16 12dfe: 12 95 swap r17 12e00: 17 70 andi r17, 0x07 ; 7 uint8_t chop2 = tmc2130_chopper_config[axis].hend; 12e02: 00 1f adc r16, r16 12e04: 00 27 eor r16, r16 12e06: 00 1f adc r16, r16 12e08: 61 81 ldd r22, Z+1 ; 0x01 12e0a: 67 70 andi r22, 0x07 ; 7 12e0c: 66 0f add r22, r22 12e0e: 06 2b or r16, r22 uint8_t chop3 = tmc2130_chopper_config[axis].tbl; 12e10: f4 01 movw r30, r8 12e12: ea 55 subi r30, 0x5A ; 90 12e14: fd 4f sbci r31, 0xFD ; 253 12e16: d0 80 ld r13, Z 12e18: d6 94 lsr r13 12e1a: d6 94 lsr r13 12e1c: d6 94 lsr r13 12e1e: ed 2d mov r30, r13 12e20: e3 70 andi r30, 0x03 ; 3 12e22: de 2e mov r13, r30 char* str_end = 0; 12e24: 1a 82 std Y+2, r1 ; 0x02 12e26: 19 82 std Y+1, r1 ; 0x01 if (CMDBUFFER_CURRENT_STRING[14]) 12e28: c5 01 movw r24, r10 12e2a: 8b 54 subi r24, 0x4B ; 75 12e2c: 9f 4e sbci r25, 0xEF ; 239 12e2e: dc 01 movw r26, r24 12e30: 3c 91 ld r19, X { uint8_t axis = *(CMDBUFFER_CURRENT_STRING + 13); axis = (axis == 'E')?3:(axis - 'X'); if (axis < 4) { uint8_t chop0 = tmc2130_chopper_config[axis].toff; 12e32: b2 2e mov r11, r18 uint8_t chop1 = tmc2130_chopper_config[axis].hstr; uint8_t chop2 = tmc2130_chopper_config[axis].hend; uint8_t chop3 = tmc2130_chopper_config[axis].tbl; char* str_end = 0; if (CMDBUFFER_CURRENT_STRING[14]) 12e34: 33 23 and r19, r19 12e36: e1 f1 breq .+120 ; 0x12eb0 { chop0 = (uint8_t)strtol(CMDBUFFER_CURRENT_STRING + 14, &str_end, 10) & 15; 12e38: 4a e0 ldi r20, 0x0A ; 10 12e3a: 50 e0 ldi r21, 0x00 ; 0 12e3c: be 01 movw r22, r28 12e3e: 6f 5f subi r22, 0xFF ; 255 12e40: 7f 4f sbci r23, 0xFF ; 255 12e42: 0f 94 62 d7 call 0x3aec4 ; 0x3aec4 12e46: 6f 70 andi r22, 0x0F ; 15 12e48: b6 2e mov r11, r22 if (str_end && *str_end) 12e4a: 89 81 ldd r24, Y+1 ; 0x01 12e4c: 9a 81 ldd r25, Y+2 ; 0x02 12e4e: 00 97 sbiw r24, 0x00 ; 0 12e50: 79 f1 breq .+94 ; 0x12eb0 12e52: fc 01 movw r30, r24 12e54: 20 81 ld r18, Z 12e56: 22 23 and r18, r18 12e58: 59 f1 breq .+86 ; 0x12eb0 { chop1 = (uint8_t)strtol(str_end, &str_end, 10) & 7; 12e5a: 4a e0 ldi r20, 0x0A ; 10 12e5c: 50 e0 ldi r21, 0x00 ; 0 12e5e: be 01 movw r22, r28 12e60: 6f 5f subi r22, 0xFF ; 255 12e62: 7f 4f sbci r23, 0xFF ; 255 12e64: 0f 94 62 d7 call 0x3aec4 ; 0x3aec4 12e68: 16 2f mov r17, r22 12e6a: 17 70 andi r17, 0x07 ; 7 if (str_end && *str_end) 12e6c: 89 81 ldd r24, Y+1 ; 0x01 12e6e: 9a 81 ldd r25, Y+2 ; 0x02 12e70: 00 97 sbiw r24, 0x00 ; 0 12e72: f1 f0 breq .+60 ; 0x12eb0 12e74: dc 01 movw r26, r24 12e76: 2c 91 ld r18, X 12e78: 22 23 and r18, r18 12e7a: d1 f0 breq .+52 ; 0x12eb0 { chop2 = (uint8_t)strtol(str_end, &str_end, 10) & 15; 12e7c: 4a e0 ldi r20, 0x0A ; 10 12e7e: 50 e0 ldi r21, 0x00 ; 0 12e80: be 01 movw r22, r28 12e82: 6f 5f subi r22, 0xFF ; 255 12e84: 7f 4f sbci r23, 0xFF ; 255 12e86: 0f 94 62 d7 call 0x3aec4 ; 0x3aec4 12e8a: 06 2f mov r16, r22 12e8c: 0f 70 andi r16, 0x0F ; 15 if (str_end && *str_end) 12e8e: 89 81 ldd r24, Y+1 ; 0x01 12e90: 9a 81 ldd r25, Y+2 ; 0x02 12e92: 00 97 sbiw r24, 0x00 ; 0 12e94: 69 f0 breq .+26 ; 0x12eb0 12e96: fc 01 movw r30, r24 12e98: 20 81 ld r18, Z 12e9a: 22 23 and r18, r18 12e9c: 49 f0 breq .+18 ; 0x12eb0 chop3 = (uint8_t)strtol(str_end, &str_end, 10) & 3; 12e9e: 4a e0 ldi r20, 0x0A ; 10 12ea0: 50 e0 ldi r21, 0x00 ; 0 12ea2: be 01 movw r22, r28 12ea4: 6f 5f subi r22, 0xFF ; 255 12ea6: 7f 4f sbci r23, 0xFF ; 255 12ea8: 0f 94 62 d7 call 0x3aec4 ; 0x3aec4 12eac: 63 70 andi r22, 0x03 ; 3 12eae: d6 2e mov r13, r22 } } } tmc2130_chopper_config[axis].toff = chop0; 12eb0: f4 01 movw r30, r8 12eb2: eb 55 subi r30, 0x5B ; 91 12eb4: fd 4f sbci r31, 0xFD ; 253 tmc2130_chopper_config[axis].hstr = chop1 & 7; 12eb6: 17 70 andi r17, 0x07 ; 7 12eb8: 12 95 swap r17 12eba: 10 7f andi r17, 0xF0 ; 240 tmc2130_chopper_config[axis].hend = chop2 & 15; 12ebc: 60 2f mov r22, r16 12ebe: 67 95 ror r22 12ec0: 66 27 eor r22, r22 12ec2: 67 95 ror r22 12ec4: 1b 29 or r17, r11 12ec6: 16 2b or r17, r22 12ec8: 10 83 st Z, r17 12eca: 60 2f mov r22, r16 12ecc: 66 95 lsr r22 12ece: 01 81 ldd r16, Z+1 ; 0x01 12ed0: 00 7e andi r16, 0xE0 ; 224 tmc2130_chopper_config[axis].tbl = chop3 & 3; 12ed2: 2d 2d mov r18, r13 12ed4: 23 70 andi r18, 0x03 ; 3 12ed6: d2 2e mov r13, r18 12ed8: dd 0c add r13, r13 12eda: dd 0c add r13, r13 12edc: dd 0c add r13, r13 12ede: 06 2b or r16, r22 12ee0: d0 2a or r13, r16 12ee2: d1 82 std Z+1, r13 ; 0x01 tmc2130_setup_chopper(axis, tmc2130_mres[axis]); 12ee4: f7 01 movw r30, r14 12ee6: ec 50 subi r30, 0x0C ; 12 12ee8: fb 4f sbci r31, 0xFB ; 251 12eea: 50 e0 ldi r21, 0x00 ; 0 12eec: 40 e0 ldi r20, 0x00 ; 0 12eee: 60 81 ld r22, Z 12ef0: 8c 2d mov r24, r12 12ef2: 0f 94 65 24 call 0x248ca ; 0x248ca 12ef6: d4 ce rjmp .-600 ; 0x12ca0 // ### TMC_SET_CHOP_ // ------------------- else if (strncmp_P(CMDBUFFER_CURRENT_STRING + 4, PSTR("SET_CHOP_"), 9) == 0) { uint8_t axis = *(CMDBUFFER_CURRENT_STRING + 13); axis = (axis == 'E')?3:(axis - 'X'); 12ef8: 03 e0 ldi r16, 0x03 ; 3 12efa: c0 2e mov r12, r16 12efc: 74 cf rjmp .-280 ; 0x12de6 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) { 12efe: 45 e0 ldi r20, 0x05 ; 5 12f00: 50 e0 ldi r21, 0x00 ; 0 12f02: 69 e8 ldi r22, 0x89 ; 137 12f04: 78 e8 ldi r23, 0x88 ; 136 12f06: c8 01 movw r24, r16 12f08: 0f 94 b6 d9 call 0x3b36c ; 0x3b36c 12f0c: 89 2b or r24, r25 12f0e: 09 f0 breq .+2 ; 0x12f12 12f10: 64 c1 rjmp .+712 ; 0x131da - `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"))) { 12f12: 8f e7 ldi r24, 0x7F ; 127 12f14: 98 e8 ldi r25, 0x88 ; 136 12f16: 0e 94 3e 68 call 0xd07c ; 0xd07c 12f1a: 88 23 and r24, r24 12f1c: 09 f4 brne .+2 ; 0x12f20 12f1e: 3c c0 rjmp .+120 ; 0x12f98 //! So basically we are interested in maximum time, the minima are mostly the same. //! May be that's why the bad RAMBo's still produce some fan RPM reading, but not corresponding to reality static void gcode_PRUSA_BadRAMBoFanTest(){ //printf_P(PSTR("Enter fan pin test\n")); #if !defined(DEBUG_DISABLE_FANCHECK) && defined(FANCHECK) && defined(TACH_1) && TACH_1 >-1 fan_measuring = false; // prevent EXTINT7 breaking into the measurement 12f20: 10 92 6e 06 sts 0x066E, r1 ; 0x80066e 12f24: 14 e6 ldi r17, 0x64 ; 100 unsigned long tach1max = 0; 12f26: c1 2c mov r12, r1 12f28: d1 2c mov r13, r1 12f2a: 76 01 movw r14, r12 uint8_t tach1cntr = 0; for( /* nothing */; tach1cntr < 100; ++tach1cntr){ //printf_P(PSTR("TACH_1: %d\n"), tach1cntr); SET_OUTPUT(TACH_1); 12f2c: 6f 9a sbi 0x0d, 7 ; 13 WRITE(TACH_1, LOW); 12f2e: 77 98 cbi 0x0e, 7 ; 14 _delay(20); // the delay may be lower 12f30: 64 e1 ldi r22, 0x14 ; 20 12f32: 70 e0 ldi r23, 0x00 ; 0 12f34: 80 e0 ldi r24, 0x00 ; 0 12f36: 90 e0 ldi r25, 0x00 ; 0 12f38: 0f 94 29 27 call 0x24e52 ; 0x24e52 unsigned long tachMeasure = _micros(); 12f3c: 0f 94 03 27 call 0x24e06 ; 0x24e06 12f40: 4b 01 movw r8, r22 12f42: 5c 01 movw r10, r24 cli(); 12f44: f8 94 cli SET_INPUT(TACH_1); 12f46: 6f 98 cbi 0x0d, 7 ; 13 // just wait brutally in an endless cycle until we reach HIGH // if this becomes a problem it may be improved to non-endless cycle while( READ(TACH_1) == 0 ) ; 12f48: 67 9b sbis 0x0c, 7 ; 12 12f4a: fe cf rjmp .-4 ; 0x12f48 sei(); 12f4c: 78 94 sei tachMeasure = _micros() - tachMeasure; 12f4e: 0f 94 03 27 call 0x24e06 ; 0x24e06 12f52: dc 01 movw r26, r24 12f54: cb 01 movw r24, r22 12f56: 88 19 sub r24, r8 12f58: 99 09 sbc r25, r9 12f5a: aa 09 sbc r26, r10 12f5c: bb 09 sbc r27, r11 12f5e: c8 16 cp r12, r24 12f60: d9 06 cpc r13, r25 12f62: ea 06 cpc r14, r26 12f64: fb 06 cpc r15, r27 12f66: 10 f4 brcc .+4 ; 0x12f6c 12f68: 6c 01 movw r12, r24 12f6a: 7d 01 movw r14, r26 12f6c: 11 50 subi r17, 0x01 ; 1 //printf_P(PSTR("Enter fan pin test\n")); #if !defined(DEBUG_DISABLE_FANCHECK) && defined(FANCHECK) && defined(TACH_1) && TACH_1 >-1 fan_measuring = false; // prevent EXTINT7 breaking into the measurement unsigned long tach1max = 0; uint8_t tach1cntr = 0; for( /* nothing */; tach1cntr < 100; ++tach1cntr){ 12f6e: f1 f6 brne .-68 ; 0x12f2c if( tach1max < tachMeasure ) tach1max = tachMeasure; //printf_P(PSTR("TACH_1: %d: capacitor check time=%lu us\n"), (int)tach1cntr, tachMeasure); } //printf_P(PSTR("TACH_1: max=%lu us\n"), tach1max); SERIAL_PROTOCOLPGM("RAMBo FAN "); 12f70: 8d e3 ldi r24, 0x3D ; 61 12f72: 95 e8 ldi r25, 0x85 ; 133 12f74: 0e 94 68 77 call 0xeed0 ; 0xeed0 if( tach1max > 500 ){ // bad RAMBo SERIAL_PROTOCOLLNPGM("BAD"); 12f78: 89 e3 ldi r24, 0x39 ; 57 12f7a: 95 e8 ldi r25, 0x85 ; 133 tach1max = tachMeasure; //printf_P(PSTR("TACH_1: %d: capacitor check time=%lu us\n"), (int)tach1cntr, tachMeasure); } //printf_P(PSTR("TACH_1: max=%lu us\n"), tach1max); SERIAL_PROTOCOLPGM("RAMBo FAN "); if( tach1max > 500 ){ 12f7c: 35 ef ldi r19, 0xF5 ; 245 12f7e: c3 16 cp r12, r19 12f80: 31 e0 ldi r19, 0x01 ; 1 12f82: d3 06 cpc r13, r19 12f84: e1 04 cpc r14, r1 12f86: f1 04 cpc r15, r1 12f88: 10 f4 brcc .+4 ; 0x12f8e // bad RAMBo SERIAL_PROTOCOLLNPGM("BAD"); } else { SERIAL_PROTOCOLLNPGM("OK"); 12f8a: 86 e3 ldi r24, 0x36 ; 54 12f8c: 95 e8 ldi r25, 0x85 ; 133 12f8e: 0e 94 93 79 call 0xf326 ; 0xf326 } // cleanup after the test function SET_INPUT(TACH_1); 12f92: 6f 98 cbi 0x0d, 7 ; 13 WRITE(TACH_1, HIGH); 12f94: 77 9a sbi 0x0e, 7 ; 14 12f96: 84 ce rjmp .-760 ; 0x12ca0 */ if (farm_prusa_code_seen()) {} else if(code_seen_P(PSTR("FANPINTST"))) { gcode_PRUSA_BadRAMBoFanTest(); } else if (code_seen_P(PSTR("FAN"))) { // PRUSA FAN 12f98: 8b e7 ldi r24, 0x7B ; 123 12f9a: 98 e8 ldi r25, 0x88 ; 136 12f9c: 0e 94 3e 68 call 0xd07c ; 0xd07c 12fa0: 88 23 and r24, r24 12fa2: 21 f1 breq .+72 ; 0x12fec printf_P(_N("E0:%d RPM\nPRN0:%d RPM\n"), 60*fan_speed[0], 60*fan_speed[1]); 12fa4: 40 91 c9 03 lds r20, 0x03C9 ; 0x8003c9 12fa8: 50 91 ca 03 lds r21, 0x03CA ; 0x8003ca 12fac: 2c e3 ldi r18, 0x3C ; 60 12fae: 24 9f mul r18, r20 12fb0: c0 01 movw r24, r0 12fb2: 25 9f mul r18, r21 12fb4: 90 0d add r25, r0 12fb6: 11 24 eor r1, r1 12fb8: 9f 93 push r25 12fba: 8f 93 push r24 12fbc: 40 91 c7 03 lds r20, 0x03C7 ; 0x8003c7 12fc0: 50 91 c8 03 lds r21, 0x03C8 ; 0x8003c8 12fc4: 24 9f mul r18, r20 12fc6: c0 01 movw r24, r0 12fc8: 25 9f mul r18, r21 12fca: 90 0d add r25, r0 12fcc: 11 24 eor r1, r1 12fce: 9f 93 push r25 12fd0: 8f 93 push r24 12fd2: 8a e6 ldi r24, 0x6A ; 106 12fd4: 9a e6 ldi r25, 0x6A ; 106 #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) #endif //DEBUG_DCODES default: printf_P(MSG_UNKNOWN_CODE, 'D', cmdbuffer + bufindr + CMDHDRSIZE); 12fd6: 9f 93 push r25 12fd8: 8f 93 push r24 12fda: 0f 94 99 da call 0x3b532 ; 0x3b532 12fde: 0f 90 pop r0 12fe0: 0f 90 pop r0 12fe2: 0f 90 pop r0 12fe4: 0f 90 pop r0 12fe6: 0f 90 pop r0 12fe8: 0f 90 pop r0 12fea: 5a ce rjmp .-844 ; 0x12ca0 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 12fec: 86 e7 ldi r24, 0x76 ; 118 12fee: 98 e8 ldi r25, 0x88 ; 136 12ff0: 0e 94 3e 68 call 0xd07c ; 0xd07c 12ff4: 88 23 and r24, r24 12ff6: 11 f1 breq .+68 ; 0x1303c if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE) == PowerPanic::PRINT_TYPE_SD) { 12ff8: 8c e8 ldi r24, 0x8C ; 140 12ffa: 9f e0 ldi r25, 0x0F ; 15 12ffc: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 13000: 81 11 cpse r24, r1 13002: 10 c0 rjmp .+32 ; 0x13024 // M24 - Start SD print enquecommand_P(MSG_M24); 13004: 61 e0 ldi r22, 0x01 ; 1 13006: 81 e3 ldi r24, 0x31 ; 49 13008: 91 e7 ldi r25, 0x71 ; 113 1300a: 0e 94 38 88 call 0x11070 ; 0x11070 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1300e: 60 e0 ldi r22, 0x00 ; 0 13010: 85 ea ldi r24, 0xA5 ; 165 13012: 9f e0 ldi r25, 0x0F ; 15 13014: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 13018: 60 e0 ldi r22, 0x00 ; 0 1301a: 8f e7 ldi r24, 0x7F ; 127 1301c: 9c e0 ldi r25, 0x0C ; 12 1301e: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 13022: 3e ce rjmp .-900 ; 0x12ca0 // 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) { 13024: 81 30 cpi r24, 0x01 ; 1 13026: 09 f0 breq .+2 ; 0x1302a 13028: 3b ce rjmp .-906 ; 0x12ca0 // 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(); 1302a: 0f 94 48 42 call 0x28490 ; 0x28490 usb_timer.start(); 1302e: 8d e0 ldi r24, 0x0D ; 13 13030: 95 e0 ldi r25, 0x05 ; 5 13032: 0f 94 83 29 call 0x25306 ; 0x25306 ::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(); 13036: 0f 94 2e 29 call 0x2525c ; 0x2525c 1303a: 32 ce rjmp .-924 ; 0x12ca0 } } else if (code_seen_P(PSTR("MMURES"))) { // PRUSA MMURES 1303c: 8f e6 ldi r24, 0x6F ; 111 1303e: 98 e8 ldi r25, 0x88 ; 136 13040: 0e 94 3e 68 call 0xd07c ; 0xd07c 13044: 88 23 and r24, r24 13046: 21 f0 breq .+8 ; 0x13050 break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 13048: 80 e0 ldi r24, 0x00 ; 0 1304a: 0f 94 52 0f call 0x21ea4 ; 0x21ea4 1304e: 28 ce rjmp .-944 ; 0x12ca0 MMU2::mmu2.Reset(MMU2::MMU2::Software); } else if (code_seen_P(PSTR("RESET"))) { // PRUSA RESET 13050: 89 e6 ldi r24, 0x69 ; 105 13052: 98 e8 ldi r25, 0x88 ; 136 13054: 0e 94 3e 68 call 0xd07c ; 0xd07c 13058: 88 23 and r24, r24 1305a: 51 f0 breq .+20 ; 0x13070 #if defined(XFLASH) && defined(BOOTAPP) boot_app_magic = 0; 1305c: 10 92 fc 1f sts 0x1FFC, r1 ; 0x801ffc <__bss_end+0x7dd> 13060: 10 92 fd 1f sts 0x1FFD, r1 ; 0x801ffd <__bss_end+0x7de> 13064: 10 92 fe 1f sts 0x1FFE, r1 ; 0x801ffe <__bss_end+0x7df> 13068: 10 92 ff 1f sts 0x1FFF, r1 ; 0x801fff <__bss_end+0x7e0> #endif //defined(XFLASH) && defined(BOOTAPP) softReset(); 1306c: 0e 94 64 67 call 0xcec8 ; 0xcec8 } else if (code_seen_P(PSTR("SN"))) { // PRUSA SN 13070: 86 e6 ldi r24, 0x66 ; 102 13072: 98 e8 ldi r25, 0x88 ; 136 13074: 0e 94 3e 68 call 0xd07c ; 0xd07c 13078: 88 23 and r24, r24 1307a: a9 f0 breq .+42 ; 0x130a6 char SN[20]; eeprom_read_block(SN, (uint8_t*)EEPROM_PRUSA_SN, 20); 1307c: 44 e1 ldi r20, 0x14 ; 20 1307e: 50 e0 ldi r21, 0x00 ; 0 13080: 65 e1 ldi r22, 0x15 ; 21 13082: 7d e0 ldi r23, 0x0D ; 13 13084: ce 01 movw r24, r28 13086: 01 96 adiw r24, 0x01 ; 1 13088: 0f 94 c7 db call 0x3b78e ; 0x3b78e if (SN[19]) 1308c: 8c 89 ldd r24, Y+20 ; 0x14 1308e: 88 23 and r24, r24 13090: 29 f0 breq .+10 ; 0x1309c puts_P(PSTR("SN invalid")); 13092: 8b e5 ldi r24, 0x5B ; 91 13094: 98 e8 ldi r25, 0x88 ; 136 13096: 0f 94 c0 da call 0x3b580 ; 0x3b580 1309a: 02 ce rjmp .-1020 ; 0x12ca0 else puts(SN); 1309c: ce 01 movw r24, r28 1309e: 01 96 adiw r24, 0x01 ; 1 130a0: 0f 94 66 e2 call 0x3c4cc ; 0x3c4cc 130a4: fd cd rjmp .-1030 ; 0x12ca0 } else if(code_seen_P(PSTR("Fir"))){ // PRUSA Fir 130a6: 87 e5 ldi r24, 0x57 ; 87 130a8: 98 e8 ldi r25, 0x88 ; 136 130aa: 0e 94 3e 68 call 0xd07c ; 0xd07c 130ae: 88 23 and r24, r24 130b0: 29 f0 breq .+10 ; 0x130bc SERIAL_PROTOCOLLNPGM(FW_VERSION_FULL); 130b2: 8b e4 ldi r24, 0x4B ; 75 130b4: 98 e8 ldi r25, 0x88 ; 136 else { SERIAL_ECHO_START; SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); SERIAL_ECHOLNPGM("\"(2)"); 130b6: 0e 94 93 79 call 0xf326 ; 0xf326 130ba: f2 cd rjmp .-1052 ; 0x12ca0 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 130bc: 87 e4 ldi r24, 0x47 ; 71 130be: 98 e8 ldi r25, 0x88 ; 136 130c0: 0e 94 3e 68 call 0xd07c ; 0xd07c 130c4: 88 23 and r24, r24 130c6: 19 f0 breq .+6 ; 0x130ce SERIAL_PROTOCOLLNPGM(FILAMENT_SIZE "-" ELECTRONICS "-" NOZZLE_TYPE ); 130c8: 88 e2 ldi r24, 0x28 ; 40 130ca: 98 e8 ldi r25, 0x88 ; 136 130cc: f4 cf rjmp .-24 ; 0x130b6 } else if(code_seen_P(PSTR("Lang"))) { // PRUSA Lang 130ce: 83 e2 ldi r24, 0x23 ; 35 130d0: 98 e8 ldi r25, 0x88 ; 136 130d2: 0e 94 3e 68 call 0xd07c ; 0xd07c 130d6: 88 23 and r24, r24 130d8: 19 f0 breq .+6 ; 0x130e0 lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { case 0: // Level 0: Language reset lang_reset(); 130da: 0e 94 44 71 call 0xe288 ; 0xe288 130de: e0 cd rjmp .-1088 ; 0x12ca0 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 130e0: 80 e2 ldi r24, 0x20 ; 32 130e2: 98 e8 ldi r25, 0x88 ; 136 130e4: 0e 94 3e 68 call 0xd07c ; 0xd07c 130e8: 88 23 and r24, r24 130ea: 79 f0 breq .+30 ; 0x1310a eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 130ec: 81 ea ldi r24, 0xA1 ; 161 130ee: 9d e0 ldi r25, 0x0D ; 13 130f0: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 130f4: 4b e0 ldi r20, 0x0B ; 11 130f6: 84 9f mul r24, r20 130f8: c0 01 movw r24, r0 130fa: 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); 130fc: 70 e0 ldi r23, 0x00 ; 0 130fe: 60 e0 ldi r22, 0x00 ; 0 13100: 80 5b subi r24, 0xB0 ; 176 13102: 92 4f sbci r25, 0xF2 ; 242 13104: 0f 94 19 dc call 0x3b832 ; 0x3b832 13108: cb cd rjmp .-1130 ; 0x12ca0 } else if(code_seen_P(PSTR("FR"))) { // PRUSA FR 1310a: 8d e1 ldi r24, 0x1D ; 29 1310c: 98 e8 ldi r25, 0x88 ; 136 1310e: 0e 94 3e 68 call 0xd07c ; 0xd07c 13112: 88 23 and r24, r24 13114: 51 f0 breq .+20 ; 0x1312a // 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(); 13116: 0e 94 2b 6f call 0xde56 ; 0xde56 Sound_MakeCustom(100,0,false); 1311a: 40 e0 ldi r20, 0x00 ; 0 1311c: 70 e0 ldi r23, 0x00 ; 0 1311e: 60 e0 ldi r22, 0x00 ; 0 13120: 84 e6 ldi r24, 0x64 ; 100 13122: 90 e0 ldi r25, 0x00 ; 0 13124: 0f 94 01 51 call 0x2a202 ; 0x2a202 13128: d8 cf rjmp .-80 ; 0x130da 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 1312a: 89 e1 ldi r24, 0x19 ; 25 1312c: 98 e8 ldi r25, 0x88 ; 136 1312e: 0e 94 3e 68 call 0xd07c ; 0xd07c 13132: 88 23 and r24, r24 13134: e1 f0 breq .+56 ; 0x1316e // Change the MBL status without changing the logical Z position. if(code_seen('V')) { 13136: 86 e5 ldi r24, 0x56 ; 86 13138: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 1313c: 88 23 and r24, r24 1313e: 09 f4 brne .+2 ; 0x13142 13140: af cd rjmp .-1186 ; 0x12ca0 bool value = code_value_short(); 13142: 0e 94 8d 5b call 0xb71a ; 0xb71a 13146: 11 e0 ldi r17, 0x01 ; 1 13148: 89 2b or r24, r25 1314a: 09 f4 brne .+2 ; 0x1314e 1314c: 10 e0 ldi r17, 0x00 ; 0 st_synchronize(); 1314e: 0f 94 a3 42 call 0x28546 ; 0x28546 if(value != mbl.active) { 13152: 80 91 c1 13 lds r24, 0x13C1 ; 0x8013c1 13156: 90 e0 ldi r25, 0x00 ; 0 13158: 18 17 cp r17, r24 1315a: 19 06 cpc r1, r25 1315c: 09 f4 brne .+2 ; 0x13160 1315e: a0 cd rjmp .-1216 ; 0x12ca0 mbl.active = value; 13160: 10 93 c1 13 sts 0x13C1, r17 ; 0x8013c1 // Use plan_set_z_position to reset the physical values plan_set_z_position(current_position[Z_AXIS]); 13164: 89 e9 ldi r24, 0x99 ; 153 13166: 96 e0 ldi r25, 0x06 ; 6 13168: 0f 94 ac 63 call 0x2c758 ; 0x2c758 1316c: 99 cd rjmp .-1230 ; 0x12ca0 } } } else if (code_seen_P(PSTR("nozzle"))) { // PRUSA nozzle 1316e: 82 e1 ldi r24, 0x12 ; 18 13170: 98 e8 ldi r25, 0x88 ; 136 13172: 0e 94 3e 68 call 0xd07c ; 0xd07c 13176: 88 23 and r24, r24 13178: 09 f4 brne .+2 ; 0x1317c 1317a: 92 cd rjmp .-1244 ; 0x12ca0 uint16_t nDiameter; if(code_seen('D')) { 1317c: 84 e4 ldi r24, 0x44 ; 68 1317e: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 13182: 88 23 and r24, r24 13184: a1 f0 breq .+40 ; 0x131ae nDiameter=(uint16_t)(code_value()*1000.0+0.5); // [,um] 13186: 0e 94 b5 60 call 0xc16a ; 0xc16a 1318a: 20 e0 ldi r18, 0x00 ; 0 1318c: 30 e0 ldi r19, 0x00 ; 0 1318e: 4a e7 ldi r20, 0x7A ; 122 13190: 54 e4 ldi r21, 0x44 ; 68 13192: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 13196: 20 e0 ldi r18, 0x00 ; 0 13198: 30 e0 ldi r19, 0x00 ; 0 1319a: 40 e0 ldi r20, 0x00 ; 0 1319c: 5f e3 ldi r21, 0x3F ; 63 1319e: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 131a2: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> nozzle_diameter_check(nDiameter); 131a6: cb 01 movw r24, r22 131a8: 0e 94 0b f5 call 0x1ea16 ; 0x1ea16 131ac: 79 cd rjmp .-1294 ; 0x12ca0 } else if(code_seen_P(PSTR("set")) && farm_mode) { 131ae: 8e e0 ldi r24, 0x0E ; 14 131b0: 98 e8 ldi r25, 0x88 ; 136 131b2: 0e 94 3e 68 call 0xd07c ; 0xd07c strchr_pointer++; // skip 1st char (~ 's') strchr_pointer++; // skip 2nd char (~ 'e') nDiameter=(uint16_t)(code_value()*1000.0+0.5); // [,um] 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); 131b6: 85 ea ldi r24, 0xA5 ; 165 131b8: 9d e0 ldi r25, 0x0D ; 13 131ba: 0f 94 e5 db call 0x3b7ca ; 0x3b7ca 131be: bc 01 movw r22, r24 131c0: 90 e0 ldi r25, 0x00 ; 0 131c2: 80 e0 ldi r24, 0x00 ; 0 131c4: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 131c8: 20 e0 ldi r18, 0x00 ; 0 131ca: 30 e0 ldi r19, 0x00 ; 0 131cc: 4a e7 ldi r20, 0x7A ; 122 131ce: 54 e4 ldi r21, 0x44 ; 68 131d0: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 131d4: 0f 94 6f 74 call 0x2e8de ; 0x2e8de 131d8: 63 cd rjmp .-1338 ; 0x12ca0 } } else if(*CMDBUFFER_CURRENT_STRING == 'G') 131da: d8 01 movw r26, r16 131dc: 8c 91 ld r24, X 131de: 87 34 cpi r24, 0x47 ; 71 131e0: 11 f0 breq .+4 ; 0x131e6 131e2: 0c 94 88 a4 jmp 0x14910 ; 0x14910 { strchr_pointer = CMDBUFFER_CURRENT_STRING; 131e6: 10 93 94 03 sts 0x0394, r17 ; 0x800394 131ea: 00 93 93 03 sts 0x0393, r16 ; 0x800393 gcode_in_progress = code_value_short(); 131ee: 0e 94 8d 5b call 0xb71a ; 0xb71a 131f2: 90 93 92 03 sts 0x0392, r25 ; 0x800392 131f6: 80 93 91 03 sts 0x0391, r24 ; 0x800391 // printf_P(_N("BEGIN G-CODE=%u\n"), gcode_in_progress); switch (gcode_in_progress) 131fa: 8e 31 cpi r24, 0x1E ; 30 131fc: 91 05 cpc r25, r1 131fe: 09 f4 brne .+2 ; 0x13202 13200: da c6 rjmp .+3508 ; 0x13fb6 13202: 0c f0 brlt .+2 ; 0x13206 13204: 45 c1 rjmp .+650 ; 0x13490 13206: 84 30 cpi r24, 0x04 ; 4 13208: 91 05 cpc r25, r1 1320a: 09 f4 brne .+2 ; 0x1320e 1320c: 7e c6 rjmp .+3324 ; 0x13f0a 1320e: 0c f0 brlt .+2 ; 0x13212 13210: c5 c0 rjmp .+394 ; 0x1339c 13212: 97 fd sbrc r25, 7 13214: cb c0 rjmp .+406 ; 0x133ac 13216: 02 97 sbiw r24, 0x02 ; 2 13218: 0c f0 brlt .+2 ; 0x1321c 1321a: fc c1 rjmp .+1016 ; 0x13614 */ case 0: // G0 -> G1 case 1: // G1 { uint16_t start_segment_idx = restore_interrupted_gcode(); 1321c: 0e 94 8b 5a call 0xb516 ; 0xb516 13220: 8c 01 movw r16, r24 get_coordinates(); // For X Y Z E F 13222: 0e 94 dc 61 call 0xc3b8 ; 0xc3b8 if (total_filament_used > ((current_position[E_AXIS] - destination[E_AXIS]) * 100)) { //protection against total_filament_used overflow 13226: 60 91 64 06 lds r22, 0x0664 ; 0x800664 1322a: 70 91 65 06 lds r23, 0x0665 ; 0x800665 1322e: 80 91 66 06 lds r24, 0x0666 ; 0x800666 13232: 90 91 67 06 lds r25, 0x0667 ; 0x800667 13236: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 1323a: 6b 01 movw r12, r22 1323c: 7c 01 movw r14, r24 1323e: 40 90 9d 06 lds r4, 0x069D ; 0x80069d 13242: 50 90 9e 06 lds r5, 0x069E ; 0x80069e 13246: 60 90 9f 06 lds r6, 0x069F ; 0x80069f 1324a: 70 90 a0 06 lds r7, 0x06A0 ; 0x8006a0 1324e: 80 90 7f 06 lds r8, 0x067F ; 0x80067f 13252: 90 90 80 06 lds r9, 0x0680 ; 0x800680 13256: a0 90 81 06 lds r10, 0x0681 ; 0x800681 1325a: b0 90 82 06 lds r11, 0x0682 ; 0x800682 1325e: a5 01 movw r20, r10 13260: 94 01 movw r18, r8 13262: c3 01 movw r24, r6 13264: b2 01 movw r22, r4 13266: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 1326a: 20 e0 ldi r18, 0x00 ; 0 1326c: 30 e0 ldi r19, 0x00 ; 0 1326e: 48 ec ldi r20, 0xC8 ; 200 13270: 52 e4 ldi r21, 0x42 ; 66 13272: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 13276: 9b 01 movw r18, r22 13278: ac 01 movw r20, r24 1327a: c7 01 movw r24, r14 1327c: b6 01 movw r22, r12 1327e: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 13282: 18 16 cp r1, r24 13284: d4 f4 brge .+52 ; 0x132ba total_filament_used = total_filament_used + ((destination[E_AXIS] - current_position[E_AXIS]) * 100); 13286: a3 01 movw r20, r6 13288: 92 01 movw r18, r4 1328a: c5 01 movw r24, r10 1328c: b4 01 movw r22, r8 1328e: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 13292: 20 e0 ldi r18, 0x00 ; 0 13294: 30 e0 ldi r19, 0x00 ; 0 13296: 48 ec ldi r20, 0xC8 ; 200 13298: 52 e4 ldi r21, 0x42 ; 66 1329a: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 1329e: a7 01 movw r20, r14 132a0: 96 01 movw r18, r12 132a2: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 132a6: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 132aa: 60 93 64 06 sts 0x0664, r22 ; 0x800664 132ae: 70 93 65 06 sts 0x0665, r23 ; 0x800665 132b2: 80 93 66 06 sts 0x0666, r24 ; 0x800666 132b6: 90 93 67 06 sts 0x0667, r25 ; 0x800667 } #ifdef FWRETRACT if(cs.autoretract_enabled) { 132ba: 80 91 3f 0e lds r24, 0x0E3F ; 0x800e3f 132be: 88 23 and r24, r24 132c0: 09 f4 brne .+2 ; 0x132c4 132c2: a4 c1 rjmp .+840 ; 0x1360c if( !(code_seen('X') || code_seen('Y') || code_seen('Z')) && code_seen('E')) { 132c4: 88 e5 ldi r24, 0x58 ; 88 132c6: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 132ca: 81 11 cpse r24, r1 132cc: 9f c1 rjmp .+830 ; 0x1360c 132ce: 89 e5 ldi r24, 0x59 ; 89 132d0: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 132d4: 81 11 cpse r24, r1 132d6: 9a c1 rjmp .+820 ; 0x1360c 132d8: 8a e5 ldi r24, 0x5A ; 90 132da: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 132de: 81 11 cpse r24, r1 132e0: 95 c1 rjmp .+810 ; 0x1360c 132e2: 85 e4 ldi r24, 0x45 ; 69 132e4: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 132e8: 88 23 and r24, r24 132ea: 09 f4 brne .+2 ; 0x132ee 132ec: 8f c1 rjmp .+798 ; 0x1360c float echange=destination[E_AXIS]-current_position[E_AXIS]; 132ee: 20 91 9d 06 lds r18, 0x069D ; 0x80069d 132f2: 30 91 9e 06 lds r19, 0x069E ; 0x80069e 132f6: 40 91 9f 06 lds r20, 0x069F ; 0x80069f 132fa: 50 91 a0 06 lds r21, 0x06A0 ; 0x8006a0 132fe: 60 91 7f 06 lds r22, 0x067F ; 0x80067f 13302: 70 91 80 06 lds r23, 0x0680 ; 0x800680 13306: 80 91 81 06 lds r24, 0x0681 ; 0x800681 1330a: 90 91 82 06 lds r25, 0x0682 ; 0x800682 1330e: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 13312: 6b 01 movw r12, r22 13314: 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 13316: 2d ec ldi r18, 0xCD ; 205 13318: 3c ec ldi r19, 0xCC ; 204 1331a: 4c ec ldi r20, 0xCC ; 204 1331c: 5d eb ldi r21, 0xBD ; 189 1331e: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 13322: 87 ff sbrs r24, 7 13324: 65 c1 rjmp .+714 ; 0x135f0 13326: 80 91 8d 06 lds r24, 0x068D ; 0x80068d 1332a: 81 11 cpse r24, r1 1332c: 0c 94 45 cc jmp 0x1988a ; 0x1988a st_synchronize(); 13330: 0f 94 a3 42 call 0x28546 ; 0x28546 current_position[E_AXIS] = destination[E_AXIS]; //hide the slicer-generated retract/recover from calculations 13334: 80 91 7f 06 lds r24, 0x067F ; 0x80067f 13338: 90 91 80 06 lds r25, 0x0680 ; 0x800680 1333c: a0 91 81 06 lds r26, 0x0681 ; 0x800681 13340: b0 91 82 06 lds r27, 0x0682 ; 0x800682 13344: 80 93 9d 06 sts 0x069D, r24 ; 0x80069d 13348: 90 93 9e 06 sts 0x069E, r25 ; 0x80069e 1334c: a0 93 9f 06 sts 0x069F, r26 ; 0x80069f 13350: b0 93 a0 06 sts 0x06A0, r27 ; 0x8006a0 plan_set_e_position(current_position[E_AXIS]); //AND from the planner 13354: 8d e9 ldi r24, 0x9D ; 157 13356: 96 e0 ldi r25, 0x06 ; 6 13358: 0f 94 79 63 call 0x2c6f2 ; 0x2c6f2 retract(!retracted[active_extruder]); 1335c: 90 91 8d 06 lds r25, 0x068D ; 0x80068d 13360: 81 e0 ldi r24, 0x01 ; 1 13362: 89 27 eor r24, r25 13364: 0f 94 e3 89 call 0x313c6 ; 0x313c6 SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); SERIAL_ECHOLNPGM("\"(2)"); } KEEPALIVE_STATE(NOT_BUSY); ClearToSend(); } 13368: c1 57 subi r28, 0x71 ; 113 1336a: df 4f sbci r29, 0xFF ; 255 1336c: 0f b6 in r0, 0x3f ; 63 1336e: f8 94 cli 13370: de bf out 0x3e, r29 ; 62 13372: 0f be out 0x3f, r0 ; 63 13374: cd bf out 0x3d, r28 ; 61 13376: df 91 pop r29 13378: cf 91 pop r28 1337a: 1f 91 pop r17 1337c: 0f 91 pop r16 1337e: ff 90 pop r15 13380: ef 90 pop r14 13382: df 90 pop r13 13384: cf 90 pop r12 13386: bf 90 pop r11 13388: af 90 pop r10 1338a: 9f 90 pop r9 1338c: 8f 90 pop r8 1338e: 7f 90 pop r7 13390: 6f 90 pop r6 13392: 5f 90 pop r5 13394: 4f 90 pop r4 13396: 3f 90 pop r3 13398: 2f 90 pop r2 1339a: 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) 1339c: 8b 30 cpi r24, 0x0B ; 11 1339e: 91 05 cpc r25, r1 133a0: 09 f4 brne .+2 ; 0x133a4 133a2: 00 c6 rjmp .+3072 ; 0x13fa4 133a4: dc f4 brge .+54 ; 0x133dc 133a6: 0a 97 sbiw r24, 0x0a ; 10 133a8: 09 f4 brne .+2 ; 0x133ac 133aa: f8 c5 rjmp .+3056 ; 0x13f9c case 99: farm_gcode_g99(); break; #endif //PRUSA_FARM default: printf_P(MSG_UNKNOWN_CODE, 'G', cmdbuffer + bufindr + CMDHDRSIZE); 133ac: 80 91 91 12 lds r24, 0x1291 ; 0x801291 133b0: 90 91 92 12 lds r25, 0x1292 ; 0x801292 133b4: 89 55 subi r24, 0x59 ; 89 133b6: 9f 4e sbci r25, 0xEF ; 239 133b8: 9f 93 push r25 133ba: 8f 93 push r24 133bc: 1f 92 push r1 133be: 87 e4 ldi r24, 0x47 ; 71 133c0: 8f 93 push r24 133c2: 8c e8 ldi r24, 0x8C ; 140 133c4: 99 e6 ldi r25, 0x69 ; 105 133c6: 9f 93 push r25 133c8: 8f 93 push r24 133ca: 0f 94 99 da call 0x3b532 ; 0x3b532 133ce: 0f 90 pop r0 133d0: 0f 90 pop r0 133d2: 0f 90 pop r0 133d4: 0f 90 pop r0 133d6: 0f 90 pop r0 133d8: 0f 90 pop r0 133da: a5 c0 rjmp .+330 ; 0x13526 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) 133dc: 85 31 cpi r24, 0x15 ; 21 133de: 91 05 cpc r25, r1 133e0: 09 f4 brne .+2 ; 0x133e4 133e2: a1 c0 rjmp .+322 ; 0x13526 133e4: 4c 97 sbiw r24, 0x1c ; 28 133e6: 11 f7 brne .-60 ; 0x133ac { 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]); 133e8: 88 e5 ldi r24, 0x58 ; 88 133ea: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 133ee: 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; 133f0: 41 2c mov r4, r1 133f2: 51 2c mov r5, r1 133f4: 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(); 133f6: 88 23 and r24, r24 133f8: 21 f0 breq .+8 ; 0x13402 133fa: 0e 94 9a 5b call 0xb734 ; 0xb734 133fe: 2b 01 movw r4, r22 13400: 3c 01 movw r6, r24 bool home_y = code_seen(axis_codes[Y_AXIS]); 13402: 89 e5 ldi r24, 0x59 ; 89 13404: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 13408: 28 2e mov r2, r24 if (home_y) home_y_value = code_value_long(); 1340a: 88 23 and r24, r24 1340c: 09 f4 brne .+2 ; 0x13410 1340e: cc c5 rjmp .+2968 ; 0x13fa8 13410: 0e 94 9a 5b call 0xb734 ; 0xb734 13414: 6e 96 adiw r28, 0x1e ; 30 13416: 6c af std Y+60, r22 ; 0x3c 13418: 7d af std Y+61, r23 ; 0x3d 1341a: 8e af std Y+62, r24 ; 0x3e 1341c: 9f af std Y+63, r25 ; 0x3f 1341e: 6e 97 sbiw r28, 0x1e ; 30 bool home_z = code_seen(axis_codes[Z_AXIS]); 13420: 8a e5 ldi r24, 0x5A ; 90 13422: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 13426: d8 2e mov r13, r24 */ case 28: { long home_x_value = 0; long home_y_value = 0; long home_z_value = 0; 13428: 81 2c mov r8, r1 1342a: 91 2c mov r9, r1 1342c: 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(); 1342e: 88 23 and r24, r24 13430: 21 f0 breq .+8 ; 0x1343a 13432: 0e 94 9a 5b call 0xb734 ; 0xb734 13436: 4b 01 movw r8, r22 13438: 5c 01 movw r10, r24 bool without_mbl = code_seen('W'); 1343a: 87 e5 ldi r24, 0x57 ; 87 1343c: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 13440: 67 96 adiw r28, 0x17 ; 23 13442: 8f af std Y+63, r24 ; 0x3f 13444: 67 97 sbiw r28, 0x17 ; 23 // calibrate? #ifdef TMC2130 bool calib = code_seen('C'); 13446: 83 e4 ldi r24, 0x43 ; 67 13448: 0e 94 ee 5b call 0xb7dc ; 0xb7dc gcode_G28(home_x, home_x_value, home_y, home_y_value, home_z, home_z_value, calib, without_mbl); 1344c: 67 96 adiw r28, 0x17 ; 23 1344e: ff ad ldd r31, Y+63 ; 0x3f 13450: 67 97 sbiw r28, 0x17 ; 23 13452: ff 93 push r31 13454: 8f 93 push r24 13456: cd 2c mov r12, r13 13458: 6e 96 adiw r28, 0x1e ; 30 1345a: ec ac ldd r14, Y+60 ; 0x3c 1345c: fd ac ldd r15, Y+61 ; 0x3d 1345e: 0e ad ldd r16, Y+62 ; 0x3e 13460: 1f ad ldd r17, Y+63 ; 0x3f 13462: 6e 97 sbiw r28, 0x1e ; 30 13464: 22 2d mov r18, r2 13466: b3 01 movw r22, r6 13468: a2 01 movw r20, r4 1346a: 83 2d mov r24, r3 1346c: 0e 94 3f 7d call 0xfa7e ; 0xfa7e #else gcode_G28(home_x, home_x_value, home_y, home_y_value, home_z, home_z_value, without_mbl); #endif //TMC2130 if ((home_x || home_y || without_mbl || home_z) == false) { 13470: 0f 90 pop r0 13472: 0f 90 pop r0 13474: 31 10 cpse r3, r1 13476: 57 c0 rjmp .+174 ; 0x13526 13478: 21 10 cpse r2, r1 1347a: 55 c0 rjmp .+170 ; 0x13526 1347c: 67 96 adiw r28, 0x17 ; 23 1347e: 2f ad ldd r18, Y+63 ; 0x3f 13480: 67 97 sbiw r28, 0x17 ; 23 13482: 21 11 cpse r18, r1 13484: 50 c0 rjmp .+160 ; 0x13526 13486: d1 10 cpse r13, r1 13488: 4e c0 rjmp .+156 ; 0x13526 - `W` - area width (on X axis) - `H` - area height (on Y axis) */ case 80: { gcode_G80(); 1348a: 0e 94 0c 8e call 0x11c18 ; 0x11c18 1348e: 4b c0 rjmp .+150 ; 0x13526 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) 13490: 86 35 cpi r24, 0x56 ; 86 13492: 91 05 cpc r25, r1 13494: 11 f4 brne .+4 ; 0x1349a 13496: 0c 94 37 a4 jmp 0x1486e ; 0x1486e 1349a: b4 f5 brge .+108 ; 0x13508 1349c: 8c 34 cpi r24, 0x4C ; 76 1349e: 91 05 cpc r25, r1 134a0: 09 f4 brne .+2 ; 0x134a4 134a2: df c5 rjmp .+3006 ; 0x14062 134a4: 3c f5 brge .+78 ; 0x134f4 134a6: 08 e2 ldi r16, 0x28 ; 40 134a8: 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)); 134aa: fc e3 ldi r31, 0x3C ; 60 134ac: ef 2e mov r14, r31 134ae: fa e6 ldi r31, 0x6A ; 106 134b0: ff 2e mov r15, r31 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) 134b2: 8b 34 cpi r24, 0x4B ; 75 134b4: 91 05 cpc r25, r1 134b6: 09 f0 breq .+2 ; 0x134ba 134b8: 79 cf rjmp .-270 ; 0x133ac 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)); 134ba: 60 2f mov r22, r16 134bc: 70 e0 ldi r23, 0x00 ; 0 134be: 90 e0 ldi r25, 0x00 ; 0 134c0: 80 e0 ldi r24, 0x00 ; 0 134c2: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 134c6: 0e 94 a2 5c call 0xb944 ; 0xb944 134ca: 9f 93 push r25 134cc: 8f 93 push r24 134ce: 7f 93 push r23 134d0: 6f 93 push r22 134d2: 1f 93 push r17 134d4: 0f 93 push r16 134d6: ff 92 push r15 134d8: ef 92 push r14 134da: 0f 94 99 da call 0x3b532 ; 0x3b532 134de: 0f 5f subi r16, 0xFF ; 255 134e0: 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++) 134e2: 0f b6 in r0, 0x3f ; 63 134e4: f8 94 cli 134e6: de bf out 0x3e, r29 ; 62 134e8: 0f be out 0x3f, r0 ; 63 134ea: cd bf out 0x3d, r28 ; 61 134ec: 0f 36 cpi r16, 0x6F ; 111 134ee: 11 05 cpc r17, r1 134f0: 21 f7 brne .-56 ; 0x134ba 134f2: 19 c0 rjmp .+50 ; 0x13526 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) 134f4: 80 35 cpi r24, 0x50 ; 80 134f6: 91 05 cpc r25, r1 134f8: 41 f2 breq .-112 ; 0x1348a 134fa: 81 35 cpi r24, 0x51 ; 81 134fc: 91 05 cpc r25, r1 134fe: 09 f0 breq .+2 ; 0x13502 13500: 55 cf rjmp .-342 ; 0x133ac /*! ### 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(); 13502: 0e 94 73 7f call 0xfee6 ; 0xfee6 13506: 0f c0 rjmp .+30 ; 0x13526 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) 13508: 8a 35 cpi r24, 0x5A ; 90 1350a: 91 05 cpc r25, r1 1350c: 11 f4 brne .+4 ; 0x13512 1350e: 0c 94 41 a4 jmp 0x14882 ; 0x14882 13512: 74 f4 brge .+28 ; 0x13530 13514: 87 35 cpi r24, 0x57 ; 87 13516: 91 05 cpc r25, r1 13518: 11 f4 brne .+4 ; 0x1351e 1351a: 0c 94 3c a4 jmp 0x14878 ; 0x14878 1351e: 88 35 cpi r24, 0x58 ; 88 13520: 91 05 cpc r25, r1 13522: 09 f0 breq .+2 ; 0x13526 13524: 43 cf rjmp .-378 ; 0x133ac #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; 13526: 10 92 92 03 sts 0x0392, r1 ; 0x800392 1352a: 10 92 91 03 sts 0x0391, r1 ; 0x800391 1352e: b8 cb rjmp .-2192 ; 0x12ca0 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) 13530: 8b 35 cpi r24, 0x5B ; 91 13532: 91 05 cpc r25, r1 13534: 11 f4 brne .+4 ; 0x1353a 13536: 0c 94 48 a4 jmp 0x14890 ; 0x14890 1353a: 8c 35 cpi r24, 0x5C ; 92 1353c: 91 05 cpc r25, r1 1353e: 09 f0 breq .+2 ; 0x13542 13540: 35 cf rjmp .-406 ; 0x133ac 13542: 1d ed ldi r17, 0xDD ; 221 13544: c1 2e mov r12, r17 13546: 12 e0 ldi r17, 0x02 ; 2 13548: d1 2e mov r13, r17 1354a: 8e 01 movw r16, r28 1354c: 0f 5b subi r16, 0xBF ; 191 1354e: 1f 4f sbci r17, 0xFF ; 255 13550: 9e 01 movw r18, r28 13552: 2f 5f subi r18, 0xFF ; 255 13554: 3f 4f sbci r19, 0xFF ; 255 13556: 79 01 movw r14, r18 13558: 81 ee ldi r24, 0xE1 ; 225 1355a: 88 2e mov r8, r24 1355c: 82 e0 ldi r24, 0x02 ; 2 1355e: 98 2e mov r9, r24 13560: 58 01 movw r10, r16 13562: 39 01 movw r6, r18 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]); 13564: d6 01 movw r26, r12 13566: 8d 91 ld r24, X+ 13568: 6d 01 movw r12, r26 1356a: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 1356e: f5 01 movw r30, r10 13570: 81 93 st Z+, r24 13572: 5f 01 movw r10, r30 if(codes[i]) 13574: 88 23 and r24, r24 13576: 41 f0 breq .+16 ; 0x13588 values[i] = code_value(); 13578: 0e 94 b5 60 call 0xc16a ; 0xc16a 1357c: d7 01 movw r26, r14 1357e: 6d 93 st X+, r22 13580: 7d 93 st X+, r23 13582: 8d 93 st X+, r24 13584: 9c 93 st X, r25 13586: 13 97 sbiw r26, 0x03 ; 3 13588: b4 e0 ldi r27, 0x04 ; 4 1358a: eb 0e add r14, r27 1358c: f1 1c adc r15, r1 { bool codes[NUM_AXIS]; float values[NUM_AXIS]; // Check which axes need to be set for(uint8_t i = 0; i < NUM_AXIS; ++i) 1358e: 8c 14 cp r8, r12 13590: 9d 04 cpc r9, r13 13592: 41 f7 brne .-48 ; 0x13564 codes[i] = code_seen(axis_codes[i]); if(codes[i]) values[i] = code_value(); } if((codes[E_AXIS] && values[E_AXIS] == 0) && 13594: f8 01 movw r30, r16 13596: d3 80 ldd r13, Z+3 ; 0x03 13598: dd 20 and r13, r13 1359a: 11 f4 brne .+4 ; 0x135a0 1359c: 0c 94 4c a4 jmp 0x14898 ; 0x14898 135a0: 20 e0 ldi r18, 0x00 ; 0 135a2: 30 e0 ldi r19, 0x00 ; 0 135a4: a9 01 movw r20, r18 135a6: 6d 85 ldd r22, Y+13 ; 0x0d 135a8: 7e 85 ldd r23, Y+14 ; 0x0e 135aa: 8f 85 ldd r24, Y+15 ; 0x0f 135ac: 98 89 ldd r25, Y+16 ; 0x10 135ae: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 135b2: 81 11 cpse r24, r1 135b4: 0c 94 4c a4 jmp 0x14898 ; 0x14898 135b8: d8 01 movw r26, r16 135ba: 8c 91 ld r24, X 135bc: 81 11 cpse r24, r1 135be: 0c 94 4c a4 jmp 0x14898 ; 0x14898 (!codes[X_AXIS] && !codes[Y_AXIS] && !codes[Z_AXIS])) 135c2: 11 96 adiw r26, 0x01 ; 1 135c4: 8c 91 ld r24, X 135c6: 11 97 sbiw r26, 0x01 ; 1 135c8: 81 11 cpse r24, r1 135ca: 0c 94 4c a4 jmp 0x14898 ; 0x14898 135ce: 12 96 adiw r26, 0x02 ; 2 135d0: 8c 91 ld r24, X 135d2: 81 11 cpse r24, r1 135d4: 0c 94 4c a4 jmp 0x14898 ; 0x14898 { // 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; 135d8: 10 92 9d 06 sts 0x069D, r1 ; 0x80069d 135dc: 10 92 9e 06 sts 0x069E, r1 ; 0x80069e 135e0: 10 92 9f 06 sts 0x069F, r1 ; 0x80069f 135e4: 10 92 a0 06 sts 0x06A0, r1 ; 0x8006a0 st_set_e_position(position[E_AXIS]); } void plan_reset_next_e() { plan_reset_next_e_queue = true; 135e8: 81 e0 ldi r24, 0x01 ; 1 135ea: 80 93 b7 04 sts 0x04B7, r24 ; 0x8004b7 <_ZL23plan_reset_next_e_queue.lto_priv.486> 135ee: 9b cf rjmp .-202 ; 0x13526 #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 135f0: 2d ec ldi r18, 0xCD ; 205 135f2: 3c ec ldi r19, 0xCC ; 204 135f4: 4c ec ldi r20, 0xCC ; 204 135f6: 5d e3 ldi r21, 0x3D ; 61 135f8: c7 01 movw r24, r14 135fa: b6 01 movw r22, r12 135fc: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 13600: 18 16 cp r1, r24 13602: 24 f4 brge .+8 ; 0x1360c 13604: 80 91 8d 06 lds r24, 0x068D ; 0x80068d 13608: 81 11 cpse r24, r1 1360a: 92 ce rjmp .-732 ; 0x13330 } } } #endif //FWRETRACT prepare_move(start_segment_idx); 1360c: c8 01 movw r24, r16 1360e: 0e 94 20 6c call 0xd840 ; 0xd840 13612: 89 cf rjmp .-238 ; 0x13526 */ case 2: case 3: { uint16_t start_segment_idx = restore_interrupted_gcode(); 13614: 0e 94 8b 5a call 0xb516 ; 0xb516 13618: e0 96 adiw r28, 0x30 ; 48 1361a: 9f af std Y+63, r25 ; 0x3f 1361c: 8e af std Y+62, r24 ; 0x3e 1361e: e0 97 sbiw r28, 0x30 ; 48 #ifdef SF_ARC_FIX bool relative_mode_backup = relative_mode; relative_mode = true; #endif get_coordinates(); // For X Y Z E F 13620: 0e 94 dc 61 call 0xc3b8 ; 0xc3b8 #ifdef SF_ARC_FIX relative_mode=relative_mode_backup; #endif offset[0] = code_seen('I') ? code_value() : 0.f; 13624: 89 e4 ldi r24, 0x49 ; 73 13626: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 1362a: 88 23 and r24, r24 1362c: 09 f4 brne .+2 ; 0x13630 1362e: 00 c4 rjmp .+2048 ; 0x13e30 13630: 0e 94 b5 60 call 0xc16a ; 0xc16a 13634: 60 93 89 03 sts 0x0389, r22 ; 0x800389 13638: 70 93 8a 03 sts 0x038A, r23 ; 0x80038a 1363c: 80 93 8b 03 sts 0x038B, r24 ; 0x80038b 13640: 90 93 8c 03 sts 0x038C, r25 ; 0x80038c offset[1] = code_seen('J') ? code_value() : 0.f; 13644: 8a e4 ldi r24, 0x4A ; 74 13646: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 1364a: c1 2c mov r12, r1 1364c: d1 2c mov r13, r1 1364e: 76 01 movw r14, r12 13650: 88 23 and r24, r24 13652: 21 f0 breq .+8 ; 0x1365c 13654: 0e 94 b5 60 call 0xc16a ; 0xc16a 13658: 6b 01 movw r12, r22 1365a: 7c 01 movw r14, r24 1365c: c0 92 8d 03 sts 0x038D, r12 ; 0x80038d 13660: d0 92 8e 03 sts 0x038E, r13 ; 0x80038e 13664: e0 92 8f 03 sts 0x038F, r14 ; 0x80038f 13668: f0 92 90 03 sts 0x0390, r15 ; 0x800390 prepare_arc_move((gcode_in_progress == 2), start_segment_idx); 1366c: e0 91 91 03 lds r30, 0x0391 ; 0x800391 13670: f0 91 92 03 lds r31, 0x0392 ; 0x800392 13674: c2 57 subi r28, 0x72 ; 114 13676: df 4f sbci r29, 0xFF ; 255 13678: f9 83 std Y+1, r31 ; 0x01 1367a: e8 83 st Y, r30 1367c: ce 58 subi r28, 0x8E ; 142 1367e: d0 40 sbci r29, 0x00 ; 0 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 13680: 80 90 89 03 lds r8, 0x0389 ; 0x800389 13684: 90 90 8a 03 lds r9, 0x038A ; 0x80038a 13688: a0 90 8b 03 lds r10, 0x038B ; 0x80038b 1368c: b0 90 8c 03 lds r11, 0x038C ; 0x80038c 13690: a7 01 movw r20, r14 13692: 96 01 movw r18, r12 13694: c5 01 movw r24, r10 13696: b4 01 movw r22, r8 13698: 0f 94 9b df call 0x3bf36 ; 0x3bf36 1369c: ae 96 adiw r28, 0x2e ; 46 1369e: 6c af std Y+60, r22 ; 0x3c 136a0: 7d af std Y+61, r23 ; 0x3d 136a2: 8e af std Y+62, r24 ; 0x3e 136a4: 9f af std Y+63, r25 ; 0x3f 136a6: ae 97 sbiw r28, 0x2e ; 46 // Trace the arc mc_arc(current_position, destination, offset, (feedrate * feedmultiply) * (1.f / 6000.f), r, isclockwise, start_segment_idx); 136a8: 60 91 39 02 lds r22, 0x0239 ; 0x800239 136ac: 70 91 3a 02 lds r23, 0x023A ; 0x80023a 136b0: 07 2e mov r0, r23 136b2: 00 0c add r0, r0 136b4: 88 0b sbc r24, r24 136b6: 99 0b sbc r25, r25 136b8: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 136bc: 20 91 b8 02 lds r18, 0x02B8 ; 0x8002b8 136c0: 30 91 b9 02 lds r19, 0x02B9 ; 0x8002b9 136c4: 40 91 ba 02 lds r20, 0x02BA ; 0x8002ba 136c8: 50 91 bb 02 lds r21, 0x02BB ; 0x8002bb 136cc: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 136d0: 2e e3 ldi r18, 0x3E ; 62 136d2: 33 ec ldi r19, 0xC3 ; 195 136d4: 4e e2 ldi r20, 0x2E ; 46 136d6: 59 e3 ldi r21, 0x39 ; 57 136d8: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 136dc: aa 96 adiw r28, 0x2a ; 42 136de: 6c af std Y+60, r22 ; 0x3c 136e0: 7d af std Y+61, r23 ; 0x3d 136e2: 8e af std Y+62, r24 ; 0x3e 136e4: 9f af std Y+63, r25 ; 0x3f 136e6: aa 97 sbiw r28, 0x2a ; 42 // 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)); 136e8: 80 e1 ldi r24, 0x10 ; 16 136ea: e1 e9 ldi r30, 0x91 ; 145 136ec: f6 e0 ldi r31, 0x06 ; 6 136ee: de 01 movw r26, r28 136f0: 11 96 adiw r26, 0x01 ; 1 136f2: 01 90 ld r0, Z+ 136f4: 0d 92 st X+, r0 136f6: 8a 95 dec r24 136f8: e1 f7 brne .-8 ; 0x136f2 float r_axis_x = -offset[X_AXIS]; // Radius vector from center to current location 136fa: a5 01 movw r20, r10 136fc: 94 01 movw r18, r8 136fe: 50 58 subi r21, 0x80 ; 128 13700: 6e 96 adiw r28, 0x1e ; 30 13702: 2c af std Y+60, r18 ; 0x3c 13704: 3d af std Y+61, r19 ; 0x3d 13706: 4e af std Y+62, r20 ; 0x3e 13708: 5f af std Y+63, r21 ; 0x3f 1370a: 6e 97 sbiw r28, 0x1e ; 30 float r_axis_y = -offset[Y_AXIS]; 1370c: d7 01 movw r26, r14 1370e: c6 01 movw r24, r12 13710: b0 58 subi r27, 0x80 ; 128 13712: 6a 96 adiw r28, 0x1a ; 26 13714: 8c af std Y+60, r24 ; 0x3c 13716: 9d af std Y+61, r25 ; 0x3d 13718: ae af std Y+62, r26 ; 0x3e 1371a: bf af std Y+63, r27 ; 0x3f 1371c: 6a 97 sbiw r28, 0x1a ; 26 float center_axis_x = start_position[X_AXIS] - r_axis_x; 1371e: 29 81 ldd r18, Y+1 ; 0x01 13720: 3a 81 ldd r19, Y+2 ; 0x02 13722: 4b 81 ldd r20, Y+3 ; 0x03 13724: 5c 81 ldd r21, Y+4 ; 0x04 13726: e6 96 adiw r28, 0x36 ; 54 13728: 2c af std Y+60, r18 ; 0x3c 1372a: 3d af std Y+61, r19 ; 0x3d 1372c: 4e af std Y+62, r20 ; 0x3e 1372e: 5f af std Y+63, r21 ; 0x3f 13730: e6 97 sbiw r28, 0x36 ; 54 13732: c5 01 movw r24, r10 13734: b4 01 movw r22, r8 13736: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 1373a: ea 96 adiw r28, 0x3a ; 58 1373c: 6c af std Y+60, r22 ; 0x3c 1373e: 7d af std Y+61, r23 ; 0x3d 13740: 8e af std Y+62, r24 ; 0x3e 13742: 9f af std Y+63, r25 ; 0x3f 13744: ea 97 sbiw r28, 0x3a ; 58 float center_axis_y = start_position[Y_AXIS] - r_axis_y; 13746: 8d 81 ldd r24, Y+5 ; 0x05 13748: 9e 81 ldd r25, Y+6 ; 0x06 1374a: af 81 ldd r26, Y+7 ; 0x07 1374c: b8 85 ldd r27, Y+8 ; 0x08 1374e: ee 96 adiw r28, 0x3e ; 62 13750: 8c af std Y+60, r24 ; 0x3c 13752: 9d af std Y+61, r25 ; 0x3d 13754: ae af std Y+62, r26 ; 0x3e 13756: bf af std Y+63, r27 ; 0x3f 13758: ee 97 sbiw r28, 0x3e ; 62 1375a: 9c 01 movw r18, r24 1375c: ad 01 movw r20, r26 1375e: c7 01 movw r24, r14 13760: b6 01 movw r22, r12 13762: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 13766: ce 57 subi r28, 0x7E ; 126 13768: df 4f sbci r29, 0xFF ; 255 1376a: 68 83 st Y, r22 1376c: 79 83 std Y+1, r23 ; 0x01 1376e: 8a 83 std Y+2, r24 ; 0x02 13770: 9b 83 std Y+3, r25 ; 0x03 13772: c2 58 subi r28, 0x82 ; 130 13774: d0 40 sbci r29, 0x00 ; 0 float travel_z = target[Z_AXIS] - start_position[Z_AXIS]; 13776: 29 85 ldd r18, Y+9 ; 0x09 13778: 3a 85 ldd r19, Y+10 ; 0x0a 1377a: 4b 85 ldd r20, Y+11 ; 0x0b 1377c: 5c 85 ldd r21, Y+12 ; 0x0c 1377e: 60 91 7b 06 lds r22, 0x067B ; 0x80067b 13782: 70 91 7c 06 lds r23, 0x067C ; 0x80067c 13786: 80 91 7d 06 lds r24, 0x067D ; 0x80067d 1378a: 90 91 7e 06 lds r25, 0x067E ; 0x80067e 1378e: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 13792: c2 58 subi r28, 0x82 ; 130 13794: df 4f sbci r29, 0xFF ; 255 13796: 68 83 st Y, r22 13798: 79 83 std Y+1, r23 ; 0x01 1379a: 8a 83 std Y+2, r24 ; 0x02 1379c: 9b 83 std Y+3, r25 ; 0x03 1379e: ce 57 subi r28, 0x7E ; 126 137a0: d0 40 sbci r29, 0x00 ; 0 float rt_x = target[X_AXIS] - center_axis_x; 137a2: 20 91 73 06 lds r18, 0x0673 ; 0x800673 137a6: 30 91 74 06 lds r19, 0x0674 ; 0x800674 137aa: 40 91 75 06 lds r20, 0x0675 ; 0x800675 137ae: 50 91 76 06 lds r21, 0x0676 ; 0x800676 137b2: ca 57 subi r28, 0x7A ; 122 137b4: df 4f sbci r29, 0xFF ; 255 137b6: 28 83 st Y, r18 137b8: 39 83 std Y+1, r19 ; 0x01 137ba: 4a 83 std Y+2, r20 ; 0x02 137bc: 5b 83 std Y+3, r21 ; 0x03 137be: c6 58 subi r28, 0x86 ; 134 137c0: d0 40 sbci r29, 0x00 ; 0 137c2: ea 96 adiw r28, 0x3a ; 58 137c4: 2c ad ldd r18, Y+60 ; 0x3c 137c6: 3d ad ldd r19, Y+61 ; 0x3d 137c8: 4e ad ldd r20, Y+62 ; 0x3e 137ca: 5f ad ldd r21, Y+63 ; 0x3f 137cc: ea 97 sbiw r28, 0x3a ; 58 137ce: ca 57 subi r28, 0x7A ; 122 137d0: df 4f sbci r29, 0xFF ; 255 137d2: 68 81 ld r22, Y 137d4: 79 81 ldd r23, Y+1 ; 0x01 137d6: 8a 81 ldd r24, Y+2 ; 0x02 137d8: 9b 81 ldd r25, Y+3 ; 0x03 137da: c6 58 subi r28, 0x86 ; 134 137dc: d0 40 sbci r29, 0x00 ; 0 137de: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 137e2: 6b 01 movw r12, r22 137e4: 7c 01 movw r14, r24 float rt_y = target[Y_AXIS] - center_axis_y; 137e6: 80 91 77 06 lds r24, 0x0677 ; 0x800677 137ea: 90 91 78 06 lds r25, 0x0678 ; 0x800678 137ee: a0 91 79 06 lds r26, 0x0679 ; 0x800679 137f2: b0 91 7a 06 lds r27, 0x067A ; 0x80067a 137f6: c6 57 subi r28, 0x76 ; 118 137f8: df 4f sbci r29, 0xFF ; 255 137fa: 88 83 st Y, r24 137fc: 99 83 std Y+1, r25 ; 0x01 137fe: aa 83 std Y+2, r26 ; 0x02 13800: bb 83 std Y+3, r27 ; 0x03 13802: ca 58 subi r28, 0x8A ; 138 13804: d0 40 sbci r29, 0x00 ; 0 13806: ce 57 subi r28, 0x7E ; 126 13808: df 4f sbci r29, 0xFF ; 255 1380a: 28 81 ld r18, Y 1380c: 39 81 ldd r19, Y+1 ; 0x01 1380e: 4a 81 ldd r20, Y+2 ; 0x02 13810: 5b 81 ldd r21, Y+3 ; 0x03 13812: c2 58 subi r28, 0x82 ; 130 13814: d0 40 sbci r29, 0x00 ; 0 13816: bc 01 movw r22, r24 13818: cd 01 movw r24, r26 1381a: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 1381e: 4b 01 movw r8, r22 13820: 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; 13822: 30 90 81 0e lds r3, 0x0E81 ; 0x800e81 13826: 20 90 82 0e lds r2, 0x0E82 ; 0x800e82 1382a: 90 91 83 0e lds r25, 0x0E83 ; 0x800e83 1382e: 6f 96 adiw r28, 0x1f ; 31 13830: 9f af std Y+63, r25 ; 0x3f 13832: 6f 97 sbiw r28, 0x1f ; 31 13834: a0 91 84 0e lds r26, 0x0E84 ; 0x800e84 13838: a3 96 adiw r28, 0x23 ; 35 1383a: af af std Y+63, r26 ; 0x3f 1383c: a3 97 sbiw r28, 0x23 ; 35 // 20210109 - Add a variable to hold the n_arc_correction value unsigned char n_arc_correction = cs.n_arc_correction; // 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); 1383e: a7 01 movw r20, r14 13840: 96 01 movw r18, r12 13842: 6e 96 adiw r28, 0x1e ; 30 13844: 6c ad ldd r22, Y+60 ; 0x3c 13846: 7d ad ldd r23, Y+61 ; 0x3d 13848: 8e ad ldd r24, Y+62 ; 0x3e 1384a: 9f ad ldd r25, Y+63 ; 0x3f 1384c: 6e 97 sbiw r28, 0x1e ; 30 1384e: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 13852: 2b 01 movw r4, r22 13854: 3c 01 movw r6, r24 13856: a5 01 movw r20, r10 13858: 94 01 movw r18, r8 1385a: 6a 96 adiw r28, 0x1a ; 26 1385c: 6c ad ldd r22, Y+60 ; 0x3c 1385e: 7d ad ldd r23, Y+61 ; 0x3d 13860: 8e ad ldd r24, Y+62 ; 0x3e 13862: 9f ad ldd r25, Y+63 ; 0x3f 13864: 6a 97 sbiw r28, 0x1a ; 26 13866: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 1386a: 9b 01 movw r18, r22 1386c: ac 01 movw r20, r24 1386e: c3 01 movw r24, r6 13870: b2 01 movw r22, r4 13872: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 13876: 2b 01 movw r4, r22 13878: 3c 01 movw r6, r24 1387a: a5 01 movw r20, r10 1387c: 94 01 movw r18, r8 1387e: 6e 96 adiw r28, 0x1e ; 30 13880: 6c ad ldd r22, Y+60 ; 0x3c 13882: 7d ad ldd r23, Y+61 ; 0x3d 13884: 8e ad ldd r24, Y+62 ; 0x3e 13886: 9f ad ldd r25, Y+63 ; 0x3f 13888: 6e 97 sbiw r28, 0x1e ; 30 1388a: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 1388e: 4b 01 movw r8, r22 13890: 5c 01 movw r10, r24 13892: a7 01 movw r20, r14 13894: 96 01 movw r18, r12 13896: 6a 96 adiw r28, 0x1a ; 26 13898: 6c ad ldd r22, Y+60 ; 0x3c 1389a: 7d ad ldd r23, Y+61 ; 0x3d 1389c: 8e ad ldd r24, Y+62 ; 0x3e 1389e: 9f ad ldd r25, Y+63 ; 0x3f 138a0: 6a 97 sbiw r28, 0x1a ; 26 138a2: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 138a6: 9b 01 movw r18, r22 138a8: ac 01 movw r20, r24 138aa: c5 01 movw r24, r10 138ac: b4 01 movw r22, r8 138ae: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 138b2: a3 01 movw r20, r6 138b4: 92 01 movw r18, r4 138b6: 0f 94 7e dd call 0x3bafc ; 0x3bafc 138ba: 6b 01 movw r12, r22 138bc: 7c 01 movw r14, r24 if (angular_travel_total < 0) { angular_travel_total += 2 * M_PI; } 138be: 20 e0 ldi r18, 0x00 ; 0 138c0: 30 e0 ldi r19, 0x00 ; 0 138c2: a9 01 movw r20, r18 138c4: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 138c8: 87 ff sbrs r24, 7 138ca: 0a c0 rjmp .+20 ; 0x138e0 138cc: 2b ed ldi r18, 0xDB ; 219 138ce: 3f e0 ldi r19, 0x0F ; 15 138d0: 49 ec ldi r20, 0xC9 ; 201 138d2: 50 e4 ldi r21, 0x40 ; 64 138d4: c7 01 movw r24, r14 138d6: b6 01 movw r22, r12 138d8: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 138dc: 6b 01 movw r12, r22 138de: 7c 01 movw r14, r24 if (cs.min_arc_segments > 0) 138e0: 60 91 8a 0e lds r22, 0x0E8A ; 0x800e8a 138e4: 70 91 8b 0e lds r23, 0x0E8B ; 0x800e8b 138e8: 61 15 cp r22, r1 138ea: 71 05 cpc r23, r1 138ec: 09 f4 brne .+2 ; 0x138f0 138ee: a4 c2 rjmp .+1352 ; 0x13e38 { // 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); 138f0: 90 e0 ldi r25, 0x00 ; 0 138f2: 80 e0 ldi r24, 0x00 ; 0 138f4: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 138f8: 9b 01 movw r18, r22 138fa: ac 01 movw r20, r24 138fc: 6b ed ldi r22, 0xDB ; 219 138fe: 7f e0 ldi r23, 0x0F ; 15 13900: 89 ec ldi r24, 0xC9 ; 201 13902: 90 e4 ldi r25, 0x40 ; 64 13904: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 13908: ae 96 adiw r28, 0x2e ; 46 1390a: 2c ad ldd r18, Y+60 ; 0x3c 1390c: 3d ad ldd r19, Y+61 ; 0x3d 1390e: 4e ad ldd r20, Y+62 ; 0x3e 13910: 5f ad ldd r21, Y+63 ; 0x3f 13912: ae 97 sbiw r28, 0x2e ; 46 13914: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 13918: 5b 01 movw r10, r22 1391a: 8c 01 movw r16, r24 } if (cs.arc_segments_per_sec > 0) 1391c: 60 91 8c 0e lds r22, 0x0E8C ; 0x800e8c 13920: 70 91 8d 0e lds r23, 0x0E8D ; 0x800e8d 13924: 61 15 cp r22, r1 13926: 71 05 cpc r23, r1 13928: f1 f0 breq .+60 ; 0x13966 { // 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)); 1392a: 90 e0 ldi r25, 0x00 ; 0 1392c: 80 e0 ldi r24, 0x00 ; 0 1392e: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 13932: 20 e0 ldi r18, 0x00 ; 0 13934: 30 e0 ldi r19, 0x00 ; 0 13936: 40 e7 ldi r20, 0x70 ; 112 13938: 52 e4 ldi r21, 0x42 ; 66 1393a: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 1393e: 9b 01 movw r18, r22 13940: ac 01 movw r20, r24 13942: aa 96 adiw r28, 0x2a ; 42 13944: 6c ad ldd r22, Y+60 ; 0x3c 13946: 7d ad ldd r23, Y+61 ; 0x3d 13948: 8e ad ldd r24, Y+62 ; 0x3e 1394a: 9f ad ldd r25, Y+63 ; 0x3f 1394c: aa 97 sbiw r28, 0x2a ; 42 1394e: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 13952: 3b 01 movw r6, r22 13954: 4c 01 movw r8, r24 if (mm_per_arc_segment_sec < mm_per_arc_segment) 13956: 95 01 movw r18, r10 13958: a8 01 movw r20, r16 1395a: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 1395e: 87 ff sbrs r24, 7 13960: 02 c0 rjmp .+4 ; 0x13966 mm_per_arc_segment = mm_per_arc_segment_sec; 13962: 53 01 movw r10, r6 13964: 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) 13966: 40 90 85 0e lds r4, 0x0E85 ; 0x800e85 1396a: 50 90 86 0e lds r5, 0x0E86 ; 0x800e86 1396e: 60 90 87 0e lds r6, 0x0E87 ; 0x800e87 13972: 70 90 88 0e lds r7, 0x0E88 ; 0x800e88 13976: 95 01 movw r18, r10 13978: a8 01 movw r20, r16 1397a: b2 01 movw r22, r4 1397c: c3 01 movw r24, r6 1397e: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 13982: 18 16 cp r1, r24 13984: c4 f0 brlt .+48 ; 0x139b6 { // 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) { 13986: 95 01 movw r18, r10 13988: a8 01 movw r20, r16 1398a: 63 2d mov r22, r3 1398c: 72 2d mov r23, r2 1398e: 6f 96 adiw r28, 0x1f ; 31 13990: 8f ad ldd r24, Y+63 ; 0x3f 13992: 6f 97 sbiw r28, 0x1f ; 31 13994: a3 96 adiw r28, 0x23 ; 35 13996: 9f ad ldd r25, Y+63 ; 0x3f 13998: a3 97 sbiw r28, 0x23 ; 35 1399a: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 1399e: 25 01 movw r4, r10 139a0: 38 01 movw r6, r16 139a2: 87 ff sbrs r24, 7 139a4: 08 c0 rjmp .+16 ; 0x139b6 // 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; 139a6: 43 2c mov r4, r3 139a8: 52 2c mov r5, r2 139aa: 6f 96 adiw r28, 0x1f ; 31 139ac: 6f ac ldd r6, Y+63 ; 0x3f 139ae: 6f 97 sbiw r28, 0x1f ; 31 139b0: a3 96 adiw r28, 0x23 ; 35 139b2: 7f ac ldd r7, Y+63 ; 0x3f 139b4: a3 97 sbiw r28, 0x23 ; 35 } // Adjust the angular travel if the direction is clockwise if (isclockwise) { angular_travel_total -= 2 * M_PI; } 139b6: c2 57 subi r28, 0x72 ; 114 139b8: df 4f sbci r29, 0xFF ; 255 139ba: e8 81 ld r30, Y 139bc: f9 81 ldd r31, Y+1 ; 0x01 139be: ce 58 subi r28, 0x8E ; 142 139c0: d0 40 sbci r29, 0x00 ; 0 139c2: 32 97 sbiw r30, 0x02 ; 2 139c4: 51 f4 brne .+20 ; 0x139da 139c6: 2b ed ldi r18, 0xDB ; 219 139c8: 3f e0 ldi r19, 0x0F ; 15 139ca: 49 ec ldi r20, 0xC9 ; 201 139cc: 50 e4 ldi r21, 0x40 ; 64 139ce: c7 01 movw r24, r14 139d0: b6 01 movw r22, r12 139d2: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 139d6: 6b 01 movw r12, r22 139d8: 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) 139da: ca 57 subi r28, 0x7A ; 122 139dc: df 4f sbci r29, 0xFF ; 255 139de: 28 81 ld r18, Y 139e0: 39 81 ldd r19, Y+1 ; 0x01 139e2: 4a 81 ldd r20, Y+2 ; 0x02 139e4: 5b 81 ldd r21, Y+3 ; 0x03 139e6: c6 58 subi r28, 0x86 ; 134 139e8: d0 40 sbci r29, 0x00 ; 0 139ea: e6 96 adiw r28, 0x36 ; 54 139ec: 6c ad ldd r22, Y+60 ; 0x3c 139ee: 7d ad ldd r23, Y+61 ; 0x3d 139f0: 8e ad ldd r24, Y+62 ; 0x3e 139f2: 9f ad ldd r25, Y+63 ; 0x3f 139f4: e6 97 sbiw r28, 0x36 ; 54 139f6: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 139fa: 81 11 cpse r24, r1 139fc: 25 c0 rjmp .+74 ; 0x13a48 139fe: c6 57 subi r28, 0x76 ; 118 13a00: df 4f sbci r29, 0xFF ; 255 13a02: 28 81 ld r18, Y 13a04: 39 81 ldd r19, Y+1 ; 0x01 13a06: 4a 81 ldd r20, Y+2 ; 0x02 13a08: 5b 81 ldd r21, Y+3 ; 0x03 13a0a: ca 58 subi r28, 0x8A ; 138 13a0c: d0 40 sbci r29, 0x00 ; 0 13a0e: ee 96 adiw r28, 0x3e ; 62 13a10: 6c ad ldd r22, Y+60 ; 0x3c 13a12: 7d ad ldd r23, Y+61 ; 0x3d 13a14: 8e ad ldd r24, Y+62 ; 0x3e 13a16: 9f ad ldd r25, Y+63 ; 0x3f 13a18: ee 97 sbiw r28, 0x3e ; 62 13a1a: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 13a1e: 81 11 cpse r24, r1 13a20: 13 c0 rjmp .+38 ; 0x13a48 13a22: 20 e0 ldi r18, 0x00 ; 0 13a24: 30 e0 ldi r19, 0x00 ; 0 13a26: a9 01 movw r20, r18 13a28: c7 01 movw r24, r14 13a2a: b6 01 movw r22, r12 13a2c: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 13a30: 81 11 cpse r24, r1 13a32: 0a c0 rjmp .+20 ; 0x13a48 { angular_travel_total += 2 * M_PI; 13a34: 2b ed ldi r18, 0xDB ; 219 13a36: 3f e0 ldi r19, 0x0F ; 15 13a38: 49 ec ldi r20, 0xC9 ; 201 13a3a: 50 e4 ldi r21, 0x40 ; 64 13a3c: c7 01 movw r24, r14 13a3e: b6 01 movw r22, r12 13a40: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 13a44: 6b 01 movw r12, r22 13a46: 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)); 13a48: a7 01 movw r20, r14 13a4a: 96 01 movw r18, r12 13a4c: ae 96 adiw r28, 0x2e ; 46 13a4e: 6c ad ldd r22, Y+60 ; 0x3c 13a50: 7d ad ldd r23, Y+61 ; 0x3d 13a52: 8e ad ldd r24, Y+62 ; 0x3e 13a54: 9f ad ldd r25, Y+63 ; 0x3f 13a56: ae 97 sbiw r28, 0x2e ; 46 13a58: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 13a5c: c2 58 subi r28, 0x82 ; 130 13a5e: df 4f sbci r29, 0xFF ; 255 13a60: 28 81 ld r18, Y 13a62: 39 81 ldd r19, Y+1 ; 0x01 13a64: 4a 81 ldd r20, Y+2 ; 0x02 13a66: 5b 81 ldd r21, Y+3 ; 0x03 13a68: ce 57 subi r28, 0x7E ; 126 13a6a: d0 40 sbci r29, 0x00 ; 0 13a6c: 0f 94 9b df call 0x3bf36 ; 0x3bf36 13a70: 4b 01 movw r8, r22 13a72: 5c 01 movw r10, r24 if (millimeters_of_travel_arc < 0.001) { return; } 13a74: 2f e6 ldi r18, 0x6F ; 111 13a76: 32 e1 ldi r19, 0x12 ; 18 13a78: 43 e8 ldi r20, 0x83 ; 131 13a7a: 5a e3 ldi r21, 0x3A ; 58 13a7c: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 13a80: 87 fd sbrc r24, 7 13a82: cf c1 rjmp .+926 ; 0x13e22 // Calculate the number of arc segments unsigned short segments = static_cast(ceil(millimeters_of_travel_arc / mm_per_arc_segment)); 13a84: 92 01 movw r18, r4 13a86: a3 01 movw r20, r6 13a88: c5 01 movw r24, r10 13a8a: b4 01 movw r22, r8 13a8c: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 13a90: 0f 94 dd dd call 0x3bbba ; 0x3bbba 13a94: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 13a98: a4 96 adiw r28, 0x24 ; 36 13a9a: 7f af std Y+63, r23 ; 0x3f 13a9c: 6e af std Y+62, r22 ; 0x3e 13a9e: a4 97 sbiw r28, 0x24 ; 36 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) 13aa0: 62 30 cpi r22, 0x02 ; 2 13aa2: 71 05 cpc r23, r1 13aa4: 08 f4 brcc .+2 ; 0x13aa8 13aa6: 8b c1 rjmp .+790 ; 0x13dbe 13aa8: e0 96 adiw r28, 0x30 ; 48 13aaa: 4e ad ldd r20, Y+62 ; 0x3e 13aac: 5f ad ldd r21, Y+63 ; 0x3f 13aae: e0 97 sbiw r28, 0x30 ; 48 13ab0: 45 2b or r20, r21 13ab2: 09 f4 brne .+2 ; 0x13ab6 13ab4: 84 c1 rjmp .+776 ; 0x13dbe 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; // 20210109 - Add a variable to hold the n_arc_correction value unsigned char n_arc_correction = cs.n_arc_correction; 13ab6: 50 91 89 0e lds r21, 0x0E89 ; 0x800e89 13aba: 6f 96 adiw r28, 0x1f ; 31 13abc: 5f af std Y+63, r21 ; 0x3f 13abe: 6f 97 sbiw r28, 0x1f ; 31 // 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) { // 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, 13ac0: 90 e0 ldi r25, 0x00 ; 0 13ac2: 80 e0 ldi r24, 0x00 ; 0 13ac4: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 13ac8: 4b 01 movw r8, r22 13aca: 5c 01 movw r10, r24 13acc: ac 01 movw r20, r24 13ace: 9b 01 movw r18, r22 13ad0: c7 01 movw r24, r14 13ad2: b6 01 movw r22, r12 13ad4: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 13ad8: 2b 01 movw r4, r22 13ada: 3c 01 movw r6, r24 linear_per_segment = travel_z / (segments), 13adc: a5 01 movw r20, r10 13ade: 94 01 movw r18, r8 13ae0: c2 58 subi r28, 0x82 ; 130 13ae2: df 4f sbci r29, 0xFF ; 255 13ae4: 68 81 ld r22, Y 13ae6: 79 81 ldd r23, Y+1 ; 0x01 13ae8: 8a 81 ldd r24, Y+2 ; 0x02 13aea: 9b 81 ldd r25, Y+3 ; 0x03 13aec: ce 57 subi r28, 0x7E ; 126 13aee: d0 40 sbci r29, 0x00 ; 0 13af0: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 13af4: ee 96 adiw r28, 0x3e ; 62 13af6: 6c af std Y+60, r22 ; 0x3c 13af8: 7d af std Y+61, r23 ; 0x3d 13afa: 8e af std Y+62, r24 ; 0x3e 13afc: 9f af std Y+63, r25 ; 0x3f 13afe: ee 97 sbiw r28, 0x3e ; 62 segment_extruder_travel = (target[E_AXIS] - start_position[E_AXIS]) / (segments), 13b00: 2d 85 ldd r18, Y+13 ; 0x0d 13b02: 3e 85 ldd r19, Y+14 ; 0x0e 13b04: 4f 85 ldd r20, Y+15 ; 0x0f 13b06: 58 89 ldd r21, Y+16 ; 0x10 13b08: 60 91 7f 06 lds r22, 0x067F ; 0x80067f 13b0c: 70 91 80 06 lds r23, 0x0680 ; 0x800680 13b10: 80 91 81 06 lds r24, 0x0681 ; 0x800681 13b14: 90 91 82 06 lds r25, 0x0682 ; 0x800682 13b18: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 13b1c: a5 01 movw r20, r10 13b1e: 94 01 movw r18, r8 13b20: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 13b24: c2 58 subi r28, 0x82 ; 130 13b26: df 4f sbci r29, 0xFF ; 255 13b28: 68 83 st Y, r22 13b2a: 79 83 std Y+1, r23 ; 0x01 13b2c: 8a 83 std Y+2, r24 ; 0x02 13b2e: 9b 83 std Y+3, r25 ; 0x03 13b30: ce 57 subi r28, 0x7E ; 126 13b32: d0 40 sbci r29, 0x00 ; 0 sq_theta_per_segment = theta_per_segment * theta_per_segment, 13b34: a3 01 movw r20, r6 13b36: 92 01 movw r18, r4 13b38: c3 01 movw r24, r6 13b3a: b2 01 movw r22, r4 13b3c: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 13b40: 6b 01 movw r12, r22 13b42: 7c 01 movw r14, r24 sin_T = theta_per_segment - sq_theta_per_segment * theta_per_segment / 6, 13b44: ac 01 movw r20, r24 13b46: 9b 01 movw r18, r22 13b48: c3 01 movw r24, r6 13b4a: b2 01 movw r22, r4 13b4c: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 13b50: 20 e0 ldi r18, 0x00 ; 0 13b52: 30 e0 ldi r19, 0x00 ; 0 13b54: 40 ec ldi r20, 0xC0 ; 192 13b56: 50 e4 ldi r21, 0x40 ; 64 13b58: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 13b5c: 9b 01 movw r18, r22 13b5e: ac 01 movw r20, r24 13b60: c3 01 movw r24, r6 13b62: b2 01 movw r22, r4 13b64: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 13b68: ae 96 adiw r28, 0x2e ; 46 13b6a: 6c af std Y+60, r22 ; 0x3c 13b6c: 7d af std Y+61, r23 ; 0x3d 13b6e: 8e af std Y+62, r24 ; 0x3e 13b70: 9f af std Y+63, r25 ; 0x3f 13b72: ae 97 sbiw r28, 0x2e ; 46 cos_T = 1 - 0.5f * sq_theta_per_segment; 13b74: 20 e0 ldi r18, 0x00 ; 0 13b76: 30 e0 ldi r19, 0x00 ; 0 13b78: 40 e0 ldi r20, 0x00 ; 0 13b7a: 5f e3 ldi r21, 0x3F ; 63 13b7c: c7 01 movw r24, r14 13b7e: b6 01 movw r22, r12 13b80: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 13b84: 9b 01 movw r18, r22 13b86: ac 01 movw r20, r24 13b88: 60 e0 ldi r22, 0x00 ; 0 13b8a: 70 e0 ldi r23, 0x00 ; 0 13b8c: 80 e8 ldi r24, 0x80 ; 128 13b8e: 9f e3 ldi r25, 0x3F ; 63 13b90: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 13b94: e6 96 adiw r28, 0x36 ; 54 13b96: 6c af std Y+60, r22 ; 0x3c 13b98: 7d af std Y+61, r23 ; 0x3d 13b9a: 8e af std Y+62, r24 ; 0x3e 13b9c: 9f af std Y+63, r25 ; 0x3f 13b9e: e6 97 sbiw r28, 0x36 ; 54 // 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++) { 13ba0: 22 24 eor r2, r2 13ba2: 23 94 inc r2 13ba4: 31 2c mov r3, r1 if (n_arc_correction-- == 0) { 13ba6: 6f 96 adiw r28, 0x1f ; 31 13ba8: 8f ad ldd r24, Y+63 ; 0x3f 13baa: 6f 97 sbiw r28, 0x1f ; 31 13bac: 81 11 cpse r24, r1 13bae: 4d c1 rjmp .+666 ; 0x13e4a // 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); 13bb0: b1 01 movw r22, r2 13bb2: 90 e0 ldi r25, 0x00 ; 0 13bb4: 80 e0 ldi r24, 0x00 ; 0 13bb6: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 13bba: a3 01 movw r20, r6 13bbc: 92 01 movw r18, r4 13bbe: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 13bc2: 6b 01 movw r12, r22 13bc4: 7c 01 movw r14, r24 13bc6: 0f 94 f9 dd call 0x3bbf2 ; 0x3bbf2 13bca: 6a 96 adiw r28, 0x1a ; 26 13bcc: 6c af std Y+60, r22 ; 0x3c 13bce: 7d af std Y+61, r23 ; 0x3d 13bd0: 8e af std Y+62, r24 ; 0x3e 13bd2: 9f af std Y+63, r25 ; 0x3f 13bd4: 6a 97 sbiw r28, 0x1a ; 26 13bd6: c7 01 movw r24, r14 13bd8: b6 01 movw r22, r12 13bda: 0f 94 bf e0 call 0x3c17e ; 0x3c17e 13bde: 4b 01 movw r8, r22 13be0: 5c 01 movw r10, r24 r_axis_x = -offset[X_AXIS] * cos_Ti + offset[Y_AXIS] * sin_Ti; 13be2: c0 90 89 03 lds r12, 0x0389 ; 0x800389 13be6: d0 90 8a 03 lds r13, 0x038A ; 0x80038a 13bea: e0 90 8b 03 lds r14, 0x038B ; 0x80038b 13bee: f0 90 8c 03 lds r15, 0x038C ; 0x80038c 13bf2: f7 fa bst r15, 7 13bf4: f0 94 com r15 13bf6: f7 f8 bld r15, 7 13bf8: f0 94 com r15 13bfa: 20 91 8d 03 lds r18, 0x038D ; 0x80038d 13bfe: 30 91 8e 03 lds r19, 0x038E ; 0x80038e 13c02: 40 91 8f 03 lds r20, 0x038F ; 0x80038f 13c06: 50 91 90 03 lds r21, 0x0390 ; 0x800390 13c0a: a2 96 adiw r28, 0x22 ; 34 13c0c: 2c af std Y+60, r18 ; 0x3c 13c0e: 3d af std Y+61, r19 ; 0x3d 13c10: 4e af std Y+62, r20 ; 0x3e 13c12: 5f af std Y+63, r21 ; 0x3f 13c14: a2 97 sbiw r28, 0x22 ; 34 13c16: a7 01 movw r20, r14 13c18: 96 01 movw r18, r12 13c1a: 6a 96 adiw r28, 0x1a ; 26 13c1c: 6c ad ldd r22, Y+60 ; 0x3c 13c1e: 7d ad ldd r23, Y+61 ; 0x3d 13c20: 8e ad ldd r24, Y+62 ; 0x3e 13c22: 9f ad ldd r25, Y+63 ; 0x3f 13c24: 6a 97 sbiw r28, 0x1a ; 26 13c26: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 13c2a: 6e 96 adiw r28, 0x1e ; 30 13c2c: 6c af std Y+60, r22 ; 0x3c 13c2e: 7d af std Y+61, r23 ; 0x3d 13c30: 8e af std Y+62, r24 ; 0x3e 13c32: 9f af std Y+63, r25 ; 0x3f 13c34: 6e 97 sbiw r28, 0x1e ; 30 13c36: a2 96 adiw r28, 0x22 ; 34 13c38: 2c ad ldd r18, Y+60 ; 0x3c 13c3a: 3d ad ldd r19, Y+61 ; 0x3d 13c3c: 4e ad ldd r20, Y+62 ; 0x3e 13c3e: 5f ad ldd r21, Y+63 ; 0x3f 13c40: a2 97 sbiw r28, 0x22 ; 34 13c42: c5 01 movw r24, r10 13c44: b4 01 movw r22, r8 13c46: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 13c4a: 9b 01 movw r18, r22 13c4c: ac 01 movw r20, r24 13c4e: 6e 96 adiw r28, 0x1e ; 30 13c50: 6c ad ldd r22, Y+60 ; 0x3c 13c52: 7d ad ldd r23, Y+61 ; 0x3d 13c54: 8e ad ldd r24, Y+62 ; 0x3e 13c56: 9f ad ldd r25, Y+63 ; 0x3f 13c58: 6e 97 sbiw r28, 0x1e ; 30 13c5a: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 13c5e: 6e 96 adiw r28, 0x1e ; 30 13c60: 6c af std Y+60, r22 ; 0x3c 13c62: 7d af std Y+61, r23 ; 0x3d 13c64: 8e af std Y+62, r24 ; 0x3e 13c66: 9f af std Y+63, r25 ; 0x3f 13c68: 6e 97 sbiw r28, 0x1e ; 30 r_axis_y = -offset[X_AXIS] * sin_Ti - offset[Y_AXIS] * cos_Ti; 13c6a: a7 01 movw r20, r14 13c6c: 96 01 movw r18, r12 13c6e: c5 01 movw r24, r10 13c70: b4 01 movw r22, r8 13c72: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 13c76: 6b 01 movw r12, r22 13c78: 7c 01 movw r14, r24 13c7a: a2 96 adiw r28, 0x22 ; 34 13c7c: 2c ad ldd r18, Y+60 ; 0x3c 13c7e: 3d ad ldd r19, Y+61 ; 0x3d 13c80: 4e ad ldd r20, Y+62 ; 0x3e 13c82: 5f ad ldd r21, Y+63 ; 0x3f 13c84: a2 97 sbiw r28, 0x22 ; 34 13c86: 6a 96 adiw r28, 0x1a ; 26 13c88: 6c ad ldd r22, Y+60 ; 0x3c 13c8a: 7d ad ldd r23, Y+61 ; 0x3d 13c8c: 8e ad ldd r24, Y+62 ; 0x3e 13c8e: 9f ad ldd r25, Y+63 ; 0x3f 13c90: 6a 97 sbiw r28, 0x1a ; 26 13c92: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 13c96: 9b 01 movw r18, r22 13c98: ac 01 movw r20, r24 13c9a: c7 01 movw r24, r14 13c9c: b6 01 movw r22, r12 13c9e: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 13ca2: 6a 96 adiw r28, 0x1a ; 26 13ca4: 6c af std Y+60, r22 ; 0x3c 13ca6: 7d af std Y+61, r23 ; 0x3d 13ca8: 8e af std Y+62, r24 ; 0x3e 13caa: 9f af std Y+63, r25 ; 0x3f 13cac: 6a 97 sbiw r28, 0x1a ; 26 // reset n_arc_correction n_arc_correction = cs.n_arc_correction; 13cae: 30 91 89 0e lds r19, 0x0E89 ; 0x800e89 13cb2: 6f 96 adiw r28, 0x1f ; 31 13cb4: 3f af std Y+63, r19 ; 0x3f 13cb6: 6f 97 sbiw r28, 0x1f ; 31 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; 13cb8: 6e 96 adiw r28, 0x1e ; 30 13cba: 2c ad ldd r18, Y+60 ; 0x3c 13cbc: 3d ad ldd r19, Y+61 ; 0x3d 13cbe: 4e ad ldd r20, Y+62 ; 0x3e 13cc0: 5f ad ldd r21, Y+63 ; 0x3f 13cc2: 6e 97 sbiw r28, 0x1e ; 30 13cc4: ea 96 adiw r28, 0x3a ; 58 13cc6: 6c ad ldd r22, Y+60 ; 0x3c 13cc8: 7d ad ldd r23, Y+61 ; 0x3d 13cca: 8e ad ldd r24, Y+62 ; 0x3e 13ccc: 9f ad ldd r25, Y+63 ; 0x3f 13cce: ea 97 sbiw r28, 0x3a ; 58 13cd0: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 13cd4: 69 83 std Y+1, r22 ; 0x01 13cd6: 7a 83 std Y+2, r23 ; 0x02 13cd8: 8b 83 std Y+3, r24 ; 0x03 13cda: 9c 83 std Y+4, r25 ; 0x04 start_position[Y_AXIS] = center_axis_y + r_axis_y; 13cdc: 6a 96 adiw r28, 0x1a ; 26 13cde: 2c ad ldd r18, Y+60 ; 0x3c 13ce0: 3d ad ldd r19, Y+61 ; 0x3d 13ce2: 4e ad ldd r20, Y+62 ; 0x3e 13ce4: 5f ad ldd r21, Y+63 ; 0x3f 13ce6: 6a 97 sbiw r28, 0x1a ; 26 13ce8: ce 57 subi r28, 0x7E ; 126 13cea: df 4f sbci r29, 0xFF ; 255 13cec: 68 81 ld r22, Y 13cee: 79 81 ldd r23, Y+1 ; 0x01 13cf0: 8a 81 ldd r24, Y+2 ; 0x02 13cf2: 9b 81 ldd r25, Y+3 ; 0x03 13cf4: c2 58 subi r28, 0x82 ; 130 13cf6: d0 40 sbci r29, 0x00 ; 0 13cf8: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 13cfc: 6d 83 std Y+5, r22 ; 0x05 13cfe: 7e 83 std Y+6, r23 ; 0x06 13d00: 8f 83 std Y+7, r24 ; 0x07 13d02: 98 87 std Y+8, r25 ; 0x08 start_position[Z_AXIS] += linear_per_segment; 13d04: ee 96 adiw r28, 0x3e ; 62 13d06: 2c ad ldd r18, Y+60 ; 0x3c 13d08: 3d ad ldd r19, Y+61 ; 0x3d 13d0a: 4e ad ldd r20, Y+62 ; 0x3e 13d0c: 5f ad ldd r21, Y+63 ; 0x3f 13d0e: ee 97 sbiw r28, 0x3e ; 62 13d10: 69 85 ldd r22, Y+9 ; 0x09 13d12: 7a 85 ldd r23, Y+10 ; 0x0a 13d14: 8b 85 ldd r24, Y+11 ; 0x0b 13d16: 9c 85 ldd r25, Y+12 ; 0x0c 13d18: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 13d1c: 69 87 std Y+9, r22 ; 0x09 13d1e: 7a 87 std Y+10, r23 ; 0x0a 13d20: 8b 87 std Y+11, r24 ; 0x0b 13d22: 9c 87 std Y+12, r25 ; 0x0c start_position[E_AXIS] += segment_extruder_travel; 13d24: c2 58 subi r28, 0x82 ; 130 13d26: df 4f sbci r29, 0xFF ; 255 13d28: 28 81 ld r18, Y 13d2a: 39 81 ldd r19, Y+1 ; 0x01 13d2c: 4a 81 ldd r20, Y+2 ; 0x02 13d2e: 5b 81 ldd r21, Y+3 ; 0x03 13d30: ce 57 subi r28, 0x7E ; 126 13d32: d0 40 sbci r29, 0x00 ; 0 13d34: 6d 85 ldd r22, Y+13 ; 0x0d 13d36: 7e 85 ldd r23, Y+14 ; 0x0e 13d38: 8f 85 ldd r24, Y+15 ; 0x0f 13d3a: 98 89 ldd r25, Y+16 ; 0x10 13d3c: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 13d40: 6d 87 std Y+13, r22 ; 0x0d 13d42: 7e 87 std Y+14, r23 ; 0x0e 13d44: 8f 87 std Y+15, r24 ; 0x0f 13d46: 98 8b std Y+16, r25 ; 0x10 // Clamp to the calculated position. clamp_to_software_endstops(start_position); 13d48: ce 01 movw r24, r28 13d4a: 01 96 adiw r24, 0x01 ; 1 13d4c: 0e 94 e1 6b call 0xd7c2 ; 0xd7c2 // Insert the segment into the buffer if (i >= start_segment_idx) 13d50: e0 96 adiw r28, 0x30 ; 48 13d52: 8e ad ldd r24, Y+62 ; 0x3e 13d54: 9f ad ldd r25, Y+63 ; 0x3f 13d56: e0 97 sbiw r28, 0x30 ; 48 13d58: 28 16 cp r2, r24 13d5a: 39 06 cpc r3, r25 13d5c: 08 f1 brcs .+66 ; 0x13da0 plan_buffer_line(start_position[X_AXIS], start_position[Y_AXIS], start_position[Z_AXIS], start_position[E_AXIS], feed_rate, position, i); 13d5e: e9 84 ldd r14, Y+9 ; 0x09 13d60: fa 84 ldd r15, Y+10 ; 0x0a 13d62: 0b 85 ldd r16, Y+11 ; 0x0b 13d64: 1c 85 ldd r17, Y+12 ; 0x0c 13d66: 2d 81 ldd r18, Y+5 ; 0x05 13d68: 3e 81 ldd r19, Y+6 ; 0x06 13d6a: 4f 81 ldd r20, Y+7 ; 0x07 13d6c: 58 85 ldd r21, Y+8 ; 0x08 13d6e: 69 81 ldd r22, Y+1 ; 0x01 13d70: 7a 81 ldd r23, Y+2 ; 0x02 13d72: 8b 81 ldd r24, Y+3 ; 0x03 13d74: 9c 81 ldd r25, Y+4 ; 0x04 13d76: 3f 92 push r3 13d78: 2f 92 push r2 13d7a: a1 e9 ldi r26, 0x91 ; 145 13d7c: b6 e0 ldi r27, 0x06 ; 6 13d7e: bf 93 push r27 13d80: af 93 push r26 13d82: aa 96 adiw r28, 0x2a ; 42 13d84: 8c ac ldd r8, Y+60 ; 0x3c 13d86: 9d ac ldd r9, Y+61 ; 0x3d 13d88: ae ac ldd r10, Y+62 ; 0x3e 13d8a: bf ac ldd r11, Y+63 ; 0x3f 13d8c: aa 97 sbiw r28, 0x2a ; 42 13d8e: de 01 movw r26, r28 13d90: 1d 96 adiw r26, 0x0d ; 13 13d92: 6d 01 movw r12, r26 13d94: 0f 94 af b0 call 0x3615e ; 0x3615e 13d98: 0f 90 pop r0 13d9a: 0f 90 pop r0 13d9c: 0f 90 pop r0 13d9e: 0f 90 pop r0 // Handle the situation where the planner is aborted hard. if (planner_aborted) 13da0: 80 91 ab 0d lds r24, 0x0DAB ; 0x800dab 13da4: 81 11 cpse r24, r1 13da6: 3d c0 rjmp .+122 ; 0x13e22 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++) { 13da8: bf ef ldi r27, 0xFF ; 255 13daa: 2b 1a sub r2, r27 13dac: 3b 0a sbc r3, r27 13dae: a4 96 adiw r28, 0x24 ; 36 13db0: ee ad ldd r30, Y+62 ; 0x3e 13db2: ff ad ldd r31, Y+63 ; 0x3f 13db4: a4 97 sbiw r28, 0x24 ; 36 13db6: e2 15 cp r30, r2 13db8: f3 05 cpc r31, r3 13dba: 09 f0 breq .+2 ; 0x13dbe 13dbc: f4 ce rjmp .-536 ; 0x13ba6 if (planner_aborted) return; } } // Clamp to the target position. clamp_to_software_endstops(target); 13dbe: 83 e7 ldi r24, 0x73 ; 115 13dc0: 96 e0 ldi r25, 0x06 ; 6 13dc2: 0e 94 e1 6b call 0xd7c2 ; 0xd7c2 // 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); 13dc6: e0 90 7b 06 lds r14, 0x067B ; 0x80067b 13dca: f0 90 7c 06 lds r15, 0x067C ; 0x80067c 13dce: 00 91 7d 06 lds r16, 0x067D ; 0x80067d 13dd2: 10 91 7e 06 lds r17, 0x067E ; 0x80067e 13dd6: 20 91 77 06 lds r18, 0x0677 ; 0x800677 13dda: 30 91 78 06 lds r19, 0x0678 ; 0x800678 13dde: 40 91 79 06 lds r20, 0x0679 ; 0x800679 13de2: 50 91 7a 06 lds r21, 0x067A ; 0x80067a 13de6: 60 91 73 06 lds r22, 0x0673 ; 0x800673 13dea: 70 91 74 06 lds r23, 0x0674 ; 0x800674 13dee: 80 91 75 06 lds r24, 0x0675 ; 0x800675 13df2: 90 91 76 06 lds r25, 0x0676 ; 0x800676 13df6: 1f 92 push r1 13df8: 1f 92 push r1 13dfa: e1 e9 ldi r30, 0x91 ; 145 13dfc: f6 e0 ldi r31, 0x06 ; 6 13dfe: ff 93 push r31 13e00: ef 93 push r30 13e02: aa 96 adiw r28, 0x2a ; 42 13e04: 8c ac ldd r8, Y+60 ; 0x3c 13e06: 9d ac ldd r9, Y+61 ; 0x3d 13e08: ae ac ldd r10, Y+62 ; 0x3e 13e0a: bf ac ldd r11, Y+63 ; 0x3f 13e0c: aa 97 sbiw r28, 0x2a ; 42 13e0e: af e7 ldi r26, 0x7F ; 127 13e10: ca 2e mov r12, r26 13e12: a6 e0 ldi r26, 0x06 ; 6 13e14: da 2e mov r13, r26 13e16: 0f 94 af b0 call 0x3615e ; 0x3615e 13e1a: 0f 90 pop r0 13e1c: 0f 90 pop r0 13e1e: 0f 90 pop r0 13e20: 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(); 13e22: 0e 94 17 5b call 0xb62e ; 0xb62e previous_millis_cmd.start(); 13e26: 84 e8 ldi r24, 0x84 ; 132 13e28: 93 e0 ldi r25, 0x03 ; 3 13e2a: 0f 94 c5 2b call 0x2578a ; 0x2578a ::start()> 13e2e: 7b cb rjmp .-2314 ; 0x13526 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; 13e30: 60 e0 ldi r22, 0x00 ; 0 13e32: 70 e0 ldi r23, 0x00 ; 0 13e34: cb 01 movw r24, r22 13e36: fe cb rjmp .-2052 ; 0x13634 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; 13e38: a3 2c mov r10, r3 13e3a: b2 2c mov r11, r2 13e3c: 6f 96 adiw r28, 0x1f ; 31 13e3e: 0f ad ldd r16, Y+63 ; 0x3f 13e40: 6f 97 sbiw r28, 0x1f ; 31 13e42: a3 96 adiw r28, 0x23 ; 35 13e44: 1f ad ldd r17, Y+63 ; 0x3f 13e46: a3 97 sbiw r28, 0x23 ; 35 13e48: 69 cd rjmp .-1326 ; 0x1391c 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++) { if (n_arc_correction-- == 0) { 13e4a: 6f 96 adiw r28, 0x1f ; 31 13e4c: 4f ad ldd r20, Y+63 ; 0x3f 13e4e: 6f 97 sbiw r28, 0x1f ; 31 13e50: 41 50 subi r20, 0x01 ; 1 13e52: 6f 96 adiw r28, 0x1f ; 31 13e54: 4f af std Y+63, r20 ; 0x3f 13e56: 6f 97 sbiw r28, 0x1f ; 31 // 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; 13e58: ae 96 adiw r28, 0x2e ; 46 13e5a: 2c ad ldd r18, Y+60 ; 0x3c 13e5c: 3d ad ldd r19, Y+61 ; 0x3d 13e5e: 4e ad ldd r20, Y+62 ; 0x3e 13e60: 5f ad ldd r21, Y+63 ; 0x3f 13e62: ae 97 sbiw r28, 0x2e ; 46 13e64: 6e 96 adiw r28, 0x1e ; 30 13e66: 6c ad ldd r22, Y+60 ; 0x3c 13e68: 7d ad ldd r23, Y+61 ; 0x3d 13e6a: 8e ad ldd r24, Y+62 ; 0x3e 13e6c: 9f ad ldd r25, Y+63 ; 0x3f 13e6e: 6e 97 sbiw r28, 0x1e ; 30 13e70: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 13e74: 6b 01 movw r12, r22 13e76: 7c 01 movw r14, r24 13e78: e6 96 adiw r28, 0x36 ; 54 13e7a: 2c ad ldd r18, Y+60 ; 0x3c 13e7c: 3d ad ldd r19, Y+61 ; 0x3d 13e7e: 4e ad ldd r20, Y+62 ; 0x3e 13e80: 5f ad ldd r21, Y+63 ; 0x3f 13e82: e6 97 sbiw r28, 0x36 ; 54 13e84: 6a 96 adiw r28, 0x1a ; 26 13e86: 6c ad ldd r22, Y+60 ; 0x3c 13e88: 7d ad ldd r23, Y+61 ; 0x3d 13e8a: 8e ad ldd r24, Y+62 ; 0x3e 13e8c: 9f ad ldd r25, Y+63 ; 0x3f 13e8e: 6a 97 sbiw r28, 0x1a ; 26 13e90: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 13e94: 9b 01 movw r18, r22 13e96: ac 01 movw r20, r24 13e98: c7 01 movw r24, r14 13e9a: b6 01 movw r22, r12 13e9c: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 13ea0: 7b 01 movw r14, r22 13ea2: 8c 01 movw r16, r24 r_axis_x = r_axis_x * cos_T - r_axis_y * sin_T; 13ea4: e6 96 adiw r28, 0x36 ; 54 13ea6: 2c ad ldd r18, Y+60 ; 0x3c 13ea8: 3d ad ldd r19, Y+61 ; 0x3d 13eaa: 4e ad ldd r20, Y+62 ; 0x3e 13eac: 5f ad ldd r21, Y+63 ; 0x3f 13eae: e6 97 sbiw r28, 0x36 ; 54 13eb0: 6e 96 adiw r28, 0x1e ; 30 13eb2: 6c ad ldd r22, Y+60 ; 0x3c 13eb4: 7d ad ldd r23, Y+61 ; 0x3d 13eb6: 8e ad ldd r24, Y+62 ; 0x3e 13eb8: 9f ad ldd r25, Y+63 ; 0x3f 13eba: 6e 97 sbiw r28, 0x1e ; 30 13ebc: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 13ec0: 4b 01 movw r8, r22 13ec2: 5c 01 movw r10, r24 13ec4: ae 96 adiw r28, 0x2e ; 46 13ec6: 2c ad ldd r18, Y+60 ; 0x3c 13ec8: 3d ad ldd r19, Y+61 ; 0x3d 13eca: 4e ad ldd r20, Y+62 ; 0x3e 13ecc: 5f ad ldd r21, Y+63 ; 0x3f 13ece: ae 97 sbiw r28, 0x2e ; 46 13ed0: 6a 96 adiw r28, 0x1a ; 26 13ed2: 6c ad ldd r22, Y+60 ; 0x3c 13ed4: 7d ad ldd r23, Y+61 ; 0x3d 13ed6: 8e ad ldd r24, Y+62 ; 0x3e 13ed8: 9f ad ldd r25, Y+63 ; 0x3f 13eda: 6a 97 sbiw r28, 0x1a ; 26 13edc: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 13ee0: 9b 01 movw r18, r22 13ee2: ac 01 movw r20, r24 13ee4: c5 01 movw r24, r10 13ee6: b4 01 movw r22, r8 13ee8: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 13eec: 6e 96 adiw r28, 0x1e ; 30 13eee: 6c af std Y+60, r22 ; 0x3c 13ef0: 7d af std Y+61, r23 ; 0x3d 13ef2: 8e af std Y+62, r24 ; 0x3e 13ef4: 9f af std Y+63, r25 ; 0x3f 13ef6: 6e 97 sbiw r28, 0x1e ; 30 r_axis_y = r_axisi; 13ef8: c7 01 movw r24, r14 13efa: d8 01 movw r26, r16 13efc: 6a 96 adiw r28, 0x1a ; 26 13efe: 8c af std Y+60, r24 ; 0x3c 13f00: 9d af std Y+61, r25 ; 0x3d 13f02: ae af std Y+62, r26 ; 0x3e 13f04: bf af std Y+63, r27 ; 0x3f 13f06: 6a 97 sbiw r28, 0x1a ; 26 13f08: d7 ce rjmp .-594 ; 0x13cb8 - `S` - Time to wait, in seconds */ case 4: codenum = 0; if(code_seen('P')) codenum = code_value(); // milliseconds to wait 13f0a: 80 e5 ldi r24, 0x50 ; 80 13f0c: 0e 94 ee 5b call 0xb7dc ; 0xb7dc - `P` - Time to wait, in milliseconds - `S` - Time to wait, in seconds */ case 4: codenum = 0; 13f10: c1 2c mov r12, r1 13f12: d1 2c mov r13, r1 13f14: 76 01 movw r14, r12 if(code_seen('P')) codenum = code_value(); // milliseconds to wait 13f16: 88 23 and r24, r24 13f18: 31 f0 breq .+12 ; 0x13f26 13f1a: 0e 94 b5 60 call 0xc16a ; 0xc16a 13f1e: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 13f22: 6b 01 movw r12, r22 13f24: 7c 01 movw r14, r24 if(code_seen('S')) codenum = code_value() * 1000; // seconds to wait 13f26: 83 e5 ldi r24, 0x53 ; 83 13f28: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 13f2c: 88 23 and r24, r24 13f2e: 61 f0 breq .+24 ; 0x13f48 13f30: 0e 94 b5 60 call 0xc16a ; 0xc16a 13f34: 20 e0 ldi r18, 0x00 ; 0 13f36: 30 e0 ldi r19, 0x00 ; 0 13f38: 4a e7 ldi r20, 0x7A ; 122 13f3a: 54 e4 ldi r21, 0x44 ; 68 13f3c: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 13f40: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 13f44: 6b 01 movw r12, r22 13f46: 7c 01 movw r14, r24 if(codenum != 0) 13f48: c1 14 cp r12, r1 13f4a: d1 04 cpc r13, r1 13f4c: e1 04 cpc r14, r1 13f4e: f1 04 cpc r15, r1 13f50: 41 f0 breq .+16 ; 0x13f62 { if(custom_message_type != CustomMsg::M117) 13f52: 80 91 c3 06 lds r24, 0x06C3 ; 0x8006c3 13f56: 87 30 cpi r24, 0x07 ; 7 13f58: 21 f0 breq .+8 ; 0x13f62 { LCD_MESSAGERPGM(_n("Sleep..."));////MSG_DWELL 13f5a: 81 e6 ldi r24, 0x61 ; 97 13f5c: 9a e6 ldi r25, 0x6A ; 106 13f5e: 0e 94 38 f1 call 0x1e270 ; 0x1e270 } } st_synchronize(); 13f62: 0f 94 a3 42 call 0x28546 ; 0x28546 codenum += _millis(); // keep track of when we started waiting 13f66: 0f 94 22 29 call 0x25244 ; 0x25244 13f6a: c6 0e add r12, r22 13f6c: d7 1e adc r13, r23 13f6e: e8 1e adc r14, r24 13f70: f9 1e adc r15, r25 previous_millis_cmd.start(); 13f72: 84 e8 ldi r24, 0x84 ; 132 13f74: 93 e0 ldi r25, 0x03 ; 3 13f76: 0f 94 c5 2b call 0x2578a ; 0x2578a ::start()> while(_millis() < codenum) { 13f7a: 0f 94 22 29 call 0x25244 ; 0x25244 13f7e: 6c 15 cp r22, r12 13f80: 7d 05 cpc r23, r13 13f82: 8e 05 cpc r24, r14 13f84: 9f 05 cpc r25, r15 13f86: 08 f0 brcs .+2 ; 0x13f8a 13f88: ce ca rjmp .-2660 ; 0x13526 manage_heater(); 13f8a: 0f 94 2e 38 call 0x2705c ; 0x2705c manage_inactivity(); 13f8e: 80 e0 ldi r24, 0x00 ; 0 13f90: 0e 94 c7 8a call 0x1158e ; 0x1158e lcd_update(0); 13f94: 80 e0 ldi r24, 0x00 ; 0 13f96: 0e 94 bf 6e call 0xdd7e ; 0xdd7e 13f9a: ef cf rjmp .-34 ; 0x13f7a 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); 13f9c: 81 e0 ldi r24, 0x01 ; 1 */ case 11: #if EXTRUDERS > 1 retract(false,retracted_swap[active_extruder]); #else retract(false); 13f9e: 0f 94 e3 89 call 0x313c6 ; 0x313c6 13fa2: c1 ca rjmp .-2686 ; 0x13526 13fa4: 80 e0 ldi r24, 0x00 ; 0 13fa6: fb cf rjmp .-10 ; 0x13f9e - `C` - Calibrate X and Y origin (home) - Only on MK3/s */ case 28: { long home_x_value = 0; long home_y_value = 0; 13fa8: 6e 96 adiw r28, 0x1e ; 30 13faa: 1c ae std Y+60, r1 ; 0x3c 13fac: 1d ae std Y+61, r1 ; 0x3d 13fae: 1e ae std Y+62, r1 ; 0x3e 13fb0: 1f ae std Y+63, r1 ; 0x3f 13fb2: 6e 97 sbiw r28, 0x1e ; 30 13fb4: 35 ca rjmp .-2966 ; 0x13420 Sensor must be over the bed. The maximum travel distance before an error is triggered is 10mm. */ case 30: { st_synchronize(); 13fb6: 0f 94 a3 42 call 0x28546 ; 0x28546 homing_flag = true; 13fba: 81 e0 ldi r24, 0x01 ; 1 13fbc: 80 93 a6 0d sts 0x0DA6, r24 ; 0x800da6 // TODO: make sure the bed_level_rotation_matrix is identity or the planner will get set incorectly int l_feedmultiply = setup_for_endstop_move(); 13fc0: 0e 94 00 67 call 0xce00 ; 0xce00 13fc4: 8c 01 movw r16, r24 feedrate = homing_feedrate[Z_AXIS]; 13fc6: 80 e0 ldi r24, 0x00 ; 0 13fc8: 90 e0 ldi r25, 0x00 ; 0 13fca: a8 e4 ldi r26, 0x48 ; 72 13fcc: b4 e4 ldi r27, 0x44 ; 68 13fce: 80 93 b8 02 sts 0x02B8, r24 ; 0x8002b8 13fd2: 90 93 b9 02 sts 0x02B9, r25 ; 0x8002b9 13fd6: a0 93 ba 02 sts 0x02BA, r26 ; 0x8002ba 13fda: b0 93 bb 02 sts 0x02BB, r27 ; 0x8002bb find_bed_induction_sensor_point_z(-10.f, 3); 13fde: 43 e0 ldi r20, 0x03 ; 3 13fe0: 60 e0 ldi r22, 0x00 ; 0 13fe2: 70 e0 ldi r23, 0x00 ; 0 13fe4: 80 e2 ldi r24, 0x20 ; 32 13fe6: 91 ec ldi r25, 0xC1 ; 193 13fe8: 0f 94 12 8c call 0x31824 ; 0x31824 printf_P(_N("%S X: %.5f Y: %.5f Z: %.5f\n"), _T(MSG_BED), _x, _y, _z); 13fec: 70 90 99 06 lds r7, 0x0699 ; 0x800699 13ff0: 60 90 9a 06 lds r6, 0x069A ; 0x80069a 13ff4: 50 90 9b 06 lds r5, 0x069B ; 0x80069b 13ff8: 40 90 9c 06 lds r4, 0x069C ; 0x80069c 13ffc: b0 90 95 06 lds r11, 0x0695 ; 0x800695 14000: a0 90 96 06 lds r10, 0x0696 ; 0x800696 14004: 90 90 97 06 lds r9, 0x0697 ; 0x800697 14008: 80 90 98 06 lds r8, 0x0698 ; 0x800698 1400c: f0 90 91 06 lds r15, 0x0691 ; 0x800691 14010: e0 90 92 06 lds r14, 0x0692 ; 0x800692 14014: d0 90 93 06 lds r13, 0x0693 ; 0x800693 14018: c0 90 94 06 lds r12, 0x0694 ; 0x800694 1401c: 85 ef ldi r24, 0xF5 ; 245 1401e: 93 e4 ldi r25, 0x43 ; 67 14020: 0e 94 c4 72 call 0xe588 ; 0xe588 14024: 4f 92 push r4 14026: 5f 92 push r5 14028: 6f 92 push r6 1402a: 7f 92 push r7 1402c: 8f 92 push r8 1402e: 9f 92 push r9 14030: af 92 push r10 14032: bf 92 push r11 14034: cf 92 push r12 14036: df 92 push r13 14038: ef 92 push r14 1403a: ff 92 push r15 1403c: 9f 93 push r25 1403e: 8f 93 push r24 14040: 85 e4 ldi r24, 0x45 ; 69 14042: 9a e6 ldi r25, 0x6A ; 106 14044: 9f 93 push r25 14046: 8f 93 push r24 14048: 0f 94 99 da call 0x3b532 ; 0x3b532 clean_up_after_endstop_move(l_feedmultiply); 1404c: c8 01 movw r24, r16 1404e: 0e 94 e6 66 call 0xcdcc ; 0xcdcc homing_flag = false; 14052: 10 92 a6 0d sts 0x0DA6, r1 ; 0x800da6 14056: 0f b6 in r0, 0x3f ; 63 14058: f8 94 cli 1405a: de bf out 0x3e, r29 ; 62 1405c: 0f be out 0x3f, r0 ; 63 1405e: cd bf out 0x3d, r28 ; 61 14060: 62 ca rjmp .-2876 ; 0x13526 ``` */ case 76: { #ifdef PINDA_THERMISTOR if (!has_temperature_compensation()) 14062: 20 e0 ldi r18, 0x00 ; 0 14064: 30 e0 ldi r19, 0x00 ; 0 14066: 40 e2 ldi r20, 0x20 ; 32 14068: 51 e4 ldi r21, 0x41 ; 65 1406a: 60 91 97 03 lds r22, 0x0397 ; 0x800397 1406e: 70 91 98 03 lds r23, 0x0398 ; 0x800398 14072: 80 91 99 03 lds r24, 0x0399 ; 0x800399 14076: 90 91 9a 03 lds r25, 0x039A ; 0x80039a 1407a: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 1407e: 87 ff sbrs r24, 7 14080: 05 c0 rjmp .+10 ; 0x1408c { SERIAL_ECHOLNPGM("No PINDA thermistor"); 14082: 8a ef ldi r24, 0xFA ; 250 14084: 97 e8 ldi r25, 0x87 ; 135 14086: 0e 94 93 79 call 0xf326 ; 0xf326 1408a: 4d ca rjmp .-2918 ; 0x13526 break; } if (!calibration_status_get(CALIBRATION_STATUS_XYZ)) { 1408c: 82 e0 ldi r24, 0x02 ; 2 1408e: 0e 94 7a ee call 0x1dcf4 ; 0x1dcf4 14092: 81 11 cpse r24, r1 14094: 07 c0 rjmp .+14 ; 0x140a4 //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)); 14096: 8f e5 ldi r24, 0x5F ; 95 14098: 9a e3 ldi r25, 0x3A ; 58 1409a: 0e 94 c4 72 call 0xe588 ; 0xe588 1409e: 0f 94 c7 1f call 0x23f8e ; 0x23f8e 140a2: 41 ca rjmp .-2942 ; 0x13526 break; } if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS])) 140a4: 80 91 8e 06 lds r24, 0x068E ; 0x80068e 140a8: 88 23 and r24, r24 140aa: 41 f0 breq .+16 ; 0x140bc 140ac: 80 91 8f 06 lds r24, 0x068F ; 0x80068f 140b0: 88 23 and r24, r24 140b2: 21 f0 breq .+8 ; 0x140bc 140b4: 10 91 90 06 lds r17, 0x0690 ; 0x800690 140b8: 11 11 cpse r17, r1 140ba: 08 c0 rjmp .+16 ; 0x140cc 140bc: 81 e0 ldi r24, 0x01 ; 1 140be: 80 93 a1 10 sts 0x10A1, r24 ; 0x8010a1 { // 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); 140c2: 8e e1 ldi r24, 0x1E ; 30 140c4: 9c e6 ldi r25, 0x6C ; 108 140c6: 0f 94 b8 74 call 0x2e970 ; 0x2e970 140ca: 2d ca rjmp .-2982 ; 0x13526 break; } lcd_show_fullscreen_message_and_wait_P(_T(MSG_TEMP_CAL_WARNING)); 140cc: 86 e1 ldi r24, 0x16 ; 22 140ce: 9a e3 ldi r25, 0x3A ; 58 140d0: 0e 94 c4 72 call 0xe588 ; 0xe588 140d4: 0f 94 c7 1f call 0x23f8e ; 0x23f8e uint8_t result = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_STEEL_SHEET_CHECK), false); 140d8: 8f eb ldi r24, 0xBF ; 191 140da: 9e e3 ldi r25, 0x3E ; 62 140dc: 0e 94 c4 72 call 0xe588 ; 0xe588 140e0: 41 e0 ldi r20, 0x01 ; 1 140e2: 60 e0 ldi r22, 0x00 ; 0 140e4: 0f 94 fb 4e call 0x29df6 ; 0x29df6 if (result == LCD_LEFT_BUTTON_CHOICE) 140e8: 81 11 cpse r24, r1 140ea: 61 c0 rjmp .+194 ; 0x141ae { current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 140ec: 80 e0 ldi r24, 0x00 ; 0 140ee: 90 e0 ldi r25, 0x00 ; 0 140f0: a0 ea ldi r26, 0xA0 ; 160 140f2: b0 e4 ldi r27, 0x40 ; 64 140f4: 80 93 99 06 sts 0x0699, r24 ; 0x800699 140f8: 90 93 9a 06 sts 0x069A, r25 ; 0x80069a 140fc: a0 93 9b 06 sts 0x069B, r26 ; 0x80069b 14100: b0 93 9c 06 sts 0x069C, r27 ; 0x80069c plan_buffer_line_curposXYZE(3000 / 60); 14104: 60 e0 ldi r22, 0x00 ; 0 14106: 70 e0 ldi r23, 0x00 ; 0 14108: 88 e4 ldi r24, 0x48 ; 72 1410a: 92 e4 ldi r25, 0x42 ; 66 1410c: 0f 94 04 c0 call 0x38008 ; 0x38008 current_position[Z_AXIS] = 50; 14110: 80 e0 ldi r24, 0x00 ; 0 14112: 90 e0 ldi r25, 0x00 ; 0 14114: a8 e4 ldi r26, 0x48 ; 72 14116: b2 e4 ldi r27, 0x42 ; 66 14118: 80 93 99 06 sts 0x0699, r24 ; 0x800699 1411c: 90 93 9a 06 sts 0x069A, r25 ; 0x80069a 14120: a0 93 9b 06 sts 0x069B, r26 ; 0x80069b 14124: b0 93 9c 06 sts 0x069C, r27 ; 0x80069c current_position[Y_AXIS] = 180; 14128: 80 e0 ldi r24, 0x00 ; 0 1412a: 90 e0 ldi r25, 0x00 ; 0 1412c: a4 e3 ldi r26, 0x34 ; 52 1412e: b3 e4 ldi r27, 0x43 ; 67 14130: 80 93 95 06 sts 0x0695, r24 ; 0x800695 14134: 90 93 96 06 sts 0x0696, r25 ; 0x800696 14138: a0 93 97 06 sts 0x0697, r26 ; 0x800697 1413c: b0 93 98 06 sts 0x0698, r27 ; 0x800698 plan_buffer_line_curposXYZE(3000 / 60); 14140: 60 e0 ldi r22, 0x00 ; 0 14142: 70 e0 ldi r23, 0x00 ; 0 14144: 88 e4 ldi r24, 0x48 ; 72 14146: 92 e4 ldi r25, 0x42 ; 66 14148: 0f 94 04 c0 call 0x38008 ; 0x38008 st_synchronize(); 1414c: 0f 94 a3 42 call 0x28546 ; 0x28546 lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_STEEL_SHEET)); 14150: 85 e9 ldi r24, 0x95 ; 149 14152: 9e e3 ldi r25, 0x3E ; 62 14154: 0e 94 c4 72 call 0xe588 ; 0xe588 14158: 0f 94 c7 1f call 0x23f8e ; 0x23f8e current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 1415c: ee e0 ldi r30, 0x0E ; 14 1415e: f6 ea ldi r31, 0xA6 ; 166 14160: 85 91 lpm r24, Z+ 14162: 95 91 lpm r25, Z+ 14164: a5 91 lpm r26, Z+ 14166: b4 91 lpm r27, Z 14168: 80 93 95 06 sts 0x0695, r24 ; 0x800695 1416c: 90 93 96 06 sts 0x0696, r25 ; 0x800696 14170: a0 93 97 06 sts 0x0697, r26 ; 0x800697 14174: b0 93 98 06 sts 0x0698, r27 ; 0x800698 current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 14178: ea e0 ldi r30, 0x0A ; 10 1417a: f6 ea ldi r31, 0xA6 ; 166 1417c: 85 91 lpm r24, Z+ 1417e: 95 91 lpm r25, Z+ 14180: a5 91 lpm r26, Z+ 14182: b4 91 lpm r27, Z 14184: 80 93 91 06 sts 0x0691, r24 ; 0x800691 14188: 90 93 92 06 sts 0x0692, r25 ; 0x800692 1418c: a0 93 93 06 sts 0x0693, r26 ; 0x800693 14190: b0 93 94 06 sts 0x0694, r27 ; 0x800694 plan_buffer_line_curposXYZE(3000 / 60); 14194: 60 e0 ldi r22, 0x00 ; 0 14196: 70 e0 ldi r23, 0x00 ; 0 14198: 88 e4 ldi r24, 0x48 ; 72 1419a: 92 e4 ldi r25, 0x42 ; 66 1419c: 0f 94 04 c0 call 0x38008 ; 0x38008 st_synchronize(); 141a0: 0f 94 a3 42 call 0x28546 ; 0x28546 gcode_G28(false, false, true); 141a4: 41 e0 ldi r20, 0x01 ; 1 141a6: 60 e0 ldi r22, 0x00 ; 0 141a8: 80 e0 ldi r24, 0x00 ; 0 141aa: 0e 94 1d 7f call 0xfe3a ; 0xfe3a } if ((current_temperature_pinda > 35) && (farm_mode == false)) { 141ae: 20 e0 ldi r18, 0x00 ; 0 141b0: 30 e0 ldi r19, 0x00 ; 0 141b2: 4c e0 ldi r20, 0x0C ; 12 141b4: 52 e4 ldi r21, 0x42 ; 66 141b6: 60 91 97 03 lds r22, 0x0397 ; 0x800397 141ba: 70 91 98 03 lds r23, 0x0398 ; 0x800398 141be: 80 91 99 03 lds r24, 0x0399 ; 0x800399 141c2: 90 91 9a 03 lds r25, 0x039A ; 0x80039a 141c6: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 141ca: 18 16 cp r1, r24 141cc: 0c f0 brlt .+2 ; 0x141d0 141ce: 73 c0 rjmp .+230 ; 0x142b6 //waiting for PIDNA probe to cool down in case that we are not in farm mode current_position[Z_AXIS] = 100; 141d0: 80 e0 ldi r24, 0x00 ; 0 141d2: 90 e0 ldi r25, 0x00 ; 0 141d4: a8 ec ldi r26, 0xC8 ; 200 141d6: b2 e4 ldi r27, 0x42 ; 66 141d8: 80 93 99 06 sts 0x0699, r24 ; 0x800699 141dc: 90 93 9a 06 sts 0x069A, r25 ; 0x80069a 141e0: a0 93 9b 06 sts 0x069B, r26 ; 0x80069b 141e4: b0 93 9c 06 sts 0x069C, r27 ; 0x80069c plan_buffer_line_curposXYZE(3000 / 60); 141e8: 60 e0 ldi r22, 0x00 ; 0 141ea: 70 e0 ldi r23, 0x00 ; 0 141ec: 88 e4 ldi r24, 0x48 ; 72 141ee: 92 e4 ldi r25, 0x42 ; 66 141f0: 0f 94 04 c0 call 0x38008 ; 0x38008 } #ifdef PINDA_THERMISTOR bool lcd_wait_for_pinda(float temp) { disable_heater(); 141f4: 0f 94 ee 2e call 0x25ddc ; 0x25ddc LongTimer pinda_timeout; 141f8: 19 82 std Y+1, r1 ; 0x01 141fa: 1a 82 std Y+2, r1 ; 0x02 141fc: 1b 82 std Y+3, r1 ; 0x03 141fe: 1c 82 std Y+4, r1 ; 0x04 14200: 1d 82 std Y+5, r1 ; 0x05 pinda_timeout.start(); 14202: ce 01 movw r24, r28 14204: 01 96 adiw r24, 0x01 ; 1 14206: 0f 94 c5 2b call 0x2578a ; 0x2578a ::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); 1420a: 03 e2 ldi r16, 0x23 ; 35 1420c: ee e2 ldi r30, 0x2E ; 46 1420e: ee 2e mov r14, r30 14210: e5 e8 ldi r30, 0x85 ; 133 14212: fe 2e mov r15, r30 disable_heater(); LongTimer pinda_timeout; pinda_timeout.start(); bool target_temp_reached = true; while (current_temperature_pinda > temp){ 14214: 20 e0 ldi r18, 0x00 ; 0 14216: 30 e0 ldi r19, 0x00 ; 0 14218: 4c e0 ldi r20, 0x0C ; 12 1421a: 52 e4 ldi r21, 0x42 ; 66 1421c: 60 91 97 03 lds r22, 0x0397 ; 0x800397 14220: 70 91 98 03 lds r23, 0x0398 ; 0x800398 14224: 80 91 99 03 lds r24, 0x0399 ; 0x800399 14228: 90 91 9a 03 lds r25, 0x039A ; 0x80039a 1422c: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 14230: 18 16 cp r1, r24 14232: c4 f5 brge .+112 ; 0x142a4 lcd_display_message_fullscreen_P(_T(MSG_WAITING_TEMP_PINDA)); 14234: 88 ec ldi r24, 0xC8 ; 200 14236: 99 e3 ldi r25, 0x39 ; 57 14238: 0e 94 c4 72 call 0xe588 ; 0xe588 1423c: 0f 94 ba 1f call 0x23f74 ; 0x23f74 lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 14240: 42 e8 ldi r20, 0x82 ; 130 14242: 64 e0 ldi r22, 0x04 ; 4 14244: 80 e0 ldi r24, 0x00 ; 0 14246: 0e 94 18 6f call 0xde30 ; 0xde30 lcd_printf_P(PSTR("%3d/%3d"), (int16_t)current_temperature_pinda, (int16_t) temp); 1424a: 1f 92 push r1 1424c: 0f 93 push r16 1424e: 60 91 97 03 lds r22, 0x0397 ; 0x800397 14252: 70 91 98 03 lds r23, 0x0398 ; 0x800398 14256: 80 91 99 03 lds r24, 0x0399 ; 0x800399 1425a: 90 91 9a 03 lds r25, 0x039A ; 0x80039a 1425e: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> 14262: 7f 93 push r23 14264: 6f 93 push r22 14266: ff 92 push r15 14268: ef 92 push r14 1426a: 0e 94 d1 6e call 0xdda2 ; 0xdda2 lcd_putc(LCD_STR_DEGREE[0]); 1426e: 81 e8 ldi r24, 0x81 ; 129 14270: 0e 94 e7 6e call 0xddce ; 0xddce delay_keep_alive(1000); 14274: 88 ee ldi r24, 0xE8 ; 232 14276: 93 e0 ldi r25, 0x03 ; 3 14278: 0e 94 fc 8c call 0x119f8 ; 0x119f8 serialecho_temperatures(); 1427c: 0e 94 76 77 call 0xeeec ; 0xeeec if (pinda_timeout.expired(8 * 60 * 1000ul)) { //PINDA cooling from 60 C to 35 C takes about 7 minutes 14280: 40 e0 ldi r20, 0x00 ; 0 14282: 53 e5 ldi r21, 0x53 ; 83 14284: 67 e0 ldi r22, 0x07 ; 7 14286: 70 e0 ldi r23, 0x00 ; 0 14288: ce 01 movw r24, r28 1428a: 01 96 adiw r24, 0x01 ; 1 1428c: 0f 94 06 2a call 0x2540c ; 0x2540c ::expired(unsigned long)> 14290: 0f 90 pop r0 14292: 0f 90 pop r0 14294: 0f 90 pop r0 14296: 0f 90 pop r0 14298: 0f 90 pop r0 1429a: 0f 90 pop r0 1429c: 88 23 and r24, r24 1429e: 09 f4 brne .+2 ; 0x142a2 142a0: b9 cf rjmp .-142 ; 0x14214 target_temp_reached = false; 142a2: 10 e0 ldi r17, 0x00 ; 0 break; } } lcd_update_enable(true); 142a4: 81 e0 ldi r24, 0x01 ; 1 142a6: 0e 94 3d 6f call 0xde7a ; 0xde7a if (lcd_wait_for_pinda(35) == false) { //waiting for PINDA probe to cool, if this takes more then time expected, temp. cal. fails 142aa: 11 11 cpse r17, r1 142ac: 04 c0 rjmp .+8 ; 0x142b6 lcd_temp_cal_show_result(false); 142ae: 80 e0 ldi r24, 0x00 ; 0 142b0: 0f 94 12 20 call 0x24024 ; 0x24024 142b4: 38 c9 rjmp .-3472 ; 0x13526 break; } } st_synchronize(); 142b6: 0f 94 a3 42 call 0x28546 ; 0x28546 homing_flag = true; // keep homing on to avoid babystepping while the LCD is enabled 142ba: 81 e0 ldi r24, 0x01 ; 1 142bc: 80 93 a6 0d sts 0x0DA6, r24 ; 0x800da6 lcd_update_enable(true); 142c0: 0e 94 3d 6f call 0xde7a ; 0xde7a SERIAL_ECHOLNPGM("PINDA probe calibration start"); 142c4: 8c ed ldi r24, 0xDC ; 220 142c6: 97 e8 ldi r25, 0x87 ; 135 142c8: 0e 94 93 79 call 0xf326 ; 0xf326 float zero_z; int z_shift = 0; //unit: steps float start_temp = 5 * (int)(current_temperature_pinda / 5); 142cc: 80 90 97 03 lds r8, 0x0397 ; 0x800397 142d0: 90 90 98 03 lds r9, 0x0398 ; 0x800398 142d4: a0 90 99 03 lds r10, 0x0399 ; 0x800399 142d8: b0 90 9a 03 lds r11, 0x039A ; 0x80039a 142dc: 20 e0 ldi r18, 0x00 ; 0 142de: 30 e0 ldi r19, 0x00 ; 0 142e0: 40 ea ldi r20, 0xA0 ; 160 142e2: 50 e4 ldi r21, 0x40 ; 64 142e4: c5 01 movw r24, r10 142e6: b4 01 movw r22, r8 142e8: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 142ec: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> 142f0: 25 e0 ldi r18, 0x05 ; 5 142f2: 26 9f mul r18, r22 142f4: a0 01 movw r20, r0 142f6: 27 9f mul r18, r23 142f8: 50 0d add r21, r0 142fa: 11 24 eor r1, r1 142fc: ba 01 movw r22, r20 142fe: 55 0f add r21, r21 14300: 88 0b sbc r24, r24 14302: 99 0b sbc r25, r25 14304: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 14308: 1b 01 movw r2, r22 1430a: 7c 01 movw r14, r24 if (start_temp < 35) start_temp = 35; 1430c: 20 e0 ldi r18, 0x00 ; 0 1430e: 30 e0 ldi r19, 0x00 ; 0 14310: 4c e0 ldi r20, 0x0C ; 12 14312: 52 e4 ldi r21, 0x42 ; 66 14314: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 14318: 87 ff sbrs r24, 7 1431a: 06 c0 rjmp .+12 ; 0x14328 1431c: 21 2c mov r2, r1 1431e: 31 2c mov r3, r1 14320: 6c e0 ldi r22, 0x0C ; 12 14322: e6 2e mov r14, r22 14324: 72 e4 ldi r23, 0x42 ; 66 14326: f7 2e mov r15, r23 if (start_temp < current_temperature_pinda) start_temp += 5; 14328: 22 2d mov r18, r2 1432a: 33 2d mov r19, r3 1432c: 4e 2d mov r20, r14 1432e: 5f 2d mov r21, r15 14330: c5 01 movw r24, r10 14332: b4 01 movw r22, r8 14334: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 14338: 18 16 cp r1, r24 1433a: 64 f4 brge .+24 ; 0x14354 1433c: 20 e0 ldi r18, 0x00 ; 0 1433e: 30 e0 ldi r19, 0x00 ; 0 14340: 40 ea ldi r20, 0xA0 ; 160 14342: 50 e4 ldi r21, 0x40 ; 64 14344: 62 2d mov r22, r2 14346: 73 2d mov r23, r3 14348: 8e 2d mov r24, r14 1434a: 9f 2d mov r25, r15 1434c: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 14350: 1b 01 movw r2, r22 14352: 7c 01 movw r14, r24 printf_P(_N("start temperature: %.1f\n"), start_temp); 14354: ff 92 push r15 14356: ef 92 push r14 14358: 3f 92 push r3 1435a: 2f 92 push r2 1435c: 83 e2 ldi r24, 0x23 ; 35 1435e: 9a e6 ldi r25, 0x6A ; 106 14360: 9f 93 push r25 14362: 8f 93 push r24 14364: 0f 94 99 da call 0x3b532 ; 0x3b532 setTargetBed(70 + (start_temp - 30)); 14368: 20 e0 ldi r18, 0x00 ; 0 1436a: 30 e0 ldi r19, 0x00 ; 0 1436c: 40 ef ldi r20, 0xF0 ; 240 1436e: 51 e4 ldi r21, 0x41 ; 65 14370: 62 2d mov r22, r2 14372: 73 2d mov r23, r3 14374: 8e 2d mov r24, r14 14376: 9f 2d mov r25, r15 14378: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 1437c: 20 e0 ldi r18, 0x00 ; 0 1437e: 30 e0 ldi r19, 0x00 ; 0 14380: 4c e8 ldi r20, 0x8C ; 140 14382: 52 e4 ldi r21, 0x42 ; 66 14384: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 14388: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> 1438c: 70 93 72 06 sts 0x0672, r23 ; 0x800672 14390: 60 93 71 06 sts 0x0671, r22 ; 0x800671 custom_message_type = CustomMsg::TempCal; 14394: 84 e0 ldi r24, 0x04 ; 4 14396: 80 93 c3 06 sts 0x06C3, r24 ; 0x8006c3 custom_message_state = 1; 1439a: 81 e0 ldi r24, 0x01 ; 1 1439c: 80 93 f6 03 sts 0x03F6, r24 ; 0x8003f6 lcd_setstatuspgm(_T(MSG_PINDA_CALIBRATION)); 143a0: 8d e1 ldi r24, 0x1D ; 29 143a2: 95 e4 ldi r25, 0x45 ; 69 143a4: 0e 94 c4 72 call 0xe588 ; 0xe588 143a8: 0e 94 38 f1 call 0x1e270 ; 0x1e270 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 143ac: 80 e0 ldi r24, 0x00 ; 0 143ae: 90 e0 ldi r25, 0x00 ; 0 143b0: a0 ea ldi r26, 0xA0 ; 160 143b2: b0 e4 ldi r27, 0x40 ; 64 143b4: 80 93 99 06 sts 0x0699, r24 ; 0x800699 143b8: 90 93 9a 06 sts 0x069A, r25 ; 0x80069a 143bc: a0 93 9b 06 sts 0x069B, r26 ; 0x80069b 143c0: b0 93 9c 06 sts 0x069C, r27 ; 0x80069c plan_buffer_line_curposXYZE(3000 / 60); 143c4: 60 e0 ldi r22, 0x00 ; 0 143c6: 70 e0 ldi r23, 0x00 ; 0 143c8: 88 e4 ldi r24, 0x48 ; 72 143ca: 92 e4 ldi r25, 0x42 ; 66 143cc: 0f 94 04 c0 call 0x38008 ; 0x38008 current_position[X_AXIS] = PINDA_PREHEAT_X; 143d0: 80 e0 ldi r24, 0x00 ; 0 143d2: 90 e0 ldi r25, 0x00 ; 0 143d4: a0 ea ldi r26, 0xA0 ; 160 143d6: b1 e4 ldi r27, 0x41 ; 65 143d8: 80 93 91 06 sts 0x0691, r24 ; 0x800691 143dc: 90 93 92 06 sts 0x0692, r25 ; 0x800692 143e0: a0 93 93 06 sts 0x0693, r26 ; 0x800693 143e4: b0 93 94 06 sts 0x0694, r27 ; 0x800694 current_position[Y_AXIS] = PINDA_PREHEAT_Y; 143e8: 80 e0 ldi r24, 0x00 ; 0 143ea: 90 e0 ldi r25, 0x00 ; 0 143ec: a0 e7 ldi r26, 0x70 ; 112 143ee: b2 e4 ldi r27, 0x42 ; 66 143f0: 80 93 95 06 sts 0x0695, r24 ; 0x800695 143f4: 90 93 96 06 sts 0x0696, r25 ; 0x800696 143f8: a0 93 97 06 sts 0x0697, r26 ; 0x800697 143fc: b0 93 98 06 sts 0x0698, r27 ; 0x800698 plan_buffer_line_curposXYZE(3000 / 60); 14400: 60 e0 ldi r22, 0x00 ; 0 14402: 70 e0 ldi r23, 0x00 ; 0 14404: 88 e4 ldi r24, 0x48 ; 72 14406: 92 e4 ldi r25, 0x42 ; 66 14408: 0f 94 04 c0 call 0x38008 ; 0x38008 current_position[Z_AXIS] = PINDA_PREHEAT_Z; 1440c: 8a e9 ldi r24, 0x9A ; 154 1440e: 99 e9 ldi r25, 0x99 ; 153 14410: a9 e1 ldi r26, 0x19 ; 25 14412: be e3 ldi r27, 0x3E ; 62 14414: 80 93 99 06 sts 0x0699, r24 ; 0x800699 14418: 90 93 9a 06 sts 0x069A, r25 ; 0x80069a 1441c: a0 93 9b 06 sts 0x069B, r26 ; 0x80069b 14420: b0 93 9c 06 sts 0x069C, r27 ; 0x80069c plan_buffer_line_curposXYZE(3000 / 60); 14424: 60 e0 ldi r22, 0x00 ; 0 14426: 70 e0 ldi r23, 0x00 ; 0 14428: 88 e4 ldi r24, 0x48 ; 72 1442a: 92 e4 ldi r25, 0x42 ; 66 1442c: 0f 94 04 c0 call 0x38008 ; 0x38008 st_synchronize(); 14430: 0f 94 a3 42 call 0x28546 ; 0x28546 14434: 0f 90 pop r0 14436: 0f 90 pop r0 14438: 0f 90 pop r0 1443a: 0f 90 pop r0 1443c: 0f 90 pop r0 1443e: 0f 90 pop r0 while (current_temperature_pinda < start_temp) 14440: 20 91 97 03 lds r18, 0x0397 ; 0x800397 14444: 30 91 98 03 lds r19, 0x0398 ; 0x800398 14448: 40 91 99 03 lds r20, 0x0399 ; 0x800399 1444c: 50 91 9a 03 lds r21, 0x039A ; 0x80039a 14450: 62 2d mov r22, r2 14452: 73 2d mov r23, r3 14454: 8e 2d mov r24, r14 14456: 9f 2d mov r25, r15 14458: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 1445c: 18 16 cp r1, r24 1445e: 3c f4 brge .+14 ; 0x1446e { delay_keep_alive(1000); 14460: 88 ee ldi r24, 0xE8 ; 232 14462: 93 e0 ldi r25, 0x03 ; 3 14464: 0e 94 fc 8c call 0x119f8 ; 0x119f8 serialecho_temperatures(); 14468: 0e 94 76 77 call 0xeeec ; 0xeeec 1446c: e9 cf rjmp .-46 ; 0x14440 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1446e: 60 e0 ldi r22, 0x00 ; 0 14470: 86 ea ldi r24, 0xA6 ; 166 14472: 9f e0 ldi r25, 0x0F ; 15 14474: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 } 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; 14478: 80 e0 ldi r24, 0x00 ; 0 1447a: 90 e0 ldi r25, 0x00 ; 0 1447c: a0 ea ldi r26, 0xA0 ; 160 1447e: b0 e4 ldi r27, 0x40 ; 64 14480: 80 93 99 06 sts 0x0699, r24 ; 0x800699 14484: 90 93 9a 06 sts 0x069A, r25 ; 0x80069a 14488: a0 93 9b 06 sts 0x069B, r26 ; 0x80069b 1448c: b0 93 9c 06 sts 0x069C, r27 ; 0x80069c plan_buffer_line_curposXYZE(3000 / 60); 14490: 60 e0 ldi r22, 0x00 ; 0 14492: 70 e0 ldi r23, 0x00 ; 0 14494: 88 e4 ldi r24, 0x48 ; 72 14496: 92 e4 ldi r25, 0x42 ; 66 14498: 0f 94 04 c0 call 0x38008 ; 0x38008 current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 1449c: ea e0 ldi r30, 0x0A ; 10 1449e: f6 ea ldi r31, 0xA6 ; 166 144a0: 85 91 lpm r24, Z+ 144a2: 95 91 lpm r25, Z+ 144a4: a5 91 lpm r26, Z+ 144a6: b4 91 lpm r27, Z 144a8: 80 93 91 06 sts 0x0691, r24 ; 0x800691 144ac: 90 93 92 06 sts 0x0692, r25 ; 0x800692 144b0: a0 93 93 06 sts 0x0693, r26 ; 0x800693 144b4: b0 93 94 06 sts 0x0694, r27 ; 0x800694 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 144b8: ee e0 ldi r30, 0x0E ; 14 144ba: f6 ea ldi r31, 0xA6 ; 166 144bc: 85 91 lpm r24, Z+ 144be: 95 91 lpm r25, Z+ 144c0: a5 91 lpm r26, Z+ 144c2: b4 91 lpm r27, Z 144c4: 80 93 95 06 sts 0x0695, r24 ; 0x800695 144c8: 90 93 96 06 sts 0x0696, r25 ; 0x800696 144cc: a0 93 97 06 sts 0x0697, r26 ; 0x800697 144d0: b0 93 98 06 sts 0x0698, r27 ; 0x800698 plan_buffer_line_curposXYZE(3000 / 60); 144d4: 60 e0 ldi r22, 0x00 ; 0 144d6: 70 e0 ldi r23, 0x00 ; 0 144d8: 88 e4 ldi r24, 0x48 ; 72 144da: 92 e4 ldi r25, 0x42 ; 66 144dc: 0f 94 04 c0 call 0x38008 ; 0x38008 st_synchronize(); 144e0: 0f 94 a3 42 call 0x28546 ; 0x28546 bool find_z_result = find_bed_induction_sensor_point_z(-1.f); 144e4: 43 e0 ldi r20, 0x03 ; 3 144e6: 60 e0 ldi r22, 0x00 ; 0 144e8: 70 e0 ldi r23, 0x00 ; 0 144ea: 80 e8 ldi r24, 0x80 ; 128 144ec: 9f eb ldi r25, 0xBF ; 191 144ee: 0f 94 12 8c call 0x31824 ; 0x31824 if (find_z_result == false) { 144f2: 81 11 cpse r24, r1 144f4: 06 c0 rjmp .+12 ; 0x14502 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); 144f6: 0f 94 12 20 call 0x24024 ; 0x24024 homing_flag = false; 144fa: 10 92 a6 0d sts 0x0DA6, r1 ; 0x800da6 144fe: 0c 94 93 9a jmp 0x13526 ; 0x13526 if (find_z_result == false) { lcd_temp_cal_show_result(find_z_result); homing_flag = false; break; } zero_z = current_position[Z_AXIS]; 14502: 90 91 99 06 lds r25, 0x0699 ; 0x800699 14506: 67 96 adiw r28, 0x17 ; 23 14508: 9f af std Y+63, r25 ; 0x3f 1450a: 67 97 sbiw r28, 0x17 ; 23 1450c: a0 91 9a 06 lds r26, 0x069A ; 0x80069a 14510: 6b 96 adiw r28, 0x1b ; 27 14512: af af std Y+63, r26 ; 0x3f 14514: 6b 97 sbiw r28, 0x1b ; 27 14516: b0 91 9b 06 lds r27, 0x069B ; 0x80069b 1451a: 6f 96 adiw r28, 0x1f ; 31 1451c: bf af std Y+63, r27 ; 0x3f 1451e: 6f 97 sbiw r28, 0x1f ; 31 14520: e0 91 9c 06 lds r30, 0x069C ; 0x80069c 14524: a7 96 adiw r28, 0x27 ; 39 14526: ef af std Y+63, r30 ; 0x3f 14528: a7 97 sbiw r28, 0x27 ; 39 printf_P(_N("\nZERO: %.3f\n"), current_position[Z_AXIS]); 1452a: ef 93 push r30 1452c: bf 93 push r27 1452e: af 93 push r26 14530: 9f 93 push r25 14532: 86 e1 ldi r24, 0x16 ; 22 14534: 9a e6 ldi r25, 0x6A ; 106 14536: 9f 93 push r25 14538: 8f 93 push r24 1453a: 0f 94 99 da call 0x3b532 ; 0x3b532 1453e: 0f 90 pop r0 14540: 0f 90 pop r0 14542: 0f 90 pop r0 14544: 0f 90 pop r0 14546: 0f 90 pop r0 14548: 0f 90 pop r0 1454a: 4e ea ldi r20, 0xAE ; 174 1454c: 84 2e mov r8, r20 1454e: 4f e0 ldi r20, 0x0F ; 15 14550: 94 2e mov r9, r20 14552: 53 e2 ldi r21, 0x23 ; 35 14554: c5 2e mov r12, r21 14556: d1 2c mov r13, r1 int i = -1; for (; i < 5; i++) 14558: 0f ef ldi r16, 0xFF ; 255 1455a: 1f ef ldi r17, 0xFF ; 255 { float temp = (40 + i * 5); 1455c: b6 01 movw r22, r12 1455e: 0d 2c mov r0, r13 14560: 00 0c add r0, r0 14562: 88 0b sbc r24, r24 14564: 99 0b sbc r25, r25 14566: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 1456a: 2b 01 movw r4, r22 1456c: 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)); 1456e: df 92 push r13 14570: cf 92 push r12 14572: c8 01 movw r24, r16 14574: 02 96 adiw r24, 0x02 ; 2 14576: 9f 93 push r25 14578: 8f 93 push r24 1457a: 2a ed ldi r18, 0xDA ; 218 1457c: 39 e6 ldi r19, 0x69 ; 105 1457e: 3f 93 push r19 14580: 2f 93 push r18 14582: 0f 94 99 da call 0x3b532 ; 0x3b532 14586: 58 01 movw r10, r16 14588: 5f ef ldi r21, 0xFF ; 255 1458a: a5 1a sub r10, r21 1458c: b5 0a sbc r11, r21 if (i >= 0) { 1458e: 0f 90 pop r0 14590: 0f 90 pop r0 14592: 0f 90 pop r0 14594: 0f 90 pop r0 14596: 0f 90 pop r0 14598: 0f 90 pop r0 1459a: 11 f4 brne .+4 ; 0x145a0 1459c: 0c 94 53 cc jmp 0x198a6 ; 0x198a6 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 145a0: 70 e0 ldi r23, 0x00 ; 0 145a2: 60 e0 ldi r22, 0x00 ; 0 145a4: c4 01 movw r24, r8 145a6: 0f 94 19 dc call 0x3b832 ; 0x3b832 eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i, z_shift); } if (start_temp <= temp) break; 145aa: a3 01 movw r20, r6 145ac: 92 01 movw r18, r4 145ae: 62 2d mov r22, r2 145b0: 73 2d mov r23, r3 145b2: 8e 2d mov r24, r14 145b4: 9f 2d mov r25, r15 145b6: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 145ba: 18 16 cp r1, r24 145bc: 44 f4 brge .+16 ; 0x145ce } zero_z = current_position[Z_AXIS]; printf_P(_N("\nZERO: %.3f\n"), current_position[Z_AXIS]); int i = -1; for (; i < 5; i++) 145be: 85 e0 ldi r24, 0x05 ; 5 145c0: a8 16 cp r10, r24 145c2: b1 04 cpc r11, r1 145c4: 11 f0 breq .+4 ; 0x145ca 145c6: 0c 94 5f cc jmp 0x198be ; 0x198be 145ca: 05 e0 ldi r16, 0x05 ; 5 145cc: 10 e0 ldi r17, 0x00 ; 0 145ce: 58 01 movw r10, r16 145d0: 97 e2 ldi r25, 0x27 ; 39 145d2: a9 1a sub r10, r25 145d4: 98 ef ldi r25, 0xF8 ; 248 145d6: b9 0a sbc r11, r25 145d8: aa 0c add r10, r10 145da: bb 1c adc r11, r11 145dc: 85 e0 ldi r24, 0x05 ; 5 145de: 80 9f mul r24, r16 145e0: 10 01 movw r2, r0 145e2: 81 9f mul r24, r17 145e4: 30 0c add r3, r0 145e6: 11 24 eor r1, r1 145e8: 0d 5f subi r16, 0xFD ; 253 145ea: 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; 145ec: 2a e9 ldi r18, 0x9A ; 154 145ee: 42 2e mov r4, r18 145f0: 29 e9 ldi r18, 0x99 ; 153 145f2: 52 2e mov r5, r18 145f4: 29 e1 ldi r18, 0x19 ; 25 145f6: 62 2e mov r6, r18 145f8: 2e e3 ldi r18, 0x3E ; 62 145fa: 72 2e mov r7, r18 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); 145fc: 31 ea ldi r19, 0xA1 ; 161 145fe: 83 2e mov r8, r19 14600: 39 e6 ldi r19, 0x69 ; 105 14602: 93 2e mov r9, r19 eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i, z_shift); } if (start_temp <= temp) break; } for (i++; i < 5; i++) 14604: c8 01 movw r24, r16 14606: 02 97 sbiw r24, 0x02 ; 2 14608: 05 97 sbiw r24, 0x05 ; 5 1460a: 0c f0 brlt .+2 ; 0x1460e 1460c: d4 c0 rjmp .+424 ; 0x147b6 { float temp = (40 + i * 5); 1460e: b1 01 movw r22, r2 14610: 63 5d subi r22, 0xD3 ; 211 14612: 7f 4f sbci r23, 0xFF ; 255 14614: 07 2e mov r0, r23 14616: 00 0c add r0, r0 14618: 88 0b sbc r24, r24 1461a: 99 0b sbc r25, r25 1461c: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 14620: 6b 01 movw r12, r22 14622: 7c 01 movw r14, r24 printf_P(_N("\nStep: %d/6\n"), i + 2); 14624: 1f 93 push r17 14626: 0f 93 push r16 14628: ad ec ldi r26, 0xCD ; 205 1462a: b9 e6 ldi r27, 0x69 ; 105 1462c: bf 93 push r27 1462e: af 93 push r26 14630: 0f 94 99 da call 0x3b532 ; 0x3b532 custom_message_state = i + 2; 14634: 00 93 f6 03 sts 0x03F6, r16 ; 0x8003f6 setTargetBed(50 + 10 * (temp - 30) / 5); 14638: 20 e0 ldi r18, 0x00 ; 0 1463a: 30 e0 ldi r19, 0x00 ; 0 1463c: 40 ef ldi r20, 0xF0 ; 240 1463e: 51 e4 ldi r21, 0x41 ; 65 14640: c7 01 movw r24, r14 14642: b6 01 movw r22, r12 14644: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 14648: 20 e0 ldi r18, 0x00 ; 0 1464a: 30 e0 ldi r19, 0x00 ; 0 1464c: 40 e2 ldi r20, 0x20 ; 32 1464e: 51 e4 ldi r21, 0x41 ; 65 14650: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 14654: 20 e0 ldi r18, 0x00 ; 0 14656: 30 e0 ldi r19, 0x00 ; 0 14658: 40 ea ldi r20, 0xA0 ; 160 1465a: 50 e4 ldi r21, 0x40 ; 64 1465c: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 14660: 20 e0 ldi r18, 0x00 ; 0 14662: 30 e0 ldi r19, 0x00 ; 0 14664: 48 e4 ldi r20, 0x48 ; 72 14666: 52 e4 ldi r21, 0x42 ; 66 14668: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 1466c: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> 14670: 70 93 72 06 sts 0x0672, r23 ; 0x800672 14674: 60 93 71 06 sts 0x0671, r22 ; 0x800671 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 14678: 80 e0 ldi r24, 0x00 ; 0 1467a: 90 e0 ldi r25, 0x00 ; 0 1467c: a0 ea ldi r26, 0xA0 ; 160 1467e: b0 e4 ldi r27, 0x40 ; 64 14680: 80 93 99 06 sts 0x0699, r24 ; 0x800699 14684: 90 93 9a 06 sts 0x069A, r25 ; 0x80069a 14688: a0 93 9b 06 sts 0x069B, r26 ; 0x80069b 1468c: b0 93 9c 06 sts 0x069C, r27 ; 0x80069c plan_buffer_line_curposXYZE(3000 / 60); 14690: 60 e0 ldi r22, 0x00 ; 0 14692: 70 e0 ldi r23, 0x00 ; 0 14694: 88 e4 ldi r24, 0x48 ; 72 14696: 92 e4 ldi r25, 0x42 ; 66 14698: 0f 94 04 c0 call 0x38008 ; 0x38008 current_position[X_AXIS] = PINDA_PREHEAT_X; 1469c: 20 e0 ldi r18, 0x00 ; 0 1469e: 30 e0 ldi r19, 0x00 ; 0 146a0: 40 ea ldi r20, 0xA0 ; 160 146a2: 51 e4 ldi r21, 0x41 ; 65 146a4: 20 93 91 06 sts 0x0691, r18 ; 0x800691 146a8: 30 93 92 06 sts 0x0692, r19 ; 0x800692 146ac: 40 93 93 06 sts 0x0693, r20 ; 0x800693 146b0: 50 93 94 06 sts 0x0694, r21 ; 0x800694 current_position[Y_AXIS] = PINDA_PREHEAT_Y; 146b4: 80 e0 ldi r24, 0x00 ; 0 146b6: 90 e0 ldi r25, 0x00 ; 0 146b8: a0 e7 ldi r26, 0x70 ; 112 146ba: b2 e4 ldi r27, 0x42 ; 66 146bc: 80 93 95 06 sts 0x0695, r24 ; 0x800695 146c0: 90 93 96 06 sts 0x0696, r25 ; 0x800696 146c4: a0 93 97 06 sts 0x0697, r26 ; 0x800697 146c8: b0 93 98 06 sts 0x0698, r27 ; 0x800698 plan_buffer_line_curposXYZE(3000 / 60); 146cc: 60 e0 ldi r22, 0x00 ; 0 146ce: 70 e0 ldi r23, 0x00 ; 0 146d0: 88 e4 ldi r24, 0x48 ; 72 146d2: 92 e4 ldi r25, 0x42 ; 66 146d4: 0f 94 04 c0 call 0x38008 ; 0x38008 current_position[Z_AXIS] = PINDA_PREHEAT_Z; 146d8: 40 92 99 06 sts 0x0699, r4 ; 0x800699 146dc: 50 92 9a 06 sts 0x069A, r5 ; 0x80069a 146e0: 60 92 9b 06 sts 0x069B, r6 ; 0x80069b 146e4: 70 92 9c 06 sts 0x069C, r7 ; 0x80069c plan_buffer_line_curposXYZE(3000 / 60); 146e8: 60 e0 ldi r22, 0x00 ; 0 146ea: 70 e0 ldi r23, 0x00 ; 0 146ec: 88 e4 ldi r24, 0x48 ; 72 146ee: 92 e4 ldi r25, 0x42 ; 66 146f0: 0f 94 04 c0 call 0x38008 ; 0x38008 st_synchronize(); 146f4: 0f 94 a3 42 call 0x28546 ; 0x28546 146f8: 0f 90 pop r0 146fa: 0f 90 pop r0 146fc: 0f 90 pop r0 146fe: 0f 90 pop r0 while (current_temperature_pinda < temp) 14700: 20 91 97 03 lds r18, 0x0397 ; 0x800397 14704: 30 91 98 03 lds r19, 0x0398 ; 0x800398 14708: 40 91 99 03 lds r20, 0x0399 ; 0x800399 1470c: 50 91 9a 03 lds r21, 0x039A ; 0x80039a 14710: c7 01 movw r24, r14 14712: b6 01 movw r22, r12 14714: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 14718: 18 16 cp r1, r24 1471a: 3c f4 brge .+14 ; 0x1472a { delay_keep_alive(1000); 1471c: 88 ee ldi r24, 0xE8 ; 232 1471e: 93 e0 ldi r25, 0x03 ; 3 14720: 0e 94 fc 8c call 0x119f8 ; 0x119f8 serialecho_temperatures(); 14724: 0e 94 76 77 call 0xeeec ; 0xeeec 14728: eb cf rjmp .-42 ; 0x14700 } current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 1472a: 80 e0 ldi r24, 0x00 ; 0 1472c: 90 e0 ldi r25, 0x00 ; 0 1472e: a0 ea ldi r26, 0xA0 ; 160 14730: b0 e4 ldi r27, 0x40 ; 64 14732: 80 93 99 06 sts 0x0699, r24 ; 0x800699 14736: 90 93 9a 06 sts 0x069A, r25 ; 0x80069a 1473a: a0 93 9b 06 sts 0x069B, r26 ; 0x80069b 1473e: b0 93 9c 06 sts 0x069C, r27 ; 0x80069c plan_buffer_line_curposXYZE(3000 / 60); 14742: 60 e0 ldi r22, 0x00 ; 0 14744: 70 e0 ldi r23, 0x00 ; 0 14746: 88 e4 ldi r24, 0x48 ; 72 14748: 92 e4 ldi r25, 0x42 ; 66 1474a: 0f 94 04 c0 call 0x38008 ; 0x38008 current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 1474e: ea e0 ldi r30, 0x0A ; 10 14750: f6 ea ldi r31, 0xA6 ; 166 14752: 85 91 lpm r24, Z+ 14754: 95 91 lpm r25, Z+ 14756: a5 91 lpm r26, Z+ 14758: b4 91 lpm r27, Z 1475a: 80 93 91 06 sts 0x0691, r24 ; 0x800691 1475e: 90 93 92 06 sts 0x0692, r25 ; 0x800692 14762: a0 93 93 06 sts 0x0693, r26 ; 0x800693 14766: b0 93 94 06 sts 0x0694, r27 ; 0x800694 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 1476a: ee e0 ldi r30, 0x0E ; 14 1476c: f6 ea ldi r31, 0xA6 ; 166 1476e: 85 91 lpm r24, Z+ 14770: 95 91 lpm r25, Z+ 14772: a5 91 lpm r26, Z+ 14774: b4 91 lpm r27, Z 14776: 80 93 95 06 sts 0x0695, r24 ; 0x800695 1477a: 90 93 96 06 sts 0x0696, r25 ; 0x800696 1477e: a0 93 97 06 sts 0x0697, r26 ; 0x800697 14782: b0 93 98 06 sts 0x0698, r27 ; 0x800698 plan_buffer_line_curposXYZE(3000 / 60); 14786: 60 e0 ldi r22, 0x00 ; 0 14788: 70 e0 ldi r23, 0x00 ; 0 1478a: 88 e4 ldi r24, 0x48 ; 72 1478c: 92 e4 ldi r25, 0x42 ; 66 1478e: 0f 94 04 c0 call 0x38008 ; 0x38008 st_synchronize(); 14792: 0f 94 a3 42 call 0x28546 ; 0x28546 find_z_result = find_bed_induction_sensor_point_z(-1.f); 14796: 43 e0 ldi r20, 0x03 ; 3 14798: 60 e0 ldi r22, 0x00 ; 0 1479a: 70 e0 ldi r23, 0x00 ; 0 1479c: 80 e8 ldi r24, 0x80 ; 128 1479e: 9f eb ldi r25, 0xBF ; 191 147a0: 0f 94 12 8c call 0x31824 ; 0x31824 147a4: 95 e0 ldi r25, 0x05 ; 5 147a6: 29 0e add r2, r25 147a8: 31 1c adc r3, r1 147aa: 0f 5f subi r16, 0xFF ; 255 147ac: 1f 4f sbci r17, 0xFF ; 255 if (find_z_result == false) { 147ae: 81 11 cpse r24, r1 147b0: 04 c0 rjmp .+8 ; 0x147ba lcd_temp_cal_show_result(find_z_result); 147b2: 0f 94 12 20 call 0x24024 ; 0x24024 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); 147b6: 81 e0 ldi r24, 0x01 ; 1 147b8: 9e ce rjmp .-708 ; 0x144f6 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]); 147ba: 67 96 adiw r28, 0x17 ; 23 147bc: 7f ad ldd r23, Y+63 ; 0x3f 147be: 67 97 sbiw r28, 0x17 ; 23 147c0: 6b 96 adiw r28, 0x1b ; 27 147c2: 6f ad ldd r22, Y+63 ; 0x3f 147c4: 6b 97 sbiw r28, 0x1b ; 27 147c6: 6f 96 adiw r28, 0x1f ; 31 147c8: 9f ad ldd r25, Y+63 ; 0x3f 147ca: 6f 97 sbiw r28, 0x1f ; 31 147cc: a7 96 adiw r28, 0x27 ; 39 147ce: 8f ad ldd r24, Y+63 ; 0x3f 147d0: a7 97 sbiw r28, 0x27 ; 39 147d2: 27 2f mov r18, r23 147d4: 36 2f mov r19, r22 147d6: 49 2f mov r20, r25 147d8: 58 2f mov r21, r24 147da: 60 91 99 06 lds r22, 0x0699 ; 0x800699 147de: 70 91 9a 06 lds r23, 0x069A ; 0x80069a 147e2: 80 91 9b 06 lds r24, 0x069B ; 0x80069b 147e6: 90 91 9c 06 lds r25, 0x069C ; 0x80069c 147ea: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 147ee: f6 2e mov r15, r22 147f0: e7 2e mov r14, r23 147f2: d8 2e mov r13, r24 147f4: c9 2e mov r12, r25 147f6: 20 91 c9 0d lds r18, 0x0DC9 ; 0x800dc9 147fa: 30 91 ca 0d lds r19, 0x0DCA ; 0x800dca 147fe: 40 91 cb 0d lds r20, 0x0DCB ; 0x800dcb 14802: 50 91 cc 0d lds r21, 0x0DCC ; 0x800dcc 14806: d7 01 movw r26, r14 14808: f6 01 movw r30, r12 1480a: 6b 2f mov r22, r27 1480c: 7a 2f mov r23, r26 1480e: 8f 2f mov r24, r31 14810: 9e 2f mov r25, r30 14812: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 14816: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> 1481a: a6 96 adiw r28, 0x26 ; 38 1481c: 6c af std Y+60, r22 ; 0x3c 1481e: 7d af std Y+61, r23 ; 0x3d 14820: 8e af std Y+62, r24 ; 0x3e 14822: 9f af std Y+63, r25 ; 0x3f 14824: a6 97 sbiw r28, 0x26 ; 38 printf_P(_N("\nPINDA temperature: %.1f Z shift (mm): %.3f"), current_temperature_pinda, current_position[Z_AXIS] - zero_z); 14826: cf 92 push r12 14828: df 92 push r13 1482a: ef 92 push r14 1482c: ff 92 push r15 1482e: 80 91 9a 03 lds r24, 0x039A ; 0x80039a 14832: 8f 93 push r24 14834: 80 91 99 03 lds r24, 0x0399 ; 0x800399 14838: 8f 93 push r24 1483a: 80 91 98 03 lds r24, 0x0398 ; 0x800398 1483e: 8f 93 push r24 14840: 80 91 97 03 lds r24, 0x0397 ; 0x800397 14844: 8f 93 push r24 14846: 9f 92 push r9 14848: 8f 92 push r8 1484a: 0f 94 99 da call 0x3b532 ; 0x3b532 1484e: a4 96 adiw r28, 0x24 ; 36 14850: 6e ad ldd r22, Y+62 ; 0x3e 14852: 7f ad ldd r23, Y+63 ; 0x3f 14854: a4 97 sbiw r28, 0x24 ; 36 14856: c5 01 movw r24, r10 14858: 0f 94 19 dc call 0x3b832 ; 0x3b832 1485c: a2 e0 ldi r26, 0x02 ; 2 1485e: aa 0e add r10, r26 14860: b1 1c adc r11, r1 14862: 0f b6 in r0, 0x3f ; 63 14864: f8 94 cli 14866: de bf out 0x3e, r29 ; 62 14868: 0f be out 0x3f, r0 ; 63 1486a: cd bf out 0x3d, r28 ; 61 1486c: cb ce rjmp .-618 ; 0x14604 This G-code will be performed at the start of a calibration script. (Prusa3D specific) */ case 86: calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 1486e: 80 e1 ldi r24, 0x10 ; 16 14870: 0e 94 18 ee call 0x1dc30 ; 0x1dc30 14874: 0c 94 93 9a jmp 0x13526 ; 0x13526 This G-code will be performed at the end of a calibration script. (Prusa3D specific) */ case 87: calibration_status_set(CALIBRATION_STATUS_LIVE_ADJUST); 14878: 80 e1 ldi r24, 0x10 ; 16 1487a: 0e 94 6d ee call 0x1dcda ; 0x1dcda 1487e: 0c 94 93 9a jmp 0x13526 ; 0x13526 /*! ### 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); 14882: 80 91 e3 03 lds r24, 0x03E3 ; 0x8003e3 14886: 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; 14888: 80 93 e3 03 sts 0x03E3, r24 ; 0x8003e3 1488c: 0c 94 93 9a jmp 0x13526 ; 0x13526 14890: 80 91 e3 03 lds r24, 0x03E3 ; 0x8003e3 14894: 87 60 ori r24, 0x07 ; 7 14896: f8 cf rjmp .-16 ; 0x14888 plan_reset_next_e(); } else { // In any other case we're forced to synchronize st_synchronize(); 14898: 0f 94 a3 42 call 0x28546 ; 0x28546 1489c: f1 2c mov r15, r1 1489e: e1 2c mov r14, r1 for(uint8_t i = 0; i < 3; ++i) { if(codes[i]) 148a0: f8 01 movw r30, r16 148a2: 81 91 ld r24, Z+ 148a4: 8f 01 movw r16, r30 148a6: 88 23 and r24, r24 148a8: d1 f0 breq .+52 ; 0x148de current_position[i] = values[i] + cs.add_homing[i]; 148aa: 97 01 movw r18, r14 148ac: 2f 56 subi r18, 0x6F ; 111 148ae: 39 4f sbci r19, 0xF9 ; 249 148b0: 59 01 movw r10, r18 148b2: f3 01 movw r30, r6 148b4: ee 0d add r30, r14 148b6: ff 1d adc r31, r15 148b8: 20 81 ld r18, Z 148ba: 31 81 ldd r19, Z+1 ; 0x01 148bc: 42 81 ldd r20, Z+2 ; 0x02 148be: 53 81 ldd r21, Z+3 ; 0x03 148c0: f7 01 movw r30, r14 148c2: eb 5e subi r30, 0xEB ; 235 148c4: f1 4f sbci r31, 0xF1 ; 241 148c6: 60 81 ld r22, Z 148c8: 71 81 ldd r23, Z+1 ; 0x01 148ca: 82 81 ldd r24, Z+2 ; 0x02 148cc: 93 81 ldd r25, Z+3 ; 0x03 148ce: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 148d2: d5 01 movw r26, r10 148d4: 6d 93 st X+, r22 148d6: 7d 93 st X+, r23 148d8: 8d 93 st X+, r24 148da: 9c 93 st X, r25 148dc: 13 97 sbiw r26, 0x03 ; 3 148de: b4 e0 ldi r27, 0x04 ; 4 148e0: eb 0e add r14, r27 148e2: 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) 148e4: ec e0 ldi r30, 0x0C ; 12 148e6: ee 16 cp r14, r30 148e8: f1 04 cpc r15, r1 148ea: d1 f6 brne .-76 ; 0x148a0 { if(codes[i]) current_position[i] = values[i] + cs.add_homing[i]; } if(codes[E_AXIS]) 148ec: dd 20 and r13, r13 148ee: 61 f0 breq .+24 ; 0x14908 current_position[E_AXIS] = values[E_AXIS]; 148f0: 8d 85 ldd r24, Y+13 ; 0x0d 148f2: 9e 85 ldd r25, Y+14 ; 0x0e 148f4: af 85 ldd r26, Y+15 ; 0x0f 148f6: b8 89 ldd r27, Y+16 ; 0x10 148f8: 80 93 9d 06 sts 0x069D, r24 ; 0x80069d 148fc: 90 93 9e 06 sts 0x069E, r25 ; 0x80069e 14900: a0 93 9f 06 sts 0x069F, r26 ; 0x80069f 14904: b0 93 a0 06 sts 0x06A0, r27 ; 0x8006a0 // Set all at once plan_set_position_curposXYZE(); 14908: 0f 94 c4 be call 0x37d88 ; 0x37d88 1490c: 0c 94 93 9a jmp 0x13526 ; 0x13526 /*! --------------------------------------------------------------------------------- # M Commands */ else if(*CMDBUFFER_CURRENT_STRING == 'M') 14910: 8d 34 cpi r24, 0x4D ; 77 14912: 11 f0 breq .+4 ; 0x14918 14914: 0c 94 c4 ca jmp 0x19588 ; 0x19588 { strchr_pointer = CMDBUFFER_CURRENT_STRING; 14918: 10 93 94 03 sts 0x0394, r17 ; 0x800394 1491c: 00 93 93 03 sts 0x0393, r16 ; 0x800393 14920: f8 01 movw r30, r16 14922: 31 96 adiw r30, 0x01 ; 1 int index; for (index = 1; *(strchr_pointer + index) == ' ' || *(strchr_pointer + index) == '\t'; index++); 14924: 81 91 ld r24, Z+ 14926: 80 32 cpi r24, 0x20 ; 32 14928: e9 f3 breq .-6 ; 0x14924 1492a: 89 30 cpi r24, 0x09 ; 9 1492c: d9 f3 breq .-10 ; 0x14924 /*for (++strchr_pointer; *strchr_pointer == ' ' || *strchr_pointer == '\t'; ++strchr_pointer);*/ if (*(strchr_pointer+index) < '0' || *(strchr_pointer+index) > '9') { 1492e: 80 53 subi r24, 0x30 ; 48 14930: 8a 30 cpi r24, 0x0A ; 10 14932: 70 f0 brcs .+28 ; 0x14950 printf_P(PSTR("Invalid M code: %s\n"), cmdbuffer + bufindr + CMDHDRSIZE); 14934: 1f 93 push r17 14936: 0f 93 push r16 14938: 88 ec ldi r24, 0xC8 ; 200 1493a: 97 e8 ldi r25, 0x87 ; 135 1493c: 9f 93 push r25 1493e: 8f 93 push r24 14940: 0f 94 99 da call 0x3b532 ; 0x3b532 14944: 0f 90 pop r0 14946: 0f 90 pop r0 14948: 0f 90 pop r0 1494a: 0f 90 pop r0 1494c: 0c 94 50 96 jmp 0x12ca0 ; 0x12ca0 } else { mcode_in_progress = code_value_short(); 14950: 0e 94 8d 5b call 0xb71a ; 0xb71a 14954: 90 93 aa 0d sts 0x0DAA, r25 ; 0x800daa <_ZL17mcode_in_progress.lto_priv.530+0x1> 14958: 80 93 a9 0d sts 0x0DA9, r24 ; 0x800da9 <_ZL17mcode_in_progress.lto_priv.530> // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1495c: 89 3c cpi r24, 0xC9 ; 201 1495e: 91 05 cpc r25, r1 14960: 11 f4 brne .+4 ; 0x14966 14962: 0c 94 86 b2 jmp 0x1650c ; 0x1650c 14966: 0c f0 brlt .+2 ; 0x1496a 14968: 08 c3 rjmp .+1552 ; 0x14f7a 1496a: 8e 34 cpi r24, 0x4E ; 78 1496c: 91 05 cpc r25, r1 1496e: 11 f4 brne .+4 ; 0x14974 14970: 0c 94 3c ae jmp 0x15c78 ; 0x15c78 14974: 0c f0 brlt .+2 ; 0x14978 14976: 0e c2 rjmp .+1052 ; 0x14d94 14978: 8c 31 cpi r24, 0x1C ; 28 1497a: 91 05 cpc r25, r1 1497c: 09 f4 brne .+2 ; 0x14980 1497e: de c7 rjmp .+4028 ; 0x1593c 14980: 0c f0 brlt .+2 ; 0x14984 14982: f1 c0 rjmp .+482 ; 0x14b66 14984: 85 31 cpi r24, 0x15 ; 21 14986: 91 05 cpc r25, r1 14988: 09 f4 brne .+2 ; 0x1498c 1498a: f1 c6 rjmp .+3554 ; 0x1576e 1498c: 0c f0 brlt .+2 ; 0x14990 1498e: 5a c0 rjmp .+180 ; 0x14a44 14990: 81 31 cpi r24, 0x11 ; 17 14992: 91 05 cpc r25, r1 14994: 09 f4 brne .+2 ; 0x14998 14996: e0 c6 rjmp .+3520 ; 0x15758 14998: dc f4 brge .+54 ; 0x149d0 1499a: 02 97 sbiw r24, 0x02 ; 2 1499c: 08 f4 brcc .+2 ; 0x149a0 1499e: 50 c6 rjmp .+3232 ; 0x15640 /*! #### End of M-Commands */ default: printf_P(MSG_UNKNOWN_CODE, 'M', cmdbuffer + bufindr + CMDHDRSIZE); 149a0: 80 91 91 12 lds r24, 0x1291 ; 0x801291 149a4: 90 91 92 12 lds r25, 0x1292 ; 0x801292 149a8: 89 55 subi r24, 0x59 ; 89 149aa: 9f 4e sbci r25, 0xEF ; 239 149ac: 9f 93 push r25 149ae: 8f 93 push r24 149b0: 1f 92 push r1 149b2: 8d e4 ldi r24, 0x4D ; 77 149b4: 8f 93 push r24 149b6: 8c e8 ldi r24, 0x8C ; 140 149b8: 99 e6 ldi r25, 0x69 ; 105 149ba: 9f 93 push r25 149bc: 8f 93 push r24 149be: 0f 94 99 da call 0x3b532 ; 0x3b532 149c2: 0f 90 pop r0 149c4: 0f 90 pop r0 149c6: 0f 90 pop r0 149c8: 0f 90 pop r0 149ca: 0f 90 pop r0 149cc: 0f 90 pop r0 149ce: 1d c6 rjmp .+3130 ; 0x1560a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 149d0: 82 31 cpi r24, 0x12 ; 18 149d2: 91 05 cpc r25, r1 149d4: 11 f4 brne .+4 ; 0x149da 149d6: 0c 94 9f af jmp 0x15f3e ; 0x15f3e 149da: 44 97 sbiw r24, 0x14 ; 20 149dc: 09 f7 brne .-62 ; 0x149a0 #### 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() 149de: 81 e0 ldi r24, 0x01 ; 1 149e0: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be SERIAL_PROTOCOLLNRPGM(_N("Begin file list"));////MSG_BEGIN_FILE_LIST 149e4: 8c e7 ldi r24, 0x7C ; 124 149e6: 99 e6 ldi r25, 0x69 ; 105 149e8: 0e 94 93 79 call 0xf326 ; 0xf326 card.ls(CardReader::ls_param(code_seen('L'), code_seen('T'))); 149ec: 84 e5 ldi r24, 0x54 ; 84 149ee: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 149f2: 18 2f mov r17, r24 149f4: 8c e4 ldi r24, 0x4C ; 76 149f6: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 149fa: 00 e0 ldi r16, 0x00 ; 0 149fc: 80 fb bst r24, 0 149fe: 00 f9 bld r16, 0 14a00: 10 fb bst r17, 0 14a02: 01 f9 bld r16, 1 } // while readDir } void CardReader::ls(ls_param params) { root.rewind(); 14a04: 85 e1 ldi r24, 0x15 ; 21 14a06: 95 e1 ldi r25, 0x15 ; 21 14a08: 0e 94 44 77 call 0xee88 ; 0xee88 lsDive("",root, NULL, LS_SerialPrint, params); 14a0c: 83 e2 ldi r24, 0x23 ; 35 14a0e: e5 e1 ldi r30, 0x15 ; 21 14a10: f5 e1 ldi r31, 0x15 ; 21 14a12: de 01 movw r26, r28 14a14: 11 96 adiw r26, 0x01 ; 1 14a16: 01 90 ld r0, Z+ 14a18: 0d 92 st X+, r0 14a1a: 8a 95 dec r24 14a1c: e1 f7 brne .-8 ; 0x14a16 14a1e: 20 e0 ldi r18, 0x00 ; 0 14a20: 50 e0 ldi r21, 0x00 ; 0 14a22: 40 e0 ldi r20, 0x00 ; 0 14a24: be 01 movw r22, r28 14a26: 6f 5f subi r22, 0xFF ; 255 14a28: 7f 4f sbci r23, 0xFF ; 255 14a2a: 86 ef ldi r24, 0xF6 ; 246 14a2c: 92 e0 ldi r25, 0x02 ; 2 14a2e: 0f 94 ca 76 call 0x2ed94 ; 0x2ed94 14a32: ce 01 movw r24, r28 14a34: 01 96 adiw r24, 0x01 ; 1 14a36: 0e 94 49 77 call 0xee92 ; 0xee92 SERIAL_PROTOCOLLNRPGM(_N("End file list"));////MSG_END_FILE_LIST 14a3a: 8e e6 ldi r24, 0x6E ; 110 14a3c: 99 e6 ldi r25, 0x69 ; 105 14a3e: 0e 94 93 79 call 0xf326 ; 0xf326 14a42: e3 c5 rjmp .+3014 ; 0x1560a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14a44: 88 31 cpi r24, 0x18 ; 24 14a46: 91 05 cpc r25, r1 14a48: 09 f4 brne .+2 ; 0x14a4c 14a4a: a2 c6 rjmp .+3396 ; 0x15790 14a4c: 84 f4 brge .+32 ; 0x14a6e 14a4e: 86 31 cpi r24, 0x16 ; 22 14a50: 91 05 cpc r25, r1 14a52: 09 f4 brne .+2 ; 0x14a56 14a54: 90 c6 rjmp .+3360 ; 0x15776 14a56: 47 97 sbiw r24, 0x17 ; 23 14a58: 09 f0 breq .+2 ; 0x14a5c 14a5a: a2 cf rjmp .-188 ; 0x149a0 M23 [filename] */ case 23: card.openFileReadFilteredGcode(strchr_pointer + 4, true); 14a5c: 80 91 93 03 lds r24, 0x0393 ; 0x800393 14a60: 90 91 94 03 lds r25, 0x0394 ; 0x800394 14a64: 61 e0 ldi r22, 0x01 ; 1 14a66: 04 96 adiw r24, 0x04 ; 4 14a68: 0f 94 06 7f call 0x2fe0c ; 0x2fe0c 14a6c: ce c5 rjmp .+2972 ; 0x1560a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14a6e: 8a 31 cpi r24, 0x1A ; 26 14a70: 91 05 cpc r25, r1 14a72: 09 f4 brne .+2 ; 0x14a76 14a74: d3 c6 rjmp .+3494 ; 0x1581c 14a76: 0c f0 brlt .+2 ; 0x14a7a 14a78: f3 c6 rjmp .+3558 ; 0x15860 14a7a: 0d ed ldi r16, 0xDD ; 221 14a7c: 12 e0 ldi r17, 0x02 ; 2 14a7e: ff e3 ldi r31, 0x3F ; 63 14a80: af 2e mov r10, r31 14a82: f2 e0 ldi r31, 0x02 ; 2 14a84: bf 2e mov r11, r31 14a86: a1 e2 ldi r26, 0x21 ; 33 14a88: ca 2e mov r12, r26 14a8a: a2 e0 ldi r26, 0x02 ; 2 14a8c: da 2e mov r13, r26 14a8e: b5 e1 ldi r27, 0x15 ; 21 14a90: eb 2e mov r14, r27 14a92: b2 e0 ldi r27, 0x02 ; 2 14a94: fb 2e mov r15, r27 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])) { 14a96: f8 01 movw r30, r16 14a98: 81 91 ld r24, Z+ 14a9a: 8f 01 movw r16, r30 14a9c: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 14aa0: 88 23 and r24, r24 14aa2: 21 f1 breq .+72 ; 0x14aec //Check that the positions are within hardware limits pause_position[axis] = constrain(code_value(), min_pos[axis], max_pos[axis]); 14aa4: 0e 94 b5 60 call 0xc16a ; 0xc16a 14aa8: d6 01 movw r26, r12 14aaa: 4d 90 ld r4, X+ 14aac: 5d 90 ld r5, X+ 14aae: 6d 90 ld r6, X+ 14ab0: 7c 90 ld r7, X 14ab2: a3 01 movw r20, r6 14ab4: 92 01 movw r18, r4 14ab6: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 14aba: 87 fd sbrc r24, 7 14abc: 11 c0 rjmp .+34 ; 0x14ae0 14abe: 0e 94 b5 60 call 0xc16a ; 0xc16a 14ac2: f7 01 movw r30, r14 14ac4: 40 80 ld r4, Z 14ac6: 51 80 ldd r5, Z+1 ; 0x01 14ac8: 62 80 ldd r6, Z+2 ; 0x02 14aca: 73 80 ldd r7, Z+3 ; 0x03 14acc: a3 01 movw r20, r6 14ace: 92 01 movw r18, r4 14ad0: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 14ad4: 18 16 cp r1, r24 14ad6: 24 f0 brlt .+8 ; 0x14ae0 14ad8: 0e 94 b5 60 call 0xc16a ; 0xc16a 14adc: 2b 01 movw r4, r22 14ade: 3c 01 movw r6, r24 14ae0: d5 01 movw r26, r10 14ae2: 4d 92 st X+, r4 14ae4: 5d 92 st X+, r5 14ae6: 6d 92 st X+, r6 14ae8: 7c 92 st X, r7 14aea: 13 97 sbiw r26, 0x03 ; 3 14aec: b4 e0 ldi r27, 0x04 ; 4 14aee: ab 0e add r10, r27 14af0: b1 1c adc r11, r1 14af2: e4 e0 ldi r30, 0x04 ; 4 14af4: ce 0e add r12, r30 14af6: d1 1c adc r13, r1 14af8: f4 e0 ldi r31, 0x04 ; 4 14afa: ef 0e add r14, r31 14afc: 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++) { 14afe: 22 e0 ldi r18, 0x02 ; 2 14b00: 00 3e cpi r16, 0xE0 ; 224 14b02: 12 07 cpc r17, r18 14b04: 41 f6 brne .-112 ; 0x14a96 //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')) { 14b06: 83 e5 ldi r24, 0x53 ; 83 14b08: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 14b0c: 88 23 and r24, r24 14b0e: 11 f4 brne .+4 ; 0x14b14 14b10: 0c 94 42 c3 jmp 0x18684 ; 0x18684 if ( code_value_uint8() == 0 ) { 14b14: 0e 94 80 5b call 0xb700 ; 0xb700 14b18: 81 11 cpse r24, r1 14b1a: 77 c5 rjmp .+2798 ; 0x1560a pause_position[X_AXIS] = X_PAUSE_POS; 14b1c: 80 e0 ldi r24, 0x00 ; 0 14b1e: 90 e0 ldi r25, 0x00 ; 0 14b20: a8 e4 ldi r26, 0x48 ; 72 14b22: b2 e4 ldi r27, 0x42 ; 66 14b24: 80 93 3f 02 sts 0x023F, r24 ; 0x80023f <_ZL14pause_position.lto_priv.481> 14b28: 90 93 40 02 sts 0x0240, r25 ; 0x800240 <_ZL14pause_position.lto_priv.481+0x1> 14b2c: a0 93 41 02 sts 0x0241, r26 ; 0x800241 <_ZL14pause_position.lto_priv.481+0x2> 14b30: b0 93 42 02 sts 0x0242, r27 ; 0x800242 <_ZL14pause_position.lto_priv.481+0x3> pause_position[Y_AXIS] = Y_PAUSE_POS; 14b34: 80 e0 ldi r24, 0x00 ; 0 14b36: 90 e0 ldi r25, 0x00 ; 0 14b38: ae e3 ldi r26, 0x3E ; 62 14b3a: b3 e4 ldi r27, 0x43 ; 67 14b3c: 80 93 43 02 sts 0x0243, r24 ; 0x800243 <_ZL14pause_position.lto_priv.481+0x4> 14b40: 90 93 44 02 sts 0x0244, r25 ; 0x800244 <_ZL14pause_position.lto_priv.481+0x5> 14b44: a0 93 45 02 sts 0x0245, r26 ; 0x800245 <_ZL14pause_position.lto_priv.481+0x6> 14b48: b0 93 46 02 sts 0x0246, r27 ; 0x800246 <_ZL14pause_position.lto_priv.481+0x7> pause_position[Z_AXIS] = Z_PAUSE_LIFT; 14b4c: 80 e0 ldi r24, 0x00 ; 0 14b4e: 90 e0 ldi r25, 0x00 ; 0 14b50: a0 ea ldi r26, 0xA0 ; 160 14b52: b1 e4 ldi r27, 0x41 ; 65 14b54: 80 93 47 02 sts 0x0247, r24 ; 0x800247 <_ZL14pause_position.lto_priv.481+0x8> 14b58: 90 93 48 02 sts 0x0248, r25 ; 0x800248 <_ZL14pause_position.lto_priv.481+0x9> 14b5c: a0 93 49 02 sts 0x0249, r26 ; 0x800249 <_ZL14pause_position.lto_priv.481+0xa> 14b60: b0 93 4a 02 sts 0x024A, r27 ; 0x80024a <_ZL14pause_position.lto_priv.481+0xb> 14b64: 52 c5 rjmp .+2724 ; 0x1560a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14b66: 8d 32 cpi r24, 0x2D ; 45 14b68: 91 05 cpc r25, r1 14b6a: 09 f4 brne .+2 ; 0x14b6e 14b6c: 89 c7 rjmp .+3858 ; 0x15a80 14b6e: 0c f0 brlt .+2 ; 0x14b72 14b70: e3 c0 rjmp .+454 ; 0x14d38 14b72: 8f 31 cpi r24, 0x1F ; 31 14b74: 91 05 cpc r25, r1 14b76: 09 f4 brne .+2 ; 0x14b7a 14b78: 10 c7 rjmp .+3616 ; 0x1599a 14b7a: 0c f0 brlt .+2 ; 0x14b7e 14b7c: 63 c0 rjmp .+198 ; 0x14c44 14b7e: 8d 31 cpi r24, 0x1D ; 29 14b80: 91 05 cpc r25, r1 14b82: 09 f4 brne .+2 ; 0x14b86 14b84: 42 c5 rjmp .+2692 ; 0x1560a 14b86: 4e 97 sbiw r24, 0x1e ; 30 14b88: 09 f0 breq .+2 ; 0x14b8c 14b8a: 0a cf rjmp .-492 ; 0x149a0 M30 [filename] */ case 30: if (card.mounted){ 14b8c: 80 91 90 14 lds r24, 0x1490 ; 0x801490 14b90: 88 23 and r24, r24 14b92: 09 f4 brne .+2 ; 0x14b96 14b94: 3a c5 rjmp .+2676 ; 0x1560a lastnr++; } void CardReader::closefile(bool store_location) { file.sync(); 14b96: 8f e1 ldi r24, 0x1F ; 31 14b98: 97 e1 ldi r25, 0x17 ; 23 14b9a: 0f 94 f6 57 call 0x2afec ; 0x2afec file.close(); 14b9e: 8f e1 ldi r24, 0x1F ; 31 14ba0: 97 e1 ldi r25, 0x17 ; 23 14ba2: 0f 94 2b 58 call 0x2b056 ; 0x2b056 saving = false; 14ba6: 10 92 8d 14 sts 0x148D, r1 ; 0x80148d logging = false; 14baa: 10 92 8e 14 sts 0x148E, r1 ; 0x80148e card.closefile(); card.removeFile(strchr_pointer + 4); 14bae: 00 91 93 03 lds r16, 0x0393 ; 0x800393 14bb2: 10 91 94 03 lds r17, 0x0394 ; 0x800394 14bb6: 0c 5f subi r16, 0xFC ; 252 14bb8: 1f 4f sbci r17, 0xFF ; 255 } } void CardReader::removeFile(const char* name) { if(!mounted) return; 14bba: 80 91 90 14 lds r24, 0x1490 ; 0x801490 14bbe: 88 23 and r24, r24 14bc0: 09 f4 brne .+2 ; 0x14bc4 14bc2: 23 c5 rjmp .+2630 ; 0x1560a file.close(); 14bc4: 8f e1 ldi r24, 0x1F ; 31 14bc6: 97 e1 ldi r25, 0x17 ; 23 14bc8: 0f 94 2b 58 call 0x2b056 ; 0x2b056 sdprinting = false; 14bcc: 10 92 8f 14 sts 0x148F, r1 ; 0x80148f const char *fname=name; 14bd0: 23 96 adiw r28, 0x03 ; 3 14bd2: 1f af std Y+63, r17 ; 0x3f 14bd4: 0e af std Y+62, r16 ; 0x3e 14bd6: 23 97 sbiw r28, 0x03 ; 3 if (!diveSubfolder(fname)) 14bd8: ce 01 movw r24, r28 14bda: 8f 5b subi r24, 0xBF ; 191 14bdc: 9f 4f sbci r25, 0xFF ; 255 14bde: 0f 94 81 7e call 0x2fd02 ; 0x2fd02 14be2: 88 23 and r24, r24 14be4: 09 f4 brne .+2 ; 0x14be8 14be6: 11 c5 rjmp .+2594 ; 0x1560a return; if (file.remove(curDir, fname)) 14be8: 23 96 adiw r28, 0x03 ; 3 14bea: 4e ad ldd r20, Y+62 ; 0x3e 14bec: 5f ad ldd r21, Y+63 ; 0x3f 14bee: 23 97 sbiw r28, 0x03 ; 3 14bf0: 60 91 38 15 lds r22, 0x1538 ; 0x801538 14bf4: 70 91 39 15 lds r23, 0x1539 ; 0x801539 * \brief Base class for SdFile with Print and C++ streams. */ class SdBaseFile { public: /** Create an instance. */ SdBaseFile() : writeError(false), type_(FAT_FILE_TYPE_CLOSED) {} 14bf8: 19 82 std Y+1, r1 ; 0x01 14bfa: 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; 14bfc: 22 e0 ldi r18, 0x02 ; 2 14bfe: ce 01 movw r24, r28 14c00: 01 96 adiw r24, 0x01 ; 1 14c02: 0f 94 d3 63 call 0x2c7a6 ; 0x2c7a6 14c06: 81 11 cpse r24, r1 14c08: a1 c6 rjmp .+3394 ; 0x1594c return file.remove(); fail: // can't set iostate - static function return false; 14c0a: 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; 14c0c: ce 01 movw r24, r28 14c0e: 01 96 adiw r24, 0x01 ; 1 14c10: 0e 94 49 77 call 0xee92 ; 0xee92 14c14: 11 23 and r17, r17 14c16: 09 f4 brne .+2 ; 0x14c1a 14c18: b0 c6 rjmp .+3424 ; 0x1597a { SERIAL_PROTOCOLPGM("File deleted:"); 14c1a: 84 ef ldi r24, 0xF4 ; 244 14c1c: 94 e8 ldi r25, 0x84 ; 132 14c1e: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_PROTOCOLLN(fname); 14c22: 23 96 adiw r28, 0x03 ; 3 14c24: 8e ad ldd r24, Y+62 ; 0x3e 14c26: 9f ad ldd r25, Y+63 ; 0x3f 14c28: 23 97 sbiw r28, 0x03 ; 3 14c2a: 0f 94 bb d5 call 0x3ab76 ; 0x3ab76 sdpos = 0; 14c2e: 10 92 a3 17 sts 0x17A3, r1 ; 0x8017a3 14c32: 10 92 a4 17 sts 0x17A4, r1 ; 0x8017a4 14c36: 10 92 a5 17 sts 0x17A5, r1 ; 0x8017a5 14c3a: 10 92 a6 17 sts 0x17A6, r1 ; 0x8017a6 #ifdef SDCARD_SORT_ALPHA presort(); 14c3e: 0f 94 4d 7c call 0x2f89a ; 0x2f89a 14c42: e3 c4 rjmp .+2502 ; 0x1560a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14c44: 8a 32 cpi r24, 0x2A ; 42 14c46: 91 05 cpc r25, r1 14c48: 09 f4 brne .+2 ; 0x14c4c 14c4a: ce c6 rjmp .+3484 ; 0x159e8 14c4c: 8c 32 cpi r24, 0x2C ; 44 14c4e: 91 05 cpc r25, r1 14c50: 09 f4 brne .+2 ; 0x14c54 14c52: fd c6 rjmp .+3578 ; 0x15a4e 14c54: 80 97 sbiw r24, 0x20 ; 32 14c56: 09 f0 breq .+2 ; 0x14c5a 14c58: a3 ce rjmp .-698 ; 0x149a0 - `S` - Starting file offset */ case 32: { if(card.sdprinting) { 14c5a: 80 91 8f 14 lds r24, 0x148F ; 0x80148f 14c5e: 81 11 cpse r24, r1 st_synchronize(); 14c60: 0f 94 a3 42 call 0x28546 ; 0x28546 } const char* namestartpos = (strchr(strchr_pointer + 4,'!')); //find ! to indicate filename string start. 14c64: 00 91 93 03 lds r16, 0x0393 ; 0x800393 14c68: 10 91 94 03 lds r17, 0x0394 ; 0x800394 14c6c: 0c 5f subi r16, 0xFC ; 252 14c6e: 1f 4f sbci r17, 0xFF ; 255 14c70: 61 e2 ldi r22, 0x21 ; 33 14c72: 70 e0 ldi r23, 0x00 ; 0 14c74: c8 01 movw r24, r16 14c76: 0f 94 2e e2 call 0x3c45c ; 0x3c45c if(namestartpos==NULL) 14c7a: 00 97 sbiw r24, 0x00 ; 0 14c7c: 19 f0 breq .+6 ; 0x14c84 { namestartpos=strchr_pointer + 4; //default name position, 4 letters after the M } else namestartpos++; //to skip the '!' 14c7e: 8c 01 movw r16, r24 14c80: 0f 5f subi r16, 0xFF ; 255 14c82: 1f 4f sbci r17, 0xFF ; 255 bool call_procedure=(code_seen('P')); 14c84: 80 e5 ldi r24, 0x50 ; 80 14c86: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 14c8a: f8 2e mov r15, r24 if(strchr_pointer>namestartpos) 14c8c: 80 91 93 03 lds r24, 0x0393 ; 0x800393 14c90: 90 91 94 03 lds r25, 0x0394 ; 0x800394 14c94: 08 17 cp r16, r24 14c96: 19 07 cpc r17, r25 14c98: 08 f4 brcc .+2 ; 0x14c9c call_procedure=false; //false alert, 'P' found within filename 14c9a: f1 2c mov r15, r1 if( card.mounted ) 14c9c: 80 91 90 14 lds r24, 0x1490 ; 0x801490 14ca0: 88 23 and r24, r24 14ca2: 09 f4 brne .+2 ; 0x14ca6 14ca4: b2 c4 rjmp .+2404 ; 0x1560a { card.openFileReadFilteredGcode(namestartpos,!call_procedure); 14ca6: 61 e0 ldi r22, 0x01 ; 1 14ca8: 6f 25 eor r22, r15 14caa: c8 01 movw r24, r16 14cac: 0f 94 06 7f call 0x2fe0c ; 0x2fe0c if(code_seen('S')) 14cb0: 83 e5 ldi r24, 0x53 ; 83 14cb2: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 14cb6: 88 23 and r24, r24 14cb8: 99 f0 breq .+38 ; 0x14ce0 if(strchr_pointer 14cbe: 90 91 94 03 lds r25, 0x0394 ; 0x800394 14cc2: 80 17 cp r24, r16 14cc4: 91 07 cpc r25, r17 14cc6: 60 f4 brcc .+24 ; 0x14ce0 card.setIndex(code_value_long()); 14cc8: 0e 94 9a 5b call 0xb734 ; 0xb734 { int16_t c = (int16_t)file.readFilteredGcode(); sdpos = file.curPosition(); return c; }; void setIndex(long index) {sdpos = index;file.seekSetFilteredGcode(index);}; 14ccc: 60 93 a3 17 sts 0x17A3, r22 ; 0x8017a3 14cd0: 70 93 a4 17 sts 0x17A4, r23 ; 0x8017a4 14cd4: 80 93 a5 17 sts 0x17A5, r24 ; 0x8017a5 14cd8: 90 93 a6 17 sts 0x17A6, r25 ; 0x8017a6 14cdc: 0f 94 57 75 call 0x2eaae ; 0x2eaae SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED } void CardReader::startFileprint() { if(mounted) 14ce0: 80 91 90 14 lds r24, 0x1490 ; 0x801490 14ce4: 88 23 and r24, r24 14ce6: 31 f0 breq .+12 ; 0x14cf4 { sdprinting = true; 14ce8: 81 e0 ldi r24, 0x01 ; 1 14cea: 80 93 8f 14 sts 0x148F, r24 ; 0x80148f 14cee: 85 e0 ldi r24, 0x05 ; 5 14cf0: 80 93 b7 0d sts 0x0DB7, r24 ; 0x800db7 <_ZL13printer_state.lto_priv.401> card.startFileprint(); if(!call_procedure) 14cf4: f1 10 cpse r15, r1 14cf6: 89 c4 rjmp .+2322 ; 0x1560a 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); }; 14cf8: 80 91 22 17 lds r24, 0x1722 ; 0x801722 14cfc: 88 23 and r24, r24 14cfe: 61 f0 breq .+24 ; 0x14d18 { if(!card.get_sdpos()) 14d00: 80 91 a3 17 lds r24, 0x17A3 ; 0x8017a3 14d04: 90 91 a4 17 lds r25, 0x17A4 ; 0x8017a4 14d08: a0 91 a5 17 lds r26, 0x17A5 ; 0x8017a5 14d0c: b0 91 a6 17 lds r27, 0x17A6 ; 0x8017a6 14d10: 89 2b or r24, r25 14d12: 8a 2b or r24, r26 14d14: 8b 2b or r24, r27 14d16: 69 f4 brne .+26 ; 0x14d32 { // A new print has started from scratch, reset stats failstats_reset_print(); 14d18: 0e 94 3c 5c call 0xb878 ; 0xb878 sdpos_atomic = 0; 14d1c: 10 92 80 03 sts 0x0380, r1 ; 0x800380 14d20: 10 92 81 03 sts 0x0381, r1 ; 0x800381 14d24: 10 92 82 03 sts 0x0382, r1 ; 0x800382 14d28: 10 92 83 03 sts 0x0383, r1 ; 0x800383 14d2c: 80 e0 ldi r24, 0x00 ; 0 14d2e: 0e 94 2f 82 call 0x1045e ; 0x1045e #ifndef LA_NOCOMPAT la10c_reset(); #endif } print_job_timer.start(); // procedure calls count as normal print time. 14d32: 0f 94 48 42 call 0x28490 ; 0x28490 14d36: 69 c4 rjmp .+2258 ; 0x1560a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14d38: 89 34 cpi r24, 0x49 ; 73 14d3a: 91 05 cpc r25, r1 14d3c: 09 f4 brne .+2 ; 0x14d40 14d3e: e4 c6 rjmp .+3528 ; 0x15b08 14d40: cc f4 brge .+50 ; 0x14d74 14d42: 8e 32 cpi r24, 0x2E ; 46 14d44: 91 05 cpc r25, r1 14d46: 09 f4 brne .+2 ; 0x14d4a 14d48: a1 c6 rjmp .+3394 ; 0x15a8c 14d4a: 88 34 cpi r24, 0x48 ; 72 14d4c: 91 05 cpc r25, r1 14d4e: 09 f0 breq .+2 ; 0x14d52 14d50: 27 ce rjmp .-946 ; 0x149a0 #### Parameters - `Snnn` - Set printer state 0 = not_ready, 1 = ready */ case 72: { if(code_seen('S')){ 14d52: 83 e5 ldi r24, 0x53 ; 83 14d54: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 14d58: 88 23 and r24, r24 14d5a: 09 f4 brne .+2 ; 0x14d5e 14d5c: c6 c6 rjmp .+3468 ; 0x15aea switch (code_value_uint8()){ 14d5e: 0e 94 80 5b call 0xb700 ; 0xb700 14d62: 88 23 and r24, r24 14d64: 09 f4 brne .+2 ; 0x14d68 14d66: be c6 rjmp .+3452 ; 0x15ae4 14d68: 81 30 cpi r24, 0x01 ; 1 14d6a: 09 f0 breq .+2 ; 0x14d6e 14d6c: 4e c4 rjmp .+2204 ; 0x1560a 14d6e: 80 93 b7 0d sts 0x0DB7, r24 ; 0x800db7 <_ZL13printer_state.lto_priv.401> 14d72: 4b c4 rjmp .+2198 ; 0x1560a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14d74: 8c 34 cpi r24, 0x4C ; 76 14d76: 91 05 cpc r25, r1 14d78: 09 f4 brne .+2 ; 0x14d7c 14d7a: 66 c7 rjmp .+3788 ; 0x15c48 14d7c: 0c f0 brlt .+2 ; 0x14d80 14d7e: 77 c7 rjmp .+3822 ; 0x15c6e 14d80: 8b 34 cpi r24, 0x4B ; 75 14d82: 91 05 cpc r25, r1 14d84: 09 f0 breq .+2 ; 0x14d88 14d86: 0c ce rjmp .-1000 ; 0x149a0 /*! ### M75 - Start the print job timer M75: Start the print job timer */ case 75: { if (!filament_presence_check()) { 14d88: 0e 94 dd f4 call 0x1e9ba ; 0x1e9ba 14d8c: 88 23 and r24, r24 14d8e: 09 f4 brne .+2 ; 0x14d92 14d90: 3c c4 rjmp .+2168 ; 0x1560a 14d92: cf cf rjmp .-98 ; 0x14d32 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14d94: 8e 36 cpi r24, 0x6E ; 110 14d96: 91 05 cpc r25, r1 14d98: 11 f4 brne .+4 ; 0x14d9e 14d9a: 0c 94 96 b0 jmp 0x1612c ; 0x1612c 14d9e: 0c f0 brlt .+2 ; 0x14da2 14da0: 7d c0 rjmp .+250 ; 0x14e9c 14da2: 86 35 cpi r24, 0x56 ; 86 14da4: 91 05 cpc r25, r1 14da6: 11 f4 brne .+4 ; 0x14dac 14da8: 0c 94 ef af jmp 0x15fde ; 0x15fde 14dac: b4 f5 brge .+108 ; 0x14e1a 14dae: 83 35 cpi r24, 0x53 ; 83 14db0: 91 05 cpc r25, r1 14db2: 11 f4 brne .+4 ; 0x14db8 14db4: 0c 94 99 af jmp 0x15f32 ; 0x15f32 14db8: 74 f4 brge .+28 ; 0x14dd6 14dba: 8f 34 cpi r24, 0x4F ; 79 14dbc: 91 05 cpc r25, r1 14dbe: 09 f4 brne .+2 ; 0x14dc2 14dc0: 76 c7 rjmp .+3820 ; 0x15cae 14dc2: 82 35 cpi r24, 0x52 ; 82 14dc4: 91 05 cpc r25, r1 14dc6: 09 f0 breq .+2 ; 0x14dca 14dc8: eb cd rjmp .-1066 ; 0x149a0 /*! ### 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; 14dca: 80 91 e3 03 lds r24, 0x03E3 ; 0x8003e3 14dce: 87 7f andi r24, 0xF7 ; 247 14dd0: 80 93 e3 03 sts 0x03E3, r24 ; 0x8003e3 14dd4: 1a c4 rjmp .+2100 ; 0x1560a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14dd6: 84 35 cpi r24, 0x54 ; 84 14dd8: 91 05 cpc r25, r1 14dda: 11 f4 brne .+4 ; 0x14de0 14ddc: 0c 94 9f af jmp 0x15f3e ; 0x15f3e 14de0: 85 35 cpi r24, 0x55 ; 85 14de2: 91 05 cpc r25, r1 14de4: 09 f0 breq .+2 ; 0x14de8 14de6: dc cd rjmp .-1096 ; 0x149a0 #### 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')) { 14de8: 83 e5 ldi r24, 0x53 ; 83 14dea: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 14dee: 88 23 and r24, r24 14df0: 09 f4 brne .+2 ; 0x14df4 14df2: 0b c4 rjmp .+2070 ; 0x1560a max_inactive_time = code_value() * 1000; 14df4: 0e 94 b5 60 call 0xc16a ; 0xc16a 14df8: 20 e0 ldi r18, 0x00 ; 0 14dfa: 30 e0 ldi r19, 0x00 ; 0 14dfc: 4a e7 ldi r20, 0x7A ; 122 14dfe: 54 e4 ldi r21, 0x44 ; 68 14e00: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 14e04: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 14e08: 60 93 7c 03 sts 0x037C, r22 ; 0x80037c 14e0c: 70 93 7d 03 sts 0x037D, r23 ; 0x80037d 14e10: 80 93 7e 03 sts 0x037E, r24 ; 0x80037e 14e14: 90 93 7f 03 sts 0x037F, r25 ; 0x80037f 14e18: f8 c3 rjmp .+2032 ; 0x1560a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14e1a: 89 36 cpi r24, 0x69 ; 105 14e1c: 91 05 cpc r25, r1 14e1e: 09 f4 brne .+2 ; 0x14e22 14e20: a2 c7 rjmp .+3908 ; 0x15d66 14e22: c4 f4 brge .+48 ; 0x14e54 14e24: 8c 35 cpi r24, 0x5C ; 92 14e26: 91 05 cpc r25, r1 14e28: 11 f4 brne .+4 ; 0x14e2e 14e2a: 0c 94 0c b0 jmp 0x16018 ; 0x16018 14e2e: 88 36 cpi r24, 0x68 ; 104 14e30: 91 05 cpc r25, r1 14e32: 09 f0 breq .+2 ; 0x14e36 14e34: b5 cd rjmp .-1174 ; 0x149a0 #### Parameters - `S` - Target temperature */ case 104: // M104 { if (code_seen('S')) 14e36: 83 e5 ldi r24, 0x53 ; 83 14e38: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 14e3c: 88 23 and r24, r24 14e3e: 09 f4 brne .+2 ; 0x14e42 14e40: e4 c3 rjmp .+1992 ; 0x1560a { setTargetHotend(code_value()); 14e42: 0e 94 b5 60 call 0xc16a ; 0xc16a return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 14e46: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> 14e4a: 70 93 b6 0d sts 0x0DB6, r23 ; 0x800db6 14e4e: 60 93 b5 0d sts 0x0DB5, r22 ; 0x800db5 14e52: db c3 rjmp .+1974 ; 0x1560a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14e54: 8b 36 cpi r24, 0x6B ; 107 14e56: 91 05 cpc r25, r1 14e58: 11 f4 brne .+4 ; 0x14e5e 14e5a: 0c 94 96 af jmp 0x15f2c ; 0x15f2c 14e5e: 14 f4 brge .+4 ; 0x14e64 14e60: 0c 94 88 af jmp 0x15f10 ; 0x15f10 14e64: 8d 36 cpi r24, 0x6D ; 109 14e66: 91 05 cpc r25, r1 14e68: 09 f0 breq .+2 ; 0x14e6c 14e6a: 9a cd rjmp .-1228 ; 0x149a0 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)); 14e6c: 87 e6 ldi r24, 0x67 ; 103 14e6e: 9e e4 ldi r25, 0x4E ; 78 14e70: 0e 94 c4 72 call 0xe588 ; 0xe588 14e74: 0e 94 38 f1 call 0x1e270 ; 0x1e270 heating_status = HeatingStatus::EXTRUDER_HEATING; 14e78: 81 e0 ldi r24, 0x01 ; 1 14e7a: 80 93 e1 03 sts 0x03E1, r24 ; 0x8003e1 prusa_statistics(1); #ifdef AUTOTEMP autotemp_enabled=false; #endif if (code_seen('S')) { 14e7e: 83 e5 ldi r24, 0x53 ; 83 14e80: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 14e84: 88 23 and r24, r24 14e86: 09 f4 brne .+2 ; 0x14e8a 14e88: 81 c7 rjmp .+3842 ; 0x15d8c setTargetHotend(code_value()); } else if (code_seen('R')) { setTargetHotend(code_value()); 14e8a: 0e 94 b5 60 call 0xc16a ; 0xc16a 14e8e: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> 14e92: 70 93 b6 0d sts 0x0DB6, r23 ; 0x800db6 14e96: 60 93 b5 0d sts 0x0DB5, r22 ; 0x800db5 14e9a: 7d c7 rjmp .+3834 ; 0x15d96 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14e9c: 87 37 cpi r24, 0x77 ; 119 14e9e: 91 05 cpc r25, r1 14ea0: 11 f4 brne .+4 ; 0x14ea6 14ea2: 0c 94 db b1 jmp 0x163b6 ; 0x163b6 14ea6: 94 f5 brge .+100 ; 0x14f0c 14ea8: 82 37 cpi r24, 0x72 ; 114 14eaa: 91 05 cpc r25, r1 14eac: 11 f4 brne .+4 ; 0x14eb2 14eae: 0c 94 90 b1 jmp 0x16320 ; 0x16320 14eb2: a4 f4 brge .+40 ; 0x14edc 14eb4: 80 37 cpi r24, 0x70 ; 112 14eb6: 91 05 cpc r25, r1 14eb8: 09 f4 brne .+2 ; 0x14ebc 14eba: 42 c7 rjmp .+3716 ; 0x15d40 14ebc: 81 37 cpi r24, 0x71 ; 113 14ebe: 91 05 cpc r25, r1 14ec0: 09 f0 breq .+2 ; 0x14ec4 14ec2: 6e cd rjmp .-1316 ; 0x149a0 #### Parameters - `S` - Seconds. Default is 2 seconds between "busy" messages */ case 113: if (code_seen('S')) { 14ec4: 83 e5 ldi r24, 0x53 ; 83 14ec6: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 14eca: 88 23 and r24, r24 14ecc: 11 f4 brne .+4 ; 0x14ed2 14ece: 0c 94 a7 b0 jmp 0x1614e ; 0x1614e host_keepalive_interval = code_value_uint8(); 14ed2: 0e 94 80 5b call 0xb700 ; 0xb700 14ed6: 80 93 2f 02 sts 0x022F, r24 ; 0x80022f 14eda: 97 c3 rjmp .+1838 ; 0x1560a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14edc: 85 37 cpi r24, 0x75 ; 117 14ede: 91 05 cpc r25, r1 14ee0: 11 f4 brne .+4 ; 0x14ee6 14ee2: 0c 94 93 b1 jmp 0x16326 ; 0x16326 14ee6: 14 f0 brlt .+4 ; 0x14eec 14ee8: 0c 94 a3 b1 jmp 0x16346 ; 0x16346 14eec: 83 37 cpi r24, 0x73 ; 115 14eee: 91 05 cpc r25, r1 14ef0: 09 f0 breq .+2 ; 0x14ef4 14ef2: 56 cd rjmp .-1364 ; 0x149a0 #### 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')) { 14ef4: 86 e5 ldi r24, 0x56 ; 86 14ef6: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 14efa: 88 23 and r24, r24 14efc: 11 f4 brne .+4 ; 0x14f02 14efe: 0c 94 bc b0 jmp 0x16178 ; 0x16178 // Report the Prusa version number. SERIAL_PROTOCOLLNRPGM(FW_VERSION_STR_P()); 14f02: 85 ed ldi r24, 0xD5 ; 213 14f04: 94 e8 ldi r25, 0x84 ; 132 14f06: 0e 94 93 79 call 0xf326 ; 0xf326 14f0a: 7f c3 rjmp .+1790 ; 0x1560a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14f0c: 8c 38 cpi r24, 0x8C ; 140 14f0e: 91 05 cpc r25, r1 14f10: 09 f4 brne .+2 ; 0x14f14 14f12: 1a c7 rjmp .+3636 ; 0x15d48 14f14: 54 f4 brge .+20 ; 0x14f2a 14f16: 8b 37 cpi r24, 0x7B ; 123 14f18: 91 05 cpc r25, r1 14f1a: 11 f4 brne .+4 ; 0x14f20 14f1c: 0c 94 40 b2 jmp 0x16480 ; 0x16480 14f20: 8d 37 cpi r24, 0x7D ; 125 14f22: 91 05 cpc r25, r1 14f24: 09 f4 brne .+2 ; 0x14f28 14f26: a9 cd rjmp .-1198 ; 0x14a7a 14f28: 3b cd rjmp .-1418 ; 0x149a0 14f2a: 8e 3b cpi r24, 0xBE ; 190 14f2c: 91 05 cpc r25, r1 14f2e: 09 f4 brne .+2 ; 0x14f32 14f30: 62 c7 rjmp .+3780 ; 0x15df6 14f32: 88 3c cpi r24, 0xC8 ; 200 14f34: 91 05 cpc r25, r1 14f36: 11 f4 brne .+4 ; 0x14f3c 14f38: 0c 94 43 b2 jmp 0x16486 ; 0x16486 14f3c: 8b 39 cpi r24, 0x9B ; 155 14f3e: 91 05 cpc r25, r1 14f40: 09 f0 breq .+2 ; 0x14f44 14f42: 2e cd rjmp .-1444 ; 0x149a0 bit 6 = free bit 7 = free */ case 155: { if (code_seen('S')){ 14f44: 83 e5 ldi r24, 0x53 ; 83 14f46: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 14f4a: 88 23 and r24, r24 14f4c: 59 f0 breq .+22 ; 0x14f64 autoReportFeatures.SetPeriod( code_value_uint8() ); 14f4e: 0e 94 80 5b call 0xb700 ; 0xb700 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; 14f52: 80 93 87 14 sts 0x1487, r24 ; 0x801487 if (auto_report_period != 0){ 14f56: 88 23 and r24, r24 14f58: 09 f4 brne .+2 ; 0x14f5c 14f5a: 11 c7 rjmp .+3618 ; 0x15d7e auto_report_timer.start(); 14f5c: 88 e8 ldi r24, 0x88 ; 136 14f5e: 94 e1 ldi r25, 0x14 ; 20 14f60: 0f 94 c5 2b call 0x2578a ; 0x2578a ::start()> case 155: { if (code_seen('S')){ autoReportFeatures.SetPeriod( code_value_uint8() ); } if (code_seen('C')){ 14f64: 83 e4 ldi r24, 0x43 ; 67 14f66: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 14f6a: 88 23 and r24, r24 14f6c: 09 f4 brne .+2 ; 0x14f70 14f6e: 0a c7 rjmp .+3604 ; 0x15d84 autoReportFeatures.SetMask(code_value_uint8()); 14f70: 0e 94 80 5b call 0xb700 ; 0xb700 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; } 14f74: 80 93 86 14 sts 0x1486, r24 ; 0x801486 14f78: 48 c3 rjmp .+1680 ; 0x1560a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14f7a: 86 3f cpi r24, 0xF6 ; 246 14f7c: f1 e0 ldi r31, 0x01 ; 1 14f7e: 9f 07 cpc r25, r31 14f80: 11 f4 brne .+4 ; 0x14f86 14f82: 0c 94 fa bb jmp 0x177f4 ; 0x177f4 14f86: 0c f0 brlt .+2 ; 0x14f8a 14f88: f7 c1 rjmp .+1006 ; 0x15378 14f8a: 8c 32 cpi r24, 0x2C ; 44 14f8c: 31 e0 ldi r19, 0x01 ; 1 14f8e: 93 07 cpc r25, r19 14f90: 11 f4 brne .+4 ; 0x14f96 14f92: 0c 94 06 b5 jmp 0x16a0c ; 0x16a0c 14f96: 0c f0 brlt .+2 ; 0x14f9a 14f98: 1b c1 rjmp .+566 ; 0x151d0 14f9a: 80 3d cpi r24, 0xD0 ; 208 14f9c: 91 05 cpc r25, r1 14f9e: 11 f4 brne .+4 ; 0x14fa4 14fa0: 0c 94 f5 b3 jmp 0x167ea ; 0x167ea 14fa4: 0c f0 brlt .+2 ; 0x14fa8 14fa6: 73 c0 rjmp .+230 ; 0x1508e 14fa8: 8d 3c cpi r24, 0xCD ; 205 14faa: 91 05 cpc r25, r1 14fac: 11 f4 brne .+4 ; 0x14fb2 14fae: 0c 94 5c b3 jmp 0x166b8 ; 0x166b8 14fb2: 9c f5 brge .+102 ; 0x1501a 14fb4: 8b 3c cpi r24, 0xCB ; 203 14fb6: 91 05 cpc r25, r1 14fb8: 11 f4 brne .+4 ; 0x14fbe 14fba: 0c 94 d3 b2 jmp 0x165a6 ; 0x165a6 14fbe: 8c 3c cpi r24, 0xCC ; 204 14fc0: 91 05 cpc r25, r1 14fc2: 09 f0 breq .+2 ; 0x14fc6 14fc4: ed cc rjmp .-1574 ; 0x149a0 - `R` - filmanent only moves - `T` - travel moves (as of now T is ignored) */ case 204: { if(code_seen('S')) { 14fc6: 83 e5 ldi r24, 0x53 ; 83 14fc8: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 14fcc: 88 23 and r24, r24 14fce: 11 f4 brne .+4 ; 0x14fd4 14fd0: 0c 94 2b b3 jmp 0x16656 ; 0x16656 // 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(); 14fd4: 0e 94 b5 60 call 0xc16a ; 0xc16a 14fd8: 60 93 7d 0e sts 0x0E7D, r22 ; 0x800e7d 14fdc: 70 93 7e 0e sts 0x0E7E, r23 ; 0x800e7e 14fe0: 80 93 7f 0e sts 0x0E7F, r24 ; 0x800e7f 14fe4: 90 93 80 0e sts 0x0E80, r25 ; 0x800e80 14fe8: 60 93 f1 0d sts 0x0DF1, r22 ; 0x800df1 14fec: 70 93 f2 0d sts 0x0DF2, r23 ; 0x800df2 14ff0: 80 93 f3 0d sts 0x0DF3, r24 ; 0x800df3 14ff4: 90 93 f4 0d sts 0x0DF4, r25 ; 0x800df4 // Interpret the T value as retract acceleration in the old Marlin format. if(code_seen('T')) 14ff8: 84 e5 ldi r24, 0x54 ; 84 14ffa: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 14ffe: 88 23 and r24, r24 15000: 09 f4 brne .+2 ; 0x15004 15002: 03 c3 rjmp .+1542 ; 0x1560a cs.retract_acceleration = code_value(); 15004: 0e 94 b5 60 call 0xc16a ; 0xc16a 15008: 60 93 f5 0d sts 0x0DF5, r22 ; 0x800df5 1500c: 70 93 f6 0d sts 0x0DF6, r23 ; 0x800df6 15010: 80 93 f7 0d sts 0x0DF7, r24 ; 0x800df7 15014: 90 93 f8 0d sts 0x0DF8, r25 ; 0x800df8 15018: f8 c2 rjmp .+1520 ; 0x1560a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1501a: 8e 3c cpi r24, 0xCE ; 206 1501c: 91 05 cpc r25, r1 1501e: 11 f4 brne .+4 ; 0x15024 15020: 0c 94 d5 b3 jmp 0x167aa ; 0x167aa 15024: 8f 3c cpi r24, 0xCF ; 207 15026: 91 05 cpc r25, r1 15028: 09 f0 breq .+2 ; 0x1502c 1502a: ba cc rjmp .-1676 ; 0x149a0 - `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')) 1502c: 83 e5 ldi r24, 0x53 ; 83 1502e: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 15032: 88 23 and r24, r24 15034: 51 f0 breq .+20 ; 0x1504a { cs.retract_length = code_value() ; 15036: 0e 94 b5 60 call 0xc16a ; 0xc16a 1503a: 60 93 40 0e sts 0x0E40, r22 ; 0x800e40 1503e: 70 93 41 0e sts 0x0E41, r23 ; 0x800e41 15042: 80 93 42 0e sts 0x0E42, r24 ; 0x800e42 15046: 90 93 43 0e sts 0x0E43, r25 ; 0x800e43 } if(code_seen('F')) 1504a: 86 e4 ldi r24, 0x46 ; 70 1504c: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 15050: 88 23 and r24, r24 15052: 61 f0 breq .+24 ; 0x1506c { cs.retract_feedrate = get_feedrate_mm_s(code_value()); 15054: 0e 94 b5 60 call 0xc16a ; 0xc16a 15058: 0e 94 df 66 call 0xcdbe ; 0xcdbe 1505c: 60 93 44 0e sts 0x0E44, r22 ; 0x800e44 15060: 70 93 45 0e sts 0x0E45, r23 ; 0x800e45 15064: 80 93 46 0e sts 0x0E46, r24 ; 0x800e46 15068: 90 93 47 0e sts 0x0E47, r25 ; 0x800e47 } if(code_seen('Z')) 1506c: 8a e5 ldi r24, 0x5A ; 90 1506e: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 15072: 88 23 and r24, r24 15074: 09 f4 brne .+2 ; 0x15078 15076: c9 c2 rjmp .+1426 ; 0x1560a { cs.retract_zlift = code_value() ; 15078: 0e 94 b5 60 call 0xc16a ; 0xc16a 1507c: 60 93 48 0e sts 0x0E48, r22 ; 0x800e48 15080: 70 93 49 0e sts 0x0E49, r23 ; 0x800e49 15084: 80 93 4a 0e sts 0x0E4A, r24 ; 0x800e4a 15088: 90 93 4b 0e sts 0x0E4B, r25 ; 0x800e4b 1508c: be c2 rjmp .+1404 ; 0x1560a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1508e: 8c 3d cpi r24, 0xDC ; 220 15090: 91 05 cpc r25, r1 15092: 11 f4 brne .+4 ; 0x15098 15094: 0c 94 5c b4 jmp 0x168b8 ; 0x168b8 15098: 0c f0 brlt .+2 ; 0x1509c 1509a: 7d c0 rjmp .+250 ; 0x15196 1509c: 81 3d cpi r24, 0xD1 ; 209 1509e: 91 05 cpc r25, r1 150a0: 11 f4 brne .+4 ; 0x150a6 150a2: 0c 94 19 b4 jmp 0x16832 ; 0x16832 150a6: 86 3d cpi r24, 0xD6 ; 214 150a8: 91 05 cpc r25, r1 150aa: 09 f0 breq .+2 ; 0x150ae 150ac: 79 cc rjmp .-1806 ; 0x149a0 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; 150ae: 80 e5 ldi r24, 0x50 ; 80 150b0: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 150b4: 88 23 and r24, r24 150b6: 11 f4 brne .+4 ; 0x150bc 150b8: 0c 94 48 b4 jmp 0x16890 ; 0x16890 150bc: 0e 94 b5 60 call 0xc16a ; 0xc16a 150c0: 2b 01 movw r4, r22 150c2: 3c 01 movw r6, r24 float s = code_seen('S') ? code_value() : cs.min_mm_per_arc_segment; 150c4: 83 e5 ldi r24, 0x53 ; 83 150c6: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 150ca: 88 23 and r24, r24 150cc: 11 f4 brne .+4 ; 0x150d2 150ce: 0c 94 52 b4 jmp 0x168a4 ; 0x168a4 150d2: 0e 94 b5 60 call 0xc16a ; 0xc16a 150d6: 4b 01 movw r8, r22 150d8: 5c 01 movw r10, r24 unsigned char n = code_seen('N') ? code_value() : cs.n_arc_correction; 150da: 8e e4 ldi r24, 0x4E ; 78 150dc: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 150e0: d0 90 89 0e lds r13, 0x0E89 ; 0x800e89 150e4: 88 23 and r24, r24 150e6: 29 f0 breq .+10 ; 0x150f2 150e8: 0e 94 b5 60 call 0xc16a ; 0xc16a 150ec: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 150f0: d6 2e mov r13, r22 unsigned short r = code_seen('R') ? code_value() : cs.min_arc_segments; 150f2: 82 e5 ldi r24, 0x52 ; 82 150f4: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 150f8: e0 90 8a 0e lds r14, 0x0E8A ; 0x800e8a 150fc: f0 90 8b 0e lds r15, 0x0E8B ; 0x800e8b 15100: 88 23 and r24, r24 15102: 29 f0 breq .+10 ; 0x1510e 15104: 0e 94 b5 60 call 0xc16a ; 0xc16a 15108: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 1510c: 7b 01 movw r14, r22 unsigned short f = code_seen('F') ? code_value() : cs.arc_segments_per_sec; 1510e: 86 e4 ldi r24, 0x46 ; 70 15110: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 15114: 00 91 8c 0e lds r16, 0x0E8C ; 0x800e8c 15118: 10 91 8d 0e lds r17, 0x0E8D ; 0x800e8d 1511c: 88 23 and r24, r24 1511e: 29 f0 breq .+10 ; 0x1512a 15120: 0e 94 b5 60 call 0xc16a ; 0xc16a 15124: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 15128: 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) 1512a: 20 e0 ldi r18, 0x00 ; 0 1512c: 30 e0 ldi r19, 0x00 ; 0 1512e: a9 01 movw r20, r18 15130: c3 01 movw r24, r6 15132: b2 01 movw r22, r4 15134: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 15138: 18 16 cp r1, r24 1513a: 0c f0 brlt .+2 ; 0x1513e 1513c: 66 c2 rjmp .+1228 ; 0x1560a 1513e: 20 e0 ldi r18, 0x00 ; 0 15140: 30 e0 ldi r19, 0x00 ; 0 15142: a9 01 movw r20, r18 15144: c5 01 movw r24, r10 15146: b4 01 movw r22, r8 15148: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 1514c: 87 fd sbrc r24, 7 1514e: 5d c2 rjmp .+1210 ; 0x1560a 15150: a5 01 movw r20, r10 15152: 94 01 movw r18, r8 15154: c3 01 movw r24, r6 15156: b2 01 movw r22, r4 15158: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 1515c: 87 fd sbrc r24, 7 1515e: 55 c2 rjmp .+1194 ; 0x1560a { // Should we display some error here? break; } cs.mm_per_arc_segment = p; 15160: 40 92 81 0e sts 0x0E81, r4 ; 0x800e81 15164: 50 92 82 0e sts 0x0E82, r5 ; 0x800e82 15168: 60 92 83 0e sts 0x0E83, r6 ; 0x800e83 1516c: 70 92 84 0e sts 0x0E84, r7 ; 0x800e84 cs.min_mm_per_arc_segment = s; 15170: 80 92 85 0e sts 0x0E85, r8 ; 0x800e85 15174: 90 92 86 0e sts 0x0E86, r9 ; 0x800e86 15178: a0 92 87 0e sts 0x0E87, r10 ; 0x800e87 1517c: b0 92 88 0e sts 0x0E88, r11 ; 0x800e88 cs.n_arc_correction = n; 15180: d0 92 89 0e sts 0x0E89, r13 ; 0x800e89 cs.min_arc_segments = r; 15184: f0 92 8b 0e sts 0x0E8B, r15 ; 0x800e8b 15188: e0 92 8a 0e sts 0x0E8A, r14 ; 0x800e8a cs.arc_segments_per_sec = f; 1518c: 10 93 8d 0e sts 0x0E8D, r17 ; 0x800e8d 15190: 00 93 8c 0e sts 0x0E8C, r16 ; 0x800e8c 15194: 3a c2 rjmp .+1140 ; 0x1560a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15196: 82 3e cpi r24, 0xE2 ; 226 15198: 91 05 cpc r25, r1 1519a: 11 f4 brne .+4 ; 0x151a0 1519c: 0c 94 ad b4 jmp 0x1695a ; 0x1695a 151a0: 80 3f cpi r24, 0xF0 ; 240 151a2: 91 05 cpc r25, r1 151a4: 09 f4 brne .+2 ; 0x151a8 151a6: 31 c2 rjmp .+1122 ; 0x1560a 151a8: 8d 3d cpi r24, 0xDD ; 221 151aa: 91 05 cpc r25, r1 151ac: 09 f0 breq .+2 ; 0x151b0 151ae: f8 cb rjmp .-2064 ; 0x149a0 #### Parameters - `S` - Extrude factor override percentage (0..100 or higher), default 100% */ case 221: { if (code_seen('S')) 151b0: 83 e5 ldi r24, 0x53 ; 83 151b2: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 151b6: 88 23 and r24, r24 151b8: 11 f4 brne .+4 ; 0x151be 151ba: 0c 94 9b b4 jmp 0x16936 ; 0x16936 { extrudemultiply = code_value_short(); 151be: 0e 94 8d 5b call 0xb71a ; 0xb71a 151c2: 90 93 bd 02 sts 0x02BD, r25 ; 0x8002bd 151c6: 80 93 bc 02 sts 0x02BC, r24 ; 0x8002bc calculate_extruder_multipliers(); 151ca: 0e 94 d1 65 call 0xcba2 ; 0xcba2 151ce: 1d c2 rjmp .+1082 ; 0x1560a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 151d0: 80 39 cpi r24, 0x90 ; 144 151d2: 51 e0 ldi r21, 0x01 ; 1 151d4: 95 07 cpc r25, r21 151d6: 11 f4 brne .+4 ; 0x151dc 151d8: 0c 94 cb bb jmp 0x17796 ; 0x17796 151dc: 0c f0 brlt .+2 ; 0x151e0 151de: a7 c0 rjmp .+334 ; 0x1532e 151e0: 8f 32 cpi r24, 0x2F ; 47 151e2: b1 e0 ldi r27, 0x01 ; 1 151e4: 9b 07 cpc r25, r27 151e6: 11 f4 brne .+4 ; 0x151ec 151e8: 0c 94 aa b5 jmp 0x16b54 ; 0x16b54 151ec: c4 f4 brge .+48 ; 0x1521e 151ee: 8d 32 cpi r24, 0x2D ; 45 151f0: f1 e0 ldi r31, 0x01 ; 1 151f2: 9f 07 cpc r25, r31 151f4: 11 f4 brne .+4 ; 0x151fa 151f6: 0c 94 2d b5 jmp 0x16a5a ; 0x16a5a 151fa: 8e 32 cpi r24, 0x2E ; 46 151fc: 91 40 sbci r25, 0x01 ; 1 151fe: 09 f0 breq .+2 ; 0x15202 15200: cf cb rjmp .-2146 ; 0x149a0 - `S` - Cold extrude minimum temperature */ case 302: { int temp = 0; if (code_seen('S')) temp=code_value_short(); 15202: 83 e5 ldi r24, 0x53 ; 83 15204: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 15208: 88 23 and r24, r24 1520a: 11 f4 brne .+4 ; 0x15210 1520c: 0c 94 a6 b5 jmp 0x16b4c ; 0x16b4c 15210: 0e 94 8d 5b call 0xb71a ; 0xb71a } #ifdef PREVENT_DANGEROUS_EXTRUDE void set_extrude_min_temp(int temp) { extrude_min_temp = temp; 15214: 90 93 6c 02 sts 0x026C, r25 ; 0x80026c 15218: 80 93 6b 02 sts 0x026B, r24 ; 0x80026b 1521c: f6 c1 rjmp .+1004 ; 0x1560a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1521e: 86 33 cpi r24, 0x36 ; 54 15220: 31 e0 ldi r19, 0x01 ; 1 15222: 93 07 cpc r25, r19 15224: 11 f4 brne .+4 ; 0x1522a 15226: 0c 94 dd b5 jmp 0x16bba ; 0x16bba 1522a: 8e 35 cpi r24, 0x5E ; 94 1522c: 41 e0 ldi r20, 0x01 ; 1 1522e: 94 07 cpc r25, r20 15230: 11 f4 brne .+4 ; 0x15236 15232: 0c 94 d6 c8 jmp 0x191ac ; 0x191ac 15236: 80 33 cpi r24, 0x30 ; 48 15238: 91 40 sbci r25, 0x01 ; 1 1523a: 09 f0 breq .+2 ; 0x1523e 1523c: b1 cb rjmp .-2206 ; 0x149a0 - `I` - integral (Ki) - `D` - derivative (Kd) */ case 304: { if(code_seen('P')) cs.bedKp = code_value(); 1523e: 80 e5 ldi r24, 0x50 ; 80 15240: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 15244: 88 23 and r24, r24 15246: 51 f0 breq .+20 ; 0x1525c 15248: 0e 94 b5 60 call 0xc16a ; 0xc16a 1524c: 60 93 31 0e sts 0x0E31, r22 ; 0x800e31 15250: 70 93 32 0e sts 0x0E32, r23 ; 0x800e32 15254: 80 93 33 0e sts 0x0E33, r24 ; 0x800e33 15258: 90 93 34 0e sts 0x0E34, r25 ; 0x800e34 if(code_seen('I')) cs.bedKi = scalePID_i(code_value()); 1525c: 89 e4 ldi r24, 0x49 ; 73 1525e: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 15262: 88 23 and r24, r24 15264: 81 f0 breq .+32 ; 0x15286 15266: 0e 94 b5 60 call 0xc16a ; 0xc16a #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 1526a: 2c ea ldi r18, 0xAC ; 172 1526c: 35 ec ldi r19, 0xC5 ; 197 1526e: 47 e2 ldi r20, 0x27 ; 39 15270: 5e e3 ldi r21, 0x3E ; 62 15272: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 15276: 60 93 35 0e sts 0x0E35, r22 ; 0x800e35 1527a: 70 93 36 0e sts 0x0E36, r23 ; 0x800e36 1527e: 80 93 37 0e sts 0x0E37, r24 ; 0x800e37 15282: 90 93 38 0e sts 0x0E38, r25 ; 0x800e38 if(code_seen('D')) cs.bedKd = scalePID_d(code_value()); 15286: 84 e4 ldi r24, 0x44 ; 68 15288: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 1528c: 88 23 and r24, r24 1528e: 81 f0 breq .+32 ; 0x152b0 15290: 0e 94 b5 60 call 0xc16a ; 0xc16a } float unscalePID_i(float i) { return i/PID_dT; 15294: 2c ea ldi r18, 0xAC ; 172 15296: 35 ec ldi r19, 0xC5 ; 197 15298: 47 e2 ldi r20, 0x27 ; 39 1529a: 5e e3 ldi r21, 0x3E ; 62 1529c: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 152a0: 60 93 39 0e sts 0x0E39, r22 ; 0x800e39 152a4: 70 93 3a 0e sts 0x0E3A, r23 ; 0x800e3a 152a8: 80 93 3b 0e sts 0x0E3B, r24 ; 0x800e3b 152ac: 90 93 3c 0e sts 0x0E3C, r25 ; 0x800e3c updatePID(); 152b0: 0f 94 a5 3a call 0x2754a ; 0x2754a SERIAL_PROTOCOLRPGM(MSG_OK); 152b4: 85 ef ldi r24, 0xF5 ; 245 152b6: 9d e6 ldi r25, 0x6D ; 109 152b8: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_PROTOCOLPGM(" p:"); 152bc: 87 e8 ldi r24, 0x87 ; 135 152be: 96 e8 ldi r25, 0x86 ; 134 152c0: 0e 94 68 77 call 0xeed0 ; 0xeed0 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 152c4: 60 91 31 0e lds r22, 0x0E31 ; 0x800e31 152c8: 70 91 32 0e lds r23, 0x0E32 ; 0x800e32 152cc: 80 91 33 0e lds r24, 0x0E33 ; 0x800e33 152d0: 90 91 34 0e lds r25, 0x0E34 ; 0x800e34 152d4: 42 e0 ldi r20, 0x02 ; 2 152d6: 0f 94 42 d5 call 0x3aa84 ; 0x3aa84 SERIAL_PROTOCOL(cs.bedKp); SERIAL_PROTOCOLPGM(" i:"); 152da: 83 e8 ldi r24, 0x83 ; 131 152dc: 96 e8 ldi r25, 0x86 ; 134 152de: 0e 94 68 77 call 0xeed0 ; 0xeed0 152e2: 2c ea ldi r18, 0xAC ; 172 152e4: 35 ec ldi r19, 0xC5 ; 197 152e6: 47 e2 ldi r20, 0x27 ; 39 152e8: 5e e3 ldi r21, 0x3E ; 62 152ea: 60 91 35 0e lds r22, 0x0E35 ; 0x800e35 152ee: 70 91 36 0e lds r23, 0x0E36 ; 0x800e36 152f2: 80 91 37 0e lds r24, 0x0E37 ; 0x800e37 152f6: 90 91 38 0e lds r25, 0x0E38 ; 0x800e38 152fa: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 152fe: 42 e0 ldi r20, 0x02 ; 2 15300: 0f 94 42 d5 call 0x3aa84 ; 0x3aa84 SERIAL_PROTOCOL(unscalePID_i(cs.bedKi)); SERIAL_PROTOCOLPGM(" d:"); 15304: 8f e7 ldi r24, 0x7F ; 127 15306: 96 e8 ldi r25, 0x86 ; 134 15308: 0e 94 68 77 call 0xeed0 ; 0xeed0 #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 1530c: 2c ea ldi r18, 0xAC ; 172 1530e: 35 ec ldi r19, 0xC5 ; 197 15310: 47 e2 ldi r20, 0x27 ; 39 15312: 5e e3 ldi r21, 0x3E ; 62 15314: 60 91 39 0e lds r22, 0x0E39 ; 0x800e39 15318: 70 91 3a 0e lds r23, 0x0E3A ; 0x800e3a 1531c: 80 91 3b 0e lds r24, 0x0E3B ; 0x800e3b 15320: 90 91 3c 0e lds r25, 0x0E3C ; 0x800e3c 15324: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> SERIAL_PROTOCOLLN(unscalePID_d(cs.bedKd)); 15328: 0f 94 6f 74 call 0x2e8de ; 0x2e8de 1532c: 6e c1 rjmp .+732 ; 0x1560a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1532e: 86 39 cpi r24, 0x96 ; 150 15330: a1 e0 ldi r26, 0x01 ; 1 15332: 9a 07 cpc r25, r26 15334: 11 f4 brne .+4 ; 0x1533a 15336: 0c 94 ed bb jmp 0x177da ; 0x177da 1533a: 74 f4 brge .+28 ; 0x15358 1533c: 83 39 cpi r24, 0x93 ; 147 1533e: e1 e0 ldi r30, 0x01 ; 1 15340: 9e 07 cpc r25, r30 15342: 11 f4 brne .+4 ; 0x15348 15344: 0c 94 cf bb jmp 0x1779e ; 0x1779e 15348: 85 39 cpi r24, 0x95 ; 149 1534a: 91 40 sbci r25, 0x01 ; 1 1534c: 09 f0 breq .+2 ; 0x15350 1534e: 28 cb rjmp .-2480 ; 0x149a0 */ case 405: // M405 Enable Filament Sensor { fsensor.setEnabled(1); 15350: 81 e0 ldi r24, 0x01 ; 1 15352: 0e 94 e7 74 call 0xe9ce ; 0xe9ce 15356: 59 c1 rjmp .+690 ; 0x1560a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15358: 84 3f cpi r24, 0xF4 ; 244 1535a: 21 e0 ldi r18, 0x01 ; 1 1535c: 92 07 cpc r25, r18 1535e: 11 f4 brne .+4 ; 0x15364 15360: 0c 94 f2 bb jmp 0x177e4 ; 0x177e4 15364: 14 f0 brlt .+4 ; 0x1536a 15366: 0c 94 f6 bb jmp 0x177ec ; 0x177ec 1536a: 84 3a cpi r24, 0xA4 ; 164 1536c: 91 40 sbci r25, 0x01 ; 1 1536e: 09 f0 breq .+2 ; 0x15372 15370: 17 cb rjmp .-2514 ; 0x149a0 M420 */ case 420: // M420 Mesh bed leveling status { gcode_G81_M420(); 15372: 0e 94 73 7f call 0xfee6 ; 0xfee6 15376: 49 c1 rjmp .+658 ; 0x1560a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15378: 83 3c cpi r24, 0xC3 ; 195 1537a: 52 e0 ldi r21, 0x02 ; 2 1537c: 95 07 cpc r25, r21 1537e: 11 f4 brne .+4 ; 0x15384 15380: 0c 94 5a ca jmp 0x194b4 ; 0x194b4 15384: 0c f0 brlt .+2 ; 0x15388 15386: 91 c0 rjmp .+290 ; 0x154aa 15388: 8a 35 cpi r24, 0x5A ; 90 1538a: b2 e0 ldi r27, 0x02 ; 2 1538c: 9b 07 cpc r25, r27 1538e: 11 f4 brne .+4 ; 0x15394 15390: 0c 94 51 c3 jmp 0x186a2 ; 0x186a2 15394: 3c f5 brge .+78 ; 0x153e4 15396: 88 32 cpi r24, 0x28 ; 40 15398: f2 e0 ldi r31, 0x02 ; 2 1539a: 9f 07 cpc r25, r31 1539c: 11 f4 brne .+4 ; 0x153a2 1539e: 0c 94 11 bf jmp 0x17e22 ; 0x17e22 153a2: ac f4 brge .+42 ; 0x153ce 153a4: 87 3f cpi r24, 0xF7 ; 247 153a6: 31 e0 ldi r19, 0x01 ; 1 153a8: 93 07 cpc r25, r19 153aa: 11 f4 brne .+4 ; 0x153b0 153ac: 0c 94 fe bb jmp 0x177fc ; 0x177fc 153b0: 8d 3f cpi r24, 0xFD ; 253 153b2: 91 40 sbci r25, 0x01 ; 1 153b4: 09 f0 breq .+2 ; 0x153b8 153b6: f4 ca rjmp .-2584 ; 0x149a0 M509 */ case 509: { lang_reset(); 153b8: 0e 94 44 71 call 0xe288 ; 0xe288 SERIAL_ECHO_START; 153bc: 82 ef ldi r24, 0xF2 ; 242 153be: 9b ea ldi r25, 0xAB ; 171 153c0: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_PROTOCOLPGM("LANG SEL FORCED"); 153c4: 8f e6 ldi r24, 0x6F ; 111 153c6: 96 e8 ldi r25, 0x86 ; 134 153c8: 0e 94 68 77 call 0xeed0 ; 0xeed0 153cc: 1e c1 rjmp .+572 ; 0x1560a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 153ce: 88 35 cpi r24, 0x58 ; 88 153d0: 52 e0 ldi r21, 0x02 ; 2 153d2: 95 07 cpc r25, r21 153d4: 11 f4 brne .+4 ; 0x153da 153d6: 0c 94 46 bf jmp 0x17e8c ; 0x17e8c 153da: 89 35 cpi r24, 0x59 ; 89 153dc: 92 40 sbci r25, 0x02 ; 2 153de: 09 f4 brne .+2 ; 0x153e2 153e0: 4c cb rjmp .-2408 ; 0x14a7a 153e2: de ca rjmp .-2628 ; 0x149a0 153e4: 8e 3b cpi r24, 0xBE ; 190 153e6: b2 e0 ldi r27, 0x02 ; 2 153e8: 9b 07 cpc r25, r27 153ea: 11 f4 brne .+4 ; 0x153f0 153ec: 0c 94 1a ca jmp 0x19434 ; 0x19434 153f0: 0c f0 brlt .+2 ; 0x153f4 153f2: 49 c0 rjmp .+146 ; 0x15486 153f4: 8b 35 cpi r24, 0x5B ; 91 153f6: f2 e0 ldi r31, 0x02 ; 2 153f8: 9f 07 cpc r25, r31 153fa: 11 f4 brne .+4 ; 0x15400 153fc: 0c 94 59 c3 jmp 0x186b2 ; 0x186b2 15400: 8d 3b cpi r24, 0xBD ; 189 15402: 92 40 sbci r25, 0x02 ; 2 15404: 09 f0 breq .+2 ; 0x15408 15406: cc ca rjmp .-2664 ; 0x149a0 case 701: { uint8_t mmuSlotIndex = 0xffU; float fastLoadLength = FILAMENTCHANGE_FIRSTFEED; // Only used without MMU float z_target = 0; if( MMU2::mmu2.Enabled() ) 15408: 80 91 b9 13 lds r24, 0x13B9 ; 0x8013b9 1540c: 81 30 cpi r24, 0x01 ; 1 1540e: 11 f4 brne .+4 ; 0x15414 15410: 0c 94 bb c9 jmp 0x19376 ; 0x19376 - `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; 15414: 1f ef ldi r17, 0xFF ; 255 if( code_seen('P') || code_seen('T') ) { mmuSlotIndex = code_value_uint8(); } } if (code_seen('L')) fastLoadLength = code_value(); 15416: 8c e4 ldi r24, 0x4C ; 76 15418: 0e 94 ee 5b call 0xb7dc ; 0xb7dc - `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 1541c: c1 2c mov r12, r1 1541e: d1 2c mov r13, r1 15420: 6c e8 ldi r22, 0x8C ; 140 15422: e6 2e mov r14, r22 15424: 62 e4 ldi r22, 0x42 ; 66 15426: f6 2e mov r15, r22 if( code_seen('P') || code_seen('T') ) { mmuSlotIndex = code_value_uint8(); } } if (code_seen('L')) fastLoadLength = code_value(); 15428: 88 23 and r24, r24 1542a: 21 f0 breq .+8 ; 0x15434 1542c: 0e 94 b5 60 call 0xc16a ; 0xc16a 15430: 6b 01 movw r12, r22 15432: 7c 01 movw r14, r24 // Z lift. For safety only allow positive values if (code_seen('Z')) z_target = fabs(code_value()); 15434: 8a e5 ldi r24, 0x5A ; 90 15436: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 1543a: 88 23 and r24, r24 1543c: 11 f4 brne .+4 ; 0x15442 1543e: 0c 94 cc c9 jmp 0x19398 ; 0x19398 15442: 0e 94 b5 60 call 0xc16a ; 0xc16a 15446: 9f 77 andi r25, 0x7F ; 127 // Raise the Z axis float delta = raise_z(z_target); 15448: 0e 94 f9 6d call 0xdbf2 ; 0xdbf2 1544c: 4b 01 movw r8, r22 1544e: 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 15450: 8a e5 ldi r24, 0x5A ; 90 15452: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 15456: 08 2f mov r16, r24 } custom_message_type = CustomMsg::Status; } void gcode_M701(float fastLoadLength, uint8_t mmuSlotIndex, bool raise_z_axis = false){ FSensorBlockRunout fsBlockRunout; 15458: 0f 94 69 86 call 0x30cd2 ; 0x30cd2 prusa_statistics(22); if (MMU2::mmu2.Enabled()) { 1545c: 80 91 b9 13 lds r24, 0x13B9 ; 0x8013b9 15460: 81 30 cpi r24, 0x01 ; 1 15462: 11 f0 breq .+4 ; 0x15468 15464: 0c 94 d1 c9 jmp 0x193a2 ; 0x193a2 if (mmuSlotIndex < MMU_FILAMENT_COUNT) { 15468: 15 30 cpi r17, 0x05 ; 5 1546a: 18 f4 brcc .+6 ; 0x15472 MMU2::mmu2.load_filament_to_nozzle(mmuSlotIndex); 1546c: 81 2f mov r24, r17 1546e: 0f 94 86 0e call 0x21d0c ; 0x21d0c lcd_update(2); lcd_setstatuspgm(MSG_WELCOME); custom_message_type = CustomMsg::Status; } eFilamentAction = FilamentAction::None; 15472: 10 92 a5 03 sts 0x03A5, r1 ; 0x8003a5 #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) // SERIAL_ECHOLNPGM("FSBlockRunout"); } FSensorBlockRunout::~FSensorBlockRunout() { fsensor.settings_init(); // restore filament runout state. 15476: 0f 94 ad 7a call 0x2f55a ; 0x2f55a // 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); 1547a: c5 01 movw r24, r10 1547c: b4 01 movw r22, r8 1547e: 90 58 subi r25, 0x80 ; 128 15480: 0e 94 f9 6d call 0xdbf2 ; 0xdbf2 15484: c2 c0 rjmp .+388 ; 0x1560a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15486: 81 3c cpi r24, 0xC1 ; 193 15488: 32 e0 ldi r19, 0x02 ; 2 1548a: 93 07 cpc r25, r19 1548c: 11 f4 brne .+4 ; 0x15492 1548e: 0c 94 4e ca jmp 0x1949c ; 0x1949c 15492: 14 f0 brlt .+4 ; 0x15498 15494: 0c 94 54 ca jmp 0x194a8 ; 0x194a8 15498: 80 3c cpi r24, 0xC0 ; 192 1549a: 92 40 sbci r25, 0x02 ; 2 1549c: 09 f0 breq .+2 ; 0x154a0 1549e: 80 ca rjmp .-2816 ; 0x149a0 #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 704: { gcodes_M704_M705_M706(704); 154a0: 80 ec ldi r24, 0xC0 ; 192 154a2: 92 e0 ldi r25, 0x02 ; 2 154a4: 0e 94 67 60 call 0xc0ce ; 0xc0ce 154a8: b0 c0 rjmp .+352 ; 0x1560a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 154aa: 84 38 cpi r24, 0x84 ; 132 154ac: a3 e0 ldi r26, 0x03 ; 3 154ae: 9a 07 cpc r25, r26 154b0: 11 f4 brne .+4 ; 0x154b6 154b2: 0c 94 03 c7 jmp 0x18e06 ; 0x18e06 154b6: 0c f0 brlt .+2 ; 0x154ba 154b8: 97 c0 rjmp .+302 ; 0x155e8 154ba: 82 35 cpi r24, 0x52 ; 82 154bc: e3 e0 ldi r30, 0x03 ; 3 154be: 9e 07 cpc r25, r30 154c0: 11 f4 brne .+4 ; 0x154c6 154c2: 0c 94 5f c3 jmp 0x186be ; 0x186be 154c6: 94 f5 brge .+100 ; 0x1552c 154c8: 84 3c cpi r24, 0xC4 ; 196 154ca: 22 e0 ldi r18, 0x02 ; 2 154cc: 92 07 cpc r25, r18 154ce: 11 f4 brne .+4 ; 0x154d4 154d0: 0c 94 77 ca jmp 0x194ee ; 0x194ee 154d4: 85 3c cpi r24, 0xC5 ; 197 154d6: 92 40 sbci r25, 0x02 ; 2 154d8: 09 f0 breq .+2 ; 0x154dc 154da: 62 ca rjmp .-2876 ; 0x149a0 M709 - Serial message if en- or disabled */ case 709: { if (code_seen('S')) 154dc: 83 e5 ldi r24, 0x53 ; 83 154de: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 154e2: 88 23 and r24, r24 154e4: 51 f0 breq .+20 ; 0x154fa { switch (code_value_uint8()) 154e6: 0e 94 80 5b call 0xb700 ; 0xb700 154ea: 88 23 and r24, r24 154ec: 11 f4 brne .+4 ; 0x154f2 154ee: 0c 94 a3 ca jmp 0x19546 ; 0x19546 154f2: 81 30 cpi r24, 0x01 ; 1 154f4: 11 f4 brne .+4 ; 0x154fa 154f6: 0c 94 b0 ca jmp 0x19560 ; 0x19560 break; default: break; } } if (MMU2::mmu2.Enabled() && code_seen('X')) 154fa: 80 91 b9 13 lds r24, 0x13B9 ; 0x8013b9 154fe: 81 30 cpi r24, 0x01 ; 1 15500: 91 f4 brne .+36 ; 0x15526 15502: 88 e5 ldi r24, 0x58 ; 88 15504: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 15508: 88 23 and r24, r24 1550a: 69 f0 breq .+26 ; 0x15526 { switch (code_value_uint8()) 1550c: 0e 94 80 5b call 0xb700 ; 0xb700 15510: 81 30 cpi r24, 0x01 ; 1 15512: 11 f4 brne .+4 ; 0x15518 15514: 0c 94 be ca jmp 0x1957c ; 0x1957c 15518: 10 f4 brcc .+4 ; 0x1551e 1551a: 0c 94 b9 ca jmp 0x19572 ; 0x19572 1551e: 8a 32 cpi r24, 0x2A ; 42 15520: 11 f4 brne .+4 ; 0x15526 15522: 0c 94 c2 ca jmp 0x19584 ; 0x19584 break; default: break; } } MMU2::mmu2.Status(); 15526: 0f 94 9e 74 call 0x2e93c ; 0x2e93c 1552a: 6f c0 rjmp .+222 ; 0x1560a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1552c: 8d 35 cpi r24, 0x5D ; 93 1552e: 43 e0 ldi r20, 0x03 ; 3 15530: 94 07 cpc r25, r20 15532: 11 f4 brne .+4 ; 0x15538 15534: 0c 94 d5 c4 jmp 0x189aa ; 0x189aa 15538: 8e 35 cpi r24, 0x5E ; 94 1553a: 53 e0 ldi r21, 0x03 ; 3 1553c: 95 07 cpc r25, r21 1553e: 11 f4 brne .+4 ; 0x15544 15540: 0c 94 6d c5 jmp 0x18ada ; 0x18ada 15544: 8c 35 cpi r24, 0x5C ; 92 15546: 93 40 sbci r25, 0x03 ; 3 15548: 09 f0 breq .+2 ; 0x1554c 1554a: 2a ca rjmp .-2988 ; 0x149a0 */ case 860: { int set_target_pinda = 0; if (code_seen('S')) { 1554c: 83 e5 ldi r24, 0x53 ; 83 1554e: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 15552: 88 23 and r24, r24 15554: 09 f4 brne .+2 ; 0x15558 15556: 59 c0 rjmp .+178 ; 0x1560a set_target_pinda = code_value_short(); 15558: 0e 94 8d 5b call 0xb71a ; 0xb71a 1555c: 8c 01 movw r16, r24 } else { break; } LCD_MESSAGERPGM(_T(MSG_PLEASE_WAIT)); 1555e: 8a ee ldi r24, 0xEA ; 234 15560: 99 e3 ldi r25, 0x39 ; 57 15562: 0e 94 c4 72 call 0xe588 ; 0xe588 15566: 0e 94 38 f1 call 0x1e270 ; 0x1e270 SERIAL_PROTOCOLPGM("Wait for PINDA target temperature:"); 1556a: 88 ee ldi r24, 0xE8 ; 232 1556c: 95 e8 ldi r25, 0x85 ; 133 1556e: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_PROTOCOLLN(set_target_pinda); 15572: c8 01 movw r24, r16 15574: 0f 94 b0 74 call 0x2e960 ; 0x2e960 codenum = _millis(); 15578: 0f 94 22 29 call 0x25244 ; 0x25244 1557c: 4b 01 movw r8, r22 1557e: 5c 01 movw r10, r24 cancel_heatup = false; 15580: 10 92 b4 0d sts 0x0DB4, r1 ; 0x800db4 <_ZL13cancel_heatup.lto_priv.408> bool is_pinda_cooling = false; if (!(CHECK_ALL_HEATERS)) is_pinda_cooling = true; 15584: 80 91 b5 0d lds r24, 0x0DB5 ; 0x800db5 15588: 90 91 b6 0d lds r25, 0x0DB6 ; 0x800db6 1558c: 89 2b or r24, r25 1558e: 41 f4 brne .+16 ; 0x155a0 15590: ff 24 eor r15, r15 15592: f3 94 inc r15 15594: 80 91 71 06 lds r24, 0x0671 ; 0x800671 15598: 90 91 72 06 lds r25, 0x0672 ; 0x800672 1559c: 89 2b or r24, r25 1559e: 09 f0 breq .+2 ; 0x155a2 SERIAL_PROTOCOLLN(set_target_pinda); codenum = _millis(); cancel_heatup = false; bool is_pinda_cooling = false; 155a0: 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)) ) { 155a2: 28 01 movw r4, r16 155a4: 01 2e mov r0, r17 155a6: 00 0c add r0, r0 155a8: 66 08 sbc r6, r6 155aa: 77 08 sbc r7, r7 155ac: f1 10 cpse r15, r1 155ae: 0c 94 95 c4 jmp 0x1892a ; 0x1892a 155b2: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 <_ZL13cancel_heatup.lto_priv.408> 155b6: 81 11 cpse r24, r1 155b8: 12 c0 rjmp .+36 ; 0x155de 155ba: c3 01 movw r24, r6 155bc: b2 01 movw r22, r4 155be: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 155c2: 20 91 97 03 lds r18, 0x0397 ; 0x800397 155c6: 30 91 98 03 lds r19, 0x0398 ; 0x800398 155ca: 40 91 99 03 lds r20, 0x0399 ; 0x800399 155ce: 50 91 9a 03 lds r21, 0x039A ; 0x80039a 155d2: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 155d6: 18 16 cp r1, r24 155d8: 14 f4 brge .+4 ; 0x155de 155da: 0c 94 a7 c4 jmp 0x1894e ; 0x1894e } manage_heater(); manage_inactivity(); lcd_update(0); } LCD_MESSAGERPGM(MSG_OK); 155de: 85 ef ldi r24, 0xF5 ; 245 155e0: 9d e6 ldi r25, 0x6D ; 109 155e2: 0e 94 38 f1 call 0x1e270 ; 0x1e270 155e6: 11 c0 rjmp .+34 ; 0x1560a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 155e8: 81 39 cpi r24, 0x91 ; 145 155ea: b3 e0 ldi r27, 0x03 ; 3 155ec: 9b 07 cpc r25, r27 155ee: 11 f4 brne .+4 ; 0x155f4 155f0: 0c 94 36 c8 jmp 0x1906c ; 0x1906c 155f4: 84 f4 brge .+32 ; 0x15616 155f6: 8b 38 cpi r24, 0x8B ; 139 155f8: f3 e0 ldi r31, 0x03 ; 3 155fa: 9f 07 cpc r25, r31 155fc: 11 f4 brne .+4 ; 0x15602 155fe: 0c 94 b2 c7 jmp 0x18f64 ; 0x18f64 15602: 8c 38 cpi r24, 0x8C ; 140 15604: 93 40 sbci r25, 0x03 ; 3 15606: 09 f0 breq .+2 ; 0x1560a 15608: cb c9 rjmp .-3178 ; 0x149a0 */ 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; 1560a: 10 92 aa 0d sts 0x0DAA, r1 ; 0x800daa <_ZL17mcode_in_progress.lto_priv.530+0x1> 1560e: 10 92 a9 0d sts 0x0DA9, r1 ; 0x800da9 <_ZL17mcode_in_progress.lto_priv.530> 15612: 0c 94 50 96 jmp 0x12ca0 ; 0x12ca0 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15616: 84 39 cpi r24, 0x94 ; 148 15618: 33 e0 ldi r19, 0x03 ; 3 1561a: 93 07 cpc r25, r19 1561c: 14 f4 brge .+4 ; 0x15622 1561e: 0c 94 85 c8 jmp 0x1910a ; 0x1910a 15622: 80 3a cpi r24, 0xA0 ; 160 15624: 93 40 sbci r25, 0x03 ; 3 15626: 09 f0 breq .+2 ; 0x1562a 15628: bb c9 rjmp .-3210 ; 0x149a0 M928 [filename] */ case 928: card.openLogFile(strchr_pointer+5); 1562a: 80 91 93 03 lds r24, 0x0393 ; 0x800393 1562e: 90 91 94 03 lds r25, 0x0394 ; 0x800394 } } void CardReader::openLogFile(const char* name) { logging = true; 15632: 21 e0 ldi r18, 0x01 ; 1 15634: 20 93 8e 14 sts 0x148E, r18 ; 0x80148e openFileWrite(name); 15638: 05 96 adiw r24, 0x05 ; 5 1563a: 0f 94 21 85 call 0x30a42 ; 0x30a42 1563e: e5 cf rjmp .-54 ; 0x1560a - `string` - Must for M1 and optional for M0 message to display on the LCD */ case 0: case 1: { const char *src = strchr_pointer + 2; 15640: 00 91 93 03 lds r16, 0x0393 ; 0x800393 15644: 10 91 94 03 lds r17, 0x0394 ; 0x800394 15648: 0e 5f subi r16, 0xFE ; 254 1564a: 1f 4f sbci r17, 0xFF ; 255 codenum = 0; if (code_seen('P')) codenum = code_value_long(); // milliseconds to wait 1564c: 80 e5 ldi r24, 0x50 ; 80 1564e: 0e 94 ee 5b call 0xb7dc ; 0xb7dc */ case 0: case 1: { const char *src = strchr_pointer + 2; codenum = 0; 15652: c1 2c mov r12, r1 15654: d1 2c mov r13, r1 15656: 76 01 movw r14, r12 if (code_seen('P')) codenum = code_value_long(); // milliseconds to wait 15658: 88 23 and r24, r24 1565a: 21 f0 breq .+8 ; 0x15664 1565c: 0e 94 9a 5b call 0xb734 ; 0xb734 15660: 6b 01 movw r12, r22 15662: 7c 01 movw r14, r24 if (code_seen('S')) codenum = code_value_long() * 1000; // seconds to wait 15664: 83 e5 ldi r24, 0x53 ; 83 15666: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 1566a: 88 23 and r24, r24 1566c: 51 f0 breq .+20 ; 0x15682 1566e: 0e 94 9a 5b call 0xb734 ; 0xb734 15672: 9b 01 movw r18, r22 15674: ac 01 movw r20, r24 15676: a8 ee ldi r26, 0xE8 ; 232 15678: b3 e0 ldi r27, 0x03 ; 3 1567a: 0f 94 6c dc call 0x3b8d8 ; 0x3b8d8 <__muluhisi3> 1567e: 6b 01 movw r12, r22 15680: 7c 01 movw r14, r24 15682: c8 01 movw r24, r16 15684: 0f 5f subi r16, 0xFF ; 255 15686: 1f 4f sbci r17, 0xFF ; 255 bool expiration_time_set = bool(codenum); while (*src == ' ') ++src; 15688: dc 01 movw r26, r24 1568a: 4c 91 ld r20, X 1568c: 40 32 cpi r20, 0x20 ; 32 1568e: c9 f3 breq .-14 ; 0x15682 custom_message_type = CustomMsg::M0Wait; 15690: 26 e0 ldi r18, 0x06 ; 6 15692: 20 93 c3 06 sts 0x06C3, r18 ; 0x8006c3 if (!expiration_time_set && *src != '\0') { 15696: c1 14 cp r12, r1 15698: d1 04 cpc r13, r1 1569a: e1 04 cpc r14, r1 1569c: f1 04 cpc r15, r1 1569e: a1 f5 brne .+104 ; 0x15708 156a0: 2c 91 ld r18, X 156a2: 22 23 and r18, r18 156a4: 89 f1 breq .+98 ; 0x15708 lcd_setstatus(src); 156a6: 0e 94 64 f4 call 0x1e8c8 ; 0x1e8c8 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(); 156aa: 0f 94 a3 42 call 0x28546 ; 0x28546 menu_set_block(MENU_BLOCK_STATUS_SCREEN_M0); 156ae: 80 91 d4 03 lds r24, 0x03D4 ; 0x8003d4 156b2: 84 60 ori r24, 0x04 ; 4 156b4: 80 93 d4 03 sts 0x03D4, r24 ; 0x8003d4 previous_millis_cmd.start(); 156b8: 84 e8 ldi r24, 0x84 ; 132 156ba: 93 e0 ldi r25, 0x03 ; 3 156bc: 0f 94 c5 2b call 0x2578a ; 0x2578a ::start()> if (expiration_time_set) { 156c0: c1 14 cp r12, r1 156c2: d1 04 cpc r13, r1 156c4: e1 04 cpc r14, r1 156c6: f1 04 cpc r15, r1 156c8: 79 f1 breq .+94 ; 0x15728 codenum += _millis(); // keep track of when we started waiting 156ca: 0f 94 22 29 call 0x25244 ; 0x25244 156ce: c6 0e add r12, r22 156d0: d7 1e adc r13, r23 156d2: e8 1e adc r14, r24 156d4: f9 1e adc r15, r25 KEEPALIVE_STATE(PAUSED_FOR_USER); 156d6: 84 e0 ldi r24, 0x04 ; 4 156d8: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be while(_millis() < codenum && !lcd_clicked()) { 156dc: 0f 94 22 29 call 0x25244 ; 0x25244 156e0: 6c 15 cp r22, r12 156e2: 7d 05 cpc r23, r13 156e4: 8e 05 cpc r24, r14 156e6: 9f 05 cpc r25, r15 156e8: b0 f0 brcs .+44 ; 0x15716 delay_keep_alive(0); } KEEPALIVE_STATE(IN_HANDLER); 156ea: 82 e0 ldi r24, 0x02 ; 2 156ec: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be } else { marlin_wait_for_click(); } menu_unset_block(MENU_BLOCK_STATUS_SCREEN_M0); 156f0: 80 91 d4 03 lds r24, 0x03D4 ; 0x8003d4 156f4: 8b 7f andi r24, 0xFB ; 251 156f6: 80 93 d4 03 sts 0x03D4, r24 ; 0x8003d4 if (IS_SD_PRINTING) 156fa: 80 91 8f 14 lds r24, 0x148F ; 0x80148f 156fe: 88 23 and r24, r24 15700: 31 f1 breq .+76 ; 0x1574e custom_message_type = CustomMsg::Status; 15702: 10 92 c3 06 sts 0x06C3, r1 ; 0x8006c3 15706: 81 cf rjmp .-254 ; 0x1560a } 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){ LCD_MESSAGERPGM(_T(MSG_USERWAIT)); 15708: 83 e0 ldi r24, 0x03 ; 3 1570a: 9a e3 ldi r25, 0x3A ; 58 1570c: 0e 94 c4 72 call 0xe588 ; 0xe588 15710: 0e 94 38 f1 call 0x1e270 ; 0x1e270 15714: ca cf rjmp .-108 ; 0x156aa 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()) { 15716: 0e 94 15 71 call 0xe22a ; 0xe22a 1571a: 81 11 cpse r24, r1 1571c: e6 cf rjmp .-52 ; 0x156ea delay_keep_alive(0); 1571e: 90 e0 ldi r25, 0x00 ; 0 15720: 80 e0 ldi r24, 0x00 ; 0 15722: 0e 94 fc 8c call 0x119f8 ; 0x119f8 15726: da cf rjmp .-76 ; 0x156dc //! @brief Wait for click //! //! Set void marlin_wait_for_click() { int8_t busy_state_backup = busy_state; 15728: 10 91 be 02 lds r17, 0x02BE ; 0x8002be KEEPALIVE_STATE(PAUSED_FOR_USER); 1572c: 84 e0 ldi r24, 0x04 ; 4 1572e: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be lcd_consume_click(); 15732: 0e 94 10 71 call 0xe220 ; 0xe220 while(!lcd_clicked()) 15736: 0e 94 15 71 call 0xe22a ; 0xe22a 1573a: 81 11 cpse r24, r1 1573c: 05 c0 rjmp .+10 ; 0x15748 { delay_keep_alive(0); 1573e: 90 e0 ldi r25, 0x00 ; 0 15740: 80 e0 ldi r24, 0x00 ; 0 15742: 0e 94 fc 8c call 0x119f8 ; 0x119f8 15746: f7 cf rjmp .-18 ; 0x15736 } KEEPALIVE_STATE(busy_state_backup); 15748: 10 93 be 02 sts 0x02BE, r17 ; 0x8002be 1574c: d1 cf rjmp .-94 ; 0x156f0 } menu_unset_block(MENU_BLOCK_STATUS_SCREEN_M0); if (IS_SD_PRINTING) custom_message_type = CustomMsg::Status; else LCD_MESSAGERPGM(MSG_WELCOME); 1574e: 86 eb ldi r24, 0xB6 ; 182 15750: 90 e7 ldi r25, 0x70 ; 112 15752: 0e 94 38 f1 call 0x1e270 ; 0x1e270 15756: 59 cf rjmp .-334 ; 0x1560a /*! ### M17 - Enable all axes M17: Enable/Power all stepper motors */ case 17: LCD_MESSAGERPGM(_T(MSG_NO_MOVE)); 15758: 88 ef ldi r24, 0xF8 ; 248 1575a: 99 e3 ldi r25, 0x39 ; 57 1575c: 0e 94 c4 72 call 0xe588 ; 0xe588 15760: 0e 94 38 f1 call 0x1e270 ; 0x1e270 enable_x(); 15764: 17 98 cbi 0x02, 7 ; 2 enable_y(); 15766: 16 98 cbi 0x02, 6 ; 2 enable_z(); 15768: 15 98 cbi 0x02, 5 ; 2 enable_e0(); 1576a: 14 98 cbi 0x02, 4 ; 2 1576c: 4e cf rjmp .-356 ; 0x1560a /*! ### M21 - Init SD card M21: Initialize SD card */ case 21: card.mount(); 1576e: 81 e0 ldi r24, 0x01 ; 1 15770: 0f 94 7d 80 call 0x300fa ; 0x300fa 15774: 4a cf rjmp .-364 ; 0x1560a presort_flag = true; #endif } void CardReader::release() { sdprinting = false; 15776: 10 92 8f 14 sts 0x148F, r1 ; 0x80148f mounted = false; 1577a: 10 92 90 14 sts 0x1490, r1 ; 0x801490 SERIAL_ECHO_START; 1577e: 82 ef ldi r24, 0xF2 ; 242 15780: 9b ea ldi r25, 0xAB ; 171 15782: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED 15786: 82 ed ldi r24, 0xD2 ; 210 15788: 9b e6 ldi r25, 0x6B ; 107 1578a: 0e 94 93 79 call 0xf326 ; 0xf326 1578e: 3d cf rjmp .-390 ; 0x1560a /*! ### M24 - Start SD print M24: Start/resume SD print */ case 24: if (printingIsPaused()) 15790: 0e 94 9d 67 call 0xcf3a ; 0xcf3a 15794: 88 23 and r24, r24 15796: 19 f0 breq .+6 ; 0x1579e lcd_resume_print(); 15798: 0e 94 f2 f7 call 0x1efe4 ; 0x1efe4 1579c: 36 cf rjmp .-404 ; 0x1560a else { if (!filament_presence_check()) { 1579e: 0e 94 dd f4 call 0x1e9ba ; 0x1e9ba 157a2: 88 23 and r24, r24 157a4: 09 f4 brne .+2 ; 0x157a8 157a6: 31 cf rjmp .-414 ; 0x1560a 157a8: 80 91 22 17 lds r24, 0x1722 ; 0x801722 157ac: 88 23 and r24, r24 157ae: 61 f0 breq .+24 ; 0x157c8 // Print was aborted break; } if (!card.get_sdpos()) 157b0: 80 91 a3 17 lds r24, 0x17A3 ; 0x8017a3 157b4: 90 91 a4 17 lds r25, 0x17A4 ; 0x8017a4 157b8: a0 91 a5 17 lds r26, 0x17A5 ; 0x8017a5 157bc: b0 91 a6 17 lds r27, 0x17A6 ; 0x8017a6 157c0: 89 2b or r24, r25 157c2: 8a 2b or r24, r26 157c4: 8b 2b or r24, r27 157c6: 69 f4 brne .+26 ; 0x157e2 { // A new print has started from scratch, reset stats failstats_reset_print(); 157c8: 0e 94 3c 5c call 0xb878 ; 0xb878 sdpos_atomic = 0; 157cc: 10 92 80 03 sts 0x0380, r1 ; 0x800380 157d0: 10 92 81 03 sts 0x0381, r1 ; 0x800381 157d4: 10 92 82 03 sts 0x0382, r1 ; 0x800382 157d8: 10 92 83 03 sts 0x0383, r1 ; 0x800383 157dc: 80 e0 ldi r24, 0x00 ; 0 157de: 0e 94 2f 82 call 0x1045e ; 0x1045e } void CardReader::startFileprint() { if(mounted) 157e2: 80 91 90 14 lds r24, 0x1490 ; 0x801490 157e6: 88 23 and r24, r24 157e8: 31 f0 breq .+12 ; 0x157f6 { sdprinting = true; 157ea: 81 e0 ldi r24, 0x01 ; 1 157ec: 80 93 8f 14 sts 0x148F, r24 ; 0x80148f 157f0: 85 e0 ldi r24, 0x05 ; 5 157f2: 80 93 b7 0d sts 0x0DB7, r24 ; 0x800db7 <_ZL13printer_state.lto_priv.401> la10c_reset(); #endif } card.startFileprint(); print_job_timer.start(); 157f6: 0f 94 48 42 call 0x28490 ; 0x28490 if (MMU2::mmu2.Enabled()) 157fa: 80 91 b9 13 lds r24, 0x13B9 ; 0x8013b9 157fe: 81 30 cpi r24, 0x01 ; 1 15800: 09 f0 breq .+2 ; 0x15804 15802: 03 cf rjmp .-506 ; 0x1560a { if (MMU2::mmu2.FindaDetectsFilament() && !fsensor.getFilamentPresent()) 15804: 80 91 8f 13 lds r24, 0x138F ; 0x80138f 15808: 88 23 and r24, r24 1580a: 09 f4 brne .+2 ; 0x1580e 1580c: fe ce rjmp .-516 ; 0x1560a 1580e: 80 91 b6 17 lds r24, 0x17B6 ; 0x8017b6 15812: 81 11 cpse r24, r1 15814: fa ce rjmp .-524 ; 0x1560a { // Filament only half way into the PTFE. Unload the filament. MMU2::mmu2.unload(); 15816: 0f 94 f8 ac call 0x359f0 ; 0x359f0 1581a: f7 ce rjmp .-530 ; 0x1560a #### Parameters - `S` - Index in bytes */ case 26: if(card.mounted && code_seen('S')) { 1581c: 80 91 90 14 lds r24, 0x1490 ; 0x801490 15820: 88 23 and r24, r24 15822: 09 f4 brne .+2 ; 0x15826 15824: f2 ce rjmp .-540 ; 0x1560a 15826: 83 e5 ldi r24, 0x53 ; 83 15828: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 1582c: 88 23 and r24, r24 1582e: 09 f4 brne .+2 ; 0x15832 15830: ec ce rjmp .-552 ; 0x1560a long index = code_value_long(); 15832: 0e 94 9a 5b call 0xb734 ; 0xb734 15836: 6b 01 movw r12, r22 15838: 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);}; 1583a: c0 92 a3 17 sts 0x17A3, r12 ; 0x8017a3 1583e: d0 92 a4 17 sts 0x17A4, r13 ; 0x8017a4 15842: e0 92 a5 17 sts 0x17A5, r14 ; 0x8017a5 15846: f0 92 a6 17 sts 0x17A6, r15 ; 0x8017a6 1584a: 0f 94 57 75 call 0x2eaae ; 0x2eaae 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; 1584e: c0 92 80 03 sts 0x0380, r12 ; 0x800380 15852: d0 92 81 03 sts 0x0381, r13 ; 0x800381 15856: e0 92 82 03 sts 0x0382, r14 ; 0x800382 1585a: f0 92 83 03 sts 0x0383, r15 ; 0x800383 1585e: d5 ce rjmp .-598 ; 0x1560a #### Parameters - `P` - Show full SFN path instead of LFN only. */ case 27: card.getStatus(code_seen('P')); 15860: 80 e5 ldi r24, 0x50 ; 80 15862: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 15866: 18 2f mov r17, r24 return filesize; } void CardReader::getStatus(bool arg_P) { if (printingIsPaused()) 15868: 0e 94 9d 67 call 0xcf3a ; 0xcf3a 1586c: 88 23 and r24, r24 1586e: 91 f0 breq .+36 ; 0x15894 { if (saved_printing && (saved_printing_type == PowerPanic::PRINT_TYPE_SD)) 15870: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 15874: 88 23 and r24, r24 15876: 49 f0 breq .+18 ; 0x1588a 15878: 80 91 6a 02 lds r24, 0x026A ; 0x80026a 1587c: 81 11 cpse r24, r1 1587e: 05 c0 rjmp .+10 ; 0x1588a SERIAL_PROTOCOLLNPGM("SD print paused"); 15880: 8e e1 ldi r24, 0x1E ; 30 15882: 95 e8 ldi r25, 0x85 ; 133 15884: 0e 94 93 79 call 0xf326 ; 0xf326 15888: c0 ce rjmp .-640 ; 0x1560a else SERIAL_PROTOCOLLNPGM("Print saved"); 1588a: 82 e1 ldi r24, 0x12 ; 18 1588c: 95 e8 ldi r25, 0x85 ; 133 1588e: 0e 94 93 79 call 0xf326 ; 0xf326 15892: bb ce rjmp .-650 ; 0x1560a } else if (sdprinting) 15894: 80 91 8f 14 lds r24, 0x148F ; 0x80148f 15898: 88 23 and r24, r24 1589a: 09 f4 brne .+2 ; 0x1589e 1589c: 4a c0 rjmp .+148 ; 0x15932 { if (arg_P) 1589e: 11 23 and r17, r17 158a0: e1 f1 breq .+120 ; 0x1591a { printAbsFilenameFast(); 158a2: 0f 94 dc 79 call 0x2f3b8 ; 0x2f3b8 SERIAL_PROTOCOLLN(); 158a6: 0f 94 b8 d5 call 0x3ab70 ; 0x3ab70 } else SERIAL_PROTOCOLLN(LONGEST_FILENAME); SERIAL_PROTOCOLRPGM(_N("SD printing byte "));////MSG_SD_PRINTING_BYTE 158aa: 8b e0 ldi r24, 0x0B ; 11 158ac: 98 e6 ldi r25, 0x68 ; 104 158ae: 0e 94 68 77 call 0xeed0 ; 0xeed0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 158b2: 60 91 a3 17 lds r22, 0x17A3 ; 0x8017a3 158b6: 70 91 a4 17 lds r23, 0x17A4 ; 0x8017a4 158ba: 80 91 a5 17 lds r24, 0x17A5 ; 0x8017a5 158be: 90 91 a6 17 lds r25, 0x17A6 ; 0x8017a6 158c2: 4a e0 ldi r20, 0x0A ; 10 158c4: 0f 94 c1 d4 call 0x3a982 ; 0x3a982 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 158c8: 8f e2 ldi r24, 0x2F ; 47 158ca: 0e 94 4f 77 call 0xee9e ; 0xee9e } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 158ce: 60 91 9c 17 lds r22, 0x179C ; 0x80179c 158d2: 70 91 9d 17 lds r23, 0x179D ; 0x80179d 158d6: 80 91 9e 17 lds r24, 0x179E ; 0x80179e 158da: 90 91 9f 17 lds r25, 0x179F ; 0x80179f 158de: 4a e0 ldi r20, 0x0A ; 10 158e0: 0f 94 c1 d4 call 0x3a982 ; 0x3a982 } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 158e4: 0f 94 b8 d5 call 0x3ab70 ; 0x3ab70 SERIAL_PROTOCOL(sdpos); SERIAL_PROTOCOL('/'); SERIAL_PROTOCOLLN(filesize); uint16_t time = print_job_timer.duration() / 60; 158e8: 0f 94 75 3e call 0x27cea ; 0x27cea 158ec: 2c e3 ldi r18, 0x3C ; 60 158ee: 30 e0 ldi r19, 0x00 ; 0 158f0: 40 e0 ldi r20, 0x00 ; 0 158f2: 50 e0 ldi r21, 0x00 ; 0 158f4: 0f 94 4a dc call 0x3b894 ; 0x3b894 <__udivmodsi4> SERIAL_PROTOCOL((int)(time / 60)); 158f8: c9 01 movw r24, r18 158fa: 6c e3 ldi r22, 0x3C ; 60 158fc: 70 e0 ldi r23, 0x00 ; 0 158fe: 0f 94 a0 dc call 0x3b940 ; 0x3b940 <__udivmodhi4> 15902: 8c 01 movw r16, r24 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 15904: 90 e0 ldi r25, 0x00 ; 0 15906: 80 e0 ldi r24, 0x00 ; 0 15908: 0f 94 26 d5 call 0x3aa4c ; 0x3aa4c } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 1590c: 8a e3 ldi r24, 0x3A ; 58 1590e: 0e 94 4f 77 call 0xee9e ; 0xee9e SERIAL_PROTOCOL(':'); SERIAL_PROTOCOLLN((int)(time % 60)); 15912: c8 01 movw r24, r16 15914: 0f 94 b0 74 call 0x2e960 ; 0x2e960 15918: 78 ce rjmp .-784 ; 0x1560a { printAbsFilenameFast(); SERIAL_PROTOCOLLN(); } else SERIAL_PROTOCOLLN(LONGEST_FILENAME); 1591a: 80 91 a6 14 lds r24, 0x14A6 ; 0x8014a6 1591e: 88 23 and r24, r24 15920: 29 f0 breq .+10 ; 0x1592c 15922: 86 ea ldi r24, 0xA6 ; 166 15924: 94 e1 ldi r25, 0x14 ; 20 15926: 0f 94 bb d5 call 0x3ab76 ; 0x3ab76 1592a: bf cf rjmp .-130 ; 0x158aa 1592c: 81 e9 ldi r24, 0x91 ; 145 1592e: 94 e1 ldi r25, 0x14 ; 20 15930: fa cf rjmp .-12 ; 0x15926 SERIAL_PROTOCOL((int)(time / 60)); SERIAL_PROTOCOL(':'); SERIAL_PROTOCOLLN((int)(time % 60)); } else SERIAL_PROTOCOLLNPGM("Not SD printing"); 15932: 82 e0 ldi r24, 0x02 ; 2 15934: 95 e8 ldi r25, 0x85 ; 133 15936: 0e 94 93 79 call 0xf326 ; 0xf326 1593a: 67 ce rjmp .-818 ; 0x1560a /*! ### M28 - Start SD write M28: Begin write to SD card */ case 28: card.openFileWrite(strchr_pointer+4); 1593c: 80 91 93 03 lds r24, 0x0393 ; 0x800393 15940: 90 91 94 03 lds r25, 0x0394 ; 0x800394 15944: 04 96 adiw r24, 0x04 ; 4 15946: 0f 94 21 85 call 0x30a42 ; 0x30a42 1594a: 5f ce rjmp .-834 ; 0x1560a * 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; 1594c: ce 01 movw r24, r28 1594e: 01 96 adiw r24, 0x01 ; 1 15950: 0f 94 38 76 call 0x2ec70 ; 0x2ec70 15954: 88 23 and r24, r24 15956: 09 f4 brne .+2 ; 0x1595a 15958: 58 c9 rjmp .-3408 ; 0x14c0a // cache directory entry d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 1595a: 61 e0 ldi r22, 0x01 ; 1 1595c: ce 01 movw r24, r28 1595e: 01 96 adiw r24, 0x01 ; 1 15960: 0f 94 dc 57 call 0x2afb8 ; 0x2afb8 if (!d) goto fail; 15964: 00 97 sbiw r24, 0x00 ; 0 15966: 09 f4 brne .+2 ; 0x1596a 15968: 50 c9 rjmp .-3424 ; 0x14c0a // mark entry deleted d->name[0] = DIR_NAME_DELETED; 1596a: 25 ee ldi r18, 0xE5 ; 229 1596c: fc 01 movw r30, r24 1596e: 20 83 st Z, r18 // set this file closed type_ = FAT_FILE_TYPE_CLOSED; 15970: 1c 82 std Y+4, r1 ; 0x04 // write entry to SD return vol_->cacheFlush(); 15972: 0f 94 d0 52 call 0x2a5a0 ; 0x2a5a0 15976: 18 2f mov r17, r24 15978: 49 c9 rjmp .-3438 ; 0x14c0c presort(); #endif } else { SERIAL_PROTOCOLPGM("Deletion failed, File: "); 1597a: 8c ed ldi r24, 0xDC ; 220 1597c: 94 e8 ldi r25, 0x84 ; 132 1597e: 0e 94 68 77 call 0xeed0 ; 0xeed0 15982: 23 96 adiw r28, 0x03 ; 3 15984: 8e ad ldd r24, Y+62 ; 0x3e 15986: 9f ad ldd r25, Y+63 ; 0x3f 15988: 23 97 sbiw r28, 0x03 ; 3 1598a: 0e 94 2c 88 call 0x11058 ; 0x11058 1598e: 8e e2 ldi r24, 0x2E ; 46 15990: 0e 94 4f 77 call 0xee9e ; 0xee9e } void MarlinSerial::println(char c, int base) { print(c, base); println(); 15994: 0f 94 b8 d5 call 0x3ab70 ; 0x3ab70 15998: 38 ce rjmp .-912 ; 0x1560a ### 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(); 1599a: 0f 94 75 3e call 0x27cea ; 0x27cea int16_t sec, min; min = t / 60; sec = t % 60; 1599e: 2c e3 ldi r18, 0x3C ; 60 159a0: 30 e0 ldi r19, 0x00 ; 0 159a2: 40 e0 ldi r20, 0x00 ; 0 159a4: 50 e0 ldi r21, 0x00 ; 0 159a6: 0f 94 4a dc call 0x3b894 ; 0x3b894 <__udivmodsi4> sprintf_P(time, PSTR("%i min, %i sec"), min, sec); 159aa: 7f 93 push r23 159ac: 6f 93 push r22 159ae: 3f 93 push r19 159b0: 2f 93 push r18 159b2: 89 eb ldi r24, 0xB9 ; 185 159b4: 97 e8 ldi r25, 0x87 ; 135 159b6: 9f 93 push r25 159b8: 8f 93 push r24 159ba: 8e 01 movw r16, r28 159bc: 0f 5f subi r16, 0xFF ; 255 159be: 1f 4f sbci r17, 0xFF ; 255 159c0: 1f 93 push r17 159c2: 0f 93 push r16 159c4: 0f 94 ee da call 0x3b5dc ; 0x3b5dc SERIAL_ECHO_START; 159c8: 82 ef ldi r24, 0xF2 ; 242 159ca: 9b ea ldi r25, 0xAB ; 171 159cc: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHOLN(time); 159d0: c8 01 movw r24, r16 159d2: 0f 94 bb d5 call 0x3ab76 ; 0x3ab76 lcd_setstatus(time); 159d6: c8 01 movw r24, r16 159d8: 0e 94 64 f4 call 0x1e8c8 ; 0x1e8c8 autotempShutdown(); 159dc: 0f b6 in r0, 0x3f ; 63 159de: f8 94 cli 159e0: de bf out 0x3e, r29 ; 62 159e2: 0f be out 0x3f, r0 ; 63 159e4: cd bf out 0x3d, r28 ; 61 159e6: 11 ce rjmp .-990 ; 0x1560a #### 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')) 159e8: 83 e5 ldi r24, 0x53 ; 83 159ea: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 159ee: 88 23 and r24, r24 159f0: 09 f4 brne .+2 ; 0x159f4 159f2: 0b ce rjmp .-1002 ; 0x1560a { uint8_t pin_status = code_value_uint8(); 159f4: 0e 94 80 5b call 0xb700 ; 0xb700 159f8: 08 2f mov r16, r24 int8_t pin_number = LED_PIN; if (code_seen('P')) 159fa: 80 e5 ldi r24, 0x50 ; 80 159fc: 0e 94 ee 5b call 0xb7dc ; 0xb7dc */ case 42: if (code_seen('S')) { uint8_t pin_status = code_value_uint8(); int8_t pin_number = LED_PIN; 15a00: 1d e0 ldi r17, 0x0D ; 13 if (code_seen('P')) 15a02: 88 23 and r24, r24 15a04: 19 f0 breq .+6 ; 0x15a0c pin_number = code_value_uint8(); 15a06: 0e 94 80 5b call 0xb700 ; 0xb700 15a0a: 18 2f mov r17, r24 15a0c: ed e9 ldi r30, 0x9D ; 157 15a0e: f7 e8 ldi r31, 0x87 ; 135 15a10: 89 eb ldi r24, 0xB9 ; 185 15a12: 97 e8 ldi r25, 0x87 ; 135 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) 15a14: 24 91 lpm r18, Z 15a16: 21 17 cp r18, r17 15a18: 09 f4 brne .+2 ; 0x15a1c 15a1a: f7 cd rjmp .-1042 ; 0x1560a 15a1c: 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++) 15a1e: 8e 17 cp r24, r30 15a20: 9f 07 cpc r25, r31 15a22: c1 f7 brne .-16 ; 0x15a14 pin_number = -1; break; } } #if defined(FAN_PIN) && FAN_PIN > -1 if (pin_number == FAN_PIN) 15a24: 16 30 cpi r17, 0x06 ; 6 15a26: 81 f4 brne .+32 ; 0x15a48 fanSpeed = pin_status; 15a28: 00 93 e5 03 sts 0x03E5, r16 ; 0x8003e5 #endif if (pin_number > -1) { pinMode(pin_number, OUTPUT); 15a2c: 61 e0 ldi r22, 0x01 ; 1 15a2e: 81 2f mov r24, r17 15a30: 0e 94 c0 e8 call 0x1d180 ; 0x1d180 digitalWrite(pin_number, pin_status); 15a34: 60 2f mov r22, r16 15a36: 81 2f mov r24, r17 15a38: 0e 94 92 e8 call 0x1d124 ; 0x1d124 analogWrite(pin_number, pin_status); 15a3c: 60 2f mov r22, r16 15a3e: 70 e0 ldi r23, 0x00 ; 0 15a40: 81 2f mov r24, r17 15a42: 0e 94 f1 e8 call 0x1d1e2 ; 0x1d1e2 15a46: e1 cd rjmp .-1086 ; 0x1560a } #if defined(FAN_PIN) && FAN_PIN > -1 if (pin_number == FAN_PIN) fanSpeed = pin_status; #endif if (pin_number > -1) 15a48: 17 fd sbrc r17, 7 15a4a: df cd rjmp .-1090 ; 0x1560a 15a4c: ef cf rjmp .-34 ; 0x15a2c ### 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); 15a4e: 80 e1 ldi r24, 0x10 ; 16 15a50: 0e 94 18 ee call 0x1dc30 ; 0x1dc30 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 15a54: 81 ea ldi r24, 0xA1 ; 161 15a56: 9d e0 ldi r25, 0x0D ; 13 15a58: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 15a5c: 3b e0 ldi r19, 0x0B ; 11 15a5e: 83 9f mul r24, r19 15a60: c0 01 movw r24, r0 15a62: 11 24 eor r1, r1 15a64: 70 e0 ldi r23, 0x00 ; 0 15a66: 60 e0 ldi r22, 0x00 ; 0 15a68: 80 5b subi r24, 0xB0 ; 176 15a6a: 92 4f sbci r25, 0xF2 ; 242 15a6c: 0f 94 19 dc call 0x3b832 ; 0x3b832 // Reset the skew and offset in both RAM and EEPROM. calibration_status_clear(CALIBRATION_STATUS_XYZ); 15a70: 82 e0 ldi r24, 0x02 ; 2 15a72: 0e 94 18 ee call 0x1dc30 ; 0x1dc30 reset_bed_offset_and_skew(); 15a76: 0f 94 10 ce call 0x39c20 ; 0x39c20 // 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(); 15a7a: 0f 94 f1 cd call 0x39be2 ; 0x39be2 15a7e: c5 cd rjmp .-1142 ; 0x1560a */ case 45: // M45: Prusa3D: bed skew and offset with manual Z up { int8_t verbosity_level = 0; bool only_Z = code_seen('Z'); 15a80: 8a e5 ldi r24, 0x5A ; 90 15a82: 0e 94 ee 5b call 0xb7dc ; 0xb7dc // 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); 15a86: 0f 94 60 8d call 0x31ac0 ; 0x31ac0 15a8a: bf cd rjmp .-1154 ; 0x1560a ### 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()) { 15a8c: 80 91 00 17 lds r24, 0x1700 ; 0x801700 15a90: 88 23 and r24, r24 15a92: 19 f1 breq .+70 ; 0x15ada uint8_t ip[4]; if (card.ToshibaFlashAir_GetIP(ip)) { 15a94: ce 01 movw r24, r28 15a96: 01 96 adiw r24, 0x01 ; 1 15a98: 0f 94 89 85 call 0x30b12 ; 0x30b12 15a9c: 88 23 and r24, r24 15a9e: c1 f0 breq .+48 ; 0x15ad0 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 15aa0: 89 81 ldd r24, Y+1 ; 0x01 15aa2: 0e 94 4f 77 call 0xee9e ; 0xee9e } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 15aa6: 8e e2 ldi r24, 0x2E ; 46 15aa8: 0e 94 4f 77 call 0xee9e ; 0xee9e } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 15aac: 8a 81 ldd r24, Y+2 ; 0x02 15aae: 0e 94 4f 77 call 0xee9e ; 0xee9e } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 15ab2: 8e e2 ldi r24, 0x2E ; 46 15ab4: 0e 94 4f 77 call 0xee9e ; 0xee9e } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 15ab8: 8b 81 ldd r24, Y+3 ; 0x03 15aba: 0e 94 4f 77 call 0xee9e ; 0xee9e } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 15abe: 8e e2 ldi r24, 0x2E ; 46 15ac0: 0e 94 4f 77 call 0xee9e ; 0xee9e } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 15ac4: 8c 81 ldd r24, Y+4 ; 0x04 15ac6: 0e 94 4f 77 call 0xee9e ; 0xee9e } void MarlinSerial::println(unsigned char b, int base) { print(b, base); println(); 15aca: 0f 94 b8 d5 call 0x3ab70 ; 0x3ab70 15ace: 9d cd rjmp .-1222 ; 0x1560a SERIAL_PROTOCOL('.'); SERIAL_PROTOCOL(uint8_t(ip[2])); SERIAL_PROTOCOL('.'); SERIAL_PROTOCOLLN(uint8_t(ip[3])); } else { SERIAL_PROTOCOLPGM("?Toshiba FlashAir GetIP failed\n"); 15ad0: 8d e7 ldi r24, 0x7D ; 125 15ad2: 97 e8 ldi r25, 0x87 ; 135 15ad4: 0e 94 68 77 call 0xeed0 ; 0xeed0 15ad8: 98 cd rjmp .-1232 ; 0x1560a } } else { SERIAL_PROTOCOLLNPGM("n/a"); 15ada: 89 e7 ldi r24, 0x79 ; 121 15adc: 97 e8 ldi r25, 0x87 ; 135 15ade: 0e 94 93 79 call 0xf326 ; 0xf326 15ae2: 93 cd rjmp .-1242 ; 0x1560a 15ae4: 10 92 b7 0d sts 0x0DB7, r1 ; 0x800db7 <_ZL13printer_state.lto_priv.401> 15ae8: 90 cd rjmp .-1248 ; 0x1560a break; default: break; } } else { printf_P(_N("PrinterState: %d\n"),uint8_t(GetPrinterState())); 15aea: 80 91 b7 0d lds r24, 0x0DB7 ; 0x800db7 <_ZL13printer_state.lto_priv.401> 15aee: 1f 92 push r1 15af0: 8f 93 push r24 15af2: 8c e5 ldi r24, 0x5C ; 92 15af4: 99 e6 ldi r25, 0x69 ; 105 15af6: 9f 93 push r25 15af8: 8f 93 push r24 15afa: 0f 94 99 da call 0x3b532 ; 0x3b532 15afe: 0f 90 pop r0 15b00: 0f 90 pop r0 15b02: 0f 90 pop r0 15b04: 0f 90 pop r0 15b06: 81 cd rjmp .-1278 ; 0x1560a - `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(); 15b08: 80 e5 ldi r24, 0x50 ; 80 15b0a: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 15b0e: 88 23 and r24, r24 15b10: 21 f0 breq .+8 ; 0x15b1a 15b12: 0e 94 80 5b call 0xb700 ; 0xb700 15b16: 80 93 ae 02 sts 0x02AE, r24 ; 0x8002ae if(code_seen('R')) print_time_remaining_normal = code_value(); 15b1a: 82 e5 ldi r24, 0x52 ; 82 15b1c: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 15b20: 88 23 and r24, r24 15b22: 41 f0 breq .+16 ; 0x15b34 15b24: 0e 94 b5 60 call 0xc16a ; 0xc16a 15b28: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 15b2c: 70 93 b2 02 sts 0x02B2, r23 ; 0x8002b2 15b30: 60 93 b1 02 sts 0x02B1, r22 ; 0x8002b1 if(code_seen('Q')) print_percent_done_silent = code_value_uint8(); 15b34: 81 e5 ldi r24, 0x51 ; 81 15b36: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 15b3a: 88 23 and r24, r24 15b3c: 21 f0 breq .+8 ; 0x15b46 15b3e: 0e 94 80 5b call 0xb700 ; 0xb700 15b42: 80 93 ad 02 sts 0x02AD, r24 ; 0x8002ad if(code_seen('S')) print_time_remaining_silent = code_value(); 15b46: 83 e5 ldi r24, 0x53 ; 83 15b48: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 15b4c: 88 23 and r24, r24 15b4e: 41 f0 breq .+16 ; 0x15b60 15b50: 0e 94 b5 60 call 0xc16a ; 0xc16a 15b54: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 15b58: 70 93 b6 02 sts 0x02B6, r23 ; 0x8002b6 15b5c: 60 93 b5 02 sts 0x02B5, r22 ; 0x8002b5 if(code_seen('C')){ 15b60: 83 e4 ldi r24, 0x43 ; 67 15b62: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 15b66: 88 23 and r24, r24 15b68: a9 f0 breq .+42 ; 0x15b94 float print_time_to_change_normal_f = code_value(); 15b6a: 0e 94 b5 60 call 0xc16a ; 0xc16a 15b6e: 6b 01 movw r12, r22 15b70: 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; 15b72: 20 e0 ldi r18, 0x00 ; 0 15b74: 30 e0 ldi r19, 0x00 ; 0 15b76: a9 01 movw r20, r18 15b78: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 15b7c: 6f ef ldi r22, 0xFF ; 255 15b7e: 7f ef ldi r23, 0xFF ; 255 15b80: 18 16 cp r1, r24 15b82: 24 f4 brge .+8 ; 0x15b8c 15b84: c7 01 movw r24, r14 15b86: b6 01 movw r22, r12 15b88: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 15b8c: 70 93 b0 02 sts 0x02B0, r23 ; 0x8002b0 15b90: 60 93 af 02 sts 0x02AF, r22 ; 0x8002af } if(code_seen('D')){ 15b94: 84 e4 ldi r24, 0x44 ; 68 15b96: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 15b9a: 88 23 and r24, r24 15b9c: a9 f0 breq .+42 ; 0x15bc8 float print_time_to_change_silent_f = code_value(); 15b9e: 0e 94 b5 60 call 0xc16a ; 0xc16a 15ba2: 6b 01 movw r12, r22 15ba4: 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; 15ba6: 20 e0 ldi r18, 0x00 ; 0 15ba8: 30 e0 ldi r19, 0x00 ; 0 15baa: a9 01 movw r20, r18 15bac: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 15bb0: 6f ef ldi r22, 0xFF ; 255 15bb2: 7f ef ldi r23, 0xFF ; 255 15bb4: 18 16 cp r1, r24 15bb6: 24 f4 brge .+8 ; 0x15bc0 15bb8: c7 01 movw r24, r14 15bba: b6 01 movw r22, r12 15bbc: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 15bc0: 70 93 b4 02 sts 0x02B4, r23 ; 0x8002b4 15bc4: 60 93 b3 02 sts 0x02B3, r22 ; 0x8002b3 } { 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); 15bc8: 80 91 b0 02 lds r24, 0x02B0 ; 0x8002b0 15bcc: 8f 93 push r24 15bce: 80 91 af 02 lds r24, 0x02AF ; 0x8002af 15bd2: 8f 93 push r24 15bd4: 80 91 b2 02 lds r24, 0x02B2 ; 0x8002b2 15bd8: 8f 93 push r24 15bda: 80 91 b1 02 lds r24, 0x02B1 ; 0x8002b1 15bde: 8f 93 push r24 15be0: 80 91 ae 02 lds r24, 0x02AE ; 0x8002ae 15be4: 28 2f mov r18, r24 15be6: 08 2e mov r0, r24 15be8: 00 0c add r0, r0 15bea: 33 0b sbc r19, r19 15bec: 3f 93 push r19 15bee: 8f 93 push r24 15bf0: 82 e0 ldi r24, 0x02 ; 2 15bf2: 99 e6 ldi r25, 0x69 ; 105 15bf4: 9f 93 push r25 15bf6: 8f 93 push r24 15bf8: 09 e0 ldi r16, 0x09 ; 9 15bfa: 19 e6 ldi r17, 0x69 ; 105 15bfc: 1f 93 push r17 15bfe: 0f 93 push r16 15c00: 0f 94 99 da call 0x3b532 ; 0x3b532 printf_P(_msg_mode_done_remain, _N("SILENT"), int8_t(print_percent_done_silent), print_time_remaining_silent, print_time_to_change_silent); 15c04: 80 91 b4 02 lds r24, 0x02B4 ; 0x8002b4 15c08: 8f 93 push r24 15c0a: 80 91 b3 02 lds r24, 0x02B3 ; 0x8002b3 15c0e: 8f 93 push r24 15c10: 80 91 b6 02 lds r24, 0x02B6 ; 0x8002b6 15c14: 8f 93 push r24 15c16: 80 91 b5 02 lds r24, 0x02B5 ; 0x8002b5 15c1a: 8f 93 push r24 15c1c: 80 91 ad 02 lds r24, 0x02AD ; 0x8002ad 15c20: 28 2f mov r18, r24 15c22: 08 2e mov r0, r24 15c24: 00 0c add r0, r0 15c26: 33 0b sbc r19, r19 15c28: 3f 93 push r19 15c2a: 8f 93 push r24 15c2c: 8b ef ldi r24, 0xFB ; 251 15c2e: 98 e6 ldi r25, 0x68 ; 104 15c30: 9f 93 push r25 15c32: 8f 93 push r24 15c34: 1f 93 push r17 15c36: 0f 93 push r16 15c38: 0f 94 99 da call 0x3b532 ; 0x3b532 15c3c: 0f b6 in r0, 0x3f ; 63 15c3e: f8 94 cli 15c40: de bf out 0x3e, r29 ; 62 15c42: 0f be out 0x3f, r0 ; 63 15c44: cd bf out 0x3d, r28 ; 61 15c46: e1 cc rjmp .-1598 ; 0x1560a } else return false; } bool Stopwatch::pause() { if (isRunning()) { 15c48: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 15c4c: 81 30 cpi r24, 0x01 ; 1 15c4e: 09 f0 breq .+2 ; 0x15c52 15c50: dc cc rjmp .-1608 ; 0x1560a state = PAUSED; 15c52: 82 e0 ldi r24, 0x02 ; 2 15c54: 80 93 9b 03 sts 0x039B, r24 ; 0x80039b stopTimestamp = _millis(); 15c58: 0f 94 22 29 call 0x25244 ; 0x25244 15c5c: 60 93 51 06 sts 0x0651, r22 ; 0x800651 15c60: 70 93 52 06 sts 0x0652, r23 ; 0x800652 15c64: 80 93 53 06 sts 0x0653, r24 ; 0x800653 15c68: 90 93 54 06 sts 0x0654, r25 ; 0x800654 15c6c: ce cc rjmp .-1636 ; 0x1560a /*! ### M77 - Stop the print job timer M77: Stop the print job timer */ case 77: { print_job_timer.stop(); 15c6e: 0f 94 6c 42 call 0x284d8 ; 0x284d8 save_statistics(); 15c72: 0e 94 37 66 call 0xcc6e ; 0xcc6e 15c76: c9 cc rjmp .-1646 ; 0x1560a ### 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 "); 15c78: 82 e7 ldi r24, 0x72 ; 114 15c7a: 97 e8 ldi r25, 0x87 ; 135 15c7c: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHO(eeprom_read_dword((uint32_t *)EEPROM_TOTALTIME)); 15c80: 8d ee ldi r24, 0xED ; 237 15c82: 9f e0 ldi r25, 0x0F ; 15 15c84: 0f 94 df db call 0x3b7be ; 0x3b7be } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 15c88: 4a e0 ldi r20, 0x0A ; 10 15c8a: 0f 94 c1 d4 call 0x3a982 ; 0x3a982 SERIAL_ECHOPGM(" min "); 15c8e: 8c e6 ldi r24, 0x6C ; 108 15c90: 97 e8 ldi r25, 0x87 ; 135 15c92: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHO(eeprom_read_dword((uint32_t *)EEPROM_FILAMENTUSED)); 15c96: 81 ef ldi r24, 0xF1 ; 241 15c98: 9f e0 ldi r25, 0x0F ; 15 15c9a: 0f 94 df db call 0x3b7be ; 0x3b7be 15c9e: 4a e0 ldi r20, 0x0A ; 10 15ca0: 0f 94 c1 d4 call 0x3a982 ; 0x3a982 SERIAL_ECHOLNPGM(" cm."); 15ca4: 87 e6 ldi r24, 0x67 ; 103 15ca6: 97 e8 ldi r25, 0x87 ; 135 15ca8: 0e 94 93 79 call 0xf326 ; 0xf326 15cac: ae cc rjmp .-1700 ; 0x1560a void ResetHostStatusScreenName() { memset(host_status_screen_name, 0, sizeof(host_status_screen_name)); } void M79_timer_restart() { M79_timer.start(); 15cae: 8c e9 ldi r24, 0x9C ; 156 15cb0: 93 e0 ldi r25, 0x03 ; 3 15cb2: 0f 94 c5 2b call 0x2578a ; 0x2578a ::start()> - `S` - Quoted string containing two characters e.g. "PL" */ case 79: M79_timer_restart(); if (code_seen('S')) 15cb6: 83 e5 ldi r24, 0x53 ; 83 15cb8: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 15cbc: 88 23 and r24, r24 15cbe: 09 f1 breq .+66 ; 0x15d02 , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 15cc0: 62 e2 ldi r22, 0x22 ; 34 15cc2: 70 e0 ldi r23, 0x00 ; 0 15cc4: 80 91 93 03 lds r24, 0x0393 ; 0x800393 15cc8: 90 91 94 03 lds r25, 0x0394 ; 0x800394 15ccc: 0f 94 2e e2 call 0x3c45c ; 0x3c45c 15cd0: 8c 01 movw r16, r24 if (!this->ptr) { 15cd2: 89 2b or r24, r25 15cd4: b1 f0 breq .+44 ; 0x15d02 // First quote not found return; } // Skip the leading quote this->ptr++; 15cd6: 0f 5f subi r16, 0xFF ; 255 15cd8: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 15cda: 62 e2 ldi r22, 0x22 ; 34 15cdc: 70 e0 ldi r23, 0x00 ; 0 15cde: c8 01 movw r24, r16 15ce0: 0f 94 2e e2 call 0x3c45c ; 0x3c45c if(!pStrEnd) { 15ce4: 89 2b or r24, r25 15ce6: 69 f0 breq .+26 ; 0x15d02 char * GetHostStatusScreenName() { return host_status_screen_name; } void ResetHostStatusScreenName() { memset(host_status_screen_name, 0, sizeof(host_status_screen_name)); 15ce8: eb e4 ldi r30, 0x4B ; 75 15cea: f6 e0 ldi r31, 0x06 ; 6 15cec: 83 e0 ldi r24, 0x03 ; 3 15cee: df 01 movw r26, r30 15cf0: 1d 92 st X+, r1 15cf2: 8a 95 dec r24 15cf4: e9 f7 brne .-6 ; 0x15cf0 static LongTimer M79_timer; static char host_status_screen_name[3]; void SetHostStatusScreenName(const char * name) { strncpy(host_status_screen_name, name, 2); 15cf6: 42 e0 ldi r20, 0x02 ; 2 15cf8: 50 e0 ldi r21, 0x00 ; 0 15cfa: b8 01 movw r22, r16 15cfc: cf 01 movw r24, r30 15cfe: 0f 94 57 e2 call 0x3c4ae ; 0x3c4ae } #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 15d02: 8c e8 ldi r24, 0x8C ; 140 15d04: 9f e0 ldi r25, 0x0F ; 15 15d06: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae && printer_recovering() && printingIsPaused()) { 15d0a: 81 30 cpi r24, 0x01 ; 1 15d0c: 09 f0 breq .+2 ; 0x15d10 15d0e: 7d cc rjmp .-1798 ; 0x1560a #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() 15d10: 0e 94 93 67 call 0xcf26 ; 0xcf26 15d14: 88 23 and r24, r24 15d16: 09 f4 brne .+2 ; 0x15d1a 15d18: 78 cc rjmp .-1808 ; 0x1560a && printingIsPaused()) { 15d1a: 0e 94 9d 67 call 0xcf3a ; 0xcf3a 15d1e: 88 23 and r24, r24 15d20: 09 f4 brne .+2 ; 0x15d24 15d22: 73 cc rjmp .-1818 ; 0x1560a // The print is in a paused state. The print was recovered following a power panic // but up to this point the printer has been waiting for the M79 from the host // 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) { 15d24: 80 91 ec 04 lds r24, 0x04EC ; 0x8004ec <_ZL24uvlo_auto_recovery_ready.lto_priv.531> 15d28: 88 23 and r24, r24 15d2a: 29 f0 breq .+10 ; 0x15d36 SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_UVLO_AUTO_RECOVERY_READY); 15d2c: 89 ed ldi r24, 0xD9 ; 217 15d2e: 98 e6 ldi r25, 0x68 ; 104 15d30: 0e 94 93 79 call 0xf326 ; 0xf326 15d34: 6a cc rjmp .-1836 ; 0x1560a } else { SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_UVLO_RECOVERY_READY); 15d36: 8c eb ldi r24, 0xBC ; 188 15d38: 98 e6 ldi r25, 0x68 ; 104 15d3a: 0e 94 93 79 call 0xf326 ; 0xf326 15d3e: 65 cc rjmp .-1846 ; 0x1560a /*! ### M112 - Emergency stop M112: Full (Emergency) Stop It is processed much earlier as to bypass the cmdqueue. */ case 112: kill(MSG_M112_KILL); 15d40: 8f e9 ldi r24, 0x9F ; 159 15d42: 98 e6 ldi r25, 0x68 ; 104 15d44: 0e 94 22 7a call 0xf444 ; 0xf444 #### Parameters - `S` - Target temperature */ case 140: if (code_seen('S')) setTargetBed(code_value()); 15d48: 83 e5 ldi r24, 0x53 ; 83 15d4a: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 15d4e: 88 23 and r24, r24 15d50: 09 f4 brne .+2 ; 0x15d54 15d52: 5b cc rjmp .-1866 ; 0x1560a 15d54: 0e 94 b5 60 call 0xc16a ; 0xc16a resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 15d58: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> 15d5c: 70 93 72 06 sts 0x0672, r23 ; 0x800672 15d60: 60 93 71 06 sts 0x0671, r22 ; 0x800671 15d64: 52 cc rjmp .-1884 ; 0x1560a 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 "); 15d66: 83 e6 ldi r24, 0x63 ; 99 15d68: 97 e8 ldi r25, 0x87 ; 135 15d6a: 0e 94 68 77 call 0xeed0 ; 0xeed0 gcode_M105(); 15d6e: 0e 94 da 78 call 0xf1b4 ; 0xf1b4 cmdqueue_pop_front(); //prevent an ok after the command since this command uses an ok at the beginning. 15d72: 0e 94 d4 76 call 0xeda8 ; 0xeda8 cmdbuffer_front_already_processed = true; 15d76: 81 e0 ldi r24, 0x01 ; 1 15d78: 80 93 a1 10 sts 0x10A1, r24 ; 0x8010a1 15d7c: 46 cc rjmp .-1908 ; 0x1560a 15d7e: 10 92 88 14 sts 0x1488, r1 ; 0x801488 15d82: f0 c8 rjmp .-3616 ; 0x14f64 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; } 15d84: 81 e0 ldi r24, 0x01 ; 1 15d86: 80 93 86 14 sts 0x1486, r24 ; 0x801486 15d8a: 3f cc rjmp .-1922 ; 0x1560a #ifdef AUTOTEMP autotemp_enabled=false; #endif if (code_seen('S')) { setTargetHotend(code_value()); } else if (code_seen('R')) { 15d8c: 82 e5 ldi r24, 0x52 ; 82 15d8e: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 15d92: 81 11 cpse r24, r1 15d94: 7a c8 rjmp .-3852 ; 0x14e8a autotemp_factor=code_value(); autotemp_enabled=true; } #endif codenum = _millis(); 15d96: 0f 94 22 29 call 0x25244 ; 0x25244 15d9a: 6b 01 movw r12, r22 15d9c: 7c 01 movw r14, r24 }; FORCE_INLINE bool isHeatingHotend(uint8_t extruder){ return target_temperature[extruder] > current_temperature[extruder]; 15d9e: 60 91 b5 0d lds r22, 0x0DB5 ; 0x800db5 15da2: 70 91 b6 0d lds r23, 0x0DB6 ; 0x800db6 15da6: 07 2e mov r0, r23 15da8: 00 0c add r0, r0 15daa: 88 0b sbc r24, r24 15dac: 99 0b sbc r25, r25 15dae: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 15db2: 11 e0 ldi r17, 0x01 ; 1 15db4: 20 91 af 0d lds r18, 0x0DAF ; 0x800daf 15db8: 30 91 b0 0d lds r19, 0x0DB0 ; 0x800db0 15dbc: 40 91 b1 0d lds r20, 0x0DB1 ; 0x800db1 15dc0: 50 91 b2 0d lds r21, 0x0DB2 ; 0x800db2 15dc4: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 15dc8: 18 16 cp r1, r24 15dca: 0c f0 brlt .+2 ; 0x15dce 15dcc: 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 15dce: 10 93 ae 0d sts 0x0DAE, r17 ; 0x800dae <_ZL16target_direction.lto_priv.532> wait_for_heater(codenum, active_extruder); //loops until target temperature is reached 15dd2: c7 01 movw r24, r14 15dd4: b6 01 movw r22, r12 15dd6: 0f 94 9c 81 call 0x30338 ; 0x30338 LCD_MESSAGERPGM(_T(MSG_HEATING_COMPLETE)); 15dda: 87 e5 ldi r24, 0x57 ; 87 15ddc: 9e e4 ldi r25, 0x4E ; 78 15dde: 0e 94 c4 72 call 0xe588 ; 0xe588 15de2: 0e 94 38 f1 call 0x1e270 ; 0x1e270 heating_status = HeatingStatus::EXTRUDER_HEATING_COMPLETE; 15de6: 82 e0 ldi r24, 0x02 ; 2 15de8: 80 93 e1 03 sts 0x03E1, r24 ; 0x8003e1 prusa_statistics(2); previous_millis_cmd.start(); 15dec: 84 e8 ldi r24, 0x84 ; 132 15dee: 93 e0 ldi r25, 0x03 ; 3 15df0: 0f 94 c5 2b call 0x2578a ; 0x2578a ::start()> 15df4: 0a cc rjmp .-2028 ; 0x1560a */ case 190: #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1 { bool CooldownNoWait = false; LCD_MESSAGERPGM(_T(MSG_BED_HEATING)); 15df6: 89 e4 ldi r24, 0x49 ; 73 15df8: 9e e4 ldi r25, 0x4E ; 78 15dfa: 0e 94 c4 72 call 0xe588 ; 0xe588 15dfe: 0e 94 38 f1 call 0x1e270 ; 0x1e270 heating_status = HeatingStatus::BED_HEATING; 15e02: 83 e0 ldi r24, 0x03 ; 3 15e04: 80 93 e1 03 sts 0x03E1, r24 ; 0x8003e1 prusa_statistics(1); if (code_seen('S')) 15e08: 83 e5 ldi r24, 0x53 ; 83 15e0a: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 15e0e: 18 2f mov r17, r24 15e10: 88 23 and r24, r24 15e12: 49 f0 breq .+18 ; 0x15e26 setTargetBed(code_value()); CooldownNoWait = true; } else if (code_seen('R')) { setTargetBed(code_value()); 15e14: 0e 94 b5 60 call 0xc16a ; 0xc16a target_temperature[0] = celsius; resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 15e18: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> 15e1c: 70 93 72 06 sts 0x0672, r23 ; 0x800672 15e20: 60 93 71 06 sts 0x0671, r22 ; 0x800671 15e24: 05 c0 rjmp .+10 ; 0x15e30 if (code_seen('S')) { setTargetBed(code_value()); CooldownNoWait = true; } else if (code_seen('R')) 15e26: 82 e5 ldi r24, 0x52 ; 82 15e28: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 15e2c: 81 11 cpse r24, r1 15e2e: f2 cf rjmp .-28 ; 0x15e14 { setTargetBed(code_value()); } codenum = _millis(); 15e30: 0f 94 22 29 call 0x25244 ; 0x25244 15e34: 6b 01 movw r12, r22 15e36: 7c 01 movw r14, r24 cancel_heatup = false; 15e38: 10 92 b4 0d sts 0x0DB4, r1 ; 0x800db4 <_ZL13cancel_heatup.lto_priv.408> 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; 15e3c: 60 91 71 06 lds r22, 0x0671 ; 0x800671 15e40: 70 91 72 06 lds r23, 0x0672 ; 0x800672 15e44: 07 2e mov r0, r23 15e46: 00 0c add r0, r0 15e48: 88 0b sbc r24, r24 15e4a: 99 0b sbc r25, r25 15e4c: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 15e50: 01 e0 ldi r16, 0x01 ; 1 15e52: 20 91 ed 04 lds r18, 0x04ED ; 0x8004ed 15e56: 30 91 ee 04 lds r19, 0x04EE ; 0x8004ee 15e5a: 40 91 ef 04 lds r20, 0x04EF ; 0x8004ef 15e5e: 50 91 f0 04 lds r21, 0x04F0 ; 0x8004f0 15e62: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 15e66: 18 16 cp r1, r24 15e68: 0c f0 brlt .+2 ; 0x15e6c 15e6a: 00 e0 ldi r16, 0x00 ; 0 target_direction = isHeatingBed(); // true if heating, false if cooling 15e6c: 00 93 ae 0d sts 0x0DAE, r16 ; 0x800dae <_ZL16target_direction.lto_priv.532> while ( (!cancel_heatup) && (target_direction ? (isHeatingBed()) : (isCoolingBed()&&(CooldownNoWait==false))) ) 15e70: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 <_ZL13cancel_heatup.lto_priv.408> 15e74: 81 11 cpse r24, r1 15e76: 1a c0 rjmp .+52 ; 0x15eac 15e78: 60 91 71 06 lds r22, 0x0671 ; 0x800671 15e7c: 70 91 72 06 lds r23, 0x0672 ; 0x800672 15e80: 07 2e mov r0, r23 15e82: 00 0c add r0, r0 15e84: 88 0b sbc r24, r24 15e86: 99 0b sbc r25, r25 15e88: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 15e8c: 20 91 ed 04 lds r18, 0x04ED ; 0x8004ed 15e90: 30 91 ee 04 lds r19, 0x04EE ; 0x8004ee 15e94: 40 91 ef 04 lds r20, 0x04EF ; 0x8004ef 15e98: 50 91 f0 04 lds r21, 0x04F0 ; 0x8004f0 15e9c: e0 91 ae 0d lds r30, 0x0DAE ; 0x800dae <_ZL16target_direction.lto_priv.532> 15ea0: ee 23 and r30, r30 15ea2: 91 f0 breq .+36 ; 0x15ec8 15ea4: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 15ea8: 18 16 cp r1, r24 15eaa: a4 f0 brlt .+40 ; 0x15ed4 } manage_heater(); manage_inactivity(); lcd_update(0); } LCD_MESSAGERPGM(_T(MSG_BED_DONE)); 15eac: 8e e3 ldi r24, 0x3E ; 62 15eae: 9e e4 ldi r25, 0x4E ; 78 15eb0: 0e 94 c4 72 call 0xe588 ; 0xe588 15eb4: 0e 94 38 f1 call 0x1e270 ; 0x1e270 heating_status = HeatingStatus::BED_HEATING_COMPLETE; 15eb8: 84 e0 ldi r24, 0x04 ; 4 15eba: 80 93 e1 03 sts 0x03E1, r24 ; 0x8003e1 previous_millis_cmd.start(); 15ebe: 84 e8 ldi r24, 0x84 ; 132 15ec0: 93 e0 ldi r25, 0x03 ; 3 15ec2: 0f 94 c5 2b call 0x2578a ; 0x2578a ::start()> 15ec6: a1 cb rjmp .-2238 ; 0x1560a codenum = _millis(); cancel_heatup = false; target_direction = isHeatingBed(); // true if heating, false if cooling while ( (!cancel_heatup) && (target_direction ? (isHeatingBed()) : (isCoolingBed()&&(CooldownNoWait==false))) ) 15ec8: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 15ecc: 87 ff sbrs r24, 7 15ece: ee cf rjmp .-36 ; 0x15eac 15ed0: 11 11 cpse r17, r1 15ed2: ec cf rjmp .-40 ; 0x15eac { if (lcd_commands_type == LcdCommands::LongPause) { 15ed4: 80 91 b3 0d lds r24, 0x0DB3 ; 0x800db3 15ed8: 82 30 cpi r24, 0x02 ; 2 15eda: 41 f3 breq .-48 ; 0x15eac // 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. 15edc: 0f 94 22 29 call 0x25244 ; 0x25244 15ee0: 6c 19 sub r22, r12 15ee2: 7d 09 sbc r23, r13 15ee4: 8e 09 sbc r24, r14 15ee6: 9f 09 sbc r25, r15 15ee8: 69 3e cpi r22, 0xE9 ; 233 15eea: 73 40 sbci r23, 0x03 ; 3 15eec: 81 05 cpc r24, r1 15eee: 91 05 cpc r25, r1 15ef0: 30 f0 brcs .+12 ; 0x15efe { if (!farm_mode) { serialecho_temperatures(); 15ef2: 0e 94 76 77 call 0xeeec ; 0xeeec } codenum = _millis(); 15ef6: 0f 94 22 29 call 0x25244 ; 0x25244 15efa: 6b 01 movw r12, r22 15efc: 7c 01 movw r14, r24 } manage_heater(); 15efe: 0f 94 2e 38 call 0x2705c ; 0x2705c manage_inactivity(); 15f02: 80 e0 ldi r24, 0x00 ; 0 15f04: 0e 94 c7 8a call 0x1158e ; 0x1158e lcd_update(0); 15f08: 80 e0 ldi r24, 0x00 ; 0 15f0a: 0e 94 bf 6e call 0xdd7e ; 0xdd7e 15f0e: b0 cf rjmp .-160 ; 0x15e70 #### 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')){ 15f10: 83 e5 ldi r24, 0x53 ; 83 15f12: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 15f16: 88 23 and r24, r24 15f18: 29 f0 breq .+10 ; 0x15f24 fanSpeed = code_value_uint8(); 15f1a: 0e 94 80 5b call 0xb700 ; 0xb700 15f1e: 80 93 e5 03 sts 0x03E5, r24 ; 0x8003e5 15f22: 73 cb rjmp .-2330 ; 0x1560a } else { fanSpeed = 255; 15f24: 8f ef ldi r24, 0xFF ; 255 15f26: 80 93 e5 03 sts 0x03E5, r24 ; 0x8003e5 15f2a: 6f cb rjmp .-2338 ; 0x1560a /*! ### M107 - Fan off M107: Fan Off */ case 107: fanSpeed = 0; 15f2c: 10 92 e5 03 sts 0x03E5, r1 ; 0x8003e5 15f30: 6c cb rjmp .-2344 ; 0x1560a /*! ### 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; 15f32: 80 91 e3 03 lds r24, 0x03E3 ; 0x8003e3 15f36: 88 60 ori r24, 0x08 ; 8 15f38: 80 93 e3 03 sts 0x03E3, r24 ; 0x8003e3 15f3c: 66 cb rjmp .-2356 ; 0x1560a ### M18 - Disable steppers M18: Disable all stepper motors Equal to M84 (compatibility) */ case 18: //compatibility case 84: // M84 if(code_seen('S')){ 15f3e: 83 e5 ldi r24, 0x53 ; 83 15f40: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 15f44: 88 23 and r24, r24 15f46: 99 f0 breq .+38 ; 0x15f6e stepper_inactive_time = code_value() * 1000; 15f48: 0e 94 b5 60 call 0xc16a ; 0xc16a 15f4c: 20 e0 ldi r18, 0x00 ; 0 15f4e: 30 e0 ldi r19, 0x00 ; 0 15f50: 4a e7 ldi r20, 0x7A ; 122 15f52: 54 e4 ldi r21, 0x44 ; 68 15f54: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 15f58: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 15f5c: 60 93 34 02 sts 0x0234, r22 ; 0x800234 15f60: 70 93 35 02 sts 0x0235, r23 ; 0x800235 15f64: 80 93 36 02 sts 0x0236, r24 ; 0x800236 15f68: 90 93 37 02 sts 0x0237, r25 ; 0x800237 15f6c: 4e cb rjmp .-2404 ; 0x1560a } 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]))); 15f6e: 88 e5 ldi r24, 0x58 ; 88 15f70: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 15f74: 88 23 and r24, r24 15f76: d1 f0 breq .+52 ; 0x15fac disable_e0(); finishAndDisableSteppers(); } else { st_synchronize(); 15f78: 0f 94 a3 42 call 0x28546 ; 0x28546 if (code_seen('X')) disable_x(); 15f7c: 88 e5 ldi r24, 0x58 ; 88 15f7e: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 15f82: 81 11 cpse r24, r1 15f84: 28 c0 rjmp .+80 ; 0x15fd6 if (code_seen('Y')) disable_y(); 15f86: 89 e5 ldi r24, 0x59 ; 89 15f88: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 15f8c: 88 23 and r24, r24 15f8e: 19 f0 breq .+6 ; 0x15f96 15f90: 16 9a sbi 0x02, 6 ; 2 15f92: 10 92 8f 06 sts 0x068F, r1 ; 0x80068f if (code_seen('Z')) disable_z(); 15f96: 8a e5 ldi r24, 0x5A ; 90 15f98: 0e 94 ee 5b call 0xb7dc ; 0xb7dc #if (E0_ENABLE_PIN != X_ENABLE_PIN) // Only enable on boards that have seperate ENABLE_PINS if (code_seen('E')) disable_e0(); 15f9c: 85 e4 ldi r24, 0x45 ; 69 15f9e: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 15fa2: 88 23 and r24, r24 15fa4: 09 f4 brne .+2 ; 0x15fa8 15fa6: 31 cb rjmp .-2462 ; 0x1560a 15fa8: 14 9a sbi 0x02, 4 ; 2 15faa: 2f cb rjmp .-2466 ; 0x1560a 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]))); 15fac: 89 e5 ldi r24, 0x59 ; 89 15fae: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 15fb2: 81 11 cpse r24, r1 15fb4: e1 cf rjmp .-62 ; 0x15f78 15fb6: 8a e5 ldi r24, 0x5A ; 90 15fb8: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 15fbc: 81 11 cpse r24, r1 15fbe: dc cf rjmp .-72 ; 0x15f78 15fc0: 85 e4 ldi r24, 0x45 ; 69 15fc2: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 15fc6: 81 11 cpse r24, r1 15fc8: d7 cf rjmp .-82 ; 0x15f78 if(all_axis) { st_synchronize(); 15fca: 0f 94 a3 42 call 0x28546 ; 0x28546 disable_e0(); 15fce: 14 9a sbi 0x02, 4 ; 2 finishAndDisableSteppers(); 15fd0: 0e 94 80 82 call 0x10500 ; 0x10500 15fd4: 1a cb rjmp .-2508 ; 0x1560a } else { st_synchronize(); if (code_seen('X')) disable_x(); 15fd6: 17 9a sbi 0x02, 7 ; 2 15fd8: 10 92 8e 06 sts 0x068E, r1 ; 0x80068e 15fdc: d4 cf rjmp .-88 ; 0x15f86 #### Parameters - `S` - specifies the time in seconds. If a value of 0 is specified, the timer is disabled. */ case 86: if (code_seen('S')) { 15fde: 83 e5 ldi r24, 0x53 ; 83 15fe0: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 15fe4: 88 23 and r24, r24 15fe6: 09 f4 brne .+2 ; 0x15fea 15fe8: 10 cb rjmp .-2528 ; 0x1560a safetytimer_inactive_time = code_value() * 1000; 15fea: 0e 94 b5 60 call 0xc16a ; 0xc16a 15fee: 20 e0 ldi r18, 0x00 ; 0 15ff0: 30 e0 ldi r19, 0x00 ; 0 15ff2: 4a e7 ldi r20, 0x7A ; 122 15ff4: 54 e4 ldi r21, 0x44 ; 68 15ff6: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 15ffa: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 15ffe: 60 93 30 02 sts 0x0230, r22 ; 0x800230 16002: 70 93 31 02 sts 0x0231, r23 ; 0x800231 16006: 80 93 32 02 sts 0x0232, r24 ; 0x800232 1600a: 90 93 33 02 sts 0x0233, r25 ; 0x800233 safetyTimer.start(); 1600e: 89 ed ldi r24, 0xD9 ; 217 16010: 95 e0 ldi r25, 0x05 ; 5 16012: 0f 94 c5 2b call 0x2578a ; 0x2578a ::start()> 16016: f9 ca rjmp .-2574 ; 0x1560a 16018: ad ed ldi r26, 0xDD ; 221 1601a: ca 2e mov r12, r26 1601c: a2 e0 ldi r26, 0x02 ; 2 1601e: da 2e mov r13, r26 16020: bd eb ldi r27, 0xBD ; 189 16022: eb 2e mov r14, r27 16024: bd e0 ldi r27, 0x0D ; 13 16026: fb 2e mov r15, r27 - `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++) 16028: 10 e0 ldi r17, 0x00 ; 0 { if(code_seen(axis_codes[i])) 1602a: f6 01 movw r30, r12 1602c: 81 91 ld r24, Z+ 1602e: 6f 01 movw r12, r30 16030: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 16034: 88 23 and r24, r24 16036: 09 f4 brne .+2 ; 0x1603a 16038: 67 c0 rjmp .+206 ; 0x16108 { float value = code_value(); 1603a: 0e 94 b5 60 call 0xc16a ; 0xc16a 1603e: 2b 01 movw r4, r22 16040: 3c 01 movw r6, r24 if(i == E_AXIS) { // E 16042: 13 30 cpi r17, 0x03 ; 3 16044: 09 f0 breq .+2 ; 0x16048 16046: 6a c0 rjmp .+212 ; 0x1611c if(value < 20.0) { 16048: 20 e0 ldi r18, 0x00 ; 0 1604a: 30 e0 ldi r19, 0x00 ; 0 1604c: 40 ea ldi r20, 0xA0 ; 160 1604e: 51 e4 ldi r21, 0x41 ; 65 16050: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 16054: 87 ff sbrs r24, 7 16056: 4e c0 rjmp .+156 ; 0x160f4 const float factor = cs.axis_steps_per_mm[E_AXIS] / value; // increase e constants if M92 E14 is given for netfab. 16058: a3 01 movw r20, r6 1605a: 92 01 movw r18, r4 1605c: 60 91 cd 0d lds r22, 0x0DCD ; 0x800dcd 16060: 70 91 ce 0d lds r23, 0x0DCE ; 0x800dce 16064: 80 91 cf 0d lds r24, 0x0DCF ; 0x800dcf 16068: 90 91 d0 0d lds r25, 0x0DD0 ; 0x800dd0 1606c: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 16070: 4b 01 movw r8, r22 16072: 5c 01 movw r10, r24 cs.max_jerk[E_AXIS] *= factor; 16074: ac 01 movw r20, r24 16076: 9b 01 movw r18, r22 16078: 60 91 11 0e lds r22, 0x0E11 ; 0x800e11 1607c: 70 91 12 0e lds r23, 0x0E12 ; 0x800e12 16080: 80 91 13 0e lds r24, 0x0E13 ; 0x800e13 16084: 90 91 14 0e lds r25, 0x0E14 ; 0x800e14 16088: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 1608c: 60 93 11 0e sts 0x0E11, r22 ; 0x800e11 16090: 70 93 12 0e sts 0x0E12, r23 ; 0x800e12 16094: 80 93 13 0e sts 0x0E13, r24 ; 0x800e13 16098: 90 93 14 0e sts 0x0E14, r25 ; 0x800e14 max_feedrate[E_AXIS] *= factor; 1609c: 20 90 71 02 lds r2, 0x0271 ; 0x800271 160a0: 30 90 72 02 lds r3, 0x0272 ; 0x800272 160a4: a5 01 movw r20, r10 160a6: 94 01 movw r18, r8 160a8: d1 01 movw r26, r2 160aa: 1c 96 adiw r26, 0x0c ; 12 160ac: 6d 91 ld r22, X+ 160ae: 7d 91 ld r23, X+ 160b0: 8d 91 ld r24, X+ 160b2: 9c 91 ld r25, X 160b4: 1f 97 sbiw r26, 0x0f ; 15 160b6: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 160ba: f1 01 movw r30, r2 160bc: 64 87 std Z+12, r22 ; 0x0c 160be: 75 87 std Z+13, r23 ; 0x0d 160c0: 86 87 std Z+14, r24 ; 0x0e 160c2: 97 87 std Z+15, r25 ; 0x0f max_acceleration_steps_per_s2[E_AXIS] *= factor; 160c4: 60 91 59 05 lds r22, 0x0559 ; 0x800559 160c8: 70 91 5a 05 lds r23, 0x055A ; 0x80055a 160cc: 80 91 5b 05 lds r24, 0x055B ; 0x80055b 160d0: 90 91 5c 05 lds r25, 0x055C ; 0x80055c 160d4: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 160d8: a5 01 movw r20, r10 160da: 94 01 movw r18, r8 160dc: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 160e0: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 160e4: 60 93 59 05 sts 0x0559, r22 ; 0x800559 160e8: 70 93 5a 05 sts 0x055A, r23 ; 0x80055a 160ec: 80 93 5b 05 sts 0x055B, r24 ; 0x80055b 160f0: 90 93 5c 05 sts 0x055C, r25 ; 0x80055c } cs.axis_steps_per_mm[E_AXIS] = value; 160f4: 40 92 cd 0d sts 0x0DCD, r4 ; 0x800dcd 160f8: 50 92 ce 0d sts 0x0DCE, r5 ; 0x800dce 160fc: 60 92 cf 0d sts 0x0DCF, r6 ; 0x800dcf 16100: 70 92 d0 0d sts 0x0DD0, r7 ; 0x800dd0 #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) fsensor.init(); 16104: 0f 94 f4 7a call 0x2f5e8 ; 0x2f5e8 16108: b4 e0 ldi r27, 0x04 ; 4 1610a: eb 0e add r14, r27 1610c: f1 1c adc r15, r1 1610e: 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++) 16110: 14 30 cpi r17, 0x04 ; 4 16112: 09 f0 breq .+2 ; 0x16116 16114: 8a cf rjmp .-236 ; 0x1602a } else { cs.axis_steps_per_mm[i] = value; } } } reset_acceleration_rates(); 16116: 0f 94 1a 63 call 0x2c634 ; 0x2c634 1611a: 77 ca rjmp .-2834 ; 0x1560a 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; 1611c: d7 01 movw r26, r14 1611e: 14 96 adiw r26, 0x04 ; 4 16120: 4d 92 st X+, r4 16122: 5d 92 st X+, r5 16124: 6d 92 st X+, r6 16126: 7c 92 st X, r7 16128: 17 97 sbiw r26, 0x07 ; 7 1612a: ee cf rjmp .-36 ; 0x16108 #### Parameters - `N` - Line number */ case 110: if (code_seen('N')) 1612c: 8e e4 ldi r24, 0x4E ; 78 1612e: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 16132: 88 23 and r24, r24 16134: 09 f4 brne .+2 ; 0x16138 16136: 69 ca rjmp .-2862 ; 0x1560a gcode_LastN = code_value_long(); 16138: 0e 94 9a 5b call 0xb734 ; 0xb734 1613c: 60 93 78 03 sts 0x0378, r22 ; 0x800378 16140: 70 93 79 03 sts 0x0379, r23 ; 0x800379 16144: 80 93 7a 03 sts 0x037A, r24 ; 0x80037a 16148: 90 93 7b 03 sts 0x037B, r25 ; 0x80037b 1614c: 5e ca rjmp .-2884 ; 0x1560a case 113: if (code_seen('S')) { host_keepalive_interval = code_value_uint8(); } else { SERIAL_ECHO_START; 1614e: 82 ef ldi r24, 0xF2 ; 242 16150: 9b ea ldi r25, 0xAB ; 171 16152: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHOPAIR("M113 S", (unsigned long)host_keepalive_interval); 16156: c0 90 2f 02 lds r12, 0x022F ; 0x80022f 1615a: d1 2c mov r13, r1 1615c: f1 2c mov r15, r1 1615e: 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); } 16160: 8c e5 ldi r24, 0x5C ; 92 16162: 97 e8 ldi r25, 0x87 ; 135 16164: 0e 94 68 77 call 0xeed0 ; 0xeed0 16168: 4a e0 ldi r20, 0x0A ; 10 1616a: c7 01 movw r24, r14 1616c: b6 01 movw r22, r12 1616e: 0f 94 c1 d4 call 0x3a982 ; 0x3a982 host_keepalive_interval = code_value_uint8(); } else { SERIAL_ECHO_START; SERIAL_ECHOPAIR("M113 S", (unsigned long)host_keepalive_interval); SERIAL_PROTOCOLLN(); 16172: 0f 94 b8 d5 call 0x3ab70 ; 0x3ab70 16176: 49 ca rjmp .-2926 ; 0x1560a */ case 115: // M115 if (code_seen('V')) { // Report the Prusa version number. SERIAL_PROTOCOLLNRPGM(FW_VERSION_STR_P()); } else if (code_seen('U')) { 16178: 85 e5 ldi r24, 0x55 ; 85 1617a: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 1617e: 88 23 and r24, r24 16180: 09 f4 brne .+2 ; 0x16184 16182: 5a c0 rjmp .+180 ; 0x16238 // 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); 16184: 00 91 93 03 lds r16, 0x0393 ; 0x800393 16188: 10 91 94 03 lds r17, 0x0394 ; 0x800394 1618c: 0f 5f subi r16, 0xFF ; 255 1618e: 1f 4f sbci r17, 0xFF ; 255 16190: 10 93 94 03 sts 0x0394, r17 ; 0x800394 16194: 00 93 93 03 sts 0x0393, r16 ; 0x800393 return false; } bool show_upgrade_dialog_if_version_newer(const char *version_string) { if(oCheckVersion == ClCheckMode::_None) 16198: 80 91 e8 04 lds r24, 0x04E8 ; 0x8004e8 1619c: 88 23 and r24, r24 1619e: 09 f4 brne .+2 ; 0x161a2 161a0: 34 ca rjmp .-2968 ; 0x1560a // 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)) 161a2: be 01 movw r22, r28 161a4: 6f 5f subi r22, 0xFF ; 255 161a6: 7f 4f sbci r23, 0xFF ; 255 161a8: c8 01 movw r24, r16 161aa: 0e 94 4c ef call 0x1de98 ; 0x1de98 161ae: 88 23 and r24, r24 161b0: 09 f4 brne .+2 ; 0x161b4 161b2: 2b ca rjmp .-2986 ; 0x1560a 161b4: 8f e4 ldi r24, 0x4F ; 79 161b6: 9e e8 ldi r25, 0x8E ; 142 161b8: de 01 movw r26, r28 161ba: 11 96 adiw r26, 0x01 ; 1 161bc: be 01 movw r22, r28 161be: 67 5f subi r22, 0xF7 ; 247 161c0: 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]); 161c2: fc 01 movw r30, r24 161c4: 45 91 lpm r20, Z+ 161c6: 54 91 lpm r21, Z if (ver_gcode[i] > v) 161c8: 2d 91 ld r18, X+ 161ca: 3d 91 ld r19, X+ 161cc: 42 17 cp r20, r18 161ce: 53 07 cpc r21, r19 161d0: 10 f4 brcc .+4 ; 0x161d6 161d2: 0c 94 75 cc jmp 0x198ea ; 0x198ea return 1; else if (ver_gcode[i] < v) 161d6: 24 17 cp r18, r20 161d8: 35 07 cpc r19, r21 161da: 08 f4 brcc .+2 ; 0x161de 161dc: 16 ca rjmp .-3028 ; 0x1560a 161de: 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) 161e0: a6 17 cp r26, r22 161e2: b7 07 cpc r27, r23 161e4: 71 f7 brne .-36 ; 0x161c2 161e6: 11 ca rjmp .-3038 ; 0x1560a 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)); 161e8: 84 e9 ldi r24, 0x94 ; 148 161ea: 99 e3 ldi r25, 0x39 ; 57 161ec: 0e 94 c4 72 call 0xe588 ; 0xe588 161f0: ac 01 movw r20, r24 161f2: 63 e0 ldi r22, 0x03 ; 3 161f4: 80 e0 ldi r24, 0x00 ; 0 161f6: 0e 94 0c 6f call 0xde18 ; 0xde18 Sound_MakeCustom(50,1000,false); 161fa: 40 e0 ldi r20, 0x00 ; 0 161fc: 68 ee ldi r22, 0xE8 ; 232 161fe: 73 e0 ldi r23, 0x03 ; 3 16200: 82 e3 ldi r24, 0x32 ; 50 16202: 90 e0 ldi r25, 0x00 ; 0 16204: 0f 94 01 51 call 0x2a202 ; 0x2a202 delay_keep_alive(500); 16208: 84 ef ldi r24, 0xF4 ; 244 1620a: 91 e0 ldi r25, 0x01 ; 1 1620c: 0e 94 fc 8c call 0x119f8 ; 0x119f8 Sound_MakeCustom(50,1000,false); 16210: 40 e0 ldi r20, 0x00 ; 0 16212: 68 ee ldi r22, 0xE8 ; 232 16214: 73 e0 ldi r23, 0x03 ; 3 16216: 82 e3 ldi r24, 0x32 ; 50 16218: 90 e0 ldi r25, 0x00 ; 0 1621a: 0f 94 01 51 call 0x2a202 ; 0x2a202 lcd_wait_for_click_delay(30); 1621e: 8e e1 ldi r24, 0x1E ; 30 16220: 90 e0 ldi r25, 0x00 ; 0 16222: 0f 94 01 3a call 0x27402 ; 0x27402 lcd_update_enable(true); 16226: 81 e0 ldi r24, 0x01 ; 1 16228: 0e 94 3d 6f call 0xde7a ; 0xde7a lcd_clear(); 1622c: 0e 94 2b 6f call 0xde56 ; 0xde56 lcd_update(0); 16230: 80 e0 ldi r24, 0x00 ; 0 16232: 0e 94 bf 6e call 0xdd7e ; 0xdd7e 16236: e9 c9 rjmp .-3118 ; 0x1560a } 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); 16238: 41 e1 ldi r20, 0x11 ; 17 1623a: 50 e0 ldi r21, 0x00 ; 0 1623c: 60 e8 ldi r22, 0x80 ; 128 1623e: 7c e0 ldi r23, 0x0C ; 12 16240: ce 01 movw r24, r28 16242: 01 96 adiw r24, 0x01 ; 1 16244: 0f 94 c7 db call 0x3b78e ; 0x3b78e SERIAL_ECHOPGM("FIRMWARE_NAME:Prusa-Firmware "); 16248: 8e e3 ldi r24, 0x3E ; 62 1624a: 97 e8 ldi r25, 0x87 ; 135 1624c: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHORPGM(FW_VERSION_STR_P()); 16250: 85 ed ldi r24, 0xD5 ; 213 16252: 94 e8 ldi r25, 0x84 ; 132 16254: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHOPGM("+"); 16258: 8c e3 ldi r24, 0x3C ; 60 1625a: 97 e8 ldi r25, 0x87 ; 135 1625c: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHOPGM(STR(FW_COMMITNR)); 16260: 87 e3 ldi r24, 0x37 ; 55 16262: 97 e8 ldi r25, 0x87 ; 135 16264: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHOPGM("_"); 16268: 85 e3 ldi r24, 0x35 ; 53 1626a: 97 e8 ldi r25, 0x87 ; 135 1626c: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHOPGM(FW_COMMIT_HASH); 16270: 8b e2 ldi r24, 0x2B ; 43 16272: 97 e8 ldi r25, 0x87 ; 135 16274: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHOPGM(" based on Marlin FIRMWARE_URL:https://github.com/prusa3d/Prusa-Firmware PROTOCOL_VERSION:"); 16278: 81 ed ldi r24, 0xD1 ; 209 1627a: 96 e8 ldi r25, 0x86 ; 134 1627c: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHOPGM(PROTOCOL_VERSION); 16280: 8d ec ldi r24, 0xCD ; 205 16282: 96 e8 ldi r25, 0x86 ; 134 16284: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHOPGM(" MACHINE_TYPE:"); 16288: 8e eb ldi r24, 0xBE ; 190 1628a: 96 e8 ldi r25, 0x86 ; 134 1628c: 0e 94 68 77 call 0xeed0 ; 0xeed0 16290: ce 01 movw r24, r28 16292: 01 96 adiw r24, 0x01 ; 1 16294: 0e 94 2c 88 call 0x11058 ; 0x11058 SERIAL_PROTOCOL(custom_mendel_name); SERIAL_ECHOPGM(" EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS)); 16298: 8c ea ldi r24, 0xAC ; 172 1629a: 96 e8 ldi r25, 0x86 ; 134 1629c: 0e 94 68 77 call 0xeed0 ; 0xeed0 #ifdef MACHINE_UUID SERIAL_ECHOPGM(" UUID:"); SERIAL_ECHOPGM(MACHINE_UUID); #endif //MACHINE_UUID SERIAL_ECHOLNPGM(""); 162a0: 8b ea ldi r24, 0xAB ; 171 162a2: 96 e8 ldi r25, 0x86 ; 134 162a4: 0e 94 93 79 call 0xf326 ; 0xf326 } #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'); 162a8: 1f 92 push r1 162aa: f1 e3 ldi r31, 0x31 ; 49 162ac: ff 2e mov r15, r31 162ae: ff 92 push r15 162b0: 84 ec ldi r24, 0xC4 ; 196 162b2: 94 e8 ldi r25, 0x84 ; 132 162b4: 9f 93 push r25 162b6: 8f 93 push r24 162b8: 0d e7 ldi r16, 0x7D ; 125 162ba: 14 e8 ldi r17, 0x84 ; 132 162bc: 1f 93 push r17 162be: 0f 93 push r16 162c0: 0f 94 99 da call 0x3b532 ; 0x3b532 162c4: 1f 92 push r1 162c6: ff 92 push r15 162c8: 84 eb ldi r24, 0xB4 ; 180 162ca: 94 e8 ldi r25, 0x84 ; 132 162cc: 9f 93 push r25 162ce: 8f 93 push r24 162d0: 1f 93 push r17 162d2: 0f 93 push r16 162d4: 0f 94 99 da call 0x3b532 ; 0x3b532 162d8: 1f 92 push r1 162da: ff 92 push r15 162dc: 80 ea ldi r24, 0xA0 ; 160 162de: 94 e8 ldi r25, 0x84 ; 132 162e0: 9f 93 push r25 162e2: 8f 93 push r24 162e4: 1f 93 push r17 162e6: 0f 93 push r16 162e8: 0f 94 99 da call 0x3b532 ; 0x3b532 162ec: 1f 92 push r1 162ee: ff 92 push r15 162f0: 83 e9 ldi r24, 0x93 ; 147 162f2: 94 e8 ldi r25, 0x84 ; 132 162f4: 9f 93 push r25 162f6: 8f 93 push r24 162f8: 1f 93 push r17 162fa: 0f 93 push r16 162fc: 0f 94 99 da call 0x3b532 ; 0x3b532 16300: 1f 92 push r1 16302: ff 92 push r15 16304: 88 e8 ldi r24, 0x88 ; 136 16306: 94 e8 ldi r25, 0x84 ; 132 16308: 9f 93 push r25 1630a: 8f 93 push r24 1630c: 1f 93 push r17 1630e: 0f 93 push r16 16310: 0f 94 99 da call 0x3b532 ; 0x3b532 16314: 0f b6 in r0, 0x3f ; 63 16316: f8 94 cli 16318: de bf out 0x3e, r29 ; 62 1631a: 0f be out 0x3f, r0 ; 63 1631c: cd bf out 0x3d, r28 ; 61 1631e: 75 c9 rjmp .-3350 ; 0x1560a /*! ### M114 - Get current position M114: Get Current Position */ case 114: gcode_M114(); 16320: 0e 94 5f 78 call 0xf0be ; 0xf0be 16324: 72 c9 rjmp .-3356 ; 0x1560a /*! ### M117 - Display Message M117: Display Message */ case 117: { const char *src = strchr_pointer + 4; // "M117" 16326: e0 91 93 03 lds r30, 0x0393 ; 0x800393 1632a: f0 91 94 03 lds r31, 0x0394 ; 0x800394 1632e: cf 01 movw r24, r30 16330: 04 96 adiw r24, 0x04 ; 4 lcd_setstatus(*src == ' '? src + 1: src); 16332: 24 81 ldd r18, Z+4 ; 0x04 16334: 20 32 cpi r18, 0x20 ; 32 16336: 09 f4 brne .+2 ; 0x1633a 16338: 01 96 adiw r24, 0x01 ; 1 1633a: 0e 94 64 f4 call 0x1e8c8 ; 0x1e8c8 custom_message_type = CustomMsg::M117; 1633e: 87 e0 ldi r24, 0x07 ; 7 16340: 80 93 c3 06 sts 0x06C3, r24 ; 0x8006c3 16344: 62 c9 rjmp .-3388 ; 0x1560a - `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; 16346: 00 91 93 03 lds r16, 0x0393 ; 0x800393 1634a: 10 91 94 03 lds r17, 0x0394 ; 0x800394 1634e: 0b 5f subi r16, 0xFB ; 251 16350: 1f 4f sbci r17, 0xFF ; 255 16352: 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; 16354: f1 2c mov r15, r1 16356: 40 e0 ldi r20, 0x00 ; 0 16358: 81 50 subi r24, 0x01 ; 1 char *p = strchr_pointer + 5; for (uint8_t i = 2; i--;) { 1635a: e9 f0 breq .+58 ; 0x16396 // A1, E1, and Pn are always parsed out if (!((p[0] == 'A' || p[0] == 'E') && p[1] == '1')) break; 1635c: d8 01 movw r26, r16 1635e: 9c 91 ld r25, X 16360: 29 2f mov r18, r25 16362: 2b 7f andi r18, 0xFB ; 251 16364: 21 34 cpi r18, 0x41 ; 65 16366: b9 f4 brne .+46 ; 0x16396 16368: 11 96 adiw r26, 0x01 ; 1 1636a: 2c 91 ld r18, X 1636c: 21 33 cpi r18, 0x31 ; 49 1636e: 99 f4 brne .+38 ; 0x16396 switch (p[0]) { 16370: 91 34 cpi r25, 0x41 ; 65 16372: 71 f0 breq .+28 ; 0x16390 16374: 95 34 cpi r25, 0x45 ; 69 16376: 09 f4 brne .+2 ; 0x1637a case 'A': hasA = true; break; case 'E': hasE = true; break; 16378: 41 e0 ldi r20, 0x01 ; 1 } p += 2; 1637a: 98 01 movw r18, r16 1637c: 2e 5f subi r18, 0xFE ; 254 1637e: 3f 4f sbci r19, 0xFF ; 255 16380: 89 01 movw r16, r18 16382: 2f 5f subi r18, 0xFF ; 255 16384: 3f 4f sbci r19, 0xFF ; 255 while (*p == ' ') ++p; 16386: f8 01 movw r30, r16 16388: 90 81 ld r25, Z 1638a: 90 32 cpi r25, 0x20 ; 32 1638c: c9 f3 breq .-14 ; 0x16380 1638e: e4 cf rjmp .-56 ; 0x16358 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; 16390: ff 24 eor r15, r15 16392: f3 94 inc r15 16394: f2 cf rjmp .-28 ; 0x1637a } p += 2; while (*p == ' ') ++p; } if (hasE) SERIAL_ECHO_START; 16396: 44 23 and r20, r20 16398: 21 f0 breq .+8 ; 0x163a2 1639a: 82 ef ldi r24, 0xF2 ; 242 1639c: 9b ea ldi r25, 0xAB ; 171 1639e: 0e 94 68 77 call 0xeed0 ; 0xeed0 if (hasA) SERIAL_ECHOPGM("//"); 163a2: ff 20 and r15, r15 163a4: 21 f0 breq .+8 ; 0x163ae 163a6: 88 ea ldi r24, 0xA8 ; 168 163a8: 96 e8 ldi r25, 0x86 ; 134 163aa: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHOLN(p); 163ae: c8 01 movw r24, r16 163b0: 0f 94 bb d5 call 0x3ab76 ; 0x3ab76 163b4: 2a c9 rjmp .-3500 ; 0x1560a /*! ### 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 163b6: 86 e8 ldi r24, 0x86 ; 134 163b8: 98 e6 ldi r25, 0x68 ; 104 163ba: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_PROTOCOLLN(); 163be: 0f 94 b8 d5 call 0x3ab70 ; 0x3ab70 #if defined(X_MIN_PIN) && X_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(_n("x_min: "));////MSG_X_MIN 163c2: 8e e7 ldi r24, 0x7E ; 126 163c4: 98 e6 ldi r25, 0x68 ; 104 163c6: 0e 94 68 77 call 0xeed0 ; 0xeed0 if(READ(X_MIN_PIN)^X_MIN_ENDSTOP_INVERTING){ 163ca: 1e 99 sbic 0x03, 6 ; 3 163cc: 47 c0 rjmp .+142 ; 0x1645c SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 163ce: 89 e7 ldi r24, 0x79 ; 121 163d0: 98 e6 ldi r25, 0x68 ; 104 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); 163d2: 0e 94 68 77 call 0xeed0 ; 0xeed0 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 163d6: 0f 94 b8 d5 call 0x3ab70 ; 0x3ab70 #endif #if defined(X_MAX_PIN) && X_MAX_PIN > -1 SERIAL_PROTOCOLRPGM(_n("x_max: "));////MSG_X_MAX 163da: 87 e6 ldi r24, 0x67 ; 103 163dc: 98 e6 ldi r25, 0x68 ; 104 163de: 0e 94 68 77 call 0xeed0 ; 0xeed0 if(READ(X_MAX_PIN)^X_MAX_ENDSTOP_INVERTING){ 163e2: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 163e6: 82 fd sbrc r24, 2 163e8: 3c c0 rjmp .+120 ; 0x16462 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 163ea: 89 e7 ldi r24, 0x79 ; 121 163ec: 98 e6 ldi r25, 0x68 ; 104 SERIAL_PROTOCOLLN(); #endif #if defined(X_MAX_PIN) && X_MAX_PIN > -1 SERIAL_PROTOCOLRPGM(_n("x_max: "));////MSG_X_MAX if(READ(X_MAX_PIN)^X_MAX_ENDSTOP_INVERTING){ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); 163ee: 0e 94 68 77 call 0xeed0 ; 0xeed0 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 163f2: 0f 94 b8 d5 call 0x3ab70 ; 0x3ab70 #endif #if defined(Y_MIN_PIN) && Y_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(_n("y_min: "));////MSG_Y_MIN 163f6: 8f e5 ldi r24, 0x5F ; 95 163f8: 98 e6 ldi r25, 0x68 ; 104 163fa: 0e 94 68 77 call 0xeed0 ; 0xeed0 if(READ(Y_MIN_PIN)^Y_MIN_ENDSTOP_INVERTING){ 163fe: 1d 99 sbic 0x03, 5 ; 3 16400: 33 c0 rjmp .+102 ; 0x16468 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 16402: 89 e7 ldi r24, 0x79 ; 121 16404: 98 e6 ldi r25, 0x68 ; 104 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); 16406: 0e 94 68 77 call 0xeed0 ; 0xeed0 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 1640a: 0f 94 b8 d5 call 0x3ab70 ; 0x3ab70 #endif #if defined(Y_MAX_PIN) && Y_MAX_PIN > -1 SERIAL_PROTOCOLRPGM(_n("y_max: "));////MSG_Y_MAX 1640e: 87 e5 ldi r24, 0x57 ; 87 16410: 98 e6 ldi r25, 0x68 ; 104 16412: 0e 94 68 77 call 0xeed0 ; 0xeed0 if(READ(Y_MAX_PIN)^Y_MAX_ENDSTOP_INVERTING){ 16416: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 1641a: 87 fd sbrc r24, 7 1641c: 28 c0 rjmp .+80 ; 0x1646e SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 1641e: 89 e7 ldi r24, 0x79 ; 121 16420: 98 e6 ldi r25, 0x68 ; 104 SERIAL_PROTOCOLLN(); #endif #if defined(Y_MAX_PIN) && Y_MAX_PIN > -1 SERIAL_PROTOCOLRPGM(_n("y_max: "));////MSG_Y_MAX if(READ(Y_MAX_PIN)^Y_MAX_ENDSTOP_INVERTING){ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); 16422: 0e 94 68 77 call 0xeed0 ; 0xeed0 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 16426: 0f 94 b8 d5 call 0x3ab70 ; 0x3ab70 #endif #if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(MSG_Z_MIN); 1642a: 8f e4 ldi r24, 0x4F ; 79 1642c: 98 e6 ldi r25, 0x68 ; 104 1642e: 0e 94 68 77 call 0xeed0 ; 0xeed0 if(READ(Z_MIN_PIN)^Z_MIN_ENDSTOP_INVERTING){ 16432: 1c 99 sbic 0x03, 4 ; 3 16434: 1f c0 rjmp .+62 ; 0x16474 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 16436: 89 e7 ldi r24, 0x79 ; 121 16438: 98 e6 ldi r25, 0x68 ; 104 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); 1643a: 0e 94 68 77 call 0xeed0 ; 0xeed0 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 1643e: 0f 94 b8 d5 call 0x3ab70 ; 0x3ab70 #endif #if defined(Z_MAX_PIN) && Z_MAX_PIN > -1 SERIAL_PROTOCOLRPGM(MSG_Z_MAX); 16442: 87 e4 ldi r24, 0x47 ; 71 16444: 98 e6 ldi r25, 0x68 ; 104 16446: 0e 94 68 77 call 0xeed0 ; 0xeed0 if(READ(Z_MAX_PIN)^Z_MAX_ENDSTOP_INVERTING){ 1644a: 01 9b sbis 0x00, 1 ; 0 1644c: 16 c0 rjmp .+44 ; 0x1647a SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 1644e: 89 e7 ldi r24, 0x79 ; 121 16450: 98 e6 ldi r25, 0x68 ; 104 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); 16452: 0e 94 68 77 call 0xeed0 ; 0xeed0 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 16456: 0f 94 b8 d5 call 0x3ab70 ; 0x3ab70 1645a: d7 c8 rjmp .-3666 ; 0x1560a 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); 1645c: 8f e6 ldi r24, 0x6F ; 111 1645e: 98 e6 ldi r25, 0x68 ; 104 16460: b8 cf rjmp .-144 ; 0x163d2 SERIAL_PROTOCOLLN(); #endif #if defined(X_MAX_PIN) && X_MAX_PIN > -1 SERIAL_PROTOCOLRPGM(_n("x_max: "));////MSG_X_MAX if(READ(X_MAX_PIN)^X_MAX_ENDSTOP_INVERTING){ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); 16462: 8f e6 ldi r24, 0x6F ; 111 16464: 98 e6 ldi r25, 0x68 ; 104 16466: c3 cf rjmp .-122 ; 0x163ee 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); 16468: 8f e6 ldi r24, 0x6F ; 111 1646a: 98 e6 ldi r25, 0x68 ; 104 1646c: cc cf rjmp .-104 ; 0x16406 SERIAL_PROTOCOLLN(); #endif #if defined(Y_MAX_PIN) && Y_MAX_PIN > -1 SERIAL_PROTOCOLRPGM(_n("y_max: "));////MSG_Y_MAX if(READ(Y_MAX_PIN)^Y_MAX_ENDSTOP_INVERTING){ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); 1646e: 8f e6 ldi r24, 0x6F ; 111 16470: 98 e6 ldi r25, 0x68 ; 104 16472: d7 cf rjmp .-82 ; 0x16422 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); 16474: 8f e6 ldi r24, 0x6F ; 111 16476: 98 e6 ldi r25, 0x68 ; 104 16478: e0 cf rjmp .-64 ; 0x1643a 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); 1647a: 8f e6 ldi r24, 0x6F ; 111 1647c: 98 e6 ldi r25, 0x68 ; 104 1647e: e9 cf rjmp .-46 ; 0x16452 E0:3240 RPM PRN1:4560 RPM E0@:255 PRN1@:255 */ case 123: gcode_M123(); 16480: 0e 94 9c 66 call 0xcd38 ; 0xcd38 16484: c2 c8 rjmp .-3708 ; 0x1560a */ 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')) { 16486: 84 e5 ldi r24, 0x54 ; 84 16488: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 1648c: 88 23 and r24, r24 1648e: 69 f0 breq .+26 ; 0x164aa extruder = code_value_uint8(); 16490: 0e 94 80 5b call 0xb700 ; 0xb700 if(extruder >= EXTRUDERS) { 16494: 88 23 and r24, r24 16496: 49 f0 breq .+18 ; 0x164aa SERIAL_ECHO_START; 16498: 82 ef ldi r24, 0xF2 ; 242 1649a: 9b ea ldi r25, 0xAB ; 171 1649c: 0e 94 68 77 call 0xeed0 ; 0xeed0 164a0: 80 e3 ldi r24, 0x30 ; 48 164a2: 98 e6 ldi r25, 0x68 ; 104 164a4: 0e 94 2c 88 call 0x11058 ; 0x11058 164a8: b0 c8 rjmp .-3744 ; 0x1560a SERIAL_ECHO(_n("M200 Invalid extruder "));////MSG_M200_INVALID_EXTRUDER break; } } if(code_seen('D')) { 164aa: 84 e4 ldi r24, 0x44 ; 68 164ac: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 164b0: 88 23 and r24, r24 164b2: 09 f4 brne .+2 ; 0x164b6 164b4: aa c8 rjmp .-3756 ; 0x1560a float diameter = code_value(); 164b6: 0e 94 b5 60 call 0xc16a ; 0xc16a if (diameter == 0.0) { 164ba: 20 e0 ldi r18, 0x00 ; 0 164bc: 30 e0 ldi r19, 0x00 ; 0 164be: a9 01 movw r20, r18 164c0: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 164c4: 81 11 cpse r24, r1 164c6: 05 c0 rjmp .+10 ; 0x164d2 // 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; 164c8: 10 92 54 0e sts 0x0E54, r1 ; 0x800e54 } } else { //reserved for setting filament diameter via UFID or filament measuring device break; } calculate_extruder_multipliers(); 164cc: 0e 94 d1 65 call 0xcba2 ; 0xcba2 164d0: 9c c8 rjmp .-3784 ; 0x1560a // 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(); 164d2: 0e 94 b5 60 call 0xc16a ; 0xc16a 164d6: 6b 01 movw r12, r22 164d8: 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]); 164da: 20 e0 ldi r18, 0x00 ; 0 164dc: 30 e0 ldi r19, 0x00 ; 0 164de: a9 01 movw r20, r18 164e0: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 164e4: 81 11 cpse r24, r1 164e6: 06 c0 rjmp .+12 ; 0x164f4 164e8: c1 2c mov r12, r1 164ea: d1 2c mov r13, r1 164ec: e0 ee ldi r30, 0xE0 ; 224 164ee: ee 2e mov r14, r30 164f0: ef e3 ldi r30, 0x3F ; 63 164f2: fe 2e mov r15, r30 164f4: c0 92 55 0e sts 0x0E55, r12 ; 0x800e55 164f8: d0 92 56 0e sts 0x0E56, r13 ; 0x800e56 164fc: e0 92 57 0e sts 0x0E57, r14 ; 0x800e57 16500: f0 92 58 0e sts 0x0E58, r15 ; 0x800e58 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; 16504: 81 e0 ldi r24, 0x01 ; 1 16506: 80 93 54 0e sts 0x0E54, r24 ; 0x800e54 1650a: e0 cf rjmp .-64 ; 0x164cc 1650c: 6d ed ldi r22, 0xDD ; 221 1650e: c6 2e mov r12, r22 16510: 62 e0 ldi r22, 0x02 ; 2 16512: d6 2e mov r13, r22 16514: 7d eb ldi r23, 0xBD ; 189 16516: e7 2e mov r14, r23 16518: 7d e0 ldi r23, 0x0D ; 13 1651a: f7 2e mov r15, r23 - `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++) 1651c: 10 e0 ldi r17, 0x00 ; 0 { if (code_seen(axis_codes[i])) 1651e: d6 01 movw r26, r12 16520: 8d 91 ld r24, X+ 16522: 6d 01 movw r12, r26 16524: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 16528: 88 23 and r24, r24 1652a: 41 f1 breq .+80 ; 0x1657c { unsigned long val = code_value(); 1652c: 0e 94 b5 60 call 0xc16a ; 0xc16a 16530: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> #ifdef TMC2130 unsigned long val_silent = val; if ((i == X_AXIS) || (i == Y_AXIS)) 16534: 12 30 cpi r17, 0x02 ; 2 16536: 4c f5 brge .+82 ; 0x1658a { if (val > NORMAL_MAX_ACCEL_XY) 16538: 65 3c cpi r22, 0xC5 ; 197 1653a: b9 e0 ldi r27, 0x09 ; 9 1653c: 7b 07 cpc r23, r27 1653e: 81 05 cpc r24, r1 16540: 91 05 cpc r25, r1 16542: 40 f5 brcc .+80 ; 0x16594 16544: 56 2f mov r21, r22 16546: 47 2f mov r20, r23 16548: 38 2f mov r19, r24 1654a: 29 2f mov r18, r25 1654c: 61 3c cpi r22, 0xC1 ; 193 1654e: e3 e0 ldi r30, 0x03 ; 3 16550: 7e 07 cpc r23, r30 16552: 81 05 cpc r24, r1 16554: 91 05 cpc r25, r1 16556: 20 f0 brcs .+8 ; 0x16560 16558: 50 ec ldi r21, 0xC0 ; 192 1655a: 43 e0 ldi r20, 0x03 ; 3 1655c: 30 e0 ldi r19, 0x00 ; 0 1655e: 20 e0 ldi r18, 0x00 ; 0 val = NORMAL_MAX_ACCEL_XY; if (val_silent > SILENT_MAX_ACCEL_XY) val_silent = SILENT_MAX_ACCEL_XY; } cs.max_acceleration_mm_per_s2_normal[i] = val; 16560: d7 01 movw r26, r14 16562: 94 96 adiw r26, 0x24 ; 36 16564: 6d 93 st X+, r22 16566: 7d 93 st X+, r23 16568: 8d 93 st X+, r24 1656a: 9c 93 st X, r25 1656c: 97 97 sbiw r26, 0x27 ; 39 cs.max_acceleration_mm_per_s2_silent[i] = val_silent; 1656e: f7 01 movw r30, r14 16570: e4 55 subi r30, 0x54 ; 84 16572: ff 4f sbci r31, 0xFF ; 255 16574: 50 83 st Z, r21 16576: 41 83 std Z+1, r20 ; 0x01 16578: 32 83 std Z+2, r19 ; 0x02 1657a: 23 83 std Z+3, r18 ; 0x03 1657c: b4 e0 ldi r27, 0x04 ; 4 1657e: eb 0e add r14, r27 16580: f1 1c adc r15, r1 16582: 1f 5f subi r17, 0xFF ; 255 - `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++) 16584: 14 30 cpi r17, 0x04 ; 4 16586: 59 f6 brne .-106 ; 0x1651e 16588: c6 cd rjmp .-1140 ; 0x16116 { if (code_seen(axis_codes[i])) { unsigned long val = code_value(); 1658a: 56 2f mov r21, r22 1658c: 47 2f mov r20, r23 1658e: 38 2f mov r19, r24 16590: 29 2f mov r18, r25 16592: e6 cf rjmp .-52 ; 0x16560 if ((i == X_AXIS) || (i == Y_AXIS)) { if (val > NORMAL_MAX_ACCEL_XY) val = NORMAL_MAX_ACCEL_XY; if (val_silent > SILENT_MAX_ACCEL_XY) val_silent = SILENT_MAX_ACCEL_XY; 16594: 50 ec ldi r21, 0xC0 ; 192 16596: 43 e0 ldi r20, 0x03 ; 3 16598: 30 e0 ldi r19, 0x00 ; 0 1659a: 20 e0 ldi r18, 0x00 ; 0 #ifdef TMC2130 unsigned long val_silent = val; if ((i == X_AXIS) || (i == Y_AXIS)) { if (val > NORMAL_MAX_ACCEL_XY) val = NORMAL_MAX_ACCEL_XY; 1659c: 64 ec ldi r22, 0xC4 ; 196 1659e: 79 e0 ldi r23, 0x09 ; 9 165a0: 80 e0 ldi r24, 0x00 ; 0 165a2: 90 e0 ldi r25, 0x00 ; 0 165a4: dd cf rjmp .-70 ; 0x16560 165a6: 4d ed ldi r20, 0xDD ; 221 165a8: a4 2e mov r10, r20 165aa: 42 e0 ldi r20, 0x02 ; 2 165ac: b4 2e mov r11, r20 165ae: 5d eb ldi r21, 0xBD ; 189 165b0: c5 2e mov r12, r21 165b2: 5d e0 ldi r21, 0x0D ; 13 165b4: d5 2e mov r13, r21 - `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++) 165b6: 91 2c mov r9, r1 { if (code_seen(axis_codes[i])) 165b8: f5 01 movw r30, r10 165ba: 81 91 ld r24, Z+ 165bc: 5f 01 movw r10, r30 165be: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 165c2: 88 23 and r24, r24 165c4: 71 f1 breq .+92 ; 0x16622 { float val = code_value(); 165c6: 0e 94 b5 60 call 0xc16a ; 0xc16a 165ca: 7b 01 movw r14, r22 165cc: 8c 01 movw r16, r24 #ifdef TMC2130 float val_silent = val; if ((i == X_AXIS) || (i == Y_AXIS)) 165ce: f1 e0 ldi r31, 0x01 ; 1 165d0: f9 15 cp r31, r9 165d2: b8 f1 brcs .+110 ; 0x16642 { if (val > NORMAL_MAX_FEEDRATE_XY) 165d4: 20 e0 ldi r18, 0x00 ; 0 165d6: 30 e0 ldi r19, 0x00 ; 0 165d8: 48 e4 ldi r20, 0x48 ; 72 165da: 53 e4 ldi r21, 0x43 ; 67 165dc: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 165e0: 18 16 cp r1, r24 165e2: 44 f1 brlt .+80 ; 0x16634 case 203: // M203 max feedrate mm/sec for (uint8_t i = 0; i < NUM_AXIS; i++) { if (code_seen(axis_codes[i])) { float val = code_value(); 165e4: 5e 2c mov r5, r14 165e6: 6f 2c mov r6, r15 165e8: 70 2e mov r7, r16 165ea: 81 2e mov r8, r17 float val_silent = val; if ((i == X_AXIS) || (i == Y_AXIS)) { if (val > NORMAL_MAX_FEEDRATE_XY) val = NORMAL_MAX_FEEDRATE_XY; if (val_silent > SILENT_MAX_FEEDRATE_XY) 165ec: 20 e0 ldi r18, 0x00 ; 0 165ee: 30 e0 ldi r19, 0x00 ; 0 165f0: 48 ec ldi r20, 0xC8 ; 200 165f2: 52 e4 ldi r21, 0x42 ; 66 165f4: b7 01 movw r22, r14 165f6: c8 01 movw r24, r16 165f8: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 165fc: 18 16 cp r1, r24 165fe: 34 f1 brlt .+76 ; 0x1664c val_silent = SILENT_MAX_FEEDRATE_XY; } cs.max_feedrate_normal[i] = val; 16600: 85 2d mov r24, r5 16602: 96 2d mov r25, r6 16604: a7 2d mov r26, r7 16606: b8 2d mov r27, r8 16608: f6 01 movw r30, r12 1660a: 84 8b std Z+20, r24 ; 0x14 1660c: 95 8b std Z+21, r25 ; 0x15 1660e: a6 8b std Z+22, r26 ; 0x16 16610: b7 8b std Z+23, r27 ; 0x17 cs.max_feedrate_silent[i] = val_silent; 16612: c7 01 movw r24, r14 16614: d8 01 movw r26, r16 16616: e4 56 subi r30, 0x64 ; 100 16618: ff 4f sbci r31, 0xFF ; 255 1661a: 80 83 st Z, r24 1661c: 91 83 std Z+1, r25 ; 0x01 1661e: a2 83 std Z+2, r26 ; 0x02 16620: b3 83 std Z+3, r27 ; 0x03 - `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++) 16622: 93 94 inc r9 16624: f4 e0 ldi r31, 0x04 ; 4 16626: cf 0e add r12, r31 16628: d1 1c adc r13, r1 1662a: 24 e0 ldi r18, 0x04 ; 4 1662c: 92 12 cpse r9, r18 1662e: c4 cf rjmp .-120 ; 0x165b8 16630: 0c 94 05 ab jmp 0x1560a ; 0x1560a #ifdef TMC2130 float val_silent = val; if ((i == X_AXIS) || (i == Y_AXIS)) { if (val > NORMAL_MAX_FEEDRATE_XY) val = NORMAL_MAX_FEEDRATE_XY; 16634: 51 2c mov r5, r1 16636: 61 2c mov r6, r1 16638: 28 e4 ldi r18, 0x48 ; 72 1663a: 72 2e mov r7, r18 1663c: 33 e4 ldi r19, 0x43 ; 67 1663e: 83 2e mov r8, r19 16640: d5 cf rjmp .-86 ; 0x165ec case 203: // M203 max feedrate mm/sec for (uint8_t i = 0; i < NUM_AXIS; i++) { if (code_seen(axis_codes[i])) { float val = code_value(); 16642: 56 2e mov r5, r22 16644: 6f 2c mov r6, r15 16646: 78 2e mov r7, r24 16648: 81 2e mov r8, r17 1664a: da cf rjmp .-76 ; 0x16600 if ((i == X_AXIS) || (i == Y_AXIS)) { if (val > NORMAL_MAX_FEEDRATE_XY) val = NORMAL_MAX_FEEDRATE_XY; if (val_silent > SILENT_MAX_FEEDRATE_XY) val_silent = SILENT_MAX_FEEDRATE_XY; 1664c: e1 2c mov r14, r1 1664e: f1 2c mov r15, r1 16650: 08 ec ldi r16, 0xC8 ; 200 16652: 12 e4 ldi r17, 0x42 ; 66 16654: d5 cf rjmp .-86 ; 0x16600 // Interpret the T value as retract acceleration in the old Marlin format. if(code_seen('T')) cs.retract_acceleration = code_value(); } else { // New acceleration format, compatible with the upstream Marlin. if(code_seen('P')) 16656: 80 e5 ldi r24, 0x50 ; 80 16658: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 1665c: 88 23 and r24, r24 1665e: 51 f0 breq .+20 ; 0x16674 cs.acceleration = code_value(); 16660: 0e 94 b5 60 call 0xc16a ; 0xc16a 16664: 60 93 f1 0d sts 0x0DF1, r22 ; 0x800df1 16668: 70 93 f2 0d sts 0x0DF2, r23 ; 0x800df2 1666c: 80 93 f3 0d sts 0x0DF3, r24 ; 0x800df3 16670: 90 93 f4 0d sts 0x0DF4, r25 ; 0x800df4 if(code_seen('R')) 16674: 82 e5 ldi r24, 0x52 ; 82 16676: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 1667a: 88 23 and r24, r24 1667c: 51 f0 breq .+20 ; 0x16692 cs.retract_acceleration = code_value(); 1667e: 0e 94 b5 60 call 0xc16a ; 0xc16a 16682: 60 93 f5 0d sts 0x0DF5, r22 ; 0x800df5 16686: 70 93 f6 0d sts 0x0DF6, r23 ; 0x800df6 1668a: 80 93 f7 0d sts 0x0DF7, r24 ; 0x800df7 1668e: 90 93 f8 0d sts 0x0DF8, r25 ; 0x800df8 if(code_seen('T')) 16692: 84 e5 ldi r24, 0x54 ; 84 16694: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 16698: 88 23 and r24, r24 1669a: 11 f4 brne .+4 ; 0x166a0 1669c: 0c 94 05 ab jmp 0x1560a ; 0x1560a cs.travel_acceleration = code_value(); 166a0: 0e 94 b5 60 call 0xc16a ; 0xc16a 166a4: 60 93 7d 0e sts 0x0E7D, r22 ; 0x800e7d 166a8: 70 93 7e 0e sts 0x0E7E, r23 ; 0x800e7e 166ac: 80 93 7f 0e sts 0x0E7F, r24 ; 0x800e7f 166b0: 90 93 80 0e sts 0x0E80, r25 ; 0x800e80 166b4: 0c 94 05 ab jmp 0x1560a ; 0x1560a - `Z` - Maximum Z jerk (units/s) - `E` - Maximum E jerk (units/s) */ case 205: { if(code_seen('S')) cs.minimumfeedrate = code_value(); 166b8: 83 e5 ldi r24, 0x53 ; 83 166ba: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 166be: 88 23 and r24, r24 166c0: 51 f0 breq .+20 ; 0x166d6 166c2: 0e 94 b5 60 call 0xc16a ; 0xc16a 166c6: 60 93 f9 0d sts 0x0DF9, r22 ; 0x800df9 166ca: 70 93 fa 0d sts 0x0DFA, r23 ; 0x800dfa 166ce: 80 93 fb 0d sts 0x0DFB, r24 ; 0x800dfb 166d2: 90 93 fc 0d sts 0x0DFC, r25 ; 0x800dfc if(code_seen('T')) cs.mintravelfeedrate = code_value(); 166d6: 84 e5 ldi r24, 0x54 ; 84 166d8: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 166dc: 88 23 and r24, r24 166de: 51 f0 breq .+20 ; 0x166f4 166e0: 0e 94 b5 60 call 0xc16a ; 0xc16a 166e4: 60 93 fd 0d sts 0x0DFD, r22 ; 0x800dfd 166e8: 70 93 fe 0d sts 0x0DFE, r23 ; 0x800dfe 166ec: 80 93 ff 0d sts 0x0DFF, r24 ; 0x800dff 166f0: 90 93 00 0e sts 0x0E00, r25 ; 0x800e00 if(code_seen('B')) cs.min_segment_time_us = (uint32_t)code_value(); 166f4: 82 e4 ldi r24, 0x42 ; 66 166f6: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 166fa: 88 23 and r24, r24 166fc: 61 f0 breq .+24 ; 0x16716 166fe: 0e 94 b5 60 call 0xc16a ; 0xc16a 16702: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 16706: 60 93 01 0e sts 0x0E01, r22 ; 0x800e01 1670a: 70 93 02 0e sts 0x0E02, r23 ; 0x800e02 1670e: 80 93 03 0e sts 0x0E03, r24 ; 0x800e03 16712: 90 93 04 0e sts 0x0E04, r25 ; 0x800e04 if(code_seen('X')) cs.max_jerk[X_AXIS] = cs.max_jerk[Y_AXIS] = code_value(); 16716: 88 e5 ldi r24, 0x58 ; 88 16718: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 1671c: 88 23 and r24, r24 1671e: 91 f0 breq .+36 ; 0x16744 16720: 0e 94 b5 60 call 0xc16a ; 0xc16a 16724: 60 93 09 0e sts 0x0E09, r22 ; 0x800e09 16728: 70 93 0a 0e sts 0x0E0A, r23 ; 0x800e0a 1672c: 80 93 0b 0e sts 0x0E0B, r24 ; 0x800e0b 16730: 90 93 0c 0e sts 0x0E0C, r25 ; 0x800e0c 16734: 60 93 05 0e sts 0x0E05, r22 ; 0x800e05 16738: 70 93 06 0e sts 0x0E06, r23 ; 0x800e06 1673c: 80 93 07 0e sts 0x0E07, r24 ; 0x800e07 16740: 90 93 08 0e sts 0x0E08, r25 ; 0x800e08 if(code_seen('Y')) cs.max_jerk[Y_AXIS] = code_value(); 16744: 89 e5 ldi r24, 0x59 ; 89 16746: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 1674a: 88 23 and r24, r24 1674c: 51 f0 breq .+20 ; 0x16762 1674e: 0e 94 b5 60 call 0xc16a ; 0xc16a 16752: 60 93 09 0e sts 0x0E09, r22 ; 0x800e09 16756: 70 93 0a 0e sts 0x0E0A, r23 ; 0x800e0a 1675a: 80 93 0b 0e sts 0x0E0B, r24 ; 0x800e0b 1675e: 90 93 0c 0e sts 0x0E0C, r25 ; 0x800e0c if(code_seen('Z')) cs.max_jerk[Z_AXIS] = code_value(); 16762: 8a e5 ldi r24, 0x5A ; 90 16764: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 16768: 88 23 and r24, r24 1676a: 51 f0 breq .+20 ; 0x16780 1676c: 0e 94 b5 60 call 0xc16a ; 0xc16a 16770: 60 93 0d 0e sts 0x0E0D, r22 ; 0x800e0d 16774: 70 93 0e 0e sts 0x0E0E, r23 ; 0x800e0e 16778: 80 93 0f 0e sts 0x0E0F, r24 ; 0x800e0f 1677c: 90 93 10 0e sts 0x0E10, r25 ; 0x800e10 if(code_seen('E')) 16780: 85 e4 ldi r24, 0x45 ; 69 16782: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 16786: 88 23 and r24, r24 16788: 11 f4 brne .+4 ; 0x1678e 1678a: 0c 94 05 ab jmp 0x1560a ; 0x1560a { float e = code_value(); 1678e: 0e 94 b5 60 call 0xc16a ; 0xc16a #ifndef LA_NOCOMPAT e = la10c_jerk(e); 16792: 0e 94 ca 81 call 0x10394 ; 0x10394 #endif cs.max_jerk[E_AXIS] = e; 16796: 60 93 11 0e sts 0x0E11, r22 ; 0x800e11 1679a: 70 93 12 0e sts 0x0E12, r23 ; 0x800e12 1679e: 80 93 13 0e sts 0x0E13, r24 ; 0x800e13 167a2: 90 93 14 0e sts 0x0E14, r25 ; 0x800e14 167a6: 0c 94 05 ab jmp 0x1560a ; 0x1560a 167aa: 0d ed ldi r16, 0xDD ; 221 167ac: 12 e0 ldi r17, 0x02 ; 2 167ae: 85 e1 ldi r24, 0x15 ; 21 167b0: e8 2e mov r14, r24 167b2: 8e e0 ldi r24, 0x0E ; 14 167b4: f8 2e mov r15, r24 167b6: 90 ee ldi r25, 0xE0 ; 224 167b8: c9 2e mov r12, r25 167ba: 92 e0 ldi r25, 0x02 ; 2 167bc: d9 2e mov r13, r25 - `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(); 167be: d8 01 movw r26, r16 167c0: 8d 91 ld r24, X+ 167c2: 8d 01 movw r16, r26 167c4: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 167c8: 88 23 and r24, r24 167ca: 39 f0 breq .+14 ; 0x167da 167cc: 0e 94 b5 60 call 0xc16a ; 0xc16a 167d0: f7 01 movw r30, r14 167d2: 60 83 st Z, r22 167d4: 71 83 std Z+1, r23 ; 0x01 167d6: 82 83 std Z+2, r24 ; 0x02 167d8: 93 83 std Z+3, r25 ; 0x03 167da: f4 e0 ldi r31, 0x04 ; 4 167dc: ef 0e add r14, r31 167de: 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++) 167e0: c0 16 cp r12, r16 167e2: d1 06 cpc r13, r17 167e4: 61 f7 brne .-40 ; 0x167be 167e6: 0c 94 05 ab jmp 0x1560a ; 0x1560a - `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')) 167ea: 83 e5 ldi r24, 0x53 ; 83 167ec: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 167f0: 88 23 and r24, r24 167f2: 51 f0 breq .+20 ; 0x16808 { cs.retract_recover_length = code_value() ; 167f4: 0e 94 b5 60 call 0xc16a ; 0xc16a 167f8: 60 93 4c 0e sts 0x0E4C, r22 ; 0x800e4c 167fc: 70 93 4d 0e sts 0x0E4D, r23 ; 0x800e4d 16800: 80 93 4e 0e sts 0x0E4E, r24 ; 0x800e4e 16804: 90 93 4f 0e sts 0x0E4F, r25 ; 0x800e4f } if(code_seen('F')) 16808: 86 e4 ldi r24, 0x46 ; 70 1680a: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 1680e: 88 23 and r24, r24 16810: 11 f4 brne .+4 ; 0x16816 16812: 0c 94 05 ab jmp 0x1560a ; 0x1560a { cs.retract_recover_feedrate = get_feedrate_mm_s(code_value()); 16816: 0e 94 b5 60 call 0xc16a ; 0xc16a 1681a: 0e 94 df 66 call 0xcdbe ; 0xcdbe 1681e: 60 93 50 0e sts 0x0E50, r22 ; 0x800e50 16822: 70 93 51 0e sts 0x0E51, r23 ; 0x800e51 16826: 80 93 52 0e sts 0x0E52, r24 ; 0x800e52 1682a: 90 93 53 0e sts 0x0E53, r25 ; 0x800e53 1682e: 0c 94 05 ab jmp 0x1560a ; 0x1560a #### 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')) 16832: 83 e5 ldi r24, 0x53 ; 83 16834: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 16838: 88 23 and r24, r24 1683a: 11 f4 brne .+4 ; 0x16840 1683c: 0c 94 05 ab jmp 0x1560a ; 0x1560a { switch(code_value_uint8()) 16840: 0e 94 80 5b call 0xb700 ; 0xb700 16844: 88 23 and r24, r24 16846: c1 f0 breq .+48 ; 0x16878 16848: 81 30 cpi r24, 0x01 ; 1 1684a: e1 f0 breq .+56 ; 0x16884 #if EXTRUDERS > 2 retracted[2]=false; #endif }break; default: SERIAL_ECHO_START; 1684c: 82 ef ldi r24, 0xF2 ; 242 1684e: 9b ea ldi r25, 0xAB ; 171 16850: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); 16854: 8d e1 ldi r24, 0x1D ; 29 16856: 98 e6 ldi r25, 0x68 ; 104 16858: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); 1685c: 80 91 91 12 lds r24, 0x1291 ; 0x801291 16860: 90 91 92 12 lds r25, 0x1292 ; 0x801292 16864: 89 55 subi r24, 0x59 ; 89 16866: 9f 4e sbci r25, 0xEF ; 239 16868: 0e 94 2c 88 call 0x11058 ; 0x11058 SERIAL_ECHOLNPGM("\"(1)"); 1686c: 83 ea ldi r24, 0xA3 ; 163 1686e: 96 e8 ldi r25, 0x86 ; 134 16870: 0e 94 93 79 call 0xf326 ; 0xf326 16874: 0c 94 05 ab jmp 0x1560a ; 0x1560a { switch(code_value_uint8()) { case 0: { cs.autoretract_enabled=false; 16878: 10 92 3f 0e sts 0x0E3F, r1 ; 0x800e3f retracted[0]=false; 1687c: 10 92 8d 06 sts 0x068D, r1 ; 0x80068d 16880: 0c 94 05 ab jmp 0x1560a ; 0x1560a retracted[2]=false; #endif }break; case 1: { cs.autoretract_enabled=true; 16884: 80 93 3f 0e sts 0x0E3F, r24 ; 0x800e3f retracted[0]=false; 16888: 10 92 8d 06 sts 0x068D, r1 ; 0x80068d 1688c: 0c 94 05 ab jmp 0x1560a ; 0x1560a 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; 16890: 40 90 81 0e lds r4, 0x0E81 ; 0x800e81 16894: 50 90 82 0e lds r5, 0x0E82 ; 0x800e82 16898: 60 90 83 0e lds r6, 0x0E83 ; 0x800e83 1689c: 70 90 84 0e lds r7, 0x0E84 ; 0x800e84 168a0: 0c 94 62 a8 jmp 0x150c4 ; 0x150c4 float s = code_seen('S') ? code_value() : cs.min_mm_per_arc_segment; 168a4: 80 90 85 0e lds r8, 0x0E85 ; 0x800e85 168a8: 90 90 86 0e lds r9, 0x0E86 ; 0x800e86 168ac: a0 90 87 0e lds r10, 0x0E87 ; 0x800e87 168b0: b0 90 88 0e lds r11, 0x0E88 ; 0x800e88 168b4: 0c 94 6d a8 jmp 0x150da ; 0x150da - `R` - Restore previous speed factor */ case 220: { bool codesWereSeen = false; if (code_seen('B')) //backup current speed factor 168b8: 82 e4 ldi r24, 0x42 ; 66 168ba: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 168be: 18 2f mov r17, r24 168c0: 88 23 and r24, r24 168c2: 41 f0 breq .+16 ; 0x168d4 { saved_feedmultiply_mm = feedmultiply; 168c4: 80 91 39 02 lds r24, 0x0239 ; 0x800239 168c8: 90 91 3a 02 lds r25, 0x023A ; 0x80023a 168cc: 90 93 2e 02 sts 0x022E, r25 ; 0x80022e 168d0: 80 93 2d 02 sts 0x022D, r24 ; 0x80022d codesWereSeen = true; } if (code_seen('S')) 168d4: 83 e5 ldi r24, 0x53 ; 83 168d6: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 168da: 08 2f mov r16, r24 168dc: 88 23 and r24, r24 168de: 39 f0 breq .+14 ; 0x168ee { feedmultiply = code_value_short(); 168e0: 0e 94 8d 5b call 0xb71a ; 0xb71a 168e4: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a 168e8: 80 93 39 02 sts 0x0239, r24 ; 0x800239 codesWereSeen = true; 168ec: 10 2f mov r17, r16 } if (code_seen('R')) //restore previous feedmultiply 168ee: 82 e5 ldi r24, 0x52 ; 82 168f0: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 168f4: 88 23 and r24, r24 168f6: 51 f0 breq .+20 ; 0x1690c { feedmultiply = saved_feedmultiply_mm; 168f8: 80 91 2d 02 lds r24, 0x022D ; 0x80022d 168fc: 90 91 2e 02 lds r25, 0x022E ; 0x80022e 16900: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a 16904: 80 93 39 02 sts 0x0239, r24 ; 0x800239 16908: 0c 94 05 ab jmp 0x1560a ; 0x1560a codesWereSeen = true; } if (!codesWereSeen) 1690c: 11 11 cpse r17, r1 1690e: 0c 94 05 ab jmp 0x1560a ; 0x1560a { printf_P(PSTR("%i%%\n"), feedmultiply); 16912: 80 91 3a 02 lds r24, 0x023A ; 0x80023a 16916: 8f 93 push r24 16918: 80 91 39 02 lds r24, 0x0239 ; 0x800239 1691c: 8f 93 push r24 1691e: 8d e9 ldi r24, 0x9D ; 157 16920: 96 e8 ldi r25, 0x86 ; 134 16922: 9f 93 push r25 16924: 8f 93 push r24 16926: 0f 94 99 da call 0x3b532 ; 0x3b532 1692a: 0f 90 pop r0 1692c: 0f 90 pop r0 1692e: 0f 90 pop r0 16930: 0f 90 pop r0 16932: 0c 94 05 ab jmp 0x1560a ; 0x1560a extrudemultiply = code_value_short(); calculate_extruder_multipliers(); } else { printf_P(PSTR("%i%%\n"), extrudemultiply); 16936: 80 91 bd 02 lds r24, 0x02BD ; 0x8002bd 1693a: 8f 93 push r24 1693c: 80 91 bc 02 lds r24, 0x02BC ; 0x8002bc 16940: 8f 93 push r24 16942: 87 e9 ldi r24, 0x97 ; 151 16944: 96 e8 ldi r25, 0x86 ; 134 16946: 9f 93 push r25 16948: 8f 93 push r24 1694a: 0f 94 99 da call 0x3b532 ; 0x3b532 1694e: 0f 90 pop r0 16950: 0f 90 pop r0 16952: 0f 90 pop r0 16954: 0f 90 pop r0 16956: 0c 94 05 ab jmp 0x1560a ; 0x1560a - `P` - pin number - `S` - pin state */ case 226: { if(code_seen('P')){ 1695a: 80 e5 ldi r24, 0x50 ; 80 1695c: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 16960: 88 23 and r24, r24 16962: 11 f4 brne .+4 ; 0x16968 16964: 0c 94 05 ab jmp 0x1560a ; 0x1560a int pin_number = code_value_short(); // pin number 16968: 0e 94 8d 5b call 0xb71a ; 0xb71a 1696c: 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 1696e: 83 e5 ldi r24, 0x53 ; 83 16970: 0e 94 ee 5b call 0xb7dc ; 0xb7dc */ case 226: { if(code_seen('P')){ int pin_number = code_value_short(); // pin number int pin_state = -1; // required pin state - default is inverted 16974: 0f ef ldi r16, 0xFF ; 255 16976: 1f ef ldi r17, 0xFF ; 255 if(code_seen('S')) pin_state = code_value_short(); // required pin state 16978: 88 23 and r24, r24 1697a: 19 f0 breq .+6 ; 0x16982 1697c: 0e 94 8d 5b call 0xb71a ; 0xb71a 16980: 8c 01 movw r16, r24 if(pin_state >= -1 && pin_state <= 1){ 16982: c8 01 movw r24, r16 16984: 01 96 adiw r24, 0x01 ; 1 16986: 03 97 sbiw r24, 0x03 ; 3 16988: 10 f0 brcs .+4 ; 0x1698e 1698a: 0c 94 05 ab jmp 0x1560a ; 0x1560a 1698e: ed e9 ldi r30, 0x9D ; 157 16990: f7 e8 ldi r31, 0x87 ; 135 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)) 16992: 84 91 lpm r24, Z 16994: 08 2e mov r0, r24 16996: 00 0c add r0, r0 16998: 99 0b sbc r25, r25 1699a: e8 16 cp r14, r24 1699c: f9 06 cpc r15, r25 1699e: 11 f4 brne .+4 ; 0x169a4 169a0: 0c 94 05 ab jmp 0x1560a ; 0x1560a 169a4: 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++) 169a6: 27 e8 ldi r18, 0x87 ; 135 169a8: e9 3b cpi r30, 0xB9 ; 185 169aa: f2 07 cpc r31, r18 169ac: 91 f7 brne .-28 ; 0x16992 pin_number = -1; break; } } if (pin_number > -1) 169ae: f7 fe sbrs r15, 7 169b0: 02 c0 rjmp .+4 ; 0x169b6 169b2: 0c 94 05 ab jmp 0x1560a ; 0x1560a { int target = LOW; st_synchronize(); 169b6: 0f 94 a3 42 call 0x28546 ; 0x28546 pinMode(pin_number, INPUT); 169ba: de 2c mov r13, r14 169bc: 60 e0 ldi r22, 0x00 ; 0 169be: 8e 2d mov r24, r14 169c0: 0e 94 c0 e8 call 0x1d180 ; 0x1d180 switch(pin_state){ 169c4: 0f 3f cpi r16, 0xFF ; 255 169c6: 10 07 cpc r17, r16 169c8: b1 f0 breq .+44 ; 0x169f6 169ca: 01 30 cpi r16, 0x01 ; 1 169cc: 11 05 cpc r17, r1 169ce: 11 f0 breq .+4 ; 0x169d4 } } if (pin_number > -1) { int target = LOW; 169d0: 10 e0 ldi r17, 0x00 ; 0 169d2: 00 e0 ldi r16, 0x00 ; 0 case -1: target = !digitalRead(pin_number); break; } while(digitalRead(pin_number) != target){ 169d4: 8d 2d mov r24, r13 169d6: 0e 94 69 e8 call 0x1d0d2 ; 0x1d0d2 169da: 80 17 cp r24, r16 169dc: 91 07 cpc r25, r17 169de: 11 f4 brne .+4 ; 0x169e4 169e0: 0c 94 05 ab jmp 0x1560a ; 0x1560a manage_heater(); 169e4: 0f 94 2e 38 call 0x2705c ; 0x2705c manage_inactivity(); 169e8: 80 e0 ldi r24, 0x00 ; 0 169ea: 0e 94 c7 8a call 0x1158e ; 0x1158e lcd_update(0); 169ee: 80 e0 ldi r24, 0x00 ; 0 169f0: 0e 94 bf 6e call 0xdd7e ; 0xdd7e 169f4: ef cf rjmp .-34 ; 0x169d4 case 0: target = LOW; break; case -1: target = !digitalRead(pin_number); 169f6: 8e 2d mov r24, r14 169f8: 0e 94 69 e8 call 0x1d0d2 ; 0x1d0d2 169fc: 31 e0 ldi r19, 0x01 ; 1 169fe: 20 e0 ldi r18, 0x00 ; 0 16a00: 89 2b or r24, r25 16a02: 09 f0 breq .+2 ; 0x16a06 16a04: 30 e0 ldi r19, 0x00 ; 0 16a06: 03 2f mov r16, r19 16a08: 12 2f mov r17, r18 16a0a: e4 cf rjmp .-56 ; 0x169d4 - `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; 16a0c: 80 e5 ldi r24, 0x50 ; 80 16a0e: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 16a12: 08 ee ldi r16, 0xE8 ; 232 16a14: 13 e0 ldi r17, 0x03 ; 3 16a16: 88 23 and r24, r24 16a18: 29 f0 breq .+10 ; 0x16a24 16a1a: 0e 94 b5 60 call 0xc16a ; 0xc16a 16a1e: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 16a22: 8b 01 movw r16, r22 uint16_t beepS; if (!code_seen('S')) 16a24: 83 e5 ldi r24, 0x53 ; 83 16a26: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 16a2a: 88 23 and r24, r24 16a2c: 71 f0 breq .+28 ; 0x16a4a beepS = 0; else { beepS = code_value(); 16a2e: 0e 94 b5 60 call 0xc16a ; 0xc16a 16a32: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> if (!beepS) { 16a36: 61 15 cp r22, r1 16a38: 71 05 cpc r23, r1 16a3a: 49 f4 brne .+18 ; 0x16a4e // handle S0 as a pause _delay(beepP); 16a3c: b8 01 movw r22, r16 16a3e: 90 e0 ldi r25, 0x00 ; 0 16a40: 80 e0 ldi r24, 0x00 ; 0 16a42: 0f 94 29 27 call 0x24e52 ; 0x24e52 16a46: 0c 94 05 ab jmp 0x1560a ; 0x1560a case 300: // M300 { uint16_t beepP = code_seen('P') ? code_value() : 1000; uint16_t beepS; if (!code_seen('S')) beepS = 0; 16a4a: 70 e0 ldi r23, 0x00 ; 0 16a4c: 60 e0 ldi r22, 0x00 ; 0 // handle S0 as a pause _delay(beepP); break; } } Sound_MakeCustom(beepP, beepS, false); 16a4e: 40 e0 ldi r20, 0x00 ; 0 16a50: c8 01 movw r24, r16 16a52: 0f 94 01 51 call 0x2a202 ; 0x2a202 16a56: 0c 94 05 ab jmp 0x1560a ; 0x1560a - `I` - integral (Ki) - `D` - derivative (Kd) */ case 301: { if(code_seen('P')) cs.Kp = code_value(); 16a5a: 80 e5 ldi r24, 0x50 ; 80 16a5c: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 16a60: 88 23 and r24, r24 16a62: 51 f0 breq .+20 ; 0x16a78 16a64: 0e 94 b5 60 call 0xc16a ; 0xc16a 16a68: 60 93 25 0e sts 0x0E25, r22 ; 0x800e25 16a6c: 70 93 26 0e sts 0x0E26, r23 ; 0x800e26 16a70: 80 93 27 0e sts 0x0E27, r24 ; 0x800e27 16a74: 90 93 28 0e sts 0x0E28, r25 ; 0x800e28 if(code_seen('I')) cs.Ki = scalePID_i(code_value()); 16a78: 89 e4 ldi r24, 0x49 ; 73 16a7a: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 16a7e: 88 23 and r24, r24 16a80: 81 f0 breq .+32 ; 0x16aa2 16a82: 0e 94 b5 60 call 0xc16a ; 0xc16a 16a86: 2c ea ldi r18, 0xAC ; 172 16a88: 35 ec ldi r19, 0xC5 ; 197 16a8a: 47 e2 ldi r20, 0x27 ; 39 16a8c: 5e e3 ldi r21, 0x3E ; 62 16a8e: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 16a92: 60 93 29 0e sts 0x0E29, r22 ; 0x800e29 16a96: 70 93 2a 0e sts 0x0E2A, r23 ; 0x800e2a 16a9a: 80 93 2b 0e sts 0x0E2B, r24 ; 0x800e2b 16a9e: 90 93 2c 0e sts 0x0E2C, r25 ; 0x800e2c if(code_seen('D')) cs.Kd = scalePID_d(code_value()); 16aa2: 84 e4 ldi r24, 0x44 ; 68 16aa4: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 16aa8: 88 23 and r24, r24 16aaa: 81 f0 breq .+32 ; 0x16acc 16aac: 0e 94 b5 60 call 0xc16a ; 0xc16a } float unscalePID_i(float i) { return i/PID_dT; 16ab0: 2c ea ldi r18, 0xAC ; 172 16ab2: 35 ec ldi r19, 0xC5 ; 197 16ab4: 47 e2 ldi r20, 0x27 ; 39 16ab6: 5e e3 ldi r21, 0x3E ; 62 16ab8: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 16abc: 60 93 2d 0e sts 0x0E2D, r22 ; 0x800e2d 16ac0: 70 93 2e 0e sts 0x0E2E, r23 ; 0x800e2e 16ac4: 80 93 2f 0e sts 0x0E2F, r24 ; 0x800e2f 16ac8: 90 93 30 0e sts 0x0E30, r25 ; 0x800e30 updatePID(); 16acc: 0f 94 a5 3a call 0x2754a ; 0x2754a SERIAL_PROTOCOLRPGM(MSG_OK); 16ad0: 85 ef ldi r24, 0xF5 ; 245 16ad2: 9d e6 ldi r25, 0x6D ; 109 16ad4: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_PROTOCOLPGM(" p:"); 16ad8: 83 e9 ldi r24, 0x93 ; 147 16ada: 96 e8 ldi r25, 0x86 ; 134 16adc: 0e 94 68 77 call 0xeed0 ; 0xeed0 } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 16ae0: 60 91 25 0e lds r22, 0x0E25 ; 0x800e25 16ae4: 70 91 26 0e lds r23, 0x0E26 ; 0x800e26 16ae8: 80 91 27 0e lds r24, 0x0E27 ; 0x800e27 16aec: 90 91 28 0e lds r25, 0x0E28 ; 0x800e28 16af0: 42 e0 ldi r20, 0x02 ; 2 16af2: 0f 94 42 d5 call 0x3aa84 ; 0x3aa84 SERIAL_PROTOCOL(cs.Kp); SERIAL_PROTOCOLPGM(" i:"); 16af6: 8f e8 ldi r24, 0x8F ; 143 16af8: 96 e8 ldi r25, 0x86 ; 134 16afa: 0e 94 68 77 call 0xeed0 ; 0xeed0 16afe: 2c ea ldi r18, 0xAC ; 172 16b00: 35 ec ldi r19, 0xC5 ; 197 16b02: 47 e2 ldi r20, 0x27 ; 39 16b04: 5e e3 ldi r21, 0x3E ; 62 16b06: 60 91 29 0e lds r22, 0x0E29 ; 0x800e29 16b0a: 70 91 2a 0e lds r23, 0x0E2A ; 0x800e2a 16b0e: 80 91 2b 0e lds r24, 0x0E2B ; 0x800e2b 16b12: 90 91 2c 0e lds r25, 0x0E2C ; 0x800e2c 16b16: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 16b1a: 42 e0 ldi r20, 0x02 ; 2 16b1c: 0f 94 42 d5 call 0x3aa84 ; 0x3aa84 SERIAL_PROTOCOL(unscalePID_i(cs.Ki)); SERIAL_PROTOCOLPGM(" d:"); 16b20: 8b e8 ldi r24, 0x8B ; 139 16b22: 96 e8 ldi r25, 0x86 ; 134 16b24: 0e 94 68 77 call 0xeed0 ; 0xeed0 #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 16b28: 2c ea ldi r18, 0xAC ; 172 16b2a: 35 ec ldi r19, 0xC5 ; 197 16b2c: 47 e2 ldi r20, 0x27 ; 39 16b2e: 5e e3 ldi r21, 0x3E ; 62 16b30: 60 91 2d 0e lds r22, 0x0E2D ; 0x800e2d 16b34: 70 91 2e 0e lds r23, 0x0E2E ; 0x800e2e 16b38: 80 91 2f 0e lds r24, 0x0E2F ; 0x800e2f 16b3c: 90 91 30 0e lds r25, 0x0E30 ; 0x800e30 16b40: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> SERIAL_PROTOCOLLN(unscalePID_d(cs.Kd)); 16b44: 0f 94 6f 74 call 0x2e8de ; 0x2e8de 16b48: 0c 94 05 ab jmp 0x1560a ; 0x1560a #### Parameters - `S` - Cold extrude minimum temperature */ case 302: { int temp = 0; 16b4c: 90 e0 ldi r25, 0x00 ; 0 16b4e: 80 e0 ldi r24, 0x00 ; 0 16b50: 0c 94 0a a9 jmp 0x15214 ; 0x15214 case 303: { float temp = 150.0; int e = 0; int c = 5; if (code_seen('E')) e = code_value_short(); 16b54: 85 e4 ldi r24, 0x45 ; 69 16b56: 0e 94 ee 5b call 0xb7dc ; 0xb7dc - `C` - Cycles, default `5` */ case 303: { float temp = 150.0; int e = 0; 16b5a: 10 e0 ldi r17, 0x00 ; 0 16b5c: 00 e0 ldi r16, 0x00 ; 0 int c = 5; if (code_seen('E')) e = code_value_short(); 16b5e: 88 23 and r24, r24 16b60: 59 f0 breq .+22 ; 0x16b78 16b62: 0e 94 8d 5b call 0xb71a ; 0xb71a 16b66: 8c 01 movw r16, r24 if (e < 0) temp = 70; 16b68: c1 2c mov r12, r1 16b6a: d1 2c mov r13, r1 16b6c: ac e8 ldi r26, 0x8C ; 140 16b6e: ea 2e mov r14, r26 16b70: a2 e4 ldi r26, 0x42 ; 66 16b72: fa 2e mov r15, r26 { float temp = 150.0; int e = 0; int c = 5; if (code_seen('E')) e = code_value_short(); if (e < 0) 16b74: 97 fd sbrc r25, 7 16b76: 06 c0 rjmp .+12 ; 0x16b84 - `S` - Target temperature, default `210°C` for hotend, 70 for bed - `C` - Cycles, default `5` */ case 303: { float temp = 150.0; 16b78: c1 2c mov r12, r1 16b7a: d1 2c mov r13, r1 16b7c: b6 e1 ldi r27, 0x16 ; 22 16b7e: eb 2e mov r14, r27 16b80: b3 e4 ldi r27, 0x43 ; 67 16b82: fb 2e mov r15, r27 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(); 16b84: 83 e5 ldi r24, 0x53 ; 83 16b86: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 16b8a: 88 23 and r24, r24 16b8c: 21 f0 breq .+8 ; 0x16b96 16b8e: 0e 94 b5 60 call 0xc16a ; 0xc16a 16b92: 6b 01 movw r12, r22 16b94: 7c 01 movw r14, r24 if (code_seen('C')) c = code_value_short(); 16b96: 83 e4 ldi r24, 0x43 ; 67 16b98: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 16b9c: 88 23 and r24, r24 16b9e: 51 f0 breq .+20 ; 0x16bb4 16ba0: 0e 94 8d 5b call 0xb71a ; 0xb71a PID_autotune(temp, e, c); 16ba4: 9c 01 movw r18, r24 16ba6: a8 01 movw r20, r16 16ba8: c7 01 movw r24, r14 16baa: b6 01 movw r22, r12 16bac: 0f 94 d2 3a call 0x275a4 ; 0x275a4 16bb0: 0c 94 05 ab jmp 0x1560a ; 0x1560a */ case 303: { float temp = 150.0; int e = 0; int c = 5; 16bb4: 85 e0 ldi r24, 0x05 ; 5 16bb6: 90 e0 ldi r25, 0x00 ; 0 16bb8: f5 cf rjmp .-22 ; 0x16ba4 { // parse all parameters float R = NAN, P = NAN, U = NAN, V = NAN, C = NAN, D = NAN, T = NAN, W = NAN, E = NAN; int8_t I = -1, S = -1, B = -1, F = -1; int16_t A = -1, L = -1; if(code_seen('I')) I = code_value_short(); 16bba: 89 e4 ldi r24, 0x49 ; 73 16bbc: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 16bc0: 88 23 and r24, r24 16bc2: 09 f4 brne .+2 ; 0x16bc6 16bc4: 30 c2 rjmp .+1120 ; 0x17026 16bc6: 0e 94 8d 5b call 0xb71a ; 0xb71a 16bca: ab 96 adiw r28, 0x2b ; 43 16bcc: 8f af std Y+63, r24 ; 0x3f 16bce: ab 97 sbiw r28, 0x2b ; 43 if(code_seen('R')) R = code_value(); 16bd0: 82 e5 ldi r24, 0x52 ; 82 16bd2: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 16bd6: 88 23 and r24, r24 16bd8: 09 f4 brne .+2 ; 0x16bdc 16bda: 2a c2 rjmp .+1108 ; 0x17030 16bdc: 0e 94 b5 60 call 0xc16a ; 0xc16a 16be0: e2 96 adiw r28, 0x32 ; 50 16be2: 6c af std Y+60, r22 ; 0x3c 16be4: 7d af std Y+61, r23 ; 0x3d 16be6: 8e af std Y+62, r24 ; 0x3e 16be8: 9f af std Y+63, r25 ; 0x3f 16bea: e2 97 sbiw r28, 0x32 ; 50 if(code_seen('P')) P = code_value(); 16bec: 80 e5 ldi r24, 0x50 ; 80 16bee: 0e 94 ee 5b call 0xb7dc ; 0xb7dc - `F` - force model self-test state (0=off 1=on) during autotune using current values */ case 310: { // parse all parameters float R = NAN, P = NAN, U = NAN, V = NAN, C = NAN, D = NAN, T = NAN, W = NAN, E = NAN; 16bf2: c1 2c mov r12, r1 16bf4: d1 2c mov r13, r1 16bf6: f0 ec ldi r31, 0xC0 ; 192 16bf8: ef 2e mov r14, r31 16bfa: ff e7 ldi r31, 0x7F ; 127 16bfc: ff 2e mov r15, r31 int8_t I = -1, S = -1, B = -1, F = -1; int16_t A = -1, L = -1; if(code_seen('I')) I = code_value_short(); if(code_seen('R')) R = code_value(); if(code_seen('P')) P = code_value(); 16bfe: 88 23 and r24, r24 16c00: 21 f0 breq .+8 ; 0x16c0a 16c02: 0e 94 b5 60 call 0xc16a ; 0xc16a 16c06: 6b 01 movw r12, r22 16c08: 7c 01 movw r14, r24 if(code_seen('U')) U = code_value(); 16c0a: 85 e5 ldi r24, 0x55 ; 85 16c0c: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 16c10: 88 23 and r24, r24 16c12: 09 f4 brne .+2 ; 0x16c16 16c14: 18 c2 rjmp .+1072 ; 0x17046 16c16: 0e 94 b5 60 call 0xc16a ; 0xc16a 16c1a: 6e 96 adiw r28, 0x1e ; 30 16c1c: 6c af std Y+60, r22 ; 0x3c 16c1e: 7d af std Y+61, r23 ; 0x3d 16c20: 8e af std Y+62, r24 ; 0x3e 16c22: 9f af std Y+63, r25 ; 0x3f 16c24: 6e 97 sbiw r28, 0x1e ; 30 if(code_seen('V')) V = code_value(); 16c26: 86 e5 ldi r24, 0x56 ; 86 16c28: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 16c2c: 88 23 and r24, r24 16c2e: 09 f4 brne .+2 ; 0x16c32 16c30: 15 c2 rjmp .+1066 ; 0x1705c 16c32: 0e 94 b5 60 call 0xc16a ; 0xc16a 16c36: a2 96 adiw r28, 0x22 ; 34 16c38: 6c af std Y+60, r22 ; 0x3c 16c3a: 7d af std Y+61, r23 ; 0x3d 16c3c: 8e af std Y+62, r24 ; 0x3e 16c3e: 9f af std Y+63, r25 ; 0x3f 16c40: a2 97 sbiw r28, 0x22 ; 34 if(code_seen('C')) C = code_value(); 16c42: 83 e4 ldi r24, 0x43 ; 67 16c44: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 16c48: 88 23 and r24, r24 16c4a: 09 f4 brne .+2 ; 0x16c4e 16c4c: 12 c2 rjmp .+1060 ; 0x17072 16c4e: 0e 94 b5 60 call 0xc16a ; 0xc16a 16c52: 6a 96 adiw r28, 0x1a ; 26 16c54: 6c af std Y+60, r22 ; 0x3c 16c56: 7d af std Y+61, r23 ; 0x3d 16c58: 8e af std Y+62, r24 ; 0x3e 16c5a: 9f af std Y+63, r25 ; 0x3f 16c5c: 6a 97 sbiw r28, 0x1a ; 26 if(code_seen('D')) D = code_value(); 16c5e: 84 e4 ldi r24, 0x44 ; 68 16c60: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 16c64: 88 23 and r24, r24 16c66: 09 f4 brne .+2 ; 0x16c6a 16c68: 0f c2 rjmp .+1054 ; 0x17088 16c6a: 0e 94 b5 60 call 0xc16a ; 0xc16a 16c6e: aa 96 adiw r28, 0x2a ; 42 16c70: 6c af std Y+60, r22 ; 0x3c 16c72: 7d af std Y+61, r23 ; 0x3d 16c74: 8e af std Y+62, r24 ; 0x3e 16c76: 9f af std Y+63, r25 ; 0x3f 16c78: aa 97 sbiw r28, 0x2a ; 42 if(code_seen('L')) L = code_value_short(); 16c7a: 8c e4 ldi r24, 0x4C ; 76 16c7c: 0e 94 ee 5b call 0xb7dc ; 0xb7dc case 310: { // parse all parameters float R = NAN, P = NAN, U = NAN, V = NAN, C = NAN, D = NAN, T = NAN, W = NAN, E = NAN; int8_t I = -1, S = -1, B = -1, F = -1; int16_t A = -1, L = -1; 16c80: 0f ef ldi r16, 0xFF ; 255 16c82: 1f ef ldi r17, 0xFF ; 255 if(code_seen('P')) P = code_value(); if(code_seen('U')) U = code_value(); if(code_seen('V')) V = code_value(); if(code_seen('C')) C = code_value(); if(code_seen('D')) D = code_value(); if(code_seen('L')) L = code_value_short(); 16c84: 88 23 and r24, r24 16c86: 19 f0 breq .+6 ; 0x16c8e 16c88: 0e 94 8d 5b call 0xb71a ; 0xb71a 16c8c: 8c 01 movw r16, r24 if(code_seen('S')) S = code_value_short(); 16c8e: 83 e5 ldi r24, 0x53 ; 83 16c90: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 16c94: 88 23 and r24, r24 16c96: 09 f4 brne .+2 ; 0x16c9a 16c98: 02 c2 rjmp .+1028 ; 0x1709e 16c9a: 0e 94 8d 5b call 0xb71a ; 0xb71a 16c9e: e3 96 adiw r28, 0x33 ; 51 16ca0: 8f af std Y+63, r24 ; 0x3f 16ca2: e3 97 sbiw r28, 0x33 ; 51 if(code_seen('B')) B = code_value_short(); 16ca4: 82 e4 ldi r24, 0x42 ; 66 16ca6: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 16caa: 88 23 and r24, r24 16cac: 09 f4 brne .+2 ; 0x16cb0 16cae: fc c1 rjmp .+1016 ; 0x170a8 16cb0: 0e 94 8d 5b call 0xb71a ; 0xb71a 16cb4: e7 96 adiw r28, 0x37 ; 55 16cb6: 8f af std Y+63, r24 ; 0x3f 16cb8: e7 97 sbiw r28, 0x37 ; 55 if(code_seen('T')) T = code_value(); 16cba: 84 e5 ldi r24, 0x54 ; 84 16cbc: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 16cc0: 88 23 and r24, r24 16cc2: 09 f4 brne .+2 ; 0x16cc6 16cc4: f6 c1 rjmp .+1004 ; 0x170b2 16cc6: 0e 94 b5 60 call 0xc16a ; 0xc16a 16cca: a6 96 adiw r28, 0x26 ; 38 16ccc: 6c af std Y+60, r22 ; 0x3c 16cce: 7d af std Y+61, r23 ; 0x3d 16cd0: 8e af std Y+62, r24 ; 0x3e 16cd2: 9f af std Y+63, r25 ; 0x3f 16cd4: a6 97 sbiw r28, 0x26 ; 38 if(code_seen('E')) E = code_value(); 16cd6: 85 e4 ldi r24, 0x45 ; 69 16cd8: 0e 94 ee 5b call 0xb7dc ; 0xb7dc - `F` - force model self-test state (0=off 1=on) during autotune using current values */ case 310: { // parse all parameters float R = NAN, P = NAN, U = NAN, V = NAN, C = NAN, D = NAN, T = NAN, W = NAN, E = NAN; 16cdc: 41 2c mov r4, r1 16cde: 51 2c mov r5, r1 16ce0: e0 ec ldi r30, 0xC0 ; 192 16ce2: 6e 2e mov r6, r30 16ce4: ef e7 ldi r30, 0x7F ; 127 16ce6: 7e 2e mov r7, r30 if(code_seen('D')) D = code_value(); if(code_seen('L')) L = code_value_short(); if(code_seen('S')) S = code_value_short(); if(code_seen('B')) B = code_value_short(); if(code_seen('T')) T = code_value(); if(code_seen('E')) E = code_value(); 16ce8: 88 23 and r24, r24 16cea: 21 f0 breq .+8 ; 0x16cf4 16cec: 0e 94 b5 60 call 0xc16a ; 0xc16a 16cf0: 2b 01 movw r4, r22 16cf2: 3c 01 movw r6, r24 if(code_seen('W')) W = code_value(); 16cf4: 87 e5 ldi r24, 0x57 ; 87 16cf6: 0e 94 ee 5b call 0xb7dc ; 0xb7dc - `F` - force model self-test state (0=off 1=on) during autotune using current values */ case 310: { // parse all parameters float R = NAN, P = NAN, U = NAN, V = NAN, C = NAN, D = NAN, T = NAN, W = NAN, E = NAN; 16cfa: 81 2c mov r8, r1 16cfc: 91 2c mov r9, r1 16cfe: 70 ec ldi r23, 0xC0 ; 192 16d00: a7 2e mov r10, r23 16d02: 7f e7 ldi r23, 0x7F ; 127 16d04: b7 2e mov r11, r23 if(code_seen('L')) L = code_value_short(); if(code_seen('S')) S = code_value_short(); if(code_seen('B')) B = code_value_short(); if(code_seen('T')) T = code_value(); if(code_seen('E')) E = code_value(); if(code_seen('W')) W = code_value(); 16d06: 88 23 and r24, r24 16d08: 21 f0 breq .+8 ; 0x16d12 16d0a: 0e 94 b5 60 call 0xc16a ; 0xc16a 16d0e: 4b 01 movw r8, r22 16d10: 5c 01 movw r10, r24 if(code_seen('A')) A = code_value_short(); 16d12: 81 e4 ldi r24, 0x41 ; 65 16d14: 0e 94 ee 5b call 0xb7dc ; 0xb7dc case 310: { // parse all parameters float R = NAN, P = NAN, U = NAN, V = NAN, C = NAN, D = NAN, T = NAN, W = NAN, E = NAN; int8_t I = -1, S = -1, B = -1, F = -1; int16_t A = -1, L = -1; 16d18: 22 24 eor r2, r2 16d1a: 2a 94 dec r2 16d1c: 32 2c mov r3, r2 if(code_seen('S')) S = code_value_short(); if(code_seen('B')) B = code_value_short(); if(code_seen('T')) T = code_value(); if(code_seen('E')) E = code_value(); if(code_seen('W')) W = code_value(); if(code_seen('A')) A = code_value_short(); 16d1e: 88 23 and r24, r24 16d20: 19 f0 breq .+6 ; 0x16d28 16d22: 0e 94 8d 5b call 0xb71a ; 0xb71a 16d26: 1c 01 movw r2, r24 if(code_seen('F')) F = code_value_short(); 16d28: 86 e4 ldi r24, 0x46 ; 70 16d2a: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 16d2e: 88 23 and r24, r24 16d30: 09 f4 brne .+2 ; 0x16d34 16d32: ca c1 rjmp .+916 ; 0x170c8 16d34: 0e 94 8d 5b call 0xb71a ; 0xb71a 16d38: eb 96 adiw r28, 0x3b ; 59 16d3a: 8f af std Y+63, r24 ; 0x3f 16d3c: eb 97 sbiw r28, 0x3b ; 59 // report values if nothing has been requested if(isnan(R) && isnan(P) && isnan(U) && isnan(V) && isnan(C) && isnan(D) && isnan(T) && isnan(W) && isnan(E) 16d3e: e2 96 adiw r28, 0x32 ; 50 16d40: 2c ad ldd r18, Y+60 ; 0x3c 16d42: 3d ad ldd r19, Y+61 ; 0x3d 16d44: 4e ad ldd r20, Y+62 ; 0x3e 16d46: 5f ad ldd r21, Y+63 ; 0x3f 16d48: e2 97 sbiw r28, 0x32 ; 50 16d4a: ca 01 movw r24, r20 16d4c: b9 01 movw r22, r18 16d4e: 0f 94 0d e1 call 0x3c21a ; 0x3c21a <__unordsf2> 16d52: 88 23 and r24, r24 16d54: 09 f4 brne .+2 ; 0x16d58 16d56: c1 c1 rjmp .+898 ; 0x170da 16d58: a7 01 movw r20, r14 16d5a: 96 01 movw r18, r12 16d5c: c7 01 movw r24, r14 16d5e: b6 01 movw r22, r12 16d60: 0f 94 0d e1 call 0x3c21a ; 0x3c21a <__unordsf2> 16d64: 88 23 and r24, r24 16d66: 09 f4 brne .+2 ; 0x16d6a 16d68: b8 c1 rjmp .+880 ; 0x170da 16d6a: 6e 96 adiw r28, 0x1e ; 30 16d6c: 2c ad ldd r18, Y+60 ; 0x3c 16d6e: 3d ad ldd r19, Y+61 ; 0x3d 16d70: 4e ad ldd r20, Y+62 ; 0x3e 16d72: 5f ad ldd r21, Y+63 ; 0x3f 16d74: 6e 97 sbiw r28, 0x1e ; 30 16d76: ca 01 movw r24, r20 16d78: b9 01 movw r22, r18 16d7a: 0f 94 0d e1 call 0x3c21a ; 0x3c21a <__unordsf2> 16d7e: 88 23 and r24, r24 16d80: 09 f4 brne .+2 ; 0x16d84 16d82: ab c1 rjmp .+854 ; 0x170da 16d84: a2 96 adiw r28, 0x22 ; 34 16d86: 2c ad ldd r18, Y+60 ; 0x3c 16d88: 3d ad ldd r19, Y+61 ; 0x3d 16d8a: 4e ad ldd r20, Y+62 ; 0x3e 16d8c: 5f ad ldd r21, Y+63 ; 0x3f 16d8e: a2 97 sbiw r28, 0x22 ; 34 16d90: ca 01 movw r24, r20 16d92: b9 01 movw r22, r18 16d94: 0f 94 0d e1 call 0x3c21a ; 0x3c21a <__unordsf2> 16d98: 88 23 and r24, r24 16d9a: 09 f4 brne .+2 ; 0x16d9e 16d9c: 9e c1 rjmp .+828 ; 0x170da 16d9e: 6a 96 adiw r28, 0x1a ; 26 16da0: 2c ad ldd r18, Y+60 ; 0x3c 16da2: 3d ad ldd r19, Y+61 ; 0x3d 16da4: 4e ad ldd r20, Y+62 ; 0x3e 16da6: 5f ad ldd r21, Y+63 ; 0x3f 16da8: 6a 97 sbiw r28, 0x1a ; 26 16daa: ca 01 movw r24, r20 16dac: b9 01 movw r22, r18 16dae: 0f 94 0d e1 call 0x3c21a ; 0x3c21a <__unordsf2> 16db2: 88 23 and r24, r24 16db4: 09 f4 brne .+2 ; 0x16db8 16db6: 91 c1 rjmp .+802 ; 0x170da 16db8: aa 96 adiw r28, 0x2a ; 42 16dba: 2c ad ldd r18, Y+60 ; 0x3c 16dbc: 3d ad ldd r19, Y+61 ; 0x3d 16dbe: 4e ad ldd r20, Y+62 ; 0x3e 16dc0: 5f ad ldd r21, Y+63 ; 0x3f 16dc2: aa 97 sbiw r28, 0x2a ; 42 16dc4: ca 01 movw r24, r20 16dc6: b9 01 movw r22, r18 16dc8: 0f 94 0d e1 call 0x3c21a ; 0x3c21a <__unordsf2> 16dcc: 88 23 and r24, r24 16dce: 09 f4 brne .+2 ; 0x16dd2 16dd0: 84 c1 rjmp .+776 ; 0x170da 16dd2: a6 96 adiw r28, 0x26 ; 38 16dd4: 2c ad ldd r18, Y+60 ; 0x3c 16dd6: 3d ad ldd r19, Y+61 ; 0x3d 16dd8: 4e ad ldd r20, Y+62 ; 0x3e 16dda: 5f ad ldd r21, Y+63 ; 0x3f 16ddc: a6 97 sbiw r28, 0x26 ; 38 16dde: ca 01 movw r24, r20 16de0: b9 01 movw r22, r18 16de2: 0f 94 0d e1 call 0x3c21a ; 0x3c21a <__unordsf2> 16de6: 88 23 and r24, r24 16de8: 09 f4 brne .+2 ; 0x16dec 16dea: 77 c1 rjmp .+750 ; 0x170da 16dec: a5 01 movw r20, r10 16dee: 94 01 movw r18, r8 16df0: c5 01 movw r24, r10 16df2: b4 01 movw r22, r8 16df4: 0f 94 0d e1 call 0x3c21a ; 0x3c21a <__unordsf2> 16df8: 88 23 and r24, r24 16dfa: 09 f4 brne .+2 ; 0x16dfe 16dfc: 6e c1 rjmp .+732 ; 0x170da 16dfe: a3 01 movw r20, r6 16e00: 92 01 movw r18, r4 16e02: c3 01 movw r24, r6 16e04: b2 01 movw r22, r4 16e06: 0f 94 0d e1 call 0x3c21a ; 0x3c21a <__unordsf2> 16e0a: 88 23 and r24, r24 16e0c: 09 f4 brne .+2 ; 0x16e10 16e0e: 65 c1 rjmp .+714 ; 0x170da && I < 0 && S < 0 && B < 0 && A < 0 && L < 0) { 16e10: ab 96 adiw r28, 0x2b ; 43 16e12: 4f ad ldd r20, Y+63 ; 0x3f 16e14: ab 97 sbiw r28, 0x2b ; 43 16e16: 47 ff sbrs r20, 7 16e18: 60 c1 rjmp .+704 ; 0x170da 16e1a: e3 96 adiw r28, 0x33 ; 51 16e1c: 5f ad ldd r21, Y+63 ; 0x3f 16e1e: e3 97 sbiw r28, 0x33 ; 51 16e20: 57 ff sbrs r21, 7 16e22: 5b c1 rjmp .+694 ; 0x170da 16e24: e7 96 adiw r28, 0x37 ; 55 16e26: 8f ad ldd r24, Y+63 ; 0x3f 16e28: e7 97 sbiw r28, 0x37 ; 55 16e2a: 87 ff sbrs r24, 7 16e2c: 5b c1 rjmp .+694 ; 0x170e4 16e2e: 37 fe sbrs r3, 7 16e30: 9f c1 rjmp .+830 ; 0x17170 16e32: 17 fd sbrc r17, 7 16e34: 4e c1 rjmp .+668 ; 0x170d2 thermal_model::data.L = samples * intv_ms; } void thermal_model_set_params(float P, float U, float V, float C, float D, int16_t L, float Ta_corr, float warn, float err) { TempMgrGuard temp_mgr_guard; 16e36: ce 01 movw r24, r28 16e38: 01 96 adiw r24, 0x01 ; 1 16e3a: 0f 94 70 31 call 0x262e0 ; 0x262e0 if(!isnan(P) && P > 0) thermal_model::data.P = P; 16e3e: a7 01 movw r20, r14 16e40: 96 01 movw r18, r12 16e42: c7 01 movw r24, r14 16e44: b6 01 movw r22, r12 16e46: 0f 94 0d e1 call 0x3c21a ; 0x3c21a <__unordsf2> 16e4a: 88 23 and r24, r24 16e4c: 09 f4 brne .+2 ; 0x16e50 16e4e: 31 c2 rjmp .+1122 ; 0x172b2 if(!isnan(U)) thermal_model::data.U = U; 16e50: 6e 96 adiw r28, 0x1e ; 30 16e52: 2c ad ldd r18, Y+60 ; 0x3c 16e54: 3d ad ldd r19, Y+61 ; 0x3d 16e56: 4e ad ldd r20, Y+62 ; 0x3e 16e58: 5f ad ldd r21, Y+63 ; 0x3f 16e5a: 6e 97 sbiw r28, 0x1e ; 30 16e5c: ca 01 movw r24, r20 16e5e: b9 01 movw r22, r18 16e60: 0f 94 0d e1 call 0x3c21a ; 0x3c21a <__unordsf2> 16e64: 81 11 cpse r24, r1 16e66: 0e c0 rjmp .+28 ; 0x16e84 16e68: 6e 96 adiw r28, 0x1e ; 30 16e6a: 2c ad ldd r18, Y+60 ; 0x3c 16e6c: 3d ad ldd r19, Y+61 ; 0x3d 16e6e: 4e ad ldd r20, Y+62 ; 0x3e 16e70: 5f ad ldd r21, Y+63 ; 0x3f 16e72: 6e 97 sbiw r28, 0x1e ; 30 16e74: 20 93 dd 12 sts 0x12DD, r18 ; 0x8012dd <_ZN13thermal_modelL4dataE.lto_priv.400+0x2e> 16e78: 30 93 de 12 sts 0x12DE, r19 ; 0x8012de <_ZN13thermal_modelL4dataE.lto_priv.400+0x2f> 16e7c: 40 93 df 12 sts 0x12DF, r20 ; 0x8012df <_ZN13thermal_modelL4dataE.lto_priv.400+0x30> 16e80: 50 93 e0 12 sts 0x12E0, r21 ; 0x8012e0 <_ZN13thermal_modelL4dataE.lto_priv.400+0x31> if(!isnan(V)) thermal_model::data.V = V; 16e84: a2 96 adiw r28, 0x22 ; 34 16e86: 2c ad ldd r18, Y+60 ; 0x3c 16e88: 3d ad ldd r19, Y+61 ; 0x3d 16e8a: 4e ad ldd r20, Y+62 ; 0x3e 16e8c: 5f ad ldd r21, Y+63 ; 0x3f 16e8e: a2 97 sbiw r28, 0x22 ; 34 16e90: ca 01 movw r24, r20 16e92: b9 01 movw r22, r18 16e94: 0f 94 0d e1 call 0x3c21a ; 0x3c21a <__unordsf2> 16e98: 81 11 cpse r24, r1 16e9a: 0e c0 rjmp .+28 ; 0x16eb8 16e9c: a2 96 adiw r28, 0x22 ; 34 16e9e: 8c ad ldd r24, Y+60 ; 0x3c 16ea0: 9d ad ldd r25, Y+61 ; 0x3d 16ea2: ae ad ldd r26, Y+62 ; 0x3e 16ea4: bf ad ldd r27, Y+63 ; 0x3f 16ea6: a2 97 sbiw r28, 0x22 ; 34 16ea8: 80 93 e1 12 sts 0x12E1, r24 ; 0x8012e1 <_ZN13thermal_modelL4dataE.lto_priv.400+0x32> 16eac: 90 93 e2 12 sts 0x12E2, r25 ; 0x8012e2 <_ZN13thermal_modelL4dataE.lto_priv.400+0x33> 16eb0: a0 93 e3 12 sts 0x12E3, r26 ; 0x8012e3 <_ZN13thermal_modelL4dataE.lto_priv.400+0x34> 16eb4: b0 93 e4 12 sts 0x12E4, r27 ; 0x8012e4 <_ZN13thermal_modelL4dataE.lto_priv.400+0x35> if(!isnan(C) && C > 0) thermal_model::data.C = C; 16eb8: 6a 96 adiw r28, 0x1a ; 26 16eba: 2c ad ldd r18, Y+60 ; 0x3c 16ebc: 3d ad ldd r19, Y+61 ; 0x3d 16ebe: 4e ad ldd r20, Y+62 ; 0x3e 16ec0: 5f ad ldd r21, Y+63 ; 0x3f 16ec2: 6a 97 sbiw r28, 0x1a ; 26 16ec4: ca 01 movw r24, r20 16ec6: b9 01 movw r22, r18 16ec8: 0f 94 0d e1 call 0x3c21a ; 0x3c21a <__unordsf2> 16ecc: 81 11 cpse r24, r1 16ece: 1b c0 rjmp .+54 ; 0x16f06 16ed0: 20 e0 ldi r18, 0x00 ; 0 16ed2: 30 e0 ldi r19, 0x00 ; 0 16ed4: a9 01 movw r20, r18 16ed6: 6a 96 adiw r28, 0x1a ; 26 16ed8: 6c ad ldd r22, Y+60 ; 0x3c 16eda: 7d ad ldd r23, Y+61 ; 0x3d 16edc: 8e ad ldd r24, Y+62 ; 0x3e 16ede: 9f ad ldd r25, Y+63 ; 0x3f 16ee0: 6a 97 sbiw r28, 0x1a ; 26 16ee2: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 16ee6: 18 16 cp r1, r24 16ee8: 74 f4 brge .+28 ; 0x16f06 16eea: 6a 96 adiw r28, 0x1a ; 26 16eec: 2c ad ldd r18, Y+60 ; 0x3c 16eee: 3d ad ldd r19, Y+61 ; 0x3d 16ef0: 4e ad ldd r20, Y+62 ; 0x3e 16ef2: 5f ad ldd r21, Y+63 ; 0x3f 16ef4: 6a 97 sbiw r28, 0x1a ; 26 16ef6: 20 93 e5 12 sts 0x12E5, r18 ; 0x8012e5 <_ZN13thermal_modelL4dataE.lto_priv.400+0x36> 16efa: 30 93 e6 12 sts 0x12E6, r19 ; 0x8012e6 <_ZN13thermal_modelL4dataE.lto_priv.400+0x37> 16efe: 40 93 e7 12 sts 0x12E7, r20 ; 0x8012e7 <_ZN13thermal_modelL4dataE.lto_priv.400+0x38> 16f02: 50 93 e8 12 sts 0x12E8, r21 ; 0x8012e8 <_ZN13thermal_modelL4dataE.lto_priv.400+0x39> if(!isnan(D)) thermal_model::data.fS = D; 16f06: aa 96 adiw r28, 0x2a ; 42 16f08: 2c ad ldd r18, Y+60 ; 0x3c 16f0a: 3d ad ldd r19, Y+61 ; 0x3d 16f0c: 4e ad ldd r20, Y+62 ; 0x3e 16f0e: 5f ad ldd r21, Y+63 ; 0x3f 16f10: aa 97 sbiw r28, 0x2a ; 42 16f12: ca 01 movw r24, r20 16f14: b9 01 movw r22, r18 16f16: 0f 94 0d e1 call 0x3c21a ; 0x3c21a <__unordsf2> 16f1a: 81 11 cpse r24, r1 16f1c: 0e c0 rjmp .+28 ; 0x16f3a 16f1e: aa 96 adiw r28, 0x2a ; 42 16f20: 8c ad ldd r24, Y+60 ; 0x3c 16f22: 9d ad ldd r25, Y+61 ; 0x3d 16f24: ae ad ldd r26, Y+62 ; 0x3e 16f26: bf ad ldd r27, Y+63 ; 0x3f 16f28: aa 97 sbiw r28, 0x2a ; 42 16f2a: 80 93 e9 12 sts 0x12E9, r24 ; 0x8012e9 <_ZN13thermal_modelL4dataE.lto_priv.400+0x3a> 16f2e: 90 93 ea 12 sts 0x12EA, r25 ; 0x8012ea <_ZN13thermal_modelL4dataE.lto_priv.400+0x3b> 16f32: a0 93 eb 12 sts 0x12EB, r26 ; 0x8012eb <_ZN13thermal_modelL4dataE.lto_priv.400+0x3c> 16f36: b0 93 ec 12 sts 0x12EC, r27 ; 0x8012ec <_ZN13thermal_modelL4dataE.lto_priv.400+0x3d> if(L >= 0) thermal_model_set_lag(L); 16f3a: 17 fd sbrc r17, 7 16f3c: 03 c0 rjmp .+6 ; 0x16f44 16f3e: c8 01 movw r24, r16 16f40: 0f 94 58 2e call 0x25cb0 ; 0x25cb0 if(!isnan(Ta_corr)) thermal_model::data.Ta_corr = Ta_corr; 16f44: a6 96 adiw r28, 0x26 ; 38 16f46: 2c ad ldd r18, Y+60 ; 0x3c 16f48: 3d ad ldd r19, Y+61 ; 0x3d 16f4a: 4e ad ldd r20, Y+62 ; 0x3e 16f4c: 5f ad ldd r21, Y+63 ; 0x3f 16f4e: a6 97 sbiw r28, 0x26 ; 38 16f50: ca 01 movw r24, r20 16f52: b9 01 movw r22, r18 16f54: 0f 94 0d e1 call 0x3c21a ; 0x3c21a <__unordsf2> 16f58: 81 11 cpse r24, r1 16f5a: 0e c0 rjmp .+28 ; 0x16f78 16f5c: a6 96 adiw r28, 0x26 ; 38 16f5e: 2c ad ldd r18, Y+60 ; 0x3c 16f60: 3d ad ldd r19, Y+61 ; 0x3d 16f62: 4e ad ldd r20, Y+62 ; 0x3e 16f64: 5f ad ldd r21, Y+63 ; 0x3f 16f66: a6 97 sbiw r28, 0x26 ; 38 16f68: 20 93 2f 13 sts 0x132F, r18 ; 0x80132f <_ZN13thermal_modelL4dataE.lto_priv.400+0x80> 16f6c: 30 93 30 13 sts 0x1330, r19 ; 0x801330 <_ZN13thermal_modelL4dataE.lto_priv.400+0x81> 16f70: 40 93 31 13 sts 0x1331, r20 ; 0x801331 <_ZN13thermal_modelL4dataE.lto_priv.400+0x82> 16f74: 50 93 32 13 sts 0x1332, r21 ; 0x801332 <_ZN13thermal_modelL4dataE.lto_priv.400+0x83> if(!isnan(warn) && warn > 0) thermal_model::data.warn = warn; 16f78: a5 01 movw r20, r10 16f7a: 94 01 movw r18, r8 16f7c: c5 01 movw r24, r10 16f7e: b4 01 movw r22, r8 16f80: 0f 94 0d e1 call 0x3c21a ; 0x3c21a <__unordsf2> 16f84: 81 11 cpse r24, r1 16f86: 11 c0 rjmp .+34 ; 0x16faa 16f88: 20 e0 ldi r18, 0x00 ; 0 16f8a: 30 e0 ldi r19, 0x00 ; 0 16f8c: a9 01 movw r20, r18 16f8e: c5 01 movw r24, r10 16f90: b4 01 movw r22, r8 16f92: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 16f96: 18 16 cp r1, r24 16f98: 44 f4 brge .+16 ; 0x16faa 16f9a: 80 92 33 13 sts 0x1333, r8 ; 0x801333 <_ZN13thermal_modelL4dataE.lto_priv.400+0x84> 16f9e: 90 92 34 13 sts 0x1334, r9 ; 0x801334 <_ZN13thermal_modelL4dataE.lto_priv.400+0x85> 16fa2: a0 92 35 13 sts 0x1335, r10 ; 0x801335 <_ZN13thermal_modelL4dataE.lto_priv.400+0x86> 16fa6: b0 92 36 13 sts 0x1336, r11 ; 0x801336 <_ZN13thermal_modelL4dataE.lto_priv.400+0x87> if(!isnan(err) && err > 0) thermal_model::data.err = err; 16faa: a3 01 movw r20, r6 16fac: 92 01 movw r18, r4 16fae: c3 01 movw r24, r6 16fb0: b2 01 movw r22, r4 16fb2: 0f 94 0d e1 call 0x3c21a ; 0x3c21a <__unordsf2> 16fb6: 81 11 cpse r24, r1 16fb8: 11 c0 rjmp .+34 ; 0x16fdc 16fba: 20 e0 ldi r18, 0x00 ; 0 16fbc: 30 e0 ldi r19, 0x00 ; 0 16fbe: a9 01 movw r20, r18 16fc0: c3 01 movw r24, r6 16fc2: b2 01 movw r22, r4 16fc4: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 16fc8: 18 16 cp r1, r24 16fca: 44 f4 brge .+16 ; 0x16fdc 16fcc: 40 92 37 13 sts 0x1337, r4 ; 0x801337 <_ZN13thermal_modelL4dataE.lto_priv.400+0x88> 16fd0: 50 92 38 13 sts 0x1338, r5 ; 0x801338 <_ZN13thermal_modelL4dataE.lto_priv.400+0x89> 16fd4: 60 92 39 13 sts 0x1339, r6 ; 0x801339 <_ZN13thermal_modelL4dataE.lto_priv.400+0x8a> 16fd8: 70 92 3a 13 sts 0x133A, r7 ; 0x80133a <_ZN13thermal_modelL4dataE.lto_priv.400+0x8b> // ensure warn <= err if (thermal_model::data.warn > thermal_model::data.err) 16fdc: c0 90 37 13 lds r12, 0x1337 ; 0x801337 <_ZN13thermal_modelL4dataE.lto_priv.400+0x88> 16fe0: d0 90 38 13 lds r13, 0x1338 ; 0x801338 <_ZN13thermal_modelL4dataE.lto_priv.400+0x89> 16fe4: e0 90 39 13 lds r14, 0x1339 ; 0x801339 <_ZN13thermal_modelL4dataE.lto_priv.400+0x8a> 16fe8: f0 90 3a 13 lds r15, 0x133A ; 0x80133a <_ZN13thermal_modelL4dataE.lto_priv.400+0x8b> 16fec: a7 01 movw r20, r14 16fee: 96 01 movw r18, r12 16ff0: 60 91 33 13 lds r22, 0x1333 ; 0x801333 <_ZN13thermal_modelL4dataE.lto_priv.400+0x84> 16ff4: 70 91 34 13 lds r23, 0x1334 ; 0x801334 <_ZN13thermal_modelL4dataE.lto_priv.400+0x85> 16ff8: 80 91 35 13 lds r24, 0x1335 ; 0x801335 <_ZN13thermal_modelL4dataE.lto_priv.400+0x86> 16ffc: 90 91 36 13 lds r25, 0x1336 ; 0x801336 <_ZN13thermal_modelL4dataE.lto_priv.400+0x87> 17000: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 17004: 18 16 cp r1, r24 17006: 44 f4 brge .+16 ; 0x17018 thermal_model::data.warn = thermal_model::data.err; 17008: c0 92 33 13 sts 0x1333, r12 ; 0x801333 <_ZN13thermal_modelL4dataE.lto_priv.400+0x84> 1700c: d0 92 34 13 sts 0x1334, r13 ; 0x801334 <_ZN13thermal_modelL4dataE.lto_priv.400+0x85> 17010: e0 92 35 13 sts 0x1335, r14 ; 0x801335 <_ZN13thermal_modelL4dataE.lto_priv.400+0x86> 17014: f0 92 36 13 sts 0x1336, r15 ; 0x801336 <_ZN13thermal_modelL4dataE.lto_priv.400+0x87> thermal_model::setup(); 17018: 0f 94 df 2e call 0x25dbe ; 0x25dbe thermal_model::data.L = samples * intv_ms; } void thermal_model_set_params(float P, float U, float V, float C, float D, int16_t L, float Ta_corr, float warn, float err) { TempMgrGuard temp_mgr_guard; 1701c: ce 01 movw r24, r28 1701e: 01 96 adiw r24, 0x01 ; 1 17020: 0f 94 63 31 call 0x262c6 ; 0x262c6 17024: c8 c0 rjmp .+400 ; 0x171b6 */ case 310: { // parse all parameters float R = NAN, P = NAN, U = NAN, V = NAN, C = NAN, D = NAN, T = NAN, W = NAN, E = NAN; int8_t I = -1, S = -1, B = -1, F = -1; 17026: 4f ef ldi r20, 0xFF ; 255 17028: ab 96 adiw r28, 0x2b ; 43 1702a: 4f af std Y+63, r20 ; 0x3f 1702c: ab 97 sbiw r28, 0x2b ; 43 1702e: d0 cd rjmp .-1120 ; 0x16bd0 - `F` - force model self-test state (0=off 1=on) during autotune using current values */ case 310: { // parse all parameters float R = NAN, P = NAN, U = NAN, V = NAN, C = NAN, D = NAN, T = NAN, W = NAN, E = NAN; 17030: 80 e0 ldi r24, 0x00 ; 0 17032: 90 e0 ldi r25, 0x00 ; 0 17034: a0 ec ldi r26, 0xC0 ; 192 17036: bf e7 ldi r27, 0x7F ; 127 17038: e2 96 adiw r28, 0x32 ; 50 1703a: 8c af std Y+60, r24 ; 0x3c 1703c: 9d af std Y+61, r25 ; 0x3d 1703e: ae af std Y+62, r26 ; 0x3e 17040: bf af std Y+63, r27 ; 0x3f 17042: e2 97 sbiw r28, 0x32 ; 50 17044: d3 cd rjmp .-1114 ; 0x16bec 17046: 20 e0 ldi r18, 0x00 ; 0 17048: 30 e0 ldi r19, 0x00 ; 0 1704a: 40 ec ldi r20, 0xC0 ; 192 1704c: 5f e7 ldi r21, 0x7F ; 127 1704e: 6e 96 adiw r28, 0x1e ; 30 17050: 2c af std Y+60, r18 ; 0x3c 17052: 3d af std Y+61, r19 ; 0x3d 17054: 4e af std Y+62, r20 ; 0x3e 17056: 5f af std Y+63, r21 ; 0x3f 17058: 6e 97 sbiw r28, 0x1e ; 30 1705a: e5 cd rjmp .-1078 ; 0x16c26 1705c: 80 e0 ldi r24, 0x00 ; 0 1705e: 90 e0 ldi r25, 0x00 ; 0 17060: a0 ec ldi r26, 0xC0 ; 192 17062: bf e7 ldi r27, 0x7F ; 127 17064: a2 96 adiw r28, 0x22 ; 34 17066: 8c af std Y+60, r24 ; 0x3c 17068: 9d af std Y+61, r25 ; 0x3d 1706a: ae af std Y+62, r26 ; 0x3e 1706c: bf af std Y+63, r27 ; 0x3f 1706e: a2 97 sbiw r28, 0x22 ; 34 17070: e8 cd rjmp .-1072 ; 0x16c42 17072: 20 e0 ldi r18, 0x00 ; 0 17074: 30 e0 ldi r19, 0x00 ; 0 17076: 40 ec ldi r20, 0xC0 ; 192 17078: 5f e7 ldi r21, 0x7F ; 127 1707a: 6a 96 adiw r28, 0x1a ; 26 1707c: 2c af std Y+60, r18 ; 0x3c 1707e: 3d af std Y+61, r19 ; 0x3d 17080: 4e af std Y+62, r20 ; 0x3e 17082: 5f af std Y+63, r21 ; 0x3f 17084: 6a 97 sbiw r28, 0x1a ; 26 17086: eb cd rjmp .-1066 ; 0x16c5e 17088: 80 e0 ldi r24, 0x00 ; 0 1708a: 90 e0 ldi r25, 0x00 ; 0 1708c: a0 ec ldi r26, 0xC0 ; 192 1708e: bf e7 ldi r27, 0x7F ; 127 17090: aa 96 adiw r28, 0x2a ; 42 17092: 8c af std Y+60, r24 ; 0x3c 17094: 9d af std Y+61, r25 ; 0x3d 17096: ae af std Y+62, r26 ; 0x3e 17098: bf af std Y+63, r27 ; 0x3f 1709a: aa 97 sbiw r28, 0x2a ; 42 1709c: ee cd rjmp .-1060 ; 0x16c7a int8_t I = -1, S = -1, B = -1, F = -1; 1709e: 9f ef ldi r25, 0xFF ; 255 170a0: e3 96 adiw r28, 0x33 ; 51 170a2: 9f af std Y+63, r25 ; 0x3f 170a4: e3 97 sbiw r28, 0x33 ; 51 170a6: fe cd rjmp .-1028 ; 0x16ca4 170a8: af ef ldi r26, 0xFF ; 255 170aa: e7 96 adiw r28, 0x37 ; 55 170ac: af af std Y+63, r26 ; 0x3f 170ae: e7 97 sbiw r28, 0x37 ; 55 170b0: 04 ce rjmp .-1016 ; 0x16cba - `F` - force model self-test state (0=off 1=on) during autotune using current values */ case 310: { // parse all parameters float R = NAN, P = NAN, U = NAN, V = NAN, C = NAN, D = NAN, T = NAN, W = NAN, E = NAN; 170b2: 20 e0 ldi r18, 0x00 ; 0 170b4: 30 e0 ldi r19, 0x00 ; 0 170b6: 40 ec ldi r20, 0xC0 ; 192 170b8: 5f e7 ldi r21, 0x7F ; 127 170ba: a6 96 adiw r28, 0x26 ; 38 170bc: 2c af std Y+60, r18 ; 0x3c 170be: 3d af std Y+61, r19 ; 0x3d 170c0: 4e af std Y+62, r20 ; 0x3e 170c2: 5f af std Y+63, r21 ; 0x3f 170c4: a6 97 sbiw r28, 0x26 ; 38 170c6: 07 ce rjmp .-1010 ; 0x16cd6 int8_t I = -1, S = -1, B = -1, F = -1; 170c8: 3f ef ldi r19, 0xFF ; 255 170ca: eb 96 adiw r28, 0x3b ; 59 170cc: 3f af std Y+63, r19 ; 0x3f 170ce: eb 97 sbiw r28, 0x3b ; 59 170d0: 36 ce rjmp .-916 ; 0x16d3e if(code_seen('F')) F = code_value_short(); // report values if nothing has been requested if(isnan(R) && isnan(P) && isnan(U) && isnan(V) && isnan(C) && isnan(D) && isnan(T) && isnan(W) && isnan(E) && I < 0 && S < 0 && B < 0 && A < 0 && L < 0) { thermal_model_report_settings(); 170d2: 0f 94 97 2d call 0x25b2e ; 0x25b2e 170d6: 0c 94 05 ab jmp 0x1560a ; 0x1560a break; } // update all parameters if(B >= 0) 170da: e7 96 adiw r28, 0x37 ; 55 170dc: 9f ad ldd r25, Y+63 ; 0x3f 170de: e7 97 sbiw r28, 0x37 ; 55 170e0: 97 fd sbrc r25, 7 170e2: 09 c0 rjmp .+18 ; 0x170f6 thermal_model_set_warn_beep(B); 170e4: 81 e0 ldi r24, 0x01 ; 1 170e6: e7 96 adiw r28, 0x37 ; 55 170e8: af ad ldd r26, Y+63 ; 0x3f 170ea: e7 97 sbiw r28, 0x37 ; 55 170ec: a1 11 cpse r26, r1 170ee: 01 c0 rjmp .+2 ; 0x170f2 170f0: 80 e0 ldi r24, 0x00 ; 0 SERIAL_ECHOLNPGM("TM: invalid parameters, cannot enable"); } void thermal_model_set_warn_beep(bool enabled) { thermal_model::warn_beep = enabled; 170f2: 80 93 3d 02 sts 0x023D, r24 ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.455> if(!isnan(P) || !isnan(U) || !isnan(V) || !isnan(C) || !isnan(D) || (L >= 0) || !isnan(T) || !isnan(W) || !isnan(E)) 170f6: a7 01 movw r20, r14 170f8: 96 01 movw r18, r12 170fa: c7 01 movw r24, r14 170fc: b6 01 movw r22, r12 170fe: 0f 94 0d e1 call 0x3c21a ; 0x3c21a <__unordsf2> 17102: 88 23 and r24, r24 17104: 09 f4 brne .+2 ; 0x17108 17106: 97 ce rjmp .-722 ; 0x16e36 17108: 6e 96 adiw r28, 0x1e ; 30 1710a: 2c ad ldd r18, Y+60 ; 0x3c 1710c: 3d ad ldd r19, Y+61 ; 0x3d 1710e: 4e ad ldd r20, Y+62 ; 0x3e 17110: 5f ad ldd r21, Y+63 ; 0x3f 17112: 6e 97 sbiw r28, 0x1e ; 30 17114: ca 01 movw r24, r20 17116: b9 01 movw r22, r18 17118: 0f 94 0d e1 call 0x3c21a ; 0x3c21a <__unordsf2> 1711c: 88 23 and r24, r24 1711e: 09 f4 brne .+2 ; 0x17122 17120: 8a ce rjmp .-748 ; 0x16e36 17122: a2 96 adiw r28, 0x22 ; 34 17124: 2c ad ldd r18, Y+60 ; 0x3c 17126: 3d ad ldd r19, Y+61 ; 0x3d 17128: 4e ad ldd r20, Y+62 ; 0x3e 1712a: 5f ad ldd r21, Y+63 ; 0x3f 1712c: a2 97 sbiw r28, 0x22 ; 34 1712e: ca 01 movw r24, r20 17130: b9 01 movw r22, r18 17132: 0f 94 0d e1 call 0x3c21a ; 0x3c21a <__unordsf2> 17136: 88 23 and r24, r24 17138: 09 f4 brne .+2 ; 0x1713c 1713a: 7d ce rjmp .-774 ; 0x16e36 1713c: 6a 96 adiw r28, 0x1a ; 26 1713e: 2c ad ldd r18, Y+60 ; 0x3c 17140: 3d ad ldd r19, Y+61 ; 0x3d 17142: 4e ad ldd r20, Y+62 ; 0x3e 17144: 5f ad ldd r21, Y+63 ; 0x3f 17146: 6a 97 sbiw r28, 0x1a ; 26 17148: ca 01 movw r24, r20 1714a: b9 01 movw r22, r18 1714c: 0f 94 0d e1 call 0x3c21a ; 0x3c21a <__unordsf2> 17150: 88 23 and r24, r24 17152: 09 f4 brne .+2 ; 0x17156 17154: 70 ce rjmp .-800 ; 0x16e36 17156: aa 96 adiw r28, 0x2a ; 42 17158: 2c ad ldd r18, Y+60 ; 0x3c 1715a: 3d ad ldd r19, Y+61 ; 0x3d 1715c: 4e ad ldd r20, Y+62 ; 0x3e 1715e: 5f ad ldd r21, Y+63 ; 0x3f 17160: aa 97 sbiw r28, 0x2a ; 42 17162: ca 01 movw r24, r20 17164: b9 01 movw r22, r18 17166: 0f 94 0d e1 call 0x3c21a ; 0x3c21a <__unordsf2> 1716a: 88 23 and r24, r24 1716c: 09 f4 brne .+2 ; 0x17170 1716e: 63 ce rjmp .-826 ; 0x16e36 17170: 17 fd sbrc r17, 7 17172: 02 c0 rjmp .+4 ; 0x17178 17174: 0c 94 96 cc jmp 0x1992c ; 0x1992c 17178: a6 96 adiw r28, 0x26 ; 38 1717a: 2c ad ldd r18, Y+60 ; 0x3c 1717c: 3d ad ldd r19, Y+61 ; 0x3d 1717e: 4e ad ldd r20, Y+62 ; 0x3e 17180: 5f ad ldd r21, Y+63 ; 0x3f 17182: a6 97 sbiw r28, 0x26 ; 38 17184: ca 01 movw r24, r20 17186: b9 01 movw r22, r18 17188: 0f 94 0d e1 call 0x3c21a ; 0x3c21a <__unordsf2> 1718c: 88 23 and r24, r24 1718e: 09 f4 brne .+2 ; 0x17192 17190: 52 ce rjmp .-860 ; 0x16e36 17192: a5 01 movw r20, r10 17194: 94 01 movw r18, r8 17196: c5 01 movw r24, r10 17198: b4 01 movw r22, r8 1719a: 0f 94 0d e1 call 0x3c21a ; 0x3c21a <__unordsf2> 1719e: 88 23 and r24, r24 171a0: 09 f4 brne .+2 ; 0x171a4 171a2: 49 ce rjmp .-878 ; 0x16e36 171a4: a3 01 movw r20, r6 171a6: 92 01 movw r18, r4 171a8: c3 01 movw r24, r6 171aa: b2 01 movw r22, r4 171ac: 0f 94 0d e1 call 0x3c21a ; 0x3c21a <__unordsf2> 171b0: 88 23 and r24, r24 171b2: 09 f4 brne .+2 ; 0x171b6 171b4: 40 ce rjmp .-896 ; 0x16e36 thermal_model_set_params(P, U, V, C, D, L, T, W, E); if(I >= 0 && !isnan(R)) 171b6: ab 96 adiw r28, 0x2b ; 43 171b8: 3f ad ldd r19, Y+63 ; 0x3f 171ba: ab 97 sbiw r28, 0x2b ; 43 171bc: 37 fd sbrc r19, 7 171be: 3b c0 rjmp .+118 ; 0x17236 171c0: e2 96 adiw r28, 0x32 ; 50 171c2: 2c ad ldd r18, Y+60 ; 0x3c 171c4: 3d ad ldd r19, Y+61 ; 0x3d 171c6: 4e ad ldd r20, Y+62 ; 0x3e 171c8: 5f ad ldd r21, Y+63 ; 0x3f 171ca: e2 97 sbiw r28, 0x32 ; 50 171cc: ca 01 movw r24, r20 171ce: b9 01 movw r22, r18 171d0: 0f 94 0d e1 call 0x3c21a ; 0x3c21a <__unordsf2> 171d4: 81 11 cpse r24, r1 171d6: 2f c0 rjmp .+94 ; 0x17236 thermal_model::setup(); } void thermal_model_set_resistance(uint8_t index, float R) { if(index >= THERMAL_MODEL_R_SIZE || R <= 0) 171d8: ab 96 adiw r28, 0x2b ; 43 171da: 4f ad ldd r20, Y+63 ; 0x3f 171dc: ab 97 sbiw r28, 0x2b ; 43 171de: 40 31 cpi r20, 0x10 ; 16 171e0: 54 f5 brge .+84 ; 0x17236 171e2: 20 e0 ldi r18, 0x00 ; 0 171e4: 30 e0 ldi r19, 0x00 ; 0 171e6: a9 01 movw r20, r18 171e8: e2 96 adiw r28, 0x32 ; 50 171ea: 6c ad ldd r22, Y+60 ; 0x3c 171ec: 7d ad ldd r23, Y+61 ; 0x3d 171ee: 8e ad ldd r24, Y+62 ; 0x3e 171f0: 9f ad ldd r25, Y+63 ; 0x3f 171f2: e2 97 sbiw r28, 0x32 ; 50 171f4: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 171f8: 18 16 cp r1, r24 171fa: ec f4 brge .+58 ; 0x17236 return; TempMgrGuard temp_mgr_guard; 171fc: ce 01 movw r24, r28 171fe: 01 96 adiw r24, 0x01 ; 1 17200: 0f 94 70 31 call 0x262e0 ; 0x262e0 thermal_model::data.R[index] = R; 17204: ab 96 adiw r28, 0x2b ; 43 17206: 5f ad ldd r21, Y+63 ; 0x3f 17208: ab 97 sbiw r28, 0x2b ; 43 1720a: 84 e0 ldi r24, 0x04 ; 4 1720c: 58 02 muls r21, r24 1720e: f0 01 movw r30, r0 17210: 11 24 eor r1, r1 17212: e1 51 subi r30, 0x11 ; 17 17214: fd 4e sbci r31, 0xED ; 237 17216: e2 96 adiw r28, 0x32 ; 50 17218: 2c ad ldd r18, Y+60 ; 0x3c 1721a: 3d ad ldd r19, Y+61 ; 0x3d 1721c: 4e ad ldd r20, Y+62 ; 0x3e 1721e: 5f ad ldd r21, Y+63 ; 0x3f 17220: e2 97 sbiw r28, 0x32 ; 50 17222: 20 83 st Z, r18 17224: 31 83 std Z+1, r19 ; 0x01 17226: 42 83 std Z+2, r20 ; 0x02 17228: 53 83 std Z+3, r21 ; 0x03 thermal_model::setup(); 1722a: 0f 94 df 2e call 0x25dbe ; 0x25dbe void thermal_model_set_resistance(uint8_t index, float R) { if(index >= THERMAL_MODEL_R_SIZE || R <= 0) return; TempMgrGuard temp_mgr_guard; 1722e: ce 01 movw r24, r28 17230: 01 96 adiw r24, 0x01 ; 1 17232: 0f 94 63 31 call 0x262c6 ; 0x262c6 thermal_model_set_resistance(I, R); // enable the model last, if requested if(S >= 0) thermal_model_set_enabled(S); 17236: e3 96 adiw r28, 0x33 ; 51 17238: 3f ad ldd r19, Y+63 ; 0x3f 1723a: e3 97 sbiw r28, 0x33 ; 51 1723c: 37 fd sbrc r19, 7 1723e: 06 c0 rjmp .+12 ; 0x1724c 17240: 81 e0 ldi r24, 0x01 ; 1 17242: 31 11 cpse r19, r1 17244: 01 c0 rjmp .+2 ; 0x17248 17246: 80 e0 ldi r24, 0x00 ; 0 17248: 0f 94 0f 32 call 0x2641e ; 0x2641e // run autotune if(A >= 0) thermal_model_autotune(A, F > 0); 1724c: 37 fe sbrs r3, 7 1724e: 02 c0 rjmp .+4 ; 0x17254 17250: 0c 94 05 ab jmp 0x1560a ; 0x1560a 17254: 11 e0 ldi r17, 0x01 ; 1 17256: eb 96 adiw r28, 0x3b ; 59 17258: 4f ad ldd r20, Y+63 ; 0x3f 1725a: eb 97 sbiw r28, 0x3b ; 59 1725c: 14 16 cp r1, r20 1725e: 0c f0 brlt .+2 ; 0x17262 17260: 10 e0 ldi r17, 0x00 ; 0 float orig_C, orig_R[THERMAL_MODEL_R_SIZE]; bool orig_enabled; static_assert(sizeof(orig_R) == sizeof(thermal_model::data.R)); // fail-safe error state thermal_model_autotune_err = true; 17262: 81 e0 ldi r24, 0x01 ; 1 17264: 80 93 3c 02 sts 0x023C, r24 ; 0x80023c <_ZL26thermal_model_autotune_err.lto_priv.536> } //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); 17268: 80 91 a4 0d lds r24, 0x0DA4 ; 0x800da4 1726c: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 17270: 89 1b sub r24, r25 17272: 8f 70 andi r24, 0x0F ; 15 char tm_message[LCD_WIDTH+1]; if(moves_planned() || (lcd_commands_type != LcdCommands::ThermalModel && printer_active())) { 17274: 41 f4 brne .+16 ; 0x17286 17276: 80 91 b3 0d lds r24, 0x0DB3 ; 0x800db3 1727a: 85 30 cpi r24, 0x05 ; 5 1727c: 69 f1 breq .+90 ; 0x172d8 1727e: 0e 94 f9 67 call 0xcff2 ; 0xcff2 17282: 88 23 and r24, r24 17284: 49 f1 breq .+82 ; 0x172d8 sprintf_P(tm_message, PSTR("TM: Cal. NOT IDLE")); 17286: 8b e6 ldi r24, 0x6B ; 107 17288: 94 e8 ldi r25, 0x84 ; 132 1728a: 9f 93 push r25 1728c: 8f 93 push r24 1728e: 81 e0 ldi r24, 0x01 ; 1 17290: 90 e0 ldi r25, 0x00 ; 0 17292: 8c 0f add r24, r28 17294: 9d 1f adc r25, r29 17296: 9f 93 push r25 17298: 8f 93 push r24 1729a: 0f 94 ee da call 0x3b5dc ; 0x3b5dc lcd_setstatus_serial(tm_message); 1729e: ce 01 movw r24, r28 172a0: 01 96 adiw r24, 0x01 ; 1 172a2: 0e 94 27 f1 call 0x1e24e ; 0x1e24e return; 172a6: 0f 90 pop r0 172a8: 0f 90 pop r0 172aa: 0f 90 pop r0 172ac: 0f 90 pop r0 172ae: 0c 94 05 ab jmp 0x1560a ; 0x1560a void thermal_model_set_params(float P, float U, float V, float C, float D, int16_t L, float Ta_corr, float warn, float err) { TempMgrGuard temp_mgr_guard; if(!isnan(P) && P > 0) thermal_model::data.P = P; 172b2: 20 e0 ldi r18, 0x00 ; 0 172b4: 30 e0 ldi r19, 0x00 ; 0 172b6: a9 01 movw r20, r18 172b8: c7 01 movw r24, r14 172ba: b6 01 movw r22, r12 172bc: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 172c0: 18 16 cp r1, r24 172c2: 0c f0 brlt .+2 ; 0x172c6 172c4: c5 cd rjmp .-1142 ; 0x16e50 172c6: c0 92 d9 12 sts 0x12D9, r12 ; 0x8012d9 <_ZN13thermal_modelL4dataE.lto_priv.400+0x2a> 172ca: d0 92 da 12 sts 0x12DA, r13 ; 0x8012da <_ZN13thermal_modelL4dataE.lto_priv.400+0x2b> 172ce: e0 92 db 12 sts 0x12DB, r14 ; 0x8012db <_ZN13thermal_modelL4dataE.lto_priv.400+0x2c> 172d2: f0 92 dc 12 sts 0x12DC, r15 ; 0x8012dc <_ZN13thermal_modelL4dataE.lto_priv.400+0x2d> 172d6: bc cd rjmp .-1160 ; 0x16e50 lcd_setstatus_serial(tm_message); return; } // lockout the printer during calibration KEEPALIVE_STATE(IN_PROCESS); 172d8: 83 e0 ldi r24, 0x03 ; 3 172da: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be menu_set_block(MENU_BLOCK_THERMAL_MODEL_AUTOTUNE); 172de: 80 91 d4 03 lds r24, 0x03D4 ; 0x8003d4 172e2: 82 60 ori r24, 0x02 ; 2 172e4: 80 93 d4 03 sts 0x03D4, r24 ; 0x8003d4 lcd_return_to_status(); 172e8: 0f 94 7c 1e call 0x23cf8 ; 0x23cf8 // save the original model data and set the model checking state during self-calibration orig_C = thermal_model::data.C; 172ec: 20 91 e5 12 lds r18, 0x12E5 ; 0x8012e5 <_ZN13thermal_modelL4dataE.lto_priv.400+0x36> 172f0: 30 91 e6 12 lds r19, 0x12E6 ; 0x8012e6 <_ZN13thermal_modelL4dataE.lto_priv.400+0x37> 172f4: 40 91 e7 12 lds r20, 0x12E7 ; 0x8012e7 <_ZN13thermal_modelL4dataE.lto_priv.400+0x38> 172f8: 50 91 e8 12 lds r21, 0x12E8 ; 0x8012e8 <_ZN13thermal_modelL4dataE.lto_priv.400+0x39> 172fc: 6e 96 adiw r28, 0x1e ; 30 172fe: 2c af std Y+60, r18 ; 0x3c 17300: 3d af std Y+61, r19 ; 0x3d 17302: 4e af std Y+62, r20 ; 0x3e 17304: 5f af std Y+63, r21 ; 0x3f 17306: 6e 97 sbiw r28, 0x1e ; 30 memcpy(orig_R, thermal_model::data.R, sizeof(thermal_model::data.R)); 17308: 80 e4 ldi r24, 0x40 ; 64 1730a: ef ee ldi r30, 0xEF ; 239 1730c: f2 e1 ldi r31, 0x12 ; 18 1730e: de 01 movw r26, r28 17310: 11 96 adiw r26, 0x01 ; 1 17312: 01 90 ld r0, Z+ 17314: 0d 92 st X+, r0 17316: 8a 95 dec r24 17318: e1 f7 brne .-8 ; 0x17312 orig_enabled = thermal_model::enabled; 1731a: 30 91 1c 05 lds r19, 0x051C ; 0x80051c <_ZN13thermal_modelL7enabledE.lto_priv.456> 1731e: 67 96 adiw r28, 0x17 ; 23 17320: 3f af std Y+63, r19 ; 0x3f 17322: 67 97 sbiw r28, 0x17 ; 23 thermal_model_reset_enabled(selftest); 17324: 81 2f mov r24, r17 17326: 0f 94 31 32 call 0x26462 ; 0x26462 // autotune SERIAL_ECHOLNPGM("TM: calibration start"); 1732a: 85 e5 ldi r24, 0x55 ; 85 1732c: 94 e8 ldi r25, 0x84 ; 132 1732e: 0e 94 93 79 call 0xf326 ; 0xf326 thermal_model_autotune_err = thermal_model_cal::autotune(temp > 0 ? temp : THERMAL_MODEL_CAL_T_high); 17332: 21 14 cp r2, r1 17334: 31 04 cpc r3, r1 17336: 19 f4 brne .+6 ; 0x1733e 17338: 56 ee ldi r21, 0xE6 ; 230 1733a: 25 2e mov r2, r21 1733c: 31 2c mov r3, r1 uint16_t samples; float e; char tm_message[LCD_WIDTH+1]; // bootstrap C/R values without fan set_fan_speed(0); 1733e: 80 e0 ldi r24, 0x00 ; 0 17340: 0f 94 8d 2d call 0x25b1a ; 0x25b1a 17344: 32 e0 ldi r19, 0x02 ; 2 17346: 43 2e mov r4, r19 17348: 51 2c mov r5, r1 for(uint8_t i = 0; i != 2; ++i) { const char* PROGMEM verb = (i == 0? PSTR("initial"): PSTR("refine")); 1734a: 49 e3 ldi r20, 0x39 ; 57 1734c: 64 2e mov r6, r20 1734e: 44 e8 ldi r20, 0x84 ; 132 17350: 74 2e mov r7, r20 17352: ae 01 movw r20, r28 17354: 4f 5b subi r20, 0xBF ; 191 17356: 5f 4f sbci r21, 0xFF ; 255 17358: 4a 01 movw r8, r20 target_temperature[0] = 0; if(current_temperature[0] >= THERMAL_MODEL_CAL_T_low) { sprintf_P(tm_message, PSTR("TM: cool down <%dC"), THERMAL_MODEL_CAL_T_low); 1735a: 12 e3 ldi r17, 0x32 ; 50 // bootstrap C/R values without fan set_fan_speed(0); for(uint8_t i = 0; i != 2; ++i) { const char* PROGMEM verb = (i == 0? PSTR("initial"): PSTR("refine")); target_temperature[0] = 0; 1735c: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 17360: 10 92 b5 0d sts 0x0DB5, r1 ; 0x800db5 if(current_temperature[0] >= THERMAL_MODEL_CAL_T_low) { 17364: 20 e0 ldi r18, 0x00 ; 0 17366: 30 e0 ldi r19, 0x00 ; 0 17368: 48 e4 ldi r20, 0x48 ; 72 1736a: 52 e4 ldi r21, 0x42 ; 66 1736c: 60 91 af 0d lds r22, 0x0DAF ; 0x800daf 17370: 70 91 b0 0d lds r23, 0x0DB0 ; 0x800db0 17374: 80 91 b1 0d lds r24, 0x0DB1 ; 0x800db1 17378: 90 91 b2 0d lds r25, 0x0DB2 ; 0x800db2 1737c: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 17380: 87 fd sbrc r24, 7 17382: 58 c0 rjmp .+176 ; 0x17434 sprintf_P(tm_message, PSTR("TM: cool down <%dC"), THERMAL_MODEL_CAL_T_low); 17384: 1f 92 push r1 17386: 1f 93 push r17 17388: 8f e1 ldi r24, 0x1F ; 31 1738a: 94 e8 ldi r25, 0x84 ; 132 1738c: 9f 93 push r25 1738e: 8f 93 push r24 17390: 9f 92 push r9 17392: 8f 92 push r8 17394: 0f 94 ee da call 0x3b5dc ; 0x3b5dc lcd_setstatus_serial(tm_message); 17398: c4 01 movw r24, r8 1739a: 0e 94 27 f1 call 0x1e24e ; 0x1e24e } } static void cooldown(float temp) { uint8_t old_speed = fanSpeed; 1739e: 00 91 e5 03 lds r16, 0x03E5 ; 0x8003e5 set_fan_speed(255); 173a2: 8f ef ldi r24, 0xFF ; 255 173a4: 0f 94 8d 2d call 0x25b1a ; 0x25b1a 173a8: 0f 90 pop r0 173aa: 0f 90 pop r0 173ac: 0f 90 pop r0 173ae: 0f 90 pop r0 173b0: 0f 90 pop r0 173b2: 0f 90 pop r0 while(current_temperature[0] >= temp) { 173b4: c0 90 af 0d lds r12, 0x0DAF ; 0x800daf 173b8: d0 90 b0 0d lds r13, 0x0DB0 ; 0x800db0 173bc: e0 90 b1 0d lds r14, 0x0DB1 ; 0x800db1 173c0: f0 90 b2 0d lds r15, 0x0DB2 ; 0x800db2 173c4: 20 e0 ldi r18, 0x00 ; 0 173c6: 30 e0 ldi r19, 0x00 ; 0 173c8: 48 e4 ldi r20, 0x48 ; 72 173ca: 52 e4 ldi r21, 0x42 ; 66 173cc: c7 01 movw r24, r14 173ce: b6 01 movw r22, r12 173d0: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 173d4: 87 fd sbrc r24, 7 173d6: 27 c0 rjmp .+78 ; 0x17426 if(temp_error_state.v) break; 173d8: 80 91 1a 05 lds r24, 0x051A ; 0x80051a <_ZL16temp_error_state.lto_priv.454> 173dc: 81 11 cpse r24, r1 173de: 23 c0 rjmp .+70 ; 0x17426 float ambient = current_temperature_ambient + thermal_model::data.Ta_corr; 173e0: 20 91 55 06 lds r18, 0x0655 ; 0x800655 173e4: 30 91 56 06 lds r19, 0x0656 ; 0x800656 173e8: 40 91 57 06 lds r20, 0x0657 ; 0x800657 173ec: 50 91 58 06 lds r21, 0x0658 ; 0x800658 173f0: 60 91 2f 13 lds r22, 0x132F ; 0x80132f <_ZN13thermal_modelL4dataE.lto_priv.400+0x80> 173f4: 70 91 30 13 lds r23, 0x1330 ; 0x801330 <_ZN13thermal_modelL4dataE.lto_priv.400+0x81> 173f8: 80 91 31 13 lds r24, 0x1331 ; 0x801331 <_ZN13thermal_modelL4dataE.lto_priv.400+0x82> 173fc: 90 91 32 13 lds r25, 0x1332 ; 0x801332 <_ZN13thermal_modelL4dataE.lto_priv.400+0x83> 17400: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> if(current_temperature[0] < (ambient + TEMP_HYSTERESIS)) { 17404: 20 e0 ldi r18, 0x00 ; 0 17406: 30 e0 ldi r19, 0x00 ; 0 17408: 40 ea ldi r20, 0xA0 ; 160 1740a: 50 e4 ldi r21, 0x40 ; 64 1740c: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 17410: 9b 01 movw r18, r22 17412: ac 01 movw r20, r24 17414: c7 01 movw r24, r14 17416: b6 01 movw r22, r12 17418: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 1741c: 87 fd sbrc r24, 7 1741e: 03 c0 rjmp .+6 ; 0x17426 // do not get stuck waiting very close to ambient temperature break; } waiting_handler(); 17420: 0f 94 56 3a call 0x274ac ; 0x274ac 17424: c7 cf rjmp .-114 ; 0x173b4 } set_fan_speed(old_speed); 17426: 80 2f mov r24, r16 17428: 0f 94 8d 2d call 0x25b1a ; 0x25b1a target_temperature[0] = 0; if(current_temperature[0] >= THERMAL_MODEL_CAL_T_low) { sprintf_P(tm_message, PSTR("TM: cool down <%dC"), THERMAL_MODEL_CAL_T_low); lcd_setstatus_serial(tm_message); cooldown(THERMAL_MODEL_CAL_T_low); wait(10000); 1742c: 80 e1 ldi r24, 0x10 ; 16 1742e: 97 e2 ldi r25, 0x27 ; 39 17430: 0f 94 83 3a call 0x27506 ; 0x27506 } sprintf_P(tm_message, PSTR("TM: %S C est."), verb); 17434: 7f 92 push r7 17436: 6f 92 push r6 17438: e1 e1 ldi r30, 0x11 ; 17 1743a: f4 e8 ldi r31, 0x84 ; 132 1743c: ff 93 push r31 1743e: ef 93 push r30 17440: 9f 92 push r9 17442: 8f 92 push r8 17444: 0f 94 ee da call 0x3b5dc ; 0x3b5dc lcd_setstatus_serial(tm_message); 17448: c4 01 movw r24, r8 1744a: 0e 94 27 f1 call 0x1e24e ; 0x1e24e target_temperature[0] = cal_temp; 1744e: 30 92 b6 0d sts 0x0DB6, r3 ; 0x800db6 17452: 20 92 b5 0d sts 0x0DB5, r2 ; 0x800db5 samples = record(); 17456: 0f 94 a2 0f call 0x21f44 ; 0x21f44 1745a: 5c 01 movw r10, r24 if(temp_error_state.v || !samples) 1745c: 80 91 1a 05 lds r24, 0x051A ; 0x80051a <_ZL16temp_error_state.lto_priv.454> 17460: 0f 90 pop r0 17462: 0f 90 pop r0 17464: 0f 90 pop r0 17466: 0f 90 pop r0 17468: 0f 90 pop r0 1746a: 0f 90 pop r0 1746c: 81 11 cpse r24, r1 1746e: 7a c0 rjmp .+244 ; 0x17564 17470: a1 14 cp r10, r1 17472: b1 04 cpc r11, r1 17474: 09 f4 brne .+2 ; 0x17478 17476: 76 c0 rjmp .+236 ; 0x17564 return true; // we need a high R value for the initial C guess if(isnan(thermal_model::data.R[0])) 17478: 60 91 ef 12 lds r22, 0x12EF ; 0x8012ef <_ZN13thermal_modelL4dataE.lto_priv.400+0x40> 1747c: 70 91 f0 12 lds r23, 0x12F0 ; 0x8012f0 <_ZN13thermal_modelL4dataE.lto_priv.400+0x41> 17480: 80 91 f1 12 lds r24, 0x12F1 ; 0x8012f1 <_ZN13thermal_modelL4dataE.lto_priv.400+0x42> 17484: 90 91 f2 12 lds r25, 0x12F2 ; 0x8012f2 <_ZN13thermal_modelL4dataE.lto_priv.400+0x43> 17488: 9b 01 movw r18, r22 1748a: ac 01 movw r20, r24 1748c: 0f 94 0d e1 call 0x3c21a ; 0x3c21a <__unordsf2> 17490: 88 23 and r24, r24 17492: 61 f0 breq .+24 ; 0x174ac thermal_model::data.R[0] = THERMAL_MODEL_CAL_R_high; 17494: 80 e0 ldi r24, 0x00 ; 0 17496: 90 e0 ldi r25, 0x00 ; 0 17498: a8 e4 ldi r26, 0x48 ; 72 1749a: b2 e4 ldi r27, 0x42 ; 66 1749c: 80 93 ef 12 sts 0x12EF, r24 ; 0x8012ef <_ZN13thermal_modelL4dataE.lto_priv.400+0x40> 174a0: 90 93 f0 12 sts 0x12F0, r25 ; 0x8012f0 <_ZN13thermal_modelL4dataE.lto_priv.400+0x41> 174a4: a0 93 f1 12 sts 0x12F1, r26 ; 0x8012f1 <_ZN13thermal_modelL4dataE.lto_priv.400+0x42> 174a8: b0 93 f2 12 sts 0x12F2, r27 ; 0x8012f2 <_ZN13thermal_modelL4dataE.lto_priv.400+0x43> e = estimate(samples, &thermal_model::data.C, 174ac: c0 90 55 06 lds r12, 0x0655 ; 0x800655 174b0: d0 90 56 06 lds r13, 0x0656 ; 0x800656 174b4: e0 90 57 06 lds r14, 0x0657 ; 0x800657 174b8: f0 90 58 06 lds r15, 0x0658 ; 0x800658 174bc: 00 e0 ldi r16, 0x00 ; 0 174be: 20 e0 ldi r18, 0x00 ; 0 174c0: 30 e0 ldi r19, 0x00 ; 0 174c2: 40 ea ldi r20, 0xA0 ; 160 174c4: 51 e4 ldi r21, 0x41 ; 65 174c6: 65 ee ldi r22, 0xE5 ; 229 174c8: 72 e1 ldi r23, 0x12 ; 18 174ca: c5 01 movw r24, r10 174cc: 0e 94 92 e6 call 0x1cd24 ; 0x1cd24 THERMAL_MODEL_CAL_C_low, THERMAL_MODEL_CAL_C_high, THERMAL_MODEL_CAL_C_thr, THERMAL_MODEL_CAL_C_itr, 0, current_temperature_ambient); if(isnan(e)) 174d0: 9b 01 movw r18, r22 174d2: ac 01 movw r20, r24 174d4: 0f 94 0d e1 call 0x3c21a ; 0x3c21a <__unordsf2> 174d8: 81 11 cpse r24, r1 174da: 44 c0 rjmp .+136 ; 0x17564 return true; wait_temp(); 174dc: 0f 94 61 3a call 0x274c2 ; 0x274c2 if(i) break; // we don't need to refine R 174e0: 4a 94 dec r4 174e2: 45 28 or r4, r5 174e4: 09 f4 brne .+2 ; 0x174e8 174e6: 85 c0 rjmp .+266 ; 0x175f2 wait(30000); // settle PID regulation 174e8: 80 e3 ldi r24, 0x30 ; 48 174ea: 95 e7 ldi r25, 0x75 ; 117 174ec: 0f 94 83 3a call 0x27506 ; 0x27506 sprintf_P(tm_message, PSTR("TM: %S R %dC"), verb, cal_temp); 174f0: 3f 92 push r3 174f2: 2f 92 push r2 174f4: 7f 92 push r7 174f6: 6f 92 push r6 174f8: 44 e0 ldi r20, 0x04 ; 4 174fa: 54 e8 ldi r21, 0x84 ; 132 174fc: 5f 93 push r21 174fe: 4f 93 push r20 17500: 9f 92 push r9 17502: 8f 92 push r8 17504: 0f 94 ee da call 0x3b5dc ; 0x3b5dc lcd_setstatus_serial(tm_message); 17508: c4 01 movw r24, r8 1750a: 0e 94 27 f1 call 0x1e24e ; 0x1e24e samples = record(); 1750e: 0f 94 a2 0f call 0x21f44 ; 0x21f44 if(temp_error_state.v || !samples) 17512: 20 91 1a 05 lds r18, 0x051A ; 0x80051a <_ZL16temp_error_state.lto_priv.454> 17516: 0f b6 in r0, 0x3f ; 63 17518: f8 94 cli 1751a: de bf out 0x3e, r29 ; 62 1751c: 0f be out 0x3f, r0 ; 63 1751e: cd bf out 0x3d, r28 ; 61 17520: 21 11 cpse r18, r1 17522: 20 c0 rjmp .+64 ; 0x17564 17524: 00 97 sbiw r24, 0x00 ; 0 17526: f1 f0 breq .+60 ; 0x17564 return true; e = estimate(samples, &thermal_model::data.R[0], 17528: c0 90 55 06 lds r12, 0x0655 ; 0x800655 1752c: d0 90 56 06 lds r13, 0x0656 ; 0x800656 17530: e0 90 57 06 lds r14, 0x0657 ; 0x800657 17534: f0 90 58 06 lds r15, 0x0658 ; 0x800658 17538: 20 e0 ldi r18, 0x00 ; 0 1753a: 30 e0 ldi r19, 0x00 ; 0 1753c: 48 e4 ldi r20, 0x48 ; 72 1753e: 52 e4 ldi r21, 0x42 ; 66 17540: 6f ee ldi r22, 0xEF ; 239 17542: 72 e1 ldi r23, 0x12 ; 18 17544: 0e 94 92 e6 call 0x1cd24 ; 0x1cd24 // bootstrap C/R values without fan set_fan_speed(0); for(uint8_t i = 0; i != 2; ++i) { const char* PROGMEM verb = (i == 0? PSTR("initial"): PSTR("refine")); 17548: 02 e3 ldi r16, 0x32 ; 50 1754a: 60 2e mov r6, r16 1754c: 04 e8 ldi r16, 0x84 ; 132 1754e: 70 2e mov r7, r16 17550: 44 24 eor r4, r4 17552: 43 94 inc r4 17554: 51 2c mov r5, r1 e = estimate(samples, &thermal_model::data.R[0], THERMAL_MODEL_CAL_R_low, THERMAL_MODEL_CAL_R_high, THERMAL_MODEL_CAL_R_thr, THERMAL_MODEL_CAL_R_itr, 0, current_temperature_ambient); if(isnan(e)) 17556: 9b 01 movw r18, r22 17558: ac 01 movw r20, r24 1755a: 0f 94 0d e1 call 0x3c21a ; 0x3c21a <__unordsf2> 1755e: 88 23 and r24, r24 17560: 09 f4 brne .+2 ; 0x17564 17562: fc ce rjmp .-520 ; 0x1735c sprintf_P(tm_message, PSTR("TM: %S C est."), verb); lcd_setstatus_serial(tm_message); target_temperature[0] = cal_temp; samples = record(); if(temp_error_state.v || !samples) return true; 17564: 81 e0 ldi r24, 0x01 ; 1 orig_enabled = thermal_model::enabled; thermal_model_reset_enabled(selftest); // autotune SERIAL_ECHOLNPGM("TM: calibration start"); thermal_model_autotune_err = thermal_model_cal::autotune(temp > 0 ? temp : THERMAL_MODEL_CAL_T_high); 17566: 80 93 3c 02 sts 0x023C, r24 ; 0x80023c <_ZL26thermal_model_autotune_err.lto_priv.536> // always reset temperature disable_heater(); 1756a: 0f 94 ee 2e call 0x25ddc ; 0x25ddc if(thermal_model_autotune_err) { 1756e: 80 91 3c 02 lds r24, 0x023C ; 0x80023c <_ZL26thermal_model_autotune_err.lto_priv.536> 17572: 88 23 and r24, r24 17574: 09 f4 brne .+2 ; 0x17578 17576: fd c0 rjmp .+506 ; 0x17772 sprintf_P(tm_message, PSTR("TM: calibr. failed!")); 17578: 81 e4 ldi r24, 0x41 ; 65 1757a: 94 e8 ldi r25, 0x84 ; 132 1757c: 9f 93 push r25 1757e: 8f 93 push r24 17580: 9f 92 push r9 17582: 8f 92 push r8 17584: 0f 94 ee da call 0x3b5dc ; 0x3b5dc lcd_setstatus_serial(tm_message); 17588: c4 01 movw r24, r8 1758a: 0e 94 27 f1 call 0x1e24e ; 0x1e24e if(temp_error_state.v) 1758e: 80 91 1a 05 lds r24, 0x051A ; 0x80051a <_ZL16temp_error_state.lto_priv.454> 17592: 0f 90 pop r0 17594: 0f 90 pop r0 17596: 0f 90 pop r0 17598: 0f 90 pop r0 1759a: 88 23 and r24, r24 1759c: 19 f0 breq .+6 ; 0x175a4 thermal_model_cal::set_fan_speed(255); 1759e: 8f ef ldi r24, 0xFF ; 255 175a0: 0f 94 8d 2d call 0x25b1a ; 0x25b1a // show calibrated values before overwriting them thermal_model_report_settings(); 175a4: 0f 94 97 2d call 0x25b2e ; 0x25b2e // restore original state thermal_model::data.C = orig_C; 175a8: 6e 96 adiw r28, 0x1e ; 30 175aa: 2c ad ldd r18, Y+60 ; 0x3c 175ac: 3d ad ldd r19, Y+61 ; 0x3d 175ae: 4e ad ldd r20, Y+62 ; 0x3e 175b0: 5f ad ldd r21, Y+63 ; 0x3f 175b2: 6e 97 sbiw r28, 0x1e ; 30 175b4: 20 93 e5 12 sts 0x12E5, r18 ; 0x8012e5 <_ZN13thermal_modelL4dataE.lto_priv.400+0x36> 175b8: 30 93 e6 12 sts 0x12E6, r19 ; 0x8012e6 <_ZN13thermal_modelL4dataE.lto_priv.400+0x37> 175bc: 40 93 e7 12 sts 0x12E7, r20 ; 0x8012e7 <_ZN13thermal_modelL4dataE.lto_priv.400+0x38> 175c0: 50 93 e8 12 sts 0x12E8, r21 ; 0x8012e8 <_ZN13thermal_modelL4dataE.lto_priv.400+0x39> memcpy(thermal_model::data.R, orig_R, sizeof(thermal_model::data.R)); 175c4: 80 e4 ldi r24, 0x40 ; 64 175c6: fe 01 movw r30, r28 175c8: 31 96 adiw r30, 0x01 ; 1 175ca: af ee ldi r26, 0xEF ; 239 175cc: b2 e1 ldi r27, 0x12 ; 18 175ce: 01 90 ld r0, Z+ 175d0: 0d 92 st X+, r0 175d2: 8a 95 dec r24 175d4: e1 f7 brne .-8 ; 0x175ce thermal_model_set_enabled(orig_enabled); 175d6: 67 96 adiw r28, 0x17 ; 23 175d8: 8f ad ldd r24, Y+63 ; 0x3f 175da: 67 97 sbiw r28, 0x17 ; 23 175dc: 0f 94 0f 32 call 0x2641e ; 0x2641e thermal_model_cal::set_fan_speed(0); thermal_model_set_enabled(orig_enabled); thermal_model_report_settings(); } lcd_consume_click(); 175e0: 0e 94 10 71 call 0xe220 ; 0xe220 menu_unset_block(MENU_BLOCK_THERMAL_MODEL_AUTOTUNE); 175e4: 80 91 d4 03 lds r24, 0x03D4 ; 0x8003d4 175e8: 8d 7f andi r24, 0xFD ; 253 175ea: 80 93 d4 03 sts 0x03D4, r24 ; 0x8003d4 175ee: 0c 94 05 ab jmp 0x1560a ; 0x1560a // Estimate fan losses at regular intervals, starting from full speed to avoid low-speed // kickstart issues, although this requires us to wait more for the PID stabilization. // Normally exhibits logarithmic behavior with the stock fan+shroud, so the shorter interval // at lower speeds is helpful to increase the resolution of the interpolation. set_fan_speed(255); 175f2: 8f ef ldi r24, 0xFF ; 255 175f4: 0f 94 8d 2d call 0x25b1a ; 0x25b1a wait(30000); 175f8: 80 e3 ldi r24, 0x30 ; 48 175fa: 95 e7 ldi r25, 0x75 ; 117 175fc: 0f 94 83 3a call 0x27506 ; 0x27506 17600: fb e2 ldi r31, 0x2B ; 43 17602: 6f 2e mov r6, r31 17604: f3 e1 ldi r31, 0x13 ; 19 17606: 7f 2e mov r7, r31 17608: 1f ef ldi r17, 0xFF ; 255 1760a: af e0 ldi r26, 0x0F ; 15 1760c: aa 2e mov r10, r26 1760e: b1 2c mov r11, r1 for(int8_t i = THERMAL_MODEL_R_SIZE - 1; i > 0; i -= THERMAL_MODEL_CAL_R_STEP) { // always disable the checker while estimating fan resistance as the difference // (esp with 3rd-party blowers) can be massive thermal_model::data.R[i] = NAN; 17610: 21 2c mov r2, r1 17612: 31 2c mov r3, r1 17614: b0 ec ldi r27, 0xC0 ; 192 17616: 4b 2e mov r4, r27 17618: bf e7 ldi r27, 0x7F ; 127 1761a: 5b 2e mov r5, r27 1761c: f3 01 movw r30, r6 1761e: 20 82 st Z, r2 17620: 31 82 std Z+1, r3 ; 0x01 17622: 42 82 std Z+2, r4 ; 0x02 17624: 53 82 std Z+3, r5 ; 0x03 uint8_t speed = 256 / THERMAL_MODEL_R_SIZE * (i + 1) - 1; set_fan_speed(speed); 17626: 81 2f mov r24, r17 17628: 0f 94 8d 2d call 0x25b1a ; 0x25b1a wait(10000); 1762c: 80 e1 ldi r24, 0x10 ; 16 1762e: 97 e2 ldi r25, 0x27 ; 39 17630: 0f 94 83 3a call 0x27506 ; 0x27506 sprintf_P(tm_message, PSTR("TM: R[%u] estimate."), (unsigned)i); 17634: bf 92 push r11 17636: af 92 push r10 17638: 20 ef ldi r18, 0xF0 ; 240 1763a: 33 e8 ldi r19, 0x83 ; 131 1763c: 3f 93 push r19 1763e: 2f 93 push r18 17640: 9f 92 push r9 17642: 8f 92 push r8 17644: 0f 94 ee da call 0x3b5dc ; 0x3b5dc lcd_setstatus_serial(tm_message); 17648: c4 01 movw r24, r8 1764a: 0e 94 27 f1 call 0x1e24e ; 0x1e24e samples = record(); 1764e: 0f 94 a2 0f call 0x21f44 ; 0x21f44 if(temp_error_state.v || !samples) 17652: 20 91 1a 05 lds r18, 0x051A ; 0x80051a <_ZL16temp_error_state.lto_priv.454> 17656: 0f 90 pop r0 17658: 0f 90 pop r0 1765a: 0f 90 pop r0 1765c: 0f 90 pop r0 1765e: 0f 90 pop r0 17660: 0f 90 pop r0 17662: 21 11 cpse r18, r1 17664: 7f cf rjmp .-258 ; 0x17564 17666: 00 97 sbiw r24, 0x00 ; 0 17668: 09 f4 brne .+2 ; 0x1766c 1766a: 7c cf rjmp .-264 ; 0x17564 return true; // a fixed fan pwm (the norminal value) is used here, as soft_pwm_fan will be modified // during fan measurements and we'd like to include that skew during normal operation. e = estimate(samples, &thermal_model::data.R[i], 1766c: c0 90 55 06 lds r12, 0x0655 ; 0x800655 17670: d0 90 56 06 lds r13, 0x0656 ; 0x800656 17674: e0 90 57 06 lds r14, 0x0657 ; 0x800657 17678: f0 90 58 06 lds r15, 0x0658 ; 0x800658 1767c: 20 91 ef 12 lds r18, 0x12EF ; 0x8012ef <_ZN13thermal_modelL4dataE.lto_priv.400+0x40> 17680: 30 91 f0 12 lds r19, 0x12F0 ; 0x8012f0 <_ZN13thermal_modelL4dataE.lto_priv.400+0x41> 17684: 40 91 f1 12 lds r20, 0x12F1 ; 0x8012f1 <_ZN13thermal_modelL4dataE.lto_priv.400+0x42> 17688: 50 91 f2 12 lds r21, 0x12F2 ; 0x8012f2 <_ZN13thermal_modelL4dataE.lto_priv.400+0x43> 1768c: 0a 2d mov r16, r10 1768e: b3 01 movw r22, r6 17690: 0e 94 92 e6 call 0x1cd24 ; 0x1cd24 THERMAL_MODEL_CAL_R_low, thermal_model::data.R[0], THERMAL_MODEL_CAL_R_thr, THERMAL_MODEL_CAL_R_itr, i, current_temperature_ambient); if(isnan(e)) 17694: 9b 01 movw r18, r22 17696: ac 01 movw r20, r24 17698: 0f 94 0d e1 call 0x3c21a ; 0x3c21a <__unordsf2> 1769c: 81 11 cpse r24, r1 1769e: 62 cf rjmp .-316 ; 0x17564 176a0: 54 e0 ldi r21, 0x04 ; 4 176a2: a5 1a sub r10, r21 176a4: b1 08 sbc r11, r1 176a6: 80 e1 ldi r24, 0x10 ; 16 176a8: 68 1a sub r6, r24 176aa: 71 08 sbc r7, r1 176ac: 10 54 subi r17, 0x40 ; 64 // Normally exhibits logarithmic behavior with the stock fan+shroud, so the shorter interval // at lower speeds is helpful to increase the resolution of the interpolation. set_fan_speed(255); wait(30000); for(int8_t i = THERMAL_MODEL_R_SIZE - 1; i > 0; i -= THERMAL_MODEL_CAL_R_STEP) { 176ae: 9f ef ldi r25, 0xFF ; 255 176b0: a9 16 cp r10, r25 176b2: b9 06 cpc r11, r25 176b4: 09 f0 breq .+2 ; 0x176b8 176b6: b2 cf rjmp .-156 ; 0x1761c 176b8: 77 e2 ldi r23, 0x27 ; 39 176ba: e7 2e mov r14, r23 176bc: 73 e1 ldi r23, 0x13 ; 19 176be: f7 2e mov r15, r23 176c0: 0e e0 ldi r16, 0x0E ; 14 176c2: 10 e0 ldi r17, 0x00 ; 0 return true; } // interpolate remaining steps to speed-up calibration // TODO: verify that the sampled values are monotically increasing? int8_t next = THERMAL_MODEL_R_SIZE - 1; 176c4: ef e0 ldi r30, 0x0F ; 15 176c6: 3e 2e mov r3, r30 for(uint8_t i = THERMAL_MODEL_R_SIZE - 2; i != 0; --i) { if(!((THERMAL_MODEL_R_SIZE - i - 1) % THERMAL_MODEL_CAL_R_STEP)) { 176c8: 8f e0 ldi r24, 0x0F ; 15 176ca: 90 e0 ldi r25, 0x00 ; 0 176cc: 80 1b sub r24, r16 176ce: 91 0b sbc r25, r17 176d0: 83 70 andi r24, 0x03 ; 3 176d2: 99 27 eor r25, r25 176d4: 89 2b or r24, r25 176d6: 59 f4 brne .+22 ; 0x176ee next = i; 176d8: 30 2e mov r3, r16 176da: 01 50 subi r16, 0x01 ; 1 176dc: 11 09 sbc r17, r1 176de: f4 e0 ldi r31, 0x04 ; 4 176e0: ef 1a sub r14, r31 176e2: f1 08 sbc r15, r1 } // interpolate remaining steps to speed-up calibration // TODO: verify that the sampled values are monotically increasing? int8_t next = THERMAL_MODEL_R_SIZE - 1; for(uint8_t i = THERMAL_MODEL_R_SIZE - 2; i != 0; --i) { 176e4: 01 15 cp r16, r1 176e6: 11 05 cpc r17, r1 176e8: 79 f7 brne .-34 ; 0x176c8 float f = (float)(i - prev) / THERMAL_MODEL_CAL_R_STEP; float d = (thermal_model::data.R[next] - thermal_model::data.R[prev]); thermal_model::data.R[i] = thermal_model::data.R[prev] + d * f; } return false; 176ea: 80 e0 ldi r24, 0x00 ; 0 176ec: 3c cf rjmp .-392 ; 0x17566 for(uint8_t i = THERMAL_MODEL_R_SIZE - 2; i != 0; --i) { if(!((THERMAL_MODEL_R_SIZE - i - 1) % THERMAL_MODEL_CAL_R_STEP)) { next = i; continue; } int8_t prev = next - THERMAL_MODEL_CAL_R_STEP; 176ee: 8c ef ldi r24, 0xFC ; 252 176f0: 83 0d add r24, r3 if(prev < 0) prev = 0; float f = (float)(i - prev) / THERMAL_MODEL_CAL_R_STEP; 176f2: 87 fd sbrc r24, 7 176f4: 80 e0 ldi r24, 0x00 ; 0 176f6: 08 2e mov r0, r24 176f8: 00 0c add r0, r0 176fa: 99 0b sbc r25, r25 float d = (thermal_model::data.R[next] - thermal_model::data.R[prev]); 176fc: fc 01 movw r30, r24 176fe: ee 0f add r30, r30 17700: ff 1f adc r31, r31 17702: ee 0f add r30, r30 17704: ff 1f adc r31, r31 17706: e1 51 subi r30, 0x11 ; 17 17708: fd 4e sbci r31, 0xED ; 237 1770a: 40 80 ld r4, Z 1770c: 51 80 ldd r5, Z+1 ; 0x01 1770e: 62 80 ldd r6, Z+2 ; 0x02 17710: 73 80 ldd r7, Z+3 ; 0x03 next = i; continue; } int8_t prev = next - THERMAL_MODEL_CAL_R_STEP; if(prev < 0) prev = 0; float f = (float)(i - prev) / THERMAL_MODEL_CAL_R_STEP; 17712: b8 01 movw r22, r16 17714: 68 1b sub r22, r24 17716: 79 0b sbc r23, r25 17718: 07 2e mov r0, r23 1771a: 00 0c add r0, r0 1771c: 88 0b sbc r24, r24 1771e: 99 0b sbc r25, r25 17720: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 17724: 20 e0 ldi r18, 0x00 ; 0 17726: 30 e0 ldi r19, 0x00 ; 0 17728: 40 e8 ldi r20, 0x80 ; 128 1772a: 5e e3 ldi r21, 0x3E ; 62 1772c: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 17730: 5b 01 movw r10, r22 17732: 6c 01 movw r12, r24 float d = (thermal_model::data.R[next] - thermal_model::data.R[prev]); 17734: a3 2d mov r26, r3 17736: b4 e0 ldi r27, 0x04 ; 4 17738: ab 02 muls r26, r27 1773a: f0 01 movw r30, r0 1773c: 11 24 eor r1, r1 1773e: e1 51 subi r30, 0x11 ; 17 17740: fd 4e sbci r31, 0xED ; 237 17742: a3 01 movw r20, r6 17744: 92 01 movw r18, r4 17746: 60 81 ld r22, Z 17748: 71 81 ldd r23, Z+1 ; 0x01 1774a: 82 81 ldd r24, Z+2 ; 0x02 1774c: 93 81 ldd r25, Z+3 ; 0x03 1774e: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 17752: 9b 01 movw r18, r22 17754: ac 01 movw r20, r24 thermal_model::data.R[i] = thermal_model::data.R[prev] + d * f; 17756: c6 01 movw r24, r12 17758: b5 01 movw r22, r10 1775a: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 1775e: a3 01 movw r20, r6 17760: 92 01 movw r18, r4 17762: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 17766: f7 01 movw r30, r14 17768: 60 83 st Z, r22 1776a: 71 83 std Z+1, r23 ; 0x01 1776c: 82 83 std Z+2, r24 ; 0x02 1776e: 93 83 std Z+3, r25 ; 0x03 17770: b4 cf rjmp .-152 ; 0x176da // restore original state thermal_model::data.C = orig_C; memcpy(thermal_model::data.R, orig_R, sizeof(thermal_model::data.R)); thermal_model_set_enabled(orig_enabled); } else { calibration_status_set(CALIBRATION_STATUS_THERMAL_MODEL); 17772: 88 e0 ldi r24, 0x08 ; 8 17774: 0e 94 6d ee call 0x1dcda ; 0x1dcda lcd_setstatuspgm(MSG_WELCOME); 17778: 86 eb ldi r24, 0xB6 ; 182 1777a: 90 e7 ldi r25, 0x70 ; 112 1777c: 0e 94 38 f1 call 0x1e270 ; 0x1e270 thermal_model_cal::set_fan_speed(0); 17780: 80 e0 ldi r24, 0x00 ; 0 17782: 0f 94 8d 2d call 0x25b1a ; 0x25b1a thermal_model_set_enabled(orig_enabled); 17786: 67 96 adiw r28, 0x17 ; 23 17788: 8f ad ldd r24, Y+63 ; 0x3f 1778a: 67 97 sbiw r28, 0x17 ; 23 1778c: 0f 94 0f 32 call 0x2641e ; 0x2641e thermal_model_report_settings(); 17790: 0f 94 97 2d call 0x25b2e ; 0x25b2e 17794: 25 cf rjmp .-438 ; 0x175e0 M400 */ case 400: { st_synchronize(); 17796: 0f 94 a3 42 call 0x28546 ; 0x28546 1779a: 0c 94 05 ab jmp 0x1560a ; 0x1560a */ 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()) 1779e: 80 91 b9 13 lds r24, 0x13B9 ; 0x8013b9 177a2: 81 30 cpi r24, 0x01 ; 1 177a4: 11 f0 breq .+4 ; 0x177aa 177a6: 0c 94 05 ab jmp 0x1560a ; 0x1560a { uint8_t extruder = 255; uint8_t filament = FILAMENT_UNDEFINED; if(code_seen('E')) extruder = code_value_uint8(); 177aa: 85 e4 ldi r24, 0x45 ; 69 177ac: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 177b0: 81 11 cpse r24, r1 177b2: 0e 94 80 5b call 0xb700 ; 0xb700 if(code_seen('F')) filament = code_value_uint8(); 177b6: 86 e4 ldi r24, 0x46 ; 70 177b8: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 177bc: 81 11 cpse r24, r1 177be: 0e 94 80 5b call 0xb700 ; 0xb700 MMU2_ECHO_MSGRPGM(PSTR("MMU2tool=")); SERIAL_ECHOLN((int)ex); } bool MMU2::set_filament_type(uint8_t /*slot*/, uint8_t /*type*/) { if (!WaitForMMUReady()) { 177c2: 0f 94 3f 88 call 0x3107e ; 0x3107e 177c6: 88 23 and r24, r24 177c8: 11 f4 brne .+4 ; 0x177ce 177ca: 0c 94 05 ab jmp 0x1560a ; 0x1560a // slot = slot; // @@TODO // type = type; // @@TODO // cmd_arg = filamentType; // command(MMU_CMD_F0 + index); if (!manage_response(false, false)) { 177ce: 60 e0 ldi r22, 0x00 ; 0 177d0: 80 e0 ldi r24, 0x00 ; 0 177d2: 0f 94 31 ac call 0x35862 ; 0x35862 177d6: 0c 94 05 ab jmp 0x1560a ; 0x1560a */ case 406: // M406 Disable Filament Sensor { fsensor.setEnabled(0); 177da: 80 e0 ldi r24, 0x00 ; 0 177dc: 0e 94 e7 74 call 0xe9ce ; 0xe9ce 177e0: 0c 94 05 ab jmp 0x1560a ; 0x1560a M500 */ case 500: { Config_StoreSettings(); 177e4: 0e 94 bc 82 call 0x10578 ; 0x10578 177e8: 0c 94 05 ab jmp 0x1560a ; 0x1560a M501 */ case 501: { Config_RetrieveSettings(); 177ec: 0e 94 c4 93 call 0x12788 ; 0x12788 177f0: 0c 94 05 ab jmp 0x1560a ; 0x1560a M502 */ case 502: { Config_ResetDefault(); 177f4: 0e 94 a4 82 call 0x10548 ; 0x10548 177f8: 0c 94 05 ab jmp 0x1560a ; 0x1560a #ifndef DISABLE_M503 void Config_PrintSettings(uint8_t level) { // Always have this function, even with EEPROM_SETTINGS disabled, the current values will be shown #ifdef TMC2130 printf_P(PSTR( 177fc: 80 91 20 0e lds r24, 0x0E20 ; 0x800e20 17800: 8f 93 push r24 17802: 80 91 1f 0e lds r24, 0x0E1F ; 0x800e1f 17806: 8f 93 push r24 17808: 80 91 1e 0e lds r24, 0x0E1E ; 0x800e1e 1780c: 8f 93 push r24 1780e: 80 91 1d 0e lds r24, 0x0E1D ; 0x800e1d 17812: 8f 93 push r24 17814: 80 91 1c 0e lds r24, 0x0E1C ; 0x800e1c 17818: 8f 93 push r24 1781a: 80 91 1b 0e lds r24, 0x0E1B ; 0x800e1b 1781e: 8f 93 push r24 17820: 80 91 1a 0e lds r24, 0x0E1A ; 0x800e1a 17824: 8f 93 push r24 17826: 80 91 19 0e lds r24, 0x0E19 ; 0x800e19 1782a: 8f 93 push r24 1782c: 80 91 18 0e lds r24, 0x0E18 ; 0x800e18 17830: 8f 93 push r24 17832: 80 91 17 0e lds r24, 0x0E17 ; 0x800e17 17836: 8f 93 push r24 17838: 80 91 16 0e lds r24, 0x0E16 ; 0x800e16 1783c: 8f 93 push r24 1783e: 80 91 15 0e lds r24, 0x0E15 ; 0x800e15 17842: 8f 93 push r24 17844: 02 ef ldi r16, 0xF2 ; 242 17846: 1b ea ldi r17, 0xAB ; 171 17848: 1f 93 push r17 1784a: 0f 93 push r16 1784c: 1f 93 push r17 1784e: 0f 93 push r16 17850: 80 91 14 0e lds r24, 0x0E14 ; 0x800e14 17854: 8f 93 push r24 17856: 80 91 13 0e lds r24, 0x0E13 ; 0x800e13 1785a: 8f 93 push r24 1785c: 80 91 12 0e lds r24, 0x0E12 ; 0x800e12 17860: 8f 93 push r24 17862: 80 91 11 0e lds r24, 0x0E11 ; 0x800e11 17866: 8f 93 push r24 17868: 80 91 10 0e lds r24, 0x0E10 ; 0x800e10 1786c: 8f 93 push r24 1786e: 80 91 0f 0e lds r24, 0x0E0F ; 0x800e0f 17872: 8f 93 push r24 17874: 80 91 0e 0e lds r24, 0x0E0E ; 0x800e0e 17878: 8f 93 push r24 1787a: 80 91 0d 0e lds r24, 0x0E0D ; 0x800e0d 1787e: 8f 93 push r24 17880: 80 91 0c 0e lds r24, 0x0E0C ; 0x800e0c 17884: 8f 93 push r24 17886: 80 91 0b 0e lds r24, 0x0E0B ; 0x800e0b 1788a: 8f 93 push r24 1788c: 80 91 0a 0e lds r24, 0x0E0A ; 0x800e0a 17890: 8f 93 push r24 17892: 80 91 09 0e lds r24, 0x0E09 ; 0x800e09 17896: 8f 93 push r24 17898: 80 91 08 0e lds r24, 0x0E08 ; 0x800e08 1789c: 8f 93 push r24 1789e: 80 91 07 0e lds r24, 0x0E07 ; 0x800e07 178a2: 8f 93 push r24 178a4: 80 91 06 0e lds r24, 0x0E06 ; 0x800e06 178a8: 8f 93 push r24 178aa: 80 91 05 0e lds r24, 0x0E05 ; 0x800e05 178ae: 8f 93 push r24 178b0: 80 91 04 0e lds r24, 0x0E04 ; 0x800e04 178b4: 8f 93 push r24 178b6: 80 91 03 0e lds r24, 0x0E03 ; 0x800e03 178ba: 8f 93 push r24 178bc: 80 91 02 0e lds r24, 0x0E02 ; 0x800e02 178c0: 8f 93 push r24 178c2: 80 91 01 0e lds r24, 0x0E01 ; 0x800e01 178c6: 8f 93 push r24 178c8: 80 91 00 0e lds r24, 0x0E00 ; 0x800e00 178cc: 8f 93 push r24 178ce: 80 91 ff 0d lds r24, 0x0DFF ; 0x800dff 178d2: 8f 93 push r24 178d4: 80 91 fe 0d lds r24, 0x0DFE ; 0x800dfe 178d8: 8f 93 push r24 178da: 80 91 fd 0d lds r24, 0x0DFD ; 0x800dfd 178de: 8f 93 push r24 178e0: 80 91 fc 0d lds r24, 0x0DFC ; 0x800dfc 178e4: 8f 93 push r24 178e6: 80 91 fb 0d lds r24, 0x0DFB ; 0x800dfb 178ea: 8f 93 push r24 178ec: 80 91 fa 0d lds r24, 0x0DFA ; 0x800dfa 178f0: 8f 93 push r24 178f2: 80 91 f9 0d lds r24, 0x0DF9 ; 0x800df9 178f6: 8f 93 push r24 178f8: 1f 93 push r17 178fa: 0f 93 push r16 178fc: 1f 93 push r17 178fe: 0f 93 push r16 17900: 80 91 80 0e lds r24, 0x0E80 ; 0x800e80 17904: 8f 93 push r24 17906: 80 91 7f 0e lds r24, 0x0E7F ; 0x800e7f 1790a: 8f 93 push r24 1790c: 80 91 7e 0e lds r24, 0x0E7E ; 0x800e7e 17910: 8f 93 push r24 17912: 80 91 7d 0e lds r24, 0x0E7D ; 0x800e7d 17916: 8f 93 push r24 17918: 80 91 f8 0d lds r24, 0x0DF8 ; 0x800df8 1791c: 8f 93 push r24 1791e: 80 91 f7 0d lds r24, 0x0DF7 ; 0x800df7 17922: 8f 93 push r24 17924: 80 91 f6 0d lds r24, 0x0DF6 ; 0x800df6 17928: 8f 93 push r24 1792a: 80 91 f5 0d lds r24, 0x0DF5 ; 0x800df5 1792e: 8f 93 push r24 17930: 80 91 f4 0d lds r24, 0x0DF4 ; 0x800df4 17934: 8f 93 push r24 17936: 80 91 f3 0d lds r24, 0x0DF3 ; 0x800df3 1793a: 8f 93 push r24 1793c: 80 91 f2 0d lds r24, 0x0DF2 ; 0x800df2 17940: 8f 93 push r24 17942: 80 91 f1 0d lds r24, 0x0DF1 ; 0x800df1 17946: 8f 93 push r24 17948: 1f 93 push r17 1794a: 0f 93 push r16 1794c: 1f 93 push r17 1794e: 0f 93 push r16 17950: 80 91 78 0e lds r24, 0x0E78 ; 0x800e78 17954: 8f 93 push r24 17956: 80 91 77 0e lds r24, 0x0E77 ; 0x800e77 1795a: 8f 93 push r24 1795c: 80 91 76 0e lds r24, 0x0E76 ; 0x800e76 17960: 8f 93 push r24 17962: 80 91 75 0e lds r24, 0x0E75 ; 0x800e75 17966: 8f 93 push r24 17968: 80 91 74 0e lds r24, 0x0E74 ; 0x800e74 1796c: 8f 93 push r24 1796e: 80 91 73 0e lds r24, 0x0E73 ; 0x800e73 17972: 8f 93 push r24 17974: 80 91 72 0e lds r24, 0x0E72 ; 0x800e72 17978: 8f 93 push r24 1797a: 80 91 71 0e lds r24, 0x0E71 ; 0x800e71 1797e: 8f 93 push r24 17980: 80 91 70 0e lds r24, 0x0E70 ; 0x800e70 17984: 8f 93 push r24 17986: 80 91 6f 0e lds r24, 0x0E6F ; 0x800e6f 1798a: 8f 93 push r24 1798c: 80 91 6e 0e lds r24, 0x0E6E ; 0x800e6e 17990: 8f 93 push r24 17992: 80 91 6d 0e lds r24, 0x0E6D ; 0x800e6d 17996: 8f 93 push r24 17998: 80 91 6c 0e lds r24, 0x0E6C ; 0x800e6c 1799c: 8f 93 push r24 1799e: 80 91 6b 0e lds r24, 0x0E6B ; 0x800e6b 179a2: 8f 93 push r24 179a4: 80 91 6a 0e lds r24, 0x0E6A ; 0x800e6a 179a8: 8f 93 push r24 179aa: 80 91 69 0e lds r24, 0x0E69 ; 0x800e69 179ae: 8f 93 push r24 179b0: 1f 93 push r17 179b2: 0f 93 push r16 179b4: 1f 93 push r17 179b6: 0f 93 push r16 179b8: 80 91 f0 0d lds r24, 0x0DF0 ; 0x800df0 179bc: 8f 93 push r24 179be: 80 91 ef 0d lds r24, 0x0DEF ; 0x800def 179c2: 8f 93 push r24 179c4: 80 91 ee 0d lds r24, 0x0DEE ; 0x800dee 179c8: 8f 93 push r24 179ca: 80 91 ed 0d lds r24, 0x0DED ; 0x800ded 179ce: 8f 93 push r24 179d0: 80 91 ec 0d lds r24, 0x0DEC ; 0x800dec 179d4: 8f 93 push r24 179d6: 80 91 eb 0d lds r24, 0x0DEB ; 0x800deb 179da: 8f 93 push r24 179dc: 80 91 ea 0d lds r24, 0x0DEA ; 0x800dea 179e0: 8f 93 push r24 179e2: 80 91 e9 0d lds r24, 0x0DE9 ; 0x800de9 179e6: 8f 93 push r24 179e8: 80 91 e8 0d lds r24, 0x0DE8 ; 0x800de8 179ec: 8f 93 push r24 179ee: 80 91 e7 0d lds r24, 0x0DE7 ; 0x800de7 179f2: 8f 93 push r24 179f4: 80 91 e6 0d lds r24, 0x0DE6 ; 0x800de6 179f8: 8f 93 push r24 179fa: 80 91 e5 0d lds r24, 0x0DE5 ; 0x800de5 179fe: 8f 93 push r24 17a00: 80 91 e4 0d lds r24, 0x0DE4 ; 0x800de4 17a04: 8f 93 push r24 17a06: 80 91 e3 0d lds r24, 0x0DE3 ; 0x800de3 17a0a: 8f 93 push r24 17a0c: 80 91 e2 0d lds r24, 0x0DE2 ; 0x800de2 17a10: 8f 93 push r24 17a12: 80 91 e1 0d lds r24, 0x0DE1 ; 0x800de1 17a16: 8f 93 push r24 17a18: 1f 93 push r17 17a1a: 0f 93 push r16 17a1c: 1f 93 push r17 17a1e: 0f 93 push r16 17a20: 80 91 68 0e lds r24, 0x0E68 ; 0x800e68 17a24: 8f 93 push r24 17a26: 80 91 67 0e lds r24, 0x0E67 ; 0x800e67 17a2a: 8f 93 push r24 17a2c: 80 91 66 0e lds r24, 0x0E66 ; 0x800e66 17a30: 8f 93 push r24 17a32: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 17a36: 8f 93 push r24 17a38: 80 91 64 0e lds r24, 0x0E64 ; 0x800e64 17a3c: 8f 93 push r24 17a3e: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 17a42: 8f 93 push r24 17a44: 80 91 62 0e lds r24, 0x0E62 ; 0x800e62 17a48: 8f 93 push r24 17a4a: 80 91 61 0e lds r24, 0x0E61 ; 0x800e61 17a4e: 8f 93 push r24 17a50: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 17a54: 8f 93 push r24 17a56: 80 91 5f 0e lds r24, 0x0E5F ; 0x800e5f 17a5a: 8f 93 push r24 17a5c: 80 91 5e 0e lds r24, 0x0E5E ; 0x800e5e 17a60: 8f 93 push r24 17a62: 80 91 5d 0e lds r24, 0x0E5D ; 0x800e5d 17a66: 8f 93 push r24 17a68: 80 91 5c 0e lds r24, 0x0E5C ; 0x800e5c 17a6c: 8f 93 push r24 17a6e: 80 91 5b 0e lds r24, 0x0E5B ; 0x800e5b 17a72: 8f 93 push r24 17a74: 80 91 5a 0e lds r24, 0x0E5A ; 0x800e5a 17a78: 8f 93 push r24 17a7a: 80 91 59 0e lds r24, 0x0E59 ; 0x800e59 17a7e: 8f 93 push r24 17a80: 1f 93 push r17 17a82: 0f 93 push r16 17a84: 1f 93 push r17 17a86: 0f 93 push r16 17a88: 80 91 e0 0d lds r24, 0x0DE0 ; 0x800de0 17a8c: 8f 93 push r24 17a8e: 80 91 df 0d lds r24, 0x0DDF ; 0x800ddf 17a92: 8f 93 push r24 17a94: 80 91 de 0d lds r24, 0x0DDE ; 0x800dde 17a98: 8f 93 push r24 17a9a: 80 91 dd 0d lds r24, 0x0DDD ; 0x800ddd 17a9e: 8f 93 push r24 17aa0: 80 91 dc 0d lds r24, 0x0DDC ; 0x800ddc 17aa4: 8f 93 push r24 17aa6: 80 91 db 0d lds r24, 0x0DDB ; 0x800ddb 17aaa: 8f 93 push r24 17aac: 80 91 da 0d lds r24, 0x0DDA ; 0x800dda 17ab0: 8f 93 push r24 17ab2: 80 91 d9 0d lds r24, 0x0DD9 ; 0x800dd9 17ab6: 8f 93 push r24 17ab8: 80 91 d8 0d lds r24, 0x0DD8 ; 0x800dd8 17abc: 8f 93 push r24 17abe: 80 91 d7 0d lds r24, 0x0DD7 ; 0x800dd7 17ac2: 8f 93 push r24 17ac4: 80 91 d6 0d lds r24, 0x0DD6 ; 0x800dd6 17ac8: 8f 93 push r24 17aca: 80 91 d5 0d lds r24, 0x0DD5 ; 0x800dd5 17ace: 8f 93 push r24 17ad0: 80 91 d4 0d lds r24, 0x0DD4 ; 0x800dd4 17ad4: 8f 93 push r24 17ad6: 80 91 d3 0d lds r24, 0x0DD3 ; 0x800dd3 17ada: 8f 93 push r24 17adc: 80 91 d2 0d lds r24, 0x0DD2 ; 0x800dd2 17ae0: 8f 93 push r24 17ae2: 80 91 d1 0d lds r24, 0x0DD1 ; 0x800dd1 17ae6: 8f 93 push r24 17ae8: 1f 93 push r17 17aea: 0f 93 push r16 17aec: 1f 93 push r17 17aee: 0f 93 push r16 17af0: 80 91 7c 0e lds r24, 0x0E7C ; 0x800e7c 17af4: 1f 92 push r1 17af6: 8f 93 push r24 17af8: 80 91 7b 0e lds r24, 0x0E7B ; 0x800e7b 17afc: 1f 92 push r1 17afe: 8f 93 push r24 17b00: 80 91 7a 0e lds r24, 0x0E7A ; 0x800e7a 17b04: 1f 92 push r1 17b06: 8f 93 push r24 17b08: 80 91 79 0e lds r24, 0x0E79 ; 0x800e79 17b0c: 1f 92 push r1 17b0e: 8f 93 push r24 17b10: 1f 93 push r17 17b12: 0f 93 push r16 17b14: 1f 93 push r17 17b16: 0f 93 push r16 17b18: 80 91 d0 0d lds r24, 0x0DD0 ; 0x800dd0 17b1c: 8f 93 push r24 17b1e: 80 91 cf 0d lds r24, 0x0DCF ; 0x800dcf 17b22: 8f 93 push r24 17b24: 80 91 ce 0d lds r24, 0x0DCE ; 0x800dce 17b28: 8f 93 push r24 17b2a: 80 91 cd 0d lds r24, 0x0DCD ; 0x800dcd 17b2e: 8f 93 push r24 17b30: 80 91 cc 0d lds r24, 0x0DCC ; 0x800dcc 17b34: 8f 93 push r24 17b36: 80 91 cb 0d lds r24, 0x0DCB ; 0x800dcb 17b3a: 8f 93 push r24 17b3c: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 17b40: 8f 93 push r24 17b42: 80 91 c9 0d lds r24, 0x0DC9 ; 0x800dc9 17b46: 8f 93 push r24 17b48: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 17b4c: 8f 93 push r24 17b4e: 80 91 c7 0d lds r24, 0x0DC7 ; 0x800dc7 17b52: 8f 93 push r24 17b54: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 17b58: 8f 93 push r24 17b5a: 80 91 c5 0d lds r24, 0x0DC5 ; 0x800dc5 17b5e: 8f 93 push r24 17b60: 80 91 c4 0d lds r24, 0x0DC4 ; 0x800dc4 17b64: 8f 93 push r24 17b66: 80 91 c3 0d lds r24, 0x0DC3 ; 0x800dc3 17b6a: 8f 93 push r24 17b6c: 80 91 c2 0d lds r24, 0x0DC2 ; 0x800dc2 17b70: 8f 93 push r24 17b72: 80 91 c1 0d lds r24, 0x0DC1 ; 0x800dc1 17b76: 8f 93 push r24 17b78: 1f 93 push r17 17b7a: 0f 93 push r16 17b7c: 1f 93 push r17 17b7e: 0f 93 push r16 17b80: 88 e1 ldi r24, 0x18 ; 24 17b82: 91 e8 ldi r25, 0x81 ; 129 17b84: 9f 93 push r25 17b86: 8f 93 push r24 17b88: 0f 94 99 da call 0x3b532 ; 0x3b532 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"), 17b8c: 0f b6 in r0, 0x3f ; 63 17b8e: f8 94 cli 17b90: de bf out 0x3e, r29 ; 62 17b92: 0f be out 0x3f, r0 ; 63 17b94: cd bf out 0x3d, r28 ; 61 #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 17b96: 2c ea ldi r18, 0xAC ; 172 17b98: 35 ec ldi r19, 0xC5 ; 197 17b9a: 47 e2 ldi r20, 0x27 ; 39 17b9c: 5e e3 ldi r21, 0x3E ; 62 17b9e: 60 91 2d 0e lds r22, 0x0E2D ; 0x800e2d 17ba2: 70 91 2e 0e lds r23, 0x0E2E ; 0x800e2e 17ba6: 80 91 2f 0e lds r24, 0x0E2F ; 0x800e2f 17baa: 90 91 30 0e lds r25, 0x0E30 ; 0x800e30 17bae: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 17bb2: 9f 93 push r25 17bb4: 8f 93 push r24 17bb6: 7f 93 push r23 17bb8: 6f 93 push r22 } float unscalePID_i(float i) { return i/PID_dT; 17bba: 2c ea ldi r18, 0xAC ; 172 17bbc: 35 ec ldi r19, 0xC5 ; 197 17bbe: 47 e2 ldi r20, 0x27 ; 39 17bc0: 5e e3 ldi r21, 0x3E ; 62 17bc2: 60 91 29 0e lds r22, 0x0E29 ; 0x800e29 17bc6: 70 91 2a 0e lds r23, 0x0E2A ; 0x800e2a 17bca: 80 91 2b 0e lds r24, 0x0E2B ; 0x800e2b 17bce: 90 91 2c 0e lds r25, 0x0E2C ; 0x800e2c 17bd2: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 17bd6: 9f 93 push r25 17bd8: 8f 93 push r24 17bda: 7f 93 push r23 17bdc: 6f 93 push r22 17bde: 80 91 28 0e lds r24, 0x0E28 ; 0x800e28 17be2: 8f 93 push r24 17be4: 80 91 27 0e lds r24, 0x0E27 ; 0x800e27 17be8: 8f 93 push r24 17bea: 80 91 26 0e lds r24, 0x0E26 ; 0x800e26 17bee: 8f 93 push r24 17bf0: 80 91 25 0e lds r24, 0x0E25 ; 0x800e25 17bf4: 8f 93 push r24 17bf6: 1f 93 push r17 17bf8: 0f 93 push r16 17bfa: 1f 93 push r17 17bfc: 0f 93 push r16 17bfe: 8b ee ldi r24, 0xEB ; 235 17c00: 90 e8 ldi r25, 0x80 ; 128 17c02: 9f 93 push r25 17c04: 8f 93 push r24 17c06: 0f 94 99 da call 0x3b532 ; 0x3b532 #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 17c0a: 2c ea ldi r18, 0xAC ; 172 17c0c: 35 ec ldi r19, 0xC5 ; 197 17c0e: 47 e2 ldi r20, 0x27 ; 39 17c10: 5e e3 ldi r21, 0x3E ; 62 17c12: 60 91 39 0e lds r22, 0x0E39 ; 0x800e39 17c16: 70 91 3a 0e lds r23, 0x0E3A ; 0x800e3a 17c1a: 80 91 3b 0e lds r24, 0x0E3B ; 0x800e3b 17c1e: 90 91 3c 0e lds r25, 0x0E3C ; 0x800e3c 17c22: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__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"), 17c26: 9f 93 push r25 17c28: 8f 93 push r24 17c2a: 7f 93 push r23 17c2c: 6f 93 push r22 } float unscalePID_i(float i) { return i/PID_dT; 17c2e: 2c ea ldi r18, 0xAC ; 172 17c30: 35 ec ldi r19, 0xC5 ; 197 17c32: 47 e2 ldi r20, 0x27 ; 39 17c34: 5e e3 ldi r21, 0x3E ; 62 17c36: 60 91 35 0e lds r22, 0x0E35 ; 0x800e35 17c3a: 70 91 36 0e lds r23, 0x0E36 ; 0x800e36 17c3e: 80 91 37 0e lds r24, 0x0E37 ; 0x800e37 17c42: 90 91 38 0e lds r25, 0x0E38 ; 0x800e38 17c46: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 17c4a: 9f 93 push r25 17c4c: 8f 93 push r24 17c4e: 7f 93 push r23 17c50: 6f 93 push r22 17c52: 80 91 34 0e lds r24, 0x0E34 ; 0x800e34 17c56: 8f 93 push r24 17c58: 80 91 33 0e lds r24, 0x0E33 ; 0x800e33 17c5c: 8f 93 push r24 17c5e: 80 91 32 0e lds r24, 0x0E32 ; 0x800e32 17c62: 8f 93 push r24 17c64: 80 91 31 0e lds r24, 0x0E31 ; 0x800e31 17c68: 8f 93 push r24 17c6a: 1f 93 push r17 17c6c: 0f 93 push r16 17c6e: 1f 93 push r17 17c70: 0f 93 push r16 17c72: 86 eb ldi r24, 0xB6 ; 182 17c74: 90 e8 ldi r25, 0x80 ; 128 17c76: 9f 93 push r25 17c78: 8f 93 push r24 17c7a: 0f 94 99 da call 0x3b532 ; 0x3b532 echomagic, echomagic, cs.bedKp, unscalePID_i(cs.bedKi), unscalePID_d(cs.bedKd)); #endif #ifdef FWRETRACT printf_P(PSTR( 17c7e: 0f b6 in r0, 0x3f ; 63 17c80: f8 94 cli 17c82: de bf out 0x3e, r29 ; 62 17c84: 0f be out 0x3f, r0 ; 63 17c86: cd bf out 0x3d, r28 ; 61 17c88: 80 91 3f 0e lds r24, 0x0E3F ; 0x800e3f 17c8c: 1f 92 push r1 17c8e: 8f 93 push r24 17c90: 1f 93 push r17 17c92: 0f 93 push r16 17c94: 1f 93 push r17 17c96: 0f 93 push r16 17c98: 20 e0 ldi r18, 0x00 ; 0 17c9a: 30 e0 ldi r19, 0x00 ; 0 17c9c: 40 e7 ldi r20, 0x70 ; 112 17c9e: 52 e4 ldi r21, 0x42 ; 66 17ca0: 60 91 50 0e lds r22, 0x0E50 ; 0x800e50 17ca4: 70 91 51 0e lds r23, 0x0E51 ; 0x800e51 17ca8: 80 91 52 0e lds r24, 0x0E52 ; 0x800e52 17cac: 90 91 53 0e lds r25, 0x0E53 ; 0x800e53 17cb0: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 17cb4: 9f 93 push r25 17cb6: 8f 93 push r24 17cb8: 7f 93 push r23 17cba: 6f 93 push r22 17cbc: 80 91 4f 0e lds r24, 0x0E4F ; 0x800e4f 17cc0: 8f 93 push r24 17cc2: 80 91 4e 0e lds r24, 0x0E4E ; 0x800e4e 17cc6: 8f 93 push r24 17cc8: 80 91 4d 0e lds r24, 0x0E4D ; 0x800e4d 17ccc: 8f 93 push r24 17cce: 80 91 4c 0e lds r24, 0x0E4C ; 0x800e4c 17cd2: 8f 93 push r24 17cd4: 1f 93 push r17 17cd6: 0f 93 push r16 17cd8: 1f 93 push r17 17cda: 0f 93 push r16 17cdc: 80 91 4b 0e lds r24, 0x0E4B ; 0x800e4b 17ce0: 8f 93 push r24 17ce2: 80 91 4a 0e lds r24, 0x0E4A ; 0x800e4a 17ce6: 8f 93 push r24 17ce8: 80 91 49 0e lds r24, 0x0E49 ; 0x800e49 17cec: 8f 93 push r24 17cee: 80 91 48 0e lds r24, 0x0E48 ; 0x800e48 17cf2: 8f 93 push r24 17cf4: 20 e0 ldi r18, 0x00 ; 0 17cf6: 30 e0 ldi r19, 0x00 ; 0 17cf8: 40 e7 ldi r20, 0x70 ; 112 17cfa: 52 e4 ldi r21, 0x42 ; 66 17cfc: 60 91 44 0e lds r22, 0x0E44 ; 0x800e44 17d00: 70 91 45 0e lds r23, 0x0E45 ; 0x800e45 17d04: 80 91 46 0e lds r24, 0x0E46 ; 0x800e46 17d08: 90 91 47 0e lds r25, 0x0E47 ; 0x800e47 17d0c: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 17d10: 9f 93 push r25 17d12: 8f 93 push r24 17d14: 7f 93 push r23 17d16: 6f 93 push r22 17d18: 80 91 43 0e lds r24, 0x0E43 ; 0x800e43 17d1c: 8f 93 push r24 17d1e: 80 91 42 0e lds r24, 0x0E42 ; 0x800e42 17d22: 8f 93 push r24 17d24: 80 91 41 0e lds r24, 0x0E41 ; 0x800e41 17d28: 8f 93 push r24 17d2a: 80 91 40 0e lds r24, 0x0E40 ; 0x800e40 17d2e: 8f 93 push r24 17d30: 1f 93 push r17 17d32: 0f 93 push r16 17d34: 1f 93 push r17 17d36: 0f 93 push r16 17d38: 85 eb ldi r24, 0xB5 ; 181 17d3a: 9f e7 ldi r25, 0x7F ; 127 17d3c: 9f 93 push r25 17d3e: 8f 93 push r24 17d40: 0f 94 99 da call 0x3b532 ; 0x3b532 ); #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) { 17d44: 0f b6 in r0, 0x3f ; 63 17d46: f8 94 cli 17d48: de bf out 0x3e, r29 ; 62 17d4a: 0f be out 0x3f, r0 ; 63 17d4c: cd bf out 0x3d, r28 ; 61 17d4e: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 17d52: 88 23 and r24, r24 17d54: 09 f4 brne .+2 ; 0x17d58 17d56: 58 c0 rjmp .+176 ; 0x17e08 printf_P(PSTR("%SFilament settings:\n%S M200 D%.2f\n"), 17d58: 80 91 58 0e lds r24, 0x0E58 ; 0x800e58 17d5c: 8f 93 push r24 17d5e: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 17d62: 8f 93 push r24 17d64: 80 91 56 0e lds r24, 0x0E56 ; 0x800e56 17d68: 8f 93 push r24 17d6a: 80 91 55 0e lds r24, 0x0E55 ; 0x800e55 17d6e: 8f 93 push r24 17d70: 1f 93 push r17 17d72: 0f 93 push r16 17d74: 1f 93 push r17 17d76: 0f 93 push r16 17d78: 8f e8 ldi r24, 0x8F ; 143 17d7a: 9f e7 ldi r25, 0x7F ; 127 17d7c: 9f 93 push r25 17d7e: 8f 93 push r24 17d80: 0f 94 99 da call 0x3b532 ; 0x3b532 17d84: 0f b6 in r0, 0x3f ; 63 17d86: f8 94 cli 17d88: de bf out 0x3e, r29 ; 62 17d8a: 0f be out 0x3f, r0 ; 63 17d8c: 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( 17d8e: 80 91 8d 0e lds r24, 0x0E8D ; 0x800e8d 17d92: 8f 93 push r24 17d94: 80 91 8c 0e lds r24, 0x0E8C ; 0x800e8c 17d98: 8f 93 push r24 17d9a: 80 91 8b 0e lds r24, 0x0E8B ; 0x800e8b 17d9e: 8f 93 push r24 17da0: 80 91 8a 0e lds r24, 0x0E8A ; 0x800e8a 17da4: 8f 93 push r24 17da6: 80 91 89 0e lds r24, 0x0E89 ; 0x800e89 17daa: 1f 92 push r1 17dac: 8f 93 push r24 17dae: 80 91 88 0e lds r24, 0x0E88 ; 0x800e88 17db2: 8f 93 push r24 17db4: 80 91 87 0e lds r24, 0x0E87 ; 0x800e87 17db8: 8f 93 push r24 17dba: 80 91 86 0e lds r24, 0x0E86 ; 0x800e86 17dbe: 8f 93 push r24 17dc0: 80 91 85 0e lds r24, 0x0E85 ; 0x800e85 17dc4: 8f 93 push r24 17dc6: 80 91 84 0e lds r24, 0x0E84 ; 0x800e84 17dca: 8f 93 push r24 17dcc: 80 91 83 0e lds r24, 0x0E83 ; 0x800e83 17dd0: 8f 93 push r24 17dd2: 80 91 82 0e lds r24, 0x0E82 ; 0x800e82 17dd6: 8f 93 push r24 17dd8: 80 91 81 0e lds r24, 0x0E81 ; 0x800e81 17ddc: 8f 93 push r24 17dde: 82 ef ldi r24, 0xF2 ; 242 17de0: 9b ea ldi r25, 0xAB ; 171 17de2: 9f 93 push r25 17de4: 8f 93 push r24 17de6: 9f 93 push r25 17de8: 8f 93 push r24 17dea: 8e ee ldi r24, 0xEE ; 238 17dec: 9e e7 ldi r25, 0x7E ; 126 17dee: 9f 93 push r25 17df0: 8f 93 push r24 17df2: 0f 94 99 da call 0x3b532 ; 0x3b532 "%SArc Settings: P:Max length(mm) S:Min length (mm) N:Corrections R:Min segments F:Segments/sec.\n%S M214 P%.2f S%.2f N%d R%d F%d\n"), echomagic, echomagic, cs.mm_per_arc_segment, cs.min_mm_per_arc_segment, cs.n_arc_correction, cs.min_arc_segments, cs.arc_segments_per_sec); #ifdef THERMAL_MODEL thermal_model_report_settings(); 17df6: 0f 94 97 2d call 0x25b2e ; 0x25b2e 17dfa: 0f b6 in r0, 0x3f ; 63 17dfc: f8 94 cli 17dfe: de bf out 0x3e, r29 ; 62 17e00: 0f be out 0x3f, r0 ; 63 17e02: cd bf out 0x3d, r28 ; 61 17e04: 0c 94 05 ab jmp 0x1560a ; 0x1560a 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); 17e08: 1f 93 push r17 17e0a: 0f 93 push r16 17e0c: 80 e7 ldi r24, 0x70 ; 112 17e0e: 9f e7 ldi r25, 0x7F ; 127 17e10: 9f 93 push r25 17e12: 8f 93 push r24 17e14: 0f 94 99 da call 0x3b532 ; 0x3b532 17e18: 0f 90 pop r0 17e1a: 0f 90 pop r0 17e1c: 0f 90 pop r0 17e1e: 0f 90 pop r0 17e20: b6 cf rjmp .-148 ; 0x17d8e #### Parameters - `P` - The IP address in xxx.xxx.xxx.xxx format. Eg: P192.168.1.14 */ case 552: { if (code_seen('P')) 17e22: 80 e5 ldi r24, 0x50 ; 80 17e24: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 17e28: 88 23 and r24, r24 17e2a: 11 f4 brne .+4 ; 0x17e30 17e2c: 0c 94 05 ab jmp 0x1560a ; 0x1560a { uint8_t valCnt = 0; IP_address = 0; 17e30: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d 17e34: 10 92 5e 06 sts 0x065E, r1 ; 0x80065e 17e38: 10 92 5f 06 sts 0x065F, r1 ; 0x80065f 17e3c: 10 92 60 06 sts 0x0660, r1 ; 0x800660 17e40: 0d e5 ldi r16, 0x5D ; 93 17e42: 16 e0 ldi r17, 0x06 ; 6 17e44: 41 e6 ldi r20, 0x61 ; 97 17e46: e4 2e mov r14, r20 17e48: 46 e0 ldi r20, 0x06 ; 6 17e4a: f4 2e mov r15, r20 do { *strchr_pointer = '*'; 17e4c: 5a e2 ldi r21, 0x2A ; 42 17e4e: d5 2e mov r13, r21 17e50: e0 91 93 03 lds r30, 0x0393 ; 0x800393 17e54: f0 91 94 03 lds r31, 0x0394 ; 0x800394 17e58: d0 82 st Z, r13 ((uint8_t*)&IP_address)[valCnt] = code_value_short(); 17e5a: 0e 94 8d 5b call 0xb71a ; 0xb71a 17e5e: d8 01 movw r26, r16 17e60: 8d 93 st X+, r24 17e62: 8d 01 movw r16, r26 valCnt++; } while ((valCnt < 4) && code_seen('.')); 17e64: ea 16 cp r14, r26 17e66: fb 06 cpc r15, r27 17e68: 11 f4 brne .+4 ; 0x17e6e 17e6a: 0c 94 05 ab jmp 0x1560a ; 0x1560a 17e6e: 8e e2 ldi r24, 0x2E ; 46 17e70: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 17e74: 81 11 cpse r24, r1 17e76: ec cf rjmp .-40 ; 0x17e50 if (valCnt != 4) IP_address = 0; 17e78: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d 17e7c: 10 92 5e 06 sts 0x065E, r1 ; 0x80065e 17e80: 10 92 5f 06 sts 0x065F, r1 ; 0x80065f 17e84: 10 92 60 06 sts 0x0660, r1 ; 0x800660 17e88: 0c 94 05 ab jmp 0x1560a ; 0x1560a - `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(); 17e8c: 0f 94 a3 42 call 0x28546 ; 0x28546 /// 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; 17e90: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 17e94: 81 11 cpse r24, r1 17e96: 02 c0 rjmp .+4 ; 0x17e9c 17e98: 0e 94 61 64 call 0xc8c2 ; 0xc8c2 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(); 17e9c: 85 e4 ldi r24, 0x45 ; 69 17e9e: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 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; 17ea2: 81 2c mov r8, r1 17ea4: 91 2c mov r9, r1 17ea6: a1 2c mov r10, r1 17ea8: 30 ec ldi r19, 0xC0 ; 192 17eaa: b3 2e mov r11, r19 float e_shift_late = FILAMENTCHANGE_FINALRETRACT; bool automatic = false; //Retract extruder if (code_seen('E')) e_shift_init = code_value(); 17eac: 88 23 and r24, r24 17eae: 21 f0 breq .+8 ; 0x17eb8 17eb0: 0e 94 b5 60 call 0xc16a ; 0xc16a 17eb4: 4b 01 movw r8, r22 17eb6: 5c 01 movw r10, r24 if (code_seen('L')) e_shift_late = code_value(); 17eb8: 8c e4 ldi r24, 0x4C ; 76 17eba: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 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; 17ebe: c1 2c mov r12, r1 17ec0: d1 2c mov r13, r1 17ec2: 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(); 17ec4: 88 23 and r24, r24 17ec6: 21 f0 breq .+8 ; 0x17ed0 17ec8: 0e 94 b5 60 call 0xc16a ; 0xc16a 17ecc: 6b 01 movw r12, r22 17ece: 7c 01 movw r14, r24 // Z lift. For safety only allow positive values if (code_seen('Z')) z_shift = fabs(code_value()); 17ed0: 8a e5 ldi r24, 0x5A ; 90 17ed2: 0e 94 ee 5b call 0xb7dc ; 0xb7dc // 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; 17ed6: 41 2c mov r4, r1 17ed8: 51 2c mov r5, r1 17eda: 28 ed ldi r18, 0xD8 ; 216 17edc: 62 2e mov r6, r18 17ede: 21 e4 ldi r18, 0x41 ; 65 17ee0: 72 2e mov r7, r18 //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()); 17ee2: 88 23 and r24, r24 17ee4: 31 f0 breq .+12 ; 0x17ef2 17ee6: 0e 94 b5 60 call 0xc16a ; 0xc16a 17eea: 2b 01 movw r4, r22 17eec: 3c 01 movw r6, r24 17eee: e8 94 clt 17ef0: 77 f8 bld r7, 7 //Move XY to side if (code_seen('X')) x_position = code_value(); 17ef2: 88 e5 ldi r24, 0x58 ; 88 17ef4: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 17ef8: 88 23 and r24, r24 17efa: 09 f4 brne .+2 ; 0x17efe 17efc: 49 c1 rjmp .+658 ; 0x18190 17efe: 0e 94 b5 60 call 0xc16a ; 0xc16a 17f02: 6a 96 adiw r28, 0x1a ; 26 17f04: 6c af std Y+60, r22 ; 0x3c 17f06: 7d af std Y+61, r23 ; 0x3d 17f08: 8e af std Y+62, r24 ; 0x3e 17f0a: 9f af std Y+63, r25 ; 0x3f 17f0c: 6a 97 sbiw r28, 0x1a ; 26 if (code_seen('Y')) y_position = code_value(); 17f0e: 89 e5 ldi r24, 0x59 ; 89 17f10: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 17f14: 88 23 and r24, r24 17f16: 09 f4 brne .+2 ; 0x17f1a 17f18: 46 c1 rjmp .+652 ; 0x181a6 17f1a: 0e 94 b5 60 call 0xc16a ; 0xc16a 17f1e: 6e 96 adiw r28, 0x1e ; 30 17f20: 6c af std Y+60, r22 ; 0x3c 17f22: 7d af std Y+61, r23 ; 0x3d 17f24: 8e af std Y+62, r24 ; 0x3e 17f26: 9f af std Y+63, r25 ; 0x3f 17f28: 6e 97 sbiw r28, 0x1e ; 30 // Filament name to show during the loading char filament_name[LCD_WIDTH + 1] = ""; 17f2a: 1a 82 std Y+2, r1 ; 0x02 17f2c: 19 82 std Y+1, r1 ; 0x01 17f2e: fe 01 movw r30, r28 17f30: 33 96 adiw r30, 0x03 ; 3 17f32: 83 e1 ldi r24, 0x13 ; 19 17f34: df 01 movw r26, r30 17f36: 1d 92 st X+, r1 17f38: 8a 95 dec r24 17f3a: e9 f7 brne .-6 ; 0x17f36 if (code_seen('C')) { 17f3c: 83 e4 ldi r24, 0x43 ; 67 17f3e: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 17f42: 88 23 and r24, r24 17f44: f9 f0 breq .+62 ; 0x17f84 , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 17f46: 62 e2 ldi r22, 0x22 ; 34 17f48: 70 e0 ldi r23, 0x00 ; 0 17f4a: 80 91 93 03 lds r24, 0x0393 ; 0x800393 17f4e: 90 91 94 03 lds r25, 0x0394 ; 0x800394 17f52: 0f 94 2e e2 call 0x3c45c ; 0x3c45c 17f56: 8c 01 movw r16, r24 if (!this->ptr) { 17f58: 89 2b or r24, r25 17f5a: a1 f0 breq .+40 ; 0x17f84 // First quote not found return; } // Skip the leading quote this->ptr++; 17f5c: 0f 5f subi r16, 0xFF ; 255 17f5e: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 17f60: 62 e2 ldi r22, 0x22 ; 34 17f62: 70 e0 ldi r23, 0x00 ; 0 17f64: c8 01 movw r24, r16 17f66: 0f 94 2e e2 call 0x3c45c ; 0x3c45c if(!pStrEnd) { 17f6a: 00 97 sbiw r24, 0x00 ; 0 17f6c: 59 f0 breq .+22 ; 0x17f84 // Second quote not found return; } this->len = pStrEnd - this->ptr; 17f6e: 80 1b sub r24, r16 unquoted_string str = unquoted_string(strchr_pointer); if (str.WasFound()) { const uint8_t len = min(str.GetLength(), LCD_WIDTH); 17f70: 84 31 cpi r24, 0x14 ; 20 17f72: 08 f0 brcs .+2 ; 0x17f76 17f74: 84 e1 ldi r24, 0x14 ; 20 memcpy(filament_name, str.GetUnquotedString(), len); 17f76: 48 2f mov r20, r24 17f78: 50 e0 ldi r21, 0x00 ; 0 17f7a: b8 01 movw r22, r16 17f7c: ce 01 movw r24, r28 17f7e: 01 96 adiw r24, 0x01 ; 1 17f80: 0f 94 00 e2 call 0x3c400 ; 0x3c400 } } if (MMU2::mmu2.Enabled() && code_seen_P(PSTR("AUTO"))) 17f84: 80 91 b9 13 lds r24, 0x13B9 ; 0x8013b9 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; 17f88: 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"))) 17f8a: 81 30 cpi r24, 0x01 ; 1 17f8c: 29 f4 brne .+10 ; 0x17f98 17f8e: 8a e6 ldi r24, 0x6A ; 106 17f90: 96 e8 ldi r25, 0x86 ; 134 17f92: 0e 94 3e 68 call 0xd07c ; 0xd07c 17f96: 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(); 17f98: 0f 94 a3 42 call 0x28546 ; 0x28546 uint8_t eject_slot = 0; prusa_statistics(22); // Turn off the fan fanSpeed = 0; 17f9c: 10 92 e5 03 sts 0x03E5, r1 ; 0x8003e5 // Retract E if (!printingIsPaused()) 17fa0: 0e 94 9d 67 call 0xcf3a ; 0xcf3a 17fa4: 81 11 cpse r24, r1 17fa6: 06 c1 rjmp .+524 ; 0x181b4 { current_position[E_AXIS] += e_shift; 17fa8: a5 01 movw r20, r10 17faa: 94 01 movw r18, r8 17fac: 60 91 9d 06 lds r22, 0x069D ; 0x80069d 17fb0: 70 91 9e 06 lds r23, 0x069E ; 0x80069e 17fb4: 80 91 9f 06 lds r24, 0x069F ; 0x80069f 17fb8: 90 91 a0 06 lds r25, 0x06A0 ; 0x8006a0 17fbc: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 17fc0: 60 93 9d 06 sts 0x069D, r22 ; 0x80069d 17fc4: 70 93 9e 06 sts 0x069E, r23 ; 0x80069e 17fc8: 80 93 9f 06 sts 0x069F, r24 ; 0x80069f 17fcc: 90 93 a0 06 sts 0x06A0, r25 ; 0x8006a0 plan_buffer_line_curposXYZE(FILAMENTCHANGE_RFEED); 17fd0: 60 e0 ldi r22, 0x00 ; 0 17fd2: 70 e0 ldi r23, 0x00 ; 0 17fd4: 88 ee ldi r24, 0xE8 ; 232 17fd6: 92 e4 ldi r25, 0x42 ; 66 17fd8: 0f 94 04 c0 call 0x38008 ; 0x38008 st_synchronize(); 17fdc: 0f 94 a3 42 call 0x28546 ; 0x28546 SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_PAUSED); 17fe0: 8c e3 ldi r24, 0x3C ; 60 17fe2: 9f e6 ldi r25, 0x6F ; 111 17fe4: 0e 94 93 79 call 0xf326 ; 0xf326 // Filament change can be issued via the Tune menu restore_extruder_temperature_from_ram(); } // Raise the Z axis raise_z(z_shift); 17fe8: c3 01 movw r24, r6 17fea: b2 01 movw r22, r4 17fec: 0e 94 f9 6d call 0xdbf2 ; 0xdbf2 // Move XY to side current_position[X_AXIS] = x_position; 17ff0: 6a 96 adiw r28, 0x1a ; 26 17ff2: 2c ad ldd r18, Y+60 ; 0x3c 17ff4: 3d ad ldd r19, Y+61 ; 0x3d 17ff6: 4e ad ldd r20, Y+62 ; 0x3e 17ff8: 5f ad ldd r21, Y+63 ; 0x3f 17ffa: 6a 97 sbiw r28, 0x1a ; 26 17ffc: 20 93 91 06 sts 0x0691, r18 ; 0x800691 18000: 30 93 92 06 sts 0x0692, r19 ; 0x800692 18004: 40 93 93 06 sts 0x0693, r20 ; 0x800693 18008: 50 93 94 06 sts 0x0694, r21 ; 0x800694 current_position[Y_AXIS] = y_position; 1800c: 6e 96 adiw r28, 0x1e ; 30 1800e: 8c ad ldd r24, Y+60 ; 0x3c 18010: 9d ad ldd r25, Y+61 ; 0x3d 18012: ae ad ldd r26, Y+62 ; 0x3e 18014: bf ad ldd r27, Y+63 ; 0x3f 18016: 6e 97 sbiw r28, 0x1e ; 30 18018: 80 93 95 06 sts 0x0695, r24 ; 0x800695 1801c: 90 93 96 06 sts 0x0696, r25 ; 0x800696 18020: a0 93 97 06 sts 0x0697, r26 ; 0x800697 18024: b0 93 98 06 sts 0x0698, r27 ; 0x800698 plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); 18028: 60 e0 ldi r22, 0x00 ; 0 1802a: 70 e0 ldi r23, 0x00 ; 0 1802c: 88 e4 ldi r24, 0x48 ; 72 1802e: 92 e4 ldi r25, 0x42 ; 66 18030: 0f 94 04 c0 call 0x38008 ; 0x38008 st_synchronize(); 18034: 0f 94 a3 42 call 0x28546 ; 0x28546 bool repeat = false; 18038: 67 96 adiw r28, 0x17 ; 23 1803a: 1f ae std Y+63, r1 ; 0x3f 1803c: 67 97 sbiw r28, 0x17 ; 23 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; 1803e: b1 2c mov r11, 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)); 18040: 0a ed ldi r16, 0xDA ; 218 18042: 20 2e mov r2, r16 18044: 0e e7 ldi r16, 0x7E ; 126 18046: 30 2e mov r3, r16 delay_keep_alive(4); if (lcd_clicked()) { setTargetHotend(saved_extruder_temperature); lcd_wait_for_heater(); wait_for_user_state = 2; 18048: 82 e0 ldi r24, 0x02 ; 2 1804a: a8 2e mov r10, r24 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)); 1804c: 92 ee ldi r25, 0xE2 ; 226 1804e: 89 2e mov r8, r25 18050: 9e e7 ldi r25, 0x7E ; 126 18052: 99 2e mov r9, r25 st_synchronize(); bool repeat = false; do { // Unload filament if (MMU2::mmu2.Enabled()) { 18054: 80 91 b9 13 lds r24, 0x13B9 ; 0x8013b9 18058: 81 30 cpi r24, 0x01 ; 1 1805a: 09 f0 breq .+2 ; 0x1805e 1805c: ae c0 rjmp .+348 ; 0x181ba eject_slot = MMU2::mmu2.get_current_tool(); 1805e: 0f 94 74 74 call 0x2e8e8 ; 0x2e8e8 18062: b8 2e mov r11, r24 mmu_M600_unload_filament(); 18064: 0e 94 2f 73 call 0xe65e ; 0xe65e } 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 18068: 0f 94 a3 42 call 0x28546 ; 0x28546 FSensorBlockRunout fsBlockRunout; 1806c: 0f 94 69 86 call 0x30cd2 ; 0x30cd2 if (!MMU2::mmu2.Enabled()) 18070: 80 91 b9 13 lds r24, 0x13B9 ; 0x8013b9 18074: 81 30 cpi r24, 0x01 ; 1 18076: 09 f4 brne .+2 ; 0x1807a 18078: 6e c1 rjmp .+732 ; 0x18356 { KEEPALIVE_STATE(PAUSED_FOR_USER); 1807a: 84 e0 ldi r24, 0x04 ; 4 1807c: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be uint8_t choice = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_UNLOAD_SUCCESSFUL), false, LCD_LEFT_BUTTON_CHOICE); 18080: 82 e7 ldi r24, 0x72 ; 114 18082: 99 e3 ldi r25, 0x39 ; 57 18084: 0e 94 c4 72 call 0xe588 ; 0xe588 18088: 40 e0 ldi r20, 0x00 ; 0 1808a: 60 e0 ldi r22, 0x00 ; 0 1808c: 0f 94 fb 4e call 0x29df6 ; 0x29df6 18090: 08 2f mov r16, r24 lcd_update_enable(false); 18092: 80 e0 ldi r24, 0x00 ; 0 18094: 0e 94 3d 6f call 0xde7a ; 0xde7a if (choice == LCD_MIDDLE_BUTTON_CHOICE) { 18098: 01 30 cpi r16, 0x01 ; 1 1809a: 29 f5 brne .+74 ; 0x180e6 lcd_clear(); 1809c: 0e 94 2b 6f call 0xde56 ; 0xde56 lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); 180a0: 8a ee ldi r24, 0xEA ; 234 180a2: 99 e3 ldi r25, 0x39 ; 57 180a4: 0e 94 c4 72 call 0xe588 ; 0xe588 180a8: ac 01 movw r20, r24 180aa: 62 e0 ldi r22, 0x02 ; 2 180ac: 80 e0 ldi r24, 0x00 ; 0 180ae: 0e 94 0c 6f call 0xde18 ; 0xde18 current_position[X_AXIS] = 100; 180b2: 80 e0 ldi r24, 0x00 ; 0 180b4: 90 e0 ldi r25, 0x00 ; 0 180b6: a8 ec ldi r26, 0xC8 ; 200 180b8: b2 e4 ldi r27, 0x42 ; 66 180ba: 80 93 91 06 sts 0x0691, r24 ; 0x800691 180be: 90 93 92 06 sts 0x0692, r25 ; 0x800692 180c2: a0 93 93 06 sts 0x0693, r26 ; 0x800693 180c6: b0 93 94 06 sts 0x0694, r27 ; 0x800694 plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); 180ca: 60 e0 ldi r22, 0x00 ; 0 180cc: 70 e0 ldi r23, 0x00 ; 0 180ce: 88 e4 ldi r24, 0x48 ; 72 180d0: 92 e4 ldi r25, 0x42 ; 66 180d2: 0f 94 04 c0 call 0x38008 ; 0x38008 st_synchronize(); 180d6: 0f 94 a3 42 call 0x28546 ; 0x28546 lcd_show_fullscreen_message_and_wait_P(_T(MSG_CHECK_IDLER)); 180da: 80 e4 ldi r24, 0x40 ; 64 180dc: 99 e3 ldi r25, 0x39 ; 57 180de: 0e 94 c4 72 call 0xe588 ; 0xe588 180e2: 0f 94 c7 1f call 0x23f8e ; 0x23f8e preheat_or_continue(FilamentAction::UnLoad); } void lcd_wait_interact(const char* filament_name) { lcd_clear(); 180e6: 0e 94 2b 6f call 0xde56 ; 0xde56 lcd_puts_at_P(0, 0, _T(MSG_INSERT_FILAMENT)); 180ea: 8e ec ldi r24, 0xCE ; 206 180ec: 98 e3 ldi r25, 0x38 ; 56 180ee: 0e 94 c4 72 call 0xe588 ; 0xe588 180f2: ac 01 movw r20, r24 180f4: 60 e0 ldi r22, 0x00 ; 0 180f6: 80 e0 ldi r24, 0x00 ; 0 180f8: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_set_cursor(0, 1); 180fc: 61 e0 ldi r22, 0x01 ; 1 180fe: 80 e0 ldi r24, 0x00 ; 0 18100: 0e 94 f8 6e call 0xddf0 ; 0xddf0 if (filament_name[0]) { 18104: 89 81 ldd r24, Y+1 ; 0x01 18106: 88 23 and r24, r24 18108: 41 f0 breq .+16 ; 0x1811a lcd_print(filament_name); 1810a: ce 01 movw r24, r28 1810c: 01 96 adiw r24, 0x01 ; 1 1810e: 0e 94 ff 70 call 0xe1fe ; 0xe1fe lcd_set_cursor(0, 2); 18112: 62 e0 ldi r22, 0x02 ; 2 18114: 80 e0 ldi r24, 0x00 ; 0 18116: 0e 94 f8 6e call 0xddf0 ; 0xddf0 } #ifdef FILAMENT_SENSOR if (!fsensor.getAutoLoadEnabled()) 1811a: 80 91 aa 17 lds r24, 0x17AA ; 0x8017aa 1811e: 81 11 cpse r24, r1 18120: 06 c0 rjmp .+12 ; 0x1812e #endif //FILAMENT_SENSOR { lcd_puts_P(_T(MSG_PRESS)); 18122: 89 eb ldi r24, 0xB9 ; 185 18124: 98 e3 ldi r25, 0x38 ; 56 18126: 0e 94 c4 72 call 0xe588 ; 0xe588 1812a: 0e 94 e3 6e call 0xddc6 ; 0xddc6 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); 1812e: 84 e0 ldi r24, 0x04 ; 4 18130: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be while(!lcd_clicked()) 18134: 0e 94 15 71 call 0xe22a ; 0xe22a 18138: 81 11 cpse r24, r1 1813a: 10 c0 rjmp .+32 ; 0x1815c { manage_heater(); 1813c: 0f 94 2e 38 call 0x2705c ; 0x2705c manage_inactivity(true); 18140: 81 e0 ldi r24, 0x01 ; 1 18142: 0e 94 c7 8a call 0x1158e ; 0x1158e #ifdef FILAMENT_SENSOR if (fsensor.getFilamentLoadEvent()) { 18146: 80 91 ad 17 lds r24, 0x17AD ; 0x8017ad 1814a: 88 23 and r24, r24 1814c: 99 f3 breq .-26 ; 0x18134 Sound_MakeCustom(50,1000,false); 1814e: 40 e0 ldi r20, 0x00 ; 0 18150: 68 ee ldi r22, 0xE8 ; 232 18152: 73 e0 ldi r23, 0x03 ; 3 18154: 82 e3 ldi r24, 0x32 ; 50 18156: 90 e0 ldi r25, 0x00 ; 0 18158: 0f 94 01 51 call 0x2a202 ; 0x2a202 break; } #endif //FILAMENT_SENSOR } KEEPALIVE_STATE(IN_HANDLER); 1815c: a0 92 be 02 sts 0x02BE, r10 ; 0x8002be M600_load_filament_movements(filament_name); 18160: ce 01 movw r24, r28 18162: 01 96 adiw r24, 0x01 ; 1 18164: 0e 94 e8 72 call 0xe5d0 ; 0xe5d0 Sound_MakeCustom(50,1000,false); 18168: 40 e0 ldi r20, 0x00 ; 0 1816a: 68 ee ldi r22, 0xE8 ; 232 1816c: 73 e0 ldi r23, 0x03 ; 3 1816e: 82 e3 ldi r24, 0x32 ; 50 18170: 90 e0 ldi r25, 0x00 ; 0 18172: 0f 94 01 51 call 0x2a202 ; 0x2a202 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); 18176: b4 e0 ldi r27, 0x04 ; 4 18178: 7b 2e mov r7, r27 else // MMU is enabled { if (!automatic) mmu_M600_filament_change_screen(eject_slot); mmu_M600_load_filament(automatic); } if (!automatic) 1817a: 11 23 and r17, r17 1817c: 09 f4 brne .+2 ; 0x18180 1817e: 00 c1 rjmp .+512 ; 0x18380 18180: 0f 94 ad 7a call 0x2f55a ; 0x2f55a current_position[Y_AXIS] = y_position; plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); st_synchronize(); bool repeat = false; do { 18184: 67 96 adiw r28, 0x17 ; 23 18186: 4f ad ldd r20, Y+63 ; 0x3f 18188: 67 97 sbiw r28, 0x17 ; 23 1818a: 41 11 cpse r20, r1 1818c: 63 cf rjmp .-314 ; 0x18054 1818e: a1 c1 rjmp .+834 ; 0x184d2 // 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; 18190: 20 e0 ldi r18, 0x00 ; 0 18192: 30 e0 ldi r19, 0x00 ; 0 18194: 43 e5 ldi r20, 0x53 ; 83 18196: 53 e4 ldi r21, 0x43 ; 67 18198: 6a 96 adiw r28, 0x1a ; 26 1819a: 2c af std Y+60, r18 ; 0x3c 1819c: 3d af std Y+61, r19 ; 0x3d 1819e: 4e af std Y+62, r20 ; 0x3e 181a0: 5f af std Y+63, r21 ; 0x3f 181a2: 6a 97 sbiw r28, 0x1a ; 26 181a4: b4 ce rjmp .-664 ; 0x17f0e float y_position = FILAMENTCHANGE_YPOS; 181a6: 6e 96 adiw r28, 0x1e ; 30 181a8: 1c ae std Y+60, r1 ; 0x3c 181aa: 1d ae std Y+61, r1 ; 0x3d 181ac: 1e ae std Y+62, r1 ; 0x3e 181ae: 1f ae std Y+63, r1 ; 0x3f 181b0: 6e 97 sbiw r28, 0x1e ; 30 181b2: bb ce rjmp .-650 ; 0x17f2a 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(); 181b4: 0e 94 e1 64 call 0xc9c2 ; 0xc9c2 181b8: 17 cf rjmp .-466 ; 0x17fe8 //! //! 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); 181ba: 84 e0 ldi r24, 0x04 ; 4 181bc: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be unsigned long waiting_start_time = _millis(); 181c0: 0f 94 22 29 call 0x25244 ; 0x25244 181c4: 2b 01 movw r4, r22 181c6: 3c 01 movw r6, r24 uint8_t wait_for_user_state = 0; lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_UNLOAD)); 181c8: 8e e8 ldi r24, 0x8E ; 142 181ca: 98 e3 ldi r25, 0x38 ; 56 181cc: 0e 94 c4 72 call 0xe588 ; 0xe588 181d0: 0f 94 ba 1f call 0x23f74 ; 0x23f74 while (!(wait_for_user_state == 0 && lcd_clicked())){ 181d4: 0e 94 15 71 call 0xe22a ; 0xe22a 181d8: 08 2f mov r16, r24 181da: 81 11 cpse r24, r1 181dc: 38 c0 rjmp .+112 ; 0x1824e 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) { 181de: a3 01 movw r20, r6 181e0: 92 01 movw r18, r4 181e2: 20 54 subi r18, 0x40 ; 64 181e4: 38 4d sbci r19, 0xD8 ; 216 181e6: 46 4f sbci r20, 0xF6 ; 246 181e8: 5f 4f sbci r21, 0xFF ; 255 181ea: 6e 96 adiw r28, 0x1e ; 30 181ec: 2c af std Y+60, r18 ; 0x3c 181ee: 3d af std Y+61, r19 ; 0x3d 181f0: 4e af std Y+62, r20 ; 0x3e 181f2: 5f af std Y+63, r21 ; 0x3f 181f4: 6e 97 sbiw r28, 0x1e ; 30 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(); 181f6: 0f 94 2e 38 call 0x2705c ; 0x2705c manage_inactivity(true); 181fa: 81 e0 ldi r24, 0x01 ; 1 181fc: 0e 94 c7 8a call 0x1158e ; 0x1158e if (wait_for_user_state != 2) sound_wait_for_user(); 18200: 02 30 cpi r16, 0x02 ; 2 18202: 09 f4 brne .+2 ; 0x18206 18204: 67 c0 rjmp .+206 ; 0x182d4 18206: 0f 94 a5 51 call 0x2a34a ; 0x2a34a 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); 1820a: 84 e0 ldi r24, 0x04 ; 4 1820c: 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) { 1820e: 01 30 cpi r16, 0x01 ; 1 18210: 39 f1 breq .+78 ; 0x18260 case 0: //nozzle is hot, waiting for user to press the knob to unload filament delay_keep_alive(4); 18212: 0e 94 fc 8c call 0x119f8 ; 0x119f8 if (_millis() > waiting_start_time + (unsigned long)M600_TIMEOUT * 1000) { 18216: 0f 94 22 29 call 0x25244 ; 0x25244 1821a: 6e 96 adiw r28, 0x1e ; 30 1821c: 2c ad ldd r18, Y+60 ; 0x3c 1821e: 3d ad ldd r19, Y+61 ; 0x3d 18220: 4e ad ldd r20, Y+62 ; 0x3e 18222: 5f ad ldd r21, Y+63 ; 0x3f 18224: 6e 97 sbiw r28, 0x1e ; 30 18226: 26 17 cp r18, r22 18228: 37 07 cpc r19, r23 1822a: 48 07 cpc r20, r24 1822c: 59 07 cpc r21, r25 1822e: 90 f6 brcc .-92 ; 0x181d4 lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_PREHEAT)); 18230: 8d e5 ldi r24, 0x5D ; 93 18232: 98 e3 ldi r25, 0x38 ; 56 18234: 0e 94 c4 72 call 0xe588 ; 0xe588 18238: 0f 94 ba 1f call 0x23f74 ; 0x23f74 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 1823c: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 18240: 10 92 b5 0d sts 0x0DB5, r1 ; 0x800db5 wait_for_user_state = 1; setTargetHotend(0); st_synchronize(); 18244: 0f 94 a3 42 call 0x28546 ; 0x28546 disable_e0(); 18248: 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; 1824a: 01 e0 ldi r16, 0x01 ; 1 1824c: d4 cf rjmp .-88 ; 0x181f6 1824e: 10 92 6a 05 sts 0x056A, r1 ; 0x80056a <_ZL10beep_timer.lto_priv.494> /// @brief Resets the global state of sound_wait_for_user() void sound_wait_for_user_reset() { beep_timer.stop(); bFirst = false; 18252: 10 92 6d 05 sts 0x056D, r1 ; 0x80056d <_ZL6bFirst.lto_priv.495> 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); 18256: c7 01 movw r24, r14 18258: b6 01 movw r22, r12 1825a: 0e 94 2a f8 call 0x1f054 ; 0x1f054 1825e: 04 cf rjmp .-504 ; 0x18068 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); 18260: 0e 94 fc 8c call 0x119f8 ; 0x119f8 if (lcd_clicked()) { 18264: 0e 94 15 71 call 0xe22a ; 0xe22a 18268: 88 23 and r24, r24 1826a: 29 f2 breq .-118 ; 0x181f6 1826c: 80 91 ab 05 lds r24, 0x05AB ; 0x8005ab 18270: 90 91 ac 05 lds r25, 0x05AC ; 0x8005ac 18274: 90 93 b6 0d sts 0x0DB6, r25 ; 0x800db6 18278: 80 93 b5 0d sts 0x0DB5, r24 ; 0x800db5 return target_temp_reached; } #endif //PINDA_THERMISTOR void lcd_wait_for_heater() { lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING)); 1827c: 8b e2 ldi r24, 0x2B ; 43 1827e: 9c e3 ldi r25, 0x3C ; 60 18280: 0e 94 c4 72 call 0xe588 ; 0xe588 18284: 0f 94 ba 1f call 0x23f74 ; 0x23f74 lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 18288: 42 e8 ldi r20, 0x82 ; 130 1828a: 64 e0 ldi r22, 0x04 ; 4 1828c: 80 e0 ldi r24, 0x00 ; 0 1828e: 0e 94 18 6f call 0xde30 ; 0xde30 lcd_printf_P(PSTR("%3d/%3d"), (int16_t)degHotend(active_extruder), (int16_t) degTargetHotend(active_extruder)); 18292: 80 91 b6 0d lds r24, 0x0DB6 ; 0x800db6 18296: 8f 93 push r24 18298: 80 91 b5 0d lds r24, 0x0DB5 ; 0x800db5 1829c: 8f 93 push r24 1829e: 60 91 af 0d lds r22, 0x0DAF ; 0x800daf 182a2: 70 91 b0 0d lds r23, 0x0DB0 ; 0x800db0 182a6: 80 91 b1 0d lds r24, 0x0DB1 ; 0x800db1 182aa: 90 91 b2 0d lds r25, 0x0DB2 ; 0x800db2 182ae: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> 182b2: 7f 93 push r23 182b4: 6f 93 push r22 182b6: 3f 92 push r3 182b8: 2f 92 push r2 182ba: 0e 94 d1 6e call 0xdda2 ; 0xdda2 lcd_putc(LCD_STR_DEGREE[0]); 182be: 81 e8 ldi r24, 0x81 ; 129 182c0: 0e 94 e7 6e call 0xddce ; 0xddce 182c4: 0f 90 pop r0 182c6: 0f 90 pop r0 182c8: 0f 90 pop r0 182ca: 0f 90 pop r0 182cc: 0f 90 pop r0 182ce: 0f 90 pop r0 setTargetHotend(saved_extruder_temperature); lcd_wait_for_heater(); wait_for_user_state = 2; 182d0: 02 e0 ldi r16, 0x02 ; 2 182d2: 91 cf rjmp .-222 ; 0x181f6 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 182d4: 60 91 b5 0d lds r22, 0x0DB5 ; 0x800db5 182d8: 70 91 b6 0d lds r23, 0x0DB6 ; 0x800db6 182dc: 07 2e mov r0, r23 182de: 00 0c add r0, r0 182e0: 88 0b sbc r24, r24 182e2: 99 0b sbc r25, r25 182e4: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> } break; case 2: //waiting for nozzle to reach target temperature if (fabs(degTargetHotend(active_extruder) - degHotend(active_extruder)) < TEMP_HYSTERESIS) { 182e8: 20 91 af 0d lds r18, 0x0DAF ; 0x800daf 182ec: 30 91 b0 0d lds r19, 0x0DB0 ; 0x800db0 182f0: 40 91 b1 0d lds r20, 0x0DB1 ; 0x800db1 182f4: 50 91 b2 0d lds r21, 0x0DB2 ; 0x800db2 182f8: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 182fc: 9f 77 andi r25, 0x7F ; 127 182fe: 20 e0 ldi r18, 0x00 ; 0 18300: 30 e0 ldi r19, 0x00 ; 0 18302: 40 ea ldi r20, 0xA0 ; 160 18304: 50 e4 ldi r21, 0x40 ; 64 18306: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 1830a: 87 ff sbrs r24, 7 1830c: 0b c0 rjmp .+22 ; 0x18324 lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_UNLOAD)); 1830e: 8e e8 ldi r24, 0x8E ; 142 18310: 98 e3 ldi r25, 0x38 ; 56 18312: 0e 94 c4 72 call 0xe588 ; 0xe588 18316: 0f 94 ba 1f call 0x23f74 ; 0x23f74 waiting_start_time = _millis(); 1831a: 0f 94 22 29 call 0x25244 ; 0x25244 1831e: 2b 01 movw r4, r22 18320: 3c 01 movw r6, r24 18322: 58 cf rjmp .-336 ; 0x181d4 wait_for_user_state = 0; } else { lcd_set_cursor(1, 4); 18324: 64 e0 ldi r22, 0x04 ; 4 18326: 81 e0 ldi r24, 0x01 ; 1 18328: 0e 94 f8 6e call 0xddf0 ; 0xddf0 lcd_printf_P(PSTR("%3d"), (int16_t)degHotend(active_extruder)); 1832c: 60 91 af 0d lds r22, 0x0DAF ; 0x800daf 18330: 70 91 b0 0d lds r23, 0x0DB0 ; 0x800db0 18334: 80 91 b1 0d lds r24, 0x0DB1 ; 0x800db1 18338: 90 91 b2 0d lds r25, 0x0DB2 ; 0x800db2 1833c: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> 18340: 7f 93 push r23 18342: 6f 93 push r22 18344: 9f 92 push r9 18346: 8f 92 push r8 18348: 0e 94 d1 6e call 0xdda2 ; 0xdda2 1834c: 0f 90 pop r0 1834e: 0f 90 pop r0 18350: 0f 90 pop r0 18352: 0f 90 pop r0 18354: 50 cf rjmp .-352 ; 0x181f6 } M600_load_filament(filament_name); } else // MMU is enabled { if (!automatic) mmu_M600_filament_change_screen(eject_slot); 18356: 11 11 cpse r17, r1 18358: 03 c0 rjmp .+6 ; 0x18360 1835a: 8b 2d mov r24, r11 1835c: 0e 94 1f 8d call 0x11a3e ; 0x11a3e mmu_M600_load_filament(automatic); 18360: 81 2f mov r24, r17 18362: 0e 94 26 78 call 0xf04c ; 0xf04c 18366: 07 cf rjmp .-498 ; 0x18176 cursor_pos--; else Sound_MakeSound(e_SOUND_TYPE_BlindAlert); } else if (lcd_encoder > 0) { // Rotating knob clockwise if (cursor_pos < 3) 18368: 03 30 cpi r16, 0x03 ; 3 1836a: 10 f4 brcc .+4 ; 0x18370 cursor_pos++; 1836c: 0f 5f subi r16, 0xFF ; 255 1836e: 49 c0 rjmp .+146 ; 0x18402 else Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 18370: 87 e0 ldi r24, 0x07 ; 7 18372: 0f 94 c2 4d call 0x29b84 ; 0x29b84 18376: 45 c0 rjmp .+138 ; 0x18402 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); 18378: ce 01 movw r24, r28 1837a: 01 96 adiw r24, 0x01 ; 1 1837c: 0e 94 e8 72 call 0xe5d0 ; 0xe5d0 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); 18380: 70 92 be 02 sts 0x02BE, r7 ; 0x8002be uint8_t lcd_alright() { uint8_t cursor_pos = 0; lcd_clear(); 18384: 0e 94 2b 6f call 0xde56 ; 0xde56 lcd_puts_at_P(1, 0, _T(MSG_CORRECTLY)); 18388: 8a e0 ldi r24, 0x0A ; 10 1838a: 99 e3 ldi r25, 0x39 ; 57 1838c: 0e 94 c4 72 call 0xe588 ; 0xe588 18390: ac 01 movw r20, r24 18392: 60 e0 ldi r22, 0x00 ; 0 18394: 81 e0 ldi r24, 0x01 ; 1 18396: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_puts_at_P(1, 1, _T(MSG_NOT_LOADED)); 1839a: 84 ef ldi r24, 0xF4 ; 244 1839c: 98 e3 ldi r25, 0x38 ; 56 1839e: 0e 94 c4 72 call 0xe588 ; 0xe588 183a2: ac 01 movw r20, r24 183a4: 61 e0 ldi r22, 0x01 ; 1 183a6: 81 e0 ldi r24, 0x01 ; 1 183a8: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_puts_at_P(1, 2, _T(MSG_NOT_COLOR)); 183ac: 80 ee ldi r24, 0xE0 ; 224 183ae: 98 e3 ldi r25, 0x38 ; 56 183b0: 0e 94 c4 72 call 0xe588 ; 0xe588 183b4: ac 01 movw r20, r24 183b6: 62 e0 ldi r22, 0x02 ; 2 183b8: 81 e0 ldi r24, 0x01 ; 1 183ba: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_puts_at_P(1, 3, _T(MSG_UNLOAD_FILAMENT)); 183be: 8e e9 ldi r24, 0x9E ; 158 183c0: 96 e4 ldi r25, 0x46 ; 70 183c2: 0e 94 c4 72 call 0xe588 ; 0xe588 183c6: ac 01 movw r20, r24 183c8: 63 e0 ldi r22, 0x03 ; 3 183ca: 81 e0 ldi r24, 0x01 ; 1 183cc: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_putc_at(0, cursor_pos, '>'); 183d0: 4e e3 ldi r20, 0x3E ; 62 183d2: 60 e0 ldi r22, 0x00 ; 0 183d4: 80 e0 ldi r24, 0x00 ; 0 183d6: 0e 94 18 6f call 0xde30 ; 0xde30 lcd_consume_click(); 183da: 0e 94 10 71 call 0xe220 ; 0xe220 uint8_t lcd_alright() { uint8_t cursor_pos = 0; 183de: 00 e0 ldi r16, 0x00 ; 0 lcd_putc_at(0, cursor_pos, '>'); lcd_consume_click(); while (1) { manage_heater(); 183e0: 0f 94 2e 38 call 0x2705c ; 0x2705c manage_inactivity(true); 183e4: 81 e0 ldi r24, 0x01 ; 1 183e6: 0e 94 c7 8a call 0x1158e ; 0x1158e if (lcd_encoder) 183ea: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 183ee: 90 91 70 06 lds r25, 0x0670 ; 0x800670 183f2: 00 97 sbiw r24, 0x00 ; 0 183f4: d9 f0 breq .+54 ; 0x1842c { if (lcd_encoder < 0 ) { 183f6: 97 ff sbrs r25, 7 183f8: b7 cf rjmp .-146 ; 0x18368 // Rotating knob counter clockwise if (cursor_pos > 0) 183fa: 00 23 and r16, r16 183fc: 09 f4 brne .+2 ; 0x18400 183fe: b8 cf rjmp .-144 ; 0x18370 cursor_pos--; 18400: 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 ")); 18402: 46 ee ldi r20, 0xE6 ; 230 18404: 5e e7 ldi r21, 0x7E ; 126 18406: 60 e0 ldi r22, 0x00 ; 0 18408: 80 e0 ldi r24, 0x00 ; 0 1840a: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_putc_at(0, cursor_pos, '>'); 1840e: 4e e3 ldi r20, 0x3E ; 62 18410: 60 2f mov r22, r16 18412: 80 e0 ldi r24, 0x00 ; 0 18414: 0e 94 18 6f call 0xde30 ; 0xde30 // Consume rotation event and make feedback sound lcd_encoder = 0; 18418: 10 92 70 06 sts 0x0670, r1 ; 0x800670 1841c: 10 92 6f 06 sts 0x066F, r1 ; 0x80066f _delay(100); 18420: 64 e6 ldi r22, 0x64 ; 100 18422: 70 e0 ldi r23, 0x00 ; 0 18424: 80 e0 ldi r24, 0x00 ; 0 18426: 90 e0 ldi r25, 0x00 ; 0 18428: 0f 94 29 27 call 0x24e52 ; 0x24e52 } if (lcd_clicked()) 1842c: 0e 94 15 71 call 0xe22a ; 0xe22a 18430: 88 23 and r24, r24 18432: b1 f2 breq .-84 ; 0x183e0 { lcd_clear(); 18434: 0e 94 2b 6f call 0xde56 ; 0xde56 lcd_return_to_status(); 18438: 0f 94 7c 1e call 0x23cf8 ; 0x23cf8 lcd_change_filament_state = lcd_alright(); KEEPALIVE_STATE(IN_HANDLER); 1843c: a0 92 be 02 sts 0x02BE, r10 ; 0x8002be switch(lcd_change_filament_state) 18440: 02 30 cpi r16, 0x02 ; 2 18442: b1 f0 breq .+44 ; 0x18470 18444: 03 30 cpi r16, 0x03 ; 3 18446: 09 f4 brne .+2 ; 0x1844a 18448: f8 c0 rjmp .+496 ; 0x1863a 1844a: 01 30 cpi r16, 0x01 ; 1 1844c: 81 f5 brne .+96 ; 0x184ae { // Filament failed to load so load it again case 1: if (MMU2::mmu2.Enabled()) { 1844e: 80 91 b9 13 lds r24, 0x13B9 ; 0x8013b9 18452: 81 30 cpi r24, 0x01 ; 1 18454: 09 f0 breq .+2 ; 0x18458 18456: 90 cf rjmp .-224 ; 0x18378 uint8_t eject_slot = MMU2::mmu2.get_current_tool(); 18458: 0f 94 74 74 call 0x2e8e8 ; 0x2e8e8 1845c: 08 2f mov r16, r24 // Unload filament mmu_M600_unload_filament(); 1845e: 0e 94 2f 73 call 0xe65e ; 0xe65e // Ask to remove any old filament and load new mmu_M600_filament_change_screen(eject_slot); 18462: 80 2f mov r24, r16 18464: 0e 94 1f 8d call 0x11a3e ; 0x11a3e // After user clicks knob, MMU will load the filament mmu_M600_load_filament(false); 18468: 80 e0 ldi r24, 0x00 ; 0 1846a: 0e 94 26 78 call 0xf04c ; 0xf04c 1846e: 88 cf rjmp .-240 ; 0x18380 } break; // Filament loaded properly but color is not clear case 2: st_synchronize(); 18470: 0f 94 a3 42 call 0x28546 ; 0x28546 load_filament_final_feed(); 18474: 0e 94 ab 64 call 0xc956 ; 0xc956 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(); 18478: 0e 94 2b 6f call 0xde56 ; 0xde56 lcd_puts_at_P(0, 0, _T(MSG_LOADING_COLOR)); 1847c: 8e e1 ldi r24, 0x1E ; 30 1847e: 99 e3 ldi r25, 0x39 ; 57 18480: 0e 94 c4 72 call 0xe588 ; 0xe588 18484: ac 01 movw r20, r24 18486: 60 e0 ldi r22, 0x00 ; 0 18488: 80 e0 ldi r24, 0x00 ; 0 1848a: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); 1848e: 8a ee ldi r24, 0xEA ; 234 18490: 99 e3 ldi r25, 0x39 ; 57 18492: 0e 94 c4 72 call 0xe588 ; 0xe588 18496: ac 01 movw r20, r24 18498: 62 e0 ldi r22, 0x02 ; 2 1849a: 80 e0 ldi r24, 0x00 ; 0 1849c: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_loading_progress_bar((FILAMENTCHANGE_FINALFEED * 1000ul) / FILAMENTCHANGE_EFEED_FINAL); //show progress bar during filament loading slow sequence 184a0: 87 e9 ldi r24, 0x97 ; 151 184a2: 9d e1 ldi r25, 0x1D ; 29 184a4: 0f 94 45 20 call 0x2408a ; 0x2408a lcd_loading_color(); st_synchronize(); 184a8: 0f 94 a3 42 call 0x28546 ; 0x28546 184ac: 69 cf rjmp .-302 ; 0x18380 } void lcd_change_success() { lcd_clear(); 184ae: 0e 94 2b 6f call 0xde56 ; 0xde56 lcd_puts_at_P(0, 2, _T(MSG_CHANGE_SUCCESS)); 184b2: 8e e2 ldi r24, 0x2E ; 46 184b4: 99 e3 ldi r25, 0x39 ; 57 184b6: 0e 94 c4 72 call 0xe588 ; 0xe588 184ba: ac 01 movw r20, r24 184bc: 62 e0 ldi r22, 0x02 ; 2 184be: 80 e0 ldi r24, 0x00 ; 0 184c0: 0e 94 0c 6f call 0xde18 ; 0xde18 //! @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) 184c4: 00 23 and r16, r16 184c6: 19 f0 breq .+6 ; 0x184ce 184c8: 03 30 cpi r16, 0x03 ; 3 184ca: 09 f0 breq .+2 ; 0x184ce 184cc: 59 cf rjmp .-334 ; 0x18380 184ce: 0f 94 ad 7a call 0x2f55a ; 0x2f55a if (!automatic) repeat = M600_check_state_and_repeat(filament_name); } while (repeat); lcd_update_enable(true); 184d2: 81 e0 ldi r24, 0x01 ; 1 184d4: 0e 94 3d 6f call 0xde7a ; 0xde7a // Not let's go back to print fanSpeed = saved_fan_speed; 184d8: 80 91 aa 05 lds r24, 0x05AA ; 0x8005aa 184dc: 80 93 e5 03 sts 0x03E5, r24 ; 0x8003e5 // Feed a little of filament to stabilize pressure if (!automatic) { 184e0: 11 11 cpse r17, r1 184e2: 27 c0 rjmp .+78 ; 0x18532 if (printingIsPaused()) 184e4: 0e 94 9d 67 call 0xcf3a ; 0xcf3a 184e8: c0 90 9d 06 lds r12, 0x069D ; 0x80069d 184ec: d0 90 9e 06 lds r13, 0x069E ; 0x80069e 184f0: e0 90 9f 06 lds r14, 0x069F ; 0x80069f 184f4: f0 90 a0 06 lds r15, 0x06A0 ; 0x8006a0 184f8: 88 23 and r24, r24 184fa: 09 f4 brne .+2 ; 0x184fe 184fc: a3 c0 rjmp .+326 ; 0x18644 { // 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; 184fe: 20 e0 ldi r18, 0x00 ; 0 18500: 30 e0 ldi r19, 0x00 ; 0 18502: 40 e8 ldi r20, 0x80 ; 128 18504: 5f e3 ldi r21, 0x3F ; 63 18506: c7 01 movw r24, r14 18508: b6 01 movw r22, r12 1850a: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 1850e: 60 93 9d 06 sts 0x069D, r22 ; 0x80069d 18512: 70 93 9e 06 sts 0x069E, r23 ; 0x80069e 18516: 80 93 9f 06 sts 0x069F, r24 ; 0x80069f 1851a: 90 93 a0 06 sts 0x06A0, r25 ; 0x8006a0 plan_buffer_line_curposXYZE(FILAMENTCHANGE_RFEED); 1851e: 60 e0 ldi r22, 0x00 ; 0 18520: 70 e0 ldi r23, 0x00 ; 0 18522: 88 ee ldi r24, 0xE8 ; 232 18524: 92 e4 ldi r25, 0x42 ; 66 18526: 0f 94 04 c0 call 0x38008 ; 0x38008 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 1852a: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 1852e: 10 92 b5 0d sts 0x0DB5, r1 ; 0x800db5 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); 18532: e0 90 99 06 lds r14, 0x0699 ; 0x800699 18536: f0 90 9a 06 lds r15, 0x069A ; 0x80069a 1853a: 00 91 9b 06 lds r16, 0x069B ; 0x80069b 1853e: 10 91 9c 06 lds r17, 0x069C ; 0x80069c 18542: 20 91 77 02 lds r18, 0x0277 ; 0x800277 18546: 30 91 78 02 lds r19, 0x0278 ; 0x800278 1854a: 40 91 79 02 lds r20, 0x0279 ; 0x800279 1854e: 50 91 7a 02 lds r21, 0x027A ; 0x80027a 18552: 60 91 73 02 lds r22, 0x0273 ; 0x800273 18556: 70 91 74 02 lds r23, 0x0274 ; 0x800274 1855a: 80 91 75 02 lds r24, 0x0275 ; 0x800275 1855e: 90 91 76 02 lds r25, 0x0276 ; 0x800276 18562: 1f 92 push r1 18564: 1f 92 push r1 18566: 1f 92 push r1 18568: 1f 92 push r1 1856a: 81 2c mov r8, r1 1856c: 91 2c mov r9, r1 1856e: e8 e4 ldi r30, 0x48 ; 72 18570: ae 2e mov r10, r30 18572: e2 e4 ldi r30, 0x42 ; 66 18574: be 2e mov r11, r30 18576: fd e9 ldi r31, 0x9D ; 157 18578: cf 2e mov r12, r31 1857a: f6 e0 ldi r31, 0x06 ; 6 1857c: df 2e mov r13, r31 1857e: 0f 94 af b0 call 0x3615e ; 0x3615e st_synchronize(); 18582: 0f 94 a3 42 call 0x28546 ; 0x28546 // Move Z back plan_buffer_line(saved_pos[X_AXIS], saved_pos[Y_AXIS], saved_pos[Z_AXIS], current_position[E_AXIS], FILAMENTCHANGE_ZFEED); 18586: e0 90 7b 02 lds r14, 0x027B ; 0x80027b 1858a: f0 90 7c 02 lds r15, 0x027C ; 0x80027c 1858e: 00 91 7d 02 lds r16, 0x027D ; 0x80027d 18592: 10 91 7e 02 lds r17, 0x027E ; 0x80027e 18596: 20 91 77 02 lds r18, 0x0277 ; 0x800277 1859a: 30 91 78 02 lds r19, 0x0278 ; 0x800278 1859e: 40 91 79 02 lds r20, 0x0279 ; 0x800279 185a2: 50 91 7a 02 lds r21, 0x027A ; 0x80027a 185a6: 60 91 73 02 lds r22, 0x0273 ; 0x800273 185aa: 70 91 74 02 lds r23, 0x0274 ; 0x800274 185ae: 80 91 75 02 lds r24, 0x0275 ; 0x800275 185b2: 90 91 76 02 lds r25, 0x0276 ; 0x800276 185b6: 1f 92 push r1 185b8: 1f 92 push r1 185ba: 1f 92 push r1 185bc: 1f 92 push r1 185be: 81 2c mov r8, r1 185c0: 91 2c mov r9, r1 185c2: a0 e7 ldi r26, 0x70 ; 112 185c4: aa 2e mov r10, r26 185c6: a1 e4 ldi r26, 0x41 ; 65 185c8: ba 2e mov r11, r26 185ca: 0f 94 af b0 call 0x3615e ; 0x3615e st_synchronize(); 185ce: 0f 94 a3 42 call 0x28546 ; 0x28546 // Set E position to original plan_set_e_position(saved_pos[E_AXIS]); 185d2: 8f e7 ldi r24, 0x7F ; 127 185d4: 92 e0 ldi r25, 0x02 ; 2 185d6: 0f 94 79 63 call 0x2c6f2 ; 0x2c6f2 memcpy(current_position, saved_pos, sizeof(saved_pos)); 185da: 80 e1 ldi r24, 0x10 ; 16 185dc: e3 e7 ldi r30, 0x73 ; 115 185de: f2 e0 ldi r31, 0x02 ; 2 185e0: a1 e9 ldi r26, 0x91 ; 145 185e2: b6 e0 ldi r27, 0x06 ; 6 185e4: 01 90 ld r0, Z+ 185e6: 0d 92 st X+, r0 185e8: 8a 95 dec r24 185ea: e1 f7 brne .-8 ; 0x185e4 set_destination_to_current(); 185ec: 0e 94 52 68 call 0xd0a4 ; 0xd0a4 // Recover feed rate feedmultiply = saved_feedmultiply2; 185f0: 80 91 6f 03 lds r24, 0x036F ; 0x80036f 185f4: 90 91 70 03 lds r25, 0x0370 ; 0x800370 185f8: 80 93 39 02 sts 0x0239, r24 ; 0x800239 185fc: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a enquecommandf_P(MSG_M220, saved_feedmultiply2); 18600: 9f 93 push r25 18602: 8f 93 push r24 18604: 80 e6 ldi r24, 0x60 ; 96 18606: 9e e6 ldi r25, 0x6E ; 110 18608: 9f 93 push r25 1860a: 8f 93 push r24 1860c: 0e 94 ce 88 call 0x1119c ; 0x1119c if (printingIsPaused()) { 18610: 0e 94 9d 67 call 0xcf3a ; 0xcf3a 18614: 0f b6 in r0, 0x3f ; 63 18616: f8 94 cli 18618: de bf out 0x3e, r29 ; 62 1861a: 0f be out 0x3f, r0 ; 63 1861c: cd bf out 0x3d, r28 ; 61 1861e: 88 23 and r24, r24 18620: 41 f1 breq .+80 ; 0x18672 lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); 18622: 89 e6 ldi r24, 0x69 ; 105 18624: 9a e4 ldi r25, 0x4A ; 74 18626: 0e 94 c4 72 call 0xe588 ; 0xe588 1862a: 0e 94 38 f1 call 0x1e270 ; 0x1e270 } else { lcd_setstatuspgm(MSG_WELCOME); SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_RESUMED); } custom_message_type = CustomMsg::Status; 1862e: 10 92 c3 06 sts 0x06C3, r1 ; 0x8006c3 void clear_print_state_in_ram() { // Set flag to false in order to avoid using // the saved values during power panic isPartialBackupAvailable = false; 18632: 10 92 a1 06 sts 0x06A1, r1 ; 0x8006a1 18636: 0c 94 05 ab jmp 0x1560a ; 0x1560a st_synchronize(); break; // Unload filament case 3: return true; 1863a: 31 e0 ldi r19, 0x01 ; 1 1863c: 67 96 adiw r28, 0x17 ; 23 1863e: 3f af std Y+63, r19 ; 0x3f 18640: 67 97 sbiw r28, 0x17 ; 23 18642: 9e cd rjmp .-1220 ; 0x18180 setTargetHotend(0); } else { // Feed a little of filament to stabilize pressure current_position[E_AXIS] += FILAMENTCHANGE_RECFEED; 18644: 20 e0 ldi r18, 0x00 ; 0 18646: 30 e0 ldi r19, 0x00 ; 0 18648: 40 ea ldi r20, 0xA0 ; 160 1864a: 50 e4 ldi r21, 0x40 ; 64 1864c: c7 01 movw r24, r14 1864e: b6 01 movw r22, r12 18650: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 18654: 60 93 9d 06 sts 0x069D, r22 ; 0x80069d 18658: 70 93 9e 06 sts 0x069E, r23 ; 0x80069e 1865c: 80 93 9f 06 sts 0x069F, r24 ; 0x80069f 18660: 90 93 a0 06 sts 0x06A0, r25 ; 0x8006a0 plan_buffer_line_curposXYZE(FILAMENTCHANGE_EXFEED); 18664: 60 e0 ldi r22, 0x00 ; 0 18666: 70 e0 ldi r23, 0x00 ; 0 18668: 80 e0 ldi r24, 0x00 ; 0 1866a: 90 e4 ldi r25, 0x40 ; 64 1866c: 0f 94 04 c0 call 0x38008 ; 0x38008 18670: 60 cf rjmp .-320 ; 0x18532 if (printingIsPaused()) { lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); } else { lcd_setstatuspgm(MSG_WELCOME); 18672: 86 eb ldi r24, 0xB6 ; 182 18674: 90 e7 ldi r25, 0x70 ; 112 18676: 0e 94 38 f1 call 0x1e270 ; 0x1e270 SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_RESUMED); 1867a: 81 e3 ldi r24, 0x31 ; 49 1867c: 9b e6 ldi r25, 0x6B ; 107 1867e: 0e 94 93 79 call 0xf326 ; 0xf326 18682: d5 cf rjmp .-86 ; 0x1862e SERIAL_ECHOPGM("Y:"); SERIAL_ECHOLN(pause_position[Y_AXIS]); SERIAL_ECHOPGM("Z:"); SERIAL_ECHOLN(pause_position[Z_AXIS]); */ if (!printingIsPaused()) { 18684: 0e 94 9d 67 call 0xcf3a ; 0xcf3a 18688: 81 11 cpse r24, r1 1868a: 0c 94 05 ab jmp 0x1560a ; 0x1560a st_synchronize(); 1868e: 0f 94 a3 42 call 0x28546 ; 0x28546 ClearToSend(); //send OK even before the command finishes executing because we want to make sure it is not skipped because of cmdqueue_pop_front(); 18692: 0e 94 42 7f call 0xfe84 ; 0xfe84 cmdqueue_pop_front(); //trick because we want skip this command (M601) after restore 18696: 0e 94 d4 76 call 0xeda8 ; 0xeda8 lcd_pause_print(); 1869a: 0f 94 2e 29 call 0x2525c ; 0x2525c 1869e: 0c 94 05 ab jmp 0x1560a ; 0x1560a /*! ### M602 - Resume print M602: Resume print */ case 602: { if (printingIsPaused()) lcd_resume_print(); 186a2: 0e 94 9d 67 call 0xcf3a ; 0xcf3a 186a6: 88 23 and r24, r24 186a8: 11 f4 brne .+4 ; 0x186ae 186aa: 0c 94 05 ab jmp 0x1560a ; 0x1560a 186ae: 0c 94 cc ab jmp 0x15798 ; 0x15798 /*! ### M603 - Stop print M603: Stop print */ case 603: { print_stop(); 186b2: 60 e0 ldi r22, 0x00 ; 0 186b4: 80 e0 ldi r24, 0x00 ; 0 186b6: 0e 94 75 f4 call 0x1e8ea ; 0x1e8ea 186ba: 0c 94 05 ab jmp 0x1560a ; 0x1560a float z_val = 0; char strLabel[8]; uint8_t iBedC = 0; uint8_t iPindaC = 0; bool bIsActive=false; strLabel[7] = '\0'; // null terminate. 186be: 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')) { 186c0: 83 e5 ldi r24, 0x53 ; 83 186c2: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 186c6: 88 23 and r24, r24 186c8: b1 f0 breq .+44 ; 0x186f6 iSel = code_value_uint8(); 186ca: 0e 94 80 5b call 0xb700 ; 0xb700 186ce: 18 2f mov r17, r24 if (iSel>=max_sheets) 186d0: 88 30 cpi r24, 0x08 ; 8 186d2: b0 f0 brcs .+44 ; 0x18700 { SERIAL_PROTOCOLPGM("Invalid sheet ID. Allowed: 0.."); 186d4: 8b e4 ldi r24, 0x4B ; 75 186d6: 96 e8 ldi r25, 0x86 ; 134 186d8: 0e 94 68 77 call 0xeed0 ; 0xeed0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 186dc: 4a e0 ldi r20, 0x0A ; 10 186de: 67 e0 ldi r22, 0x07 ; 7 186e0: 70 e0 ldi r23, 0x00 ; 0 186e2: 80 e0 ldi r24, 0x00 ; 0 186e4: 90 e0 ldi r25, 0x00 ; 0 186e6: 0f 94 c1 d4 call 0x3a982 ; 0x3a982 SERIAL_PROTOCOL(max_sheets-1); SERIAL_PROTOCOLLN(""); 186ea: 86 ef ldi r24, 0xF6 ; 246 186ec: 92 e0 ldi r25, 0x02 ; 2 186ee: 0f 94 bb d5 call 0x3ab76 ; 0x3ab76 186f2: 0c 94 05 ab jmp 0x1560a ; 0x1560a break; // invalid sheet ID } } else { iSel = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 186f6: 81 ea ldi r24, 0xA1 ; 161 186f8: 9d e0 ldi r25, 0x0D ; 13 186fa: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 186fe: 18 2f mov r17, r24 } if (code_seen('Z')){ 18700: 8a e5 ldi r24, 0x5A ; 90 18702: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 18706: 88 23 and r24, r24 18708: 09 f4 brne .+2 ; 0x1870c 1870a: d7 c0 rjmp .+430 ; 0x188ba z_val = code_value(); 1870c: 0e 94 b5 60 call 0xc16a ; 0xc16a 18710: 2b 01 movw r4, r22 18712: 3c 01 movw r6, r24 zraw = z_val*cs.axis_steps_per_mm[Z_AXIS]; 18714: 20 91 c9 0d lds r18, 0x0DC9 ; 0x800dc9 18718: 30 91 ca 0d lds r19, 0x0DCA ; 0x800dca 1871c: 40 91 cb 0d lds r20, 0x0DCB ; 0x800dcb 18720: 50 91 cc 0d lds r21, 0x0DCC ; 0x800dcc 18724: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 18728: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> 1872c: 6b 01 movw r12, r22 if ((zraw < Z_BABYSTEP_MIN) || (zraw > Z_BABYSTEP_MAX)) 1872e: 9b 01 movw r18, r22 18730: 21 56 subi r18, 0x61 ; 97 18732: 30 4f sbci r19, 0xF0 ; 240 18734: 20 3a cpi r18, 0xA0 ; 160 18736: 3f 40 sbci r19, 0x0F ; 15 18738: 30 f0 brcs .+12 ; 0x18746 { SERIAL_PROTOCOLLNPGM(" Z VALUE OUT OF RANGE"); 1873a: 85 e3 ldi r24, 0x35 ; 53 1873c: 96 e8 ldi r25, 0x86 ; 134 1873e: 0e 94 93 79 call 0xf326 ; 0xf326 18742: 0c 94 05 ab jmp 0x1560a ; 0x1560a break; } eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[iSel].z_offset)),zraw); 18746: 5b e0 ldi r21, 0x0B ; 11 18748: 15 9f mul r17, r21 1874a: 90 01 movw r18, r0 1874c: 11 24 eor r1, r1 1874e: c9 01 movw r24, r18 18750: 80 5b subi r24, 0xB0 ; 176 18752: 92 4f sbci r25, 0xF2 ; 242 18754: 0f 94 19 dc call 0x3b832 ; 0x3b832 { 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')) 18758: 8c e4 ldi r24, 0x4C ; 76 1875a: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 1875e: bb e0 ldi r27, 0x0B ; 11 18760: 1b 9f mul r17, r27 18762: 70 01 movw r14, r0 18764: 11 24 eor r1, r1 18766: 57 01 movw r10, r14 18768: e7 eb ldi r30, 0xB7 ; 183 1876a: ae 1a sub r10, r30 1876c: e2 ef ldi r30, 0xF2 ; 242 1876e: be 0a sbc r11, r30 18770: 88 23 and r24, r24 18772: 09 f4 brne .+2 ; 0x18776 18774: be c0 rjmp .+380 ; 0x188f2 { char *src = strchr_pointer + 1; 18776: e0 91 93 03 lds r30, 0x0393 ; 0x800393 1877a: f0 91 94 03 lds r31, 0x0394 ; 0x800394 1877e: 31 96 adiw r30, 0x01 ; 1 18780: bf 01 movw r22, r30 while (*src == ' ') ++src; 18782: 81 91 ld r24, Z+ 18784: 80 32 cpi r24, 0x20 ; 32 18786: e1 f3 breq .-8 ; 0x18780 if (*src != '\0') 18788: 88 23 and r24, r24 1878a: 31 f0 breq .+12 ; 0x18798 { strncpy(strLabel,src,7); 1878c: 47 e0 ldi r20, 0x07 ; 7 1878e: 50 e0 ldi r21, 0x00 ; 0 18790: ce 01 movw r24, r28 18792: 01 96 adiw r24, 0x01 ; 1 18794: 0f 94 57 e2 call 0x3c4ae ; 0x3c4ae #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); 18798: 47 e0 ldi r20, 0x07 ; 7 1879a: 50 e0 ldi r21, 0x00 ; 0 1879c: b5 01 movw r22, r10 1879e: ce 01 movw r24, r28 187a0: 01 96 adiw r24, 0x01 ; 1 187a2: 0f 94 eb db call 0x3b7d6 ; 0x3b7d6 else { eeprom_read_block(strLabel, EEPROM_Sheets_base->s[iSel].name, sizeof(Sheet::name)); } if (code_seen('B')) 187a6: 82 e4 ldi r24, 0x42 ; 66 187a8: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 187ac: 57 01 movw r10, r14 187ae: fe ea ldi r31, 0xAE ; 174 187b0: af 1a sub r10, r31 187b2: f2 ef ldi r31, 0xF2 ; 242 187b4: bf 0a sbc r11, r31 187b6: 88 23 and r24, r24 187b8: 09 f4 brne .+2 ; 0x187bc 187ba: a3 c0 rjmp .+326 ; 0x18902 { iBedC = code_value_uint8(); 187bc: 0e 94 80 5b call 0xb700 ; 0xb700 187c0: 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); 187c2: 68 2f mov r22, r24 187c4: c5 01 movw r24, r10 187c6: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 else { iBedC = eeprom_read_byte(&EEPROM_Sheets_base->s[iSel].bed_temp); } if (code_seen('P')) 187ca: 80 e5 ldi r24, 0x50 ; 80 187cc: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 187d0: 2d ea ldi r18, 0xAD ; 173 187d2: e2 1a sub r14, r18 187d4: 22 ef ldi r18, 0xF2 ; 242 187d6: f2 0a sbc r15, r18 187d8: 88 23 and r24, r24 187da: 09 f4 brne .+2 ; 0x187de 187dc: 97 c0 rjmp .+302 ; 0x1890c { iPindaC = code_value_uint8(); 187de: 0e 94 80 5b call 0xb700 ; 0xb700 187e2: b8 2e mov r11, r24 187e4: 68 2f mov r22, r24 187e6: c7 01 movw r24, r14 187e8: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 else { iPindaC = eeprom_read_byte(&EEPROM_Sheets_base->s[iSel].pinda_temp); } if (code_seen('A')) 187ec: 81 e4 ldi r24, 0x41 ; 65 187ee: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 187f2: 88 23 and r24, r24 187f4: 09 f4 brne .+2 ; 0x187f8 187f6: 8f c0 rjmp .+286 ; 0x18916 { bIsActive |= code_value_uint8() || (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); 187f8: 0e 94 80 5b call 0xb700 ; 0xb700 187fc: 81 11 cpse r24, r1 187fe: 06 c0 rjmp .+12 ; 0x1880c 18800: 81 ea ldi r24, 0xA1 ; 161 18802: 9d e0 ldi r25, 0x0D ; 13 18804: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 18808: 18 13 cpse r17, r24 1880a: 8d c0 rjmp .+282 ; 0x18926 if(bIsActive && eeprom_is_sheet_initialized(iSel)) { 1880c: 81 2f mov r24, r17 1880e: 0e 94 59 76 call 0xecb2 ; 0xecb2 18812: 08 2f mov r16, r24 18814: 88 23 and r24, r24 18816: 29 f0 breq .+10 ; 0x18822 18818: 61 2f mov r22, r17 1881a: 81 ea ldi r24, 0xA1 ; 161 1881c: 9d e0 ldi r25, 0x0D ; 13 1881e: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 else { bIsActive = (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); } SERIAL_PROTOCOLPGM("Sheet "); 18822: 8e e2 ldi r24, 0x2E ; 46 18824: 96 e8 ldi r25, 0x86 ; 134 18826: 0e 94 68 77 call 0xeed0 ; 0xeed0 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 1882a: 61 2f mov r22, r17 1882c: 70 e0 ldi r23, 0x00 ; 0 1882e: 90 e0 ldi r25, 0x00 ; 0 18830: 80 e0 ldi r24, 0x00 ; 0 18832: 0f 94 26 d5 call 0x3aa4c ; 0x3aa4c SERIAL_PROTOCOL((int)iSel); if (!eeprom_is_sheet_initialized(iSel)) 18836: 81 2f mov r24, r17 18838: 0e 94 59 76 call 0xecb2 ; 0xecb2 1883c: 81 11 cpse r24, r1 1883e: 04 c0 rjmp .+8 ; 0x18848 SERIAL_PROTOCOLLNPGM(" NOT INITIALIZED"); 18840: 8d e1 ldi r24, 0x1D ; 29 18842: 96 e8 ldi r25, 0x86 ; 134 18844: 0e 94 93 79 call 0xf326 ; 0xf326 SERIAL_PROTOCOLPGM(" Z"); 18848: 8a e1 ldi r24, 0x1A ; 26 1884a: 96 e8 ldi r25, 0x86 ; 134 1884c: 0e 94 68 77 call 0xeed0 ; 0xeed0 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 18850: 44 e0 ldi r20, 0x04 ; 4 18852: c3 01 movw r24, r6 18854: b2 01 movw r22, r4 18856: 0f 94 42 d5 call 0x3aa84 ; 0x3aa84 SERIAL_PROTOCOL_F(z_val,4); SERIAL_PROTOCOLPGM(" R"); 1885a: 87 e1 ldi r24, 0x17 ; 23 1885c: 96 e8 ldi r25, 0x86 ; 134 1885e: 0e 94 68 77 call 0xeed0 ; 0xeed0 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 18862: b6 01 movw r22, r12 18864: dd 0c add r13, r13 18866: 88 0b sbc r24, r24 18868: 99 0b sbc r25, r25 1886a: 0f 94 26 d5 call 0x3aa4c ; 0x3aa4c SERIAL_PROTOCOL((int)zraw); SERIAL_PROTOCOLPGM(" L"); 1886e: 84 e1 ldi r24, 0x14 ; 20 18870: 96 e8 ldi r25, 0x86 ; 134 18872: 0e 94 68 77 call 0xeed0 ; 0xeed0 18876: ce 01 movw r24, r28 18878: 01 96 adiw r24, 0x01 ; 1 1887a: 0e 94 2c 88 call 0x11058 ; 0x11058 SERIAL_PROTOCOL(strLabel); SERIAL_PROTOCOLPGM(" B"); 1887e: 81 e1 ldi r24, 0x11 ; 17 18880: 96 e8 ldi r25, 0x86 ; 134 18882: 0e 94 68 77 call 0xeed0 ; 0xeed0 18886: 69 2d mov r22, r9 18888: 70 e0 ldi r23, 0x00 ; 0 1888a: 90 e0 ldi r25, 0x00 ; 0 1888c: 80 e0 ldi r24, 0x00 ; 0 1888e: 0f 94 26 d5 call 0x3aa4c ; 0x3aa4c SERIAL_PROTOCOL((int)iBedC); SERIAL_PROTOCOLPGM(" P"); 18892: 8e e0 ldi r24, 0x0E ; 14 18894: 96 e8 ldi r25, 0x86 ; 134 18896: 0e 94 68 77 call 0xeed0 ; 0xeed0 1889a: 6b 2d mov r22, r11 1889c: 70 e0 ldi r23, 0x00 ; 0 1889e: 90 e0 ldi r25, 0x00 ; 0 188a0: 80 e0 ldi r24, 0x00 ; 0 188a2: 0f 94 26 d5 call 0x3aa4c ; 0x3aa4c SERIAL_PROTOCOL((int)iPindaC); SERIAL_PROTOCOLPGM(" A"); 188a6: 8b e0 ldi r24, 0x0B ; 11 188a8: 96 e8 ldi r25, 0x86 ; 134 188aa: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_PROTOCOLLN((int)bIsActive); 188ae: 80 2f mov r24, r16 188b0: 90 e0 ldi r25, 0x00 ; 0 188b2: 0f 94 b0 74 call 0x2e960 ; 0x2e960 188b6: 0c 94 05 ab jmp 0x1560a ; 0x1560a } 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))); 188ba: ab e0 ldi r26, 0x0B ; 11 188bc: 1a 9f mul r17, r26 188be: c0 01 movw r24, r0 188c0: 11 24 eor r1, r1 188c2: 80 5b subi r24, 0xB0 ; 176 188c4: 92 4f sbci r25, 0xF2 ; 242 188c6: 0f 94 e5 db call 0x3b7ca ; 0x3b7ca 188ca: 6c 01 movw r12, r24 z_val = ((float)zraw/cs.axis_steps_per_mm[Z_AXIS]); 188cc: bc 01 movw r22, r24 188ce: 99 0f add r25, r25 188d0: 88 0b sbc r24, r24 188d2: 99 0b sbc r25, r25 188d4: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 188d8: 20 91 c9 0d lds r18, 0x0DC9 ; 0x800dc9 188dc: 30 91 ca 0d lds r19, 0x0DCA ; 0x800dca 188e0: 40 91 cb 0d lds r20, 0x0DCB ; 0x800dcb 188e4: 50 91 cc 0d lds r21, 0x0DCC ; 0x800dcc 188e8: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 188ec: 2b 01 movw r4, r22 188ee: 3c 01 movw r6, r24 188f0: 33 cf rjmp .-410 ; 0x18758 } 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)); 188f2: 47 e0 ldi r20, 0x07 ; 7 188f4: 50 e0 ldi r21, 0x00 ; 0 188f6: b5 01 movw r22, r10 188f8: ce 01 movw r24, r28 188fa: 01 96 adiw r24, 0x01 ; 1 188fc: 0f 94 c7 db call 0x3b78e ; 0x3b78e 18900: 52 cf rjmp .-348 ; 0x187a6 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); 18902: c5 01 movw r24, r10 18904: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 18908: 98 2e mov r9, r24 1890a: 5f cf rjmp .-322 ; 0x187ca 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); 1890c: c7 01 movw r24, r14 1890e: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 18912: b8 2e mov r11, r24 18914: 6b cf rjmp .-298 ; 0x187ec bIsActive = 0; } } else { bIsActive = (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); 18916: 81 ea ldi r24, 0xA1 ; 161 18918: 9d e0 ldi r25, 0x0D ; 13 1891a: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 1891e: 01 e0 ldi r16, 0x01 ; 1 18920: 18 17 cp r17, r24 18922: 09 f4 brne .+2 ; 0x18926 18924: 7e cf rjmp .-260 ; 0x18822 { 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; 18926: 00 e0 ldi r16, 0x00 ; 0 18928: 7c cf rjmp .-264 ; 0x18822 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)) ) { 1892a: c3 01 movw r24, r6 1892c: b2 01 movw r22, r4 1892e: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 18932: 20 91 97 03 lds r18, 0x0397 ; 0x800397 18936: 30 91 98 03 lds r19, 0x0398 ; 0x800398 1893a: 40 91 99 03 lds r20, 0x0399 ; 0x800399 1893e: 50 91 9a 03 lds r21, 0x039A ; 0x80039a 18942: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 18946: 87 fd sbrc r24, 7 18948: 02 c0 rjmp .+4 ; 0x1894e 1894a: 0c 94 ef aa jmp 0x155de ; 0x155de if ((_millis() - codenum) > 1000) //Print Temp Reading every 1 second while waiting. 1894e: 0f 94 22 29 call 0x25244 ; 0x25244 18952: 68 19 sub r22, r8 18954: 79 09 sbc r23, r9 18956: 8a 09 sbc r24, r10 18958: 9b 09 sbc r25, r11 1895a: 69 3e cpi r22, 0xE9 ; 233 1895c: 73 40 sbci r23, 0x03 ; 3 1895e: 81 05 cpc r24, r1 18960: 91 05 cpc r25, r1 18962: c8 f0 brcs .+50 ; 0x18996 { SERIAL_PROTOCOLPGM("P:"); 18964: 85 ee ldi r24, 0xE5 ; 229 18966: 95 e8 ldi r25, 0x85 ; 133 18968: 0e 94 68 77 call 0xeed0 ; 0xeed0 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 1896c: 60 91 97 03 lds r22, 0x0397 ; 0x800397 18970: 70 91 98 03 lds r23, 0x0398 ; 0x800398 18974: 80 91 99 03 lds r24, 0x0399 ; 0x800399 18978: 90 91 9a 03 lds r25, 0x039A ; 0x80039a 1897c: 41 e0 ldi r20, 0x01 ; 1 1897e: 0f 94 42 d5 call 0x3aa84 ; 0x3aa84 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 18982: 8f e2 ldi r24, 0x2F ; 47 18984: 0e 94 4f 77 call 0xee9e ; 0xee9e SERIAL_PROTOCOL_F(current_temperature_pinda, 1); SERIAL_PROTOCOL('/'); SERIAL_PROTOCOLLN(set_target_pinda); 18988: c8 01 movw r24, r16 1898a: 0f 94 b0 74 call 0x2e960 ; 0x2e960 codenum = _millis(); 1898e: 0f 94 22 29 call 0x25244 ; 0x25244 18992: 4b 01 movw r8, r22 18994: 5c 01 movw r10, r24 } manage_heater(); 18996: 0f 94 2e 38 call 0x2705c ; 0x2705c manage_inactivity(); 1899a: 80 e0 ldi r24, 0x00 ; 0 1899c: 0e 94 c7 8a call 0x1158e ; 0x1158e lcd_update(0); 189a0: 80 e0 ldi r24, 0x00 ; 0 189a2: 0e 94 bf 6e call 0xdd7e ; 0xdd7e 189a6: 0c 94 d6 aa jmp 0x155ac ; 0x155ac - `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 189aa: 8f e3 ldi r24, 0x3F ; 63 189ac: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 189b0: 88 23 and r24, r24 189b2: c9 f0 breq .+50 ; 0x189e6 SERIAL_PROTOCOLPGM("PINDA cal status: "); 189b4: 82 ed ldi r24, 0xD2 ; 210 189b6: 95 e8 ldi r25, 0x85 ; 133 189b8: 0e 94 68 77 call 0xeed0 ; 0xeed0 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); } 189bc: 86 ea ldi r24, 0xA6 ; 166 189be: 9f e0 ldi r25, 0x0F ; 15 189c0: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 189c4: 21 e0 ldi r18, 0x01 ; 1 189c6: 30 e0 ldi r19, 0x00 ; 0 189c8: 81 11 cpse r24, r1 189ca: 02 c0 rjmp .+4 ; 0x189d0 189cc: 30 e0 ldi r19, 0x00 ; 0 189ce: 20 e0 ldi r18, 0x00 ; 0 SERIAL_PROTOCOLLN(calibration_status_pinda()); 189d0: c9 01 movw r24, r18 189d2: 0f 94 b0 74 call 0x2e960 ; 0x2e960 SERIAL_PROTOCOLLNRPGM(_header); 189d6: 8b eb ldi r24, 0xBB ; 187 189d8: 95 e8 ldi r25, 0x85 ; 133 189da: 0e 94 93 79 call 0xf326 ; 0xf326 gcode_M861_print_pinda_cal_eeprom(); 189de: 0e 94 a0 77 call 0xef40 ; 0xef40 189e2: 0c 94 05 ab jmp 0x1560a ; 0x1560a } else if (code_seen('!')) { // ! - Set factory default values 189e6: 81 e2 ldi r24, 0x21 ; 33 189e8: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 189ec: 88 23 and r24, r24 189ee: 49 f1 breq .+82 ; 0x18a42 189f0: 61 e0 ldi r22, 0x01 ; 1 189f2: 86 ea ldi r24, 0xA6 ; 166 189f4: 9f e0 ldi r25, 0x0F ; 15 189f6: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 189fa: 68 e0 ldi r22, 0x08 ; 8 189fc: 70 e0 ldi r23, 0x00 ; 0 189fe: 80 eb ldi r24, 0xB0 ; 176 18a00: 9f e0 ldi r25, 0x0F ; 15 18a02: 0f 94 19 dc call 0x3b832 ; 0x3b832 18a06: 68 e1 ldi r22, 0x18 ; 24 18a08: 70 e0 ldi r23, 0x00 ; 0 18a0a: 82 eb ldi r24, 0xB2 ; 178 18a0c: 9f e0 ldi r25, 0x0F ; 15 18a0e: 0f 94 19 dc call 0x3b832 ; 0x3b832 18a12: 60 e3 ldi r22, 0x30 ; 48 18a14: 70 e0 ldi r23, 0x00 ; 0 18a16: 84 eb ldi r24, 0xB4 ; 180 18a18: 9f e0 ldi r25, 0x0F ; 15 18a1a: 0f 94 19 dc call 0x3b832 ; 0x3b832 18a1e: 60 e5 ldi r22, 0x50 ; 80 18a20: 70 e0 ldi r23, 0x00 ; 0 18a22: 86 eb ldi r24, 0xB6 ; 182 18a24: 9f e0 ldi r25, 0x0F ; 15 18a26: 0f 94 19 dc call 0x3b832 ; 0x3b832 18a2a: 68 e7 ldi r22, 0x78 ; 120 18a2c: 70 e0 ldi r23, 0x00 ; 0 18a2e: 88 eb ldi r24, 0xB8 ; 184 18a30: 9f e0 ldi r25, 0x0F ; 15 18a32: 0f 94 19 dc call 0x3b832 ; 0x3b832 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"); 18a36: 8a ea ldi r24, 0xAA ; 170 18a38: 95 e8 ldi r25, 0x85 ; 133 18a3a: 0e 94 93 79 call 0xf326 ; 0xf326 18a3e: 0c 94 05 ab jmp 0x1560a ; 0x1560a } else if (code_seen('Z')) { // Z - Set all values to 0 (effectively disabling PINDA temperature compensation) 18a42: 8a e5 ldi r24, 0x5A ; 90 18a44: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 18a48: 88 23 and r24, r24 18a4a: c1 f0 breq .+48 ; 0x18a7c if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 18a4c: 61 e0 ldi r22, 0x01 ; 1 18a4e: 86 ea ldi r24, 0xA6 ; 166 18a50: 9f e0 ldi r25, 0x0F ; 15 18a52: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 18a56: 00 eb ldi r16, 0xB0 ; 176 18a58: 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); 18a5a: 70 e0 ldi r23, 0x00 ; 0 18a5c: 60 e0 ldi r22, 0x00 ; 0 18a5e: c8 01 movw r24, r16 18a60: 0f 94 19 dc call 0x3b832 ; 0x3b832 18a64: 0e 5f subi r16, 0xFE ; 254 18a66: 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++) { 18a68: 0a 3b cpi r16, 0xBA ; 186 18a6a: 4f e0 ldi r20, 0x0F ; 15 18a6c: 14 07 cpc r17, r20 18a6e: a9 f7 brne .-22 ; 0x18a5a eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i, z_shift); } SERIAL_PROTOCOLLNPGM("zerorized"); 18a70: 80 ea ldi r24, 0xA0 ; 160 18a72: 95 e8 ldi r25, 0x85 ; 133 18a74: 0e 94 93 79 call 0xf326 ; 0xf326 18a78: 0c 94 05 ab jmp 0x1560a ; 0x1560a } else if (code_seen('S')) { // Sxxx Iyyy - Set compensation ustep value S for compensation table index I 18a7c: 83 e5 ldi r24, 0x53 ; 83 18a7e: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 18a82: 88 23 and r24, r24 18a84: 21 f1 breq .+72 ; 0x18ace int16_t usteps = code_value_short(); 18a86: 0e 94 8d 5b call 0xb71a ; 0xb71a 18a8a: 8c 01 movw r16, r24 if (code_seen('I')) { 18a8c: 89 e4 ldi r24, 0x49 ; 73 18a8e: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 18a92: 88 23 and r24, r24 18a94: 11 f4 brne .+4 ; 0x18a9a 18a96: 0c 94 05 ab jmp 0x1560a ; 0x1560a uint8_t index = code_value_uint8(); 18a9a: 0e 94 80 5b call 0xb700 ; 0xb700 if (index < 5) { 18a9e: 85 30 cpi r24, 0x05 ; 5 18aa0: 10 f0 brcs .+4 ; 0x18aa6 18aa2: 0c 94 05 ab jmp 0x1560a ; 0x1560a eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + index, usteps); 18aa6: 90 e0 ldi r25, 0x00 ; 0 18aa8: 88 52 subi r24, 0x28 ; 40 18aaa: 98 4f sbci r25, 0xF8 ; 248 18aac: b8 01 movw r22, r16 18aae: 88 0f add r24, r24 18ab0: 99 1f adc r25, r25 18ab2: 0f 94 19 dc call 0x3b832 ; 0x3b832 SERIAL_PROTOCOLLNRPGM(MSG_OK); 18ab6: 85 ef ldi r24, 0xF5 ; 245 18ab8: 9d e6 ldi r25, 0x6D ; 109 18aba: 0e 94 93 79 call 0xf326 ; 0xf326 SERIAL_PROTOCOLLNRPGM(_header); 18abe: 8b eb ldi r24, 0xBB ; 187 18ac0: 95 e8 ldi r25, 0x85 ; 133 18ac2: 0e 94 93 79 call 0xf326 ; 0xf326 gcode_M861_print_pinda_cal_eeprom(); 18ac6: 0e 94 a0 77 call 0xef40 ; 0xef40 18aca: 0c 94 05 ab jmp 0x1560a ; 0x1560a } } } else { SERIAL_PROTOCOLLNPGM("no valid command"); 18ace: 8f e8 ldi r24, 0x8F ; 143 18ad0: 95 e8 ldi r25, 0x85 ; 133 18ad2: 0e 94 93 79 call 0xf326 ; 0xf326 18ad6: 0c 94 05 ab jmp 0x1560a ; 0x1560a */ 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); 18ada: 0e 94 b5 60 call 0xc16a ; 0xc16a 18ade: 20 e0 ldi r18, 0x00 ; 0 18ae0: 30 e0 ldi r19, 0x00 ; 0 18ae2: 40 e2 ldi r20, 0x20 ; 32 18ae4: 51 e4 ldi r21, 0x41 ; 65 18ae6: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 18aea: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 18aee: 6c 5a subi r22, 0xAC ; 172 switch(nCommand) 18af0: 63 30 cpi r22, 0x03 ; 3 18af2: 09 f4 brne .+2 ; 0x18af6 18af4: a2 c0 rjmp .+324 ; 0x18c3a 18af6: 98 f5 brcc .+102 ; 0x18b5e 18af8: 61 30 cpi r22, 0x01 ; 1 18afa: 09 f4 brne .+2 ; 0x18afe 18afc: 59 c0 rjmp .+178 ; 0x18bb0 18afe: 62 30 cpi r22, 0x02 ; 2 18b00: 11 f0 breq .+4 ; 0x18b06 18b02: 0c 94 05 ab jmp 0x1560a ; 0x1560a ,(uint8_t)oCheckModel ); } uint16_t nPrinterType(bool bMMu) { if (bMMu) { 18b06: 80 91 b9 13 lds r24, 0x13B9 ; 0x8013b9 return pgm_read_word(&_nPrinterMmuType); 18b0a: e6 ed ldi r30, 0xD6 ; 214 18b0c: fe e7 ldi r31, 0x7E ; 126 ,(uint8_t)oCheckModel ); } uint16_t nPrinterType(bool bMMu) { if (bMMu) { 18b0e: 81 30 cpi r24, 0x01 ; 1 18b10: 11 f0 breq .+4 ; 0x18b16 return pgm_read_word(&_nPrinterMmuType); } else { return pgm_read_word(&_nPrinterType); 18b12: e8 ed ldi r30, 0xD8 ; 216 18b14: fe e7 ldi r31, 0x7E ; 126 18b16: 05 91 lpm r16, Z+ 18b18: 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')) 18b1a: 80 e5 ldi r24, 0x50 ; 80 18b1c: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 18b20: 88 23 and r24, r24 18b22: 09 f4 brne .+2 ; 0x18b26 18b24: 79 c0 rjmp .+242 ; 0x18c18 { uint16_t nPrinterModel; nPrinterModel=(uint16_t)code_value_long(); 18b26: 0e 94 9a 5b call 0xb734 ; 0xb734 menu_submenu(lcd_hw_setup_menu); } } void printer_model_check(uint16_t nPrinterModel, uint16_t actualPrinterModel) { if (oCheckModel == ClCheckMode::_None) 18b2a: f0 90 e9 04 lds r15, 0x04E9 ; 0x8004e9 18b2e: ff 20 and r15, r15 18b30: 11 f4 brne .+4 ; 0x18b36 18b32: 0c 94 05 ab jmp 0x1560a ; 0x1560a return; if (nPrinterModel == actualPrinterModel) 18b36: 60 17 cp r22, r16 18b38: 71 07 cpc r23, r17 18b3a: 11 f4 brne .+4 ; 0x18b40 18b3c: 0c 94 05 ab jmp 0x1560a ; 0x1560a // SERIAL_ECHOLNPGM("Printer model differs from the G-code ..."); // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN(actualPrinterModel); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN(nPrinterModel); render_M862_warnings( 18b40: 8d ef ldi r24, 0xFD ; 253 18b42: 97 e3 ldi r25, 0x37 ; 55 18b44: 0e 94 c4 72 call 0xe588 ; 0xe588 18b48: 8c 01 movw r16, r24 18b4a: 85 ec ldi r24, 0xC5 ; 197 18b4c: 97 e3 ldi r25, 0x37 ; 55 18b4e: 0e 94 c4 72 call 0xe588 ; 0xe588 18b52: 4f 2d mov r20, r15 18b54: b8 01 movw r22, r16 18b56: 0e 94 cc f4 call 0x1e998 ; 0x1e998 18b5a: 0c 94 05 ab jmp 0x1560a ; 0x1560a 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) 18b5e: 64 30 cpi r22, 0x04 ; 4 18b60: 09 f4 brne .+2 ; 0x18b64 18b62: be c0 rjmp .+380 ; 0x18ce0 18b64: 65 30 cpi r22, 0x05 ; 5 18b66: 11 f0 breq .+4 ; 0x18b6c 18b68: 0c 94 05 ab jmp 0x1560a ; 0x1560a 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')) 18b6c: 80 e5 ldi r24, 0x50 ; 80 18b6e: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 18b72: 88 23 and r24, r24 18b74: 09 f4 brne .+2 ; 0x18b78 18b76: 3a c1 rjmp .+628 ; 0x18dec { uint16_t nGcodeLevel; nGcodeLevel=(uint16_t)code_value_long(); 18b78: 0e 94 9a 5b call 0xb734 ; 0xb734 done: return true; } void gcode_level_check(uint16_t nGcodeLevel) { if (oCheckGcode == ClCheckMode::_None) 18b7c: 10 91 e7 04 lds r17, 0x04E7 ; 0x8004e7 18b80: 11 23 and r17, r17 18b82: 11 f4 brne .+4 ; 0x18b88 18b84: 0c 94 05 ab jmp 0x1560a ; 0x1560a return; if (nGcodeLevel <= (uint16_t)GCODE_LEVEL) 18b88: 62 30 cpi r22, 0x02 ; 2 18b8a: 71 05 cpc r23, r1 18b8c: 10 f4 brcc .+4 ; 0x18b92 18b8e: 0c 94 05 ab jmp 0x1560a ; 0x1560a // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN(GCODE_LEVEL); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN(nGcodeLevel); render_M862_warnings( 18b92: 89 ee ldi r24, 0xE9 ; 233 18b94: 96 e3 ldi r25, 0x36 ; 54 18b96: 0e 94 c4 72 call 0xe588 ; 0xe588 18b9a: 7c 01 movw r14, r24 18b9c: 88 eb ldi r24, 0xB8 ; 184 18b9e: 96 e3 ldi r25, 0x36 ; 54 18ba0: 0e 94 c4 72 call 0xe588 ; 0xe588 18ba4: 41 2f mov r20, r17 18ba6: b7 01 movw r22, r14 18ba8: 0e 94 cc f4 call 0x1e998 ; 0x1e998 18bac: 0c 94 05 ab jmp 0x1560a ; 0x1560a ClPrintChecking nCommand = static_cast((uint16_t)(code_value()*10) - 8620u); switch(nCommand) { case ClPrintChecking::_Nozzle: // ~ .1 uint16_t nDiameter; if(code_seen('P')) 18bb0: 80 e5 ldi r24, 0x50 ; 80 18bb2: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 18bb6: 88 23 and r24, r24 18bb8: a9 f0 breq .+42 ; 0x18be4 { nDiameter=(uint16_t)(code_value()*1000.0+0.5); // [,um] 18bba: 0e 94 b5 60 call 0xc16a ; 0xc16a 18bbe: 20 e0 ldi r18, 0x00 ; 0 18bc0: 30 e0 ldi r19, 0x00 ; 0 18bc2: 4a e7 ldi r20, 0x7A ; 122 18bc4: 54 e4 ldi r21, 0x44 ; 68 18bc6: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 18bca: 20 e0 ldi r18, 0x00 ; 0 18bcc: 30 e0 ldi r19, 0x00 ; 0 18bce: 40 e0 ldi r20, 0x00 ; 0 18bd0: 5f e3 ldi r21, 0x3F ; 63 18bd2: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 18bd6: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> nozzle_diameter_check(nDiameter); 18bda: cb 01 movw r24, r22 18bdc: 0e 94 0b f5 call 0x1ea16 ; 0x1ea16 18be0: 0c 94 05 ab jmp 0x1560a ; 0x1560a } else if(code_seen('Q')) 18be4: 81 e5 ldi r24, 0x51 ; 81 18be6: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 18bea: 88 23 and r24, r24 18bec: 11 f4 brne .+4 ; 0x18bf2 18bee: 0c 94 05 ab jmp 0x1560a ; 0x1560a SERIAL_PROTOCOLLN((float)eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM)/1000.0); 18bf2: 85 ea ldi r24, 0xA5 ; 165 18bf4: 9d e0 ldi r25, 0x0D ; 13 18bf6: 0f 94 e5 db call 0x3b7ca ; 0x3b7ca 18bfa: bc 01 movw r22, r24 18bfc: 90 e0 ldi r25, 0x00 ; 0 18bfe: 80 e0 ldi r24, 0x00 ; 0 18c00: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 18c04: 20 e0 ldi r18, 0x00 ; 0 18c06: 30 e0 ldi r19, 0x00 ; 0 18c08: 4a e7 ldi r20, 0x7A ; 122 18c0a: 54 e4 ldi r21, 0x44 ; 68 18c0c: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 18c10: 0f 94 6f 74 call 0x2e8de ; 0x2e8de 18c14: 0c 94 05 ab jmp 0x1560a ; 0x1560a 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')) 18c18: 81 e5 ldi r24, 0x51 ; 81 18c1a: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 18c1e: 88 23 and r24, r24 18c20: 11 f4 brne .+4 ; 0x18c26 18c22: 0c 94 05 ab jmp 0x1560a ; 0x1560a print((long) n, base); } void MarlinSerial::print(unsigned int n, int base) { print((unsigned long) n, base); 18c26: b8 01 movw r22, r16 18c28: 90 e0 ldi r25, 0x00 ; 0 18c2a: 80 e0 ldi r24, 0x00 ; 0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 18c2c: 4a e0 ldi r20, 0x0A ; 10 18c2e: 0f 94 c1 d4 call 0x3a982 ; 0x3a982 } void MarlinSerial::println(unsigned int n, int base) { print(n, base); println(); 18c32: 0f 94 b8 d5 call 0x3ab70 ; 0x3ab70 18c36: 0c 94 05 ab jmp 0x1560a ; 0x1560a return pgm_read_word(&_nPrinterType); } } const char *sPrinterType(bool bMMu) { if (bMMu) { 18c3a: 80 91 b9 13 lds r24, 0x13B9 ; 0x8013b9 return _sPrinterMmuName; 18c3e: 6e ec ldi r22, 0xCE ; 206 18c40: e6 2e mov r14, r22 18c42: 6e e7 ldi r22, 0x7E ; 126 18c44: f6 2e mov r15, r22 return pgm_read_word(&_nPrinterType); } } const char *sPrinterType(bool bMMu) { if (bMMu) { 18c46: 81 30 cpi r24, 0x01 ; 1 18c48: 21 f0 breq .+8 ; 0x18c52 return _sPrinterMmuName; } else { return _sPrinterName; 18c4a: 5a ec ldi r21, 0xCA ; 202 18c4c: e5 2e mov r14, r21 18c4e: 5e e7 ldi r21, 0x7E ; 126 18c50: f5 2e mov r15, r21 SERIAL_PROTOCOLLN(type); } break; case ClPrintChecking::_Smodel: { // ~ .3 const char *type = sPrinterType(MMU2::mmu2.Enabled()); if(code_seen('P')) 18c52: 80 e5 ldi r24, 0x50 ; 80 18c54: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 18c58: 88 23 and r24, r24 18c5a: b1 f1 breq .+108 ; 0x18cc8 , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 18c5c: 62 e2 ldi r22, 0x22 ; 34 18c5e: 70 e0 ldi r23, 0x00 ; 0 18c60: 80 91 93 03 lds r24, 0x0393 ; 0x800393 18c64: 90 91 94 03 lds r25, 0x0394 ; 0x800394 18c68: 0f 94 2e e2 call 0x3c45c ; 0x3c45c 18c6c: 8c 01 movw r16, r24 if (!this->ptr) { 18c6e: 89 2b or r24, r25 18c70: d1 f0 breq .+52 ; 0x18ca6 // First quote not found return; } // Skip the leading quote this->ptr++; 18c72: 0f 5f subi r16, 0xFF ; 255 18c74: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 18c76: 62 e2 ldi r22, 0x22 ; 34 18c78: 70 e0 ldi r23, 0x00 ; 0 18c7a: c8 01 movw r24, r16 18c7c: 0f 94 2e e2 call 0x3c45c ; 0x3c45c if(!pStrEnd) { 18c80: 00 97 sbiw r24, 0x00 ; 0 18c82: 89 f0 breq .+34 ; 0x18ca6 // Second quote not found return; } this->len = pStrEnd - this->ptr; 18c84: d8 2e mov r13, r24 18c86: d0 1a sub r13, r16 18c88: c7 01 movw r24, r14 18c8a: 0f 94 95 d9 call 0x3b32a ; 0x3b32a <__strlen_P> unquoted_string smodel = unquoted_string(pStrPos); if(smodel.WasFound()) { const uint8_t compareLength = strlen_P(actualPrinterSModel); if(compareLength == smodel.GetLength()) { 18c8e: d8 12 cpse r13, r24 18c90: 0a c0 rjmp .+20 ; 0x18ca6 if (strncmp_P(smodel.GetUnquotedString(), actualPrinterSModel, compareLength) == 0) return; 18c92: ac 01 movw r20, r24 18c94: 55 27 eor r21, r21 18c96: b7 01 movw r22, r14 18c98: c8 01 movw r24, r16 18c9a: 0f 94 b6 d9 call 0x3b36c ; 0x3b36c 18c9e: 89 2b or r24, r25 18ca0: 11 f4 brne .+4 ; 0x18ca6 18ca2: 0c 94 05 ab jmp 0x1560a ; 0x1560a } } render_M862_warnings( 18ca6: f0 90 e9 04 lds r15, 0x04E9 ; 0x8004e9 18caa: 8d ef ldi r24, 0xFD ; 253 18cac: 97 e3 ldi r25, 0x37 ; 55 18cae: 0e 94 c4 72 call 0xe588 ; 0xe588 18cb2: 8c 01 movw r16, r24 18cb4: 85 ec ldi r24, 0xC5 ; 197 18cb6: 97 e3 ldi r25, 0x37 ; 55 18cb8: 0e 94 c4 72 call 0xe588 ; 0xe588 18cbc: 4f 2d mov r20, r15 18cbe: b8 01 movw r22, r16 18cc0: 0e 94 cc f4 call 0x1e998 ; 0x1e998 18cc4: 0c 94 05 ab jmp 0x1560a ; 0x1560a { printer_smodel_check(strchr_pointer, type); } else if(code_seen('Q')) 18cc8: 81 e5 ldi r24, 0x51 ; 81 18cca: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 18cce: 88 23 and r24, r24 18cd0: 11 f4 brne .+4 ; 0x18cd6 18cd2: 0c 94 05 ab jmp 0x1560a ; 0x1560a SERIAL_PROTOCOLLNRPGM(type); 18cd6: c7 01 movw r24, r14 18cd8: 0e 94 93 79 call 0xf326 ; 0xf326 18cdc: 0c 94 05 ab jmp 0x1560a ; 0x1560a } break; case ClPrintChecking::_Version: // ~ .4 if(code_seen('P')) 18ce0: 80 e5 ldi r24, 0x50 ; 80 18ce2: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 18ce6: 88 23 and r24, r24 18ce8: 09 f4 brne .+2 ; 0x18cec 18cea: 77 c0 rjmp .+238 ; 0x18dda fw_version_check(++strchr_pointer); 18cec: 80 91 93 03 lds r24, 0x0393 ; 0x800393 18cf0: 90 91 94 03 lds r25, 0x0394 ; 0x800394 18cf4: 01 96 adiw r24, 0x01 ; 1 18cf6: 90 93 94 03 sts 0x0394, r25 ; 0x800394 18cfa: 80 93 93 03 sts 0x0393, r24 ; 0x800393 return ((uint8_t)ClCompareValue::_Less); return ((uint8_t)ClCompareValue::_Equal); } void fw_version_check(const char *pVersion) { if (oCheckVersion == ClCheckMode::_None) 18cfe: 20 91 e8 04 lds r18, 0x04E8 ; 0x8004e8 18d02: 22 23 and r18, r18 18d04: 11 f4 brne .+4 ; 0x18d0a 18d06: 0c 94 05 ab jmp 0x1560a ; 0x1560a return; uint16_t aVersion[4]; uint8_t nCompareValueResult; parse_version(pVersion, aVersion); 18d0a: be 01 movw r22, r28 18d0c: 6f 5f subi r22, 0xFF ; 255 18d0e: 7f 4f sbci r23, 0xFF ; 255 18d10: 0e 94 4c ef call 0x1de98 ; 0x1de98 nCompareValueResult = mCompareValue(aVersion[0], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_MAJOR)) << 6; 18d14: 8a e0 ldi r24, 0x0A ; 10 18d16: 90 e0 ldi r25, 0x00 ; 0 18d18: 0f 94 e5 db call 0x3b7ca ; 0x3b7ca 18d1c: 29 81 ldd r18, Y+1 ; 0x01 18d1e: 3a 81 ldd r19, Y+2 ; 0x02 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 18d20: 12 e0 ldi r17, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 18d22: 82 17 cp r24, r18 18d24: 93 07 cpc r25, r19 18d26: 28 f0 brcs .+10 ; 0x18d32 return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 18d28: 11 e0 ldi r17, 0x01 ; 1 18d2a: 28 17 cp r18, r24 18d2c: 39 07 cpc r19, r25 18d2e: 08 f4 brcc .+2 ; 0x18d32 18d30: 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; 18d32: 12 95 swap r17 18d34: 11 0f add r17, r17 18d36: 11 0f add r17, r17 18d38: 10 7c andi r17, 0xC0 ; 192 nCompareValueResult += mCompareValue(aVersion[1], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_MINOR)) << 4; 18d3a: 8c e0 ldi r24, 0x0C ; 12 18d3c: 90 e0 ldi r25, 0x00 ; 0 18d3e: 0f 94 e5 db call 0x3b7ca ; 0x3b7ca 18d42: ac 01 movw r20, r24 18d44: 2b 81 ldd r18, Y+3 ; 0x03 18d46: 3c 81 ldd r19, Y+4 ; 0x04 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 18d48: 82 e0 ldi r24, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 18d4a: 42 17 cp r20, r18 18d4c: 53 07 cpc r21, r19 18d4e: 28 f0 brcs .+10 ; 0x18d5a return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 18d50: 81 e0 ldi r24, 0x01 ; 1 18d52: 24 17 cp r18, r20 18d54: 35 07 cpc r19, r21 18d56: 08 f4 brcc .+2 ; 0x18d5a 18d58: 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; 18d5a: 50 e1 ldi r21, 0x10 ; 16 18d5c: 85 9f mul r24, r21 18d5e: c0 01 movw r24, r0 18d60: 11 24 eor r1, r1 18d62: 18 0f add r17, r24 nCompareValueResult += mCompareValue(aVersion[2], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_REVISION)) << 2; 18d64: 8e e0 ldi r24, 0x0E ; 14 18d66: 90 e0 ldi r25, 0x00 ; 0 18d68: 0f 94 e5 db call 0x3b7ca ; 0x3b7ca 18d6c: ac 01 movw r20, r24 18d6e: 2d 81 ldd r18, Y+5 ; 0x05 18d70: 3e 81 ldd r19, Y+6 ; 0x06 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 18d72: 82 e0 ldi r24, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 18d74: 42 17 cp r20, r18 18d76: 53 07 cpc r21, r19 18d78: 28 f0 brcs .+10 ; 0x18d84 return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 18d7a: 81 e0 ldi r24, 0x01 ; 1 18d7c: 24 17 cp r18, r20 18d7e: 35 07 cpc r19, r21 18d80: 08 f4 brcc .+2 ; 0x18d84 18d82: 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; 18d84: a4 e0 ldi r26, 0x04 ; 4 18d86: 8a 9f mul r24, r26 18d88: c0 01 movw r24, r0 18d8a: 11 24 eor r1, r1 18d8c: 18 0f add r17, r24 nCompareValueResult += mCompareValue(aVersion[3], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_FLAVOR)); 18d8e: 80 e1 ldi r24, 0x10 ; 16 18d90: 90 e0 ldi r25, 0x00 ; 0 18d92: 0f 94 e5 db call 0x3b7ca ; 0x3b7ca 18d96: ac 01 movw r20, r24 18d98: 2f 81 ldd r18, Y+7 ; 0x07 18d9a: 38 85 ldd r19, Y+8 ; 0x08 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 18d9c: 92 e0 ldi r25, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 18d9e: 42 17 cp r20, r18 18da0: 53 07 cpc r21, r19 18da2: 28 f0 brcs .+10 ; 0x18dae return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 18da4: 91 e0 ldi r25, 0x01 ; 1 18da6: 24 17 cp r18, r20 18da8: 35 07 cpc r19, r21 18daa: 08 f4 brcc .+2 ; 0x18dae 18dac: 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)); 18dae: 19 0f add r17, r25 if (nCompareValueResult <= COMPARE_VALUE_EQUAL) 18db0: 16 35 cpi r17, 0x56 ; 86 18db2: 10 f4 brcc .+4 ; 0x18db8 18db4: 0c 94 05 ab jmp 0x1560a ; 0x1560a SERIAL_ECHO(aVersion[2]); SERIAL_ECHO('.'); SERIAL_ECHOLN(aVersion[3]); */ render_M862_warnings( 18db8: f0 90 e8 04 lds r15, 0x04E8 ; 0x8004e8 18dbc: 82 e7 ldi r24, 0x72 ; 114 18dbe: 97 e3 ldi r25, 0x37 ; 55 18dc0: 0e 94 c4 72 call 0xe588 ; 0xe588 18dc4: 8c 01 movw r16, r24 18dc6: 82 e4 ldi r24, 0x42 ; 66 18dc8: 97 e3 ldi r25, 0x37 ; 55 18dca: 0e 94 c4 72 call 0xe588 ; 0xe588 18dce: 4f 2d mov r20, r15 18dd0: b8 01 movw r22, r16 18dd2: 0e 94 cc f4 call 0x1e998 ; 0x1e998 18dd6: 0c 94 05 ab jmp 0x1560a ; 0x1560a else if(code_seen('Q')) 18dda: 81 e5 ldi r24, 0x51 ; 81 18ddc: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 18de0: 88 23 and r24, r24 18de2: 11 f4 brne .+4 ; 0x18de8 18de4: 0c 94 05 ab jmp 0x1560a ; 0x1560a 18de8: 0c 94 81 a7 jmp 0x14f02 ; 0x14f02 { uint16_t nGcodeLevel; nGcodeLevel=(uint16_t)code_value_long(); gcode_level_check(nGcodeLevel); } else if(code_seen('Q')) 18dec: 81 e5 ldi r24, 0x51 ; 81 18dee: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 18df2: 88 23 and r24, r24 18df4: 11 f4 brne .+4 ; 0x18dfa 18df6: 0c 94 05 ab jmp 0x1560a ; 0x1560a SERIAL_PROTOCOLLN(GCODE_LEVEL); 18dfa: 81 e0 ldi r24, 0x01 ; 1 18dfc: 90 e0 ldi r25, 0x00 ; 0 18dfe: 0f 94 b0 74 call 0x2e960 ; 0x2e960 18e02: 0c 94 05 ab jmp 0x1560a ; 0x1560a * 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; 18e06: 8b e4 ldi r24, 0x4B ; 75 18e08: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 18e0c: c1 2c mov r12, r1 18e0e: d1 2c mov r13, r1 18e10: e1 2c mov r14, r1 18e12: 40 ec ldi r20, 0xC0 ; 192 18e14: f4 2e mov r15, r20 18e16: 88 23 and r24, r24 18e18: 49 f1 breq .+82 ; 0x18e6c 18e1a: 0e 94 b5 60 call 0xc16a ; 0xc16a 18e1e: 6b 01 movw r12, r22 18e20: 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) 18e22: 20 e0 ldi r18, 0x00 ; 0 18e24: 30 e0 ldi r19, 0x00 ; 0 18e26: a9 01 movw r20, r18 18e28: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 18e2c: 81 11 cpse r24, r1 18e2e: 1e c0 rjmp .+60 ; 0x18e6c { extruder_advance_K = 0; 18e30: 10 92 64 05 sts 0x0564, r1 ; 0x800564 18e34: 10 92 65 05 sts 0x0565, r1 ; 0x800565 18e38: 10 92 66 05 sts 0x0566, r1 ; 0x800566 18e3c: 10 92 67 05 sts 0x0567, r1 ; 0x800567 18e40: 0e 94 2f 82 call 0x1045e ; 0x1045e else extruder_advance_K = newK; } #endif SERIAL_ECHO_START; 18e44: 82 ef ldi r24, 0xF2 ; 242 18e46: 9b ea ldi r25, 0xAB ; 171 18e48: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHOPGM("Advance K="); 18e4c: 87 ea ldi r24, 0xA7 ; 167 18e4e: 9e e7 ldi r25, 0x7E ; 126 18e50: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHOLN(extruder_advance_K); 18e54: 60 91 64 05 lds r22, 0x0564 ; 0x800564 18e58: 70 91 65 05 lds r23, 0x0565 ; 0x800565 18e5c: 80 91 66 05 lds r24, 0x0566 ; 0x800566 18e60: 90 91 67 05 lds r25, 0x0567 ; 0x800567 18e64: 0f 94 6f 74 call 0x2e8de ; 0x2e8de 18e68: 0c 94 05 ab jmp 0x1560a ; 0x1560a } float la10c_value(float k) { if(la10c_mode == LA10C_UNKNOWN) 18e6c: 80 91 6e 03 lds r24, 0x036E ; 0x80036e 18e70: 81 11 cpse r24, r1 18e72: 1b c0 rjmp .+54 ; 0x18eaa { // do not autodetect until a valid value is seen if(k == 0) return 0; else if(k < 0) 18e74: 20 e0 ldi r18, 0x00 ; 0 18e76: 30 e0 ldi r19, 0x00 ; 0 18e78: a9 01 movw r20, r18 18e7a: c7 01 movw r24, r14 18e7c: b6 01 movw r22, r12 18e7e: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 18e82: 87 ff sbrs r24, 7 18e84: 05 c0 rjmp .+10 ; 0x18e90 } else { newK = la10c_value(newK); if (newK < 0) SERIAL_ECHOLNPGM("K out of allowed range!"); 18e86: 82 eb ldi r24, 0xB2 ; 178 18e88: 9e e7 ldi r25, 0x7E ; 126 18e8a: 0e 94 93 79 call 0xf326 ; 0xf326 18e8e: da cf rjmp .-76 ; 0x18e44 return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); 18e90: 20 e0 ldi r18, 0x00 ; 0 18e92: 30 e0 ldi r19, 0x00 ; 0 18e94: 40 e2 ldi r20, 0x20 ; 32 18e96: 51 e4 ldi r21, 0x41 ; 65 18e98: c7 01 movw r24, r14 18e9a: b6 01 movw r22, r12 18e9c: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 18ea0: 87 ff sbrs r24, 7 18ea2: 2c c0 rjmp .+88 ; 0x18efc 18ea4: 81 e0 ldi r24, 0x01 ; 1 18ea6: 0e 94 2f 82 call 0x1045e ; 0x1045e } if(la10c_mode == LA10C_LA15) 18eaa: 80 91 6e 03 lds r24, 0x036E ; 0x80036e return (k >= 0 && k < LA_K_MAX? k: -1); 18eae: 20 e0 ldi r18, 0x00 ; 0 18eb0: 30 e0 ldi r19, 0x00 ; 0 18eb2: a9 01 movw r20, r18 return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); } if(la10c_mode == LA10C_LA15) 18eb4: 81 30 cpi r24, 0x01 ; 1 18eb6: 21 f5 brne .+72 ; 0x18f00 return (k >= 0 && k < LA_K_MAX? k: -1); 18eb8: c7 01 movw r24, r14 18eba: b6 01 movw r22, r12 18ebc: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 18ec0: 87 fd sbrc r24, 7 18ec2: e1 cf rjmp .-62 ; 0x18e86 18ec4: 20 e0 ldi r18, 0x00 ; 0 18ec6: 30 e0 ldi r19, 0x00 ; 0 18ec8: 40 e2 ldi r20, 0x20 ; 32 18eca: 51 e4 ldi r21, 0x41 ; 65 18ecc: c7 01 movw r24, r14 18ece: b6 01 movw r22, r12 18ed0: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 18ed4: 87 ff sbrs r24, 7 18ed6: d7 cf rjmp .-82 ; 0x18e86 la10c_reset(); } else { newK = la10c_value(newK); if (newK < 0) 18ed8: 20 e0 ldi r18, 0x00 ; 0 18eda: 30 e0 ldi r19, 0x00 ; 0 18edc: a9 01 movw r20, r18 18ede: c7 01 movw r24, r14 18ee0: b6 01 movw r22, r12 18ee2: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 18ee6: 87 fd sbrc r24, 7 18ee8: ce cf rjmp .-100 ; 0x18e86 SERIAL_ECHOLNPGM("K out of allowed range!"); else extruder_advance_K = newK; 18eea: c0 92 64 05 sts 0x0564, r12 ; 0x800564 18eee: d0 92 65 05 sts 0x0565, r13 ; 0x800565 18ef2: e0 92 66 05 sts 0x0566, r14 ; 0x800566 18ef6: f0 92 67 05 sts 0x0567, r15 ; 0x800567 18efa: a4 cf rjmp .-184 ; 0x18e44 if(k == 0) return 0; else if(k < 0) return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); 18efc: 82 e0 ldi r24, 0x02 ; 2 18efe: d3 cf rjmp .-90 ; 0x18ea6 } if(la10c_mode == LA10C_LA15) return (k >= 0 && k < LA_K_MAX? k: -1); else return (k >= 0? la10c_convert(k): -1); 18f00: c7 01 movw r24, r14 18f02: b6 01 movw r22, r12 18f04: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 18f08: 87 fd sbrc r24, 7 18f0a: bd cf rjmp .-134 ; 0x18e86 // Approximate a LA10 value to a LA15 equivalent. static float la10c_convert(float k) { float new_K = k * 0.002 - 0.01; 18f0c: 2f e6 ldi r18, 0x6F ; 111 18f0e: 32 e1 ldi r19, 0x12 ; 18 18f10: 43 e0 ldi r20, 0x03 ; 3 18f12: 5b e3 ldi r21, 0x3B ; 59 18f14: c7 01 movw r24, r14 18f16: b6 01 movw r22, r12 18f18: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 18f1c: 2a e0 ldi r18, 0x0A ; 10 18f1e: 37 ed ldi r19, 0xD7 ; 215 18f20: 43 e2 ldi r20, 0x23 ; 35 18f22: 5c e3 ldi r21, 0x3C ; 60 18f24: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 18f28: 6b 01 movw r12, r22 18f2a: 7c 01 movw r14, r24 return new_K < 0? 0: 18f2c: 20 e0 ldi r18, 0x00 ; 0 18f2e: 30 e0 ldi r19, 0x00 ; 0 18f30: a9 01 movw r20, r18 18f32: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 18f36: 87 fd sbrc r24, 7 18f38: 11 c0 rjmp .+34 ; 0x18f5c new_K > (LA_K_MAX - FLT_EPSILON)? (LA_K_MAX - FLT_EPSILON): 18f3a: 20 e0 ldi r18, 0x00 ; 0 18f3c: 30 e0 ldi r19, 0x00 ; 0 18f3e: 40 e2 ldi r20, 0x20 ; 32 18f40: 51 e4 ldi r21, 0x41 ; 65 18f42: c7 01 movw r24, r14 18f44: b6 01 movw r22, r12 18f46: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 18f4a: 18 16 cp r1, r24 18f4c: 2c f6 brge .-118 ; 0x18ed8 18f4e: c1 2c mov r12, r1 18f50: d1 2c mov r13, r1 18f52: 30 e2 ldi r19, 0x20 ; 32 18f54: e3 2e mov r14, r19 18f56: 31 e4 ldi r19, 0x41 ; 65 18f58: f3 2e mov r15, r19 18f5a: c7 cf rjmp .-114 ; 0x18eea // 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: 18f5c: c1 2c mov r12, r1 18f5e: d1 2c mov r13, r1 18f60: 76 01 movw r14, r12 18f62: c3 cf rjmp .-122 ; 0x18eea 18f64: 9d ed ldi r25, 0xDD ; 221 18f66: 89 2e mov r8, r25 18f68: 92 e0 ldi r25, 0x02 ; 2 18f6a: 99 2e mov r9, r25 18f6c: 0d e5 ldi r16, 0x5D ; 93 18f6e: 12 e0 ldi r17, 0x02 ; 2 18f70: 24 ef ldi r18, 0xF4 ; 244 18f72: a2 2e mov r10, r18 18f74: 24 e0 ldi r18, 0x04 ; 4 18f76: b2 2e mov r11, r18 */ case 907: { #ifdef TMC2130 // See tmc2130_cur2val() for translation to 0 .. 63 range for (uint_least8_t i = 0; i < NUM_AXIS; i++){ 18f78: 71 2c mov r7, r1 if(code_seen(axis_codes[i])){ 18f7a: f4 01 movw r30, r8 18f7c: 81 91 ld r24, Z+ 18f7e: 4f 01 movw r8, r30 18f80: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 18f84: 88 23 and r24, r24 18f86: 09 f4 brne .+2 ; 0x18f8a 18f88: 45 c0 rjmp .+138 ; 0x19014 if( i == E_AXIS && FarmOrUserECool() ){ 18f8a: f3 e0 ldi r31, 0x03 ; 3 18f8c: 7f 12 cpse r7, r31 18f8e: 04 c0 rjmp .+8 ; 0x18f98 return ( eeprom_read_byte((uint8_t *)EEPROM_ECOOL_ENABLE) == EEPROM_ECOOL_MAGIC_NUMBER ) && ( eeprom_read_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY) == 1 ); } bool FarmOrUserECool(){ return farm_mode || UserECoolEnabled(); 18f90: 0e 94 ac ef call 0x1df58 ; 0x1df58 18f94: 81 11 cpse r24, r1 18f96: 61 c0 rjmp .+194 ; 0x1905a SERIAL_ECHORPGM(eMotorCurrentScalingEnabled); SERIAL_ECHOLNPGM(", M907 E ignored"); continue; } float cur_mA = code_value(); 18f98: 0e 94 b5 60 call 0xc16a ; 0xc16a 18f9c: 6b 01 movw r12, r22 18f9e: 7c 01 movw r14, r24 //! | 1020 | 62 | | //! | 1029 | 63 | | uint8_t tmc2130_cur2val(float cur) { if (cur < 0) cur = 0; //limit min 18fa0: 20 e0 ldi r18, 0x00 ; 0 18fa2: 30 e0 ldi r19, 0x00 ; 0 18fa4: a9 01 movw r20, r18 18fa6: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 18faa: 87 fd sbrc r24, 7 18fac: 46 c0 rjmp .+140 ; 0x1903a if (cur > 1029) cur = 1029; //limit max 18fae: 20 e0 ldi r18, 0x00 ; 0 18fb0: 30 ea ldi r19, 0xA0 ; 160 18fb2: 40 e8 ldi r20, 0x80 ; 128 18fb4: 54 e4 ldi r21, 0x44 ; 68 18fb6: c7 01 movw r24, r14 18fb8: b6 01 movw r22, r12 18fba: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 18fbe: 18 16 cp r1, r24 18fc0: a4 f1 brlt .+104 ; 0x1902a //540mA is threshold for switch from high sense to low sense //for higher currents is maximum current 1029mA if (cur >= 540) return 63 * (float)cur / 1029; 18fc2: 20 e0 ldi r18, 0x00 ; 0 18fc4: 30 e0 ldi r19, 0x00 ; 0 18fc6: 47 e0 ldi r20, 0x07 ; 7 18fc8: 54 e4 ldi r21, 0x44 ; 68 18fca: c7 01 movw r24, r14 18fcc: b6 01 movw r22, r12 18fce: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 18fd2: 87 fd sbrc r24, 7 18fd4: 35 c0 rjmp .+106 ; 0x19040 18fd6: 20 e0 ldi r18, 0x00 ; 0 18fd8: 30 e0 ldi r19, 0x00 ; 0 18fda: 4c e7 ldi r20, 0x7C ; 124 18fdc: 52 e4 ldi r21, 0x42 ; 66 18fde: c7 01 movw r24, r14 18fe0: b6 01 movw r22, r12 18fe2: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 18fe6: 20 e0 ldi r18, 0x00 ; 0 18fe8: 30 ea ldi r19, 0xA0 ; 160 18fea: 40 e8 ldi r20, 0x80 ; 128 18fec: 54 e4 ldi r21, 0x44 ; 68 //for lower currents must be the value divided by 1.125 (= 0.18*2/0.32) return 63 * (float)cur / (1029 * 1.125); 18fee: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 18ff2: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 18ff6: f6 2e mov r15, r22 uint8_t val = tmc2130_cur2val(cur_mA); currents[i].setiHold(val); 18ff8: c8 01 movw r24, r16 18ffa: 0e 94 16 68 call 0xd02c ; 0xd02c currents[i].setiRun(val); 18ffe: 6f 2d mov r22, r15 19000: c8 01 movw r24, r16 19002: 0e 94 1e 68 call 0xd03c ; 0xd03c tmc2130_setup_chopper(i, tmc2130_mres[i]); 19006: 50 e0 ldi r21, 0x00 ; 0 19008: 40 e0 ldi r20, 0x00 ; 0 1900a: d5 01 movw r26, r10 1900c: 6c 91 ld r22, X 1900e: 87 2d mov r24, r7 19010: 0f 94 65 24 call 0x248ca ; 0x248ca */ case 907: { #ifdef TMC2130 // See tmc2130_cur2val() for translation to 0 .. 63 range for (uint_least8_t i = 0; i < NUM_AXIS; i++){ 19014: 73 94 inc r7 19016: 0d 5f subi r16, 0xFD ; 253 19018: 1f 4f sbci r17, 0xFF ; 255 1901a: bf ef ldi r27, 0xFF ; 255 1901c: ab 1a sub r10, r27 1901e: bb 0a sbc r11, r27 19020: e4 e0 ldi r30, 0x04 ; 4 19022: 7e 12 cpse r7, r30 19024: aa cf rjmp .-172 ; 0x18f7a 19026: 0c 94 05 ab jmp 0x1560a ; 0x1560a //! | 1029 | 63 | | uint8_t tmc2130_cur2val(float cur) { if (cur < 0) cur = 0; //limit min if (cur > 1029) cur = 1029; //limit max 1902a: c1 2c mov r12, r1 1902c: 80 ea ldi r24, 0xA0 ; 160 1902e: d8 2e mov r13, r24 19030: 80 e8 ldi r24, 0x80 ; 128 19032: e8 2e mov r14, r24 19034: 84 e4 ldi r24, 0x44 ; 68 19036: f8 2e mov r15, r24 19038: ce cf rjmp .-100 ; 0x18fd6 //! | 1020 | 62 | | //! | 1029 | 63 | | uint8_t tmc2130_cur2val(float cur) { if (cur < 0) cur = 0; //limit min 1903a: c1 2c mov r12, r1 1903c: d1 2c mov r13, r1 1903e: 76 01 movw r14, r12 if (cur > 1029) cur = 1029; //limit max //540mA is threshold for switch from high sense to low sense //for higher currents is maximum current 1029mA if (cur >= 540) return 63 * (float)cur / 1029; //for lower currents must be the value divided by 1.125 (= 0.18*2/0.32) return 63 * (float)cur / (1029 * 1.125); 19040: 20 e0 ldi r18, 0x00 ; 0 19042: 30 e0 ldi r19, 0x00 ; 0 19044: 4c e7 ldi r20, 0x7C ; 124 19046: 52 e4 ldi r21, 0x42 ; 66 19048: c7 01 movw r24, r14 1904a: b6 01 movw r22, r12 1904c: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 19050: 20 e0 ldi r18, 0x00 ; 0 19052: 34 eb ldi r19, 0xB4 ; 180 19054: 40 e9 ldi r20, 0x90 ; 144 19056: 54 e4 ldi r21, 0x44 ; 68 19058: ca cf rjmp .-108 ; 0x18fee if(code_seen(axis_codes[i])){ if( i == E_AXIS && FarmOrUserECool() ){ SERIAL_ECHORPGM(eMotorCurrentScalingEnabled); 1905a: 88 ea ldi r24, 0xA8 ; 168 1905c: 9f e9 ldi r25, 0x9F ; 159 1905e: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHOLNPGM(", M907 E ignored"); 19062: 8e e7 ldi r24, 0x7E ; 126 19064: 95 e8 ldi r25, 0x85 ; 133 19066: 0e 94 93 79 call 0xf326 ; 0xf326 1906a: d4 cf rjmp .-88 ; 0x19014 1906c: a0 90 67 02 lds r10, 0x0267 ; 0x800267 , iRun((ir < 32) ? ir : (ir >> 1)) , iHold((ir < 32) ? ih : (ih >> 1)) {} inline uint8_t getiRun() const { return iRun; } inline uint8_t getiHold() const { return min(iHold, iRun); } inline uint8_t getOriginaliRun() const { return vSense ? iRun : iRun << 1; } 19070: 80 91 66 02 lds r24, 0x0266 ; 0x800266 19074: 81 11 cpse r24, r1 19076: 01 c0 rjmp .+2 ; 0x1907a 19078: aa 0c add r10, r10 SetCurrents(axis, *curr); } void tmc2130_print_currents() { printf_P(_n("tmc2130_print_currents()\n\tH\tR\nX\t%d\t%d\nY\t%d\t%d\nZ\t%d\t%d\nE\t%d\t%d\n"), 1907a: b1 2c mov r11, r1 currents[0].getOriginaliHold(), currents[0].getOriginaliRun(), currents[1].getOriginaliHold(), currents[1].getOriginaliRun(), currents[2].getOriginaliHold(), currents[2].getOriginaliRun(), currents[3].getOriginaliHold(), currents[3].getOriginaliRun() 1907c: 86 e6 ldi r24, 0x66 ; 102 1907e: 92 e0 ldi r25, 0x02 ; 2 19080: 0f 94 ec 26 call 0x24dd8 ; 0x24dd8 19084: 88 2e mov r8, r24 19086: c0 90 64 02 lds r12, 0x0264 ; 0x800264 1908a: 80 91 63 02 lds r24, 0x0263 ; 0x800263 1908e: 81 11 cpse r24, r1 19090: 01 c0 rjmp .+2 ; 0x19094 19092: cc 0c add r12, r12 SetCurrents(axis, *curr); } void tmc2130_print_currents() { printf_P(_n("tmc2130_print_currents()\n\tH\tR\nX\t%d\t%d\nY\t%d\t%d\nZ\t%d\t%d\nE\t%d\t%d\n"), 19094: d1 2c mov r13, r1 currents[0].getOriginaliHold(), currents[0].getOriginaliRun(), currents[1].getOriginaliHold(), currents[1].getOriginaliRun(), currents[2].getOriginaliHold(), currents[2].getOriginaliRun(), 19096: 83 e6 ldi r24, 0x63 ; 99 19098: 92 e0 ldi r25, 0x02 ; 2 1909a: 0f 94 ec 26 call 0x24dd8 ; 0x24dd8 1909e: 98 2e mov r9, r24 190a0: 00 91 61 02 lds r16, 0x0261 ; 0x800261 190a4: 80 91 60 02 lds r24, 0x0260 ; 0x800260 190a8: 81 11 cpse r24, r1 190aa: 01 c0 rjmp .+2 ; 0x190ae 190ac: 00 0f add r16, r16 SetCurrents(axis, *curr); } void tmc2130_print_currents() { printf_P(_n("tmc2130_print_currents()\n\tH\tR\nX\t%d\t%d\nY\t%d\t%d\nZ\t%d\t%d\nE\t%d\t%d\n"), 190ae: 10 e0 ldi r17, 0x00 ; 0 currents[0].getOriginaliHold(), currents[0].getOriginaliRun(), currents[1].getOriginaliHold(), currents[1].getOriginaliRun(), 190b0: 80 e6 ldi r24, 0x60 ; 96 190b2: 92 e0 ldi r25, 0x02 ; 2 190b4: 0f 94 ec 26 call 0x24dd8 ; 0x24dd8 190b8: e8 2e mov r14, r24 190ba: f0 90 5e 02 lds r15, 0x025E ; 0x80025e 190be: 80 91 5d 02 lds r24, 0x025D ; 0x80025d 190c2: 81 11 cpse r24, r1 190c4: 01 c0 rjmp .+2 ; 0x190c8 190c6: ff 0c add r15, r15 } void tmc2130_print_currents() { printf_P(_n("tmc2130_print_currents()\n\tH\tR\nX\t%d\t%d\nY\t%d\t%d\nZ\t%d\t%d\nE\t%d\t%d\n"), currents[0].getOriginaliHold(), currents[0].getOriginaliRun(), 190c8: 8d e5 ldi r24, 0x5D ; 93 190ca: 92 e0 ldi r25, 0x02 ; 2 190cc: 0f 94 ec 26 call 0x24dd8 ; 0x24dd8 SetCurrents(axis, *curr); } void tmc2130_print_currents() { printf_P(_n("tmc2130_print_currents()\n\tH\tR\nX\t%d\t%d\nY\t%d\t%d\nZ\t%d\t%d\nE\t%d\t%d\n"), 190d0: bf 92 push r11 190d2: af 92 push r10 190d4: 1f 92 push r1 190d6: 8f 92 push r8 190d8: df 92 push r13 190da: cf 92 push r12 190dc: 1f 92 push r1 190de: 9f 92 push r9 190e0: 1f 93 push r17 190e2: 0f 93 push r16 190e4: 1f 92 push r1 190e6: ef 92 push r14 190e8: 1f 92 push r1 190ea: ff 92 push r15 190ec: 1f 92 push r1 190ee: 8f 93 push r24 190f0: 8c ec ldi r24, 0xCC ; 204 190f2: 97 e6 ldi r25, 0x67 ; 103 190f4: 9f 93 push r25 190f6: 8f 93 push r24 190f8: 0f 94 99 da call 0x3b532 ; 0x3b532 190fc: 0f b6 in r0, 0x3f ; 63 190fe: f8 94 cli 19100: de bf out 0x3e, r29 ; 62 19102: 0f be out 0x3f, r0 ; 63 19104: cd bf out 0x3d, r28 ; 61 19106: 0c 94 05 ab jmp 0x1560a ; 0x1560a - `Q` - Print effective silent/normal status. (Does not report override) */ case 914: case 915: { uint8_t newMode = (mcode_in_progress==914) ? TMC2130_MODE_NORMAL : TMC2130_MODE_SILENT; 1910a: 11 e0 ldi r17, 0x01 ; 1 1910c: 82 39 cpi r24, 0x92 ; 146 1910e: 93 40 sbci r25, 0x03 ; 3 19110: 09 f4 brne .+2 ; 0x19114 19112: 10 e0 ldi r17, 0x00 ; 0 //printf_P(_n("tmc2130mode/smm/eep: %d %d %d %d"),tmc2130_mode,SilentModeMenu,eeprom_read_byte((uint8_t*)EEPROM_SILENT), bEnableForce_z); if (code_seen('R')) 19114: 82 e5 ldi r24, 0x52 ; 82 19116: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 1911a: 88 23 and r24, r24 1911c: 81 f0 breq .+32 ; 0x1913e { newMode = eeprom_read_byte((uint8_t*)EEPROM_SILENT); 1911e: 8f ef ldi r24, 0xFF ; 255 19120: 9f e0 ldi r25, 0x0F ; 15 19122: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 19126: 18 2f mov r17, r24 tmc2130_mode == TMC2130_MODE_NORMAL ? _O(MSG_NORMAL) : _O(MSG_SILENT) ); } if (tmc2130_mode != newMode 19128: 80 91 8b 06 lds r24, 0x068B ; 0x80068b 1912c: 81 17 cp r24, r17 1912e: 11 f4 brne .+4 ; 0x19134 19130: 0c 94 05 ab jmp 0x1560a ; 0x1560a ) { #ifdef PSU_Delta enable_force_z(); #endif change_power_mode_live(newMode); 19134: 81 2f mov r24, r17 19136: 0e 94 a1 60 call 0xc142 ; 0xc142 1913a: 0c 94 05 ab jmp 0x1560a ; 0x1560a //printf_P(_n("tmc2130mode/smm/eep: %d %d %d %d"),tmc2130_mode,SilentModeMenu,eeprom_read_byte((uint8_t*)EEPROM_SILENT), bEnableForce_z); if (code_seen('R')) { newMode = eeprom_read_byte((uint8_t*)EEPROM_SILENT); } else if (code_seen('P')) 1913e: 80 e5 ldi r24, 0x50 ; 80 19140: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 19144: 88 23 and r24, r24 19146: 89 f0 breq .+34 ; 0x1916a { uint8_t newMenuMode = (mcode_in_progress==914) ? SILENT_MODE_NORMAL : SILENT_MODE_STEALTH; 19148: 01 e0 ldi r16, 0x01 ; 1 1914a: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 <_ZL17mcode_in_progress.lto_priv.530> 1914e: 90 91 aa 0d lds r25, 0x0DAA ; 0x800daa <_ZL17mcode_in_progress.lto_priv.530+0x1> 19152: 82 39 cpi r24, 0x92 ; 146 19154: 93 40 sbci r25, 0x03 ; 3 19156: 09 f4 brne .+2 ; 0x1915a 19158: 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); 1915a: 60 2f mov r22, r16 1915c: 8f ef ldi r24, 0xFF ; 255 1915e: 9f e0 ldi r25, 0x0F ; 15 19160: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 eeprom_update_byte_notify((unsigned char *)EEPROM_SILENT, newMenuMode); SilentModeMenu = newMenuMode; 19164: 00 93 a2 03 sts 0x03A2, r16 ; 0x8003a2 19168: df cf rjmp .-66 ; 0x19128 //printf_P(_n("tmc2130mode/smm/eep: %d %d %d %d"),tmc2130_mode,SilentModeMenu,eeprom_read_byte((uint8_t*)EEPROM_SILENT), bEnableForce_z); } else if (code_seen('Q')) 1916a: 81 e5 ldi r24, 0x51 ; 81 1916c: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 19170: 88 23 and r24, r24 19172: d1 f2 breq .-76 ; 0x19128 { printf_P(PSTR("%S: %S\n"), _O(MSG_MODE), 19174: 80 91 8b 06 lds r24, 0x068B ; 0x80068b 19178: 81 11 cpse r24, r1 1917a: 15 c0 rjmp .+42 ; 0x191a6 1917c: 86 e9 ldi r24, 0x96 ; 150 1917e: 94 e4 ldi r25, 0x44 ; 68 19180: 9f 93 push r25 19182: 8f 93 push r24 19184: 8d e0 ldi r24, 0x0D ; 13 19186: 98 e4 ldi r25, 0x48 ; 72 19188: 9f 93 push r25 1918a: 8f 93 push r24 1918c: 86 e7 ldi r24, 0x76 ; 118 1918e: 95 e8 ldi r25, 0x85 ; 133 19190: 9f 93 push r25 19192: 8f 93 push r24 19194: 0f 94 99 da call 0x3b532 ; 0x3b532 19198: 0f 90 pop r0 1919a: 0f 90 pop r0 1919c: 0f 90 pop r0 1919e: 0f 90 pop r0 191a0: 0f 90 pop r0 191a2: 0f 90 pop r0 191a4: c1 cf rjmp .-126 ; 0x19128 191a6: 8a e8 ldi r24, 0x8A ; 138 191a8: 97 e4 ldi r25, 0x47 ; 71 191aa: ea cf rjmp .-44 ; 0x19180 191ac: 8d ed ldi r24, 0xDD ; 221 191ae: 92 e0 ldi r25, 0x02 ; 2 191b0: 6c 96 adiw r28, 0x1c ; 28 191b2: 9f af std Y+63, r25 ; 0x3f 191b4: 8e af std Y+62, r24 ; 0x3e 191b6: 6c 97 sbiw r28, 0x1c ; 28 191b8: ed eb ldi r30, 0xBD ; 189 191ba: ee 2e mov r14, r30 191bc: ed e0 ldi r30, 0x0D ; 13 191be: fe 2e mov r15, r30 191c0: f2 ea ldi r31, 0xA2 ; 162 191c2: cf 2e mov r12, r31 191c4: f6 e0 ldi r31, 0x06 ; 6 191c6: df 2e mov r13, r31 191c8: a4 ef ldi r26, 0xF4 ; 244 191ca: 2a 2e mov r2, r26 191cc: a4 e0 ldi r26, 0x04 ; 4 191ce: 3a 2e mov r3, r26 191d0: b9 e7 ldi r27, 0x79 ; 121 191d2: 8b 2e mov r8, r27 191d4: be e0 ldi r27, 0x0E ; 14 191d6: 9b 2e mov r9, r27 - `S` - All axes new resolution */ case 350: { #ifdef TMC2130 for (uint_least8_t i=0; i 191f4: b8 2e mov r11, r24 191f6: 88 23 and r24, r24 191f8: 09 f4 brne .+2 ; 0x191fc 191fa: 7c c0 rjmp .+248 ; 0x192f4 { uint16_t res_new = code_value(); 191fc: 0e 94 b5 60 call 0xc16a ; 0xc16a 19200: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 19204: 2b 01 movw r4, r22 19206: 8b 01 movw r16, r22 #ifdef ALLOW_ALL_MRES bool res_valid = res_new > 0 && res_new <= 256 && !(res_new & (res_new - 1)); // must be a power of two #else bool res_valid = (res_new == 8) || (res_new == 16) || (res_new == 32); // resolutions valid for all axis 19208: 68 30 cpi r22, 0x08 ; 8 1920a: 71 05 cpc r23, r1 1920c: 09 f4 brne .+2 ; 0x19210 1920e: 60 c3 rjmp .+1728 ; 0x198d0 19210: 60 31 cpi r22, 0x10 ; 16 19212: 71 05 cpc r23, r1 19214: 09 f4 brne .+2 ; 0x19218 19216: 5c c3 rjmp .+1720 ; 0x198d0 19218: 81 e0 ldi r24, 0x01 ; 1 1921a: 00 32 cpi r16, 0x20 ; 32 1921c: 11 05 cpc r17, r1 1921e: 09 f0 breq .+2 ; 0x19222 19220: 80 e0 ldi r24, 0x00 ; 0 res_valid |= (i != E_AXIS) && ((res_new == 1) || (res_new == 2) || (res_new == 4)); // resolutions valid for X Y Z only 19222: 67 96 adiw r28, 0x17 ; 23 19224: bf ad ldd r27, Y+63 ; 0x3f 19226: 67 97 sbiw r28, 0x17 ; 23 19228: b3 30 cpi r27, 0x03 ; 3 1922a: 09 f4 brne .+2 ; 0x1922e 1922c: 5c c3 rjmp .+1720 ; 0x198e6 1922e: 92 01 movw r18, r4 19230: 21 50 subi r18, 0x01 ; 1 19232: 31 09 sbc r19, r1 19234: 22 30 cpi r18, 0x02 ; 2 19236: 31 05 cpc r19, r1 19238: 08 f0 brcs .+2 ; 0x1923c 1923a: 50 c3 rjmp .+1696 ; 0x198dc 1923c: 9b 2d mov r25, r11 1923e: 89 2b or r24, r25 res_valid |= (i == E_AXIS) && ((res_new == 64) || (res_new == 128)); // resolutions valid for E only 19240: 67 96 adiw r28, 0x17 ; 23 19242: ef ad ldd r30, Y+63 ; 0x3f 19244: 67 97 sbiw r28, 0x17 ; 23 19246: e3 30 cpi r30, 0x03 ; 3 19248: 41 f4 brne .+16 ; 0x1925a 1924a: 00 34 cpi r16, 0x40 ; 64 1924c: 11 05 cpc r17, r1 1924e: 31 f0 breq .+12 ; 0x1925c 19250: bb 24 eor r11, r11 19252: b3 94 inc r11 19254: 00 38 cpi r16, 0x80 ; 128 19256: 11 05 cpc r17, r1 19258: 09 f0 breq .+2 ; 0x1925c 1925a: b1 2c mov r11, r1 #endif if (res_valid) 1925c: 81 11 cpse r24, r1 1925e: 03 c0 rjmp .+6 ; 0x19266 19260: bb 20 and r11, r11 19262: 09 f4 brne .+2 ; 0x19266 19264: 47 c0 rjmp .+142 ; 0x192f4 { st_synchronize(); 19266: 0f 94 a3 42 call 0x28546 ; 0x28546 return stat; } uint16_t tmc2130_get_res(uint8_t axis) { return tmc2130_mres2usteps(tmc2130_mres[axis]); 1926a: d1 01 movw r26, r2 1926c: 8c 91 ld r24, X 1926e: a1 2c mov r10, r1 19270: bb 24 eor r11, r11 19272: b3 94 inc r11 19274: 02 c0 rjmp .+4 ; 0x1927a 19276: b6 94 lsr r11 19278: a7 94 ror r10 1927a: 8a 95 dec r24 1927c: e2 f7 brpl .-8 ; 0x19276 uint16_t res = tmc2130_get_res(i); tmc2130_set_res(i, res_new); 1927e: b2 01 movw r22, r4 19280: 67 96 adiw r28, 0x17 ; 23 19282: 8f ad ldd r24, Y+63 ; 0x3f 19284: 67 97 sbiw r28, 0x17 ; 23 19286: 0f 94 d0 24 call 0x249a0 ; 0x249a0 cs.axis_ustep_resolution[i] = res_new; 1928a: f4 01 movw r30, r8 1928c: 40 82 st Z, r4 if (res_new > res) 1928e: a0 16 cp r10, r16 19290: b1 06 cpc r11, r17 19292: 08 f0 brcs .+2 ; 0x19296 19294: 47 c0 rjmp .+142 ; 0x19324 { uint16_t fac = (res_new / res); 19296: c8 01 movw r24, r16 19298: b5 01 movw r22, r10 1929a: 0f 94 a0 dc call 0x3b940 ; 0x3b940 <__udivmodhi4> cs.axis_steps_per_mm[i] *= fac; 1929e: 2b 01 movw r4, r22 192a0: 71 2c mov r7, r1 192a2: 61 2c mov r6, r1 192a4: c3 01 movw r24, r6 192a6: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 192aa: 9b 01 movw r18, r22 192ac: ac 01 movw r20, r24 192ae: d7 01 movw r26, r14 192b0: 14 96 adiw r26, 0x04 ; 4 192b2: 6d 91 ld r22, X+ 192b4: 7d 91 ld r23, X+ 192b6: 8d 91 ld r24, X+ 192b8: 9c 91 ld r25, X 192ba: 17 97 sbiw r26, 0x07 ; 7 192bc: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 192c0: f7 01 movw r30, r14 192c2: 64 83 std Z+4, r22 ; 0x04 192c4: 75 83 std Z+5, r23 ; 0x05 192c6: 86 83 std Z+6, r24 ; 0x06 192c8: 97 83 std Z+7, r25 ; 0x07 position[i] *= fac; 192ca: d6 01 movw r26, r12 192cc: 2d 91 ld r18, X+ 192ce: 3d 91 ld r19, X+ 192d0: 4d 91 ld r20, X+ 192d2: 5c 91 ld r21, X 192d4: c3 01 movw r24, r6 192d6: b2 01 movw r22, r4 192d8: 0f 94 3a dc call 0x3b874 ; 0x3b874 <__mulsi3> 192dc: f6 01 movw r30, r12 192de: 60 83 st Z, r22 192e0: 71 83 std Z+1, r23 ; 0x01 192e2: 82 83 std Z+2, r24 ; 0x02 192e4: 93 83 std Z+3, r25 ; 0x03 uint16_t fac = (res / res_new); cs.axis_steps_per_mm[i] /= fac; position[i] /= fac; } #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) if (i == E_AXIS) 192e6: 67 96 adiw r28, 0x17 ; 23 192e8: ff ad ldd r31, Y+63 ; 0x3f 192ea: 67 97 sbiw r28, 0x17 ; 23 192ec: f3 30 cpi r31, 0x03 ; 3 192ee: 11 f4 brne .+4 ; 0x192f4 fsensor.init(); 192f0: 0f 94 f4 7a call 0x2f5e8 ; 0x2f5e8 - `S` - All axes new resolution */ case 350: { #ifdef TMC2130 for (uint_least8_t i=0; i 1931e: 5f cf rjmp .-322 ; 0x191de 19320: 0c 94 8b b0 jmp 0x16116 ; 0x16116 cs.axis_steps_per_mm[i] *= fac; position[i] *= fac; } else { uint16_t fac = (res / res_new); 19324: c5 01 movw r24, r10 19326: b8 01 movw r22, r16 19328: 0f 94 a0 dc call 0x3b940 ; 0x3b940 <__udivmodhi4> cs.axis_steps_per_mm[i] /= fac; 1932c: 2b 01 movw r4, r22 1932e: 71 2c mov r7, r1 19330: 61 2c mov r6, r1 19332: c3 01 movw r24, r6 19334: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 19338: 9b 01 movw r18, r22 1933a: ac 01 movw r20, r24 1933c: d7 01 movw r26, r14 1933e: 14 96 adiw r26, 0x04 ; 4 19340: 6d 91 ld r22, X+ 19342: 7d 91 ld r23, X+ 19344: 8d 91 ld r24, X+ 19346: 9c 91 ld r25, X 19348: 17 97 sbiw r26, 0x07 ; 7 1934a: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 1934e: f7 01 movw r30, r14 19350: 64 83 std Z+4, r22 ; 0x04 19352: 75 83 std Z+5, r23 ; 0x05 19354: 86 83 std Z+6, r24 ; 0x06 19356: 97 83 std Z+7, r25 ; 0x07 position[i] /= fac; 19358: d6 01 movw r26, r12 1935a: 6d 91 ld r22, X+ 1935c: 7d 91 ld r23, X+ 1935e: 8d 91 ld r24, X+ 19360: 9c 91 ld r25, X 19362: a3 01 movw r20, r6 19364: 92 01 movw r18, r4 19366: 0f 94 c8 dc call 0x3b990 ; 0x3b990 <__divmodsi4> 1936a: f6 01 movw r30, r12 1936c: 20 83 st Z, r18 1936e: 31 83 std Z+1, r19 ; 0x01 19370: 42 83 std Z+2, r20 ; 0x02 19372: 53 83 std Z+3, r21 ; 0x03 19374: b8 cf rjmp .-144 ; 0x192e6 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') ) { 19376: 80 e5 ldi r24, 0x50 ; 80 19378: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 1937c: 88 23 and r24, r24 1937e: 29 f0 breq .+10 ; 0x1938a mmuSlotIndex = code_value_uint8(); 19380: 0e 94 80 5b call 0xb700 ; 0xb700 19384: 18 2f mov r17, r24 19386: 0c 94 0b aa jmp 0x15416 ; 0x15416 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') ) { 1938a: 84 e5 ldi r24, 0x54 ; 84 1938c: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 19390: 81 11 cpse r24, r1 19392: f6 cf rjmp .-20 ; 0x19380 19394: 0c 94 0a aa jmp 0x15414 ; 0x15414 */ case 701: { uint8_t mmuSlotIndex = 0xffU; float fastLoadLength = FILAMENTCHANGE_FIRSTFEED; // Only used without MMU float z_target = 0; 19398: 60 e0 ldi r22, 0x00 ; 0 1939a: 70 e0 ldi r23, 0x00 ; 0 1939c: cb 01 movw r24, r22 1939e: 0c 94 24 aa jmp 0x15448 ; 0x15448 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; 193a2: 82 e0 ldi r24, 0x02 ; 2 193a4: 80 93 c3 06 sts 0x06C3, r24 ; 0x8006c3 lcd_setstatuspgm(_T(MSG_LOADING_FILAMENT)); 193a8: 81 e7 ldi r24, 0x71 ; 113 193aa: 9c e5 ldi r25, 0x5C ; 92 193ac: 0e 94 c4 72 call 0xe588 ; 0xe588 193b0: 0e 94 38 f1 call 0x1e270 ; 0x1e270 current_position[E_AXIS] += fastLoadLength; 193b4: a7 01 movw r20, r14 193b6: 96 01 movw r18, r12 193b8: 60 91 9d 06 lds r22, 0x069D ; 0x80069d 193bc: 70 91 9e 06 lds r23, 0x069E ; 0x80069e 193c0: 80 91 9f 06 lds r24, 0x069F ; 0x80069f 193c4: 90 91 a0 06 lds r25, 0x06A0 ; 0x8006a0 193c8: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 193cc: 60 93 9d 06 sts 0x069D, r22 ; 0x80069d 193d0: 70 93 9e 06 sts 0x069E, r23 ; 0x80069e 193d4: 80 93 9f 06 sts 0x069F, r24 ; 0x80069f 193d8: 90 93 a0 06 sts 0x06A0, r25 ; 0x8006a0 plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FIRST); //fast sequence 193dc: 60 e0 ldi r22, 0x00 ; 0 193de: 70 e0 ldi r23, 0x00 ; 0 193e0: 80 ea ldi r24, 0xA0 ; 160 193e2: 91 e4 ldi r25, 0x41 ; 65 193e4: 0f 94 04 c0 call 0x38008 ; 0x38008 if (raise_z_axis) { // backwards compatibility for 3.12 and older FW 193e8: 01 11 cpse r16, r1 193ea: 06 c0 rjmp .+12 ; 0x193f8 raise_z_above(MIN_Z_FOR_LOAD); 193ec: 60 e0 ldi r22, 0x00 ; 0 193ee: 70 e0 ldi r23, 0x00 ; 0 193f0: 88 e4 ldi r24, 0x48 ; 72 193f2: 92 e4 ldi r25, 0x42 ; 66 193f4: 0e 94 78 6e call 0xdcf0 ; 0xdcf0 } load_filament_final_feed(); // slow sequence 193f8: 0e 94 ab 64 call 0xc956 ; 0xc956 st_synchronize(); 193fc: 0f 94 a3 42 call 0x28546 ; 0x28546 Sound_MakeCustom(50, 500, false); 19400: 40 e0 ldi r20, 0x00 ; 0 19402: 64 ef ldi r22, 0xF4 ; 244 19404: 71 e0 ldi r23, 0x01 ; 1 19406: 82 e3 ldi r24, 0x32 ; 50 19408: 90 e0 ldi r25, 0x00 ; 0 1940a: 0f 94 01 51 call 0x2a202 ; 0x2a202 if (!farm_mode && (eFilamentAction != FilamentAction::None)) { 1940e: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 19412: 81 11 cpse r24, r1 lcd_load_filament_color_check(); 19414: 0f 94 24 4f call 0x29e48 ; 0x29e48 #ifdef COMMUNITY_PREVENT_OOZE // Retract filament to prevent oozing retract_for_ooze_prevention(); #endif //COMMUNITY_PREVENT_OOZE lcd_update_enable(true); 19418: 81 e0 ldi r24, 0x01 ; 1 1941a: 0e 94 3d 6f call 0xde7a ; 0xde7a lcd_update(2); 1941e: 82 e0 ldi r24, 0x02 ; 2 19420: 0e 94 bf 6e call 0xdd7e ; 0xdd7e lcd_setstatuspgm(MSG_WELCOME); 19424: 86 eb ldi r24, 0xB6 ; 182 19426: 90 e7 ldi r25, 0x70 ; 112 19428: 0e 94 38 f1 call 0x1e270 ; 0x1e270 custom_message_type = CustomMsg::Status; 1942c: 10 92 c3 06 sts 0x06C3, r1 ; 0x8006c3 19430: 0c 94 39 aa jmp 0x15472 ; 0x15472 */ case 702: { float z_target = 0; float unloadLength = FILAMENTCHANGE_FINALRETRACT; if (code_seen('U')) unloadLength = code_value(); 19434: 85 e5 ldi r24, 0x55 ; 85 19436: 0e 94 ee 5b call 0xb7dc ; 0xb7dc - `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; 1943a: c1 2c mov r12, r1 1943c: d1 2c mov r13, r1 1943e: 76 01 movw r14, r12 if (code_seen('U')) unloadLength = code_value(); 19440: 88 23 and r24, r24 19442: 21 f0 breq .+8 ; 0x1944c 19444: 0e 94 b5 60 call 0xc16a ; 0xc16a 19448: 6b 01 movw r12, r22 1944a: 7c 01 movw r14, r24 // For safety only allow positive values if (code_seen('Z')) z_target = fabs(code_value()); 1944c: 8a e5 ldi r24, 0x5A ; 90 1944e: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 19452: 88 23 and r24, r24 19454: a1 f0 breq .+40 ; 0x1947e 19456: 0e 94 b5 60 call 0xc16a ; 0xc16a 1945a: 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); 1945c: 0e 94 f9 6d call 0xdbf2 ; 0xdbf2 19460: 4b 01 movw r8, r22 19462: 5c 01 movw r10, r24 // Unload filament if (MMU2::mmu2.Enabled()) MMU2::mmu2.unload(); 19464: 80 91 b9 13 lds r24, 0x13B9 ; 0x8013b9 19468: 81 30 cpi r24, 0x01 ; 1 1946a: 99 f4 brne .+38 ; 0x19492 1946c: 0f 94 f8 ac call 0x359f0 ; 0x359f0 else unload_filament(unloadLength); // Restore Z axis raise_z(-delta); 19470: c5 01 movw r24, r10 19472: b4 01 movw r22, r8 19474: 90 58 subi r25, 0x80 ; 128 19476: 0e 94 f9 6d call 0xdbf2 ; 0xdbf2 1947a: 0c 94 05 ab jmp 0x1560a ; 0x1560a 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 1947e: 60 e0 ldi r22, 0x00 ; 0 19480: 70 e0 ldi r23, 0x00 ; 0 19482: 80 ea ldi r24, 0xA0 ; 160 19484: 91 e4 ldi r25, 0x41 ; 65 19486: 0e 94 78 6e call 0xdcf0 ; 0xdcf0 - `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; 1948a: 60 e0 ldi r22, 0x00 ; 0 1948c: 70 e0 ldi r23, 0x00 ; 0 1948e: cb 01 movw r24, r22 19490: e5 cf rjmp .-54 ; 0x1945c // Raise the Z axis float delta = raise_z(z_target); // Unload filament if (MMU2::mmu2.Enabled()) MMU2::mmu2.unload(); else unload_filament(unloadLength); 19492: c7 01 movw r24, r14 19494: b6 01 movw r22, r12 19496: 0e 94 2a f8 call 0x1f054 ; 0x1f054 1949a: ea cf rjmp .-44 ; 0x19470 #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 705: { gcodes_M704_M705_M706(705); 1949c: 81 ec ldi r24, 0xC1 ; 193 1949e: 92 e0 ldi r25, 0x02 ; 2 194a0: 0e 94 67 60 call 0xc0ce ; 0xc0ce 194a4: 0c 94 05 ab jmp 0x1560a ; 0x1560a #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 706: { gcodes_M704_M705_M706(706); 194a8: 82 ec ldi r24, 0xC2 ; 194 194aa: 92 e0 ldi r25, 0x02 ; 2 194ac: 0e 94 67 60 call 0xc0ce ; 0xc0ce 194b0: 0c 94 05 ab jmp 0x1560a ; 0x1560a 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() ) { 194b4: 80 91 b9 13 lds r24, 0x13B9 ; 0x8013b9 194b8: 81 30 cpi r24, 0x01 ; 1 194ba: 11 f0 breq .+4 ; 0x194c0 194bc: 0c 94 05 ab jmp 0x1560a ; 0x1560a if( code_seen('A') ) { 194c0: 81 e4 ldi r24, 0x41 ; 65 194c2: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 194c6: 88 23 and r24, r24 194c8: 11 f4 brne .+4 ; 0x194ce 194ca: 0c 94 05 ab jmp 0x1560a ; 0x1560a MMU2::mmu2.ReadRegister(uint8_t(strtol(strchr_pointer+1, NULL, 16))); 194ce: 80 91 93 03 lds r24, 0x0393 ; 0x800393 194d2: 90 91 94 03 lds r25, 0x0394 ; 0x800394 194d6: 40 e1 ldi r20, 0x10 ; 16 194d8: 50 e0 ldi r21, 0x00 ; 0 194da: 70 e0 ldi r23, 0x00 ; 0 194dc: 60 e0 ldi r22, 0x00 ; 0 194de: 01 96 adiw r24, 0x01 ; 1 194e0: 0f 94 62 d7 call 0x3aec4 ; 0x3aec4 194e4: 86 2f mov r24, r22 194e6: 0f 94 71 0f call 0x21ee2 ; 0x21ee2 194ea: 0c 94 05 ab jmp 0x1560a ; 0x1560a 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() ){ 194ee: 80 91 b9 13 lds r24, 0x13B9 ; 0x8013b9 194f2: 81 30 cpi r24, 0x01 ; 1 194f4: 11 f0 breq .+4 ; 0x194fa 194f6: 0c 94 05 ab jmp 0x1560a ; 0x1560a uint8_t addr = 0; if( code_seen('A') ) { 194fa: 81 e4 ldi r24, 0x41 ; 65 194fc: 0e 94 ee 5b call 0xb7dc ; 0xb7dc Does nothing if A parameter is missing or if MMU is not enabled. */ case 708: { if ( MMU2::mmu2.Enabled() ){ uint8_t addr = 0; 19500: 10 e0 ldi r17, 0x00 ; 0 if( code_seen('A') ) { 19502: 88 23 and r24, r24 19504: 61 f0 breq .+24 ; 0x1951e addr = uint8_t(strtol(strchr_pointer+1, NULL, 16)); 19506: 80 91 93 03 lds r24, 0x0393 ; 0x800393 1950a: 90 91 94 03 lds r25, 0x0394 ; 0x800394 1950e: 40 e1 ldi r20, 0x10 ; 16 19510: 50 e0 ldi r21, 0x00 ; 0 19512: 70 e0 ldi r23, 0x00 ; 0 19514: 60 e0 ldi r22, 0x00 ; 0 19516: 01 96 adiw r24, 0x01 ; 1 19518: 0f 94 62 d7 call 0x3aec4 ; 0x3aec4 1951c: 16 2f mov r17, r22 } uint16_t data = 0; if( code_seen('X') ) { 1951e: 88 e5 ldi r24, 0x58 ; 88 19520: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 19524: 88 23 and r24, r24 19526: 61 f0 breq .+24 ; 0x19540 data = code_value_short(); 19528: 0e 94 8d 5b call 0xb71a ; 0xb71a } if(addr){ 1952c: 11 23 and r17, r17 1952e: 11 f4 brne .+4 ; 0x19534 19530: 0c 94 05 ab jmp 0x1560a ; 0x1560a MMU2::mmu2.WriteRegister(addr, data); 19534: bc 01 movw r22, r24 19536: 81 2f mov r24, r17 19538: 0e 94 1f e8 call 0x1d03e ; 0x1d03e 1953c: 0c 94 05 ab jmp 0x1560a ; 0x1560a 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; 19540: 90 e0 ldi r25, 0x00 ; 0 19542: 80 e0 ldi r24, 0x00 ; 0 19544: f3 cf rjmp .-26 ; 0x1952c 19546: 60 e0 ldi r22, 0x00 ; 0 19548: 8c ea ldi r24, 0xAC ; 172 1954a: 9c e0 ldi r25, 0x0C ; 12 1954c: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 19550: 10 92 b9 13 sts 0x13B9, r1 ; 0x8013b9 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 19554: 10 92 67 13 sts 0x1367, r1 ; 0x801367 currentScope = Scope::Stopped; 19558: 10 92 4c 13 sts 0x134C, r1 ; 0x80134c 1955c: 0c 94 7d aa jmp 0x154fa ; 0x154fa 19560: 61 e0 ldi r22, 0x01 ; 1 19562: 8c ea ldi r24, 0xAC ; 172 19564: 9c e0 ldi r25, 0x0C ; 12 19566: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 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(); 1956a: 0e 94 69 e3 call 0x1c6d2 ; 0x1c6d2 1956e: 0c 94 7d aa jmp 0x154fa ; 0x154fa break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 19572: 80 e0 ldi r24, 0x00 ; 0 } void MMU2::ResetX42() { logic.ResetMMU(42); 19574: 0f 94 52 0f call 0x21ea4 ; 0x21ea4 19578: 0c 94 93 aa jmp 0x15526 ; 0x15526 } void MMU2::TriggerResetPin() { reset(); 1957c: 0f 94 55 c5 call 0x38aaa ; 0x38aaa 19580: 0c 94 93 aa jmp 0x15526 ; 0x15526 void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset } void MMU2::ResetX42() { logic.ResetMMU(42); 19584: 8a e2 ldi r24, 0x2A ; 42 19586: f6 cf rjmp .-20 ; 0x19574 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') { 19588: 84 35 cpi r24, 0x54 ; 84 1958a: 09 f0 breq .+2 ; 0x1958e 1958c: 79 c0 rjmp .+242 ; 0x19680 strchr_pointer = CMDBUFFER_CURRENT_STRING; 1958e: 10 93 94 03 sts 0x0394, r17 ; 0x800394 19592: 00 93 93 03 sts 0x0393, r16 ; 0x800393 processing_tcode = true; 19596: 81 e0 ldi r24, 0x01 ; 1 19598: 80 93 a1 03 sts 0x03A1, r24 ; 0x8003a1 TCodes(strchr_pointer, code_value_uint8()); 1959c: 0e 94 80 5b call 0xb700 ; 0xb700 195a0: 18 2f mov r17, r24 195a2: 20 91 93 03 lds r18, 0x0393 ; 0x800393 195a6: 30 91 94 03 lds r19, 0x0394 ; 0x800394 inline void TCodeInvalid() { SERIAL_ECHOLNPGM("Invalid T code."); } void TCodes(char *const strchr_pointer, const uint8_t codeValue) { uint8_t index = 1; 195aa: 91 e0 ldi r25, 0x01 ; 1 for ( /*nothing*/ ; strchr_pointer[index] == ' ' || strchr_pointer[index] == '\t'; index++) 195ac: 79 01 movw r14, r18 195ae: e9 0e add r14, r25 195b0: f1 1c adc r15, r1 195b2: d7 01 movw r26, r14 195b4: 8c 91 ld r24, X 195b6: 80 32 cpi r24, 0x20 ; 32 195b8: 11 f0 breq .+4 ; 0x195be 195ba: 89 30 cpi r24, 0x09 ; 9 195bc: 11 f4 brne .+4 ; 0x195c2 195be: 9f 5f subi r25, 0xFF ; 255 195c0: f5 cf rjmp .-22 ; 0x195ac ; strchr_pointer[index] = tolower(strchr_pointer[index]); 195c2: 08 2e mov r0, r24 195c4: 00 0c add r0, r0 195c6: 99 0b sbc r25, r25 195c8: 0f 94 eb e1 call 0x3c3d6 ; 0x3c3d6 195cc: f7 01 movw r30, r14 195ce: 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'); 195d0: 90 ed ldi r25, 0xD0 ; 208 195d2: 98 0f add r25, r24 195d4: 95 30 cpi r25, 0x05 ; 5 195d6: 58 f0 brcs .+22 ; 0x195ee 195d8: 8f 33 cpi r24, 0x3F ; 63 195da: 59 f0 breq .+22 ; 0x195f2 195dc: 88 37 cpi r24, 0x78 ; 120 195de: 49 f0 breq .+18 ; 0x195f2 195e0: 83 36 cpi r24, 0x63 ; 99 195e2: f1 f0 breq .+60 ; 0x19620 } inline void TCodeInvalid() { SERIAL_ECHOLNPGM("Invalid T code."); 195e4: 8d e7 ldi r24, 0x7D ; 125 195e6: 9e e7 ldi r25, 0x7E ; 126 } else { SERIAL_ECHO_START; if (codeValue >= EXTRUDERS) { SERIAL_ECHO('T'); SERIAL_ECHOLN(codeValue + '0'); SERIAL_ECHOLNRPGM(_n("Invalid extruder")); ////MSG_INVALID_EXTRUDER 195e8: 0e 94 93 79 call 0xf326 ; 0xf326 195ec: 13 c0 rjmp .+38 ; 0x19614 strchr_pointer[index] = tolower(strchr_pointer[index]); if (IsInvalidTCode(strchr_pointer, index)){ TCodeInvalid(); } else if (strchr_pointer[index] == 'x' || strchr_pointer[index] == '?'){ 195ee: 8f 33 cpi r24, 0x3F ; 63 195f0: a9 f4 brne .+42 ; 0x1961c // load to extruder gears; if mmu is not present do nothing if (MMU2::mmu2.Enabled()) { 195f2: 80 91 b9 13 lds r24, 0x13B9 ; 0x8013b9 195f6: 81 30 cpi r24, 0x01 ; 1 195f8: 69 f4 brne .+26 ; 0x19614 MMU2::mmu2.tool_change(strchr_pointer[index], choose_menu_P(_T(MSG_SELECT_FILAMENT), MSG_FILAMENT)); 195fa: 8d ea ldi r24, 0xAD ; 173 195fc: 9b e3 ldi r25, 0x3B ; 59 195fe: 0e 94 c4 72 call 0xe588 ; 0xe588 19602: 70 e0 ldi r23, 0x00 ; 0 19604: 60 e0 ldi r22, 0x00 ; 0 19606: 0e 94 dc e3 call 0x1c7b8 ; 0x1c7b8 1960a: 68 2f mov r22, r24 1960c: d7 01 movw r26, r14 1960e: 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()); 19610: 0f 94 f0 0e call 0x21de0 ; 0x21de0 processing_tcode = false; 19614: 10 92 a1 03 sts 0x03A1, r1 ; 0x8003a1 19618: 0c 94 50 96 jmp 0x12ca0 ; 0x12ca0 } 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'){ 1961c: 83 36 cpi r24, 0x63 ; 99 1961e: 49 f4 brne .+18 ; 0x19632 // load from extruder gears to nozzle (nozzle should be preheated) if (MMU2::mmu2.Enabled()) { 19620: 80 91 b9 13 lds r24, 0x13B9 ; 0x8013b9 19624: 81 30 cpi r24, 0x01 ; 1 19626: b1 f7 brne .-20 ; 0x19614 MMU2::mmu2.tool_change(strchr_pointer[index], MMU2::mmu2.get_current_tool()); 19628: 0f 94 74 74 call 0x2e8e8 ; 0x2e8e8 1962c: 68 2f mov r22, r24 1962e: 83 e6 ldi r24, 0x63 ; 99 19630: ef cf rjmp .-34 ; 0x19610 } } else { // Process T0 ... T4 if (MMU2::mmu2.Enabled()) { 19632: 80 91 b9 13 lds r24, 0x13B9 ; 0x8013b9 19636: 81 30 cpi r24, 0x01 ; 1 19638: 69 f4 brne .+26 ; 0x19654 if (codeValue == MMU2::mmu2.get_current_tool()){ 1963a: 0f 94 74 74 call 0x2e8e8 ; 0x2e8e8 1963e: 18 13 cpse r17, r24 19640: 05 c0 rjmp .+10 ; 0x1964c // don't execute the same T-code twice in a row puts_P(duplicate_Tcode_ignored); 19642: 8d e8 ldi r24, 0x8D ; 141 19644: 9e e7 ldi r25, 0x7E ; 126 19646: 0f 94 c0 da call 0x3b580 ; 0x3b580 1964a: e4 cf rjmp .-56 ; 0x19614 #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); 1964c: 81 2f mov r24, r17 1964e: 0f 94 cd 0e call 0x21d9a ; 0x21d9a 19652: e0 cf rjmp .-64 ; 0x19614 } } else { SERIAL_ECHO_START; 19654: 82 ef ldi r24, 0xF2 ; 242 19656: 9b ea ldi r25, 0xAB ; 171 19658: 0e 94 68 77 call 0xeed0 ; 0xeed0 if (codeValue >= EXTRUDERS) { 1965c: 11 23 and r17, r17 1965e: 59 f0 breq .+22 ; 0x19676 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 19660: 84 e5 ldi r24, 0x54 ; 84 19662: 0e 94 4f 77 call 0xee9e ; 0xee9e SERIAL_ECHO('T'); SERIAL_ECHOLN(codeValue + '0'); 19666: 81 2f mov r24, r17 19668: 90 e0 ldi r25, 0x00 ; 0 1966a: c0 96 adiw r24, 0x30 ; 48 1966c: 0f 94 b0 74 call 0x2e960 ; 0x2e960 SERIAL_ECHOLNRPGM(_n("Invalid extruder")); ////MSG_INVALID_EXTRUDER 19670: 8b eb ldi r24, 0xBB ; 187 19672: 97 e6 ldi r25, 0x67 ; 103 19674: b9 cf rjmp .-142 ; 0x195e8 // next_feedrate = code_value(); // if (next_feedrate > 0.0) { // feedrate = next_feedrate; // } // } SERIAL_ECHORPGM(_n("Active Extruder: 0")); ////MSG_ACTIVE_EXTRUDER 19676: 88 ea ldi r24, 0xA8 ; 168 19678: 97 e6 ldi r25, 0x67 ; 103 1967a: 0e 94 68 77 call 0xeed0 ; 0xeed0 1967e: ca cf rjmp .-108 ; 0x19614 /** *--------------------------------------------------------------------------------- *# D codes */ else if(*CMDBUFFER_CURRENT_STRING == 'D') // D codes (debug) 19680: 84 34 cpi r24, 0x44 ; 68 19682: 09 f0 breq .+2 ; 0x19686 19684: ee c0 rjmp .+476 ; 0x19862 { strchr_pointer = CMDBUFFER_CURRENT_STRING; 19686: 10 93 94 03 sts 0x0394, r17 ; 0x800394 1968a: 00 93 93 03 sts 0x0393, r16 ; 0x800393 switch(code_value_short()) 1968e: 0e 94 8d 5b call 0xb71a ; 0xb71a 19692: 86 30 cpi r24, 0x06 ; 6 19694: 91 05 cpc r25, r1 19696: 09 f4 brne .+2 ; 0x1969a 19698: 79 c0 rjmp .+242 ; 0x1978c 1969a: 9c f4 brge .+38 ; 0x196c2 1969c: 82 30 cpi r24, 0x02 ; 2 1969e: 91 05 cpc r25, r1 196a0: 09 f4 brne .+2 ; 0x196a4 196a2: 52 c0 rjmp .+164 ; 0x19748 196a4: 83 30 cpi r24, 0x03 ; 3 196a6: 91 05 cpc r25, r1 196a8: 09 f4 brne .+2 ; 0x196ac 196aa: 61 c0 rjmp .+194 ; 0x1976e 196ac: 01 96 adiw r24, 0x01 ; 1 196ae: 89 f4 brne .+34 ; 0x196d2 * */ void dcode__1() { DBG(_N("D-1 - Endless loop\n")); 196b0: 84 e9 ldi r24, 0x94 ; 148 196b2: 97 e6 ldi r25, 0x67 ; 103 196b4: 9f 93 push r25 196b6: 8f 93 push r24 196b8: 0f 94 99 da call 0x3b532 ; 0x3b532 196bc: 0f 90 pop r0 196be: 0f 90 pop r0 196c0: ff cf rjmp .-2 ; 0x196c0 196c2: 85 31 cpi r24, 0x15 ; 21 196c4: 91 05 cpc r25, r1 196c6: 09 f4 brne .+2 ; 0x196ca 196c8: 8d c0 rjmp .+282 ; 0x197e4 196ca: 94 f4 brge .+36 ; 0x196f0 196cc: 44 97 sbiw r24, 0x14 ; 20 196ce: 09 f4 brne .+2 ; 0x196d2 196d0: 69 c0 rjmp .+210 ; 0x197a4 #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) #endif //DEBUG_DCODES default: printf_P(MSG_UNKNOWN_CODE, 'D', cmdbuffer + bufindr + CMDHDRSIZE); 196d2: 80 91 91 12 lds r24, 0x1291 ; 0x801291 196d6: 90 91 92 12 lds r25, 0x1292 ; 0x801292 196da: 89 55 subi r24, 0x59 ; 89 196dc: 9f 4e sbci r25, 0xEF ; 239 196de: 9f 93 push r25 196e0: 8f 93 push r24 196e2: 1f 92 push r1 196e4: 84 e4 ldi r24, 0x44 ; 68 196e6: 8f 93 push r24 196e8: 8c e8 ldi r24, 0x8C ; 140 196ea: 99 e6 ldi r25, 0x69 ; 105 196ec: 0c 94 eb 97 jmp 0x12fd6 ; 0x12fd6 *# D codes */ else if(*CMDBUFFER_CURRENT_STRING == 'D') // D codes (debug) { strchr_pointer = CMDBUFFER_CURRENT_STRING; switch(code_value_short()) 196f0: 86 31 cpi r24, 0x16 ; 22 196f2: 91 05 cpc r25, r1 196f4: 09 f4 brne .+2 ; 0x196f8 196f6: 9b c0 rjmp .+310 ; 0x1982e 196f8: 86 34 cpi r24, 0x46 ; 70 196fa: 91 05 cpc r25, r1 196fc: 51 f7 brne .-44 ; 0x196d2 #### Parameters - `S` - Enable 0-1 (default 0) */ case 70: { if(code_seen('S')) 196fe: 83 e5 ldi r24, 0x53 ; 83 19700: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 19704: 88 23 and r24, r24 19706: 11 f4 brne .+4 ; 0x1970c 19708: 0c 94 50 96 jmp 0x12ca0 ; 0x12ca0 thermal_model_log_enable(code_value_short()); 1970c: 0e 94 8d 5b call 0xb71a ; 0xb71a 19710: 11 e0 ldi r17, 0x01 ; 1 19712: 00 97 sbiw r24, 0x00 ; 0 19714: 09 f4 brne .+2 ; 0x19718 19716: 10 e0 ldi r17, 0x00 ; 0 } #ifdef THERMAL_MODEL_DEBUG void thermal_model_log_enable(bool enable) { if(enable) { 19718: 89 2b or r24, r25 1971a: 91 f0 breq .+36 ; 0x19740 TempMgrGuard temp_mgr_guard; 1971c: ce 01 movw r24, r28 1971e: 01 96 adiw r24, 0x01 ; 1 19720: 0f 94 70 31 call 0x262e0 ; 0x262e0 thermal_model::log_buf.entry.stamp = _millis(); 19724: 0f 94 22 29 call 0x25244 ; 0x25244 19728: 60 93 23 06 sts 0x0623, r22 ; 0x800623 <_ZN13thermal_modelL7log_bufE.lto_priv.537> 1972c: 70 93 24 06 sts 0x0624, r23 ; 0x800624 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x1> 19730: 80 93 25 06 sts 0x0625, r24 ; 0x800625 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x2> 19734: 90 93 26 06 sts 0x0626, r25 ; 0x800626 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x3> #ifdef THERMAL_MODEL_DEBUG void thermal_model_log_enable(bool enable) { if(enable) { TempMgrGuard temp_mgr_guard; 19738: ce 01 movw r24, r28 1973a: 01 96 adiw r24, 0x01 ; 1 1973c: 0f 94 63 31 call 0x262c6 ; 0x262c6 thermal_model::log_buf.entry.stamp = _millis(); } thermal_model::log_buf.enabled = enable; 19740: 10 93 33 06 sts 0x0633, r17 ; 0x800633 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x10> 19744: 0c 94 50 96 jmp 0x12ca0 ; 0x12ca0 - The hex data needs to be lowercase */ void dcode_2() { dcode_core(RAMSTART, RAMEND+1, dcode_mem_t::sram, 2, _N("SRAM")); 19748: 4f e8 ldi r20, 0x8F ; 143 1974a: c4 2e mov r12, r20 1974c: 47 e6 ldi r20, 0x67 ; 103 1974e: d4 2e mov r13, r20 19750: 52 e0 ldi r21, 0x02 ; 2 19752: e5 2e mov r14, r21 19754: 00 e0 ldi r16, 0x00 ; 0 19756: 20 e0 ldi r18, 0x00 ; 0 19758: 32 e2 ldi r19, 0x22 ; 34 1975a: 40 e0 ldi r20, 0x00 ; 0 1975c: 50 e0 ldi r21, 0x00 ; 0 1975e: 60 e0 ldi r22, 0x00 ; 0 19760: 72 e0 ldi r23, 0x02 ; 2 19762: 80 e0 ldi r24, 0x00 ; 0 19764: 90 e0 ldi r25, 0x00 ; 0 - The hex data needs to be lowercase - Writing is currently not implemented */ void dcode_6() { dcode_core(0x0, XFLASH_SIZE, dcode_mem_t::xflash, 6, _N("XFLASH")); 19766: 0e 94 bb 62 call 0xc576 ; 0xc576 1976a: 0c 94 50 96 jmp 0x12ca0 ; 0x12ca0 - The hex data needs to be lowercase */ void dcode_3() { dcode_core(0, EEPROM_SIZE, dcode_mem_t::eeprom, 3, _N("EEPROM")); 1976e: 28 e8 ldi r18, 0x88 ; 136 19770: c2 2e mov r12, r18 19772: 27 e6 ldi r18, 0x67 ; 103 19774: d2 2e mov r13, r18 19776: 33 e0 ldi r19, 0x03 ; 3 19778: e3 2e mov r14, r19 1977a: 01 e0 ldi r16, 0x01 ; 1 1977c: 20 e0 ldi r18, 0x00 ; 0 1977e: 30 e1 ldi r19, 0x10 ; 16 19780: 40 e0 ldi r20, 0x00 ; 0 19782: 50 e0 ldi r21, 0x00 ; 0 - The hex data needs to be lowercase - Writing is currently not implemented */ void dcode_6() { dcode_core(0x0, XFLASH_SIZE, dcode_mem_t::xflash, 6, _N("XFLASH")); 19784: 60 e0 ldi r22, 0x00 ; 0 19786: 70 e0 ldi r23, 0x00 ; 0 19788: cb 01 movw r24, r22 1978a: ed cf rjmp .-38 ; 0x19766 1978c: 81 e8 ldi r24, 0x81 ; 129 1978e: c8 2e mov r12, r24 19790: 87 e6 ldi r24, 0x67 ; 103 19792: d8 2e mov r13, r24 19794: 96 e0 ldi r25, 0x06 ; 6 19796: e9 2e mov r14, r25 19798: 03 e0 ldi r16, 0x03 ; 3 1979a: 20 e0 ldi r18, 0x00 ; 0 1979c: 30 e0 ldi r19, 0x00 ; 0 1979e: 44 e0 ldi r20, 0x04 ; 4 197a0: 50 e0 ldi r21, 0x00 ; 0 197a2: f0 cf rjmp .-32 ; 0x19784 #ifdef XFLASH_DUMP #include "xflash_dump.h" void dcode_20() { if(code_seen('E')) 197a4: 85 e4 ldi r24, 0x45 ; 69 197a6: 0e 94 ee 5b call 0xb7dc ; 0xb7dc 197aa: 88 23 and r24, r24 197ac: 29 f0 breq .+10 ; 0x197b8 xfdump_full_dump_and_reset(); 197ae: 80 e0 ldi r24, 0x00 ; 0 197b0: 0e 94 97 ed call 0x1db2e ; 0x1db2e 197b4: 0c 94 50 96 jmp 0x12ca0 ; 0x12ca0 else { unsigned long ts = _millis(); 197b8: 0f 94 22 29 call 0x25244 ; 0x25244 197bc: 6b 01 movw r12, r22 197be: 7c 01 movw r14, r24 xfdump_dump(); 197c0: 0e 94 c5 ed call 0x1db8a ; 0x1db8a ts = _millis() - ts; 197c4: 0f 94 22 29 call 0x25244 ; 0x25244 197c8: dc 01 movw r26, r24 197ca: cb 01 movw r24, r22 197cc: 8c 19 sub r24, r12 197ce: 9d 09 sbc r25, r13 197d0: ae 09 sbc r26, r14 197d2: bf 09 sbc r27, r15 DBG(_N("dump completed in %lums\n"), ts); 197d4: bf 93 push r27 197d6: af 93 push r26 197d8: 9f 93 push r25 197da: 8f 93 push r24 197dc: 88 e6 ldi r24, 0x68 ; 104 197de: 97 e6 ldi r25, 0x67 ; 103 197e0: 0c 94 eb 97 jmp 0x12fd6 ; 0x12fd6 } } void dcode_21() { if(!xfdump_check_state()) 197e4: 90 e0 ldi r25, 0x00 ; 0 197e6: 80 e0 ldi r24, 0x00 ; 0 197e8: 0e 94 e3 ec call 0x1d9c6 ; 0x1d9c6 197ec: 81 11 cpse r24, r1 197ee: 07 c0 rjmp .+14 ; 0x197fe DBG(_N("no dump available\n")); 197f0: 85 e5 ldi r24, 0x55 ; 85 197f2: 97 e6 ldi r25, 0x67 ; 103 if(!xfdump_check_state()) DBG(_N("no dump available\n")); else { xfdump_reset(); DBG(_N("dump cleared\n")); 197f4: 9f 93 push r25 197f6: 8f 93 push r24 197f8: 0f 94 99 da call 0x3b532 ; 0x3b532 197fc: 14 c0 rjmp .+40 ; 0x19826 { if(!xfdump_check_state()) DBG(_N("no dump available\n")); else { KEEPALIVE_STATE(NOT_BUSY); 197fe: 81 e0 ldi r24, 0x01 ; 1 19800: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be DBG(_N("D21 - read crash dump\n")); 19804: 8e e3 ldi r24, 0x3E ; 62 19806: 97 e6 ldi r25, 0x67 ; 103 19808: 9f 93 push r25 1980a: 8f 93 push r24 1980c: 0f 94 99 da call 0x3b532 ; 0x3b532 print_mem(DUMP_OFFSET, sizeof(dump_t), dcode_mem_t::xflash); 19810: 03 e0 ldi r16, 0x03 ; 3 19812: 20 e0 ldi r18, 0x00 ; 0 19814: 33 e2 ldi r19, 0x23 ; 35 19816: 40 e0 ldi r20, 0x00 ; 0 19818: 50 e0 ldi r21, 0x00 ; 0 1981a: 60 e0 ldi r22, 0x00 ; 0 1981c: 70 ed ldi r23, 0xD0 ; 208 1981e: 83 e0 ldi r24, 0x03 ; 3 19820: 90 e0 ldi r25, 0x00 ; 0 19822: 0f 94 e4 85 call 0x30bc8 ; 0x30bc8 if(!xfdump_check_state()) DBG(_N("no dump available\n")); else { xfdump_reset(); DBG(_N("dump cleared\n")); 19826: 0f 90 pop r0 19828: 0f 90 pop r0 1982a: 0c 94 50 96 jmp 0x12ca0 ; 0x12ca0 } } void dcode_22() { if(!xfdump_check_state()) 1982e: 90 e0 ldi r25, 0x00 ; 0 19830: 80 e0 ldi r24, 0x00 ; 0 19832: 0e 94 e3 ec call 0x1d9c6 ; 0x1d9c6 19836: 81 11 cpse r24, r1 19838: 03 c0 rjmp .+6 ; 0x19840 DBG(_N("no dump available\n")); 1983a: 8b e2 ldi r24, 0x2B ; 43 1983c: 97 e6 ldi r25, 0x67 ; 103 1983e: da cf rjmp .-76 ; 0x197f4 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 19840: 8c e5 ldi r24, 0x5C ; 92 19842: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 19844: 1d bc out 0x2d, r1 ; 45 void xfdump_reset() { XFLASH_SPI_ENTER(); xflash_enable_wr(); 19846: 0e 94 1b ed call 0x1da36 ; 0x1da36 _CS_HIGH(); } void xflash_sector_erase(uint32_t addr) { return xflash_erase(_CMD_SECTOR_ERASE, addr); 1984a: 40 e0 ldi r20, 0x00 ; 0 1984c: 50 ed ldi r21, 0xD0 ; 208 1984e: 63 e0 ldi r22, 0x03 ; 3 19850: 70 e0 ldi r23, 0x00 ; 0 19852: 80 e2 ldi r24, 0x20 ; 32 19854: 0e 94 9d ec call 0x1d93a ; 0x1d93a xflash_sector_erase(DUMP_OFFSET + offsetof(dump_t, header.magic)); xflash_wait_busy(); 19858: 0e 94 7f ec call 0x1d8fe ; 0x1d8fe else { xfdump_reset(); DBG(_N("dump cleared\n")); 1985c: 8d e1 ldi r24, 0x1D ; 29 1985e: 97 e6 ldi r25, 0x67 ; 103 19860: c9 cf rjmp .-110 ; 0x197f4 } } else { SERIAL_ECHO_START; 19862: 82 ef ldi r24, 0xF2 ; 242 19864: 9b ea ldi r25, 0xAB ; 171 19866: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); 1986a: 8d e1 ldi r24, 0x1D ; 29 1986c: 98 e6 ldi r25, 0x68 ; 104 1986e: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); 19872: 80 91 91 12 lds r24, 0x1291 ; 0x801291 19876: 90 91 92 12 lds r25, 0x1292 ; 0x801292 1987a: 89 55 subi r24, 0x59 ; 89 1987c: 9f 4e sbci r25, 0xEF ; 239 1987e: 0e 94 2c 88 call 0x11058 ; 0x11058 SERIAL_ECHOLNPGM("\"(2)"); 19882: 81 e7 ldi r24, 0x71 ; 113 19884: 95 e8 ldi r25, 0x85 ; 133 19886: 0c 94 5b 98 jmp 0x130b6 ; 0x130b6 #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 1988a: 2d ec ldi r18, 0xCD ; 205 1988c: 3c ec ldi r19, 0xCC ; 204 1988e: 4c ec ldi r20, 0xCC ; 204 19890: 5d e3 ldi r21, 0x3D ; 61 19892: c7 01 movw r24, r14 19894: b6 01 movw r22, r12 19896: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 1989a: 18 16 cp r1, r24 1989c: 14 f4 brge .+4 ; 0x198a2 1989e: 0c 94 98 99 jmp 0x13330 ; 0x13330 198a2: 0c 94 06 9b jmp 0x1360c ; 0x1360c 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; 198a6: a3 01 movw r20, r6 198a8: 92 01 movw r18, r4 198aa: 62 2d mov r22, r2 198ac: 73 2d mov r23, r3 198ae: 8e 2d mov r24, r14 198b0: 9f 2d mov r25, r15 198b2: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 198b6: 18 16 cp r1, r24 198b8: 14 f0 brlt .+4 ; 0x198be 198ba: 0c 94 e7 a2 jmp 0x145ce ; 0x145ce 198be: e5 e0 ldi r30, 0x05 ; 5 198c0: ce 0e add r12, r30 198c2: d1 1c adc r13, r1 198c4: f2 e0 ldi r31, 0x02 ; 2 198c6: 8f 0e add r8, r31 198c8: 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; 198ca: 85 01 movw r16, r10 198cc: 0c 94 ae a2 jmp 0x1455c ; 0x1455c uint16_t res_new = code_value(); #ifdef ALLOW_ALL_MRES bool res_valid = res_new > 0 && res_new <= 256 && !(res_new & (res_new - 1)); // must be a power of two #else bool res_valid = (res_new == 8) || (res_new == 16) || (res_new == 32); // resolutions valid for all axis res_valid |= (i != E_AXIS) && ((res_new == 1) || (res_new == 2) || (res_new == 4)); // resolutions valid for X Y Z only 198d0: 67 96 adiw r28, 0x17 ; 23 198d2: 2f ad ldd r18, Y+63 ; 0x3f 198d4: 67 97 sbiw r28, 0x17 ; 23 198d6: 8b 2d mov r24, r11 198d8: 23 30 cpi r18, 0x03 ; 3 198da: 29 f0 breq .+10 ; 0x198e6 198dc: 91 e0 ldi r25, 0x01 ; 1 198de: 04 30 cpi r16, 0x04 ; 4 198e0: 11 05 cpc r17, r1 198e2: 09 f4 brne .+2 ; 0x198e6 198e4: ac cc rjmp .-1704 ; 0x1923e 198e6: 90 e0 ldi r25, 0x00 ; 0 198e8: aa cc rjmp .-1708 ; 0x1923e 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)); 198ea: 86 ea ldi r24, 0xA6 ; 166 198ec: 99 e3 ldi r25, 0x39 ; 57 198ee: 0e 94 c4 72 call 0xe588 ; 0xe588 198f2: 0f 94 ba 1f call 0x23f74 ; 0x23f74 lcd_puts_at_P(0, 2, PSTR("")); 198f6: 44 ed ldi r20, 0xD4 ; 212 198f8: 54 e8 ldi r21, 0x84 ; 132 198fa: 62 e0 ldi r22, 0x02 ; 2 198fc: 80 e0 ldi r24, 0x00 ; 0 198fe: 0e 94 0c 6f call 0xde18 ; 0xde18 for (const char *c = version_string; ! is_whitespace_or_nl_or_eol(*c); ++ c) 19902: f8 01 movw r30, r16 19904: 81 91 ld r24, Z+ 19906: 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'; 19908: 98 2f mov r25, r24 1990a: 9f 7d andi r25, 0xDF ; 223 1990c: 11 f4 brne .+4 ; 0x19912 1990e: 0c 94 f4 b0 jmp 0x161e8 ; 0x161e8 19912: 97 ef ldi r25, 0xF7 ; 247 19914: 98 0f add r25, r24 19916: 92 30 cpi r25, 0x02 ; 2 19918: 10 f4 brcc .+4 ; 0x1991e 1991a: 0c 94 f4 b0 jmp 0x161e8 ; 0x161e8 1991e: 8d 30 cpi r24, 0x0D ; 13 19920: 11 f4 brne .+4 ; 0x19926 19922: 0c 94 f4 b0 jmp 0x161e8 ; 0x161e8 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); 19926: 0e 94 e7 6e call 0xddce ; 0xddce 1992a: eb cf rjmp .-42 ; 0x19902 thermal_model::data.L = samples * intv_ms; } void thermal_model_set_params(float P, float U, float V, float C, float D, int16_t L, float Ta_corr, float warn, float err) { TempMgrGuard temp_mgr_guard; 1992c: ce 01 movw r24, r28 1992e: 01 96 adiw r24, 0x01 ; 1 19930: 0f 94 70 31 call 0x262e0 ; 0x262e0 19934: 0c 94 28 b7 jmp 0x16e50 ; 0x16e50 00019938 : uint8_t check_pinda_0() { return _PINDA?0:1; } 19938: 22 e0 ldi r18, 0x02 ; 2 1993a: 20 93 c0 00 sts 0x00C0, r18 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> 1993e: 10 92 c5 00 sts 0x00C5, r1 ; 0x8000c5 <__TEXT_REGION_LENGTH__+0x7c20c5> 19942: 90 e1 ldi r25, 0x10 ; 16 19944: 90 93 c4 00 sts 0x00C4, r25 ; 0x8000c4 <__TEXT_REGION_LENGTH__+0x7c20c4> 19948: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 1994c: 80 61 ori r24, 0x10 ; 16 1994e: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 19952: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 19956: 88 60 ori r24, 0x08 ; 8 19958: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 1995c: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 19960: 80 68 ori r24, 0x80 ; 128 19962: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 19966: 80 91 38 05 lds r24, 0x0538 ; 0x800538 1996a: 81 30 cpi r24, 0x01 ; 1 1996c: a9 f4 brne .+42 ; 0x19998 1996e: 20 93 c8 00 sts 0x00C8, r18 ; 0x8000c8 <__TEXT_REGION_LENGTH__+0x7c20c8> 19972: 10 92 cd 00 sts 0x00CD, r1 ; 0x8000cd <__TEXT_REGION_LENGTH__+0x7c20cd> 19976: 90 93 cc 00 sts 0x00CC, r25 ; 0x8000cc <__TEXT_REGION_LENGTH__+0x7c20cc> 1997a: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 1997e: 80 61 ori r24, 0x10 ; 16 19980: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 19984: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 19988: 88 60 ori r24, 0x08 ; 8 1998a: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 1998e: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 19992: 80 68 ori r24, 0x80 ; 128 19994: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 19998: 08 95 ret 0001999a : 1999a: 81 50 subi r24, 0x01 ; 1 1999c: 82 31 cpi r24, 0x12 ; 18 1999e: 08 f0 brcs .+2 ; 0x199a2 199a0: 5a c0 rjmp .+180 ; 0x19a56 199a2: e8 2f mov r30, r24 199a4: f0 e0 ldi r31, 0x00 ; 0 199a6: 88 27 eor r24, r24 199a8: e7 52 subi r30, 0x27 ; 39 199aa: f3 43 sbci r31, 0x33 ; 51 199ac: 8f 4f sbci r24, 0xFF ; 255 199ae: 0d 94 e7 dc jmp 0x3b9ce ; 0x3b9ce <__tablejump2__> 199b2: f9 cc rjmp .-1550 ; 0x193a6 199b4: fd cc rjmp .-1542 ; 0x193b0 199b6: eb cc rjmp .-1578 ; 0x1938e 199b8: f1 cc rjmp .-1566 ; 0x1939c 199ba: f5 cc rjmp .-1558 ; 0x193a6 199bc: 2b cd rjmp .-1450 ; 0x19414 199be: 00 cd rjmp .-1536 ; 0x193c0 199c0: 06 cd rjmp .-1524 ; 0x193ce 199c2: 0a cd rjmp .-1516 ; 0x193d8 199c4: 10 cd rjmp .-1504 ; 0x193e6 199c6: 14 cd rjmp .-1496 ; 0x193f0 199c8: 18 cd rjmp .-1488 ; 0x193fa 199ca: 1e cd rjmp .-1476 ; 0x19408 199cc: 22 cd rjmp .-1468 ; 0x19412 199ce: 2b cd rjmp .-1450 ; 0x19426 199d0: 26 cd rjmp .-1460 ; 0x1941e 199d2: 2c cd rjmp .-1448 ; 0x1942c 199d4: 30 cd rjmp .-1440 ; 0x19436 199d6: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 199da: 8f 77 andi r24, 0x7F ; 127 199dc: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 199e0: 08 95 ret 199e2: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 199e6: 8f 7d andi r24, 0xDF ; 223 199e8: f9 cf rjmp .-14 ; 0x199dc 199ea: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 199ee: 87 7f andi r24, 0xF7 ; 247 199f0: f5 cf rjmp .-22 ; 0x199dc 199f2: 84 b5 in r24, 0x24 ; 36 199f4: 8f 77 andi r24, 0x7F ; 127 199f6: 84 bd out 0x24, r24 ; 36 199f8: 08 95 ret 199fa: 84 b5 in r24, 0x24 ; 36 199fc: 8f 7d andi r24, 0xDF ; 223 199fe: fb cf rjmp .-10 ; 0x199f6 19a00: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 19a04: 8f 77 andi r24, 0x7F ; 127 19a06: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 19a0a: 08 95 ret 19a0c: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 19a10: 8f 7d andi r24, 0xDF ; 223 19a12: f9 cf rjmp .-14 ; 0x19a06 19a14: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 19a18: 8f 77 andi r24, 0x7F ; 127 19a1a: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 19a1e: 08 95 ret 19a20: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 19a24: 8f 7d andi r24, 0xDF ; 223 19a26: f9 cf rjmp .-14 ; 0x19a1a 19a28: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 19a2c: 87 7f andi r24, 0xF7 ; 247 19a2e: f5 cf rjmp .-22 ; 0x19a1a 19a30: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 19a34: 8f 77 andi r24, 0x7F ; 127 19a36: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 19a3a: 08 95 ret 19a3c: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 19a40: 8f 7d andi r24, 0xDF ; 223 19a42: f9 cf rjmp .-14 ; 0x19a36 19a44: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 19a48: 87 7f andi r24, 0xF7 ; 247 19a4a: f5 cf rjmp .-22 ; 0x19a36 19a4c: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 19a50: 8f 77 andi r24, 0x7F ; 127 19a52: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 19a56: 08 95 ret 19a58: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 19a5c: 8f 7d andi r24, 0xDF ; 223 19a5e: f9 cf rjmp .-14 ; 0x19a52 19a60: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 19a64: 87 7f andi r24, 0xF7 ; 247 19a66: f5 cf rjmp .-22 ; 0x19a52 00019a68 : 19a68: 83 b1 in r24, 0x03 ; 3 19a6a: 82 95 swap r24 19a6c: 81 70 andi r24, 0x01 ; 1 19a6e: 08 95 ret 00019a70 : } #else //SM4_ACCEL_TEST uint16_t xyzcal_calc_delay(uint16_t, uint16_t) { return xyzcal_sm4_delay; } 19a70: 80 91 fc 03 lds r24, 0x03FC ; 0x8003fc 19a74: 90 91 fd 03 lds r25, 0x03FD ; 0x8003fd 19a78: 08 95 ret 00019a7a : } uint8_t xyzcal_dm = 0; void xyzcal_update_pos(uint16_t dx, uint16_t dy, uint16_t dz, uint16_t) { 19a7a: cf 92 push r12 19a7c: df 92 push r13 19a7e: ef 92 push r14 19a80: 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; 19a82: 20 91 fe 03 lds r18, 0x03FE ; 0x8003fe 19a86: b0 e0 ldi r27, 0x00 ; 0 19a88: a0 e0 ldi r26, 0x00 ; 0 19a8a: c0 90 b2 06 lds r12, 0x06B2 ; 0x8006b2 19a8e: d0 90 b3 06 lds r13, 0x06B3 ; 0x8006b3 19a92: e0 90 b4 06 lds r14, 0x06B4 ; 0x8006b4 19a96: f0 90 b5 06 lds r15, 0x06B5 ; 0x8006b5 19a9a: 20 ff sbrs r18, 0 19a9c: 42 c0 rjmp .+132 ; 0x19b22 19a9e: c8 1a sub r12, r24 19aa0: d9 0a sbc r13, r25 19aa2: ea 0a sbc r14, r26 19aa4: fb 0a sbc r15, r27 19aa6: c0 92 b2 06 sts 0x06B2, r12 ; 0x8006b2 19aaa: d0 92 b3 06 sts 0x06B3, r13 ; 0x8006b3 19aae: e0 92 b4 06 sts 0x06B4, r14 ; 0x8006b4 19ab2: f0 92 b5 06 sts 0x06B5, r15 ; 0x8006b5 19ab6: cb 01 movw r24, r22 19ab8: b0 e0 ldi r27, 0x00 ; 0 19aba: a0 e0 ldi r26, 0x00 ; 0 if (xyzcal_dm&2) count_position[1] -= dy; else count_position[1] += dy; 19abc: c0 90 b6 06 lds r12, 0x06B6 ; 0x8006b6 19ac0: d0 90 b7 06 lds r13, 0x06B7 ; 0x8006b7 19ac4: e0 90 b8 06 lds r14, 0x06B8 ; 0x8006b8 19ac8: f0 90 b9 06 lds r15, 0x06B9 ; 0x8006b9 19acc: 21 ff sbrs r18, 1 19ace: 36 c0 rjmp .+108 ; 0x19b3c 19ad0: c8 1a sub r12, r24 19ad2: d9 0a sbc r13, r25 19ad4: ea 0a sbc r14, r26 19ad6: fb 0a sbc r15, r27 19ad8: c0 92 b6 06 sts 0x06B6, r12 ; 0x8006b6 19adc: d0 92 b7 06 sts 0x06B7, r13 ; 0x8006b7 19ae0: e0 92 b8 06 sts 0x06B8, r14 ; 0x8006b8 19ae4: f0 92 b9 06 sts 0x06B9, r15 ; 0x8006b9 19ae8: 70 e0 ldi r23, 0x00 ; 0 19aea: 60 e0 ldi r22, 0x00 ; 0 if (xyzcal_dm&4) count_position[2] -= dz; else count_position[2] += dz; 19aec: 80 91 ba 06 lds r24, 0x06BA ; 0x8006ba 19af0: 90 91 bb 06 lds r25, 0x06BB ; 0x8006bb 19af4: a0 91 bc 06 lds r26, 0x06BC ; 0x8006bc 19af8: b0 91 bd 06 lds r27, 0x06BD ; 0x8006bd 19afc: 22 ff sbrs r18, 2 19afe: 2b c0 rjmp .+86 ; 0x19b56 19b00: 84 1b sub r24, r20 19b02: 95 0b sbc r25, r21 19b04: a6 0b sbc r26, r22 19b06: b7 0b sbc r27, r23 19b08: 80 93 ba 06 sts 0x06BA, r24 ; 0x8006ba 19b0c: 90 93 bb 06 sts 0x06BB, r25 ; 0x8006bb 19b10: a0 93 bc 06 sts 0x06BC, r26 ; 0x8006bc 19b14: b0 93 bd 06 sts 0x06BD, r27 ; 0x8006bd // DBG(_n(" after xyzcal_update_pos x=%ld y=%ld z=%ld\n"), count_position[0], count_position[1], count_position[2]); } 19b18: ff 90 pop r15 19b1a: ef 90 pop r14 19b1c: df 90 pop r13 19b1e: cf 90 pop r12 19b20: 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; 19b22: 8c 0d add r24, r12 19b24: 9d 1d adc r25, r13 19b26: ae 1d adc r26, r14 19b28: bf 1d adc r27, r15 19b2a: 80 93 b2 06 sts 0x06B2, r24 ; 0x8006b2 19b2e: 90 93 b3 06 sts 0x06B3, r25 ; 0x8006b3 19b32: a0 93 b4 06 sts 0x06B4, r26 ; 0x8006b4 19b36: b0 93 b5 06 sts 0x06B5, r27 ; 0x8006b5 19b3a: bd cf rjmp .-134 ; 0x19ab6 if (xyzcal_dm&2) count_position[1] -= dy; else count_position[1] += dy; 19b3c: 8c 0d add r24, r12 19b3e: 9d 1d adc r25, r13 19b40: ae 1d adc r26, r14 19b42: bf 1d adc r27, r15 19b44: 80 93 b6 06 sts 0x06B6, r24 ; 0x8006b6 19b48: 90 93 b7 06 sts 0x06B7, r25 ; 0x8006b7 19b4c: a0 93 b8 06 sts 0x06B8, r26 ; 0x8006b8 19b50: b0 93 b9 06 sts 0x06B9, r27 ; 0x8006b9 19b54: c9 cf rjmp .-110 ; 0x19ae8 if (xyzcal_dm&4) count_position[2] -= dz; else count_position[2] += dz; 19b56: 84 0f add r24, r20 19b58: 95 1f adc r25, r21 19b5a: a6 1f adc r26, r22 19b5c: b7 1f adc r27, r23 19b5e: d4 cf rjmp .-88 ; 0x19b08 00019b60 : inline bool is_digit(char c) { return c >= '0' && c <= '9'; } char const * __attribute__((noinline)) Number(char const *str, uint16_t *v){ 19b60: fb 01 movw r30, r22 *v = 0; 19b62: 11 82 std Z+1, r1 ; 0x01 19b64: 10 82 st Z, r1 while(is_digit(*str)){ *v *= 10; 19b66: 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'; 19b68: dc 01 movw r26, r24 19b6a: 2c 91 ld r18, X 19b6c: 20 53 subi r18, 0x30 ; 48 } char const * __attribute__((noinline)) Number(char const *str, uint16_t *v){ *v = 0; while(is_digit(*str)){ 19b6e: 2a 30 cpi r18, 0x0A ; 10 19b70: a0 f4 brcc .+40 ; 0x19b9a *v *= 10; 19b72: 40 81 ld r20, Z 19b74: 51 81 ldd r21, Z+1 ; 0x01 19b76: 64 9f mul r22, r20 19b78: 90 01 movw r18, r0 19b7a: 65 9f mul r22, r21 19b7c: 30 0d add r19, r0 19b7e: 11 24 eor r1, r1 19b80: 31 83 std Z+1, r19 ; 0x01 19b82: 20 83 st Z, r18 *v += *str - '0'; 19b84: 4d 91 ld r20, X+ 19b86: cd 01 movw r24, r26 19b88: 20 53 subi r18, 0x30 ; 48 19b8a: 31 09 sbc r19, r1 19b8c: 24 0f add r18, r20 19b8e: 31 1d adc r19, r1 19b90: 47 fd sbrc r20, 7 19b92: 3a 95 dec r19 19b94: 31 83 std Z+1, r19 ; 0x01 19b96: 20 83 st Z, r18 19b98: e7 cf rjmp .-50 ; 0x19b68 ++str; } return str; } 19b9a: 08 95 ret 00019b9c : } #ifdef THERMAL_MODEL void lcd_thermal_model_cal() { lcd_commands_type = LcdCommands::ThermalModel; 19b9c: 85 e0 ldi r24, 0x05 ; 5 19b9e: 80 93 b3 0d sts 0x0DB3, r24 ; 0x800db3 lcd_return_to_status(); 19ba2: 0d 94 7c 1e jmp 0x23cf8 ; 0x23cf8 00019ba6 : 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) { 19ba6: fc 01 movw r30, r24 switch(*oCheckSetting) { 19ba8: 80 81 ld r24, Z 19baa: 88 23 and r24, r24 19bac: 21 f0 breq .+8 ; 0x19bb6 19bae: 81 30 cpi r24, 0x01 ; 1 19bb0: 29 f4 brne .+10 ; 0x19bbc case ClCheckMode::_None: *oCheckSetting = ClCheckMode::_Warn; break; case ClCheckMode::_Warn: *oCheckSetting = ClCheckMode::_Strict; 19bb2: 82 e0 ldi r24, 0x02 ; 2 19bb4: 01 c0 rjmp .+2 ; 0x19bb8 while (0) static void lcd_check_update_RAM(ClCheckMode * oCheckSetting) { switch(*oCheckSetting) { case ClCheckMode::_None: *oCheckSetting = ClCheckMode::_Warn; 19bb6: 81 e0 ldi r24, 0x01 ; 1 break; case ClCheckMode::_Warn: *oCheckSetting = ClCheckMode::_Strict; 19bb8: 80 83 st Z, r24 19bba: 08 95 ret break; case ClCheckMode::_Strict: *oCheckSetting = ClCheckMode::_None; 19bbc: 10 82 st Z, r1 break; default: *oCheckSetting = ClCheckMode::_None; } } 19bbe: 08 95 ret 00019bc0 : } //! @brief Send host action "start" void lcd_send_action_start() { SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_START); 19bc0: 82 e0 ldi r24, 0x02 ; 2 19bc2: 9c e6 ldi r25, 0x6C ; 108 19bc4: 0e 94 93 79 call 0xf326 ; 0xf326 lcd_return_to_status(); 19bc8: 0d 94 7c 1e jmp 0x23cf8 ; 0x23cf8 00019bcc : //! 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) { 19bcc: 80 91 b7 0d lds r24, 0x0DB7 ; 0x800db7 <_ZL13printer_state.lto_priv.401> 19bd0: 81 30 cpi r24, 0x01 ; 1 19bd2: 21 f4 brne .+8 ; 0x19bdc SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_NOT_READY); 19bd4: 81 e6 ldi r24, 0x61 ; 97 19bd6: 9b e6 ldi r25, 0x6B ; 107 } else { SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_READY); 19bd8: 0c 94 93 79 jmp 0xf326 ; 0xf326 19bdc: 82 e5 ldi r24, 0x52 ; 82 19bde: 9b e6 ldi r25, 0x6B ; 107 19be0: fb cf rjmp .-10 ; 0x19bd8 00019be2 : planner_synchronize(); Disable_E0(); } void MMU2::execute_load_to_nozzle_sequence() { 19be2: cf 93 push r28 19be4: df 93 push r29 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 19be6: 0f 94 a3 42 call 0x28546 ; 0x28546 float planner_get_current_position_E() { return current_position[E_AXIS]; } void planner_set_current_position_E(float e) { current_position[E_AXIS] = e; 19bea: c1 e9 ldi r28, 0x91 ; 145 19bec: d6 e0 ldi r29, 0x06 ; 6 planner_synchronize(); // Compensate for configurable Extra Loading Distance planner_set_current_position_E(planner_get_current_position_E() - (logic.ExtraLoadDistance() - MMU2_FILAMENT_SENSOR_POSITION)); 19bee: 60 91 96 13 lds r22, 0x1396 ; 0x801396 19bf2: 70 e0 ldi r23, 0x00 ; 0 19bf4: 90 e0 ldi r25, 0x00 ; 0 19bf6: 80 e0 ldi r24, 0x00 ; 0 19bf8: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 19bfc: 20 e0 ldi r18, 0x00 ; 0 19bfe: 30 e0 ldi r19, 0x00 ; 0 19c00: 40 e8 ldi r20, 0x80 ; 128 19c02: 51 e4 ldi r21, 0x41 ; 65 19c04: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 19c08: 9b 01 movw r18, r22 19c0a: ac 01 movw r20, r24 19c0c: 6c 85 ldd r22, Y+12 ; 0x0c 19c0e: 7d 85 ldd r23, Y+13 ; 0x0d 19c10: 8e 85 ldd r24, Y+14 ; 0x0e 19c12: 9f 85 ldd r25, Y+15 ; 0x0f 19c14: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 19c18: 6c 87 std Y+12, r22 ; 0x0c 19c1a: 7d 87 std Y+13, r23 ; 0x0d 19c1c: 8e 87 std Y+14, r24 ; 0x0e 19c1e: 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])); 19c20: 62 e0 ldi r22, 0x02 ; 2 19c22: 85 e3 ldi r24, 0x35 ; 53 19c24: 9f e8 ldi r25, 0x8F ; 143 } 19c26: df 91 pop r29 19c28: 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])); 19c2a: 0d 94 16 88 jmp 0x3102c ; 0x3102c 00019c2e : } } menu_item++; } void __attribute__((noinline)) menu_item_function_E(const Sheet &sheet, menu_func_t func) 19c2e: df 92 push r13 19c30: ef 92 push r14 19c32: ff 92 push r15 19c34: 0f 93 push r16 19c36: 1f 93 push r17 19c38: cf 93 push r28 19c3a: df 93 push r29 19c3c: cd b7 in r28, 0x3d ; 61 19c3e: de b7 in r29, 0x3e ; 62 19c40: 63 97 sbiw r28, 0x13 ; 19 19c42: 0f b6 in r0, 0x3f ; 63 19c44: f8 94 cli 19c46: de bf out 0x3e, r29 ; 62 19c48: 0f be out 0x3f, r0 ; 63 19c4a: cd bf out 0x3d, r28 ; 61 { if (menu_item == menu_line) 19c4c: 30 91 14 05 lds r19, 0x0514 ; 0x800514 19c50: 20 91 13 05 lds r18, 0x0513 ; 0x800513 19c54: 32 13 cpse r19, r18 19c56: 73 c0 rjmp .+230 ; 0x19d3e 19c58: 7c 01 movw r14, r24 { if (lcd_draw_update) menu_draw_item_select_sheet_E(' ', sheet); 19c5a: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 19c5e: 88 23 and r24, r24 19c60: 09 f4 brne .+2 ; 0x19c64 19c62: 45 c0 rjmp .+138 ; 0x19cee //! //! @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)); 19c64: 8d ec ldi r24, 0xCD ; 205 19c66: 9d e4 ldi r25, 0x4D ; 77 19c68: 0e 94 c4 72 call 0xe588 ; 0xe588 19c6c: 9f 93 push r25 19c6e: 8f 93 push r24 19c70: 8e ee ldi r24, 0xEE ; 238 19c72: 9e e8 ldi r25, 0x8E ; 142 19c74: 9f 93 push r25 19c76: 8f 93 push r24 19c78: 8e 01 movw r16, r28 19c7a: 0f 5f subi r16, 0xFF ; 255 19c7c: 1f 4f sbci r17, 0xFF ; 255 19c7e: 1f 93 push r17 19c80: 0f 93 push r16 19c82: 0f 94 ee da call 0x3b5dc ; 0x3b5dc 19c86: d8 2e mov r13, r24 eeprom_read_block(&(buffer.c[index]), sheet_E.name, sizeof(sheet_E.name)/sizeof(sheet_E.name[0])); 19c88: 47 e0 ldi r20, 0x07 ; 7 19c8a: 50 e0 ldi r21, 0x00 ; 0 19c8c: b7 01 movw r22, r14 19c8e: 80 0f add r24, r16 19c90: 91 2f mov r25, r17 19c92: 91 1d adc r25, r1 19c94: 0f 94 c7 db call 0x3b78e ; 0x3b78e 19c98: 0f 90 pop r0 19c9a: 0f 90 pop r0 19c9c: 0f 90 pop r0 19c9e: 0f 90 pop r0 19ca0: 0f 90 pop r0 19ca2: 0f 90 pop r0 19ca4: 20 e0 ldi r18, 0x00 ; 0 19ca6: 82 2f mov r24, r18 19ca8: 8d 0d add r24, r13 19caa: 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) 19cac: 27 30 cpi r18, 0x07 ; 7 19cae: 39 f0 breq .+14 ; 0x19cbe 19cb0: 2f 5f subi r18, 0xFF ; 255 { if (buffer.c[index] == '\0') break; 19cb2: f8 01 movw r30, r16 19cb4: e8 0f add r30, r24 19cb6: f9 1f adc r31, r25 19cb8: 30 81 ld r19, Z 19cba: 31 11 cpse r19, r1 19cbc: f4 cf rjmp .-24 ; 0x19ca6 } buffer.c[index] = ']'; 19cbe: f8 01 movw r30, r16 19cc0: e8 0f add r30, r24 19cc2: f9 1f adc r31, r25 19cc4: 2d e5 ldi r18, 0x5D ; 93 19cc6: 20 83 st Z, r18 buffer.c[index + 1] = '\0'; 19cc8: 8c 0f add r24, r28 19cca: 9d 1f adc r25, r29 19ccc: fc 01 movw r30, r24 19cce: 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()); 19cd0: 0f 94 13 d0 call 0x3a026 ; 0x3a026 19cd4: 48 2f mov r20, r24 19cd6: 60 91 11 05 lds r22, 0x0511 ; 0x800511 19cda: 80 e0 ldi r24, 0x00 ; 0 19cdc: 0e 94 18 6f call 0xde30 ; 0xde30 lcd_print_pad(buffer.c, LCD_WIDTH - 2); 19ce0: 62 e1 ldi r22, 0x12 ; 18 19ce2: c8 01 movw r24, r16 19ce4: 0e 94 e7 70 call 0xe1ce ; 0xe1ce lcd_putc(type_char); 19ce8: 80 e2 ldi r24, 0x20 ; 32 19cea: 0e 94 e7 6e call 0xddce ; 0xddce 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)) 19cee: 80 91 12 05 lds r24, 0x0512 ; 0x800512 19cf2: 88 23 and r24, r24 19cf4: 21 f1 breq .+72 ; 0x19d3e 19cf6: 20 91 14 05 lds r18, 0x0514 ; 0x800514 19cfa: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 19cfe: 90 91 70 06 lds r25, 0x0670 ; 0x800670 19d02: 28 17 cp r18, r24 19d04: 19 06 cpc r1, r25 19d06: d9 f4 brne .+54 ; 0x19d3e { lcd_update_enabled = 0; 19d08: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e if (func) func(); 19d0c: 8b e7 ldi r24, 0x7B ; 123 19d0e: 96 e7 ldi r25, 0x76 ; 118 19d10: 89 2b or r24, r25 19d12: 11 f0 breq .+4 ; 0x19d18 19d14: 0e 94 7b 76 call 0xecf6 ; 0xecf6 lcd_update_enabled = 1; 19d18: 81 e0 ldi r24, 0x01 ; 1 19d1a: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e menu_item_ret(); 19d1e: 0f 94 37 d0 call 0x3a06e ; 0x3a06e return; } } menu_item++; } 19d22: 63 96 adiw r28, 0x13 ; 19 19d24: 0f b6 in r0, 0x3f ; 63 19d26: f8 94 cli 19d28: de bf out 0x3e, r29 ; 62 19d2a: 0f be out 0x3f, r0 ; 63 19d2c: cd bf out 0x3d, r28 ; 61 19d2e: df 91 pop r29 19d30: cf 91 pop r28 19d32: 1f 91 pop r17 19d34: 0f 91 pop r16 19d36: ff 90 pop r15 19d38: ef 90 pop r14 19d3a: df 90 pop r13 19d3c: 08 95 ret lcd_update_enabled = 1; menu_item_ret(); return; } } menu_item++; 19d3e: 80 91 14 05 lds r24, 0x0514 ; 0x800514 19d42: 8f 5f subi r24, 0xFF ; 255 19d44: 80 93 14 05 sts 0x0514, r24 ; 0x800514 19d48: ec cf rjmp .-40 ; 0x19d22 00019d4a : lcd_return_to_status(); } void lcd_mesh_calibration() { enquecommand_P(PSTR("M45")); 19d4a: 61 e0 ldi r22, 0x01 ; 1 19d4c: 8c ef ldi r24, 0xFC ; 252 19d4e: 99 e8 ldi r25, 0x89 ; 137 19d50: 0e 94 38 88 call 0x11070 ; 0x11070 lcd_return_to_status(); 19d54: 0d 94 7c 1e jmp 0x23cf8 ; 0x23cf8 00019d58 : } void lcd_mesh_calibration_z() { enquecommand_P(PSTR("M45 Z")); 19d58: 61 e0 ldi r22, 0x01 ; 1 19d5a: 80 e0 ldi r24, 0x00 ; 0 19d5c: 9a e8 ldi r25, 0x8A ; 138 19d5e: 0e 94 38 88 call 0x11070 ; 0x11070 lcd_return_to_status(); 19d62: 0d 94 7c 1e jmp 0x23cf8 ; 0x23cf8 00019d66 : } #endif //(LANG_MODE != 0) void lcd_mesh_bedleveling() { enquecommand_P(PSTR("G80")); 19d66: 61 e0 ldi r22, 0x01 ; 1 19d68: 88 ef ldi r24, 0xF8 ; 248 19d6a: 99 e8 ldi r25, 0x89 ; 137 19d6c: 0e 94 38 88 call 0x11070 ; 0x11070 lcd_return_to_status(); 19d70: 0d 94 7c 1e jmp 0x23cf8 ; 0x23cf8 00019d74 : MYSERIAL.begin(BAUDRATE); } #endif //HAS_SECOND_SERIAL_PORT void lcd_calibrate_pinda() { enquecommand_P(PSTR("G76")); 19d74: 61 e0 ldi r22, 0x01 ; 1 19d76: 86 e0 ldi r24, 0x06 ; 6 19d78: 9a e8 ldi r25, 0x8A ; 138 19d7a: 0e 94 38 88 call 0x11070 ; 0x11070 lcd_return_to_status(); 19d7e: 0d 94 7c 1e jmp 0x23cf8 ; 0x23cf8 00019d82 : } static void nozzle_change() { #ifdef FILAMENT_SENSOR if (fsensor.isEnabled() && fsensor.getFilamentPresent()) { 19d82: 80 91 a9 17 lds r24, 0x17A9 ; 0x8017a9 19d86: 88 23 and r24, r24 19d88: 61 f0 breq .+24 ; 0x19da2 19d8a: 80 91 b6 17 lds r24, 0x17B6 ; 0x8017b6 19d8e: 88 23 and r24, r24 19d90: 41 f0 breq .+16 ; 0x19da2 lcd_show_fullscreen_message_and_wait_P(_T(MSG_UNLOAD_FILAMENT_REPEAT)); 19d92: 89 e1 ldi r24, 0x19 ; 25 19d94: 94 e4 ldi r25, 0x44 ; 68 19d96: 0e 94 c4 72 call 0xe588 ; 0xe588 19d9a: 0f 94 c7 1f call 0x23f8e ; 0x23f8e lcd_return_to_status(); return; } #endif //FILAMENT_SENSOR lcd_commands_type = LcdCommands::NozzleCNG; lcd_return_to_status(); 19d9e: 0d 94 7c 1e jmp 0x23cf8 ; 0x23cf8 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; 19da2: 86 e0 ldi r24, 0x06 ; 6 19da4: 80 93 b3 0d sts 0x0DB3, r24 ; 0x800db3 19da8: fa cf rjmp .-12 ; 0x19d9e 00019daa : // When MMU is disabled P parameter is ignored enquecommand_P(PSTR("M701 P0")); } static void wizard_lay1cal_message(bool cold) { 19daa: cf 93 push r28 19dac: c8 2f mov r28, r24 lcd_show_fullscreen_message_and_wait_P( 19dae: 8d e1 ldi r24, 0x1D ; 29 19db0: 9e e3 ldi r25, 0x3E ; 62 19db2: 0e 94 c4 72 call 0xe588 ; 0xe588 19db6: 0f 94 c7 1f call 0x23f8e ; 0x23f8e _T(MSG_WIZARD_V2_CAL)); if (MMU2::mmu2.Enabled()) 19dba: 80 91 b9 13 lds r24, 0x13B9 ; 0x8013b9 19dbe: 81 30 cpi r24, 0x01 ; 1 19dc0: 69 f4 brne .+26 ; 0x19ddc { lcd_show_fullscreen_message_and_wait_P( 19dc2: 84 ec ldi r24, 0xC4 ; 196 19dc4: 9d e3 ldi r25, 0x3D ; 61 _T(MSG_SELECT_FIL_1ST_LAYERCAL)); } else if (cold) { lcd_show_fullscreen_message_and_wait_P( 19dc6: 0e 94 c4 72 call 0xe588 ; 0xe588 19dca: 0f 94 c7 1f call 0x23f8e ; 0x23f8e _T(MSG_SELECT_TEMP_MATCHES_MATERIAL)); } lcd_show_fullscreen_message_and_wait_P( 19dce: 82 ef ldi r24, 0xF2 ; 242 19dd0: 9c e3 ldi r25, 0x3C ; 60 19dd2: 0e 94 c4 72 call 0xe588 ; 0xe588 _T(MSG_WIZARD_V2_CAL_2)); } 19dd6: 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( 19dd8: 0d 94 c7 1f jmp 0x23f8e ; 0x23f8e if (MMU2::mmu2.Enabled()) { lcd_show_fullscreen_message_and_wait_P( _T(MSG_SELECT_FIL_1ST_LAYERCAL)); } else if (cold) 19ddc: cc 23 and r28, r28 19dde: b9 f3 breq .-18 ; 0x19dce { lcd_show_fullscreen_message_and_wait_P( 19de0: 82 e9 ldi r24, 0x92 ; 146 19de2: 9d e3 ldi r25, 0x3D ; 61 19de4: f0 cf rjmp .-32 ; 0x19dc6 00019de6 : } } static void lcd_wizard_load() { if (MMU2::mmu2.Enabled()) { 19de6: 80 91 b9 13 lds r24, 0x13B9 ; 0x8013b9 19dea: 81 30 cpi r24, 0x01 ; 1 19dec: 71 f4 brne .+28 ; 0x19e0a lcd_show_fullscreen_message_and_wait_P( 19dee: 89 e9 ldi r24, 0x99 ; 153 19df0: 9c e3 ldi r25, 0x3C ; 60 19df2: 0e 94 c4 72 call 0xe588 ; 0xe588 19df6: 0f 94 c7 1f call 0x23f8e ; 0x23f8e _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; 19dfa: 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; 19dfc: 80 93 a5 03 sts 0x03A5, r24 ; 0x8003a5 } // When MMU is disabled P parameter is ignored enquecommand_P(PSTR("M701 P0")); 19e00: 61 e0 ldi r22, 0x01 ; 1 19e02: 8a e0 ldi r24, 0x0A ; 10 19e04: 9a e8 ldi r25, 0x8A ; 138 19e06: 0c 94 38 88 jmp 0x11070 ; 0x11070 // 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( 19e0a: 8d e4 ldi r24, 0x4D ; 77 19e0c: 9c e3 ldi r25, 0x3C ; 60 19e0e: 0e 94 c4 72 call 0xe588 ; 0xe588 19e12: 0f 94 c7 1f call 0x23f8e ; 0x23f8e _T(MSG_WIZARD_LOAD_FILAMENT)); lcd_update_enable(false); 19e16: 80 e0 ldi r24, 0x00 ; 0 19e18: 0e 94 3d 6f call 0xde7a ; 0xde7a lcd_clear(); 19e1c: 0e 94 2b 6f call 0xde56 ; 0xde56 lcd_puts_at_P(0, 2, _T(MSG_LOADING_FILAMENT)); 19e20: 81 e7 ldi r24, 0x71 ; 113 19e22: 9c e5 ldi r25, 0x5C ; 92 19e24: 0e 94 c4 72 call 0xe588 ; 0xe588 19e28: ac 01 movw r20, r24 19e2a: 62 e0 ldi r22, 0x02 ; 2 19e2c: 80 e0 ldi r24, 0x00 ; 0 19e2e: 0e 94 0c 6f call 0xde18 ; 0xde18 eFilamentAction = FilamentAction::Load; 19e32: 81 e0 ldi r24, 0x01 ; 1 19e34: e3 cf rjmp .-58 ; 0x19dfc 00019e36 : #endif // TMC2130 #ifdef FILAMENT_SENSOR static void fsensor_reinit() { fsensor.init(); 19e36: 0d 94 f4 7a jmp 0x2f5e8 ; 0x2f5e8 00019e3a : bool __attribute__((noinline)) Tag(const char *str, const char *tag_P, uint8_t tagSize, uint16_t tagMask, uint16_t *v){ 19e3a: cf 92 push r12 19e3c: df 92 push r13 19e3e: ef 92 push r14 19e40: ff 92 push r15 19e42: 0f 93 push r16 19e44: 1f 93 push r17 19e46: cf 93 push r28 19e48: df 93 push r29 19e4a: 6c 01 movw r12, r24 19e4c: 79 01 movw r14, r18 if( ! strncmp_P(str, tag_P, tagSize) ){ 19e4e: c4 2f mov r28, r20 19e50: d0 e0 ldi r29, 0x00 ; 0 19e52: ae 01 movw r20, r28 19e54: 0f 94 b6 d9 call 0x3b36c ; 0x3b36c 19e58: 89 2b or r24, r25 19e5a: b9 f4 brne .+46 ; 0x19e8a Number(str + tagSize, v); 19e5c: b8 01 movw r22, r16 19e5e: c6 01 movw r24, r12 19e60: 8c 0f add r24, r28 19e62: 9d 1f adc r25, r29 19e64: 0e 94 b0 cd call 0x19b60 ; 0x19b60 *v |= tagMask; 19e68: f8 01 movw r30, r16 19e6a: 20 81 ld r18, Z 19e6c: 31 81 ldd r19, Z+1 ; 0x01 19e6e: 2e 29 or r18, r14 19e70: 3f 29 or r19, r15 19e72: 31 83 std Z+1, r19 ; 0x01 19e74: 20 83 st Z, r18 return true; 19e76: 81 e0 ldi r24, 0x01 ; 1 } return false; } 19e78: df 91 pop r29 19e7a: cf 91 pop r28 19e7c: 1f 91 pop r17 19e7e: 0f 91 pop r16 19e80: ff 90 pop r15 19e82: ef 90 pop r14 19e84: df 90 pop r13 19e86: cf 90 pop r12 19e88: 08 95 ret if( ! strncmp_P(str, tag_P, tagSize) ){ Number(str + tagSize, v); *v |= tagMask; return true; } return false; 19e8a: 80 e0 ldi r24, 0x00 ; 0 19e8c: f5 cf rjmp .-22 ; 0x19e78 00019e8e : } #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); 19e8e: 87 ea ldi r24, 0xA7 ; 167 19e90: 9c e0 ldi r25, 0x0C ; 12 19e92: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae if (value > 1) value = 1; 19e96: 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) 19e98: 82 30 cpi r24, 0x02 ; 2 19e9a: 08 f4 brcc .+2 ; 0x19e9e 19e9c: 68 27 eor r22, r24 19e9e: 87 ea ldi r24, 0xA7 ; 167 19ea0: 9c e0 ldi r25, 0x0C ; 12 19ea2: 0d 94 fb db jmp 0x3b7f6 ; 0x3b7f6 00019ea6 : bool FarmOrUserECool(){ return farm_mode || UserECoolEnabled(); } #ifdef PRUSA_SN_SUPPORT void WorkaroundPrusaSN() { 19ea6: cf 93 push r28 19ea8: df 93 push r29 19eaa: c5 e1 ldi r28, 0x15 ; 21 19eac: dd e0 ldi r29, 0x0D ; 13 const char *SN = PSTR("CZPXInvalidSerialNr"); for (uint8_t i = 0; i < 20; i++) { eeprom_update_byte_notify((uint8_t*)EEPROM_PRUSA_SN + i, pgm_read_byte(SN++)); 19eae: fe 01 movw r30, r28 19eb0: e8 54 subi r30, 0x48 ; 72 19eb2: f2 48 sbci r31, 0x82 ; 130 19eb4: 64 91 lpm r22, Z 19eb6: ce 01 movw r24, r28 19eb8: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 19ebc: 21 96 adiw r28, 0x01 ; 1 } #ifdef PRUSA_SN_SUPPORT void WorkaroundPrusaSN() { const char *SN = PSTR("CZPXInvalidSerialNr"); for (uint8_t i = 0; i < 20; i++) { 19ebe: c9 32 cpi r28, 0x29 ; 41 19ec0: 8d e0 ldi r24, 0x0D ; 13 19ec2: d8 07 cpc r29, r24 19ec4: a1 f7 brne .-24 ; 0x19eae eeprom_update_byte_notify((uint8_t*)EEPROM_PRUSA_SN + i, pgm_read_byte(SN++)); } } 19ec6: df 91 pop r29 19ec8: cf 91 pop r28 19eca: 08 95 ret 00019ecc : 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); 19ecc: 8a ea ldi r24, 0xAA ; 170 19ece: 9d e0 ldi r25, 0x0D ; 13 19ed0: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae switch (mbl_z_probe_nr) { case 1: mbl_z_probe_nr = 3; break; case 3: mbl_z_probe_nr = 5; break; 19ed4: 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) { 19ed6: 83 30 cpi r24, 0x03 ; 3 19ed8: 21 f0 breq .+8 ; 0x19ee2 case 1: mbl_z_probe_nr = 3; break; case 3: mbl_z_probe_nr = 5; break; case 5: mbl_z_probe_nr = 1; break; 19eda: 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) { 19edc: 85 30 cpi r24, 0x05 ; 5 19ede: 09 f0 breq .+2 ; 0x19ee2 case 1: mbl_z_probe_nr = 3; break; 19ee0: 63 e0 ldi r22, 0x03 ; 3 19ee2: 8a ea ldi r24, 0xAA ; 170 19ee4: 9d e0 ldi r25, 0x0D ; 13 19ee6: 0d 94 fb db jmp 0x3b7f6 ; 0x3b7f6 00019eea : 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); 19eea: 8b ea ldi r24, 0xAB ; 171 19eec: 9d e0 ldi r25, 0x0D ; 13 19eee: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae if(mesh_nr == 3) mesh_nr = 7; else mesh_nr = 3; 19ef2: 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; 19ef4: 83 30 cpi r24, 0x03 ; 3 19ef6: 09 f4 brne .+2 ; 0x19efa 19ef8: 67 e0 ldi r22, 0x07 ; 7 19efa: 8b ea ldi r24, 0xAB ; 171 19efc: 9d e0 ldi r25, 0x0D ; 13 19efe: 0d 94 fb db jmp 0x3b7f6 ; 0x3b7f6 00019f02 : #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); 19f02: 8c ea ldi r24, 0xAC ; 172 19f04: 9d e0 ldi r25, 0x0D ; 13 19f06: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae magnet_elimination = !magnet_elimination; 19f0a: 61 e0 ldi r22, 0x01 ; 1 19f0c: 81 11 cpse r24, r1 19f0e: 60 e0 ldi r22, 0x00 ; 0 19f10: 8c ea ldi r24, 0xAC ; 172 19f12: 9d e0 ldi r25, 0x0D ; 13 19f14: 0d 94 fb db jmp 0x3b7f6 ; 0x3b7f6 00019f18 : 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); 19f18: 86 ee ldi r24, 0xE6 ; 230 19f1a: 94 e0 ldi r25, 0x04 ; 4 19f1c: 0e 94 d3 cd call 0x19ba6 ; 0x19ba6 19f20: 60 91 e6 04 lds r22, 0x04E6 ; 0x8004e6 19f24: 80 e2 ldi r24, 0x20 ; 32 19f26: 9c e0 ldi r25, 0x0C ; 12 19f28: 0d 94 fb db jmp 0x3b7f6 ; 0x3b7f6 00019f2c : 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); 19f2c: 88 ee ldi r24, 0xE8 ; 232 19f2e: 94 e0 ldi r25, 0x04 ; 4 19f30: 0e 94 d3 cd call 0x19ba6 ; 0x19ba6 19f34: 60 91 e8 04 lds r22, 0x04E8 ; 0x8004e8 19f38: 83 ea ldi r24, 0xA3 ; 163 19f3a: 9d e0 ldi r25, 0x0D ; 13 19f3c: 0d 94 fb db jmp 0x3b7f6 ; 0x3b7f6 00019f40 : 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); 19f40: 89 ee ldi r24, 0xE9 ; 233 19f42: 94 e0 ldi r25, 0x04 ; 4 19f44: 0e 94 d3 cd call 0x19ba6 ; 0x19ba6 19f48: 60 91 e9 04 lds r22, 0x04E9 ; 0x8004e9 19f4c: 84 ea ldi r24, 0xA4 ; 164 19f4e: 9d e0 ldi r25, 0x0D ; 13 19f50: 0d 94 fb db jmp 0x3b7f6 ; 0x3b7f6 00019f54 : *oCheckSetting = ClCheckMode::_None; } } static void lcd_check_mode_set() { lcd_check_update_RAM(&oCheckMode); 19f54: 8b ee ldi r24, 0xEB ; 235 19f56: 94 e0 ldi r25, 0x04 ; 4 19f58: 0e 94 d3 cd call 0x19ba6 ; 0x19ba6 19f5c: 60 91 eb 04 lds r22, 0x04EB ; 0x8004eb 19f60: 88 ea ldi r24, 0xA8 ; 168 19f62: 9d e0 ldi r25, 0x0D ; 13 19f64: 0d 94 fb db jmp 0x3b7f6 ; 0x3b7f6 00019f68 : #endif //FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125 static void lcd_fsensor_actionNA_set(void) { Filament_sensor::SensorActionOnError act = fsensor.getActionOnError(); switch(act) { 19f68: 80 91 b1 17 lds r24, 0x17B1 ; 0x8017b1 case Filament_sensor::SensorActionOnError::_Continue: act = Filament_sensor::SensorActionOnError::_Pause; break; case Filament_sensor::SensorActionOnError::_Pause: act = Filament_sensor::SensorActionOnError::_Continue; 19f6c: 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) { 19f6e: 81 11 cpse r24, r1 19f70: 01 c0 rjmp .+2 ; 0x19f74 case Filament_sensor::SensorActionOnError::_Continue: act = Filament_sensor::SensorActionOnError::_Pause; 19f72: 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; 19f74: 60 93 b1 17 sts 0x17B1, r22 ; 0x8017b1 19f78: 87 e4 ldi r24, 0x47 ; 71 19f7a: 9d e0 ldi r25, 0x0D ; 13 19f7c: 0d 94 fb db jmp 0x3b7f6 ; 0x3b7f6 00019f80 : static void lcd_fsensor_runout_set() { fsensor.setRunoutEnabled(!fsensor.getRunoutEnabled(), true); } static void lcd_fsensor_autoload_set() { fsensor.setAutoLoadEnabled(!fsensor.getAutoLoadEnabled(), true); 19f80: e9 ea ldi r30, 0xA9 ; 169 19f82: f7 e1 ldi r31, 0x17 ; 23 19f84: 61 81 ldd r22, Z+1 ; 0x01 19f86: 81 e0 ldi r24, 0x01 ; 1 19f88: 68 27 eor r22, r24 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 19f8a: 61 83 std Z+1, r22 ; 0x01 19f8c: 87 e0 ldi r24, 0x07 ; 7 19f8e: 9f e0 ldi r25, 0x0F ; 15 19f90: 0d 94 fb db jmp 0x3b7f6 ; 0x3b7f6 00019f94 : static void lcd_fsensor_enabled_set(void) { fsensor.setEnabled(!fsensor.isEnabled()); } static void lcd_fsensor_runout_set() { fsensor.setRunoutEnabled(!fsensor.getRunoutEnabled(), true); 19f94: e9 ea ldi r30, 0xA9 ; 169 19f96: f7 e1 ldi r31, 0x17 ; 23 19f98: 62 81 ldd r22, Z+2 ; 0x02 19f9a: 81 e0 ldi r24, 0x01 ; 1 19f9c: 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; 19f9e: 62 83 std Z+2, r22 ; 0x02 19fa0: 85 ed ldi r24, 0xD5 ; 213 19fa2: 9e e0 ldi r25, 0x0E ; 14 19fa4: 0d 94 fb db jmp 0x3b7f6 ; 0x3b7f6 00019fa8 : lcd_return_to_status(); } void lcd_toshiba_flash_air_compatibility_toggle() { card.ToshibaFlashAir_enable(! card.ToshibaFlashAir_isEnabled()); 19fa8: e0 e0 ldi r30, 0x00 ; 0 19faa: f7 e1 ldi r31, 0x17 ; 23 19fac: 60 81 ld r22, Z 19fae: 81 e0 ldi r24, 0x01 ; 1 19fb0: 68 27 eor r22, r24 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; } 19fb2: 60 83 st Z, r22 19fb4: 8b eb ldi r24, 0xBB ; 187 19fb6: 9f e0 ldi r25, 0x0F ; 15 19fb8: 0d 94 fb db jmp 0x3b7f6 ; 0x3b7f6 00019fbc : eeprom_update_byte_notify((unsigned char *)EEPROM_TEMP_CAL_ACTIVE, temp_cal_active); } #ifdef HAS_SECOND_SERIAL_PORT void lcd_second_serial_set() { if(selectedSerialPort == 1) selectedSerialPort = 0; 19fbc: 80 91 38 05 lds r24, 0x0538 ; 0x800538 19fc0: 81 30 cpi r24, 0x01 ; 1 19fc2: 51 f4 brne .+20 ; 0x19fd8 19fc4: 10 92 38 05 sts 0x0538, r1 ; 0x800538 19fc8: 60 91 38 05 lds r22, 0x0538 ; 0x800538 19fcc: 88 e0 ldi r24, 0x08 ; 8 19fce: 9f e0 ldi r25, 0x0F ; 15 19fd0: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 else selectedSerialPort = 1; eeprom_update_byte_notify((unsigned char *)EEPROM_SECOND_SERIAL_ACTIVE, selectedSerialPort); MYSERIAL.begin(BAUDRATE); 19fd4: 0c 94 9c cc jmp 0x19938 ; 0x19938 } #ifdef HAS_SECOND_SERIAL_PORT void lcd_second_serial_set() { if(selectedSerialPort == 1) selectedSerialPort = 0; else selectedSerialPort = 1; 19fd8: 81 e0 ldi r24, 0x01 ; 1 19fda: 80 93 38 05 sts 0x0538, r24 ; 0x800538 19fde: f4 cf rjmp .-24 ; 0x19fc8 00019fe0 : 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); 19fe0: 8f ea ldi r24, 0xAF ; 175 19fe2: 9f e0 ldi r25, 0x0F ; 15 19fe4: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae temp_cal_active = !temp_cal_active; 19fe8: 61 e0 ldi r22, 0x01 ; 1 19fea: 81 11 cpse r24, r1 19fec: 60 e0 ldi r22, 0x00 ; 0 19fee: 8f ea ldi r24, 0xAF ; 175 19ff0: 9f e0 ldi r25, 0x0F ; 15 19ff2: 0d 94 fb db jmp 0x3b7f6 ; 0x3b7f6 00019ff6 : eeprom_update_byte_notify((uint8_t*)EEPROM_SOUND_MODE,(uint8_t)eSoundMode); } void Sound_CycleState(void) { switch(eSoundMode) 19ff6: 80 91 dd 04 lds r24, 0x04DD ; 0x8004dd 19ffa: 81 30 cpi r24, 0x01 ; 1 19ffc: 71 f0 breq .+28 ; 0x1a01a 19ffe: 20 f0 brcs .+8 ; 0x1a008 1a000: 82 30 cpi r24, 0x02 ; 2 1a002: 69 f4 brne .+26 ; 0x1a01e break; case e_SOUND_MODE_ONCE: eSoundMode=e_SOUND_MODE_SILENT; break; case e_SOUND_MODE_SILENT: eSoundMode=e_SOUND_MODE_BLIND; 1a004: 83 e0 ldi r24, 0x03 ; 3 1a006: 01 c0 rjmp .+2 ; 0x1a00a void Sound_CycleState(void) { switch(eSoundMode) { case e_SOUND_MODE_LOUD: eSoundMode=e_SOUND_MODE_ONCE; 1a008: 81 e0 ldi r24, 0x01 ; 1 break; case e_SOUND_MODE_ONCE: eSoundMode=e_SOUND_MODE_SILENT; 1a00a: 80 93 dd 04 sts 0x04DD, r24 ; 0x8004dd 1a00e: 60 91 dd 04 lds r22, 0x04DD ; 0x8004dd 1a012: 87 ed ldi r24, 0xD7 ; 215 1a014: 9e e0 ldi r25, 0x0E ; 14 1a016: 0d 94 fb db jmp 0x3b7f6 ; 0x3b7f6 1a01a: 82 e0 ldi r24, 0x02 ; 2 1a01c: f6 cf rjmp .-20 ; 0x1a00a break; case e_SOUND_MODE_SILENT: eSoundMode=e_SOUND_MODE_BLIND; break; case e_SOUND_MODE_BLIND: eSoundMode=e_SOUND_MODE_LOUD; 1a01e: 10 92 dd 04 sts 0x04DD, r1 ; 0x8004dd 1a022: f5 cf rjmp .-22 ; 0x1a00e 0001a024 : } #ifdef SDCARD_SORT_ALPHA static void lcd_sort_type_set() { uint8_t sdSort; sdSort = eeprom_read_byte((uint8_t*) EEPROM_SD_SORT); 1a024: 89 e0 ldi r24, 0x09 ; 9 1a026: 9f e0 ldi r25, 0x0F ; 15 1a028: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae switch (sdSort) { case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; 1a02c: 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) { 1a02e: 88 23 and r24, r24 1a030: 21 f0 breq .+8 ; 0x1a03a case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; case SD_SORT_ALPHA: sdSort = SD_SORT_NONE; break; 1a032: 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) { 1a034: 81 30 cpi r24, 0x01 ; 1 1a036: 09 f0 breq .+2 ; 0x1a03a case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; case SD_SORT_ALPHA: sdSort = SD_SORT_NONE; break; default: sdSort = SD_SORT_TIME; 1a038: 60 e0 ldi r22, 0x00 ; 0 1a03a: 89 e0 ldi r24, 0x09 ; 9 1a03c: 9f e0 ldi r25, 0x0F ; 15 1a03e: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 } eeprom_update_byte_notify((uint8_t*)EEPROM_SD_SORT, sdSort); card.presort_flag = true; 1a042: 81 e0 ldi r24, 0x01 ; 1 1a044: 80 93 de 14 sts 0x14DE, r24 ; 0x8014de } 1a048: 08 95 ret 0001a04a : MENU_ITEM_TOGGLE_P(_T(MSG_SOUND), _T(MSG_SOUND_LOUD), lcd_sound_state_set);\ }\ }\ while (0) static void lcd_nozzle_diameter_cycle(void) { 1a04a: cf 93 push r28 1a04c: df 93 push r29 uint16_t nDiameter; switch(oNozzleDiameter){ 1a04e: 80 91 ea 04 lds r24, 0x04EA ; 0x8004ea 1a052: 8c 33 cpi r24, 0x3C ; 60 1a054: e1 f0 breq .+56 ; 0x1a08e 1a056: 80 35 cpi r24, 0x50 ; 80 1a058: 01 f1 breq .+64 ; 0x1a09a 1a05a: 88 32 cpi r24, 0x28 ; 40 1a05c: 91 f0 breq .+36 ; 0x1a082 case ClNozzleDiameter::_Diameter_250: oNozzleDiameter=ClNozzleDiameter::_Diameter_400; 1a05e: 88 e2 ldi r24, 0x28 ; 40 1a060: 80 93 ea 04 sts 0x04EA, r24 ; 0x8004ea nDiameter=400; 1a064: c0 e9 ldi r28, 0x90 ; 144 1a066: d1 e0 ldi r29, 0x01 ; 1 1a068: 60 91 ea 04 lds r22, 0x04EA ; 0x8004ea 1a06c: 87 ea ldi r24, 0xA7 ; 167 1a06e: 9d e0 ldi r25, 0x0D ; 13 1a070: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 1a074: be 01 movw r22, r28 1a076: 85 ea ldi r24, 0xA5 ; 165 1a078: 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); } 1a07a: df 91 pop r29 1a07c: cf 91 pop r28 1a07e: 0d 94 19 dc jmp 0x3b832 ; 0x3b832 case ClNozzleDiameter::_Diameter_250: oNozzleDiameter=ClNozzleDiameter::_Diameter_400; nDiameter=400; break; case ClNozzleDiameter::_Diameter_400: oNozzleDiameter=ClNozzleDiameter::_Diameter_600; 1a082: 8c e3 ldi r24, 0x3C ; 60 1a084: 80 93 ea 04 sts 0x04EA, r24 ; 0x8004ea nDiameter=600; 1a088: c8 e5 ldi r28, 0x58 ; 88 1a08a: d2 e0 ldi r29, 0x02 ; 2 1a08c: ed cf rjmp .-38 ; 0x1a068 break; case ClNozzleDiameter::_Diameter_600: oNozzleDiameter=ClNozzleDiameter::_Diameter_800; 1a08e: 80 e5 ldi r24, 0x50 ; 80 1a090: 80 93 ea 04 sts 0x04EA, r24 ; 0x8004ea nDiameter=800; 1a094: c0 e2 ldi r28, 0x20 ; 32 1a096: d3 e0 ldi r29, 0x03 ; 3 1a098: e7 cf rjmp .-50 ; 0x1a068 break; case ClNozzleDiameter::_Diameter_800: oNozzleDiameter=ClNozzleDiameter::_Diameter_250; 1a09a: 89 e1 ldi r24, 0x19 ; 25 1a09c: 80 93 ea 04 sts 0x04EA, r24 ; 0x8004ea nDiameter=250; 1a0a0: ca ef ldi r28, 0xFA ; 250 1a0a2: d0 e0 ldi r29, 0x00 ; 0 1a0a4: e1 cf rjmp .-62 ; 0x1a068 0001a0a6 : } return 0; } bool eeprom_fw_version_older_than_p(const uint16_t (&ver_req)[4]) { 1a0a6: 0f 93 push r16 1a0a8: 1f 93 push r17 1a0aa: cf 93 push r28 1a0ac: df 93 push r29 1a0ae: 00 d0 rcall .+0 ; 0x1a0b0 1a0b0: 00 d0 rcall .+0 ; 0x1a0b2 1a0b2: 1f 92 push r1 1a0b4: 1f 92 push r1 1a0b6: cd b7 in r28, 0x3d ; 61 1a0b8: de b7 in r29, 0x3e ; 62 1a0ba: 8c 01 movw r16, r24 uint16_t ver_eeprom[4]; ver_eeprom[0] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MAJOR); 1a0bc: 8a e0 ldi r24, 0x0A ; 10 1a0be: 90 e0 ldi r25, 0x00 ; 0 1a0c0: 0f 94 e5 db call 0x3b7ca ; 0x3b7ca 1a0c4: 9a 83 std Y+2, r25 ; 0x02 1a0c6: 89 83 std Y+1, r24 ; 0x01 ver_eeprom[1] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MINOR); 1a0c8: 8c e0 ldi r24, 0x0C ; 12 1a0ca: 90 e0 ldi r25, 0x00 ; 0 1a0cc: 0f 94 e5 db call 0x3b7ca ; 0x3b7ca 1a0d0: 9c 83 std Y+4, r25 ; 0x04 1a0d2: 8b 83 std Y+3, r24 ; 0x03 ver_eeprom[2] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_REVISION); 1a0d4: 8e e0 ldi r24, 0x0E ; 14 1a0d6: 90 e0 ldi r25, 0x00 ; 0 1a0d8: 0f 94 e5 db call 0x3b7ca ; 0x3b7ca 1a0dc: 9e 83 std Y+6, r25 ; 0x06 1a0de: 8d 83 std Y+5, r24 ; 0x05 ver_eeprom[3] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_FLAVOR); 1a0e0: 80 e1 ldi r24, 0x10 ; 16 1a0e2: 90 e0 ldi r25, 0x00 ; 0 1a0e4: 0f 94 e5 db call 0x3b7ca ; 0x3b7ca 1a0e8: 98 87 std Y+8, r25 ; 0x08 1a0ea: 8f 83 std Y+7, r24 ; 0x07 1a0ec: c8 01 movw r24, r16 1a0ee: de 01 movw r26, r28 1a0f0: 11 96 adiw r26, 0x01 ; 1 1a0f2: be 01 movw r22, r28 1a0f4: 67 5f subi r22, 0xF7 ; 247 1a0f6: 7f 4f sbci r23, 0xFF ; 255 for (uint8_t i = 0; i < 4; ++i) { uint16_t v = pgm_read_word(&ver_req[i]); 1a0f8: fc 01 movw r30, r24 1a0fa: 25 91 lpm r18, Z+ 1a0fc: 34 91 lpm r19, Z if (v > ver_eeprom[i]) 1a0fe: 4d 91 ld r20, X+ 1a100: 5d 91 ld r21, X+ 1a102: 42 17 cp r20, r18 1a104: 53 07 cpc r21, r19 1a106: 48 f0 brcs .+18 ; 0x1a11a return true; else if (v < ver_eeprom[i]) 1a108: 24 17 cp r18, r20 1a10a: 35 07 cpc r19, r21 1a10c: 20 f0 brcs .+8 ; 0x1a116 1a10e: 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) { 1a110: a6 17 cp r26, r22 1a112: b7 07 cpc r27, r23 1a114: 89 f7 brne .-30 ; 0x1a0f8 return true; else if (v < ver_eeprom[i]) break; } return false; 1a116: 80 e0 ldi r24, 0x00 ; 0 1a118: 01 c0 rjmp .+2 ; 0x1a11c 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; 1a11a: 81 e0 ldi r24, 0x01 ; 1 else if (v < ver_eeprom[i]) break; } return false; } 1a11c: 28 96 adiw r28, 0x08 ; 8 1a11e: 0f b6 in r0, 0x3f ; 63 1a120: f8 94 cli 1a122: de bf out 0x3e, r29 ; 62 1a124: 0f be out 0x3f, r0 ; 63 1a126: cd bf out 0x3d, r28 ; 61 1a128: df 91 pop r29 1a12a: cf 91 pop r28 1a12c: 1f 91 pop r17 1a12e: 0f 91 pop r16 1a130: 08 95 ret 0001a132 : 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) { 1a132: 0f 93 push r16 1a134: 1f 93 push r17 1a136: cf 93 push r28 1a138: df 93 push r29 1a13a: 98 2f mov r25, r24 1a13c: 86 2f mov r24, r22 1a13e: 14 2f mov r17, r20 1a140: e9 01 movw r28, r18 lcd_set_cursor(_col, _row); 1a142: 69 2f mov r22, r25 1a144: 0e 94 f8 6e call 0xddf0 ; 0xddf0 switch (_state) 1a148: 11 30 cpi r17, 0x01 ; 1 1a14a: 21 f0 breq .+8 ; 0x1a154 1a14c: 12 30 cpi r17, 0x02 ; 2 1a14e: 79 f0 breq .+30 ; 0x1a16e lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); 1a150: ce 01 movw r24, r28 1a152: 15 c0 rjmp .+42 ; 0x1a17e { lcd_set_cursor(_col, _row); switch (_state) { case 1: lcd_puts_P(_name_PROGMEM); 1a154: ce 01 movw r24, r28 1a156: 0e 94 e3 6e call 0xddc6 ; 0xddc6 lcd_putc(':'); 1a15a: 8a e3 ldi r24, 0x3A ; 58 1a15c: 0e 94 e7 6e call 0xddce ; 0xddce lcd_putc(_indicator); 1a160: 80 2f mov r24, r16 lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); } } 1a162: df 91 pop r29 1a164: cf 91 pop r28 1a166: 1f 91 pop r17 1a168: 0f 91 pop r16 switch (_state) { case 1: lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_putc(_indicator); 1a16a: 0c 94 e7 6e jmp 0xddce ; 0xddce break; case 2: lcd_puts_P(_name_PROGMEM); 1a16e: ce 01 movw r24, r28 1a170: 0e 94 e3 6e call 0xddc6 ; 0xddc6 lcd_putc(':'); 1a174: 8a e3 ldi r24, 0x3A ; 58 1a176: 0e 94 e7 6e call 0xddce ; 0xddce lcd_puts_P(MSG_OK_CAPS); 1a17a: 8c eb ldi r24, 0xBC ; 188 1a17c: 9b e6 ldi r25, 0x6B ; 107 break; default: lcd_puts_P(_name_PROGMEM); } } 1a17e: df 91 pop r29 1a180: cf 91 pop r28 1a182: 1f 91 pop r17 1a184: 0f 91 pop r16 lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); 1a186: 0c 94 e3 6e jmp 0xddc6 ; 0xddc6 0001a18a : static void fsensor_reinit() { fsensor.init(); } static void lcd_fsensor_enabled_set(void) { fsensor.setEnabled(!fsensor.isEnabled()); 1a18a: 81 e0 ldi r24, 0x01 ; 1 1a18c: 90 91 a9 17 lds r25, 0x17A9 ; 0x8017a9 1a190: 91 11 cpse r25, r1 1a192: 80 e0 ldi r24, 0x00 ; 0 1a194: 0c 94 e7 74 jmp 0xe9ce ; 0xe9ce 0001a198 : static void lcd_fsensor_autoload_set() { fsensor.setAutoLoadEnabled(!fsensor.getAutoLoadEnabled(), true); } #if FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125 static void lcd_fsensor_jam_detection_set() { 1a198: 0f 93 push r16 1a19a: 1f 93 push r17 1a19c: cf 93 push r28 fsensor.setJamDetectionEnabled(!fsensor.getJamDetectionEnabled(), true); 1a19e: 09 ea ldi r16, 0xA9 ; 169 1a1a0: 17 e1 ldi r17, 0x17 ; 23 1a1a2: f8 01 movw r30, r16 1a1a4: c6 85 ldd r28, Z+14 ; 0x0e 1a1a6: 81 e0 ldi r24, 0x01 ; 1 1a1a8: c8 27 eor r28, r24 return fsensorDetected; } #endif void PAT9125_sensor::setJamDetectionEnabled(bool state, bool updateEEPROM) { jamDetection = state; 1a1aa: c6 87 std Z+14, r28 ; 0x0e oldPos = pat9125_y; 1a1ac: 80 91 8e 0e lds r24, 0x0E8E ; 0x800e8e 1a1b0: 90 91 8f 0e lds r25, 0x0E8F ; 0x800e8f 1a1b4: 90 8b std Z+16, r25 ; 0x10 1a1b6: 87 87 std Z+15, r24 ; 0x0f resetStepCount(); 1a1b8: 0f 94 a5 7a call 0x2f54a ; 0x2f54a jamErrCnt = 0; 1a1bc: f8 01 movw r30, r16 1a1be: 15 8a std Z+21, r1 ; 0x15 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1a1c0: 6c 2f mov r22, r28 1a1c2: 8d ea ldi r24, 0xAD ; 173 1a1c4: 9c e0 ldi r25, 0x0C ; 12 } 1a1c6: cf 91 pop r28 1a1c8: 1f 91 pop r17 1a1ca: 0f 91 pop r16 1a1cc: 0d 94 fb db jmp 0x3b7f6 ; 0x3b7f6 0001a1d0 : Sound_CycleState(); } #ifndef MMU_FORCE_STEALTH_MODE static void lcd_mmu_mode_toggle() { eeprom_toggle((uint8_t*)EEPROM_MMU_STEALTH); 1a1d0: 89 ea ldi r24, 0xA9 ; 169 1a1d2: 9d e0 ldi r25, 0x0D ; 13 1a1d4: 0c 94 4c 76 jmp 0xec98 ; 0xec98 0001a1d8 : 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)) { 1a1d8: 0f 93 push r16 1a1da: 1f 93 push r17 1a1dc: cf 93 push r28 1a1de: df 93 push r29 1a1e0: eb 01 movw r28, r22 1a1e2: 8a 01 movw r16, r20 switch(*oCheckSetting) { 1a1e4: 81 30 cpi r24, 0x01 ; 1 1a1e6: 81 f0 breq .+32 ; 0x1a208 1a1e8: 82 30 cpi r24, 0x02 ; 2 1a1ea: 89 f0 breq .+34 ; 0x1a20e case ClCheckMode::_None: MENU_ITEM_TOGGLE_P(msg, _T(MSG_NONE), func); 1a1ec: 83 ed ldi r24, 0xD3 ; 211 1a1ee: 99 e4 ldi r25, 0x49 ; 73 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); 1a1f0: 0e 94 c4 72 call 0xe588 ; 0xe588 1a1f4: 22 e0 ldi r18, 0x02 ; 2 1a1f6: a8 01 movw r20, r16 1a1f8: bc 01 movw r22, r24 1a1fa: ce 01 movw r24, r28 break; default: MENU_ITEM_TOGGLE_P(msg, _T(MSG_NONE), func); } } 1a1fc: df 91 pop r29 1a1fe: cf 91 pop r28 1a200: 1f 91 pop r17 1a202: 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); 1a204: 0d 94 e0 d2 jmp 0x3a5c0 ; 0x3a5c0 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); 1a208: 8c ec ldi r24, 0xCC ; 204 1a20a: 99 e4 ldi r25, 0x49 ; 73 1a20c: f1 cf rjmp .-30 ; 0x1a1f0 break; case ClCheckMode::_Strict: MENU_ITEM_TOGGLE_P(msg, _T(MSG_STRICT), func); 1a20e: 83 ec ldi r24, 0xC3 ; 195 1a210: 99 e4 ldi r25, 0x49 ; 73 1a212: ee cf rjmp .-36 ; 0x1a1f0 0001a214 : 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() { 1a214: cf 93 push r28 1a216: 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); 1a218: 80 91 38 02 lds r24, 0x0238 ; 0x800238 1a21c: 88 23 and r24, r24 1a21e: 89 f0 breq .+34 ; 0x1a242 1a220: 83 e1 ldi r24, 0x13 ; 19 1a222: 9d e5 ldi r25, 0x5D ; 93 1a224: 0e 94 c4 72 call 0xe588 ; 0xe588 1a228: ec 01 movw r28, r24 1a22a: 8b ef ldi r24, 0xFB ; 251 1a22c: 93 e4 ldi r25, 0x43 ; 67 1a22e: 0e 94 c4 72 call 0xe588 ; 0xe588 1a232: 22 e0 ldi r18, 0x02 ; 2 1a234: 48 e7 ldi r20, 0x78 ; 120 1a236: 59 e3 ldi r21, 0x39 ; 57 1a238: be 01 movw r22, r28 } 1a23a: df 91 pop r29 1a23c: 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); 1a23e: 0d 94 e0 d2 jmp 0x3a5c0 ; 0x3a5c0 1a242: 8d e0 ldi r24, 0x0D ; 13 1a244: 9d e5 ldi r25, 0x5D ; 93 1a246: ee cf rjmp .-36 ; 0x1a224 0001a248 : eeprom_toggle((uint8_t *)EEPROM_MMU_ENABLED); MMU2::mmu2.Status(); } static void SETTINGS_SILENT_MODE() { 1a248: cf 93 push r28 1a24a: df 93 push r29 if (!farm_mode) { // dont show in menu if we are in farm mode #ifdef TMC2130 uint8_t eeprom_mode = eeprom_read_byte((uint8_t*)EEPROM_SILENT); 1a24c: 8f ef ldi r24, 0xFF ; 255 1a24e: 9f e0 ldi r25, 0x0F ; 15 1a250: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae bool bDesync = tmc2130_mode ^ eeprom_mode; 1a254: 90 91 8b 06 lds r25, 0x068B ; 0x80068b if (eeprom_mode == SILENT_MODE_NORMAL) 1a258: 81 11 cpse r24, r1 1a25a: 35 c0 rjmp .+106 ; 0x1a2c6 { if (bDesync) 1a25c: 99 23 and r25, r25 1a25e: 11 f1 breq .+68 ; 0x1a2a4 { MENU_ITEM_TOGGLE_P(_T(MSG_MODE), PSTR("M915"), lcd_silent_mode_set); 1a260: 8b e0 ldi r24, 0x0B ; 11 1a262: 98 e4 ldi r25, 0x48 ; 72 1a264: 0e 94 c4 72 call 0xe588 ; 0xe588 1a268: 22 e0 ldi r18, 0x02 ; 2 1a26a: 45 e0 ldi r20, 0x05 ; 5 1a26c: 50 ef ldi r21, 0xF0 ; 240 1a26e: 69 e2 ldi r22, 0x29 ; 41 1a270: 7a e8 ldi r23, 0x8A ; 138 } else { MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_NORMAL), lcd_silent_mode_set); 1a272: 0f 94 e0 d2 call 0x3a5c0 ; 0x3a5c0 } MENU_ITEM_TOGGLE_P(_T(MSG_CRASHDETECT), eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET) ? _T(MSG_ON) : _T(MSG_OFF), crash_mode_switch); 1a276: 89 e6 ldi r24, 0x69 ; 105 1a278: 9f e0 ldi r25, 0x0F ; 15 1a27a: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 1a27e: 88 23 and r24, r24 1a280: f9 f0 breq .+62 ; 0x1a2c0 1a282: 83 e1 ldi r24, 0x13 ; 19 1a284: 9d e5 ldi r25, 0x5D ; 93 1a286: 0e 94 c4 72 call 0xe588 ; 0xe588 1a28a: ec 01 movw r28, r24 1a28c: 8c ed ldi r24, 0xDC ; 220 1a28e: 93 e4 ldi r25, 0x43 ; 67 1a290: 0e 94 c4 72 call 0xe588 ; 0xe588 1a294: 22 e0 ldi r18, 0x02 ; 2 1a296: 49 e0 ldi r20, 0x09 ; 9 1a298: 5f ed ldi r21, 0xDF ; 223 1a29a: 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 } } 1a29c: df 91 pop r29 1a29e: cf 91 pop r28 } else { 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); 1a2a0: 0d 94 e0 d2 jmp 0x3a5c0 ; 0x3a5c0 { MENU_ITEM_TOGGLE_P(_T(MSG_MODE), PSTR("M915"), lcd_silent_mode_set); } else { MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_NORMAL), lcd_silent_mode_set); 1a2a4: 84 e9 ldi r24, 0x94 ; 148 1a2a6: 94 e4 ldi r25, 0x44 ; 68 1a2a8: 0e 94 c4 72 call 0xe588 ; 0xe588 1a2ac: ec 01 movw r28, r24 1a2ae: 8b e0 ldi r24, 0x0B ; 11 1a2b0: 98 e4 ldi r25, 0x48 ; 72 1a2b2: 0e 94 c4 72 call 0xe588 ; 0xe588 1a2b6: 22 e0 ldi r18, 0x02 ; 2 1a2b8: 45 e0 ldi r20, 0x05 ; 5 1a2ba: 50 ef ldi r21, 0xF0 ; 240 1a2bc: be 01 movw r22, r28 1a2be: d9 cf rjmp .-78 ; 0x1a272 } MENU_ITEM_TOGGLE_P(_T(MSG_CRASHDETECT), eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET) ? _T(MSG_ON) : _T(MSG_OFF), crash_mode_switch); 1a2c0: 8d e0 ldi r24, 0x0D ; 13 1a2c2: 9d e5 ldi r25, 0x5D ; 93 1a2c4: e0 cf rjmp .-64 ; 0x1a286 } else { if (bDesync) 1a2c6: 98 17 cp r25, r24 1a2c8: a9 f0 breq .+42 ; 0x1a2f4 { MENU_ITEM_TOGGLE_P(_T(MSG_MODE), PSTR("M914") , lcd_silent_mode_set); 1a2ca: 8b e0 ldi r24, 0x0B ; 11 1a2cc: 98 e4 ldi r25, 0x48 ; 72 1a2ce: 0e 94 c4 72 call 0xe588 ; 0xe588 1a2d2: 22 e0 ldi r18, 0x02 ; 2 1a2d4: 45 e0 ldi r20, 0x05 ; 5 1a2d6: 50 ef ldi r21, 0xF0 ; 240 1a2d8: 64 e2 ldi r22, 0x24 ; 36 1a2da: 7a e8 ldi r23, 0x8A ; 138 } else { MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_STEALTH), lcd_silent_mode_set); 1a2dc: 0f 94 e0 d2 call 0x3a5c0 ; 0x3a5c0 } MENU_ITEM_TOGGLE_P(_T(MSG_CRASHDETECT), NULL, lcd_crash_mode_info); 1a2e0: 8c ed ldi r24, 0xDC ; 220 1a2e2: 93 e4 ldi r25, 0x43 ; 67 1a2e4: 0e 94 c4 72 call 0xe588 ; 0xe588 1a2e8: 22 e0 ldi r18, 0x02 ; 2 1a2ea: 4f e0 ldi r20, 0x0F ; 15 1a2ec: 5f ed ldi r21, 0xDF ; 223 1a2ee: 70 e0 ldi r23, 0x00 ; 0 1a2f0: 60 e0 ldi r22, 0x00 ; 0 1a2f2: d4 cf rjmp .-88 ; 0x1a29c { MENU_ITEM_TOGGLE_P(_T(MSG_MODE), PSTR("M914") , lcd_silent_mode_set); } else { MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_STEALTH), lcd_silent_mode_set); 1a2f4: 82 ed ldi r24, 0xD2 ; 210 1a2f6: 93 e4 ldi r25, 0x43 ; 67 1a2f8: 0e 94 c4 72 call 0xe588 ; 0xe588 1a2fc: ec 01 movw r28, r24 1a2fe: 8b e0 ldi r24, 0x0B ; 11 1a300: 98 e4 ldi r25, 0x48 ; 72 1a302: 0e 94 c4 72 call 0xe588 ; 0xe588 1a306: 22 e0 ldi r18, 0x02 ; 2 1a308: 45 e0 ldi r20, 0x05 ; 5 1a30a: 50 ef ldi r21, 0xF0 ; 240 1a30c: be 01 movw r22, r28 1a30e: e6 cf rjmp .-52 ; 0x1a2dc 0001a310 : } #endif //FILAMENT_SENSOR static void menuitems_MMU_settings_common() { 1a310: cf 93 push r28 1a312: df 93 push r29 } } bool SpoolJoin::isSpoolJoinEnabled() { if(eeprom_read_byte((uint8_t*)EEPROM_SPOOL_JOIN) == (uint8_t)EEPROM::Enabled) { 1a314: 86 ed ldi r24, 0xD6 ; 214 1a316: 9e e0 ldi r25, 0x0E ; 14 1a318: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 1a31c: 81 30 cpi r24, 0x01 ; 1 1a31e: c1 f5 brne .+112 ; 0x1a390 MENU_ITEM_TOGGLE_P(MSG_SPOOL_JOIN, SpoolJoin::spooljoin.isSpoolJoinEnabled() ? _T(MSG_ON) : _T(MSG_OFF), SpoolJoin::spooljoin.toggleSpoolJoin); 1a320: 83 e1 ldi r24, 0x13 ; 19 1a322: 9d e5 ldi r25, 0x5D ; 93 1a324: 0e 94 c4 72 call 0xe588 ; 0xe588 1a328: 22 e0 ldi r18, 0x02 ; 2 1a32a: 48 e4 ldi r20, 0x48 ; 72 1a32c: 5a e3 ldi r21, 0x3A ; 58 1a32e: bc 01 movw r22, r24 1a330: 8c ec ldi r24, 0xCC ; 204 1a332: 9a e6 ldi r25, 0x6A ; 106 1a334: 0f 94 e0 d2 call 0x3a5c0 ; 0x3a5c0 #ifdef MMU_HAS_CUTTER if (EEPROM_MMU_CUTTER_ENABLED_enabled == eeprom_read_byte((uint8_t *)EEPROM_MMU_CUTTER_ENABLED)) 1a338: 8e ec ldi r24, 0xCE ; 206 1a33a: 9e e0 ldi r25, 0x0E ; 14 1a33c: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 1a340: 81 30 cpi r24, 0x01 ; 1 1a342: 49 f5 brne .+82 ; 0x1a396 { MENU_ITEM_TOGGLE_P(_T(MSG_CUTTER), _T(MSG_ON), lcd_cutter_enabled); 1a344: 83 e1 ldi r24, 0x13 ; 19 1a346: 9d e5 ldi r25, 0x5D ; 93 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); 1a348: 0e 94 c4 72 call 0xe588 ; 0xe588 1a34c: ec 01 movw r28, r24 1a34e: 89 ec ldi r24, 0xC9 ; 201 1a350: 93 e4 ldi r25, 0x43 ; 67 1a352: 0e 94 c4 72 call 0xe588 ; 0xe588 1a356: 22 e0 ldi r18, 0x02 ; 2 1a358: 4a ee ldi r20, 0xEA ; 234 1a35a: 5a e3 ldi r21, 0x3A ; 58 1a35c: be 01 movw r22, r28 1a35e: 0f 94 e0 d2 call 0x3a5c0 ; 0x3a5c0 } #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); 1a362: 89 ea ldi r24, 0xA9 ; 169 1a364: 9d e0 ldi r25, 0x0D ; 13 1a366: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 1a36a: 88 23 and r24, r24 1a36c: b9 f0 breq .+46 ; 0x1a39c 1a36e: 82 ed ldi r24, 0xD2 ; 210 1a370: 93 e4 ldi r25, 0x43 ; 67 1a372: 0e 94 c4 72 call 0xe588 ; 0xe588 1a376: ec 01 movw r28, r24 1a378: 8e eb ldi r24, 0xBE ; 190 1a37a: 93 e4 ldi r25, 0x43 ; 67 1a37c: 0e 94 c4 72 call 0xe588 ; 0xe588 1a380: 22 e0 ldi r18, 0x02 ; 2 1a382: 48 ee ldi r20, 0xE8 ; 232 1a384: 50 ed ldi r21, 0xD0 ; 208 1a386: be 01 movw r22, r28 #endif // MMU_FORCE_STEALTH_MODE } 1a388: df 91 pop r29 1a38a: cf 91 pop r28 MENU_ITEM_TOGGLE_P(_T(MSG_CUTTER), _T(MSG_OFF), lcd_cutter_enabled); } #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); 1a38c: 0d 94 e0 d2 jmp 0x3a5c0 ; 0x3a5c0 #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); 1a390: 8d e0 ldi r24, 0x0D ; 13 1a392: 9d e5 ldi r25, 0x5D ; 93 1a394: c7 cf rjmp .-114 ; 0x1a324 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); 1a396: 8d e0 ldi r24, 0x0D ; 13 1a398: 9d e5 ldi r25, 0x5D ; 93 1a39a: d6 cf rjmp .-84 ; 0x1a348 } #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); 1a39c: 84 e9 ldi r24, 0x94 ; 148 1a39e: 94 e4 ldi r25, 0x44 ; 68 1a3a0: e8 cf rjmp .-48 ; 0x1a372 0001a3a2 : 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) 1a3a2: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 1a3a6: 88 23 and r24, r24 1a3a8: 21 f0 breq .+8 ; 0x1a3b2 1a3aa: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 1a3ae: 88 23 and r24, r24 1a3b0: 51 f0 breq .+20 ; 0x1a3c6 { _md->status = 1; 1a3b2: 81 e0 ldi r24, 0x01 ; 1 1a3b4: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 _md->experimental_menu_visibility = eeprom_init_default_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY, 0); 1a3b8: 60 e0 ldi r22, 0x00 ; 0 1a3ba: 8a e2 ldi r24, 0x2A ; 42 1a3bc: 9d e0 ldi r25, 0x0D ; 13 1a3be: 0e 94 21 76 call 0xec42 ; 0xec42 1a3c2: 80 93 a8 03 sts 0x03A8, r24 ; 0x8003a8 } MENU_BEGIN(); 1a3c6: 0f 94 51 d1 call 0x3a2a2 ; 0x3a2a2 1a3ca: 10 92 11 05 sts 0x0511, r1 ; 0x800511 1a3ce: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1a3d2: 84 30 cpi r24, 0x04 ; 4 1a3d4: 08 f0 brcs .+2 ; 0x1a3d8 1a3d6: 76 c0 rjmp .+236 ; 0x1a4c4 1a3d8: 10 92 14 05 sts 0x0514, r1 ; 0x800514 MENU_ITEM_BACK_P(_T(bSettings?MSG_SETTINGS:MSG_BACK)); // i.e. default menu-item / menu-item after checking mismatch 1a3dc: 80 91 fb 03 lds r24, 0x03FB ; 0x8003fb 1a3e0: 81 11 cpse r24, r1 1a3e2: 3f c0 rjmp .+126 ; 0x1a462 1a3e4: 8c eb ldi r24, 0xBC ; 188 1a3e6: 99 e4 ldi r25, 0x49 ; 73 1a3e8: 0e 94 c4 72 call 0xe588 ; 0xe588 1a3ec: 0f 94 1c d4 call 0x3a838 ; 0x3a838 MENU_ITEM_SUBMENU_P(_T(MSG_STEEL_SHEETS), sheets_menu); 1a3f0: 88 e2 ldi r24, 0x28 ; 40 1a3f2: 96 e4 ldi r25, 0x46 ; 70 1a3f4: 0e 94 c4 72 call 0xe588 ; 0xe588 1a3f8: 61 ee ldi r22, 0xE1 ; 225 1a3fa: 71 ee ldi r23, 0xE1 ; 225 1a3fc: 0f 94 cf d3 call 0x3a79e ; 0x3a79e SETTINGS_NOZZLE; 1a400: 80 91 ea 04 lds r24, 0x04EA ; 0x8004ea 1a404: 8c 33 cpi r24, 0x3C ; 60 1a406: 09 f4 brne .+2 ; 0x1a40a 1a408: 49 c0 rjmp .+146 ; 0x1a49c 1a40a: 70 f5 brcc .+92 ; 0x1a468 1a40c: 89 31 cpi r24, 0x19 ; 25 1a40e: d1 f1 breq .+116 ; 0x1a484 1a410: 88 32 cpi r24, 0x28 ; 40 1a412: 71 f1 breq .+92 ; 0x1a470 MENU_ITEM_FUNCTION_P(_T(MSG_NOZZLE_CNG_MENU),nozzle_change); 1a414: 8f e5 ldi r24, 0x5F ; 95 1a416: 94 e4 ldi r25, 0x44 ; 68 1a418: 0e 94 c4 72 call 0xe588 ; 0xe588 1a41c: 61 ec ldi r22, 0xC1 ; 193 1a41e: 7e ec ldi r23, 0xCE ; 206 1a420: 0f 94 ce d0 call 0x3a19c ; 0x3a19c MENU_ITEM_SUBMENU_P(_T(MSG_CHECKS), lcd_checking_menu); 1a424: 86 e5 ldi r24, 0x56 ; 86 1a426: 94 e4 ldi r25, 0x44 ; 68 1a428: 0e 94 c4 72 call 0xe588 ; 0xe588 1a42c: 69 e1 ldi r22, 0x19 ; 25 1a42e: 74 ed ldi r23, 0xD4 ; 212 1a430: 0f 94 cf d3 call 0x3a79e ; 0x3a79e //! 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) 1a434: 80 91 a8 03 lds r24, 0x03A8 ; 0x8003a8 1a438: 88 23 and r24, r24 1a43a: 31 f0 breq .+12 ; 0x1a448 { MENU_ITEM_SUBMENU_P(PSTR("Experimental"), lcd_experimental_menu);////MSG_MENU_EXPERIMENTAL c=18 1a43c: 6c eb ldi r22, 0xBC ; 188 1a43e: 7f ee ldi r23, 0xEF ; 239 1a440: 8e e2 ldi r24, 0x2E ; 46 1a442: 9a e8 ldi r25, 0x8A ; 138 1a444: 0f 94 cf d3 call 0x3a79e ; 0x3a79e //! //! 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); #endif //PINDA_TEMP_COMP MENU_END(); 1a448: 0f 94 25 d1 call 0x3a24a ; 0x3a24a _md->status = 1; _md->experimental_menu_visibility = eeprom_init_default_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY, 0); } MENU_BEGIN(); 1a44c: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1a450: 8f 5f subi r24, 0xFF ; 255 1a452: 80 93 11 05 sts 0x0511, r24 ; 0x800511 1a456: 80 91 13 05 lds r24, 0x0513 ; 0x800513 1a45a: 8f 5f subi r24, 0xFF ; 255 1a45c: 80 93 13 05 sts 0x0513, r24 ; 0x800513 1a460: b6 cf rjmp .-148 ; 0x1a3ce MENU_ITEM_BACK_P(_T(bSettings?MSG_SETTINGS:MSG_BACK)); // i.e. default menu-item / menu-item after checking mismatch 1a462: 86 e4 ldi r24, 0x46 ; 70 1a464: 98 e4 ldi r25, 0x48 ; 72 1a466: c0 cf rjmp .-128 ; 0x1a3e8 MENU_ITEM_SUBMENU_P(_T(MSG_STEEL_SHEETS), sheets_menu); SETTINGS_NOZZLE; 1a468: 80 35 cpi r24, 0x50 ; 80 1a46a: 11 f1 breq .+68 ; 0x1a4b0 1a46c: 8f 3f cpi r24, 0xFF ; 255 1a46e: 91 f6 brne .-92 ; 0x1a414 1a470: 8f e6 ldi r24, 0x6F ; 111 1a472: 94 e4 ldi r25, 0x44 ; 68 1a474: 0e 94 c4 72 call 0xe588 ; 0xe588 1a478: 22 e0 ldi r18, 0x02 ; 2 1a47a: 45 e2 ldi r20, 0x25 ; 37 1a47c: 50 ed ldi r21, 0xD0 ; 208 1a47e: 65 e4 ldi r22, 0x45 ; 69 1a480: 7a e8 ldi r23, 0x8A ; 138 1a482: 09 c0 rjmp .+18 ; 0x1a496 1a484: 8f e6 ldi r24, 0x6F ; 111 1a486: 94 e4 ldi r25, 0x44 ; 68 1a488: 0e 94 c4 72 call 0xe588 ; 0xe588 1a48c: 22 e0 ldi r18, 0x02 ; 2 1a48e: 45 e2 ldi r20, 0x25 ; 37 1a490: 50 ed ldi r21, 0xD0 ; 208 1a492: 6a e4 ldi r22, 0x4A ; 74 1a494: 7a e8 ldi r23, 0x8A ; 138 1a496: 0f 94 e0 d2 call 0x3a5c0 ; 0x3a5c0 1a49a: bc cf rjmp .-136 ; 0x1a414 1a49c: 8f e6 ldi r24, 0x6F ; 111 1a49e: 94 e4 ldi r25, 0x44 ; 68 1a4a0: 0e 94 c4 72 call 0xe588 ; 0xe588 1a4a4: 22 e0 ldi r18, 0x02 ; 2 1a4a6: 45 e2 ldi r20, 0x25 ; 37 1a4a8: 50 ed ldi r21, 0xD0 ; 208 1a4aa: 60 e4 ldi r22, 0x40 ; 64 1a4ac: 7a e8 ldi r23, 0x8A ; 138 1a4ae: f3 cf rjmp .-26 ; 0x1a496 1a4b0: 8f e6 ldi r24, 0x6F ; 111 1a4b2: 94 e4 ldi r25, 0x44 ; 68 1a4b4: 0e 94 c4 72 call 0xe588 ; 0xe588 1a4b8: 22 e0 ldi r18, 0x02 ; 2 1a4ba: 45 e2 ldi r20, 0x25 ; 37 1a4bc: 50 ed ldi r21, 0xD0 ; 208 1a4be: 6b e3 ldi r22, 0x3B ; 59 1a4c0: 7a e8 ldi r23, 0x8A ; 138 1a4c2: e9 cf rjmp .-46 ; 0x1a496 //! 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); #endif //PINDA_TEMP_COMP MENU_END(); } 1a4c4: 08 95 ret 0001a4c6 : lcd_return_to_status(); } #endif //THERMAL_MODEL void lcd_sdcard_stop() { 1a4c6: cf 93 push r28 // Show static message lcd_puts_at_P(0, 0, _T(MSG_STOP_PRINT)); 1a4c8: 8c e5 ldi r24, 0x5C ; 92 1a4ca: 98 e4 ldi r25, 0x48 ; 72 1a4cc: 0e 94 c4 72 call 0xe588 ; 0xe588 1a4d0: ac 01 movw r20, r24 1a4d2: 60 e0 ldi r22, 0x00 ; 0 1a4d4: 80 e0 ldi r24, 0x00 ; 0 1a4d6: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_putc_at(0, 1, '\n'); 1a4da: 4a e0 ldi r20, 0x0A ; 10 1a4dc: 61 e0 ldi r22, 0x01 ; 1 1a4de: 80 e0 ldi r24, 0x00 ; 0 1a4e0: 0e 94 18 6f call 0xde30 ; 0xde30 MENU_BEGIN(); 1a4e4: 0f 94 51 d1 call 0x3a2a2 ; 0x3a2a2 1a4e8: 10 92 11 05 sts 0x0511, r1 ; 0x800511 // Skip first two LCD rows used by static message if(menu_row == 0) menu_row = 2; 1a4ec: 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(); 1a4ee: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1a4f2: 84 30 cpi r24, 0x04 ; 4 1a4f4: 18 f5 brcc .+70 ; 0x1a53c 1a4f6: 10 92 14 05 sts 0x0514, r1 ; 0x800514 // Skip first two LCD rows used by static message if(menu_row == 0) menu_row = 2; 1a4fa: 81 11 cpse r24, r1 1a4fc: 02 c0 rjmp .+4 ; 0x1a502 1a4fe: c0 93 11 05 sts 0x0511, r28 ; 0x800511 // Show No options first, the default selection MENU_ITEM_FUNCTION_P(_T(MSG_NO), lcd_return_to_status); 1a502: 87 e5 ldi r24, 0x57 ; 87 1a504: 98 e4 ldi r25, 0x48 ; 72 1a506: 0e 94 c4 72 call 0xe588 ; 0xe588 1a50a: 66 e1 ldi r22, 0x16 ; 22 1a50c: 7a e3 ldi r23, 0x3A ; 58 1a50e: 0f 94 ce d0 call 0x3a19c ; 0x3a19c MENU_ITEM_FUNCTION_P(_T(MSG_YES), lcd_print_stop); 1a512: 81 e5 ldi r24, 0x51 ; 81 1a514: 98 e4 ldi r25, 0x48 ; 72 1a516: 0e 94 c4 72 call 0xe588 ; 0xe588 1a51a: 68 ec ldi r22, 0xC8 ; 200 1a51c: 74 ef ldi r23, 0xF4 ; 244 1a51e: 0f 94 ce d0 call 0x3a19c ; 0x3a19c MENU_END(); 1a522: 0f 94 25 d1 call 0x3a24a ; 0x3a24a { // Show static message lcd_puts_at_P(0, 0, _T(MSG_STOP_PRINT)); lcd_putc_at(0, 1, '\n'); MENU_BEGIN(); 1a526: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1a52a: 8f 5f subi r24, 0xFF ; 255 1a52c: 80 93 11 05 sts 0x0511, r24 ; 0x800511 1a530: 80 91 13 05 lds r24, 0x0513 ; 0x800513 1a534: 8f 5f subi r24, 0xFF ; 255 1a536: 80 93 13 05 sts 0x0513, r24 ; 0x800513 1a53a: d9 cf rjmp .-78 ; 0x1a4ee // 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(); } 1a53c: cf 91 pop r28 1a53e: 08 95 ret 0001a540 : act = Filament_sensor::SensorActionOnError::_Continue; } fsensor.setActionOnError(act, true); } static void lcd_fsensor_settings_menu() { 1a540: cf 93 push r28 1a542: df 93 push r29 MENU_BEGIN(); 1a544: 0f 94 51 d1 call 0x3a2a2 ; 0x3a2a2 1a548: 10 92 11 05 sts 0x0511, r1 ; 0x800511 1a54c: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1a550: 84 30 cpi r24, 0x04 ; 4 1a552: 08 f0 brcs .+2 ; 0x1a556 1a554: bd c0 rjmp .+378 ; 0x1a6d0 1a556: 10 92 14 05 sts 0x0514, r1 ; 0x800514 MENU_ITEM_BACK_P(_T(MSG_BACK)); 1a55a: 8c eb ldi r24, 0xBC ; 188 1a55c: 99 e4 ldi r25, 0x49 ; 73 1a55e: 0e 94 c4 72 call 0xe588 ; 0xe588 1a562: 0f 94 1c d4 call 0x3a838 ; 0x3a838 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR), fsensor.isEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_enabled_set); 1a566: 80 91 a9 17 lds r24, 0x17A9 ; 0x8017a9 1a56a: 88 23 and r24, r24 1a56c: 09 f4 brne .+2 ; 0x1a570 1a56e: 4e c0 rjmp .+156 ; 0x1a60c 1a570: 83 e1 ldi r24, 0x13 ; 19 1a572: 9d e5 ldi r25, 0x5D ; 93 1a574: 0e 94 c4 72 call 0xe588 ; 0xe588 1a578: ec 01 movw r28, r24 1a57a: 87 ea ldi r24, 0xA7 ; 167 1a57c: 97 e4 ldi r25, 0x47 ; 71 1a57e: 0e 94 c4 72 call 0xe588 ; 0xe588 1a582: 22 e0 ldi r18, 0x02 ; 2 1a584: 45 ec ldi r20, 0xC5 ; 197 1a586: 50 ed ldi r21, 0xD0 ; 208 1a588: be 01 movw r22, r28 1a58a: 0f 94 e0 d2 call 0x3a5c0 ; 0x3a5c0 1a58e: 80 91 a9 17 lds r24, 0x17A9 ; 0x8017a9 if (fsensor.isEnabled()) { 1a592: 88 23 and r24, r24 1a594: 09 f4 brne .+2 ; 0x1a598 1a596: 8c c0 rjmp .+280 ; 0x1a6b0 if (fsensor.isError()) { 1a598: 83 30 cpi r24, 0x03 ; 3 1a59a: d9 f5 brne .+118 ; 0x1a612 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_RUNOUT), _T(MSG_NA), fsensor_reinit); 1a59c: 86 ee ldi r24, 0xE6 ; 230 1a59e: 97 e4 ldi r25, 0x47 ; 71 1a5a0: 0e 94 c4 72 call 0xe588 ; 0xe588 1a5a4: ec 01 movw r28, r24 1a5a6: 82 eb ldi r24, 0xB2 ; 178 1a5a8: 93 e4 ldi r25, 0x43 ; 67 1a5aa: 0e 94 c4 72 call 0xe588 ; 0xe588 1a5ae: 22 e0 ldi r18, 0x02 ; 2 1a5b0: 4b e1 ldi r20, 0x1B ; 27 1a5b2: 5f ec ldi r21, 0xCF ; 207 1a5b4: be 01 movw r22, r28 1a5b6: 0f 94 e0 d2 call 0x3a5c0 ; 0x3a5c0 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), _T(MSG_NA), fsensor_reinit); 1a5ba: 86 ee ldi r24, 0xE6 ; 230 1a5bc: 97 e4 ldi r25, 0x47 ; 71 1a5be: 0e 94 c4 72 call 0xe588 ; 0xe588 1a5c2: ec 01 movw r28, r24 1a5c4: 84 ea ldi r24, 0xA4 ; 164 1a5c6: 93 e4 ldi r25, 0x43 ; 67 1a5c8: 0e 94 c4 72 call 0xe588 ; 0xe588 1a5cc: 22 e0 ldi r18, 0x02 ; 2 1a5ce: 4b e1 ldi r20, 0x1B ; 27 1a5d0: 5f ec ldi r21, 0xCF ; 207 1a5d2: be 01 movw r22, r28 1a5d4: 0f 94 e0 d2 call 0x3a5c0 ; 0x3a5c0 #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_JAM_DETECTION), _T(MSG_NA), fsensor_reinit); 1a5d8: 86 ee ldi r24, 0xE6 ; 230 1a5da: 97 e4 ldi r25, 0x47 ; 71 1a5dc: 0e 94 c4 72 call 0xe588 ; 0xe588 1a5e0: ec 01 movw r28, r24 1a5e2: 84 e9 ldi r24, 0x94 ; 148 1a5e4: 93 e4 ldi r25, 0x43 ; 67 1a5e6: 0e 94 c4 72 call 0xe588 ; 0xe588 1a5ea: 22 e0 ldi r18, 0x02 ; 2 1a5ec: 4b e1 ldi r20, 0x1B ; 27 1a5ee: 5f ec ldi r21, 0xCF ; 207 } 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); #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); 1a5f0: be 01 movw r22, r28 1a5f2: 0f 94 e0 d2 call 0x3a5c0 ; 0x3a5c0 #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) } switch(fsensor.getActionOnError()) { 1a5f6: 80 91 b1 17 lds r24, 0x17B1 ; 0x8017b1 1a5fa: 88 23 and r24, r24 1a5fc: 09 f4 brne .+2 ; 0x1a600 1a5fe: 49 c0 rjmp .+146 ; 0x1a692 1a600: 81 30 cpi r24, 0x01 ; 1 1a602: 09 f4 brne .+2 ; 0x1a606 1a604: 62 c0 rjmp .+196 ; 0x1a6ca 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(); 1a606: 0e 94 b4 cf call 0x19f68 ; 0x19f68 1a60a: 52 c0 rjmp .+164 ; 0x1a6b0 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); 1a60c: 8d e0 ldi r24, 0x0D ; 13 1a60e: 9d e5 ldi r25, 0x5D ; 93 1a610: b1 cf rjmp .-158 ; 0x1a574 #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); 1a612: 80 91 ab 17 lds r24, 0x17AB ; 0x8017ab 1a616: 88 23 and r24, r24 1a618: 99 f1 breq .+102 ; 0x1a680 1a61a: 83 e1 ldi r24, 0x13 ; 19 1a61c: 9d e5 ldi r25, 0x5D ; 93 1a61e: 0e 94 c4 72 call 0xe588 ; 0xe588 1a622: ec 01 movw r28, r24 1a624: 82 eb ldi r24, 0xB2 ; 178 1a626: 93 e4 ldi r25, 0x43 ; 67 1a628: 0e 94 c4 72 call 0xe588 ; 0xe588 1a62c: 22 e0 ldi r18, 0x02 ; 2 1a62e: 4a ec ldi r20, 0xCA ; 202 1a630: 5f ec ldi r21, 0xCF ; 207 1a632: be 01 movw r22, r28 1a634: 0f 94 e0 d2 call 0x3a5c0 ; 0x3a5c0 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), fsensor.getAutoLoadEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_autoload_set); 1a638: 80 91 aa 17 lds r24, 0x17AA ; 0x8017aa 1a63c: 88 23 and r24, r24 1a63e: 19 f1 breq .+70 ; 0x1a686 1a640: 83 e1 ldi r24, 0x13 ; 19 1a642: 9d e5 ldi r25, 0x5D ; 93 1a644: 0e 94 c4 72 call 0xe588 ; 0xe588 1a648: ec 01 movw r28, r24 1a64a: 84 ea ldi r24, 0xA4 ; 164 1a64c: 93 e4 ldi r25, 0x43 ; 67 1a64e: 0e 94 c4 72 call 0xe588 ; 0xe588 1a652: 22 e0 ldi r18, 0x02 ; 2 1a654: 40 ec ldi r20, 0xC0 ; 192 1a656: 5f ec ldi r21, 0xCF ; 207 1a658: be 01 movw r22, r28 1a65a: 0f 94 e0 d2 call 0x3a5c0 ; 0x3a5c0 #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); 1a65e: 80 91 b7 17 lds r24, 0x17B7 ; 0x8017b7 1a662: 88 23 and r24, r24 1a664: 99 f0 breq .+38 ; 0x1a68c 1a666: 83 e1 ldi r24, 0x13 ; 19 1a668: 9d e5 ldi r25, 0x5D ; 93 1a66a: 0e 94 c4 72 call 0xe588 ; 0xe588 1a66e: ec 01 movw r28, r24 1a670: 84 e9 ldi r24, 0x94 ; 148 1a672: 93 e4 ldi r25, 0x43 ; 67 1a674: 0e 94 c4 72 call 0xe588 ; 0xe588 1a678: 22 e0 ldi r18, 0x02 ; 2 1a67a: 4c ec ldi r20, 0xCC ; 204 1a67c: 50 ed ldi r21, 0xD0 ; 208 1a67e: b8 cf rjmp .-144 ; 0x1a5f0 #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); 1a680: 8d e0 ldi r24, 0x0D ; 13 1a682: 9d e5 ldi r25, 0x5D ; 93 1a684: cc cf rjmp .-104 ; 0x1a61e MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), fsensor.getAutoLoadEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_autoload_set); 1a686: 8d e0 ldi r24, 0x0D ; 13 1a688: 9d e5 ldi r25, 0x5D ; 93 1a68a: dc cf rjmp .-72 ; 0x1a644 #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); 1a68c: 8d e0 ldi r24, 0x0D ; 13 1a68e: 9d e5 ldi r25, 0x5D ; 93 1a690: ec cf rjmp .-40 ; 0x1a66a #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); 1a692: 8c e8 ldi r24, 0x8C ; 140 1a694: 93 e4 ldi r25, 0x43 ; 67 break; case Filament_sensor::SensorActionOnError::_Pause: MENU_ITEM_TOGGLE_P(_T(MSG_FS_ACTION), _T(MSG_PAUSE), lcd_fsensor_actionNA_set); 1a696: 0e 94 c4 72 call 0xe588 ; 0xe588 1a69a: ec 01 movw r28, r24 1a69c: 80 e8 ldi r24, 0x80 ; 128 1a69e: 93 e4 ldi r25, 0x43 ; 67 1a6a0: 0e 94 c4 72 call 0xe588 ; 0xe588 1a6a4: 22 e0 ldi r18, 0x02 ; 2 1a6a6: 44 eb ldi r20, 0xB4 ; 180 1a6a8: 5f ec ldi r21, 0xCF ; 207 1a6aa: be 01 movw r22, r28 1a6ac: 0f 94 e0 d2 call 0x3a5c0 ; 0x3a5c0 default: lcd_fsensor_actionNA_set(); } } MENU_END(); 1a6b0: 0f 94 25 d1 call 0x3a24a ; 0x3a24a } fsensor.setActionOnError(act, true); } static void lcd_fsensor_settings_menu() { MENU_BEGIN(); 1a6b4: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1a6b8: 8f 5f subi r24, 0xFF ; 255 1a6ba: 80 93 11 05 sts 0x0511, r24 ; 0x800511 1a6be: 80 91 13 05 lds r24, 0x0513 ; 0x800513 1a6c2: 8f 5f subi r24, 0xFF ; 255 1a6c4: 80 93 13 05 sts 0x0513, r24 ; 0x800513 1a6c8: 41 cf rjmp .-382 ; 0x1a54c 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); 1a6ca: 88 e7 ldi r24, 0x78 ; 120 1a6cc: 93 e4 ldi r25, 0x43 ; 67 1a6ce: e3 cf rjmp .-58 ; 0x1a696 lcd_fsensor_actionNA_set(); } } MENU_END(); } 1a6d0: df 91 pop r29 1a6d2: cf 91 pop r28 1a6d4: 08 95 ret 0001a6d6 : lcd_first_layer_calibration_reset(); } static void lcd_sheet_menu() { MENU_BEGIN(); 1a6d6: 0f 94 51 d1 call 0x3a2a2 ; 0x3a2a2 1a6da: 10 92 11 05 sts 0x0511, r1 ; 0x800511 1a6de: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1a6e2: 84 30 cpi r24, 0x04 ; 4 1a6e4: 08 f0 brcs .+2 ; 0x1a6e8 1a6e6: 3f c0 rjmp .+126 ; 0x1a766 1a6e8: 10 92 14 05 sts 0x0514, r1 ; 0x800514 MENU_ITEM_BACK_P(_T(MSG_STEEL_SHEETS)); 1a6ec: 88 e2 ldi r24, 0x28 ; 40 1a6ee: 96 e4 ldi r25, 0x46 ; 70 1a6f0: 0e 94 c4 72 call 0xe588 ; 0xe588 1a6f4: 0f 94 1c d4 call 0x3a838 ; 0x3a838 if(eeprom_is_sheet_initialized(selected_sheet)){ 1a6f8: 80 91 e0 03 lds r24, 0x03E0 ; 0x8003e0 1a6fc: 0e 94 59 76 call 0xecb2 ; 0xecb2 1a700: 88 23 and r24, r24 1a702: 41 f0 breq .+16 ; 0x1a714 MENU_ITEM_SUBMENU_P(_T(MSG_SELECT), change_sheet); 1a704: 8f e1 ldi r24, 0x1F ; 31 1a706: 96 e4 ldi r25, 0x46 ; 70 1a708: 0e 94 c4 72 call 0xe588 ; 0xe588 1a70c: 6b ea ldi r22, 0xAB ; 171 1a70e: 70 ee ldi r23, 0xE0 ; 224 1a710: 0f 94 cf d3 call 0x3a79e ; 0x3a79e } if (lcd_commands_type == LcdCommands::Idle) 1a714: 80 91 b3 0d lds r24, 0x0DB3 ; 0x800db3 1a718: 81 11 cpse r24, r1 1a71a: 08 c0 rjmp .+16 ; 0x1a72c { MENU_ITEM_SUBMENU_P(_T(MSG_V2_CALIBRATION), activate_calibrate_sheet); 1a71c: 8c e0 ldi r24, 0x0C ; 12 1a71e: 96 e4 ldi r25, 0x46 ; 70 1a720: 0e 94 c4 72 call 0xe588 ; 0xe588 1a724: 64 e4 ldi r22, 0x44 ; 68 1a726: 7f ee ldi r23, 0xEF ; 239 1a728: 0f 94 cf d3 call 0x3a79e ; 0x3a79e } MENU_ITEM_SUBMENU_P(_T(MSG_RENAME), lcd_rename_sheet_menu); 1a72c: 83 e0 ldi r24, 0x03 ; 3 1a72e: 96 e4 ldi r25, 0x46 ; 70 1a730: 0e 94 c4 72 call 0xe588 ; 0xe588 1a734: 68 e6 ldi r22, 0x68 ; 104 1a736: 7b ed ldi r23, 0xDB ; 219 1a738: 0f 94 cf d3 call 0x3a79e ; 0x3a79e MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_reset_sheet); 1a73c: 8b ef ldi r24, 0xFB ; 251 1a73e: 95 e4 ldi r25, 0x45 ; 69 1a740: 0e 94 c4 72 call 0xe588 ; 0xe588 1a744: 66 e2 ldi r22, 0x26 ; 38 1a746: 7e ee ldi r23, 0xEE ; 238 1a748: 0f 94 ce d0 call 0x3a19c ; 0x3a19c MENU_END(); 1a74c: 0f 94 25 d1 call 0x3a24a ; 0x3a24a lcd_first_layer_calibration_reset(); } static void lcd_sheet_menu() { MENU_BEGIN(); 1a750: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1a754: 8f 5f subi r24, 0xFF ; 255 1a756: 80 93 11 05 sts 0x0511, r24 ; 0x800511 1a75a: 80 91 13 05 lds r24, 0x0513 ; 0x800513 1a75e: 8f 5f subi r24, 0xFF ; 255 1a760: 80 93 13 05 sts 0x0513, r24 ; 0x800513 1a764: bc cf rjmp .-136 ; 0x1a6de } MENU_ITEM_SUBMENU_P(_T(MSG_RENAME), lcd_rename_sheet_menu); MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_reset_sheet); MENU_END(); } 1a766: 08 95 ret 0001a768 ()>: } template static void select_sheet_menu() { selected_sheet = number; 1a768: 87 e0 ldi r24, 0x07 ; 7 1a76a: 80 93 e0 03 sts 0x03E0, r24 ; 0x8003e0 lcd_sheet_menu(); 1a76e: 0c 94 6b d3 jmp 0x1a6d6 ; 0x1a6d6 0001a772 ()>: } template static void select_sheet_menu() { selected_sheet = number; 1a772: 86 e0 ldi r24, 0x06 ; 6 1a774: 80 93 e0 03 sts 0x03E0, r24 ; 0x8003e0 lcd_sheet_menu(); 1a778: 0c 94 6b d3 jmp 0x1a6d6 ; 0x1a6d6 0001a77c ()>: } template static void select_sheet_menu() { selected_sheet = number; 1a77c: 85 e0 ldi r24, 0x05 ; 5 1a77e: 80 93 e0 03 sts 0x03E0, r24 ; 0x8003e0 lcd_sheet_menu(); 1a782: 0c 94 6b d3 jmp 0x1a6d6 ; 0x1a6d6 0001a786 ()>: } template static void select_sheet_menu() { selected_sheet = number; 1a786: 84 e0 ldi r24, 0x04 ; 4 1a788: 80 93 e0 03 sts 0x03E0, r24 ; 0x8003e0 lcd_sheet_menu(); 1a78c: 0c 94 6b d3 jmp 0x1a6d6 ; 0x1a6d6 0001a790 ()>: } template static void select_sheet_menu() { selected_sheet = number; 1a790: 83 e0 ldi r24, 0x03 ; 3 1a792: 80 93 e0 03 sts 0x03E0, r24 ; 0x8003e0 lcd_sheet_menu(); 1a796: 0c 94 6b d3 jmp 0x1a6d6 ; 0x1a6d6 0001a79a ()>: } template static void select_sheet_menu() { selected_sheet = number; 1a79a: 82 e0 ldi r24, 0x02 ; 2 1a79c: 80 93 e0 03 sts 0x03E0, r24 ; 0x8003e0 lcd_sheet_menu(); 1a7a0: 0c 94 6b d3 jmp 0x1a6d6 ; 0x1a6d6 0001a7a4 ()>: } template static void select_sheet_menu() { selected_sheet = number; 1a7a4: 81 e0 ldi r24, 0x01 ; 1 1a7a6: 80 93 e0 03 sts 0x03E0, r24 ; 0x8003e0 lcd_sheet_menu(); 1a7aa: 0c 94 6b d3 jmp 0x1a6d6 ; 0x1a6d6 0001a7ae ()>: } template static void select_sheet_menu() { selected_sheet = number; 1a7ae: 10 92 e0 03 sts 0x03E0, r1 ; 0x8003e0 lcd_sheet_menu(); 1a7b2: 0c 94 6b d3 jmp 0x1a6d6 ; 0x1a6d6 0001a7b6 : menu_back_if_clicked(); } void lcd_move_menu_axis() { MENU_BEGIN(); 1a7b6: 0f 94 51 d1 call 0x3a2a2 ; 0x3a2a2 1a7ba: 10 92 11 05 sts 0x0511, r1 ; 0x800511 1a7be: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1a7c2: 84 30 cpi r24, 0x04 ; 4 1a7c4: a8 f5 brcc .+106 ; 0x1a830 1a7c6: 10 92 14 05 sts 0x0514, r1 ; 0x800514 MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); 1a7ca: 86 e4 ldi r24, 0x46 ; 70 1a7cc: 98 e4 ldi r25, 0x48 ; 72 1a7ce: 0e 94 c4 72 call 0xe588 ; 0xe588 1a7d2: 0f 94 1c d4 call 0x3a838 ; 0x3a838 MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_X), lcd_move_x); 1a7d6: 80 ea ldi r24, 0xA0 ; 160 1a7d8: 9a e3 ldi r25, 0x3A ; 58 1a7da: 0e 94 c4 72 call 0xe588 ; 0xe588 1a7de: 66 ef ldi r22, 0xF6 ; 246 1a7e0: 7a e3 ldi r23, 0x3A ; 58 1a7e2: 0f 94 cf d3 call 0x3a79e ; 0x3a79e MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_Y), lcd_move_y); 1a7e6: 87 e9 ldi r24, 0x97 ; 151 1a7e8: 9a e3 ldi r25, 0x3A ; 58 1a7ea: 0e 94 c4 72 call 0xe588 ; 0xe588 1a7ee: 6e ef ldi r22, 0xFE ; 254 1a7f0: 7a e3 ldi r23, 0x3A ; 58 1a7f2: 0f 94 cf d3 call 0x3a79e ; 0x3a79e MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_Z), lcd_move_z); 1a7f6: 8e e8 ldi r24, 0x8E ; 142 1a7f8: 9a e3 ldi r25, 0x3A ; 58 1a7fa: 0e 94 c4 72 call 0xe588 ; 0xe588 1a7fe: 64 e2 ldi r22, 0x24 ; 36 1a800: 7b e3 ldi r23, 0x3B ; 59 1a802: 0f 94 cf d3 call 0x3a79e ; 0x3a79e MENU_ITEM_SUBMENU_P(_T(MSG_EXTRUDER), lcd_move_e); 1a806: 83 e8 ldi r24, 0x83 ; 131 1a808: 9a e3 ldi r25, 0x3A ; 58 1a80a: 0e 94 c4 72 call 0xe588 ; 0xe588 1a80e: 62 e0 ldi r22, 0x02 ; 2 1a810: 7b e3 ldi r23, 0x3B ; 59 1a812: 0f 94 cf d3 call 0x3a79e ; 0x3a79e MENU_END(); 1a816: 0f 94 25 d1 call 0x3a24a ; 0x3a24a menu_back_if_clicked(); } void lcd_move_menu_axis() { MENU_BEGIN(); 1a81a: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1a81e: 8f 5f subi r24, 0xFF ; 255 1a820: 80 93 11 05 sts 0x0511, r24 ; 0x800511 1a824: 80 91 13 05 lds r24, 0x0513 ; 0x800513 1a828: 8f 5f subi r24, 0xFF ; 255 1a82a: 80 93 13 05 sts 0x0513, r24 ; 0x800513 1a82e: c7 cf rjmp .-114 ; 0x1a7be 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(); } 1a830: 08 95 ret 0001a832 : } } static void lcd_checking_menu(void) { MENU_BEGIN(); 1a832: 0f 94 51 d1 call 0x3a2a2 ; 0x3a2a2 1a836: 10 92 11 05 sts 0x0511, r1 ; 0x800511 1a83a: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1a83e: 84 30 cpi r24, 0x04 ; 4 1a840: d8 f5 brcc .+118 ; 0x1a8b8 1a842: 10 92 14 05 sts 0x0514, r1 ; 0x800514 MENU_ITEM_BACK_P(_T(MSG_HW_SETUP)); 1a846: 86 ed ldi r24, 0xD6 ; 214 1a848: 94 e4 ldi r25, 0x44 ; 68 1a84a: 0e 94 c4 72 call 0xe588 ; 0xe588 1a84e: 0f 94 1c d4 call 0x3a838 ; 0x3a838 settings_check_toggle(&oCheckMode, _T(MSG_NOZZLE), lcd_check_mode_set); 1a852: 80 e1 ldi r24, 0x10 ; 16 1a854: 94 e4 ldi r25, 0x44 ; 68 1a856: 0e 94 c4 72 call 0xe588 ; 0xe588 1a85a: 4a ea ldi r20, 0xAA ; 170 1a85c: 5f ec ldi r21, 0xCF ; 207 1a85e: bc 01 movw r22, r24 1a860: 80 91 eb 04 lds r24, 0x04EB ; 0x8004eb 1a864: 0e 94 ec d0 call 0x1a1d8 ; 0x1a1d8 settings_check_toggle(&oCheckModel, _T(MSG_MODEL), lcd_check_model_set); 1a868: 88 e0 ldi r24, 0x08 ; 8 1a86a: 94 e4 ldi r25, 0x44 ; 68 1a86c: 0e 94 c4 72 call 0xe588 ; 0xe588 1a870: 40 ea ldi r20, 0xA0 ; 160 1a872: 5f ec ldi r21, 0xCF ; 207 1a874: bc 01 movw r22, r24 1a876: 80 91 e9 04 lds r24, 0x04E9 ; 0x8004e9 1a87a: 0e 94 ec d0 call 0x1a1d8 ; 0x1a1d8 settings_check_toggle(&oCheckVersion, MSG_FIRMWARE, lcd_check_version_set); 1a87e: 46 e9 ldi r20, 0x96 ; 150 1a880: 5f ec ldi r21, 0xCF ; 207 1a882: 66 ed ldi r22, 0xD6 ; 214 1a884: 7a e6 ldi r23, 0x6A ; 106 1a886: 80 91 e8 04 lds r24, 0x04E8 ; 0x8004e8 1a88a: 0e 94 ec d0 call 0x1a1d8 ; 0x1a1d8 settings_check_toggle(&oCheckFilament, MSG_FILAMENT, lcd_check_filament_set); 1a88e: 4c e8 ldi r20, 0x8C ; 140 1a890: 5f ec ldi r21, 0xCF ; 207 1a892: 68 ef ldi r22, 0xF8 ; 248 1a894: 7d e6 ldi r23, 0x6D ; 109 1a896: 80 91 e6 04 lds r24, 0x04E6 ; 0x8004e6 1a89a: 0e 94 ec d0 call 0x1a1d8 ; 0x1a1d8 MENU_END(); 1a89e: 0f 94 25 d1 call 0x3a24a ; 0x3a24a } } static void lcd_checking_menu(void) { MENU_BEGIN(); 1a8a2: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1a8a6: 8f 5f subi r24, 0xFF ; 255 1a8a8: 80 93 11 05 sts 0x0511, r24 ; 0x800511 1a8ac: 80 91 13 05 lds r24, 0x0513 ; 0x800513 1a8b0: 8f 5f subi r24, 0xFF ; 255 1a8b2: 80 93 13 05 sts 0x0513, r24 ; 0x800513 1a8b6: c1 cf rjmp .-126 ; 0x1a83a 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(); } 1a8b8: 08 95 ret 0001a8ba : value = !value; eeprom_update_byte_notify((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT, value); } void lcd_reprint_from_eeprom() { restore_file_from_sd(); 1a8ba: 0e 94 f3 88 call 0x111e6 ; 0x111e6 // M24: Start/resume SD print enquecommand_P(MSG_M24); 1a8be: 61 e0 ldi r22, 0x01 ; 1 1a8c0: 81 e3 ldi r24, 0x31 ; 49 1a8c2: 91 e7 ldi r25, 0x71 ; 113 1a8c4: 0e 94 38 88 call 0x11070 ; 0x11070 lcd_return_to_status(); 1a8c8: 0d 94 7c 1e jmp 0x23cf8 ; 0x23cf8 0001a8cc : { return lcd_status_message_level; } void menu_lcd_longpress_func(void) { 1a8cc: cf 93 push r28 1a8ce: df 93 push r29 // Wake up the LCD backlight and, // start LCD inactivity timer lcd_timeoutToStatus.start(); 1a8d0: 8a ed ldi r24, 0xDA ; 218 1a8d2: 93 e0 ldi r25, 0x03 ; 3 1a8d4: 0f 94 c5 2b call 0x2578a ; 0x2578a ::start()> if (homing_flag || mesh_bed_leveling_flag || menu_menu == lcd_babystep_z || menu_menu == lcd_move_z || menu_is_any_block() || Stopped) 1a8d8: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 1a8dc: 81 11 cpse r24, r1 1a8de: 18 c0 rjmp .+48 ; 0x1a910 1a8e0: 80 91 a7 0d lds r24, 0x0DA7 ; 0x800da7 1a8e4: 81 11 cpse r24, r1 1a8e6: 14 c0 rjmp .+40 ; 0x1a910 1a8e8: c0 91 12 04 lds r28, 0x0412 ; 0x800412 1a8ec: d0 91 13 04 lds r29, 0x0413 ; 0x800413 1a8f0: 89 e3 ldi r24, 0x39 ; 57 1a8f2: ca 37 cpi r28, 0x7A ; 122 1a8f4: d8 07 cpc r29, r24 1a8f6: 61 f0 breq .+24 ; 0x1a910 1a8f8: 8b e3 ldi r24, 0x3B ; 59 1a8fa: c4 32 cpi r28, 0x24 ; 36 1a8fc: d8 07 cpc r29, r24 1a8fe: 41 f0 breq .+16 ; 0x1a910 1a900: 80 91 d4 03 lds r24, 0x03D4 ; 0x8003d4 1a904: 81 11 cpse r24, r1 1a906: 04 c0 rjmp .+8 ; 0x1a910 1a908: 80 91 10 05 lds r24, 0x0510 ; 0x800510 1a90c: 88 23 and r24, r24 1a90e: 31 f0 breq .+12 ; 0x1a91c { // disable longpress during re-entry, while homing, calibration or if a serious error lcd_draw_update = 2; 1a910: 82 e0 ldi r24, 0x02 ; 2 1a912: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 1a916: df 91 pop r29 1a918: cf 91 pop r28 1a91a: 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) 1a91c: 81 ed ldi r24, 0xD1 ; 209 1a91e: c1 3d cpi r28, 0xD1 ; 209 1a920: d8 07 cpc r29, r24 1a922: 49 f4 brne .+18 ; 0x1a936 { // only toggle the experimental menu visibility flag lcd_draw_update = 2; 1a924: 82 e0 ldi r24, 0x02 ; 2 1a926: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d eeprom_toggle((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY); 1a92a: 8a e2 ldi r24, 0x2A ; 42 1a92c: 9d e0 ldi r25, 0x0D ; 13 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 1a92e: df 91 pop r29 1a930: cf 91 pop r28 } if (menu_menu == lcd_hw_setup_menu) { // only toggle the experimental menu visibility flag lcd_draw_update = 2; eeprom_toggle((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY); 1a932: 0c 94 4c 76 jmp 0xec98 ; 0xec98 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); 1a936: 90 91 a4 0d lds r25, 0x0DA4 ; 0x800da4 1a93a: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 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 1a93e: 98 13 cpse r25, r24 1a940: 04 c0 rjmp .+8 ; 0x1a94a 1a942: 0e 94 a8 67 call 0xcf50 ; 0xcf50 1a946: 88 23 and r24, r24 1a948: 61 f0 breq .+24 ; 0x1a962 if ( babystep_allowed_strict() 1a94a: 0e 94 e3 67 call 0xcfc6 ; 0xcfc6 && (menu_menu == lcd_status_screen // and in listed menus... 1a94e: 81 11 cpse r24, r1 1a950: 10 c0 rjmp .+32 ; 0x1a972 Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); } void lcd_quick_feedback(void) { lcd_draw_update = 2; 1a952: 82 e0 ldi r24, 0x02 ; 2 1a954: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 1a958: 80 e0 ldi r24, 0x00 ; 0 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 1a95a: df 91 pop r29 1a95c: cf 91 pop r28 1a95e: 0d 94 c2 4d jmp 0x29b84 ; 0x29b84 menu_submenu(lcd_babystep_z); } else { lcd_quick_feedback(); } } else { // long press as move-z if (menu_menu == lcd_status_screen 1a962: 8a e3 ldi r24, 0x3A ; 58 1a964: c6 34 cpi r28, 0x46 ; 70 1a966: d8 07 cpc r29, r24 1a968: e1 f4 brne .+56 ; 0x1a9a2 #if (LANG_MODE != 0) || menu_menu == lcd_language #endif || menu_menu == lcd_support_menu ){ menu_submenu(lcd_move_z); 1a96a: 60 e0 ldi r22, 0x00 ; 0 1a96c: 84 e2 ldi r24, 0x24 ; 36 1a96e: 9b e3 ldi r25, 0x3B ; 59 1a970: 14 c0 rjmp .+40 ; 0x1a99a // 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... 1a972: 8a e3 ldi r24, 0x3A ; 58 1a974: c6 34 cpi r28, 0x46 ; 70 1a976: d8 07 cpc r29, r24 1a978: 59 f0 breq .+22 ; 0x1a990 || menu_menu == lcd_main_menu 1a97a: 84 ed ldi r24, 0xD4 ; 212 1a97c: ce 3e cpi r28, 0xEE ; 238 1a97e: d8 07 cpc r29, r24 1a980: 39 f0 breq .+14 ; 0x1a990 || menu_menu == lcd_tune_menu 1a982: 89 ed ldi r24, 0xD9 ; 217 1a984: c6 36 cpi r28, 0x66 ; 102 1a986: d8 07 cpc r29, r24 1a988: 19 f0 breq .+6 ; 0x1a990 || menu_menu == lcd_support_menu 1a98a: c2 53 subi r28, 0x32 ; 50 1a98c: da 43 sbci r29, 0x3A ; 58 1a98e: 09 f7 brne .-62 ; 0x1a952 ) ){ lcd_clear(); 1a990: 0e 94 2b 6f call 0xde56 ; 0xde56 menu_submenu(lcd_babystep_z); 1a994: 60 e0 ldi r22, 0x00 ; 0 1a996: 8a e7 ldi r24, 0x7A ; 122 1a998: 99 e3 ldi r25, 0x39 ; 57 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 1a99a: df 91 pop r29 1a99c: cf 91 pop r28 #if (LANG_MODE != 0) || menu_menu == lcd_language #endif || menu_menu == lcd_support_menu ){ menu_submenu(lcd_move_z); 1a99e: 0d 94 be d2 jmp 0x3a57c ; 0x3a57c } else { lcd_quick_feedback(); } } else { // long press as move-z if (menu_menu == lcd_status_screen || menu_menu == lcd_main_menu 1a9a2: 84 ed ldi r24, 0xD4 ; 212 1a9a4: ce 3e cpi r28, 0xEE ; 238 1a9a6: d8 07 cpc r29, r24 1a9a8: 01 f3 breq .-64 ; 0x1a96a || menu_menu == lcd_preheat_menu 1a9aa: 89 e3 ldi r24, 0x39 ; 57 1a9ac: c2 34 cpi r28, 0x42 ; 66 1a9ae: d8 07 cpc r29, r24 1a9b0: e1 f2 breq .-72 ; 0x1a96a || menu_menu == lcd_sdcard_menu 1a9b2: 81 ef ldi r24, 0xF1 ; 241 1a9b4: c9 34 cpi r28, 0x49 ; 73 1a9b6: d8 07 cpc r29, r24 1a9b8: c1 f2 breq .-80 ; 0x1a96a || menu_menu == lcd_settings_menu 1a9ba: 87 ed ldi r24, 0xD7 ; 215 1a9bc: c1 30 cpi r28, 0x01 ; 1 1a9be: d8 07 cpc r29, r24 1a9c0: a1 f2 breq .-88 ; 0x1a96a || menu_menu == lcd_control_temperature_menu 1a9c2: 89 ed ldi r24, 0xD9 ; 217 1a9c4: c6 34 cpi r28, 0x46 ; 70 1a9c6: d8 07 cpc r29, r24 1a9c8: 81 f2 breq .-96 ; 0x1a96a #if (LANG_MODE != 0) || menu_menu == lcd_language 1a9ca: 8a ed ldi r24, 0xDA ; 218 1a9cc: ca 32 cpi r28, 0x2A ; 42 1a9ce: d8 07 cpc r29, r24 1a9d0: 61 f2 breq .-104 ; 0x1a96a #endif || menu_menu == lcd_support_menu 1a9d2: c2 53 subi r28, 0x32 ; 50 1a9d4: da 43 sbci r29, 0x3A ; 58 1a9d6: 09 f0 breq .+2 ; 0x1a9da 1a9d8: bc cf rjmp .-136 ; 0x1a952 1a9da: c7 cf rjmp .-114 ; 0x1a96a 0001a9dc : //! | Fail stats | allways //! | Fail stats MMU | mmu //! | Support | allways //! @endcode static void lcd_main_menu() { 1a9dc: 1f 93 push r17 1a9de: cf 93 push r28 1a9e0: df 93 push r29 MENU_BEGIN(); 1a9e2: 0f 94 51 d1 call 0x3a2a2 ; 0x3a2a2 1a9e6: 10 92 11 05 sts 0x0511, r1 ; 0x800511 #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); 1a9ea: 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 1a9ec: d1 e0 ldi r29, 0x01 ; 1 //! | Support | allways //! @endcode static void lcd_main_menu() { MENU_BEGIN(); 1a9ee: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1a9f2: 84 30 cpi r24, 0x04 ; 4 1a9f4: 08 f0 brcs .+2 ; 0x1a9f8 1a9f6: 01 c2 rjmp .+1026 ; 0x1adfa 1a9f8: 10 92 14 05 sts 0x0514, r1 ; 0x800514 // Majkl superawesome menu MENU_ITEM_BACK_P(_T(MSG_INFO_SCREEN)); 1a9fc: 84 e6 ldi r24, 0x64 ; 100 1a9fe: 97 e4 ldi r25, 0x47 ; 71 1aa00: 0e 94 c4 72 call 0xe588 ; 0xe588 1aa04: 0f 94 1c d4 call 0x3a838 ; 0x3a838 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)) { 1aa08: 0e 94 f9 67 call 0xcff2 ; 0xcff2 1aa0c: 81 11 cpse r24, r1 1aa0e: 19 c0 rjmp .+50 ; 0x1aa42 1aa10: 0e 94 93 67 call 0xcf26 ; 0xcf26 1aa14: 81 11 cpse r24, r1 1aa16: 15 c0 rjmp .+42 ; 0x1aa42 1aa18: 80 91 e1 03 lds r24, 0x03E1 ; 0x8003e1 1aa1c: 81 11 cpse r24, r1 1aa1e: 11 c0 rjmp .+34 ; 0x1aa42 #include "printer_state.h" static PrinterState printer_state; PrinterState GetPrinterState() { return printer_state; 1aa20: 80 91 b7 0d lds r24, 0x0DB7 ; 0x800db7 <_ZL13printer_state.lto_priv.401> if ((GetPrinterState() == PrinterState::SDPrintingFinished) && card.mounted) { 1aa24: 83 30 cpi r24, 0x03 ; 3 1aa26: 09 f0 breq .+2 ; 0x1aa2a 1aa28: 51 c0 rjmp .+162 ; 0x1aacc 1aa2a: 80 91 90 14 lds r24, 0x1490 ; 0x801490 1aa2e: 88 23 and r24, r24 1aa30: 41 f0 breq .+16 ; 0x1aa42 MENU_ITEM_FUNCTION_P(_T(MSG_REPRINT), lcd_reprint_from_eeprom); 1aa32: 8a e5 ldi r24, 0x5A ; 90 1aa34: 97 e4 ldi r25, 0x47 ; 71 1aa36: 0e 94 c4 72 call 0xe588 ; 0xe588 1aa3a: 6d e5 ldi r22, 0x5D ; 93 1aa3c: 74 ed ldi r23, 0xD4 ; 212 } else if ((GetPrinterState() == PrinterState::HostPrintingFinished) && M79_timer_get_status()) { MENU_ITEM_FUNCTION_P(_T(MSG_REPRINT), lcd_send_action_start); 1aa3e: 0f 94 ce d0 call 0x3a19c ; 0x3a19c } } // Menu is never shown when idle if (babystep_allowed_strict() && (printJobOngoing() || lcd_commands_type == LcdCommands::Layer1Cal)) 1aa42: 0e 94 e3 67 call 0xcfc6 ; 0xcfc6 1aa46: 88 23 and r24, r24 1aa48: 81 f0 breq .+32 ; 0x1aa6a 1aa4a: 0e 94 a8 67 call 0xcf50 ; 0xcf50 1aa4e: 81 11 cpse r24, r1 1aa50: 04 c0 rjmp .+8 ; 0x1aa5a 1aa52: 80 91 b3 0d lds r24, 0x0DB3 ; 0x800db3 1aa56: 84 30 cpi r24, 0x04 ; 4 1aa58: 41 f4 brne .+16 ; 0x1aa6a MENU_ITEM_SUBMENU_P(_T(MSG_BABYSTEP_Z), lcd_babystep_z);//8 1aa5a: 8a e4 ldi r24, 0x4A ; 74 1aa5c: 97 e4 ldi r25, 0x47 ; 71 1aa5e: 0e 94 c4 72 call 0xe588 ; 0xe588 1aa62: 6a e7 ldi r22, 0x7A ; 122 1aa64: 79 e3 ldi r23, 0x39 ; 57 1aa66: 0f 94 cf d3 call 0x3a79e ; 0x3a79e if (farm_mode) MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);//8 if (!printer_recovering()) { 1aa6a: 0e 94 93 67 call 0xcf26 ; 0xcf26 1aa6e: 81 11 cpse r24, r1 1aa70: 61 c0 rjmp .+194 ; 0x1ab34 } //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); 1aa72: 80 91 a4 0d lds r24, 0x0DA4 ; 0x800da4 1aa76: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 1aa7a: 89 1b sub r24, r25 1aa7c: 8f 70 andi r24, 0x0F ; 15 if ( moves_planned() || printer_active() #ifdef FANCHECK || fan_check_error == EFCE_REPORTED 1aa7e: a9 f5 brne .+106 ; 0x1aaea if (farm_mode) MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);//8 if (!printer_recovering()) { if ( moves_planned() || printer_active() 1aa80: 0e 94 f9 67 call 0xcff2 ; 0xcff2 1aa84: 81 11 cpse r24, r1 1aa86: 31 c0 rjmp .+98 ; 0x1aaea #ifdef FANCHECK || fan_check_error == EFCE_REPORTED 1aa88: 80 91 e4 03 lds r24, 0x03E4 ; 0x8003e4 1aa8c: 82 30 cpi r24, 0x02 ; 2 1aa8e: 69 f1 breq .+90 ; 0x1aaea #endif //End FANCHECK ) { MENU_ITEM_SUBMENU_P(_T(MSG_TUNE), lcd_tune_menu); } else if (!Stopped) { 1aa90: 80 91 10 05 lds r24, 0x0510 ; 0x800510 1aa94: 81 11 cpse r24, r1 1aa96: 31 c0 rjmp .+98 ; 0x1aafa MENU_ITEM_SUBMENU_P(_T(MSG_PREHEAT), lcd_preheat_menu); 1aa98: 89 e3 ldi r24, 0x39 ; 57 1aa9a: 97 e4 ldi r25, 0x47 ; 71 1aa9c: 0e 94 c4 72 call 0xe588 ; 0xe588 1aaa0: 62 e4 ldi r22, 0x42 ; 66 1aaa2: 79 e3 ldi r23, 0x39 ; 57 1aaa4: 0f 94 cf d3 call 0x3a79e ; 0x3a79e if (M79_timer_get_status()) { 1aaa8: 80 91 9c 03 lds r24, 0x039C ; 0x80039c <_ZL9M79_timer.lto_priv.450> 1aaac: 88 23 and r24, r24 1aaae: 29 f1 breq .+74 ; 0x1aafa #ifndef REPLACE_SETREADY if(GetPrinterState() == PrinterState::IsReady) { 1aab0: 80 91 b7 0d lds r24, 0x0DB7 ; 0x800db7 <_ZL13printer_state.lto_priv.401> 1aab4: 81 30 cpi r24, 0x01 ; 1 1aab6: 09 f0 breq .+2 ; 0x1aaba 1aab8: 7e c0 rjmp .+252 ; 0x1abb6 MENU_ITEM_FUNCTION_P(_T(MSG_SET_NOT_READY), lcd_printer_ready_state_toggle); 1aaba: 89 e2 ldi r24, 0x29 ; 41 1aabc: 97 e4 ldi r25, 0x47 ; 71 } else { MENU_ITEM_FUNCTION_P(_T(MSG_SET_READY), lcd_printer_ready_state_toggle); 1aabe: 0e 94 c4 72 call 0xe588 ; 0xe588 1aac2: 66 ee ldi r22, 0xE6 ; 230 1aac4: 7d ec ldi r23, 0xCD ; 205 1aac6: 0f 94 ce d0 call 0x3a19c ; 0x3a19c 1aaca: 17 c0 rjmp .+46 ; 0x1aafa // 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()) { 1aacc: 84 30 cpi r24, 0x04 ; 4 1aace: 09 f0 breq .+2 ; 0x1aad2 1aad0: b8 cf rjmp .-144 ; 0x1aa42 1aad2: 80 91 9c 03 lds r24, 0x039C ; 0x80039c <_ZL9M79_timer.lto_priv.450> 1aad6: 88 23 and r24, r24 1aad8: 09 f4 brne .+2 ; 0x1aadc 1aada: b3 cf rjmp .-154 ; 0x1aa42 MENU_ITEM_FUNCTION_P(_T(MSG_REPRINT), lcd_send_action_start); 1aadc: 8a e5 ldi r24, 0x5A ; 90 1aade: 97 e4 ldi r25, 0x47 ; 71 1aae0: 0e 94 c4 72 call 0xe588 ; 0xe588 1aae4: 60 ee ldi r22, 0xE0 ; 224 1aae6: 7d ec ldi r23, 0xCD ; 205 1aae8: aa cf rjmp .-172 ; 0x1aa3e 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); 1aaea: 83 e4 ldi r24, 0x43 ; 67 1aaec: 97 e4 ldi r25, 0x47 ; 71 1aaee: 0e 94 c4 72 call 0xe588 ; 0xe588 1aaf2: 66 e6 ldi r22, 0x66 ; 102 1aaf4: 79 ed ldi r23, 0xD9 ; 217 1aaf6: 0f 94 cf d3 call 0x3a79e ; 0x3a79e #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) { 1aafa: c0 91 a7 0d lds r28, 0x0DA7 ; 0x800da7 1aafe: 0e 94 9d 67 call 0xcf3a ; 0xcf3a 1ab02: c1 11 cpse r28, r1 1ab04: 17 c0 rjmp .+46 ; 0x1ab34 1ab06: 90 91 a6 0d lds r25, 0x0DA6 ; 0x800da6 1ab0a: 91 11 cpse r25, r1 1ab0c: 13 c0 rjmp .+38 ; 0x1ab34 1ab0e: 81 11 cpse r24, r1 1ab10: 15 c0 rjmp .+42 ; 0x1ab3c 1ab12: 80 91 a1 03 lds r24, 0x03A1 ; 0x8003a1 1ab16: 81 11 cpse r24, r1 1ab18: 0d c0 rjmp .+26 ; 0x1ab34 if (usb_timer.running()) { 1ab1a: 80 91 0d 05 lds r24, 0x050D ; 0x80050d 1ab1e: 88 23 and r24, r24 1ab20: 09 f4 brne .+2 ; 0x1ab24 1ab22: 4c c0 rjmp .+152 ; 0x1abbc MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_usb_print); 1ab24: 8f e0 ldi r24, 0x0F ; 15 1ab26: 97 e4 ldi r25, 0x47 ; 71 1ab28: 0e 94 c4 72 call 0xe588 ; 0xe588 1ab2c: 66 e6 ldi r22, 0x66 ; 102 1ab2e: 7a e3 ldi r23, 0x3A ; 58 } else if (IS_SD_PRINTING) { MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_print); 1ab30: 0f 94 ce d0 call 0x3a19c ; 0x3a19c } } } if (printingIsPaused() 1ab34: 0e 94 9d 67 call 0xcf3a ; 0xcf3a && !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) { 1ab38: 88 23 and r24, r24 1ab3a: f1 f0 breq .+60 ; 0x1ab78 temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; 1ab3c: 80 91 1a 05 lds r24, 0x051A ; 0x80051a <_ZL16temp_error_state.lto_priv.454> } } } if (printingIsPaused() // only allow resuming if hardware errors (temperature or fan) are cleared && !get_temp_error() 1ab40: 81 11 cpse r24, r1 1ab42: 1a c0 rjmp .+52 ; 0x1ab78 #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 1ab44: 80 91 e4 03 lds r24, 0x03E4 ; 0x8003e4 1ab48: 82 30 cpi r24, 0x02 ; 2 1ab4a: b1 f0 breq .+44 ; 0x1ab78 #endif //FANCHECK && (saved_printing_type != PowerPanic::PRINT_TYPE_NONE || saved_printing) 1ab4c: 80 91 6a 02 lds r24, 0x026A ; 0x80026a 1ab50: 82 30 cpi r24, 0x02 ; 2 1ab52: 21 f4 brne .+8 ; 0x1ab5c 1ab54: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 1ab58: 99 23 and r25, r25 1ab5a: 71 f0 breq .+28 ; 0x1ab78 && custom_message_type != CustomMsg::Resuming) { 1ab5c: 90 91 c3 06 lds r25, 0x06C3 ; 0x8006c3 1ab60: 98 30 cpi r25, 0x08 ; 8 1ab62: 51 f0 breq .+20 ; 0x1ab78 if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) { 1ab64: 81 11 cpse r24, r1 1ab66: 36 c0 rjmp .+108 ; 0x1abd4 MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_print); 1ab68: 80 e0 ldi r24, 0x00 ; 0 1ab6a: 97 e4 ldi r25, 0x47 ; 71 1ab6c: 0e 94 c4 72 call 0xe588 ; 0xe588 1ab70: 62 ef ldi r22, 0xF2 ; 242 1ab72: 77 ef ldi r23, 0xF7 ; 247 } 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); 1ab74: 0f 94 cf d3 call 0x3a79e ; 0x3a79e } } if((printJobOngoing() || printingIsPaused() || (printer_recovering())) 1ab78: 0e 94 a8 67 call 0xcf50 ; 0xcf50 && (custom_message_type != CustomMsg::MeshBedLeveling) && !processing_tcode) { 1ab7c: 81 11 cpse r24, r1 1ab7e: 08 c0 rjmp .+16 ; 0x1ab90 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())) 1ab80: 0e 94 9d 67 call 0xcf3a ; 0xcf3a 1ab84: 81 11 cpse r24, r1 1ab86: 04 c0 rjmp .+8 ; 0x1ab90 1ab88: 0e 94 93 67 call 0xcf26 ; 0xcf26 1ab8c: 88 23 and r24, r24 1ab8e: 41 f0 breq .+16 ; 0x1aba0 && (custom_message_type != CustomMsg::MeshBedLeveling) && !processing_tcode) { 1ab90: 80 91 c3 06 lds r24, 0x06C3 ; 0x8006c3 1ab94: 81 30 cpi r24, 0x01 ; 1 1ab96: 21 f0 breq .+8 ; 0x1aba0 1ab98: 80 91 a1 03 lds r24, 0x03A1 ; 0x8003a1 1ab9c: 88 23 and r24, r24 1ab9e: 39 f1 breq .+78 ; 0x1abee MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop); } #ifdef THERMAL_MODEL else if(Stopped) { 1aba0: 80 91 10 05 lds r24, 0x0510 ; 0x800510 1aba4: 88 23 and r24, r24 1aba6: 59 f1 breq .+86 ; 0x1abfe MENU_ITEM_SUBMENU_P(_T(MSG_TM_ACK_ERROR), lcd_print_stop); 1aba8: 8f ee ldi r24, 0xEF ; 239 1abaa: 96 e4 ldi r25, 0x46 ; 70 1abac: 0e 94 c4 72 call 0xe588 ; 0xe588 1abb0: 68 ec ldi r22, 0xC8 ; 200 1abb2: 74 ef ldi r23, 0xF4 ; 244 1abb4: 22 c0 rjmp .+68 ; 0x1abfa 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); 1abb6: 8d e1 ldi r24, 0x1D ; 29 1abb8: 97 e4 ldi r25, 0x47 ; 71 1abba: 81 cf rjmp .-254 ; 0x1aabe } } 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) { 1abbc: 80 91 8f 14 lds r24, 0x148F ; 0x80148f 1abc0: 88 23 and r24, r24 1abc2: 09 f4 brne .+2 ; 0x1abc6 1abc4: b7 cf rjmp .-146 ; 0x1ab34 MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_print); 1abc6: 8f e0 ldi r24, 0x0F ; 15 1abc8: 97 e4 ldi r25, 0x47 ; 71 1abca: 0e 94 c4 72 call 0xe588 ; 0xe588 1abce: 60 ec ldi r22, 0xC0 ; 192 1abd0: 7a e3 ldi r23, 0x3A ; 58 1abd2: ae cf rjmp .-164 ; 0x1ab30 #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())) { 1abd4: 81 30 cpi r24, 0x01 ; 1 1abd6: 81 f6 brne .-96 ; 0x1ab78 1abd8: 80 91 9c 03 lds r24, 0x039C ; 0x80039c <_ZL9M79_timer.lto_priv.450> 1abdc: 88 23 and r24, r24 1abde: 61 f2 breq .-104 ; 0x1ab78 MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_usb_print); 1abe0: 80 e0 ldi r24, 0x00 ; 0 1abe2: 97 e4 ldi r25, 0x47 ; 71 1abe4: 0e 94 c4 72 call 0xe588 ; 0xe588 1abe8: 61 e2 ldi r22, 0x21 ; 33 1abea: 78 ef ldi r23, 0xF8 ; 248 1abec: c3 cf rjmp .-122 ; 0x1ab74 } } if((printJobOngoing() || printingIsPaused() || (printer_recovering())) && (custom_message_type != CustomMsg::MeshBedLeveling) && !processing_tcode) { MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop); 1abee: 8c e5 ldi r24, 0x5C ; 92 1abf0: 98 e4 ldi r25, 0x48 ; 72 1abf2: 0e 94 c4 72 call 0xe588 ; 0xe588 1abf6: 63 e6 ldi r22, 0x63 ; 99 1abf8: 72 ed ldi r23, 0xD2 ; 210 } #ifdef THERMAL_MODEL else if(Stopped) { MENU_ITEM_SUBMENU_P(_T(MSG_TM_ACK_ERROR), lcd_print_stop); 1abfa: 0f 94 cf d3 call 0x3a79e ; 0x3a79e } #endif // only allow starting SD print if hardware errors (temperature or fan) are cleared if (!printer_recovering() && !printer_active() && !get_temp_error() 1abfe: 0e 94 93 67 call 0xcf26 ; 0xcf26 #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 1ac02: 81 11 cpse r24, r1 1ac04: 91 c0 rjmp .+290 ; 0x1ad28 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() 1ac06: 0e 94 f9 67 call 0xcff2 ; 0xcff2 1ac0a: 81 11 cpse r24, r1 1ac0c: 8d c0 rjmp .+282 ; 0x1ad28 1ac0e: 80 91 1a 05 lds r24, 0x051A ; 0x80051a <_ZL16temp_error_state.lto_priv.454> 1ac12: 81 11 cpse r24, r1 1ac14: 89 c0 rjmp .+274 ; 0x1ad28 #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 1ac16: 80 91 e4 03 lds r24, 0x03E4 ; 0x8003e4 1ac1a: 82 30 cpi r24, 0x02 ; 2 1ac1c: 09 f4 brne .+2 ; 0x1ac20 1ac1e: 84 c0 rjmp .+264 ; 0x1ad28 #endif //FANCHECK ) { #ifdef SDSUPPORT //!@todo SDSUPPORT undefined creates several issues in source code if (card.mounted 1ac20: 80 91 90 14 lds r24, 0x1490 ; 0x801490 1ac24: 81 11 cpse r24, r1 1ac26: 05 c0 rjmp .+10 ; 0x1ac32 || lcd_commands_type != LcdCommands::Idle) { 1ac28: 80 91 b3 0d lds r24, 0x0DB3 ; 0x800db3 1ac2c: 88 23 and r24, r24 1ac2e: 09 f4 brne .+2 ; 0x1ac32 1ac30: ac c0 rjmp .+344 ; 0x1ad8a if (!card.isFileOpen()) { 1ac32: 80 91 22 17 lds r24, 0x1722 ; 0x801722 1ac36: 81 11 cpse r24, r1 1ac38: 12 c0 rjmp .+36 ; 0x1ac5e if (!usb_timer.running() && (lcd_commands_type == LcdCommands::Idle)) { 1ac3a: 80 91 0d 05 lds r24, 0x050D ; 0x80050d 1ac3e: 81 11 cpse r24, r1 1ac40: 0e c0 rjmp .+28 ; 0x1ac5e 1ac42: 80 91 b3 0d lds r24, 0x0DB3 ; 0x800db3 1ac46: 81 11 cpse r24, r1 1ac48: 0a c0 rjmp .+20 ; 0x1ac5e bMain=true; // flag ('fake parameter') for 'lcd_sdcard_menu()' function 1ac4a: d0 93 df 03 sts 0x03DF, r29 ; 0x8003df MENU_ITEM_SUBMENU_P(_T(MSG_CARD_MENU), lcd_sdcard_menu); 1ac4e: 8f ed ldi r24, 0xDF ; 223 1ac50: 96 e4 ldi r25, 0x46 ; 70 1ac52: 0e 94 c4 72 call 0xe588 ; 0xe588 1ac56: 69 e4 ldi r22, 0x49 ; 73 1ac58: 71 ef ldi r23, 0xF1 ; 241 1ac5a: 0f 94 cf d3 call 0x3a79e ; 0x3a79e 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) { const int8_t sheet = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 1ac5e: 81 ea ldi r24, 0xA1 ; 161 1ac60: 9d e0 ldi r25, 0x0D ; 13 1ac62: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 1ac66: c8 2f mov r28, r24 const int8_t nextSheet = eeprom_next_initialized_sheet(sheet); 1ac68: 0e 94 67 76 call 0xecce ; 0xecce if ((nextSheet >= 0) && (sheet != nextSheet)) { // show menu only if we have 2 or more sheets initialized 1ac6c: 87 fd sbrc r24, 7 1ac6e: 09 c0 rjmp .+18 ; 0x1ac82 1ac70: c8 17 cp r28, r24 1ac72: 39 f0 breq .+14 ; 0x1ac82 MENU_ITEM_FUNCTION_E(EEPROM_Sheets_base->s[sheet], eeprom_switch_to_next_sheet); 1ac74: c1 02 muls r28, r17 1ac76: c0 01 movw r24, r0 1ac78: 11 24 eor r1, r1 1ac7a: 87 5b subi r24, 0xB7 ; 183 1ac7c: 92 4f sbci r25, 0xF2 ; 242 1ac7e: 0e 94 17 ce call 0x19c2e ; 0x19c2e SETTINGS_NOZZLE; #endif //QUICK_NOZZLE_CHANGE } if (!((eFilamentAction != FilamentAction::None) || Stopped )) { 1ac82: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 1ac86: 81 11 cpse r24, r1 1ac88: 4f c0 rjmp .+158 ; 0x1ad28 1ac8a: 80 91 10 05 lds r24, 0x0510 ; 0x800510 1ac8e: 81 11 cpse r24, r1 1ac90: 4b c0 rjmp .+150 ; 0x1ad28 if (MMU2::mmu2.Enabled()) { 1ac92: 80 91 b9 13 lds r24, 0x13B9 ; 0x8013b9 1ac96: 81 30 cpi r24, 0x01 ; 1 1ac98: 09 f0 breq .+2 ; 0x1ac9c 1ac9a: 80 c0 rjmp .+256 ; 0x1ad9c if(!MMU2::mmu2.FindaDetectsFilament() && !fsensor.getFilamentPresent()) { 1ac9c: 80 91 8f 13 lds r24, 0x138F ; 0x80138f 1aca0: 81 11 cpse r24, r1 1aca2: 0c c0 rjmp .+24 ; 0x1acbc 1aca4: 80 91 b6 17 lds r24, 0x17B6 ; 0x8017b6 1aca8: 81 11 cpse r24, r1 1acaa: 08 c0 rjmp .+16 ; 0x1acbc // 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); 1acac: 81 ec ldi r24, 0xC1 ; 193 1acae: 96 e4 ldi r25, 0x46 ; 70 1acb0: 0e 94 c4 72 call 0xe588 ; 0xe588 1acb4: 65 e6 ldi r22, 0x65 ; 101 1acb6: 70 ee ldi r23, 0xE0 ; 224 1acb8: 0f 94 cf d3 call 0x3a79e ; 0x3a79e } MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_TO_NOZZLE), lcd_mmuLoadFilament); 1acbc: 80 eb ldi r24, 0xB0 ; 176 1acbe: 96 e4 ldi r25, 0x46 ; 70 1acc0: 0e 94 c4 72 call 0xe588 ; 0xe588 1acc4: 6c e9 ldi r22, 0x9C ; 156 1acc6: 70 ee ldi r23, 0xE0 ; 224 1acc8: 0f 94 cf d3 call 0x3a79e ; 0x3a79e MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_mmuUnloadFilament); 1accc: 8e e9 ldi r24, 0x9E ; 158 1acce: 96 e4 ldi r25, 0x46 ; 70 1acd0: 0e 94 c4 72 call 0xe588 ; 0xe588 1acd4: 6f e9 ldi r22, 0x9F ; 159 1acd6: 70 ee ldi r23, 0xE0 ; 224 1acd8: 0f 94 cf d3 call 0x3a79e ; 0x3a79e MENU_ITEM_SUBMENU_P(_T(MSG_EJECT_FROM_MMU), lcd_mmuEjectFilament); 1acdc: 80 e6 ldi r24, 0x60 ; 96 1acde: 9c e5 ldi r25, 0x5C ; 92 1ace0: 0e 94 c4 72 call 0xe588 ; 0xe588 1ace4: 62 ea ldi r22, 0xA2 ; 162 1ace6: 70 ee ldi r23, 0xE0 ; 224 1ace8: 0f 94 cf d3 call 0x3a79e ; 0x3a79e #ifdef MMU_HAS_CUTTER if (eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED) != 0) { 1acec: 8e ec ldi r24, 0xCE ; 206 1acee: 9e e0 ldi r25, 0x0E ; 14 1acf0: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 1acf4: 88 23 and r24, r24 1acf6: 41 f0 breq .+16 ; 0x1ad08 MENU_ITEM_SUBMENU_P(_T(MSG_CUT_FILAMENT), lcd_mmuCutFilament); 1acf8: 81 e5 ldi r24, 0x51 ; 81 1acfa: 9c e5 ldi r25, 0x5C ; 92 1acfc: 0e 94 c4 72 call 0xe588 ; 0xe588 1ad00: 65 ea ldi r22, 0xA5 ; 165 1ad02: 70 ee ldi r23, 0xE0 ; 224 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); 1ad04: 0f 94 cf d3 call 0x3a79e ; 0x3a79e #ifdef FILAMENT_SENSOR } #endif //FILAMENT_SENSOR } MENU_ITEM_SUBMENU_P(_T(MSG_SETTINGS), lcd_settings_menu); 1ad08: 86 e4 ldi r24, 0x46 ; 70 1ad0a: 98 e4 ldi r25, 0x48 ; 72 1ad0c: 0e 94 c4 72 call 0xe588 ; 0xe588 1ad10: 61 e0 ldi r22, 0x01 ; 1 1ad12: 77 ed ldi r23, 0xD7 ; 215 1ad14: 0f 94 cf d3 call 0x3a79e ; 0x3a79e MENU_ITEM_SUBMENU_P(_T(MSG_CALIBRATION), lcd_calibration_menu); 1ad18: 8c e6 ldi r24, 0x6C ; 108 1ad1a: 96 e4 ldi r25, 0x46 ; 70 1ad1c: 0e 94 c4 72 call 0xe588 ; 0xe588 1ad20: 64 e7 ldi r22, 0x74 ; 116 1ad22: 78 ed ldi r23, 0xD8 ; 216 1ad24: 0f 94 cf d3 call 0x3a79e ; 0x3a79e } } MENU_ITEM_SUBMENU_P(_T(MSG_STATISTICS), lcd_menu_statistics); 1ad28: 8f e5 ldi r24, 0x5F ; 95 1ad2a: 96 e4 ldi r25, 0x46 ; 70 1ad2c: 0e 94 c4 72 call 0xe588 ; 0xe588 1ad30: 60 e1 ldi r22, 0x10 ; 16 1ad32: 7a e3 ldi r23, 0x3A ; 58 1ad34: 0f 94 cf d3 call 0x3a79e ; 0x3a79e #if defined(TMC2130) || defined(FILAMENT_SENSOR) MENU_ITEM_SUBMENU_P(_T(MSG_FAIL_STATS), lcd_menu_fails_stats); 1ad38: 82 e5 ldi r24, 0x52 ; 82 1ad3a: 96 e4 ldi r25, 0x46 ; 70 1ad3c: 0e 94 c4 72 call 0xe588 ; 0xe588 1ad40: 64 e6 ldi r22, 0x64 ; 100 1ad42: 7a e3 ldi r23, 0x3A ; 58 1ad44: 0f 94 cf d3 call 0x3a79e ; 0x3a79e #endif if (MMU2::mmu2.Enabled()) { 1ad48: 80 91 b9 13 lds r24, 0x13B9 ; 0x8013b9 1ad4c: 81 30 cpi r24, 0x01 ; 1 1ad4e: 41 f4 brne .+16 ; 0x1ad60 MENU_ITEM_SUBMENU_P(_T(MSG_MMU_FAIL_STATS), lcd_menu_fails_stats_mmu); 1ad50: 81 e4 ldi r24, 0x41 ; 65 1ad52: 96 e4 ldi r25, 0x46 ; 70 1ad54: 0e 94 c4 72 call 0xe588 ; 0xe588 1ad58: 64 ea ldi r22, 0xA4 ; 164 1ad5a: 7a e3 ldi r23, 0x3A ; 58 1ad5c: 0f 94 cf d3 call 0x3a79e ; 0x3a79e 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); 1ad60: 87 e3 ldi r24, 0x37 ; 55 1ad62: 96 e4 ldi r25, 0x46 ; 70 1ad64: 0e 94 c4 72 call 0xe588 ; 0xe588 1ad68: 62 e3 ldi r22, 0x32 ; 50 1ad6a: 7a e3 ldi r23, 0x3A ; 58 1ad6c: 0f 94 cf d3 call 0x3a79e ; 0x3a79e MENU_END(); 1ad70: 0f 94 25 d1 call 0x3a24a ; 0x3a24a //! | Support | allways //! @endcode static void lcd_main_menu() { MENU_BEGIN(); 1ad74: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1ad78: 8f 5f subi r24, 0xFF ; 255 1ad7a: 80 93 11 05 sts 0x0511, r24 ; 0x800511 1ad7e: 80 91 13 05 lds r24, 0x0513 ; 0x800513 1ad82: 8f 5f subi r24, 0xFF ; 255 1ad84: 80 93 13 05 sts 0x0513, r24 ; 0x800513 1ad88: 32 ce rjmp .-924 ; 0x1a9ee #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 1ad8a: d0 93 df 03 sts 0x03DF, r29 ; 0x8003df MENU_ITEM_BACK_P(_T(MSG_NO_CARD)); 1ad8e: 82 ed ldi r24, 0xD2 ; 210 1ad90: 96 e4 ldi r25, 0x46 ; 70 1ad92: 0e 94 c4 72 call 0xe588 ; 0xe588 1ad96: 0f 94 1c d4 call 0x3a838 ; 0x3a838 1ad9a: 61 cf rjmp .-318 ; 0x1ac5e MENU_ITEM_SUBMENU_P(_T(MSG_CUT_FILAMENT), lcd_mmuCutFilament); } #endif //MMU_HAS_CUTTER } else { #ifdef FILAMENT_SENSOR if (fsensor.isEnabled()) { 1ad9c: 80 91 a9 17 lds r24, 0x17A9 ; 0x8017a9 1ada0: 88 23 and r24, r24 1ada2: e1 f0 breq .+56 ; 0x1addc if (!fsensor.getAutoLoadEnabled()) { 1ada4: 80 91 aa 17 lds r24, 0x17AA ; 0x8017aa 1ada8: 81 11 cpse r24, r1 1adaa: 08 c0 rjmp .+16 ; 0x1adbc MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_FILAMENT), lcd_LoadFilament); 1adac: 8e e8 ldi r24, 0x8E ; 142 1adae: 96 e4 ldi r25, 0x46 ; 70 1adb0: 0e 94 c4 72 call 0xe588 ; 0xe588 1adb4: 6e e3 ldi r22, 0x3E ; 62 1adb6: 7a e3 ldi r23, 0x3A ; 58 1adb8: 0f 94 cf d3 call 0x3a79e ; 0x3a79e } if (!fsensor.getFilamentPresent()) { 1adbc: 80 91 b6 17 lds r24, 0x17B6 ; 0x8017b6 1adc0: 81 11 cpse r24, r1 1adc2: 14 c0 rjmp .+40 ; 0x1adec if (fsensor.getAutoLoadEnabled()) { 1adc4: 80 91 aa 17 lds r24, 0x17AA ; 0x8017aa 1adc8: 88 23 and r24, r24 1adca: 09 f4 brne .+2 ; 0x1adce 1adcc: 9d cf rjmp .-198 ; 0x1ad08 MENU_ITEM_SUBMENU_P(_T(MSG_AUTOLOAD_FILAMENT), lcd_menu_AutoLoadFilament); 1adce: 8a e7 ldi r24, 0x7A ; 122 1add0: 96 e4 ldi r25, 0x46 ; 70 1add2: 0e 94 c4 72 call 0xe588 ; 0xe588 1add6: 60 e1 ldi r22, 0x10 ; 16 1add8: 7b e3 ldi r23, 0x3B ; 59 1adda: 94 cf rjmp .-216 ; 0x1ad04 } 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); 1addc: 8e e8 ldi r24, 0x8E ; 142 1adde: 96 e4 ldi r25, 0x46 ; 70 1ade0: 0e 94 c4 72 call 0xe588 ; 0xe588 1ade4: 6e e3 ldi r22, 0x3E ; 62 1ade6: 7a e3 ldi r23, 0x3A ; 58 1ade8: 0f 94 cf d3 call 0x3a79e ; 0x3a79e MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_unLoadFilament); 1adec: 8e e9 ldi r24, 0x9E ; 158 1adee: 96 e4 ldi r25, 0x46 ; 70 1adf0: 0e 94 c4 72 call 0xe588 ; 0xe588 1adf4: 6c ec ldi r22, 0xCC ; 204 1adf6: 7a e3 ldi r23, 0x3A ; 58 1adf8: 85 cf rjmp .-246 ; 0x1ad04 #endif //HOST_SHUTOWN MENU_ITEM_SUBMENU_P(_T(MSG_SUPPORT), lcd_support_menu); MENU_END(); } 1adfa: df 91 pop r29 1adfc: cf 91 pop r28 1adfe: 1f 91 pop r17 1ae00: 08 95 ret 0001ae02 : MENU_END(); } static void lcd_settings_menu() { 1ae02: 1f 93 push r17 1ae04: cf 93 push r28 1ae06: df 93 push r29 SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); 1ae08: 8f ef ldi r24, 0xFF ; 255 1ae0a: 9f e0 ldi r25, 0x0F ; 15 1ae0c: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 1ae10: 80 93 a2 03 sts 0x03A2, r24 ; 0x8003a2 MENU_BEGIN(); 1ae14: 0f 94 51 d1 call 0x3a2a2 ; 0x3a2a2 1ae18: 10 92 11 05 sts 0x0511, r1 ; 0x800511 SETTINGS_FANS_CHECK(); SETTINGS_SILENT_MODE(); if(!farm_mode) { bSettings=true; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function 1ae1c: 11 e0 ldi r17, 0x01 ; 1 } static void lcd_settings_menu() { SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 1ae1e: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1ae22: 84 30 cpi r24, 0x04 ; 4 1ae24: 08 f0 brcs .+2 ; 0x1ae28 1ae26: 5c c1 rjmp .+696 ; 0x1b0e0 1ae28: 10 92 14 05 sts 0x0514, r1 ; 0x800514 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1ae2c: 88 ea ldi r24, 0xA8 ; 168 1ae2e: 98 e4 ldi r25, 0x48 ; 72 1ae30: 0e 94 c4 72 call 0xe588 ; 0xe588 1ae34: 0f 94 1c d4 call 0x3a838 ; 0x3a838 MENU_ITEM_SUBMENU_P(_T(MSG_TEMPERATURE), lcd_control_temperature_menu); 1ae38: 8f e0 ldi r24, 0x0F ; 15 1ae3a: 95 e4 ldi r25, 0x45 ; 69 1ae3c: 0e 94 c4 72 call 0xe588 ; 0xe588 1ae40: 66 e4 ldi r22, 0x46 ; 70 1ae42: 79 ed ldi r23, 0xD9 ; 217 1ae44: 0f 94 cf d3 call 0x3a79e ; 0x3a79e if (!printer_active() || printingIsPaused()) 1ae48: 0e 94 f9 67 call 0xcff2 ; 0xcff2 1ae4c: 88 23 and r24, r24 1ae4e: 21 f0 breq .+8 ; 0x1ae58 1ae50: 0e 94 9d 67 call 0xcf3a ; 0xcf3a 1ae54: 88 23 and r24, r24 1ae56: 81 f0 breq .+32 ; 0x1ae78 { MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_AXIS), lcd_move_menu_axis); 1ae58: 83 e0 ldi r24, 0x03 ; 3 1ae5a: 95 e4 ldi r25, 0x45 ; 69 1ae5c: 0e 94 c4 72 call 0xe588 ; 0xe588 1ae60: 6b ed ldi r22, 0xDB ; 219 1ae62: 73 ed ldi r23, 0xD3 ; 211 1ae64: 0f 94 cf d3 call 0x3a79e ; 0x3a79e MENU_ITEM_GCODE_P(_T(MSG_DISABLE_STEPPERS), MSG_M84); 1ae68: 80 ef ldi r24, 0xF0 ; 240 1ae6a: 94 e4 ldi r25, 0x44 ; 68 1ae6c: 0e 94 c4 72 call 0xe588 ; 0xe588 1ae70: 61 e1 ldi r22, 0x11 ; 17 1ae72: 7c e6 ldi r23, 0x6C ; 108 1ae74: 0f 94 47 d0 call 0x3a08e ; 0x3a08e } #ifdef FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_FSENSOR), lcd_fsensor_settings_menu); 1ae78: 87 ea ldi r24, 0xA7 ; 167 1ae7a: 97 e4 ldi r25, 0x47 ; 71 1ae7c: 0e 94 c4 72 call 0xe588 ; 0xe588 1ae80: 60 ea ldi r22, 0xA0 ; 160 1ae82: 72 ed ldi r23, 0xD2 ; 210 1ae84: 0f 94 cf d3 call 0x3a79e ; 0x3a79e #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); 1ae88: 8c ea ldi r24, 0xAC ; 172 1ae8a: 9c e0 ldi r25, 0x0C ; 12 1ae8c: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 1ae90: 88 23 and r24, r24 1ae92: 09 f4 brne .+2 ; 0x1ae96 1ae94: ac c0 rjmp .+344 ; 0x1afee 1ae96: 83 e1 ldi r24, 0x13 ; 19 1ae98: 9d e5 ldi r25, 0x5D ; 93 1ae9a: 0e 94 c4 72 call 0xe588 ; 0xe588 1ae9e: 22 e0 ldi r18, 0x02 ; 2 1aea0: 47 ec ldi r20, 0xC7 ; 199 1aea2: 53 ee ldi r21, 0xE3 ; 227 1aea4: bc 01 movw r22, r24 1aea6: 89 e5 ldi r24, 0x59 ; 89 1aea8: 9a e8 ldi r25, 0x8A ; 138 1aeaa: 0f 94 e0 d2 call 0x3a5c0 ; 0x3a5c0 if (eeprom_read_byte((uint8_t *)EEPROM_MMU_ENABLED)) 1aeae: 8c ea ldi r24, 0xAC ; 172 1aeb0: 9c e0 ldi r25, 0x0C ; 12 1aeb2: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 1aeb6: 88 23 and r24, r24 1aeb8: 31 f0 breq .+12 ; 0x1aec6 { // Communication with MMU not required to reset MMU MENU_ITEM_FUNCTION_P(PSTR("Reset MMU"), []() { MMU2::mmu2.Reset(MMU2::MMU2::ResetForm::Software); }); 1aeba: 60 e9 ldi r22, 0x90 ; 144 1aebc: 79 e3 ldi r23, 0x39 ; 57 1aebe: 8f e4 ldi r24, 0x4F ; 79 1aec0: 9a e8 ldi r25, 0x8A ; 138 1aec2: 0f 94 ce d0 call 0x3a19c ; 0x3a19c } if (MMU2::mmu2.Enabled()) 1aec6: 80 91 b9 13 lds r24, 0x13B9 ; 0x8013b9 1aeca: 81 30 cpi r24, 0x01 ; 1 1aecc: 51 f4 brne .+20 ; 0x1aee2 { // Only show menus when communicating with MMU menuitems_MMU_settings_common(); 1aece: 0e 94 88 d1 call 0x1a310 ; 0x1a310 MENU_ITEM_SUBMENU_P(_T(MSG_LOADING_TEST), lcd_mmuLoadingTest); 1aed2: 81 ee ldi r24, 0xE1 ; 225 1aed4: 94 e4 ldi r25, 0x44 ; 68 1aed6: 0e 94 c4 72 call 0xe588 ; 0xe588 1aeda: 68 ea ldi r22, 0xA8 ; 168 1aedc: 70 ee ldi r23, 0xE0 ; 224 1aede: 0f 94 cf d3 call 0x3a79e ; 0x3a79e } SETTINGS_FANS_CHECK(); 1aee2: 0e 94 0a d1 call 0x1a214 ; 0x1a214 SETTINGS_SILENT_MODE(); 1aee6: 0e 94 24 d1 call 0x1a248 ; 0x1a248 if(!farm_mode) { bSettings=true; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function 1aeea: 10 93 fb 03 sts 0x03FB, r17 ; 0x8003fb MENU_ITEM_SUBMENU_P(_T(MSG_HW_SETUP), lcd_hw_setup_menu); 1aeee: 86 ed ldi r24, 0xD6 ; 214 1aef0: 94 e4 ldi r25, 0x44 ; 68 1aef2: 0e 94 c4 72 call 0xe588 ; 0xe588 1aef6: 61 ed ldi r22, 0xD1 ; 209 1aef8: 71 ed ldi r23, 0xD1 ; 209 1aefa: 0f 94 cf d3 call 0x3a79e ; 0x3a79e } 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); 1aefe: 84 e6 ldi r24, 0x64 ; 100 1af00: 95 e4 ldi r25, 0x45 ; 69 1af02: 0e 94 c4 72 call 0xe588 ; 0xe588 1af06: 6e e2 ldi r22, 0x2E ; 46 1af08: 7a e3 ldi r23, 0x3A ; 58 1af0a: 0f 94 cf d3 call 0x3a79e ; 0x3a79e #if defined (TMC2130) && defined (LINEARITY_CORRECTION) MENU_ITEM_SUBMENU_P(_T(MSG_LIN_CORRECTION), lcd_settings_linearity_correction_menu); 1af0e: 84 ec ldi r24, 0xC4 ; 196 1af10: 94 e4 ldi r25, 0x44 ; 68 1af12: 0e 94 c4 72 call 0xe588 ; 0xe588 1af16: 69 e4 ldi r22, 0x49 ; 73 1af18: 70 ef ldi r23, 0xF0 ; 240 1af1a: 0f 94 cf d3 call 0x3a79e ; 0x3a79e #endif //LINEARITY_CORRECTION && TMC2130 #ifdef PINDA_THERMISTOR if(has_temperature_compensation()) 1af1e: 20 e0 ldi r18, 0x00 ; 0 1af20: 30 e0 ldi r19, 0x00 ; 0 1af22: 40 e2 ldi r20, 0x20 ; 32 1af24: 51 e4 ldi r21, 0x41 ; 65 1af26: 60 91 97 03 lds r22, 0x0397 ; 0x800397 1af2a: 70 91 98 03 lds r23, 0x0398 ; 0x800398 1af2e: 80 91 99 03 lds r24, 0x0399 ; 0x800399 1af32: 90 91 9a 03 lds r25, 0x039A ; 0x80039a 1af36: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 1af3a: 87 fd sbrc r24, 7 1af3c: 16 c0 rjmp .+44 ; 0x1af6a 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); 1af3e: 8f ea ldi r24, 0xAF ; 175 1af40: 9f e0 ldi r25, 0x0F ; 15 1af42: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 1af46: 88 23 and r24, r24 1af48: 09 f4 brne .+2 ; 0x1af4c 1af4a: 54 c0 rjmp .+168 ; 0x1aff4 1af4c: 83 e1 ldi r24, 0x13 ; 19 1af4e: 9d e5 ldi r25, 0x5D ; 93 1af50: 0e 94 c4 72 call 0xe588 ; 0xe588 1af54: ec 01 movw r28, r24 1af56: 8d e1 ldi r24, 0x1D ; 29 1af58: 95 e4 ldi r25, 0x45 ; 69 1af5a: 0e 94 c4 72 call 0xe588 ; 0xe588 1af5e: 22 e0 ldi r18, 0x02 ; 2 1af60: 40 ef ldi r20, 0xF0 ; 240 1af62: 5f ec ldi r21, 0xCF ; 207 1af64: be 01 movw r22, r28 1af66: 0f 94 e0 d2 call 0x3a5c0 ; 0x3a5c0 #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); 1af6a: 80 91 38 05 lds r24, 0x0538 ; 0x800538 1af6e: 81 11 cpse r24, r1 1af70: 44 c0 rjmp .+136 ; 0x1affa 1af72: 8d e0 ldi r24, 0x0D ; 13 1af74: 9d e5 ldi r25, 0x5D ; 93 1af76: 0e 94 c4 72 call 0xe588 ; 0xe588 1af7a: ec 01 movw r28, r24 1af7c: 89 eb ldi r24, 0xB9 ; 185 1af7e: 94 e4 ldi r25, 0x44 ; 68 1af80: 0e 94 c4 72 call 0xe588 ; 0xe588 1af84: 22 e0 ldi r18, 0x02 ; 2 1af86: 4e ed ldi r20, 0xDE ; 222 1af88: 5f ec ldi r21, 0xCF ; 207 1af8a: be 01 movw r22, r28 1af8c: 0f 94 e0 d2 call 0x3a5c0 ; 0x3a5c0 #endif //HAS_SECOND_SERIAL if (!printingIsPaused()) MENU_ITEM_SUBMENU_P(_T(MSG_BABYSTEP_Z), lcd_babystep_z); 1af90: 0e 94 9d 67 call 0xcf3a ; 0xcf3a 1af94: 81 11 cpse r24, r1 1af96: 08 c0 rjmp .+16 ; 0x1afa8 1af98: 8a e4 ldi r24, 0x4A ; 74 1af9a: 97 e4 ldi r25, 0x47 ; 71 1af9c: 0e 94 c4 72 call 0xe588 ; 0xe588 1afa0: 6a e7 ldi r22, 0x7A ; 122 1afa2: 79 e3 ldi r23, 0x39 ; 57 1afa4: 0f 94 cf d3 call 0x3a79e ; 0x3a79e #if (LANG_MODE != 0) MENU_ITEM_SUBMENU_P(_T(MSG_SELECT_LANGUAGE), lcd_language_menu); 1afa8: 87 ea ldi r24, 0xA7 ; 167 1afaa: 94 e4 ldi r25, 0x44 ; 68 1afac: 0e 94 c4 72 call 0xe588 ; 0xe588 1afb0: 6a ea ldi r22, 0xAA ; 170 1afb2: 72 ee ldi r23, 0xE2 ; 226 1afb4: 0f 94 cf d3 call 0x3a79e ; 0x3a79e #endif //(LANG_MODE != 0) if (!farm_mode) { //SD related settings are not available in farm mode if (card.ToshibaFlashAir_isEnabled()) 1afb8: 80 91 00 17 lds r24, 0x1700 ; 0x801700 1afbc: 88 23 and r24, r24 1afbe: 01 f1 breq .+64 ; 0x1b000 MENU_ITEM_TOGGLE_P(_T(MSG_SD_CARD), MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY, lcd_toshiba_flash_air_compatibility_toggle); 1afc0: 8d e9 ldi r24, 0x9D ; 157 1afc2: 94 e4 ldi r25, 0x44 ; 68 1afc4: 0e 94 c4 72 call 0xe588 ; 0xe588 1afc8: 22 e0 ldi r18, 0x02 ; 2 1afca: 44 ed ldi r20, 0xD4 ; 212 1afcc: 5f ec ldi r21, 0xCF ; 207 1afce: 6c ee ldi r22, 0xEC ; 236 1afd0: 7a e6 ldi r23, 0x6A ; 106 else MENU_ITEM_TOGGLE_P(_T(MSG_SD_CARD), _T(MSG_NORMAL), lcd_toshiba_flash_air_compatibility_toggle); 1afd2: 0f 94 e0 d2 call 0x3a5c0 ; 0x3a5c0 #ifdef SDCARD_SORT_ALPHA switch (eeprom_read_byte((uint8_t*) EEPROM_SD_SORT)) { 1afd6: 89 e0 ldi r24, 0x09 ; 9 1afd8: 9f e0 ldi r25, 0x0F ; 15 1afda: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 1afde: 88 23 and r24, r24 1afe0: e9 f0 breq .+58 ; 0x1b01c 1afe2: 81 30 cpi r24, 0x01 ; 1 1afe4: 09 f4 brne .+2 ; 0x1afe8 1afe6: 6d c0 rjmp .+218 ; 0x1b0c2 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); 1afe8: 83 ed ldi r24, 0xD3 ; 211 1afea: 99 e4 ldi r25, 0x49 ; 73 1afec: 19 c0 rjmp .+50 ; 0x1b020 #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); 1afee: 8d e0 ldi r24, 0x0D ; 13 1aff0: 9d e5 ldi r25, 0x5D ; 93 1aff2: 53 cf rjmp .-346 ; 0x1ae9a #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); 1aff4: 8d e0 ldi r24, 0x0D ; 13 1aff6: 9d e5 ldi r25, 0x5D ; 93 1aff8: ab cf rjmp .-170 ; 0x1af50 #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); 1affa: 83 e1 ldi r24, 0x13 ; 19 1affc: 9d e5 ldi r25, 0x5D ; 93 1affe: bb cf rjmp .-138 ; 0x1af76 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); 1b000: 84 e9 ldi r24, 0x94 ; 148 1b002: 94 e4 ldi r25, 0x44 ; 68 1b004: 0e 94 c4 72 call 0xe588 ; 0xe588 1b008: ec 01 movw r28, r24 1b00a: 8d e9 ldi r24, 0x9D ; 157 1b00c: 94 e4 ldi r25, 0x44 ; 68 1b00e: 0e 94 c4 72 call 0xe588 ; 0xe588 1b012: 22 e0 ldi r18, 0x02 ; 2 1b014: 44 ed ldi r20, 0xD4 ; 212 1b016: 5f ec ldi r21, 0xCF ; 207 1b018: be 01 movw r22, r28 1b01a: db cf rjmp .-74 ; 0x1afd2 #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; 1b01c: 8d e8 ldi r24, 0x8D ; 141 1b01e: 94 e4 ldi r25, 0x44 ; 68 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); 1b020: 0e 94 c4 72 call 0xe588 ; 0xe588 1b024: ec 01 movw r28, r24 1b026: 86 e8 ldi r24, 0x86 ; 134 1b028: 94 e4 ldi r25, 0x44 ; 68 1b02a: 0e 94 c4 72 call 0xe588 ; 0xe588 1b02e: 22 e0 ldi r18, 0x02 ; 2 1b030: 42 e1 ldi r20, 0x12 ; 18 1b032: 50 ed ldi r21, 0xD0 ; 208 1b034: be 01 movw r22, r28 1b036: 0f 94 e0 d2 call 0x3a5c0 ; 0x3a5c0 } } #endif //SDCARD_SORT_ALPHA SETTINGS_SOUND; 1b03a: 80 91 dd 04 lds r24, 0x04DD ; 0x8004dd 1b03e: 82 30 cpi r24, 0x02 ; 2 1b040: 09 f4 brne .+2 ; 0x1b044 1b042: 45 c0 rjmp .+138 ; 0x1b0ce 1b044: 83 30 cpi r24, 0x03 ; 3 1b046: 09 f4 brne .+2 ; 0x1b04a 1b048: 45 c0 rjmp .+138 ; 0x1b0d4 1b04a: 81 30 cpi r24, 0x01 ; 1 1b04c: e9 f1 breq .+122 ; 0x1b0c8 1b04e: 80 ea ldi r24, 0xA0 ; 160 1b050: 97 e4 ldi r25, 0x47 ; 71 1b052: 0e 94 c4 72 call 0xe588 ; 0xe588 1b056: ec 01 movw r28, r24 1b058: 88 e9 ldi r24, 0x98 ; 152 1b05a: 97 e4 ldi r25, 0x47 ; 71 1b05c: 0e 94 c4 72 call 0xe588 ; 0xe588 1b060: 22 e0 ldi r18, 0x02 ; 2 1b062: 4b ef ldi r20, 0xFB ; 251 1b064: 5f ec ldi r21, 0xCF ; 207 1b066: be 01 movw r22, r28 1b068: 0f 94 e0 d2 call 0x3a5c0 ; 0x3a5c0 #ifdef LCD_BL_PIN if (backlightSupport) 1b06c: 80 91 01 04 lds r24, 0x0401 ; 0x800401 1b070: 88 23 and r24, r24 1b072: 41 f0 breq .+16 ; 0x1b084 { MENU_ITEM_SUBMENU_P(_T(MSG_BRIGHTNESS), lcd_backlight_menu); 1b074: 82 e7 ldi r24, 0x72 ; 114 1b076: 97 e4 ldi r25, 0x47 ; 71 1b078: 0e 94 c4 72 call 0xe588 ; 0xe588 1b07c: 6c ed ldi r22, 0xDC ; 220 1b07e: 7f ed ldi r23, 0xDF ; 223 1b080: 0f 94 cf d3 call 0x3a79e ; 0x3a79e } #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 1b084: 87 ea ldi r24, 0xA7 ; 167 1b086: 9c e0 ldi r25, 0x0C ; 12 1b088: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 1b08c: 88 23 and r24, r24 1b08e: 29 f1 breq .+74 ; 0x1b0da 1b090: 81 e5 ldi r24, 0x51 ; 81 1b092: 98 e4 ldi r25, 0x48 ; 72 1b094: 0e 94 c4 72 call 0xe588 ; 0xe588 1b098: 22 e0 ldi r18, 0x02 ; 2 1b09a: 47 e4 ldi r20, 0x47 ; 71 1b09c: 5f ec ldi r21, 0xCF ; 207 1b09e: bc 01 movw r22, r24 1b0a0: 8f ed ldi r24, 0xDF ; 223 1b0a2: 9a e6 ldi r25, 0x6A ; 106 1b0a4: 0f 94 e0 d2 call 0x3a5c0 ; 0x3a5c0 if (farm_mode) { MENU_ITEM_FUNCTION_P(PSTR("Disable farm mode"), lcd_disable_farm_mode); } MENU_END(); 1b0a8: 0f 94 25 d1 call 0x3a24a ; 0x3a24a } static void lcd_settings_menu() { SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 1b0ac: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1b0b0: 8f 5f subi r24, 0xFF ; 255 1b0b2: 80 93 11 05 sts 0x0511, r24 ; 0x800511 1b0b6: 80 91 13 05 lds r24, 0x0513 ; 0x800513 1b0ba: 8f 5f subi r24, 0xFF ; 255 1b0bc: 80 93 13 05 sts 0x0513, r24 ; 0x800513 1b0c0: ae ce rjmp .-676 ; 0x1ae1e 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; 1b0c2: 8b e7 ldi r24, 0x7B ; 123 1b0c4: 94 e4 ldi r25, 0x44 ; 68 1b0c6: ac cf rjmp .-168 ; 0x1b020 default: MENU_ITEM_TOGGLE_P(_T(MSG_SORT), _T(MSG_NONE), lcd_sort_type_set); } } #endif //SDCARD_SORT_ALPHA SETTINGS_SOUND; 1b0c8: 81 e9 ldi r24, 0x91 ; 145 1b0ca: 97 e4 ldi r25, 0x47 ; 71 1b0cc: c2 cf rjmp .-124 ; 0x1b052 1b0ce: 88 e8 ldi r24, 0x88 ; 136 1b0d0: 97 e4 ldi r25, 0x47 ; 71 1b0d2: bf cf rjmp .-130 ; 0x1b052 1b0d4: 8f e7 ldi r24, 0x7F ; 127 1b0d6: 97 e4 ldi r25, 0x47 ; 71 1b0d8: bc cf rjmp .-136 ; 0x1b052 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 1b0da: 87 e5 ldi r24, 0x57 ; 87 1b0dc: 98 e4 ldi r25, 0x48 ; 72 1b0de: da cf rjmp .-76 ; 0x1b094 { MENU_ITEM_FUNCTION_P(PSTR("Disable farm mode"), lcd_disable_farm_mode); } MENU_END(); } 1b0e0: df 91 pop r29 1b0e2: cf 91 pop r28 1b0e4: 1f 91 pop r17 1b0e6: 08 95 ret 0001b0e8 : } #endif //TMC2130 static void lcd_calibration_menu() { MENU_BEGIN(); 1b0e8: 0f 94 51 d1 call 0x3a2a2 ; 0x3a2a2 1b0ec: 10 92 11 05 sts 0x0511, r1 ; 0x800511 1b0f0: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1b0f4: 84 30 cpi r24, 0x04 ; 4 1b0f6: 08 f0 brcs .+2 ; 0x1b0fa 1b0f8: 8f c0 rjmp .+286 ; 0x1b218 1b0fa: 10 92 14 05 sts 0x0514, r1 ; 0x800514 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1b0fe: 88 ea ldi r24, 0xA8 ; 168 1b100: 98 e4 ldi r25, 0x48 ; 72 1b102: 0e 94 c4 72 call 0xe588 ; 0xe588 1b106: 0f 94 1c d4 call 0x3a838 ; 0x3a838 MENU_ITEM_FUNCTION_P(_T(MSG_WIZARD), lcd_wizard); 1b10a: 8d ea ldi r24, 0xAD ; 173 1b10c: 95 e4 ldi r25, 0x45 ; 69 1b10e: 0e 94 c4 72 call 0xe588 ; 0xe588 1b112: 62 e8 ldi r22, 0x82 ; 130 1b114: 7a e3 ldi r23, 0x3A ; 58 1b116: 0f 94 ce d0 call 0x3a19c ; 0x3a19c if (lcd_commands_type == LcdCommands::Idle) 1b11a: 80 91 b3 0d lds r24, 0x0DB3 ; 0x800db3 1b11e: 81 11 cpse r24, r1 1b120: 08 c0 rjmp .+16 ; 0x1b132 { MENU_ITEM_SUBMENU_P(_T(MSG_V2_CALIBRATION), lcd_first_layer_calibration_reset); 1b122: 8c e0 ldi r24, 0x0C ; 12 1b124: 96 e4 ldi r25, 0x46 ; 70 1b126: 0e 94 c4 72 call 0xe588 ; 0xe588 1b12a: 67 e8 ldi r22, 0x87 ; 135 1b12c: 7e ee ldi r23, 0xEE ; 238 1b12e: 0f 94 cf d3 call 0x3a79e ; 0x3a79e } MENU_ITEM_GCODE_P(_T(MSG_AUTO_HOME), G28W); 1b132: 85 e4 ldi r24, 0x45 ; 69 1b134: 9c e5 ldi r25, 0x5C ; 92 1b136: 0e 94 c4 72 call 0xe588 ; 0xe588 1b13a: 6e e1 ldi r22, 0x1E ; 30 1b13c: 7c e6 ldi r23, 0x6C ; 108 1b13e: 0f 94 47 d0 call 0x3a08e ; 0x3a08e #ifdef TMC2130 MENU_ITEM_FUNCTION_P(_T(MSG_BELTTEST), lcd_belttest_v); 1b142: 81 ea ldi r24, 0xA1 ; 161 1b144: 95 e4 ldi r25, 0x45 ; 69 1b146: 0e 94 c4 72 call 0xe588 ; 0xe588 1b14a: 63 e2 ldi r22, 0x23 ; 35 1b14c: 7f ed ldi r23, 0xDF ; 223 1b14e: 0f 94 ce d0 call 0x3a19c ; 0x3a19c #endif //TMC2130 MENU_ITEM_FUNCTION_P(_T(MSG_SELFTEST), lcd_selftest_v); 1b152: 86 e9 ldi r24, 0x96 ; 150 1b154: 95 e4 ldi r25, 0x45 ; 69 1b156: 0e 94 c4 72 call 0xe588 ; 0xe588 1b15a: 6a ea ldi r22, 0xAA ; 170 1b15c: 77 ef ldi r23, 0xF7 ; 247 1b15e: 0f 94 ce d0 call 0x3a19c ; 0x3a19c // MK2 MENU_ITEM_FUNCTION_P(_T(MSG_CALIBRATE_BED), lcd_mesh_calibration); 1b162: 86 e8 ldi r24, 0x86 ; 134 1b164: 95 e4 ldi r25, 0x45 ; 69 1b166: 0e 94 c4 72 call 0xe588 ; 0xe588 1b16a: 65 ea ldi r22, 0xA5 ; 165 1b16c: 7e ec ldi r23, 0xCE ; 206 1b16e: 0f 94 ce d0 call 0x3a19c ; 0x3a19c // "Calibrate Z" with storing the reference values to EEPROM. MENU_ITEM_FUNCTION_P(_T(MSG_HOMEYZ), lcd_mesh_calibration_z); 1b172: 88 e7 ldi r24, 0x78 ; 120 1b174: 95 e4 ldi r25, 0x45 ; 69 1b176: 0e 94 c4 72 call 0xe588 ; 0xe588 1b17a: 6c ea ldi r22, 0xAC ; 172 1b17c: 7e ec ldi r23, 0xCE ; 206 1b17e: 0f 94 ce d0 call 0x3a19c ; 0x3a19c MENU_ITEM_SUBMENU_P(_T(MSG_MESH_BED_LEVELING), lcd_mesh_bedleveling); ////MSG_MESH_BED_LEVELING c=18 1b182: 84 e6 ldi r24, 0x64 ; 100 1b184: 95 e4 ldi r25, 0x45 ; 69 1b186: 0e 94 c4 72 call 0xe588 ; 0xe588 1b18a: 63 eb ldi r22, 0xB3 ; 179 1b18c: 7e ec ldi r23, 0xCE ; 206 1b18e: 0f 94 cf d3 call 0x3a79e ; 0x3a79e MENU_ITEM_SUBMENU_P(_T(MSG_BED_CORRECTION_MENU), lcd_adjust_bed); 1b192: 80 e5 ldi r24, 0x50 ; 80 1b194: 95 e4 ldi r25, 0x45 ; 69 1b196: 0e 94 c4 72 call 0xe588 ; 0xe588 1b19a: 6e eb ldi r22, 0xBE ; 190 1b19c: 79 e3 ldi r23, 0x39 ; 57 1b19e: 0f 94 cf d3 call 0x3a79e ; 0x3a79e MENU_ITEM_SUBMENU_P(_T(MSG_PID_EXTRUDER), pid_extruder); 1b1a2: 8e e3 ldi r24, 0x3E ; 62 1b1a4: 95 e4 ldi r25, 0x45 ; 69 1b1a6: 0e 94 c4 72 call 0xe588 ; 0xe588 1b1aa: 6a e1 ldi r22, 0x1A ; 26 1b1ac: 7b e3 ldi r23, 0x3B ; 59 1b1ae: 0f 94 cf d3 call 0x3a79e ; 0x3a79e #ifndef TMC2130 MENU_ITEM_SUBMENU_P(_T(MSG_SHOW_END_STOPS), menu_show_end_stops); #endif MENU_ITEM_GCODE_P(_T(MSG_CALIBRATE_BED_RESET), PSTR("M44")); 1b1b2: 8a e2 ldi r24, 0x2A ; 42 1b1b4: 95 e4 ldi r25, 0x45 ; 69 1b1b6: 0e 94 c4 72 call 0xe588 ; 0xe588 1b1ba: 6d e5 ldi r22, 0x5D ; 93 1b1bc: 7a e8 ldi r23, 0x8A ; 138 1b1be: 0f 94 47 d0 call 0x3a08e ; 0x3a08e #ifdef PINDA_THERMISTOR if(has_temperature_compensation()) 1b1c2: 20 e0 ldi r18, 0x00 ; 0 1b1c4: 30 e0 ldi r19, 0x00 ; 0 1b1c6: 40 e2 ldi r20, 0x20 ; 32 1b1c8: 51 e4 ldi r21, 0x41 ; 65 1b1ca: 60 91 97 03 lds r22, 0x0397 ; 0x800397 1b1ce: 70 91 98 03 lds r23, 0x0398 ; 0x800398 1b1d2: 80 91 99 03 lds r24, 0x0399 ; 0x800399 1b1d6: 90 91 9a 03 lds r25, 0x039A ; 0x80039a 1b1da: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 1b1de: 87 fd sbrc r24, 7 1b1e0: 08 c0 rjmp .+16 ; 0x1b1f2 MENU_ITEM_FUNCTION_P(_T(MSG_PINDA_CALIBRATION), lcd_calibrate_pinda); 1b1e2: 8d e1 ldi r24, 0x1D ; 29 1b1e4: 95 e4 ldi r25, 0x45 ; 69 1b1e6: 0e 94 c4 72 call 0xe588 ; 0xe588 1b1ea: 6a eb ldi r22, 0xBA ; 186 1b1ec: 7e ec ldi r23, 0xCE ; 206 1b1ee: 0f 94 ce d0 call 0x3a19c ; 0x3a19c #endif #ifdef THERMAL_MODEL MENU_ITEM_FUNCTION_P(_n("Thermal Model cal."), lcd_thermal_model_cal); 1b1f2: 6e ec ldi r22, 0xCE ; 206 1b1f4: 7d ec ldi r23, 0xCD ; 205 1b1f6: 85 ef ldi r24, 0xF5 ; 245 1b1f8: 9a e6 ldi r25, 0x6A ; 106 1b1fa: 0f 94 ce d0 call 0x3a19c ; 0x3a19c #endif //THERMAL_MODEL MENU_END(); 1b1fe: 0f 94 25 d1 call 0x3a24a ; 0x3a24a } #endif //TMC2130 static void lcd_calibration_menu() { MENU_BEGIN(); 1b202: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1b206: 8f 5f subi r24, 0xFF ; 255 1b208: 80 93 11 05 sts 0x0511, r24 ; 0x800511 1b20c: 80 91 13 05 lds r24, 0x0513 ; 0x800513 1b210: 8f 5f subi r24, 0xFF ; 255 1b212: 80 93 13 05 sts 0x0513, r24 ; 0x800513 1b216: 6c cf rjmp .-296 ; 0x1b0f0 #ifdef THERMAL_MODEL MENU_ITEM_FUNCTION_P(_n("Thermal Model cal."), lcd_thermal_model_cal); #endif //THERMAL_MODEL MENU_END(); } 1b218: 08 95 ret 0001b21a : } #endif // TMC2130 } } static void menuitems_temperature_common() { 1b21a: ef 92 push r14 1b21c: ff 92 push r15 1b21e: 0f 93 push r16 1b220: 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); 1b222: 80 e1 ldi r24, 0x10 ; 16 1b224: 94 e4 ldi r25, 0x44 ; 68 1b226: 0e 94 c4 72 call 0xe588 ; 0xe588 1b22a: 28 ec ldi r18, 0xC8 ; 200 1b22c: e2 2e mov r14, r18 1b22e: f1 2c mov r15, r1 1b230: 07 e2 ldi r16, 0x27 ; 39 1b232: 11 e0 ldi r17, 0x01 ; 1 1b234: 30 e0 ldi r19, 0x00 ; 0 1b236: 20 e0 ldi r18, 0x00 ; 0 1b238: 40 e1 ldi r20, 0x10 ; 16 1b23a: 65 eb ldi r22, 0xB5 ; 181 1b23c: 7d e0 ldi r23, 0x0D ; 13 1b23e: 0f 94 a1 d1 call 0x3a342 ; 0x3a342 #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); 1b242: 85 ef ldi r24, 0xF5 ; 245 1b244: 93 e4 ldi r25, 0x43 ; 67 1b246: 0e 94 c4 72 call 0xe588 ; 0xe588 1b24a: 32 e3 ldi r19, 0x32 ; 50 1b24c: e3 2e mov r14, r19 1b24e: f1 2c mov r15, r1 1b250: 08 e7 ldi r16, 0x78 ; 120 1b252: 10 e0 ldi r17, 0x00 ; 0 1b254: 30 e0 ldi r19, 0x00 ; 0 1b256: 20 e0 ldi r18, 0x00 ; 0 1b258: 40 e1 ldi r20, 0x10 ; 16 1b25a: 61 e7 ldi r22, 0x71 ; 113 1b25c: 76 e0 ldi r23, 0x06 ; 6 1b25e: 0f 94 a1 d1 call 0x3a342 ; 0x3a342 #endif MENU_ITEM_EDIT_int3_jmp_P(_T(MSG_FAN_SPEED), &fanSpeed, 0, 255, LCD_JUMP_FAN_SPEED); 1b262: 89 ee ldi r24, 0xE9 ; 233 1b264: 93 e4 ldi r25, 0x43 ; 67 1b266: 0e 94 c4 72 call 0xe588 ; 0xe588 1b26a: 4f e7 ldi r20, 0x7F ; 127 1b26c: e4 2e mov r14, r20 1b26e: f1 2c mov r15, r1 1b270: 0f ef ldi r16, 0xFF ; 255 1b272: 10 e0 ldi r17, 0x00 ; 0 1b274: 30 e0 ldi r19, 0x00 ; 0 1b276: 20 e0 ldi r18, 0x00 ; 0 1b278: 48 e0 ldi r20, 0x08 ; 8 1b27a: 65 ee ldi r22, 0xE5 ; 229 1b27c: 73 e0 ldi r23, 0x03 ; 3 1b27e: 0f 94 a1 d1 call 0x3a342 ; 0x3a342 } 1b282: 1f 91 pop r17 1b284: 0f 91 pop r16 1b286: ff 90 pop r15 1b288: ef 90 pop r14 1b28a: 08 95 ret 0001b28c : } #endif //LCD_BL_PIN static void lcd_control_temperature_menu() { MENU_BEGIN(); 1b28c: 0f 94 51 d1 call 0x3a2a2 ; 0x3a2a2 1b290: 10 92 11 05 sts 0x0511, r1 ; 0x800511 1b294: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1b298: 84 30 cpi r24, 0x04 ; 4 1b29a: b8 f4 brcc .+46 ; 0x1b2ca 1b29c: 10 92 14 05 sts 0x0514, r1 ; 0x800514 MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); 1b2a0: 86 e4 ldi r24, 0x46 ; 70 1b2a2: 98 e4 ldi r25, 0x48 ; 72 1b2a4: 0e 94 c4 72 call 0xe588 ; 0xe588 1b2a8: 0f 94 1c d4 call 0x3a838 ; 0x3a838 menuitems_temperature_common(); 1b2ac: 0e 94 0d d9 call 0x1b21a ; 0x1b21a MENU_END(); 1b2b0: 0f 94 25 d1 call 0x3a24a ; 0x3a24a } #endif //LCD_BL_PIN static void lcd_control_temperature_menu() { MENU_BEGIN(); 1b2b4: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1b2b8: 8f 5f subi r24, 0xFF ; 255 1b2ba: 80 93 11 05 sts 0x0511, r24 ; 0x800511 1b2be: 80 91 13 05 lds r24, 0x0513 ; 0x800513 1b2c2: 8f 5f subi r24, 0xFF ; 255 1b2c4: 80 93 13 05 sts 0x0513, r24 ; 0x800513 1b2c8: e5 cf rjmp .-54 ; 0x1b294 MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); menuitems_temperature_common(); MENU_END(); } 1b2ca: 08 95 ret 0001b2cc : #define MENU_ITEM_EDIT_advance_K() do { lcd_advance_K(); } while (0) #endif static void lcd_tune_menu() { 1b2cc: ef 92 push r14 1b2ce: ff 92 push r15 1b2d0: 0f 93 push r16 1b2d2: 1f 93 push r17 1b2d4: cf 93 push r28 1b2d6: df 93 push r29 1b2d8: 80 91 bc 02 lds r24, 0x02BC ; 0x8002bc 1b2dc: 90 91 bd 02 lds r25, 0x02BD ; 0x8002bd //! 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) 1b2e0: 20 91 b4 03 lds r18, 0x03B4 ; 0x8003b4 1b2e4: 21 11 cpse r18, r1 1b2e6: 97 c0 rjmp .+302 ; 0x1b416 { // Menu was entered. Mark the menu as entered and save the current extrudemultiply value. _md->status = 1; 1b2e8: 21 e0 ldi r18, 0x01 ; 1 1b2ea: 20 93 b4 03 sts 0x03B4, r18 ; 0x8003b4 _md->extrudemultiply = extrudemultiply; 1b2ee: 90 93 b6 03 sts 0x03B6, r25 ; 0x8003b6 1b2f2: 80 93 b5 03 sts 0x03B5, r24 ; 0x8003b5 // 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); 1b2f6: 8f ef ldi r24, 0xFF ; 255 1b2f8: 9f e0 ldi r25, 0x0F ; 15 1b2fa: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 1b2fe: 80 93 a2 03 sts 0x03A2, r24 ; 0x8003a2 MENU_BEGIN(); 1b302: 0f 94 51 d1 call 0x3a2a2 ; 0x3a2a2 1b306: 10 92 11 05 sts 0x0511, r1 ; 0x800511 1b30a: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1b30e: 84 30 cpi r24, 0x04 ; 4 1b310: 08 f0 brcs .+2 ; 0x1b314 1b312: 99 c0 rjmp .+306 ; 0x1b446 1b314: 10 92 14 05 sts 0x0514, r1 ; 0x800514 ON_MENU_LEAVE( 1b318: 0f 94 d1 cf call 0x39fa2 ; 0x39fa2 1b31c: 81 11 cpse r24, r1 1b31e: 0e 94 fb 64 call 0xc9f6 ; 0xc9f6 refresh_saved_feedrate_multiplier_in_ram(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1b322: 88 ea ldi r24, 0xA8 ; 168 1b324: 98 e4 ldi r25, 0x48 ; 72 1b326: 0e 94 c4 72 call 0xe588 ; 0xe588 1b32a: 0f 94 1c d4 call 0x3a838 ; 0x3a838 MENU_ITEM_EDIT_int3_P(_T(MSG_SPEED), &feedmultiply, 10, 999); 1b32e: 8e ec ldi r24, 0xCE ; 206 1b330: 97 e4 ldi r25, 0x47 ; 71 1b332: 0e 94 c4 72 call 0xe588 ; 0xe588 1b336: f1 2c mov r15, r1 1b338: e1 2c mov r14, r1 1b33a: 07 ee ldi r16, 0xE7 ; 231 1b33c: 13 e0 ldi r17, 0x03 ; 3 1b33e: 2a e0 ldi r18, 0x0A ; 10 1b340: 30 e0 ldi r19, 0x00 ; 0 1b342: 40 e1 ldi r20, 0x10 ; 16 1b344: 69 e3 ldi r22, 0x39 ; 57 1b346: 72 e0 ldi r23, 0x02 ; 2 1b348: 0f 94 a1 d1 call 0x3a342 ; 0x3a342 menuitems_temperature_common(); 1b34c: 0e 94 0d d9 call 0x1b21a ; 0x1b21a MENU_ITEM_EDIT_int3_P(_T(MSG_FLOW), &extrudemultiply, 10, 999); 1b350: 87 ec ldi r24, 0xC7 ; 199 1b352: 97 e4 ldi r25, 0x47 ; 71 1b354: 0e 94 c4 72 call 0xe588 ; 0xe588 1b358: 2a e0 ldi r18, 0x0A ; 10 1b35a: 30 e0 ldi r19, 0x00 ; 0 1b35c: 40 e1 ldi r20, 0x10 ; 16 1b35e: 6c eb ldi r22, 0xBC ; 188 1b360: 72 e0 ldi r23, 0x02 ; 2 1b362: 0f 94 a1 d1 call 0x3a342 ; 0x3a342 #ifdef LA_LIVE_K MENU_ITEM_EDIT_advance_K(); #endif #ifdef FILAMENTCHANGEENABLE if (!farm_mode) MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change); 1b366: 85 eb ldi r24, 0xB5 ; 181 1b368: 97 e4 ldi r25, 0x47 ; 71 1b36a: 0e 94 c4 72 call 0xe588 ; 0xe588 1b36e: 60 e5 ldi r22, 0x50 ; 80 1b370: 74 ef ldi r23, 0xF4 ; 244 1b372: 0f 94 ce d0 call 0x3a19c ; 0x3a19c #endif if (printingIsPaused()) {// Don't allow rehome if actively printing. Maaaaybe it could work to insert on the fly, seems too risky. 1b376: 0e 94 9d 67 call 0xcf3a ; 0xcf3a 1b37a: 88 23 and r24, r24 1b37c: 41 f0 breq .+16 ; 0x1b38e MENU_ITEM_GCODE_P(_T(MSG_AUTO_HOME),PSTR("G28 XY")); 1b37e: 85 e4 ldi r24, 0x45 ; 69 1b380: 9c e5 ldi r25, 0x5C ; 92 1b382: 0e 94 c4 72 call 0xe588 ; 0xe588 1b386: 61 e6 ldi r22, 0x61 ; 97 1b388: 7a e8 ldi r23, 0x8A ; 138 1b38a: 0f 94 47 d0 call 0x3a08e ; 0x3a08e } #ifdef FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_FSENSOR), lcd_fsensor_settings_menu); 1b38e: 87 ea ldi r24, 0xA7 ; 167 1b390: 97 e4 ldi r25, 0x47 ; 71 1b392: 0e 94 c4 72 call 0xe588 ; 0xe588 1b396: 60 ea ldi r22, 0xA0 ; 160 1b398: 72 ed ldi r23, 0xD2 ; 210 1b39a: 0f 94 cf d3 call 0x3a79e ; 0x3a79e #endif //FILAMENT_SENSOR if (MMU2::mmu2.Enabled()) 1b39e: 80 91 b9 13 lds r24, 0x13B9 ; 0x8013b9 1b3a2: 81 30 cpi r24, 0x01 ; 1 1b3a4: 11 f4 brne .+4 ; 0x1b3aa { menuitems_MMU_settings_common(); 1b3a6: 0e 94 88 d1 call 0x1a310 ; 0x1a310 } SETTINGS_FANS_CHECK(); 1b3aa: 0e 94 0a d1 call 0x1a214 ; 0x1a214 SETTINGS_SILENT_MODE(); 1b3ae: 0e 94 24 d1 call 0x1a248 ; 0x1a248 SETTINGS_SOUND; 1b3b2: 80 91 dd 04 lds r24, 0x04DD ; 0x8004dd 1b3b6: 82 30 cpi r24, 0x02 ; 2 1b3b8: 09 f4 brne .+2 ; 0x1b3bc 1b3ba: 3f c0 rjmp .+126 ; 0x1b43a 1b3bc: 83 30 cpi r24, 0x03 ; 3 1b3be: 09 f4 brne .+2 ; 0x1b3c2 1b3c0: 3f c0 rjmp .+126 ; 0x1b440 1b3c2: 81 30 cpi r24, 0x01 ; 1 1b3c4: b9 f1 breq .+110 ; 0x1b434 1b3c6: 80 ea ldi r24, 0xA0 ; 160 1b3c8: 97 e4 ldi r25, 0x47 ; 71 1b3ca: 0e 94 c4 72 call 0xe588 ; 0xe588 1b3ce: ec 01 movw r28, r24 1b3d0: 88 e9 ldi r24, 0x98 ; 152 1b3d2: 97 e4 ldi r25, 0x47 ; 71 1b3d4: 0e 94 c4 72 call 0xe588 ; 0xe588 1b3d8: 22 e0 ldi r18, 0x02 ; 2 1b3da: 4b ef ldi r20, 0xFB ; 251 1b3dc: 5f ec ldi r21, 0xCF ; 207 1b3de: be 01 movw r22, r28 1b3e0: 0f 94 e0 d2 call 0x3a5c0 ; 0x3a5c0 #ifdef LCD_BL_PIN if (backlightSupport) 1b3e4: 80 91 01 04 lds r24, 0x0401 ; 0x800401 1b3e8: 88 23 and r24, r24 1b3ea: 41 f0 breq .+16 ; 0x1b3fc { MENU_ITEM_SUBMENU_P(_T(MSG_BRIGHTNESS), lcd_backlight_menu); 1b3ec: 82 e7 ldi r24, 0x72 ; 114 1b3ee: 97 e4 ldi r25, 0x47 ; 71 1b3f0: 0e 94 c4 72 call 0xe588 ; 0xe588 1b3f4: 6c ed ldi r22, 0xDC ; 220 1b3f6: 7f ed ldi r23, 0xDF ; 223 1b3f8: 0f 94 cf d3 call 0x3a79e ; 0x3a79e } #endif //LCD_BL_PIN MENU_END(); 1b3fc: 0f 94 25 d1 call 0x3a24a ; 0x3a24a calculate_extruder_multipliers(); } SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 1b400: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1b404: 8f 5f subi r24, 0xFF ; 255 1b406: 80 93 11 05 sts 0x0511, r24 ; 0x800511 1b40a: 80 91 13 05 lds r24, 0x0513 ; 0x800513 1b40e: 8f 5f subi r24, 0xFF ; 255 1b410: 80 93 13 05 sts 0x0513, r24 ; 0x800513 1b414: 7a cf rjmp .-268 ; 0x1b30a { // 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) 1b416: 20 91 b5 03 lds r18, 0x03B5 ; 0x8003b5 1b41a: 30 91 b6 03 lds r19, 0x03B6 ; 0x8003b6 1b41e: 28 17 cp r18, r24 1b420: 39 07 cpc r19, r25 1b422: 09 f4 brne .+2 ; 0x1b426 1b424: 68 cf rjmp .-304 ; 0x1b2f6 { // extrudemultiply has been changed from the child menu. Apply the new value. _md->extrudemultiply = extrudemultiply; 1b426: 90 93 b6 03 sts 0x03B6, r25 ; 0x8003b6 1b42a: 80 93 b5 03 sts 0x03B5, r24 ; 0x8003b5 calculate_extruder_multipliers(); 1b42e: 0e 94 d1 65 call 0xcba2 ; 0xcba2 1b432: 61 cf rjmp .-318 ; 0x1b2f6 menuitems_MMU_settings_common(); } SETTINGS_FANS_CHECK(); SETTINGS_SILENT_MODE(); SETTINGS_SOUND; 1b434: 81 e9 ldi r24, 0x91 ; 145 1b436: 97 e4 ldi r25, 0x47 ; 71 1b438: c8 cf rjmp .-112 ; 0x1b3ca 1b43a: 88 e8 ldi r24, 0x88 ; 136 1b43c: 97 e4 ldi r25, 0x47 ; 71 1b43e: c5 cf rjmp .-118 ; 0x1b3ca 1b440: 8f e7 ldi r24, 0x7F ; 127 1b442: 97 e4 ldi r25, 0x47 ; 71 1b444: c2 cf rjmp .-124 ; 0x1b3ca { MENU_ITEM_SUBMENU_P(_T(MSG_BRIGHTNESS), lcd_backlight_menu); } #endif //LCD_BL_PIN MENU_END(); } 1b446: df 91 pop r29 1b448: cf 91 pop r28 1b44a: 1f 91 pop r17 1b44c: 0f 91 pop r16 1b44e: ff 90 pop r15 1b450: ef 90 pop r14 1b452: 08 95 ret 0001b454 : } } #if (LANG_MODE != 0) void lcd_language() { 1b454: cf 93 push r28 1b456: df 93 push r29 lcd_update_enable(true); 1b458: 81 e0 ldi r24, 0x01 ; 1 1b45a: 0e 94 3d 6f call 0xde7a ; 0xde7a menu_goto(lcd_language_menu, 0, true, true); 1b45e: 21 e0 ldi r18, 0x01 ; 1 1b460: 41 e0 ldi r20, 0x01 ; 1 1b462: 70 e0 ldi r23, 0x00 ; 0 1b464: 60 e0 ldi r22, 0x00 ; 0 1b466: 8a ea ldi r24, 0xAA ; 170 1b468: 92 ee ldi r25, 0xE2 ; 226 1b46a: 0f 94 7b d1 call 0x3a2f6 ; 0x3a2f6 1b46e: 10 92 da 03 sts 0x03DA, r1 ; 0x8003da lcd_timeoutToStatus.stop(); //infinite timeout while ((menu_menu != lcd_status_screen) && (!lang_is_selected())) 1b472: c0 91 12 04 lds r28, 0x0412 ; 0x800412 1b476: d0 91 13 04 lds r29, 0x0413 ; 0x800413 1b47a: 0e 94 35 71 call 0xe26a ; 0xe26a 1b47e: c6 54 subi r28, 0x46 ; 70 1b480: da 43 sbci r29, 0x3A ; 58 1b482: 39 f0 breq .+14 ; 0x1b492 1b484: 81 11 cpse r24, r1 1b486: 07 c0 rjmp .+14 ; 0x1b496 { delay_keep_alive(50); 1b488: 82 e3 ldi r24, 0x32 ; 50 1b48a: 90 e0 ldi r25, 0x00 ; 0 1b48c: 0e 94 fc 8c call 0x119f8 ; 0x119f8 1b490: f0 cf rjmp .-32 ; 0x1b472 } if (lang_is_selected()) 1b492: 88 23 and r24, r24 1b494: 21 f0 breq .+8 ; 0x1b49e lcd_return_to_status(); else lang_select(LANG_ID_PRI); } 1b496: df 91 pop r29 1b498: 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(); 1b49a: 0d 94 7c 1e jmp 0x23cf8 ; 0x23cf8 else lang_select(LANG_ID_PRI); 1b49e: 80 e0 ldi r24, 0x00 ; 0 } 1b4a0: df 91 pop r29 1b4a2: cf 91 pop r28 delay_keep_alive(50); } if (lang_is_selected()) lcd_return_to_status(); else lang_select(LANG_ID_PRI); 1b4a4: 0c 94 4c 72 jmp 0xe498 ; 0xe498 0001b4a8 : } #endif //FANCHECK static uint8_t lcd_selftest_screen(TestScreen screen, uint8_t _progress, uint8_t _progress_scale, bool _clear, uint16_t _delay) { 1b4a8: bf 92 push r11 1b4aa: cf 92 push r12 1b4ac: df 92 push r13 1b4ae: ef 92 push r14 1b4b0: ff 92 push r15 1b4b2: 0f 93 push r16 1b4b4: 1f 93 push r17 1b4b6: cf 93 push r28 1b4b8: df 93 push r29 1b4ba: c8 2f mov r28, r24 1b4bc: f6 2e mov r15, r22 1b4be: e4 2e mov r14, r20 1b4c0: b2 2e mov r11, r18 1b4c2: 68 01 movw r12, r16 lcd_update_enable(false); 1b4c4: 80 e0 ldi r24, 0x00 ; 0 1b4c6: 0e 94 3d 6f call 0xde7a ; 0xde7a const char _indicator = (_progress >= _progress_scale) ? '-' : '|'; 1b4ca: dc e7 ldi r29, 0x7C ; 124 1b4cc: fe 14 cp r15, r14 1b4ce: 08 f0 brcs .+2 ; 0x1b4d2 1b4d0: dd e2 ldi r29, 0x2D ; 45 if (_clear) 1b4d2: bb 20 and r11, r11 1b4d4: 09 f1 breq .+66 ; 0x1b518 lcd_clear(); 1b4d6: 0e 94 2b 6f call 0xde56 ; 0xde56 else lcd_home(); if (screen == TestScreen::ExtruderFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 1b4da: c1 11 cpse r28, r1 1b4dc: 20 c0 rjmp .+64 ; 0x1b51e if (screen == TestScreen::PrintFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); if (screen == TestScreen::FansOk) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 1b4de: 86 ed ldi r24, 0xD6 ; 214 1b4e0: 96 e5 ldi r25, 0x56 ; 86 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)); 1b4e2: 0e 94 c4 72 call 0xe588 ; 0xe588 1b4e6: 0e 94 e3 6e call 0xddc6 ; 0xddc6 if (screen == TestScreen::Hotend || screen == TestScreen::HotendOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_HOTEND)); 1b4ea: 88 ef ldi r24, 0xF8 ; 248 1b4ec: 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 1b4ee: 82 30 cpi r24, 0x02 ; 2 1b4f0: 78 f5 brcc .+94 ; 0x1b550 || screen == TestScreen::HotendOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_HOTEND)); 1b4f2: 82 e4 ldi r24, 0x42 ; 66 1b4f4: 99 e4 ldi r25, 0x49 ; 73 1b4f6: 0e 94 c4 72 call 0xe588 ; 0xe588 1b4fa: 0e 94 e3 6e call 0xddc6 ; 0xddc6 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)); 1b4fe: 81 e2 ldi r24, 0x21 ; 33 1b500: 99 e4 ldi r25, 0x49 ; 73 1b502: cc 30 cpi r28, 0x0C ; 12 1b504: 49 f1 breq .+82 ; 0x1b558 if (screen == TestScreen::Failed) lcd_puts_P(_T(MSG_SELFTEST_FAILED)); 1b506: 81 ee ldi r24, 0xE1 ; 225 1b508: 96 e5 ldi r25, 0x56 ; 86 1b50a: cd 30 cpi r28, 0x0D ; 13 1b50c: 29 f1 breq .+74 ; 0x1b558 if (screen == TestScreen::Home) lcd_puts_P(_T(MSG_CALIBRATING_HOME)); 1b50e: ce 30 cpi r28, 0x0E ; 14 1b510: 39 f5 brne .+78 ; 0x1b560 1b512: 8e e0 ldi r24, 0x0E ; 14 1b514: 99 e4 ldi r25, 0x49 ; 73 1b516: 20 c0 rjmp .+64 ; 0x1b558 lcd_update_enable(false); const char _indicator = (_progress >= _progress_scale) ? '-' : '|'; if (_clear) lcd_clear(); else lcd_home(); 1b518: 0e 94 24 6f call 0xde48 ; 0xde48 1b51c: de cf rjmp .-68 ; 0x1b4da if (screen == TestScreen::ExtruderFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); if (screen == TestScreen::PrintFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 1b51e: c1 30 cpi r28, 0x01 ; 1 1b520: f1 f2 breq .-68 ; 0x1b4de if (screen == TestScreen::FansOk) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 1b522: c2 30 cpi r28, 0x02 ; 2 1b524: e1 f2 breq .-72 ; 0x1b4de if (screen == TestScreen::EndStops) lcd_puts_P(_T(MSG_SELFTEST_CHECK_ENDSTOPS)); 1b526: 89 e9 ldi r24, 0x99 ; 153 1b528: 99 e4 ldi r25, 0x49 ; 73 1b52a: c3 30 cpi r28, 0x03 ; 3 1b52c: d1 f2 breq .-76 ; 0x1b4e2 if (screen == TestScreen::AxisX) lcd_puts_P(_T(MSG_CHECKING_X)); 1b52e: 87 e8 ldi r24, 0x87 ; 135 1b530: 99 e4 ldi r25, 0x49 ; 73 1b532: c4 30 cpi r28, 0x04 ; 4 1b534: b1 f2 breq .-84 ; 0x1b4e2 if (screen == TestScreen::AxisY) lcd_puts_P(_T(MSG_CHECKING_Y)); 1b536: 85 e7 ldi r24, 0x75 ; 117 1b538: 99 e4 ldi r25, 0x49 ; 73 1b53a: c5 30 cpi r28, 0x05 ; 5 1b53c: 91 f2 breq .-92 ; 0x1b4e2 if (screen == TestScreen::AxisZ) lcd_puts_P(_T(MSG_SELFTEST_CHECK_Z)); 1b53e: 83 e6 ldi r24, 0x63 ; 99 1b540: 99 e4 ldi r25, 0x49 ; 73 1b542: c6 30 cpi r28, 0x06 ; 6 1b544: 71 f2 breq .-100 ; 0x1b4e2 if (screen == TestScreen::Bed) lcd_puts_P(_T(MSG_SELFTEST_CHECK_BED)); 1b546: c7 30 cpi r28, 0x07 ; 7 1b548: 81 f6 brne .-96 ; 0x1b4ea 1b54a: 84 e5 ldi r24, 0x54 ; 84 1b54c: 99 e4 ldi r25, 0x49 ; 73 1b54e: c9 cf rjmp .-110 ; 0x1b4e2 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)); 1b550: ca 30 cpi r28, 0x0A ; 10 1b552: 99 f5 brne .+102 ; 0x1b5ba if (screen == TestScreen::FsensorOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_FSENSOR)); 1b554: 8f e2 ldi r24, 0x2F ; 47 1b556: 99 e4 ldi r25, 0x49 ; 73 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)); 1b558: 0e 94 c4 72 call 0xe588 ; 0xe588 1b55c: 0e 94 e3 6e call 0xddc6 ; 0xddc6 lcd_puts_at_P(0, 1, STR_SEPARATOR); 1b560: 48 eb ldi r20, 0xB8 ; 184 1b562: 5a e8 ldi r21, 0x8A ; 138 1b564: 61 e0 ldi r22, 0x01 ; 1 1b566: 80 e0 ldi r24, 0x00 ; 0 1b568: 0e 94 0c 6f call 0xde18 ; 0xde18 if ((screen >= TestScreen::ExtruderFan) && (screen <= TestScreen::FansOk)) 1b56c: c3 30 cpi r28, 0x03 ; 3 1b56e: 70 f5 brcc .+92 ; 0x1b5cc { //SERIAL_ECHOLNPGM("Fan test"); lcd_puts_at_P(0, 2, _T(MSG_HOTEND_FAN_SPEED)); 1b570: 80 e0 ldi r24, 0x00 ; 0 1b572: 99 e4 ldi r25, 0x49 ; 73 1b574: 0e 94 c4 72 call 0xe588 ; 0xe588 1b578: ac 01 movw r20, r24 1b57a: 62 e0 ldi r22, 0x02 ; 2 1b57c: 80 e0 ldi r24, 0x00 ; 0 1b57e: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_set_cursor(18, 2); 1b582: 62 e0 ldi r22, 0x02 ; 2 1b584: 82 e1 ldi r24, 0x12 ; 18 1b586: 0e 94 f8 6e call 0xddf0 ; 0xddf0 (screen < TestScreen::PrintFan) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 1b58a: c1 11 cpse r28, r1 1b58c: 1a c0 rjmp .+52 ; 0x1b5c2 1b58e: 8d 2f mov r24, r29 1b590: 0e 94 e7 6e call 0xddce ; 0xddce lcd_puts_at_P(0, 3, _T(MSG_PRINT_FAN_SPEED)); 1b594: 83 ef ldi r24, 0xF3 ; 243 1b596: 98 e4 ldi r25, 0x48 ; 72 1b598: 0e 94 c4 72 call 0xe588 ; 0xe588 1b59c: ac 01 movw r20, r24 1b59e: 63 e0 ldi r22, 0x03 ; 3 1b5a0: 80 e0 ldi r24, 0x00 ; 0 1b5a2: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_set_cursor(18, 3); 1b5a6: 63 e0 ldi r22, 0x03 ; 3 1b5a8: 82 e1 ldi r24, 0x12 ; 18 1b5aa: 0e 94 f8 6e call 0xddf0 ; 0xddf0 (screen < TestScreen::FansOk) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 1b5ae: c2 30 cpi r28, 0x02 ; 2 1b5b0: 19 f1 breq .+70 ; 0x1b5f8 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); 1b5b2: 8d 2f mov r24, r29 1b5b4: 0e 94 e7 6e call 0xddce ; 0xddce 1b5b8: 23 c0 rjmp .+70 ; 0x1b600 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)); 1b5ba: cb 30 cpi r28, 0x0B ; 11 1b5bc: 09 f0 breq .+2 ; 0x1b5c0 1b5be: 9f cf rjmp .-194 ; 0x1b4fe 1b5c0: c9 cf rjmp .-110 ; 0x1b554 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); 1b5c2: 8c eb ldi r24, 0xBC ; 188 1b5c4: 9b e6 ldi r25, 0x6B ; 107 1b5c6: 0e 94 e3 6e call 0xddc6 ; 0xddc6 1b5ca: e4 cf rjmp .-56 ; 0x1b594 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) 1b5cc: 86 ef ldi r24, 0xF6 ; 246 1b5ce: 8c 0f add r24, r28 1b5d0: 82 30 cpi r24, 0x02 ; 2 1b5d2: a8 f5 brcc .+106 ; 0x1b63e { lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR)); 1b5d4: 83 ef ldi r24, 0xF3 ; 243 1b5d6: 96 e5 ldi r25, 0x56 ; 86 1b5d8: 0e 94 c4 72 call 0xe588 ; 0xe588 1b5dc: ac 01 movw r20, r24 1b5de: 62 e0 ldi r22, 0x02 ; 2 1b5e0: 80 e0 ldi r24, 0x00 ; 0 1b5e2: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_putc(':'); 1b5e6: 8a e3 ldi r24, 0x3A ; 58 1b5e8: 0e 94 e7 6e call 0xddce ; 0xddce lcd_set_cursor(18, 2); 1b5ec: 62 e0 ldi r22, 0x02 ; 2 1b5ee: 82 e1 ldi r24, 0x12 ; 18 1b5f0: 0e 94 f8 6e call 0xddf0 ; 0xddf0 (screen == TestScreen::Fsensor) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 1b5f4: ca 30 cpi r28, 0x0A ; 10 1b5f6: e9 f2 breq .-70 ; 0x1b5b2 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); 1b5f8: 8c eb ldi r24, 0xBC ; 188 1b5fa: 9b e6 ldi r25, 0x6B ; 107 1b5fc: 0e 94 e3 6e call 0xddc6 ; 0xddc6 _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); 1b600: c1 14 cp r12, r1 1b602: d1 04 cpc r13, r1 1b604: 19 f0 breq .+6 ; 0x1b60c 1b606: c6 01 movw r24, r12 1b608: 0e 94 fc 8c call 0x119f8 ; 0x119f8 _progress++; 1b60c: 81 e0 ldi r24, 0x01 ; 1 1b60e: 8f 0d add r24, r15 return (_progress >= _progress_scale * 2) ? 0 : _progress; 1b610: 48 2f mov r20, r24 1b612: 50 e0 ldi r21, 0x00 ; 0 1b614: 92 e0 ldi r25, 0x02 ; 2 1b616: 24 e0 ldi r18, 0x04 ; 4 1b618: 30 e0 ldi r19, 0x00 ; 0 1b61a: e9 16 cp r14, r25 1b61c: 11 f0 breq .+4 ; 0x1b622 1b61e: 26 e0 ldi r18, 0x06 ; 6 1b620: 30 e0 ldi r19, 0x00 ; 0 1b622: 42 17 cp r20, r18 1b624: 53 07 cpc r21, r19 1b626: 0c f0 brlt .+2 ; 0x1b62a 1b628: 80 e0 ldi r24, 0x00 ; 0 } 1b62a: df 91 pop r29 1b62c: cf 91 pop r28 1b62e: 1f 91 pop r17 1b630: 0f 91 pop r16 1b632: ff 90 pop r15 1b634: ef 90 pop r14 1b636: df 90 pop r13 1b638: cf 90 pop r12 1b63a: bf 90 pop r11 1b63c: 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) 1b63e: ca 30 cpi r28, 0x0A ; 10 1b640: f8 f6 brcc .-66 ; 0x1b600 { //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); 1b642: 41 e0 ldi r20, 0x01 ; 1 1b644: c4 30 cpi r28, 0x04 ; 4 1b646: 21 f0 breq .+8 ; 0x1b650 1b648: 42 e0 ldi r20, 0x02 ; 2 1b64a: c3 30 cpi r28, 0x03 ; 3 1b64c: 09 f4 brne .+2 ; 0x1b650 1b64e: 40 e0 ldi r20, 0x00 ; 0 1b650: 0d 2f mov r16, r29 1b652: 26 eb ldi r18, 0xB6 ; 182 1b654: 3a e8 ldi r19, 0x8A ; 138 1b656: 62 e0 ldi r22, 0x02 ; 2 1b658: 82 e0 ldi r24, 0x02 ; 2 1b65a: 0e 94 99 d0 call 0x1a132 ; 0x1a132 _step_block = TestScreen::AxisY; lcd_selftest_screen_step(2, 8, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Y"), _indicator); 1b65e: 41 e0 ldi r20, 0x01 ; 1 1b660: c5 30 cpi r28, 0x05 ; 5 1b662: 21 f0 breq .+8 ; 0x1b66c 1b664: 42 e0 ldi r20, 0x02 ; 2 1b666: c5 30 cpi r28, 0x05 ; 5 1b668: 08 f4 brcc .+2 ; 0x1b66c 1b66a: 40 e0 ldi r20, 0x00 ; 0 1b66c: 0d 2f mov r16, r29 1b66e: 24 eb ldi r18, 0xB4 ; 180 1b670: 3a e8 ldi r19, 0x8A ; 138 1b672: 68 e0 ldi r22, 0x08 ; 8 1b674: 82 e0 ldi r24, 0x02 ; 2 1b676: 0e 94 99 d0 call 0x1a132 ; 0x1a132 _step_block = TestScreen::AxisZ; lcd_selftest_screen_step(2, 14, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Z"), _indicator); 1b67a: 41 e0 ldi r20, 0x01 ; 1 1b67c: c6 30 cpi r28, 0x06 ; 6 1b67e: 21 f0 breq .+8 ; 0x1b688 1b680: 42 e0 ldi r20, 0x02 ; 2 1b682: c6 30 cpi r28, 0x06 ; 6 1b684: 08 f4 brcc .+2 ; 0x1b688 1b686: 40 e0 ldi r20, 0x00 ; 0 1b688: 0d 2f mov r16, r29 1b68a: 22 eb ldi r18, 0xB2 ; 178 1b68c: 3a e8 ldi r19, 0x8A ; 138 1b68e: 6e e0 ldi r22, 0x0E ; 14 1b690: 82 e0 ldi r24, 0x02 ; 2 1b692: 0e 94 99 d0 call 0x1a132 ; 0x1a132 _step_block = TestScreen::Bed; lcd_selftest_screen_step(3, 0, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Bed"), _indicator); 1b696: 41 e0 ldi r20, 0x01 ; 1 1b698: c7 30 cpi r28, 0x07 ; 7 1b69a: 21 f0 breq .+8 ; 0x1b6a4 1b69c: 42 e0 ldi r20, 0x02 ; 2 1b69e: c7 30 cpi r28, 0x07 ; 7 1b6a0: 08 f4 brcc .+2 ; 0x1b6a4 1b6a2: 40 e0 ldi r20, 0x00 ; 0 1b6a4: 0d 2f mov r16, r29 1b6a6: 2e ea ldi r18, 0xAE ; 174 1b6a8: 3a e8 ldi r19, 0x8A ; 138 1b6aa: 60 e0 ldi r22, 0x00 ; 0 1b6ac: 83 e0 ldi r24, 0x03 ; 3 1b6ae: 0e 94 99 d0 call 0x1a132 ; 0x1a132 _step_block = TestScreen::Hotend; lcd_selftest_screen_step(3, 9, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Hotend"), _indicator); 1b6b2: 41 e0 ldi r20, 0x01 ; 1 1b6b4: c8 30 cpi r28, 0x08 ; 8 1b6b6: 21 f0 breq .+8 ; 0x1b6c0 1b6b8: 42 e0 ldi r20, 0x02 ; 2 1b6ba: c8 30 cpi r28, 0x08 ; 8 1b6bc: 08 f4 brcc .+2 ; 0x1b6c0 1b6be: 40 e0 ldi r20, 0x00 ; 0 1b6c0: 0d 2f mov r16, r29 1b6c2: 27 ea ldi r18, 0xA7 ; 167 1b6c4: 3a e8 ldi r19, 0x8A ; 138 1b6c6: 69 e0 ldi r22, 0x09 ; 9 1b6c8: 83 e0 ldi r24, 0x03 ; 3 1b6ca: 0e 94 99 d0 call 0x1a132 ; 0x1a132 1b6ce: 98 cf rjmp .-208 ; 0x1b600 0001b6d0 : { printf_P(MSG_HOST_ACTION_NOTIFICATION, message); } static void lcd_rename_sheet_menu() { 1b6d0: cf 93 push r28 1b6d2: 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) 1b6d4: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 1b6d8: 81 11 cpse r24, r1 1b6da: 18 c0 rjmp .+48 ; 0x1b70c { eeprom_read_block(menuData->name, EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); 1b6dc: 60 91 e0 03 lds r22, 0x03E0 ; 0x8003e0 1b6e0: 8b e0 ldi r24, 0x0B ; 11 1b6e2: 68 9f mul r22, r24 1b6e4: b0 01 movw r22, r0 1b6e6: 11 24 eor r1, r1 1b6e8: 67 5b subi r22, 0xB7 ; 183 1b6ea: 72 4f sbci r23, 0xF2 ; 242 1b6ec: 47 e0 ldi r20, 0x07 ; 7 1b6ee: 50 e0 ldi r21, 0x00 ; 0 1b6f0: 89 ea ldi r24, 0xA9 ; 169 1b6f2: 93 e0 ldi r25, 0x03 ; 3 1b6f4: 0f 94 c7 db call 0x3b78e ; 0x3b78e lcd_encoder = menuData->name[0]; 1b6f8: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 1b6fc: 90 e0 ldi r25, 0x00 ; 0 1b6fe: 90 93 70 06 sts 0x0670, r25 ; 0x800670 1b702: 80 93 6f 06 sts 0x066F, r24 ; 0x80066f menuData->initialized = true; 1b706: 81 e0 ldi r24, 0x01 ; 1 1b708: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 } if (lcd_encoder < 0x20) lcd_encoder = 0x20; 1b70c: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 1b710: 90 91 70 06 lds r25, 0x0670 ; 0x800670 1b714: 80 97 sbiw r24, 0x20 ; 32 1b716: 34 f4 brge .+12 ; 0x1b724 1b718: 80 e2 ldi r24, 0x20 ; 32 1b71a: 90 e0 ldi r25, 0x00 ; 0 1b71c: 90 93 70 06 sts 0x0670, r25 ; 0x800670 1b720: 80 93 6f 06 sts 0x066F, r24 ; 0x80066f if (lcd_encoder > 0xFF) lcd_encoder = 0xFF; 1b724: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 1b728: 90 91 70 06 lds r25, 0x0670 ; 0x800670 1b72c: 8f 3f cpi r24, 0xFF ; 255 1b72e: 91 05 cpc r25, r1 1b730: 39 f0 breq .+14 ; 0x1b740 1b732: 34 f0 brlt .+12 ; 0x1b740 1b734: 8f ef ldi r24, 0xFF ; 255 1b736: 90 e0 ldi r25, 0x00 ; 0 1b738: 90 93 70 06 sts 0x0670, r25 ; 0x800670 1b73c: 80 93 6f 06 sts 0x066F, r24 ; 0x80066f menuData->name[menuData->selected] = lcd_encoder; 1b740: e0 91 a8 03 lds r30, 0x03A8 ; 0x8003a8 1b744: f0 e0 ldi r31, 0x00 ; 0 1b746: e9 55 subi r30, 0x59 ; 89 1b748: fc 4f sbci r31, 0xFC ; 252 1b74a: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 1b74e: 82 83 std Z+2, r24 ; 0x02 lcd_home(); 1b750: 0e 94 24 6f call 0xde48 ; 0xde48 1b754: c9 ea ldi r28, 0xA9 ; 169 1b756: d3 e0 ldi r29, 0x03 ; 3 for (uint_least8_t i = 0; i < sizeof(Sheet::name); ++i) { lcd_putc(menuData->name[i]); 1b758: 89 91 ld r24, Y+ 1b75a: 0e 94 e7 6e call 0xddce ; 0xddce 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) 1b75e: 83 e0 ldi r24, 0x03 ; 3 1b760: c0 3b cpi r28, 0xB0 ; 176 1b762: d8 07 cpc r29, r24 1b764: c9 f7 brne .-14 ; 0x1b758 { lcd_putc(menuData->name[i]); } lcd_putc_at(menuData->selected, 1, '^'); 1b766: 4e e5 ldi r20, 0x5E ; 94 1b768: 61 e0 ldi r22, 0x01 ; 1 1b76a: 80 91 a8 03 lds r24, 0x03A8 ; 0x8003a8 1b76e: 0e 94 18 6f call 0xde30 ; 0xde30 if (menuData->selected > 0) 1b772: 80 91 a8 03 lds r24, 0x03A8 ; 0x8003a8 1b776: 88 23 and r24, r24 1b778: 29 f0 breq .+10 ; 0x1b784 { lcd_putc_at(menuData->selected-1, 1, ' '); 1b77a: 40 e2 ldi r20, 0x20 ; 32 1b77c: 61 e0 ldi r22, 0x01 ; 1 1b77e: 81 50 subi r24, 0x01 ; 1 1b780: 0e 94 18 6f call 0xde30 ; 0xde30 } if (lcd_clicked()) 1b784: 0e 94 15 71 call 0xe22a ; 0xe22a 1b788: 88 23 and r24, r24 1b78a: 99 f0 breq .+38 ; 0x1b7b2 { if ((menuData->selected + 1u) < sizeof(Sheet::name)) 1b78c: e0 91 a8 03 lds r30, 0x03A8 ; 0x8003a8 1b790: 8e 2f mov r24, r30 1b792: 90 e0 ldi r25, 0x00 ; 0 1b794: 01 96 adiw r24, 0x01 ; 1 1b796: 07 97 sbiw r24, 0x07 ; 7 1b798: 78 f4 brcc .+30 ; 0x1b7b8 { lcd_encoder = menuData->name[++(menuData->selected)]; 1b79a: ef 5f subi r30, 0xFF ; 255 1b79c: e0 93 a8 03 sts 0x03A8, r30 ; 0x8003a8 1b7a0: f0 e0 ldi r31, 0x00 ; 0 1b7a2: e9 55 subi r30, 0x59 ; 89 1b7a4: fc 4f sbci r31, 0xFC ; 252 1b7a6: 82 81 ldd r24, Z+2 ; 0x02 1b7a8: 90 e0 ldi r25, 0x00 ; 0 1b7aa: 90 93 70 06 sts 0x0670, r25 ; 0x800670 1b7ae: 80 93 6f 06 sts 0x066F, r24 ; 0x80066f EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); } } } 1b7b2: df 91 pop r29 1b7b4: cf 91 pop r28 1b7b6: 08 95 ret { lcd_encoder = menuData->name[++(menuData->selected)]; } else { eeprom_update_block_notify(menuData->name, 1b7b8: 60 91 e0 03 lds r22, 0x03E0 ; 0x8003e0 1b7bc: 8b e0 ldi r24, 0x0B ; 11 1b7be: 68 9f mul r22, r24 1b7c0: b0 01 movw r22, r0 1b7c2: 11 24 eor r1, r1 1b7c4: 67 5b subi r22, 0xB7 ; 183 1b7c6: 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); 1b7c8: 47 e0 ldi r20, 0x07 ; 7 1b7ca: 50 e0 ldi r21, 0x00 ; 0 1b7cc: 89 ea ldi r24, 0xA9 ; 169 1b7ce: 93 e0 ldi r25, 0x03 ; 3 1b7d0: 0f 94 eb db call 0x3b7d6 ; 0x3b7d6 EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); } } } 1b7d4: df 91 pop r29 1b7d6: cf 91 pop r28 else { eeprom_update_block_notify(menuData->name, EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); 1b7d8: 0d 94 19 d4 jmp 0x3a832 ; 0x3a832 0001b7dc : manage_inactivity(true); return _result; } static bool lcd_selfcheck_check_heater(bool _isbed) { 1b7dc: 8f 92 push r8 1b7de: 9f 92 push r9 1b7e0: af 92 push r10 1b7e2: bf 92 push r11 1b7e4: cf 92 push r12 1b7e6: df 92 push r13 1b7e8: ef 92 push r14 1b7ea: ff 92 push r15 1b7ec: 0f 93 push r16 1b7ee: 1f 93 push r17 1b7f0: cf 93 push r28 1b7f2: df 93 push r29 1b7f4: f8 2e mov r15, r24 1b7f6: 60 91 af 0d lds r22, 0x0DAF ; 0x800daf 1b7fa: 70 91 b0 0d lds r23, 0x0DB0 ; 0x800db0 1b7fe: 80 91 b1 0d lds r24, 0x0DB1 ; 0x800db1 1b802: 90 91 b2 0d lds r25, 0x0DB2 ; 0x800db2 1b806: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> 1b80a: 4b 01 movw r8, r22 1b80c: 6b 01 movw r12, r22 1b80e: 60 91 ed 04 lds r22, 0x04ED ; 0x8004ed 1b812: 70 91 ee 04 lds r23, 0x04EE ; 0x8004ee 1b816: 80 91 ef 04 lds r24, 0x04EF ; 0x8004ef 1b81a: 90 91 f0 04 lds r25, 0x04F0 ; 0x8004f0 1b81e: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> 1b822: eb 01 movw r28, r22 uint8_t _progress = 0; int _checked_snapshot = (_isbed) ? degBed() : degHotend(0); 1b824: ff 20 and r15, r15 1b826: 09 f4 brne .+2 ; 0x1b82a 1b828: a6 c0 rjmp .+332 ; 0x1b976 1b82a: 6b 01 movw r12, r22 int _opposite_snapshot = (_isbed) ? degHotend(0) : degBed(); 1b82c: e4 01 movw r28, r8 uint8_t _cycles = (_isbed) ? 180 : 60; //~ 90s / 30s 1b82e: 24 eb ldi r18, 0xB4 ; 180 1b830: 92 2e mov r9, r18 target_temperature[0] = (_isbed) ? 0 : 200; 1b832: 90 e0 ldi r25, 0x00 ; 0 1b834: 80 e0 ldi r24, 0x00 ; 0 1b836: 90 93 b6 0d sts 0x0DB6, r25 ; 0x800db6 1b83a: 80 93 b5 0d sts 0x0DB5, r24 ; 0x800db5 target_temperature_bed = (_isbed) ? 100 : 0; 1b83e: 84 e6 ldi r24, 0x64 ; 100 1b840: 90 e0 ldi r25, 0x00 ; 0 1b842: f1 10 cpse r15, r1 1b844: 02 c0 rjmp .+4 ; 0x1b84a 1b846: 90 e0 ldi r25, 0x00 ; 0 1b848: 80 e0 ldi r24, 0x00 ; 0 1b84a: 90 93 72 06 sts 0x0672, r25 ; 0x800672 1b84e: 80 93 71 06 sts 0x0671, r24 ; 0x800671 thermal_model::reinitialize(); } bool thermal_model_enabled() { return thermal_model::enabled; 1b852: e0 90 1c 05 lds r14, 0x051C ; 0x80051c <_ZN13thermal_modelL7enabledE.lto_priv.456> #ifdef THERMAL_MODEL bool tm_was_enabled = thermal_model_enabled(); thermal_model_set_enabled(false); 1b856: 80 e0 ldi r24, 0x00 ; 0 1b858: 0f 94 0f 32 call 0x2641e ; 0x2641e #endif //THERMAL_MODEL manage_heater(); 1b85c: 0f 94 2e 38 call 0x2705c ; 0x2705c manage_inactivity(true); 1b860: 81 e0 ldi r24, 0x01 ; 1 1b862: 0e 94 c7 8a call 0x1158e ; 0x1158e for(uint8_t _counter = 0; _counter < _cycles && !Stopped; ++_counter) 1b866: b1 2c mov r11, r1 return _result; } static bool lcd_selfcheck_check_heater(bool _isbed) { uint8_t _progress = 0; 1b868: a1 2c mov r10, r1 } else { MYSERIAL.print("Hotend temp:"); MYSERIAL.println(degHotend(0)); }*/ if(_counter%5 == 0) serialecho_temperatures(); //show temperatures once in two seconds 1b86a: 85 e0 ldi r24, 0x05 ; 5 1b86c: 88 2e mov r8, r24 thermal_model_set_enabled(false); #endif //THERMAL_MODEL manage_heater(); manage_inactivity(true); for(uint8_t _counter = 0; _counter < _cycles && !Stopped; ++_counter) 1b86e: 80 91 10 05 lds r24, 0x0510 ; 0x800510 1b872: 81 11 cpse r24, r1 1b874: 1c c0 rjmp .+56 ; 0x1b8ae { manage_heater(); 1b876: 0f 94 2e 38 call 0x2705c ; 0x2705c manage_inactivity(true); 1b87a: 81 e0 ldi r24, 0x01 ; 1 1b87c: 0e 94 c7 8a call 0x1158e ; 0x1158e _progress = (_isbed? 1b880: 00 e9 ldi r16, 0x90 ; 144 1b882: 11 e0 ldi r17, 0x01 ; 1 1b884: 20 e0 ldi r18, 0x00 ; 0 1b886: 42 e0 ldi r20, 0x02 ; 2 1b888: 6a 2d mov r22, r10 1b88a: 87 e0 ldi r24, 0x07 ; 7 1b88c: f1 10 cpse r15, r1 1b88e: 01 c0 rjmp .+2 ; 0x1b892 1b890: 88 e0 ldi r24, 0x08 ; 8 1b892: 0e 94 54 da call 0x1b4a8 ; 0x1b4a8 1b896: a8 2e mov r10, r24 } else { MYSERIAL.print("Hotend temp:"); MYSERIAL.println(degHotend(0)); }*/ if(_counter%5 == 0) serialecho_temperatures(); //show temperatures once in two seconds 1b898: 8b 2d mov r24, r11 1b89a: 68 2d mov r22, r8 1b89c: 0f 94 86 dc call 0x3b90c ; 0x3b90c <__udivmodqi4> 1b8a0: 91 11 cpse r25, r1 1b8a2: 02 c0 rjmp .+4 ; 0x1b8a8 1b8a4: 0e 94 76 77 call 0xeeec ; 0xeeec thermal_model_set_enabled(false); #endif //THERMAL_MODEL manage_heater(); manage_inactivity(true); for(uint8_t _counter = 0; _counter < _cycles && !Stopped; ++_counter) 1b8a8: b3 94 inc r11 1b8aa: b9 10 cpse r11, r9 1b8ac: e0 cf rjmp .-64 ; 0x1b86e MYSERIAL.println(degHotend(0)); }*/ if(_counter%5 == 0) serialecho_temperatures(); //show temperatures once in two seconds } target_temperature[0] = 0; 1b8ae: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 1b8b2: 10 92 b5 0d sts 0x0DB5, r1 ; 0x800db5 target_temperature_bed = 0; 1b8b6: 10 92 72 06 sts 0x0672, r1 ; 0x800672 1b8ba: 10 92 71 06 sts 0x0671, r1 ; 0x800671 manage_heater(); 1b8be: 0f 94 2e 38 call 0x2705c ; 0x2705c 1b8c2: b6 01 movw r22, r12 1b8c4: dd 0c add r13, r13 1b8c6: 88 0b sbc r24, r24 1b8c8: 99 0b sbc r25, r25 1b8ca: 4e 01 movw r8, r28 1b8cc: dd 0f add r29, r29 1b8ce: aa 08 sbc r10, r10 1b8d0: bb 08 sbc r11, r11 int _checked_result = (_isbed) ? degBed() - _checked_snapshot : degHotend(0) - _checked_snapshot; 1b8d2: ff 20 and r15, r15 1b8d4: 09 f4 brne .+2 ; 0x1b8d8 1b8d6: 54 c0 rjmp .+168 ; 0x1b980 1b8d8: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 1b8dc: 9b 01 movw r18, r22 1b8de: ac 01 movw r20, r24 1b8e0: 60 91 ed 04 lds r22, 0x04ED ; 0x8004ed 1b8e4: 70 91 ee 04 lds r23, 0x04EE ; 0x8004ee 1b8e8: 80 91 ef 04 lds r24, 0x04EF ; 0x8004ef 1b8ec: 90 91 f0 04 lds r25, 0x04F0 ; 0x8004f0 1b8f0: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 1b8f4: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> 1b8f8: eb 01 movw r28, r22 int _opposite_result = (_isbed) ? degHotend(0) - _opposite_snapshot : degBed() - _opposite_snapshot; 1b8fa: c5 01 movw r24, r10 1b8fc: b4 01 movw r22, r8 1b8fe: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 1b902: 9b 01 movw r18, r22 1b904: ac 01 movw r20, r24 1b906: 60 91 af 0d lds r22, 0x0DAF ; 0x800daf 1b90a: 70 91 b0 0d lds r23, 0x0DB0 ; 0x800db0 1b90e: 80 91 b1 0d lds r24, 0x0DB1 ; 0x800db1 1b912: 90 91 b2 0d lds r25, 0x0DB2 ; 0x800db2 1b916: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 1b91a: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) 1b91e: 10 91 10 05 lds r17, 0x0510 ; 0x800510 1b922: 11 11 cpse r17, r1 1b924: 0c c0 rjmp .+24 ; 0x1b93e 1b926: f1 10 cpse r15, r1 1b928: 4b c0 rjmp .+150 ; 0x1b9c0 1b92a: 69 30 cpi r22, 0x09 ; 9 1b92c: 71 05 cpc r23, r1 1b92e: 0c f0 brlt .+2 ; 0x1b932 1b930: 4d c0 rjmp .+154 ; 0x1b9cc { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 1b932: 8e e1 ldi r24, 0x1E ; 30 1b934: 90 e0 ldi r25, 0x00 ; 0 _stepresult = true; 1b936: 11 e0 ldi r17, 0x01 ; 1 */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 1b938: c8 17 cp r28, r24 1b93a: d9 07 cpc r29, r25 1b93c: 34 f4 brge .+12 ; 0x1b94a _stepresult = true; else lcd_selftest_error(TestError::Heater, "", ""); 1b93e: 66 ef ldi r22, 0xF6 ; 246 1b940: 72 e0 ldi r23, 0x02 ; 2 1b942: 80 e0 ldi r24, 0x00 ; 0 1b944: 0f 94 29 9f call 0x33e52 ; 0x33e52 MYSERIAL.println(_checked_result); MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; 1b948: 10 e0 ldi r17, 0x00 ; 0 { lcd_selftest_error(TestError::Bed, "", ""); } #ifdef THERMAL_MODEL thermal_model_set_enabled(tm_was_enabled); 1b94a: 8e 2d mov r24, r14 1b94c: 0f 94 0f 32 call 0x2641e ; 0x2641e #endif //THERMAL_MODEL manage_heater(); 1b950: 0f 94 2e 38 call 0x2705c ; 0x2705c manage_inactivity(true); 1b954: 81 e0 ldi r24, 0x01 ; 1 1b956: 0e 94 c7 8a call 0x1158e ; 0x1158e return _stepresult; } 1b95a: 81 2f mov r24, r17 1b95c: df 91 pop r29 1b95e: cf 91 pop r28 1b960: 1f 91 pop r17 1b962: 0f 91 pop r16 1b964: ff 90 pop r15 1b966: ef 90 pop r14 1b968: df 90 pop r13 1b96a: cf 90 pop r12 1b96c: bf 90 pop r11 1b96e: af 90 pop r10 1b970: 9f 90 pop r9 1b972: 8f 90 pop r8 1b974: 08 95 ret static bool lcd_selfcheck_check_heater(bool _isbed) { 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 1b976: 9c e3 ldi r25, 0x3C ; 60 1b978: 99 2e mov r9, r25 target_temperature[0] = (_isbed) ? 0 : 200; 1b97a: 88 ec ldi r24, 0xC8 ; 200 1b97c: 90 e0 ldi r25, 0x00 ; 0 1b97e: 5b cf rjmp .-330 ; 0x1b836 target_temperature[0] = 0; target_temperature_bed = 0; manage_heater(); int _checked_result = (_isbed) ? degBed() - _checked_snapshot : degHotend(0) - _checked_snapshot; 1b980: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 1b984: 9b 01 movw r18, r22 1b986: ac 01 movw r20, r24 1b988: 60 91 af 0d lds r22, 0x0DAF ; 0x800daf 1b98c: 70 91 b0 0d lds r23, 0x0DB0 ; 0x800db0 1b990: 80 91 b1 0d lds r24, 0x0DB1 ; 0x800db1 1b994: 90 91 b2 0d lds r25, 0x0DB2 ; 0x800db2 1b998: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 1b99c: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> 1b9a0: eb 01 movw r28, r22 int _opposite_result = (_isbed) ? degHotend(0) - _opposite_snapshot : degBed() - _opposite_snapshot; 1b9a2: c5 01 movw r24, r10 1b9a4: b4 01 movw r22, r8 1b9a6: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 1b9aa: 9b 01 movw r18, r22 1b9ac: ac 01 movw r20, r24 1b9ae: 60 91 ed 04 lds r22, 0x04ED ; 0x8004ed 1b9b2: 70 91 ee 04 lds r23, 0x04EE ; 0x8004ee 1b9b6: 80 91 ef 04 lds r24, 0x04EF ; 0x8004ef 1b9ba: 90 91 f0 04 lds r25, 0x04F0 ; 0x8004f0 1b9be: ab cf rjmp .-170 ; 0x1b916 */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 1b9c0: 89 e0 ldi r24, 0x09 ; 9 1b9c2: 90 e0 ldi r25, 0x00 ; 0 MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) 1b9c4: 6e 31 cpi r22, 0x1E ; 30 1b9c6: 71 05 cpc r23, r1 1b9c8: 0c f4 brge .+2 ; 0x1b9cc 1b9ca: b5 cf rjmp .-150 ; 0x1b936 else lcd_selftest_error(TestError::Heater, "", ""); } else { lcd_selftest_error(TestError::Bed, "", ""); 1b9cc: 66 ef ldi r22, 0xF6 ; 246 1b9ce: 72 e0 ldi r23, 0x02 ; 2 1b9d0: 81 e0 ldi r24, 0x01 ; 1 1b9d2: 0f 94 29 9f call 0x33e52 ; 0x33e52 1b9d6: b9 cf rjmp .-142 ; 0x1b94a 0001b9d8 : return(_result); } #ifdef TMC2130 static void reset_crash_det(uint8_t axis) { 1b9d8: cf 93 push r28 1b9da: df 93 push r29 current_position[axis] += 10; 1b9dc: 94 e0 ldi r25, 0x04 ; 4 1b9de: 89 9f mul r24, r25 1b9e0: e0 01 movw r28, r0 1b9e2: 11 24 eor r1, r1 1b9e4: cf 56 subi r28, 0x6F ; 111 1b9e6: d9 4f sbci r29, 0xF9 ; 249 1b9e8: 20 e0 ldi r18, 0x00 ; 0 1b9ea: 30 e0 ldi r19, 0x00 ; 0 1b9ec: 40 e2 ldi r20, 0x20 ; 32 1b9ee: 51 e4 ldi r21, 0x41 ; 65 1b9f0: 68 81 ld r22, Y 1b9f2: 79 81 ldd r23, Y+1 ; 0x01 1b9f4: 8a 81 ldd r24, Y+2 ; 0x02 1b9f6: 9b 81 ldd r25, Y+3 ; 0x03 1b9f8: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 1b9fc: 68 83 st Y, r22 1b9fe: 79 83 std Y+1, r23 ; 0x01 1ba00: 8a 83 std Y+2, r24 ; 0x02 1ba02: 9b 83 std Y+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1ba04: 60 e0 ldi r22, 0x00 ; 0 1ba06: 70 e0 ldi r23, 0x00 ; 0 1ba08: 84 e3 ldi r24, 0x34 ; 52 1ba0a: 92 e4 ldi r25, 0x42 ; 66 1ba0c: 0f 94 04 c0 call 0x38008 ; 0x38008 st_synchronize(); 1ba10: 0f 94 a3 42 call 0x28546 ; 0x28546 crashdet_use_eeprom_setting(); } 1ba14: df 91 pop r29 1ba16: cf 91 pop r28 static void reset_crash_det(uint8_t axis) { current_position[axis] += 10; plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); st_synchronize(); crashdet_use_eeprom_setting(); 1ba18: 0d 94 2b 26 jmp 0x24c56 ; 0x24c56 0001ba1c : } static bool lcd_selfcheck_axis_sg(uint8_t axis) { 1ba1c: 2f 92 push r2 1ba1e: 3f 92 push r3 1ba20: 4f 92 push r4 1ba22: 5f 92 push r5 1ba24: 6f 92 push r6 1ba26: 7f 92 push r7 1ba28: 8f 92 push r8 1ba2a: 9f 92 push r9 1ba2c: af 92 push r10 1ba2e: bf 92 push r11 1ba30: cf 92 push r12 1ba32: df 92 push r13 1ba34: ef 92 push r14 1ba36: ff 92 push r15 1ba38: 1f 93 push r17 1ba3a: cf 93 push r28 1ba3c: df 93 push r29 1ba3e: 00 d0 rcall .+0 ; 0x1ba40 1ba40: 00 d0 rcall .+0 ; 0x1ba42 1ba42: 1f 92 push r1 1ba44: cd b7 in r28, 0x3d ; 61 1ba46: de b7 in r29, 0x3e ; 62 1ba48: 18 2f mov r17, r24 // each axis length is measured twice float axis_length, current_position_init, current_position_final; float measured_axis_length[2]; float margin = 60; float max_error_mm = 5; switch (axis) { 1ba4a: 68 2e mov r6, r24 1ba4c: 71 2c mov r7, r1 case 0: axis_length = X_MAX_POS; break; case 1: axis_length = Y_MAX_POS - Y_MIN_POS + 4; break; 1ba4e: 81 2c mov r8, r1 1ba50: 20 e8 ldi r18, 0x80 ; 128 1ba52: 92 2e mov r9, r18 1ba54: 2c e5 ldi r18, 0x5C ; 92 1ba56: a2 2e mov r10, r18 1ba58: 23 e4 ldi r18, 0x43 ; 67 1ba5a: b2 2e mov r11, r18 // each axis length is measured twice float axis_length, current_position_init, current_position_final; float measured_axis_length[2]; float margin = 60; float max_error_mm = 5; switch (axis) { 1ba5c: 81 30 cpi r24, 0x01 ; 1 1ba5e: 31 f0 breq .+12 ; 0x1ba6c case 0: axis_length = X_MAX_POS; break; 1ba60: 81 2c mov r8, r1 1ba62: 91 2c mov r9, r1 1ba64: 9f e7 ldi r25, 0x7F ; 127 1ba66: a9 2e mov r10, r25 1ba68: 93 e4 ldi r25, 0x43 ; 67 1ba6a: b9 2e mov r11, r25 case 1: axis_length = Y_MAX_POS - Y_MIN_POS + 4; break; default: axis_length = 210; break; } tmc2130_sg_stop_on_crash = false; 1ba6c: 10 92 5c 02 sts 0x025C, r1 ; 0x80025c tmc2130_home_exit(); 1ba70: 0f 94 7f 25 call 0x24afe ; 0x24afe 1ba74: 81 e0 ldi r24, 0x01 ; 1 1ba76: 80 93 b7 02 sts 0x02B7, r24 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> enable_endstops(true); raise_z_above(MESH_HOME_Z_SEARCH); 1ba7a: 60 e0 ldi r22, 0x00 ; 0 1ba7c: 70 e0 ldi r23, 0x00 ; 0 1ba7e: 80 ea ldi r24, 0xA0 ; 160 1ba80: 90 e4 ldi r25, 0x40 ; 64 1ba82: 0e 94 78 6e call 0xdcf0 ; 0xdcf0 tmc2130_home_enter(1 << axis); 1ba86: 81 e0 ldi r24, 0x01 ; 1 1ba88: 01 2e mov r0, r17 1ba8a: 01 c0 rjmp .+2 ; 0x1ba8e 1ba8c: 88 0f add r24, r24 1ba8e: 0a 94 dec r0 1ba90: ea f7 brpl .-6 ; 0x1ba8c 1ba92: 0f 94 ae 25 call 0x24b5c ; 0x24b5c // first axis length measurement begin current_position[axis] -= (axis_length + margin); 1ba96: 20 e0 ldi r18, 0x00 ; 0 1ba98: 30 e0 ldi r19, 0x00 ; 0 1ba9a: 40 e7 ldi r20, 0x70 ; 112 1ba9c: 52 e4 ldi r21, 0x42 ; 66 1ba9e: c5 01 movw r24, r10 1baa0: b4 01 movw r22, r8 1baa2: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 1baa6: 69 83 std Y+1, r22 ; 0x01 1baa8: 7a 83 std Y+2, r23 ; 0x02 1baaa: 8b 83 std Y+3, r24 ; 0x03 1baac: 9c 83 std Y+4, r25 ; 0x04 1baae: 13 01 movw r2, r6 1bab0: 22 0c add r2, r2 1bab2: 33 1c adc r3, r3 1bab4: 22 0c add r2, r2 1bab6: 33 1c adc r3, r3 1bab8: c1 01 movw r24, r2 1baba: 8f 56 subi r24, 0x6F ; 111 1babc: 99 4f sbci r25, 0xF9 ; 249 1babe: 9e 83 std Y+6, r25 ; 0x06 1bac0: 8d 83 std Y+5, r24 ; 0x05 1bac2: 29 81 ldd r18, Y+1 ; 0x01 1bac4: 3a 81 ldd r19, Y+2 ; 0x02 1bac6: 4b 81 ldd r20, Y+3 ; 0x03 1bac8: 5c 81 ldd r21, Y+4 ; 0x04 1baca: fc 01 movw r30, r24 1bacc: 60 81 ld r22, Z 1bace: 71 81 ldd r23, Z+1 ; 0x01 1bad0: 82 81 ldd r24, Z+2 ; 0x02 1bad2: 93 81 ldd r25, Z+3 ; 0x03 1bad4: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 1bad8: ed 81 ldd r30, Y+5 ; 0x05 1bada: fe 81 ldd r31, Y+6 ; 0x06 1badc: 60 83 st Z, r22 1bade: 71 83 std Z+1, r23 ; 0x01 1bae0: 82 83 std Z+2, r24 ; 0x02 1bae2: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1bae4: 60 e0 ldi r22, 0x00 ; 0 1bae6: 70 e0 ldi r23, 0x00 ; 0 1bae8: 84 e3 ldi r24, 0x34 ; 52 1baea: 92 e4 ldi r25, 0x42 ; 66 1baec: 0f 94 04 c0 call 0x38008 ; 0x38008 st_synchronize(); 1baf0: 0f 94 a3 42 call 0x28546 ; 0x28546 #endif } void tmc2130_sg_measure_start(uint8_t axis) { tmc2130_sg_measure = axis; 1baf4: 10 93 3b 02 sts 0x023B, r17 ; 0x80023b <_ZL18tmc2130_sg_measure.lto_priv.473> tmc2130_sg_measure_cnt = 0; 1baf8: 10 92 cb 03 sts 0x03CB, r1 ; 0x8003cb <_ZL22tmc2130_sg_measure_cnt.lto_priv.475> 1bafc: 10 92 cc 03 sts 0x03CC, r1 ; 0x8003cc <_ZL22tmc2130_sg_measure_cnt.lto_priv.475+0x1> 1bb00: 10 92 cd 03 sts 0x03CD, r1 ; 0x8003cd <_ZL22tmc2130_sg_measure_cnt.lto_priv.475+0x2> 1bb04: 10 92 ce 03 sts 0x03CE, r1 ; 0x8003ce <_ZL22tmc2130_sg_measure_cnt.lto_priv.475+0x3> tmc2130_sg_measure_val = 0; 1bb08: 10 92 cf 03 sts 0x03CF, r1 ; 0x8003cf <_ZL22tmc2130_sg_measure_val.lto_priv.474> 1bb0c: 10 92 d0 03 sts 0x03D0, r1 ; 0x8003d0 <_ZL22tmc2130_sg_measure_val.lto_priv.474+0x1> 1bb10: 10 92 d1 03 sts 0x03D1, r1 ; 0x8003d1 <_ZL22tmc2130_sg_measure_val.lto_priv.474+0x2> 1bb14: 10 92 d2 03 sts 0x03D2, r1 ; 0x8003d2 <_ZL22tmc2130_sg_measure_val.lto_priv.474+0x3> tmc2130_sg_measure_start(axis); current_position_init = st_get_position_mm(axis); 1bb18: 81 2f mov r24, r17 1bb1a: 0f 94 8f 42 call 0x2851e ; 0x2851e 1bb1e: 6b 01 movw r12, r22 1bb20: 7c 01 movw r14, r24 current_position[axis] += 2 * margin; 1bb22: 20 e0 ldi r18, 0x00 ; 0 1bb24: 30 e0 ldi r19, 0x00 ; 0 1bb26: 40 ef ldi r20, 0xF0 ; 240 1bb28: 52 e4 ldi r21, 0x42 ; 66 1bb2a: ed 81 ldd r30, Y+5 ; 0x05 1bb2c: fe 81 ldd r31, Y+6 ; 0x06 1bb2e: 60 81 ld r22, Z 1bb30: 71 81 ldd r23, Z+1 ; 0x01 1bb32: 82 81 ldd r24, Z+2 ; 0x02 1bb34: 93 81 ldd r25, Z+3 ; 0x03 1bb36: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 1bb3a: ed 81 ldd r30, Y+5 ; 0x05 1bb3c: fe 81 ldd r31, Y+6 ; 0x06 1bb3e: 60 83 st Z, r22 1bb40: 71 83 std Z+1, r23 ; 0x01 1bb42: 82 83 std Z+2, r24 ; 0x02 1bb44: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1bb46: 60 e0 ldi r22, 0x00 ; 0 1bb48: 70 e0 ldi r23, 0x00 ; 0 1bb4a: 84 e3 ldi r24, 0x34 ; 52 1bb4c: 92 e4 ldi r25, 0x42 ; 66 1bb4e: 0f 94 04 c0 call 0x38008 ; 0x38008 st_synchronize(); 1bb52: 0f 94 a3 42 call 0x28546 ; 0x28546 current_position[axis] += axis_length; 1bb56: a5 01 movw r20, r10 1bb58: 94 01 movw r18, r8 1bb5a: ed 81 ldd r30, Y+5 ; 0x05 1bb5c: fe 81 ldd r31, Y+6 ; 0x06 1bb5e: 60 81 ld r22, Z 1bb60: 71 81 ldd r23, Z+1 ; 0x01 1bb62: 82 81 ldd r24, Z+2 ; 0x02 1bb64: 93 81 ldd r25, Z+3 ; 0x03 1bb66: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 1bb6a: ed 81 ldd r30, Y+5 ; 0x05 1bb6c: fe 81 ldd r31, Y+6 ; 0x06 1bb6e: 60 83 st Z, r22 1bb70: 71 83 std Z+1, r23 ; 0x01 1bb72: 82 83 std Z+2, r24 ; 0x02 1bb74: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1bb76: 60 e0 ldi r22, 0x00 ; 0 1bb78: 70 e0 ldi r23, 0x00 ; 0 1bb7a: 84 e3 ldi r24, 0x34 ; 52 1bb7c: 92 e4 ldi r25, 0x42 ; 66 1bb7e: 0f 94 04 c0 call 0x38008 ; 0x38008 st_synchronize(); 1bb82: 0f 94 a3 42 call 0x28546 ; 0x28546 } uint16_t tmc2130_sg_measure_stop() { tmc2130_sg_measure = 0xff; 1bb86: 8f ef ldi r24, 0xFF ; 255 1bb88: 80 93 3b 02 sts 0x023B, r24 ; 0x80023b <_ZL18tmc2130_sg_measure.lto_priv.473> return tmc2130_sg_measure_val / tmc2130_sg_measure_cnt; 1bb8c: 60 91 cf 03 lds r22, 0x03CF ; 0x8003cf <_ZL22tmc2130_sg_measure_val.lto_priv.474> 1bb90: 70 91 d0 03 lds r23, 0x03D0 ; 0x8003d0 <_ZL22tmc2130_sg_measure_val.lto_priv.474+0x1> 1bb94: 80 91 d1 03 lds r24, 0x03D1 ; 0x8003d1 <_ZL22tmc2130_sg_measure_val.lto_priv.474+0x2> 1bb98: 90 91 d2 03 lds r25, 0x03D2 ; 0x8003d2 <_ZL22tmc2130_sg_measure_val.lto_priv.474+0x3> 1bb9c: 20 91 cb 03 lds r18, 0x03CB ; 0x8003cb <_ZL22tmc2130_sg_measure_cnt.lto_priv.475> 1bba0: 30 91 cc 03 lds r19, 0x03CC ; 0x8003cc <_ZL22tmc2130_sg_measure_cnt.lto_priv.475+0x1> 1bba4: 40 91 cd 03 lds r20, 0x03CD ; 0x8003cd <_ZL22tmc2130_sg_measure_cnt.lto_priv.475+0x2> 1bba8: 50 91 ce 03 lds r21, 0x03CE ; 0x8003ce <_ZL22tmc2130_sg_measure_cnt.lto_priv.475+0x3> 1bbac: 0f 94 4a dc call 0x3b894 ; 0x3b894 <__udivmodsi4> 1bbb0: 2d 83 std Y+5, r18 ; 0x05 1bbb2: 3f 83 std Y+7, r19 ; 0x07 uint16_t sg1 = tmc2130_sg_measure_stop(); printf_P(PSTR("%c AXIS SG1=%d\n"), 'X'+axis, sg1); 1bbb4: 3f 93 push r19 1bbb6: 2f 93 push r18 1bbb8: f8 e5 ldi r31, 0x58 ; 88 1bbba: 6f 0e add r6, r31 1bbbc: 71 1c adc r7, r1 1bbbe: 7f 92 push r7 1bbc0: 6f 92 push r6 1bbc2: 87 e9 ldi r24, 0x97 ; 151 1bbc4: 9a e8 ldi r25, 0x8A ; 138 1bbc6: 9f 93 push r25 1bbc8: 8f 93 push r24 1bbca: 0f 94 99 da call 0x3b532 ; 0x3b532 eeprom_write_word_notify(((uint16_t*)((axis == X_AXIS)?EEPROM_BELTSTATUS_X:EEPROM_BELTSTATUS_Y)), sg1); 1bbce: 0f 90 pop r0 1bbd0: 0f 90 pop r0 1bbd2: 0f 90 pop r0 1bbd4: 0f 90 pop r0 1bbd6: 0f 90 pop r0 1bbd8: 0f 90 pop r0 1bbda: 8b e5 ldi r24, 0x5B ; 91 1bbdc: 9f e0 ldi r25, 0x0F ; 15 1bbde: 11 11 cpse r17, r1 1bbe0: 02 c0 rjmp .+4 ; 0x1bbe6 1bbe2: 8d e5 ldi r24, 0x5D ; 93 1bbe4: 9f e0 ldi r25, 0x0F ; 15 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); 1bbe6: 6d 81 ldd r22, Y+5 ; 0x05 1bbe8: 7f 81 ldd r23, Y+7 ; 0x07 1bbea: 0f 94 35 dc call 0x3b86a ; 0x3b86a current_position_final = st_get_position_mm(axis); 1bbee: 81 2f mov r24, r17 1bbf0: 0f 94 8f 42 call 0x2851e ; 0x2851e 1bbf4: 2b 01 movw r4, r22 1bbf6: 3c 01 movw r6, r24 measured_axis_length[0] = fabs(current_position_final - current_position_init); 1bbf8: a7 01 movw r20, r14 1bbfa: 96 01 movw r18, r12 1bbfc: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 1bc00: 6b 01 movw r12, r22 1bc02: 7c 01 movw r14, r24 1bc04: e8 94 clt 1bc06: f7 f8 bld r15, 7 // first measurement end and second measurement begin current_position[axis] -= margin; 1bc08: c1 01 movw r24, r2 1bc0a: 8f 56 subi r24, 0x6F ; 111 1bc0c: 99 4f sbci r25, 0xF9 ; 249 1bc0e: 9e 83 std Y+6, r25 ; 0x06 1bc10: 8d 83 std Y+5, r24 ; 0x05 1bc12: 20 e0 ldi r18, 0x00 ; 0 1bc14: 30 e0 ldi r19, 0x00 ; 0 1bc16: 40 e7 ldi r20, 0x70 ; 112 1bc18: 52 e4 ldi r21, 0x42 ; 66 1bc1a: fc 01 movw r30, r24 1bc1c: 60 81 ld r22, Z 1bc1e: 71 81 ldd r23, Z+1 ; 0x01 1bc20: 82 81 ldd r24, Z+2 ; 0x02 1bc22: 93 81 ldd r25, Z+3 ; 0x03 1bc24: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 1bc28: ed 81 ldd r30, Y+5 ; 0x05 1bc2a: fe 81 ldd r31, Y+6 ; 0x06 1bc2c: 60 83 st Z, r22 1bc2e: 71 83 std Z+1, r23 ; 0x01 1bc30: 82 83 std Z+2, r24 ; 0x02 1bc32: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1bc34: 60 e0 ldi r22, 0x00 ; 0 1bc36: 70 e0 ldi r23, 0x00 ; 0 1bc38: 84 e3 ldi r24, 0x34 ; 52 1bc3a: 92 e4 ldi r25, 0x42 ; 66 1bc3c: 0f 94 04 c0 call 0x38008 ; 0x38008 st_synchronize(); 1bc40: 0f 94 a3 42 call 0x28546 ; 0x28546 current_position[axis] -= (axis_length + margin); 1bc44: 29 81 ldd r18, Y+1 ; 0x01 1bc46: 3a 81 ldd r19, Y+2 ; 0x02 1bc48: 4b 81 ldd r20, Y+3 ; 0x03 1bc4a: 5c 81 ldd r21, Y+4 ; 0x04 1bc4c: ed 81 ldd r30, Y+5 ; 0x05 1bc4e: fe 81 ldd r31, Y+6 ; 0x06 1bc50: 60 81 ld r22, Z 1bc52: 71 81 ldd r23, Z+1 ; 0x01 1bc54: 82 81 ldd r24, Z+2 ; 0x02 1bc56: 93 81 ldd r25, Z+3 ; 0x03 1bc58: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 1bc5c: ed 81 ldd r30, Y+5 ; 0x05 1bc5e: fe 81 ldd r31, Y+6 ; 0x06 1bc60: 60 83 st Z, r22 1bc62: 71 83 std Z+1, r23 ; 0x01 1bc64: 82 83 std Z+2, r24 ; 0x02 1bc66: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1bc68: 60 e0 ldi r22, 0x00 ; 0 1bc6a: 70 e0 ldi r23, 0x00 ; 0 1bc6c: 84 e3 ldi r24, 0x34 ; 52 1bc6e: 92 e4 ldi r25, 0x42 ; 66 1bc70: 0f 94 04 c0 call 0x38008 ; 0x38008 st_synchronize(); 1bc74: 0f 94 a3 42 call 0x28546 ; 0x28546 current_position_init = st_get_position_mm(axis); 1bc78: 81 2f mov r24, r17 1bc7a: 0f 94 8f 42 call 0x2851e ; 0x2851e 1bc7e: 9b 01 movw r18, r22 1bc80: ac 01 movw r20, r24 measured_axis_length[1] = fabs(current_position_final - current_position_init); 1bc82: c3 01 movw r24, r6 1bc84: b2 01 movw r22, r4 1bc86: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 1bc8a: 2b 01 movw r4, r22 1bc8c: 3c 01 movw r6, r24 1bc8e: e8 94 clt 1bc90: 77 f8 bld r7, 7 tmc2130_home_exit(); 1bc92: 0f 94 7f 25 call 0x24afe ; 0x24afe //end of second measurement, now check for possible errors: for(uint_least8_t i = 0; i < 2; i++){ //check if measured axis length corresponds to expected length printf_P(_N("Measured axis length:%.3f\n"), measured_axis_length[i]); 1bc96: ff 92 push r15 1bc98: ef 92 push r14 1bc9a: df 92 push r13 1bc9c: cf 92 push r12 1bc9e: 81 ea ldi r24, 0xA1 ; 161 1bca0: 9b e6 ldi r25, 0x6B ; 107 1bca2: 9f 93 push r25 1bca4: 8f 93 push r24 1bca6: 0f 94 99 da call 0x3b532 ; 0x3b532 if (fabs(measured_axis_length[i] - axis_length) > max_error_mm) { 1bcaa: a5 01 movw r20, r10 1bcac: 94 01 movw r18, r8 1bcae: c7 01 movw r24, r14 1bcb0: b6 01 movw r22, r12 1bcb2: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 1bcb6: 9f 77 andi r25, 0x7F ; 127 1bcb8: 0f 90 pop r0 1bcba: 0f 90 pop r0 1bcbc: 0f 90 pop r0 1bcbe: 0f 90 pop r0 1bcc0: 0f 90 pop r0 1bcc2: 0f 90 pop r0 1bcc4: 20 e0 ldi r18, 0x00 ; 0 1bcc6: 30 e0 ldi r19, 0x00 ; 0 1bcc8: 40 ea ldi r20, 0xA0 ; 160 1bcca: 50 e4 ldi r21, 0x40 ; 64 1bccc: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 1bcd0: 18 16 cp r1, r24 1bcd2: 0c f4 brge .+2 ; 0x1bcd6 1bcd4: 53 c0 rjmp .+166 ; 0x1bd7c tmc2130_home_exit(); //end of second measurement, now check for possible errors: for(uint_least8_t i = 0; i < 2; i++){ //check if measured axis length corresponds to expected length printf_P(_N("Measured axis length:%.3f\n"), measured_axis_length[i]); 1bcd6: 7f 92 push r7 1bcd8: 6f 92 push r6 1bcda: 5f 92 push r5 1bcdc: 4f 92 push r4 1bcde: 81 ea ldi r24, 0xA1 ; 161 1bce0: 9b e6 ldi r25, 0x6B ; 107 1bce2: 9f 93 push r25 1bce4: 8f 93 push r24 1bce6: 0f 94 99 da call 0x3b532 ; 0x3b532 if (fabs(measured_axis_length[i] - axis_length) > max_error_mm) { 1bcea: a5 01 movw r20, r10 1bcec: 94 01 movw r18, r8 1bcee: c3 01 movw r24, r6 1bcf0: b2 01 movw r22, r4 1bcf2: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 1bcf6: 9f 77 andi r25, 0x7F ; 127 1bcf8: 0f 90 pop r0 1bcfa: 0f 90 pop r0 1bcfc: 0f 90 pop r0 1bcfe: 0f 90 pop r0 1bd00: 0f 90 pop r0 1bd02: 0f 90 pop r0 1bd04: 20 e0 ldi r18, 0x00 ; 0 1bd06: 30 e0 ldi r19, 0x00 ; 0 1bd08: 40 ea ldi r20, 0xA0 ; 160 1bd0a: 50 e4 ldi r21, 0x40 ; 64 1bd0c: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 1bd10: 18 16 cp r1, r24 1bd12: a4 f1 brlt .+104 ; 0x1bd7c endstops_hit_on_purpose(); return false; } } printf_P(_N("Axis length difference:%.3f\n"), fabs(measured_axis_length[0] - measured_axis_length[1])); 1bd14: a3 01 movw r20, r6 1bd16: 92 01 movw r18, r4 1bd18: c7 01 movw r24, r14 1bd1a: b6 01 movw r22, r12 1bd1c: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 1bd20: 6b 01 movw r12, r22 1bd22: 7c 01 movw r14, r24 1bd24: e8 94 clt 1bd26: f7 f8 bld r15, 7 1bd28: ff 92 push r15 1bd2a: ef 92 push r14 1bd2c: df 92 push r13 1bd2e: cf 92 push r12 1bd30: 84 e8 ldi r24, 0x84 ; 132 1bd32: 9b e6 ldi r25, 0x6B ; 107 1bd34: 9f 93 push r25 1bd36: 8f 93 push r24 1bd38: 0f 94 99 da call 0x3b532 ; 0x3b532 if (fabs(measured_axis_length[0] - measured_axis_length[1]) > 1) { //check if difference between first and second measurement is low 1bd3c: 0f 90 pop r0 1bd3e: 0f 90 pop r0 1bd40: 0f 90 pop r0 1bd42: 0f 90 pop r0 1bd44: 0f 90 pop r0 1bd46: 0f 90 pop r0 1bd48: 20 e0 ldi r18, 0x00 ; 0 1bd4a: 30 e0 ldi r19, 0x00 ; 0 1bd4c: 40 e8 ldi r20, 0x80 ; 128 1bd4e: 5f e3 ldi r21, 0x3F ; 63 1bd50: c7 01 movw r24, r14 1bd52: b6 01 movw r22, r12 1bd54: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 1bd58: 18 16 cp r1, r24 1bd5a: 0c f4 brge .+2 ; 0x1bd5e 1bd5c: 44 c0 rjmp .+136 ; 0x1bde6 plan_set_position_curposXYZE(); reset_crash_det(axis); endstops_hit_on_purpose(); return false; } current_position[axis] = 0; 1bd5e: ed 81 ldd r30, Y+5 ; 0x05 1bd60: fe 81 ldd r31, Y+6 ; 0x06 1bd62: 10 82 st Z, r1 1bd64: 11 82 std Z+1, r1 ; 0x01 1bd66: 12 82 std Z+2, r1 ; 0x02 1bd68: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 1bd6a: 0f 94 c4 be call 0x37d88 ; 0x37d88 reset_crash_det(axis); 1bd6e: 81 2f mov r24, r17 1bd70: 0e 94 ec dc call 0x1b9d8 ; 0x1b9d8 endstops_hit_on_purpose(); 1bd74: 0f 94 b9 4d call 0x29b72 ; 0x29b72 return true; 1bd78: 81 e0 ldi r24, 0x01 ; 1 1bd7a: 1d c0 rjmp .+58 ; 0x1bdb6 1bd7c: 10 92 b7 02 sts 0x02B7, r1 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> enable_endstops(false); const char *_error_1; if (axis == X_AXIS) _error_1 = "X"; if (axis == Y_AXIS) _error_1 = "Y"; 1bd80: 63 ee ldi r22, 0xE3 ; 227 1bd82: 72 e0 ldi r23, 0x02 ; 2 1bd84: 11 30 cpi r17, 0x01 ; 1 1bd86: 11 f0 breq .+4 ; 0x1bd8c 1bd88: 61 ee ldi r22, 0xE1 ; 225 1bd8a: 72 e0 ldi r23, 0x02 ; 2 if (axis == Z_AXIS) _error_1 = "Z"; lcd_selftest_error(TestError::Axis, _error_1, ""); 1bd8c: 88 e0 ldi r24, 0x08 ; 8 1bd8e: 0f 94 29 9f call 0x33e52 ; 0x33e52 current_position[axis] = 0; 1bd92: f1 01 movw r30, r2 1bd94: ef 56 subi r30, 0x6F ; 111 1bd96: f9 4f sbci r31, 0xF9 ; 249 1bd98: 10 82 st Z, r1 1bd9a: 11 82 std Z+1, r1 ; 0x01 1bd9c: 12 82 std Z+2, r1 ; 0x02 1bd9e: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 1bda0: 0f 94 c4 be call 0x37d88 ; 0x37d88 reset_crash_det(axis); 1bda4: 81 2f mov r24, r17 1bda6: 0e 94 ec dc call 0x1b9d8 ; 0x1b9d8 1bdaa: 81 e0 ldi r24, 0x01 ; 1 1bdac: 80 93 b7 02 sts 0x02B7, r24 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> lcd_selftest_error(TestError::Pulley, _error_1, ""); current_position[axis] = 0; plan_set_position_curposXYZE(); reset_crash_det(axis); endstops_hit_on_purpose(); 1bdb0: 0f 94 b9 4d call 0x29b72 ; 0x29b72 return false; 1bdb4: 80 e0 ldi r24, 0x00 ; 0 current_position[axis] = 0; plan_set_position_curposXYZE(); reset_crash_det(axis); endstops_hit_on_purpose(); return true; } 1bdb6: 27 96 adiw r28, 0x07 ; 7 1bdb8: 0f b6 in r0, 0x3f ; 63 1bdba: f8 94 cli 1bdbc: de bf out 0x3e, r29 ; 62 1bdbe: 0f be out 0x3f, r0 ; 63 1bdc0: cd bf out 0x3d, r28 ; 61 1bdc2: df 91 pop r29 1bdc4: cf 91 pop r28 1bdc6: 1f 91 pop r17 1bdc8: ff 90 pop r15 1bdca: ef 90 pop r14 1bdcc: df 90 pop r13 1bdce: cf 90 pop r12 1bdd0: bf 90 pop r11 1bdd2: af 90 pop r10 1bdd4: 9f 90 pop r9 1bdd6: 8f 90 pop r8 1bdd8: 7f 90 pop r7 1bdda: 6f 90 pop r6 1bddc: 5f 90 pop r5 1bdde: 4f 90 pop r4 1bde0: 3f 90 pop r3 1bde2: 2f 90 pop r2 1bde4: 08 95 ret if (fabs(measured_axis_length[0] - measured_axis_length[1]) > 1) { //check if difference between first and second measurement is low //loose pulleys const char *_error_1; if (axis == X_AXIS) _error_1 = "X"; if (axis == Y_AXIS) _error_1 = "Y"; 1bde6: 63 ee ldi r22, 0xE3 ; 227 1bde8: 72 e0 ldi r23, 0x02 ; 2 1bdea: 11 30 cpi r17, 0x01 ; 1 1bdec: 11 f0 breq .+4 ; 0x1bdf2 1bdee: 61 ee ldi r22, 0xE1 ; 225 1bdf0: 72 e0 ldi r23, 0x02 ; 2 if (axis == Z_AXIS) _error_1 = "Z"; lcd_selftest_error(TestError::Pulley, _error_1, ""); 1bdf2: 87 e0 ldi r24, 0x07 ; 7 1bdf4: 0f 94 29 9f call 0x33e52 ; 0x33e52 current_position[axis] = 0; 1bdf8: f1 01 movw r30, r2 1bdfa: ef 56 subi r30, 0x6F ; 111 1bdfc: f9 4f sbci r31, 0xF9 ; 249 1bdfe: 10 82 st Z, r1 1be00: 11 82 std Z+1, r1 ; 0x01 1be02: 12 82 std Z+2, r1 ; 0x02 1be04: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 1be06: 0f 94 c4 be call 0x37d88 ; 0x37d88 reset_crash_det(axis); 1be0a: 81 2f mov r24, r17 1be0c: 0e 94 ec dc call 0x1b9d8 ; 0x1b9d8 1be10: cf cf rjmp .-98 ; 0x1bdb0 0001be12 : } #ifdef TMC2130 static void crash_mode_switch() { eeprom_toggle((uint8_t*)EEPROM_CRASH_DET); 1be12: 89 e6 ldi r24, 0x69 ; 105 1be14: 9f e0 ldi r25, 0x0F ; 15 1be16: 0e 94 4c 76 call 0xec98 ; 0xec98 crashdet_use_eeprom_setting(); 1be1a: 0d 94 2b 26 jmp 0x24c56 ; 0x24c56 0001be1e : #endif //SDCARD_SORT_ALPHA #ifdef TMC2130 static void lcd_crash_mode_info() { lcd_home(); 1be1e: 0e 94 24 6f call 0xde48 ; 0xde48 lcd_puts_P(_T(MSG_CRASH_DET_ONLY_IN_NORMAL)); 1be22: 89 ea ldi r24, 0xA9 ; 169 1be24: 9a e3 ldi r25, 0x3A ; 58 1be26: 0e 94 c4 72 call 0xe588 ; 0xe588 1be2a: 0e 94 e3 6e call 0xddc6 ; 0xddc6 menu_back_if_clicked(); 1be2e: 0d 94 bb d4 jmp 0x3a976 ; 0x3a976 0001be32 : } static void lcd_crash_mode_info2() { lcd_home(); 1be32: 0e 94 24 6f call 0xde48 ; 0xde48 lcd_puts_P(_T(MSG_CRASH_DET_STEALTH_FORCE_OFF)); 1be36: 80 ee ldi r24, 0xE0 ; 224 1be38: 9a e3 ldi r25, 0x3A ; 58 1be3a: 0e 94 c4 72 call 0xe588 ; 0xe588 1be3e: 0e 94 e3 6e call 0xddc6 ; 0xddc6 menu_back_if_clicked(); 1be42: 0d 94 bb d4 jmp 0x3a976 ; 0x3a976 0001be46 : default: _md->menuState = _uninitialized; //shouldn't ever happen. Anyways, initialize the menu. } } #ifdef TMC2130 static void lcd_belttest_v() { 1be46: 0f 93 push r16 1be48: 1f 93 push r17 1be4a: cf 93 push r28 1be4c: df 93 push r29 menu_back_if_clicked(); } void lcd_belttest() { lcd_clear(); 1be4e: 0e 94 2b 6f call 0xde56 ; 0xde56 // Belttest requires high power mode. Enable it. FORCE_HIGH_POWER_START; 1be52: 81 e0 ldi r24, 0x01 ; 1 1be54: 0e 94 c8 66 call 0xcd90 ; 0xcd90 uint16_t X = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_X)); 1be58: 8d e5 ldi r24, 0x5D ; 93 1be5a: 9f e0 ldi r25, 0x0F ; 15 1be5c: 0f 94 e5 db call 0x3b7ca ; 0x3b7ca 1be60: ec 01 movw r28, r24 uint16_t Y = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_Y)); 1be62: 8b e5 ldi r24, 0x5B ; 91 1be64: 9f e0 ldi r25, 0x0F ; 15 1be66: 0f 94 e5 db call 0x3b7ca ; 0x3b7ca 1be6a: 18 2f mov r17, r24 1be6c: 09 2f mov r16, r25 lcd_puts_P(_T(MSG_CHECKING_X)); 1be6e: 87 e8 ldi r24, 0x87 ; 135 1be70: 99 e4 ldi r25, 0x49 ; 73 1be72: 0e 94 c4 72 call 0xe588 ; 0xe588 1be76: 0e 94 e3 6e call 0xddc6 ; 0xddc6 lcd_set_cursor(0,1), lcd_printf_P(PSTR("X: %u -> ..."),X); 1be7a: 61 e0 ldi r22, 0x01 ; 1 1be7c: 80 e0 ldi r24, 0x00 ; 0 1be7e: 0e 94 f8 6e call 0xddf0 ; 0xddf0 1be82: df 93 push r29 1be84: cf 93 push r28 1be86: 8e e7 ldi r24, 0x7E ; 126 1be88: 9a e8 ldi r25, 0x8A ; 138 1be8a: 9f 93 push r25 1be8c: 8f 93 push r24 1be8e: 0e 94 d1 6e call 0xdda2 ; 0xdda2 KEEPALIVE_STATE(IN_HANDLER); 1be92: 82 e0 ldi r24, 0x02 ; 2 1be94: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be // N.B: it doesn't make sense to handle !lcd_selfcheck...() because selftest_sg throws its own error screen // that clobbers ours, with more info than we could provide. So on fail we just fall through to take us back to status. if (lcd_selfcheck_axis_sg(X_AXIS)){ 1be98: 80 e0 ldi r24, 0x00 ; 0 1be9a: 0e 94 0e dd call 0x1ba1c ; 0x1ba1c 1be9e: 0f 90 pop r0 1bea0: 0f 90 pop r0 1bea2: 0f 90 pop r0 1bea4: 0f 90 pop r0 1bea6: 88 23 and r24, r24 1bea8: 09 f4 brne .+2 ; 0x1beac 1beaa: 45 c0 rjmp .+138 ; 0x1bf36 X = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_X)); 1beac: 8d e5 ldi r24, 0x5D ; 93 1beae: 9f e0 ldi r25, 0x0F ; 15 1beb0: 0f 94 e5 db call 0x3b7ca ; 0x3b7ca 1beb4: ec 01 movw r28, r24 lcd_set_cursor(10, 1); 1beb6: 61 e0 ldi r22, 0x01 ; 1 1beb8: 8a e0 ldi r24, 0x0A ; 10 1beba: 0e 94 f8 6e call 0xddf0 ; 0xddf0 lcd_print((long) n, base); } void lcd_print(unsigned int n, int base) { lcd_print((unsigned long) n, base); 1bebe: be 01 movw r22, r28 1bec0: 90 e0 ldi r25, 0x00 ; 0 1bec2: 80 e0 ldi r24, 0x00 ; 0 void lcd_print(unsigned long n, int base) { if (base == 0) lcd_write(n); else lcd_printNumber(n, base); 1bec4: 4a e0 ldi r20, 0x0A ; 10 1bec6: 0e 94 4c 70 call 0xe098 ; 0xe098 lcd_print(X); // Show new X value next to old one. lcd_puts_at_P(0, 2, _T(MSG_CHECKING_Y)); 1beca: 85 e7 ldi r24, 0x75 ; 117 1becc: 99 e4 ldi r25, 0x49 ; 73 1bece: 0e 94 c4 72 call 0xe588 ; 0xe588 1bed2: ac 01 movw r20, r24 1bed4: 62 e0 ldi r22, 0x02 ; 2 1bed6: 80 e0 ldi r24, 0x00 ; 0 1bed8: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_set_cursor(0, 3), lcd_printf_P(PSTR("Y: %u -> ..."),Y); 1bedc: 63 e0 ldi r22, 0x03 ; 3 1bede: 80 e0 ldi r24, 0x00 ; 0 1bee0: 0e 94 f8 6e call 0xddf0 ; 0xddf0 1bee4: 0f 93 push r16 1bee6: 1f 93 push r17 1bee8: 81 e7 ldi r24, 0x71 ; 113 1beea: 9a e8 ldi r25, 0x8A ; 138 1beec: 9f 93 push r25 1beee: 8f 93 push r24 1bef0: 0e 94 d1 6e call 0xdda2 ; 0xdda2 if (lcd_selfcheck_axis_sg(Y_AXIS)) 1bef4: 81 e0 ldi r24, 0x01 ; 1 1bef6: 0e 94 0e dd call 0x1ba1c ; 0x1ba1c 1befa: 0f 90 pop r0 1befc: 0f 90 pop r0 1befe: 0f 90 pop r0 1bf00: 0f 90 pop r0 1bf02: 88 23 and r24, r24 1bf04: c1 f0 breq .+48 ; 0x1bf36 { Y = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_Y)); 1bf06: 8b e5 ldi r24, 0x5B ; 91 1bf08: 9f e0 ldi r25, 0x0F ; 15 1bf0a: 0f 94 e5 db call 0x3b7ca ; 0x3b7ca 1bf0e: ec 01 movw r28, r24 lcd_set_cursor(10, 3); 1bf10: 63 e0 ldi r22, 0x03 ; 3 1bf12: 8a e0 ldi r24, 0x0A ; 10 1bf14: 0e 94 f8 6e call 0xddf0 ; 0xddf0 lcd_print((long) n, base); } void lcd_print(unsigned int n, int base) { lcd_print((unsigned long) n, base); 1bf18: be 01 movw r22, r28 1bf1a: 90 e0 ldi r25, 0x00 ; 0 1bf1c: 80 e0 ldi r24, 0x00 ; 0 void lcd_print(unsigned long n, int base) { if (base == 0) lcd_write(n); else lcd_printNumber(n, base); 1bf1e: 4a e0 ldi r20, 0x0A ; 10 1bf20: 0e 94 4c 70 call 0xe098 ; 0xe098 lcd_print(Y); lcd_putc_at(19, 3, LCD_STR_UPLEVEL[0]); 1bf24: 43 e8 ldi r20, 0x83 ; 131 1bf26: 63 e0 ldi r22, 0x03 ; 3 1bf28: 83 e1 ldi r24, 0x13 ; 19 1bf2a: 0e 94 18 6f call 0xde30 ; 0xde30 lcd_wait_for_click_delay(10); 1bf2e: 8a e0 ldi r24, 0x0A ; 10 1bf30: 90 e0 ldi r25, 0x00 ; 0 1bf32: 0f 94 01 3a call 0x27402 ; 0x27402 } } FORCE_HIGH_POWER_END; 1bf36: 80 e0 ldi r24, 0x00 ; 0 1bf38: 0e 94 c8 66 call 0xcd90 ; 0xcd90 KEEPALIVE_STATE(NOT_BUSY); 1bf3c: 81 e0 ldi r24, 0x01 ; 1 1bf3e: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be #ifdef TMC2130 static void lcd_belttest_v() { lcd_belttest(); menu_back_if_clicked(); } 1bf42: df 91 pop r29 1bf44: cf 91 pop r28 1bf46: 1f 91 pop r17 1bf48: 0f 91 pop r16 } #ifdef TMC2130 static void lcd_belttest_v() { lcd_belttest(); menu_back_if_clicked(); 1bf4a: 0d 94 bb d4 jmp 0x3a976 ; 0x3a976 0001bf4e : static void lcd_sd_refresh() { #if SDCARDDETECT == -1 card.mount(); #else card.presort(); 1bf4e: 0f 94 4d 7c call 0x2f89a ; 0x2f89a #endif menu_top = 0; 1bf52: 10 92 a3 03 sts 0x03A3, r1 ; 0x8003a3 lcd_encoder = 0; 1bf56: 10 92 70 06 sts 0x0670, r1 ; 0x800670 1bf5a: 10 92 6f 06 sts 0x066F, r1 ; 0x80066f menu_data_reset(); //Forces reloading of cached variables. 1bf5e: 0d 94 73 d1 jmp 0x3a2e6 ; 0x3a2e6 0001bf62 : } } void CardReader::updir() { if(workDirDepth > 0) 1bf62: 80 91 2f 16 lds r24, 0x162F ; 0x80162f 1bf66: 88 23 and r24, r24 1bf68: f9 f0 breq .+62 ; 0x1bfa8 { --workDirDepth; 1bf6a: 81 50 subi r24, 0x01 ; 1 1bf6c: 80 93 2f 16 sts 0x162F, r24 ; 0x80162f workDir = workDirParents[0]; 1bf70: 93 e2 ldi r25, 0x23 ; 35 1bf72: ed e5 ldi r30, 0x5D ; 93 1bf74: f5 e1 ldi r31, 0x15 ; 21 1bf76: aa e3 ldi r26, 0x3A ; 58 1bf78: b5 e1 ldi r27, 0x15 ; 21 1bf7a: 01 90 ld r0, Z+ 1bf7c: 0d 92 st X+, r0 1bf7e: 9a 95 dec r25 1bf80: e1 f7 brne .-8 ; 0x1bf7a 1bf82: 2d e5 ldi r18, 0x5D ; 93 1bf84: 35 e1 ldi r19, 0x15 ; 21 for (uint8_t d = 0; d < workDirDepth; d++) 1bf86: 90 e0 ldi r25, 0x00 ; 0 1bf88: 98 17 cp r25, r24 1bf8a: 60 f4 brcc .+24 ; 0x1bfa4 { workDirParents[d] = workDirParents[d+1]; 1bf8c: 43 e2 ldi r20, 0x23 ; 35 1bf8e: f9 01 movw r30, r18 1bf90: b3 96 adiw r30, 0x23 ; 35 1bf92: d9 01 movw r26, r18 1bf94: 01 90 ld r0, Z+ 1bf96: 0d 92 st X+, r0 1bf98: 4a 95 dec r20 1bf9a: e1 f7 brne .-8 ; 0x1bf94 { if(workDirDepth > 0) { --workDirDepth; workDir = workDirParents[0]; for (uint8_t d = 0; d < workDirDepth; d++) 1bf9c: 9f 5f subi r25, 0xFF ; 255 1bf9e: 2d 5d subi r18, 0xDD ; 221 1bfa0: 3f 4f sbci r19, 0xFF ; 255 1bfa2: f2 cf rjmp .-28 ; 0x1bf88 { workDirParents[d] = workDirParents[d+1]; } #ifdef SDCARD_SORT_ALPHA presort(); 1bfa4: 0f 94 4d 7c call 0x2f89a ; 0x2f89a } static void lcd_sd_updir() { card.updir(); menu_top = 0; 1bfa8: 10 92 a3 03 sts 0x03A3, r1 ; 0x8003a3 lcd_encoder = 0; 1bfac: 10 92 70 06 sts 0x0670, r1 ; 0x800670 1bfb0: 10 92 6f 06 sts 0x066F, r1 ; 0x80066f menu_data_reset(); //Forces reloading of cached variables. 1bfb4: 0d 94 73 d1 jmp 0x3a2e6 ; 0x3a2e6 0001bfb8 : } backlight_save(); } static void lcd_backlight_menu() { 1bfb8: ef 92 push r14 1bfba: ff 92 push r15 1bfbc: 0f 93 push r16 1bfbe: 1f 93 push r17 1bfc0: cf 93 push r28 1bfc2: df 93 push r29 MENU_BEGIN(); 1bfc4: 0f 94 51 d1 call 0x3a2a2 ; 0x3a2a2 1bfc8: 10 92 11 05 sts 0x0511, r1 ; 0x800511 1bfcc: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1bfd0: 84 30 cpi r24, 0x04 ; 4 1bfd2: 08 f0 brcs .+2 ; 0x1bfd6 1bfd4: 63 c0 rjmp .+198 ; 0x1c09c 1bfd6: 10 92 14 05 sts 0x0514, r1 ; 0x800514 ON_MENU_LEAVE( 1bfda: 0f 94 d1 cf call 0x39fa2 ; 0x39fa2 1bfde: 81 11 cpse r24, r1 1bfe0: 0e 94 47 8a call 0x1148e ; 0x1148e backlight_save(); ); MENU_ITEM_BACK_P(_T(MSG_BACK)); 1bfe4: 8c eb ldi r24, 0xBC ; 188 1bfe6: 99 e4 ldi r25, 0x49 ; 73 1bfe8: 0e 94 c4 72 call 0xe588 ; 0xe588 1bfec: 0f 94 1c d4 call 0x3a838 ; 0x3a838 MENU_ITEM_EDIT_int3_P(_T(MSG_BL_HIGH), &backlightLevel_HIGH, backlightLevel_LOW, 255); 1bff0: c0 91 ff 03 lds r28, 0x03FF ; 0x8003ff 1bff4: d0 e0 ldi r29, 0x00 ; 0 1bff6: 87 e3 ldi r24, 0x37 ; 55 1bff8: 98 e4 ldi r25, 0x48 ; 72 1bffa: 0e 94 c4 72 call 0xe588 ; 0xe588 1bffe: f1 2c mov r15, r1 1c000: e1 2c mov r14, r1 1c002: 0f ef ldi r16, 0xFF ; 255 1c004: 10 e0 ldi r17, 0x00 ; 0 1c006: 9e 01 movw r18, r28 1c008: 48 e0 ldi r20, 0x08 ; 8 1c00a: 60 e0 ldi r22, 0x00 ; 0 1c00c: 74 e0 ldi r23, 0x04 ; 4 1c00e: 0f 94 a1 d1 call 0x3a342 ; 0x3a342 MENU_ITEM_EDIT_int3_P(_T(MSG_BL_LOW), &backlightLevel_LOW, 0, backlightLevel_HIGH); 1c012: 00 91 00 04 lds r16, 0x0400 ; 0x800400 1c016: 10 e0 ldi r17, 0x00 ; 0 1c018: 88 e2 ldi r24, 0x28 ; 40 1c01a: 98 e4 ldi r25, 0x48 ; 72 1c01c: 0e 94 c4 72 call 0xe588 ; 0xe588 1c020: 30 e0 ldi r19, 0x00 ; 0 1c022: 20 e0 ldi r18, 0x00 ; 0 1c024: 48 e0 ldi r20, 0x08 ; 8 1c026: 6f ef ldi r22, 0xFF ; 255 1c028: 73 e0 ldi r23, 0x03 ; 3 1c02a: 0f 94 a1 d1 call 0x3a342 ; 0x3a342 MENU_ITEM_TOGGLE_P(_T(MSG_MODE), ((backlightMode==BACKLIGHT_MODE_BRIGHT) ? _T(MSG_BRIGHT) : ((backlightMode==BACKLIGHT_MODE_DIM) ? _T(MSG_DIM) : _T(MSG_AUTO))), backlight_mode_toggle); 1c02e: 80 91 4f 02 lds r24, 0x024F ; 0x80024f 1c032: 81 30 cpi r24, 0x01 ; 1 1c034: 59 f5 brne .+86 ; 0x1c08c 1c036: 8f e1 ldi r24, 0x1F ; 31 1c038: 98 e4 ldi r25, 0x48 ; 72 1c03a: 0e 94 c4 72 call 0xe588 ; 0xe588 1c03e: ec 01 movw r28, r24 1c040: 8b e0 ldi r24, 0x0B ; 11 1c042: 98 e4 ldi r25, 0x48 ; 72 1c044: 0e 94 c4 72 call 0xe588 ; 0xe588 1c048: 22 e0 ldi r18, 0x02 ; 2 1c04a: 45 e5 ldi r20, 0x55 ; 85 1c04c: 50 ee ldi r21, 0xE0 ; 224 1c04e: be 01 movw r22, r28 1c050: 0f 94 e0 d2 call 0x3a5c0 ; 0x3a5c0 MENU_ITEM_EDIT_int3_P(_T(MSG_TIMEOUT), &backlightTimer_period, 1, 999); 1c054: 81 e0 ldi r24, 0x01 ; 1 1c056: 98 e4 ldi r25, 0x48 ; 72 1c058: 0e 94 c4 72 call 0xe588 ; 0xe588 1c05c: f1 2c mov r15, r1 1c05e: e1 2c mov r14, r1 1c060: 07 ee ldi r16, 0xE7 ; 231 1c062: 13 e0 ldi r17, 0x03 ; 3 1c064: 21 e0 ldi r18, 0x01 ; 1 1c066: 30 e0 ldi r19, 0x00 ; 0 1c068: 40 e1 ldi r20, 0x10 ; 16 1c06a: 6d e4 ldi r22, 0x4D ; 77 1c06c: 72 e0 ldi r23, 0x02 ; 2 1c06e: 0f 94 a1 d1 call 0x3a342 ; 0x3a342 MENU_END(); 1c072: 0f 94 25 d1 call 0x3a24a ; 0x3a24a backlight_save(); } static void lcd_backlight_menu() { MENU_BEGIN(); 1c076: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1c07a: 8f 5f subi r24, 0xFF ; 255 1c07c: 80 93 11 05 sts 0x0511, r24 ; 0x800511 1c080: 80 91 13 05 lds r24, 0x0513 ; 0x800513 1c084: 8f 5f subi r24, 0xFF ; 255 1c086: 80 93 13 05 sts 0x0513, r24 ; 0x800513 1c08a: a0 cf rjmp .-192 ; 0x1bfcc ); MENU_ITEM_BACK_P(_T(MSG_BACK)); MENU_ITEM_EDIT_int3_P(_T(MSG_BL_HIGH), &backlightLevel_HIGH, backlightLevel_LOW, 255); MENU_ITEM_EDIT_int3_P(_T(MSG_BL_LOW), &backlightLevel_LOW, 0, backlightLevel_HIGH); MENU_ITEM_TOGGLE_P(_T(MSG_MODE), ((backlightMode==BACKLIGHT_MODE_BRIGHT) ? _T(MSG_BRIGHT) : ((backlightMode==BACKLIGHT_MODE_DIM) ? _T(MSG_DIM) : _T(MSG_AUTO))), backlight_mode_toggle); 1c08c: 81 11 cpse r24, r1 1c08e: 03 c0 rjmp .+6 ; 0x1c096 1c090: 89 e1 ldi r24, 0x19 ; 25 1c092: 98 e4 ldi r25, 0x48 ; 72 1c094: d2 cf rjmp .-92 ; 0x1c03a 1c096: 82 e1 ldi r24, 0x12 ; 18 1c098: 98 e4 ldi r25, 0x48 ; 72 1c09a: cf cf rjmp .-98 ; 0x1c03a MENU_ITEM_EDIT_int3_P(_T(MSG_TIMEOUT), &backlightTimer_period, 1, 999); MENU_END(); } 1c09c: df 91 pop r29 1c09e: cf 91 pop r28 1c0a0: 1f 91 pop r17 1c0a2: 0f 91 pop r16 1c0a4: ff 90 pop r15 1c0a6: ef 90 pop r14 1c0a8: 08 95 ret 0001c0aa : } #ifdef LCD_BL_PIN static void backlight_mode_toggle() { switch (backlightMode) 1c0aa: 80 91 4f 02 lds r24, 0x024F ; 0x80024f 1c0ae: 88 23 and r24, r24 1c0b0: 31 f0 breq .+12 ; 0x1c0be 1c0b2: 81 30 cpi r24, 0x01 ; 1 1c0b4: 41 f4 brne .+16 ; 0x1c0c6 { case BACKLIGHT_MODE_BRIGHT: backlightMode = BACKLIGHT_MODE_DIM; break; 1c0b6: 10 92 4f 02 sts 0x024F, r1 ; 0x80024f case BACKLIGHT_MODE_DIM: backlightMode = BACKLIGHT_MODE_AUTO; break; case BACKLIGHT_MODE_AUTO: backlightMode = BACKLIGHT_MODE_BRIGHT; break; default: backlightMode = BACKLIGHT_MODE_BRIGHT; break; } backlight_save(); 1c0ba: 0c 94 47 8a jmp 0x1148e ; 0x1148e static void backlight_mode_toggle() { switch (backlightMode) { case BACKLIGHT_MODE_BRIGHT: backlightMode = BACKLIGHT_MODE_DIM; break; case BACKLIGHT_MODE_DIM: backlightMode = BACKLIGHT_MODE_AUTO; break; 1c0be: 82 e0 ldi r24, 0x02 ; 2 case BACKLIGHT_MODE_AUTO: backlightMode = BACKLIGHT_MODE_BRIGHT; break; 1c0c0: 80 93 4f 02 sts 0x024F, r24 ; 0x80024f 1c0c4: fa cf rjmp .-12 ; 0x1c0ba 1c0c6: 81 e0 ldi r24, 0x01 ; 1 1c0c8: fb cf rjmp .-10 ; 0x1c0c0 0001c0ca : static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); } static void mmu_preload_filament_menu() { 1c0ca: cf 93 push r28 MENU_BEGIN(); 1c0cc: 0f 94 51 d1 call 0x3a2a2 ; 0x3a2a2 1c0d0: 10 92 11 05 sts 0x0511, r1 ; 0x800511 1c0d4: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1c0d8: 84 30 cpi r24, 0x04 ; 4 1c0da: 60 f5 brcc .+88 ; 0x1c134 1c0dc: 10 92 14 05 sts 0x0514, r1 ; 0x800514 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1c0e0: 88 ea ldi r24, 0xA8 ; 168 1c0e2: 98 e4 ldi r25, 0x48 ; 72 1c0e4: 0e 94 c4 72 call 0xe588 ; 0xe588 1c0e8: 0f 94 1c d4 call 0x3a838 ; 0x3a838 MENU_ITEM_FUNCTION_P(_T(MSG_LOAD_ALL), load_all_wrapper); 1c0ec: 89 ec ldi r24, 0xC9 ; 201 1c0ee: 95 e4 ldi r25, 0x45 ; 69 1c0f0: 0e 94 c4 72 call 0xe588 ; 0xe588 1c0f4: 69 e5 ldi r22, 0x59 ; 89 1c0f6: 71 ee ldi r23, 0xE1 ; 225 1c0f8: 0f 94 ce d0 call 0x3a19c ; 0x3a19c for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 1c0fc: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', load_filament_wrapper, i); 1c0fe: 8e e8 ldi r24, 0x8E ; 142 1c100: 96 e4 ldi r25, 0x46 ; 70 1c102: 0e 94 c4 72 call 0xe588 ; 0xe588 1c106: 61 e3 ldi r22, 0x31 ; 49 1c108: 6c 0f add r22, r28 1c10a: 2c 2f mov r18, r28 1c10c: 48 e6 ldi r20, 0x68 ; 104 1c10e: 51 ee ldi r21, 0xE1 ; 225 1c110: 0f 94 77 d0 call 0x3a0ee ; 0x3a0ee 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++) 1c114: cf 5f subi r28, 0xFF ; 255 1c116: c5 30 cpi r28, 0x05 ; 5 1c118: 91 f7 brne .-28 ; 0x1c0fe MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', load_filament_wrapper, i); MENU_END(); 1c11a: 0f 94 25 d1 call 0x3a24a ; 0x3a24a static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); } static void mmu_preload_filament_menu() { MENU_BEGIN(); 1c11e: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1c122: 8f 5f subi r24, 0xFF ; 255 1c124: 80 93 11 05 sts 0x0511, r24 ; 0x800511 1c128: 80 91 13 05 lds r24, 0x0513 ; 0x800513 1c12c: 8f 5f subi r24, 0xFF ; 255 1c12e: 80 93 13 05 sts 0x0513, r24 ; 0x800513 1c132: d0 cf rjmp .-96 ; 0x1c0d4 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(); } 1c134: cf 91 pop r28 1c136: 08 95 ret 0001c138 : static void lcd_mmuCutFilament() { preheat_or_continue(FilamentAction::MmuCut); } static void lcd_mmuLoadFilament() { preheat_or_continue(FilamentAction::MmuLoad); 1c138: 84 e0 ldi r24, 0x04 ; 4 1c13a: 0d 94 76 50 jmp 0x2a0ec ; 0x2a0ec 0001c13e : } static void lcd_mmuUnloadFilament() { preheat_or_continue(FilamentAction::MmuUnLoad); 1c13e: 85 e0 ldi r24, 0x05 ; 5 1c140: 0d 94 76 50 jmp 0x2a0ec ; 0x2a0ec 0001c144 : } static void lcd_mmuEjectFilament() { preheat_or_continue(FilamentAction::MmuEject); 1c144: 86 e0 ldi r24, 0x06 ; 6 1c146: 0d 94 76 50 jmp 0x2a0ec ; 0x2a0ec 0001c14a : static void lcd_mmuLoadingTest() { preheat_or_continue(FilamentAction::MmuLoadingTest); } static void lcd_mmuCutFilament() { preheat_or_continue(FilamentAction::MmuCut); 1c14a: 87 e0 ldi r24, 0x07 ; 7 1c14c: 0d 94 76 50 jmp 0x2a0ec ; 0x2a0ec 0001c150 : 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); 1c150: 88 e0 ldi r24, 0x08 ; 8 1c152: 0d 94 76 50 jmp 0x2a0ec ; 0x2a0ec 0001c156 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1c156: 60 91 e0 03 lds r22, 0x03E0 ; 0x8003e0 1c15a: 81 ea ldi r24, 0xA1 ; 161 1c15c: 9d e0 ldi r25, 0x0D ; 13 1c15e: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 } static void change_sheet() { eeprom_update_byte_notify(&(EEPROM_Sheets_base->active_sheet), selected_sheet); menu_back(3); 1c162: 83 e0 ldi r24, 0x03 ; 3 1c164: 0d 94 fd d3 jmp 0x3a7fa ; 0x3a7fa 0001c168 : // Clear the filament action clearFilamentAction(); } static void mmu_loading_test_menu() { 1c168: cf 93 push r28 MENU_BEGIN(); 1c16a: 0f 94 51 d1 call 0x3a2a2 ; 0x3a2a2 1c16e: 10 92 11 05 sts 0x0511, r1 ; 0x800511 1c172: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1c176: 84 30 cpi r24, 0x04 ; 4 1c178: 88 f5 brcc .+98 ; 0x1c1dc 1c17a: 10 92 14 05 sts 0x0514, r1 ; 0x800514 ON_MENU_LEAVE( 1c17e: 0f 94 d1 cf call 0x39fa2 ; 0x39fa2 1c182: 81 11 cpse r24, r1 1c184: 0f 94 69 20 call 0x240d2 ; 0x240d2 clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1c188: 88 ea ldi r24, 0xA8 ; 168 1c18a: 98 e4 ldi r25, 0x48 ; 72 1c18c: 0e 94 c4 72 call 0xe588 ; 0xe588 1c190: 0f 94 1c d4 call 0x3a838 ; 0x3a838 MENU_ITEM_FUNCTION_P(_T(MSG_LOAD_ALL), loading_test_all_wrapper); 1c194: 89 ec ldi r24, 0xC9 ; 201 1c196: 95 e4 ldi r25, 0x45 ; 69 1c198: 0e 94 c4 72 call 0xe588 ; 0xe588 1c19c: 68 eb ldi r22, 0xB8 ; 184 1c19e: 7a e3 ldi r23, 0x3A ; 58 1c1a0: 0f 94 ce d0 call 0x3a19c ; 0x3a19c for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 1c1a4: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', loading_test_wrapper, i); 1c1a6: 8e e8 ldi r24, 0x8E ; 142 1c1a8: 96 e4 ldi r25, 0x46 ; 70 1c1aa: 0e 94 c4 72 call 0xe588 ; 0xe588 1c1ae: 61 e3 ldi r22, 0x31 ; 49 1c1b0: 6c 0f add r22, r28 1c1b2: 2c 2f mov r18, r28 1c1b4: 40 e2 ldi r20, 0x20 ; 32 1c1b6: 5b e3 ldi r21, 0x3B ; 59 1c1b8: 0f 94 77 d0 call 0x3a0ee ; 0x3a0ee 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++) 1c1bc: cf 5f subi r28, 0xFF ; 255 1c1be: c5 30 cpi r28, 0x05 ; 5 1c1c0: 91 f7 brne .-28 ; 0x1c1a6 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', loading_test_wrapper, i); MENU_END(); 1c1c2: 0f 94 25 d1 call 0x3a24a ; 0x3a24a // Clear the filament action clearFilamentAction(); } static void mmu_loading_test_menu() { MENU_BEGIN(); 1c1c6: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1c1ca: 8f 5f subi r24, 0xFF ; 255 1c1cc: 80 93 11 05 sts 0x0511, r24 ; 0x800511 1c1d0: 80 91 13 05 lds r24, 0x0513 ; 0x800513 1c1d4: 8f 5f subi r24, 0xFF ; 255 1c1d6: 80 93 13 05 sts 0x0513, r24 ; 0x800513 1c1da: cb cf rjmp .-106 ; 0x1c172 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(); } 1c1dc: cf 91 pop r28 1c1de: 08 95 ret 0001c1e0 : } // 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)) { 1c1e0: ef 92 push r14 1c1e2: ff 92 push r15 1c1e4: 0f 93 push r16 1c1e6: 1f 93 push r17 1c1e8: cf 93 push r28 1c1ea: 8c 01 movw r16, r24 1c1ec: 7b 01 movw r14, r22 MENU_BEGIN(); 1c1ee: 0f 94 51 d1 call 0x3a2a2 ; 0x3a2a2 1c1f2: 10 92 11 05 sts 0x0511, r1 ; 0x800511 1c1f6: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1c1fa: 84 30 cpi r24, 0x04 ; 4 1c1fc: 28 f5 brcc .+74 ; 0x1c248 1c1fe: 10 92 14 05 sts 0x0514, r1 ; 0x800514 ON_MENU_LEAVE( 1c202: 0f 94 d1 cf call 0x39fa2 ; 0x39fa2 1c206: 81 11 cpse r24, r1 1c208: 0f 94 69 20 call 0x240d2 ; 0x240d2 clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1c20c: 88 ea ldi r24, 0xA8 ; 168 1c20e: 98 e4 ldi r25, 0x48 ; 72 1c210: 0e 94 c4 72 call 0xe588 ; 0xe588 1c214: 0f 94 1c d4 call 0x3a838 ; 0x3a838 for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 1c218: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(label, i + '1', menuAction, i); 1c21a: 61 e3 ldi r22, 0x31 ; 49 1c21c: 6c 0f add r22, r28 1c21e: 2c 2f mov r18, r28 1c220: a7 01 movw r20, r14 1c222: c8 01 movw r24, r16 1c224: 0f 94 77 d0 call 0x3a0ee ; 0x3a0ee MENU_BEGIN(); ON_MENU_LEAVE( clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 1c228: cf 5f subi r28, 0xFF ; 255 1c22a: c5 30 cpi r28, 0x05 ; 5 1c22c: b1 f7 brne .-20 ; 0x1c21a MENU_ITEM_FUNCTION_NR_P(label, i + '1', menuAction, i); MENU_END(); 1c22e: 0f 94 25 d1 call 0x3a24a ; 0x3a24a // 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(); 1c232: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1c236: 8f 5f subi r24, 0xFF ; 255 1c238: 80 93 11 05 sts 0x0511, r24 ; 0x800511 1c23c: 80 91 13 05 lds r24, 0x0513 ; 0x800513 1c240: 8f 5f subi r24, 0xFF ; 255 1c242: 80 93 13 05 sts 0x0513, r24 ; 0x800513 1c246: d7 cf rjmp .-82 ; 0x1c1f6 ); 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(); } 1c248: cf 91 pop r28 1c24a: 1f 91 pop r17 1c24c: 0f 91 pop r16 1c24e: ff 90 pop r15 1c250: ef 90 pop r14 1c252: 08 95 ret 0001c254 : 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); 1c254: 81 e5 ldi r24, 0x51 ; 81 1c256: 9c e5 ldi r25, 0x5C ; 92 1c258: 0e 94 c4 72 call 0xe588 ; 0xe588 1c25c: 62 e4 ldi r22, 0x42 ; 66 1c25e: 71 ee ldi r23, 0xE1 ; 225 1c260: 0c 94 f0 e0 jmp 0x1c1e0 ; 0x1c1e0 0001c264 : // Clear the filament action clearFilamentAction(); } static void mmu_fil_eject_menu() { mmu_common_choose_filament_menu(_T(MSG_EJECT_FROM_MMU), mmu_eject_filament); 1c264: 80 e6 ldi r24, 0x60 ; 96 1c266: 9c e5 ldi r25, 0x5C ; 92 1c268: 0e 94 c4 72 call 0xe588 ; 0xe588 1c26c: 6e e4 ldi r22, 0x4E ; 78 1c26e: 71 ee ldi r23, 0xE1 ; 225 1c270: 0c 94 f0 e0 jmp 0x1c1e0 ; 0x1c1e0 0001c274 : 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); 1c274: 8e e8 ldi r24, 0x8E ; 142 1c276: 96 e4 ldi r25, 0x46 ; 70 1c278: 0e 94 c4 72 call 0xe588 ; 0xe588 1c27c: 68 e2 ldi r22, 0x28 ; 40 1c27e: 7a e3 ldi r23, 0x3A ; 58 1c280: 0c 94 f0 e0 jmp 0x1c1e0 ; 0x1c1e0 0001c284 : 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){ 1c284: cf 93 push r28 1c286: c8 2f mov r28, r24 IncrementMMUFails(); } } bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) { if (!WaitForMMUReady()) { 1c288: 0f 94 3f 88 call 0x3107e ; 0x3107e 1c28c: 88 23 and r24, r24 1c28e: 21 f0 breq .+8 ; 0x1c298 1c290: 8c 2f mov r24, r28 MMU2::mmu2.cut_filament(index); } 1c292: cf 91 pop r28 1c294: 0d 94 d0 ad jmp 0x35ba0 ; 0x35ba0 1c298: cf 91 pop r28 1c29a: 08 95 ret 0001c29c : 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) { 1c29c: cf 93 push r28 1c29e: c8 2f mov r28, r24 menu_back(); 1c2a0: 0f 94 19 d4 call 0x3a832 ; 0x3a832 MMU2::mmu2.eject_filament(filament, true); 1c2a4: 61 e0 ldi r22, 0x01 ; 1 1c2a6: 8c 2f mov r24, r28 1c2a8: 0f 94 53 ad call 0x35aa6 ; 0x35aa6 // Clear the filament action clearFilamentAction(); } 1c2ac: 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(); 1c2ae: 0d 94 69 20 jmp 0x240d2 ; 0x240d2 0001c2b2 : } static inline void load_all_wrapper(){ for(uint8_t i = 0; i < 5; ++i){ MMU2::mmu2.load_filament(i); 1c2b2: 80 e0 ldi r24, 0x00 ; 0 1c2b4: 0f 94 10 ad call 0x35a20 ; 0x35a20 1c2b8: 81 e0 ldi r24, 0x01 ; 1 1c2ba: 0f 94 10 ad call 0x35a20 ; 0x35a20 1c2be: 82 e0 ldi r24, 0x02 ; 2 1c2c0: 0f 94 10 ad call 0x35a20 ; 0x35a20 1c2c4: 83 e0 ldi r24, 0x03 ; 3 1c2c6: 0f 94 10 ad call 0x35a20 ; 0x35a20 1c2ca: 84 e0 ldi r24, 0x04 ; 4 1c2cc: 0d 94 10 ad jmp 0x35a20 ; 0x35a20 0001c2d0 : } } static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); 1c2d0: 0d 94 10 ad jmp 0x35a20 ; 0x35a20 0001c2d4 : } #endif //TMC2130 #if (LANG_MODE != 0) static void menu_setlang(uint8_t lang) { 1c2d4: cf 93 push r28 1c2d6: c8 2f mov r28, r24 if (!lang_select(lang)) 1c2d8: 0e 94 4c 72 call 0xe498 ; 0xe498 1c2dc: 81 11 cpse r24, r1 1c2de: 37 c0 rjmp .+110 ; 0x1c34e { if (lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_COPY_SEL_LANG), false, LCD_LEFT_BUTTON_CHOICE) == LCD_LEFT_BUTTON_CHOICE) 1c2e0: 81 e3 ldi r24, 0x31 ; 49 1c2e2: 9b e3 ldi r25, 0x3B ; 59 1c2e4: 0e 94 c4 72 call 0xe588 ; 0xe588 1c2e8: 40 e0 ldi r20, 0x00 ; 0 1c2ea: 60 e0 ldi r22, 0x00 ; 0 1c2ec: 0f 94 fb 4e call 0x29df6 ; 0x29df6 1c2f0: 81 11 cpse r24, r1 1c2f2: 20 c0 rjmp .+64 ; 0x1c334 #endif //(LANG_MODE == 0) void lang_boot_update_start(uint8_t lang) { uint8_t cnt = lang_get_count(); 1c2f4: 0e 94 01 72 call 0xe402 ; 0xe402 if ((lang < 2) || (lang > cnt)) return; //only languages from xflash can be selected 1c2f8: c2 30 cpi r28, 0x02 ; 2 1c2fa: e0 f0 brcs .+56 ; 0x1c334 1c2fc: 8c 17 cp r24, r28 1c2fe: d0 f0 brcs .+52 ; 0x1c334 softReset(); } void bootapp_reboot_user0(uint8_t reserved) { cli(); 1c300: f8 94 cli boot_app_magic = BOOT_APP_MAGIC; 1c302: 8a ea ldi r24, 0xAA ; 170 1c304: 95 e5 ldi r25, 0x55 ; 85 1c306: dc 01 movw r26, r24 1c308: 80 93 fc 1f sts 0x1FFC, r24 ; 0x801ffc <__bss_end+0x7dd> 1c30c: 90 93 fd 1f sts 0x1FFD, r25 ; 0x801ffd <__bss_end+0x7de> 1c310: a0 93 fe 1f sts 0x1FFE, r26 ; 0x801ffe <__bss_end+0x7df> 1c314: b0 93 ff 1f sts 0x1FFF, r27 ; 0x801fff <__bss_end+0x7e0> boot_app_flags = BOOT_APP_FLG_USER0; 1c318: 80 e8 ldi r24, 0x80 ; 128 1c31a: 80 93 fb 1f sts 0x1FFB, r24 ; 0x801ffb <__bss_end+0x7dc> boot_copy_size = 0; 1c31e: 10 92 f9 1f sts 0x1FF9, r1 ; 0x801ff9 <__bss_end+0x7da> 1c322: 10 92 f8 1f sts 0x1FF8, r1 ; 0x801ff8 <__bss_end+0x7d9> bootapp_reboot_user0(lang << 3); 1c326: cc 0f add r28, r28 1c328: cc 0f add r28, r28 1c32a: cc 0f add r28, r28 boot_reserved = reserved; 1c32c: c0 93 fa 1f sts 0x1FFA, r28 ; 0x801ffa <__bss_end+0x7db> // bootapp_print_vars(); softReset(); 1c330: 0e 94 64 67 call 0xcec8 ; 0xcec8 lang_boot_update_start(lang); lcd_update_enable(true); 1c334: 81 e0 ldi r24, 0x01 ; 1 1c336: 0e 94 3d 6f call 0xde7a ; 0xde7a menu_goto(lcd_language_menu, 0, true, true); 1c33a: 21 e0 ldi r18, 0x01 ; 1 1c33c: 41 e0 ldi r20, 0x01 ; 1 1c33e: 70 e0 ldi r23, 0x00 ; 0 1c340: 60 e0 ldi r22, 0x00 ; 0 1c342: 8a ea ldi r24, 0xAA ; 170 1c344: 92 ee ldi r25, 0xE2 ; 226 1c346: 0f 94 7b d1 call 0x3a2f6 ; 0x3a2f6 1c34a: 10 92 da 03 sts 0x03DA, r1 ; 0x8003da lcd_timeoutToStatus.stop(); //infinite timeout } } 1c34e: cf 91 pop r28 1c350: 08 95 ret 0001c352 : #ifdef COMMUNITY_LANGUAGE_SUPPORT #ifdef XFLASH static void lcd_community_language_menu() { 1c352: cf 93 push r28 1c354: df 93 push r29 MENU_BEGIN(); 1c356: 0f 94 51 d1 call 0x3a2a2 ; 0x3a2a2 1c35a: 10 92 11 05 sts 0x0511, r1 ; 0x800511 1c35e: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1c362: 84 30 cpi r24, 0x04 ; 4 1c364: 58 f5 brcc .+86 ; 0x1c3bc 1c366: 10 92 14 05 sts 0x0514, r1 ; 0x800514 uint8_t cnt = lang_get_count(); 1c36a: 0e 94 01 72 call 0xe402 ; 0xe402 1c36e: d8 2f mov r29, r24 MENU_ITEM_BACK_P(_T(MSG_SELECT_LANGUAGE)); //Back to previous Menu 1c370: 87 ea ldi r24, 0xA7 ; 167 1c372: 94 e4 ldi r25, 0x44 ; 68 1c374: 0e 94 c4 72 call 0xe588 ; 0xe588 1c378: 0f 94 1c d4 call 0x3a838 ; 0x3a838 for (uint8_t i = 8; i < cnt; i++) //all community languages 1c37c: c8 e0 ldi r28, 0x08 ; 8 1c37e: cd 17 cp r28, r29 1c380: 80 f4 brcc .+32 ; 0x1c3a2 if (menu_item_text_P(lang_get_name_by_code(lang_get_code(i)))) 1c382: 8c 2f mov r24, r28 1c384: 0e 94 b2 71 call 0xe364 ; 0xe364 1c388: 0e 94 4b 71 call 0xe296 ; 0xe296 1c38c: 0f 94 ff d0 call 0x3a1fe ; 0x3a1fe 1c390: 88 23 and r24, r24 1c392: 29 f0 breq .+10 ; 0x1c39e { menu_setlang(i); 1c394: 8c 2f mov r24, r28 return; } MENU_END(); } 1c396: df 91 pop r29 1c398: cf 91 pop r28 uint8_t cnt = lang_get_count(); MENU_ITEM_BACK_P(_T(MSG_SELECT_LANGUAGE)); //Back to previous Menu for (uint8_t i = 8; i < cnt; i++) //all community languages if (menu_item_text_P(lang_get_name_by_code(lang_get_code(i)))) { menu_setlang(i); 1c39a: 0c 94 6a e1 jmp 0x1c2d4 ; 0x1c2d4 static void lcd_community_language_menu() { MENU_BEGIN(); uint8_t cnt = lang_get_count(); MENU_ITEM_BACK_P(_T(MSG_SELECT_LANGUAGE)); //Back to previous Menu for (uint8_t i = 8; i < cnt; i++) //all community languages 1c39e: cf 5f subi r28, 0xFF ; 255 1c3a0: ee cf rjmp .-36 ; 0x1c37e if (menu_item_text_P(lang_get_name_by_code(lang_get_code(i)))) { menu_setlang(i); return; } MENU_END(); 1c3a2: 0f 94 25 d1 call 0x3a24a ; 0x3a24a #ifdef COMMUNITY_LANGUAGE_SUPPORT #ifdef XFLASH static void lcd_community_language_menu() { MENU_BEGIN(); 1c3a6: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1c3aa: 8f 5f subi r24, 0xFF ; 255 1c3ac: 80 93 11 05 sts 0x0511, r24 ; 0x800511 1c3b0: 80 91 13 05 lds r24, 0x0513 ; 0x800513 1c3b4: 8f 5f subi r24, 0xFF ; 255 1c3b6: 80 93 13 05 sts 0x0513, r24 ; 0x800513 1c3ba: d1 cf rjmp .-94 ; 0x1c35e { menu_setlang(i); return; } MENU_END(); } 1c3bc: df 91 pop r29 1c3be: cf 91 pop r28 1c3c0: 08 95 ret 0001c3c2 : lcd_sheet_menu(); } static void sheets_menu() { MENU_BEGIN(); 1c3c2: 0f 94 51 d1 call 0x3a2a2 ; 0x3a2a2 1c3c6: 10 92 11 05 sts 0x0511, r1 ; 0x800511 1c3ca: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1c3ce: 84 30 cpi r24, 0x04 ; 4 1c3d0: 08 f0 brcs .+2 ; 0x1c3d4 1c3d2: 45 c0 rjmp .+138 ; 0x1c45e 1c3d4: 10 92 14 05 sts 0x0514, r1 ; 0x800514 MENU_ITEM_BACK_P(_T(MSG_HW_SETUP)); 1c3d8: 86 ed ldi r24, 0xD6 ; 214 1c3da: 94 e4 ldi r25, 0x44 ; 68 1c3dc: 0e 94 c4 72 call 0xe588 ; 0xe588 1c3e0: 0f 94 1c d4 call 0x3a838 ; 0x3a838 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[0], select_sheet_menu<0>); 1c3e4: 67 ed ldi r22, 0xD7 ; 215 1c3e6: 73 ed ldi r23, 0xD3 ; 211 1c3e8: 89 e4 ldi r24, 0x49 ; 73 1c3ea: 9d e0 ldi r25, 0x0D ; 13 1c3ec: 0f 94 7f d3 call 0x3a6fe ; 0x3a6fe MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[1], select_sheet_menu<1>); 1c3f0: 62 ed ldi r22, 0xD2 ; 210 1c3f2: 73 ed ldi r23, 0xD3 ; 211 1c3f4: 84 e5 ldi r24, 0x54 ; 84 1c3f6: 9d e0 ldi r25, 0x0D ; 13 1c3f8: 0f 94 7f d3 call 0x3a6fe ; 0x3a6fe MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[2], select_sheet_menu<2>); 1c3fc: 6d ec ldi r22, 0xCD ; 205 1c3fe: 73 ed ldi r23, 0xD3 ; 211 1c400: 8f e5 ldi r24, 0x5F ; 95 1c402: 9d e0 ldi r25, 0x0D ; 13 1c404: 0f 94 7f d3 call 0x3a6fe ; 0x3a6fe MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[3], select_sheet_menu<3>); 1c408: 68 ec ldi r22, 0xC8 ; 200 1c40a: 73 ed ldi r23, 0xD3 ; 211 1c40c: 8a e6 ldi r24, 0x6A ; 106 1c40e: 9d e0 ldi r25, 0x0D ; 13 1c410: 0f 94 7f d3 call 0x3a6fe ; 0x3a6fe MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[4], select_sheet_menu<4>); 1c414: 63 ec ldi r22, 0xC3 ; 195 1c416: 73 ed ldi r23, 0xD3 ; 211 1c418: 85 e7 ldi r24, 0x75 ; 117 1c41a: 9d e0 ldi r25, 0x0D ; 13 1c41c: 0f 94 7f d3 call 0x3a6fe ; 0x3a6fe MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[5], select_sheet_menu<5>); 1c420: 6e eb ldi r22, 0xBE ; 190 1c422: 73 ed ldi r23, 0xD3 ; 211 1c424: 80 e8 ldi r24, 0x80 ; 128 1c426: 9d e0 ldi r25, 0x0D ; 13 1c428: 0f 94 7f d3 call 0x3a6fe ; 0x3a6fe MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[6], select_sheet_menu<6>); 1c42c: 69 eb ldi r22, 0xB9 ; 185 1c42e: 73 ed ldi r23, 0xD3 ; 211 1c430: 8b e8 ldi r24, 0x8B ; 139 1c432: 9d e0 ldi r25, 0x0D ; 13 1c434: 0f 94 7f d3 call 0x3a6fe ; 0x3a6fe MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[7], select_sheet_menu<7>); 1c438: 64 eb ldi r22, 0xB4 ; 180 1c43a: 73 ed ldi r23, 0xD3 ; 211 1c43c: 86 e9 ldi r24, 0x96 ; 150 1c43e: 9d e0 ldi r25, 0x0D ; 13 1c440: 0f 94 7f d3 call 0x3a6fe ; 0x3a6fe MENU_END(); 1c444: 0f 94 25 d1 call 0x3a24a ; 0x3a24a lcd_sheet_menu(); } static void sheets_menu() { MENU_BEGIN(); 1c448: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1c44c: 8f 5f subi r24, 0xFF ; 255 1c44e: 80 93 11 05 sts 0x0511, r24 ; 0x800511 1c452: 80 91 13 05 lds r24, 0x0513 ; 0x800513 1c456: 8f 5f subi r24, 0xFF ; 255 1c458: 80 93 13 05 sts 0x0513, r24 ; 0x800513 1c45c: b6 cf rjmp .-148 ; 0x1c3ca 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(); } 1c45e: 08 95 ret 0001c460 : lang_select(LANG_ID_PRI); } #endif static void wait_preheat() { 1c460: cf 92 push r12 1c462: df 92 push r13 1c464: ef 92 push r14 1c466: ff 92 push r15 current_position[Z_AXIS] = 100; //move in z axis to make space for loading filament 1c468: 80 e0 ldi r24, 0x00 ; 0 1c46a: 90 e0 ldi r25, 0x00 ; 0 1c46c: a8 ec ldi r26, 0xC8 ; 200 1c46e: b2 e4 ldi r27, 0x42 ; 66 1c470: 80 93 99 06 sts 0x0699, r24 ; 0x800699 1c474: 90 93 9a 06 sts 0x069A, r25 ; 0x80069a 1c478: a0 93 9b 06 sts 0x069B, r26 ; 0x80069b 1c47c: b0 93 9c 06 sts 0x069C, r27 ; 0x80069c plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); 1c480: 65 e5 ldi r22, 0x55 ; 85 1c482: 75 e5 ldi r23, 0x55 ; 85 1c484: 85 e5 ldi r24, 0x55 ; 85 1c486: 91 e4 ldi r25, 0x41 ; 65 1c488: 0f 94 04 c0 call 0x38008 ; 0x38008 delay_keep_alive(2000); 1c48c: 80 ed ldi r24, 0xD0 ; 208 1c48e: 97 e0 ldi r25, 0x07 ; 7 1c490: 0e 94 fc 8c call 0x119f8 ; 0x119f8 lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING)); 1c494: 8b e2 ldi r24, 0x2B ; 43 1c496: 9c e3 ldi r25, 0x3C ; 60 1c498: 0e 94 c4 72 call 0xe588 ; 0xe588 1c49c: 0f 94 ba 1f call 0x23f74 ; 0x23f74 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 1c4a0: 60 91 b5 0d lds r22, 0x0DB5 ; 0x800db5 1c4a4: 70 91 b6 0d lds r23, 0x0DB6 ; 0x800db6 1c4a8: 07 2e mov r0, r23 1c4aa: 00 0c add r0, r0 1c4ac: 88 0b sbc r24, r24 1c4ae: 99 0b sbc r25, r25 1c4b0: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 1c4b4: 9b 01 movw r18, r22 1c4b6: ac 01 movw r20, r24 while (fabs(degHotend(0) - degTargetHotend(0)) > TEMP_HYSTERESIS) { 1c4b8: 60 91 af 0d lds r22, 0x0DAF ; 0x800daf 1c4bc: 70 91 b0 0d lds r23, 0x0DB0 ; 0x800db0 1c4c0: 80 91 b1 0d lds r24, 0x0DB1 ; 0x800db1 1c4c4: 90 91 b2 0d lds r25, 0x0DB2 ; 0x800db2 1c4c8: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 1c4cc: 9f 77 andi r25, 0x7F ; 127 1c4ce: 20 e0 ldi r18, 0x00 ; 0 1c4d0: 30 e0 ldi r19, 0x00 ; 0 1c4d2: 40 ea ldi r20, 0xA0 ; 160 1c4d4: 50 e4 ldi r21, 0x40 ; 64 1c4d6: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 1c4da: 18 16 cp r1, r24 1c4dc: b4 f5 brge .+108 ; 0x1c54a lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING)); 1c4de: 8b e2 ldi r24, 0x2B ; 43 1c4e0: 9c e3 ldi r25, 0x3C ; 60 1c4e2: 0e 94 c4 72 call 0xe588 ; 0xe588 1c4e6: 0f 94 ba 1f call 0x23f74 ; 0x23f74 lcd_set_cursor(0, 4); 1c4ea: 64 e0 ldi r22, 0x04 ; 4 1c4ec: 80 e0 ldi r24, 0x00 ; 0 1c4ee: 0e 94 f8 6e call 0xddf0 ; 0xddf0 1c4f2: 60 91 b5 0d lds r22, 0x0DB5 ; 0x800db5 1c4f6: 70 91 b6 0d lds r23, 0x0DB6 ; 0x800db6 1c4fa: 07 2e mov r0, r23 1c4fc: 00 0c add r0, r0 1c4fe: 88 0b sbc r24, r24 1c500: 99 0b sbc r25, r25 1c502: 0f 94 65 d6 call 0x3acca ; 0x3acca <__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)); 1c506: 20 e0 ldi r18, 0x00 ; 0 1c508: 30 e0 ldi r19, 0x00 ; 0 1c50a: 40 e0 ldi r20, 0x00 ; 0 1c50c: 5f e3 ldi r21, 0x3F ; 63 1c50e: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 1c512: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> 1c516: 6b 01 movw r12, r22 1c518: 20 e0 ldi r18, 0x00 ; 0 1c51a: 30 e0 ldi r19, 0x00 ; 0 1c51c: 40 e0 ldi r20, 0x00 ; 0 1c51e: 5f e3 ldi r21, 0x3F ; 63 1c520: 60 91 af 0d lds r22, 0x0DAF ; 0x800daf 1c524: 70 91 b0 0d lds r23, 0x0DB0 ; 0x800db0 1c528: 80 91 b1 0d lds r24, 0x0DB1 ; 0x800db1 1c52c: 90 91 b2 0d lds r25, 0x0DB2 ; 0x800db2 1c530: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 1c534: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> 1c538: a6 01 movw r20, r12 1c53a: 82 e8 ldi r24, 0x82 ; 130 1c53c: 0f 94 4f 21 call 0x2429e ; 0x2429e delay_keep_alive(1000); 1c540: 88 ee ldi r24, 0xE8 ; 232 1c542: 93 e0 ldi r25, 0x03 ; 3 1c544: 0e 94 fc 8c call 0x119f8 ; 0x119f8 1c548: ab cf rjmp .-170 ; 0x1c4a0 } } 1c54a: ff 90 pop r15 1c54c: ef 90 pop r14 1c54e: df 90 pop r13 1c550: cf 90 pop r12 1c552: 08 95 ret 0001c554 : } #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL static void lcd_language_menu() { 1c554: cf 93 push r28 MENU_BEGIN(); 1c556: 0f 94 51 d1 call 0x3a2a2 ; 0x3a2a2 1c55a: 10 92 11 05 sts 0x0511, r1 ; 0x800511 1c55e: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1c562: 84 30 cpi r24, 0x04 ; 4 1c564: 08 f0 brcs .+2 ; 0x1c568 1c566: 4a c0 rjmp .+148 ; 0x1c5fc 1c568: 10 92 14 05 sts 0x0514, r1 ; 0x800514 if (lang_is_selected()) MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); // 1c56c: 0e 94 35 71 call 0xe26a ; 0xe26a 1c570: 88 23 and r24, r24 1c572: 31 f0 breq .+12 ; 0x1c580 1c574: 86 e4 ldi r24, 0x46 ; 70 1c576: 98 e4 ldi r25, 0x48 ; 72 1c578: 0e 94 c4 72 call 0xe588 ; 0xe588 1c57c: 0f 94 1c d4 call 0x3a838 ; 0x3a838 if (menu_item_text_P(lang_get_name_by_code(lang_get_code(0)))) //primary language 1c580: 8e e6 ldi r24, 0x6E ; 110 1c582: 95 e6 ldi r25, 0x65 ; 101 1c584: 0e 94 4b 71 call 0xe296 ; 0xe296 1c588: 0f 94 ff d0 call 0x3a1fe ; 0x3a1fe 1c58c: 88 23 and r24, r24 1c58e: 21 f0 breq .+8 ; 0x1c598 { menu_setlang(0); 1c590: 80 e0 ldi r24, 0x00 ; 0 MENU_ITEM_SUBMENU_P(_T(MSG_COMMUNITY_MADE), lcd_community_language_menu); #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL MENU_END(); } 1c592: cf 91 pop r28 #else //XFLASH for (uint8_t i = 1; i < cnt; i++) //all seconday languages (MK2/25) #endif //XFLASH if (menu_item_text_P(lang_get_name_by_code(lang_get_code(i)))) { menu_setlang(i); 1c594: 0c 94 6a e1 jmp 0x1c2d4 ; 0x1c2d4 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(); 1c598: 0e 94 01 72 call 0xe402 ; 0xe402 menu_setlang(1); return; } } else for (uint8_t i = 2; i < 8; i++) //skip seconday language - solved in lang_select (MK3) 'i < 8' for 7 official languages 1c59c: c2 e0 ldi r28, 0x02 ; 2 menu_setlang(0); return; } uint8_t cnt = lang_get_count(); #ifdef XFLASH if (cnt == 2) //display secondary language in case of clear xflash 1c59e: 82 30 cpi r24, 0x02 ; 2 1c5a0: 51 f4 brne .+20 ; 0x1c5b6 1c5a2: 0e 94 22 71 call 0xe244 ; 0xe244 { if (menu_item_text_P(lang_get_name_by_code(lang_get_code(1)))) 1c5a6: 0e 94 4b 71 call 0xe296 ; 0xe296 1c5aa: 0f 94 ff d0 call 0x3a1fe ; 0x3a1fe 1c5ae: 88 23 and r24, r24 1c5b0: 81 f0 breq .+32 ; 0x1c5d2 { menu_setlang(1); 1c5b2: 81 e0 ldi r24, 0x01 ; 1 1c5b4: ee cf rjmp .-36 ; 0x1c592 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) #endif //XFLASH if (menu_item_text_P(lang_get_name_by_code(lang_get_code(i)))) 1c5b6: 8c 2f mov r24, r28 1c5b8: 0e 94 b2 71 call 0xe364 ; 0xe364 1c5bc: 0e 94 4b 71 call 0xe296 ; 0xe296 1c5c0: 0f 94 ff d0 call 0x3a1fe ; 0x3a1fe 1c5c4: 88 23 and r24, r24 1c5c6: 11 f0 breq .+4 ; 0x1c5cc { menu_setlang(i); 1c5c8: 8c 2f mov r24, r28 1c5ca: e3 cf rjmp .-58 ; 0x1c592 menu_setlang(1); return; } } else for (uint8_t i = 2; i < 8; i++) //skip seconday language - solved in lang_select (MK3) 'i < 8' for 7 official languages 1c5cc: cf 5f subi r28, 0xFF ; 255 1c5ce: c8 30 cpi r28, 0x08 ; 8 1c5d0: 91 f7 brne .-28 ; 0x1c5b6 return; } #ifdef COMMUNITY_LANGUAGE_SUPPORT #ifdef XFLASH MENU_ITEM_SUBMENU_P(_T(MSG_COMMUNITY_MADE), lcd_community_language_menu); 1c5d2: 8b e4 ldi r24, 0x4B ; 75 1c5d4: 9b e3 ldi r25, 0x3B ; 59 1c5d6: 0e 94 c4 72 call 0xe588 ; 0xe588 1c5da: 69 ea ldi r22, 0xA9 ; 169 1c5dc: 71 ee ldi r23, 0xE1 ; 225 1c5de: 0f 94 cf d3 call 0x3a79e ; 0x3a79e #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL MENU_END(); 1c5e2: 0f 94 25 d1 call 0x3a24a ; 0x3a24a #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL static void lcd_language_menu() { MENU_BEGIN(); 1c5e6: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1c5ea: 8f 5f subi r24, 0xFF ; 255 1c5ec: 80 93 11 05 sts 0x0511, r24 ; 0x800511 1c5f0: 80 91 13 05 lds r24, 0x0513 ; 0x800513 1c5f4: 8f 5f subi r24, 0xFF ; 255 1c5f6: 80 93 13 05 sts 0x0513, r24 ; 0x800513 1c5fa: b1 cf rjmp .-158 ; 0x1c55e MENU_ITEM_SUBMENU_P(_T(MSG_COMMUNITY_MADE), lcd_community_language_menu); #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL MENU_END(); } 1c5fc: cf 91 pop r28 1c5fe: 08 95 ret 0001c600 : 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()") { 1c600: cf 93 push r28 1c602: 10 92 da 03 sts 0x03DA, r1 ; 0x8003da { //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); 1c606: c3 b1 in r28, 0x03 ; 3 lcd_puts_at_P(0, 0, MSG_PINDA); 1c608: 40 eb ldi r20, 0xB0 ; 176 1c60a: 5a e6 ldi r21, 0x6A ; 106 1c60c: 60 e0 ldi r22, 0x00 ; 0 1c60e: 80 e0 ldi r24, 0x00 ; 0 1c610: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_set_cursor(LCD_WIDTH - 14, 0); 1c614: 60 e0 ldi r22, 0x00 ; 0 1c616: 86 e0 ldi r24, 0x06 ; 6 1c618: 0e 94 f8 6e call 0xddf0 ; 0xddf0 lcd_print_state(pinda_state); 1c61c: c4 fb bst r28, 4 1c61e: 88 27 eor r24, r24 1c620: 80 f9 bld r24, 0 1c622: 0f 94 60 1f call 0x23ec0 ; 0x23ec0 if (MMU2::mmu2.Enabled()) { 1c626: 80 91 b9 13 lds r24, 0x13B9 ; 0x8013b9 1c62a: 81 30 cpi r24, 0x01 ; 1 1c62c: 99 f4 brne .+38 ; 0x1c654 inline bool Running() const { return state == State::Running; } inline bool FindaPressed() const { return regs8[0]; 1c62e: c1 e0 ldi r28, 0x01 ; 1 1c630: 80 91 8f 13 lds r24, 0x138F ; 0x80138f 1c634: 81 11 cpse r24, r1 1c636: 01 c0 rjmp .+2 ; 0x1c63a 1c638: 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 1c63a: 4a ea ldi r20, 0xAA ; 170 1c63c: 5a e6 ldi r21, 0x6A ; 106 1c63e: 60 e0 ldi r22, 0x00 ; 0 1c640: 8a e0 ldi r24, 0x0A ; 10 1c642: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_set_cursor(LCD_WIDTH - 3, 0); 1c646: 60 e0 ldi r22, 0x00 ; 0 1c648: 81 e1 ldi r24, 0x11 ; 17 1c64a: 0e 94 f8 6e call 0xddf0 ; 0xddf0 lcd_print_state(finda_state); 1c64e: 8c 2f mov r24, r28 1c650: 0f 94 60 1f call 0x23ec0 ; 0x23ec0 1c654: c1 e0 ldi r28, 0x01 ; 1 1c656: 80 91 b6 17 lds r24, 0x17B6 ; 0x8017b6 1c65a: 81 11 cpse r24, r1 1c65c: 01 c0 rjmp .+2 ; 0x1c660 1c65e: c0 e0 ldi r28, 0x00 ; 0 } #ifdef FILAMENT_SENSOR idler_state = fsensor.getFilamentPresent(); lcd_puts_at_P(0, 1, _T(MSG_FSENSOR)); 1c660: 87 ea ldi r24, 0xA7 ; 167 1c662: 97 e4 ldi r25, 0x47 ; 71 1c664: 0e 94 c4 72 call 0xe588 ; 0xe588 1c668: ac 01 movw r20, r24 1c66a: 61 e0 ldi r22, 0x01 ; 1 1c66c: 80 e0 ldi r24, 0x00 ; 0 1c66e: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_set_cursor(LCD_WIDTH - 3, 1); 1c672: 61 e0 ldi r22, 0x01 ; 1 1c674: 81 e1 ldi r24, 0x11 ; 17 1c676: 0e 94 f8 6e call 0xddf0 ; 0xddf0 lcd_print_state(idler_state); 1c67a: 8c 2f mov r24, r28 1c67c: 0f 94 60 1f call 0x23ec0 ; 0x23ec0 // auto-exposure algorithm. When the chip is tracking on a reflective surface, the Shutter is small. // When the chip is tracking on a surface that absorbs IR (or doesn't reflect it), the Shutter is large. // The maximum value of the shutter is 17. The value of 16 seems to be reported as 17 even though the // Brightness value changes correctly as if the shutter changed to 16 (probably some bug with the sensor). // The shutter algorithm tries to keep the B value in the 70-110 range. lcd_set_cursor(0, 2); 1c680: 62 e0 ldi r22, 0x02 ; 2 1c682: 80 e0 ldi r24, 0x00 ; 0 1c684: 0e 94 f8 6e call 0xddf0 ; 0xddf0 lcd_printf_P(_N("B: %3d Xd:%6d\n" 1c688: 80 91 8f 0e lds r24, 0x0E8F ; 0x800e8f 1c68c: 8f 93 push r24 1c68e: 80 91 8e 0e lds r24, 0x0E8E ; 0x800e8e 1c692: 8f 93 push r24 1c694: 80 91 ba 0d lds r24, 0x0DBA ; 0x800dba 1c698: 1f 92 push r1 1c69a: 8f 93 push r24 1c69c: 80 91 96 03 lds r24, 0x0396 ; 0x800396 1c6a0: 8f 93 push r24 1c6a2: 80 91 95 03 lds r24, 0x0395 ; 0x800395 1c6a6: 8f 93 push r24 1c6a8: 80 91 b9 0d lds r24, 0x0DB9 ; 0x800db9 1c6ac: 1f 92 push r1 1c6ae: 8f 93 push r24 1c6b0: 86 e8 ldi r24, 0x86 ; 134 1c6b2: 9a e6 ldi r25, 0x6A ; 106 1c6b4: 9f 93 push r25 1c6b6: 8f 93 push r24 1c6b8: 0e 94 d1 6e call 0xdda2 ; 0xdda2 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(); 1c6bc: 8d b7 in r24, 0x3d ; 61 1c6be: 9e b7 in r25, 0x3e ; 62 1c6c0: 0a 96 adiw r24, 0x0a ; 10 1c6c2: 0f b6 in r0, 0x3f ; 63 1c6c4: f8 94 cli 1c6c6: 9e bf out 0x3e, r25 ; 62 1c6c8: 0f be out 0x3f, r0 ; 63 1c6ca: 8d bf out 0x3d, r24 ; 61 } 1c6cc: 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(); 1c6ce: 0d 94 bb d4 jmp 0x3a976 ; 0x3a976 0001c6d2 : } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); } } void MMU2::Start() { 1c6d2: 1f 93 push r17 1c6d4: cf 93 push r28 1c6d6: df 93 push r29 } //uart init (io + FILE stream) void uart2_init(uint32_t baudRate) { DDRH &= ~0x01; 1c6d8: e1 e0 ldi r30, 0x01 ; 1 1c6da: f1 e0 ldi r31, 0x01 ; 1 1c6dc: 80 81 ld r24, Z 1c6de: 8e 7f andi r24, 0xFE ; 254 1c6e0: 80 83 st Z, r24 PORTH |= 0x01; 1c6e2: e2 e0 ldi r30, 0x02 ; 2 1c6e4: f1 e0 ldi r31, 0x01 ; 1 1c6e6: 80 81 ld r24, Z 1c6e8: 81 60 ori r24, 0x01 ; 1 1c6ea: 80 83 st Z, r24 //#include void rbuf_ini(uint8_t* ptr, uint8_t l) { ptr[0] = l; 1c6ec: e9 e3 ldi r30, 0x39 ; 57 1c6ee: f5 e0 ldi r31, 0x05 ; 5 1c6f0: 90 e1 ldi r25, 0x10 ; 16 1c6f2: 90 83 st Z, r25 ptr[1] = 0; 1c6f4: 11 82 std Z+1, r1 ; 0x01 ptr[2] = 0; 1c6f6: 12 82 std Z+2, r1 ; 0x02 rbuf_ini(uart2_ibuf, sizeof(uart2_ibuf) - 4); UCSR2A |= (1 << U2X2); // baudrate multiplier 1c6f8: e0 ed ldi r30, 0xD0 ; 208 1c6fa: f0 e0 ldi r31, 0x00 ; 0 1c6fc: 80 81 ld r24, Z 1c6fe: 82 60 ori r24, 0x02 ; 2 1c700: 80 83 st Z, r24 UBRR2L = UART_BAUD_SELECT(baudRate, F_CPU); // select baudrate 1c702: 90 93 d4 00 sts 0x00D4, r25 ; 0x8000d4 <__TEXT_REGION_LENGTH__+0x7c20d4> UCSR2B = (1 << RXEN2) | (1 << TXEN2); // enable receiver and transmitter 1c706: e1 ed ldi r30, 0xD1 ; 209 1c708: f0 e0 ldi r31, 0x00 ; 0 1c70a: 88 e1 ldi r24, 0x18 ; 24 1c70c: 80 83 st Z, r24 UCSR2B |= (1 << RXCIE2); // enable rx interrupt 1c70e: 80 81 ld r24, Z 1c710: 80 68 ori r24, 0x80 ; 128 1c712: 80 83 st Z, r24 fdev_setup_stream(uart2io, uart2_putchar, uart2_getchar, _FDEV_SETUP_WRITE | _FDEV_SETUP_READ); //setup uart2 i/o stream 1c714: e3 e9 ldi r30, 0x93 ; 147 1c716: f2 e1 ldi r31, 0x12 ; 18 1c718: 8a e5 ldi r24, 0x5A ; 90 1c71a: 9a e3 ldi r25, 0x3A ; 58 1c71c: 91 87 std Z+9, r25 ; 0x09 1c71e: 80 87 std Z+8, r24 ; 0x08 1c720: 82 e3 ldi r24, 0x32 ; 50 1c722: 99 e3 ldi r25, 0x39 ; 57 1c724: 93 87 std Z+11, r25 ; 0x0b 1c726: 82 87 std Z+10, r24 ; 0x0a 1c728: 13 e0 ldi r17, 0x03 ; 3 1c72a: 13 83 std Z+3, r17 ; 0x03 1c72c: 15 86 std Z+13, r1 ; 0x0d 1c72e: 14 86 std Z+12, r1 ; 0x0c namespace MMU2 { // On MK3 we cannot do actual power cycle on HW. Instead trigger a hardware reset. void power_on() { #ifdef MMU_HWRESET WRITE(MMU_RST_PIN, 1); 1c730: 9f b7 in r25, 0x3f ; 63 1c732: f8 94 cli 1c734: e5 e0 ldi r30, 0x05 ; 5 1c736: f1 e0 ldi r31, 0x01 ; 1 1c738: 80 81 ld r24, Z 1c73a: 80 62 ori r24, 0x20 ; 32 1c73c: 80 83 st Z, r24 1c73e: 9f bf out 0x3f, r25 ; 63 SET_OUTPUT(MMU_RST_PIN); // setup reset pin 1c740: e4 e0 ldi r30, 0x04 ; 4 1c742: f1 e0 ldi r31, 0x01 ; 1 1c744: 80 81 ld r24, Z 1c746: 80 62 ori r24, 0x20 ; 32 1c748: 80 83 st Z, r24 #endif //MMU_HWRESET reset(); 1c74a: 0f 94 55 c5 call 0x38aaa ; 0x38aaa mmu2Serial.begin(MMU_BAUD); PowerOn(); mmu2Serial.flush(); // make sure the UART buffer is clear before starting communication SetCurrentTool(MMU2_NO_TOOL); 1c74e: 83 e6 ldi r24, 0x63 ; 99 1c750: 0f 94 be 87 call 0x30f7c ; 0x30f7c retryAttempts--; } } void ProtocolLogic::ResetRetryAttempts() { SERIAL_ECHOLNPGM("ResetRetryAttempts"); 1c754: 8b eb ldi r24, 0xBB ; 187 1c756: 97 ea ldi r25, 0xA7 ; 167 1c758: 0e 94 93 79 call 0xf326 ; 0xf326 retryAttempts = MAX_RETRIES; 1c75c: ca e4 ldi r28, 0x4A ; 74 1c75e: d3 e1 ldi r29, 0x13 ; 19 1c760: 10 93 9e 13 sts 0x139E, r17 ; 0x80139e } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 1c764: 85 e9 ldi r24, 0x95 ; 149 1c766: 9b ea ldi r25, 0xAB ; 171 1c768: 0e 94 93 79 call 0xf326 ; 0xf326 /// @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; } 1c76c: 8a e0 ldi r24, 0x0A ; 10 1c76e: 8c 8b std Y+20, r24 ; 0x14 // start the communication logic.ResetRetryAttempts(); logic.ResetCommunicationTimeoutAttempts(); state = xState::Connecting; 1c770: 82 e0 ldi r24, 0x02 ; 2 1c772: 80 93 b9 13 sts 0x13B9, r24 ; 0x8013b9 initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 1c776: 81 e0 ldi r24, 0x01 ; 1 1c778: 8d 8f std Y+29, r24 ; 0x1d currentScope = Scope::StartSeq; 1c77a: 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; 1c77c: 1c a2 std Y+36, r1 ; 0x24 LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 1c77e: 86 e0 ldi r24, 0x06 ; 6 1c780: 8c 83 std Y+4, r24 ; 0x04 SendVersion(0); 1c782: 80 e0 ldi r24, 0x00 ; 0 logic.Start(); } 1c784: df 91 pop r29 1c786: cf 91 pop r28 1c788: 1f 91 pop r17 1c78a: 0d 94 37 a5 jmp 0x34a6e ; 0x34a6e 0001c78e : #endif // MMU_FORCE_STEALTH_MODE } static void mmu_enable_switch() { uint8_t current_state = eeprom_read_byte((uint8_t *)EEPROM_MMU_ENABLED); 1c78e: 8c ea ldi r24, 0xAC ; 172 1c790: 9c e0 ldi r25, 0x0C ; 12 1c792: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae if (current_state) 1c796: 88 23 and r24, r24 1c798: 61 f0 breq .+24 ; 0x1c7b2 StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 1c79a: 10 92 b9 13 sts 0x13B9, r1 ; 0x8013b9 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 1c79e: 10 92 67 13 sts 0x1367, r1 ; 0x801367 currentScope = Scope::Stopped; 1c7a2: 10 92 4c 13 sts 0x134C, r1 ; 0x80134c else { MMU2::mmu2.Start(); } eeprom_toggle((uint8_t *)EEPROM_MMU_ENABLED); 1c7a6: 8c ea ldi r24, 0xAC ; 172 1c7a8: 9c e0 ldi r25, 0x0C ; 12 1c7aa: 0e 94 4c 76 call 0xec98 ; 0xec98 MMU2::mmu2.Status(); 1c7ae: 0d 94 9e 74 jmp 0x2e93c ; 0x2e93c { MMU2::mmu2.Stop(); } else { MMU2::mmu2.Start(); 1c7b2: 0e 94 69 e3 call 0x1c6d2 ; 0x1c6d2 1c7b6: f7 cf rjmp .-18 ; 0x1c7a6 0001c7b8 : //! //! @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) 1c7b8: 4f 92 push r4 1c7ba: 5f 92 push r5 1c7bc: 6f 92 push r6 1c7be: 7f 92 push r7 1c7c0: 8f 92 push r8 1c7c2: 9f 92 push r9 1c7c4: af 92 push r10 1c7c6: bf 92 push r11 1c7c8: cf 92 push r12 1c7ca: df 92 push r13 1c7cc: ef 92 push r14 1c7ce: ff 92 push r15 1c7d0: 0f 93 push r16 1c7d2: 1f 93 push r17 1c7d4: cf 93 push r28 1c7d6: df 93 push r29 1c7d8: 6c 01 movw r12, r24 1c7da: 7b 01 movw r14, r22 1c7dc: 80 91 b9 13 lds r24, 0x13B9 ; 0x8013b9 { //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); 1c7e0: 67 2b or r22, r23 1c7e2: 29 f0 breq .+10 ; 0x1c7ee 1c7e4: 06 e0 ldi r16, 0x06 ; 6 1c7e6: 81 30 cpi r24, 0x01 ; 1 1c7e8: 29 f0 breq .+10 ; 0x1c7f4 1c7ea: 05 e0 ldi r16, 0x05 ; 5 1c7ec: 03 c0 rjmp .+6 ; 0x1c7f4 1c7ee: 04 e0 ldi r16, 0x04 ; 4 1c7f0: 81 30 cpi r24, 0x01 ; 1 1c7f2: d9 f3 breq .-10 ; 0x1c7ea const uint8_t item_len = item?strlen_P(item):0; int8_t first = 0; int8_t cursor_pos = 1; lcd_clear(); 1c7f4: 0e 94 2b 6f call 0xde56 ; 0xde56 KEEPALIVE_STATE(PAUSED_FOR_USER); 1c7f8: 84 e0 ldi r24, 0x04 ; 4 1c7fa: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be { //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; 1c7fe: 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; 1c800: 81 2c mov r8, r1 } if (cursor_pos > 3) { cursor_pos = 3; if (first < items_no - 3) 1c802: 03 50 subi r16, 0x03 ; 3 1c804: 11 0b sbc r17, r17 lcd_clear(); KEEPALIVE_STATE(PAUSED_FOR_USER); while (1) { manage_heater(); 1c806: 0f 94 2e 38 call 0x2705c ; 0x2705c manage_inactivity(true); 1c80a: 81 e0 ldi r24, 0x01 ; 1 1c80c: 0e 94 c7 8a call 0x1158e ; 0x1158e if (lcd_encoder) 1c810: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 1c814: 90 91 70 06 lds r25, 0x0670 ; 0x800670 1c818: 00 97 sbiw r24, 0x00 ; 0 1c81a: 09 f4 brne .+2 ; 0x1c81e 1c81c: 9d c0 rjmp .+314 ; 0x1c958 { if (lcd_encoder < 0) 1c81e: 97 ff sbrs r25, 7 1c820: 88 c0 rjmp .+272 ; 0x1c932 { cursor_pos--; 1c822: c1 50 subi r28, 0x01 ; 1 if (lcd_encoder > 0) { cursor_pos++; } lcd_encoder = 0; 1c824: 10 92 70 06 sts 0x0670, r1 ; 0x800670 1c828: 10 92 6f 06 sts 0x066F, r1 ; 0x80066f } if (cursor_pos > 3) 1c82c: c4 30 cpi r28, 0x04 ; 4 1c82e: 0c f4 brge .+2 ; 0x1c832 1c830: 86 c0 rjmp .+268 ; 0x1c93e { cursor_pos = 3; if (first < items_no - 3) 1c832: 88 2d mov r24, r8 1c834: 08 2c mov r0, r8 1c836: 00 0c add r0, r0 1c838: 99 0b sbc r25, r25 1c83a: 80 17 cp r24, r16 1c83c: 91 07 cpc r25, r17 1c83e: 0c f0 brlt .+2 ; 0x1c842 1c840: 7a c0 rjmp .+244 ; 0x1c936 { first++; 1c842: 83 94 inc r8 lcd_clear(); 1c844: 0e 94 2b 6f call 0xde56 ; 0xde56 lcd_encoder = 0; } if (cursor_pos > 3) { cursor_pos = 3; 1c848: 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); 1c84a: c1 14 cp r12, r1 1c84c: d1 04 cpc r13, r1 1c84e: 29 f0 breq .+10 ; 0x1c85a 1c850: a6 01 movw r20, r12 1c852: 60 e0 ldi r22, 0x00 ; 0 1c854: 80 e0 ldi r24, 0x00 ; 0 1c856: 0e 94 0c 6f call 0xde18 ; 0xde18 const bool last_visible = (first == items_no - 3); 1c85a: a8 2c mov r10, r8 1c85c: 08 2c mov r0, r8 1c85e: 00 0c add r0, r0 1c860: bb 08 sbc r11, r11 const uint_least8_t ordinary_items = (last_item&&last_visible)?2:3; 1c862: e1 14 cp r14, r1 1c864: f1 04 cpc r15, r1 1c866: 29 f0 breq .+10 ; 0x1c872 1c868: 82 e0 ldi r24, 0x02 ; 2 1c86a: 98 2e mov r9, r24 1c86c: a0 16 cp r10, r16 1c86e: b1 06 cpc r11, r17 1c870: 11 f0 breq .+4 ; 0x1c876 1c872: 93 e0 ldi r25, 0x03 ; 3 1c874: 99 2e mov r9, r25 for (uint_least8_t i = 0; i < ordinary_items; i++) 1c876: d0 e0 ldi r29, 0x00 ; 0 { if (item) lcd_puts_at_P(1, i + 1, item); 1c878: df 5f subi r29, 0xFF ; 255 1c87a: 48 ef ldi r20, 0xF8 ; 248 1c87c: 5d e6 ldi r21, 0x6D ; 109 1c87e: 6d 2f mov r22, r29 1c880: 81 e0 ldi r24, 0x01 ; 1 1c882: 0e 94 0c 6f call 0xde18 ; 0xde18 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++) 1c886: 9d 12 cpse r9, r29 1c888: f7 cf rjmp .-18 ; 0x1c878 1c88a: 48 2c mov r4, r8 1c88c: 08 2c mov r0, r8 1c88e: 00 0c add r0, r0 1c890: 55 08 sbc r5, r5 1c892: 66 08 sbc r6, r6 1c894: 77 08 sbc r7, r7 1c896: 8f ef ldi r24, 0xFF ; 255 1c898: 48 1a sub r4, r24 1c89a: 58 0a sbc r5, r24 1c89c: 68 0a sbc r6, r24 1c89e: 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++) 1c8a0: 91 2c mov r9, r1 { lcd_set_cursor(2 + item_len, i+1); 1c8a2: 93 94 inc r9 1c8a4: 69 2d mov r22, r9 1c8a6: 8a e0 ldi r24, 0x0A ; 10 1c8a8: 0e 94 f8 6e call 0xddf0 ; 0xddf0 1c8ac: c3 01 movw r24, r6 1c8ae: b2 01 movw r22, r4 1c8b0: 0e 94 b1 70 call 0xe162 ; 0xe162 1c8b4: 8f ef ldi r24, 0xFF ; 255 1c8b6: 48 1a sub r4, r24 1c8b8: 58 0a sbc r5, r24 1c8ba: 68 0a sbc r6, r24 1c8bc: 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++) 1c8be: d9 11 cpse r29, r9 1c8c0: f0 cf rjmp .-32 ; 0x1c8a2 { 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); 1c8c2: e1 14 cp r14, r1 1c8c4: f1 04 cpc r15, r1 1c8c6: 41 f0 breq .+16 ; 0x1c8d8 1c8c8: a0 16 cp r10, r16 1c8ca: b1 06 cpc r11, r17 1c8cc: 29 f4 brne .+10 ; 0x1c8d8 1c8ce: a7 01 movw r20, r14 1c8d0: 63 e0 ldi r22, 0x03 ; 3 1c8d2: 81 e0 ldi r24, 0x01 ; 1 1c8d4: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_puts_at_P(0, 1, PSTR(" \n \n ")); 1c8d8: 4f e2 ldi r20, 0x2F ; 47 1c8da: 5f e8 ldi r21, 0x8F ; 143 1c8dc: 61 e0 ldi r22, 0x01 ; 1 1c8de: 80 e0 ldi r24, 0x00 ; 0 1c8e0: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_putc_at(0, cursor_pos, '>'); 1c8e4: 4e e3 ldi r20, 0x3E ; 62 1c8e6: 6c 2f mov r22, r28 1c8e8: 80 e0 ldi r24, 0x00 ; 0 1c8ea: 0e 94 18 6f call 0xde30 ; 0xde30 _delay(100); 1c8ee: 64 e6 ldi r22, 0x64 ; 100 1c8f0: 70 e0 ldi r23, 0x00 ; 0 1c8f2: 80 e0 ldi r24, 0x00 ; 0 1c8f4: 90 e0 ldi r25, 0x00 ; 0 1c8f6: 0f 94 29 27 call 0x24e52 ; 0x24e52 if (lcd_clicked()) 1c8fa: 0e 94 15 71 call 0xe22a ; 0xe22a 1c8fe: 88 23 and r24, r24 1c900: 09 f4 brne .+2 ; 0x1c904 1c902: 81 cf rjmp .-254 ; 0x1c806 { KEEPALIVE_STATE(IN_HANDLER); 1c904: 82 e0 ldi r24, 0x02 ; 2 1c906: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be return(cursor_pos + first - 1); 1c90a: 8f ef ldi r24, 0xFF ; 255 1c90c: 8c 0f add r24, r28 1c90e: 88 0d add r24, r8 } } } 1c910: df 91 pop r29 1c912: cf 91 pop r28 1c914: 1f 91 pop r17 1c916: 0f 91 pop r16 1c918: ff 90 pop r15 1c91a: ef 90 pop r14 1c91c: df 90 pop r13 1c91e: cf 90 pop r12 1c920: bf 90 pop r11 1c922: af 90 pop r10 1c924: 9f 90 pop r9 1c926: 8f 90 pop r8 1c928: 7f 90 pop r7 1c92a: 6f 90 pop r6 1c92c: 5f 90 pop r5 1c92e: 4f 90 pop r4 1c930: 08 95 ret cursor_pos--; } if (lcd_encoder > 0) { cursor_pos++; 1c932: cf 5f subi r28, 0xFF ; 255 1c934: 77 cf rjmp .-274 ; 0x1c824 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); 1c936: 87 e0 ldi r24, 0x07 ; 7 1c938: 0f 94 c2 4d call 0x29b84 ; 0x29b84 1c93c: 85 cf rjmp .-246 ; 0x1c848 } } if (cursor_pos < 1) 1c93e: c1 11 cpse r28, r1 1c940: 84 cf rjmp .-248 ; 0x1c84a { cursor_pos = 1; if (first > 0) 1c942: 18 14 cp r1, r8 1c944: 2c f4 brge .+10 ; 0x1c950 { first--; 1c946: 8a 94 dec r8 lcd_clear(); 1c948: 0e 94 2b 6f call 0xde56 ; 0xde56 } } if (cursor_pos < 1) { cursor_pos = 1; 1c94c: c1 e0 ldi r28, 0x01 ; 1 1c94e: 7d cf rjmp .-262 ; 0x1c84a if (first > 0) { first--; lcd_clear(); } else { // here we are at the very end of the list Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 1c950: 87 e0 ldi r24, 0x07 ; 7 1c952: 0f 94 c2 4d call 0x29b84 ; 0x29b84 1c956: fa cf rjmp .-12 ; 0x1c94c cursor_pos++; } lcd_encoder = 0; } if (cursor_pos > 3) 1c958: c4 30 cpi r28, 0x04 ; 4 1c95a: 0c f0 brlt .+2 ; 0x1c95e 1c95c: 6a cf rjmp .-300 ; 0x1c832 1c95e: 75 cf rjmp .-278 ; 0x1c84a 0001c960 : 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() { 1c960: cf 93 push r28 1c962: df 93 push r29 if (MMU2::mmu2.Enabled()) { 1c964: 80 91 b9 13 lds r24, 0x13B9 ; 0x8013b9 1c968: 81 30 cpi r24, 0x01 ; 1 1c96a: f9 f4 brne .+62 ; 0x1c9aa 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 1c96c: 80 ec ldi r24, 0xC0 ; 192 1c96e: 9b e3 ldi r25, 0x3B ; 59 1c970: 0e 94 c4 72 call 0xe588 ; 0xe588 1c974: ec 01 movw r28, r24 } void lcd_v2_calibration() { if (MMU2::mmu2.Enabled()) { const uint8_t filament = choose_menu_P( 1c976: 8d ea ldi r24, 0xAD ; 173 1c978: 9b e3 ldi r25, 0x3B ; 59 1c97a: 0e 94 c4 72 call 0xe588 ; 0xe588 1c97e: be 01 movw r22, r28 1c980: 6f 5f subi r22, 0xFF ; 255 1c982: 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 1c984: 0e 94 dc e3 call 0x1c7b8 ; 0x1c7b8 if (filament < MMU_FILAMENT_COUNT) { 1c988: 85 30 cpi r24, 0x05 ; 5 1c98a: 98 f5 brcc .+102 ; 0x1c9f2 lay1cal_filament = filament; 1c98c: 80 93 f9 03 sts 0x03F9, r24 ; 0x8003f9 return; } } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; 1c990: 8a e0 ldi r24, 0x0A ; 10 1c992: 80 93 a5 03 sts 0x03A5, r24 ; 0x8003a5 menu_goto(lcd_generic_preheat_menu, 0, true); 1c996: 20 e0 ldi r18, 0x00 ; 0 1c998: 41 e0 ldi r20, 0x01 ; 1 1c99a: 70 e0 ldi r23, 0x00 ; 0 1c99c: 60 e0 ldi r22, 0x00 ; 0 1c99e: 86 e9 ldi r24, 0x96 ; 150 1c9a0: 9a e3 ldi r25, 0x3A ; 58 } 1c9a2: df 91 pop r29 1c9a4: cf 91 pop r28 } } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; menu_goto(lcd_generic_preheat_menu, 0, true); 1c9a6: 0d 94 7b d1 jmp 0x3a2f6 ; 0x3a2f6 menu_back(); return; } } #ifdef FILAMENT_SENSOR else if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 1c9aa: 8f e5 ldi r24, 0x5F ; 95 1c9ac: 9f e0 ldi r25, 0x0F ; 15 1c9ae: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 1c9b2: 81 11 cpse r24, r1 1c9b4: ed cf rjmp .-38 ; 0x1c990 { bool loaded = false; if (fsensor.isReady()) { 1c9b6: 80 91 a9 17 lds r24, 0x17A9 ; 0x8017a9 1c9ba: 82 30 cpi r24, 0x02 ; 2 1c9bc: f1 f4 brne .+60 ; 0x1c9fa 1c9be: 80 91 b6 17 lds r24, 0x17B6 ; 0x8017b6 1c9c2: 81 11 cpse r24, r1 1c9c4: e5 cf rjmp .-54 ; 0x1c990 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) { lcd_display_message_fullscreen_P(_T(MSG_PLEASE_LOAD_PLA)); 1c9c6: 8f e8 ldi r24, 0x8F ; 143 1c9c8: 9b e3 ldi r25, 0x3B ; 59 1c9ca: 0e 94 c4 72 call 0xe588 ; 0xe588 1c9ce: 0f 94 ba 1f call 0x23f74 ; 0x23f74 lcd_consume_click(); 1c9d2: 0e 94 10 71 call 0xe220 ; 0xe220 1c9d6: c4 e1 ldi r28, 0x14 ; 20 for (uint_least8_t i = 0; i < 20; i++) { //wait max. 2s delay_keep_alive(100); 1c9d8: 84 e6 ldi r24, 0x64 ; 100 1c9da: 90 e0 ldi r25, 0x00 ; 0 1c9dc: 0e 94 fc 8c call 0x119f8 ; 0x119f8 if (lcd_clicked()) { 1c9e0: 0e 94 15 71 call 0xe22a ; 0xe22a 1c9e4: 81 11 cpse r24, r1 1c9e6: 02 c0 rjmp .+4 ; 0x1c9ec 1c9e8: 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 1c9ea: b1 f7 brne .-20 ; 0x1c9d8 delay_keep_alive(100); if (lcd_clicked()) { break; } } lcd_update_enabled = true; 1c9ec: 81 e0 ldi r24, 0x01 ; 1 1c9ee: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; menu_goto(lcd_generic_preheat_menu, 0, true); } 1c9f2: df 91 pop r29 1c9f4: cf 91 pop r28 if (lcd_clicked()) { break; } } lcd_update_enabled = true; menu_back(); 1c9f6: 0d 94 19 d4 jmp 0x3a832 ; 0x3a832 { 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); 1c9fa: 86 ec ldi r24, 0xC6 ; 198 1c9fc: 90 e4 ldi r25, 0x40 ; 64 1c9fe: 0e 94 c4 72 call 0xe588 ; 0xe588 1ca02: 41 e0 ldi r20, 0x01 ; 1 1ca04: 60 e0 ldi r22, 0x00 ; 0 1ca06: 0f 94 fb 4e call 0x29df6 ; 0x29df6 1ca0a: 91 e0 ldi r25, 0x01 ; 1 1ca0c: 81 11 cpse r24, r1 1ca0e: 90 e0 ldi r25, 0x00 ; 0 lcd_update_enabled = true; 1ca10: 81 e0 ldi r24, 0x01 ; 1 1ca12: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e } if (!loaded) { 1ca16: 91 11 cpse r25, r1 1ca18: bb cf rjmp .-138 ; 0x1c990 1ca1a: d5 cf rjmp .-86 ; 0x1c9c6 0001ca1c : { const float a_ = !isnan(a) ? a : nanv; return (a_ * (1.f - f)) + (b * f); } void model_data::step(uint8_t heater_pwm, uint8_t fan_pwm, float heater_temp, float ambient_temp) 1ca1c: 2f 92 push r2 1ca1e: 3f 92 push r3 1ca20: 4f 92 push r4 1ca22: 5f 92 push r5 1ca24: 6f 92 push r6 1ca26: 7f 92 push r7 1ca28: 8f 92 push r8 1ca2a: 9f 92 push r9 1ca2c: af 92 push r10 1ca2e: bf 92 push r11 1ca30: cf 92 push r12 1ca32: df 92 push r13 1ca34: ef 92 push r14 1ca36: ff 92 push r15 1ca38: 0f 93 push r16 1ca3a: 1f 93 push r17 1ca3c: cf 93 push r28 1ca3e: df 93 push r29 1ca40: 00 d0 rcall .+0 ; 0x1ca42 1ca42: 00 d0 rcall .+0 ; 0x1ca44 1ca44: 1f 92 push r1 1ca46: cd b7 in r28, 0x3d ; 61 1ca48: de b7 in r29, 0x3e ; 62 1ca4a: 69 83 std Y+1, r22 ; 0x01 1ca4c: 49 01 movw r8, r18 1ca4e: 5a 01 movw r10, r20 1ca50: 27 01 movw r4, r14 { constexpr float soft_pwm_inv = 1. / ((1 << 7) - 1); // input values const float heater_scale = soft_pwm_inv * heater_pwm; 1ca52: 68 2f mov r22, r24 1ca54: 70 e0 ldi r23, 0x00 ; 0 1ca56: 90 e0 ldi r25, 0x00 ; 0 1ca58: 80 e0 ldi r24, 0x00 ; 0 1ca5a: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 1ca5e: 24 e0 ldi r18, 0x04 ; 4 1ca60: 32 e0 ldi r19, 0x02 ; 2 1ca62: 41 e0 ldi r20, 0x01 ; 1 1ca64: 5c e3 ldi r21, 0x3C ; 60 1ca66: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> const float cur_heater_temp = heater_temp; const float cur_ambient_temp = ambient_temp + Ta_corr; const float cur_R = R[fan_pwm]; // resistance at current fan power (K/W) float dP = P * heater_scale; // current power [W] 1ca6a: 20 91 d9 12 lds r18, 0x12D9 ; 0x8012d9 <_ZN13thermal_modelL4dataE.lto_priv.400+0x2a> 1ca6e: 30 91 da 12 lds r19, 0x12DA ; 0x8012da <_ZN13thermal_modelL4dataE.lto_priv.400+0x2b> 1ca72: 40 91 db 12 lds r20, 0x12DB ; 0x8012db <_ZN13thermal_modelL4dataE.lto_priv.400+0x2c> 1ca76: 50 91 dc 12 lds r21, 0x12DC ; 0x8012dc <_ZN13thermal_modelL4dataE.lto_priv.400+0x2d> 1ca7a: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 1ca7e: 6b 01 movw r12, r22 1ca80: 7c 01 movw r14, r24 dP *= (cur_heater_temp * U) + V; // linear temp. correction 1ca82: 20 91 dd 12 lds r18, 0x12DD ; 0x8012dd <_ZN13thermal_modelL4dataE.lto_priv.400+0x2e> 1ca86: 30 91 de 12 lds r19, 0x12DE ; 0x8012de <_ZN13thermal_modelL4dataE.lto_priv.400+0x2f> 1ca8a: 40 91 df 12 lds r20, 0x12DF ; 0x8012df <_ZN13thermal_modelL4dataE.lto_priv.400+0x30> 1ca8e: 50 91 e0 12 lds r21, 0x12E0 ; 0x8012e0 <_ZN13thermal_modelL4dataE.lto_priv.400+0x31> 1ca92: c5 01 movw r24, r10 1ca94: b4 01 movw r22, r8 1ca96: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 1ca9a: 20 91 e1 12 lds r18, 0x12E1 ; 0x8012e1 <_ZN13thermal_modelL4dataE.lto_priv.400+0x32> 1ca9e: 30 91 e2 12 lds r19, 0x12E2 ; 0x8012e2 <_ZN13thermal_modelL4dataE.lto_priv.400+0x33> 1caa2: 40 91 e3 12 lds r20, 0x12E3 ; 0x8012e3 <_ZN13thermal_modelL4dataE.lto_priv.400+0x34> 1caa6: 50 91 e4 12 lds r21, 0x12E4 ; 0x8012e4 <_ZN13thermal_modelL4dataE.lto_priv.400+0x35> 1caaa: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 1caae: a7 01 movw r20, r14 1cab0: 96 01 movw r18, r12 1cab2: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 1cab6: 6b 01 movw r12, r22 1cab8: 7c 01 movw r14, r24 constexpr float soft_pwm_inv = 1. / ((1 << 7) - 1); // input values const float heater_scale = soft_pwm_inv * heater_pwm; const float cur_heater_temp = heater_temp; const float cur_ambient_temp = ambient_temp + Ta_corr; 1caba: 20 91 2f 13 lds r18, 0x132F ; 0x80132f <_ZN13thermal_modelL4dataE.lto_priv.400+0x80> 1cabe: 30 91 30 13 lds r19, 0x1330 ; 0x801330 <_ZN13thermal_modelL4dataE.lto_priv.400+0x81> 1cac2: 40 91 31 13 lds r20, 0x1331 ; 0x801331 <_ZN13thermal_modelL4dataE.lto_priv.400+0x82> 1cac6: 50 91 32 13 lds r21, 0x1332 ; 0x801332 <_ZN13thermal_modelL4dataE.lto_priv.400+0x83> 1caca: c8 01 movw r24, r16 1cacc: b2 01 movw r22, r4 1cace: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 1cad2: 9b 01 movw r18, r22 1cad4: ac 01 movw r20, r24 const float cur_R = R[fan_pwm]; // resistance at current fan power (K/W) float dP = P * heater_scale; // current power [W] dP *= (cur_heater_temp * U) + V; // linear temp. correction float dPl = (cur_heater_temp - cur_ambient_temp) / cur_R; // [W] leakage power 1cad6: c5 01 movw r24, r10 1cad8: b4 01 movw r22, r8 1cada: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> // input values const float heater_scale = soft_pwm_inv * heater_pwm; const float cur_heater_temp = heater_temp; const float cur_ambient_temp = ambient_temp + Ta_corr; const float cur_R = R[fan_pwm]; // resistance at current fan power (K/W) 1cade: 39 81 ldd r19, Y+1 ; 0x01 1cae0: 24 e0 ldi r18, 0x04 ; 4 1cae2: 32 9f mul r19, r18 1cae4: f0 01 movw r30, r0 1cae6: 11 24 eor r1, r1 1cae8: e1 51 subi r30, 0x11 ; 17 1caea: fd 4e sbci r31, 0xED ; 237 float dP = P * heater_scale; // current power [W] dP *= (cur_heater_temp * U) + V; // linear temp. correction float dPl = (cur_heater_temp - cur_ambient_temp) / cur_R; // [W] leakage power 1caec: 20 81 ld r18, Z 1caee: 31 81 ldd r19, Z+1 ; 0x01 1caf0: 42 81 ldd r20, Z+2 ; 0x02 1caf2: 53 81 ldd r21, Z+3 ; 0x03 1caf4: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 1caf8: 9b 01 movw r18, r22 1cafa: ac 01 movw r20, r24 float dT = (dP - dPl) * C_i; // expected temperature difference (K) 1cafc: c7 01 movw r24, r14 1cafe: b6 01 movw r22, r12 1cb00: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 1cb04: 20 91 3c 13 lds r18, 0x133C ; 0x80133c <_ZN13thermal_modelL4dataE.lto_priv.400+0x8d> 1cb08: 30 91 3d 13 lds r19, 0x133D ; 0x80133d <_ZN13thermal_modelL4dataE.lto_priv.400+0x8e> 1cb0c: 40 91 3e 13 lds r20, 0x133E ; 0x80133e <_ZN13thermal_modelL4dataE.lto_priv.400+0x8f> 1cb10: 50 91 3f 13 lds r21, 0x133F ; 0x80133f <_ZN13thermal_modelL4dataE.lto_priv.400+0x90> 1cb14: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 1cb18: 6f 83 std Y+7, r22 ; 0x07 1cb1a: 79 83 std Y+1, r23 ; 0x01 1cb1c: 18 2f mov r17, r24 1cb1e: 09 2f mov r16, r25 // filter and lag dT uint8_t dT_next_idx = (dT_lag_idx == (dT_lag_size - 1) ? 0: dT_lag_idx + 1); 1cb20: 20 91 d0 12 lds r18, 0x12D0 ; 0x8012d0 <_ZN13thermal_modelL4dataE.lto_priv.400+0x21> 1cb24: e2 2f mov r30, r18 1cb26: f0 e0 ldi r31, 0x00 ; 0 1cb28: 80 91 cf 12 lds r24, 0x12CF ; 0x8012cf <_ZN13thermal_modelL4dataE.lto_priv.400+0x20> 1cb2c: 81 50 subi r24, 0x01 ; 1 1cb2e: 99 0b sbc r25, r25 1cb30: e8 17 cp r30, r24 1cb32: f9 07 cpc r31, r25 1cb34: 09 f4 brne .+2 ; 0x1cb38 1cb36: f4 c0 rjmp .+488 ; 0x1cd20 1cb38: 2f 5f subi r18, 0xFF ; 255 1cb3a: 2e 83 std Y+6, r18 ; 0x06 float dT_lag = dT_lag_buf[dT_next_idx]; 1cb3c: 5e 81 ldd r21, Y+6 ; 0x06 1cb3e: 44 e0 ldi r20, 0x04 ; 4 1cb40: 54 9f mul r21, r20 1cb42: 10 01 movw r2, r0 1cb44: 11 24 eor r1, r1 1cb46: d1 01 movw r26, r2 1cb48: a1 55 subi r26, 0x51 ; 81 1cb4a: bd 4e sbci r27, 0xED ; 237 1cb4c: 2d 91 ld r18, X+ 1cb4e: 3d 91 ld r19, X+ 1cb50: 4d 91 ld r20, X+ 1cb52: 5c 91 ld r21, X 1cb54: 2a 83 std Y+2, r18 ; 0x02 1cb56: 3b 83 std Y+3, r19 ; 0x03 1cb58: 4c 83 std Y+4, r20 ; 0x04 1cb5a: 5d 83 std Y+5, r21 ; 0x05 float dT_lag_prev = dT_lag_buf[dT_lag_idx]; 1cb5c: ee 0f add r30, r30 1cb5e: ff 1f adc r31, r31 1cb60: ee 0f add r30, r30 1cb62: ff 1f adc r31, r31 1cb64: e1 55 subi r30, 0x51 ; 81 1cb66: fd 4e sbci r31, 0xED ; 237 1cb68: 40 80 ld r4, Z 1cb6a: 51 80 ldd r5, Z+1 ; 0x01 1cb6c: 62 80 ldd r6, Z+2 ; 0x02 1cb6e: 73 80 ldd r7, Z+3 ; 0x03 float dT_f = iir_mul(dT_lag_prev, dT, fS, dT); 1cb70: c0 90 e9 12 lds r12, 0x12E9 ; 0x8012e9 <_ZN13thermal_modelL4dataE.lto_priv.400+0x3a> 1cb74: d0 90 ea 12 lds r13, 0x12EA ; 0x8012ea <_ZN13thermal_modelL4dataE.lto_priv.400+0x3b> 1cb78: e0 90 eb 12 lds r14, 0x12EB ; 0x8012eb <_ZN13thermal_modelL4dataE.lto_priv.400+0x3c> 1cb7c: f0 90 ec 12 lds r15, 0x12EC ; 0x8012ec <_ZN13thermal_modelL4dataE.lto_priv.400+0x3d> flag_bits.uninitialized = false; } static constexpr float iir_mul(const float a, const float b, const float f, const float nanv) { const float a_ = !isnan(a) ? a : nanv; 1cb80: 92 01 movw r18, r4 1cb82: a3 01 movw r20, r6 1cb84: b2 01 movw r22, r4 1cb86: c3 01 movw r24, r6 1cb88: 0f 94 0d e1 call 0x3c21a ; 0x3c21a <__unordsf2> 1cb8c: 88 23 and r24, r24 1cb8e: 21 f0 breq .+8 ; 0x1cb98 1cb90: 4f 80 ldd r4, Y+7 ; 0x07 1cb92: 59 80 ldd r5, Y+1 ; 0x01 1cb94: 61 2e mov r6, r17 1cb96: 70 2e mov r7, r16 // filter and lag dT uint8_t dT_next_idx = (dT_lag_idx == (dT_lag_size - 1) ? 0: dT_lag_idx + 1); float dT_lag = dT_lag_buf[dT_next_idx]; float dT_lag_prev = dT_lag_buf[dT_lag_idx]; float dT_f = iir_mul(dT_lag_prev, dT, fS, dT); dT_lag_buf[dT_next_idx] = dT_f; 1cb98: a1 01 movw r20, r2 1cb9a: 41 55 subi r20, 0x51 ; 81 1cb9c: 5d 4e sbci r21, 0xED ; 237 1cb9e: 1a 01 movw r2, r20 } static constexpr float iir_mul(const float a, const float b, const float f, const float nanv) { const float a_ = !isnan(a) ? a : nanv; return (a_ * (1.f - f)) + (b * f); 1cba0: a7 01 movw r20, r14 1cba2: 96 01 movw r18, r12 1cba4: 60 e0 ldi r22, 0x00 ; 0 1cba6: 70 e0 ldi r23, 0x00 ; 0 1cba8: 80 e8 ldi r24, 0x80 ; 128 1cbaa: 9f e3 ldi r25, 0x3F ; 63 1cbac: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 1cbb0: 92 01 movw r18, r4 1cbb2: a3 01 movw r20, r6 1cbb4: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 1cbb8: 2b 01 movw r4, r22 1cbba: 3c 01 movw r6, r24 1cbbc: a7 01 movw r20, r14 1cbbe: 96 01 movw r18, r12 1cbc0: 6f 81 ldd r22, Y+7 ; 0x07 1cbc2: 79 81 ldd r23, Y+1 ; 0x01 1cbc4: 81 2f mov r24, r17 1cbc6: 90 2f mov r25, r16 1cbc8: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 1cbcc: 9b 01 movw r18, r22 1cbce: ac 01 movw r20, r24 1cbd0: c3 01 movw r24, r6 1cbd2: b2 01 movw r22, r4 1cbd4: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> // filter and lag dT uint8_t dT_next_idx = (dT_lag_idx == (dT_lag_size - 1) ? 0: dT_lag_idx + 1); float dT_lag = dT_lag_buf[dT_next_idx]; float dT_lag_prev = dT_lag_buf[dT_lag_idx]; float dT_f = iir_mul(dT_lag_prev, dT, fS, dT); dT_lag_buf[dT_next_idx] = dT_f; 1cbd8: f1 01 movw r30, r2 1cbda: 60 83 st Z, r22 1cbdc: 71 83 std Z+1, r23 ; 0x01 1cbde: 82 83 std Z+2, r24 ; 0x02 1cbe0: 93 83 std Z+3, r25 ; 0x03 dT_lag_idx = dT_next_idx; 1cbe2: fe 81 ldd r31, Y+6 ; 0x06 1cbe4: f0 93 d0 12 sts 0x12D0, r31 ; 0x8012d0 <_ZN13thermal_modelL4dataE.lto_priv.400+0x21> // calculate and filter dT_err float dT_err = (cur_heater_temp - T_prev) - dT_lag; 1cbe8: 20 91 d5 12 lds r18, 0x12D5 ; 0x8012d5 <_ZN13thermal_modelL4dataE.lto_priv.400+0x26> 1cbec: 30 91 d6 12 lds r19, 0x12D6 ; 0x8012d6 <_ZN13thermal_modelL4dataE.lto_priv.400+0x27> 1cbf0: 40 91 d7 12 lds r20, 0x12D7 ; 0x8012d7 <_ZN13thermal_modelL4dataE.lto_priv.400+0x28> 1cbf4: 50 91 d8 12 lds r21, 0x12D8 ; 0x8012d8 <_ZN13thermal_modelL4dataE.lto_priv.400+0x29> 1cbf8: c5 01 movw r24, r10 1cbfa: b4 01 movw r22, r8 1cbfc: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 1cc00: 2a 81 ldd r18, Y+2 ; 0x02 1cc02: 3b 81 ldd r19, Y+3 ; 0x03 1cc04: 4c 81 ldd r20, Y+4 ; 0x04 1cc06: 5d 81 ldd r21, Y+5 ; 0x05 1cc08: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 1cc0c: 2b 01 movw r4, r22 1cc0e: 3c 01 movw r6, r24 float dT_err_f = iir_mul(dT_err_prev, dT_err, THERMAL_MODEL_fE, 0.); 1cc10: c0 90 d1 12 lds r12, 0x12D1 ; 0x8012d1 <_ZN13thermal_modelL4dataE.lto_priv.400+0x22> 1cc14: d0 90 d2 12 lds r13, 0x12D2 ; 0x8012d2 <_ZN13thermal_modelL4dataE.lto_priv.400+0x23> 1cc18: e0 90 d3 12 lds r14, 0x12D3 ; 0x8012d3 <_ZN13thermal_modelL4dataE.lto_priv.400+0x24> 1cc1c: f0 90 d4 12 lds r15, 0x12D4 ; 0x8012d4 <_ZN13thermal_modelL4dataE.lto_priv.400+0x25> flag_bits.uninitialized = false; } static constexpr float iir_mul(const float a, const float b, const float f, const float nanv) { const float a_ = !isnan(a) ? a : nanv; 1cc20: a7 01 movw r20, r14 1cc22: 96 01 movw r18, r12 1cc24: c7 01 movw r24, r14 1cc26: b6 01 movw r22, r12 1cc28: 0f 94 0d e1 call 0x3c21a ; 0x3c21a <__unordsf2> 1cc2c: 88 23 and r24, r24 1cc2e: 19 f0 breq .+6 ; 0x1cc36 1cc30: c1 2c mov r12, r1 1cc32: d1 2c mov r13, r1 1cc34: 76 01 movw r14, r12 return (a_ * (1.f - f)) + (b * f); 1cc36: 23 e3 ldi r18, 0x33 ; 51 1cc38: 33 e3 ldi r19, 0x33 ; 51 1cc3a: 43 e7 ldi r20, 0x73 ; 115 1cc3c: 5f e3 ldi r21, 0x3F ; 63 1cc3e: c7 01 movw r24, r14 1cc40: b6 01 movw r22, r12 1cc42: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 1cc46: 6b 01 movw r12, r22 1cc48: 7c 01 movw r14, r24 1cc4a: 2d ec ldi r18, 0xCD ; 205 1cc4c: 3c ec ldi r19, 0xCC ; 204 1cc4e: 4c e4 ldi r20, 0x4C ; 76 1cc50: 5d e3 ldi r21, 0x3D ; 61 1cc52: c3 01 movw r24, r6 1cc54: b2 01 movw r22, r4 1cc56: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 1cc5a: 9b 01 movw r18, r22 1cc5c: ac 01 movw r20, r24 1cc5e: c7 01 movw r24, r14 1cc60: b6 01 movw r22, r12 1cc62: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> dT_lag_idx = dT_next_idx; // calculate and filter dT_err float dT_err = (cur_heater_temp - T_prev) - dT_lag; float dT_err_f = iir_mul(dT_err_prev, dT_err, THERMAL_MODEL_fE, 0.); T_prev = cur_heater_temp; 1cc66: 80 92 d5 12 sts 0x12D5, r8 ; 0x8012d5 <_ZN13thermal_modelL4dataE.lto_priv.400+0x26> 1cc6a: 90 92 d6 12 sts 0x12D6, r9 ; 0x8012d6 <_ZN13thermal_modelL4dataE.lto_priv.400+0x27> 1cc6e: a0 92 d7 12 sts 0x12D7, r10 ; 0x8012d7 <_ZN13thermal_modelL4dataE.lto_priv.400+0x28> 1cc72: b0 92 d8 12 sts 0x12D8, r11 ; 0x8012d8 <_ZN13thermal_modelL4dataE.lto_priv.400+0x29> dT_err_prev = dT_err_f; 1cc76: 60 93 d1 12 sts 0x12D1, r22 ; 0x8012d1 <_ZN13thermal_modelL4dataE.lto_priv.400+0x22> 1cc7a: 70 93 d2 12 sts 0x12D2, r23 ; 0x8012d2 <_ZN13thermal_modelL4dataE.lto_priv.400+0x23> 1cc7e: 80 93 d3 12 sts 0x12D3, r24 ; 0x8012d3 <_ZN13thermal_modelL4dataE.lto_priv.400+0x24> 1cc82: 90 93 d4 12 sts 0x12D4, r25 ; 0x8012d4 <_ZN13thermal_modelL4dataE.lto_priv.400+0x25> // check and trigger errors flag_bits.error = (fabsf(dT_err_f) > err_s); 1cc86: 6b 01 movw r12, r22 1cc88: 7c 01 movw r14, r24 1cc8a: e8 94 clt 1cc8c: f7 f8 bld r15, 7 1cc8e: 21 e0 ldi r18, 0x01 ; 1 1cc90: 29 83 std Y+1, r18 ; 0x01 1cc92: 20 91 44 13 lds r18, 0x1344 ; 0x801344 <_ZN13thermal_modelL4dataE.lto_priv.400+0x95> 1cc96: 30 91 45 13 lds r19, 0x1345 ; 0x801345 <_ZN13thermal_modelL4dataE.lto_priv.400+0x96> 1cc9a: 40 91 46 13 lds r20, 0x1346 ; 0x801346 <_ZN13thermal_modelL4dataE.lto_priv.400+0x97> 1cc9e: 50 91 47 13 lds r21, 0x1347 ; 0x801347 <_ZN13thermal_modelL4dataE.lto_priv.400+0x98> 1cca2: c7 01 movw r24, r14 1cca4: b6 01 movw r22, r12 1cca6: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 1ccaa: 18 16 cp r1, r24 1ccac: 0c f0 brlt .+2 ; 0x1ccb0 1ccae: 19 82 std Y+1, r1 ; 0x01 1ccb0: 80 91 3b 13 lds r24, 0x133B ; 0x80133b <_ZN13thermal_modelL4dataE.lto_priv.400+0x8c> 1ccb4: 39 81 ldd r19, Y+1 ; 0x01 1ccb6: 30 fb bst r19, 0 1ccb8: 81 f9 bld r24, 1 1ccba: 80 93 3b 13 sts 0x133B, r24 ; 0x80133b <_ZN13thermal_modelL4dataE.lto_priv.400+0x8c> flag_bits.warning = (fabsf(dT_err_f) > warn_s); 1ccbe: 41 e0 ldi r20, 0x01 ; 1 1ccc0: 49 83 std Y+1, r20 ; 0x01 1ccc2: 20 91 40 13 lds r18, 0x1340 ; 0x801340 <_ZN13thermal_modelL4dataE.lto_priv.400+0x91> 1ccc6: 30 91 41 13 lds r19, 0x1341 ; 0x801341 <_ZN13thermal_modelL4dataE.lto_priv.400+0x92> 1ccca: 40 91 42 13 lds r20, 0x1342 ; 0x801342 <_ZN13thermal_modelL4dataE.lto_priv.400+0x93> 1ccce: 50 91 43 13 lds r21, 0x1343 ; 0x801343 <_ZN13thermal_modelL4dataE.lto_priv.400+0x94> 1ccd2: c7 01 movw r24, r14 1ccd4: b6 01 movw r22, r12 1ccd6: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 1ccda: 18 16 cp r1, r24 1ccdc: 0c f0 brlt .+2 ; 0x1cce0 1ccde: 19 82 std Y+1, r1 ; 0x01 1cce0: 80 91 3b 13 lds r24, 0x133B ; 0x80133b <_ZN13thermal_modelL4dataE.lto_priv.400+0x8c> 1cce4: 59 81 ldd r21, Y+1 ; 0x01 1cce6: 50 fb bst r21, 0 1cce8: 82 f9 bld r24, 2 1ccea: 80 93 3b 13 sts 0x133B, r24 ; 0x80133b <_ZN13thermal_modelL4dataE.lto_priv.400+0x8c> } 1ccee: 27 96 adiw r28, 0x07 ; 7 1ccf0: 0f b6 in r0, 0x3f ; 63 1ccf2: f8 94 cli 1ccf4: de bf out 0x3e, r29 ; 62 1ccf6: 0f be out 0x3f, r0 ; 63 1ccf8: cd bf out 0x3d, r28 ; 61 1ccfa: df 91 pop r29 1ccfc: cf 91 pop r28 1ccfe: 1f 91 pop r17 1cd00: 0f 91 pop r16 1cd02: ff 90 pop r15 1cd04: ef 90 pop r14 1cd06: df 90 pop r13 1cd08: cf 90 pop r12 1cd0a: bf 90 pop r11 1cd0c: af 90 pop r10 1cd0e: 9f 90 pop r9 1cd10: 8f 90 pop r8 1cd12: 7f 90 pop r7 1cd14: 6f 90 pop r6 1cd16: 5f 90 pop r5 1cd18: 4f 90 pop r4 1cd1a: 3f 90 pop r3 1cd1c: 2f 90 pop r2 1cd1e: 08 95 ret dP *= (cur_heater_temp * U) + V; // linear temp. correction float dPl = (cur_heater_temp - cur_ambient_temp) / cur_R; // [W] leakage power float dT = (dP - dPl) * C_i; // expected temperature difference (K) // filter and lag dT uint8_t dT_next_idx = (dT_lag_idx == (dT_lag_size - 1) ? 0: dT_lag_idx + 1); 1cd20: 1e 82 std Y+6, r1 ; 0x06 1cd22: 0c cf rjmp .-488 ; 0x1cb3c 0001cd24 : float d = GOLDEN_RATIO * (bounds[1] - bounds[0]); points[0] = bounds[0] + d; points[1] = bounds[1] - d; } static float estimate(uint16_t samples, 1cd24: 2f 92 push r2 1cd26: 3f 92 push r3 1cd28: 4f 92 push r4 1cd2a: 5f 92 push r5 1cd2c: 6f 92 push r6 1cd2e: 7f 92 push r7 1cd30: 8f 92 push r8 1cd32: 9f 92 push r9 1cd34: af 92 push r10 1cd36: bf 92 push r11 1cd38: cf 92 push r12 1cd3a: df 92 push r13 1cd3c: ef 92 push r14 1cd3e: ff 92 push r15 1cd40: 0f 93 push r16 1cd42: 1f 93 push r17 1cd44: cf 93 push r28 1cd46: df 93 push r29 1cd48: cd b7 in r28, 0x3d ; 61 1cd4a: de b7 in r29, 0x3e ; 62 1cd4c: a4 97 sbiw r28, 0x24 ; 36 1cd4e: 0f b6 in r0, 0x3f ; 63 1cd50: f8 94 cli 1cd52: de bf out 0x3e, r29 ; 62 1cd54: 0f be out 0x3f, r0 ; 63 1cd56: cd bf out 0x3d, r28 ; 61 1cd58: 9b 8f std Y+27, r25 ; 0x1b 1cd5a: 8a 8f std Y+26, r24 ; 0x1a 1cd5c: 7a 8b std Y+18, r23 ; 0x12 1cd5e: 69 8b std Y+17, r22 ; 0x11 1cd60: 2b 8b std Y+19, r18 ; 0x13 1cd62: 3c 8b std Y+20, r19 ; 0x14 1cd64: 4d 8b std Y+21, r20 ; 0x15 1cd66: 5e 8b std Y+22, r21 ; 0x16 1cd68: 0c 8f std Y+28, r16 ; 0x1c 1cd6a: cd 8e std Y+29, r12 ; 0x1d 1cd6c: de 8e std Y+30, r13 ; 0x1e 1cd6e: ef 8e std Y+31, r14 ; 0x1f 1cd70: f8 a2 std Y+32, r15 ; 0x20 float thr, uint16_t max_itr, uint8_t fan_pwm, float ambient) { // during estimation we alter the model values without an extra copy to conserve memory // so we cannot keep the main checker active until a value has been found bool was_enabled = thermal_model::enabled; 1cd72: 20 91 1c 05 lds r18, 0x051C ; 0x80051c <_ZN13thermal_modelL7enabledE.lto_priv.456> 1cd76: 29 8f std Y+25, r18 ; 0x19 thermal_model_reset_enabled(false); 1cd78: 80 e0 ldi r24, 0x00 ; 0 1cd7a: 0f 94 31 32 call 0x26462 ; 0x26462 float orig = *var; 1cd7e: a9 89 ldd r26, Y+17 ; 0x11 1cd80: ba 89 ldd r27, Y+18 ; 0x12 1cd82: 8d 91 ld r24, X+ 1cd84: 9d 91 ld r25, X+ 1cd86: 0d 90 ld r0, X+ 1cd88: bc 91 ld r27, X 1cd8a: a0 2d mov r26, r0 1cd8c: 89 a3 std Y+33, r24 ; 0x21 1cd8e: 9a a3 std Y+34, r25 ; 0x22 1cd90: ab a3 std Y+35, r26 ; 0x23 1cd92: bc a3 std Y+36, r27 ; 0x24 float e = NAN; float points[2]; float bounds[2] = {min, max}; 1cd94: 80 e0 ldi r24, 0x00 ; 0 1cd96: 90 e0 ldi r25, 0x00 ; 0 1cd98: a0 ea ldi r26, 0xA0 ; 160 1cd9a: b0 e4 ldi r27, 0x40 ; 64 1cd9c: 89 83 std Y+1, r24 ; 0x01 1cd9e: 9a 83 std Y+2, r25 ; 0x02 1cda0: ab 83 std Y+3, r26 ; 0x03 1cda2: bc 83 std Y+4, r27 ; 0x04 1cda4: 8b 89 ldd r24, Y+19 ; 0x13 1cda6: 9c 89 ldd r25, Y+20 ; 0x14 1cda8: ad 89 ldd r26, Y+21 ; 0x15 1cdaa: be 89 ldd r27, Y+22 ; 0x16 1cdac: 8d 83 std Y+5, r24 ; 0x05 1cdae: 9e 83 std Y+6, r25 ; 0x06 1cdb0: af 83 std Y+7, r26 ; 0x07 1cdb2: b8 87 std Y+8, r27 ; 0x08 constexpr float GOLDEN_RATIO = 0.6180339887498949; static void update_section(float points[2], const float bounds[2]) { float d = GOLDEN_RATIO * (bounds[1] - bounds[0]); 1cdb4: 20 e0 ldi r18, 0x00 ; 0 1cdb6: 30 e0 ldi r19, 0x00 ; 0 1cdb8: 40 ea ldi r20, 0xA0 ; 160 1cdba: 50 e4 ldi r21, 0x40 ; 64 1cdbc: bc 01 movw r22, r24 1cdbe: cd 01 movw r24, r26 1cdc0: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 1cdc4: 2a e7 ldi r18, 0x7A ; 122 1cdc6: 37 e3 ldi r19, 0x37 ; 55 1cdc8: 4e e1 ldi r20, 0x1E ; 30 1cdca: 5f e3 ldi r21, 0x3F ; 63 1cdcc: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 1cdd0: 6b 01 movw r12, r22 1cdd2: 7c 01 movw r14, r24 points[0] = bounds[0] + d; 1cdd4: 20 e0 ldi r18, 0x00 ; 0 1cdd6: 30 e0 ldi r19, 0x00 ; 0 1cdd8: 40 ea ldi r20, 0xA0 ; 160 1cdda: 50 e4 ldi r21, 0x40 ; 64 1cddc: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 1cde0: 69 87 std Y+9, r22 ; 0x09 1cde2: 7a 87 std Y+10, r23 ; 0x0a 1cde4: 8b 87 std Y+11, r24 ; 0x0b 1cde6: 9c 87 std Y+12, r25 ; 0x0c points[1] = bounds[1] - d; 1cde8: a7 01 movw r20, r14 1cdea: 96 01 movw r18, r12 1cdec: 6b 89 ldd r22, Y+19 ; 0x13 1cdee: 7c 89 ldd r23, Y+20 ; 0x14 1cdf0: 8d 89 ldd r24, Y+21 ; 0x15 1cdf2: 9e 89 ldd r25, Y+22 ; 0x16 1cdf4: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 1cdf8: 6d 87 std Y+13, r22 ; 0x0d 1cdfa: 7e 87 std Y+14, r23 ; 0x0e 1cdfc: 8f 87 std Y+15, r24 ; 0x0f 1cdfe: 98 8b std Y+16, r25 ; 0x10 1ce00: 31 2c mov r3, r1 1ce02: 21 2c mov r2, r1 float points[2]; float bounds[2] = {min, max}; update_section(points, bounds); for(uint8_t it = 0; it != max_itr; ++it) { float c1 = cost_fn(samples, var, points[0], fan_pwm, ambient); 1ce04: 29 85 ldd r18, Y+9 ; 0x09 1ce06: 3a 85 ldd r19, Y+10 ; 0x0a 1ce08: 4b 85 ldd r20, Y+11 ; 0x0b 1ce0a: 5c 85 ldd r21, Y+12 ; 0x0c 1ce0c: cd 8c ldd r12, Y+29 ; 0x1d 1ce0e: de 8c ldd r13, Y+30 ; 0x1e 1ce10: ef 8c ldd r14, Y+31 ; 0x1f 1ce12: f8 a0 ldd r15, Y+32 ; 0x20 1ce14: 0c 8d ldd r16, Y+28 ; 0x1c 1ce16: 69 89 ldd r22, Y+17 ; 0x11 1ce18: 7a 89 ldd r23, Y+18 ; 0x12 1ce1a: 8a 8d ldd r24, Y+26 ; 0x1a 1ce1c: 9b 8d ldd r25, Y+27 ; 0x1b 1ce1e: 0f 94 83 2c call 0x25906 ; 0x25906 1ce22: 4b 01 movw r8, r22 1ce24: 5c 01 movw r10, r24 float c2 = cost_fn(samples, var, points[1], fan_pwm, ambient); 1ce26: 2d 85 ldd r18, Y+13 ; 0x0d 1ce28: 3e 85 ldd r19, Y+14 ; 0x0e 1ce2a: 4f 85 ldd r20, Y+15 ; 0x0f 1ce2c: 58 89 ldd r21, Y+16 ; 0x10 1ce2e: cd 8c ldd r12, Y+29 ; 0x1d 1ce30: de 8c ldd r13, Y+30 ; 0x1e 1ce32: ef 8c ldd r14, Y+31 ; 0x1f 1ce34: f8 a0 ldd r15, Y+32 ; 0x20 1ce36: 0c 8d ldd r16, Y+28 ; 0x1c 1ce38: 69 89 ldd r22, Y+17 ; 0x11 1ce3a: 7a 89 ldd r23, Y+18 ; 0x12 1ce3c: 8a 8d ldd r24, Y+26 ; 0x1a 1ce3e: 9b 8d ldd r25, Y+27 ; 0x1b 1ce40: 0f 94 83 2c call 0x25906 ; 0x25906 1ce44: 9b 01 movw r18, r22 1ce46: ac 01 movw r20, r24 bool dir = (c2 < c1); 1ce48: 11 e0 ldi r17, 0x01 ; 1 1ce4a: c5 01 movw r24, r10 1ce4c: b4 01 movw r22, r8 1ce4e: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 1ce52: 18 16 cp r1, r24 1ce54: 0c f0 brlt .+2 ; 0x1ce58 1ce56: 10 e0 ldi r17, 0x00 ; 0 bounds[dir] = points[!dir]; 1ce58: 01 e0 ldi r16, 0x01 ; 1 1ce5a: 01 27 eor r16, r17 1ce5c: 80 2f mov r24, r16 1ce5e: 90 e0 ldi r25, 0x00 ; 0 1ce60: e1 2f mov r30, r17 1ce62: f0 e0 ldi r31, 0x00 ; 0 1ce64: ee 0f add r30, r30 1ce66: ff 1f adc r31, r31 1ce68: ee 0f add r30, r30 1ce6a: ff 1f adc r31, r31 1ce6c: 41 e0 ldi r20, 0x01 ; 1 1ce6e: 50 e0 ldi r21, 0x00 ; 0 1ce70: 4c 0f add r20, r28 1ce72: 5d 1f adc r21, r29 1ce74: 4e 0f add r20, r30 1ce76: 5f 1f adc r21, r31 1ce78: 8c 01 movw r16, r24 1ce7a: 00 0f add r16, r16 1ce7c: 11 1f adc r17, r17 1ce7e: 00 0f add r16, r16 1ce80: 11 1f adc r17, r17 1ce82: a1 e0 ldi r26, 0x01 ; 1 1ce84: b0 e0 ldi r27, 0x00 ; 0 1ce86: ac 0f add r26, r28 1ce88: bd 1f adc r27, r29 1ce8a: 0a 0f add r16, r26 1ce8c: 1b 1f adc r17, r27 1ce8e: f8 01 movw r30, r16 1ce90: 38 96 adiw r30, 0x08 ; 8 1ce92: f8 8f std Y+24, r31 ; 0x18 1ce94: ef 8b std Y+23, r30 ; 0x17 1ce96: f8 01 movw r30, r16 1ce98: 80 85 ldd r24, Z+8 ; 0x08 1ce9a: 91 85 ldd r25, Z+9 ; 0x09 1ce9c: a2 85 ldd r26, Z+10 ; 0x0a 1ce9e: b3 85 ldd r27, Z+11 ; 0x0b 1cea0: fa 01 movw r30, r20 1cea2: 80 83 st Z, r24 1cea4: 91 83 std Z+1, r25 ; 0x01 1cea6: a2 83 std Z+2, r26 ; 0x02 1cea8: b3 83 std Z+3, r27 ; 0x03 constexpr float GOLDEN_RATIO = 0.6180339887498949; static void update_section(float points[2], const float bounds[2]) { float d = GOLDEN_RATIO * (bounds[1] - bounds[0]); 1ceaa: 8d 80 ldd r8, Y+5 ; 0x05 1ceac: 9e 80 ldd r9, Y+6 ; 0x06 1ceae: af 80 ldd r10, Y+7 ; 0x07 1ceb0: b8 84 ldd r11, Y+8 ; 0x08 1ceb2: c9 80 ldd r12, Y+1 ; 0x01 1ceb4: da 80 ldd r13, Y+2 ; 0x02 1ceb6: eb 80 ldd r14, Y+3 ; 0x03 1ceb8: fc 80 ldd r15, Y+4 ; 0x04 1ceba: a7 01 movw r20, r14 1cebc: 96 01 movw r18, r12 1cebe: c5 01 movw r24, r10 1cec0: b4 01 movw r22, r8 1cec2: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 1cec6: 2a e7 ldi r18, 0x7A ; 122 1cec8: 37 e3 ldi r19, 0x37 ; 55 1ceca: 4e e1 ldi r20, 0x1E ; 30 1cecc: 5f e3 ldi r21, 0x3F ; 63 1cece: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 1ced2: 2b 01 movw r4, r22 1ced4: 3c 01 movw r6, r24 points[0] = bounds[0] + d; 1ced6: ac 01 movw r20, r24 1ced8: 9b 01 movw r18, r22 1ceda: c7 01 movw r24, r14 1cedc: b6 01 movw r22, r12 1cede: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 1cee2: 69 87 std Y+9, r22 ; 0x09 1cee4: 7a 87 std Y+10, r23 ; 0x0a 1cee6: 8b 87 std Y+11, r24 ; 0x0b 1cee8: 9c 87 std Y+12, r25 ; 0x0c points[1] = bounds[1] - d; 1ceea: a3 01 movw r20, r6 1ceec: 92 01 movw r18, r4 1ceee: c5 01 movw r24, r10 1cef0: b4 01 movw r22, r8 1cef2: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 1cef6: 6d 87 std Y+13, r22 ; 0x0d 1cef8: 7e 87 std Y+14, r23 ; 0x0e 1cefa: 8f 87 std Y+15, r24 ; 0x0f 1cefc: 98 8b std Y+16, r25 ; 0x10 float c1 = cost_fn(samples, var, points[0], fan_pwm, ambient); float c2 = cost_fn(samples, var, points[1], fan_pwm, ambient); bool dir = (c2 < c1); bounds[dir] = points[!dir]; update_section(points, bounds); float x = points[!dir]; 1cefe: d8 01 movw r26, r16 1cf00: 18 96 adiw r26, 0x08 ; 8 1cf02: 4c 90 ld r4, X 1cf04: ef 89 ldd r30, Y+23 ; 0x17 1cf06: f8 8d ldd r31, Y+24 ; 0x18 1cf08: 51 80 ldd r5, Z+1 ; 0x01 1cf0a: 62 80 ldd r6, Z+2 ; 0x02 1cf0c: 73 80 ldd r7, Z+3 ; 0x03 e = (1-GOLDEN_RATIO) * fabsf((bounds[0]-bounds[1]) / x); 1cf0e: a5 01 movw r20, r10 1cf10: 94 01 movw r18, r8 1cf12: c7 01 movw r24, r14 1cf14: b6 01 movw r22, r12 1cf16: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 1cf1a: 24 2d mov r18, r4 1cf1c: 35 2d mov r19, r5 1cf1e: 46 2d mov r20, r6 1cf20: 57 2d mov r21, r7 1cf22: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 1cf26: 9f 77 andi r25, 0x7F ; 127 1cf28: 2c e0 ldi r18, 0x0C ; 12 1cf2a: 31 e9 ldi r19, 0x91 ; 145 1cf2c: 43 ec ldi r20, 0xC3 ; 195 1cf2e: 5e e3 ldi r21, 0x3E ; 62 1cf30: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 1cf34: 6b 01 movw r12, r22 1cf36: 7c 01 movw r14, r24 1cf38: 5b 01 movw r10, r22 1cf3a: 8c 01 movw r16, r24 printf_P(PSTR("TM iter:%u v:%.2f e:%.3f\n"), it, x, e); 1cf3c: ff 92 push r15 1cf3e: 8f 93 push r24 1cf40: df 92 push r13 1cf42: 6f 93 push r22 1cf44: 7f 92 push r7 1cf46: 6f 92 push r6 1cf48: 5f 92 push r5 1cf4a: 4f 92 push r4 1cf4c: 3f 92 push r3 1cf4e: 2f 92 push r2 1cf50: 25 e1 ldi r18, 0x15 ; 21 1cf52: 3f e8 ldi r19, 0x8F ; 143 1cf54: 3f 93 push r19 1cf56: 2f 93 push r18 1cf58: 0f 94 99 da call 0x3b532 ; 0x3b532 if(e < thr) { 1cf5c: 0f b6 in r0, 0x3f ; 63 1cf5e: f8 94 cli 1cf60: de bf out 0x3e, r29 ; 62 1cf62: 0f be out 0x3f, r0 ; 63 1cf64: cd bf out 0x3d, r28 ; 61 1cf66: 2a e0 ldi r18, 0x0A ; 10 1cf68: 37 ed ldi r19, 0xD7 ; 215 1cf6a: 43 e2 ldi r20, 0x23 ; 35 1cf6c: 5c e3 ldi r21, 0x3C ; 60 1cf6e: 6c 2d mov r22, r12 1cf70: 7d 2d mov r23, r13 1cf72: 8e 2d mov r24, r14 1cf74: 9f 2d mov r25, r15 1cf76: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 1cf7a: 87 ff sbrs r24, 7 1cf7c: 42 c0 rjmp .+132 ; 0x1d002 if(x == min || x == max) { 1cf7e: 20 e0 ldi r18, 0x00 ; 0 1cf80: 30 e0 ldi r19, 0x00 ; 0 1cf82: 40 ea ldi r20, 0xA0 ; 160 1cf84: 50 e4 ldi r21, 0x40 ; 64 1cf86: 64 2d mov r22, r4 1cf88: 75 2d mov r23, r5 1cf8a: 86 2d mov r24, r6 1cf8c: 97 2d mov r25, r7 1cf8e: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 1cf92: 88 23 and r24, r24 1cf94: f1 f1 breq .+124 ; 0x1d012 1cf96: 24 2d mov r18, r4 1cf98: 35 2d mov r19, r5 1cf9a: 46 2d mov r20, r6 1cf9c: 57 2d mov r21, r7 1cf9e: 6b 89 ldd r22, Y+19 ; 0x13 1cfa0: 7c 89 ldd r23, Y+20 ; 0x14 1cfa2: 8d 89 ldd r24, Y+21 ; 0x15 1cfa4: 9e 89 ldd r25, Y+22 ; 0x16 1cfa6: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 1cfaa: 88 23 and r24, r24 1cfac: 91 f1 breq .+100 ; 0x1d012 // real value likely outside of the search boundaries break; } *var = x; 1cfae: 84 2d mov r24, r4 1cfb0: 95 2d mov r25, r5 1cfb2: a6 2d mov r26, r6 1cfb4: b7 2d mov r27, r7 1cfb6: e9 89 ldd r30, Y+17 ; 0x11 1cfb8: fa 89 ldd r31, Y+18 ; 0x12 1cfba: 80 83 st Z, r24 1cfbc: 91 83 std Z+1, r25 ; 0x01 1cfbe: a2 83 std Z+2, r26 ; 0x02 1cfc0: b3 83 std Z+3, r27 ; 0x03 thermal_model_reset_enabled(was_enabled); 1cfc2: 89 8d ldd r24, Y+25 ; 0x19 1cfc4: 0f 94 31 32 call 0x26462 ; 0x26462 SERIAL_ECHOLNPGM("TM estimation did not converge"); *var = orig; thermal_model_reset_enabled(was_enabled); return NAN; } 1cfc8: 6a 2d mov r22, r10 1cfca: 7b 2d mov r23, r11 1cfcc: 80 2f mov r24, r16 1cfce: 91 2f mov r25, r17 1cfd0: a4 96 adiw r28, 0x24 ; 36 1cfd2: 0f b6 in r0, 0x3f ; 63 1cfd4: f8 94 cli 1cfd6: de bf out 0x3e, r29 ; 62 1cfd8: 0f be out 0x3f, r0 ; 63 1cfda: cd bf out 0x3d, r28 ; 61 1cfdc: df 91 pop r29 1cfde: cf 91 pop r28 1cfe0: 1f 91 pop r17 1cfe2: 0f 91 pop r16 1cfe4: ff 90 pop r15 1cfe6: ef 90 pop r14 1cfe8: df 90 pop r13 1cfea: cf 90 pop r12 1cfec: bf 90 pop r11 1cfee: af 90 pop r10 1cff0: 9f 90 pop r9 1cff2: 8f 90 pop r8 1cff4: 7f 90 pop r7 1cff6: 6f 90 pop r6 1cff8: 5f 90 pop r5 1cffa: 4f 90 pop r4 1cffc: 3f 90 pop r3 1cffe: 2f 90 pop r2 1d000: 08 95 ret 1d002: ff ef ldi r31, 0xFF ; 255 1d004: 2f 1a sub r2, r31 1d006: 3f 0a sbc r3, r31 float e = NAN; float points[2]; float bounds[2] = {min, max}; update_section(points, bounds); for(uint8_t it = 0; it != max_itr; ++it) { 1d008: 2e e1 ldi r18, 0x1E ; 30 1d00a: 22 16 cp r2, r18 1d00c: 31 04 cpc r3, r1 1d00e: 09 f0 breq .+2 ; 0x1d012 1d010: f9 ce rjmp .-526 ; 0x1ce04 thermal_model_reset_enabled(was_enabled); return e; } } SERIAL_ECHOLNPGM("TM estimation did not converge"); 1d012: 86 ef ldi r24, 0xF6 ; 246 1d014: 9e e8 ldi r25, 0x8E ; 142 1d016: 0e 94 93 79 call 0xf326 ; 0xf326 *var = orig; 1d01a: 89 a1 ldd r24, Y+33 ; 0x21 1d01c: 9a a1 ldd r25, Y+34 ; 0x22 1d01e: ab a1 ldd r26, Y+35 ; 0x23 1d020: bc a1 ldd r27, Y+36 ; 0x24 1d022: e9 89 ldd r30, Y+17 ; 0x11 1d024: fa 89 ldd r31, Y+18 ; 0x12 1d026: 80 83 st Z, r24 1d028: 91 83 std Z+1, r25 ; 0x01 1d02a: a2 83 std Z+2, r26 ; 0x02 1d02c: b3 83 std Z+3, r27 ; 0x03 thermal_model_reset_enabled(was_enabled); 1d02e: 89 8d ldd r24, Y+25 ; 0x19 1d030: 0f 94 31 32 call 0x26462 ; 0x26462 return NAN; 1d034: a1 2c mov r10, r1 1d036: b1 2c mov r11, r1 1d038: 00 ec ldi r16, 0xC0 ; 192 1d03a: 1f e7 ldi r17, 0x7F ; 127 1d03c: c5 cf rjmp .-118 ; 0x1cfc8 0001d03e : // Update cached value lastReadRegisterValue = logic.rsp.paramValue; return true; } bool __attribute__((noinline)) MMU2::WriteRegister(uint8_t address, uint16_t data) { 1d03e: ef 92 push r14 1d040: ff 92 push r15 1d042: 0f 93 push r16 1d044: 1f 93 push r17 1d046: cf 93 push r28 1d048: df 93 push r29 1d04a: 00 d0 rcall .+0 ; 0x1d04c 1d04c: 1f 92 push r1 1d04e: 1f 92 push r1 1d050: cd b7 in r28, 0x3d ; 61 1d052: de b7 in r29, 0x3e ; 62 1d054: 08 2f mov r16, r24 1d056: 16 2f mov r17, r22 1d058: f7 2e mov r15, r23 if (!WaitForMMUReady()) { 1d05a: 0f 94 3f 88 call 0x3107e ; 0x3107e 1d05e: 88 23 and r24, r24 1d060: d9 f0 breq .+54 ; 0x1d098 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) { 1d062: 0b 30 cpi r16, 0x0B ; 11 1d064: 29 f1 breq .+74 ; 0x1d0b0 1d066: 04 31 cpi r16, 0x14 ; 20 1d068: 31 f1 breq .+76 ; 0x1d0b6 /// @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()) { 1d06a: 87 e5 ldi r24, 0x57 ; 87 1d06c: e8 2e mov r14, r24 1d06e: e9 82 std Y+1, r14 ; 0x01 1d070: 0a 83 std Y+2, r16 ; 0x02 1d072: 1b 83 std Y+3, r17 ; 0x03 1d074: fc 82 std Y+4, r15 ; 0x04 1d076: ce 01 movw r24, r28 1d078: 01 96 adiw r24, 0x01 ; 1 1d07a: 0f 94 24 c5 call 0x38a48 ; 0x38a48 1d07e: 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)); 1d080: 47 e5 ldi r20, 0x57 ; 87 1d082: 50 2f mov r21, r16 1d084: 61 2f mov r22, r17 1d086: 7f 2d mov r23, r15 1d088: 0f 94 0d a5 call 0x34a1a ; 0x34a1a 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)); 1d08c: 60 e0 ldi r22, 0x00 ; 0 1d08e: 80 e0 ldi r24, 0x00 ; 0 1d090: 0f 94 31 ac call 0x35862 ; 0x35862 1d094: 88 23 and r24, r24 1d096: 59 f3 breq .-42 ; 0x1d06e return true; } 1d098: 0f 90 pop r0 1d09a: 0f 90 pop r0 1d09c: 0f 90 pop r0 1d09e: 0f 90 pop r0 1d0a0: 0f 90 pop r0 1d0a2: df 91 pop r29 1d0a4: cf 91 pop r28 1d0a6: 1f 91 pop r17 1d0a8: 0f 91 pop r16 1d0aa: ff 90 pop r15 1d0ac: ef 90 pop r14 1d0ae: 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); 1d0b0: 10 93 96 13 sts 0x1396, r17 ; 0x801396 1d0b4: da cf rjmp .-76 ; 0x1d06a break; case (uint8_t)Register::Pulley_Slow_Feedrate: logic.PlanPulleySlowFeedRate(data); 1d0b6: 10 93 97 13 sts 0x1397, r17 ; 0x801397 1d0ba: d7 cf rjmp .-82 ; 0x1d06a 0001d0bc : #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) 1d0bc: 82 30 cpi r24, 0x02 ; 2 1d0be: 91 05 cpc r25, r1 1d0c0: 38 f0 brcs .+14 ; 0x1d0d0 // 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 1d0c2: 88 0f add r24, r24 1d0c4: 99 1f adc r25, r25 1d0c6: 88 0f add r24, r24 1d0c8: 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, 1d0ca: 05 97 sbiw r24, 0x05 ; 5 #endif // busy wait __asm__ __volatile__ ( 1d0cc: 01 97 sbiw r24, 0x01 ; 1 1d0ce: f1 f7 brne .-4 ; 0x1d0cc "1: sbiw %0,1" "\n\t" // 2 cycles "brne 1b" : "=w" (us) : "0" (us) // 2 cycles ); // return = 4 cycles } 1d0d0: 08 95 ret 0001d0d2 : SREG = oldSREG; } int digitalRead(uint8_t pin) { 1d0d2: cf 93 push r28 1d0d4: df 93 push r29 uint8_t timer = digitalPinToTimer(pin); 1d0d6: 28 2f mov r18, r24 1d0d8: 30 e0 ldi r19, 0x00 ; 0 1d0da: f9 01 movw r30, r18 1d0dc: e9 5d subi r30, 0xD9 ; 217 1d0de: f2 47 sbci r31, 0x72 ; 114 1d0e0: 84 91 lpm r24, Z uint8_t bit = digitalPinToBitMask(pin); 1d0e2: f9 01 movw r30, r18 1d0e4: ef 52 subi r30, 0x2F ; 47 1d0e6: f3 47 sbci r31, 0x73 ; 115 1d0e8: d4 91 lpm r29, Z uint8_t port = digitalPinToPort(pin); 1d0ea: f9 01 movw r30, r18 1d0ec: e5 58 subi r30, 0x85 ; 133 1d0ee: f3 47 sbci r31, 0x73 ; 115 1d0f0: c4 91 lpm r28, Z if (port == NOT_A_PIN) return LOW; 1d0f2: cc 23 and r28, r28 1d0f4: a1 f0 breq .+40 ; 0x1d11e // 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); 1d0f6: 81 11 cpse r24, r1 1d0f8: 0e 94 cd cc call 0x1999a ; 0x1999a if (*portInputRegister(port) & bit) return HIGH; 1d0fc: ec 2f mov r30, r28 1d0fe: f0 e0 ldi r31, 0x00 ; 0 1d100: ee 0f add r30, r30 1d102: ff 1f adc r31, r31 1d104: ef 59 subi r30, 0x9F ; 159 1d106: f3 47 sbci r31, 0x73 ; 115 1d108: a5 91 lpm r26, Z+ 1d10a: b4 91 lpm r27, Z 1d10c: ec 91 ld r30, X 1d10e: ed 23 and r30, r29 1d110: 81 e0 ldi r24, 0x01 ; 1 1d112: 90 e0 ldi r25, 0x00 ; 0 1d114: 09 f4 brne .+2 ; 0x1d118 1d116: 80 e0 ldi r24, 0x00 ; 0 return LOW; } 1d118: df 91 pop r29 1d11a: cf 91 pop r28 1d11c: 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; 1d11e: 80 e0 ldi r24, 0x00 ; 0 1d120: 90 e0 ldi r25, 0x00 ; 0 1d122: fa cf rjmp .-12 ; 0x1d118 0001d124 : #endif } } void digitalWrite(uint8_t pin, uint8_t val) { 1d124: 1f 93 push r17 1d126: cf 93 push r28 1d128: df 93 push r29 uint8_t timer = digitalPinToTimer(pin); 1d12a: 28 2f mov r18, r24 1d12c: 30 e0 ldi r19, 0x00 ; 0 1d12e: f9 01 movw r30, r18 1d130: e9 5d subi r30, 0xD9 ; 217 1d132: f2 47 sbci r31, 0x72 ; 114 1d134: 84 91 lpm r24, Z uint8_t bit = digitalPinToBitMask(pin); 1d136: f9 01 movw r30, r18 1d138: ef 52 subi r30, 0x2F ; 47 1d13a: f3 47 sbci r31, 0x73 ; 115 1d13c: d4 91 lpm r29, Z uint8_t port = digitalPinToPort(pin); 1d13e: f9 01 movw r30, r18 1d140: e5 58 subi r30, 0x85 ; 133 1d142: f3 47 sbci r31, 0x73 ; 115 1d144: c4 91 lpm r28, Z volatile uint8_t *out; if (port == NOT_A_PIN) return; 1d146: cc 23 and r28, r28 1d148: a9 f0 breq .+42 ; 0x1d174 1d14a: 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); 1d14c: 81 11 cpse r24, r1 1d14e: 0e 94 cd cc call 0x1999a ; 0x1999a out = portOutputRegister(port); 1d152: ec 2f mov r30, r28 1d154: f0 e0 ldi r31, 0x00 ; 0 1d156: ee 0f add r30, r30 1d158: ff 1f adc r31, r31 1d15a: e9 5b subi r30, 0xB9 ; 185 1d15c: f3 47 sbci r31, 0x73 ; 115 1d15e: a5 91 lpm r26, Z+ 1d160: b4 91 lpm r27, Z uint8_t oldSREG = SREG; 1d162: 8f b7 in r24, 0x3f ; 63 cli(); 1d164: f8 94 cli if (val == LOW) { *out &= ~bit; 1d166: ec 91 ld r30, X out = portOutputRegister(port); uint8_t oldSREG = SREG; cli(); if (val == LOW) { 1d168: 11 11 cpse r17, r1 1d16a: 08 c0 rjmp .+16 ; 0x1d17c *out &= ~bit; 1d16c: d0 95 com r29 1d16e: de 23 and r29, r30 } else { *out |= bit; 1d170: dc 93 st X, r29 } SREG = oldSREG; 1d172: 8f bf out 0x3f, r24 ; 63 } 1d174: df 91 pop r29 1d176: cf 91 pop r28 1d178: 1f 91 pop r17 1d17a: 08 95 ret cli(); if (val == LOW) { *out &= ~bit; } else { *out |= bit; 1d17c: de 2b or r29, r30 1d17e: f8 cf rjmp .-16 ; 0x1d170 0001d180 : #define ARDUINO_MAIN #include "wiring_private.h" #include "pins_arduino.h" void pinMode(uint8_t pin, uint8_t mode) { 1d180: cf 93 push r28 1d182: df 93 push r29 uint8_t bit = digitalPinToBitMask(pin); 1d184: 90 e0 ldi r25, 0x00 ; 0 1d186: fc 01 movw r30, r24 1d188: ef 52 subi r30, 0x2F ; 47 1d18a: f3 47 sbci r31, 0x73 ; 115 1d18c: 24 91 lpm r18, Z uint8_t port = digitalPinToPort(pin); 1d18e: 85 58 subi r24, 0x85 ; 133 1d190: 93 47 sbci r25, 0x73 ; 115 1d192: fc 01 movw r30, r24 1d194: 84 91 lpm r24, Z volatile uint8_t *reg, *out; if (port == NOT_A_PIN) return; 1d196: 88 23 and r24, r24 1d198: d1 f0 breq .+52 ; 0x1d1ce // JWS: can I let the optimizer do this? reg = portModeRegister(port); 1d19a: 90 e0 ldi r25, 0x00 ; 0 1d19c: 88 0f add r24, r24 1d19e: 99 1f adc r25, r25 1d1a0: fc 01 movw r30, r24 1d1a2: e3 5d subi r30, 0xD3 ; 211 1d1a4: f3 47 sbci r31, 0x73 ; 115 1d1a6: a5 91 lpm r26, Z+ 1d1a8: b4 91 lpm r27, Z out = portOutputRegister(port); 1d1aa: fc 01 movw r30, r24 1d1ac: e9 5b subi r30, 0xB9 ; 185 1d1ae: f3 47 sbci r31, 0x73 ; 115 1d1b0: c5 91 lpm r28, Z+ 1d1b2: d4 91 lpm r29, Z if (mode == INPUT) { 1d1b4: 61 11 cpse r22, r1 1d1b6: 0e c0 rjmp .+28 ; 0x1d1d4 uint8_t oldSREG = SREG; 1d1b8: 9f b7 in r25, 0x3f ; 63 cli(); 1d1ba: f8 94 cli *reg &= ~bit; 1d1bc: 8c 91 ld r24, X 1d1be: e2 2f mov r30, r18 1d1c0: e0 95 com r30 1d1c2: 8e 23 and r24, r30 1d1c4: 8c 93 st X, r24 *out &= ~bit; 1d1c6: 28 81 ld r18, Y 1d1c8: e2 23 and r30, r18 1d1ca: e8 83 st Y, r30 SREG = oldSREG; 1d1cc: 9f bf out 0x3f, r25 ; 63 uint8_t oldSREG = SREG; cli(); *reg |= bit; SREG = oldSREG; } } 1d1ce: df 91 pop r29 1d1d0: cf 91 pop r28 1d1d2: 08 95 ret cli(); *reg &= ~bit; *out |= bit; SREG = oldSREG; } else { uint8_t oldSREG = SREG; 1d1d4: 8f b7 in r24, 0x3f ; 63 cli(); 1d1d6: f8 94 cli *reg |= bit; 1d1d8: ec 91 ld r30, X 1d1da: e2 2b or r30, r18 1d1dc: ec 93 st X, r30 SREG = oldSREG; 1d1de: 8f bf out 0x3f, r24 ; 63 1d1e0: f6 cf rjmp .-20 ; 0x1d1ce 0001d1e2 : // 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) { 1d1e2: 1f 93 push r17 1d1e4: cf 93 push r28 1d1e6: df 93 push r29 1d1e8: 18 2f mov r17, r24 1d1ea: 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); 1d1ec: 61 e0 ldi r22, 0x01 ; 1 1d1ee: 0e 94 c0 e8 call 0x1d180 ; 0x1d180 if (val == 0) 1d1f2: 20 97 sbiw r28, 0x00 ; 0 1d1f4: 39 f4 brne .+14 ; 0x1d204 { digitalWrite(pin, LOW); 1d1f6: 60 e0 ldi r22, 0x00 ; 0 } else if (val == 255) { digitalWrite(pin, HIGH); 1d1f8: 81 2f mov r24, r17 } else { digitalWrite(pin, HIGH); } } } } 1d1fa: df 91 pop r29 1d1fc: cf 91 pop r28 1d1fe: 1f 91 pop r17 { digitalWrite(pin, LOW); } else if (val == 255) { digitalWrite(pin, HIGH); 1d200: 0c 94 92 e8 jmp 0x1d124 ; 0x1d124 pinMode(pin, OUTPUT); if (val == 0) { digitalWrite(pin, LOW); } else if (val == 255) 1d204: cf 3f cpi r28, 0xFF ; 255 1d206: d1 05 cpc r29, r1 1d208: 11 f4 brne .+4 ; 0x1d20e { digitalWrite(pin, HIGH); 1d20a: 61 e0 ldi r22, 0x01 ; 1 1d20c: f5 cf rjmp .-22 ; 0x1d1f8 } else { switch(digitalPinToTimer(pin)) 1d20e: e1 2f mov r30, r17 1d210: f0 e0 ldi r31, 0x00 ; 0 1d212: e9 5d subi r30, 0xD9 ; 217 1d214: f2 47 sbci r31, 0x72 ; 114 1d216: e4 91 lpm r30, Z 1d218: e1 50 subi r30, 0x01 ; 1 1d21a: e2 31 cpi r30, 0x12 ; 18 1d21c: 08 f0 brcs .+2 ; 0x1d220 1d21e: b3 c0 rjmp .+358 ; 0x1d386 1d220: f0 e0 ldi r31, 0x00 ; 0 1d222: 88 27 eor r24, r24 1d224: e9 5e subi r30, 0xE9 ; 233 1d226: f6 41 sbci r31, 0x16 ; 22 1d228: 8f 4f sbci r24, 0xFF ; 255 1d22a: 0d 94 e7 dc jmp 0x3b9ce ; 0x3b9ce <__tablejump2__> 1d22e: 29 e9 ldi r18, 0x99 ; 153 1d230: 31 e9 ldi r19, 0x91 ; 145 1d232: 36 e9 ldi r19, 0x96 ; 150 1d234: 40 e9 ldi r20, 0x90 ; 144 1d236: 4a e9 ldi r20, 0x9A ; 154 1d238: c3 e9 ldi r28, 0x93 ; 147 1d23a: 54 e9 ldi r21, 0x94 ; 148 1d23c: 5c e9 ldi r21, 0x9C ; 156 1d23e: 64 e9 ldi r22, 0x94 ; 148 1d240: 6e e9 ldi r22, 0x9E ; 158 1d242: 78 e9 ldi r23, 0x98 ; 152 1d244: 82 e9 ldi r24, 0x92 ; 146 1d246: 91 e9 ldi r25, 0x91 ; 145 1d248: 9b e9 ldi r25, 0x9B ; 155 1d24a: c3 e9 ldi r28, 0x93 ; 147 1d24c: a5 e9 ldi r26, 0x95 ; 149 1d24e: af e9 ldi r26, 0x9F ; 159 1d250: b9 e9 ldi r27, 0x99 ; 153 #endif #if defined(TCCR0A) && defined(COM0A1) case TIMER0A: // connect pwm to pin on timer 0, channel A sbi(TCCR0A, COM0A1); 1d252: 84 b5 in r24, 0x24 ; 36 1d254: 80 68 ori r24, 0x80 ; 128 1d256: 84 bd out 0x24, r24 ; 36 OCR0A = val; // set pwm duty 1d258: c7 bd out 0x27, r28 ; 39 } else { digitalWrite(pin, HIGH); } } } } 1d25a: df 91 pop r29 1d25c: cf 91 pop r28 1d25e: 1f 91 pop r17 1d260: 08 95 ret #endif #if defined(TCCR0A) && defined(COM0B1) case TIMER0B: // connect pwm to pin on timer 0, channel B sbi(TCCR0A, COM0B1); 1d262: 84 b5 in r24, 0x24 ; 36 1d264: 80 62 ori r24, 0x20 ; 32 1d266: 84 bd out 0x24, r24 ; 36 OCR0B = val; // set pwm duty 1d268: c8 bd out 0x28, r28 ; 40 1d26a: f7 cf rjmp .-18 ; 0x1d25a #endif #if defined(TCCR1A) && defined(COM1A1) case TIMER1A: // connect pwm to pin on timer 1, channel A sbi(TCCR1A, COM1A1); 1d26c: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1d270: 80 68 ori r24, 0x80 ; 128 1d272: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1A = val; // set pwm duty 1d276: d0 93 89 00 sts 0x0089, r29 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 1d27a: c0 93 88 00 sts 0x0088, r28 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 1d27e: ed cf rjmp .-38 ; 0x1d25a #endif #if defined(TCCR1A) && defined(COM1B1) case TIMER1B: // connect pwm to pin on timer 1, channel B sbi(TCCR1A, COM1B1); 1d280: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1d284: 80 62 ori r24, 0x20 ; 32 1d286: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1B = val; // set pwm duty 1d28a: d0 93 8b 00 sts 0x008B, r29 ; 0x80008b <__TEXT_REGION_LENGTH__+0x7c208b> 1d28e: c0 93 8a 00 sts 0x008A, r28 ; 0x80008a <__TEXT_REGION_LENGTH__+0x7c208a> 1d292: e3 cf rjmp .-58 ; 0x1d25a #endif #if defined(TCCR1A) && defined(COM1C1) case TIMER1C: // connect pwm to pin on timer 1, channel C sbi(TCCR1A, COM1C1); 1d294: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1d298: 88 60 ori r24, 0x08 ; 8 1d29a: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1C = val; // set pwm duty 1d29e: d0 93 8d 00 sts 0x008D, r29 ; 0x80008d <__TEXT_REGION_LENGTH__+0x7c208d> 1d2a2: c0 93 8c 00 sts 0x008C, r28 ; 0x80008c <__TEXT_REGION_LENGTH__+0x7c208c> 1d2a6: d9 cf rjmp .-78 ; 0x1d25a #endif #if defined(TCCR2A) && defined(COM2A1) case TIMER2A: // connect pwm to pin on timer 2, channel A sbi(TCCR2A, COM2A1); 1d2a8: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1d2ac: 80 68 ori r24, 0x80 ; 128 1d2ae: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> OCR2A = val; // set pwm duty 1d2b2: c0 93 b3 00 sts 0x00B3, r28 ; 0x8000b3 <__TEXT_REGION_LENGTH__+0x7c20b3> 1d2b6: d1 cf rjmp .-94 ; 0x1d25a #endif #if defined(TCCR2A) && defined(COM2B1) case TIMER2B: // connect pwm to pin on timer 2, channel B sbi(TCCR2A, COM2B1); 1d2b8: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1d2bc: 80 62 ori r24, 0x20 ; 32 1d2be: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> OCR2B = val; // set pwm duty 1d2c2: c0 93 b4 00 sts 0x00B4, r28 ; 0x8000b4 <__TEXT_REGION_LENGTH__+0x7c20b4> 1d2c6: c9 cf rjmp .-110 ; 0x1d25a #endif #if defined(TCCR3A) && defined(COM3A1) case TIMER3A: // connect pwm to pin on timer 3, channel A sbi(TCCR3A, COM3A1); 1d2c8: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1d2cc: 80 68 ori r24, 0x80 ; 128 1d2ce: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3A = val; // set pwm duty 1d2d2: d0 93 99 00 sts 0x0099, r29 ; 0x800099 <__TEXT_REGION_LENGTH__+0x7c2099> 1d2d6: c0 93 98 00 sts 0x0098, r28 ; 0x800098 <__TEXT_REGION_LENGTH__+0x7c2098> 1d2da: bf cf rjmp .-130 ; 0x1d25a #endif #if defined(TCCR3A) && defined(COM3B1) case TIMER3B: // connect pwm to pin on timer 3, channel B sbi(TCCR3A, COM3B1); 1d2dc: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1d2e0: 80 62 ori r24, 0x20 ; 32 1d2e2: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3B = val; // set pwm duty 1d2e6: d0 93 9b 00 sts 0x009B, r29 ; 0x80009b <__TEXT_REGION_LENGTH__+0x7c209b> 1d2ea: c0 93 9a 00 sts 0x009A, r28 ; 0x80009a <__TEXT_REGION_LENGTH__+0x7c209a> 1d2ee: b5 cf rjmp .-150 ; 0x1d25a #endif #if defined(TCCR3A) && defined(COM3C1) case TIMER3C: // connect pwm to pin on timer 3, channel C sbi(TCCR3A, COM3C1); 1d2f0: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1d2f4: 88 60 ori r24, 0x08 ; 8 1d2f6: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3C = val; // set pwm duty 1d2fa: d0 93 9d 00 sts 0x009D, r29 ; 0x80009d <__TEXT_REGION_LENGTH__+0x7c209d> 1d2fe: c0 93 9c 00 sts 0x009C, r28 ; 0x80009c <__TEXT_REGION_LENGTH__+0x7c209c> 1d302: ab cf rjmp .-170 ; 0x1d25a #endif #if defined(TCCR4A) case TIMER4A: //connect pwm to pin on timer 4, channel A sbi(TCCR4A, COM4A1); 1d304: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1d308: 80 68 ori r24, 0x80 ; 128 1d30a: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> #if defined(COM4A0) // only used on 32U4 cbi(TCCR4A, COM4A0); 1d30e: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1d312: 8f 7b andi r24, 0xBF ; 191 1d314: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> #endif OCR4A = val; // set pwm duty 1d318: d0 93 a9 00 sts 0x00A9, r29 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 1d31c: c0 93 a8 00 sts 0x00A8, r28 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 1d320: 9c cf rjmp .-200 ; 0x1d25a #endif #if defined(TCCR4A) && defined(COM4B1) case TIMER4B: // connect pwm to pin on timer 4, channel B sbi(TCCR4A, COM4B1); 1d322: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1d326: 80 62 ori r24, 0x20 ; 32 1d328: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4B = val; // set pwm duty 1d32c: d0 93 ab 00 sts 0x00AB, r29 ; 0x8000ab <__TEXT_REGION_LENGTH__+0x7c20ab> 1d330: c0 93 aa 00 sts 0x00AA, r28 ; 0x8000aa <__TEXT_REGION_LENGTH__+0x7c20aa> 1d334: 92 cf rjmp .-220 ; 0x1d25a #endif #if defined(TCCR4A) && defined(COM4C1) case TIMER4C: // connect pwm to pin on timer 4, channel C sbi(TCCR4A, COM4C1); 1d336: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1d33a: 88 60 ori r24, 0x08 ; 8 1d33c: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = val; // set pwm duty 1d340: d0 93 ad 00 sts 0x00AD, r29 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 1d344: c0 93 ac 00 sts 0x00AC, r28 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 1d348: 88 cf rjmp .-240 ; 0x1d25a #if defined(TCCR5A) && defined(COM5A1) case TIMER5A: // connect pwm to pin on timer 5, channel A sbi(TCCR5A, COM5A1); 1d34a: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1d34e: 80 68 ori r24, 0x80 ; 128 1d350: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5A = val; // set pwm duty 1d354: d0 93 29 01 sts 0x0129, r29 ; 0x800129 <__TEXT_REGION_LENGTH__+0x7c2129> 1d358: c0 93 28 01 sts 0x0128, r28 ; 0x800128 <__TEXT_REGION_LENGTH__+0x7c2128> 1d35c: 7e cf rjmp .-260 ; 0x1d25a #endif #if defined(TCCR5A) && defined(COM5B1) case TIMER5B: // connect pwm to pin on timer 5, channel B sbi(TCCR5A, COM5B1); 1d35e: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1d362: 80 62 ori r24, 0x20 ; 32 1d364: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5B = val; // set pwm duty 1d368: d0 93 2b 01 sts 0x012B, r29 ; 0x80012b <__TEXT_REGION_LENGTH__+0x7c212b> 1d36c: c0 93 2a 01 sts 0x012A, r28 ; 0x80012a <__TEXT_REGION_LENGTH__+0x7c212a> 1d370: 74 cf rjmp .-280 ; 0x1d25a #endif #if defined(TCCR5A) && defined(COM5C1) case TIMER5C: // connect pwm to pin on timer 5, channel C sbi(TCCR5A, COM5C1); 1d372: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1d376: 88 60 ori r24, 0x08 ; 8 1d378: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5C = val; // set pwm duty 1d37c: d0 93 2d 01 sts 0x012D, r29 ; 0x80012d <__TEXT_REGION_LENGTH__+0x7c212d> 1d380: c0 93 2c 01 sts 0x012C, r28 ; 0x80012c <__TEXT_REGION_LENGTH__+0x7c212c> 1d384: 6a cf rjmp .-300 ; 0x1d25a break; #endif case NOT_ON_TIMER: default: if (val < 128) { 1d386: c0 38 cpi r28, 0x80 ; 128 1d388: d1 05 cpc r29, r1 1d38a: 0c f0 brlt .+2 ; 0x1d38e 1d38c: 3e cf rjmp .-388 ; 0x1d20a 1d38e: 33 cf rjmp .-410 ; 0x1d1f6 0001d390 : } } /// 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){ 1d390: 4f 92 push r4 1d392: 5f 92 push r5 1d394: 6f 92 push r6 1d396: 7f 92 push r7 1d398: 8f 92 push r8 1d39a: 9f 92 push r9 1d39c: af 92 push r10 1d39e: bf 92 push r11 1d3a0: cf 92 push r12 1d3a2: df 92 push r13 1d3a4: ef 92 push r14 1d3a6: ff 92 push r15 1d3a8: 0f 93 push r16 1d3aa: 1f 93 push r17 1d3ac: cf 93 push r28 1d3ae: df 93 push r29 void sm4_do_step(uint8_t axes_mask) { #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 1d3b0: 86 b9 out 0x06, r24 ; 6 1d3b2: fa 01 movw r30, r20 1d3b4: e0 80 ld r14, Z 1d3b6: f1 80 ldd r15, Z+1 ; 0x01 sm4_do_step(axes); /// keep max speed (avoid extra computation) if (acc > 0 && delay_us == min_delay_us){ 1d3b8: 16 16 cp r1, r22 1d3ba: 17 06 cpc r1, r23 1d3bc: b4 f4 brge .+44 ; 0x1d3ea 1d3be: e2 16 cp r14, r18 1d3c0: f3 06 cpc r15, r19 1d3c2: 99 f4 brne .+38 ; 0x1d3ea delayMicroseconds(delay_us); 1d3c4: c7 01 movw r24, r14 //DBG(_n("%d "), t1); delayMicroseconds(t1); delay_us = t1; } 1d3c6: df 91 pop r29 1d3c8: cf 91 pop r28 1d3ca: 1f 91 pop r17 1d3cc: 0f 91 pop r16 1d3ce: ff 90 pop r15 1d3d0: ef 90 pop r14 1d3d2: df 90 pop r13 1d3d4: cf 90 pop r12 1d3d6: bf 90 pop r11 1d3d8: af 90 pop r10 1d3da: 9f 90 pop r9 1d3dc: 8f 90 pop r8 1d3de: 7f 90 pop r7 1d3e0: 6f 90 pop r6 1d3e2: 5f 90 pop r5 1d3e4: 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); 1d3e6: 0c 94 5e e8 jmp 0x1d0bc ; 0x1d0bc 1d3ea: 89 01 movw r16, r18 1d3ec: 6a 01 movw r12, r20 1d3ee: eb 01 movw r28, r22 return; } // v1 = v0 + a * t // 0.01 = length of a step const float t0 = delay_us * 0.000001f; 1d3f0: b7 01 movw r22, r14 1d3f2: 90 e0 ldi r25, 0x00 ; 0 1d3f4: 80 e0 ldi r24, 0x00 ; 0 1d3f6: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 1d3fa: 2d eb ldi r18, 0xBD ; 189 1d3fc: 37 e3 ldi r19, 0x37 ; 55 1d3fe: 46 e8 ldi r20, 0x86 ; 134 1d400: 55 e3 ldi r21, 0x35 ; 53 1d402: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 1d406: 4b 01 movw r8, r22 1d408: 5c 01 movw r10, r24 const float v1 = (0.01f / t0 + acc * t0); 1d40a: be 01 movw r22, r28 1d40c: 0d 2e mov r0, r29 1d40e: 00 0c add r0, r0 1d410: 88 0b sbc r24, r24 1d412: 99 0b sbc r25, r25 1d414: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 1d418: a5 01 movw r20, r10 1d41a: 94 01 movw r18, r8 1d41c: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 1d420: 2b 01 movw r4, r22 1d422: 3c 01 movw r6, r24 1d424: a5 01 movw r20, r10 1d426: 94 01 movw r18, r8 1d428: 6a e0 ldi r22, 0x0A ; 10 1d42a: 77 ed ldi r23, 0xD7 ; 215 1d42c: 83 e2 ldi r24, 0x23 ; 35 1d42e: 9c e3 ldi r25, 0x3C ; 60 1d430: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 1d434: 9b 01 movw r18, r22 1d436: ac 01 movw r20, r24 1d438: c3 01 movw r24, r6 1d43a: b2 01 movw r22, r4 1d43c: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 1d440: 4b 01 movw r8, r22 1d442: 5c 01 movw r10, r24 uint16_t t1; if (v1 <= 0.16f){ ///< slowest speed convertible to uint16_t delay 1d444: 2a e0 ldi r18, 0x0A ; 10 1d446: 37 ed ldi r19, 0xD7 ; 215 1d448: 43 e2 ldi r20, 0x23 ; 35 1d44a: 5e e3 ldi r21, 0x3E ; 62 1d44c: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 1d450: 18 16 cp r1, r24 1d452: dc f5 brge .+118 ; 0x1d4ca 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)); 1d454: a5 01 movw r20, r10 1d456: 94 01 movw r18, r8 1d458: 6a e0 ldi r22, 0x0A ; 10 1d45a: 77 ed ldi r23, 0xD7 ; 215 1d45c: 83 e2 ldi r24, 0x23 ; 35 1d45e: 9c e3 ldi r25, 0x3C ; 60 1d460: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 1d464: 20 e0 ldi r18, 0x00 ; 0 1d466: 34 e2 ldi r19, 0x24 ; 36 1d468: 44 e7 ldi r20, 0x74 ; 116 1d46a: 59 e4 ldi r21, 0x49 ; 73 1d46c: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__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); 1d470: 20 e0 ldi r18, 0x00 ; 0 1d472: 30 e0 ldi r19, 0x00 ; 0 1d474: 40 e0 ldi r20, 0x00 ; 0 1d476: 5f e3 ldi r21, 0x3F ; 63 1d478: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 1d47c: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 1d480: 5b 01 movw r10, r22 1d482: 60 17 cp r22, r16 1d484: 71 07 cpc r23, r17 1d486: 08 f4 brcc .+2 ; 0x1d48a 1d488: 58 01 movw r10, r16 /// 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){ 1d48a: ea 14 cp r14, r10 1d48c: fb 04 cpc r15, r11 1d48e: 31 f4 brne .+12 ; 0x1d49c 1d490: 20 97 sbiw r28, 0x00 ; 0 1d492: 21 f0 breq .+8 ; 0x1d49c if (acc > 0) 1d494: fc f0 brlt .+62 ; 0x1d4d4 t1--; 1d496: f1 e0 ldi r31, 0x01 ; 1 1d498: af 1a sub r10, r31 1d49a: b1 08 sbc r11, r1 t1++; } //DBG(_n("%d "), t1); delayMicroseconds(t1); 1d49c: c5 01 movw r24, r10 1d49e: 0e 94 5e e8 call 0x1d0bc ; 0x1d0bc delay_us = t1; 1d4a2: f6 01 movw r30, r12 1d4a4: b1 82 std Z+1, r11 ; 0x01 1d4a6: a0 82 st Z, r10 } 1d4a8: df 91 pop r29 1d4aa: cf 91 pop r28 1d4ac: 1f 91 pop r17 1d4ae: 0f 91 pop r16 1d4b0: ff 90 pop r15 1d4b2: ef 90 pop r14 1d4b4: df 90 pop r13 1d4b6: cf 90 pop r12 1d4b8: bf 90 pop r11 1d4ba: af 90 pop r10 1d4bc: 9f 90 pop r9 1d4be: 8f 90 pop r8 1d4c0: 7f 90 pop r7 1d4c2: 6f 90 pop r6 1d4c4: 5f 90 pop r5 1d4c6: 4f 90 pop r4 1d4c8: 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 1d4ca: 80 e1 ldi r24, 0x10 ; 16 1d4cc: a8 2e mov r10, r24 1d4ce: 87 e2 ldi r24, 0x27 ; 39 1d4d0: b8 2e mov r11, r24 1d4d2: db cf rjmp .-74 ; 0x1d48a /// make sure delay has changed a bit at least if (t1 == delay_us && acc != 0){ if (acc > 0) t1--; else t1++; 1d4d4: 8f ef ldi r24, 0xFF ; 255 1d4d6: a8 1a sub r10, r24 1d4d8: b8 0a sbc r11, r24 1d4da: e0 cf rjmp .-64 ; 0x1d49c 0001d4dc : /// 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){ 1d4dc: 2f 92 push r2 1d4de: 3f 92 push r3 1d4e0: 4f 92 push r4 1d4e2: 5f 92 push r5 1d4e4: 6f 92 push r6 1d4e6: 7f 92 push r7 1d4e8: 8f 92 push r8 1d4ea: 9f 92 push r9 1d4ec: af 92 push r10 1d4ee: bf 92 push r11 1d4f0: cf 92 push r12 1d4f2: df 92 push r13 1d4f4: ef 92 push r14 1d4f6: ff 92 push r15 1d4f8: 0f 93 push r16 1d4fa: 1f 93 push r17 1d4fc: cf 93 push r28 1d4fe: df 93 push r29 1d500: 00 d0 rcall .+0 ; 0x1d502 1d502: cd b7 in r28, 0x3d ; 61 1d504: de b7 in r29, 0x3e ; 62 if (steps <= 0 || dec <= 0) 1d506: f9 01 movw r30, r18 1d508: e0 80 ld r14, Z 1d50a: f1 80 ldd r15, Z+1 ; 0x01 1d50c: e1 14 cp r14, r1 1d50e: f1 04 cpc r15, r1 1d510: 09 f4 brne .+2 ; 0x1d514 1d512: 6b c0 rjmp .+214 ; 0x1d5ea 1d514: 16 16 cp r1, r22 1d516: 17 06 cpc r1, r23 1d518: 0c f0 brlt .+2 ; 0x1d51c 1d51a: 67 c0 rjmp .+206 ; 0x1d5ea 1d51c: 19 01 movw r2, r18 1d51e: 5b 83 std Y+3, r21 ; 0x03 1d520: 4a 83 std Y+2, r20 ; 0x02 1d522: 6b 01 movw r12, r22 1d524: 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)); 1d526: fa 01 movw r30, r20 1d528: 00 81 ld r16, Z 1d52a: 11 81 ldd r17, Z+1 ; 0x01 1d52c: b8 01 movw r22, r16 1d52e: 90 e0 ldi r25, 0x00 ; 0 1d530: 80 e0 ldi r24, 0x00 ; 0 1d532: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 1d536: 4b 01 movw r8, r22 1d538: 5c 01 movw r10, r24 1d53a: b6 01 movw r22, r12 1d53c: 0d 2c mov r0, r13 1d53e: 00 0c add r0, r0 1d540: 88 0b sbc r24, r24 1d542: 99 0b sbc r25, r25 1d544: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 1d548: 2b 01 movw r4, r22 1d54a: 3c 01 movw r6, r24 1d54c: a5 01 movw r20, r10 1d54e: 94 01 movw r18, r8 1d550: c5 01 movw r24, r10 1d552: b4 01 movw r22, r8 1d554: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 1d558: 9b 01 movw r18, r22 1d55a: ac 01 movw r20, r24 1d55c: c3 01 movw r24, r6 1d55e: b2 01 movw r22, r4 1d560: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 1d564: 9b 01 movw r18, r22 1d566: ac 01 movw r20, r24 1d568: 6a e0 ldi r22, 0x0A ; 10 1d56a: 77 ed ldi r23, 0xD7 ; 215 1d56c: 83 ea ldi r24, 0xA3 ; 163 1d56e: 9b e3 ldi r25, 0x3B ; 59 1d570: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__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); 1d574: 20 e0 ldi r18, 0x00 ; 0 1d576: 30 e0 ldi r19, 0x00 ; 0 1d578: 40 e0 ldi r20, 0x00 ; 0 1d57a: 5f e3 ldi r21, 0x3F ; 63 1d57c: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 1d580: 0f 94 77 de call 0x3bcee ; 0x3bcee <__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){ 1d584: 6e 15 cp r22, r14 1d586: 7f 05 cpc r23, r15 1d588: 28 f5 brcc .+74 ; 0x1d5d4 1d58a: f9 81 ldd r31, Y+1 ; 0x01 1d58c: f6 b9 out 0x06, r31 ; 6 /// go steady sm4_do_step(axes); delayMicroseconds(delay_us); 1d58e: ea 81 ldd r30, Y+2 ; 0x02 1d590: fb 81 ldd r31, Y+3 ; 0x03 1d592: 80 81 ld r24, Z 1d594: 91 81 ldd r25, Z+1 ; 0x01 1d596: 0e 94 5e e8 call 0x1d0bc ; 0x1d0bc } else { /// decelerate accelerate_1_step(axes, -dec, delay_us, delay_us); } --steps; 1d59a: f1 01 movw r30, r2 1d59c: 80 81 ld r24, Z 1d59e: 91 81 ldd r25, Z+1 ; 0x01 1d5a0: 01 97 sbiw r24, 0x01 ; 1 1d5a2: 91 83 std Z+1, r25 ; 0x01 1d5a4: 80 83 st Z, r24 return true; 1d5a6: 81 e0 ldi r24, 0x01 ; 1 } 1d5a8: 0f 90 pop r0 1d5aa: 0f 90 pop r0 1d5ac: 0f 90 pop r0 1d5ae: df 91 pop r29 1d5b0: cf 91 pop r28 1d5b2: 1f 91 pop r17 1d5b4: 0f 91 pop r16 1d5b6: ff 90 pop r15 1d5b8: ef 90 pop r14 1d5ba: df 90 pop r13 1d5bc: cf 90 pop r12 1d5be: bf 90 pop r11 1d5c0: af 90 pop r10 1d5c2: 9f 90 pop r9 1d5c4: 8f 90 pop r8 1d5c6: 7f 90 pop r7 1d5c8: 6f 90 pop r6 1d5ca: 5f 90 pop r5 1d5cc: 4f 90 pop r4 1d5ce: 3f 90 pop r3 1d5d0: 2f 90 pop r2 1d5d2: 08 95 ret /// go steady sm4_do_step(axes); delayMicroseconds(delay_us); } else { /// decelerate accelerate_1_step(axes, -dec, delay_us, delay_us); 1d5d4: 66 27 eor r22, r22 1d5d6: 77 27 eor r23, r23 1d5d8: 6c 19 sub r22, r12 1d5da: 7d 09 sbc r23, r13 1d5dc: 98 01 movw r18, r16 1d5de: 4a 81 ldd r20, Y+2 ; 0x02 1d5e0: 5b 81 ldd r21, Y+3 ; 0x03 1d5e2: 89 81 ldd r24, Y+1 ; 0x01 1d5e4: 0e 94 c8 e9 call 0x1d390 ; 0x1d390 1d5e8: d8 cf rjmp .-80 ; 0x1d59a /// 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; 1d5ea: 80 e0 ldi r24, 0x00 ; 0 1d5ec: dd cf rjmp .-70 ; 0x1d5a8 0001d5ee : count_position[i] += dir & mask ? -1L : 1L; } } } static void __attribute__((noinline)) set_axes_dir(const uint8_t axis, const uint8_t dir) { 1d5ee: 0f 93 push r16 1d5f0: 1f 93 push r17 1d5f2: cf 93 push r28 1d5f4: df 93 push r29 1d5f6: 18 2f mov r17, r24 1d5f8: 06 2f mov r16, r22 for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i <= Z_AXIS; i++, mask <<= 1) { 1d5fa: d1 e0 ldi r29, 0x01 ; 1 1d5fc: c0 e0 ldi r28, 0x00 ; 0 if (axis & mask) { 1d5fe: 81 2f mov r24, r17 1d600: 8d 23 and r24, r29 1d602: 29 f0 breq .+10 ; 0x1d60e sm4_set_dir(i, dir & mask); 1d604: 60 2f mov r22, r16 1d606: 6d 23 and r22, r29 1d608: 8c 2f mov r24, r28 1d60a: 0f 94 d7 51 call 0x2a3ae ; 0x2a3ae } } } 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) { 1d60e: cf 5f subi r28, 0xFF ; 255 1d610: dd 0f add r29, r29 1d612: c3 30 cpi r28, 0x03 ; 3 1d614: a1 f7 brne .-24 ; 0x1d5fe if (axis & mask) { sm4_set_dir(i, dir & mask); } } } 1d616: df 91 pop r29 1d618: cf 91 pop r28 1d61a: 1f 91 pop r17 1d61c: 0f 91 pop r16 1d61e: 08 95 ret 0001d620 : //@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) { 1d620: 8f 92 push r8 1d622: 9f 92 push r9 1d624: af 92 push r10 1d626: bf 92 push r11 1d628: cf 92 push r12 1d62a: df 92 push r13 1d62c: ef 92 push r14 1d62e: ff 92 push r15 1d630: 30 e0 ldi r19, 0x00 ; 0 1d632: 20 e0 ldi r18, 0x00 ; 0 for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i <= Z_AXIS; i++, mask <<= 1) { 1d634: 91 e0 ldi r25, 0x01 ; 1 if (axis & mask) { 1d636: 48 2f mov r20, r24 1d638: 49 23 and r20, r25 1d63a: 19 f1 breq .+70 ; 0x1d682 count_position[i] += dir & mask ? -1L : 1L; 1d63c: a9 01 movw r20, r18 1d63e: 44 0f add r20, r20 1d640: 55 1f adc r21, r21 1d642: 44 0f add r20, r20 1d644: 55 1f adc r21, r21 1d646: fa 01 movw r30, r20 1d648: ee 54 subi r30, 0x4E ; 78 1d64a: f9 4f sbci r31, 0xF9 ; 249 1d64c: c0 80 ld r12, Z 1d64e: d1 80 ldd r13, Z+1 ; 0x01 1d650: e2 80 ldd r14, Z+2 ; 0x02 1d652: f3 80 ldd r15, Z+3 ; 0x03 1d654: 76 2f mov r23, r22 1d656: 79 23 and r23, r25 1d658: 81 2c mov r8, r1 1d65a: 91 2c mov r9, r1 1d65c: 54 01 movw r10, r8 1d65e: 83 94 inc r8 1d660: 77 23 and r23, r23 1d662: 21 f0 breq .+8 ; 0x1d66c 1d664: 88 24 eor r8, r8 1d666: 8a 94 dec r8 1d668: 98 2c mov r9, r8 1d66a: 54 01 movw r10, r8 1d66c: c8 0c add r12, r8 1d66e: d9 1c adc r13, r9 1d670: ea 1c adc r14, r10 1d672: fb 1c adc r15, r11 1d674: 4e 54 subi r20, 0x4E ; 78 1d676: 59 4f sbci r21, 0xF9 ; 249 1d678: fa 01 movw r30, r20 1d67a: c0 82 st Z, r12 1d67c: d1 82 std Z+1, r13 ; 0x01 1d67e: e2 82 std Z+2, r14 ; 0x02 1d680: 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) { 1d682: 99 0f add r25, r25 1d684: 2f 5f subi r18, 0xFF ; 255 1d686: 3f 4f sbci r19, 0xFF ; 255 1d688: 23 30 cpi r18, 0x03 ; 3 1d68a: 31 05 cpc r19, r1 1d68c: a1 f6 brne .-88 ; 0x1d636 if (axis & mask) { count_position[i] += dir & mask ? -1L : 1L; } } } 1d68e: ff 90 pop r15 1d690: ef 90 pop r14 1d692: df 90 pop r13 1d694: cf 90 pop r12 1d696: bf 90 pop r11 1d698: af 90 pop r10 1d69a: 9f 90 pop r9 1d69c: 8f 90 pop r8 1d69e: 08 95 ret 0001d6a0 : /// 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) { 1d6a0: 2f 92 push r2 1d6a2: 3f 92 push r3 1d6a4: 4f 92 push r4 1d6a6: 5f 92 push r5 1d6a8: 6f 92 push r6 1d6aa: 7f 92 push r7 1d6ac: 8f 92 push r8 1d6ae: 9f 92 push r9 1d6b0: af 92 push r10 1d6b2: bf 92 push r11 1d6b4: cf 92 push r12 1d6b6: df 92 push r13 1d6b8: ef 92 push r14 1d6ba: ff 92 push r15 1d6bc: 0f 93 push r16 1d6be: 1f 93 push r17 1d6c0: cf 93 push r28 1d6c2: df 93 push r29 1d6c4: 00 d0 rcall .+0 ; 0x1d6c6 1d6c6: 00 d0 rcall .+0 ; 0x1d6c8 1d6c8: cd b7 in r28, 0x3d ; 61 1d6ca: 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]; 1d6cc: c0 90 b2 06 lds r12, 0x06B2 ; 0x8006b2 1d6d0: d0 90 b3 06 lds r13, 0x06B3 ; 0x8006b3 1d6d4: e0 90 b4 06 lds r14, 0x06B4 ; 0x8006b4 1d6d8: f0 90 b5 06 lds r15, 0x06B5 ; 0x8006b5 1d6dc: 7c 01 movw r14, r24 1d6de: ec 18 sub r14, r12 1d6e0: fd 08 sbc r15, r13 y -= (int16_t)count_position[1]; 1d6e2: 80 91 b6 06 lds r24, 0x06B6 ; 0x8006b6 1d6e6: 90 91 b7 06 lds r25, 0x06B7 ; 0x8006b7 1d6ea: a0 91 b8 06 lds r26, 0x06B8 ; 0x8006b8 1d6ee: b0 91 b9 06 lds r27, 0x06B9 ; 0x8006b9 1d6f2: 68 1b sub r22, r24 1d6f4: 79 0b sbc r23, r25 z -= (int16_t)count_position[2]; 1d6f6: 80 91 ba 06 lds r24, 0x06BA ; 0x8006ba 1d6fa: 90 91 bb 06 lds r25, 0x06BB ; 0x8006bb 1d6fe: a0 91 bc 06 lds r26, 0x06BC ; 0x8006bc 1d702: b0 91 bd 06 lds r27, 0x06BD ; 0x8006bd 1d706: fa 01 movw r30, r20 1d708: e8 1b sub r30, r24 1d70a: f9 0b sbc r31, r25 1d70c: fa 83 std Y+2, r31 ; 0x02 1d70e: e9 83 std Y+1, r30 ; 0x01 xyzcal_dm = ((x<0)?1:0) | ((y<0)?2:0) | ((z<0)?4:0); 1d710: fb 01 movw r30, r22 1d712: ff 0f add r31, r31 1d714: ee 0b sbc r30, r30 1d716: ff 0f add r31, r31 1d718: fe 2f mov r31, r30 1d71a: ee 1f adc r30, r30 1d71c: e2 70 andi r30, 0x02 ; 2 1d71e: 89 81 ldd r24, Y+1 ; 0x01 1d720: 9a 81 ldd r25, Y+2 ; 0x02 1d722: 88 e0 ldi r24, 0x08 ; 8 1d724: 98 02 muls r25, r24 1d726: 81 2d mov r24, r1 1d728: 99 0b sbc r25, r25 1d72a: 11 24 eor r1, r1 1d72c: 84 70 andi r24, 0x04 ; 4 1d72e: e8 2b or r30, r24 1d730: 8f 2d mov r24, r15 1d732: 88 1f adc r24, r24 1d734: 88 27 eor r24, r24 1d736: 88 1f adc r24, r24 1d738: e8 2b or r30, r24 1d73a: e0 93 fe 03 sts 0x03FE, r30 ; 0x8003fe asm("nop"); } void sm4_set_dir_bits(uint8_t dir_bits) { uint8_t portL = PORTL; 1d73e: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> portL &= 0xb8; //set direction bits to zero 1d742: 98 7b andi r25, 0xB8 ; 184 if (dir_bits & 1) portL |= 2; //set X direction bit if (dir_bits & 2) portL |= 1; //set Y direction bit if (dir_bits & 4) portL |= 4; //set Z direction bit if (dir_bits & 8) portL |= 64; //set E direction bit #elif ((MOTHERBOARD == BOARD_EINSY_1_0a)) dir_bits ^= dir_mask; 1d744: 8a e0 ldi r24, 0x0A ; 10 1d746: e8 27 eor r30, r24 if (dir_bits & 1) portL |= 1; //set X direction bit 1d748: e0 fd sbrc r30, 0 1d74a: 91 60 ori r25, 0x01 ; 1 if (dir_bits & 2) portL |= 2; //set Y direction bit 1d74c: e1 fd sbrc r30, 1 1d74e: 92 60 ori r25, 0x02 ; 2 if (dir_bits & 4) portL |= 4; //set Z direction bit 1d750: e2 fd sbrc r30, 2 1d752: 94 60 ori r25, 0x04 ; 4 if (dir_bits & 8) portL |= 64; //set E direction bit 1d754: 90 64 ori r25, 0x40 ; 64 #endif PORTL = portL; 1d756: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> asm("nop"); 1d75a: 00 00 nop sm4_set_dir_bits(xyzcal_dm); sm4_stop_cb = check_pinda?((check_pinda<0)?check_pinda_0:check_pinda_1):0; 1d75c: 84 e3 ldi r24, 0x34 ; 52 1d75e: 9d ec ldi r25, 0xCD ; 205 1d760: 01 11 cpse r16, r1 1d762: 02 c0 rjmp .+4 ; 0x1d768 1d764: 90 e0 ldi r25, 0x00 ; 0 1d766: 80 e0 ldi r24, 0x00 ; 0 1d768: 90 93 88 06 sts 0x0688, r25 ; 0x800688 1d76c: 80 93 87 06 sts 0x0687, r24 ; 0x800687 xyzcal_sm4_delay = delay_us; 1d770: 30 93 fd 03 sts 0x03FD, r19 ; 0x8003fd 1d774: 20 93 fc 03 sts 0x03FC, r18 ; 0x8003fc // uint32_t u = _micros(); bool ret = sm4_line_xyz_ui(abs(x), abs(y), abs(z)) ? true : false; 1d778: 29 81 ldd r18, Y+1 ; 0x01 1d77a: 3a 81 ldd r19, Y+2 ; 0x02 1d77c: 3e 83 std Y+6, r19 ; 0x06 1d77e: 2d 83 std Y+5, r18 ; 0x05 1d780: 37 ff sbrs r19, 7 1d782: 05 c0 rjmp .+10 ; 0x1d78e 1d784: 31 95 neg r19 1d786: 21 95 neg r18 1d788: 31 09 sbc r19, r1 1d78a: 3e 83 std Y+6, r19 ; 0x06 1d78c: 2d 83 std Y+5, r18 ; 0x05 1d78e: 8b 01 movw r16, r22 1d790: 77 ff sbrs r23, 7 1d792: 03 c0 rjmp .+6 ; 0x1d79a 1d794: 11 95 neg r17 1d796: 01 95 neg r16 1d798: 11 09 sbc r17, r1 1d79a: f7 fe sbrs r15, 7 1d79c: 03 c0 rjmp .+6 ; 0x1d7a4 1d79e: f1 94 neg r15 1d7a0: e1 94 neg r14 1d7a2: 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); 1d7a4: 98 01 movw r18, r16 1d7a6: d8 01 movw r26, r16 1d7a8: 0f 94 ef dc call 0x3b9de ; 0x3b9de <__mulhisi3> 1d7ac: 4b 01 movw r8, r22 1d7ae: 5c 01 movw r10, r24 1d7b0: 2d 81 ldd r18, Y+5 ; 0x05 1d7b2: 3e 81 ldd r19, Y+6 ; 0x06 1d7b4: d9 01 movw r26, r18 1d7b6: 0f 94 ef dc call 0x3b9de ; 0x3b9de <__mulhisi3> 1d7ba: 86 0e add r8, r22 1d7bc: 97 1e adc r9, r23 1d7be: a8 1e adc r10, r24 1d7c0: b9 1e adc r11, r25 1d7c2: 97 01 movw r18, r14 1d7c4: d7 01 movw r26, r14 1d7c6: 0f 94 ef dc call 0x3b9de ; 0x3b9de <__mulhisi3> 1d7ca: 68 0d add r22, r8 1d7cc: 79 1d adc r23, r9 1d7ce: 8a 1d adc r24, r10 1d7d0: 9b 1d adc r25, r11 1d7d2: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 1d7d6: 0f 94 cd e0 call 0x3c19a ; 0x3c19a 1d7da: 20 e0 ldi r18, 0x00 ; 0 1d7dc: 30 e0 ldi r19, 0x00 ; 0 1d7de: 40 e0 ldi r20, 0x00 ; 0 1d7e0: 5f e3 ldi r21, 0x3F ; 63 1d7e2: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 1d7e6: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 1d7ea: 2b 01 movw r4, r22 uint16_t nd = dd; uint16_t cx = dd; uint16_t cy = dd; uint16_t cz = dd; 1d7ec: 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; 1d7ee: 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; 1d7f0: 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; 1d7f2: 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; 1d7f4: 1c 82 std Y+4, r1 ; 0x04 1d7f6: 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; 1d7f8: 31 2c mov r3, r1 1d7fa: 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; 1d7fc: 1a 82 std Y+2, r1 ; 0x02 1d7fe: 19 82 std Y+1, r1 ; 0x01 uint16_t y = 0; uint16_t z = 0; while (nd){ 1d800: 61 14 cp r6, r1 1d802: 71 04 cpc r7, r1 1d804: 09 f4 brne .+2 ; 0x1d808 1d806: 47 c0 rjmp .+142 ; 0x1d896 if (sm4_stop_cb && (*sm4_stop_cb)()) break; 1d808: e0 91 87 06 lds r30, 0x0687 ; 0x800687 1d80c: f0 91 88 06 lds r31, 0x0688 ; 0x800688 1d810: 30 97 sbiw r30, 0x00 ; 0 1d812: e9 f5 brne .+122 ; 0x1d88e uint8_t sm = 0; //step mask 1d814: 80 e0 ldi r24, 0x00 ; 0 if (cx <= dx){ 1d816: ec 14 cp r14, r12 1d818: fd 04 cpc r15, r13 1d81a: 40 f0 brcs .+16 ; 0x1d82c sm |= 1; cx += dd; 1d81c: c4 0c add r12, r4 1d81e: d5 1c adc r13, r5 x++; 1d820: 89 81 ldd r24, Y+1 ; 0x01 1d822: 9a 81 ldd r25, Y+2 ; 0x02 1d824: 01 96 adiw r24, 0x01 ; 1 1d826: 9a 83 std Y+2, r25 ; 0x02 1d828: 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; 1d82a: 81 e0 ldi r24, 0x01 ; 1 cx += dd; x++; } if (cy <= dy){ 1d82c: 0a 15 cp r16, r10 1d82e: 1b 05 cpc r17, r11 1d830: 30 f0 brcs .+12 ; 0x1d83e sm |= 2; 1d832: 82 60 ori r24, 0x02 ; 2 cy += dd; 1d834: a4 0c add r10, r4 1d836: b5 1c adc r11, r5 y++; 1d838: 9f ef ldi r25, 0xFF ; 255 1d83a: 29 1a sub r2, r25 1d83c: 39 0a sbc r3, r25 } if (cz <= dz){ 1d83e: ed 81 ldd r30, Y+5 ; 0x05 1d840: fe 81 ldd r31, Y+6 ; 0x06 1d842: e8 15 cp r30, r8 1d844: f9 05 cpc r31, r9 1d846: 48 f0 brcs .+18 ; 0x1d85a sm |= 4; 1d848: 84 60 ori r24, 0x04 ; 4 cz += dd; 1d84a: 84 0c add r8, r4 1d84c: 95 1c adc r9, r5 z++; 1d84e: 2b 81 ldd r18, Y+3 ; 0x03 1d850: 3c 81 ldd r19, Y+4 ; 0x04 1d852: 2f 5f subi r18, 0xFF ; 255 1d854: 3f 4f sbci r19, 0xFF ; 255 1d856: 3c 83 std Y+4, r19 ; 0x04 1d858: 2b 83 std Y+3, r18 ; 0x03 } cx -= dx; 1d85a: ce 18 sub r12, r14 1d85c: df 08 sbc r13, r15 cy -= dy; 1d85e: a0 1a sub r10, r16 1d860: b1 0a sbc r11, r17 cz -= dz; 1d862: ed 81 ldd r30, Y+5 ; 0x05 1d864: fe 81 ldd r31, Y+6 ; 0x06 1d866: 8e 1a sub r8, r30 1d868: 9f 0a sbc r9, r31 void sm4_do_step(uint8_t axes_mask) { #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 1d86a: 86 b9 out 0x06, r24 ; 6 cx -= dx; cy -= dy; cz -= dz; sm4_do_step(sm); uint16_t delay = SM4_DEFDELAY; if (sm4_calc_delay_cb) delay = (*sm4_calc_delay_cb)(nd, dd); 1d86c: e0 91 83 06 lds r30, 0x0683 ; 0x800683 1d870: f0 91 84 06 lds r31, 0x0684 ; 0x800684 1d874: 30 97 sbiw r30, 0x00 ; 0 1d876: d1 f1 breq .+116 ; 0x1d8ec 1d878: b2 01 movw r22, r4 1d87a: c3 01 movw r24, r6 1d87c: 19 95 eicall if (delay) delayMicroseconds(delay); 1d87e: 00 97 sbiw r24, 0x00 ; 0 1d880: 11 f0 breq .+4 ; 0x1d886 1d882: 0e 94 5e e8 call 0x1d0bc ; 0x1d0bc nd--; 1d886: f1 e0 ldi r31, 0x01 ; 1 1d888: 6f 1a sub r6, r31 1d88a: 71 08 sbc r7, r1 1d88c: b9 cf rjmp .-142 ; 0x1d800 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; 1d88e: 19 95 eicall 1d890: 88 23 and r24, r24 1d892: 09 f4 brne .+2 ; 0x1d896 1d894: bf cf rjmp .-130 ; 0x1d814 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) 1d896: e0 91 85 06 lds r30, 0x0685 ; 0x800685 1d89a: f0 91 86 06 lds r31, 0x0686 ; 0x800686 1d89e: 30 97 sbiw r30, 0x00 ; 0 1d8a0: 41 f0 breq .+16 ; 0x1d8b2 (*sm4_update_pos_cb)(x, y, z, 0); 1d8a2: 30 e0 ldi r19, 0x00 ; 0 1d8a4: 20 e0 ldi r18, 0x00 ; 0 1d8a6: 4b 81 ldd r20, Y+3 ; 0x03 1d8a8: 5c 81 ldd r21, Y+4 ; 0x04 1d8aa: b1 01 movw r22, r2 1d8ac: 89 81 ldd r24, Y+1 ; 0x01 1d8ae: 9a 81 ldd r25, Y+2 ; 0x02 1d8b0: 19 95 eicall 1d8b2: 81 e0 ldi r24, 0x01 ; 1 1d8b4: 67 28 or r6, r7 1d8b6: 09 f4 brne .+2 ; 0x1d8ba 1d8b8: 80 e0 ldi r24, 0x00 ; 0 // u = _micros() - u; return ret; } 1d8ba: 26 96 adiw r28, 0x06 ; 6 1d8bc: 0f b6 in r0, 0x3f ; 63 1d8be: f8 94 cli 1d8c0: de bf out 0x3e, r29 ; 62 1d8c2: 0f be out 0x3f, r0 ; 63 1d8c4: cd bf out 0x3d, r28 ; 61 1d8c6: df 91 pop r29 1d8c8: cf 91 pop r28 1d8ca: 1f 91 pop r17 1d8cc: 0f 91 pop r16 1d8ce: ff 90 pop r15 1d8d0: ef 90 pop r14 1d8d2: df 90 pop r13 1d8d4: cf 90 pop r12 1d8d6: bf 90 pop r11 1d8d8: af 90 pop r10 1d8da: 9f 90 pop r9 1d8dc: 8f 90 pop r8 1d8de: 7f 90 pop r7 1d8e0: 6f 90 pop r6 1d8e2: 5f 90 pop r5 1d8e4: 4f 90 pop r4 1d8e6: 3f 90 pop r3 1d8e8: 2f 90 pop r2 1d8ea: 08 95 ret } cx -= dx; cy -= dy; cz -= dz; sm4_do_step(sm); uint16_t delay = SM4_DEFDELAY; 1d8ec: 84 ef ldi r24, 0xF4 ; 244 1d8ee: 91 e0 ldi r25, 0x01 ; 1 1d8f0: c8 cf rjmp .-112 ; 0x1d882 0001d8f2 : } static inline uint8_t spi_txrx(uint8_t tx) { SPDR = tx; 1d8f2: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))); 1d8f4: 0d b4 in r0, 0x2d ; 45 1d8f6: 07 fe sbrs r0, 7 1d8f8: fd cf rjmp .-6 ; 0x1d8f4 return SPDR; 1d8fa: 8e b5 in r24, 0x2e ; 46 } 1d8fc: 08 95 ret 0001d8fe : _CS_HIGH(); } uint8_t xflash_rd_status_reg(void) { _CS_LOW(); 1d8fe: 45 98 cbi 0x08, 5 ; 8 _SPI_TX(_CMD_RD_STATUS_REG); // send command 0x90 1d900: 85 e0 ldi r24, 0x05 ; 5 1d902: 0e 94 79 ec call 0x1d8f2 ; 0x1d8f2 uint8_t val = _SPI_RX(); // receive value 1d906: 8f ef ldi r24, 0xFF ; 255 1d908: 0e 94 79 ec call 0x1d8f2 ; 0x1d8f2 _CS_HIGH(); 1d90c: 45 9a sbi 0x08, 5 ; 8 ((xflash_mfrid == _MFRID_GD25Q20C) && (xflash_devid == _DEVID_GD25Q20C)); } void xflash_wait_busy(void) { while (xflash_rd_status_reg() & XFLASH_STATUS_BUSY) ; 1d90e: 80 fd sbrc r24, 0 1d910: f6 cf rjmp .-20 ; 0x1d8fe } 1d912: 08 95 ret 0001d914 : _CS_HIGH(); return val; } static void xflash_send_cmdaddr(uint8_t cmd, uint32_t addr) { 1d914: 1f 93 push r17 1d916: cf 93 push r28 1d918: df 93 push r29 1d91a: ea 01 movw r28, r20 1d91c: 16 2f mov r17, r22 _SPI_TX(cmd); // send command 0x03 1d91e: 0e 94 79 ec call 0x1d8f2 ; 0x1d8f2 _SPI_TX(((uint8_t*)&addr)[2]); // send addr bits 16..23 1d922: 81 2f mov r24, r17 1d924: 0e 94 79 ec call 0x1d8f2 ; 0x1d8f2 _SPI_TX(((uint8_t*)&addr)[1]); // send addr bits 8..15 1d928: 8d 2f mov r24, r29 1d92a: 0e 94 79 ec call 0x1d8f2 ; 0x1d8f2 _SPI_TX(((uint8_t*)&addr)[0]); // send addr bits 0..7 1d92e: 8c 2f mov r24, r28 } 1d930: df 91 pop r29 1d932: cf 91 pop r28 1d934: 1f 91 pop r17 static void xflash_send_cmdaddr(uint8_t cmd, uint32_t addr) { _SPI_TX(cmd); // send command 0x03 _SPI_TX(((uint8_t*)&addr)[2]); // send addr bits 16..23 _SPI_TX(((uint8_t*)&addr)[1]); // send addr bits 8..15 _SPI_TX(((uint8_t*)&addr)[0]); // send addr bits 0..7 1d936: 0c 94 79 ec jmp 0x1d8f2 ; 0x1d8f2 0001d93a : _CS_HIGH(); } void xflash_erase(uint8_t cmd, uint32_t addr) { _CS_LOW(); 1d93a: 45 98 cbi 0x08, 5 ; 8 xflash_send_cmdaddr(cmd, addr); 1d93c: 0e 94 8a ec call 0x1d914 ; 0x1d914 _CS_HIGH(); 1d940: 45 9a sbi 0x08, 5 ; 8 } 1d942: 08 95 ret 0001d944 : *(data++) = _SPI_RX(); _CS_HIGH(); } void xflash_page_program(uint32_t addr, uint8_t* data, uint16_t cnt) { 1d944: ef 92 push r14 1d946: ff 92 push r15 1d948: 0f 93 push r16 1d94a: 1f 93 push r17 1d94c: cf 93 push r28 1d94e: df 93 push r29 1d950: 7a 01 movw r14, r20 1d952: 89 01 movw r16, r18 _CS_LOW(); 1d954: 45 98 cbi 0x08, 5 ; 8 xflash_send_cmdaddr(_CMD_PAGE_PROGRAM, addr); 1d956: ab 01 movw r20, r22 1d958: bc 01 movw r22, r24 1d95a: 82 e0 ldi r24, 0x02 ; 2 1d95c: 0e 94 8a ec call 0x1d914 ; 0x1d914 1d960: e7 01 movw r28, r14 1d962: 0e 0d add r16, r14 1d964: 1f 1d adc r17, r15 while (cnt--) // send data 1d966: c0 17 cp r28, r16 1d968: d1 07 cpc r29, r17 1d96a: 41 f4 brne .+16 ; 0x1d97c _SPI_TX(*(data++)); _CS_HIGH(); 1d96c: 45 9a sbi 0x08, 5 ; 8 } 1d96e: df 91 pop r29 1d970: cf 91 pop r28 1d972: 1f 91 pop r17 1d974: 0f 91 pop r16 1d976: ff 90 pop r15 1d978: ef 90 pop r14 1d97a: 08 95 ret void xflash_page_program(uint32_t addr, uint8_t* data, uint16_t cnt) { _CS_LOW(); xflash_send_cmdaddr(_CMD_PAGE_PROGRAM, addr); while (cnt--) // send data _SPI_TX(*(data++)); 1d97c: 89 91 ld r24, Y+ 1d97e: 0e 94 79 ec call 0x1d8f2 ; 0x1d8f2 1d982: f1 cf rjmp .-30 ; 0x1d966 0001d984 : _SPI_TX(((uint8_t*)&addr)[1]); // send addr bits 8..15 _SPI_TX(((uint8_t*)&addr)[0]); // send addr bits 0..7 } void xflash_rd_data(uint32_t addr, uint8_t* data, uint16_t cnt) { 1d984: ef 92 push r14 1d986: ff 92 push r15 1d988: 0f 93 push r16 1d98a: 1f 93 push r17 1d98c: cf 93 push r28 1d98e: df 93 push r29 1d990: 7a 01 movw r14, r20 1d992: 89 01 movw r16, r18 _CS_LOW(); 1d994: 45 98 cbi 0x08, 5 ; 8 xflash_send_cmdaddr(_CMD_RD_DATA, addr); 1d996: ab 01 movw r20, r22 1d998: bc 01 movw r22, r24 1d99a: 83 e0 ldi r24, 0x03 ; 3 1d99c: 0e 94 8a ec call 0x1d914 ; 0x1d914 1d9a0: e7 01 movw r28, r14 1d9a2: 0e 0d add r16, r14 1d9a4: 1f 1d adc r17, r15 while (cnt--) // receive data 1d9a6: c0 17 cp r28, r16 1d9a8: d1 07 cpc r29, r17 1d9aa: 41 f4 brne .+16 ; 0x1d9bc *(data++) = _SPI_RX(); _CS_HIGH(); 1d9ac: 45 9a sbi 0x08, 5 ; 8 } 1d9ae: df 91 pop r29 1d9b0: cf 91 pop r28 1d9b2: 1f 91 pop r17 1d9b4: 0f 91 pop r16 1d9b6: ff 90 pop r15 1d9b8: ef 90 pop r14 1d9ba: 08 95 ret void xflash_rd_data(uint32_t addr, uint8_t* data, uint16_t cnt) { _CS_LOW(); xflash_send_cmdaddr(_CMD_RD_DATA, addr); while (cnt--) // receive data *(data++) = _SPI_RX(); 1d9bc: 8f ef ldi r24, 0xFF ; 255 1d9be: 0e 94 79 ec call 0x1d8f2 ; 0x1d8f2 1d9c2: 89 93 st Y+, r24 1d9c4: f0 cf rjmp .-32 ; 0x1d9a6 0001d9c6 : #include "asm.h" #include "xflash.h" #include "Marlin.h" // for softReset bool xfdump_check_state(dump_crash_reason* reason) { 1d9c6: 0f 93 push r16 1d9c8: 1f 93 push r17 1d9ca: cf 93 push r28 1d9cc: df 93 push r29 1d9ce: 00 d0 rcall .+0 ; 0x1d9d0 1d9d0: 1f 92 push r1 1d9d2: cd b7 in r28, 0x3d ; 61 1d9d4: de b7 in r29, 0x3e ; 62 1d9d6: 8c 01 movw r16, r24 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 1d9d8: 8c e5 ldi r24, 0x5C ; 92 1d9da: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 1d9dc: 1d bc out 0x2d, r1 ; 45 uint32_t magic; XFLASH_SPI_ENTER(); xflash_rd_data(DUMP_OFFSET + offsetof(dump_t, header.magic), 1d9de: 24 e0 ldi r18, 0x04 ; 4 1d9e0: 30 e0 ldi r19, 0x00 ; 0 1d9e2: ae 01 movw r20, r28 1d9e4: 4f 5f subi r20, 0xFF ; 255 1d9e6: 5f 4f sbci r21, 0xFF ; 255 1d9e8: 60 e0 ldi r22, 0x00 ; 0 1d9ea: 70 ed ldi r23, 0xD0 ; 208 1d9ec: 83 e0 ldi r24, 0x03 ; 3 1d9ee: 90 e0 ldi r25, 0x00 ; 0 1d9f0: 0e 94 c2 ec call 0x1d984 ; 0x1d984 (uint8_t*)&magic, sizeof(magic)); if (magic != DUMP_MAGIC) 1d9f4: 89 81 ldd r24, Y+1 ; 0x01 1d9f6: 9a 81 ldd r25, Y+2 ; 0x02 1d9f8: ab 81 ldd r26, Y+3 ; 0x03 1d9fa: bc 81 ldd r27, Y+4 ; 0x04 1d9fc: 87 34 cpi r24, 0x47 ; 71 1d9fe: 95 45 sbci r25, 0x55 ; 85 1da00: a2 45 sbci r26, 0x52 ; 82 1da02: b5 45 sbci r27, 0x55 ; 85 1da04: 71 f4 brne .+28 ; 0x1da22 return false; if (reason) 1da06: 01 15 cp r16, r1 1da08: 11 05 cpc r17, r1 1da0a: 49 f0 breq .+18 ; 0x1da1e { xflash_rd_data(DUMP_OFFSET + offsetof(dump_t, header.crash_reason), 1da0c: 21 e0 ldi r18, 0x01 ; 1 1da0e: 30 e0 ldi r19, 0x00 ; 0 1da10: a8 01 movw r20, r16 1da12: 65 e0 ldi r22, 0x05 ; 5 1da14: 70 ed ldi r23, 0xD0 ; 208 1da16: 83 e0 ldi r24, 0x03 ; 3 1da18: 90 e0 ldi r25, 0x00 ; 0 1da1a: 0e 94 c2 ec call 0x1d984 ; 0x1d984 (uint8_t*)reason, sizeof(*reason)); } return true; 1da1e: 81 e0 ldi r24, 0x01 ; 1 1da20: 01 c0 rjmp .+2 ; 0x1da24 XFLASH_SPI_ENTER(); xflash_rd_data(DUMP_OFFSET + offsetof(dump_t, header.magic), (uint8_t*)&magic, sizeof(magic)); if (magic != DUMP_MAGIC) return false; 1da22: 80 e0 ldi r24, 0x00 ; 0 { xflash_rd_data(DUMP_OFFSET + offsetof(dump_t, header.crash_reason), (uint8_t*)reason, sizeof(*reason)); } return true; } 1da24: 0f 90 pop r0 1da26: 0f 90 pop r0 1da28: 0f 90 pop r0 1da2a: 0f 90 pop r0 1da2c: df 91 pop r29 1da2e: cf 91 pop r28 1da30: 1f 91 pop r17 1da32: 0f 91 pop r16 1da34: 08 95 ret 0001da36 : return 1; } void xflash_enable_wr(void) { _CS_LOW(); 1da36: 45 98 cbi 0x08, 5 ; 8 _SPI_TX(_CMD_ENABLE_WR); // send command 0x06 1da38: 86 e0 ldi r24, 0x06 ; 6 1da3a: 0e 94 79 ec call 0x1d8f2 ; 0x1d8f2 _CS_HIGH(); 1da3e: 45 9a sbi 0x08, 5 ; 8 } 1da40: 08 95 ret 0001da42 : } } static void __attribute__((noinline)) xfdump_dump_core(dump_header_t& hdr, uint32_t addr, uint8_t* buf, uint16_t cnt) { 1da42: 4f 92 push r4 1da44: 5f 92 push r5 1da46: 6f 92 push r6 1da48: 7f 92 push r7 1da4a: 8f 92 push r8 1da4c: 9f 92 push r9 1da4e: af 92 push r10 1da50: bf 92 push r11 1da52: ef 92 push r14 1da54: ff 92 push r15 1da56: 0f 93 push r16 1da58: 1f 93 push r17 1da5a: cf 93 push r28 1da5c: df 93 push r29 1da5e: 7c 01 movw r14, r24 1da60: 4a 01 movw r8, r20 1da62: 5b 01 movw r10, r22 1da64: e9 01 movw r28, r18 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 1da66: 8c e5 ldi r24, 0x5C ; 92 1da68: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 1da6a: 1d bc out 0x2d, r1 ; 45 } static void xfdump_erase() { for(uint32_t addr = DUMP_OFFSET; 1da6c: 41 2c mov r4, r1 1da6e: 80 ed ldi r24, 0xD0 ; 208 1da70: 58 2e mov r5, r24 1da72: 83 e0 ldi r24, 0x03 ; 3 1da74: 68 2e mov r6, r24 1da76: 71 2c mov r7, r1 addr < DUMP_OFFSET + DUMP_SIZE; addr += 4096) { xflash_enable_wr(); 1da78: 0e 94 1b ed call 0x1da36 ; 0x1da36 _CS_HIGH(); } void xflash_sector_erase(uint32_t addr) { return xflash_erase(_CMD_SECTOR_ERASE, addr); 1da7c: b3 01 movw r22, r6 1da7e: a2 01 movw r20, r4 1da80: 80 e2 ldi r24, 0x20 ; 32 1da82: 0e 94 9d ec call 0x1d93a ; 0x1d93a xflash_sector_erase(addr); xflash_wait_busy(); 1da86: 0e 94 7f ec call 0x1d8fe ; 0x1d8fe static void xfdump_erase() { for(uint32_t addr = DUMP_OFFSET; addr < DUMP_OFFSET + DUMP_SIZE; addr += 4096) 1da8a: 80 e1 ldi r24, 0x10 ; 16 1da8c: 58 0e add r5, r24 1da8e: 61 1c adc r6, r1 1da90: 71 1c adc r7, r1 static void xfdump_erase() { for(uint32_t addr = DUMP_OFFSET; addr < DUMP_OFFSET + DUMP_SIZE; 1da92: 41 14 cp r4, r1 1da94: 51 04 cpc r5, r1 1da96: e4 e0 ldi r30, 0x04 ; 4 1da98: 6e 06 cpc r6, r30 1da9a: 71 04 cpc r7, r1 1da9c: 69 f7 brne .-38 ; 0x1da78 // start by clearing all sectors (we need all of them in any case) xfdump_erase(); // sample SP/PC hdr.sp = SP; 1da9e: 8d b7 in r24, 0x3d ; 61 1daa0: 9e b7 in r25, 0x3e ; 62 1daa2: f7 01 movw r30, r14 1daa4: 93 87 std Z+11, r25 ; 0x0b 1daa6: 82 87 std Z+10, r24 ; 0x0a "rcall .\n" "pop %A0\n" "pop %B0\n" "pop %C0\n" : "=&r" (ret) ); 1daa8: 00 d0 rcall .+0 ; 0x1daaa 1daaa: 8f 91 pop r24 1daac: 9f 91 pop r25 1daae: af 91 pop r26 hdr.pc = GETPC(); 1dab0: b0 e0 ldi r27, 0x00 ; 0 1dab2: 86 83 std Z+6, r24 ; 0x06 1dab4: 97 83 std Z+7, r25 ; 0x07 1dab6: a0 87 std Z+8, r26 ; 0x08 1dab8: b1 87 std Z+9, r27 ; 0x09 // write header static_assert(sizeof(hdr) <= 256, "header is larger than a single page write"); xflash_enable_wr(); 1daba: 0e 94 1b ed call 0x1da36 ; 0x1da36 xflash_page_program(DUMP_OFFSET, (uint8_t*)&hdr, sizeof(hdr)); 1dabe: 2c e0 ldi r18, 0x0C ; 12 1dac0: 30 e0 ldi r19, 0x00 ; 0 1dac2: a7 01 movw r20, r14 1dac4: 60 e0 ldi r22, 0x00 ; 0 1dac6: 70 ed ldi r23, 0xD0 ; 208 1dac8: 83 e0 ldi r24, 0x03 ; 3 1daca: 90 e0 ldi r25, 0x00 ; 0 1dacc: 0e 94 a2 ec call 0x1d944 ; 0x1d944 xflash_wait_busy(); 1dad0: 0e 94 7f ec call 0x1d8fe ; 0x1d8fe void xflash_multipage_program(uint32_t addr, uint8_t* data, uint16_t cnt) { while(cnt) { xflash_enable_wr(); 1dad4: 0e 94 1b ed call 0x1da36 ; 0x1da36 _CS_LOW(); 1dad8: 45 98 cbi 0x08, 5 ; 8 xflash_send_cmdaddr(_CMD_PAGE_PROGRAM, addr); 1dada: b5 01 movw r22, r10 1dadc: a4 01 movw r20, r8 1dade: 82 e0 ldi r24, 0x02 ; 2 1dae0: 0e 94 8a ec call 0x1d914 ; 0x1d914 1dae4: fe 01 movw r30, r28 while(1) { // send data _SPI_TX(*(data++)); 1dae6: 21 96 adiw r28, 0x01 ; 1 1dae8: 80 81 ld r24, Z 1daea: 0e 94 79 ec call 0x1d8f2 ; 0x1d8f2 if(!--cnt || !(++addr & 0xFF)) 1daee: 01 50 subi r16, 0x01 ; 1 1daf0: 11 09 sbc r17, r1 1daf2: 41 f0 breq .+16 ; 0x1db04 1daf4: ff ef ldi r31, 0xFF ; 255 1daf6: 8f 1a sub r8, r31 1daf8: 9f 0a sbc r9, r31 1dafa: af 0a sbc r10, r31 1dafc: bf 0a sbc r11, r31 _CS_LOW(); xflash_send_cmdaddr(_CMD_PAGE_PROGRAM, addr); while(1) { // send data _SPI_TX(*(data++)); 1dafe: fe 01 movw r30, r28 if(!--cnt || !(++addr & 0xFF)) 1db00: 81 10 cpse r8, r1 1db02: f1 cf rjmp .-30 ; 0x1dae6 { // on a page boundary or end of write _CS_HIGH(); 1db04: 45 9a sbi 0x08, 5 ; 8 xflash_wait_busy(); 1db06: 0e 94 7f ec call 0x1d8fe ; 0x1d8fe _CS_HIGH(); } void xflash_multipage_program(uint32_t addr, uint8_t* data, uint16_t cnt) { while(cnt) 1db0a: 01 15 cp r16, r1 1db0c: 11 05 cpc r17, r1 1db0e: 11 f7 brne .-60 ; 0x1dad4 // write data static_assert(sizeof(dump_t::data) <= RAMEND+1, "dump area size insufficient"); xflash_multipage_program(addr, buf, cnt); } 1db10: df 91 pop r29 1db12: cf 91 pop r28 1db14: 1f 91 pop r17 1db16: 0f 91 pop r16 1db18: ff 90 pop r15 1db1a: ef 90 pop r14 1db1c: bf 90 pop r11 1db1e: af 90 pop r10 1db20: 9f 90 pop r9 1db22: 8f 90 pop r8 1db24: 7f 90 pop r7 1db26: 6f 90 pop r6 1db28: 5f 90 pop r5 1db2a: 4f 90 pop r4 1db2c: 08 95 ret 0001db2e : (uint8_t*)RAMSTART, RAMSIZE); } void xfdump_full_dump_and_reset(dump_crash_reason reason) { 1db2e: cf 93 push r28 1db30: df 93 push r29 1db32: cd b7 in r28, 0x3d ; 61 1db34: de b7 in r29, 0x3e ; 62 1db36: 2c 97 sbiw r28, 0x0c ; 12 1db38: 0f b6 in r0, 0x3f ; 63 1db3a: f8 94 cli 1db3c: de bf out 0x3e, r29 ; 62 1db3e: 0f be out 0x3f, r0 ; 63 1db40: cd bf out 0x3d, r28 ; 61 dump_header_t buf; buf.magic = DUMP_MAGIC; 1db42: 47 e4 ldi r20, 0x47 ; 71 1db44: 55 e5 ldi r21, 0x55 ; 85 1db46: 62 e5 ldi r22, 0x52 ; 82 1db48: 75 e5 ldi r23, 0x55 ; 85 1db4a: 49 83 std Y+1, r20 ; 0x01 1db4c: 5a 83 std Y+2, r21 ; 0x02 1db4e: 6b 83 std Y+3, r22 ; 0x03 1db50: 7c 83 std Y+4, r23 ; 0x04 buf.regs_present = true; 1db52: 91 e0 ldi r25, 0x01 ; 1 1db54: 9d 83 std Y+5, r25 ; 0x05 buf.crash_reason = (uint8_t)reason; 1db56: 8e 83 std Y+6, r24 ; 0x06 // disable interrupts for a cleaner register dump cli(); 1db58: f8 94 cli 1db5a: 88 e1 ldi r24, 0x18 ; 24 1db5c: 9d e0 ldi r25, 0x0D ; 13 1db5e: 0f b6 in r0, 0x3f ; 63 1db60: f8 94 cli 1db62: a8 95 wdr 1db64: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1db68: 0f be out 0x3f, r0 ; 63 1db6a: 90 93 60 00 sts 0x0060, r25 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> // ensure there's always enough time (with some margin) to dump // dump time on w25x20cl: ~150ms wdt_enable(WDTO_500MS); // write all addressable ranges (this will trash bidirectional registers) xfdump_dump_core(buf, DUMP_OFFSET + offsetof(dump_t, data), 0, RAMEND+1); 1db6e: 00 e0 ldi r16, 0x00 ; 0 1db70: 12 e2 ldi r17, 0x22 ; 34 1db72: 30 e0 ldi r19, 0x00 ; 0 1db74: 20 e0 ldi r18, 0x00 ; 0 1db76: 40 e0 ldi r20, 0x00 ; 0 1db78: 51 ed ldi r21, 0xD1 ; 209 1db7a: 63 e0 ldi r22, 0x03 ; 3 1db7c: 70 e0 ldi r23, 0x00 ; 0 1db7e: ce 01 movw r24, r28 1db80: 01 96 adiw r24, 0x01 ; 1 1db82: 0e 94 21 ed call 0x1da42 ; 0x1da42 // force a reset even sooner softReset(); 1db86: 0e 94 64 67 call 0xcec8 ; 0xcec8 0001db8a : xflash_multipage_program(addr, buf, cnt); } void xfdump_dump() { 1db8a: 0f 93 push r16 1db8c: 1f 93 push r17 1db8e: cf 93 push r28 1db90: df 93 push r29 1db92: cd b7 in r28, 0x3d ; 61 1db94: de b7 in r29, 0x3e ; 62 1db96: 2c 97 sbiw r28, 0x0c ; 12 1db98: 0f b6 in r0, 0x3f ; 63 1db9a: f8 94 cli 1db9c: de bf out 0x3e, r29 ; 62 1db9e: 0f be out 0x3f, r0 ; 63 1dba0: cd bf out 0x3d, r28 ; 61 dump_header_t buf; buf.magic = DUMP_MAGIC; 1dba2: 87 e4 ldi r24, 0x47 ; 71 1dba4: 95 e5 ldi r25, 0x55 ; 85 1dba6: a2 e5 ldi r26, 0x52 ; 82 1dba8: b5 e5 ldi r27, 0x55 ; 85 1dbaa: 89 83 std Y+1, r24 ; 0x01 1dbac: 9a 83 std Y+2, r25 ; 0x02 1dbae: ab 83 std Y+3, r26 ; 0x03 1dbb0: bc 83 std Y+4, r27 ; 0x04 buf.regs_present = false; 1dbb2: 1d 82 std Y+5, r1 ; 0x05 buf.crash_reason = (uint8_t)dump_crash_reason::manual; 1dbb4: 1e 82 std Y+6, r1 ; 0x06 // write sram only xfdump_dump_core(buf, DUMP_OFFSET + offsetof(dump_t, data.sram), 1dbb6: 00 e0 ldi r16, 0x00 ; 0 1dbb8: 10 e2 ldi r17, 0x20 ; 32 1dbba: 20 e0 ldi r18, 0x00 ; 0 1dbbc: 32 e0 ldi r19, 0x02 ; 2 1dbbe: 40 e0 ldi r20, 0x00 ; 0 1dbc0: 53 ed ldi r21, 0xD3 ; 211 1dbc2: 63 e0 ldi r22, 0x03 ; 3 1dbc4: 70 e0 ldi r23, 0x00 ; 0 1dbc6: ce 01 movw r24, r28 1dbc8: 01 96 adiw r24, 0x01 ; 1 1dbca: 0e 94 21 ed call 0x1da42 ; 0x1da42 (uint8_t*)RAMSTART, RAMSIZE); } 1dbce: 2c 96 adiw r28, 0x0c ; 12 1dbd0: 0f b6 in r0, 0x3f ; 63 1dbd2: f8 94 cli 1dbd4: de bf out 0x3e, r29 ; 62 1dbd6: 0f be out 0x3f, r0 ; 63 1dbd8: cd bf out 0x3d, r28 ; 61 1dbda: df 91 pop r29 1dbdc: cf 91 pop r28 1dbde: 1f 91 pop r17 1dbe0: 0f 91 pop r16 1dbe2: 08 95 ret 0001dbe4 : int xflash_mfrid_devid(void); int8_t xflash_init(void) { 1dbe4: cf 93 push r28 _CS_HIGH(); 1dbe6: 45 9a sbi 0x08, 5 ; 8 SET_OUTPUT(XFLASH_PIN_CS); 1dbe8: 3d 9a sbi 0x07, 5 ; 7 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 1dbea: 8c e5 ldi r24, 0x5C ; 92 1dbec: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 1dbee: 1d bc out 0x2d, r1 ; 45 _CS_HIGH(); } int xflash_mfrid_devid(void) { _CS_LOW(); 1dbf0: 45 98 cbi 0x08, 5 ; 8 _SPI_TX(_CMD_MFRID_DEVID); // send command 0x90 1dbf2: 80 e9 ldi r24, 0x90 ; 144 1dbf4: 0e 94 79 ec call 0x1d8f2 ; 0x1d8f2 uint8_t cnt = 3; // 3 address bytes while (cnt--) // send address bytes _SPI_TX(0x00); 1dbf8: 80 e0 ldi r24, 0x00 ; 0 1dbfa: 0e 94 79 ec call 0x1d8f2 ; 0x1d8f2 1dbfe: 80 e0 ldi r24, 0x00 ; 0 1dc00: 0e 94 79 ec call 0x1d8f2 ; 0x1d8f2 1dc04: 80 e0 ldi r24, 0x00 ; 0 1dc06: 0e 94 79 ec call 0x1d8f2 ; 0x1d8f2 uint8_t xflash_mfrid = _SPI_RX(); // receive mfrid 1dc0a: 8f ef ldi r24, 0xFF ; 255 1dc0c: 0e 94 79 ec call 0x1d8f2 ; 0x1d8f2 1dc10: c8 2f mov r28, r24 uint8_t xflash_devid = _SPI_RX(); // receive devid 1dc12: 8f ef ldi r24, 0xFF ; 255 1dc14: 0e 94 79 ec call 0x1d8f2 ; 0x1d8f2 1dc18: 98 2f mov r25, r24 _CS_HIGH(); 1dc1a: 45 9a sbi 0x08, 5 ; 8 return ((xflash_mfrid == _MFRID_W25X20CL) && (xflash_devid == _DEVID_W25X20CL)) || 1dc1c: cf 3e cpi r28, 0xEF ; 239 1dc1e: 11 f0 breq .+4 ; 0x1dc24 1dc20: c8 3c cpi r28, 0xC8 ; 200 1dc22: 19 f4 brne .+6 ; 0x1dc2a 1dc24: 81 e0 ldi r24, 0x01 ; 1 1dc26: 91 31 cpi r25, 0x11 ; 17 1dc28: 09 f0 breq .+2 ; 0x1dc2c int8_t xflash_init(void) { _CS_HIGH(); SET_OUTPUT(XFLASH_PIN_CS); XFLASH_SPI_ENTER(); if (!xflash_mfrid_devid()) return 0; 1dc2a: 80 e0 ldi r24, 0x00 ; 0 return 1; } 1dc2c: cf 91 pop r28 1dc2e: 08 95 ret 0001dc30 : status |= components; eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } void calibration_status_clear(CalibrationStatus components) { 1dc30: cf 93 push r28 1dc32: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 1dc34: 86 ea ldi r24, 0xA6 ; 166 1dc36: 9c e0 ldi r25, 0x0C ; 12 1dc38: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae status &= ~components; 1dc3c: c0 95 com r28 1dc3e: 6c 2f mov r22, r28 1dc40: 68 23 and r22, r24 1dc42: 86 ea ldi r24, 0xA6 ; 166 1dc44: 9c e0 ldi r25, 0x0C ; 12 eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } 1dc46: cf 91 pop r28 1dc48: 0d 94 fb db jmp 0x3b7f6 ; 0x3b7f6 0001dc4c : } } } static void lcd_reset_sheet() { 1dc4c: 1f 93 push r17 1dc4e: cf 93 push r28 1dc50: df 93 push r29 1dc52: 00 d0 rcall .+0 ; 0x1dc54 1dc54: 00 d0 rcall .+0 ; 0x1dc56 1dc56: 1f 92 push r1 1dc58: 1f 92 push r1 1dc5a: cd b7 in r28, 0x3d ; 61 1dc5c: de b7 in r29, 0x3e ; 62 SheetName sheetName; eeprom_default_sheet_name(selected_sheet, sheetName); 1dc5e: be 01 movw r22, r28 1dc60: 6f 5f subi r22, 0xFF ; 255 1dc62: 7f 4f sbci r23, 0xFF ; 255 1dc64: 80 91 e0 03 lds r24, 0x03E0 ; 0x8003e0 1dc68: 0e 94 89 76 call 0xed12 ; 0xed12 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[selected_sheet].z_offset)),EEPROM_EMPTY_VALUE16); 1dc6c: 80 91 e0 03 lds r24, 0x03E0 ; 0x8003e0 1dc70: 1b e0 ldi r17, 0x0B ; 11 1dc72: 81 9f mul r24, r17 1dc74: c0 01 movw r24, r0 1dc76: 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); 1dc78: 6f ef ldi r22, 0xFF ; 255 1dc7a: 7f ef ldi r23, 0xFF ; 255 1dc7c: 80 5b subi r24, 0xB0 ; 176 1dc7e: 92 4f sbci r25, 0xF2 ; 242 1dc80: 0f 94 19 dc call 0x3b832 ; 0x3b832 eeprom_update_block_notify(sheetName.c,EEPROM_Sheets_base->s[selected_sheet].name,sizeof(Sheet::name)); 1dc84: 60 91 e0 03 lds r22, 0x03E0 ; 0x8003e0 1dc88: 61 9f mul r22, r17 1dc8a: b0 01 movw r22, r0 1dc8c: 11 24 eor r1, r1 1dc8e: 67 5b subi r22, 0xB7 ; 183 1dc90: 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); 1dc92: 47 e0 ldi r20, 0x07 ; 7 1dc94: 50 e0 ldi r21, 0x00 ; 0 1dc96: ce 01 movw r24, r28 1dc98: 01 96 adiw r24, 0x01 ; 1 1dc9a: 0f 94 eb db call 0x3b7d6 ; 0x3b7d6 if (selected_sheet == eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet))) 1dc9e: 81 ea ldi r24, 0xA1 ; 161 1dca0: 9d e0 ldi r25, 0x0D ; 13 1dca2: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 1dca6: 90 91 e0 03 lds r25, 0x03E0 ; 0x8003e0 1dcaa: 89 13 cpse r24, r25 1dcac: 0a c0 rjmp .+20 ; 0x1dcc2 { eeprom_switch_to_next_sheet(); 1dcae: 0e 94 7b 76 call 0xecf6 ; 0xecf6 if (-1 == eeprom_next_initialized_sheet(0)) 1dcb2: 80 e0 ldi r24, 0x00 ; 0 1dcb4: 0e 94 67 76 call 0xecce ; 0xecce 1dcb8: 8f 3f cpi r24, 0xFF ; 255 1dcba: 19 f4 brne .+6 ; 0x1dcc2 calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 1dcbc: 80 e1 ldi r24, 0x10 ; 16 1dcbe: 0e 94 18 ee call 0x1dc30 ; 0x1dc30 } menu_back(); 1dcc2: 0f 94 19 d4 call 0x3a832 ; 0x3a832 } 1dcc6: 28 96 adiw r28, 0x08 ; 8 1dcc8: 0f b6 in r0, 0x3f ; 63 1dcca: f8 94 cli 1dccc: de bf out 0x3e, r29 ; 62 1dcce: 0f be out 0x3f, r0 ; 63 1dcd0: cd bf out 0x3d, r28 ; 61 1dcd2: df 91 pop r29 1dcd4: cf 91 pop r28 1dcd6: 1f 91 pop r17 1dcd8: 08 95 ret 0001dcda : CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); return ((status & components) == components); } void calibration_status_set(CalibrationStatus components) { 1dcda: cf 93 push r28 1dcdc: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 1dcde: 86 ea ldi r24, 0xA6 ; 166 1dce0: 9c e0 ldi r25, 0x0C ; 12 1dce2: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae status |= components; 1dce6: 68 2f mov r22, r24 1dce8: 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); 1dcea: 86 ea ldi r24, 0xA6 ; 166 1dcec: 9c e0 ldi r25, 0x0C ; 12 eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } 1dcee: cf 91 pop r28 1dcf0: 0d 94 fb db jmp 0x3b7f6 ; 0x3b7f6 0001dcf4 : sprintf_P(dest, PSTR("%u.%u.%u.%u"), IP[0], IP[1], IP[2], IP[3]); } bool calibration_status_get(CalibrationStatus components) { 1dcf4: cf 93 push r28 1dcf6: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 1dcf8: 86 ea ldi r24, 0xA6 ; 166 1dcfa: 9c e0 ldi r25, 0x0C ; 12 1dcfc: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae return ((status & components) == components); 1dd00: 98 2f mov r25, r24 1dd02: 9c 23 and r25, r28 1dd04: 81 e0 ldi r24, 0x01 ; 1 1dd06: 9c 13 cpse r25, r28 1dd08: 80 e0 ldi r24, 0x00 ; 0 } 1dd0a: cf 91 pop r28 1dd0c: 08 95 ret 0001dd0e : //! |>Continue | MSG_CONTINUE //! | Reset | MSG_RESET //! ---------------------- //! @endcode void lcd_first_layer_calibration_reset() { 1dd0e: af 92 push r10 1dd10: bf 92 push r11 1dd12: cf 92 push r12 1dd14: df 92 push r13 1dd16: ef 92 push r14 1dd18: ff 92 push r15 1dd1a: 0f 93 push r16 1dd1c: 1f 93 push r17 1dd1e: cf 93 push r28 1dd20: df 93 push r29 1dd22: 00 d0 rcall .+0 ; 0x1dd24 1dd24: 00 d0 rcall .+0 ; 0x1dd26 1dd26: 1f 92 push r1 1dd28: cd b7 in r28, 0x3d ; 61 1dd2a: 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)) || 1dd2c: 80 91 a6 03 lds r24, 0x03A6 ; 0x8003a6 1dd30: 81 11 cpse r24, r1 1dd32: 18 c0 rjmp .+48 ; 0x1dd64 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))) || 1dd34: 81 ea ldi r24, 0xA1 ; 161 1dd36: 9d e0 ldi r25, 0x0D ; 13 1dd38: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 1dd3c: 18 2f mov r17, r24 1dd3e: 0e 94 59 76 call 0xecb2 ; 0xecb2 1dd42: 88 23 and r24, r24 1dd44: 79 f0 breq .+30 ; 0x1dd64 (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) || 1dd46: 80 e1 ldi r24, 0x10 ; 16 1dd48: 0e 94 7a ee call 0x1dcf4 ; 0x1dcf4 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))) || 1dd4c: 88 23 and r24, r24 1dd4e: 51 f0 breq .+20 ; 0x1dd64 (!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))))) 1dd50: 2b e0 ldi r18, 0x0B ; 11 1dd52: 12 9f mul r17, r18 1dd54: c0 01 movw r24, r0 1dd56: 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 1dd58: 80 5b subi r24, 0xB0 ; 176 1dd5a: 92 4f sbci r25, 0xF2 ; 242 1dd5c: 0f 94 e5 db call 0x3b7ca ; 0x3b7ca } 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)) || 1dd60: 89 2b or r24, r25 1dd62: f1 f4 brne .+60 ; 0x1dda0 (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) 1dd64: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 1dd68: 88 23 and r24, r24 1dd6a: 71 f0 breq .+28 ; 0x1dd88 { eeprom_update_word_notify(reinterpret_cast(&EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset), 0xffff); 1dd6c: 81 ea ldi r24, 0xA1 ; 161 1dd6e: 9d e0 ldi r25, 0x0D ; 13 1dd70: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 1dd74: 2b e0 ldi r18, 0x0B ; 11 1dd76: 82 9f mul r24, r18 1dd78: c0 01 movw r24, r0 1dd7a: 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); 1dd7c: 6f ef ldi r22, 0xFF ; 255 1dd7e: 7f ef ldi r23, 0xFF ; 255 1dd80: 80 5b subi r24, 0xB0 ; 176 1dd82: 92 4f sbci r25, 0xF2 ; 242 1dd84: 0f 94 19 dc call 0x3b832 ; 0x3b832 } // 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()); 1dd88: 0e 94 15 71 call 0xe22a ; 0xe22a 1dd8c: 21 e0 ldi r18, 0x01 ; 1 1dd8e: 81 11 cpse r24, r1 1dd90: 20 e0 ldi r18, 0x00 ; 0 1dd92: 41 e0 ldi r20, 0x01 ; 1 1dd94: 70 e0 ldi r23, 0x00 ; 0 1dd96: 60 e0 ldi r22, 0x00 ; 0 1dd98: 80 eb ldi r24, 0xB0 ; 176 1dd9a: 94 ee ldi r25, 0xE4 ; 228 1dd9c: 0f 94 7b d1 call 0x3a2f6 ; 0x3a2f6 } if (lcd_encoder) { 1dda0: 20 91 6f 06 lds r18, 0x066F ; 0x80066f 1dda4: 30 91 70 06 lds r19, 0x0670 ; 0x800670 1dda8: 21 15 cp r18, r1 1ddaa: 31 05 cpc r19, r1 1ddac: 59 f0 breq .+22 ; 0x1ddc4 menuData->reset = lcd_encoder > 0; 1ddae: 81 e0 ldi r24, 0x01 ; 1 1ddb0: 12 16 cp r1, r18 1ddb2: 13 06 cpc r1, r19 1ddb4: 0c f0 brlt .+2 ; 0x1ddb8 1ddb6: 80 e0 ldi r24, 0x00 ; 0 1ddb8: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 lcd_encoder = 0; // Reset 1ddbc: 10 92 70 06 sts 0x0670, r1 ; 0x800670 1ddc0: 10 92 6f 06 sts 0x066F, r1 ; 0x80066f } 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)); 1ddc4: 81 ea ldi r24, 0xA1 ; 161 1ddc6: 9d e0 ldi r25, 0x0D ; 13 1ddc8: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 1ddcc: 1b e0 ldi r17, 0x0B ; 11 1ddce: 81 9f mul r24, r17 1ddd0: b0 01 movw r22, r0 1ddd2: 11 24 eor r1, r1 1ddd4: 67 5b subi r22, 0xB7 ; 183 1ddd6: 72 4f sbci r23, 0xF2 ; 242 1ddd8: 47 e0 ldi r20, 0x07 ; 7 1ddda: 50 e0 ldi r21, 0x00 ; 0 1dddc: ce 01 movw r24, r28 1ddde: 01 96 adiw r24, 0x01 ; 1 1dde0: 7c 01 movw r14, r24 1dde2: 0f 94 c7 db call 0x3b78e ; 0x3b78e lcd_home(); 1dde6: 0e 94 24 6f call 0xde48 ; 0xde48 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]; 1ddea: 81 ea ldi r24, 0xA1 ; 161 1ddec: 9d e0 ldi r25, 0x0D ; 13 1ddee: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 1ddf2: 81 9f mul r24, r17 1ddf4: c0 01 movw r24, r0 1ddf6: 11 24 eor r1, r1 1ddf8: 80 5b subi r24, 0xB0 ; 176 1ddfa: 92 4f sbci r25, 0xF2 ; 242 1ddfc: 0f 94 e5 db call 0x3b7ca ; 0x3b7ca 1de00: bc 01 movw r22, r24 1de02: 99 0f add r25, r25 1de04: 88 0b sbc r24, r24 1de06: 99 0b sbc r25, r25 1de08: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 1de0c: 20 91 c9 0d lds r18, 0x0DC9 ; 0x800dc9 1de10: 30 91 ca 0d lds r19, 0x0DCA ; 0x800dca 1de14: 40 91 cb 0d lds r20, 0x0DCB ; 0x800dcb 1de18: 50 91 cc 0d lds r21, 0x0DCC ; 0x800dcc 1de1c: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 1de20: d6 2e mov r13, r22 1de22: c7 2e mov r12, r23 1de24: b8 2e mov r11, r24 1de26: a9 2e mov r10, r25 lcd_printf_P(_T(MSG_SHEET_OFFSET), 1de28: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 1de2c: 0e e3 ldi r16, 0x3E ; 62 1de2e: 10 e2 ldi r17, 0x20 ; 32 1de30: 81 11 cpse r24, r1 1de32: 02 c0 rjmp .+4 ; 0x1de38 1de34: 00 e2 ldi r16, 0x20 ; 32 1de36: 1e e3 ldi r17, 0x3E ; 62 1de38: 8c e5 ldi r24, 0x5C ; 92 1de3a: 9b e3 ldi r25, 0x3B ; 59 1de3c: 0e 94 c4 72 call 0xe588 ; 0xe588 1de40: 1f 92 push r1 1de42: 0f 93 push r16 1de44: 1f 92 push r1 1de46: 1f 93 push r17 1de48: af 92 push r10 1de4a: bf 92 push r11 1de4c: cf 92 push r12 1de4e: df 92 push r13 1de50: ff 92 push r15 1de52: ef 92 push r14 1de54: 9f 93 push r25 1de56: 8f 93 push r24 1de58: 0e 94 d1 6e call 0xdda2 ; 0xdda2 1de5c: 0f b6 in r0, 0x3f ; 63 1de5e: f8 94 cli 1de60: de bf out 0x3e, r29 ; 62 1de62: 0f be out 0x3f, r0 ; 63 1de64: 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. } 1de66: 27 96 adiw r28, 0x07 ; 7 1de68: 0f b6 in r0, 0x3f ; 63 1de6a: f8 94 cli 1de6c: de bf out 0x3e, r29 ; 62 1de6e: 0f be out 0x3f, r0 ; 63 1de70: cd bf out 0x3d, r28 ; 61 1de72: df 91 pop r29 1de74: cf 91 pop r28 1de76: 1f 91 pop r17 1de78: 0f 91 pop r16 1de7a: ff 90 pop r15 1de7c: ef 90 pop r14 1de7e: df 90 pop r13 1de80: cf 90 pop r12 1de82: bf 90 pop r11 1de84: af 90 pop r10 1de86: 08 95 ret 0001de88 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1de88: 60 91 e0 03 lds r22, 0x03E0 ; 0x8003e0 1de8c: 81 ea ldi r24, 0xA1 ; 161 1de8e: 9d e0 ldi r25, 0x0D ; 13 1de90: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 //! @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(); 1de94: 0c 94 87 ee jmp 0x1dd0e ; 0x1dd0e 0001de98 : return false; } // Parse a major.minor.revision version number. // Return true if valid. bool parse_version(const char *str, uint16_t version[4]) { 1de98: 0f 93 push r16 1de9a: 1f 93 push r17 1de9c: 8b 01 movw r16, r22 for(uint8_t i = 0; i < 2; ++i){ str = Number(str, version + i); 1de9e: 0e 94 b0 cd call 0x19b60 ; 0x19b60 if (*str != '.') 1dea2: fc 01 movw r30, r24 1dea4: 20 81 ld r18, Z 1dea6: 2e 32 cpi r18, 0x2E ; 46 1dea8: 11 f0 breq .+4 ; 0x1deae 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 1deaa: 80 e0 ldi r24, 0x00 ; 0 1deac: 34 c0 rjmp .+104 ; 0x1df16 // 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); 1deae: b8 01 movw r22, r16 1deb0: 6e 5f subi r22, 0xFE ; 254 1deb2: 7f 4f sbci r23, 0xFF ; 255 1deb4: 01 96 adiw r24, 0x01 ; 1 1deb6: 0e 94 b0 cd call 0x19b60 ; 0x19b60 if (*str != '.') 1deba: fc 01 movw r30, r24 1debc: 20 81 ld r18, Z 1debe: 2e 32 cpi r18, 0x2E ; 46 1dec0: a1 f7 brne .-24 ; 0x1deaa return false; ++str; } str = Number(str, version + 2); 1dec2: b8 01 movw r22, r16 1dec4: 6c 5f subi r22, 0xFC ; 252 1dec6: 7f 4f sbci r23, 0xFF ; 255 1dec8: 01 96 adiw r24, 0x01 ; 1 1deca: 0e 94 b0 cd call 0x19b60 ; 0x19b60 version[3] = FIRMWARE_REVISION_RELEASED; 1dece: 20 e4 ldi r18, 0x40 ; 64 1ded0: 30 e0 ldi r19, 0x00 ; 0 1ded2: f8 01 movw r30, r16 1ded4: 37 83 std Z+7, r19 ; 0x07 1ded6: 26 83 std Z+6, r18 ; 0x06 1ded8: fc 01 movw r30, r24 1deda: df 01 movw r26, r30 // skip everything else until eol or '-' for(;;){ if(is_whitespace_or_nl_or_eol(*str)){ 1dedc: 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'; 1dede: 89 2f mov r24, r25 1dee0: 8f 7d andi r24, 0xDF ; 223 1dee2: c1 f1 breq .+112 ; 0x1df54 1dee4: 87 ef ldi r24, 0xF7 ; 247 1dee6: 89 0f add r24, r25 1dee8: 82 30 cpi r24, 0x02 ; 2 1deea: a0 f1 brcs .+104 ; 0x1df54 1deec: 9d 30 cpi r25, 0x0D ; 13 1deee: 91 f1 breq .+100 ; 0x1df54 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 == '-'){ 1def0: 9d 32 cpi r25, 0x2D ; 45 1def2: 99 f7 brne .-26 ; 0x1deda // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); if (*str++ == '-') { switch(*str){ 1def4: 11 96 adiw r26, 0x01 ; 1 1def6: 9c 91 ld r25, X 1def8: 92 34 cpi r25, 0x42 ; 66 1defa: e1 f0 breq .+56 ; 0x1df34 1defc: 7c f4 brge .+30 ; 0x1df1c 1defe: 91 34 cpi r25, 0x41 ; 65 1df00: a1 f6 brne .-88 ; 0x1deaa 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); 1df02: 0a 5f subi r16, 0xFA ; 250 1df04: 1f 4f sbci r17, 0xFF ; 255 1df06: 28 e0 ldi r18, 0x08 ; 8 1df08: 30 e0 ldi r19, 0x00 ; 0 1df0a: 45 e0 ldi r20, 0x05 ; 5 1df0c: 67 e2 ldi r22, 0x27 ; 39 1df0e: 7c e8 ldi r23, 0x8C ; 140 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); 1df10: cf 01 movw r24, r30 1df12: 0e 94 1d cf call 0x19e3a ; 0x19e3a // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); return false; } 1df16: 1f 91 pop r17 1df18: 0f 91 pop r16 1df1a: 08 95 ret // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); if (*str++ == '-') { switch(*str){ 1df1c: 94 34 cpi r25, 0x44 ; 68 1df1e: 91 f0 breq .+36 ; 0x1df44 1df20: 92 35 cpi r25, 0x52 ; 82 1df22: 19 f6 brne .-122 ; 0x1deaa 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); 1df24: 0a 5f subi r16, 0xFA ; 250 1df26: 1f 4f sbci r17, 0xFF ; 255 1df28: 20 e2 ldi r18, 0x20 ; 32 1df2a: 30 e0 ldi r19, 0x00 ; 0 1df2c: 42 e0 ldi r20, 0x02 ; 2 1df2e: 6b e1 ldi r22, 0x1B ; 27 1df30: 7c e8 ldi r23, 0x8C ; 140 1df32: ee cf rjmp .-36 ; 0x1df10 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); 1df34: 0a 5f subi r16, 0xFA ; 250 1df36: 1f 4f sbci r17, 0xFF ; 255 1df38: 20 e1 ldi r18, 0x10 ; 16 1df3a: 30 e0 ldi r19, 0x00 ; 0 1df3c: 44 e0 ldi r20, 0x04 ; 4 1df3e: 62 e2 ldi r22, 0x22 ; 34 1df40: 7c e8 ldi r23, 0x8C ; 140 1df42: e6 cf rjmp .-52 ; 0x1df10 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); 1df44: 0a 5f subi r16, 0xFA ; 250 1df46: 1f 4f sbci r17, 0xFF ; 255 1df48: 30 e0 ldi r19, 0x00 ; 0 1df4a: 20 e0 ldi r18, 0x00 ; 0 1df4c: 43 e0 ldi r20, 0x03 ; 3 1df4e: 6e e1 ldi r22, 0x1E ; 30 1df50: 7c e8 ldi r23, 0x8C ; 140 1df52: de cf rjmp .-68 ; 0x1df10 // 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; 1df54: 81 e0 ldi r24, 0x01 ; 1 1df56: df cf rjmp .-66 ; 0x1df16 0001df58 : /// (which would be obviously too late for an improperly sized motor) /// For farm printing, the cooler E-motor is enabled by default. bool UserECoolEnabled(){ // We enable E-cool mode for non-farm prints IFF the experimental menu is visible AND the EEPROM_ECOOL variable has // a value of the universal answer to all problems of the universe return ( eeprom_read_byte((uint8_t *)EEPROM_ECOOL_ENABLE) == EEPROM_ECOOL_MAGIC_NUMBER ) 1df58: 84 e0 ldi r24, 0x04 ; 4 1df5a: 9d e0 ldi r25, 0x0D ; 13 1df5c: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae && ( eeprom_read_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY) == 1 ); 1df60: 8a 32 cpi r24, 0x2A ; 42 1df62: 39 f4 brne .+14 ; 0x1df72 1df64: 8a e2 ldi r24, 0x2A ; 42 1df66: 9d e0 ldi r25, 0x0D ; 13 1df68: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 1df6c: 91 e0 ldi r25, 0x01 ; 1 1df6e: 81 30 cpi r24, 0x01 ; 1 1df70: 09 f0 breq .+2 ; 0x1df74 1df72: 90 e0 ldi r25, 0x00 ; 0 } 1df74: 89 2f mov r24, r25 1df76: 08 95 ret 0001df78 : } #endif //PRUSA_SN_SUPPORT void lcd_experimental_menu() { MENU_BEGIN(); 1df78: 0f 94 51 d1 call 0x3a2a2 ; 0x3a2a2 1df7c: 10 92 11 05 sts 0x0511, r1 ; 0x800511 1df80: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1df84: 84 30 cpi r24, 0x04 ; 4 1df86: 70 f5 brcc .+92 ; 0x1dfe4 1df88: 10 92 14 05 sts 0x0514, r1 ; 0x800514 MENU_ITEM_BACK_P(_T(MSG_BACK)); 1df8c: 8c eb ldi r24, 0xBC ; 188 1df8e: 99 e4 ldi r25, 0x49 ; 73 1df90: 0e 94 c4 72 call 0xe588 ; 0xe588 1df94: 0f 94 1c d4 call 0x3a838 ; 0x3a838 #ifdef EXTRUDER_ALTFAN_DETECT MENU_ITEM_TOGGLE_P(_N("ALTFAN det."), altfanOverride_get()?_T(MSG_OFF):_T(MSG_ON), altfanOverride_toggle);////MSG_MENU_ALTFAN c=18 #endif //EXTRUDER_ALTFAN_DETECT #ifdef TMC2130 MENU_ITEM_TOGGLE_P(_N("E-cool mode"), UserECoolEnabled()?_T(MSG_ON):_T(MSG_OFF), UserECool_toggle);////MSG_MENU_ECOOL c=18 1df98: 0e 94 ac ef call 0x1df58 ; 0x1df58 1df9c: 88 23 and r24, r24 1df9e: f9 f0 breq .+62 ; 0x1dfde 1dfa0: 83 e1 ldi r24, 0x13 ; 19 1dfa2: 9d e5 ldi r25, 0x5D ; 93 1dfa4: 0e 94 c4 72 call 0xe588 ; 0xe588 1dfa8: 22 e0 ldi r18, 0x02 ; 2 1dfaa: 43 ef ldi r20, 0xF3 ; 243 1dfac: 5f ee ldi r21, 0xEF ; 239 1dfae: bc 01 movw r22, r24 1dfb0: 86 ef ldi r24, 0xF6 ; 246 1dfb2: 9b e6 ldi r25, 0x6B ; 107 1dfb4: 0f 94 e0 d2 call 0x3a5c0 ; 0x3a5c0 #ifdef DEBUG_PULLUP_CRASH MENU_ITEM_FUNCTION_P(_N("Test Pullup Crash"), TestPullupCrash); #endif // DEBUG_PULLUP_CRASH #ifdef PRUSA_SN_SUPPORT MENU_ITEM_FUNCTION_P(_N("Fake serial number"), WorkaroundPrusaSN);////MSG_WORKAROUND_PRUSA_SN c=18 1dfb8: 63 e5 ldi r22, 0x53 ; 83 1dfba: 7f ec ldi r23, 0xCF ; 207 1dfbc: 83 ee ldi r24, 0xE3 ; 227 1dfbe: 9b e6 ldi r25, 0x6B ; 107 1dfc0: 0f 94 ce d0 call 0x3a19c ; 0x3a19c #endif //PRUSA_SN_SUPPORT MENU_END(); 1dfc4: 0f 94 25 d1 call 0x3a24a ; 0x3a24a } #endif //PRUSA_SN_SUPPORT void lcd_experimental_menu() { MENU_BEGIN(); 1dfc8: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1dfcc: 8f 5f subi r24, 0xFF ; 255 1dfce: 80 93 11 05 sts 0x0511, r24 ; 0x800511 1dfd2: 80 91 13 05 lds r24, 0x0513 ; 0x800513 1dfd6: 8f 5f subi r24, 0xFF ; 255 1dfd8: 80 93 13 05 sts 0x0513, r24 ; 0x800513 1dfdc: d1 cf rjmp .-94 ; 0x1df80 #ifdef EXTRUDER_ALTFAN_DETECT MENU_ITEM_TOGGLE_P(_N("ALTFAN det."), altfanOverride_get()?_T(MSG_OFF):_T(MSG_ON), altfanOverride_toggle);////MSG_MENU_ALTFAN c=18 #endif //EXTRUDER_ALTFAN_DETECT #ifdef TMC2130 MENU_ITEM_TOGGLE_P(_N("E-cool mode"), UserECoolEnabled()?_T(MSG_ON):_T(MSG_OFF), UserECool_toggle);////MSG_MENU_ECOOL c=18 1dfde: 8d e0 ldi r24, 0x0D ; 13 1dfe0: 9d e5 ldi r25, 0x5D ; 93 1dfe2: e0 cf rjmp .-64 ; 0x1dfa4 #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(); } 1dfe4: 08 95 ret 0001dfe6 : prusa_statistics_update_from_lcd_update(); if (lcd_commands_type == LcdCommands::Layer1Cal) lcd_commands(); } #ifdef TMC2130 void UserECool_toggle(){ 1dfe6: cf 93 push r28 // this is only called when the experimental menu is visible, thus the first condition for enabling of the ECool mode is met in this place // The condition is intentionally inverted as we are toggling the state (i.e. if it was enabled, we are disabling the feature and vice versa) bool enable = ! UserECoolEnabled(); 1dfe8: 0e 94 ac ef call 0x1df58 ; 0x1df58 1dfec: c1 e0 ldi r28, 0x01 ; 1 1dfee: c8 27 eor r28, r24 eeprom_update_byte_notify((uint8_t *)EEPROM_ECOOL_ENABLE, enable ? EEPROM_ECOOL_MAGIC_NUMBER : EEPROM_EMPTY_VALUE); 1dff0: 6f ef ldi r22, 0xFF ; 255 1dff2: 09 f0 breq .+2 ; 0x1dff6 1dff4: 6a e2 ldi r22, 0x2A ; 42 1dff6: 84 e0 ldi r24, 0x04 ; 4 1dff8: 9d e0 ldi r25, 0x0D ; 13 1dffa: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 1 #else 0 #endif ) , enableECool(enableECool) { } 1dffe: 8c 2f mov r24, r28 1e000: 88 0f add r24, r24 // @@TODO I don't like this - disabling the experimental menu shall disable ECool mode, but it will not reinit the TMC // and I don't want to add more code for this experimental feature ... ideally do not reinit the TMC here at all and let the user reset the printer. tmc2130_init(TMCInitParams(enable)); 1e002: 82 70 andi r24, 0x02 ; 2 } 1e004: cf 91 pop r28 eeprom_update_byte_notify((uint8_t *)EEPROM_ECOOL_ENABLE, enable ? EEPROM_ECOOL_MAGIC_NUMBER : EEPROM_EMPTY_VALUE); // @@TODO I don't like this - disabling the experimental menu shall disable ECool mode, but it will not reinit the TMC // and I don't want to add more code for this experimental feature ... ideally do not reinit the TMC here at all and let the user reset the printer. tmc2130_init(TMCInitParams(enable)); 1e006: 0d 94 36 26 jmp 0x24c6c ; 0x24c6c 0001e00a : eeprom_toggle((uint8_t*)EEPROM_MMU_STEALTH); } #endif //MMU_FORCE_STEALTH_MODE static void lcd_silent_mode_set() { switch (SilentModeMenu) { 1e00a: 80 91 a2 03 lds r24, 0x03A2 ; 0x8003a2 1e00e: 81 11 cpse r24, r1 1e010: 3c c0 rjmp .+120 ; 0x1e08a #ifdef TMC2130 case SILENT_MODE_NORMAL: SilentModeMenu = SILENT_MODE_STEALTH; break; 1e012: 81 e0 ldi r24, 0x01 ; 1 1e014: 80 93 a2 03 sts 0x03A2, r24 ; 0x8003a2 1e018: 60 91 a2 03 lds r22, 0x03A2 ; 0x8003a2 1e01c: 8f ef ldi r24, 0xFF ; 255 1e01e: 9f e0 ldi r25, 0x0F ; 15 1e020: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 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); 1e024: 90 91 a4 0d lds r25, 0x0DA4 ; 0x800da4 1e028: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 default: SilentModeMenu = SILENT_MODE_POWER; break; // (probably) not needed #endif //TMC2130 } eeprom_update_byte_notify((unsigned char *)EEPROM_SILENT, SilentModeMenu); #ifdef TMC2130 if (blocks_queued()) 1e02c: 98 17 cp r25, r24 1e02e: 41 f0 breq .+16 ; 0x1e040 { lcd_display_message_fullscreen_P(_T(MSG_MODE_CHANGE_IN_PROGRESS)); 1e030: 84 e1 ldi r24, 0x14 ; 20 1e032: 9b e3 ldi r25, 0x3B ; 59 1e034: 0e 94 c4 72 call 0xe588 ; 0xe588 1e038: 0f 94 ba 1f call 0x23f74 ; 0x23f74 // Wait until the planner queue is drained and the stepper routine achieves // an idle state. st_synchronize(); 1e03c: 0f 94 a3 42 call 0x28546 ; 0x28546 } tmc2130_wait_standstill_xy(1000); 1e040: 0f 94 d3 87 call 0x30fa6 ; 0x30fa6 cli(); 1e044: f8 94 cli tmc2130_mode = (SilentModeMenu != SILENT_MODE_NORMAL)?TMC2130_MODE_SILENT:TMC2130_MODE_NORMAL; 1e046: 81 e0 ldi r24, 0x01 ; 1 1e048: 90 91 a2 03 lds r25, 0x03A2 ; 0x8003a2 1e04c: 91 11 cpse r25, r1 1e04e: 01 c0 rjmp .+2 ; 0x1e052 1e050: 80 e0 ldi r24, 0x00 ; 0 1e052: 80 93 8b 06 sts 0x068B, r24 ; 0x80068b update_mode_profile(); 1e056: 0f 94 5c 63 call 0x2c6b8 ; 0x2c6b8 return ( eeprom_read_byte((uint8_t *)EEPROM_ECOOL_ENABLE) == EEPROM_ECOOL_MAGIC_NUMBER ) && ( eeprom_read_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY) == 1 ); } bool FarmOrUserECool(){ return farm_mode || UserECoolEnabled(); 1e05a: 0e 94 ac ef call 0x1df58 ; 0x1df58 struct TMCInitParams { uint8_t bSuppressFlag : 1; // only relevant on MK3S with PSU_Delta uint8_t enableECool : 1; // experimental support for E-motor cooler operation inline TMCInitParams():bSuppressFlag(0), enableECool(0) { } inline explicit TMCInitParams(bool bSuppressFlag, bool enableECool):bSuppressFlag(bSuppressFlag), enableECool(enableECool) { } 1e05e: 88 0f add r24, r24 } tmc2130_wait_standstill_xy(1000); cli(); tmc2130_mode = (SilentModeMenu != SILENT_MODE_NORMAL)?TMC2130_MODE_SILENT:TMC2130_MODE_NORMAL; update_mode_profile(); tmc2130_init(TMCInitParams(false, FarmOrUserECool())); 1e060: 82 70 andi r24, 0x02 ; 2 1e062: 0f 94 36 26 call 0x24c6c ; 0x24c6c // 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(); 1e066: 0f 94 fd 42 call 0x285fa ; 0x285fa sei(); 1e06a: 78 94 sei #else st_current_init(); #endif //TMC2130 #ifdef TMC2130 if (eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET) && (SilentModeMenu != SILENT_MODE_NORMAL)) 1e06c: 89 e6 ldi r24, 0x69 ; 105 1e06e: 9f e0 ldi r25, 0x0F ; 15 1e070: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 1e074: 88 23 and r24, r24 1e076: 61 f0 breq .+24 ; 0x1e090 1e078: 80 91 a2 03 lds r24, 0x03A2 ; 0x8003a2 1e07c: 88 23 and r24, r24 1e07e: 41 f0 breq .+16 ; 0x1e090 menu_submenu(lcd_crash_mode_info2); 1e080: 60 e0 ldi r22, 0x00 ; 0 1e082: 89 e1 ldi r24, 0x19 ; 25 1e084: 9f ed ldi r25, 0xDF ; 223 1e086: 0d 94 be d2 jmp 0x3a57c ; 0x3a57c static void lcd_silent_mode_set() { switch (SilentModeMenu) { #ifdef TMC2130 case SILENT_MODE_NORMAL: SilentModeMenu = SILENT_MODE_STEALTH; break; case SILENT_MODE_STEALTH: SilentModeMenu = SILENT_MODE_NORMAL; break; 1e08a: 10 92 a2 03 sts 0x03A2, r1 ; 0x8003a2 1e08e: c4 cf rjmp .-120 ; 0x1e018 #ifdef TMC2130 if (eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET) && (SilentModeMenu != SILENT_MODE_NORMAL)) menu_submenu(lcd_crash_mode_info2); #endif //TMC2130 } 1e090: 08 95 ret 0001e092 : lcd_update(2); } #ifdef TMC2130 void lcd_settings_linearity_correction_menu(void) { 1e092: df 92 push r13 1e094: ef 92 push r14 1e096: ff 92 push r15 1e098: 0f 93 push r16 1e09a: 1f 93 push r17 1e09c: cf 93 push r28 1e09e: df 93 push r29 MENU_BEGIN(); 1e0a0: 0f 94 51 d1 call 0x3a2a2 ; 0x3a2a2 1e0a4: 10 92 11 05 sts 0x0511, r1 ; 0x800511 1e0a8: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1e0ac: 84 30 cpi r24, 0x04 ; 4 1e0ae: 08 f0 brcs .+2 ; 0x1e0b2 1e0b0: 66 c0 rjmp .+204 ; 0x1e17e 1e0b2: 10 92 14 05 sts 0x0514, r1 ; 0x800514 ON_MENU_LEAVE( 1e0b6: 0f 94 d1 cf call 0x39fa2 ; 0x39fa2 1e0ba: 88 23 and r24, r24 1e0bc: e9 f0 breq .+58 ; 0x1e0f8 1e0be: 08 ef ldi r16, 0xF8 ; 248 1e0c0: 14 e0 ldi r17, 0x04 ; 4 1e0c2: c7 ef ldi r28, 0xF7 ; 247 1e0c4: de e0 ldi r29, 0x0E ; 14 #ifdef TMC2130 static void lcd_settings_linearity_correction_menu_save() { for (uint8_t axis = 0; axis < NUM_AXIS; axis++) { if (tmc2130_wave_fac[axis] < TMC2130_WAVE_FAC1000_MIN) { 1e0c6: f8 01 movw r30, r16 1e0c8: 80 81 ld r24, Z 1e0ca: 8e 31 cpi r24, 0x1E ; 30 1e0cc: 08 f4 brcc .+2 ; 0x1e0d0 tmc2130_wave_fac[axis] = 0; 1e0ce: 10 82 st Z, r1 1e0d0: f8 01 movw r30, r16 1e0d2: 61 91 ld r22, Z+ 1e0d4: 8f 01 movw r16, r30 1e0d6: ce 01 movw r24, r28 1e0d8: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 1e0dc: 21 97 sbiw r28, 0x01 ; 1 MENU_END(); } #ifdef TMC2130 static void lcd_settings_linearity_correction_menu_save() { for (uint8_t axis = 0; axis < NUM_AXIS; axis++) { 1e0de: c3 3f cpi r28, 0xF3 ; 243 1e0e0: fe e0 ldi r31, 0x0E ; 14 1e0e2: df 07 cpc r29, r31 1e0e4: 81 f7 brne .-32 ; 0x1e0c6 return ( eeprom_read_byte((uint8_t *)EEPROM_ECOOL_ENABLE) == EEPROM_ECOOL_MAGIC_NUMBER ) && ( eeprom_read_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY) == 1 ); } bool FarmOrUserECool(){ return farm_mode || UserECoolEnabled(); 1e0e6: 0e 94 ac ef call 0x1df58 ; 0x1df58 1e0ea: e8 94 clt 1e0ec: d0 f8 bld r13, 0 1e0ee: 80 fb bst r24, 0 1e0f0: d1 f8 bld r13, 1 eeprom_update_byte_notify((uint8_t*)EEPROM_TMC2130_WAVE_X_FAC - axis, tmc2130_wave_fac[axis]); } // Re-init the TMC2130 driver to apply changes, if any tmc2130_init(TMCInitParams(false, FarmOrUserECool())); 1e0f2: 8d 2d mov r24, r13 1e0f4: 0f 94 36 26 call 0x24c6c ; 0x24c6c { MENU_BEGIN(); ON_MENU_LEAVE( lcd_settings_linearity_correction_menu_save(); ); MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); 1e0f8: 86 e4 ldi r24, 0x46 ; 70 1e0fa: 98 e4 ldi r25, 0x48 ; 72 1e0fc: 0e 94 c4 72 call 0xe588 ; 0xe588 1e100: 0f 94 1c d4 call 0x3a838 ; 0x3a838 #ifdef TMC2130_LINEARITY_CORRECTION_XYZ MENU_ITEM_EDIT_int3_P(_T(MSG_X_CORRECTION), &tmc2130_wave_fac[X_AXIS], TMC2130_WAVE_FAC1000_MIN-TMC2130_WAVE_FAC1000_STP, TMC2130_WAVE_FAC1000_MAX); 1e104: 8c e6 ldi r24, 0x6C ; 108 1e106: 93 e4 ldi r25, 0x43 ; 67 1e108: 0e 94 c4 72 call 0xe588 ; 0xe588 1e10c: f1 2c mov r15, r1 1e10e: e1 2c mov r14, r1 1e110: 08 ec ldi r16, 0xC8 ; 200 1e112: 10 e0 ldi r17, 0x00 ; 0 1e114: 2d e1 ldi r18, 0x1D ; 29 1e116: 30 e0 ldi r19, 0x00 ; 0 1e118: 48 e0 ldi r20, 0x08 ; 8 1e11a: 68 ef ldi r22, 0xF8 ; 248 1e11c: 74 e0 ldi r23, 0x04 ; 4 1e11e: 0f 94 a1 d1 call 0x3a342 ; 0x3a342 MENU_ITEM_EDIT_int3_P(_T(MSG_Y_CORRECTION), &tmc2130_wave_fac[Y_AXIS], TMC2130_WAVE_FAC1000_MIN-TMC2130_WAVE_FAC1000_STP, TMC2130_WAVE_FAC1000_MAX); 1e122: 80 e6 ldi r24, 0x60 ; 96 1e124: 93 e4 ldi r25, 0x43 ; 67 1e126: 0e 94 c4 72 call 0xe588 ; 0xe588 1e12a: 2d e1 ldi r18, 0x1D ; 29 1e12c: 30 e0 ldi r19, 0x00 ; 0 1e12e: 48 e0 ldi r20, 0x08 ; 8 1e130: 69 ef ldi r22, 0xF9 ; 249 1e132: 74 e0 ldi r23, 0x04 ; 4 1e134: 0f 94 a1 d1 call 0x3a342 ; 0x3a342 MENU_ITEM_EDIT_int3_P(_T(MSG_Z_CORRECTION), &tmc2130_wave_fac[Z_AXIS], TMC2130_WAVE_FAC1000_MIN-TMC2130_WAVE_FAC1000_STP, TMC2130_WAVE_FAC1000_MAX); 1e138: 84 e5 ldi r24, 0x54 ; 84 1e13a: 93 e4 ldi r25, 0x43 ; 67 1e13c: 0e 94 c4 72 call 0xe588 ; 0xe588 1e140: 2d e1 ldi r18, 0x1D ; 29 1e142: 30 e0 ldi r19, 0x00 ; 0 1e144: 48 e0 ldi r20, 0x08 ; 8 1e146: 6a ef ldi r22, 0xFA ; 250 1e148: 74 e0 ldi r23, 0x04 ; 4 1e14a: 0f 94 a1 d1 call 0x3a342 ; 0x3a342 #endif //TMC2130_LINEARITY_CORRECTION_XYZ MENU_ITEM_EDIT_int3_P(_T(MSG_EXTRUDER_CORRECTION), &tmc2130_wave_fac[E_AXIS], TMC2130_WAVE_FAC1000_MIN-TMC2130_WAVE_FAC1000_STP, TMC2130_WAVE_FAC1000_MAX); 1e14e: 88 e4 ldi r24, 0x48 ; 72 1e150: 93 e4 ldi r25, 0x43 ; 67 1e152: 0e 94 c4 72 call 0xe588 ; 0xe588 1e156: 2d e1 ldi r18, 0x1D ; 29 1e158: 30 e0 ldi r19, 0x00 ; 0 1e15a: 48 e0 ldi r20, 0x08 ; 8 1e15c: 6b ef ldi r22, 0xFB ; 251 1e15e: 74 e0 ldi r23, 0x04 ; 4 1e160: 0f 94 a1 d1 call 0x3a342 ; 0x3a342 MENU_END(); 1e164: 0f 94 25 d1 call 0x3a24a ; 0x3a24a } #ifdef TMC2130 void lcd_settings_linearity_correction_menu(void) { MENU_BEGIN(); 1e168: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1e16c: 8f 5f subi r24, 0xFF ; 255 1e16e: 80 93 11 05 sts 0x0511, r24 ; 0x800511 1e172: 80 91 13 05 lds r24, 0x0513 ; 0x800513 1e176: 8f 5f subi r24, 0xFF ; 255 1e178: 80 93 13 05 sts 0x0513, r24 ; 0x800513 1e17c: 95 cf rjmp .-214 ; 0x1e0a8 MENU_ITEM_EDIT_int3_P(_T(MSG_Y_CORRECTION), &tmc2130_wave_fac[Y_AXIS], TMC2130_WAVE_FAC1000_MIN-TMC2130_WAVE_FAC1000_STP, TMC2130_WAVE_FAC1000_MAX); MENU_ITEM_EDIT_int3_P(_T(MSG_Z_CORRECTION), &tmc2130_wave_fac[Z_AXIS], TMC2130_WAVE_FAC1000_MIN-TMC2130_WAVE_FAC1000_STP, TMC2130_WAVE_FAC1000_MAX); #endif //TMC2130_LINEARITY_CORRECTION_XYZ MENU_ITEM_EDIT_int3_P(_T(MSG_EXTRUDER_CORRECTION), &tmc2130_wave_fac[E_AXIS], TMC2130_WAVE_FAC1000_MIN-TMC2130_WAVE_FAC1000_STP, TMC2130_WAVE_FAC1000_MAX); MENU_END(); } 1e17e: df 91 pop r29 1e180: cf 91 pop r28 1e182: 1f 91 pop r17 1e184: 0f 91 pop r16 1e186: ff 90 pop r15 1e188: ef 90 pop r14 1e18a: df 90 pop r13 1e18c: 08 95 ret 0001e18e : } static void lcd_updatestatus(const char *message, bool progmem = false) { if (progmem) strncpy_P(lcd_status_message, message, LCD_WIDTH); 1e18e: 44 e1 ldi r20, 0x14 ; 20 1e190: 50 e0 ldi r21, 0x00 ; 0 return false; } static void lcd_updatestatus(const char *message, bool progmem = false) { if (progmem) 1e192: 66 23 and r22, r22 1e194: 89 f0 breq .+34 ; 0x1e1b8 strncpy_P(lcd_status_message, message, LCD_WIDTH); 1e196: bc 01 movw r22, r24 1e198: 8e e1 ldi r24, 0x1E ; 30 1e19a: 95 e0 ldi r25, 0x05 ; 5 1e19c: 0f 94 c4 d9 call 0x3b388 ; 0x3b388 else strncpy(lcd_status_message, message, LCD_WIDTH); lcd_status_message[LCD_WIDTH] = 0; 1e1a0: 10 92 32 05 sts 0x0532, r1 ; 0x800532 <_ZL18lcd_status_message.lto_priv.453+0x14> lcd_status_message_idx = 0; // Print message from beginning 1e1a4: 10 92 1d 05 sts 0x051D, r1 ; 0x80051d <_ZL22lcd_status_message_idx.lto_priv.448> SERIAL_PROTOCOLLNRPGM(MSG_LCD_STATUS_CHANGED); 1e1a8: 8f eb ldi r24, 0xBF ; 191 1e1aa: 9b e6 ldi r25, 0x6B ; 107 1e1ac: 0e 94 93 79 call 0xf326 ; 0xf326 // hack lcd_draw_update to 1, i.e. without clear lcd_draw_update = 1; 1e1b0: 81 e0 ldi r24, 0x01 ; 1 1e1b2: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } 1e1b6: 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); 1e1b8: bc 01 movw r22, r24 1e1ba: 8e e1 ldi r24, 0x1E ; 30 1e1bc: 95 e0 ldi r25, 0x05 ; 5 1e1be: 0f 94 57 e2 call 0x3c4ae ; 0x3c4ae 1e1c2: ee cf rjmp .-36 ; 0x1e1a0 0001e1c4 : } static bool lcd_message_check(uint8_t priority) { // regular priority check if (priority >= lcd_status_message_level) 1e1c4: 90 91 d3 03 lds r25, 0x03D3 ; 0x8003d3 <_ZL24lcd_status_message_level.lto_priv.451> 1e1c8: 89 17 cp r24, r25 1e1ca: 80 f4 brcc .+32 ; 0x1e1ec return true; // check if we can override an info message yet if (lcd_status_message_level == LCD_STATUS_INFO) { 1e1cc: 91 30 cpi r25, 0x01 ; 1 1e1ce: 61 f4 brne .+24 ; 0x1e1e8 } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 1e1d0: 80 91 33 05 lds r24, 0x0533 ; 0x800533 <_ZL26lcd_status_message_timeout.lto_priv.452> 1e1d4: 88 23 and r24, r24 1e1d6: 51 f0 breq .+20 ; 0x1e1ec 1e1d8: 40 e2 ldi r20, 0x20 ; 32 1e1da: 5e e4 ldi r21, 0x4E ; 78 1e1dc: 60 e0 ldi r22, 0x00 ; 0 1e1de: 70 e0 ldi r23, 0x00 ; 0 1e1e0: 83 e3 ldi r24, 0x33 ; 51 1e1e2: 95 e0 ldi r25, 0x05 ; 5 1e1e4: 0d 94 06 2a jmp 0x2540c ; 0x2540c ::expired(unsigned long)> return lcd_status_message_timeout.expired_cont(LCD_STATUS_INFO_TIMEOUT); } return false; 1e1e8: 80 e0 ldi r24, 0x00 ; 0 1e1ea: 08 95 ret static bool lcd_message_check(uint8_t priority) { // regular priority check if (priority >= lcd_status_message_level) return true; 1e1ec: 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; } 1e1ee: 08 95 ret 0001e1f0 : { lcd_setalertstatus_(message, severity, false); } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { 1e1f0: ef 92 push r14 1e1f2: ff 92 push r15 1e1f4: 1f 93 push r17 1e1f6: cf 93 push r28 1e1f8: df 93 push r29 1e1fa: ec 01 movw r28, r24 1e1fc: 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)) { 1e1fe: 86 2f mov r24, r22 1e200: 0e 94 e2 f0 call 0x1e1c4 ; 0x1e1c4 1e204: 88 23 and r24, r24 1e206: e9 f0 breq .+58 ; 0x1e242 bool same = !(progmem? strcmp_P(lcd_status_message, message): 1e208: be 01 movw r22, r28 1e20a: 8e e1 ldi r24, 0x1E ; 30 1e20c: 95 e0 ldi r25, 0x05 ; 5 1e20e: 0f 94 85 d9 call 0x3b30a ; 0x3b30a 1e212: 7c 01 movw r14, r24 strcmp(lcd_status_message, message)); lcd_status_message_timeout.start(); 1e214: 83 e3 ldi r24, 0x33 ; 51 1e216: 95 e0 ldi r25, 0x05 ; 5 1e218: 0f 94 c5 2b call 0x2578a ; 0x2578a ::start()> lcd_status_message_level = severity; 1e21c: 10 93 d3 03 sts 0x03D3, r17 ; 0x8003d3 <_ZL24lcd_status_message_level.lto_priv.451> custom_message_type = CustomMsg::Status; 1e220: 10 92 c3 06 sts 0x06C3, r1 ; 0x8006c3 custom_message_state = 0; 1e224: 10 92 f6 03 sts 0x03F6, r1 ; 0x8003f6 if (!same) { 1e228: ef 28 or r14, r15 1e22a: 59 f0 breq .+22 ; 0x1e242 // do not kick the user out of the menus if the message is unchanged lcd_updatestatus(message, progmem); 1e22c: 61 e0 ldi r22, 0x01 ; 1 1e22e: ce 01 movw r24, r28 1e230: 0e 94 c7 f0 call 0x1e18e ; 0x1e18e } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { lcd_setalertstatus_(message, severity, true); } 1e234: df 91 pop r29 1e236: cf 91 pop r28 1e238: 1f 91 pop r17 1e23a: ff 90 pop r15 1e23c: 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(); 1e23e: 0d 94 7c 1e jmp 0x23cf8 ; 0x23cf8 } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { lcd_setalertstatus_(message, severity, true); } 1e242: df 91 pop r29 1e244: cf 91 pop r28 1e246: 1f 91 pop r17 1e248: ff 90 pop r15 1e24a: ef 90 pop r14 1e24c: 08 95 ret 0001e24e : if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message, true); } void lcd_setstatus_serial(const char* message) { 1e24e: cf 93 push r28 1e250: df 93 push r29 1e252: ec 01 movw r28, r24 if (lcd_message_check(LCD_STATUS_NONE)) 1e254: 80 e0 ldi r24, 0x00 ; 0 1e256: 0e 94 e2 f0 call 0x1e1c4 ; 0x1e1c4 1e25a: 88 23 and r24, r24 1e25c: 21 f0 breq .+8 ; 0x1e266 lcd_updatestatus(message); 1e25e: 60 e0 ldi r22, 0x00 ; 0 1e260: ce 01 movw r24, r28 1e262: 0e 94 c7 f0 call 0x1e18e ; 0x1e18e SERIAL_ECHOLN(message); 1e266: ce 01 movw r24, r28 } 1e268: df 91 pop r29 1e26a: cf 91 pop r28 void lcd_setstatus_serial(const char* message) { if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message); SERIAL_ECHOLN(message); 1e26c: 0d 94 bb d5 jmp 0x3ab76 ; 0x3ab76 0001e270 : void lcd_getstatus(char buf[LCD_WIDTH]) { strncpy(buf, lcd_status_message, LCD_WIDTH); } void lcd_setstatuspgm(const char* message) { 1e270: cf 93 push r28 1e272: df 93 push r29 1e274: ec 01 movw r28, r24 if (lcd_message_check(LCD_STATUS_NONE)) 1e276: 80 e0 ldi r24, 0x00 ; 0 1e278: 0e 94 e2 f0 call 0x1e1c4 ; 0x1e1c4 1e27c: 88 23 and r24, r24 1e27e: 31 f0 breq .+12 ; 0x1e28c lcd_updatestatus(message, true); 1e280: 61 e0 ldi r22, 0x01 ; 1 1e282: ce 01 movw r24, r28 } 1e284: df 91 pop r29 1e286: cf 91 pop r28 } void lcd_setstatuspgm(const char* message) { if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message, true); 1e288: 0c 94 c7 f0 jmp 0x1e18e ; 0x1e18e } 1e28c: df 91 pop r29 1e28e: cf 91 pop r28 1e290: 08 95 ret 0001e292 : MENU_ITEM_FUNCTION_P(_T(MSG_YES), lcd_print_stop); MENU_END(); } void lcd_sdcard_menu() { 1e292: 2f 92 push r2 1e294: 3f 92 push r3 1e296: 4f 92 push r4 1e298: 5f 92 push r5 1e29a: 6f 92 push r6 1e29c: 7f 92 push r7 1e29e: 8f 92 push r8 1e2a0: 9f 92 push r9 1e2a2: af 92 push r10 1e2a4: bf 92 push r11 1e2a6: cf 92 push r12 1e2a8: df 92 push r13 1e2aa: ef 92 push r14 1e2ac: ff 92 push r15 1e2ae: 0f 93 push r16 1e2b0: 1f 93 push r17 1e2b2: cf 93 push r28 1e2b4: df 93 push r29 1e2b6: cd b7 in r28, 0x3d ; 61 1e2b8: de b7 in r29, 0x3e ; 62 1e2ba: 2d 97 sbiw r28, 0x0d ; 13 1e2bc: 0f b6 in r0, 0x3f ; 63 1e2be: f8 94 cli 1e2c0: de bf out 0x3e, r29 ; 62 1e2c2: 0f be out 0x3f, r0 ; 63 1e2c4: 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) 1e2c6: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 1e2ca: 81 30 cpi r24, 0x01 ; 1 1e2cc: 31 f1 breq .+76 ; 0x1e31a 1e2ce: 30 f0 brcs .+12 ; 0x1e2dc 1e2d0: 82 30 cpi r24, 0x02 ; 2 1e2d2: 09 f4 brne .+2 ; 0x1e2d6 1e2d4: 7d c2 rjmp .+1274 ; 0x1e7d0 { _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. 1e2d6: 10 92 a7 03 sts 0x03A7, r1 ; 0x8003a7 1e2da: fe c0 rjmp .+508 ; 0x1e4d8 switch(_md->menuState) { case _uninitialized: //Initialize menu data { if (card.presort_flag == true) //used to force resorting if sorting type is changed. 1e2dc: 80 91 de 14 lds r24, 0x14DE ; 0x8014de 1e2e0: 88 23 and r24, r24 1e2e2: 49 f0 breq .+18 ; 0x1e2f6 { card.presort_flag = false; 1e2e4: 10 92 de 14 sts 0x14DE, r1 ; 0x8014de lcd_update_enabled = false; 1e2e8: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e card.presort(); 1e2ec: 0f 94 4d 7c call 0x2f89a ; 0x2f89a lcd_update_enabled = true; 1e2f0: 81 e0 ldi r24, 0x01 ; 1 1e2f2: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e } _md->fileCnt = card.getnrfilenames(); 1e2f6: 0f 94 8f 79 call 0x2f31e ; 0x2f31e 1e2fa: 90 93 af 03 sts 0x03AF, r25 ; 0x8003af 1e2fe: 80 93 ae 03 sts 0x03AE, r24 ; 0x8003ae _md->sdSort = farm_mode ? SD_SORT_NONE : eeprom_read_byte((uint8_t*)EEPROM_SD_SORT); 1e302: 89 e0 ldi r24, 0x09 ; 9 1e304: 9f e0 ldi r25, 0x0F ; 15 1e306: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 1e30a: 80 93 b1 03 sts 0x03B1, r24 ; 0x8003b1 _md->menuState = _standard; 1e30e: 81 e0 ldi r24, 0x01 ; 1 1e310: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 _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. 1e314: 8f ef ldi r24, 0xFF ; 255 1e316: 80 93 b0 03 sts 0x03B0, r24 ; 0x8003b0 } // 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. 1e31a: 80 91 b2 03 lds r24, 0x03B2 ; 0x8003b2 1e31e: 81 11 cpse r24, r1 1e320: 07 c0 rjmp .+14 ; 0x1e330 { _md->lcd_scrollTimer.start(); 1e322: 82 eb ldi r24, 0xB2 ; 178 1e324: 93 e0 ldi r25, 0x03 ; 3 1e326: 0f 94 83 29 call 0x25306 ; 0x25306 ::start()> lcd_draw_update = 1; 1e32a: 81 e0 ldi r24, 0x01 ; 1 1e32c: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } 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. 1e330: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 1e334: 81 11 cpse r24, r1 1e336: 21 c0 rjmp .+66 ; 0x1e37a 1e338: 64 ef ldi r22, 0xF4 ; 244 1e33a: 71 e0 ldi r23, 0x01 ; 1 1e33c: 82 eb ldi r24, 0xB2 ; 178 1e33e: 93 e0 ldi r25, 0x03 ; 3 1e340: 0f 94 54 29 call 0x252a8 ; 0x252a8 ::expired(unsigned short)> 1e344: 88 23 and r24, r24 1e346: a1 f0 breq .+40 ; 0x1e370 1e348: 80 91 b0 03 lds r24, 0x03B0 ; 0x8003b0 1e34c: 8f 3f cpi r24, 0xFF ; 255 1e34e: 81 f0 breq .+32 ; 0x1e370 { _md->menuState = _scrolling; 1e350: 82 e0 ldi r24, 0x02 ; 2 1e352: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 _md->offset = 0; 1e356: 10 92 a8 03 sts 0x03A8, r1 ; 0x8003a8 _md->scrollPointer = NULL; 1e35a: 10 92 ab 03 sts 0x03AB, r1 ; 0x8003ab 1e35e: 10 92 aa 03 sts 0x03AA, r1 ; 0x8003aa _md->lcd_scrollTimer.start(); 1e362: 82 eb ldi r24, 0xB2 ; 178 1e364: 93 e0 ldi r25, 0x03 ; 3 1e366: 0f 94 83 29 call 0x25306 ; 0x25306 ::start()> lcd_draw_update = 1; //forces last load before switching to scrolling. 1e36a: 81 e0 ldi r24, 0x01 ; 1 1e36c: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } if (lcd_draw_update == 0 && !lcd_clicked()) 1e370: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 1e374: 88 23 and r24, r24 1e376: 09 f4 brne .+2 ; 0x1e37a 1e378: ab c0 rjmp .+342 ; 0x1e4d0 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. 1e37a: 8f ef ldi r24, 0xFF ; 255 1e37c: 80 93 b0 03 sts 0x03B0, r24 ; 0x8003b0 //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(); 1e380: 82 eb ldi r24, 0xB2 ; 178 1e382: 93 e0 ldi r25, 0x03 ; 3 1e384: 0f 94 83 29 call 0x25306 ; 0x25306 ::start()> MENU_BEGIN(); 1e388: 0f 94 51 d1 call 0x3a2a2 ; 0x3a2a2 1e38c: 10 92 11 05 sts 0x0511, r1 ; 0x800511 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); 1e390: ce 01 movw r24, r28 1e392: 01 96 adiw r24, 0x01 ; 1 1e394: 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); 1e396: f5 e3 ldi r31, 0x35 ; 53 1e398: 2f 2e mov r2, r31 1e39a: f1 e7 ldi r31, 0x71 ; 113 1e39c: 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(); 1e39e: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1e3a2: 84 30 cpi r24, 0x04 ; 4 1e3a4: 08 f0 brcs .+2 ; 0x1e3a8 1e3a6: 98 c0 rjmp .+304 ; 0x1e4d8 1e3a8: 10 92 14 05 sts 0x0514, r1 ; 0x800514 MENU_ITEM_BACK_P(_T(bMain?MSG_MAIN:MSG_BACK)); // i.e. default menu-item / menu-item after card insertion 1e3ac: 80 91 df 03 lds r24, 0x03DF ; 0x8003df 1e3b0: 88 23 and r24, r24 1e3b2: 09 f4 brne .+2 ; 0x1e3b6 1e3b4: aa c0 rjmp .+340 ; 0x1e50a 1e3b6: 88 ea ldi r24, 0xA8 ; 168 1e3b8: 98 e4 ldi r25, 0x48 ; 72 1e3ba: 0e 94 c4 72 call 0xe588 ; 0xe588 1e3be: 0f 94 1c d4 call 0x3a838 ; 0x3a838 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;}; 1e3c2: 61 e9 ldi r22, 0x91 ; 145 1e3c4: 74 e1 ldi r23, 0x14 ; 20 1e3c6: 8a e3 ldi r24, 0x3A ; 58 1e3c8: 95 e1 ldi r25, 0x15 ; 21 1e3ca: 0f 94 34 58 call 0x2b068 ; 0x2b068 card.getWorkDirName(); if (card.filename[0] == '/') 1e3ce: 80 91 91 14 lds r24, 0x1491 ; 0x801491 1e3d2: 8f 32 cpi r24, 0x2F ; 47 1e3d4: 09 f0 breq .+2 ; 0x1e3d8 1e3d6: 9c c0 rjmp .+312 ; 0x1e510 { #if SDCARDDETECT == -1 MENU_ITEM_FUNCTION_P(_T(MSG_REFRESH), lcd_sd_refresh); #else if (card.ToshibaFlashAir_isEnabled()) 1e3d8: 80 91 00 17 lds r24, 0x1700 ; 0x801700 1e3dc: 88 23 and r24, r24 1e3de: 41 f0 breq .+16 ; 0x1e3f0 MENU_ITEM_FUNCTION_P(_T(MSG_REFRESH), lcd_sd_refresh); //show the refresh option if in flashAir mode. 1e3e0: 8d e9 ldi r24, 0x9D ; 157 1e3e2: 98 e4 ldi r25, 0x48 ; 72 1e3e4: 0e 94 c4 72 call 0xe588 ; 0xe588 1e3e8: 67 ea ldi r22, 0xA7 ; 167 1e3ea: 7f ed ldi r23, 0xDF ; 223 #endif } else MENU_ITEM_FUNCTION_P(PSTR(LCD_STR_FOLDER ".."), lcd_sd_updir); //Show the updir button if in a subdir. 1e3ec: 0f 94 ce d0 call 0x3a19c ; 0x3a19c for (uint16_t i = _md->fileCnt; i-- > 0;) // Every file, from top to bottom. 1e3f0: c0 90 ae 03 lds r12, 0x03AE ; 0x8003ae 1e3f4: d0 90 af 03 lds r13, 0x03AF ; 0x8003af } if (menu_clicked && (lcd_encoder == menu_item)) { lcd_update_enabled = false; menu_action_sdfile(str_fn); lcd_update_enabled = true; 1e3f8: 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. 1e3fa: 91 e0 ldi r25, 0x01 ; 1 1e3fc: c9 1a sub r12, r25 1e3fe: d1 08 sbc r13, r1 1e400: 08 f4 brcc .+2 ; 0x1e404 1e402: d9 c1 rjmp .+946 ; 0x1e7b6 { if (menu_item == menu_line) //If the file is on the screen. 1e404: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1e408: 90 91 13 05 lds r25, 0x0513 ; 0x800513 1e40c: 89 13 cpse r24, r25 1e40e: cf c1 rjmp .+926 ; 0x1e7ae { //load filename to memory. #ifdef SDCARD_SORT_ALPHA card.getfilename_sorted(i, _md->sdSort); 1e410: 60 91 b1 03 lds r22, 0x03B1 ; 0x8003b1 1e414: c6 01 movw r24, r12 1e416: 0f 94 bb 84 call 0x30976 ; 0x30976 #else card.getfilename(i); #endif if (lcd_encoder == menu_item) //If the file is selected. 1e41a: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1e41e: 90 e0 ldi r25, 0x00 ; 0 1e420: 20 91 6f 06 lds r18, 0x066F ; 0x80066f 1e424: 30 91 70 06 lds r19, 0x0670 ; 0x800670 1e428: 10 91 db 14 lds r17, 0x14DB ; 0x8014db 1e42c: 82 17 cp r24, r18 1e42e: 93 07 cpc r25, r19 1e430: 51 f4 brne .+20 ; 0x1e446 { _md->selectedFileID = i; 1e432: d0 92 ad 03 sts 0x03AD, r13 ; 0x8003ad 1e436: c0 92 ac 03 sts 0x03AC, r12 ; 0x8003ac _md->isDir = card.filenameIsDir; 1e43a: 10 93 a9 03 sts 0x03A9, r17 ; 0x8003a9 _md->row = menu_row; 1e43e: 40 91 11 05 lds r20, 0x0511 ; 0x800511 1e442: 40 93 b0 03 sts 0x03B0, r20 ; 0x8003b0 1e446: 40 91 6d 02 lds r20, 0x026D ; 0x80026d } if (card.filenameIsDir) 1e44a: 11 23 and r17, r17 1e44c: 09 f4 brne .+2 ; 0x1e450 1e44e: 65 c0 rjmp .+202 ; 0x1e51a #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) 1e450: 44 23 and r20, r20 1e452: e9 f0 breq .+58 ; 0x1e48e { lcd_implementation_drawmenu_sddirectory(menu_row, (str_fnl[0] == '\0') ? str_fn : str_fnl); 1e454: 40 91 a6 14 lds r20, 0x14A6 ; 0x8014a6 1e458: e1 e9 ldi r30, 0x91 ; 145 1e45a: ae 2e mov r10, r30 1e45c: e4 e1 ldi r30, 0x14 ; 20 1e45e: be 2e mov r11, r30 1e460: 44 23 and r20, r20 1e462: 21 f0 breq .+8 ; 0x1e46c 1e464: 76 ea ldi r23, 0xA6 ; 166 1e466: a7 2e mov r10, r23 1e468: 74 e1 ldi r23, 0x14 ; 20 1e46a: b7 2e mov r11, r23 1e46c: 60 91 11 05 lds r22, 0x0511 ; 0x800511 } 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)?'>':' '); 1e470: 4e e3 ldi r20, 0x3E ; 62 1e472: 82 17 cp r24, r18 1e474: 93 07 cpc r25, r19 1e476: 09 f0 breq .+2 ; 0x1e47a 1e478: 40 e2 ldi r20, 0x20 ; 32 1e47a: 80 e0 ldi r24, 0x00 ; 0 1e47c: 0e 94 18 6f call 0xde30 ; 0xde30 lcd_putc(LCD_STR_FOLDER[0]); 1e480: 85 e8 ldi r24, 0x85 ; 133 1e482: 0e 94 e7 6e call 0xddce ; 0xddce lcd_print_pad(longFilename, len); 1e486: 62 e1 ldi r22, 0x12 ; 18 1e488: c5 01 movw r24, r10 1e48a: 0e 94 e7 70 call 0xe1ce ; 0xe1ce 1e48e: 80 91 14 05 lds r24, 0x0514 ; 0x800514 { 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)) 1e492: 90 91 12 05 lds r25, 0x0512 ; 0x800512 1e496: 99 23 and r25, r25 1e498: 09 f4 brne .+2 ; 0x1e49c 1e49a: 89 c1 rjmp .+786 ; 0x1e7ae 1e49c: 20 91 6f 06 lds r18, 0x066F ; 0x80066f 1e4a0: 30 91 70 06 lds r19, 0x0670 ; 0x800670 1e4a4: 82 17 cp r24, r18 1e4a6: 13 06 cpc r1, r19 1e4a8: 09 f0 breq .+2 ; 0x1e4ac 1e4aa: 81 c1 rjmp .+770 ; 0x1e7ae { lcd_update_enabled = false; 1e4ac: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e lcd_return_to_status(); } void menu_action_sddirectory(const char* filename) { card.chdir(filename, true); 1e4b0: 61 e0 ldi r22, 0x01 ; 1 1e4b2: 81 e9 ldi r24, 0x91 ; 145 1e4b4: 94 e1 ldi r25, 0x14 ; 20 1e4b6: 0f 94 cf 7d call 0x2fb9e ; 0x2fb9e lcd_encoder = 0; 1e4ba: 10 92 70 06 sts 0x0670, r1 ; 0x800670 1e4be: 10 92 6f 06 sts 0x066F, r1 ; 0x80066f menu_data_reset(); //Forces reloading of cached variables. 1e4c2: 0f 94 73 d1 call 0x3a2e6 ; 0x3a2e6 } if (menu_clicked && (lcd_encoder == menu_item)) { lcd_update_enabled = false; menu_action_sdfile(str_fn); lcd_update_enabled = true; 1e4c6: 00 93 6e 02 sts 0x026E, r16 ; 0x80026e menu_item_ret(); 1e4ca: 0f 94 37 d0 call 0x3a06e ; 0x3a06e 1e4ce: 95 cf rjmp .-214 ; 0x1e3fa _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()) 1e4d0: 0e 94 15 71 call 0xe22a ; 0xe22a 1e4d4: 81 11 cpse r24, r1 1e4d6: 51 cf rjmp .-350 ; 0x1e37a _md->menuState = _standard; } } break; default: _md->menuState = _uninitialized; //shouldn't ever happen. Anyways, initialize the menu. } } 1e4d8: 2d 96 adiw r28, 0x0d ; 13 1e4da: 0f b6 in r0, 0x3f ; 63 1e4dc: f8 94 cli 1e4de: de bf out 0x3e, r29 ; 62 1e4e0: 0f be out 0x3f, r0 ; 63 1e4e2: cd bf out 0x3d, r28 ; 61 1e4e4: df 91 pop r29 1e4e6: cf 91 pop r28 1e4e8: 1f 91 pop r17 1e4ea: 0f 91 pop r16 1e4ec: ff 90 pop r15 1e4ee: ef 90 pop r14 1e4f0: df 90 pop r13 1e4f2: cf 90 pop r12 1e4f4: bf 90 pop r11 1e4f6: af 90 pop r10 1e4f8: 9f 90 pop r9 1e4fa: 8f 90 pop r8 1e4fc: 7f 90 pop r7 1e4fe: 6f 90 pop r6 1e500: 5f 90 pop r5 1e502: 4f 90 pop r4 1e504: 3f 90 pop r3 1e506: 2f 90 pop r2 1e508: 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 1e50a: 8c eb ldi r24, 0xBC ; 188 1e50c: 99 e4 ldi r25, 0x49 ; 73 1e50e: 55 cf rjmp .-342 ; 0x1e3ba 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. 1e510: 61 eb ldi r22, 0xB1 ; 177 1e512: 7f ed ldi r23, 0xDF ; 223 1e514: 8d e6 ldi r24, 0x6D ; 109 1e516: 9a e8 ldi r25, 0x8A ; 138 1e518: 69 cf rjmp .-302 ; 0x1e3ec menu_item++; } static void menu_item_sdfile(const char* str_fn, char* str_fnl) { if (lcd_draw_update) 1e51a: 44 23 and r20, r20 1e51c: d1 f0 breq .+52 ; 0x1e552 { lcd_implementation_drawmenu_sdfile(menu_row, (str_fnl[0] == '\0') ? str_fn : str_fnl); 1e51e: 40 91 a6 14 lds r20, 0x14A6 ; 0x8014a6 1e522: 61 e9 ldi r22, 0x91 ; 145 1e524: a6 2e mov r10, r22 1e526: 64 e1 ldi r22, 0x14 ; 20 1e528: b6 2e mov r11, r22 1e52a: 44 23 and r20, r20 1e52c: 21 f0 breq .+8 ; 0x1e536 1e52e: 56 ea ldi r21, 0xA6 ; 166 1e530: a5 2e mov r10, r21 1e532: 54 e1 ldi r21, 0x14 ; 20 1e534: b5 2e mov r11, r21 1e536: 60 91 11 05 lds r22, 0x0511 ; 0x800511 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)?'>':' '); 1e53a: 4e e3 ldi r20, 0x3E ; 62 1e53c: 82 17 cp r24, r18 1e53e: 93 07 cpc r25, r19 1e540: 09 f0 breq .+2 ; 0x1e544 1e542: 40 e2 ldi r20, 0x20 ; 32 1e544: 80 e0 ldi r24, 0x00 ; 0 1e546: 0e 94 18 6f call 0xde30 ; 0xde30 lcd_print_pad(longFilename, len); 1e54a: 63 e1 ldi r22, 0x13 ; 19 1e54c: c5 01 movw r24, r10 1e54e: 0e 94 e7 70 call 0xe1ce ; 0xe1ce 1e552: 80 91 14 05 lds r24, 0x0514 ; 0x800514 { 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)) 1e556: 90 91 12 05 lds r25, 0x0512 ; 0x800512 1e55a: 99 23 and r25, r25 1e55c: 09 f4 brne .+2 ; 0x1e560 1e55e: 27 c1 rjmp .+590 ; 0x1e7ae 1e560: 20 91 6f 06 lds r18, 0x066F ; 0x80066f 1e564: 30 91 70 06 lds r19, 0x0670 ; 0x800670 1e568: 82 17 cp r24, r18 1e56a: 13 06 cpc r1, r19 1e56c: 09 f0 breq .+2 ; 0x1e570 1e56e: 1f c1 rjmp .+574 ; 0x1e7ae { lcd_update_enabled = false; 1e570: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e return result; } static void menu_action_sdfile(const char* filename) { if(eFilamentAction != FilamentAction::None) return; 1e574: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 1e578: 81 11 cpse r24, r1 1e57a: a5 cf rjmp .-182 ; 0x1e4c6 // 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); 1e57c: 61 e9 ldi r22, 0x91 ; 145 1e57e: 74 e1 ldi r23, 0x14 ; 20 1e580: c7 01 movw r24, r14 1e582: 0f 94 42 e2 call 0x3c484 ; 0x3c484 1e586: 47 01 movw r8, r14 1e588: 45 e9 ldi r20, 0x95 ; 149 1e58a: a4 2e mov r10, r20 1e58c: 4f e0 ldi r20, 0x0F ; 15 1e58e: 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] == '.') { 1e590: f4 01 movw r30, r8 1e592: 61 91 ld r22, Z+ 1e594: 4f 01 movw r8, r30 1e596: 66 23 and r22, r22 1e598: 19 f0 breq .+6 ; 0x1e5a0 1e59a: 6e 32 cpi r22, 0x2E ; 46 1e59c: 09 f0 breq .+2 ; 0x1e5a0 1e59e: 4b c0 rjmp .+150 ; 0x1e636 1e5a0: 60 e0 ldi r22, 0x00 ; 0 1e5a2: c5 01 movw r24, r10 1e5a4: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 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, '.'); 1e5a8: 6e e2 ldi r22, 0x2E ; 46 1e5aa: 70 e0 ldi r23, 0x00 ; 0 1e5ac: c7 01 movw r24, r14 1e5ae: 0f 94 2e e2 call 0x3c45c ; 0x3c45c 1e5b2: 3c 01 movw r6, r24 if (extension_ptr) { 1e5b4: 89 2b or r24, r25 1e5b6: 19 f0 breq .+6 ; 0x1e5be extension_ptr++; // skip the '.' 1e5b8: 8f ef ldi r24, 0xFF ; 255 1e5ba: 68 1a sub r6, r24 1e5bc: 78 0a sbc r7, r24 1e5be: 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); 1e5c0: 31 e9 ldi r19, 0x91 ; 145 1e5c2: a3 2e mov r10, r19 1e5c4: 3c e0 ldi r19, 0x0C ; 12 1e5c6: 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') { 1e5c8: 61 14 cp r6, r1 1e5ca: 71 04 cpc r7, r1 1e5cc: 21 f0 breq .+8 ; 0x1e5d6 1e5ce: f4 01 movw r30, r8 1e5d0: 60 81 ld r22, Z 1e5d2: 61 11 cpse r22, r1 1e5d4: 01 c0 rjmp .+2 ; 0x1e5d8 1e5d6: 60 e0 ldi r22, 0x00 ; 0 1e5d8: c5 01 movw r24, r10 1e5da: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 1e5de: ff ef ldi r31, 0xFF ; 255 1e5e0: af 1a sub r10, r31 1e5e2: bf 0a sbc r11, r31 1e5e4: 2f ef ldi r18, 0xFF ; 255 1e5e6: 82 1a sub r8, r18 1e5e8: 92 0a sbc r9, r18 if (extension_ptr) { extension_ptr++; // skip the '.' } for (uint_least8_t i = 0; i < 3; i++) 1e5ea: 84 e9 ldi r24, 0x94 ; 148 1e5ec: a8 16 cp r10, r24 1e5ee: 8c e0 ldi r24, 0x0C ; 12 1e5f0: b8 06 cpc r11, r24 1e5f2: 51 f7 brne .-44 ; 0x1e5c8 { workDirParents[level].getFilename(name); } uint8_t CardReader::getWorkDirDepth() { return workDirDepth; 1e5f4: 60 90 2f 16 lds r6, 0x162F ; 0x80162f 1e5f8: 66 2d mov r22, r6 1e5fa: 8a e5 ldi r24, 0x5A ; 90 1e5fc: 9f e0 ldi r25, 0x0F ; 15 1e5fe: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 1e602: 8d e8 ldi r24, 0x8D ; 141 1e604: 94 e1 ldi r25, 0x14 ; 20 1e606: 2a e0 ldi r18, 0x0A ; 10 1e608: a2 2e mov r10, r18 1e60a: 2f e0 ldi r18, 0x0F ; 15 1e60c: 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++) { 1e60e: 71 2c mov r7, r1 1e610: 4c 01 movw r8, r24 1e612: e9 e0 ldi r30, 0x09 ; 9 1e614: 8e 0e add r8, r30 1e616: 91 1c adc r9, r1 1e618: 76 14 cp r7, r6 1e61a: d1 f0 breq .+52 ; 0x1e650 #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); 1e61c: 48 e0 ldi r20, 0x08 ; 8 1e61e: 50 e0 ldi r21, 0x00 ; 0 1e620: b5 01 movw r22, r10 1e622: 8e 5a subi r24, 0xAE ; 174 1e624: 9f 4f sbci r25, 0xFF ; 255 1e626: 0f 94 eb db call 0x3b7d6 ; 0x3b7d6 1e62a: 73 94 inc r7 1e62c: f8 e0 ldi r31, 0x08 ; 8 1e62e: af 0e add r10, r31 1e630: b1 1c adc r11, r1 1e632: c4 01 movw r24, r8 1e634: ed cf rjmp .-38 ; 0x1e610 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1e636: c5 01 movw r24, r10 1e638: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 1e63c: ff ef ldi r31, 0xFF ; 255 1e63e: af 1a sub r10, r31 1e640: 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++) { 1e642: 2d e9 ldi r18, 0x9D ; 157 1e644: a2 16 cp r10, r18 1e646: 2f e0 ldi r18, 0x0F ; 15 1e648: b2 06 cpc r11, r18 1e64a: 09 f0 breq .+2 ; 0x1e64e 1e64c: a1 cf rjmp .-190 ; 0x1e590 1e64e: ac cf rjmp .-168 ; 0x1e5a8 /** Menu action functions **/ static bool check_file(const char* filename) { if (farm_mode) return true; card.openFileReadFilteredGcode(filename, true); 1e650: 61 e0 ldi r22, 0x01 ; 1 1e652: c7 01 movw r24, r14 1e654: 0f 94 06 7f call 0x2fe0c ; 0x2fe0c } uint32_t CardReader::getFileSize() { return filesize; 1e658: 40 90 9c 17 lds r4, 0x179C ; 0x80179c 1e65c: 50 90 9d 17 lds r5, 0x179D ; 0x80179d 1e660: 60 90 9e 17 lds r6, 0x179E ; 0x80179e 1e664: 70 90 9f 17 lds r7, 0x179F ; 0x80179f bool result = false; const uint32_t filesize = card.getFileSize(); uint32_t startPos = 0; const uint16_t bytesToCheck = min(END_FILE_SECTION, filesize); 1e668: 94 2d mov r25, r4 1e66a: 85 2d mov r24, r5 1e66c: 21 e0 ldi r18, 0x01 ; 1 1e66e: 42 16 cp r4, r18 1e670: 28 e7 ldi r18, 0x78 ; 120 1e672: 52 06 cpc r5, r18 1e674: 61 04 cpc r6, r1 1e676: 71 04 cpc r7, r1 1e678: 10 f0 brcs .+4 ; 0x1e67e 1e67a: 90 e0 ldi r25, 0x00 ; 0 1e67c: 88 e7 ldi r24, 0x78 ; 120 1e67e: a9 2e mov r10, r25 1e680: b8 2e mov r11, r24 if (filesize > END_FILE_SECTION) { 1e682: 81 e0 ldi r24, 0x01 ; 1 1e684: 48 16 cp r4, r24 1e686: 88 e7 ldi r24, 0x78 ; 120 1e688: 58 06 cpc r5, r24 1e68a: 61 04 cpc r6, r1 1e68c: 71 04 cpc r7, r1 1e68e: 08 f4 brcc .+2 ; 0x1e692 1e690: 5d c0 rjmp .+186 ; 0x1e74c startPos = filesize - END_FILE_SECTION; 1e692: 98 e7 ldi r25, 0x78 ; 120 1e694: 59 1a sub r5, r25 1e696: 61 08 sbc r6, r1 1e698: 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);}; 1e69a: 40 92 a3 17 sts 0x17A3, r4 ; 0x8017a3 1e69e: 50 92 a4 17 sts 0x17A4, r5 ; 0x8017a4 1e6a2: 60 92 a5 17 sts 0x17A5, r6 ; 0x8017a5 1e6a6: 70 92 a6 17 sts 0x17A6, r7 ; 0x8017a6 1e6aa: c3 01 movw r24, r6 1e6ac: b2 01 movw r22, r4 1e6ae: 0f 94 57 75 call 0x2eaae ; 0x2eaae card.setIndex(startPos); } cmdqueue_reset(); 1e6b2: 0e 94 5c 7f call 0xfeb8 ; 0xfeb8 cmdqueue_serial_disabled = true; 1e6b6: 00 93 a4 03 sts 0x03A4, r16 ; 0x8003a4 menu_progressbar_init(bytesToCheck, _T(MSG_CHECKING_FILE)); 1e6ba: 89 e6 ldi r24, 0x69 ; 105 1e6bc: 98 e4 ldi r25, 0x48 ; 72 1e6be: 0e 94 c4 72 call 0xe588 ; 0xe588 1e6c2: bc 01 movw r22, r24 1e6c4: c5 01 movw r24, r10 1e6c6: 0f 94 b3 cf call 0x39f66 ; 0x39f66 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; } 1e6ca: 80 91 a3 17 lds r24, 0x17A3 ; 0x8017a3 1e6ce: 90 91 a4 17 lds r25, 0x17A4 ; 0x8017a4 1e6d2: a0 91 a5 17 lds r26, 0x17A5 ; 0x8017a5 1e6d6: b0 91 a6 17 lds r27, 0x17A6 ; 0x8017a6 while (!card.eof() && !result) { 1e6da: 40 91 9c 17 lds r20, 0x179C ; 0x80179c 1e6de: 50 91 9d 17 lds r21, 0x179D ; 0x80179d 1e6e2: 60 91 9e 17 lds r22, 0x179E ; 0x80179e 1e6e6: 70 91 9f 17 lds r23, 0x179F ; 0x80179f 1e6ea: 84 17 cp r24, r20 1e6ec: 95 07 cpc r25, r21 1e6ee: a6 07 cpc r26, r22 1e6f0: b7 07 cpc r27, r23 1e6f2: 80 f5 brcc .+96 ; 0x1e754 1e6f4: 11 11 cpse r17, r1 1e6f6: 2e c0 rjmp .+92 ; 0x1e754 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); }; 1e6f8: 20 91 22 17 lds r18, 0x1722 ; 0x801722 1e6fc: 21 11 cpse r18, r1 1e6fe: 03 c0 rjmp .+6 ; 0x1e706 1e700: 80 e0 ldi r24, 0x00 ; 0 1e702: 90 e0 ldi r25, 0x00 ; 0 1e704: dc 01 movw r26, r24 menu_progressbar_update(card.get_sdpos() - startPos); 1e706: 84 19 sub r24, r4 1e708: 95 09 sbc r25, r5 1e70a: 0f 94 84 cf call 0x39f08 ; 0x39f08 card.sdprinting = true; 1e70e: 00 93 8f 14 sts 0x148F, r16 ; 0x80148f get_command(); 1e712: 0e 94 38 83 call 0x10670 ; 0x10670 #endif // LIN_ADVANCE bool check_commands() { bool end_command_found = false; while (buflen) 1e716: 80 91 a2 10 lds r24, 0x10A2 ; 0x8010a2 1e71a: 90 91 a3 10 lds r25, 0x10A3 ; 0x8010a3 1e71e: 89 2b or r24, r25 1e720: a1 f2 breq .-88 ; 0x1e6ca { if ((code_seen_P(MSG_M84)) || (code_seen_P(PSTR("M 84")))) end_command_found = true; 1e722: 81 e1 ldi r24, 0x11 ; 17 1e724: 9c e6 ldi r25, 0x6C ; 108 1e726: 0e 94 3e 68 call 0xd07c ; 0xd07c 1e72a: 81 11 cpse r24, r1 1e72c: 05 c0 rjmp .+10 ; 0x1e738 1e72e: 88 e6 ldi r24, 0x68 ; 104 1e730: 9a e8 ldi r25, 0x8A ; 138 1e732: 0e 94 3e 68 call 0xd07c ; 0xd07c 1e736: 81 11 cpse r24, r1 1e738: 11 e0 ldi r17, 0x01 ; 1 if (!cmdbuffer_front_already_processed) 1e73a: 80 91 a1 10 lds r24, 0x10A1 ; 0x8010a1 1e73e: 81 11 cpse r24, r1 1e740: 02 c0 rjmp .+4 ; 0x1e746 cmdqueue_pop_front(); 1e742: 0e 94 d4 76 call 0xeda8 ; 0xeda8 cmdbuffer_front_already_processed = false; 1e746: 10 92 a1 10 sts 0x10A1, r1 ; 0x8010a1 1e74a: e5 cf rjmp .-54 ; 0x1e716 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; 1e74c: 41 2c mov r4, r1 1e74e: 51 2c mov r5, r1 1e750: 32 01 movw r6, r4 1e752: af cf rjmp .-162 ; 0x1e6b2 // with the CMDBUFFER_DEBUG enabled manage_heater(); #endif // CMDBUFFER_DEBUG } menu_progressbar_finish(); 1e754: 0f 94 a5 cf call 0x39f4a ; 0x39f4a cmdqueue_serial_disabled = false; 1e758: 10 92 a4 03 sts 0x03A4, r1 ; 0x8003a4 card.printingHasFinished(); 1e75c: 0f 94 3e 80 call 0x3007c ; 0x3007c lcd_setstatuspgm(MSG_WELCOME); 1e760: 86 eb ldi r24, 0xB6 ; 182 1e762: 90 e7 ldi r25, 0x70 ; 112 1e764: 0e 94 38 f1 call 0x1e270 ; 0x1e270 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)) { 1e768: 11 23 and r17, r17 1e76a: 91 f0 breq .+36 ; 0x1e790 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); 1e76c: ff 92 push r15 1e76e: ef 92 push r14 1e770: 3f 92 push r3 1e772: 2f 92 push r2 1e774: 0e 94 ce 88 call 0x1119c ; 0x1119c enquecommand_P(MSG_M24); 1e778: 61 e0 ldi r22, 0x01 ; 1 1e77a: 81 e3 ldi r24, 0x31 ; 49 1e77c: 91 e7 ldi r25, 0x71 ; 113 1e77e: 0e 94 38 88 call 0x11070 ; 0x11070 1e782: 0f 90 pop r0 1e784: 0f 90 pop r0 1e786: 0f 90 pop r0 1e788: 0f 90 pop r0 } lcd_return_to_status(); 1e78a: 0f 94 7c 1e call 0x23cf8 ; 0x23cf8 1e78e: 9b ce rjmp .-714 ; 0x1e4c6 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)) { result = !lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_FILE_INCOMPLETE), false); 1e790: 89 e7 ldi r24, 0x79 ; 121 1e792: 98 e4 ldi r25, 0x48 ; 72 1e794: 0e 94 c4 72 call 0xe588 ; 0xe588 1e798: 41 e0 ldi r20, 0x01 ; 1 1e79a: 60 e0 ldi r22, 0x00 ; 0 1e79c: 0f 94 fb 4e call 0x29df6 ; 0x29df6 1e7a0: 18 2f mov r17, r24 lcd_update_enable(true); 1e7a2: 81 e0 ldi r24, 0x01 ; 1 1e7a4: 0e 94 3d 6f call 0xde7a ; 0xde7a } if (result) { 1e7a8: 11 23 and r17, r17 1e7aa: 01 f3 breq .-64 ; 0x1e76c 1e7ac: ee cf rjmp .-36 ; 0x1e78a lcd_putc_at(LCD_WIDTH - 1, menu_row, type_char); } void menu_item_dummy(void) { menu_item++; 1e7ae: 8f 5f subi r24, 0xFF ; 255 1e7b0: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1e7b4: 22 ce rjmp .-956 ; 0x1e3fa else MENU_ITEM_SDFILE(card.filename, card.longFilename); } else MENU_ITEM_DUMMY(); //dummy item that just increments the internal menu counters. } MENU_END(); 1e7b6: 0f 94 25 d1 call 0x3a24a ; 0x3a24a _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(); 1e7ba: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1e7be: 8f 5f subi r24, 0xFF ; 255 1e7c0: 80 93 11 05 sts 0x0511, r24 ; 0x800511 1e7c4: 80 91 13 05 lds r24, 0x0513 ; 0x800513 1e7c8: 8f 5f subi r24, 0xFF ; 255 1e7ca: 80 93 13 05 sts 0x0513, r24 ; 0x800513 1e7ce: e7 cd rjmp .-1074 ; 0x1e39e 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. 1e7d0: 80 91 a6 03 lds r24, 0x03A6 ; 0x8003a6 1e7d4: 11 e0 ldi r17, 0x01 ; 1 1e7d6: 81 11 cpse r24, r1 1e7d8: 05 c0 rjmp .+10 ; 0x1e7e4 1e7da: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 1e7de: 81 11 cpse r24, r1 1e7e0: 01 c0 rjmp .+2 ; 0x1e7e4 1e7e2: 10 e0 ldi r17, 0x00 ; 0 if (_md->scrollPointer == NULL) 1e7e4: 80 91 aa 03 lds r24, 0x03AA ; 0x8003aa 1e7e8: 90 91 ab 03 lds r25, 0x03AB ; 0x8003ab 1e7ec: 89 2b or r24, r25 1e7ee: 91 f4 brne .+36 ; 0x1e814 { //load filename to memory. #ifdef SDCARD_SORT_ALPHA card.getfilename_sorted(_md->selectedFileID, _md->sdSort); 1e7f0: 60 91 b1 03 lds r22, 0x03B1 ; 0x8003b1 1e7f4: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 1e7f8: 90 91 ad 03 lds r25, 0x03AD ; 0x8003ad 1e7fc: 0f 94 bb 84 call 0x30976 ; 0x30976 #else card.getfilename(_md->selectedFileID); #endif _md->scrollPointer = (card.longFilename[0] == '\0') ? card.filename : card.longFilename; 1e800: 80 91 a6 14 lds r24, 0x14A6 ; 0x8014a6 1e804: 81 11 cpse r24, r1 1e806: 46 c0 rjmp .+140 ; 0x1e894 1e808: 81 e9 ldi r24, 0x91 ; 145 1e80a: 94 e1 ldi r25, 0x14 ; 20 1e80c: 90 93 ab 03 sts 0x03AB, r25 ; 0x8003ab 1e810: 80 93 aa 03 sts 0x03AA, r24 ; 0x8003aa } if (rewindFlag) 1e814: 11 11 cpse r17, r1 _md->offset = 0; //redraw once again from the beginning. 1e816: 10 92 a8 03 sts 0x03A8, r1 ; 0x8003a8 if (_md->lcd_scrollTimer.expired(300) || rewindFlag) 1e81a: 6c e2 ldi r22, 0x2C ; 44 1e81c: 71 e0 ldi r23, 0x01 ; 1 1e81e: 82 eb ldi r24, 0xB2 ; 178 1e820: 93 e0 ldi r25, 0x03 ; 3 1e822: 0f 94 54 29 call 0x252a8 ; 0x252a8 ::expired(unsigned short)> 1e826: 81 11 cpse r24, r1 1e828: 03 c0 rjmp .+6 ; 0x1e830 1e82a: 11 23 and r17, r17 1e82c: 09 f4 brne .+2 ; 0x1e830 1e82e: 54 ce rjmp .-856 ; 0x1e4d8 { uint8_t len = LCD_WIDTH - ((_md->isDir)? 2 : 1); 1e830: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 1e834: 02 e1 ldi r16, 0x12 ; 18 1e836: 81 11 cpse r24, r1 1e838: 01 c0 rjmp .+2 ; 0x1e83c 1e83a: 03 e1 ldi r16, 0x13 ; 19 lcd_putc_at(0, _md->row, '>'); 1e83c: 4e e3 ldi r20, 0x3E ; 62 1e83e: 60 91 b0 03 lds r22, 0x03B0 ; 0x8003b0 1e842: 80 e0 ldi r24, 0x00 ; 0 1e844: 0e 94 18 6f call 0xde30 ; 0xde30 if (_md->isDir) 1e848: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 1e84c: 88 23 and r24, r24 1e84e: 19 f0 breq .+6 ; 0x1e856 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 1e850: 85 e8 ldi r24, 0x85 ; 133 1e852: 0e 94 a7 6f call 0xdf4e ; 0xdf4e lcd_print(LCD_STR_FOLDER[0]); if( lcd_print_pad(&_md->scrollPointer[_md->offset], len) == 0) 1e856: 20 91 a8 03 lds r18, 0x03A8 ; 0x8003a8 1e85a: 80 91 aa 03 lds r24, 0x03AA ; 0x8003aa 1e85e: 90 91 ab 03 lds r25, 0x03AB ; 0x8003ab 1e862: 60 2f mov r22, r16 1e864: 82 0f add r24, r18 1e866: 91 1d adc r25, r1 1e868: 0e 94 e7 70 call 0xe1ce ; 0xe1ce 1e86c: 81 11 cpse r24, r1 1e86e: 15 c0 rjmp .+42 ; 0x1e89a { _md->lcd_scrollTimer.start(); 1e870: 82 eb ldi r24, 0xB2 ; 178 1e872: 93 e0 ldi r25, 0x03 ; 3 1e874: 0f 94 83 29 call 0x25306 ; 0x25306 ::start()> _md->offset++; 1e878: 80 91 a8 03 lds r24, 0x03A8 ; 0x8003a8 1e87c: 8f 5f subi r24, 0xFF ; 255 1e87e: 80 93 a8 03 sts 0x03A8, r24 ; 0x8003a8 } else { // stop at the end of the string _md->lcd_scrollTimer.stop(); } } if (rewindFlag) //go back to sd_menu. 1e882: 11 23 and r17, r17 1e884: 09 f4 brne .+2 ; 0x1e888 1e886: 28 ce rjmp .-944 ; 0x1e4d8 1e888: 10 92 b2 03 sts 0x03B2, r1 ; 0x8003b2 { _md->lcd_scrollTimer.stop(); //forces redraw in _standard state _md->menuState = _standard; 1e88c: 81 e0 ldi r24, 0x01 ; 1 1e88e: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 1e892: 22 ce rjmp .-956 ; 0x1e4d8 #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; 1e894: 86 ea ldi r24, 0xA6 ; 166 1e896: 94 e1 ldi r25, 0x14 ; 20 1e898: b9 cf rjmp .-142 ; 0x1e80c 1e89a: 10 92 b2 03 sts 0x03B2, r1 ; 0x8003b2 1e89e: f1 cf rjmp .-30 ; 0x1e882 0001e8a0 : } #endif /* DEBUG_STEPPER_TIMER_MISSED */ static void lcd_colorprint_change() { enquecommand_P(MSG_M600); 1e8a0: 61 e0 ldi r22, 0x01 ; 1 1e8a2: 8c e2 ldi r24, 0x2C ; 44 1e8a4: 91 e7 ldi r25, 0x71 ; 113 1e8a6: 0e 94 38 88 call 0x11070 ; 0x11070 custom_message_type = CustomMsg::FilamentLoading; //just print status message 1e8aa: 82 e0 ldi r24, 0x02 ; 2 1e8ac: 80 93 c3 06 sts 0x06C3, r24 ; 0x8006c3 lcd_setstatuspgm(_T(MSG_FINISHING_MOVEMENTS)); 1e8b0: 85 e9 ldi r24, 0x95 ; 149 1e8b2: 93 e5 ldi r25, 0x53 ; 83 1e8b4: 0e 94 c4 72 call 0xe588 ; 0xe588 1e8b8: 0e 94 38 f1 call 0x1e270 ; 0x1e270 lcd_return_to_status(); 1e8bc: 0f 94 7c 1e call 0x23cf8 ; 0x23cf8 lcd_draw_update = 3; 1e8c0: 83 e0 ldi r24, 0x03 ; 3 1e8c2: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } 1e8c6: 08 95 ret 0001e8c8 : // hack lcd_draw_update to 1, i.e. without clear lcd_draw_update = 1; } void lcd_setstatus(const char* message) { 1e8c8: cf 93 push r28 1e8ca: df 93 push r29 1e8cc: ec 01 movw r28, r24 if (lcd_message_check(LCD_STATUS_NONE)) 1e8ce: 80 e0 ldi r24, 0x00 ; 0 1e8d0: 0e 94 e2 f0 call 0x1e1c4 ; 0x1e1c4 1e8d4: 88 23 and r24, r24 1e8d6: 31 f0 breq .+12 ; 0x1e8e4 lcd_updatestatus(message); 1e8d8: 60 e0 ldi r22, 0x00 ; 0 1e8da: ce 01 movw r24, r28 } 1e8dc: df 91 pop r29 1e8de: cf 91 pop r28 } void lcd_setstatus(const char* message) { if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message); 1e8e0: 0c 94 c7 f0 jmp 0x1e18e ; 0x1e18e } 1e8e4: df 91 pop r29 1e8e6: cf 91 pop r28 1e8e8: 08 95 ret 0001e8ea : 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) { 1e8ea: cf 93 push r28 1e8ec: df 93 push r29 1e8ee: c8 2f mov r28, r24 softReset(); } void UnconditionalStop() { CRITICAL_SECTION_START; 1e8f0: 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) { 1e8f2: 66 23 and r22, r22 1e8f4: d9 f1 breq .+118 ; 0x1e96c 1e8f6: f8 94 cli // Disable all heaters and unroll the temperature wait loop stack disable_heater(); 1e8f8: 0f 94 ee 2e call 0x25ddc ; 0x25ddc cancel_heatup = true; 1e8fc: 81 e0 ldi r24, 0x01 ; 1 1e8fe: 80 93 b4 0d sts 0x0DB4, r24 ; 0x800db4 <_ZL13cancel_heatup.lto_priv.408> heating_status = HeatingStatus::NO_HEATING; 1e902: 10 92 e1 03 sts 0x03E1, r1 ; 0x8003e1 // Clear any saved printing state cancel_saved_printing(); 1e906: 0e 94 c5 64 call 0xc98a ; 0xc98a // Abort the planner planner_abort_hard(); 1e90a: 0f 94 7e c1 call 0x382fc ; 0x382fc // Reset the queue cmdqueue_reset(); 1e90e: 0e 94 5c 7f call 0xfeb8 ; 0xfeb8 cmdqueue_serial_disabled = false; 1e912: 10 92 a4 03 sts 0x03A4, r1 ; 0x8003a4 st_reset_timer(); 1e916: 0f 94 fd 42 call 0x285fa ; 0x285fa CRITICAL_SECTION_END; 1e91a: df bf out 0x3f, r29 ; 63 // clear paused state immediately did_pause_print = false; 1e91c: 10 92 e2 03 sts 0x03E2, r1 ; 0x8003e2 print_job_timer.stop(); 1e920: 0f 94 6c 42 call 0x284d8 ; 0x284d8 } else { // Allow lcd_print_stop_finish() to use the heaters when it is safe ConditionalStop(); } if (card.isFileOpen()) { 1e924: 80 91 22 17 lds r24, 0x1722 ; 0x801722 1e928: 88 23 and r24, r24 1e92a: 71 f0 breq .+28 ; 0x1e948 // Reset the sd status card.sdprinting = false; 1e92c: 10 92 8f 14 sts 0x148F, r1 ; 0x80148f lastnr++; } void CardReader::closefile(bool store_location) { file.sync(); 1e930: 8f e1 ldi r24, 0x1F ; 31 1e932: 97 e1 ldi r25, 0x17 ; 23 1e934: 0f 94 f6 57 call 0x2afec ; 0x2afec file.close(); 1e938: 8f e1 ldi r24, 0x1F ; 31 1e93a: 97 e1 ldi r25, 0x17 ; 23 1e93c: 0f 94 2b 58 call 0x2b056 ; 0x2b056 saving = false; 1e940: 10 92 8d 14 sts 0x148D, r1 ; 0x80148d logging = false; 1e944: 10 92 8e 14 sts 0x148E, r1 ; 0x80148e card.closefile(); } SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_CANCEL); 1e948: 84 e7 ldi r24, 0x74 ; 116 1e94a: 9b e6 ldi r25, 0x6B ; 107 1e94c: 0e 94 93 79 call 0xf326 ; 0xf326 #ifdef MESH_BED_LEVELING mbl.active = false; 1e950: 10 92 c1 13 sts 0x13C1, r1 ; 0x8013c1 #endif if (interactive) { 1e954: c1 11 cpse r28, r1 // acknowledged by the user from the LCD: resume processing USB commands again Stopped = false; 1e956: 10 92 10 05 sts 0x0510, r1 ; 0x800510 } // return to status is required to continue processing in the main loop! lcd_commands_type = LcdCommands::StopPrint; 1e95a: 81 e0 ldi r24, 0x01 ; 1 1e95c: 80 93 b3 0d sts 0x0DB3, r24 ; 0x800db3 } PrinterState SetPrinterState(PrinterState status) { return printer_state = status; 1e960: 10 92 b7 0d sts 0x0DB7, r1 ; 0x800db7 <_ZL13printer_state.lto_priv.401> SetPrinterState(PrinterState::NotReady); //set printer state to show LCD menu after print has been stopped lcd_return_to_status(); } 1e964: df 91 pop r29 1e966: 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(); 1e968: 0d 94 7c 1e jmp 0x23cf8 ; 0x23cf8 } void ConditionalStop() { CRITICAL_SECTION_START; 1e96c: 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; 1e96e: 81 e0 ldi r24, 0x01 ; 1 1e970: 80 93 b4 0d sts 0x0DB4, r24 ; 0x800db4 <_ZL13cancel_heatup.lto_priv.408> heating_status = HeatingStatus::NO_HEATING; 1e974: 10 92 e1 03 sts 0x03E1, r1 ; 0x8003e1 // Clear any saved printing state cancel_saved_printing(); 1e978: 0e 94 c5 64 call 0xc98a ; 0xc98a // Abort the planner planner_abort_hard(); 1e97c: 0f 94 7e c1 call 0x382fc ; 0x382fc // Reset the queue cmdqueue_reset(); 1e980: 0e 94 5c 7f call 0xfeb8 ; 0xfeb8 cmdqueue_serial_disabled = false; 1e984: 10 92 a4 03 sts 0x03A4, r1 ; 0x8003a4 st_reset_timer(); 1e988: 0f 94 fd 42 call 0x285fa ; 0x285fa CRITICAL_SECTION_END; 1e98c: df bf out 0x3f, r29 ; 63 1e98e: ca cf rjmp .-108 ; 0x1e924 0001e990 : } void lcd_print_stop() { print_stop(true); 1e990: 60 e0 ldi r22, 0x00 ; 0 1e992: 81 e0 ldi r24, 0x01 ; 1 1e994: 0c 94 75 f4 jmp 0x1e8ea ; 0x1e8ea 0001e998 : 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' 1e998: 41 30 cpi r20, 0x01 ; 1 1e99a: 41 f4 brne .+16 ; 0x1e9ac if (lcd_show_multiscreen_message_yes_no_and_wait_P(warning, true, LCD_LEFT_BUTTON_CHOICE) == LCD_MIDDLE_BUTTON_CHOICE) { 1e99c: 40 e0 ldi r20, 0x00 ; 0 1e99e: 61 e0 ldi r22, 0x01 ; 1 1e9a0: 0f 94 fb 4e call 0x29df6 ; 0x29df6 1e9a4: 81 30 cpi r24, 0x01 ; 1 1e9a6: 41 f4 brne .+16 ; 0x1e9b8 lcd_print_stop(); } } else if (check == 2) { // Strict, always stop print lcd_show_fullscreen_message_and_wait_P(strict); lcd_print_stop(); 1e9a8: 0c 94 c8 f4 jmp 0x1e990 ; 0x1e990 { 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 1e9ac: 42 30 cpi r20, 0x02 ; 2 1e9ae: 21 f4 brne .+8 ; 0x1e9b8 lcd_show_fullscreen_message_and_wait_P(strict); 1e9b0: cb 01 movw r24, r22 1e9b2: 0f 94 c7 1f call 0x23f8e ; 0x23f8e 1e9b6: f8 cf rjmp .-16 ; 0x1e9a8 lcd_print_stop(); } } 1e9b8: 08 95 ret 0001e9ba : ,_T(MSG_GCODE_NEWER_FIRMWARE_CANCELLED) ,(uint8_t)oCheckVersion ); } bool filament_presence_check() { 1e9ba: 0f 93 push r16 1e9bc: 1f 93 push r17 1e9be: 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)) { 1e9c0: 8c ea ldi r24, 0xAC ; 172 1e9c2: 9c e0 ldi r25, 0x0C ; 12 1e9c4: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 1e9c8: 81 11 cpse r24, r1 1e9ca: 23 c0 rjmp .+70 ; 0x1ea12 goto done; } if (fsensor.isEnabled() && !fsensor.getFilamentPresent()) { 1e9cc: 80 91 a9 17 lds r24, 0x17A9 ; 0x8017a9 1e9d0: 88 23 and r24, r24 1e9d2: f9 f0 breq .+62 ; 0x1ea12 1e9d4: 80 91 b6 17 lds r24, 0x17B6 ; 0x8017b6 1e9d8: 81 11 cpse r24, r1 1e9da: 1b c0 rjmp .+54 ; 0x1ea12 if (oCheckFilament == ClCheckMode::_None) { 1e9dc: c0 91 e6 04 lds r28, 0x04E6 ; 0x8004e6 1e9e0: cc 23 and r28, r28 1e9e2: b9 f0 breq .+46 ; 0x1ea12 goto done; } render_M862_warnings( 1e9e4: 86 e4 ldi r24, 0x46 ; 70 1e9e6: 9b e4 ldi r25, 0x4B ; 75 1e9e8: 0e 94 c4 72 call 0xe588 ; 0xe588 1e9ec: 8c 01 movw r16, r24 1e9ee: 8d e1 ldi r24, 0x1D ; 29 1e9f0: 9b e4 ldi r25, 0x4B ; 75 1e9f2: 0e 94 c4 72 call 0xe588 ; 0xe588 1e9f6: 4c 2f mov r20, r28 1e9f8: b8 01 movw r22, r16 1e9fa: 0e 94 cc f4 call 0x1e998 ; 0x1e998 _T(MSG_MISSING_FILAMENT_CONTINUE) ,_T(MSG_MISSING_FILAMENT_CANCELLED) ,(uint8_t)oCheckFilament ); if (lcd_commands_type == LcdCommands::StopPrint) { 1e9fe: 81 e0 ldi r24, 0x01 ; 1 1ea00: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 1ea04: 91 30 cpi r25, 0x01 ; 1 1ea06: 09 f4 brne .+2 ; 0x1ea0a 1ea08: 80 e0 ldi r24, 0x00 ; 0 } } done: return true; } 1ea0a: cf 91 pop r28 1ea0c: 1f 91 pop r17 1ea0e: 0f 91 pop r16 1ea10: 08 95 ret return false; } } done: return true; 1ea12: 81 e0 ldi r24, 0x01 ; 1 1ea14: fa cf rjmp .-12 ; 0x1ea0a 0001ea16 : lcd_show_fullscreen_message_and_wait_P(strict); lcd_print_stop(); } } void nozzle_diameter_check(uint16_t nDiameter) { 1ea16: 1f 93 push r17 1ea18: cf 93 push r28 1ea1a: df 93 push r29 uint16_t nDiameter_um; if (oCheckMode == ClCheckMode::_None) 1ea1c: 10 91 eb 04 lds r17, 0x04EB ; 0x8004eb 1ea20: 11 23 and r17, r17 1ea22: f9 f0 breq .+62 ; 0x1ea62 1ea24: ec 01 movw r28, r24 return; nDiameter_um = eeprom_read_word((uint16_t *)EEPROM_NOZZLE_DIAMETER_uM); 1ea26: 85 ea ldi r24, 0xA5 ; 165 1ea28: 9d e0 ldi r25, 0x0D ; 13 1ea2a: 0f 94 e5 db call 0x3b7ca ; 0x3b7ca if (nDiameter == nDiameter_um) 1ea2e: 8c 17 cp r24, r28 1ea30: 9d 07 cpc r25, r29 1ea32: b9 f0 breq .+46 ; 0x1ea62 // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN((float)(nDiameter_um/1000.0)); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN((float)(nDiameter/1000.0)); render_M862_warnings( 1ea34: 8d eb ldi r24, 0xBD ; 189 1ea36: 9a e4 ldi r25, 0x4A ; 74 1ea38: 0e 94 c4 72 call 0xe588 ; 0xe588 1ea3c: ec 01 movw r28, r24 1ea3e: 88 e8 ldi r24, 0x88 ; 136 1ea40: 9a e4 ldi r25, 0x4A ; 74 1ea42: 0e 94 c4 72 call 0xe588 ; 0xe588 1ea46: 41 2f mov r20, r17 1ea48: be 01 movw r22, r28 1ea4a: 0e 94 cc f4 call 0x1e998 ; 0x1e998 ,_T(MSG_NOZZLE_DIFFERS_CANCELLED) ,(uint8_t)oCheckMode ); if (!farm_mode) { bSettings = false; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function 1ea4e: 10 92 fb 03 sts 0x03FB, r1 ; 0x8003fb menu_submenu(lcd_hw_setup_menu); 1ea52: 60 e0 ldi r22, 0x00 ; 0 1ea54: 81 ed ldi r24, 0xD1 ; 209 1ea56: 91 ed ldi r25, 0xD1 ; 209 } } 1ea58: df 91 pop r29 1ea5a: cf 91 pop r28 1ea5c: 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); 1ea5e: 0d 94 be d2 jmp 0x3a57c ; 0x3a57c } } 1ea62: df 91 pop r29 1ea64: cf 91 pop r28 1ea66: 1f 91 pop r17 1ea68: 08 95 ret 0001ea6a : } /// @brief Set print fan speed /// @param speed ranges from 0 to 255 static void lcd_selftest_setfan(const uint8_t speed) { fanSpeed = speed; 1ea6a: 80 93 e5 03 sts 0x03E5, r24 ; 0x8003e5 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = speed; 1ea6e: 80 93 a5 04 sts 0x04A5, r24 ; 0x8004a5 #endif manage_heater(); 1ea72: 0d 94 2e 38 jmp 0x2705c ; 0x2705c 0001ea76 : { (void)lcd_selftest(); } bool lcd_selftest() { 1ea76: cf 92 push r12 1ea78: df 92 push r13 1ea7a: ef 92 push r14 1ea7c: ff 92 push r15 1ea7e: 0f 93 push r16 1ea80: 1f 93 push r17 1ea82: cf 93 push r28 1ea84: df 93 push r29 1ea86: 00 d0 rcall .+0 ; 0x1ea88 1ea88: 1f 92 push r1 1ea8a: cd b7 in r28, 0x3d ; 61 1ea8c: 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(); 1ea8e: 0f 94 ee 2e call 0x25ddc ; 0x25ddc uint8_t fanSpeedBckp = fanSpeed; 1ea92: d0 90 e5 03 lds r13, 0x03E5 ; 0x8003e5 fanSpeed = 255; 1ea96: 8f ef ldi r24, 0xFF ; 255 1ea98: 80 93 e5 03 sts 0x03E5, r24 ; 0x8003e5 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)); 1ea9c: 81 e9 ldi r24, 0x91 ; 145 1ea9e: e8 2e mov r14, r24 1eaa0: 8a e8 ldi r24, 0x8A ; 138 1eaa2: 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()); 1eaa4: 0b e8 ldi r16, 0x8B ; 139 1eaa6: 1a e8 ldi r17, 0x8A ; 138 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)) { 1eaa8: 20 e0 ldi r18, 0x00 ; 0 1eaaa: 30 e0 ldi r19, 0x00 ; 0 1eaac: 48 e4 ldi r20, 0x48 ; 72 1eaae: 52 e4 ldi r21, 0x42 ; 66 1eab0: 60 91 af 0d lds r22, 0x0DAF ; 0x800daf 1eab4: 70 91 b0 0d lds r23, 0x0DB0 ; 0x800db0 1eab8: 80 91 b1 0d lds r24, 0x0DB1 ; 0x800db1 1eabc: 90 91 b2 0d lds r25, 0x0DB2 ; 0x800db2 1eac0: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 1eac4: 18 16 cp r1, r24 1eac6: 8c f0 brlt .+34 ; 0x1eaea 1eac8: 20 e0 ldi r18, 0x00 ; 0 1eaca: 30 e0 ldi r19, 0x00 ; 0 1eacc: 48 e4 ldi r20, 0x48 ; 72 1eace: 52 e4 ldi r21, 0x42 ; 66 1ead0: 60 91 ed 04 lds r22, 0x04ED ; 0x8004ed 1ead4: 70 91 ee 04 lds r23, 0x04EE ; 0x8004ee 1ead8: 80 91 ef 04 lds r24, 0x04EF ; 0x8004ef 1eadc: 90 91 f0 04 lds r25, 0x04F0 ; 0x8004f0 1eae0: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 1eae4: 18 16 cp r1, r24 1eae6: 0c f0 brlt .+2 ; 0x1eaea 1eae8: 42 c0 rjmp .+132 ; 0x1eb6e lcd_display_message_fullscreen_P(_T(MSG_WAITING_TEMP)); 1eaea: 8f ea ldi r24, 0xAF ; 175 1eaec: 98 e4 ldi r25, 0x48 ; 72 1eaee: 0e 94 c4 72 call 0xe588 ; 0xe588 1eaf2: 0f 94 ba 1f call 0x23f74 ; 0x23f74 lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 1eaf6: 42 e8 ldi r20, 0x82 ; 130 1eaf8: 64 e0 ldi r22, 0x04 ; 4 1eafa: 80 e0 ldi r24, 0x00 ; 0 1eafc: 0e 94 18 6f call 0xde30 ; 0xde30 lcd_printf_P(PSTR("%3d/0"), (int16_t)degHotend(0)); 1eb00: 60 91 af 0d lds r22, 0x0DAF ; 0x800daf 1eb04: 70 91 b0 0d lds r23, 0x0DB0 ; 0x800db0 1eb08: 80 91 b1 0d lds r24, 0x0DB1 ; 0x800db1 1eb0c: 90 91 b2 0d lds r25, 0x0DB2 ; 0x800db2 1eb10: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> 1eb14: 7f 93 push r23 1eb16: 6f 93 push r22 1eb18: ff 92 push r15 1eb1a: ef 92 push r14 1eb1c: 0e 94 d1 6e call 0xdda2 ; 0xdda2 lcd_putc(LCD_STR_DEGREE[0]); 1eb20: 81 e8 ldi r24, 0x81 ; 129 1eb22: 0e 94 e7 6e call 0xddce ; 0xddce lcd_putc_at(9, 4, LCD_STR_BEDTEMP[0]); 1eb26: 40 e8 ldi r20, 0x80 ; 128 1eb28: 64 e0 ldi r22, 0x04 ; 4 1eb2a: 89 e0 ldi r24, 0x09 ; 9 1eb2c: 0e 94 18 6f call 0xde30 ; 0xde30 lcd_printf_P(PSTR("%3d/0"), (int16_t)degBed()); 1eb30: 60 91 ed 04 lds r22, 0x04ED ; 0x8004ed 1eb34: 70 91 ee 04 lds r23, 0x04EE ; 0x8004ee 1eb38: 80 91 ef 04 lds r24, 0x04EF ; 0x8004ef 1eb3c: 90 91 f0 04 lds r25, 0x04F0 ; 0x8004f0 1eb40: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> 1eb44: 7f 93 push r23 1eb46: 6f 93 push r22 1eb48: 1f 93 push r17 1eb4a: 0f 93 push r16 1eb4c: 0e 94 d1 6e call 0xdda2 ; 0xdda2 lcd_putc(LCD_STR_DEGREE[0]); 1eb50: 81 e8 ldi r24, 0x81 ; 129 1eb52: 0e 94 e7 6e call 0xddce ; 0xddce delay_keep_alive(1000); 1eb56: 88 ee ldi r24, 0xE8 ; 232 1eb58: 93 e0 ldi r25, 0x03 ; 3 1eb5a: 0e 94 fc 8c call 0x119f8 ; 0x119f8 serialecho_temperatures(); 1eb5e: 0e 94 76 77 call 0xeeec ; 0xeeec 1eb62: 0f b6 in r0, 0x3f ; 63 1eb64: f8 94 cli 1eb66: de bf out 0x3e, r29 ; 62 1eb68: 0f be out 0x3f, r0 ; 63 1eb6a: cd bf out 0x3d, r28 ; 61 1eb6c: 9d cf rjmp .-198 ; 0x1eaa8 } fanSpeed = fanSpeedBckp; 1eb6e: d0 92 e5 03 sts 0x03E5, r13 ; 0x8003e5 lcd_update_enable(true); 1eb72: 81 e0 ldi r24, 0x01 ; 1 1eb74: 0e 94 3d 6f call 0xde7a ; 0xde7a lcd_detect_IRsensor(); } } #endif lcd_wait_for_cool_down(); lcd_clear(); 1eb78: 0e 94 2b 6f call 0xde56 ; 0xde56 lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_START)); 1eb7c: 82 ee ldi r24, 0xE2 ; 226 1eb7e: 98 e4 ldi r25, 0x48 ; 72 1eb80: 0e 94 c4 72 call 0xe588 ; 0xe588 1eb84: ac 01 movw r20, r24 1eb86: 60 e0 ldi r22, 0x00 ; 0 1eb88: 80 e0 ldi r24, 0x00 ; 0 1eb8a: 0e 94 0c 6f call 0xde18 ; 0xde18 #ifdef TMC2130 FORCE_HIGH_POWER_START; 1eb8e: 81 e0 ldi r24, 0x01 ; 1 1eb90: 0e 94 c8 66 call 0xcd90 ; 0xcd90 #endif // TMC2130 FORCE_BL_ON_START; 1eb94: 81 e0 ldi r24, 0x01 ; 1 1eb96: 0e 94 61 8a call 0x114c2 ; 0x114c2 _delay(2000); 1eb9a: 60 ed ldi r22, 0xD0 ; 208 1eb9c: 77 e0 ldi r23, 0x07 ; 7 1eb9e: 80 e0 ldi r24, 0x00 ; 0 1eba0: 90 e0 ldi r25, 0x00 ; 0 1eba2: 0f 94 29 27 call 0x24e52 ; 0x24e52 KEEPALIVE_STATE(IN_HANDLER); 1eba6: 82 e0 ldi r24, 0x02 ; 2 1eba8: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be _progress = lcd_selftest_screen(TestScreen::ExtruderFan, _progress, 3, true, 2000); 1ebac: 00 ed ldi r16, 0xD0 ; 208 1ebae: 17 e0 ldi r17, 0x07 ; 7 1ebb0: 21 e0 ldi r18, 0x01 ; 1 1ebb2: 43 e0 ldi r20, 0x03 ; 3 1ebb4: 60 e0 ldi r22, 0x00 ; 0 1ebb6: 80 e0 ldi r24, 0x00 ; 0 1ebb8: 0e 94 54 da call 0x1b4a8 ; 0x1b4a8 1ebbc: 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 1ebbe: 83 e0 ldi r24, 0x03 ; 3 1ebc0: 0e 94 73 75 call 0xeae6 ; 0xeae6 lcd_selftest_setfan(0); // print fan off 1ebc4: 80 e0 ldi r24, 0x00 ; 0 1ebc6: 0e 94 35 f5 call 0x1ea6a ; 0x1ea6a lcd_selftest_measure_fans(2, 18, 2); 1ebca: 62 e0 ldi r22, 0x02 ; 2 1ebcc: 82 e0 ldi r24, 0x02 ; 2 1ebce: 0f 94 a4 a0 call 0x34148 ; 0x34148 setExtruderAutoFanState(0); // hotend fan off 1ebd2: 80 e0 ldi r24, 0x00 ; 0 1ebd4: 0e 94 73 75 call 0xeae6 ; 0xeae6 if (fan_speed[0] < failThr) { 1ebd8: c0 90 c7 03 lds r12, 0x03C7 ; 0x8003c7 1ebdc: d0 90 c8 03 lds r13, 0x03C8 ; 0x8003c8 1ebe0: 94 e1 ldi r25, 0x14 ; 20 1ebe2: c9 16 cp r12, r25 1ebe4: d1 04 cpc r13, r1 1ebe6: 5c f1 brlt .+86 ; 0x1ec3e lcd_selftest_error(TestError::ExtruderFan, "", ""); } if (_result) { _progress = lcd_selftest_screen(TestScreen::PrintFan, _progress, 3, true, 2000); 1ebe8: 21 e0 ldi r18, 0x01 ; 1 1ebea: 43 e0 ldi r20, 0x03 ; 3 1ebec: 6f 2d mov r22, r15 1ebee: 81 e0 ldi r24, 0x01 ; 1 1ebf0: 0e 94 54 da call 0x1b4a8 ; 0x1b4a8 1ebf4: f8 2e mov r15, r24 return FanCheck::SwappedFan; } break; case 1: lcd_selftest_setfan(255); 1ebf6: 8f ef ldi r24, 0xFF ; 255 1ebf8: 0e 94 35 f5 call 0x1ea6a ; 0x1ea6a lcd_selftest_measure_fans(5, 18, 3); 1ebfc: 63 e0 ldi r22, 0x03 ; 3 1ebfe: 85 e0 ldi r24, 0x05 ; 5 1ec00: 0f 94 a4 a0 call 0x34148 ; 0x34148 lcd_selftest_setfan(0); 1ec04: 80 e0 ldi r24, 0x00 ; 0 1ec06: 0e 94 35 f5 call 0x1ea6a ; 0x1ea6a if (fan_speed[1] < failThr) { 1ec0a: 80 91 c9 03 lds r24, 0x03C9 ; 0x8003c9 1ec0e: 90 91 ca 03 lds r25, 0x03CA ; 0x8003ca 1ec12: 84 31 cpi r24, 0x14 ; 20 1ec14: 91 05 cpc r25, r1 1ec16: cc f4 brge .+50 ; 0x1ec4a #else //defined(TACH_1) _result = lcd_selftest_manual_fan_check(1, false); #endif //defined(TACH_1) if (!_result) { lcd_selftest_error(TestError::PrintFan, "", ""); //print fan not spinning 1ec18: 66 ef ldi r22, 0xF6 ; 246 1ec1a: 72 e0 ldi r23, 0x02 ; 2 1ec1c: 85 e0 ldi r24, 0x05 ; 5 1ec1e: 0f 94 29 9f call 0x33e52 ; 0x33e52 } } if (_swapped_fan) { 1ec22: 96 e4 ldi r25, 0x46 ; 70 1ec24: c9 16 cp r12, r25 1ec26: d1 04 cpc r13, r1 1ec28: 9c f4 brge .+38 ; 0x1ec50 { _progress = lcd_selftest_screen(TestScreen::AllCorrect, _progress, 3, true, 5000); //all correct } else { _progress = lcd_selftest_screen(TestScreen::Failed, _progress, 3, true, 5000); 1ec2a: 08 e8 ldi r16, 0x88 ; 136 1ec2c: 13 e1 ldi r17, 0x13 ; 19 1ec2e: 21 e0 ldi r18, 0x01 ; 1 1ec30: 43 e0 ldi r20, 0x03 ; 3 1ec32: 6f 2d mov r22, r15 1ec34: 8d e0 ldi r24, 0x0D ; 13 1ec36: 0e 94 54 da call 0x1b4a8 ; 0x1b4a8 1ec3a: e1 2c mov r14, r1 1ec3c: 49 c1 rjmp .+658 ; 0x1eed0 #else //defined(TACH_0) _result = lcd_selftest_manual_fan_check(0, false); #endif //defined(TACH_0) if (!_result) { lcd_selftest_error(TestError::ExtruderFan, "", ""); 1ec3e: 66 ef ldi r22, 0xF6 ; 246 1ec40: 72 e0 ldi r23, 0x02 ; 2 1ec42: 86 e0 ldi r24, 0x06 ; 6 lcd_selftest_error(TestError::PrintFan, "", ""); } } else { // fans are swapped lcd_selftest_error(TestError::SwappedFan, "", ""); 1ec44: 0f 94 29 9f call 0x33e52 ; 0x33e52 1ec48: f0 cf rjmp .-32 ; 0x1ec2a lcd_selftest_measure_fans(5, 18, 3); lcd_selftest_setfan(0); if (fan_speed[1] < failThr) { return FanCheck::PrintFan; } if (fan_speed[1] < printFanThr) { 1ec4a: 86 34 cpi r24, 0x46 ; 70 1ec4c: 91 05 cpc r25, r1 1ec4e: 54 f4 brge .+20 ; 0x1ec64 } } if (_swapped_fan) { //turn on print fan and check that left hotend fan is not spinning _result = lcd_selftest_manual_fan_check(1, true); 1ec50: 60 e0 ldi r22, 0x00 ; 0 1ec52: 81 e0 ldi r24, 0x01 ; 1 1ec54: 0f 94 16 a0 call 0x3402c ; 0x3402c if (_result) { 1ec58: 81 11 cpse r24, r1 1ec5a: 68 c1 rjmp .+720 ; 0x1ef2c lcd_selftest_error(TestError::PrintFan, "", ""); } } else { // fans are swapped lcd_selftest_error(TestError::SwappedFan, "", ""); 1ec5c: 66 ef ldi r22, 0xF6 ; 246 1ec5e: 72 e0 ldi r23, 0x02 ; 2 1ec60: 89 e0 ldi r24, 0x09 ; 9 1ec62: f0 cf rjmp .-32 ; 0x1ec44 { lcd_selftest_error(TestError::PrintFan, "", ""); //print fan not spinning } } if (_swapped_fan) { 1ec64: 86 e4 ldi r24, 0x46 ; 70 1ec66: c8 16 cp r12, r24 1ec68: d1 04 cpc r13, r1 1ec6a: 94 f7 brge .-28 ; 0x1ec50 } } if (_result) { _progress = lcd_selftest_screen(TestScreen::FansOk, _progress, 3, true, 2000); 1ec6c: 00 ed ldi r16, 0xD0 ; 208 1ec6e: 17 e0 ldi r17, 0x07 ; 7 1ec70: 21 e0 ldi r18, 0x01 ; 1 1ec72: 43 e0 ldi r20, 0x03 ; 3 1ec74: 6f 2d mov r22, r15 1ec76: 82 e0 ldi r24, 0x02 ; 2 1ec78: 0e 94 54 da call 0x1b4a8 ; 0x1b4a8 1ec7c: f8 2e mov r15, r24 static bool lcd_selfcheck_endstops() { bool _result = true; if ( 1ec7e: 1c 9b sbis 0x03, 4 ; 3 1ec80: 18 c0 rjmp .+48 ; 0x1ecb2 { #ifndef TMC2130 if ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) current_position[0] += 10; if ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) current_position[1] += 10; #endif //!TMC2130 if ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1) current_position[2] += 10; 1ec82: 1c 9b sbis 0x03, 4 ; 3 1ec84: 16 c0 rjmp .+44 ; 0x1ecb2 1ec86: 20 e0 ldi r18, 0x00 ; 0 1ec88: 30 e0 ldi r19, 0x00 ; 0 1ec8a: 40 e2 ldi r20, 0x20 ; 32 1ec8c: 51 e4 ldi r21, 0x41 ; 65 1ec8e: 60 91 99 06 lds r22, 0x0699 ; 0x800699 1ec92: 70 91 9a 06 lds r23, 0x069A ; 0x80069a 1ec96: 80 91 9b 06 lds r24, 0x069B ; 0x80069b 1ec9a: 90 91 9c 06 lds r25, 0x069C ; 0x80069c 1ec9e: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 1eca2: 60 93 99 06 sts 0x0699, r22 ; 0x800699 1eca6: 70 93 9a 06 sts 0x069A, r23 ; 0x80069a 1ecaa: 80 93 9b 06 sts 0x069B, r24 ; 0x80069b 1ecae: 90 93 9c 06 sts 0x069C, r25 ; 0x80069c } plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1ecb2: 60 e0 ldi r22, 0x00 ; 0 1ecb4: 70 e0 ldi r23, 0x00 ; 0 1ecb6: 84 e3 ldi r24, 0x34 ; 52 1ecb8: 92 e4 ldi r25, 0x42 ; 66 1ecba: 0f 94 04 c0 call 0x38008 ; 0x38008 st_synchronize(); 1ecbe: 0f 94 a3 42 call 0x28546 ; 0x28546 if ( 1ecc2: 1c 9b sbis 0x03, 4 ; 3 1ecc4: 3d c1 rjmp .+634 ; 0x1ef40 ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) || #endif //!TMC2130 ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1)) { _result = false; char _error[4] = ""; 1ecc6: 1a 82 std Y+2, r1 ; 0x02 1ecc8: 19 82 std Y+1, r1 ; 0x01 1ecca: 1c 82 std Y+4, r1 ; 0x04 1eccc: 1b 82 std Y+3, r1 ; 0x03 #ifndef TMC2130 if ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) strcat(_error, "X"); 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"); 1ecce: 1c 9b sbis 0x03, 4 ; 3 1ecd0: 06 c0 rjmp .+12 ; 0x1ecde 1ecd2: 65 ee ldi r22, 0xE5 ; 229 1ecd4: 72 e0 ldi r23, 0x02 ; 2 1ecd6: ce 01 movw r24, r28 1ecd8: 01 96 adiw r24, 0x01 ; 1 1ecda: 0f 94 23 e2 call 0x3c446 ; 0x3c446 lcd_selftest_error(TestError::Endstops, _error, ""); 1ecde: be 01 movw r22, r28 1ece0: 6f 5f subi r22, 0xFF ; 255 1ece2: 7f 4f sbci r23, 0xFF ; 255 1ece4: 82 e0 ldi r24, 0x02 ; 2 1ece6: 0f 94 29 9f call 0x33e52 ; 0x33e52 ((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; 1ecea: 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(); 1ecec: 0f 94 2e 38 call 0x2705c ; 0x2705c manage_inactivity(true); 1ecf0: 81 e0 ldi r24, 0x01 ; 1 1ecf2: 0e 94 c7 8a call 0x1158e ; 0x1158e { _progress = lcd_selftest_screen(TestScreen::FansOk, _progress, 3, true, 2000); _result = lcd_selfcheck_endstops(); //With TMC2130, only the Z probe is tested. } if (_result) 1ecf6: 11 23 and r17, r17 1ecf8: 09 f4 brne .+2 ; 0x1ecfc 1ecfa: 97 cf rjmp .-210 ; 0x1ec2a { //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); 1ecfc: 00 ed ldi r16, 0xD0 ; 208 1ecfe: 17 e0 ldi r17, 0x07 ; 7 1ed00: 21 e0 ldi r18, 0x01 ; 1 1ed02: 43 e0 ldi r20, 0x03 ; 3 1ed04: 6f 2d mov r22, r15 1ed06: 84 e0 ldi r24, 0x04 ; 4 1ed08: 0e 94 54 da call 0x1b4a8 ; 0x1b4a8 1ed0c: f8 2e mov r15, r24 #ifdef TMC2130 _result = lcd_selfcheck_axis_sg(X_AXIS); 1ed0e: 80 e0 ldi r24, 0x00 ; 0 1ed10: 0e 94 0e dd call 0x1ba1c ; 0x1ba1c } if (_result) 1ed14: 88 23 and r24, r24 1ed16: 09 f4 brne .+2 ; 0x1ed1a 1ed18: 88 cf rjmp .-240 ; 0x1ec2a { _progress = lcd_selftest_screen(TestScreen::AxisX, _progress, 3, true, 0); 1ed1a: 10 e0 ldi r17, 0x00 ; 0 1ed1c: 00 e0 ldi r16, 0x00 ; 0 1ed1e: 21 e0 ldi r18, 0x01 ; 1 1ed20: 43 e0 ldi r20, 0x03 ; 3 1ed22: 6f 2d mov r22, r15 1ed24: 84 e0 ldi r24, 0x04 ; 4 1ed26: 0e 94 54 da call 0x1b4a8 ; 0x1b4a8 } if (_result) { _progress = lcd_selftest_screen(TestScreen::AxisY, _progress, 3, true, 1500); 1ed2a: 0c ed ldi r16, 0xDC ; 220 1ed2c: 15 e0 ldi r17, 0x05 ; 5 1ed2e: 21 e0 ldi r18, 0x01 ; 1 1ed30: 43 e0 ldi r20, 0x03 ; 3 1ed32: 68 2f mov r22, r24 1ed34: 85 e0 ldi r24, 0x05 ; 5 1ed36: 0e 94 54 da call 0x1b4a8 ; 0x1b4a8 1ed3a: f8 2e mov r15, r24 #ifdef TMC2130 _result = lcd_selfcheck_axis_sg(Y_AXIS); 1ed3c: 81 e0 ldi r24, 0x01 ; 1 1ed3e: 0e 94 0e dd call 0x1ba1c ; 0x1ba1c #else _result = lcd_selfcheck_axis(Y_AXIS, Y_MAX_POS); #endif // TMC2130 } if (_result) 1ed42: 88 23 and r24, r24 1ed44: 09 f4 brne .+2 ; 0x1ed48 1ed46: 71 cf rjmp .-286 ; 0x1ec2a { _progress = lcd_selftest_screen(TestScreen::AxisZ, _progress, 3, true, 0); 1ed48: 10 e0 ldi r17, 0x00 ; 0 1ed4a: 00 e0 ldi r16, 0x00 ; 0 1ed4c: 21 e0 ldi r18, 0x01 ; 1 1ed4e: 43 e0 ldi r20, 0x03 ; 3 1ed50: 6f 2d mov r22, r15 1ed52: 86 e0 ldi r24, 0x06 ; 6 1ed54: 0e 94 54 da call 0x1b4a8 ; 0x1b4a8 1ed58: f8 2e mov r15, r24 if (_result) { #ifdef TMC2130 tmc2130_home_exit(); 1ed5a: 0f 94 7f 25 call 0x24afe ; 0x24afe 1ed5e: 10 92 b7 02 sts 0x02B7, r1 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> enable_endstops(false); #endif //homeaxis(X_AXIS); //homeaxis(Y_AXIS); current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 1ed62: ea e0 ldi r30, 0x0A ; 10 1ed64: f6 ea ldi r31, 0xA6 ; 166 1ed66: 85 91 lpm r24, Z+ 1ed68: 95 91 lpm r25, Z+ 1ed6a: a5 91 lpm r26, Z+ 1ed6c: b4 91 lpm r27, Z 1ed6e: 80 93 91 06 sts 0x0691, r24 ; 0x800691 1ed72: 90 93 92 06 sts 0x0692, r25 ; 0x800692 1ed76: a0 93 93 06 sts 0x0693, r26 ; 0x800693 1ed7a: b0 93 94 06 sts 0x0694, r27 ; 0x800694 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4+1); 1ed7e: ee e0 ldi r30, 0x0E ; 14 1ed80: f6 ea ldi r31, 0xA6 ; 166 1ed82: 65 91 lpm r22, Z+ 1ed84: 75 91 lpm r23, Z+ 1ed86: 85 91 lpm r24, Z+ 1ed88: 94 91 lpm r25, Z #ifdef TMC2130 //current_position[X_AXIS] += 0; current_position[Y_AXIS] += 4; 1ed8a: 20 e0 ldi r18, 0x00 ; 0 1ed8c: 30 e0 ldi r19, 0x00 ; 0 1ed8e: 40 e8 ldi r20, 0x80 ; 128 1ed90: 50 e4 ldi r21, 0x40 ; 64 1ed92: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 1ed96: 60 93 95 06 sts 0x0695, r22 ; 0x800695 1ed9a: 70 93 96 06 sts 0x0696, r23 ; 0x800696 1ed9e: 80 93 97 06 sts 0x0697, r24 ; 0x800697 1eda2: 90 93 98 06 sts 0x0698, r25 ; 0x800698 #endif //TMC2130 raise_z(10); 1eda6: 60 e0 ldi r22, 0x00 ; 0 1eda8: 70 e0 ldi r23, 0x00 ; 0 1edaa: 80 e2 ldi r24, 0x20 ; 32 1edac: 91 e4 ldi r25, 0x41 ; 65 1edae: 0e 94 f9 6d call 0xdbf2 ; 0xdbf2 set_destination_to_current(); 1edb2: 0e 94 52 68 call 0xd0a4 ; 0xd0a4 _progress = lcd_selftest_screen(TestScreen::AxisZ, _progress, 3, true, 1500); 1edb6: 0c ed ldi r16, 0xDC ; 220 1edb8: 15 e0 ldi r17, 0x05 ; 5 1edba: 21 e0 ldi r18, 0x01 ; 1 1edbc: 43 e0 ldi r20, 0x03 ; 3 1edbe: 6f 2d mov r22, r15 1edc0: 86 e0 ldi r24, 0x06 ; 6 1edc2: 0e 94 54 da call 0x1b4a8 ; 0x1b4a8 #ifdef TMC2130 homeaxis(Z_AXIS); //In case of failure, the code gets stuck in this function. 1edc6: 50 e0 ldi r21, 0x00 ; 0 1edc8: 40 e0 ldi r20, 0x00 ; 0 1edca: 61 e0 ldi r22, 0x01 ; 1 1edcc: 82 e0 ldi r24, 0x02 ; 2 1edce: 0e 94 83 7a call 0xf506 ; 0xf506 #else _result = lcd_selfcheck_axis(Z_AXIS, Z_MAX_POS); #endif //TMC2130 //raise Z to not damage the bed during and hotend testing raise_z(20); 1edd2: 60 e0 ldi r22, 0x00 ; 0 1edd4: 70 e0 ldi r23, 0x00 ; 0 1edd6: 80 ea ldi r24, 0xA0 ; 160 1edd8: 91 e4 ldi r25, 0x41 ; 65 1edda: 0e 94 f9 6d call 0xdbf2 ; 0xdbf2 } #ifdef TMC2130 if (_result) { raise_z(10); 1edde: 60 e0 ldi r22, 0x00 ; 0 1ede0: 70 e0 ldi r23, 0x00 ; 0 1ede2: 80 e2 ldi r24, 0x20 ; 32 1ede4: 91 e4 ldi r25, 0x41 ; 65 1ede6: 0e 94 f9 6d call 0xdbf2 ; 0xdbf2 _progress = lcd_selftest_screen(TestScreen::Home, 0, 2, true, 0); 1edea: 10 e0 ldi r17, 0x00 ; 0 1edec: 00 e0 ldi r16, 0x00 ; 0 1edee: 21 e0 ldi r18, 0x01 ; 1 1edf0: 42 e0 ldi r20, 0x02 ; 2 1edf2: 60 e0 ldi r22, 0x00 ; 0 1edf4: 8e e0 ldi r24, 0x0E ; 14 1edf6: 0e 94 54 da call 0x1b4a8 ; 0x1b4a8 bool bres = tmc2130_home_calibrate(X_AXIS); 1edfa: 80 e0 ldi r24, 0x00 ; 0 1edfc: 0f 94 71 22 call 0x244e2 ; 0x244e2 1ee00: e8 2e mov r14, r24 _progress = lcd_selftest_screen(TestScreen::Home, 1, 2, true, 0); 1ee02: 21 e0 ldi r18, 0x01 ; 1 1ee04: 42 e0 ldi r20, 0x02 ; 2 1ee06: 61 e0 ldi r22, 0x01 ; 1 1ee08: 8e e0 ldi r24, 0x0E ; 14 1ee0a: 0e 94 54 da call 0x1b4a8 ; 0x1b4a8 bres &= tmc2130_home_calibrate(Y_AXIS); 1ee0e: 81 e0 ldi r24, 0x01 ; 1 1ee10: 0f 94 71 22 call 0x244e2 ; 0x244e2 1ee14: e8 22 and r14, r24 _progress = lcd_selftest_screen(TestScreen::Home, 2, 2, true, 0); 1ee16: 21 e0 ldi r18, 0x01 ; 1 1ee18: 42 e0 ldi r20, 0x02 ; 2 1ee1a: 62 e0 ldi r22, 0x02 ; 2 1ee1c: 8e e0 ldi r24, 0x0E ; 14 1ee1e: 0e 94 54 da call 0x1b4a8 ; 0x1b4a8 1ee22: f8 2e mov r15, r24 if (bres) 1ee24: ee 20 and r14, r14 1ee26: 09 f4 brne .+2 ; 0x1ee2a 1ee28: 00 cf rjmp .-512 ; 0x1ec2a 1ee2a: 61 e0 ldi r22, 0x01 ; 1 1ee2c: 88 ef ldi r24, 0xF8 ; 248 1ee2e: 9e e0 ldi r25, 0x0E ; 14 1ee30: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 } #endif //TMC2130 if (_result) { _progress = lcd_selftest_screen(TestScreen::Bed, _progress, 3, true, 2000); 1ee34: 00 ed ldi r16, 0xD0 ; 208 1ee36: 17 e0 ldi r17, 0x07 ; 7 1ee38: 21 e0 ldi r18, 0x01 ; 1 1ee3a: 43 e0 ldi r20, 0x03 ; 3 1ee3c: 6f 2d mov r22, r15 1ee3e: 87 e0 ldi r24, 0x07 ; 7 1ee40: 0e 94 54 da call 0x1b4a8 ; 0x1b4a8 1ee44: f8 2e mov r15, r24 _result = lcd_selfcheck_check_heater(true); 1ee46: 81 e0 ldi r24, 0x01 ; 1 1ee48: 0e 94 ee db call 0x1b7dc ; 0x1b7dc } if (_result) 1ee4c: 88 23 and r24, r24 1ee4e: 09 f4 brne .+2 ; 0x1ee52 1ee50: ec ce rjmp .-552 ; 0x1ec2a { _progress = lcd_selftest_screen(TestScreen::Hotend, _progress, 3, true, 1000); 1ee52: 08 ee ldi r16, 0xE8 ; 232 1ee54: 13 e0 ldi r17, 0x03 ; 3 1ee56: 21 e0 ldi r18, 0x01 ; 1 1ee58: 43 e0 ldi r20, 0x03 ; 3 1ee5a: 6f 2d mov r22, r15 1ee5c: 88 e0 ldi r24, 0x08 ; 8 1ee5e: 0e 94 54 da call 0x1b4a8 ; 0x1b4a8 1ee62: f8 2e mov r15, r24 _result = lcd_selfcheck_check_heater(false); 1ee64: 80 e0 ldi r24, 0x00 ; 0 1ee66: 0e 94 ee db call 0x1b7dc ; 0x1b7dc 1ee6a: e8 2e mov r14, r24 } if (_result) 1ee6c: 88 23 and r24, r24 1ee6e: 09 f4 brne .+2 ; 0x1ee72 1ee70: dc ce rjmp .-584 ; 0x1ec2a { _progress = lcd_selftest_screen(TestScreen::HotendOk, _progress, 3, true, 2000); //nozzle ok 1ee72: 00 ed ldi r16, 0xD0 ; 208 1ee74: 17 e0 ldi r17, 0x07 ; 7 1ee76: 21 e0 ldi r18, 0x01 ; 1 1ee78: 43 e0 ldi r20, 0x03 ; 3 1ee7a: 6f 2d mov r22, r15 1ee7c: 89 e0 ldi r24, 0x09 ; 9 1ee7e: 0e 94 54 da call 0x1b4a8 ; 0x1b4a8 } } else #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_IR) || (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) { #if FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125 _progress = lcd_selftest_screen(TestScreen::Fsensor, _progress, 3, true, 2000); //check filaments sensor 1ee82: 21 e0 ldi r18, 0x01 ; 1 1ee84: 43 e0 ldi r20, 0x03 ; 3 1ee86: 68 2f mov r22, r24 1ee88: 8a e0 ldi r24, 0x0A ; 10 1ee8a: 0e 94 54 da call 0x1b4a8 ; 0x1b4a8 1ee8e: f8 2e mov r15, r24 #ifdef FILAMENT_SENSOR #if FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125 static bool lcd_selftest_fsensor(void) { fsensor.init(); 1ee90: 0f 94 f4 7a call 0x2f5e8 ; 0x2f5e8 if (fsensor.isError()) 1ee94: 80 91 a9 17 lds r24, 0x17A9 ; 0x8017a9 1ee98: 83 30 cpi r24, 0x03 ; 3 1ee9a: 29 f4 brne .+10 ; 0x1eea6 { lcd_selftest_error(TestError::WiringFsensor, "", ""); 1ee9c: 66 ef ldi r22, 0xF6 ; 246 1ee9e: 72 e0 ldi r23, 0x02 ; 2 1eea0: 8a e0 ldi r24, 0x0A ; 10 1eea2: 0f 94 29 9f call 0x33e52 ; 0x33e52 #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_IR) || (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) { #if FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125 _progress = lcd_selftest_screen(TestScreen::Fsensor, _progress, 3, true, 2000); //check filaments sensor _result = lcd_selftest_fsensor(); if (_result) 1eea6: 80 91 a9 17 lds r24, 0x17A9 ; 0x8017a9 1eeaa: 83 30 cpi r24, 0x03 ; 3 1eeac: 09 f4 brne .+2 ; 0x1eeb0 1eeae: bd ce rjmp .-646 ; 0x1ec2a { _progress = lcd_selftest_screen(TestScreen::FsensorOk, _progress, 3, true, 2000); //fil sensor OK 1eeb0: 00 ed ldi r16, 0xD0 ; 208 1eeb2: 17 e0 ldi r17, 0x07 ; 7 1eeb4: 21 e0 ldi r18, 0x01 ; 1 1eeb6: 43 e0 ldi r20, 0x03 ; 3 1eeb8: 6f 2d mov r22, r15 1eeba: 8b e0 ldi r24, 0x0B ; 11 1eebc: 0e 94 54 da call 0x1b4a8 ; 0x1b4a8 } } #endif //FILAMENT_SENSOR if (_result) { _progress = lcd_selftest_screen(TestScreen::AllCorrect, _progress, 3, true, 5000); //all correct 1eec0: 08 e8 ldi r16, 0x88 ; 136 1eec2: 13 e1 ldi r17, 0x13 ; 19 1eec4: 21 e0 ldi r18, 0x01 ; 1 1eec6: 43 e0 ldi r20, 0x03 ; 3 1eec8: 68 2f mov r22, r24 1eeca: 8c e0 ldi r24, 0x0C ; 12 1eecc: 0e 94 54 da call 0x1b4a8 ; 0x1b4a8 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 1eed0: 10 92 d3 03 sts 0x03D3, r1 ; 0x8003d3 <_ZL24lcd_status_message_level.lto_priv.451> else { _progress = lcd_selftest_screen(TestScreen::Failed, _progress, 3, true, 5000); } lcd_reset_alert_level(); enquecommand_P(MSG_M84); 1eed4: 61 e0 ldi r22, 0x01 ; 1 1eed6: 81 e1 ldi r24, 0x11 ; 17 1eed8: 9c e6 ldi r25, 0x6C ; 108 1eeda: 0e 94 38 88 call 0x11070 ; 0x11070 lcd_update_enable(true); 1eede: 81 e0 ldi r24, 0x01 ; 1 1eee0: 0e 94 3d 6f call 0xde7a ; 0xde7a if (_result) 1eee4: ee 20 and r14, r14 1eee6: 71 f1 breq .+92 ; 0x1ef44 { calibration_status_set(CALIBRATION_STATUS_SELFTEST); 1eee8: 81 e0 ldi r24, 0x01 ; 1 1eeea: 0e 94 6d ee call 0x1dcda ; 0x1dcda lcd_setstatuspgm(_T(MSG_SELFTEST_OK)); 1eeee: 84 ed ldi r24, 0xD4 ; 212 1eef0: 98 e4 ldi r25, 0x48 ; 72 1eef2: 0e 94 c4 72 call 0xe588 ; 0xe588 1eef6: 0e 94 38 f1 call 0x1e270 ; 0x1e270 lcd_return_to_status(); 1eefa: 0f 94 7c 1e call 0x23cf8 ; 0x23cf8 else { LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); } #ifdef TMC2130 FORCE_HIGH_POWER_END; 1eefe: 80 e0 ldi r24, 0x00 ; 0 1ef00: 0e 94 c8 66 call 0xcd90 ; 0xcd90 #endif // TMC2130 FORCE_BL_ON_END; 1ef04: 80 e0 ldi r24, 0x00 ; 0 1ef06: 0e 94 61 8a call 0x114c2 ; 0x114c2 KEEPALIVE_STATE(NOT_BUSY); 1ef0a: 81 e0 ldi r24, 0x01 ; 1 1ef0c: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be return(_result); } 1ef10: 8e 2d mov r24, r14 1ef12: 0f 90 pop r0 1ef14: 0f 90 pop r0 1ef16: 0f 90 pop r0 1ef18: 0f 90 pop r0 1ef1a: df 91 pop r29 1ef1c: cf 91 pop r28 1ef1e: 1f 91 pop r17 1ef20: 0f 91 pop r16 1ef22: ff 90 pop r15 1ef24: ef 90 pop r14 1ef26: df 90 pop r13 1ef28: cf 90 pop r12 1ef2a: 08 95 ret if (_swapped_fan) { //turn on print fan and check that left hotend fan is not spinning _result = lcd_selftest_manual_fan_check(1, true); if (_result) { //print fan is stil turned on; check that it is spinning _result = lcd_selftest_manual_fan_check(1, false, true); 1ef2c: 61 e0 ldi r22, 0x01 ; 1 1ef2e: 80 e0 ldi r24, 0x00 ; 0 1ef30: 0f 94 16 a0 call 0x3402c ; 0x3402c if (!_result){ 1ef34: 81 11 cpse r24, r1 1ef36: 9a ce rjmp .-716 ; 0x1ec6c lcd_selftest_error(TestError::PrintFan, "", ""); 1ef38: 66 ef ldi r22, 0xF6 ; 246 1ef3a: 72 e0 ldi r23, 0x02 ; 2 1ef3c: 85 e0 ldi r24, 0x05 ; 5 1ef3e: 82 ce rjmp .-764 ; 0x1ec44 #endif //not defined TMC2130 static bool lcd_selfcheck_endstops() { bool _result = true; 1ef40: 11 e0 ldi r17, 0x01 ; 1 1ef42: d4 ce rjmp .-600 ; 0x1ecec lcd_setstatuspgm(_T(MSG_SELFTEST_OK)); lcd_return_to_status(); } else { LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); 1ef44: 81 ee ldi r24, 0xE1 ; 225 1ef46: 96 e5 ldi r25, 0x56 ; 86 1ef48: 0e 94 c4 72 call 0xe588 ; 0xe588 1ef4c: 62 e0 ldi r22, 0x02 ; 2 1ef4e: 0e 94 f8 f0 call 0x1e1f0 ; 0x1e1f0 1ef52: d5 cf rjmp .-86 ; 0x1eefe 0001ef54 : } #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) static void lcd_selftest_v() { (void)lcd_selftest(); 1ef54: 0c 94 3b f5 jmp 0x1ea76 ; 0x1ea76 0001ef58 : return 0; } bool resume_print_checks() { // reset the lcd status so that a newer error will be shown lcd_return_to_status(); 1ef58: 0f 94 7c 1e call 0x23cf8 ; 0x23cf8 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 1ef5c: 10 92 d3 03 sts 0x03D3, r1 ; 0x8003d3 <_ZL24lcd_status_message_level.lto_priv.451> temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; 1ef60: 80 91 1a 05 lds r24, 0x051A ; 0x80051a <_ZL16temp_error_state.lto_priv.454> 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() 1ef64: 81 11 cpse r24, r1 1ef66: 32 c0 rjmp .+100 ; 0x1efcc } static bool fan_error_selftest() { #ifdef FANCHECK if (!fans_check_enabled) return 0; 1ef68: 80 91 38 02 lds r24, 0x0238 ; 0x800238 1ef6c: 81 11 cpse r24, r1 1ef6e: 02 c0 rjmp .+4 ; 0x1ef74 #endif ) { return false; // abort if error persists } return true; 1ef70: 81 e0 ldi r24, 0x01 ; 1 1ef72: 08 95 ret static bool fan_error_selftest() { #ifdef FANCHECK if (!fans_check_enabled) return 0; lcd_selftest_setfan(255); 1ef74: 8f ef ldi r24, 0xFF ; 255 1ef76: 0e 94 35 f5 call 0x1ea6a ; 0x1ea6a setExtruderAutoFanState(3); //force enables the hotend fan 1ef7a: 83 e0 ldi r24, 0x03 ; 3 1ef7c: 0e 94 73 75 call 0xeae6 ; 0xeae6 #ifdef FAN_SOFT_PWM extruder_autofan_last_check = _millis(); 1ef80: 0f 94 22 29 call 0x25244 ; 0x25244 1ef84: 60 93 bf 17 sts 0x17BF, r22 ; 0x8017bf 1ef88: 70 93 c0 17 sts 0x17C0, r23 ; 0x8017c0 1ef8c: 80 93 c1 17 sts 0x17C1, r24 ; 0x8017c1 1ef90: 90 93 c2 17 sts 0x17C2, r25 ; 0x8017c2 fan_measuring = true; 1ef94: 81 e0 ldi r24, 0x01 ; 1 1ef96: 80 93 6e 06 sts 0x066E, r24 ; 0x80066e #endif //FAN_SOFT_PWM _delay(1000); //delay_keep_alive would turn off hotend fan, because temerature is too low (maybe) 1ef9a: 68 ee ldi r22, 0xE8 ; 232 1ef9c: 73 e0 ldi r23, 0x03 ; 3 1ef9e: 80 e0 ldi r24, 0x00 ; 0 1efa0: 90 e0 ldi r25, 0x00 ; 0 1efa2: 0f 94 29 27 call 0x24e52 ; 0x24e52 manage_heater(); 1efa6: 0f 94 2e 38 call 0x2705c ; 0x2705c setExtruderAutoFanState(1); //releases lock on the hotend fan 1efaa: 81 e0 ldi r24, 0x01 ; 1 1efac: 0e 94 73 75 call 0xeae6 ; 0xeae6 lcd_selftest_setfan(0); 1efb0: 80 e0 ldi r24, 0x00 ; 0 1efb2: 0e 94 35 f5 call 0x1ea6a ; 0x1ea6a #ifdef TACH_0 if (fan_speed[0] <= 20) { //hotend fan error 1efb6: 80 91 c7 03 lds r24, 0x03C7 ; 0x8003c7 1efba: 90 91 c8 03 lds r25, 0x03C8 ; 0x8003c8 1efbe: 45 97 sbiw r24, 0x15 ; 21 1efc0: 3c f4 brge .+14 ; 0x1efd0 LCD_ALERTMESSAGERPGM(MSG_FANCHECK_HOTEND); 1efc2: 62 e0 ldi r22, 0x02 ; 2 1efc4: 8c e1 ldi r24, 0x1C ; 28 1efc6: 9b e6 ldi r25, 0x6B ; 107 return 1; } #endif #ifdef TACH_1 if (fan_speed[1] <= 20) { //print fan error LCD_ALERTMESSAGERPGM(MSG_FANCHECK_PRINT); 1efc8: 0e 94 f8 f0 call 0x1e1f0 ; 0x1e1f0 if (get_temp_error() #ifdef FANCHECK || fan_error_selftest() #endif ) { return false; // abort if error persists 1efcc: 80 e0 ldi r24, 0x00 ; 0 } return true; } 1efce: 08 95 ret LCD_ALERTMESSAGERPGM(MSG_FANCHECK_HOTEND); return 1; } #endif #ifdef TACH_1 if (fan_speed[1] <= 20) { //print fan error 1efd0: 80 91 c9 03 lds r24, 0x03C9 ; 0x8003c9 1efd4: 90 91 ca 03 lds r25, 0x03CA ; 0x8003ca 1efd8: 45 97 sbiw r24, 0x15 ; 21 1efda: 54 f6 brge .-108 ; 0x1ef70 LCD_ALERTMESSAGERPGM(MSG_FANCHECK_PRINT); 1efdc: 62 e0 ldi r22, 0x02 ; 2 1efde: 88 e0 ldi r24, 0x08 ; 8 1efe0: 9b e6 ldi r25, 0x6B ; 107 1efe2: f2 cf rjmp .-28 ; 0x1efc8 0001efe4 : //! @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; 1efe4: 0e 94 ac f7 call 0x1ef58 ; 0x1ef58 1efe8: 88 23 and r24, r24 1efea: 51 f1 breq .+84 ; 0x1f040 cmdqueue_serial_disabled = false; 1efec: 10 92 a4 03 sts 0x03A4, r1 ; 0x8003a4 lcd_setstatuspgm(_T(MSG_FINISHING_MOVEMENTS)); 1eff0: 85 e9 ldi r24, 0x95 ; 149 1eff2: 93 e5 ldi r25, 0x53 ; 83 1eff4: 0e 94 c4 72 call 0xe588 ; 0xe588 1eff8: 0e 94 38 f1 call 0x1e270 ; 0x1e270 st_synchronize(); 1effc: 0f 94 a3 42 call 0x28546 ; 0x28546 custom_message_type = CustomMsg::Resuming; 1f000: 88 e0 ldi r24, 0x08 ; 8 1f002: 80 93 c3 06 sts 0x06C3, r24 ; 0x8006c3 { #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(); 1f006: 0e 94 f9 74 call 0xe9f2 ; 0xe9f2 setExtruderAutoFanState(1); 1f00a: 81 e0 ldi r24, 0x01 ; 1 1f00c: 0e 94 73 75 call 0xeae6 ; 0xeae6 // resume processing USB commands again and restore hotend fan state (in case the print was // stopped due to a thermal error) hotendDefaultAutoFanState(); Stopped = false; 1f010: 10 92 10 05 sts 0x0510, r1 ; 0x800510 restore_print_from_ram_and_continue(default_retraction); 1f014: 60 e0 ldi r22, 0x00 ; 0 1f016: 70 e0 ldi r23, 0x00 ; 0 1f018: 80 e8 ldi r24, 0x80 ; 128 1f01a: 9f e3 ldi r25, 0x3F ; 63 1f01c: 0e 94 5c 68 call 0xd0b8 ; 0xd0b8 did_pause_print = false; 1f020: 10 92 e2 03 sts 0x03E2, r1 ; 0x8003e2 // Resume the print job timer if it was running if (print_job_timer.isPaused()) print_job_timer.start(); 1f024: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 1f028: 82 30 cpi r24, 0x02 ; 2 1f02a: 11 f4 brne .+4 ; 0x1f030 1f02c: 0f 94 48 42 call 0x28490 ; 0x28490 refresh_cmd_timeout(); 1f030: 0e 94 db 66 call 0xcdb6 ; 0xcdb6 SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_RESUMED); 1f034: 81 e3 ldi r24, 0x31 ; 49 1f036: 9b e6 ldi r25, 0x6B ; 107 1f038: 0e 94 93 79 call 0xf326 ; 0xf326 custom_message_type = CustomMsg::Status; 1f03c: 10 92 c3 06 sts 0x06C3, r1 ; 0x8006c3 } 1f040: 08 95 ret 0001f042 : //! @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; 1f042: 0e 94 ac f7 call 0x1ef58 ; 0x1ef58 1f046: 88 23 and r24, r24 1f048: 21 f0 breq .+8 ; 0x1f052 // resume the usb host SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_ASK_RESUME); 1f04a: 82 e4 ldi r24, 0x42 ; 66 1f04c: 9b e6 ldi r25, 0x6B ; 107 1f04e: 0c 94 93 79 jmp 0xf326 ; 0xf326 } 1f052: 08 95 ret 0001f054 : } /// @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) { 1f054: cf 92 push r12 1f056: df 92 push r13 1f058: ef 92 push r14 1f05a: ff 92 push r15 1f05c: cf 93 push r28 1f05e: 6b 01 movw r12, r22 1f060: 7c 01 movw r14, r24 custom_message_type = CustomMsg::FilamentLoading; 1f062: 82 e0 ldi r24, 0x02 ; 2 1f064: 80 93 c3 06 sts 0x06C3, r24 ; 0x8006c3 lcd_setstatuspgm(_T(MSG_UNLOADING_FILAMENT)); 1f068: 88 e3 ldi r24, 0x38 ; 56 1f06a: 93 e5 ldi r25, 0x53 ; 83 1f06c: 0e 94 c4 72 call 0xe588 ; 0xe588 1f070: 0e 94 38 f1 call 0x1e270 ; 0x1e270 FSensorBlockRunout fsBlockRunout; 1f074: 0f 94 69 86 call 0x30cd2 ; 0x30cd2 current_position[E_AXIS] -= FILAMENT_UNLOAD_FAST_RETRACT_LENGTH; 1f078: 20 e0 ldi r18, 0x00 ; 0 1f07a: 30 e0 ldi r19, 0x00 ; 0 1f07c: 44 e3 ldi r20, 0x34 ; 52 1f07e: 52 e4 ldi r21, 0x42 ; 66 1f080: 60 91 9d 06 lds r22, 0x069D ; 0x80069d 1f084: 70 91 9e 06 lds r23, 0x069E ; 0x80069e 1f088: 80 91 9f 06 lds r24, 0x069F ; 0x80069f 1f08c: 90 91 a0 06 lds r25, 0x06A0 ; 0x8006a0 1f090: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 1f094: 60 93 9d 06 sts 0x069D, r22 ; 0x80069d 1f098: 70 93 9e 06 sts 0x069E, r23 ; 0x80069e 1f09c: 80 93 9f 06 sts 0x069F, r24 ; 0x80069f 1f0a0: 90 93 a0 06 sts 0x06A0, r25 ; 0x8006a0 plan_buffer_line_curposXYZE(FILAMENT_UNLOAD_FAST_RETRACT_FEEDRATE); 1f0a4: 6a e0 ldi r22, 0x0A ; 10 1f0a6: 77 e5 ldi r23, 0x57 ; 87 1f0a8: 8d ea ldi r24, 0xAD ; 173 1f0aa: 92 e4 ldi r25, 0x42 ; 66 1f0ac: 0f 94 04 c0 call 0x38008 ; 0x38008 st_synchronize(); 1f0b0: 0f 94 a3 42 call 0x28546 ; 0x28546 current_position[E_AXIS] -= FILAMENT_UNLOAD_SLOW_RETRACT_LENGTH; 1f0b4: 20 e0 ldi r18, 0x00 ; 0 1f0b6: 30 e0 ldi r19, 0x00 ; 0 1f0b8: 4c e0 ldi r20, 0x0C ; 12 1f0ba: 52 e4 ldi r21, 0x42 ; 66 1f0bc: 60 91 9d 06 lds r22, 0x069D ; 0x80069d 1f0c0: 70 91 9e 06 lds r23, 0x069E ; 0x80069e 1f0c4: 80 91 9f 06 lds r24, 0x069F ; 0x80069f 1f0c8: 90 91 a0 06 lds r25, 0x06A0 ; 0x8006a0 1f0cc: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 1f0d0: 60 93 9d 06 sts 0x069D, r22 ; 0x80069d 1f0d4: 70 93 9e 06 sts 0x069E, r23 ; 0x80069e 1f0d8: 80 93 9f 06 sts 0x069F, r24 ; 0x80069f 1f0dc: 90 93 a0 06 sts 0x06A0, r25 ; 0x8006a0 plan_buffer_line_curposXYZE(FILAMENT_UNLOAD_SLOW_RETRACT_FEEDRATE); 1f0e0: 69 e2 ldi r22, 0x29 ; 41 1f0e2: 7c e5 ldi r23, 0x5C ; 92 1f0e4: 85 e8 ldi r24, 0x85 ; 133 1f0e6: 91 e4 ldi r25, 0x41 ; 65 1f0e8: 0f 94 04 c0 call 0x38008 ; 0x38008 st_synchronize(); 1f0ec: 0f 94 a3 42 call 0x28546 ; 0x28546 // Configurable length, by default it's 0. // only plan the move if the length is set to a non-zero value if (unloadLength) 1f0f0: 20 e0 ldi r18, 0x00 ; 0 1f0f2: 30 e0 ldi r19, 0x00 ; 0 1f0f4: a9 01 movw r20, r18 1f0f6: c7 01 movw r24, r14 1f0f8: b6 01 movw r22, r12 1f0fa: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 1f0fe: 88 23 and r24, r24 1f100: e1 f0 breq .+56 ; 0x1f13a { current_position[E_AXIS] += unloadLength; 1f102: a7 01 movw r20, r14 1f104: 96 01 movw r18, r12 1f106: 60 91 9d 06 lds r22, 0x069D ; 0x80069d 1f10a: 70 91 9e 06 lds r23, 0x069E ; 0x80069e 1f10e: 80 91 9f 06 lds r24, 0x069F ; 0x80069f 1f112: 90 91 a0 06 lds r25, 0x06A0 ; 0x8006a0 1f116: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 1f11a: 60 93 9d 06 sts 0x069D, r22 ; 0x80069d 1f11e: 70 93 9e 06 sts 0x069E, r23 ; 0x80069e 1f122: 80 93 9f 06 sts 0x069F, r24 ; 0x80069f 1f126: 90 93 a0 06 sts 0x06A0, r25 ; 0x8006a0 plan_buffer_line_curposXYZE(FILAMENT_CHANGE_UNLOAD_FEEDRATE); 1f12a: 60 e0 ldi r22, 0x00 ; 0 1f12c: 70 e0 ldi r23, 0x00 ; 0 1f12e: 80 e2 ldi r24, 0x20 ; 32 1f130: 91 e4 ldi r25, 0x41 ; 65 1f132: 0f 94 04 c0 call 0x38008 ; 0x38008 st_synchronize(); 1f136: 0f 94 a3 42 call 0x28546 ; 0x28546 } lcd_display_message_fullscreen_P(_T(MSG_PULL_OUT_FILAMENT)); 1f13a: 84 ed ldi r24, 0xD4 ; 212 1f13c: 95 e4 ldi r25, 0x45 ; 69 1f13e: 0e 94 c4 72 call 0xe588 ; 0xe588 1f142: 0f 94 ba 1f call 0x23f74 ; 0x23f74 //disable extruder steppers so filament can be removed disable_e0(); 1f146: 14 9a sbi 0x02, 4 ; 2 _delay(100); 1f148: 64 e6 ldi r22, 0x64 ; 100 1f14a: 70 e0 ldi r23, 0x00 ; 0 1f14c: 80 e0 ldi r24, 0x00 ; 0 1f14e: 90 e0 ldi r25, 0x00 ; 0 1f150: 0f 94 29 27 call 0x24e52 ; 0x24e52 Sound_MakeSound(e_SOUND_TYPE_StandardPrompt); 1f154: 82 e0 ldi r24, 0x02 ; 2 1f156: 0f 94 c2 4d call 0x29b84 ; 0x29b84 1f15a: c3 e3 ldi r28, 0x33 ; 51 uint8_t counterBeep = 0; while (!lcd_clicked() && (counterBeep < 50)) { 1f15c: 0e 94 15 71 call 0xe22a ; 0xe22a 1f160: 81 11 cpse r24, r1 1f162: 07 c0 rjmp .+14 ; 0x1f172 1f164: c1 50 subi r28, 0x01 ; 1 1f166: 29 f0 breq .+10 ; 0x1f172 delay_keep_alive(100); 1f168: 84 e6 ldi r24, 0x64 ; 100 1f16a: 90 e0 ldi r25, 0x00 ; 0 1f16c: 0e 94 fc 8c call 0x119f8 ; 0x119f8 1f170: f5 cf rjmp .-22 ; 0x1f15c counterBeep++; } st_synchronize(); 1f172: 0f 94 a3 42 call 0x28546 ; 0x28546 while (lcd_clicked()) delay_keep_alive(100); 1f176: 0e 94 15 71 call 0xe22a ; 0xe22a 1f17a: 88 23 and r24, r24 1f17c: 29 f0 breq .+10 ; 0x1f188 1f17e: 84 e6 ldi r24, 0x64 ; 100 1f180: 90 e0 ldi r25, 0x00 ; 0 1f182: 0e 94 fc 8c call 0x119f8 ; 0x119f8 1f186: f7 cf rjmp .-18 ; 0x1f176 lcd_update_enable(true); 1f188: 81 e0 ldi r24, 0x01 ; 1 1f18a: 0e 94 3d 6f call 0xde7a ; 0xde7a lcd_setstatuspgm(MSG_WELCOME); 1f18e: 86 eb ldi r24, 0xB6 ; 182 1f190: 90 e7 ldi r25, 0x70 ; 112 1f192: 0e 94 38 f1 call 0x1e270 ; 0x1e270 custom_message_type = CustomMsg::Status; 1f196: 10 92 c3 06 sts 0x06C3, r1 ; 0x8006c3 clearFilamentAction(); 1f19a: 0f 94 69 20 call 0x240d2 ; 0x240d2 } 1f19e: cf 91 pop r28 1f1a0: ff 90 pop r15 1f1a2: ef 90 pop r14 1f1a4: df 90 pop r13 1f1a6: cf 90 pop r12 #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) // SERIAL_ECHOLNPGM("FSBlockRunout"); } FSensorBlockRunout::~FSensorBlockRunout() { fsensor.settings_init(); // restore filament runout state. 1f1a8: 0d 94 ad 7a jmp 0x2f55a ; 0x2f55a 0001f1ac : //! ---------------------- | ---------------- //! 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) { 1f1ac: af 92 push r10 1f1ae: bf 92 push r11 1f1b0: cf 92 push r12 1f1b2: df 92 push r13 1f1b4: ef 92 push r14 1f1b6: ff 92 push r15 1f1b8: 0f 93 push r16 1f1ba: 1f 93 push r17 1f1bc: cf 93 push r28 1f1be: 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); 1f1c0: 88 23 and r24, r24 1f1c2: 29 f0 breq .+10 ; 0x1f1ce 1f1c4: 61 e0 ldi r22, 0x01 ; 1 1f1c6: 8f e5 ldi r24, 0x5F ; 95 1f1c8: 9f e0 ldi r25, 0x0F ; 15 1f1ca: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 FORCE_BL_ON_START; 1f1ce: 81 e0 ldi r24, 0x01 ; 1 1f1d0: 0e 94 61 8a call 0x114c2 ; 0x114c2 while (!end) { printf_P(PSTR("Wizard state: %d\n"), (uint8_t)state); 1f1d4: 82 e1 ldi r24, 0x12 ; 18 1f1d6: e8 2e mov r14, r24 1f1d8: 8a e8 ldi r24, 0x8A ; 138 1f1da: f8 2e mov r15, r24 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 1f1dc: 97 ed ldi r25, 0xD7 ; 215 1f1de: c9 2e mov r12, r25 1f1e0: d1 2c mov r13, r1 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 1f1e2: 2c e3 ldi r18, 0x3C ; 60 1f1e4: a2 2e mov r10, r18 1f1e6: b1 2c mov r11, r1 1f1e8: 0c 2f mov r16, r28 1f1ea: 10 e0 ldi r17, 0x00 ; 0 1f1ec: 1f 92 push r1 1f1ee: cf 93 push r28 1f1f0: ff 92 push r15 1f1f2: ef 92 push r14 1f1f4: 0f 94 99 da call 0x3b532 ; 0x3b532 switch (state) { 1f1f8: 0f 90 pop r0 1f1fa: 0f 90 pop r0 1f1fc: 0f 90 pop r0 1f1fe: 0f 90 pop r0 1f200: cf 30 cpi r28, 0x0F ; 15 1f202: a0 f7 brcc .-24 ; 0x1f1ec 1f204: f8 01 movw r30, r16 1f206: 88 27 eor r24, r24 1f208: e7 5f subi r30, 0xF7 ; 247 1f20a: f6 40 sbci r31, 0x06 ; 6 1f20c: 8f 4f sbci r24, 0xFF ; 255 1f20e: 0d 94 e7 dc jmp 0x3b9ce ; 0x3b9ce <__tablejump2__> 1f212: 18 f9 .word 0xf918 ; ???? 1f214: 68 f9 .word 0xf968 ; ???? 1f216: 8e f9 .word 0xf98e ; ???? 1f218: 9a f9 .word 0xf99a ; ???? 1f21a: a4 f9 bld r26, 4 1f21c: de f9 .word 0xf9de ; ???? 1f21e: ea f9 .word 0xf9ea ; ???? 1f220: 04 fa bst r0, 4 1f222: 1b fa .word 0xfa1b ; ???? 1f224: 15 fa bst r1, 5 1f226: 1f fa .word 0xfa1f ; ???? 1f228: 2d fa .word 0xfa2d ; ???? 1f22a: 36 fa bst r3, 6 1f22c: 4a fa .word 0xfa4a ; ???? 1f22e: 4a fa .word 0xfa4a ; ???? // 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; 1f230: 10 92 a8 0d sts 0x0DA8, r1 ; 0x800da8 if( eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)==2){ 1f234: 8f e5 ldi r24, 0x5F ; 95 1f236: 9f e0 ldi r25, 0x0F ; 15 1f238: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 1f23c: 82 30 cpi r24, 0x02 ; 2 1f23e: 39 f4 brne .+14 ; 0x1f24e // printer pre-assembled: finish remaining steps lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_WELCOME_SHIPPING)); 1f240: 83 ea ldi r24, 0xA3 ; 163 1f242: 92 e4 ldi r25, 0x42 ; 66 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)); 1f244: 0e 94 c4 72 call 0xe588 ; 0xe588 1f248: 0f 94 c7 1f call 0x23f8e ; 0x23f8e 1f24c: 0f c0 rjmp .+30 ; 0x1f26c // 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); 1f24e: 8e e3 ldi r24, 0x3E ; 62 1f250: 92 e4 ldi r25, 0x42 ; 66 1f252: 0e 94 c4 72 call 0xe588 ; 0xe588 1f256: 40 e0 ldi r20, 0x00 ; 0 1f258: 60 e0 ldi r22, 0x00 ; 0 1f25a: 0f 94 fb 4e call 0x29df6 ; 0x29df6 if (wizard_event == LCD_LEFT_BUTTON_CHOICE) { 1f25e: 81 11 cpse r24, r1 1f260: 07 c0 rjmp .+14 ; 0x1f270 1f262: 61 e0 ldi r22, 0x01 ; 1 1f264: 8f e5 ldi r24, 0x5F ; 95 1f266: 9f e0 ldi r25, 0x0F ; 15 1f268: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 state = S::Lay1CalCold; } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_ADDITIONAL_SHEETS)); state = S::Restore; 1f26c: c1 e0 ldi r28, 0x01 ; 1 1f26e: bc cf rjmp .-136 ; 0x1f1e8 1f270: 60 e0 ldi r22, 0x00 ; 0 1f272: 8f e5 ldi r24, 0x5F ; 95 1f274: 9f e0 ldi r25, 0x0F ; 15 1f276: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 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); 1f27a: 10 e0 ldi r17, 0x00 ; 0 1f27c: 00 e0 ldi r16, 0x00 ; 0 end = true; break; } } FORCE_BL_ON_END; 1f27e: 80 e0 ldi r24, 0x00 ; 0 1f280: 0e 94 61 8a call 0x114c2 ; 0x114c2 const char *msg = NULL; printf_P(_N("Wizard end state: %d\n"), (uint8_t)state); 1f284: 1f 93 push r17 1f286: 0f 93 push r16 1f288: 86 eb ldi r24, 0xB6 ; 182 1f28a: 9a e6 ldi r25, 0x6A ; 106 1f28c: 9f 93 push r25 1f28e: 8f 93 push r24 1f290: 0f 94 99 da call 0x3b532 ; 0x3b532 switch (state) { 1f294: 0f 90 pop r0 1f296: 0f 90 pop r0 1f298: 0f 90 pop r0 1f29a: 0f 90 pop r0 1f29c: cd 30 cpi r28, 0x0D ; 13 1f29e: 09 f4 brne .+2 ; 0x1f2a2 1f2a0: ff c0 rjmp .+510 ; 0x1f4a0 1f2a2: ce 30 cpi r28, 0x0E ; 14 1f2a4: 09 f4 brne .+2 ; 0x1f2a8 1f2a6: 11 c1 rjmp .+546 ; 0x1f4ca case S::Run: // user interrupted msg = _T(MSG_WIZARD_QUIT); 1f2a8: 8d e5 ldi r24, 0x5D ; 93 1f2aa: 9f e3 ldi r25, 0x3F ; 63 FORCE_BL_ON_END; const char *msg = NULL; printf_P(_N("Wizard end state: %d\n"), (uint8_t)state); switch (state) { 1f2ac: cc 23 and r28, r28 1f2ae: 09 f4 brne .+2 ; 0x1f2b2 1f2b0: 0e c1 rjmp .+540 ; 0x1f4ce break; } if (msg) { lcd_show_fullscreen_message_and_wait_P(msg); } lcd_update_enable(true); 1f2b2: 81 e0 ldi r24, 0x01 ; 1 1f2b4: 0e 94 3d 6f call 0xde7a ; 0xde7a lcd_update(2); 1f2b8: 82 e0 ldi r24, 0x02 ; 2 } 1f2ba: cf 91 pop r28 1f2bc: 1f 91 pop r17 1f2be: 0f 91 pop r16 1f2c0: ff 90 pop r15 1f2c2: ef 90 pop r14 1f2c4: df 90 pop r13 1f2c6: cf 90 pop r12 1f2c8: bf 90 pop r11 1f2ca: af 90 pop r10 } if (msg) { lcd_show_fullscreen_message_and_wait_P(msg); } lcd_update_enable(true); lcd_update(2); 1f2cc: 0c 94 bf 6e jmp 0xdd7e ; 0xdd7e lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 1f2d0: 10 92 d3 03 sts 0x03D3, r1 ; 0x8003d3 <_ZL24lcd_status_message_level.lto_priv.451> 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)) { 1f2d4: 81 e0 ldi r24, 0x01 ; 1 1f2d6: 0e 94 7a ee call 0x1dcf4 ; 0x1dcf4 state = S::Selftest; 1f2da: 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)) { 1f2dc: 88 23 and r24, r24 1f2de: 09 f4 brne .+2 ; 0x1f2e2 1f2e0: 83 cf rjmp .-250 ; 0x1f1e8 state = S::Selftest; } else if (!calibration_status_get(CALIBRATION_STATUS_XYZ)) { 1f2e2: 82 e0 ldi r24, 0x02 ; 2 1f2e4: 0e 94 7a ee call 0x1dcf4 ; 0x1dcf4 // S::Xyz *includes* S::Z so it needs to come before // to avoid repeating Z alignment state = S::Xyz; 1f2e8: 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)) { 1f2ea: 88 23 and r24, r24 1f2ec: 09 f4 brne .+2 ; 0x1f2f0 1f2ee: 7c cf rjmp .-264 ; 0x1f1e8 // 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)) { 1f2f0: 84 e0 ldi r24, 0x04 ; 4 1f2f2: 0e 94 7a ee call 0x1dcf4 ; 0x1dcf4 state = S::Z; 1f2f6: 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)) { 1f2f8: 88 23 and r24, r24 1f2fa: 09 f4 brne .+2 ; 0x1f2fe 1f2fc: 75 cf rjmp .-278 ; 0x1f1e8 state = S::Z; #ifdef THERMAL_MODEL } else if (!calibration_status_get(CALIBRATION_STATUS_THERMAL_MODEL)) { 1f2fe: 88 e0 ldi r24, 0x08 ; 8 1f300: 0e 94 7a ee call 0x1dcf4 ; 0x1dcf4 state = S::ThermalModel; 1f304: c5 e0 ldi r28, 0x05 ; 5 // to avoid repeating Z alignment state = S::Xyz; } else if (!calibration_status_get(CALIBRATION_STATUS_Z)) { state = S::Z; #ifdef THERMAL_MODEL } else if (!calibration_status_get(CALIBRATION_STATUS_THERMAL_MODEL)) { 1f306: 88 23 and r24, r24 1f308: 09 f4 brne .+2 ; 0x1f30c 1f30a: 6e cf rjmp .-292 ; 0x1f1e8 state = S::ThermalModel; #endif //THERMAL_MODEL } else if (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) { 1f30c: 80 e1 ldi r24, 0x10 ; 16 1f30e: 0e 94 7a ee call 0x1dcf4 ; 0x1dcf4 state = S::IsFil; } else { // all required steps completed, finish successfully state = S::Finish; 1f312: cd e0 ldi r28, 0x0D ; 13 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)) { 1f314: 81 11 cpse r24, r1 1f316: 68 cf rjmp .-304 ; 0x1f1e8 state = S::IsFil; 1f318: c6 e0 ldi r28, 0x06 ; 6 1f31a: 66 cf rjmp .-308 ; 0x1f1e8 // all required steps completed, finish successfully state = S::Finish; } break; case S::Selftest: lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_SELFTEST)); 1f31c: 85 ef ldi r24, 0xF5 ; 245 1f31e: 91 e4 ldi r25, 0x41 ; 65 1f320: 0e 94 c4 72 call 0xe588 ; 0xe588 1f324: 0f 94 c7 1f call 0x23f8e ; 0x23f8e wizard_event = lcd_selftest(); 1f328: 0e 94 3b f5 call 0x1ea76 ; 0x1ea76 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); 1f32c: 81 11 cpse r24, r1 1f32e: 9e cf rjmp .-196 ; 0x1f26c } 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); 1f330: ce e0 ldi r28, 0x0E ; 14 1f332: 5a cf rjmp .-332 ; 0x1f1e8 break; case S::Xyz: lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_XYZ_CAL)); 1f334: 87 eb ldi r24, 0xB7 ; 183 1f336: 91 e4 ldi r25, 0x41 ; 65 1f338: 0e 94 c4 72 call 0xe588 ; 0xe588 1f33c: 0f 94 c7 1f call 0x23f8e ; 0x23f8e wizard_event = gcode_M45(false, 0); 1f340: 80 e0 ldi r24, 0x00 ; 0 1f342: 0f 94 60 8d call 0x31ac0 ; 0x31ac0 1f346: f2 cf rjmp .-28 ; 0x1f32c state = (wizard_event ? S::Restore : S::Failed); break; case S::Z: lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_SHIPPING_HELPERS)); 1f348: 8f e8 ldi r24, 0x8F ; 143 1f34a: 91 e4 ldi r25, 0x41 ; 65 1f34c: 0e 94 c4 72 call 0xe588 ; 0xe588 1f350: 0f 94 c7 1f call 0x23f8e ; 0x23f8e lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_TEST_PRINT)); 1f354: 81 e6 ldi r24, 0x61 ; 97 1f356: 91 e4 ldi r25, 0x41 ; 65 1f358: 0e 94 c4 72 call 0xe588 ; 0xe588 1f35c: 0f 94 c7 1f call 0x23f8e ; 0x23f8e lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_Z_CAL)); 1f360: 81 e4 ldi r24, 0x41 ; 65 1f362: 91 e4 ldi r25, 0x41 ; 65 1f364: 0e 94 c4 72 call 0xe588 ; 0xe588 1f368: 0f 94 c7 1f call 0x23f8e ; 0x23f8e wizard_event = gcode_M45(true, 0); 1f36c: 81 e0 ldi r24, 0x01 ; 1 1f36e: 0f 94 60 8d call 0x31ac0 ; 0x31ac0 if (!wizard_event) { 1f372: 88 23 and r24, r24 1f374: e9 f2 breq .-70 ; 0x1f330 state = S::Failed; } else { raise_z_above(MIN_Z_FOR_SWAP); 1f376: 60 e0 ldi r22, 0x00 ; 0 1f378: 70 e0 ldi r23, 0x00 ; 0 1f37a: 88 ed ldi r24, 0xD8 ; 216 1f37c: 91 e4 ldi r25, 0x41 ; 65 1f37e: 0e 94 78 6e call 0xdcf0 ; 0xdcf0 if(!MMU2::mmu2.Enabled()) { 1f382: 80 91 b9 13 lds r24, 0x13B9 ; 0x8013b9 1f386: 81 30 cpi r24, 0x01 ; 1 1f388: 09 f4 brne .+2 ; 0x1f38c 1f38a: 70 cf rjmp .-288 ; 0x1f26c return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 1f38c: d0 92 b6 0d sts 0x0DB6, r13 ; 0x800db6 1f390: c0 92 b5 0d sts 0x0DB5, r12 ; 0x800db5 //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)); 1f394: 8c e1 ldi r24, 0x1C ; 28 1f396: 91 e4 ldi r25, 0x41 ; 65 1f398: 0e 94 c4 72 call 0xe588 ; 0xe588 1f39c: 0f 94 ba 1f call 0x23f74 ; 0x23f74 wait_preheat(); 1f3a0: 0e 94 30 e2 call 0x1c460 ; 0x1c460 unload_filament(FILAMENTCHANGE_FINALRETRACT); // unload current filament 1f3a4: 60 e0 ldi r22, 0x00 ; 0 1f3a6: 70 e0 ldi r23, 0x00 ; 0 1f3a8: cb 01 movw r24, r22 1f3aa: 0e 94 2a f8 call 0x1f054 ; 0x1f054 lcd_wizard_load(); // load filament 1f3ae: 0e 94 f3 ce call 0x19de6 ; 0x19de6 1f3b2: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 1f3b6: 10 92 b5 0d sts 0x0DB5, r1 ; 0x800db5 1f3ba: 58 cf rjmp .-336 ; 0x1f26c state = S::Restore; } break; #ifdef THERMAL_MODEL case S::ThermalModel: lcd_show_fullscreen_message_and_wait_P(_T(MSG_TM_CAL)); 1f3bc: 8c ed ldi r24, 0xDC ; 220 1f3be: 90 e4 ldi r25, 0x40 ; 64 1f3c0: 0e 94 c4 72 call 0xe588 ; 0xe588 1f3c4: 0f 94 c7 1f call 0x23f8e ; 0x23f8e lcd_commands_type = LcdCommands::ThermalModel; 1f3c8: 85 e0 ldi r24, 0x05 ; 5 1f3ca: 80 93 b3 0d sts 0x0DB3, r24 ; 0x800db3 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); 1f3ce: 05 e0 ldi r16, 0x05 ; 5 1f3d0: 10 e0 ldi r17, 0x00 ; 0 1f3d2: 55 cf rjmp .-342 ; 0x1f27e 1f3d4: d0 92 b6 0d sts 0x0DB6, r13 ; 0x800db6 1f3d8: c0 92 b5 0d sts 0x0DB5, r12 ; 0x800db5 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 1f3dc: b0 92 72 06 sts 0x0672, r11 ; 0x800672 1f3e0: a0 92 71 06 sts 0x0671, r10 ; 0x800671 #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); 1f3e4: 86 ec ldi r24, 0xC6 ; 198 1f3e6: 90 e4 ldi r25, 0x40 ; 64 1f3e8: 0e 94 c4 72 call 0xe588 ; 0xe588 1f3ec: 41 e0 ldi r20, 0x01 ; 1 1f3ee: 60 e0 ldi r22, 0x00 ; 0 1f3f0: 0f 94 fb 4e call 0x29df6 ; 0x29df6 if (wizard_event == LCD_LEFT_BUTTON_CHOICE) { 1f3f4: 88 23 and r24, r24 1f3f6: 09 f1 breq .+66 ; 0x1f43a state = S::Lay1CalCold; } else { // MIDDLE_BUTTON_CHOICE if(MMU2::mmu2.Enabled()) state = S::LoadFilCold; 1f3f8: 80 91 b9 13 lds r24, 0x13B9 ; 0x8013b9 else state = S::Preheat; 1f3fc: c7 e0 ldi r28, 0x07 ; 7 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); if (wizard_event == LCD_LEFT_BUTTON_CHOICE) { state = S::Lay1CalCold; } else { // MIDDLE_BUTTON_CHOICE if(MMU2::mmu2.Enabled()) state = S::LoadFilCold; 1f3fe: 81 30 cpi r24, 0x01 ; 1 1f400: 09 f0 breq .+2 ; 0x1f404 1f402: f2 ce rjmp .-540 ; 0x1f1e8 1f404: c8 e0 ldi r28, 0x08 ; 8 1f406: f0 ce rjmp .-544 ; 0x1f1e8 else state = S::Preheat; } break; case S::Preheat: menu_goto(lcd_preheat_menu, 0, true); 1f408: 20 e0 ldi r18, 0x00 ; 0 1f40a: 41 e0 ldi r20, 0x01 ; 1 1f40c: 70 e0 ldi r23, 0x00 ; 0 1f40e: 60 e0 ldi r22, 0x00 ; 0 1f410: 82 e4 ldi r24, 0x42 ; 66 1f412: 99 e3 ldi r25, 0x39 ; 57 1f414: 0f 94 7b d1 call 0x3a2f6 ; 0x3a2f6 lcd_show_fullscreen_message_and_wait_P(_T(MSG_SEL_PREHEAT_TEMP)); 1f418: 85 e8 ldi r24, 0x85 ; 133 1f41a: 90 e4 ldi r25, 0x40 ; 64 1f41c: 0e 94 c4 72 call 0xe588 ; 0xe588 1f420: 0f 94 c7 1f call 0x23f8e ; 0x23f8e 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); 1f424: 07 e0 ldi r16, 0x07 ; 7 1f426: 10 e0 ldi r17, 0x00 ; 0 1f428: 2a cf rjmp .-428 ; 0x1f27e 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(); 1f42a: 0e 94 30 e2 call 0x1c460 ; 0x1c460 lcd_wizard_load(); 1f42e: 0e 94 f3 ce call 0x19de6 ; 0x19de6 state = S::Lay1CalHot; 1f432: cb e0 ldi r28, 0x0B ; 11 1f434: d9 ce rjmp .-590 ; 0x1f1e8 break; case S::LoadFilCold: lcd_wizard_load(); 1f436: 0e 94 f3 ce call 0x19de6 ; 0x19de6 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; 1f43a: ca e0 ldi r28, 0x0A ; 10 1f43c: d5 ce rjmp .-598 ; 0x1f1e8 case S::LoadFilCold: lcd_wizard_load(); state = S::Lay1CalCold; break; case S::Lay1CalCold: wizard_lay1cal_message(true); 1f43e: 81 e0 ldi r24, 0x01 ; 1 1f440: 0e 94 d5 ce call 0x19daa ; 0x19daa menu_goto(lcd_v2_calibration, 0, true); 1f444: 20 e0 ldi r18, 0x00 ; 0 1f446: 41 e0 ldi r20, 0x01 ; 1 1f448: 70 e0 ldi r23, 0x00 ; 0 1f44a: 60 e0 ldi r22, 0x00 ; 0 1f44c: 80 eb ldi r24, 0xB0 ; 176 1f44e: 94 ee ldi r25, 0xE4 ; 228 1f450: 0f 94 7b d1 call 0x3a2f6 ; 0x3a2f6 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); 1f454: 0a e0 ldi r16, 0x0A ; 10 1f456: 10 e0 ldi r17, 0x00 ; 0 1f458: 12 cf rjmp .-476 ; 0x1f27e 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); 1f45a: 80 e0 ldi r24, 0x00 ; 0 1f45c: 0e 94 d5 ce call 0x19daa ; 0x19daa lcd_commands_type = LcdCommands::Layer1Cal; 1f460: 84 e0 ldi r24, 0x04 ; 4 1f462: 80 93 b3 0d sts 0x0DB3, r24 ; 0x800db3 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); 1f466: 0b e0 ldi r16, 0x0B ; 11 1f468: 10 e0 ldi r17, 0x00 ; 0 1f46a: 09 cf rjmp .-494 ; 0x1f27e 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); 1f46c: 82 e3 ldi r24, 0x32 ; 50 1f46e: 90 e4 ldi r25, 0x40 ; 64 1f470: 0e 94 c4 72 call 0xe588 ; 0xe588 1f474: 41 e0 ldi r20, 0x01 ; 1 1f476: 60 e0 ldi r22, 0x00 ; 0 1f478: 0f 94 fb 4e call 0x29df6 ; 0x29df6 if (wizard_event == LCD_LEFT_BUTTON_CHOICE) 1f47c: 81 11 cpse r24, r1 1f47e: 07 c0 rjmp .+14 ; 0x1f48e { lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_CLEAN_HEATBED)); 1f480: 82 e0 ldi r24, 0x02 ; 2 1f482: 90 e4 ldi r25, 0x40 ; 64 1f484: 0e 94 c4 72 call 0xe588 ; 0xe588 1f488: 0f 94 c7 1f call 0x23f8e ; 0x23f8e 1f48c: d6 cf rjmp .-84 ; 0x1f43a state = S::Lay1CalCold; } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_ADDITIONAL_SHEETS)); 1f48e: 8c e9 ldi r24, 0x9C ; 156 1f490: 9f e3 ldi r25, 0x3F ; 63 1f492: d8 ce rjmp .-592 ; 0x1f244 1f494: 60 e0 ldi r22, 0x00 ; 0 1f496: 8f e5 ldi r24, 0x5F ; 95 1f498: 9f e0 ldi r25, 0x0F ; 15 1f49a: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 1f49e: ef ce rjmp .-546 ; 0x1f27e msg = _T(MSG_WIZARD_QUIT); break; case S::Finish: // we are successfully finished msg = _T(MSG_WIZARD_DONE); 1f4a0: 8e e3 ldi r24, 0x3E ; 62 1f4a2: 9f e3 ldi r25, 0x3F ; 63 1f4a4: 0e 94 c4 72 call 0xe588 ; 0xe588 1f4a8: 8c 01 movw r16, r24 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 1f4aa: 10 92 d3 03 sts 0x03D3, r1 ; 0x8003d3 <_ZL24lcd_status_message_level.lto_priv.451> case S::Finish: // we are successfully finished msg = _T(MSG_WIZARD_DONE); lcd_reset_alert_level(); lcd_setstatuspgm(MSG_WELCOME); 1f4ae: 86 eb ldi r24, 0xB6 ; 182 1f4b0: 90 e7 ldi r25, 0x70 ; 112 1f4b2: 0e 94 38 f1 call 0x1e270 ; 0x1e270 lcd_return_to_status(); 1f4b6: 0f 94 7c 1e call 0x23cf8 ; 0x23cf8 default: // exiting for later re-entry break; } if (msg) { 1f4ba: 01 15 cp r16, r1 1f4bc: 11 05 cpc r17, r1 1f4be: 09 f4 brne .+2 ; 0x1f4c2 1f4c0: f8 ce rjmp .-528 ; 0x1f2b2 lcd_show_fullscreen_message_and_wait_P(msg); 1f4c2: c8 01 movw r24, r16 1f4c4: 0f 94 c7 1f call 0x23f8e ; 0x23f8e 1f4c8: f4 ce rjmp .-536 ; 0x1f2b2 lcd_return_to_status(); break; case S::Failed: // aborted due to failure msg = _T(MSG_WIZARD_CALIBRATION_FAILED); 1f4ca: 8c ed ldi r24, 0xDC ; 220 1f4cc: 9e e3 ldi r25, 0x3E ; 62 1f4ce: 0e 94 c4 72 call 0xe588 ; 0xe588 1f4d2: 8c 01 movw r16, r24 1f4d4: f2 cf rjmp .-28 ; 0x1f4ba 0001f4d6
: void setupUSB() __attribute__((weak)); void setupUSB() { } int main(void) { 1f4d6: cf 93 push r28 1f4d8: df 93 push r29 1f4da: cd b7 in r28, 0x3d ; 61 1f4dc: de b7 in r29, 0x3e ; 62 1f4de: 67 97 sbiw r28, 0x17 ; 23 1f4e0: 0f b6 in r0, 0x3f ; 63 1f4e2: f8 94 cli 1f4e4: de bf out 0x3e, r29 ; 62 1f4e6: 0f be out 0x3f, r0 ; 63 1f4e8: cd bf out 0x3d, r28 ; 61 void init() { // this needs to be called before setup() or some functions won't // work there sei(); 1f4ea: 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); 1f4ec: 84 b5 in r24, 0x24 ; 36 1f4ee: 82 60 ori r24, 0x02 ; 2 1f4f0: 84 bd out 0x24, r24 ; 36 sbi(TCCR0A, WGM00); 1f4f2: 84 b5 in r24, 0x24 ; 36 1f4f4: 81 60 ori r24, 0x01 ; 1 1f4f6: 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); 1f4f8: 85 b5 in r24, 0x25 ; 37 1f4fa: 82 60 ori r24, 0x02 ; 2 1f4fc: 85 bd out 0x25, r24 ; 37 sbi(TCCR0B, CS00); 1f4fe: 85 b5 in r24, 0x25 ; 37 1f500: 81 60 ori r24, 0x01 ; 1 1f502: 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); 1f504: 80 91 6e 00 lds r24, 0x006E ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> 1f508: 81 60 ori r24, 0x01 ; 1 1f50a: 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; 1f50e: 10 92 81 00 sts 0x0081, r1 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> // set timer 1 prescale factor to 64 sbi(TCCR1B, CS11); 1f512: 80 91 81 00 lds r24, 0x0081 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> 1f516: 82 60 ori r24, 0x02 ; 2 1f518: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> #if F_CPU >= 8000000L sbi(TCCR1B, CS10); 1f51c: 80 91 81 00 lds r24, 0x0081 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> 1f520: 81 60 ori r24, 0x01 ; 1 1f522: 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); 1f526: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1f52a: 81 60 ori r24, 0x01 ; 1 1f52c: 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); 1f530: 80 91 b1 00 lds r24, 0x00B1 ; 0x8000b1 <__TEXT_REGION_LENGTH__+0x7c20b1> 1f534: 84 60 ori r24, 0x04 ; 4 1f536: 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); 1f53a: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1f53e: 81 60 ori r24, 0x01 ; 1 1f540: 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 1f544: 80 91 91 00 lds r24, 0x0091 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> 1f548: 82 60 ori r24, 0x02 ; 2 1f54a: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> sbi(TCCR3B, CS30); 1f54e: 80 91 91 00 lds r24, 0x0091 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> 1f552: 81 60 ori r24, 0x01 ; 1 1f554: 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 1f558: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1f55c: 81 60 ori r24, 0x01 ; 1 1f55e: 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 1f562: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 1f566: 82 60 ori r24, 0x02 ; 2 1f568: 80 93 a1 00 sts 0x00A1, r24 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> sbi(TCCR4B, CS40); 1f56c: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 1f570: 81 60 ori r24, 0x01 ; 1 1f572: 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 1f576: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1f57a: 81 60 ori r24, 0x01 ; 1 1f57c: 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 1f580: 80 91 21 01 lds r24, 0x0121 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> 1f584: 82 60 ori r24, 0x02 ; 2 1f586: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> sbi(TCCR5B, CS50); 1f58a: 80 91 21 01 lds r24, 0x0121 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> 1f58e: 81 60 ori r24, 0x01 ; 1 1f590: 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 1f594: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1f598: 81 60 ori r24, 0x01 ; 1 1f59a: 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); 1f59e: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1f5a2: 84 60 ori r24, 0x04 ; 4 1f5a4: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> sbi(ADCSRA, ADPS1); 1f5a8: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1f5ac: 82 60 ori r24, 0x02 ; 2 1f5ae: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> sbi(ADCSRA, ADPS0); 1f5b2: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1f5b6: 81 60 ori r24, 0x01 ; 1 1f5b8: 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); 1f5bc: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1f5c0: 80 68 ori r24, 0x80 ; 128 1f5c2: 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; 1f5c6: 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) { 1f5ca: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 1f5cc: f8 94 cli wdt_reset(); 1f5ce: a8 95 wdr MCUSR &= ~_BV(WDRF); 1f5d0: 84 b7 in r24, 0x34 ; 52 1f5d2: 87 7f andi r24, 0xF7 ; 247 1f5d4: 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" ); 1f5d6: 0f b6 in r0, 0x3f ; 63 1f5d8: f8 94 cli 1f5da: a8 95 wdr 1f5dc: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1f5e0: 88 61 ori r24, 0x18 ; 24 1f5e2: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1f5e6: 10 92 60 00 sts 0x0060, r1 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1f5ea: 0f be out 0x3f, r0 ; 63 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 1f5ec: 9f bf out 0x3f, r25 ; 63 CRITICAL_SECTION_END; } void timer2_init(void) { CRITICAL_SECTION_START; 1f5ee: 9f b7 in r25, 0x3f ; 63 1f5f0: 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 1f5f2: 10 92 b0 00 sts 0x00B0, r1 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> TCCR2B = (4 << CS20); //WGM_2=0, CS_0-2=011 1f5f6: 84 e0 ldi r24, 0x04 ; 4 1f5f8: 80 93 b1 00 sts 0x00B1, r24 ; 0x8000b1 <__TEXT_REGION_LENGTH__+0x7c20b1> //mask timer2 interrupts - enable OVF, disable others TIMSK2 |= (1< 1f600: 81 60 ori r24, 0x01 ; 1 1f602: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> TIMSK2 &= ~(1< 1f60a: 8d 7f andi r24, 0xFD ; 253 1f60c: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> TIMSK2 &= ~(1< 1f614: 8b 7f andi r24, 0xFB ; 251 1f616: 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; 1f61a: 10 92 b3 00 sts 0x00B3, r1 ; 0x8000b3 <__TEXT_REGION_LENGTH__+0x7c20b3> CRITICAL_SECTION_END; 1f61e: 9f bf out 0x3f, r25 ; 63 } void backlight_init() { //check for backlight support on lcd SET_INPUT(LCD_BL_PIN); 1f620: 6b 98 cbi 0x0d, 3 ; 13 WRITE(LCD_BL_PIN,HIGH); 1f622: 73 9a sbi 0x0e, 3 ; 14 _delay(10); 1f624: 6a e0 ldi r22, 0x0A ; 10 1f626: 70 e0 ldi r23, 0x00 ; 0 1f628: 80 e0 ldi r24, 0x00 ; 0 1f62a: 90 e0 ldi r25, 0x00 ; 0 1f62c: 0f 94 29 27 call 0x24e52 ; 0x24e52 backlightSupport = !READ(LCD_BL_PIN); 1f630: 9c b1 in r25, 0x0c ; 12 1f632: 81 e0 ldi r24, 0x01 ; 1 1f634: 29 2f mov r18, r25 1f636: 28 70 andi r18, 0x08 ; 8 1f638: 93 fd sbrc r25, 3 1f63a: 80 e0 ldi r24, 0x00 ; 0 1f63c: 80 93 01 04 sts 0x0401, r24 ; 0x800401 if (!backlightSupport) return; 1f640: 21 11 cpse r18, r1 1f642: 22 c0 rjmp .+68 ; 0x1f688 //initialize backlight backlightMode = eeprom_init_default_byte((uint8_t *)EEPROM_BACKLIGHT_MODE, BACKLIGHT_MODE_AUTO); 1f644: 62 e0 ldi r22, 0x02 ; 2 1f646: 82 e3 ldi r24, 0x32 ; 50 1f648: 9d e0 ldi r25, 0x0D ; 13 1f64a: 0e 94 21 76 call 0xec42 ; 0xec42 1f64e: 80 93 4f 02 sts 0x024F, r24 ; 0x80024f backlightLevel_HIGH = eeprom_init_default_byte((uint8_t *)EEPROM_BACKLIGHT_LEVEL_HIGH, 130); 1f652: 62 e8 ldi r22, 0x82 ; 130 1f654: 84 e3 ldi r24, 0x34 ; 52 1f656: 9d e0 ldi r25, 0x0D ; 13 1f658: 0e 94 21 76 call 0xec42 ; 0xec42 1f65c: 80 93 00 04 sts 0x0400, r24 ; 0x800400 backlightLevel_LOW = eeprom_init_default_byte((uint8_t *)EEPROM_BACKLIGHT_LEVEL_LOW, 50); 1f660: 62 e3 ldi r22, 0x32 ; 50 1f662: 83 e3 ldi r24, 0x33 ; 51 1f664: 9d e0 ldi r25, 0x0D ; 13 1f666: 0e 94 21 76 call 0xec42 ; 0xec42 1f66a: 80 93 ff 03 sts 0x03FF, r24 ; 0x8003ff backlightTimer_period = eeprom_init_default_word((uint16_t *)EEPROM_BACKLIGHT_TIMEOUT, 10); // in seconds 1f66e: 6a e0 ldi r22, 0x0A ; 10 1f670: 70 e0 ldi r23, 0x00 ; 0 1f672: 80 e3 ldi r24, 0x30 ; 48 1f674: 9d e0 ldi r25, 0x0D ; 13 1f676: 0e 94 09 76 call 0xec12 ; 0xec12 1f67a: 90 93 4e 02 sts 0x024E, r25 ; 0x80024e 1f67e: 80 93 4d 02 sts 0x024D, r24 ; 0x80024d SET_OUTPUT(LCD_BL_PIN); 1f682: 6b 9a sbi 0x0d, 3 ; 13 backlightTimer_reset(); 1f684: 0e 94 7a 8a call 0x114f4 ; 0x114f4 return 0; } void lcd_init(void) { WRITE(LCD_PINS_ENABLE,LOW); 1f688: 8f 98 cbi 0x11, 7 ; 17 SET_OUTPUT(LCD_PINS_RS); 1f68a: 55 9a sbi 0x0a, 5 ; 10 SET_OUTPUT(LCD_PINS_ENABLE); 1f68c: 87 9a sbi 0x10, 7 ; 16 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); 1f68e: 85 9a sbi 0x10, 5 ; 16 SET_OUTPUT(LCD_PINS_D5); 1f690: 9c 9a sbi 0x13, 4 ; 19 SET_OUTPUT(LCD_PINS_D6); 1f692: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1f696: 80 68 ori r24, 0x80 ; 128 1f698: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> SET_OUTPUT(LCD_PINS_D7); 1f69c: 9b 9a sbi 0x13, 3 ; 19 #ifdef LCD_8BIT lcd_displayfunction |= LCD_8BITMODE; #endif lcd_displayfunction |= LCD_2LINE; 1f69e: 80 91 10 04 lds r24, 0x0410 ; 0x800410 <_ZL19lcd_displayfunction.lto_priv.549> 1f6a2: 88 60 ori r24, 0x08 ; 8 1f6a4: 80 93 10 04 sts 0x0410, r24 ; 0x800410 <_ZL19lcd_displayfunction.lto_priv.549> 1f6a8: 2f ef ldi r18, 0xFF ; 255 1f6aa: 30 e7 ldi r19, 0x70 ; 112 1f6ac: 82 e0 ldi r24, 0x02 ; 2 1f6ae: 21 50 subi r18, 0x01 ; 1 1f6b0: 30 40 sbci r19, 0x00 ; 0 1f6b2: 80 40 sbci r24, 0x00 ; 0 1f6b4: e1 f7 brne .-8 ; 0x1f6ae 1f6b6: 00 c0 rjmp .+0 ; 0x1f6b8 1f6b8: 00 00 nop _delay_us(50000); lcd_begin(1); //first time init 1f6ba: 81 e0 ldi r24, 0x01 ; 1 1f6bc: 0e 94 63 6f call 0xdec6 ; 0xdec6 fdev_setup_stream(lcdout, lcd_putchar, NULL, _FDEV_SETUP_WRITE); //setup lcdout stream 1f6c0: 8b e0 ldi r24, 0x0B ; 11 1f6c2: 91 e7 ldi r25, 0x71 ; 113 1f6c4: 90 93 0b 04 sts 0x040B, r25 ; 0x80040b <_lcdout+0x9> 1f6c8: 80 93 0a 04 sts 0x040A, r24 ; 0x80040a <_lcdout+0x8> 1f6cc: 10 92 0d 04 sts 0x040D, r1 ; 0x80040d <_lcdout+0xb> 1f6d0: 10 92 0c 04 sts 0x040C, r1 ; 0x80040c <_lcdout+0xa> 1f6d4: 12 e0 ldi r17, 0x02 ; 2 1f6d6: 10 93 05 04 sts 0x0405, r17 ; 0x800405 <_lcdout+0x3> 1f6da: 10 92 0f 04 sts 0x040F, r1 ; 0x80040f <_lcdout+0xd> 1f6de: 10 92 0e 04 sts 0x040E, r1 ; 0x80040e <_lcdout+0xc> void ultralcd_init() { backlight_init(); lcd_init(); lcd_refresh(); 1f6e2: 0e 94 a4 6f call 0xdf48 ; 0xdf48 lcd_longpress_func = menu_lcd_longpress_func; 1f6e6: 86 e6 ldi r24, 0x66 ; 102 1f6e8: 94 ed ldi r25, 0xD4 ; 212 1f6ea: 90 93 17 04 sts 0x0417, r25 ; 0x800417 1f6ee: 80 93 16 04 sts 0x0416, r24 ; 0x800416 lcd_lcdupdate_func = menu_lcd_lcdupdate_func; 1f6f2: 82 ea ldi r24, 0xA2 ; 162 1f6f4: 9a e3 ldi r25, 0x3A ; 58 1f6f6: 90 93 15 04 sts 0x0415, r25 ; 0x800415 1f6fa: 80 93 14 04 sts 0x0414, r24 ; 0x800414 menu_menu = lcd_status_screen; 1f6fe: 86 e4 ldi r24, 0x46 ; 70 1f700: 9a e3 ldi r25, 0x3A ; 58 1f702: 90 93 13 04 sts 0x0413, r25 ; 0x800413 1f706: 80 93 12 04 sts 0x0412, r24 ; 0x800412 SET_INPUT(BTN_EN1); 1f70a: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1f70e: 8b 7f andi r24, 0xFB ; 251 1f710: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> SET_INPUT(BTN_EN2); 1f714: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1f718: 8d 7f andi r24, 0xFD ; 253 1f71a: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> WRITE(BTN_EN1, HIGH); 1f71e: 9f b7 in r25, 0x3f ; 63 1f720: f8 94 cli 1f722: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f726: 84 60 ori r24, 0x04 ; 4 1f728: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f72c: 9f bf out 0x3f, r25 ; 63 WRITE(BTN_EN2, HIGH); 1f72e: 9f b7 in r25, 0x3f ; 63 1f730: f8 94 cli 1f732: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f736: 82 60 ori r24, 0x02 ; 2 1f738: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f73c: 9f bf out 0x3f, r25 ; 63 #if BTN_ENC > 0 SET_INPUT(BTN_ENC); 1f73e: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1f742: 8f 7b andi r24, 0xBF ; 191 1f744: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> WRITE(BTN_ENC, HIGH); 1f748: 9f b7 in r25, 0x3f ; 63 1f74a: f8 94 cli 1f74c: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1f750: 80 64 ori r24, 0x40 ; 64 1f752: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1f756: 9f bf out 0x3f, r25 ; 63 #endif #if defined (SDSUPPORT) && defined(SDCARDDETECT) && (SDCARDDETECT > 0) SET_INPUT(SDCARDDETECT); 1f758: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1f75c: 8e 7f andi r24, 0xFE ; 254 1f75e: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> WRITE(SDCARDDETECT, HIGH); 1f762: 9f b7 in r25, 0x3f ; 63 1f764: f8 94 cli 1f766: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f76a: 81 60 ori r24, 0x01 ; 1 1f76c: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f770: 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); 1f772: af e9 ldi r26, 0x9F ; 159 1f774: bf e0 ldi r27, 0x0F ; 15 1f776: 11 97 sbiw r26, 0x01 ; 1 1f778: f1 f7 brne .-4 ; 0x1f776 1f77a: 00 c0 rjmp .+0 ; 0x1f77c 1f77c: 00 00 nop _delay_ms(1); //wait for the pullups to raise the line lcd_oldcardstatus = IS_SD_INSERTED; 1f77e: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 1f782: 80 95 com r24 1f784: 81 70 andi r24, 0x01 ; 1 1f786: 80 93 11 04 sts 0x0411, r24 ; 0x800411 #endif//(SDCARDDETECT > 0) // Initialise status line strncpy_P(lcd_status_message, MSG_WELCOME, LCD_WIDTH); 1f78a: 44 e1 ldi r20, 0x14 ; 20 1f78c: 50 e0 ldi r21, 0x00 ; 0 1f78e: 66 eb ldi r22, 0xB6 ; 182 1f790: 70 e7 ldi r23, 0x70 ; 112 1f792: 8e e1 ldi r24, 0x1E ; 30 1f794: 95 e0 ldi r25, 0x05 ; 5 1f796: 0f 94 c4 d9 call 0x3b388 ; 0x3b388 timer2_init(); // enables functional millis ultralcd_init(); spi_init(); 1f79a: 0f 94 89 c2 call 0x38512 ; 0x38512 } void lcd_splash() { lcd_clear(); // clears display and homes screen 1f79e: 0e 94 2b 6f call 0xde56 ; 0xde56 lcd_printf_P(PSTR("\n Original Prusa i3\n Prusa Research\n%20.20S"), PSTR(FW_VERSION)); 1f7a2: 8d e7 ldi r24, 0x7D ; 125 1f7a4: 9d e8 ldi r25, 0x8D ; 141 1f7a6: 9f 93 push r25 1f7a8: 8f 93 push r24 1f7aa: 84 e8 ldi r24, 0x84 ; 132 1f7ac: 9d e8 ldi r25, 0x8D ; 141 1f7ae: 9f 93 push r25 1f7b0: 8f 93 push r24 1f7b2: 0e 94 d1 6e call 0xdda2 ; 0xdda2 static void Sound_DoSound_Encoder_Move(void); static void Sound_DoSound_Blind_Alert(void); void Sound_Init(void) { SET_OUTPUT(BEEPER); 1f7b6: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1f7ba: 84 60 ori r24, 0x04 ; 4 1f7bc: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> eSoundMode = static_cast(eeprom_init_default_byte((uint8_t*)EEPROM_SOUND_MODE, e_SOUND_MODE_DEFAULT)); 1f7c0: 60 e0 ldi r22, 0x00 ; 0 1f7c2: 87 ed ldi r24, 0xD7 ; 215 1f7c4: 9e e0 ldi r25, 0x0E ; 14 1f7c6: 0e 94 21 76 call 0xec42 ; 0xec42 1f7ca: 80 93 dd 04 sts 0x04DD, r24 ; 0x8004dd spi_init(); lcd_splash(); Sound_Init(); // also guarantee "SET_OUTPUT(BEEPER)" selectedSerialPort = eeprom_init_default_byte((uint8_t *)EEPROM_SECOND_SERIAL_ACTIVE, 0); 1f7ce: 60 e0 ldi r22, 0x00 ; 0 1f7d0: 88 e0 ldi r24, 0x08 ; 8 1f7d2: 9f e0 ldi r25, 0x0F ; 15 1f7d4: 0e 94 21 76 call 0xec42 ; 0xec42 1f7d8: 80 93 38 05 sts 0x0538, r24 ; 0x800538 MYSERIAL.begin(BAUDRATE); 1f7dc: 0e 94 9c cc call 0x19938 ; 0x19938 fdev_setup_stream(uartout, uart_putchar, NULL, _FDEV_SETUP_WRITE); //setup uart out stream 1f7e0: 83 e6 ldi r24, 0x63 ; 99 1f7e2: 97 e7 ldi r25, 0x77 ; 119 1f7e4: 90 93 05 05 sts 0x0505, r25 ; 0x800505 <_uartout+0x9> 1f7e8: 80 93 04 05 sts 0x0504, r24 ; 0x800504 <_uartout+0x8> 1f7ec: 10 92 07 05 sts 0x0507, r1 ; 0x800507 <_uartout+0xb> 1f7f0: 10 92 06 05 sts 0x0506, r1 ; 0x800506 <_uartout+0xa> 1f7f4: 10 93 ff 04 sts 0x04FF, r17 ; 0x8004ff <_uartout+0x3> 1f7f8: 10 92 09 05 sts 0x0509, r1 ; 0x800509 <_uartout+0xd> 1f7fc: 10 92 08 05 sts 0x0508, r1 ; 0x800508 <_uartout+0xc> stdout = uartout; 1f800: 8c ef ldi r24, 0xFC ; 252 1f802: 94 e0 ldi r25, 0x04 ; 4 1f804: 90 93 1c 18 sts 0x181C, r25 ; 0x80181c <__iob+0x3> 1f808: 80 93 1b 18 sts 0x181B, r24 ; 0x80181b <__iob+0x2> #ifdef XFLASH bool xflash_success = xflash_init(); 1f80c: 0e 94 f2 ed call 0x1dbe4 ; 0x1dbe4 1f810: b8 2e mov r11, r24 uint8_t optiboot_status = 1; if (xflash_success) 1f812: 0f 90 pop r0 1f814: 0f 90 pop r0 1f816: 0f 90 pop r0 1f818: 0f 90 pop r0 1f81a: 8e 01 movw r16, r28 1f81c: 0f 5f subi r16, 0xFF ; 255 1f81e: 1f 4f sbci r17, 0xFF ; 255 fdev_setup_stream(uartout, uart_putchar, NULL, _FDEV_SETUP_WRITE); //setup uart out stream stdout = uartout; #ifdef XFLASH bool xflash_success = xflash_init(); uint8_t optiboot_status = 1; 1f820: aa 24 eor r10, r10 1f822: a3 94 inc r10 if (xflash_success) 1f824: 88 23 and r24, r24 1f826: 09 f4 brne .+2 ; 0x1f82a 1f828: d8 c0 rjmp .+432 ; 0x1f9da { optiboot_status = optiboot_xflash_enter(); 1f82a: 0f 94 97 c2 call 0x3852e ; 0x3852e 1f82e: a8 2e mov r10, r24 #define LANGBOOT_BLOCKSIZE 0x1000u #define LANGBOOT_RAMBUFFER 0x0800 void update_sec_lang_from_external_flash() { if ((boot_app_magic == BOOT_APP_MAGIC) && (boot_app_flags & BOOT_APP_FLG_USER0)) 1f830: 80 91 fc 1f lds r24, 0x1FFC ; 0x801ffc <__bss_end+0x7dd> 1f834: 90 91 fd 1f lds r25, 0x1FFD ; 0x801ffd <__bss_end+0x7de> 1f838: a0 91 fe 1f lds r26, 0x1FFE ; 0x801ffe <__bss_end+0x7df> 1f83c: b0 91 ff 1f lds r27, 0x1FFF ; 0x801fff <__bss_end+0x7e0> 1f840: 8a 3a cpi r24, 0xAA ; 170 1f842: 95 45 sbci r25, 0x55 ; 85 1f844: aa 4a sbci r26, 0xAA ; 170 1f846: b5 45 sbci r27, 0x55 ; 85 1f848: 09 f0 breq .+2 ; 0x1f84c 1f84a: bf c0 rjmp .+382 ; 0x1f9ca 1f84c: 80 91 fb 1f lds r24, 0x1FFB ; 0x801ffb <__bss_end+0x7dc> 1f850: 87 ff sbrs r24, 7 1f852: bb c0 rjmp .+374 ; 0x1f9ca { uint8_t lang = boot_reserved >> 3; 1f854: 80 90 fa 1f lds r8, 0x1FFA ; 0x801ffa <__bss_end+0x7db> 1f858: 98 2c mov r9, r8 1f85a: 96 94 lsr r9 1f85c: 96 94 lsr r9 1f85e: 96 94 lsr r9 uint8_t state = boot_reserved & 0x07; 1f860: f8 2d mov r31, r8 1f862: f7 70 andi r31, 0x07 ; 7 1f864: 8f 2e mov r8, r31 return count; } uint8_t lang_get_header(uint8_t lang, lang_table_header_t* header, uint32_t* offset) { if (lang == LANG_ID_PRI) return 0; //primary lang not supported for this function 1f866: 99 20 and r9, r9 1f868: 09 f4 brne .+2 ; 0x1f86c 1f86a: af c0 rjmp .+350 ; 0x1f9ca #ifdef XFLASH if (lang == LANG_ID_SEC) 1f86c: 21 e0 ldi r18, 0x01 ; 1 1f86e: 92 12 cpse r9, r18 1f870: 24 c0 rjmp .+72 ; 0x1f8ba { uint16_t ui = _SEC_LANG_TABLE; //table pointer memcpy_P(header, (lang_table_t*)(_SEC_LANG_TABLE), sizeof(lang_table_header_t)); //read table header from progmem 1f872: 40 e1 ldi r20, 0x10 ; 16 1f874: 50 e0 ldi r21, 0x00 ; 0 1f876: 60 e0 ldi r22, 0x00 ; 0 1f878: 71 e0 ldi r23, 0x01 ; 1 1f87a: c8 01 movw r24, r16 1f87c: 0f 94 71 d9 call 0x3b2e2 ; 0x3b2e2 if (offset) *offset = ui; 1f880: 60 e0 ldi r22, 0x00 ; 0 1f882: 71 e0 ldi r23, 0x01 ; 1 1f884: 6b 01 movw r12, r22 1f886: f1 2c mov r15, r1 1f888: e1 2c mov r14, r1 lang_table_header_t header; uint32_t src_addr; if (lang_get_header(lang, &header, &src_addr)) 1f88a: 89 81 ldd r24, Y+1 ; 0x01 1f88c: 9a 81 ldd r25, Y+2 ; 0x02 1f88e: ab 81 ldd r26, Y+3 ; 0x03 1f890: bc 81 ldd r27, Y+4 ; 0x04 1f892: 85 3a cpi r24, 0xA5 ; 165 1f894: 9a 45 sbci r25, 0x5A ; 90 1f896: a4 4b sbci r26, 0xB4 ; 180 1f898: bb 44 sbci r27, 0x4B ; 75 1f89a: 09 f0 breq .+2 ; 0x1f89e 1f89c: 96 c0 rjmp .+300 ; 0x1f9ca { lcd_puts_at_P(1,0,PSTR("Language update")); 1f89e: 42 eb ldi r20, 0xB2 ; 178 1f8a0: 5d e8 ldi r21, 0x8D ; 141 1f8a2: 60 e0 ldi r22, 0x00 ; 0 1f8a4: 81 e0 ldi r24, 0x01 ; 1 1f8a6: 0e 94 0c 6f call 0xde18 ; 0xde18 for (uint8_t i = 0; i < state; i++) 1f8aa: 91 2c mov r9, r1 1f8ac: 89 14 cp r8, r9 1f8ae: 39 f1 breq .+78 ; 0x1f8fe } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 1f8b0: 8e e2 ldi r24, 0x2E ; 46 1f8b2: 0e 94 a7 6f call 0xdf4e ; 0xdf4e 1f8b6: 93 94 inc r9 1f8b8: f9 cf rjmp .-14 ; 0x1f8ac SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 1f8ba: 8c e5 ldi r24, 0x5C ; 92 1f8bc: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 1f8be: 1d bc out 0x2d, r1 ; 45 return (header->magic == LANG_MAGIC)?1:0; //return 1 if magic valid } XFLASH_SPI_ENTER(); uint32_t addr = LANG_OFFSET; 1f8c0: c1 2c mov r12, r1 1f8c2: d1 2c mov r13, r1 1f8c4: 76 01 movw r14, r12 lang--; while (1) { xflash_rd_data(addr, (uint8_t*)(header), sizeof(lang_table_header_t)); //read table header from xflash 1f8c6: 20 e1 ldi r18, 0x10 ; 16 1f8c8: 30 e0 ldi r19, 0x00 ; 0 1f8ca: a8 01 movw r20, r16 1f8cc: c7 01 movw r24, r14 1f8ce: b6 01 movw r22, r12 1f8d0: 0e 94 c2 ec call 0x1d984 ; 0x1d984 if (header->magic != LANG_MAGIC) break; //break if not valid 1f8d4: 89 81 ldd r24, Y+1 ; 0x01 1f8d6: 9a 81 ldd r25, Y+2 ; 0x02 1f8d8: ab 81 ldd r26, Y+3 ; 0x03 1f8da: bc 81 ldd r27, Y+4 ; 0x04 1f8dc: 85 3a cpi r24, 0xA5 ; 165 1f8de: 9a 45 sbci r25, 0x5A ; 90 1f8e0: a4 4b sbci r26, 0xB4 ; 180 1f8e2: bb 44 sbci r27, 0x4B ; 75 1f8e4: 09 f0 breq .+2 ; 0x1f8e8 1f8e6: 71 c0 rjmp .+226 ; 0x1f9ca if (offset) *offset = addr; if (--lang == 0) return 1; 1f8e8: f2 e0 ldi r31, 0x02 ; 2 1f8ea: 9f 16 cp r9, r31 1f8ec: c1 f2 breq .-80 ; 0x1f89e addr += header->size; //calc address of next table 1f8ee: 8d 81 ldd r24, Y+5 ; 0x05 1f8f0: 9e 81 ldd r25, Y+6 ; 0x06 1f8f2: c8 0e add r12, r24 1f8f4: d9 1e adc r13, r25 1f8f6: e1 1c adc r14, r1 1f8f8: f1 1c adc r15, r1 1f8fa: 9a 94 dec r9 1f8fc: e4 cf rjmp .-56 ; 0x1f8c6 lcd_print('.'); _delay(100); 1f8fe: 64 e6 ldi r22, 0x64 ; 100 1f900: 70 e0 ldi r23, 0x00 ; 0 1f902: 80 e0 ldi r24, 0x00 ; 0 1f904: 90 e0 ldi r25, 0x00 ; 0 1f906: 0f 94 29 27 call 0x24e52 ; 0x24e52 boot_reserved = (boot_reserved & 0xF8) | ((state + 1) & 0x07); 1f90a: 80 91 fa 1f lds r24, 0x1FFA ; 0x801ffa <__bss_end+0x7db> 1f90e: 88 7f andi r24, 0xF8 ; 248 1f910: 91 e0 ldi r25, 0x01 ; 1 1f912: 98 0d add r25, r8 1f914: 97 70 andi r25, 0x07 ; 7 1f916: 89 2b or r24, r25 1f918: 80 93 fa 1f sts 0x1FFA, r24 ; 0x801ffa <__bss_end+0x7db> if ((state * LANGBOOT_BLOCKSIZE) < header.size) 1f91c: 91 2c mov r9, r1 1f91e: 98 2c mov r9, r8 1f920: 88 24 eor r8, r8 1f922: 92 94 swap r9 1f924: 80 ef ldi r24, 0xF0 ; 240 1f926: 98 22 and r9, r24 1f928: 8d 81 ldd r24, Y+5 ; 0x05 1f92a: 9e 81 ldd r25, Y+6 ; 0x06 1f92c: 88 16 cp r8, r24 1f92e: 99 06 cpc r9, r25 1f930: 08 f0 brcs .+2 ; 0x1f934 1f932: 46 c0 rjmp .+140 ; 0x1f9c0 { cli(); 1f934: f8 94 cli uint16_t size = header.size - state * LANGBOOT_BLOCKSIZE; 1f936: 0d 81 ldd r16, Y+5 ; 0x05 1f938: 1e 81 ldd r17, Y+6 ; 0x06 1f93a: 08 19 sub r16, r8 1f93c: 19 09 sbc r17, r9 if (size > LANGBOOT_BLOCKSIZE) size = LANGBOOT_BLOCKSIZE; 1f93e: 01 30 cpi r16, 0x01 ; 1 1f940: 20 e1 ldi r18, 0x10 ; 16 1f942: 12 07 cpc r17, r18 1f944: 10 f0 brcs .+4 ; 0x1f94a 1f946: 00 e0 ldi r16, 0x00 ; 0 1f948: 10 e1 ldi r17, 0x10 ; 16 xflash_rd_data(src_addr + state * LANGBOOT_BLOCKSIZE, (uint8_t*)LANGBOOT_RAMBUFFER, size); 1f94a: c7 01 movw r24, r14 1f94c: b6 01 movw r22, r12 1f94e: 68 0d add r22, r8 1f950: 79 1d adc r23, r9 1f952: 81 1d adc r24, r1 1f954: 91 1d adc r25, r1 1f956: 98 01 movw r18, r16 1f958: 40 e0 ldi r20, 0x00 ; 0 1f95a: 58 e0 ldi r21, 0x08 ; 8 1f95c: 0e 94 c2 ec call 0x1d984 ; 0x1d984 } void bootapp_ram2flash(uint16_t rptr, uint16_t fptr, uint16_t size) { cli(); 1f960: f8 94 cli boot_app_magic = BOOT_APP_MAGIC; 1f962: 8a ea ldi r24, 0xAA ; 170 1f964: 95 e5 ldi r25, 0x55 ; 85 1f966: dc 01 movw r26, r24 1f968: 80 93 fc 1f sts 0x1FFC, r24 ; 0x801ffc <__bss_end+0x7dd> 1f96c: 90 93 fd 1f sts 0x1FFD, r25 ; 0x801ffd <__bss_end+0x7de> 1f970: a0 93 fe 1f sts 0x1FFE, r26 ; 0x801ffe <__bss_end+0x7df> 1f974: b0 93 ff 1f sts 0x1FFF, r27 ; 0x801fff <__bss_end+0x7e0> boot_app_flags |= BOOT_APP_FLG_COPY | BOOT_APP_FLG_ERASE; 1f978: 80 91 fb 1f lds r24, 0x1FFB ; 0x801ffb <__bss_end+0x7dc> 1f97c: 83 60 ori r24, 0x03 ; 3 1f97e: 80 93 fb 1f sts 0x1FFB, r24 ; 0x801ffb <__bss_end+0x7dc> boot_copy_size = (uint16_t)size; 1f982: 10 93 f9 1f sts 0x1FF9, r17 ; 0x801ff9 <__bss_end+0x7da> 1f986: 00 93 f8 1f sts 0x1FF8, r16 ; 0x801ff8 <__bss_end+0x7d9> boot_src_addr = (uint32_t)rptr; 1f98a: 80 e0 ldi r24, 0x00 ; 0 1f98c: 98 e0 ldi r25, 0x08 ; 8 1f98e: a0 e0 ldi r26, 0x00 ; 0 1f990: b0 e0 ldi r27, 0x00 ; 0 1f992: 80 93 f0 1f sts 0x1FF0, r24 ; 0x801ff0 <__bss_end+0x7d1> 1f996: 90 93 f1 1f sts 0x1FF1, r25 ; 0x801ff1 <__bss_end+0x7d2> 1f99a: a0 93 f2 1f sts 0x1FF2, r26 ; 0x801ff2 <__bss_end+0x7d3> 1f99e: b0 93 f3 1f sts 0x1FF3, r27 ; 0x801ff3 <__bss_end+0x7d4> if (state == 0) { //TODO - check header integrity } bootapp_ram2flash(LANGBOOT_RAMBUFFER, _SEC_LANG_TABLE + state * LANGBOOT_BLOCKSIZE, size); 1f9a2: c4 01 movw r24, r8 1f9a4: 80 50 subi r24, 0x00 ; 0 1f9a6: 9f 4f sbci r25, 0xFF ; 255 boot_dst_addr = (uint32_t)fptr; 1f9a8: b0 e0 ldi r27, 0x00 ; 0 1f9aa: a0 e0 ldi r26, 0x00 ; 0 1f9ac: 80 93 f4 1f sts 0x1FF4, r24 ; 0x801ff4 <__bss_end+0x7d5> 1f9b0: 90 93 f5 1f sts 0x1FF5, r25 ; 0x801ff5 <__bss_end+0x7d6> 1f9b4: a0 93 f6 1f sts 0x1FF6, r26 ; 0x801ff6 <__bss_end+0x7d7> 1f9b8: b0 93 f7 1f sts 0x1FF7, r27 ; 0x801ff7 <__bss_end+0x7d8> for (uint16_t i = 0; i < EEPROM_TOP; i++) { eeprom_update_byte_notify((uint8_t*)i, 0xFF); menu_progressbar_update(i); } menu_progressbar_finish(); softReset(); 1f9bc: 0e 94 64 67 call 0xcec8 ; 0xcec8 1f9c0: 61 e0 ldi r22, 0x01 ; 1 1f9c2: 8e ef ldi r24, 0xFE ; 254 1f9c4: 9f e0 ldi r25, 0x0F ; 15 1f9c6: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 //TODO - check sec lang data integrity eeprom_update_byte_notify((unsigned char *)EEPROM_LANG, LANG_ID_SEC); } } } boot_app_magic = 0; 1f9ca: 10 92 fc 1f sts 0x1FFC, r1 ; 0x801ffc <__bss_end+0x7dd> 1f9ce: 10 92 fd 1f sts 0x1FFD, r1 ; 0x801ffd <__bss_end+0x7de> 1f9d2: 10 92 fe 1f sts 0x1FFE, r1 ; 0x801ffe <__bss_end+0x7df> 1f9d6: 10 92 ff 1f sts 0x1FFF, r1 ; 0x801fff <__bss_end+0x7e0> return ( eeprom_read_byte((uint8_t *)EEPROM_ECOOL_ENABLE) == EEPROM_ECOOL_MAGIC_NUMBER ) && ( eeprom_read_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY) == 1 ); } bool FarmOrUserECool(){ return farm_mode || UserECoolEnabled(); 1f9da: 0e 94 ac ef call 0x1df58 ; 0x1df58 setup_powerhold(); farm_mode_init(); #ifdef TMC2130 if(FarmOrUserECool()) { 1f9de: 88 23 and r24, r24 1f9e0: 51 f0 breq .+20 ; 0x1f9f6 //increased extruder current (PFW363) currents[E_AXIS].setiRun(TMC2130_CURRENTS_FARM); 1f9e2: 64 e2 ldi r22, 0x24 ; 36 1f9e4: 86 e6 ldi r24, 0x66 ; 102 1f9e6: 92 e0 ldi r25, 0x02 ; 2 1f9e8: 0e 94 1e 68 call 0xd03c ; 0xd03c currents[E_AXIS].setiHold(TMC2130_CURRENTS_FARM); 1f9ec: 64 e2 ldi r22, 0x24 ; 36 1f9ee: 86 e6 ldi r24, 0x66 ; 102 1f9f0: 92 e0 ldi r25, 0x02 ; 2 1f9f2: 0e 94 16 68 call 0xd02c ; 0xd02c #ifdef PRUSA_SN_SUPPORT //Check for valid SN in EEPROM. Try to retrieve it in case it's invalid. //SN is valid only if it is NULL terminated and starts with "CZPX". { char SN[20]; eeprom_read_block(SN, (uint8_t*)EEPROM_PRUSA_SN, 20); 1f9f6: 44 e1 ldi r20, 0x14 ; 20 1f9f8: 50 e0 ldi r21, 0x00 ; 0 1f9fa: 65 e1 ldi r22, 0x15 ; 21 1f9fc: 7d e0 ldi r23, 0x0D ; 13 1f9fe: c8 01 movw r24, r16 1fa00: 0f 94 c7 db call 0x3b78e ; 0x3b78e if (SN[19] || strncmp_P(SN, PSTR("CZPX"), 4)) 1fa04: 8c 89 ldd r24, Y+20 ; 0x14 1fa06: 81 11 cpse r24, r1 1fa08: 0a c0 rjmp .+20 ; 0x1fa1e 1fa0a: 44 e0 ldi r20, 0x04 ; 4 1fa0c: 50 e0 ldi r21, 0x00 ; 0 1fa0e: 64 eb ldi r22, 0xB4 ; 180 1fa10: 7e e8 ldi r23, 0x8E ; 142 1fa12: c8 01 movw r24, r16 1fa14: 0f 94 b6 d9 call 0x3b36c ; 0x3b36c 1fa18: 89 2b or r24, r25 1fa1a: 09 f4 brne .+2 ; 0x1fa1e 1fa1c: 51 c0 rjmp .+162 ; 0x1fac0 * @return 1 on general failure */ #ifdef PRUSA_SN_SUPPORT static uint8_t get_PRUSA_SN(char* SN) { uint8_t selectedSerialPort_bak = selectedSerialPort; 1fa1e: e0 90 38 05 lds r14, 0x0538 ; 0x800538 uint8_t rxIndex; bool SN_valid = false; ShortTimer timeout; 1fa22: 1d 8a std Y+21, r1 ; 0x15 1fa24: 1f 8a std Y+23, r1 ; 0x17 1fa26: 1e 8a std Y+22, r1 ; 0x16 selectedSerialPort = 0; 1fa28: 10 92 38 05 sts 0x0538, r1 ; 0x800538 timeout.start(); 1fa2c: ce 01 movw r24, r28 1fa2e: 45 96 adiw r24, 0x15 ; 21 1fa30: 0f 94 83 29 call 0x25306 ; 0x25306 ::start()> while (!SN_valid) { rxIndex = 0; _delay(50); 1fa34: 62 e3 ldi r22, 0x32 ; 50 1fa36: 70 e0 ldi r23, 0x00 ; 0 1fa38: 80 e0 ldi r24, 0x00 ; 0 1fa3a: 90 e0 ldi r25, 0x00 ; 0 1fa3c: 0f 94 29 27 call 0x24e52 ; 0x24e52 // 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; 1fa40: 80 91 9a 04 lds r24, 0x049A ; 0x80049a 1fa44: 90 91 9b 04 lds r25, 0x049B ; 0x80049b 1fa48: 90 93 99 04 sts 0x0499, r25 ; 0x800499 1fa4c: 80 93 98 04 sts 0x0498, r24 ; 0x800498 MYSERIAL.flush(); //clear RX buffer SERIAL_ECHOLNRPGM(PSTR(";S")); 1fa50: 87 ec ldi r24, 0xC7 ; 199 1fa52: 9d e8 ldi r25, 0x8D ; 141 1fa54: 0e 94 93 79 call 0xf326 ; 0xf326 1fa58: 68 01 movw r12, r16 selectedSerialPort = 0; timeout.start(); while (!SN_valid) { rxIndex = 0; 1fa5a: f1 2c mov r15, r1 _delay(50); MYSERIAL.flush(); //clear RX buffer SERIAL_ECHOLNRPGM(PSTR(";S")); while (rxIndex < 19) 1fa5c: 33 e1 ldi r19, 0x13 ; 19 1fa5e: f3 16 cp r15, r19 1fa60: a1 f0 breq .+40 ; 0x1fa8a { if (timeout.expired(250u)) 1fa62: 6a ef ldi r22, 0xFA ; 250 1fa64: 70 e0 ldi r23, 0x00 ; 0 1fa66: ce 01 movw r24, r28 1fa68: 45 96 adiw r24, 0x15 ; 21 1fa6a: 0f 94 54 29 call 0x252a8 ; 0x252a8 ::expired(unsigned short)> 1fa6e: 81 11 cpse r24, r1 1fa70: c1 c0 rjmp .+386 ; 0x1fbf4 goto exit; if (MYSERIAL.available() > 0) 1fa72: 0e 94 21 77 call 0xee42 ; 0xee42 1fa76: 18 16 cp r1, r24 1fa78: 19 06 cpc r1, r25 1fa7a: 84 f7 brge .-32 ; 0x1fa5c { SN[rxIndex] = MYSERIAL.read(); 1fa7c: 0f 94 bf d5 call 0x3ab7e ; 0x3ab7e 1fa80: d6 01 movw r26, r12 1fa82: 8d 93 st X+, r24 1fa84: 6d 01 movw r12, r26 rxIndex++; 1fa86: f3 94 inc r15 1fa88: e9 cf rjmp .-46 ; 0x1fa5c } } SN[rxIndex] = 0; 1fa8a: 1c 8a std Y+20, r1 ; 0x14 // printf_P(PSTR("SN:%s\n"), SN); SN_valid = (strncmp_P(SN, PSTR("CZPX"), 4) == 0); 1fa8c: 44 e0 ldi r20, 0x04 ; 4 1fa8e: 50 e0 ldi r21, 0x00 ; 0 1fa90: 62 ec ldi r22, 0xC2 ; 194 1fa92: 7d e8 ldi r23, 0x8D ; 141 1fa94: c8 01 movw r24, r16 1fa96: 0f 94 b6 d9 call 0x3b36c ; 0x3b36c ShortTimer timeout; selectedSerialPort = 0; timeout.start(); while (!SN_valid) 1fa9a: 89 2b or r24, r25 1fa9c: 59 f6 brne .-106 ; 0x1fa34 1fa9e: 81 e0 ldi r24, 0x01 ; 1 SN[rxIndex] = 0; // printf_P(PSTR("SN:%s\n"), SN); SN_valid = (strncmp_P(SN, PSTR("CZPX"), 4) == 0); } exit: selectedSerialPort = selectedSerialPort_bak; 1faa0: e0 92 38 05 sts 0x0538, r14 ; 0x800538 { char SN[20]; eeprom_read_block(SN, (uint8_t*)EEPROM_PRUSA_SN, 20); if (SN[19] || strncmp_P(SN, PSTR("CZPX"), 4)) { if (!get_PRUSA_SN(SN)) 1faa4: 88 23 and r24, r24 1faa6: 09 f4 brne .+2 ; 0x1faaa 1faa8: a7 c0 rjmp .+334 ; 0x1fbf8 #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); 1faaa: 44 e1 ldi r20, 0x14 ; 20 1faac: 50 e0 ldi r21, 0x00 ; 0 1faae: 65 e1 ldi r22, 0x15 ; 21 1fab0: 7d e0 ldi r23, 0x0D ; 13 1fab2: c8 01 movw r24, r16 1fab4: 0f 94 eb db call 0x3b7d6 ; 0x3b7d6 { eeprom_update_block_notify(SN, (uint8_t*)EEPROM_PRUSA_SN, 20); puts_P(PSTR("SN updated")); 1fab8: 89 ea ldi r24, 0xA9 ; 169 1faba: 9e e8 ldi r25, 0x8E ; 142 } else puts_P(PSTR("SN update failed")); 1fabc: 0f 94 c0 da call 0x3b580 ; 0x3b580 #ifndef XFLASH SERIAL_PROTOCOLLNPGM("start"); #else if ((optiboot_status != 0) || (selectedSerialPort != 0)) 1fac0: a1 10 cpse r10, r1 1fac2: 04 c0 rjmp .+8 ; 0x1facc 1fac4: 80 91 38 05 lds r24, 0x0538 ; 0x800538 1fac8: 88 23 and r24, r24 1faca: 21 f0 breq .+8 ; 0x1fad4 SERIAL_PROTOCOLLNPGM("start"); 1facc: 82 e9 ldi r24, 0x92 ; 146 1face: 9e e8 ldi r25, 0x8E ; 142 1fad0: 0e 94 93 79 call 0xf326 ; 0xf326 #endif SERIAL_ECHO_START; 1fad4: 82 ef ldi r24, 0xF2 ; 242 1fad6: 9b ea ldi r25, 0xAB ; 171 1fad8: 0e 94 68 77 call 0xeed0 ; 0xeed0 puts_P(PSTR(" " FW_VERSION_FULL "_" FW_COMMIT_HASH)); 1fadc: 8b e7 ldi r24, 0x7B ; 123 1fade: 9e e8 ldi r25, 0x8E ; 142 1fae0: 0f 94 c0 da call 0x3b580 ; 0x3b580 // by default the MMU shall remain disabled - PFW-1418 if (eeprom_init_default_byte((uint8_t *)EEPROM_MMU_ENABLED, 0)) { 1fae4: 60 e0 ldi r22, 0x00 ; 0 1fae6: 8c ea ldi r24, 0xAC ; 172 1fae8: 9c e0 ldi r25, 0x0C ; 12 1faea: 0e 94 21 76 call 0xec42 ; 0xec42 1faee: 81 11 cpse r24, r1 MMU2::mmu2.Start(); 1faf0: 0e 94 69 e3 call 0x1c6d2 ; 0x1c6d2 } MMU2::mmu2.Status(); 1faf4: 0f 94 9e 74 call 0x2e93c ; 0x2e93c } void SpoolJoin::initSpoolJoinStatus() { // Useful information to see during bootup SERIAL_ECHOPGM("SpoolJoin is "); 1faf8: 8a ec ldi r24, 0xCA ; 202 1fafa: 9d e8 ldi r25, 0x8D ; 141 1fafc: 0e 94 68 77 call 0xeed0 ; 0xeed0 uint8_t status = eeprom_init_default_byte((uint8_t*)EEPROM_SPOOL_JOIN, (uint8_t)EEPROM::Disabled); 1fb00: 62 e0 ldi r22, 0x02 ; 2 1fb02: 86 ed ldi r24, 0xD6 ; 214 1fb04: 9e e0 ldi r25, 0x0E ; 14 1fb06: 0e 94 21 76 call 0xec42 ; 0xec42 if (status == (uint8_t)EEPROM::Enabled) 1fb0a: 81 30 cpi r24, 0x01 ; 1 1fb0c: 09 f0 breq .+2 ; 0x1fb10 1fb0e: 77 c0 rjmp .+238 ; 0x1fbfe { SERIAL_ECHOLNRPGM(_O(MSG_ON)); 1fb10: 85 e1 ldi r24, 0x15 ; 21 1fb12: 9d e5 ldi r25, 0x5D ; 93 } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); 1fb14: 0e 94 93 79 call 0xf326 ; 0xf326 #endif #endif //DEBUG_SEC_LANG // Check startup - does nothing if bootloader sets MCUSR to 0 byte mcu = MCUSR; 1fb18: f4 b6 in r15, 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); 1fb1a: f0 fe sbrs r15, 0 1fb1c: 04 c0 rjmp .+8 ; 0x1fb26 1fb1e: 85 ec ldi r24, 0xC5 ; 197 1fb20: 9d e6 ldi r25, 0x6D ; 109 1fb22: 0f 94 c0 da call 0x3b580 ; 0x3b580 if (mcu & 2) puts_P(MSG_EXTERNAL_RESET); 1fb26: f1 fe sbrs r15, 1 1fb28: 04 c0 rjmp .+8 ; 0x1fb32 1fb2a: 85 eb ldi r24, 0xB5 ; 181 1fb2c: 9d e6 ldi r25, 0x6D ; 109 1fb2e: 0f 94 c0 da call 0x3b580 ; 0x3b580 if (mcu & 4) puts_P(MSG_BROWNOUT_RESET); 1fb32: f2 fe sbrs r15, 2 1fb34: 04 c0 rjmp .+8 ; 0x1fb3e 1fb36: 84 ea ldi r24, 0xA4 ; 164 1fb38: 9d e6 ldi r25, 0x6D ; 109 1fb3a: 0f 94 c0 da call 0x3b580 ; 0x3b580 if (mcu & 8) puts_P(MSG_WATCHDOG_RESET); 1fb3e: f3 fe sbrs r15, 3 1fb40: 04 c0 rjmp .+8 ; 0x1fb4a 1fb42: 84 e9 ldi r24, 0x94 ; 148 1fb44: 9d e6 ldi r25, 0x6D ; 109 1fb46: 0f 94 c0 da call 0x3b580 ; 0x3b580 if (mcu & 32) puts_P(MSG_SOFTWARE_RESET); 1fb4a: f5 fe sbrs r15, 5 1fb4c: 04 c0 rjmp .+8 ; 0x1fb56 1fb4e: 84 e8 ldi r24, 0x84 ; 132 1fb50: 9d e6 ldi r25, 0x6D ; 109 1fb52: 0f 94 c0 da call 0x3b580 ; 0x3b580 MCUSR = 0; 1fb56: 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; 1fb58: 82 ef ldi r24, 0xF2 ; 242 1fb5a: 9b ea ldi r25, 0xAB ; 171 1fb5c: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHORPGM(_n(" Last Updated: "));////MSG_CONFIGURATION_VER 1fb60: 84 e7 ldi r24, 0x74 ; 116 1fb62: 9d e6 ldi r25, 0x6D ; 109 1fb64: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHOPGM(STRING_VERSION_CONFIG_H); 1fb68: 87 e6 ldi r24, 0x67 ; 103 1fb6a: 9e e8 ldi r25, 0x8E ; 142 1fb6c: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHORPGM(_n(" | Author: "));////MSG_AUTHOR 1fb70: 88 e6 ldi r24, 0x68 ; 104 1fb72: 9d e6 ldi r25, 0x6D ; 109 1fb74: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHOLNPGM(STRING_CONFIG_H_AUTHOR); 1fb78: 8f e5 ldi r24, 0x5F ; 95 1fb7a: 9e e8 ldi r25, 0x8E ; 142 1fb7c: 0e 94 93 79 call 0xf326 ; 0xf326 #endif #endif SERIAL_ECHO_START; 1fb80: 82 ef ldi r24, 0xF2 ; 242 1fb82: 9b ea ldi r25, 0xAB ; 171 1fb84: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHORPGM(_n(" Free Memory: "));////MSG_FREE_MEMORY 1fb88: 89 e5 ldi r24, 0x59 ; 89 1fb8a: 9d e6 ldi r25, 0x6D ; 109 1fb8c: 0e 94 68 77 call 0xeed0 ; 0xeed0 /** Amount of free RAM * \return The number of free bytes. */ int SdFatUtil::FreeRam() { char top; return __brkval ? &top - __brkval : &top - &__bss_end; 1fb90: 80 91 15 18 lds r24, 0x1815 ; 0x801815 <__brkval> 1fb94: 90 91 16 18 lds r25, 0x1816 ; 0x801816 <__brkval+0x1> 1fb98: 00 97 sbiw r24, 0x00 ; 0 1fb9a: a1 f1 breq .+104 ; 0x1fc04 1fb9c: 08 1b sub r16, r24 1fb9e: 19 0b sbc r17, r25 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 1fba0: b8 01 movw r22, r16 1fba2: 11 0f add r17, r17 1fba4: 88 0b sbc r24, r24 1fba6: 99 0b sbc r25, r25 1fba8: 0f 94 26 d5 call 0x3aa4c ; 0x3aa4c SERIAL_ECHO(freeMemory()); SERIAL_ECHORPGM(_n(" PlannerBufferBytes: "));////MSG_PLANNER_BUFFER_BYTES 1fbac: 82 e4 ldi r24, 0x42 ; 66 1fbae: 9d e6 ldi r25, 0x6D ; 109 1fbb0: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHOLN((int)sizeof(block_t)*BLOCK_BUFFER_SIZE); 1fbb4: 80 ee ldi r24, 0xE0 ; 224 1fbb6: 96 e0 ldi r25, 0x06 ; 6 1fbb8: 0f 94 b0 74 call 0x2e960 ; 0x2e960 #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); 1fbbc: 6c e2 ldi r22, 0x2C ; 44 1fbbe: 71 e0 ldi r23, 0x01 ; 1 1fbc0: 8e ee ldi r24, 0xEE ; 238 1fbc2: 9e e0 ldi r25, 0x0E ; 14 1fbc4: 0e 94 09 76 call 0xec12 ; 0xec12 1fbc8: 8c 01 movw r16, r24 uint16_t motherboard = eeprom_init_default_word((uint16_t*)EEPROM_BOARD_TYPE, MOTHERBOARD); 1fbca: 66 e3 ldi r22, 0x36 ; 54 1fbcc: 71 e0 ldi r23, 0x01 ; 1 1fbce: 8c ee ldi r24, 0xEC ; 236 1fbd0: 9e e0 ldi r25, 0x0E ; 14 1fbd2: 0e 94 09 76 call 0xec12 ; 0xec12 if (printer_type != PRINTER_TYPE) version_changed |= 0b10; 1fbd6: 0c 32 cpi r16, 0x2C ; 44 1fbd8: 11 40 sbci r17, 0x01 ; 1 1fbda: 11 f0 breq .+4 ; 0x1fbe0 1fbdc: 0d 94 e6 05 jmp 0x20bcc ; 0x20bcc if (motherboard != MOTHERBOARD) version_changed |= 0b01; 1fbe0: 01 e0 ldi r16, 0x01 ; 1 1fbe2: 86 33 cpi r24, 0x36 ; 54 1fbe4: 91 40 sbci r25, 0x01 ; 1 1fbe6: 09 f4 brne .+2 ; 0x1fbea 1fbe8: 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(); 1fbea: 0e 94 c4 93 call 0x12788 ; 0x12788 1fbee: f8 2e mov r15, r24 1fbf0: 0d 94 ee 05 jmp 0x20bdc ; 0x20bdc _delay(50); MYSERIAL.flush(); //clear RX buffer SERIAL_ECHOLNRPGM(PSTR(";S")); while (rxIndex < 19) { if (timeout.expired(250u)) 1fbf4: 80 e0 ldi r24, 0x00 ; 0 1fbf6: 54 cf rjmp .-344 ; 0x1faa0 { eeprom_update_block_notify(SN, (uint8_t*)EEPROM_PRUSA_SN, 20); puts_P(PSTR("SN updated")); } else puts_P(PSTR("SN update failed")); 1fbf8: 88 e9 ldi r24, 0x98 ; 152 1fbfa: 9e e8 ldi r25, 0x8E ; 142 1fbfc: 5f cf rjmp .-322 ; 0x1fabc 1fbfe: 8f e0 ldi r24, 0x0F ; 15 1fc00: 9d e5 ldi r25, 0x5D ; 93 1fc02: 88 cf rjmp .-240 ; 0x1fb14 1fc04: 0f 51 subi r16, 0x1F ; 31 1fc06: 18 41 sbci r17, 0x18 ; 24 1fc08: cb cf rjmp .-106 ; 0x1fba0 minttemp_raw[0] -= OVERSAMPLENR; #endif } #endif //MINTEMP #ifdef HEATER_0_MAXTEMP maxttemp[0] = HEATER_0_MAXTEMP; 1fc0a: 81 e3 ldi r24, 0x31 ; 49 1fc0c: 91 e0 ldi r25, 0x01 ; 1 1fc0e: 90 93 57 02 sts 0x0257, r25 ; 0x800257 <_ZL8maxttemp.lto_priv.470+0x1> 1fc12: 80 93 56 02 sts 0x0256, r24 ; 0x800256 <_ZL8maxttemp.lto_priv.470> while(analog2temp(maxttemp_raw[0], 0) > HEATER_0_MAXTEMP) { 1fc16: 80 91 a0 04 lds r24, 0x04A0 ; 0x8004a0 <_ZL12maxttemp_raw.lto_priv.463> 1fc1a: 90 91 a1 04 lds r25, 0x04A1 ; 0x8004a1 <_ZL12maxttemp_raw.lto_priv.463+0x1> 1fc1e: 0f 94 d7 a0 call 0x341ae ; 0x341ae 1fc22: 20 e0 ldi r18, 0x00 ; 0 1fc24: 30 e8 ldi r19, 0x80 ; 128 1fc26: 48 e9 ldi r20, 0x98 ; 152 1fc28: 53 e4 ldi r21, 0x43 ; 67 1fc2a: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 1fc2e: 18 16 cp r1, r24 1fc30: 54 f4 brge .+20 ; 0x1fc46 #if HEATER_0_RAW_LO_TEMP < HEATER_0_RAW_HI_TEMP maxttemp_raw[0] -= OVERSAMPLENR; #else maxttemp_raw[0] += OVERSAMPLENR; 1fc32: 80 91 a0 04 lds r24, 0x04A0 ; 0x8004a0 <_ZL12maxttemp_raw.lto_priv.463> 1fc36: 90 91 a1 04 lds r25, 0x04A1 ; 0x8004a1 <_ZL12maxttemp_raw.lto_priv.463+0x1> 1fc3a: 40 96 adiw r24, 0x10 ; 16 1fc3c: 90 93 a1 04 sts 0x04A1, r25 ; 0x8004a1 <_ZL12maxttemp_raw.lto_priv.463+0x1> 1fc40: 80 93 a0 04 sts 0x04A0, r24 ; 0x8004a0 <_ZL12maxttemp_raw.lto_priv.463> 1fc44: e8 cf rjmp .-48 ; 0x1fc16 #endif } #endif //MAXTEMP #ifdef BED_MINTEMP while(analog2tempBed(bed_minttemp_raw) < BED_MINTEMP) { 1fc46: 80 91 52 02 lds r24, 0x0252 ; 0x800252 <_ZL16bed_minttemp_raw.lto_priv.471> 1fc4a: 90 91 53 02 lds r25, 0x0253 ; 0x800253 <_ZL16bed_minttemp_raw.lto_priv.471+0x1> 1fc4e: 0f 94 88 34 call 0x26910 ; 0x26910 1fc52: 20 e0 ldi r18, 0x00 ; 0 1fc54: 30 e0 ldi r19, 0x00 ; 0 1fc56: 40 e2 ldi r20, 0x20 ; 32 1fc58: 51 e4 ldi r21, 0x41 ; 65 1fc5a: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 1fc5e: 87 ff sbrs r24, 7 1fc60: 0a c0 rjmp .+20 ; 0x1fc76 #if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP bed_minttemp_raw += OVERSAMPLENR; #else bed_minttemp_raw -= OVERSAMPLENR; 1fc62: 80 91 52 02 lds r24, 0x0252 ; 0x800252 <_ZL16bed_minttemp_raw.lto_priv.471> 1fc66: 90 91 53 02 lds r25, 0x0253 ; 0x800253 <_ZL16bed_minttemp_raw.lto_priv.471+0x1> 1fc6a: 40 97 sbiw r24, 0x10 ; 16 1fc6c: 90 93 53 02 sts 0x0253, r25 ; 0x800253 <_ZL16bed_minttemp_raw.lto_priv.471+0x1> 1fc70: 80 93 52 02 sts 0x0252, r24 ; 0x800252 <_ZL16bed_minttemp_raw.lto_priv.471> 1fc74: e8 cf rjmp .-48 ; 0x1fc46 #endif } #endif //BED_MINTEMP #ifdef BED_MAXTEMP while(analog2tempBed(bed_maxttemp_raw) > BED_MAXTEMP) { 1fc76: 80 91 9e 04 lds r24, 0x049E ; 0x80049e <_ZL16bed_maxttemp_raw.lto_priv.464> 1fc7a: 90 91 9f 04 lds r25, 0x049F ; 0x80049f <_ZL16bed_maxttemp_raw.lto_priv.464+0x1> 1fc7e: 0f 94 88 34 call 0x26910 ; 0x26910 1fc82: 20 e0 ldi r18, 0x00 ; 0 1fc84: 30 e0 ldi r19, 0x00 ; 0 1fc86: 4a ef ldi r20, 0xFA ; 250 1fc88: 52 e4 ldi r21, 0x42 ; 66 1fc8a: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 1fc8e: 18 16 cp r1, r24 1fc90: 54 f4 brge .+20 ; 0x1fca6 #if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP bed_maxttemp_raw -= OVERSAMPLENR; #else bed_maxttemp_raw += OVERSAMPLENR; 1fc92: 80 91 9e 04 lds r24, 0x049E ; 0x80049e <_ZL16bed_maxttemp_raw.lto_priv.464> 1fc96: 90 91 9f 04 lds r25, 0x049F ; 0x80049f <_ZL16bed_maxttemp_raw.lto_priv.464+0x1> 1fc9a: 40 96 adiw r24, 0x10 ; 16 1fc9c: 90 93 9f 04 sts 0x049F, r25 ; 0x80049f <_ZL16bed_maxttemp_raw.lto_priv.464+0x1> 1fca0: 80 93 9e 04 sts 0x049E, r24 ; 0x80049e <_ZL16bed_maxttemp_raw.lto_priv.464> 1fca4: e8 cf rjmp .-48 ; 0x1fc76 #endif } #endif //BED_MAXTEMP #ifdef AMBIENT_MINTEMP while(analog2tempAmbient(ambient_minttemp_raw) < AMBIENT_MINTEMP) { 1fca6: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL20ambient_minttemp_raw.lto_priv.462> 1fcaa: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL20ambient_minttemp_raw.lto_priv.462+0x1> 1fcae: 0f 94 f3 33 call 0x267e6 ; 0x267e6 1fcb2: 20 e0 ldi r18, 0x00 ; 0 1fcb4: 30 e0 ldi r19, 0x00 ; 0 1fcb6: 40 ef ldi r20, 0xF0 ; 240 1fcb8: 51 ec ldi r21, 0xC1 ; 193 1fcba: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 1fcbe: 87 ff sbrs r24, 7 1fcc0: 0a c0 rjmp .+20 ; 0x1fcd6 #if AMBIENT_RAW_LO_TEMP < AMBIENT_RAW_HI_TEMP ambient_minttemp_raw += OVERSAMPLENR; #else ambient_minttemp_raw -= OVERSAMPLENR; 1fcc2: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL20ambient_minttemp_raw.lto_priv.462> 1fcc6: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL20ambient_minttemp_raw.lto_priv.462+0x1> 1fcca: 40 97 sbiw r24, 0x10 ; 16 1fccc: 90 93 51 02 sts 0x0251, r25 ; 0x800251 <_ZL20ambient_minttemp_raw.lto_priv.462+0x1> 1fcd0: 80 93 50 02 sts 0x0250, r24 ; 0x800250 <_ZL20ambient_minttemp_raw.lto_priv.462> 1fcd4: e8 cf rjmp .-48 ; 0x1fca6 #endif } #endif //AMBIENT_MINTEMP #ifdef AMBIENT_MAXTEMP while(analog2tempAmbient(ambient_maxttemp_raw) > AMBIENT_MAXTEMP) { 1fcd6: 80 91 9c 04 lds r24, 0x049C ; 0x80049c <_ZL20ambient_maxttemp_raw.lto_priv.465> 1fcda: 90 91 9d 04 lds r25, 0x049D ; 0x80049d <_ZL20ambient_maxttemp_raw.lto_priv.465+0x1> 1fcde: 0f 94 f3 33 call 0x267e6 ; 0x267e6 1fce2: 20 e0 ldi r18, 0x00 ; 0 1fce4: 30 e0 ldi r19, 0x00 ; 0 1fce6: 40 ea ldi r20, 0xA0 ; 160 1fce8: 52 e4 ldi r21, 0x42 ; 66 1fcea: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 1fcee: 18 16 cp r1, r24 1fcf0: 54 f4 brge .+20 ; 0x1fd06 #if AMBIENT_RAW_LO_TEMP < AMBIENT_RAW_HI_TEMP ambient_maxttemp_raw -= OVERSAMPLENR; #else ambient_maxttemp_raw += OVERSAMPLENR; 1fcf2: 80 91 9c 04 lds r24, 0x049C ; 0x80049c <_ZL20ambient_maxttemp_raw.lto_priv.465> 1fcf6: 90 91 9d 04 lds r25, 0x049D ; 0x80049d <_ZL20ambient_maxttemp_raw.lto_priv.465+0x1> 1fcfa: 40 96 adiw r24, 0x10 ; 16 1fcfc: 90 93 9d 04 sts 0x049D, r25 ; 0x80049d <_ZL20ambient_maxttemp_raw.lto_priv.465+0x1> 1fd00: 80 93 9c 04 sts 0x049C, r24 ; 0x80049c <_ZL20ambient_maxttemp_raw.lto_priv.465> 1fd04: e8 cf rjmp .-48 ; 0x1fcd6 #include #include "macros.h" void timer0_init(void) { CRITICAL_SECTION_START; 1fd06: 9f b7 in r25, 0x3f ; 63 1fd08: f8 94 cli TCNT0 = 0; 1fd0a: 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; 1fd0c: 8f ef ldi r24, 0xFF ; 255 1fd0e: 88 bd out 0x28, r24 ; 40 // Set fast PWM mode and inverting mode. TCCR0A = (1 << WGM01) | (1 << WGM00) | (1 << COM0B1) | (1 << COM0B0); 1fd10: 83 e3 ldi r24, 0x33 ; 51 1fd12: 84 bd out 0x24, r24 ; 36 TCCR0B = (1 << CS01); // CLK/8 prescaling 1fd14: 12 e0 ldi r17, 0x02 ; 2 1fd16: 15 bd out 0x25, r17 ; 37 TIMSK0 |= (1 << TOIE0); // enable timer overflow interrupt 1fd18: 80 91 6e 00 lds r24, 0x006E ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> 1fd1c: 81 60 ori r24, 0x01 ; 1 1fd1e: 80 93 6e 00 sts 0x006E, r24 ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> CRITICAL_SECTION_END; 1fd22: 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; 1fd24: 80 e8 ldi r24, 0x80 ; 128 1fd26: 80 93 b4 00 sts 0x00B4, r24 ; 0x8000b4 <__TEXT_REGION_LENGTH__+0x7c20b4> ENABLE_SOFT_PWM_INTERRUPT(); 1fd2a: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 1fd2e: 84 60 ori r24, 0x04 ; 4 1fd30: 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; 1fd34: 2f b7 in r18, 0x3f ; 63 1fd36: f8 94 cli SET_OUTPUT(BEEPER); 1fd38: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1fd3c: 84 60 ori r24, 0x04 ; 4 1fd3e: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> WRITE(BEEPER, LOW); 1fd42: 9f b7 in r25, 0x3f ; 63 1fd44: f8 94 cli 1fd46: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1fd4a: 8b 7f andi r24, 0xFB ; 251 1fd4c: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1fd50: 9f bf out 0x3f, r25 ; 63 SET_OUTPUT(EXTRUDER_0_AUTO_FAN_PIN); 1fd52: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1fd56: 80 62 ori r24, 0x20 ; 32 1fd58: 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); 1fd5c: 81 e0 ldi r24, 0x01 ; 1 1fd5e: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> TCCR4B = _BV(WGM43) | _BV(CS42) | _BV(CS40); 1fd62: 85 e1 ldi r24, 0x15 ; 21 1fd64: 80 93 a1 00 sts 0x00A1, r24 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> OCR4A = 255U; 1fd68: 8f ef ldi r24, 0xFF ; 255 1fd6a: 90 e0 ldi r25, 0x00 ; 0 1fd6c: 90 93 a9 00 sts 0x00A9, r25 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 1fd70: 80 93 a8 00 sts 0x00A8, r24 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> OCR4B = 255U; 1fd74: 90 93 ab 00 sts 0x00AB, r25 ; 0x8000ab <__TEXT_REGION_LENGTH__+0x7c20ab> 1fd78: 80 93 aa 00 sts 0x00AA, r24 ; 0x8000aa <__TEXT_REGION_LENGTH__+0x7c20aa> OCR4C = 255U; 1fd7c: 90 93 ad 00 sts 0x00AD, r25 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 1fd80: 80 93 ac 00 sts 0x00AC, r24 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> TIMSK4 = 0; 1fd84: 10 92 72 00 sts 0x0072, r1 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 1fd88: 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")); 1fd8a: 88 ed ldi r24, 0xD8 ; 216 1fd8c: 9d e8 ldi r25, 0x8D ; 141 1fd8e: 0f 94 c0 da call 0x3b580 ; 0x3b580 DIDR0 = ((ADC_CHAN_MSK & ADC_DIDR_MSK) & 0xff); //disable digital inputs PORTF 1fd92: 8f e5 ldi r24, 0x5F ; 95 1fd94: 80 93 7e 00 sts 0x007E, r24 ; 0x80007e <__TEXT_REGION_LENGTH__+0x7c207e> DIDR2 = ((ADC_CHAN_MSK & ADC_DIDR_MSK) >> 8); //disable digital inputs PORTK 1fd98: 10 93 7d 00 sts 0x007D, r17 ; 0x80007d <__TEXT_REGION_LENGTH__+0x7c207d> ADMUX |= (1 << REFS0); //use AVCC as reference 1fd9c: 80 91 7c 00 lds r24, 0x007C ; 0x80007c <__TEXT_REGION_LENGTH__+0x7c207c> 1fda0: 80 64 ori r24, 0x40 ; 64 1fda2: 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); 1fda6: 8f e9 ldi r24, 0x9F ; 159 1fda8: 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(); 1fdac: 0e 94 ef 8d call 0x11bde ; 0x11bde // initialize temperature timer ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 1fdb0: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 1fdb2: f8 94 cli // CTC TCCRxB &= ~(1< 1fdb8: 8f 7e andi r24, 0xEF ; 239 1fdba: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> TCCRxB |= (1< 1fdc2: 88 60 ori r24, 0x08 ; 8 1fdc4: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> TCCRxA &= ~(1< 1fdcc: 8d 7f andi r24, 0xFD ; 253 1fdce: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> TCCRxA &= ~(1< 1fdd6: 8e 7f andi r24, 0xFE ; 254 1fdd8: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> // output mode = 00 (disconnected) TCCRxA &= ~(3< 1fde0: 8f 73 andi r24, 0x3F ; 63 1fde2: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> TCCRxA &= ~(3< 1fdea: 8f 7c andi r24, 0xCF ; 207 1fdec: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> // x/256 prescaler TCCRxB |= (1< 1fdf4: 84 60 ori r24, 0x04 ; 4 1fdf6: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> TCCRxB &= ~(1< 1fdfe: 8d 7f andi r24, 0xFD ; 253 1fe00: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> TCCRxB &= ~(1< 1fe08: 8e 7f andi r24, 0xFE ; 254 1fe0a: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> // reset counter TCNTx = 0; 1fe0e: 10 92 25 01 sts 0x0125, r1 ; 0x800125 <__TEXT_REGION_LENGTH__+0x7c2125> 1fe12: 10 92 24 01 sts 0x0124, r1 ; 0x800124 <__TEXT_REGION_LENGTH__+0x7c2124> OCRxA = TEMP_TIM_OCRA_OVF; 1fe16: 2b ee ldi r18, 0xEB ; 235 1fe18: 31 e4 ldi r19, 0x41 ; 65 1fe1a: 30 93 29 01 sts 0x0129, r19 ; 0x800129 <__TEXT_REGION_LENGTH__+0x7c2129> 1fe1e: 20 93 28 01 sts 0x0128, r18 ; 0x800128 <__TEXT_REGION_LENGTH__+0x7c2128> // clear pending interrupts, enable COMPA TEMP_MGR_INT_FLAG_CLEAR(); 1fe22: d1 9a sbi 0x1a, 1 ; 26 ENABLE_TEMP_MGR_INTERRUPT(); 1fe24: 80 91 73 00 lds r24, 0x0073 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> 1fe28: 82 60 ori r24, 0x02 ; 2 1fe2a: 80 93 73 00 sts 0x0073, r24 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 1fe2e: 9f bf out 0x3f, r25 ; 63 // SERIAL_ECHOLNPGM("planner_recalculate - 4"); } void plan_init() { block_buffer_head = 0; 1fe30: 10 92 a4 0d sts 0x0DA4, r1 ; 0x800da4 block_buffer_tail = 0; 1fe34: 10 92 a5 0d sts 0x0DA5, r1 ; 0x800da5 memset(position, 0, sizeof(position)); // clear position 1fe38: 80 e1 ldi r24, 0x10 ; 16 1fe3a: e2 ea ldi r30, 0xA2 ; 162 1fe3c: f6 e0 ldi r31, 0x06 ; 6 1fe3e: df 01 movw r26, r30 1fe40: 28 2f mov r18, r24 1fe42: 1d 92 st X+, r1 1fe44: 2a 95 dec r18 1fe46: e9 f7 brne .-6 ; 0x1fe42 #ifdef LIN_ADVANCE memset(position_float, 0, sizeof(position_float)); // clear position 1fe48: ec ec ldi r30, 0xCC ; 204 1fe4a: f4 e0 ldi r31, 0x04 ; 4 1fe4c: df 01 movw r26, r30 1fe4e: 28 2f mov r18, r24 1fe50: 1d 92 st X+, r1 1fe52: 2a 95 dec r18 1fe54: e9 f7 brne .-6 ; 0x1fe50 #endif memset(previous_speed, 0, sizeof(previous_speed)); 1fe56: ec eb ldi r30, 0xBC ; 188 1fe58: f4 e0 ldi r31, 0x04 ; 4 1fe5a: df 01 movw r26, r30 1fe5c: 1d 92 st X+, r1 1fe5e: 8a 95 dec r24 1fe60: e9 f7 brne .-6 ; 0x1fe5c previous_nominal_speed = 0.0; 1fe62: 10 92 b8 04 sts 0x04B8, r1 ; 0x8004b8 <_ZL22previous_nominal_speed.lto_priv.488> 1fe66: 10 92 b9 04 sts 0x04B9, r1 ; 0x8004b9 <_ZL22previous_nominal_speed.lto_priv.488+0x1> 1fe6a: 10 92 ba 04 sts 0x04BA, r1 ; 0x8004ba <_ZL22previous_nominal_speed.lto_priv.488+0x2> 1fe6e: 10 92 bb 04 sts 0x04BB, r1 ; 0x8004bb <_ZL22previous_nominal_speed.lto_priv.488+0x3> plan_reset_next_e_queue = false; 1fe72: 10 92 b7 04 sts 0x04B7, r1 ; 0x8004b7 <_ZL23plan_reset_next_e_queue.lto_priv.486> plan_reset_next_e_sched = false; 1fe76: 10 92 b6 04 sts 0x04B6, r1 ; 0x8004b6 <_ZL23plan_reset_next_e_sched.lto_priv.487> } void factory_reset() { KEEPALIVE_STATE(PAUSED_FOR_USER); 1fe7a: 84 e0 ldi r24, 0x04 ; 4 1fe7c: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be if (!READ(BTN_ENC)) 1fe80: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 1fe84: 86 fd sbrc r24, 6 1fe86: ca c0 rjmp .+404 ; 0x2001c 1fe88: bf ef ldi r27, 0xFF ; 255 1fe8a: e3 ed ldi r30, 0xD3 ; 211 1fe8c: f0 e3 ldi r31, 0x30 ; 48 1fe8e: b1 50 subi r27, 0x01 ; 1 1fe90: e0 40 sbci r30, 0x00 ; 0 1fe92: f0 40 sbci r31, 0x00 ; 0 1fe94: e1 f7 brne .-8 ; 0x1fe8e 1fe96: 00 c0 rjmp .+0 ; 0x1fe98 1fe98: 00 00 nop { _delay_ms(1000); if (!READ(BTN_ENC)) 1fe9a: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 1fe9e: 86 fd sbrc r24, 6 1fea0: bd c0 rjmp .+378 ; 0x2001c { lcd_clear(); 1fea2: 0e 94 2b 6f call 0xde56 ; 0xde56 lcd_puts_P(PSTR("Factory RESET")); 1fea6: 82 e3 ldi r24, 0x32 ; 50 1fea8: 9e e8 ldi r25, 0x8E ; 142 1feaa: 0e 94 e3 6e call 0xddc6 ; 0xddc6 SET_OUTPUT(BEEPER); 1feae: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1feb2: 84 60 ori r24, 0x04 ; 4 1feb4: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> if(eSoundMode!=e_SOUND_MODE_SILENT) 1feb8: 80 91 dd 04 lds r24, 0x04DD ; 0x8004dd 1febc: 82 30 cpi r24, 0x02 ; 2 1febe: 41 f0 breq .+16 ; 0x1fed0 WRITE(BEEPER, HIGH); 1fec0: 9f b7 in r25, 0x3f ; 63 1fec2: f8 94 cli 1fec4: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1fec8: 84 60 ori r24, 0x04 ; 4 1feca: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1fece: 9f bf out 0x3f, r25 ; 63 while (!READ(BTN_ENC)); 1fed0: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 1fed4: 86 ff sbrs r24, 6 1fed6: fc cf rjmp .-8 ; 0x1fed0 WRITE(BEEPER, LOW); 1fed8: 9f b7 in r25, 0x3f ; 63 1feda: f8 94 cli 1fedc: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1fee0: 8b 7f andi r24, 0xFB ; 251 1fee2: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1fee6: 9f bf out 0x3f, r25 ; 63 1fee8: 2f ef ldi r18, 0xFF ; 255 1feea: 37 ea ldi r19, 0xA7 ; 167 1feec: 81 e6 ldi r24, 0x61 ; 97 1feee: 21 50 subi r18, 0x01 ; 1 1fef0: 30 40 sbci r19, 0x00 ; 0 1fef2: 80 40 sbci r24, 0x00 ; 0 1fef4: e1 f7 brne .-8 ; 0x1feee 1fef6: 00 c0 rjmp .+0 ; 0x1fef8 1fef8: 00 00 nop PSTR("Language"), PSTR("Statistics"), PSTR("Shipping prep"), PSTR("Service prep"), PSTR("All Data"), }; 1fefa: 88 e1 ldi r24, 0x18 ; 24 1fefc: 9e e8 ldi r25, 0x8E ; 142 1fefe: 9a 83 std Y+2, r25 ; 0x02 1ff00: 89 83 std Y+1, r24 ; 0x01 1ff02: 8d e0 ldi r24, 0x0D ; 13 1ff04: 9e e8 ldi r25, 0x8E ; 142 1ff06: 9c 83 std Y+4, r25 ; 0x04 1ff08: 8b 83 std Y+3, r24 ; 0x03 1ff0a: 8f ef ldi r24, 0xFF ; 255 1ff0c: 9d e8 ldi r25, 0x8D ; 141 1ff0e: 9e 83 std Y+6, r25 ; 0x06 1ff10: 8d 83 std Y+5, r24 ; 0x05 1ff12: 82 ef ldi r24, 0xF2 ; 242 1ff14: 9d e8 ldi r25, 0x8D ; 141 1ff16: 98 87 std Y+8, r25 ; 0x08 1ff18: 8f 83 std Y+7, r24 ; 0x07 1ff1a: 89 ee ldi r24, 0xE9 ; 233 1ff1c: 9d e8 ldi r25, 0x8D ; 141 1ff1e: 9a 87 std Y+10, r25 ; 0x0a 1ff20: 89 87 std Y+9, r24 ; 0x09 lcd_clear(); 1ff22: 0e 94 2b 6f call 0xde56 ; 0xde56 lcd_putc_at(0, 0, '>'); 1ff26: 4e e3 ldi r20, 0x3E ; 62 1ff28: 60 e0 ldi r22, 0x00 ; 0 1ff2a: 80 e0 ldi r24, 0x00 ; 0 1ff2c: 0e 94 18 6f call 0xde30 ; 0xde30 lcd_consume_click(); 1ff30: 0e 94 10 71 call 0xe220 ; 0xe220 } } char reset_menu() { static int8_t first = 0; char cursor_pos = 0; 1ff34: 10 e0 ldi r17, 0x00 ; 0 1ff36: d1 2c mov r13, r1 1ff38: 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]); 1ff3a: 80 91 dc 04 lds r24, 0x04DC ; 0x8004dc 1ff3e: f6 01 movw r30, r12 1ff40: e8 0f add r30, r24 1ff42: f1 1d adc r31, r1 1ff44: 87 fd sbrc r24, 7 1ff46: fa 95 dec r31 1ff48: ee 0f add r30, r30 1ff4a: ff 1f adc r31, r31 1ff4c: a1 e0 ldi r26, 0x01 ; 1 1ff4e: b0 e0 ldi r27, 0x00 ; 0 1ff50: ac 0f add r26, r28 1ff52: bd 1f adc r27, r29 1ff54: ea 0f add r30, r26 1ff56: fb 1f adc r31, r27 1ff58: 40 81 ld r20, Z 1ff5a: 51 81 ldd r21, Z+1 ; 0x01 1ff5c: 6c 2d mov r22, r12 1ff5e: 81 e0 ldi r24, 0x01 ; 1 1ff60: 0e 94 0c 6f call 0xde18 ; 0xde18 1ff64: bf ef ldi r27, 0xFF ; 255 1ff66: cb 1a sub r12, r27 1ff68: db 0a sbc r13, r27 lcd_clear(); lcd_putc_at(0, 0, '>'); lcd_consume_click(); while (1) { for (uint_least8_t i = 0; i < 4; i++) { 1ff6a: e4 e0 ldi r30, 0x04 ; 4 1ff6c: ce 16 cp r12, r30 1ff6e: d1 04 cpc r13, r1 1ff70: 21 f7 brne .-56 ; 0x1ff3a lcd_puts_at_P(1, i, item[first + i]); } manage_heater(); 1ff72: 0f 94 2e 38 call 0x2705c ; 0x2705c manage_inactivity(true); 1ff76: 81 e0 ldi r24, 0x01 ; 1 1ff78: 0e 94 c7 8a call 0x1158e ; 0x1158e if (lcd_encoder) { 1ff7c: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 1ff80: 90 91 70 06 lds r25, 0x0670 ; 0x800670 1ff84: 00 97 sbiw r24, 0x00 ; 0 1ff86: 71 f1 breq .+92 ; 0x1ffe4 if (lcd_encoder < 0) { 1ff88: 97 ff sbrs r25, 7 1ff8a: 12 c0 rjmp .+36 ; 0x1ffb0 cursor_pos--; 1ff8c: 11 50 subi r17, 0x01 ; 1 if (lcd_encoder > 0) { cursor_pos++; } if (cursor_pos > 3) { 1ff8e: 14 30 cpi r17, 0x04 ; 4 1ff90: 0c f4 brge .+2 ; 0x1ff94 1ff92: a6 c0 rjmp .+332 ; 0x200e0 cursor_pos = 3; Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 1ff94: 87 e0 ldi r24, 0x07 ; 7 1ff96: 0f 94 c2 4d call 0x29b84 ; 0x29b84 if (first < (uint8_t)(sizeof(item) / sizeof(item[0])) - 4) { 1ff9a: 80 91 dc 04 lds r24, 0x04DC ; 0x8004dc 1ff9e: 18 16 cp r1, r24 1ffa0: 2c f0 brlt .+10 ; 0x1ffac first++; 1ffa2: 8f 5f subi r24, 0xFF ; 255 1ffa4: 80 93 dc 04 sts 0x04DC, r24 ; 0x8004dc lcd_clear(); 1ffa8: 0e 94 2b 6f call 0xde56 ; 0xde56 if (lcd_encoder > 0) { cursor_pos++; } if (cursor_pos > 3) { cursor_pos = 3; 1ffac: 13 e0 ldi r17, 0x03 ; 3 1ffae: 03 c0 rjmp .+6 ; 0x1ffb6 if (lcd_encoder < 0) { cursor_pos--; } if (lcd_encoder > 0) { cursor_pos++; 1ffb0: 1f 5f subi r17, 0xFF ; 255 } if (cursor_pos > 3) { 1ffb2: 14 30 cpi r17, 0x04 ; 4 1ffb4: 78 f7 brcc .-34 ; 0x1ff94 if (first > 0) { first--; lcd_clear(); } } lcd_puts_at_P(0, 0, PSTR(" \n \n \n ")); 1ffb6: 41 ee ldi r20, 0xE1 ; 225 1ffb8: 5d e8 ldi r21, 0x8D ; 141 1ffba: 60 e0 ldi r22, 0x00 ; 0 1ffbc: 80 e0 ldi r24, 0x00 ; 0 1ffbe: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_set_cursor(0, cursor_pos); 1ffc2: 61 2f mov r22, r17 1ffc4: 80 e0 ldi r24, 0x00 ; 0 1ffc6: 0e 94 f8 6e call 0xddf0 ; 0xddf0 lcd_putc('>'); 1ffca: 8e e3 ldi r24, 0x3E ; 62 1ffcc: 0e 94 e7 6e call 0xddce ; 0xddce lcd_encoder = 0; 1ffd0: 10 92 70 06 sts 0x0670, r1 ; 0x800670 1ffd4: 10 92 6f 06 sts 0x066F, r1 ; 0x80066f _delay(100); 1ffd8: 64 e6 ldi r22, 0x64 ; 100 1ffda: 70 e0 ldi r23, 0x00 ; 0 1ffdc: 80 e0 ldi r24, 0x00 ; 0 1ffde: 90 e0 ldi r25, 0x00 ; 0 1ffe0: 0f 94 29 27 call 0x24e52 ; 0x24e52 } if (lcd_clicked()) { 1ffe4: 0e 94 15 71 call 0xe22a ; 0xe22a 1ffe8: 88 23 and r24, r24 1ffea: 09 f4 brne .+2 ; 0x1ffee 1ffec: a4 cf rjmp .-184 ; 0x1ff36 return(cursor_pos + first); 1ffee: 80 91 dc 04 lds r24, 0x04DC ; 0x8004dc 1fff2: 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(); 1fff4: 0e 94 2b 6f call 0xde56 ; 0xde56 Sound_MakeCustom(100,0,false); 1fff8: 40 e0 ldi r20, 0x00 ; 0 1fffa: 70 e0 ldi r23, 0x00 ; 0 1fffc: 60 e0 ldi r22, 0x00 ; 0 1fffe: 84 e6 ldi r24, 0x64 ; 100 20000: 90 e0 ldi r25, 0x00 ; 0 20002: 0f 94 01 51 call 0x2a202 ; 0x2a202 switch (level) { 20006: 12 30 cpi r17, 0x02 ; 2 20008: 09 f4 brne .+2 ; 0x2000c 2000a: a0 c0 rjmp .+320 ; 0x2014c 2000c: 08 f0 brcs .+2 ; 0x20010 2000e: 79 c0 rjmp .+242 ; 0x20102 20010: 11 23 and r17, r17 20012: 09 f4 brne .+2 ; 0x20016 20014: 93 c0 rjmp .+294 ; 0x2013c 20016: 11 30 cpi r17, 0x01 ; 1 20018: 09 f4 brne .+2 ; 0x2001c 2001a: 93 c0 rjmp .+294 ; 0x20142 case 4: _delay_ms(0); break; } } } KEEPALIVE_STATE(IN_HANDLER); 2001c: 82 e0 ldi r24, 0x02 ; 2 2001e: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be plan_init(); // Initialize planner; factory_reset(); eeprom_init_default_byte((uint8_t*)EEPROM_SILENT, SILENT_MODE_OFF); 20022: 60 e0 ldi r22, 0x00 ; 0 20024: 8f ef ldi r24, 0xFF ; 255 20026: 9f e0 ldi r25, 0x0F ; 15 20028: 0e 94 21 76 call 0xec42 ; 0xec42 eeprom_init_default_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 1); //run wizard if uninitialized 2002c: 61 e0 ldi r22, 0x01 ; 1 2002e: 8f e5 ldi r24, 0x5F ; 95 20030: 9f e0 ldi r25, 0x0F ; 15 20032: 0e 94 21 76 call 0xec42 ; 0xec42 #ifdef TMC2130 uint8_t silentMode = eeprom_read_byte((uint8_t*)EEPROM_SILENT); 20036: 8f ef ldi r24, 0xFF ; 255 20038: 9f e0 ldi r25, 0x0F ; 15 2003a: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 2003e: 18 2f mov r17, r24 if (silentMode == 0xff) silentMode = 0; 20040: 8f 3f cpi r24, 0xFF ; 255 20042: 09 f4 brne .+2 ; 0x20046 20044: 10 e0 ldi r17, 0x00 ; 0 tmc2130_mode = TMC2130_MODE_NORMAL; 20046: 10 92 8b 06 sts 0x068B, r1 ; 0x80068b tmc2130_sg_stop_on_crash = eeprom_init_default_byte((uint8_t*)EEPROM_CRASH_DET, farm_mode ? false : true); 2004a: 61 e0 ldi r22, 0x01 ; 1 2004c: 89 e6 ldi r24, 0x69 ; 105 2004e: 9f e0 ldi r25, 0x0F ; 15 20050: 0e 94 21 76 call 0xec42 ; 0xec42 20054: 91 e0 ldi r25, 0x01 ; 1 20056: 81 11 cpse r24, r1 20058: 01 c0 rjmp .+2 ; 0x2005c 2005a: 90 e0 ldi r25, 0x00 ; 0 2005c: 90 93 5c 02 sts 0x025C, r25 ; 0x80025c if (tmc2130_sg_stop_on_crash) { 20060: 88 23 and r24, r24 20062: 09 f4 brne .+2 ; 0x20066 20064: a5 c0 rjmp .+330 ; 0x201b0 puts_P(_N("CrashDetect ENABLED!")); 20066: 8d e2 ldi r24, 0x2D ; 45 20068: 9d e6 ldi r25, 0x6D ; 109 } else { puts_P(_N("CrashDetect DISABLED")); 2006a: 0f 94 c0 da call 0x3b580 ; 0x3b580 } #ifdef TMC2130_LINEARITY_CORRECTION #ifdef TMC2130_LINEARITY_CORRECTION_XYZ tmc2130_wave_fac[X_AXIS] = eeprom_read_byte((uint8_t*)EEPROM_TMC2130_WAVE_X_FAC); 2006e: 87 ef ldi r24, 0xF7 ; 247 20070: 9e e0 ldi r25, 0x0E ; 14 20072: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 20076: c8 2e mov r12, r24 20078: 80 93 f8 04 sts 0x04F8, r24 ; 0x8004f8 tmc2130_wave_fac[Y_AXIS] = eeprom_read_byte((uint8_t*)EEPROM_TMC2130_WAVE_Y_FAC); 2007c: 86 ef ldi r24, 0xF6 ; 246 2007e: 9e e0 ldi r25, 0x0E ; 14 20080: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 20084: d8 2e mov r13, r24 20086: 80 93 f9 04 sts 0x04F9, r24 ; 0x8004f9 tmc2130_wave_fac[Z_AXIS] = eeprom_read_byte((uint8_t*)EEPROM_TMC2130_WAVE_Z_FAC); 2008a: 85 ef ldi r24, 0xF5 ; 245 2008c: 9e e0 ldi r25, 0x0E ; 14 2008e: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 20092: e8 2e mov r14, r24 20094: 80 93 fa 04 sts 0x04FA, r24 ; 0x8004fa #endif //TMC2130_LINEARITY_CORRECTION_XYZ tmc2130_wave_fac[E_AXIS] = eeprom_read_byte((uint8_t*)EEPROM_TMC2130_WAVE_E_FAC); 20098: 84 ef ldi r24, 0xF4 ; 244 2009a: 9e e0 ldi r25, 0x0E ; 14 2009c: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 200a0: 80 93 fb 04 sts 0x04FB, r24 ; 0x8004fb if (tmc2130_wave_fac[X_AXIS] == 0xff) tmc2130_wave_fac[X_AXIS] = 0; 200a4: 2f ef ldi r18, 0xFF ; 255 200a6: c2 12 cpse r12, r18 200a8: 02 c0 rjmp .+4 ; 0x200ae 200aa: 10 92 f8 04 sts 0x04F8, r1 ; 0x8004f8 if (tmc2130_wave_fac[Y_AXIS] == 0xff) tmc2130_wave_fac[Y_AXIS] = 0; 200ae: 3f ef ldi r19, 0xFF ; 255 200b0: d3 12 cpse r13, r19 200b2: 02 c0 rjmp .+4 ; 0x200b8 200b4: 10 92 f9 04 sts 0x04F9, r1 ; 0x8004f9 if (tmc2130_wave_fac[Z_AXIS] == 0xff) tmc2130_wave_fac[Z_AXIS] = 0; 200b8: 9f ef ldi r25, 0xFF ; 255 200ba: e9 12 cpse r14, r25 200bc: 02 c0 rjmp .+4 ; 0x200c2 200be: 10 92 fa 04 sts 0x04FA, r1 ; 0x8004fa if (tmc2130_wave_fac[E_AXIS] == 0xff) tmc2130_wave_fac[E_AXIS] = 0; 200c2: 8f 3f cpi r24, 0xFF ; 255 200c4: 11 f4 brne .+4 ; 0x200ca 200c6: 10 92 fb 04 sts 0x04FB, r1 ; 0x8004fb #endif //TMC2130_LINEARITY_CORRECTION #ifdef TMC2130_VARIABLE_RESOLUTION tmc2130_mres[X_AXIS] = tmc2130_usteps2mres(cs.axis_ustep_resolution[X_AXIS]); 200ca: 80 91 79 0e lds r24, 0x0E79 ; 0x800e79 200ce: 90 e0 ldi r25, 0x00 ; 0 //printf_P(PSTR("MSLUT[%d]=%08lx\n"), i, val); } uint8_t tmc2130_usteps2mres(uint16_t usteps) { uint8_t mres = 8; while (usteps >>= 1) mres--; 200d0: 28 e0 ldi r18, 0x08 ; 8 200d2: 96 95 lsr r25 200d4: 87 95 ror r24 200d6: 00 97 sbiw r24, 0x00 ; 0 200d8: 09 f4 brne .+2 ; 0x200dc 200da: 6d c0 rjmp .+218 ; 0x201b6 200dc: 21 50 subi r18, 0x01 ; 1 200de: f9 cf rjmp .-14 ; 0x200d2 first++; lcd_clear(); } } if (cursor_pos < 0) { 200e0: 1f 3f cpi r17, 0xFF ; 255 200e2: 09 f0 breq .+2 ; 0x200e6 200e4: 68 cf rjmp .-304 ; 0x1ffb6 cursor_pos = 0; Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 200e6: 87 e0 ldi r24, 0x07 ; 7 200e8: 0f 94 c2 4d call 0x29b84 ; 0x29b84 if (first > 0) { 200ec: 80 91 dc 04 lds r24, 0x04DC ; 0x8004dc 200f0: 18 16 cp r1, r24 200f2: 2c f4 brge .+10 ; 0x200fe first--; 200f4: 81 50 subi r24, 0x01 ; 1 200f6: 80 93 dc 04 sts 0x04DC, r24 ; 0x8004dc lcd_clear(); 200fa: 0e 94 2b 6f call 0xde56 ; 0xde56 lcd_clear(); } } if (cursor_pos < 0) { cursor_pos = 0; 200fe: 10 e0 ldi r17, 0x00 ; 0 20100: 5a cf rjmp .-332 ; 0x1ffb6 // Level input parameter sets depth of reset static void factory_reset(char level) { lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { 20102: 13 30 cpi r17, 0x03 ; 3 20104: 29 f1 breq .+74 ; 0x20150 20106: 14 30 cpi r17, 0x04 ; 4 20108: 09 f0 breq .+2 ; 0x2010c 2010a: 88 cf rjmp .-240 ; 0x2001c #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) #endif //FILAMENT_SENSOR break; case 4: menu_progressbar_init(EEPROM_TOP, PSTR("ERASING all data")); 2010c: 61 e2 ldi r22, 0x21 ; 33 2010e: 7e e8 ldi r23, 0x8E ; 142 20110: 80 e0 ldi r24, 0x00 ; 0 20112: 90 e1 ldi r25, 0x10 ; 16 20114: 0f 94 b3 cf call 0x39f66 ; 0x39f66 // Erase EEPROM for (uint16_t i = 0; i < EEPROM_TOP; i++) { 20118: 10 e0 ldi r17, 0x00 ; 0 2011a: 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); 2011c: 6f ef ldi r22, 0xFF ; 255 2011e: c8 01 movw r24, r16 20120: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 eeprom_update_byte_notify((uint8_t*)i, 0xFF); menu_progressbar_update(i); 20124: c8 01 movw r24, r16 20126: 0f 94 84 cf call 0x39f08 ; 0x39f08 break; case 4: menu_progressbar_init(EEPROM_TOP, PSTR("ERASING all data")); // Erase EEPROM for (uint16_t i = 0; i < EEPROM_TOP; i++) { 2012a: 0f 5f subi r16, 0xFF ; 255 2012c: 1f 4f sbci r17, 0xFF ; 255 2012e: 01 15 cp r16, r1 20130: f0 e1 ldi r31, 0x10 ; 16 20132: 1f 07 cpc r17, r31 20134: 99 f7 brne .-26 ; 0x2011c eeprom_update_byte_notify((uint8_t*)i, 0xFF); menu_progressbar_update(i); } menu_progressbar_finish(); 20136: 0f 94 a5 cf call 0x39f4a ; 0x39f4a 2013a: 40 cc rjmp .-1920 ; 0x1f9bc lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { case 0: // Level 0: Language reset lang_reset(); 2013c: 0e 94 44 71 call 0xe288 ; 0xe288 20140: 6d cf rjmp .-294 ; 0x2001c break; case 1: //Level 1: Reset statistics factory_reset_stats(); 20142: 0e 94 29 67 call 0xce52 ; 0xce52 lcd_menu_statistics(); 20146: 0f 94 a7 3e call 0x27d4e ; 0x27d4e 2014a: 68 cf rjmp .-304 ; 0x2001c break; case 2: // Level 2: Prepare for shipping factory_reset_stats(); 2014c: 0e 94 29 67 call 0xce52 ; 0xce52 // FALLTHRU case 3: // Level 3: Preparation after being serviced // Force language selection at the next boot up. lang_reset(); 20150: 0e 94 44 71 call 0xe288 ; 0xe288 // Force the wizard in "Follow calibration flow" mode at the next boot up calibration_status_clear(CALIBRATION_FORCE_PREP); 20154: 84 e0 ldi r24, 0x04 ; 4 20156: 0e 94 18 ee call 0x1dc30 ; 0x1dc30 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); 2015a: 62 e0 ldi r22, 0x02 ; 2 2015c: 8f e5 ldi r24, 0x5F ; 95 2015e: 9f e0 ldi r25, 0x0F ; 15 20160: 0f 94 1f dc call 0x3b83e ; 0x3b83e eeprom_write_byte_notify((uint8_t*)EEPROM_WIZARD_ACTIVE, 2); farm_disable(); #ifdef FILAMENT_SENSOR fsensor.setEnabled(true); 20164: 81 e0 ldi r24, 0x01 ; 1 20166: 0e 94 e7 74 call 0xe9ce ; 0xe9ce fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 2016a: 11 e0 ldi r17, 0x01 ; 1 2016c: 10 93 aa 17 sts 0x17AA, r17 ; 0x8017aa if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 20170: 61 e0 ldi r22, 0x01 ; 1 20172: 87 e0 ldi r24, 0x07 ; 7 20174: 9f e0 ldi r25, 0x0F ; 15 20176: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 2017a: 10 93 ab 17 sts 0x17AB, r17 ; 0x8017ab 2017e: 61 e0 ldi r22, 0x01 ; 1 20180: 85 ed ldi r24, 0xD5 ; 213 20182: 9e e0 ldi r25, 0x0E ; 14 20184: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 return fsensorDetected; } #endif void PAT9125_sensor::setJamDetectionEnabled(bool state, bool updateEEPROM) { jamDetection = state; 20188: 10 93 b7 17 sts 0x17B7, r17 ; 0x8017b7 oldPos = pat9125_y; 2018c: 80 91 8e 0e lds r24, 0x0E8E ; 0x800e8e 20190: 90 91 8f 0e lds r25, 0x0E8F ; 0x800e8f 20194: 90 93 b9 17 sts 0x17B9, r25 ; 0x8017b9 20198: 80 93 b8 17 sts 0x17B8, r24 ; 0x8017b8 resetStepCount(); 2019c: 0f 94 a5 7a call 0x2f54a ; 0x2f54a jamErrCnt = 0; 201a0: 10 92 be 17 sts 0x17BE, r1 ; 0x8017be 201a4: 61 e0 ldi r22, 0x01 ; 1 201a6: 8d ea ldi r24, 0xAD ; 173 201a8: 9c e0 ldi r25, 0x0C ; 12 201aa: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 201ae: 36 cf rjmp .-404 ; 0x2001c tmc2130_sg_stop_on_crash = eeprom_init_default_byte((uint8_t*)EEPROM_CRASH_DET, farm_mode ? false : true); if (tmc2130_sg_stop_on_crash) { puts_P(_N("CrashDetect ENABLED!")); } else { puts_P(_N("CrashDetect DISABLED")); 201b0: 88 e1 ldi r24, 0x18 ; 24 201b2: 9d e6 ldi r25, 0x6D ; 109 201b4: 5a cf rjmp .-332 ; 0x2006a if (tmc2130_wave_fac[Z_AXIS] == 0xff) tmc2130_wave_fac[Z_AXIS] = 0; if (tmc2130_wave_fac[E_AXIS] == 0xff) tmc2130_wave_fac[E_AXIS] = 0; #endif //TMC2130_LINEARITY_CORRECTION #ifdef TMC2130_VARIABLE_RESOLUTION tmc2130_mres[X_AXIS] = tmc2130_usteps2mres(cs.axis_ustep_resolution[X_AXIS]); 201b6: 20 93 f4 04 sts 0x04F4, r18 ; 0x8004f4 tmc2130_mres[Y_AXIS] = tmc2130_usteps2mres(cs.axis_ustep_resolution[Y_AXIS]); 201ba: 80 91 7a 0e lds r24, 0x0E7A ; 0x800e7a 201be: 90 e0 ldi r25, 0x00 ; 0 201c0: 28 e0 ldi r18, 0x08 ; 8 201c2: 96 95 lsr r25 201c4: 87 95 ror r24 201c6: 00 97 sbiw r24, 0x00 ; 0 201c8: 11 f0 breq .+4 ; 0x201ce 201ca: 21 50 subi r18, 0x01 ; 1 201cc: fa cf rjmp .-12 ; 0x201c2 201ce: 20 93 f5 04 sts 0x04F5, r18 ; 0x8004f5 tmc2130_mres[Z_AXIS] = tmc2130_usteps2mres(cs.axis_ustep_resolution[Z_AXIS]); 201d2: 80 91 7b 0e lds r24, 0x0E7B ; 0x800e7b 201d6: 90 e0 ldi r25, 0x00 ; 0 201d8: 28 e0 ldi r18, 0x08 ; 8 201da: 96 95 lsr r25 201dc: 87 95 ror r24 201de: 00 97 sbiw r24, 0x00 ; 0 201e0: 11 f0 breq .+4 ; 0x201e6 201e2: 21 50 subi r18, 0x01 ; 1 201e4: fa cf rjmp .-12 ; 0x201da 201e6: 20 93 f6 04 sts 0x04F6, r18 ; 0x8004f6 tmc2130_mres[E_AXIS] = tmc2130_usteps2mres(cs.axis_ustep_resolution[E_AXIS]); 201ea: 80 91 7c 0e lds r24, 0x0E7C ; 0x800e7c 201ee: 90 e0 ldi r25, 0x00 ; 0 201f0: 28 e0 ldi r18, 0x08 ; 8 201f2: 96 95 lsr r25 201f4: 87 95 ror r24 201f6: 00 97 sbiw r24, 0x00 ; 0 201f8: 11 f0 breq .+4 ; 0x201fe 201fa: 21 50 subi r18, 0x01 ; 1 201fc: fa cf rjmp .-12 ; 0x201f2 201fe: 20 93 f7 04 sts 0x04F7, r18 ; 0x8004f7 return ( eeprom_read_byte((uint8_t *)EEPROM_ECOOL_ENABLE) == EEPROM_ECOOL_MAGIC_NUMBER ) && ( eeprom_read_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY) == 1 ); } bool FarmOrUserECool(){ return farm_mode || UserECoolEnabled(); 20202: 0e 94 ac ef call 0x1df58 ; 0x1df58 20206: 88 0f add r24, r24 #endif // LIN_ADVANCE void st_init() { #ifdef TMC2130 tmc2130_init(TMCInitParams(false, FarmOrUserECool())); 20208: 82 70 andi r24, 0x02 ; 2 2020a: 0f 94 36 26 call 0x24c6c ; 0x24c6c microstep_init(); //Initialize Microstepping Pins #endif //TMC2130 //Initialize Dir Pins #if defined(X_DIR_PIN) && X_DIR_PIN > -1 SET_OUTPUT(X_DIR_PIN); 2020e: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 20212: 81 60 ori r24, 0x01 ; 1 20214: 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); 20218: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 2021c: 82 60 ori r24, 0x02 ; 2 2021e: 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); 20222: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 20226: 84 60 ori r24, 0x04 ; 4 20228: 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); 2022c: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 20230: 80 64 ori r24, 0x40 ; 64 20232: 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); 20236: 0f 9a sbi 0x01, 7 ; 1 if(!X_ENABLE_ON) WRITE(X_ENABLE_PIN,HIGH); 20238: 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); 2023a: 0e 9a sbi 0x01, 6 ; 1 if(!Y_ENABLE_ON) WRITE(Y_ENABLE_PIN,HIGH); 2023c: 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); 2023e: 0d 9a sbi 0x01, 5 ; 1 if(!Z_ENABLE_ON) WRITE(Z_ENABLE_PIN,HIGH); 20240: 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); 20242: 0c 9a sbi 0x01, 4 ; 1 if(!E_ENABLE_ON) WRITE(E0_ENABLE_PIN,HIGH); 20244: 14 9a sbi 0x02, 4 ; 2 #endif //endstops and pullups #if defined(X_MIN_PIN) && X_MIN_PIN > -1 SET_INPUT(X_MIN_PIN); 20246: 26 98 cbi 0x04, 6 ; 4 #ifdef ENDSTOPPULLUP_XMIN WRITE(X_MIN_PIN,HIGH); 20248: 2e 9a sbi 0x05, 6 ; 5 #endif #endif #if defined(Y_MIN_PIN) && Y_MIN_PIN > -1 SET_INPUT(Y_MIN_PIN); 2024a: 25 98 cbi 0x04, 5 ; 4 #ifdef ENDSTOPPULLUP_YMIN WRITE(Y_MIN_PIN,HIGH); 2024c: 2d 9a sbi 0x05, 5 ; 5 #endif #endif #if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 SET_INPUT(Z_MIN_PIN); 2024e: 24 98 cbi 0x04, 4 ; 4 #ifdef ENDSTOPPULLUP_ZMIN WRITE(Z_MIN_PIN,HIGH); 20250: 2c 9a sbi 0x05, 4 ; 5 #endif #endif #if defined(X_MAX_PIN) && X_MAX_PIN > -1 SET_INPUT(X_MAX_PIN); 20252: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 20256: 8b 7f andi r24, 0xFB ; 251 20258: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> #ifdef ENDSTOPPULLUP_XMAX WRITE(X_MAX_PIN,HIGH); 2025c: 9f b7 in r25, 0x3f ; 63 2025e: f8 94 cli 20260: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 20264: 84 60 ori r24, 0x04 ; 4 20266: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 2026a: 9f bf out 0x3f, r25 ; 63 #endif #endif #if defined(Y_MAX_PIN) && Y_MAX_PIN > -1 SET_INPUT(Y_MAX_PIN); 2026c: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 20270: 8f 77 andi r24, 0x7F ; 127 20272: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> #ifdef ENDSTOPPULLUP_YMAX WRITE(Y_MAX_PIN,HIGH); 20276: 9f b7 in r25, 0x3f ; 63 20278: f8 94 cli 2027a: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 2027e: 80 68 ori r24, 0x80 ; 128 20280: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 20284: 9f bf out 0x3f, r25 ; 63 #endif #endif #if defined(Z_MAX_PIN) && Z_MAX_PIN > -1 SET_INPUT(Z_MAX_PIN); 20286: 09 98 cbi 0x01, 1 ; 1 #ifdef ENDSTOPPULLUP_ZMAX WRITE(Z_MAX_PIN,HIGH); 20288: 11 9a sbi 0x02, 1 ; 2 #endif #endif #if (defined(FANCHECK) && defined(TACH_0) && (TACH_0 > -1)) SET_INPUT(TACH_0); 2028a: 6e 98 cbi 0x0d, 6 ; 13 #endif //Initialize Step Pins #if defined(X_STEP_PIN) && (X_STEP_PIN > -1) SET_OUTPUT(X_STEP_PIN); 2028c: 38 9a sbi 0x07, 0 ; 7 WRITE(X_STEP_PIN,INVERT_X_STEP_PIN); 2028e: 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(); 20290: 17 9a sbi 0x02, 7 ; 2 20292: 10 92 8e 06 sts 0x068E, r1 ; 0x80068e 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); 20296: 39 9a sbi 0x07, 1 ; 7 WRITE(Y_STEP_PIN,INVERT_Y_STEP_PIN); 20298: 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(); 2029a: 16 9a sbi 0x02, 6 ; 2 2029c: 10 92 8f 06 sts 0x068F, r1 ; 0x80068f #endif #if defined(Z_STEP_PIN) && (Z_STEP_PIN > -1) SET_OUTPUT(Z_STEP_PIN); 202a0: 3a 9a sbi 0x07, 2 ; 7 WRITE(Z_STEP_PIN,INVERT_Z_STEP_PIN); 202a2: 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); 202a4: 3b 9a sbi 0x07, 3 ; 7 WRITE(E0_STEP_PIN,INVERT_E_STEP_PIN); 202a6: 43 98 cbi 0x08, 3 ; 8 disable_e0(); 202a8: 14 9a sbi 0x02, 4 ; 2 #endif // waveform generation = 0100 = CTC TCCR1B &= ~(1< 202ae: 8f 7e andi r24, 0xEF ; 239 202b0: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> TCCR1B |= (1< 202b8: 88 60 ori r24, 0x08 ; 8 202ba: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> TCCR1A &= ~(1< 202c2: 8d 7f andi r24, 0xFD ; 253 202c4: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> TCCR1A &= ~(1< 202cc: 8e 7f andi r24, 0xFE ; 254 202ce: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> // output mode = 00 (disconnected) TCCR1A &= ~(3< 202d6: 8f 73 andi r24, 0x3F ; 63 202d8: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> TCCR1A &= ~(3< 202e0: 8f 7c andi r24, 0xCF ; 207 202e2: 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< 202ea: 88 7f andi r24, 0xF8 ; 248 202ec: 82 60 ori r24, 0x02 ; 2 202ee: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> // Plan the first interrupt after 8ms from now. OCR1A = 0x4000; 202f2: 80 e0 ldi r24, 0x00 ; 0 202f4: 90 e4 ldi r25, 0x40 ; 64 202f6: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 202fa: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> TCNT1 = 0; 202fe: 10 92 85 00 sts 0x0085, r1 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 20302: 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; 20306: 10 92 e5 04 sts 0x04E5, r1 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.476+0x1> 2030a: 10 92 e4 04 sts 0x04E4, r1 ; 0x8004e4 <_ZL11nextMainISR.lto_priv.476> nextAdvanceISR = ADV_NEVER; 2030e: 8f ef ldi r24, 0xFF ; 255 20310: 9f ef ldi r25, 0xFF ; 255 20312: 90 93 e3 04 sts 0x04E3, r25 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.477+0x1> 20316: 80 93 e2 04 sts 0x04E2, r24 ; 0x8004e2 <_ZL14nextAdvanceISR.lto_priv.477> main_Rate = ADV_NEVER; 2031a: 90 93 e1 04 sts 0x04E1, r25 ; 0x8004e1 <_ZL9main_Rate.lto_priv.478+0x1> 2031e: 80 93 e0 04 sts 0x04E0, r24 ; 0x8004e0 <_ZL9main_Rate.lto_priv.478> current_adv_steps = 0; 20322: 10 92 df 04 sts 0x04DF, r1 ; 0x8004df <_ZL17current_adv_steps.lto_priv.479+0x1> 20326: 10 92 de 04 sts 0x04DE, r1 ; 0x8004de <_ZL17current_adv_steps.lto_priv.479> } bool enable_endstops(bool check) { bool old = check_endstops; check_endstops = check; 2032a: 81 e0 ldi r24, 0x01 ; 1 2032c: 80 93 b7 02 sts 0x02B7, r24 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> current_adv_steps = 0; #endif enable_endstops(true); // Start with endstops active. After homing they can be disabled ENABLE_STEPPER_DRIVER_INTERRUPT(); 20330: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 20334: 82 60 ori r24, 0x02 ; 2 20336: 80 93 6f 00 sts 0x006F, r24 ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> sei(); 2033a: 78 94 sei #endif //TMC2130 st_init(); // Initialize stepper, this enables interrupts! #ifdef TMC2130 tmc2130_mode = silentMode?TMC2130_MODE_SILENT:TMC2130_MODE_NORMAL; 2033c: 81 e0 ldi r24, 0x01 ; 1 2033e: 11 11 cpse r17, r1 20340: 01 c0 rjmp .+2 ; 0x20344 20342: 80 e0 ldi r24, 0x00 ; 0 20344: 80 93 8b 06 sts 0x068B, r24 ; 0x80068b update_mode_profile(); 20348: 0f 94 5c 63 call 0x2c6b8 ; 0x2c6b8 2034c: 0e 94 ac ef call 0x1df58 ; 0x1df58 20350: 88 0f add r24, r24 tmc2130_init(TMCInitParams(false, FarmOrUserECool() )); 20352: 82 70 andi r24, 0x02 ; 2 20354: 0f 94 36 26 call 0x24c6c ; 0x24c6c setup_photpin(); // Reset the machine correction matrix. // It does not make sense to load the correction matrix until the machine is homed. world2machine_reset(); 20358: 0f 94 b8 cd call 0x39b70 ; 0x39b70 // Initialize current_position accounting for software endstops to // avoid unexpected initial shifts on the first move clamp_to_software_endstops(current_position); 2035c: 81 e9 ldi r24, 0x91 ; 145 2035e: 96 e0 ldi r25, 0x06 ; 6 20360: 0e 94 e1 6b call 0xd7c2 ; 0xd7c2 plan_set_position_curposXYZE(); 20364: 0f 94 c4 be call 0x37d88 ; 0x37d88 // Show the xflash error message now that serial, lcd and encoder are available if (!xflash_success) 20368: b1 10 cpse r11, r1 2036a: 08 c0 rjmp .+16 ; 0x2037c } static void xflash_err_msg() { puts_P(_n("XFLASH not responding.")); 2036c: 85 e7 ldi r24, 0x75 ; 117 2036e: 9c e6 ldi r25, 0x6C ; 108 20370: 0f 94 c0 da call 0x3b580 ; 0x3b580 lcd_show_fullscreen_message_and_wait_P(_n("External SPI flash\nXFLASH is not res-\nponding. Language\nswitch unavailable.")); 20374: 89 e2 ldi r24, 0x29 ; 41 20376: 9c e6 ldi r25, 0x6C ; 108 20378: 0f 94 c7 1f call 0x23f8e ; 0x23f8e } #define KILL_PENDING_FLAG 0x42 static void fw_kill_init() { if (eeprom_read_byte((uint8_t*)EEPROM_KILL_PENDING_FLAG) == KILL_PENDING_FLAG) { 2037c: 84 e9 ldi r24, 0x94 ; 148 2037e: 9c e0 ldi r25, 0x0C ; 12 20380: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 20384: 82 34 cpi r24, 0x42 ; 66 20386: 59 f4 brne .+22 ; 0x2039e 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); 20388: 6f ef ldi r22, 0xFF ; 255 2038a: 84 e9 ldi r24, 0x94 ; 148 2038c: 9c e0 ldi r25, 0x0C ; 12 2038e: 0f 94 1f dc call 0x3b83e ; 0x3b83e // 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); 20392: 85 e9 ldi r24, 0x95 ; 149 20394: 9c e0 ldi r25, 0x0C ; 12 20396: 0f 94 e5 db call 0x3b7ca ; 0x3b7ca lcd_show_fullscreen_message_and_wait_P(kill_msg); 2039a: 0f 94 c7 1f call 0x23f8e ; 0x23f8e // report kill() events fw_kill_init(); #ifdef FILAMENT_SENSOR fsensor.init(); 2039e: 0f 94 f4 7a call 0x2f5e8 ; 0x2f5e8 #endif setup_homepin(); #if defined(Z_AXIS_ALWAYS_ON) enable_z(); 203a2: 15 98 cbi 0x02, 5 ; 2 // The farm monitoring SW may accidentally expect // 2 messages of "printer started" to consider a printer working. prusa_statistics(8); // Enable Toshiba FlashAir SD card / WiFi enahanced card. card.ToshibaFlashAir_enable(eeprom_read_byte((unsigned char*)EEPROM_TOSHIBA_FLASH_AIR_COMPATIBLITY) == 1); 203a4: 8b eb ldi r24, 0xBB ; 187 203a6: 9f e0 ldi r25, 0x0F ; 15 203a8: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 203ac: 91 e0 ldi r25, 0x01 ; 1 203ae: 81 30 cpi r24, 0x01 ; 1 203b0: 09 f0 breq .+2 ; 0x203b4 203b2: 90 e0 ldi r25, 0x00 ; 0 203b4: 90 93 00 17 sts 0x1700, r25 ; 0x801700 // 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(); 203b8: 81 e0 ldi r24, 0x01 ; 1 203ba: 0f 94 7d 80 call 0x300fa ; 0x300fa #include #include void eeprom_init() { eeprom_init_default_byte((uint8_t*)EEPROM_POWER_COUNT, 0); 203be: 60 e0 ldi r22, 0x00 ; 0 203c0: 84 e6 ldi r24, 0x64 ; 100 203c2: 9f e0 ldi r25, 0x0F ; 15 203c4: 0e 94 21 76 call 0xec42 ; 0xec42 eeprom_init_default_byte((uint8_t*)EEPROM_CRASH_COUNT_X, 0); 203c8: 60 e0 ldi r22, 0x00 ; 0 203ca: 86 e6 ldi r24, 0x66 ; 102 203cc: 9f e0 ldi r25, 0x0F ; 15 203ce: 0e 94 21 76 call 0xec42 ; 0xec42 eeprom_init_default_byte((uint8_t*)EEPROM_CRASH_COUNT_Y, 0); 203d2: 60 e0 ldi r22, 0x00 ; 0 203d4: 88 e6 ldi r24, 0x68 ; 104 203d6: 9f e0 ldi r25, 0x0F ; 15 203d8: 0e 94 21 76 call 0xec42 ; 0xec42 eeprom_init_default_byte((uint8_t*)EEPROM_FERROR_COUNT, 0); 203dc: 60 e0 ldi r22, 0x00 ; 0 203de: 85 e6 ldi r24, 0x65 ; 101 203e0: 9f e0 ldi r25, 0x0F ; 15 203e2: 0e 94 21 76 call 0xec42 ; 0xec42 eeprom_init_default_word((uint16_t*)EEPROM_POWER_COUNT_TOT, 0); 203e6: 70 e0 ldi r23, 0x00 ; 0 203e8: 60 e0 ldi r22, 0x00 ; 0 203ea: 8f ef ldi r24, 0xFF ; 255 203ec: 9e e0 ldi r25, 0x0E ; 14 203ee: 0e 94 09 76 call 0xec12 ; 0xec12 eeprom_init_default_word((uint16_t*)EEPROM_CRASH_COUNT_X_TOT, 0); 203f2: 70 e0 ldi r23, 0x00 ; 0 203f4: 60 e0 ldi r22, 0x00 ; 0 203f6: 85 e0 ldi r24, 0x05 ; 5 203f8: 9f e0 ldi r25, 0x0F ; 15 203fa: 0e 94 09 76 call 0xec12 ; 0xec12 eeprom_init_default_word((uint16_t*)EEPROM_CRASH_COUNT_Y_TOT, 0); 203fe: 70 e0 ldi r23, 0x00 ; 0 20400: 60 e0 ldi r22, 0x00 ; 0 20402: 83 e0 ldi r24, 0x03 ; 3 20404: 9f e0 ldi r25, 0x0F ; 15 20406: 0e 94 09 76 call 0xec12 ; 0xec12 eeprom_init_default_word((uint16_t*)EEPROM_FERROR_COUNT_TOT, 0); 2040a: 70 e0 ldi r23, 0x00 ; 0 2040c: 60 e0 ldi r22, 0x00 ; 0 2040e: 81 e0 ldi r24, 0x01 ; 1 20410: 9f e0 ldi r25, 0x0F ; 15 20412: 0e 94 09 76 call 0xec12 ; 0xec12 eeprom_init_default_word((uint16_t*)EEPROM_MMU_FAIL_TOT, 0); 20416: 70 e0 ldi r23, 0x00 ; 0 20418: 60 e0 ldi r22, 0x00 ; 0 2041a: 83 ed ldi r24, 0xD3 ; 211 2041c: 9e e0 ldi r25, 0x0E ; 14 2041e: 0e 94 09 76 call 0xec12 ; 0xec12 eeprom_init_default_word((uint16_t*)EEPROM_MMU_LOAD_FAIL_TOT, 0); 20422: 70 e0 ldi r23, 0x00 ; 0 20424: 60 e0 ldi r22, 0x00 ; 0 20426: 80 ed ldi r24, 0xD0 ; 208 20428: 9e e0 ldi r25, 0x0E ; 14 2042a: 0e 94 09 76 call 0xec12 ; 0xec12 eeprom_init_default_byte((uint8_t*)EEPROM_MMU_FAIL, 0); 2042e: 60 e0 ldi r22, 0x00 ; 0 20430: 82 ed ldi r24, 0xD2 ; 210 20432: 9e e0 ldi r25, 0x0E ; 14 20434: 0e 94 21 76 call 0xec42 ; 0xec42 eeprom_init_default_byte((uint8_t*)EEPROM_MMU_LOAD_FAIL, 0); 20438: 60 e0 ldi r22, 0x00 ; 0 2043a: 8f ec ldi r24, 0xCF ; 207 2043c: 9e e0 ldi r25, 0x0E ; 14 2043e: 0e 94 21 76 call 0xec42 ; 0xec42 eeprom_init_default_dword((uint32_t*)EEPROM_MMU_MATERIAL_CHANGES, 0); 20442: 88 ea ldi r24, 0xA8 ; 168 20444: 9c e0 ldi r25, 0x0C ; 12 20446: 0f 94 18 7a call 0x2f430 ; 0x2f430 if (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == EEPROM_EMPTY_VALUE) 2044a: 81 ea ldi r24, 0xA1 ; 161 2044c: 9d e0 ldi r25, 0x0D ; 13 2044e: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 20452: 8f 3f cpi r24, 0xFF ; 255 20454: 71 f4 brne .+28 ; 0x20472 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 20456: 60 e0 ldi r22, 0x00 ; 0 20458: 81 ea ldi r24, 0xA1 ; 161 2045a: 9d e0 ldi r25, 0x0D ; 13 2045c: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 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); 20460: 88 ef ldi r24, 0xF8 ; 248 20462: 9f e0 ldi r25, 0x0F ; 15 20464: 0f 94 e5 db call 0x3b7ca ; 0x3b7ca eeprom_update_word(reinterpret_cast(&(EEPROM_Sheets_base->s[0].z_offset)), last_babystep); 20468: bc 01 movw r22, r24 2046a: 80 e5 ldi r24, 0x50 ; 80 2046c: 9d e0 ldi r25, 0x0D ; 13 2046e: 0f 94 19 dc call 0x3b832 ; 0x3b832 20472: 39 e4 ldi r19, 0x49 ; 73 20474: c3 2e mov r12, r19 20476: 3d e0 ldi r19, 0x0D ; 13 20478: d3 2e mov r13, r19 2047a: 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); 2047c: be 01 movw r22, r28 2047e: 6f 5f subi r22, 0xFF ; 255 20480: 7f 4f sbci r23, 0xFF ; 255 20482: 81 2f mov r24, r17 20484: 0e 94 89 76 call 0xed12 ; 0xed12 eeprom_init_default_block(EEPROM_Sheets_base->s[i].name, (sizeof(Sheet::name)/sizeof(Sheet::name[0])), sheetName.c); 20488: ae 01 movw r20, r28 2048a: 4f 5f subi r20, 0xFF ; 255 2048c: 5f 4f sbci r21, 0xFF ; 255 2048e: 67 e0 ldi r22, 0x07 ; 7 20490: 70 e0 ldi r23, 0x00 ; 0 20492: c6 01 movw r24, r12 20494: 0e 94 ea 75 call 0xebd4 ; 0xebd4 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++) { 20498: 1f 5f subi r17, 0xFF ; 255 2049a: ab e0 ldi r26, 0x0B ; 11 2049c: ca 0e add r12, r26 2049e: d1 1c adc r13, r1 204a0: 18 30 cpi r17, 0x08 ; 8 204a2: 61 f7 brne .-40 ; 0x2047c 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)))) 204a4: 81 ea ldi r24, 0xA1 ; 161 204a6: 9d e0 ldi r25, 0x0D ; 13 204a8: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 204ac: 0e 94 59 76 call 0xecb2 ; 0xecb2 204b0: 81 11 cpse r24, r1 204b2: 02 c0 rjmp .+4 ; 0x204b8 { eeprom_switch_to_next_sheet(); 204b4: 0e 94 7b 76 call 0xecf6 ; 0xecf6 } check_babystep(); 204b8: 0e 94 97 79 call 0xf32e ; 0xf32e // initialize custom mendel name in eeprom if (eeprom_read_byte((uint8_t*)EEPROM_CUSTOM_MENDEL_NAME) == EEPROM_EMPTY_VALUE) { 204bc: 80 e8 ldi r24, 0x80 ; 128 204be: 9c e0 ldi r25, 0x0C ; 12 204c0: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 204c4: 8f 3f cpi r24, 0xFF ; 255 204c6: 41 f4 brne .+16 ; 0x204d8 #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); 204c8: 4d e0 ldi r20, 0x0D ; 13 204ca: 50 e0 ldi r21, 0x00 ; 0 204cc: 60 e8 ldi r22, 0x80 ; 128 204ce: 7c e0 ldi r23, 0x0C ; 12 204d0: 87 ee ldi r24, 0xE7 ; 231 204d2: 92 e0 ldi r25, 0x02 ; 2 204d4: 0f 94 eb db call 0x3b7d6 ; 0x3b7d6 #ifdef PINDA_TEMP_COMP eeprom_init_default_byte((uint8_t*)EEPROM_PINDA_TEMP_COMPENSATION, 0); #endif //PINDA_TEMP_COMP eeprom_init_default_dword((uint32_t*)EEPROM_JOB_ID, 0); 204d8: 85 e0 ldi r24, 0x05 ; 5 204da: 9d e0 ldi r25, 0x0D ; 13 204dc: 0f 94 18 7a call 0x2f430 ; 0x2f430 eeprom_init_default_dword((uint32_t*)EEPROM_TOTALTIME, 0); 204e0: 8d ee ldi r24, 0xED ; 237 204e2: 9f e0 ldi r25, 0x0F ; 15 204e4: 0f 94 18 7a call 0x2f430 ; 0x2f430 eeprom_init_default_dword((uint32_t*)EEPROM_FILAMENTUSED, 0); 204e8: 81 ef ldi r24, 0xF1 ; 241 204ea: 9f e0 ldi r25, 0x0F ; 15 204ec: 0f 94 18 7a call 0x2f430 ; 0x2f430 eeprom_init_default_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED, 0); 204f0: 60 e0 ldi r22, 0x00 ; 0 204f2: 8e ec ldi r24, 0xCE ; 206 204f4: 9e e0 ldi r25, 0x0E ; 14 204f6: 0e 94 21 76 call 0xec42 ; 0xec42 eeprom_init_default_byte((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT, 1); 204fa: 61 e0 ldi r22, 0x01 ; 1 204fc: 87 ea ldi r24, 0xA7 ; 167 204fe: 9c e0 ldi r25, 0x0C ; 12 20500: 0e 94 21 76 call 0xec42 ; 0xec42 putchar('\n'); list_sec_lang_from_external_flash(); #endif //DEBUG_XFLASH // lang_reset(); if (!lang_select(eeprom_read_byte((uint8_t*)EEPROM_LANG))) 20504: 8e ef ldi r24, 0xFE ; 254 20506: 9f e0 ldi r25, 0x0F ; 15 20508: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 2050c: 0e 94 4c 72 call 0xe498 ; 0xe498 20510: 81 11 cpse r24, r1 20512: 02 c0 rjmp .+4 ; 0x20518 lcd_language(); 20514: 0e 94 2a da call 0x1b454 ; 0x1b454 lang_print_sec_lang(); #endif //DEBUG_SEC_LANG #endif //(LANG_MODE != 0) eeprom_init_default_byte((uint8_t*)EEPROM_TEMP_CAL_ACTIVE, 0); 20518: 60 e0 ldi r22, 0x00 ; 0 2051a: 8f ea ldi r24, 0xAF ; 175 2051c: 9f e0 ldi r25, 0x0F ; 15 2051e: 0e 94 21 76 call 0xec42 ; 0xec42 if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA) == 255) { 20522: 86 ea ldi r24, 0xA6 ; 166 20524: 9f e0 ldi r25, 0x0F ; 15 20526: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 2052a: 8f 3f cpi r24, 0xFF ; 255 2052c: d9 f4 brne .+54 ; 0x20564 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 2052e: 61 e0 ldi r22, 0x01 ; 1 20530: 86 ea ldi r24, 0xA6 ; 166 20532: 9f e0 ldi r25, 0x0F ; 15 20534: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 20538: 20 eb ldi r18, 0xB0 ; 176 2053a: c2 2e mov r12, r18 2053c: 2f e0 ldi r18, 0x0F ; 15 2053e: d2 2e mov r13, r18 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 20540: 70 e0 ldi r23, 0x00 ; 0 20542: 60 e0 ldi r22, 0x00 ; 0 20544: c6 01 movw r24, r12 20546: 0f 94 19 dc call 0x3b832 ; 0x3b832 2054a: b2 e0 ldi r27, 0x02 ; 2 2054c: cb 0e add r12, r27 2054e: d1 1c adc r13, 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++) { 20550: ea eb ldi r30, 0xBA ; 186 20552: ce 16 cp r12, r30 20554: ef e0 ldi r30, 0x0F ; 15 20556: de 06 cpc r13, r30 20558: 99 f7 brne .-26 ; 0x20540 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 2055a: 60 e0 ldi r22, 0x00 ; 0 2055c: 8f ea ldi r24, 0xAF ; 175 2055e: 9f e0 ldi r25, 0x0F ; 15 20560: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 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); 20564: 60 e0 ldi r22, 0x00 ; 0 20566: 85 ea ldi r24, 0xA5 ; 165 20568: 9f e0 ldi r25, 0x0F ; 15 2056a: 0e 94 21 76 call 0xec42 ; 0xec42 eeprom_init_default_byte((uint8_t*)EEPROM_UVLO_Z_LIFTED, 0); 2056e: 60 e0 ldi r22, 0x00 ; 0 20570: 8f e7 ldi r24, 0x7F ; 127 20572: 9c e0 ldi r25, 0x0C ; 12 20574: 0e 94 21 76 call 0xec42 ; 0xec42 eeprom_init_default_byte((uint8_t*)EEPROM_SD_SORT, 0); 20578: 60 e0 ldi r22, 0x00 ; 0 2057a: 89 e0 ldi r24, 0x09 ; 9 2057c: 9f e0 ldi r25, 0x0F ; 15 2057e: 0e 94 21 76 call 0xec42 ; 0xec42 } 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); 20582: 61 e0 ldi r22, 0x01 ; 1 20584: 8c ea ldi r24, 0xAC ; 172 20586: 9d e0 ldi r25, 0x0D ; 13 20588: 0e 94 21 76 call 0xec42 ; 0xec42 eeprom_init_default_byte((uint8_t*)EEPROM_MBL_POINTS_NR, 3); 2058c: 63 e0 ldi r22, 0x03 ; 3 2058e: 8b ea ldi r24, 0xAB ; 171 20590: 9d e0 ldi r25, 0x0D ; 13 20592: 0e 94 21 76 call 0xec42 ; 0xec42 eeprom_init_default_byte((uint8_t*)EEPROM_MBL_PROBE_NR, 3); 20596: 63 e0 ldi r22, 0x03 ; 3 20598: 8a ea ldi r24, 0xAA ; 170 2059a: 9d e0 ldi r25, 0x0D ; 13 2059c: 0e 94 21 76 call 0xec42 ; 0xec42 //mbl_mode_init(); mbl_settings_init(); eeprom_init_default_byte((uint8_t*)EEPROM_MMU_STEALTH, 1); 205a0: 61 e0 ldi r22, 0x01 ; 1 205a2: 89 ea ldi r24, 0xA9 ; 169 205a4: 9d e0 ldi r25, 0x0D ; 13 205a6: 0e 94 21 76 call 0xec42 ; 0xec42 #endif //(defined(TACH_0) && TACH_0 >-1) || (defined(TACH_1) && TACH_1 > -1) #if (defined(FANCHECK) && defined(TACH_1) && (TACH_1 >-1)) void setup_fan_interrupt() { //INT7 DDRE &= ~(1 << 7); //input pin 205aa: 6f 98 cbi 0x0d, 7 ; 13 PORTE &= ~(1 << 7); //no internal pull-up 205ac: 77 98 cbi 0x0e, 7 ; 14 //start with sensing rising edge EICRB &= ~(1 << 6); 205ae: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> 205b2: 8f 7b andi r24, 0xBF ; 191 205b4: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> EICRB |= (1 << 7); 205b8: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> 205bc: 80 68 ori r24, 0x80 ; 128 205be: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> //enable INT7 interrupt EIMSK |= (1 << 7); 205c2: ef 9a sbi 0x1d, 7 ; 29 #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); 205c4: 84 e0 ldi r24, 0x04 ; 4 205c6: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be return false; } #ifdef FSENSOR_PROBING bool PAT9125_sensor::probeOtherType() { SET_INPUT(IR_SENSOR_PIN); // input mode 205ca: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 205ce: 8e 7f andi r24, 0xFE ; 254 205d0: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> WRITE(IR_SENSOR_PIN, 1); // pullup 205d4: 9f b7 in r25, 0x3f ; 63 205d6: f8 94 cli 205d8: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 205dc: 81 60 ori r24, 0x01 ; 1 205de: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 205e2: 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); 205e4: 8f e8 ldi r24, 0x8F ; 143 205e6: 91 e0 ldi r25, 0x01 ; 1 205e8: 01 97 sbiw r24, 0x01 ; 1 205ea: f1 f7 brne .-4 ; 0x205e8 205ec: 00 c0 rjmp .+0 ; 0x205ee 205ee: 00 00 nop _delay_us(100); // wait for the pullup to pull the line high (might be needed, not really sure. The internal pullups are quite weak and there might be a // long wire attached). bool fsensorDetected = !READ(IR_SENSOR_PIN); 205f0: 90 91 06 01 lds r25, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> WRITE(IR_SENSOR_PIN, 0); // no pullup 205f4: 2f b7 in r18, 0x3f ; 63 205f6: f8 94 cli 205f8: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 205fc: 8e 7f andi r24, 0xFE ; 254 205fe: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 20602: 2f bf out 0x3f, r18 ; 63 } #if defined(FILAMENT_SENSOR) && defined(FSENSOR_PROBING) //! @brief try to check if firmware is on right type of printer static void check_if_fw_is_on_right_printer() { if (fsensor.probeOtherType()) { 20604: 90 fd sbrc r25, 0 20606: 06 c0 rjmp .+12 ; 0x20614 lcd_show_fullscreen_message_and_wait_P(_T(MSG_FW_MK3_DETECTED)); 20608: 86 e7 ldi r24, 0x76 ; 118 2060a: 9b e4 ldi r25, 0x4B ; 75 2060c: 0e 94 c4 72 call 0xe588 ; 0xe588 20610: 0f 94 c7 1f call 0x23f8e ; 0x23f8e #if defined(FILAMENT_SENSOR) && defined(FSENSOR_PROBING) check_if_fw_is_on_right_printer(); #endif //defined(FILAMENT_SENSOR) && defined(FSENSOR_PROBING) } switch (hw_changed) { 20614: 02 30 cpi r16, 0x02 ; 2 20616: 81 f0 breq .+32 ; 0x20638 20618: 03 30 cpi r16, 0x03 ; 3 2061a: 09 f4 brne .+2 ; 0x2061e 2061c: 37 c1 rjmp .+622 ; 0x2088c 2061e: 01 30 cpi r16, 0x01 ; 1 20620: b9 f4 brne .+46 ; 0x20650 //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)); 20622: 88 ea ldi r24, 0xA8 ; 168 20624: 9d e4 ldi r25, 0x4D ; 77 20626: 0e 94 c4 72 call 0xe588 ; 0xe588 2062a: 0f 94 c7 1f call 0x23f8e ; 0x23f8e 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); 2062e: 66 e3 ldi r22, 0x36 ; 54 20630: 71 e0 ldi r23, 0x01 ; 1 20632: 8c ee ldi r24, 0xEC ; 236 20634: 9e e0 ldi r25, 0x0E ; 14 20636: 0a c0 rjmp .+20 ; 0x2064c eeprom_write_word_notify((uint16_t*)EEPROM_BOARD_TYPE, MOTHERBOARD); break; case(0b10): lcd_show_fullscreen_message_and_wait_P(_T(MSG_CHANGED_PRINTER)); 20638: 87 e8 ldi r24, 0x87 ; 135 2063a: 9d e4 ldi r25, 0x4D ; 77 2063c: 0e 94 c4 72 call 0xe588 ; 0xe588 20640: 0f 94 c7 1f call 0x23f8e ; 0x23f8e 20644: 6c e2 ldi r22, 0x2C ; 44 20646: 71 e0 ldi r23, 0x01 ; 1 20648: 8e ee ldi r24, 0xEE ; 238 2064a: 9e e0 ldi r25, 0x0E ; 14 2064c: 0f 94 35 dc call 0x3b86a ; 0x3b86a eeprom_write_word_notify((uint16_t*)EEPROM_BOARD_TYPE, MOTHERBOARD); break; default: break; //no change, show no message } if (!previous_settings_retrieved) { 20650: f1 10 cpse r15, r1 20652: 08 c0 rjmp .+16 ; 0x20664 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 20654: 80 e1 ldi r24, 0x10 ; 16 20656: 9d e4 ldi r25, 0x4D ; 77 20658: 0e 94 c4 72 call 0xe588 ; 0xe588 2065c: 0f 94 c7 1f call 0x23f8e ; 0x23f8e Config_StoreSettings(); 20660: 0e 94 bc 82 call 0x10578 ; 0x10578 } // handle FW and calibration status upgrade bool run_wizard = false; if (calibration_status_get(CALIBRATION_STATUS_UNKNOWN)) { 20664: 80 e8 ldi r24, 0x80 ; 128 20666: 0e 94 7a ee call 0x1dcf4 ; 0x1dcf4 2066a: 88 23 and r24, r24 2066c: c9 f0 breq .+50 ; 0x206a0 CalibrationStatus calibration_status = 0; if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V1) == 1) { 2066e: 87 ef ldi r24, 0xF7 ; 247 20670: 9f e0 ldi r25, 0x0F ; 15 20672: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae } // handle FW and calibration status upgrade bool run_wizard = false; if (calibration_status_get(CALIBRATION_STATUS_UNKNOWN)) { CalibrationStatus calibration_status = 0; 20676: 60 e0 ldi r22, 0x00 ; 0 if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V1) == 1) { 20678: 81 30 cpi r24, 0x01 ; 1 2067a: 71 f4 brne .+28 ; 0x20698 // 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)) { 2067c: 87 e5 ldi r24, 0x57 ; 87 2067e: 9e e8 ldi r25, 0x8E ; 142 20680: 0e 94 53 d0 call 0x1a0a6 ; 0x1a0a6 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); 20684: 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)) { 20686: 88 23 and r24, r24 20688: 39 f0 breq .+14 ; 0x20698 // printer upgraded from FW<3.2.0.4 and requires re-running selftest lcd_show_fullscreen_message_and_wait_P(_T(MSG_FORCE_SELFTEST)); 2068a: 8e ec ldi r24, 0xCE ; 206 2068c: 9c e4 ldi r25, 0x4C ; 76 2068e: 0e 94 c4 72 call 0xe588 ; 0xe588 20692: 0f 94 c7 1f call 0x23f8e ; 0x23f8e calibration_status &= ~CALIBRATION_STATUS_SELFTEST; 20696: 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); 20698: 86 ea ldi r24, 0xA6 ; 166 2069a: 9c e0 ldi r25, 0x0C ; 12 2069c: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 } } eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, calibration_status); } if (eeprom_fw_version_older_than_p(FW_VERSION_NR)) { 206a0: 8f e4 ldi r24, 0x4F ; 79 206a2: 9e e8 ldi r25, 0x8E ; 142 206a4: 0e 94 53 d0 call 0x1a0a6 ; 0x1a0a6 206a8: f8 2e mov r15, r24 206aa: 88 23 and r24, r24 206ac: 31 f0 breq .+12 ; 0x206ba if (!calibration_status_get(CALIBRATION_WIZARD_STEPS)) { 206ae: 8f e1 ldi r24, 0x1F ; 31 206b0: 0e 94 7a ee call 0x1dcf4 ; 0x1dcf4 206b4: 91 e0 ldi r25, 0x01 ; 1 206b6: f8 2e mov r15, r24 206b8: f9 26 eor r15, r25 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; 206ba: 10 e0 ldi r17, 0x00 ; 0 206bc: 00 e0 ldi r16, 0x00 ; 0 } 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)); 206be: f8 01 movw r30, r16 206c0: e0 5c subi r30, 0xC0 ; 192 206c2: f1 47 sbci r31, 0x71 ; 113 206c4: 64 91 lpm r22, Z 206c6: c8 01 movw r24, r16 206c8: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 206cc: 0f 5f subi r16, 0xFF ; 255 206ce: 1f 4f sbci r17, 0xFF ; 255 return true; } void update_current_firmware_version_to_eeprom() { for (int8_t i = 0; i < FW_PRUSA3D_MAGIC_LEN; ++ i){ 206d0: 0a 30 cpi r16, 0x0A ; 10 206d2: 11 05 cpc r17, r1 206d4: a1 f7 brne .-24 ; 0x206be 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])); 206d6: ef e4 ldi r30, 0x4F ; 79 206d8: fe e8 ldi r31, 0x8E ; 142 206da: 65 91 lpm r22, Z+ 206dc: 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); 206de: 8a e0 ldi r24, 0x0A ; 10 206e0: 90 e0 ldi r25, 0x00 ; 0 206e2: 0f 94 19 dc call 0x3b832 ; 0x3b832 eeprom_update_word_notify((uint16_t*)EEPROM_FIRMWARE_VERSION_MINOR, (uint16_t)pgm_read_word(&FW_VERSION_NR[1])); 206e6: e1 e5 ldi r30, 0x51 ; 81 206e8: fe e8 ldi r31, 0x8E ; 142 206ea: 65 91 lpm r22, Z+ 206ec: 74 91 lpm r23, Z 206ee: 8c e0 ldi r24, 0x0C ; 12 206f0: 90 e0 ldi r25, 0x00 ; 0 206f2: 0f 94 19 dc call 0x3b832 ; 0x3b832 eeprom_update_word_notify((uint16_t*)EEPROM_FIRMWARE_VERSION_REVISION, (uint16_t)pgm_read_word(&FW_VERSION_NR[2])); 206f6: e3 e5 ldi r30, 0x53 ; 83 206f8: fe e8 ldi r31, 0x8E ; 142 206fa: 65 91 lpm r22, Z+ 206fc: 74 91 lpm r23, Z 206fe: 8e e0 ldi r24, 0x0E ; 14 20700: 90 e0 ldi r25, 0x00 ; 0 20702: 0f 94 19 dc call 0x3b832 ; 0x3b832 // 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])); 20706: e5 e5 ldi r30, 0x55 ; 85 20708: fe e8 ldi r31, 0x8E ; 142 2070a: 65 91 lpm r22, Z+ 2070c: 74 91 lpm r23, Z 2070e: 80 e1 ldi r24, 0x10 ; 16 20710: 90 e0 ldi r25, 0x00 ; 0 20712: 0f 94 19 dc call 0x3b832 ; 0x3b832 run_wizard = true; } } update_current_firmware_version_to_eeprom(); if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) { 20716: 8f e5 ldi r24, 0x5F ; 95 20718: 9f e0 ldi r25, 0x0F ; 15 2071a: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 2071e: 88 23 and r24, r24 20720: 09 f4 brne .+2 ; 0x20724 20722: c1 c0 rjmp .+386 ; 0x208a6 // first time run of wizard or service prep lcd_wizard(WizState::Run); 20724: 80 e0 ldi r24, 0x00 ; 0 } else if (run_wizard) { // some wizard steps required by the upgrade checks lcd_wizard(WizState::Restore); 20726: 0e 94 d6 f8 call 0x1f1ac ; 0x1f1ac lcd_show_fullscreen_message_and_wait_P(_T(MSG_TM_NOT_CAL)); #endif //THERMAL_MODEL } } KEEPALIVE_STATE(IN_PROCESS); 2072a: 83 e0 ldi r24, 0x03 ; 3 2072c: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be #endif //DEBUG_DISABLE_STARTMSGS lcd_update_enable(true); 20730: 81 e0 ldi r24, 0x01 ; 1 20732: 0e 94 3d 6f call 0xde7a ; 0xde7a lcd_clear(); 20736: 0e 94 2b 6f call 0xde56 ; 0xde56 lcd_update(2); 2073a: 82 e0 ldi r24, 0x02 ; 2 2073c: 0e 94 bf 6e call 0xdd7e ; 0xdd7e #ifdef TMC2130 tmc2130_home_origin[X_AXIS] = eeprom_init_default_byte((uint8_t*)EEPROM_TMC2130_HOME_X_ORIGIN, 0); 20740: 60 e0 ldi r22, 0x00 ; 0 20742: 8e ef ldi r24, 0xFE ; 254 20744: 9e e0 ldi r25, 0x0E ; 14 20746: 0e 94 21 76 call 0xec42 ; 0xec42 2074a: 80 93 f2 04 sts 0x04F2, r24 ; 0x8004f2 tmc2130_home_bsteps[X_AXIS] = eeprom_init_default_byte((uint8_t*)EEPROM_TMC2130_HOME_X_BSTEPS, 48); 2074e: 60 e3 ldi r22, 0x30 ; 48 20750: 8d ef ldi r24, 0xFD ; 253 20752: 9e e0 ldi r25, 0x0E ; 14 20754: 0e 94 21 76 call 0xec42 ; 0xec42 20758: 80 93 5a 02 sts 0x025A, r24 ; 0x80025a tmc2130_home_fsteps[X_AXIS] = eeprom_init_default_byte((uint8_t*)EEPROM_TMC2130_HOME_X_FSTEPS, 48); 2075c: 60 e3 ldi r22, 0x30 ; 48 2075e: 8c ef ldi r24, 0xFC ; 252 20760: 9e e0 ldi r25, 0x0E ; 14 20762: 0e 94 21 76 call 0xec42 ; 0xec42 20766: 80 93 58 02 sts 0x0258, r24 ; 0x800258 tmc2130_home_origin[Y_AXIS] = eeprom_init_default_byte((uint8_t*)EEPROM_TMC2130_HOME_Y_ORIGIN, 0); 2076a: 60 e0 ldi r22, 0x00 ; 0 2076c: 8b ef ldi r24, 0xFB ; 251 2076e: 9e e0 ldi r25, 0x0E ; 14 20770: 0e 94 21 76 call 0xec42 ; 0xec42 20774: 80 93 f3 04 sts 0x04F3, r24 ; 0x8004f3 tmc2130_home_bsteps[Y_AXIS] = eeprom_init_default_byte((uint8_t*)EEPROM_TMC2130_HOME_Y_BSTEPS, 48); 20778: 60 e3 ldi r22, 0x30 ; 48 2077a: 8a ef ldi r24, 0xFA ; 250 2077c: 9e e0 ldi r25, 0x0E ; 14 2077e: 0e 94 21 76 call 0xec42 ; 0xec42 20782: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b tmc2130_home_fsteps[Y_AXIS] = eeprom_init_default_byte((uint8_t*)EEPROM_TMC2130_HOME_Y_FSTEPS, 48); 20786: 60 e3 ldi r22, 0x30 ; 48 20788: 89 ef ldi r24, 0xF9 ; 249 2078a: 9e e0 ldi r25, 0x0E ; 14 2078c: 0e 94 21 76 call 0xec42 ; 0xec42 20790: 80 93 59 02 sts 0x0259, r24 ; 0x800259 tmc2130_home_enabled = eeprom_init_default_byte((uint8_t*)EEPROM_TMC2130_HOME_ENABLED, 0); 20794: 60 e0 ldi r22, 0x00 ; 0 20796: 88 ef ldi r24, 0xF8 ; 248 20798: 9e e0 ldi r25, 0x0E ; 14 2079a: 0e 94 21 76 call 0xec42 ; 0xec42 2079e: 80 93 f1 04 sts 0x04F1, r24 ; 0x8004f1 static void fw_crash_init() { #ifdef XFLASH_DUMP dump_crash_reason crash_reason; if(xfdump_check_state(&crash_reason)) 207a2: ce 01 movw r24, r28 207a4: 01 96 adiw r24, 0x01 ; 1 207a6: 0e 94 e3 ec call 0x1d9c6 ; 0x1d9c6 207aa: 88 23 and r24, r24 207ac: 89 f0 breq .+34 ; 0x207d0 { // always signal to the host that a dump is available for retrieval puts_P(_N("//action:dump_available")); 207ae: 80 e0 ldi r24, 0x00 ; 0 207b0: 9d e6 ldi r25, 0x6D ; 109 207b2: 0f 94 c0 da call 0x3b580 ; 0x3b580 #ifdef EMERGENCY_DUMP if(crash_reason != dump_crash_reason::manual && 207b6: 89 81 ldd r24, Y+1 ; 0x01 207b8: 88 23 and r24, r24 207ba: 51 f0 breq .+20 ; 0x207d0 eeprom_read_byte((uint8_t*)EEPROM_FW_CRASH_FLAG) != 0xFF) 207bc: 83 e0 ldi r24, 0x03 ; 3 207be: 9d e0 ldi r25, 0x0D ; 13 207c0: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae { // always signal to the host that a dump is available for retrieval puts_P(_N("//action:dump_available")); #ifdef EMERGENCY_DUMP if(crash_reason != dump_crash_reason::manual && 207c4: 8f 3f cpi r24, 0xFF ; 255 207c6: 21 f0 breq .+8 ; 0x207d0 eeprom_read_byte((uint8_t*)EEPROM_FW_CRASH_FLAG) != 0xFF) { lcd_show_fullscreen_message_and_wait_P( 207c8: 8c e8 ldi r24, 0x8C ; 140 207ca: 9c e6 ldi r25, 0x6C ; 108 207cc: 0f 94 c7 1f call 0x23f8e ; 0x23f8e if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 207d0: 6f ef ldi r22, 0xFF ; 255 207d2: 83 e0 ldi r24, 0x03 ; 3 207d4: 9d e0 ldi r25, 0x0D ; 13 207d6: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 // report crash failures fw_crash_init(); #ifdef UVLO_SUPPORT if (printer_recovering()) { //previous print was terminated by UVLO 207da: 0e 94 93 67 call 0xcf26 ; 0xcf26 207de: 88 23 and r24, r24 207e0: d9 f1 breq .+118 ; 0x20858 manage_heater(); // Update temperatures 207e2: 0f 94 2e 38 call 0x2705c ; 0x2705c //Restore printing type saved_printing_type = eeprom_read_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE); 207e6: 8c e8 ldi r24, 0x8C ; 140 207e8: 9f e0 ldi r25, 0x0F ; 15 207ea: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 207ee: 08 2f mov r16, r24 207f0: 80 93 6a 02 sts 0x026A, r24 ; 0x80026a return current_temperature_bed_raw; }; #endif FORCE_INLINE float degBed() { return current_temperature_bed; 207f4: 80 90 ed 04 lds r8, 0x04ED ; 0x8004ed 207f8: 90 90 ee 04 lds r9, 0x04EE ; 0x8004ee 207fc: a0 90 ef 04 lds r10, 0x04EF ; 0x8004ef 20800: b0 90 f0 04 lds r11, 0x04F0 ; 0x8004f0 #ifdef DEBUG_UVLO_AUTOMATIC_RECOVER printf_P(_N("Power panic detected!\nCurrent bed temp:%d\nSaved bed temp:%d\n"), (int)degBed(), eeprom_read_byte((uint8_t*)EEPROM_UVLO_TARGET_BED)); #endif //DEBUG_UVLO_AUTOMATIC_RECOVER uvlo_auto_recovery_ready = (degBed() > ( (float)eeprom_read_byte((uint8_t*)EEPROM_UVLO_TARGET_BED) - AUTOMATIC_UVLO_BED_TEMP_OFFSET)); 20804: 8b e8 ldi r24, 0x8B ; 139 20806: 9f e0 ldi r25, 0x0F ; 15 20808: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 2080c: 68 2f mov r22, r24 2080e: 70 e0 ldi r23, 0x00 ; 0 20810: 90 e0 ldi r25, 0x00 ; 0 20812: 80 e0 ldi r24, 0x00 ; 0 20814: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 20818: 20 e0 ldi r18, 0x00 ; 0 2081a: 30 e0 ldi r19, 0x00 ; 0 2081c: 40 ea ldi r20, 0xA0 ; 160 2081e: 50 e4 ldi r21, 0x40 ; 64 20820: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 20824: 6b 01 movw r12, r22 20826: 7c 01 movw r14, r24 20828: 11 e0 ldi r17, 0x01 ; 1 2082a: ac 01 movw r20, r24 2082c: 9b 01 movw r18, r22 2082e: c5 01 movw r24, r10 20830: b4 01 movw r22, r8 20832: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 20836: 18 16 cp r1, r24 20838: 0c f0 brlt .+2 ; 0x2083c 2083a: 10 e0 ldi r17, 0x00 ; 0 2083c: 10 93 ec 04 sts 0x04EC, r17 ; 0x8004ec <_ZL24uvlo_auto_recovery_ready.lto_priv.531> if (uvlo_auto_recovery_ready){ 20840: a7 01 movw r20, r14 20842: 96 01 movw r18, r12 20844: c5 01 movw r24, r10 20846: b4 01 movw r22, r8 20848: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 2084c: 18 16 cp r1, r24 2084e: 0c f0 brlt .+2 ; 0x20852 20850: 58 c0 rjmp .+176 ; 0x20902 #ifdef DEBUG_UVLO_AUTOMATIC_RECOVER puts_P(_N("Automatic recovery!")); #endif //DEBUG_UVLO_AUTOMATIC_RECOVER recover_print(1); 20852: 81 e0 ldi r24, 0x01 ; 1 } else { #ifdef DEBUG_UVLO_AUTOMATIC_RECOVER puts_P(_N("Normal recovery!")); #endif //DEBUG_UVLO_AUTOMATIC_RECOVER if (saved_printing_type == PowerPanic::PRINT_TYPE_HOST) { recover_print(0); 20854: 0f 94 bb 5b call 0x2b776 ; 0x2b776 printf_P(_N("UVLO_TINY - end %d\n"), _millis() - time_start); uvlo_drain_reset(); } void setup_uvlo_interrupt() { DDRE &= ~(1 << 4); //input pin 20858: 6c 98 cbi 0x0d, 4 ; 13 PORTE &= ~(1 << 4); //no internal pull-up 2085a: 74 98 cbi 0x0e, 4 ; 14 // sensing falling edge EICRB |= (1 << 0); 2085c: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> 20860: 81 60 ori r24, 0x01 ; 1 20862: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> EICRB &= ~(1 << 1); 20866: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> 2086a: 8d 7f andi r24, 0xFD ; 253 2086c: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> // enable INT4 interrupt EIMSK |= (1 << 4); 20870: ec 9a sbi 0x1d, 4 ; 29 // check if power was lost before we armed the interrupt if(!(PINE & (1 << 4)) && printer_recovering()) 20872: 64 99 sbic 0x0c, 4 ; 12 20874: 57 c0 rjmp .+174 ; 0x20924 20876: 0e 94 93 67 call 0xcf26 ; 0xcf26 2087a: 88 23 and r24, r24 2087c: 09 f4 brne .+2 ; 0x20880 2087e: 52 c0 rjmp .+164 ; 0x20924 { SERIAL_ECHOLNRPGM(MSG_INT4); 20880: 8a e4 ldi r24, 0x4A ; 74 20882: 9e e8 ldi r25, 0x8E ; 142 20884: 0e 94 93 79 call 0xf326 ; 0xf326 uvlo_drain_reset(); 20888: 0f 94 d7 5e call 0x2bdae ; 0x2bdae 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)); 2088c: 8c e4 ldi r24, 0x4C ; 76 2088e: 9d e4 ldi r25, 0x4D ; 77 20890: 0e 94 c4 72 call 0xe588 ; 0xe588 20894: 0f 94 c7 1f call 0x23f8e ; 0x23f8e 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); 20898: 6c e2 ldi r22, 0x2C ; 44 2089a: 71 e0 ldi r23, 0x01 ; 1 2089c: 8e ee ldi r24, 0xEE ; 238 2089e: 9e e0 ldi r25, 0x0E ; 14 208a0: 0f 94 35 dc call 0x3b86a ; 0x3b86a 208a4: c4 ce rjmp .-632 ; 0x2062e // 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); 208a6: 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) { 208a8: f1 10 cpse r15, r1 208aa: 3d cf rjmp .-390 ; 0x20726 // some wizard steps required by the upgrade checks lcd_wizard(WizState::Restore); } else { if (!calibration_status_get(CALIBRATION_STATUS_SELFTEST)) { 208ac: 0e 94 7a ee call 0x1dcf4 ; 0x1dcf4 208b0: 81 11 cpse r24, r1 208b2: 07 c0 rjmp .+14 ; 0x208c2 // aborted or missing wizard: show a single warning lcd_show_fullscreen_message_and_wait_P(_T(MSG_FOLLOW_CALIBRATION_FLOW)); 208b4: 8e e5 ldi r24, 0x5E ; 94 208b6: 9c e4 ldi r25, 0x4C ; 76 // 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)); #ifdef THERMAL_MODEL if (!calibration_status_get(CALIBRATION_STATUS_THERMAL_MODEL) && thermal_model_enabled()) lcd_show_fullscreen_message_and_wait_P(_T(MSG_TM_NOT_CAL)); 208b8: 0e 94 c4 72 call 0xe588 ; 0xe588 208bc: 0f 94 c7 1f call 0x23f8e ; 0x23f8e 208c0: 34 cf rjmp .-408 ; 0x2072a 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)) { 208c2: 84 e0 ldi r24, 0x04 ; 4 208c4: 0e 94 7a ee call 0x1dcf4 ; 0x1dcf4 208c8: 81 11 cpse r24, r1 208ca: 03 c0 rjmp .+6 ; 0x208d2 // wizard reset after service prep lcd_show_fullscreen_message_and_wait_P(_T(MSG_FOLLOW_Z_CALIBRATION_FLOW)); 208cc: 86 ee ldi r24, 0xE6 ; 230 208ce: 9b e4 ldi r25, 0x4B ; 75 208d0: f3 cf rjmp .-26 ; 0x208b8 } else { // warn about other important steps individually if (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) 208d2: 80 e1 ldi r24, 0x10 ; 16 208d4: 0e 94 7a ee call 0x1dcf4 ; 0x1dcf4 208d8: 81 11 cpse r24, r1 208da: 06 c0 rjmp .+12 ; 0x208e8 lcd_show_fullscreen_message_and_wait_P(_T(MSG_BABYSTEP_Z_NOT_SET)); 208dc: 8e e7 ldi r24, 0x7E ; 126 208de: 9a e5 ldi r25, 0x5A ; 90 208e0: 0e 94 c4 72 call 0xe588 ; 0xe588 208e4: 0f 94 c7 1f call 0x23f8e ; 0x23f8e #ifdef THERMAL_MODEL if (!calibration_status_get(CALIBRATION_STATUS_THERMAL_MODEL) && thermal_model_enabled()) 208e8: 88 e0 ldi r24, 0x08 ; 8 208ea: 0e 94 7a ee call 0x1dcf4 ; 0x1dcf4 208ee: 81 11 cpse r24, r1 208f0: 1c cf rjmp .-456 ; 0x2072a 208f2: 80 91 1c 05 lds r24, 0x051C ; 0x80051c <_ZN13thermal_modelL7enabledE.lto_priv.456> 208f6: 88 23 and r24, r24 208f8: 09 f4 brne .+2 ; 0x208fc 208fa: 17 cf rjmp .-466 ; 0x2072a lcd_show_fullscreen_message_and_wait_P(_T(MSG_TM_NOT_CAL)); 208fc: 82 ec ldi r24, 0xC2 ; 194 208fe: 9b e4 ldi r25, 0x4B ; 75 20900: db cf rjmp .-74 ; 0x208b8 recover_print(1); } else { #ifdef DEBUG_UVLO_AUTOMATIC_RECOVER puts_P(_N("Normal recovery!")); #endif //DEBUG_UVLO_AUTOMATIC_RECOVER if (saved_printing_type == PowerPanic::PRINT_TYPE_HOST) { 20902: 01 30 cpi r16, 0x01 ; 1 20904: 11 f4 brne .+4 ; 0x2090a recover_print(0); 20906: 80 e0 ldi r24, 0x00 ; 0 20908: a5 cf rjmp .-182 ; 0x20854 } else { const uint8_t btn = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_RECOVER_PRINT), false); 2090a: 8e e9 ldi r24, 0x9E ; 158 2090c: 9b e4 ldi r25, 0x4B ; 75 2090e: 0e 94 c4 72 call 0xe588 ; 0xe588 20912: 41 e0 ldi r20, 0x01 ; 1 20914: 60 e0 ldi r22, 0x00 ; 0 20916: 0f 94 fb 4e call 0x29df6 ; 0x29df6 if ( btn == LCD_LEFT_BUTTON_CHOICE) { 2091a: 88 23 and r24, r24 2091c: a1 f3 breq .-24 ; 0x20906 recover_print(0); } else { // LCD_MIDDLE_BUTTON_CHOICE cancel_saved_printing(); 2091e: 0e 94 c5 64 call 0xc98a ; 0xc98a 20922: 9a cf rjmp .-204 ; 0x20858 ClCheckMode oCheckVersion; ClCheckMode oCheckGcode; ClCheckMode oCheckFilament; void fCheckModeInit() { oCheckMode = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_MODE, (uint8_t)ClCheckMode::_Warn); 20924: 61 e0 ldi r22, 0x01 ; 1 20926: 88 ea ldi r24, 0xA8 ; 168 20928: 9d e0 ldi r25, 0x0D ; 13 2092a: 0e 94 21 76 call 0xec42 ; 0xec42 2092e: 80 93 eb 04 sts 0x04EB, r24 ; 0x8004eb if (farm_mode) { oCheckMode = ClCheckMode::_Strict; 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); 20932: 68 e2 ldi r22, 0x28 ; 40 20934: 87 ea ldi r24, 0xA7 ; 167 20936: 9d e0 ldi r25, 0x0D ; 13 20938: 0e 94 21 76 call 0xec42 ; 0xec42 2093c: 80 93 ea 04 sts 0x04EA, r24 ; 0x8004ea eeprom_init_default_word((uint16_t *)EEPROM_NOZZLE_DIAMETER_uM, EEPROM_NOZZLE_DIAMETER_uM_DEFAULT); 20940: 60 e9 ldi r22, 0x90 ; 144 20942: 71 e0 ldi r23, 0x01 ; 1 20944: 85 ea ldi r24, 0xA5 ; 165 20946: 9d e0 ldi r25, 0x0D ; 13 20948: 0e 94 09 76 call 0xec12 ; 0xec12 oCheckModel = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_MODEL, (uint8_t)ClCheckMode::_Warn); 2094c: 61 e0 ldi r22, 0x01 ; 1 2094e: 84 ea ldi r24, 0xA4 ; 164 20950: 9d e0 ldi r25, 0x0D ; 13 20952: 0e 94 21 76 call 0xec42 ; 0xec42 20956: 80 93 e9 04 sts 0x04E9, r24 ; 0x8004e9 oCheckVersion = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_VERSION, (uint8_t)ClCheckMode::_Warn); 2095a: 61 e0 ldi r22, 0x01 ; 1 2095c: 83 ea ldi r24, 0xA3 ; 163 2095e: 9d e0 ldi r25, 0x0D ; 13 20960: 0e 94 21 76 call 0xec42 ; 0xec42 20964: 80 93 e8 04 sts 0x04E8, r24 ; 0x8004e8 oCheckGcode = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_GCODE, (uint8_t)ClCheckMode::_Warn); 20968: 61 e0 ldi r22, 0x01 ; 1 2096a: 82 ea ldi r24, 0xA2 ; 162 2096c: 9d e0 ldi r25, 0x0D ; 13 2096e: 0e 94 21 76 call 0xec42 ; 0xec42 20972: 80 93 e7 04 sts 0x04E7, r24 ; 0x8004e7 oCheckFilament = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_FILAMENT, (uint8_t)ClCheckMode::_Warn); 20976: 61 e0 ldi r22, 0x01 ; 1 20978: 80 e2 ldi r24, 0x20 ; 32 2097a: 9c e0 ldi r25, 0x0C ; 12 2097c: 0e 94 21 76 call 0xec42 ; 0xec42 20980: 80 93 e6 04 sts 0x04E6, r24 ; 0x8004e6 // the entire state machine initialized. setup_uvlo_interrupt(); #endif //UVLO_SUPPORT fCheckModeInit(); KEEPALIVE_STATE(NOT_BUSY); 20984: 81 e0 ldi r24, 0x01 ; 1 20986: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be : "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" ); 2098a: 88 e1 ldi r24, 0x18 ; 24 2098c: 98 e2 ldi r25, 0x28 ; 40 2098e: 0f b6 in r0, 0x3f ; 63 20990: f8 94 cli 20992: a8 95 wdr 20994: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 20998: 0f be out 0x3f, r0 ; 63 2099a: 90 93 60 00 sts 0x0060, r25 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> #ifdef WATCHDOG wdt_enable(WDTO_4S); #ifdef EMERGENCY_HANDLERS WDTCSR |= (1 << WDIE); 2099e: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 209a2: 80 64 ori r24, 0x40 ; 64 209a4: 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; 209a8: 85 e0 ldi r24, 0x05 ; 5 209aa: d8 2e mov r13, r24 setup(); for (;;) { loop(); if (serialEventRun) serialEventRun(); 209ac: 00 e0 ldi r16, 0x00 ; 0 209ae: 10 e0 ldi r17, 0x00 ; 0 // 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); 209b0: cc 24 eor r12, r12 209b2: 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); 209b4: 94 e0 ldi r25, 0x04 ; 4 209b6: b9 2e mov r11, r25 // 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; 209b8: 10 92 ab 0d sts 0x0DAB, r1 ; 0x800dab if(Stopped) { 209bc: 80 91 10 05 lds r24, 0x0510 ; 0x800510 209c0: 88 23 and r24, r24 209c2: 09 f4 brne .+2 ; 0x209c6 209c4: c4 c0 rjmp .+392 ; 0x20b4e // 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); 209c6: b0 92 be 02 sts 0x02BE, r11 ; 0x8002be } 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. 209ca: 0e 94 9d 67 call 0xcf3a ; 0xcf3a 209ce: 88 23 and r24, r24 209d0: 09 f4 brne .+2 ; 0x209d4 209d2: c0 c0 rjmp .+384 ; 0x20b54 209d4: 80 91 6a 02 lds r24, 0x026A ; 0x80026a 209d8: 81 30 cpi r24, 0x01 ; 1 209da: 09 f0 breq .+2 ; 0x209de 209dc: bb c0 rjmp .+374 ; 0x20b54 usb_timer.start(); 209de: 8d e0 ldi r24, 0x0D ; 13 209e0: 95 e0 ldi r25, 0x05 ; 5 209e2: 0f 94 83 29 call 0x25306 ; 0x25306 ::start()> } else #endif { get_command(); 209e6: 0e 94 38 83 call 0x10670 ; 0x10670 // 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) 209ea: 80 91 69 02 lds r24, 0x0269 ; 0x800269 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.551> 209ee: 88 23 and r24, r24 209f0: 89 f0 breq .+34 ; 0x20a14 return; if(autostart_atmillis.expired(5000)) 209f2: 68 e8 ldi r22, 0x88 ; 136 209f4: 73 e1 ldi r23, 0x13 ; 19 209f6: 80 ea ldi r24, 0xA0 ; 160 209f8: 97 e1 ldi r25, 0x17 ; 23 209fa: 0f 94 54 29 call 0x252a8 ; 0x252a8 ::expired(unsigned short)> 209fe: 81 11 cpse r24, r1 20a00: 09 c0 rjmp .+18 ; 0x20a14 return; } autostart_stilltocheck = false; 20a02: 10 92 69 02 sts 0x0269, r1 ; 0x800269 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.551> if(!mounted) 20a06: 80 91 90 14 lds r24, 0x1490 ; 0x801490 20a0a: 88 23 and r24, r24 20a0c: 09 f4 brne .+2 ; 0x20a10 20a0e: ae c0 rjmp .+348 ; 0x20b6c 20a10: 0f 94 72 75 call 0x2eae4 ; 0x2eae4 #ifdef SDSUPPORT card.checkautostart(false); #endif if(buflen) 20a14: 80 91 a2 10 lds r24, 0x10A2 ; 0x8010a2 20a18: 90 91 a3 10 lds r25, 0x10A3 ; 0x8010a3 20a1c: 89 2b or r24, r25 20a1e: 09 f4 brne .+2 ; 0x20a22 20a20: 61 c0 rjmp .+194 ; 0x20ae4 { cmdbuffer_front_already_processed = false; 20a22: 10 92 a1 10 sts 0x10A1, r1 ; 0x8010a1 #ifdef SDSUPPORT if(card.saving) 20a26: 80 91 8d 14 lds r24, 0x148D ; 0x80148d 20a2a: 88 23 and r24, r24 20a2c: d1 f1 breq .+116 ; 0x20aa2 { // 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) { 20a2e: 80 91 91 12 lds r24, 0x1291 ; 0x801291 20a32: 90 91 92 12 lds r25, 0x1292 ; 0x801292 20a36: dc 01 movw r26, r24 20a38: a9 55 subi r26, 0x59 ; 89 20a3a: bf 4e sbci r27, 0xEF ; 239 20a3c: 7d 01 movw r14, r26 20a3e: 6a ee ldi r22, 0xEA ; 234 20a40: 7e e8 ldi r23, 0x8E ; 142 20a42: cd 01 movw r24, r26 20a44: 0f 94 de d9 call 0x3b3bc ; 0x3b3bc 20a48: 89 2b or r24, r25 20a4a: 09 f0 breq .+2 ; 0x20a4e 20a4c: 9c c0 rjmp .+312 ; 0x20b86 else SERIAL_PROTOCOLLNPGM("Not SD printing"); } void CardReader::write_command(char *buf) { file.writeError = false; 20a4e: 10 92 1f 17 sts 0x171F, r1 ; 0x80171f /** 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)); 20a52: f7 01 movw r30, r14 20a54: 01 90 ld r0, Z+ 20a56: 00 20 and r0, r0 20a58: e9 f7 brne .-6 ; 0x20a54 20a5a: 31 97 sbiw r30, 0x01 ; 1 20a5c: bf 01 movw r22, r30 20a5e: 6e 19 sub r22, r14 20a60: 7f 09 sbc r23, r15 20a62: c7 01 movw r24, r14 20a64: 0f 94 1b 83 call 0x30636 ; 0x30636 20a68: 62 e0 ldi r22, 0x02 ; 2 20a6a: 70 e0 ldi r23, 0x00 ; 0 20a6c: 84 ef ldi r24, 0xF4 ; 244 20a6e: 92 e0 ldi r25, 0x02 ; 2 20a70: 0f 94 1b 83 call 0x30636 ; 0x30636 file.write(buf); //write command file.write("\r\n"); //write line termination if (file.writeError) 20a74: 80 91 1f 17 lds r24, 0x171F ; 0x80171f 20a78: 88 23 and r24, r24 20a7a: 41 f0 breq .+16 ; 0x20a8c { SERIAL_ERROR_START; 20a7c: 8a ec ldi r24, 0xCA ; 202 20a7e: 9b ea ldi r25, 0xAB ; 171 20a80: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ERRORLNRPGM(MSG_SD_ERR_WRITE_TO_FILE); 20a84: 8d ec ldi r24, 0xCD ; 205 20a86: 9d e6 ldi r25, 0x6D ; 109 20a88: 0e 94 93 79 call 0xf326 ; 0xf326 card.write_command(CMDBUFFER_CURRENT_STRING); if(card.logging) 20a8c: 80 91 8e 14 lds r24, 0x148E ; 0x80148e 20a90: 88 23 and r24, r24 20a92: 09 f4 brne .+2 ; 0x20a96 20a94: 73 c0 rjmp .+230 ; 0x20b7c */ void process_commands() { if (!buflen) return; //empty command 20a96: 80 91 a2 10 lds r24, 0x10A2 ; 0x8010a2 20a9a: 90 91 a3 10 lds r25, 0x10A3 ; 0x8010a3 20a9e: 89 2b or r24, r25 20aa0: 11 f0 breq .+4 ; 0x20aa6 20aa2: 0e 94 92 95 call 0x12b24 ; 0x12b24 } #else process_commands(); #endif //SDSUPPORT if (! cmdbuffer_front_already_processed && buflen) 20aa6: 80 91 a1 10 lds r24, 0x10A1 ; 0x8010a1 20aaa: 81 11 cpse r24, r1 20aac: 19 c0 rjmp .+50 ; 0x20ae0 20aae: 80 91 a2 10 lds r24, 0x10A2 ; 0x8010a2 20ab2: 90 91 a3 10 lds r25, 0x10A3 ; 0x8010a3 20ab6: 89 2b or r24, r25 20ab8: 99 f0 breq .+38 ; 0x20ae0 { // 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; 20aba: e0 91 91 12 lds r30, 0x1291 ; 0x801291 20abe: f0 91 92 12 lds r31, 0x1292 ; 0x801292 20ac2: ec 55 subi r30, 0x5C ; 92 20ac4: ff 4e sbci r31, 0xEF ; 239 if (*ptr == CMDBUFFER_CURRENT_TYPE_SDCARD) { 20ac6: 80 81 ld r24, Z 20ac8: 82 30 cpi r24, 0x02 ; 2 20aca: 09 f0 breq .+2 ; 0x20ace 20acc: 6b c0 rjmp .+214 ; 0x20ba4 { // 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(); 20ace: 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; 20ad0: 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); 20ad2: 81 81 ldd r24, Z+1 ; 0x01 20ad4: 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); 20ad6: 0f 94 01 63 call 0x2c602 ; 0x2c602 sei(); 20ada: 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(); 20adc: 0e 94 d4 76 call 0xeda8 ; 0xeda8 } host_keepalive(); 20ae0: 0e 94 bf 7f call 0xff7e ; 0xff7e } } //check heater every n milliseconds manage_heater(); 20ae4: 0f 94 2e 38 call 0x2705c ; 0x2705c manage_inactivity(printingIsPaused()); 20ae8: 0e 94 9d 67 call 0xcf3a ; 0xcf3a 20aec: 0e 94 c7 8a call 0x1158e ; 0x1158e //=============================functions ============================ //=========================================================================== void checkHitEndstops() { if(endstop_hit) { 20af0: 80 91 0a 05 lds r24, 0x050A ; 0x80050a <_ZL11endstop_hit.lto_priv.480> 20af4: 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; 20af6: 10 92 0a 05 sts 0x050A, r1 ; 0x80050a <_ZL11endstop_hit.lto_priv.480> checkHitEndstops(); lcd_update(0); 20afa: 80 e0 ldi r24, 0x00 ; 0 20afc: 0e 94 bf 6e call 0xdd7e ; 0xdd7e #ifdef TMC2130 tmc2130_check_overtemp(); 20b00: 0f 94 bd 29 call 0x2537a ; 0x2537a if (tmc2130_sg_crash) 20b04: 80 91 0c 05 lds r24, 0x050C ; 0x80050c 20b08: 88 23 and r24, r24 20b0a: 79 f0 breq .+30 ; 0x20b2a { uint8_t crash = tmc2130_sg_crash; tmc2130_sg_crash = 0; 20b0c: 10 92 0c 05 sts 0x050C, r1 ; 0x80050c // crashdet_stop_and_save_print(); switch (crash) 20b10: 82 30 cpi r24, 0x02 ; 2 20b12: 09 f4 brne .+2 ; 0x20b16 20b14: 53 c0 rjmp .+166 ; 0x20bbc 20b16: 83 30 cpi r24, 0x03 ; 3 20b18: 09 f4 brne .+2 ; 0x20b1c 20b1a: 54 c0 rjmp .+168 ; 0x20bc4 20b1c: 81 30 cpi r24, 0x01 ; 1 20b1e: 29 f4 brne .+10 ; 0x20b2a { case 1: enquecommand_P((PSTR("CRASH_DETECTEDX"))); break; 20b20: 61 e0 ldi r22, 0x01 ; 1 20b22: 8a ed ldi r24, 0xDA ; 218 20b24: 9e e8 ldi r25, 0x8E ; 142 case 2: enquecommand_P((PSTR("CRASH_DETECTEDY"))); break; case 3: enquecommand_P((PSTR("CRASH_DETECTEDXY"))); break; 20b26: 0e 94 38 88 call 0x11070 ; 0x11070 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) { 20b2a: 80 91 0b 05 lds r24, 0x050B ; 0x80050b <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.540> 20b2e: 81 11 cpse r24, r1 20b30: 07 c0 rjmp .+14 ; 0x20b40 return; } avoidRecursion = true; 20b32: c0 92 0b 05 sts 0x050B, r12 ; 0x80050b <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.540> mmu_loop_inner(true); 20b36: 81 e0 ldi r24, 0x01 ; 1 20b38: 0f 94 bd a6 call 0x34d7a ; 0x34d7a avoidRecursion = false; 20b3c: 10 92 0b 05 sts 0x050B, r1 ; 0x80050b <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.540> 20b40: 01 15 cp r16, r1 20b42: 11 05 cpc r17, r1 20b44: 09 f4 brne .+2 ; 0x20b48 20b46: 38 cf rjmp .-400 ; 0x209b8 20b48: 0e 94 00 00 call 0 ; 0x0 <__vectors> 20b4c: 35 cf rjmp .-406 ; 0x209b8 // 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); 20b4e: c0 92 be 02 sts 0x02BE, r12 ; 0x8002be 20b52: 3b cf rjmp .-394 ; 0x209ca } 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. 20b54: 60 e1 ldi r22, 0x10 ; 16 20b56: 77 e2 ldi r23, 0x27 ; 39 20b58: 8d e0 ldi r24, 0x0D ; 13 20b5a: 95 e0 ldi r25, 0x05 ; 5 20b5c: 0f 94 54 29 call 0x252a8 ; 0x252a8 ::expired(unsigned short)> 20b60: 88 23 and r24, r24 20b62: 09 f4 brne .+2 ; 0x20b66 20b64: 40 cf rjmp .-384 ; 0x209e6 20b66: b0 92 b7 0d sts 0x0DB7, r11 ; 0x800db7 <_ZL13printer_state.lto_priv.401> 20b6a: 3d cf rjmp .-390 ; 0x209e6 return; } autostart_stilltocheck = false; if(!mounted) { mount(); 20b6c: 81 e0 ldi r24, 0x01 ; 1 20b6e: 0f 94 7d 80 call 0x300fa ; 0x300fa if(!mounted) //fail 20b72: 80 91 90 14 lds r24, 0x1490 ; 0x801490 20b76: 81 11 cpse r24, r1 20b78: 4b cf rjmp .-362 ; 0x20a10 20b7a: 4c cf rjmp .-360 ; 0x20a14 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); 20b7c: 85 ef ldi r24, 0xF5 ; 245 20b7e: 9d e6 ldi r25, 0x6D ; 109 } else { card.closefile(); SERIAL_PROTOCOLLNRPGM(MSG_FILE_SAVED); 20b80: 0e 94 93 79 call 0xf326 ; 0xf326 20b84: 90 cf rjmp .-224 ; 0x20aa6 lastnr++; } void CardReader::closefile(bool store_location) { file.sync(); 20b86: 8f e1 ldi r24, 0x1F ; 31 20b88: 97 e1 ldi r25, 0x17 ; 23 20b8a: 0f 94 f6 57 call 0x2afec ; 0x2afec file.close(); 20b8e: 8f e1 ldi r24, 0x1F ; 31 20b90: 97 e1 ldi r25, 0x17 ; 23 20b92: 0f 94 2b 58 call 0x2b056 ; 0x2b056 saving = false; 20b96: 10 92 8d 14 sts 0x148D, r1 ; 0x80148d logging = false; 20b9a: 10 92 8e 14 sts 0x148E, r1 ; 0x80148e 20b9e: 83 ee ldi r24, 0xE3 ; 227 20ba0: 9d e6 ldi r25, 0x6D ; 109 20ba2: ee cf rjmp .-36 ; 0x20b80 // 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){ 20ba4: 86 30 cpi r24, 0x06 ; 6 20ba6: 09 f0 breq .+2 ; 0x20baa 20ba8: 99 cf rjmp .-206 ; 0x20adc 20baa: 80 91 8f 14 lds r24, 0x148F ; 0x80148f 20bae: 81 11 cpse r24, r1 20bb0: 95 cf rjmp .-214 ; 0x20adc cli(); 20bb2: f8 94 cli *ptr ++ = CMDBUFFER_CURRENT_TYPE_TO_BE_REMOVED; 20bb4: d0 82 st Z, r13 // and one for each command to previous block in the planner queue. planner_add_sd_length(1); 20bb6: 81 e0 ldi r24, 0x01 ; 1 20bb8: 90 e0 ldi r25, 0x00 ; 0 20bba: 8d cf rjmp .-230 ; 0x20ad6 tmc2130_sg_crash = 0; // crashdet_stop_and_save_print(); switch (crash) { case 1: enquecommand_P((PSTR("CRASH_DETECTEDX"))); break; case 2: enquecommand_P((PSTR("CRASH_DETECTEDY"))); break; 20bbc: 61 e0 ldi r22, 0x01 ; 1 20bbe: 8a ec ldi r24, 0xCA ; 202 20bc0: 9e e8 ldi r25, 0x8E ; 142 20bc2: b1 cf rjmp .-158 ; 0x20b26 case 3: enquecommand_P((PSTR("CRASH_DETECTEDXY"))); break; 20bc4: 61 e0 ldi r22, 0x01 ; 1 20bc6: 89 eb ldi r24, 0xB9 ; 185 20bc8: 9e e8 ldi r25, 0x8E ; 142 20bca: ad cf rjmp .-166 ; 0x20b26 { 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; 20bcc: 02 e0 ldi r16, 0x02 ; 2 if (motherboard != MOTHERBOARD) version_changed |= 0b01; 20bce: 86 33 cpi r24, 0x36 ; 54 20bd0: 91 40 sbci r25, 0x01 ; 1 20bd2: 09 f0 breq .+2 ; 0x20bd6 20bd4: 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(); 20bd6: 0e 94 a4 82 call 0x10548 ; 0x10548 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; 20bda: f1 2c mov r15, 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; 20bdc: 82 ea ldi r24, 0xA2 ; 162 20bde: 92 ea ldi r25, 0xA2 ; 162 20be0: a0 e0 ldi r26, 0x00 ; 0 20be2: b0 e0 ldi r27, 0x00 ; 0 20be4: 80 93 3f 18 sts 0x183F, r24 ; 0x80183f <__bss_end+0x20> 20be8: 90 93 40 18 sts 0x1840, r25 ; 0x801840 <__bss_end+0x21> 20bec: a0 93 41 18 sts 0x1841, r26 ; 0x801841 <__bss_end+0x22> 20bf0: b0 93 42 18 sts 0x1842, r27 ; 0x801842 <__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; 20bf4: 10 92 b2 04 sts 0x04B2, r1 ; 0x8004b2 <_ZL14iState_sum_min.lto_priv.468> 20bf8: 10 92 b3 04 sts 0x04B3, r1 ; 0x8004b3 <_ZL14iState_sum_min.lto_priv.468+0x1> 20bfc: 10 92 b4 04 sts 0x04B4, r1 ; 0x8004b4 <_ZL14iState_sum_min.lto_priv.468+0x2> 20c00: 10 92 b5 04 sts 0x04B5, r1 ; 0x8004b5 <_ZL14iState_sum_min.lto_priv.468+0x3> iState_sum_max[e] = PID_INTEGRAL_DRIVE_MAX / cs.Ki; 20c04: 20 91 29 0e lds r18, 0x0E29 ; 0x800e29 20c08: 30 91 2a 0e lds r19, 0x0E2A ; 0x800e2a 20c0c: 40 91 2b 0e lds r20, 0x0E2B ; 0x800e2b 20c10: 50 91 2c 0e lds r21, 0x0E2C ; 0x800e2c 20c14: 60 e0 ldi r22, 0x00 ; 0 20c16: 70 e0 ldi r23, 0x00 ; 0 20c18: 8f e7 ldi r24, 0x7F ; 127 20c1a: 93 e4 ldi r25, 0x43 ; 67 20c1c: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 20c20: 60 93 ae 04 sts 0x04AE, r22 ; 0x8004ae <_ZL14iState_sum_max.lto_priv.469> 20c24: 70 93 af 04 sts 0x04AF, r23 ; 0x8004af <_ZL14iState_sum_max.lto_priv.469+0x1> 20c28: 80 93 b0 04 sts 0x04B0, r24 ; 0x8004b0 <_ZL14iState_sum_max.lto_priv.469+0x2> 20c2c: 90 93 b1 04 sts 0x04B1, r25 ; 0x8004b1 <_ZL14iState_sum_max.lto_priv.469+0x3> #endif //PIDTEMP #ifdef PIDTEMPBED temp_iState_min_bed = 0.0; 20c30: 10 92 aa 04 sts 0x04AA, r1 ; 0x8004aa <_ZL19temp_iState_min_bed.lto_priv.466> 20c34: 10 92 ab 04 sts 0x04AB, r1 ; 0x8004ab <_ZL19temp_iState_min_bed.lto_priv.466+0x1> 20c38: 10 92 ac 04 sts 0x04AC, r1 ; 0x8004ac <_ZL19temp_iState_min_bed.lto_priv.466+0x2> 20c3c: 10 92 ad 04 sts 0x04AD, r1 ; 0x8004ad <_ZL19temp_iState_min_bed.lto_priv.466+0x3> temp_iState_max_bed = PID_INTEGRAL_DRIVE_MAX / cs.bedKi; 20c40: 20 91 35 0e lds r18, 0x0E35 ; 0x800e35 20c44: 30 91 36 0e lds r19, 0x0E36 ; 0x800e36 20c48: 40 91 37 0e lds r20, 0x0E37 ; 0x800e37 20c4c: 50 91 38 0e lds r21, 0x0E38 ; 0x800e38 20c50: 60 e0 ldi r22, 0x00 ; 0 20c52: 70 e0 ldi r23, 0x00 ; 0 20c54: 8f e7 ldi r24, 0x7F ; 127 20c56: 93 e4 ldi r25, 0x43 ; 67 20c58: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 20c5c: 60 93 a6 04 sts 0x04A6, r22 ; 0x8004a6 <_ZL19temp_iState_max_bed.lto_priv.467> 20c60: 70 93 a7 04 sts 0x04A7, r23 ; 0x8004a7 <_ZL19temp_iState_max_bed.lto_priv.467+0x1> 20c64: 80 93 a8 04 sts 0x04A8, r24 ; 0x8004a8 <_ZL19temp_iState_max_bed.lto_priv.467+0x2> 20c68: 90 93 a9 04 sts 0x04A9, r25 ; 0x8004a9 <_ZL19temp_iState_max_bed.lto_priv.467+0x3> #endif //PIDTEMPBED } #if defined(HEATER_0_PIN) && (HEATER_0_PIN > -1) SET_OUTPUT(HEATER_0_PIN); 20c6c: 6d 9a sbi 0x0d, 5 ; 13 #endif #if defined(HEATER_BED_PIN) && (HEATER_BED_PIN > -1) SET_OUTPUT(HEATER_BED_PIN); 20c6e: 9d 9a sbi 0x13, 5 ; 19 #endif #if defined(FAN_PIN) && (FAN_PIN > -1) SET_OUTPUT(FAN_PIN); 20c70: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 20c74: 88 60 ori r24, 0x08 ; 8 20c76: 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)); 20c7a: 80 91 a5 04 lds r24, 0x04A5 ; 0x8004a5 20c7e: 90 e0 ldi r25, 0x00 ; 0 20c80: b4 e0 ldi r27, 0x04 ; 4 20c82: 95 95 asr r25 20c84: 87 95 ror r24 20c86: ba 95 dec r27 20c88: e1 f7 brne .-8 ; 0x20c82 20c8a: 80 93 a4 04 sts 0x04A4, r24 ; 0x8004a4 <_ZL12soft_pwm_fan.lto_priv.460> pinMode(MAX6675_SS, OUTPUT); digitalWrite(MAX6675_SS,1); #endif #ifdef HEATER_0_MINTEMP minttemp[0] = HEATER_0_MINTEMP; 20c8e: 8a e0 ldi r24, 0x0A ; 10 20c90: 90 e0 ldi r25, 0x00 ; 0 20c92: 90 93 a3 04 sts 0x04A3, r25 ; 0x8004a3 <_ZL8minttemp.lto_priv.461+0x1> 20c96: 80 93 a2 04 sts 0x04A2, r24 ; 0x8004a2 <_ZL8minttemp.lto_priv.461> while(analog2temp(minttemp_raw[0], 0) < HEATER_0_MINTEMP) { 20c9a: 80 91 54 02 lds r24, 0x0254 ; 0x800254 <_ZL12minttemp_raw.lto_priv.472> 20c9e: 90 91 55 02 lds r25, 0x0255 ; 0x800255 <_ZL12minttemp_raw.lto_priv.472+0x1> 20ca2: 0f 94 d7 a0 call 0x341ae ; 0x341ae 20ca6: 20 e0 ldi r18, 0x00 ; 0 20ca8: 30 e0 ldi r19, 0x00 ; 0 20caa: 40 e2 ldi r20, 0x20 ; 32 20cac: 51 e4 ldi r21, 0x41 ; 65 20cae: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 20cb2: 87 fd sbrc r24, 7 20cb4: 02 c0 rjmp .+4 ; 0x20cba 20cb6: 0c 94 05 fe jmp 0x1fc0a ; 0x1fc0a #if HEATER_0_RAW_LO_TEMP < HEATER_0_RAW_HI_TEMP minttemp_raw[0] += OVERSAMPLENR; #else minttemp_raw[0] -= OVERSAMPLENR; 20cba: 80 91 54 02 lds r24, 0x0254 ; 0x800254 <_ZL12minttemp_raw.lto_priv.472> 20cbe: 90 91 55 02 lds r25, 0x0255 ; 0x800255 <_ZL12minttemp_raw.lto_priv.472+0x1> 20cc2: 40 97 sbiw r24, 0x10 ; 16 20cc4: 90 93 55 02 sts 0x0255, r25 ; 0x800255 <_ZL12minttemp_raw.lto_priv.472+0x1> 20cc8: 80 93 54 02 sts 0x0254, r24 ; 0x800254 <_ZL12minttemp_raw.lto_priv.472> 20ccc: e6 cf rjmp .-52 ; 0x20c9a 00020cce : } } void lcd_print_stop_finish(); void lcd_commands() 20cce: 2f 92 push r2 20cd0: 3f 92 push r3 20cd2: 4f 92 push r4 20cd4: 5f 92 push r5 20cd6: 6f 92 push r6 20cd8: 7f 92 push r7 20cda: 8f 92 push r8 20cdc: 9f 92 push r9 20cde: af 92 push r10 20ce0: bf 92 push r11 20ce2: cf 92 push r12 20ce4: df 92 push r13 20ce6: ef 92 push r14 20ce8: ff 92 push r15 20cea: 0f 93 push r16 20cec: 1f 93 push r17 20cee: cf 93 push r28 20cf0: df 93 push r29 20cf2: 00 d0 rcall .+0 ; 0x20cf4 20cf4: 1f 92 push r1 20cf6: 1f 92 push r1 20cf8: cd b7 in r28, 0x3d ; 61 20cfa: 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) 20cfc: 80 91 b3 0d lds r24, 0x0DB3 ; 0x800db3 20d00: 81 30 cpi r24, 0x01 ; 1 20d02: 09 f0 breq .+2 ; 0x20d06 20d04: 61 c0 rjmp .+194 ; 0x20dc8 20d06: 90 91 a4 0d lds r25, 0x0DA4 ; 0x800da4 20d0a: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 { if (!blocks_queued() && !homing_flag) 20d0e: 98 13 cpse r25, r24 20d10: 5b c0 rjmp .+182 ; 0x20dc8 20d12: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 20d16: 81 11 cpse r24, r1 20d18: 57 c0 rjmp .+174 ; 0x20dc8 { custom_message_type = CustomMsg::Status; 20d1a: 10 92 c3 06 sts 0x06C3, r1 ; 0x8006c3 lcd_setstatuspgm(_T(MSG_PRINT_ABORTED)); 20d1e: 88 e7 ldi r24, 0x78 ; 120 20d20: 9a e4 ldi r25, 0x4A ; 74 20d22: 0e 94 c4 72 call 0xe588 ; 0xe588 20d26: 0e 94 38 f1 call 0x1e270 ; 0x1e270 lcd_commands_type = LcdCommands::Idle; 20d2a: 10 92 b3 0d sts 0x0DB3, r1 ; 0x800db3 20d2e: 82 e0 ldi r24, 0x02 ; 2 20d30: 80 93 b7 0d sts 0x0DB7, r24 ; 0x800db7 <_ZL13printer_state.lto_priv.401> SetPrinterState(PrinterState::Idle); lcd_commands_step = 0; 20d34: 10 92 fa 03 sts 0x03FA, r1 ; 0x8003fa #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(); 20d38: 0f 94 6c 42 call 0x284d8 ; 0x284d8 save_statistics(); 20d3c: 0e 94 37 66 call 0xcc6e ; 0xcc6e // lift Z raise_z(10); 20d40: 60 e0 ldi r22, 0x00 ; 0 20d42: 70 e0 ldi r23, 0x00 ; 0 20d44: 80 e2 ldi r24, 0x20 ; 32 20d46: 91 e4 ldi r25, 0x41 ; 65 20d48: 0e 94 f9 6d call 0xdbf2 ; 0xdbf2 // if axis are homed, move to parking position. if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) { 20d4c: 80 91 8e 06 lds r24, 0x068E ; 0x80068e 20d50: 88 23 and r24, r24 20d52: 21 f1 breq .+72 ; 0x20d9c 20d54: 80 91 8f 06 lds r24, 0x068F ; 0x80068f 20d58: 88 23 and r24, r24 20d5a: 01 f1 breq .+64 ; 0x20d9c current_position[X_AXIS] = X_CANCEL_POS; 20d5c: 80 e0 ldi r24, 0x00 ; 0 20d5e: 90 e0 ldi r25, 0x00 ; 0 20d60: a8 e4 ldi r26, 0x48 ; 72 20d62: b2 e4 ldi r27, 0x42 ; 66 20d64: 80 93 91 06 sts 0x0691, r24 ; 0x800691 20d68: 90 93 92 06 sts 0x0692, r25 ; 0x800692 20d6c: a0 93 93 06 sts 0x0693, r26 ; 0x800693 20d70: b0 93 94 06 sts 0x0694, r27 ; 0x800694 current_position[Y_AXIS] = Y_CANCEL_POS; 20d74: 80 e0 ldi r24, 0x00 ; 0 20d76: 90 e0 ldi r25, 0x00 ; 0 20d78: ae e3 ldi r26, 0x3E ; 62 20d7a: b3 e4 ldi r27, 0x43 ; 67 20d7c: 80 93 95 06 sts 0x0695, r24 ; 0x800695 20d80: 90 93 96 06 sts 0x0696, r25 ; 0x800696 20d84: a0 93 97 06 sts 0x0697, r26 ; 0x800697 20d88: b0 93 98 06 sts 0x0698, r27 ; 0x800698 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 20d8c: 60 e0 ldi r22, 0x00 ; 0 20d8e: 70 e0 ldi r23, 0x00 ; 0 20d90: 84 e3 ldi r24, 0x34 ; 52 20d92: 92 e4 ldi r25, 0x42 ; 66 20d94: 0f 94 04 c0 call 0x38008 ; 0x38008 st_synchronize(); 20d98: 0f 94 a3 42 call 0x28546 ; 0x28546 temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; 20d9c: 80 91 1a 05 lds r24, 0x051A ; 0x80051a <_ZL16temp_error_state.lto_priv.454> // 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()) { 20da0: 88 23 and r24, r24 20da2: 09 f4 brne .+2 ; 0x20da6 20da4: c9 c0 rjmp .+402 ; 0x20f38 // time to stop the error beep WRITE(BEEPER, LOW); 20da6: 9f b7 in r25, 0x3f ; 63 20da8: f8 94 cli 20daa: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 20dae: 8b 7f andi r24, 0xFB ; 251 20db0: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 20db4: 9f bf out 0x3f, r25 ; 63 MMU2::mmu2.unload(); // M702 } } } lcd_cooldown(); //turns off heaters and fan; goes to status screen. 20db6: 0f 94 03 2f call 0x25e06 ; 0x25e06 finishAndDisableSteppers(); //M84 20dba: 0e 94 80 82 call 0x10500 ; 0x10500 axis_relative_modes = E_AXIS_MASK; //XYZ absolute, E relative 20dbe: 88 e0 ldi r24, 0x08 ; 8 20dc0: 80 93 e3 03 sts 0x03E3, r24 ; 0x8003e3 did_pause_print = false; // Clear pause state in case the print was aborted while paused 20dc4: 10 92 e2 03 sts 0x03E2, r1 ; 0x8003e2 lcd_commands_step = 0; lcd_print_stop_finish(); } } if (lcd_commands_type == LcdCommands::LongPause) 20dc8: 80 91 b3 0d lds r24, 0x0DB3 ; 0x800db3 20dcc: 82 30 cpi r24, 0x02 ; 2 20dce: 09 f0 breq .+2 ; 0x20dd2 20dd0: 6a c0 rjmp .+212 ; 0x20ea6 20dd2: 90 91 a4 0d lds r25, 0x0DA4 ; 0x800da4 20dd6: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 { if (!blocks_queued() && !homing_flag) 20dda: 98 13 cpse r25, r24 20ddc: 64 c0 rjmp .+200 ; 0x20ea6 20dde: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 20de2: 81 11 cpse r24, r1 20de4: 60 c0 rjmp .+192 ; 0x20ea6 { if (custom_message_type != CustomMsg::M117) 20de6: 80 91 c3 06 lds r24, 0x06C3 ; 0x8006c3 20dea: 87 30 cpi r24, 0x07 ; 7 20dec: 41 f0 breq .+16 ; 0x20dfe { custom_message_type = CustomMsg::Status; 20dee: 10 92 c3 06 sts 0x06C3, r1 ; 0x8006c3 lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); 20df2: 89 e6 ldi r24, 0x69 ; 105 20df4: 9a e4 ldi r25, 0x4A ; 74 20df6: 0e 94 c4 72 call 0xe588 ; 0xe588 20dfa: 0e 94 38 f1 call 0x1e270 ; 0x1e270 } lcd_commands_type = LcdCommands::Idle; 20dfe: 10 92 b3 0d sts 0x0DB3, r1 ; 0x800db3 20e02: 82 e0 ldi r24, 0x02 ; 2 20e04: 80 93 b7 0d sts 0x0DB7, r24 ; 0x800db7 <_ZL13printer_state.lto_priv.401> SetPrinterState(PrinterState::Idle); lcd_commands_step = 0; 20e08: 10 92 fa 03 sts 0x03FA, r1 ; 0x8003fa } #endif //PINDA_THERMISTOR void long_pause() //long pause print { st_synchronize(); 20e0c: 0f 94 a3 42 call 0x28546 ; 0x28546 // Stop heaters heating_status = HeatingStatus::NO_HEATING; 20e10: 10 92 e1 03 sts 0x03E1, r1 ; 0x8003e1 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 20e14: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 20e18: 10 92 b5 0d sts 0x0DB5, r1 ; 0x800db5 setTargetHotend(0); // Lift z raise_z(pause_position[Z_AXIS]); 20e1c: 60 91 47 02 lds r22, 0x0247 ; 0x800247 <_ZL14pause_position.lto_priv.481+0x8> 20e20: 70 91 48 02 lds r23, 0x0248 ; 0x800248 <_ZL14pause_position.lto_priv.481+0x9> 20e24: 80 91 49 02 lds r24, 0x0249 ; 0x800249 <_ZL14pause_position.lto_priv.481+0xa> 20e28: 90 91 4a 02 lds r25, 0x024A ; 0x80024a <_ZL14pause_position.lto_priv.481+0xb> 20e2c: 0e 94 f9 6d call 0xdbf2 ; 0xdbf2 // Move XY to side if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) { 20e30: 80 91 8e 06 lds r24, 0x068E ; 0x80068e 20e34: 88 23 and r24, r24 20e36: 51 f1 breq .+84 ; 0x20e8c 20e38: 80 91 8f 06 lds r24, 0x068F ; 0x80068f 20e3c: 88 23 and r24, r24 20e3e: 31 f1 breq .+76 ; 0x20e8c current_position[X_AXIS] = pause_position[X_AXIS]; 20e40: 80 91 3f 02 lds r24, 0x023F ; 0x80023f <_ZL14pause_position.lto_priv.481> 20e44: 90 91 40 02 lds r25, 0x0240 ; 0x800240 <_ZL14pause_position.lto_priv.481+0x1> 20e48: a0 91 41 02 lds r26, 0x0241 ; 0x800241 <_ZL14pause_position.lto_priv.481+0x2> 20e4c: b0 91 42 02 lds r27, 0x0242 ; 0x800242 <_ZL14pause_position.lto_priv.481+0x3> 20e50: 80 93 91 06 sts 0x0691, r24 ; 0x800691 20e54: 90 93 92 06 sts 0x0692, r25 ; 0x800692 20e58: a0 93 93 06 sts 0x0693, r26 ; 0x800693 20e5c: b0 93 94 06 sts 0x0694, r27 ; 0x800694 current_position[Y_AXIS] = pause_position[Y_AXIS]; 20e60: 80 91 43 02 lds r24, 0x0243 ; 0x800243 <_ZL14pause_position.lto_priv.481+0x4> 20e64: 90 91 44 02 lds r25, 0x0244 ; 0x800244 <_ZL14pause_position.lto_priv.481+0x5> 20e68: a0 91 45 02 lds r26, 0x0245 ; 0x800245 <_ZL14pause_position.lto_priv.481+0x6> 20e6c: b0 91 46 02 lds r27, 0x0246 ; 0x800246 <_ZL14pause_position.lto_priv.481+0x7> 20e70: 80 93 95 06 sts 0x0695, r24 ; 0x800695 20e74: 90 93 96 06 sts 0x0696, r25 ; 0x800696 20e78: a0 93 97 06 sts 0x0697, r26 ; 0x800697 20e7c: b0 93 98 06 sts 0x0698, r27 ; 0x800698 plan_buffer_line_curposXYZE(50); 20e80: 60 e0 ldi r22, 0x00 ; 0 20e82: 70 e0 ldi r23, 0x00 ; 0 20e84: 88 e4 ldi r24, 0x48 ; 72 20e86: 92 e4 ldi r25, 0x42 ; 66 20e88: 0f 94 04 c0 call 0x38008 ; 0x38008 20e8c: 80 91 1a 05 lds r24, 0x051A ; 0x80051a <_ZL16temp_error_state.lto_priv.454> } // did we come here from a thermal error? if(get_temp_error()) { 20e90: 88 23 and r24, r24 20e92: 09 f4 brne .+2 ; 0x20e96 20e94: 7b c0 rjmp .+246 ; 0x20f8c // time to stop the error beep WRITE(BEEPER, LOW); 20e96: 9f b7 in r25, 0x3f ; 63 20e98: f8 94 cli 20e9a: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 20e9e: 8b 7f andi r24, 0xFB ; 251 20ea0: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 20ea4: 9f bf out 0x3f, r25 ; 63 long_pause(); } } if (lcd_commands_type == LcdCommands::Layer1Cal) 20ea6: 80 91 b3 0d lds r24, 0x0DB3 ; 0x800db3 20eaa: 84 30 cpi r24, 0x04 ; 4 20eac: 09 f0 breq .+2 ; 0x20eb0 20eae: ad c0 rjmp .+346 ; 0x2100a { const uint16_t nozzle_dia = eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM); 20eb0: 85 ea ldi r24, 0xA5 ; 165 20eb2: 9d e0 ldi r25, 0x0D ; 13 20eb4: 0f 94 e5 db call 0x3b7ca ; 0x3b7ca 20eb8: 30 91 a4 0d lds r19, 0x0DA4 ; 0x800da4 20ebc: 20 91 a5 0d lds r18, 0x0DA5 ; 0x800da5 const float extrusion_width = (nozzle_dia + 20)/1000.0f; const float layer_height = 0.2f; if (!blocks_queued() && cmd_buffer_empty() && !saved_printing) 20ec0: 32 13 cpse r19, r18 20ec2: 7c c1 rjmp .+760 ; 0x211bc 20ec4: 20 91 a2 10 lds r18, 0x10A2 ; 0x8010a2 20ec8: 30 91 a3 10 lds r19, 0x10A3 ; 0x8010a3 20ecc: 23 2b or r18, r19 20ece: 09 f0 breq .+2 ; 0x20ed2 20ed0: 75 c1 rjmp .+746 ; 0x211bc 20ed2: 20 91 a8 0d lds r18, 0x0DA8 ; 0x800da8 20ed6: 29 83 std Y+1, r18 ; 0x01 20ed8: 21 11 cpse r18, r1 20eda: 70 c1 rjmp .+736 ; 0x211bc { if (lcd_commands_step == 0) 20edc: 20 91 fa 03 lds r18, 0x03FA ; 0x8003fa 20ee0: 21 11 cpse r18, r1 20ee2: 57 c0 rjmp .+174 ; 0x20f92 lcd_commands_step = 12; 20ee4: 2c e0 ldi r18, 0x0C ; 12 else lcd_commands_step--; 20ee6: 20 93 fa 03 sts 0x03FA, r18 ; 0x8003fa } 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; 20eea: 44 96 adiw r24, 0x14 ; 20 20eec: bc 01 movw r22, r24 20eee: 90 e0 ldi r25, 0x00 ; 0 20ef0: 80 e0 ldi r24, 0x00 ; 0 20ef2: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 20ef6: 20 e0 ldi r18, 0x00 ; 0 20ef8: 30 e0 ldi r19, 0x00 ; 0 20efa: 4a e7 ldi r20, 0x7A ; 122 20efc: 54 e4 ldi r21, 0x44 ; 68 20efe: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 20f02: 6b 01 movw r12, r22 20f04: 7c 01 movw r14, r24 if (lcd_commands_step == 0) lcd_commands_step = 12; else lcd_commands_step--; switch(lcd_commands_step) 20f06: e0 91 fa 03 lds r30, 0x03FA ; 0x8003fa 20f0a: e1 50 subi r30, 0x01 ; 1 20f0c: ec 30 cpi r30, 0x0C ; 12 20f0e: 08 f0 brcs .+2 ; 0x20f12 20f10: 7c c0 rjmp .+248 ; 0x2100a 20f12: f0 e0 ldi r31, 0x00 ; 0 20f14: 88 27 eor r24, r24 20f16: e0 57 subi r30, 0x70 ; 112 20f18: f8 4f sbci r31, 0xF8 ; 248 20f1a: 8e 4f sbci r24, 0xFE ; 254 20f1c: 0d 94 e7 dc jmp 0x3b9ce ; 0x3b9ce <__tablejump2__> 20f20: e8 3a cpi r30, 0xA8 ; 168 20f22: 3e 3b cpi r19, 0xBE ; 190 20f24: 5a 39 cpi r21, 0x9A ; 154 20f26: 3a 3b cpi r19, 0xBA ; 186 20f28: 20 3a cpi r18, 0xA0 ; 160 20f2a: 5e 39 cpi r21, 0x9E ; 158 20f2c: d6 3a cpi r29, 0xA6 ; 166 20f2e: b8 39 cpi r27, 0x98 ; 152 20f30: 06 3a cpi r16, 0xA6 ; 166 20f32: ee 3a cpi r30, 0xAE ; 174 20f34: 50 3a cpi r21, 0xA0 ; 160 20f36: 38 3b cpi r19, 0xB8 ; 184 if(get_temp_error()) { // time to stop the error beep WRITE(BEEPER, LOW); } else { // Turn off the print fan fanSpeed = 0; 20f38: 10 92 e5 03 sts 0x03E5, r1 ; 0x8003e5 { #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(); 20f3c: 0e 94 f9 74 call 0xe9f2 ; 0xe9f2 setExtruderAutoFanState(1); 20f40: 81 e0 ldi r24, 0x01 ; 1 20f42: 0e 94 73 75 call 0xeae6 ; 0xeae6 // restore the auto hotend state hotendDefaultAutoFanState(); if (MMU2::mmu2.Enabled() && MMU2::mmu2.FindaDetectsFilament() #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 20f46: 80 91 b9 13 lds r24, 0x13B9 ; 0x8013b9 20f4a: 81 30 cpi r24, 0x01 ; 1 20f4c: 09 f0 breq .+2 ; 0x20f50 20f4e: 33 cf rjmp .-410 ; 0x20db6 fanSpeed = 0; // restore the auto hotend state hotendDefaultAutoFanState(); if (MMU2::mmu2.Enabled() && MMU2::mmu2.FindaDetectsFilament() 20f50: 80 91 8f 13 lds r24, 0x138F ; 0x80138f 20f54: 88 23 and r24, r24 20f56: 09 f4 brne .+2 ; 0x20f5a 20f58: 2e cf rjmp .-420 ; 0x20db6 #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 20f5a: 80 91 e4 03 lds r24, 0x03E4 ; 0x8003e4 20f5e: 82 30 cpi r24, 0x02 ; 2 20f60: 09 f4 brne .+2 ; 0x20f64 20f62: 29 cf rjmp .-430 ; 0x20db6 #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()) 20f64: 0e 94 9d 67 call 0xcf3a ; 0xcf3a 20f68: 81 11 cpse r24, r1 { // Restore temperature saved in ram after pausing print restore_extruder_temperature_from_ram(); 20f6a: 0e 94 e1 64 call 0xc9c2 ; 0xc9c2 } // 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) { 20f6e: 20 91 b5 0d lds r18, 0x0DB5 ; 0x800db5 20f72: 30 91 b6 0d lds r19, 0x0DB6 ; 0x800db6 20f76: 80 91 6b 02 lds r24, 0x026B ; 0x80026b 20f7a: 90 91 6c 02 lds r25, 0x026C ; 0x80026c 20f7e: 28 17 cp r18, r24 20f80: 39 07 cpc r19, r25 20f82: 0c f4 brge .+2 ; 0x20f86 20f84: 18 cf rjmp .-464 ; 0x20db6 MMU2::mmu2.unload(); // M702 20f86: 0f 94 f8 ac call 0x359f0 ; 0x359f0 20f8a: 15 cf rjmp .-470 ; 0x20db6 } else { // Turn off the print fan fanSpeed = 0; 20f8c: 10 92 e5 03 sts 0x03E5, r1 ; 0x8003e5 20f90: 8a cf rjmp .-236 ; 0x20ea6 if (!blocks_queued() && cmd_buffer_empty() && !saved_printing) { if (lcd_commands_step == 0) lcd_commands_step = 12; else lcd_commands_step--; 20f92: 21 50 subi r18, 0x01 ; 1 20f94: a8 cf rjmp .-176 ; 0x20ee6 preheat_cmd_3, preheat_cmd_4, zero_extrusion }; lay1cal_common_enqueue_loop(preheat_cmd, sizeof(preheat_cmd)/sizeof(preheat_cmd[0])); 20f96: 65 e0 ldi r22, 0x05 ; 5 20f98: 89 e7 ldi r24, 0x79 ; 121 20f9a: 9b e8 ldi r25, 0x8B ; 139 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]))); 20f9c: 0e 94 b7 88 call 0x1116e ; 0x1116e 20fa0: 34 c0 rjmp .+104 ; 0x2100a //! @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()) 20fa2: 80 91 b9 13 lds r24, 0x13B9 ; 0x8013b9 20fa6: 81 30 cpi r24, 0x01 ; 1 20fa8: 69 f5 brne .+90 ; 0x21004 { case 12: lay1cal_wait_preheat(); break; case 11: extraPurgeNeeded = lay1cal_load_filament(lay1cal_filament); 20faa: 30 91 f9 03 lds r19, 0x03F9 ; 0x8003f9 20fae: 3b 83 std Y+3, r19 ; 0x03 { enquecommand_P(MSG_M83); 20fb0: 61 e0 ldi r22, 0x01 ; 1 20fb2: 8a e1 ldi r24, 0x1A ; 26 20fb4: 9c e6 ldi r25, 0x6C ; 108 20fb6: 0e 94 38 88 call 0x11070 ; 0x11070 enquecommand_P(PSTR("G1 Y-3 F1000")); 20fba: 61 e0 ldi r22, 0x01 ; 1 20fbc: 8c e6 ldi r24, 0x6C ; 108 20fbe: 9b e8 ldi r25, 0x8B ; 139 20fc0: 0e 94 38 88 call 0x11070 ; 0x11070 enquecommand_P(PSTR("G1 Z0.4 F1000")); 20fc4: 61 e0 ldi r22, 0x01 ; 1 20fc6: 8e e5 ldi r24, 0x5E ; 94 20fc8: 9b e8 ldi r25, 0x8B ; 139 20fca: 0e 94 38 88 call 0x11070 ; 0x11070 uint8_t currentTool = MMU2::mmu2.get_current_tool(); 20fce: 0f 94 74 74 call 0x2e8e8 ; 0x2e8e8 if(currentTool == filament ){ 20fd2: 9b 81 ldd r25, Y+3 ; 0x03 20fd4: 98 17 cp r25, r24 20fd6: b1 f0 breq .+44 ; 0x21004 // already have the correct tool loaded - do nothing return false; } else if( currentTool != (uint8_t)MMU2::FILAMENT_UNKNOWN){ 20fd8: 8f 3f cpi r24, 0xFF ; 255 20fda: 29 f0 breq .+10 ; 0x20fe6 // some other slot is loaded, perform an unload first enquecommand_P(MSG_M702); 20fdc: 61 e0 ldi r22, 0x01 ; 1 20fde: 85 e1 ldi r24, 0x15 ; 21 20fe0: 9c e6 ldi r25, 0x6C ; 108 20fe2: 0e 94 38 88 call 0x11070 ; 0x11070 } // perform a toolchange enquecommandf_P(PSTR("T%d"), filament); 20fe6: 1f 92 push r1 20fe8: 2b 81 ldd r18, Y+3 ; 0x03 20fea: 2f 93 push r18 20fec: 8a e5 ldi r24, 0x5A ; 90 20fee: 9b e8 ldi r25, 0x8B ; 139 20ff0: 9f 93 push r25 20ff2: 8f 93 push r24 20ff4: 0e 94 ce 88 call 0x1119c ; 0x1119c 20ff8: 0f 90 pop r0 20ffa: 0f 90 pop r0 20ffc: 0f 90 pop r0 20ffe: 0f 90 pop r0 return true; 21000: 31 e0 ldi r19, 0x01 ; 1 21002: 39 83 std Y+1, r19 ; 0x01 21004: 89 81 ldd r24, Y+1 ; 0x01 21006: 80 93 f8 03 sts 0x03F8, r24 ; 0x8003f8 break; } } } if (lcd_commands_type == LcdCommands::PidExtruder) { 2100a: 80 91 b3 0d lds r24, 0x0DB3 ; 0x800db3 2100e: 83 30 cpi r24, 0x03 ; 3 21010: 09 f0 breq .+2 ; 0x21014 21012: d4 c0 rjmp .+424 ; 0x211bc if (lcd_commands_step == 0) { 21014: 90 91 fa 03 lds r25, 0x03FA ; 0x8003fa 21018: 91 11 cpse r25, r1 2101a: 09 c0 rjmp .+18 ; 0x2102e custom_message_type = CustomMsg::PidCal; 2101c: 80 93 c3 06 sts 0x06C3, r24 ; 0x8006c3 custom_message_state = 1; 21020: 91 e0 ldi r25, 0x01 ; 1 21022: 90 93 f6 03 sts 0x03F6, r25 ; 0x8003f6 lcd_draw_update = 3; 21026: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d lcd_commands_step = 3; 2102a: 80 93 fa 03 sts 0x03FA, r24 ; 0x8003fa } if (lcd_commands_step == 3 && !blocks_queued()) { //PID calibration 2102e: 80 91 fa 03 lds r24, 0x03FA ; 0x8003fa 21032: 83 30 cpi r24, 0x03 ; 3 21034: 19 f5 brne .+70 ; 0x2107c 21036: 90 91 a4 0d lds r25, 0x0DA4 ; 0x800da4 2103a: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 2103e: 98 13 cpse r25, r24 21040: 1d c0 rjmp .+58 ; 0x2107c return !pid_tuning_finished; } void preparePidTuning() { // ensure heaters are disabled before we switch off PID management! disable_heater(); 21042: 0f 94 ee 2e call 0x25ddc ; 0x25ddc pid_tuning_finished = false; 21046: 10 92 3e 02 sts 0x023E, r1 ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.458> 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); 2104a: 80 91 4c 02 lds r24, 0x024C ; 0x80024c <_ZL8pid_temp.lto_priv.441+0x1> 2104e: 8f 93 push r24 21050: 80 91 4b 02 lds r24, 0x024B ; 0x80024b <_ZL8pid_temp.lto_priv.441> 21054: 8f 93 push r24 21056: 8e e0 ldi r24, 0x0E ; 14 21058: 9c e8 ldi r25, 0x8C ; 140 2105a: 9f 93 push r25 2105c: 8f 93 push r24 2105e: 0e 94 ce 88 call 0x1119c ; 0x1119c lcd_setstatuspgm(_T(MSG_PID_RUNNING)); 21062: 8e e5 ldi r24, 0x5E ; 94 21064: 9a e4 ldi r25, 0x4A ; 74 21066: 0e 94 c4 72 call 0xe588 ; 0xe588 2106a: 0e 94 38 f1 call 0x1e270 ; 0x1e270 lcd_commands_step = 2; 2106e: 82 e0 ldi r24, 0x02 ; 2 21070: 80 93 fa 03 sts 0x03FA, r24 ; 0x8003fa 21074: 0f 90 pop r0 21076: 0f 90 pop r0 21078: 0f 90 pop r0 2107a: 0f 90 pop r0 } if (lcd_commands_step == 2 && !pidTuningRunning()) { //saving to eeprom 2107c: 80 91 fa 03 lds r24, 0x03FA ; 0x8003fa 21080: 82 30 cpi r24, 0x02 ; 2 21082: 09 f0 breq .+2 ; 0x21086 21084: 7c c0 rjmp .+248 ; 0x2117e 21086: 80 91 3e 02 lds r24, 0x023E ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.458> 2108a: 88 23 and r24, r24 2108c: 09 f4 brne .+2 ; 0x21090 2108e: 77 c0 rjmp .+238 ; 0x2117e custom_message_state = 0; 21090: 10 92 f6 03 sts 0x03F6, r1 ; 0x8003f6 lcd_setstatuspgm(_T(MSG_PID_FINISHED)); 21094: 8a e4 ldi r24, 0x4A ; 74 21096: 9a e4 ldi r25, 0x4A ; 74 21098: 0e 94 c4 72 call 0xe588 ; 0xe588 2109c: 0e 94 38 f1 call 0x1e270 ; 0x1e270 210a0: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 210a4: 10 92 b5 0d sts 0x0DB5, r1 ; 0x800db5 setTargetHotend(0); if (_Kp != 0 || _Ki != 0 || _Kd != 0) { 210a8: 30 91 f2 03 lds r19, 0x03F2 ; 0x8003f2 <_Kp> 210ac: 39 83 std Y+1, r19 ; 0x01 210ae: 80 91 f3 03 lds r24, 0x03F3 ; 0x8003f3 <_Kp+0x1> 210b2: 8b 83 std Y+3, r24 ; 0x03 210b4: 10 91 f4 03 lds r17, 0x03F4 ; 0x8003f4 <_Kp+0x2> 210b8: 00 91 f5 03 lds r16, 0x03F5 ; 0x8003f5 <_Kp+0x3> 210bc: 20 e0 ldi r18, 0x00 ; 0 210be: 30 e0 ldi r19, 0x00 ; 0 210c0: a9 01 movw r20, r18 210c2: b9 81 ldd r27, Y+1 ; 0x01 210c4: f8 01 movw r30, r16 210c6: 6b 2f mov r22, r27 210c8: 78 2f mov r23, r24 210ca: 8f 2f mov r24, r31 210cc: 9e 2f mov r25, r30 210ce: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 210d2: 81 11 cpse r24, r1 210d4: 1f c0 rjmp .+62 ; 0x21114 210d6: 20 e0 ldi r18, 0x00 ; 0 210d8: 30 e0 ldi r19, 0x00 ; 0 210da: a9 01 movw r20, r18 210dc: 60 91 ee 03 lds r22, 0x03EE ; 0x8003ee <_Ki> 210e0: 70 91 ef 03 lds r23, 0x03EF ; 0x8003ef <_Ki+0x1> 210e4: 80 91 f0 03 lds r24, 0x03F0 ; 0x8003f0 <_Ki+0x2> 210e8: 90 91 f1 03 lds r25, 0x03F1 ; 0x8003f1 <_Ki+0x3> 210ec: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 210f0: 81 11 cpse r24, r1 210f2: 10 c0 rjmp .+32 ; 0x21114 210f4: 20 e0 ldi r18, 0x00 ; 0 210f6: 30 e0 ldi r19, 0x00 ; 0 210f8: a9 01 movw r20, r18 210fa: 60 91 ea 03 lds r22, 0x03EA ; 0x8003ea <_Kd> 210fe: 70 91 eb 03 lds r23, 0x03EB ; 0x8003eb <_Kd+0x1> 21102: 80 91 ec 03 lds r24, 0x03EC ; 0x8003ec <_Kd+0x2> 21106: 90 91 ed 03 lds r25, 0x03ED ; 0x8003ed <_Kd+0x3> 2110a: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 2110e: 88 23 and r24, r24 21110: 09 f4 brne .+2 ; 0x21114 21112: 47 c2 rjmp .+1166 ; 0x215a2 enquecommandf_P(PSTR("M301 P%.2f I%.2f D%.2f"), _Kp, _Ki, _Kd); 21114: 80 91 ed 03 lds r24, 0x03ED ; 0x8003ed <_Kd+0x3> 21118: 8f 93 push r24 2111a: 80 91 ec 03 lds r24, 0x03EC ; 0x8003ec <_Kd+0x2> 2111e: 8f 93 push r24 21120: 80 91 eb 03 lds r24, 0x03EB ; 0x8003eb <_Kd+0x1> 21124: 8f 93 push r24 21126: 80 91 ea 03 lds r24, 0x03EA ; 0x8003ea <_Kd> 2112a: 8f 93 push r24 2112c: 80 91 f1 03 lds r24, 0x03F1 ; 0x8003f1 <_Ki+0x3> 21130: 8f 93 push r24 21132: 80 91 f0 03 lds r24, 0x03F0 ; 0x8003f0 <_Ki+0x2> 21136: 8f 93 push r24 21138: 80 91 ef 03 lds r24, 0x03EF ; 0x8003ef <_Ki+0x1> 2113c: 8f 93 push r24 2113e: 80 91 ee 03 lds r24, 0x03EE ; 0x8003ee <_Ki> 21142: 8f 93 push r24 21144: 0f 93 push r16 21146: 1f 93 push r17 21148: 9b 81 ldd r25, Y+3 ; 0x03 2114a: 9f 93 push r25 2114c: 29 81 ldd r18, Y+1 ; 0x01 2114e: 2f 93 push r18 21150: 87 ef ldi r24, 0xF7 ; 247 21152: 9b e8 ldi r25, 0x8B ; 139 21154: 9f 93 push r25 21156: 8f 93 push r24 21158: 0e 94 ce 88 call 0x1119c ; 0x1119c enquecommand_P(MSG_M500); 2115c: 61 e0 ldi r22, 0x01 ; 1 2115e: 84 e2 ldi r24, 0x24 ; 36 21160: 9c e6 ldi r25, 0x6C ; 108 21162: 0e 94 38 88 call 0x11070 ; 0x11070 21166: 0f b6 in r0, 0x3f ; 63 21168: f8 94 cli 2116a: de bf out 0x3e, r29 ; 62 2116c: 0f be out 0x3f, r0 ; 63 2116e: cd bf out 0x3d, r28 ; 61 } else { SERIAL_ECHOPGM("Invalid PID cal. results. Not stored to EEPROM."); } display_time.start(); 21170: 87 ee ldi r24, 0xE7 ; 231 21172: 93 e0 ldi r25, 0x03 ; 3 21174: 0f 94 83 29 call 0x25306 ; 0x25306 ::start()> lcd_commands_step = 1; 21178: 81 e0 ldi r24, 0x01 ; 1 2117a: 80 93 fa 03 sts 0x03FA, r24 ; 0x8003fa } if ((lcd_commands_step == 1) && display_time.expired(2000)) { //calibration finished message 2117e: 80 91 fa 03 lds r24, 0x03FA ; 0x8003fa 21182: 81 30 cpi r24, 0x01 ; 1 21184: d9 f4 brne .+54 ; 0x211bc 21186: 60 ed ldi r22, 0xD0 ; 208 21188: 77 e0 ldi r23, 0x07 ; 7 2118a: 87 ee ldi r24, 0xE7 ; 231 2118c: 93 e0 ldi r25, 0x03 ; 3 2118e: 0f 94 54 29 call 0x252a8 ; 0x252a8 ::expired(unsigned short)> 21192: 88 23 and r24, r24 21194: 99 f0 breq .+38 ; 0x211bc lcd_setstatuspgm(MSG_WELCOME); 21196: 86 eb ldi r24, 0xB6 ; 182 21198: 90 e7 ldi r25, 0x70 ; 112 2119a: 0e 94 38 f1 call 0x1e270 ; 0x1e270 custom_message_type = CustomMsg::Status; 2119e: 10 92 c3 06 sts 0x06C3, r1 ; 0x8006c3 pid_temp = DEFAULT_PID_TEMP; 211a2: 82 ed ldi r24, 0xD2 ; 210 211a4: 90 e0 ldi r25, 0x00 ; 0 211a6: 90 93 4c 02 sts 0x024C, r25 ; 0x80024c <_ZL8pid_temp.lto_priv.441+0x1> 211aa: 80 93 4b 02 sts 0x024B, r24 ; 0x80024b <_ZL8pid_temp.lto_priv.441> lcd_commands_step = 0; 211ae: 10 92 fa 03 sts 0x03FA, r1 ; 0x8003fa lcd_commands_type = LcdCommands::Idle; 211b2: 10 92 b3 0d sts 0x0DB3, r1 ; 0x800db3 211b6: 82 e0 ldi r24, 0x02 ; 2 211b8: 80 93 b7 0d sts 0x0DB7, r24 ; 0x800db7 <_ZL13printer_state.lto_priv.401> SetPrinterState(PrinterState::Idle); } } #ifdef THERMAL_MODEL if (lcd_commands_type == LcdCommands::ThermalModel && cmd_buffer_empty()) 211bc: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 211c0: 95 30 cpi r25, 0x05 ; 5 211c2: 99 f4 brne .+38 ; 0x211ea 211c4: 20 91 a2 10 lds r18, 0x10A2 ; 0x8010a2 211c8: 30 91 a3 10 lds r19, 0x10A3 ; 0x8010a3 211cc: 23 2b or r18, r19 211ce: 71 f5 brne .+92 ; 0x2122c { switch (lcd_commands_step) 211d0: 80 91 fa 03 lds r24, 0x03FA ; 0x8003fa 211d4: 82 30 cpi r24, 0x02 ; 2 211d6: 09 f4 brne .+2 ; 0x211da 211d8: 0d c2 rjmp .+1050 ; 0x215f4 211da: 08 f0 brcs .+2 ; 0x211de 211dc: e7 c1 rjmp .+974 ; 0x215ac 211de: 88 23 and r24, r24 211e0: 09 f4 brne .+2 ; 0x211e4 211e2: f8 c1 rjmp .+1008 ; 0x215d4 211e4: 81 30 cpi r24, 0x01 ; 1 211e6: 09 f4 brne .+2 ; 0x211ea 211e8: 10 c2 rjmp .+1056 ; 0x2160a break; } } #endif //THERMAL_MODEL if (lcd_commands_type == LcdCommands::NozzleCNG) 211ea: 80 91 b3 0d lds r24, 0x0DB3 ; 0x800db3 211ee: 86 30 cpi r24, 0x06 ; 6 211f0: e9 f4 brne .+58 ; 0x2122c 211f2: 90 91 a4 0d lds r25, 0x0DA4 ; 0x800da4 211f6: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 { if (!blocks_queued() && cmd_buffer_empty() && !saved_printing) 211fa: 98 13 cpse r25, r24 211fc: 17 c0 rjmp .+46 ; 0x2122c 211fe: 80 91 a2 10 lds r24, 0x10A2 ; 0x8010a2 21202: 90 91 a3 10 lds r25, 0x10A3 ; 0x8010a3 21206: 89 2b or r24, r25 21208: 89 f4 brne .+34 ; 0x2122c 2120a: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 2120e: 81 11 cpse r24, r1 21210: 0d c0 rjmp .+26 ; 0x2122c #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) 21212: 80 91 fa 03 lds r24, 0x03FA ; 0x8003fa 21216: 81 30 cpi r24, 0x01 ; 1 21218: 09 f4 brne .+2 ; 0x2121c 2121a: 4c c2 rjmp .+1176 ; 0x216b4 2121c: 08 f4 brcc .+2 ; 0x21220 2121e: 0f c2 rjmp .+1054 ; 0x2163e 21220: 82 30 cpi r24, 0x02 ; 2 21222: 09 f4 brne .+2 ; 0x21226 21224: 2e c2 rjmp .+1116 ; 0x21682 21226: 83 30 cpi r24, 0x03 ; 3 21228: 09 f4 brne .+2 ; 0x2122c 2122a: 0d c2 rjmp .+1050 ; 0x21646 menu_depth = 3; break; } } } } 2122c: 0f 90 pop r0 2122e: 0f 90 pop r0 21230: 0f 90 pop r0 21232: 0f 90 pop r0 21234: 0f 90 pop r0 21236: df 91 pop r29 21238: cf 91 pop r28 2123a: 1f 91 pop r17 2123c: 0f 91 pop r16 2123e: ff 90 pop r15 21240: ef 90 pop r14 21242: df 90 pop r13 21244: cf 90 pop r12 21246: bf 90 pop r11 21248: af 90 pop r10 2124a: 9f 90 pop r9 2124c: 8f 90 pop r8 2124e: 7f 90 pop r7 21250: 6f 90 pop r6 21252: 5f 90 pop r5 21254: 4f 90 pop r4 21256: 3f 90 pop r3 21258: 2f 90 pop r2 2125a: 08 95 ret break; case 11: extraPurgeNeeded = lay1cal_load_filament(lay1cal_filament); break; case 10: lcd_clear(); 2125c: 0e 94 2b 6f call 0xde56 ; 0xde56 menu_depth = 0; 21260: 10 92 f7 03 sts 0x03F7, r1 ; 0x8003f7 menu_submenu(lcd_babystep_z, true); 21264: 61 e0 ldi r22, 0x01 ; 1 21266: 8a e7 ldi r24, 0x7A ; 122 21268: 99 e3 ldi r25, 0x39 ; 57 2126a: 0f 94 be d2 call 0x3a57c ; 0x3a57c cmd_intro_mmu_10, cmd_intro_mmu_11, cmd_intro_mmu_12, }; if (MMU2::mmu2.Enabled()) 2126e: 80 91 b9 13 lds r24, 0x13B9 ; 0x8013b9 21272: 81 30 cpi r24, 0x01 ; 1 21274: f1 f4 brne .+60 ; 0x212b2 { for (uint8_t i = (extraPurgeNeeded ? 0 : 2); i < (sizeof(intro_mmu_cmd)/sizeof(intro_mmu_cmd[0])); ++i) 21276: 80 91 f8 03 lds r24, 0x03F8 ; 0x8003f8 2127a: 10 e0 ldi r17, 0x00 ; 0 2127c: 81 11 cpse r24, r1 2127e: 01 c0 rjmp .+2 ; 0x21282 21280: 12 e0 ldi r17, 0x02 ; 2 21282: 21 2f mov r18, r17 21284: 30 e0 ldi r19, 0x00 ; 0 21286: 22 0f add r18, r18 21288: 33 1f adc r19, r19 2128a: 2a 5b subi r18, 0xBA ; 186 2128c: 34 47 sbci r19, 0x74 ; 116 2128e: 3a 83 std Y+2, r19 ; 0x02 21290: 29 83 std Y+1, r18 ; 0x01 { enquecommand_P(static_cast(pgm_read_ptr(&intro_mmu_cmd[i]))); 21292: e9 81 ldd r30, Y+1 ; 0x01 21294: fa 81 ldd r31, Y+2 ; 0x02 21296: 85 91 lpm r24, Z+ 21298: 94 91 lpm r25, Z 2129a: 61 e0 ldi r22, 0x01 ; 1 2129c: 0e 94 38 88 call 0x11070 ; 0x11070 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) 212a0: 1f 5f subi r17, 0xFF ; 255 212a2: 89 81 ldd r24, Y+1 ; 0x01 212a4: 9a 81 ldd r25, Y+2 ; 0x02 212a6: 02 96 adiw r24, 0x02 ; 2 212a8: 9a 83 std Y+2, r25 ; 0x02 212aa: 89 83 std Y+1, r24 ; 0x01 212ac: 1a 30 cpi r17, 0x0A ; 10 212ae: 89 f7 brne .-30 ; 0x21292 212b0: ac ce rjmp .-680 ; 0x2100a } } 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)); 212b2: 20 e0 ldi r18, 0x00 ; 0 212b4: 30 e0 ldi r19, 0x00 ; 0 212b6: 40 e8 ldi r20, 0x80 ; 128 212b8: 50 e4 ldi r21, 0x40 ; 64 212ba: c7 01 movw r24, r14 212bc: b6 01 movw r22, r12 212be: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 212c2: 20 e0 ldi r18, 0x00 ; 0 212c4: 30 e0 ldi r19, 0x00 ; 0 212c6: 40 e7 ldi r20, 0x70 ; 112 212c8: 52 e4 ldi r21, 0x42 ; 66 212ca: 0f 94 7c 86 call 0x30cf8 ; 0x30cf8 212ce: 9f 93 push r25 212d0: 8f 93 push r24 212d2: 7f 93 push r23 212d4: 6f 93 push r22 212d6: 1f 92 push r1 212d8: 8c e3 ldi r24, 0x3C ; 60 212da: 8f 93 push r24 212dc: 22 e3 ldi r18, 0x32 ; 50 212de: 3b e8 ldi r19, 0x8B ; 139 212e0: 3f 93 push r19 212e2: 2f 93 push r18 212e4: 0e 94 ce 88 call 0x1119c ; 0x1119c enquecommandf_P(fmt1, 100, count_e(layer_height, extrusion_width * 8.f, 40)); 212e8: 20 e0 ldi r18, 0x00 ; 0 212ea: 30 e0 ldi r19, 0x00 ; 0 212ec: 40 e0 ldi r20, 0x00 ; 0 212ee: 51 e4 ldi r21, 0x41 ; 65 212f0: c7 01 movw r24, r14 212f2: b6 01 movw r22, r12 212f4: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 212f8: 20 e0 ldi r18, 0x00 ; 0 212fa: 30 e0 ldi r19, 0x00 ; 0 212fc: 40 e2 ldi r20, 0x20 ; 32 212fe: 52 e4 ldi r21, 0x42 ; 66 21300: 0f 94 7c 86 call 0x30cf8 ; 0x30cf8 21304: 9f 93 push r25 21306: 8f 93 push r24 21308: 7f 93 push r23 2130a: 6f 93 push r22 2130c: 1f 92 push r1 2130e: 84 e6 ldi r24, 0x64 ; 100 21310: 8f 93 push r24 21312: 22 e3 ldi r18, 0x32 ; 50 21314: 3b e8 ldi r19, 0x8B ; 139 21316: 3f 93 push r19 21318: 2f 93 push r18 2131a: 0e 94 ce 88 call 0x1119c ; 0x1119c 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)); 2131e: 0f b6 in r0, 0x3f ; 63 21320: f8 94 cli 21322: de bf out 0x3e, r29 ; 62 21324: 0f be out 0x3f, r0 ; 63 21326: cd bf out 0x3d, r28 ; 61 21328: 70 ce rjmp .-800 ; 0x2100a 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]))); 2132a: 67 e0 ldi r22, 0x07 ; 7 2132c: 84 e2 ldi r24, 0x24 ; 36 2132e: 9b e8 ldi r25, 0x8B ; 139 21330: 35 ce rjmp .-918 ; 0x20f9c } //! @brief Print meander start void lay1cal_meander_start(float layer_height, float extrusion_width) { enquecommand_P(PSTR("G1 X50 Y155")); 21332: 61 e0 ldi r22, 0x01 ; 1 21334: 88 e1 ldi r24, 0x18 ; 24 21336: 9b e8 ldi r25, 0x8B ; 139 21338: 0e 94 38 88 call 0x11070 ; 0x11070 static const char fmt1[] PROGMEM = "G1 Z%-.3f F7200"; enquecommandf_P(fmt1, layer_height); 2133c: 8e e3 ldi r24, 0x3E ; 62 2133e: 8f 93 push r24 21340: 8c e4 ldi r24, 0x4C ; 76 21342: 8f 93 push r24 21344: 8c ec ldi r24, 0xCC ; 204 21346: 8f 93 push r24 21348: 8d ec ldi r24, 0xCD ; 205 2134a: 8f 93 push r24 2134c: 88 e0 ldi r24, 0x08 ; 8 2134e: 9b e8 ldi r25, 0x8B ; 139 21350: 9f 93 push r25 21352: 8f 93 push r24 21354: 0e 94 ce 88 call 0x1119c ; 0x1119c enquecommand_P(PSTR("G1 F1080")); 21358: 61 e0 ldi r22, 0x01 ; 1 2135a: 8f ef ldi r24, 0xFF ; 255 2135c: 9a e8 ldi r25, 0x8A ; 138 2135e: 0e 94 38 88 call 0x11070 ; 0x11070 enquecommandf_P(extrude_fmt, 75, 155, count_e(layer_height, extrusion_width * 4.f, 25)); 21362: 20 e0 ldi r18, 0x00 ; 0 21364: 30 e0 ldi r19, 0x00 ; 0 21366: 40 e8 ldi r20, 0x80 ; 128 21368: 50 e4 ldi r21, 0x40 ; 64 2136a: c7 01 movw r24, r14 2136c: b6 01 movw r22, r12 2136e: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 21372: 20 e0 ldi r18, 0x00 ; 0 21374: 30 e0 ldi r19, 0x00 ; 0 21376: 48 ec ldi r20, 0xC8 ; 200 21378: 51 e4 ldi r21, 0x41 ; 65 2137a: 0f 94 7c 86 call 0x30cf8 ; 0x30cf8 2137e: 9f 93 push r25 21380: 8f 93 push r24 21382: 7f 93 push r23 21384: 6f 93 push r22 21386: 1f 92 push r1 21388: 1b e9 ldi r17, 0x9B ; 155 2138a: 1f 93 push r17 2138c: 1f 92 push r1 2138e: 8b e4 ldi r24, 0x4B ; 75 21390: 8f 93 push r24 21392: 8d ee ldi r24, 0xED ; 237 21394: 9a e8 ldi r25, 0x8A ; 138 21396: 9f 93 push r25 21398: 8f 93 push r24 2139a: 0e 94 ce 88 call 0x1119c ; 0x1119c enquecommandf_P(extrude_fmt, 100, 155, count_e(layer_height, extrusion_width * 2.f, 25)); 2139e: a7 01 movw r20, r14 213a0: 96 01 movw r18, r12 213a2: c7 01 movw r24, r14 213a4: b6 01 movw r22, r12 213a6: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 213aa: 20 e0 ldi r18, 0x00 ; 0 213ac: 30 e0 ldi r19, 0x00 ; 0 213ae: 48 ec ldi r20, 0xC8 ; 200 213b0: 51 e4 ldi r21, 0x41 ; 65 213b2: 0f 94 7c 86 call 0x30cf8 ; 0x30cf8 213b6: 9f 93 push r25 213b8: 8f 93 push r24 213ba: 7f 93 push r23 213bc: 6f 93 push r22 213be: 1f 92 push r1 213c0: 1f 93 push r17 213c2: 1f 92 push r1 213c4: 84 e6 ldi r24, 0x64 ; 100 213c6: 8f 93 push r24 213c8: 8d ee ldi r24, 0xED ; 237 213ca: 9a e8 ldi r25, 0x8A ; 138 213cc: 9f 93 push r25 213ce: 8f 93 push r24 213d0: 0e 94 ce 88 call 0x1119c ; 0x1119c enquecommandf_P(extrude_fmt, 200, 155, count_e(layer_height, extrusion_width, 100)); 213d4: 20 e0 ldi r18, 0x00 ; 0 213d6: 30 e0 ldi r19, 0x00 ; 0 213d8: 48 ec ldi r20, 0xC8 ; 200 213da: 52 e4 ldi r21, 0x42 ; 66 213dc: c7 01 movw r24, r14 213de: b6 01 movw r22, r12 213e0: 0f 94 7c 86 call 0x30cf8 ; 0x30cf8 213e4: 9f 93 push r25 213e6: 8f 93 push r24 213e8: 7f 93 push r23 213ea: 6f 93 push r22 213ec: 1f 92 push r1 213ee: 1f 93 push r17 213f0: 1f 92 push r1 213f2: 18 ec ldi r17, 0xC8 ; 200 213f4: 1f 93 push r17 213f6: 8d ee ldi r24, 0xED ; 237 213f8: 9a e8 ldi r25, 0x8A ; 138 213fa: 9f 93 push r25 213fc: 8f 93 push r24 213fe: 0e 94 ce 88 call 0x1119c ; 0x1119c enquecommandf_P(extrude_fmt, 200, 135, count_e(layer_height, extrusion_width, 20)); 21402: 0f b6 in r0, 0x3f ; 63 21404: f8 94 cli 21406: de bf out 0x3e, r29 ; 62 21408: 0f be out 0x3f, r0 ; 63 2140a: cd bf out 0x3d, r28 ; 61 2140c: 20 e0 ldi r18, 0x00 ; 0 2140e: 30 e0 ldi r19, 0x00 ; 0 21410: 40 ea ldi r20, 0xA0 ; 160 21412: 51 e4 ldi r21, 0x41 ; 65 21414: c7 01 movw r24, r14 21416: b6 01 movw r22, r12 21418: 0f 94 7c 86 call 0x30cf8 ; 0x30cf8 2141c: 9f 93 push r25 2141e: 8f 93 push r24 21420: 7f 93 push r23 21422: 6f 93 push r22 21424: 1f 92 push r1 21426: 87 e8 ldi r24, 0x87 ; 135 21428: 8f 93 push r24 2142a: 1f 92 push r1 2142c: 1f 93 push r17 2142e: 2d ee ldi r18, 0xED ; 237 21430: 3a e8 ldi r19, 0x8A ; 138 21432: 3f 93 push r19 21434: 2f 93 push r18 21436: 0e 94 ce 88 call 0x1119c ; 0x1119c 2143a: 71 cf rjmp .-286 ; 0x2131e //! @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); 2143c: 20 e0 ldi r18, 0x00 ; 0 2143e: 30 e0 ldi r19, 0x00 ; 0 21440: 46 e1 ldi r20, 0x16 ; 22 21442: 53 e4 ldi r21, 0x43 ; 67 21444: c7 01 movw r24, r14 21446: b6 01 movw r22, r12 21448: 0f 94 7c 86 call 0x30cf8 ; 0x30cf8 2144c: 56 2e mov r5, r22 2144e: 47 2e mov r4, r23 21450: 38 2e mov r3, r24 21452: 29 2e mov r2, r25 const float short_extrusion = count_e(layer_height, extrusion_width, short_length); 21454: 20 e0 ldi r18, 0x00 ; 0 21456: 30 e0 ldi r19, 0x00 ; 0 21458: 40 ea ldi r20, 0xA0 ; 160 2145a: 51 e4 ldi r21, 0x41 ; 65 2145c: c7 01 movw r24, r14 2145e: b6 01 movw r22, r12 21460: 0f 94 7c 86 call 0x30cf8 ; 0x30cf8 21464: 6b 83 std Y+3, r22 ; 0x03 21466: c7 2e mov r12, r23 21468: 78 2e mov r7, r24 2146a: 69 2e mov r6, r25 2146c: 85 e0 ldi r24, 0x05 ; 5 2146e: 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; 21470: 81 2c mov r8, r1 21472: 91 2c mov r9, r1 21474: 96 e1 ldi r25, 0x16 ; 22 21476: a9 2e mov r10, r25 21478: 93 e4 ldi r25, 0x43 ; 67 2147a: 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; 2147c: 32 e3 ldi r19, 0x32 ; 50 2147e: 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; 21480: 87 e8 ldi r24, 0x87 ; 135 21482: 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); 21484: 0d ee ldi r16, 0xED ; 237 21486: 1a e8 ldi r17, 0x8A ; 138 21488: 9d 81 ldd r25, Y+5 ; 0x05 2148a: e9 2e mov r14, r25 2148c: f1 2c mov r15, r1 2148e: 3c 81 ldd r19, Y+4 ; 0x04 21490: 23 2f mov r18, r19 21492: 30 e0 ldi r19, 0x00 ; 0 21494: 3a 83 std Y+2, r19 ; 0x02 21496: 29 83 std Y+1, r18 ; 0x01 21498: 2f 92 push r2 2149a: 3f 92 push r3 2149c: 4f 92 push r4 2149e: 5f 92 push r5 214a0: 1f 92 push r1 214a2: 9f 93 push r25 214a4: 1f 92 push r1 214a6: 8c 81 ldd r24, Y+4 ; 0x04 214a8: 8f 93 push r24 214aa: 1f 93 push r17 214ac: 0f 93 push r16 214ae: 0e 94 ce 88 call 0x1119c ; 0x1119c y_pos -= short_length; 214b2: b7 01 movw r22, r14 214b4: ff 0c add r15, r15 214b6: 88 0b sbc r24, r24 214b8: 99 0b sbc r25, r25 214ba: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 214be: 20 e0 ldi r18, 0x00 ; 0 214c0: 30 e0 ldi r19, 0x00 ; 0 214c2: 40 ea ldi r20, 0xA0 ; 160 214c4: 51 e4 ldi r21, 0x41 ; 65 214c6: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 214ca: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 214ce: 6d 83 std Y+5, r22 ; 0x05 enquecommandf_P(extrude_fmt, x_pos, y_pos, short_extrusion); 214d0: 6f 92 push r6 214d2: 7f 92 push r7 214d4: cf 92 push r12 214d6: 9b 81 ldd r25, Y+3 ; 0x03 214d8: 9f 93 push r25 214da: 1f 92 push r1 214dc: 2d 81 ldd r18, Y+5 ; 0x05 214de: 2f 93 push r18 214e0: 1f 92 push r1 214e2: 3c 81 ldd r19, Y+4 ; 0x04 214e4: 3f 93 push r19 214e6: 1f 93 push r17 214e8: 0f 93 push r16 214ea: 0e 94 ce 88 call 0x1119c ; 0x1119c x_pos += long_length; 214ee: 29 81 ldd r18, Y+1 ; 0x01 214f0: 3a 81 ldd r19, Y+2 ; 0x02 214f2: b9 01 movw r22, r18 214f4: 33 0f add r19, r19 214f6: 88 0b sbc r24, r24 214f8: 99 0b sbc r25, r25 214fa: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 214fe: a5 01 movw r20, r10 21500: 94 01 movw r18, r8 21502: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 21506: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 2150a: 6c 83 std Y+4, r22 ; 0x04 long_length = -long_length; 2150c: b7 fa bst r11, 7 2150e: b0 94 com r11 21510: b7 f8 bld r11, 7 21512: b0 94 com r11 21514: 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) 21516: 0f b6 in r0, 0x3f ; 63 21518: f8 94 cli 2151a: de bf out 0x3e, r29 ; 62 2151c: 0f be out 0x3f, r0 ; 63 2151e: cd bf out 0x3d, r28 ; 61 21520: d1 10 cpse r13, r1 21522: b2 cf rjmp .-156 ; 0x21488 21524: 72 cd rjmp .-1308 ; 0x2100a break; case 7: lay1cal_meander(layer_height, extrusion_width); break; case 6: lay1cal_square(0, layer_height, extrusion_width); 21526: b7 01 movw r22, r14 21528: a6 01 movw r20, r12 2152a: 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); 2152c: 0f 94 a3 86 call 0x30d46 ; 0x30d46 21530: 6c cd rjmp .-1320 ; 0x2100a break; case 6: lay1cal_square(0, layer_height, extrusion_width); break; case 5: lay1cal_square(4, layer_height, extrusion_width); 21532: b7 01 movw r22, r14 21534: a6 01 movw r20, r12 21536: 84 e0 ldi r24, 0x04 ; 4 21538: f9 cf rjmp .-14 ; 0x2152c break; case 4: lay1cal_square(8, layer_height, extrusion_width); 2153a: b7 01 movw r22, r14 2153c: a6 01 movw r20, r12 2153e: 88 e0 ldi r24, 0x08 ; 8 21540: f5 cf rjmp .-22 ; 0x2152c break; case 3: lay1cal_square(12, layer_height, extrusion_width); 21542: b7 01 movw r22, r14 21544: a6 01 movw r20, r12 21546: 8c e0 ldi r24, 0x0C ; 12 21548: f1 cf rjmp .-30 ; 0x2152c 2154a: 90 91 b9 13 lds r25, 0x13B9 ; 0x8013b9 2154e: 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]))); 21550: 66 e0 ldi r22, 0x06 ; 6 21552: 81 ee ldi r24, 0xE1 ; 225 21554: 9a e8 ldi r25, 0x8A ; 138 21556: 0e 94 b7 88 call 0x1116e ; 0x1116e if (mmu_enabled) enquecommand_P(MSG_M702); //unload from nozzle 2155a: 29 81 ldd r18, Y+1 ; 0x01 2155c: 21 30 cpi r18, 0x01 ; 1 2155e: 29 f4 brne .+10 ; 0x2156a 21560: 61 e0 ldi r22, 0x01 ; 1 21562: 85 e1 ldi r24, 0x15 ; 21 21564: 9c e6 ldi r25, 0x6C ; 108 21566: 0e 94 38 88 call 0x11070 ; 0x11070 enquecommand_P(MSG_M84);// disable motors 2156a: 61 e0 ldi r22, 0x01 ; 1 2156c: 81 e1 ldi r24, 0x11 ; 17 2156e: 9c e6 ldi r25, 0x6C ; 108 21570: 0e 94 38 88 call 0x11070 ; 0x11070 21574: 4a cd rjmp .-1388 ; 0x2100a break; case 2: lay1cal_finish(MMU2::mmu2.Enabled()); break; case 1: lcd_setstatuspgm(MSG_WELCOME); 21576: 86 eb ldi r24, 0xB6 ; 182 21578: 90 e7 ldi r25, 0x70 ; 112 2157a: 0e 94 38 f1 call 0x1e270 ; 0x1e270 lcd_commands_step = 0; 2157e: 10 92 fa 03 sts 0x03FA, r1 ; 0x8003fa lcd_commands_type = LcdCommands::Idle; 21582: 10 92 b3 0d sts 0x0DB3, r1 ; 0x800db3 21586: 82 e0 ldi r24, 0x02 ; 2 21588: 80 93 b7 0d sts 0x0DB7, r24 ; 0x800db7 <_ZL13printer_state.lto_priv.401> SetPrinterState(PrinterState::Idle); if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 2158c: 8f e5 ldi r24, 0x5F ; 95 2158e: 9f e0 ldi r25, 0x0F ; 15 21590: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 21594: 88 23 and r24, r24 21596: 09 f4 brne .+2 ; 0x2159a 21598: 11 ce rjmp .-990 ; 0x211bc lcd_wizard(WizState::RepeatLay1Cal); 2159a: 8c e0 ldi r24, 0x0C ; 12 2159c: 0e 94 d6 f8 call 0x1f1ac ; 0x1f1ac 215a0: 34 cd rjmp .-1432 ; 0x2100a 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."); 215a2: 87 ec ldi r24, 0xC7 ; 199 215a4: 9b e8 ldi r25, 0x8B ; 139 215a6: 0e 94 68 77 call 0xeed0 ; 0xeed0 215aa: e2 cd rjmp .-1084 ; 0x21170 } #ifdef THERMAL_MODEL if (lcd_commands_type == LcdCommands::ThermalModel && cmd_buffer_empty()) { switch (lcd_commands_step) 215ac: 84 30 cpi r24, 0x04 ; 4 215ae: a9 f0 breq .+42 ; 0x215da 215b0: c0 f0 brcs .+48 ; 0x215e2 215b2: 85 30 cpi r24, 0x05 ; 5 215b4: 09 f0 breq .+2 ; 0x215b8 215b6: 19 ce rjmp .-974 ; 0x211ea case 0: lcd_commands_step = 5; [[fallthrough]]; case 5: enquecommand_P(G28W); 215b8: 61 e0 ldi r22, 0x01 ; 1 215ba: 8e e1 ldi r24, 0x1E ; 30 215bc: 9c e6 ldi r25, 0x6C ; 108 215be: 0e 94 38 88 call 0x11070 ; 0x11070 enquecommand_P(PSTR("G1 X125 Y105 Z1 F8000")); 215c2: 61 e0 ldi r22, 0x01 ; 1 215c4: 81 eb ldi r24, 0xB1 ; 177 215c6: 9b e8 ldi r25, 0x8B ; 139 215c8: 0e 94 38 88 call 0x11070 ; 0x11070 lcd_commands_step = 4; 215cc: 84 e0 ldi r24, 0x04 ; 4 break; case 4: st_synchronize(); lcd_commands_step = 3; 215ce: 80 93 fa 03 sts 0x03FA, r24 ; 0x8003fa 215d2: 0b ce rjmp .-1002 ; 0x211ea if (lcd_commands_type == LcdCommands::ThermalModel && cmd_buffer_empty()) { switch (lcd_commands_step) { case 0: lcd_commands_step = 5; 215d4: 90 93 fa 03 sts 0x03FA, r25 ; 0x8003fa 215d8: ef cf rjmp .-34 ; 0x215b8 enquecommand_P(PSTR("G1 X125 Y105 Z1 F8000")); lcd_commands_step = 4; break; case 4: st_synchronize(); 215da: 0f 94 a3 42 call 0x28546 ; 0x28546 lcd_commands_step = 3; 215de: 83 e0 ldi r24, 0x03 ; 3 215e0: f6 cf rjmp .-20 ; 0x215ce SERIAL_ECHOLNPGM("TM: invalid parameters, cannot enable"); } void thermal_model_set_warn_beep(bool enabled) { thermal_model::warn_beep = enabled; 215e2: 10 92 3d 02 sts 0x023D, r1 ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.455> break; case 3: thermal_model_set_warn_beep(false); enquecommand_P(PSTR("M310 A F1")); 215e6: 61 e0 ldi r22, 0x01 ; 1 215e8: 87 ea ldi r24, 0xA7 ; 167 215ea: 9b e8 ldi r25, 0x8B ; 139 215ec: 0e 94 38 88 call 0x11070 ; 0x11070 lcd_commands_step = 2; 215f0: 82 e0 ldi r24, 0x02 ; 2 215f2: ed cf rjmp .-38 ; 0x215ce break; case 2: if (thermal_model_autotune_result()) 215f4: 80 91 3c 02 lds r24, 0x023C ; 0x80023c <_ZL26thermal_model_autotune_err.lto_priv.536> 215f8: 81 11 cpse r24, r1 215fa: 05 c0 rjmp .+10 ; 0x21606 enquecommand_P(MSG_M500); 215fc: 61 e0 ldi r22, 0x01 ; 1 215fe: 84 e2 ldi r24, 0x24 ; 36 21600: 9c e6 ldi r25, 0x6C ; 108 21602: 0e 94 38 88 call 0x11070 ; 0x11070 lcd_commands_step = 1; 21606: 81 e0 ldi r24, 0x01 ; 1 21608: e2 cf rjmp .-60 ; 0x215ce break; case 1: lcd_commands_step = 0; 2160a: 10 92 fa 03 sts 0x03FA, r1 ; 0x8003fa lcd_commands_type = LcdCommands::Idle; 2160e: 10 92 b3 0d sts 0x0DB3, r1 ; 0x800db3 21612: 92 e0 ldi r25, 0x02 ; 2 21614: 90 93 b7 0d sts 0x0DB7, r25 ; 0x800db7 <_ZL13printer_state.lto_priv.401> 21618: 80 93 3d 02 sts 0x023D, r24 ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.455> SetPrinterState(PrinterState::Idle); thermal_model_set_warn_beep(true); bool res = thermal_model_autotune_result(); if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) { 2161c: 8f e5 ldi r24, 0x5F ; 95 2161e: 9f e0 ldi r25, 0x0F ; 15 21620: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 21624: 88 23 and r24, r24 21626: 09 f4 brne .+2 ; 0x2162a 21628: 01 ce rjmp .-1022 ; 0x2122c // resume the wizard lcd_wizard(res ? WizState::Restore : WizState::Failed); 2162a: 80 91 3c 02 lds r24, 0x023C ; 0x80023c <_ZL26thermal_model_autotune_err.lto_priv.536> 2162e: 81 11 cpse r24, r1 21630: 04 c0 rjmp .+8 ; 0x2163a 21632: 81 e0 ldi r24, 0x01 ; 1 21634: 0e 94 d6 f8 call 0x1f1ac ; 0x1f1ac 21638: d8 cd rjmp .-1104 ; 0x211ea 2163a: 8e e0 ldi r24, 0x0E ; 14 2163c: fb cf rjmp .-10 ; 0x21634 #endif //THERMAL_MODEL #endif //QUICK_NOZZLE_CHANGE switch(lcd_commands_step) { case 0: lcd_commands_step = 3; 2163e: 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; 21640: 80 93 fa 03 sts 0x03FA, r24 ; 0x8003fa 21644: f3 cd rjmp .-1050 ; 0x2122c 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)); 21646: 83 e1 ldi r24, 0x13 ; 19 21648: 9a e4 ldi r25, 0x4A ; 74 2164a: 0e 94 c4 72 call 0xe588 ; 0xe588 2164e: 0f 94 c7 1f call 0x23f8e ; 0x23f8e enquecommand_P(G28W); 21652: 61 e0 ldi r22, 0x01 ; 1 21654: 8e e1 ldi r24, 0x1E ; 30 21656: 9c e6 ldi r25, 0x6C ; 108 21658: 0e 94 38 88 call 0x11070 ; 0x11070 enquecommand_P(PSTR("G1 X125 Z200 F1000")); 2165c: 61 e0 ldi r22, 0x01 ; 1 2165e: 84 e9 ldi r24, 0x94 ; 148 21660: 9b e8 ldi r25, 0x8B ; 139 21662: 0e 94 38 88 call 0x11070 ; 0x11070 enquecommand_P(PSTR("M109 S280")); 21666: 61 e0 ldi r22, 0x01 ; 1 21668: 8a e8 ldi r24, 0x8A ; 138 2166a: 9b e8 ldi r25, 0x8B ; 139 2166c: 0e 94 38 88 call 0x11070 ; 0x11070 #ifdef THERMAL_MODEL was_enabled = thermal_model_enabled(); 21670: 80 91 1c 05 lds r24, 0x051C ; 0x80051c <_ZN13thermal_modelL7enabledE.lto_priv.456> 21674: 80 93 e6 03 sts 0x03E6, r24 ; 0x8003e6 thermal_model_set_enabled(false); 21678: 80 e0 ldi r24, 0x00 ; 0 2167a: 0f 94 0f 32 call 0x2641e ; 0x2641e } } enquecommand_P(G28W); //home enquecommand_P(PSTR("G1 X125 Z200 F1000")); //move to top center #endif //QUICK_NOZZLE_CHANGE lcd_commands_step = 2; 2167e: 82 e0 ldi r24, 0x02 ; 2 21680: df cf rjmp .-66 ; 0x21640 break; case 2: enquecommand_P(PSTR("M84 XY")); 21682: 61 e0 ldi r22, 0x01 ; 1 21684: 83 e8 ldi r24, 0x83 ; 131 21686: 9b e8 ldi r25, 0x8B ; 139 21688: 0e 94 38 88 call 0x11070 ; 0x11070 if (lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_NOZZLE_CNG_CHANGED), false) == LCD_LEFT_BUTTON_CHOICE) { 2168c: 8a ed ldi r24, 0xDA ; 218 2168e: 99 e4 ldi r25, 0x49 ; 73 21690: 0e 94 c4 72 call 0xe588 ; 0xe588 21694: 41 e0 ldi r20, 0x01 ; 1 21696: 60 e0 ldi r22, 0x00 ; 0 21698: 0f 94 fb 4e call 0x29df6 ; 0x29df6 2169c: 81 11 cpse r24, r1 2169e: c6 cd rjmp .-1140 ; 0x2122c 216a0: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 216a4: 10 92 b5 0d sts 0x0DB5, r1 ; 0x800db5 #ifndef QUICK_NOZZLE_CHANGE setTargetHotend(0); #ifdef THERMAL_MODEL thermal_model_set_enabled(was_enabled); 216a8: 80 91 e6 03 lds r24, 0x03E6 ; 0x8003e6 216ac: 0f 94 0f 32 call 0x2641e ; 0x2641e #endif //THERMAL_MODEL #else fanSpeed = 0; //turn off fan #endif //QUICK_NOZZLE_CHANGE lcd_commands_step = 1; 216b0: 81 e0 ldi r24, 0x01 ; 1 216b2: c6 cf rjmp .-116 ; 0x21640 } break; case 1: lcd_commands_step = 0; 216b4: 10 92 fa 03 sts 0x03FA, r1 ; 0x8003fa lcd_commands_type = LcdCommands::Idle; 216b8: 10 92 b3 0d sts 0x0DB3, r1 ; 0x800db3 216bc: 82 e0 ldi r24, 0x02 ; 2 216be: 80 93 b7 0d sts 0x0DB7, r24 ; 0x800db7 <_ZL13printer_state.lto_priv.401> SetPrinterState(PrinterState::Idle); menu_goto(lcd_hw_setup_menu, 2, true); 216c2: 20 e0 ldi r18, 0x00 ; 0 216c4: 41 e0 ldi r20, 0x01 ; 1 216c6: 62 e0 ldi r22, 0x02 ; 2 216c8: 70 e0 ldi r23, 0x00 ; 0 216ca: 81 ed ldi r24, 0xD1 ; 209 216cc: 91 ed ldi r25, 0xD1 ; 209 216ce: 0f 94 7b d1 call 0x3a2f6 ; 0x3a2f6 menu_depth = 3; 216d2: 83 e0 ldi r24, 0x03 ; 3 216d4: 80 93 f7 03 sts 0x03F7, r24 ; 0x8003f7 216d8: a9 cd rjmp .-1198 ; 0x2122c 000216da : && menu_menu != lcd_babystep_z && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); } void menu_lcd_lcdupdate_func(void) { 216da: 0f 93 push r16 216dc: 1f 93 push r17 #if (SDCARDDETECT > 0) if ((IS_SD_INSERTED != lcd_oldcardstatus)) 216de: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 216e2: 80 95 com r24 216e4: 81 70 andi r24, 0x01 ; 1 216e6: 90 91 11 04 lds r25, 0x0411 ; 0x800411 216ea: 89 17 cp r24, r25 216ec: a1 f1 breq .+104 ; 0x21756 { if(menu_menu == lcd_sdcard_menu) { 216ee: 80 91 12 04 lds r24, 0x0412 ; 0x800412 216f2: 90 91 13 04 lds r25, 0x0413 ; 0x800413 216f6: 89 54 subi r24, 0x49 ; 73 216f8: 91 4f sbci r25, 0xF1 ; 241 216fa: 11 f4 brne .+4 ; 0x21700 // 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(); 216fc: 0f 94 19 d4 call 0x3a832 ; 0x3a832 } lcd_draw_update = 2; 21700: 82 e0 ldi r24, 0x02 ; 2 21702: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d lcd_oldcardstatus = IS_SD_INSERTED; 21706: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2170a: 80 95 com r24 2170c: 81 70 andi r24, 0x01 ; 1 2170e: 80 93 11 04 sts 0x0411, r24 ; 0x800411 lcd_refresh(); // to maybe revive the LCD if static electricity killed it. 21712: 0e 94 a4 6f call 0xdf48 ; 0xdf48 backlight_wake(); 21716: 80 e0 ldi r24, 0x00 ; 0 21718: 0e 94 85 8a call 0x1150a ; 0x1150a if (lcd_oldcardstatus) 2171c: 80 91 11 04 lds r24, 0x0411 ; 0x800411 21720: 88 23 and r24, r24 21722: 09 f4 brne .+2 ; 0x21726 21724: 71 c0 rjmp .+226 ; 0x21808 { if (!card.mounted) 21726: 80 91 90 14 lds r24, 0x1490 ; 0x801490 2172a: 81 11 cpse r24, r1 2172c: 05 c0 rjmp .+10 ; 0x21738 { card.mount(false); //delay the sorting to the sd menu. Otherwise, removing the SD card while sorting will not menu_back() 2172e: 0f 94 7d 80 call 0x300fa ; 0x300fa card.presort_flag = true; //force sorting of the SD menu 21732: 81 e0 ldi r24, 0x01 ; 1 21734: 80 93 de 14 sts 0x14DE, r24 ; 0x8014de } LCD_MESSAGERPGM(MSG_WELCOME); 21738: 86 eb ldi r24, 0xB6 ; 182 2173a: 90 e7 ldi r25, 0x70 ; 112 2173c: 0e 94 38 f1 call 0x1e270 ; 0x1e270 bMain=false; // flag (i.e. 'fake parameter') for 'lcd_sdcard_menu()' function 21740: 10 92 df 03 sts 0x03DF, r1 ; 0x8003df menu_submenu(lcd_sdcard_menu, true); 21744: 61 e0 ldi r22, 0x01 ; 1 21746: 89 e4 ldi r24, 0x49 ; 73 21748: 91 ef ldi r25, 0xF1 ; 241 2174a: 0f 94 be d2 call 0x3a57c ; 0x3a57c lcd_timeoutToStatus.start(); 2174e: 8a ed ldi r24, 0xDA ; 218 21750: 93 e0 ldi r25, 0x03 ; 3 21752: 0f 94 c5 2b call 0x2578a ; 0x2578a ::start()> card.release(); LCD_MESSAGERPGM(_T(MSG_SD_REMOVED)); } } #endif//CARDINSERTED if (lcd_next_update_millis < _millis()) 21756: 0f 94 22 29 call 0x25244 ; 0x25244 2175a: 00 91 d6 03 lds r16, 0x03D6 ; 0x8003d6 2175e: 10 91 d7 03 lds r17, 0x03D7 ; 0x8003d7 21762: 20 91 d8 03 lds r18, 0x03D8 ; 0x8003d8 21766: 30 91 d9 03 lds r19, 0x03D9 ; 0x8003d9 2176a: 06 17 cp r16, r22 2176c: 17 07 cpc r17, r23 2176e: 28 07 cpc r18, r24 21770: 39 07 cpc r19, r25 21772: e8 f5 brcc .+122 ; 0x217ee { if (lcd_draw_update) { 21774: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 21778: 88 23 and r24, r24 2177a: 31 f0 breq .+12 ; 0x21788 lcd_timeoutToStatus.start(); 2177c: 8a ed ldi r24, 0xDA ; 218 2177e: 93 e0 ldi r25, 0x03 ; 3 21780: 0f 94 c5 2b call 0x2578a ; 0x2578a ::start()> lcd_frame_start(); 21784: 0e 94 ac 6e call 0xdd58 ; 0xdd58 } (*menu_menu)(); 21788: e0 91 12 04 lds r30, 0x0412 ; 0x800412 2178c: f0 91 13 04 lds r31, 0x0413 ; 0x800413 21790: 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)))); 21792: 80 91 12 04 lds r24, 0x0412 ; 0x800412 21796: 90 91 13 04 lds r25, 0x0413 ; 0x800413 2179a: 8a 57 subi r24, 0x7A ; 122 2179c: 99 43 sbci r25, 0x39 ; 57 2179e: 09 f4 brne .+2 ; 0x217a2 217a0: 46 c0 rjmp .+140 ; 0x2182e } static inline bool other_menu_expired() { return (menu_menu != lcd_status_screen 217a2: 80 91 12 04 lds r24, 0x0412 ; 0x800412 217a6: 90 91 13 04 lds r25, 0x0413 ; 0x800413 && menu_menu != lcd_babystep_z && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); 217aa: 2a e3 ldi r18, 0x3A ; 58 217ac: 86 34 cpi r24, 0x46 ; 70 217ae: 92 07 cpc r25, r18 217b0: 09 f0 breq .+2 ; 0x217b4 217b2: 5e c0 rjmp .+188 ; 0x21870 } lcd_clear(); lcd_return_to_status(); lcd_draw_update = 2; } if (lcd_draw_update == 2) lcdui_refresh(); 217b4: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 217b8: 82 30 cpi r24, 0x02 ; 2 217ba: 21 f4 brne .+8 ; 0x217c4 #endif //DEBUG_DISABLE_LCD_STATUS_LINE } static void lcdui_refresh(uint8_t clear = true) { clear ? lcd_refresh() : lcd_refresh_noclear(); 217bc: 0e 94 a4 6f call 0xdf48 ; 0xdf48 lcd_status_message_idx = 0; // Re-draw message from beginning 217c0: 10 92 1d 05 sts 0x051D, r1 ; 0x80051d <_ZL22lcd_status_message_idx.lto_priv.448> lcd_clear(); lcd_return_to_status(); lcd_draw_update = 2; } if (lcd_draw_update == 2) lcdui_refresh(); if (lcd_draw_update) lcd_draw_update--; 217c4: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 217c8: 88 23 and r24, r24 217ca: 19 f0 breq .+6 ; 0x217d2 217cc: 81 50 subi r24, 0x01 ; 1 217ce: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d lcd_next_update_millis = _millis() + LCD_UPDATE_INTERVAL; 217d2: 0f 94 22 29 call 0x25244 ; 0x25244 217d6: 6c 59 subi r22, 0x9C ; 156 217d8: 7f 4f sbci r23, 0xFF ; 255 217da: 8f 4f sbci r24, 0xFF ; 255 217dc: 9f 4f sbci r25, 0xFF ; 255 217de: 60 93 d6 03 sts 0x03D6, r22 ; 0x8003d6 217e2: 70 93 d7 03 sts 0x03D7, r23 ; 0x8003d7 217e6: 80 93 d8 03 sts 0x03D8, r24 ; 0x8003d8 217ea: 90 93 d9 03 sts 0x03D9, r25 ; 0x8003d9 } prusa_statistics_update_from_lcd_update(); if (lcd_commands_type == LcdCommands::Layer1Cal) lcd_commands(); 217ee: 80 91 b3 0d lds r24, 0x0DB3 ; 0x800db3 217f2: 84 30 cpi r24, 0x04 ; 4 217f4: 09 f0 breq .+2 ; 0x217f8 217f6: 53 c0 rjmp .+166 ; 0x2189e 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) { 217f8: 80 91 ab 0d lds r24, 0x0DAB ; 0x800dab 217fc: 81 11 cpse r24, r1 217fe: 4f c0 rjmp .+158 ; 0x2189e 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(); } 21800: 1f 91 pop r17 21802: 0f 91 pop r16 21804: 0d 94 67 06 jmp 0x20cce ; 0x20cce presort_flag = true; #endif } void CardReader::release() { sdprinting = false; 21808: 10 92 8f 14 sts 0x148F, r1 ; 0x80148f mounted = false; 2180c: 10 92 90 14 sts 0x1490, r1 ; 0x801490 SERIAL_ECHO_START; 21810: 82 ef ldi r24, 0xF2 ; 242 21812: 9b ea ldi r25, 0xAB ; 171 21814: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED 21818: 82 ed ldi r24, 0xD2 ; 210 2181a: 9b e6 ldi r25, 0x6B ; 107 2181c: 0e 94 93 79 call 0xf326 ; 0xf326 lcd_timeoutToStatus.start(); } else { card.release(); LCD_MESSAGERPGM(_T(MSG_SD_REMOVED)); 21820: 8d ea ldi r24, 0xAD ; 173 21822: 99 e4 ldi r25, 0x49 ; 73 21824: 0e 94 c4 72 call 0xe588 ; 0xe588 21828: 0e 94 38 f1 call 0x1e270 ; 0x1e270 2182c: 94 cf rjmp .-216 ; 0x21756 // 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)))); 2182e: 0e 94 b7 67 call 0xcf6e ; 0xcf6e 21832: 81 11 cpse r24, r1 21834: 0e c0 rjmp .+28 ; 0x21852 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) 21836: e0 91 12 04 lds r30, 0x0412 ; 0x800412 2183a: f0 91 13 04 lds r31, 0x0413 ; 0x800413 2183e: 30 97 sbiw r30, 0x00 ; 0 21840: 39 f5 brne .+78 ; 0x21890 { menu_leaving = 1; (*menu_menu)(); menu_leaving = 0; } lcd_clear(); 21842: 0e 94 2b 6f call 0xde56 ; 0xde56 lcd_return_to_status(); 21846: 0f 94 7c 1e call 0x23cf8 ; 0x23cf8 lcd_draw_update = 2; 2184a: 82 e0 ldi r24, 0x02 ; 2 2184c: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d 21850: b1 cf rjmp .-158 ; 0x217b4 // 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)))); 21852: 80 91 b3 0d lds r24, 0x0DB3 ; 0x800db3 21856: 81 11 cpse r24, r1 21858: a4 cf rjmp .-184 ; 0x217a2 2185a: 40 e9 ldi r20, 0x90 ; 144 2185c: 5f e5 ldi r21, 0x5F ; 95 2185e: 61 e0 ldi r22, 0x01 ; 1 21860: 70 e0 ldi r23, 0x00 ; 0 21862: 8a ed ldi r24, 0xDA ; 218 21864: 93 e0 ldi r25, 0x03 ; 3 21866: 0f 94 06 2a call 0x2540c ; 0x2540c ::expired(unsigned long)> 2186a: 81 11 cpse r24, r1 2186c: e4 cf rjmp .-56 ; 0x21836 2186e: 99 cf rjmp .-206 ; 0x217a2 } static inline bool other_menu_expired() { return (menu_menu != lcd_status_screen && menu_menu != lcd_babystep_z 21870: 8a 57 subi r24, 0x7A ; 122 21872: 99 43 sbci r25, 0x39 ; 57 21874: 09 f4 brne .+2 ; 0x21878 21876: 9e cf rjmp .-196 ; 0x217b4 && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); 21878: 40 e3 ldi r20, 0x30 ; 48 2187a: 55 e7 ldi r21, 0x75 ; 117 2187c: 60 e0 ldi r22, 0x00 ; 0 2187e: 70 e0 ldi r23, 0x00 ; 0 21880: 8a ed ldi r24, 0xDA ; 218 21882: 93 e0 ldi r25, 0x03 ; 3 21884: 0f 94 06 2a call 0x2540c ; 0x2540c ::expired(unsigned long)> 21888: 88 23 and r24, r24 2188a: 09 f4 brne .+2 ; 0x2188e 2188c: 93 cf rjmp .-218 ; 0x217b4 2188e: d3 cf rjmp .-90 ; 0x21836 // 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; 21890: 81 e0 ldi r24, 0x01 ; 1 21892: 80 93 d5 03 sts 0x03D5, r24 ; 0x8003d5 (*menu_menu)(); 21896: 19 95 eicall menu_leaving = 0; 21898: 10 92 d5 03 sts 0x03D5, r1 ; 0x8003d5 2189c: d2 cf rjmp .-92 ; 0x21842 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(); } 2189e: 1f 91 pop r17 218a0: 0f 91 pop r16 218a2: 08 95 ret 000218a4 : menu_goto(lcd_generic_preheat_menu, 0, true); } void lcd_wizard() { bool result = true; if (calibration_status_get(CALIBRATION_WIZARD_STEPS)) { 218a4: 8f e1 ldi r24, 0x1F ; 31 218a6: 0e 94 7a ee call 0x1dcf4 ; 0x1dcf4 218aa: 81 11 cpse r24, r1 218ac: 06 c0 rjmp .+12 ; 0x218ba // 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); 218ae: 8f e1 ldi r24, 0x1F ; 31 218b0: 0e 94 18 ee call 0x1dc30 ; 0x1dc30 lcd_wizard(WizState::Run); 218b4: 80 e0 ldi r24, 0x00 ; 0 218b6: 0c 94 d6 f8 jmp 0x1f1ac ; 0x1f1ac 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); 218ba: 8a ec ldi r24, 0xCA ; 202 218bc: 9b e3 ldi r25, 0x3B ; 59 218be: 0e 94 c4 72 call 0xe588 ; 0xe588 218c2: 41 e0 ldi r20, 0x01 ; 1 218c4: 60 e0 ldi r22, 0x00 ; 0 218c6: 0f 94 fb 4e call 0x29df6 ; 0x29df6 } if (result) { 218ca: 88 23 and r24, r24 218cc: 81 f3 breq .-32 ; 0x218ae calibration_status_clear(CALIBRATION_WIZARD_STEPS); lcd_wizard(WizState::Run); } else { lcd_return_to_status(); 218ce: 0f 94 7c 1e call 0x23cf8 ; 0x23cf8 lcd_update_enable(true); 218d2: 81 e0 ldi r24, 0x01 ; 1 218d4: 0e 94 3d 6f call 0xde7a ; 0xde7a lcd_update(2); 218d8: 82 e0 ldi r24, 0x02 ; 2 218da: 0c 94 bf 6e jmp 0xdd7e ; 0xdd7e 000218de : if (result == LCD_LEFT_BUTTON_CHOICE) { lcd_mesh_calibration_z(); } } void prompt_steel_sheet_on_bed(bool wantedState) { 218de: cf 93 push r28 218e0: 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); 218e2: 8f eb ldi r24, 0xBF ; 191 218e4: 9e e3 ldi r25, 0x3E ; 62 218e6: 0e 94 c4 72 call 0xe588 ; 0xe588 218ea: 41 e0 ldi r20, 0x01 ; 1 218ec: 4c 27 eor r20, r28 218ee: 60 e0 ldi r22, 0x00 ; 0 218f0: 0f 94 fb 4e call 0x29df6 ; 0x29df6 218f4: 91 e0 ldi r25, 0x01 ; 1 218f6: 81 11 cpse r24, r1 218f8: 90 e0 ldi r25, 0x00 ; 0 if (sheetIsOnBed != wantedState) { 218fa: c9 17 cp r28, r25 218fc: 59 f0 breq .+22 ; 0x21914 lcd_show_fullscreen_message_and_wait_P(_T(wantedState ? MSG_PLACE_STEEL_SHEET : MSG_REMOVE_STEEL_SHEET)); 218fe: 85 e9 ldi r24, 0x95 ; 149 21900: 9e e3 ldi r25, 0x3E ; 62 21902: cc 23 and r28, r28 21904: 11 f0 breq .+4 ; 0x2190a 21906: 87 e5 ldi r24, 0x57 ; 87 21908: 9a e5 ldi r25, 0x5A ; 90 2190a: 0e 94 c4 72 call 0xe588 ; 0xe588 } #endif //STEEL_SHEET } 2190e: 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)); 21910: 0d 94 c7 1f jmp 0x23f8e ; 0x23f8e } #endif //STEEL_SHEET } 21914: cf 91 pop r28 21916: 08 95 ret 00021918 : } lcd_show_fullscreen_message_and_wait_P( _T(MSG_WIZARD_V2_CAL_2)); } void lcd_z_calibration_prompt(bool allowTimeouting) { 21918: cf 93 push r28 2191a: c8 2f mov r28, r24 uint8_t result = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_Z_CALIBRATION_PROMPT), allowTimeouting, 0); 2191c: 8c e6 ldi r24, 0x6C ; 108 2191e: 9e e3 ldi r25, 0x3E ; 62 21920: 0e 94 c4 72 call 0xe588 ; 0xe588 21924: 40 e0 ldi r20, 0x00 ; 0 21926: 6c 2f mov r22, r28 21928: 0f 94 fb 4e call 0x29df6 ; 0x29df6 if (result == LCD_LEFT_BUTTON_CHOICE) { 2192c: 81 11 cpse r24, r1 2192e: 03 c0 rjmp .+6 ; 0x21936 lcd_mesh_calibration_z(); } } 21930: 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(); 21932: 0c 94 ac ce jmp 0x19d58 ; 0x19d58 } } 21936: cf 91 pop r28 21938: 08 95 ret 0002193a : } eeprom_update_byte_notify((uint8_t*)EEPROM_MBL_PROBE_NR, mbl_z_probe_nr); } static void lcd_mesh_bed_leveling_settings() { 2193a: bf 92 push r11 2193c: cf 92 push r12 2193e: df 92 push r13 21940: ef 92 push r14 21942: ff 92 push r15 21944: 0f 93 push r16 21946: 1f 93 push r17 21948: cf 93 push r28 2194a: df 93 push r29 2194c: 00 d0 rcall .+0 ; 0x2194e 2194e: 1f 92 push r1 21950: cd b7 in r28, 0x3d ; 61 21952: de b7 in r29, 0x3e ; 62 bool magnet_elimination = (eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION) > 0); 21954: 8c ea ldi r24, 0xAC ; 172 21956: 9d e0 ldi r25, 0x0D ; 13 21958: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 2195c: c8 2e mov r12, r24 uint8_t points_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR); 2195e: 8b ea ldi r24, 0xAB ; 171 21960: 9d e0 ldi r25, 0x0D ; 13 21962: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 21966: f8 2e mov r15, r24 uint8_t mbl_z_probe_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR); 21968: 8a ea ldi r24, 0xAA ; 170 2196a: 9d e0 ldi r25, 0x0D ; 13 2196c: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 21970: 18 2f mov r17, r24 char sToggle[4]; //enough for nxn format MENU_BEGIN(); 21972: 0f 94 51 d1 call 0x3a2a2 ; 0x3a2a2 21976: 10 92 11 05 sts 0x0511, r1 ; 0x800511 if (points_nr == 7) { lcd_z_calibration_prompt(true); } ); MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); sToggle[0] = points_nr + '0'; 2197a: 80 e3 ldi r24, 0x30 ; 48 2197c: d8 2e mov r13, r24 2197e: df 0c add r13, r15 sToggle[1] = 'x'; 21980: 98 e7 ldi r25, 0x78 ; 120 21982: 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'; 21984: 20 e3 ldi r18, 0x30 ; 48 21986: e2 2e mov r14, r18 21988: 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(); 2198a: 80 91 11 05 lds r24, 0x0511 ; 0x800511 2198e: 84 30 cpi r24, 0x04 ; 4 21990: 08 f0 brcs .+2 ; 0x21994 21992: 56 c0 rjmp .+172 ; 0x21a40 21994: 10 92 14 05 sts 0x0514, r1 ; 0x800514 ON_MENU_LEAVE( 21998: 0f 94 d1 cf call 0x39fa2 ; 0x39fa2 2199c: 88 23 and r24, r24 2199e: 31 f0 breq .+12 ; 0x219ac 219a0: 87 e0 ldi r24, 0x07 ; 7 219a2: f8 12 cpse r15, r24 219a4: 03 c0 rjmp .+6 ; 0x219ac 219a6: 81 e0 ldi r24, 0x01 ; 1 219a8: 0f 94 8c 0c call 0x21918 ; 0x21918 // 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)); 219ac: 86 e4 ldi r24, 0x46 ; 70 219ae: 98 e4 ldi r25, 0x48 ; 72 219b0: 0e 94 c4 72 call 0xe588 ; 0xe588 219b4: 0f 94 1c d4 call 0x3a838 ; 0x3a838 sToggle[0] = points_nr + '0'; 219b8: d9 82 std Y+1, r13 ; 0x01 sToggle[1] = 'x'; 219ba: ba 82 std Y+2, r11 ; 0x02 sToggle[2] = points_nr + '0'; 219bc: db 82 std Y+3, r13 ; 0x03 sToggle[3] = 0; 219be: 1c 82 std Y+4, r1 ; 0x04 MENU_ITEM_TOGGLE(_T(MSG_MESH), sToggle, mbl_mesh_toggle); 219c0: 8a ef ldi r24, 0xFA ; 250 219c2: 97 e4 ldi r25, 0x47 ; 71 219c4: 0e 94 c4 72 call 0xe588 ; 0xe588 219c8: 20 e0 ldi r18, 0x00 ; 0 219ca: 45 e7 ldi r20, 0x75 ; 117 219cc: 5f ec ldi r21, 0xCF ; 207 219ce: be 01 movw r22, r28 219d0: 6f 5f subi r22, 0xFF ; 255 219d2: 7f 4f sbci r23, 0xFF ; 255 219d4: 0f 94 e0 d2 call 0x3a5c0 ; 0x3a5c0 sToggle[0] = mbl_z_probe_nr + '0'; 219d8: e9 82 std Y+1, r14 ; 0x01 sToggle[1] = 0; 219da: 1a 82 std Y+2, r1 ; 0x02 MENU_ITEM_TOGGLE(_T(MSG_Z_PROBE_NR), sToggle, mbl_probe_nr_toggle); 219dc: 8c ee ldi r24, 0xEC ; 236 219de: 97 e4 ldi r25, 0x47 ; 71 219e0: 0e 94 c4 72 call 0xe588 ; 0xe588 219e4: 20 e0 ldi r18, 0x00 ; 0 219e6: 46 e6 ldi r20, 0x66 ; 102 219e8: 5f ec ldi r21, 0xCF ; 207 219ea: be 01 movw r22, r28 219ec: 6f 5f subi r22, 0xFF ; 255 219ee: 7f 4f sbci r23, 0xFF ; 255 219f0: 0f 94 e0 d2 call 0x3a5c0 ; 0x3a5c0 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); 219f4: 87 e0 ldi r24, 0x07 ; 7 219f6: f8 12 cpse r15, r24 219f8: 20 c0 rjmp .+64 ; 0x21a3a 219fa: 83 e1 ldi r24, 0x13 ; 19 219fc: 9d e5 ldi r25, 0x5D ; 93 219fe: c1 10 cpse r12, r1 21a00: 02 c0 rjmp .+4 ; 0x21a06 21a02: 8d e0 ldi r24, 0x0D ; 13 21a04: 9d e5 ldi r25, 0x5D ; 93 21a06: 0e 94 c4 72 call 0xe588 ; 0xe588 21a0a: 8c 01 movw r16, r24 21a0c: 86 ed ldi r24, 0xD6 ; 214 21a0e: 97 e4 ldi r25, 0x47 ; 71 21a10: 0e 94 c4 72 call 0xe588 ; 0xe588 21a14: 22 e0 ldi r18, 0x02 ; 2 21a16: 41 e8 ldi r20, 0x81 ; 129 21a18: 5f ec ldi r21, 0xCF ; 207 21a1a: b8 01 movw r22, r16 21a1c: 0f 94 e0 d2 call 0x3a5c0 ; 0x3a5c0 MENU_END(); 21a20: 0f 94 25 d1 call 0x3a24a ; 0x3a24a 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(); 21a24: 90 91 11 05 lds r25, 0x0511 ; 0x800511 21a28: 9f 5f subi r25, 0xFF ; 255 21a2a: 90 93 11 05 sts 0x0511, r25 ; 0x800511 21a2e: 90 91 13 05 lds r25, 0x0513 ; 0x800513 21a32: 9f 5f subi r25, 0xFF ; 255 21a34: 90 93 13 05 sts 0x0513, r25 ; 0x800513 21a38: a8 cf rjmp .-176 ; 0x2198a 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); 21a3a: 86 ee ldi r24, 0xE6 ; 230 21a3c: 97 e4 ldi r25, 0x47 ; 71 21a3e: e3 cf rjmp .-58 ; 0x21a06 MENU_END(); } 21a40: 0f 90 pop r0 21a42: 0f 90 pop r0 21a44: 0f 90 pop r0 21a46: 0f 90 pop r0 21a48: df 91 pop r29 21a4a: cf 91 pop r28 21a4c: 1f 91 pop r17 21a4e: 0f 91 pop r16 21a50: ff 90 pop r15 21a52: ef 90 pop r14 21a54: df 90 pop r13 21a56: cf 90 pop r12 21a58: bf 90 pop r11 21a5a: 08 95 ret 00021a5c : } } return false; // couldn't accomplish the task } void MMU2::ToolChangeCommon(uint8_t slot) { 21a5c: 2f 92 push r2 21a5e: 3f 92 push r3 21a60: 4f 92 push r4 21a62: 5f 92 push r5 21a64: 6f 92 push r6 21a66: 7f 92 push r7 21a68: 8f 92 push r8 21a6a: 9f 92 push r9 21a6c: af 92 push r10 21a6e: bf 92 push r11 21a70: cf 92 push r12 21a72: df 92 push r13 21a74: ef 92 push r14 21a76: ff 92 push r15 21a78: 0f 93 push r16 21a7a: 1f 93 push r17 21a7c: cf 93 push r28 21a7e: df 93 push r29 21a80: cd b7 in r28, 0x3d ; 61 21a82: de b7 in r29, 0x3e ; 62 21a84: 67 97 sbiw r28, 0x17 ; 23 21a86: 0f b6 in r0, 0x3f ; 63 21a88: f8 94 cli 21a8a: de bf out 0x3e, r29 ; 62 21a8c: 0f be out 0x3f, r0 ; 63 21a8e: cd bf out 0x3d, r28 ; 61 21a90: 08 2f mov r16, r24 21a92: ce 01 movw r24, r28 21a94: 46 96 adiw r24, 0x16 ; 22 21a96: 9f 8b std Y+23, r25 ; 0x17 21a98: 8e 8b std Y+22, r24 ; 0x16 21a9a: 83 e0 ldi r24, 0x03 ; 3 21a9c: f8 2e mov r15, r24 lcd_draw_update = 1; // force redraw } void lcd_clearstatus() { memset(lcd_status_message, 0, sizeof(lcd_status_message)); 21a9e: 95 e1 ldi r25, 0x15 ; 21 21aa0: 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 21aa2: 0f 94 6a c5 call 0x38ad4 ; 0x38ad4 tool_change_extruder = slot; 21aa6: 00 93 a1 13 sts 0x13A1, r16 ; 0x8013a1 state = State::Stopped; currentScope = Scope::Stopped; } void ProtocolLogic::ToolChange(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Tool, slot)); 21aaa: 40 2f mov r20, r16 21aac: 64 e5 ldi r22, 0x54 ; 84 21aae: ce 01 movw r24, r28 21ab0: 01 96 adiw r24, 0x01 ; 1 21ab2: 0f 94 48 c5 call 0x38a90 ; 0x38a90 21ab6: 49 81 ldd r20, Y+1 ; 0x01 21ab8: 5a 81 ldd r21, Y+2 ; 0x02 21aba: 6b 81 ldd r22, Y+3 ; 0x03 21abc: 7c 81 ldd r23, Y+4 ; 0x04 21abe: 8d 81 ldd r24, Y+5 ; 0x05 21ac0: 0f 94 0d a5 call 0x34a1a ; 0x34a1a logic.ToolChange(slot); // let the MMU pull the filament out and push a new one in if (manage_response(true, true)) { 21ac4: 61 e0 ldi r22, 0x01 ; 1 21ac6: 81 e0 ldi r24, 0x01 ; 1 21ac8: 0f 94 31 ac call 0x35862 ; 0x35862 21acc: 18 2f mov r17, r24 21ace: 81 11 cpse r24, r1 21ad0: 07 c0 rjmp .+14 ; 0x21ae0 break; } // otherwise: failed to perform the command - unload first and then let it run again IncrementMMUFails(); 21ad2: 0f 94 a9 c4 call 0x38952 ; 0x38952 // just in case we stood in an error screen for too long and the hotend got cold ResumeHotendTemp(); 21ad6: 0f 94 cf ab call 0x3579e ; 0x3579e // if the extruder has been parked, it will get unparked once the ToolChange command finishes OK // - so no ResumeUnpark() at this spot UnloadInner(); 21ada: 0f 94 bf ac call 0x3597e ; 0x3597e 21ade: e1 cf rjmp .-62 ; 0x21aa2 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 21ae0: 0f 94 a3 42 call 0x28546 ; 0x28546 } bool MMU2::VerifyFilamentEnteredPTFE() { planner_synchronize(); if (WhereIsFilament() != FilamentState::AT_FSENSOR) 21ae4: 0f 94 a0 c5 call 0x38b40 ; 0x38b40 21ae8: 81 30 cpi r24, 0x01 ; 1 21aea: 79 f1 breq .+94 ; 0x21b4a // 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(); 21aec: 0f 94 bf ac call 0x3597e ; 0x3597e if (retries == 2 && cutter_enabled()) { 21af0: 92 e0 ldi r25, 0x02 ; 2 21af2: f9 12 cpse r15, r25 21af4: 09 c0 rjmp .+18 ; 0x21b08 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; 21af6: 8e ec ldi r24, 0xCE ; 206 21af8: 9e e0 ldi r25, 0x0E ; 14 21afa: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 21afe: 81 30 cpi r24, 0x01 ; 1 21b00: 19 f4 brne .+6 ; 0x21b08 CutFilamentInner(slot); // try cutting filament tip at the last attempt 21b02: 80 2f mov r24, r16 21b04: 0f 94 a6 ad call 0x35b4c ; 0x35b4c 21b08: 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) { 21b0a: f1 10 cpse r15, r1 21b0c: ca cf rjmp .-108 ; 0x21aa2 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()) { 21b0e: 80 91 ab 0d lds r24, 0x0DAB ; 0x800dab 21b12: 88 23 and r24, r24 21b14: 09 f4 brne .+2 ; 0x21b18 21b16: ef c0 rjmp .+478 ; 0x21cf6 SetCurrentTool(slot); // filament change is finished SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; } 21b18: 67 96 adiw r28, 0x17 ; 23 21b1a: 0f b6 in r0, 0x3f ; 63 21b1c: f8 94 cli 21b1e: de bf out 0x3e, r29 ; 62 21b20: 0f be out 0x3f, r0 ; 63 21b22: cd bf out 0x3d, r28 ; 61 21b24: df 91 pop r29 21b26: cf 91 pop r28 21b28: 1f 91 pop r17 21b2a: 0f 91 pop r16 21b2c: ff 90 pop r15 21b2e: ef 90 pop r14 21b30: df 90 pop r13 21b32: cf 90 pop r12 21b34: bf 90 pop r11 21b36: af 90 pop r10 21b38: 9f 90 pop r9 21b3a: 8f 90 pop r8 21b3c: 7f 90 pop r7 21b3e: 6f 90 pop r6 21b40: 5f 90 pop r5 21b42: 4f 90 pop r4 21b44: 3f 90 pop r3 21b46: 2f 90 pop r2 21b48: 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(); 21b4a: 60 91 96 13 lds r22, 0x1396 ; 0x801396 21b4e: 70 e0 ldi r23, 0x00 ; 0 21b50: 90 e0 ldi r25, 0x00 ; 0 21b52: 80 e0 ldi r24, 0x00 ; 0 21b54: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 21b58: 9b 01 movw r18, r22 21b5a: ac 01 movw r20, r24 21b5c: 66 e6 ldi r22, 0x66 ; 102 21b5e: 76 e6 ldi r23, 0x66 ; 102 21b60: 8d e9 ldi r24, 0x9D ; 157 21b62: 92 e4 ldi r25, 0x42 ; 66 21b64: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 21b68: 36 2e mov r3, r22 21b6a: 87 2e mov r8, r23 21b6c: 98 2e mov r9, r24 21b6e: 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)) 21b70: 26 2f mov r18, r22 21b72: 37 2f mov r19, r23 21b74: 48 2f mov r20, r24 21b76: 59 2f mov r21, r25 21b78: 60 e0 ldi r22, 0x00 ; 0 21b7a: 70 e0 ldi r23, 0x00 ; 0 21b7c: 80 e2 ldi r24, 0x20 ; 32 21b7e: 91 e4 ldi r25, 0x41 ; 65 21b80: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 21b84: 2b 01 movw r4, r22 21b86: 3c 01 movw r6, r24 21b88: ee e1 ldi r30, 0x1E ; 30 21b8a: f5 e0 ldi r31, 0x05 ; 5 21b8c: 82 2d mov r24, r2 21b8e: 11 92 st Z+, r1 21b90: 8a 95 dec r24 21b92: e9 f7 brne .-6 ; 0x21b8e lcd_status_message_idx = 0; 21b94: 10 92 1d 05 sts 0x051D, r1 ; 0x80051d <_ZL22lcd_status_message_idx.lto_priv.448> 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); 21b98: 83 2d mov r24, r3 21b9a: 98 2d mov r25, r8 21b9c: a9 2d mov r26, r9 21b9e: be 2d mov r27, r14 21ba0: bc 01 movw r22, r24 21ba2: 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++) { 21ba4: 91 2c mov r9, r1 21ba6: 31 2c mov r3, r1 21ba8: e1 2c mov r14, r1 extruder_move(move == 0 ? tryload_length : -tryload_length, MMU2_VERIFY_LOAD_TO_NOZZLE_FEED_RATE); 21baa: 5b 01 movw r10, r22 21bac: 6c 01 movw r12, r24 21bae: d7 fa bst r13, 7 21bb0: d0 94 com r13 21bb2: d7 f8 bld r13, 7 21bb4: d0 94 com r13 21bb6: 20 e0 ldi r18, 0x00 ; 0 21bb8: 30 e0 ldi r19, 0x00 ; 0 21bba: 48 e4 ldi r20, 0x48 ; 72 21bbc: 52 e4 ldi r21, 0x42 ; 66 21bbe: 0f 94 6c c5 call 0x38ad8 ; 0x38ad8 21bc2: 90 91 a4 0d lds r25, 0x0DA4 ; 0x800da4 21bc6: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 while (planner_any_moves()) { 21bca: 98 17 cp r25, r24 21bcc: 09 f4 brne .+2 ; 0x21bd0 21bce: 49 c0 rjmp .+146 ; 0x21c62 filament_inserted = filament_inserted && (WhereIsFilament() == FilamentState::AT_FSENSOR); 21bd0: 11 23 and r17, r17 21bd2: 31 f0 breq .+12 ; 0x21be0 21bd4: 0f 94 a0 c5 call 0x38b40 ; 0x38b40 21bd8: 11 e0 ldi r17, 0x01 ; 1 21bda: 81 30 cpi r24, 0x01 ; 1 21bdc: 09 f0 breq .+2 ; 0x21be0 21bde: 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); 21be0: 83 e0 ldi r24, 0x03 ; 3 21be2: 0f 94 8f 42 call 0x2851e ; 0x2851e 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); 21be6: 20 91 9d 06 lds r18, 0x069D ; 0x80069d 21bea: 30 91 9e 06 lds r19, 0x069E ; 0x80069e 21bee: 40 91 9f 06 lds r20, 0x069F ; 0x80069f 21bf2: 50 91 a0 06 lds r21, 0x06A0 ; 0x8006a0 21bf6: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 21bfa: a3 01 movw r20, r6 21bfc: 92 01 movw r18, r4 21bfe: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 21c02: 0f 94 dd dd call 0x3bbba ; 0x3bbba 21c06: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 21c0a: 86 2e mov r8, r22 if (dpixel1 - dpixel0) { 21c0c: e6 16 cp r14, r22 21c0e: c1 f0 breq .+48 ; 0x21c40 21c10: e3 2d mov r30, r3 21c12: e4 31 cpi r30, 0x14 ; 20 21c14: 08 f0 brcs .+2 ; 0x21c18 21c16: 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); 21c18: 33 24 eor r3, r3 21c1a: 33 94 inc r3 21c1c: 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] : '-'); 21c1e: 8f ef ldi r24, 0xFF ; 255 21c20: 11 11 cpse r17, r1 21c22: 01 c0 rjmp .+2 ; 0x21c26 21c24: 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; 21c26: f0 e0 ldi r31, 0x00 ; 0 21c28: e2 5e subi r30, 0xE2 ; 226 21c2a: fa 4f sbci r31, 0xFA ; 250 21c2c: 80 83 st Z, r24 lcd_draw_update = 1; // force redraw 21c2e: 91 e0 ldi r25, 0x01 ; 1 21c30: 90 93 6d 02 sts 0x026D, r25 ; 0x80026d if (!lcd_update_enabled) lcdui_print_status_line(); 21c34: 80 91 6e 02 lds r24, 0x026E ; 0x80026e 21c38: 81 11 cpse r24, r1 21c3a: 02 c0 rjmp .+4 ; 0x21c40 21c3c: 0f 94 49 2a call 0x25492 ; 0x25492 void thermal_setTargetHotend(int16_t t) { setTargetHotend(t); } void safe_delay_keep_alive(uint16_t t) { delay_keep_alive(t); 21c40: 90 e0 ldi r25, 0x00 ; 0 21c42: 80 e0 ldi r24, 0x00 ; 0 21c44: 0e 94 fc 8c call 0x119f8 ; 0x119f8 } 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); 21c48: e8 2c mov r14, r8 tlur.Progress(filament_inserted); safe_delay_keep_alive(0); if (planner_draining()) { 21c4a: 80 91 ab 0d lds r24, 0x0DAB ; 0x800dab 21c4e: 88 23 and r24, r24 21c50: 09 f4 brne .+2 ; 0x21c54 21c52: b7 cf rjmp .-146 ; 0x21bc2 return false; // power panic or a similar issue happened, bail out fast 21c54: 10 e0 ldi r17, 0x00 ; 0 21c56: 37 c0 rjmp .+110 ; 0x21cc6 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); 21c58: c6 01 movw r24, r12 21c5a: b5 01 movw r22, r10 21c5c: 99 24 eor r9, r9 21c5e: 93 94 inc r9 21c60: aa cf rjmp .-172 ; 0x21bb6 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++) { 21c62: 91 e0 ldi r25, 0x01 ; 1 21c64: 99 12 cpse r9, r25 21c66: f8 cf rjmp .-16 ; 0x21c58 return false; // power panic or a similar issue happened, bail out fast } } } Disable_E0(); 21c68: 0f 94 6a c5 call 0x38ad4 ; 0x38ad4 if (!filament_inserted) { 21c6c: 11 11 cpse r17, r1 21c6e: 08 c0 rjmp .+16 ; 0x21c80 eeprom_update_byte_notify((uint8_t *)EEPROM_MMU_ENABLED, false); mmu2.Status(); } void IncrementLoadFails(){ eeprom_increment_byte((uint8_t *)EEPROM_MMU_LOAD_FAIL); 21c70: 8f ec ldi r24, 0xCF ; 207 21c72: 9e e0 ldi r25, 0x0E ; 14 21c74: 0e 94 40 76 call 0xec80 ; 0xec80 eeprom_increment_word((uint16_t *)EEPROM_MMU_LOAD_FAIL_TOT); 21c78: 80 ed ldi r24, 0xD0 ; 208 21c7a: 9e e0 ldi r25, 0x0E ; 14 21c7c: 0e 94 33 76 call 0xec66 ; 0xec66 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); 21c80: 44 e1 ldi r20, 0x14 ; 20 21c82: 50 e0 ldi r21, 0x00 ; 0 21c84: 6e e1 ldi r22, 0x1E ; 30 21c86: 75 e0 ldi r23, 0x05 ; 5 21c88: ce 01 movw r24, r28 21c8a: 01 96 adiw r24, 0x01 ; 1 21c8c: 0f 94 57 e2 call 0x3c4ae ; 0x3c4ae 21c90: fe 01 movw r30, r28 21c92: 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'; 21c94: 81 91 ld r24, Z+ 21c96: 87 fd sbrc r24, 7 21c98: 2c c0 rjmp .+88 ; 0x21cf2 21c9a: 80 e3 ldi r24, 0x30 ; 48 21c9c: df 01 movw r26, r30 21c9e: 11 97 sbiw r26, 0x01 ; 1 21ca0: 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++) { 21ca2: 8e 89 ldd r24, Y+22 ; 0x16 21ca4: 9f 89 ldd r25, Y+23 ; 0x17 21ca6: 8e 17 cp r24, r30 21ca8: 9f 07 cpc r25, r31 21caa: a1 f7 brne .-24 ; 0x21c94 // 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; 21cac: 1d 8a std Y+21, r1 ; 0x15 MMU2_ECHO_MSGLN(buf); 21cae: 82 ef ldi r24, 0xF2 ; 242 21cb0: 9b ea ldi r25, 0xAB ; 171 21cb2: 0e 94 68 77 call 0xeed0 ; 0xeed0 21cb6: 85 e4 ldi r24, 0x45 ; 69 21cb8: 9f e8 ldi r25, 0x8F ; 143 21cba: 0e 94 68 77 call 0xeed0 ; 0xeed0 21cbe: ce 01 movw r24, r28 21cc0: 01 96 adiw r24, 0x01 ; 1 21cc2: 0f 94 bb d5 call 0x3ab76 ; 0x3ab76 SERIAL_ECHOLN(message); } void lcd_reset_status_message_timeout() { lcd_status_message_timeout.start(); 21cc6: 83 e3 ldi r24, 0x33 ; 51 21cc8: 95 e0 ldi r25, 0x05 ; 5 21cca: 0f 94 c5 2b call 0x2578a ; 0x2578a ::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()) { 21cce: 11 23 and r17, r17 21cd0: 09 f4 brne .+2 ; 0x21cd4 21cd2: 0c cf rjmp .-488 ; 0x21aec // 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 21cd4: 80 2f mov r24, r16 21cd6: 0f 94 be 87 call 0x30f7c ; 0x30f7c } } void SpoolJoin::setSlot(uint8_t slot) { currentMMUSlot = slot; 21cda: 00 93 48 13 sts 0x1348, r16 ; 0x801348 SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; 21cde: 80 91 bd 13 lds r24, 0x13BD ; 0x8013bd 21ce2: 90 91 be 13 lds r25, 0x13BE ; 0x8013be 21ce6: 01 96 adiw r24, 0x01 ; 1 21ce8: 90 93 be 13 sts 0x13BE, r25 ; 0x8013be 21cec: 80 93 bd 13 sts 0x13BD, r24 ; 0x8013bd 21cf0: 13 cf rjmp .-474 ; 0x21b18 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'; 21cf2: 81 e3 ldi r24, 0x31 ; 49 21cf4: d3 cf rjmp .-90 ; 0x21c9c void SetInAutoRetry(bool iar) { inAutoRetry = iar; } inline void SetPrinterError(ErrorCode ec) { explicitPrinterError = ec; 21cf6: 8a e2 ldi r24, 0x2A ; 42 21cf8: 90 e8 ldi r25, 0x80 ; 128 21cfa: 90 93 4b 13 sts 0x134B, r25 ; 0x80134b 21cfe: 80 93 4a 13 sts 0x134A, r24 ; 0x80134a 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 21d02: 61 e0 ldi r22, 0x01 ; 1 21d04: 81 e0 ldi r24, 0x01 ; 1 21d06: 0f 94 31 ac call 0x35862 ; 0x35862 21d0a: c7 ce rjmp .-626 ; 0x21a9a 00021d0c : } ScreenUpdateEnable(); return true; } bool MMU2::load_filament_to_nozzle(uint8_t slot) { 21d0c: cf 93 push r28 21d0e: df 93 push r29 21d10: d8 2f mov r29, r24 if (!WaitForMMUReady()) { 21d12: 0f 94 3f 88 call 0x3107e ; 0x3107e 21d16: c8 2f mov r28, r24 21d18: 88 23 and r24, r24 21d1a: 49 f1 breq .+82 ; 0x21d6e safe_delay_keep_alive(delay); } } void WaitForHotendTargetTempBeep() { waitForHotendTargetTemp(200, [] {}); 21d1c: 88 ec ldi r24, 0xC8 ; 200 21d1e: 90 e0 ldi r25, 0x00 ; 0 21d20: 0f 94 ee c8 call 0x391dc ; 0x391dc (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.385]> 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); 21d24: 82 e0 ldi r24, 0x02 ; 2 21d26: 0f 94 c2 4d call 0x29b84 ; 0x29b84 void FullScreenMsgTest(uint8_t slot){ FullScreenMsg(_T(MSG_TESTING_FILAMENT), slot); } void FullScreenMsgLoad(uint8_t slot){ FullScreenMsg(_T(MSG_LOADING_FILAMENT), slot); 21d2a: 81 e7 ldi r24, 0x71 ; 113 21d2c: 9c e5 ldi r25, 0x5C ; 92 21d2e: 0e 94 c4 72 call 0xe588 ; 0xe588 21d32: 6d 2f mov r22, r29 21d34: 0f 94 8a c4 call 0x38914 ; 0x38914 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 21d38: 0f 94 b3 87 call 0x30f66 ; 0x30f66 FullScreenMsgLoad(slot); { // used for MMU-menu operation "Load to Nozzle" ReportingRAII rep(CommandInProgress::ToolChange); FSensorBlockRunout blockRunout; 21d3c: 0f 94 69 86 call 0x30cd2 ; 0x30cd2 if (extruder != MMU2_NO_TOOL) { // we already have some filament loaded - free it + shape its tip properly 21d40: 80 91 a0 13 lds r24, 0x13A0 ; 0x8013a0 21d44: 83 36 cpi r24, 0x63 ; 99 21d46: 29 f0 breq .+10 ; 0x21d52 return ss; } void MMU2::filament_ramming() { execute_extruder_sequence(ramming_sequence, sizeof(ramming_sequence) / sizeof(E_Step)); 21d48: 62 e1 ldi r22, 0x12 ; 18 21d4a: 8b e2 ldi r24, 0x2B ; 43 21d4c: 97 ea ldi r25, 0xA7 ; 167 21d4e: 0f 94 16 88 call 0x3102c ; 0x3102c if (extruder != MMU2_NO_TOOL) { // we already have some filament loaded - free it + shape its tip properly filament_ramming(); } ToolChangeCommon(slot); 21d52: 8d 2f mov r24, r29 21d54: 0f 94 2e 0d call 0x21a5c ; 0x21a5c // Finish loading to the nozzle with finely tuned steps. execute_load_to_nozzle_sequence(); 21d58: 0e 94 f1 cd call 0x19be2 ; 0x19be2 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); 21d5c: 83 e0 ldi r24, 0x03 ; 3 21d5e: 0f 94 c2 4d call 0x29b84 ; 0x29b84 #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) // SERIAL_ECHOLNPGM("FSBlockRunout"); } FSensorBlockRunout::~FSensorBlockRunout() { fsensor.settings_init(); // restore filament runout state. 21d62: 0f 94 ad 7a call 0x2f55a ; 0x2f55a explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 21d66: 0f 94 34 88 call 0x31068 ; 0x31068 // Finish loading to the nozzle with finely tuned steps. execute_load_to_nozzle_sequence(); MakeSound(Confirm); } ScreenUpdateEnable(); 21d6a: 0f 94 87 c4 call 0x3890e ; 0x3890e return true; } 21d6e: 8c 2f mov r24, r28 21d70: df 91 pop r29 21d72: cf 91 pop r28 21d74: 08 95 ret 00021d76 : 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); 21d76: 0f 94 86 0e call 0x21d0c ; 0x21d0c // Extrude a little bit of filament so the user // can see the color is correct load_filament_final_feed(); 21d7a: 0e 94 ab 64 call 0xc956 ; 0xc956 st_synchronize(); 21d7e: 0f 94 a3 42 call 0x28546 ; 0x28546 // Ask user if the extruded color is correct: lcd_return_to_status(); 21d82: 0f 94 7c 1e call 0x23cf8 ; 0x23cf8 lcd_load_filament_color_check(); 21d86: 0f 94 24 4f call 0x29e48 ; 0x29e48 lcd_setstatuspgm(MSG_WELCOME); 21d8a: 86 eb ldi r24, 0xB6 ; 182 21d8c: 90 e7 ldi r25, 0x70 ; 112 21d8e: 0e 94 38 f1 call 0x1e270 ; 0x1e270 custom_message_type = CustomMsg::Status; 21d92: 10 92 c3 06 sts 0x06C3, r1 ; 0x8006c3 // Clear the filament action clearFilamentAction(); 21d96: 0d 94 69 20 jmp 0x240d2 ; 0x240d2 00021d9a : SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; } bool MMU2::tool_change(uint8_t slot) { 21d9a: cf 93 push r28 21d9c: df 93 push r29 21d9e: d8 2f mov r29, r24 if (!WaitForMMUReady()) { 21da0: 0f 94 3f 88 call 0x3107e ; 0x3107e 21da4: c8 2f mov r28, r24 21da6: 88 23 and r24, r24 21da8: b9 f0 breq .+46 ; 0x21dd8 return false; } if (slot != extruder) { 21daa: 80 91 a0 13 lds r24, 0x13A0 ; 0x8013a0 21dae: 8d 17 cp r24, r29 21db0: 99 f0 breq .+38 ; 0x21dd8 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(); 21db2: 0e 94 f9 67 call 0xcff2 ; 0xcff2 if (/*FindaDetectsFilament()*/ 21db6: 81 11 cpse r24, r1 21db8: 02 c0 rjmp .+4 ; 0x21dbe /*!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(); 21dba: 0f 94 f8 ac call 0x359f0 ; 0x359f0 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 21dbe: 0f 94 b3 87 call 0x30f66 ; 0x30f66 // we need to unload manually as well -- but only if FINDA detects filament unload(); } ReportingRAII rep(CommandInProgress::ToolChange); FSensorBlockRunout blockRunout; 21dc2: 0f 94 69 86 call 0x30cd2 ; 0x30cd2 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 21dc6: 0f 94 a3 42 call 0x28546 ; 0x28546 planner_synchronize(); ToolChangeCommon(slot); 21dca: 8d 2f mov r24, r29 21dcc: 0f 94 2e 0d call 0x21a5c ; 0x21a5c 21dd0: 0f 94 ad 7a call 0x2f55a ; 0x2f55a explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 21dd4: 0f 94 34 88 call 0x31068 ; 0x31068 FSensorBlockRunout blockRunout; planner_synchronize(); ToolChangeCommon(slot); } return true; } 21dd8: 8c 2f mov r24, r28 21dda: df 91 pop r29 21ddc: cf 91 pop r28 21dde: 08 95 ret 00021de0 : /// 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) { 21de0: 1f 93 push r17 21de2: cf 93 push r28 21de4: df 93 push r29 21de6: c8 2f mov r28, r24 21de8: 16 2f mov r17, r22 if (!WaitForMMUReady()) { 21dea: 0f 94 3f 88 call 0x3107e ; 0x3107e 21dee: d8 2f mov r29, r24 21df0: 88 23 and r24, r24 21df2: 89 f0 breq .+34 ; 0x21e16 return false; } FSensorBlockRunout blockRunout; 21df4: 0f 94 69 86 call 0x30cd2 ; 0x30cd2 switch (code) { 21df8: c3 36 cpi r28, 0x63 ; 99 21dfa: 01 f1 breq .+64 ; 0x21e3c 21dfc: c8 37 cpi r28, 0x78 ; 120 21dfe: 81 f0 breq .+32 ; 0x21e20 21e00: cf 33 cpi r28, 0x3F ; 63 21e02: 39 f4 brne .+14 ; 0x21e12 case '?': { waitForHotendTargetTemp(100, [] {}); 21e04: 84 e6 ldi r24, 0x64 ; 100 21e06: 90 e0 ldi r25, 0x00 ; 0 21e08: 0f 94 ee c8 call 0x391dc ; 0x391dc (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.385]> load_filament_to_nozzle(slot); 21e0c: 81 2f mov r24, r17 21e0e: 0f 94 86 0e call 0x21d0c ; 0x21d0c 21e12: 0f 94 ad 7a call 0x2f55a ; 0x2f55a execute_load_to_nozzle_sequence(); } break; } return true; } 21e16: 8d 2f mov r24, r29 21e18: df 91 pop r29 21e1a: cf 91 pop r28 21e1c: 1f 91 pop r17 21e1e: 08 95 ret } #ifdef PREVENT_DANGEROUS_EXTRUDE void set_extrude_min_temp(int temp) { extrude_min_temp = temp; 21e20: 10 92 6c 02 sts 0x026C, r1 ; 0x80026c 21e24: 10 92 6b 02 sts 0x026B, r1 ; 0x80026b 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); 21e28: 81 2f mov r24, r17 21e2a: 0f 94 cd 0e call 0x21d9a ; 0x21d9a 21e2e: 8f ea ldi r24, 0xAF ; 175 21e30: 90 e0 ldi r25, 0x00 ; 0 21e32: 90 93 6c 02 sts 0x026C, r25 ; 0x80026c 21e36: 80 93 6b 02 sts 0x026B, r24 ; 0x80026b 21e3a: eb cf rjmp .-42 ; 0x21e12 thermal_setExtrudeMintemp(EXTRUDE_MINTEMP); } break; case 'c': { waitForHotendTargetTemp(100, [] {}); 21e3c: 84 e6 ldi r24, 0x64 ; 100 21e3e: 90 e0 ldi r25, 0x00 ; 0 21e40: 0f 94 ee c8 call 0x391dc ; 0x391dc (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.385]> execute_load_to_nozzle_sequence(); 21e44: 0e 94 f1 cd call 0x19be2 ; 0x19be2 21e48: e4 cf rjmp .-56 ; 0x21e12 00021e4a : // Clear the filament action clearFilamentAction(); } static inline void loading_test_wrapper(uint8_t i){ 21e4a: cf 93 push r28 21e4c: 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); 21e4e: 86 eb ldi r24, 0xB6 ; 182 21e50: 95 e4 ldi r25, 0x45 ; 69 21e52: 0e 94 c4 72 call 0xe588 ; 0xe588 21e56: 6c 2f mov r22, r28 21e58: 0f 94 8a c4 call 0x38914 ; 0x38914 return true; } bool MMU2::loading_test(uint8_t slot) { FullScreenMsgTest(slot); tool_change(slot); 21e5c: 8c 2f mov r24, r28 21e5e: 0f 94 cd 0e call 0x21d9a ; 0x21d9a 21e62: 0f 94 a3 42 call 0x28546 ; 0x28546 planner_synchronize(); unload(); 21e66: 0f 94 f8 ac call 0x359f0 ; 0x359f0 ScreenUpdateEnable(); 21e6a: 0f 94 87 c4 call 0x3890e ; 0x3890e MMU2::mmu2.loading_test(i); // Clear the filament action clearFilamentAction(); } 21e6e: cf 91 pop r28 static inline void loading_test_wrapper(uint8_t i){ MMU2::mmu2.loading_test(i); // Clear the filament action clearFilamentAction(); 21e70: 0d 94 69 20 jmp 0x240d2 ; 0x240d2 00021e74 : 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(){ 21e74: cf 93 push r28 for(uint8_t i = 0; i < 5; ++i){ 21e76: c0 e0 ldi r28, 0x00 ; 0 21e78: 86 eb ldi r24, 0xB6 ; 182 21e7a: 95 e4 ldi r25, 0x45 ; 69 21e7c: 0e 94 c4 72 call 0xe588 ; 0xe588 21e80: 6c 2f mov r22, r28 21e82: 0f 94 8a c4 call 0x38914 ; 0x38914 return true; } bool MMU2::loading_test(uint8_t slot) { FullScreenMsgTest(slot); tool_change(slot); 21e86: 8c 2f mov r24, r28 21e88: 0f 94 cd 0e call 0x21d9a ; 0x21d9a 21e8c: 0f 94 a3 42 call 0x28546 ; 0x28546 planner_synchronize(); unload(); 21e90: 0f 94 f8 ac call 0x359f0 ; 0x359f0 ScreenUpdateEnable(); 21e94: 0f 94 87 c4 call 0x3890e ; 0x3890e 21e98: cf 5f subi r28, 0xFF ; 255 21e9a: c5 30 cpi r28, 0x05 ; 5 21e9c: 69 f7 brne .-38 ; 0x21e78 MMU2::mmu2.loading_test(i); } // Clear the filament action clearFilamentAction(); } 21e9e: cf 91 pop r28 for(uint8_t i = 0; i < 5; ++i){ MMU2::mmu2.loading_test(i); } // Clear the filament action clearFilamentAction(); 21ea0: 0d 94 69 20 jmp 0x240d2 ; 0x240d2 00021ea4 : void ProtocolLogic::CutFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Cut, slot)); } void ProtocolLogic::ResetMMU(uint8_t mode /* = 0 */) { 21ea4: cf 93 push r28 21ea6: df 93 push r29 21ea8: 00 d0 rcall .+0 ; 0x21eaa 21eaa: 1f 92 push r1 21eac: 1f 92 push r1 21eae: cd b7 in r28, 0x3d ; 61 21eb0: de b7 in r29, 0x3e ; 62 PlanGenericRequest(RequestMsg(RequestMsgCodes::Reset, mode)); 21eb2: 48 2f mov r20, r24 21eb4: 68 e5 ldi r22, 0x58 ; 88 21eb6: ce 01 movw r24, r28 21eb8: 01 96 adiw r24, 0x01 ; 1 21eba: 0f 94 48 c5 call 0x38a90 ; 0x38a90 21ebe: 49 81 ldd r20, Y+1 ; 0x01 21ec0: 5a 81 ldd r21, Y+2 ; 0x02 21ec2: 6b 81 ldd r22, Y+3 ; 0x03 21ec4: 7c 81 ldd r23, Y+4 ; 0x04 21ec6: 8d 81 ldd r24, Y+5 ; 0x05 21ec8: 0f 94 0d a5 call 0x34a1a ; 0x34a1a } 21ecc: 0f 90 pop r0 21ece: 0f 90 pop r0 21ed0: 0f 90 pop r0 21ed2: 0f 90 pop r0 21ed4: 0f 90 pop r0 21ed6: df 91 pop r29 21ed8: cf 91 pop r28 21eda: 08 95 ret 00021edc : break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 21edc: 80 e0 ldi r24, 0x00 ; 0 21ede: 0d 94 52 0f jmp 0x21ea4 ; 0x21ea4 00021ee2 : void MMU2::PowerOn() { power_on(); } bool MMU2::ReadRegister(uint8_t address) { 21ee2: 1f 93 push r17 21ee4: cf 93 push r28 21ee6: df 93 push r29 21ee8: 00 d0 rcall .+0 ; 0x21eea 21eea: 1f 92 push r1 21eec: 1f 92 push r1 21eee: cd b7 in r28, 0x3d ; 61 21ef0: de b7 in r29, 0x3e ; 62 21ef2: 18 2f mov r17, r24 if (!WaitForMMUReady()) { 21ef4: 0f 94 3f 88 call 0x3107e ; 0x3107e 21ef8: 88 23 and r24, r24 21efa: d9 f0 breq .+54 ; 0x21f32 void ProtocolLogic::Home(uint8_t mode) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Home, mode)); } void ProtocolLogic::ReadRegister(uint8_t address) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Read, address)); 21efc: 41 2f mov r20, r17 21efe: 62 e5 ldi r22, 0x52 ; 82 21f00: ce 01 movw r24, r28 21f02: 01 96 adiw r24, 0x01 ; 1 21f04: 0f 94 48 c5 call 0x38a90 ; 0x38a90 21f08: 49 81 ldd r20, Y+1 ; 0x01 21f0a: 5a 81 ldd r21, Y+2 ; 0x02 21f0c: 6b 81 ldd r22, Y+3 ; 0x03 21f0e: 7c 81 ldd r23, Y+4 ; 0x04 21f10: 8d 81 ldd r24, Y+5 ; 0x05 21f12: 0f 94 0d a5 call 0x34a1a ; 0x34a1a 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)); 21f16: 60 e0 ldi r22, 0x00 ; 0 21f18: 80 e0 ldi r24, 0x00 ; 0 21f1a: 0f 94 31 ac call 0x35862 ; 0x35862 21f1e: 88 23 and r24, r24 21f20: 69 f3 breq .-38 ; 0x21efc // Update cached value lastReadRegisterValue = logic.rsp.paramValue; 21f22: 20 91 65 13 lds r18, 0x1365 ; 0x801365 21f26: 30 91 66 13 lds r19, 0x1366 ; 0x801366 21f2a: 30 93 b6 13 sts 0x13B6, r19 ; 0x8013b6 21f2e: 20 93 b5 13 sts 0x13B5, r18 ; 0x8013b5 return true; } 21f32: 0f 90 pop r0 21f34: 0f 90 pop r0 21f36: 0f 90 pop r0 21f38: 0f 90 pop r0 21f3a: 0f 90 pop r0 21f3c: df 91 pop r29 21f3e: cf 91 pop r28 21f40: 1f 91 pop r17 21f42: 08 95 ret 00021f44 : waiting_handler(); } set_fan_speed(old_speed); } static uint16_t record(uint16_t samples = REC_BUFFER_SIZE) { 21f44: ff 92 push r15 21f46: 0f 93 push r16 21f48: 1f 93 push r17 21f4a: cf 93 push r28 21f4c: df 93 push r29 21f4e: 1f 92 push r1 21f50: cd b7 in r28, 0x3d ; 61 21f52: de b7 in r29, 0x3e ; 62 TempMgrGuard temp_mgr_guard; 21f54: ce 01 movw r24, r28 21f56: 01 96 adiw r24, 0x01 ; 1 21f58: 0f 94 70 31 call 0x262e0 ; 0x262e0 uint16_t pos = 0; 21f5c: 10 e0 ldi r17, 0x00 ; 0 21f5e: 00 e0 ldi r16, 0x00 ; 0 // stop recording for an hard error condition if(temp_error_state.v) return 0; // record a new entry rec_entry& entry = rec_buffer[pos]; 21f60: 85 e0 ldi r24, 0x05 ; 5 21f62: f8 2e mov r15, r24 static uint16_t record(uint16_t samples = REC_BUFFER_SIZE) { TempMgrGuard temp_mgr_guard; uint16_t pos = 0; while(pos < samples) { if(!TEMP_MGR_INT_FLAG_STATE()) { 21f64: d1 99 sbic 0x1a, 1 ; 26 21f66: 11 c0 rjmp .+34 ; 0x21f8a // temperatures not ready yet, just manage heaters while waiting to reduce jitter manage_heater(); 21f68: 0f 94 2e 38 call 0x2705c ; 0x2705c static uint16_t record(uint16_t samples = REC_BUFFER_SIZE) { TempMgrGuard temp_mgr_guard; uint16_t pos = 0; while(pos < samples) { 21f6c: 0e 3d cpi r16, 0xDE ; 222 21f6e: 11 05 cpc r17, r1 21f70: c9 f7 brne .-14 ; 0x21f64 } set_fan_speed(old_speed); } static uint16_t record(uint16_t samples = REC_BUFFER_SIZE) { TempMgrGuard temp_mgr_guard; 21f72: ce 01 movw r24, r28 21f74: 01 96 adiw r24, 0x01 ; 1 21f76: 0f 94 63 31 call 0x262c6 ; 0x262c6 // it's now safer to give regular serial/lcd updates a shot waiting_handler(); } return pos; } 21f7a: c8 01 movw r24, r16 21f7c: 0f 90 pop r0 21f7e: df 91 pop r29 21f80: cf 91 pop r28 21f82: 1f 91 pop r17 21f84: 0f 91 pop r16 21f86: ff 90 pop r15 21f88: 08 95 ret if(!TEMP_MGR_INT_FLAG_STATE()) { // temperatures not ready yet, just manage heaters while waiting to reduce jitter manage_heater(); continue; } TEMP_MGR_INT_FLAG_CLEAR(); 21f8a: d1 9a sbi 0x1a, 1 ; 26 // manually repeat what the regular isr would do if(adc_values_ready != true) continue; 21f8c: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16adc_values_ready.lto_priv.457> 21f90: 88 23 and r24, r24 21f92: 61 f3 breq .-40 ; 0x21f6c adc_values_ready = false; 21f94: 10 92 1b 05 sts 0x051B, r1 ; 0x80051b <_ZL16adc_values_ready.lto_priv.457> adc_start_cycle(); 21f98: 0e 94 ef 8d call 0x11bde ; 0x11bde temp_mgr_isr(); 21f9c: 0f 94 8b 35 call 0x26b16 ; 0x26b16 // stop recording for an hard error condition if(temp_error_state.v) 21fa0: 80 91 1a 05 lds r24, 0x051A ; 0x80051a <_ZL16temp_error_state.lto_priv.454> 21fa4: 81 11 cpse r24, r1 21fa6: 1b c0 rjmp .+54 ; 0x21fde return 0; // record a new entry rec_entry& entry = rec_buffer[pos]; 21fa8: f0 9e mul r15, r16 21faa: f0 01 movw r30, r0 21fac: f1 9e mul r15, r17 21fae: f0 0d add r31, r0 21fb0: 11 24 eor r1, r1 21fb2: ec 53 subi r30, 0x3C ; 60 21fb4: f9 4f sbci r31, 0xF9 ; 249 entry.temp = current_temperature_isr[0]; 21fb6: 80 91 16 05 lds r24, 0x0516 ; 0x800516 21fba: 90 91 17 05 lds r25, 0x0517 ; 0x800517 21fbe: a0 91 18 05 lds r26, 0x0518 ; 0x800518 21fc2: b0 91 19 05 lds r27, 0x0519 ; 0x800519 21fc6: 80 83 st Z, r24 21fc8: 91 83 std Z+1, r25 ; 0x01 21fca: a2 83 std Z+2, r26 ; 0x02 21fcc: b3 83 std Z+3, r27 ; 0x03 entry.pwm = soft_pwm[0]; 21fce: 80 91 15 05 lds r24, 0x0515 ; 0x800515 <_ZL8soft_pwm.lto_priv.459> 21fd2: 84 83 std Z+4, r24 ; 0x04 ++pos; 21fd4: 0f 5f subi r16, 0xFF ; 255 21fd6: 1f 4f sbci r17, 0xFF ; 255 // it's now safer to give regular serial/lcd updates a shot waiting_handler(); 21fd8: 0f 94 56 3a call 0x274ac ; 0x274ac 21fdc: c7 cf rjmp .-114 ; 0x21f6c adc_start_cycle(); temp_mgr_isr(); // stop recording for an hard error condition if(temp_error_state.v) return 0; 21fde: 10 e0 ldi r17, 0x00 ; 0 21fe0: 00 e0 ldi r16, 0x00 ; 0 21fe2: c7 cf rjmp .-114 ; 0x21f72 00021fe4 : #endif // TMC2130 static inline bool pgm_is_whitespace(const char *c_addr) { const char c = pgm_read_byte(c_addr); 21fe4: fc 01 movw r30, r24 21fe6: 94 91 lpm r25, Z return c == ' ' || c == '\t' || c == '\r' || c == '\n'; 21fe8: 90 32 cpi r25, 0x20 ; 32 21fea: 49 f0 breq .+18 ; 0x21ffe 21fec: 87 ef ldi r24, 0xF7 ; 247 21fee: 89 0f add r24, r25 21ff0: 82 30 cpi r24, 0x02 ; 2 21ff2: 28 f0 brcs .+10 ; 0x21ffe 21ff4: 81 e0 ldi r24, 0x01 ; 1 21ff6: 9d 30 cpi r25, 0x0D ; 13 21ff8: 19 f0 breq .+6 ; 0x22000 21ffa: 80 e0 ldi r24, 0x00 ; 0 21ffc: 08 95 ret 21ffe: 81 e0 ldi r24, 0x01 ; 1 } 22000: 08 95 ret 00022002 : 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; 22002: 88 3e cpi r24, 0xE8 ; 232 22004: 23 e0 ldi r18, 0x03 ; 3 22006: 92 07 cpc r25, r18 22008: 10 f0 brcs .+4 ; 0x2200e 2200a: 87 ee ldi r24, 0xE7 ; 231 2200c: 93 e0 ldi r25, 0x03 ; 3 } 2200e: 08 95 ret 00022010 : return 0; } int uart2_getchar(_UNUSED FILE *stream) { if (rbuf_empty(uart2_ibuf)) return -1; 22010: 90 91 3b 05 lds r25, 0x053B ; 0x80053b 22014: 80 91 3a 05 lds r24, 0x053A ; 0x80053a 22018: 2f ef ldi r18, 0xFF ; 255 2201a: 3f ef ldi r19, 0xFF ; 255 2201c: 89 17 cp r24, r25 2201e: 71 f0 breq .+28 ; 0x2203c _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 22020: e9 2f mov r30, r25 22022: f0 e0 ldi r31, 0x00 ; 0 22024: e3 5c subi r30, 0xC3 ; 195 22026: fa 4f sbci r31, 0xFA ; 250 22028: 20 81 ld r18, Z 2202a: 30 e0 ldi r19, 0x00 ; 0 buf_r++; //increment read index 2202c: 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 2202e: 80 91 39 05 lds r24, 0x0539 ; 0x800539 22032: 98 17 cp r25, r24 22034: 08 f0 brcs .+2 ; 0x22038 22036: 90 e0 ldi r25, 0x00 ; 0 ptr[2] = buf_r; //store read index 22038: 90 93 3b 05 sts 0x053B, r25 ; 0x80053b return rbuf_get(uart2_ibuf); } 2203c: c9 01 movw r24, r18 2203e: 08 95 ret 00022040 : FILE _uart2io = {0}; int uart2_putchar(char c, _UNUSED FILE *stream) { while (!uart2_txready); 22040: 90 91 d0 00 lds r25, 0x00D0 ; 0x8000d0 <__TEXT_REGION_LENGTH__+0x7c20d0> 22044: 95 ff sbrs r25, 5 22046: fc cf rjmp .-8 ; 0x22040 UDR2 = c; // transmit byte 22048: 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; } 2204c: 90 e0 ldi r25, 0x00 ; 0 2204e: 80 e0 ldi r24, 0x00 ; 0 22050: 08 95 ret 00022052 : } while (i++ != 255); tmc2130_wr_MSLUTSEL(axis, x[0], x[1], x[2], w[0], w[1], w[2], w[3]); } void bubblesort_uint8(uint8_t* data, uint8_t size, uint8_t* data2) { 22052: cf 92 push r12 22054: df 92 push r13 22056: ef 92 push r14 22058: ff 92 push r15 2205a: 0f 93 push r16 2205c: 1f 93 push r17 2205e: cf 93 push r28 22060: df 93 push r29 22062: 8c 01 movw r16, r24 22064: ea 01 movw r28, r20 uint8_t changed = 1; while (changed) { changed = 0; for (uint8_t i = 0; i < (size - 1); i++) 22066: 90 e0 ldi r25, 0x00 ; 0 void bubblesort_uint8(uint8_t* data, uint8_t size, uint8_t* data2) { uint8_t changed = 1; while (changed) { changed = 0; 22068: 50 e0 ldi r21, 0x00 ; 0 for (uint8_t i = 0; i < (size - 1); i++) 2206a: 61 50 subi r22, 0x01 ; 1 2206c: 77 0b sbc r23, r23 2206e: 29 2f mov r18, r25 22070: 30 e0 ldi r19, 0x00 ; 0 22072: 26 17 cp r18, r22 22074: 37 07 cpc r19, r23 22076: 2c f0 brlt .+10 ; 0x22082 } void bubblesort_uint8(uint8_t* data, uint8_t size, uint8_t* data2) { uint8_t changed = 1; while (changed) 22078: 55 23 and r21, r21 2207a: 19 f1 breq .+70 ; 0x220c2 { changed = 0; for (uint8_t i = 0; i < (size - 1); i++) 2207c: 90 e0 ldi r25, 0x00 ; 0 void bubblesort_uint8(uint8_t* data, uint8_t size, uint8_t* data2) { uint8_t changed = 1; while (changed) { changed = 0; 2207e: 50 e0 ldi r21, 0x00 ; 0 22080: f6 cf rjmp .-20 ; 0x2206e for (uint8_t i = 0; i < (size - 1); i++) if (data[i] > data[i+1]) 22082: 78 01 movw r14, r16 22084: e2 0e add r14, r18 22086: f3 1e adc r15, r19 22088: f7 01 movw r30, r14 2208a: 80 81 ld r24, Z 2208c: d9 01 movw r26, r18 2208e: 11 96 adiw r26, 0x01 ; 1 22090: 68 01 movw r12, r16 22092: ca 0e add r12, r26 22094: db 1e adc r13, r27 22096: f6 01 movw r30, r12 22098: 40 81 ld r20, Z 2209a: 48 17 cp r20, r24 2209c: 80 f4 brcc .+32 ; 0x220be { uint8_t d = data[i]; data[i] = data[i+1]; 2209e: f7 01 movw r30, r14 220a0: 40 83 st Z, r20 data[i+1] = d; 220a2: f6 01 movw r30, r12 220a4: 80 83 st Z, r24 if (data2) 220a6: 20 97 sbiw r28, 0x00 ; 0 220a8: 49 f0 breq .+18 ; 0x220bc { d = data2[i]; 220aa: fe 01 movw r30, r28 220ac: e2 0f add r30, r18 220ae: f3 1f adc r31, r19 220b0: 80 81 ld r24, Z data2[i] = data2[i+1]; 220b2: ac 0f add r26, r28 220b4: bd 1f adc r27, r29 220b6: 2c 91 ld r18, X 220b8: 20 83 st Z, r18 data2[i+1] = d; 220ba: 8c 93 st X, r24 } changed = 1; 220bc: 51 e0 ldi r21, 0x01 ; 1 { uint8_t changed = 1; while (changed) { changed = 0; for (uint8_t i = 0; i < (size - 1); i++) 220be: 9f 5f subi r25, 0xFF ; 255 220c0: d6 cf rjmp .-84 ; 0x2206e data2[i+1] = d; } changed = 1; } } } 220c2: df 91 pop r29 220c4: cf 91 pop r28 220c6: 1f 91 pop r17 220c8: 0f 91 pop r16 220ca: ff 90 pop r15 220cc: ef 90 pop r14 220ce: df 90 pop r13 220d0: cf 90 pop r12 220d2: 08 95 ret 000220d4 : } } inline void tmc2130_cs_high(uint8_t axis) { switch (axis) 220d4: 81 30 cpi r24, 0x01 ; 1 220d6: 41 f0 breq .+16 ; 0x220e8 220d8: 28 f0 brcs .+10 ; 0x220e4 220da: 82 30 cpi r24, 0x02 ; 2 220dc: 39 f0 breq .+14 ; 0x220ec 220de: 83 30 cpi r24, 0x03 ; 3 220e0: 71 f0 breq .+28 ; 0x220fe 220e2: 08 95 ret { case X_AXIS: WRITE(X_TMC2130_CS, HIGH); break; 220e4: a0 9a sbi 0x14, 0 ; 20 220e6: 08 95 ret case Y_AXIS: WRITE(Y_TMC2130_CS, HIGH); break; 220e8: a2 9a sbi 0x14, 2 ; 20 220ea: 08 95 ret case Z_AXIS: WRITE(Z_TMC2130_CS, HIGH); break; 220ec: 9f b7 in r25, 0x3f ; 63 220ee: f8 94 cli 220f0: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 220f4: 80 62 ori r24, 0x20 ; 32 case E_AXIS: WRITE(E0_TMC2130_CS, HIGH); break; 220f6: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 220fa: 9f bf out 0x3f, r25 ; 63 } } 220fc: 08 95 ret switch (axis) { case X_AXIS: WRITE(X_TMC2130_CS, HIGH); break; case Y_AXIS: WRITE(Y_TMC2130_CS, HIGH); break; case Z_AXIS: WRITE(Z_TMC2130_CS, HIGH); break; case E_AXIS: WRITE(E0_TMC2130_CS, HIGH); break; 220fe: 9f b7 in r25, 0x3f ; 63 22100: f8 94 cli 22102: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22106: 80 61 ori r24, 0x10 ; 16 22108: f6 cf rjmp .-20 ; 0x220f6 0002210a : } inline void tmc2130_cs_low(uint8_t axis) { switch (axis) 2210a: 81 30 cpi r24, 0x01 ; 1 2210c: 41 f0 breq .+16 ; 0x2211e 2210e: 28 f0 brcs .+10 ; 0x2211a 22110: 82 30 cpi r24, 0x02 ; 2 22112: 39 f0 breq .+14 ; 0x22122 22114: 83 30 cpi r24, 0x03 ; 3 22116: 71 f0 breq .+28 ; 0x22134 22118: 08 95 ret { case X_AXIS: WRITE(X_TMC2130_CS, LOW); break; 2211a: a0 98 cbi 0x14, 0 ; 20 2211c: 08 95 ret case Y_AXIS: WRITE(Y_TMC2130_CS, LOW); break; 2211e: a2 98 cbi 0x14, 2 ; 20 22120: 08 95 ret case Z_AXIS: WRITE(Z_TMC2130_CS, LOW); break; 22122: 9f b7 in r25, 0x3f ; 63 22124: f8 94 cli 22126: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 2212a: 8f 7d andi r24, 0xDF ; 223 case E_AXIS: WRITE(E0_TMC2130_CS, LOW); break; 2212c: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22130: 9f bf out 0x3f, r25 ; 63 } } 22132: 08 95 ret switch (axis) { case X_AXIS: WRITE(X_TMC2130_CS, LOW); break; case Y_AXIS: WRITE(Y_TMC2130_CS, LOW); break; case Z_AXIS: WRITE(Z_TMC2130_CS, LOW); break; case E_AXIS: WRITE(E0_TMC2130_CS, LOW); break; 22134: 9f b7 in r25, 0x3f ; 63 22136: f8 94 cli 22138: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 2213c: 8f 7e andi r24, 0xEF ; 239 2213e: f6 cf rjmp .-20 ; 0x2212c 00022140 : } static inline uint8_t spi_txrx(uint8_t tx) { SPDR = tx; 22140: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))); 22142: 0d b4 in r0, 0x2d ; 45 22144: 07 fe sbrs r0, 7 22146: fd cf rjmp .-6 ; 0x22142 return SPDR; 22148: 8e b5 in r24, 0x2e ; 46 } 2214a: 08 95 ret 0002214c : #endif temp_meas_ready = true; } static void temp_mgr_pid() { 2214c: 2f 92 push r2 2214e: 3f 92 push r3 22150: 4f 92 push r4 22152: 5f 92 push r5 22154: 6f 92 push r6 22156: 7f 92 push r7 22158: 8f 92 push r8 2215a: 9f 92 push r9 2215c: af 92 push r10 2215e: bf 92 push r11 22160: cf 92 push r12 22162: df 92 push r13 22164: ef 92 push r14 22166: ff 92 push r15 22168: 0f 93 push r16 2216a: 1f 93 push r17 2216c: cf 93 push r28 2216e: df 93 push r29 22170: cd b7 in r28, 0x3d ; 61 22172: de b7 in r29, 0x3e ; 62 22174: 2e 97 sbiw r28, 0x0e ; 14 22176: 0f b6 in r0, 0x3f ; 63 22178: f8 94 cli 2217a: de bf out 0x3e, r29 ; 62 2217c: 0f be out 0x3f, r0 ; 63 2217e: 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]); 22180: 20 90 1d 06 lds r2, 0x061D ; 0x80061d 22184: 30 90 1e 06 lds r3, 0x061E ; 0x80061e 22188: 40 90 16 05 lds r4, 0x0516 ; 0x800516 2218c: 50 90 17 05 lds r5, 0x0517 ; 0x800517 22190: 60 90 18 05 lds r6, 0x0518 ; 0x800518 22194: 70 90 19 05 lds r7, 0x0519 ; 0x800519 #ifdef PIDTEMP pid_input = current; #ifndef PID_OPENLOOP if(target == 0) { 22198: 21 14 cp r2, r1 2219a: 31 04 cpc r3, r1 2219c: 39 f4 brne .+14 ; 0x221ac pid_output = 0; pid_reset[e] = true; 2219e: 81 e0 ldi r24, 0x01 ; 1 221a0: 80 93 f4 05 sts 0x05F4, r24 ; 0x8005f4 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; 221a4: 81 2c mov r8, r1 221a6: 91 2c mov r9, r1 221a8: 54 01 movw r10, r8 221aa: f9 c0 rjmp .+498 ; 0x2239e #ifndef PID_OPENLOOP if(target == 0) { pid_output = 0; pid_reset[e] = true; } else { pid_error[e] = target - pid_input; 221ac: b1 01 movw r22, r2 221ae: 03 2c mov r0, r3 221b0: 00 0c add r0, r0 221b2: 88 0b sbc r24, r24 221b4: 99 0b sbc r25, r25 221b6: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 221ba: a3 01 movw r20, r6 221bc: 92 01 movw r18, r4 221be: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 221c2: 6b 01 movw r12, r22 221c4: 7c 01 movw r14, r24 if(pid_reset[e]) { 221c6: 80 91 f4 05 lds r24, 0x05F4 ; 0x8005f4 221ca: 88 23 and r24, r24 221cc: 91 f0 breq .+36 ; 0x221f2 iState_sum[e] = 0.0; 221ce: 10 92 f0 05 sts 0x05F0, r1 ; 0x8005f0 221d2: 10 92 f1 05 sts 0x05F1, r1 ; 0x8005f1 221d6: 10 92 f2 05 sts 0x05F2, r1 ; 0x8005f2 221da: 10 92 f3 05 sts 0x05F3, r1 ; 0x8005f3 dTerm[e] = 0.0; // 'dState_last[e]' initial setting is not necessary (see end of if-statement) 221de: 10 92 ec 05 sts 0x05EC, r1 ; 0x8005ec 221e2: 10 92 ed 05 sts 0x05ED, r1 ; 0x8005ed 221e6: 10 92 ee 05 sts 0x05EE, r1 ; 0x8005ee 221ea: 10 92 ef 05 sts 0x05EF, r1 ; 0x8005ef pid_reset[e] = false; 221ee: 10 92 f4 05 sts 0x05F4, r1 ; 0x8005f4 } #ifndef PonM pTerm[e] = cs.Kp * pid_error[e]; 221f2: 20 91 25 0e lds r18, 0x0E25 ; 0x800e25 221f6: 30 91 26 0e lds r19, 0x0E26 ; 0x800e26 221fa: 40 91 27 0e lds r20, 0x0E27 ; 0x800e27 221fe: 50 91 28 0e lds r21, 0x0E28 ; 0x800e28 22202: c7 01 movw r24, r14 22204: b6 01 movw r22, r12 22206: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 2220a: 69 83 std Y+1, r22 ; 0x01 2220c: 7a 83 std Y+2, r23 ; 0x02 2220e: 8b 83 std Y+3, r24 ; 0x03 22210: 9c 83 std Y+4, r25 ; 0x04 iState_sum[e] += pid_error[e]; 22212: 20 91 f0 05 lds r18, 0x05F0 ; 0x8005f0 22216: 30 91 f1 05 lds r19, 0x05F1 ; 0x8005f1 2221a: 40 91 f2 05 lds r20, 0x05F2 ; 0x8005f2 2221e: 50 91 f3 05 lds r21, 0x05F3 ; 0x8005f3 22222: c7 01 movw r24, r14 22224: b6 01 movw r22, r12 22226: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 2222a: 4b 01 movw r8, r22 2222c: 5c 01 movw r10, r24 iState_sum[e] = constrain(iState_sum[e], iState_sum_min[e], iState_sum_max[e]); 2222e: 20 91 b2 04 lds r18, 0x04B2 ; 0x8004b2 <_ZL14iState_sum_min.lto_priv.468> 22232: 2d 87 std Y+13, r18 ; 0x0d 22234: 30 91 b3 04 lds r19, 0x04B3 ; 0x8004b3 <_ZL14iState_sum_min.lto_priv.468+0x1> 22238: 39 87 std Y+9, r19 ; 0x09 2223a: 10 91 b4 04 lds r17, 0x04B4 ; 0x8004b4 <_ZL14iState_sum_min.lto_priv.468+0x2> 2223e: 00 91 b5 04 lds r16, 0x04B5 ; 0x8004b5 <_ZL14iState_sum_min.lto_priv.468+0x3> 22242: 41 2f mov r20, r17 22244: 50 2f mov r21, r16 22246: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 2224a: 87 fd sbrc r24, 7 2224c: 17 c0 rjmp .+46 ; 0x2227c 2224e: 80 91 ae 04 lds r24, 0x04AE ; 0x8004ae <_ZL14iState_sum_max.lto_priv.469> 22252: 8d 87 std Y+13, r24 ; 0x0d 22254: 90 91 af 04 lds r25, 0x04AF ; 0x8004af <_ZL14iState_sum_max.lto_priv.469+0x1> 22258: 99 87 std Y+9, r25 ; 0x09 2225a: 10 91 b0 04 lds r17, 0x04B0 ; 0x8004b0 <_ZL14iState_sum_max.lto_priv.469+0x2> 2225e: 00 91 b1 04 lds r16, 0x04B1 ; 0x8004b1 <_ZL14iState_sum_max.lto_priv.469+0x3> 22262: 9c 01 movw r18, r24 22264: 41 2f mov r20, r17 22266: 50 2f mov r21, r16 22268: b4 01 movw r22, r8 2226a: c5 01 movw r24, r10 2226c: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 22270: 18 16 cp r1, r24 22272: 24 f0 brlt .+8 ; 0x2227c 22274: 8d 86 std Y+13, r8 ; 0x0d 22276: 99 86 std Y+9, r9 ; 0x09 22278: 1a 2d mov r17, r10 2227a: 0b 2d mov r16, r11 2227c: 8d 85 ldd r24, Y+13 ; 0x0d 2227e: 99 85 ldd r25, Y+9 ; 0x09 22280: a1 2f mov r26, r17 22282: b0 2f mov r27, r16 22284: 80 93 f0 05 sts 0x05F0, r24 ; 0x8005f0 22288: 90 93 f1 05 sts 0x05F1, r25 ; 0x8005f1 2228c: a0 93 f2 05 sts 0x05F2, r26 ; 0x8005f2 22290: b0 93 f3 05 sts 0x05F3, r27 ; 0x8005f3 iTerm[e] = cs.Ki * iState_sum[e]; 22294: 20 91 29 0e lds r18, 0x0E29 ; 0x800e29 22298: 30 91 2a 0e lds r19, 0x0E2A ; 0x800e2a 2229c: 40 91 2b 0e lds r20, 0x0E2B ; 0x800e2b 222a0: 50 91 2c 0e lds r21, 0x0E2C ; 0x800e2c 222a4: bc 01 movw r22, r24 222a6: 81 2f mov r24, r17 222a8: 90 2f mov r25, r16 222aa: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 222ae: 6d 83 std Y+5, r22 ; 0x05 222b0: 7e 83 std Y+6, r23 ; 0x06 222b2: 8f 83 std Y+7, r24 ; 0x07 222b4: 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 222b6: 20 91 e8 05 lds r18, 0x05E8 ; 0x8005e8 222ba: 30 91 e9 05 lds r19, 0x05E9 ; 0x8005e9 222be: 40 91 ea 05 lds r20, 0x05EA ; 0x8005ea 222c2: 50 91 eb 05 lds r21, 0x05EB ; 0x8005eb 222c6: c3 01 movw r24, r6 222c8: b2 01 movw r22, r4 222ca: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 222ce: 20 91 2d 0e lds r18, 0x0E2D ; 0x800e2d 222d2: 30 91 2e 0e lds r19, 0x0E2E ; 0x800e2e 222d6: 40 91 2f 0e lds r20, 0x0E2F ; 0x800e2f 222da: 50 91 30 0e lds r21, 0x0E30 ; 0x800e30 222de: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 222e2: 20 ed ldi r18, 0xD0 ; 208 222e4: 3c ec ldi r19, 0xCC ; 204 222e6: 4c e4 ldi r20, 0x4C ; 76 222e8: 5d e3 ldi r21, 0x3D ; 61 222ea: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 222ee: 4b 01 movw r8, r22 222f0: 5c 01 movw r10, r24 222f2: 23 e3 ldi r18, 0x33 ; 51 222f4: 33 e3 ldi r19, 0x33 ; 51 222f6: 43 e7 ldi r20, 0x73 ; 115 222f8: 5f e3 ldi r21, 0x3F ; 63 222fa: 60 91 ec 05 lds r22, 0x05EC ; 0x8005ec 222fe: 70 91 ed 05 lds r23, 0x05ED ; 0x8005ed 22302: 80 91 ee 05 lds r24, 0x05EE ; 0x8005ee 22306: 90 91 ef 05 lds r25, 0x05EF ; 0x8005ef 2230a: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 2230e: 9b 01 movw r18, r22 22310: ac 01 movw r20, r24 22312: c5 01 movw r24, r10 22314: b4 01 movw r22, r8 22316: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 2231a: 4b 01 movw r8, r22 2231c: 5c 01 movw r10, r24 2231e: 80 92 ec 05 sts 0x05EC, r8 ; 0x8005ec 22322: 90 92 ed 05 sts 0x05ED, r9 ; 0x8005ed 22326: a0 92 ee 05 sts 0x05EE, r10 ; 0x8005ee 2232a: b0 92 ef 05 sts 0x05EF, r11 ; 0x8005ef 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) 2232e: 2d 81 ldd r18, Y+5 ; 0x05 22330: 3e 81 ldd r19, Y+6 ; 0x06 22332: 4f 81 ldd r20, Y+7 ; 0x07 22334: 58 85 ldd r21, Y+8 ; 0x08 22336: 69 81 ldd r22, Y+1 ; 0x01 22338: 7a 81 ldd r23, Y+2 ; 0x02 2233a: 8b 81 ldd r24, Y+3 ; 0x03 2233c: 9c 81 ldd r25, Y+4 ; 0x04 2233e: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 22342: a5 01 movw r20, r10 22344: 94 01 movw r18, r8 22346: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 2234a: 4b 01 movw r8, r22 2234c: 5c 01 movw r10, r24 if (pid_output > PID_MAX) { 2234e: 20 e0 ldi r18, 0x00 ; 0 22350: 30 e0 ldi r19, 0x00 ; 0 22352: 4f e7 ldi r20, 0x7F ; 127 22354: 53 e4 ldi r21, 0x43 ; 67 22356: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> if (pid_error[e] > 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 2235a: 20 e0 ldi r18, 0x00 ; 0 2235c: 30 e0 ldi r19, 0x00 ; 0 2235e: 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) { 22360: 18 16 cp r1, r24 22362: 0c f0 brlt .+2 ; 0x22366 22364: 6d c1 rjmp .+730 ; 0x22640 if (pid_error[e] > 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 22366: c7 01 movw r24, r14 22368: b6 01 movw r22, r12 2236a: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 2236e: 18 16 cp r1, r24 22370: 84 f4 brge .+32 ; 0x22392 22372: a7 01 movw r20, r14 22374: 96 01 movw r18, r12 22376: 6d 85 ldd r22, Y+13 ; 0x0d 22378: 79 85 ldd r23, Y+9 ; 0x09 2237a: 81 2f mov r24, r17 2237c: 90 2f mov r25, r16 2237e: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 22382: 60 93 f0 05 sts 0x05F0, r22 ; 0x8005f0 22386: 70 93 f1 05 sts 0x05F1, r23 ; 0x8005f1 2238a: 80 93 f2 05 sts 0x05F2, r24 ; 0x8005f2 2238e: 90 93 f3 05 sts 0x05F3, r25 ; 0x8005f3 pid_output=PID_MAX; 22392: 81 2c mov r8, r1 22394: 91 2c mov r9, r1 22396: 3f e7 ldi r19, 0x7F ; 127 22398: a3 2e mov r10, r19 2239a: 33 e4 ldi r19, 0x43 ; 67 2239c: 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; 2239e: 40 92 e8 05 sts 0x05E8, r4 ; 0x8005e8 223a2: 50 92 e9 05 sts 0x05E9, r5 ; 0x8005e9 223a6: 60 92 ea 05 sts 0x05EA, r6 ; 0x8005ea 223aa: 70 92 eb 05 sts 0x05EB, r7 ; 0x8005eb pid_output = PID_MAX; } #endif // Check if temperature is within the correct range if((current < maxttemp[e]) && (target != 0)) 223ae: 60 91 56 02 lds r22, 0x0256 ; 0x800256 <_ZL8maxttemp.lto_priv.470> 223b2: 70 91 57 02 lds r23, 0x0257 ; 0x800257 <_ZL8maxttemp.lto_priv.470+0x1> 223b6: 07 2e mov r0, r23 223b8: 00 0c add r0, r0 223ba: 88 0b sbc r24, r24 223bc: 99 0b sbc r25, r25 223be: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 223c2: 9b 01 movw r18, r22 223c4: ac 01 movw r20, r24 223c6: c3 01 movw r24, r6 223c8: b2 01 movw r22, r4 223ca: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 223ce: 87 ff sbrs r24, 7 223d0: 57 c1 rjmp .+686 ; 0x22680 223d2: 23 28 or r2, r3 223d4: 09 f4 brne .+2 ; 0x223d8 223d6: 54 c1 rjmp .+680 ; 0x22680 soft_pwm[e] = (int)pid_output >> 1; 223d8: c5 01 movw r24, r10 223da: b4 01 movw r22, r8 223dc: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> 223e0: 75 95 asr r23 223e2: 67 95 ror r22 223e4: 60 93 15 05 sts 0x0515, r22 ; 0x800515 <_ZL8soft_pwm.lto_priv.459> 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); 223e8: 20 91 16 06 lds r18, 0x0616 ; 0x800616 223ec: 30 91 17 06 lds r19, 0x0617 ; 0x800617 223f0: 3a 83 std Y+2, r19 ; 0x02 223f2: 29 83 std Y+1, r18 ; 0x01 223f4: 40 90 18 06 lds r4, 0x0618 ; 0x800618 223f8: 50 90 19 06 lds r5, 0x0619 ; 0x800619 223fc: 60 90 1a 06 lds r6, 0x061A ; 0x80061a 22400: 70 90 1b 06 lds r7, 0x061B ; 0x80061b #ifdef PIDTEMPBED pid_input = current; #ifndef PID_OPENLOOP pid_error_bed = target - pid_input; 22404: b9 01 movw r22, r18 22406: 33 0f add r19, r19 22408: 88 0b sbc r24, r24 2240a: 99 0b sbc r25, r25 2240c: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 22410: a3 01 movw r20, r6 22412: 92 01 movw r18, r4 22414: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 22418: 6b 01 movw r12, r22 2241a: 7c 01 movw r14, r24 pTerm_bed = cs.bedKp * pid_error_bed; 2241c: 20 91 31 0e lds r18, 0x0E31 ; 0x800e31 22420: 30 91 32 0e lds r19, 0x0E32 ; 0x800e32 22424: 40 91 33 0e lds r20, 0x0E33 ; 0x800e33 22428: 50 91 34 0e lds r21, 0x0E34 ; 0x800e34 2242c: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 22430: 6d 83 std Y+5, r22 ; 0x05 22432: 7e 83 std Y+6, r23 ; 0x06 22434: 8f 83 std Y+7, r24 ; 0x07 22436: 98 87 std Y+8, r25 ; 0x08 temp_iState_bed += pid_error_bed; 22438: 20 91 fd 05 lds r18, 0x05FD ; 0x8005fd 2243c: 30 91 fe 05 lds r19, 0x05FE ; 0x8005fe 22440: 40 91 ff 05 lds r20, 0x05FF ; 0x8005ff 22444: 50 91 00 06 lds r21, 0x0600 ; 0x800600 22448: c7 01 movw r24, r14 2244a: b6 01 movw r22, r12 2244c: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 22450: 5b 01 movw r10, r22 22452: 8c 01 movw r16, r24 temp_iState_bed = constrain(temp_iState_bed, temp_iState_min_bed, temp_iState_max_bed); 22454: 30 91 aa 04 lds r19, 0x04AA ; 0x8004aa <_ZL19temp_iState_min_bed.lto_priv.466> 22458: 3e 87 std Y+14, r19 ; 0x0e 2245a: 80 91 ab 04 lds r24, 0x04AB ; 0x8004ab <_ZL19temp_iState_min_bed.lto_priv.466+0x1> 2245e: 8d 87 std Y+13, r24 ; 0x0d 22460: 30 90 ac 04 lds r3, 0x04AC ; 0x8004ac <_ZL19temp_iState_min_bed.lto_priv.466+0x2> 22464: 20 90 ad 04 lds r2, 0x04AD ; 0x8004ad <_ZL19temp_iState_min_bed.lto_priv.466+0x3> 22468: 23 2f mov r18, r19 2246a: 38 2f mov r19, r24 2246c: 43 2d mov r20, r3 2246e: 52 2d mov r21, r2 22470: b5 01 movw r22, r10 22472: c8 01 movw r24, r16 22474: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 22478: 87 fd sbrc r24, 7 2247a: 18 c0 rjmp .+48 ; 0x224ac 2247c: 90 91 a6 04 lds r25, 0x04A6 ; 0x8004a6 <_ZL19temp_iState_max_bed.lto_priv.467> 22480: 9e 87 std Y+14, r25 ; 0x0e 22482: 20 91 a7 04 lds r18, 0x04A7 ; 0x8004a7 <_ZL19temp_iState_max_bed.lto_priv.467+0x1> 22486: 2d 87 std Y+13, r18 ; 0x0d 22488: 30 90 a8 04 lds r3, 0x04A8 ; 0x8004a8 <_ZL19temp_iState_max_bed.lto_priv.467+0x2> 2248c: 20 90 a9 04 lds r2, 0x04A9 ; 0x8004a9 <_ZL19temp_iState_max_bed.lto_priv.467+0x3> 22490: 29 2f mov r18, r25 22492: 3d 85 ldd r19, Y+13 ; 0x0d 22494: 43 2d mov r20, r3 22496: 52 2d mov r21, r2 22498: b5 01 movw r22, r10 2249a: c8 01 movw r24, r16 2249c: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 224a0: 18 16 cp r1, r24 224a2: 24 f0 brlt .+8 ; 0x224ac 224a4: ae 86 std Y+14, r10 ; 0x0e 224a6: bd 86 std Y+13, r11 ; 0x0d 224a8: 30 2e mov r3, r16 224aa: 21 2e mov r2, r17 224ac: 8e 85 ldd r24, Y+14 ; 0x0e 224ae: 9d 85 ldd r25, Y+13 ; 0x0d 224b0: a3 2d mov r26, r3 224b2: b2 2d mov r27, r2 224b4: 80 93 fd 05 sts 0x05FD, r24 ; 0x8005fd 224b8: 90 93 fe 05 sts 0x05FE, r25 ; 0x8005fe 224bc: a0 93 ff 05 sts 0x05FF, r26 ; 0x8005ff 224c0: b0 93 00 06 sts 0x0600, r27 ; 0x800600 iTerm_bed = cs.bedKi * temp_iState_bed; 224c4: 20 91 35 0e lds r18, 0x0E35 ; 0x800e35 224c8: 30 91 36 0e lds r19, 0x0E36 ; 0x800e36 224cc: 40 91 37 0e lds r20, 0x0E37 ; 0x800e37 224d0: 50 91 38 0e lds r21, 0x0E38 ; 0x800e38 224d4: bc 01 movw r22, r24 224d6: 83 2d mov r24, r3 224d8: 92 2d mov r25, r2 224da: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 224de: 69 87 std Y+9, r22 ; 0x09 224e0: 7a 87 std Y+10, r23 ; 0x0a 224e2: 8b 87 std Y+11, r24 ; 0x0b 224e4: 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); 224e6: 20 91 f9 05 lds r18, 0x05F9 ; 0x8005f9 224ea: 30 91 fa 05 lds r19, 0x05FA ; 0x8005fa 224ee: 40 91 fb 05 lds r20, 0x05FB ; 0x8005fb 224f2: 50 91 fc 05 lds r21, 0x05FC ; 0x8005fc 224f6: c3 01 movw r24, r6 224f8: b2 01 movw r22, r4 224fa: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 224fe: 20 91 39 0e lds r18, 0x0E39 ; 0x800e39 22502: 30 91 3a 0e lds r19, 0x0E3A ; 0x800e3a 22506: 40 91 3b 0e lds r20, 0x0E3B ; 0x800e3b 2250a: 50 91 3c 0e lds r21, 0x0E3C ; 0x800e3c 2250e: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 22512: 20 ed ldi r18, 0xD0 ; 208 22514: 3c ec ldi r19, 0xCC ; 204 22516: 4c e4 ldi r20, 0x4C ; 76 22518: 5d e3 ldi r21, 0x3D ; 61 2251a: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 2251e: 4b 01 movw r8, r22 22520: 5c 01 movw r10, r24 22522: 23 e3 ldi r18, 0x33 ; 51 22524: 33 e3 ldi r19, 0x33 ; 51 22526: 43 e7 ldi r20, 0x73 ; 115 22528: 5f e3 ldi r21, 0x3F ; 63 2252a: 60 91 f5 05 lds r22, 0x05F5 ; 0x8005f5 2252e: 70 91 f6 05 lds r23, 0x05F6 ; 0x8005f6 22532: 80 91 f7 05 lds r24, 0x05F7 ; 0x8005f7 22536: 90 91 f8 05 lds r25, 0x05F8 ; 0x8005f8 2253a: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 2253e: 9b 01 movw r18, r22 22540: ac 01 movw r20, r24 22542: c5 01 movw r24, r10 22544: b4 01 movw r22, r8 22546: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 2254a: 4b 01 movw r8, r22 2254c: 5c 01 movw r10, r24 2254e: 80 92 f5 05 sts 0x05F5, r8 ; 0x8005f5 22552: 90 92 f6 05 sts 0x05F6, r9 ; 0x8005f6 22556: a0 92 f7 05 sts 0x05F7, r10 ; 0x8005f7 2255a: b0 92 f8 05 sts 0x05F8, r11 ; 0x8005f8 temp_dState_bed = pid_input; 2255e: 40 92 f9 05 sts 0x05F9, r4 ; 0x8005f9 22562: 50 92 fa 05 sts 0x05FA, r5 ; 0x8005fa 22566: 60 92 fb 05 sts 0x05FB, r6 ; 0x8005fb 2256a: 70 92 fc 05 sts 0x05FC, r7 ; 0x8005fc pid_output = pTerm_bed + iTerm_bed - dTerm_bed; 2256e: 29 85 ldd r18, Y+9 ; 0x09 22570: 3a 85 ldd r19, Y+10 ; 0x0a 22572: 4b 85 ldd r20, Y+11 ; 0x0b 22574: 5c 85 ldd r21, Y+12 ; 0x0c 22576: 6d 81 ldd r22, Y+5 ; 0x05 22578: 7e 81 ldd r23, Y+6 ; 0x06 2257a: 8f 81 ldd r24, Y+7 ; 0x07 2257c: 98 85 ldd r25, Y+8 ; 0x08 2257e: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 22582: a5 01 movw r20, r10 22584: 94 01 movw r18, r8 22586: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 2258a: 4b 01 movw r8, r22 2258c: 5c 01 movw r10, r24 if (pid_output > MAX_BED_POWER) { 2258e: 20 e0 ldi r18, 0x00 ; 0 22590: 30 e0 ldi r19, 0x00 ; 0 22592: 4f e7 ldi r20, 0x7F ; 127 22594: 53 e4 ldi r21, 0x43 ; 67 22596: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> if (pid_error_bed > 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 2259a: 20 e0 ldi r18, 0x00 ; 0 2259c: 30 e0 ldi r19, 0x00 ; 0 2259e: 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) { 225a0: 18 16 cp r1, r24 225a2: 0c f0 brlt .+2 ; 0x225a6 225a4: 70 c0 rjmp .+224 ; 0x22686 if (pid_error_bed > 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 225a6: c7 01 movw r24, r14 225a8: b6 01 movw r22, r12 225aa: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 225ae: 18 16 cp r1, r24 225b0: 84 f4 brge .+32 ; 0x225d2 225b2: a7 01 movw r20, r14 225b4: 96 01 movw r18, r12 225b6: 6e 85 ldd r22, Y+14 ; 0x0e 225b8: 7d 85 ldd r23, Y+13 ; 0x0d 225ba: 83 2d mov r24, r3 225bc: 92 2d mov r25, r2 225be: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 225c2: 60 93 fd 05 sts 0x05FD, r22 ; 0x8005fd 225c6: 70 93 fe 05 sts 0x05FE, r23 ; 0x8005fe 225ca: 80 93 ff 05 sts 0x05FF, r24 ; 0x8005ff 225ce: 90 93 00 06 sts 0x0600, r25 ; 0x800600 pid_output=MAX_BED_POWER; 225d2: 81 2c mov r8, r1 225d4: 91 2c mov r9, r1 225d6: 9f e7 ldi r25, 0x7F ; 127 225d8: a9 2e mov r10, r25 225da: 93 e4 ldi r25, 0x43 ; 67 225dc: b9 2e mov r11, r25 #else pid_output = constrain(target, 0, MAX_BED_POWER); #endif //PID_OPENLOOP if(current < BED_MAXTEMP) 225de: 20 e0 ldi r18, 0x00 ; 0 225e0: 30 e0 ldi r19, 0x00 ; 0 225e2: 4a ef ldi r20, 0xFA ; 250 225e4: 52 e4 ldi r21, 0x42 ; 66 225e6: c3 01 movw r24, r6 225e8: b2 01 movw r22, r4 225ea: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 225ee: 87 ff sbrs r24, 7 225f0: 6d c0 rjmp .+218 ; 0x226cc { soft_pwm_bed = (int)pid_output >> 1; 225f2: c5 01 movw r24, r10 225f4: b4 01 movw r22, r8 225f6: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> 225fa: 75 95 asr r23 225fc: 67 95 ror r22 225fe: 60 93 1c 06 sts 0x061C, r22 ; 0x80061c soft_pwm_bed = 0; WRITE(HEATER_BED_PIN,LOW); } #endif //BED_LIMIT_SWITCHING if(target==0) 22602: 89 81 ldd r24, Y+1 ; 0x01 22604: 9a 81 ldd r25, Y+2 ; 0x02 22606: 89 2b or r24, r25 22608: 11 f4 brne .+4 ; 0x2260e { soft_pwm_bed = 0; 2260a: 10 92 1c 06 sts 0x061C, r1 ; 0x80061c 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); } 2260e: 2e 96 adiw r28, 0x0e ; 14 22610: 0f b6 in r0, 0x3f ; 63 22612: f8 94 cli 22614: de bf out 0x3e, r29 ; 62 22616: 0f be out 0x3f, r0 ; 63 22618: cd bf out 0x3d, r28 ; 61 2261a: df 91 pop r29 2261c: cf 91 pop r28 2261e: 1f 91 pop r17 22620: 0f 91 pop r16 22622: ff 90 pop r15 22624: ef 90 pop r14 22626: df 90 pop r13 22628: cf 90 pop r12 2262a: bf 90 pop r11 2262c: af 90 pop r10 2262e: 9f 90 pop r9 22630: 8f 90 pop r8 22632: 7f 90 pop r7 22634: 6f 90 pop r6 22636: 5f 90 pop r5 22638: 4f 90 pop r4 2263a: 3f 90 pop r3 2263c: 2f 90 pop r2 2263e: 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) { 22640: c5 01 movw r24, r10 22642: b4 01 movw r22, r8 22644: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 22648: 87 ff sbrs r24, 7 2264a: a9 ce rjmp .-686 ; 0x2239e if (pid_error[e] < 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 2264c: 20 e0 ldi r18, 0x00 ; 0 2264e: 30 e0 ldi r19, 0x00 ; 0 22650: a9 01 movw r20, r18 22652: c7 01 movw r24, r14 22654: b6 01 movw r22, r12 22656: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 2265a: 87 ff sbrs r24, 7 2265c: a3 cd rjmp .-1210 ; 0x221a4 2265e: a7 01 movw r20, r14 22660: 96 01 movw r18, r12 22662: 6d 85 ldd r22, Y+13 ; 0x0d 22664: 79 85 ldd r23, Y+9 ; 0x09 22666: 81 2f mov r24, r17 22668: 90 2f mov r25, r16 2266a: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 2266e: 60 93 f0 05 sts 0x05F0, r22 ; 0x8005f0 22672: 70 93 f1 05 sts 0x05F1, r23 ; 0x8005f1 22676: 80 93 f2 05 sts 0x05F2, r24 ; 0x8005f2 2267a: 90 93 f3 05 sts 0x05F3, r25 ; 0x8005f3 2267e: 92 cd rjmp .-1244 ; 0x221a4 // 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; 22680: 10 92 15 05 sts 0x0515, r1 ; 0x800515 <_ZL8soft_pwm.lto_priv.459> 22684: b1 ce rjmp .-670 ; 0x223e8 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){ 22686: c5 01 movw r24, r10 22688: b4 01 movw r22, r8 2268a: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 2268e: 87 ff sbrs r24, 7 22690: a6 cf rjmp .-180 ; 0x225de if (pid_error_bed < 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 22692: 20 e0 ldi r18, 0x00 ; 0 22694: 30 e0 ldi r19, 0x00 ; 0 22696: a9 01 movw r20, r18 22698: c7 01 movw r24, r14 2269a: b6 01 movw r22, r12 2269c: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 226a0: 87 ff sbrs r24, 7 226a2: 10 c0 rjmp .+32 ; 0x226c4 226a4: a7 01 movw r20, r14 226a6: 96 01 movw r18, r12 226a8: 6e 85 ldd r22, Y+14 ; 0x0e 226aa: 7d 85 ldd r23, Y+13 ; 0x0d 226ac: 83 2d mov r24, r3 226ae: 92 2d mov r25, r2 226b0: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 226b4: 60 93 fd 05 sts 0x05FD, r22 ; 0x8005fd 226b8: 70 93 fe 05 sts 0x05FE, r23 ; 0x8005fe 226bc: 80 93 ff 05 sts 0x05FF, r24 ; 0x8005ff 226c0: 90 93 00 06 sts 0x0600, r25 ; 0x800600 pid_output=0; 226c4: 81 2c mov r8, r1 226c6: 91 2c mov r9, r1 226c8: 54 01 movw r10, r8 226ca: 89 cf rjmp .-238 ; 0x225de { soft_pwm_bed = (int)pid_output >> 1; } else { soft_pwm_bed = 0; 226cc: 10 92 1c 06 sts 0x061C, r1 ; 0x80061c 226d0: 98 cf rjmp .-208 ; 0x22602 000226d2 : } static void setIsrTargetTemperatures() { for(uint8_t e=0;e 226d6: 90 91 b6 0d lds r25, 0x0DB6 ; 0x800db6 226da: 90 93 1e 06 sts 0x061E, r25 ; 0x80061e 226de: 80 93 1d 06 sts 0x061D, r24 ; 0x80061d target_temperature_bed_isr = target_temperature_bed; 226e2: 80 91 71 06 lds r24, 0x0671 ; 0x800671 226e6: 90 91 72 06 lds r25, 0x0672 ; 0x800672 226ea: 90 93 17 06 sts 0x0617, r25 ; 0x800617 226ee: 80 93 16 06 sts 0x0616, r24 ; 0x800616 } 226f2: 08 95 ret 000226f4 : { // 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) 226f4: 81 30 cpi r24, 0x01 ; 1 226f6: 41 f1 breq .+80 ; 0x22748 226f8: 20 f0 brcs .+8 ; 0x22702 226fa: 82 30 cpi r24, 0x02 ; 2 226fc: 09 f4 brne .+2 ; 0x22700 226fe: 45 c0 rjmp .+138 ; 0x2278a 22700: 08 95 ret { case X_AXIS: { enable_x(); 22702: 17 98 cbi 0x02, 7 ; 2 uint8_t old_x_dir_pin = READ(X_DIR_PIN); //if dualzstepper, both point to same direction. 22704: 80 91 09 01 lds r24, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 22708: 81 70 andi r24, 0x01 ; 1 uint8_t new_x_dir_pin = (INVERT_X_DIR)^direction; 2270a: 91 e0 ldi r25, 0x01 ; 1 2270c: 69 27 eor r22, r25 //setup new step if (new_x_dir_pin != old_x_dir_pin) { 2270e: 86 17 cp r24, r22 22710: 59 f0 breq .+22 ; 0x22728 WRITE_NC(X_DIR_PIN, new_x_dir_pin); 22712: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 22716: 66 23 and r22, r22 22718: 89 f0 breq .+34 ; 0x2273c 2271a: 91 60 ori r25, 0x01 ; 1 2271c: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> #endif // busy wait __asm__ __volatile__ ( 22720: eb e4 ldi r30, 0x4B ; 75 22722: f0 e0 ldi r31, 0x00 ; 0 22724: 31 97 sbiw r30, 0x01 ; 1 22726: f1 f7 brne .-4 ; 0x22724 delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(X_AXIS); 22728: 91 e0 ldi r25, 0x01 ; 1 2272a: 96 b9 out 0x06, r25 ; 6 #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); 2272c: 88 23 and r24, r24 2272e: 41 f0 breq .+16 ; 0x22740 22730: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 22734: 81 60 ori r24, 0x01 ; 1 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); 22736: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> } break; default: break; } } 2273a: 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); 2273c: 9e 7f andi r25, 0xFE ; 254 2273e: ee cf rjmp .-36 ; 0x2271c #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); 22740: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 22744: 8e 7f andi r24, 0xFE ; 254 22746: f7 cf rjmp .-18 ; 0x22736 } break; case Y_AXIS: { enable_y(); 22748: 16 98 cbi 0x02, 6 ; 2 uint8_t old_y_dir_pin = READ(Y_DIR_PIN); //if dualzstepper, both point to same direction. 2274a: 90 91 09 01 lds r25, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 2274e: 81 e0 ldi r24, 0x01 ; 1 22750: 29 2f mov r18, r25 22752: 22 70 andi r18, 0x02 ; 2 22754: 91 ff sbrs r25, 1 22756: 80 e0 ldi r24, 0x00 ; 0 uint8_t new_y_dir_pin = (INVERT_Y_DIR)^direction; //setup new step if (new_y_dir_pin != old_y_dir_pin) { 22758: 86 17 cp r24, r22 2275a: 59 f0 breq .+22 ; 0x22772 WRITE_NC(Y_DIR_PIN, new_y_dir_pin); 2275c: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 22760: 66 23 and r22, r22 22762: 79 f0 breq .+30 ; 0x22782 22764: 82 60 ori r24, 0x02 ; 2 22766: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2276a: 8b e4 ldi r24, 0x4B ; 75 2276c: 90 e0 ldi r25, 0x00 ; 0 2276e: 01 97 sbiw r24, 0x01 ; 1 22770: f1 f7 brne .-4 ; 0x2276e delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(Y_AXIS); 22772: 82 e0 ldi r24, 0x02 ; 2 22774: 86 b9 out 0x06, r24 ; 6 #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); 22776: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2277a: 22 23 and r18, r18 2277c: 21 f0 breq .+8 ; 0x22786 2277e: 82 60 ori r24, 0x02 ; 2 22780: da cf rjmp .-76 ; 0x22736 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); 22782: 8d 7f andi r24, 0xFD ; 253 22784: f0 cf rjmp .-32 ; 0x22766 #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); 22786: 8d 7f andi r24, 0xFD ; 253 22788: d6 cf rjmp .-84 ; 0x22736 } break; case Z_AXIS: { enable_z(); 2278a: 15 98 cbi 0x02, 5 ; 2 uint8_t old_z_dir_pin = READ(Z_DIR_PIN); //if dualzstepper, both point to same direction. 2278c: 90 91 09 01 lds r25, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 22790: 81 e0 ldi r24, 0x01 ; 1 22792: 29 2f mov r18, r25 22794: 24 70 andi r18, 0x04 ; 4 22796: 92 ff sbrs r25, 2 22798: 80 e0 ldi r24, 0x00 ; 0 uint8_t new_z_dir_pin = (INVERT_Z_DIR)^direction^BABYSTEP_INVERT_Z; 2279a: 91 e0 ldi r25, 0x01 ; 1 2279c: 69 27 eor r22, r25 //setup new step if (new_z_dir_pin != old_z_dir_pin) { 2279e: 86 17 cp r24, r22 227a0: 59 f0 breq .+22 ; 0x227b8 WRITE_NC(Z_DIR_PIN, new_z_dir_pin); 227a2: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 227a6: 66 23 and r22, r22 227a8: 91 f0 breq .+36 ; 0x227ce 227aa: 94 60 ori r25, 0x04 ; 4 227ac: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 227b0: eb e4 ldi r30, 0x4B ; 75 227b2: f0 e0 ldi r31, 0x00 ; 0 227b4: 31 97 sbiw r30, 0x01 ; 1 227b6: f1 f7 brne .-4 ; 0x227b4 #endif delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(Z_AXIS); 227b8: 94 e0 ldi r25, 0x04 ; 4 227ba: 96 b9 out 0x06, r25 ; 6 #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) { 227bc: 86 17 cp r24, r22 227be: 09 f4 brne .+2 ; 0x227c2 227c0: bc cf rjmp .-136 ; 0x2273a WRITE_NC(Z_DIR_PIN, old_z_dir_pin); 227c2: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 227c6: 22 23 and r18, r18 227c8: 21 f0 breq .+8 ; 0x227d2 227ca: 84 60 ori r24, 0x04 ; 4 227cc: b4 cf rjmp .-152 ; 0x22736 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); 227ce: 9b 7f andi r25, 0xFB ; 251 227d0: ed cf rjmp .-38 ; 0x227ac 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); 227d2: 8b 7f andi r24, 0xFB ; 251 227d4: b0 cf rjmp .-160 ; 0x22736 000227d6 : } } static void checkRx(void) { if (selectedSerialPort == 0) { 227d6: 80 91 38 05 lds r24, 0x0538 ; 0x800538 227da: 81 11 cpse r24, r1 227dc: 25 c0 rjmp .+74 ; 0x22828 if((M_UCSRxA & (1< 227e2: 87 ff sbrs r24, 7 227e4: 3d c0 rjmp .+122 ; 0x22860 // Test for a framing error. if (M_UCSRxA & (1< 227ea: 84 ff sbrs r24, 4 227ec: 03 c0 rjmp .+6 ; 0x227f4 // 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); 227ee: 80 91 c6 00 lds r24, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> 227f2: 08 95 ret } else { unsigned char c = M_UDRx; 227f4: 40 91 c6 00 lds r20, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> int i = (unsigned int)(rx_buffer.head + 1) % RX_BUFFER_SIZE; 227f8: 20 91 98 04 lds r18, 0x0498 ; 0x800498 227fc: 30 91 99 04 lds r19, 0x0499 ; 0x800499 22800: c9 01 movw r24, r18 22802: 01 96 adiw r24, 0x01 ; 1 22804: 8f 77 andi r24, 0x7F ; 127 22806: 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) { 22808: 60 91 9a 04 lds r22, 0x049A ; 0x80049a 2280c: 70 91 9b 04 lds r23, 0x049B ; 0x80049b 22810: 86 17 cp r24, r22 22812: 97 07 cpc r25, r23 22814: 29 f1 breq .+74 ; 0x22860 // 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; 22816: 28 5e subi r18, 0xE8 ; 232 22818: 3b 4f sbci r19, 0xFB ; 251 2281a: f9 01 movw r30, r18 2281c: 40 83 st Z, r20 rx_buffer.head = i; 2281e: 90 93 99 04 sts 0x0499, r25 ; 0x800499 22822: 80 93 98 04 sts 0x0498, r24 ; 0x800498 22826: 1c c0 rjmp .+56 ; 0x22860 UDR1 = c; #endif //DEBUG_DUMP_TO_2ND_SERIAL } } } else { // if(selectedSerialPort == 1) { if((UCSR1A & (1< 2282c: 87 ff sbrs r24, 7 2282e: 18 c0 rjmp .+48 ; 0x22860 // Test for a framing error. if (UCSR1A & (1< 22834: 84 ff sbrs r24, 4 22836: 03 c0 rjmp .+6 ; 0x2283e // 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); 22838: 80 91 ce 00 lds r24, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> 2283c: 08 95 ret } else { unsigned char c = UDR1; 2283e: 40 91 ce 00 lds r20, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> int i = (unsigned int)(rx_buffer.head + 1) % RX_BUFFER_SIZE; 22842: 20 91 98 04 lds r18, 0x0498 ; 0x800498 22846: 30 91 99 04 lds r19, 0x0499 ; 0x800499 2284a: c9 01 movw r24, r18 2284c: 01 96 adiw r24, 0x01 ; 1 2284e: 8f 77 andi r24, 0x7F ; 127 22850: 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) { 22852: 60 91 9a 04 lds r22, 0x049A ; 0x80049a 22856: 70 91 9b 04 lds r23, 0x049B ; 0x80049b 2285a: 68 17 cp r22, r24 2285c: 79 07 cpc r23, r25 2285e: d9 f6 brne .-74 ; 0x22816 M_UDRx = c; #endif //DEBUG_DUMP_TO_2ND_SERIAL } } } } 22860: 08 95 ret 00022862 : static void Sound_DoSound_Alert(bool bOnce) { uint8_t nI,nMax; nMax=bOnce?1:3; 22862: 23 e0 ldi r18, 0x03 ; 3 22864: 81 11 cpse r24, r1 22866: 21 e0 ldi r18, 0x01 ; 1 for(nI=0;nI 2287a: 94 60 ori r25, 0x04 ; 4 2287c: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 22880: 3f bf out 0x3f, r19 ; 63 22882: fb 01 movw r30, r22 22884: 31 97 sbiw r30, 0x01 ; 1 22886: f1 f7 brne .-4 ; 0x22884 delayMicroseconds(200); WRITE(BEEPER,LOW); 22888: 3f b7 in r19, 0x3f ; 63 2288a: f8 94 cli 2288c: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 22890: 9b 7f andi r25, 0xFB ; 251 22892: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 22896: 3f bf out 0x3f, r19 ; 63 22898: fa 01 movw r30, r20 2289a: 31 97 sbiw r30, 0x01 ; 1 2289c: f1 f7 brne .-4 ; 0x2289a 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); } } 228a4: 08 95 ret 000228a6 : delayMicroseconds(75); } } static void Sound_DoSound_Echo(void) { 228a6: 8a e0 ldi r24, 0x0A ; 10 228a8: 2b e8 ldi r18, 0x8B ; 139 228aa: 31 e0 ldi r19, 0x01 ; 1 uint8_t nI; for(nI=0;nI<10;nI++) { WRITE(BEEPER,HIGH); 228ac: 4f b7 in r20, 0x3f ; 63 228ae: f8 94 cli 228b0: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 228b4: 94 60 ori r25, 0x04 ; 4 228b6: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 228ba: 4f bf out 0x3f, r20 ; 63 228bc: f9 01 movw r30, r18 228be: 31 97 sbiw r30, 0x01 ; 1 228c0: f1 f7 brne .-4 ; 0x228be delayMicroseconds(100); WRITE(BEEPER,LOW); 228c2: 4f b7 in r20, 0x3f ; 63 228c4: f8 94 cli 228c6: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 228ca: 9b 7f andi r25, 0xFB ; 251 228cc: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 228d0: 4f bf out 0x3f, r20 ; 63 228d2: f9 01 movw r30, r18 228d4: 31 97 sbiw r30, 0x01 ; 1 228d6: f1 f7 brne .-4 ; 0x228d4 228d8: 81 50 subi r24, 0x01 ; 1 static void Sound_DoSound_Echo(void) { uint8_t nI; for(nI=0;nI<10;nI++) 228da: 41 f7 brne .-48 ; 0x228ac WRITE(BEEPER,HIGH); delayMicroseconds(100); WRITE(BEEPER,LOW); delayMicroseconds(100); } } 228dc: 08 95 ret 000228de : } //! @brief Send host action "pause" void lcd_pause_usb_print() { SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_ASK_PAUSE); 228de: 8c e4 ldi r24, 0x4C ; 76 228e0: 9f e6 ldi r25, 0x6F ; 111 228e2: 0c 94 93 79 jmp 0xf326 ; 0xf326 000228e6 : MENU_END(); } void lcd_set_fan_check() { fans_check_enabled = !fans_check_enabled; 228e6: 60 91 38 02 lds r22, 0x0238 ; 0x800238 228ea: 81 e0 ldi r24, 0x01 ; 1 228ec: 68 27 eor r22, r24 228ee: 60 93 38 02 sts 0x0238, r22 ; 0x800238 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 228f2: 87 e8 ldi r24, 0x87 ; 135 228f4: 9f e0 ldi r25, 0x0F ; 15 228f6: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 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. 228fa: 80 91 38 02 lds r24, 0x0238 ; 0x800238 228fe: 81 11 cpse r24, r1 22900: 02 c0 rjmp .+4 ; 0x22906 22902: 10 92 e4 03 sts 0x03E4, r1 ; 0x8003e4 #endif //FANCHECK } 22906: 08 95 ret 00022908 : * 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) { 22908: af 92 push r10 2290a: bf 92 push r11 2290c: cf 92 push r12 2290e: df 92 push r13 22910: ef 92 push r14 22912: ff 92 push r15 22914: 0f 93 push r16 22916: 1f 93 push r17 22918: cf 93 push r28 2291a: df 93 push r29 2291c: 6c 01 movw r12, r24 const char *msgend = msg; bool multi_screen = false; lcd_frame_start(); 2291e: 0e 94 ac 6e call 0xdd58 ; 0xdd58 * @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; 22922: e6 01 movw r28, r12 bool multi_screen = false; lcd_frame_start(); for (uint8_t row = 0; row < LCD_HEIGHT; ++ row) { 22924: 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; 22926: e1 2c mov r14, r1 lcd_frame_start(); for (uint8_t row = 0; row < LCD_HEIGHT; ++ row) { lcd_set_cursor(0, row); 22928: 6f 2d mov r22, r15 2292a: 80 e0 ldi r24, 0x00 ; 0 2292c: 0e 94 f8 6e call 0xddf0 ; 0xddf0 // 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) 22930: c6 01 movw r24, r12 22932: 0f 94 f2 0f call 0x21fe4 ; 0x21fe4 22936: 88 23 and r24, r24 22938: 29 f0 breq .+10 ; 0x22944 2293a: 8f ef ldi r24, 0xFF ; 255 2293c: c8 1a sub r12, r24 2293e: d8 0a sbc r13, r24 22940: 09 f4 brne .+2 ; 0x22944 22942: 49 c0 rjmp .+146 ; 0x229d6 22944: c6 01 movw r24, r12 22946: 0f 94 95 d9 call 0x3b32a ; 0x3b32a <__strlen_P> { // End of the message. break; } uint8_t linelen = min(strlen_P(msg), LCD_WIDTH); 2294a: 84 31 cpi r24, 0x14 ; 20 2294c: 91 05 cpc r25, r1 2294e: 10 f0 brcs .+4 ; 0x22954 22950: 84 e1 ldi r24, 0x14 ; 20 22952: 90 e0 ldi r25, 0x00 ; 0 const char *msgend2 = msg + linelen; 22954: e6 01 movw r28, r12 22956: c8 0f add r28, r24 22958: d9 1f adc r29, r25 msgend = msgend2; if (row == 3 && linelen == LCD_WIDTH) { 2295a: e3 e0 ldi r30, 0x03 ; 3 2295c: fe 12 cpse r15, r30 2295e: 0a c0 rjmp .+20 ; 0x22974 22960: 84 31 cpi r24, 0x14 ; 20 22962: 41 f4 brne .+16 ; 0x22974 // 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; 22964: fe 01 movw r30, r28 22966: 84 91 lpm r24, Z 22968: e1 2c mov r14, r1 if (multi_screen) 2296a: 88 23 and r24, r24 2296c: 19 f0 breq .+6 ; 0x22974 msgend = (msgend2 -= 2); 2296e: 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; 22970: ee 24 eor r14, r14 22972: e3 94 inc r14 if (multi_screen) msgend = (msgend2 -= 2); } if (pgm_read_byte(msgend) != 0 && ! pgm_is_whitespace(msgend) && ! pgm_is_interpunction(msgend)) { 22974: fe 01 movw r30, r28 22976: 84 91 lpm r24, Z 22978: 88 23 and r24, r24 2297a: 09 f4 brne .+2 ; 0x2297e 2297c: 40 c0 rjmp .+128 ; 0x229fe 2297e: ce 01 movw r24, r28 22980: 0f 94 f2 0f call 0x21fe4 ; 0x21fe4 22984: 81 11 cpse r24, r1 22986: 3b c0 rjmp .+118 ; 0x229fe 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); 22988: fe 01 movw r30, r28 2298a: 84 91 lpm r24, Z return c == '.' || c == ',' || c == ':'|| c == ';' || c == '?' || c == '!' || c == '/'; 2298c: 92 ed ldi r25, 0xD2 ; 210 2298e: 98 0f add r25, r24 22990: 92 30 cpi r25, 0x02 ; 2 22992: a8 f1 brcs .+106 ; 0x229fe 22994: 8c 32 cpi r24, 0x2C ; 44 22996: 99 f1 breq .+102 ; 0x229fe 22998: 96 ec ldi r25, 0xC6 ; 198 2299a: 98 0f add r25, r24 2299c: 92 30 cpi r25, 0x02 ; 2 2299e: 78 f1 brcs .+94 ; 0x229fe 229a0: 8f 33 cpi r24, 0x3F ; 63 229a2: 69 f1 breq .+90 ; 0x229fe 229a4: 81 32 cpi r24, 0x21 ; 33 229a6: 59 f1 breq .+86 ; 0x229fe 229a8: 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)) 229aa: c0 16 cp r12, r16 229ac: d1 06 cpc r13, r17 229ae: 58 f4 brcc .+22 ; 0x229c6 229b0: 58 01 movw r10, r16 229b2: f1 e0 ldi r31, 0x01 ; 1 229b4: af 1a sub r10, r31 229b6: b1 08 sbc r11, r1 229b8: c5 01 movw r24, r10 229ba: 0f 94 f2 0f call 0x21fe4 ; 0x21fe4 229be: 81 11 cpse r24, r1 229c0: 1d c0 rjmp .+58 ; 0x229fc -- msgend; 229c2: 85 01 movw r16, r10 229c4: f2 cf rjmp .-28 ; 0x229aa if (msgend == msg) 229c6: c0 16 cp r12, r16 229c8: d1 06 cpc r13, r17 229ca: c9 f0 breq .+50 ; 0x229fe 229cc: 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) { 229ce: f3 94 inc r15 229d0: 84 e0 ldi r24, 0x04 ; 4 229d2: f8 12 cpse r15, r24 229d4: a9 cf rjmp .-174 ; 0x22928 } lcd_print(c); } } if (multi_screen) { 229d6: ee 20 and r14, r14 229d8: f9 f0 breq .+62 ; 0x22a18 // Display the double down arrow. lcd_putc_at(19, 3, LCD_STR_ARROW_2_DOWN[0]); 229da: 48 e8 ldi r20, 0x88 ; 136 229dc: 63 e0 ldi r22, 0x03 ; 3 229de: 83 e1 ldi r24, 0x13 ; 19 229e0: 0e 94 18 6f call 0xde30 ; 0xde30 } return multi_screen ? msgend : NULL; } 229e4: ce 01 movw r24, r28 229e6: df 91 pop r29 229e8: cf 91 pop r28 229ea: 1f 91 pop r17 229ec: 0f 91 pop r16 229ee: ff 90 pop r15 229f0: ef 90 pop r14 229f2: df 90 pop r13 229f4: cf 90 pop r12 229f6: bf 90 pop r11 229f8: af 90 pop r10 229fa: 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)) 229fc: 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) { 229fe: cc 16 cp r12, r28 22a00: dd 06 cpc r13, r29 22a02: 28 f7 brcc .-54 ; 0x229ce char c = char(pgm_read_byte(msg)); 22a04: f6 01 movw r30, r12 22a06: 84 91 lpm r24, Z if (c == '\n') { 22a08: 8a 30 cpi r24, 0x0A ; 10 22a0a: 09 f3 breq .-62 ; 0x229ce 22a0c: 0e 94 a7 6f call 0xdf4e ; 0xdf4e -- msgend; if (msgend == msg) // Found a single long word, which cannot be split. Just cut it. msgend = msgend2; } for (; msg < msgend; ++ msg) { 22a10: ff ef ldi r31, 0xFF ; 255 22a12: cf 1a sub r12, r31 22a14: df 0a sbc r13, r31 22a16: f3 cf rjmp .-26 ; 0x229fe if (multi_screen) { // Display the double down arrow. lcd_putc_at(19, 3, LCD_STR_ARROW_2_DOWN[0]); } return multi_screen ? msgend : NULL; 22a18: d0 e0 ldi r29, 0x00 ; 0 22a1a: c0 e0 ldi r28, 0x00 ; 0 22a1c: e3 cf rjmp .-58 ; 0x229e4 00022a1e : #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){ 22a1e: cf 93 push r28 22a20: df 93 push r29 22a22: cd b7 in r28, 0x3d ; 61 22a24: de b7 in r29, 0x3e ; 62 22a26: 2f 97 sbiw r28, 0x0f ; 15 22a28: 0f b6 in r0, 0x3f ; 63 22a2a: f8 94 cli 22a2c: de bf out 0x3e, r29 ; 62 22a2e: 0f be out 0x3f, r0 ; 63 22a30: cd bf out 0x3d, r28 ; 61 22a32: fc 01 movw r30, r24 22a34: de 01 movw r26, r28 22a36: 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; 22a38: 90 e0 ldi r25, 0x00 ; 0 22a3a: 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); 22a3c: 84 91 lpm r24, Z 22a3e: 41 e0 ldi r20, 0x01 ; 1 22a40: 49 0f add r20, r25 if( ! b ) 22a42: 88 23 and r24, r24 22a44: 29 f0 breq .+10 ; 0x22a50 break; dst[i] = b; 22a46: 8d 93 st X+, r24 22a48: 31 96 adiw r30, 0x01 ; 1 22a4a: 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 22a4c: 4d 30 cpi r20, 0x0D ; 13 22a4e: b1 f7 brne .-20 ; 0x22a3c uint8_t b = pgm_read_byte(ipgmLabel + i); if( ! b ) break; dst[i] = b; } dst[i] = ':'; // append the colon 22a50: f9 01 movw r30, r18 22a52: e9 0f add r30, r25 22a54: f1 1d adc r31, r1 22a56: 8a e3 ldi r24, 0x3A ; 58 22a58: 80 83 st Z, r24 ++i; 22a5a: 9f 5f subi r25, 0xFF ; 255 22a5c: f9 01 movw r30, r18 22a5e: e9 0f add r30, r25 22a60: f1 1d adc r31, r1 for(; i < dstSize - 1; ++i) // fill the rest with spaces dst[i] = ' '; 22a62: 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 22a64: 9e 30 cpi r25, 0x0E ; 14 22a66: 19 f0 breq .+6 ; 0x22a6e dst[i] = ' '; 22a68: 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 22a6a: 9f 5f subi r25, 0xFF ; 255 22a6c: fb cf rjmp .-10 ; 0x22a64 dst[i] = ' '; dst[dstSize-1] = '\0'; // terminate the string properly 22a6e: 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 22a70: 7f 93 push r23 22a72: 6f 93 push r22 22a74: 3f 93 push r19 22a76: 2f 93 push r18 22a78: 8a e5 ldi r24, 0x5A ; 90 22a7a: 91 ea ldi r25, 0xA1 ; 161 22a7c: 9f 93 push r25 22a7e: 8f 93 push r24 22a80: 0e 94 d1 6e call 0xdda2 ; 0xdda2 22a84: 0f 90 pop r0 22a86: 0f 90 pop r0 22a88: 0f 90 pop r0 22a8a: 0f 90 pop r0 22a8c: 0f 90 pop r0 22a8e: 0f 90 pop r0 } 22a90: 2f 96 adiw r28, 0x0f ; 15 22a92: 0f b6 in r0, 0x3f ; 63 22a94: f8 94 cli 22a96: de bf out 0x3e, r29 ; 62 22a98: 0f be out 0x3f, r0 ; 63 22a9a: cd bf out 0x3d, r28 ; 61 22a9c: df 91 pop r29 22a9e: cf 91 pop r28 22aa0: 08 95 ret 00022aa2 : //! |Rear side [µm]: | MSG_BED_CORRECTION_REAR //! |Reset | MSG_BED_CORRECTION_RESET //! ---------------------- //! @endcode void lcd_adjust_bed(void) { 22aa2: ef 92 push r14 22aa4: ff 92 push r15 22aa6: 0f 93 push r16 22aa8: 1f 93 push r17 _menu_data_adjust_bed_t* _md = (_menu_data_adjust_bed_t*)&(menu_data[0]); if (_md->status == 0) 22aaa: 80 91 b4 03 lds r24, 0x03B4 ; 0x8003b4 22aae: 81 11 cpse r24, r1 22ab0: 35 c0 rjmp .+106 ; 0x22b1c { // Menu was entered. if (eeprom_read_byte((unsigned char*)EEPROM_BED_CORRECTION_VALID) == 1) 22ab2: 80 ec ldi r24, 0xC0 ; 192 22ab4: 9f e0 ldi r25, 0x0F ; 15 22ab6: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 22aba: 81 30 cpi r24, 0x01 ; 1 22abc: 61 f5 brne .+88 ; 0x22b16 { _md->left = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_LEFT); 22abe: 8f eb ldi r24, 0xBF ; 191 22ac0: 9f e0 ldi r25, 0x0F ; 15 22ac2: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 22ac6: 08 2e mov r0, r24 22ac8: 00 0c add r0, r0 22aca: 99 0b sbc r25, r25 22acc: 90 93 b6 03 sts 0x03B6, r25 ; 0x8003b6 22ad0: 80 93 b5 03 sts 0x03B5, r24 ; 0x8003b5 _md->right = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_RIGHT); 22ad4: 8e eb ldi r24, 0xBE ; 190 22ad6: 9f e0 ldi r25, 0x0F ; 15 22ad8: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 22adc: 08 2e mov r0, r24 22ade: 00 0c add r0, r0 22ae0: 99 0b sbc r25, r25 22ae2: 90 93 b8 03 sts 0x03B8, r25 ; 0x8003b8 22ae6: 80 93 b7 03 sts 0x03B7, r24 ; 0x8003b7 _md->front = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_FRONT); 22aea: 8d eb ldi r24, 0xBD ; 189 22aec: 9f e0 ldi r25, 0x0F ; 15 22aee: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 22af2: 08 2e mov r0, r24 22af4: 00 0c add r0, r0 22af6: 99 0b sbc r25, r25 22af8: 90 93 ba 03 sts 0x03BA, r25 ; 0x8003ba 22afc: 80 93 b9 03 sts 0x03B9, r24 ; 0x8003b9 _md->rear = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_REAR); 22b00: 8c eb ldi r24, 0xBC ; 188 22b02: 9f e0 ldi r25, 0x0F ; 15 22b04: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 22b08: 08 2e mov r0, r24 22b0a: 00 0c add r0, r0 22b0c: 99 0b sbc r25, r25 22b0e: 90 93 bc 03 sts 0x03BC, r25 ; 0x8003bc 22b12: 80 93 bb 03 sts 0x03BB, r24 ; 0x8003bb } _md->status = 1; 22b16: 81 e0 ldi r24, 0x01 ; 1 22b18: 80 93 b4 03 sts 0x03B4, r24 ; 0x8003b4 } MENU_BEGIN(); 22b1c: 0f 94 51 d1 call 0x3a2a2 ; 0x3a2a2 22b20: 10 92 11 05 sts 0x0511, r1 ; 0x800511 22b24: 80 91 11 05 lds r24, 0x0511 ; 0x800511 22b28: 84 30 cpi r24, 0x04 ; 4 22b2a: 08 f0 brcs .+2 ; 0x22b2e 22b2c: 6e c0 rjmp .+220 ; 0x22c0a 22b2e: 10 92 14 05 sts 0x0514, r1 ; 0x800514 // leaving menu - this condition must be immediately before MENU_ITEM_BACK_P ON_MENU_LEAVE( 22b32: 0f 94 d1 cf call 0x39fa2 ; 0x39fa2 22b36: 88 23 and r24, r24 22b38: e9 f0 breq .+58 ; 0x22b74 22b3a: 60 91 b5 03 lds r22, 0x03B5 ; 0x8003b5 22b3e: 8f eb ldi r24, 0xBF ; 191 22b40: 9f e0 ldi r25, 0x0F ; 15 22b42: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 22b46: 60 91 b9 03 lds r22, 0x03B9 ; 0x8003b9 22b4a: 8d eb ldi r24, 0xBD ; 189 22b4c: 9f e0 ldi r25, 0x0F ; 15 22b4e: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 22b52: 60 91 bb 03 lds r22, 0x03BB ; 0x8003bb 22b56: 8c eb ldi r24, 0xBC ; 188 22b58: 9f e0 ldi r25, 0x0F ; 15 22b5a: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 22b5e: 60 91 b7 03 lds r22, 0x03B7 ; 0x8003b7 22b62: 8e eb ldi r24, 0xBE ; 190 22b64: 9f e0 ldi r25, 0x0F ; 15 22b66: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 22b6a: 61 e0 ldi r22, 0x01 ; 1 22b6c: 80 ec ldi r24, 0xC0 ; 192 22b6e: 9f e0 ldi r25, 0x0F ; 15 22b70: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 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)); 22b74: 8c eb ldi r24, 0xBC ; 188 22b76: 99 e4 ldi r25, 0x49 ; 73 22b78: 0e 94 c4 72 call 0xe588 ; 0xe588 22b7c: 0f 94 1c d4 call 0x3a838 ; 0x3a838 MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_LEFT), &_md->left, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 22b80: 80 ed ldi r24, 0xD0 ; 208 22b82: 91 e5 ldi r25, 0x51 ; 81 22b84: 0e 94 c4 72 call 0xe588 ; 0xe588 22b88: f1 2c mov r15, r1 22b8a: e1 2c mov r14, r1 22b8c: 04 e6 ldi r16, 0x64 ; 100 22b8e: 10 e0 ldi r17, 0x00 ; 0 22b90: 2c e9 ldi r18, 0x9C ; 156 22b92: 3f ef ldi r19, 0xFF ; 255 22b94: 40 e1 ldi r20, 0x10 ; 16 22b96: 65 eb ldi r22, 0xB5 ; 181 22b98: 73 e0 ldi r23, 0x03 ; 3 22b9a: 0f 94 a1 d1 call 0x3a342 ; 0x3a342 MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_RIGHT), &_md->right, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 22b9e: 8f eb ldi r24, 0xBF ; 191 22ba0: 91 e5 ldi r25, 0x51 ; 81 22ba2: 0e 94 c4 72 call 0xe588 ; 0xe588 22ba6: 2c e9 ldi r18, 0x9C ; 156 22ba8: 3f ef ldi r19, 0xFF ; 255 22baa: 40 e1 ldi r20, 0x10 ; 16 22bac: 67 eb ldi r22, 0xB7 ; 183 22bae: 73 e0 ldi r23, 0x03 ; 3 22bb0: 0f 94 a1 d1 call 0x3a342 ; 0x3a342 MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_FRONT), &_md->front, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 22bb4: 8e ea ldi r24, 0xAE ; 174 22bb6: 91 e5 ldi r25, 0x51 ; 81 22bb8: 0e 94 c4 72 call 0xe588 ; 0xe588 22bbc: 2c e9 ldi r18, 0x9C ; 156 22bbe: 3f ef ldi r19, 0xFF ; 255 22bc0: 40 e1 ldi r20, 0x10 ; 16 22bc2: 69 eb ldi r22, 0xB9 ; 185 22bc4: 73 e0 ldi r23, 0x03 ; 3 22bc6: 0f 94 a1 d1 call 0x3a342 ; 0x3a342 MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_REAR), &_md->rear, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 22bca: 8d e9 ldi r24, 0x9D ; 157 22bcc: 91 e5 ldi r25, 0x51 ; 81 22bce: 0e 94 c4 72 call 0xe588 ; 0xe588 22bd2: 2c e9 ldi r18, 0x9C ; 156 22bd4: 3f ef ldi r19, 0xFF ; 255 22bd6: 40 e1 ldi r20, 0x10 ; 16 22bd8: 6b eb ldi r22, 0xBB ; 187 22bda: 73 e0 ldi r23, 0x03 ; 3 22bdc: 0f 94 a1 d1 call 0x3a342 ; 0x3a342 MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_adjust_bed_reset); 22be0: 8b ef ldi r24, 0xFB ; 251 22be2: 95 e4 ldi r25, 0x45 ; 69 22be4: 0e 94 c4 72 call 0xe588 ; 0xe588 22be8: 6e e9 ldi r22, 0x9E ; 158 22bea: 79 e3 ldi r23, 0x39 ; 57 22bec: 0f 94 ce d0 call 0x3a19c ; 0x3a19c MENU_END(); 22bf0: 0f 94 25 d1 call 0x3a24a ; 0x3a24a _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(); 22bf4: 80 91 11 05 lds r24, 0x0511 ; 0x800511 22bf8: 8f 5f subi r24, 0xFF ; 255 22bfa: 80 93 11 05 sts 0x0511, r24 ; 0x800511 22bfe: 80 91 13 05 lds r24, 0x0513 ; 0x800513 22c02: 8f 5f subi r24, 0xFF ; 255 22c04: 80 93 13 05 sts 0x0513, r24 ; 0x800513 22c08: 8d cf rjmp .-230 ; 0x22b24 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(); } 22c0a: 1f 91 pop r17 22c0c: 0f 91 pop r16 22c0e: ff 90 pop r15 22c10: ef 90 pop r14 22c12: 08 95 ret 00022c14 : } } #endif //MMU_HAS_CUTTER bool shouldPreheatOnlyNozzle() { uint8_t eeprom_setting = eeprom_read_byte((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT); 22c14: 87 ea ldi r24, 0xA7 ; 167 22c16: 9c e0 ldi r25, 0x0C ; 12 22c18: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae if (eeprom_setting != 0) 22c1c: 81 11 cpse r24, r1 22c1e: 05 c0 rjmp .+10 ; 0x22c2a return false; switch(eFilamentAction) { 22c20: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 22c24: 81 50 subi r24, 0x01 ; 1 22c26: 88 30 cpi r24, 0x08 ; 8 22c28: 10 f0 brcs .+4 ; 0x22c2e #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; 22c2a: 80 e0 ldi r24, 0x00 ; 0 22c2c: 08 95 ret case FilamentAction::MmuLoad: case FilamentAction::MmuUnLoad: case FilamentAction::MmuLoadingTest: case FilamentAction::MmuEject: case FilamentAction::MmuCut: return true; 22c2e: 81 e0 ldi r24, 0x01 ; 1 default: return false; } } 22c30: 08 95 ret 00022c32 : } #ifdef MMU_HAS_CUTTER void lcd_cutter_enabled() { if (EEPROM_MMU_CUTTER_ENABLED_enabled == eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED)) 22c32: 8e ec ldi r24, 0xCE ; 206 22c34: 9e e0 ldi r25, 0x0E ; 14 22c36: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 22c3a: 60 e0 ldi r22, 0x00 ; 0 22c3c: 81 30 cpi r24, 0x01 ; 1 22c3e: 09 f0 breq .+2 ; 0x22c42 22c40: 61 e0 ldi r22, 0x01 ; 1 22c42: 8e ec ldi r24, 0xCE ; 206 22c44: 9e e0 ldi r25, 0x0E ; 14 22c46: 0d 94 fb db jmp 0x3b7f6 ; 0x3b7f6 00022c4a : } } void SpoolJoin::toggleSpoolJoin() { if (eeprom_read_byte((uint8_t*)EEPROM_SPOOL_JOIN) == (uint8_t)EEPROM::Disabled) 22c4a: 86 ed ldi r24, 0xD6 ; 214 22c4c: 9e e0 ldi r25, 0x0E ; 14 22c4e: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 22c52: 61 e0 ldi r22, 0x01 ; 1 22c54: 82 30 cpi r24, 0x02 ; 2 22c56: 09 f0 breq .+2 ; 0x22c5a 22c58: 62 e0 ldi r22, 0x02 ; 2 22c5a: 86 ed ldi r24, 0xD6 ; 214 22c5c: 9e e0 ldi r25, 0x0E ; 14 22c5e: 0d 94 fb db jmp 0x3b7f6 ; 0x3b7f6 00022c62 : } _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(); 22c62: 0e 94 b0 76 call 0xed60 ; 0xed60 _menu_data_adjust_bed_t* _md = (_menu_data_adjust_bed_t*)&(menu_data[0]); _md->status = 0; 22c66: 10 92 b4 03 sts 0x03B4, r1 ; 0x8003b4 } 22c6a: 08 95 ret 00022c6c : } #ifdef FILAMENT_SENSOR static void lcd_menu_AutoLoadFilament() { lcd_display_message_fullscreen_nonBlocking_P(_T(MSG_AUTOLOADING_ENABLED)); 22c6c: 8c e7 ldi r24, 0x7C ; 124 22c6e: 90 e5 ldi r25, 0x50 ; 80 22c70: 0e 94 c4 72 call 0xe588 ; 0xe588 22c74: 0f 94 84 14 call 0x22908 ; 0x22908 menu_back_if_clicked(); 22c78: 0d 94 bb d4 jmp 0x3a976 ; 0x3a976 00022c7c : //! | | //! | | //! ---------------------- //! @endcode void lcd_menu_extruder_info() // NOT static due to using inside "Marlin_main" module ("manage_inactivity()") { 22c7c: df 92 push r13 22c7e: ef 92 push r14 22c80: ff 92 push r15 22c82: 0f 93 push r16 22c84: 1f 93 push r17 22c86: cf 93 push r28 22c88: df 93 push r29 22c8a: 10 92 da 03 sts 0x03DA, r1 ; 0x8003da lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 22c8e: 0e 94 24 6f call 0xde48 ; 0xde48 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] ); 22c92: c7 ec ldi r28, 0xC7 ; 199 22c94: d3 e0 ldi r29, 0x03 ; 3 22c96: 8a 81 ldd r24, Y+2 ; 0x02 22c98: 9b 81 ldd r25, Y+3 ; 0x03 22c9a: 2c e3 ldi r18, 0x3C ; 60 22c9c: f2 2e mov r15, r18 22c9e: f8 9e mul r15, r24 22ca0: 80 01 movw r16, r0 22ca2: f9 9e mul r15, r25 22ca4: 10 0d add r17, r0 22ca6: 11 24 eor r1, r1 22ca8: 83 ef ldi r24, 0xF3 ; 243 22caa: 98 e4 ldi r25, 0x48 ; 72 22cac: 0e 94 c4 72 call 0xe588 ; 0xe588 22cb0: e8 2e mov r14, r24 22cb2: d9 2e mov r13, r25 22cb4: 88 81 ld r24, Y 22cb6: 99 81 ldd r25, Y+1 ; 0x01 22cb8: f8 9e mul r15, r24 22cba: e0 01 movw r28, r0 22cbc: f9 9e mul r15, r25 22cbe: d0 0d add r29, r0 22cc0: 11 24 eor r1, r1 22cc2: 80 e0 ldi r24, 0x00 ; 0 22cc4: 99 e4 ldi r25, 0x49 ; 73 22cc6: 0e 94 c4 72 call 0xe588 ; 0xe588 22cca: 1f 93 push r17 22ccc: 0f 93 push r16 22cce: df 92 push r13 22cd0: ef 92 push r14 22cd2: df 93 push r29 22cd4: cf 93 push r28 22cd6: 9f 93 push r25 22cd8: 8f 93 push r24 22cda: 8e eb ldi r24, 0xBE ; 190 22cdc: 90 ea ldi r25, 0xA0 ; 160 22cde: 9f 93 push r25 22ce0: 8f 93 push r24 22ce2: 0e 94 d1 6e call 0xdda2 ; 0xdda2 menu_back_if_clicked(); 22ce6: 8d b7 in r24, 0x3d ; 61 22ce8: 9e b7 in r25, 0x3e ; 62 22cea: 0a 96 adiw r24, 0x0a ; 10 22cec: 0f b6 in r0, 0x3f ; 63 22cee: f8 94 cli 22cf0: 9e bf out 0x3e, r25 ; 62 22cf2: 0f be out 0x3f, r0 ; 63 22cf4: 8d bf out 0x3d, r24 ; 61 } 22cf6: df 91 pop r29 22cf8: cf 91 pop r28 22cfa: 1f 91 pop r17 22cfc: 0f 91 pop r16 22cfe: ff 90 pop r15 22d00: ef 90 pop r14 22d02: 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(); 22d04: 0d 94 bb d4 jmp 0x3a976 ; 0x3a976 00022d08 : //! | PINDA: 000D| MSG_PINDA c=14 //! ---------------------- //! D - Degree sysmbol LCD_STR_DEGREE //! @endcode static void lcd_menu_temperatures() { 22d08: cf 92 push r12 22d0a: df 92 push r13 22d0c: ef 92 push r14 22d0e: ff 92 push r15 22d10: 10 92 da 03 sts 0x03DA, r1 ; 0x8003da lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 22d14: 0e 94 24 6f call 0xde48 ; 0xde48 lcd_menu_temperatures_line( _T(MSG_NOZZLE), (int)current_temperature[0] ); 22d18: 60 91 af 0d lds r22, 0x0DAF ; 0x800daf 22d1c: 70 91 b0 0d lds r23, 0x0DB0 ; 0x800db0 22d20: 80 91 b1 0d lds r24, 0x0DB1 ; 0x800db1 22d24: 90 91 b2 0d lds r25, 0x0DB2 ; 0x800db2 22d28: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> 22d2c: 6b 01 movw r12, r22 22d2e: 80 e1 ldi r24, 0x10 ; 16 22d30: 94 e4 ldi r25, 0x44 ; 68 22d32: 0e 94 c4 72 call 0xe588 ; 0xe588 22d36: b6 01 movw r22, r12 22d38: 0f 94 0f 15 call 0x22a1e ; 0x22a1e lcd_menu_temperatures_line( _T(MSG_BED), (int)current_temperature_bed ); 22d3c: 60 91 ed 04 lds r22, 0x04ED ; 0x8004ed 22d40: 70 91 ee 04 lds r23, 0x04EE ; 0x8004ee 22d44: 80 91 ef 04 lds r24, 0x04EF ; 0x8004ef 22d48: 90 91 f0 04 lds r25, 0x04F0 ; 0x8004f0 22d4c: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> 22d50: 6b 01 movw r12, r22 22d52: 85 ef ldi r24, 0xF5 ; 245 22d54: 93 e4 ldi r25, 0x43 ; 67 22d56: 0e 94 c4 72 call 0xe588 ; 0xe588 22d5a: b6 01 movw r22, r12 22d5c: 0f 94 0f 15 call 0x22a1e ; 0x22a1e #ifdef AMBIENT_THERMISTOR lcd_menu_temperatures_line( _T(MSG_AMBIENT), (int)current_temperature_ambient ); 22d60: 60 91 55 06 lds r22, 0x0655 ; 0x800655 22d64: 70 91 56 06 lds r23, 0x0656 ; 0x800656 22d68: 80 91 57 06 lds r24, 0x0657 ; 0x800657 22d6c: 90 91 58 06 lds r25, 0x0658 ; 0x800658 22d70: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> 22d74: 6b 01 movw r12, r22 22d76: 87 e1 ldi r24, 0x17 ; 23 22d78: 9f e4 ldi r25, 0x4F ; 79 22d7a: 0e 94 c4 72 call 0xe588 ; 0xe588 22d7e: b6 01 movw r22, r12 22d80: 0f 94 0f 15 call 0x22a1e ; 0x22a1e #endif //AMBIENT_THERMISTOR #ifdef PINDA_THERMISTOR lcd_menu_temperatures_line(MSG_PINDA, (int)current_temperature_pinda ); ////MSG_PINDA 22d84: 60 91 97 03 lds r22, 0x0397 ; 0x800397 22d88: 70 91 98 03 lds r23, 0x0398 ; 0x800398 22d8c: 80 91 99 03 lds r24, 0x0399 ; 0x800399 22d90: 90 91 9a 03 lds r25, 0x039A ; 0x80039a 22d94: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> 22d98: 80 eb ldi r24, 0xB0 ; 176 22d9a: 9a e6 ldi r25, 0x6A ; 106 22d9c: 0f 94 0f 15 call 0x22a1e ; 0x22a1e #endif //PINDA_THERMISTOR menu_back_if_clicked(); } 22da0: ff 90 pop r15 22da2: ef 90 pop r14 22da4: df 90 pop r13 22da6: 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(); 22da8: 0d 94 bb d4 jmp 0x3a976 ; 0x3a976 00022dac : //! | Bed: 00.0V | c=12 //! | IR : 00.0V | c=12 optional //! ---------------------- //! @endcode static void lcd_menu_voltages() { 22dac: cf 92 push r12 22dae: df 92 push r13 22db0: ef 92 push r14 22db2: ff 92 push r15 22db4: 0f 93 push r16 22db6: 1f 93 push r17 22db8: cf 93 push r28 22dba: df 93 push r29 22dbc: 10 92 da 03 sts 0x03DA, r1 ; 0x8003da lcd_timeoutToStatus.stop(); //infinite timeout float volt_pwr = VOLT_DIV_REF * ((float)current_voltage_raw_pwr / (1023 * OVERSAMPLENR)) / VOLT_DIV_FAC; 22dc0: 60 91 5b 06 lds r22, 0x065B ; 0x80065b 22dc4: 70 91 5c 06 lds r23, 0x065C ; 0x80065c 22dc8: 07 2e mov r0, r23 22dca: 00 0c add r0, r0 22dcc: 88 0b sbc r24, r24 22dce: 99 0b sbc r25, r25 22dd0: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 22dd4: 20 e0 ldi r18, 0x00 ; 0 22dd6: 30 ec ldi r19, 0xC0 ; 192 22dd8: 4f e7 ldi r20, 0x7F ; 127 22dda: 56 e4 ldi r21, 0x46 ; 70 22ddc: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 22de0: 20 e0 ldi r18, 0x00 ; 0 22de2: 30 e0 ldi r19, 0x00 ; 0 22de4: 40 ea ldi r20, 0xA0 ; 160 22de6: 50 e4 ldi r21, 0x40 ; 64 22de8: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 22dec: 27 ed ldi r18, 0xD7 ; 215 22dee: 30 e3 ldi r19, 0x30 ; 48 22df0: 44 e4 ldi r20, 0x44 ; 68 22df2: 5e e3 ldi r21, 0x3E ; 62 22df4: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 22df8: eb 01 movw r28, r22 22dfa: 18 2f mov r17, r24 22dfc: 09 2f mov r16, r25 float volt_bed = VOLT_DIV_REF * ((float)current_voltage_raw_bed / (1023 * OVERSAMPLENR)) / VOLT_DIV_FAC; 22dfe: 60 91 59 06 lds r22, 0x0659 ; 0x800659 22e02: 70 91 5a 06 lds r23, 0x065A ; 0x80065a 22e06: 07 2e mov r0, r23 22e08: 00 0c add r0, r0 22e0a: 88 0b sbc r24, r24 22e0c: 99 0b sbc r25, r25 22e0e: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 22e12: 20 e0 ldi r18, 0x00 ; 0 22e14: 30 ec ldi r19, 0xC0 ; 192 22e16: 4f e7 ldi r20, 0x7F ; 127 22e18: 56 e4 ldi r21, 0x46 ; 70 22e1a: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 22e1e: 20 e0 ldi r18, 0x00 ; 0 22e20: 30 e0 ldi r19, 0x00 ; 0 22e22: 40 ea ldi r20, 0xA0 ; 160 22e24: 50 e4 ldi r21, 0x40 ; 64 22e26: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 22e2a: 27 ed ldi r18, 0xD7 ; 215 22e2c: 30 e3 ldi r19, 0x30 ; 48 22e2e: 44 e4 ldi r20, 0x44 ; 68 22e30: 5e e3 ldi r21, 0x3E ; 62 22e32: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 22e36: f6 2e mov r15, r22 22e38: e7 2e mov r14, r23 22e3a: d8 2e mov r13, r24 22e3c: c9 2e mov r12, r25 lcd_home(); 22e3e: 0e 94 24 6f call 0xde48 ; 0xde48 lcd_printf_P(PSTR(" PWR: %4.1fV\n" " BED: %4.1fV"), volt_pwr, volt_bed); 22e42: cf 92 push r12 22e44: df 92 push r13 22e46: ef 92 push r14 22e48: ff 92 push r15 22e4a: 0f 93 push r16 22e4c: 1f 93 push r17 22e4e: df 93 push r29 22e50: cf 93 push r28 22e52: 84 e6 ldi r24, 0x64 ; 100 22e54: 91 ea ldi r25, 0xA1 ; 161 22e56: 9f 93 push r25 22e58: 8f 93 push r24 22e5a: 0e 94 d1 6e call 0xdda2 ; 0xdda2 #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) lcd_printf_P(PSTR("\n IR : %3.1fV"), Raw2Voltage(fsensor.getVoltRaw())); #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) menu_back_if_clicked(); 22e5e: 8d b7 in r24, 0x3d ; 61 22e60: 9e b7 in r25, 0x3e ; 62 22e62: 0a 96 adiw r24, 0x0a ; 10 22e64: 0f b6 in r0, 0x3f ; 63 22e66: f8 94 cli 22e68: 9e bf out 0x3e, r25 ; 62 22e6a: 0f be out 0x3f, r0 ; 63 22e6c: 8d bf out 0x3d, r24 ; 61 } 22e6e: df 91 pop r29 22e70: cf 91 pop r28 22e72: 1f 91 pop r17 22e74: 0f 91 pop r16 22e76: ff 90 pop r15 22e78: ef 90 pop r14 22e7a: df 90 pop r13 22e7c: cf 90 pop r12 lcd_home(); lcd_printf_P(PSTR(" PWR: %4.1fV\n" " BED: %4.1fV"), volt_pwr, volt_bed); #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) lcd_printf_P(PSTR("\n IR : %3.1fV"), Raw2Voltage(fsensor.getVoltRaw())); #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) menu_back_if_clicked(); 22e7e: 0d 94 bb d4 jmp 0x3a976 ; 0x3a976 00022e82 : //! | Crash X 000 Y 000| MSG_CRASH c=7 //! ---------------------- //! @endcode //! @todo leptun refactor this piece of code please static void lcd_menu_fails_stats_print() { 22e82: af 92 push r10 22e84: bf 92 push r11 22e86: cf 92 push r12 22e88: df 92 push r13 22e8a: ef 92 push r14 22e8c: ff 92 push r15 22e8e: 0f 93 push r16 22e90: 1f 93 push r17 22e92: cf 93 push r28 22e94: df 93 push r29 22e96: 10 92 da 03 sts 0x03DA, r1 ; 0x8003da lcd_timeoutToStatus.stop(); //infinite timeout uint8_t power = eeprom_read_byte((uint8_t*)EEPROM_POWER_COUNT); 22e9a: 84 e6 ldi r24, 0x64 ; 100 22e9c: 9f e0 ldi r25, 0x0F ; 15 22e9e: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 22ea2: 18 2f mov r17, r24 uint8_t filam = eeprom_read_byte((uint8_t*)EEPROM_FERROR_COUNT); 22ea4: 85 e6 ldi r24, 0x65 ; 101 22ea6: 9f e0 ldi r25, 0x0F ; 15 22ea8: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 22eac: e8 2e mov r14, r24 uint8_t crashX = eeprom_read_byte((uint8_t*)EEPROM_CRASH_COUNT_X); 22eae: 86 e6 ldi r24, 0x66 ; 102 22eb0: 9f e0 ldi r25, 0x0F ; 15 22eb2: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 22eb6: b8 2e mov r11, r24 uint8_t crashY = eeprom_read_byte((uint8_t*)EEPROM_CRASH_COUNT_Y); 22eb8: 88 e6 ldi r24, 0x68 ; 104 22eba: 9f e0 ldi r25, 0x0F ; 15 22ebc: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 22ec0: a8 2e mov r10, r24 lcd_home(); 22ec2: 0e 94 24 6f call 0xde48 ; 0xde48 lcd_printf_P(failStatsFmt, 22ec6: 8a ef ldi r24, 0xFA ; 250 22ec8: 9e e4 ldi r25, 0x4E ; 78 22eca: 0e 94 c4 72 call 0xe588 ; 0xe588 22ece: d8 2e mov r13, r24 22ed0: c9 2e mov r12, r25 22ed2: 8b ee ldi r24, 0xEB ; 235 22ed4: 9e e4 ldi r25, 0x4E ; 78 22ed6: 0e 94 c4 72 call 0xe588 ; 0xe588 22eda: 08 2f mov r16, r24 22edc: f9 2e mov r15, r25 22ede: 8a ed ldi r24, 0xDA ; 218 22ee0: 9e e4 ldi r25, 0x4E ; 78 22ee2: 0e 94 c4 72 call 0xe588 ; 0xe588 22ee6: ec 01 movw r28, r24 22ee8: 84 ec ldi r24, 0xC4 ; 196 22eea: 9e e4 ldi r25, 0x4E ; 78 22eec: 0e 94 c4 72 call 0xe588 ; 0xe588 22ef0: 1f 92 push r1 22ef2: af 92 push r10 22ef4: 1f 92 push r1 22ef6: bf 92 push r11 22ef8: cf 92 push r12 22efa: df 92 push r13 22efc: 1f 92 push r1 22efe: ef 92 push r14 22f00: ff 92 push r15 22f02: 0f 93 push r16 22f04: 1f 92 push r1 22f06: 1f 93 push r17 22f08: df 93 push r29 22f0a: cf 93 push r28 22f0c: 9f 93 push r25 22f0e: 8f 93 push r24 22f10: 85 e2 ldi r24, 0x25 ; 37 22f12: 91 ea ldi r25, 0xA1 ; 161 22f14: 9f 93 push r25 22f16: 8f 93 push r24 22f18: 0e 94 d1 6e call 0xdda2 ; 0xdda2 _T(MSG_LAST_PRINT_FAILURES), _T(MSG_POWER_FAILURES), power, _T(MSG_FIL_RUNOUTS), filam, _T(MSG_CRASH), crashX, crashY); menu_back_if_clicked(); 22f1c: 8d b7 in r24, 0x3d ; 61 22f1e: 9e b7 in r25, 0x3e ; 62 22f20: 42 96 adiw r24, 0x12 ; 18 22f22: 0f b6 in r0, 0x3f ; 63 22f24: f8 94 cli 22f26: 9e bf out 0x3e, r25 ; 62 22f28: 0f be out 0x3f, r0 ; 63 22f2a: 8d bf out 0x3d, r24 ; 61 } 22f2c: df 91 pop r29 22f2e: cf 91 pop r28 22f30: 1f 91 pop r17 22f32: 0f 91 pop r16 22f34: ff 90 pop r15 22f36: ef 90 pop r14 22f38: df 90 pop r13 22f3a: cf 90 pop r12 22f3c: bf 90 pop r11 22f3e: af 90 pop r10 lcd_printf_P(failStatsFmt, _T(MSG_LAST_PRINT_FAILURES), _T(MSG_POWER_FAILURES), power, _T(MSG_FIL_RUNOUTS), filam, _T(MSG_CRASH), crashX, crashY); menu_back_if_clicked(); 22f40: 0d 94 bb d4 jmp 0x3a976 ; 0x3a976 00022f44 : //! | 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() { 22f44: cf 92 push r12 22f46: df 92 push r13 22f48: ef 92 push r14 22f4a: ff 92 push r15 22f4c: 0f 93 push r16 22f4e: 1f 93 push r17 22f50: cf 93 push r28 22f52: df 93 push r29 22f54: 10 92 da 03 sts 0x03DA, r1 ; 0x8003da lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 22f58: 0e 94 24 6f call 0xde48 ; 0xde48 " %-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) )); 22f5c: 8f ec ldi r24, 0xCF ; 207 22f5e: 9e e0 ldi r25, 0x0E ; 14 22f60: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu_print() { lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); lcd_printf_P( 22f64: 90 e0 ldi r25, 0x00 ; 0 22f66: 0f 94 01 10 call 0x22002 ; 0x22002 22f6a: d8 2e mov r13, r24 22f6c: c9 2e mov r12, r25 22f6e: 8d e7 ldi r24, 0x7D ; 125 22f70: 9e e4 ldi r25, 0x4E ; 78 22f72: 0e 94 c4 72 call 0xe588 ; 0xe588 22f76: f8 2e mov r15, r24 22f78: 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) ), 22f7a: 82 ed ldi r24, 0xD2 ; 210 22f7c: 9e e0 ldi r25, 0x0E ; 14 22f7e: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu_print() { lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); lcd_printf_P( 22f82: 90 e0 ldi r25, 0x00 ; 0 22f84: 0f 94 01 10 call 0x22002 ; 0x22002 22f88: 18 2f mov r17, r24 22f8a: 09 2f mov r16, r25 22f8c: 81 e7 ldi r24, 0x71 ; 113 22f8e: 9e e4 ldi r25, 0x4E ; 78 22f90: 0e 94 c4 72 call 0xe588 ; 0xe588 22f94: ec 01 movw r28, r24 22f96: 84 ec ldi r24, 0xC4 ; 196 22f98: 9e e4 ldi r25, 0x4E ; 78 22f9a: 0e 94 c4 72 call 0xe588 ; 0xe588 22f9e: cf 92 push r12 22fa0: df 92 push r13 22fa2: ef 92 push r14 22fa4: ff 92 push r15 22fa6: 0f 93 push r16 22fa8: 1f 93 push r17 22faa: df 93 push r29 22fac: cf 93 push r28 22fae: 9f 93 push r25 22fb0: 8f 93 push r24 22fb2: 89 ed ldi r24, 0xD9 ; 217 22fb4: 90 ea ldi r25, 0xA0 ; 160 22fb6: 9f 93 push r25 22fb8: 8f 93 push r24 22fba: 0e 94 d1 6e call 0xdda2 ; 0xdda2 " %-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(); 22fbe: 8d b7 in r24, 0x3d ; 61 22fc0: 9e b7 in r25, 0x3e ; 62 22fc2: 0c 96 adiw r24, 0x0c ; 12 22fc4: 0f b6 in r0, 0x3f ; 63 22fc6: f8 94 cli 22fc8: 9e bf out 0x3e, r25 ; 62 22fca: 0f be out 0x3f, r0 ; 63 22fcc: 8d bf out 0x3d, r24 ; 61 } 22fce: df 91 pop r29 22fd0: cf 91 pop r28 22fd2: 1f 91 pop r17 22fd4: 0f 91 pop r16 22fd6: ff 90 pop r15 22fd8: ef 90 pop r14 22fda: df 90 pop r13 22fdc: 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(); 22fde: 0d 94 bb d4 jmp 0x3a976 ; 0x3a976 00022fe2 : //! | Y: 000 | //! | | //! ---------------------- //! @endcode static void lcd_menu_belt_status() { 22fe2: 0f 93 push r16 22fe4: 1f 93 push r17 22fe6: cf 93 push r28 22fe8: df 93 push r29 lcd_home(); 22fea: 0e 94 24 6f call 0xde48 ; 0xde48 lcd_printf_P(PSTR("%S\n" " X %d\n" " Y %d"), _T(MSG_BELT_STATUS), eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_X)), eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_Y))); 22fee: 8b e5 ldi r24, 0x5B ; 91 22ff0: 9f e0 ldi r25, 0x0F ; 15 22ff2: 0f 94 e5 db call 0x3b7ca ; 0x3b7ca 22ff6: 18 2f mov r17, r24 22ff8: 09 2f mov r16, r25 22ffa: 8d e5 ldi r24, 0x5D ; 93 22ffc: 9f e0 ldi r25, 0x0F ; 15 22ffe: 0f 94 e5 db call 0x3b7ca ; 0x3b7ca 23002: ec 01 movw r28, r24 23004: 8b e3 ldi r24, 0x3B ; 59 23006: 9f e4 ldi r25, 0x4F ; 79 23008: 0e 94 c4 72 call 0xe588 ; 0xe588 2300c: 0f 93 push r16 2300e: 1f 93 push r17 23010: df 93 push r29 23012: cf 93 push r28 23014: 9f 93 push r25 23016: 8f 93 push r24 23018: 88 e8 ldi r24, 0x88 ; 136 2301a: 91 ea ldi r25, 0xA1 ; 161 2301c: 9f 93 push r25 2301e: 8f 93 push r24 23020: 0e 94 d1 6e call 0xdda2 ; 0xdda2 menu_back_if_clicked(); 23024: 8d b7 in r24, 0x3d ; 61 23026: 9e b7 in r25, 0x3e ; 62 23028: 08 96 adiw r24, 0x08 ; 8 2302a: 0f b6 in r0, 0x3f ; 63 2302c: f8 94 cli 2302e: 9e bf out 0x3e, r25 ; 62 23030: 0f be out 0x3f, r0 ; 63 23032: 8d bf out 0x3d, r24 ; 61 } 23034: df 91 pop r29 23036: cf 91 pop r28 23038: 1f 91 pop r17 2303a: 0f 91 pop r16 //! @endcode static void lcd_menu_belt_status() { lcd_home(); lcd_printf_P(PSTR("%S\n" " X %d\n" " Y %d"), _T(MSG_BELT_STATUS), eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_X)), eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_Y))); menu_back_if_clicked(); 2303c: 0d 94 bb d4 jmp 0x3a976 ; 0x3a976 00023040 : //! | Fil. runouts 000| MSG_FIL_RUNOUTS c=15 //! | Crash X:000 Y:000| MSG_CRASH c=7 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_total() { 23040: 6f 92 push r6 23042: 7f 92 push r7 23044: 8f 92 push r8 23046: 9f 92 push r9 23048: af 92 push r10 2304a: bf 92 push r11 2304c: cf 92 push r12 2304e: df 92 push r13 23050: ef 92 push r14 23052: ff 92 push r15 23054: 0f 93 push r16 23056: 1f 93 push r17 23058: cf 93 push r28 2305a: df 93 push r29 2305c: 10 92 da 03 sts 0x03DA, r1 ; 0x8003da lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 23060: 0e 94 24 6f call 0xde48 ; 0xde48 lcd_printf_P(failStatsFmt, 23064: 83 e0 ldi r24, 0x03 ; 3 23066: 9f e0 ldi r25, 0x0F ; 15 23068: 0f 94 e5 db call 0x3b7ca ; 0x3b7ca 2306c: 0f 94 01 10 call 0x22002 ; 0x22002 23070: 78 2e mov r7, r24 23072: 69 2e mov r6, r25 23074: 85 e0 ldi r24, 0x05 ; 5 23076: 9f e0 ldi r25, 0x0F ; 15 23078: 0f 94 e5 db call 0x3b7ca ; 0x3b7ca 2307c: 0f 94 01 10 call 0x22002 ; 0x22002 23080: 98 2e mov r9, r24 23082: 89 2e mov r8, r25 23084: 8a ef ldi r24, 0xFA ; 250 23086: 9e e4 ldi r25, 0x4E ; 78 23088: 0e 94 c4 72 call 0xe588 ; 0xe588 2308c: b8 2e mov r11, r24 2308e: a9 2e mov r10, r25 23090: 81 e0 ldi r24, 0x01 ; 1 23092: 9f e0 ldi r25, 0x0F ; 15 23094: 0f 94 e5 db call 0x3b7ca ; 0x3b7ca 23098: 0f 94 01 10 call 0x22002 ; 0x22002 2309c: d8 2e mov r13, r24 2309e: c9 2e mov r12, r25 230a0: 8b ee ldi r24, 0xEB ; 235 230a2: 9e e4 ldi r25, 0x4E ; 78 230a4: 0e 94 c4 72 call 0xe588 ; 0xe588 230a8: f8 2e mov r15, r24 230aa: e9 2e mov r14, r25 230ac: 8f ef ldi r24, 0xFF ; 255 230ae: 9e e0 ldi r25, 0x0E ; 14 230b0: 0f 94 e5 db call 0x3b7ca ; 0x3b7ca 230b4: 0f 94 01 10 call 0x22002 ; 0x22002 230b8: 18 2f mov r17, r24 230ba: 09 2f mov r16, r25 230bc: 8a ed ldi r24, 0xDA ; 218 230be: 9e e4 ldi r25, 0x4E ; 78 230c0: 0e 94 c4 72 call 0xe588 ; 0xe588 230c4: ec 01 movw r28, r24 230c6: 83 eb ldi r24, 0xB3 ; 179 230c8: 9e e4 ldi r25, 0x4E ; 78 230ca: 0e 94 c4 72 call 0xe588 ; 0xe588 230ce: 6f 92 push r6 230d0: 7f 92 push r7 230d2: 8f 92 push r8 230d4: 9f 92 push r9 230d6: af 92 push r10 230d8: bf 92 push r11 230da: cf 92 push r12 230dc: df 92 push r13 230de: ef 92 push r14 230e0: ff 92 push r15 230e2: 0f 93 push r16 230e4: 1f 93 push r17 230e6: df 93 push r29 230e8: cf 93 push r28 230ea: 9f 93 push r25 230ec: 8f 93 push r24 230ee: 85 e2 ldi r24, 0x25 ; 37 230f0: 91 ea ldi r25, 0xA1 ; 161 230f2: 9f 93 push r25 230f4: 8f 93 push r24 230f6: 0e 94 d1 6e call 0xdda2 ; 0xdda2 _T(MSG_POWER_FAILURES), clamp999( eeprom_read_word((uint16_t*)EEPROM_POWER_COUNT_TOT) ), _T(MSG_FIL_RUNOUTS), clamp999( eeprom_read_word((uint16_t*)EEPROM_FERROR_COUNT_TOT) ), _T(MSG_CRASH), clamp999( eeprom_read_word((uint16_t*)EEPROM_CRASH_COUNT_X_TOT) ), clamp999( eeprom_read_word((uint16_t*)EEPROM_CRASH_COUNT_Y_TOT) )); menu_back_if_clicked(); 230fa: 8d b7 in r24, 0x3d ; 61 230fc: 9e b7 in r25, 0x3e ; 62 230fe: 42 96 adiw r24, 0x12 ; 18 23100: 0f b6 in r0, 0x3f ; 63 23102: f8 94 cli 23104: 9e bf out 0x3e, r25 ; 62 23106: 0f be out 0x3f, r0 ; 63 23108: 8d bf out 0x3d, r24 ; 61 } 2310a: df 91 pop r29 2310c: cf 91 pop r28 2310e: 1f 91 pop r17 23110: 0f 91 pop r16 23112: ff 90 pop r15 23114: ef 90 pop r14 23116: df 90 pop r13 23118: cf 90 pop r12 2311a: bf 90 pop r11 2311c: af 90 pop r10 2311e: 9f 90 pop r9 23120: 8f 90 pop r8 23122: 7f 90 pop r7 23124: 6f 90 pop r6 _T(MSG_POWER_FAILURES), clamp999( eeprom_read_word((uint16_t*)EEPROM_POWER_COUNT_TOT) ), _T(MSG_FIL_RUNOUTS), clamp999( eeprom_read_word((uint16_t*)EEPROM_FERROR_COUNT_TOT) ), _T(MSG_CRASH), clamp999( eeprom_read_word((uint16_t*)EEPROM_CRASH_COUNT_X_TOT) ), clamp999( eeprom_read_word((uint16_t*)EEPROM_CRASH_COUNT_Y_TOT) )); menu_back_if_clicked(); 23126: 0d 94 bb d4 jmp 0x3a976 ; 0x3a976 0002312a : //! | 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() { 2312a: 8f 92 push r8 2312c: 9f 92 push r9 2312e: af 92 push r10 23130: bf 92 push r11 23132: cf 92 push r12 23134: df 92 push r13 23136: ef 92 push r14 23138: ff 92 push r15 2313a: 0f 93 push r16 2313c: 1f 93 push r17 2313e: cf 93 push r28 23140: df 93 push r29 23142: 10 92 da 03 sts 0x03DA, r1 ; 0x8003da lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 23146: 0e 94 24 6f call 0xde48 ; 0xde48 lcd_printf_P( 2314a: 80 91 bf 13 lds r24, 0x13BF ; 0x8013bf 2314e: 90 91 c0 13 lds r25, 0x13C0 ; 0x8013c0 23152: 0f 94 01 10 call 0x22002 ; 0x22002 23156: 98 2e mov r9, r24 23158: 89 2e mov r8, r25 2315a: 8e e8 ldi r24, 0x8E ; 142 2315c: 9e e4 ldi r25, 0x4E ; 78 2315e: 0e 94 c4 72 call 0xe588 ; 0xe588 23162: b8 2e mov r11, r24 23164: a9 2e mov r10, r25 23166: 80 ed ldi r24, 0xD0 ; 208 23168: 9e e0 ldi r25, 0x0E ; 14 2316a: 0f 94 e5 db call 0x3b7ca ; 0x3b7ca 2316e: 0f 94 01 10 call 0x22002 ; 0x22002 23172: d8 2e mov r13, r24 23174: c9 2e mov r12, r25 23176: 8d e7 ldi r24, 0x7D ; 125 23178: 9e e4 ldi r25, 0x4E ; 78 2317a: 0e 94 c4 72 call 0xe588 ; 0xe588 2317e: f8 2e mov r15, r24 23180: e9 2e mov r14, r25 23182: 83 ed ldi r24, 0xD3 ; 211 23184: 9e e0 ldi r25, 0x0E ; 14 23186: 0f 94 e5 db call 0x3b7ca ; 0x3b7ca 2318a: 0f 94 01 10 call 0x22002 ; 0x22002 2318e: 18 2f mov r17, r24 23190: 09 2f mov r16, r25 23192: 81 e7 ldi r24, 0x71 ; 113 23194: 9e e4 ldi r25, 0x4E ; 78 23196: 0e 94 c4 72 call 0xe588 ; 0xe588 2319a: ec 01 movw r28, r24 2319c: 83 eb ldi r24, 0xB3 ; 179 2319e: 9e e4 ldi r25, 0x4E ; 78 231a0: 0e 94 c4 72 call 0xe588 ; 0xe588 231a4: 8f 92 push r8 231a6: 9f 92 push r9 231a8: af 92 push r10 231aa: bf 92 push r11 231ac: cf 92 push r12 231ae: df 92 push r13 231b0: ef 92 push r14 231b2: ff 92 push r15 231b4: 0f 93 push r16 231b6: 1f 93 push r17 231b8: df 93 push r29 231ba: cf 93 push r28 231bc: 9f 93 push r25 231be: 8f 93 push r24 231c0: 88 ef ldi r24, 0xF8 ; 248 231c2: 90 ea ldi r25, 0xA0 ; 160 231c4: 9f 93 push r25 231c6: 8f 93 push r24 231c8: 0e 94 d1 6e call 0xdda2 ; 0xdda2 ), _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(); 231cc: 8d b7 in r24, 0x3d ; 61 231ce: 9e b7 in r25, 0x3e ; 62 231d0: 40 96 adiw r24, 0x10 ; 16 231d2: 0f b6 in r0, 0x3f ; 63 231d4: f8 94 cli 231d6: 9e bf out 0x3e, r25 ; 62 231d8: 0f be out 0x3f, r0 ; 63 231da: 8d bf out 0x3d, r24 ; 61 } 231dc: df 91 pop r29 231de: cf 91 pop r28 231e0: 1f 91 pop r17 231e2: 0f 91 pop r16 231e4: ff 90 pop r15 231e6: ef 90 pop r14 231e8: df 90 pop r13 231ea: cf 90 pop r12 231ec: bf 90 pop r11 231ee: af 90 pop r10 231f0: 9f 90 pop r9 231f2: 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(); 231f4: 0d 94 bb d4 jmp 0x3a976 ; 0x3a976 000231f8 : //! |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() { 231f8: cf 93 push r28 231fa: df 93 push r29 lcd_puts_at_P(0, 0, _T(MSG_MEASURED_OFFSET)); 231fc: 8a e7 ldi r24, 0x7A ; 122 231fe: 91 e5 ldi r25, 0x51 ; 81 23200: 0e 94 c4 72 call 0xe588 ; 0xe588 23204: ac 01 movw r20, r24 23206: 60 e0 ldi r22, 0x00 ; 0 23208: 80 e0 ldi r24, 0x00 ; 0 2320a: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_puts_at_P(0, 1, STR_SEPARATOR); 2320e: 48 eb ldi r20, 0xB8 ; 184 23210: 5a e8 ldi r21, 0x8A ; 138 23212: 61 e0 ldi r22, 0x01 ; 1 23214: 80 e0 ldi r24, 0x00 ; 0 23216: 0e 94 0c 6f call 0xde18 ; 0xde18 for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(0, i + 2); 2321a: 62 e0 ldi r22, 0x02 ; 2 2321c: 80 e0 ldi r24, 0x00 ; 0 2321e: 0e 94 f8 6e call 0xddf0 ; 0xddf0 lcd_printf_P(PSTR("%c%17.2fmm"), 'X' + i, eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_CENTER+4*i))); 23222: 85 ee ldi r24, 0xE5 ; 229 23224: 9f e0 ldi r25, 0x0F ; 15 23226: 0f 94 df db call 0x3b7be ; 0x3b7be 2322a: 9f 93 push r25 2322c: 8f 93 push r24 2322e: 7f 93 push r23 23230: 6f 93 push r22 23232: 1f 92 push r1 23234: 88 e5 ldi r24, 0x58 ; 88 23236: 8f 93 push r24 23238: c1 e6 ldi r28, 0x61 ; 97 2323a: d3 ea ldi r29, 0xA3 ; 163 2323c: df 93 push r29 2323e: cf 93 push r28 23240: 0e 94 d1 6e call 0xdda2 ; 0xdda2 { 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); 23244: 63 e0 ldi r22, 0x03 ; 3 23246: 80 e0 ldi r24, 0x00 ; 0 23248: 0e 94 f8 6e call 0xddf0 ; 0xddf0 lcd_printf_P(PSTR("%c%17.2fmm"), 'X' + i, eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_CENTER+4*i))); 2324c: 89 ee ldi r24, 0xE9 ; 233 2324e: 9f e0 ldi r25, 0x0F ; 15 23250: 0f 94 df db call 0x3b7be ; 0x3b7be 23254: 9f 93 push r25 23256: 8f 93 push r24 23258: 7f 93 push r23 2325a: 6f 93 push r22 2325c: 1f 92 push r1 2325e: 89 e5 ldi r24, 0x59 ; 89 23260: 8f 93 push r24 23262: df 93 push r29 23264: cf 93 push r28 23266: 0e 94 d1 6e call 0xdda2 ; 0xdda2 } menu_back_if_clicked(); 2326a: 8d b7 in r24, 0x3d ; 61 2326c: 9e b7 in r25, 0x3e ; 62 2326e: 40 96 adiw r24, 0x10 ; 16 23270: 0f b6 in r0, 0x3f ; 63 23272: f8 94 cli 23274: 9e bf out 0x3e, r25 ; 62 23276: 0f be out 0x3f, r0 ; 63 23278: 8d bf out 0x3d, r24 ; 61 } 2327a: df 91 pop r29 2327c: 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(); 2327e: 0d 94 bb d4 jmp 0x3a976 ; 0x3a976 00023282 : //! ---------------------- //! 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() { 23282: cf 92 push r12 23284: df 92 push r13 23286: ef 92 push r14 23288: ff 92 push r15 2328a: 0f 93 push r16 2328c: 1f 93 push r17 2328e: cf 93 push r28 23290: df 93 push r29 float angleDiff = eeprom_read_float((float*)(EEPROM_XYZ_CAL_SKEW)); 23292: 80 e6 ldi r24, 0x60 ; 96 23294: 9f e0 ldi r25, 0x0F ; 15 23296: 0f 94 df db call 0x3b7be ; 0x3b7be 2329a: 6b 01 movw r12, r22 2329c: 7c 01 movw r14, r24 lcd_home(); 2329e: 0e 94 24 6f call 0xde48 ; 0xde48 lcd_printf_P(_N( 232a2: 8c e6 ldi r24, 0x6C ; 108 232a4: 91 e5 ldi r25, 0x51 ; 81 232a6: 0e 94 c4 72 call 0xe588 ; 0xe588 232aa: 18 2f mov r17, r24 232ac: 09 2f mov r16, r25 232ae: 8e e5 ldi r24, 0x5E ; 94 232b0: 91 e5 ldi r25, 0x51 ; 81 232b2: 0e 94 c4 72 call 0xe588 ; 0xe588 232b6: ec 01 movw r28, r24 232b8: 8e e4 ldi r24, 0x4E ; 78 232ba: 91 e5 ldi r25, 0x51 ; 81 232bc: 0e 94 c4 72 call 0xe588 ; 0xe588 232c0: 2e e3 ldi r18, 0x3E ; 62 232c2: 2f 93 push r18 232c4: 20 e8 ldi r18, 0x80 ; 128 232c6: 2f 93 push r18 232c8: 1f 92 push r1 232ca: 1f 92 push r1 232cc: 0f 93 push r16 232ce: 1f 93 push r17 232d0: 2d e3 ldi r18, 0x3D ; 61 232d2: 2f 93 push r18 232d4: 25 ef ldi r18, 0xF5 ; 245 232d6: 2f 93 push r18 232d8: 22 ec ldi r18, 0xC2 ; 194 232da: 2f 93 push r18 232dc: 20 e9 ldi r18, 0x90 ; 144 232de: 2f 93 push r18 232e0: df 93 push r29 232e2: cf 93 push r28 232e4: 28 eb ldi r18, 0xB8 ; 184 232e6: 3a e8 ldi r19, 0x8A ; 138 232e8: 3f 93 push r19 232ea: 2f 93 push r18 232ec: 9f 93 push r25 232ee: 8f 93 push r24 232f0: 80 e0 ldi r24, 0x00 ; 0 232f2: 90 e7 ldi r25, 0x70 ; 112 232f4: 9f 93 push r25 232f6: 8f 93 push r24 232f8: 0e 94 d1 6e call 0xdda2 ; 0xdda2 _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); 232fc: 60 e0 ldi r22, 0x00 ; 0 232fe: 8f e0 ldi r24, 0x0F ; 15 23300: 0e 94 f8 6e call 0xddf0 ; 0xddf0 if (angleDiff < 100){ 23304: 8d b7 in r24, 0x3d ; 61 23306: 9e b7 in r25, 0x3e ; 62 23308: 42 96 adiw r24, 0x12 ; 18 2330a: 0f b6 in r0, 0x3f ; 63 2330c: f8 94 cli 2330e: 9e bf out 0x3e, r25 ; 62 23310: 0f be out 0x3f, r0 ; 63 23312: 8d bf out 0x3d, r24 ; 61 23314: 20 e0 ldi r18, 0x00 ; 0 23316: 30 e0 ldi r19, 0x00 ; 0 23318: 48 ec ldi r20, 0xC8 ; 200 2331a: 52 e4 ldi r21, 0x42 ; 66 2331c: c7 01 movw r24, r14 2331e: b6 01 movw r22, r12 23320: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 23324: 87 ff sbrs r24, 7 23326: 32 c0 rjmp .+100 ; 0x2338c } //@brief Show measured axis skewness float _deg(float rad) { return rad * 180 / M_PI; 23328: 20 e0 ldi r18, 0x00 ; 0 2332a: 30 e0 ldi r19, 0x00 ; 0 2332c: 44 e3 ldi r20, 0x34 ; 52 2332e: 53 e4 ldi r21, 0x43 ; 67 23330: c7 01 movw r24, r14 23332: b6 01 movw r22, r12 23334: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 23338: 2b ed ldi r18, 0xDB ; 219 2333a: 3f e0 ldi r19, 0x0F ; 15 2333c: 49 e4 ldi r20, 0x49 ; 73 2333e: 50 e4 ldi r21, 0x40 ; 64 23340: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__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)); 23344: 9f 93 push r25 23346: 8f 93 push r24 23348: 7f 93 push r23 2334a: 6f 93 push r22 2334c: 89 ef ldi r24, 0xF9 ; 249 2334e: 9f e6 ldi r25, 0x6F ; 111 23350: 9f 93 push r25 23352: 8f 93 push r24 23354: 0e 94 d1 6e call 0xdda2 ; 0xdda2 23358: 0f 90 pop r0 2335a: 0f 90 pop r0 2335c: 0f 90 pop r0 2335e: 0f 90 pop r0 23360: 0f 90 pop r0 23362: 0f 90 pop r0 } else { lcd_puts_P(_T(MSG_NA)); } if (lcd_clicked()) 23364: 0e 94 15 71 call 0xe22a ; 0xe22a 23368: 88 23 and r24, r24 2336a: b9 f0 breq .+46 ; 0x2339a menu_goto(lcd_menu_xyz_offset, 0, true); 2336c: 20 e0 ldi r18, 0x00 ; 0 2336e: 41 e0 ldi r20, 0x01 ; 1 23370: 70 e0 ldi r23, 0x00 ; 0 23372: 60 e0 ldi r22, 0x00 ; 0 23374: 8a e4 ldi r24, 0x4A ; 74 23376: 9a e3 ldi r25, 0x3A ; 58 } 23378: df 91 pop r29 2337a: cf 91 pop r28 2337c: 1f 91 pop r17 2337e: 0f 91 pop r16 23380: ff 90 pop r15 23382: ef 90 pop r14 23384: df 90 pop r13 23386: 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); 23388: 0d 94 7b d1 jmp 0x3a2f6 ; 0x3a2f6 ); 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)); 2338c: 86 ee ldi r24, 0xE6 ; 230 2338e: 97 e4 ldi r25, 0x47 ; 71 23390: 0e 94 c4 72 call 0xe588 ; 0xe588 23394: 0e 94 e3 6e call 0xddc6 ; 0xddc6 23398: e5 cf rjmp .-54 ; 0x23364 } if (lcd_clicked()) menu_goto(lcd_menu_xyz_offset, 0, true); } 2339a: df 91 pop r29 2339c: cf 91 pop r28 2339e: 1f 91 pop r17 233a0: 0f 91 pop r16 233a2: ff 90 pop r15 233a4: ef 90 pop r14 233a6: df 90 pop r13 233a8: cf 90 pop r12 233aa: 08 95 ret 000233ac : //! |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() { 233ac: 2f 92 push r2 233ae: 3f 92 push r3 233b0: 4f 92 push r4 233b2: 5f 92 push r5 233b4: 6f 92 push r6 233b6: 7f 92 push r7 233b8: 8f 92 push r8 233ba: 9f 92 push r9 233bc: af 92 push r10 233be: bf 92 push r11 233c0: cf 92 push r12 233c2: df 92 push r13 233c4: ef 92 push r14 233c6: ff 92 push r15 233c8: 0f 93 push r16 233ca: 1f 93 push r17 233cc: cf 93 push r28 233ce: df 93 push r29 233d0: cd b7 in r28, 0x3d ; 61 233d2: de b7 in r29, 0x3e ; 62 233d4: a8 97 sbiw r28, 0x28 ; 40 233d6: 0f b6 in r0, 0x3f ; 63 233d8: f8 94 cli 233da: de bf out 0x3e, r29 ; 62 233dc: 0f be out 0x3f, r0 ; 63 233de: 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); 233e0: 48 e0 ldi r20, 0x08 ; 8 233e2: 50 e0 ldi r21, 0x00 ; 0 233e4: 65 ee ldi r22, 0xE5 ; 229 233e6: 7f e0 ldi r23, 0x0F ; 15 233e8: ce 01 movw r24, r28 233ea: 41 96 adiw r24, 0x11 ; 17 233ec: 0f 94 c7 db call 0x3b78e ; 0x3b78e eeprom_read_block(&vec_x[0], (float*)(EEPROM_BED_CALIBRATION_VEC_X), 8); 233f0: 48 e0 ldi r20, 0x08 ; 8 233f2: 50 e0 ldi r21, 0x00 ; 0 233f4: 6d ed ldi r22, 0xDD ; 221 233f6: 7f e0 ldi r23, 0x0F ; 15 233f8: ce 01 movw r24, r28 233fa: 09 96 adiw r24, 0x09 ; 9 233fc: 0f 94 c7 db call 0x3b78e ; 0x3b78e eeprom_read_block(&vec_y[0], (float*)(EEPROM_BED_CALIBRATION_VEC_Y), 8); 23400: 48 e0 ldi r20, 0x08 ; 8 23402: 50 e0 ldi r21, 0x00 ; 0 23404: 65 ed ldi r22, 0xD5 ; 213 23406: 7f e0 ldi r23, 0x0F ; 15 23408: ce 01 movw r24, r28 2340a: 01 96 adiw r24, 0x01 ; 1 2340c: 0f 94 c7 db call 0x3b78e ; 0x3b78e 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]; 23410: 8d 84 ldd r8, Y+13 ; 0x0d 23412: 9e 84 ldd r9, Y+14 ; 0x0e 23414: af 84 ldd r10, Y+15 ; 0x0f 23416: b8 88 ldd r11, Y+16 ; 0x10 23418: ea e0 ldi r30, 0x0A ; 10 2341a: f6 ea ldi r31, 0xA6 ; 166 2341c: 25 91 lpm r18, Z+ 2341e: 35 91 lpm r19, Z+ 23420: 45 91 lpm r20, Z+ 23422: 54 91 lpm r21, Z 23424: cd 80 ldd r12, Y+5 ; 0x05 23426: de 80 ldd r13, Y+6 ; 0x06 23428: ef 80 ldd r14, Y+7 ; 0x07 2342a: f8 84 ldd r15, Y+8 ; 0x08 2342c: ee e0 ldi r30, 0x0E ; 14 2342e: f6 ea ldi r31, 0xA6 ; 166 23430: 85 91 lpm r24, Z+ 23432: 95 91 lpm r25, Z+ 23434: a5 91 lpm r26, Z+ 23436: b4 91 lpm r27, Z 23438: 8d a3 std Y+37, r24 ; 0x25 2343a: 9e a3 std Y+38, r25 ; 0x26 2343c: af a3 std Y+39, r26 ; 0x27 2343e: b8 a7 std Y+40, r27 ; 0x28 23440: 8d 89 ldd r24, Y+21 ; 0x15 23442: 9e 89 ldd r25, Y+22 ; 0x16 23444: af 89 ldd r26, Y+23 ; 0x17 23446: b8 8d ldd r27, Y+24 ; 0x18 23448: 89 a3 std Y+33, r24 ; 0x21 2344a: 9a a3 std Y+34, r25 ; 0x22 2344c: ab a3 std Y+35, r26 ; 0x23 2344e: bc a3 std Y+36, r27 ; 0x24 23450: c5 01 movw r24, r10 23452: b4 01 movw r22, r8 23454: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 23458: 2b 01 movw r4, r22 2345a: 3c 01 movw r6, r24 2345c: 2d a1 ldd r18, Y+37 ; 0x25 2345e: 3e a1 ldd r19, Y+38 ; 0x26 23460: 4f a1 ldd r20, Y+39 ; 0x27 23462: 58 a5 ldd r21, Y+40 ; 0x28 23464: c7 01 movw r24, r14 23466: b6 01 movw r22, r12 23468: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 2346c: 9b 01 movw r18, r22 2346e: ac 01 movw r20, r24 23470: c3 01 movw r24, r6 23472: b2 01 movw r22, r4 23474: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 23478: 29 a1 ldd r18, Y+33 ; 0x21 2347a: 3a a1 ldd r19, Y+34 ; 0x22 2347c: 4b a1 ldd r20, Y+35 ; 0x23 2347e: 5c a1 ldd r21, Y+36 ; 0x24 23480: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> distanceMin[mesh_point] = (y - Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 23484: 20 e0 ldi r18, 0x00 ; 0 23486: 30 e0 ldi r19, 0x00 ; 0 23488: 40 e9 ldi r20, 0x90 ; 144 2348a: 50 e4 ldi r21, 0x40 ; 64 2348c: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 23490: 1b 01 movw r2, r22 23492: 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]; 23494: e2 e1 ldi r30, 0x12 ; 18 23496: f6 ea ldi r31, 0xA6 ; 166 23498: 25 91 lpm r18, Z+ 2349a: 35 91 lpm r19, Z+ 2349c: 45 91 lpm r20, Z+ 2349e: 54 91 lpm r21, Z 234a0: e6 e1 ldi r30, 0x16 ; 22 234a2: f6 ea ldi r31, 0xA6 ; 166 234a4: 45 90 lpm r4, Z+ 234a6: 55 90 lpm r5, Z+ 234a8: 65 90 lpm r6, Z+ 234aa: 74 90 lpm r7, Z 234ac: c5 01 movw r24, r10 234ae: b4 01 movw r22, r8 234b0: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 234b4: 4b 01 movw r8, r22 234b6: 5c 01 movw r10, r24 234b8: a3 01 movw r20, r6 234ba: 92 01 movw r18, r4 234bc: c7 01 movw r24, r14 234be: b6 01 movw r22, r12 234c0: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 234c4: 9b 01 movw r18, r22 234c6: ac 01 movw r20, r24 234c8: c5 01 movw r24, r10 234ca: b4 01 movw r22, r8 234cc: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 234d0: 29 a1 ldd r18, Y+33 ; 0x21 234d2: 3a a1 ldd r19, Y+34 ; 0x22 234d4: 4b a1 ldd r20, Y+35 ; 0x23 234d6: 5c a1 ldd r21, Y+36 ; 0x24 234d8: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> distanceMin[mesh_point] = (y - Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 234dc: 20 e0 ldi r18, 0x00 ; 0 234de: 30 e0 ldi r19, 0x00 ; 0 234e0: 40 e9 ldi r20, 0x90 ; 144 234e2: 50 e4 ldi r21, 0x40 ; 64 234e4: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 234e8: 6d 8f std Y+29, r22 ; 0x1d 234ea: 7e 8f std Y+30, r23 ; 0x1e 234ec: 8f 8f std Y+31, r24 ; 0x1f 234ee: 98 a3 std Y+32, r25 ; 0x20 float distanceMin[2]; count_xyz_details(distanceMin); lcd_home(); 234f0: 0e 94 24 6f call 0xde48 ; 0xde48 lcd_printf_P(_N( 234f4: 86 e4 ldi r24, 0x46 ; 70 234f6: 91 e5 ldi r25, 0x51 ; 81 234f8: 0e 94 c4 72 call 0xe588 ; 0xe588 234fc: d8 2e mov r13, r24 234fe: c9 2e mov r12, r25 23500: 8f e3 ldi r24, 0x3F ; 63 23502: 91 e5 ldi r25, 0x51 ; 81 23504: 0e 94 c4 72 call 0xe588 ; 0xe588 23508: f8 2e mov r15, r24 2350a: e9 2e mov r14, r25 2350c: 89 e2 ldi r24, 0x29 ; 41 2350e: 91 e5 ldi r25, 0x51 ; 81 23510: 0e 94 c4 72 call 0xe588 ; 0xe588 23514: cf 92 push r12 23516: df 92 push r13 23518: ef 92 push r14 2351a: ff 92 push r15 2351c: 28 eb ldi r18, 0xB8 ; 184 2351e: 3a e8 ldi r19, 0x8A ; 138 23520: 3f 93 push r19 23522: 2f 93 push r18 23524: 9f 93 push r25 23526: 8f 93 push r24 23528: 8b ee ldi r24, 0xEB ; 235 2352a: 9f e6 ldi r25, 0x6F ; 111 2352c: 9f 93 push r25 2352e: 8f 93 push r24 23530: 0e 94 d1 6e call 0xdda2 ; 0xdda2 _T(MSG_LEFT), _T(MSG_RIGHT) ); for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(11,2+i); 23534: 62 e0 ldi r22, 0x02 ; 2 23536: 8b e0 ldi r24, 0x0B ; 11 23538: 0e 94 f8 6e call 0xddf0 ; 0xddf0 if (distanceMin[i] >= 200) lcd_puts_P(_T(MSG_NA)); 2353c: 0f b6 in r0, 0x3f ; 63 2353e: f8 94 cli 23540: de bf out 0x3e, r29 ; 62 23542: 0f be out 0x3f, r0 ; 63 23544: cd bf out 0x3d, r28 ; 61 23546: 20 e0 ldi r18, 0x00 ; 0 23548: 30 e0 ldi r19, 0x00 ; 0 2354a: 48 e4 ldi r20, 0x48 ; 72 2354c: 53 e4 ldi r21, 0x43 ; 67 2354e: 62 2d mov r22, r2 23550: 73 2d mov r23, r3 23552: 80 2f mov r24, r16 23554: 91 2f mov r25, r17 23556: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 2355a: 87 ff sbrs r24, 7 2355c: 51 c0 rjmp .+162 ; 0x23600 else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); 2355e: 1f 93 push r17 23560: 0f 93 push r16 23562: 3f 92 push r3 23564: 2f 92 push r2 23566: 83 ee ldi r24, 0xE3 ; 227 23568: 9f e6 ldi r25, 0x6F ; 111 2356a: 9f 93 push r25 2356c: 8f 93 push r24 2356e: 0e 94 d1 6e call 0xdda2 ; 0xdda2 23572: 0f 90 pop r0 23574: 0f 90 pop r0 23576: 0f 90 pop r0 23578: 0f 90 pop r0 2357a: 0f 90 pop r0 2357c: 0f 90 pop r0 _T(MSG_LEFT), _T(MSG_RIGHT) ); for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(11,2+i); 2357e: 63 e0 ldi r22, 0x03 ; 3 23580: 8b e0 ldi r24, 0x0B ; 11 23582: 0e 94 f8 6e call 0xddf0 ; 0xddf0 if (distanceMin[i] >= 200) lcd_puts_P(_T(MSG_NA)); 23586: 1d 8d ldd r17, Y+29 ; 0x1d 23588: 0e 8d ldd r16, Y+30 ; 0x1e 2358a: ff 8c ldd r15, Y+31 ; 0x1f 2358c: e8 a0 ldd r14, Y+32 ; 0x20 2358e: 20 e0 ldi r18, 0x00 ; 0 23590: 30 e0 ldi r19, 0x00 ; 0 23592: 48 e4 ldi r20, 0x48 ; 72 23594: 53 e4 ldi r21, 0x43 ; 67 23596: d8 01 movw r26, r16 23598: f7 01 movw r30, r14 2359a: 6b 2f mov r22, r27 2359c: 7a 2f mov r23, r26 2359e: 8f 2f mov r24, r31 235a0: 9e 2f mov r25, r30 235a2: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 235a6: 87 fd sbrc r24, 7 235a8: 32 c0 rjmp .+100 ; 0x2360e 235aa: 86 ee ldi r24, 0xE6 ; 230 235ac: 97 e4 ldi r25, 0x47 ; 71 235ae: 0e 94 c4 72 call 0xe588 ; 0xe588 235b2: 0e 94 e3 6e call 0xddc6 ; 0xddc6 else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); } if (lcd_clicked()) 235b6: 0e 94 15 71 call 0xe22a ; 0xe22a 235ba: 88 23 and r24, r24 235bc: 41 f0 breq .+16 ; 0x235ce menu_goto(lcd_menu_xyz_skew, 0, true); 235be: 20 e0 ldi r18, 0x00 ; 0 235c0: 41 e0 ldi r20, 0x01 ; 1 235c2: 70 e0 ldi r23, 0x00 ; 0 235c4: 60 e0 ldi r22, 0x00 ; 0 235c6: 8c ef ldi r24, 0xFC ; 252 235c8: 9a e3 ldi r25, 0x3A ; 58 235ca: 0f 94 7b d1 call 0x3a2f6 ; 0x3a2f6 } 235ce: a8 96 adiw r28, 0x28 ; 40 235d0: 0f b6 in r0, 0x3f ; 63 235d2: f8 94 cli 235d4: de bf out 0x3e, r29 ; 62 235d6: 0f be out 0x3f, r0 ; 63 235d8: cd bf out 0x3d, r28 ; 61 235da: df 91 pop r29 235dc: cf 91 pop r28 235de: 1f 91 pop r17 235e0: 0f 91 pop r16 235e2: ff 90 pop r15 235e4: ef 90 pop r14 235e6: df 90 pop r13 235e8: cf 90 pop r12 235ea: bf 90 pop r11 235ec: af 90 pop r10 235ee: 9f 90 pop r9 235f0: 8f 90 pop r8 235f2: 7f 90 pop r7 235f4: 6f 90 pop r6 235f6: 5f 90 pop r5 235f8: 4f 90 pop r4 235fa: 3f 90 pop r3 235fc: 2f 90 pop r2 235fe: 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)); 23600: 86 ee ldi r24, 0xE6 ; 230 23602: 97 e4 ldi r25, 0x47 ; 71 23604: 0e 94 c4 72 call 0xe588 ; 0xe588 23608: 0e 94 e3 6e call 0xddc6 ; 0xddc6 2360c: b8 cf rjmp .-144 ; 0x2357e else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); 2360e: ef 92 push r14 23610: ff 92 push r15 23612: 0f 93 push r16 23614: 1f 93 push r17 23616: 83 ee ldi r24, 0xE3 ; 227 23618: 9f e6 ldi r25, 0x6F ; 111 2361a: 9f 93 push r25 2361c: 8f 93 push r24 2361e: 0e 94 d1 6e call 0xdda2 ; 0xdda2 23622: 0f 90 pop r0 23624: 0f 90 pop r0 23626: 0f 90 pop r0 23628: 0f 90 pop r0 2362a: 0f 90 pop r0 2362c: 0f 90 pop r0 2362e: c3 cf rjmp .-122 ; 0x235b6 00023630 <_lcd_move(char const*, unsigned char, int, int)>: } } static void _lcd_move(const char *name, uint8_t axis, int min, int max) { 23630: 2f 92 push r2 23632: 3f 92 push r3 23634: 4f 92 push r4 23636: 5f 92 push r5 23638: 6f 92 push r6 2363a: 7f 92 push r7 2363c: 9f 92 push r9 2363e: af 92 push r10 23640: bf 92 push r11 23642: cf 92 push r12 23644: df 92 push r13 23646: ef 92 push r14 23648: ff 92 push r15 2364a: 0f 93 push r16 2364c: 1f 93 push r17 2364e: cf 93 push r28 23650: df 93 push r29 if (homing_flag || mesh_bed_leveling_flag) 23652: 70 91 a6 0d lds r23, 0x0DA6 ; 0x800da6 23656: 71 11 cpse r23, r1 23658: 04 c0 rjmp .+8 ; 0x23662 <_lcd_move(char const*, unsigned char, int, int)+0x32> 2365a: 70 91 a7 0d lds r23, 0x0DA7 ; 0x800da7 2365e: 77 23 and r23, r23 23660: 99 f0 breq .+38 ; 0x23688 <_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(); } 23662: df 91 pop r29 23664: cf 91 pop r28 23666: 1f 91 pop r17 23668: 0f 91 pop r16 2366a: ff 90 pop r15 2366c: ef 90 pop r14 2366e: df 90 pop r13 23670: cf 90 pop r12 23672: bf 90 pop r11 23674: af 90 pop r10 23676: 9f 90 pop r9 23678: 7f 90 pop r7 2367a: 6f 90 pop r6 2367c: 5f 90 pop r5 2367e: 4f 90 pop r4 23680: 3f 90 pop r3 23682: 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(); 23684: 0d 94 19 d4 jmp 0x3a832 ; 0x3a832 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) 23688: 70 91 a7 03 lds r23, 0x03A7 ; 0x8003a7 2368c: 71 11 cpse r23, r1 2368e: 09 c0 rjmp .+18 ; 0x236a2 <_lcd_move(char const*, unsigned char, int, int)+0x72> return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 23690: 70 91 b7 02 lds r23, 0x02B7 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> check_endstops = check; 23694: 10 92 b7 02 sts 0x02B7, r1 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> { _md->endstopsEnabledPrevious = enable_endstops(false); 23698: 70 93 a8 03 sts 0x03A8, r23 ; 0x8003a8 _md->initialized = true; 2369c: 71 e0 ldi r23, 0x01 ; 1 2369e: 70 93 a7 03 sts 0x03A7, r23 ; 0x8003a7 236a2: 19 01 movw r2, r18 236a4: 6a 01 movw r12, r20 236a6: c6 2f mov r28, r22 236a8: d9 2f mov r29, r25 236aa: 98 2e mov r9, r24 } if (lcd_encoder != 0) 236ac: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 236b0: 90 91 70 06 lds r25, 0x0670 ; 0x800670 236b4: 89 2b or r24, r25 236b6: 09 f4 brne .+2 ; 0x236ba <_lcd_move(char const*, unsigned char, int, int)+0x8a> 236b8: 71 c0 rjmp .+226 ; 0x2379c <_lcd_move(char const*, unsigned char, int, int)+0x16c> { refresh_cmd_timeout(); 236ba: 0e 94 db 66 call 0xcdb6 ; 0xcdb6 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; 236be: 80 91 a4 0d lds r24, 0x0DA4 ; 0x800da4 if (++ next_block_index == BLOCK_BUFFER_SIZE) 236c2: 8f 5f subi r24, 0xFF ; 255 236c4: 80 31 cpi r24, 0x10 ; 16 236c6: 09 f4 brne .+2 ; 0x236ca <_lcd_move(char const*, unsigned char, int, int)+0x9a> next_block_index = 0; 236c8: 80 e0 ldi r24, 0x00 ; 0 return block_buffer_tail == next_block_index; 236ca: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 if (! planner_queue_full()) 236ce: 98 17 cp r25, r24 236d0: 09 f4 brne .+2 ; 0x236d4 <_lcd_move(char const*, unsigned char, int, int)+0xa4> 236d2: 64 c0 rjmp .+200 ; 0x2379c <_lcd_move(char const*, unsigned char, int, int)+0x16c> { current_position[axis] += lcd_encoder; 236d4: 84 e0 ldi r24, 0x04 ; 4 236d6: c8 9f mul r28, r24 236d8: 80 01 movw r16, r0 236da: 11 24 eor r1, r1 236dc: f8 01 movw r30, r16 236de: ef 56 subi r30, 0x6F ; 111 236e0: f9 4f sbci r31, 0xF9 ; 249 236e2: 5f 01 movw r10, r30 236e4: 60 91 6f 06 lds r22, 0x066F ; 0x80066f 236e8: 70 91 70 06 lds r23, 0x0670 ; 0x800670 236ec: 07 2e mov r0, r23 236ee: 00 0c add r0, r0 236f0: 88 0b sbc r24, r24 236f2: 99 0b sbc r25, r25 236f4: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 236f8: f5 01 movw r30, r10 236fa: 20 81 ld r18, Z 236fc: 31 81 ldd r19, Z+1 ; 0x01 236fe: 42 81 ldd r20, Z+2 ; 0x02 23700: 53 81 ldd r21, Z+3 ; 0x03 23702: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 23706: 2b 01 movw r4, r22 23708: 3c 01 movw r6, r24 if (min_software_endstops && current_position[axis] < min) current_position[axis] = min; 2370a: b6 01 movw r22, r12 2370c: dd 0c add r13, r13 2370e: 88 0b sbc r24, r24 23710: 99 0b sbc r25, r25 23712: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 23716: 6b 01 movw r12, r22 23718: 7c 01 movw r14, r24 2371a: ac 01 movw r20, r24 2371c: 9b 01 movw r18, r22 2371e: c3 01 movw r24, r6 23720: b2 01 movw r22, r4 23722: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 23726: f5 01 movw r30, r10 23728: 87 fd sbrc r24, 7 2372a: 7d c0 rjmp .+250 ; 0x23826 <_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; 2372c: 40 82 st Z, r4 2372e: 51 82 std Z+1, r5 ; 0x01 23730: 62 82 std Z+2, r6 ; 0x02 23732: 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; 23734: b1 01 movw r22, r2 23736: 33 0c add r3, r3 23738: 88 0b sbc r24, r24 2373a: 99 0b sbc r25, r25 2373c: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 23740: 2b 01 movw r4, r22 23742: 3c 01 movw r6, r24 23744: c8 01 movw r24, r16 23746: 8f 56 subi r24, 0x6F ; 111 23748: 99 4f sbci r25, 0xF9 ; 249 2374a: 7c 01 movw r14, r24 2374c: a3 01 movw r20, r6 2374e: 92 01 movw r18, r4 23750: fc 01 movw r30, r24 23752: 60 81 ld r22, Z 23754: 71 81 ldd r23, Z+1 ; 0x01 23756: 82 81 ldd r24, Z+2 ; 0x02 23758: 93 81 ldd r25, Z+3 ; 0x03 2375a: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 2375e: 18 16 cp r1, r24 23760: 2c f4 brge .+10 ; 0x2376c <_lcd_move(char const*, unsigned char, int, int)+0x13c> 23762: f7 01 movw r30, r14 23764: 40 82 st Z, r4 23766: 51 82 std Z+1, r5 ; 0x01 23768: 62 82 std Z+2, r6 ; 0x02 2376a: 73 82 std Z+3, r7 ; 0x03 lcd_encoder = 0; 2376c: 10 92 70 06 sts 0x0670, r1 ; 0x800670 23770: 10 92 6f 06 sts 0x066F, r1 ; 0x80066f world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 23774: 65 e9 ldi r22, 0x95 ; 149 23776: 76 e0 ldi r23, 0x06 ; 6 23778: 81 e9 ldi r24, 0x91 ; 145 2377a: 96 e0 ldi r25, 0x06 ; 6 2377c: 0e 94 c2 6a call 0xd584 ; 0xd584 plan_buffer_line_curposXYZE(get_feedrate_mm_s(manual_feedrate[axis])); 23780: f8 01 movw r30, r16 23782: e9 50 subi r30, 0x09 ; 9 23784: fd 4f sbci r31, 0xFD ; 253 23786: 60 81 ld r22, Z 23788: 71 81 ldd r23, Z+1 ; 0x01 2378a: 82 81 ldd r24, Z+2 ; 0x02 2378c: 93 81 ldd r25, Z+3 ; 0x03 2378e: 0e 94 df 66 call 0xcdbe ; 0xcdbe 23792: 0f 94 04 c0 call 0x38008 ; 0x38008 lcd_draw_update = 1; 23796: 81 e0 ldi r24, 0x01 ; 1 23798: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } } if (lcd_draw_update) 2379c: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 237a0: 88 23 and r24, r24 237a2: 11 f1 breq .+68 ; 0x237e8 <_lcd_move(char const*, unsigned char, int, int)+0x1b8> { lcd_set_cursor(0, 1); 237a4: 61 e0 ldi r22, 0x01 ; 1 237a6: 80 e0 ldi r24, 0x00 ; 0 237a8: 0e 94 f8 6e call 0xddf0 ; 0xddf0 menu_draw_float31(name, current_position[axis]); 237ac: 84 e0 ldi r24, 0x04 ; 4 237ae: c8 9f mul r28, r24 237b0: f0 01 movw r30, r0 237b2: 11 24 eor r1, r1 237b4: ef 56 subi r30, 0x6F ; 111 237b6: f9 4f sbci r31, 0xF9 ; 249 //! 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); 237b8: 83 81 ldd r24, Z+3 ; 0x03 237ba: 8f 93 push r24 237bc: 82 81 ldd r24, Z+2 ; 0x02 237be: 8f 93 push r24 237c0: 81 81 ldd r24, Z+1 ; 0x01 237c2: 8f 93 push r24 237c4: 80 81 ld r24, Z 237c6: 8f 93 push r24 237c8: df 93 push r29 237ca: 9f 92 push r9 237cc: 88 e4 ldi r24, 0x48 ; 72 237ce: 93 ea ldi r25, 0xA3 ; 163 237d0: 9f 93 push r25 237d2: 8f 93 push r24 237d4: 0e 94 d1 6e call 0xdda2 ; 0xdda2 237d8: ed b7 in r30, 0x3d ; 61 237da: fe b7 in r31, 0x3e ; 62 237dc: 38 96 adiw r30, 0x08 ; 8 237de: 0f b6 in r0, 0x3f ; 63 237e0: f8 94 cli 237e2: fe bf out 0x3e, r31 ; 62 237e4: 0f be out 0x3f, r0 ; 63 237e6: ed bf out 0x3d, r30 ; 61 } if (menu_leaving || LCD_CLICKED) (void)enable_endstops(_md->endstopsEnabledPrevious); 237e8: 80 91 d5 03 lds r24, 0x03D5 ; 0x8003d5 237ec: 81 11 cpse r24, r1 237ee: 04 c0 rjmp .+8 ; 0x237f8 <_lcd_move(char const*, unsigned char, int, int)+0x1c8> 237f0: 80 91 a6 03 lds r24, 0x03A6 ; 0x8003a6 237f4: 88 23 and r24, r24 237f6: 21 f0 breq .+8 ; 0x23800 <_lcd_move(char const*, unsigned char, int, int)+0x1d0> 237f8: 80 91 a8 03 lds r24, 0x03A8 ; 0x8003a8 237fc: 80 93 b7 02 sts 0x02B7, r24 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> menu_back_if_clicked(); } 23800: df 91 pop r29 23802: cf 91 pop r28 23804: 1f 91 pop r17 23806: 0f 91 pop r16 23808: ff 90 pop r15 2380a: ef 90 pop r14 2380c: df 90 pop r13 2380e: cf 90 pop r12 23810: bf 90 pop r11 23812: af 90 pop r10 23814: 9f 90 pop r9 23816: 7f 90 pop r7 23818: 6f 90 pop r6 2381a: 5f 90 pop r5 2381c: 4f 90 pop r4 2381e: 3f 90 pop r3 23820: 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(); 23822: 0d 94 bb d4 jmp 0x3a976 ; 0x3a976 { refresh_cmd_timeout(); if (! planner_queue_full()) { current_position[axis] += lcd_encoder; if (min_software_endstops && current_position[axis] < min) current_position[axis] = min; 23826: c0 82 st Z, r12 23828: d1 82 std Z+1, r13 ; 0x01 2382a: e2 82 std Z+2, r14 ; 0x02 2382c: f3 82 std Z+3, r15 ; 0x03 2382e: 82 cf rjmp .-252 ; 0x23734 <_lcd_move(char const*, unsigned char, int, int)+0x104> 00023830 : } static void lcd_move_y() { _lcd_move(PSTR("Y:"), Y_AXIS, Y_MIN_POS, Y_MAX_POS); } static void lcd_move_z() { _lcd_move(PSTR("Z:"), Z_AXIS, Z_MIN_POS, Z_MAX_POS); 23830: 22 ed ldi r18, 0xD2 ; 210 23832: 30 e0 ldi r19, 0x00 ; 0 23834: 50 e0 ldi r21, 0x00 ; 0 23836: 40 e0 ldi r20, 0x00 ; 0 23838: 62 e0 ldi r22, 0x02 ; 2 2383a: 82 e7 ldi r24, 0x72 ; 114 2383c: 93 ea ldi r25, 0xA3 ; 163 2383e: 0d 94 18 1b jmp 0x23630 ; 0x23630 <_lcd_move(char const*, unsigned char, int, int)> 00023842 : // the implementation of menu_draw_float31 static void lcd_move_x() { _lcd_move(PSTR("X:"), X_AXIS, X_MIN_POS, X_MAX_POS); } static void lcd_move_y() { _lcd_move(PSTR("Y:"), Y_AXIS, Y_MIN_POS, Y_MAX_POS); 23842: 24 ed ldi r18, 0xD4 ; 212 23844: 30 e0 ldi r19, 0x00 ; 0 23846: 4c ef ldi r20, 0xFC ; 252 23848: 5f ef ldi r21, 0xFF ; 255 2384a: 61 e0 ldi r22, 0x01 ; 1 2384c: 8f e6 ldi r24, 0x6F ; 111 2384e: 93 ea ldi r25, 0xA3 ; 163 23850: 0d 94 18 1b jmp 0x23630 ; 0x23630 <_lcd_move(char const*, unsigned char, int, int)> 00023854 : } // 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); 23854: 2f ef ldi r18, 0xFF ; 255 23856: 30 e0 ldi r19, 0x00 ; 0 23858: 50 e0 ldi r21, 0x00 ; 0 2385a: 40 e0 ldi r20, 0x00 ; 0 2385c: 60 e0 ldi r22, 0x00 ; 0 2385e: 8c e6 ldi r24, 0x6C ; 108 23860: 93 ea ldi r25, 0xA3 ; 163 23862: 0d 94 18 1b jmp 0x23630 ; 0x23630 <_lcd_move(char const*, unsigned char, int, int)> 00023866 : //! ---------------------- //! @endcode static void lcd_menu_fails_stats() { MENU_BEGIN(); 23866: 0f 94 51 d1 call 0x3a2a2 ; 0x3a2a2 2386a: 10 92 11 05 sts 0x0511, r1 ; 0x800511 2386e: 80 91 11 05 lds r24, 0x0511 ; 0x800511 23872: 84 30 cpi r24, 0x04 ; 4 23874: 28 f5 brcc .+74 ; 0x238c0 23876: 10 92 14 05 sts 0x0514, r1 ; 0x800514 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 2387a: 88 ea ldi r24, 0xA8 ; 168 2387c: 98 e4 ldi r25, 0x48 ; 72 2387e: 0e 94 c4 72 call 0xe588 ; 0xe588 23882: 0f 94 1c d4 call 0x3a838 ; 0x3a838 MENU_ITEM_SUBMENU_P(_T(MSG_LAST_PRINT), lcd_menu_fails_stats_print); 23886: 8a e0 ldi r24, 0x0A ; 10 23888: 9f e4 ldi r25, 0x4F ; 79 2388a: 0e 94 c4 72 call 0xe588 ; 0xe588 2388e: 68 e5 ldi r22, 0x58 ; 88 23890: 79 e3 ldi r23, 0x39 ; 57 23892: 0f 94 cf d3 call 0x3a79e ; 0x3a79e MENU_ITEM_SUBMENU_P(_T(MSG_TOTAL), lcd_menu_fails_stats_total); 23896: 82 e0 ldi r24, 0x02 ; 2 23898: 9f e4 ldi r25, 0x4F ; 79 2389a: 0e 94 c4 72 call 0xe588 ; 0xe588 2389e: 62 ee ldi r22, 0xE2 ; 226 238a0: 79 e3 ldi r23, 0x39 ; 57 238a2: 0f 94 cf d3 call 0x3a79e ; 0x3a79e MENU_END(); 238a6: 0f 94 25 d1 call 0x3a24a ; 0x3a24a //! ---------------------- //! @endcode static void lcd_menu_fails_stats() { MENU_BEGIN(); 238aa: 80 91 11 05 lds r24, 0x0511 ; 0x800511 238ae: 8f 5f subi r24, 0xFF ; 255 238b0: 80 93 11 05 sts 0x0511, r24 ; 0x800511 238b4: 80 91 13 05 lds r24, 0x0513 ; 0x800513 238b8: 8f 5f subi r24, 0xFF ; 255 238ba: 80 93 13 05 sts 0x0513, r24 ; 0x800513 238be: d7 cf rjmp .-82 ; 0x2386e MENU_ITEM_BACK_P(_T(MSG_MAIN)); MENU_ITEM_SUBMENU_P(_T(MSG_LAST_PRINT), lcd_menu_fails_stats_print); MENU_ITEM_SUBMENU_P(_T(MSG_TOTAL), lcd_menu_fails_stats_total); MENU_END(); } 238c0: 08 95 ret 000238c2 : //! | Material changes | MSG_MATERIAL_CHANGES c=18 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu() { MENU_BEGIN(); 238c2: 0f 94 51 d1 call 0x3a2a2 ; 0x3a2a2 238c6: 10 92 11 05 sts 0x0511, r1 ; 0x800511 238ca: 80 91 11 05 lds r24, 0x0511 ; 0x800511 238ce: 84 30 cpi r24, 0x04 ; 4 238d0: 68 f5 brcc .+90 ; 0x2392c 238d2: 10 92 14 05 sts 0x0514, r1 ; 0x800514 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 238d6: 88 ea ldi r24, 0xA8 ; 168 238d8: 98 e4 ldi r25, 0x48 ; 72 238da: 0e 94 c4 72 call 0xe588 ; 0xe588 238de: 0f 94 1c d4 call 0x3a838 ; 0x3a838 MENU_ITEM_SUBMENU_P(_T(MSG_LAST_PRINT), lcd_menu_fails_stats_mmu_print); 238e2: 8a e0 ldi r24, 0x0A ; 10 238e4: 9f e4 ldi r25, 0x4F ; 79 238e6: 0e 94 c4 72 call 0xe588 ; 0xe588 238ea: 62 ec ldi r22, 0xC2 ; 194 238ec: 79 e3 ldi r23, 0x39 ; 57 238ee: 0f 94 cf d3 call 0x3a79e ; 0x3a79e MENU_ITEM_SUBMENU_P(_T(MSG_TOTAL), lcd_menu_fails_stats_mmu_total); 238f2: 82 e0 ldi r24, 0x02 ; 2 238f4: 9f e4 ldi r25, 0x4F ; 79 238f6: 0e 94 c4 72 call 0xe588 ; 0xe588 238fa: 60 e3 ldi r22, 0x30 ; 48 238fc: 7b e3 ldi r23, 0x3B ; 59 238fe: 0f 94 cf d3 call 0x3a79e ; 0x3a79e MENU_ITEM_SUBMENU_P(_T(MSG_MATERIAL_CHANGES), lcd_menu_toolchange_stats_mmu_total); 23902: 80 ea ldi r24, 0xA0 ; 160 23904: 9e e4 ldi r25, 0x4E ; 78 23906: 0e 94 c4 72 call 0xe588 ; 0xe588 2390a: 66 e2 ldi r22, 0x26 ; 38 2390c: 7a e3 ldi r23, 0x3A ; 58 2390e: 0f 94 cf d3 call 0x3a79e ; 0x3a79e MENU_END(); 23912: 0f 94 25 d1 call 0x3a24a ; 0x3a24a //! | Material changes | MSG_MATERIAL_CHANGES c=18 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu() { MENU_BEGIN(); 23916: 80 91 11 05 lds r24, 0x0511 ; 0x800511 2391a: 8f 5f subi r24, 0xFF ; 255 2391c: 80 93 11 05 sts 0x0511, r24 ; 0x800511 23920: 80 91 13 05 lds r24, 0x0513 ; 0x800513 23924: 8f 5f subi r24, 0xFF ; 255 23926: 80 93 13 05 sts 0x0513, r24 ; 0x800513 2392a: cf cf rjmp .-98 ; 0x238ca 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(); } 2392c: 08 95 ret 0002392e : setFilamentAction(FilamentAction::None); } /// Reset the menu stack and clear the planned filament action flag static void __attribute__((noinline)) mFilamentResetMenuStack() { menu_back(bFilamentPreheatState ? 1 : 2); 2392e: 80 91 62 06 lds r24, 0x0662 ; 0x800662 23932: 81 11 cpse r24, r1 23934: 03 c0 rjmp .+6 ; 0x2393c 23936: 82 e0 ldi r24, 0x02 ; 2 23938: 0d 94 fd d3 jmp 0x3a7fa ; 0x3a7fa 2393c: 81 e0 ldi r24, 0x01 ; 1 2393e: fc cf rjmp .-8 ; 0x23938 00023940 : //! | Debug | c=18 //! @endcode //! ---------------------- //! @endcode static void lcd_support_menu() { 23940: ef 92 push r14 23942: ff 92 push r15 23944: 0f 93 push r16 23946: 1f 93 push r17 23948: cf 93 push r28 2394a: 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) 2394c: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 23950: 88 23 and r24, r24 23952: 29 f0 breq .+10 ; 0x2395e 23954: 90 91 6d 02 lds r25, 0x026D ; 0x80026d 23958: 92 30 cpi r25, 0x02 ; 2 2395a: 09 f0 breq .+2 ; 0x2395e 2395c: 80 c1 rjmp .+768 ; 0x23c5e { // Menu was entered or SD card status has changed (plugged in or removed). // Initialize its status. _md->status = 1; 2395e: 81 e0 ldi r24, 0x01 ; 1 23960: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 23964: 80 91 00 17 lds r24, 0x1700 ; 0x801700 _md->is_flash_air = card.ToshibaFlashAir_isEnabled(); 23968: 80 93 a8 03 sts 0x03A8, r24 ; 0x8003a8 if (_md->is_flash_air) { 2396c: 88 23 and r24, r24 2396e: 21 f0 breq .+8 ; 0x23978 card.ToshibaFlashAir_GetIP((uint8_t*)(&_md->ip)); // ip == 0 if it failed 23970: 89 ea ldi r24, 0xA9 ; 169 23972: 93 e0 ldi r25, 0x03 ; 3 23974: 0f 94 89 85 call 0x30b12 ; 0x30b12 { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; } MENU_BEGIN(); 23978: 0f 94 51 d1 call 0x3a2a2 ; 0x3a2a2 2397c: 10 92 11 05 sts 0x0511, r1 ; 0x800511 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); 23980: 88 ec ldi r24, 0xC8 ; 200 23982: e8 2e mov r14, r24 23984: 81 ea ldi r24, 0xA1 ; 161 23986: 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]); 23988: c7 e9 ldi r28, 0x97 ; 151 2398a: d1 ea ldi r29, 0xA1 ; 161 2398c: 0d ea ldi r16, 0xAD ; 173 2398e: 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(); 23990: 80 91 11 05 lds r24, 0x0511 ; 0x800511 23994: 84 30 cpi r24, 0x04 ; 4 23996: 08 f0 brcs .+2 ; 0x2399a 23998: 89 c1 rjmp .+786 ; 0x23cac 2399a: 10 92 14 05 sts 0x0514, r1 ; 0x800514 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 2399e: 88 ea ldi r24, 0xA8 ; 168 239a0: 98 e4 ldi r25, 0x48 ; 72 239a2: 0e 94 c4 72 call 0xe588 ; 0xe588 239a6: 0f 94 1c d4 call 0x3a838 ; 0x3a838 MENU_ITEM_BACK_P(PSTR("Firmware:")); 239aa: 8b e2 ldi r24, 0x2B ; 43 239ac: 92 ea ldi r25, 0xA2 ; 162 239ae: 0f 94 1c d4 call 0x3a838 ; 0x3a838 MENU_ITEM_BACK_P(PSTR(" " FW_VERSION_FULL)); 239b2: 8e e1 ldi r24, 0x1E ; 30 239b4: 92 ea ldi r25, 0xA2 ; 162 239b6: 0f 94 1c d4 call 0x3a838 ; 0x3a838 MENU_ITEM_BACK_P(PSTR(" Repo:" FW_REPOSITORY)); 239ba: 80 e1 ldi r24, 0x10 ; 16 239bc: 92 ea ldi r25, 0xA2 ; 162 239be: 0f 94 1c d4 call 0x3a838 ; 0x3a838 MENU_ITEM_BACK_P(PSTR(" Hash:" FW_COMMIT_HASH)); 239c2: 80 e0 ldi r24, 0x00 ; 0 239c4: 92 ea ldi r25, 0xA2 ; 162 239c6: 0f 94 1c d4 call 0x3a838 ; 0x3a838 MENU_ITEM_BACK_P(_n("prusa3d.com"));////MSG_PRUSA3D c=18 239ca: 8a e8 ldi r24, 0x8A ; 138 239cc: 9f e6 ldi r25, 0x6F ; 111 239ce: 0f 94 1c d4 call 0x3a838 ; 0x3a838 MENU_ITEM_BACK_P(_n("forum.prusa3d.com"));////MSG_PRUSA3D_FORUM c=18 239d2: 88 e7 ldi r24, 0x78 ; 120 239d4: 9f e6 ldi r25, 0x6F ; 111 239d6: 0f 94 1c d4 call 0x3a838 ; 0x3a838 MENU_ITEM_BACK_P(_n("help.prusa3d.com"));////MSG_PRUSA3D_HELP c=18 239da: 87 e6 ldi r24, 0x67 ; 103 239dc: 9f e6 ldi r25, 0x6F ; 111 239de: 0f 94 1c d4 call 0x3a838 ; 0x3a838 MENU_ITEM_BACK_P(STR_SEPARATOR); 239e2: 88 eb ldi r24, 0xB8 ; 184 239e4: 9a e8 ldi r25, 0x8A ; 138 239e6: 0f 94 1c d4 call 0x3a838 ; 0x3a838 MENU_ITEM_BACK_P(PSTR(FILAMENT_SIZE)); 239ea: 85 ef ldi r24, 0xF5 ; 245 239ec: 91 ea ldi r25, 0xA1 ; 161 239ee: 0f 94 1c d4 call 0x3a838 ; 0x3a838 MENU_ITEM_BACK_P(PSTR(ELECTRONICS)); 239f2: 8b ee ldi r24, 0xEB ; 235 239f4: 91 ea ldi r25, 0xA1 ; 161 239f6: 0f 94 1c d4 call 0x3a838 ; 0x3a838 MENU_ITEM_BACK_P(PSTR(NOZZLE_TYPE)); 239fa: 81 ee ldi r24, 0xE1 ; 225 239fc: 91 ea ldi r25, 0xA1 ; 161 239fe: 0f 94 1c d4 call 0x3a838 ; 0x3a838 MENU_ITEM_BACK_P(STR_SEPARATOR); 23a02: 88 eb ldi r24, 0xB8 ; 184 23a04: 9a e8 ldi r25, 0x8A ; 138 23a06: 0f 94 1c d4 call 0x3a838 ; 0x3a838 MENU_ITEM_BACK_P(_T(MSG_DATE)); 23a0a: 87 ea ldi r24, 0xA7 ; 167 23a0c: 9f e4 ldi r25, 0x4F ; 79 23a0e: 0e 94 c4 72 call 0xe588 ; 0xe588 23a12: 0f 94 1c d4 call 0x3a838 ; 0x3a838 MENU_ITEM_BACK_P(PSTR(SOURCE_DATE_EPOCH)); 23a16: 86 ed ldi r24, 0xD6 ; 214 23a18: 91 ea ldi r25, 0xA1 ; 161 23a1a: 0f 94 1c d4 call 0x3a838 ; 0x3a838 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); 23a1e: 88 eb ldi r24, 0xB8 ; 184 23a20: 9a e8 ldi r25, 0x8A ; 138 23a22: 0f 94 1c d4 call 0x3a838 ; 0x3a838 if (MMU2::mmu2.Enabled()) 23a26: 80 91 b9 13 lds r24, 0x13B9 ; 0x8013b9 23a2a: 81 30 cpi r24, 0x01 ; 1 23a2c: 09 f0 breq .+2 ; 0x23a30 23a2e: 39 c1 rjmp .+626 ; 0x23ca2 { MENU_ITEM_BACK_P(_T(MSG_MMU_CONNECTED)); 23a30: 87 e9 ldi r24, 0x97 ; 151 23a32: 9f e4 ldi r25, 0x4F ; 79 23a34: 0e 94 c4 72 call 0xe588 ; 0xe588 23a38: 0f 94 1c d4 call 0x3a838 ; 0x3a838 MENU_ITEM_BACK_P(PSTR(" FW:")); ////c=17 23a3c: 81 ed ldi r24, 0xD1 ; 209 23a3e: 91 ea ldi r25, 0xA1 ; 161 23a40: 0f 94 1c d4 call 0x3a838 ; 0x3a838 if (((menu_item - 1) == menu_line) && lcd_draw_update) 23a44: 80 91 14 05 lds r24, 0x0514 ; 0x800514 23a48: 81 50 subi r24, 0x01 ; 1 23a4a: 99 0b sbc r25, r25 23a4c: 20 91 13 05 lds r18, 0x0513 ; 0x800513 23a50: 28 17 cp r18, r24 23a52: 19 06 cpc r1, r25 23a54: 49 f5 brne .+82 ; 0x23aa8 23a56: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 23a5a: 88 23 and r24, r24 23a5c: 29 f1 breq .+74 ; 0x23aa8 { lcd_set_cursor(6, menu_row); 23a5e: 60 91 11 05 lds r22, 0x0511 ; 0x800511 23a62: 86 e0 ldi r24, 0x06 ; 6 23a64: 0e 94 f8 6e call 0xddf0 ; 0xddf0 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) { 23a68: 80 91 b9 13 lds r24, 0x13B9 ; 0x8013b9 23a6c: 81 30 cpi r24, 0x01 ; 1 23a6e: 09 f0 breq .+2 ; 0x23a72 23a70: 11 c1 rjmp .+546 ; 0x23c94 23a72: 80 91 99 13 lds r24, 0x1399 ; 0x801399 23a76: 90 91 9a 13 lds r25, 0x139A ; 0x80139a 23a7a: 20 91 9b 13 lds r18, 0x139B ; 0x80139b MMU2::Version mmu_version = MMU2::mmu2.GetMMUFWVersion(); if (mmu_version.major > 0) 23a7e: 88 23 and r24, r24 23a80: 09 f4 brne .+2 ; 0x23a84 23a82: 08 c1 rjmp .+528 ; 0x23c94 lcd_printf_P(PSTR("%d.%d.%d"), mmu_version.major, mmu_version.minor, mmu_version.build); 23a84: 1f 92 push r1 23a86: 2f 93 push r18 23a88: 1f 92 push r1 23a8a: 9f 93 push r25 23a8c: 1f 92 push r1 23a8e: 8f 93 push r24 23a90: ff 92 push r15 23a92: ef 92 push r14 23a94: 0e 94 d1 6e call 0xdda2 ; 0xdda2 23a98: 8d b7 in r24, 0x3d ; 61 23a9a: 9e b7 in r25, 0x3e ; 62 23a9c: 08 96 adiw r24, 0x08 ; 8 23a9e: 0f b6 in r0, 0x3f ; 63 23aa0: f8 94 cli 23aa2: 9e bf out 0x3e, r25 ; 62 23aa4: 0f be out 0x3f, r0 ; 63 23aa6: 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) { 23aa8: 80 91 a8 03 lds r24, 0x03A8 ; 0x8003a8 23aac: 88 23 and r24, r24 23aae: 09 f4 brne .+2 ; 0x23ab2 23ab0: 40 c0 rjmp .+128 ; 0x23b32 MENU_ITEM_BACK_P(STR_SEPARATOR); 23ab2: 88 eb ldi r24, 0xB8 ; 184 23ab4: 9a e8 ldi r25, 0x8A ; 138 23ab6: 0f 94 1c d4 call 0x3a838 ; 0x3a838 MENU_ITEM_BACK_P(PSTR("FlashAir IP Addr:")); ////MSG_FLASHAIR c=18 23aba: 87 ea ldi r24, 0xA7 ; 167 23abc: 91 ea ldi r25, 0xA1 ; 161 23abe: 0f 94 1c d4 call 0x3a838 ; 0x3a838 MENU_ITEM_BACK_P(PSTR(" ")); 23ac2: 85 ea ldi r24, 0xA5 ; 165 23ac4: 91 ea ldi r25, 0xA1 ; 161 23ac6: 0f 94 1c d4 call 0x3a838 ; 0x3a838 if (((menu_item - 1) == menu_line) && lcd_draw_update) { 23aca: 80 91 14 05 lds r24, 0x0514 ; 0x800514 23ace: 81 50 subi r24, 0x01 ; 1 23ad0: 99 0b sbc r25, r25 23ad2: 20 91 13 05 lds r18, 0x0513 ; 0x800513 23ad6: 28 17 cp r18, r24 23ad8: 19 06 cpc r1, r25 23ada: 59 f5 brne .+86 ; 0x23b32 23adc: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 23ae0: 88 23 and r24, r24 23ae2: 39 f1 breq .+78 ; 0x23b32 lcd_set_cursor(2, menu_row); 23ae4: 60 91 11 05 lds r22, 0x0511 ; 0x800511 23ae8: 82 e0 ldi r24, 0x02 ; 2 23aea: 0e 94 f8 6e call 0xddf0 ; 0xddf0 23aee: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 23af2: 1f 92 push r1 23af4: 8f 93 push r24 23af6: 80 91 ab 03 lds r24, 0x03AB ; 0x8003ab 23afa: 1f 92 push r1 23afc: 8f 93 push r24 23afe: 80 91 aa 03 lds r24, 0x03AA ; 0x8003aa 23b02: 1f 92 push r1 23b04: 8f 93 push r24 23b06: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 23b0a: 1f 92 push r1 23b0c: 8f 93 push r24 23b0e: df 93 push r29 23b10: cf 93 push r28 23b12: 1f 93 push r17 23b14: 0f 93 push r16 23b16: 0f 94 ee da call 0x3b5dc ; 0x3b5dc ip4_to_str(_md->ip_str, (uint8_t*)(&_md->ip)); lcd_print(_md->ip_str); 23b1a: 8d ea ldi r24, 0xAD ; 173 23b1c: 93 e0 ldi r25, 0x03 ; 3 23b1e: 0e 94 ff 70 call 0xe1fe ; 0xe1fe 23b22: 8d b7 in r24, 0x3d ; 61 23b24: 9e b7 in r25, 0x3e ; 62 23b26: 0c 96 adiw r24, 0x0c ; 12 23b28: 0f b6 in r0, 0x3f ; 63 23b2a: f8 94 cli 23b2c: 9e bf out 0x3e, r25 ; 62 23b2e: 0f be out 0x3f, r0 ; 63 23b30: 8d bf out 0x3d, r24 ; 61 } } // Show the printer IP address, if it is available. if (IP_address) { 23b32: 80 91 5d 06 lds r24, 0x065D ; 0x80065d 23b36: 90 91 5e 06 lds r25, 0x065E ; 0x80065e 23b3a: a0 91 5f 06 lds r26, 0x065F ; 0x80065f 23b3e: b0 91 60 06 lds r27, 0x0660 ; 0x800660 23b42: 89 2b or r24, r25 23b44: 8a 2b or r24, r26 23b46: 8b 2b or r24, r27 23b48: 09 f4 brne .+2 ; 0x23b4c 23b4a: 42 c0 rjmp .+132 ; 0x23bd0 MENU_ITEM_BACK_P(STR_SEPARATOR); 23b4c: 88 eb ldi r24, 0xB8 ; 184 23b4e: 9a e8 ldi r25, 0x8A ; 138 23b50: 0f 94 1c d4 call 0x3a838 ; 0x3a838 MENU_ITEM_BACK_P(_T(MSG_PRINTER_IP)); 23b54: 8a e7 ldi r24, 0x7A ; 122 23b56: 9f e4 ldi r25, 0x4F ; 79 23b58: 0e 94 c4 72 call 0xe588 ; 0xe588 23b5c: 0f 94 1c d4 call 0x3a838 ; 0x3a838 MENU_ITEM_BACK_P(PSTR(" ")); 23b60: 83 ea ldi r24, 0xA3 ; 163 23b62: 91 ea ldi r25, 0xA1 ; 161 23b64: 0f 94 1c d4 call 0x3a838 ; 0x3a838 if (((menu_item - 1) == menu_line) && lcd_draw_update) { 23b68: 80 91 14 05 lds r24, 0x0514 ; 0x800514 23b6c: 81 50 subi r24, 0x01 ; 1 23b6e: 99 0b sbc r25, r25 23b70: 20 91 13 05 lds r18, 0x0513 ; 0x800513 23b74: 28 17 cp r18, r24 23b76: 19 06 cpc r1, r25 23b78: 59 f5 brne .+86 ; 0x23bd0 23b7a: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 23b7e: 88 23 and r24, r24 23b80: 39 f1 breq .+78 ; 0x23bd0 lcd_set_cursor(2, menu_row); 23b82: 60 91 11 05 lds r22, 0x0511 ; 0x800511 23b86: 82 e0 ldi r24, 0x02 ; 2 23b88: 0e 94 f8 6e call 0xddf0 ; 0xddf0 23b8c: 80 91 60 06 lds r24, 0x0660 ; 0x800660 23b90: 1f 92 push r1 23b92: 8f 93 push r24 23b94: 80 91 5f 06 lds r24, 0x065F ; 0x80065f 23b98: 1f 92 push r1 23b9a: 8f 93 push r24 23b9c: 80 91 5e 06 lds r24, 0x065E ; 0x80065e 23ba0: 1f 92 push r1 23ba2: 8f 93 push r24 23ba4: 80 91 5d 06 lds r24, 0x065D ; 0x80065d 23ba8: 1f 92 push r1 23baa: 8f 93 push r24 23bac: df 93 push r29 23bae: cf 93 push r28 23bb0: 1f 93 push r17 23bb2: 0f 93 push r16 23bb4: 0f 94 ee da call 0x3b5dc ; 0x3b5dc ip4_to_str(_md->ip_str, (uint8_t*)(&IP_address)); lcd_print(_md->ip_str); 23bb8: 8d ea ldi r24, 0xAD ; 173 23bba: 93 e0 ldi r25, 0x03 ; 3 23bbc: 0e 94 ff 70 call 0xe1fe ; 0xe1fe 23bc0: 8d b7 in r24, 0x3d ; 61 23bc2: 9e b7 in r25, 0x3e ; 62 23bc4: 0c 96 adiw r24, 0x0c ; 12 23bc6: 0f b6 in r0, 0x3f ; 63 23bc8: f8 94 cli 23bca: 9e bf out 0x3e, r25 ; 62 23bcc: 0f be out 0x3f, r0 ; 63 23bce: 8d bf out 0x3d, r24 ; 61 } } MENU_ITEM_BACK_P(STR_SEPARATOR); 23bd0: 88 eb ldi r24, 0xB8 ; 184 23bd2: 9a e8 ldi r25, 0x8A ; 138 23bd4: 0f 94 1c d4 call 0x3a838 ; 0x3a838 MENU_ITEM_SUBMENU_P(_T(MSG_XYZ_DETAILS), lcd_menu_xyz_y_min); 23bd8: 87 e6 ldi r24, 0x67 ; 103 23bda: 9f e4 ldi r25, 0x4F ; 79 23bdc: 0e 94 c4 72 call 0xe588 ; 0xe588 23be0: 6c e9 ldi r22, 0x9C ; 156 23be2: 79 e3 ldi r23, 0x39 ; 57 23be4: 0f 94 cf d3 call 0x3a79e ; 0x3a79e MENU_ITEM_SUBMENU_P(_T(MSG_INFO_EXTRUDER), lcd_menu_extruder_info); 23be8: 87 e5 ldi r24, 0x57 ; 87 23bea: 9f e4 ldi r25, 0x4F ; 79 23bec: 0e 94 c4 72 call 0xe588 ; 0xe588 23bf0: 68 ef ldi r22, 0xF8 ; 248 23bf2: 79 e3 ldi r23, 0x39 ; 57 23bf4: 0f 94 cf d3 call 0x3a79e ; 0x3a79e MENU_ITEM_SUBMENU_P(_T(MSG_INFO_SENSORS), lcd_menu_show_sensors_state); 23bf8: 89 e4 ldi r24, 0x49 ; 73 23bfa: 9f e4 ldi r25, 0x4F ; 79 23bfc: 0e 94 c4 72 call 0xe588 ; 0xe588 23c00: 60 e0 ldi r22, 0x00 ; 0 23c02: 73 ee ldi r23, 0xE3 ; 227 23c04: 0f 94 cf d3 call 0x3a79e ; 0x3a79e #ifdef TMC2130 MENU_ITEM_SUBMENU_P(_T(MSG_BELT_STATUS), lcd_menu_belt_status); 23c08: 8b e3 ldi r24, 0x3B ; 59 23c0a: 9f e4 ldi r25, 0x4F ; 79 23c0c: 0e 94 c4 72 call 0xe588 ; 0xe588 23c10: 66 ea ldi r22, 0xA6 ; 166 23c12: 7a e3 ldi r23, 0x3A ; 58 23c14: 0f 94 cf d3 call 0x3a79e ; 0x3a79e #endif //TMC2130 MENU_ITEM_SUBMENU_P(_T(MSG_MENU_TEMPERATURES), lcd_menu_temperatures); 23c18: 8c e2 ldi r24, 0x2C ; 44 23c1a: 9f e4 ldi r25, 0x4F ; 79 23c1c: 0e 94 c4 72 call 0xe588 ; 0xe588 23c20: 64 e5 ldi r22, 0x54 ; 84 23c22: 7a e3 ldi r23, 0x3A ; 58 23c24: 0f 94 cf d3 call 0x3a79e ; 0x3a79e #if defined (VOLT_BED_PIN) || defined (VOLT_PWR_PIN) MENU_ITEM_SUBMENU_P(_T(MSG_MENU_VOLTAGES), lcd_menu_voltages); 23c28: 81 e2 ldi r24, 0x21 ; 33 23c2a: 9f e4 ldi r25, 0x4F ; 79 23c2c: 0e 94 c4 72 call 0xe588 ; 0xe588 23c30: 60 e7 ldi r22, 0x70 ; 112 23c32: 79 e3 ldi r23, 0x39 ; 57 23c34: 0f 94 cf d3 call 0x3a79e ; 0x3a79e #endif //defined VOLT_BED_PIN || defined VOLT_PWR_PIN #ifdef MENU_DUMP MENU_ITEM_FUNCTION_P(_n("Dump memory"), lcd_dump_memory); 23c38: 64 eb ldi r22, 0xB4 ; 180 23c3a: 7a e3 ldi r23, 0x3A ; 58 23c3c: 8b e5 ldi r24, 0x5B ; 91 23c3e: 9f e6 ldi r25, 0x6F ; 111 23c40: 0f 94 ce d0 call 0x3a19c ; 0x3a19c 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(); 23c44: 0f 94 25 d1 call 0x3a24a ; 0x3a24a { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; } MENU_BEGIN(); 23c48: 80 91 11 05 lds r24, 0x0511 ; 0x800511 23c4c: 8f 5f subi r24, 0xFF ; 255 23c4e: 80 93 11 05 sts 0x0511, r24 ; 0x800511 23c52: 80 91 13 05 lds r24, 0x0513 ; 0x800513 23c56: 8f 5f subi r24, 0xFF ; 255 23c58: 80 93 13 05 sts 0x0513, r24 ; 0x800513 23c5c: 99 ce rjmp .-718 ; 0x23990 _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) 23c5e: 90 91 a8 03 lds r25, 0x03A8 ; 0x8003a8 23c62: 99 23 and r25, r25 23c64: 09 f4 brne .+2 ; 0x23c68 23c66: 88 ce rjmp .-752 ; 0x23978 23c68: 40 91 a9 03 lds r20, 0x03A9 ; 0x8003a9 23c6c: 50 91 aa 03 lds r21, 0x03AA ; 0x8003aa 23c70: 60 91 ab 03 lds r22, 0x03AB ; 0x8003ab 23c74: 70 91 ac 03 lds r23, 0x03AC ; 0x8003ac 23c78: 45 2b or r20, r21 23c7a: 46 2b or r20, r22 23c7c: 47 2b or r20, r23 23c7e: 09 f0 breq .+2 ; 0x23c82 23c80: 7b ce rjmp .-778 ; 0x23978 23c82: 8f 5f subi r24, 0xFF ; 255 23c84: 80 31 cpi r24, 0x10 ; 16 23c86: 19 f0 breq .+6 ; 0x23c8e 23c88: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 23c8c: 75 ce rjmp .-790 ; 0x23978 { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; 23c8e: 10 92 a7 03 sts 0x03A7, r1 ; 0x8003a7 23c92: 72 ce rjmp .-796 ; 0x23978 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)); 23c94: 8d e8 ldi r24, 0x8D ; 141 23c96: 9f e4 ldi r25, 0x4F ; 79 23c98: 0e 94 c4 72 call 0xe588 ; 0xe588 23c9c: 0e 94 e3 6e call 0xddc6 ; 0xddc6 23ca0: 03 cf rjmp .-506 ; 0x23aa8 } } else MENU_ITEM_BACK_P(PSTR("MMU N/A")); 23ca2: 89 eb ldi r24, 0xB9 ; 185 23ca4: 91 ea ldi r25, 0xA1 ; 161 23ca6: 0f 94 1c d4 call 0x3a838 ; 0x3a838 23caa: fe ce rjmp .-516 ; 0x23aa8 #endif //EMERGENCY_HANDLERS MENU_ITEM_SUBMENU_P(PSTR("Debug"), lcd_menu_debug);////MSG_DEBUG c=18 #endif /* DEBUG_BUILD */ MENU_END(); } 23cac: df 91 pop r29 23cae: cf 91 pop r28 23cb0: 1f 91 pop r17 23cb2: 0f 91 pop r16 23cb4: ff 90 pop r15 23cb6: ef 90 pop r14 23cb8: 08 95 ret 00023cba : { 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) { 23cba: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 23cbe: 81 11 cpse r24, r1 23cc0: 19 c0 rjmp .+50 ; 0x23cf4 lcd_clear(); 23cc2: 0e 94 2b 6f call 0xde56 ; 0xde56 lcd_puts_P(_T(MSG_MATERIAL_CHANGES)); /// MSG_MATERIAL_CHANGES c=18 23cc6: 80 ea ldi r24, 0xA0 ; 160 23cc8: 9e e4 ldi r25, 0x4E ; 78 23cca: 0e 94 c4 72 call 0xe588 ; 0xe588 23cce: 0e 94 e3 6e call 0xddc6 ; 0xddc6 lcd_putc(':'); 23cd2: 8a e3 ldi r24, 0x3A ; 58 23cd4: 0e 94 e7 6e call 0xddce ; 0xddce lcd_set_cursor(10, 1); 23cd8: 61 e0 ldi r22, 0x01 ; 1 23cda: 8a e0 ldi r24, 0x0A ; 10 23cdc: 0e 94 f8 6e call 0xddf0 ; 0xddf0 lcd_print(eeprom_read_dword((uint32_t*)EEPROM_MMU_MATERIAL_CHANGES)); 23ce0: 88 ea ldi r24, 0xA8 ; 168 23ce2: 9c e0 ldi r25, 0x0C ; 12 23ce4: 0f 94 df db call 0x3b7be ; 0x3b7be void lcd_print(unsigned long n, int base) { if (base == 0) lcd_write(n); else lcd_printNumber(n, base); 23ce8: 4a e0 ldi r20, 0x0A ; 10 23cea: 0e 94 4c 70 call 0xe098 ; 0xe098 _md->initialized = true; 23cee: 81 e0 ldi r24, 0x01 ; 1 23cf0: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 } menu_back_if_clicked(); 23cf4: 0d 94 bb d4 jmp 0x3a976 ; 0x3a976 00023cf8 : #endif //DEBUG_DISABLE_LCD_STATUS_LINE } static void lcdui_refresh(uint8_t clear = true) { clear ? lcd_refresh() : lcd_refresh_noclear(); 23cf8: 0e 94 a4 6f call 0xdf48 ; 0xdf48 lcd_status_message_idx = 0; // Re-draw message from beginning 23cfc: 10 92 1d 05 sts 0x051D, r1 ; 0x80051d <_ZL22lcd_status_message_idx.lto_priv.448> } void lcd_return_to_status() { lcdui_refresh(); // to maybe revive the LCD if static electricity killed it. menu_goto(lcd_status_screen, 0, true); 23d00: 20 e0 ldi r18, 0x00 ; 0 23d02: 41 e0 ldi r20, 0x01 ; 1 23d04: 70 e0 ldi r23, 0x00 ; 0 23d06: 60 e0 ldi r22, 0x00 ; 0 23d08: 86 e4 ldi r24, 0x46 ; 70 23d0a: 9a e3 ldi r25, 0x3A ; 58 23d0c: 0f 94 7b d1 call 0x3a2f6 ; 0x3a2f6 menu_depth = 0; 23d10: 10 92 f7 03 sts 0x03F7, r1 ; 0x8003f7 eFilamentAction = FilamentAction::None; // i.e. non-autoLoad 23d14: 10 92 a5 03 sts 0x03A5, r1 ; 0x8003a5 } 23d18: 08 95 ret 00023d1a : //! | | //! ---------------------- //! @endcode void pid_extruder() { lcd_clear(); 23d1a: 0e 94 2b 6f call 0xde56 ; 0xde56 lcd_puts_at_P(0, 0, _T(MSG_SET_TEMPERATURE)); 23d1e: 81 ee ldi r24, 0xE1 ; 225 23d20: 91 e5 ldi r25, 0x51 ; 81 23d22: 0e 94 c4 72 call 0xe588 ; 0xe588 23d26: ac 01 movw r20, r24 23d28: 60 e0 ldi r22, 0x00 ; 0 23d2a: 80 e0 ldi r24, 0x00 ; 0 23d2c: 0e 94 0c 6f call 0xde18 ; 0xde18 pid_temp += lcd_encoder; 23d30: 80 91 4b 02 lds r24, 0x024B ; 0x80024b <_ZL8pid_temp.lto_priv.441> 23d34: 90 91 4c 02 lds r25, 0x024C ; 0x80024c <_ZL8pid_temp.lto_priv.441+0x1> 23d38: 20 91 6f 06 lds r18, 0x066F ; 0x80066f 23d3c: 30 91 70 06 lds r19, 0x0670 ; 0x800670 23d40: 82 0f add r24, r18 23d42: 93 1f adc r25, r19 if (pid_temp > HEATER_0_MAXTEMP) pid_temp = HEATER_0_MAXTEMP; 23d44: 82 33 cpi r24, 0x32 ; 50 23d46: 21 e0 ldi r18, 0x01 ; 1 23d48: 92 07 cpc r25, r18 23d4a: 50 f1 brcs .+84 ; 0x23da0 23d4c: 81 e3 ldi r24, 0x31 ; 49 23d4e: 91 e0 ldi r25, 0x01 ; 1 else if (pid_temp < HEATER_0_MINTEMP) pid_temp = HEATER_0_MINTEMP; 23d50: 90 93 4c 02 sts 0x024C, r25 ; 0x80024c <_ZL8pid_temp.lto_priv.441+0x1> 23d54: 80 93 4b 02 sts 0x024B, r24 ; 0x80024b <_ZL8pid_temp.lto_priv.441> lcd_encoder = 0; 23d58: 10 92 70 06 sts 0x0670, r1 ; 0x800670 23d5c: 10 92 6f 06 sts 0x066F, r1 ; 0x80066f lcd_set_cursor(1, 2); 23d60: 62 e0 ldi r22, 0x02 ; 2 23d62: 81 e0 ldi r24, 0x01 ; 1 23d64: 0e 94 f8 6e call 0xddf0 ; 0xddf0 lcd_printf_P(PSTR("%3u"), pid_temp); 23d68: 80 91 4c 02 lds r24, 0x024C ; 0x80024c <_ZL8pid_temp.lto_priv.441+0x1> 23d6c: 8f 93 push r24 23d6e: 80 91 4b 02 lds r24, 0x024B ; 0x80024b <_ZL8pid_temp.lto_priv.441> 23d72: 8f 93 push r24 23d74: 86 e8 ldi r24, 0x86 ; 134 23d76: 93 ea ldi r25, 0xA3 ; 163 23d78: 9f 93 push r25 23d7a: 8f 93 push r24 23d7c: 0e 94 d1 6e call 0xdda2 ; 0xdda2 if (lcd_clicked()) { 23d80: 0e 94 15 71 call 0xe22a ; 0xe22a 23d84: 0f 90 pop r0 23d86: 0f 90 pop r0 23d88: 0f 90 pop r0 23d8a: 0f 90 pop r0 23d8c: 88 23 and r24, r24 23d8e: 71 f0 breq .+28 ; 0x23dac lcd_commands_type = LcdCommands::PidExtruder; 23d90: 83 e0 ldi r24, 0x03 ; 3 23d92: 80 93 b3 0d sts 0x0DB3, r24 ; 0x800db3 lcd_return_to_status(); 23d96: 0f 94 7c 1e call 0x23cf8 ; 0x23cf8 lcd_update(2); 23d9a: 82 e0 ldi r24, 0x02 ; 2 23d9c: 0c 94 bf 6e jmp 0xdd7e ; 0xdd7e { 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; 23da0: 8a 30 cpi r24, 0x0A ; 10 23da2: 91 05 cpc r25, r1 23da4: a8 f6 brcc .-86 ; 0x23d50 23da6: 8a e0 ldi r24, 0x0A ; 10 23da8: 90 e0 ldi r25, 0x00 ; 0 23daa: d2 cf rjmp .-92 ; 0x23d50 lcd_commands_type = LcdCommands::PidExtruder; lcd_return_to_status(); lcd_update(2); } } 23dac: 08 95 ret 00023dae : } 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){ 23dae: 0f 93 push r16 23db0: 1f 93 push r17 23db2: cf 93 push r28 23db4: df 93 push r29 23db6: ec 01 movw r28, r24 23db8: cb 01 movw r24, r22 23dba: ba 01 movw r22, r20 static const char m1[] PROGMEM = "Please restart"; switch(state){ 23dbc: 4a 81 ldd r20, Y+2 ; 0x02 23dbe: 41 30 cpi r20, 0x01 ; 1 23dc0: 29 f0 breq .+10 ; 0x23dcc 23dc2: 88 f0 brcs .+34 ; 0x23de6 23dc4: 42 30 cpi r20, 0x02 ; 2 23dc6: 09 f1 breq .+66 ; 0x23e0a 23dc8: 43 30 cpi r20, 0x03 ; 3 23dca: d1 f4 brne .+52 ; 0x23e00 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 ){ 23dcc: 8b 81 ldd r24, Y+3 ; 0x03 23dce: 81 11 cpse r24, r1 23dd0: 25 c0 rjmp .+74 ; 0x23e1c state = next_state; // advance to the next state 23dd2: 82 e0 ldi r24, 0x02 ; 2 23dd4: 8a 83 std Y+2, r24 ; 0x02 lcd_setalertstatuspgm(next_msg, LCD_STATUS_CRITICAL); 23dd6: 63 e0 ldi r22, 0x03 ; 3 23dd8: 81 ec ldi r24, 0xC1 ; 193 23dda: 9e e9 ldi r25, 0x9E ; 158 23ddc: 0e 94 f8 f0 call 0x1e1f0 ; 0x1e1f0 repeat = ALERT_AUTOMATON_SPEED_DIV; // and prepare repeating for it too 23de0: 85 e0 ldi r24, 0x05 ; 5 } else { --repeat; 23de2: 8b 83 std Y+3, r24 ; 0x03 23de4: 0d c0 rjmp .+26 ; 0x23e00 //! @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 ){ 23de6: a9 01 movw r20, r18 23de8: 98 01 movw r18, r16 23dea: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 23dee: 18 16 cp r1, r24 23df0: 3c f4 brge .+14 ; 0x23e00 lcd_setalertstatuspgm(m2, LCD_STATUS_CRITICAL); 23df2: 63 e0 ldi r22, 0x03 ; 3 23df4: 88 81 ld r24, Y 23df6: 99 81 ldd r25, Y+1 ; 0x01 23df8: 0e 94 f8 f0 call 0x1e1f0 ; 0x1e1f0 state = States::TempAboveMintemp; 23dfc: 81 e0 ldi r24, 0x01 ; 1 23dfe: 8a 83 std Y+2, r24 ; 0x02 break; case States::ShowPleaseRestart: // displaying "Please restart" substep(m2, States::ShowMintemp); break; } } 23e00: df 91 pop r29 23e02: cf 91 pop r28 23e04: 1f 91 pop r17 23e06: 0f 91 pop r16 23e08: 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 ){ 23e0a: 8b 81 ldd r24, Y+3 ; 0x03 23e0c: 81 11 cpse r24, r1 23e0e: 06 c0 rjmp .+12 ; 0x23e1c 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); 23e10: 88 81 ld r24, Y 23e12: 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 23e14: 23 e0 ldi r18, 0x03 ; 3 23e16: 2a 83 std Y+2, r18 ; 0x02 lcd_setalertstatuspgm(next_msg, LCD_STATUS_CRITICAL); 23e18: 63 e0 ldi r22, 0x03 ; 3 23e1a: e0 cf rjmp .-64 ; 0x23ddc repeat = ALERT_AUTOMATON_SPEED_DIV; // and prepare repeating for it too } else { --repeat; 23e1c: 81 50 subi r24, 0x01 ; 1 23e1e: e1 cf rjmp .-62 ; 0x23de2 00023e20 : } } static void temp_runaway_stop(bool isPreheat, bool isBed) { 23e20: cf 93 push r28 if(IsStopped() == false) { 23e22: 90 91 10 05 lds r25, 0x0510 ; 0x800510 23e26: 91 11 cpse r25, r1 23e28: 18 c0 rjmp .+48 ; 0x23e5a 23e2a: c6 2f mov r28, r22 if (isPreheat) { 23e2c: 88 23 and r24, r24 23e2e: c9 f0 breq .+50 ; 0x23e62 lcd_setalertstatuspgm(isBed? PSTR("BED PREHEAT ERROR") : PSTR("PREHEAT ERROR"), LCD_STATUS_CRITICAL); 23e30: 85 e6 ldi r24, 0x65 ; 101 23e32: 9e e9 ldi r25, 0x9E ; 158 23e34: 66 23 and r22, r22 23e36: 11 f0 breq .+4 ; 0x23e3c 23e38: 83 e7 ldi r24, 0x73 ; 115 23e3a: 9e e9 ldi r25, 0x9E ; 158 23e3c: 63 e0 ldi r22, 0x03 ; 3 23e3e: 0e 94 f8 f0 call 0x1e1f0 ; 0x1e1f0 SERIAL_ERROR_START; 23e42: 8a ec ldi r24, 0xCA ; 202 23e44: 9b ea ldi r25, 0xAB ; 171 23e46: 0e 94 68 77 call 0xeed0 ; 0xeed0 if (isBed) { SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HEATBED)"); 23e4a: 82 e4 ldi r24, 0x42 ; 66 23e4c: 9e e9 ldi r25, 0x9E ; 158 { if(IsStopped() == false) { if (isPreheat) { lcd_setalertstatuspgm(isBed? PSTR("BED PREHEAT ERROR") : PSTR("PREHEAT ERROR"), LCD_STATUS_CRITICAL); SERIAL_ERROR_START; if (isBed) { 23e4e: c1 11 cpse r28, r1 23e50: 02 c0 rjmp .+4 ; 0x23e56 SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HEATBED)"); } else { SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HOTEND)"); 23e52: 80 e2 ldi r24, 0x20 ; 32 23e54: 9e e9 ldi r25, 0x9E ; 158 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"); 23e56: 0e 94 93 79 call 0xf326 ; 0xf326 } } prusa_statistics(0); prusa_statistics(isPreheat? 91 : 90); } ThermalStop(); 23e5a: 80 e0 ldi r24, 0x00 ; 0 } 23e5c: cf 91 pop r28 } } prusa_statistics(0); prusa_statistics(isPreheat? 91 : 90); } ThermalStop(); 23e5e: 0c 94 c4 79 jmp 0xf388 ; 0xf388 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); 23e62: 8c ef ldi r24, 0xFC ; 252 23e64: 9d e9 ldi r25, 0x9D ; 157 23e66: 66 23 and r22, r22 23e68: 11 f0 breq .+4 ; 0x23e6e 23e6a: 8c e0 ldi r24, 0x0C ; 12 23e6c: 9e e9 ldi r25, 0x9E ; 158 23e6e: 63 e0 ldi r22, 0x03 ; 3 23e70: 0e 94 f8 f0 call 0x1e1f0 ; 0x1e1f0 SERIAL_ERROR_START; 23e74: 8a ec ldi r24, 0xCA ; 202 23e76: 9b ea ldi r25, 0xAB ; 171 23e78: 0e 94 68 77 call 0xeed0 ; 0xeed0 if (isBed) { SERIAL_ERRORLNPGM(" HEATBED THERMAL RUNAWAY"); 23e7c: 83 ee ldi r24, 0xE3 ; 227 23e7e: 9d e9 ldi r25, 0x9D ; 157 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) { 23e80: c1 11 cpse r28, r1 23e82: e9 cf rjmp .-46 ; 0x23e56 SERIAL_ERRORLNPGM(" HEATBED THERMAL RUNAWAY"); } else { SERIAL_ERRORLNPGM(" HOTEND THERMAL RUNAWAY"); 23e84: 8b ec ldi r24, 0xCB ; 203 23e86: 9d e9 ldi r25, 0x9D ; 157 23e88: e6 cf rjmp .-52 ; 0x23e56 00023e8a : static void Sound_DoSound_Prompt(void) { backlight_wake(2); 23e8a: 82 e0 ldi r24, 0x02 ; 2 23e8c: 0e 94 85 8a call 0x1150a ; 0x1150a WRITE(BEEPER,HIGH); 23e90: 9f b7 in r25, 0x3f ; 63 23e92: f8 94 cli 23e94: e2 e0 ldi r30, 0x02 ; 2 23e96: f1 e0 ldi r31, 0x01 ; 1 23e98: 80 81 ld r24, Z 23e9a: 84 60 ori r24, 0x04 ; 4 23e9c: 80 83 st Z, r24 23e9e: 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); 23ea0: 2f ef ldi r18, 0xFF ; 255 23ea2: 89 e6 ldi r24, 0x69 ; 105 23ea4: 98 e1 ldi r25, 0x18 ; 24 23ea6: 21 50 subi r18, 0x01 ; 1 23ea8: 80 40 sbci r24, 0x00 ; 0 23eaa: 90 40 sbci r25, 0x00 ; 0 23eac: e1 f7 brne .-8 ; 0x23ea6 23eae: 00 c0 rjmp .+0 ; 0x23eb0 23eb0: 00 00 nop _delay_ms(500); WRITE(BEEPER,LOW); 23eb2: 9f b7 in r25, 0x3f ; 63 23eb4: f8 94 cli 23eb6: 80 81 ld r24, Z 23eb8: 8b 7f andi r24, 0xFB ; 251 23eba: 80 83 st Z, r24 23ebc: 9f bf out 0x3f, r25 ; 63 } 23ebe: 08 95 ret 00023ec0 : } #endif // not defined TMC2130 static void lcd_print_state(uint8_t state) { switch (state) { 23ec0: 81 30 cpi r24, 0x01 ; 1 23ec2: 21 f4 brne .+8 ; 0x23ecc case STATE_ON: lcd_puts_P(_N(" 1")); 23ec4: 81 e3 ldi r24, 0x31 ; 49 23ec6: 90 e7 ldi r25, 0x70 ; 112 break; case STATE_OFF: lcd_puts_P(_N(" 0")); 23ec8: 0c 94 e3 6e jmp 0xddc6 ; 0xddc6 23ecc: 8d e2 ldi r24, 0x2D ; 45 23ece: 90 e7 ldi r25, 0x70 ; 112 23ed0: fb cf rjmp .-10 ; 0x23ec8 00023ed2 : //! @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) { 23ed2: cf 92 push r12 23ed4: df 92 push r13 23ed6: ef 92 push r14 23ed8: ff 92 push r15 23eda: 0f 93 push r16 23edc: 1f 93 push r17 23ede: cf 93 push r28 23ee0: df 93 push r29 23ee2: d8 2f mov r29, r24 23ee4: 6b 01 movw r12, r22 23ee6: 7a 01 movw r14, r20 23ee8: c2 2f mov r28, r18 lcd_putc_at(0, 3, selected == LCD_LEFT_BUTTON_CHOICE ? '>': ' '); 23eea: 40 e2 ldi r20, 0x20 ; 32 23eec: 81 11 cpse r24, r1 23eee: 01 c0 rjmp .+2 ; 0x23ef2 23ef0: 4e e3 ldi r20, 0x3E ; 62 23ef2: 63 e0 ldi r22, 0x03 ; 3 23ef4: 80 e0 ldi r24, 0x00 ; 0 23ef6: 0e 94 18 6f call 0xde30 ; 0xde30 lcd_puts_P(first_choice); 23efa: c6 01 movw r24, r12 23efc: 0e 94 e3 6e call 0xddc6 ; 0xddc6 lcd_putc_at(second_col, 3, selected == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 23f00: 40 e2 ldi r20, 0x20 ; 32 23f02: d1 30 cpi r29, 0x01 ; 1 23f04: 09 f4 brne .+2 ; 0x23f08 23f06: 4e e3 ldi r20, 0x3E ; 62 23f08: 63 e0 ldi r22, 0x03 ; 3 23f0a: 8c 2f mov r24, r28 23f0c: 0e 94 18 6f call 0xde30 ; 0xde30 lcd_puts_P(second_choice); 23f10: c7 01 movw r24, r14 23f12: 0e 94 e3 6e call 0xddc6 ; 0xddc6 if (third_choice) { 23f16: 01 15 cp r16, r1 23f18: 11 05 cpc r17, r1 23f1a: 19 f1 breq .+70 ; 0x23f62 23f1c: c8 01 movw r24, r16 23f1e: 0f 94 95 d9 call 0x3b32a ; 0x3b32a <__strlen_P> 23f22: d8 2e mov r13, r24 23f24: c7 01 movw r24, r14 23f26: 0f 94 95 d9 call 0x3b32a ; 0x3b32a <__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; 23f2a: 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;} 23f2c: 93 e1 ldi r25, 0x13 ; 19 23f2e: 9d 19 sub r25, r13 23f30: 8c 0f add r24, r28 23f32: 89 17 cp r24, r25 23f34: 08 f4 brcc .+2 ; 0x23f38 23f36: 89 2f mov r24, r25 23f38: 83 31 cpi r24, 0x13 ; 19 23f3a: 08 f0 brcs .+2 ; 0x23f3e 23f3c: 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 ? '>': ' '); 23f3e: 40 e2 ldi r20, 0x20 ; 32 23f40: d2 30 cpi r29, 0x02 ; 2 23f42: 09 f4 brne .+2 ; 0x23f46 23f44: 4e e3 ldi r20, 0x3E ; 62 23f46: 63 e0 ldi r22, 0x03 ; 3 23f48: 0e 94 18 6f call 0xde30 ; 0xde30 lcd_puts_P(third_choice); 23f4c: c8 01 movw r24, r16 } } 23f4e: df 91 pop r29 23f50: cf 91 pop r28 23f52: 1f 91 pop r17 23f54: 0f 91 pop r16 23f56: ff 90 pop r15 23f58: ef 90 pop r14 23f5a: df 90 pop r13 23f5c: 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); 23f5e: 0c 94 e3 6e jmp 0xddc6 ; 0xddc6 } } 23f62: df 91 pop r29 23f64: cf 91 pop r28 23f66: 1f 91 pop r17 23f68: 0f 91 pop r16 23f6a: ff 90 pop r15 23f6c: ef 90 pop r14 23f6e: df 90 pop r13 23f70: cf 90 pop r12 23f72: 08 95 ret 00023f74 : return multi_screen ? msgend : NULL; } const char* lcd_display_message_fullscreen_P(const char *msg) { 23f74: cf 93 push r28 23f76: df 93 push r29 23f78: ec 01 movw r28, r24 // Disable update of the screen by the usual lcd_update(0) routine. lcd_update_enable(false); 23f7a: 80 e0 ldi r24, 0x00 ; 0 23f7c: 0e 94 3d 6f call 0xde7a ; 0xde7a lcd_clear(); 23f80: 0e 94 2b 6f call 0xde56 ; 0xde56 return lcd_display_message_fullscreen_nonBlocking_P(msg); 23f84: ce 01 movw r24, r28 } 23f86: df 91 pop r29 23f88: 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); 23f8a: 0d 94 84 14 jmp 0x22908 ; 0x22908 00023f8e : * * This function is blocking. * @param msg message to be displayed from PROGMEM */ void lcd_show_fullscreen_message_and_wait_P(const char *msg) { 23f8e: cf 92 push r12 23f90: df 92 push r13 23f92: ef 92 push r14 23f94: ff 92 push r15 23f96: 0f 93 push r16 23f98: 1f 93 push r17 23f9a: cf 93 push r28 23f9c: df 93 push r29 23f9e: d8 2e mov r13, r24 23fa0: 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) 23fa2: 01 e0 ldi r16, 0x01 ; 1 23fa4: 80 91 6e 02 lds r24, 0x026E ; 0x80026e 23fa8: 81 11 cpse r24, r1 23faa: 01 c0 rjmp .+2 ; 0x23fae 23fac: 00 e0 ldi r16, 0x00 ; 0 { lcd_update_enabled = false; 23fae: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e LcdUpdateDisabler lcdUpdateDisabler; const char *msg_next = lcd_display_message_fullscreen_P(msg); 23fb2: 8d 2d mov r24, r13 23fb4: 9c 2d mov r25, r12 23fb6: 0f 94 ba 1f call 0x23f74 ; 0x23f74 23fba: 7c 01 movw r14, r24 bool multi_screen = msg_next != NULL; lcd_consume_click(); 23fbc: 0e 94 10 71 call 0xe220 ; 0xe220 KEEPALIVE_STATE(PAUSED_FOR_USER); 23fc0: 84 e0 ldi r24, 0x04 ; 4 23fc2: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be * @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); 23fc6: 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) { 23fc8: 20 97 sbiw r28, 0x00 ; 0 23fca: 29 f4 brne .+10 ; 0x23fd6 // Display the confirm char. lcd_putc_at(19, 3, LCD_STR_CONFIRM[0]); 23fcc: 49 e8 ldi r20, 0x89 ; 137 23fce: 63 e0 ldi r22, 0x03 ; 3 23fd0: 83 e1 ldi r24, 0x13 ; 19 23fd2: 0e 94 18 6f call 0xde30 ; 0xde30 * @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); 23fd6: 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); 23fd8: 82 e3 ldi r24, 0x32 ; 50 23fda: 90 e0 ldi r25, 0x00 ; 0 23fdc: 0e 94 fc 8c call 0x119f8 ; 0x119f8 if (lcd_clicked()) { 23fe0: 0e 94 15 71 call 0xe22a ; 0xe22a 23fe4: 88 23 and r24, r24 23fe6: 81 f0 breq .+32 ; 0x24008 if (msg_next == NULL) { 23fe8: 20 97 sbiw r28, 0x00 ; 0 23fea: 81 f4 brne .+32 ; 0x2400c KEEPALIVE_STATE(IN_HANDLER); 23fec: 82 e0 ldi r24, 0x02 ; 2 23fee: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be } ~LcdUpdateDisabler() { lcd_update_enabled = m_updateEnabled; 23ff2: 00 93 6e 02 sts 0x026E, r16 ; 0x80026e if (msg_next == NULL) msg_next = msg; msg_next = lcd_display_message_fullscreen_P(msg_next); } } } 23ff6: df 91 pop r29 23ff8: cf 91 pop r28 23ffa: 1f 91 pop r17 23ffc: 0f 91 pop r16 23ffe: ff 90 pop r15 24000: ef 90 pop r14 24002: df 90 pop r13 24004: cf 90 pop r12 24006: 08 95 ret 24008: 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) { 2400a: 31 f7 brne .-52 ; 0x23fd8 else { break; } } } if (multi_screen) { 2400c: e1 14 cp r14, r1 2400e: f1 04 cpc r15, r1 24010: d9 f2 breq .-74 ; 0x23fc8 if (msg_next == NULL) 24012: 20 97 sbiw r28, 0x00 ; 0 24014: 11 f4 brne .+4 ; 0x2401a msg_next = msg; 24016: cd 2d mov r28, r13 24018: dc 2d mov r29, r12 msg_next = lcd_display_message_fullscreen_P(msg_next); 2401a: ce 01 movw r24, r28 2401c: 0f 94 ba 1f call 0x23f74 ; 0x23f74 24020: ec 01 movw r28, r24 24022: d2 cf rjmp .-92 ; 0x23fc8 00024024 : lcd_show_fullscreen_message_and_wait_P(msg); } } } void lcd_temp_cal_show_result(bool result) { 24024: cf 93 push r28 24026: c8 2f mov r28, r24 custom_message_type = CustomMsg::Status; 24028: 10 92 c3 06 sts 0x06C3, r1 ; 0x8006c3 disable_x(); 2402c: 17 9a sbi 0x02, 7 ; 2 2402e: 10 92 8e 06 sts 0x068E, r1 ; 0x80068e disable_y(); 24032: 16 9a sbi 0x02, 6 ; 2 24034: 10 92 8f 06 sts 0x068F, r1 ; 0x80068f disable_z(); disable_e0(); 24038: 14 9a sbi 0x02, 4 ; 2 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 2403a: 10 92 72 06 sts 0x0672, r1 ; 0x800672 2403e: 10 92 71 06 sts 0x0671, r1 ; 0x800671 24042: 68 2f mov r22, r24 24044: 86 ea ldi r24, 0xA6 ; 166 24046: 9f e0 ldi r25, 0x0F ; 15 24048: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 2404c: 6c 2f mov r22, r28 2404e: 8f ea ldi r24, 0xAF ; 175 24050: 9f e0 ldi r25, 0x0F ; 15 24052: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 // 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) { 24056: cc 23 and r28, r28 24058: 89 f0 breq .+34 ; 0x2407c SERIAL_ECHOLNPGM("PINDA calibration done. Continue with pressing the knob."); 2405a: 85 ec ldi r24, 0xC5 ; 197 2405c: 93 ea ldi r25, 0xA3 ; 163 2405e: 0e 94 93 79 call 0xf326 ; 0xf326 lcd_show_fullscreen_message_and_wait_P(_T(MSG_PINDA_CALIBRATION_DONE)); 24062: 8f e0 ldi r24, 0x0F ; 15 24064: 92 e5 ldi r25, 0x52 ; 82 } else { SERIAL_ECHOLNPGM("PINDA calibration failed. Continue with pressing the knob."); lcd_show_fullscreen_message_and_wait_P(_T(MSG_PINDA_CAL_FAILED)); 24066: 0e 94 c4 72 call 0xe588 ; 0xe588 2406a: 0f 94 c7 1f call 0x23f8e ; 0x23f8e } lcd_update_enable(true); 2406e: 81 e0 ldi r24, 0x01 ; 1 24070: 0e 94 3d 6f call 0xde7a ; 0xde7a lcd_update(2); 24074: 82 e0 ldi r24, 0x02 ; 2 } 24076: 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); 24078: 0c 94 bf 6e jmp 0xdd7e ; 0xdd7e 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."); 2407c: 8a e8 ldi r24, 0x8A ; 138 2407e: 93 ea ldi r25, 0xA3 ; 163 24080: 0e 94 93 79 call 0xf326 ; 0xf326 lcd_show_fullscreen_message_and_wait_P(_T(MSG_PINDA_CAL_FAILED)); 24084: 84 ef ldi r24, 0xF4 ; 244 24086: 91 e5 ldi r25, 0x51 ; 81 24088: ee cf rjmp .-36 ; 0x24066 0002408a : lcd_puts_at_P(0, 2, _T(MSG_CHANGE_SUCCESS)); } static void lcd_loading_progress_bar(uint16_t loading_time_ms) { 2408a: 1f 93 push r17 2408c: cf 93 push r28 2408e: 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); 24090: 64 e6 ldi r22, 0x64 ; 100 24092: 70 e0 ldi r23, 0x00 ; 0 24094: 0f 94 a0 dc call 0x3b940 ; 0x3b940 <__udivmodhi4> 24098: 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++) { 2409a: 10 e0 ldi r17, 0x00 ; 0 lcd_putc_at(i, 3, '.'); 2409c: 4e e2 ldi r20, 0x2E ; 46 2409e: 63 e0 ldi r22, 0x03 ; 3 240a0: 81 2f mov r24, r17 240a2: 0e 94 18 6f call 0xde30 ; 0xde30 //loading_time_ms/20 delay for (uint_least8_t j = 0; j < 5; j++) { delay_keep_alive(loading_time_ms / 100); 240a6: ce 01 movw r24, r28 240a8: 0e 94 fc 8c call 0x119f8 ; 0x119f8 240ac: ce 01 movw r24, r28 240ae: 0e 94 fc 8c call 0x119f8 ; 0x119f8 240b2: ce 01 movw r24, r28 240b4: 0e 94 fc 8c call 0x119f8 ; 0x119f8 240b8: ce 01 movw r24, r28 240ba: 0e 94 fc 8c call 0x119f8 ; 0x119f8 240be: ce 01 movw r24, r28 240c0: 0e 94 fc 8c call 0x119f8 ; 0x119f8 } static void lcd_loading_progress_bar(uint16_t loading_time_ms) { for (uint_least8_t i = 0; i < LCD_WIDTH; i++) { 240c4: 1f 5f subi r17, 0xFF ; 255 240c6: 14 31 cpi r17, 0x14 ; 20 240c8: 49 f7 brne .-46 ; 0x2409c //loading_time_ms/20 delay for (uint_least8_t j = 0; j < 5; j++) { delay_keep_alive(loading_time_ms / 100); } } } 240ca: df 91 pop r29 240cc: cf 91 pop r28 240ce: 1f 91 pop r17 240d0: 08 95 ret 000240d2 : } } } static void setFilamentAction(FilamentAction action) { eFilamentAction = action; 240d2: 10 92 a5 03 sts 0x03A5, r1 ; 0x8003a5 static void __attribute__((noinline)) clearFilamentAction() { // filament action has been cancelled or completed setFilamentAction(FilamentAction::None); } 240d6: 08 95 ret 000240d8 : bFilamentPreheatState = false; mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); } void lcd_generic_preheat_menu() { 240d8: cf 93 push r28 MENU_BEGIN(); 240da: 0f 94 51 d1 call 0x3a2a2 ; 0x3a2a2 240de: 10 92 11 05 sts 0x0511, r1 ; 0x800511 240e2: 80 91 11 05 lds r24, 0x0511 ; 0x800511 240e6: 84 30 cpi r24, 0x04 ; 4 240e8: 08 f0 brcs .+2 ; 0x240ec 240ea: a1 c0 rjmp .+322 ; 0x2422e 240ec: 10 92 14 05 sts 0x0514, r1 ; 0x800514 if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 240f0: 8f e5 ldi r24, 0x5F ; 95 240f2: 9f e0 ldi r25, 0x0F ; 15 240f4: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 240f8: 81 11 cpse r24, r1 240fa: 10 c0 rjmp .+32 ; 0x2411c { ON_MENU_LEAVE( 240fc: 0f 94 d1 cf call 0x39fa2 ; 0x39fa2 24100: 81 11 cpse r24, r1 24102: 0f 94 69 20 call 0x240d2 ; 0x240d2 clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(eFilamentAction == FilamentAction::Lay1Cal ? MSG_BACK : MSG_MAIN)); 24106: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 2410a: 8a 30 cpi r24, 0x0A ; 10 2410c: 09 f4 brne .+2 ; 0x24110 2410e: 8c c0 rjmp .+280 ; 0x24228 24110: 88 ea ldi r24, 0xA8 ; 168 24112: 98 e4 ldi r25, 0x48 ; 72 24114: 0e 94 c4 72 call 0xe588 ; 0xe588 24118: 0f 94 1c d4 call 0x3a838 ; 0x3a838 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(); 2411c: 0f 94 0a 16 call 0x22c14 ; 0x22c14 24120: 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); 24122: 8d e2 ldi r24, 0x2D ; 45 24124: 93 ea ldi r25, 0xA3 ; 163 24126: cc 23 and r28, r28 24128: 11 f0 breq .+4 ; 0x2412e 2412a: 8c e3 ldi r24, 0x3C ; 60 2412c: 93 ea ldi r25, 0xA3 ; 163 2412e: 6c ee ldi r22, 0xEC ; 236 24130: 7a e3 ldi r23, 0x3A ; 58 24132: 0f 94 cf d3 call 0x3a79e ; 0x3a79e 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); 24136: 82 e1 ldi r24, 0x12 ; 18 24138: 93 ea ldi r25, 0xA3 ; 163 2413a: cc 23 and r28, r28 2413c: 11 f0 breq .+4 ; 0x24142 2413e: 81 e2 ldi r24, 0x21 ; 33 24140: 93 ea ldi r25, 0xA3 ; 163 24142: 68 ea ldi r22, 0xA8 ; 168 24144: 7a e3 ldi r23, 0x3A ; 58 24146: 0f 94 cf d3 call 0x3a79e ; 0x3a79e 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); 2414a: 86 ef ldi r24, 0xF6 ; 246 2414c: 92 ea ldi r25, 0xA2 ; 162 2414e: cc 23 and r28, r28 24150: 11 f0 breq .+4 ; 0x24156 24152: 86 e0 ldi r24, 0x06 ; 6 24154: 93 ea ldi r25, 0xA3 ; 163 24156: 60 eb ldi r22, 0xB0 ; 176 24158: 7a e3 ldi r23, 0x3A ; 58 2415a: 0f 94 cf d3 call 0x3a79e ; 0x3a79e 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); 2415e: 8a ed ldi r24, 0xDA ; 218 24160: 92 ea ldi r25, 0xA2 ; 162 24162: cc 23 and r28, r28 24164: 11 f0 breq .+4 ; 0x2416a 24166: 8a ee ldi r24, 0xEA ; 234 24168: 92 ea ldi r25, 0xA2 ; 162 2416a: 6a e1 ldi r22, 0x1A ; 26 2416c: 7a e3 ldi r23, 0x3A ; 58 2416e: 0f 94 cf d3 call 0x3a79e ; 0x3a79e 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); 24172: 8f eb ldi r24, 0xBF ; 191 24174: 92 ea ldi r25, 0xA2 ; 162 24176: cc 23 and r28, r28 24178: 11 f0 breq .+4 ; 0x2417e 2417a: 8e ec ldi r24, 0xCE ; 206 2417c: 92 ea ldi r25, 0xA2 ; 162 2417e: 60 e0 ldi r22, 0x00 ; 0 24180: 7a e3 ldi r23, 0x3A ; 58 24182: 0f 94 cf d3 call 0x3a79e ; 0x3a79e 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); 24186: 84 ea ldi r24, 0xA4 ; 164 24188: 92 ea ldi r25, 0xA2 ; 162 2418a: cc 23 and r28, r28 2418c: 11 f0 breq .+4 ; 0x24192 2418e: 83 eb ldi r24, 0xB3 ; 179 24190: 92 ea ldi r25, 0xA2 ; 162 24192: 62 e0 ldi r22, 0x02 ; 2 24194: 7a e3 ldi r23, 0x3A ; 58 24196: 0f 94 cf d3 call 0x3a79e ; 0x3a79e 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); 2419a: 88 e8 ldi r24, 0x88 ; 136 2419c: 92 ea ldi r25, 0xA2 ; 162 2419e: cc 23 and r28, r28 241a0: 11 f0 breq .+4 ; 0x241a6 241a2: 88 e9 ldi r24, 0x98 ; 152 241a4: 92 ea ldi r25, 0xA2 ; 162 241a6: 60 e8 ldi r22, 0x80 ; 128 241a8: 79 e3 ldi r23, 0x39 ; 57 241aa: 0f 94 cf d3 call 0x3a79e ; 0x3a79e 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); 241ae: 8c e6 ldi r24, 0x6C ; 108 241b0: 92 ea ldi r25, 0xA2 ; 162 241b2: cc 23 and r28, r28 241b4: 11 f0 breq .+4 ; 0x241ba 241b6: 8c e7 ldi r24, 0x7C ; 124 241b8: 92 ea ldi r25, 0xA2 ; 162 241ba: 62 e1 ldi r22, 0x12 ; 18 241bc: 7a e3 ldi r23, 0x3A ; 58 241be: 0f 94 cf d3 call 0x3a79e ; 0x3a79e 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); 241c2: 80 e5 ldi r24, 0x50 ; 80 241c4: 92 ea ldi r25, 0xA2 ; 162 241c6: cc 23 and r28, r28 241c8: 11 f0 breq .+4 ; 0x241ce 241ca: 80 e6 ldi r24, 0x60 ; 96 241cc: 92 ea ldi r25, 0xA2 ; 162 241ce: 66 e7 ldi r22, 0x76 ; 118 241d0: 7a e3 ldi r23, 0x3A ; 58 241d2: 0f 94 cf d3 call 0x3a79e ; 0x3a79e 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); 241d6: 85 e3 ldi r24, 0x35 ; 53 241d8: 92 ea ldi r25, 0xA2 ; 162 241da: cc 23 and r28, r28 241dc: 11 f0 breq .+4 ; 0x241e2 241de: 84 e4 ldi r24, 0x44 ; 68 241e0: 92 ea ldi r25, 0xA2 ; 162 241e2: 60 e8 ldi r22, 0x80 ; 128 241e4: 7a e3 ldi r23, 0x3A ; 58 241e6: 0f 94 cf d3 call 0x3a79e ; 0x3a79e } if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE) && eFilamentAction == FilamentAction::Preheat) MENU_ITEM_FUNCTION_P(_T(MSG_COOLDOWN), lcd_cooldown); 241ea: 8f e5 ldi r24, 0x5F ; 95 241ec: 9f e0 ldi r25, 0x0F ; 15 241ee: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 241f2: 81 11 cpse r24, r1 241f4: 0c c0 rjmp .+24 ; 0x2420e 241f6: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 241fa: 89 30 cpi r24, 0x09 ; 9 241fc: 41 f4 brne .+16 ; 0x2420e 241fe: 8e e3 ldi r24, 0x3E ; 62 24200: 90 e5 ldi r25, 0x50 ; 80 24202: 0e 94 c4 72 call 0xe588 ; 0xe588 24206: 68 ef ldi r22, 0xF8 ; 248 24208: 7a e3 ldi r23, 0x3A ; 58 2420a: 0f 94 ce d0 call 0x3a19c ; 0x3a19c MENU_END(); 2420e: 0f 94 25 d1 call 0x3a24a ; 0x3a24a mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); } void lcd_generic_preheat_menu() { MENU_BEGIN(); 24212: 80 91 11 05 lds r24, 0x0511 ; 0x800511 24216: 8f 5f subi r24, 0xFF ; 255 24218: 80 93 11 05 sts 0x0511, r24 ; 0x800511 2421c: 80 91 13 05 lds r24, 0x0513 ; 0x800513 24220: 8f 5f subi r24, 0xFF ; 255 24222: 80 93 13 05 sts 0x0513, r24 ; 0x800513 24226: 5d cf rjmp .-326 ; 0x240e2 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)); 24228: 8c eb ldi r24, 0xBC ; 188 2422a: 99 e4 ldi r25, 0x49 ; 73 2422c: 73 cf rjmp .-282 ; 0x24114 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); MENU_END(); } 2422e: cf 91 pop r28 24230: 08 95 ret 00024232 : #endif //RESUME_DEBUG //! @brief Show Preheat Menu static void lcd_preheat_menu() { eFilamentAction = FilamentAction::Preheat; 24232: 89 e0 ldi r24, 0x09 ; 9 24234: 80 93 a5 03 sts 0x03A5, r24 ; 0x8003a5 lcd_generic_preheat_menu(); 24238: 0d 94 6c 20 jmp 0x240d8 ; 0x240d8 0002423c : // 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); 2423c: 81 e0 ldi r24, 0x01 ; 1 2423e: 0e 94 ee 6e call 0xdddc ; 0xdddc if (MMU2::mmu2.get_current_tool() == MMU2::mmu2.get_tool_change_tool()) { 24242: 0f 94 74 74 call 0x2e8e8 ; 0x2e8e8 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; 24246: 90 91 a1 13 lds r25, 0x13A1 ; 0x8013a1 2424a: 93 36 cpi r25, 0x63 ; 99 2424c: 09 f4 brne .+2 ; 0x24250 2424e: 9f ef ldi r25, 0xFF ; 255 24250: 89 13 cpse r24, r25 24252: 0e c0 rjmp .+28 ; 0x24270 lcd_putc('F'); 24254: 86 e4 ldi r24, 0x46 ; 70 24256: 0e 94 e7 6e call 0xddce ; 0xddce lcd_putc(MMU2::mmu2.get_current_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_current_tool() + '1'); 2425a: 0f 94 74 74 call 0x2e8e8 ; 0x2e8e8 2425e: 8f 3f cpi r24, 0xFF ; 255 24260: 29 f0 breq .+10 ; 0x2426c 24262: 8f 5c subi r24, 0xCF ; 207 24264: 0e 94 e7 6e call 0xddce ; 0xddce 24268: 83 e0 ldi r24, 0x03 ; 3 2426a: 08 95 ret 2426c: 8f e3 ldi r24, 0x3F ; 63 2426e: fa cf rjmp .-12 ; 0x24264 chars += 2; } else { lcd_putc(MMU2::mmu2.get_current_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_current_tool() + '1'); 24270: 8f 3f cpi r24, 0xFF ; 255 24272: 89 f0 breq .+34 ; 0x24296 24274: 8f 5c subi r24, 0xCF ; 207 24276: 0e 94 e7 6e call 0xddce ; 0xddce lcd_putc('>'); 2427a: 8e e3 ldi r24, 0x3E ; 62 2427c: 0e 94 e7 6e call 0xddce ; 0xddce 24280: 80 91 a1 13 lds r24, 0x13A1 ; 0x8013a1 24284: 83 36 cpi r24, 0x63 ; 99 24286: 49 f0 breq .+18 ; 0x2429a lcd_putc(MMU2::mmu2.get_tool_change_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_tool_change_tool() + '1'); 24288: 8f 3f cpi r24, 0xFF ; 255 2428a: 39 f0 breq .+14 ; 0x2429a 2428c: 8f 5c subi r24, 0xCF ; 207 2428e: 0e 94 e7 6e call 0xddce ; 0xddce chars += 3; 24292: 84 e0 ldi r24, 0x04 ; 4 } return chars; } 24294: 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'); 24296: 8f e3 ldi r24, 0x3F ; 63 24298: ee cf rjmp .-36 ; 0x24276 lcd_putc('>'); lcd_putc(MMU2::mmu2.get_tool_change_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_tool_change_tool() + '1'); 2429a: 8f e3 ldi r24, 0x3F ; 63 2429c: f8 cf rjmp .-16 ; 0x2428e 0002429e : } // 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); 2429e: 5f 93 push r21 242a0: 4f 93 push r20 242a2: 7f 93 push r23 242a4: 6f 93 push r22 242a6: 28 2f mov r18, r24 242a8: 08 2e mov r0, r24 242aa: 00 0c add r0, r0 242ac: 33 0b sbc r19, r19 242ae: 3f 93 push r19 242b0: 8f 93 push r24 242b2: 8e ed ldi r24, 0xDE ; 222 242b4: 9e e6 ldi r25, 0x6E ; 110 242b6: 9f 93 push r25 242b8: 8f 93 push r24 242ba: 0e 94 d1 6e call 0xdda2 ; 0xdda2 lcd_space(9 - chars); 242be: 2d b7 in r18, 0x3d ; 61 242c0: 3e b7 in r19, 0x3e ; 62 242c2: 28 5f subi r18, 0xF8 ; 248 242c4: 3f 4f sbci r19, 0xFF ; 255 242c6: 0f b6 in r0, 0x3f ; 63 242c8: f8 94 cli 242ca: 3e bf out 0x3e, r19 ; 62 242cc: 0f be out 0x3f, r0 ; 63 242ce: 2d bf out 0x3d, r18 ; 61 242d0: 99 e0 ldi r25, 0x09 ; 9 242d2: 98 1b sub r25, r24 242d4: 89 2f mov r24, r25 242d6: 0c 94 ee 6e jmp 0xdddc ; 0xdddc 000242da : default: return false; } } void lcd_print_target_temps_first_line() { 242da: cf 93 push r28 242dc: df 93 push r29 lcd_home(); 242de: 0e 94 24 6f call 0xde48 ; 0xde48 lcdui_print_temp(LCD_STR_THERMOMETER[0], (int) degHotend(0), (int) degTargetHotend(0)); 242e2: c0 91 b5 0d lds r28, 0x0DB5 ; 0x800db5 242e6: d0 91 b6 0d lds r29, 0x0DB6 ; 0x800db6 242ea: 60 91 af 0d lds r22, 0x0DAF ; 0x800daf 242ee: 70 91 b0 0d lds r23, 0x0DB0 ; 0x800db0 242f2: 80 91 b1 0d lds r24, 0x0DB1 ; 0x800db1 242f6: 90 91 b2 0d lds r25, 0x0DB2 ; 0x800db2 242fa: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> 242fe: ae 01 movw r20, r28 24300: 82 e8 ldi r24, 0x82 ; 130 24302: 0f 94 4f 21 call 0x2429e ; 0x2429e lcd_set_cursor(10, 0); 24306: 60 e0 ldi r22, 0x00 ; 0 24308: 8a e0 ldi r24, 0x0A ; 10 2430a: 0e 94 f8 6e call 0xddf0 ; 0xddf0 FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; 2430e: c0 91 71 06 lds r28, 0x0671 ; 0x800671 24312: d0 91 72 06 lds r29, 0x0672 ; 0x800672 int targetBedTemp = (int) degTargetBed(); if (targetBedTemp) { 24316: 20 97 sbiw r28, 0x00 ; 0 24318: 81 f0 breq .+32 ; 0x2433a lcdui_print_temp(LCD_STR_BEDTEMP[0], (int) degBed(), targetBedTemp); 2431a: 60 91 ed 04 lds r22, 0x04ED ; 0x8004ed 2431e: 70 91 ee 04 lds r23, 0x04EE ; 0x8004ee 24322: 80 91 ef 04 lds r24, 0x04EF ; 0x8004ef 24326: 90 91 f0 04 lds r25, 0x04F0 ; 0x8004f0 2432a: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> 2432e: ae 01 movw r20, r28 24330: 80 e8 ldi r24, 0x80 ; 128 } else { lcd_space(10); } } 24332: df 91 pop r29 24334: 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); 24336: 0d 94 4f 21 jmp 0x2429e ; 0x2429e } else { lcd_space(10); 2433a: 8a e0 ldi r24, 0x0A ; 10 } } 2433c: df 91 pop r29 2433e: 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); 24340: 0c 94 ee 6e jmp 0xdddc ; 0xdddc 00024344 : 24344: 10 92 da 03 sts 0x03DA, r1 ; 0x8003da } } static void mFilamentPrompt() { lcd_timeoutToStatus.stop(); lcd_print_target_temps_first_line(); 24348: 0f 94 6d 21 call 0x242da ; 0x242da lcd_puts_at_P(0,1, _T(MSG_PRESS_KNOB)); 2434c: 87 ed ldi r24, 0xD7 ; 215 2434e: 9f e4 ldi r25, 0x4F ; 79 24350: 0e 94 c4 72 call 0xe588 ; 0xe588 24354: ac 01 movw r20, r24 24356: 61 e0 ldi r22, 0x01 ; 1 24358: 80 e0 ldi r24, 0x00 ; 0 2435a: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_set_cursor(0,2); 2435e: 62 e0 ldi r22, 0x02 ; 2 24360: 80 e0 ldi r24, 0x00 ; 0 24362: 0e 94 f8 6e call 0xddf0 ; 0xddf0 switch(eFilamentAction) { 24366: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 2436a: 83 30 cpi r24, 0x03 ; 3 2436c: 81 f1 breq .+96 ; 0x243ce 2436e: 48 f4 brcc .+18 ; 0x24382 24370: 81 30 cpi r24, 0x01 ; 1 24372: 60 f0 brcs .+24 ; 0x2438c case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::MmuLoad: case FilamentAction::MmuLoadingTest: lcd_puts_P(_T(MSG_TO_LOAD_FIL)); 24374: 84 ec ldi r24, 0xC4 ; 196 24376: 9f e4 ldi r25, 0x4F ; 79 break; case FilamentAction::UnLoad: case FilamentAction::MmuUnLoad: lcd_puts_P(_T(MSG_TO_UNLOAD_FIL)); 24378: 0e 94 c4 72 call 0xe588 ; 0xe588 2437c: 0e 94 e3 6e call 0xddc6 ; 0xddc6 24380: 05 c0 rjmp .+10 ; 0x2438c 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) { 24382: 85 30 cpi r24, 0x05 ; 5 24384: 21 f1 breq .+72 ; 0x243ce 24386: b0 f3 brcs .-20 ; 0x24374 24388: 88 30 cpi r24, 0x08 ; 8 2438a: a1 f3 breq .-24 ; 0x24374 case FilamentAction::Preheat: case FilamentAction::Lay1Cal: break; } if(lcd_clicked() 2438c: 0e 94 15 71 call 0xe22a ; 0xe22a #ifdef FILAMENT_SENSOR /// @todo leptun - add this as a specific retest item || (((eFilamentAction == FilamentAction::Load) || (eFilamentAction == FilamentAction::AutoLoad)) && fsensor.getFilamentLoadEvent()) 24390: 81 11 cpse r24, r1 24392: 09 c0 rjmp .+18 ; 0x243a6 24394: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 24398: 81 50 subi r24, 0x01 ; 1 2439a: 82 30 cpi r24, 0x02 ; 2 2439c: 28 f5 brcc .+74 ; 0x243e8 2439e: 80 91 ad 17 lds r24, 0x17AD ; 0x8017ad 243a2: 88 23 and r24, r24 243a4: 09 f1 breq .+66 ; 0x243e8 #endif //FILAMENT_SENSOR ) { menu_back(bFilamentPreheatState ? 2 : 3); 243a6: 80 91 62 06 lds r24, 0x0662 ; 0x800662 243aa: 81 11 cpse r24, r1 243ac: 13 c0 rjmp .+38 ; 0x243d4 243ae: 83 e0 ldi r24, 0x03 ; 3 243b0: 0f 94 fd d3 call 0x3a7fa ; 0x3a7fa switch(eFilamentAction) { 243b4: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 243b8: 82 30 cpi r24, 0x02 ; 2 243ba: 71 f0 breq .+28 ; 0x243d8 243bc: 83 30 cpi r24, 0x03 ; 3 243be: 81 f0 breq .+32 ; 0x243e0 243c0: 81 30 cpi r24, 0x01 ; 1 243c2: 91 f4 brne .+36 ; 0x243e8 case FilamentAction::AutoLoad: // loading no longer cancellable eFilamentAction = FilamentAction::Load; [[fallthrough]]; case FilamentAction::Load: enquecommand_P(MSG_M701); // load filament 243c4: 61 e0 ldi r22, 0x01 ; 1 243c6: 86 e9 ldi r24, 0x96 ; 150 243c8: 9f e6 ldi r25, 0x6F ; 111 break; case FilamentAction::UnLoad: enquecommand_P(MSG_M702); // unload filament 243ca: 0c 94 38 88 jmp 0x11070 ; 0x11070 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)); 243ce: 8f ea ldi r24, 0xAF ; 175 243d0: 9f e4 ldi r25, 0x4F ; 79 243d2: d2 cf rjmp .-92 ; 0x24378 #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); 243d4: 82 e0 ldi r24, 0x02 ; 2 243d6: ec cf rjmp .-40 ; 0x243b0 switch(eFilamentAction) { case FilamentAction::AutoLoad: // loading no longer cancellable eFilamentAction = FilamentAction::Load; 243d8: 81 e0 ldi r24, 0x01 ; 1 243da: 80 93 a5 03 sts 0x03A5, r24 ; 0x8003a5 243de: f2 cf rjmp .-28 ; 0x243c4 [[fallthrough]]; case FilamentAction::Load: enquecommand_P(MSG_M701); // load filament break; case FilamentAction::UnLoad: enquecommand_P(MSG_M702); // unload filament 243e0: 61 e0 ldi r22, 0x01 ; 1 243e2: 85 e1 ldi r24, 0x15 ; 21 243e4: 9c e6 ldi r25, 0x6C ; 108 243e6: f1 cf rjmp .-30 ; 0x243ca case FilamentAction::Preheat: case FilamentAction::Lay1Cal: break; } } } 243e8: 08 95 ret 000243ea <__vector_51>: } return 1; //all characters match - return 1 } ISR(USART2_RX_vect) { 243ea: 1f 92 push r1 243ec: 0f 92 push r0 243ee: 0f b6 in r0, 0x3f ; 63 243f0: 0f 92 push r0 243f2: 11 24 eor r1, r1 243f4: 0b b6 in r0, 0x3b ; 59 243f6: 0f 92 push r0 243f8: 2f 93 push r18 243fa: 3f 93 push r19 243fc: 4f 93 push r20 243fe: 5f 93 push r21 24400: 6f 93 push r22 24402: 7f 93 push r23 24404: 8f 93 push r24 24406: 9f 93 push r25 24408: af 93 push r26 2440a: bf 93 push r27 2440c: ef 93 push r30 2440e: ff 93 push r31 //printf_P(PSTR("USART2_RX_vect \n") ); if (rbuf_put(uart2_ibuf, UDR2) < 0) // put received byte to buffer 24410: 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 24414: 80 91 3a 05 lds r24, 0x053A ; 0x80053a uint8_t buf_r = ptr[2]; //get read index 24418: 90 91 3b 05 lds r25, 0x053B ; 0x80053b _unlock(); //unlock ptr[4 + buf_w] = b; //store byte to buffer 2441c: e8 2f mov r30, r24 2441e: f0 e0 ldi r31, 0x00 ; 0 24420: e3 5c subi r30, 0xC3 ; 195 24422: fa 4f sbci r31, 0xFA ; 250 24424: 20 83 st Z, r18 buf_w++; //incerment write index 24426: 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 24428: 20 91 39 05 lds r18, 0x0539 ; 0x800539 2442c: 82 17 cp r24, r18 2442e: 08 f0 brcs .+2 ; 0x24432 <__vector_51+0x48> 24430: 80 e0 ldi r24, 0x00 ; 0 if (buf_w == buf_r) return -1; //return -1 to signal buffer full 24432: 98 13 cpse r25, r24 24434: 17 c0 rjmp .+46 ; 0x24464 <__vector_51+0x7a> { //rx buffer full //uart2_rx_clr(); //for sure, clear input buffer puts_P(PSTR("USART2 rx Full!!!")); 24436: 85 e8 ldi r24, 0x85 ; 133 24438: 90 ea ldi r25, 0xA0 ; 160 2443a: 0f 94 c0 da call 0x3b580 ; 0x3b580 } } 2443e: ff 91 pop r31 24440: ef 91 pop r30 24442: bf 91 pop r27 24444: af 91 pop r26 24446: 9f 91 pop r25 24448: 8f 91 pop r24 2444a: 7f 91 pop r23 2444c: 6f 91 pop r22 2444e: 5f 91 pop r21 24450: 4f 91 pop r20 24452: 3f 91 pop r19 24454: 2f 91 pop r18 24456: 0f 90 pop r0 24458: 0b be out 0x3b, r0 ; 59 2445a: 0f 90 pop r0 2445c: 0f be out 0x3f, r0 ; 63 2445e: 0f 90 pop r0 24460: 1f 90 pop r1 24462: 18 95 reti ptr[1] = buf_w; //store write index 24464: 80 93 3a 05 sts 0x053A, r24 ; 0x80053a 24468: ea cf rjmp .-44 ; 0x2443e <__vector_51+0x54> 0002446a <__vector_45>: { WRITE(BEEPER, 1); } ISR(TIMER4_OVF_vect) { 2446a: 1f 92 push r1 2446c: 0f 92 push r0 2446e: 0f b6 in r0, 0x3f ; 63 24470: 0f 92 push r0 24472: 11 24 eor r1, r1 24474: 0b b6 in r0, 0x3b ; 59 24476: 0f 92 push r0 24478: 8f 93 push r24 2447a: 9f 93 push r25 2447c: ef 93 push r30 2447e: ff 93 push r31 WRITE(BEEPER, 0); 24480: 9f b7 in r25, 0x3f ; 63 24482: f8 94 cli 24484: e2 e0 ldi r30, 0x02 ; 2 24486: f1 e0 ldi r31, 0x01 ; 1 24488: 80 81 ld r24, Z 2448a: 8b 7f andi r24, 0xFB ; 251 2448c: 80 83 st Z, r24 2448e: 9f bf out 0x3f, r25 ; 63 } 24490: ff 91 pop r31 24492: ef 91 pop r30 24494: 9f 91 pop r25 24496: 8f 91 pop r24 24498: 0f 90 pop r0 2449a: 0b be out 0x3b, r0 ; 59 2449c: 0f 90 pop r0 2449e: 0f be out 0x3f, r0 ; 63 244a0: 0f 90 pop r0 244a2: 1f 90 pop r1 244a4: 18 95 reti 000244a6 <__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) { 244a6: 1f 92 push r1 244a8: 0f 92 push r0 244aa: 0f b6 in r0, 0x3f ; 63 244ac: 0f 92 push r0 244ae: 11 24 eor r1, r1 244b0: 0b b6 in r0, 0x3b ; 59 244b2: 0f 92 push r0 244b4: 8f 93 push r24 244b6: 9f 93 push r25 244b8: ef 93 push r30 244ba: ff 93 push r31 WRITE(BEEPER, 1); 244bc: 9f b7 in r25, 0x3f ; 63 244be: f8 94 cli 244c0: e2 e0 ldi r30, 0x02 ; 2 244c2: f1 e0 ldi r31, 0x01 ; 1 244c4: 80 81 ld r24, Z 244c6: 84 60 ori r24, 0x04 ; 4 244c8: 80 83 st Z, r24 244ca: 9f bf out 0x3f, r25 ; 63 } 244cc: ff 91 pop r31 244ce: ef 91 pop r30 244d0: 9f 91 pop r25 244d2: 8f 91 pop r24 244d4: 0f 90 pop r0 244d6: 0b be out 0x3b, r0 ; 59 244d8: 0f 90 pop r0 244da: 0f be out 0x3f, r0 ; 63 244dc: 0f 90 pop r0 244de: 1f 90 pop r1 244e0: 18 95 reti 000244e2 : if (cval) cval[cl] = sum / cnt; return ++cl; } bool tmc2130_home_calibrate(uint8_t axis) { 244e2: 6f 92 push r6 244e4: 7f 92 push r7 244e6: 8f 92 push r8 244e8: 9f 92 push r9 244ea: af 92 push r10 244ec: bf 92 push r11 244ee: df 92 push r13 244f0: ef 92 push r14 244f2: ff 92 push r15 244f4: 0f 93 push r16 244f6: 1f 93 push r17 244f8: cf 93 push r28 244fa: df 93 push r29 244fc: cd b7 in r28, 0x3d ; 61 244fe: de b7 in r29, 0x3e ; 62 24500: e0 97 sbiw r28, 0x30 ; 48 24502: 0f b6 in r0, 0x3f ; 63 24504: f8 94 cli 24506: de bf out 0x3e, r29 ; 62 24508: 0f be out 0x3f, r0 ; 63 2450a: cd bf out 0x3d, r28 ; 61 2450c: d8 2e mov r13, r24 uint8_t step[16]; uint8_t cnt[16]; uint8_t val[16]; homeaxis(axis, 16, step); 2450e: ae 01 movw r20, r28 24510: 4f 5f subi r20, 0xFF ; 255 24512: 5f 4f sbci r21, 0xFF ; 255 24514: 60 e1 ldi r22, 0x10 ; 16 24516: 0e 94 83 7a call 0xf506 ; 0xf506 bubblesort_uint8(step, 16, 0); 2451a: 50 e0 ldi r21, 0x00 ; 0 2451c: 40 e0 ldi r20, 0x00 ; 0 2451e: 60 e1 ldi r22, 0x10 ; 16 24520: ce 01 movw r24, r28 24522: 01 96 adiw r24, 0x01 ; 1 24524: 0f 94 29 10 call 0x22052 ; 0x22052 puts_P(PSTR("sorted samples:")); 24528: 85 e7 ldi r24, 0x75 ; 117 2452a: 90 ea ldi r25, 0xA0 ; 160 2452c: 0f 94 c0 da call 0x3b580 ; 0x3b580 24530: 9e 01 movw r18, r28 24532: 2f 5f subi r18, 0xFF ; 255 24534: 3f 4f sbci r19, 0xFF ; 255 24536: 59 01 movw r10, r18 24538: 10 e0 ldi r17, 0x00 ; 0 2453a: 00 e0 ldi r16, 0x00 ; 0 for (uint8_t i = 0; i < 16; i++) printf_P(PSTR(" i=%2d step=%2d\n"), i, step[i]); 2453c: 24 e6 ldi r18, 0x64 ; 100 2453e: e2 2e mov r14, r18 24540: 20 ea ldi r18, 0xA0 ; 160 24542: f2 2e mov r15, r18 24544: d5 01 movw r26, r10 24546: 8d 91 ld r24, X+ 24548: 5d 01 movw r10, r26 2454a: 1f 92 push r1 2454c: 8f 93 push r24 2454e: 1f 93 push r17 24550: 0f 93 push r16 24552: ff 92 push r15 24554: ef 92 push r14 24556: 0f 94 99 da call 0x3b532 ; 0x3b532 2455a: 0f 5f subi r16, 0xFF ; 255 2455c: 1f 4f sbci r17, 0xFF ; 255 uint8_t cnt[16]; uint8_t val[16]; homeaxis(axis, 16, step); bubblesort_uint8(step, 16, 0); puts_P(PSTR("sorted samples:")); for (uint8_t i = 0; i < 16; i++) 2455e: 0f 90 pop r0 24560: 0f 90 pop r0 24562: 0f 90 pop r0 24564: 0f 90 pop r0 24566: 0f 90 pop r0 24568: 0f 90 pop r0 2456a: 00 31 cpi r16, 0x10 ; 16 2456c: 11 05 cpc r17, r1 2456e: 51 f7 brne .-44 ; 0x24544 } uint8_t clusterize_uint8(uint8_t* data, uint8_t size, uint8_t* ccnt, uint8_t* cval, uint8_t tol) { uint8_t cnt = 1; uint16_t sum = data[0]; 24570: 09 81 ldd r16, Y+1 ; 0x01 24572: 10 e0 ldi r17, 0x00 ; 0 24574: 5e 01 movw r10, r28 24576: b2 e0 ldi r27, 0x02 ; 2 24578: ab 0e add r10, r27 2457a: b1 1c adc r11, r1 2457c: ee 24 eor r14, r14 2457e: e3 94 inc r14 24580: f1 2c mov r15, r1 24582: ec 0e add r14, r28 24584: fd 1e adc r15, r29 24586: e0 e1 ldi r30, 0x10 ; 16 24588: ee 0e add r14, r30 2458a: f1 1c adc r15, r1 uint8_t cl = 0; 2458c: e0 e0 ldi r30, 0x00 ; 0 } } uint8_t clusterize_uint8(uint8_t* data, uint8_t size, uint8_t* ccnt, uint8_t* cval, uint8_t tol) { uint8_t cnt = 1; 2458e: 21 e0 ldi r18, 0x01 ; 1 uint16_t sum = data[0]; uint8_t cl = 0; for (uint8_t i = 1; i < size; i++) { uint8_t d = data[i]; 24590: d5 01 movw r26, r10 24592: 3d 91 ld r19, X+ 24594: 5d 01 movw r10, r26 uint8_t val = sum / cnt; 24596: 62 2f mov r22, r18 24598: 70 e0 ldi r23, 0x00 ; 0 2459a: c8 01 movw r24, r16 2459c: 0f 94 a0 dc call 0x3b940 ; 0x3b940 <__udivmodhi4> uint8_t dif = 0; if (val > d) dif = val - d; 245a0: 46 2f mov r20, r22 245a2: 43 1b sub r20, r19 245a4: 36 17 cp r19, r22 245a6: 10 f0 brcs .+4 ; 0x245ac else dif = d - val; 245a8: 43 2f mov r20, r19 245aa: 46 1b sub r20, r22 245ac: 83 2f mov r24, r19 245ae: 90 e0 ldi r25, 0x00 ; 0 if (dif <= tol) 245b0: 42 30 cpi r20, 0x02 ; 2 245b2: 08 f0 brcs .+2 ; 0x245b6 245b4: 47 c0 rjmp .+142 ; 0x24644 { cnt += 1; 245b6: 2f 5f subi r18, 0xFF ; 255 sum += d; 245b8: 08 0f add r16, r24 245ba: 19 1f adc r17, r25 uint8_t clusterize_uint8(uint8_t* data, uint8_t size, uint8_t* ccnt, uint8_t* cval, uint8_t tol) { uint8_t cnt = 1; uint16_t sum = data[0]; uint8_t cl = 0; for (uint8_t i = 1; i < size; i++) 245bc: ae 14 cp r10, r14 245be: bf 04 cpc r11, r15 245c0: 39 f7 brne .-50 ; 0x24590 cnt = 1; sum = d; cl += 1; } } if (ccnt) ccnt[cl] = cnt; 245c2: ae 2e mov r10, r30 245c4: b1 2c mov r11, r1 245c6: a1 e1 ldi r26, 0x11 ; 17 245c8: b0 e0 ldi r27, 0x00 ; 0 245ca: ac 0f add r26, r28 245cc: bd 1f adc r27, r29 245ce: aa 0d add r26, r10 245d0: bb 1d adc r27, r11 245d2: 2c 93 st X, r18 if (cval) cval[cl] = sum / cnt; 245d4: 7e 01 movw r14, r28 245d6: b1 e2 ldi r27, 0x21 ; 33 245d8: eb 0e add r14, r27 245da: f1 1c adc r15, r1 245dc: ae 0c add r10, r14 245de: bf 1c adc r11, r15 245e0: 62 2f mov r22, r18 245e2: 70 e0 ldi r23, 0x00 ; 0 245e4: c8 01 movw r24, r16 245e6: 0f 94 a0 dc call 0x3b940 ; 0x3b940 <__udivmodhi4> 245ea: d5 01 movw r26, r10 245ec: 6c 93 st X, r22 return ++cl; 245ee: 11 e0 ldi r17, 0x01 ; 1 245f0: 1e 0f add r17, r30 bubblesort_uint8(step, 16, 0); puts_P(PSTR("sorted samples:")); for (uint8_t i = 0; i < 16; i++) printf_P(PSTR(" i=%2d step=%2d\n"), i, step[i]); uint8_t cl = clusterize_uint8(step, 16, cnt, val, 1); puts_P(PSTR("clusters:")); 245f2: 8a e5 ldi r24, 0x5A ; 90 245f4: 90 ea ldi r25, 0xA0 ; 160 245f6: 0f 94 c0 da call 0x3b580 ; 0x3b580 245fa: fe 01 movw r30, r28 245fc: 71 96 adiw r30, 0x11 ; 17 245fe: 3f 01 movw r6, r30 24600: 57 01 movw r10, r14 for (uint8_t i = 0; i < cl; i++) printf_P(PSTR(" i=%2d cnt=%2d val=%2d\n"), i, cnt[i], val[i]); 24602: 82 e4 ldi r24, 0x42 ; 66 24604: 88 2e mov r8, r24 24606: 80 ea ldi r24, 0xA0 ; 160 24608: 98 2e mov r9, r24 puts_P(PSTR("sorted samples:")); for (uint8_t i = 0; i < 16; i++) printf_P(PSTR(" i=%2d step=%2d\n"), i, step[i]); uint8_t cl = clusterize_uint8(step, 16, cnt, val, 1); puts_P(PSTR("clusters:")); for (uint8_t i = 0; i < cl; i++) 2460a: 8a 2d mov r24, r10 2460c: 8e 19 sub r24, r14 2460e: 81 17 cp r24, r17 24610: 70 f5 brcc .+92 ; 0x2466e 24612: c5 01 movw r24, r10 24614: 8e 19 sub r24, r14 24616: 9f 09 sbc r25, r15 printf_P(PSTR(" i=%2d cnt=%2d val=%2d\n"), i, cnt[i], val[i]); 24618: d5 01 movw r26, r10 2461a: 3d 91 ld r19, X+ 2461c: 5d 01 movw r10, r26 2461e: f3 01 movw r30, r6 24620: 21 91 ld r18, Z+ 24622: 3f 01 movw r6, r30 24624: 1f 92 push r1 24626: 3f 93 push r19 24628: 1f 92 push r1 2462a: 2f 93 push r18 2462c: 9f 93 push r25 2462e: 8f 93 push r24 24630: 9f 92 push r9 24632: 8f 92 push r8 24634: 0f 94 99 da call 0x3b532 ; 0x3b532 24638: 0f b6 in r0, 0x3f ; 63 2463a: f8 94 cli 2463c: de bf out 0x3e, r29 ; 62 2463e: 0f be out 0x3f, r0 ; 63 24640: cd bf out 0x3d, r28 ; 61 24642: e3 cf rjmp .-58 ; 0x2460a 24644: 4e 2f mov r20, r30 24646: 50 e0 ldi r21, 0x00 ; 0 cnt += 1; sum += d; } else { if (ccnt) ccnt[cl] = cnt; 24648: a1 e1 ldi r26, 0x11 ; 17 2464a: b0 e0 ldi r27, 0x00 ; 0 2464c: ac 0f add r26, r28 2464e: bd 1f adc r27, r29 24650: a4 0f add r26, r20 24652: b5 1f adc r27, r21 24654: ef 5f subi r30, 0xFF ; 255 24656: 2c 93 st X, r18 if (cval) cval[cl] = val; 24658: 21 e2 ldi r18, 0x21 ; 33 2465a: 30 e0 ldi r19, 0x00 ; 0 2465c: 2c 0f add r18, r28 2465e: 3d 1f adc r19, r29 24660: 42 0f add r20, r18 24662: 53 1f adc r21, r19 24664: da 01 movw r26, r20 24666: 6c 93 st X, r22 cnt = 1; sum = d; 24668: 8c 01 movw r16, r24 } else { if (ccnt) ccnt[cl] = cnt; if (cval) cval[cl] = val; cnt = 1; 2466a: 21 e0 ldi r18, 0x01 ; 1 2466c: a7 cf rjmp .-178 ; 0x245bc printf_P(PSTR(" i=%2d step=%2d\n"), i, step[i]); uint8_t cl = clusterize_uint8(step, 16, cnt, val, 1); puts_P(PSTR("clusters:")); for (uint8_t i = 0; i < cl; i++) printf_P(PSTR(" i=%2d cnt=%2d val=%2d\n"), i, cnt[i], val[i]); bubblesort_uint8(cnt, cl, val); 2466e: a7 01 movw r20, r14 24670: 61 2f mov r22, r17 24672: ce 01 movw r24, r28 24674: 41 96 adiw r24, 0x11 ; 17 24676: 0f 94 29 10 call 0x22052 ; 0x22052 tmc2130_home_origin[axis] = val[cl-1]; 2467a: fe 01 movw r30, r28 2467c: e1 0f add r30, r17 2467e: f1 1d adc r31, r1 24680: 80 a1 ldd r24, Z+32 ; 0x20 24682: ed 2d mov r30, r13 24684: f0 e0 ldi r31, 0x00 ; 0 24686: ee 50 subi r30, 0x0E ; 14 24688: fb 4f sbci r31, 0xFB ; 251 2468a: 80 83 st Z, r24 printf_P(PSTR("result value: %d\n"), tmc2130_home_origin[axis]); 2468c: 1f 92 push r1 2468e: 8f 93 push r24 24690: 80 e3 ldi r24, 0x30 ; 48 24692: 90 ea ldi r25, 0xA0 ; 160 24694: 9f 93 push r25 24696: 8f 93 push r24 24698: 0f 94 99 da call 0x3b532 ; 0x3b532 if (axis == X_AXIS) eeprom_update_byte_notify((uint8_t*)EEPROM_TMC2130_HOME_X_ORIGIN, tmc2130_home_origin[X_AXIS]); 2469c: 0f 90 pop r0 2469e: 0f 90 pop r0 246a0: 0f 90 pop r0 246a2: 0f 90 pop r0 246a4: 60 91 f2 04 lds r22, 0x04F2 ; 0x8004f2 246a8: 8e ef ldi r24, 0xFE ; 254 246aa: 9e e0 ldi r25, 0x0E ; 14 246ac: dd 20 and r13, r13 246ae: 21 f0 breq .+8 ; 0x246b8 246b0: 60 91 f3 04 lds r22, 0x04F3 ; 0x8004f3 246b4: 8b ef ldi r24, 0xFB ; 251 246b6: 9e e0 ldi r25, 0x0E ; 14 246b8: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 else if (axis == Y_AXIS) eeprom_update_byte_notify((uint8_t*)EEPROM_TMC2130_HOME_Y_ORIGIN, tmc2130_home_origin[Y_AXIS]); return true; } 246bc: 81 e0 ldi r24, 0x01 ; 1 246be: e0 96 adiw r28, 0x30 ; 48 246c0: 0f b6 in r0, 0x3f ; 63 246c2: f8 94 cli 246c4: de bf out 0x3e, r29 ; 62 246c6: 0f be out 0x3f, r0 ; 63 246c8: cd bf out 0x3d, r28 ; 61 246ca: df 91 pop r29 246cc: cf 91 pop r28 246ce: 1f 91 pop r17 246d0: 0f 91 pop r16 246d2: ff 90 pop r15 246d4: ef 90 pop r14 246d6: df 90 pop r13 246d8: bf 90 pop r11 246da: af 90 pop r10 246dc: 9f 90 pop r9 246de: 8f 90 pop r8 246e0: 7f 90 pop r7 246e2: 6f 90 pop r6 246e4: 08 95 ret 000246e6 : delayMicroseconds(TMC2130_SET_DIR_DELAY); } void tmc2130_do_step(uint8_t axis) { switch (axis) 246e6: 81 30 cpi r24, 0x01 ; 1 246e8: 49 f0 breq .+18 ; 0x246fc 246ea: 28 f0 brcs .+10 ; 0x246f6 246ec: 82 30 cpi r24, 0x02 ; 2 246ee: 41 f0 breq .+16 ; 0x24700 246f0: 83 30 cpi r24, 0x03 ; 3 246f2: 41 f0 breq .+16 ; 0x24704 246f4: 08 95 ret { case X_AXIS: _DO_STEP_X; break; 246f6: 81 e0 ldi r24, 0x01 ; 1 case Y_AXIS: _DO_STEP_Y; break; case Z_AXIS: _DO_STEP_Z; break; case E_AXIS: _DO_STEP_E; break; 246f8: 86 b9 out 0x06, r24 ; 6 } } 246fa: 08 95 ret void tmc2130_do_step(uint8_t axis) { switch (axis) { case X_AXIS: _DO_STEP_X; break; case Y_AXIS: _DO_STEP_Y; break; 246fc: 82 e0 ldi r24, 0x02 ; 2 246fe: fc cf rjmp .-8 ; 0x246f8 case Z_AXIS: _DO_STEP_Z; break; 24700: 84 e0 ldi r24, 0x04 ; 4 24702: fa cf rjmp .-12 ; 0x246f8 case E_AXIS: _DO_STEP_E; break; 24704: 88 e0 ldi r24, 0x08 ; 8 24706: f8 cf rjmp .-16 ; 0x246f8 00024708 : } void tmc2130_set_dir(uint8_t axis, uint8_t dir) { switch (axis) 24708: 81 30 cpi r24, 0x01 ; 1 2470a: d1 f0 breq .+52 ; 0x24740 2470c: 48 f0 brcs .+18 ; 0x24720 2470e: 82 30 cpi r24, 0x02 ; 2 24710: 21 f1 breq .+72 ; 0x2475a 24712: 83 30 cpi r24, 0x03 ; 3 24714: 79 f1 breq .+94 ; 0x24774 24716: 8b e4 ldi r24, 0x4B ; 75 24718: 90 e0 ldi r25, 0x00 ; 0 2471a: 01 97 sbiw r24, 0x01 ; 1 2471c: f1 f7 brne .-4 ; 0x2471a case Y_AXIS: _SET_DIR_Y(dir); break; case Z_AXIS: _SET_DIR_Z(dir); break; case E_AXIS: _SET_DIR_E(dir); break; } delayMicroseconds(TMC2130_SET_DIR_DELAY); } 2471e: 08 95 ret void tmc2130_set_dir(uint8_t axis, uint8_t dir) { switch (axis) { case X_AXIS: _SET_DIR_X(dir); break; 24720: 9f b7 in r25, 0x3f ; 63 24722: 66 23 and r22, r22 24724: 41 f0 breq .+16 ; 0x24736 24726: f8 94 cli 24728: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2472c: 81 60 ori r24, 0x01 ; 1 case Y_AXIS: _SET_DIR_Y(dir); break; case Z_AXIS: _SET_DIR_Z(dir); break; case E_AXIS: _SET_DIR_E(dir); break; 2472e: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24732: 9f bf out 0x3f, r25 ; 63 24734: f0 cf rjmp .-32 ; 0x24716 void tmc2130_set_dir(uint8_t axis, uint8_t dir) { switch (axis) { case X_AXIS: _SET_DIR_X(dir); break; 24736: f8 94 cli 24738: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2473c: 8e 7f andi r24, 0xFE ; 254 2473e: f7 cf rjmp .-18 ; 0x2472e case Y_AXIS: _SET_DIR_Y(dir); break; 24740: 9f b7 in r25, 0x3f ; 63 24742: 61 11 cpse r22, r1 24744: 05 c0 rjmp .+10 ; 0x24750 24746: f8 94 cli 24748: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2474c: 82 60 ori r24, 0x02 ; 2 2474e: ef cf rjmp .-34 ; 0x2472e 24750: f8 94 cli 24752: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24756: 8d 7f andi r24, 0xFD ; 253 24758: ea cf rjmp .-44 ; 0x2472e case Z_AXIS: _SET_DIR_Z(dir); break; 2475a: 9f b7 in r25, 0x3f ; 63 2475c: 66 23 and r22, r22 2475e: 29 f0 breq .+10 ; 0x2476a 24760: f8 94 cli 24762: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24766: 84 60 ori r24, 0x04 ; 4 24768: e2 cf rjmp .-60 ; 0x2472e 2476a: f8 94 cli 2476c: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24770: 8b 7f andi r24, 0xFB ; 251 24772: dd cf rjmp .-70 ; 0x2472e case E_AXIS: _SET_DIR_E(dir); break; 24774: 9f b7 in r25, 0x3f ; 63 24776: 61 11 cpse r22, r1 24778: 05 c0 rjmp .+10 ; 0x24784 2477a: f8 94 cli 2477c: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24780: 80 64 ori r24, 0x40 ; 64 24782: d5 cf rjmp .-86 ; 0x2472e 24784: f8 94 cli 24786: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2478a: 8f 7b andi r24, 0xBF ; 191 2478c: d0 cf rjmp .-96 ; 0x2472e 0002478e : tmc2130_cs_high(axis); TMC2130_SPI_LEAVE(); } static uint8_t tmc2130_rx(uint8_t axis, uint8_t addr, uint32_t* rval) { 2478e: cf 92 push r12 24790: df 92 push r13 24792: ef 92 push r14 24794: ff 92 push r15 24796: 0f 93 push r16 24798: 1f 93 push r17 2479a: cf 93 push r28 2479c: df 93 push r29 2479e: 18 2f mov r17, r24 247a0: f6 2e mov r15, r22 247a2: ea 01 movw r28, r20 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 247a4: 0c e5 ldi r16, 0x5C ; 92 247a6: 0c bd out 0x2c, r16 ; 44 SPSR = spsr; 247a8: 1d bc out 0x2d, r1 ; 45 //datagram1 - request TMC2130_SPI_ENTER(); tmc2130_cs_low(axis); 247aa: 0f 94 85 10 call 0x2210a ; 0x2210a TMC2130_SPI_TXRX(addr); // address 247ae: 8f 2d mov r24, r15 247b0: 0f 94 a0 10 call 0x22140 ; 0x22140 TMC2130_SPI_TXRX(0); // MSB 247b4: 80 e0 ldi r24, 0x00 ; 0 247b6: 0f 94 a0 10 call 0x22140 ; 0x22140 TMC2130_SPI_TXRX(0); 247ba: 80 e0 ldi r24, 0x00 ; 0 247bc: 0f 94 a0 10 call 0x22140 ; 0x22140 TMC2130_SPI_TXRX(0); 247c0: 80 e0 ldi r24, 0x00 ; 0 247c2: 0f 94 a0 10 call 0x22140 ; 0x22140 TMC2130_SPI_TXRX(0); // LSB 247c6: 80 e0 ldi r24, 0x00 ; 0 247c8: 0f 94 a0 10 call 0x22140 ; 0x22140 tmc2130_cs_high(axis); 247cc: 81 2f mov r24, r17 247ce: 0f 94 6a 10 call 0x220d4 ; 0x220d4 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 247d2: 0c bd out 0x2c, r16 ; 44 SPSR = spsr; 247d4: 1d bc out 0x2d, r1 ; 45 TMC2130_SPI_LEAVE(); //datagram2 - response TMC2130_SPI_ENTER(); tmc2130_cs_low(axis); 247d6: 81 2f mov r24, r17 247d8: 0f 94 85 10 call 0x2210a ; 0x2210a uint8_t stat = TMC2130_SPI_TXRX(0); // status 247dc: 80 e0 ldi r24, 0x00 ; 0 247de: 0f 94 a0 10 call 0x22140 ; 0x22140 247e2: 08 2f mov r16, r24 uint32_t val32 = 0; val32 = TMC2130_SPI_TXRX(0); // MSB 247e4: 80 e0 ldi r24, 0x00 ; 0 247e6: 0f 94 a0 10 call 0x22140 ; 0x22140 247ea: 90 e0 ldi r25, 0x00 ; 0 247ec: b0 e0 ldi r27, 0x00 ; 0 247ee: a0 e0 ldi r26, 0x00 ; 0 val32 = (val32 << 8) | TMC2130_SPI_TXRX(0); 247f0: cc 24 eor r12, r12 247f2: d8 2e mov r13, r24 247f4: e9 2e mov r14, r25 247f6: fa 2e mov r15, r26 247f8: 80 e0 ldi r24, 0x00 ; 0 247fa: 0f 94 a0 10 call 0x22140 ; 0x22140 247fe: c8 2a or r12, r24 val32 = (val32 << 8) | TMC2130_SPI_TXRX(0); 24800: fe 2c mov r15, r14 24802: ed 2c mov r14, r13 24804: dc 2c mov r13, r12 24806: cc 24 eor r12, r12 24808: 80 e0 ldi r24, 0x00 ; 0 2480a: 0f 94 a0 10 call 0x22140 ; 0x22140 2480e: c8 2a or r12, r24 val32 = (val32 << 8) | TMC2130_SPI_TXRX(0); // LSB 24810: fe 2c mov r15, r14 24812: ed 2c mov r14, r13 24814: dc 2c mov r13, r12 24816: cc 24 eor r12, r12 24818: 80 e0 ldi r24, 0x00 ; 0 2481a: 0f 94 a0 10 call 0x22140 ; 0x22140 2481e: c8 2a or r12, r24 tmc2130_cs_high(axis); 24820: 81 2f mov r24, r17 24822: 0f 94 6a 10 call 0x220d4 ; 0x220d4 TMC2130_SPI_LEAVE(); if (rval != 0) *rval = val32; 24826: c8 82 st Y, r12 24828: d9 82 std Y+1, r13 ; 0x01 2482a: ea 82 std Y+2, r14 ; 0x02 2482c: fb 82 std Y+3, r15 ; 0x03 return stat; } 2482e: 80 2f mov r24, r16 24830: df 91 pop r29 24832: cf 91 pop r28 24834: 1f 91 pop r17 24836: 0f 91 pop r16 24838: ff 90 pop r15 2483a: ef 90 pop r14 2483c: df 90 pop r13 2483e: cf 90 pop r12 24840: 08 95 ret 00024842 : #define TMC2130_SPI_ENTER() spi_setup(TMC2130_SPCR, TMC2130_SPSR) #define TMC2130_SPI_TXRX spi_txrx #define TMC2130_SPI_LEAVE() static void tmc2130_tx(uint8_t axis, uint8_t addr, uint32_t wval) { 24842: ef 92 push r14 24844: ff 92 push r15 24846: 0f 93 push r16 24848: 1f 93 push r17 2484a: cf 93 push r28 2484c: df 93 push r29 2484e: c8 2f mov r28, r24 24850: e6 2e mov r14, r22 24852: d2 2f mov r29, r18 24854: 13 2f mov r17, r19 24856: 04 2f mov r16, r20 24858: f5 2e mov r15, r21 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 2485a: 8c e5 ldi r24, 0x5C ; 92 2485c: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 2485e: 1d bc out 0x2d, r1 ; 45 //datagram1 - request TMC2130_SPI_ENTER(); tmc2130_cs_low(axis); 24860: 8c 2f mov r24, r28 24862: 0f 94 85 10 call 0x2210a ; 0x2210a TMC2130_SPI_TXRX(addr); // address 24866: 8e 2d mov r24, r14 24868: 0f 94 a0 10 call 0x22140 ; 0x22140 TMC2130_SPI_TXRX((wval >> 24) & 0xff); // MSB 2486c: 8f 2d mov r24, r15 2486e: 0f 94 a0 10 call 0x22140 ; 0x22140 TMC2130_SPI_TXRX((wval >> 16) & 0xff); 24872: 80 2f mov r24, r16 24874: 0f 94 a0 10 call 0x22140 ; 0x22140 TMC2130_SPI_TXRX((wval >> 8) & 0xff); 24878: 81 2f mov r24, r17 2487a: 0f 94 a0 10 call 0x22140 ; 0x22140 TMC2130_SPI_TXRX(wval & 0xff); // LSB 2487e: 8d 2f mov r24, r29 24880: 0f 94 a0 10 call 0x22140 ; 0x22140 tmc2130_cs_high(axis); 24884: 8c 2f mov r24, r28 TMC2130_SPI_LEAVE(); } 24886: df 91 pop r29 24888: cf 91 pop r28 2488a: 1f 91 pop r17 2488c: 0f 91 pop r16 2488e: ff 90 pop r15 24890: ef 90 pop r14 TMC2130_SPI_TXRX(addr); // address TMC2130_SPI_TXRX((wval >> 24) & 0xff); // MSB TMC2130_SPI_TXRX((wval >> 16) & 0xff); TMC2130_SPI_TXRX((wval >> 8) & 0xff); TMC2130_SPI_TXRX(wval & 0xff); // LSB tmc2130_cs_high(axis); 24892: 0d 94 6a 10 jmp 0x220d4 ; 0x220d4 00024896 : if (val32 & 0x000f0000) return 0xffff; return val32 & 0xffff; } uint16_t tmc2130_rd_MSCNT(uint8_t axis) { 24896: cf 93 push r28 24898: df 93 push r29 2489a: 00 d0 rcall .+0 ; 0x2489c 2489c: 1f 92 push r1 2489e: cd b7 in r28, 0x3d ; 61 248a0: de b7 in r29, 0x3e ; 62 uint32_t val32 = 0; 248a2: 19 82 std Y+1, r1 ; 0x01 248a4: 1a 82 std Y+2, r1 ; 0x02 248a6: 1b 82 std Y+3, r1 ; 0x03 248a8: 1c 82 std Y+4, r1 ; 0x04 tmc2130_rd(axis, TMC2130_REG_MSCNT, &val32); 248aa: ae 01 movw r20, r28 248ac: 4f 5f subi r20, 0xFF ; 255 248ae: 5f 4f sbci r21, 0xFF ; 255 248b0: 6a e6 ldi r22, 0x6A ; 106 248b2: 0f 94 c7 23 call 0x2478e ; 0x2478e return val32 & 0x3ff; 248b6: 89 81 ldd r24, Y+1 ; 0x01 248b8: 9a 81 ldd r25, Y+2 ; 0x02 } 248ba: 93 70 andi r25, 0x03 ; 3 248bc: 0f 90 pop r0 248be: 0f 90 pop r0 248c0: 0f 90 pop r0 248c2: 0f 90 pop r0 248c4: df 91 pop r29 248c6: cf 91 pop r28 248c8: 08 95 ret 000248ca : #endif //DEBUG_TMC_CURRENTS tmc2130_wr(axis, TMC2130_REG_IHOLD_IRUN, ihold_irun.dw); } void tmc2130_setup_chopper(uint8_t axis, uint8_t mres, const MotorCurrents *curr /* = nullptr */) { 248ca: ff 92 push r15 248cc: 0f 93 push r16 248ce: 1f 93 push r17 248d0: cf 93 push r28 248d2: df 93 push r29 248d4: f8 2e mov r15, r24 248d6: ea 01 movw r28, r20 // Initialise the chopper configuration ChopConfU chopconf = ChopConfU(currents[axis].getvSense(), mres); 248d8: e8 2f mov r30, r24 248da: f0 e0 ldi r31, 0x00 ; 0 248dc: 83 e0 ldi r24, 0x03 ; 3 248de: f8 9e mul r15, r24 248e0: 80 01 movw r16, r0 248e2: 11 24 eor r1, r1 248e4: 03 5a subi r16, 0xA3 ; 163 248e6: 1d 4f sbci r17, 0xFD ; 253 248e8: d8 01 movw r26, r16 248ea: 8c 91 ld r24, X , sync(0) , mres(mres) , intpol(0) , dedge(default_dedge_bit) , diss2g(0) // Short to GND protection is on , reserved(0) {} 248ec: 30 e0 ldi r19, 0x00 ; 0 248ee: 37 7f andi r19, 0xF7 ; 247 248f0: 3f 7e andi r19, 0xEF ; 239 248f2: 3f 7d andi r19, 0xDF ; 223 248f4: 3f 7b andi r19, 0xBF ; 191 248f6: 40 e0 ldi r20, 0x00 ; 0 248f8: 80 fb bst r24, 0 248fa: 41 f9 bld r20, 1 248fc: 43 70 andi r20, 0x03 ; 3 248fe: 56 2f mov r21, r22 24900: 5f 70 andi r21, 0x0F ; 15 24902: 50 62 ori r21, 0x20 ; 32 24904: 5f 7b andi r21, 0xBF ; 191 24906: 5f 77 andi r21, 0x7F ; 127 #endif #if defined(TMC2130_INTPOL_Z) && (TMC2130_INTPOL_Z == 0) if (axis == Z_AXIS) return 0; #endif return (mres != 0); // intpol to 256 only if microsteps aren't 256 24908: 81 e0 ldi r24, 0x01 ; 1 2490a: 61 11 cpse r22, r1 2490c: 01 c0 rjmp .+2 ; 0x24910 2490e: 80 e0 ldi r24, 0x00 ; 0 void tmc2130_setup_chopper(uint8_t axis, uint8_t mres, const MotorCurrents *curr /* = nullptr */) { // Initialise the chopper configuration ChopConfU chopconf = ChopConfU(currents[axis].getvSense(), mres); chopconf.s.intpol = getIntpolBit(axis, mres); 24910: 80 fb bst r24, 0 24912: 54 f9 bld r21, 4 chopconf.s.toff = tmc2130_chopper_config[axis].toff; // toff = 3 (fchop = 27.778kHz) 24914: bf 01 movw r22, r30 24916: 66 0f add r22, r22 24918: 77 1f adc r23, r23 2491a: fb 01 movw r30, r22 2491c: eb 55 subi r30, 0x5B ; 91 2491e: fd 4f sbci r31, 0xFD ; 253 24920: 20 81 ld r18, Z chopconf.s.hstrt = tmc2130_chopper_config[axis].hstr; // initial 4, modified to 5 chopconf.s.hend = tmc2130_chopper_config[axis].hend; // original value = 1 24922: 92 2f mov r25, r18 24924: 99 1f adc r25, r25 24926: 99 27 eor r25, r25 24928: 99 1f adc r25, r25 2492a: 81 81 ldd r24, Z+1 ; 0x01 2492c: 87 70 andi r24, 0x07 ; 7 2492e: 88 0f add r24, r24 24930: 89 2b or r24, r25 24932: 80 fb bst r24, 0 24934: 27 f9 bld r18, 7 24936: 86 95 lsr r24 24938: 87 70 andi r24, 0x07 ; 7 2493a: 38 7f andi r19, 0xF8 ; 248 2493c: 38 2b or r19, r24 chopconf.s.tbl = tmc2130_chopper_config[axis].tbl; //blanking time, original value = 2 2493e: 6a 55 subi r22, 0x5A ; 90 24940: 7d 4f sbci r23, 0xFD ; 253 24942: fb 01 movw r30, r22 24944: 80 81 ld r24, Z 24946: 86 95 lsr r24 24948: 86 95 lsr r24 2494a: 86 95 lsr r24 2494c: 80 fb bst r24, 0 2494e: 37 f9 bld r19, 7 24950: 81 fb bst r24, 1 24952: 40 f9 bld r20, 0 tmc2130_wr(axis, TMC2130_REG_CHOPCONF, chopconf.dw); 24954: 6c ee ldi r22, 0xEC ; 236 24956: 8f 2d mov r24, r15 24958: 0f 94 21 24 call 0x24842 ; 0x24842 if (curr == nullptr) { 2495c: 20 97 sbiw r28, 0x00 ; 0 2495e: 09 f4 brne .+2 ; 0x24962 curr = ¤ts[axis]; 24960: e8 01 movw r28, r16 24962: 19 81 ldd r17, Y+1 ; 0x01 24964: 8a 81 ldd r24, Y+2 ; 0x02 24966: c1 2f mov r28, r17 24968: 81 17 cp r24, r17 2496a: 08 f4 brcc .+2 ; 0x2496e 2496c: c8 2f mov r28, r24 static void SetCurrents(const uint8_t axis, const MotorCurrents &curr) { uint8_t iHold = curr.getiHold(); const uint8_t iRun = curr.getiRun(); // Make sure iHold never exceeds iRun at runtime if (curr.iHoldIsClamped()) { 2496e: 18 17 cp r17, r24 24970: 40 f4 brcc .+16 ; 0x24982 // Let user know firmware modified the value SERIAL_ECHO_START; 24972: 82 ef ldi r24, 0xF2 ; 242 24974: 9b ea ldi r25, 0xAB ; 171 24976: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHOLNRPGM(_n("Hold current truncated to Run current")); 2497a: 88 eb ldi r24, 0xB8 ; 184 2497c: 9e e6 ldi r25, 0x6E ; 110 2497e: 0e 94 93 79 call 0xf326 ; 0xf326 struct S { uint8_t iHold; uint8_t iRun; uint16_t iHoldDelay; constexpr S(uint8_t ih, uint8_t ir) : iHold(ih & 0x1F) 24982: 2c 2f mov r18, r28 24984: 2f 71 andi r18, 0x1F ; 31 , iRun(ir & 0x1F) 24986: 31 2f mov r19, r17 24988: 3f 71 andi r19, 0x1F ; 31 IHoldRun ihold_irun(iHold, iRun); #ifdef DEBUG_TMC_CURRENTS printf_P(PSTR("SetCurrents(axis=%u, iHold=%u, iRun=%u, vsense=%u, reg=%08lX)\n"), axis, iHold, iRun, curr.getvSense(), ihold_irun.dw); #endif //DEBUG_TMC_CURRENTS tmc2130_wr(axis, TMC2130_REG_IHOLD_IRUN, ihold_irun.dw); 2498a: 4f e0 ldi r20, 0x0F ; 15 2498c: 50 e0 ldi r21, 0x00 ; 0 2498e: 60 e9 ldi r22, 0x90 ; 144 24990: 8f 2d mov r24, r15 tmc2130_wr(axis, TMC2130_REG_CHOPCONF, chopconf.dw); if (curr == nullptr) { curr = ¤ts[axis]; } SetCurrents(axis, *curr); } 24992: df 91 pop r29 24994: cf 91 pop r28 24996: 1f 91 pop r17 24998: 0f 91 pop r16 2499a: ff 90 pop r15 IHoldRun ihold_irun(iHold, iRun); #ifdef DEBUG_TMC_CURRENTS printf_P(PSTR("SetCurrents(axis=%u, iHold=%u, iRun=%u, vsense=%u, reg=%08lX)\n"), axis, iHold, iRun, curr.getvSense(), ihold_irun.dw); #endif //DEBUG_TMC_CURRENTS tmc2130_wr(axis, TMC2130_REG_IHOLD_IRUN, ihold_irun.dw); 2499c: 0d 94 21 24 jmp 0x24842 ; 0x24842 000249a0 : return tmc2130_mres2usteps(tmc2130_mres[axis]); } void tmc2130_set_res(uint8_t axis, uint16_t res) { tmc2130_mres[axis] = tmc2130_usteps2mres(res); 249a0: e8 2f mov r30, r24 249a2: f0 e0 ldi r31, 0x00 ; 0 //printf_P(PSTR("MSLUT[%d]=%08lx\n"), i, val); } uint8_t tmc2130_usteps2mres(uint16_t usteps) { uint8_t mres = 8; while (usteps >>= 1) mres--; 249a4: 98 e0 ldi r25, 0x08 ; 8 249a6: 76 95 lsr r23 249a8: 67 95 ror r22 249aa: 61 15 cp r22, r1 249ac: 71 05 cpc r23, r1 249ae: 11 f0 breq .+4 ; 0x249b4 249b0: 91 50 subi r25, 0x01 ; 1 249b2: f9 cf rjmp .-14 ; 0x249a6 return tmc2130_mres2usteps(tmc2130_mres[axis]); } void tmc2130_set_res(uint8_t axis, uint16_t res) { tmc2130_mres[axis] = tmc2130_usteps2mres(res); 249b4: ec 50 subi r30, 0x0C ; 12 249b6: fb 4f sbci r31, 0xFB ; 251 249b8: 90 83 st Z, r25 // uint32_t u = _micros(); tmc2130_setup_chopper(axis, tmc2130_mres[axis]); 249ba: 50 e0 ldi r21, 0x00 ; 0 249bc: 40 e0 ldi r20, 0x00 ; 0 249be: 69 2f mov r22, r25 249c0: 0d 94 65 24 jmp 0x248ca ; 0x248ca 000249c4 : } return 0; } static void tmc2130_XYZ_reg_init(uint8_t axis) { 249c4: 0f 93 push r16 249c6: 1f 93 push r17 249c8: cf 93 push r28 249ca: df 93 push r29 249cc: c8 2f mov r28, r24 tmc2130_setup_chopper(axis, tmc2130_mres[axis]); 249ce: 08 2f mov r16, r24 249d0: 10 e0 ldi r17, 0x00 ; 0 249d2: f8 01 movw r30, r16 249d4: ec 50 subi r30, 0x0C ; 12 249d6: fb 4f sbci r31, 0xFB ; 251 249d8: 50 e0 ldi r21, 0x00 ; 0 249da: 40 e0 ldi r20, 0x00 ; 0 249dc: 60 81 ld r22, Z 249de: 0f 94 65 24 call 0x248ca ; 0x248ca tmc2130_wr(axis, TMC2130_REG_TPOWERDOWN, 0x00000000); 249e2: 20 e0 ldi r18, 0x00 ; 0 249e4: 30 e0 ldi r19, 0x00 ; 0 249e6: a9 01 movw r20, r18 249e8: 61 e9 ldi r22, 0x91 ; 145 249ea: 8c 2f mov r24, r28 249ec: 0f 94 21 24 call 0x24842 ; 0x24842 const bool isStealth = (tmc2130_mode == TMC2130_MODE_SILENT); 249f0: d0 91 8b 06 lds r29, 0x068B ; 0x80068b if (axis == Z_AXIS) { 249f4: c2 30 cpi r28, 0x02 ; 2 249f6: e1 f5 brne .+120 ; 0x24a70 #ifdef TMC2130_STEALTH_Z tmc2130_wr(axis, TMC2130_REG_COOLCONF, (((uint32_t)tmc2130_sg_thr[axis]) << 16) | ((uint32_t)1 << 24)); 249f8: 20 e0 ldi r18, 0x00 ; 0 249fa: 30 e0 ldi r19, 0x00 ; 0 249fc: 44 e0 ldi r20, 0x04 ; 4 249fe: 51 e0 ldi r21, 0x01 ; 1 24a00: 6d ee ldi r22, 0xED ; 237 24a02: 82 e0 ldi r24, 0x02 ; 2 24a04: 0f 94 21 24 call 0x24842 ; 0x24842 tmc2130_wr(axis, TMC2130_REG_TCOOLTHRS, isStealth ? 0 : __tcoolthrs(axis)); 24a08: 24 ef ldi r18, 0xF4 ; 244 24a0a: 31 e0 ldi r19, 0x01 ; 1 24a0c: 40 e0 ldi r20, 0x00 ; 0 24a0e: 50 e0 ldi r21, 0x00 ; 0 24a10: d1 30 cpi r29, 0x01 ; 1 24a12: 19 f4 brne .+6 ; 0x24a1a 24a14: 20 e0 ldi r18, 0x00 ; 0 24a16: 30 e0 ldi r19, 0x00 ; 0 24a18: a9 01 movw r20, r18 24a1a: 64 e9 ldi r22, 0x94 ; 148 24a1c: 82 e0 ldi r24, 0x02 ; 2 24a1e: 0f 94 21 24 call 0x24842 ; 0x24842 tmc2130_wr(axis, TMC2130_REG_GCONF, isStealth ? TMC2130_GCONF_SILENT : TMC2130_GCONF_DYNAMIC_SGSENS); 24a22: 24 e8 ldi r18, 0x84 ; 132 24a24: 31 e0 ldi r19, 0x01 ; 1 24a26: 40 e0 ldi r20, 0x00 ; 0 24a28: 50 e0 ldi r21, 0x00 ; 0 24a2a: d1 30 cpi r29, 0x01 ; 1 24a2c: 21 f4 brne .+8 ; 0x24a36 24a2e: 24 e0 ldi r18, 0x04 ; 4 24a30: 30 e0 ldi r19, 0x00 ; 0 24a32: 40 e0 ldi r20, 0x00 ; 0 24a34: 50 e0 ldi r21, 0x00 ; 0 24a36: 60 e8 ldi r22, 0x80 ; 128 24a38: 82 e0 ldi r24, 0x02 ; 2 24a3a: 0f 94 21 24 call 0x24842 ; 0x24842 tmc2130_wr(axis, TMC2130_REG_PWMCONF, pwmconf[axis].dw); 24a3e: 28 ec ldi r18, 0xC8 ; 200 24a40: 34 e0 ldi r19, 0x04 ; 4 24a42: 46 e0 ldi r20, 0x06 ; 6 24a44: 50 e0 ldi r21, 0x00 ; 0 24a46: 60 ef ldi r22, 0xF0 ; 240 24a48: 82 e0 ldi r24, 0x02 ; 2 24a4a: 0f 94 21 24 call 0x24842 ; 0x24842 tmc2130_wr(axis, TMC2130_REG_TPWMTHRS, isStealth ? 0 : 0xFFFF0); 24a4e: 20 ef ldi r18, 0xF0 ; 240 24a50: 3f ef ldi r19, 0xFF ; 255 24a52: 4f e0 ldi r20, 0x0F ; 15 24a54: 50 e0 ldi r21, 0x00 ; 0 24a56: d1 30 cpi r29, 0x01 ; 1 24a58: 19 f4 brne .+6 ; 0x24a60 24a5a: 20 e0 ldi r18, 0x00 ; 0 24a5c: 30 e0 ldi r19, 0x00 ; 0 24a5e: a9 01 movw r20, r18 24a60: 63 e9 ldi r22, 0x93 ; 147 24a62: 82 e0 ldi r24, 0x02 ; 2 tmc2130_wr(axis, TMC2130_REG_TCOOLTHRS, isStealth ? 0 : __tcoolthrs(axis)); tmc2130_wr(axis, TMC2130_REG_GCONF, isStealth ? TMC2130_GCONF_SILENT : TMC2130_GCONF_SGSENS); tmc2130_wr(axis, TMC2130_REG_PWMCONF, pwmconf[axis].dw); tmc2130_wr(axis, TMC2130_REG_TPWMTHRS, TMC2130_TPWMTHRS); } } 24a64: df 91 pop r29 24a66: cf 91 pop r28 24a68: 1f 91 pop r17 24a6a: 0f 91 pop r16 } else { // X Y tmc2130_wr(axis, TMC2130_REG_COOLCONF, (((uint32_t)tmc2130_sg_thr[axis]) << 16) | ((uint32_t)1 << 24)); tmc2130_wr(axis, TMC2130_REG_TCOOLTHRS, isStealth ? 0 : __tcoolthrs(axis)); tmc2130_wr(axis, TMC2130_REG_GCONF, isStealth ? TMC2130_GCONF_SILENT : TMC2130_GCONF_SGSENS); tmc2130_wr(axis, TMC2130_REG_PWMCONF, pwmconf[axis].dw); tmc2130_wr(axis, TMC2130_REG_TPWMTHRS, TMC2130_TPWMTHRS); 24a6c: 0d 94 21 24 jmp 0x24842 ; 0x24842 tmc2130_wr(axis, TMC2130_REG_TPWMTHRS, isStealth ? 0 : 0xFFFF0); #else // TMC2130_STEALTH_Z tmc2130_wr(axis, TMC2130_REG_GCONF, TMC2130_GCONF_SGSENS); #endif // TMC2130_STEALTH_Z } else { // X Y tmc2130_wr(axis, TMC2130_REG_COOLCONF, (((uint32_t)tmc2130_sg_thr[axis]) << 16) | ((uint32_t)1 << 24)); 24a70: f8 01 movw r30, r16 24a72: e9 5e subi r30, 0xE9 ; 233 24a74: fc 4f sbci r31, 0xFC ; 252 24a76: 20 81 ld r18, Z 24a78: 30 e0 ldi r19, 0x00 ; 0 24a7a: 50 e0 ldi r21, 0x00 ; 0 24a7c: 40 e0 ldi r20, 0x00 ; 0 24a7e: a9 01 movw r20, r18 24a80: 33 27 eor r19, r19 24a82: 22 27 eor r18, r18 24a84: 51 60 ori r21, 0x01 ; 1 24a86: 6d ee ldi r22, 0xED ; 237 24a88: 8c 2f mov r24, r28 24a8a: 0f 94 21 24 call 0x24842 ; 0x24842 tmc2130_wr(axis, TMC2130_REG_TCOOLTHRS, isStealth ? 0 : __tcoolthrs(axis)); 24a8e: 20 e0 ldi r18, 0x00 ; 0 24a90: 30 e0 ldi r19, 0x00 ; 0 24a92: a9 01 movw r20, r18 24a94: d1 30 cpi r29, 0x01 ; 1 24a96: 61 f0 breq .+24 ; 0x24ab0 uint16_t __tcoolthrs(uint8_t axis) { switch (axis) { case X_AXIS: return TMC2130_TCOOLTHRS_X; 24a98: 2e ea ldi r18, 0xAE ; 174 24a9a: 31 e0 ldi r19, 0x01 ; 1 static void tmc2130_tx(uint8_t axis, uint8_t addr, uint32_t wval); static uint8_t tmc2130_rx(uint8_t axis, uint8_t addr, uint32_t* rval); uint16_t __tcoolthrs(uint8_t axis) { switch (axis) 24a9c: c2 30 cpi r28, 0x02 ; 2 24a9e: 30 f0 brcs .+12 ; 0x24aac { case X_AXIS: return TMC2130_TCOOLTHRS_X; case Y_AXIS: return TMC2130_TCOOLTHRS_Y; case Z_AXIS: return TMC2130_TCOOLTHRS_Z; 24aa0: 24 ef ldi r18, 0xF4 ; 244 24aa2: 31 e0 ldi r19, 0x01 ; 1 static void tmc2130_tx(uint8_t axis, uint8_t addr, uint32_t wval); static uint8_t tmc2130_rx(uint8_t axis, uint8_t addr, uint32_t* rval); uint16_t __tcoolthrs(uint8_t axis) { switch (axis) 24aa4: c2 30 cpi r28, 0x02 ; 2 24aa6: 11 f0 breq .+4 ; 0x24aac { case X_AXIS: return TMC2130_TCOOLTHRS_X; case Y_AXIS: return TMC2130_TCOOLTHRS_Y; case Z_AXIS: return TMC2130_TCOOLTHRS_Z; } return 0; 24aa8: 30 e0 ldi r19, 0x00 ; 0 24aaa: 20 e0 ldi r18, 0x00 ; 0 #else // TMC2130_STEALTH_Z tmc2130_wr(axis, TMC2130_REG_GCONF, TMC2130_GCONF_SGSENS); #endif // TMC2130_STEALTH_Z } else { // X Y tmc2130_wr(axis, TMC2130_REG_COOLCONF, (((uint32_t)tmc2130_sg_thr[axis]) << 16) | ((uint32_t)1 << 24)); tmc2130_wr(axis, TMC2130_REG_TCOOLTHRS, isStealth ? 0 : __tcoolthrs(axis)); 24aac: 50 e0 ldi r21, 0x00 ; 0 24aae: 40 e0 ldi r20, 0x00 ; 0 24ab0: 64 e9 ldi r22, 0x94 ; 148 24ab2: 8c 2f mov r24, r28 24ab4: 0f 94 21 24 call 0x24842 ; 0x24842 tmc2130_wr(axis, TMC2130_REG_GCONF, isStealth ? TMC2130_GCONF_SILENT : TMC2130_GCONF_SGSENS); 24ab8: 20 e8 ldi r18, 0x80 ; 128 24aba: 31 e0 ldi r19, 0x01 ; 1 24abc: 40 e0 ldi r20, 0x00 ; 0 24abe: 50 e0 ldi r21, 0x00 ; 0 24ac0: d1 30 cpi r29, 0x01 ; 1 24ac2: 21 f4 brne .+8 ; 0x24acc 24ac4: 24 e0 ldi r18, 0x04 ; 4 24ac6: 30 e0 ldi r19, 0x00 ; 0 24ac8: 40 e0 ldi r20, 0x00 ; 0 24aca: 50 e0 ldi r21, 0x00 ; 0 24acc: 60 e8 ldi r22, 0x80 ; 128 24ace: 8c 2f mov r24, r28 24ad0: 0f 94 21 24 call 0x24842 ; 0x24842 tmc2130_wr(axis, TMC2130_REG_PWMCONF, pwmconf[axis].dw); 24ad4: 00 0f add r16, r16 24ad6: 11 1f adc r17, r17 24ad8: 00 0f add r16, r16 24ada: 11 1f adc r17, r17 24adc: f8 01 movw r30, r16 24ade: e9 5f subi r30, 0xF9 ; 249 24ae0: fc 4f sbci r31, 0xFC ; 252 24ae2: 20 81 ld r18, Z 24ae4: 31 81 ldd r19, Z+1 ; 0x01 24ae6: 42 81 ldd r20, Z+2 ; 0x02 24ae8: 53 81 ldd r21, Z+3 ; 0x03 24aea: 60 ef ldi r22, 0xF0 ; 240 24aec: 8c 2f mov r24, r28 24aee: 0f 94 21 24 call 0x24842 ; 0x24842 tmc2130_wr(axis, TMC2130_REG_TPWMTHRS, TMC2130_TPWMTHRS); 24af2: 20 e0 ldi r18, 0x00 ; 0 24af4: 30 e0 ldi r19, 0x00 ; 0 24af6: a9 01 movw r20, r18 24af8: 63 e9 ldi r22, 0x93 ; 147 24afa: 8c 2f mov r24, r28 24afc: b3 cf rjmp .-154 ; 0x24a64 00024afe : } #endif //TMC2130_SG_HOMING } void tmc2130_home_exit() { 24afe: 1f 93 push r17 24b00: cf 93 push r28 24b02: df 93 push r29 printf_P(PSTR("tmc2130_home_exit tmc2130_sg_homing_axes_mask=0x%02x\n"), tmc2130_sg_homing_axes_mask); 24b04: 80 91 42 06 lds r24, 0x0642 ; 0x800642 24b08: 1f 92 push r1 24b0a: 8f 93 push r24 24b0c: 8a ef ldi r24, 0xFA ; 250 24b0e: 9f e9 ldi r25, 0x9F ; 159 24b10: 9f 93 push r25 24b12: 8f 93 push r24 24b14: 0f 94 99 da call 0x3b532 ; 0x3b532 #ifdef TMC2130_SG_HOMING if (tmc2130_sg_homing_axes_mask & (X_AXIS_MASK | Y_AXIS_MASK)) 24b18: 80 91 42 06 lds r24, 0x0642 ; 0x800642 24b1c: 83 70 andi r24, 0x03 ; 3 24b1e: 0f 90 pop r0 24b20: 0f 90 pop r0 24b22: 0f 90 pop r0 24b24: 0f 90 pop r0 24b26: 11 f0 breq .+4 ; 0x24b2c tmc2130_wait_standstill_xy(1000); 24b28: 0f 94 d3 87 call 0x30fa6 ; 0x30fa6 if (tmc2130_sg_homing_axes_mask) 24b2c: 10 91 42 06 lds r17, 0x0642 ; 0x800642 24b30: 11 23 and r17, r17 24b32: 71 f0 breq .+28 ; 0x24b50 { for (uint8_t axis = X_AXIS, mask = X_AXIS_MASK; axis <= Z_AXIS; axis++, mask <<= 1) //X Y and Z axes 24b34: d1 e0 ldi r29, 0x01 ; 1 24b36: c0 e0 ldi r28, 0x00 ; 0 { if (tmc2130_sg_homing_axes_mask & mask) { 24b38: 81 2f mov r24, r17 24b3a: 8d 23 and r24, r29 24b3c: 19 f0 breq .+6 ; 0x24b44 tmc2130_XYZ_reg_init(axis); 24b3e: 8c 2f mov r24, r28 24b40: 0f 94 e2 24 call 0x249c4 ; 0x249c4 #ifdef TMC2130_SG_HOMING if (tmc2130_sg_homing_axes_mask & (X_AXIS_MASK | Y_AXIS_MASK)) tmc2130_wait_standstill_xy(1000); if (tmc2130_sg_homing_axes_mask) { for (uint8_t axis = X_AXIS, mask = X_AXIS_MASK; axis <= Z_AXIS; axis++, mask <<= 1) //X Y and Z axes 24b44: cf 5f subi r28, 0xFF ; 255 24b46: dd 0f add r29, r29 24b48: c3 30 cpi r28, 0x03 ; 3 24b4a: b1 f7 brne .-20 ; 0x24b38 { if (tmc2130_sg_homing_axes_mask & mask) { tmc2130_XYZ_reg_init(axis); } } tmc2130_sg_homing_axes_mask = 0x00; 24b4c: 10 92 42 06 sts 0x0642, r1 ; 0x800642 } tmc2130_sg_crash = false; 24b50: 10 92 0c 05 sts 0x050C, r1 ; 0x80050c #endif } 24b54: df 91 pop r29 24b56: cf 91 pop r28 24b58: 1f 91 pop r17 24b5a: 08 95 ret 00024b5c : } return false; } void tmc2130_home_enter(uint8_t axes_mask) { 24b5c: df 92 push r13 24b5e: ef 92 push r14 24b60: ff 92 push r15 24b62: 0f 93 push r16 24b64: 1f 93 push r17 24b66: cf 93 push r28 24b68: df 93 push r29 24b6a: 00 d0 rcall .+0 ; 0x24b6c 24b6c: cd b7 in r28, 0x3d ; 61 24b6e: de b7 in r29, 0x3e ; 62 24b70: d8 2e mov r13, r24 printf_P(PSTR("tmc2130_home_enter(axes_mask=0x%02x)\n"), axes_mask); 24b72: 1f 92 push r1 24b74: 8f 93 push r24 24b76: 84 ed ldi r24, 0xD4 ; 212 24b78: 9f e9 ldi r25, 0x9F ; 159 24b7a: 9f 93 push r25 24b7c: 8f 93 push r24 24b7e: 0f 94 99 da call 0x3b532 ; 0x3b532 #ifdef TMC2130_SG_HOMING if (axes_mask & (X_AXIS_MASK | Y_AXIS_MASK)) //X or Y 24b82: 8d 2d mov r24, r13 24b84: 83 70 andi r24, 0x03 ; 3 24b86: 0f 90 pop r0 24b88: 0f 90 pop r0 24b8a: 0f 90 pop r0 24b8c: 0f 90 pop r0 24b8e: 11 f0 breq .+4 ; 0x24b94 tmc2130_wait_standstill_xy(1000); 24b90: 0f 94 d3 87 call 0x30fa6 ; 0x30fa6 } return false; } void tmc2130_home_enter(uint8_t axes_mask) { 24b94: 10 e0 ldi r17, 0x00 ; 0 24b96: 00 e0 ldi r16, 0x00 ; 0 24b98: ff 24 eor r15, r15 24b9a: f3 94 inc r15 24b9c: e0 2e mov r14, r16 #ifdef TMC2130_SG_HOMING if (axes_mask & (X_AXIS_MASK | Y_AXIS_MASK)) //X or Y tmc2130_wait_standstill_xy(1000); for (uint8_t axis = X_AXIS, mask = X_AXIS_MASK; axis <= Z_AXIS; axis++, mask <<= 1) //X Y and Z axes { if (axes_mask & mask) 24b9e: 8d 2d mov r24, r13 24ba0: 8f 21 and r24, r15 24ba2: 09 f4 brne .+2 ; 0x24ba6 24ba4: 46 c0 rjmp .+140 ; 0x24c32 { tmc2130_sg_homing_axes_mask |= mask; 24ba6: 80 91 42 06 lds r24, 0x0642 ; 0x800642 24baa: 8f 29 or r24, r15 24bac: 80 93 42 06 sts 0x0642, r24 ; 0x800642 //Configuration to spreadCycle tmc2130_wr(axis, TMC2130_REG_GCONF, TMC2130_GCONF_NORMAL); 24bb0: 20 e0 ldi r18, 0x00 ; 0 24bb2: 30 e0 ldi r19, 0x00 ; 0 24bb4: a9 01 movw r20, r18 24bb6: 60 e8 ldi r22, 0x80 ; 128 24bb8: 80 2f mov r24, r16 24bba: 0f 94 21 24 call 0x24842 ; 0x24842 tmc2130_wr(axis, TMC2130_REG_COOLCONF, (((uint32_t)tmc2130_sg_thr_home[axis]) << 16)); 24bbe: f8 01 movw r30, r16 24bc0: e9 5e subi r30, 0xE9 ; 233 24bc2: fc 4f sbci r31, 0xFC ; 252 24bc4: 20 81 ld r18, Z 24bc6: 30 e0 ldi r19, 0x00 ; 0 24bc8: 50 e0 ldi r21, 0x00 ; 0 24bca: 40 e0 ldi r20, 0x00 ; 0 24bcc: a9 01 movw r20, r18 24bce: 33 27 eor r19, r19 24bd0: 22 27 eor r18, r18 24bd2: 6d ee ldi r22, 0xED ; 237 24bd4: 80 2f mov r24, r16 24bd6: 0f 94 21 24 call 0x24842 ; 0x24842 static void tmc2130_tx(uint8_t axis, uint8_t addr, uint32_t wval); static uint8_t tmc2130_rx(uint8_t axis, uint8_t addr, uint32_t* rval); uint16_t __tcoolthrs(uint8_t axis) { switch (axis) 24bda: 82 e0 ldi r24, 0x02 ; 2 { case X_AXIS: return TMC2130_TCOOLTHRS_X; case Y_AXIS: return TMC2130_TCOOLTHRS_Y; case Z_AXIS: return TMC2130_TCOOLTHRS_Z; 24bdc: 24 ef ldi r18, 0xF4 ; 244 24bde: 31 e0 ldi r19, 0x01 ; 1 static void tmc2130_tx(uint8_t axis, uint8_t addr, uint32_t wval); static uint8_t tmc2130_rx(uint8_t axis, uint8_t addr, uint32_t* rval); uint16_t __tcoolthrs(uint8_t axis) { switch (axis) 24be0: 08 17 cp r16, r24 24be2: 11 f0 breq .+4 ; 0x24be8 { case X_AXIS: return TMC2130_TCOOLTHRS_X; 24be4: 2e ea ldi r18, 0xAE ; 174 24be6: 31 e0 ldi r19, 0x01 ; 1 { tmc2130_sg_homing_axes_mask |= mask; //Configuration to spreadCycle tmc2130_wr(axis, TMC2130_REG_GCONF, TMC2130_GCONF_NORMAL); tmc2130_wr(axis, TMC2130_REG_COOLCONF, (((uint32_t)tmc2130_sg_thr_home[axis]) << 16)); tmc2130_wr(axis, TMC2130_REG_TCOOLTHRS, __tcoolthrs(axis)); 24be8: 50 e0 ldi r21, 0x00 ; 0 24bea: 40 e0 ldi r20, 0x00 ; 0 24bec: 64 e9 ldi r22, 0x94 ; 148 24bee: 8e 2d mov r24, r14 24bf0: 0f 94 21 24 call 0x24842 ; 0x24842 iRun >>= 1; } } // PROGMEM initializer inline __attribute__((always_inline)) MotorCurrents(const MotorCurrents &curr_P) { memcpy_P(this, &curr_P, sizeof(*this)); } 24bf4: b8 01 movw r22, r16 24bf6: 66 0f add r22, r22 24bf8: 77 1f adc r23, r23 24bfa: 60 0f add r22, r16 24bfc: 71 1f adc r23, r17 24bfe: 68 53 subi r22, 0x38 ; 56 24c00: 70 46 sbci r23, 0x60 ; 96 24c02: 43 e0 ldi r20, 0x03 ; 3 24c04: 50 e0 ldi r21, 0x00 ; 0 24c06: ce 01 movw r24, r28 24c08: 01 96 adiw r24, 0x01 ; 1 24c0a: 0f 94 71 d9 call 0x3b2e2 ; 0x3b2e2 MotorCurrents curr(homing_currents_P[axis]); tmc2130_setup_chopper(axis, tmc2130_mres[axis], &curr); 24c0e: ae 01 movw r20, r28 24c10: 4f 5f subi r20, 0xFF ; 255 24c12: 5f 4f sbci r21, 0xFF ; 255 24c14: f8 01 movw r30, r16 24c16: ec 50 subi r30, 0x0C ; 12 24c18: fb 4f sbci r31, 0xFB ; 251 24c1a: 60 81 ld r22, Z 24c1c: 8e 2d mov r24, r14 24c1e: 0f 94 65 24 call 0x248ca ; 0x248ca tmc2130_wr(axis, TMC2130_REG_GCONF, TMC2130_GCONF_SGSENS); //stallguard output DIAG1, DIAG1 = pushpull 24c22: 20 e8 ldi r18, 0x80 ; 128 24c24: 31 e0 ldi r19, 0x01 ; 1 24c26: 40 e0 ldi r20, 0x00 ; 0 24c28: 50 e0 ldi r21, 0x00 ; 0 24c2a: 60 e8 ldi r22, 0x80 ; 128 24c2c: 8e 2d mov r24, r14 24c2e: 0f 94 21 24 call 0x24842 ; 0x24842 { printf_P(PSTR("tmc2130_home_enter(axes_mask=0x%02x)\n"), axes_mask); #ifdef TMC2130_SG_HOMING if (axes_mask & (X_AXIS_MASK | Y_AXIS_MASK)) //X or Y tmc2130_wait_standstill_xy(1000); for (uint8_t axis = X_AXIS, mask = X_AXIS_MASK; axis <= Z_AXIS; axis++, mask <<= 1) //X Y and Z axes 24c32: ff 0c add r15, r15 24c34: 0f 5f subi r16, 0xFF ; 255 24c36: 1f 4f sbci r17, 0xFF ; 255 24c38: 03 30 cpi r16, 0x03 ; 3 24c3a: 11 05 cpc r17, r1 24c3c: 09 f0 breq .+2 ; 0x24c40 24c3e: ae cf rjmp .-164 ; 0x24b9c tmc2130_setup_chopper(axis, tmc2130_mres[axis], &curr); tmc2130_wr(axis, TMC2130_REG_GCONF, TMC2130_GCONF_SGSENS); //stallguard output DIAG1, DIAG1 = pushpull } } #endif //TMC2130_SG_HOMING } 24c40: 0f 90 pop r0 24c42: 0f 90 pop r0 24c44: 0f 90 pop r0 24c46: df 91 pop r29 24c48: cf 91 pop r28 24c4a: 1f 91 pop r17 24c4c: 0f 91 pop r16 24c4e: ff 90 pop r15 24c50: ef 90 pop r14 24c52: df 90 pop r13 24c54: 08 95 ret 00024c56 : crashdet_stop_and_save_print(); } } void crashdet_use_eeprom_setting() { tmc2130_sg_stop_on_crash = eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET); 24c56: 89 e6 ldi r24, 0x69 ; 105 24c58: 9f e0 ldi r25, 0x0F ; 15 24c5a: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 24c5e: 91 e0 ldi r25, 0x01 ; 1 24c60: 81 11 cpse r24, r1 24c62: 01 c0 rjmp .+2 ; 0x24c66 24c64: 90 e0 ldi r25, 0x00 ; 0 24c66: 90 93 5c 02 sts 0x025C, r25 ; 0x80025c } 24c6a: 08 95 ret 00024c6c : tmc2130_wr(axis, TMC2130_REG_TPWMTHRS, TMC2130_TPWMTHRS); } } void tmc2130_init(TMCInitParams params) { 24c6c: cf 93 push r28 24c6e: c8 2f mov r28, r24 // DBG(_n("tmc2130_init(), mode=%S\n"), tmc2130_mode?_n("STEALTH"):_n("NORMAL")); WRITE(X_TMC2130_CS, HIGH); 24c70: a0 9a sbi 0x14, 0 ; 20 WRITE(Y_TMC2130_CS, HIGH); 24c72: a2 9a sbi 0x14, 2 ; 20 WRITE(Z_TMC2130_CS, HIGH); 24c74: 9f b7 in r25, 0x3f ; 63 24c76: f8 94 cli 24c78: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24c7c: 80 62 ori r24, 0x20 ; 32 24c7e: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24c82: 9f bf out 0x3f, r25 ; 63 WRITE(E0_TMC2130_CS, HIGH); 24c84: 9f b7 in r25, 0x3f ; 63 24c86: f8 94 cli 24c88: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24c8c: 80 61 ori r24, 0x10 ; 16 24c8e: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24c92: 9f bf out 0x3f, r25 ; 63 SET_OUTPUT(X_TMC2130_CS); 24c94: 98 9a sbi 0x13, 0 ; 19 SET_OUTPUT(Y_TMC2130_CS); 24c96: 9a 9a sbi 0x13, 2 ; 19 SET_OUTPUT(Z_TMC2130_CS); 24c98: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 24c9c: 80 62 ori r24, 0x20 ; 32 24c9e: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_OUTPUT(E0_TMC2130_CS); 24ca2: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 24ca6: 80 61 ori r24, 0x10 ; 16 24ca8: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_INPUT(X_TMC2130_DIAG); 24cac: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 24cb0: 8b 7f andi r24, 0xFB ; 251 24cb2: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_INPUT(Y_TMC2130_DIAG); 24cb6: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 24cba: 8f 77 andi r24, 0x7F ; 127 24cbc: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_INPUT(Z_TMC2130_DIAG); 24cc0: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 24cc4: 8f 7b andi r24, 0xBF ; 191 24cc6: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_INPUT(E0_TMC2130_DIAG); 24cca: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 24cce: 87 7f andi r24, 0xF7 ; 247 24cd0: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> WRITE(X_TMC2130_DIAG,HIGH); 24cd4: 9f b7 in r25, 0x3f ; 63 24cd6: f8 94 cli 24cd8: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24cdc: 84 60 ori r24, 0x04 ; 4 24cde: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24ce2: 9f bf out 0x3f, r25 ; 63 WRITE(Y_TMC2130_DIAG,HIGH); 24ce4: 9f b7 in r25, 0x3f ; 63 24ce6: f8 94 cli 24ce8: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24cec: 80 68 ori r24, 0x80 ; 128 24cee: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24cf2: 9f bf out 0x3f, r25 ; 63 WRITE(Z_TMC2130_DIAG,HIGH); 24cf4: 9f b7 in r25, 0x3f ; 63 24cf6: f8 94 cli 24cf8: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24cfc: 80 64 ori r24, 0x40 ; 64 24cfe: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24d02: 9f bf out 0x3f, r25 ; 63 WRITE(E0_TMC2130_DIAG,HIGH); 24d04: 9f b7 in r25, 0x3f ; 63 24d06: f8 94 cli 24d08: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24d0c: 88 60 ori r24, 0x08 ; 8 24d0e: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24d12: 9f bf out 0x3f, r25 ; 63 for (uint_least8_t axis = 0; axis < E_AXIS; axis++) // X Y Z axes { tmc2130_XYZ_reg_init(axis); 24d14: 80 e0 ldi r24, 0x00 ; 0 24d16: 0f 94 e2 24 call 0x249c4 ; 0x249c4 24d1a: 81 e0 ldi r24, 0x01 ; 1 24d1c: 0f 94 e2 24 call 0x249c4 ; 0x249c4 24d20: 82 e0 ldi r24, 0x02 ; 2 24d22: 0f 94 e2 24 call 0x249c4 ; 0x249c4 } // E axis tmc2130_setup_chopper(E_AXIS, tmc2130_mres[E_AXIS]); 24d26: 50 e0 ldi r21, 0x00 ; 0 24d28: 40 e0 ldi r20, 0x00 ; 0 24d2a: 60 91 f7 04 lds r22, 0x04F7 ; 0x8004f7 24d2e: 83 e0 ldi r24, 0x03 ; 3 24d30: 0f 94 65 24 call 0x248ca ; 0x248ca tmc2130_wr(E_AXIS, TMC2130_REG_TPOWERDOWN, 0x00000000); 24d34: 20 e0 ldi r18, 0x00 ; 0 24d36: 30 e0 ldi r19, 0x00 ; 0 24d38: a9 01 movw r20, r18 24d3a: 61 e9 ldi r22, 0x91 ; 145 24d3c: 83 e0 ldi r24, 0x03 ; 3 24d3e: 0f 94 21 24 call 0x24842 ; 0x24842 #ifndef TMC2130_STEALTH_E if( ! params.enableECool ){ 24d42: c1 fd sbrc r28, 1 24d44: 1d c0 rjmp .+58 ; 0x24d80 tmc2130_wr(E_AXIS, TMC2130_REG_GCONF, TMC2130_GCONF_SGSENS); 24d46: 20 e8 ldi r18, 0x80 ; 128 24d48: 31 e0 ldi r19, 0x01 ; 1 24d4a: 40 e0 ldi r20, 0x00 ; 0 24d4c: 50 e0 ldi r21, 0x00 ; 0 24d4e: 60 e8 ldi r22, 0x80 ; 128 24d50: 83 e0 ldi r24, 0x03 ; 3 24d52: 0f 94 21 24 call 0x24842 ; 0x24842 tmc2130_wr(E_AXIS, TMC2130_REG_TPWMTHRS, TMC2130_TPWMTHRS); #endif //TMC2130_STEALTH_E #ifdef TMC2130_LINEARITY_CORRECTION #ifdef TMC2130_LINEARITY_CORRECTION_XYZ tmc2130_set_wave(X_AXIS, 247, tmc2130_wave_fac[X_AXIS]); 24d56: 60 91 f8 04 lds r22, 0x04F8 ; 0x8004f8 24d5a: 80 e0 ldi r24, 0x00 ; 0 24d5c: 0f 94 47 88 call 0x3108e ; 0x3108e tmc2130_set_wave(Y_AXIS, 247, tmc2130_wave_fac[Y_AXIS]); 24d60: 60 91 f9 04 lds r22, 0x04F9 ; 0x8004f9 24d64: 81 e0 ldi r24, 0x01 ; 1 24d66: 0f 94 47 88 call 0x3108e ; 0x3108e tmc2130_set_wave(Z_AXIS, 247, tmc2130_wave_fac[Z_AXIS]); 24d6a: 60 91 fa 04 lds r22, 0x04FA ; 0x8004fa 24d6e: 82 e0 ldi r24, 0x02 ; 2 24d70: 0f 94 47 88 call 0x3108e ; 0x3108e #endif //TMC2130_LINEARITY_CORRECTION_XYZ tmc2130_set_wave(E_AXIS, 247, tmc2130_wave_fac[E_AXIS]); 24d74: 60 91 fb 04 lds r22, 0x04FB ; 0x8004fb 24d78: 83 e0 ldi r24, 0x03 ; 3 #ifdef PSU_Delta if(!params.bSuppressFlag) check_force_z(); #endif // PSU_Delta } 24d7a: cf 91 pop r28 #ifdef TMC2130_LINEARITY_CORRECTION_XYZ tmc2130_set_wave(X_AXIS, 247, tmc2130_wave_fac[X_AXIS]); tmc2130_set_wave(Y_AXIS, 247, tmc2130_wave_fac[Y_AXIS]); tmc2130_set_wave(Z_AXIS, 247, tmc2130_wave_fac[Z_AXIS]); #endif //TMC2130_LINEARITY_CORRECTION_XYZ tmc2130_set_wave(E_AXIS, 247, tmc2130_wave_fac[E_AXIS]); 24d7c: 0d 94 47 88 jmp 0x3108e ; 0x3108e tmc2130_wr(E_AXIS, TMC2130_REG_TPOWERDOWN, 0x00000000); #ifndef TMC2130_STEALTH_E if( ! params.enableECool ){ tmc2130_wr(E_AXIS, TMC2130_REG_GCONF, TMC2130_GCONF_SGSENS); } else { tmc2130_wr(E_AXIS, TMC2130_REG_COOLCONF, (((uint32_t)tmc2130_sg_thr[E_AXIS]) << 16)); 24d80: 20 e0 ldi r18, 0x00 ; 0 24d82: 30 e0 ldi r19, 0x00 ; 0 24d84: 43 e0 ldi r20, 0x03 ; 3 24d86: 50 e0 ldi r21, 0x00 ; 0 24d88: 6d ee ldi r22, 0xED ; 237 24d8a: 83 e0 ldi r24, 0x03 ; 3 24d8c: 0f 94 21 24 call 0x24842 ; 0x24842 tmc2130_wr(E_AXIS, TMC2130_REG_TCOOLTHRS, 0); 24d90: 20 e0 ldi r18, 0x00 ; 0 24d92: 30 e0 ldi r19, 0x00 ; 0 24d94: a9 01 movw r20, r18 24d96: 64 e9 ldi r22, 0x94 ; 148 24d98: 83 e0 ldi r24, 0x03 ; 3 24d9a: 0f 94 21 24 call 0x24842 ; 0x24842 tmc2130_wr(E_AXIS, TMC2130_REG_GCONF, TMC2130_GCONF_SILENT); 24d9e: 24 e0 ldi r18, 0x04 ; 4 24da0: 30 e0 ldi r19, 0x00 ; 0 24da2: 40 e0 ldi r20, 0x00 ; 0 24da4: 50 e0 ldi r21, 0x00 ; 0 24da6: 60 e8 ldi r22, 0x80 ; 128 24da8: 83 e0 ldi r24, 0x03 ; 3 24daa: 0f 94 21 24 call 0x24842 ; 0x24842 tmc2130_wr(E_AXIS, TMC2130_REG_PWMCONF, pwmconf_Ecool.dw); 24dae: 2b e2 ldi r18, 0x2B ; 43 24db0: 34 e5 ldi r19, 0x54 ; 84 24db2: 42 e0 ldi r20, 0x02 ; 2 24db4: 50 e0 ldi r21, 0x00 ; 0 24db6: 60 ef ldi r22, 0xF0 ; 240 24db8: 83 e0 ldi r24, 0x03 ; 3 24dba: 0f 94 21 24 call 0x24842 ; 0x24842 tmc2130_wr(E_AXIS, TMC2130_REG_TPWMTHRS, TMC2130_TPWMTHRS_E); 24dbe: 23 e9 ldi r18, 0x93 ; 147 24dc0: 31 e0 ldi r19, 0x01 ; 1 24dc2: 40 e0 ldi r20, 0x00 ; 0 24dc4: 50 e0 ldi r21, 0x00 ; 0 24dc6: 63 e9 ldi r22, 0x93 ; 147 24dc8: 83 e0 ldi r24, 0x03 ; 3 24dca: 0f 94 21 24 call 0x24842 ; 0x24842 SERIAL_ECHOLNRPGM(eMotorCurrentScalingEnabled); 24dce: 88 ea ldi r24, 0xA8 ; 168 24dd0: 9f e9 ldi r25, 0x9F ; 159 24dd2: 0e 94 93 79 call 0xf326 ; 0xf326 24dd6: bf cf rjmp .-130 ; 0x24d56 00024dd8 : , iHold((ir < 32) ? ih : (ih >> 1)) {} inline uint8_t getiRun() const { return iRun; } inline uint8_t getiHold() const { return min(iHold, iRun); } inline uint8_t getOriginaliRun() const { return vSense ? iRun : iRun << 1; } inline uint8_t getOriginaliHold() const { return min(vSense ? iHold : iHold << 1, getOriginaliRun()); } 24dd8: fc 01 movw r30, r24 24dda: 20 81 ld r18, Z 24ddc: 92 81 ldd r25, Z+2 ; 0x02 24dde: 49 2f mov r20, r25 24de0: 50 e0 ldi r21, 0x00 ; 0 24de2: 21 11 cpse r18, r1 24de4: 02 c0 rjmp .+4 ; 0x24dea 24de6: 44 0f add r20, r20 24de8: 55 1f adc r21, r21 24dea: 81 81 ldd r24, Z+1 ; 0x01 , iRun((ir < 32) ? ir : (ir >> 1)) , iHold((ir < 32) ? ih : (ih >> 1)) {} inline uint8_t getiRun() const { return iRun; } inline uint8_t getiHold() const { return min(iHold, iRun); } inline uint8_t getOriginaliRun() const { return vSense ? iRun : iRun << 1; } 24dec: 21 11 cpse r18, r1 24dee: 01 c0 rjmp .+2 ; 0x24df2 24df0: 88 0f add r24, r24 inline uint8_t getOriginaliHold() const { return min(vSense ? iHold : iHold << 1, getOriginaliRun()); } 24df2: 84 17 cp r24, r20 24df4: 15 06 cpc r1, r21 24df6: 31 f0 breq .+12 ; 0x24e04 24df8: 2c f0 brlt .+10 ; 0x24e04 24dfa: 89 2f mov r24, r25 24dfc: 21 11 cpse r18, r1 24dfe: 02 c0 rjmp .+4 ; 0x24e04 24e00: 88 0f add r24, r24 24e02: 08 95 ret 24e04: 08 95 ret 00024e06 : } unsigned long micros2(void) { unsigned long m; uint8_t oldSREG = SREG, t; 24e06: 3f b7 in r19, 0x3f ; 63 cli(); 24e08: f8 94 cli m = timer2_overflow_count; 24e0a: 80 91 3e 06 lds r24, 0x063E ; 0x80063e 24e0e: 90 91 3f 06 lds r25, 0x063F ; 0x80063f 24e12: a0 91 40 06 lds r26, 0x0640 ; 0x800640 24e16: b0 91 41 06 lds r27, 0x0641 ; 0x800641 #if defined(TCNT2) t = TCNT2; 24e1a: 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)) 24e1e: b8 9b sbis 0x17, 0 ; 23 24e20: 05 c0 rjmp .+10 ; 0x24e2c 24e22: 2f 3f cpi r18, 0xFF ; 255 24e24: 19 f0 breq .+6 ; 0x24e2c m++; 24e26: 01 96 adiw r24, 0x01 ; 1 24e28: a1 1d adc r26, r1 24e2a: b1 1d adc r27, r1 #else if ((TIFR & _BV(TOV2)) && (t < 255)) m++; #endif SREG = oldSREG; 24e2c: 3f bf out 0x3f, r19 ; 63 return ((m << 8) + t) * (64 / clockCyclesPerMicrosecond()); 24e2e: ba 2f mov r27, r26 24e30: a9 2f mov r26, r25 24e32: 98 2f mov r25, r24 24e34: 88 27 eor r24, r24 24e36: bc 01 movw r22, r24 24e38: cd 01 movw r24, r26 24e3a: 62 0f add r22, r18 24e3c: 71 1d adc r23, r1 24e3e: 81 1d adc r24, r1 24e40: 91 1d adc r25, r1 24e42: 42 e0 ldi r20, 0x02 ; 2 24e44: 66 0f add r22, r22 24e46: 77 1f adc r23, r23 24e48: 88 1f adc r24, r24 24e4a: 99 1f adc r25, r25 24e4c: 4a 95 dec r20 24e4e: d1 f7 brne .-12 ; 0x24e44 } 24e50: 08 95 ret 00024e52 : void delay2(unsigned long ms) { 24e52: 8f 92 push r8 24e54: 9f 92 push r9 24e56: af 92 push r10 24e58: bf 92 push r11 24e5a: cf 92 push r12 24e5c: df 92 push r13 24e5e: ef 92 push r14 24e60: ff 92 push r15 24e62: 6b 01 movw r12, r22 24e64: 7c 01 movw r14, r24 uint32_t start = micros2(); 24e66: 0f 94 03 27 call 0x24e06 ; 0x24e06 24e6a: 4b 01 movw r8, r22 24e6c: 5c 01 movw r10, r24 while (ms > 0) { yield(); while ( ms > 0 && (micros2() - start) >= 1000) 24e6e: c1 14 cp r12, r1 24e70: d1 04 cpc r13, r1 24e72: e1 04 cpc r14, r1 24e74: f1 04 cpc r15, r1 24e76: b9 f0 breq .+46 ; 0x24ea6 24e78: 0f 94 03 27 call 0x24e06 ; 0x24e06 24e7c: 68 19 sub r22, r8 24e7e: 79 09 sbc r23, r9 24e80: 8a 09 sbc r24, r10 24e82: 9b 09 sbc r25, r11 24e84: 68 3e cpi r22, 0xE8 ; 232 24e86: 73 40 sbci r23, 0x03 ; 3 24e88: 81 05 cpc r24, r1 24e8a: 91 05 cpc r25, r1 24e8c: 80 f3 brcs .-32 ; 0x24e6e { ms--; 24e8e: 21 e0 ldi r18, 0x01 ; 1 24e90: c2 1a sub r12, r18 24e92: d1 08 sbc r13, r1 24e94: e1 08 sbc r14, r1 24e96: f1 08 sbc r15, r1 start += 1000; 24e98: 88 ee ldi r24, 0xE8 ; 232 24e9a: 88 0e add r8, r24 24e9c: 83 e0 ldi r24, 0x03 ; 3 24e9e: 98 1e adc r9, r24 24ea0: a1 1c adc r10, r1 24ea2: b1 1c adc r11, r1 24ea4: e4 cf rjmp .-56 ; 0x24e6e } } } 24ea6: ff 90 pop r15 24ea8: ef 90 pop r14 24eaa: df 90 pop r13 24eac: cf 90 pop r12 24eae: bf 90 pop r11 24eb0: af 90 pop r10 24eb2: 9f 90 pop r9 24eb4: 8f 90 pop r8 24eb6: 08 95 ret 00024eb8 : * @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() { 24eb8: ef 92 push r14 24eba: ff 92 push r15 24ebc: 0f 93 push r16 24ebe: 1f 93 push r17 24ec0: cf 93 push r28 24ec2: df 93 push r29 24ec4: cd b7 in r28, 0x3d ; 61 24ec6: de b7 in r29, 0x3e ; 62 24ec8: 63 97 sbiw r28, 0x13 ; 19 24eca: 0f b6 in r0, 0x3f ; 63 24ecc: f8 94 cli 24ece: de bf out 0x3e, r29 ; 62 24ed0: 0f be out 0x3f, r0 ; 63 24ed2: 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) 24ed4: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 24ed8: 81 11 cpse r24, r1 24eda: 3a c0 rjmp .+116 ; 0x24f50 { // Menu was entered. // Initialize its status. _md->status = 1; 24edc: 81 e0 ldi r24, 0x01 ; 1 24ede: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 check_babystep(); 24ee2: 0e 94 97 79 call 0xf32e ; 0xf32e if(!eeprom_is_sheet_initialized(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))){ 24ee6: 81 ea ldi r24, 0xA1 ; 161 24ee8: 9d e0 ldi r25, 0x0D ; 13 24eea: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 24eee: 18 2f mov r17, r24 24ef0: 0e 94 59 76 call 0xecb2 ; 0xecb2 24ef4: 81 11 cpse r24, r1 24ef6: ee c0 rjmp .+476 ; 0x250d4 _md->babystepMemZ = 0; 24ef8: 10 92 a9 03 sts 0x03A9, r1 ; 0x8003a9 24efc: 10 92 a8 03 sts 0x03A8, r1 ; 0x8003a8 _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)) 24f00: 80 e1 ldi r24, 0x10 ; 16 24f02: 0e 94 7a ee call 0x1dcf4 ; 0x1dcf4 24f06: 81 11 cpse r24, r1 24f08: 04 c0 rjmp .+8 ; 0x24f12 _md->babystepMemZ = 0; 24f0a: 10 92 a9 03 sts 0x03A9, r1 ; 0x8003a9 24f0e: 10 92 a8 03 sts 0x03A8, r1 ; 0x8003a8 _md->babystepMemMMZ = _md->babystepMemZ/cs.axis_steps_per_mm[Z_AXIS]; 24f12: 60 91 a8 03 lds r22, 0x03A8 ; 0x8003a8 24f16: 70 91 a9 03 lds r23, 0x03A9 ; 0x8003a9 24f1a: 07 2e mov r0, r23 24f1c: 00 0c add r0, r0 24f1e: 88 0b sbc r24, r24 24f20: 99 0b sbc r25, r25 24f22: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 24f26: 20 91 c9 0d lds r18, 0x0DC9 ; 0x800dc9 24f2a: 30 91 ca 0d lds r19, 0x0DCA ; 0x800dca 24f2e: 40 91 cb 0d lds r20, 0x0DCB ; 0x800dcb 24f32: 50 91 cc 0d lds r21, 0x0DCC ; 0x800dcc 24f36: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 24f3a: 60 93 aa 03 sts 0x03AA, r22 ; 0x8003aa 24f3e: 70 93 ab 03 sts 0x03AB, r23 ; 0x8003ab 24f42: 80 93 ac 03 sts 0x03AC, r24 ; 0x8003ac 24f46: 90 93 ad 03 sts 0x03AD, r25 ; 0x8003ad lcd_draw_update = 1; 24f4a: 81 e0 ldi r24, 0x01 ; 1 24f4c: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d //SERIAL_ECHO("Z baby step: "); //SERIAL_ECHO(_md->babystepMem[2]); } if (lcd_encoder != 0) 24f50: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 24f54: 90 91 70 06 lds r25, 0x0670 ; 0x800670 24f58: 00 97 sbiw r24, 0x00 ; 0 24f5a: f1 f1 breq .+124 ; 0x24fd8 { _md->babystepMemZ += lcd_encoder; 24f5c: 20 91 a8 03 lds r18, 0x03A8 ; 0x8003a8 24f60: 30 91 a9 03 lds r19, 0x03A9 ; 0x8003a9 24f64: 28 0f add r18, r24 24f66: 39 1f adc r19, r25 24f68: 30 93 a9 03 sts 0x03A9, r19 ; 0x8003a9 24f6c: 20 93 a8 03 sts 0x03A8, r18 ; 0x8003a8 if (_md->babystepMemZ < Z_BABYSTEP_MIN) _md->babystepMemZ = Z_BABYSTEP_MIN; //-3999 -> -9.99 mm 24f70: 21 36 cpi r18, 0x61 ; 97 24f72: 40 ef ldi r20, 0xF0 ; 240 24f74: 34 07 cpc r19, r20 24f76: 0c f0 brlt .+2 ; 0x24f7a 24f78: ba c0 rjmp .+372 ; 0x250ee 24f7a: 81 e6 ldi r24, 0x61 ; 97 24f7c: 90 ef ldi r25, 0xF0 ; 240 24f7e: 90 93 a9 03 sts 0x03A9, r25 ; 0x8003a9 24f82: 80 93 a8 03 sts 0x03A8, r24 ; 0x8003a8 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]; 24f86: 60 91 a8 03 lds r22, 0x03A8 ; 0x8003a8 24f8a: 70 91 a9 03 lds r23, 0x03A9 ; 0x8003a9 24f8e: 07 2e mov r0, r23 24f90: 00 0c add r0, r0 24f92: 88 0b sbc r24, r24 24f94: 99 0b sbc r25, r25 24f96: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 24f9a: 20 91 c9 0d lds r18, 0x0DC9 ; 0x800dc9 24f9e: 30 91 ca 0d lds r19, 0x0DCA ; 0x800dca 24fa2: 40 91 cb 0d lds r20, 0x0DCB ; 0x800dcb 24fa6: 50 91 cc 0d lds r21, 0x0DCC ; 0x800dcc 24faa: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 24fae: 60 93 aa 03 sts 0x03AA, r22 ; 0x8003aa 24fb2: 70 93 ab 03 sts 0x03AB, r23 ; 0x8003ab 24fb6: 80 93 ac 03 sts 0x03AC, r24 ; 0x8003ac 24fba: 90 93 ad 03 sts 0x03AD, r25 ; 0x8003ad _delay(50); 24fbe: 62 e3 ldi r22, 0x32 ; 50 24fc0: 70 e0 ldi r23, 0x00 ; 0 24fc2: 80 e0 ldi r24, 0x00 ; 0 24fc4: 90 e0 ldi r25, 0x00 ; 0 24fc6: 0f 94 29 27 call 0x24e52 ; 0x24e52 lcd_encoder = 0; 24fca: 10 92 70 06 sts 0x0670, r1 ; 0x800670 24fce: 10 92 6f 06 sts 0x066F, r1 ; 0x80066f lcd_draw_update = 1; 24fd2: 81 e0 ldi r24, 0x01 ; 1 24fd4: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } if (lcd_draw_update) 24fd8: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 24fdc: 88 23 and r24, r24 24fde: c9 f1 breq .+114 ; 0x25052 { SheetFormatBuffer buffer; menu_format_sheet_E(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))], buffer); 24fe0: 81 ea ldi r24, 0xA1 ; 161 24fe2: 9d e0 ldi r25, 0x0D ; 13 24fe4: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 24fe8: 2b e0 ldi r18, 0x0B ; 11 24fea: 82 9f mul r24, r18 24fec: c0 01 movw r24, r0 24fee: 11 24 eor r1, r1 24ff0: be 01 movw r22, r28 24ff2: 6f 5f subi r22, 0xFF ; 255 24ff4: 7f 4f sbci r23, 0xFF ; 255 24ff6: 87 5b subi r24, 0xB7 ; 183 24ff8: 92 4f sbci r25, 0xF2 ; 242 24ffa: 0f 94 eb cf call 0x39fd6 ; 0x39fd6 lcd_home(); 24ffe: 0e 94 24 6f call 0xde48 ; 0xde48 lcd_print(buffer.c); 25002: ce 01 movw r24, r28 25004: 01 96 adiw r24, 0x01 ; 1 25006: 0e 94 ff 70 call 0xe1fe ; 0xe1fe lcd_set_cursor(0, 1); 2500a: 61 e0 ldi r22, 0x01 ; 1 2500c: 80 e0 ldi r24, 0x00 ; 0 2500e: 0e 94 f8 6e call 0xddf0 ; 0xddf0 menu_draw_float13(_T(MSG_BABYSTEPPING_Z), _md->babystepMemMMZ); 25012: 10 91 aa 03 lds r17, 0x03AA ; 0x8003aa 25016: 00 91 ab 03 lds r16, 0x03AB ; 0x8003ab 2501a: f0 90 ac 03 lds r15, 0x03AC ; 0x8003ac 2501e: e0 90 ad 03 lds r14, 0x03AD ; 0x8003ad 25022: 8f e8 ldi r24, 0x8F ; 143 25024: 91 e5 ldi r25, 0x51 ; 81 25026: 0e 94 c4 72 call 0xe588 ; 0xe588 //! (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); 2502a: ef 92 push r14 2502c: ff 92 push r15 2502e: 0f 93 push r16 25030: 1f 93 push r17 25032: 9f 93 push r25 25034: 8f 93 push r24 25036: 1f 92 push r1 25038: 80 e2 ldi r24, 0x20 ; 32 2503a: 8f 93 push r24 2503c: 85 e7 ldi r24, 0x75 ; 117 2503e: 93 ea ldi r25, 0xA3 ; 163 25040: 9f 93 push r25 25042: 8f 93 push r24 25044: 0e 94 d1 6e call 0xdda2 ; 0xdda2 25048: 0f b6 in r0, 0x3f ; 63 2504a: f8 94 cli 2504c: de bf out 0x3e, r29 ; 62 2504e: 0f be out 0x3f, r0 ; 63 25050: cd bf out 0x3d, r28 ; 61 } if (LCD_CLICKED || menu_leaving) 25052: 80 91 a6 03 lds r24, 0x03A6 ; 0x8003a6 25056: 81 11 cpse r24, r1 25058: 04 c0 rjmp .+8 ; 0x25062 2505a: 80 91 d5 03 lds r24, 0x03D5 ; 0x8003d5 2505e: 88 23 and r24, r24 25060: 51 f1 breq .+84 ; 0x250b6 { // Only update the EEPROM when leaving the menu. uint8_t active_sheet=eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 25062: 81 ea ldi r24, 0xA1 ; 161 25064: 9d e0 ldi r25, 0x0D ; 13 25066: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 2506a: 9b e0 ldi r25, 0x0B ; 11 2506c: 89 9f mul r24, r25 2506e: 80 01 movw r16, r0 25070: 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); 25072: 60 91 a8 03 lds r22, 0x03A8 ; 0x8003a8 25076: 70 91 a9 03 lds r23, 0x03A9 ; 0x8003a9 2507a: c8 01 movw r24, r16 2507c: 80 5b subi r24, 0xB0 ; 176 2507e: 92 4f sbci r25, 0xF2 ; 242 25080: 0f 94 19 dc call 0x3b832 ; 0x3b832 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 25084: 60 91 71 06 lds r22, 0x0671 ; 0x800671 25088: c8 01 movw r24, r16 2508a: 8e 5a subi r24, 0xAE ; 174 2508c: 92 4f sbci r25, 0xF2 ; 242 2508e: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 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); 25092: 60 91 97 03 lds r22, 0x0397 ; 0x800397 25096: 70 91 98 03 lds r23, 0x0398 ; 0x800398 2509a: 80 91 99 03 lds r24, 0x0399 ; 0x800399 2509e: 90 91 9a 03 lds r25, 0x039A ; 0x80039a 250a2: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 250a6: c8 01 movw r24, r16 250a8: 8d 5a subi r24, 0xAD ; 173 250aa: 92 4f sbci r25, 0xF2 ; 242 250ac: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 #endif //PINDA_THERMISTOR calibration_status_set(CALIBRATION_STATUS_LIVE_ADJUST); 250b0: 80 e1 ldi r24, 0x10 ; 16 250b2: 0e 94 6d ee call 0x1dcda ; 0x1dcda } menu_back_if_clicked(); 250b6: 0f 94 bb d4 call 0x3a976 ; 0x3a976 } 250ba: 63 96 adiw r28, 0x13 ; 19 250bc: 0f b6 in r0, 0x3f ; 63 250be: f8 94 cli 250c0: de bf out 0x3e, r29 ; 62 250c2: 0f be out 0x3f, r0 ; 63 250c4: cd bf out 0x3d, r28 ; 61 250c6: df 91 pop r29 250c8: cf 91 pop r28 250ca: 1f 91 pop r17 250cc: 0f 91 pop r16 250ce: ff 90 pop r15 250d0: ef 90 pop r14 250d2: 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-> 250d4: 2b e0 ldi r18, 0x0B ; 11 250d6: 12 9f mul r17, r18 250d8: c0 01 movw r24, r0 250da: 11 24 eor r1, r1 250dc: 80 5b subi r24, 0xB0 ; 176 250de: 92 4f sbci r25, 0xF2 ; 242 250e0: 0f 94 e5 db call 0x3b7ca ; 0x3b7ca 250e4: 90 93 a9 03 sts 0x03A9, r25 ; 0x8003a9 250e8: 80 93 a8 03 sts 0x03A8, r24 ; 0x8003a8 250ec: 09 cf rjmp .-494 ; 0x24f00 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 250ee: 12 16 cp r1, r18 250f0: 13 06 cpc r1, r19 250f2: 2c f4 brge .+10 ; 0x250fe 250f4: 10 92 a9 03 sts 0x03A9, r1 ; 0x8003a9 250f8: 10 92 a8 03 sts 0x03A8, r1 ; 0x8003a8 250fc: 44 cf rjmp .-376 ; 0x24f86 extern volatile int babystepsTodo[3]; inline void babystepsTodoZadd(int n) { if (n != 0) { CRITICAL_SECTION_START 250fe: 2f b7 in r18, 0x3f ; 63 25100: f8 94 cli babystepsTodo[Z_AXIS] += n; 25102: 40 91 6c 06 lds r20, 0x066C ; 0x80066c 25106: 50 91 6d 06 lds r21, 0x066D ; 0x80066d 2510a: 84 0f add r24, r20 2510c: 95 1f adc r25, r21 2510e: 90 93 6d 06 sts 0x066D, r25 ; 0x80066d 25112: 80 93 6c 06 sts 0x066C, r24 ; 0x80066c CRITICAL_SECTION_END 25116: 2f bf out 0x3f, r18 ; 63 25118: 36 cf rjmp .-404 ; 0x24f86 0002511a : } void lcd_move_e() { if ((int)degHotend0() > extrude_min_temp) 2511a: 60 91 af 0d lds r22, 0x0DAF ; 0x800daf 2511e: 70 91 b0 0d lds r23, 0x0DB0 ; 0x800db0 25122: 80 91 b1 0d lds r24, 0x0DB1 ; 0x800db1 25126: 90 91 b2 0d lds r25, 0x0DB2 ; 0x800db2 2512a: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> 2512e: 20 91 6b 02 lds r18, 0x026B ; 0x80026b 25132: 30 91 6c 02 lds r19, 0x026C ; 0x80026c 25136: 26 17 cp r18, r22 25138: 37 07 cpc r19, r23 2513a: 0c f0 brlt .+2 ; 0x2513e 2513c: 65 c0 rjmp .+202 ; 0x25208 { if (lcd_encoder != 0) 2513e: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 25142: 90 91 70 06 lds r25, 0x0670 ; 0x800670 25146: 89 2b or r24, r25 25148: b9 f1 breq .+110 ; 0x251b8 { refresh_cmd_timeout(); 2514a: 0e 94 db 66 call 0xcdb6 ; 0xcdb6 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; 2514e: 80 91 a4 0d lds r24, 0x0DA4 ; 0x800da4 if (++ next_block_index == BLOCK_BUFFER_SIZE) 25152: 8f 5f subi r24, 0xFF ; 255 25154: 80 31 cpi r24, 0x10 ; 16 25156: 09 f4 brne .+2 ; 0x2515a next_block_index = 0; 25158: 80 e0 ldi r24, 0x00 ; 0 return block_buffer_tail == next_block_index; 2515a: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 if (! planner_queue_full()) 2515e: 98 17 cp r25, r24 25160: 59 f1 breq .+86 ; 0x251b8 { current_position[E_AXIS] += lcd_encoder; 25162: 60 91 6f 06 lds r22, 0x066F ; 0x80066f 25166: 70 91 70 06 lds r23, 0x0670 ; 0x800670 2516a: 07 2e mov r0, r23 2516c: 00 0c add r0, r0 2516e: 88 0b sbc r24, r24 25170: 99 0b sbc r25, r25 25172: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 25176: 9b 01 movw r18, r22 25178: ac 01 movw r20, r24 2517a: 60 91 9d 06 lds r22, 0x069D ; 0x80069d 2517e: 70 91 9e 06 lds r23, 0x069E ; 0x80069e 25182: 80 91 9f 06 lds r24, 0x069F ; 0x80069f 25186: 90 91 a0 06 lds r25, 0x06A0 ; 0x8006a0 2518a: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 2518e: 60 93 9d 06 sts 0x069D, r22 ; 0x80069d 25192: 70 93 9e 06 sts 0x069E, r23 ; 0x80069e 25196: 80 93 9f 06 sts 0x069F, r24 ; 0x80069f 2519a: 90 93 a0 06 sts 0x06A0, r25 ; 0x8006a0 lcd_encoder = 0; 2519e: 10 92 70 06 sts 0x0670, r1 ; 0x800670 251a2: 10 92 6f 06 sts 0x066F, r1 ; 0x80066f plan_buffer_line_curposXYZE(manual_feedrate[E_AXIS] / 60); 251a6: 65 e5 ldi r22, 0x55 ; 85 251a8: 75 e5 ldi r23, 0x55 ; 85 251aa: 85 ed ldi r24, 0xD5 ; 213 251ac: 9f e3 ldi r25, 0x3F ; 63 251ae: 0f 94 04 c0 call 0x38008 ; 0x38008 lcd_draw_update = 1; 251b2: 81 e0 ldi r24, 0x01 ; 1 251b4: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } } if (lcd_draw_update) 251b8: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 251bc: 88 23 and r24, r24 251be: 11 f1 breq .+68 ; 0x25204 { lcd_set_cursor(0, 1); 251c0: 61 e0 ldi r22, 0x01 ; 1 251c2: 80 e0 ldi r24, 0x00 ; 0 251c4: 0e 94 f8 6e call 0xddf0 ; 0xddf0 //! 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); 251c8: 80 91 a0 06 lds r24, 0x06A0 ; 0x8006a0 251cc: 8f 93 push r24 251ce: 80 91 9f 06 lds r24, 0x069F ; 0x80069f 251d2: 8f 93 push r24 251d4: 80 91 9e 06 lds r24, 0x069E ; 0x80069e 251d8: 8f 93 push r24 251da: 80 91 9d 06 lds r24, 0x069D ; 0x80069d 251de: 8f 93 push r24 251e0: 87 e5 ldi r24, 0x57 ; 87 251e2: 93 ea ldi r25, 0xA3 ; 163 251e4: 9f 93 push r25 251e6: 8f 93 push r24 251e8: 88 e4 ldi r24, 0x48 ; 72 251ea: 93 ea ldi r25, 0xA3 ; 163 251ec: 9f 93 push r25 251ee: 8f 93 push r24 251f0: 0e 94 d1 6e call 0xdda2 ; 0xdda2 251f4: 8d b7 in r24, 0x3d ; 61 251f6: 9e b7 in r25, 0x3e ; 62 251f8: 08 96 adiw r24, 0x08 ; 8 251fa: 0f b6 in r0, 0x3f ; 63 251fc: f8 94 cli 251fe: 9e bf out 0x3e, r25 ; 62 25200: 0f be out 0x3f, r0 ; 63 25202: 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(); 25204: 0d 94 bb d4 jmp 0x3a976 ; 0x3a976 }; } void show_preheat_nozzle_warning() { lcd_clear(); 25208: 0e 94 2b 6f call 0xde56 ; 0xde56 lcd_puts_at_P(0, 0, _T(MSG_ERROR)); 2520c: 80 e2 ldi r24, 0x20 ; 32 2520e: 91 e5 ldi r25, 0x51 ; 81 25210: 0e 94 c4 72 call 0xe588 ; 0xe588 25214: ac 01 movw r20, r24 25216: 60 e0 ldi r22, 0x00 ; 0 25218: 80 e0 ldi r24, 0x00 ; 0 2521a: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_puts_at_P(0, 2, _T(MSG_PREHEAT_NOZZLE)); 2521e: 8a e0 ldi r24, 0x0A ; 10 25220: 91 e5 ldi r25, 0x51 ; 81 25222: 0e 94 c4 72 call 0xe588 ; 0xe588 25226: ac 01 movw r20, r24 25228: 62 e0 ldi r22, 0x02 ; 2 2522a: 80 e0 ldi r24, 0x00 ; 0 2522c: 0e 94 0c 6f call 0xde18 ; 0xde18 _delay(2000); 25230: 60 ed ldi r22, 0xD0 ; 208 25232: 77 e0 ldi r23, 0x07 ; 7 25234: 80 e0 ldi r24, 0x00 ; 0 25236: 90 e0 ldi r25, 0x00 ; 0 25238: 0f 94 29 27 call 0x24e52 ; 0x24e52 lcd_clear(); 2523c: 0e 94 2b 6f call 0xde56 ; 0xde56 menu_back_if_clicked(); } else { show_preheat_nozzle_warning(); lcd_return_to_status(); 25240: 0d 94 7c 1e jmp 0x23cf8 ; 0x23cf8 00025244 : } unsigned long millis2(void) { unsigned long m; uint8_t oldSREG = SREG; 25244: 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(); 25246: f8 94 cli m = timer2_millis; 25248: 60 91 3a 06 lds r22, 0x063A ; 0x80063a 2524c: 70 91 3b 06 lds r23, 0x063B ; 0x80063b 25250: 80 91 3c 06 lds r24, 0x063C ; 0x80063c 25254: 90 91 3d 06 lds r25, 0x063D ; 0x80063d SREG = oldSREG; 25258: 2f bf out 0x3f, r18 ; 63 return m; } 2525a: 08 95 ret 0002525c : } //! @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); 2525c: 20 e0 ldi r18, 0x00 ; 0 2525e: 30 e0 ldi r19, 0x00 ; 0 25260: 40 e8 ldi r20, 0x80 ; 128 25262: 5f eb ldi r21, 0xBF ; 191 25264: 60 e0 ldi r22, 0x00 ; 0 25266: 70 e0 ldi r23, 0x00 ; 0 25268: cb 01 movw r24, r22 2526a: 0e 94 4f 89 call 0x1129e ; 0x1129e SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_PAUSED); 2526e: 8c e3 ldi r24, 0x3C ; 60 25270: 9f e6 ldi r25, 0x6F ; 111 25272: 0e 94 93 79 call 0xf326 ; 0xf326 // Indicate that the printer is paused did_pause_print = true; 25276: 81 e0 ldi r24, 0x01 ; 1 25278: 80 93 e2 03 sts 0x03E2, r24 ; 0x8003e2 } else return false; } bool Stopwatch::pause() { if (isRunning()) { 2527c: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 25280: 81 30 cpi r24, 0x01 ; 1 25282: 69 f4 brne .+26 ; 0x2529e state = PAUSED; 25284: 82 e0 ldi r24, 0x02 ; 2 25286: 80 93 9b 03 sts 0x039B, r24 ; 0x80039b stopTimestamp = _millis(); 2528a: 0f 94 22 29 call 0x25244 ; 0x25244 2528e: 60 93 51 06 sts 0x0651, r22 ; 0x800651 25292: 70 93 52 06 sts 0x0652, r23 ; 0x800652 25296: 80 93 53 06 sts 0x0653, r24 ; 0x800653 2529a: 90 93 54 06 sts 0x0654, r25 ; 0x800654 print_job_timer.pause(); // return to status is required to continue processing in the main loop! lcd_commands_type = LcdCommands::LongPause; 2529e: 82 e0 ldi r24, 0x02 ; 2 252a0: 80 93 b3 0d sts 0x0DB3, r24 ; 0x800db3 lcd_return_to_status(); 252a4: 0d 94 7c 1e jmp 0x23cf8 ; 0x23cf8 000252a8 ::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) 252a8: ff 92 push r15 252aa: 0f 93 push r16 252ac: 1f 93 push r17 252ae: cf 93 push r28 252b0: df 93 push r29 { if (!m_isRunning) return false; 252b2: fc 01 movw r30, r24 252b4: f0 80 ld r15, Z 252b6: f1 10 cpse r15, r1 252b8: 08 c0 rjmp .+16 ; 0x252ca ::expired(unsigned short)+0x22> 252ba: f1 2c mov r15, r1 expired = true; } } if (expired) m_isRunning = false; return expired; } 252bc: 8f 2d mov r24, r15 252be: df 91 pop r29 252c0: cf 91 pop r28 252c2: 1f 91 pop r17 252c4: 0f 91 pop r16 252c6: ff 90 pop r15 252c8: 08 95 ret 252ca: 8b 01 movw r16, r22 252cc: ec 01 movw r28, r24 template bool Timer::expired(T msPeriod) { if (!m_isRunning) return false; bool expired = false; const T now = _millis(); 252ce: 0f 94 22 29 call 0x25244 ; 0x25244 if (m_started <= m_started + msPeriod) 252d2: 89 81 ldd r24, Y+1 ; 0x01 252d4: 9a 81 ldd r25, Y+2 ; 0x02 252d6: 08 0f add r16, r24 252d8: 19 1f adc r17, r25 252da: 08 17 cp r16, r24 252dc: 19 07 cpc r17, r25 252de: 40 f0 brcs .+16 ; 0x252f0 ::expired(unsigned short)+0x48> { if ((now >= m_started + msPeriod) || (now < m_started)) 252e0: 60 17 cp r22, r16 252e2: 71 07 cpc r23, r17 252e4: 18 f4 brcc .+6 ; 0x252ec ::expired(unsigned short)+0x44> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 252e6: 68 17 cp r22, r24 252e8: 79 07 cpc r23, r25 252ea: 38 f7 brcc .-50 ; 0x252ba ::expired(unsigned short)+0x12> { expired = true; } } if (expired) m_isRunning = false; 252ec: 18 82 st Y, r1 252ee: e6 cf rjmp .-52 ; 0x252bc ::expired(unsigned short)+0x14> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 252f0: 60 17 cp r22, r16 252f2: 71 07 cpc r23, r17 252f4: c0 f7 brcc .-16 ; 0x252e6 ::expired(unsigned short)+0x3e> 252f6: e1 cf rjmp .-62 ; 0x252ba ::expired(unsigned short)+0x12> 000252f8 ::expired_cont(unsigned short)>: } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 252f8: fc 01 movw r30, r24 252fa: 20 81 ld r18, Z 252fc: 21 11 cpse r18, r1 252fe: 0d 94 54 29 jmp 0x252a8 ; 0x252a8 ::expired(unsigned short)> } 25302: 81 e0 ldi r24, 0x01 ; 1 25304: 08 95 ret 00025306 ::start()>: /** * @brief Start timer */ template void Timer::start() 25306: cf 93 push r28 25308: df 93 push r29 2530a: ec 01 movw r28, r24 { m_started = _millis(); 2530c: 0f 94 22 29 call 0x25244 ; 0x25244 25310: 7a 83 std Y+2, r23 ; 0x02 25312: 69 83 std Y+1, r22 ; 0x01 m_isRunning = true; 25314: 81 e0 ldi r24, 0x01 ; 1 25316: 88 83 st Y, r24 } 25318: df 91 pop r29 2531a: cf 91 pop r28 2531c: 08 95 ret 0002531e : TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTO); } static uint8_t twi_wait(uint8_t status) { 2531e: 1f 93 push r17 25320: cf 93 push r28 25322: df 93 push r29 25324: 00 d0 rcall .+0 ; 0x25326 25326: cd b7 in r28, 0x3d ; 61 25328: de b7 in r29, 0x3e ; 62 2532a: 18 2f mov r17, r24 ShortTimer timmy; 2532c: 19 82 std Y+1, r1 ; 0x01 2532e: 1b 82 std Y+3, r1 ; 0x03 25330: 1a 82 std Y+2, r1 ; 0x02 timmy.start(); 25332: ce 01 movw r24, r28 25334: 01 96 adiw r24, 0x01 ; 1 25336: 0f 94 83 29 call 0x25306 ; 0x25306 ::start()> while(!(TWCR & _BV(TWINT))) { 2533a: 80 91 bc 00 lds r24, 0x00BC ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> 2533e: 87 fd sbrc r24, 7 25340: 0a c0 rjmp .+20 ; 0x25356 if (timmy.expired(TWI_TIMEOUT_MS)) { 25342: 6a e0 ldi r22, 0x0A ; 10 25344: 70 e0 ldi r23, 0x00 ; 0 25346: ce 01 movw r24, r28 25348: 01 96 adiw r24, 0x01 ; 1 2534a: 0f 94 54 29 call 0x252a8 ; 0x252a8 ::expired(unsigned short)> 2534e: 88 23 and r24, r24 25350: a1 f3 breq .-24 ; 0x2533a return 2; 25352: 82 e0 ldi r24, 0x02 ; 2 25354: 09 c0 rjmp .+18 ; 0x25368 } } if(TW_STATUS != status) 25356: 80 91 b9 00 lds r24, 0x00B9 ; 0x8000b9 <__TEXT_REGION_LENGTH__+0x7c20b9> 2535a: 88 7f andi r24, 0xF8 ; 248 2535c: 18 17 cp r17, r24 2535e: 59 f0 breq .+22 ; 0x25376 } static void twi_stop() { TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTO); 25360: 84 e9 ldi r24, 0x94 ; 148 25362: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> } } if(TW_STATUS != status) { twi_stop(); return 1; 25366: 81 e0 ldi r24, 0x01 ; 1 } return 0; } 25368: 0f 90 pop r0 2536a: 0f 90 pop r0 2536c: 0f 90 pop r0 2536e: df 91 pop r29 25370: cf 91 pop r28 25372: 1f 91 pop r17 25374: 08 95 ret if(TW_STATUS != status) { twi_stop(); return 1; } return 0; 25376: 80 e0 ldi r24, 0x00 ; 0 25378: f7 cf rjmp .-18 ; 0x25368 0002537a : } return standstill; } void tmc2130_check_overtemp() { 2537a: 1f 93 push r17 2537c: cf 93 push r28 2537e: df 93 push r29 25380: 00 d0 rcall .+0 ; 0x25382 25382: 1f 92 push r1 25384: cd b7 in r28, 0x3d ; 61 25386: de b7 in r29, 0x3e ; 62 if (tmc2130_overtemp_timer.expired_cont(1000)) 25388: 68 ee ldi r22, 0xE8 ; 232 2538a: 73 e0 ldi r23, 0x03 ; 3 2538c: 83 e4 ldi r24, 0x43 ; 67 2538e: 96 e0 ldi r25, 0x06 ; 6 25390: 0f 94 7c 29 call 0x252f8 ; 0x252f8 ::expired_cont(unsigned short)> 25394: 88 23 and r24, r24 25396: 91 f1 breq .+100 ; 0x253fc { for (uint_least8_t i = 0; i < 4; i++) 25398: 10 e0 ldi r17, 0x00 ; 0 { uint32_t drv_status = 0; 2539a: 19 82 std Y+1, r1 ; 0x01 2539c: 1a 82 std Y+2, r1 ; 0x02 2539e: 1b 82 std Y+3, r1 ; 0x03 253a0: 1c 82 std Y+4, r1 ; 0x04 tmc2130_rd(i, TMC2130_REG_DRV_STATUS, &drv_status); 253a2: ae 01 movw r20, r28 253a4: 4f 5f subi r20, 0xFF ; 255 253a6: 5f 4f sbci r21, 0xFF ; 255 253a8: 6f e6 ldi r22, 0x6F ; 111 253aa: 81 2f mov r24, r17 253ac: 0f 94 c7 23 call 0x2478e ; 0x2478e if (drv_status & ((uint32_t)1 << 26)) 253b0: 89 81 ldd r24, Y+1 ; 0x01 253b2: 9a 81 ldd r25, Y+2 ; 0x02 253b4: ab 81 ldd r26, Y+3 ; 0x03 253b6: bc 81 ldd r27, Y+4 ; 0x04 253b8: b2 ff sbrs r27, 2 253ba: 19 c0 rjmp .+50 ; 0x253ee { // BIT 26 - over temp prewarning ~120C (+-20C) SERIAL_ERRORRPGM(MSG_TMC_OVERTEMP); 253bc: 84 ea ldi r24, 0xA4 ; 164 253be: 9e e6 ldi r25, 0x6E ; 110 253c0: 0e 94 68 77 call 0xeed0 ; 0xeed0 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 253c4: 81 2f mov r24, r17 253c6: 0e 94 4f 77 call 0xee9e ; 0xee9e } void MarlinSerial::println(unsigned char b, int base) { print(b, base); println(); 253ca: 0f 94 b8 d5 call 0x3ab70 ; 0x3ab70 SERIAL_ECHOLN(i); for (uint_least8_t j = 0; j < 4; j++) 253ce: 10 e0 ldi r17, 0x00 ; 0 tmc2130_wr(j, TMC2130_REG_CHOPCONF, 0x00010000); 253d0: 20 e0 ldi r18, 0x00 ; 0 253d2: 30 e0 ldi r19, 0x00 ; 0 253d4: 41 e0 ldi r20, 0x01 ; 1 253d6: 50 e0 ldi r21, 0x00 ; 0 253d8: 6c ee ldi r22, 0xEC ; 236 253da: 81 2f mov r24, r17 253dc: 0f 94 21 24 call 0x24842 ; 0x24842 tmc2130_rd(i, TMC2130_REG_DRV_STATUS, &drv_status); if (drv_status & ((uint32_t)1 << 26)) { // BIT 26 - over temp prewarning ~120C (+-20C) SERIAL_ERRORRPGM(MSG_TMC_OVERTEMP); SERIAL_ECHOLN(i); for (uint_least8_t j = 0; j < 4; j++) 253e0: 1f 5f subi r17, 0xFF ; 255 253e2: 14 30 cpi r17, 0x04 ; 4 253e4: a9 f7 brne .-22 ; 0x253d0 tmc2130_wr(j, TMC2130_REG_CHOPCONF, 0x00010000); kill(MSG_TMC_OVERTEMP); 253e6: 84 ea ldi r24, 0xA4 ; 164 253e8: 9e e6 ldi r25, 0x6E ; 110 253ea: 0e 94 22 7a call 0xf444 ; 0xf444 void tmc2130_check_overtemp() { if (tmc2130_overtemp_timer.expired_cont(1000)) { for (uint_least8_t i = 0; i < 4; i++) 253ee: 1f 5f subi r17, 0xFF ; 255 253f0: 14 30 cpi r17, 0x04 ; 4 253f2: 99 f6 brne .-90 ; 0x2539a tmc2130_wr(j, TMC2130_REG_CHOPCONF, 0x00010000); kill(MSG_TMC_OVERTEMP); } } tmc2130_overtemp_timer.start(); 253f4: 83 e4 ldi r24, 0x43 ; 67 253f6: 96 e0 ldi r25, 0x06 ; 6 253f8: 0f 94 83 29 call 0x25306 ; 0x25306 ::start()> } } 253fc: 0f 90 pop r0 253fe: 0f 90 pop r0 25400: 0f 90 pop r0 25402: 0f 90 pop r0 25404: df 91 pop r29 25406: cf 91 pop r28 25408: 1f 91 pop r17 2540a: 08 95 ret 0002540c ::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) 2540c: 8f 92 push r8 2540e: 9f 92 push r9 25410: af 92 push r10 25412: bf 92 push r11 25414: cf 92 push r12 25416: df 92 push r13 25418: ef 92 push r14 2541a: ff 92 push r15 2541c: 1f 93 push r17 2541e: cf 93 push r28 25420: df 93 push r29 { if (!m_isRunning) return false; 25422: fc 01 movw r30, r24 25424: 10 81 ld r17, Z 25426: 11 11 cpse r17, r1 25428: 0e c0 rjmp .+28 ; 0x25446 ::expired(unsigned long)+0x3a> 2542a: 10 e0 ldi r17, 0x00 ; 0 expired = true; } } if (expired) m_isRunning = false; return expired; } 2542c: 81 2f mov r24, r17 2542e: df 91 pop r29 25430: cf 91 pop r28 25432: 1f 91 pop r17 25434: ff 90 pop r15 25436: ef 90 pop r14 25438: df 90 pop r13 2543a: cf 90 pop r12 2543c: bf 90 pop r11 2543e: af 90 pop r10 25440: 9f 90 pop r9 25442: 8f 90 pop r8 25444: 08 95 ret 25446: 6a 01 movw r12, r20 25448: 7b 01 movw r14, r22 2544a: ec 01 movw r28, r24 template bool Timer::expired(T msPeriod) { if (!m_isRunning) return false; bool expired = false; const T now = _millis(); 2544c: 0f 94 22 29 call 0x25244 ; 0x25244 25450: 4b 01 movw r8, r22 25452: 5c 01 movw r10, r24 if (m_started <= m_started + msPeriod) 25454: 89 81 ldd r24, Y+1 ; 0x01 25456: 9a 81 ldd r25, Y+2 ; 0x02 25458: ab 81 ldd r26, Y+3 ; 0x03 2545a: bc 81 ldd r27, Y+4 ; 0x04 2545c: c8 0e add r12, r24 2545e: d9 1e adc r13, r25 25460: ea 1e adc r14, r26 25462: fb 1e adc r15, r27 25464: c8 16 cp r12, r24 25466: d9 06 cpc r13, r25 25468: ea 06 cpc r14, r26 2546a: fb 06 cpc r15, r27 2546c: 60 f0 brcs .+24 ; 0x25486 ::expired(unsigned long)+0x7a> { if ((now >= m_started + msPeriod) || (now < m_started)) 2546e: 8c 14 cp r8, r12 25470: 9d 04 cpc r9, r13 25472: ae 04 cpc r10, r14 25474: bf 04 cpc r11, r15 25476: 28 f4 brcc .+10 ; 0x25482 ::expired(unsigned long)+0x76> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 25478: 88 16 cp r8, r24 2547a: 99 06 cpc r9, r25 2547c: aa 06 cpc r10, r26 2547e: bb 06 cpc r11, r27 25480: a0 f6 brcc .-88 ; 0x2542a ::expired(unsigned long)+0x1e> { expired = true; } } if (expired) m_isRunning = false; 25482: 18 82 st Y, r1 25484: d3 cf rjmp .-90 ; 0x2542c ::expired(unsigned long)+0x20> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 25486: 8c 14 cp r8, r12 25488: 9d 04 cpc r9, r13 2548a: ae 04 cpc r10, r14 2548c: bf 04 cpc r11, r15 2548e: a0 f7 brcc .-24 ; 0x25478 ::expired(unsigned long)+0x6c> 25490: cc cf rjmp .-104 ; 0x2542a ::expired(unsigned long)+0x1e> 00025492 : } lcd_space(8 - chars); } //! @Brief Print status line on status screen void lcdui_print_status_line(void) { 25492: 0f 93 push r16 25494: 1f 93 push r17 25496: cf 93 push r28 static uint8_t heating_status_counter; if (heating_status != HeatingStatus::NO_HEATING) { // If heating flag, show progress of heating 25498: 80 91 e1 03 lds r24, 0x03E1 ; 0x8003e1 2549c: 88 23 and r24, r24 2549e: 09 f4 brne .+2 ; 0x254a2 254a0: 4d c0 rjmp .+154 ; 0x2553c heating_status_counter++; 254a2: 80 91 4a 06 lds r24, 0x064A ; 0x80064a 254a6: 8f 5f subi r24, 0xFF ; 255 if (heating_status_counter > 13) { 254a8: 8e 30 cpi r24, 0x0E ; 14 254aa: b0 f4 brcc .+44 ; 0x254d8 //! @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++; 254ac: 80 93 4a 06 sts 0x064A, r24 ; 0x80064a if (heating_status_counter > 13) { heating_status_counter = 0; } lcd_set_cursor(7, 3); 254b0: 63 e0 ldi r22, 0x03 ; 3 254b2: 87 e0 ldi r24, 0x07 ; 7 254b4: 0e 94 f8 6e call 0xddf0 ; 0xddf0 lcd_space(13); 254b8: 8d e0 ldi r24, 0x0D ; 13 254ba: 0e 94 ee 6e call 0xdddc ; 0xdddc for (uint8_t dots = 0; dots < heating_status_counter; dots++) { 254be: c0 e0 ldi r28, 0x00 ; 0 254c0: 80 91 4a 06 lds r24, 0x064A ; 0x80064a 254c4: c8 17 cp r28, r24 254c6: 58 f4 brcc .+22 ; 0x254de lcd_putc_at(7 + dots, 3, '.'); 254c8: 4e e2 ldi r20, 0x2E ; 46 254ca: 63 e0 ldi r22, 0x03 ; 3 254cc: 87 e0 ldi r24, 0x07 ; 7 254ce: 8c 0f add r24, r28 254d0: 0e 94 18 6f call 0xde30 ; 0xde30 heating_status_counter = 0; } lcd_set_cursor(7, 3); lcd_space(13); for (uint8_t dots = 0; dots < heating_status_counter; dots++) { 254d4: cf 5f subi r28, 0xFF ; 255 254d6: f4 cf rjmp .-24 ; 0x254c0 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; 254d8: 10 92 4a 06 sts 0x064A, r1 ; 0x80064a 254dc: e9 cf rjmp .-46 ; 0x254b0 lcd_space(13); for (uint8_t dots = 0; dots < heating_status_counter; dots++) { lcd_putc_at(7 + dots, 3, '.'); } switch (heating_status) { 254de: 80 91 e1 03 lds r24, 0x03E1 ; 0x8003e1 254e2: 82 30 cpi r24, 0x02 ; 2 254e4: d1 f0 breq .+52 ; 0x2551a 254e6: 30 f4 brcc .+12 ; 0x254f4 254e8: 81 30 cpi r24, 0x01 ; 1 254ea: 59 f0 breq .+22 ; 0x25502 case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 254ec: cf 91 pop r28 254ee: 1f 91 pop r17 254f0: 0f 91 pop r16 254f2: 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) { 254f4: 83 30 cpi r24, 0x03 ; 3 254f6: f9 f0 breq .+62 ; 0x25536 254f8: 84 30 cpi r24, 0x04 ; 4 254fa: c1 f7 brne .-16 ; 0x254ec 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)); 254fc: 8e e3 ldi r24, 0x3E ; 62 254fe: 9e e4 ldi r25, 0x4E ; 78 25500: 0e c0 rjmp .+28 ; 0x2551e 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)); 25502: 87 e6 ldi r24, 0x67 ; 103 25504: 9e e4 ldi r25, 0x4E ; 78 lcd_print(custom_message_state); // seconds lcd_print(' '); } break; case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); 25506: 0e 94 c4 72 call 0xe588 ; 0xe588 2550a: ac 01 movw r20, r24 2550c: 63 e0 ldi r22, 0x03 ; 3 2550e: 80 e0 ldi r24, 0x00 ; 0 break; } } } 25510: cf 91 pop r28 25512: 1f 91 pop r17 25514: 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)); 25516: 0c 94 0c 6f jmp 0xde18 ; 0xde18 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)); 2551a: 87 e5 ldi r24, 0x57 ; 87 2551c: 9e e4 ldi r25, 0x4E ; 78 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)); 2551e: 0e 94 c4 72 call 0xe588 ; 0xe588 25522: ac 01 movw r20, r24 25524: 63 e0 ldi r22, 0x03 ; 3 25526: 80 e0 ldi r24, 0x00 ; 0 25528: 0e 94 0c 6f call 0xde18 ; 0xde18 heating_status = HeatingStatus::NO_HEATING; 2552c: 10 92 e1 03 sts 0x03E1, r1 ; 0x8003e1 heating_status_counter = 0; 25530: 10 92 4a 06 sts 0x064A, r1 ; 0x80064a 25534: db cf rjmp .-74 ; 0x254ec 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)); 25536: 89 e4 ldi r24, 0x49 ; 73 25538: 9e e4 ldi r25, 0x4E ; 78 2553a: e5 cf rjmp .-54 ; 0x25506 break; } } else if ((IS_SD_PRINTING) && (custom_message_type == CustomMsg::Status) && (lcd_status_message_level <= LCD_STATUS_INFO) && 2553c: 80 91 8f 14 lds r24, 0x148F ; 0x80148f 25540: 88 23 and r24, r24 25542: 61 f1 breq .+88 ; 0x2559c break; default: break; } } else if ((IS_SD_PRINTING) && 25544: 80 91 c3 06 lds r24, 0x06C3 ; 0x8006c3 25548: 81 11 cpse r24, r1 2554a: 28 c0 rjmp .+80 ; 0x2559c (custom_message_type == CustomMsg::Status) && 2554c: 80 91 d3 03 lds r24, 0x03D3 ; 0x8003d3 <_ZL24lcd_status_message_level.lto_priv.451> 25550: 82 30 cpi r24, 0x02 ; 2 25552: 20 f5 brcc .+72 ; 0x2559c } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 25554: 80 91 33 05 lds r24, 0x0533 ; 0x800533 <_ZL26lcd_status_message_timeout.lto_priv.452> 25558: 81 11 cpse r24, r1 2555a: 16 c0 rjmp .+44 ; 0x25588 (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); 2555c: 80 91 a6 14 lds r24, 0x14A6 ; 0x8014a6 25560: 88 23 and r24, r24 25562: 09 f4 brne .+2 ; 0x25566 25564: 35 c0 rjmp .+106 ; 0x255d0 25566: 86 ea ldi r24, 0xA6 ; 166 25568: 94 e1 ldi r25, 0x14 ; 20 if( lcd_print_pad(&longFilenameOLD[scrollstuff], LCD_WIDTH) == 0) 2556a: 20 91 b8 0d lds r18, 0x0DB8 ; 0x800db8 2556e: 64 e1 ldi r22, 0x14 ; 20 25570: 82 0f add r24, r18 25572: 91 1d adc r25, r1 25574: 0e 94 e7 70 call 0xe1ce ; 0xe1ce 25578: 81 11 cpse r24, r1 2557a: 2d c0 rjmp .+90 ; 0x255d6 { scrollstuff++; 2557c: 80 91 b8 0d lds r24, 0x0DB8 ; 0x800db8 25580: 8f 5f subi r24, 0xFF ; 255 25582: 80 93 b8 0d sts 0x0DB8, r24 ; 0x800db8 25586: b2 cf rjmp .-156 ; 0x254ec 25588: 40 e2 ldi r20, 0x20 ; 32 2558a: 5e e4 ldi r21, 0x4E ; 78 2558c: 60 e0 ldi r22, 0x00 ; 0 2558e: 70 e0 ldi r23, 0x00 ; 0 25590: 83 e3 ldi r24, 0x33 ; 51 25592: 95 e0 ldi r25, 0x05 ; 5 25594: 0f 94 06 2a call 0x2540c ; 0x2540c ::expired(unsigned long)> 25598: 81 11 cpse r24, r1 2559a: e0 cf rjmp .-64 ; 0x2555c 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) 2559c: 80 91 c3 06 lds r24, 0x06C3 ; 0x8006c3 255a0: 81 11 cpse r24, r1 255a2: 1c c0 rjmp .+56 ; 0x255dc { return; // Nothing to do, waiting for delay to expire } switch (custom_message_type) { 255a4: e0 91 c3 06 lds r30, 0x06C3 ; 0x8006c3 255a8: ea 30 cpi r30, 0x0A ; 10 255aa: 08 f0 brcs .+2 ; 0x255ae 255ac: 9f cf rjmp .-194 ; 0x254ec 255ae: f0 e0 ldi r31, 0x00 ; 0 255b0: 88 27 eor r24, r24 255b2: e2 52 subi r30, 0x22 ; 34 255b4: f5 4d sbci r31, 0xD5 ; 213 255b6: 8e 4f sbci r24, 0xFE ; 254 255b8: 0d 94 e7 dc jmp 0x3b9ce ; 0x3b9ce <__tablejump2__> 255bc: 9e 3a cpi r25, 0xAE ; 174 255be: 94 3a cpi r25, 0xA4 ; 164 255c0: 9e 3a cpi r25, 0xAE ; 174 255c2: a6 39 cpi r26, 0x96 ; 150 255c4: ba 39 cpi r27, 0x9A ; 154 255c6: 52 39 cpi r21, 0x92 ; 146 255c8: 9e 3a cpi r25, 0xAE ; 174 255ca: 9e 3a cpi r25, 0xAE ; 174 255cc: ca 3a cpi r28, 0xAA ; 170 255ce: 9e 3a cpi r25, 0xAE ; 174 (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); 255d0: 81 e9 ldi r24, 0x91 ; 145 255d2: 94 e1 ldi r25, 0x14 ; 20 255d4: ca cf rjmp .-108 ; 0x2556a if( lcd_print_pad(&longFilenameOLD[scrollstuff], LCD_WIDTH) == 0) { scrollstuff++; } else { scrollstuff = 0; 255d6: 10 92 b8 0d sts 0x0DB8, r1 ; 0x800db8 255da: 88 cf rjmp .-240 ; 0x254ec } } else { // Otherwise check for other special events if ( custom_message_type != CustomMsg::Status && lcd_status_message_timeout.running() 255dc: 80 91 33 05 lds r24, 0x0533 ; 0x800533 <_ZL26lcd_status_message_timeout.lto_priv.452> 255e0: 88 23 and r24, r24 255e2: 01 f3 breq .-64 ; 0x255a4 * 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; 255e4: 0f 94 22 29 call 0x25244 ; 0x25244 255e8: 00 91 34 05 lds r16, 0x0534 ; 0x800534 <_ZL26lcd_status_message_timeout.lto_priv.452+0x1> 255ec: 10 91 35 05 lds r17, 0x0535 ; 0x800535 <_ZL26lcd_status_message_timeout.lto_priv.452+0x2> 255f0: 20 91 36 05 lds r18, 0x0536 ; 0x800536 <_ZL26lcd_status_message_timeout.lto_priv.452+0x3> 255f4: 30 91 37 05 lds r19, 0x0537 ; 0x800537 <_ZL26lcd_status_message_timeout.lto_priv.452+0x4> 255f8: 60 1b sub r22, r16 255fa: 71 0b sbc r23, r17 255fc: 82 0b sbc r24, r18 255fe: 93 0b sbc r25, r19 && lcd_status_message_timeout.elapsed() < LCD_STATUS_DELAYED_TIMEOUT) 25600: 60 3a cpi r22, 0xA0 ; 160 25602: 7f 40 sbci r23, 0x0F ; 15 25604: 81 05 cpc r24, r1 25606: 91 05 cpc r25, r1 25608: 68 f6 brcc .-102 ; 0x255a4 2560a: 70 cf rjmp .-288 ; 0x254ec 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); 2560c: 63 e0 ldi r22, 0x03 ; 3 2560e: 80 91 1d 05 lds r24, 0x051D ; 0x80051d <_ZL22lcd_status_message_idx.lto_priv.448> 25612: 0e 94 f8 6e call 0xddf0 ; 0xddf0 const uint8_t padding = lcd_print_pad(&lcd_status_message[lcd_status_message_idx], LCD_WIDTH - lcd_status_message_idx); 25616: 80 91 1d 05 lds r24, 0x051D ; 0x80051d <_ZL22lcd_status_message_idx.lto_priv.448> 2561a: c4 e1 ldi r28, 0x14 ; 20 2561c: 6c 2f mov r22, r28 2561e: 68 1b sub r22, r24 25620: 90 e0 ldi r25, 0x00 ; 0 25622: 82 5e subi r24, 0xE2 ; 226 25624: 9a 4f sbci r25, 0xFA ; 250 25626: 0e 94 e7 70 call 0xe1ce ; 0xe1ce lcd_status_message_idx = LCD_WIDTH - padding; 2562a: c8 1b sub r28, r24 2562c: c0 93 1d 05 sts 0x051D, r28 ; 0x80051d <_ZL22lcd_status_message_idx.lto_priv.448> 25630: 5d cf rjmp .-326 ; 0x254ec } break; case CustomMsg::MeshBedLeveling: // If mesh bed leveling in progress, show the status if (custom_message_state > 10) { 25632: 80 91 f6 03 lds r24, 0x03F6 ; 0x8003f6 25636: 8b 30 cpi r24, 0x0B ; 11 25638: 08 f1 brcs .+66 ; 0x2567c lcd_set_cursor(0, 3); 2563a: 63 e0 ldi r22, 0x03 ; 3 2563c: 80 e0 ldi r24, 0x00 ; 0 2563e: 0e 94 f8 6e call 0xddf0 ; 0xddf0 lcd_space(LCD_WIDTH); 25642: 84 e1 ldi r24, 0x14 ; 20 25644: 0e 94 ee 6e call 0xdddc ; 0xdddc lcd_puts_at_P(0, 3, _T(MSG_CALIBRATE_Z_AUTO)); 25648: 8e e2 ldi r24, 0x2E ; 46 2564a: 9e e4 ldi r25, 0x4E ; 78 2564c: 0e 94 c4 72 call 0xe588 ; 0xe588 25650: ac 01 movw r20, r24 25652: 63 e0 ldi r22, 0x03 ; 3 25654: 80 e0 ldi r24, 0x00 ; 0 25656: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_puts_P(PSTR(" : ")); 2565a: 81 eb ldi r24, 0xB1 ; 177 2565c: 90 ea ldi r25, 0xA0 ; 160 2565e: 0e 94 e3 6e call 0xddc6 ; 0xddc6 lcd_print(custom_message_state - 10); 25662: 60 91 f6 03 lds r22, 0x03F6 ; 0x8003f6 25666: 6a 50 subi r22, 0x0A ; 10 25668: 77 0b sbc r23, r23 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); 2566a: 07 2e mov r0, r23 2566c: 00 0c add r0, r0 2566e: 88 0b sbc r24, r24 25670: 99 0b sbc r25, r25 case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 25672: cf 91 pop r28 25674: 1f 91 pop r17 25676: 0f 91 pop r16 25678: 0c 94 b1 70 jmp 0xe162 ; 0xe162 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) { 2567c: 83 30 cpi r24, 0x03 ; 3 2567e: 31 f4 brne .+12 ; 0x2568c lcd_setstatuspgm(MSG_WELCOME); 25680: 86 eb ldi r24, 0xB6 ; 182 25682: 90 e7 ldi r25, 0x70 ; 112 25684: 0e 94 38 f1 call 0x1e270 ; 0x1e270 custom_message_type = CustomMsg::Status; 25688: 10 92 c3 06 sts 0x06C3, r1 ; 0x8006c3 } if (custom_message_state > 3 && custom_message_state <= 10) { 2568c: 80 91 f6 03 lds r24, 0x03F6 ; 0x8003f6 25690: 84 50 subi r24, 0x04 ; 4 25692: 87 30 cpi r24, 0x07 ; 7 25694: 08 f0 brcs .+2 ; 0x25698 25696: 2a cf rjmp .-428 ; 0x254ec lcd_set_cursor(0, 3); 25698: 63 e0 ldi r22, 0x03 ; 3 2569a: 80 e0 ldi r24, 0x00 ; 0 2569c: 0e 94 f8 6e call 0xddf0 ; 0xddf0 lcd_space(19); 256a0: 83 e1 ldi r24, 0x13 ; 19 256a2: 0e 94 ee 6e call 0xdddc ; 0xdddc lcd_puts_at_P(0, 3, _T(MSG_HOMEYZ_DONE)); 256a6: 8b e1 ldi r24, 0x1B ; 27 256a8: 9e e4 ldi r25, 0x4E ; 78 256aa: 0e 94 c4 72 call 0xe588 ; 0xe588 256ae: ac 01 movw r20, r24 256b0: 63 e0 ldi r22, 0x03 ; 3 256b2: 80 e0 ldi r24, 0x00 ; 0 256b4: 0e 94 0c 6f call 0xde18 ; 0xde18 custom_message_state--; 256b8: 80 91 f6 03 lds r24, 0x03F6 ; 0x8003f6 256bc: 81 50 subi r24, 0x01 ; 1 256be: 80 93 f6 03 sts 0x03F6, r24 ; 0x8003f6 256c2: 14 cf rjmp .-472 ; 0x254ec } } break; case CustomMsg::PidCal: // PID tuning in progress lcd_print_pad(lcd_status_message, LCD_WIDTH); 256c4: 64 e1 ldi r22, 0x14 ; 20 256c6: 8e e1 ldi r24, 0x1E ; 30 256c8: 95 e0 ldi r25, 0x05 ; 5 256ca: 0e 94 e7 70 call 0xe1ce ; 0xe1ce if (pid_cycle <= pid_number_of_cycles && custom_message_state > 0) { 256ce: 20 91 48 06 lds r18, 0x0648 ; 0x800648 256d2: 30 91 49 06 lds r19, 0x0649 ; 0x800649 256d6: 80 91 46 06 lds r24, 0x0646 ; 0x800646 256da: 90 91 47 06 lds r25, 0x0647 ; 0x800647 256de: 82 17 cp r24, r18 256e0: 93 07 cpc r25, r19 256e2: 0c f4 brge .+2 ; 0x256e6 256e4: 03 cf rjmp .-506 ; 0x254ec 256e6: 80 91 f6 03 lds r24, 0x03F6 ; 0x8003f6 256ea: 88 23 and r24, r24 256ec: 09 f4 brne .+2 ; 0x256f0 256ee: fe ce rjmp .-516 ; 0x254ec lcd_set_cursor(10, 3); 256f0: 63 e0 ldi r22, 0x03 ; 3 256f2: 8a e0 ldi r24, 0x0A ; 10 256f4: 0e 94 f8 6e call 0xddf0 ; 0xddf0 lcd_printf_P(PSTR("%3d/%-3d"), pid_cycle, pid_number_of_cycles); 256f8: 80 91 47 06 lds r24, 0x0647 ; 0x800647 256fc: 8f 93 push r24 256fe: 80 91 46 06 lds r24, 0x0646 ; 0x800646 25702: 8f 93 push r24 25704: 80 91 49 06 lds r24, 0x0649 ; 0x800649 25708: 8f 93 push r24 2570a: 80 91 48 06 lds r24, 0x0648 ; 0x800648 2570e: 8f 93 push r24 25710: 88 ea ldi r24, 0xA8 ; 168 25712: 90 ea ldi r25, 0xA0 ; 160 } 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); 25714: 9f 93 push r25 25716: 8f 93 push r24 25718: 0e 94 d1 6e call 0xdda2 ; 0xdda2 2571c: 0f 90 pop r0 2571e: 0f 90 pop r0 25720: 0f 90 pop r0 25722: 0f 90 pop r0 25724: 0f 90 pop r0 25726: 0f 90 pop r0 25728: e1 ce rjmp .-574 ; 0x254ec 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); 2572a: 63 e0 ldi r22, 0x03 ; 3 2572c: 80 e0 ldi r24, 0x00 ; 0 2572e: 0e 94 f8 6e call 0xddf0 ; 0xddf0 lcd_printf_P(PSTR("%-12.12S%-d/6"), _T(MSG_PINDA_CALIBRATION), custom_message_state); 25732: c0 91 f6 03 lds r28, 0x03F6 ; 0x8003f6 25736: 8d e1 ldi r24, 0x1D ; 29 25738: 95 e4 ldi r25, 0x45 ; 69 2573a: 0e 94 c4 72 call 0xe588 ; 0xe588 2573e: 1f 92 push r1 25740: cf 93 push r28 25742: 9f 93 push r25 25744: 8f 93 push r24 25746: 8a e9 ldi r24, 0x9A ; 154 25748: 90 ea ldi r25, 0xA0 ; 160 2574a: e4 cf rjmp .-56 ; 0x25714 break; case CustomMsg::TempCompPreheat: // temp compensation preheat lcd_puts_at_P(0, 3, _T(MSG_PINDA_PREHEAT)); 2574c: 8b e0 ldi r24, 0x0B ; 11 2574e: 9e e4 ldi r25, 0x4E ; 78 25750: 0e 94 c4 72 call 0xe588 ; 0xe588 25754: ac 01 movw r20, r24 25756: 63 e0 ldi r22, 0x03 ; 3 25758: 80 e0 ldi r24, 0x00 ; 0 2575a: 0e 94 0c 6f call 0xde18 ; 0xde18 if (custom_message_state <= PINDA_HEAT_T) { 2575e: 80 91 f6 03 lds r24, 0x03F6 ; 0x8003f6 25762: 89 37 cpi r24, 0x79 ; 121 25764: 08 f0 brcs .+2 ; 0x25768 25766: c2 ce rjmp .-636 ; 0x254ec lcd_puts_P(PSTR(": ")); 25768: 87 e9 ldi r24, 0x97 ; 151 2576a: 90 ea ldi r25, 0xA0 ; 160 2576c: 0e 94 e3 6e call 0xddc6 ; 0xddc6 } void lcd_print(unsigned long n, int base) { if (base == 0) lcd_write(n); 25770: 80 91 f6 03 lds r24, 0x03F6 ; 0x8003f6 25774: 0e 94 a7 6f call 0xdf4e ; 0xdf4e } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 25778: 80 e2 ldi r24, 0x20 ; 32 case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 2577a: cf 91 pop r28 2577c: 1f 91 pop r17 2577e: 0f 91 pop r16 25780: 0c 94 a7 6f jmp 0xdf4e ; 0xdf4e lcd_print(custom_message_state); // seconds lcd_print(' '); } break; case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); 25784: 8a ef ldi r24, 0xFA ; 250 25786: 9d e4 ldi r25, 0x4D ; 77 25788: be ce rjmp .-644 ; 0x25506 0002578a ::start()>: /** * @brief Start timer */ template void Timer::start() 2578a: cf 93 push r28 2578c: df 93 push r29 2578e: ec 01 movw r28, r24 { m_started = _millis(); 25790: 0f 94 22 29 call 0x25244 ; 0x25244 25794: 69 83 std Y+1, r22 ; 0x01 25796: 7a 83 std Y+2, r23 ; 0x02 25798: 8b 83 std Y+3, r24 ; 0x03 2579a: 9c 83 std Y+4, r25 ; 0x04 m_isRunning = true; 2579c: 81 e0 ldi r24, 0x01 ; 1 2579e: 88 83 st Y, r24 } 257a0: df 91 pop r29 257a2: cf 91 pop r28 257a4: 08 95 ret 000257a6 : //! 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) { 257a6: cf 92 push r12 257a8: df 92 push r13 257aa: ff 92 push r15 257ac: 0f 93 push r16 257ae: 1f 93 push r17 257b0: cf 93 push r28 257b2: df 93 push r29 257b4: cd b7 in r28, 0x3d ; 61 257b6: de b7 in r29, 0x3e ; 62 257b8: 64 97 sbiw r28, 0x14 ; 20 257ba: 0f b6 in r0, 0x3f ; 63 257bc: f8 94 cli 257be: de bf out 0x3e, r29 ; 62 257c0: 0f be out 0x3f, r0 ; 63 257c2: cd bf out 0x3d, r28 ; 61 257c4: 8c 01 movw r16, r24 257c6: f6 2e mov r15, r22 char msg[LCD_WIDTH]; strcpy_P(msg, PSTR("Err: ")); 257c8: 6b ea ldi r22, 0xAB ; 171 257ca: 7e e9 ldi r23, 0x9E ; 158 257cc: ce 01 movw r24, r28 257ce: 01 96 adiw r24, 0x01 ; 1 257d0: 0f 94 8e d9 call 0x3b31c ; 0x3b31c strcat_P(msg, type); 257d4: b8 01 movw r22, r16 257d6: ce 01 movw r24, r28 257d8: 01 96 adiw r24, 0x01 ; 1 257da: 0f 94 7a d9 call 0x3b2f4 ; 0x3b2f4 lcd_status_message_timeout.start(); } void lcd_setalertstatus_(const char* message, uint8_t severity, bool progmem) { if (lcd_message_check(severity)) { 257de: 83 e0 ldi r24, 0x03 ; 3 257e0: 0e 94 e2 f0 call 0x1e1c4 ; 0x1e1c4 257e4: 88 23 and r24, r24 257e6: e1 f0 breq .+56 ; 0x25820 bool same = !(progmem? strcmp_P(lcd_status_message, message): strcmp(lcd_status_message, message)); 257e8: be 01 movw r22, r28 257ea: 6f 5f subi r22, 0xFF ; 255 257ec: 7f 4f sbci r23, 0xFF ; 255 257ee: 8e e1 ldi r24, 0x1E ; 30 257f0: 95 e0 ldi r25, 0x05 ; 5 257f2: 0f 94 39 e2 call 0x3c472 ; 0x3c472 257f6: 6c 01 movw r12, r24 lcd_status_message_timeout.start(); 257f8: 83 e3 ldi r24, 0x33 ; 51 257fa: 95 e0 ldi r25, 0x05 ; 5 257fc: 0f 94 c5 2b call 0x2578a ; 0x2578a ::start()> lcd_status_message_level = severity; 25800: 83 e0 ldi r24, 0x03 ; 3 25802: 80 93 d3 03 sts 0x03D3, r24 ; 0x8003d3 <_ZL24lcd_status_message_level.lto_priv.451> custom_message_type = CustomMsg::Status; 25806: 10 92 c3 06 sts 0x06C3, r1 ; 0x8006c3 custom_message_state = 0; 2580a: 10 92 f6 03 sts 0x03F6, r1 ; 0x8003f6 if (!same) { 2580e: cd 28 or r12, r13 25810: 39 f0 breq .+14 ; 0x25820 // do not kick the user out of the menus if the message is unchanged lcd_updatestatus(message, progmem); 25812: 60 e0 ldi r22, 0x00 ; 0 25814: ce 01 movw r24, r28 25816: 01 96 adiw r24, 0x01 ; 1 25818: 0e 94 c7 f0 call 0x1e18e ; 0x1e18e lcd_return_to_status(); 2581c: 0f 94 7c 1e call 0x23cf8 ; 0x23cf8 lcd_setalertstatus(msg, LCD_STATUS_CRITICAL); SERIAL_ERROR_START; 25820: 8a ec ldi r24, 0xCA ; 202 25822: 9b ea ldi r25, 0xAB ; 171 25824: 0e 94 68 77 call 0xeed0 ; 0xeed0 if(e != EXTRUDERS) { 25828: 81 e0 ldi r24, 0x01 ; 1 2582a: f8 16 cp r15, r24 2582c: 49 f0 breq .+18 ; 0x25840 2582e: 60 e0 ldi r22, 0x00 ; 0 25830: 70 e0 ldi r23, 0x00 ; 0 25832: cb 01 movw r24, r22 25834: 0f 94 26 d5 call 0x3aa4c ; 0x3aa4c SERIAL_ERROR((int)e); SERIAL_ERRORPGM(": "); 25838: 88 ea ldi r24, 0xA8 ; 168 2583a: 9e e9 ldi r25, 0x9E ; 158 2583c: 0e 94 68 77 call 0xeed0 ; 0xeed0 } SERIAL_ERRORPGM("Heaters switched off. "); 25840: 81 e9 ldi r24, 0x91 ; 145 25842: 9e e9 ldi r25, 0x9E ; 158 25844: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ERRORRPGM(type); 25848: c8 01 movw r24, r16 2584a: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ERRORLNPGM(" triggered!"); 2584e: 85 e8 ldi r24, 0x85 ; 133 25850: 9e e9 ldi r25, 0x9E ; 158 25852: 0e 94 93 79 call 0xf326 ; 0xf326 } 25856: 64 96 adiw r28, 0x14 ; 20 25858: 0f b6 in r0, 0x3f ; 63 2585a: f8 94 cli 2585c: de bf out 0x3e, r29 ; 62 2585e: 0f be out 0x3f, r0 ; 63 25860: cd bf out 0x3d, r28 ; 61 25862: df 91 pop r29 25864: cf 91 pop r28 25866: 1f 91 pop r17 25868: 0f 91 pop r16 2586a: ff 90 pop r15 2586c: df 90 pop r13 2586e: cf 90 pop r12 25870: 08 95 ret 00025872 <__vector_15>: volatile unsigned long timer2_overflow_count; volatile unsigned long timer2_millis; unsigned char timer2_fract = 0; ISR(TIMER2_OVF_vect) { 25872: 1f 92 push r1 25874: 0f 92 push r0 25876: 0f b6 in r0, 0x3f ; 63 25878: 0f 92 push r0 2587a: 11 24 eor r1, r1 2587c: 2f 93 push r18 2587e: 3f 93 push r19 25880: 8f 93 push r24 25882: 9f 93 push r25 25884: af 93 push r26 25886: 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; 25888: 80 91 3a 06 lds r24, 0x063A ; 0x80063a 2588c: 90 91 3b 06 lds r25, 0x063B ; 0x80063b 25890: a0 91 3c 06 lds r26, 0x063C ; 0x80063c 25894: b0 91 3d 06 lds r27, 0x063D ; 0x80063d unsigned char f = timer2_fract; 25898: 30 91 39 06 lds r19, 0x0639 ; 0x800639 m += MILLIS_INC; f += FRACT_INC; 2589c: 23 e0 ldi r18, 0x03 ; 3 2589e: 23 0f add r18, r19 if (f >= FRACT_MAX) 258a0: 2d 37 cpi r18, 0x7D ; 125 258a2: 58 f5 brcc .+86 ; 0x258fa <__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; 258a4: 01 96 adiw r24, 0x01 ; 1 258a6: a1 1d adc r26, r1 258a8: b1 1d adc r27, r1 if (f >= FRACT_MAX) { f -= FRACT_MAX; m += 1; } timer2_fract = f; 258aa: 20 93 39 06 sts 0x0639, r18 ; 0x800639 timer2_millis = m; 258ae: 80 93 3a 06 sts 0x063A, r24 ; 0x80063a 258b2: 90 93 3b 06 sts 0x063B, r25 ; 0x80063b 258b6: a0 93 3c 06 sts 0x063C, r26 ; 0x80063c 258ba: b0 93 3d 06 sts 0x063D, r27 ; 0x80063d timer2_overflow_count++; 258be: 80 91 3e 06 lds r24, 0x063E ; 0x80063e 258c2: 90 91 3f 06 lds r25, 0x063F ; 0x80063f 258c6: a0 91 40 06 lds r26, 0x0640 ; 0x800640 258ca: b0 91 41 06 lds r27, 0x0641 ; 0x800641 258ce: 01 96 adiw r24, 0x01 ; 1 258d0: a1 1d adc r26, r1 258d2: b1 1d adc r27, r1 258d4: 80 93 3e 06 sts 0x063E, r24 ; 0x80063e 258d8: 90 93 3f 06 sts 0x063F, r25 ; 0x80063f 258dc: a0 93 40 06 sts 0x0640, r26 ; 0x800640 258e0: b0 93 41 06 sts 0x0641, r27 ; 0x800641 } 258e4: bf 91 pop r27 258e6: af 91 pop r26 258e8: 9f 91 pop r25 258ea: 8f 91 pop r24 258ec: 3f 91 pop r19 258ee: 2f 91 pop r18 258f0: 0f 90 pop r0 258f2: 0f be out 0x3f, r0 ; 63 258f4: 0f 90 pop r0 258f6: 1f 90 pop r1 258f8: 18 95 reti unsigned char f = timer2_fract; m += MILLIS_INC; f += FRACT_INC; if (f >= FRACT_MAX) { f -= FRACT_MAX; 258fa: 26 e8 ldi r18, 0x86 ; 134 258fc: 23 0f add r18, r19 m += 1; 258fe: 02 96 adiw r24, 0x02 ; 2 25900: a1 1d adc r26, r1 25902: b1 1d adc r27, r1 25904: d2 cf rjmp .-92 ; 0x258aa <__vector_15+0x38> 00025906 : return pos; } static float cost_fn(uint16_t samples, float* const var, float v, uint8_t fan_pwm, float ambient) { 25906: 2f 92 push r2 25908: 3f 92 push r3 2590a: 4f 92 push r4 2590c: 5f 92 push r5 2590e: 6f 92 push r6 25910: 7f 92 push r7 25912: 8f 92 push r8 25914: 9f 92 push r9 25916: af 92 push r10 25918: bf 92 push r11 2591a: cf 92 push r12 2591c: df 92 push r13 2591e: ef 92 push r14 25920: ff 92 push r15 25922: 0f 93 push r16 25924: 1f 93 push r17 25926: cf 93 push r28 25928: df 93 push r29 2592a: 00 d0 rcall .+0 ; 0x2592c 2592c: 00 d0 rcall .+0 ; 0x2592e 2592e: 1f 92 push r1 25930: cd b7 in r28, 0x3d ; 61 25932: de b7 in r29, 0x3e ; 62 25934: 9c 83 std Y+4, r25 ; 0x04 25936: 8b 83 std Y+3, r24 ; 0x03 25938: 0d 83 std Y+5, r16 ; 0x05 2593a: 26 01 movw r4, r12 2593c: 37 01 movw r6, r14 *var = v; 2593e: fb 01 movw r30, r22 25940: 20 83 st Z, r18 25942: 31 83 std Z+1, r19 ; 0x01 25944: 42 83 std Z+2, r20 ; 0x02 25946: 53 83 std Z+3, r21 ; 0x03 void model_data::reset(uint8_t heater_pwm _UNUSED, uint8_t fan_pwm _UNUSED, float heater_temp _UNUSED, float ambient_temp _UNUSED) { // pre-compute invariant values C_i = (TEMP_MGR_INTV / C); 25948: 20 91 e5 12 lds r18, 0x12E5 ; 0x8012e5 <_ZN13thermal_modelL4dataE.lto_priv.400+0x36> 2594c: 30 91 e6 12 lds r19, 0x12E6 ; 0x8012e6 <_ZN13thermal_modelL4dataE.lto_priv.400+0x37> 25950: 40 91 e7 12 lds r20, 0x12E7 ; 0x8012e7 <_ZN13thermal_modelL4dataE.lto_priv.400+0x38> 25954: 50 91 e8 12 lds r21, 0x12E8 ; 0x8012e8 <_ZN13thermal_modelL4dataE.lto_priv.400+0x39> 25958: 61 e7 ldi r22, 0x71 ; 113 2595a: 7d e3 ldi r23, 0x3D ; 61 2595c: 8a e8 ldi r24, 0x8A ; 138 2595e: 9e e3 ldi r25, 0x3E ; 62 25960: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 25964: 60 93 3c 13 sts 0x133C, r22 ; 0x80133c <_ZN13thermal_modelL4dataE.lto_priv.400+0x8d> 25968: 70 93 3d 13 sts 0x133D, r23 ; 0x80133d <_ZN13thermal_modelL4dataE.lto_priv.400+0x8e> 2596c: 80 93 3e 13 sts 0x133E, r24 ; 0x80133e <_ZN13thermal_modelL4dataE.lto_priv.400+0x8f> 25970: 90 93 3f 13 sts 0x133F, r25 ; 0x80133f <_ZN13thermal_modelL4dataE.lto_priv.400+0x90> warn_s = warn * TEMP_MGR_INTV; 25974: 21 e7 ldi r18, 0x71 ; 113 25976: 3d e3 ldi r19, 0x3D ; 61 25978: 4a e8 ldi r20, 0x8A ; 138 2597a: 5e e3 ldi r21, 0x3E ; 62 2597c: 60 91 33 13 lds r22, 0x1333 ; 0x801333 <_ZN13thermal_modelL4dataE.lto_priv.400+0x84> 25980: 70 91 34 13 lds r23, 0x1334 ; 0x801334 <_ZN13thermal_modelL4dataE.lto_priv.400+0x85> 25984: 80 91 35 13 lds r24, 0x1335 ; 0x801335 <_ZN13thermal_modelL4dataE.lto_priv.400+0x86> 25988: 90 91 36 13 lds r25, 0x1336 ; 0x801336 <_ZN13thermal_modelL4dataE.lto_priv.400+0x87> 2598c: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 25990: 60 93 40 13 sts 0x1340, r22 ; 0x801340 <_ZN13thermal_modelL4dataE.lto_priv.400+0x91> 25994: 70 93 41 13 sts 0x1341, r23 ; 0x801341 <_ZN13thermal_modelL4dataE.lto_priv.400+0x92> 25998: 80 93 42 13 sts 0x1342, r24 ; 0x801342 <_ZN13thermal_modelL4dataE.lto_priv.400+0x93> 2599c: 90 93 43 13 sts 0x1343, r25 ; 0x801343 <_ZN13thermal_modelL4dataE.lto_priv.400+0x94> err_s = err * TEMP_MGR_INTV; 259a0: 21 e7 ldi r18, 0x71 ; 113 259a2: 3d e3 ldi r19, 0x3D ; 61 259a4: 4a e8 ldi r20, 0x8A ; 138 259a6: 5e e3 ldi r21, 0x3E ; 62 259a8: 60 91 37 13 lds r22, 0x1337 ; 0x801337 <_ZN13thermal_modelL4dataE.lto_priv.400+0x88> 259ac: 70 91 38 13 lds r23, 0x1338 ; 0x801338 <_ZN13thermal_modelL4dataE.lto_priv.400+0x89> 259b0: 80 91 39 13 lds r24, 0x1339 ; 0x801339 <_ZN13thermal_modelL4dataE.lto_priv.400+0x8a> 259b4: 90 91 3a 13 lds r25, 0x133A ; 0x80133a <_ZN13thermal_modelL4dataE.lto_priv.400+0x8b> 259b8: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 259bc: 60 93 44 13 sts 0x1344, r22 ; 0x801344 <_ZN13thermal_modelL4dataE.lto_priv.400+0x95> 259c0: 70 93 45 13 sts 0x1345, r23 ; 0x801345 <_ZN13thermal_modelL4dataE.lto_priv.400+0x96> 259c4: 80 93 46 13 sts 0x1346, r24 ; 0x801346 <_ZN13thermal_modelL4dataE.lto_priv.400+0x97> 259c8: 90 93 47 13 sts 0x1347, r25 ; 0x801347 <_ZN13thermal_modelL4dataE.lto_priv.400+0x98> dT_lag_size = L / (uint16_t)(TEMP_MGR_INTV * 1000); 259cc: 80 91 ed 12 lds r24, 0x12ED ; 0x8012ed <_ZN13thermal_modelL4dataE.lto_priv.400+0x3e> 259d0: 90 91 ee 12 lds r25, 0x12EE ; 0x8012ee <_ZN13thermal_modelL4dataE.lto_priv.400+0x3f> 259d4: 6e e0 ldi r22, 0x0E ; 14 259d6: 71 e0 ldi r23, 0x01 ; 1 259d8: 0f 94 a0 dc call 0x3b940 ; 0x3b940 <__udivmodhi4> 259dc: 60 93 cf 12 sts 0x12CF, r22 ; 0x8012cf <_ZN13thermal_modelL4dataE.lto_priv.400+0x20> 259e0: ef ea ldi r30, 0xAF ; 175 259e2: f2 e1 ldi r31, 0x12 ; 18 // initial values for(uint8_t i = 0; i != THERMAL_MODEL_MAX_LAG_SIZE; ++i) dT_lag_buf[i] = NAN; 259e4: 80 e0 ldi r24, 0x00 ; 0 259e6: 90 e0 ldi r25, 0x00 ; 0 259e8: a0 ec ldi r26, 0xC0 ; 192 259ea: bf e7 ldi r27, 0x7F ; 127 259ec: 81 93 st Z+, r24 259ee: 91 93 st Z+, r25 259f0: a1 93 st Z+, r26 259f2: b1 93 st Z+, r27 warn_s = warn * TEMP_MGR_INTV; err_s = err * TEMP_MGR_INTV; dT_lag_size = L / (uint16_t)(TEMP_MGR_INTV * 1000); // initial values for(uint8_t i = 0; i != THERMAL_MODEL_MAX_LAG_SIZE; ++i) 259f4: 22 e1 ldi r18, 0x12 ; 18 259f6: ef 3c cpi r30, 0xCF ; 207 259f8: f2 07 cpc r31, r18 259fa: c1 f7 brne .-16 ; 0x259ec dT_lag_buf[i] = NAN; dT_lag_idx = 0; 259fc: 10 92 d0 12 sts 0x12D0, r1 ; 0x8012d0 <_ZN13thermal_modelL4dataE.lto_priv.400+0x21> dT_err_prev = 0; 25a00: 10 92 d1 12 sts 0x12D1, r1 ; 0x8012d1 <_ZN13thermal_modelL4dataE.lto_priv.400+0x22> 25a04: 10 92 d2 12 sts 0x12D2, r1 ; 0x8012d2 <_ZN13thermal_modelL4dataE.lto_priv.400+0x23> 25a08: 10 92 d3 12 sts 0x12D3, r1 ; 0x8012d3 <_ZN13thermal_modelL4dataE.lto_priv.400+0x24> 25a0c: 10 92 d4 12 sts 0x12D4, r1 ; 0x8012d4 <_ZN13thermal_modelL4dataE.lto_priv.400+0x25> T_prev = NAN; 25a10: 80 93 d5 12 sts 0x12D5, r24 ; 0x8012d5 <_ZN13thermal_modelL4dataE.lto_priv.400+0x26> 25a14: 90 93 d6 12 sts 0x12D6, r25 ; 0x8012d6 <_ZN13thermal_modelL4dataE.lto_priv.400+0x27> 25a18: a0 93 d7 12 sts 0x12D7, r26 ; 0x8012d7 <_ZN13thermal_modelL4dataE.lto_priv.400+0x28> 25a1c: b0 93 d8 12 sts 0x12D8, r27 ; 0x8012d8 <_ZN13thermal_modelL4dataE.lto_priv.400+0x29> // clear the initialization flag flag_bits.uninitialized = false; 25a20: 80 91 3b 13 lds r24, 0x133B ; 0x80133b <_ZN13thermal_modelL4dataE.lto_priv.400+0x8c> 25a24: 8e 7f andi r24, 0xFE ; 254 25a26: 80 93 3b 13 sts 0x133B, r24 ; 0x80133b <_ZN13thermal_modelL4dataE.lto_priv.400+0x8c> 25a2a: 84 ec ldi r24, 0xC4 ; 196 25a2c: 96 e0 ldi r25, 0x06 ; 6 25a2e: 9f 83 std Y+7, r25 ; 0x07 25a30: 8e 83 std Y+6, r24 ; 0x06 { *var = v; thermal_model::data.reset(rec_buffer[0].pwm, fan_pwm, rec_buffer[0].temp, ambient); float err = 0; uint16_t cnt = 0; for(uint16_t i = 1; i < samples; ++i) { 25a32: e1 e0 ldi r30, 0x01 ; 1 25a34: f0 e0 ldi r31, 0x00 ; 0 25a36: fa 83 std Y+2, r31 ; 0x02 25a38: e9 83 std Y+1, r30 ; 0x01 static float cost_fn(uint16_t samples, float* const var, float v, uint8_t fan_pwm, float ambient) { *var = v; thermal_model::data.reset(rec_buffer[0].pwm, fan_pwm, rec_buffer[0].temp, ambient); float err = 0; uint16_t cnt = 0; 25a3a: 31 2c mov r3, r1 25a3c: 21 2c mov r2, r1 static float cost_fn(uint16_t samples, float* const var, float v, uint8_t fan_pwm, float ambient) { *var = v; thermal_model::data.reset(rec_buffer[0].pwm, fan_pwm, rec_buffer[0].temp, ambient); float err = 0; 25a3e: 81 2c mov r8, r1 25a40: 91 2c mov r9, r1 25a42: 54 01 movw r10, r8 uint16_t cnt = 0; for(uint16_t i = 1; i < samples; ++i) { 25a44: 29 81 ldd r18, Y+1 ; 0x01 25a46: 3a 81 ldd r19, Y+2 ; 0x02 25a48: 8b 81 ldd r24, Y+3 ; 0x03 25a4a: 9c 81 ldd r25, Y+4 ; 0x04 25a4c: 28 17 cp r18, r24 25a4e: 39 07 cpc r19, r25 25a50: c8 f5 brcc .+114 ; 0x25ac4 thermal_model::data.step(rec_buffer[i].pwm, fan_pwm, rec_buffer[i].temp, ambient); 25a52: ee 81 ldd r30, Y+6 ; 0x06 25a54: ff 81 ldd r31, Y+7 ; 0x07 25a56: 25 81 ldd r18, Z+5 ; 0x05 25a58: 36 81 ldd r19, Z+6 ; 0x06 25a5a: 47 81 ldd r20, Z+7 ; 0x07 25a5c: 50 85 ldd r21, Z+8 ; 0x08 25a5e: 83 01 movw r16, r6 25a60: 72 01 movw r14, r4 25a62: 6d 81 ldd r22, Y+5 ; 0x05 25a64: 81 85 ldd r24, Z+9 ; 0x09 25a66: 0e 94 0e e5 call 0x1ca1c ; 0x1ca1c float err_v = thermal_model::data.dT_err_prev; 25a6a: c0 90 d1 12 lds r12, 0x12D1 ; 0x8012d1 <_ZN13thermal_modelL4dataE.lto_priv.400+0x22> 25a6e: d0 90 d2 12 lds r13, 0x12D2 ; 0x8012d2 <_ZN13thermal_modelL4dataE.lto_priv.400+0x23> 25a72: e0 90 d3 12 lds r14, 0x12D3 ; 0x8012d3 <_ZN13thermal_modelL4dataE.lto_priv.400+0x24> 25a76: f0 90 d4 12 lds r15, 0x12D4 ; 0x8012d4 <_ZN13thermal_modelL4dataE.lto_priv.400+0x25> if(!isnan(err_v)) { 25a7a: a7 01 movw r20, r14 25a7c: 96 01 movw r18, r12 25a7e: c7 01 movw r24, r14 25a80: b6 01 movw r22, r12 25a82: 0f 94 0d e1 call 0x3c21a ; 0x3c21a <__unordsf2> 25a86: 81 11 cpse r24, r1 25a88: 11 c0 rjmp .+34 ; 0x25aac err += err_v * err_v; 25a8a: a7 01 movw r20, r14 25a8c: 96 01 movw r18, r12 25a8e: c7 01 movw r24, r14 25a90: b6 01 movw r22, r12 25a92: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 25a96: 9b 01 movw r18, r22 25a98: ac 01 movw r20, r24 25a9a: c5 01 movw r24, r10 25a9c: b4 01 movw r22, r8 25a9e: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 25aa2: 4b 01 movw r8, r22 25aa4: 5c 01 movw r10, r24 ++cnt; 25aa6: ff ef ldi r31, 0xFF ; 255 25aa8: 2f 1a sub r2, r31 25aaa: 3f 0a sbc r3, r31 { *var = v; thermal_model::data.reset(rec_buffer[0].pwm, fan_pwm, rec_buffer[0].temp, ambient); float err = 0; uint16_t cnt = 0; for(uint16_t i = 1; i < samples; ++i) { 25aac: 29 81 ldd r18, Y+1 ; 0x01 25aae: 3a 81 ldd r19, Y+2 ; 0x02 25ab0: 2f 5f subi r18, 0xFF ; 255 25ab2: 3f 4f sbci r19, 0xFF ; 255 25ab4: 3a 83 std Y+2, r19 ; 0x02 25ab6: 29 83 std Y+1, r18 ; 0x01 25ab8: 8e 81 ldd r24, Y+6 ; 0x06 25aba: 9f 81 ldd r25, Y+7 ; 0x07 25abc: 05 96 adiw r24, 0x05 ; 5 25abe: 9f 83 std Y+7, r25 ; 0x07 25ac0: 8e 83 std Y+6, r24 ; 0x06 25ac2: c0 cf rjmp .-128 ; 0x25a44 if(!isnan(err_v)) { err += err_v * err_v; ++cnt; } } return cnt ? (err / cnt) : NAN; 25ac4: 60 e0 ldi r22, 0x00 ; 0 25ac6: 70 e0 ldi r23, 0x00 ; 0 25ac8: 80 ec ldi r24, 0xC0 ; 192 25aca: 9f e7 ldi r25, 0x7F ; 127 25acc: 21 14 cp r2, r1 25ace: 31 04 cpc r3, r1 25ad0: 59 f0 breq .+22 ; 0x25ae8 25ad2: b1 01 movw r22, r2 25ad4: 90 e0 ldi r25, 0x00 ; 0 25ad6: 80 e0 ldi r24, 0x00 ; 0 25ad8: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 25adc: 9b 01 movw r18, r22 25ade: ac 01 movw r20, r24 25ae0: c5 01 movw r24, r10 25ae2: b4 01 movw r22, r8 25ae4: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> } 25ae8: 27 96 adiw r28, 0x07 ; 7 25aea: 0f b6 in r0, 0x3f ; 63 25aec: f8 94 cli 25aee: de bf out 0x3e, r29 ; 62 25af0: 0f be out 0x3f, r0 ; 63 25af2: cd bf out 0x3d, r28 ; 61 25af4: df 91 pop r29 25af6: cf 91 pop r28 25af8: 1f 91 pop r17 25afa: 0f 91 pop r16 25afc: ff 90 pop r15 25afe: ef 90 pop r14 25b00: df 90 pop r13 25b02: cf 90 pop r12 25b04: bf 90 pop r11 25b06: af 90 pop r10 25b08: 9f 90 pop r9 25b0a: 8f 90 pop r8 25b0c: 7f 90 pop r7 25b0e: 6f 90 pop r6 25b10: 5f 90 pop r5 25b12: 4f 90 pop r4 25b14: 3f 90 pop r3 25b16: 2f 90 pop r2 25b18: 08 95 ret 00025b1a : namespace thermal_model_cal { // set current fan speed for both front/backend static __attribute__((noinline)) void set_fan_speed(uint8_t fan_speed) { 25b1a: cf 93 push r28 25b1c: c8 2f mov r28, r24 // reset the fan measuring state due to missing hysteresis handling on the checking side resetFanCheck(); 25b1e: 0e 94 f9 74 call 0xe9f2 ; 0xe9f2 fanSpeed = fan_speed; 25b22: c0 93 e5 03 sts 0x03E5, r28 ; 0x8003e5 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = fan_speed; 25b26: c0 93 a5 04 sts 0x04A5, r28 ; 0x8004a5 #endif } 25b2a: cf 91 pop r28 25b2c: 08 95 ret 00025b2e : thermal_model::data.R[index] = R; thermal_model::setup(); } void thermal_model_report_settings() { 25b2e: cf 92 push r12 25b30: df 92 push r13 25b32: ef 92 push r14 25b34: ff 92 push r15 25b36: 0f 93 push r16 25b38: 1f 93 push r17 25b3a: cf 93 push r28 25b3c: df 93 push r29 SERIAL_ECHO_START; 25b3e: 82 ef ldi r24, 0xF2 ; 242 25b40: 9b ea ldi r25, 0xAB ; 171 25b42: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHOLNPGM("Thermal Model settings:"); 25b46: 80 e5 ldi r24, 0x50 ; 80 25b48: 9f e9 ldi r25, 0x9F ; 159 25b4a: 0e 94 93 79 call 0xf326 ; 0xf326 25b4e: cf ee ldi r28, 0xEF ; 239 25b50: d2 e1 ldi r29, 0x12 ; 18 25b52: 10 e0 ldi r17, 0x00 ; 0 25b54: 00 e0 ldi r16, 0x00 ; 0 for(uint8_t i = 0; i != THERMAL_MODEL_R_SIZE; ++i) printf_P(PSTR("%S M310 I%u R%.2f\n"), echomagic, (unsigned)i, (double)thermal_model::data.R[i]); 25b56: 82 ef ldi r24, 0xF2 ; 242 25b58: e8 2e mov r14, r24 25b5a: 8b ea ldi r24, 0xAB ; 171 25b5c: f8 2e mov r15, r24 25b5e: 9c e3 ldi r25, 0x3C ; 60 25b60: c9 2e mov r12, r25 25b62: 9f e9 ldi r25, 0x9F ; 159 25b64: d9 2e mov r13, r25 25b66: 88 81 ld r24, Y 25b68: 99 81 ldd r25, Y+1 ; 0x01 25b6a: 2a 81 ldd r18, Y+2 ; 0x02 25b6c: 3b 81 ldd r19, Y+3 ; 0x03 25b6e: 24 96 adiw r28, 0x04 ; 4 25b70: 3f 93 push r19 25b72: 2f 93 push r18 25b74: 9f 93 push r25 25b76: 8f 93 push r24 25b78: 1f 93 push r17 25b7a: 0f 93 push r16 25b7c: ff 92 push r15 25b7e: ef 92 push r14 25b80: df 92 push r13 25b82: cf 92 push r12 25b84: 0f 94 99 da call 0x3b532 ; 0x3b532 25b88: 0f 5f subi r16, 0xFF ; 255 25b8a: 1f 4f sbci r17, 0xFF ; 255 void thermal_model_report_settings() { SERIAL_ECHO_START; SERIAL_ECHOLNPGM("Thermal Model settings:"); for(uint8_t i = 0; i != THERMAL_MODEL_R_SIZE; ++i) 25b8c: 8d b7 in r24, 0x3d ; 61 25b8e: 9e b7 in r25, 0x3e ; 62 25b90: 0a 96 adiw r24, 0x0a ; 10 25b92: 0f b6 in r0, 0x3f ; 63 25b94: f8 94 cli 25b96: 9e bf out 0x3e, r25 ; 62 25b98: 0f be out 0x3f, r0 ; 63 25b9a: 8d bf out 0x3d, r24 ; 61 25b9c: 00 31 cpi r16, 0x10 ; 16 25b9e: 11 05 cpc r17, r1 25ba0: 11 f7 brne .-60 ; 0x25b66 printf_P(PSTR("%S M310 I%u R%.2f\n"), echomagic, (unsigned)i, (double)thermal_model::data.R[i]); printf_P(PSTR("%S M310 P%.2f U%.4f V%.2f C%.2f D%.4f L%u S%u B%u E%.2f W%.2f T%.2f\n"), 25ba2: 80 91 32 13 lds r24, 0x1332 ; 0x801332 <_ZN13thermal_modelL4dataE.lto_priv.400+0x83> 25ba6: 8f 93 push r24 25ba8: 80 91 31 13 lds r24, 0x1331 ; 0x801331 <_ZN13thermal_modelL4dataE.lto_priv.400+0x82> 25bac: 8f 93 push r24 25bae: 80 91 30 13 lds r24, 0x1330 ; 0x801330 <_ZN13thermal_modelL4dataE.lto_priv.400+0x81> 25bb2: 8f 93 push r24 25bb4: 80 91 2f 13 lds r24, 0x132F ; 0x80132f <_ZN13thermal_modelL4dataE.lto_priv.400+0x80> 25bb8: 8f 93 push r24 25bba: 80 91 36 13 lds r24, 0x1336 ; 0x801336 <_ZN13thermal_modelL4dataE.lto_priv.400+0x87> 25bbe: 8f 93 push r24 25bc0: 80 91 35 13 lds r24, 0x1335 ; 0x801335 <_ZN13thermal_modelL4dataE.lto_priv.400+0x86> 25bc4: 8f 93 push r24 25bc6: 80 91 34 13 lds r24, 0x1334 ; 0x801334 <_ZN13thermal_modelL4dataE.lto_priv.400+0x85> 25bca: 8f 93 push r24 25bcc: 80 91 33 13 lds r24, 0x1333 ; 0x801333 <_ZN13thermal_modelL4dataE.lto_priv.400+0x84> 25bd0: 8f 93 push r24 25bd2: 80 91 3a 13 lds r24, 0x133A ; 0x80133a <_ZN13thermal_modelL4dataE.lto_priv.400+0x8b> 25bd6: 8f 93 push r24 25bd8: 80 91 39 13 lds r24, 0x1339 ; 0x801339 <_ZN13thermal_modelL4dataE.lto_priv.400+0x8a> 25bdc: 8f 93 push r24 25bde: 80 91 38 13 lds r24, 0x1338 ; 0x801338 <_ZN13thermal_modelL4dataE.lto_priv.400+0x89> 25be2: 8f 93 push r24 25be4: 80 91 37 13 lds r24, 0x1337 ; 0x801337 <_ZN13thermal_modelL4dataE.lto_priv.400+0x88> 25be8: 8f 93 push r24 25bea: 80 91 3d 02 lds r24, 0x023D ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.455> 25bee: 1f 92 push r1 25bf0: 8f 93 push r24 25bf2: 80 91 1c 05 lds r24, 0x051C ; 0x80051c <_ZN13thermal_modelL7enabledE.lto_priv.456> 25bf6: 1f 92 push r1 25bf8: 8f 93 push r24 25bfa: 80 91 ee 12 lds r24, 0x12EE ; 0x8012ee <_ZN13thermal_modelL4dataE.lto_priv.400+0x3f> 25bfe: 8f 93 push r24 25c00: 80 91 ed 12 lds r24, 0x12ED ; 0x8012ed <_ZN13thermal_modelL4dataE.lto_priv.400+0x3e> 25c04: 8f 93 push r24 25c06: 80 91 ec 12 lds r24, 0x12EC ; 0x8012ec <_ZN13thermal_modelL4dataE.lto_priv.400+0x3d> 25c0a: 8f 93 push r24 25c0c: 80 91 eb 12 lds r24, 0x12EB ; 0x8012eb <_ZN13thermal_modelL4dataE.lto_priv.400+0x3c> 25c10: 8f 93 push r24 25c12: 80 91 ea 12 lds r24, 0x12EA ; 0x8012ea <_ZN13thermal_modelL4dataE.lto_priv.400+0x3b> 25c16: 8f 93 push r24 25c18: 80 91 e9 12 lds r24, 0x12E9 ; 0x8012e9 <_ZN13thermal_modelL4dataE.lto_priv.400+0x3a> 25c1c: 8f 93 push r24 25c1e: 80 91 e8 12 lds r24, 0x12E8 ; 0x8012e8 <_ZN13thermal_modelL4dataE.lto_priv.400+0x39> 25c22: 8f 93 push r24 25c24: 80 91 e7 12 lds r24, 0x12E7 ; 0x8012e7 <_ZN13thermal_modelL4dataE.lto_priv.400+0x38> 25c28: 8f 93 push r24 25c2a: 80 91 e6 12 lds r24, 0x12E6 ; 0x8012e6 <_ZN13thermal_modelL4dataE.lto_priv.400+0x37> 25c2e: 8f 93 push r24 25c30: 80 91 e5 12 lds r24, 0x12E5 ; 0x8012e5 <_ZN13thermal_modelL4dataE.lto_priv.400+0x36> 25c34: 8f 93 push r24 25c36: 80 91 e4 12 lds r24, 0x12E4 ; 0x8012e4 <_ZN13thermal_modelL4dataE.lto_priv.400+0x35> 25c3a: 8f 93 push r24 25c3c: 80 91 e3 12 lds r24, 0x12E3 ; 0x8012e3 <_ZN13thermal_modelL4dataE.lto_priv.400+0x34> 25c40: 8f 93 push r24 25c42: 80 91 e2 12 lds r24, 0x12E2 ; 0x8012e2 <_ZN13thermal_modelL4dataE.lto_priv.400+0x33> 25c46: 8f 93 push r24 25c48: 80 91 e1 12 lds r24, 0x12E1 ; 0x8012e1 <_ZN13thermal_modelL4dataE.lto_priv.400+0x32> 25c4c: 8f 93 push r24 25c4e: 80 91 e0 12 lds r24, 0x12E0 ; 0x8012e0 <_ZN13thermal_modelL4dataE.lto_priv.400+0x31> 25c52: 8f 93 push r24 25c54: 80 91 df 12 lds r24, 0x12DF ; 0x8012df <_ZN13thermal_modelL4dataE.lto_priv.400+0x30> 25c58: 8f 93 push r24 25c5a: 80 91 de 12 lds r24, 0x12DE ; 0x8012de <_ZN13thermal_modelL4dataE.lto_priv.400+0x2f> 25c5e: 8f 93 push r24 25c60: 80 91 dd 12 lds r24, 0x12DD ; 0x8012dd <_ZN13thermal_modelL4dataE.lto_priv.400+0x2e> 25c64: 8f 93 push r24 25c66: 80 91 dc 12 lds r24, 0x12DC ; 0x8012dc <_ZN13thermal_modelL4dataE.lto_priv.400+0x2d> 25c6a: 8f 93 push r24 25c6c: 80 91 db 12 lds r24, 0x12DB ; 0x8012db <_ZN13thermal_modelL4dataE.lto_priv.400+0x2c> 25c70: 8f 93 push r24 25c72: 80 91 da 12 lds r24, 0x12DA ; 0x8012da <_ZN13thermal_modelL4dataE.lto_priv.400+0x2b> 25c76: 8f 93 push r24 25c78: 80 91 d9 12 lds r24, 0x12D9 ; 0x8012d9 <_ZN13thermal_modelL4dataE.lto_priv.400+0x2a> 25c7c: 8f 93 push r24 25c7e: ff 92 push r15 25c80: ef 92 push r14 25c82: 86 ef ldi r24, 0xF6 ; 246 25c84: 9e e9 ldi r25, 0x9E ; 158 25c86: 9f 93 push r25 25c88: 8f 93 push r24 25c8a: 0f 94 99 da call 0x3b532 ; 0x3b532 25c8e: 8d b7 in r24, 0x3d ; 61 25c90: 9e b7 in r25, 0x3e ; 62 25c92: 8a 96 adiw r24, 0x2a ; 42 25c94: 0f b6 in r0, 0x3f ; 63 25c96: f8 94 cli 25c98: 9e bf out 0x3e, r25 ; 62 25c9a: 0f be out 0x3f, r0 ; 63 25c9c: 8d bf out 0x3d, r24 ; 61 echomagic, (double)thermal_model::data.P, (double)thermal_model::data.U, (double)thermal_model::data.V, (double)thermal_model::data.C, (double)thermal_model::data.fS, (unsigned)thermal_model::data.L, (unsigned)thermal_model::enabled, (unsigned)thermal_model::warn_beep, (double)thermal_model::data.err, (double)thermal_model::data.warn, (double)thermal_model::data.Ta_corr); } 25c9e: df 91 pop r29 25ca0: cf 91 pop r28 25ca2: 1f 91 pop r17 25ca4: 0f 91 pop r16 25ca6: ff 90 pop r15 25ca8: ef 90 pop r14 25caa: df 90 pop r13 25cac: cf 90 pop r12 25cae: 08 95 ret 00025cb0 : // set the model lag rounding to the effective sample resolution, ensuring the reported/stored lag // matches the current model constraints (future-proofing for model changes) static void thermal_model_set_lag(uint16_t ms) { static const uint16_t intv_ms = (uint16_t)(TEMP_MGR_INTV * 1000); uint16_t samples = ((ms + intv_ms/2) / intv_ms); 25cb0: 89 57 subi r24, 0x79 ; 121 25cb2: 9f 4f sbci r25, 0xFF ; 255 25cb4: 6e e0 ldi r22, 0x0E ; 14 25cb6: 71 e0 ldi r23, 0x01 ; 1 25cb8: 0f 94 a0 dc call 0x3b940 ; 0x3b940 <__udivmodhi4> // ensure we do not exceed the maximum lag buffer and have at least one lag sample for filtering if(samples < 1) 25cbc: 61 15 cp r22, r1 25cbe: 71 05 cpc r23, r1 25cc0: 99 f0 breq .+38 ; 0x25ce8 25cc2: 69 30 cpi r22, 0x09 ; 9 25cc4: 71 05 cpc r23, r1 25cc6: 10 f0 brcs .+4 ; 0x25ccc 25cc8: 68 e0 ldi r22, 0x08 ; 8 25cca: 70 e0 ldi r23, 0x00 ; 0 samples = 1; else if(samples > THERMAL_MODEL_MAX_LAG_SIZE) samples = THERMAL_MODEL_MAX_LAG_SIZE; // round back to ms thermal_model::data.L = samples * intv_ms; 25ccc: 2e e0 ldi r18, 0x0E ; 14 25cce: 31 e0 ldi r19, 0x01 ; 1 25cd0: 62 9f mul r22, r18 25cd2: c0 01 movw r24, r0 25cd4: 63 9f mul r22, r19 25cd6: 90 0d add r25, r0 25cd8: 72 9f mul r23, r18 25cda: 90 0d add r25, r0 25cdc: 11 24 eor r1, r1 25cde: 90 93 ee 12 sts 0x12EE, r25 ; 0x8012ee <_ZN13thermal_modelL4dataE.lto_priv.400+0x3f> 25ce2: 80 93 ed 12 sts 0x12ED, r24 ; 0x8012ed <_ZN13thermal_modelL4dataE.lto_priv.400+0x3e> } 25ce6: 08 95 ret static const uint16_t intv_ms = (uint16_t)(TEMP_MGR_INTV * 1000); uint16_t samples = ((ms + intv_ms/2) / intv_ms); // ensure we do not exceed the maximum lag buffer and have at least one lag sample for filtering if(samples < 1) samples = 1; 25ce8: 61 e0 ldi r22, 0x01 ; 1 25cea: 70 e0 ldi r23, 0x00 ; 0 25cec: ef cf rjmp .-34 ; 0x25ccc 00025cee : if(!calibrated()) enabled = false; reinitialize(); } static bool calibrated() { 25cee: cf 93 push r28 25cf0: df 93 push r29 if(!(data.P > 0)) return false; 25cf2: 20 e0 ldi r18, 0x00 ; 0 25cf4: 30 e0 ldi r19, 0x00 ; 0 25cf6: a9 01 movw r20, r18 25cf8: 60 91 d9 12 lds r22, 0x12D9 ; 0x8012d9 <_ZN13thermal_modelL4dataE.lto_priv.400+0x2a> 25cfc: 70 91 da 12 lds r23, 0x12DA ; 0x8012da <_ZN13thermal_modelL4dataE.lto_priv.400+0x2b> 25d00: 80 91 db 12 lds r24, 0x12DB ; 0x8012db <_ZN13thermal_modelL4dataE.lto_priv.400+0x2c> 25d04: 90 91 dc 12 lds r25, 0x12DC ; 0x8012dc <_ZN13thermal_modelL4dataE.lto_priv.400+0x2d> 25d08: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 25d0c: 18 16 cp r1, r24 25d0e: 0c f0 brlt .+2 ; 0x25d12 25d10: 54 c0 rjmp .+168 ; 0x25dba if(isnan(data.U)) return false; 25d12: 60 91 dd 12 lds r22, 0x12DD ; 0x8012dd <_ZN13thermal_modelL4dataE.lto_priv.400+0x2e> 25d16: 70 91 de 12 lds r23, 0x12DE ; 0x8012de <_ZN13thermal_modelL4dataE.lto_priv.400+0x2f> 25d1a: 80 91 df 12 lds r24, 0x12DF ; 0x8012df <_ZN13thermal_modelL4dataE.lto_priv.400+0x30> 25d1e: 90 91 e0 12 lds r25, 0x12E0 ; 0x8012e0 <_ZN13thermal_modelL4dataE.lto_priv.400+0x31> 25d22: 9b 01 movw r18, r22 25d24: ac 01 movw r20, r24 25d26: 0f 94 0d e1 call 0x3c21a ; 0x3c21a <__unordsf2> 25d2a: 81 11 cpse r24, r1 25d2c: 46 c0 rjmp .+140 ; 0x25dba if(isnan(data.V)) return false; 25d2e: 60 91 e1 12 lds r22, 0x12E1 ; 0x8012e1 <_ZN13thermal_modelL4dataE.lto_priv.400+0x32> 25d32: 70 91 e2 12 lds r23, 0x12E2 ; 0x8012e2 <_ZN13thermal_modelL4dataE.lto_priv.400+0x33> 25d36: 80 91 e3 12 lds r24, 0x12E3 ; 0x8012e3 <_ZN13thermal_modelL4dataE.lto_priv.400+0x34> 25d3a: 90 91 e4 12 lds r25, 0x12E4 ; 0x8012e4 <_ZN13thermal_modelL4dataE.lto_priv.400+0x35> 25d3e: 9b 01 movw r18, r22 25d40: ac 01 movw r20, r24 25d42: 0f 94 0d e1 call 0x3c21a ; 0x3c21a <__unordsf2> 25d46: 81 11 cpse r24, r1 25d48: 38 c0 rjmp .+112 ; 0x25dba if(!(data.C > 0)) return false; 25d4a: 20 e0 ldi r18, 0x00 ; 0 25d4c: 30 e0 ldi r19, 0x00 ; 0 25d4e: a9 01 movw r20, r18 25d50: 60 91 e5 12 lds r22, 0x12E5 ; 0x8012e5 <_ZN13thermal_modelL4dataE.lto_priv.400+0x36> 25d54: 70 91 e6 12 lds r23, 0x12E6 ; 0x8012e6 <_ZN13thermal_modelL4dataE.lto_priv.400+0x37> 25d58: 80 91 e7 12 lds r24, 0x12E7 ; 0x8012e7 <_ZN13thermal_modelL4dataE.lto_priv.400+0x38> 25d5c: 90 91 e8 12 lds r25, 0x12E8 ; 0x8012e8 <_ZN13thermal_modelL4dataE.lto_priv.400+0x39> 25d60: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 25d64: 18 16 cp r1, r24 25d66: 4c f5 brge .+82 ; 0x25dba if(isnan(data.fS)) return false; 25d68: 60 91 e9 12 lds r22, 0x12E9 ; 0x8012e9 <_ZN13thermal_modelL4dataE.lto_priv.400+0x3a> 25d6c: 70 91 ea 12 lds r23, 0x12EA ; 0x8012ea <_ZN13thermal_modelL4dataE.lto_priv.400+0x3b> 25d70: 80 91 eb 12 lds r24, 0x12EB ; 0x8012eb <_ZN13thermal_modelL4dataE.lto_priv.400+0x3c> 25d74: 90 91 ec 12 lds r25, 0x12EC ; 0x8012ec <_ZN13thermal_modelL4dataE.lto_priv.400+0x3d> 25d78: 9b 01 movw r18, r22 25d7a: ac 01 movw r20, r24 25d7c: 0f 94 0d e1 call 0x3c21a ; 0x3c21a <__unordsf2> 25d80: 81 11 cpse r24, r1 25d82: 1b c0 rjmp .+54 ; 0x25dba if(!(data.L > 0)) return false; 25d84: 80 91 ed 12 lds r24, 0x12ED ; 0x8012ed <_ZN13thermal_modelL4dataE.lto_priv.400+0x3e> 25d88: 90 91 ee 12 lds r25, 0x12EE ; 0x8012ee <_ZN13thermal_modelL4dataE.lto_priv.400+0x3f> 25d8c: 89 2b or r24, r25 25d8e: a9 f0 breq .+42 ; 0x25dba 25d90: cf ee ldi r28, 0xEF ; 239 25d92: d2 e1 ldi r29, 0x12 ; 18 if(!(data.Ta_corr != NAN)) return false; for(uint8_t i = 0; i != THERMAL_MODEL_R_SIZE; ++i) { if(!(thermal_model::data.R[i] >= 0)) 25d94: 69 91 ld r22, Y+ 25d96: 79 91 ld r23, Y+ 25d98: 89 91 ld r24, Y+ 25d9a: 99 91 ld r25, Y+ 25d9c: 20 e0 ldi r18, 0x00 ; 0 25d9e: 30 e0 ldi r19, 0x00 ; 0 25da0: a9 01 movw r20, r18 25da2: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 25da6: 87 fd sbrc r24, 7 25da8: 08 c0 rjmp .+16 ; 0x25dba if(isnan(data.V)) return false; if(!(data.C > 0)) return false; if(isnan(data.fS)) return false; if(!(data.L > 0)) return false; if(!(data.Ta_corr != NAN)) return false; for(uint8_t i = 0; i != THERMAL_MODEL_R_SIZE; ++i) { 25daa: 83 e1 ldi r24, 0x13 ; 19 25dac: cf 32 cpi r28, 0x2F ; 47 25dae: d8 07 cpc r29, r24 25db0: 89 f7 brne .-30 ; 0x25d94 if(!(thermal_model::data.R[i] >= 0)) return false; } if(!(data.warn != NAN)) return false; if(!(data.err != NAN)) return false; return true; 25db2: 81 e0 ldi r24, 0x01 ; 1 } 25db4: df 91 pop r29 25db6: cf 91 pop r28 25db8: 08 95 ret reinitialize(); } static bool calibrated() { if(!(data.P > 0)) return false; 25dba: 80 e0 ldi r24, 0x00 ; 0 25dbc: fb cf rjmp .-10 ; 0x25db4 00025dbe : } // verify calibration status and trigger a model reset if valid static void setup() { if(!calibrated()) enabled = false; 25dbe: 0f 94 77 2e call 0x25cee ; 0x25cee 25dc2: 81 11 cpse r24, r1 25dc4: 02 c0 rjmp .+4 ; 0x25dca 25dc6: 10 92 1c 05 sts 0x051C, r1 ; 0x80051c <_ZN13thermal_modelL7enabledE.lto_priv.456> } // clear error flags and mark as uninitialized static void reinitialize() { data.flags = 1; // shorcut to reset all error flags 25dca: 81 e0 ldi r24, 0x01 ; 1 25dcc: 80 93 3b 13 sts 0x133B, r24 ; 0x80133b <_ZN13thermal_modelL4dataE.lto_priv.400+0x8c> warning_state.assert = false; // explicitly clear assertions 25dd0: 80 91 38 06 lds r24, 0x0638 ; 0x800638 25dd4: 8d 7f andi r24, 0xFD ; 253 25dd6: 80 93 38 06 sts 0x0638, r24 ; 0x800638 // verify calibration status and trigger a model reset if valid static void setup() { if(!calibrated()) enabled = false; reinitialize(); } 25dda: 08 95 ret 00025ddc : } ENABLE_TEMP_MGR_INTERRUPT(); } void disable_heater() { 25ddc: 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; 25dde: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 25de2: 10 92 b5 0d sts 0x0DB5, r1 ; 0x800db5 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 25de6: 10 92 72 06 sts 0x0672, r1 ; 0x800672 25dea: 10 92 71 06 sts 0x0671, r1 ; 0x800671 setTargetHotend(0); setTargetBed(0); ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 25dee: cf b7 in r28, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 25df0: f8 94 cli // propagate all values down the chain setIsrTargetTemperatures(); 25df2: 0f 94 69 13 call 0x226d2 ; 0x226d2 temp_mgr_pid(); 25df6: 0f 94 a6 10 call 0x2214c ; 0x2214c // 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); 25dfa: 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; 25dfc: 10 92 8c 06 sts 0x068C, r1 ; 0x80068c (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 25e00: cf bf out 0x3f, r28 ; 63 #endif } } 25e02: cf 91 pop r28 25e04: 08 95 ret 00025e06 : /* Menu implementation */ static void lcd_cooldown() { disable_heater(); 25e06: 0f 94 ee 2e call 0x25ddc ; 0x25ddc fanSpeed = 0; 25e0a: 10 92 e5 03 sts 0x03E5, r1 ; 0x8003e5 lcd_return_to_status(); 25e0e: 0d 94 7c 1e jmp 0x23cf8 ; 0x23cf8 00025e12 : // 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) { 25e12: 1f 93 push r17 25e14: cf 93 push r28 25e16: df 93 push r29 25e18: c8 2f mov r28, r24 25e1a: 16 2f mov r17, r22 25e1c: d4 2f mov r29, r20 // save the original target temperatures for recovery before disabling heaters if(!temp_error_state.error && !saved_printing) { 25e1e: 80 91 1a 05 lds r24, 0x051A ; 0x80051a <_ZL16temp_error_state.lto_priv.454> 25e22: 80 fd sbrc r24, 0 25e24: 18 c0 rjmp .+48 ; 0x25e56 25e26: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 25e2a: 81 11 cpse r24, r1 25e2c: 14 c0 rjmp .+40 ; 0x25e56 saved_bed_temperature = target_temperature_bed; 25e2e: 80 91 71 06 lds r24, 0x0671 ; 0x800671 25e32: 80 93 ad 05 sts 0x05AD, r24 ; 0x8005ad saved_extruder_temperature = target_temperature[index]; 25e36: e6 2f mov r30, r22 25e38: f0 e0 ldi r31, 0x00 ; 0 25e3a: ee 0f add r30, r30 25e3c: ff 1f adc r31, r31 25e3e: eb 54 subi r30, 0x4B ; 75 25e40: f2 4f sbci r31, 0xF2 ; 242 25e42: 80 81 ld r24, Z 25e44: 91 81 ldd r25, Z+1 ; 0x01 25e46: 90 93 ac 05 sts 0x05AC, r25 ; 0x8005ac 25e4a: 80 93 ab 05 sts 0x05AB, r24 ; 0x8005ab saved_fan_speed = fanSpeed; 25e4e: 80 91 e5 03 lds r24, 0x03E5 ; 0x8003e5 25e52: 80 93 aa 05 sts 0x05AA, r24 ; 0x8005aa } // keep disabling heaters and keep fans on as long as the condition is asserted disable_heater(); 25e56: 0f 94 ee 2e call 0x25ddc ; 0x25ddc void hotendFanSetFullSpeed() { #ifdef EXTRUDER_ALTFAN_DETECT altfanStatus.altfanOverride = 1; //full speed #endif //EXTRUDER_ALTFAN_DETECT resetFanCheck(); 25e5a: 0e 94 f9 74 call 0xe9f2 ; 0xe9f2 setExtruderAutoFanState(3); 25e5e: 83 e0 ldi r24, 0x03 ; 3 25e60: 0e 94 73 75 call 0xeae6 ; 0xeae6 SET_OUTPUT(FAN_PIN); 25e64: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 25e68: 88 60 ori r24, 0x08 ; 8 25e6a: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = 255; 25e6e: 8f ef ldi r24, 0xFF ; 255 25e70: 80 93 a5 04 sts 0x04A5, r24 ; 0x8004a5 #else //FAN_SOFT_PWM analogWrite(FAN_PIN, 255); #endif //FAN_SOFT_PWM fanSpeed = 255; 25e74: 80 93 e5 03 sts 0x03E5, r24 ; 0x8003e5 hotendFanSetFullSpeed(); // set the initial error source to the highest priority error if(!temp_error_state.error || (uint8_t)type < temp_error_state.type) { 25e78: 80 91 1a 05 lds r24, 0x051A ; 0x80051a <_ZL16temp_error_state.lto_priv.454> 25e7c: 80 ff sbrs r24, 0 25e7e: 07 c0 rjmp .+14 ; 0x25e8e 25e80: 80 91 1a 05 lds r24, 0x051A ; 0x80051a <_ZL16temp_error_state.lto_priv.454> 25e84: 82 95 swap r24 25e86: 86 95 lsr r24 25e88: 87 70 andi r24, 0x07 ; 7 25e8a: d8 17 cp r29, r24 25e8c: c0 f4 brcc .+48 ; 0x25ebe temp_error_state.source = (uint8_t)source; 25e8e: c3 70 andi r28, 0x03 ; 3 25e90: cc 0f add r28, r28 25e92: cc 0f add r28, r28 25e94: 80 91 1a 05 lds r24, 0x051A ; 0x80051a <_ZL16temp_error_state.lto_priv.454> 25e98: 83 7f andi r24, 0xF3 ; 243 25e9a: 8c 2b or r24, r28 25e9c: 80 93 1a 05 sts 0x051A, r24 ; 0x80051a <_ZL16temp_error_state.lto_priv.454> temp_error_state.index = index; 25ea0: 80 91 1a 05 lds r24, 0x051A ; 0x80051a <_ZL16temp_error_state.lto_priv.454> 25ea4: 10 fb bst r17, 0 25ea6: 84 f9 bld r24, 4 25ea8: 80 93 1a 05 sts 0x051A, r24 ; 0x80051a <_ZL16temp_error_state.lto_priv.454> temp_error_state.type = (uint8_t)type; 25eac: d2 95 swap r29 25eae: dd 0f add r29, r29 25eb0: d0 7e andi r29, 0xE0 ; 224 25eb2: 40 91 1a 05 lds r20, 0x051A ; 0x80051a <_ZL16temp_error_state.lto_priv.454> 25eb6: 4f 71 andi r20, 0x1F ; 31 25eb8: 4d 2b or r20, r29 25eba: 40 93 1a 05 sts 0x051A, r20 ; 0x80051a <_ZL16temp_error_state.lto_priv.454> } // always set the error state temp_error_state.error = true; 25ebe: 80 91 1a 05 lds r24, 0x051A ; 0x80051a <_ZL16temp_error_state.lto_priv.454> 25ec2: 81 60 ori r24, 0x01 ; 1 25ec4: 80 93 1a 05 sts 0x051A, r24 ; 0x80051a <_ZL16temp_error_state.lto_priv.454> temp_error_state.assert = true; 25ec8: 80 91 1a 05 lds r24, 0x051A ; 0x80051a <_ZL16temp_error_state.lto_priv.454> 25ecc: 82 60 ori r24, 0x02 ; 2 25ece: 80 93 1a 05 sts 0x051A, r24 ; 0x80051a <_ZL16temp_error_state.lto_priv.454> } 25ed2: df 91 pop r29 25ed4: cf 91 pop r28 25ed6: 1f 91 pop r17 25ed8: 08 95 ret 00025eda : } void check_min_temp_bed() { #if HEATER_BED_RAW_LO_TEMP > HEATER_BED_RAW_HI_TEMP if (current_temperature_bed_raw >= bed_minttemp_raw) { 25eda: 20 91 08 06 lds r18, 0x0608 ; 0x800608 25ede: 30 91 09 06 lds r19, 0x0609 ; 0x800609 25ee2: 80 91 52 02 lds r24, 0x0252 ; 0x800252 <_ZL16bed_minttemp_raw.lto_priv.471> 25ee6: 90 91 53 02 lds r25, 0x0253 ; 0x800253 <_ZL16bed_minttemp_raw.lto_priv.471+0x1> 25eea: 28 17 cp r18, r24 25eec: 39 07 cpc r19, r25 25eee: 2c f0 brlt .+10 ; 0x25efa #else if (current_temperature_bed_raw <= bed_minttemp_raw) { #endif set_temp_error(TempErrorSource::bed, 0, TempErrorType::min); 25ef0: 41 e0 ldi r20, 0x01 ; 1 25ef2: 60 e0 ldi r22, 0x00 ; 0 25ef4: 81 e0 ldi r24, 0x01 ; 1 25ef6: 0d 94 09 2f jmp 0x25e12 ; 0x25e12 } } 25efa: 08 95 ret 00025efc : 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]) { 25efc: 20 91 0a 06 lds r18, 0x060A ; 0x80060a 25f00: 30 91 0b 06 lds r19, 0x060B ; 0x80060b 25f04: 80 91 54 02 lds r24, 0x0254 ; 0x800254 <_ZL12minttemp_raw.lto_priv.472> 25f08: 90 91 55 02 lds r25, 0x0255 ; 0x800255 <_ZL12minttemp_raw.lto_priv.472+0x1> 25f0c: 28 17 cp r18, r24 25f0e: 39 07 cpc r19, r25 25f10: 2c f0 brlt .+10 ; 0x25f1c #else if (current_temperature_raw[0] <= minttemp_raw[0]) { #endif set_temp_error(TempErrorSource::hotend, 0, TempErrorType::min); 25f12: 41 e0 ldi r20, 0x01 ; 1 25f14: 60 e0 ldi r22, 0x00 ; 0 25f16: 80 e0 ldi r24, 0x00 ; 0 25f18: 0d 94 09 2f jmp 0x25e12 ; 0x25e12 } } 25f1c: 08 95 ret 00025f1e : 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) { 25f1e: 2f 92 push r2 25f20: 3f 92 push r3 25f22: 4f 92 push r4 25f24: 5f 92 push r5 25f26: 6f 92 push r6 25f28: 7f 92 push r7 25f2a: 8f 92 push r8 25f2c: 9f 92 push r9 25f2e: af 92 push r10 25f30: bf 92 push r11 25f32: cf 92 push r12 25f34: df 92 push r13 25f36: ef 92 push r14 25f38: ff 92 push r15 25f3a: 0f 93 push r16 25f3c: 1f 93 push r17 25f3e: cf 93 push r28 25f40: df 93 push r29 25f42: cd b7 in r28, 0x3d ; 61 25f44: de b7 in r29, 0x3e ; 62 25f46: 2c 97 sbiw r28, 0x0c ; 12 25f48: 0f b6 in r0, 0x3f ; 63 25f4a: f8 94 cli 25f4c: de bf out 0x3e, r29 ; 62 25f4e: 0f be out 0x3f, r0 ; 63 25f50: cd bf out 0x3d, r28 ; 61 25f52: 28 2e mov r2, r24 25f54: 49 83 std Y+1, r20 ; 0x01 25f56: 5a 83 std Y+2, r21 ; 0x02 25f58: 6b 83 std Y+3, r22 ; 0x03 25f5a: 7c 83 std Y+4, r23 ; 0x04 25f5c: 28 01 movw r4, r16 25f5e: 39 01 movw r6, r18 25f60: 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) 25f62: 0f 94 22 29 call 0x25244 ; 0x25244 25f66: 02 2d mov r16, r2 25f68: 10 e0 ldi r17, 0x00 ; 0 25f6a: 98 01 movw r18, r16 25f6c: 22 0f add r18, r18 25f6e: 33 1f adc r19, r19 25f70: 22 0f add r18, r18 25f72: 33 1f adc r19, r19 25f74: 3c 87 std Y+12, r19 ; 0x0c 25f76: 2b 87 std Y+11, r18 ; 0x0b 25f78: f9 01 movw r30, r18 25f7a: e8 53 subi r30, 0x38 ; 56 25f7c: fa 4f sbci r31, 0xFA ; 250 25f7e: 80 80 ld r8, Z 25f80: 91 80 ldd r9, Z+1 ; 0x01 25f82: a2 80 ldd r10, Z+2 ; 0x02 25f84: b3 80 ldd r11, Z+3 ; 0x03 25f86: 68 19 sub r22, r8 25f88: 79 09 sbc r23, r9 25f8a: 8a 09 sbc r24, r10 25f8c: 9b 09 sbc r25, r11 25f8e: 61 3d cpi r22, 0xD1 ; 209 25f90: 77 40 sbci r23, 0x07 ; 7 25f92: 81 05 cpc r24, r1 25f94: 91 05 cpc r25, r1 25f96: 08 f4 brcc .+2 ; 0x25f9a 25f98: ea c0 rjmp .+468 ; 0x2616e { #ifdef TEMP_RUNAWAY_BED_TIMEOUT if (_isbed) 25f9a: 33 20 and r3, r3 25f9c: 09 f4 brne .+2 ; 0x25fa0 25f9e: 75 c0 rjmp .+234 ; 0x2608a { __hysteresis = TEMP_RUNAWAY_BED_HYSTERESIS; __timeout = TEMP_RUNAWAY_BED_TIMEOUT; 25fa0: 88 e6 ldi r24, 0x68 ; 104 25fa2: 91 e0 ldi r25, 0x01 ; 1 25fa4: 9a 87 std Y+10, r25 ; 0x0a 25fa6: 89 87 std Y+9, r24 ; 0x09 { #ifdef TEMP_RUNAWAY_BED_TIMEOUT if (_isbed) { __hysteresis = TEMP_RUNAWAY_BED_HYSTERESIS; 25fa8: 80 e0 ldi r24, 0x00 ; 0 25faa: 90 e0 ldi r25, 0x00 ; 0 25fac: a0 ea ldi r26, 0xA0 ; 160 25fae: b0 e4 ldi r27, 0x40 ; 64 } #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; 25fb0: 8d 83 std Y+5, r24 ; 0x05 25fb2: 9e 83 std Y+6, r25 ; 0x06 25fb4: af 83 std Y+7, r26 ; 0x07 25fb6: b8 87 std Y+8, r27 ; 0x08 __timeout = TEMP_RUNAWAY_EXTRUDER_TIMEOUT; } #endif temp_runaway_timer[_heater_id] = _millis(); 25fb8: 0f 94 22 29 call 0x25244 ; 0x25244 25fbc: eb 85 ldd r30, Y+11 ; 0x0b 25fbe: fc 85 ldd r31, Y+12 ; 0x0c 25fc0: e8 53 subi r30, 0x38 ; 56 25fc2: fa 4f sbci r31, 0xFA ; 250 25fc4: 60 83 st Z, r22 25fc6: 71 83 std Z+1, r23 ; 0x01 25fc8: 82 83 std Z+2, r24 ; 0x02 25fca: 93 83 std Z+3, r25 ; 0x03 if (_output == 0) 25fcc: 20 e0 ldi r18, 0x00 ; 0 25fce: 30 e0 ldi r19, 0x00 ; 0 25fd0: a9 01 movw r20, r18 25fd2: c7 01 movw r24, r14 25fd4: b6 01 movw r22, r12 25fd6: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 25fda: 81 11 cpse r24, r1 25fdc: 07 c0 rjmp .+14 ; 0x25fec { temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 25fde: f8 01 movw r30, r16 25fe0: ee 0f add r30, r30 25fe2: ff 1f adc r31, r31 25fe4: ec 53 subi r30, 0x3C ; 60 25fe6: fa 4f sbci r31, 0xFA ; 250 25fe8: 11 82 std Z+1, r1 ; 0x01 25fea: 10 82 st Z, r1 } if (temp_runaway_target[_heater_id] != _target_temperature) 25fec: ab 85 ldd r26, Y+11 ; 0x0b 25fee: bc 85 ldd r27, Y+12 ; 0x0c 25ff0: a4 54 subi r26, 0x44 ; 68 25ff2: ba 4f sbci r27, 0xFA ; 250 25ff4: 5d 01 movw r10, r26 25ff6: 29 81 ldd r18, Y+1 ; 0x01 25ff8: 3a 81 ldd r19, Y+2 ; 0x02 25ffa: 4b 81 ldd r20, Y+3 ; 0x03 25ffc: 5c 81 ldd r21, Y+4 ; 0x04 25ffe: 6d 91 ld r22, X+ 26000: 7d 91 ld r23, X+ 26002: 8d 91 ld r24, X+ 26004: 9c 91 ld r25, X 26006: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 2600a: 88 23 and r24, r24 2600c: 09 f4 brne .+2 ; 0x26010 2600e: 91 c0 rjmp .+290 ; 0x26132 { if (_target_temperature > 0) 26010: 20 e0 ldi r18, 0x00 ; 0 26012: 30 e0 ldi r19, 0x00 ; 0 26014: a9 01 movw r20, r18 26016: 69 81 ldd r22, Y+1 ; 0x01 26018: 7a 81 ldd r23, Y+2 ; 0x02 2601a: 8b 81 ldd r24, Y+3 ; 0x03 2601c: 9c 81 ldd r25, Y+4 ; 0x04 2601e: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 26022: f8 01 movw r30, r16 26024: e6 54 subi r30, 0x46 ; 70 26026: fa 4f sbci r31, 0xFA ; 250 26028: 18 16 cp r1, r24 2602a: c4 f5 brge .+112 ; 0x2609c { temp_runaway_status[_heater_id] = TempRunaway_PREHEAT; 2602c: 81 e0 ldi r24, 0x01 ; 1 2602e: 80 83 st Z, r24 temp_runaway_target[_heater_id] = _target_temperature; 26030: 89 81 ldd r24, Y+1 ; 0x01 26032: 9a 81 ldd r25, Y+2 ; 0x02 26034: ab 81 ldd r26, Y+3 ; 0x03 26036: bc 81 ldd r27, Y+4 ; 0x04 26038: f5 01 movw r30, r10 2603a: 80 83 st Z, r24 2603c: 91 83 std Z+1, r25 ; 0x01 2603e: a2 83 std Z+2, r26 ; 0x02 26040: b3 83 std Z+3, r27 ; 0x03 __preheat_start[_heater_id] = _current_temperature; 26042: eb 85 ldd r30, Y+11 ; 0x0b 26044: fc 85 ldd r31, Y+12 ; 0x0c 26046: ee 54 subi r30, 0x4E ; 78 26048: fa 4f sbci r31, 0xFA ; 250 2604a: 40 82 st Z, r4 2604c: 51 82 std Z+1, r5 ; 0x01 2604e: 62 82 std Z+2, r6 ; 0x02 26050: 73 82 std Z+3, r7 ; 0x03 __preheat_counter[_heater_id] = 0; 26052: f8 01 movw r30, r16 26054: e0 55 subi r30, 0x50 ; 80 26056: fa 4f sbci r31, 0xFA ; 250 26058: 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)) 2605a: a3 01 movw r20, r6 2605c: 92 01 movw r18, r4 2605e: bc 01 movw r22, r24 26060: cd 01 movw r24, r26 26062: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 26066: 18 16 cp r1, r24 26068: 1c f5 brge .+70 ; 0x260b0 { __preheat_counter[_heater_id]++; 2606a: f8 01 movw r30, r16 2606c: e0 55 subi r30, 0x50 ; 80 2606e: fa 4f sbci r31, 0xFA ; 250 26070: 80 81 ld r24, Z 26072: 8f 5f subi r24, 0xFF ; 255 26074: 80 83 st Z, r24 if (__preheat_counter[_heater_id] > ((_isbed) ? 16 : 8)) // periodicaly check if current temperature changes 26076: 31 10 cpse r3, r1 26078: c7 c0 rjmp .+398 ; 0x26208 2607a: 89 30 cpi r24, 0x09 ; 9 2607c: c8 f0 brcs .+50 ; 0x260b0 { __delta=2.0; 2607e: 81 2c mov r8, r1 26080: 91 2c mov r9, r1 26082: a1 2c mov r10, r1 26084: 50 e4 ldi r21, 0x40 ; 64 26086: b5 2e mov r11, r21 26088: e8 c0 rjmp .+464 ; 0x2625a #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; __timeout = TEMP_RUNAWAY_EXTRUDER_TIMEOUT; 2608a: ad e2 ldi r26, 0x2D ; 45 2608c: b0 e0 ldi r27, 0x00 ; 0 2608e: ba 87 std Y+10, r27 ; 0x0a 26090: a9 87 std Y+9, r26 ; 0x09 } #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; 26092: 80 e0 ldi r24, 0x00 ; 0 26094: 90 e0 ldi r25, 0x00 ; 0 26096: a0 e7 ldi r26, 0x70 ; 112 26098: b1 e4 ldi r27, 0x41 ; 65 2609a: 8a cf rjmp .-236 ; 0x25fb0 __preheat_start[_heater_id] = _current_temperature; __preheat_counter[_heater_id] = 0; } else { temp_runaway_status[_heater_id] = TempRunaway_INACTIVE; 2609c: 10 82 st Z, r1 temp_runaway_target[_heater_id] = _target_temperature; 2609e: 89 81 ldd r24, Y+1 ; 0x01 260a0: 9a 81 ldd r25, Y+2 ; 0x02 260a2: ab 81 ldd r26, Y+3 ; 0x03 260a4: bc 81 ldd r27, Y+4 ; 0x04 260a6: f5 01 movw r30, r10 260a8: 80 83 st Z, r24 260aa: 91 83 std Z+1, r25 ; 0x01 260ac: a2 83 std Z+2, r26 ; 0x02 260ae: 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) 260b0: 2d 81 ldd r18, Y+5 ; 0x05 260b2: 3e 81 ldd r19, Y+6 ; 0x06 260b4: 4f 81 ldd r20, Y+7 ; 0x07 260b6: 58 85 ldd r21, Y+8 ; 0x08 260b8: 69 81 ldd r22, Y+1 ; 0x01 260ba: 7a 81 ldd r23, Y+2 ; 0x02 260bc: 8b 81 ldd r24, Y+3 ; 0x03 260be: 9c 81 ldd r25, Y+4 ; 0x04 260c0: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 260c4: a3 01 movw r20, r6 260c6: 92 01 movw r18, r4 260c8: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 260cc: 87 ff sbrs r24, 7 260ce: 46 c0 rjmp .+140 ; 0x2615c 260d0: f8 01 movw r30, r16 260d2: e6 54 subi r30, 0x46 ; 70 260d4: fa 4f sbci r31, 0xFA ; 250 260d6: 80 81 ld r24, Z 260d8: 81 30 cpi r24, 0x01 ; 1 260da: 49 f4 brne .+18 ; 0x260ee { temp_runaway_status[_heater_id] = TempRunaway_ACTIVE; 260dc: 82 e0 ldi r24, 0x02 ; 2 260de: 80 83 st Z, r24 temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 260e0: f8 01 movw r30, r16 260e2: ee 0f add r30, r30 260e4: ff 1f adc r31, r31 260e6: ec 53 subi r30, 0x3C ; 60 260e8: fa 4f sbci r31, 0xFA ; 250 260ea: 11 82 std Z+1, r1 ; 0x01 260ec: 10 82 st Z, r1 } if (_output > 0) 260ee: 20 e0 ldi r18, 0x00 ; 0 260f0: 30 e0 ldi r19, 0x00 ; 0 260f2: a9 01 movw r20, r18 260f4: c7 01 movw r24, r14 260f6: b6 01 movw r22, r12 260f8: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 260fc: 18 16 cp r1, r24 260fe: bc f5 brge .+110 ; 0x2616e if (temp_runaway_check_active) { // we are in range if ((_current_temperature > (_target_temperature - __hysteresis)) && (_current_temperature < (_target_temperature + __hysteresis))) 26100: 29 81 ldd r18, Y+1 ; 0x01 26102: 3a 81 ldd r19, Y+2 ; 0x02 26104: 4b 81 ldd r20, Y+3 ; 0x03 26106: 5c 81 ldd r21, Y+4 ; 0x04 26108: 6d 81 ldd r22, Y+5 ; 0x05 2610a: 7e 81 ldd r23, Y+6 ; 0x06 2610c: 8f 81 ldd r24, Y+7 ; 0x07 2610e: 98 85 ldd r25, Y+8 ; 0x08 26110: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 26114: a3 01 movw r20, r6 26116: 92 01 movw r18, r4 26118: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 2611c: 18 16 cp r1, r24 2611e: 0c f0 brlt .+2 ; 0x26122 26120: 3f c0 rjmp .+126 ; 0x261a0 { temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 26122: 00 0f add r16, r16 26124: 11 1f adc r17, r17 26126: f8 01 movw r30, r16 26128: ec 53 subi r30, 0x3C ; 60 2612a: fa 4f sbci r31, 0xFA ; 250 2612c: 11 82 std Z+1, r1 ; 0x01 2612e: 10 82 st Z, r1 26130: 1e c0 rjmp .+60 ; 0x2616e 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)) 26132: a3 01 movw r20, r6 26134: 92 01 movw r18, r4 26136: 69 81 ldd r22, Y+1 ; 0x01 26138: 7a 81 ldd r23, Y+2 ; 0x02 2613a: 8b 81 ldd r24, Y+3 ; 0x03 2613c: 9c 81 ldd r25, Y+4 ; 0x04 2613e: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 26142: 18 16 cp r1, r24 26144: 0c f0 brlt .+2 ; 0x26148 26146: b4 cf rjmp .-152 ; 0x260b0 26148: f8 01 movw r30, r16 2614a: e6 54 subi r30, 0x46 ; 70 2614c: fa 4f sbci r31, 0xFA ; 250 2614e: 80 81 ld r24, Z 26150: 81 30 cpi r24, 0x01 ; 1 26152: 09 f0 breq .+2 ; 0x26156 26154: ad cf rjmp .-166 ; 0x260b0 26156: 89 cf rjmp .-238 ; 0x2606a 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; 26158: 10 82 st Z, r1 2615a: 97 c0 rjmp .+302 ; 0x2628a temp_runaway_status[_heater_id] = TempRunaway_ACTIVE; temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; } if (_output > 0) 2615c: 20 e0 ldi r18, 0x00 ; 0 2615e: 30 e0 ldi r19, 0x00 ; 0 26160: a9 01 movw r20, r18 26162: c7 01 movw r24, r14 26164: b6 01 movw r22, r12 26166: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 2616a: 18 16 cp r1, r24 2616c: cc f0 brlt .+50 ; 0x261a0 } } } } } 2616e: 2c 96 adiw r28, 0x0c ; 12 26170: 0f b6 in r0, 0x3f ; 63 26172: f8 94 cli 26174: de bf out 0x3e, r29 ; 62 26176: 0f be out 0x3f, r0 ; 63 26178: cd bf out 0x3d, r28 ; 61 2617a: df 91 pop r29 2617c: cf 91 pop r28 2617e: 1f 91 pop r17 26180: 0f 91 pop r16 26182: ff 90 pop r15 26184: ef 90 pop r14 26186: df 90 pop r13 26188: cf 90 pop r12 2618a: bf 90 pop r11 2618c: af 90 pop r10 2618e: 9f 90 pop r9 26190: 8f 90 pop r8 26192: 7f 90 pop r7 26194: 6f 90 pop r6 26196: 5f 90 pop r5 26198: 4f 90 pop r4 2619a: 3f 90 pop r3 2619c: 2f 90 pop r2 2619e: 08 95 ret temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; } else { if (temp_runaway_status[_heater_id] > TempRunaway_PREHEAT) 261a0: f8 01 movw r30, r16 261a2: e6 54 subi r30, 0x46 ; 70 261a4: fa 4f sbci r31, 0xFA ; 250 261a6: 80 81 ld r24, Z 261a8: 82 30 cpi r24, 0x02 ; 2 261aa: 08 f3 brcs .-62 ; 0x2616e { temp_runaway_error_counter[_heater_id]++; 261ac: 00 0f add r16, r16 261ae: 11 1f adc r17, r17 261b0: f8 01 movw r30, r16 261b2: ec 53 subi r30, 0x3C ; 60 261b4: fa 4f sbci r31, 0xFA ; 250 261b6: 80 81 ld r24, Z 261b8: 91 81 ldd r25, Z+1 ; 0x01 261ba: 01 96 adiw r24, 0x01 ; 1 261bc: 91 83 std Z+1, r25 ; 0x01 261be: 80 83 st Z, r24 if (temp_runaway_error_counter[_heater_id] * 2 > __timeout) 261c0: 88 0f add r24, r24 261c2: 99 1f adc r25, r25 261c4: e9 85 ldd r30, Y+9 ; 0x09 261c6: fa 85 ldd r31, Y+10 ; 0x0a 261c8: e8 17 cp r30, r24 261ca: f9 07 cpc r31, r25 261cc: 80 f6 brcc .-96 ; 0x2616e set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::runaway); 261ce: 43 e0 ldi r20, 0x03 ; 3 261d0: 62 2d mov r22, r2 261d2: 83 2d mov r24, r3 } } } } } 261d4: 2c 96 adiw r28, 0x0c ; 12 261d6: 0f b6 in r0, 0x3f ; 63 261d8: f8 94 cli 261da: de bf out 0x3e, r29 ; 62 261dc: 0f be out 0x3f, r0 ; 63 261de: cd bf out 0x3d, r28 ; 61 261e0: df 91 pop r29 261e2: cf 91 pop r28 261e4: 1f 91 pop r17 261e6: 0f 91 pop r16 261e8: ff 90 pop r15 261ea: ef 90 pop r14 261ec: df 90 pop r13 261ee: cf 90 pop r12 261f0: bf 90 pop r11 261f2: af 90 pop r10 261f4: 9f 90 pop r9 261f6: 8f 90 pop r8 261f8: 7f 90 pop r7 261fa: 6f 90 pop r6 261fc: 5f 90 pop r5 261fe: 4f 90 pop r4 26200: 3f 90 pop r3 26202: 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); 26204: 0d 94 09 2f jmp 0x25e12 ; 0x25e12 } 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 26208: 81 31 cpi r24, 0x11 ; 17 2620a: 08 f4 brcc .+2 ; 0x2620e 2620c: 51 cf rjmp .-350 ; 0x260b0 { __delta=2.0; if(_isbed) { __delta=3.0; if(_current_temperature>90.0) __delta=2.0; 2620e: 20 e0 ldi r18, 0x00 ; 0 26210: 30 e0 ldi r19, 0x00 ; 0 26212: 44 eb ldi r20, 0xB4 ; 180 26214: 52 e4 ldi r21, 0x42 ; 66 26216: c3 01 movw r24, r6 26218: b2 01 movw r22, r4 2621a: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> if (__preheat_counter[_heater_id] > ((_isbed) ? 16 : 8)) // periodicaly check if current temperature changes { __delta=2.0; if(_isbed) { __delta=3.0; 2621e: 81 2c mov r8, r1 26220: 91 2c mov r9, r1 26222: e0 e4 ldi r30, 0x40 ; 64 26224: ae 2e mov r10, r30 26226: ba 2c mov r11, r10 if(_current_temperature>90.0) __delta=2.0; 26228: 18 16 cp r1, r24 2622a: 2c f4 brge .+10 ; 0x26236 2622c: 81 2c mov r8, r1 2622e: 91 2c mov r9, r1 26230: a1 2c mov r10, r1 26232: 70 e4 ldi r23, 0x40 ; 64 26234: b7 2e mov r11, r23 if(_current_temperature>105.0) __delta=0.6; 26236: 20 e0 ldi r18, 0x00 ; 0 26238: 30 e0 ldi r19, 0x00 ; 0 2623a: 42 ed ldi r20, 0xD2 ; 210 2623c: 52 e4 ldi r21, 0x42 ; 66 2623e: c3 01 movw r24, r6 26240: b2 01 movw r22, r4 26242: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 26246: 18 16 cp r1, r24 26248: 44 f4 brge .+16 ; 0x2625a 2624a: 6a e9 ldi r22, 0x9A ; 154 2624c: 86 2e mov r8, r22 2624e: 69 e9 ldi r22, 0x99 ; 153 26250: 96 2e mov r9, r22 26252: 69 e1 ldi r22, 0x19 ; 25 26254: a6 2e mov r10, r22 26256: 6f e3 ldi r22, 0x3F ; 63 26258: b6 2e mov r11, r22 } if (_current_temperature - __preheat_start[_heater_id] < __delta) { 2625a: eb 85 ldd r30, Y+11 ; 0x0b 2625c: fc 85 ldd r31, Y+12 ; 0x0c 2625e: ee 54 subi r30, 0x4E ; 78 26260: fa 4f sbci r31, 0xFA ; 250 26262: 20 81 ld r18, Z 26264: 31 81 ldd r19, Z+1 ; 0x01 26266: 42 81 ldd r20, Z+2 ; 0x02 26268: 53 81 ldd r21, Z+3 ; 0x03 2626a: c3 01 movw r24, r6 2626c: b2 01 movw r22, r4 2626e: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 26272: a5 01 movw r20, r10 26274: 94 01 movw r18, r8 26276: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 2627a: f8 01 movw r30, r16 2627c: e2 55 subi r30, 0x52 ; 82 2627e: fa 4f sbci r31, 0xFA ; 250 26280: 87 ff sbrs r24, 7 26282: 6a cf rjmp .-300 ; 0x26158 __preheat_errors[_heater_id]++; 26284: 80 81 ld r24, Z 26286: 8f 5f subi r24, 0xFF ; 255 26288: 80 83 st Z, r24 } else { __preheat_errors[_heater_id] = 0; } if (__preheat_errors[_heater_id] > ((_isbed) ? 3 : 5)) 2628a: 80 81 ld r24, Z 2628c: 90 e0 ldi r25, 0x00 ; 0 2628e: 31 10 cpse r3, r1 26290: 04 c0 rjmp .+8 ; 0x2629a 26292: 06 97 sbiw r24, 0x06 ; 6 26294: 4c f0 brlt .+18 ; 0x262a8 set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::preheat); 26296: 80 e0 ldi r24, 0x00 ; 0 26298: 03 c0 rjmp .+6 ; 0x262a0 __preheat_errors[_heater_id]++; } else { __preheat_errors[_heater_id] = 0; } if (__preheat_errors[_heater_id] > ((_isbed) ? 3 : 5)) 2629a: 04 97 sbiw r24, 0x04 ; 4 2629c: 2c f0 brlt .+10 ; 0x262a8 set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::preheat); 2629e: 81 e0 ldi r24, 0x01 ; 1 262a0: 42 e0 ldi r20, 0x02 ; 2 262a2: 62 2d mov r22, r2 262a4: 0f 94 09 2f call 0x25e12 ; 0x25e12 __preheat_start[_heater_id] = _current_temperature; 262a8: 2b 85 ldd r18, Y+11 ; 0x0b 262aa: 3c 85 ldd r19, Y+12 ; 0x0c 262ac: 2e 54 subi r18, 0x4E ; 78 262ae: 3a 4f sbci r19, 0xFA ; 250 262b0: d9 01 movw r26, r18 262b2: 4d 92 st X+, r4 262b4: 5d 92 st X+, r5 262b6: 6d 92 st X+, r6 262b8: 7c 92 st X, r7 262ba: 13 97 sbiw r26, 0x03 ; 3 __preheat_counter[_heater_id] = 0; 262bc: f8 01 movw r30, r16 262be: e0 55 subi r30, 0x50 ; 80 262c0: fa 4f sbci r31, 0xFA ; 250 262c2: 10 82 st Z, r1 262c4: f5 ce rjmp .-534 ; 0x260b0 000262c6 : temp_mgr_state = TEMP_MGR_INTERRUPT_STATE(); DISABLE_TEMP_MGR_INTERRUPT(); } } ~TempMgrGuard() throw() { 262c6: fc 01 movw r30, r24 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 262c8: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 262ca: f8 94 cli if(temp_mgr_state) ENABLE_TEMP_MGR_INTERRUPT(); 262cc: 80 81 ld r24, Z 262ce: 88 23 and r24, r24 262d0: 29 f0 breq .+10 ; 0x262dc 262d2: 80 91 73 00 lds r24, 0x0073 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> 262d6: 82 60 ori r24, 0x02 ; 2 262d8: 80 93 73 00 sts 0x0073, r24 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 262dc: 9f bf out 0x3f, r25 ; 63 } } 262de: 08 95 ret 000262e0 : class TempMgrGuard { bool temp_mgr_state; public: TempMgrGuard() { 262e0: dc 01 movw r26, r24 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 262e2: 2f b7 in r18, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 262e4: f8 94 cli temp_mgr_state = TEMP_MGR_INTERRUPT_STATE(); 262e6: e3 e7 ldi r30, 0x73 ; 115 262e8: f0 e0 ldi r31, 0x00 ; 0 262ea: 90 81 ld r25, Z 262ec: 96 95 lsr r25 262ee: 91 70 andi r25, 0x01 ; 1 262f0: 9c 93 st X, r25 DISABLE_TEMP_MGR_INTERRUPT(); 262f2: 80 81 ld r24, Z 262f4: 8d 7f andi r24, 0xFD ; 253 262f6: 80 83 st Z, r24 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 262f8: 2f bf out 0x3f, r18 ; 63 } } 262fa: 08 95 ret 000262fc : (double)thermal_model::data.err, (double)thermal_model::data.warn, (double)thermal_model::data.Ta_corr); } void thermal_model_reset_settings() { 262fc: cf 93 push r28 262fe: df 93 push r29 26300: 1f 92 push r1 26302: cd b7 in r28, 0x3d ; 61 26304: de b7 in r29, 0x3e ; 62 TempMgrGuard temp_mgr_guard; 26306: ce 01 movw r24, r28 26308: 01 96 adiw r24, 0x01 ; 1 2630a: 0f 94 70 31 call 0x262e0 ; 0x262e0 thermal_model::data.P = THERMAL_MODEL_DEF(P); 2630e: 80 e0 ldi r24, 0x00 ; 0 26310: 90 e0 ldi r25, 0x00 ; 0 26312: a8 e1 ldi r26, 0x18 ; 24 26314: b2 e4 ldi r27, 0x42 ; 66 26316: 80 93 d9 12 sts 0x12D9, r24 ; 0x8012d9 <_ZN13thermal_modelL4dataE.lto_priv.400+0x2a> 2631a: 90 93 da 12 sts 0x12DA, r25 ; 0x8012da <_ZN13thermal_modelL4dataE.lto_priv.400+0x2b> 2631e: a0 93 db 12 sts 0x12DB, r26 ; 0x8012db <_ZN13thermal_modelL4dataE.lto_priv.400+0x2c> 26322: b0 93 dc 12 sts 0x12DC, r27 ; 0x8012dc <_ZN13thermal_modelL4dataE.lto_priv.400+0x2d> thermal_model::data.U = THERMAL_MODEL_DEF(U); 26326: 10 92 dd 12 sts 0x12DD, r1 ; 0x8012dd <_ZN13thermal_modelL4dataE.lto_priv.400+0x2e> 2632a: 10 92 de 12 sts 0x12DE, r1 ; 0x8012de <_ZN13thermal_modelL4dataE.lto_priv.400+0x2f> 2632e: 10 92 df 12 sts 0x12DF, r1 ; 0x8012df <_ZN13thermal_modelL4dataE.lto_priv.400+0x30> 26332: 10 92 e0 12 sts 0x12E0, r1 ; 0x8012e0 <_ZN13thermal_modelL4dataE.lto_priv.400+0x31> thermal_model::data.V = THERMAL_MODEL_DEF(V); 26336: 80 e0 ldi r24, 0x00 ; 0 26338: 90 e0 ldi r25, 0x00 ; 0 2633a: a0 e8 ldi r26, 0x80 ; 128 2633c: bf e3 ldi r27, 0x3F ; 63 2633e: 80 93 e1 12 sts 0x12E1, r24 ; 0x8012e1 <_ZN13thermal_modelL4dataE.lto_priv.400+0x32> 26342: 90 93 e2 12 sts 0x12E2, r25 ; 0x8012e2 <_ZN13thermal_modelL4dataE.lto_priv.400+0x33> 26346: a0 93 e3 12 sts 0x12E3, r26 ; 0x8012e3 <_ZN13thermal_modelL4dataE.lto_priv.400+0x34> 2634a: b0 93 e4 12 sts 0x12E4, r27 ; 0x8012e4 <_ZN13thermal_modelL4dataE.lto_priv.400+0x35> thermal_model::data.C = THERMAL_MODEL_DEF(C); 2634e: 8a e9 ldi r24, 0x9A ; 154 26350: 99 e9 ldi r25, 0x99 ; 153 26352: a1 e4 ldi r26, 0x41 ; 65 26354: b1 e4 ldi r27, 0x41 ; 65 26356: 80 93 e5 12 sts 0x12E5, r24 ; 0x8012e5 <_ZN13thermal_modelL4dataE.lto_priv.400+0x36> 2635a: 90 93 e6 12 sts 0x12E6, r25 ; 0x8012e6 <_ZN13thermal_modelL4dataE.lto_priv.400+0x37> 2635e: a0 93 e7 12 sts 0x12E7, r26 ; 0x8012e7 <_ZN13thermal_modelL4dataE.lto_priv.400+0x38> 26362: b0 93 e8 12 sts 0x12E8, r27 ; 0x8012e8 <_ZN13thermal_modelL4dataE.lto_priv.400+0x39> thermal_model::data.fS = THERMAL_MODEL_DEF(fS); 26366: 88 eb ldi r24, 0xB8 ; 184 26368: 9e e1 ldi r25, 0x1E ; 30 2636a: a5 e8 ldi r26, 0x85 ; 133 2636c: bd e3 ldi r27, 0x3D ; 61 2636e: 80 93 e9 12 sts 0x12E9, r24 ; 0x8012e9 <_ZN13thermal_modelL4dataE.lto_priv.400+0x3a> 26372: 90 93 ea 12 sts 0x12EA, r25 ; 0x8012ea <_ZN13thermal_modelL4dataE.lto_priv.400+0x3b> 26376: a0 93 eb 12 sts 0x12EB, r26 ; 0x8012eb <_ZN13thermal_modelL4dataE.lto_priv.400+0x3c> 2637a: b0 93 ec 12 sts 0x12EC, r27 ; 0x8012ec <_ZN13thermal_modelL4dataE.lto_priv.400+0x3d> thermal_model::data.L = (uint16_t)(THERMAL_MODEL_DEF(LAG) / (TEMP_MGR_INTV * 1000) + 0.5) * (uint16_t)(TEMP_MGR_INTV * 1000); 2637e: 80 e7 ldi r24, 0x70 ; 112 26380: 98 e0 ldi r25, 0x08 ; 8 26382: 90 93 ee 12 sts 0x12EE, r25 ; 0x8012ee <_ZN13thermal_modelL4dataE.lto_priv.400+0x3f> 26386: 80 93 ed 12 sts 0x12ED, r24 ; 0x8012ed <_ZN13thermal_modelL4dataE.lto_priv.400+0x3e> 2638a: 88 e6 ldi r24, 0x68 ; 104 2638c: 9f e9 ldi r25, 0x9F ; 159 2638e: af ee ldi r26, 0xEF ; 239 26390: b2 e1 ldi r27, 0x12 ; 18 for(uint8_t i = 0; i != THERMAL_MODEL_R_SIZE; ++i) thermal_model::data.R[i] = pgm_read_float(THERMAL_MODEL_R_DEFAULT + i); 26392: fc 01 movw r30, r24 26394: 45 91 lpm r20, Z+ 26396: 55 91 lpm r21, Z+ 26398: 65 91 lpm r22, Z+ 2639a: 74 91 lpm r23, Z 2639c: 4d 93 st X+, r20 2639e: 5d 93 st X+, r21 263a0: 6d 93 st X+, r22 263a2: 7d 93 st X+, r23 263a4: 04 96 adiw r24, 0x04 ; 4 thermal_model::data.U = THERMAL_MODEL_DEF(U); thermal_model::data.V = THERMAL_MODEL_DEF(V); thermal_model::data.C = THERMAL_MODEL_DEF(C); thermal_model::data.fS = THERMAL_MODEL_DEF(fS); thermal_model::data.L = (uint16_t)(THERMAL_MODEL_DEF(LAG) / (TEMP_MGR_INTV * 1000) + 0.5) * (uint16_t)(TEMP_MGR_INTV * 1000); for(uint8_t i = 0; i != THERMAL_MODEL_R_SIZE; ++i) 263a6: 23 e1 ldi r18, 0x13 ; 19 263a8: af 32 cpi r26, 0x2F ; 47 263aa: b2 07 cpc r27, r18 263ac: 91 f7 brne .-28 ; 0x26392 thermal_model::data.R[i] = pgm_read_float(THERMAL_MODEL_R_DEFAULT + i); thermal_model::data.Ta_corr = THERMAL_MODEL_Ta_corr; 263ae: 80 e0 ldi r24, 0x00 ; 0 263b0: 90 e0 ldi r25, 0x00 ; 0 263b2: a0 ee ldi r26, 0xE0 ; 224 263b4: b0 ec ldi r27, 0xC0 ; 192 263b6: 80 93 2f 13 sts 0x132F, r24 ; 0x80132f <_ZN13thermal_modelL4dataE.lto_priv.400+0x80> 263ba: 90 93 30 13 sts 0x1330, r25 ; 0x801330 <_ZN13thermal_modelL4dataE.lto_priv.400+0x81> 263be: a0 93 31 13 sts 0x1331, r26 ; 0x801331 <_ZN13thermal_modelL4dataE.lto_priv.400+0x82> 263c2: b0 93 32 13 sts 0x1332, r27 ; 0x801332 <_ZN13thermal_modelL4dataE.lto_priv.400+0x83> thermal_model::data.warn = THERMAL_MODEL_DEF(W); 263c6: 8a e9 ldi r24, 0x9A ; 154 263c8: 99 e9 ldi r25, 0x99 ; 153 263ca: a9 e9 ldi r26, 0x99 ; 153 263cc: bf e3 ldi r27, 0x3F ; 63 263ce: 80 93 33 13 sts 0x1333, r24 ; 0x801333 <_ZN13thermal_modelL4dataE.lto_priv.400+0x84> 263d2: 90 93 34 13 sts 0x1334, r25 ; 0x801334 <_ZN13thermal_modelL4dataE.lto_priv.400+0x85> 263d6: a0 93 35 13 sts 0x1335, r26 ; 0x801335 <_ZN13thermal_modelL4dataE.lto_priv.400+0x86> 263da: b0 93 36 13 sts 0x1336, r27 ; 0x801336 <_ZN13thermal_modelL4dataE.lto_priv.400+0x87> thermal_model::data.err = THERMAL_MODEL_DEF(E); 263de: 82 e5 ldi r24, 0x52 ; 82 263e0: 98 eb ldi r25, 0xB8 ; 184 263e2: ae ed ldi r26, 0xDE ; 222 263e4: bf e3 ldi r27, 0x3F ; 63 263e6: 80 93 37 13 sts 0x1337, r24 ; 0x801337 <_ZN13thermal_modelL4dataE.lto_priv.400+0x88> 263ea: 90 93 38 13 sts 0x1338, r25 ; 0x801338 <_ZN13thermal_modelL4dataE.lto_priv.400+0x89> 263ee: a0 93 39 13 sts 0x1339, r26 ; 0x801339 <_ZN13thermal_modelL4dataE.lto_priv.400+0x8a> 263f2: b0 93 3a 13 sts 0x133A, r27 ; 0x80133a <_ZN13thermal_modelL4dataE.lto_priv.400+0x8b> thermal_model::warn_beep = true; 263f6: 81 e0 ldi r24, 0x01 ; 1 263f8: 80 93 3d 02 sts 0x023D, r24 ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.455> thermal_model::enabled = true; 263fc: 80 93 1c 05 sts 0x051C, r24 ; 0x80051c <_ZN13thermal_modelL7enabledE.lto_priv.456> } // clear error flags and mark as uninitialized static void reinitialize() { data.flags = 1; // shorcut to reset all error flags 26400: 80 93 3b 13 sts 0x133B, r24 ; 0x80133b <_ZN13thermal_modelL4dataE.lto_priv.400+0x8c> warning_state.assert = false; // explicitly clear assertions 26404: 80 91 38 06 lds r24, 0x0638 ; 0x800638 26408: 8d 7f andi r24, 0xFD ; 253 2640a: 80 93 38 06 sts 0x0638, r24 ; 0x800638 (double)thermal_model::data.Ta_corr); } void thermal_model_reset_settings() { TempMgrGuard temp_mgr_guard; 2640e: ce 01 movw r24, r28 26410: 01 96 adiw r24, 0x01 ; 1 26412: 0f 94 63 31 call 0x262c6 ; 0x262c6 thermal_model::data.warn = THERMAL_MODEL_DEF(W); thermal_model::data.err = THERMAL_MODEL_DEF(E); thermal_model::warn_beep = true; thermal_model::enabled = true; thermal_model::reinitialize(); } 26416: 0f 90 pop r0 26418: df 91 pop r29 2641a: cf 91 pop r28 2641c: 08 95 ret 0002641e : { return thermal_model::enabled; } void thermal_model_set_enabled(bool enabled) { 2641e: 1f 93 push r17 26420: cf 93 push r28 26422: df 93 push r29 26424: 1f 92 push r1 26426: cd b7 in r28, 0x3d ; 61 26428: de b7 in r29, 0x3e ; 62 2642a: 18 2f mov r17, r24 // set the enabled flag { TempMgrGuard temp_mgr_guard; 2642c: ce 01 movw r24, r28 2642e: 01 96 adiw r24, 0x01 ; 1 26430: 0f 94 70 31 call 0x262e0 ; 0x262e0 thermal_model::enabled = enabled; 26434: 10 93 1c 05 sts 0x051C, r17 ; 0x80051c <_ZN13thermal_modelL7enabledE.lto_priv.456> thermal_model::setup(); 26438: 0f 94 df 2e call 0x25dbe ; 0x25dbe void thermal_model_set_enabled(bool enabled) { // set the enabled flag { TempMgrGuard temp_mgr_guard; 2643c: ce 01 movw r24, r28 2643e: 01 96 adiw r24, 0x01 ; 1 26440: 0f 94 63 31 call 0x262c6 ; 0x262c6 thermal_model::enabled = enabled; thermal_model::setup(); } // verify that the model has been enabled if(enabled && !thermal_model::enabled) 26444: 11 23 and r17, r17 26446: 41 f0 breq .+16 ; 0x26458 26448: 80 91 1c 05 lds r24, 0x051C ; 0x80051c <_ZN13thermal_modelL7enabledE.lto_priv.456> 2644c: 81 11 cpse r24, r1 2644e: 04 c0 rjmp .+8 ; 0x26458 SERIAL_ECHOLNPGM("TM: invalid parameters, cannot enable"); 26450: 80 ed ldi r24, 0xD0 ; 208 26452: 9e e9 ldi r25, 0x9E ; 158 26454: 0e 94 93 79 call 0xf326 ; 0xf326 } 26458: 0f 90 pop r0 2645a: df 91 pop r29 2645c: cf 91 pop r28 2645e: 1f 91 pop r17 26460: 08 95 ret 00026462 : #endif } // namespace thermal_model static void thermal_model_reset_enabled(bool enabled) { 26462: 1f 93 push r17 26464: cf 93 push r28 26466: df 93 push r29 26468: 1f 92 push r1 2646a: cd b7 in r28, 0x3d ; 61 2646c: de b7 in r29, 0x3e ; 62 2646e: 18 2f mov r17, r24 TempMgrGuard temp_mgr_guard; 26470: ce 01 movw r24, r28 26472: 01 96 adiw r24, 0x01 ; 1 26474: 0f 94 70 31 call 0x262e0 ; 0x262e0 thermal_model::enabled = enabled; 26478: 10 93 1c 05 sts 0x051C, r17 ; 0x80051c <_ZN13thermal_modelL7enabledE.lto_priv.456> } // clear error flags and mark as uninitialized static void reinitialize() { data.flags = 1; // shorcut to reset all error flags 2647c: 81 e0 ldi r24, 0x01 ; 1 2647e: 80 93 3b 13 sts 0x133B, r24 ; 0x80133b <_ZN13thermal_modelL4dataE.lto_priv.400+0x8c> warning_state.assert = false; // explicitly clear assertions 26482: e8 e3 ldi r30, 0x38 ; 56 26484: f6 e0 ldi r31, 0x06 ; 6 26486: 80 81 ld r24, Z 26488: 8d 7f andi r24, 0xFD ; 253 2648a: 80 83 st Z, r24 } // namespace thermal_model static void thermal_model_reset_enabled(bool enabled) { TempMgrGuard temp_mgr_guard; 2648c: ce 01 movw r24, r28 2648e: 01 96 adiw r24, 0x01 ; 1 26490: 0f 94 63 31 call 0x262c6 ; 0x262c6 thermal_model::enabled = enabled; thermal_model::reinitialize(); } 26494: 0f 90 pop r0 26496: df 91 pop r29 26498: cf 91 pop r28 2649a: 1f 91 pop r17 2649c: 08 95 ret 0002649e : /* 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() { 2649e: cf 93 push r28 264a0: df 93 push r29 264a2: 1f 92 push r1 264a4: cd b7 in r28, 0x3d ; 61 264a6: de b7 in r29, 0x3e ; 62 TempMgrGuard temp_mgr_guard; 264a8: ce 01 movw r24, r28 264aa: 01 96 adiw r24, 0x01 ; 1 264ac: 0f 94 70 31 call 0x262e0 ; 0x262e0 } static void setCurrentTemperaturesFromIsr() { for(uint8_t e=0;e 264b4: 90 91 17 05 lds r25, 0x0517 ; 0x800517 264b8: a0 91 18 05 lds r26, 0x0518 ; 0x800518 264bc: b0 91 19 05 lds r27, 0x0519 ; 0x800519 264c0: 80 93 af 0d sts 0x0DAF, r24 ; 0x800daf 264c4: 90 93 b0 0d sts 0x0DB0, r25 ; 0x800db0 264c8: a0 93 b1 0d sts 0x0DB1, r26 ; 0x800db1 264cc: b0 93 b2 0d sts 0x0DB2, r27 ; 0x800db2 current_temperature_bed = current_temperature_bed_isr; 264d0: 80 91 18 06 lds r24, 0x0618 ; 0x800618 264d4: 90 91 19 06 lds r25, 0x0619 ; 0x800619 264d8: a0 91 1a 06 lds r26, 0x061A ; 0x80061a 264dc: b0 91 1b 06 lds r27, 0x061B ; 0x80061b 264e0: 80 93 ed 04 sts 0x04ED, r24 ; 0x8004ed 264e4: 90 93 ee 04 sts 0x04EE, r25 ; 0x8004ee 264e8: a0 93 ef 04 sts 0x04EF, r26 ; 0x8004ef 264ec: b0 93 f0 04 sts 0x04F0, r27 ; 0x8004f0 #ifdef PINDA_THERMISTOR current_temperature_pinda = current_temperature_pinda_isr; 264f0: 80 91 02 06 lds r24, 0x0602 ; 0x800602 264f4: 90 91 03 06 lds r25, 0x0603 ; 0x800603 264f8: a0 91 04 06 lds r26, 0x0604 ; 0x800604 264fc: b0 91 05 06 lds r27, 0x0605 ; 0x800605 26500: 80 93 97 03 sts 0x0397, r24 ; 0x800397 26504: 90 93 98 03 sts 0x0398, r25 ; 0x800398 26508: a0 93 99 03 sts 0x0399, r26 ; 0x800399 2650c: b0 93 9a 03 sts 0x039A, r27 ; 0x80039a #endif #ifdef AMBIENT_THERMISTOR current_temperature_ambient = current_temperature_ambient_isr; 26510: 80 91 1f 06 lds r24, 0x061F ; 0x80061f 26514: 90 91 20 06 lds r25, 0x0620 ; 0x800620 26518: a0 91 21 06 lds r26, 0x0621 ; 0x800621 2651c: b0 91 22 06 lds r27, 0x0622 ; 0x800622 26520: 80 93 55 06 sts 0x0655, r24 ; 0x800655 26524: 90 93 56 06 sts 0x0656, r25 ; 0x800656 26528: a0 93 57 06 sts 0x0657, r26 ; 0x800657 2652c: b0 93 58 06 sts 0x0658, r27 ; 0x800658 This function is blocking: check temp_meas_ready before calling! */ static void updateTemperatures() { TempMgrGuard temp_mgr_guard; setCurrentTemperaturesFromIsr(); if(!temp_error_state.v) { 26530: 80 91 1a 05 lds r24, 0x051A ; 0x80051a <_ZL16temp_error_state.lto_priv.454> 26534: 81 11 cpse r24, r1 26536: 02 c0 rjmp .+4 ; 0x2653c // refuse to update target temperatures in any error condition! setIsrTargetTemperatures(); 26538: 0f 94 69 13 call 0x226d2 ; 0x226d2 } temp_meas_ready = false; 2653c: 10 92 01 06 sts 0x0601, r1 ; 0x800601 - 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() { TempMgrGuard temp_mgr_guard; 26540: ce 01 movw r24, r28 26542: 01 96 adiw r24, 0x01 ; 1 26544: 0f 94 63 31 call 0x262c6 ; 0x262c6 if(!temp_error_state.v) { // refuse to update target temperatures in any error condition! setIsrTargetTemperatures(); } temp_meas_ready = false; } 26548: 0f 90 pop r0 2654a: df 91 pop r29 2654c: cf 91 pop r28 2654e: 08 95 ret 00026550 <__vector_14>: #ifdef SYSTEM_TIMER_2 ISR(TIMER2_COMPB_vect) #else //SYSTEM_TIMER_2 ISR(TIMER0_COMPB_vect) #endif //SYSTEM_TIMER_2 { 26550: 1f 92 push r1 26552: 0f 92 push r0 26554: 0f b6 in r0, 0x3f ; 63 26556: 0f 92 push r0 26558: 11 24 eor r1, r1 2655a: 0b b6 in r0, 0x3b ; 59 2655c: 0f 92 push r0 2655e: ff 92 push r15 26560: 0f 93 push r16 26562: 1f 93 push r17 26564: 2f 93 push r18 26566: 3f 93 push r19 26568: 4f 93 push r20 2656a: 5f 93 push r21 2656c: 6f 93 push r22 2656e: 7f 93 push r23 26570: 8f 93 push r24 26572: 9f 93 push r25 26574: af 93 push r26 26576: bf 93 push r27 26578: cf 93 push r28 2657a: df 93 push r29 2657c: ef 93 push r30 2657e: ff 93 push r31 DISABLE_SOFT_PWM_INTERRUPT(); 26580: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 26584: 8b 7f andi r24, 0xFB ; 251 26586: 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(); 2658a: 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) 2658c: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 26590: 86 fd sbrc r24, 6 26592: c8 c0 rjmp .+400 ; 0x26724 <__vector_14+0x1d4> { //button is pressed if (buttonBlanking.expired_cont(BUTTON_BLANKING_TIME)) { 26594: 68 ec ldi r22, 0xC8 ; 200 26596: 70 e0 ldi r23, 0x00 ; 0 26598: 8e ed ldi r24, 0xDE ; 222 2659a: 95 e0 ldi r25, 0x05 ; 5 2659c: 0f 94 7c 29 call 0x252f8 ; 0x252f8 ::expired_cont(unsigned short)> 265a0: 88 23 and r24, r24 265a2: b9 f0 breq .+46 ; 0x265d2 <__vector_14+0x82> buttonBlanking.start(); 265a4: 8e ed ldi r24, 0xDE ; 222 265a6: 95 e0 ldi r25, 0x05 ; 5 265a8: 0f 94 83 29 call 0x25306 ; 0x25306 ::start()> safetyTimer.start(); 265ac: 89 ed ldi r24, 0xD9 ; 217 265ae: 95 e0 ldi r25, 0x05 ; 5 265b0: 0f 94 c5 2b call 0x2578a ; 0x2578a ::start()> if ((lcd_button_pressed == 0) && (lcd_long_press_active == 0)) 265b4: 80 91 d8 05 lds r24, 0x05D8 ; 0x8005d8 265b8: 81 11 cpse r24, r1 265ba: a5 c0 rjmp .+330 ; 0x26706 <__vector_14+0x1b6> 265bc: 80 91 d7 05 lds r24, 0x05D7 ; 0x8005d7 265c0: 81 11 cpse r24, r1 265c2: a1 c0 rjmp .+322 ; 0x26706 <__vector_14+0x1b6> { longPressTimer.start(); 265c4: 84 ed ldi r24, 0xD4 ; 212 265c6: 95 e0 ldi r25, 0x05 ; 5 265c8: 0f 94 83 29 call 0x25306 ; 0x25306 ::start()> lcd_button_pressed = 1; 265cc: 81 e0 ldi r24, 0x01 ; 1 265ce: 80 93 d8 05 sts 0x05D8, r24 ; 0x8005d8 -2, 1, -1, 0, }; static uint8_t enc_bits_old = 0; uint8_t enc_bits = 0; if (!READ(BTN_EN1)) enc_bits |= _BV(0); 265d2: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 265d6: 82 fb bst r24, 2 265d8: 88 27 eor r24, r24 265da: 80 f9 bld r24, 0 265dc: 91 e0 ldi r25, 0x01 ; 1 265de: 89 27 eor r24, r25 if (!READ(BTN_EN2)) enc_bits |= _BV(1); 265e0: 90 91 03 01 lds r25, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 265e4: 91 ff sbrs r25, 1 265e6: 82 60 ori r24, 0x02 ; 2 if (enc_bits != enc_bits_old) 265e8: e0 91 d1 05 lds r30, 0x05D1 ; 0x8005d1 265ec: e8 17 cp r30, r24 265ee: e1 f0 breq .+56 ; 0x26628 <__vector_14+0xd8> { int8_t newDiff = pgm_read_byte(&encrot_table[(enc_bits_old << 2) | enc_bits]); 265f0: 24 e0 ldi r18, 0x04 ; 4 265f2: e2 9f mul r30, r18 265f4: f0 01 movw r30, r0 265f6: 11 24 eor r1, r1 265f8: e8 2b or r30, r24 265fa: ef 54 subi r30, 0x4F ; 79 265fc: f1 46 sbci r31, 0x61 ; 97 265fe: e4 91 lpm r30, Z lcd_encoder_diff += newDiff; 26600: 90 91 d0 05 lds r25, 0x05D0 ; 0x8005d0 <_ZL16lcd_encoder_diff.lto_priv.539> 26604: e9 0f add r30, r25 26606: e0 93 d0 05 sts 0x05D0, r30 ; 0x8005d0 <_ZL16lcd_encoder_diff.lto_priv.539> if (abs(lcd_encoder_diff) >= ENCODER_PULSES_PER_STEP) { 2660a: 0e 2e mov r0, r30 2660c: 00 0c add r0, r0 2660e: ff 0b sbc r31, r31 26610: f7 ff sbrs r31, 7 26612: 03 c0 rjmp .+6 ; 0x2661a <__vector_14+0xca> 26614: f1 95 neg r31 26616: e1 95 neg r30 26618: f1 09 sbc r31, r1 2661a: 34 97 sbiw r30, 0x04 ; 4 2661c: 1c f0 brlt .+6 ; 0x26624 <__vector_14+0xd4> lcd_backlight_wake_trigger = true; // flag event, knob rotated 2661e: 91 e0 ldi r25, 0x01 ; 1 26620: 90 93 d2 05 sts 0x05D2, r25 ; 0x8005d2 <_ZL26lcd_backlight_wake_trigger.lto_priv.538> } enc_bits_old = enc_bits; 26624: 80 93 d1 05 sts 0x05D1, r24 ; 0x8005d1 #ifndef SLOW_PWM_HEATERS /* * standard PWM modulation */ if (pwm_count == 0) 26628: 80 91 a4 02 lds r24, 0x02A4 ; 0x8002a4 2662c: 81 11 cpse r24, r1 2662e: 08 c0 rjmp .+16 ; 0x26640 <__vector_14+0xf0> { soft_pwm_0 = soft_pwm[0]; 26630: 80 91 15 05 lds r24, 0x0515 ; 0x800515 <_ZL8soft_pwm.lto_priv.459> 26634: 80 93 e7 05 sts 0x05E7, r24 ; 0x8005e7 if(soft_pwm_0 > 0) 26638: 88 23 and r24, r24 2663a: 09 f4 brne .+2 ; 0x2663e <__vector_14+0xee> 2663c: 87 c0 rjmp .+270 ; 0x2674c <__vector_14+0x1fc> { WRITE(HEATER_0_PIN,1); 2663e: 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) 26640: 80 91 a4 02 lds r24, 0x02A4 ; 0x8002a4 26644: 8f 70 andi r24, 0x0F ; 15 26646: a9 f4 brne .+42 ; 0x26672 <__vector_14+0x122> { soft_pwm_fan = fanSpeedSoftPwm / (1 << (8 - FAN_SOFT_PWM_BITS)); 26648: 80 91 a5 04 lds r24, 0x04A5 ; 0x8004a5 2664c: 90 e0 ldi r25, 0x00 ; 0 2664e: 24 e0 ldi r18, 0x04 ; 4 26650: 95 95 asr r25 26652: 87 95 ror r24 26654: 2a 95 dec r18 26656: e1 f7 brne .-8 ; 0x26650 <__vector_14+0x100> 26658: 80 93 a4 04 sts 0x04A4, r24 ; 0x8004a4 <_ZL12soft_pwm_fan.lto_priv.460> if(soft_pwm_fan > 0) WRITE(FAN_PIN,1); else WRITE(FAN_PIN,0); 2665c: 89 2b or r24, r25 2665e: 09 f4 brne .+2 ; 0x26662 <__vector_14+0x112> 26660: 77 c0 rjmp .+238 ; 0x26750 <__vector_14+0x200> 26662: 9f b7 in r25, 0x3f ; 63 26664: f8 94 cli 26666: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2666a: 88 60 ori r24, 0x08 ; 8 2666c: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 26670: 9f bf out 0x3f, r25 ; 63 } #endif if(soft_pwm_0 < pwm_count) 26672: 90 91 e7 05 lds r25, 0x05E7 ; 0x8005e7 26676: 80 91 a4 02 lds r24, 0x02A4 ; 0x8002a4 2667a: 98 17 cp r25, r24 2667c: 08 f4 brcc .+2 ; 0x26680 <__vector_14+0x130> { WRITE(HEATER_0_PIN,0); 2667e: 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); 26680: 80 91 a4 02 lds r24, 0x02A4 ; 0x8002a4 26684: 8f 70 andi r24, 0x0F ; 15 26686: 90 91 a4 04 lds r25, 0x04A4 ; 0x8004a4 <_ZL12soft_pwm_fan.lto_priv.460> 2668a: 98 17 cp r25, r24 2668c: 40 f4 brcc .+16 ; 0x2669e <__vector_14+0x14e> 2668e: 9f b7 in r25, 0x3f ; 63 26690: f8 94 cli 26692: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 26696: 87 7f andi r24, 0xF7 ; 247 26698: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2669c: 9f bf out 0x3f, r25 ; 63 #endif pwm_count += (1 << SOFT_PWM_SCALE); 2669e: 80 91 a4 02 lds r24, 0x02A4 ; 0x8002a4 266a2: 8f 5f subi r24, 0xFF ; 255 pwm_count &= 0x7f; 266a4: 8f 77 andi r24, 0x7F ; 127 266a6: 80 93 a4 02 sts 0x02A4, r24 ; 0x8002a4 266aa: 10 e0 ldi r17, 0x00 ; 0 266ac: 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 266ae: e8 01 movw r28, r16 266b0: cc 0f add r28, r28 266b2: dd 1f adc r29, r29 266b4: c8 59 subi r28, 0x98 ; 152 266b6: d9 4f sbci r29, 0xF9 ; 249 266b8: 88 81 ld r24, Y 266ba: 99 81 ldd r25, Y+1 ; 0x01 if(curTodo>0) 266bc: 18 16 cp r1, r24 266be: 19 06 cpc r1, r25 266c0: 0c f0 brlt .+2 ; 0x266c4 <__vector_14+0x174> 266c2: 4c c0 rjmp .+152 ; 0x2675c <__vector_14+0x20c> { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 266c4: ff b6 in r15, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 266c6: f8 94 cli babystep(axis,/*fwd*/true); 266c8: 61 e0 ldi r22, 0x01 ; 1 266ca: 80 2f mov r24, r16 266cc: 0f 94 7a 13 call 0x226f4 ; 0x226f4 babystepsTodo[axis]--; //less to do next time 266d0: 88 81 ld r24, Y 266d2: 99 81 ldd r25, Y+1 ; 0x01 266d4: 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 266d6: 99 83 std Y+1, r25 ; 0x01 266d8: 88 83 st Y, r24 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 266da: ff be out 0x3f, r15 ; 63 __asm__ volatile ("" ::: "memory"); 266dc: 0f 5f subi r16, 0xFF ; 255 266de: 1f 4f sbci r17, 0xFF ; 255 } #endif #ifdef BABYSTEPPING FORCE_INLINE static void applyBabysteps() { for(uint8_t axis=0;axis<3;axis++) 266e0: 03 30 cpi r16, 0x03 ; 3 266e2: 11 05 cpc r17, r1 266e4: 21 f7 brne .-56 ; 0x266ae <__vector_14+0x15e> #ifdef BABYSTEPPING applyBabysteps(); #endif //BABYSTEPPING // Check if a stack overflow happened if (!SdFatUtil::test_stack_integrity()) stack_error(); 266e6: 80 91 3f 18 lds r24, 0x183F ; 0x80183f <__bss_end+0x20> 266ea: 90 91 40 18 lds r25, 0x1840 ; 0x801840 <__bss_end+0x21> 266ee: a0 91 41 18 lds r26, 0x1841 ; 0x801841 <__bss_end+0x22> 266f2: b0 91 42 18 lds r27, 0x1842 ; 0x801842 <__bss_end+0x23> 266f6: 82 3a cpi r24, 0xA2 ; 162 266f8: 92 4a sbci r25, 0xA2 ; 162 266fa: a1 05 cpc r26, r1 266fc: b1 05 cpc r27, r1 266fe: d9 f1 breq .+118 ; 0x26776 <__vector_14+0x226> crash_and_burn(dump_crash_reason::bad_isr); } #endif //EMERGENCY_HANDLERS void stack_error() { crash_and_burn(dump_crash_reason::stack_error); 26700: 81 e0 ldi r24, 0x01 ; 1 26702: 0e 94 70 67 call 0xcee0 ; 0xcee0 if ((lcd_button_pressed == 0) && (lcd_long_press_active == 0)) { longPressTimer.start(); lcd_button_pressed = 1; } else if (longPressTimer.expired(LONG_PRESS_TIME)) 26706: 68 ee ldi r22, 0xE8 ; 232 26708: 73 e0 ldi r23, 0x03 ; 3 2670a: 84 ed ldi r24, 0xD4 ; 212 2670c: 95 e0 ldi r25, 0x05 ; 5 2670e: 0f 94 54 29 call 0x252a8 ; 0x252a8 ::expired(unsigned short)> 26712: 88 23 and r24, r24 26714: 09 f4 brne .+2 ; 0x26718 <__vector_14+0x1c8> 26716: 5d cf rjmp .-326 ; 0x265d2 <__vector_14+0x82> { lcd_long_press_active = 1; 26718: 81 e0 ldi r24, 0x01 ; 1 2671a: 80 93 d7 05 sts 0x05D7, r24 ; 0x8005d7 lcd_longpress_trigger = 1; 2671e: 80 93 d3 05 sts 0x05D3, r24 ; 0x8005d3 26722: 57 cf rjmp .-338 ; 0x265d2 <__vector_14+0x82> } } } else { //button not pressed if (lcd_button_pressed) 26724: 80 91 d8 05 lds r24, 0x05D8 ; 0x8005d8 26728: 88 23 and r24, r24 2672a: 09 f4 brne .+2 ; 0x2672e <__vector_14+0x1de> 2672c: 52 cf rjmp .-348 ; 0x265d2 <__vector_14+0x82> { //button was released lcd_button_pressed = 0; // Reset to prevent double triggering 2672e: 10 92 d8 05 sts 0x05D8, r1 ; 0x8005d8 if (!lcd_long_press_active) 26732: 80 91 d7 05 lds r24, 0x05D7 ; 0x8005d7 26736: 81 11 cpse r24, r1 26738: 03 c0 rjmp .+6 ; 0x26740 <__vector_14+0x1f0> { //button released before long press gets activated lcd_click_trigger = 1; // This flag is reset when the event is consumed 2673a: 81 e0 ldi r24, 0x01 ; 1 2673c: 80 93 a6 03 sts 0x03A6, r24 ; 0x8003a6 } lcd_backlight_wake_trigger = true; // flag event, knob pressed 26740: 81 e0 ldi r24, 0x01 ; 1 26742: 80 93 d2 05 sts 0x05D2, r24 ; 0x8005d2 <_ZL26lcd_backlight_wake_trigger.lto_priv.538> lcd_long_press_active = 0; 26746: 10 92 d7 05 sts 0x05D7, r1 ; 0x8005d7 2674a: 43 cf rjmp .-378 ; 0x265d2 <__vector_14+0x82> { WRITE(HEATER_0_PIN,1); #ifdef HEATERS_PARALLEL WRITE(HEATER_1_PIN,1); #endif } else WRITE(HEATER_0_PIN,0); 2674c: 75 98 cbi 0x0e, 5 ; 14 2674e: 78 cf rjmp .-272 ; 0x26640 <__vector_14+0xf0> #ifdef FAN_SOFT_PWM if ((pwm_count & ((1 << FAN_SOFT_PWM_BITS) - 1)) == 0) { soft_pwm_fan = fanSpeedSoftPwm / (1 << (8 - FAN_SOFT_PWM_BITS)); if(soft_pwm_fan > 0) WRITE(FAN_PIN,1); else WRITE(FAN_PIN,0); 26750: 9f b7 in r25, 0x3f ; 63 26752: f8 94 cli 26754: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 26758: 87 7f andi r24, 0xF7 ; 247 2675a: 88 cf rjmp .-240 ; 0x2666c <__vector_14+0x11c> babystep(axis,/*fwd*/true); babystepsTodo[axis]--; //less to do next time } } else if(curTodo<0) 2675c: 89 2b or r24, r25 2675e: 09 f4 brne .+2 ; 0x26762 <__vector_14+0x212> 26760: bd cf rjmp .-134 ; 0x266dc <__vector_14+0x18c> { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 26762: ff b6 in r15, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 26764: f8 94 cli babystep(axis,/*fwd*/false); 26766: 60 e0 ldi r22, 0x00 ; 0 26768: 80 2f mov r24, r16 2676a: 0f 94 7a 13 call 0x226f4 ; 0x226f4 babystepsTodo[axis]++; //less to do next time 2676e: 88 81 ld r24, Y 26770: 99 81 ldd r25, Y+1 ; 0x01 26772: 01 96 adiw r24, 0x01 ; 1 26774: b0 cf rjmp .-160 ; 0x266d6 <__vector_14+0x186> #if (defined(FANCHECK) && defined(TACH_0) && (TACH_0 > -1)) void readFanTach() { static bool fan_state[2]; #ifdef FAN_SOFT_PWM if (READ(TACH_0) != fan_state[0]) { 26776: 9c b1 in r25, 0x0c ; 12 26778: 80 91 e5 05 lds r24, 0x05E5 ; 0x8005e5 2677c: 96 fb bst r25, 6 2677e: 99 27 eor r25, r25 26780: 90 f9 bld r25, 0 26782: 98 17 cp r25, r24 26784: 91 f0 breq .+36 ; 0x267aa <__vector_14+0x25a> if(fan_measuring) fan_edge_counter[0] ++; 26786: 90 91 6e 06 lds r25, 0x066E ; 0x80066e 2678a: 99 23 and r25, r25 2678c: 51 f0 breq .+20 ; 0x267a2 <__vector_14+0x252> 2678e: 20 91 e1 05 lds r18, 0x05E1 ; 0x8005e1 26792: 30 91 e2 05 lds r19, 0x05E2 ; 0x8005e2 26796: 2f 5f subi r18, 0xFF ; 255 26798: 3f 4f sbci r19, 0xFF ; 255 2679a: 30 93 e2 05 sts 0x05E2, r19 ; 0x8005e2 2679e: 20 93 e1 05 sts 0x05E1, r18 ; 0x8005e1 fan_state[0] = !fan_state[0]; 267a2: 91 e0 ldi r25, 0x01 ; 1 267a4: 89 27 eor r24, r25 267a6: 80 93 e5 05 sts 0x05E5, r24 ; 0x8005e5 (void)__s; } static __inline__ void __iCliParam(const uint8_t *__s) { cli(); 267aa: f8 94 cli { DISABLE_SOFT_PWM_INTERRUPT(); NONATOMIC_BLOCK(NONATOMIC_FORCEOFF) { soft_pwm_isr(); } ENABLE_SOFT_PWM_INTERRUPT(); 267ac: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 267b0: 84 60 ori r24, 0x04 ; 4 267b2: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> } 267b6: ff 91 pop r31 267b8: ef 91 pop r30 267ba: df 91 pop r29 267bc: cf 91 pop r28 267be: bf 91 pop r27 267c0: af 91 pop r26 267c2: 9f 91 pop r25 267c4: 8f 91 pop r24 267c6: 7f 91 pop r23 267c8: 6f 91 pop r22 267ca: 5f 91 pop r21 267cc: 4f 91 pop r20 267ce: 3f 91 pop r19 267d0: 2f 91 pop r18 267d2: 1f 91 pop r17 267d4: 0f 91 pop r16 267d6: ff 90 pop r15 267d8: 0f 90 pop r0 267da: 0b be out 0x3b, r0 ; 59 267dc: 0f 90 pop r0 267de: 0f be out 0x3f, r0 ; 63 267e0: 0f 90 pop r0 267e2: 1f 90 pop r1 267e4: 18 95 reti 000267e6 : #endif } #ifdef AMBIENT_THERMISTOR static float analog2tempAmbient(int raw) { 267e6: 4f 92 push r4 267e8: 5f 92 push r5 267ea: 6f 92 push r6 267ec: 7f 92 push r7 267ee: af 92 push r10 267f0: bf 92 push r11 267f2: cf 92 push r12 267f4: df 92 push r13 267f6: ef 92 push r14 267f8: ff 92 push r15 267fa: 0f 93 push r16 267fc: 1f 93 push r17 267fe: cf 93 push r28 26800: df 93 push r29 26802: 24 e0 ldi r18, 0x04 ; 4 26804: 30 e0 ldi r19, 0x00 ; 0 26806: 41 e0 ldi r20, 0x01 ; 1 26808: 50 e0 ldi r21, 0x00 ; 0 2680a: d9 01 movw r26, r18 2680c: ad 5b subi r26, 0xBD ; 189 2680e: b2 46 sbci r27, 0x62 ; 98 float celsius = 0; byte i; for (i=1; i raw) 26810: fd 01 movw r30, r26 26812: 65 91 lpm r22, Z+ 26814: 74 91 lpm r23, Z 26816: 86 17 cp r24, r22 26818: 97 07 cpc r25, r23 2681a: 0c f0 brlt .+2 ; 0x2681e 2681c: 66 c0 rjmp .+204 ; 0x268ea { celsius = PGM_RD_W(AMBIENTTEMPTABLE[i-1][1]) + 2681e: 41 50 subi r20, 0x01 ; 1 26820: 51 09 sbc r21, r1 26822: 44 0f add r20, r20 26824: 55 1f adc r21, r21 26826: 44 0f add r20, r20 26828: 55 1f adc r21, r21 2682a: ea 01 movw r28, r20 2682c: cb 5b subi r28, 0xBB ; 187 2682e: d2 46 sbci r29, 0x62 ; 98 26830: fe 01 movw r30, r28 26832: 05 91 lpm r16, Z+ 26834: 14 91 lpm r17, Z (raw - PGM_RD_W(AMBIENTTEMPTABLE[i-1][0])) * 26836: 4d 5b subi r20, 0xBD ; 189 26838: 52 46 sbci r21, 0x62 ; 98 2683a: fa 01 movw r30, r20 2683c: 65 91 lpm r22, Z+ 2683e: 74 91 lpm r23, Z (float)(PGM_RD_W(AMBIENTTEMPTABLE[i][1]) - PGM_RD_W(AMBIENTTEMPTABLE[i-1][1])) / 26840: f9 01 movw r30, r18 26842: eb 5b subi r30, 0xBB ; 187 26844: f2 46 sbci r31, 0x62 ; 98 26846: e5 90 lpm r14, Z+ 26848: f4 90 lpm r15, Z 2684a: fe 01 movw r30, r28 2684c: c5 90 lpm r12, Z+ 2684e: d4 90 lpm r13, Z (float)(PGM_RD_W(AMBIENTTEMPTABLE[i][0]) - PGM_RD_W(AMBIENTTEMPTABLE[i-1][0])); 26850: fd 01 movw r30, r26 26852: c5 91 lpm r28, Z+ 26854: d4 91 lpm r29, Z 26856: fa 01 movw r30, r20 26858: a5 90 lpm r10, Z+ 2685a: b4 90 lpm r11, Z for (i=1; i raw) { celsius = PGM_RD_W(AMBIENTTEMPTABLE[i-1][1]) + (raw - PGM_RD_W(AMBIENTTEMPTABLE[i-1][0])) * 2685c: 86 1b sub r24, r22 2685e: 97 0b sbc r25, r23 26860: bc 01 movw r22, r24 26862: 99 0f add r25, r25 26864: 88 0b sbc r24, r24 26866: 99 0b sbc r25, r25 26868: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 2686c: 2b 01 movw r4, r22 2686e: 3c 01 movw r6, r24 (float)(PGM_RD_W(AMBIENTTEMPTABLE[i][1]) - PGM_RD_W(AMBIENTTEMPTABLE[i-1][1])) / 26870: b7 01 movw r22, r14 26872: 6c 19 sub r22, r12 26874: 7d 09 sbc r23, r13 26876: 07 2e mov r0, r23 26878: 00 0c add r0, r0 2687a: 88 0b sbc r24, r24 2687c: 99 0b sbc r25, r25 2687e: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 26882: 9b 01 movw r18, r22 26884: ac 01 movw r20, r24 for (i=1; i raw) { celsius = PGM_RD_W(AMBIENTTEMPTABLE[i-1][1]) + (raw - PGM_RD_W(AMBIENTTEMPTABLE[i-1][0])) * 26886: c3 01 movw r24, r6 26888: b2 01 movw r22, r4 2688a: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 2688e: 6b 01 movw r12, r22 26890: 7c 01 movw r14, r24 (float)(PGM_RD_W(AMBIENTTEMPTABLE[i][1]) - PGM_RD_W(AMBIENTTEMPTABLE[i-1][1])) / (float)(PGM_RD_W(AMBIENTTEMPTABLE[i][0]) - PGM_RD_W(AMBIENTTEMPTABLE[i-1][0])); 26892: be 01 movw r22, r28 26894: 6a 19 sub r22, r10 26896: 7b 09 sbc r23, r11 26898: 07 2e mov r0, r23 2689a: 00 0c add r0, r0 2689c: 88 0b sbc r24, r24 2689e: 99 0b sbc r25, r25 268a0: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 268a4: 9b 01 movw r18, r22 268a6: ac 01 movw r20, r24 { if (PGM_RD_W(AMBIENTTEMPTABLE[i][0]) > raw) { celsius = PGM_RD_W(AMBIENTTEMPTABLE[i-1][1]) + (raw - PGM_RD_W(AMBIENTTEMPTABLE[i-1][0])) * (float)(PGM_RD_W(AMBIENTTEMPTABLE[i][1]) - PGM_RD_W(AMBIENTTEMPTABLE[i-1][1])) / 268a8: c7 01 movw r24, r14 268aa: b6 01 movw r22, r12 268ac: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 268b0: 6b 01 movw r12, r22 268b2: 7c 01 movw r14, r24 for (i=1; i raw) { celsius = PGM_RD_W(AMBIENTTEMPTABLE[i-1][1]) + 268b4: b8 01 movw r22, r16 268b6: 11 0f add r17, r17 268b8: 88 0b sbc r24, r24 268ba: 99 0b sbc r25, r25 268bc: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 268c0: 9b 01 movw r18, r22 268c2: ac 01 movw r20, r24 268c4: c7 01 movw r24, r14 268c6: b6 01 movw r22, r12 268c8: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> } } // Overflow: Set to last value in the table if (i == AMBIENTTEMPTABLE_LEN) celsius = PGM_RD_W(AMBIENTTEMPTABLE[i-1][1]); return celsius; } 268cc: df 91 pop r29 268ce: cf 91 pop r28 268d0: 1f 91 pop r17 268d2: 0f 91 pop r16 268d4: ff 90 pop r15 268d6: ef 90 pop r14 268d8: df 90 pop r13 268da: cf 90 pop r12 268dc: bf 90 pop r11 268de: af 90 pop r10 268e0: 7f 90 pop r7 268e2: 6f 90 pop r6 268e4: 5f 90 pop r5 268e6: 4f 90 pop r4 268e8: 08 95 ret 268ea: 4f 5f subi r20, 0xFF ; 255 268ec: 5f 4f sbci r21, 0xFF ; 255 268ee: 2c 5f subi r18, 0xFC ; 252 268f0: 3f 4f sbci r19, 0xFF ; 255 static float analog2tempAmbient(int raw) { float celsius = 0; byte i; for (i=1; i 268f8: 88 cf rjmp .-240 ; 0x2680a (float)(PGM_RD_W(AMBIENTTEMPTABLE[i][0]) - PGM_RD_W(AMBIENTTEMPTABLE[i-1][0])); break; } } // Overflow: Set to last value in the table if (i == AMBIENTTEMPTABLE_LEN) celsius = PGM_RD_W(AMBIENTTEMPTABLE[i-1][1]); 268fa: e9 ec ldi r30, 0xC9 ; 201 268fc: fd e9 ldi r31, 0x9D ; 157 268fe: 65 91 lpm r22, Z+ 26900: 74 91 lpm r23, Z 26902: 07 2e mov r0, r23 26904: 00 0c add r0, r0 26906: 88 0b sbc r24, r24 26908: 99 0b sbc r25, r25 2690a: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 2690e: de cf rjmp .-68 ; 0x268cc 00026910 : 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) { 26910: 4f 92 push r4 26912: 5f 92 push r5 26914: 6f 92 push r6 26916: 7f 92 push r7 26918: af 92 push r10 2691a: bf 92 push r11 2691c: cf 92 push r12 2691e: df 92 push r13 26920: ef 92 push r14 26922: ff 92 push r15 26924: 0f 93 push r16 26926: 1f 93 push r17 26928: cf 93 push r28 2692a: df 93 push r29 2692c: 24 e0 ldi r18, 0x04 ; 4 2692e: 30 e0 ldi r19, 0x00 ; 0 26930: 41 e0 ldi r20, 0x01 ; 1 26932: 50 e0 ldi r21, 0x00 ; 0 26934: d9 01 movw r26, r18 26936: a1 5b subi r26, 0xB1 ; 177 26938: b3 46 sbci r27, 0x63 ; 99 float celsius = 0; byte i; for (i=1; i raw) 2693a: fd 01 movw r30, r26 2693c: 65 91 lpm r22, Z+ 2693e: 74 91 lpm r23, Z 26940: 86 17 cp r24, r22 26942: 97 07 cpc r25, r23 26944: 0c f0 brlt .+2 ; 0x26948 26946: 80 c0 rjmp .+256 ; 0x26a48 { celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]) + 26948: 41 50 subi r20, 0x01 ; 1 2694a: 51 09 sbc r21, r1 2694c: 44 0f add r20, r20 2694e: 55 1f adc r21, r21 26950: 44 0f add r20, r20 26952: 55 1f adc r21, r21 26954: 8a 01 movw r16, r20 26956: 0f 5a subi r16, 0xAF ; 175 26958: 13 46 sbci r17, 0x63 ; 99 2695a: f8 01 movw r30, r16 2695c: c5 90 lpm r12, Z+ 2695e: d4 90 lpm r13, Z (raw - PGM_RD_W(BEDTEMPTABLE[i-1][0])) * 26960: 41 5b subi r20, 0xB1 ; 177 26962: 53 46 sbci r21, 0x63 ; 99 26964: fa 01 movw r30, r20 26966: 65 91 lpm r22, Z+ 26968: 74 91 lpm r23, Z (float)(PGM_RD_W(BEDTEMPTABLE[i][1]) - PGM_RD_W(BEDTEMPTABLE[i-1][1])) / 2696a: f9 01 movw r30, r18 2696c: ef 5a subi r30, 0xAF ; 175 2696e: f3 46 sbci r31, 0x63 ; 99 26970: c5 91 lpm r28, Z+ 26972: d4 91 lpm r29, Z 26974: f8 01 movw r30, r16 26976: 05 91 lpm r16, Z+ 26978: 14 91 lpm r17, Z (float)(PGM_RD_W(BEDTEMPTABLE[i][0]) - PGM_RD_W(BEDTEMPTABLE[i-1][0])); 2697a: fd 01 movw r30, r26 2697c: e5 90 lpm r14, Z+ 2697e: f4 90 lpm r15, Z 26980: fa 01 movw r30, r20 26982: a5 90 lpm r10, Z+ 26984: 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])) * 26986: 86 1b sub r24, r22 26988: 97 0b sbc r25, r23 2698a: bc 01 movw r22, r24 2698c: 99 0f add r25, r25 2698e: 88 0b sbc r24, r24 26990: 99 0b sbc r25, r25 26992: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 26996: 2b 01 movw r4, r22 26998: 3c 01 movw r6, r24 (float)(PGM_RD_W(BEDTEMPTABLE[i][1]) - PGM_RD_W(BEDTEMPTABLE[i-1][1])) / 2699a: be 01 movw r22, r28 2699c: 60 1b sub r22, r16 2699e: 71 0b sbc r23, r17 269a0: 07 2e mov r0, r23 269a2: 00 0c add r0, r0 269a4: 88 0b sbc r24, r24 269a6: 99 0b sbc r25, r25 269a8: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 269ac: 9b 01 movw r18, r22 269ae: 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])) * 269b0: c3 01 movw r24, r6 269b2: b2 01 movw r22, r4 269b4: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 269b8: 2b 01 movw r4, r22 269ba: 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])); 269bc: b7 01 movw r22, r14 269be: 6a 19 sub r22, r10 269c0: 7b 09 sbc r23, r11 269c2: 07 2e mov r0, r23 269c4: 00 0c add r0, r0 269c6: 88 0b sbc r24, r24 269c8: 99 0b sbc r25, r25 269ca: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 269ce: 9b 01 movw r18, r22 269d0: 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])) / 269d2: c3 01 movw r24, r6 269d4: b2 01 movw r22, r4 269d6: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 269da: 2b 01 movw r4, r22 269dc: 3c 01 movw r6, r24 for (i=1; i raw) { celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]) + 269de: b6 01 movw r22, r12 269e0: dd 0c add r13, r13 269e2: 88 0b sbc r24, r24 269e4: 99 0b sbc r25, r25 269e6: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 269ea: 9b 01 movw r18, r22 269ec: ac 01 movw r20, r24 269ee: c3 01 movw r24, r6 269f0: b2 01 movw r22, r4 269f2: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> break; } } // Overflow: Set to last value in the table if (i == BEDTEMPTABLE_LEN) celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]); 269f6: 6b 01 movw r12, r22 269f8: 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) 269fa: 20 e0 ldi r18, 0x00 ; 0 269fc: 30 e0 ldi r19, 0x00 ; 0 269fe: 40 e2 ldi r20, 0x20 ; 32 26a00: 52 e4 ldi r21, 0x42 ; 66 26a02: c7 01 movw r24, r14 26a04: b6 01 movw r22, r12 26a06: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 26a0a: 87 fd sbrc r24, 7 26a0c: 30 c0 rjmp .+96 ; 0x26a6e 26a0e: 20 e0 ldi r18, 0x00 ; 0 26a10: 30 e0 ldi r19, 0x00 ; 0 26a12: 48 e4 ldi r20, 0x48 ; 72 26a14: 52 e4 ldi r21, 0x42 ; 66 26a16: c7 01 movw r24, r14 26a18: b6 01 movw r22, r12 26a1a: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 26a1e: 18 16 cp r1, r24 26a20: 34 f1 brlt .+76 ; 0x26a6e { celsius = celsius + (_first_koef * (celsius - _offset_start)); 26a22: 20 e0 ldi r18, 0x00 ; 0 26a24: 30 e0 ldi r19, 0x00 ; 0 26a26: 40 e2 ldi r20, 0x20 ; 32 26a28: 52 e4 ldi r21, 0x42 ; 66 26a2a: c7 01 movw r24, r14 26a2c: b6 01 movw r22, r12 26a2e: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 26a32: 20 e0 ldi r18, 0x00 ; 0 26a34: 30 e0 ldi r19, 0x00 ; 0 26a36: 40 e0 ldi r20, 0x00 ; 0 26a38: 5f e3 ldi r21, 0x3F ; 63 26a3a: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 26a3e: 9b 01 movw r18, r22 26a40: 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; 26a42: c7 01 movw r24, r14 26a44: b6 01 movw r22, r12 26a46: 43 c0 rjmp .+134 ; 0x26ace 26a48: 4f 5f subi r20, 0xFF ; 255 26a4a: 5f 4f sbci r21, 0xFF ; 255 26a4c: 2c 5f subi r18, 0xFC ; 252 26a4e: 3f 4f sbci r19, 0xFF ; 255 static float analog2tempBed(int raw) { #ifdef BED_USES_THERMISTOR float celsius = 0; byte i; for (i=1; i 26a56: 6e cf rjmp .-292 ; 0x26934 break; } } // Overflow: Set to last value in the table if (i == BEDTEMPTABLE_LEN) celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]); 26a58: e1 e4 ldi r30, 0x41 ; 65 26a5a: fd e9 ldi r31, 0x9D ; 157 26a5c: 65 91 lpm r22, Z+ 26a5e: 74 91 lpm r23, Z 26a60: 07 2e mov r0, r23 26a62: 00 0c add r0, r0 26a64: 88 0b sbc r24, r24 26a66: 99 0b sbc r25, r25 26a68: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 26a6c: c4 cf rjmp .-120 ; 0x269f6 if (celsius >= _offset_start && celsius <= _offset_center) { celsius = celsius + (_first_koef * (celsius - _offset_start)); } else if (celsius > _offset_center && celsius <= 100) 26a6e: 20 e0 ldi r18, 0x00 ; 0 26a70: 30 e0 ldi r19, 0x00 ; 0 26a72: 48 e4 ldi r20, 0x48 ; 72 26a74: 52 e4 ldi r21, 0x42 ; 66 26a76: c7 01 movw r24, r14 26a78: b6 01 movw r22, r12 26a7a: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 26a7e: 18 16 cp r1, r24 26a80: dc f5 brge .+118 ; 0x26af8 26a82: 20 e0 ldi r18, 0x00 ; 0 26a84: 30 e0 ldi r19, 0x00 ; 0 26a86: 48 ec ldi r20, 0xC8 ; 200 26a88: 52 e4 ldi r21, 0x42 ; 66 26a8a: c7 01 movw r24, r14 26a8c: b6 01 movw r22, r12 26a8e: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 26a92: 18 16 cp r1, r24 26a94: 8c f1 brlt .+98 ; 0x26af8 { celsius = celsius + (_first_koef * (_offset_center - _offset_start)) + ( _second_koef * ( celsius - ( 100 - _offset_center ) )) ; 26a96: 20 e0 ldi r18, 0x00 ; 0 26a98: 30 e0 ldi r19, 0x00 ; 0 26a9a: 40 ea ldi r20, 0xA0 ; 160 26a9c: 50 e4 ldi r21, 0x40 ; 64 26a9e: c7 01 movw r24, r14 26aa0: b6 01 movw r22, r12 26aa2: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 26aa6: 2b 01 movw r4, r22 26aa8: 3c 01 movw r6, r24 26aaa: 20 e0 ldi r18, 0x00 ; 0 26aac: 30 e0 ldi r19, 0x00 ; 0 26aae: 48 e4 ldi r20, 0x48 ; 72 26ab0: 52 e4 ldi r21, 0x42 ; 66 26ab2: c7 01 movw r24, r14 26ab4: b6 01 movw r22, r12 26ab6: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 26aba: 2d ec ldi r18, 0xCD ; 205 26abc: 3c ec ldi r19, 0xCC ; 204 26abe: 4c ec ldi r20, 0xCC ; 204 26ac0: 5d e3 ldi r21, 0x3D ; 61 26ac2: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 26ac6: 9b 01 movw r18, r22 26ac8: ac 01 movw r20, r24 26aca: c3 01 movw r24, r6 26acc: b2 01 movw r22, r4 } else if (celsius > 100) { celsius = celsius + _offset; 26ace: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 26ad2: 6b 01 movw r12, r22 26ad4: 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 } 26ad6: c7 01 movw r24, r14 26ad8: b6 01 movw r22, r12 26ada: df 91 pop r29 26adc: cf 91 pop r28 26ade: 1f 91 pop r17 26ae0: 0f 91 pop r16 26ae2: ff 90 pop r15 26ae4: ef 90 pop r14 26ae6: df 90 pop r13 26ae8: cf 90 pop r12 26aea: bf 90 pop r11 26aec: af 90 pop r10 26aee: 7f 90 pop r7 26af0: 6f 90 pop r6 26af2: 5f 90 pop r5 26af4: 4f 90 pop r4 26af6: 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) 26af8: 20 e0 ldi r18, 0x00 ; 0 26afa: 30 e0 ldi r19, 0x00 ; 0 26afc: 48 ec ldi r20, 0xC8 ; 200 26afe: 52 e4 ldi r21, 0x42 ; 66 26b00: c7 01 movw r24, r14 26b02: b6 01 movw r22, r12 26b04: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 26b08: 18 16 cp r1, r24 26b0a: 2c f7 brge .-54 ; 0x26ad6 { celsius = celsius + _offset; 26b0c: 20 e0 ldi r18, 0x00 ; 0 26b0e: 30 e0 ldi r19, 0x00 ; 0 26b10: 40 e2 ldi r20, 0x20 ; 32 26b12: 51 e4 ldi r21, 0x41 ; 65 26b14: 96 cf rjmp .-212 ; 0x26a42 00026b16 : } static void check_temp_raw(); static void temp_mgr_isr() { 26b16: 4f 92 push r4 26b18: 5f 92 push r5 26b1a: 6f 92 push r6 26b1c: 7f 92 push r7 26b1e: af 92 push r10 26b20: cf 92 push r12 26b22: df 92 push r13 26b24: ef 92 push r14 26b26: ff 92 push r15 26b28: 0f 93 push r16 26b2a: 1f 93 push r17 26b2c: cf 93 push r28 26b2e: df 93 push r29 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 26b34: 90 91 0b 06 lds r25, 0x060B ; 0x80060b 26b38: 0f 94 d7 a0 call 0x341ae ; 0x341ae 26b3c: 60 93 16 05 sts 0x0516, r22 ; 0x800516 26b40: 70 93 17 05 sts 0x0517, r23 ; 0x800517 26b44: 80 93 18 05 sts 0x0518, r24 ; 0x800518 26b48: 90 93 19 05 sts 0x0519, r25 ; 0x800519 current_temperature_bed_isr = analog2tempBed(current_temperature_bed_raw); 26b4c: 60 90 08 06 lds r6, 0x0608 ; 0x800608 26b50: 70 90 09 06 lds r7, 0x0609 ; 0x800609 26b54: c3 01 movw r24, r6 26b56: 0f 94 88 34 call 0x26910 ; 0x26910 26b5a: 6b 01 movw r12, r22 26b5c: 7c 01 movw r14, r24 26b5e: c0 92 18 06 sts 0x0618, r12 ; 0x800618 26b62: d0 92 19 06 sts 0x0619, r13 ; 0x800619 26b66: e0 92 1a 06 sts 0x061A, r14 ; 0x80061a 26b6a: f0 92 1b 06 sts 0x061B, r15 ; 0x80061b #ifdef PINDA_THERMISTOR current_temperature_pinda_isr = analog2tempBed(current_temperature_raw_pinda); 26b6e: 80 91 06 06 lds r24, 0x0606 ; 0x800606 26b72: 90 91 07 06 lds r25, 0x0607 ; 0x800607 26b76: 0f 94 88 34 call 0x26910 ; 0x26910 26b7a: 60 93 02 06 sts 0x0602, r22 ; 0x800602 26b7e: 70 93 03 06 sts 0x0603, r23 ; 0x800603 26b82: 80 93 04 06 sts 0x0604, r24 ; 0x800604 26b86: 90 93 05 06 sts 0x0605, r25 ; 0x800605 #endif #ifdef AMBIENT_THERMISTOR current_temperature_ambient_isr = analog2tempAmbient(current_temperature_raw_ambient); //thermistor for ambient is NTCG104LH104JT1 (2000) 26b8a: c0 91 14 06 lds r28, 0x0614 ; 0x800614 26b8e: d0 91 15 06 lds r29, 0x0615 ; 0x800615 26b92: ce 01 movw r24, r28 26b94: 0f 94 f3 33 call 0x267e6 ; 0x267e6 26b98: 60 93 1f 06 sts 0x061F, r22 ; 0x80061f 26b9c: 70 93 20 06 sts 0x0620, r23 ; 0x800620 26ba0: 80 93 21 06 sts 0x0621, r24 ; 0x800621 26ba4: 90 93 22 06 sts 0x0622, r25 ; 0x800622 #endif temp_meas_ready = true; 26ba8: 81 e0 ldi r24, 0x01 ; 1 26baa: 80 93 01 06 sts 0x0601, r24 ; 0x800601 { // update *_isr temperatures from raw values for PID regulation setIsrTemperaturesFromRawValues(); // clear the error assertion flag before checking again temp_error_state.assert = false; 26bae: 80 91 1a 05 lds r24, 0x051A ; 0x80051a <_ZL16temp_error_state.lto_priv.454> 26bb2: 8d 7f andi r24, 0xFD ; 253 26bb4: 80 93 1a 05 sts 0x051A, r24 ; 0x80051a <_ZL16temp_error_state.lto_priv.454> 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]) { 26bb8: 20 91 0a 06 lds r18, 0x060A ; 0x80060a 26bbc: 30 91 0b 06 lds r19, 0x060B ; 0x80060b 26bc0: 80 91 a0 04 lds r24, 0x04A0 ; 0x8004a0 <_ZL12maxttemp_raw.lto_priv.463> 26bc4: 90 91 a1 04 lds r25, 0x04A1 ; 0x8004a1 <_ZL12maxttemp_raw.lto_priv.463+0x1> 26bc8: 82 17 cp r24, r18 26bca: 93 07 cpc r25, r19 26bcc: 2c f0 brlt .+10 ; 0x26bd8 #else if (current_temperature_raw[0] >= maxttemp_raw[0]) { #endif set_temp_error(TempErrorSource::hotend, 0, TempErrorType::max); 26bce: 40 e0 ldi r20, 0x00 ; 0 26bd0: 60 e0 ldi r22, 0x00 ; 0 26bd2: 80 e0 ldi r24, 0x00 ; 0 26bd4: 0f 94 09 2f call 0x25e12 ; 0x25e12 } //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) { 26bd8: 80 91 9e 04 lds r24, 0x049E ; 0x80049e <_ZL16bed_maxttemp_raw.lto_priv.464> 26bdc: 90 91 9f 04 lds r25, 0x049F ; 0x80049f <_ZL16bed_maxttemp_raw.lto_priv.464+0x1> 26be0: 86 15 cp r24, r6 26be2: 97 05 cpc r25, r7 26be4: 2c f0 brlt .+10 ; 0x26bf0 #else if (current_temperature_bed_raw >= bed_maxttemp_raw) { #endif set_temp_error(TempErrorSource::bed, 0, TempErrorType::max); 26be6: 40 e0 ldi r20, 0x00 ; 0 26be8: 60 e0 ldi r22, 0x00 ; 0 26bea: 81 e0 ldi r24, 0x01 ; 1 26bec: 0f 94 09 2f call 0x25e12 ; 0x25e12 } #endif //ambient #if defined(AMBIENT_MAXTEMP) && (TEMP_SENSOR_AMBIENT != 0) #if AMBIENT_RAW_LO_TEMP > AMBIENT_RAW_HI_TEMP if (current_temperature_raw_ambient <= ambient_maxttemp_raw) { 26bf0: 80 91 9c 04 lds r24, 0x049C ; 0x80049c <_ZL20ambient_maxttemp_raw.lto_priv.465> 26bf4: 90 91 9d 04 lds r25, 0x049D ; 0x80049d <_ZL20ambient_maxttemp_raw.lto_priv.465+0x1> 26bf8: 8c 17 cp r24, r28 26bfa: 9d 07 cpc r25, r29 26bfc: 2c f0 brlt .+10 ; 0x26c08 #else if (current_temperature_raw_ambient >= ambient_maxttemp_raw) { #endif set_temp_error(TempErrorSource::ambient, 0, TempErrorType::max); 26bfe: 40 e0 ldi r20, 0x00 ; 0 26c00: 60 e0 ldi r22, 0x00 ; 0 26c02: 82 e0 ldi r24, 0x02 ; 2 26c04: 0f 94 09 2f call 0x25e12 ; 0x25e12 #ifdef AMBIENT_MINTEMP void check_min_temp_ambient() { #if AMBIENT_RAW_LO_TEMP > AMBIENT_RAW_HI_TEMP if (current_temperature_raw_ambient >= ambient_minttemp_raw) { 26c08: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL20ambient_minttemp_raw.lto_priv.462> 26c0c: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL20ambient_minttemp_raw.lto_priv.462+0x1> 26c10: c8 17 cp r28, r24 26c12: d9 07 cpc r29, r25 26c14: 2c f0 brlt .+10 ; 0x26c20 #else if (current_temperature_raw_ambient <= ambient_minttemp_raw) { #endif set_temp_error(TempErrorSource::ambient, 0, TempErrorType::min); 26c16: 41 e0 ldi r20, 0x01 ; 1 26c18: 60 e0 ldi r22, 0x00 ; 0 26c1a: 82 e0 ldi r24, 0x02 ; 2 26c1c: 0f 94 09 2f call 0x25e12 ; 0x25e12 #ifdef AMBIENT_MINTEMP // we need to check ambient temperature check_min_temp_ambient(); #endif #if AMBIENT_RAW_LO_TEMP > AMBIENT_RAW_HI_TEMP if(current_temperature_raw_ambient>(OVERSAMPLENR*MINTEMP_MINAMBIENT_RAW)) // thermistor is NTC type 26c20: c1 3a cpi r28, 0xA1 ; 161 26c22: de 43 sbci r29, 0x3E ; 62 26c24: 0c f4 brge .+2 ; 0x26c28 26c26: cd c1 rjmp .+922 ; 0x26fc2 { // 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]) { 26c28: 60 91 a2 04 lds r22, 0x04A2 ; 0x8004a2 <_ZL8minttemp.lto_priv.461> 26c2c: 70 91 a3 04 lds r23, 0x04A3 ; 0x8004a3 <_ZL8minttemp.lto_priv.461+0x1> 26c30: 80 91 1d 06 lds r24, 0x061D ; 0x80061d 26c34: 90 91 1e 06 lds r25, 0x061E ; 0x80061e 26c38: 68 17 cp r22, r24 26c3a: 79 07 cpc r23, r25 26c3c: 0c f0 brlt .+2 ; 0x26c40 26c3e: 55 c0 rjmp .+170 ; 0x26cea // ~ nozzle heating is on bCheckingOnHeater=bCheckingOnHeater||(current_temperature_isr[active_extruder]>(minttemp[active_extruder]+TEMP_HYSTERESIS)); // for eventually delay cutting 26c40: c0 91 13 06 lds r28, 0x0613 ; 0x800613 26c44: c1 11 cpse r28, r1 26c46: 18 c0 rjmp .+48 ; 0x26c78 26c48: 6b 5f subi r22, 0xFB ; 251 26c4a: 7f 4f sbci r23, 0xFF ; 255 26c4c: 07 2e mov r0, r23 26c4e: 00 0c add r0, r0 26c50: 88 0b sbc r24, r24 26c52: 99 0b sbc r25, r25 26c54: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 26c58: 9b 01 movw r18, r22 26c5a: ac 01 movw r20, r24 26c5c: c1 e0 ldi r28, 0x01 ; 1 26c5e: 60 91 16 05 lds r22, 0x0516 ; 0x800516 26c62: 70 91 17 05 lds r23, 0x0517 ; 0x800517 26c66: 80 91 18 05 lds r24, 0x0518 ; 0x800518 26c6a: 90 91 19 05 lds r25, 0x0519 ; 0x800519 26c6e: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 26c72: 18 16 cp r1, r24 26c74: 0c f0 brlt .+2 ; 0x26c78 26c76: c0 e0 ldi r28, 0x00 ; 0 26c78: c0 93 13 06 sts 0x0613, r28 ; 0x800613 if(oTimer4minTempHeater.expired_cont(HEATER_MINTEMP_DELAY) || bCheckingOnHeater) { 26c7c: 68 e9 ldi r22, 0x98 ; 152 26c7e: 7a e3 ldi r23, 0x3A ; 58 26c80: 80 e1 ldi r24, 0x10 ; 16 26c82: 96 e0 ldi r25, 0x06 ; 6 26c84: 0f 94 7c 29 call 0x252f8 ; 0x252f8 ::expired_cont(unsigned short)> 26c88: 81 11 cpse r24, r1 26c8a: 02 c0 rjmp .+4 ; 0x26c90 26c8c: cc 23 and r28, r28 26c8e: 29 f0 breq .+10 ; 0x26c9a bCheckingOnHeater=true; // not necessary 26c90: 81 e0 ldi r24, 0x01 ; 1 26c92: 80 93 13 06 sts 0x0613, r24 ; 0x800613 check_min_temp_heater0(); // delay is elapsed or temperature is/was over minTemp => periodical checking is active 26c96: 0f 94 7e 2f call 0x25efc ; 0x25efc // ~ nozzle heating is off oTimer4minTempHeater.start(); bCheckingOnHeater=false; } // * bed checking if(target_temperature_bed_isr>BED_MINTEMP) { 26c9a: 80 91 16 06 lds r24, 0x0616 ; 0x800616 26c9e: 90 91 17 06 lds r25, 0x0617 ; 0x800617 26ca2: 0b 97 sbiw r24, 0x0b ; 11 26ca4: 4c f1 brlt .+82 ; 0x26cf8 // ~ bed heating is on bCheckingOnBed=bCheckingOnBed||(current_temperature_bed_isr>(BED_MINTEMP+TEMP_HYSTERESIS)); // for eventually delay cutting 26ca6: c0 91 0f 06 lds r28, 0x060F ; 0x80060f 26caa: c1 11 cpse r28, r1 26cac: 0c c0 rjmp .+24 ; 0x26cc6 26cae: c1 e0 ldi r28, 0x01 ; 1 26cb0: 20 e0 ldi r18, 0x00 ; 0 26cb2: 30 e0 ldi r19, 0x00 ; 0 26cb4: 40 e7 ldi r20, 0x70 ; 112 26cb6: 51 e4 ldi r21, 0x41 ; 65 26cb8: c7 01 movw r24, r14 26cba: b6 01 movw r22, r12 26cbc: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 26cc0: 18 16 cp r1, r24 26cc2: 0c f0 brlt .+2 ; 0x26cc6 26cc4: c0 e0 ldi r28, 0x00 ; 0 26cc6: c0 93 0f 06 sts 0x060F, r28 ; 0x80060f if(oTimer4minTempBed.expired_cont(BED_MINTEMP_DELAY) || bCheckingOnBed) { 26cca: 60 e5 ldi r22, 0x50 ; 80 26ccc: 73 ec ldi r23, 0xC3 ; 195 26cce: 8c e0 ldi r24, 0x0C ; 12 26cd0: 96 e0 ldi r25, 0x06 ; 6 26cd2: 0f 94 7c 29 call 0x252f8 ; 0x252f8 ::expired_cont(unsigned short)> 26cd6: 81 11 cpse r24, r1 26cd8: 02 c0 rjmp .+4 ; 0x26cde 26cda: cc 23 and r28, r28 26cdc: 99 f0 breq .+38 ; 0x26d04 bCheckingOnBed=true; // not necessary 26cde: 81 e0 ldi r24, 0x01 ; 1 26ce0: 80 93 0f 06 sts 0x060F, r24 ; 0x80060f #ifdef AMBIENT_THERMISTOR } else { // ambient temperature is standard check_min_temp_heater0(); check_min_temp_bed(); 26ce4: 0f 94 6d 2f call 0x25eda ; 0x25eda 26ce8: 0d c0 rjmp .+26 ; 0x26d04 check_min_temp_heater0(); // delay is elapsed or temperature is/was over minTemp => periodical checking is active } } else { // ~ nozzle heating is off oTimer4minTempHeater.start(); 26cea: 80 e1 ldi r24, 0x10 ; 16 26cec: 96 e0 ldi r25, 0x06 ; 6 26cee: 0f 94 83 29 call 0x25306 ; 0x25306 ::start()> bCheckingOnHeater=false; 26cf2: 10 92 13 06 sts 0x0613, r1 ; 0x800613 26cf6: d1 cf rjmp .-94 ; 0x26c9a check_min_temp_bed(); // delay is elapsed or temperature is/was over minTemp => periodical checking is active } } else { // ~ bed heating is off oTimer4minTempBed.start(); 26cf8: 8c e0 ldi r24, 0x0C ; 12 26cfa: 96 e0 ldi r25, 0x06 ; 6 26cfc: 0f 94 83 29 call 0x25306 ; 0x25306 ::start()> bCheckingOnBed=false; 26d00: 10 92 0f 06 sts 0x060F, r1 ; 0x80060f 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); 26d04: 60 91 15 05 lds r22, 0x0515 ; 0x800515 <_ZL8soft_pwm.lto_priv.459> 26d08: 70 e0 ldi r23, 0x00 ; 0 26d0a: 90 e0 ldi r25, 0x00 ; 0 26d0c: 80 e0 ldi r24, 0x00 ; 0 26d0e: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 26d12: 6b 01 movw r12, r22 26d14: 7c 01 movw r14, r24 26d16: 40 90 16 05 lds r4, 0x0516 ; 0x800516 26d1a: 50 90 17 05 lds r5, 0x0517 ; 0x800517 26d1e: 60 90 18 05 lds r6, 0x0518 ; 0x800518 26d22: 70 90 19 05 lds r7, 0x0519 ; 0x800519 26d26: 60 91 1d 06 lds r22, 0x061D ; 0x80061d 26d2a: 70 91 1e 06 lds r23, 0x061E ; 0x80061e 26d2e: 07 2e mov r0, r23 26d30: 00 0c add r0, r0 26d32: 88 0b sbc r24, r24 26d34: 99 0b sbc r25, r25 26d36: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 26d3a: ab 01 movw r20, r22 26d3c: bc 01 movw r22, r24 26d3e: a1 2c mov r10, r1 26d40: 93 01 movw r18, r6 26d42: 82 01 movw r16, r4 26d44: 81 e0 ldi r24, 0x01 ; 1 26d46: 0f 94 8f 2f call 0x25f1e ; 0x25f1e #endif #ifdef TEMP_RUNAWAY_BED_HYSTERESIS temp_runaway_check(0, target_temperature_bed_isr, current_temperature_bed_isr, soft_pwm_bed, true); 26d4a: 60 91 1c 06 lds r22, 0x061C ; 0x80061c 26d4e: 70 e0 ldi r23, 0x00 ; 0 26d50: 90 e0 ldi r25, 0x00 ; 0 26d52: 80 e0 ldi r24, 0x00 ; 0 26d54: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 26d58: 6b 01 movw r12, r22 26d5a: 7c 01 movw r14, r24 26d5c: 40 90 18 06 lds r4, 0x0618 ; 0x800618 26d60: 50 90 19 06 lds r5, 0x0619 ; 0x800619 26d64: 60 90 1a 06 lds r6, 0x061A ; 0x80061a 26d68: 70 90 1b 06 lds r7, 0x061B ; 0x80061b 26d6c: 60 91 16 06 lds r22, 0x0616 ; 0x800616 26d70: 70 91 17 06 lds r23, 0x0617 ; 0x800617 26d74: 07 2e mov r0, r23 26d76: 00 0c add r0, r0 26d78: 88 0b sbc r24, r24 26d7a: 99 0b sbc r25, r25 26d7c: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 26d80: ab 01 movw r20, r22 26d82: bc 01 movw r22, r24 26d84: aa 24 eor r10, r10 26d86: a3 94 inc r10 26d88: 93 01 movw r18, r6 26d8a: 82 01 movw r16, r4 26d8c: 80 e0 ldi r24, 0x00 ; 0 26d8e: 0f 94 8f 2f call 0x25f1e ; 0x25f1e return true; } static void check() { if(!enabled) return; 26d92: 80 91 1c 05 lds r24, 0x051C ; 0x80051c <_ZN13thermal_modelL7enabledE.lto_priv.456> 26d96: 88 23 and r24, r24 26d98: 09 f4 brne .+2 ; 0x26d9c 26d9a: bc c0 rjmp .+376 ; 0x26f14 uint8_t heater_pwm = soft_pwm[0]; 26d9c: c0 91 15 05 lds r28, 0x0515 ; 0x800515 <_ZL8soft_pwm.lto_priv.459> uint8_t fan_pwm = soft_pwm_fan; 26da0: d0 91 a4 04 lds r29, 0x04A4 ; 0x8004a4 <_ZL12soft_pwm_fan.lto_priv.460> float heater_temp = current_temperature_isr[0]; 26da4: 40 90 16 05 lds r4, 0x0516 ; 0x800516 26da8: 50 90 17 05 lds r5, 0x0517 ; 0x800517 26dac: 60 90 18 05 lds r6, 0x0518 ; 0x800518 26db0: 70 90 19 05 lds r7, 0x0519 ; 0x800519 float ambient_temp = current_temperature_ambient_isr; 26db4: c0 90 1f 06 lds r12, 0x061F ; 0x80061f 26db8: d0 90 20 06 lds r13, 0x0620 ; 0x800620 26dbc: e0 90 21 06 lds r14, 0x0621 ; 0x800621 26dc0: f0 90 22 06 lds r15, 0x0622 ; 0x800622 // check if a reset is required to seed the model: this needs to be done with valid // ADC values, so we can't do that directly in init() if(data.flag_bits.uninitialized) 26dc4: 80 91 3b 13 lds r24, 0x133B ; 0x80133b <_ZN13thermal_modelL4dataE.lto_priv.400+0x8c> 26dc8: 80 ff sbrs r24, 0 26dca: 72 c0 rjmp .+228 ; 0x26eb0 void model_data::reset(uint8_t heater_pwm _UNUSED, uint8_t fan_pwm _UNUSED, float heater_temp _UNUSED, float ambient_temp _UNUSED) { // pre-compute invariant values C_i = (TEMP_MGR_INTV / C); 26dcc: 20 91 e5 12 lds r18, 0x12E5 ; 0x8012e5 <_ZN13thermal_modelL4dataE.lto_priv.400+0x36> 26dd0: 30 91 e6 12 lds r19, 0x12E6 ; 0x8012e6 <_ZN13thermal_modelL4dataE.lto_priv.400+0x37> 26dd4: 40 91 e7 12 lds r20, 0x12E7 ; 0x8012e7 <_ZN13thermal_modelL4dataE.lto_priv.400+0x38> 26dd8: 50 91 e8 12 lds r21, 0x12E8 ; 0x8012e8 <_ZN13thermal_modelL4dataE.lto_priv.400+0x39> 26ddc: 61 e7 ldi r22, 0x71 ; 113 26dde: 7d e3 ldi r23, 0x3D ; 61 26de0: 8a e8 ldi r24, 0x8A ; 138 26de2: 9e e3 ldi r25, 0x3E ; 62 26de4: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 26de8: 60 93 3c 13 sts 0x133C, r22 ; 0x80133c <_ZN13thermal_modelL4dataE.lto_priv.400+0x8d> 26dec: 70 93 3d 13 sts 0x133D, r23 ; 0x80133d <_ZN13thermal_modelL4dataE.lto_priv.400+0x8e> 26df0: 80 93 3e 13 sts 0x133E, r24 ; 0x80133e <_ZN13thermal_modelL4dataE.lto_priv.400+0x8f> 26df4: 90 93 3f 13 sts 0x133F, r25 ; 0x80133f <_ZN13thermal_modelL4dataE.lto_priv.400+0x90> warn_s = warn * TEMP_MGR_INTV; 26df8: 21 e7 ldi r18, 0x71 ; 113 26dfa: 3d e3 ldi r19, 0x3D ; 61 26dfc: 4a e8 ldi r20, 0x8A ; 138 26dfe: 5e e3 ldi r21, 0x3E ; 62 26e00: 60 91 33 13 lds r22, 0x1333 ; 0x801333 <_ZN13thermal_modelL4dataE.lto_priv.400+0x84> 26e04: 70 91 34 13 lds r23, 0x1334 ; 0x801334 <_ZN13thermal_modelL4dataE.lto_priv.400+0x85> 26e08: 80 91 35 13 lds r24, 0x1335 ; 0x801335 <_ZN13thermal_modelL4dataE.lto_priv.400+0x86> 26e0c: 90 91 36 13 lds r25, 0x1336 ; 0x801336 <_ZN13thermal_modelL4dataE.lto_priv.400+0x87> 26e10: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 26e14: 60 93 40 13 sts 0x1340, r22 ; 0x801340 <_ZN13thermal_modelL4dataE.lto_priv.400+0x91> 26e18: 70 93 41 13 sts 0x1341, r23 ; 0x801341 <_ZN13thermal_modelL4dataE.lto_priv.400+0x92> 26e1c: 80 93 42 13 sts 0x1342, r24 ; 0x801342 <_ZN13thermal_modelL4dataE.lto_priv.400+0x93> 26e20: 90 93 43 13 sts 0x1343, r25 ; 0x801343 <_ZN13thermal_modelL4dataE.lto_priv.400+0x94> err_s = err * TEMP_MGR_INTV; 26e24: 21 e7 ldi r18, 0x71 ; 113 26e26: 3d e3 ldi r19, 0x3D ; 61 26e28: 4a e8 ldi r20, 0x8A ; 138 26e2a: 5e e3 ldi r21, 0x3E ; 62 26e2c: 60 91 37 13 lds r22, 0x1337 ; 0x801337 <_ZN13thermal_modelL4dataE.lto_priv.400+0x88> 26e30: 70 91 38 13 lds r23, 0x1338 ; 0x801338 <_ZN13thermal_modelL4dataE.lto_priv.400+0x89> 26e34: 80 91 39 13 lds r24, 0x1339 ; 0x801339 <_ZN13thermal_modelL4dataE.lto_priv.400+0x8a> 26e38: 90 91 3a 13 lds r25, 0x133A ; 0x80133a <_ZN13thermal_modelL4dataE.lto_priv.400+0x8b> 26e3c: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 26e40: 60 93 44 13 sts 0x1344, r22 ; 0x801344 <_ZN13thermal_modelL4dataE.lto_priv.400+0x95> 26e44: 70 93 45 13 sts 0x1345, r23 ; 0x801345 <_ZN13thermal_modelL4dataE.lto_priv.400+0x96> 26e48: 80 93 46 13 sts 0x1346, r24 ; 0x801346 <_ZN13thermal_modelL4dataE.lto_priv.400+0x97> 26e4c: 90 93 47 13 sts 0x1347, r25 ; 0x801347 <_ZN13thermal_modelL4dataE.lto_priv.400+0x98> dT_lag_size = L / (uint16_t)(TEMP_MGR_INTV * 1000); 26e50: 80 91 ed 12 lds r24, 0x12ED ; 0x8012ed <_ZN13thermal_modelL4dataE.lto_priv.400+0x3e> 26e54: 90 91 ee 12 lds r25, 0x12EE ; 0x8012ee <_ZN13thermal_modelL4dataE.lto_priv.400+0x3f> 26e58: 6e e0 ldi r22, 0x0E ; 14 26e5a: 71 e0 ldi r23, 0x01 ; 1 26e5c: 0f 94 a0 dc call 0x3b940 ; 0x3b940 <__udivmodhi4> 26e60: 60 93 cf 12 sts 0x12CF, r22 ; 0x8012cf <_ZN13thermal_modelL4dataE.lto_priv.400+0x20> 26e64: ef ea ldi r30, 0xAF ; 175 26e66: f2 e1 ldi r31, 0x12 ; 18 26e68: 8f ec ldi r24, 0xCF ; 207 26e6a: 92 e1 ldi r25, 0x12 ; 18 // initial values for(uint8_t i = 0; i != THERMAL_MODEL_MAX_LAG_SIZE; ++i) dT_lag_buf[i] = NAN; 26e6c: 40 e0 ldi r20, 0x00 ; 0 26e6e: 50 e0 ldi r21, 0x00 ; 0 26e70: 60 ec ldi r22, 0xC0 ; 192 26e72: 7f e7 ldi r23, 0x7F ; 127 26e74: 41 93 st Z+, r20 26e76: 51 93 st Z+, r21 26e78: 61 93 st Z+, r22 26e7a: 71 93 st Z+, r23 warn_s = warn * TEMP_MGR_INTV; err_s = err * TEMP_MGR_INTV; dT_lag_size = L / (uint16_t)(TEMP_MGR_INTV * 1000); // initial values for(uint8_t i = 0; i != THERMAL_MODEL_MAX_LAG_SIZE; ++i) 26e7c: 8e 17 cp r24, r30 26e7e: 9f 07 cpc r25, r31 26e80: c9 f7 brne .-14 ; 0x26e74 dT_lag_buf[i] = NAN; dT_lag_idx = 0; 26e82: 10 92 d0 12 sts 0x12D0, r1 ; 0x8012d0 <_ZN13thermal_modelL4dataE.lto_priv.400+0x21> dT_err_prev = 0; 26e86: 10 92 d1 12 sts 0x12D1, r1 ; 0x8012d1 <_ZN13thermal_modelL4dataE.lto_priv.400+0x22> 26e8a: 10 92 d2 12 sts 0x12D2, r1 ; 0x8012d2 <_ZN13thermal_modelL4dataE.lto_priv.400+0x23> 26e8e: 10 92 d3 12 sts 0x12D3, r1 ; 0x8012d3 <_ZN13thermal_modelL4dataE.lto_priv.400+0x24> 26e92: 10 92 d4 12 sts 0x12D4, r1 ; 0x8012d4 <_ZN13thermal_modelL4dataE.lto_priv.400+0x25> T_prev = NAN; 26e96: 40 93 d5 12 sts 0x12D5, r20 ; 0x8012d5 <_ZN13thermal_modelL4dataE.lto_priv.400+0x26> 26e9a: 50 93 d6 12 sts 0x12D6, r21 ; 0x8012d6 <_ZN13thermal_modelL4dataE.lto_priv.400+0x27> 26e9e: 60 93 d7 12 sts 0x12D7, r22 ; 0x8012d7 <_ZN13thermal_modelL4dataE.lto_priv.400+0x28> 26ea2: 70 93 d8 12 sts 0x12D8, r23 ; 0x8012d8 <_ZN13thermal_modelL4dataE.lto_priv.400+0x29> // clear the initialization flag flag_bits.uninitialized = false; 26ea6: 80 91 3b 13 lds r24, 0x133B ; 0x80133b <_ZN13thermal_modelL4dataE.lto_priv.400+0x8c> 26eaa: 8e 7f andi r24, 0xFE ; 254 26eac: 80 93 3b 13 sts 0x133B, r24 ; 0x80133b <_ZN13thermal_modelL4dataE.lto_priv.400+0x8c> // ADC values, so we can't do that directly in init() if(data.flag_bits.uninitialized) data.reset(heater_pwm, fan_pwm, heater_temp, ambient_temp); // step the model data.step(heater_pwm, fan_pwm, heater_temp, ambient_temp); 26eb0: 87 01 movw r16, r14 26eb2: 76 01 movw r14, r12 26eb4: a3 01 movw r20, r6 26eb6: 92 01 movw r18, r4 26eb8: 6d 2f mov r22, r29 26eba: 8c 2f mov r24, r28 26ebc: 0e 94 0e e5 call 0x1ca1c ; 0x1ca1c // handle errors if(data.flag_bits.error) 26ec0: 80 91 3b 13 lds r24, 0x133B ; 0x80133b <_ZN13thermal_modelL4dataE.lto_priv.400+0x8c> 26ec4: 81 ff sbrs r24, 1 26ec6: 05 c0 rjmp .+10 ; 0x26ed2 set_temp_error(TempErrorSource::hotend, 0, TempErrorType::model); 26ec8: 44 e0 ldi r20, 0x04 ; 4 26eca: 60 e0 ldi r22, 0x00 ; 0 26ecc: 80 e0 ldi r24, 0x00 ; 0 26ece: 0f 94 09 2f call 0x25e12 ; 0x25e12 // handle warning conditions as lower-priority but with greater feedback warning_state.assert = data.flag_bits.warning; 26ed2: 90 91 3b 13 lds r25, 0x133B ; 0x80133b <_ZN13thermal_modelL4dataE.lto_priv.400+0x8c> 26ed6: 80 91 38 06 lds r24, 0x0638 ; 0x800638 26eda: 92 fb bst r25, 2 26edc: 81 f9 bld r24, 1 26ede: 80 93 38 06 sts 0x0638, r24 ; 0x800638 if(warning_state.assert) { 26ee2: 80 91 38 06 lds r24, 0x0638 ; 0x800638 26ee6: 81 ff sbrs r24, 1 26ee8: 15 c0 rjmp .+42 ; 0x26f14 warning_state.warning = true; 26eea: 80 91 38 06 lds r24, 0x0638 ; 0x800638 26eee: 81 60 ori r24, 0x01 ; 1 26ef0: 80 93 38 06 sts 0x0638, r24 ; 0x800638 warning_state.dT_err = thermal_model::data.dT_err_prev; 26ef4: 80 91 d1 12 lds r24, 0x12D1 ; 0x8012d1 <_ZN13thermal_modelL4dataE.lto_priv.400+0x22> 26ef8: 90 91 d2 12 lds r25, 0x12D2 ; 0x8012d2 <_ZN13thermal_modelL4dataE.lto_priv.400+0x23> 26efc: a0 91 d3 12 lds r26, 0x12D3 ; 0x8012d3 <_ZN13thermal_modelL4dataE.lto_priv.400+0x24> 26f00: b0 91 d4 12 lds r27, 0x12D4 ; 0x8012d4 <_ZN13thermal_modelL4dataE.lto_priv.400+0x25> 26f04: 80 93 34 06 sts 0x0634, r24 ; 0x800634 26f08: 90 93 35 06 sts 0x0635, r25 ; 0x800635 26f0c: a0 93 36 06 sts 0x0636, r26 ; 0x800636 26f10: b0 93 37 06 sts 0x0637, r27 ; 0x800637 (int)cur_pwm, (unsigned long)cur_temp_b, (unsigned long)cur_amb_b); } static void log_isr() { if(!log_buf.enabled) return; 26f14: 80 91 33 06 lds r24, 0x0633 ; 0x800633 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x10> 26f18: 88 23 and r24, r24 26f1a: 09 f4 brne .+2 ; 0x26f1e 26f1c: 3f c0 rjmp .+126 ; 0x26f9c uint32_t stamp = _millis(); 26f1e: 0f 94 22 29 call 0x25244 ; 0x25244 uint8_t delta_ms = stamp - log_buf.entry.stamp - (uint32_t)(TEMP_MGR_INTV * 1000); 26f22: c0 90 23 06 lds r12, 0x0623 ; 0x800623 <_ZN13thermal_modelL7log_bufE.lto_priv.537> 26f26: d0 90 24 06 lds r13, 0x0624 ; 0x800624 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x1> 26f2a: e0 90 25 06 lds r14, 0x0625 ; 0x800625 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x2> 26f2e: f0 90 26 06 lds r15, 0x0626 ; 0x800626 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x3> log_buf.entry.stamp = stamp; 26f32: 60 93 23 06 sts 0x0623, r22 ; 0x800623 <_ZN13thermal_modelL7log_bufE.lto_priv.537> 26f36: 70 93 24 06 sts 0x0624, r23 ; 0x800624 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x1> 26f3a: 80 93 25 06 sts 0x0625, r24 ; 0x800625 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x2> 26f3e: 90 93 26 06 sts 0x0626, r25 ; 0x800626 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x3> ++log_buf.entry.counter; 26f42: 20 91 28 06 lds r18, 0x0628 ; 0x800628 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x5> 26f46: 2f 5f subi r18, 0xFF ; 255 26f48: 20 93 28 06 sts 0x0628, r18 ; 0x800628 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x5> static void log_isr() { if(!log_buf.enabled) return; uint32_t stamp = _millis(); uint8_t delta_ms = stamp - log_buf.entry.stamp - (uint32_t)(TEMP_MGR_INTV * 1000); 26f4c: 6c 19 sub r22, r12 26f4e: 6e 50 subi r22, 0x0E ; 14 log_buf.entry.stamp = stamp; ++log_buf.entry.counter; log_buf.entry.delta_ms = delta_ms; 26f50: 60 93 27 06 sts 0x0627, r22 ; 0x800627 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x4> log_buf.entry.cur_pwm = soft_pwm[0]; 26f54: 80 91 15 05 lds r24, 0x0515 ; 0x800515 <_ZL8soft_pwm.lto_priv.459> 26f58: 80 93 29 06 sts 0x0629, r24 ; 0x800629 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x6> log_buf.entry.cur_temp = current_temperature_isr[0]; 26f5c: 80 91 16 05 lds r24, 0x0516 ; 0x800516 26f60: 90 91 17 05 lds r25, 0x0517 ; 0x800517 26f64: a0 91 18 05 lds r26, 0x0518 ; 0x800518 26f68: b0 91 19 05 lds r27, 0x0519 ; 0x800519 26f6c: 80 93 2a 06 sts 0x062A, r24 ; 0x80062a <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x7> 26f70: 90 93 2b 06 sts 0x062B, r25 ; 0x80062b <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x8> 26f74: a0 93 2c 06 sts 0x062C, r26 ; 0x80062c <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x9> 26f78: b0 93 2d 06 sts 0x062D, r27 ; 0x80062d <_ZN13thermal_modelL7log_bufE.lto_priv.537+0xa> log_buf.entry.cur_amb = current_temperature_ambient_isr; 26f7c: 80 91 1f 06 lds r24, 0x061F ; 0x80061f 26f80: 90 91 20 06 lds r25, 0x0620 ; 0x800620 26f84: a0 91 21 06 lds r26, 0x0621 ; 0x800621 26f88: b0 91 22 06 lds r27, 0x0622 ; 0x800622 26f8c: 80 93 2e 06 sts 0x062E, r24 ; 0x80062e <_ZN13thermal_modelL7log_bufE.lto_priv.537+0xb> 26f90: 90 93 2f 06 sts 0x062F, r25 ; 0x80062f <_ZN13thermal_modelL7log_bufE.lto_priv.537+0xc> 26f94: a0 93 30 06 sts 0x0630, r26 ; 0x800630 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0xd> 26f98: b0 93 31 06 sts 0x0631, r27 ; 0x800631 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0xe> thermal_model::log_isr(); #endif #endif // PID regulation if (pid_tuning_finished) 26f9c: 80 91 3e 02 lds r24, 0x023E ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.458> 26fa0: 88 23 and r24, r24 26fa2: 91 f0 breq .+36 ; 0x26fc8 temp_mgr_pid(); } 26fa4: df 91 pop r29 26fa6: cf 91 pop r28 26fa8: 1f 91 pop r17 26faa: 0f 91 pop r16 26fac: ff 90 pop r15 26fae: ef 90 pop r14 26fb0: df 90 pop r13 26fb2: cf 90 pop r12 26fb4: af 90 pop r10 26fb6: 7f 90 pop r7 26fb8: 6f 90 pop r6 26fba: 5f 90 pop r5 26fbc: 4f 90 pop r4 #endif #endif // PID regulation if (pid_tuning_finished) temp_mgr_pid(); 26fbe: 0d 94 a6 10 jmp 0x2214c ; 0x2214c // *** end of 'common' part #ifdef AMBIENT_THERMISTOR } else { // ambient temperature is standard check_min_temp_heater0(); 26fc2: 0f 94 7e 2f call 0x25efc ; 0x25efc 26fc6: 8e ce rjmp .-740 ; 0x26ce4 #endif // PID regulation if (pid_tuning_finished) temp_mgr_pid(); } 26fc8: df 91 pop r29 26fca: cf 91 pop r28 26fcc: 1f 91 pop r17 26fce: 0f 91 pop r16 26fd0: ff 90 pop r15 26fd2: ef 90 pop r14 26fd4: df 90 pop r13 26fd6: cf 90 pop r12 26fd8: af 90 pop r10 26fda: 7f 90 pop r7 26fdc: 6f 90 pop r6 26fde: 5f 90 pop r5 26fe0: 4f 90 pop r4 26fe2: 08 95 ret 00026fe4 <__vector_47>: ISR(TIMERx_COMPA_vect) { 26fe4: 1f 92 push r1 26fe6: 0f 92 push r0 26fe8: 0f b6 in r0, 0x3f ; 63 26fea: 0f 92 push r0 26fec: 11 24 eor r1, r1 26fee: 0b b6 in r0, 0x3b ; 59 26ff0: 0f 92 push r0 26ff2: 2f 93 push r18 26ff4: 3f 93 push r19 26ff6: 4f 93 push r20 26ff8: 5f 93 push r21 26ffa: 6f 93 push r22 26ffc: 7f 93 push r23 26ffe: 8f 93 push r24 27000: 9f 93 push r25 27002: af 93 push r26 27004: bf 93 push r27 27006: ef 93 push r30 27008: ff 93 push r31 // immediately schedule a new conversion if(adc_values_ready != true) return; 2700a: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16adc_values_ready.lto_priv.457> 2700e: 88 23 and r24, r24 27010: 91 f0 breq .+36 ; 0x27036 <__vector_47+0x52> adc_values_ready = false; 27012: 10 92 1b 05 sts 0x051B, r1 ; 0x80051b <_ZL16adc_values_ready.lto_priv.457> adc_start_cycle(); 27016: 0e 94 ef 8d call 0x11bde ; 0x11bde // run temperature management with interrupts enabled to reduce latency DISABLE_TEMP_MGR_INTERRUPT(); 2701a: 80 91 73 00 lds r24, 0x0073 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> 2701e: 8d 7f andi r24, 0xFD ; 253 27020: 80 93 73 00 sts 0x0073, r24 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> #if !defined(__DOXYGEN__) /* Internal helper functions. */ static __inline__ uint8_t __iSeiRetVal(void) { sei(); 27024: 78 94 sei NONATOMIC_BLOCK(NONATOMIC_FORCEOFF) { temp_mgr_isr(); 27026: 0f 94 8b 35 call 0x26b16 ; 0x26b16 (void)__s; } static __inline__ void __iCliParam(const uint8_t *__s) { cli(); 2702a: f8 94 cli } ENABLE_TEMP_MGR_INTERRUPT(); 2702c: 80 91 73 00 lds r24, 0x0073 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> 27030: 82 60 ori r24, 0x02 ; 2 27032: 80 93 73 00 sts 0x0073, r24 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> } 27036: ff 91 pop r31 27038: ef 91 pop r30 2703a: bf 91 pop r27 2703c: af 91 pop r26 2703e: 9f 91 pop r25 27040: 8f 91 pop r24 27042: 7f 91 pop r23 27044: 6f 91 pop r22 27046: 5f 91 pop r21 27048: 4f 91 pop r20 2704a: 3f 91 pop r19 2704c: 2f 91 pop r18 2704e: 0f 90 pop r0 27050: 0b be out 0x3b, r0 ; 59 27052: 0f 90 pop r0 27054: 0f be out 0x3f, r0 ; 63 27056: 0f 90 pop r0 27058: 1f 90 pop r1 2705a: 18 95 reti 0002705c : } void handle_temp_error(); void manage_heater() { 2705c: 6f 92 push r6 2705e: 7f 92 push r7 27060: 8f 92 push r8 27062: 9f 92 push r9 27064: af 92 push r10 27066: bf 92 push r11 27068: cf 92 push r12 2706a: df 92 push r13 2706c: ef 92 push r14 2706e: ff 92 push r15 27070: 0f 93 push r16 27072: 1f 93 push r17 27074: cf 93 push r28 27076: df 93 push r29 27078: 1f 92 push r1 2707a: cd b7 in r28, 0x3d ; 61 2707c: de b7 in r29, 0x3e ; 62 #ifdef WATCHDOG wdt_reset(); 2707e: 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) 27080: 80 91 01 06 lds r24, 0x0601 ; 0x800601 27084: 88 23 and r24, r24 27086: 09 f4 brne .+2 ; 0x2708a 27088: bb c0 rjmp .+374 ; 0x27200 return; // syncronize temperatures with isr updateTemperatures(); 2708a: 0f 94 4f 32 call 0x2649e ; 0x2649e #ifdef THERMAL_MODEL // handle model warnings first, so not to override the error handler if(thermal_model::warning_state.warning) 2708e: 80 91 38 06 lds r24, 0x0638 ; 0x800638 27092: 80 ff sbrs r24, 0 27094: 51 c0 rjmp .+162 ; 0x27138 } static void handle_warning() { // update values float warn = data.warn; 27096: 10 91 33 13 lds r17, 0x1333 ; 0x801333 <_ZN13thermal_modelL4dataE.lto_priv.400+0x84> 2709a: 00 91 34 13 lds r16, 0x1334 ; 0x801334 <_ZN13thermal_modelL4dataE.lto_priv.400+0x85> 2709e: b0 90 35 13 lds r11, 0x1335 ; 0x801335 <_ZN13thermal_modelL4dataE.lto_priv.400+0x86> 270a2: a0 90 36 13 lds r10, 0x1336 ; 0x801336 <_ZN13thermal_modelL4dataE.lto_priv.400+0x87> float dT_err; { TempMgrGuard temp_mgr_guard; 270a6: ce 01 movw r24, r28 270a8: 01 96 adiw r24, 0x01 ; 1 270aa: 0f 94 70 31 call 0x262e0 ; 0x262e0 dT_err = warning_state.dT_err; 270ae: c0 90 34 06 lds r12, 0x0634 ; 0x800634 270b2: d0 90 35 06 lds r13, 0x0635 ; 0x800635 270b6: e0 90 36 06 lds r14, 0x0636 ; 0x800636 270ba: f0 90 37 06 lds r15, 0x0637 ; 0x800637 { // update values float warn = data.warn; float dT_err; { TempMgrGuard temp_mgr_guard; 270be: ce 01 movw r24, r28 270c0: 01 96 adiw r24, 0x01 ; 1 270c2: 0f 94 63 31 call 0x262c6 ; 0x262c6 dT_err = warning_state.dT_err; } dT_err /= TEMP_MGR_INTV; // per-sample => K/s printf_P(PSTR("TM: error |%f|>%f\n"), (double)dT_err, (double)warn); 270c6: af 92 push r10 270c8: bf 92 push r11 270ca: 0f 93 push r16 270cc: 1f 93 push r17 float dT_err; { TempMgrGuard temp_mgr_guard; dT_err = warning_state.dT_err; } dT_err /= TEMP_MGR_INTV; // per-sample => K/s 270ce: 21 e7 ldi r18, 0x71 ; 113 270d0: 3d e3 ldi r19, 0x3D ; 61 270d2: 4a e8 ldi r20, 0x8A ; 138 270d4: 5e e3 ldi r21, 0x3E ; 62 270d6: c7 01 movw r24, r14 270d8: b6 01 movw r22, r12 270da: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> printf_P(PSTR("TM: error |%f|>%f\n"), (double)dT_err, (double)warn); 270de: 9f 93 push r25 270e0: 8f 93 push r24 270e2: 7f 93 push r23 270e4: 6f 93 push r22 270e6: 8c e3 ldi r24, 0x3C ; 60 270e8: 9c e9 ldi r25, 0x9C ; 156 270ea: 9f 93 push r25 270ec: 8f 93 push r24 270ee: 0f 94 99 da call 0x3b532 ; 0x3b532 static bool first = true; if(warning_state.assert) { 270f2: 90 91 38 06 lds r25, 0x0638 ; 0x800638 270f6: 0f b6 in r0, 0x3f ; 63 270f8: f8 94 cli 270fa: de bf out 0x3e, r29 ; 62 270fc: 0f be out 0x3f, r0 ; 63 270fe: cd bf out 0x3d, r28 ; 61 27100: 80 91 3d 02 lds r24, 0x023D ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.455> 27104: 91 ff sbrs r25, 1 27106: 93 c0 rjmp .+294 ; 0x2722e if (first) { 27108: 90 91 a3 02 lds r25, 0x02A3 ; 0x8002a3 2710c: 99 23 and r25, r25 2710e: 09 f4 brne .+2 ; 0x27112 27110: 87 c0 rjmp .+270 ; 0x27220 if(warn_beep) { 27112: 88 23 and r24, r24 27114: 79 f0 breq .+30 ; 0x27134 lcd_setalertstatuspgm(_T(MSG_THERMAL_ANOMALY), LCD_STATUS_INFO); 27116: 88 ee ldi r24, 0xE8 ; 232 27118: 9d e4 ldi r25, 0x4D ; 77 2711a: 0e 94 c4 72 call 0xe588 ; 0xe588 2711e: 61 e0 ldi r22, 0x01 ; 1 27120: 0e 94 f8 f0 call 0x1e1f0 ; 0x1e1f0 WRITE(BEEPER, HIGH); 27124: 9f b7 in r25, 0x3f ; 63 27126: f8 94 cli 27128: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2712c: 84 60 ori r24, 0x04 ; 4 2712e: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 27132: 9f bf out 0x3f, r25 ; 63 } first = false; 27134: 10 92 a3 02 sts 0x02A3, r1 ; 0x8002a3 if(thermal_model::warning_state.warning) thermal_model::handle_warning(); #endif // handle temperature errors if(temp_error_state.v) 27138: 80 91 1a 05 lds r24, 0x051A ; 0x80051a <_ZL16temp_error_state.lto_priv.454> 2713c: 88 23 and r24, r24 2713e: 89 f0 breq .+34 ; 0x27162 #endif void handle_temp_error() { // relay to the original handler switch((TempErrorType)temp_error_state.type) { 27140: 80 91 1a 05 lds r24, 0x051A ; 0x80051a <_ZL16temp_error_state.lto_priv.454> 27144: 82 95 swap r24 27146: 86 95 lsr r24 27148: 87 70 andi r24, 0x07 ; 7 2714a: 84 30 cpi r24, 0x04 ; 4 2714c: 08 f0 brcs .+2 ; 0x27150 2714e: 82 c0 rjmp .+260 ; 0x27254 27150: 82 30 cpi r24, 0x02 ; 2 27152: 08 f0 brcs .+2 ; 0x27156 27154: 1d c1 rjmp .+570 ; 0x27390 27156: 88 23 and r24, r24 27158: 09 f4 brne .+2 ; 0x2715c 2715a: f4 c0 rjmp .+488 ; 0x27344 2715c: 81 30 cpi r24, 0x01 ; 1 2715e: 09 f4 brne .+2 ; 0x27162 27160: 94 c0 rjmp .+296 ; 0x2728a // handle temperature errors if(temp_error_state.v) handle_temp_error(); // periodically check fans checkFans(); 27162: 0e 94 1a 80 call 0x10034 ; 0x10034 } #ifdef THERMAL_MODEL_DEBUG static void log_usr() { if(!log_buf.enabled) return; 27166: 80 91 33 06 lds r24, 0x0633 ; 0x800633 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x10> 2716a: 88 23 and r24, r24 2716c: 09 f4 brne .+2 ; 0x27170 2716e: 48 c0 rjmp .+144 ; 0x27200 uint8_t counter = log_buf.entry.counter; 27170: 80 91 28 06 lds r24, 0x0628 ; 0x800628 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x5> if (counter == log_buf.serial) return; 27174: 70 90 32 06 lds r7, 0x0632 ; 0x800632 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0xf> 27178: 87 15 cp r24, r7 2717a: 09 f4 brne .+2 ; 0x2717e 2717c: 41 c0 rjmp .+130 ; 0x27200 // avoid strict-aliasing warnings union { float cur_temp; uint32_t cur_temp_b; }; union { float cur_amb; uint32_t cur_amb_b; }; { TempMgrGuard temp_mgr_guard; 2717e: ce 01 movw r24, r28 27180: 01 96 adiw r24, 0x01 ; 1 27182: 0f 94 70 31 call 0x262e0 ; 0x262e0 delta_ms = log_buf.entry.delta_ms; 27186: 00 91 27 06 lds r16, 0x0627 ; 0x800627 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x4> counter = log_buf.entry.counter; 2718a: 10 91 28 06 lds r17, 0x0628 ; 0x800628 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x5> cur_pwm = log_buf.entry.cur_pwm; 2718e: 60 90 29 06 lds r6, 0x0629 ; 0x800629 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x6> cur_temp = log_buf.entry.cur_temp; 27192: c0 90 2a 06 lds r12, 0x062A ; 0x80062a <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x7> 27196: d0 90 2b 06 lds r13, 0x062B ; 0x80062b <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x8> 2719a: e0 90 2c 06 lds r14, 0x062C ; 0x80062c <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x9> 2719e: f0 90 2d 06 lds r15, 0x062D ; 0x80062d <_ZN13thermal_modelL7log_bufE.lto_priv.537+0xa> cur_amb = log_buf.entry.cur_amb; 271a2: 80 90 2e 06 lds r8, 0x062E ; 0x80062e <_ZN13thermal_modelL7log_bufE.lto_priv.537+0xb> 271a6: 90 90 2f 06 lds r9, 0x062F ; 0x80062f <_ZN13thermal_modelL7log_bufE.lto_priv.537+0xc> 271aa: a0 90 30 06 lds r10, 0x0630 ; 0x800630 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0xd> 271ae: b0 90 31 06 lds r11, 0x0631 ; 0x800631 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0xe> // avoid strict-aliasing warnings union { float cur_temp; uint32_t cur_temp_b; }; union { float cur_amb; uint32_t cur_amb_b; }; { TempMgrGuard temp_mgr_guard; 271b2: ce 01 movw r24, r28 271b4: 01 96 adiw r24, 0x01 ; 1 271b6: 0f 94 63 31 call 0x262c6 ; 0x262c6 cur_temp = log_buf.entry.cur_temp; cur_amb = log_buf.entry.cur_amb; } uint8_t d = counter - log_buf.serial; log_buf.serial = counter; 271ba: 10 93 32 06 sts 0x0632, r17 ; 0x800632 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0xf> printf_P(PSTR("TML %d %d %x %lx %lx\n"), (unsigned)d - 1, (int)delta_ms + 1, 271be: bf 92 push r11 271c0: af 92 push r10 271c2: 9f 92 push r9 271c4: 8f 92 push r8 271c6: ff 92 push r15 271c8: ef 92 push r14 271ca: df 92 push r13 271cc: cf 92 push r12 271ce: 1f 92 push r1 271d0: 6f 92 push r6 271d2: 80 2f mov r24, r16 271d4: 00 0f add r16, r16 271d6: 99 0b sbc r25, r25 271d8: 01 96 adiw r24, 0x01 ; 1 271da: 9f 93 push r25 271dc: 8f 93 push r24 cur_pwm = log_buf.entry.cur_pwm; cur_temp = log_buf.entry.cur_temp; cur_amb = log_buf.entry.cur_amb; } uint8_t d = counter - log_buf.serial; 271de: 81 2f mov r24, r17 271e0: 87 19 sub r24, r7 log_buf.serial = counter; printf_P(PSTR("TML %d %d %x %lx %lx\n"), (unsigned)d - 1, (int)delta_ms + 1, 271e2: 81 50 subi r24, 0x01 ; 1 271e4: 99 0b sbc r25, r25 271e6: 9f 93 push r25 271e8: 8f 93 push r24 271ea: 8f eb ldi r24, 0xBF ; 191 271ec: 9b e9 ldi r25, 0x9B ; 155 271ee: 9f 93 push r25 271f0: 8f 93 push r24 271f2: 0f 94 99 da call 0x3b532 ; 0x3b532 271f6: 0f b6 in r0, 0x3f ; 63 271f8: f8 94 cli 271fa: de bf out 0x3e, r29 ; 62 271fc: 0f be out 0x3f, r0 ; 63 271fe: cd bf out 0x3d, r28 ; 61 checkFans(); #ifdef THERMAL_MODEL_DEBUG thermal_model::log_usr(); #endif } 27200: 0f 90 pop r0 27202: df 91 pop r29 27204: cf 91 pop r28 27206: 1f 91 pop r17 27208: 0f 91 pop r16 2720a: ff 90 pop r15 2720c: ef 90 pop r14 2720e: df 90 pop r13 27210: cf 90 pop r12 27212: bf 90 pop r11 27214: af 90 pop r10 27216: 9f 90 pop r9 27218: 8f 90 pop r8 2721a: 7f 90 pop r7 2721c: 6f 90 pop r6 2721e: 08 95 ret lcd_setalertstatuspgm(_T(MSG_THERMAL_ANOMALY), LCD_STATUS_INFO); WRITE(BEEPER, HIGH); } first = false; } else { if(warn_beep) TOGGLE(BEEPER); 27220: 88 23 and r24, r24 27222: 09 f4 brne .+2 ; 0x27226 27224: 89 cf rjmp .-238 ; 0x27138 27226: 84 e0 ldi r24, 0x04 ; 4 27228: 80 93 00 01 sts 0x0100, r24 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 2722c: 85 cf rjmp .-246 ; 0x27138 } } else { // warning cleared, reset state warning_state.warning = false; 2722e: 90 91 38 06 lds r25, 0x0638 ; 0x800638 27232: 9e 7f andi r25, 0xFE ; 254 27234: 90 93 38 06 sts 0x0638, r25 ; 0x800638 if(warn_beep) WRITE(BEEPER, LOW); 27238: 88 23 and r24, r24 2723a: 41 f0 breq .+16 ; 0x2724c 2723c: 9f b7 in r25, 0x3f ; 63 2723e: f8 94 cli 27240: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 27244: 8b 7f andi r24, 0xFB ; 251 27246: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2724a: 9f bf out 0x3f, r25 ; 63 first = true; 2724c: 81 e0 ldi r24, 0x01 ; 1 2724e: 80 93 a3 02 sts 0x02A3, r24 ; 0x8002a3 27252: 72 cf rjmp .-284 ; 0x27138 #endif void handle_temp_error() { // relay to the original handler switch((TempErrorType)temp_error_state.type) { 27254: 84 30 cpi r24, 0x04 ; 4 27256: 09 f0 breq .+2 ; 0x2725a 27258: 84 cf rjmp .-248 ; 0x27162 #endif } break; #ifdef THERMAL_MODEL case TempErrorType::model: if(temp_error_state.assert) { 2725a: 80 91 1a 05 lds r24, 0x051A ; 0x80051a <_ZL16temp_error_state.lto_priv.454> 2725e: 81 ff sbrs r24, 1 27260: b4 c0 rjmp .+360 ; 0x273ca if(IsStopped() == false) { 27262: 80 91 10 05 lds r24, 0x0510 ; 0x800510 27266: 81 11 cpse r24, r1 27268: 04 c0 rjmp .+8 ; 0x27272 SERIAL_ECHOLNPGM("TM: error triggered!"); 2726a: 87 e2 ldi r24, 0x27 ; 39 2726c: 9c e9 ldi r25, 0x9C ; 156 2726e: 0e 94 93 79 call 0xf326 ; 0xf326 } ThermalStop(true); 27272: 81 e0 ldi r24, 0x01 ; 1 27274: 0e 94 c4 79 call 0xf388 ; 0xf388 WRITE(BEEPER, HIGH); 27278: 9f b7 in r25, 0x3f ; 63 2727a: f8 94 cli 2727c: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 27280: 84 60 ori r24, 0x04 ; 4 27282: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 27286: 9f bf out 0x3f, r25 ; 63 27288: 6c cf rjmp .-296 ; 0x27162 void handle_temp_error() { // relay to the original handler switch((TempErrorType)temp_error_state.type) { case TempErrorType::min: switch((TempErrorSource)temp_error_state.source) { 2728a: 80 91 1a 05 lds r24, 0x051A ; 0x80051a <_ZL16temp_error_state.lto_priv.454> 2728e: 86 95 lsr r24 27290: 86 95 lsr r24 27292: 83 70 andi r24, 0x03 ; 3 27294: 81 30 cpi r24, 0x01 ; 1 27296: d9 f1 breq .+118 ; 0x2730e 27298: 58 f0 brcs .+22 ; 0x272b0 2729a: 82 30 cpi r24, 0x02 ; 2 2729c: 09 f0 breq .+2 ; 0x272a0 2729e: 61 cf rjmp .-318 ; 0x27162 } ThermalStop(); } static void ambient_min_temp_error(void) { if(IsStopped() == false) { 272a0: 80 91 10 05 lds r24, 0x0510 ; 0x800510 272a4: 81 11 cpse r24, r1 272a6: 14 c0 rjmp .+40 ; 0x272d0 temp_error_messagepgm(PSTR("MINTEMP AMB")); 272a8: 61 e0 ldi r22, 0x01 ; 1 272aa: 89 ee ldi r24, 0xE9 ; 233 272ac: 9b e9 ldi r25, 0x9B ; 155 272ae: 0e c0 rjmp .+28 ; 0x272cc // relay to the original handler switch((TempErrorType)temp_error_state.type) { case TempErrorType::min: switch((TempErrorSource)temp_error_state.source) { case TempErrorSource::hotend: if(temp_error_state.assert) { 272b0: 80 91 1a 05 lds r24, 0x051A ; 0x80051a <_ZL16temp_error_state.lto_priv.454> 272b4: 81 ff sbrs r24, 1 272b6: 10 c0 rjmp .+32 ; 0x272d8 min_temp_error(temp_error_state.index); 272b8: 60 91 1a 05 lds r22, 0x051A ; 0x80051a <_ZL16temp_error_state.lto_priv.454> 272bc: 62 95 swap r22 272be: 61 70 andi r22, 0x01 ; 1 #endif } static void min_temp_error(uint8_t e) { static const char err[] PROGMEM = "MINTEMP"; if(IsStopped() == false) { 272c0: 80 91 10 05 lds r24, 0x0510 ; 0x800510 272c4: 81 11 cpse r24, r1 272c6: 04 c0 rjmp .+8 ; 0x272d0 temp_error_messagepgm(err, e); 272c8: 85 ed ldi r24, 0xD5 ; 213 272ca: 9b e9 ldi r25, 0x9B ; 155 272cc: 0f 94 d3 2b call 0x257a6 ; 0x257a6 prusa_statistics(92); } ThermalStop(); 272d0: 80 e0 ldi r24, 0x00 ; 0 272d2: 0e 94 c4 79 call 0xf388 ; 0xf388 272d6: 45 cf rjmp .-374 ; 0x27162 // 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); 272d8: 60 91 a2 04 lds r22, 0x04A2 ; 0x8004a2 <_ZL8minttemp.lto_priv.461> 272dc: 70 91 a3 04 lds r23, 0x04A3 ; 0x8004a3 <_ZL8minttemp.lto_priv.461+0x1> 272e0: 6b 5f subi r22, 0xFB ; 251 272e2: 7f 4f sbci r23, 0xFF ; 255 272e4: 07 2e mov r0, r23 272e6: 00 0c add r0, r0 272e8: 88 0b sbc r24, r24 272ea: 99 0b sbc r25, r25 272ec: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 272f0: 8b 01 movw r16, r22 272f2: 9c 01 movw r18, r24 272f4: 40 91 af 0d lds r20, 0x0DAF ; 0x800daf 272f8: 50 91 b0 0d lds r21, 0x0DB0 ; 0x800db0 272fc: 60 91 b1 0d lds r22, 0x0DB1 ; 0x800db1 27300: 70 91 b2 0d lds r23, 0x0DB2 ; 0x800db2 27304: 8f e9 ldi r24, 0x9F ; 159 27306: 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); 27308: 0f 94 d7 1e call 0x23dae ; 0x23dae 2730c: 2a cf rjmp .-428 ; 0x27162 // 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) { 2730e: 80 91 1a 05 lds r24, 0x051A ; 0x80051a <_ZL16temp_error_state.lto_priv.454> 27312: 81 ff sbrs r24, 1 27314: 08 c0 rjmp .+16 ; 0x27326 ThermalStop(); } static void bed_min_temp_error(void) { static const char err[] PROGMEM = "MINTEMP BED"; if(IsStopped() == false) { 27316: 80 91 10 05 lds r24, 0x0510 ; 0x800510 2731a: 81 11 cpse r24, r1 2731c: d9 cf rjmp .-78 ; 0x272d0 temp_error_messagepgm(err); 2731e: 61 e0 ldi r22, 0x01 ; 1 27320: 8d ed ldi r24, 0xDD ; 221 27322: 9b e9 ldi r25, 0x9B ; 155 27324: d3 cf rjmp .-90 ; 0x272cc 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); 27326: 40 91 ed 04 lds r20, 0x04ED ; 0x8004ed 2732a: 50 91 ee 04 lds r21, 0x04EE ; 0x8004ee 2732e: 60 91 ef 04 lds r22, 0x04EF ; 0x8004ef 27332: 70 91 f0 04 lds r23, 0x04F0 ; 0x8004f0 27336: 00 e0 ldi r16, 0x00 ; 0 27338: 10 e0 ldi r17, 0x00 ; 0 2733a: 20 e7 ldi r18, 0x70 ; 112 2733c: 31 e4 ldi r19, 0x41 ; 65 2733e: 8b e9 ldi r24, 0x9B ; 155 27340: 92 e0 ldi r25, 0x02 ; 2 27342: e2 cf rjmp .-60 ; 0x27308 break; #endif } break; case TempErrorType::max: switch((TempErrorSource)temp_error_state.source) { 27344: 80 91 1a 05 lds r24, 0x051A ; 0x80051a <_ZL16temp_error_state.lto_priv.454> 27348: 86 95 lsr r24 2734a: 86 95 lsr r24 2734c: 83 70 andi r24, 0x03 ; 3 2734e: 81 30 cpi r24, 0x01 ; 1 27350: b9 f0 breq .+46 ; 0x27380 27352: 58 f0 brcs .+22 ; 0x2736a 27354: 82 30 cpi r24, 0x02 ; 2 27356: 09 f0 breq .+2 ; 0x2735a 27358: 04 cf rjmp .-504 ; 0x27162 } #ifdef AMBIENT_THERMISTOR static void ambient_max_temp_error(void) { if(IsStopped() == false) { 2735a: 80 91 10 05 lds r24, 0x0510 ; 0x800510 2735e: 81 11 cpse r24, r1 27360: b7 cf rjmp .-146 ; 0x272d0 temp_error_messagepgm(PSTR("MAXTEMP AMB")); 27362: 61 e0 ldi r22, 0x01 ; 1 27364: 89 e0 ldi r24, 0x09 ; 9 27366: 9c e9 ldi r25, 0x9C ; 156 27368: b1 cf rjmp .-158 ; 0x272cc } break; case TempErrorType::max: switch((TempErrorSource)temp_error_state.source) { case TempErrorSource::hotend: max_temp_error(temp_error_state.index); 2736a: 60 91 1a 05 lds r22, 0x051A ; 0x80051a <_ZL16temp_error_state.lto_priv.454> 2736e: 62 95 swap r22 27370: 61 70 andi r22, 0x01 ; 1 SERIAL_ERRORLNPGM(" triggered!"); } static void max_temp_error(uint8_t e) { if(IsStopped() == false) { 27372: 80 91 10 05 lds r24, 0x0510 ; 0x800510 27376: 81 11 cpse r24, r1 27378: ab cf rjmp .-170 ; 0x272d0 temp_error_messagepgm(PSTR("MAXTEMP"), e); 2737a: 85 ef ldi r24, 0xF5 ; 245 2737c: 9b e9 ldi r25, 0x9B ; 155 2737e: a6 cf rjmp .-180 ; 0x272cc } ThermalStop(); } static void bed_max_temp_error(void) { if(IsStopped() == false) { 27380: 80 91 10 05 lds r24, 0x0510 ; 0x800510 27384: 81 11 cpse r24, r1 27386: a4 cf rjmp .-184 ; 0x272d0 temp_error_messagepgm(PSTR("MAXTEMP BED")); 27388: 61 e0 ldi r22, 0x01 ; 1 2738a: 8d ef ldi r24, 0xFD ; 253 2738c: 9b e9 ldi r25, 0x9B ; 155 2738e: 9e cf rjmp .-196 ; 0x272cc #endif } break; case TempErrorType::preheat: case TempErrorType::runaway: switch((TempErrorSource)temp_error_state.source) { 27390: 80 91 1a 05 lds r24, 0x051A ; 0x80051a <_ZL16temp_error_state.lto_priv.454> 27394: 86 95 lsr r24 27396: 86 95 lsr r24 27398: 83 70 andi r24, 0x03 ; 3 2739a: 82 30 cpi r24, 0x02 ; 2 2739c: 08 f0 brcs .+2 ; 0x273a0 2739e: e1 ce rjmp .-574 ; 0x27162 case TempErrorSource::hotend: case TempErrorSource::bed: temp_runaway_stop( ((TempErrorType)temp_error_state.type == TempErrorType::preheat), ((TempErrorSource)temp_error_state.source == TempErrorSource::bed)); 273a0: 80 91 1a 05 lds r24, 0x051A ; 0x80051a <_ZL16temp_error_state.lto_priv.454> 273a4: 86 95 lsr r24 273a6: 86 95 lsr r24 273a8: 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), 273aa: 90 91 1a 05 lds r25, 0x051A ; 0x80051a <_ZL16temp_error_state.lto_priv.454> 273ae: 92 95 swap r25 273b0: 96 95 lsr r25 273b2: 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( 273b4: 61 e0 ldi r22, 0x01 ; 1 273b6: 81 30 cpi r24, 0x01 ; 1 273b8: 09 f0 breq .+2 ; 0x273bc 273ba: 60 e0 ldi r22, 0x00 ; 0 273bc: 81 e0 ldi r24, 0x01 ; 1 273be: 92 30 cpi r25, 0x02 ; 2 273c0: 09 f0 breq .+2 ; 0x273c4 273c2: 80 e0 ldi r24, 0x00 ; 0 273c4: 0f 94 10 1f call 0x23e20 ; 0x23e20 273c8: cc ce rjmp .-616 ; 0x27162 SERIAL_ECHOLNPGM("TM: error triggered!"); } ThermalStop(true); WRITE(BEEPER, HIGH); } else { temp_error_state.v = 0; 273ca: 10 92 1a 05 sts 0x051A, r1 ; 0x80051a <_ZL16temp_error_state.lto_priv.454> WRITE(BEEPER, LOW); 273ce: 9f b7 in r25, 0x3f ; 63 273d0: f8 94 cli 273d2: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 273d6: 8b 7f andi r24, 0xFB ; 251 273d8: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 273dc: 9f bf out 0x3f, r25 ; 63 // hotend error was transitory and disappeared, re-enable bed if (!target_temperature_bed) 273de: 80 91 71 06 lds r24, 0x0671 ; 0x800671 273e2: 90 91 72 06 lds r25, 0x0672 ; 0x800672 273e6: 89 2b or r24, r25 273e8: 39 f4 brne .+14 ; 0x273f8 target_temperature_bed = saved_bed_temperature; 273ea: 80 91 ad 05 lds r24, 0x05AD ; 0x8005ad 273ee: 90 e0 ldi r25, 0x00 ; 0 273f0: 90 93 72 06 sts 0x0672, r25 ; 0x800672 273f4: 80 93 71 06 sts 0x0671, r24 ; 0x800671 SERIAL_ECHOLNPGM("TM: error cleared"); 273f8: 85 e1 ldi r24, 0x15 ; 21 273fa: 9c e9 ldi r25, 0x9C ; 156 273fc: 0e 94 93 79 call 0xf326 ; 0xf326 27400: b0 ce rjmp .-672 ; 0x27162 00027402 : } bool lcd_wait_for_click_delay(uint16_t nDelay) // nDelay :: timeout [s] (0 ~ no timeout) // true ~ clicked, false ~ delayed { 27402: 4f 92 push r4 27404: 5f 92 push r5 27406: 6f 92 push r6 27408: 7f 92 push r7 2740a: 8f 92 push r8 2740c: 9f 92 push r9 2740e: af 92 push r10 27410: bf 92 push r11 27412: cf 92 push r12 27414: df 92 push r13 27416: ef 92 push r14 27418: ff 92 push r15 2741a: 6c 01 movw r12, r24 bool bDelayed; long nTime0 = _millis()/1000; 2741c: 0f 94 22 29 call 0x25244 ; 0x25244 27420: 28 ee ldi r18, 0xE8 ; 232 27422: 33 e0 ldi r19, 0x03 ; 3 27424: 40 e0 ldi r20, 0x00 ; 0 27426: 50 e0 ldi r21, 0x00 ; 0 27428: 0f 94 4a dc call 0x3b894 ; 0x3b894 <__udivmodsi4> 2742c: 29 01 movw r4, r18 2742e: 3a 01 movw r6, r20 lcd_consume_click(); 27430: 0e 94 10 71 call 0xe220 ; 0xe220 KEEPALIVE_STATE(PAUSED_FOR_USER); 27434: 84 e0 ldi r24, 0x04 ; 4 27436: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be for (;;) { manage_heater(); manage_inactivity(true); bDelayed = ((_millis()/1000-nTime0) > nDelay); 2743a: f1 2c mov r15, r1 2743c: e1 2c mov r14, r1 bool bDelayed; long nTime0 = _millis()/1000; lcd_consume_click(); KEEPALIVE_STATE(PAUSED_FOR_USER); for (;;) { manage_heater(); 2743e: 0f 94 2e 38 call 0x2705c ; 0x2705c manage_inactivity(true); 27442: 81 e0 ldi r24, 0x01 ; 1 27444: 0e 94 c7 8a call 0x1158e ; 0x1158e bDelayed = ((_millis()/1000-nTime0) > nDelay); 27448: 0f 94 22 29 call 0x25244 ; 0x25244 2744c: 28 ee ldi r18, 0xE8 ; 232 2744e: 33 e0 ldi r19, 0x03 ; 3 27450: 40 e0 ldi r20, 0x00 ; 0 27452: 50 e0 ldi r21, 0x00 ; 0 27454: 0f 94 4a dc call 0x3b894 ; 0x3b894 <__udivmodsi4> 27458: 49 01 movw r8, r18 2745a: 5a 01 movw r10, r20 2745c: 84 18 sub r8, r4 2745e: 95 08 sbc r9, r5 27460: a6 08 sbc r10, r6 27462: b7 08 sbc r11, r7 bDelayed = (bDelayed && (nDelay != 0)); // 0 ~ no timeout, always waiting for click if (lcd_clicked() || bDelayed) { 27464: 0e 94 15 71 call 0xe22a ; 0xe22a 27468: 81 11 cpse r24, r1 2746a: 07 c0 rjmp .+14 ; 0x2747a 2746c: c8 14 cp r12, r8 2746e: d9 04 cpc r13, r9 27470: ea 04 cpc r14, r10 27472: fb 04 cpc r15, r11 27474: 20 f7 brcc .-56 ; 0x2743e 27476: 81 e0 ldi r24, 0x01 ; 1 27478: 07 c0 rjmp .+14 ; 0x27488 KEEPALIVE_STATE(PAUSED_FOR_USER); for (;;) { manage_heater(); manage_inactivity(true); bDelayed = ((_millis()/1000-nTime0) > nDelay); bDelayed = (bDelayed && (nDelay != 0)); // 0 ~ no timeout, always waiting for click 2747a: 81 e0 ldi r24, 0x01 ; 1 2747c: c8 14 cp r12, r8 2747e: d9 04 cpc r13, r9 27480: ea 04 cpc r14, r10 27482: fb 04 cpc r15, r11 27484: 08 f0 brcs .+2 ; 0x27488 27486: 80 e0 ldi r24, 0x00 ; 0 if (lcd_clicked() || bDelayed) { KEEPALIVE_STATE(IN_HANDLER); 27488: 92 e0 ldi r25, 0x02 ; 2 2748a: 90 93 be 02 sts 0x02BE, r25 ; 0x8002be return(!bDelayed); } } } 2748e: 91 e0 ldi r25, 0x01 ; 1 27490: 89 27 eor r24, r25 27492: ff 90 pop r15 27494: ef 90 pop r14 27496: df 90 pop r13 27498: cf 90 pop r12 2749a: bf 90 pop r11 2749c: af 90 pop r10 2749e: 9f 90 pop r9 274a0: 8f 90 pop r8 274a2: 7f 90 pop r7 274a4: 6f 90 pop r6 274a6: 5f 90 pop r5 274a8: 4f 90 pop r4 274aa: 08 95 ret 000274ac : #endif } static void waiting_handler() { manage_heater(); 274ac: 0f 94 2e 38 call 0x2705c ; 0x2705c host_keepalive(); 274b0: 0e 94 bf 7f call 0xff7e ; 0xff7e host_autoreport(); 274b4: 0e 94 70 79 call 0xf2e0 ; 0xf2e0 checkFans(); 274b8: 0e 94 1a 80 call 0x10034 ; 0x10034 lcd_update(0); 274bc: 80 e0 ldi r24, 0x00 ; 0 274be: 0c 94 bf 6e jmp 0xdd7e ; 0xdd7e 000274c2 : } } static void __attribute__((noinline)) wait_temp() { while(current_temperature[0] < (target_temperature[0] - TEMP_HYSTERESIS)) { 274c2: 60 91 b5 0d lds r22, 0x0DB5 ; 0x800db5 274c6: 70 91 b6 0d lds r23, 0x0DB6 ; 0x800db6 274ca: 65 50 subi r22, 0x05 ; 5 274cc: 71 09 sbc r23, r1 274ce: 07 2e mov r0, r23 274d0: 00 0c add r0, r0 274d2: 88 0b sbc r24, r24 274d4: 99 0b sbc r25, r25 274d6: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 274da: 9b 01 movw r18, r22 274dc: ac 01 movw r20, r24 274de: 60 91 af 0d lds r22, 0x0DAF ; 0x800daf 274e2: 70 91 b0 0d lds r23, 0x0DB0 ; 0x800db0 274e6: 80 91 b1 0d lds r24, 0x0DB1 ; 0x800db1 274ea: 90 91 b2 0d lds r25, 0x0DB2 ; 0x800db2 274ee: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 274f2: 87 ff sbrs r24, 7 274f4: 07 c0 rjmp .+14 ; 0x27504 if(temp_error_state.v) break; 274f6: 80 91 1a 05 lds r24, 0x051A ; 0x80051a <_ZL16temp_error_state.lto_priv.454> 274fa: 81 11 cpse r24, r1 274fc: 03 c0 rjmp .+6 ; 0x27504 waiting_handler(); 274fe: 0f 94 56 3a call 0x274ac ; 0x274ac 27502: df cf rjmp .-66 ; 0x274c2 } } 27504: 08 95 ret 00027506 : checkFans(); lcd_update(0); } static void wait(unsigned ms) { 27506: cf 92 push r12 27508: df 92 push r13 2750a: ef 92 push r14 2750c: ff 92 push r15 2750e: 7c 01 movw r14, r24 unsigned long mark = _millis() + ms; 27510: 0f 94 22 29 call 0x25244 ; 0x25244 27514: 9b 01 movw r18, r22 27516: ac 01 movw r20, r24 27518: 2e 0d add r18, r14 2751a: 3f 1d adc r19, r15 2751c: 41 1d adc r20, r1 2751e: 51 1d adc r21, r1 27520: 69 01 movw r12, r18 27522: 7a 01 movw r14, r20 while(_millis() < mark) { 27524: 0f 94 22 29 call 0x25244 ; 0x25244 27528: 6c 15 cp r22, r12 2752a: 7d 05 cpc r23, r13 2752c: 8e 05 cpc r24, r14 2752e: 9f 05 cpc r25, r15 27530: 38 f4 brcc .+14 ; 0x27540 if(temp_error_state.v) break; 27532: 80 91 1a 05 lds r24, 0x051A ; 0x80051a <_ZL16temp_error_state.lto_priv.454> 27536: 81 11 cpse r24, r1 27538: 03 c0 rjmp .+6 ; 0x27540 waiting_handler(); 2753a: 0f 94 56 3a call 0x274ac ; 0x274ac 2753e: f2 cf rjmp .-28 ; 0x27524 } } 27540: ff 90 pop r15 27542: ef 90 pop r14 27544: df 90 pop r13 27546: cf 90 pop r12 27548: 08 95 ret 0002754a : 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; 2754a: 20 91 29 0e lds r18, 0x0E29 ; 0x800e29 2754e: 30 91 2a 0e lds r19, 0x0E2A ; 0x800e2a 27552: 40 91 2b 0e lds r20, 0x0E2B ; 0x800e2b 27556: 50 91 2c 0e lds r21, 0x0E2C ; 0x800e2c 2755a: 60 e0 ldi r22, 0x00 ; 0 2755c: 70 e0 ldi r23, 0x00 ; 0 2755e: 8f e7 ldi r24, 0x7F ; 127 27560: 93 e4 ldi r25, 0x43 ; 67 27562: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 27566: 60 93 ae 04 sts 0x04AE, r22 ; 0x8004ae <_ZL14iState_sum_max.lto_priv.469> 2756a: 70 93 af 04 sts 0x04AF, r23 ; 0x8004af <_ZL14iState_sum_max.lto_priv.469+0x1> 2756e: 80 93 b0 04 sts 0x04B0, r24 ; 0x8004b0 <_ZL14iState_sum_max.lto_priv.469+0x2> 27572: 90 93 b1 04 sts 0x04B1, r25 ; 0x8004b1 <_ZL14iState_sum_max.lto_priv.469+0x3> } #endif #ifdef PIDTEMPBED temp_iState_max_bed = PID_INTEGRAL_DRIVE_MAX / cs.bedKi; 27576: 20 91 35 0e lds r18, 0x0E35 ; 0x800e35 2757a: 30 91 36 0e lds r19, 0x0E36 ; 0x800e36 2757e: 40 91 37 0e lds r20, 0x0E37 ; 0x800e37 27582: 50 91 38 0e lds r21, 0x0E38 ; 0x800e38 27586: 60 e0 ldi r22, 0x00 ; 0 27588: 70 e0 ldi r23, 0x00 ; 0 2758a: 8f e7 ldi r24, 0x7F ; 127 2758c: 93 e4 ldi r25, 0x43 ; 67 2758e: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 27592: 60 93 a6 04 sts 0x04A6, r22 ; 0x8004a6 <_ZL19temp_iState_max_bed.lto_priv.467> 27596: 70 93 a7 04 sts 0x04A7, r23 ; 0x8004a7 <_ZL19temp_iState_max_bed.lto_priv.467+0x1> 2759a: 80 93 a8 04 sts 0x04A8, r24 ; 0x8004a8 <_ZL19temp_iState_max_bed.lto_priv.467+0x2> 2759e: 90 93 a9 04 sts 0x04A9, r25 ; 0x8004a9 <_ZL19temp_iState_max_bed.lto_priv.467+0x3> #endif } 275a2: 08 95 ret 000275a4 : #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) { 275a4: 2f 92 push r2 275a6: 3f 92 push r3 275a8: 4f 92 push r4 275aa: 5f 92 push r5 275ac: 6f 92 push r6 275ae: 7f 92 push r7 275b0: 8f 92 push r8 275b2: 9f 92 push r9 275b4: af 92 push r10 275b6: bf 92 push r11 275b8: cf 92 push r12 275ba: df 92 push r13 275bc: ef 92 push r14 275be: ff 92 push r15 275c0: 0f 93 push r16 275c2: 1f 93 push r17 275c4: cf 93 push r28 275c6: df 93 push r29 275c8: cd b7 in r28, 0x3d ; 61 275ca: de b7 in r29, 0x3e ; 62 275cc: e0 97 sbiw r28, 0x30 ; 48 275ce: 0f b6 in r0, 0x3f ; 63 275d0: f8 94 cli 275d2: de bf out 0x3e, r29 ; 62 275d4: 0f be out 0x3f, r0 ; 63 275d6: cd bf out 0x3d, r28 ; 61 275d8: 6a 87 std Y+10, r22 ; 0x0a 275da: 7b 87 std Y+11, r23 ; 0x0b 275dc: 8c 87 std Y+12, r24 ; 0x0c 275de: 9d 87 std Y+13, r25 ; 0x0d 275e0: 1a 01 movw r2, r20 275e2: 3a a7 std Y+42, r19 ; 0x2a 275e4: 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(); 275e6: 0f 94 ee 2e call 0x25ddc ; 0x25ddc pid_tuning_finished = false; 275ea: 10 92 3e 02 sts 0x023E, r1 ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.458> // 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; 275ee: 29 a5 ldd r18, Y+41 ; 0x29 275f0: 3a a5 ldd r19, Y+42 ; 0x2a 275f2: 30 93 47 06 sts 0x0647, r19 ; 0x800647 275f6: 20 93 46 06 sts 0x0646, r18 ; 0x800646 float input = 0.0; pid_cycle=0; 275fa: 10 92 49 06 sts 0x0649, r1 ; 0x800649 275fe: 10 92 48 06 sts 0x0648, r1 ; 0x800648 bool heating = true; unsigned long temp_millis = _millis(); 27602: 0f 94 22 29 call 0x25244 ; 0x25244 27606: 6e 83 std Y+6, r22 ; 0x06 27608: 7f 83 std Y+7, r23 ; 0x07 2760a: 88 87 std Y+8, r24 ; 0x08 2760c: 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 2760e: 37 fe sbrs r3, 7 27610: ff c0 rjmp .+510 ; 0x27810 27612: 3d e2 ldi r19, 0x2D ; 45 27614: 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(); 27616: 0f 94 22 29 call 0x25244 ; 0x25244 2761a: 6c a3 std Y+36, r22 ; 0x24 2761c: 7d a3 std Y+37, r23 ; 0x25 2761e: 8e a3 std Y+38, r24 ; 0x26 27620: 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."); 27622: 85 e9 ldi r24, 0x95 ; 149 27624: 9b e9 ldi r25, 0x9B ; 155 #if (defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN > -1) unsigned long extruder_autofan_last_check = _millis(); #endif if ((extruder >= EXTRUDERS) 27626: 12 14 cp r1, r2 27628: 13 04 cpc r1, r3 2762a: 0c f4 brge .+2 ; 0x2762e 2762c: 8a c2 rjmp .+1300 ; 0x27b42 pid_tuning_finished = true; pid_cycle = 0; return; } SERIAL_ECHOLNPGM("PID Autotune start"); 2762e: 82 e8 ldi r24, 0x82 ; 130 27630: 9b e9 ldi r25, 0x9B ; 155 27632: 0e 94 93 79 call 0xf326 ; 0xf326 27636: 6a 85 ldd r22, Y+10 ; 0x0a 27638: 7b 85 ldd r23, Y+11 ; 0x0b 2763a: 8c 85 ldd r24, Y+12 ; 0x0c 2763c: 9d 85 ldd r25, Y+13 ; 0x0d 2763e: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> if (extruder<0) { soft_pwm_bed = (MAX_BED_POWER)/2; 27642: 2f e7 ldi r18, 0x7F ; 127 return; } SERIAL_ECHOLNPGM("PID Autotune start"); if (extruder<0) 27644: 21 14 cp r2, r1 27646: 31 04 cpc r3, r1 27648: 09 f4 brne .+2 ; 0x2764c 2764a: e5 c0 rjmp .+458 ; 0x27816 { soft_pwm_bed = (MAX_BED_POWER)/2; 2764c: 20 93 1c 06 sts 0x061C, r18 ; 0x80061c bias = d = (MAX_BED_POWER)/2; target_temperature_bed = (int)temp; // to display the requested target bed temperature properly on the main screen 27650: 70 93 72 06 sts 0x0672, r23 ; 0x800672 27654: 60 93 71 06 sts 0x0671, r22 ; 0x800671 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 27658: 8e 81 ldd r24, Y+6 ; 0x06 2765a: 9f 81 ldd r25, Y+7 ; 0x07 2765c: a8 85 ldd r26, Y+8 ; 0x08 2765e: b9 85 ldd r27, Y+9 ; 0x09 27660: 8e 87 std Y+14, r24 ; 0x0e 27662: 9f 87 std Y+15, r25 ; 0x0f 27664: a8 8b std Y+16, r26 ; 0x10 27666: b9 8b std Y+17, r27 ; 0x11 27668: 88 a3 std Y+32, r24 ; 0x20 2766a: 99 a3 std Y+33, r25 ; 0x21 2766c: aa a3 std Y+34, r26 ; 0x22 2766e: bb a3 std Y+35, r27 ; 0x23 27670: 1a 8a std Y+18, r1 ; 0x12 27672: 90 e4 ldi r25, 0x40 ; 64 27674: 9b 8b std Y+19, r25 ; 0x13 27676: ac e1 ldi r26, 0x1C ; 28 27678: ac 8b std Y+20, r26 ; 0x14 2767a: b6 e4 ldi r27, 0x46 ; 70 2767c: bd 8b std Y+21, r27 ; 0x15 2767e: 1e 8a std Y+22, r1 ; 0x16 27680: 1f 8a std Y+23, r1 ; 0x17 27682: 18 8e std Y+24, r1 ; 0x18 27684: 19 8e std Y+25, r1 ; 0x19 27686: 6f e7 ldi r22, 0x7F ; 127 27688: c6 2e mov r12, r22 2768a: d1 2c mov r13, r1 2768c: e1 2c mov r14, r1 2768e: f1 2c mov r15, r1 27690: 00 e0 ldi r16, 0x00 ; 0 27692: 10 e0 ldi r17, 0x00 ; 0 27694: 18 aa std Y+48, r1 ; 0x30 27696: 1f a6 std Y+47, r1 ; 0x2f 27698: 1d 82 std Y+5, r1 ; 0x05 2769a: 2f e7 ldi r18, 0x7F ; 127 2769c: 30 e0 ldi r19, 0x00 ; 0 2769e: 40 e0 ldi r20, 0x00 ; 0 276a0: 50 e0 ldi r21, 0x00 ; 0 276a2: 29 83 std Y+1, r18 ; 0x01 276a4: 3a 83 std Y+2, r19 ; 0x02 276a6: 4b 83 std Y+3, r20 ; 0x03 276a8: 5c 83 std Y+4, r21 ; 0x04 276aa: 1b 8e std Y+27, r1 ; 0x1b 276ac: 1c 8e std Y+28, r1 ; 0x1c 276ae: 1d 8e std Y+29, r1 ; 0x1d 276b0: 1e 8e std Y+30, r1 ; 0x1e 276b2: 31 e0 ldi r19, 0x01 ; 1 276b4: 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(); 276b6: a8 95 wdr #endif //WATCHDOG if(temp_meas_ready == true) { // temp sample ready 276b8: 40 91 01 06 lds r20, 0x0601 ; 0x800601 276bc: 48 a7 std Y+40, r20 ; 0x28 276be: 44 23 and r20, r20 276c0: 09 f4 brne .+2 ; 0x276c4 276c2: 2c c2 rjmp .+1112 ; 0x27b1c updateTemperatures(); 276c4: 0f 94 4f 32 call 0x2649e ; 0x2649e input = (extruder<0)?current_temperature_bed:current_temperature[extruder]; 276c8: 21 14 cp r2, r1 276ca: 31 04 cpc r3, r1 276cc: 09 f0 breq .+2 ; 0x276d0 276ce: aa c0 rjmp .+340 ; 0x27824 276d0: 00 91 af 0d lds r16, 0x0DAF ; 0x800daf 276d4: 10 91 b0 0d lds r17, 0x0DB0 ; 0x800db0 276d8: 50 91 b1 0d lds r21, 0x0DB1 ; 0x800db1 276dc: 58 ab std Y+48, r21 ; 0x30 276de: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 276e2: 8f a7 std Y+47, r24 ; 0x2f max=max(max,input); 276e4: 2e 89 ldd r18, Y+22 ; 0x16 276e6: 3f 89 ldd r19, Y+23 ; 0x17 276e8: 48 8d ldd r20, Y+24 ; 0x18 276ea: 59 8d ldd r21, Y+25 ; 0x19 276ec: b8 01 movw r22, r16 276ee: 88 a9 ldd r24, Y+48 ; 0x30 276f0: 9f a5 ldd r25, Y+47 ; 0x2f 276f2: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 276f6: 87 fd sbrc r24, 7 276f8: 06 c0 rjmp .+12 ; 0x27706 276fa: 0e 8b std Y+22, r16 ; 0x16 276fc: 1f 8b std Y+23, r17 ; 0x17 276fe: b8 a9 ldd r27, Y+48 ; 0x30 27700: b8 8f std Y+24, r27 ; 0x18 27702: 2f a5 ldd r18, Y+47 ; 0x2f 27704: 29 8f std Y+25, r18 ; 0x19 min=min(min,input); 27706: 2a 89 ldd r18, Y+18 ; 0x12 27708: 3b 89 ldd r19, Y+19 ; 0x13 2770a: 4c 89 ldd r20, Y+20 ; 0x14 2770c: 5d 89 ldd r21, Y+21 ; 0x15 2770e: b8 01 movw r22, r16 27710: 88 a9 ldd r24, Y+48 ; 0x30 27712: 9f a5 ldd r25, Y+47 ; 0x2f 27714: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 27718: 18 16 cp r1, r24 2771a: 34 f0 brlt .+12 ; 0x27728 2771c: 0a 8b std Y+18, r16 ; 0x12 2771e: 1b 8b std Y+19, r17 ; 0x13 27720: 38 a9 ldd r19, Y+48 ; 0x30 27722: 3c 8b std Y+20, r19 ; 0x14 27724: 4f a5 ldd r20, Y+47 ; 0x2f 27726: 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) { 27728: 0f 94 22 29 call 0x25244 ; 0x25244 2772c: 2c a1 ldd r18, Y+36 ; 0x24 2772e: 3d a1 ldd r19, Y+37 ; 0x25 27730: 4e a1 ldd r20, Y+38 ; 0x26 27732: 5f a1 ldd r21, Y+39 ; 0x27 27734: 62 1b sub r22, r18 27736: 73 0b sbc r23, r19 27738: 84 0b sbc r24, r20 2773a: 95 0b sbc r25, r21 2773c: 65 3c cpi r22, 0xC5 ; 197 2773e: 79 40 sbci r23, 0x09 ; 9 27740: 81 05 cpc r24, r1 27742: 91 05 cpc r25, r1 27744: 40 f0 brcs .+16 ; 0x27756 checkExtruderAutoFans(); 27746: 0e 94 bf 75 call 0xeb7e ; 0xeb7e extruder_autofan_last_check = _millis(); 2774a: 0f 94 22 29 call 0x25244 ; 0x25244 2774e: 6c a3 std Y+36, r22 ; 0x24 27750: 7d a3 std Y+37, r23 ; 0x25 27752: 8e a3 std Y+38, r24 ; 0x26 27754: 9f a3 std Y+39, r25 ; 0x27 } #endif if(heating == true && input > temp) { 27756: 4a 8d ldd r20, Y+26 ; 0x1a 27758: 44 23 and r20, r20 2775a: 09 f4 brne .+2 ; 0x2775e 2775c: 4c c0 rjmp .+152 ; 0x277f6 2775e: 2a 85 ldd r18, Y+10 ; 0x0a 27760: 3b 85 ldd r19, Y+11 ; 0x0b 27762: 4c 85 ldd r20, Y+12 ; 0x0c 27764: 5d 85 ldd r21, Y+13 ; 0x0d 27766: b8 01 movw r22, r16 27768: 88 a9 ldd r24, Y+48 ; 0x30 2776a: 9f a5 ldd r25, Y+47 ; 0x2f 2776c: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 27770: 18 16 cp r1, r24 27772: 0c f0 brlt .+2 ; 0x27776 27774: d3 c1 rjmp .+934 ; 0x27b1c if(_millis() - t2 > 5000) { 27776: 0f 94 22 29 call 0x25244 ; 0x25244 2777a: 2e 85 ldd r18, Y+14 ; 0x0e 2777c: 3f 85 ldd r19, Y+15 ; 0x0f 2777e: 48 89 ldd r20, Y+16 ; 0x10 27780: 59 89 ldd r21, Y+17 ; 0x11 27782: 62 1b sub r22, r18 27784: 73 0b sbc r23, r19 27786: 84 0b sbc r24, r20 27788: 95 0b sbc r25, r21 2778a: 69 38 cpi r22, 0x89 ; 137 2778c: 73 41 sbci r23, 0x13 ; 19 2778e: 81 05 cpc r24, r1 27790: 91 05 cpc r25, r1 27792: 08 f4 brcc .+2 ; 0x27796 27794: c3 c1 rjmp .+902 ; 0x27b1c 27796: d7 01 movw r26, r14 27798: c6 01 movw r24, r12 2779a: 29 81 ldd r18, Y+1 ; 0x01 2779c: 3a 81 ldd r19, Y+2 ; 0x02 2779e: 4b 81 ldd r20, Y+3 ; 0x03 277a0: 5c 81 ldd r21, Y+4 ; 0x04 277a2: 82 1b sub r24, r18 277a4: 93 0b sbc r25, r19 277a6: a4 0b sbc r26, r20 277a8: b5 0b sbc r27, r21 277aa: b5 95 asr r27 277ac: a7 95 ror r26 277ae: 97 95 ror r25 277b0: 87 95 ror r24 heating=false; if (extruder<0) { 277b2: 21 14 cp r2, r1 277b4: 31 04 cpc r3, r1 277b6: 09 f4 brne .+2 ; 0x277ba 277b8: 40 c0 rjmp .+128 ; 0x2783a soft_pwm_bed = (bias - d) >> 1; 277ba: 80 93 1c 06 sts 0x061C, r24 ; 0x80061c } else soft_pwm[extruder] = (bias - d) >> 1; t1=_millis(); 277be: 0f 94 22 29 call 0x25244 ; 0x25244 277c2: 6e 83 std Y+6, r22 ; 0x06 277c4: 7f 83 std Y+7, r23 ; 0x07 277c6: 88 87 std Y+8, r24 ; 0x08 277c8: 99 87 std Y+9, r25 ; 0x09 t_high=t1 - t2; 277ca: dc 01 movw r26, r24 277cc: cb 01 movw r24, r22 277ce: 2e 85 ldd r18, Y+14 ; 0x0e 277d0: 3f 85 ldd r19, Y+15 ; 0x0f 277d2: 48 89 ldd r20, Y+16 ; 0x10 277d4: 59 89 ldd r21, Y+17 ; 0x11 277d6: 82 1b sub r24, r18 277d8: 93 0b sbc r25, r19 277da: a4 0b sbc r26, r20 277dc: b5 0b sbc r27, r21 277de: 8b 8f std Y+27, r24 ; 0x1b 277e0: 9c 8f std Y+28, r25 ; 0x1c 277e2: ad 8f std Y+29, r26 ; 0x1d 277e4: be 8f std Y+30, r27 ; 0x1e max=temp; 277e6: 3a 85 ldd r19, Y+10 ; 0x0a 277e8: 3e 8b std Y+22, r19 ; 0x16 277ea: 4b 85 ldd r20, Y+11 ; 0x0b 277ec: 4f 8b std Y+23, r20 ; 0x17 277ee: 5c 85 ldd r21, Y+12 ; 0x0c 277f0: 58 8f std Y+24, r21 ; 0x18 277f2: 8d 85 ldd r24, Y+13 ; 0x0d 277f4: 89 8f std Y+25, r24 ; 0x19 } } if(heating == false && input < temp) { 277f6: 2a 85 ldd r18, Y+10 ; 0x0a 277f8: 3b 85 ldd r19, Y+11 ; 0x0b 277fa: 4c 85 ldd r20, Y+12 ; 0x0c 277fc: 5d 85 ldd r21, Y+13 ; 0x0d 277fe: b8 01 movw r22, r16 27800: 88 a9 ldd r24, Y+48 ; 0x30 27802: 9f a5 ldd r25, Y+47 ; 0x2f 27804: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 27808: 87 fd sbrc r24, 7 2780a: 1a c0 rjmp .+52 ; 0x27840 if(_millis() - t1 > 5000) { 2780c: 1a 8e std Y+26, r1 ; 0x1a 2780e: 86 c1 rjmp .+780 ; 0x27b1c 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 27810: 4a e0 ldi r20, 0x0A ; 10 27812: 4f 8f std Y+31, r20 ; 0x1f 27814: 00 cf rjmp .-512 ; 0x27616 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; 27816: 20 93 15 05 sts 0x0515, r18 ; 0x800515 <_ZL8soft_pwm.lto_priv.459> bias = d = (PID_MAX)/2; target_temperature[extruder] = (int)temp; // to display the requested target extruder temperature properly on the main screen 2781a: 70 93 b6 0d sts 0x0DB6, r23 ; 0x800db6 2781e: 60 93 b5 0d sts 0x0DB5, r22 ; 0x800db5 27822: 1a cf rjmp .-460 ; 0x27658 wdt_reset(); #endif //WATCHDOG if(temp_meas_ready == true) { // temp sample ready updateTemperatures(); input = (extruder<0)?current_temperature_bed:current_temperature[extruder]; 27824: 00 91 ed 04 lds r16, 0x04ED ; 0x8004ed 27828: 10 91 ee 04 lds r17, 0x04EE ; 0x8004ee 2782c: 90 91 ef 04 lds r25, 0x04EF ; 0x8004ef 27830: 98 ab std Y+48, r25 ; 0x30 27832: a0 91 f0 04 lds r26, 0x04F0 ; 0x8004f0 27836: af a7 std Y+47, r26 ; 0x2f 27838: 55 cf rjmp .-342 ; 0x276e4 heating=false; if (extruder<0) { soft_pwm_bed = (bias - d) >> 1; } else soft_pwm[extruder] = (bias - d) >> 1; 2783a: 80 93 15 05 sts 0x0515, r24 ; 0x800515 <_ZL8soft_pwm.lto_priv.459> 2783e: bf cf rjmp .-130 ; 0x277be t_high=t1 - t2; max=temp; } } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { 27840: 0f 94 22 29 call 0x25244 ; 0x25244 27844: 2e 81 ldd r18, Y+6 ; 0x06 27846: 3f 81 ldd r19, Y+7 ; 0x07 27848: 48 85 ldd r20, Y+8 ; 0x08 2784a: 59 85 ldd r21, Y+9 ; 0x09 2784c: 62 1b sub r22, r18 2784e: 73 0b sbc r23, r19 27850: 84 0b sbc r24, r20 27852: 95 0b sbc r25, r21 27854: 69 38 cpi r22, 0x89 ; 137 27856: 73 41 sbci r23, 0x13 ; 19 27858: 81 05 cpc r24, r1 2785a: 91 05 cpc r25, r1 2785c: b8 f2 brcs .-82 ; 0x2780c heating=true; t2=_millis(); 2785e: 0f 94 22 29 call 0x25244 ; 0x25244 27862: 6e 87 std Y+14, r22 ; 0x0e 27864: 7f 87 std Y+15, r23 ; 0x0f 27866: 88 8b std Y+16, r24 ; 0x10 27868: 99 8b std Y+17, r25 ; 0x11 t_low=t2 - t1; if(pid_cycle > 0) { 2786a: 80 91 48 06 lds r24, 0x0648 ; 0x800648 2786e: 90 91 49 06 lds r25, 0x0649 ; 0x800649 27872: 18 16 cp r1, r24 27874: 19 06 cpc r1, r25 27876: 0c f0 brlt .+2 ; 0x2787a 27878: 2c c1 rjmp .+600 ; 0x27ad2 } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { heating=true; t2=_millis(); t_low=t2 - t1; 2787a: 8e 85 ldd r24, Y+14 ; 0x0e 2787c: 9f 85 ldd r25, Y+15 ; 0x0f 2787e: a8 89 ldd r26, Y+16 ; 0x10 27880: b9 89 ldd r27, Y+17 ; 0x11 27882: 2e 81 ldd r18, Y+6 ; 0x06 27884: 3f 81 ldd r19, Y+7 ; 0x07 27886: 48 85 ldd r20, Y+8 ; 0x08 27888: 59 85 ldd r21, Y+9 ; 0x09 2788a: 82 1b sub r24, r18 2788c: 93 0b sbc r25, r19 2788e: a4 0b sbc r26, r20 27890: b5 0b sbc r27, r21 if(pid_cycle > 0) { bias += (d*(t_high - t_low))/(t_low + t_high); 27892: 4b 8c ldd r4, Y+27 ; 0x1b 27894: 5c 8c ldd r5, Y+28 ; 0x1c 27896: 6d 8c ldd r6, Y+29 ; 0x1d 27898: 7e 8c ldd r7, Y+30 ; 0x1e 2789a: 48 0e add r4, r24 2789c: 59 1e adc r5, r25 2789e: 6a 1e adc r6, r26 278a0: 7b 1e adc r7, r27 278a2: 2b 8d ldd r18, Y+27 ; 0x1b 278a4: 3c 8d ldd r19, Y+28 ; 0x1c 278a6: 4d 8d ldd r20, Y+29 ; 0x1d 278a8: 5e 8d ldd r21, Y+30 ; 0x1e 278aa: 28 1b sub r18, r24 278ac: 39 0b sbc r19, r25 278ae: 4a 0b sbc r20, r26 278b0: 5b 0b sbc r21, r27 278b2: 69 81 ldd r22, Y+1 ; 0x01 278b4: 7a 81 ldd r23, Y+2 ; 0x02 278b6: 8b 81 ldd r24, Y+3 ; 0x03 278b8: 9c 81 ldd r25, Y+4 ; 0x04 278ba: 0f 94 3a dc call 0x3b874 ; 0x3b874 <__mulsi3> 278be: a3 01 movw r20, r6 278c0: 92 01 movw r18, r4 278c2: 0f 94 c8 dc call 0x3b990 ; 0x3b990 <__divmodsi4> 278c6: da 01 movw r26, r20 278c8: c9 01 movw r24, r18 278ca: 8c 0d add r24, r12 278cc: 9d 1d adc r25, r13 278ce: ae 1d adc r26, r14 278d0: bf 1d adc r27, r15 bias = constrain(bias, 20 ,(extruder<0?(MAX_BED_POWER):(PID_MAX))-20); 278d2: 84 31 cpi r24, 0x14 ; 20 278d4: 91 05 cpc r25, r1 278d6: a1 05 cpc r26, r1 278d8: b1 05 cpc r27, r1 278da: 0c f4 brge .+2 ; 0x278de 278dc: 3c c1 rjmp .+632 ; 0x27b56 278de: 6c 01 movw r12, r24 278e0: 7d 01 movw r14, r26 278e2: 3c ee ldi r19, 0xEC ; 236 278e4: c3 16 cp r12, r19 278e6: d1 04 cpc r13, r1 278e8: e1 04 cpc r14, r1 278ea: f1 04 cpc r15, r1 278ec: 2c f0 brlt .+10 ; 0x278f8 278ee: 4b ee ldi r20, 0xEB ; 235 278f0: c4 2e mov r12, r20 278f2: d1 2c mov r13, r1 278f4: e1 2c mov r14, r1 278f6: 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; 278f8: 80 38 cpi r24, 0x80 ; 128 278fa: 91 05 cpc r25, r1 278fc: a1 05 cpc r26, r1 278fe: b1 05 cpc r27, r1 27900: 0c f4 brge .+2 ; 0x27904 27902: 37 c1 rjmp .+622 ; 0x27b72 27904: 8e ef ldi r24, 0xFE ; 254 27906: 90 e0 ldi r25, 0x00 ; 0 27908: a0 e0 ldi r26, 0x00 ; 0 2790a: b0 e0 ldi r27, 0x00 ; 0 2790c: 8c 19 sub r24, r12 2790e: 9d 09 sbc r25, r13 27910: ae 09 sbc r26, r14 27912: bf 09 sbc r27, r15 27914: 89 83 std Y+1, r24 ; 0x01 27916: 9a 83 std Y+2, r25 ; 0x02 27918: ab 83 std Y+3, r26 ; 0x03 2791a: bc 83 std Y+4, r27 ; 0x04 else d = bias; SERIAL_PROTOCOLPGM(" bias: "); SERIAL_PROTOCOL(bias); 2791c: 8a e7 ldi r24, 0x7A ; 122 2791e: 9b e9 ldi r25, 0x9B ; 155 27920: 0e 94 68 77 call 0xeed0 ; 0xeed0 27924: c7 01 movw r24, r14 27926: b6 01 movw r22, r12 27928: 0f 94 26 d5 call 0x3aa4c ; 0x3aa4c SERIAL_PROTOCOLPGM(" d: "); SERIAL_PROTOCOL(d); 2792c: 85 e7 ldi r24, 0x75 ; 117 2792e: 9b e9 ldi r25, 0x9B ; 155 27930: 0e 94 68 77 call 0xeed0 ; 0xeed0 27934: 69 81 ldd r22, Y+1 ; 0x01 27936: 7a 81 ldd r23, Y+2 ; 0x02 27938: 8b 81 ldd r24, Y+3 ; 0x03 2793a: 9c 81 ldd r25, Y+4 ; 0x04 2793c: 0f 94 26 d5 call 0x3aa4c ; 0x3aa4c SERIAL_PROTOCOLPGM(" min: "); SERIAL_PROTOCOL(min); 27940: 8e e6 ldi r24, 0x6E ; 110 27942: 9b e9 ldi r25, 0x9B ; 155 27944: 0e 94 68 77 call 0xeed0 ; 0xeed0 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 27948: 42 e0 ldi r20, 0x02 ; 2 2794a: 6a 89 ldd r22, Y+18 ; 0x12 2794c: 7b 89 ldd r23, Y+19 ; 0x13 2794e: 8c 89 ldd r24, Y+20 ; 0x14 27950: 9d 89 ldd r25, Y+21 ; 0x15 27952: 0f 94 42 d5 call 0x3aa84 ; 0x3aa84 SERIAL_PROTOCOLPGM(" max: "); SERIAL_PROTOCOLLN(max); 27956: 87 e6 ldi r24, 0x67 ; 103 27958: 9b e9 ldi r25, 0x9B ; 155 2795a: 0e 94 68 77 call 0xeed0 ; 0xeed0 2795e: 6e 89 ldd r22, Y+22 ; 0x16 27960: 7f 89 ldd r23, Y+23 ; 0x17 27962: 88 8d ldd r24, Y+24 ; 0x18 27964: 99 8d ldd r25, Y+25 ; 0x19 27966: 0f 94 6f 74 call 0x2e8de ; 0x2e8de if(pid_cycle > 2) { 2796a: 80 91 48 06 lds r24, 0x0648 ; 0x800648 2796e: 90 91 49 06 lds r25, 0x0649 ; 0x800649 27972: 03 97 sbiw r24, 0x03 ; 3 27974: 0c f4 brge .+2 ; 0x27978 27976: ad c0 rjmp .+346 ; 0x27ad2 Ku = (4.0*d)/(3.14159*(max-min)/2.0); 27978: 69 81 ldd r22, Y+1 ; 0x01 2797a: 7a 81 ldd r23, Y+2 ; 0x02 2797c: 8b 81 ldd r24, Y+3 ; 0x03 2797e: 9c 81 ldd r25, Y+4 ; 0x04 27980: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 27984: 20 e0 ldi r18, 0x00 ; 0 27986: 30 e0 ldi r19, 0x00 ; 0 27988: 40 e8 ldi r20, 0x80 ; 128 2798a: 50 e4 ldi r21, 0x40 ; 64 2798c: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 27990: 4b 01 movw r8, r22 27992: 5c 01 movw r10, r24 27994: 2a 89 ldd r18, Y+18 ; 0x12 27996: 3b 89 ldd r19, Y+19 ; 0x13 27998: 4c 89 ldd r20, Y+20 ; 0x14 2799a: 5d 89 ldd r21, Y+21 ; 0x15 2799c: 6e 89 ldd r22, Y+22 ; 0x16 2799e: 7f 89 ldd r23, Y+23 ; 0x17 279a0: 88 8d ldd r24, Y+24 ; 0x18 279a2: 99 8d ldd r25, Y+25 ; 0x19 279a4: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 279a8: 20 ed ldi r18, 0xD0 ; 208 279aa: 3f e0 ldi r19, 0x0F ; 15 279ac: 49 e4 ldi r20, 0x49 ; 73 279ae: 50 e4 ldi r21, 0x40 ; 64 279b0: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 279b4: 20 e0 ldi r18, 0x00 ; 0 279b6: 30 e0 ldi r19, 0x00 ; 0 279b8: 40 e0 ldi r20, 0x00 ; 0 279ba: 5f e3 ldi r21, 0x3F ; 63 279bc: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 279c0: 9b 01 movw r18, r22 279c2: ac 01 movw r20, r24 279c4: c5 01 movw r24, r10 279c6: b4 01 movw r22, r8 279c8: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 279cc: 4b 01 movw r8, r22 279ce: 5c 01 movw r10, r24 Tu = ((float)(t_low + t_high)/1000.0); 279d0: c3 01 movw r24, r6 279d2: b2 01 movw r22, r4 279d4: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 279d8: 20 e0 ldi r18, 0x00 ; 0 279da: 30 e0 ldi r19, 0x00 ; 0 279dc: 4a e7 ldi r20, 0x7A ; 122 279de: 54 e4 ldi r21, 0x44 ; 68 279e0: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 279e4: 2b 01 movw r4, r22 279e6: 3c 01 movw r6, r24 SERIAL_PROTOCOLPGM(" Ku: "); SERIAL_PROTOCOL(Ku); 279e8: 81 e6 ldi r24, 0x61 ; 97 279ea: 9b e9 ldi r25, 0x9B ; 155 279ec: 0e 94 68 77 call 0xeed0 ; 0xeed0 279f0: 42 e0 ldi r20, 0x02 ; 2 279f2: c5 01 movw r24, r10 279f4: b4 01 movw r22, r8 279f6: 0f 94 42 d5 call 0x3aa84 ; 0x3aa84 SERIAL_PROTOCOLPGM(" Tu: "); SERIAL_PROTOCOLLN(Tu); 279fa: 8b e5 ldi r24, 0x5B ; 91 279fc: 9b e9 ldi r25, 0x9B ; 155 279fe: 0e 94 68 77 call 0xeed0 ; 0xeed0 27a02: c3 01 movw r24, r6 27a04: b2 01 movw r22, r4 27a06: 0f 94 6f 74 call 0x2e8de ; 0x2e8de _Kp = 0.6*Ku; 27a0a: 2a e9 ldi r18, 0x9A ; 154 27a0c: 39 e9 ldi r19, 0x99 ; 153 27a0e: 49 e1 ldi r20, 0x19 ; 25 27a10: 5f e3 ldi r21, 0x3F ; 63 27a12: c5 01 movw r24, r10 27a14: b4 01 movw r22, r8 27a16: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 27a1a: 4b 01 movw r8, r22 27a1c: 5c 01 movw r10, r24 27a1e: 80 92 f2 03 sts 0x03F2, r8 ; 0x8003f2 <_Kp> 27a22: 90 92 f3 03 sts 0x03F3, r9 ; 0x8003f3 <_Kp+0x1> 27a26: a0 92 f4 03 sts 0x03F4, r10 ; 0x8003f4 <_Kp+0x2> 27a2a: b0 92 f5 03 sts 0x03F5, r11 ; 0x8003f5 <_Kp+0x3> _Ki = 2*_Kp/Tu; 27a2e: ac 01 movw r20, r24 27a30: 9b 01 movw r18, r22 27a32: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 27a36: a3 01 movw r20, r6 27a38: 92 01 movw r18, r4 27a3a: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 27a3e: 60 93 ee 03 sts 0x03EE, r22 ; 0x8003ee <_Ki> 27a42: 70 93 ef 03 sts 0x03EF, r23 ; 0x8003ef <_Ki+0x1> 27a46: 80 93 f0 03 sts 0x03F0, r24 ; 0x8003f0 <_Ki+0x2> 27a4a: 90 93 f1 03 sts 0x03F1, r25 ; 0x8003f1 <_Ki+0x3> _Kd = _Kp*Tu/8; 27a4e: a3 01 movw r20, r6 27a50: 92 01 movw r18, r4 27a52: c5 01 movw r24, r10 27a54: b4 01 movw r22, r8 27a56: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 27a5a: 20 e0 ldi r18, 0x00 ; 0 27a5c: 30 e0 ldi r19, 0x00 ; 0 27a5e: 40 e0 ldi r20, 0x00 ; 0 27a60: 5e e3 ldi r21, 0x3E ; 62 27a62: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 27a66: 60 93 ea 03 sts 0x03EA, r22 ; 0x8003ea <_Kd> 27a6a: 70 93 eb 03 sts 0x03EB, r23 ; 0x8003eb <_Kd+0x1> 27a6e: 80 93 ec 03 sts 0x03EC, r24 ; 0x8003ec <_Kd+0x2> 27a72: 90 93 ed 03 sts 0x03ED, r25 ; 0x8003ed <_Kd+0x3> SERIAL_PROTOCOLLNPGM(" Classic PID "); 27a76: 8d e4 ldi r24, 0x4D ; 77 27a78: 9b e9 ldi r25, 0x9B ; 155 27a7a: 0e 94 93 79 call 0xf326 ; 0xf326 SERIAL_PROTOCOLPGM(" Kp: "); SERIAL_PROTOCOLLN(_Kp); 27a7e: 87 e4 ldi r24, 0x47 ; 71 27a80: 9b e9 ldi r25, 0x9B ; 155 27a82: 0e 94 68 77 call 0xeed0 ; 0xeed0 27a86: 60 91 f2 03 lds r22, 0x03F2 ; 0x8003f2 <_Kp> 27a8a: 70 91 f3 03 lds r23, 0x03F3 ; 0x8003f3 <_Kp+0x1> 27a8e: 80 91 f4 03 lds r24, 0x03F4 ; 0x8003f4 <_Kp+0x2> 27a92: 90 91 f5 03 lds r25, 0x03F5 ; 0x8003f5 <_Kp+0x3> 27a96: 0f 94 6f 74 call 0x2e8de ; 0x2e8de SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(_Ki); 27a9a: 81 e4 ldi r24, 0x41 ; 65 27a9c: 9b e9 ldi r25, 0x9B ; 155 27a9e: 0e 94 68 77 call 0xeed0 ; 0xeed0 27aa2: 60 91 ee 03 lds r22, 0x03EE ; 0x8003ee <_Ki> 27aa6: 70 91 ef 03 lds r23, 0x03EF ; 0x8003ef <_Ki+0x1> 27aaa: 80 91 f0 03 lds r24, 0x03F0 ; 0x8003f0 <_Ki+0x2> 27aae: 90 91 f1 03 lds r25, 0x03F1 ; 0x8003f1 <_Ki+0x3> 27ab2: 0f 94 6f 74 call 0x2e8de ; 0x2e8de SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(_Kd); 27ab6: 8b e3 ldi r24, 0x3B ; 59 27ab8: 9b e9 ldi r25, 0x9B ; 155 27aba: 0e 94 68 77 call 0xeed0 ; 0xeed0 27abe: 60 91 ea 03 lds r22, 0x03EA ; 0x8003ea <_Kd> 27ac2: 70 91 eb 03 lds r23, 0x03EB ; 0x8003eb <_Kd+0x1> 27ac6: 80 91 ec 03 lds r24, 0x03EC ; 0x8003ec <_Kd+0x2> 27aca: 90 91 ed 03 lds r25, 0x03ED ; 0x8003ed <_Kd+0x3> 27ace: 0f 94 6f 74 call 0x2e8de ; 0x2e8de 27ad2: 89 81 ldd r24, Y+1 ; 0x01 27ad4: 9a 81 ldd r25, Y+2 ; 0x02 27ad6: ab 81 ldd r26, Y+3 ; 0x03 27ad8: bc 81 ldd r27, Y+4 ; 0x04 27ada: 8c 0d add r24, r12 27adc: 9d 1d adc r25, r13 27ade: ae 1d adc r26, r14 27ae0: bf 1d adc r27, r15 27ae2: b5 95 asr r27 27ae4: a7 95 ror r26 27ae6: 97 95 ror r25 27ae8: 87 95 ror r24 SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(_Ki); SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(_Kd); */ } } if (extruder<0) 27aea: 21 14 cp r2, r1 27aec: 31 04 cpc r3, r1 27aee: 09 f4 brne .+2 ; 0x27af2 27af0: 45 c0 rjmp .+138 ; 0x27b7c { soft_pwm_bed = (bias + d) >> 1; 27af2: 80 93 1c 06 sts 0x061C, r24 ; 0x80061c } else soft_pwm[extruder] = (bias + d) >> 1; pid_cycle++; 27af6: 80 91 48 06 lds r24, 0x0648 ; 0x800648 27afa: 90 91 49 06 lds r25, 0x0649 ; 0x800649 27afe: 01 96 adiw r24, 0x01 ; 1 27b00: 90 93 49 06 sts 0x0649, r25 ; 0x800649 27b04: 80 93 48 06 sts 0x0648, r24 ; 0x800648 min=temp; 27b08: 3a 85 ldd r19, Y+10 ; 0x0a 27b0a: 3a 8b std Y+18, r19 ; 0x12 27b0c: 4b 85 ldd r20, Y+11 ; 0x0b 27b0e: 4b 8b std Y+19, r20 ; 0x13 27b10: 5c 85 ldd r21, Y+12 ; 0x0c 27b12: 5c 8b std Y+20, r21 ; 0x14 27b14: 8d 85 ldd r24, Y+13 ; 0x0d 27b16: 8d 8b std Y+21, r24 ; 0x15 max=temp; } } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { heating=true; 27b18: 98 a5 ldd r25, Y+40 ; 0x28 27b1a: 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)) { 27b1c: 20 e0 ldi r18, 0x00 ; 0 27b1e: 30 e0 ldi r19, 0x00 ; 0 27b20: 40 ea ldi r20, 0xA0 ; 160 27b22: 51 e4 ldi r21, 0x41 ; 65 27b24: 6a 85 ldd r22, Y+10 ; 0x0a 27b26: 7b 85 ldd r23, Y+11 ; 0x0b 27b28: 8c 85 ldd r24, Y+12 ; 0x0c 27b2a: 9d 85 ldd r25, Y+13 ; 0x0d 27b2c: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 27b30: 98 01 movw r18, r16 27b32: 48 a9 ldd r20, Y+48 ; 0x30 27b34: 5f a5 ldd r21, Y+47 ; 0x2f 27b36: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 27b3a: 87 ff sbrs r24, 7 27b3c: 22 c0 rjmp .+68 ; 0x27b82 SERIAL_PROTOCOLLNPGM("PID Autotune failed! Temperature too high"); 27b3e: 81 e1 ldi r24, 0x11 ; 17 27b40: 9b e9 ldi r25, 0x9B ; 155 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"); 27b42: 0e 94 93 79 call 0xf326 ; 0xf326 pid_tuning_finished = true; 27b46: 81 e0 ldi r24, 0x01 ; 1 27b48: 80 93 3e 02 sts 0x023E, r24 ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.458> pid_cycle = 0; 27b4c: 10 92 49 06 sts 0x0649, r1 ; 0x800649 27b50: 10 92 48 06 sts 0x0648, r1 ; 0x800648 27b54: 98 c0 rjmp .+304 ; 0x27c86 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); 27b56: 34 e1 ldi r19, 0x14 ; 20 27b58: c3 2e mov r12, r19 27b5a: d1 2c mov r13, r1 27b5c: e1 2c mov r14, r1 27b5e: f1 2c mov r15, r1 27b60: 24 e1 ldi r18, 0x14 ; 20 27b62: 30 e0 ldi r19, 0x00 ; 0 27b64: 40 e0 ldi r20, 0x00 ; 0 27b66: 50 e0 ldi r21, 0x00 ; 0 27b68: 29 83 std Y+1, r18 ; 0x01 27b6a: 3a 83 std Y+2, r19 ; 0x02 27b6c: 4b 83 std Y+3, r20 ; 0x03 27b6e: 5c 83 std Y+4, r21 ; 0x04 27b70: d5 ce rjmp .-598 ; 0x2791c 27b72: c9 82 std Y+1, r12 ; 0x01 27b74: da 82 std Y+2, r13 ; 0x02 27b76: eb 82 std Y+3, r14 ; 0x03 27b78: fc 82 std Y+4, r15 ; 0x04 27b7a: d0 ce rjmp .-608 ; 0x2791c if (extruder<0) { soft_pwm_bed = (bias + d) >> 1; } else soft_pwm[extruder] = (bias + d) >> 1; 27b7c: 80 93 15 05 sts 0x0515, r24 ; 0x800515 <_ZL8soft_pwm.lto_priv.459> 27b80: ba cf rjmp .-140 ; 0x27af6 SERIAL_PROTOCOLLNPGM("PID Autotune failed! Temperature too high"); pid_tuning_finished = true; pid_cycle = 0; return; } if(_millis() - temp_millis > 2000) { 27b82: 0f 94 22 29 call 0x25244 ; 0x25244 27b86: 28 a1 ldd r18, Y+32 ; 0x20 27b88: 39 a1 ldd r19, Y+33 ; 0x21 27b8a: 4a a1 ldd r20, Y+34 ; 0x22 27b8c: 5b a1 ldd r21, Y+35 ; 0x23 27b8e: 62 1b sub r22, r18 27b90: 73 0b sbc r23, r19 27b92: 84 0b sbc r24, r20 27b94: 95 0b sbc r25, r21 27b96: 61 3d cpi r22, 0xD1 ; 209 27b98: 77 40 sbci r23, 0x07 ; 7 27b9a: 81 05 cpc r24, r1 27b9c: 91 05 cpc r25, r1 27b9e: 58 f1 brcs .+86 ; 0x27bf6 int p; if (extruder<0){ p=soft_pwm_bed; 27ba0: a0 90 1c 06 lds r10, 0x061C ; 0x80061c 27ba4: b1 2c mov r11, r1 SERIAL_PROTOCOLPGM("B:"); 27ba6: 8e e0 ldi r24, 0x0E ; 14 27ba8: 9b e9 ldi r25, 0x9B ; 155 pid_cycle = 0; return; } if(_millis() - temp_millis > 2000) { int p; if (extruder<0){ 27baa: 21 14 cp r2, r1 27bac: 31 04 cpc r3, r1 27bae: 29 f4 brne .+10 ; 0x27bba p=soft_pwm_bed; SERIAL_PROTOCOLPGM("B:"); }else{ p=soft_pwm[extruder]; 27bb0: a0 90 15 05 lds r10, 0x0515 ; 0x800515 <_ZL8soft_pwm.lto_priv.459> 27bb4: b1 2c mov r11, r1 SERIAL_PROTOCOLPGM("T:"); 27bb6: 8b e0 ldi r24, 0x0B ; 11 27bb8: 9b e9 ldi r25, 0x9B ; 155 27bba: 0e 94 68 77 call 0xeed0 ; 0xeed0 27bbe: 42 e0 ldi r20, 0x02 ; 2 27bc0: b8 01 movw r22, r16 27bc2: 88 a9 ldd r24, Y+48 ; 0x30 27bc4: 9f a5 ldd r25, Y+47 ; 0x2f 27bc6: 0f 94 42 d5 call 0x3aa84 ; 0x3aa84 } SERIAL_PROTOCOL(input); SERIAL_PROTOCOLPGM(" @:"); 27bca: 87 e0 ldi r24, 0x07 ; 7 27bcc: 9b e9 ldi r25, 0x9B ; 155 27bce: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_PROTOCOLLN(p); 27bd2: c5 01 movw r24, r10 27bd4: 0f 94 b0 74 call 0x2e960 ; 0x2e960 if (safety_check_cycles == 0) { //save ambient temp 27bd8: 4d 81 ldd r20, Y+5 ; 0x05 27bda: 44 23 and r20, r20 27bdc: 09 f4 brne .+2 ; 0x27be0 27bde: 6c c0 rjmp .+216 ; 0x27cb8 temp_ambient = input; //SERIAL_ECHOPGM("Ambient T: "); //MYSERIAL.println(temp_ambient); safety_check_cycles++; } else if (safety_check_cycles < safety_check_cycles_count) { //delay 27be0: 5f 8d ldd r21, Y+31 ; 0x1f 27be2: 45 17 cp r20, r21 27be4: 70 f5 brcc .+92 ; 0x27c42 safety_check_cycles++; 27be6: 4f 5f subi r20, 0xFF ; 255 27be8: 4d 83 std Y+5, r20 ; 0x05 temp_runaway_stop(false, (extruder<0)); pid_tuning_finished = true; return; } } temp_millis = _millis(); 27bea: 0f 94 22 29 call 0x25244 ; 0x25244 27bee: 68 a3 std Y+32, r22 ; 0x20 27bf0: 79 a3 std Y+33, r23 ; 0x21 27bf2: 8a a3 std Y+34, r24 ; 0x22 27bf4: 9b a3 std Y+35, r25 ; 0x23 } if(((_millis() - t1) + (_millis() - t2)) > (10L*60L*1000L*2L)) { 27bf6: 0f 94 22 29 call 0x25244 ; 0x25244 27bfa: 4b 01 movw r8, r22 27bfc: 5c 01 movw r10, r24 27bfe: 0f 94 22 29 call 0x25244 ; 0x25244 27c02: 4e 80 ldd r4, Y+6 ; 0x06 27c04: 5f 80 ldd r5, Y+7 ; 0x07 27c06: 68 84 ldd r6, Y+8 ; 0x08 27c08: 79 84 ldd r7, Y+9 ; 0x09 27c0a: 2e 85 ldd r18, Y+14 ; 0x0e 27c0c: 3f 85 ldd r19, Y+15 ; 0x0f 27c0e: 48 89 ldd r20, Y+16 ; 0x10 27c10: 59 89 ldd r21, Y+17 ; 0x11 27c12: 42 0e add r4, r18 27c14: 53 1e adc r5, r19 27c16: 64 1e adc r6, r20 27c18: 75 1e adc r7, r21 27c1a: 84 18 sub r8, r4 27c1c: 95 08 sbc r9, r5 27c1e: a6 08 sbc r10, r6 27c20: b7 08 sbc r11, r7 27c22: 86 0e add r8, r22 27c24: 97 1e adc r9, r23 27c26: a8 1e adc r10, r24 27c28: b9 1e adc r11, r25 27c2a: 31 e8 ldi r19, 0x81 ; 129 27c2c: 83 16 cp r8, r19 27c2e: 3f e4 ldi r19, 0x4F ; 79 27c30: 93 06 cpc r9, r19 27c32: 32 e1 ldi r19, 0x12 ; 18 27c34: a3 06 cpc r10, r19 27c36: b1 04 cpc r11, r1 27c38: 08 f4 brcc .+2 ; 0x27c3c 27c3a: 47 c0 rjmp .+142 ; 0x27cca SERIAL_PROTOCOLLNPGM("PID Autotune failed! timeout"); 27c3c: 8a ee ldi r24, 0xEA ; 234 27c3e: 9a e9 ldi r25, 0x9A ; 154 27c40: 80 cf rjmp .-256 ; 0x27b42 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 27c42: 8d 81 ldd r24, Y+5 ; 0x05 27c44: 9f 8d ldd r25, Y+31 ; 0x1f 27c46: 89 13 cpse r24, r25 27c48: d0 cf rjmp .-96 ; 0x27bea safety_check_cycles++; 27c4a: 8f 5f subi r24, 0xFF ; 255 27c4c: 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) { 27c4e: 2b a5 ldd r18, Y+43 ; 0x2b 27c50: 3c a5 ldd r19, Y+44 ; 0x2c 27c52: 4d a5 ldd r20, Y+45 ; 0x2d 27c54: 5e a5 ldd r21, Y+46 ; 0x2e 27c56: b8 01 movw r22, r16 27c58: 88 a9 ldd r24, Y+48 ; 0x30 27c5a: 9f a5 ldd r25, Y+47 ; 0x2f 27c5c: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 27c60: 9f 77 andi r25, 0x7F ; 127 27c62: 20 e0 ldi r18, 0x00 ; 0 27c64: 30 e0 ldi r19, 0x00 ; 0 27c66: 40 ea ldi r20, 0xA0 ; 160 27c68: 50 e4 ldi r21, 0x40 ; 64 27c6a: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 27c6e: 87 ff sbrs r24, 7 27c70: bc cf rjmp .-136 ; 0x27bea temp_runaway_stop(false, (extruder<0)); 27c72: 63 2d mov r22, r3 27c74: 66 1f adc r22, r22 27c76: 66 27 eor r22, r22 27c78: 66 1f adc r22, r22 27c7a: 80 e0 ldi r24, 0x00 ; 0 27c7c: 0f 94 10 1f call 0x23e20 ; 0x23e20 pid_tuning_finished = true; 27c80: 81 e0 ldi r24, 0x01 ; 1 27c82: 80 93 3e 02 sts 0x023E, r24 ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.458> pid_cycle = 0; return; } lcd_update(0); } } 27c86: e0 96 adiw r28, 0x30 ; 48 27c88: 0f b6 in r0, 0x3f ; 63 27c8a: f8 94 cli 27c8c: de bf out 0x3e, r29 ; 62 27c8e: 0f be out 0x3f, r0 ; 63 27c90: cd bf out 0x3d, r28 ; 61 27c92: df 91 pop r29 27c94: cf 91 pop r28 27c96: 1f 91 pop r17 27c98: 0f 91 pop r16 27c9a: ff 90 pop r15 27c9c: ef 90 pop r14 27c9e: df 90 pop r13 27ca0: cf 90 pop r12 27ca2: bf 90 pop r11 27ca4: af 90 pop r10 27ca6: 9f 90 pop r9 27ca8: 8f 90 pop r8 27caa: 7f 90 pop r7 27cac: 6f 90 pop r6 27cae: 5f 90 pop r5 27cb0: 4f 90 pop r4 27cb2: 3f 90 pop r3 27cb4: 2f 90 pop r2 27cb6: 08 95 ret SERIAL_PROTOCOL(input); SERIAL_PROTOCOLPGM(" @:"); SERIAL_PROTOCOLLN(p); if (safety_check_cycles == 0) { //save ambient temp temp_ambient = input; 27cb8: 0b a7 std Y+43, r16 ; 0x2b 27cba: 1c a7 std Y+44, r17 ; 0x2c 27cbc: a8 a9 ldd r26, Y+48 ; 0x30 27cbe: ad a7 std Y+45, r26 ; 0x2d 27cc0: bf a5 ldd r27, Y+47 ; 0x2f 27cc2: be a7 std Y+46, r27 ; 0x2e //SERIAL_ECHOPGM("Ambient T: "); //MYSERIAL.println(temp_ambient); safety_check_cycles++; 27cc4: 21 e0 ldi r18, 0x01 ; 1 27cc6: 2d 83 std Y+5, r18 ; 0x05 27cc8: 90 cf rjmp .-224 ; 0x27bea SERIAL_PROTOCOLLNPGM("PID Autotune failed! timeout"); pid_tuning_finished = true; pid_cycle = 0; return; } if(pid_cycle > ncycles) { 27cca: 80 91 48 06 lds r24, 0x0648 ; 0x800648 27cce: 90 91 49 06 lds r25, 0x0649 ; 0x800649 27cd2: 49 a5 ldd r20, Y+41 ; 0x29 27cd4: 5a a5 ldd r21, Y+42 ; 0x2a 27cd6: 48 17 cp r20, r24 27cd8: 59 07 cpc r21, r25 27cda: 1c f4 brge .+6 ; 0x27ce2 SERIAL_PROTOCOLLNPGM("PID Autotune finished! Put the last Kp, Ki and Kd constants from above into Configuration.h"); 27cdc: 8e e8 ldi r24, 0x8E ; 142 27cde: 9a e9 ldi r25, 0x9A ; 154 27ce0: 30 cf rjmp .-416 ; 0x27b42 pid_tuning_finished = true; pid_cycle = 0; return; } lcd_update(0); 27ce2: 80 e0 ldi r24, 0x00 ; 0 27ce4: 0e 94 bf 6e call 0xdd7e ; 0xdd7e 27ce8: e6 cc rjmp .-1588 ; 0x276b6 00027cea : startTimestamp = 0; stopTimestamp = 0; accumulator = 0; } uint32_t Stopwatch::duration() { 27cea: 0f 93 push r16 27cec: 1f 93 push r17 return accumulator + MS_TO_SEC((isRunning() ? _millis() : stopTimestamp) - startTimestamp); 27cee: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 27cf2: 81 30 cpi r24, 0x01 ; 1 27cf4: 19 f5 brne .+70 ; 0x27d3c 27cf6: 0f 94 22 29 call 0x25244 ; 0x25244 27cfa: 00 91 a6 05 lds r16, 0x05A6 ; 0x8005a6 27cfe: 10 91 a7 05 lds r17, 0x05A7 ; 0x8005a7 27d02: 20 91 a8 05 lds r18, 0x05A8 ; 0x8005a8 27d06: 30 91 a9 05 lds r19, 0x05A9 ; 0x8005a9 27d0a: 60 1b sub r22, r16 27d0c: 71 0b sbc r23, r17 27d0e: 82 0b sbc r24, r18 27d10: 93 0b sbc r25, r19 27d12: 28 ee ldi r18, 0xE8 ; 232 27d14: 33 e0 ldi r19, 0x03 ; 3 27d16: 40 e0 ldi r20, 0x00 ; 0 27d18: 50 e0 ldi r21, 0x00 ; 0 27d1a: 0f 94 4a dc call 0x3b894 ; 0x3b894 <__udivmodsi4> 27d1e: 60 91 a2 05 lds r22, 0x05A2 ; 0x8005a2 27d22: 70 91 a3 05 lds r23, 0x05A3 ; 0x8005a3 27d26: 80 91 a4 05 lds r24, 0x05A4 ; 0x8005a4 27d2a: 90 91 a5 05 lds r25, 0x05A5 ; 0x8005a5 27d2e: 62 0f add r22, r18 27d30: 73 1f adc r23, r19 27d32: 84 1f adc r24, r20 27d34: 95 1f adc r25, r21 } 27d36: 1f 91 pop r17 27d38: 0f 91 pop r16 27d3a: 08 95 ret stopTimestamp = 0; accumulator = 0; } uint32_t Stopwatch::duration() { return accumulator + MS_TO_SEC((isRunning() ? _millis() : stopTimestamp) - startTimestamp); 27d3c: 60 91 51 06 lds r22, 0x0651 ; 0x800651 27d40: 70 91 52 06 lds r23, 0x0652 ; 0x800652 27d44: 80 91 53 06 lds r24, 0x0653 ; 0x800653 27d48: 90 91 54 06 lds r25, 0x0654 ; 0x800654 27d4c: d6 cf rjmp .-84 ; 0x27cfa 00027d4e : //! |Total print time: | MSG_TOTAL_PRINT_TIME c=19 //! | 00d 00h 00m | //! ---------------------- //! @endcode void lcd_menu_statistics() { 27d4e: 4f 92 push r4 27d50: 5f 92 push r5 27d52: 6f 92 push r6 27d54: 7f 92 push r7 27d56: 8f 92 push r8 27d58: 9f 92 push r9 27d5a: af 92 push r10 27d5c: bf 92 push r11 27d5e: cf 92 push r12 27d60: df 92 push r13 27d62: ef 92 push r14 27d64: ff 92 push r15 27d66: 0f 93 push r16 27d68: 1f 93 push r17 27d6a: cf 93 push r28 27d6c: df 93 push r29 27d6e: 10 92 da 03 sts 0x03DA, r1 ; 0x8003da lcd_timeoutToStatus.stop(); //infinite timeout if (printJobOngoing()) 27d72: 0e 94 a8 67 call 0xcf50 ; 0xcf50 27d76: 88 23 and r24, r24 27d78: 09 f4 brne .+2 ; 0x27d7c 27d7a: 6e c0 rjmp .+220 ; 0x27e58 { const float _met = ((float)total_filament_used) / (100000.f); 27d7c: 60 91 64 06 lds r22, 0x0664 ; 0x800664 27d80: 70 91 65 06 lds r23, 0x0665 ; 0x800665 27d84: 80 91 66 06 lds r24, 0x0666 ; 0x800666 27d88: 90 91 67 06 lds r25, 0x0667 ; 0x800667 27d8c: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 27d90: 20 e0 ldi r18, 0x00 ; 0 27d92: 30 e5 ldi r19, 0x50 ; 80 27d94: 43 ec ldi r20, 0xC3 ; 195 27d96: 57 e4 ldi r21, 0x47 ; 71 27d98: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 27d9c: 56 2e mov r5, r22 27d9e: 47 2e mov r4, r23 27da0: ec 01 movw r28, r24 const uint32_t _t = print_job_timer.duration(); 27da2: 0f 94 75 3e call 0x27cea ; 0x27cea 27da6: 6b 01 movw r12, r22 27da8: 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(); 27daa: 0e 94 24 6f call 0xde48 ; 0xde48 lcd_printf_P(_N( 27dae: 8d ef ldi r24, 0xFD ; 253 27db0: 90 e5 ldi r25, 0x50 ; 80 27db2: 0e 94 c4 72 call 0xe588 ; 0xe588 27db6: 18 2f mov r17, r24 27db8: 09 2f mov r16, r25 27dba: 8d ee ldi r24, 0xED ; 237 27dbc: 90 e5 ldi r25, 0x50 ; 80 27dbe: 0e 94 c4 72 call 0xe588 ; 0xe588 27dc2: 78 2e mov r7, r24 27dc4: 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; 27dc6: 8c e3 ldi r24, 0x3C ; 60 27dc8: 88 2e mov r8, r24 27dca: 91 2c mov r9, r1 27dcc: a1 2c mov r10, r1 27dce: b1 2c mov r11, r1 27dd0: c7 01 movw r24, r14 27dd2: b6 01 movw r22, r12 27dd4: a5 01 movw r20, r10 27dd6: 94 01 movw r18, r8 27dd8: 0f 94 4a dc call 0x3b894 ; 0x3b894 <__udivmodsi4> lcd_home(); lcd_printf_P(_N( 27ddc: 7f 93 push r23 27dde: 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; 27de0: ca 01 movw r24, r20 27de2: b9 01 movw r22, r18 27de4: a5 01 movw r20, r10 27de6: 94 01 movw r18, r8 27de8: 0f 94 4a dc call 0x3b894 ; 0x3b894 <__udivmodsi4> const uint8_t _s = _t % 60; lcd_home(); lcd_printf_P(_N( 27dec: 7f 93 push r23 27dee: 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; 27df0: c7 01 movw r24, r14 27df2: b6 01 movw r22, r12 27df4: 20 e1 ldi r18, 0x10 ; 16 27df6: 3e e0 ldi r19, 0x0E ; 14 27df8: 40 e0 ldi r20, 0x00 ; 0 27dfa: 50 e0 ldi r21, 0x00 ; 0 27dfc: 0f 94 4a dc call 0x3b894 ; 0x3b894 <__udivmodsi4> const uint8_t _m = (_t / 60) % 60; const uint8_t _s = _t % 60; lcd_home(); lcd_printf_P(_N( 27e00: 5f 93 push r21 27e02: 4f 93 push r20 27e04: 3f 93 push r19 27e06: 2f 93 push r18 27e08: 0f 93 push r16 27e0a: 1f 93 push r17 27e0c: df 93 push r29 27e0e: cf 93 push r28 27e10: 4f 92 push r4 27e12: 5f 92 push r5 27e14: 6f 92 push r6 27e16: 7f 92 push r7 27e18: 8f eb ldi r24, 0xBF ; 191 27e1a: 9f e6 ldi r25, 0x6F ; 111 27e1c: 9f 93 push r25 27e1e: 8f 93 push r24 27e20: 0e 94 d1 6e call 0xdda2 ; 0xdda2 "%S:\n" "%10ldh %02dm %02ds" ), _T(MSG_FILAMENT_USED), _met, _T(MSG_PRINT_TIME), _h, _m, _s); menu_back_if_clicked(); 27e24: 8d b7 in r24, 0x3d ; 61 27e26: 9e b7 in r25, 0x3e ; 62 27e28: 42 96 adiw r24, 0x12 ; 18 27e2a: 0f b6 in r0, 0x3f ; 63 27e2c: f8 94 cli 27e2e: 9e bf out 0x3e, r25 ; 62 27e30: 0f be out 0x3f, r0 ; 63 27e32: 8d bf out 0x3d, r24 ; 61 ), _T(MSG_TOTAL_FILAMENT), _filament_m, _T(MSG_TOTAL_PRINT_TIME), _days, _hours, _minutes); menu_back_if_clicked(); } } 27e34: df 91 pop r29 27e36: cf 91 pop r28 27e38: 1f 91 pop r17 27e3a: 0f 91 pop r16 27e3c: ff 90 pop r15 27e3e: ef 90 pop r14 27e40: df 90 pop r13 27e42: cf 90 pop r12 27e44: bf 90 pop r11 27e46: af 90 pop r10 27e48: 9f 90 pop r9 27e4a: 8f 90 pop r8 27e4c: 7f 90 pop r7 27e4e: 6f 90 pop r6 27e50: 5f 90 pop r5 27e52: 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(); 27e54: 0d 94 bb d4 jmp 0x3a976 ; 0x3a976 _T(MSG_PRINT_TIME), _h, _m, _s); menu_back_if_clicked(); } else { uint32_t _filament = eeprom_read_dword((uint32_t *)EEPROM_FILAMENTUSED); // in meters 27e58: 81 ef ldi r24, 0xF1 ; 241 27e5a: 9f e0 ldi r25, 0x0F ; 15 27e5c: 0f 94 df db call 0x3b7be ; 0x3b7be 27e60: 2b 01 movw r4, r22 27e62: 3c 01 movw r6, r24 uint32_t _time = eeprom_read_dword((uint32_t *)EEPROM_TOTALTIME); // in minutes 27e64: 8d ee ldi r24, 0xED ; 237 27e66: 9f e0 ldi r25, 0x0F ; 15 27e68: 0f 94 df db call 0x3b7be ; 0x3b7be 27e6c: 6b 01 movw r12, r22 27e6e: 7c 01 movw r14, r24 float _filament_m = (float)_filament/100; _days = (_time / 60) / 24; _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); 27e70: 0e 94 24 6f call 0xde48 ; 0xde48 lcd_printf_P(_N( 27e74: 8a ed ldi r24, 0xDA ; 218 27e76: 90 e5 ldi r25, 0x50 ; 80 27e78: 0e 94 c4 72 call 0xe588 ; 0xe588 27e7c: 98 2e mov r9, r24 27e7e: 89 2e mov r8, r25 27e80: 89 ec ldi r24, 0xC9 ; 201 27e82: 90 e5 ldi r25, 0x50 ; 80 27e84: 0e 94 c4 72 call 0xe588 ; 0xe588 27e88: b8 2e mov r11, r24 27e8a: 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; 27e8c: c7 01 movw r24, r14 27e8e: b6 01 movw r22, r12 27e90: 2c e3 ldi r18, 0x3C ; 60 27e92: 30 e0 ldi r19, 0x00 ; 0 27e94: 40 e0 ldi r20, 0x00 ; 0 27e96: 50 e0 ldi r21, 0x00 ; 0 27e98: 0f 94 4a dc call 0x3b894 ; 0x3b894 <__udivmodsi4> lcd_home(); lcd_printf_P(_N( 27e9c: 7f 93 push r23 27e9e: 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; 27ea0: ca 01 movw r24, r20 27ea2: b9 01 movw r22, r18 27ea4: 28 e1 ldi r18, 0x18 ; 24 27ea6: 30 e0 ldi r19, 0x00 ; 0 27ea8: 40 e0 ldi r20, 0x00 ; 0 27eaa: 50 e0 ldi r21, 0x00 ; 0 27eac: 0f 94 4a dc call 0x3b894 ; 0x3b894 <__udivmodsi4> _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 27eb0: 7f 93 push r23 27eb2: 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; 27eb4: c7 01 movw r24, r14 27eb6: b6 01 movw r22, r12 27eb8: 20 ea ldi r18, 0xA0 ; 160 27eba: 35 e0 ldi r19, 0x05 ; 5 27ebc: 40 e0 ldi r20, 0x00 ; 0 27ebe: 50 e0 ldi r21, 0x00 ; 0 27ec0: 0f 94 4a dc call 0x3b894 ; 0x3b894 <__udivmodsi4> _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 27ec4: 5f 93 push r21 27ec6: 4f 93 push r20 27ec8: 3f 93 push r19 27eca: 2f 93 push r18 27ecc: 8f 92 push r8 27ece: 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; 27ed0: c3 01 movw r24, r6 27ed2: b2 01 movw r22, r4 27ed4: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 27ed8: 20 e0 ldi r18, 0x00 ; 0 27eda: 30 e0 ldi r19, 0x00 ; 0 27edc: 48 ec ldi r20, 0xC8 ; 200 27ede: 52 e4 ldi r21, 0x42 ; 66 27ee0: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> _days = (_time / 60) / 24; _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 27ee4: 9f 93 push r25 27ee6: 8f 93 push r24 27ee8: 7f 93 push r23 27eea: 6f 93 push r22 27eec: af 92 push r10 27eee: bf 92 push r11 27ef0: 8b e9 ldi r24, 0x9B ; 155 27ef2: 9f e6 ldi r25, 0x6F ; 111 27ef4: 9f 93 push r25 27ef6: 8f 93 push r24 27ef8: 0e 94 d1 6e call 0xdda2 ; 0xdda2 "%S:\n" "%10ldd %02dh %02dm" ), _T(MSG_TOTAL_FILAMENT), _filament_m, _T(MSG_TOTAL_PRINT_TIME), _days, _hours, _minutes); menu_back_if_clicked(); 27efc: 8d b7 in r24, 0x3d ; 61 27efe: 9e b7 in r25, 0x3e ; 62 27f00: 42 96 adiw r24, 0x12 ; 18 27f02: 0f b6 in r0, 0x3f ; 63 27f04: f8 94 cli 27f06: 9e bf out 0x3e, r25 ; 62 27f08: 0f be out 0x3f, r0 ; 63 27f0a: 8d bf out 0x3d, r24 ; 61 27f0c: 93 cf rjmp .-218 ; 0x27e34 00027f0e : 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()") { 27f0e: cf 92 push r12 27f10: df 92 push r13 27f12: ef 92 push r14 27f14: ff 92 push r15 27f16: 0f 93 push r16 27f18: 1f 93 push r17 27f1a: cf 93 push r28 27f1c: df 93 push r29 27f1e: 00 d0 rcall .+0 ; 0x27f20 27f20: 00 d0 rcall .+0 ; 0x27f22 27f22: 1f 92 push r1 27f24: 1f 92 push r1 27f26: cd b7 in r28, 0x3d ; 61 27f28: de b7 in r29, 0x3e ; 62 static uint8_t lcd_status_update_delay = 0; #ifdef ULTIPANEL_FEEDMULTIPLY if (lcd_encoder) 27f2a: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 27f2e: 90 91 70 06 lds r25, 0x0670 ; 0x800670 27f32: 00 97 sbiw r24, 0x00 ; 0 27f34: e1 f1 breq .+120 ; 0x27fae { const int16_t initial_feedmultiply = feedmultiply; 27f36: 20 91 39 02 lds r18, 0x0239 ; 0x800239 27f3a: 30 91 3a 02 lds r19, 0x023A ; 0x80023a // Dead zone at 100% feedrate if ((feedmultiply < 100 && (feedmultiply + lcd_encoder) > 100) || 27f3e: 24 36 cpi r18, 0x64 ; 100 27f40: 31 05 cpc r19, r1 27f42: 4c f4 brge .+18 ; 0x27f56 27f44: ac 01 movw r20, r24 27f46: 42 0f add r20, r18 27f48: 53 1f adc r21, r19 27f4a: 45 36 cpi r20, 0x65 ; 101 27f4c: 51 05 cpc r21, r1 27f4e: 6c f4 brge .+26 ; 0x27f6a 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; 27f50: 82 0f add r24, r18 27f52: 93 1f adc r25, r19 27f54: 0c c0 rjmp .+24 ; 0x27f6e #ifdef ULTIPANEL_FEEDMULTIPLY if (lcd_encoder) { const int16_t initial_feedmultiply = feedmultiply; // Dead zone at 100% feedrate if ((feedmultiply < 100 && (feedmultiply + lcd_encoder) > 100) || 27f56: 24 36 cpi r18, 0x64 ; 100 27f58: 31 05 cpc r19, r1 27f5a: 09 f4 brne .+2 ; 0x27f5e 27f5c: 55 c0 rjmp .+170 ; 0x28008 (feedmultiply > 100 && (feedmultiply + lcd_encoder) < 100)) 27f5e: ac 01 movw r20, r24 27f60: 42 0f add r20, r18 27f62: 53 1f adc r21, r19 27f64: 44 36 cpi r20, 0x64 ; 100 27f66: 51 05 cpc r21, r1 27f68: 9c f7 brge .-26 ; 0x27f50 { feedmultiply = 100; 27f6a: 84 e6 ldi r24, 0x64 ; 100 27f6c: 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; 27f6e: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a 27f72: 80 93 39 02 sts 0x0239, r24 ; 0x800239 if (initial_feedmultiply != feedmultiply) { 27f76: 80 91 39 02 lds r24, 0x0239 ; 0x800239 27f7a: 90 91 3a 02 lds r25, 0x023A ; 0x80023a 27f7e: 82 17 cp r24, r18 27f80: 93 07 cpc r25, r19 27f82: a9 f0 breq .+42 ; 0x27fae feedmultiply = constrain(feedmultiply, 10, 999); 27f84: 88 3e cpi r24, 0xE8 ; 232 27f86: 53 e0 ldi r21, 0x03 ; 3 27f88: 95 07 cpc r25, r21 27f8a: 14 f0 brlt .+4 ; 0x27f90 27f8c: 87 ee ldi r24, 0xE7 ; 231 27f8e: 93 e0 ldi r25, 0x03 ; 3 27f90: 8a 30 cpi r24, 0x0A ; 10 27f92: 91 05 cpc r25, r1 27f94: 14 f4 brge .+4 ; 0x27f9a 27f96: 8a e0 ldi r24, 0x0A ; 10 27f98: 90 e0 ldi r25, 0x00 ; 0 27f9a: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a 27f9e: 80 93 39 02 sts 0x0239, r24 ; 0x800239 lcd_encoder = 0; // Consume rotation event 27fa2: 10 92 70 06 sts 0x0670, r1 ; 0x800670 27fa6: 10 92 6f 06 sts 0x066F, r1 ; 0x80066f refresh_saved_feedrate_multiplier_in_ram(); 27faa: 0e 94 fb 64 call 0xc9f6 ; 0xc9f6 } } #endif //ULTIPANEL_FEEDMULTIPLY if (lcd_draw_update) { 27fae: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 27fb2: 81 11 cpse r24, r1 // Update the status screen immediately lcd_status_update_delay = 0; 27fb4: 10 92 50 06 sts 0x0650, r1 ; 0x800650 } if (lcd_status_update_delay) 27fb8: 10 91 50 06 lds r17, 0x0650 ; 0x800650 27fbc: 11 23 and r17, r17 27fbe: 91 f1 breq .+100 ; 0x28024 lcd_status_update_delay--; 27fc0: 2f ef ldi r18, 0xFF ; 255 27fc2: 21 0f add r18, r17 27fc4: 20 93 50 06 sts 0x0650, r18 ; 0x800650 if (lcd_commands_type != LcdCommands::Idle) lcd_commands(); } if (!menu_is_any_block() && lcd_clicked()) { 27fc8: 80 91 d4 03 lds r24, 0x03D4 ; 0x8003d4 27fcc: 81 11 cpse r24, r1 27fce: 0d c0 rjmp .+26 ; 0x27fea 27fd0: 0e 94 15 71 call 0xe22a ; 0xe22a 27fd4: 88 23 and r24, r24 27fd6: 49 f0 breq .+18 ; 0x27fea menu_depth = 0; //redundant, as already done in lcd_return_to_status(), just to be sure 27fd8: 10 92 f7 03 sts 0x03F7, r1 ; 0x8003f7 menu_submenu(lcd_main_menu); 27fdc: 60 e0 ldi r22, 0x00 ; 0 27fde: 8e ee ldi r24, 0xEE ; 238 27fe0: 94 ed ldi r25, 0xD4 ; 212 27fe2: 0f 94 be d2 call 0x3a57c ; 0x3a57c lcd_refresh(); // to maybe revive the LCD if static electricity killed it. 27fe6: 0e 94 a4 6f call 0xdf48 ; 0xdf48 } } 27fea: 28 96 adiw r28, 0x08 ; 8 27fec: 0f b6 in r0, 0x3f ; 63 27fee: f8 94 cli 27ff0: de bf out 0x3e, r29 ; 62 27ff2: 0f be out 0x3f, r0 ; 63 27ff4: cd bf out 0x3d, r28 ; 61 27ff6: df 91 pop r29 27ff8: cf 91 pop r28 27ffa: 1f 91 pop r17 27ffc: 0f 91 pop r16 27ffe: ff 90 pop r15 28000: ef 90 pop r14 28002: df 90 pop r13 28004: cf 90 pop r12 28006: 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) { 28008: 8b 30 cpi r24, 0x0B ; 11 2800a: 91 05 cpc r25, r1 2800c: 1c f0 brlt .+6 ; 0x28014 feedmultiply += lcd_encoder - ENCODER_FEEDRATE_DEADZONE; 2800e: 86 5a subi r24, 0xA6 ; 166 28010: 9f 4f sbci r25, 0xFF ; 255 28012: ad cf rjmp .-166 ; 0x27f6e } else if (feedmultiply == 100 && lcd_encoder < -ENCODER_FEEDRATE_DEADZONE) { 28014: 86 3f cpi r24, 0xF6 ; 246 28016: 4f ef ldi r20, 0xFF ; 255 28018: 94 07 cpc r25, r20 2801a: 0c f0 brlt .+2 ; 0x2801e 2801c: ac cf rjmp .-168 ; 0x27f76 feedmultiply += lcd_encoder + ENCODER_FEEDRATE_DEADZONE; 2801e: 82 59 subi r24, 0x92 ; 146 28020: 9f 4f sbci r25, 0xFF ; 255 28022: a5 cf rjmp .-182 ; 0x27f6e 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; 28024: 6a e0 ldi r22, 0x0A ; 10 28026: 60 93 50 06 sts 0x0650, r22 ; 0x800650 ReInitLCD++; 2802a: 80 91 4f 06 lds r24, 0x064F ; 0x80064f 2802e: 8f 5f subi r24, 0xFF ; 255 28030: 80 93 4f 06 sts 0x064F, r24 ; 0x80064f if (ReInitLCD == 30) 28034: 8e 31 cpi r24, 0x1E ; 30 28036: 09 f0 breq .+2 ; 0x2803a 28038: 9f c0 rjmp .+318 ; 0x28178 { ReInitLCD = 0 ; 2803a: 10 92 4f 06 sts 0x064F, r1 ; 0x80064f #endif //DEBUG_DISABLE_LCD_STATUS_LINE } static void lcdui_refresh(uint8_t clear = true) { clear ? lcd_refresh() : lcd_refresh_noclear(); 2803e: 0e 94 a4 6f call 0xdf48 ; 0xdf48 lcd_status_message_idx = 0; // Re-draw message from beginning 28042: 10 92 1d 05 sts 0x051D, r1 ; 0x80051d <_ZL22lcd_status_message_idx.lto_priv.448> //! F - feedrate symbol LCD_STR_FEEDRATE //! t - clock symbol LCD_STR_THERMOMETER //! @endcode void lcdui_print_status_screen(void) { lcd_frame_start(); 28046: 0e 94 ac 6e call 0xdd58 ; 0xdd58 lcd_home(); //line 0 2804a: 0e 94 24 6f call 0xde48 ; 0xde48 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 2804e: 60 91 b5 0d lds r22, 0x0DB5 ; 0x800db5 28052: 70 91 b6 0d lds r23, 0x0DB6 ; 0x800db6 28056: 07 2e mov r0, r23 28058: 00 0c add r0, r0 2805a: 88 0b sbc r24, r24 2805c: 99 0b sbc r25, r25 2805e: 0f 94 65 d6 call 0x3acca ; 0x3acca <__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)); 28062: 20 e0 ldi r18, 0x00 ; 0 28064: 30 e0 ldi r19, 0x00 ; 0 28066: 40 e0 ldi r20, 0x00 ; 0 28068: 5f e3 ldi r21, 0x3F ; 63 2806a: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 2806e: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> 28072: 6b 01 movw r12, r22 28074: 20 e0 ldi r18, 0x00 ; 0 28076: 30 e0 ldi r19, 0x00 ; 0 28078: 40 e0 ldi r20, 0x00 ; 0 2807a: 5f e3 ldi r21, 0x3F ; 63 2807c: 60 91 af 0d lds r22, 0x0DAF ; 0x800daf 28080: 70 91 b0 0d lds r23, 0x0DB0 ; 0x800db0 28084: 80 91 b1 0d lds r24, 0x0DB1 ; 0x800db1 28088: 90 91 b2 0d lds r25, 0x0DB2 ; 0x800db2 2808c: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 28090: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> 28094: a6 01 movw r20, r12 28096: 82 e8 ldi r24, 0x82 ; 130 28098: 0f 94 4f 21 call 0x2429e ; 0x2429e lcd_space(3); //3 spaces 2809c: 83 e0 ldi r24, 0x03 ; 3 2809e: 0e 94 ee 6e call 0xdddc ; 0xdddc } // Print Z-coordinate (8 chars total) void lcdui_print_Z_coord(void) { if (custom_message_type == CustomMsg::MeshBedLeveling) 280a2: 80 91 c3 06 lds r24, 0x06C3 ; 0x8006c3 280a6: 81 30 cpi r24, 0x01 ; 1 280a8: 09 f0 breq .+2 ; 0x280ac 280aa: 6e c0 rjmp .+220 ; 0x28188 lcd_puts_P(_N("Z --- ")); 280ac: 81 ef ldi r24, 0xF1 ; 241 280ae: 9e e6 ldi r25, 0x6E ; 110 280b0: 0e 94 e3 6e call 0xddc6 ; 0xddc6 lcd_space(3); //3 spaces //Print Z-coordinate (8 chars total) lcdui_print_Z_coord(); lcd_set_cursor(0, 1); //line 1 280b4: 61 e0 ldi r22, 0x01 ; 1 280b6: 80 e0 ldi r24, 0x00 ; 0 280b8: 0e 94 f8 6e call 0xddf0 ; 0xddf0 }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; 280bc: 60 91 71 06 lds r22, 0x0671 ; 0x800671 280c0: 70 91 72 06 lds r23, 0x0672 ; 0x800672 280c4: 07 2e mov r0, r23 280c6: 00 0c add r0, r0 280c8: 88 0b sbc r24, r24 280ca: 99 0b sbc r25, r25 280cc: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> //Print the Bed temperature (9 chars total) lcdui_print_temp(LCD_STR_BEDTEMP[0], (int)(degBed() + 0.5), (int)(degTargetBed() + 0.5)); 280d0: 20 e0 ldi r18, 0x00 ; 0 280d2: 30 e0 ldi r19, 0x00 ; 0 280d4: 40 e0 ldi r20, 0x00 ; 0 280d6: 5f e3 ldi r21, 0x3F ; 63 280d8: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 280dc: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> 280e0: 6b 01 movw r12, r22 280e2: 20 e0 ldi r18, 0x00 ; 0 280e4: 30 e0 ldi r19, 0x00 ; 0 280e6: 40 e0 ldi r20, 0x00 ; 0 280e8: 5f e3 ldi r21, 0x3F ; 63 280ea: 60 91 ed 04 lds r22, 0x04ED ; 0x8004ed 280ee: 70 91 ee 04 lds r23, 0x04EE ; 0x8004ee 280f2: 80 91 ef 04 lds r24, 0x04EF ; 0x8004ef 280f6: 90 91 f0 04 lds r25, 0x04F0 ; 0x8004f0 280fa: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 280fe: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> 28102: a6 01 movw r20, r12 28104: 80 e8 ldi r24, 0x80 ; 128 28106: 0f 94 4f 21 call 0x2429e ; 0x2429e lcd_space(3); //3 spaces 2810a: 83 e0 ldi r24, 0x03 ; 3 2810c: 0e 94 ee 6e call 0xdddc ; 0xdddc #endif // PLANNER_DIAGNOSTICS // Print feedrate (8 chars total) void lcdui_print_feedrate(void) { int chars = lcd_printf_P(_N(LCD_STR_FEEDRATE "%3d%%"), feedmultiply); 28110: 80 91 3a 02 lds r24, 0x023A ; 0x80023a 28114: 8f 93 push r24 28116: 80 91 39 02 lds r24, 0x0239 ; 0x800239 2811a: 8f 93 push r24 2811c: 8a ef ldi r24, 0xFA ; 250 2811e: 9e e6 ldi r25, 0x6E ; 110 28120: 9f 93 push r25 28122: 8f 93 push r24 28124: 0e 94 d1 6e call 0xdda2 ; 0xdda2 lcd_space(8 - chars); 28128: 98 e0 ldi r25, 0x08 ; 8 2812a: 98 1b sub r25, r24 2812c: 89 2f mov r24, r25 2812e: 0e 94 ee 6e call 0xdddc ; 0xdddc #else // PLANNER_DIAGNOSTICS //Print Feedrate (8 chars) lcdui_print_feedrate(); #endif // PLANNER_DIAGNOSTICS lcd_set_cursor(0, 2); //line 2 28132: 62 e0 ldi r22, 0x02 ; 2 28134: 80 e0 ldi r24, 0x00 ; 0 28136: 0e 94 f8 6e call 0xddf0 ; 0xddf0 } // 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(" ")); 2813a: 0f 90 pop r0 2813c: 0f 90 pop r0 2813e: 0f 90 pop r0 28140: 0f 90 pop r0 28142: 80 91 0d 05 lds r24, 0x050D ; 0x80050d 28146: e0 90 8f 14 lds r14, 0x148F ; 0x80148f 2814a: 81 11 cpse r24, r1 2814c: 3e c0 rjmp .+124 ; 0x281ca 2814e: 2d e0 ldi r18, 0x0D ; 13 28150: c2 2e mov r12, r18 28152: 2f e6 ldi r18, 0x6F ; 111 28154: d2 2e mov r13, r18 28156: e1 10 cpse r14, r1 28158: 3c c0 rjmp .+120 ; 0x281d2 2815a: 81 e1 ldi r24, 0x11 ; 17 2815c: c8 2e mov r12, r24 2815e: 8f e6 ldi r24, 0x6F ; 111 28160: d8 2e mov r13, r24 bool num = IS_SD_PRINTING || (printer_active() && (print_percent_done_normal != PRINT_PERCENT_DONE_INIT)); 28162: 0e 94 f9 67 call 0xcff2 ; 0xcff2 28166: f8 2e mov r15, r24 28168: 88 23 and r24, r24 2816a: e1 f1 breq .+120 ; 0x281e4 2816c: 80 91 ae 02 lds r24, 0x02AE ; 0x8002ae 28170: 8f 3f cpi r24, 0xFF ; 255 28172: 89 f5 brne .+98 ; 0x281d6 28174: f1 2c mov r15, r1 28176: 36 c0 rjmp .+108 ; 0x281e4 ReInitLCD = 0 ; lcdui_refresh(); } else { if ((ReInitLCD % 10) == 0) 28178: 0f 94 92 dc call 0x3b924 ; 0x3b924 <__divmodqi4> 2817c: 91 11 cpse r25, r1 2817e: 63 cf rjmp .-314 ; 0x28046 lcd_begin(1); } void lcd_refresh_noclear(void) { lcd_begin(0); 28180: 80 e0 ldi r24, 0x00 ; 0 28182: 0e 94 63 6f call 0xdec6 ; 0xdec6 28186: 5d cf rjmp .-326 ; 0x28042 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]?' ':'?'); 28188: 80 91 90 06 lds r24, 0x0690 ; 0x800690 2818c: 88 23 and r24, r24 2818e: d9 f0 breq .+54 ; 0x281c6 28190: 80 e2 ldi r24, 0x20 ; 32 28192: 1f 92 push r1 28194: 8f 93 push r24 28196: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 2819a: 8f 93 push r24 2819c: 80 91 9b 06 lds r24, 0x069B ; 0x80069b 281a0: 8f 93 push r24 281a2: 80 91 9a 06 lds r24, 0x069A ; 0x80069a 281a6: 8f 93 push r24 281a8: 80 91 99 06 lds r24, 0x0699 ; 0x800699 281ac: 8f 93 push r24 281ae: 88 ee ldi r24, 0xE8 ; 232 281b0: 9e e6 ldi r25, 0x6E ; 110 281b2: 9f 93 push r25 281b4: 8f 93 push r24 281b6: 0e 94 d1 6e call 0xdda2 ; 0xdda2 281ba: 0f b6 in r0, 0x3f ; 63 281bc: f8 94 cli 281be: de bf out 0x3e, r29 ; 62 281c0: 0f be out 0x3f, r0 ; 63 281c2: cd bf out 0x3d, r28 ; 61 281c4: 77 cf rjmp .-274 ; 0x280b4 281c6: 8f e3 ldi r24, 0x3F ; 63 281c8: e4 cf rjmp .-56 ; 0x28192 } // 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(" ")); 281ca: 95 e1 ldi r25, 0x15 ; 21 281cc: c9 2e mov r12, r25 281ce: 9f e6 ldi r25, 0x6F ; 111 281d0: d9 2e mov r13, r25 bool num = IS_SD_PRINTING || (printer_active() && (print_percent_done_normal != PRINT_PERCENT_DONE_INIT)); 281d2: ee 20 and r14, r14 281d4: 31 f2 breq .-116 ; 0x28162 if (!num || heating_status != HeatingStatus::NO_HEATING) // either not printing or heating 281d6: 80 91 e1 03 lds r24, 0x03E1 ; 0x8003e1 // 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)); 281da: ff 24 eor r15, r15 281dc: f3 94 inc r15 if (!num || heating_status != HeatingStatus::NO_HEATING) // either not printing or heating 281de: 88 23 and r24, r24 281e0: 09 f4 brne .+2 ; 0x281e4 281e2: bb c0 rjmp .+374 ; 0x2835a { const int8_t sheetNR = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 281e4: 81 ea ldi r24, 0xA1 ; 161 281e6: 9d e0 ldi r25, 0x0D ; 13 281e8: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 281ec: 08 2f mov r16, r24 const int8_t nextSheet = eeprom_next_initialized_sheet(sheetNR); 281ee: 0e 94 67 76 call 0xecce ; 0xecce if ((nextSheet >= 0) && (sheetNR != nextSheet)) 281f2: 87 fd sbrc r24, 7 281f4: b2 c0 rjmp .+356 ; 0x2835a 281f6: 08 17 cp r16, r24 281f8: 09 f4 brne .+2 ; 0x281fc 281fa: af c0 rjmp .+350 ; 0x2835a { char sheet[8]; eeprom_read_block(sheet, EEPROM_Sheets_base->s[sheetNR].name, 7); 281fc: 9b e0 ldi r25, 0x0B ; 11 281fe: 09 02 muls r16, r25 28200: b0 01 movw r22, r0 28202: 11 24 eor r1, r1 28204: 67 5b subi r22, 0xB7 ; 183 28206: 72 4f sbci r23, 0xF2 ; 242 28208: 47 e0 ldi r20, 0x07 ; 7 2820a: 50 e0 ldi r21, 0x00 ; 0 2820c: 8e 01 movw r16, r28 2820e: 0f 5f subi r16, 0xFF ; 255 28210: 1f 4f sbci r17, 0xFF ; 255 28212: c8 01 movw r24, r16 28214: 0f 94 c7 db call 0x3b78e ; 0x3b78e sheet[7] = '\0'; 28218: 18 86 std Y+8, r1 ; 0x08 lcd_printf_P(PSTR("%-7s"),sheet); 2821a: 1f 93 push r17 2821c: 0f 93 push r16 2821e: 89 eb ldi r24, 0xB9 ; 185 28220: 90 ea ldi r25, 0xA0 ; 160 lcd_print(hostName); // Two characters } else { lcd_printf_P(PSTR("%3S"), src); } lcd_printf_P(num ? _N("%3d%%"):_N("---%%"), calc_percent_done()); 28222: 9f 93 push r25 28224: 8f 93 push r24 28226: 0e 94 d1 6e call 0xdda2 ; 0xdda2 2822a: 0f 90 pop r0 2822c: 0f 90 pop r0 2822e: 0f 90 pop r0 28230: 0f 90 pop r0 lcd_set_cursor(0, 2); //line 2 //Print SD status (7 chars) lcdui_print_percent_done(); if (MMU2::mmu2.Enabled()) { 28232: 80 91 b9 13 lds r24, 0x13B9 ; 0x8013b9 28236: 81 30 cpi r24, 0x01 ; 1 28238: 09 f0 breq .+2 ; 0x2823c 2823a: e9 c0 rjmp .+466 ; 0x2840e // Print extruder status (5 chars) lcd_space(5 - lcdui_print_extruder()); 2823c: 0f 94 1e 21 call 0x2423c ; 0x2423c 28240: 95 e0 ldi r25, 0x05 ; 5 28242: 98 1b sub r25, r24 28244: 89 2f mov r24, r25 } else if (farm_mode) { // Print farm number (5 chars) lcdui_print_farm(); } else { lcd_space(5); // 5 spaces 28246: 0e 94 ee 6e call 0xdddc ; 0xdddc 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()) { 2824a: 0e 94 f9 67 call 0xcff2 ; 0xcff2 2824e: 88 23 and r24, r24 28250: 09 f4 brne .+2 ; 0x28254 28252: fa c0 rjmp .+500 ; 0x28448 uint16_t print_tc = PRINT_TIME_REMAINING_INIT; // unit: minutes char suff = ' '; char suff_doubt = ' '; #ifdef TMC2130 if (SilentModeMenu != SILENT_MODE_OFF) { 28254: 80 91 a2 03 lds r24, 0x03A2 ; 0x8003a2 28258: 88 23 and r24, r24 2825a: 09 f4 brne .+2 ; 0x2825e 2825c: da c0 rjmp .+436 ; 0x28412 if (print_time_remaining_silent != PRINT_TIME_REMAINING_INIT) 2825e: c0 90 b5 02 lds r12, 0x02B5 ; 0x8002b5 28262: d0 90 b6 02 lds r13, 0x02B6 ; 0x8002b6 print_tr = print_time_remaining_silent; //#ifdef CLOCK_INTERVAL_TIME if (print_time_to_change_silent != PRINT_TIME_REMAINING_INIT) 28266: e0 90 b3 02 lds r14, 0x02B3 ; 0x8002b3 2826a: f0 90 b4 02 lds r15, 0x02B4 ; 0x8002b4 #ifdef TMC2130 } #endif //TMC2130 //#ifdef CLOCK_INTERVAL_TIME if (clock_interval == CLOCK_INTERVAL_TIME*2) 2826e: 80 91 4e 06 lds r24, 0x064E ; 0x80064e 28272: 8a 30 cpi r24, 0x0A ; 10 28274: 11 f4 brne .+4 ; 0x2827a clock_interval = 0; 28276: 10 92 4e 06 sts 0x064E, r1 ; 0x80064e clock_interval++; 2827a: 80 91 4e 06 lds r24, 0x064E ; 0x80064e 2827e: 8f 5f subi r24, 0xFF ; 255 28280: 80 93 4e 06 sts 0x064E, r24 ; 0x80064e if (print_tc != PRINT_TIME_REMAINING_INIT && clock_interval > CLOCK_INTERVAL_TIME) { 28284: 2f ef ldi r18, 0xFF ; 255 28286: e2 16 cp r14, r18 28288: f2 06 cpc r15, r18 2828a: 21 f0 breq .+8 ; 0x28294 2828c: 97 01 movw r18, r14 print_t = print_tc; suff = 'C'; 2828e: 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) { 28290: 86 30 cpi r24, 0x06 ; 6 28292: 70 f4 brcc .+28 ; 0x282b0 print_t = print_tc; suff = 'C'; } else //#endif //CLOCK_INTERVAL_TIME if (print_tr != PRINT_TIME_REMAINING_INIT) { 28294: 3f ef ldi r19, 0xFF ; 255 28296: c3 16 cp r12, r19 28298: d3 06 cpc r13, r19 2829a: 09 f0 breq .+2 ; 0x2829e 2829c: c3 c0 rjmp .+390 ; 0x28424 print_t = print_tr; suff = 'R'; } else print_t = print_job_timer.duration() / 60; 2829e: 0f 94 75 3e call 0x27cea ; 0x27cea 282a2: 2c e3 ldi r18, 0x3C ; 60 282a4: 30 e0 ldi r19, 0x00 ; 0 282a6: 40 e0 ldi r20, 0x00 ; 0 282a8: 50 e0 ldi r21, 0x00 ; 0 282aa: 0f 94 4a dc call 0x3b894 ; 0x3b894 <__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 = ' '; 282ae: 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)) { 282b0: 40 91 39 02 lds r20, 0x0239 ; 0x800239 282b4: 50 91 3a 02 lds r21, 0x023A ; 0x80023a 282b8: 44 36 cpi r20, 0x64 ; 100 282ba: 51 05 cpc r21, r1 282bc: 09 f4 brne .+2 ; 0x282c0 282be: b5 c0 rjmp .+362 ; 0x2842a 282c0: c2 16 cp r12, r18 282c2: d3 06 cpc r13, r19 282c4: 21 f0 breq .+8 ; 0x282ce 282c6: e2 16 cp r14, r18 282c8: f3 06 cpc r15, r19 282ca: 09 f0 breq .+2 ; 0x282ce 282cc: ae c0 rjmp .+348 ; 0x2842a 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); 282ce: a4 e6 ldi r26, 0x64 ; 100 282d0: b0 e0 ldi r27, 0x00 ; 0 282d2: 0f 94 77 dc call 0x3b8ee ; 0x3b8ee <__umulhisi3> 282d6: 9a 01 movw r18, r20 282d8: 55 0f add r21, r21 282da: 44 0b sbc r20, r20 282dc: 55 0b sbc r21, r21 282de: 0f 94 4a dc call 0x3b894 ; 0x3b894 <__udivmodsi4> suff = 'R'; } else print_t = print_job_timer.duration() / 60; if (feedmultiply != 100 && (print_t == print_tr || print_t == print_tc)) { suff_doubt = '?'; 282e2: 4f e3 ldi r20, 0x3F ; 63 282e4: e4 2e mov r14, r20 282e6: 04 2e mov r0, r20 282e8: 00 0c add r0, r0 282ea: ff 08 sbc r15, r15 282ec: e1 2f mov r30, r17 282ee: 01 2e mov r0, r17 282f0: 00 0c add r0, r0 282f2: ff 0b sbc r31, r31 282f4: c9 01 movw r24, r18 282f6: 6c e3 ldi r22, 0x3C ; 60 282f8: 70 e0 ldi r23, 0x00 ; 0 282fa: 0f 94 a0 dc call 0x3b940 ; 0x3b940 <__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 282fe: 20 37 cpi r18, 0x70 ; 112 28300: 37 41 sbci r19, 0x17 ; 23 28302: 08 f0 brcs .+2 ; 0x28306 28304: 94 c0 rjmp .+296 ; 0x2842e chars = lcd_printf_P(_N(LCD_STR_CLOCK "%02u:%02u%c%c"), print_t / 60, print_t % 60, suff, suff_doubt); 28306: ff 92 push r15 28308: 4f 93 push r20 2830a: ff 93 push r31 2830c: 1f 93 push r17 2830e: 9f 93 push r25 28310: 8f 93 push r24 28312: 7f 93 push r23 28314: 6f 93 push r22 28316: 8d e2 ldi r24, 0x2D ; 45 28318: 9f e6 ldi r25, 0x6F ; 111 2831a: 9f 93 push r25 2831c: 8f 93 push r24 2831e: 0e 94 d1 6e call 0xdda2 ; 0xdda2 else //time>=100h chars = lcd_printf_P(_N(LCD_STR_CLOCK "%3uh %c%c"), print_t / 60, suff, suff_doubt); 28322: 0f b6 in r0, 0x3f ; 63 28324: f8 94 cli 28326: de bf out 0x3e, r29 ; 62 28328: 0f be out 0x3f, r0 ; 63 2832a: 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); 2832c: 98 e0 ldi r25, 0x08 ; 8 2832e: 98 1b sub r25, r24 28330: 89 2f mov r24, r25 28332: 0e 94 ee 6e call 0xdddc ; 0xdddc #else //Print time (8chars) lcdui_print_time(); #endif //CMD_DIAGNOSTICS lcd_set_cursor(0, 3); //line 3 28336: 63 e0 ldi r22, 0x03 ; 3 28338: 80 e0 ldi r24, 0x00 ; 0 2833a: 0e 94 f8 6e call 0xddf0 ; 0xddf0 #ifndef DEBUG_DISABLE_LCD_STATUS_LINE lcdui_print_status_line(); 2833e: 0f 94 49 2a call 0x25492 ; 0x25492 lcdui_print_status_screen(); prusa_statistics_update_from_status_screen(); if (lcd_commands_type != LcdCommands::Idle) 28342: 80 91 b3 0d lds r24, 0x0DB3 ; 0x800db3 28346: 88 23 and r24, r24 28348: 09 f4 brne .+2 ; 0x2834c 2834a: 3e ce rjmp .-900 ; 0x27fc8 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) { 2834c: 80 91 ab 0d lds r24, 0x0DAB ; 0x800dab 28350: 81 11 cpse r24, r1 28352: 3a ce rjmp .-908 ; 0x27fc8 28354: 0f 94 67 06 call 0x20cce ; 0x20cce 28358: 37 ce rjmp .-914 ; 0x27fc8 lcd_printf_P(PSTR("%-7s"),sheet); return; //do not also print the percentage } } if (!IS_SD_PRINTING && M79_timer_get_status() && GetHostStatusScreenName()) 2835a: e1 10 cpse r14, r1 2835c: 04 c0 rjmp .+8 ; 0x28366 2835e: 80 91 9c 03 lds r24, 0x039C ; 0x80039c <_ZL9M79_timer.lto_priv.450> 28362: 81 11 cpse r24, r1 28364: 4a c0 rjmp .+148 ; 0x283fa // Overwrite the name char * hostName = GetHostStatusScreenName(); lcd_space(1); // Blank space lcd_print(hostName); // Two characters } else { lcd_printf_P(PSTR("%3S"), src); 28366: df 92 push r13 28368: cf 92 push r12 2836a: 85 eb ldi r24, 0xB5 ; 181 2836c: 90 ea ldi r25, 0xA0 ; 160 2836e: 9f 93 push r25 28370: 8f 93 push r24 28372: 0e 94 d1 6e call 0xdda2 ; 0xdda2 28376: 0f 90 pop r0 28378: 0f 90 pop r0 2837a: 0f 90 pop r0 2837c: 0f 90 pop r0 uint8_t calc_percent_done() { //in case that we have information from M73 gcode return percentage counted by slicer, else return percentage counted as byte_printed/filesize uint8_t percent_done = 0; #ifdef TMC2130 if (SilentModeMenu == SILENT_MODE_OFF && print_percent_done_normal <= 100) 2837e: 80 91 a2 03 lds r24, 0x03A2 ; 0x8003a2 28382: 81 11 cpse r24, r1 28384: 04 c0 rjmp .+8 ; 0x2838e 28386: 80 91 ae 02 lds r24, 0x02AE ; 0x8002ae 2838a: 85 36 cpi r24, 0x65 ; 101 2838c: f0 f1 brcs .+124 ; 0x2840a { percent_done = print_percent_done_normal; } else if (print_percent_done_silent <= 100) 2838e: 80 91 ad 02 lds r24, 0x02AD ; 0x8002ad 28392: 85 36 cpi r24, 0x65 ; 101 28394: d0 f1 brcs .+116 ; 0x2840a 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;}; 28396: 80 91 22 17 lds r24, 0x1722 ; 0x801722 2839a: 88 23 and r24, r24 2839c: 19 f1 breq .+70 ; 0x283e4 2839e: 80 91 9c 17 lds r24, 0x179C ; 0x80179c 283a2: 90 91 9d 17 lds r25, 0x179D ; 0x80179d 283a6: a0 91 9e 17 lds r26, 0x179E ; 0x80179e 283aa: b0 91 9f 17 lds r27, 0x179F ; 0x80179f 283ae: 00 97 sbiw r24, 0x00 ; 0 283b0: a1 05 cpc r26, r1 283b2: b1 05 cpc r27, r1 283b4: b9 f0 breq .+46 ; 0x283e4 283b6: bc 01 movw r22, r24 283b8: cd 01 movw r24, r26 283ba: 6d 59 subi r22, 0x9D ; 157 283bc: 7f 4f sbci r23, 0xFF ; 255 283be: 8f 4f sbci r24, 0xFF ; 255 283c0: 9f 4f sbci r25, 0xFF ; 255 283c2: 24 e6 ldi r18, 0x64 ; 100 283c4: 30 e0 ldi r19, 0x00 ; 0 283c6: 40 e0 ldi r20, 0x00 ; 0 283c8: 50 e0 ldi r21, 0x00 ; 0 283ca: 0f 94 4a dc call 0x3b894 ; 0x3b894 <__udivmodsi4> 283ce: 60 91 a3 17 lds r22, 0x17A3 ; 0x8017a3 283d2: 70 91 a4 17 lds r23, 0x17A4 ; 0x8017a4 283d6: 80 91 a5 17 lds r24, 0x17A5 ; 0x8017a5 283da: 90 91 a6 17 lds r25, 0x17A6 ; 0x8017a6 283de: 0f 94 4a dc call 0x3b894 ; 0x3b894 <__udivmodsi4> 283e2: 12 2f mov r17, r18 } lcd_printf_P(num ? _N("%3d%%"):_N("---%%"), calc_percent_done()); 283e4: 21 2f mov r18, r17 283e6: 30 e0 ldi r19, 0x00 ; 0 283e8: 87 e0 ldi r24, 0x07 ; 7 283ea: 9f e6 ldi r25, 0x6F ; 111 283ec: f1 10 cpse r15, r1 283ee: 02 c0 rjmp .+4 ; 0x283f4 283f0: 81 e0 ldi r24, 0x01 ; 1 283f2: 9f e6 ldi r25, 0x6F ; 111 283f4: 3f 93 push r19 283f6: 2f 93 push r18 283f8: 14 cf rjmp .-472 ; 0x28222 if (!IS_SD_PRINTING && M79_timer_get_status() && GetHostStatusScreenName()) { // Overwrite the name char * hostName = GetHostStatusScreenName(); lcd_space(1); // Blank space 283fa: 81 e0 ldi r24, 0x01 ; 1 283fc: 0e 94 ee 6e call 0xdddc ; 0xdddc lcd_print(hostName); // Two characters 28400: 8b e4 ldi r24, 0x4B ; 75 28402: 96 e0 ldi r25, 0x06 ; 6 28404: 0e 94 ff 70 call 0xe1fe ; 0xe1fe 28408: ba cf rjmp .-140 ; 0x2837e 2840a: 18 2f mov r17, r24 2840c: eb cf rjmp .-42 ; 0x283e4 lcd_space(5 - lcdui_print_extruder()); } else if (farm_mode) { // Print farm number (5 chars) lcdui_print_farm(); } else { lcd_space(5); // 5 spaces 2840e: 85 e0 ldi r24, 0x05 ; 5 28410: 1a cf rjmp .-460 ; 0x28246 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) 28412: c0 90 b1 02 lds r12, 0x02B1 ; 0x8002b1 28416: d0 90 b2 02 lds r13, 0x02B2 ; 0x8002b2 print_tr = print_time_remaining_normal; //#ifdef CLOCK_INTERVAL_TIME if (print_time_to_change_normal != PRINT_TIME_REMAINING_INIT) 2841a: e0 90 af 02 lds r14, 0x02AF ; 0x8002af 2841e: f0 90 b0 02 lds r15, 0x02B0 ; 0x8002b0 28422: 25 cf rjmp .-438 ; 0x2826e 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) { 28424: 96 01 movw r18, r12 print_t = print_tr; suff = 'R'; 28426: 12 e5 ldi r17, 0x52 ; 82 28428: 43 cf rjmp .-378 ; 0x282b0 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 = ' '; 2842a: 40 e2 ldi r20, 0x20 ; 32 2842c: 5b cf rjmp .-330 ; 0x282e4 } 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); 2842e: ff 92 push r15 28430: 4f 93 push r20 28432: ff 93 push r31 28434: 1f 93 push r17 28436: 7f 93 push r23 28438: 6f 93 push r22 2843a: 82 e2 ldi r24, 0x22 ; 34 2843c: 9f e6 ldi r25, 0x6F ; 111 2843e: 9f 93 push r25 28440: 8f 93 push r24 28442: 0e 94 d1 6e call 0xdda2 ; 0xdda2 28446: 6d cf rjmp .-294 ; 0x28322 } 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 "--:-- ")); 28448: 89 e1 ldi r24, 0x19 ; 25 2844a: 9f e6 ldi r25, 0x6F ; 111 2844c: 9f 93 push r25 2844e: 8f 93 push r24 28450: 0e 94 d1 6e call 0xdda2 ; 0xdda2 28454: 0f 90 pop r0 28456: 0f 90 pop r0 28458: 69 cf rjmp .-302 ; 0x2832c 0002845a : reset(); if ((accumulator = with_time)) state = RUNNING; } void Stopwatch::reset() { state = STOPPED; 2845a: 10 92 9b 03 sts 0x039B, r1 ; 0x80039b startTimestamp = 0; 2845e: 10 92 a6 05 sts 0x05A6, r1 ; 0x8005a6 28462: 10 92 a7 05 sts 0x05A7, r1 ; 0x8005a7 28466: 10 92 a8 05 sts 0x05A8, r1 ; 0x8005a8 2846a: 10 92 a9 05 sts 0x05A9, r1 ; 0x8005a9 stopTimestamp = 0; 2846e: 10 92 51 06 sts 0x0651, r1 ; 0x800651 28472: 10 92 52 06 sts 0x0652, r1 ; 0x800652 28476: 10 92 53 06 sts 0x0653, r1 ; 0x800653 2847a: 10 92 54 06 sts 0x0654, r1 ; 0x800654 accumulator = 0; 2847e: 10 92 a2 05 sts 0x05A2, r1 ; 0x8005a2 28482: 10 92 a3 05 sts 0x05A3, r1 ; 0x8005a3 28486: 10 92 a4 05 sts 0x05A4, r1 ; 0x8005a4 2848a: 10 92 a5 05 sts 0x05A5, r1 ; 0x8005a5 } 2848e: 08 95 ret 00028490 : /** * @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; } 28490: 80 91 9b 03 lds r24, 0x039B ; 0x80039b } else return false; } bool Stopwatch::start() { if (!isRunning()) { 28494: 81 30 cpi r24, 0x01 ; 1 28496: f1 f0 breq .+60 ; 0x284d4 if (isPaused()) accumulator = duration(); 28498: 82 30 cpi r24, 0x02 ; 2 2849a: c9 f4 brne .+50 ; 0x284ce 2849c: 0f 94 75 3e call 0x27cea ; 0x27cea 284a0: 60 93 a2 05 sts 0x05A2, r22 ; 0x8005a2 284a4: 70 93 a3 05 sts 0x05A3, r23 ; 0x8005a3 284a8: 80 93 a4 05 sts 0x05A4, r24 ; 0x8005a4 284ac: 90 93 a5 05 sts 0x05A5, r25 ; 0x8005a5 else reset(); state = RUNNING; 284b0: 81 e0 ldi r24, 0x01 ; 1 284b2: 80 93 9b 03 sts 0x039B, r24 ; 0x80039b startTimestamp = _millis(); 284b6: 0f 94 22 29 call 0x25244 ; 0x25244 284ba: 60 93 a6 05 sts 0x05A6, r22 ; 0x8005a6 284be: 70 93 a7 05 sts 0x05A7, r23 ; 0x8005a7 284c2: 80 93 a8 05 sts 0x05A8, r24 ; 0x8005a8 284c6: 90 93 a9 05 sts 0x05A9, r25 ; 0x8005a9 284ca: 81 e0 ldi r24, 0x01 ; 1 284cc: 08 95 ret } bool Stopwatch::start() { if (!isRunning()) { if (isPaused()) accumulator = duration(); else reset(); 284ce: 0f 94 2d 42 call 0x2845a ; 0x2845a 284d2: ee cf rjmp .-36 ; 0x284b0 state = RUNNING; startTimestamp = _millis(); return true; } else return false; 284d4: 80 e0 ldi r24, 0x00 ; 0 } 284d6: 08 95 ret 000284d8 : uint32_t Stopwatch::accumulator; uint32_t Stopwatch::startTimestamp; uint32_t Stopwatch::stopTimestamp; bool Stopwatch::stop() { if (isRunning() || isPaused()) { 284d8: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 284dc: 81 50 subi r24, 0x01 ; 1 284de: 82 30 cpi r24, 0x02 ; 2 284e0: 70 f4 brcc .+28 ; 0x284fe state = STOPPED; 284e2: 10 92 9b 03 sts 0x039B, r1 ; 0x80039b stopTimestamp = _millis(); 284e6: 0f 94 22 29 call 0x25244 ; 0x25244 284ea: 60 93 51 06 sts 0x0651, r22 ; 0x800651 284ee: 70 93 52 06 sts 0x0652, r23 ; 0x800652 284f2: 80 93 53 06 sts 0x0653, r24 ; 0x800653 284f6: 90 93 54 06 sts 0x0654, r25 ; 0x800654 284fa: 81 e0 ldi r24, 0x01 ; 1 284fc: 08 95 ret return true; } else return false; 284fe: 80 e0 ldi r24, 0x00 ; 0 } 28500: 08 95 ret 00028502 : } long st_get_position(uint8_t axis) { long count_pos; CRITICAL_SECTION_START; 28502: 2f b7 in r18, 0x3f ; 63 28504: f8 94 cli count_pos = count_position[axis]; 28506: 94 e0 ldi r25, 0x04 ; 4 28508: 89 9f mul r24, r25 2850a: f0 01 movw r30, r0 2850c: 11 24 eor r1, r1 2850e: ee 54 subi r30, 0x4E ; 78 28510: f9 4f sbci r31, 0xF9 ; 249 28512: 60 81 ld r22, Z 28514: 71 81 ldd r23, Z+1 ; 0x01 28516: 82 81 ldd r24, Z+2 ; 0x02 28518: 93 81 ldd r25, Z+3 ; 0x03 CRITICAL_SECTION_END; 2851a: 2f bf out 0x3f, r18 ; 63 return count_pos; } 2851c: 08 95 ret 0002851e : y = count_position[Y_AXIS]; CRITICAL_SECTION_END; } float st_get_position_mm(uint8_t axis) { 2851e: cf 93 push r28 28520: c8 2f mov r28, r24 float steper_position_in_steps = st_get_position(axis); 28522: 0f 94 81 42 call 0x28502 ; 0x28502 28526: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> return steper_position_in_steps / cs.axis_steps_per_mm[axis]; 2852a: 24 e0 ldi r18, 0x04 ; 4 2852c: c2 9f mul r28, r18 2852e: f0 01 movw r30, r0 28530: 11 24 eor r1, r1 28532: ef 53 subi r30, 0x3F ; 63 28534: f2 4f sbci r31, 0xF2 ; 242 28536: 20 81 ld r18, Z 28538: 31 81 ldd r19, Z+1 ; 0x01 2853a: 42 81 ldd r20, Z+2 ; 0x02 2853c: 53 81 ldd r21, Z+3 ; 0x03 2853e: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> } 28542: cf 91 pop r28 28544: 08 95 ret 00028546 : } // Block until all buffered steps are executed void st_synchronize() { 28546: cf 93 push r28 28548: df 93 push r29 2854a: 00 d0 rcall .+0 ; 0x2854c 2854c: 1f 92 push r1 2854e: cd b7 in r28, 0x3d ; 61 28550: de b7 in r29, 0x3e ; 62 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); 28552: 90 91 a4 0d lds r25, 0x0DA4 ; 0x800da4 28556: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 while(blocks_queued()) 2855a: 98 17 cp r25, r24 2855c: 09 f4 brne .+2 ; 0x28560 2855e: 46 c0 rjmp .+140 ; 0x285ec { #ifdef TMC2130 manage_heater(); 28560: 0f 94 2e 38 call 0x2705c ; 0x2705c tmc2130_sg_stop_on_crash = eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET); } bool tmc2130_update_sg() { if (tmc2130_sg_measure <= E_AXIS) 28564: 80 91 3b 02 lds r24, 0x023B ; 0x80023b <_ZL18tmc2130_sg_measure.lto_priv.473> 28568: 84 30 cpi r24, 0x04 ; 4 2856a: 38 f0 brcs .+14 ; 0x2857a // Vojtech: Don't disable motors inside the planner! if (!tmc2130_update_sg()) { manage_inactivity(true); 2856c: 81 e0 ldi r24, 0x01 ; 1 2856e: 0e 94 c7 8a call 0x1158e ; 0x1158e lcd_update(0); 28572: 80 e0 ldi r24, 0x00 ; 0 28574: 0e 94 bf 6e call 0xdd7e ; 0xdd7e 28578: ec cf rjmp .-40 ; 0x28552 { uint32_t val32 = 0; 2857a: 19 82 std Y+1, r1 ; 0x01 2857c: 1a 82 std Y+2, r1 ; 0x02 2857e: 1b 82 std Y+3, r1 ; 0x03 28580: 1c 82 std Y+4, r1 ; 0x04 tmc2130_rd(tmc2130_sg_measure, TMC2130_REG_DRV_STATUS, &val32); 28582: ae 01 movw r20, r28 28584: 4f 5f subi r20, 0xFF ; 255 28586: 5f 4f sbci r21, 0xFF ; 255 28588: 6f e6 ldi r22, 0x6F ; 111 2858a: 0f 94 c7 23 call 0x2478e ; 0x2478e tmc2130_sg_measure_val += (val32 & 0x3ff); 2858e: 89 81 ldd r24, Y+1 ; 0x01 28590: 9a 81 ldd r25, Y+2 ; 0x02 28592: ab 81 ldd r26, Y+3 ; 0x03 28594: bc 81 ldd r27, Y+4 ; 0x04 28596: 93 70 andi r25, 0x03 ; 3 28598: aa 27 eor r26, r26 2859a: bb 27 eor r27, r27 2859c: 40 91 cf 03 lds r20, 0x03CF ; 0x8003cf <_ZL22tmc2130_sg_measure_val.lto_priv.474> 285a0: 50 91 d0 03 lds r21, 0x03D0 ; 0x8003d0 <_ZL22tmc2130_sg_measure_val.lto_priv.474+0x1> 285a4: 60 91 d1 03 lds r22, 0x03D1 ; 0x8003d1 <_ZL22tmc2130_sg_measure_val.lto_priv.474+0x2> 285a8: 70 91 d2 03 lds r23, 0x03D2 ; 0x8003d2 <_ZL22tmc2130_sg_measure_val.lto_priv.474+0x3> 285ac: 84 0f add r24, r20 285ae: 95 1f adc r25, r21 285b0: a6 1f adc r26, r22 285b2: b7 1f adc r27, r23 285b4: 80 93 cf 03 sts 0x03CF, r24 ; 0x8003cf <_ZL22tmc2130_sg_measure_val.lto_priv.474> 285b8: 90 93 d0 03 sts 0x03D0, r25 ; 0x8003d0 <_ZL22tmc2130_sg_measure_val.lto_priv.474+0x1> 285bc: a0 93 d1 03 sts 0x03D1, r26 ; 0x8003d1 <_ZL22tmc2130_sg_measure_val.lto_priv.474+0x2> 285c0: b0 93 d2 03 sts 0x03D2, r27 ; 0x8003d2 <_ZL22tmc2130_sg_measure_val.lto_priv.474+0x3> tmc2130_sg_measure_cnt++; 285c4: 80 91 cb 03 lds r24, 0x03CB ; 0x8003cb <_ZL22tmc2130_sg_measure_cnt.lto_priv.475> 285c8: 90 91 cc 03 lds r25, 0x03CC ; 0x8003cc <_ZL22tmc2130_sg_measure_cnt.lto_priv.475+0x1> 285cc: a0 91 cd 03 lds r26, 0x03CD ; 0x8003cd <_ZL22tmc2130_sg_measure_cnt.lto_priv.475+0x2> 285d0: b0 91 ce 03 lds r27, 0x03CE ; 0x8003ce <_ZL22tmc2130_sg_measure_cnt.lto_priv.475+0x3> 285d4: 01 96 adiw r24, 0x01 ; 1 285d6: a1 1d adc r26, r1 285d8: b1 1d adc r27, r1 285da: 80 93 cb 03 sts 0x03CB, r24 ; 0x8003cb <_ZL22tmc2130_sg_measure_cnt.lto_priv.475> 285de: 90 93 cc 03 sts 0x03CC, r25 ; 0x8003cc <_ZL22tmc2130_sg_measure_cnt.lto_priv.475+0x1> 285e2: a0 93 cd 03 sts 0x03CD, r26 ; 0x8003cd <_ZL22tmc2130_sg_measure_cnt.lto_priv.475+0x2> 285e6: b0 93 ce 03 sts 0x03CE, r27 ; 0x8003ce <_ZL22tmc2130_sg_measure_cnt.lto_priv.475+0x3> 285ea: b3 cf rjmp .-154 ; 0x28552 #else //TMC2130 // Vojtech: Don't disable motors inside the planner! delay_keep_alive(0); #endif //TMC2130 } } 285ec: 0f 90 pop r0 285ee: 0f 90 pop r0 285f0: 0f 90 pop r0 285f2: 0f 90 pop r0 285f4: df 91 pop r29 285f6: cf 91 pop r28 285f8: 08 95 ret 000285fa : void st_reset_timer() { // Clear a possible pending interrupt on OCR1A overflow. TIFR1 |= 1 << OCF1A; 285fa: b1 9a sbi 0x16, 1 ; 22 // Reset the counter. TCNT1 = 0; 285fc: 10 92 85 00 sts 0x0085, r1 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 28600: 10 92 84 00 sts 0x0084, r1 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> // Wake up after 1ms from now. OCR1A = 2000; 28604: 80 ed ldi r24, 0xD0 ; 208 28606: 97 e0 ldi r25, 0x07 ; 7 28608: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2860c: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> #ifdef LIN_ADVANCE nextMainISR = 0; 28610: 10 92 e5 04 sts 0x04E5, r1 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.476+0x1> 28614: 10 92 e4 04 sts 0x04E4, r1 ; 0x8004e4 <_ZL11nextMainISR.lto_priv.476> if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) 28618: 80 91 e2 04 lds r24, 0x04E2 ; 0x8004e2 <_ZL14nextAdvanceISR.lto_priv.477> 2861c: 90 91 e3 04 lds r25, 0x04E3 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.477+0x1> 28620: 01 97 sbiw r24, 0x01 ; 1 28622: 8e 3f cpi r24, 0xFE ; 254 28624: 9f 4f sbci r25, 0xFF ; 255 28626: 20 f4 brcc .+8 ; 0x28630 nextAdvanceISR = 0; 28628: 10 92 e3 04 sts 0x04E3, r1 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.477+0x1> 2862c: 10 92 e2 04 sts 0x04E2, r1 ; 0x8004e2 <_ZL14nextAdvanceISR.lto_priv.477> #endif } 28630: 08 95 ret 00028632 <__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) { 28632: 1f 92 push r1 28634: 0f 92 push r0 28636: 0f b6 in r0, 0x3f ; 63 28638: 0f 92 push r0 2863a: 11 24 eor r1, r1 2863c: 0b b6 in r0, 0x3b ; 59 2863e: 0f 92 push r0 28640: 6f 92 push r6 28642: 7f 92 push r7 28644: 8f 92 push r8 28646: cf 92 push r12 28648: df 92 push r13 2864a: ef 92 push r14 2864c: ff 92 push r15 2864e: 0f 93 push r16 28650: 1f 93 push r17 28652: 2f 93 push r18 28654: 3f 93 push r19 28656: 4f 93 push r20 28658: 5f 93 push r21 2865a: 6f 93 push r22 2865c: 7f 93 push r23 2865e: 8f 93 push r24 28660: 9f 93 push r25 28662: af 93 push r26 28664: bf 93 push r27 28666: cf 93 push r28 28668: df 93 push r29 2866a: ef 93 push r30 2866c: ff 93 push r31 } } FORCE_INLINE void advance_isr_scheduler() { // Integrate the final timer value, accounting for scheduling adjustments if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) 2866e: 80 91 e2 04 lds r24, 0x04E2 ; 0x8004e2 <_ZL14nextAdvanceISR.lto_priv.477> 28672: 90 91 e3 04 lds r25, 0x04E3 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.477+0x1> 28676: 9c 01 movw r18, r24 28678: 21 50 subi r18, 0x01 ; 1 2867a: 31 09 sbc r19, r1 2867c: 2e 3f cpi r18, 0xFE ; 254 2867e: 3f 4f sbci r19, 0xFF ; 255 28680: 90 f4 brcc .+36 ; 0x286a6 <__vector_17+0x74> { if(nextAdvanceISR > OCR1A) 28682: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 28686: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2868a: 28 17 cp r18, r24 2868c: 39 07 cpc r19, r25 2868e: 08 f0 brcs .+2 ; 0x28692 <__vector_17+0x60> 28690: f9 c0 rjmp .+498 ; 0x28884 <__vector_17+0x252> nextAdvanceISR -= OCR1A; 28692: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 28696: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2869a: 82 1b sub r24, r18 2869c: 93 0b sbc r25, r19 2869e: 90 93 e3 04 sts 0x04E3, r25 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.477+0x1> 286a2: 80 93 e2 04 sts 0x04E2, r24 ; 0x8004e2 <_ZL14nextAdvanceISR.lto_priv.477> else nextAdvanceISR = 0; } if(nextMainISR > OCR1A) 286a6: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 286aa: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 286ae: 80 91 e4 04 lds r24, 0x04E4 ; 0x8004e4 <_ZL11nextMainISR.lto_priv.476> 286b2: 90 91 e5 04 lds r25, 0x04E5 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.476+0x1> 286b6: 28 17 cp r18, r24 286b8: 39 07 cpc r19, r25 286ba: 08 f0 brcs .+2 ; 0x286be <__vector_17+0x8c> 286bc: e8 c0 rjmp .+464 ; 0x2888e <__vector_17+0x25c> nextMainISR -= OCR1A; 286be: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 286c2: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 286c6: 82 1b sub r24, r18 286c8: 93 0b sbc r25, r19 286ca: 90 93 e5 04 sts 0x04E5, r25 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.476+0x1> 286ce: 80 93 e4 04 sts 0x04E4, r24 ; 0x8004e4 <_ZL11nextMainISR.lto_priv.476> else nextMainISR = 0; // Run main stepping ISR if flagged if (!nextMainISR) 286d2: 80 91 e4 04 lds r24, 0x04E4 ; 0x8004e4 <_ZL11nextMainISR.lto_priv.476> 286d6: 90 91 e5 04 lds r25, 0x04E5 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.476+0x1> 286da: 89 2b or r24, r25 286dc: 11 f0 breq .+4 ; 0x286e2 <__vector_17+0xb0> 286de: 0d 94 69 4c jmp 0x298d2 ; 0x298d2 <__vector_17+0x12a0> 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) 286e2: e0 91 a0 05 lds r30, 0x05A0 ; 0x8005a0 286e6: f0 91 a1 05 lds r31, 0x05A1 ; 0x8005a1 286ea: 30 97 sbiw r30, 0x00 ; 0 286ec: 09 f0 breq .+2 ; 0x286f0 <__vector_17+0xbe> 286ee: 87 c1 rjmp .+782 ; 0x289fe <__vector_17+0x3cc> // 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) { 286f0: 90 91 a4 0d lds r25, 0x0DA4 ; 0x800da4 286f4: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 286f8: 98 17 cp r25, r24 286fa: 09 f4 brne .+2 ; 0x286fe <__vector_17+0xcc> 286fc: f9 c1 rjmp .+1010 ; 0x28af0 <__vector_17+0x4be> return(NULL); } block_t *block = &block_buffer[block_buffer_tail]; 286fe: c0 91 a5 0d lds r28, 0x0DA5 ; 0x800da5 28702: 2c 2f mov r18, r28 28704: 30 e0 ldi r19, 0x00 ; 0 28706: 5e e6 ldi r21, 0x6E ; 110 28708: c5 9f mul r28, r21 2870a: e0 01 movw r28, r0 2870c: 11 24 eor r1, r1 2870e: cc 53 subi r28, 0x3C ; 60 28710: d9 4f sbci r29, 0xF9 ; 249 block->busy = true; 28712: fe 01 movw r30, r28 28714: e9 5b subi r30, 0xB9 ; 185 28716: ff 4f sbci r31, 0xFF ; 255 28718: 41 e0 ldi r20, 0x01 ; 1 2871a: 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(); 2871c: d0 93 a1 05 sts 0x05A1, r29 ; 0x8005a1 28720: c0 93 a0 05 sts 0x05A0, r28 ; 0x8005a0 if (current_block != NULL) { 28724: 20 97 sbiw r28, 0x00 ; 0 28726: 09 f4 brne .+2 ; 0x2872a <__vector_17+0xf8> 28728: e3 c1 rjmp .+966 ; 0x28af0 <__vector_17+0x4be> // 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; 2872a: 10 92 9c 05 sts 0x059C, r1 ; 0x80059c 2872e: 10 92 9d 05 sts 0x059D, r1 ; 0x80059d 28732: 10 92 9e 05 sts 0x059E, r1 ; 0x80059e 28736: 10 92 9f 05 sts 0x059F, r1 ; 0x80059f // 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; 2873a: 10 92 9b 05 sts 0x059B, r1 ; 0x80059b acc_step_rate = uint16_t(current_block->initial_rate); 2873e: 8a ad ldd r24, Y+58 ; 0x3a 28740: 9b ad ldd r25, Y+59 ; 0x3b 28742: 90 93 9a 05 sts 0x059A, r25 ; 0x80059a 28746: 80 93 99 05 sts 0x0599, r24 ; 0x800599 #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; 2874a: 81 34 cpi r24, 0x41 ; 65 2874c: ec e9 ldi r30, 0x9C ; 156 2874e: 9e 07 cpc r25, r30 28750: 08 f0 brcs .+2 ; 0x28754 <__vector_17+0x122> 28752: a2 c0 rjmp .+324 ; 0x28898 <__vector_17+0x266> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 28754: 81 32 cpi r24, 0x21 ; 33 28756: fe e4 ldi r31, 0x4E ; 78 28758: 9f 07 cpc r25, r31 2875a: 08 f4 brcc .+2 ; 0x2875e <__vector_17+0x12c> 2875c: a0 c0 rjmp .+320 ; 0x2889e <__vector_17+0x26c> step_rate = (step_rate >> 2)&0x3fff; 2875e: 96 95 lsr r25 28760: 87 95 ror r24 28762: 96 95 lsr r25 28764: 87 95 ror r24 step_loops = 4; 28766: 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; 28768: 40 93 98 05 sts 0x0598, r20 ; 0x800598 else { step_loops = 1; } if(step_rate < (F_CPU/500000)) step_rate = (F_CPU/500000); step_rate -= (F_CPU/500000); // Correct for minimal speed 2876c: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 2876e: 81 15 cp r24, r1 28770: e8 e0 ldi r30, 0x08 ; 8 28772: 9e 07 cpc r25, r30 28774: 08 f4 brcc .+2 ; 0x28778 <__vector_17+0x146> 28776: a4 c0 rjmp .+328 ; 0x288c0 <__vector_17+0x28e> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 28778: e9 2f mov r30, r25 2877a: ff 27 eor r31, r31 2877c: ee 0f add r30, r30 2877e: ff 1f adc r31, r31 28780: ee 0f add r30, r30 28782: ff 1f adc r31, r31 28784: af 01 movw r20, r30 28786: 42 57 subi r20, 0x72 ; 114 28788: 59 46 sbci r21, 0x69 ; 105 unsigned char tmp_step_rate = (step_rate & 0x00ff); uint16_t gain = (uint16_t)pgm_read_word_near(table_address+2); 2878a: fa 01 movw r30, r20 2878c: 32 96 adiw r30, 0x02 ; 2 2878e: a5 91 lpm r26, Z+ 28790: b4 91 lpm r27, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 28792: fa 01 movw r30, r20 28794: 45 91 lpm r20, Z+ 28796: 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. ); 28798: b8 9f mul r27, r24 2879a: b0 01 movw r22, r0 2879c: a8 9f mul r26, r24 2879e: 00 0c add r0, r0 287a0: 61 1d adc r22, r1 287a2: 11 24 eor r1, r1 287a4: 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); 287a6: ca 01 movw r24, r20 287a8: 86 1b sub r24, r22 287aa: 97 0b sbc r25, r23 acceleration_time = calc_timer(acc_step_rate, step_loops); 287ac: 84 36 cpi r24, 0x64 ; 100 287ae: 91 05 cpc r25, r1 287b0: 10 f4 brcc .+4 ; 0x287b6 <__vector_17+0x184> 287b2: 84 e6 ldi r24, 0x64 ; 100 287b4: 90 e0 ldi r25, 0x00 ; 0 287b6: b0 e0 ldi r27, 0x00 ; 0 287b8: a0 e0 ldi r26, 0x00 ; 0 287ba: 80 93 94 05 sts 0x0594, r24 ; 0x800594 287be: 90 93 95 05 sts 0x0595, r25 ; 0x800595 287c2: a0 93 96 05 sts 0x0596, r26 ; 0x800596 287c6: b0 93 97 05 sts 0x0597, r27 ; 0x800597 #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 287ca: 4e e6 ldi r20, 0x6E ; 110 287cc: 42 9f mul r20, r18 287ce: c0 01 movw r24, r0 287d0: 43 9f mul r20, r19 287d2: 90 0d add r25, r0 287d4: 11 24 eor r1, r1 287d6: 8c 53 subi r24, 0x3C ; 60 287d8: 99 4f sbci r25, 0xF9 ; 249 287da: fc 01 movw r30, r24 287dc: e4 5b subi r30, 0xB4 ; 180 287de: ff 4f sbci r31, 0xFF ; 255 287e0: 40 81 ld r20, Z 287e2: 44 23 and r20, r20 287e4: 49 f0 breq .+18 ; 0x287f8 <__vector_17+0x1c6> target_adv_steps = current_block->max_adv_steps; 287e6: 81 5b subi r24, 0xB1 ; 177 287e8: 9f 4f sbci r25, 0xFF ; 255 287ea: fc 01 movw r30, r24 287ec: 80 81 ld r24, Z 287ee: 91 81 ldd r25, Z+1 ; 0x01 287f0: 90 93 93 05 sts 0x0593, r25 ; 0x800593 287f4: 80 93 92 05 sts 0x0592, r24 ; 0x800592 } e_steps = 0; 287f8: 10 92 91 05 sts 0x0591, r1 ; 0x800591 nextAdvanceISR = ADV_NEVER; 287fc: 8f ef ldi r24, 0xFF ; 255 287fe: 9f ef ldi r25, 0xFF ; 255 28800: 90 93 e3 04 sts 0x04E3, r25 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.477+0x1> 28804: 80 93 e2 04 sts 0x04E2, r24 ; 0x8004e2 <_ZL14nextAdvanceISR.lto_priv.477> LA_phase = -1; 28808: 80 93 90 05 sts 0x0590, r24 ; 0x800590 #endif if (current_block->flag & BLOCK_FLAG_E_RESET) { 2880c: 8e e6 ldi r24, 0x6E ; 110 2880e: 82 9f mul r24, r18 28810: f0 01 movw r30, r0 28812: 83 9f mul r24, r19 28814: f0 0d add r31, r0 28816: 11 24 eor r1, r1 28818: ec 53 subi r30, 0x3C ; 60 2881a: f9 4f sbci r31, 0xF9 ; 249 2881c: 85 a9 ldd r24, Z+53 ; 0x35 2881e: 84 ff sbrs r24, 4 28820: 08 c0 rjmp .+16 ; 0x28832 <__vector_17+0x200> count_position[E_AXIS] = 0; 28822: 10 92 be 06 sts 0x06BE, r1 ; 0x8006be 28826: 10 92 bf 06 sts 0x06BF, r1 ; 0x8006bf 2882a: 10 92 c0 06 sts 0x06C0, r1 ; 0x8006c0 2882e: 10 92 c1 06 sts 0x06C1, r1 ; 0x8006c1 } if (current_block->flag & BLOCK_FLAG_DDA_LOWRES) { 28832: 83 ff sbrs r24, 3 28834: 66 c0 rjmp .+204 ; 0x28902 <__vector_17+0x2d0> const int16_t value = -(current_block->step_event_count.lo >> 1); 28836: 8e e6 ldi r24, 0x6E ; 110 28838: 82 9f mul r24, r18 2883a: f0 01 movw r30, r0 2883c: 83 9f mul r24, r19 2883e: f0 0d add r31, r0 28840: 11 24 eor r1, r1 28842: ec 53 subi r30, 0x3C ; 60 28844: f9 4f sbci r31, 0xF9 ; 249 28846: 80 89 ldd r24, Z+16 ; 0x10 28848: 91 89 ldd r25, Z+17 ; 0x11 2884a: 96 95 lsr r25 2884c: 87 95 ror r24 2884e: 91 95 neg r25 28850: 81 95 neg r24 28852: 91 09 sbc r25, r1 for (uint8_t axis = 0; axis < NUM_AXIS; axis++) { counter[axis].lo = value; 28854: 90 93 81 05 sts 0x0581, r25 ; 0x800581 28858: 80 93 80 05 sts 0x0580, r24 ; 0x800580 2885c: 90 93 85 05 sts 0x0585, r25 ; 0x800585 28860: 80 93 84 05 sts 0x0584, r24 ; 0x800584 28864: 90 93 89 05 sts 0x0589, r25 ; 0x800589 28868: 80 93 88 05 sts 0x0588, r24 ; 0x800588 2886c: 90 93 8d 05 sts 0x058D, r25 ; 0x80058d 28870: 80 93 8c 05 sts 0x058C, r24 ; 0x80058c } #ifdef LIN_ADVANCE e_extruding = current_block->steps[E_AXIS].lo != 0; 28874: 81 e0 ldi r24, 0x01 ; 1 28876: 24 85 ldd r18, Z+12 ; 0x0c 28878: 35 85 ldd r19, Z+13 ; 0x0d 2887a: 23 2b or r18, r19 2887c: 09 f0 breq .+2 ; 0x28880 <__vector_17+0x24e> 2887e: 82 c0 rjmp .+260 ; 0x28984 <__vector_17+0x352> 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; 28880: 80 e0 ldi r24, 0x00 ; 0 28882: 80 c0 rjmp .+256 ; 0x28984 <__vector_17+0x352> if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) { if(nextAdvanceISR > OCR1A) nextAdvanceISR -= OCR1A; else nextAdvanceISR = 0; 28884: 10 92 e3 04 sts 0x04E3, r1 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.477+0x1> 28888: 10 92 e2 04 sts 0x04E2, r1 ; 0x8004e2 <_ZL14nextAdvanceISR.lto_priv.477> 2888c: 0c cf rjmp .-488 ; 0x286a6 <__vector_17+0x74> } if(nextMainISR > OCR1A) nextMainISR -= OCR1A; else nextMainISR = 0; 2888e: 10 92 e5 04 sts 0x04E5, r1 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.476+0x1> 28892: 10 92 e4 04 sts 0x04E4, r1 ; 0x8004e4 <_ZL11nextMainISR.lto_priv.476> 28896: 1d cf rjmp .-454 ; 0x286d2 <__vector_17+0xa0> #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; 28898: 80 e4 ldi r24, 0x40 ; 64 2889a: 9c e9 ldi r25, 0x9C ; 156 2889c: 60 cf rjmp .-320 ; 0x2875e <__vector_17+0x12c> 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 2889e: 81 31 cpi r24, 0x11 ; 17 288a0: 57 e2 ldi r21, 0x27 ; 39 288a2: 95 07 cpc r25, r21 288a4: 20 f0 brcs .+8 ; 0x288ae <__vector_17+0x27c> step_rate = (step_rate >> 1)&0x7fff; 288a6: 96 95 lsr r25 288a8: 87 95 ror r24 step_loops = 2; 288aa: 42 e0 ldi r20, 0x02 ; 2 288ac: 5d cf rjmp .-326 ; 0x28768 <__vector_17+0x136> } else { step_loops = 1; 288ae: 40 93 98 05 sts 0x0598, r20 ; 0x800598 288b2: 80 32 cpi r24, 0x20 ; 32 288b4: 91 05 cpc r25, r1 288b6: 08 f0 brcs .+2 ; 0x288ba <__vector_17+0x288> 288b8: 59 cf rjmp .-334 ; 0x2876c <__vector_17+0x13a> 288ba: 80 e2 ldi r24, 0x20 ; 32 288bc: 90 e0 ldi r25, 0x00 ; 0 288be: 56 cf rjmp .-340 ; 0x2876c <__vector_17+0x13a> 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; 288c0: ac 01 movw r20, r24 288c2: 56 95 lsr r21 288c4: 47 95 ror r20 288c6: 4c 7f andi r20, 0xFC ; 252 288c8: 42 57 subi r20, 0x72 ; 114 288ca: 5d 46 sbci r21, 0x6D ; 109 timer = (unsigned short)pgm_read_word_near(table_address); 288cc: fa 01 movw r30, r20 288ce: 65 91 lpm r22, Z+ 288d0: 74 91 lpm r23, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 288d2: fa 01 movw r30, r20 288d4: 32 96 adiw r30, 0x02 ; 2 288d6: a5 91 lpm r26, Z+ 288d8: b4 91 lpm r27, Z 288da: ac 01 movw r20, r24 288dc: 47 70 andi r20, 0x07 ; 7 288de: 55 27 eor r21, r21 288e0: 4a 9f mul r20, r26 288e2: c0 01 movw r24, r0 288e4: 4b 9f mul r20, r27 288e6: 90 0d add r25, r0 288e8: 5a 9f mul r21, r26 288ea: 90 0d add r25, r0 288ec: 11 24 eor r1, r1 288ee: e3 e0 ldi r30, 0x03 ; 3 288f0: 96 95 lsr r25 288f2: 87 95 ror r24 288f4: ea 95 dec r30 288f6: e1 f7 brne .-8 ; 0x288f0 <__vector_17+0x2be> 288f8: ab 01 movw r20, r22 288fa: 48 1b sub r20, r24 288fc: 59 0b sbc r21, r25 288fe: ca 01 movw r24, r20 28900: 55 cf rjmp .-342 ; 0x287ac <__vector_17+0x17a> } #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); 28902: 8e e6 ldi r24, 0x6E ; 110 28904: 82 9f mul r24, r18 28906: f0 01 movw r30, r0 28908: 83 9f mul r24, r19 2890a: f0 0d add r31, r0 2890c: 11 24 eor r1, r1 2890e: ec 53 subi r30, 0x3C ; 60 28910: f9 4f sbci r31, 0xF9 ; 249 28912: 80 89 ldd r24, Z+16 ; 0x10 28914: 91 89 ldd r25, Z+17 ; 0x11 28916: a2 89 ldd r26, Z+18 ; 0x12 28918: b3 89 ldd r27, Z+19 ; 0x13 2891a: b6 95 lsr r27 2891c: a7 95 ror r26 2891e: 97 95 ror r25 28920: 87 95 ror r24 28922: b0 95 com r27 28924: a0 95 com r26 28926: 90 95 com r25 28928: 81 95 neg r24 2892a: 9f 4f sbci r25, 0xFF ; 255 2892c: af 4f sbci r26, 0xFF ; 255 2892e: bf 4f sbci r27, 0xFF ; 255 for (uint8_t axis = 0; axis < NUM_AXIS; axis++) { counter[axis].wide = value; 28930: 80 93 80 05 sts 0x0580, r24 ; 0x800580 28934: 90 93 81 05 sts 0x0581, r25 ; 0x800581 28938: a0 93 82 05 sts 0x0582, r26 ; 0x800582 2893c: b0 93 83 05 sts 0x0583, r27 ; 0x800583 28940: 80 93 84 05 sts 0x0584, r24 ; 0x800584 28944: 90 93 85 05 sts 0x0585, r25 ; 0x800585 28948: a0 93 86 05 sts 0x0586, r26 ; 0x800586 2894c: b0 93 87 05 sts 0x0587, r27 ; 0x800587 28950: 80 93 88 05 sts 0x0588, r24 ; 0x800588 28954: 90 93 89 05 sts 0x0589, r25 ; 0x800589 28958: a0 93 8a 05 sts 0x058A, r26 ; 0x80058a 2895c: b0 93 8b 05 sts 0x058B, r27 ; 0x80058b 28960: 80 93 8c 05 sts 0x058C, r24 ; 0x80058c 28964: 90 93 8d 05 sts 0x058D, r25 ; 0x80058d 28968: a0 93 8e 05 sts 0x058E, r26 ; 0x80058e 2896c: b0 93 8f 05 sts 0x058F, r27 ; 0x80058f } #ifdef LIN_ADVANCE e_extruding = current_block->steps[E_AXIS].wide != 0; 28970: 81 e0 ldi r24, 0x01 ; 1 28972: 44 85 ldd r20, Z+12 ; 0x0c 28974: 55 85 ldd r21, Z+13 ; 0x0d 28976: 66 85 ldd r22, Z+14 ; 0x0e 28978: 77 85 ldd r23, Z+15 ; 0x0f 2897a: 45 2b or r20, r21 2897c: 46 2b or r20, r22 2897e: 47 2b or r20, r23 28980: 09 f4 brne .+2 ; 0x28984 <__vector_17+0x352> 28982: 7e cf rjmp .-260 ; 0x28880 <__vector_17+0x24e> 28984: 80 93 7f 05 sts 0x057F, r24 ; 0x80057f #endif } step_events_completed.wide = 0; 28988: 10 92 7b 05 sts 0x057B, r1 ; 0x80057b 2898c: 10 92 7c 05 sts 0x057C, r1 ; 0x80057c 28990: 10 92 7d 05 sts 0x057D, r1 ; 0x80057d 28994: 10 92 7e 05 sts 0x057E, r1 ; 0x80057e // Set directions. out_bits = current_block->direction_bits; 28998: 88 8d ldd r24, Y+24 ; 0x18 2899a: 80 93 7a 05 sts 0x057A, r24 ; 0x80057a // 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); 289a2: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 289a6: 81 60 ori r24, 0x01 ; 1 289a8: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[X_AXIS]=-1; 289ac: 8f ef ldi r24, 0xFF ; 255 } else { WRITE_NC(X_DIR_PIN, !INVERT_X_DIR); count_direction[X_AXIS]=1; 289ae: 80 93 97 02 sts 0x0297, r24 ; 0x800297 } if((out_bits & (1< 289b6: 81 ff sbrs r24, 1 289b8: 8b c0 rjmp .+278 ; 0x28ad0 <__vector_17+0x49e> WRITE_NC(Y_DIR_PIN, INVERT_Y_DIR); 289ba: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 289be: 8d 7f andi r24, 0xFD ; 253 289c0: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Y_AXIS]=-1; 289c4: 8f ef ldi r24, 0xFF ; 255 } else { WRITE_NC(Y_DIR_PIN, !INVERT_Y_DIR); count_direction[Y_AXIS]=1; 289c6: 80 93 98 02 sts 0x0298, r24 ; 0x800298 } if ((out_bits & (1< 289ce: 82 ff sbrs r24, 2 289d0: 86 c0 rjmp .+268 ; 0x28ade <__vector_17+0x4ac> WRITE_NC(Z_DIR_PIN,INVERT_Z_DIR); 289d2: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 289d6: 84 60 ori r24, 0x04 ; 4 289d8: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Z_AXIS]=-1; 289dc: 8f ef ldi r24, 0xFF ; 255 } else { // +direction WRITE_NC(Z_DIR_PIN,!INVERT_Z_DIR); count_direction[Z_AXIS]=1; 289de: 80 93 99 02 sts 0x0299, r24 ; 0x800299 } if ((out_bits & (1 << E_AXIS)) != 0) { // -direction 289e2: 80 91 7a 05 lds r24, 0x057A ; 0x80057a 289e6: 83 ff sbrs r24, 3 289e8: 81 c0 rjmp .+258 ; 0x28aec <__vector_17+0x4ba> #ifndef LIN_ADVANCE WRITE(E0_DIR_PIN, INVERT_E0_DIR); #endif /* LIN_ADVANCE */ count_direction[E_AXIS] = -1; 289ea: 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; 289ec: 80 93 9a 02 sts 0x029A, r24 ; 0x80029a //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) 289f0: e0 91 a0 05 lds r30, 0x05A0 ; 0x8005a0 289f4: f0 91 a1 05 lds r31, 0x05A1 ; 0x8005a1 289f8: 30 97 sbiw r30, 0x00 ; 0 289fa: 09 f4 brne .+2 ; 0x289fe <__vector_17+0x3cc> 289fc: 3d c7 rjmp .+3706 ; 0x29878 <__vector_17+0x1246> } // Check limit switches. FORCE_INLINE void stepper_check_endstops() { if(check_endstops) 289fe: 80 91 b7 02 lds r24, 0x02B7 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> 28a02: 50 91 77 05 lds r21, 0x0577 ; 0x800577 28a06: 88 23 and r24, r24 28a08: 09 f4 brne .+2 ; 0x28a0c <__vector_17+0x3da> 28a0a: cb c0 rjmp .+406 ; 0x28ba2 <__vector_17+0x570> { uint8_t _endstop_hit = endstop_hit; 28a0c: 20 91 0a 05 lds r18, 0x050A ; 0x80050a <_ZL11endstop_hit.lto_priv.480> uint8_t _endstop = endstop; 28a10: 80 91 79 05 lds r24, 0x0579 ; 0x800579 uint8_t _old_endstop = old_endstop; 28a14: 90 91 78 05 lds r25, 0x0578 ; 0x800578 #ifndef COREXY if ((out_bits & (1< #endif { #if ( (defined(X_MIN_PIN) && (X_MIN_PIN > -1)) || defined(TMC2130_SG_HOMING) ) && !defined(DEBUG_DISABLE_XMINLIMIT) #ifdef TMC2130_SG_HOMING // Stall guard homing turned on SET_BIT_TO(_endstop, X_AXIS, (!READ(X_TMC2130_DIAG))); 28a1c: 40 91 06 01 lds r20, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> { uint8_t _endstop_hit = endstop_hit; uint8_t _endstop = endstop; uint8_t _old_endstop = old_endstop; #ifndef COREXY if ((out_bits & (1< #endif { #if ( (defined(X_MIN_PIN) && (X_MIN_PIN > -1)) || defined(TMC2130_SG_HOMING) ) && !defined(DEBUG_DISABLE_XMINLIMIT) #ifdef TMC2130_SG_HOMING // Stall guard homing turned on SET_BIT_TO(_endstop, X_AXIS, (!READ(X_TMC2130_DIAG))); 28a24: 42 fd sbrc r20, 2 28a26: 83 c0 rjmp .+262 ; 0x28b2e <__vector_17+0x4fc> 28a28: 81 60 ori r24, 0x01 ; 1 #else // Normal homing SET_BIT_TO(_endstop, X_AXIS, (READ(X_MIN_PIN) != X_MIN_ENDSTOP_INVERTING)); #endif if((_endstop & _old_endstop & _BV(X_AXIS)) && (current_block->steps[X_AXIS].wide > 0)) { 28a2a: 49 2f mov r20, r25 28a2c: 41 70 andi r20, 0x01 ; 1 SET_BIT_TO(_endstop, X_AXIS + 4, (!READ(X_TMC2130_DIAG))); #else // Normal homing SET_BIT_TO(_endstop, X_AXIS + 4, (READ(X_MAX_PIN) != X_MAX_ENDSTOP_INVERTING)); #endif if((_endstop & _old_endstop & _BV(X_AXIS + 4)) && (current_block->steps[X_AXIS].wide > 0)){ 28a2e: 48 23 and r20, r24 28a30: b1 f0 breq .+44 ; 0x28a5e <__vector_17+0x42c> 28a32: c0 80 ld r12, Z 28a34: d1 80 ldd r13, Z+1 ; 0x01 28a36: e2 80 ldd r14, Z+2 ; 0x02 28a38: f3 80 ldd r15, Z+3 ; 0x03 28a3a: 1c 14 cp r1, r12 28a3c: 1d 04 cpc r1, r13 28a3e: 1e 04 cpc r1, r14 28a40: 1f 04 cpc r1, r15 28a42: 6c f4 brge .+26 ; 0x28a5e <__vector_17+0x42c> #ifdef VERBOSE_CHECK_HIT_ENDSTOPS endstops_trigsteps[X_AXIS] = count_position[X_AXIS]; #endif //VERBOSE_CHECK_HIT_ENDSTOPS _endstop_hit |= _BV(X_AXIS); 28a44: 21 60 ori r18, 0x01 ; 1 step_events_completed.wide = current_block->step_event_count.wide; 28a46: c0 88 ldd r12, Z+16 ; 0x10 28a48: d1 88 ldd r13, Z+17 ; 0x11 28a4a: e2 88 ldd r14, Z+18 ; 0x12 28a4c: f3 88 ldd r15, Z+19 ; 0x13 28a4e: c0 92 7b 05 sts 0x057B, r12 ; 0x80057b 28a52: d0 92 7c 05 sts 0x057C, r13 ; 0x80057c 28a56: e0 92 7d 05 sts 0x057D, r14 ; 0x80057d 28a5a: f0 92 7e 05 sts 0x057E, r15 ; 0x80057e #endif { #if ( (defined(Y_MIN_PIN) && (Y_MIN_PIN > -1)) || defined(TMC2130_SG_HOMING) ) && !defined(DEBUG_DISABLE_YMINLIMIT) #ifdef TMC2130_SG_HOMING // Stall guard homing turned on SET_BIT_TO(_endstop, Y_AXIS, (!READ(Y_TMC2130_DIAG))); 28a5e: 40 91 06 01 lds r20, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> } #endif } #ifndef COREXY if ((out_bits & (1< #endif { #if ( (defined(Y_MIN_PIN) && (Y_MIN_PIN > -1)) || defined(TMC2130_SG_HOMING) ) && !defined(DEBUG_DISABLE_YMINLIMIT) #ifdef TMC2130_SG_HOMING // Stall guard homing turned on SET_BIT_TO(_endstop, Y_AXIS, (!READ(Y_TMC2130_DIAG))); 28a66: 47 fd sbrc r20, 7 28a68: 6c c0 rjmp .+216 ; 0x28b42 <__vector_17+0x510> 28a6a: 82 60 ori r24, 0x02 ; 2 #else // Normal homing SET_BIT_TO(_endstop, Y_AXIS, (READ(Y_MIN_PIN) != Y_MIN_ENDSTOP_INVERTING)); #endif if((_endstop & _old_endstop & _BV(Y_AXIS)) && (current_block->steps[Y_AXIS].wide > 0)) { 28a6c: 49 2f mov r20, r25 28a6e: 42 70 andi r20, 0x02 ; 2 SET_BIT_TO(_endstop, Y_AXIS + 4, (!READ(Y_TMC2130_DIAG))); #else // Normal homing SET_BIT_TO(_endstop, Y_AXIS + 4, (READ(Y_MAX_PIN) != Y_MAX_ENDSTOP_INVERTING)); #endif if((_endstop & _old_endstop & _BV(Y_AXIS + 4)) && (current_block->steps[Y_AXIS].wide > 0)){ 28a70: 48 23 and r20, r24 28a72: b1 f0 breq .+44 ; 0x28aa0 <__vector_17+0x46e> 28a74: c4 80 ldd r12, Z+4 ; 0x04 28a76: d5 80 ldd r13, Z+5 ; 0x05 28a78: e6 80 ldd r14, Z+6 ; 0x06 28a7a: f7 80 ldd r15, Z+7 ; 0x07 28a7c: 1c 14 cp r1, r12 28a7e: 1d 04 cpc r1, r13 28a80: 1e 04 cpc r1, r14 28a82: 1f 04 cpc r1, r15 28a84: 6c f4 brge .+26 ; 0x28aa0 <__vector_17+0x46e> #ifdef VERBOSE_CHECK_HIT_ENDSTOPS endstops_trigsteps[Y_AXIS] = count_position[Y_AXIS]; #endif //VERBOSE_CHECK_HIT_ENDSTOPS _endstop_hit |= _BV(Y_AXIS); 28a86: 22 60 ori r18, 0x02 ; 2 step_events_completed.wide = current_block->step_event_count.wide; 28a88: c0 88 ldd r12, Z+16 ; 0x10 28a8a: d1 88 ldd r13, Z+17 ; 0x11 28a8c: e2 88 ldd r14, Z+18 ; 0x12 28a8e: f3 88 ldd r15, Z+19 ; 0x13 28a90: c0 92 7b 05 sts 0x057B, r12 ; 0x80057b 28a94: d0 92 7c 05 sts 0x057C, r13 ; 0x80057c 28a98: e0 92 7d 05 sts 0x057D, r14 ; 0x80057d 28a9c: f0 92 7e 05 sts 0x057E, r15 ; 0x80057e } #endif } if ((out_bits & (1< { #if defined(Z_MIN_PIN) && (Z_MIN_PIN > -1) && !defined(DEBUG_DISABLE_ZMINLIMIT) if (! check_z_endstop) { 28aa4: 51 11 cpse r21, r1 28aa6: 77 c0 rjmp .+238 ; 0x28b96 <__vector_17+0x564> #ifdef TMC2130_SG_HOMING // Stall guard homing turned on #ifdef TMC2130_STEALTH_Z if ((tmc2130_mode == TMC2130_MODE_SILENT) && !(tmc2130_sg_homing_axes_mask & 0x04)) 28aa8: 30 91 8b 06 lds r19, 0x068B ; 0x80068b 28aac: 31 30 cpi r19, 0x01 ; 1 28aae: 09 f0 breq .+2 ; 0x28ab2 <__vector_17+0x480> 28ab0: 52 c0 rjmp .+164 ; 0x28b56 <__vector_17+0x524> 28ab2: 30 91 42 06 lds r19, 0x0642 ; 0x800642 28ab6: 32 fd sbrc r19, 2 28ab8: 4e c0 rjmp .+156 ; 0x28b56 <__vector_17+0x524> SET_BIT_TO(_endstop, Z_AXIS, (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING)); 28aba: 1c 9b sbis 0x03, 4 ; 3 28abc: 52 c0 rjmp .+164 ; 0x28b62 <__vector_17+0x530> else #endif //TMC2130_STEALTH_Z SET_BIT_TO(_endstop, Z_AXIS, (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING) || (!READ(Z_TMC2130_DIAG))); 28abe: 84 60 ori r24, 0x04 ; 4 28ac0: 51 c0 rjmp .+162 ; 0x28b64 <__vector_17+0x532> // Set the direction bits (X_AXIS=A_AXIS and Y_AXIS=B_AXIS for COREXY) if((out_bits & (1< 28ac6: 8e 7f andi r24, 0xFE ; 254 28ac8: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[X_AXIS]=1; 28acc: 81 e0 ldi r24, 0x01 ; 1 28ace: 6f cf rjmp .-290 ; 0x289ae <__vector_17+0x37c> } if((out_bits & (1< 28ad4: 82 60 ori r24, 0x02 ; 2 28ad6: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Y_AXIS]=1; 28ada: 81 e0 ldi r24, 0x01 ; 1 28adc: 74 cf rjmp .-280 ; 0x289c6 <__vector_17+0x394> } if ((out_bits & (1< 28ae2: 8b 7f andi r24, 0xFB ; 251 28ae4: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Z_AXIS]=1; 28ae8: 81 e0 ldi r24, 0x01 ; 1 28aea: 79 cf rjmp .-270 ; 0x289de <__vector_17+0x3ac> 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; 28aec: 81 e0 ldi r24, 0x01 ; 1 28aee: 7e cf rjmp .-260 ; 0x289ec <__vector_17+0x3ba> } } else { _NEXT_ISR(2000); // 1kHz. 28af0: 80 ed ldi r24, 0xD0 ; 208 28af2: 97 e0 ldi r25, 0x07 ; 7 28af4: 90 93 e5 04 sts 0x04E5, r25 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.476+0x1> 28af8: 80 93 e4 04 sts 0x04E4, r24 ; 0x8004e4 <_ZL11nextMainISR.lto_priv.476> 28afc: 90 93 e1 04 sts 0x04E1, r25 ; 0x8004e1 <_ZL9main_Rate.lto_priv.478+0x1> 28b00: 80 93 e0 04 sts 0x04E0, r24 ; 0x8004e0 <_ZL9main_Rate.lto_priv.478> #ifdef LIN_ADVANCE // reset LA state when there's no block nextAdvanceISR = ADV_NEVER; 28b04: 8f ef ldi r24, 0xFF ; 255 28b06: 9f ef ldi r25, 0xFF ; 255 28b08: 90 93 e3 04 sts 0x04E3, r25 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.477+0x1> 28b0c: 80 93 e2 04 sts 0x04E2, r24 ; 0x8004e2 <_ZL14nextAdvanceISR.lto_priv.477> e_steps = 0; 28b10: 10 92 91 05 sts 0x0591, r1 ; 0x800591 // incrementally lose pressure to give a chance for // a new LA block to be scheduled and recover if(current_adv_steps) 28b14: 80 91 de 04 lds r24, 0x04DE ; 0x8004de <_ZL17current_adv_steps.lto_priv.479> 28b18: 90 91 df 04 lds r25, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.479+0x1> 28b1c: 00 97 sbiw r24, 0x00 ; 0 28b1e: 09 f4 brne .+2 ; 0x28b22 <__vector_17+0x4f0> 28b20: 67 cf rjmp .-306 ; 0x289f0 <__vector_17+0x3be> --current_adv_steps; 28b22: 01 97 sbiw r24, 0x01 ; 1 28b24: 90 93 df 04 sts 0x04DF, r25 ; 0x8004df <_ZL17current_adv_steps.lto_priv.479+0x1> 28b28: 80 93 de 04 sts 0x04DE, r24 ; 0x8004de <_ZL17current_adv_steps.lto_priv.479> 28b2c: 61 cf rjmp .-318 ; 0x289f0 <__vector_17+0x3be> #endif { #if ( (defined(X_MIN_PIN) && (X_MIN_PIN > -1)) || defined(TMC2130_SG_HOMING) ) && !defined(DEBUG_DISABLE_XMINLIMIT) #ifdef TMC2130_SG_HOMING // Stall guard homing turned on SET_BIT_TO(_endstop, X_AXIS, (!READ(X_TMC2130_DIAG))); 28b2e: 8e 7f andi r24, 0xFE ; 254 28b30: 7c cf rjmp .-264 ; 0x28a2a <__vector_17+0x3f8> #endif } else { // +direction #if ( (defined(X_MAX_PIN) && (X_MAX_PIN > -1)) || defined(TMC2130_SG_HOMING) ) && !defined(DEBUG_DISABLE_XMAXLIMIT) #ifdef TMC2130_SG_HOMING // Stall guard homing turned on SET_BIT_TO(_endstop, X_AXIS + 4, (!READ(X_TMC2130_DIAG))); 28b32: 42 fd sbrc r20, 2 28b34: 04 c0 rjmp .+8 ; 0x28b3e <__vector_17+0x50c> 28b36: 80 61 ori r24, 0x10 ; 16 #else // Normal homing SET_BIT_TO(_endstop, X_AXIS + 4, (READ(X_MAX_PIN) != X_MAX_ENDSTOP_INVERTING)); #endif if((_endstop & _old_endstop & _BV(X_AXIS + 4)) && (current_block->steps[X_AXIS].wide > 0)){ 28b38: 49 2f mov r20, r25 28b3a: 40 71 andi r20, 0x10 ; 16 28b3c: 78 cf rjmp .-272 ; 0x28a2e <__vector_17+0x3fc> #endif } else { // +direction #if ( (defined(X_MAX_PIN) && (X_MAX_PIN > -1)) || defined(TMC2130_SG_HOMING) ) && !defined(DEBUG_DISABLE_XMAXLIMIT) #ifdef TMC2130_SG_HOMING // Stall guard homing turned on SET_BIT_TO(_endstop, X_AXIS + 4, (!READ(X_TMC2130_DIAG))); 28b3e: 8f 7e andi r24, 0xEF ; 239 28b40: fb cf rjmp .-10 ; 0x28b38 <__vector_17+0x506> #endif { #if ( (defined(Y_MIN_PIN) && (Y_MIN_PIN > -1)) || defined(TMC2130_SG_HOMING) ) && !defined(DEBUG_DISABLE_YMINLIMIT) #ifdef TMC2130_SG_HOMING // Stall guard homing turned on SET_BIT_TO(_endstop, Y_AXIS, (!READ(Y_TMC2130_DIAG))); 28b42: 8d 7f andi r24, 0xFD ; 253 28b44: 93 cf rjmp .-218 ; 0x28a6c <__vector_17+0x43a> #endif } else { // +direction #if ( (defined(Y_MAX_PIN) && (Y_MAX_PIN > -1)) || defined(TMC2130_SG_HOMING) ) && !defined(DEBUG_DISABLE_YMAXLIMIT) #ifdef TMC2130_SG_HOMING // Stall guard homing turned on SET_BIT_TO(_endstop, Y_AXIS + 4, (!READ(Y_TMC2130_DIAG))); 28b46: 47 fd sbrc r20, 7 28b48: 04 c0 rjmp .+8 ; 0x28b52 <__vector_17+0x520> 28b4a: 80 62 ori r24, 0x20 ; 32 #else // Normal homing SET_BIT_TO(_endstop, Y_AXIS + 4, (READ(Y_MAX_PIN) != Y_MAX_ENDSTOP_INVERTING)); #endif if((_endstop & _old_endstop & _BV(Y_AXIS + 4)) && (current_block->steps[Y_AXIS].wide > 0)){ 28b4c: 49 2f mov r20, r25 28b4e: 40 72 andi r20, 0x20 ; 32 28b50: 8f cf rjmp .-226 ; 0x28a70 <__vector_17+0x43e> #endif } else { // +direction #if ( (defined(Y_MAX_PIN) && (Y_MAX_PIN > -1)) || defined(TMC2130_SG_HOMING) ) && !defined(DEBUG_DISABLE_YMAXLIMIT) #ifdef TMC2130_SG_HOMING // Stall guard homing turned on SET_BIT_TO(_endstop, Y_AXIS + 4, (!READ(Y_TMC2130_DIAG))); 28b52: 8f 7d andi r24, 0xDF ; 223 28b54: fb cf rjmp .-10 ; 0x28b4c <__vector_17+0x51a> #ifdef TMC2130_STEALTH_Z if ((tmc2130_mode == TMC2130_MODE_SILENT) && !(tmc2130_sg_homing_axes_mask & 0x04)) 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))); 28b56: 1c 99 sbic 0x03, 4 ; 3 28b58: b2 cf rjmp .-156 ; 0x28abe <__vector_17+0x48c> 28b5a: 30 91 06 01 lds r19, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 28b5e: 36 ff sbrs r19, 6 28b60: ae cf rjmp .-164 ; 0x28abe <__vector_17+0x48c> 28b62: 8b 7f andi r24, 0xFB ; 251 #else SET_BIT_TO(_endstop, Z_AXIS, (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING)); #endif //TMC2130_SG_HOMING if((_endstop & _old_endstop & _BV(Z_AXIS)) && (current_block->steps[Z_AXIS].wide > 0)) { 28b64: 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)) { 28b66: 98 23 and r25, r24 28b68: b1 f0 breq .+44 ; 0x28b96 <__vector_17+0x564> 28b6a: c0 84 ldd r12, Z+8 ; 0x08 28b6c: d1 84 ldd r13, Z+9 ; 0x09 28b6e: e2 84 ldd r14, Z+10 ; 0x0a 28b70: f3 84 ldd r15, Z+11 ; 0x0b 28b72: 1c 14 cp r1, r12 28b74: 1d 04 cpc r1, r13 28b76: 1e 04 cpc r1, r14 28b78: 1f 04 cpc r1, r15 28b7a: 6c f4 brge .+26 ; 0x28b96 <__vector_17+0x564> #ifdef VERBOSE_CHECK_HIT_ENDSTOPS endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS]; #endif //VERBOSE_CHECK_HIT_ENDSTOPS _endstop_hit |= _BV(Z_AXIS); 28b7c: 24 60 ori r18, 0x04 ; 4 step_events_completed.wide = current_block->step_event_count.wide; 28b7e: c0 88 ldd r12, Z+16 ; 0x10 28b80: d1 88 ldd r13, Z+17 ; 0x11 28b82: e2 88 ldd r14, Z+18 ; 0x12 28b84: f3 88 ldd r15, Z+19 ; 0x13 28b86: c0 92 7b 05 sts 0x057B, r12 ; 0x80057b 28b8a: d0 92 7c 05 sts 0x057C, r13 ; 0x80057c 28b8e: e0 92 7d 05 sts 0x057D, r14 ; 0x80057d 28b92: f0 92 7e 05 sts 0x057E, r15 ; 0x80057e } #endif } endstop = _endstop; 28b96: 80 93 79 05 sts 0x0579, r24 ; 0x800579 old_endstop = _endstop; //apply current endstop state to the old endstop 28b9a: 80 93 78 05 sts 0x0578, r24 ; 0x800578 endstop_hit = _endstop_hit; 28b9e: 20 93 0a 05 sts 0x050A, r18 ; 0x80050a <_ZL11endstop_hit.lto_priv.480> } // 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) { 28ba2: 55 23 and r21, r21 28ba4: 09 f4 brne .+2 ; 0x28ba8 <__vector_17+0x576> 28ba6: 40 c0 rjmp .+128 ; 0x28c28 <__vector_17+0x5f6> uint8_t _endstop_hit = endstop_hit; 28ba8: 20 91 0a 05 lds r18, 0x050A ; 0x80050a <_ZL11endstop_hit.lto_priv.480> uint8_t _endstop = endstop; 28bac: 80 91 79 05 lds r24, 0x0579 ; 0x800579 uint8_t _old_endstop = old_endstop; 28bb0: 90 91 78 05 lds r25, 0x0578 ; 0x800578 // Check the Z min end-stop no matter what. // Good for searching for the center of an induction target. #ifdef TMC2130_SG_HOMING // Stall guard homing turned on #ifdef TMC2130_STEALTH_Z if ((tmc2130_mode == TMC2130_MODE_SILENT) && !(tmc2130_sg_homing_axes_mask & 0x04)) 28bb4: 30 91 8b 06 lds r19, 0x068B ; 0x80068b 28bb8: 31 30 cpi r19, 0x01 ; 1 28bba: c9 f4 brne .+50 ; 0x28bee <__vector_17+0x5bc> 28bbc: 30 91 42 06 lds r19, 0x0642 ; 0x800642 28bc0: 32 fd sbrc r19, 2 28bc2: 15 c0 rjmp .+42 ; 0x28bee <__vector_17+0x5bc> SET_BIT_TO(_endstop, Z_AXIS, (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING)); 28bc4: 1c 9b sbis 0x03, 4 ; 3 28bc6: 19 c0 rjmp .+50 ; 0x28bfa <__vector_17+0x5c8> else #endif //TMC2130_STEALTH_Z SET_BIT_TO(_endstop, Z_AXIS, (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING) || (!READ(Z_TMC2130_DIAG))); 28bc8: 84 60 ori r24, 0x04 ; 4 28bca: 18 c0 rjmp .+48 ; 0x28bfc <__vector_17+0x5ca> } else { // +direction #if defined(Z_MAX_PIN) && (Z_MAX_PIN > -1) && !defined(DEBUG_DISABLE_ZMAXLIMIT) #ifdef TMC2130_SG_HOMING // Stall guard homing turned on #ifdef TMC2130_STEALTH_Z if ((tmc2130_mode == TMC2130_MODE_SILENT) && !(tmc2130_sg_homing_axes_mask & 0x04)) 28bcc: 30 91 8b 06 lds r19, 0x068B ; 0x80068b 28bd0: 31 30 cpi r19, 0x01 ; 1 28bd2: 31 f4 brne .+12 ; 0x28be0 <__vector_17+0x5ae> 28bd4: 30 91 42 06 lds r19, 0x0642 ; 0x800642 28bd8: 32 fd sbrc r19, 2 28bda: 02 c0 rjmp .+4 ; 0x28be0 <__vector_17+0x5ae> SET_BIT_TO(_endstop, Z_AXIS + 4, 0); else #endif //TMC2130_STEALTH_Z SET_BIT_TO(_endstop, Z_AXIS + 4, (!READ(Z_TMC2130_DIAG))); 28bdc: 8f 7b andi r24, 0xBF ; 191 28bde: 05 c0 rjmp .+10 ; 0x28bea <__vector_17+0x5b8> 28be0: 30 91 06 01 lds r19, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 28be4: 36 fd sbrc r19, 6 28be6: fa cf rjmp .-12 ; 0x28bdc <__vector_17+0x5aa> 28be8: 80 64 ori r24, 0x40 ; 64 #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)) { 28bea: 90 74 andi r25, 0x40 ; 64 28bec: bc cf rjmp .-136 ; 0x28b66 <__vector_17+0x534> #ifdef TMC2130_STEALTH_Z if ((tmc2130_mode == TMC2130_MODE_SILENT) && !(tmc2130_sg_homing_axes_mask & 0x04)) 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))); 28bee: 1c 99 sbic 0x03, 4 ; 3 28bf0: eb cf rjmp .-42 ; 0x28bc8 <__vector_17+0x596> 28bf2: 30 91 06 01 lds r19, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 28bf6: 36 ff sbrs r19, 6 28bf8: e7 cf rjmp .-50 ; 0x28bc8 <__vector_17+0x596> 28bfa: 8b 7f andi r24, 0xFB ; 251 #else SET_BIT_TO(_endstop, Z_AXIS, (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING)); #endif //TMC2130_SG_HOMING if(_endstop & _old_endstop & _BV(Z_AXIS)) { 28bfc: 94 70 andi r25, 0x04 ; 4 28bfe: 98 23 and r25, r24 28c00: 69 f0 breq .+26 ; 0x28c1c <__vector_17+0x5ea> #ifdef VERBOSE_CHECK_HIT_ENDSTOPS endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS]; #endif //VERBOSE_CHECK_HIT_ENDSTOPS _endstop_hit |= _BV(Z_AXIS); 28c02: 24 60 ori r18, 0x04 ; 4 step_events_completed.wide = current_block->step_event_count.wide; 28c04: 40 89 ldd r20, Z+16 ; 0x10 28c06: 51 89 ldd r21, Z+17 ; 0x11 28c08: 62 89 ldd r22, Z+18 ; 0x12 28c0a: 73 89 ldd r23, Z+19 ; 0x13 28c0c: 40 93 7b 05 sts 0x057B, r20 ; 0x80057b 28c10: 50 93 7c 05 sts 0x057C, r21 ; 0x80057c 28c14: 60 93 7d 05 sts 0x057D, r22 ; 0x80057d 28c18: 70 93 7e 05 sts 0x057E, r23 ; 0x80057e } endstop = _endstop; 28c1c: 80 93 79 05 sts 0x0579, r24 ; 0x800579 old_endstop = _endstop; //apply current endstop state to the old endstop 28c20: 80 93 78 05 sts 0x0578, r24 ; 0x800578 endstop_hit = _endstop_hit; 28c24: 20 93 0a 05 sts 0x050A, r18 ; 0x80050a <_ZL11endstop_hit.lto_priv.480> stepper_next_block(); if (current_block != NULL) { stepper_check_endstops(); if (current_block->flag & BLOCK_FLAG_DDA_LOWRES) 28c28: 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) 28c2a: c0 e0 ldi r28, 0x00 ; 0 MSerial.checkRx(); // Check for serial chars. // Step in X axis counter[X_AXIS].lo += current_block->steps[X_AXIS].lo; if (counter[X_AXIS].lo > 0) { STEP_NC_HI(X_AXIS); 28c2c: d1 e0 ldi r29, 0x01 ; 1 #endif //DEBUG_XSTEP_DUP_PIN } // Step in Y axis counter[Y_AXIS].lo += current_block->steps[Y_AXIS].lo; if (counter[Y_AXIS].lo > 0) { STEP_NC_HI(Y_AXIS); 28c2e: 12 e0 ldi r17, 0x02 ; 2 #endif //DEBUG_YSTEP_DUP_PIN } // Step in Z axis counter[Z_AXIS].lo += current_block->steps[Z_AXIS].lo; if (counter[Z_AXIS].lo > 0) { STEP_NC_HI(Z_AXIS); 28c30: 04 e0 ldi r16, 0x04 ; 4 stepper_next_block(); if (current_block != NULL) { stepper_check_endstops(); if (current_block->flag & BLOCK_FLAG_DDA_LOWRES) 28c32: 83 ff sbrs r24, 3 28c34: 08 c1 rjmp .+528 ; 0x28e46 <__vector_17+0x814> } FORCE_INLINE void stepper_tick_lowres() { for (uint8_t i=0; i < step_loops; ++ i) { // Take multiple steps per interrupt (For high speed moves) 28c36: 80 91 98 05 lds r24, 0x0598 ; 0x800598 28c3a: c8 17 cp r28, r24 28c3c: 08 f0 brcs .+2 ; 0x28c40 <__vector_17+0x60e> 28c3e: 72 c2 rjmp .+1252 ; 0x29124 <__vector_17+0xaf2> MSerial.checkRx(); // Check for serial chars. 28c40: 0f 94 eb 13 call 0x227d6 ; 0x227d6 // Step in X axis counter[X_AXIS].lo += current_block->steps[X_AXIS].lo; 28c44: e0 91 a0 05 lds r30, 0x05A0 ; 0x8005a0 28c48: f0 91 a1 05 lds r31, 0x05A1 ; 0x8005a1 28c4c: 80 81 ld r24, Z 28c4e: 91 81 ldd r25, Z+1 ; 0x01 28c50: 20 91 80 05 lds r18, 0x0580 ; 0x800580 28c54: 30 91 81 05 lds r19, 0x0581 ; 0x800581 28c58: 82 0f add r24, r18 28c5a: 93 1f adc r25, r19 28c5c: 90 93 81 05 sts 0x0581, r25 ; 0x800581 28c60: 80 93 80 05 sts 0x0580, r24 ; 0x800580 if (counter[X_AXIS].lo > 0) { 28c64: 18 16 cp r1, r24 28c66: 19 06 cpc r1, r25 28c68: 64 f5 brge .+88 ; 0x28cc2 <__vector_17+0x690> STEP_NC_HI(X_AXIS); 28c6a: d6 b9 out 0x06, r29 ; 6 #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; 28c6c: e0 91 a0 05 lds r30, 0x05A0 ; 0x8005a0 28c70: f0 91 a1 05 lds r31, 0x05A1 ; 0x8005a1 28c74: 80 91 80 05 lds r24, 0x0580 ; 0x800580 28c78: 90 91 81 05 lds r25, 0x0581 ; 0x800581 28c7c: 20 89 ldd r18, Z+16 ; 0x10 28c7e: 31 89 ldd r19, Z+17 ; 0x11 28c80: 82 1b sub r24, r18 28c82: 93 0b sbc r25, r19 28c84: 90 93 81 05 sts 0x0581, r25 ; 0x800581 28c88: 80 93 80 05 sts 0x0580, r24 ; 0x800580 count_position[X_AXIS]+=count_direction[X_AXIS]; 28c8c: 90 91 97 02 lds r25, 0x0297 ; 0x800297 28c90: 40 91 b2 06 lds r20, 0x06B2 ; 0x8006b2 28c94: 50 91 b3 06 lds r21, 0x06B3 ; 0x8006b3 28c98: 60 91 b4 06 lds r22, 0x06B4 ; 0x8006b4 28c9c: 70 91 b5 06 lds r23, 0x06B5 ; 0x8006b5 28ca0: 89 2f mov r24, r25 28ca2: 99 0f add r25, r25 28ca4: 99 0b sbc r25, r25 28ca6: aa 0b sbc r26, r26 28ca8: bb 0b sbc r27, r27 28caa: 84 0f add r24, r20 28cac: 95 1f adc r25, r21 28cae: a6 1f adc r26, r22 28cb0: b7 1f adc r27, r23 28cb2: 80 93 b2 06 sts 0x06B2, r24 ; 0x8006b2 28cb6: 90 93 b3 06 sts 0x06B3, r25 ; 0x8006b3 28cba: a0 93 b4 06 sts 0x06B4, r26 ; 0x8006b4 28cbe: b0 93 b5 06 sts 0x06B5, r27 ; 0x8006b5 #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; 28cc2: e0 91 a0 05 lds r30, 0x05A0 ; 0x8005a0 28cc6: f0 91 a1 05 lds r31, 0x05A1 ; 0x8005a1 28cca: 84 81 ldd r24, Z+4 ; 0x04 28ccc: 95 81 ldd r25, Z+5 ; 0x05 28cce: 20 91 84 05 lds r18, 0x0584 ; 0x800584 28cd2: 30 91 85 05 lds r19, 0x0585 ; 0x800585 28cd6: 82 0f add r24, r18 28cd8: 93 1f adc r25, r19 28cda: 90 93 85 05 sts 0x0585, r25 ; 0x800585 28cde: 80 93 84 05 sts 0x0584, r24 ; 0x800584 if (counter[Y_AXIS].lo > 0) { 28ce2: 18 16 cp r1, r24 28ce4: 19 06 cpc r1, r25 28ce6: 44 f5 brge .+80 ; 0x28d38 <__vector_17+0x706> STEP_NC_HI(Y_AXIS); 28ce8: 16 b9 out 0x06, r17 ; 6 #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; 28cea: e0 91 a0 05 lds r30, 0x05A0 ; 0x8005a0 28cee: f0 91 a1 05 lds r31, 0x05A1 ; 0x8005a1 28cf2: 20 89 ldd r18, Z+16 ; 0x10 28cf4: 31 89 ldd r19, Z+17 ; 0x11 28cf6: 82 1b sub r24, r18 28cf8: 93 0b sbc r25, r19 28cfa: 90 93 85 05 sts 0x0585, r25 ; 0x800585 28cfe: 80 93 84 05 sts 0x0584, r24 ; 0x800584 count_position[Y_AXIS]+=count_direction[Y_AXIS]; 28d02: 90 91 98 02 lds r25, 0x0298 ; 0x800298 28d06: 40 91 b6 06 lds r20, 0x06B6 ; 0x8006b6 28d0a: 50 91 b7 06 lds r21, 0x06B7 ; 0x8006b7 28d0e: 60 91 b8 06 lds r22, 0x06B8 ; 0x8006b8 28d12: 70 91 b9 06 lds r23, 0x06B9 ; 0x8006b9 28d16: 89 2f mov r24, r25 28d18: 99 0f add r25, r25 28d1a: 99 0b sbc r25, r25 28d1c: aa 0b sbc r26, r26 28d1e: bb 0b sbc r27, r27 28d20: 84 0f add r24, r20 28d22: 95 1f adc r25, r21 28d24: a6 1f adc r26, r22 28d26: b7 1f adc r27, r23 28d28: 80 93 b6 06 sts 0x06B6, r24 ; 0x8006b6 28d2c: 90 93 b7 06 sts 0x06B7, r25 ; 0x8006b7 28d30: a0 93 b8 06 sts 0x06B8, r26 ; 0x8006b8 28d34: b0 93 b9 06 sts 0x06B9, r27 ; 0x8006b9 #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; 28d38: e0 91 a0 05 lds r30, 0x05A0 ; 0x8005a0 28d3c: f0 91 a1 05 lds r31, 0x05A1 ; 0x8005a1 28d40: 80 85 ldd r24, Z+8 ; 0x08 28d42: 91 85 ldd r25, Z+9 ; 0x09 28d44: 20 91 88 05 lds r18, 0x0588 ; 0x800588 28d48: 30 91 89 05 lds r19, 0x0589 ; 0x800589 28d4c: 82 0f add r24, r18 28d4e: 93 1f adc r25, r19 28d50: 90 93 89 05 sts 0x0589, r25 ; 0x800589 28d54: 80 93 88 05 sts 0x0588, r24 ; 0x800588 if (counter[Z_AXIS].lo > 0) { 28d58: 18 16 cp r1, r24 28d5a: 19 06 cpc r1, r25 28d5c: 44 f5 brge .+80 ; 0x28dae <__vector_17+0x77c> STEP_NC_HI(Z_AXIS); 28d5e: 06 b9 out 0x06, r16 ; 6 counter[Z_AXIS].lo -= current_block->step_event_count.lo; 28d60: e0 91 a0 05 lds r30, 0x05A0 ; 0x8005a0 28d64: f0 91 a1 05 lds r31, 0x05A1 ; 0x8005a1 28d68: 20 89 ldd r18, Z+16 ; 0x10 28d6a: 31 89 ldd r19, Z+17 ; 0x11 28d6c: 82 1b sub r24, r18 28d6e: 93 0b sbc r25, r19 28d70: 90 93 89 05 sts 0x0589, r25 ; 0x800589 28d74: 80 93 88 05 sts 0x0588, r24 ; 0x800588 count_position[Z_AXIS]+=count_direction[Z_AXIS]; 28d78: 90 91 99 02 lds r25, 0x0299 ; 0x800299 28d7c: 40 91 ba 06 lds r20, 0x06BA ; 0x8006ba 28d80: 50 91 bb 06 lds r21, 0x06BB ; 0x8006bb 28d84: 60 91 bc 06 lds r22, 0x06BC ; 0x8006bc 28d88: 70 91 bd 06 lds r23, 0x06BD ; 0x8006bd 28d8c: 89 2f mov r24, r25 28d8e: 99 0f add r25, r25 28d90: 99 0b sbc r25, r25 28d92: aa 0b sbc r26, r26 28d94: bb 0b sbc r27, r27 28d96: 84 0f add r24, r20 28d98: 95 1f adc r25, r21 28d9a: a6 1f adc r26, r22 28d9c: b7 1f adc r27, r23 28d9e: 80 93 ba 06 sts 0x06BA, r24 ; 0x8006ba 28da2: 90 93 bb 06 sts 0x06BB, r25 ; 0x8006bb 28da6: a0 93 bc 06 sts 0x06BC, r26 ; 0x8006bc 28daa: b0 93 bd 06 sts 0x06BD, r27 ; 0x8006bd STEP_NC_LO(Z_AXIS); } // Step in E axis counter[E_AXIS].lo += current_block->steps[E_AXIS].lo; 28dae: e0 91 a0 05 lds r30, 0x05A0 ; 0x8005a0 28db2: f0 91 a1 05 lds r31, 0x05A1 ; 0x8005a1 28db6: 80 91 8c 05 lds r24, 0x058C ; 0x80058c 28dba: 90 91 8d 05 lds r25, 0x058D ; 0x80058d 28dbe: 24 85 ldd r18, Z+12 ; 0x0c 28dc0: 35 85 ldd r19, Z+13 ; 0x0d 28dc2: 82 0f add r24, r18 28dc4: 93 1f adc r25, r19 28dc6: 90 93 8d 05 sts 0x058D, r25 ; 0x80058d 28dca: 80 93 8c 05 sts 0x058C, r24 ; 0x80058c 28dce: 20 89 ldd r18, Z+16 ; 0x10 28dd0: 31 89 ldd r19, Z+17 ; 0x11 if (counter[E_AXIS].lo > 0) { 28dd2: 18 16 cp r1, r24 28dd4: 19 06 cpc r1, r25 28dd6: 44 f5 brge .+80 ; 0x28e28 <__vector_17+0x7f6> #ifndef LIN_ADVANCE STEP_NC_HI(E_AXIS); #endif /* LIN_ADVANCE */ counter[E_AXIS].lo -= current_block->step_event_count.lo; 28dd8: 82 1b sub r24, r18 28dda: 93 0b sbc r25, r19 28ddc: 90 93 8d 05 sts 0x058D, r25 ; 0x80058d 28de0: 80 93 8c 05 sts 0x058C, r24 ; 0x80058c count_position[E_AXIS] += count_direction[E_AXIS]; 28de4: 90 91 9a 02 lds r25, 0x029A ; 0x80029a 28de8: 40 91 be 06 lds r20, 0x06BE ; 0x8006be 28dec: 50 91 bf 06 lds r21, 0x06BF ; 0x8006bf 28df0: 60 91 c0 06 lds r22, 0x06C0 ; 0x8006c0 28df4: 70 91 c1 06 lds r23, 0x06C1 ; 0x8006c1 28df8: 89 2f mov r24, r25 28dfa: 99 0f add r25, r25 28dfc: 99 0b sbc r25, r25 28dfe: aa 0b sbc r26, r26 28e00: bb 0b sbc r27, r27 28e02: 84 0f add r24, r20 28e04: 95 1f adc r25, r21 28e06: a6 1f adc r26, r22 28e08: b7 1f adc r27, r23 28e0a: 80 93 be 06 sts 0x06BE, r24 ; 0x8006be 28e0e: 90 93 bf 06 sts 0x06BF, r25 ; 0x8006bf 28e12: a0 93 c0 06 sts 0x06C0, r26 ; 0x8006c0 28e16: b0 93 c1 06 sts 0x06C1, r27 ; 0x8006c1 #ifdef LIN_ADVANCE e_steps += count_direction[E_AXIS]; 28e1a: 90 91 9a 02 lds r25, 0x029A ; 0x80029a 28e1e: 80 91 91 05 lds r24, 0x0591 ; 0x800591 28e22: 89 0f add r24, r25 28e24: 80 93 91 05 sts 0x0591, r24 ; 0x800591 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) 28e28: 80 91 7b 05 lds r24, 0x057B ; 0x80057b 28e2c: 90 91 7c 05 lds r25, 0x057C ; 0x80057c 28e30: 01 96 adiw r24, 0x01 ; 1 28e32: 90 93 7c 05 sts 0x057C, r25 ; 0x80057c 28e36: 80 93 7b 05 sts 0x057B, r24 ; 0x80057b 28e3a: 82 17 cp r24, r18 28e3c: 93 07 cpc r25, r19 28e3e: 08 f0 brcs .+2 ; 0x28e42 <__vector_17+0x810> 28e40: 71 c1 rjmp .+738 ; 0x29124 <__vector_17+0xaf2> } FORCE_INLINE void stepper_tick_lowres() { for (uint8_t i=0; i < step_loops; ++ i) { // Take multiple steps per interrupt (For high speed moves) 28e42: cf 5f subi r28, 0xFF ; 255 28e44: f8 ce rjmp .-528 ; 0x28c36 <__vector_17+0x604> } } FORCE_INLINE void stepper_tick_highres() { for (uint8_t i=0; i < step_loops; ++ i) { // Take multiple steps per interrupt (For high speed moves) 28e46: 80 91 98 05 lds r24, 0x0598 ; 0x800598 28e4a: c8 17 cp r28, r24 28e4c: 08 f0 brcs .+2 ; 0x28e50 <__vector_17+0x81e> 28e4e: 6a c1 rjmp .+724 ; 0x29124 <__vector_17+0xaf2> MSerial.checkRx(); // Check for serial chars. 28e50: 0f 94 eb 13 call 0x227d6 ; 0x227d6 // Step in X axis counter[X_AXIS].wide += current_block->steps[X_AXIS].wide; 28e54: e0 91 a0 05 lds r30, 0x05A0 ; 0x8005a0 28e58: f0 91 a1 05 lds r31, 0x05A1 ; 0x8005a1 28e5c: 80 81 ld r24, Z 28e5e: 91 81 ldd r25, Z+1 ; 0x01 28e60: a2 81 ldd r26, Z+2 ; 0x02 28e62: b3 81 ldd r27, Z+3 ; 0x03 28e64: 40 91 80 05 lds r20, 0x0580 ; 0x800580 28e68: 50 91 81 05 lds r21, 0x0581 ; 0x800581 28e6c: 60 91 82 05 lds r22, 0x0582 ; 0x800582 28e70: 70 91 83 05 lds r23, 0x0583 ; 0x800583 28e74: 84 0f add r24, r20 28e76: 95 1f adc r25, r21 28e78: a6 1f adc r26, r22 28e7a: b7 1f adc r27, r23 28e7c: 80 93 80 05 sts 0x0580, r24 ; 0x800580 28e80: 90 93 81 05 sts 0x0581, r25 ; 0x800581 28e84: a0 93 82 05 sts 0x0582, r26 ; 0x800582 28e88: b0 93 83 05 sts 0x0583, r27 ; 0x800583 if (counter[X_AXIS].wide > 0) { 28e8c: 18 16 cp r1, r24 28e8e: 19 06 cpc r1, r25 28e90: 1a 06 cpc r1, r26 28e92: 1b 06 cpc r1, r27 28e94: c4 f5 brge .+112 ; 0x28f06 <__vector_17+0x8d4> STEP_NC_HI(X_AXIS); 28e96: d6 b9 out 0x06, r29 ; 6 #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; 28e98: e0 91 a0 05 lds r30, 0x05A0 ; 0x8005a0 28e9c: f0 91 a1 05 lds r31, 0x05A1 ; 0x8005a1 28ea0: 80 91 80 05 lds r24, 0x0580 ; 0x800580 28ea4: 90 91 81 05 lds r25, 0x0581 ; 0x800581 28ea8: a0 91 82 05 lds r26, 0x0582 ; 0x800582 28eac: b0 91 83 05 lds r27, 0x0583 ; 0x800583 28eb0: 40 89 ldd r20, Z+16 ; 0x10 28eb2: 51 89 ldd r21, Z+17 ; 0x11 28eb4: 62 89 ldd r22, Z+18 ; 0x12 28eb6: 73 89 ldd r23, Z+19 ; 0x13 28eb8: 84 1b sub r24, r20 28eba: 95 0b sbc r25, r21 28ebc: a6 0b sbc r26, r22 28ebe: b7 0b sbc r27, r23 28ec0: 80 93 80 05 sts 0x0580, r24 ; 0x800580 28ec4: 90 93 81 05 sts 0x0581, r25 ; 0x800581 28ec8: a0 93 82 05 sts 0x0582, r26 ; 0x800582 28ecc: b0 93 83 05 sts 0x0583, r27 ; 0x800583 count_position[X_AXIS]+=count_direction[X_AXIS]; 28ed0: 90 91 97 02 lds r25, 0x0297 ; 0x800297 28ed4: 40 91 b2 06 lds r20, 0x06B2 ; 0x8006b2 28ed8: 50 91 b3 06 lds r21, 0x06B3 ; 0x8006b3 28edc: 60 91 b4 06 lds r22, 0x06B4 ; 0x8006b4 28ee0: 70 91 b5 06 lds r23, 0x06B5 ; 0x8006b5 28ee4: 89 2f mov r24, r25 28ee6: 99 0f add r25, r25 28ee8: 99 0b sbc r25, r25 28eea: aa 0b sbc r26, r26 28eec: bb 0b sbc r27, r27 28eee: 84 0f add r24, r20 28ef0: 95 1f adc r25, r21 28ef2: a6 1f adc r26, r22 28ef4: b7 1f adc r27, r23 28ef6: 80 93 b2 06 sts 0x06B2, r24 ; 0x8006b2 28efa: 90 93 b3 06 sts 0x06B3, r25 ; 0x8006b3 28efe: a0 93 b4 06 sts 0x06B4, r26 ; 0x8006b4 28f02: b0 93 b5 06 sts 0x06B5, r27 ; 0x8006b5 #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; 28f06: e0 91 a0 05 lds r30, 0x05A0 ; 0x8005a0 28f0a: f0 91 a1 05 lds r31, 0x05A1 ; 0x8005a1 28f0e: 84 81 ldd r24, Z+4 ; 0x04 28f10: 95 81 ldd r25, Z+5 ; 0x05 28f12: a6 81 ldd r26, Z+6 ; 0x06 28f14: b7 81 ldd r27, Z+7 ; 0x07 28f16: 40 91 84 05 lds r20, 0x0584 ; 0x800584 28f1a: 50 91 85 05 lds r21, 0x0585 ; 0x800585 28f1e: 60 91 86 05 lds r22, 0x0586 ; 0x800586 28f22: 70 91 87 05 lds r23, 0x0587 ; 0x800587 28f26: 84 0f add r24, r20 28f28: 95 1f adc r25, r21 28f2a: a6 1f adc r26, r22 28f2c: b7 1f adc r27, r23 28f2e: 80 93 84 05 sts 0x0584, r24 ; 0x800584 28f32: 90 93 85 05 sts 0x0585, r25 ; 0x800585 28f36: a0 93 86 05 sts 0x0586, r26 ; 0x800586 28f3a: b0 93 87 05 sts 0x0587, r27 ; 0x800587 if (counter[Y_AXIS].wide > 0) { 28f3e: 18 16 cp r1, r24 28f40: 19 06 cpc r1, r25 28f42: 1a 06 cpc r1, r26 28f44: 1b 06 cpc r1, r27 28f46: 84 f5 brge .+96 ; 0x28fa8 <__vector_17+0x976> STEP_NC_HI(Y_AXIS); 28f48: 16 b9 out 0x06, r17 ; 6 #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; 28f4a: e0 91 a0 05 lds r30, 0x05A0 ; 0x8005a0 28f4e: f0 91 a1 05 lds r31, 0x05A1 ; 0x8005a1 28f52: 40 89 ldd r20, Z+16 ; 0x10 28f54: 51 89 ldd r21, Z+17 ; 0x11 28f56: 62 89 ldd r22, Z+18 ; 0x12 28f58: 73 89 ldd r23, Z+19 ; 0x13 28f5a: 84 1b sub r24, r20 28f5c: 95 0b sbc r25, r21 28f5e: a6 0b sbc r26, r22 28f60: b7 0b sbc r27, r23 28f62: 80 93 84 05 sts 0x0584, r24 ; 0x800584 28f66: 90 93 85 05 sts 0x0585, r25 ; 0x800585 28f6a: a0 93 86 05 sts 0x0586, r26 ; 0x800586 28f6e: b0 93 87 05 sts 0x0587, r27 ; 0x800587 count_position[Y_AXIS]+=count_direction[Y_AXIS]; 28f72: 90 91 98 02 lds r25, 0x0298 ; 0x800298 28f76: 40 91 b6 06 lds r20, 0x06B6 ; 0x8006b6 28f7a: 50 91 b7 06 lds r21, 0x06B7 ; 0x8006b7 28f7e: 60 91 b8 06 lds r22, 0x06B8 ; 0x8006b8 28f82: 70 91 b9 06 lds r23, 0x06B9 ; 0x8006b9 28f86: 89 2f mov r24, r25 28f88: 99 0f add r25, r25 28f8a: 99 0b sbc r25, r25 28f8c: aa 0b sbc r26, r26 28f8e: bb 0b sbc r27, r27 28f90: 84 0f add r24, r20 28f92: 95 1f adc r25, r21 28f94: a6 1f adc r26, r22 28f96: b7 1f adc r27, r23 28f98: 80 93 b6 06 sts 0x06B6, r24 ; 0x8006b6 28f9c: 90 93 b7 06 sts 0x06B7, r25 ; 0x8006b7 28fa0: a0 93 b8 06 sts 0x06B8, r26 ; 0x8006b8 28fa4: b0 93 b9 06 sts 0x06B9, r27 ; 0x8006b9 #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; 28fa8: e0 91 a0 05 lds r30, 0x05A0 ; 0x8005a0 28fac: f0 91 a1 05 lds r31, 0x05A1 ; 0x8005a1 28fb0: 80 85 ldd r24, Z+8 ; 0x08 28fb2: 91 85 ldd r25, Z+9 ; 0x09 28fb4: a2 85 ldd r26, Z+10 ; 0x0a 28fb6: b3 85 ldd r27, Z+11 ; 0x0b 28fb8: 40 91 88 05 lds r20, 0x0588 ; 0x800588 28fbc: 50 91 89 05 lds r21, 0x0589 ; 0x800589 28fc0: 60 91 8a 05 lds r22, 0x058A ; 0x80058a 28fc4: 70 91 8b 05 lds r23, 0x058B ; 0x80058b 28fc8: 84 0f add r24, r20 28fca: 95 1f adc r25, r21 28fcc: a6 1f adc r26, r22 28fce: b7 1f adc r27, r23 28fd0: 80 93 88 05 sts 0x0588, r24 ; 0x800588 28fd4: 90 93 89 05 sts 0x0589, r25 ; 0x800589 28fd8: a0 93 8a 05 sts 0x058A, r26 ; 0x80058a 28fdc: b0 93 8b 05 sts 0x058B, r27 ; 0x80058b if (counter[Z_AXIS].wide > 0) { 28fe0: 18 16 cp r1, r24 28fe2: 19 06 cpc r1, r25 28fe4: 1a 06 cpc r1, r26 28fe6: 1b 06 cpc r1, r27 28fe8: 84 f5 brge .+96 ; 0x2904a <__vector_17+0xa18> STEP_NC_HI(Z_AXIS); 28fea: 06 b9 out 0x06, r16 ; 6 counter[Z_AXIS].wide -= current_block->step_event_count.wide; 28fec: e0 91 a0 05 lds r30, 0x05A0 ; 0x8005a0 28ff0: f0 91 a1 05 lds r31, 0x05A1 ; 0x8005a1 28ff4: 40 89 ldd r20, Z+16 ; 0x10 28ff6: 51 89 ldd r21, Z+17 ; 0x11 28ff8: 62 89 ldd r22, Z+18 ; 0x12 28ffa: 73 89 ldd r23, Z+19 ; 0x13 28ffc: 84 1b sub r24, r20 28ffe: 95 0b sbc r25, r21 29000: a6 0b sbc r26, r22 29002: b7 0b sbc r27, r23 29004: 80 93 88 05 sts 0x0588, r24 ; 0x800588 29008: 90 93 89 05 sts 0x0589, r25 ; 0x800589 2900c: a0 93 8a 05 sts 0x058A, r26 ; 0x80058a 29010: b0 93 8b 05 sts 0x058B, r27 ; 0x80058b count_position[Z_AXIS]+=count_direction[Z_AXIS]; 29014: 90 91 99 02 lds r25, 0x0299 ; 0x800299 29018: 40 91 ba 06 lds r20, 0x06BA ; 0x8006ba 2901c: 50 91 bb 06 lds r21, 0x06BB ; 0x8006bb 29020: 60 91 bc 06 lds r22, 0x06BC ; 0x8006bc 29024: 70 91 bd 06 lds r23, 0x06BD ; 0x8006bd 29028: 89 2f mov r24, r25 2902a: 99 0f add r25, r25 2902c: 99 0b sbc r25, r25 2902e: aa 0b sbc r26, r26 29030: bb 0b sbc r27, r27 29032: 84 0f add r24, r20 29034: 95 1f adc r25, r21 29036: a6 1f adc r26, r22 29038: b7 1f adc r27, r23 2903a: 80 93 ba 06 sts 0x06BA, r24 ; 0x8006ba 2903e: 90 93 bb 06 sts 0x06BB, r25 ; 0x8006bb 29042: a0 93 bc 06 sts 0x06BC, r26 ; 0x8006bc 29046: b0 93 bd 06 sts 0x06BD, r27 ; 0x8006bd STEP_NC_LO(Z_AXIS); } // Step in E axis counter[E_AXIS].wide += current_block->steps[E_AXIS].wide; 2904a: e0 91 a0 05 lds r30, 0x05A0 ; 0x8005a0 2904e: f0 91 a1 05 lds r31, 0x05A1 ; 0x8005a1 29052: 80 91 8c 05 lds r24, 0x058C ; 0x80058c 29056: 90 91 8d 05 lds r25, 0x058D ; 0x80058d 2905a: a0 91 8e 05 lds r26, 0x058E ; 0x80058e 2905e: b0 91 8f 05 lds r27, 0x058F ; 0x80058f 29062: 44 85 ldd r20, Z+12 ; 0x0c 29064: 55 85 ldd r21, Z+13 ; 0x0d 29066: 66 85 ldd r22, Z+14 ; 0x0e 29068: 77 85 ldd r23, Z+15 ; 0x0f 2906a: 84 0f add r24, r20 2906c: 95 1f adc r25, r21 2906e: a6 1f adc r26, r22 29070: b7 1f adc r27, r23 29072: 80 93 8c 05 sts 0x058C, r24 ; 0x80058c 29076: 90 93 8d 05 sts 0x058D, r25 ; 0x80058d 2907a: a0 93 8e 05 sts 0x058E, r26 ; 0x80058e 2907e: b0 93 8f 05 sts 0x058F, r27 ; 0x80058f 29082: 40 89 ldd r20, Z+16 ; 0x10 29084: 51 89 ldd r21, Z+17 ; 0x11 29086: 62 89 ldd r22, Z+18 ; 0x12 29088: 73 89 ldd r23, Z+19 ; 0x13 if (counter[E_AXIS].wide > 0) { 2908a: 18 16 cp r1, r24 2908c: 19 06 cpc r1, r25 2908e: 1a 06 cpc r1, r26 29090: 1b 06 cpc r1, r27 29092: 74 f5 brge .+92 ; 0x290f0 <__vector_17+0xabe> #ifndef LIN_ADVANCE STEP_NC_HI(E_AXIS); #endif /* LIN_ADVANCE */ counter[E_AXIS].wide -= current_block->step_event_count.wide; 29094: 84 1b sub r24, r20 29096: 95 0b sbc r25, r21 29098: a6 0b sbc r26, r22 2909a: b7 0b sbc r27, r23 2909c: 80 93 8c 05 sts 0x058C, r24 ; 0x80058c 290a0: 90 93 8d 05 sts 0x058D, r25 ; 0x80058d 290a4: a0 93 8e 05 sts 0x058E, r26 ; 0x80058e 290a8: b0 93 8f 05 sts 0x058F, r27 ; 0x80058f count_position[E_AXIS] += count_direction[E_AXIS]; 290ac: 90 91 9a 02 lds r25, 0x029A ; 0x80029a 290b0: c0 90 be 06 lds r12, 0x06BE ; 0x8006be 290b4: d0 90 bf 06 lds r13, 0x06BF ; 0x8006bf 290b8: e0 90 c0 06 lds r14, 0x06C0 ; 0x8006c0 290bc: f0 90 c1 06 lds r15, 0x06C1 ; 0x8006c1 290c0: 89 2f mov r24, r25 290c2: 99 0f add r25, r25 290c4: 99 0b sbc r25, r25 290c6: aa 0b sbc r26, r26 290c8: bb 0b sbc r27, r27 290ca: 8c 0d add r24, r12 290cc: 9d 1d adc r25, r13 290ce: ae 1d adc r26, r14 290d0: bf 1d adc r27, r15 290d2: 80 93 be 06 sts 0x06BE, r24 ; 0x8006be 290d6: 90 93 bf 06 sts 0x06BF, r25 ; 0x8006bf 290da: a0 93 c0 06 sts 0x06C0, r26 ; 0x8006c0 290de: b0 93 c1 06 sts 0x06C1, r27 ; 0x8006c1 #ifdef LIN_ADVANCE e_steps += count_direction[E_AXIS]; 290e2: 90 91 9a 02 lds r25, 0x029A ; 0x80029a 290e6: 80 91 91 05 lds r24, 0x0591 ; 0x800591 290ea: 89 0f add r24, r25 290ec: 80 93 91 05 sts 0x0591, r24 ; 0x800591 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) 290f0: 80 91 7b 05 lds r24, 0x057B ; 0x80057b 290f4: 90 91 7c 05 lds r25, 0x057C ; 0x80057c 290f8: a0 91 7d 05 lds r26, 0x057D ; 0x80057d 290fc: b0 91 7e 05 lds r27, 0x057E ; 0x80057e 29100: 01 96 adiw r24, 0x01 ; 1 29102: a1 1d adc r26, r1 29104: b1 1d adc r27, r1 29106: 80 93 7b 05 sts 0x057B, r24 ; 0x80057b 2910a: 90 93 7c 05 sts 0x057C, r25 ; 0x80057c 2910e: a0 93 7d 05 sts 0x057D, r26 ; 0x80057d 29112: b0 93 7e 05 sts 0x057E, r27 ; 0x80057e 29116: 84 17 cp r24, r20 29118: 95 07 cpc r25, r21 2911a: a6 07 cpc r26, r22 2911c: b7 07 cpc r27, r23 2911e: 10 f4 brcc .+4 ; 0x29124 <__vector_17+0xaf2> } } FORCE_INLINE void stepper_tick_highres() { for (uint8_t i=0; i < step_loops; ++ i) { // Take multiple steps per interrupt (For high speed moves) 29120: cf 5f subi r28, 0xFF ; 255 29122: 91 ce rjmp .-734 ; 0x28e46 <__vector_17+0x814> else stepper_tick_highres(); #ifdef LIN_ADVANCE if (e_steps) WRITE_NC(E0_DIR_PIN, e_steps < 0? INVERT_E0_DIR: !INVERT_E0_DIR); 29124: 80 91 91 05 lds r24, 0x0591 ; 0x800591 29128: 88 23 and r24, r24 2912a: 39 f0 breq .+14 ; 0x2913a <__vector_17+0xb08> 2912c: 87 fd sbrc r24, 7 2912e: ee c0 rjmp .+476 ; 0x2930c <__vector_17+0xcda> 29130: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 29134: 80 64 ori r24, 0x40 ; 64 29136: 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) { 2913a: 40 91 7b 05 lds r20, 0x057B ; 0x80057b 2913e: 50 91 7c 05 lds r21, 0x057C ; 0x80057c 29142: 60 91 7d 05 lds r22, 0x057D ; 0x80057d 29146: 70 91 7e 05 lds r23, 0x057E ; 0x80057e 2914a: c0 91 a0 05 lds r28, 0x05A0 ; 0x8005a0 2914e: d0 91 a1 05 lds r29, 0x05A1 ; 0x8005a1 29152: 89 8d ldd r24, Y+25 ; 0x19 29154: 9a 8d ldd r25, Y+26 ; 0x1a 29156: ab 8d ldd r26, Y+27 ; 0x1b 29158: bc 8d ldd r27, Y+28 ; 0x1c 2915a: 84 17 cp r24, r20 2915c: 95 07 cpc r25, r21 2915e: a6 07 cpc r26, r22 29160: b7 07 cpc r27, r23 29162: 08 f4 brcc .+2 ; 0x29166 <__vector_17+0xb34> 29164: 34 c1 rjmp .+616 ; 0x293ce <__vector_17+0xd9c> // v = t * a -> acc_step_rate = acceleration_time * current_block->acceleration_rate acc_step_rate = MUL24x24R24(acceleration_time, current_block->acceleration_rate); 29166: 40 91 94 05 lds r20, 0x0594 ; 0x800594 2916a: 50 91 95 05 lds r21, 0x0595 ; 0x800595 2916e: 60 91 96 05 lds r22, 0x0596 ; 0x800596 29172: 70 91 97 05 lds r23, 0x0597 ; 0x800597 "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. ); 29176: cc 88 ldd r12, Y+20 ; 0x14 29178: dd 88 ldd r13, Y+21 ; 0x15 2917a: ee 88 ldd r14, Y+22 ; 0x16 2917c: aa 27 eor r26, r26 2917e: 4d 9d mul r20, r13 29180: b1 2d mov r27, r1 29182: 5e 9d mul r21, r14 29184: c0 01 movw r24, r0 29186: 6e 9d mul r22, r14 29188: 90 0d add r25, r0 2918a: 6d 9d mul r22, r13 2918c: 80 0d add r24, r0 2918e: 91 1d adc r25, r1 29190: 4e 9d mul r20, r14 29192: b0 0d add r27, r0 29194: 81 1d adc r24, r1 29196: 9a 1f adc r25, r26 29198: 5d 9d mul r21, r13 2919a: b0 0d add r27, r0 2919c: 81 1d adc r24, r1 2919e: 9a 1f adc r25, r26 291a0: 6c 9d mul r22, r12 291a2: b0 0d add r27, r0 291a4: 81 1d adc r24, r1 291a6: 9a 1f adc r25, r26 291a8: 5c 9d mul r21, r12 291aa: b1 0d add r27, r1 291ac: 8a 1f adc r24, r26 291ae: 9a 1f adc r25, r26 291b0: bb 0f add r27, r27 291b2: 8a 1f adc r24, r26 291b4: 9a 1f adc r25, r26 291b6: 11 24 eor r1, r1 acc_step_rate += uint16_t(current_block->initial_rate); 291b8: 2a ad ldd r18, Y+58 ; 0x3a 291ba: 3b ad ldd r19, Y+59 ; 0x3b 291bc: 82 0f add r24, r18 291be: 93 1f adc r25, r19 291c0: 90 93 9a 05 sts 0x059A, r25 ; 0x80059a 291c4: 80 93 99 05 sts 0x0599, r24 ; 0x800599 // upper limit if(acc_step_rate > uint16_t(current_block->nominal_rate)) 291c8: 2e a9 ldd r18, Y+54 ; 0x36 291ca: 3f a9 ldd r19, Y+55 ; 0x37 291cc: 28 17 cp r18, r24 291ce: 39 07 cpc r19, r25 291d0: 20 f4 brcc .+8 ; 0x291da <__vector_17+0xba8> acc_step_rate = current_block->nominal_rate; 291d2: 30 93 9a 05 sts 0x059A, r19 ; 0x80059a 291d6: 20 93 99 05 sts 0x0599, r18 ; 0x800599 // step_rate to timer interval uint16_t timer = calc_timer(acc_step_rate, step_loops); 291da: 80 91 99 05 lds r24, 0x0599 ; 0x800599 291de: 90 91 9a 05 lds r25, 0x059A ; 0x80059a #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; 291e2: 81 34 cpi r24, 0x41 ; 65 291e4: fc e9 ldi r31, 0x9C ; 156 291e6: 9f 07 cpc r25, r31 291e8: 08 f0 brcs .+2 ; 0x291ec <__vector_17+0xbba> 291ea: 94 c0 rjmp .+296 ; 0x29314 <__vector_17+0xce2> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 291ec: 81 32 cpi r24, 0x21 ; 33 291ee: 2e e4 ldi r18, 0x4E ; 78 291f0: 92 07 cpc r25, r18 291f2: 08 f4 brcc .+2 ; 0x291f6 <__vector_17+0xbc4> 291f4: 92 c0 rjmp .+292 ; 0x2931a <__vector_17+0xce8> step_rate = (step_rate >> 2)&0x3fff; 291f6: 96 95 lsr r25 291f8: 87 95 ror r24 291fa: 96 95 lsr r25 291fc: 87 95 ror r24 step_loops = 4; 291fe: 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; 29200: 20 93 98 05 sts 0x0598, r18 ; 0x800598 else { step_loops = 1; } if(step_rate < (F_CPU/500000)) step_rate = (F_CPU/500000); step_rate -= (F_CPU/500000); // Correct for minimal speed 29204: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 29206: 81 15 cp r24, r1 29208: f8 e0 ldi r31, 0x08 ; 8 2920a: 9f 07 cpc r25, r31 2920c: 08 f4 brcc .+2 ; 0x29210 <__vector_17+0xbde> 2920e: 97 c0 rjmp .+302 ; 0x2933e <__vector_17+0xd0c> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 29210: e9 2f mov r30, r25 29212: ff 27 eor r31, r31 29214: ee 0f add r30, r30 29216: ff 1f adc r31, r31 29218: ee 0f add r30, r30 2921a: ff 1f adc r31, r31 2921c: 9f 01 movw r18, r30 2921e: 22 57 subi r18, 0x72 ; 114 29220: 39 46 sbci r19, 0x69 ; 105 unsigned char tmp_step_rate = (step_rate & 0x00ff); uint16_t gain = (uint16_t)pgm_read_word_near(table_address+2); 29222: f9 01 movw r30, r18 29224: 32 96 adiw r30, 0x02 ; 2 29226: a5 91 lpm r26, Z+ 29228: b4 91 lpm r27, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 2922a: f9 01 movw r30, r18 2922c: 25 91 lpm r18, Z+ 2922e: 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. ); 29230: b8 9f mul r27, r24 29232: f0 01 movw r30, r0 29234: a8 9f mul r26, r24 29236: 00 0c add r0, r0 29238: e1 1d adc r30, r1 2923a: 11 24 eor r1, r1 2923c: f1 1d adc r31, 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); 2923e: c9 01 movw r24, r18 29240: 8e 1b sub r24, r30 29242: 9f 0b sbc r25, r31 29244: 84 36 cpi r24, 0x64 ; 100 29246: 91 05 cpc r25, r1 29248: 10 f4 brcc .+4 ; 0x2924e <__vector_17+0xc1c> 2924a: 84 e6 ldi r24, 0x64 ; 100 2924c: 90 e0 ldi r25, 0x00 ; 0 _NEXT_ISR(timer); 2924e: 90 93 e5 04 sts 0x04E5, r25 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.476+0x1> 29252: 80 93 e4 04 sts 0x04E4, r24 ; 0x8004e4 <_ZL11nextMainISR.lto_priv.476> 29256: 90 93 e1 04 sts 0x04E1, r25 ; 0x8004e1 <_ZL9main_Rate.lto_priv.478+0x1> 2925a: 80 93 e0 04 sts 0x04E0, r24 ; 0x8004e0 <_ZL9main_Rate.lto_priv.478> acceleration_time += timer; 2925e: 48 0f add r20, r24 29260: 59 1f adc r21, r25 29262: 61 1d adc r22, r1 29264: 71 1d adc r23, r1 29266: 40 93 94 05 sts 0x0594, r20 ; 0x800594 2926a: 50 93 95 05 sts 0x0595, r21 ; 0x800595 2926e: 60 93 96 05 sts 0x0596, r22 ; 0x800596 29272: 70 93 97 05 sts 0x0597, r23 ; 0x800597 #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 29276: fe 01 movw r30, r28 29278: e4 5b subi r30, 0xB4 ; 180 2927a: ff 4f sbci r31, 0xFF ; 255 2927c: 80 81 ld r24, Z 2927e: 81 11 cpse r24, r1 29280: 7d c0 rjmp .+250 ; 0x2937c <__vector_17+0xd4a> 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; 29282: 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) { 29284: 80 ff sbrs r24, 0 29286: 16 c0 rjmp .+44 ; 0x292b4 <__vector_17+0xc82> LA_phase = -1; 29288: 9f ef ldi r25, 0xFF ; 255 2928a: 90 93 90 05 sts 0x0590, r25 ; 0x800590 if (current_adv_steps == target_adv_steps) { 2928e: e0 91 de 04 lds r30, 0x04DE ; 0x8004de <_ZL17current_adv_steps.lto_priv.479> 29292: f0 91 df 04 lds r31, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.479+0x1> 29296: 20 91 92 05 lds r18, 0x0592 ; 0x800592 2929a: 30 91 93 05 lds r19, 0x0593 ; 0x800593 2929e: e2 17 cp r30, r18 292a0: f3 07 cpc r31, r19 292a2: 09 f0 breq .+2 ; 0x292a6 <__vector_17+0xc74> 292a4: 24 c2 rjmp .+1096 ; 0x296ee <__vector_17+0x10bc> // nothing to be done in this phase, cancel any pending eisr la_state = 0; nextAdvanceISR = ADV_NEVER; 292a6: 8f ef ldi r24, 0xFF ; 255 292a8: 9f ef ldi r25, 0xFF ; 255 292aa: 90 93 e3 04 sts 0x04E3, r25 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.477+0x1> 292ae: 80 93 e2 04 sts 0x04E2, r24 ; 0x8004e2 <_ZL14nextAdvanceISR.lto_priv.477> 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; 292b2: 80 e0 ldi r24, 0x00 ; 0 eISR_Err += current_block->advance_rate; LA_phase = 0; } } } if (la_state & ADV_INIT || nextAdvanceISR != ADV_NEVER) { 292b4: 80 fd sbrc r24, 0 292b6: 07 c0 rjmp .+14 ; 0x292c6 <__vector_17+0xc94> 292b8: 80 91 e2 04 lds r24, 0x04E2 ; 0x8004e2 <_ZL14nextAdvanceISR.lto_priv.477> 292bc: 90 91 e3 04 lds r25, 0x04E3 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.477+0x1> 292c0: 01 96 adiw r24, 0x01 ; 1 292c2: 09 f4 brne .+2 ; 0x292c6 <__vector_17+0xc94> 292c4: b2 c2 rjmp .+1380 ; 0x2982a <__vector_17+0x11f8> // update timers & phase for the next iteration advance_spread(main_Rate); 292c6: e0 91 e0 04 lds r30, 0x04E0 ; 0x8004e0 <_ZL9main_Rate.lto_priv.478> 292ca: f0 91 e1 04 lds r31, 0x04E1 ; 0x8004e1 <_ZL9main_Rate.lto_priv.478+0x1> else return ((uint32_t)0xAAAB * q) >> 17; } FORCE_INLINE void advance_spread(uint16_t timer) { eISR_Err += timer; 292ce: 80 91 71 05 lds r24, 0x0571 ; 0x800571 292d2: 90 91 72 05 lds r25, 0x0572 ; 0x800572 292d6: a0 91 73 05 lds r26, 0x0573 ; 0x800573 292da: b0 91 74 05 lds r27, 0x0574 ; 0x800574 292de: 8e 0f add r24, r30 292e0: 9f 1f adc r25, r31 292e2: a1 1d adc r26, r1 292e4: b1 1d adc r27, r1 uint8_t ticks = 0; while(eISR_Err >= current_block->advance_rate) 292e6: c3 5b subi r28, 0xB3 ; 179 292e8: df 4f sbci r29, 0xFF ; 255 292ea: 08 81 ld r16, Y 292ec: 19 81 ldd r17, Y+1 ; 0x01 292ee: 30 e0 ldi r19, 0x00 ; 0 292f0: 20 e0 ldi r18, 0x00 ; 0 FORCE_INLINE void advance_spread(uint16_t timer) { eISR_Err += timer; uint8_t ticks = 0; 292f2: 60 e0 ldi r22, 0x00 ; 0 while(eISR_Err >= current_block->advance_rate) 292f4: 80 17 cp r24, r16 292f6: 91 07 cpc r25, r17 292f8: a2 07 cpc r26, r18 292fa: b3 07 cpc r27, r19 292fc: 08 f4 brcc .+2 ; 0x29300 <__vector_17+0xcce> 292fe: 27 c2 rjmp .+1102 ; 0x2974e <__vector_17+0x111c> { ++ticks; 29300: 6f 5f subi r22, 0xFF ; 255 eISR_Err -= current_block->advance_rate; 29302: 80 1b sub r24, r16 29304: 91 0b sbc r25, r17 29306: a2 0b sbc r26, r18 29308: b3 0b sbc r27, r19 2930a: f4 cf rjmp .-24 ; 0x292f4 <__vector_17+0xcc2> else stepper_tick_highres(); #ifdef LIN_ADVANCE if (e_steps) WRITE_NC(E0_DIR_PIN, e_steps < 0? INVERT_E0_DIR: !INVERT_E0_DIR); 2930c: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 29310: 8f 7b andi r24, 0xBF ; 191 29312: 11 cf rjmp .-478 ; 0x29136 <__vector_17+0xb04> #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; 29314: 80 e4 ldi r24, 0x40 ; 64 29316: 9c e9 ldi r25, 0x9C ; 156 29318: 6e cf rjmp .-292 ; 0x291f6 <__vector_17+0xbc4> 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 2931a: 81 31 cpi r24, 0x11 ; 17 2931c: e7 e2 ldi r30, 0x27 ; 39 2931e: 9e 07 cpc r25, r30 29320: 20 f0 brcs .+8 ; 0x2932a <__vector_17+0xcf8> step_rate = (step_rate >> 1)&0x7fff; 29322: 96 95 lsr r25 29324: 87 95 ror r24 step_loops = 2; 29326: 22 e0 ldi r18, 0x02 ; 2 29328: 6b cf rjmp .-298 ; 0x29200 <__vector_17+0xbce> } else { step_loops = 1; 2932a: 21 e0 ldi r18, 0x01 ; 1 2932c: 20 93 98 05 sts 0x0598, r18 ; 0x800598 29330: 80 32 cpi r24, 0x20 ; 32 29332: 91 05 cpc r25, r1 29334: 08 f0 brcs .+2 ; 0x29338 <__vector_17+0xd06> 29336: 66 cf rjmp .-308 ; 0x29204 <__vector_17+0xbd2> 29338: 80 e2 ldi r24, 0x20 ; 32 2933a: 90 e0 ldi r25, 0x00 ; 0 2933c: 63 cf rjmp .-314 ; 0x29204 <__vector_17+0xbd2> 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; 2933e: 9c 01 movw r18, r24 29340: 36 95 lsr r19 29342: 27 95 ror r18 29344: 2c 7f andi r18, 0xFC ; 252 29346: 22 57 subi r18, 0x72 ; 114 29348: 3d 46 sbci r19, 0x6D ; 109 timer = (unsigned short)pgm_read_word_near(table_address); 2934a: f9 01 movw r30, r18 2934c: a5 91 lpm r26, Z+ 2934e: b4 91 lpm r27, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 29350: f9 01 movw r30, r18 29352: 32 96 adiw r30, 0x02 ; 2 29354: 05 91 lpm r16, Z+ 29356: 14 91 lpm r17, Z 29358: 87 70 andi r24, 0x07 ; 7 2935a: 99 27 eor r25, r25 2935c: 80 9f mul r24, r16 2935e: 90 01 movw r18, r0 29360: 81 9f mul r24, r17 29362: 30 0d add r19, r0 29364: 90 9f mul r25, r16 29366: 30 0d add r19, r0 29368: 11 24 eor r1, r1 2936a: f3 e0 ldi r31, 0x03 ; 3 2936c: 36 95 lsr r19 2936e: 27 95 ror r18 29370: fa 95 dec r31 29372: e1 f7 brne .-8 ; 0x2936c <__vector_17+0xd3a> 29374: cd 01 movw r24, r26 29376: 82 1b sub r24, r18 29378: 93 0b sbc r25, r19 2937a: 64 cf rjmp .-312 ; 0x29244 <__vector_17+0xc12> 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) { 2937c: 40 91 7b 05 lds r20, 0x057B ; 0x80057b 29380: 50 91 7c 05 lds r21, 0x057C ; 0x80057c 29384: 60 91 7d 05 lds r22, 0x057D ; 0x80057d 29388: 70 91 7e 05 lds r23, 0x057E ; 0x80057e 2938c: 80 91 98 05 lds r24, 0x0598 ; 0x800598 29390: 90 e0 ldi r25, 0x00 ; 0 29392: b0 e0 ldi r27, 0x00 ; 0 29394: a0 e0 ldi r26, 0x00 ; 0 29396: 84 17 cp r24, r20 29398: 95 07 cpc r25, r21 2939a: a6 07 cpc r26, r22 2939c: b7 07 cpc r27, r23 2939e: 08 f4 brcc .+2 ; 0x293a2 <__vector_17+0xd70> 293a0: 70 cf rjmp .-288 ; 0x29282 <__vector_17+0xc50> la_state = ADV_INIT | ADV_ACC_VARY; if (e_extruding && current_adv_steps > target_adv_steps) 293a2: 80 91 7f 05 lds r24, 0x057F ; 0x80057f 293a6: 81 11 cpse r24, r1 293a8: 02 c0 rjmp .+4 ; 0x293ae <__vector_17+0xd7c> _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; 293aa: 83 e0 ldi r24, 0x03 ; 3 293ac: 6b cf rjmp .-298 ; 0x29284 <__vector_17+0xc52> if (e_extruding && current_adv_steps > target_adv_steps) 293ae: 80 91 de 04 lds r24, 0x04DE ; 0x8004de <_ZL17current_adv_steps.lto_priv.479> 293b2: 90 91 df 04 lds r25, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.479+0x1> 293b6: 20 91 92 05 lds r18, 0x0592 ; 0x800592 293ba: 30 91 93 05 lds r19, 0x0593 ; 0x800593 293be: 28 17 cp r18, r24 293c0: 39 07 cpc r19, r25 293c2: 98 f7 brcc .-26 ; 0x293aa <__vector_17+0xd78> target_adv_steps = current_adv_steps; 293c4: 90 93 93 05 sts 0x0593, r25 ; 0x800593 293c8: 80 93 92 05 sts 0x0592, r24 ; 0x800592 293cc: ee cf rjmp .-36 ; 0x293aa <__vector_17+0xd78> } } #endif } else if (step_events_completed.wide > current_block->decelerate_after) { 293ce: 80 91 7b 05 lds r24, 0x057B ; 0x80057b 293d2: 90 91 7c 05 lds r25, 0x057C ; 0x80057c 293d6: a0 91 7d 05 lds r26, 0x057D ; 0x80057d 293da: b0 91 7e 05 lds r27, 0x057E ; 0x80057e 293de: 4d 8d ldd r20, Y+29 ; 0x1d 293e0: 5e 8d ldd r21, Y+30 ; 0x1e 293e2: 6f 8d ldd r22, Y+31 ; 0x1f 293e4: 78 a1 ldd r23, Y+32 ; 0x20 293e6: 48 17 cp r20, r24 293e8: 59 07 cpc r21, r25 293ea: 6a 07 cpc r22, r26 293ec: 7b 07 cpc r23, r27 293ee: 08 f0 brcs .+2 ; 0x293f2 <__vector_17+0xdc0> 293f0: e3 c0 rjmp .+454 ; 0x295b8 <__vector_17+0xf86> uint16_t step_rate = MUL24x24R24(deceleration_time, current_block->acceleration_rate); 293f2: c0 90 9c 05 lds r12, 0x059C ; 0x80059c 293f6: d0 90 9d 05 lds r13, 0x059D ; 0x80059d 293fa: e0 90 9e 05 lds r14, 0x059E ; 0x80059e 293fe: f0 90 9f 05 lds r15, 0x059F ; 0x80059f "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. ); 29402: 6c 88 ldd r6, Y+20 ; 0x14 29404: 7d 88 ldd r7, Y+21 ; 0x15 29406: 8e 88 ldd r8, Y+22 ; 0x16 29408: aa 27 eor r26, r26 2940a: c7 9c mul r12, r7 2940c: b1 2d mov r27, r1 2940e: d8 9c mul r13, r8 29410: f0 01 movw r30, r0 29412: e8 9c mul r14, r8 29414: f0 0d add r31, r0 29416: e7 9c mul r14, r7 29418: e0 0d add r30, r0 2941a: f1 1d adc r31, r1 2941c: c8 9c mul r12, r8 2941e: b0 0d add r27, r0 29420: e1 1d adc r30, r1 29422: fa 1f adc r31, r26 29424: d7 9c mul r13, r7 29426: b0 0d add r27, r0 29428: e1 1d adc r30, r1 2942a: fa 1f adc r31, r26 2942c: e6 9c mul r14, r6 2942e: b0 0d add r27, r0 29430: e1 1d adc r30, r1 29432: fa 1f adc r31, r26 29434: d6 9c mul r13, r6 29436: b1 0d add r27, r1 29438: ea 1f adc r30, r26 2943a: fa 1f adc r31, r26 2943c: bb 0f add r27, r27 2943e: ea 1f adc r30, r26 29440: fa 1f adc r31, r26 29442: 11 24 eor r1, r1 if (step_rate > acc_step_rate) { // Check step_rate stays positive 29444: 20 91 99 05 lds r18, 0x0599 ; 0x800599 29448: 30 91 9a 05 lds r19, 0x059A ; 0x80059a 2944c: 8e ad ldd r24, Y+62 ; 0x3e 2944e: 9f ad ldd r25, Y+63 ; 0x3f 29450: 2e 17 cp r18, r30 29452: 3f 07 cpc r19, r31 29454: 30 f0 brcs .+12 ; 0x29462 <__vector_17+0xe30> step_rate = uint16_t(current_block->final_rate); } else { step_rate = acc_step_rate - step_rate; // Decelerate from acceleration end point. 29456: 2e 1b sub r18, r30 29458: 3f 0b sbc r19, r31 2945a: 82 17 cp r24, r18 2945c: 93 07 cpc r25, r19 2945e: 08 f4 brcc .+2 ; 0x29462 <__vector_17+0xe30> 29460: 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; 29462: 81 34 cpi r24, 0x41 ; 65 29464: 2c e9 ldi r18, 0x9C ; 156 29466: 92 07 cpc r25, r18 29468: 08 f0 brcs .+2 ; 0x2946c <__vector_17+0xe3a> 2946a: 75 c0 rjmp .+234 ; 0x29556 <__vector_17+0xf24> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 2946c: 81 32 cpi r24, 0x21 ; 33 2946e: ee e4 ldi r30, 0x4E ; 78 29470: 9e 07 cpc r25, r30 29472: 08 f4 brcc .+2 ; 0x29476 <__vector_17+0xe44> 29474: 73 c0 rjmp .+230 ; 0x2955c <__vector_17+0xf2a> step_rate = (step_rate >> 2)&0x3fff; 29476: 96 95 lsr r25 29478: 87 95 ror r24 2947a: 96 95 lsr r25 2947c: 87 95 ror r24 step_loops = 4; 2947e: 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; 29480: 20 93 98 05 sts 0x0598, r18 ; 0x800598 else { step_loops = 1; } if(step_rate < (F_CPU/500000)) step_rate = (F_CPU/500000); step_rate -= (F_CPU/500000); // Correct for minimal speed 29484: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 29486: 81 15 cp r24, r1 29488: 28 e0 ldi r18, 0x08 ; 8 2948a: 92 07 cpc r25, r18 2948c: 08 f4 brcc .+2 ; 0x29490 <__vector_17+0xe5e> 2948e: 78 c0 rjmp .+240 ; 0x29580 <__vector_17+0xf4e> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 29490: e9 2f mov r30, r25 29492: ff 27 eor r31, r31 29494: ee 0f add r30, r30 29496: ff 1f adc r31, r31 29498: ee 0f add r30, r30 2949a: ff 1f adc r31, r31 2949c: 9f 01 movw r18, r30 2949e: 22 57 subi r18, 0x72 ; 114 294a0: 39 46 sbci r19, 0x69 ; 105 unsigned char tmp_step_rate = (step_rate & 0x00ff); uint16_t gain = (uint16_t)pgm_read_word_near(table_address+2); 294a2: f9 01 movw r30, r18 294a4: 32 96 adiw r30, 0x02 ; 2 294a6: a5 91 lpm r26, Z+ 294a8: b4 91 lpm r27, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 294aa: f9 01 movw r30, r18 294ac: 25 91 lpm r18, Z+ 294ae: 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. ); 294b0: b8 9f mul r27, r24 294b2: f0 01 movw r30, r0 294b4: a8 9f mul r26, r24 294b6: 00 0c add r0, r0 294b8: e1 1d adc r30, r1 294ba: 11 24 eor r1, r1 294bc: 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); 294be: 2e 1b sub r18, r30 294c0: 3f 0b sbc r19, r31 294c2: c9 01 movw r24, r18 294c4: 24 36 cpi r18, 0x64 ; 100 294c6: 31 05 cpc r19, r1 294c8: 10 f4 brcc .+4 ; 0x294ce <__vector_17+0xe9c> 294ca: 84 e6 ldi r24, 0x64 ; 100 294cc: 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); 294ce: 90 93 e5 04 sts 0x04E5, r25 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.476+0x1> 294d2: 80 93 e4 04 sts 0x04E4, r24 ; 0x8004e4 <_ZL11nextMainISR.lto_priv.476> 294d6: 90 93 e1 04 sts 0x04E1, r25 ; 0x8004e1 <_ZL9main_Rate.lto_priv.478+0x1> 294da: 80 93 e0 04 sts 0x04E0, r24 ; 0x8004e0 <_ZL9main_Rate.lto_priv.478> deceleration_time += timer; 294de: c8 0e add r12, r24 294e0: d9 1e adc r13, r25 294e2: e1 1c adc r14, r1 294e4: f1 1c adc r15, r1 294e6: c0 92 9c 05 sts 0x059C, r12 ; 0x80059c 294ea: d0 92 9d 05 sts 0x059D, r13 ; 0x80059d 294ee: e0 92 9e 05 sts 0x059E, r14 ; 0x80059e 294f2: f0 92 9f 05 sts 0x059F, r15 ; 0x80059f #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 294f6: fe 01 movw r30, r28 294f8: e4 5b subi r30, 0xB4 ; 180 294fa: ff 4f sbci r31, 0xFF ; 255 294fc: 80 81 ld r24, Z 294fe: 88 23 and r24, r24 29500: 09 f4 brne .+2 ; 0x29504 <__vector_17+0xed2> 29502: bf ce rjmp .-642 ; 0x29282 <__vector_17+0xc50> if (step_events_completed.wide <= current_block->decelerate_after + step_loops) { 29504: 80 91 7b 05 lds r24, 0x057B ; 0x80057b 29508: 90 91 7c 05 lds r25, 0x057C ; 0x80057c 2950c: a0 91 7d 05 lds r26, 0x057D ; 0x80057d 29510: b0 91 7e 05 lds r27, 0x057E ; 0x80057e 29514: 20 91 98 05 lds r18, 0x0598 ; 0x800598 29518: 42 0f add r20, r18 2951a: 51 1d adc r21, r1 2951c: 61 1d adc r22, r1 2951e: 71 1d adc r23, r1 29520: 48 17 cp r20, r24 29522: 59 07 cpc r21, r25 29524: 6a 07 cpc r22, r26 29526: 7b 07 cpc r23, r27 29528: 08 f4 brcc .+2 ; 0x2952c <__vector_17+0xefa> 2952a: ab ce rjmp .-682 ; 0x29282 <__vector_17+0xc50> target_adv_steps = current_block->final_adv_steps; 2952c: 35 96 adiw r30, 0x05 ; 5 2952e: 20 81 ld r18, Z 29530: 31 81 ldd r19, Z+1 ; 0x01 29532: 30 93 93 05 sts 0x0593, r19 ; 0x800593 29536: 20 93 92 05 sts 0x0592, r18 ; 0x800592 la_state = ADV_INIT | ADV_ACC_VARY; if (e_extruding && current_adv_steps < target_adv_steps) 2953a: 80 91 7f 05 lds r24, 0x057F ; 0x80057f 2953e: 88 23 and r24, r24 29540: 09 f4 brne .+2 ; 0x29544 <__vector_17+0xf12> 29542: 33 cf rjmp .-410 ; 0x293aa <__vector_17+0xd78> 29544: 80 91 de 04 lds r24, 0x04DE ; 0x8004de <_ZL17current_adv_steps.lto_priv.479> 29548: 90 91 df 04 lds r25, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.479+0x1> 2954c: 82 17 cp r24, r18 2954e: 93 07 cpc r25, r19 29550: 08 f0 brcs .+2 ; 0x29554 <__vector_17+0xf22> 29552: 2b cf rjmp .-426 ; 0x293aa <__vector_17+0xd78> 29554: 37 cf rjmp .-402 ; 0x293c4 <__vector_17+0xd92> #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; 29556: 80 e4 ldi r24, 0x40 ; 64 29558: 9c e9 ldi r25, 0x9C ; 156 2955a: 8d cf rjmp .-230 ; 0x29476 <__vector_17+0xe44> 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 2955c: 81 31 cpi r24, 0x11 ; 17 2955e: f7 e2 ldi r31, 0x27 ; 39 29560: 9f 07 cpc r25, r31 29562: 20 f0 brcs .+8 ; 0x2956c <__vector_17+0xf3a> step_rate = (step_rate >> 1)&0x7fff; 29564: 96 95 lsr r25 29566: 87 95 ror r24 step_loops = 2; 29568: 22 e0 ldi r18, 0x02 ; 2 2956a: 8a cf rjmp .-236 ; 0x29480 <__vector_17+0xe4e> } else { step_loops = 1; 2956c: 21 e0 ldi r18, 0x01 ; 1 2956e: 20 93 98 05 sts 0x0598, r18 ; 0x800598 29572: 80 32 cpi r24, 0x20 ; 32 29574: 91 05 cpc r25, r1 29576: 08 f0 brcs .+2 ; 0x2957a <__vector_17+0xf48> 29578: 85 cf rjmp .-246 ; 0x29484 <__vector_17+0xe52> 2957a: 80 e2 ldi r24, 0x20 ; 32 2957c: 90 e0 ldi r25, 0x00 ; 0 2957e: 82 cf rjmp .-252 ; 0x29484 <__vector_17+0xe52> 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; 29580: dc 01 movw r26, r24 29582: b6 95 lsr r27 29584: a7 95 ror r26 29586: ac 7f andi r26, 0xFC ; 252 29588: a2 57 subi r26, 0x72 ; 114 2958a: bd 46 sbci r27, 0x6D ; 109 timer = (unsigned short)pgm_read_word_near(table_address); 2958c: fd 01 movw r30, r26 2958e: 25 91 lpm r18, Z+ 29590: 34 91 lpm r19, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 29592: fd 01 movw r30, r26 29594: 32 96 adiw r30, 0x02 ; 2 29596: a5 91 lpm r26, Z+ 29598: b4 91 lpm r27, Z 2959a: 87 70 andi r24, 0x07 ; 7 2959c: 99 27 eor r25, r25 2959e: 8a 9f mul r24, r26 295a0: f0 01 movw r30, r0 295a2: 8b 9f mul r24, r27 295a4: f0 0d add r31, r0 295a6: 9a 9f mul r25, r26 295a8: f0 0d add r31, r0 295aa: 11 24 eor r1, r1 295ac: a3 e0 ldi r26, 0x03 ; 3 295ae: f6 95 lsr r31 295b0: e7 95 ror r30 295b2: aa 95 dec r26 295b4: e1 f7 brne .-8 ; 0x295ae <__vector_17+0xf7c> 295b6: 83 cf rjmp .-250 ; 0x294be <__vector_17+0xe8c> } } #endif } else { if (! step_loops_nominal) { 295b8: 80 91 9b 05 lds r24, 0x059B ; 0x80059b 295bc: 88 23 and r24, r24 295be: 71 f0 breq .+28 ; 0x295dc <__vector_17+0xfaa> 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; 295c0: 80 e0 ldi r24, 0x00 ; 0 if (e_extruding) target_adv_steps = current_adv_steps; } #endif } _NEXT_ISR(OCR1A_nominal); 295c2: 20 91 75 05 lds r18, 0x0575 ; 0x800575 295c6: 30 91 76 05 lds r19, 0x0576 ; 0x800576 295ca: 30 93 e5 04 sts 0x04E5, r19 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.476+0x1> 295ce: 20 93 e4 04 sts 0x04E4, r18 ; 0x8004e4 <_ZL11nextMainISR.lto_priv.476> 295d2: 30 93 e1 04 sts 0x04E1, r19 ; 0x8004e1 <_ZL9main_Rate.lto_priv.478+0x1> 295d6: 20 93 e0 04 sts 0x04E0, r18 ; 0x8004e0 <_ZL9main_Rate.lto_priv.478> 295da: 54 ce rjmp .-856 ; 0x29284 <__vector_17+0xc52> } 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); 295dc: 8e a9 ldd r24, Y+54 ; 0x36 295de: 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; 295e0: 81 34 cpi r24, 0x41 ; 65 295e2: 4c e9 ldi r20, 0x9C ; 156 295e4: 94 07 cpc r25, r20 295e6: 08 f0 brcs .+2 ; 0x295ea <__vector_17+0xfb8> 295e8: 4e c0 rjmp .+156 ; 0x29686 <__vector_17+0x1054> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 295ea: 81 32 cpi r24, 0x21 ; 33 295ec: 5e e4 ldi r21, 0x4E ; 78 295ee: 95 07 cpc r25, r21 295f0: 08 f4 brcc .+2 ; 0x295f4 <__vector_17+0xfc2> 295f2: 4c c0 rjmp .+152 ; 0x2968c <__vector_17+0x105a> step_rate = (step_rate >> 2)&0x3fff; 295f4: 96 95 lsr r25 295f6: 87 95 ror r24 295f8: 96 95 lsr r25 295fa: 87 95 ror r24 step_loops = 4; 295fc: 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; 295fe: 20 93 98 05 sts 0x0598, r18 ; 0x800598 else { step_loops = 1; } if(step_rate < (F_CPU/500000)) step_rate = (F_CPU/500000); step_rate -= (F_CPU/500000); // Correct for minimal speed 29602: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 29604: 81 15 cp r24, r1 29606: f8 e0 ldi r31, 0x08 ; 8 29608: 9f 07 cpc r25, r31 2960a: 08 f4 brcc .+2 ; 0x2960e <__vector_17+0xfdc> 2960c: 51 c0 rjmp .+162 ; 0x296b0 <__vector_17+0x107e> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 2960e: e9 2f mov r30, r25 29610: ff 27 eor r31, r31 29612: ee 0f add r30, r30 29614: ff 1f adc r31, r31 29616: ee 0f add r30, r30 29618: ff 1f adc r31, r31 2961a: 9f 01 movw r18, r30 2961c: 22 57 subi r18, 0x72 ; 114 2961e: 39 46 sbci r19, 0x69 ; 105 unsigned char tmp_step_rate = (step_rate & 0x00ff); uint16_t gain = (uint16_t)pgm_read_word_near(table_address+2); 29620: f9 01 movw r30, r18 29622: 32 96 adiw r30, 0x02 ; 2 29624: 65 91 lpm r22, Z+ 29626: 74 91 lpm r23, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 29628: f9 01 movw r30, r18 2962a: 25 91 lpm r18, Z+ 2962c: 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. ); 2962e: 78 9f mul r23, r24 29630: a0 01 movw r20, r0 29632: 68 9f mul r22, r24 29634: 00 0c add r0, r0 29636: 41 1d adc r20, r1 29638: 11 24 eor r1, r1 2963a: 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); 2963c: c9 01 movw r24, r18 2963e: 84 1b sub r24, r20 29640: 95 0b sbc r25, r21 29642: 84 36 cpi r24, 0x64 ; 100 29644: 91 05 cpc r25, r1 29646: 10 f4 brcc .+4 ; 0x2964c <__vector_17+0x101a> 29648: 84 e6 ldi r24, 0x64 ; 100 2964a: 90 e0 ldi r25, 0x00 ; 0 2964c: 90 93 76 05 sts 0x0576, r25 ; 0x800576 29650: 80 93 75 05 sts 0x0575, r24 ; 0x800575 step_loops_nominal = step_loops; 29654: 80 91 98 05 lds r24, 0x0598 ; 0x800598 29658: 80 93 9b 05 sts 0x059B, r24 ; 0x80059b #ifdef LIN_ADVANCE if(current_block->use_advance_lead) { 2965c: fe 01 movw r30, r28 2965e: e4 5b subi r30, 0xB4 ; 180 29660: ff 4f sbci r31, 0xFF ; 255 29662: 80 81 ld r24, Z 29664: 88 23 and r24, r24 29666: 09 f4 brne .+2 ; 0x2966a <__vector_17+0x1038> 29668: ab cf rjmp .-170 ; 0x295c0 <__vector_17+0xf8e> // 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) 2966a: 80 91 7f 05 lds r24, 0x057F ; 0x80057f 2966e: 88 23 and r24, r24 29670: 41 f0 breq .+16 ; 0x29682 <__vector_17+0x1050> target_adv_steps = current_adv_steps; 29672: 80 91 de 04 lds r24, 0x04DE ; 0x8004de <_ZL17current_adv_steps.lto_priv.479> 29676: 90 91 df 04 lds r25, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.479+0x1> 2967a: 90 93 93 05 sts 0x0593, r25 ; 0x800593 2967e: 80 93 92 05 sts 0x0592, r24 ; 0x800592 #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; 29682: 81 e0 ldi r24, 0x01 ; 1 29684: 9e cf rjmp .-196 ; 0x295c2 <__vector_17+0xf90> #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; 29686: 80 e4 ldi r24, 0x40 ; 64 29688: 9c e9 ldi r25, 0x9C ; 156 2968a: b4 cf rjmp .-152 ; 0x295f4 <__vector_17+0xfc2> 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 2968c: 81 31 cpi r24, 0x11 ; 17 2968e: e7 e2 ldi r30, 0x27 ; 39 29690: 9e 07 cpc r25, r30 29692: 20 f0 brcs .+8 ; 0x2969c <__vector_17+0x106a> step_rate = (step_rate >> 1)&0x7fff; 29694: 96 95 lsr r25 29696: 87 95 ror r24 step_loops = 2; 29698: 22 e0 ldi r18, 0x02 ; 2 2969a: b1 cf rjmp .-158 ; 0x295fe <__vector_17+0xfcc> } else { step_loops = 1; 2969c: 21 e0 ldi r18, 0x01 ; 1 2969e: 20 93 98 05 sts 0x0598, r18 ; 0x800598 296a2: 80 32 cpi r24, 0x20 ; 32 296a4: 91 05 cpc r25, r1 296a6: 08 f0 brcs .+2 ; 0x296aa <__vector_17+0x1078> 296a8: ac cf rjmp .-168 ; 0x29602 <__vector_17+0xfd0> 296aa: 80 e2 ldi r24, 0x20 ; 32 296ac: 90 e0 ldi r25, 0x00 ; 0 296ae: a9 cf rjmp .-174 ; 0x29602 <__vector_17+0xfd0> 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; 296b0: 9c 01 movw r18, r24 296b2: 36 95 lsr r19 296b4: 27 95 ror r18 296b6: 2c 7f andi r18, 0xFC ; 252 296b8: 22 57 subi r18, 0x72 ; 114 296ba: 3d 46 sbci r19, 0x6D ; 109 timer = (unsigned short)pgm_read_word_near(table_address); 296bc: f9 01 movw r30, r18 296be: 45 91 lpm r20, Z+ 296c0: 54 91 lpm r21, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 296c2: f9 01 movw r30, r18 296c4: 32 96 adiw r30, 0x02 ; 2 296c6: 65 91 lpm r22, Z+ 296c8: 74 91 lpm r23, Z 296ca: 87 70 andi r24, 0x07 ; 7 296cc: 99 27 eor r25, r25 296ce: 86 9f mul r24, r22 296d0: 90 01 movw r18, r0 296d2: 87 9f mul r24, r23 296d4: 30 0d add r19, r0 296d6: 96 9f mul r25, r22 296d8: 30 0d add r19, r0 296da: 11 24 eor r1, r1 296dc: a3 e0 ldi r26, 0x03 ; 3 296de: 36 95 lsr r19 296e0: 27 95 ror r18 296e2: aa 95 dec r26 296e4: e1 f7 brne .-8 ; 0x296de <__vector_17+0x10ac> 296e6: ca 01 movw r24, r20 296e8: 82 1b sub r24, r18 296ea: 93 0b sbc r25, r19 296ec: aa cf rjmp .-172 ; 0x29642 <__vector_17+0x1010> la_state = 0; nextAdvanceISR = ADV_NEVER; } else { // reset error and iterations per loop for this phase eISR_Err = current_block->advance_rate; 296ee: de 01 movw r26, r28 296f0: a3 5b subi r26, 0xB3 ; 179 296f2: bf 4f sbci r27, 0xFF ; 255 296f4: 4d 91 ld r20, X+ 296f6: 5c 91 ld r21, X 296f8: 11 97 sbiw r26, 0x01 ; 1 296fa: 70 e0 ldi r23, 0x00 ; 0 296fc: 60 e0 ldi r22, 0x00 ; 0 296fe: 40 93 71 05 sts 0x0571, r20 ; 0x800571 29702: 50 93 72 05 sts 0x0572, r21 ; 0x800572 29706: 60 93 73 05 sts 0x0573, r22 ; 0x800573 2970a: 70 93 74 05 sts 0x0574, r23 ; 0x800574 e_step_loops = current_block->advance_step_loops; 2970e: 16 96 adiw r26, 0x06 ; 6 29710: 9c 91 ld r25, X 29712: 90 93 70 05 sts 0x0570, r25 ; 0x800570 if ((la_state & ADV_ACC_VARY) && e_extruding && (current_adv_steps > target_adv_steps)) { 29716: 98 2f mov r25, r24 29718: 92 70 andi r25, 0x02 ; 2 2971a: 09 f4 brne .+2 ; 0x2971e <__vector_17+0x10ec> 2971c: cb cd rjmp .-1130 ; 0x292b4 <__vector_17+0xc82> 2971e: 90 91 7f 05 lds r25, 0x057F ; 0x80057f 29722: 99 23 and r25, r25 29724: 09 f4 brne .+2 ; 0x29728 <__vector_17+0x10f6> 29726: c6 cd rjmp .-1140 ; 0x292b4 <__vector_17+0xc82> 29728: 2e 17 cp r18, r30 2972a: 3f 07 cpc r19, r31 2972c: 08 f0 brcs .+2 ; 0x29730 <__vector_17+0x10fe> 2972e: c2 cd rjmp .-1148 ; 0x292b4 <__vector_17+0xc82> // LA could reverse the direction of extrusion in this phase eISR_Err += current_block->advance_rate; 29730: 44 0f add r20, r20 29732: 55 1f adc r21, r21 29734: 66 1f adc r22, r22 29736: 77 1f adc r23, r23 29738: 40 93 71 05 sts 0x0571, r20 ; 0x800571 2973c: 50 93 72 05 sts 0x0572, r21 ; 0x800572 29740: 60 93 73 05 sts 0x0573, r22 ; 0x800573 29744: 70 93 74 05 sts 0x0574, r23 ; 0x800574 LA_phase = 0; 29748: 10 92 90 05 sts 0x0590, r1 ; 0x800590 2974c: b3 cd rjmp .-1178 ; 0x292b4 <__vector_17+0xc82> 2974e: 80 93 71 05 sts 0x0571, r24 ; 0x800571 29752: 90 93 72 05 sts 0x0572, r25 ; 0x800572 29756: a0 93 73 05 sts 0x0573, r26 ; 0x800573 2975a: b0 93 74 05 sts 0x0574, r27 ; 0x800574 while(eISR_Err >= current_block->advance_rate) { ++ticks; eISR_Err -= current_block->advance_rate; } if(!ticks) 2975e: 61 11 cpse r22, r1 29760: 1b c0 rjmp .+54 ; 0x29798 <__vector_17+0x1166> { eISR_Rate = timer; 29762: f0 93 6f 05 sts 0x056F, r31 ; 0x80056f 29766: e0 93 6e 05 sts 0x056E, r30 ; 0x80056e nextAdvanceISR = timer; 2976a: f0 93 e3 04 sts 0x04E3, r31 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.477+0x1> 2976e: e0 93 e2 04 sts 0x04E2, r30 ; 0x8004e2 <_ZL14nextAdvanceISR.lto_priv.477> } } if (la_state & ADV_INIT || nextAdvanceISR != ADV_NEVER) { // update timers & phase for the next iteration advance_spread(main_Rate); if (LA_phase >= 0) { 29772: 80 91 90 05 lds r24, 0x0590 ; 0x800590 29776: 87 fd sbrc r24, 7 29778: 58 c0 rjmp .+176 ; 0x2982a <__vector_17+0x11f8> if (step_loops == e_step_loops) 2977a: 80 91 98 05 lds r24, 0x0598 ; 0x800598 2977e: 10 91 70 05 lds r17, 0x0570 ; 0x800570 29782: 28 81 ld r18, Y 29784: 39 81 ldd r19, Y+1 ; 0x01 29786: 81 13 cpse r24, r17 29788: 35 c0 rjmp .+106 ; 0x297f4 <__vector_17+0x11c2> LA_phase = (current_block->advance_rate < main_Rate); 2978a: 81 e0 ldi r24, 0x01 ; 1 2978c: 2e 17 cp r18, r30 2978e: 3f 07 cpc r19, r31 29790: 08 f4 brcc .+2 ; 0x29794 <__vector_17+0x1162> 29792: 49 c0 rjmp .+146 ; 0x29826 <__vector_17+0x11f4> 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); 29794: 80 e0 ldi r24, 0x00 ; 0 29796: 47 c0 rjmp .+142 ; 0x29826 <__vector_17+0x11f4> eISR_Rate = timer; nextAdvanceISR = timer; return; } if (ticks <= 3) 29798: 64 30 cpi r22, 0x04 ; 4 2979a: 28 f5 brcc .+74 ; 0x297e6 <__vector_17+0x11b4> eISR_Rate = fastdiv(timer, ticks + 1); 2979c: 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); 2979e: 63 30 cpi r22, 0x03 ; 3 297a0: a9 f0 breq .+42 ; 0x297cc <__vector_17+0x119a> 297a2: 66 95 lsr r22 297a4: af 01 movw r20, r30 297a6: 02 c0 rjmp .+4 ; 0x297ac <__vector_17+0x117a> 297a8: 56 95 lsr r21 297aa: 47 95 ror r20 297ac: 6a 95 dec r22 297ae: e2 f7 brpl .-8 ; 0x297a8 <__vector_17+0x1176> 297b0: 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); 297b2: 70 93 6f 05 sts 0x056F, r23 ; 0x80056f 297b6: 60 93 6e 05 sts 0x056E, r22 ; 0x80056e } nextAdvanceISR = eISR_Rate; 297ba: 80 91 6e 05 lds r24, 0x056E ; 0x80056e 297be: 90 91 6f 05 lds r25, 0x056F ; 0x80056f 297c2: 90 93 e3 04 sts 0x04E3, r25 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.477+0x1> 297c6: 80 93 e2 04 sts 0x04E2, r24 ; 0x8004e2 <_ZL14nextAdvanceISR.lto_priv.477> 297ca: d3 cf rjmp .-90 ; 0x29772 <__vector_17+0x1140> // @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; 297cc: 9f 01 movw r18, r30 297ce: ab ea ldi r26, 0xAB ; 171 297d0: ba ea ldi r27, 0xAA ; 170 297d2: 0f 94 77 dc call 0x3b8ee ; 0x3b8ee <__umulhisi3> 297d6: 41 e1 ldi r20, 0x11 ; 17 297d8: 96 95 lsr r25 297da: 87 95 ror r24 297dc: 77 95 ror r23 297de: 67 95 ror r22 297e0: 4a 95 dec r20 297e2: d1 f7 brne .-12 ; 0x297d8 <__vector_17+0x11a6> 297e4: e6 cf rjmp .-52 ; 0x297b2 <__vector_17+0x1180> if (ticks <= 3) eISR_Rate = fastdiv(timer, ticks + 1); else { // >4 ticks are still possible on slow moves eISR_Rate = timer / (ticks + 1); 297e6: 70 e0 ldi r23, 0x00 ; 0 297e8: 6f 5f subi r22, 0xFF ; 255 297ea: 7f 4f sbci r23, 0xFF ; 255 297ec: cf 01 movw r24, r30 297ee: 0f 94 a0 dc call 0x3b940 ; 0x3b940 <__udivmodhi4> 297f2: df cf rjmp .-66 ; 0x297b2 <__vector_17+0x1180> #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); 297f4: 83 30 cpi r24, 0x03 ; 3 297f6: 09 f4 brne .+2 ; 0x297fa <__vector_17+0x11c8> 297f8: cf c0 rjmp .+414 ; 0x29998 <__vector_17+0x1366> 297fa: 86 95 lsr r24 297fc: a9 01 movw r20, r18 297fe: 02 c0 rjmp .+4 ; 0x29804 <__vector_17+0x11d2> 29800: 56 95 lsr r21 29802: 47 95 ror r20 29804: 8a 95 dec r24 29806: e2 f7 brpl .-8 ; 0x29800 <__vector_17+0x11ce> 29808: 13 30 cpi r17, 0x03 ; 3 2980a: 09 f4 brne .+2 ; 0x2980e <__vector_17+0x11dc> 2980c: d3 c0 rjmp .+422 ; 0x299b4 <__vector_17+0x1382> 2980e: 16 95 lsr r17 29810: bf 01 movw r22, r30 29812: 02 c0 rjmp .+4 ; 0x29818 <__vector_17+0x11e6> 29814: 76 95 lsr r23 29816: 67 95 ror r22 29818: 1a 95 dec r17 2981a: e2 f7 brpl .-8 ; 0x29814 <__vector_17+0x11e2> 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); 2981c: 81 e0 ldi r24, 0x01 ; 1 2981e: 46 17 cp r20, r22 29820: 57 07 cpc r21, r23 29822: 08 f0 brcs .+2 ; 0x29826 <__vector_17+0x11f4> 29824: b7 cf rjmp .-146 ; 0x29794 <__vector_17+0x1162> 29826: 80 93 90 05 sts 0x0590, r24 ; 0x800590 } } // 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(); 2982a: 0f 94 eb 13 call 0x227d6 ; 0x227d6 #endif // If current block is finished, reset pointer if (step_events_completed.wide >= current_block->step_event_count.wide) { 2982e: 40 91 7b 05 lds r20, 0x057B ; 0x80057b 29832: 50 91 7c 05 lds r21, 0x057C ; 0x80057c 29836: 60 91 7d 05 lds r22, 0x057D ; 0x80057d 2983a: 70 91 7e 05 lds r23, 0x057E ; 0x80057e 2983e: e0 91 a0 05 lds r30, 0x05A0 ; 0x8005a0 29842: f0 91 a1 05 lds r31, 0x05A1 ; 0x8005a1 29846: 80 89 ldd r24, Z+16 ; 0x10 29848: 91 89 ldd r25, Z+17 ; 0x11 2984a: a2 89 ldd r26, Z+18 ; 0x12 2984c: b3 89 ldd r27, Z+19 ; 0x13 2984e: 48 17 cp r20, r24 29850: 59 07 cpc r21, r25 29852: 6a 07 cpc r22, r26 29854: 7b 07 cpc r23, r27 29856: 80 f0 brcs .+32 ; 0x29878 <__vector_17+0x1246> current_block = NULL; 29858: 10 92 a1 05 sts 0x05A1, r1 ; 0x8005a1 2985c: 10 92 a0 05 sts 0x05A0, r1 ; 0x8005a0 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) { 29860: 90 91 a4 0d lds r25, 0x0DA4 ; 0x800da4 29864: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 29868: 98 17 cp r25, r24 2986a: 31 f0 breq .+12 ; 0x29878 <__vector_17+0x1246> block_buffer_tail = (block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 2986c: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 29870: 8f 5f subi r24, 0xFF ; 255 29872: 8f 70 andi r24, 0x0F ; 15 29874: 80 93 a5 0d sts 0x0DA5, r24 ; 0x800da5 return mask; } void tmc2130_st_isr() { if (tmc2130_mode == TMC2130_MODE_SILENT || tmc2130_sg_stop_on_crash == false || tmc2130_sg_homing_axes_mask != 0) 29878: 80 91 8b 06 lds r24, 0x068B ; 0x80068b 2987c: 81 30 cpi r24, 0x01 ; 1 2987e: 49 f1 breq .+82 ; 0x298d2 <__vector_17+0x12a0> 29880: 80 91 5c 02 lds r24, 0x025C ; 0x80025c 29884: 88 23 and r24, r24 29886: 29 f1 breq .+74 ; 0x298d2 <__vector_17+0x12a0> 29888: 80 91 42 06 lds r24, 0x0642 ; 0x800642 2988c: 81 11 cpse r24, r1 2988e: 21 c0 rjmp .+66 ; 0x298d2 <__vector_17+0x12a0> } uint8_t tmc2130_sample_diag() { uint8_t mask = 0; if (!READ(X_TMC2130_DIAG)) mask |= X_AXIS_MASK; 29890: 90 91 06 01 lds r25, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 29894: 81 e0 ldi r24, 0x01 ; 1 29896: 29 2f mov r18, r25 29898: 24 70 andi r18, 0x04 ; 4 2989a: 92 fd sbrc r25, 2 2989c: 80 e0 ldi r24, 0x00 ; 0 if (!READ(Y_TMC2130_DIAG)) mask |= Y_AXIS_MASK; 2989e: 90 91 06 01 lds r25, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 298a2: 82 60 ori r24, 0x02 ; 2 298a4: 97 ff sbrs r25, 7 298a6: 03 c0 rjmp .+6 ; 0x298ae <__vector_17+0x127c> void tmc2130_st_isr() { if (tmc2130_mode == TMC2130_MODE_SILENT || tmc2130_sg_stop_on_crash == false || tmc2130_sg_homing_axes_mask != 0) return; uint8_t mask = tmc2130_sample_diag(); if (tmc2130_sg_stop_on_crash && mask) { 298a8: 21 11 cpse r18, r1 298aa: 13 c0 rjmp .+38 ; 0x298d2 <__vector_17+0x12a0> 298ac: 81 e0 ldi r24, 0x01 ; 1 tmc2130_sg_crash = mask; 298ae: 80 93 0c 05 sts 0x050C, r24 ; 0x80050c tmc2130_sg_stop_on_crash = false; 298b2: 10 92 5c 02 sts 0x025C, r1 ; 0x80025c #ifdef TMC2130 void crashdet_stop_and_save_print() { stop_and_save_print_to_ram(pause_position[Z_AXIS], -default_retraction); //XY - no change, Pause Z LIFT mm up, E -1mm retract 298b6: 60 91 47 02 lds r22, 0x0247 ; 0x800247 <_ZL14pause_position.lto_priv.481+0x8> 298ba: 70 91 48 02 lds r23, 0x0248 ; 0x800248 <_ZL14pause_position.lto_priv.481+0x9> 298be: 80 91 49 02 lds r24, 0x0249 ; 0x800249 <_ZL14pause_position.lto_priv.481+0xa> 298c2: 90 91 4a 02 lds r25, 0x024A ; 0x80024a <_ZL14pause_position.lto_priv.481+0xb> 298c6: 20 e0 ldi r18, 0x00 ; 0 298c8: 30 e0 ldi r19, 0x00 ; 0 298ca: 40 e8 ldi r20, 0x80 ; 128 298cc: 5f eb ldi r21, 0xBF ; 191 298ce: 0e 94 4f 89 call 0x1129e ; 0x1129e WRITE_NC(LOGIC_ANALYZER_CH0, false); #endif } // Run the next advance isr if triggered bool eisr = !nextAdvanceISR; 298d2: 60 91 e2 04 lds r22, 0x04E2 ; 0x8004e2 <_ZL14nextAdvanceISR.lto_priv.477> 298d6: 70 91 e3 04 lds r23, 0x04E3 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.477+0x1> if (eisr) 298da: 61 15 cp r22, r1 298dc: 71 05 cpc r23, r1 298de: 09 f0 breq .+2 ; 0x298e2 <__vector_17+0x12b0> 298e0: 46 c0 rjmp .+140 ; 0x2996e <__vector_17+0x133c> #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) { 298e2: 40 91 de 04 lds r20, 0x04DE ; 0x8004de <_ZL17current_adv_steps.lto_priv.479> 298e6: 50 91 df 04 lds r21, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.479+0x1> 298ea: 20 91 92 05 lds r18, 0x0592 ; 0x800592 298ee: 30 91 93 05 lds r19, 0x0593 ; 0x800593 298f2: 80 91 91 05 lds r24, 0x0591 ; 0x800591 298f6: 24 17 cp r18, r20 298f8: 35 07 cpc r19, r21 298fa: 08 f0 brcs .+2 ; 0x298fe <__vector_17+0x12cc> 298fc: 6c c0 rjmp .+216 ; 0x299d6 <__vector_17+0x13a4> // decompression if (e_step_loops != 1) { 298fe: 90 91 70 05 lds r25, 0x0570 ; 0x800570 29902: 91 30 cpi r25, 0x01 ; 1 29904: 41 f0 breq .+16 ; 0x29916 <__vector_17+0x12e4> uint16_t d_steps = current_adv_steps - target_adv_steps; 29906: 42 1b sub r20, r18 29908: 53 0b sbc r21, r19 if (d_steps < e_step_loops) 2990a: 94 17 cp r25, r20 2990c: 15 06 cpc r1, r21 2990e: 19 f0 breq .+6 ; 0x29916 <__vector_17+0x12e4> 29910: 10 f0 brcs .+4 ; 0x29916 <__vector_17+0x12e4> e_step_loops = d_steps; 29912: 40 93 70 05 sts 0x0570, r20 ; 0x800570 } e_steps -= e_step_loops; 29916: 90 91 70 05 lds r25, 0x0570 ; 0x800570 2991a: 89 1b sub r24, r25 2991c: 80 93 91 05 sts 0x0591, r24 ; 0x800591 if (e_steps) WRITE_NC(E0_DIR_PIN, e_steps < 0? INVERT_E0_DIR: !INVERT_E0_DIR); 29920: 88 23 and r24, r24 29922: 39 f0 breq .+14 ; 0x29932 <__vector_17+0x1300> 29924: 87 fd sbrc r24, 7 29926: 53 c0 rjmp .+166 ; 0x299ce <__vector_17+0x139c> 29928: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2992c: 80 64 ori r24, 0x40 ; 64 2992e: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> current_adv_steps -= e_step_loops; 29932: 20 91 70 05 lds r18, 0x0570 ; 0x800570 29936: 80 91 de 04 lds r24, 0x04DE ; 0x8004de <_ZL17current_adv_steps.lto_priv.479> 2993a: 90 91 df 04 lds r25, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.479+0x1> 2993e: 82 1b sub r24, r18 29940: 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; 29942: 90 93 df 04 sts 0x04DF, r25 ; 0x8004df <_ZL17current_adv_steps.lto_priv.479+0x1> 29946: 80 93 de 04 sts 0x04DE, r24 ; 0x8004de <_ZL17current_adv_steps.lto_priv.479> } if (current_adv_steps == target_adv_steps) { 2994a: 20 91 de 04 lds r18, 0x04DE ; 0x8004de <_ZL17current_adv_steps.lto_priv.479> 2994e: 30 91 df 04 lds r19, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.479+0x1> 29952: 80 91 92 05 lds r24, 0x0592 ; 0x800592 29956: 90 91 93 05 lds r25, 0x0593 ; 0x800593 2995a: 28 17 cp r18, r24 2995c: 39 07 cpc r19, r25 2995e: 09 f0 breq .+2 ; 0x29962 <__vector_17+0x1330> 29960: 66 c0 rjmp .+204 ; 0x29a2e <__vector_17+0x13fc> // advance steps completed nextAdvanceISR = ADV_NEVER; 29962: 8f ef ldi r24, 0xFF ; 255 29964: 9f ef ldi r25, 0xFF ; 255 } else { // schedule another tick nextAdvanceISR = eISR_Rate; 29966: 90 93 e3 04 sts 0x04E3, r25 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.477+0x1> 2996a: 80 93 e2 04 sts 0x04E2, r24 ; 0x8004e2 <_ZL14nextAdvanceISR.lto_priv.477> WRITE_NC(LOGIC_ANALYZER_CH1, false); #endif } // Tick E steps if any if (e_steps && (LA_phase < 0 || LA_phase == eisr)) { 2996e: 40 91 91 05 lds r20, 0x0591 ; 0x800591 29972: 41 11 cpse r20, r1 29974: 61 c0 rjmp .+194 ; 0x29a38 <__vector_17+0x1406> 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) 29976: 80 91 e2 04 lds r24, 0x04E2 ; 0x8004e2 <_ZL14nextAdvanceISR.lto_priv.477> 2997a: 90 91 e3 04 lds r25, 0x04E3 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.477+0x1> 2997e: 20 91 e4 04 lds r18, 0x04E4 ; 0x8004e4 <_ZL11nextMainISR.lto_priv.476> 29982: 30 91 e5 04 lds r19, 0x04E5 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.476+0x1> 29986: 8f 3f cpi r24, 0xFF ; 255 29988: 98 07 cpc r25, r24 2998a: 09 f0 breq .+2 ; 0x2998e <__vector_17+0x135c> 2998c: 98 c0 rjmp .+304 ; 0x29abe <__vector_17+0x148c> OCR1A = nextAdvanceISR; else OCR1A = nextMainISR; 2998e: 30 93 89 00 sts 0x0089, r19 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 29992: 20 93 88 00 sts 0x0088, r18 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 29996: 9e c0 rjmp .+316 ; 0x29ad4 <__vector_17+0x14a2> // @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; 29998: ab ea ldi r26, 0xAB ; 171 2999a: ba ea ldi r27, 0xAA ; 170 2999c: 0f 94 77 dc call 0x3b8ee ; 0x3b8ee <__umulhisi3> 299a0: ab 01 movw r20, r22 299a2: bc 01 movw r22, r24 299a4: 31 e1 ldi r19, 0x11 ; 17 299a6: 76 95 lsr r23 299a8: 67 95 ror r22 299aa: 57 95 ror r21 299ac: 47 95 ror r20 299ae: 3a 95 dec r19 299b0: d1 f7 brne .-12 ; 0x299a6 <__vector_17+0x1374> 299b2: 2a cf rjmp .-428 ; 0x29808 <__vector_17+0x11d6> 299b4: 9f 01 movw r18, r30 299b6: ab ea ldi r26, 0xAB ; 171 299b8: ba ea ldi r27, 0xAA ; 170 299ba: 0f 94 77 dc call 0x3b8ee ; 0x3b8ee <__umulhisi3> 299be: 21 e1 ldi r18, 0x11 ; 17 299c0: 96 95 lsr r25 299c2: 87 95 ror r24 299c4: 77 95 ror r23 299c6: 67 95 ror r22 299c8: 2a 95 dec r18 299ca: d1 f7 brne .-12 ; 0x299c0 <__vector_17+0x138e> 299cc: 27 cf rjmp .-434 ; 0x2981c <__vector_17+0x11ea> 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); 299ce: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 299d2: 8f 7b andi r24, 0xBF ; 191 299d4: ac cf rjmp .-168 ; 0x2992e <__vector_17+0x12fc> current_adv_steps -= e_step_loops; } else if (current_adv_steps < target_adv_steps) { 299d6: 42 17 cp r20, r18 299d8: 53 07 cpc r21, r19 299da: 08 f0 brcs .+2 ; 0x299de <__vector_17+0x13ac> 299dc: b6 cf rjmp .-148 ; 0x2994a <__vector_17+0x1318> // compression if (e_step_loops != 1) { 299de: 90 91 70 05 lds r25, 0x0570 ; 0x800570 299e2: 91 30 cpi r25, 0x01 ; 1 299e4: 41 f0 breq .+16 ; 0x299f6 <__vector_17+0x13c4> uint16_t d_steps = target_adv_steps - current_adv_steps; 299e6: 24 1b sub r18, r20 299e8: 35 0b sbc r19, r21 if (d_steps < e_step_loops) 299ea: 92 17 cp r25, r18 299ec: 13 06 cpc r1, r19 299ee: 19 f0 breq .+6 ; 0x299f6 <__vector_17+0x13c4> 299f0: 10 f0 brcs .+4 ; 0x299f6 <__vector_17+0x13c4> e_step_loops = d_steps; 299f2: 20 93 70 05 sts 0x0570, r18 ; 0x800570 } e_steps += e_step_loops; 299f6: 90 91 70 05 lds r25, 0x0570 ; 0x800570 299fa: 89 0f add r24, r25 299fc: 80 93 91 05 sts 0x0591, r24 ; 0x800591 if (e_steps) WRITE_NC(E0_DIR_PIN, e_steps < 0? INVERT_E0_DIR: !INVERT_E0_DIR); 29a00: 88 23 and r24, r24 29a02: 39 f0 breq .+14 ; 0x29a12 <__vector_17+0x13e0> 29a04: 87 fd sbrc r24, 7 29a06: 0f c0 rjmp .+30 ; 0x29a26 <__vector_17+0x13f4> 29a08: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 29a0c: 80 64 ori r24, 0x40 ; 64 29a0e: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> current_adv_steps += e_step_loops; 29a12: 80 91 70 05 lds r24, 0x0570 ; 0x800570 29a16: 20 91 de 04 lds r18, 0x04DE ; 0x8004de <_ZL17current_adv_steps.lto_priv.479> 29a1a: 30 91 df 04 lds r19, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.479+0x1> 29a1e: 82 0f add r24, r18 29a20: 93 2f mov r25, r19 29a22: 91 1d adc r25, r1 29a24: 8e cf rjmp .-228 ; 0x29942 <__vector_17+0x1310> 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); 29a26: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 29a2a: 8f 7b andi r24, 0xBF ; 191 29a2c: f0 cf rjmp .-32 ; 0x29a0e <__vector_17+0x13dc> // advance steps completed nextAdvanceISR = ADV_NEVER; } else { // schedule another tick nextAdvanceISR = eISR_Rate; 29a2e: 80 91 6e 05 lds r24, 0x056E ; 0x80056e 29a32: 90 91 6f 05 lds r25, 0x056F ; 0x80056f 29a36: 97 cf rjmp .-210 ; 0x29966 <__vector_17+0x1334> WRITE_NC(LOGIC_ANALYZER_CH1, false); #endif } // Tick E steps if any if (e_steps && (LA_phase < 0 || LA_phase == eisr)) { 29a38: 80 91 90 05 lds r24, 0x0590 ; 0x800590 29a3c: 87 fd sbrc r24, 7 29a3e: 0e c0 rjmp .+28 ; 0x29a5c <__vector_17+0x142a> 29a40: 08 2e mov r0, r24 29a42: 00 0c add r0, r0 29a44: 99 0b sbc r25, r25 WRITE_NC(LOGIC_ANALYZER_CH0, false); #endif } // Run the next advance isr if triggered bool eisr = !nextAdvanceISR; 29a46: 21 e0 ldi r18, 0x01 ; 1 29a48: 30 e0 ldi r19, 0x00 ; 0 29a4a: 61 15 cp r22, r1 29a4c: 71 05 cpc r23, r1 29a4e: 11 f0 breq .+4 ; 0x29a54 <__vector_17+0x1422> 29a50: 30 e0 ldi r19, 0x00 ; 0 29a52: 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)) { 29a54: 82 17 cp r24, r18 29a56: 93 07 cpc r25, r19 29a58: 09 f0 breq .+2 ; 0x29a5c <__vector_17+0x142a> 29a5a: 8d cf rjmp .-230 ; 0x29976 <__vector_17+0x1344> uint8_t max_ticks = (eisr? e_step_loops: step_loops); 29a5c: 20 91 70 05 lds r18, 0x0570 ; 0x800570 29a60: 67 2b or r22, r23 29a62: 11 f0 breq .+4 ; 0x29a68 <__vector_17+0x1436> 29a64: 20 91 98 05 lds r18, 0x0598 ; 0x800598 max_ticks = min(abs(e_steps), max_ticks); 29a68: 84 2f mov r24, r20 29a6a: 04 2e mov r0, r20 29a6c: 00 0c add r0, r0 29a6e: 99 0b sbc r25, r25 29a70: 97 ff sbrs r25, 7 29a72: 03 c0 rjmp .+6 ; 0x29a7a <__vector_17+0x1448> 29a74: 91 95 neg r25 29a76: 81 95 neg r24 29a78: 91 09 sbc r25, r1 29a7a: 30 e0 ldi r19, 0x00 ; 0 29a7c: 28 17 cp r18, r24 29a7e: 39 07 cpc r19, r25 29a80: 0c f4 brge .+2 ; 0x29a84 <__vector_17+0x1452> 29a82: c9 01 movw r24, r18 29a84: 47 ff sbrs r20, 7 29a86: 17 c0 rjmp .+46 ; 0x29ab6 <__vector_17+0x1484> 29a88: 61 e0 ldi r22, 0x01 ; 1 29a8a: 4f ef ldi r20, 0xFF ; 255 29a8c: 5f ef ldi r21, 0xFF ; 255 bool rev = (e_steps < 0); do { STEP_NC_HI(E_AXIS); 29a8e: 78 e0 ldi r23, 0x08 ; 8 29a90: 76 b9 out 0x06, r23 ; 6 e_steps += (rev? 1: -1); 29a92: 90 91 91 05 lds r25, 0x0591 ; 0x800591 29a96: 96 0f add r25, r22 29a98: 90 93 91 05 sts 0x0591, r25 ; 0x800591 void setJamDetectionEnabled(bool state, bool updateEEPROM = false); bool getJamDetectionEnabled() const { return jamDetection; } void stStep(bool rev) { //from stepper isr stepCount += rev ? -1 : 1; 29a9c: 20 91 ba 17 lds r18, 0x17BA ; 0x8017ba 29aa0: 30 91 bb 17 lds r19, 0x17BB ; 0x8017bb 29aa4: 24 0f add r18, r20 29aa6: 35 1f adc r19, r21 29aa8: 30 93 bb 17 sts 0x17BB, r19 ; 0x8017bb 29aac: 20 93 ba 17 sts 0x17BA, r18 ; 0x8017ba STEP_NC_LO(E_AXIS); #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) fsensor.stStep(rev); #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) } while(--max_ticks); 29ab0: 81 50 subi r24, 0x01 ; 1 29ab2: 71 f7 brne .-36 ; 0x29a90 <__vector_17+0x145e> 29ab4: 60 cf rjmp .-320 ; 0x29976 <__vector_17+0x1344> 29ab6: 6f ef ldi r22, 0xFF ; 255 29ab8: 41 e0 ldi r20, 0x01 ; 1 29aba: 50 e0 ldi r21, 0x00 ; 0 29abc: e8 cf rjmp .-48 ; 0x29a8e <__vector_17+0x145c> } // 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) 29abe: ac 01 movw r20, r24 29ac0: 48 5d subi r20, 0xD8 ; 216 29ac2: 5f 4f sbci r21, 0xFF ; 255 29ac4: 42 17 cp r20, r18 29ac6: 53 07 cpc r21, r19 29ac8: 08 f0 brcs .+2 ; 0x29acc <__vector_17+0x149a> 29aca: 61 cf rjmp .-318 ; 0x2998e <__vector_17+0x135c> OCR1A = nextAdvanceISR; 29acc: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 29ad0: 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) { 29ad4: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 29ad8: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 29adc: 80 91 84 00 lds r24, 0x0084 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> 29ae0: 90 91 85 00 lds r25, 0x0085 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 29ae4: 40 96 adiw r24, 0x10 ; 16 29ae6: 28 17 cp r18, r24 29ae8: 39 07 cpc r19, r25 29aea: 48 f4 brcc .+18 ; 0x29afe <__vector_17+0x14cc> // 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; 29aec: 80 91 84 00 lds r24, 0x0084 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> 29af0: 90 91 85 00 lds r25, 0x0085 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 29af4: 40 96 adiw r24, 0x10 ; 16 29af6: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 29afa: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> } } 29afe: ff 91 pop r31 29b00: ef 91 pop r30 29b02: df 91 pop r29 29b04: cf 91 pop r28 29b06: bf 91 pop r27 29b08: af 91 pop r26 29b0a: 9f 91 pop r25 29b0c: 8f 91 pop r24 29b0e: 7f 91 pop r23 29b10: 6f 91 pop r22 29b12: 5f 91 pop r21 29b14: 4f 91 pop r20 29b16: 3f 91 pop r19 29b18: 2f 91 pop r18 29b1a: 1f 91 pop r17 29b1c: 0f 91 pop r16 29b1e: ff 90 pop r15 29b20: ef 90 pop r14 29b22: df 90 pop r13 29b24: cf 90 pop r12 29b26: 8f 90 pop r8 29b28: 7f 90 pop r7 29b2a: 6f 90 pop r6 29b2c: 0f 90 pop r0 29b2e: 0b be out 0x3b, r0 ; 59 29b30: 0f 90 pop r0 29b32: 0f be out 0x3f, r0 ; 63 29b34: 0f 90 pop r0 29b36: 1f 90 pop r1 29b38: 18 95 reti 00029b3a : return old; } bool enable_z_endstop(bool check) { bool old = check_z_endstop; 29b3a: 90 91 77 05 lds r25, 0x0577 ; 0x800577 check_z_endstop = check; 29b3e: 80 93 77 05 sts 0x0577, r24 ; 0x800577 CRITICAL_SECTION_START; 29b42: 2f b7 in r18, 0x3f ; 63 29b44: f8 94 cli endstop_hit &= ~_BV(Z_AXIS); 29b46: 80 91 0a 05 lds r24, 0x050A ; 0x80050a <_ZL11endstop_hit.lto_priv.480> 29b4a: 8b 7f andi r24, 0xFB ; 251 29b4c: 80 93 0a 05 sts 0x050A, r24 ; 0x80050a <_ZL11endstop_hit.lto_priv.480> CRITICAL_SECTION_END; 29b50: 2f bf out 0x3f, r18 ; 63 return old; } 29b52: 89 2f mov r24, r25 29b54: 08 95 ret 00029b56 : return old; } bool endstop_z_hit_on_purpose() { bool hit = endstop_hit & _BV(Z_AXIS); 29b56: 80 91 0a 05 lds r24, 0x050A ; 0x80050a <_ZL11endstop_hit.lto_priv.480> CRITICAL_SECTION_START; 29b5a: 2f b7 in r18, 0x3f ; 63 29b5c: f8 94 cli endstop_hit &= ~_BV(Z_AXIS); 29b5e: 90 91 0a 05 lds r25, 0x050A ; 0x80050a <_ZL11endstop_hit.lto_priv.480> 29b62: 9b 7f andi r25, 0xFB ; 251 29b64: 90 93 0a 05 sts 0x050A, r25 ; 0x80050a <_ZL11endstop_hit.lto_priv.480> CRITICAL_SECTION_END; 29b68: 2f bf out 0x3f, r18 ; 63 return hit; } 29b6a: 82 fb bst r24, 2 29b6c: 88 27 eor r24, r24 29b6e: 80 f9 bld r24, 0 29b70: 08 95 ret 00029b72 : } } bool endstops_hit_on_purpose() { uint8_t old = endstop_hit; 29b72: 90 91 0a 05 lds r25, 0x050A ; 0x80050a <_ZL11endstop_hit.lto_priv.480> endstop_hit = 0; 29b76: 10 92 0a 05 sts 0x050A, r1 ; 0x80050a <_ZL11endstop_hit.lto_priv.480> return old; 29b7a: 81 e0 ldi r24, 0x01 ; 1 29b7c: 91 11 cpse r25, r1 29b7e: 01 c0 rjmp .+2 ; 0x29b82 29b80: 80 e0 ldi r24, 0x00 ; 0 } 29b82: 08 95 ret 00029b84 : } } void Sound_MakeSound(eSOUND_TYPE eSoundType) { switch(eSoundMode) 29b84: 90 91 dd 04 lds r25, 0x04DD ; 0x8004dd 29b88: 91 30 cpi r25, 0x01 ; 1 29b8a: a1 f0 breq .+40 ; 0x29bb4 29b8c: 28 f0 brcs .+10 ; 0x29b98 29b8e: 92 30 cpi r25, 0x02 ; 2 29b90: a9 f0 breq .+42 ; 0x29bbc 29b92: 93 30 cpi r25, 0x03 ; 3 29b94: c1 f0 breq .+48 ; 0x29bc6 29b96: 08 95 ret { case e_SOUND_MODE_LOUD: if(eSoundType==e_SOUND_TYPE_ButtonEcho) 29b98: 81 11 cpse r24, r1 29b9a: 02 c0 rjmp .+4 ; 0x29ba0 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(); 29b9c: 0d 94 53 14 jmp 0x228a6 ; 0x228a6 switch(eSoundMode) { case e_SOUND_MODE_LOUD: if(eSoundType==e_SOUND_TYPE_ButtonEcho) Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 29ba0: 82 30 cpi r24, 0x02 ; 2 29ba2: 11 f4 brne .+4 ; 0x29ba8 break; case e_SOUND_MODE_BLIND: if(eSoundType==e_SOUND_TYPE_ButtonEcho) Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) Sound_DoSound_Prompt(); 29ba4: 0d 94 45 1f jmp 0x23e8a ; 0x23e8a 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) 29ba8: 85 30 cpi r24, 0x05 ; 5 29baa: 09 f0 breq .+2 ; 0x29bae 29bac: 50 c0 rjmp .+160 ; 0x29c4e Sound_DoSound_Alert(false); 29bae: 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); 29bb0: 0d 94 31 14 jmp 0x22862 ; 0x22862 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) 29bb4: 88 23 and r24, r24 29bb6: 91 f3 breq .-28 ; 0x29b9c Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 29bb8: 82 30 cpi r24, 0x02 ; 2 29bba: a1 f3 breq .-24 ; 0x29ba4 Sound_DoSound_Prompt(); if(eSoundType==e_SOUND_TYPE_StandardAlert) 29bbc: 85 30 cpi r24, 0x05 ; 5 29bbe: 09 f0 breq .+2 ; 0x29bc2 29bc0: 46 c0 rjmp .+140 ; 0x29c4e Sound_DoSound_Alert(true); 29bc2: 81 e0 ldi r24, 0x01 ; 1 29bc4: f5 cf rjmp .-22 ; 0x29bb0 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) 29bc6: 88 23 and r24, r24 29bc8: 49 f3 breq .-46 ; 0x29b9c Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 29bca: 82 30 cpi r24, 0x02 ; 2 29bcc: 59 f3 breq .-42 ; 0x29ba4 Sound_DoSound_Prompt(); if(eSoundType==e_SOUND_TYPE_StandardAlert) 29bce: 85 30 cpi r24, 0x05 ; 5 29bd0: 71 f3 breq .-36 ; 0x29bae Sound_DoSound_Alert(false); if(eSoundType==e_SOUND_TYPE_EncoderMove) 29bd2: 86 30 cpi r24, 0x06 ; 6 29bd4: e1 f4 brne .+56 ; 0x29c0e 29bd6: 85 e0 ldi r24, 0x05 ; 5 29bd8: 27 e2 ldi r18, 0x27 ; 39 29bda: 31 e0 ldi r19, 0x01 ; 1 { uint8_t nI; for(nI=0;nI<5;nI++) { WRITE(BEEPER,HIGH); 29bdc: 4f b7 in r20, 0x3f ; 63 29bde: f8 94 cli 29be0: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29be4: 94 60 ori r25, 0x04 ; 4 29be6: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29bea: 4f bf out 0x3f, r20 ; 63 29bec: f9 01 movw r30, r18 29bee: 31 97 sbiw r30, 0x01 ; 1 29bf0: f1 f7 brne .-4 ; 0x29bee delayMicroseconds(75); WRITE(BEEPER,LOW); 29bf2: 4f b7 in r20, 0x3f ; 63 29bf4: f8 94 cli 29bf6: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29bfa: 9b 7f andi r25, 0xFB ; 251 29bfc: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29c00: 4f bf out 0x3f, r20 ; 63 29c02: f9 01 movw r30, r18 29c04: 31 97 sbiw r30, 0x01 ; 1 29c06: f1 f7 brne .-4 ; 0x29c04 29c08: 81 50 subi r24, 0x01 ; 1 static void Sound_DoSound_Encoder_Move(void) { uint8_t nI; for(nI=0;nI<5;nI++) 29c0a: 41 f7 brne .-48 ; 0x29bdc 29c0c: 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) 29c0e: 87 30 cpi r24, 0x07 ; 7 29c10: f1 f4 brne .+60 ; 0x29c4e } } static void Sound_DoSound_Blind_Alert(void) { backlight_wake(1); 29c12: 81 e0 ldi r24, 0x01 ; 1 29c14: 0e 94 85 8a call 0x1150a ; 0x1150a 29c18: 84 e1 ldi r24, 0x14 ; 20 29c1a: 23 e7 ldi r18, 0x73 ; 115 29c1c: 31 e0 ldi r19, 0x01 ; 1 uint8_t nI; for(nI=0; nI<20; nI++) { WRITE(BEEPER,HIGH); 29c1e: 4f b7 in r20, 0x3f ; 63 29c20: f8 94 cli 29c22: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29c26: 94 60 ori r25, 0x04 ; 4 29c28: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29c2c: 4f bf out 0x3f, r20 ; 63 29c2e: f9 01 movw r30, r18 29c30: 31 97 sbiw r30, 0x01 ; 1 29c32: f1 f7 brne .-4 ; 0x29c30 delayMicroseconds(94); WRITE(BEEPER,LOW); 29c34: 4f b7 in r20, 0x3f ; 63 29c36: f8 94 cli 29c38: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29c3c: 9b 7f andi r25, 0xFB ; 251 29c3e: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29c42: 4f bf out 0x3f, r20 ; 63 29c44: f9 01 movw r30, r18 29c46: 31 97 sbiw r30, 0x01 ; 1 29c48: f1 f7 brne .-4 ; 0x29c46 29c4a: 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++) 29c4c: 41 f7 brne .-48 ; 0x29c1e Sound_DoSound_Blind_Alert(); break; default: break; } } 29c4e: 08 95 ret 00029c50 : //! @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 ) { 29c50: 2f 92 push r2 29c52: 3f 92 push r3 29c54: 4f 92 push r4 29c56: 5f 92 push r5 29c58: 6f 92 push r6 29c5a: 7f 92 push r7 29c5c: 8f 92 push r8 29c5e: 9f 92 push r9 29c60: af 92 push r10 29c62: bf 92 push r11 29c64: cf 92 push r12 29c66: df 92 push r13 29c68: ef 92 push r14 29c6a: ff 92 push r15 29c6c: 0f 93 push r16 29c6e: 1f 93 push r17 29c70: cf 93 push r28 29c72: df 93 push r29 29c74: 00 d0 rcall .+0 ; 0x29c76 29c76: 00 d0 rcall .+0 ; 0x29c78 29c78: cd b7 in r28, 0x3d ; 61 29c7a: de b7 in r29, 0x3e ; 62 29c7c: 5c 01 movw r10, r24 29c7e: 6c 83 std Y+4, r22 ; 0x04 29c80: 34 2e mov r3, r20 29c82: 3b 83 std Y+3, r19 ; 0x03 29c84: 2a 83 std Y+2, r18 ; 0x02 29c86: 48 01 movw r8, r16 29c88: 2c 2c mov r2, r12 const char *msg_next = msg ? lcd_display_message_fullscreen_P(msg) : NULL; 29c8a: 00 97 sbiw r24, 0x00 ; 0 29c8c: 09 f0 breq .+2 ; 0x29c90 29c8e: 51 c0 rjmp .+162 ; 0x29d32 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); 29c90: 87 01 movw r16, r14 29c92: 22 2d mov r18, r2 29c94: a4 01 movw r20, r8 29c96: 6a 81 ldd r22, Y+2 ; 0x02 29c98: 7b 81 ldd r23, Y+3 ; 0x03 29c9a: 83 2d mov r24, r3 29c9c: 0f 94 69 1f call 0x23ed2 ; 0x23ed2 29ca0: d1 2c mov r13, r1 29ca2: c1 2c mov r12, r1 } // Wait for user confirmation or a timeout. unsigned long previous_millis_cmd = _millis(); 29ca4: 0f 94 22 29 call 0x25244 ; 0x25244 29ca8: 2b 01 movw r4, r22 29caa: 3c 01 movw r6, r24 lcd_consume_click(); 29cac: 0e 94 10 71 call 0xe220 ; 0xe220 KEEPALIVE_STATE(PAUSED_FOR_USER); 29cb0: 84 e0 ldi r24, 0x04 ; 4 29cb2: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be 29cb6: de 82 std Y+6, r13 ; 0x06 29cb8: cd 82 std Y+5, r12 ; 0x05 29cba: 24 e6 ldi r18, 0x64 ; 100 29cbc: 29 83 std Y+1, r18 ; 0x01 for (;;) { for (uint8_t i = 0; i < 100; ++i) { delay_keep_alive(50); 29cbe: 82 e3 ldi r24, 0x32 ; 50 29cc0: 90 e0 ldi r25, 0x00 ; 0 29cc2: 0e 94 fc 8c call 0x119f8 ; 0x119f8 if (allow_timeouting && _millis() - previous_millis_cmd > LCD_TIMEOUT_TO_STATUS) { 29cc6: 3c 81 ldd r19, Y+4 ; 0x04 29cc8: 31 11 cpse r19, r1 29cca: 3a c0 rjmp .+116 ; 0x29d40 current_selection = LCD_BUTTON_TIMEOUT; goto exit; } if (lcd_encoder) { 29ccc: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 29cd0: 90 91 70 06 lds r25, 0x0670 ; 0x800670 29cd4: 00 97 sbiw r24, 0x00 ; 0 29cd6: 09 f0 breq .+2 ; 0x29cda 29cd8: 42 c0 rjmp .+132 ; 0x29d5e } else { Sound_MakeSound(e_SOUND_TYPE_BlindAlert); break; // turning knob skips waiting loop } } if (lcd_clicked()) { 29cda: 0e 94 15 71 call 0xe22a ; 0xe22a 29cde: 88 23 and r24, r24 29ce0: 09 f4 brne .+2 ; 0x29ce4 29ce2: 67 c0 rjmp .+206 ; 0x29db2 if (msg_next == NULL) { 29ce4: 8d 81 ldd r24, Y+5 ; 0x05 29ce6: 9e 81 ldd r25, Y+6 ; 0x06 29ce8: 89 2b or r24, r25 29cea: 09 f0 breq .+2 ; 0x29cee 29cec: 5e c0 rjmp .+188 ; 0x29daa if (msg_next == NULL) { lcd_show_choices_prompt_P(current_selection, first_choice, second_choice, second_col, third_choice); } } exit: KEEPALIVE_STATE(IN_HANDLER); 29cee: 82 e0 ldi r24, 0x02 ; 2 29cf0: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be // 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; 29cf4: 91 e0 ldi r25, 0x01 ; 1 29cf6: 90 93 6e 02 sts 0x026E, r25 ; 0x80026e lcd_draw_update = 2; 29cfa: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d return current_selection; } 29cfe: 83 2d mov r24, r3 29d00: 26 96 adiw r28, 0x06 ; 6 29d02: 0f b6 in r0, 0x3f ; 63 29d04: f8 94 cli 29d06: de bf out 0x3e, r29 ; 62 29d08: 0f be out 0x3f, r0 ; 63 29d0a: cd bf out 0x3d, r28 ; 61 29d0c: df 91 pop r29 29d0e: cf 91 pop r28 29d10: 1f 91 pop r17 29d12: 0f 91 pop r16 29d14: ff 90 pop r15 29d16: ef 90 pop r14 29d18: df 90 pop r13 29d1a: cf 90 pop r12 29d1c: bf 90 pop r11 29d1e: af 90 pop r10 29d20: 9f 90 pop r9 29d22: 8f 90 pop r8 29d24: 7f 90 pop r7 29d26: 6f 90 pop r6 29d28: 5f 90 pop r5 29d2a: 4f 90 pop r4 29d2c: 3f 90 pop r3 29d2e: 2f 90 pop r2 29d30: 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; 29d32: 0f 94 ba 1f call 0x23f74 ; 0x23f74 29d36: 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) { 29d38: 89 2b or r24, r25 29d3a: 09 f0 breq .+2 ; 0x29d3e 29d3c: b3 cf rjmp .-154 ; 0x29ca4 29d3e: a8 cf rjmp .-176 ; 0x29c90 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) { 29d40: 0f 94 22 29 call 0x25244 ; 0x25244 29d44: 64 19 sub r22, r4 29d46: 75 09 sbc r23, r5 29d48: 86 09 sbc r24, r6 29d4a: 97 09 sbc r25, r7 29d4c: 61 33 cpi r22, 0x31 ; 49 29d4e: 75 47 sbci r23, 0x75 ; 117 29d50: 81 05 cpc r24, r1 29d52: 91 05 cpc r25, r1 29d54: 08 f4 brcc .+2 ; 0x29d58 29d56: ba cf rjmp .-140 ; 0x29ccc current_selection = LCD_BUTTON_TIMEOUT; 29d58: 33 24 eor r3, r3 29d5a: 3a 94 dec r3 29d5c: c8 cf rjmp .-112 ; 0x29cee goto exit; } if (lcd_encoder) { if (msg_next == NULL) { 29d5e: 2d 81 ldd r18, Y+5 ; 0x05 29d60: 3e 81 ldd r19, Y+6 ; 0x06 29d62: 23 2b or r18, r19 29d64: f9 f4 brne .+62 ; 0x29da4 if (third_choice) { // third_choice is not nullptr, safe to dereference 29d66: e1 14 cp r14, r1 29d68: f1 04 cpc r15, r1 29d6a: b1 f0 breq .+44 ; 0x29d98 if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 29d6c: 97 ff sbrs r25, 7 29d6e: 0f c0 rjmp .+30 ; 0x29d8e 29d70: 31 10 cpse r3, r1 // Rotating knob counter clockwise current_selection--; 29d72: 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); 29d74: 87 01 movw r16, r14 29d76: 22 2d mov r18, r2 29d78: a4 01 movw r20, r8 29d7a: 6a 81 ldd r22, Y+2 ; 0x02 29d7c: 7b 81 ldd r23, Y+3 ; 0x03 29d7e: 83 2d mov r24, r3 29d80: 0f 94 69 1f call 0x23ed2 ; 0x23ed2 lcd_encoder = 0; 29d84: 10 92 70 06 sts 0x0670, r1 ; 0x800670 29d88: 10 92 6f 06 sts 0x066F, r1 ; 0x80066f 29d8c: a6 cf rjmp .-180 ; 0x29cda 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) { 29d8e: 32 e0 ldi r19, 0x02 ; 2 29d90: 33 16 cp r3, r19 29d92: 81 f3 breq .-32 ; 0x29d74 // Rotating knob clockwise current_selection++; 29d94: 33 94 inc r3 29d96: ee cf rjmp .-36 ; 0x29d74 } } else { if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 29d98: 39 2e mov r3, r25 29d9a: 30 94 com r3 29d9c: 33 1c adc r3, r3 29d9e: 33 24 eor r3, r3 29da0: 33 1c adc r3, r3 29da2: e8 cf rjmp .-48 ; 0x29d74 } } 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); 29da4: 87 e0 ldi r24, 0x07 ; 7 29da6: 0f 94 c2 4d call 0x29b84 ; 0x29b84 goto exit; } else break; } } if (multi_screen) { 29daa: c1 14 cp r12, r1 29dac: d1 04 cpc r13, r1 29dae: 79 f4 brne .+30 ; 0x29dce 29db0: 84 cf rjmp .-248 ; 0x29cba 29db2: 99 81 ldd r25, Y+1 ; 0x01 29db4: 91 50 subi r25, 0x01 ; 1 29db6: 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) { 29db8: 91 11 cpse r25, r1 29dba: 81 cf rjmp .-254 ; 0x29cbe goto exit; } else break; } } if (multi_screen) { 29dbc: c1 14 cp r12, r1 29dbe: d1 04 cpc r13, r1 29dc0: 61 f0 breq .+24 ; 0x29dda if (msg_next == NULL) { 29dc2: 2d 81 ldd r18, Y+5 ; 0x05 29dc4: 3e 81 ldd r19, Y+6 ; 0x06 29dc6: 23 2b or r18, r19 29dc8: 11 f4 brne .+4 ; 0x29dce 29dca: be 82 std Y+6, r11 ; 0x06 29dcc: ad 82 std Y+5, r10 ; 0x05 msg_next = msg; } msg_next = lcd_display_message_fullscreen_P(msg_next); 29dce: 8d 81 ldd r24, Y+5 ; 0x05 29dd0: 9e 81 ldd r25, Y+6 ; 0x06 29dd2: 0f 94 ba 1f call 0x23f74 ; 0x23f74 29dd6: 9e 83 std Y+6, r25 ; 0x06 29dd8: 8d 83 std Y+5, r24 ; 0x05 } if (msg_next == NULL) { 29dda: 8d 81 ldd r24, Y+5 ; 0x05 29ddc: 9e 81 ldd r25, Y+6 ; 0x06 29dde: 89 2b or r24, r25 29de0: 09 f0 breq .+2 ; 0x29de4 29de2: 6b cf rjmp .-298 ; 0x29cba lcd_show_choices_prompt_P(current_selection, first_choice, second_choice, second_col, third_choice); 29de4: 87 01 movw r16, r14 29de6: 22 2d mov r18, r2 29de8: a4 01 movw r20, r8 29dea: 6a 81 ldd r22, Y+2 ; 0x02 29dec: 7b 81 ldd r23, Y+3 ; 0x03 29dee: 83 2d mov r24, r3 29df0: 0f 94 69 1f call 0x23ed2 ; 0x23ed2 29df4: 62 cf rjmp .-316 ; 0x29cba 00029df6 : //! @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) { 29df6: bf 92 push r11 29df8: cf 92 push r12 29dfa: df 92 push r13 29dfc: ef 92 push r14 29dfe: ff 92 push r15 29e00: 0f 93 push r16 29e02: 1f 93 push r17 29e04: cf 93 push r28 29e06: df 93 push r29 29e08: ec 01 movw r28, r24 29e0a: d6 2e mov r13, r22 29e0c: 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); 29e0e: 87 e5 ldi r24, 0x57 ; 87 29e10: 98 e4 ldi r25, 0x48 ; 72 29e12: 0e 94 c4 72 call 0xe588 ; 0xe588 29e16: 8c 01 movw r16, r24 29e18: 81 e5 ldi r24, 0x51 ; 81 29e1a: 98 e4 ldi r25, 0x48 ; 72 29e1c: 0e 94 c4 72 call 0xe588 ; 0xe588 29e20: 2a e0 ldi r18, 0x0A ; 10 29e22: c2 2e mov r12, r18 29e24: f1 2c mov r15, r1 29e26: e1 2c mov r14, r1 29e28: 9c 01 movw r18, r24 29e2a: 4b 2d mov r20, r11 29e2c: 6d 2d mov r22, r13 29e2e: ce 01 movw r24, r28 29e30: 0f 94 28 4e call 0x29c50 ; 0x29c50 } 29e34: df 91 pop r29 29e36: cf 91 pop r28 29e38: 1f 91 pop r17 29e3a: 0f 91 pop r16 29e3c: ff 90 pop r15 29e3e: ef 90 pop r14 29e40: df 90 pop r13 29e42: cf 90 pop r12 29e44: bf 90 pop r11 29e46: 08 95 ret 00029e48 : _delay(2000); lcd_clear(); } void lcd_load_filament_color_check() { 29e48: cf 92 push r12 29e4a: ef 92 push r14 29e4c: ff 92 push r15 29e4e: 0f 93 push r16 29e50: 1f 93 push r17 29e52: cf 93 push r28 29e54: 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); 29e56: 84 e7 ldi r24, 0x74 ; 116 29e58: 90 e5 ldi r25, 0x50 ; 80 29e5a: 0e 94 c4 72 call 0xe588 ; 0xe588 29e5e: 7c 01 movw r14, r24 29e60: 87 e5 ldi r24, 0x57 ; 87 29e62: 98 e4 ldi r25, 0x48 ; 72 29e64: 0e 94 c4 72 call 0xe588 ; 0xe588 29e68: 8c 01 movw r16, r24 29e6a: 81 e5 ldi r24, 0x51 ; 81 29e6c: 98 e4 ldi r25, 0x48 ; 72 29e6e: 0e 94 c4 72 call 0xe588 ; 0xe588 29e72: ec 01 movw r28, r24 29e74: 89 e4 ldi r24, 0x49 ; 73 29e76: 90 e5 ldi r25, 0x50 ; 80 29e78: 0e 94 c4 72 call 0xe588 ; 0xe588 29e7c: 28 e0 ldi r18, 0x08 ; 8 29e7e: c2 2e mov r12, r18 29e80: 9e 01 movw r18, r28 29e82: 40 e0 ldi r20, 0x00 ; 0 29e84: 60 e0 ldi r22, 0x00 ; 0 29e86: 0f 94 28 4e call 0x29c50 ; 0x29c50 while (clean == LCD_MIDDLE_BUTTON_CHOICE) { 29e8a: 81 30 cpi r24, 0x01 ; 1 29e8c: 29 f4 brne .+10 ; 0x29e98 load_filament_final_feed(); 29e8e: 0e 94 ab 64 call 0xc956 ; 0xc956 st_synchronize(); 29e92: 0f 94 a3 42 call 0x28546 ; 0x28546 29e96: df cf rjmp .-66 ; 0x29e56 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) { 29e98: 82 30 cpi r24, 0x02 ; 2 29e9a: 61 f4 brne .+24 ; 0x29eb4 unload_filament(FILAMENTCHANGE_FINALRETRACT); 29e9c: 60 e0 ldi r22, 0x00 ; 0 29e9e: 70 e0 ldi r23, 0x00 ; 0 29ea0: cb 01 movw r24, r22 } } 29ea2: df 91 pop r29 29ea4: cf 91 pop r28 29ea6: 1f 91 pop r17 29ea8: 0f 91 pop r16 29eaa: ff 90 pop r15 29eac: ef 90 pop r14 29eae: 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); 29eb0: 0c 94 2a f8 jmp 0x1f054 ; 0x1f054 } } 29eb4: df 91 pop r29 29eb6: cf 91 pop r28 29eb8: 1f 91 pop r17 29eba: 0f 91 pop r16 29ebc: ff 90 pop r15 29ebe: ef 90 pop r14 29ec0: cf 90 pop r12 29ec2: 08 95 ret 00029ec4 : static void __attribute__((noinline)) mFilamentResetMenuStack() { menu_back(bFilamentPreheatState ? 1 : 2); } void mFilamentItem(uint16_t nTemp, uint16_t nTempBed) { 29ec4: 0f 93 push r16 29ec6: 1f 93 push r17 29ec8: cf 93 push r28 29eca: df 93 push r29 29ecc: 8c 01 movw r16, r24 29ece: eb 01 movw r28, r22 }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 29ed0: 90 93 b6 0d sts 0x0DB6, r25 ; 0x800db6 29ed4: 80 93 b5 0d sts 0x0DB5, r24 ; 0x800db5 setTargetHotend((float)nTemp); if (!shouldPreheatOnlyNozzle()) setTargetBed((float)nTempBed); 29ed8: 0f 94 0a 16 call 0x22c14 ; 0x22c14 29edc: 81 11 cpse r24, r1 29ede: 04 c0 rjmp .+8 ; 0x29ee8 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 29ee0: d0 93 72 06 sts 0x0672, r29 ; 0x800672 29ee4: c0 93 71 06 sts 0x0671, r28 ; 0x800671 { const FilamentAction action = eFilamentAction; 29ee8: c0 91 a5 03 lds r28, 0x03A5 ; 0x8003a5 if (action == FilamentAction::Preheat || action == FilamentAction::Lay1Cal) 29eec: 87 ef ldi r24, 0xF7 ; 247 29eee: 8c 0f add r24, r28 29ef0: 82 30 cpi r24, 0x02 ; 2 29ef2: f8 f4 brcc .+62 ; 0x29f32 { lcd_return_to_status(); 29ef4: 0f 94 7c 1e call 0x23cf8 ; 0x23cf8 if (action == FilamentAction::Lay1Cal) 29ef8: ca 30 cpi r28, 0x0A ; 10 29efa: 41 f4 brne .+16 ; 0x29f0c { lcd_commands_type = LcdCommands::Layer1Cal; 29efc: 84 e0 ldi r24, 0x04 ; 4 29efe: 80 93 b3 0d sts 0x0DB3, r24 ; 0x800db3 } menu_back(); clearFilamentAction(); } } } 29f02: df 91 pop r29 29f04: cf 91 pop r28 29f06: 1f 91 pop r17 29f08: 0f 91 pop r16 29f0a: 08 95 ret { lcd_commands_type = LcdCommands::Layer1Cal; } else { raise_z_above(MIN_Z_FOR_PREHEAT); 29f0c: 60 e0 ldi r22, 0x00 ; 0 29f0e: 70 e0 ldi r23, 0x00 ; 0 29f10: 80 e2 ldi r24, 0x20 ; 32 29f12: 91 e4 ldi r25, 0x41 ; 65 29f14: 0e 94 78 6e call 0xdcf0 ; 0xdcf0 if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 29f18: 8f e5 ldi r24, 0x5F ; 95 29f1a: 9f e0 ldi r25, 0x0F ; 15 29f1c: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 29f20: 88 23 and r24, r24 29f22: 79 f3 breq .-34 ; 0x29f02 lcd_wizard(WizState::LoadFilHot); 29f24: 89 e0 ldi r24, 0x09 ; 9 } menu_back(); clearFilamentAction(); } } } 29f26: df 91 pop r29 29f28: cf 91 pop r28 29f2a: 1f 91 pop r17 29f2c: 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); 29f2e: 0c 94 d6 f8 jmp 0x1f1ac ; 0x1f1ac 29f32: 10 92 da 03 sts 0x03DA, r1 ; 0x8003da 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) 29f36: 80 91 63 06 lds r24, 0x0663 ; 0x800663 29f3a: 81 11 cpse r24, r1 29f3c: 12 c0 rjmp .+36 ; 0x29f62 29f3e: 60 91 af 0d lds r22, 0x0DAF ; 0x800daf 29f42: 70 91 b0 0d lds r23, 0x0DB0 ; 0x800db0 29f46: 80 91 b1 0d lds r24, 0x0DB1 ; 0x800db1 29f4a: 90 91 b2 0d lds r25, 0x0DB2 ; 0x800db2 29f4e: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> 29f52: 60 1b sub r22, r16 29f54: 71 0b sbc r23, r17 29f56: 6c 5f subi r22, 0xFC ; 252 29f58: 7f 4f sbci r23, 0xFF ; 255 29f5a: 69 30 cpi r22, 0x09 ; 9 29f5c: 71 05 cpc r23, r1 29f5e: 08 f0 brcs .+2 ; 0x29f62 29f60: 60 c0 rjmp .+192 ; 0x2a022 { menu_func_t filamentActionMenu = nullptr; switch (eFilamentAction) 29f62: c1 50 subi r28, 0x01 ; 1 29f64: c8 30 cpi r28, 0x08 ; 8 29f66: 88 f5 brcc .+98 ; 0x29fca 29f68: ec 2f mov r30, r28 29f6a: f0 e0 ldi r31, 0x00 ; 0 29f6c: 88 27 eor r24, r24 29f6e: e4 54 subi r30, 0x44 ; 68 29f70: f0 4b sbci r31, 0xB0 ; 176 29f72: 8e 4f sbci r24, 0xFE ; 254 29f74: 0d 94 e7 dc jmp 0x3b9ce ; 0x3b9ce <__tablejump2__> 29f78: 28 3b cpi r18, 0xB8 ; 184 29f7a: 28 3b cpi r18, 0xB8 ; 184 29f7c: 28 3b cpi r18, 0xB8 ; 184 29f7e: 08 3a cpi r16, 0xA8 ; 168 29f80: 2e 3b cpi r18, 0xBE ; 190 29f82: 6a 3a cpi r22, 0xAA ; 170 29f84: d4 3a cpi r29, 0xA4 ; 164 29f86: 8a 39 cpi r24, 0x9A ; 154 else if (eFilamentAction == FilamentAction::UnLoad) enquecommand_P(MSG_M702); // unload filament } break; case FilamentAction::MmuLoad: filamentActionMenu = mmu_load_to_nozzle_menu; 29f88: ca e3 ldi r28, 0x3A ; 58 29f8a: d1 ee ldi r29, 0xE1 ; 225 case FilamentAction::Preheat: case FilamentAction::Lay1Cal: // handled earlier break; } if (bFilamentWaitingFlag) { 29f8c: 80 91 61 06 lds r24, 0x0661 ; 0x800661 29f90: 88 23 and r24, r24 29f92: 29 f0 breq .+10 ; 0x29f9e Sound_MakeSound(e_SOUND_TYPE_StandardPrompt); 29f94: 82 e0 ldi r24, 0x02 ; 2 29f96: 0f 94 c2 4d call 0x29b84 ; 0x29b84 bFilamentWaitingFlag = false; 29f9a: 10 92 61 06 sts 0x0661, r1 ; 0x800661 } if (filamentActionMenu) { 29f9e: 20 97 sbiw r28, 0x00 ; 0 29fa0: 09 f4 brne .+2 ; 0x29fa4 29fa2: af cf rjmp .-162 ; 0x29f02 // Reset the menu stack and filament action before entering action menu mFilamentResetMenuStack(); 29fa4: 0f 94 97 1c call 0x2392e ; 0x2392e // The menu should clear eFilamentAction when the // 'action' is done menu_submenu(filamentActionMenu, true); 29fa8: 61 e0 ldi r22, 0x01 ; 1 29faa: ce 01 movw r24, r28 } menu_back(); clearFilamentAction(); } } } 29fac: df 91 pop r29 29fae: cf 91 pop r28 29fb0: 1f 91 pop r17 29fb2: 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); 29fb4: 0d 94 be d2 jmp 0x3a57c ; 0x3a57c switch (eFilamentAction) { case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::UnLoad: if (bFilamentWaitingFlag) menu_submenu(mFilamentPrompt, true); 29fb8: 80 91 61 06 lds r24, 0x0661 ; 0x800661 29fbc: 88 23 and r24, r24 29fbe: 41 f0 breq .+16 ; 0x29fd0 29fc0: 61 e0 ldi r22, 0x01 ; 1 29fc2: 88 e7 ldi r24, 0x78 ; 120 29fc4: 9a e3 ldi r25, 0x3A ; 58 29fc6: 0f 94 be d2 call 0x3a57c ; 0x3a57c // 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; 29fca: d0 e0 ldi r29, 0x00 ; 0 29fcc: c0 e0 ldi r28, 0x00 ; 0 29fce: de cf rjmp .-68 ; 0x29f8c case FilamentAction::AutoLoad: case FilamentAction::UnLoad: if (bFilamentWaitingFlag) menu_submenu(mFilamentPrompt, true); else { mFilamentResetMenuStack(); 29fd0: 0f 94 97 1c call 0x2392e ; 0x2392e if (eFilamentAction == FilamentAction::AutoLoad) { 29fd4: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 29fd8: 82 30 cpi r24, 0x02 ; 2 29fda: 19 f4 brne .+6 ; 0x29fe2 // loading no longer cancellable eFilamentAction = FilamentAction::Load; 29fdc: 81 e0 ldi r24, 0x01 ; 1 29fde: 80 93 a5 03 sts 0x03A5, r24 ; 0x8003a5 } if (eFilamentAction == FilamentAction::Load) 29fe2: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 29fe6: 81 30 cpi r24, 0x01 ; 1 29fe8: 31 f4 brne .+12 ; 0x29ff6 enquecommand_P(MSG_M701); // load filament 29fea: 61 e0 ldi r22, 0x01 ; 1 29fec: 86 e9 ldi r24, 0x96 ; 150 29fee: 9f e6 ldi r25, 0x6F ; 111 else if (eFilamentAction == FilamentAction::UnLoad) enquecommand_P(MSG_M702); // unload filament 29ff0: 0e 94 38 88 call 0x11070 ; 0x11070 29ff4: ea cf rjmp .-44 ; 0x29fca eFilamentAction = FilamentAction::Load; } if (eFilamentAction == FilamentAction::Load) enquecommand_P(MSG_M701); // load filament else if (eFilamentAction == FilamentAction::UnLoad) 29ff6: 83 30 cpi r24, 0x03 ; 3 29ff8: 41 f7 brne .-48 ; 0x29fca enquecommand_P(MSG_M702); // unload filament 29ffa: 61 e0 ldi r22, 0x01 ; 1 29ffc: 85 e1 ldi r24, 0x15 ; 21 29ffe: 9c e6 ldi r25, 0x6C ; 108 2a000: f7 cf rjmp .-18 ; 0x29ff0 break; case FilamentAction::MmuLoad: filamentActionMenu = mmu_load_to_nozzle_menu; break; case FilamentAction::MmuLoadingTest: filamentActionMenu = mmu_loading_test_menu; 2a002: c4 eb ldi r28, 0xB4 ; 180 2a004: d0 ee ldi r29, 0xE0 ; 224 2a006: c2 cf rjmp .-124 ; 0x29f8c break; case FilamentAction::MmuUnLoad: mFilamentResetMenuStack(); 2a008: 0f 94 97 1c call 0x2392e ; 0x2392e MMU2::mmu2.unload(); 2a00c: 0f 94 f8 ac call 0x359f0 ; 0x359f0 // 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(); 2a010: 0f 94 69 20 call 0x240d2 ; 0x240d2 2a014: da cf rjmp .-76 ; 0x29fca break; case FilamentAction::MmuEject: filamentActionMenu = mmu_fil_eject_menu; 2a016: c2 e3 ldi r28, 0x32 ; 50 2a018: d1 ee ldi r29, 0xE1 ; 225 2a01a: b8 cf rjmp .-144 ; 0x29f8c break; case FilamentAction::MmuCut: #ifdef MMU_HAS_CUTTER filamentActionMenu = mmu_cut_filament_menu; 2a01c: ca e2 ldi r28, 0x2A ; 42 2a01e: d1 ee ldi r29, 0xE1 ; 225 2a020: b5 cf rjmp .-150 ; 0x29f8c menu_submenu(filamentActionMenu, true); } } else // still preheating, continue updating LCD UI { if (!bFilamentWaitingFlag || lcd_draw_update) 2a022: 80 91 61 06 lds r24, 0x0661 ; 0x800661 2a026: 88 23 and r24, r24 2a028: 21 f0 breq .+8 ; 0x2a032 2a02a: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 2a02e: 88 23 and r24, r24 2a030: 71 f1 breq .+92 ; 0x2a08e // 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; 2a032: 81 e0 ldi r24, 0x01 ; 1 2a034: 80 93 61 06 sts 0x0661, r24 ; 0x800661 // also force-enable lcd_draw_update (might be 0 when called from outside a menu) lcd_draw_update = 1; 2a038: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d lcd_clear(); 2a03c: 0e 94 2b 6f call 0xde56 ; 0xde56 lcd_puts_at_P(0, 3, _T(MSG_CANCEL)); 2a040: 80 ec ldi r24, 0xC0 ; 192 2a042: 9b e3 ldi r25, 0x3B ; 59 2a044: 0e 94 c4 72 call 0xe588 ; 0xe588 2a048: ac 01 movw r20, r24 2a04a: 63 e0 ldi r22, 0x03 ; 3 2a04c: 80 e0 ldi r24, 0x00 ; 0 2a04e: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_set_cursor(0, 1); 2a052: 61 e0 ldi r22, 0x01 ; 1 2a054: 80 e0 ldi r24, 0x00 ; 0 2a056: 0e 94 f8 6e call 0xddf0 ; 0xddf0 switch (eFilamentAction) 2a05a: e0 91 a5 03 lds r30, 0x03A5 ; 0x8003a5 2a05e: e1 50 subi r30, 0x01 ; 1 2a060: e8 30 cpi r30, 0x08 ; 8 2a062: a8 f4 brcc .+42 ; 0x2a08e 2a064: f0 e0 ldi r31, 0x00 ; 0 2a066: 88 27 eor r24, r24 2a068: e7 5c subi r30, 0xC7 ; 199 2a06a: ff 4a sbci r31, 0xAF ; 175 2a06c: 8e 4f sbci r24, 0xFE ; 254 2a06e: 0d 94 e7 dc jmp 0x3b9ce ; 0x3b9ce <__tablejump2__> 2a072: 30 39 cpi r19, 0x90 ; 144 2a074: 30 39 cpi r19, 0x90 ; 144 2a076: 8c 39 cpi r24, 0x9C ; 156 2a078: 30 39 cpi r19, 0x90 ; 144 2a07a: 8c 39 cpi r24, 0x9C ; 156 2a07c: f2 3a cpi r31, 0xA2 ; 162 2a07e: b0 39 cpi r27, 0x90 ; 144 2a080: 30 39 cpi r19, 0x90 ; 144 { case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::MmuLoad: case FilamentAction::MmuLoadingTest: lcd_puts_P(_T(MSG_PREHEATING_TO_LOAD)); 2a082: 89 e2 ldi r24, 0x29 ; 41 2a084: 90 e5 ldi r25, 0x50 ; 80 break; case FilamentAction::MmuEject: lcd_puts_P(_T(MSG_PREHEATING_TO_EJECT)); break; case FilamentAction::MmuCut: lcd_puts_P(_T(MSG_PREHEATING_TO_CUT)); 2a086: 0e 94 c4 72 call 0xe588 ; 0xe588 2a08a: 0e 94 e3 6e call 0xddc6 ; 0xddc6 // handled earlier break; } } if (bFilamentWaitingFlag) { 2a08e: 80 91 61 06 lds r24, 0x0661 ; 0x800661 2a092: 81 11 cpse r24, r1 lcd_print_target_temps_first_line(); 2a094: 0f 94 6d 21 call 0x242da ; 0x242da } if (lcd_clicked()) 2a098: 0e 94 15 71 call 0xe22a ; 0xe22a 2a09c: 88 23 and r24, r24 2a09e: 09 f4 brne .+2 ; 0x2a0a2 2a0a0: 30 cf rjmp .-416 ; 0x29f02 { // Filament action canceled while preheating bFilamentWaitingFlag = false; 2a0a2: 10 92 61 06 sts 0x0661, r1 ; 0x800661 if (!bFilamentPreheatState) 2a0a6: 80 91 62 06 lds r24, 0x0662 ; 0x800662 2a0aa: 81 11 cpse r24, r1 2a0ac: 0e c0 rjmp .+28 ; 0x2a0ca return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 2a0ae: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 2a0b2: 10 92 b5 0d sts 0x0DB5, r1 ; 0x800db5 { setTargetHotend(0); if (!printingIsPaused()) setTargetBed(0); 2a0b6: 0e 94 9d 67 call 0xcf3a ; 0xcf3a 2a0ba: 81 11 cpse r24, r1 2a0bc: 04 c0 rjmp .+8 ; 0x2a0c6 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 2a0be: 10 92 72 06 sts 0x0672, r1 ; 0x800672 2a0c2: 10 92 71 06 sts 0x0671, r1 ; 0x800671 menu_back(); 2a0c6: 0f 94 19 d4 call 0x3a832 ; 0x3a832 } menu_back(); 2a0ca: 0f 94 19 d4 call 0x3a832 ; 0x3a832 clearFilamentAction(); } } } 2a0ce: df 91 pop r29 2a0d0: cf 91 pop r28 2a0d2: 1f 91 pop r17 2a0d4: 0f 91 pop r16 setTargetHotend(0); if (!printingIsPaused()) setTargetBed(0); menu_back(); } menu_back(); clearFilamentAction(); 2a0d6: 0d 94 69 20 jmp 0x240d2 ; 0x240d2 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)); 2a0da: 82 e1 ldi r24, 0x12 ; 18 2a0dc: 90 e5 ldi r25, 0x50 ; 80 2a0de: d3 cf rjmp .-90 ; 0x2a086 break; case FilamentAction::MmuEject: lcd_puts_P(_T(MSG_PREHEATING_TO_EJECT)); 2a0e0: 8c ef ldi r24, 0xFC ; 252 2a0e2: 9f e4 ldi r25, 0x4F ; 79 2a0e4: d0 cf rjmp .-96 ; 0x2a086 break; case FilamentAction::MmuCut: lcd_puts_P(_T(MSG_PREHEATING_TO_CUT)); 2a0e6: 88 ee ldi r24, 0xE8 ; 232 2a0e8: 9f e4 ldi r25, 0x4F ; 79 2a0ea: cd cf rjmp .-102 ; 0x2a086 0002a0ec : } } } static void setFilamentAction(FilamentAction action) { eFilamentAction = action; 2a0ec: 80 93 a5 03 sts 0x03A5, r24 ; 0x8003a5 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) ); 2a0f0: 40 91 b9 13 lds r20, 0x13B9 ; 0x8013b9 2a0f4: 20 91 b5 0d lds r18, 0x0DB5 ; 0x800db5 2a0f8: 30 91 b6 0d lds r19, 0x0DB6 ; 0x800db6 2a0fc: 41 30 cpi r20, 0x01 ; 1 2a0fe: 59 f0 breq .+22 ; 0x2a116 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() 2a100: 10 92 63 06 sts 0x0663, r1 ; 0x800663 && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); if (bFilamentSkipPreheat || target_temperature[0] >= extrude_min_temp) { 2a104: 80 91 6b 02 lds r24, 0x026B ; 0x80026b 2a108: 90 91 6c 02 lds r25, 0x026C ; 0x80026c 2a10c: 28 17 cp r18, r24 2a10e: 39 07 cpc r19, r25 2a110: 5c f4 brge .+22 ; 0x2a128 bFilamentPreheatState = true; mFilamentItem(target_temperature[0], target_temperature_bed); bFilamentSkipPreheat = false; // Reset flag } else { lcd_generic_preheat_menu(); 2a112: 0d 94 6c 20 jmp 0x240d8 ; 0x240d8 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() 2a116: 90 91 8f 13 lds r25, 0x138F ; 0x80138f 2a11a: 91 11 cpse r25, r1 2a11c: f1 cf rjmp .-30 ; 0x2a100 && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); 2a11e: 86 50 subi r24, 0x06 ; 6 2a120: 82 30 cpi r24, 0x02 ; 2 2a122: 70 f7 brcc .-36 ; 0x2a100 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() 2a124: 40 93 63 06 sts 0x0663, r20 ; 0x800663 && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); if (bFilamentSkipPreheat || target_temperature[0] >= extrude_min_temp) { bFilamentPreheatState = true; 2a128: 81 e0 ldi r24, 0x01 ; 1 2a12a: 80 93 62 06 sts 0x0662, r24 ; 0x800662 mFilamentItem(target_temperature[0], target_temperature_bed); 2a12e: 60 91 71 06 lds r22, 0x0671 ; 0x800671 2a132: 70 91 72 06 lds r23, 0x0672 ; 0x800672 2a136: c9 01 movw r24, r18 2a138: 0f 94 62 4f call 0x29ec4 ; 0x29ec4 bFilamentSkipPreheat = false; // Reset flag 2a13c: 10 92 63 06 sts 0x0663, r1 ; 0x800663 } else { lcd_generic_preheat_menu(); } } 2a140: 08 95 ret 0002a142 : { preheat_or_continue(FilamentAction::Load); } void lcd_AutoLoadFilament() { preheat_or_continue(FilamentAction::AutoLoad); 2a142: 82 e0 ldi r24, 0x02 ; 2 2a144: 0d 94 76 50 jmp 0x2a0ec ; 0x2a0ec 0002a148 : } } static void lcd_LoadFilament() { preheat_or_continue(FilamentAction::Load); 2a148: 81 e0 ldi r24, 0x01 ; 1 2a14a: 0d 94 76 50 jmp 0x2a0ec ; 0x2a0ec 0002a14e : MENU_END(); } static void lcd_unLoadFilament() { preheat_or_continue(FilamentAction::UnLoad); 2a14e: 83 e0 ldi r24, 0x03 ; 3 2a150: 0d 94 76 50 jmp 0x2a0ec ; 0x2a0ec 0002a154 : mFilamentItem(FARM_PREHEAT_HOTEND_TEMP, 0); } static void mFilamentItem_PLA() { bFilamentPreheatState = false; 2a154: 10 92 62 06 sts 0x0662, r1 ; 0x800662 mFilamentItem(PLA_PREHEAT_HOTEND_TEMP, PLA_PREHEAT_HPB_TEMP); 2a158: 6c e3 ldi r22, 0x3C ; 60 2a15a: 70 e0 ldi r23, 0x00 ; 0 2a15c: 87 ed ldi r24, 0xD7 ; 215 2a15e: 90 e0 ldi r25, 0x00 ; 0 2a160: 0d 94 62 4f jmp 0x29ec4 ; 0x29ec4 0002a164 : } static void mFilamentItem_PET() { bFilamentPreheatState = false; 2a164: 10 92 62 06 sts 0x0662, r1 ; 0x800662 mFilamentItem(PET_PREHEAT_HOTEND_TEMP, PET_PREHEAT_HPB_TEMP); 2a168: 65 e5 ldi r22, 0x55 ; 85 2a16a: 70 e0 ldi r23, 0x00 ; 0 2a16c: 86 ee ldi r24, 0xE6 ; 230 2a16e: 90 e0 ldi r25, 0x00 ; 0 2a170: 0d 94 62 4f jmp 0x29ec4 ; 0x29ec4 0002a174 : } static void mFilamentItem_ASA() { bFilamentPreheatState = false; 2a174: 10 92 62 06 sts 0x0662, r1 ; 0x800662 mFilamentItem(ASA_PREHEAT_HOTEND_TEMP, ASA_PREHEAT_HPB_TEMP); 2a178: 69 e6 ldi r22, 0x69 ; 105 2a17a: 70 e0 ldi r23, 0x00 ; 0 2a17c: 84 e0 ldi r24, 0x04 ; 4 2a17e: 91 e0 ldi r25, 0x01 ; 1 2a180: 0d 94 62 4f jmp 0x29ec4 ; 0x29ec4 0002a184 : } static void mFilamentItem_PC() { bFilamentPreheatState = false; 2a184: 10 92 62 06 sts 0x0662, r1 ; 0x800662 mFilamentItem(PC_PREHEAT_HOTEND_TEMP, PC_PREHEAT_HPB_TEMP); 2a188: 6e e6 ldi r22, 0x6E ; 110 2a18a: 70 e0 ldi r23, 0x00 ; 0 2a18c: 83 e1 ldi r24, 0x13 ; 19 2a18e: 91 e0 ldi r25, 0x01 ; 1 2a190: 0d 94 62 4f jmp 0x29ec4 ; 0x29ec4 0002a194 : mFilamentItem(FLEX_PREHEAT_HOTEND_TEMP, FLEX_PREHEAT_HPB_TEMP); } static void mFilamentItem_PVB() { bFilamentPreheatState = false; 2a194: 10 92 62 06 sts 0x0662, r1 ; 0x800662 mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); 2a198: 6b e4 ldi r22, 0x4B ; 75 2a19a: 70 e0 ldi r23, 0x00 ; 0 2a19c: 87 ed ldi r24, 0xD7 ; 215 2a19e: 90 e0 ldi r25, 0x00 ; 0 2a1a0: 0d 94 62 4f jmp 0x29ec4 ; 0x29ec4 0002a1a4 : mFilamentItem(ABS_PREHEAT_HOTEND_TEMP, ABS_PREHEAT_HPB_TEMP); } static void mFilamentItem_PA() { bFilamentPreheatState = false; 2a1a4: 10 92 62 06 sts 0x0662, r1 ; 0x800662 mFilamentItem(PA_PREHEAT_HOTEND_TEMP, PA_PREHEAT_HPB_TEMP); 2a1a8: 6a e5 ldi r22, 0x5A ; 90 2a1aa: 70 e0 ldi r23, 0x00 ; 0 2a1ac: 83 e1 ldi r24, 0x13 ; 19 2a1ae: 91 e0 ldi r25, 0x01 ; 1 2a1b0: 0d 94 62 4f jmp 0x29ec4 ; 0x29ec4 0002a1b4 : mFilamentItem(PC_PREHEAT_HOTEND_TEMP, PC_PREHEAT_HPB_TEMP); } static void mFilamentItem_ABS() { bFilamentPreheatState = false; 2a1b4: 10 92 62 06 sts 0x0662, r1 ; 0x800662 mFilamentItem(ABS_PREHEAT_HOTEND_TEMP, ABS_PREHEAT_HPB_TEMP); 2a1b8: 64 e6 ldi r22, 0x64 ; 100 2a1ba: 70 e0 ldi r23, 0x00 ; 0 2a1bc: 8f ef ldi r24, 0xFF ; 255 2a1be: 90 e0 ldi r25, 0x00 ; 0 2a1c0: 0d 94 62 4f jmp 0x29ec4 ; 0x29ec4 0002a1c4 : mFilamentItem(PA_PREHEAT_HOTEND_TEMP, PA_PREHEAT_HPB_TEMP); } static void mFilamentItem_HIPS() { bFilamentPreheatState = false; 2a1c4: 10 92 62 06 sts 0x0662, r1 ; 0x800662 mFilamentItem(HIPS_PREHEAT_HOTEND_TEMP, HIPS_PREHEAT_HPB_TEMP); 2a1c8: 64 e6 ldi r22, 0x64 ; 100 2a1ca: 70 e0 ldi r23, 0x00 ; 0 2a1cc: 8c ed ldi r24, 0xDC ; 220 2a1ce: 90 e0 ldi r25, 0x00 ; 0 2a1d0: 0d 94 62 4f jmp 0x29ec4 ; 0x29ec4 0002a1d4 : } static void mFilamentItem_PP() { bFilamentPreheatState = false; 2a1d4: 10 92 62 06 sts 0x0662, r1 ; 0x800662 mFilamentItem(PP_PREHEAT_HOTEND_TEMP, PP_PREHEAT_HPB_TEMP); 2a1d8: 64 e6 ldi r22, 0x64 ; 100 2a1da: 70 e0 ldi r23, 0x00 ; 0 2a1dc: 8e ef ldi r24, 0xFE ; 254 2a1de: 90 e0 ldi r25, 0x00 ; 0 2a1e0: 0d 94 62 4f jmp 0x29ec4 ; 0x29ec4 0002a1e4 : } static void mFilamentItem_FLEX() { bFilamentPreheatState = false; 2a1e4: 10 92 62 06 sts 0x0662, r1 ; 0x800662 mFilamentItem(FLEX_PREHEAT_HOTEND_TEMP, FLEX_PREHEAT_HPB_TEMP); 2a1e8: 62 e3 ldi r22, 0x32 ; 50 2a1ea: 70 e0 ldi r23, 0x00 ; 0 2a1ec: 80 ef ldi r24, 0xF0 ; 240 2a1ee: 90 e0 ldi r25, 0x00 ; 0 2a1f0: 0d 94 62 4f jmp 0x29ec4 ; 0x29ec4 0002a1f4 : } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 2a1f4: 80 e0 ldi r24, 0x00 ; 0 2a1f6: 0f 94 c2 4d call 0x29b84 ; 0x29b84 #include "xflash_dump.h" static void lcd_dump_memory() { lcd_beeper_quick_feedback(); xfdump_dump(); 2a1fa: 0e 94 c5 ed call 0x1db8a ; 0x1db8a lcd_return_to_status(); 2a1fe: 0d 94 7c 1e jmp 0x23cf8 ; 0x23cf8 0002a202 : } 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){ 2a202: cf 92 push r12 2a204: df 92 push r13 2a206: ef 92 push r14 2a208: ff 92 push r15 if (critical || eSoundMode != e_SOUND_MODE_SILENT) { 2a20a: 41 11 cpse r20, r1 2a20c: 04 c0 rjmp .+8 ; 0x2a216 2a20e: 20 91 dd 04 lds r18, 0x04DD ; 0x8004dd 2a212: 22 30 cpi r18, 0x02 ; 2 2a214: d1 f0 breq .+52 ; 0x2a24a 2a216: 9b 01 movw r18, r22 2a218: 6c 01 movw r12, r24 2a21a: f1 2c mov r15, r1 2a21c: e1 2c mov r14, r1 if(!tone_) { 2a21e: 67 2b or r22, r23 2a220: c9 f4 brne .+50 ; 0x2a254 WRITE(BEEPER, HIGH); 2a222: 9f b7 in r25, 0x3f ; 63 2a224: f8 94 cli 2a226: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2a22a: 84 60 ori r24, 0x04 ; 4 2a22c: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2a230: 9f bf out 0x3f, r25 ; 63 _delay(ms); 2a232: c7 01 movw r24, r14 2a234: b6 01 movw r22, r12 2a236: 0f 94 29 27 call 0x24e52 ; 0x24e52 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); 2a23a: 9f b7 in r25, 0x3f ; 63 2a23c: f8 94 cli 2a23e: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2a242: 8b 7f andi r24, 0xFB ; 251 2a244: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2a248: 9f bf out 0x3f, r25 ; 63 _tone(BEEPER, tone_); _delay(ms); _noTone(BEEPER); } } } 2a24a: ff 90 pop r15 2a24c: ef 90 pop r14 2a24e: df 90 pop r13 2a250: cf 90 pop r12 2a252: 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); 2a254: 22 0f add r18, r18 2a256: 33 1f adc r19, r19 2a258: 50 e0 ldi r21, 0x00 ; 0 2a25a: 40 e0 ldi r20, 0x00 ; 0 2a25c: 60 e0 ldi r22, 0x00 ; 0 2a25e: 74 e2 ldi r23, 0x24 ; 36 2a260: 84 ef ldi r24, 0xF4 ; 244 2a262: 90 e0 ldi r25, 0x00 ; 0 2a264: 0f 94 c8 dc call 0x3b990 ; 0x3b990 <__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; 2a268: 91 e0 ldi r25, 0x01 ; 1 uint32_t pwm_freq = F_CPU / (2 * frequency); if (pwm_freq > UINT16_MAX) { 2a26a: 21 15 cp r18, r1 2a26c: 31 05 cpc r19, r1 2a26e: 81 e0 ldi r24, 0x01 ; 1 2a270: 48 07 cpc r20, r24 2a272: 51 05 cpc r21, r1 2a274: 44 f0 brlt .+16 ; 0x2a286 pwm_freq /= 64; // Increase prescaler to 64 2a276: 86 e0 ldi r24, 0x06 ; 6 2a278: 56 95 lsr r21 2a27a: 47 95 ror r20 2a27c: 37 95 ror r19 2a27e: 27 95 ror r18 2a280: 8a 95 dec r24 2a282: d1 f7 brne .-12 ; 0x2a278 prescalarbits = 0b011; 2a284: 93 e0 ldi r25, 0x03 ; 3 } uint16_t ocr = pwm_freq - 1; 2a286: 21 50 subi r18, 0x01 ; 1 2a288: 31 09 sbc r19, r1 CRITICAL_SECTION_START; 2a28a: 4f b7 in r20, 0x3f ; 63 2a28c: f8 94 cli // Set calcualted prescaler TCCR4B = (TCCR4B & 0b11111000) | prescalarbits; 2a28e: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 2a292: 88 7f andi r24, 0xF8 ; 248 2a294: 89 2b or r24, r25 2a296: 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); 2a29a: 60 91 ac 00 lds r22, 0x00AC ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 2a29e: 70 91 ad 00 lds r23, 0x00AD ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 2a2a2: 26 9f mul r18, r22 2a2a4: c0 01 movw r24, r0 2a2a6: 27 9f mul r18, r23 2a2a8: 90 0d add r25, r0 2a2aa: 36 9f mul r19, r22 2a2ac: 90 0d add r25, r0 2a2ae: 11 24 eor r1, r1 2a2b0: 50 91 72 00 lds r21, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 2a2b4: 6f ef ldi r22, 0xFF ; 255 2a2b6: 70 e0 ldi r23, 0x00 ; 0 2a2b8: 51 ff sbrs r21, 1 2a2ba: 04 c0 rjmp .+8 ; 0x2a2c4 2a2bc: 60 91 a8 00 lds r22, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 2a2c0: 70 91 a9 00 lds r23, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 2a2c4: 0f 94 a0 dc call 0x3b940 ; 0x3b940 <__udivmodhi4> 2a2c8: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 2a2cc: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> #endif //EXTRUDER_0_AUTO_FAN_PIN // Set calcualted ocr OCR4A = ocr; 2a2d0: 30 93 a9 00 sts 0x00A9, r19 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 2a2d4: 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); 2a2d8: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 2a2dc: 83 60 ori r24, 0x03 ; 3 2a2de: 80 93 72 00 sts 0x0072, r24 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 2a2e2: 4f bf out 0x3f, r20 ; 63 WRITE(BEEPER, HIGH); _delay(ms); WRITE(BEEPER, LOW); } else { _tone(BEEPER, tone_); _delay(ms); 2a2e4: c7 01 movw r24, r14 2a2e6: b6 01 movw r22, r12 2a2e8: 0f 94 29 27 call 0x24e52 ; 0x24e52 } void noTone4(_UNUSED uint8_t _pin) { CRITICAL_SECTION_START; 2a2ec: 2f b7 in r18, 0x3f ; 63 2a2ee: f8 94 cli // Revert prescaler to CLK/1024 TCCR4B = (TCCR4B & 0b11111000) | _BV(CS42) | _BV(CS40); 2a2f0: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 2a2f4: 88 7f andi r24, 0xF8 ; 248 2a2f6: 85 60 ori r24, 0x05 ; 5 2a2f8: 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); 2a2fc: 40 91 ac 00 lds r20, 0x00AC ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 2a300: 50 91 ad 00 lds r21, 0x00AD ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 2a304: 3f ef ldi r19, 0xFF ; 255 2a306: 34 9f mul r19, r20 2a308: c0 01 movw r24, r0 2a30a: 35 9f mul r19, r21 2a30c: 90 0d add r25, r0 2a30e: 11 24 eor r1, r1 2a310: 30 91 72 00 lds r19, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 2a314: 6f ef ldi r22, 0xFF ; 255 2a316: 70 e0 ldi r23, 0x00 ; 0 2a318: 31 ff sbrs r19, 1 2a31a: 04 c0 rjmp .+8 ; 0x2a324 2a31c: 60 91 a8 00 lds r22, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 2a320: 70 91 a9 00 lds r23, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 2a324: 0f 94 a0 dc call 0x3b940 ; 0x3b940 <__udivmodhi4> 2a328: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 2a32c: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> #endif //EXTRUDER_0_AUTO_FAN_PIN OCR4A = 255U; 2a330: 8f ef ldi r24, 0xFF ; 255 2a332: 90 e0 ldi r25, 0x00 ; 0 2a334: 90 93 a9 00 sts 0x00A9, r25 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 2a338: 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)); 2a33c: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 2a340: 8c 7f andi r24, 0xFC ; 252 2a342: 80 93 72 00 sts 0x0072, r24 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 2a346: 2f bf out 0x3f, r18 ; 63 2a348: 78 cf rjmp .-272 ; 0x2a23a 0002a34a : /// 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() { 2a34a: cf 93 push r28 #if BEEPER > 0 if (eSoundMode == e_SOUND_MODE_SILENT) return; 2a34c: c0 91 dd 04 lds r28, 0x04DD ; 0x8004dd 2a350: c2 30 cpi r28, 0x02 ; 2 2a352: 59 f1 breq .+86 ; 0x2a3aa // Handle case where only one beep is needed if (eSoundMode == e_SOUND_MODE_ONCE) { 2a354: c1 30 cpi r28, 0x01 ; 1 2a356: 69 f4 brne .+26 ; 0x2a372 if (bFirst) return; 2a358: 80 91 6d 05 lds r24, 0x056D ; 0x80056d <_ZL6bFirst.lto_priv.495> 2a35c: 81 11 cpse r24, r1 2a35e: 25 c0 rjmp .+74 ; 0x2a3aa Sound_MakeCustom(80, 0, false); 2a360: 40 e0 ldi r20, 0x00 ; 0 2a362: 70 e0 ldi r23, 0x00 ; 0 2a364: 60 e0 ldi r22, 0x00 ; 0 2a366: 80 e5 ldi r24, 0x50 ; 80 2a368: 90 e0 ldi r25, 0x00 ; 0 2a36a: 0f 94 01 51 call 0x2a202 ; 0x2a202 bFirst = true; 2a36e: c0 93 6d 05 sts 0x056D, r28 ; 0x80056d <_ZL6bFirst.lto_priv.495> } // Handle case where there should be continous beeps if (beep_timer.expired_cont(CONTINOUS_BEEP_PERIOD)) { 2a372: 60 ed ldi r22, 0xD0 ; 208 2a374: 77 e0 ldi r23, 0x07 ; 7 2a376: 8a e6 ldi r24, 0x6A ; 106 2a378: 95 e0 ldi r25, 0x05 ; 5 2a37a: 0f 94 7c 29 call 0x252f8 ; 0x252f8 ::expired_cont(unsigned short)> 2a37e: 88 23 and r24, r24 2a380: a1 f0 breq .+40 ; 0x2a3aa beep_timer.start(); 2a382: 8a e6 ldi r24, 0x6A ; 106 2a384: 95 e0 ldi r25, 0x05 ; 5 2a386: 0f 94 83 29 call 0x25306 ; 0x25306 ::start()> if (eSoundMode == e_SOUND_MODE_LOUD) { 2a38a: 80 91 dd 04 lds r24, 0x04DD ; 0x8004dd 2a38e: 81 11 cpse r24, r1 2a390: 08 c0 rjmp .+16 ; 0x2a3a2 Sound_MakeCustom(80, 0, false); 2a392: 40 e0 ldi r20, 0x00 ; 0 2a394: 70 e0 ldi r23, 0x00 ; 0 2a396: 60 e0 ldi r22, 0x00 ; 0 2a398: 80 e5 ldi r24, 0x50 ; 80 2a39a: 90 e0 ldi r25, 0x00 ; 0 // Assist (lower volume sound) Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); } } #endif // BEEPER > 0 } 2a39c: 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); 2a39e: 0d 94 01 51 jmp 0x2a202 ; 0x2a202 } else { // Assist (lower volume sound) Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 2a3a2: 80 e0 ldi r24, 0x00 ; 0 } } #endif // BEEPER > 0 } 2a3a4: 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); 2a3a6: 0d 94 c2 4d jmp 0x29b84 ; 0x29b84 } } #endif // BEEPER > 0 } 2a3aa: cf 91 pop r28 2a3ac: 08 95 ret 0002a3ae : sm4_calc_delay_cb_t sm4_calc_delay_cb = 0; void sm4_set_dir(uint8_t axis, uint8_t dir) { switch (axis) 2a3ae: 82 30 cpi r24, 0x02 ; 2 2a3b0: b9 f0 breq .+46 ; 0x2a3e0 2a3b2: 83 30 cpi r24, 0x03 ; 3 2a3b4: e9 f0 breq .+58 ; 0x2a3f0 2a3b6: 81 30 cpi r24, 0x01 ; 1 2a3b8: 59 f0 breq .+22 ; 0x2a3d0 case 0: if (dir == INVERT_X_DIR) PORTL |= 2; else PORTL &= ~2; break; 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; #elif ((MOTHERBOARD == BOARD_EINSY_1_0a)) case 0: if (dir == INVERT_X_DIR) PORTL |= 1; else PORTL &= ~1; break; 2a3ba: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2a3be: 61 30 cpi r22, 0x01 ; 1 2a3c0: 29 f4 brne .+10 ; 0x2a3cc 2a3c2: 81 60 ori r24, 0x01 ; 1 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; 2a3c4: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> #endif } asm("nop"); 2a3c8: 00 00 nop } 2a3ca: 08 95 ret case 0: if (dir == INVERT_X_DIR) PORTL |= 2; else PORTL &= ~2; break; 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; #elif ((MOTHERBOARD == BOARD_EINSY_1_0a)) case 0: if (dir == INVERT_X_DIR) PORTL |= 1; else PORTL &= ~1; break; 2a3cc: 8e 7f andi r24, 0xFE ; 254 2a3ce: fa cf rjmp .-12 ; 0x2a3c4 case 1: if (dir == INVERT_Y_DIR) PORTL |= 2; else PORTL &= ~2; break; 2a3d0: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2a3d4: 61 11 cpse r22, r1 2a3d6: 02 c0 rjmp .+4 ; 0x2a3dc 2a3d8: 82 60 ori r24, 0x02 ; 2 2a3da: f4 cf rjmp .-24 ; 0x2a3c4 2a3dc: 8d 7f andi r24, 0xFD ; 253 2a3de: f2 cf rjmp .-28 ; 0x2a3c4 case 2: if (dir == INVERT_Z_DIR) PORTL |= 4; else PORTL &= ~4; break; 2a3e0: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2a3e4: 61 30 cpi r22, 0x01 ; 1 2a3e6: 11 f4 brne .+4 ; 0x2a3ec 2a3e8: 84 60 ori r24, 0x04 ; 4 2a3ea: ec cf rjmp .-40 ; 0x2a3c4 2a3ec: 8b 7f andi r24, 0xFB ; 251 2a3ee: ea cf rjmp .-44 ; 0x2a3c4 case 3: if (dir == INVERT_E0_DIR) PORTL |= 64; else PORTL &= ~64; break; 2a3f0: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2a3f4: 61 11 cpse r22, r1 2a3f6: 02 c0 rjmp .+4 ; 0x2a3fc 2a3f8: 80 64 ori r24, 0x40 ; 64 2a3fa: e4 cf rjmp .-56 ; 0x2a3c4 2a3fc: 8f 7b andi r24, 0xBF ; 191 2a3fe: e2 cf rjmp .-60 ; 0x2a3c4 0002a400 : buf[nbyte] = SPDR; } //------------------------------------------------------------------------------ /** SPI send a byte */ static void spiSend(uint8_t b) { SPDR = b; 2a400: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2a402: 0d b4 in r0, 0x2d ; 45 2a404: 07 fe sbrs r0, 7 2a406: fd cf rjmp .-6 ; 0x2a402 } 2a408: 08 95 ret 0002a40a : SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; } //------------------------------------------------------------------------------ /** SPI receive a byte */ static uint8_t spiRec() { SPDR = 0XFF; 2a40a: 8f ef ldi r24, 0xFF ; 255 2a40c: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2a40e: 0d b4 in r0, 0x2d ; 45 2a410: 07 fe sbrs r0, 7 2a412: fd cf rjmp .-6 ; 0x2a40e return SPDR; 2a414: 8e b5 in r24, 0x2e ; 46 } 2a416: 08 95 ret 0002a418 : } } #endif // SOFTWARE_SPI //------------------------------------------------------------------------------ // send command and return error code. Return zero for OK uint8_t Sd2Card::cardCommand(uint8_t cmd, uint32_t arg) { 2a418: 8f 92 push r8 2a41a: 9f 92 push r9 2a41c: af 92 push r10 2a41e: bf 92 push r11 2a420: ef 92 push r14 2a422: ff 92 push r15 2a424: 0f 93 push r16 2a426: 1f 93 push r17 2a428: cf 93 push r28 2a42a: 7c 01 movw r14, r24 2a42c: c6 2f mov r28, r22 2a42e: 49 01 movw r8, r18 2a430: 5a 01 movw r10, r20 WRITE(SDSS, 1); } //------------------------------------------------------------------------------ void Sd2Card::chipSelectLow() { #ifndef SOFTWARE_SPI spiInit(spiRate_); 2a432: fc 01 movw r30, r24 2a434: 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); 2a436: 89 2f mov r24, r25 2a438: 80 6a ori r24, 0xA0 ; 160 2a43a: 86 95 lsr r24 2a43c: 8c bd out 0x2c, r24 ; 44 SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; 2a43e: 90 fd sbrc r25, 0 2a440: 03 c0 rjmp .+6 ; 0x2a448 2a442: 81 e0 ldi r24, 0x01 ; 1 2a444: 96 30 cpi r25, 0x06 ; 6 2a446: 09 f4 brne .+2 ; 0x2a44a 2a448: 80 e0 ldi r24, 0x00 ; 0 2a44a: 8d bd out 0x2d, r24 ; 45 //------------------------------------------------------------------------------ void Sd2Card::chipSelectLow() { #ifndef SOFTWARE_SPI spiInit(spiRate_); #endif // SOFTWARE_SPI WRITE(SDSS, 0); 2a44c: 9f b7 in r25, 0x3f ; 63 2a44e: f8 94 cli 2a450: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 2a454: 8f 7b andi r24, 0xBF ; 191 2a456: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 2a45a: 9f bf out 0x3f, r25 ; 63 uint8_t Sd2Card::cardCommand(uint8_t cmd, uint32_t arg) { // select card chipSelectLow(); // wait up to 300 ms if busy waitNotBusy(300); 2a45c: 8c e2 ldi r24, 0x2C ; 44 2a45e: 91 e0 ldi r25, 0x01 ; 1 2a460: 0f 94 83 74 call 0x2e906 ; 0x2e906 // send command spiSend(cmd | 0x40); 2a464: 8c 2f mov r24, r28 2a466: 80 64 ori r24, 0x40 ; 64 2a468: 0f 94 00 52 call 0x2a400 ; 0x2a400 2a46c: 08 e1 ldi r16, 0x18 ; 24 2a46e: 10 e0 ldi r17, 0x00 ; 0 // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); 2a470: d5 01 movw r26, r10 2a472: c4 01 movw r24, r8 2a474: 00 2e mov r0, r16 2a476: 04 c0 rjmp .+8 ; 0x2a480 2a478: b6 95 lsr r27 2a47a: a7 95 ror r26 2a47c: 97 95 ror r25 2a47e: 87 95 ror r24 2a480: 0a 94 dec r0 2a482: d2 f7 brpl .-12 ; 0x2a478 2a484: 0f 94 00 52 call 0x2a400 ; 0x2a400 2a488: 08 50 subi r16, 0x08 ; 8 2a48a: 11 09 sbc r17, r1 2a48c: 08 3f cpi r16, 0xF8 ; 248 2a48e: ff ef ldi r31, 0xFF ; 255 2a490: 1f 07 cpc r17, r31 2a492: 71 f7 brne .-36 ; 0x2a470 // send CRC uint8_t crc = 0XFF; if (cmd == CMD0) crc = 0X95; // correct crc for CMD0 with arg 0 2a494: 85 e9 ldi r24, 0x95 ; 149 2a496: cc 23 and r28, r28 2a498: 21 f0 breq .+8 ; 0x2a4a2 if (cmd == CMD8) crc = 0X87; // correct crc for CMD8 with arg 0X1AA 2a49a: 87 e8 ldi r24, 0x87 ; 135 2a49c: c8 30 cpi r28, 0x08 ; 8 2a49e: 09 f0 breq .+2 ; 0x2a4a2 // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); // send CRC uint8_t crc = 0XFF; 2a4a0: 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); 2a4a2: 0f 94 00 52 call 0x2a400 ; 0x2a400 // skip stuff byte for stop read if (cmd == CMD12) spiRec(); 2a4a6: cc 30 cpi r28, 0x0C ; 12 2a4a8: 11 f4 brne .+4 ; 0x2a4ae 2a4aa: 0f 94 05 52 call 0x2a40a ; 0x2a40a // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); // send CRC uint8_t crc = 0XFF; 2a4ae: 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 */ } 2a4b0: 0f 94 05 52 call 0x2a40a ; 0x2a40a 2a4b4: f7 01 movw r30, r14 2a4b6: 82 83 std Z+2, r24 ; 0x02 2a4b8: 87 ff sbrs r24, 7 2a4ba: 04 c0 rjmp .+8 ; 0x2a4c4 2a4bc: cf 3f cpi r28, 0xFF ; 255 2a4be: 11 f0 breq .+4 ; 0x2a4c4 2a4c0: cf 5f subi r28, 0xFF ; 255 2a4c2: f6 cf rjmp .-20 ; 0x2a4b0 return status_; } 2a4c4: cf 91 pop r28 2a4c6: 1f 91 pop r17 2a4c8: 0f 91 pop r16 2a4ca: ff 90 pop r15 2a4cc: ef 90 pop r14 2a4ce: bf 90 pop r11 2a4d0: af 90 pop r10 2a4d2: 9f 90 pop r9 2a4d4: 8f 90 pop r8 2a4d6: 08 95 ret 0002a4d8 : * \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) { 2a4d8: 0f 93 push r16 2a4da: 1f 93 push r17 2a4dc: cf 93 push r28 2a4de: df 93 push r29 2a4e0: ec 01 movw r28, r24 2a4e2: 89 01 movw r16, r18 // use address if not SDHC card if (type() != SD_CARD_TYPE_SDHC) blockNumber <<= 9; 2a4e4: 8b 81 ldd r24, Y+3 ; 0x03 2a4e6: 83 30 cpi r24, 0x03 ; 3 2a4e8: 39 f0 breq .+14 ; 0x2a4f8 2a4ea: 89 e0 ldi r24, 0x09 ; 9 2a4ec: 44 0f add r20, r20 2a4ee: 55 1f adc r21, r21 2a4f0: 66 1f adc r22, r22 2a4f2: 77 1f adc r23, r23 2a4f4: 8a 95 dec r24 2a4f6: d1 f7 brne .-12 ; 0x2a4ec if (cardCommand(CMD24, blockNumber)) { 2a4f8: 9a 01 movw r18, r20 2a4fa: ab 01 movw r20, r22 2a4fc: 68 e1 ldi r22, 0x18 ; 24 2a4fe: ce 01 movw r24, r28 2a500: 0f 94 0c 52 call 0x2a418 ; 0x2a418 2a504: 88 23 and r24, r24 2a506: 19 f0 breq .+6 ; 0x2a50e bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 2a508: 86 e0 ldi r24, 0x06 ; 6 2a50a: 88 83 st Y, r24 2a50c: 39 c0 rjmp .+114 ; 0x2a580 } //------------------------------------------------------------------------------ /** 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; 2a50e: 8e ef ldi r24, 0xFE ; 254 2a510: 8e bd out 0x2e, r24 ; 46 2a512: f8 01 movw r30, r16 2a514: c8 01 movw r24, r16 2a516: 9e 5f subi r25, 0xFE ; 254 for (uint16_t i = 0; i < 512; i += 2) { while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2a518: 0d b4 in r0, 0x2d ; 45 2a51a: 07 fe sbrs r0, 7 2a51c: fd cf rjmp .-6 ; 0x2a518 SPDR = buf[i]; 2a51e: 20 81 ld r18, Z 2a520: 2e bd out 0x2e, r18 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2a522: 0d b4 in r0, 0x2d ; 45 2a524: 07 fe sbrs r0, 7 2a526: fd cf rjmp .-6 ; 0x2a522 SPDR = buf[i + 1]; 2a528: 21 81 ldd r18, Z+1 ; 0x01 2a52a: 2e bd out 0x2e, r18 ; 46 2a52c: 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) { 2a52e: e8 17 cp r30, r24 2a530: f9 07 cpc r31, r25 2a532: 91 f7 brne .-28 ; 0x2a518 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 */ } 2a534: 0d b4 in r0, 0x2d ; 45 2a536: 07 fe sbrs r0, 7 2a538: fd cf rjmp .-6 ; 0x2a534 //------------------------------------------------------------------------------ // 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 2a53a: 8f ef ldi r24, 0xFF ; 255 2a53c: 0f 94 00 52 call 0x2a400 ; 0x2a400 spiSend(0xff); // dummy crc 2a540: 8f ef ldi r24, 0xFF ; 255 2a542: 0f 94 00 52 call 0x2a400 ; 0x2a400 status_ = spiRec(); 2a546: 0f 94 05 52 call 0x2a40a ; 0x2a40a 2a54a: 8a 83 std Y+2, r24 ; 0x02 if ((status_ & DATA_RES_MASK) != DATA_RES_ACCEPTED) { 2a54c: 8f 71 andi r24, 0x1F ; 31 2a54e: 85 30 cpi r24, 0x05 ; 5 2a550: 99 f4 brne .+38 ; 0x2a578 goto fail; } if (!writeData(DATA_START_BLOCK, src)) goto fail; // wait for flash programming to complete if (!waitNotBusy(SD_WRITE_TIMEOUT)) { 2a552: 88 e5 ldi r24, 0x58 ; 88 2a554: 92 e0 ldi r25, 0x02 ; 2 2a556: 0f 94 83 74 call 0x2e906 ; 0x2e906 2a55a: 18 2f mov r17, r24 2a55c: 87 e1 ldi r24, 0x17 ; 23 2a55e: 11 23 and r17, r17 2a560: a1 f2 breq .-88 ; 0x2a50a error(SD_CARD_ERROR_WRITE_TIMEOUT); goto fail; } // response is r2 so get and check two bytes for nonzero if (cardCommand(CMD13, 0) || spiRec()) { 2a562: 20 e0 ldi r18, 0x00 ; 0 2a564: 30 e0 ldi r19, 0x00 ; 0 2a566: a9 01 movw r20, r18 2a568: 6d e0 ldi r22, 0x0D ; 13 2a56a: ce 01 movw r24, r28 2a56c: 0f 94 0c 52 call 0x2a418 ; 0x2a418 2a570: 88 23 and r24, r24 2a572: 51 f0 breq .+20 ; 0x2a588 2a574: 86 e1 ldi r24, 0x16 ; 22 2a576: c9 cf rjmp .-110 ; 0x2a50a 2a578: 83 e1 ldi r24, 0x13 ; 19 2a57a: 88 83 st Y, r24 goto fail; } return true; fail: chipSelectHigh(); 2a57c: 0f 94 7a 74 call 0x2e8f4 ; 0x2e8f4 } chipSelectHigh(); return true; fail: chipSelectHigh(); 2a580: 0f 94 7a 74 call 0x2e8f4 ; 0x2e8f4 return false; 2a584: 10 e0 ldi r17, 0x00 ; 0 2a586: 06 c0 rjmp .+12 ; 0x2a594 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()) { 2a588: 0f 94 05 52 call 0x2a40a ; 0x2a40a 2a58c: 81 11 cpse r24, r1 2a58e: f2 cf rjmp .-28 ; 0x2a574 error(SD_CARD_ERROR_WRITE_PROGRAMMING); goto fail; } chipSelectHigh(); 2a590: 0f 94 7a 74 call 0x2e8f4 ; 0x2e8f4 return true; fail: chipSelectHigh(); return false; } 2a594: 81 2f mov r24, r17 2a596: df 91 pop r29 2a598: cf 91 pop r28 2a59a: 1f 91 pop r17 2a59c: 0f 91 pop r16 2a59e: 08 95 ret 0002a5a0 : fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheFlush() { 2a5a0: cf 93 push r28 if (cacheDirty_) { 2a5a2: 80 91 98 0e lds r24, 0x0E98 ; 0x800e98 } cacheMirrorBlock_ = 0; } cacheDirty_ = 0; } return true; 2a5a6: c1 e0 ldi r28, 0x01 ; 1 fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheFlush() { if (cacheDirty_) { 2a5a8: 88 23 and r24, r24 2a5aa: a1 f0 breq .+40 ; 0x2a5d4 if (!sdCard_->writeBlock(cacheBlockNumber_, cacheBuffer_.data)) { 2a5ac: 40 91 90 0e lds r20, 0x0E90 ; 0x800e90 2a5b0: 50 91 91 0e lds r21, 0x0E91 ; 0x800e91 2a5b4: 60 91 92 0e lds r22, 0x0E92 ; 0x800e92 2a5b8: 70 91 93 0e lds r23, 0x0E93 ; 0x800e93 2a5bc: 2c e9 ldi r18, 0x9C ; 156 2a5be: 3e e0 ldi r19, 0x0E ; 14 2a5c0: 80 91 99 0e lds r24, 0x0E99 ; 0x800e99 2a5c4: 90 91 9a 0e lds r25, 0x0E9A ; 0x800e9a 2a5c8: 0f 94 6c 52 call 0x2a4d8 ; 0x2a4d8 2a5cc: c8 2f mov r28, r24 2a5ce: 81 11 cpse r24, r1 2a5d0: 04 c0 rjmp .+8 ; 0x2a5da cacheDirty_ = 0; } return true; fail: return false; 2a5d2: c0 e0 ldi r28, 0x00 ; 0 } 2a5d4: 8c 2f mov r24, r28 2a5d6: cf 91 pop r28 2a5d8: 08 95 ret if (cacheDirty_) { if (!sdCard_->writeBlock(cacheBlockNumber_, cacheBuffer_.data)) { goto fail; } // mirror FAT tables if (cacheMirrorBlock_) { 2a5da: 40 91 94 0e lds r20, 0x0E94 ; 0x800e94 2a5de: 50 91 95 0e lds r21, 0x0E95 ; 0x800e95 2a5e2: 60 91 96 0e lds r22, 0x0E96 ; 0x800e96 2a5e6: 70 91 97 0e lds r23, 0x0E97 ; 0x800e97 2a5ea: 41 15 cp r20, r1 2a5ec: 51 05 cpc r21, r1 2a5ee: 61 05 cpc r22, r1 2a5f0: 71 05 cpc r23, r1 2a5f2: 91 f0 breq .+36 ; 0x2a618 if (!sdCard_->writeBlock(cacheMirrorBlock_, cacheBuffer_.data)) { 2a5f4: 2c e9 ldi r18, 0x9C ; 156 2a5f6: 3e e0 ldi r19, 0x0E ; 14 2a5f8: 80 91 99 0e lds r24, 0x0E99 ; 0x800e99 2a5fc: 90 91 9a 0e lds r25, 0x0E9A ; 0x800e9a 2a600: 0f 94 6c 52 call 0x2a4d8 ; 0x2a4d8 2a604: 88 23 and r24, r24 2a606: 29 f3 breq .-54 ; 0x2a5d2 goto fail; } cacheMirrorBlock_ = 0; 2a608: 10 92 94 0e sts 0x0E94, r1 ; 0x800e94 2a60c: 10 92 95 0e sts 0x0E95, r1 ; 0x800e95 2a610: 10 92 96 0e sts 0x0E96, r1 ; 0x800e96 2a614: 10 92 97 0e sts 0x0E97, r1 ; 0x800e97 } cacheDirty_ = 0; 2a618: 10 92 98 0e sts 0x0E98, r1 ; 0x800e98 2a61c: db cf rjmp .-74 ; 0x2a5d4 0002a61e : * \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) { 2a61e: 2f 92 push r2 2a620: 3f 92 push r3 2a622: 4f 92 push r4 2a624: 5f 92 push r5 2a626: 6f 92 push r6 2a628: 7f 92 push r7 2a62a: 8f 92 push r8 2a62c: 9f 92 push r9 2a62e: af 92 push r10 2a630: bf 92 push r11 2a632: cf 92 push r12 2a634: df 92 push r13 2a636: ef 92 push r14 2a638: ff 92 push r15 2a63a: 0f 93 push r16 2a63c: 1f 93 push r17 2a63e: cf 93 push r28 2a640: df 93 push r29 2a642: ec 01 movw r28, r24 2a644: 2a 01 movw r4, r20 2a646: 3b 01 movw r6, r22 2a648: 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; 2a64a: 8b 81 ldd r24, Y+3 ; 0x03 2a64c: 83 30 cpi r24, 0x03 ; 3 2a64e: 39 f0 breq .+14 ; 0x2a65e 2a650: 69 e0 ldi r22, 0x09 ; 9 2a652: 44 0c add r4, r4 2a654: 55 1c adc r5, r5 2a656: 66 1c adc r6, r6 2a658: 77 1c adc r7, r7 2a65a: 6a 95 dec r22 2a65c: d1 f7 brne .-12 ; 0x2a652 retry2: 2a65e: 43 e0 ldi r20, 0x03 ; 3 2a660: 94 2e mov r9, r20 2a662: 56 01 movw r10, r12 2a664: 81 e0 ldi r24, 0x01 ; 1 2a666: a8 1a sub r10, r24 2a668: 8e ef ldi r24, 0xFE ; 254 2a66a: b8 0a sbc r11, r24 2a66c: 16 01 movw r2, r12 2a66e: ee ef ldi r30, 0xFE ; 254 2a670: 3e 1a sub r3, r30 2a672: 54 e0 ldi r21, 0x04 ; 4 2a674: 85 2e mov r8, r21 retryCnt --; 2a676: 9a 94 dec r9 if (cardCommand(CMD17, blockNumber)) { 2a678: a3 01 movw r20, r6 2a67a: 92 01 movw r18, r4 2a67c: 61 e1 ldi r22, 0x11 ; 17 2a67e: ce 01 movw r24, r28 2a680: 0f 94 0c 52 call 0x2a418 ; 0x2a418 2a684: 88 23 and r24, r24 2a686: 79 f0 breq .+30 ; 0x2a6a6 2a688: 88 82 st Y, r8 error(SD_CARD_ERROR_CMD17); if (retryCnt > 0) goto retry; 2a68a: 99 20 and r9, r9 2a68c: 09 f4 brne .+2 ; 0x2a690 2a68e: 7a c0 rjmp .+244 ; 0x2a784 if (retryCnt > 0) goto retry; goto fail; } return true; retry: chipSelectHigh(); 2a690: 0f 94 7a 74 call 0x2e8f4 ; 0x2e8f4 cardCommand(CMD12, 0);//Try sending a stop command, but ignore the result. 2a694: 20 e0 ldi r18, 0x00 ; 0 2a696: 30 e0 ldi r19, 0x00 ; 0 2a698: a9 01 movw r20, r18 2a69a: 6c e0 ldi r22, 0x0C ; 12 2a69c: ce 01 movw r24, r28 2a69e: 0f 94 0c 52 call 0x2a418 ; 0x2a418 errorCode_ = 0; 2a6a2: 18 82 st Y, r1 2a6a4: e8 cf rjmp .-48 ; 0x2a676 #endif //------------------------------------------------------------------------------ bool Sd2Card::readData(uint8_t* dst, uint16_t count) { // wait for start block token uint16_t t0 = _millis(); 2a6a6: 0f 94 22 29 call 0x25244 ; 0x25244 2a6aa: 8b 01 movw r16, r22 while ((status_ = spiRec()) == 0XFF) { 2a6ac: 0f 94 05 52 call 0x2a40a ; 0x2a40a 2a6b0: 8a 83 std Y+2, r24 ; 0x02 2a6b2: 8f 3f cpi r24, 0xFF ; 255 2a6b4: 91 f4 brne .+36 ; 0x2a6da if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { 2a6b6: 0f 94 22 29 call 0x25244 ; 0x25244 2a6ba: 60 1b sub r22, r16 2a6bc: 71 0b sbc r23, r17 2a6be: 6d 32 cpi r22, 0x2D ; 45 2a6c0: 71 40 sbci r23, 0x01 ; 1 2a6c2: a0 f3 brcs .-24 ; 0x2a6ac 2a6c4: 81 e1 ldi r24, 0x11 ; 17 2a6c6: 88 83 st Y, r24 if (flash_air_compatible_) spiSend(0XFF); return true; fail: chipSelectHigh(); 2a6c8: 0f 94 7a 74 call 0x2e8f4 ; 0x2e8f4 // Toshiba FlashAir Patch. Purge pending status byte. if (flash_air_compatible_) 2a6cc: 8c 81 ldd r24, Y+4 ; 0x04 2a6ce: 88 23 and r24, r24 2a6d0: e1 f2 breq .-72 ; 0x2a68a spiSend(0XFF); 2a6d2: 8f ef ldi r24, 0xFF ; 255 2a6d4: 0f 94 00 52 call 0x2a400 ; 0x2a400 2a6d8: d8 cf rjmp .-80 ; 0x2a68a if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { error(SD_CARD_ERROR_READ_TIMEOUT); goto fail; } } if (status_ != DATA_START_BLOCK) { 2a6da: 8e 3f cpi r24, 0xFE ; 254 2a6dc: 11 f0 breq .+4 ; 0x2a6e2 2a6de: 8f e0 ldi r24, 0x0F ; 15 2a6e0: f2 cf rjmp .-28 ; 0x2a6c6 //------------------------------------------------------------------------------ /** 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; 2a6e2: 8f ef ldi r24, 0xFF ; 255 2a6e4: 8e bd out 0x2e, r24 ; 46 2a6e6: d6 01 movw r26, r12 2a6e8: f6 01 movw r30, r12 for (uint16_t i = 0; i < nbyte; i++) { while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2a6ea: 0d b4 in r0, 0x2d ; 45 2a6ec: 07 fe sbrs r0, 7 2a6ee: fd cf rjmp .-6 ; 0x2a6ea buf[i] = SPDR; 2a6f0: 9e b5 in r25, 0x2e ; 46 2a6f2: 91 93 st Z+, r25 SPDR = 0XFF; 2a6f4: 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++) { 2a6f6: ea 15 cp r30, r10 2a6f8: fb 05 cpc r31, r11 2a6fa: b9 f7 brne .-18 ; 0x2a6ea while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } buf[i] = SPDR; SPDR = 0XFF; } while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2a6fc: 0d b4 in r0, 0x2d ; 45 2a6fe: 07 fe sbrs r0, 7 2a700: fd cf rjmp .-6 ; 0x2a6fc buf[nbyte] = SPDR; 2a702: 8e b5 in r24, 0x2e ; 46 2a704: f5 01 movw r30, r10 2a706: 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; 2a708: f1 2c mov r15, r1 2a70a: 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); 2a70c: 8d 91 ld r24, X+ 2a70e: ef 2d mov r30, r15 2a710: ff 27 eor r31, r31 2a712: e8 27 eor r30, r24 2a714: ee 0f add r30, r30 2a716: ff 1f adc r31, r31 2a718: eb 57 subi r30, 0x7B ; 123 2a71a: ff 46 sbci r31, 0x6F ; 111 2a71c: 85 91 lpm r24, Z+ 2a71e: 94 91 lpm r25, Z 2a720: fe 2c mov r15, r14 2a722: ee 24 eor r14, r14 2a724: e8 26 eor r14, r24 2a726: 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++) { 2a728: 2a 16 cp r2, r26 2a72a: 3b 06 cpc r3, r27 2a72c: 79 f7 brne .-34 ; 0x2a70c spiRead(dst, count); #ifdef SD_CHECK_AND_RETRY { uint16_t calcCrc = CRC_CCITT(dst, count); uint16_t recvCrc = spiRec() << 8; 2a72e: 0f 94 05 52 call 0x2a40a ; 0x2a40a 2a732: 08 2f mov r16, r24 2a734: 10 e0 ldi r17, 0x00 ; 0 2a736: 10 2f mov r17, r16 2a738: 00 27 eor r16, r16 recvCrc |= spiRec(); 2a73a: 0f 94 05 52 call 0x2a40a ; 0x2a40a 2a73e: 08 2b or r16, r24 if (calcCrc != recvCrc) 2a740: 0e 15 cp r16, r14 2a742: 1f 05 cpc r17, r15 2a744: 19 f0 breq .+6 ; 0x2a74c 2a746: f0 e2 ldi r31, 0x20 ; 32 2a748: f8 83 st Y, r31 2a74a: be cf rjmp .-132 ; 0x2a6c8 #else // discard CRC spiRec(); spiRec(); #endif chipSelectHigh(); 2a74c: 0f 94 7a 74 call 0x2e8f4 ; 0x2e8f4 // Toshiba FlashAir Patch. Purge pending status byte. if (flash_air_compatible_) 2a750: cc 81 ldd r28, Y+4 ; 0x04 2a752: cc 23 and r28, r28 2a754: d9 f0 breq .+54 ; 0x2a78c spiSend(0XFF); 2a756: 8f ef ldi r24, 0xFF ; 255 2a758: 0f 94 00 52 call 0x2a400 ; 0x2a400 #endif fail: chipSelectHigh(); return false; } 2a75c: 8c 2f mov r24, r28 2a75e: df 91 pop r29 2a760: cf 91 pop r28 2a762: 1f 91 pop r17 2a764: 0f 91 pop r16 2a766: ff 90 pop r15 2a768: ef 90 pop r14 2a76a: df 90 pop r13 2a76c: cf 90 pop r12 2a76e: bf 90 pop r11 2a770: af 90 pop r10 2a772: 9f 90 pop r9 2a774: 8f 90 pop r8 2a776: 7f 90 pop r7 2a778: 6f 90 pop r6 2a77a: 5f 90 pop r5 2a77c: 4f 90 pop r4 2a77e: 3f 90 pop r3 2a780: 2f 90 pop r2 2a782: 08 95 ret } return readData(dst, 512); #endif fail: chipSelectHigh(); 2a784: 0f 94 7a 74 call 0x2e8f4 ; 0x2e8f4 return false; 2a788: c0 e0 ldi r28, 0x00 ; 0 2a78a: e8 cf rjmp .-48 ; 0x2a75c if (!readData(dst, 512)) { if (retryCnt > 0) goto retry; goto fail; } return true; 2a78c: c1 e0 ldi r28, 0x01 ; 1 2a78e: e6 cf rjmp .-52 ; 0x2a75c 0002a790 : fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheRawBlock(uint32_t blockNumber, bool dirty) { 2a790: cf 92 push r12 2a792: df 92 push r13 2a794: ef 92 push r14 2a796: ff 92 push r15 2a798: cf 93 push r28 2a79a: 6b 01 movw r12, r22 2a79c: 7c 01 movw r14, r24 2a79e: c4 2f mov r28, r20 if (cacheBlockNumber_ != blockNumber) { 2a7a0: 80 91 90 0e lds r24, 0x0E90 ; 0x800e90 2a7a4: 90 91 91 0e lds r25, 0x0E91 ; 0x800e91 2a7a8: a0 91 92 0e lds r26, 0x0E92 ; 0x800e92 2a7ac: b0 91 93 0e lds r27, 0x0E93 ; 0x800e93 2a7b0: 8c 15 cp r24, r12 2a7b2: 9d 05 cpc r25, r13 2a7b4: ae 05 cpc r26, r14 2a7b6: bf 05 cpc r27, r15 2a7b8: 01 f1 breq .+64 ; 0x2a7fa if (!cacheFlush()) goto fail; 2a7ba: 0f 94 d0 52 call 0x2a5a0 ; 0x2a5a0 2a7be: 81 11 cpse r24, r1 2a7c0: 08 c0 rjmp .+16 ; 0x2a7d2 } if (dirty) cacheDirty_ = true; return true; fail: return false; 2a7c2: c0 e0 ldi r28, 0x00 ; 0 } 2a7c4: 8c 2f mov r24, r28 2a7c6: cf 91 pop r28 2a7c8: ff 90 pop r15 2a7ca: ef 90 pop r14 2a7cc: df 90 pop r13 2a7ce: cf 90 pop r12 2a7d0: 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; 2a7d2: 2c e9 ldi r18, 0x9C ; 156 2a7d4: 3e e0 ldi r19, 0x0E ; 14 2a7d6: b7 01 movw r22, r14 2a7d8: a6 01 movw r20, r12 2a7da: 80 91 99 0e lds r24, 0x0E99 ; 0x800e99 2a7de: 90 91 9a 0e lds r25, 0x0E9A ; 0x800e9a 2a7e2: 0f 94 0f 53 call 0x2a61e ; 0x2a61e 2a7e6: 88 23 and r24, r24 2a7e8: 61 f3 breq .-40 ; 0x2a7c2 cacheBlockNumber_ = blockNumber; 2a7ea: c0 92 90 0e sts 0x0E90, r12 ; 0x800e90 2a7ee: d0 92 91 0e sts 0x0E91, r13 ; 0x800e91 2a7f2: e0 92 92 0e sts 0x0E92, r14 ; 0x800e92 2a7f6: f0 92 93 0e sts 0x0E93, r15 ; 0x800e93 } if (dirty) cacheDirty_ = true; 2a7fa: cc 23 and r28, r28 2a7fc: 21 f0 breq .+8 ; 0x2a806 2a7fe: 81 e0 ldi r24, 0x01 ; 1 2a800: 80 93 98 0e sts 0x0E98, r24 ; 0x800e98 2a804: df cf rjmp .-66 ; 0x2a7c4 return true; 2a806: c1 e0 ldi r28, 0x01 ; 1 2a808: dd cf rjmp .-70 ; 0x2a7c4 0002a80a : fail: return false; } //------------------------------------------------------------------------------ // Store a FAT entry bool SdVolume::fatPut(uint32_t cluster, uint32_t value) { 2a80a: 4f 92 push r4 2a80c: 5f 92 push r5 2a80e: 6f 92 push r6 2a810: 7f 92 push r7 2a812: 8f 92 push r8 2a814: 9f 92 push r9 2a816: af 92 push r10 2a818: bf 92 push r11 2a81a: cf 92 push r12 2a81c: df 92 push r13 2a81e: ef 92 push r14 2a820: ff 92 push r15 2a822: 0f 93 push r16 2a824: 1f 93 push r17 2a826: cf 93 push r28 2a828: df 93 push r29 2a82a: ec 01 movw r28, r24 uint32_t lba; // error if reserved cluster if (cluster < 2) goto fail; 2a82c: 42 30 cpi r20, 0x02 ; 2 2a82e: 51 05 cpc r21, r1 2a830: 61 05 cpc r22, r1 2a832: 71 05 cpc r23, r1 2a834: 90 f4 brcc .+36 ; 0x2a85a // mirror second FAT if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_; return true; fail: return false; 2a836: 80 e0 ldi r24, 0x00 ; 0 } 2a838: df 91 pop r29 2a83a: cf 91 pop r28 2a83c: 1f 91 pop r17 2a83e: 0f 91 pop r16 2a840: ff 90 pop r15 2a842: ef 90 pop r14 2a844: df 90 pop r13 2a846: cf 90 pop r12 2a848: bf 90 pop r11 2a84a: af 90 pop r10 2a84c: 9f 90 pop r9 2a84e: 8f 90 pop r8 2a850: 7f 90 pop r7 2a852: 6f 90 pop r6 2a854: 5f 90 pop r5 2a856: 4f 90 pop r4 2a858: 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; 2a85a: 89 85 ldd r24, Y+9 ; 0x09 2a85c: 9a 85 ldd r25, Y+10 ; 0x0a 2a85e: ab 85 ldd r26, Y+11 ; 0x0b 2a860: bc 85 ldd r27, Y+12 ; 0x0c 2a862: 01 96 adiw r24, 0x01 ; 1 2a864: a1 1d adc r26, r1 2a866: b1 1d adc r27, r1 2a868: 84 17 cp r24, r20 2a86a: 95 07 cpc r25, r21 2a86c: a6 07 cpc r26, r22 2a86e: b7 07 cpc r27, r23 2a870: 10 f3 brcs .-60 ; 0x2a836 tmp = ((cacheBuffer_.data[index] & 0XF0)) | tmp >> 4; } cacheBuffer_.data[index] = tmp; return true; } if (fatType_ == 16) { 2a872: 8f 89 ldd r24, Y+23 ; 0x17 2a874: 80 31 cpi r24, 0x10 ; 16 2a876: c9 f5 brne .+114 ; 0x2a8ea lba = fatStartBlock_ + (cluster >> 8); 2a878: 85 2e mov r8, r21 2a87a: 96 2e mov r9, r22 2a87c: a7 2e mov r10, r23 2a87e: bb 24 eor r11, r11 2a880: 8b 89 ldd r24, Y+19 ; 0x13 2a882: 9c 89 ldd r25, Y+20 ; 0x14 2a884: ad 89 ldd r26, Y+21 ; 0x15 2a886: be 89 ldd r27, Y+22 ; 0x16 } else if (fatType_ == 32) { lba = fatStartBlock_ + (cluster >> 7); 2a888: 88 0e add r8, r24 2a88a: 99 1e adc r9, r25 2a88c: aa 1e adc r10, r26 2a88e: bb 1e adc r11, r27 2a890: 28 01 movw r4, r16 2a892: 39 01 movw r6, r18 2a894: 6a 01 movw r12, r20 2a896: 7b 01 movw r14, r22 } else { goto fail; } if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) goto fail; 2a898: 41 e0 ldi r20, 0x01 ; 1 2a89a: c5 01 movw r24, r10 2a89c: b4 01 movw r22, r8 2a89e: 0f 94 c8 53 call 0x2a790 ; 0x2a790 2a8a2: 88 23 and r24, r24 2a8a4: 41 f2 breq .-112 ; 0x2a836 // store entry if (fatType_ == 16) { 2a8a6: 9f 89 ldd r25, Y+23 ; 0x17 2a8a8: 90 31 cpi r25, 0x10 ; 16 2a8aa: 81 f5 brne .+96 ; 0x2a90c cacheBuffer_.fat16[cluster & 0XFF] = value; 2a8ac: dd 24 eor r13, r13 2a8ae: ee 24 eor r14, r14 2a8b0: ff 24 eor r15, r15 2a8b2: f6 01 movw r30, r12 2a8b4: ee 0f add r30, r30 2a8b6: ff 1f adc r31, r31 2a8b8: e4 56 subi r30, 0x64 ; 100 2a8ba: f1 4f sbci r31, 0xF1 ; 241 2a8bc: 11 83 std Z+1, r17 ; 0x01 2a8be: 00 83 st Z, r16 } else { cacheBuffer_.fat32[cluster & 0X7F] = value; } // mirror second FAT if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_; 2a8c0: 9a 89 ldd r25, Y+18 ; 0x12 2a8c2: 92 30 cpi r25, 0x02 ; 2 2a8c4: 08 f4 brcc .+2 ; 0x2a8c8 2a8c6: b8 cf rjmp .-144 ; 0x2a838 2a8c8: 4d 81 ldd r20, Y+5 ; 0x05 2a8ca: 5e 81 ldd r21, Y+6 ; 0x06 2a8cc: 6f 81 ldd r22, Y+7 ; 0x07 2a8ce: 78 85 ldd r23, Y+8 ; 0x08 2a8d0: 84 0e add r8, r20 2a8d2: 95 1e adc r9, r21 2a8d4: a6 1e adc r10, r22 2a8d6: b7 1e adc r11, r23 2a8d8: 80 92 94 0e sts 0x0E94, r8 ; 0x800e94 2a8dc: 90 92 95 0e sts 0x0E95, r9 ; 0x800e95 2a8e0: a0 92 96 0e sts 0x0E96, r10 ; 0x800e96 2a8e4: b0 92 97 0e sts 0x0E97, r11 ; 0x800e97 2a8e8: a7 cf rjmp .-178 ; 0x2a838 cacheBuffer_.data[index] = tmp; return true; } if (fatType_ == 16) { lba = fatStartBlock_ + (cluster >> 8); } else if (fatType_ == 32) { 2a8ea: 80 32 cpi r24, 0x20 ; 32 2a8ec: 09 f0 breq .+2 ; 0x2a8f0 2a8ee: a3 cf rjmp .-186 ; 0x2a836 lba = fatStartBlock_ + (cluster >> 7); 2a8f0: 8b 89 ldd r24, Y+19 ; 0x13 2a8f2: 9c 89 ldd r25, Y+20 ; 0x14 2a8f4: ad 89 ldd r26, Y+21 ; 0x15 2a8f6: be 89 ldd r27, Y+22 ; 0x16 2a8f8: 4a 01 movw r8, r20 2a8fa: 5b 01 movw r10, r22 2a8fc: e7 e0 ldi r30, 0x07 ; 7 2a8fe: b6 94 lsr r11 2a900: a7 94 ror r10 2a902: 97 94 ror r9 2a904: 87 94 ror r8 2a906: ea 95 dec r30 2a908: d1 f7 brne .-12 ; 0x2a8fe 2a90a: be cf rjmp .-132 ; 0x2a888 if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) goto fail; // store entry if (fatType_ == 16) { cacheBuffer_.fat16[cluster & 0XFF] = value; } else { cacheBuffer_.fat32[cluster & 0X7F] = value; 2a90c: e8 94 clt 2a90e: c7 f8 bld r12, 7 2a910: dd 24 eor r13, r13 2a912: ee 24 eor r14, r14 2a914: ff 24 eor r15, r15 2a916: f6 01 movw r30, r12 2a918: ee 0f add r30, r30 2a91a: ff 1f adc r31, r31 2a91c: ee 0f add r30, r30 2a91e: ff 1f adc r31, r31 2a920: e4 56 subi r30, 0x64 ; 100 2a922: f1 4f sbci r31, 0xF1 ; 241 2a924: 40 82 st Z, r4 2a926: 51 82 std Z+1, r5 ; 0x01 2a928: 62 82 std Z+2, r6 ; 0x02 2a92a: 73 82 std Z+3, r7 ; 0x03 2a92c: c9 cf rjmp .-110 ; 0x2a8c0 0002a92e : fail: return false; } //------------------------------------------------------------------------------ // Fetch a FAT entry bool SdVolume::fatGet(uint32_t cluster, uint32_t* value) { 2a92e: cf 92 push r12 2a930: df 92 push r13 2a932: ef 92 push r14 2a934: ff 92 push r15 2a936: 0f 93 push r16 2a938: 1f 93 push r17 2a93a: cf 93 push r28 2a93c: df 93 push r29 2a93e: fc 01 movw r30, r24 uint32_t lba; if (cluster > (clusterCount_ + 1)) goto fail; 2a940: 81 85 ldd r24, Z+9 ; 0x09 2a942: 92 85 ldd r25, Z+10 ; 0x0a 2a944: a3 85 ldd r26, Z+11 ; 0x0b 2a946: b4 85 ldd r27, Z+12 ; 0x0c 2a948: 01 96 adiw r24, 0x01 ; 1 2a94a: a1 1d adc r26, r1 2a94c: b1 1d adc r27, r1 2a94e: 84 17 cp r24, r20 2a950: 95 07 cpc r25, r21 2a952: a6 07 cpc r26, r22 2a954: b7 07 cpc r27, r23 2a956: 50 f4 brcc .+20 ; 0x2a96c *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; } return true; fail: return false; 2a958: 80 e0 ldi r24, 0x00 ; 0 } 2a95a: df 91 pop r29 2a95c: cf 91 pop r28 2a95e: 1f 91 pop r17 2a960: 0f 91 pop r16 2a962: ff 90 pop r15 2a964: ef 90 pop r14 2a966: df 90 pop r13 2a968: cf 90 pop r12 2a96a: 08 95 ret } tmp |= cacheBuffer_.data[index] << 8; *value = cluster & 1 ? tmp >> 4 : tmp & 0XFFF; return true; } if (fatType_ == 16) { 2a96c: 87 89 ldd r24, Z+23 ; 0x17 2a96e: 80 31 cpi r24, 0x10 ; 16 2a970: a9 f5 brne .+106 ; 0x2a9dc lba = fatStartBlock_ + (cluster >> 8); 2a972: bb 27 eor r27, r27 2a974: a7 2f mov r26, r23 2a976: 96 2f mov r25, r22 2a978: 85 2f mov r24, r21 2a97a: c3 88 ldd r12, Z+19 ; 0x13 2a97c: d4 88 ldd r13, Z+20 ; 0x14 2a97e: e5 88 ldd r14, Z+21 ; 0x15 2a980: f6 88 ldd r15, Z+22 ; 0x16 } else if (fatType_ == 32) { lba = fatStartBlock_ + (cluster >> 7); 2a982: 8c 0d add r24, r12 2a984: 9d 1d adc r25, r13 2a986: ae 1d adc r26, r14 2a988: bf 1d adc r27, r15 2a98a: e9 01 movw r28, r18 2a98c: 6a 01 movw r12, r20 2a98e: 7b 01 movw r14, r22 2a990: 8f 01 movw r16, r30 } else { goto fail; } if (lba != cacheBlockNumber_) { 2a992: 40 91 90 0e lds r20, 0x0E90 ; 0x800e90 2a996: 50 91 91 0e lds r21, 0x0E91 ; 0x800e91 2a99a: 60 91 92 0e lds r22, 0x0E92 ; 0x800e92 2a99e: 70 91 93 0e lds r23, 0x0E93 ; 0x800e93 2a9a2: 84 17 cp r24, r20 2a9a4: 95 07 cpc r25, r21 2a9a6: a6 07 cpc r26, r22 2a9a8: b7 07 cpc r27, r23 2a9aa: 49 f5 brne .+82 ; 0x2a9fe if (!cacheRawBlock(lba, CACHE_FOR_READ)) goto fail; } if (fatType_ == 16) { 2a9ac: f8 01 movw r30, r16 2a9ae: 87 89 ldd r24, Z+23 ; 0x17 2a9b0: 80 31 cpi r24, 0x10 ; 16 2a9b2: 69 f5 brne .+90 ; 0x2aa0e *value = cacheBuffer_.fat16[cluster & 0XFF]; 2a9b4: b7 01 movw r22, r14 2a9b6: a6 01 movw r20, r12 2a9b8: 55 27 eor r21, r21 2a9ba: 66 27 eor r22, r22 2a9bc: 77 27 eor r23, r23 2a9be: 44 0f add r20, r20 2a9c0: 55 1f adc r21, r21 2a9c2: 44 56 subi r20, 0x64 ; 100 2a9c4: 51 4f sbci r21, 0xF1 ; 241 2a9c6: fa 01 movw r30, r20 2a9c8: 80 81 ld r24, Z 2a9ca: 91 81 ldd r25, Z+1 ; 0x01 2a9cc: b0 e0 ldi r27, 0x00 ; 0 2a9ce: a0 e0 ldi r26, 0x00 ; 0 } else { *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; 2a9d0: 88 83 st Y, r24 2a9d2: 99 83 std Y+1, r25 ; 0x01 2a9d4: aa 83 std Y+2, r26 ; 0x02 2a9d6: bb 83 std Y+3, r27 ; 0x03 2a9d8: 81 e0 ldi r24, 0x01 ; 1 2a9da: bf cf rjmp .-130 ; 0x2a95a *value = cluster & 1 ? tmp >> 4 : tmp & 0XFFF; return true; } if (fatType_ == 16) { lba = fatStartBlock_ + (cluster >> 8); } else if (fatType_ == 32) { 2a9dc: 80 32 cpi r24, 0x20 ; 32 2a9de: 09 f0 breq .+2 ; 0x2a9e2 2a9e0: bb cf rjmp .-138 ; 0x2a958 lba = fatStartBlock_ + (cluster >> 7); 2a9e2: c3 88 ldd r12, Z+19 ; 0x13 2a9e4: d4 88 ldd r13, Z+20 ; 0x14 2a9e6: e5 88 ldd r14, Z+21 ; 0x15 2a9e8: f6 88 ldd r15, Z+22 ; 0x16 2a9ea: db 01 movw r26, r22 2a9ec: ca 01 movw r24, r20 2a9ee: c7 e0 ldi r28, 0x07 ; 7 2a9f0: b6 95 lsr r27 2a9f2: a7 95 ror r26 2a9f4: 97 95 ror r25 2a9f6: 87 95 ror r24 2a9f8: ca 95 dec r28 2a9fa: d1 f7 brne .-12 ; 0x2a9f0 2a9fc: c2 cf rjmp .-124 ; 0x2a982 } else { goto fail; } if (lba != cacheBlockNumber_) { if (!cacheRawBlock(lba, CACHE_FOR_READ)) goto fail; 2a9fe: 40 e0 ldi r20, 0x00 ; 0 2aa00: bc 01 movw r22, r24 2aa02: cd 01 movw r24, r26 2aa04: 0f 94 c8 53 call 0x2a790 ; 0x2a790 2aa08: 81 11 cpse r24, r1 2aa0a: d0 cf rjmp .-96 ; 0x2a9ac 2aa0c: a5 cf rjmp .-182 ; 0x2a958 } if (fatType_ == 16) { *value = cacheBuffer_.fat16[cluster & 0XFF]; } else { *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; 2aa0e: b7 01 movw r22, r14 2aa10: a6 01 movw r20, r12 2aa12: 4f 77 andi r20, 0x7F ; 127 2aa14: 55 27 eor r21, r21 2aa16: 66 27 eor r22, r22 2aa18: 77 27 eor r23, r23 2aa1a: 44 0f add r20, r20 2aa1c: 55 1f adc r21, r21 2aa1e: 44 0f add r20, r20 2aa20: 55 1f adc r21, r21 2aa22: 44 56 subi r20, 0x64 ; 100 2aa24: 51 4f sbci r21, 0xF1 ; 241 2aa26: fa 01 movw r30, r20 2aa28: 80 81 ld r24, Z 2aa2a: 91 81 ldd r25, Z+1 ; 0x01 2aa2c: a2 81 ldd r26, Z+2 ; 0x02 2aa2e: b3 81 ldd r27, Z+3 ; 0x03 2aa30: bf 70 andi r27, 0x0F ; 15 2aa32: ce cf rjmp .-100 ; 0x2a9d0 0002aa34 : fail: return false; } //------------------------------------------------------------------------------ // return the size in bytes of a cluster chain bool SdVolume::chainSize(uint32_t cluster, uint32_t* size) { 2aa34: 4f 92 push r4 2aa36: 5f 92 push r5 2aa38: 6f 92 push r6 2aa3a: 7f 92 push r7 2aa3c: af 92 push r10 2aa3e: bf 92 push r11 2aa40: cf 92 push r12 2aa42: df 92 push r13 2aa44: ef 92 push r14 2aa46: ff 92 push r15 2aa48: 0f 93 push r16 2aa4a: 1f 93 push r17 2aa4c: cf 93 push r28 2aa4e: df 93 push r29 2aa50: 00 d0 rcall .+0 ; 0x2aa52 2aa52: 1f 92 push r1 2aa54: cd b7 in r28, 0x3d ; 61 2aa56: de b7 in r29, 0x3e ; 62 2aa58: 8c 01 movw r16, r24 2aa5a: 49 83 std Y+1, r20 ; 0x01 2aa5c: 5a 83 std Y+2, r21 ; 0x02 2aa5e: 6b 83 std Y+3, r22 ; 0x03 2aa60: 7c 83 std Y+4, r23 ; 0x04 2aa62: 59 01 movw r10, r18 uint32_t s = 0; 2aa64: c1 2c mov r12, r1 2aa66: d1 2c mov r13, r1 2aa68: 76 01 movw r14, r12 do { if (!fatGet(cluster, &cluster)) goto fail; s += 512UL << clusterSizeShift_; 2aa6a: 41 2c mov r4, r1 2aa6c: 82 e0 ldi r24, 0x02 ; 2 2aa6e: 58 2e mov r5, r24 2aa70: 61 2c mov r6, r1 2aa72: 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; 2aa74: 49 81 ldd r20, Y+1 ; 0x01 2aa76: 5a 81 ldd r21, Y+2 ; 0x02 2aa78: 6b 81 ldd r22, Y+3 ; 0x03 2aa7a: 7c 81 ldd r23, Y+4 ; 0x04 2aa7c: 9e 01 movw r18, r28 2aa7e: 2f 5f subi r18, 0xFF ; 255 2aa80: 3f 4f sbci r19, 0xFF ; 255 2aa82: c8 01 movw r24, r16 2aa84: 0f 94 97 54 call 0x2a92e ; 0x2a92e 2aa88: 88 23 and r24, r24 2aa8a: 19 f1 breq .+70 ; 0x2aad2 s += 512UL << clusterSizeShift_; 2aa8c: f8 01 movw r30, r16 2aa8e: 85 85 ldd r24, Z+13 ; 0x0d 2aa90: a3 01 movw r20, r6 2aa92: 92 01 movw r18, r4 2aa94: 04 c0 rjmp .+8 ; 0x2aa9e 2aa96: 22 0f add r18, r18 2aa98: 33 1f adc r19, r19 2aa9a: 44 1f adc r20, r20 2aa9c: 55 1f adc r21, r21 2aa9e: 8a 95 dec r24 2aaa0: d2 f7 brpl .-12 ; 0x2aa96 2aaa2: da 01 movw r26, r20 2aaa4: c9 01 movw r24, r18 2aaa6: c8 0e add r12, r24 2aaa8: d9 1e adc r13, r25 2aaaa: ea 1e adc r14, r26 2aaac: fb 1e adc r15, r27 } while (!isEOC(cluster)); 2aaae: 49 81 ldd r20, Y+1 ; 0x01 2aab0: 5a 81 ldd r21, Y+2 ; 0x02 2aab2: 6b 81 ldd r22, Y+3 ; 0x03 2aab4: 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; 2aab6: 87 89 ldd r24, Z+23 ; 0x17 2aab8: 80 31 cpi r24, 0x10 ; 16 2aaba: f1 f4 brne .+60 ; 0x2aaf8 2aabc: 81 e0 ldi r24, 0x01 ; 1 2aabe: 48 3f cpi r20, 0xF8 ; 248 2aac0: 5f 4f sbci r21, 0xFF ; 255 2aac2: 61 05 cpc r22, r1 2aac4: 71 05 cpc r23, r1 2aac6: b0 f2 brcs .-84 ; 0x2aa74 *size = s; 2aac8: f5 01 movw r30, r10 2aaca: c0 82 st Z, r12 2aacc: d1 82 std Z+1, r13 ; 0x01 2aace: e2 82 std Z+2, r14 ; 0x02 2aad0: f3 82 std Z+3, r15 ; 0x03 return true; fail: return false; } 2aad2: 0f 90 pop r0 2aad4: 0f 90 pop r0 2aad6: 0f 90 pop r0 2aad8: 0f 90 pop r0 2aada: df 91 pop r29 2aadc: cf 91 pop r28 2aade: 1f 91 pop r17 2aae0: 0f 91 pop r16 2aae2: ff 90 pop r15 2aae4: ef 90 pop r14 2aae6: df 90 pop r13 2aae8: cf 90 pop r12 2aaea: bf 90 pop r11 2aaec: af 90 pop r10 2aaee: 7f 90 pop r7 2aaf0: 6f 90 pop r6 2aaf2: 5f 90 pop r5 2aaf4: 4f 90 pop r4 2aaf6: 08 95 ret return cluster >= FAT32EOC_MIN; 2aaf8: 81 e0 ldi r24, 0x01 ; 1 2aafa: 48 3f cpi r20, 0xF8 ; 248 2aafc: 5f 4f sbci r21, 0xFF ; 255 2aafe: 6f 4f sbci r22, 0xFF ; 255 2ab00: 7f 40 sbci r23, 0x0F ; 15 2ab02: 08 f4 brcc .+2 ; 0x2ab06 2ab04: b7 cf rjmp .-146 ; 0x2aa74 2ab06: e0 cf rjmp .-64 ; 0x2aac8 0002ab08 : * \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) { 2ab08: 0f 93 push r16 2ab0a: 1f 93 push r17 2ab0c: cf 93 push r28 2ab0e: df 93 push r29 // error if file is already open if (isOpen()) goto fail; 2ab10: fc 01 movw r30, r24 2ab12: 23 81 ldd r18, Z+3 ; 0x03 2ab14: 22 23 and r18, r18 2ab16: 31 f0 breq .+12 ; 0x2ab24 dirBlock_ = 0; dirIndex_ = 0; return true; fail: return false; 2ab18: 80 e0 ldi r24, 0x00 ; 0 } 2ab1a: df 91 pop r29 2ab1c: cf 91 pop r28 2ab1e: 1f 91 pop r17 2ab20: 0f 91 pop r16 2ab22: 08 95 ret 2ab24: 8b 01 movw r16, r22 2ab26: ec 01 movw r28, r24 2ab28: fb 01 movw r30, r22 2ab2a: 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)) { 2ab2c: 80 31 cpi r24, 0x10 ; 16 2ab2e: 39 f5 brne .+78 ; 0x2ab7e type_ = FAT_FILE_TYPE_ROOT_FIXED; 2ab30: 82 e0 ldi r24, 0x02 ; 2 2ab32: 8b 83 std Y+3, r24 ; 0x03 firstCluster_ = 0; 2ab34: 1d 8a std Y+21, r1 ; 0x15 2ab36: 1e 8a std Y+22, r1 ; 0x16 2ab38: 1f 8a std Y+23, r1 ; 0x17 2ab3a: 18 8e std Y+24, r1 ; 0x18 fileSize_ = 32 * vol->rootDirEntryCount(); 2ab3c: 80 8d ldd r24, Z+24 ; 0x18 2ab3e: 91 8d ldd r25, Z+25 ; 0x19 2ab40: b0 e0 ldi r27, 0x00 ; 0 2ab42: a0 e0 ldi r26, 0x00 ; 0 2ab44: 25 e0 ldi r18, 0x05 ; 5 2ab46: 88 0f add r24, r24 2ab48: 99 1f adc r25, r25 2ab4a: aa 1f adc r26, r26 2ab4c: bb 1f adc r27, r27 2ab4e: 2a 95 dec r18 2ab50: d1 f7 brne .-12 ; 0x2ab46 2ab52: 89 8b std Y+17, r24 ; 0x11 2ab54: 9a 8b std Y+18, r25 ; 0x12 2ab56: ab 8b std Y+19, r26 ; 0x13 2ab58: 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; 2ab5a: 1a 8f std Y+26, r17 ; 0x1a 2ab5c: 09 8f std Y+25, r16 ; 0x19 // read only flags_ = O_READ; 2ab5e: 81 e0 ldi r24, 0x01 ; 1 2ab60: 89 83 std Y+1, r24 ; 0x01 // set to start of file curCluster_ = 0; 2ab62: 1c 82 std Y+4, r1 ; 0x04 2ab64: 1d 82 std Y+5, r1 ; 0x05 2ab66: 1e 82 std Y+6, r1 ; 0x06 2ab68: 1f 82 std Y+7, r1 ; 0x07 curPosition_ = 0; 2ab6a: 18 86 std Y+8, r1 ; 0x08 2ab6c: 19 86 std Y+9, r1 ; 0x09 2ab6e: 1a 86 std Y+10, r1 ; 0x0a 2ab70: 1b 86 std Y+11, r1 ; 0x0b // root has no directory entry dirBlock_ = 0; 2ab72: 1c 86 std Y+12, r1 ; 0x0c 2ab74: 1d 86 std Y+13, r1 ; 0x0d 2ab76: 1e 86 std Y+14, r1 ; 0x0e 2ab78: 1f 86 std Y+15, r1 ; 0x0f dirIndex_ = 0; 2ab7a: 18 8a std Y+16, r1 ; 0x10 2ab7c: ce cf rjmp .-100 ; 0x2ab1a 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) { 2ab7e: 80 32 cpi r24, 0x20 ; 32 2ab80: 59 f6 brne .-106 ; 0x2ab18 type_ = FAT_FILE_TYPE_ROOT32; 2ab82: 83 e0 ldi r24, 0x03 ; 3 2ab84: 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_;} 2ab86: 42 8d ldd r20, Z+26 ; 0x1a 2ab88: 53 8d ldd r21, Z+27 ; 0x1b 2ab8a: 64 8d ldd r22, Z+28 ; 0x1c 2ab8c: 75 8d ldd r23, Z+29 ; 0x1d firstCluster_ = vol->rootDirStart(); 2ab8e: 4d 8b std Y+21, r20 ; 0x15 2ab90: 5e 8b std Y+22, r21 ; 0x16 2ab92: 6f 8b std Y+23, r22 ; 0x17 2ab94: 78 8f std Y+24, r23 ; 0x18 if (!vol->chainSize(firstCluster_, &fileSize_)) goto fail; 2ab96: 9e 01 movw r18, r28 2ab98: 2f 5e subi r18, 0xEF ; 239 2ab9a: 3f 4f sbci r19, 0xFF ; 255 2ab9c: c8 01 movw r24, r16 2ab9e: 0f 94 1a 55 call 0x2aa34 ; 0x2aa34 2aba2: 81 11 cpse r24, r1 2aba4: da cf rjmp .-76 ; 0x2ab5a 2aba6: b8 cf rjmp .-144 ; 0x2ab18 0002aba8 : vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; } return true; } bool SdFile::gfComputeNextFileBlock() { 2aba8: cf 92 push r12 2abaa: df 92 push r13 2abac: ef 92 push r14 2abae: ff 92 push r15 2abb0: 1f 93 push r17 2abb2: cf 93 push r28 2abb4: df 93 push r29 2abb6: ec 01 movw r28, r24 2abb8: eb 81 ldd r30, Y+3 ; 0x03 // error if not open or write only if (!isOpen() || !(flags_ & O_READ)) return false; 2abba: e1 11 cpse r30, r1 2abbc: 09 c0 rjmp .+18 ; 0x2abd0 2abbe: 80 e0 ldi r24, 0x00 ; 0 } } gfBlock = vol_->clusterStartBlock(curCluster_) + blockOfCluster; } return true; } 2abc0: df 91 pop r29 2abc2: cf 91 pop r28 2abc4: 1f 91 pop r17 2abc6: ff 90 pop r15 2abc8: ef 90 pop r14 2abca: df 90 pop r13 2abcc: cf 90 pop r12 2abce: 08 95 ret return true; } bool SdFile::gfComputeNextFileBlock() { // error if not open or write only if (!isOpen() || !(flags_ & O_READ)) return false; 2abd0: 89 81 ldd r24, Y+1 ; 0x01 2abd2: 80 ff sbrs r24, 0 2abd4: f4 cf rjmp .-24 ; 0x2abbe gfOffset = curPosition_ & 0X1FF; // offset in block 2abd6: 48 85 ldd r20, Y+8 ; 0x08 2abd8: 59 85 ldd r21, Y+9 ; 0x09 2abda: 6a 85 ldd r22, Y+10 ; 0x0a 2abdc: 7b 85 ldd r23, Y+11 ; 0x0b 2abde: 9a 01 movw r18, r20 2abe0: 31 70 andi r19, 0x01 ; 1 2abe2: 3a a3 std Y+34, r19 ; 0x22 2abe4: 29 a3 std Y+33, r18 ; 0x21 2abe6: 89 8d ldd r24, Y+25 ; 0x19 2abe8: 9a 8d ldd r25, Y+26 ; 0x1a 2abea: 6a 01 movw r12, r20 2abec: 7b 01 movw r14, r22 2abee: f9 e0 ldi r31, 0x09 ; 9 2abf0: f6 94 lsr r15 2abf2: e7 94 ror r14 2abf4: d7 94 ror r13 2abf6: c7 94 ror r12 2abf8: fa 95 dec r31 2abfa: d1 f7 brne .-12 ; 0x2abf0 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 2abfc: e2 30 cpi r30, 0x02 ; 2 2abfe: 79 f4 brne .+30 ; 0x2ac1e // 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); 2ac00: fc 01 movw r30, r24 2ac02: 82 8d ldd r24, Z+26 ; 0x1a 2ac04: 93 8d ldd r25, Z+27 ; 0x1b 2ac06: a4 8d ldd r26, Z+28 ; 0x1c 2ac08: b5 8d ldd r27, Z+29 ; 0x1d 2ac0a: 8c 0d add r24, r12 2ac0c: 9d 1d adc r25, r13 2ac0e: ae 1d adc r26, r14 2ac10: bf 1d adc r27, r15 } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) return false; } } gfBlock = vol_->clusterStartBlock(curCluster_) + blockOfCluster; 2ac12: 8d 8f std Y+29, r24 ; 0x1d 2ac14: 9e 8f std Y+30, r25 ; 0x1e 2ac16: af 8f std Y+31, r26 ; 0x1f 2ac18: b8 a3 std Y+32, r27 ; 0x20 } return true; 2ac1a: 81 e0 ldi r24, 0x01 ; 1 2ac1c: d1 cf rjmp .-94 ; 0x2abc0 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);} 2ac1e: fc 01 movw r30, r24 2ac20: 14 81 ldd r17, Z+4 ; 0x04 2ac22: 11 50 subi r17, 0x01 ; 1 2ac24: 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) { 2ac26: 23 2b or r18, r19 2ac28: 71 f4 brne .+28 ; 0x2ac46 2ac2a: 11 11 cpse r17, r1 2ac2c: 0c c0 rjmp .+24 ; 0x2ac46 // start of new cluster if (curPosition_ == 0) { 2ac2e: 45 2b or r20, r21 2ac30: 46 2b or r20, r22 2ac32: 47 2b or r20, r23 2ac34: 31 f5 brne .+76 ; 0x2ac82 // use first cluster in file curCluster_ = firstCluster_; 2ac36: 8d 89 ldd r24, Y+21 ; 0x15 2ac38: 9e 89 ldd r25, Y+22 ; 0x16 2ac3a: af 89 ldd r26, Y+23 ; 0x17 2ac3c: b8 8d ldd r27, Y+24 ; 0x18 2ac3e: 8c 83 std Y+4, r24 ; 0x04 2ac40: 9d 83 std Y+5, r25 ; 0x05 2ac42: ae 83 std Y+6, r26 ; 0x06 2ac44: 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; 2ac46: e9 8d ldd r30, Y+25 ; 0x19 2ac48: fa 8d ldd r31, Y+26 ; 0x1a uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 2ac4a: 8c 81 ldd r24, Y+4 ; 0x04 2ac4c: 9d 81 ldd r25, Y+5 ; 0x05 2ac4e: ae 81 ldd r26, Y+6 ; 0x06 2ac50: bf 81 ldd r27, Y+7 ; 0x07 2ac52: 02 97 sbiw r24, 0x02 ; 2 2ac54: a1 09 sbc r26, r1 2ac56: b1 09 sbc r27, r1 2ac58: 25 85 ldd r18, Z+13 ; 0x0d 2ac5a: 04 c0 rjmp .+8 ; 0x2ac64 2ac5c: 88 0f add r24, r24 2ac5e: 99 1f adc r25, r25 2ac60: aa 1f adc r26, r26 2ac62: bb 1f adc r27, r27 2ac64: 2a 95 dec r18 2ac66: d2 f7 brpl .-12 ; 0x2ac5c 2ac68: 46 85 ldd r20, Z+14 ; 0x0e 2ac6a: 57 85 ldd r21, Z+15 ; 0x0f 2ac6c: 60 89 ldd r22, Z+16 ; 0x10 2ac6e: 71 89 ldd r23, Z+17 ; 0x11 2ac70: 84 0f add r24, r20 2ac72: 95 1f adc r25, r21 2ac74: a6 1f adc r26, r22 2ac76: b7 1f adc r27, r23 2ac78: 81 0f add r24, r17 2ac7a: 91 1d adc r25, r1 2ac7c: a1 1d adc r26, r1 2ac7e: b1 1d adc r27, r1 2ac80: c8 cf rjmp .-112 ; 0x2ac12 if (curPosition_ == 0) { // use first cluster in file curCluster_ = firstCluster_; } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) return false; 2ac82: 4c 81 ldd r20, Y+4 ; 0x04 2ac84: 5d 81 ldd r21, Y+5 ; 0x05 2ac86: 6e 81 ldd r22, Y+6 ; 0x06 2ac88: 7f 81 ldd r23, Y+7 ; 0x07 2ac8a: 9e 01 movw r18, r28 2ac8c: 2c 5f subi r18, 0xFC ; 252 2ac8e: 3f 4f sbci r19, 0xFF ; 255 2ac90: 0f 94 97 54 call 0x2a92e ; 0x2a92e 2ac94: 81 11 cpse r24, r1 2ac96: d7 cf rjmp .-82 ; 0x2ac46 2ac98: 92 cf rjmp .-220 ; 0x2abbe 0002ac9a : * \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) { 2ac9a: 8f 92 push r8 2ac9c: 9f 92 push r9 2ac9e: af 92 push r10 2aca0: bf 92 push r11 2aca2: cf 92 push r12 2aca4: df 92 push r13 2aca6: ef 92 push r14 2aca8: ff 92 push r15 2acaa: 0f 93 push r16 2acac: 1f 93 push r17 2acae: cf 93 push r28 2acb0: df 93 push r29 2acb2: ec 01 movw r28, r24 2acb4: 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; 2acb6: 81 11 cpse r24, r1 2acb8: 0e c0 rjmp .+28 ; 0x2acd6 done: return true; fail: return false; 2acba: 80 e0 ldi r24, 0x00 ; 0 } 2acbc: df 91 pop r29 2acbe: cf 91 pop r28 2acc0: 1f 91 pop r17 2acc2: 0f 91 pop r16 2acc4: ff 90 pop r15 2acc6: ef 90 pop r14 2acc8: df 90 pop r13 2acca: cf 90 pop r12 2accc: bf 90 pop r11 2acce: af 90 pop r10 2acd0: 9f 90 pop r9 2acd2: 8f 90 pop r8 2acd4: 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; 2acd6: 09 89 ldd r16, Y+17 ; 0x11 2acd8: 1a 89 ldd r17, Y+18 ; 0x12 2acda: 2b 89 ldd r18, Y+19 ; 0x13 2acdc: 3c 89 ldd r19, Y+20 ; 0x14 2acde: 04 17 cp r16, r20 2ace0: 15 07 cpc r17, r21 2ace2: 26 07 cpc r18, r22 2ace4: 37 07 cpc r19, r23 2ace6: 48 f3 brcs .-46 ; 0x2acba 2ace8: 4a 01 movw r8, r20 2acea: 5b 01 movw r10, r22 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 2acec: 82 30 cpi r24, 0x02 ; 2 2acee: 31 f4 brne .+12 ; 0x2acfc curPosition_ = pos; 2acf0: 88 86 std Y+8, r8 ; 0x08 2acf2: 99 86 std Y+9, r9 ; 0x09 2acf4: aa 86 std Y+10, r10 ; 0x0a 2acf6: bb 86 std Y+11, r11 ; 0x0b if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; } curPosition_ = pos; done: return true; 2acf8: 81 e0 ldi r24, 0x01 ; 1 2acfa: e0 cf rjmp .-64 ; 0x2acbc if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { curPosition_ = pos; goto done; } if (pos == 0) { 2acfc: 81 14 cp r8, r1 2acfe: 91 04 cpc r9, r1 2ad00: a1 04 cpc r10, r1 2ad02: b1 04 cpc r11, r1 2ad04: 49 f4 brne .+18 ; 0x2ad18 // set position to start of file curCluster_ = 0; 2ad06: 1c 82 std Y+4, r1 ; 0x04 2ad08: 1d 82 std Y+5, r1 ; 0x05 2ad0a: 1e 82 std Y+6, r1 ; 0x06 2ad0c: 1f 82 std Y+7, r1 ; 0x07 curPosition_ = 0; 2ad0e: 18 86 std Y+8, r1 ; 0x08 2ad10: 19 86 std Y+9, r1 ; 0x09 2ad12: 1a 86 std Y+10, r1 ; 0x0a 2ad14: 1b 86 std Y+11, r1 ; 0x0b 2ad16: f0 cf rjmp .-32 ; 0x2acf8 goto done; } // calculate cluster index for cur and new position nCur = (curPosition_ - 1) >> (vol_->clusterSizeShift_ + 9); 2ad18: 08 85 ldd r16, Y+8 ; 0x08 2ad1a: 19 85 ldd r17, Y+9 ; 0x09 2ad1c: 2a 85 ldd r18, Y+10 ; 0x0a 2ad1e: 3b 85 ldd r19, Y+11 ; 0x0b 2ad20: e9 8d ldd r30, Y+25 ; 0x19 2ad22: fa 8d ldd r31, Y+26 ; 0x1a 2ad24: 85 85 ldd r24, Z+13 ; 0x0d 2ad26: 90 e0 ldi r25, 0x00 ; 0 2ad28: 09 96 adiw r24, 0x09 ; 9 2ad2a: b9 01 movw r22, r18 2ad2c: a8 01 movw r20, r16 2ad2e: 41 50 subi r20, 0x01 ; 1 2ad30: 51 09 sbc r21, r1 2ad32: 61 09 sbc r22, r1 2ad34: 71 09 sbc r23, r1 2ad36: 08 2e mov r0, r24 2ad38: 04 c0 rjmp .+8 ; 0x2ad42 2ad3a: 76 95 lsr r23 2ad3c: 67 95 ror r22 2ad3e: 57 95 ror r21 2ad40: 47 95 ror r20 2ad42: 0a 94 dec r0 2ad44: d2 f7 brpl .-12 ; 0x2ad3a nNew = (pos - 1) >> (vol_->clusterSizeShift_ + 9); 2ad46: 75 01 movw r14, r10 2ad48: 64 01 movw r12, r8 2ad4a: e1 e0 ldi r30, 0x01 ; 1 2ad4c: ce 1a sub r12, r30 2ad4e: d1 08 sbc r13, r1 2ad50: e1 08 sbc r14, r1 2ad52: f1 08 sbc r15, r1 2ad54: 04 c0 rjmp .+8 ; 0x2ad5e 2ad56: f6 94 lsr r15 2ad58: e7 94 ror r14 2ad5a: d7 94 ror r13 2ad5c: c7 94 ror r12 2ad5e: 8a 95 dec r24 2ad60: d2 f7 brpl .-12 ; 0x2ad56 if (nNew < nCur || curPosition_ == 0) { 2ad62: c4 16 cp r12, r20 2ad64: d5 06 cpc r13, r21 2ad66: e6 06 cpc r14, r22 2ad68: f7 06 cpc r15, r23 2ad6a: 20 f0 brcs .+8 ; 0x2ad74 2ad6c: 01 2b or r16, r17 2ad6e: 02 2b or r16, r18 2ad70: 03 2b or r16, r19 2ad72: 11 f5 brne .+68 ; 0x2adb8 // must follow chain from first cluster curCluster_ = firstCluster_; 2ad74: 8d 89 ldd r24, Y+21 ; 0x15 2ad76: 9e 89 ldd r25, Y+22 ; 0x16 2ad78: af 89 ldd r26, Y+23 ; 0x17 2ad7a: b8 8d ldd r27, Y+24 ; 0x18 2ad7c: 8c 83 std Y+4, r24 ; 0x04 2ad7e: 9d 83 std Y+5, r25 ; 0x05 2ad80: ae 83 std Y+6, r26 ; 0x06 2ad82: bf 83 std Y+7, r27 ; 0x07 } else { // advance from curPosition nNew -= nCur; } while (nNew--) { if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 2ad84: 8e 01 movw r16, r28 2ad86: 0c 5f subi r16, 0xFC ; 252 2ad88: 1f 4f sbci r17, 0xFF ; 255 curCluster_ = firstCluster_; } else { // advance from curPosition nNew -= nCur; } while (nNew--) { 2ad8a: c1 14 cp r12, r1 2ad8c: d1 04 cpc r13, r1 2ad8e: e1 04 cpc r14, r1 2ad90: f1 04 cpc r15, r1 2ad92: 09 f4 brne .+2 ; 0x2ad96 2ad94: ad cf rjmp .-166 ; 0x2acf0 if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 2ad96: 4c 81 ldd r20, Y+4 ; 0x04 2ad98: 5d 81 ldd r21, Y+5 ; 0x05 2ad9a: 6e 81 ldd r22, Y+6 ; 0x06 2ad9c: 7f 81 ldd r23, Y+7 ; 0x07 2ad9e: 98 01 movw r18, r16 2ada0: 89 8d ldd r24, Y+25 ; 0x19 2ada2: 9a 8d ldd r25, Y+26 ; 0x1a 2ada4: 0f 94 97 54 call 0x2a92e ; 0x2a92e 2ada8: 91 e0 ldi r25, 0x01 ; 1 2adaa: c9 1a sub r12, r25 2adac: d1 08 sbc r13, r1 2adae: e1 08 sbc r14, r1 2adb0: f1 08 sbc r15, r1 2adb2: 81 11 cpse r24, r1 2adb4: ea cf rjmp .-44 ; 0x2ad8a 2adb6: 81 cf rjmp .-254 ; 0x2acba if (nNew < nCur || curPosition_ == 0) { // must follow chain from first cluster curCluster_ = firstCluster_; } else { // advance from curPosition nNew -= nCur; 2adb8: c4 1a sub r12, r20 2adba: d5 0a sbc r13, r21 2adbc: e6 0a sbc r14, r22 2adbe: f7 0a sbc r15, r23 2adc0: e1 cf rjmp .-62 ; 0x2ad84 0002adc2 : 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() { 2adc2: 3f 92 push r3 2adc4: 4f 92 push r4 2adc6: 5f 92 push r5 2adc8: 6f 92 push r6 2adca: 7f 92 push r7 2adcc: 8f 92 push r8 2adce: 9f 92 push r9 2add0: af 92 push r10 2add2: bf 92 push r11 2add4: cf 92 push r12 2add6: df 92 push r13 2add8: ef 92 push r14 2adda: ff 92 push r15 2addc: 0f 93 push r16 2adde: 1f 93 push r17 2ade0: cf 93 push r28 2ade2: df 93 push r29 2ade4: cd b7 in r28, 0x3d ; 61 2ade6: de b7 in r29, 0x3e ; 62 2ade8: 2c 97 sbiw r28, 0x0c ; 12 2adea: 0f b6 in r0, 0x3f ; 63 2adec: f8 94 cli 2adee: de bf out 0x3e, r29 ; 62 2adf0: 0f be out 0x3f, r0 ; 63 2adf2: cd bf out 0x3d, r28 ; 61 2adf4: 5c 01 movw r10, r24 if (!vol_->allocContiguous(1, &curCluster_)) goto fail; 2adf6: dc 01 movw r26, r24 2adf8: 59 96 adiw r26, 0x19 ; 25 2adfa: 8d 90 ld r8, X+ 2adfc: 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; 2adfe: f4 01 movw r30, r8 2ae00: 81 85 ldd r24, Z+9 ; 0x09 2ae02: 92 85 ldd r25, Z+10 ; 0x0a 2ae04: a3 85 ldd r26, Z+11 ; 0x0b 2ae06: b4 85 ldd r27, Z+12 ; 0x0c 2ae08: 9c 01 movw r18, r24 2ae0a: ad 01 movw r20, r26 2ae0c: 2f 5f subi r18, 0xFF ; 255 2ae0e: 3f 4f sbci r19, 0xFF ; 255 2ae10: 4f 4f sbci r20, 0xFF ; 255 2ae12: 5f 4f sbci r21, 0xFF ; 255 2ae14: 29 87 std Y+9, r18 ; 0x09 2ae16: 3a 87 std Y+10, r19 ; 0x0a 2ae18: 4b 87 std Y+11, r20 ; 0x0b 2ae1a: 5c 87 std Y+12, r21 ; 0x0c // flag to save place to start next search bool setStart; // set search start cluster if (*curCluster) { 2ae1c: d5 01 movw r26, r10 2ae1e: 14 96 adiw r26, 0x04 ; 4 2ae20: 4d 90 ld r4, X+ 2ae22: 5d 90 ld r5, X+ 2ae24: 6d 90 ld r6, X+ 2ae26: 7c 90 ld r7, X 2ae28: 17 97 sbiw r26, 0x07 ; 7 2ae2a: 41 14 cp r4, r1 2ae2c: 51 04 cpc r5, r1 2ae2e: 61 04 cpc r6, r1 2ae30: 71 04 cpc r7, r1 2ae32: 09 f4 brne .+2 ; 0x2ae36 2ae34: 59 c0 rjmp .+178 ; 0x2aee8 // try to make file contiguous bgnCluster = *curCluster + 1; 2ae36: bf ef ldi r27, 0xFF ; 255 2ae38: 4b 1a sub r4, r27 2ae3a: 5b 0a sbc r5, r27 2ae3c: 6b 0a sbc r6, r27 2ae3e: 7b 0a sbc r7, r27 // don't save new start location setStart = false; 2ae40: 31 2c mov r3, r1 // save next search start if one cluster setStart = count == 1; } // end of group endCluster = bgnCluster; 2ae42: 73 01 movw r14, r6 2ae44: 62 01 movw r12, r4 // search the FAT for free clusters for (uint32_t n = 0;; n++, endCluster++) { 2ae46: 1d 82 std Y+5, r1 ; 0x05 2ae48: 1e 82 std Y+6, r1 ; 0x06 2ae4a: 1f 82 std Y+7, r1 ; 0x07 2ae4c: 18 86 std Y+8, r1 ; 0x08 // can't find space checked all clusters if (n >= clusterCount_) goto fail; 2ae4e: f4 01 movw r30, r8 2ae50: 81 85 ldd r24, Z+9 ; 0x09 2ae52: 92 85 ldd r25, Z+10 ; 0x0a 2ae54: a3 85 ldd r26, Z+11 ; 0x0b 2ae56: b4 85 ldd r27, Z+12 ; 0x0c 2ae58: 2d 81 ldd r18, Y+5 ; 0x05 2ae5a: 3e 81 ldd r19, Y+6 ; 0x06 2ae5c: 4f 81 ldd r20, Y+7 ; 0x07 2ae5e: 58 85 ldd r21, Y+8 ; 0x08 2ae60: 28 17 cp r18, r24 2ae62: 39 07 cpc r19, r25 2ae64: 4a 07 cpc r20, r26 2ae66: 5b 07 cpc r21, r27 2ae68: 08 f0 brcs .+2 ; 0x2ae6c 2ae6a: 56 c0 rjmp .+172 ; 0x2af18 // past end - start from beginning of FAT if (endCluster > fatEnd) { 2ae6c: 89 85 ldd r24, Y+9 ; 0x09 2ae6e: 9a 85 ldd r25, Y+10 ; 0x0a 2ae70: ab 85 ldd r26, Y+11 ; 0x0b 2ae72: bc 85 ldd r27, Y+12 ; 0x0c 2ae74: 8c 15 cp r24, r12 2ae76: 9d 05 cpc r25, r13 2ae78: ae 05 cpc r26, r14 2ae7a: bf 05 cpc r27, r15 2ae7c: 50 f4 brcc .+20 ; 0x2ae92 bgnCluster = endCluster = 2; 2ae7e: 82 e0 ldi r24, 0x02 ; 2 2ae80: c8 2e mov r12, r24 2ae82: d1 2c mov r13, r1 2ae84: e1 2c mov r14, r1 2ae86: f1 2c mov r15, r1 2ae88: 92 e0 ldi r25, 0x02 ; 2 2ae8a: 49 2e mov r4, r25 2ae8c: 51 2c mov r5, r1 2ae8e: 61 2c mov r6, r1 2ae90: 71 2c mov r7, r1 } uint32_t f; if (!fatGet(endCluster, &f)) goto fail; 2ae92: 9e 01 movw r18, r28 2ae94: 2f 5f subi r18, 0xFF ; 255 2ae96: 3f 4f sbci r19, 0xFF ; 255 2ae98: b7 01 movw r22, r14 2ae9a: a6 01 movw r20, r12 2ae9c: c4 01 movw r24, r8 2ae9e: 0f 94 97 54 call 0x2a92e ; 0x2a92e 2aea2: 88 23 and r24, r24 2aea4: c9 f1 breq .+114 ; 0x2af18 if (f != 0) { 2aea6: 89 81 ldd r24, Y+1 ; 0x01 2aea8: 9a 81 ldd r25, Y+2 ; 0x02 2aeaa: ab 81 ldd r26, Y+3 ; 0x03 2aeac: bc 81 ldd r27, Y+4 ; 0x04 2aeae: 89 2b or r24, r25 2aeb0: 8a 2b or r24, r26 2aeb2: 8b 2b or r24, r27 2aeb4: 01 f1 breq .+64 ; 0x2aef6 // cluster in use try next cluster as bgnCluster bgnCluster = endCluster + 1; 2aeb6: 26 01 movw r4, r12 2aeb8: 37 01 movw r6, r14 2aeba: 9f ef ldi r25, 0xFF ; 255 2aebc: 49 1a sub r4, r25 2aebe: 59 0a sbc r5, r25 2aec0: 69 0a sbc r6, r25 2aec2: 79 0a sbc r7, r25 } // end of group endCluster = bgnCluster; // search the FAT for free clusters for (uint32_t n = 0;; n++, endCluster++) { 2aec4: 2d 81 ldd r18, Y+5 ; 0x05 2aec6: 3e 81 ldd r19, Y+6 ; 0x06 2aec8: 4f 81 ldd r20, Y+7 ; 0x07 2aeca: 58 85 ldd r21, Y+8 ; 0x08 2aecc: 2f 5f subi r18, 0xFF ; 255 2aece: 3f 4f sbci r19, 0xFF ; 255 2aed0: 4f 4f sbci r20, 0xFF ; 255 2aed2: 5f 4f sbci r21, 0xFF ; 255 2aed4: 2d 83 std Y+5, r18 ; 0x05 2aed6: 3e 83 std Y+6, r19 ; 0x06 2aed8: 4f 83 std Y+7, r20 ; 0x07 2aeda: 58 87 std Y+8, r21 ; 0x08 2aedc: 3f ef ldi r19, 0xFF ; 255 2aede: c3 1a sub r12, r19 2aee0: d3 0a sbc r13, r19 2aee2: e3 0a sbc r14, r19 2aee4: f3 0a sbc r15, r19 2aee6: b3 cf rjmp .-154 ; 0x2ae4e // don't save new start location setStart = false; } else { // start at likely place for free cluster bgnCluster = allocSearchStart_; 2aee8: 40 80 ld r4, Z 2aeea: 51 80 ldd r5, Z+1 ; 0x01 2aeec: 62 80 ldd r6, Z+2 ; 0x02 2aeee: 73 80 ldd r7, Z+3 ; 0x03 // save next search start if one cluster setStart = count == 1; 2aef0: 33 24 eor r3, r3 2aef2: 33 94 inc r3 2aef4: a6 cf rjmp .-180 ; 0x2ae42 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) { 2aef6: c4 14 cp r12, r4 2aef8: d5 04 cpc r13, r5 2aefa: e6 04 cpc r14, r6 2aefc: f7 04 cpc r15, r7 2aefe: 11 f7 brne .-60 ; 0x2aec4 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); 2af00: 0f ef ldi r16, 0xFF ; 255 2af02: 1f ef ldi r17, 0xFF ; 255 2af04: 2f ef ldi r18, 0xFF ; 255 2af06: 3f e0 ldi r19, 0x0F ; 15 2af08: b7 01 movw r22, r14 2af0a: a6 01 movw r20, r12 2af0c: c4 01 movw r24, r8 2af0e: 0f 94 05 54 call 0x2a80a ; 0x2a80a 2af12: 78 2e mov r7, r24 // done - found space break; } } // mark end of chain if (!fatPutEOC(endCluster)) goto fail; 2af14: 81 11 cpse r24, r1 2af16: 1a c0 rjmp .+52 ; 0x2af4c flags_ |= F_FILE_DIR_DIRTY; } return true; fail: return false; 2af18: 71 2c mov r7, r1 } 2af1a: 87 2d mov r24, r7 2af1c: 2c 96 adiw r28, 0x0c ; 12 2af1e: 0f b6 in r0, 0x3f ; 63 2af20: f8 94 cli 2af22: de bf out 0x3e, r29 ; 62 2af24: 0f be out 0x3f, r0 ; 63 2af26: cd bf out 0x3d, r28 ; 61 2af28: df 91 pop r29 2af2a: cf 91 pop r28 2af2c: 1f 91 pop r17 2af2e: 0f 91 pop r16 2af30: ff 90 pop r15 2af32: ef 90 pop r14 2af34: df 90 pop r13 2af36: cf 90 pop r12 2af38: bf 90 pop r11 2af3a: af 90 pop r10 2af3c: 9f 90 pop r9 2af3e: 8f 90 pop r8 2af40: 7f 90 pop r7 2af42: 6f 90 pop r6 2af44: 5f 90 pop r5 2af46: 4f 90 pop r4 2af48: 3f 90 pop r3 2af4a: 08 95 ret // link clusters while (endCluster > bgnCluster) { if (!fatPut(endCluster - 1, endCluster)) goto fail; endCluster--; } if (*curCluster != 0) { 2af4c: f5 01 movw r30, r10 2af4e: 44 81 ldd r20, Z+4 ; 0x04 2af50: 55 81 ldd r21, Z+5 ; 0x05 2af52: 66 81 ldd r22, Z+6 ; 0x06 2af54: 77 81 ldd r23, Z+7 ; 0x07 2af56: 41 15 cp r20, r1 2af58: 51 05 cpc r21, r1 2af5a: 61 05 cpc r22, r1 2af5c: 71 05 cpc r23, r1 2af5e: 39 f0 breq .+14 ; 0x2af6e // connect chains if (!fatPut(*curCluster, bgnCluster)) goto fail; 2af60: 97 01 movw r18, r14 2af62: 86 01 movw r16, r12 2af64: c4 01 movw r24, r8 2af66: 0f 94 05 54 call 0x2a80a ; 0x2a80a 2af6a: 88 23 and r24, r24 2af6c: a9 f2 breq .-86 ; 0x2af18 } // return first cluster number to caller *curCluster = bgnCluster; 2af6e: d5 01 movw r26, r10 2af70: 14 96 adiw r26, 0x04 ; 4 2af72: cd 92 st X+, r12 2af74: dd 92 st X+, r13 2af76: ed 92 st X+, r14 2af78: fc 92 st X, r15 2af7a: 17 97 sbiw r26, 0x07 ; 7 // remember possible next free cluster if (setStart) allocSearchStart_ = bgnCluster + 1; 2af7c: 33 20 and r3, r3 2af7e: 51 f0 breq .+20 ; 0x2af94 2af80: d7 01 movw r26, r14 2af82: c6 01 movw r24, r12 2af84: 01 96 adiw r24, 0x01 ; 1 2af86: a1 1d adc r26, r1 2af88: b1 1d adc r27, r1 2af8a: f4 01 movw r30, r8 2af8c: 80 83 st Z, r24 2af8e: 91 83 std Z+1, r25 ; 0x01 2af90: a2 83 std Z+2, r26 ; 0x02 2af92: 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) { 2af94: f5 01 movw r30, r10 2af96: 85 89 ldd r24, Z+21 ; 0x15 2af98: 96 89 ldd r25, Z+22 ; 0x16 2af9a: a7 89 ldd r26, Z+23 ; 0x17 2af9c: b0 8d ldd r27, Z+24 ; 0x18 2af9e: 89 2b or r24, r25 2afa0: 8a 2b or r24, r26 2afa2: 8b 2b or r24, r27 2afa4: 09 f0 breq .+2 ; 0x2afa8 2afa6: b9 cf rjmp .-142 ; 0x2af1a firstCluster_ = curCluster_; 2afa8: c5 8a std Z+21, r12 ; 0x15 2afaa: d6 8a std Z+22, r13 ; 0x16 2afac: e7 8a std Z+23, r14 ; 0x17 2afae: f0 8e std Z+24, r15 ; 0x18 flags_ |= F_FILE_DIR_DIRTY; 2afb0: 81 81 ldd r24, Z+1 ; 0x01 2afb2: 80 68 ori r24, 0x80 ; 128 2afb4: 81 83 std Z+1, r24 ; 0x01 2afb6: b1 cf rjmp .-158 ; 0x2af1a 0002afb8 : return false; } //------------------------------------------------------------------------------ // cache a file's directory entry // return pointer to cached entry or null for failure dir_t* SdBaseFile::cacheDirEntry(uint8_t action) { 2afb8: cf 93 push r28 2afba: df 93 push r29 2afbc: ec 01 movw r28, r24 if (!vol_->cacheRawBlock(dirBlock_, action)) goto fail; 2afbe: 46 2f mov r20, r22 2afc0: 41 70 andi r20, 0x01 ; 1 2afc2: 6c 85 ldd r22, Y+12 ; 0x0c 2afc4: 7d 85 ldd r23, Y+13 ; 0x0d 2afc6: 8e 85 ldd r24, Y+14 ; 0x0e 2afc8: 9f 85 ldd r25, Y+15 ; 0x0f 2afca: 0f 94 c8 53 call 0x2a790 ; 0x2a790 2afce: 88 23 and r24, r24 2afd0: 51 f0 breq .+20 ; 0x2afe6 return vol_->cache()->dir + dirIndex_; 2afd2: 88 89 ldd r24, Y+16 ; 0x10 2afd4: 20 e2 ldi r18, 0x20 ; 32 2afd6: 82 9f mul r24, r18 2afd8: c0 01 movw r24, r0 2afda: 11 24 eor r1, r1 2afdc: 84 56 subi r24, 0x64 ; 100 2afde: 91 4f sbci r25, 0xF1 ; 241 fail: return 0; } 2afe0: df 91 pop r29 2afe2: cf 91 pop r28 2afe4: 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; 2afe6: 90 e0 ldi r25, 0x00 ; 0 2afe8: 80 e0 ldi r24, 0x00 ; 0 2afea: fa cf rjmp .-12 ; 0x2afe0 0002afec : * \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() { 2afec: cf 93 push r28 2afee: df 93 push r29 2aff0: ec 01 movw r28, r24 // only allow open files and directories if (!isOpen()) goto fail; 2aff2: 8b 81 ldd r24, Y+3 ; 0x03 2aff4: 88 23 and r24, r24 2aff6: 49 f1 breq .+82 ; 0x2b04a if (flags_ & F_FILE_DIR_DIRTY) { 2aff8: 89 81 ldd r24, Y+1 ; 0x01 2affa: 87 ff sbrs r24, 7 2affc: 22 c0 rjmp .+68 ; 0x2b042 dir_t* d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 2affe: 61 e0 ldi r22, 0x01 ; 1 2b000: ce 01 movw r24, r28 2b002: 0f 94 dc 57 call 0x2afb8 ; 0x2afb8 2b006: fc 01 movw r30, r24 // check for deleted by another open file object if (!d || d->name[0] == DIR_NAME_DELETED) goto fail; 2b008: 89 2b or r24, r25 2b00a: f9 f0 breq .+62 ; 0x2b04a 2b00c: 80 81 ld r24, Z 2b00e: 85 3e cpi r24, 0xE5 ; 229 2b010: e1 f0 breq .+56 ; 0x2b04a // do not set filesize for dir files if (!isDir()) d->fileSize = fileSize_; 2b012: 8b 81 ldd r24, Y+3 ; 0x03 2b014: 82 30 cpi r24, 0x02 ; 2 2b016: 40 f4 brcc .+16 ; 0x2b028 2b018: 89 89 ldd r24, Y+17 ; 0x11 2b01a: 9a 89 ldd r25, Y+18 ; 0x12 2b01c: ab 89 ldd r26, Y+19 ; 0x13 2b01e: bc 89 ldd r27, Y+20 ; 0x14 2b020: 84 8f std Z+28, r24 ; 0x1c 2b022: 95 8f std Z+29, r25 ; 0x1d 2b024: a6 8f std Z+30, r26 ; 0x1e 2b026: b7 8f std Z+31, r27 ; 0x1f // update first cluster fields d->firstClusterLow = firstCluster_ & 0XFFFF; 2b028: 8d 89 ldd r24, Y+21 ; 0x15 2b02a: 9e 89 ldd r25, Y+22 ; 0x16 2b02c: 93 8f std Z+27, r25 ; 0x1b 2b02e: 82 8f std Z+26, r24 ; 0x1a d->firstClusterHigh = firstCluster_ >> 16; 2b030: 8d 89 ldd r24, Y+21 ; 0x15 2b032: 9e 89 ldd r25, Y+22 ; 0x16 2b034: af 89 ldd r26, Y+23 ; 0x17 2b036: b8 8d ldd r27, Y+24 ; 0x18 2b038: b5 8b std Z+21, r27 ; 0x15 2b03a: 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; 2b03c: 89 81 ldd r24, Y+1 ; 0x01 2b03e: 8f 77 andi r24, 0x7F ; 127 2b040: 89 83 std Y+1, r24 ; 0x01 return vol_->cacheFlush(); fail: writeError = true; return false; } 2b042: df 91 pop r29 2b044: cf 91 pop r28 d->lastAccessDate = d->lastWriteDate; } // clear directory dirty flags_ &= ~F_FILE_DIR_DIRTY; } return vol_->cacheFlush(); 2b046: 0d 94 d0 52 jmp 0x2a5a0 ; 0x2a5a0 fail: writeError = true; 2b04a: 81 e0 ldi r24, 0x01 ; 1 2b04c: 88 83 st Y, r24 return false; } 2b04e: 80 e0 ldi r24, 0x00 ; 0 2b050: df 91 pop r29 2b052: cf 91 pop r28 2b054: 08 95 ret 0002b056 : * * \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() { 2b056: cf 93 push r28 2b058: df 93 push r29 2b05a: ec 01 movw r28, r24 bool rtn = sync(); 2b05c: 0f 94 f6 57 call 0x2afec ; 0x2afec type_ = FAT_FILE_TYPE_CLOSED; 2b060: 1b 82 std Y+3, r1 ; 0x03 return rtn; } 2b062: df 91 pop r29 2b064: cf 91 pop r28 2b066: 08 95 ret 0002b068 : * \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) { 2b068: cf 93 push r28 2b06a: df 93 push r29 2b06c: eb 01 movw r28, r22 2b06e: fc 01 movw r30, r24 2b070: 23 81 ldd r18, Z+3 ; 0x03 if (!isOpen()) return false; 2b072: 21 11 cpse r18, r1 2b074: 04 c0 rjmp .+8 ; 0x2b07e 2b076: 80 e0 ldi r24, 0x00 ; 0 if (!p) return false; // format name dirName(*p, name); return true; } 2b078: df 91 pop r29 2b07a: cf 91 pop r28 2b07c: 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; 2b07e: 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()) { 2b080: 22 30 cpi r18, 0x02 ; 2 2b082: 28 f4 brcc .+10 ; 0x2b08e name[0] = '/'; 2b084: 8f e2 ldi r24, 0x2F ; 47 2b086: 88 83 st Y, r24 name[1] = '\0'; 2b088: 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; 2b08a: 81 e0 ldi r24, 0x01 ; 1 2b08c: f5 cf rjmp .-22 ; 0x2b078 name[0] = '/'; name[1] = '\0'; return true; } // cache entry dir_t* p = cacheDirEntry(SdVolume::CACHE_FOR_READ); 2b08e: 60 e0 ldi r22, 0x00 ; 0 2b090: 0f 94 dc 57 call 0x2afb8 ; 0x2afb8 if (!p) return false; 2b094: 00 97 sbiw r24, 0x00 ; 0 2b096: 79 f3 breq .-34 ; 0x2b076 2b098: 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; 2b09a: 60 e0 ldi r22, 0x00 ; 0 for (uint8_t i = 0; i < 11; i++) { 2b09c: 80 e0 ldi r24, 0x00 ; 0 if (dir.name[i] == ' ')continue; if (i == 8) name[j++] = '.'; 2b09e: 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; 2b0a0: 2d 91 ld r18, X+ 2b0a2: 20 32 cpi r18, 0x20 ; 32 2b0a4: 99 f0 breq .+38 ; 0x2b0cc if (i == 8) name[j++] = '.'; 2b0a6: 88 30 cpi r24, 0x08 ; 8 2b0a8: 31 f4 brne .+12 ; 0x2b0b6 2b0aa: 9e 01 movw r18, r28 2b0ac: 26 0f add r18, r22 2b0ae: 31 1d adc r19, r1 2b0b0: f9 01 movw r30, r18 2b0b2: 90 83 st Z, r25 2b0b4: 6f 5f subi r22, 0xFF ; 255 name[j++] = dir.name[i]; 2b0b6: 9e 01 movw r18, r28 2b0b8: 26 0f add r18, r22 2b0ba: 31 1d adc r19, r1 2b0bc: ad 01 movw r20, r26 2b0be: 41 50 subi r20, 0x01 ; 1 2b0c0: 51 09 sbc r21, r1 2b0c2: fa 01 movw r30, r20 2b0c4: 40 81 ld r20, Z 2b0c6: f9 01 movw r30, r18 2b0c8: 40 83 st Z, r20 2b0ca: 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++) { 2b0cc: 8f 5f subi r24, 0xFF ; 255 2b0ce: 8b 30 cpi r24, 0x0B ; 11 2b0d0: 39 f7 brne .-50 ; 0x2b0a0 if (dir.name[i] == ' ')continue; if (i == 8) name[j++] = '.'; name[j++] = dir.name[i]; } name[j] = 0; 2b0d2: fe 01 movw r30, r28 2b0d4: e6 0f add r30, r22 2b0d6: f1 1d adc r31, r1 2b0d8: 10 82 st Z, r1 2b0da: d7 cf rjmp .-82 ; 0x2b08a 0002b0dc : * 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) { 2b0dc: 2f 92 push r2 2b0de: 3f 92 push r3 2b0e0: 4f 92 push r4 2b0e2: 5f 92 push r5 2b0e4: 6f 92 push r6 2b0e6: 7f 92 push r7 2b0e8: 8f 92 push r8 2b0ea: 9f 92 push r9 2b0ec: af 92 push r10 2b0ee: bf 92 push r11 2b0f0: cf 92 push r12 2b0f2: df 92 push r13 2b0f4: ef 92 push r14 2b0f6: ff 92 push r15 2b0f8: 0f 93 push r16 2b0fa: 1f 93 push r17 2b0fc: cf 93 push r28 2b0fe: df 93 push r29 2b100: 00 d0 rcall .+0 ; 0x2b102 2b102: 1f 92 push r1 2b104: cd b7 in r28, 0x3d ; 61 2b106: de b7 in r29, 0x3e ; 62 2b108: 9c 83 std Y+4, r25 ; 0x04 2b10a: 8b 83 std Y+3, r24 ; 0x03 2b10c: 4b 01 movw r8, r22 2b10e: 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; 2b110: dc 01 movw r26, r24 2b112: 13 96 adiw r26, 0x03 ; 3 2b114: 8c 91 ld r24, X 2b116: 81 11 cpse r24, r1 2b118: 19 c0 rjmp .+50 ; 0x2b14c toRead -= n; } return nbyte; fail: return -1; 2b11a: 8f ef ldi r24, 0xFF ; 255 2b11c: 9f ef ldi r25, 0xFF ; 255 } 2b11e: 0f 90 pop r0 2b120: 0f 90 pop r0 2b122: 0f 90 pop r0 2b124: 0f 90 pop r0 2b126: df 91 pop r29 2b128: cf 91 pop r28 2b12a: 1f 91 pop r17 2b12c: 0f 91 pop r16 2b12e: ff 90 pop r15 2b130: ef 90 pop r14 2b132: df 90 pop r13 2b134: cf 90 pop r12 2b136: bf 90 pop r11 2b138: af 90 pop r10 2b13a: 9f 90 pop r9 2b13c: 8f 90 pop r8 2b13e: 7f 90 pop r7 2b140: 6f 90 pop r6 2b142: 5f 90 pop r5 2b144: 4f 90 pop r4 2b146: 3f 90 pop r3 2b148: 2f 90 pop r2 2b14a: 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; 2b14c: eb 81 ldd r30, Y+3 ; 0x03 2b14e: fc 81 ldd r31, Y+4 ; 0x04 2b150: 81 81 ldd r24, Z+1 ; 0x01 2b152: 80 ff sbrs r24, 0 2b154: e2 cf rjmp .-60 ; 0x2b11a // max bytes left in file if (nbyte >= (fileSize_ - curPosition_)) { 2b156: 01 89 ldd r16, Z+17 ; 0x11 2b158: 12 89 ldd r17, Z+18 ; 0x12 2b15a: 23 89 ldd r18, Z+19 ; 0x13 2b15c: 34 89 ldd r19, Z+20 ; 0x14 2b15e: 40 85 ldd r20, Z+8 ; 0x08 2b160: 51 85 ldd r21, Z+9 ; 0x09 2b162: 62 85 ldd r22, Z+10 ; 0x0a 2b164: 73 85 ldd r23, Z+11 ; 0x0b 2b166: c7 01 movw r24, r14 2b168: b0 e0 ldi r27, 0x00 ; 0 2b16a: a0 e0 ldi r26, 0x00 ; 0 2b16c: 28 01 movw r4, r16 2b16e: 39 01 movw r6, r18 2b170: 44 1a sub r4, r20 2b172: 55 0a sbc r5, r21 2b174: 66 0a sbc r6, r22 2b176: 77 0a sbc r7, r23 2b178: 84 15 cp r24, r4 2b17a: 95 05 cpc r25, r5 2b17c: a6 05 cpc r26, r6 2b17e: b7 05 cpc r27, r7 2b180: 18 f0 brcs .+6 ; 0x2b188 nbyte = fileSize_ - curPosition_; 2b182: 78 01 movw r14, r16 2b184: e4 1a sub r14, r20 2b186: f5 0a sbc r15, r21 } // amount left to read toRead = nbyte; 2b188: 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; 2b18a: 8b 81 ldd r24, Y+3 ; 0x03 2b18c: 9c 81 ldd r25, Y+4 ; 0x04 2b18e: 04 96 adiw r24, 0x04 ; 4 2b190: 9a 83 std Y+2, r25 ; 0x02 2b192: 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; 2b194: 61 2c mov r6, r1 2b196: 32 e0 ldi r19, 0x02 ; 2 2b198: 73 2e mov r7, r19 if (nbyte >= (fileSize_ - curPosition_)) { nbyte = fileSize_ - curPosition_; } // amount left to read toRead = nbyte; while (toRead > 0) { 2b19a: c1 14 cp r12, r1 2b19c: d1 04 cpc r13, r1 2b19e: 09 f4 brne .+2 ; 0x2b1a2 2b1a0: b7 c0 rjmp .+366 ; 0x2b310 offset = curPosition_ & 0X1FF; // offset in block 2b1a2: ab 81 ldd r26, Y+3 ; 0x03 2b1a4: bc 81 ldd r27, Y+4 ; 0x04 2b1a6: 18 96 adiw r26, 0x08 ; 8 2b1a8: 4d 91 ld r20, X+ 2b1aa: 5d 91 ld r21, X+ 2b1ac: 6d 91 ld r22, X+ 2b1ae: 7c 91 ld r23, X 2b1b0: 1b 97 sbiw r26, 0x0b ; 11 2b1b2: 5a 01 movw r10, r20 2b1b4: b1 e0 ldi r27, 0x01 ; 1 2b1b6: bb 22 and r11, r27 2b1b8: eb 81 ldd r30, Y+3 ; 0x03 2b1ba: fc 81 ldd r31, Y+4 ; 0x04 2b1bc: 81 8d ldd r24, Z+25 ; 0x19 2b1be: 92 8d ldd r25, Z+26 ; 0x1a 2b1c0: 1a 01 movw r2, r20 2b1c2: 2b 01 movw r4, r22 2b1c4: 29 e0 ldi r18, 0x09 ; 9 2b1c6: 56 94 lsr r5 2b1c8: 47 94 ror r4 2b1ca: 37 94 ror r3 2b1cc: 27 94 ror r2 2b1ce: 2a 95 dec r18 2b1d0: d1 f7 brne .-12 ; 0x2b1c6 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 2b1d2: 23 81 ldd r18, Z+3 ; 0x03 2b1d4: 22 30 cpi r18, 0x02 ; 2 2b1d6: 91 f5 brne .+100 ; 0x2b23c block = vol_->rootDirStart() + (curPosition_ >> 9); 2b1d8: dc 01 movw r26, r24 2b1da: 5a 96 adiw r26, 0x1a ; 26 2b1dc: 6d 91 ld r22, X+ 2b1de: 7d 91 ld r23, X+ 2b1e0: 8d 91 ld r24, X+ 2b1e2: 9c 91 ld r25, X 2b1e4: 5d 97 sbiw r26, 0x1d ; 29 2b1e6: 62 0d add r22, r2 2b1e8: 73 1d adc r23, r3 2b1ea: 84 1d adc r24, r4 2b1ec: 95 1d adc r25, r5 2b1ee: 83 01 movw r16, r6 2b1f0: 0a 19 sub r16, r10 2b1f2: 1b 09 sbc r17, r11 2b1f4: c0 16 cp r12, r16 2b1f6: d1 06 cpc r13, r17 2b1f8: 08 f4 brcc .+2 ; 0x2b1fc 2b1fa: 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()) { 2b1fc: 01 15 cp r16, r1 2b1fe: b2 e0 ldi r27, 0x02 ; 2 2b200: 1b 07 cpc r17, r27 2b202: 71 f4 brne .+28 ; 0x2b220 2b204: 20 91 90 0e lds r18, 0x0E90 ; 0x800e90 2b208: 30 91 91 0e lds r19, 0x0E91 ; 0x800e91 2b20c: 40 91 92 0e lds r20, 0x0E92 ; 0x800e92 2b210: 50 91 93 0e lds r21, 0x0E93 ; 0x800e93 2b214: 62 17 cp r22, r18 2b216: 73 07 cpc r23, r19 2b218: 84 07 cpc r24, r20 2b21a: 95 07 cpc r25, r21 2b21c: 09 f0 breq .+2 ; 0x2b220 2b21e: 59 c0 rjmp .+178 ; 0x2b2d2 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; 2b220: 40 e0 ldi r20, 0x00 ; 0 2b222: 0f 94 c8 53 call 0x2a790 ; 0x2a790 2b226: 88 23 and r24, r24 2b228: 09 f4 brne .+2 ; 0x2b22c 2b22a: 77 cf rjmp .-274 ; 0x2b11a uint8_t* src = vol_->cache()->data + offset; 2b22c: b5 01 movw r22, r10 2b22e: 64 56 subi r22, 0x64 ; 100 2b230: 71 4f sbci r23, 0xF1 ; 241 memcpy(dst, src, n); 2b232: a8 01 movw r20, r16 2b234: c4 01 movw r24, r8 2b236: 0f 94 00 e2 call 0x3c400 ; 0x3c400 2b23a: 57 c0 rjmp .+174 ; 0x2b2ea 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);} 2b23c: fc 01 movw r30, r24 2b23e: 14 81 ldd r17, Z+4 ; 0x04 2b240: 11 50 subi r17, 0x01 ; 1 2b242: 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) { 2b244: a1 14 cp r10, r1 2b246: b1 04 cpc r11, r1 2b248: 81 f4 brne .+32 ; 0x2b26a 2b24a: 11 11 cpse r17, r1 2b24c: 0e c0 rjmp .+28 ; 0x2b26a // start of new cluster if (curPosition_ == 0) { 2b24e: 45 2b or r20, r21 2b250: 46 2b or r20, r22 2b252: 47 2b or r20, r23 2b254: 79 f5 brne .+94 ; 0x2b2b4 // use first cluster in file curCluster_ = firstCluster_; 2b256: eb 81 ldd r30, Y+3 ; 0x03 2b258: fc 81 ldd r31, Y+4 ; 0x04 2b25a: 85 89 ldd r24, Z+21 ; 0x15 2b25c: 96 89 ldd r25, Z+22 ; 0x16 2b25e: a7 89 ldd r26, Z+23 ; 0x17 2b260: b0 8d ldd r27, Z+24 ; 0x18 2b262: 84 83 std Z+4, r24 ; 0x04 2b264: 95 83 std Z+5, r25 ; 0x05 2b266: a6 83 std Z+6, r26 ; 0x06 2b268: 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; 2b26a: ab 81 ldd r26, Y+3 ; 0x03 2b26c: bc 81 ldd r27, Y+4 ; 0x04 2b26e: 59 96 adiw r26, 0x19 ; 25 2b270: ed 91 ld r30, X+ 2b272: fc 91 ld r31, X 2b274: 5a 97 sbiw r26, 0x1a ; 26 uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 2b276: 14 96 adiw r26, 0x04 ; 4 2b278: 6d 91 ld r22, X+ 2b27a: 7d 91 ld r23, X+ 2b27c: 8d 91 ld r24, X+ 2b27e: 9c 91 ld r25, X 2b280: 17 97 sbiw r26, 0x07 ; 7 2b282: 62 50 subi r22, 0x02 ; 2 2b284: 71 09 sbc r23, r1 2b286: 81 09 sbc r24, r1 2b288: 91 09 sbc r25, r1 2b28a: 25 85 ldd r18, Z+13 ; 0x0d 2b28c: 04 c0 rjmp .+8 ; 0x2b296 2b28e: 66 0f add r22, r22 2b290: 77 1f adc r23, r23 2b292: 88 1f adc r24, r24 2b294: 99 1f adc r25, r25 2b296: 2a 95 dec r18 2b298: d2 f7 brpl .-12 ; 0x2b28e 2b29a: 26 85 ldd r18, Z+14 ; 0x0e 2b29c: 37 85 ldd r19, Z+15 ; 0x0f 2b29e: 40 89 ldd r20, Z+16 ; 0x10 2b2a0: 51 89 ldd r21, Z+17 ; 0x11 2b2a2: 62 0f add r22, r18 2b2a4: 73 1f adc r23, r19 2b2a6: 84 1f adc r24, r20 2b2a8: 95 1f adc r25, r21 2b2aa: 61 0f add r22, r17 2b2ac: 71 1d adc r23, r1 2b2ae: 81 1d adc r24, r1 2b2b0: 91 1d adc r25, r1 2b2b2: 9d cf rjmp .-198 ; 0x2b1ee if (curPosition_ == 0) { // use first cluster in file curCluster_ = firstCluster_; } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 2b2b4: ab 81 ldd r26, Y+3 ; 0x03 2b2b6: bc 81 ldd r27, Y+4 ; 0x04 2b2b8: 14 96 adiw r26, 0x04 ; 4 2b2ba: 4d 91 ld r20, X+ 2b2bc: 5d 91 ld r21, X+ 2b2be: 6d 91 ld r22, X+ 2b2c0: 7c 91 ld r23, X 2b2c2: 17 97 sbiw r26, 0x07 ; 7 2b2c4: 29 81 ldd r18, Y+1 ; 0x01 2b2c6: 3a 81 ldd r19, Y+2 ; 0x02 2b2c8: 0f 94 97 54 call 0x2a92e ; 0x2a92e 2b2cc: 81 11 cpse r24, r1 2b2ce: cd cf rjmp .-102 ; 0x2b26a 2b2d0: 24 cf rjmp .-440 ; 0x2b11a 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);} 2b2d2: 94 01 movw r18, r8 2b2d4: ab 01 movw r20, r22 2b2d6: bc 01 movw r22, r24 2b2d8: 80 91 99 0e lds r24, 0x0E99 ; 0x800e99 2b2dc: 90 91 9a 0e lds r25, 0x0E9A ; 0x800e9a 2b2e0: 0f 94 0f 53 call 0x2a61e ; 0x2a61e // 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; 2b2e4: 88 23 and r24, r24 2b2e6: 09 f4 brne .+2 ; 0x2b2ea 2b2e8: 18 cf rjmp .-464 ; 0x2b11a // 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; 2b2ea: 80 0e add r8, r16 2b2ec: 91 1e adc r9, r17 curPosition_ += n; 2b2ee: eb 81 ldd r30, Y+3 ; 0x03 2b2f0: fc 81 ldd r31, Y+4 ; 0x04 2b2f2: 80 85 ldd r24, Z+8 ; 0x08 2b2f4: 91 85 ldd r25, Z+9 ; 0x09 2b2f6: a2 85 ldd r26, Z+10 ; 0x0a 2b2f8: b3 85 ldd r27, Z+11 ; 0x0b 2b2fa: 80 0f add r24, r16 2b2fc: 91 1f adc r25, r17 2b2fe: a1 1d adc r26, r1 2b300: b1 1d adc r27, r1 2b302: 80 87 std Z+8, r24 ; 0x08 2b304: 91 87 std Z+9, r25 ; 0x09 2b306: a2 87 std Z+10, r26 ; 0x0a 2b308: b3 87 std Z+11, r27 ; 0x0b toRead -= n; 2b30a: c0 1a sub r12, r16 2b30c: d1 0a sbc r13, r17 2b30e: 45 cf rjmp .-374 ; 0x2b19a } return nbyte; 2b310: c7 01 movw r24, r14 2b312: 05 cf rjmp .-502 ; 0x2b11e 0002b314 : * 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) { 2b314: df 92 push r13 2b316: ef 92 push r14 2b318: ff 92 push r15 2b31a: 0f 93 push r16 2b31c: 1f 93 push r17 2b31e: cf 93 push r28 2b320: df 93 push r29 2b322: 8c 01 movw r16, r24 2b324: eb 01 movw r28, r22 2b326: 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; 2b328: 8d e0 ldi r24, 0x0D ; 13 2b32a: d8 2e mov r13, r24 { longFilename[0] = '\0'; } while (1) { n = read(dir, sizeof(dir_t)); 2b32c: 40 e2 ldi r20, 0x20 ; 32 2b32e: 50 e0 ldi r21, 0x00 ; 0 2b330: be 01 movw r22, r28 2b332: c8 01 movw r24, r16 2b334: 0f 94 6e 58 call 0x2b0dc ; 0x2b0dc if (n != sizeof(dir_t)) return n == 0 ? 0 : -1; 2b338: 80 32 cpi r24, 0x20 ; 32 2b33a: 91 05 cpc r25, r1 2b33c: 71 f0 breq .+28 ; 0x2b35a 2b33e: 21 e0 ldi r18, 0x01 ; 1 2b340: 89 2b or r24, r25 2b342: 09 f4 brne .+2 ; 0x2b346 2b344: 20 e0 ldi r18, 0x00 ; 0 2b346: 82 2f mov r24, r18 2b348: 81 95 neg r24 } } // return if normal file or subdirectory if (DIR_IS_FILE_OR_SUBDIR(dir)) return n; } } 2b34a: df 91 pop r29 2b34c: cf 91 pop r28 2b34e: 1f 91 pop r17 2b350: 0f 91 pop r16 2b352: ff 90 pop r15 2b354: ef 90 pop r14 2b356: df 90 pop r13 2b358: 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; 2b35a: 28 81 ld r18, Y 2b35c: 22 23 and r18, r18 2b35e: 09 f4 brne .+2 ; 0x2b362 2b360: 3f c0 rjmp .+126 ; 0x2b3e0 // skip empty entries and entry for . and .. if (dir->name[0] == DIR_NAME_DELETED || dir->name[0] == '.') continue; 2b362: 25 3e cpi r18, 0xE5 ; 229 2b364: 19 f3 breq .-58 ; 0x2b32c 2b366: 2e 32 cpi r18, 0x2E ; 46 2b368: 09 f3 breq .-62 ; 0x2b32c //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) 2b36a: 3b 85 ldd r19, Y+11 ; 0x0b 2b36c: 3f 73 andi r19, 0x3F ; 63 2b36e: 3f 30 cpi r19, 0x0F ; 15 2b370: 99 f5 brne .+102 ; 0x2b3d8 2b372: e1 14 cp r14, r1 2b374: f1 04 cpc r15, r1 2b376: 81 f1 breq .+96 ; 0x2b3d8 { 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) 2b378: 4a 8d ldd r20, Y+26 ; 0x1a 2b37a: 5b 8d ldd r21, Y+27 ; 0x1b 2b37c: 45 2b or r20, r21 2b37e: 61 f5 brne .+88 ; 0x2b3d8 2b380: 2f 71 andi r18, 0x1F ; 31 2b382: 3f ef ldi r19, 0xFF ; 255 2b384: 32 0f add r19, r18 2b386: 34 30 cpi r19, 0x04 ; 4 2b388: 38 f5 brcc .+78 ; 0x2b3d8 { //TODO: Store the filename checksum to verify if a none-long filename aware system modified the file table. n = ((VFAT->sequenceNumber & 0x1F) - 1) * 13; 2b38a: 21 50 subi r18, 0x01 ; 1 2b38c: 33 0b sbc r19, r19 2b38e: d2 9e mul r13, r18 2b390: c0 01 movw r24, r0 2b392: d3 9e mul r13, r19 2b394: 90 0d add r25, r0 2b396: 11 24 eor r1, r1 longFilename[n+0] = VFAT->name1[0]; 2b398: f7 01 movw r30, r14 2b39a: e8 0f add r30, r24 2b39c: f9 1f adc r31, r25 2b39e: 29 81 ldd r18, Y+1 ; 0x01 2b3a0: 20 83 st Z, r18 longFilename[n+1] = VFAT->name1[1]; 2b3a2: 2b 81 ldd r18, Y+3 ; 0x03 2b3a4: 21 83 std Z+1, r18 ; 0x01 longFilename[n+2] = VFAT->name1[2]; 2b3a6: 2d 81 ldd r18, Y+5 ; 0x05 2b3a8: 22 83 std Z+2, r18 ; 0x02 longFilename[n+3] = VFAT->name1[3]; 2b3aa: 2f 81 ldd r18, Y+7 ; 0x07 2b3ac: 23 83 std Z+3, r18 ; 0x03 longFilename[n+4] = VFAT->name1[4]; 2b3ae: 29 85 ldd r18, Y+9 ; 0x09 2b3b0: 24 83 std Z+4, r18 ; 0x04 longFilename[n+5] = VFAT->name2[0]; 2b3b2: 2e 85 ldd r18, Y+14 ; 0x0e 2b3b4: 25 83 std Z+5, r18 ; 0x05 longFilename[n+6] = VFAT->name2[1]; 2b3b6: 28 89 ldd r18, Y+16 ; 0x10 2b3b8: 26 83 std Z+6, r18 ; 0x06 longFilename[n+7] = VFAT->name2[2]; 2b3ba: 2a 89 ldd r18, Y+18 ; 0x12 2b3bc: 27 83 std Z+7, r18 ; 0x07 longFilename[n+8] = VFAT->name2[3]; 2b3be: 2c 89 ldd r18, Y+20 ; 0x14 2b3c0: 20 87 std Z+8, r18 ; 0x08 longFilename[n+9] = VFAT->name2[4]; 2b3c2: 2e 89 ldd r18, Y+22 ; 0x16 2b3c4: 21 87 std Z+9, r18 ; 0x09 longFilename[n+10] = VFAT->name2[5]; 2b3c6: 28 8d ldd r18, Y+24 ; 0x18 2b3c8: 22 87 std Z+10, r18 ; 0x0a longFilename[n+11] = VFAT->name3[0]; 2b3ca: 2c 8d ldd r18, Y+28 ; 0x1c 2b3cc: 23 87 std Z+11, r18 ; 0x0b longFilename[n+12] = VFAT->name3[1]; 2b3ce: 2e 8d ldd r18, Y+30 ; 0x1e 2b3d0: 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) 2b3d2: 28 81 ld r18, Y 2b3d4: 26 fd sbrc r18, 6 longFilename[n+13] = '\0'; 2b3d6: 15 86 std Z+13, r1 ; 0x0d } } // return if normal file or subdirectory if (DIR_IS_FILE_OR_SUBDIR(dir)) return n; 2b3d8: 2b 85 ldd r18, Y+11 ; 0x0b 2b3da: 23 fd sbrc r18, 3 2b3dc: a7 cf rjmp .-178 ; 0x2b32c 2b3de: b5 cf rjmp .-150 ; 0x2b34a 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; 2b3e0: 80 e0 ldi r24, 0x00 ; 0 2b3e2: b3 cf rjmp .-154 ; 0x2b34a 0002b3e4 : return false; } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { 2b3e4: 4f 92 push r4 2b3e6: 5f 92 push r5 2b3e8: 6f 92 push r6 2b3ea: 7f 92 push r7 2b3ec: af 92 push r10 2b3ee: bf 92 push r11 2b3f0: cf 92 push r12 2b3f2: df 92 push r13 2b3f4: ef 92 push r14 2b3f6: ff 92 push r15 2b3f8: 0f 93 push r16 2b3fa: 1f 93 push r17 2b3fc: cf 93 push r28 2b3fe: df 93 push r29 2b400: 1f 92 push r1 2b402: cd b7 in r28, 0x3d ; 61 2b404: de b7 in r29, 0x3e ; 62 2b406: 8c 01 movw r16, r24 2b408: 7b 01 movw r14, r22 2b40a: 5a 01 movw r10, r20 2b40c: c2 2e mov r12, r18 bool emptyFound = false; bool fileFound = false; uint8_t index; dir_t* p; vol_ = dirFile->vol_; 2b40e: db 01 movw r26, r22 2b410: 59 96 adiw r26, 0x19 ; 25 2b412: 8d 91 ld r24, X+ 2b414: 9c 91 ld r25, X 2b416: f8 01 movw r30, r16 2b418: 92 8f std Z+26, r25 ; 0x1a 2b41a: 81 8f std Z+25, r24 ; 0x19 dirFile->rewind(); 2b41c: cb 01 movw r24, r22 2b41e: 0e 94 44 77 call 0xee88 ; 0xee88 } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { bool emptyFound = false; 2b422: 71 2c mov r7, r1 vol_ = dirFile->vol_; dirFile->rewind(); // search for file while (dirFile->curPosition_ < dirFile->fileSize_) { 2b424: f7 01 movw r30, r14 2b426: 80 85 ldd r24, Z+8 ; 0x08 2b428: 91 85 ldd r25, Z+9 ; 0x09 2b42a: a2 85 ldd r26, Z+10 ; 0x0a 2b42c: b3 85 ldd r27, Z+11 ; 0x0b 2b42e: 41 89 ldd r20, Z+17 ; 0x11 2b430: 52 89 ldd r21, Z+18 ; 0x12 2b432: 63 89 ldd r22, Z+19 ; 0x13 2b434: 74 89 ldd r23, Z+20 ; 0x14 2b436: 84 17 cp r24, r20 2b438: 95 07 cpc r25, r21 2b43a: a6 07 cpc r26, r22 2b43c: b7 07 cpc r27, r23 2b43e: 08 f0 brcs .+2 ; 0x2b442 2b440: 52 c0 rjmp .+164 ; 0x2b4e6 index = 0XF & (dirFile->curPosition_ >> 5); 2b442: 55 e0 ldi r21, 0x05 ; 5 2b444: b6 95 lsr r27 2b446: a7 95 ror r26 2b448: 97 95 ror r25 2b44a: 87 95 ror r24 2b44c: 5a 95 dec r21 2b44e: d1 f7 brne .-12 ; 0x2b444 2b450: f8 2f mov r31, r24 2b452: ff 70 andi r31, 0x0F ; 15 2b454: 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; 2b456: d7 01 movw r26, r14 2b458: 13 96 adiw r26, 0x03 ; 3 2b45a: 8c 91 ld r24, X 2b45c: 82 30 cpi r24, 0x02 ; 2 2b45e: 10 f4 brcc .+4 ; 0x2b464 if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; fail: type_ = FAT_FILE_TYPE_CLOSED; return false; 2b460: 80 e0 ldi r24, 0x00 ; 0 2b462: db c0 rjmp .+438 ; 0x2b61a * \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; 2b464: 41 e0 ldi r20, 0x01 ; 1 2b466: 50 e0 ldi r21, 0x00 ; 0 2b468: be 01 movw r22, r28 2b46a: 6f 5f subi r22, 0xFF ; 255 2b46c: 7f 4f sbci r23, 0xFF ; 255 2b46e: c7 01 movw r24, r14 2b470: 0f 94 6e 58 call 0x2b0dc ; 0x2b0dc 2b474: 01 97 sbiw r24, 0x01 ; 1 2b476: a1 f7 brne .-24 ; 0x2b460 // use read to locate and cache block if (read() < 0) goto fail; // advance to next entry curPosition_ += 31; 2b478: f7 01 movw r30, r14 2b47a: 80 85 ldd r24, Z+8 ; 0x08 2b47c: 91 85 ldd r25, Z+9 ; 0x09 2b47e: a2 85 ldd r26, Z+10 ; 0x0a 2b480: b3 85 ldd r27, Z+11 ; 0x0b 2b482: 4f 96 adiw r24, 0x1f ; 31 2b484: a1 1d adc r26, r1 2b486: b1 1d adc r27, r1 2b488: 80 87 std Z+8, r24 ; 0x08 2b48a: 91 87 std Z+9, r25 ; 0x09 2b48c: a2 87 std Z+10, r26 ; 0x0a 2b48e: b3 87 std Z+11, r27 ; 0x0b // return pointer to entry return vol_->cache()->dir + i; 2b490: f0 e2 ldi r31, 0x20 ; 32 2b492: df 9e mul r13, r31 2b494: b0 01 movw r22, r0 2b496: 11 24 eor r1, r1 2b498: 64 56 subi r22, 0x64 ; 100 2b49a: 71 4f sbci r23, 0xF1 ; 241 // search for file while (dirFile->curPosition_ < dirFile->fileSize_) { index = 0XF & (dirFile->curPosition_ >> 5); p = dirFile->readDirCache(); if (!p) goto fail; 2b49c: 61 15 cp r22, r1 2b49e: 71 05 cpc r23, r1 2b4a0: f9 f2 breq .-66 ; 0x2b460 if (p->name[0] == DIR_NAME_FREE || p->name[0] == DIR_NAME_DELETED) { 2b4a2: db 01 movw r26, r22 2b4a4: 8c 91 ld r24, X 2b4a6: 88 23 and r24, r24 2b4a8: 41 f0 breq .+16 ; 0x2b4ba 2b4aa: 85 3e cpi r24, 0xE5 ; 229 2b4ac: 09 f0 breq .+2 ; 0x2b4b0 2b4ae: 4c c0 rjmp .+152 ; 0x2b548 // remember first empty slot if (!emptyFound) { 2b4b0: 77 20 and r7, r7 2b4b2: 29 f0 breq .+10 ; 0x2b4be return false; } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { 2b4b4: 77 24 eor r7, r7 2b4b6: 73 94 inc r7 2b4b8: b5 cf rjmp .-150 ; 0x2b424 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) { 2b4ba: 71 10 cpse r7, r1 2b4bc: 0e c0 rjmp .+28 ; 0x2b4da dirBlock_ = dirFile->vol_->cacheBlockNumber(); 2b4be: 80 91 90 0e lds r24, 0x0E90 ; 0x800e90 2b4c2: 90 91 91 0e lds r25, 0x0E91 ; 0x800e91 2b4c6: a0 91 92 0e lds r26, 0x0E92 ; 0x800e92 2b4ca: b0 91 93 0e lds r27, 0x0E93 ; 0x800e93 2b4ce: f8 01 movw r30, r16 2b4d0: 84 87 std Z+12, r24 ; 0x0c 2b4d2: 95 87 std Z+13, r25 ; 0x0d 2b4d4: a6 87 std Z+14, r26 ; 0x0e 2b4d6: b7 87 std Z+15, r27 ; 0x0f dirIndex_ = index; 2b4d8: d0 8a std Z+16, r13 ; 0x10 emptyFound = true; } // done if no entries follow if (p->name[0] == DIR_NAME_FREE) break; 2b4da: db 01 movw r26, r22 2b4dc: 8c 91 ld r24, X 2b4de: 81 11 cpse r24, r1 2b4e0: e9 cf rjmp .-46 ; 0x2b4b4 2b4e2: 77 24 eor r7, r7 2b4e4: 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; 2b4e6: 8c 2d mov r24, r12 2b4e8: 82 74 andi r24, 0x42 ; 66 2b4ea: 82 34 cpi r24, 0x42 ; 66 2b4ec: 09 f0 breq .+2 ; 0x2b4f0 2b4ee: b8 cf rjmp .-144 ; 0x2b460 if (emptyFound) { 2b4f0: 77 20 and r7, r7 2b4f2: 09 f4 brne .+2 ; 0x2b4f6 2b4f4: a2 c0 rjmp .+324 ; 0x2b63a index = dirIndex_; 2b4f6: f8 01 movw r30, r16 2b4f8: d0 88 ldd r13, Z+16 ; 0x10 p = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 2b4fa: 61 e0 ldi r22, 0x01 ; 1 2b4fc: c8 01 movw r24, r16 2b4fe: 0f 94 dc 57 call 0x2afb8 ; 0x2afb8 if (!p) goto fail; 2b502: 00 97 sbiw r24, 0x00 ; 0 2b504: 09 f4 brne .+2 ; 0x2b508 2b506: ac cf rjmp .-168 ; 0x2b460 // use first entry in cluster p = dirFile->vol_->cache()->dir; index = 0; } // initialize as empty file memset(p, 0, sizeof(dir_t)); 2b508: 20 e2 ldi r18, 0x20 ; 32 2b50a: dc 01 movw r26, r24 2b50c: 1d 92 st X+, r1 2b50e: 2a 95 dec r18 2b510: e9 f7 brne .-6 ; 0x2b50c memcpy(p->name, dname, 11); 2b512: 2b e0 ldi r18, 0x0B ; 11 2b514: f5 01 movw r30, r10 2b516: dc 01 movw r26, r24 2b518: 01 90 ld r0, Z+ 2b51a: 0d 92 st X+, r0 2b51c: 2a 95 dec r18 2b51e: e1 f7 brne .-8 ; 0x2b518 if (dateTime_) { // call user date/time function dateTime_(&p->creationDate, &p->creationTime); } else { // use default date/time p->creationDate = FAT_DEFAULT_DATE; 2b520: 21 e2 ldi r18, 0x21 ; 33 2b522: 38 e2 ldi r19, 0x28 ; 40 2b524: fc 01 movw r30, r24 2b526: 31 8b std Z+17, r19 ; 0x11 2b528: 20 8b std Z+16, r18 ; 0x10 p->creationTime = FAT_DEFAULT_TIME; 2b52a: 40 e0 ldi r20, 0x00 ; 0 2b52c: 58 e0 ldi r21, 0x08 ; 8 2b52e: 57 87 std Z+15, r21 ; 0x0f 2b530: 46 87 std Z+14, r20 ; 0x0e } p->lastAccessDate = p->creationDate; 2b532: 33 8b std Z+19, r19 ; 0x13 2b534: 22 8b std Z+18, r18 ; 0x12 p->lastWriteDate = p->creationDate; 2b536: 31 8f std Z+25, r19 ; 0x19 2b538: 20 8f std Z+24, r18 ; 0x18 p->lastWriteTime = p->creationTime; 2b53a: 57 8b std Z+23, r21 ; 0x17 2b53c: 46 8b std Z+22, r20 ; 0x16 // write entry to SD if (!dirFile->vol_->cacheFlush()) goto fail; 2b53e: 0f 94 d0 52 call 0x2a5a0 ; 0x2a5a0 2b542: 81 11 cpse r24, r1 2b544: 09 c0 rjmp .+18 ; 0x2b558 2b546: 8c cf rjmp .-232 ; 0x2b460 dirIndex_ = index; emptyFound = true; } // done if no entries follow if (p->name[0] == DIR_NAME_FREE) break; } else if (!memcmp(dname, p->name, 11)) { 2b548: 4b e0 ldi r20, 0x0B ; 11 2b54a: 50 e0 ldi r21, 0x00 ; 0 2b54c: c5 01 movw r24, r10 2b54e: 0f 94 f3 e1 call 0x3c3e6 ; 0x3c3e6 2b552: 89 2b or r24, r25 2b554: 09 f0 breq .+2 ; 0x2b558 2b556: 66 cf rjmp .-308 ; 0x2b424 } //------------------------------------------------------------------------------ // 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]; 2b558: f0 e2 ldi r31, 0x20 ; 32 2b55a: df 9e mul r13, r31 2b55c: d0 01 movw r26, r0 2b55e: 11 24 eor r1, r1 2b560: 9d 01 movw r18, r26 2b562: 24 56 subi r18, 0x64 ; 100 2b564: 31 4f sbci r19, 0xF1 ; 241 // write or truncate is an error for a directory or read-only file if (p->attributes & (DIR_ATT_READ_ONLY | DIR_ATT_DIRECTORY)) { 2b566: f9 01 movw r30, r18 2b568: 83 85 ldd r24, Z+11 ; 0x0b 2b56a: 81 71 andi r24, 0x11 ; 17 2b56c: 21 f0 breq .+8 ; 0x2b576 if (oflag & (O_WRITE | O_TRUNC)) goto fail; 2b56e: 8c 2d mov r24, r12 2b570: 82 71 andi r24, 0x12 ; 18 2b572: 09 f0 breq .+2 ; 0x2b576 2b574: fc c0 rjmp .+504 ; 0x2b76e } //------------------------------------------------------------------------------ // 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]; 2b576: f8 01 movw r30, r16 2b578: 81 8d ldd r24, Z+25 ; 0x19 2b57a: 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(); 2b57c: 40 91 90 0e lds r20, 0x0E90 ; 0x800e90 2b580: 50 91 91 0e lds r21, 0x0E91 ; 0x800e91 2b584: 60 91 92 0e lds r22, 0x0E92 ; 0x800e92 2b588: 70 91 93 0e lds r23, 0x0E93 ; 0x800e93 2b58c: 44 87 std Z+12, r20 ; 0x0c 2b58e: 55 87 std Z+13, r21 ; 0x0d 2b590: 66 87 std Z+14, r22 ; 0x0e 2b592: 77 87 std Z+15, r23 ; 0x0f dirIndex_ = dirIndex; 2b594: d0 8a std Z+16, r13 ; 0x10 // copy first cluster number for directory fields firstCluster_ = (uint32_t)p->firstClusterHigh << 16; 2b596: fd 01 movw r30, r26 2b598: e4 56 subi r30, 0x64 ; 100 2b59a: f1 4f sbci r31, 0xF1 ; 241 2b59c: 44 88 ldd r4, Z+20 ; 0x14 2b59e: 55 88 ldd r5, Z+21 ; 0x15 2b5a0: 71 2c mov r7, r1 2b5a2: 61 2c mov r6, r1 2b5a4: 32 01 movw r6, r4 2b5a6: 55 24 eor r5, r5 2b5a8: 44 24 eor r4, r4 2b5aa: d8 01 movw r26, r16 2b5ac: 55 96 adiw r26, 0x15 ; 21 2b5ae: 4d 92 st X+, r4 2b5b0: 5d 92 st X+, r5 2b5b2: 6d 92 st X+, r6 2b5b4: 7c 92 st X, r7 2b5b6: 58 97 sbiw r26, 0x18 ; 24 firstCluster_ |= p->firstClusterLow; 2b5b8: 42 8d ldd r20, Z+26 ; 0x1a 2b5ba: 53 8d ldd r21, Z+27 ; 0x1b 2b5bc: 70 e0 ldi r23, 0x00 ; 0 2b5be: 60 e0 ldi r22, 0x00 ; 0 2b5c0: 44 29 or r20, r4 2b5c2: 55 29 or r21, r5 2b5c4: 66 29 or r22, r6 2b5c6: 77 29 or r23, r7 2b5c8: 55 96 adiw r26, 0x15 ; 21 2b5ca: 4d 93 st X+, r20 2b5cc: 5d 93 st X+, r21 2b5ce: 6d 93 st X+, r22 2b5d0: 7c 93 st X, r23 2b5d2: 58 97 sbiw r26, 0x18 ; 24 2b5d4: d9 01 movw r26, r18 2b5d6: 1b 96 adiw r26, 0x0b ; 11 2b5d8: 2c 91 ld r18, X 2b5da: 28 71 andi r18, 0x18 ; 24 // make sure it is a normal file or subdirectory if (DIR_IS_FILE(p)) { 2b5dc: 09 f0 breq .+2 ; 0x2b5e0 2b5de: b9 c0 rjmp .+370 ; 0x2b752 fileSize_ = p->fileSize; 2b5e0: 84 8d ldd r24, Z+28 ; 0x1c 2b5e2: 95 8d ldd r25, Z+29 ; 0x1d 2b5e4: a6 8d ldd r26, Z+30 ; 0x1e 2b5e6: b7 8d ldd r27, Z+31 ; 0x1f 2b5e8: f8 01 movw r30, r16 2b5ea: 81 8b std Z+17, r24 ; 0x11 2b5ec: 92 8b std Z+18, r25 ; 0x12 2b5ee: a3 8b std Z+19, r26 ; 0x13 2b5f0: b4 8b std Z+20, r27 ; 0x14 type_ = FAT_FILE_TYPE_NORMAL; 2b5f2: 81 e0 ldi r24, 0x01 ; 1 2b5f4: 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; 2b5f6: 8c 2d mov r24, r12 2b5f8: 8f 70 andi r24, 0x0F ; 15 2b5fa: f8 01 movw r30, r16 2b5fc: 81 83 std Z+1, r24 ; 0x01 // set to start of file curCluster_ = 0; 2b5fe: 14 82 std Z+4, r1 ; 0x04 2b600: 15 82 std Z+5, r1 ; 0x05 2b602: 16 82 std Z+6, r1 ; 0x06 2b604: 17 82 std Z+7, r1 ; 0x07 curPosition_ = 0; 2b606: 10 86 std Z+8, r1 ; 0x08 2b608: 11 86 std Z+9, r1 ; 0x09 2b60a: 12 86 std Z+10, r1 ; 0x0a 2b60c: 13 86 std Z+11, r1 ; 0x0b if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; 2b60e: 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; 2b610: c4 fe sbrs r12, 4 2b612: 03 c0 rjmp .+6 ; 0x2b61a 2b614: c8 01 movw r24, r16 2b616: 0f 94 38 76 call 0x2ec70 ; 0x2ec70 // open entry in cache return openCachedEntry(index, oflag); fail: return false; } 2b61a: 0f 90 pop r0 2b61c: df 91 pop r29 2b61e: cf 91 pop r28 2b620: 1f 91 pop r17 2b622: 0f 91 pop r16 2b624: ff 90 pop r15 2b626: ef 90 pop r14 2b628: df 90 pop r13 2b62a: cf 90 pop r12 2b62c: bf 90 pop r11 2b62e: af 90 pop r10 2b630: 7f 90 pop r7 2b632: 6f 90 pop r6 2b634: 5f 90 pop r5 2b636: 4f 90 pop r4 2b638: 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; 2b63a: d7 01 movw r26, r14 2b63c: 13 96 adiw r26, 0x03 ; 3 2b63e: 8c 91 ld r24, X 2b640: 13 97 sbiw r26, 0x03 ; 3 2b642: 82 30 cpi r24, 0x02 ; 2 2b644: 09 f4 brne .+2 ; 0x2b648 2b646: 0c cf rjmp .-488 ; 0x2b460 // 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; 2b648: 51 96 adiw r26, 0x11 ; 17 2b64a: 8d 91 ld r24, X+ 2b64c: 9d 91 ld r25, X+ 2b64e: 0d 90 ld r0, X+ 2b650: bc 91 ld r27, X 2b652: a0 2d mov r26, r0 2b654: 80 3e cpi r24, 0xE0 ; 224 2b656: 9f 4f sbci r25, 0xFF ; 255 2b658: af 41 sbci r26, 0x1F ; 31 2b65a: b1 05 cpc r27, r1 2b65c: 08 f0 brcs .+2 ; 0x2b660 2b65e: 00 cf rjmp .-512 ; 0x2b460 if (!addCluster()) goto fail; 2b660: c7 01 movw r24, r14 2b662: 0f 94 e1 56 call 0x2adc2 ; 0x2adc2 2b666: 88 23 and r24, r24 2b668: 09 f4 brne .+2 ; 0x2b66c 2b66a: fa ce rjmp .-524 ; 0x2b460 if (!vol_->cacheFlush()) goto fail; 2b66c: 0f 94 d0 52 call 0x2a5a0 ; 0x2a5a0 2b670: 88 23 and r24, r24 2b672: 09 f4 brne .+2 ; 0x2b676 2b674: f5 ce rjmp .-534 ; 0x2b460 block = vol_->clusterStartBlock(curCluster_); 2b676: d7 01 movw r26, r14 2b678: 59 96 adiw r26, 0x19 ; 25 2b67a: ed 91 ld r30, X+ 2b67c: fc 91 ld r31, X 2b67e: 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_);} 2b680: 14 96 adiw r26, 0x04 ; 4 2b682: 4d 90 ld r4, X+ 2b684: 5d 90 ld r5, X+ 2b686: 6d 90 ld r6, X+ 2b688: 7c 90 ld r7, X 2b68a: 17 97 sbiw r26, 0x07 ; 7 2b68c: b2 e0 ldi r27, 0x02 ; 2 2b68e: 4b 1a sub r4, r27 2b690: 51 08 sbc r5, r1 2b692: 61 08 sbc r6, r1 2b694: 71 08 sbc r7, r1 2b696: 85 85 ldd r24, Z+13 ; 0x0d 2b698: 04 c0 rjmp .+8 ; 0x2b6a2 2b69a: 44 0c add r4, r4 2b69c: 55 1c adc r5, r5 2b69e: 66 1c adc r6, r6 2b6a0: 77 1c adc r7, r7 2b6a2: 8a 95 dec r24 2b6a4: d2 f7 brpl .-12 ; 0x2b69a 2b6a6: 86 85 ldd r24, Z+14 ; 0x0e 2b6a8: 97 85 ldd r25, Z+15 ; 0x0f 2b6aa: a0 89 ldd r26, Z+16 ; 0x10 2b6ac: b1 89 ldd r27, Z+17 ; 0x11 2b6ae: 48 0e add r4, r24 2b6b0: 59 1e adc r5, r25 2b6b2: 6a 1e adc r6, r26 2b6b4: 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; 2b6b6: 81 e0 ldi r24, 0x01 ; 1 2b6b8: 80 93 98 0e sts 0x0E98, r24 ; 0x800e98 cacheBlockNumber_ = blockNumber; 2b6bc: 40 92 90 0e sts 0x0E90, r4 ; 0x800e90 2b6c0: 50 92 91 0e sts 0x0E91, r5 ; 0x800e91 2b6c4: 60 92 92 0e sts 0x0E92, r6 ; 0x800e92 2b6c8: 70 92 93 0e sts 0x0E93, r7 ; 0x800e93 // set cache to first block of cluster vol_->cacheSetBlockNumber(block, true); // zero first block of cluster memset(vol_->cacheBuffer_.data, 0, 512); 2b6cc: ec e9 ldi r30, 0x9C ; 156 2b6ce: fe e0 ldi r31, 0x0E ; 14 2b6d0: 80 e0 ldi r24, 0x00 ; 0 2b6d2: 92 e0 ldi r25, 0x02 ; 2 2b6d4: df 01 movw r26, r30 2b6d6: 9c 01 movw r18, r24 2b6d8: 1d 92 st X+, r1 2b6da: 21 50 subi r18, 0x01 ; 1 2b6dc: 30 40 sbci r19, 0x00 ; 0 2b6de: e1 f7 brne .-8 ; 0x2b6d8 // zero rest of cluster for (uint8_t i = 1; i < vol_->blocksPerCluster_; i++) { 2b6e0: dd 24 eor r13, r13 2b6e2: d3 94 inc r13 2b6e4: d7 01 movw r26, r14 2b6e6: 59 96 adiw r26, 0x19 ; 25 2b6e8: ed 91 ld r30, X+ 2b6ea: fc 91 ld r31, X 2b6ec: 84 81 ldd r24, Z+4 ; 0x04 2b6ee: d8 16 cp r13, r24 2b6f0: 98 f4 brcc .+38 ; 0x2b718 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); 2b6f2: 2c e9 ldi r18, 0x9C ; 156 2b6f4: 3e e0 ldi r19, 0x0E ; 14 2b6f6: b3 01 movw r22, r6 2b6f8: a2 01 movw r20, r4 2b6fa: 4d 0d add r20, r13 2b6fc: 51 1d adc r21, r1 2b6fe: 61 1d adc r22, r1 2b700: 71 1d adc r23, r1 2b702: 80 91 99 0e lds r24, 0x0E99 ; 0x800e99 2b706: 90 91 9a 0e lds r25, 0x0E9A ; 0x800e9a 2b70a: 0f 94 6c 52 call 0x2a4d8 ; 0x2a4d8 if (!vol_->writeBlock(block + i, vol_->cacheBuffer_.data)) goto fail; 2b70e: 88 23 and r24, r24 2b710: 09 f4 brne .+2 ; 0x2b714 2b712: a6 ce rjmp .-692 ; 0x2b460 // zero first block of cluster memset(vol_->cacheBuffer_.data, 0, 512); // zero rest of cluster for (uint8_t i = 1; i < vol_->blocksPerCluster_; i++) { 2b714: d3 94 inc r13 2b716: e6 cf rjmp .-52 ; 0x2b6e4 if (!vol_->writeBlock(block + i, vol_->cacheBuffer_.data)) goto fail; } // Increase directory file size by cluster size fileSize_ += 512UL << vol_->clusterSizeShift_; 2b718: 25 85 ldd r18, Z+13 ; 0x0d 2b71a: 80 e0 ldi r24, 0x00 ; 0 2b71c: 92 e0 ldi r25, 0x02 ; 2 2b71e: a0 e0 ldi r26, 0x00 ; 0 2b720: b0 e0 ldi r27, 0x00 ; 0 2b722: 04 c0 rjmp .+8 ; 0x2b72c 2b724: 88 0f add r24, r24 2b726: 99 1f adc r25, r25 2b728: aa 1f adc r26, r26 2b72a: bb 1f adc r27, r27 2b72c: 2a 95 dec r18 2b72e: d2 f7 brpl .-12 ; 0x2b724 2b730: f7 01 movw r30, r14 2b732: 41 89 ldd r20, Z+17 ; 0x11 2b734: 52 89 ldd r21, Z+18 ; 0x12 2b736: 63 89 ldd r22, Z+19 ; 0x13 2b738: 74 89 ldd r23, Z+20 ; 0x14 2b73a: 84 0f add r24, r20 2b73c: 95 1f adc r25, r21 2b73e: a6 1f adc r26, r22 2b740: b7 1f adc r27, r23 2b742: 81 8b std Z+17, r24 ; 0x11 2b744: 92 8b std Z+18, r25 ; 0x12 2b746: a3 8b std Z+19, r26 ; 0x13 2b748: 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; 2b74a: 8c e9 ldi r24, 0x9C ; 156 2b74c: 9e e0 ldi r25, 0x0E ; 14 index = 0; 2b74e: d1 2c mov r13, r1 2b750: db ce rjmp .-586 ; 0x2b508 // 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)) { 2b752: 20 31 cpi r18, 0x10 ; 16 2b754: 61 f4 brne .+24 ; 0x2b76e if (!vol_->chainSize(firstCluster_, &fileSize_)) goto fail; 2b756: 98 01 movw r18, r16 2b758: 2f 5e subi r18, 0xEF ; 239 2b75a: 3f 4f sbci r19, 0xFF ; 255 2b75c: 0f 94 1a 55 call 0x2aa34 ; 0x2aa34 2b760: 88 23 and r24, r24 2b762: 29 f0 breq .+10 ; 0x2b76e type_ = FAT_FILE_TYPE_SUBDIR; 2b764: 84 e0 ldi r24, 0x04 ; 4 2b766: d8 01 movw r26, r16 2b768: 13 96 adiw r26, 0x03 ; 3 2b76a: 8c 93 st X, r24 2b76c: 44 cf rjmp .-376 ; 0x2b5f6 curPosition_ = 0; if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; fail: type_ = FAT_FILE_TYPE_CLOSED; 2b76e: d8 01 movw r26, r16 2b770: 13 96 adiw r26, 0x03 ; 3 2b772: 1c 92 st X, r1 2b774: 75 ce rjmp .-790 ; 0x2b460 0002b776 : // version of uvlo_() which doesn't overwrite the print state already waiting in EEPROM uvlo_tiny(); } } void recover_print(uint8_t automatic) { 2b776: 4f 92 push r4 2b778: 5f 92 push r5 2b77a: 6f 92 push r6 2b77c: 7f 92 push r7 2b77e: 8f 92 push r8 2b780: 9f 92 push r9 2b782: af 92 push r10 2b784: bf 92 push r11 2b786: cf 92 push r12 2b788: df 92 push r13 2b78a: ef 92 push r14 2b78c: ff 92 push r15 2b78e: 0f 93 push r16 2b790: 1f 93 push r17 2b792: cf 93 push r28 2b794: df 93 push r29 2b796: 1f 92 push r1 2b798: 1f 92 push r1 2b79a: cd b7 in r28, 0x3d ; 61 2b79c: de b7 in r29, 0x3e ; 62 2b79e: a8 2e mov r10, r24 lcd_setstatuspgm(_T(MSG_RECOVERING_PRINT)); 2b7a0: 85 ed ldi r24, 0xD5 ; 213 2b7a2: 9d e4 ldi r25, 0x4D ; 77 2b7a4: 0e 94 c4 72 call 0xe588 ; 0xe588 2b7a8: 0e 94 38 f1 call 0x1e270 ; 0x1e270 gcode_M114(); } bool recover_machine_state_after_power_panic() { // 1) Preset some dummy values for the XY axes current_position[X_AXIS] = 0; 2b7ac: 10 92 91 06 sts 0x0691, r1 ; 0x800691 2b7b0: 10 92 92 06 sts 0x0692, r1 ; 0x800692 2b7b4: 10 92 93 06 sts 0x0693, r1 ; 0x800693 2b7b8: 10 92 94 06 sts 0x0694, r1 ; 0x800694 current_position[Y_AXIS] = 0; 2b7bc: 10 92 95 06 sts 0x0695, r1 ; 0x800695 2b7c0: 10 92 96 06 sts 0x0696, r1 ; 0x800696 2b7c4: 10 92 97 06 sts 0x0697, r1 ; 0x800697 2b7c8: 10 92 98 06 sts 0x0698, r1 ; 0x800698 2b7cc: 9e ea ldi r25, 0xAE ; 174 2b7ce: e9 2e mov r14, r25 2b7d0: 9d e0 ldi r25, 0x0D ; 13 2b7d2: f9 2e mov r15, r25 // 2) Restore the mesh bed leveling offsets, but not the MBL status. // This is 2*7*7=98 bytes, which takes 98*3.4us=333us in worst case. bool mbl_was_active = false; 2b7d4: d1 2c mov r13, r1 for (int8_t mesh_point = 0; mesh_point < MESH_NUM_X_POINTS * MESH_NUM_Y_POINTS; ++ mesh_point) { 2b7d6: c1 2c mov r12, r1 uint8_t ix = mesh_point % MESH_NUM_X_POINTS; // from 0 to MESH_NUM_X_POINTS - 1 2b7d8: 27 e0 ldi r18, 0x07 ; 7 2b7da: b2 2e mov r11, r18 2b7dc: 8c 2d mov r24, r12 2b7de: 6b 2d mov r22, r11 2b7e0: 0f 94 92 dc call 0x3b924 ; 0x3b924 <__divmodqi4> 2b7e4: 08 2f mov r16, r24 2b7e6: 99 2e mov r9, r25 uint8_t iy = mesh_point / MESH_NUM_X_POINTS; // Scale the z value to 10u resolution. int16_t v; eeprom_read_block(&v, (void*)(EEPROM_UVLO_MESH_BED_LEVELING_FULL+2*mesh_point), 2); 2b7e8: 42 e0 ldi r20, 0x02 ; 2 2b7ea: 50 e0 ldi r21, 0x00 ; 0 2b7ec: b7 01 movw r22, r14 2b7ee: ce 01 movw r24, r28 2b7f0: 01 96 adiw r24, 0x01 ; 1 2b7f2: 0f 94 c7 db call 0x3b78e ; 0x3b78e if (v != 0) 2b7f6: 69 81 ldd r22, Y+1 ; 0x01 2b7f8: 7a 81 ldd r23, Y+2 ; 0x02 2b7fa: 61 15 cp r22, r1 2b7fc: 71 05 cpc r23, r1 2b7fe: 11 f0 breq .+4 ; 0x2b804 mbl_was_active = true; 2b800: dd 24 eor r13, r13 2b802: d3 94 inc r13 mbl.z_values[iy][ix] = float(v) * 0.001f; 2b804: 2b 2d mov r18, r11 2b806: 02 03 mulsu r16, r18 2b808: 80 01 movw r16, r0 2b80a: 11 24 eor r1, r1 2b80c: 09 0d add r16, r9 2b80e: 11 1d adc r17, r1 2b810: 97 fc sbrc r9, 7 2b812: 1a 95 dec r17 2b814: 00 0f add r16, r16 2b816: 11 1f adc r17, r17 2b818: 00 0f add r16, r16 2b81a: 11 1f adc r17, r17 2b81c: 0f 53 subi r16, 0x3F ; 63 2b81e: 1c 4e sbci r17, 0xEC ; 236 2b820: 07 2e mov r0, r23 2b822: 00 0c add r0, r0 2b824: 88 0b sbc r24, r24 2b826: 99 0b sbc r25, r25 2b828: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 2b82c: 2f e6 ldi r18, 0x6F ; 111 2b82e: 32 e1 ldi r19, 0x12 ; 18 2b830: 43 e8 ldi r20, 0x83 ; 131 2b832: 5a e3 ldi r21, 0x3A ; 58 2b834: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 2b838: f8 01 movw r30, r16 2b83a: 61 83 std Z+1, r22 ; 0x01 2b83c: 72 83 std Z+2, r23 ; 0x02 2b83e: 83 83 std Z+3, r24 ; 0x03 2b840: 94 83 std Z+4, r25 ; 0x04 2b842: f2 e0 ldi r31, 0x02 ; 2 2b844: ef 0e add r14, r31 2b846: f1 1c adc r15, r1 2b848: c3 94 inc r12 current_position[Y_AXIS] = 0; // 2) Restore the mesh bed leveling offsets, but not the MBL status. // This is 2*7*7=98 bytes, which takes 98*3.4us=333us in worst case. bool mbl_was_active = false; for (int8_t mesh_point = 0; mesh_point < MESH_NUM_X_POINTS * MESH_NUM_Y_POINTS; ++ mesh_point) { 2b84a: 21 e3 ldi r18, 0x31 ; 49 2b84c: c2 12 cpse r12, r18 2b84e: c6 cf rjmp .-116 ; 0x2b7dc mbl.z_values[iy][ix] = float(v) * 0.001f; } // Recover the physical coordinate of the Z axis at the time of the power panic. // The current position after power panic is moved to the next closest 0th full step. current_position[Z_AXIS] = eeprom_read_float((float*)(EEPROM_UVLO_TINY_CURRENT_POSITION_Z)); 2b850: 8a ed ldi r24, 0xDA ; 218 2b852: 9e e0 ldi r25, 0x0E ; 14 2b854: 0f 94 df db call 0x3b7be ; 0x3b7be 2b858: 60 93 99 06 sts 0x0699, r22 ; 0x800699 2b85c: 70 93 9a 06 sts 0x069A, r23 ; 0x80069a 2b860: 80 93 9b 06 sts 0x069B, r24 ; 0x80069b 2b864: 90 93 9c 06 sts 0x069C, r25 ; 0x80069c // Recover last E axis position current_position[E_AXIS] = eeprom_read_float((float*)(EEPROM_UVLO_CURRENT_POSITION_E)); 2b868: 8e e6 ldi r24, 0x6E ; 110 2b86a: 9f e0 ldi r25, 0x0F ; 15 2b86c: 0f 94 df db call 0x3b7be ; 0x3b7be 2b870: 60 93 9d 06 sts 0x069D, r22 ; 0x80069d 2b874: 70 93 9e 06 sts 0x069E, r23 ; 0x80069e 2b878: 80 93 9f 06 sts 0x069F, r24 ; 0x80069f 2b87c: 90 93 a0 06 sts 0x06A0, r25 ; 0x8006a0 // 3) Initialize the logical to physical coordinate system transformation. world2machine_initialize(); 2b880: 0f 94 56 ce call 0x39cac ; 0x39cac // 4) Load the baby stepping value, which is expected to be active at the time of power panic. // The baby stepping value is used to reset the physical Z axis when rehoming the Z axis. babystep_load(); 2b884: 0f 94 40 c9 call 0x39280 ; 0x39280 // 5) Set the physical positions from the logical positions using the world2machine transformation // This is only done to inizialize Z/E axes with physical locations, since X/Y are unknown. clamp_to_software_endstops(current_position); 2b888: 81 e9 ldi r24, 0x91 ; 145 2b88a: 96 e0 ldi r25, 0x06 ; 6 2b88c: 0e 94 e1 6b call 0xd7c2 ; 0xd7c2 set_destination_to_current(); 2b890: 0e 94 52 68 call 0xd0a4 ; 0xd0a4 plan_set_position_curposXYZE(); 2b894: 0f 94 c4 be call 0x37d88 ; 0x37d88 SERIAL_ECHOPGM("recover_machine_state_after_power_panic, initial "); 2b898: 82 e7 ldi r24, 0x72 ; 114 2b89a: 9f e8 ldi r25, 0x8F ; 143 2b89c: 0e 94 68 77 call 0xeed0 ; 0xeed0 saved_printing = false; } void print_world_coordinates() { printf_P(_N("world coordinates: (%.3f, %.3f, %.3f)\n"), current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS]); 2b8a0: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 2b8a4: 8f 93 push r24 2b8a6: 80 91 9b 06 lds r24, 0x069B ; 0x80069b 2b8aa: 8f 93 push r24 2b8ac: 80 91 9a 06 lds r24, 0x069A ; 0x80069a 2b8b0: 8f 93 push r24 2b8b2: 80 91 99 06 lds r24, 0x0699 ; 0x800699 2b8b6: 8f 93 push r24 2b8b8: 80 91 98 06 lds r24, 0x0698 ; 0x800698 2b8bc: 8f 93 push r24 2b8be: 80 91 97 06 lds r24, 0x0697 ; 0x800697 2b8c2: 8f 93 push r24 2b8c4: 80 91 96 06 lds r24, 0x0696 ; 0x800696 2b8c8: 8f 93 push r24 2b8ca: 80 91 95 06 lds r24, 0x0695 ; 0x800695 2b8ce: 8f 93 push r24 2b8d0: 80 91 94 06 lds r24, 0x0694 ; 0x800694 2b8d4: 8f 93 push r24 2b8d6: 80 91 93 06 lds r24, 0x0693 ; 0x800693 2b8da: 8f 93 push r24 2b8dc: 80 91 92 06 lds r24, 0x0692 ; 0x800692 2b8e0: 8f 93 push r24 2b8e2: 80 91 91 06 lds r24, 0x0691 ; 0x800691 2b8e6: 8f 93 push r24 2b8e8: 89 e3 ldi r24, 0x39 ; 57 2b8ea: 9e e6 ldi r25, 0x6E ; 110 2b8ec: 9f 93 push r25 2b8ee: 8f 93 push r24 2b8f0: 0f 94 99 da call 0x3b532 ; 0x3b532 print_world_coordinates(); // 6) Power up the Z motors, mark their positions as known. axis_known_position[Z_AXIS] = true; 2b8f4: 81 e0 ldi r24, 0x01 ; 1 2b8f6: 80 93 90 06 sts 0x0690, r24 ; 0x800690 enable_z(); 2b8fa: 15 98 cbi 0x02, 5 ; 2 // 7) Recover the target temperatures. target_temperature[active_extruder] = eeprom_read_word((uint16_t*)EEPROM_UVLO_TARGET_HOTEND); 2b8fc: 88 ed ldi r24, 0xD8 ; 216 2b8fe: 9e e0 ldi r25, 0x0E ; 14 2b900: 0f 94 e5 db call 0x3b7ca ; 0x3b7ca 2b904: 90 93 b6 0d sts 0x0DB6, r25 ; 0x800db6 2b908: 80 93 b5 0d sts 0x0DB5, r24 ; 0x800db5 target_temperature_bed = eeprom_read_byte((uint8_t*)EEPROM_UVLO_TARGET_BED); 2b90c: 8b e8 ldi r24, 0x8B ; 139 2b90e: 9f e0 ldi r25, 0x0F ; 15 2b910: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 2b914: 90 e0 ldi r25, 0x00 ; 0 2b916: 90 93 72 06 sts 0x0672, r25 ; 0x800672 2b91a: 80 93 71 06 sts 0x0671, r24 ; 0x800671 // 8) Recover extruder multipilers extruder_multiplier[0] = eeprom_read_float((float*)(EEPROM_EXTRUDER_MULTIPLIER_0)); 2b91e: 88 ee ldi r24, 0xE8 ; 232 2b920: 9e e0 ldi r25, 0x0E ; 14 2b922: 0f 94 df db call 0x3b7be ; 0x3b7be 2b926: 60 93 93 02 sts 0x0293, r22 ; 0x800293 2b92a: 70 93 94 02 sts 0x0294, r23 ; 0x800294 2b92e: 80 93 95 02 sts 0x0295, r24 ; 0x800295 2b932: 90 93 96 02 sts 0x0296, r25 ; 0x800296 extrudemultiply = (int)eeprom_read_word((uint16_t*)(EEPROM_EXTRUDEMULTIPLY)); 2b936: 8e ed ldi r24, 0xDE ; 222 2b938: 9e e0 ldi r25, 0x0E ; 14 2b93a: 0f 94 e5 db call 0x3b7ca ; 0x3b7ca 2b93e: 90 93 bd 02 sts 0x02BD, r25 ; 0x8002bd 2b942: 80 93 bc 02 sts 0x02BC, r24 ; 0x8002bc // 9) Recover the saved target eeprom_read_block(saved_start_position, (float *)EEPROM_UVLO_SAVED_START_POSITION, sizeof(saved_start_position)); 2b946: 40 e1 ldi r20, 0x10 ; 16 2b948: 50 e0 ldi r21, 0x00 ; 0 2b94a: 67 e3 ldi r22, 0x37 ; 55 2b94c: 7d e0 ldi r23, 0x0D ; 13 2b94e: 83 e8 ldi r24, 0x83 ; 131 2b950: 92 e0 ldi r25, 0x02 ; 2 2b952: 0f 94 c7 db call 0x3b78e ; 0x3b78e saved_segment_idx = eeprom_read_word((uint16_t*)EEPROM_UVLO_SAVED_SEGMENT_IDX); 2b956: 8c e6 ldi r24, 0x6C ; 108 2b958: 9f e0 ldi r25, 0x0F ; 15 2b95a: 0f 94 e5 db call 0x3b7ca ; 0x3b7ca 2b95e: 90 93 69 05 sts 0x0569, r25 ; 0x800569 2b962: 80 93 68 05 sts 0x0568, r24 ; 0x800568 #ifdef LIN_ADVANCE extruder_advance_K = eeprom_read_float((float*)EEPROM_UVLO_LA_K); 2b966: 8c e2 ldi r24, 0x2C ; 44 2b968: 9d e0 ldi r25, 0x0D ; 13 2b96a: 0f 94 df db call 0x3b7be ; 0x3b7be 2b96e: 60 93 64 05 sts 0x0564, r22 ; 0x800564 2b972: 70 93 65 05 sts 0x0565, r23 ; 0x800565 2b976: 80 93 66 05 sts 0x0566, r24 ; 0x800566 2b97a: 90 93 67 05 sts 0x0567, r25 ; 0x800567 #endif #ifdef PREVENT_DANGEROUS_EXTRUDE extrude_min_temp = eeprom_read_word((uint16_t*)EEPROM_UVLO_EXTRUDE_MINTEMP); 2b97e: 8d e7 ldi r24, 0x7D ; 125 2b980: 9c e0 ldi r25, 0x0C ; 12 2b982: 0f 94 e5 db call 0x3b7ca ; 0x3b7ca 2b986: 90 93 6c 02 sts 0x026C, r25 ; 0x80026c 2b98a: 80 93 6b 02 sts 0x026B, r24 ; 0x80026b #endif //PREVENT_DANGEROUS_EXTRUDE eeprom_read_block(cs.max_acceleration_mm_per_s2_normal, (uint32_t *)EEPROM_UVLO_ACCELL_MM_S2_NORMAL, sizeof(cs.max_acceleration_mm_per_s2_normal)); 2b98e: 40 e1 ldi r20, 0x10 ; 16 2b990: 50 e0 ldi r21, 0x00 ; 0 2b992: 6d e6 ldi r22, 0x6D ; 109 2b994: 7c e0 ldi r23, 0x0C ; 12 2b996: 81 ee ldi r24, 0xE1 ; 225 2b998: 9d e0 ldi r25, 0x0D ; 13 2b99a: 0f 94 c7 db call 0x3b78e ; 0x3b78e eeprom_read_block(cs.max_acceleration_mm_per_s2_silent, (uint32_t *)EEPROM_UVLO_ACCELL_MM_S2_SILENT, sizeof(cs.max_acceleration_mm_per_s2_silent)); 2b99e: 40 e1 ldi r20, 0x10 ; 16 2b9a0: 50 e0 ldi r21, 0x00 ; 0 2b9a2: 6d e5 ldi r22, 0x5D ; 93 2b9a4: 7c e0 ldi r23, 0x0C ; 12 2b9a6: 89 e6 ldi r24, 0x69 ; 105 2b9a8: 9e e0 ldi r25, 0x0E ; 14 2b9aa: 0f 94 c7 db call 0x3b78e ; 0x3b78e eeprom_read_block(cs.max_feedrate_normal, (float *)EEPROM_UVLO_MAX_FEEDRATE_NORMAL, sizeof(cs.max_feedrate_normal)); 2b9ae: 40 e1 ldi r20, 0x10 ; 16 2b9b0: 50 e0 ldi r21, 0x00 ; 0 2b9b2: 6d e4 ldi r22, 0x4D ; 77 2b9b4: 7c e0 ldi r23, 0x0C ; 12 2b9b6: 81 ed ldi r24, 0xD1 ; 209 2b9b8: 9d e0 ldi r25, 0x0D ; 13 2b9ba: 0f 94 c7 db call 0x3b78e ; 0x3b78e eeprom_read_block(cs.max_feedrate_silent, (float *)EEPROM_UVLO_MAX_FEEDRATE_SILENT, sizeof(cs.max_feedrate_silent)); 2b9be: 40 e1 ldi r20, 0x10 ; 16 2b9c0: 50 e0 ldi r21, 0x00 ; 0 2b9c2: 6d e3 ldi r22, 0x3D ; 61 2b9c4: 7c e0 ldi r23, 0x0C ; 12 2b9c6: 89 e5 ldi r24, 0x59 ; 89 2b9c8: 9e e0 ldi r25, 0x0E ; 14 2b9ca: 0f 94 c7 db call 0x3b78e ; 0x3b78e cs.minimumfeedrate = eeprom_read_float((float *)EEPROM_UVLO_MIN_FEEDRATE); 2b9ce: 89 e3 ldi r24, 0x39 ; 57 2b9d0: 9c e0 ldi r25, 0x0C ; 12 2b9d2: 0f 94 df db call 0x3b7be ; 0x3b7be 2b9d6: 60 93 f9 0d sts 0x0DF9, r22 ; 0x800df9 2b9da: 70 93 fa 0d sts 0x0DFA, r23 ; 0x800dfa 2b9de: 80 93 fb 0d sts 0x0DFB, r24 ; 0x800dfb 2b9e2: 90 93 fc 0d sts 0x0DFC, r25 ; 0x800dfc cs.mintravelfeedrate = eeprom_read_float((float *)EEPROM_UVLO_MIN_TRAVEL_FEEDRATE); 2b9e6: 85 e3 ldi r24, 0x35 ; 53 2b9e8: 9c e0 ldi r25, 0x0C ; 12 2b9ea: 0f 94 df db call 0x3b7be ; 0x3b7be 2b9ee: 60 93 fd 0d sts 0x0DFD, r22 ; 0x800dfd 2b9f2: 70 93 fe 0d sts 0x0DFE, r23 ; 0x800dfe 2b9f6: 80 93 ff 0d sts 0x0DFF, r24 ; 0x800dff 2b9fa: 90 93 00 0e sts 0x0E00, r25 ; 0x800e00 cs.min_segment_time_us = eeprom_read_dword((uint32_t *)EEPROM_UVLO_MIN_SEGMENT_TIME_US); 2b9fe: 81 e3 ldi r24, 0x31 ; 49 2ba00: 9c e0 ldi r25, 0x0C ; 12 2ba02: 0f 94 df db call 0x3b7be ; 0x3b7be 2ba06: 60 93 01 0e sts 0x0E01, r22 ; 0x800e01 2ba0a: 70 93 02 0e sts 0x0E02, r23 ; 0x800e02 2ba0e: 80 93 03 0e sts 0x0E03, r24 ; 0x800e03 2ba12: 90 93 04 0e sts 0x0E04, r25 ; 0x800e04 eeprom_read_block(cs.max_jerk, (float *)EEPROM_UVLO_MAX_JERK, sizeof(cs.max_jerk)); 2ba16: 40 e1 ldi r20, 0x10 ; 16 2ba18: 50 e0 ldi r21, 0x00 ; 0 2ba1a: 61 e2 ldi r22, 0x21 ; 33 2ba1c: 7c e0 ldi r23, 0x0C ; 12 2ba1e: 85 e0 ldi r24, 0x05 ; 5 2ba20: 9e e0 ldi r25, 0x0E ; 14 2ba22: 0f 94 c7 db call 0x3b78e ; 0x3b78e bool mbl_was_active = recover_machine_state_after_power_panic(); // Undo PP Z Lift by setting current Z pos to + Z_PAUSE_LIFT // With first PP or Pause + PP the Z has been already lift. // After a reboot the printer doesn't know the Z height and we have to set its previous value if(eeprom_read_byte((uint8_t*)EEPROM_UVLO_Z_LIFTED) == 1 ) { 2ba26: 8f e7 ldi r24, 0x7F ; 127 2ba28: 9c e0 ldi r25, 0x0C ; 12 2ba2a: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 2ba2e: 0f b6 in r0, 0x3f ; 63 2ba30: f8 94 cli 2ba32: de bf out 0x3e, r29 ; 62 2ba34: 0f be out 0x3f, r0 ; 63 2ba36: cd bf out 0x3d, r28 ; 61 2ba38: 81 30 cpi r24, 0x01 ; 1 2ba3a: b1 f4 brne .+44 ; 0x2ba68 current_position[Z_AXIS] += Z_PAUSE_LIFT; 2ba3c: 20 e0 ldi r18, 0x00 ; 0 2ba3e: 30 e0 ldi r19, 0x00 ; 0 2ba40: 40 ea ldi r20, 0xA0 ; 160 2ba42: 51 e4 ldi r21, 0x41 ; 65 2ba44: 60 91 99 06 lds r22, 0x0699 ; 0x800699 2ba48: 70 91 9a 06 lds r23, 0x069A ; 0x80069a 2ba4c: 80 91 9b 06 lds r24, 0x069B ; 0x80069b 2ba50: 90 91 9c 06 lds r25, 0x069C ; 0x80069c 2ba54: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 2ba58: 60 93 99 06 sts 0x0699, r22 ; 0x800699 2ba5c: 70 93 9a 06 sts 0x069A, r23 ; 0x80069a 2ba60: 80 93 9b 06 sts 0x069B, r24 ; 0x80069b 2ba64: 90 93 9c 06 sts 0x069C, r25 ; 0x80069c } // Lift the print head ONCE plus Z_PAUSE_LIFT first to avoid collisions with oozed material with the print, if(eeprom_read_byte((uint8_t*)EEPROM_UVLO_Z_LIFTED) == 0) { 2ba68: 8f e7 ldi r24, 0x7F ; 127 2ba6a: 9c e0 ldi r25, 0x0C ; 12 2ba6c: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 2ba70: 81 11 cpse r24, r1 2ba72: 23 c0 rjmp .+70 ; 0x2baba enquecommandf_P(PSTR("G1 Z%.3f F800"), current_position[Z_AXIS] + Z_PAUSE_LIFT); 2ba74: 20 e0 ldi r18, 0x00 ; 0 2ba76: 30 e0 ldi r19, 0x00 ; 0 2ba78: 40 ea ldi r20, 0xA0 ; 160 2ba7a: 51 e4 ldi r21, 0x41 ; 65 2ba7c: 60 91 99 06 lds r22, 0x0699 ; 0x800699 2ba80: 70 91 9a 06 lds r23, 0x069A ; 0x80069a 2ba84: 80 91 9b 06 lds r24, 0x069B ; 0x80069b 2ba88: 90 91 9c 06 lds r25, 0x069C ; 0x80069c 2ba8c: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 2ba90: 9f 93 push r25 2ba92: 8f 93 push r24 2ba94: 7f 93 push r23 2ba96: 6f 93 push r22 2ba98: 87 e7 ldi r24, 0x77 ; 119 2ba9a: 90 e9 ldi r25, 0x90 ; 144 2ba9c: 9f 93 push r25 2ba9e: 8f 93 push r24 2baa0: 0e 94 ce 88 call 0x1119c ; 0x1119c 2baa4: 61 e0 ldi r22, 0x01 ; 1 2baa6: 8f e7 ldi r24, 0x7F ; 127 2baa8: 9c e0 ldi r25, 0x0C ; 12 2baaa: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 2baae: 0f 90 pop r0 2bab0: 0f 90 pop r0 2bab2: 0f 90 pop r0 2bab4: 0f 90 pop r0 2bab6: 0f 90 pop r0 2bab8: 0f 90 pop r0 eeprom_update_byte_notify((uint8_t*)EEPROM_UVLO_Z_LIFTED, 1); } // Home X and Y axes. Homing just X and Y shall not touch the babystep and the world2machine // transformation status. G28 will not touch Z when MBL is off. enquecommand_P(PSTR("G28 X Y")); 2baba: 61 e0 ldi r22, 0x01 ; 1 2babc: 8f e6 ldi r24, 0x6F ; 111 2babe: 90 e9 ldi r25, 0x90 ; 144 2bac0: 0e 94 38 88 call 0x11070 ; 0x11070 // Set the target bed and nozzle temperatures and wait. enquecommandf_P(PSTR("M104 S%d"), target_temperature[active_extruder]); 2bac4: 80 91 b6 0d lds r24, 0x0DB6 ; 0x800db6 2bac8: 8f 93 push r24 2baca: 80 91 b5 0d lds r24, 0x0DB5 ; 0x800db5 2bace: 8f 93 push r24 2bad0: 86 e6 ldi r24, 0x66 ; 102 2bad2: 90 e9 ldi r25, 0x90 ; 144 2bad4: 9f 93 push r25 2bad6: 8f 93 push r24 2bad8: 0e 94 ce 88 call 0x1119c ; 0x1119c enquecommandf_P(PSTR("M140 S%d"), target_temperature_bed); 2badc: 80 91 72 06 lds r24, 0x0672 ; 0x800672 2bae0: 8f 93 push r24 2bae2: 80 91 71 06 lds r24, 0x0671 ; 0x800671 2bae6: 8f 93 push r24 2bae8: 8d e5 ldi r24, 0x5D ; 93 2baea: 90 e9 ldi r25, 0x90 ; 144 2baec: 9f 93 push r25 2baee: 8f 93 push r24 2baf0: 0e 94 ce 88 call 0x1119c ; 0x1119c //No need to wait for hotend heatup while host printing, as print will pause and wait for host. if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE) == PowerPanic::PRINT_TYPE_SD) { 2baf4: 8c e8 ldi r24, 0x8C ; 140 2baf6: 9f e0 ldi r25, 0x0F ; 15 2baf8: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 2bafc: 0f b6 in r0, 0x3f ; 63 2bafe: f8 94 cli 2bb00: de bf out 0x3e, r29 ; 62 2bb02: 0f be out 0x3f, r0 ; 63 2bb04: cd bf out 0x3d, r28 ; 61 2bb06: 81 11 cpse r24, r1 2bb08: 10 c0 rjmp .+32 ; 0x2bb2a enquecommandf_P(PSTR("M109 S%d"), target_temperature[active_extruder]); 2bb0a: 80 91 b6 0d lds r24, 0x0DB6 ; 0x800db6 2bb0e: 8f 93 push r24 2bb10: 80 91 b5 0d lds r24, 0x0DB5 ; 0x800db5 2bb14: 8f 93 push r24 2bb16: 84 e5 ldi r24, 0x54 ; 84 2bb18: 90 e9 ldi r25, 0x90 ; 144 2bb1a: 9f 93 push r25 2bb1c: 8f 93 push r24 2bb1e: 0e 94 ce 88 call 0x1119c ; 0x1119c 2bb22: 0f 90 pop r0 2bb24: 0f 90 pop r0 2bb26: 0f 90 pop r0 2bb28: 0f 90 pop r0 } enquecommand_P(MSG_M83); //E axis relative mode 2bb2a: 61 e0 ldi r22, 0x01 ; 1 2bb2c: 8a e1 ldi r24, 0x1A ; 26 2bb2e: 9c e6 ldi r25, 0x6C ; 108 2bb30: 0e 94 38 88 call 0x11070 ; 0x11070 // If not automatically recoreverd (long power loss) if(automatic == 0){ 2bb34: a1 10 cpse r10, r1 2bb36: 17 c0 rjmp .+46 ; 0x2bb66 //Extrude some filament to stabilize the pressure enquecommand_P(PSTR("G1 E5 F120")); 2bb38: 61 e0 ldi r22, 0x01 ; 1 2bb3a: 89 e4 ldi r24, 0x49 ; 73 2bb3c: 90 e9 ldi r25, 0x90 ; 144 2bb3e: 0e 94 38 88 call 0x11070 ; 0x11070 // Retract to be consistent with a short pause enquecommandf_P(G1_E_F2700, default_retraction); 2bb42: 8f e3 ldi r24, 0x3F ; 63 2bb44: 8f 93 push r24 2bb46: 80 e8 ldi r24, 0x80 ; 128 2bb48: 8f 93 push r24 2bb4a: 1f 92 push r1 2bb4c: 1f 92 push r1 2bb4e: 84 e9 ldi r24, 0x94 ; 148 2bb50: 9e e6 ldi r25, 0x6E ; 110 2bb52: 9f 93 push r25 2bb54: 8f 93 push r24 2bb56: 0e 94 ce 88 call 0x1119c ; 0x1119c 2bb5a: 0f 90 pop r0 2bb5c: 0f 90 pop r0 2bb5e: 0f 90 pop r0 2bb60: 0f 90 pop r0 2bb62: 0f 90 pop r0 2bb64: 0f 90 pop r0 } puts_P(_N("Temperature Restored\n")); 2bb66: 8e e7 ldi r24, 0x7E ; 126 2bb68: 9e e6 ldi r25, 0x6E ; 110 2bb6a: 0f 94 c0 da call 0x3b580 ; 0x3b580 gcode_M114(); 2bb6e: 0e 94 5f 78 call 0xf0be ; 0xf0be void restore_print_from_eeprom(bool mbl_was_active) { int feedrate_rec; int feedmultiply_rec; uint8_t fan_speed_rec; fan_speed_rec = eeprom_read_byte((uint8_t*)EEPROM_UVLO_FAN_SPEED); 2bb72: 88 e8 ldi r24, 0x88 ; 136 2bb74: 9f e0 ldi r25, 0x0F ; 15 2bb76: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 2bb7a: 88 2e mov r8, r24 feedrate_rec = eeprom_read_word((uint16_t*)EEPROM_UVLO_FEEDRATE); 2bb7c: 89 e8 ldi r24, 0x89 ; 137 2bb7e: 9f e0 ldi r25, 0x0F ; 15 2bb80: 0f 94 e5 db call 0x3b7ca ; 0x3b7ca 2bb84: 8c 01 movw r16, r24 feedmultiply_rec = eeprom_read_word((uint16_t*)EEPROM_UVLO_FEEDMULTIPLY); 2bb86: 85 e3 ldi r24, 0x35 ; 53 2bb88: 9d e0 ldi r25, 0x0D ; 13 2bb8a: 0f 94 e5 db call 0x3b7ca ; 0x3b7ca 2bb8e: f8 2e mov r15, r24 2bb90: e9 2e mov r14, r25 SERIAL_ECHOPGM("Feedrate:"); 2bb92: 8f e3 ldi r24, 0x3F ; 63 2bb94: 90 e9 ldi r25, 0x90 ; 144 2bb96: 0e 94 68 77 call 0xeed0 ; 0xeed0 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 2bb9a: b8 01 movw r22, r16 2bb9c: 01 2e mov r0, r17 2bb9e: 00 0c add r0, r0 2bba0: 88 0b sbc r24, r24 2bba2: 99 0b sbc r25, r25 2bba4: 0f 94 26 d5 call 0x3aa4c ; 0x3aa4c MYSERIAL.print(feedrate_rec); SERIAL_ECHOPGM(", feedmultiply:"); 2bba8: 8f e2 ldi r24, 0x2F ; 47 2bbaa: 90 e9 ldi r25, 0x90 ; 144 2bbac: 0e 94 68 77 call 0xeed0 ; 0xeed0 MYSERIAL.println(feedmultiply_rec); 2bbb0: 8f 2d mov r24, r15 2bbb2: 9e 2d mov r25, r14 2bbb4: 0f 94 b0 74 call 0x2e960 ; 0x2e960 if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) 2bbb8: 80 91 6a 02 lds r24, 0x026A ; 0x80026a 2bbbc: 81 11 cpse r24, r1 2bbbe: 02 c0 rjmp .+4 ; 0x2bbc4 { // M23 restore_file_from_sd(); 2bbc0: 0e 94 f3 88 call 0x111e6 ; 0x111e6 } // Move to the XY print position in logical coordinates, where the print has been killed, but // without shifting Z along the way. This requires performing the move without mbl. float pos_x = eeprom_read_float((float*)(EEPROM_UVLO_CURRENT_POSITION + 0)); 2bbc4: 8d e9 ldi r24, 0x9D ; 157 2bbc6: 9f e0 ldi r25, 0x0F ; 15 2bbc8: 0f 94 df db call 0x3b7be ; 0x3b7be 2bbcc: c6 2e mov r12, r22 2bbce: b7 2e mov r11, r23 2bbd0: a8 2e mov r10, r24 2bbd2: 99 2e mov r9, r25 float pos_y = eeprom_read_float((float*)(EEPROM_UVLO_CURRENT_POSITION + 4)); 2bbd4: 81 ea ldi r24, 0xA1 ; 161 2bbd6: 9f e0 ldi r25, 0x0F ; 15 2bbd8: 0f 94 df db call 0x3b7be ; 0x3b7be 2bbdc: 76 2e mov r7, r22 2bbde: 67 2e mov r6, r23 2bbe0: 58 2e mov r5, r24 2bbe2: 49 2e mov r4, r25 if (pos_x != X_COORD_INVALID) { 2bbe4: 20 e0 ldi r18, 0x00 ; 0 2bbe6: 30 e0 ldi r19, 0x00 ; 0 2bbe8: 40 e8 ldi r20, 0x80 ; 128 2bbea: 5f eb ldi r21, 0xBF ; 191 2bbec: 6c 2d mov r22, r12 2bbee: 7b 2d mov r23, r11 2bbf0: 8a 2d mov r24, r10 2bbf2: 99 2d mov r25, r9 2bbf4: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 2bbf8: 88 23 and r24, r24 2bbfa: 99 f0 breq .+38 ; 0x2bc22 enquecommandf_P(PSTR("G1 X%-.3f Y%-.3f F3000"), pos_x, pos_y); 2bbfc: 4f 92 push r4 2bbfe: 5f 92 push r5 2bc00: 6f 92 push r6 2bc02: 7f 92 push r7 2bc04: 9f 92 push r9 2bc06: af 92 push r10 2bc08: bf 92 push r11 2bc0a: cf 92 push r12 2bc0c: 88 e1 ldi r24, 0x18 ; 24 2bc0e: 90 e9 ldi r25, 0x90 ; 144 2bc10: 9f 93 push r25 2bc12: 8f 93 push r24 2bc14: 0e 94 ce 88 call 0x1119c ; 0x1119c 2bc18: 0f b6 in r0, 0x3f ; 63 2bc1a: f8 94 cli 2bc1c: de bf out 0x3e, r29 ; 62 2bc1e: 0f be out 0x3f, r0 ; 63 2bc20: cd bf out 0x3d, r28 ; 61 } // Enable MBL and switch to logical positioning if (mbl_was_active) 2bc22: dd 20 and r13, r13 2bc24: 29 f0 breq .+10 ; 0x2bc30 enquecommand_P(PSTR("PRUSA MBL V1")); 2bc26: 61 e0 ldi r22, 0x01 ; 1 2bc28: 8b e0 ldi r24, 0x0B ; 11 2bc2a: 90 e9 ldi r25, 0x90 ; 144 2bc2c: 0e 94 38 88 call 0x11070 ; 0x11070 // Move the Z axis down to the print, in logical coordinates. enquecommandf_P(PSTR("G1 Z%-.3f"), eeprom_read_float((float*)(EEPROM_UVLO_CURRENT_POSITION_Z))); 2bc30: 8d e8 ldi r24, 0x8D ; 141 2bc32: 9f e0 ldi r25, 0x0F ; 15 2bc34: 0f 94 df db call 0x3b7be ; 0x3b7be 2bc38: 9f 93 push r25 2bc3a: 8f 93 push r24 2bc3c: 7f 93 push r23 2bc3e: 6f 93 push r22 2bc40: 81 e0 ldi r24, 0x01 ; 1 2bc42: 90 e9 ldi r25, 0x90 ; 144 2bc44: 9f 93 push r25 2bc46: 8f 93 push r24 2bc48: 0e 94 ce 88 call 0x1119c ; 0x1119c // Restore acceleration settings float acceleration = eeprom_read_float((float*)(EEPROM_UVLO_ACCELL)); 2bc4c: 81 e1 ldi r24, 0x11 ; 17 2bc4e: 9d e0 ldi r25, 0x0D ; 13 2bc50: 0f 94 df db call 0x3b7be ; 0x3b7be 2bc54: d6 2e mov r13, r22 2bc56: c7 2e mov r12, r23 2bc58: b8 2e mov r11, r24 2bc5a: a9 2e mov r10, r25 float retract_acceleration = eeprom_read_float((float*)(EEPROM_UVLO_RETRACT_ACCELL)); 2bc5c: 8d e0 ldi r24, 0x0D ; 13 2bc5e: 9d e0 ldi r25, 0x0D ; 13 2bc60: 0f 94 df db call 0x3b7be ; 0x3b7be 2bc64: 96 2e mov r9, r22 2bc66: 77 2e mov r7, r23 2bc68: 68 2e mov r6, r24 2bc6a: 59 2e mov r5, r25 float travel_acceleration = eeprom_read_float((float*)(EEPROM_UVLO_TRAVEL_ACCELL)); 2bc6c: 89 e0 ldi r24, 0x09 ; 9 2bc6e: 9d e0 ldi r25, 0x0D ; 13 2bc70: 0f 94 df db call 0x3b7be ; 0x3b7be // accelerations are usually ordinary numbers, no need to keep extensive amount of decimal places enquecommandf_P(PSTR("M204 P%-.1f R%-.1f T%-.1f"), acceleration, retract_acceleration, travel_acceleration); 2bc74: 9f 93 push r25 2bc76: 8f 93 push r24 2bc78: 7f 93 push r23 2bc7a: 6f 93 push r22 2bc7c: 5f 92 push r5 2bc7e: 6f 92 push r6 2bc80: 7f 92 push r7 2bc82: 9f 92 push r9 2bc84: af 92 push r10 2bc86: bf 92 push r11 2bc88: cf 92 push r12 2bc8a: df 92 push r13 2bc8c: 87 ee ldi r24, 0xE7 ; 231 2bc8e: 9f e8 ldi r25, 0x8F ; 143 2bc90: 9f 93 push r25 2bc92: 8f 93 push r24 2bc94: 0e 94 ce 88 call 0x1119c ; 0x1119c // Unretract. enquecommandf_P(G1_E_F2700, default_retraction); 2bc98: 8f e3 ldi r24, 0x3F ; 63 2bc9a: 8f 93 push r24 2bc9c: 80 e8 ldi r24, 0x80 ; 128 2bc9e: 8f 93 push r24 2bca0: 1f 92 push r1 2bca2: 1f 92 push r1 2bca4: 84 e9 ldi r24, 0x94 ; 148 2bca6: 9e e6 ldi r25, 0x6E ; 110 2bca8: 9f 93 push r25 2bcaa: 8f 93 push r24 2bcac: 0e 94 ce 88 call 0x1119c ; 0x1119c // Recover final E axis position and mode float pos_e = eeprom_read_float((float*)(EEPROM_UVLO_CURRENT_POSITION_E)); 2bcb0: 8e e6 ldi r24, 0x6E ; 110 2bcb2: 9f e0 ldi r25, 0x0F ; 15 2bcb4: 0f 94 df db call 0x3b7be ; 0x3b7be enquecommandf_P(PSTR("G92 E%-.3f"), pos_e); 2bcb8: 9f 93 push r25 2bcba: 8f 93 push r24 2bcbc: 7f 93 push r23 2bcbe: 6f 93 push r22 2bcc0: 8c ed ldi r24, 0xDC ; 220 2bcc2: 9f e8 ldi r25, 0x8F ; 143 2bcc4: 9f 93 push r25 2bcc6: 8f 93 push r24 2bcc8: 0e 94 ce 88 call 0x1119c ; 0x1119c if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_E_ABS)) 2bccc: 0f b6 in r0, 0x3f ; 63 2bcce: f8 94 cli 2bcd0: de bf out 0x3e, r29 ; 62 2bcd2: 0f be out 0x3f, r0 ; 63 2bcd4: cd bf out 0x3d, r28 ; 61 2bcd6: 82 e7 ldi r24, 0x72 ; 114 2bcd8: 9f e0 ldi r25, 0x0F ; 15 2bcda: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 2bcde: 88 23 and r24, r24 2bce0: 29 f0 breq .+10 ; 0x2bcec enquecommand_P(PSTR("M82")); //E axis abslute mode 2bce2: 61 e0 ldi r22, 0x01 ; 1 2bce4: 88 ed ldi r24, 0xD8 ; 216 2bce6: 9f e8 ldi r25, 0x8F ; 143 2bce8: 0e 94 38 88 call 0x11070 ; 0x11070 // Set the feedrates saved at the power panic. enquecommandf_P(PSTR("G1 F%d"), feedrate_rec); 2bcec: 1f 93 push r17 2bcee: 0f 93 push r16 2bcf0: 81 ed ldi r24, 0xD1 ; 209 2bcf2: 9f e8 ldi r25, 0x8F ; 143 2bcf4: 9f 93 push r25 2bcf6: 8f 93 push r24 2bcf8: 0e 94 ce 88 call 0x1119c ; 0x1119c enquecommandf_P(MSG_M220, feedmultiply_rec); 2bcfc: ef 92 push r14 2bcfe: ff 92 push r15 2bd00: 80 e6 ldi r24, 0x60 ; 96 2bd02: 9e e6 ldi r25, 0x6E ; 110 2bd04: 9f 93 push r25 2bd06: 8f 93 push r24 2bd08: 0e 94 ce 88 call 0x1119c ; 0x1119c // Set the fan speed saved at the power panic. enquecommandf_P(PSTR("M106 S%u"), fan_speed_rec); 2bd0c: 1f 92 push r1 2bd0e: 8f 92 push r8 2bd10: 88 ec ldi r24, 0xC8 ; 200 2bd12: 9f e8 ldi r25, 0x8F ; 143 2bd14: 9f 93 push r25 2bd16: 8f 93 push r24 2bd18: 0e 94 ce 88 call 0x1119c ; 0x1119c // SD: Position in file, USB: g-code line number uint32_t position = eeprom_read_dword((uint32_t*)(EEPROM_FILE_POSITION)); 2bd1c: 81 e9 ldi r24, 0x91 ; 145 2bd1e: 9f e0 ldi r25, 0x0F ; 15 2bd20: 0f 94 df db call 0x3b7be ; 0x3b7be if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) 2bd24: 20 91 6a 02 lds r18, 0x026A ; 0x80026a 2bd28: 0f b6 in r0, 0x3f ; 63 2bd2a: f8 94 cli 2bd2c: de bf out 0x3e, r29 ; 62 2bd2e: 0f be out 0x3f, r0 ; 63 2bd30: cd bf out 0x3d, r28 ; 61 2bd32: 21 11 cpse r18, r1 2bd34: 33 c0 rjmp .+102 ; 0x2bd9c { // Set a position in the file. enquecommandf_P(PSTR("M26 S%lu"), position); 2bd36: 9f 93 push r25 2bd38: 8f 93 push r24 2bd3a: 7f 93 push r23 2bd3c: 6f 93 push r22 2bd3e: 8f eb ldi r24, 0xBF ; 191 2bd40: 9f e8 ldi r25, 0x8F ; 143 } else if (saved_printing_type == PowerPanic::PRINT_TYPE_HOST) { // Set line number enquecommandf_P(PSTR("M110 N%lu"), position); 2bd42: 9f 93 push r25 2bd44: 8f 93 push r24 2bd46: 0e 94 ce 88 call 0x1119c ; 0x1119c 2bd4a: 0f 90 pop r0 2bd4c: 0f 90 pop r0 2bd4e: 0f 90 pop r0 2bd50: 0f 90 pop r0 2bd52: 0f 90 pop r0 2bd54: 0f 90 pop r0 } enquecommand_P(PSTR("G4 S0")); 2bd56: 61 e0 ldi r22, 0x01 ; 1 2bd58: 8f ea ldi r24, 0xAF ; 175 2bd5a: 9f e8 ldi r25, 0x8F ; 143 2bd5c: 0e 94 38 88 call 0x11070 ; 0x11070 enquecommand_P(PSTR("PRUSA uvlo")); 2bd60: 61 e0 ldi r22, 0x01 ; 1 2bd62: 84 ea ldi r24, 0xA4 ; 164 2bd64: 9f e8 ldi r25, 0x8F ; 143 2bd66: 0e 94 38 88 call 0x11070 ; 0x11070 puts_P(_N("Temperature Restored\n")); gcode_M114(); // Restart the print. restore_print_from_eeprom(mbl_was_active); puts_P(_N("Done reading EEPROM\n")); 2bd6a: 89 e6 ldi r24, 0x69 ; 105 2bd6c: 9e e6 ldi r25, 0x6E ; 110 2bd6e: 0f 94 c0 da call 0x3b580 ; 0x3b580 gcode_M114(); 2bd72: 0e 94 5f 78 call 0xf0be ; 0xf0be } 2bd76: 0f 90 pop r0 2bd78: 0f 90 pop r0 2bd7a: df 91 pop r29 2bd7c: cf 91 pop r28 2bd7e: 1f 91 pop r17 2bd80: 0f 91 pop r16 2bd82: ff 90 pop r15 2bd84: ef 90 pop r14 2bd86: df 90 pop r13 2bd88: cf 90 pop r12 2bd8a: bf 90 pop r11 2bd8c: af 90 pop r10 2bd8e: 9f 90 pop r9 2bd90: 8f 90 pop r8 2bd92: 7f 90 pop r7 2bd94: 6f 90 pop r6 2bd96: 5f 90 pop r5 2bd98: 4f 90 pop r4 2bd9a: 08 95 ret if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) { // Set a position in the file. enquecommandf_P(PSTR("M26 S%lu"), position); } else if (saved_printing_type == PowerPanic::PRINT_TYPE_HOST) 2bd9c: 21 30 cpi r18, 0x01 ; 1 2bd9e: d9 f6 brne .-74 ; 0x2bd56 { // Set line number enquecommandf_P(PSTR("M110 N%lu"), position); 2bda0: 9f 93 push r25 2bda2: 8f 93 push r24 2bda4: 7f 93 push r23 2bda6: 6f 93 push r22 2bda8: 85 eb ldi r24, 0xB5 ; 181 2bdaa: 9f e8 ldi r25, 0x8F ; 143 2bdac: ca cf rjmp .-108 ; 0x2bd42 0002bdae : 2bdae: 88 e1 ldi r24, 0x18 ; 24 2bdb0: 9e e0 ldi r25, 0x0E ; 14 2bdb2: 0f b6 in r0, 0x3f ; 63 2bdb4: f8 94 cli 2bdb6: a8 95 wdr 2bdb8: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 2bdbc: 0f be out 0x3f, r0 ; 63 2bdbe: 90 93 60 00 sts 0x0060, r25 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> static void restore_print_from_eeprom(bool mbl_was_active); static void uvlo_drain_reset() { // burn all that residual power wdt_enable(WDTO_1S); WRITE(BEEPER,HIGH); 2bdc2: 9f b7 in r25, 0x3f ; 63 2bdc4: f8 94 cli 2bdc6: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2bdca: 84 60 ori r24, 0x04 ; 4 2bdcc: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2bdd0: 9f bf out 0x3f, r25 ; 63 lcd_clear(); 2bdd2: 0e 94 2b 6f call 0xde56 ; 0xde56 lcd_puts_at_P(0, 1, MSG_POWERPANIC_DETECTED); 2bdd6: 41 e0 ldi r20, 0x01 ; 1 2bdd8: 5e e6 ldi r21, 0x6E ; 110 2bdda: 61 e0 ldi r22, 0x01 ; 1 2bddc: 80 e0 ldi r24, 0x00 ; 0 2bdde: 0e 94 0c 6f call 0xde18 ; 0xde18 2bde2: ff cf rjmp .-2 ; 0x2bde2 0002bde4 <__vector_5>: SERIAL_ECHOLNRPGM(MSG_INT4); uvlo_drain_reset(); } } ISR(INT4_vect) { 2bde4: 1f 92 push r1 2bde6: 0f 92 push r0 2bde8: 0f b6 in r0, 0x3f ; 63 2bdea: 0f 92 push r0 2bdec: 11 24 eor r1, r1 2bdee: 0b b6 in r0, 0x3b ; 59 2bdf0: 0f 92 push r0 2bdf2: 8f 92 push r8 2bdf4: 9f 92 push r9 2bdf6: af 92 push r10 2bdf8: bf 92 push r11 2bdfa: cf 92 push r12 2bdfc: df 92 push r13 2bdfe: ef 92 push r14 2be00: ff 92 push r15 2be02: 0f 93 push r16 2be04: 1f 93 push r17 2be06: 2f 93 push r18 2be08: 3f 93 push r19 2be0a: 4f 93 push r20 2be0c: 5f 93 push r21 2be0e: 6f 93 push r22 2be10: 7f 93 push r23 2be12: 8f 93 push r24 2be14: 9f 93 push r25 2be16: af 93 push r26 2be18: bf 93 push r27 2be1a: cf 93 push r28 2be1c: df 93 push r29 2be1e: ef 93 push r30 2be20: ff 93 push r31 EIMSK &= ~(1 << 4); //disable INT4 interrupt to make sure that this code will be executed just once 2be22: ec 98 cbi 0x1d, 4 ; 29 SERIAL_ECHOLNRPGM(MSG_INT4); 2be24: 8a e4 ldi r24, 0x4A ; 74 2be26: 9e e8 ldi r25, 0x8E ; 142 2be28: 0e 94 93 79 call 0xf326 ; 0xf326 if (eeprom_read_byte((uint8_t*)EEPROM_UVLO) == PowerPanic::NO_PENDING_RECOVERY) 2be2c: 85 ea ldi r24, 0xA5 ; 165 2be2e: 9f e0 ldi r25, 0x0F ; 15 2be30: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 2be34: 18 2f mov r17, r24 2be36: 81 11 cpse r24, r1 2be38: de c2 rjmp .+1468 ; 0x2c3f6 <__vector_5+0x612> { if(printer_active()) { 2be3a: 0e 94 f9 67 call 0xcff2 ; 0xcff2 2be3e: 88 23 and r24, r24 2be40: 09 f4 brne .+2 ; 0x2be44 <__vector_5+0x60> 2be42: a9 c3 rjmp .+1874 ; 0x2c596 <__vector_5+0x7b2> while(1); } void uvlo_() { unsigned long time_start = _millis(); 2be44: 0f 94 22 29 call 0x25244 ; 0x25244 2be48: 6b 01 movw r12, r22 2be4a: 7c 01 movw r14, r24 // True if a print is already saved to RAM const bool print_saved_in_ram = saved_printing && (saved_printing_type != PowerPanic::PRINT_TYPE_NONE); 2be4c: c0 91 a8 0d lds r28, 0x0DA8 ; 0x800da8 2be50: cc 23 and r28, r28 2be52: 31 f0 breq .+12 ; 0x2be60 <__vector_5+0x7c> 2be54: c1 e0 ldi r28, 0x01 ; 1 2be56: 80 91 6a 02 lds r24, 0x026A ; 0x80026a 2be5a: 82 30 cpi r24, 0x02 ; 2 2be5c: 09 f4 brne .+2 ; 0x2be60 <__vector_5+0x7c> 2be5e: c0 e0 ldi r28, 0x00 ; 0 const bool pos_invalid = mesh_bed_leveling_flag || homing_flag; 2be60: d0 91 a7 0d lds r29, 0x0DA7 ; 0x800da7 2be64: d1 11 cpse r29, r1 2be66: 02 c0 rjmp .+4 ; 0x2be6c <__vector_5+0x88> 2be68: d0 91 a6 0d lds r29, 0x0DA6 ; 0x800da6 // Conserve as much power as soon as possible // Turn off the LCD backlight #ifdef LCD_BL_PIN backlightMode = BACKLIGHT_MODE_DIM; 2be6c: 10 92 4f 02 sts 0x024F, r1 ; 0x80024f backlightLevel_LOW = 0; 2be70: 10 92 ff 03 sts 0x03FF, r1 ; 0x8003ff backlight_update(); 2be74: 0e 94 1e 8a call 0x1143c ; 0x1143c #endif //LCD_BL_PIN // Disable X and Y motors to conserve power disable_x(); 2be78: 17 9a sbi 0x02, 7 ; 2 2be7a: 10 92 8e 06 sts 0x068E, r1 ; 0x80068e disable_y(); 2be7e: 16 9a sbi 0x02, 6 ; 2 2be80: 10 92 8f 06 sts 0x068F, r1 ; 0x80068f // Minimise Z and E motor currents (Hold and Run) #ifdef TMC2130 currents[Z_AXIS].setiHold(20); 2be84: 64 e1 ldi r22, 0x14 ; 20 2be86: 83 e6 ldi r24, 0x63 ; 99 2be88: 92 e0 ldi r25, 0x02 ; 2 2be8a: 0e 94 16 68 call 0xd02c ; 0xd02c currents[Z_AXIS].setiRun(20); 2be8e: 64 e1 ldi r22, 0x14 ; 20 2be90: 83 e6 ldi r24, 0x63 ; 99 2be92: 92 e0 ldi r25, 0x02 ; 2 2be94: 0e 94 1e 68 call 0xd03c ; 0xd03c tmc2130_setup_chopper(Z_AXIS, tmc2130_mres[Z_AXIS]); 2be98: 50 e0 ldi r21, 0x00 ; 0 2be9a: 40 e0 ldi r20, 0x00 ; 0 2be9c: 60 91 f6 04 lds r22, 0x04F6 ; 0x8004f6 2bea0: 82 e0 ldi r24, 0x02 ; 2 2bea2: 0f 94 65 24 call 0x248ca ; 0x248ca currents[E_AXIS].setiHold(20); 2bea6: 64 e1 ldi r22, 0x14 ; 20 2bea8: 86 e6 ldi r24, 0x66 ; 102 2beaa: 92 e0 ldi r25, 0x02 ; 2 2beac: 0e 94 16 68 call 0xd02c ; 0xd02c currents[E_AXIS].setiRun(20); 2beb0: 64 e1 ldi r22, 0x14 ; 20 2beb2: 86 e6 ldi r24, 0x66 ; 102 2beb4: 92 e0 ldi r25, 0x02 ; 2 2beb6: 0e 94 1e 68 call 0xd03c ; 0xd03c tmc2130_setup_chopper(E_AXIS, tmc2130_mres[E_AXIS]); 2beba: 50 e0 ldi r21, 0x00 ; 0 2bebc: 40 e0 ldi r20, 0x00 ; 0 2bebe: 60 91 f7 04 lds r22, 0x04F7 ; 0x8004f7 2bec2: 83 e0 ldi r24, 0x03 ; 3 2bec4: 0f 94 65 24 call 0x248ca ; 0x248ca #endif //TMC2130 if (!print_saved_in_ram && !isPartialBackupAvailable) 2bec8: c1 11 cpse r28, r1 2beca: 1b c0 rjmp .+54 ; 0x2bf02 <__vector_5+0x11e> 2becc: 80 91 a1 06 lds r24, 0x06A1 ; 0x8006a1 2bed0: 81 11 cpse r24, r1 2bed2: 17 c0 rjmp .+46 ; 0x2bf02 <__vector_5+0x11e> { saved_bed_temperature = target_temperature_bed; 2bed4: 80 91 71 06 lds r24, 0x0671 ; 0x800671 2bed8: 80 93 ad 05 sts 0x05AD, r24 ; 0x8005ad saved_extruder_temperature = target_temperature[active_extruder]; 2bedc: 80 91 b5 0d lds r24, 0x0DB5 ; 0x800db5 2bee0: 90 91 b6 0d lds r25, 0x0DB6 ; 0x800db6 2bee4: 90 93 ac 05 sts 0x05AC, r25 ; 0x8005ac 2bee8: 80 93 ab 05 sts 0x05AB, r24 ; 0x8005ab saved_extruder_relative_mode = axis_relative_modes & E_AXIS_MASK; 2beec: 80 91 e3 03 lds r24, 0x03E3 ; 0x8003e3 2bef0: 83 fb bst r24, 3 2bef2: 88 27 eor r24, r24 2bef4: 80 f9 bld r24, 0 2bef6: 80 93 63 05 sts 0x0563, r24 ; 0x800563 saved_fan_speed = fanSpeed; 2befa: 80 91 e5 03 lds r24, 0x03E5 ; 0x8003e5 2befe: 80 93 aa 05 sts 0x05AA, r24 ; 0x8005aa } // Stop all heaters before continuing disable_heater(); 2bf02: 0f 94 ee 2e call 0x25ddc ; 0x25ddc // Fetch data not included in a partial back-up if (!print_saved_in_ram) { 2bf06: c1 11 cpse r28, r1 2bf08: 04 c0 rjmp .+8 ; 0x2bf12 <__vector_5+0x12e> // Calculate the file position, from which to resume this print. save_print_file_state(); 2bf0a: 0e 94 52 65 call 0xcaa4 ; 0xcaa4 // save the global state at planning time save_planner_global_state(); 2bf0e: 0e 94 08 65 call 0xca10 ; 0xca10 } // From this point on and up to the print recovery, Z should not move during X/Y travels and // should be controlled precisely. Reset the MBL status before planner_abort_hard in order to // get the physical Z for further manipulation. bool mbl_was_active = mbl.active; 2bf12: 00 91 c1 13 lds r16, 0x13C1 ; 0x8013c1 mbl.active = false; 2bf16: 10 92 c1 13 sts 0x13C1, r1 ; 0x8013c1 // After this call, the planner queue is emptied and the current_position is set to a current logical coordinate. // The logical coordinate will likely differ from the machine coordinate if the skew calibration and mesh bed leveling // are in action. planner_abort_hard(); 2bf1a: 0f 94 7e c1 call 0x382fc ; 0x382fc // When there is no position already saved, then we must grab whatever the current position is. // This is most likely a position where the printer is in the middle of a G-code move if (!print_saved_in_ram && !isPartialBackupAvailable) 2bf1e: c1 11 cpse r28, r1 2bf20: 1b c0 rjmp .+54 ; 0x2bf58 <__vector_5+0x174> 2bf22: 80 91 a1 06 lds r24, 0x06A1 ; 0x8006a1 2bf26: 81 11 cpse r24, r1 2bf28: 17 c0 rjmp .+46 ; 0x2bf58 <__vector_5+0x174> { memcpy(saved_pos, current_position, sizeof(saved_pos)); 2bf2a: 80 e1 ldi r24, 0x10 ; 16 2bf2c: e1 e9 ldi r30, 0x91 ; 145 2bf2e: f6 e0 ldi r31, 0x06 ; 6 2bf30: a3 e7 ldi r26, 0x73 ; 115 2bf32: b2 e0 ldi r27, 0x02 ; 2 2bf34: 01 90 ld r0, Z+ 2bf36: 0d 92 st X+, r0 2bf38: 8a 95 dec r24 2bf3a: e1 f7 brne .-8 ; 0x2bf34 <__vector_5+0x150> if (pos_invalid) saved_pos[X_AXIS] = X_COORD_INVALID; 2bf3c: dd 23 and r29, r29 2bf3e: 61 f0 breq .+24 ; 0x2bf58 <__vector_5+0x174> 2bf40: 80 e0 ldi r24, 0x00 ; 0 2bf42: 90 e0 ldi r25, 0x00 ; 0 2bf44: a0 e8 ldi r26, 0x80 ; 128 2bf46: bf eb ldi r27, 0xBF ; 191 2bf48: 80 93 73 02 sts 0x0273, r24 ; 0x800273 2bf4c: 90 93 74 02 sts 0x0274, r25 ; 0x800274 2bf50: a0 93 75 02 sts 0x0275, r26 ; 0x800275 2bf54: b0 93 76 02 sts 0x0276, r27 ; 0x800276 } // Store the print logical Z position, which we need to recover (a slight error here would be // recovered on the next Gcode instruction, while a physical location error would not) float logical_z = saved_pos[Z_AXIS]; 2bf58: 80 90 7b 02 lds r8, 0x027B ; 0x80027b 2bf5c: 90 90 7c 02 lds r9, 0x027C ; 0x80027c 2bf60: a0 90 7d 02 lds r10, 0x027D ; 0x80027d 2bf64: b0 90 7e 02 lds r11, 0x027E ; 0x80027e if(mbl_was_active) { 2bf68: 00 23 and r16, r16 2bf6a: d1 f0 breq .+52 ; 0x2bfa0 <__vector_5+0x1bc> // Mesh bed leveling was being actively applied to the Z-position. Revert the // mesh bed leveling offset value. logical_z -= mbl.get_z(saved_pos[X_AXIS], saved_pos[Y_AXIS]); 2bf6c: 20 91 77 02 lds r18, 0x0277 ; 0x800277 2bf70: 30 91 78 02 lds r19, 0x0278 ; 0x800278 2bf74: 40 91 79 02 lds r20, 0x0279 ; 0x800279 2bf78: 50 91 7a 02 lds r21, 0x027A ; 0x80027a 2bf7c: 60 91 73 02 lds r22, 0x0273 ; 0x800273 2bf80: 70 91 74 02 lds r23, 0x0274 ; 0x800274 2bf84: 80 91 75 02 lds r24, 0x0275 ; 0x800275 2bf88: 90 91 76 02 lds r25, 0x0276 ; 0x800276 2bf8c: 0f 94 6c a1 call 0x342d8 ; 0x342d8 2bf90: 9b 01 movw r18, r22 2bf92: ac 01 movw r20, r24 2bf94: c5 01 movw r24, r10 2bf96: b4 01 movw r22, r8 2bf98: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 2bf9c: 4b 01 movw r8, r22 2bf9e: 5c 01 movw r10, r24 if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 2bfa0: b5 01 movw r22, r10 2bfa2: a4 01 movw r20, r8 2bfa4: 8d e8 ldi r24, 0x8D ; 141 2bfa6: 9f e0 ldi r25, 0x0F ; 15 2bfa8: 0f 94 0d dc call 0x3b81a ; 0x3b81a 2bfac: 40 91 7f 02 lds r20, 0x027F ; 0x80027f 2bfb0: 50 91 80 02 lds r21, 0x0280 ; 0x800280 2bfb4: 60 91 81 02 lds r22, 0x0281 ; 0x800281 2bfb8: 70 91 82 02 lds r23, 0x0282 ; 0x800282 2bfbc: 8e e6 ldi r24, 0x6E ; 110 2bfbe: 9f e0 ldi r25, 0x0F ; 15 2bfc0: 0f 94 0d dc call 0x3b81a ; 0x3b81a } eeprom_update_float_notify((float*)EEPROM_UVLO_CURRENT_POSITION_Z, logical_z); // Store the print E position before we lose track eeprom_update_float_notify((float*)(EEPROM_UVLO_CURRENT_POSITION_E), saved_pos[E_AXIS]); eeprom_update_byte_notify((uint8_t*)EEPROM_UVLO_E_ABS, !saved_extruder_relative_mode); 2bfc4: 60 91 63 05 lds r22, 0x0563 ; 0x800563 2bfc8: c1 e0 ldi r28, 0x01 ; 1 2bfca: 6c 27 eor r22, r28 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 2bfcc: 82 e7 ldi r24, 0x72 ; 114 2bfce: 9f e0 ldi r25, 0x0F ; 15 2bfd0: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 // Clean the input command queue, inhibit serial processing using saved_printing cmdqueue_reset(); 2bfd4: 0e 94 5c 7f call 0xfeb8 ; 0xfeb8 card.sdprinting = false; 2bfd8: 10 92 8f 14 sts 0x148F, r1 ; 0x80148f saved_printing = true; 2bfdc: c0 93 a8 0d sts 0x0DA8, r28 ; 0x800da8 // Enable stepper driver interrupt to move Z axis. This should be fine as the planner and // command queues are empty, SD card printing is disabled, usb is inhibited. planner_aborted = false; 2bfe0: 10 92 ab 0d sts 0x0DAB, r1 ; 0x800dab sei(); 2bfe4: 78 94 sei // Retract current_position[E_AXIS] -= default_retraction; 2bfe6: 20 e0 ldi r18, 0x00 ; 0 2bfe8: 30 e0 ldi r19, 0x00 ; 0 2bfea: 40 e8 ldi r20, 0x80 ; 128 2bfec: 5f e3 ldi r21, 0x3F ; 63 2bfee: 60 91 9d 06 lds r22, 0x069D ; 0x80069d 2bff2: 70 91 9e 06 lds r23, 0x069E ; 0x80069e 2bff6: 80 91 9f 06 lds r24, 0x069F ; 0x80069f 2bffa: 90 91 a0 06 lds r25, 0x06A0 ; 0x8006a0 2bffe: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 2c002: 60 93 9d 06 sts 0x069D, r22 ; 0x80069d 2c006: 70 93 9e 06 sts 0x069E, r23 ; 0x80069e 2c00a: 80 93 9f 06 sts 0x069F, r24 ; 0x80069f 2c00e: 90 93 a0 06 sts 0x06A0, r25 ; 0x8006a0 plan_buffer_line_curposXYZE(95); 2c012: 60 e0 ldi r22, 0x00 ; 0 2c014: 70 e0 ldi r23, 0x00 ; 0 2c016: 8e eb ldi r24, 0xBE ; 190 2c018: 92 e4 ldi r25, 0x42 ; 66 2c01a: 0f 94 04 c0 call 0x38008 ; 0x38008 st_synchronize(); 2c01e: 0f 94 a3 42 call 0x28546 ; 0x28546 disable_e0(); 2c022: 14 9a sbi 0x02, 4 ; 2 return stat; } uint16_t tmc2130_get_res(uint8_t axis) { return tmc2130_mres2usteps(tmc2130_mres[axis]); 2c024: 80 91 f6 04 lds r24, 0x04F6 ; 0x8004f6 2c028: c0 e0 ldi r28, 0x00 ; 0 2c02a: d1 e0 ldi r29, 0x01 ; 1 2c02c: 02 c0 rjmp .+4 ; 0x2c032 <__vector_5+0x24e> 2c02e: d6 95 lsr r29 2c030: c7 95 ror r28 2c032: 8a 95 dec r24 2c034: e2 f7 brpl .-8 ; 0x2c02e <__vector_5+0x24a> // Read out the current Z motor microstep counter to move the axis up towards // a full step before powering off. NOTE: we need to ensure to schedule more // than "dropsegments" steps in order to move (this is always the case here // due to UVLO_Z_AXIS_SHIFT being used) uint16_t z_res = tmc2130_get_res(Z_AXIS); uint16_t z_microsteps = tmc2130_rd_MSCNT(Z_AXIS); 2c036: 82 e0 ldi r24, 0x02 ; 2 2c038: 0f 94 4b 24 call 0x24896 ; 0x24896 current_position[Z_AXIS] += float(1024 - z_microsteps) 2c03c: 60 e0 ldi r22, 0x00 ; 0 2c03e: 74 e0 ldi r23, 0x04 ; 4 2c040: 68 1b sub r22, r24 2c042: 79 0b sbc r23, r25 2c044: 90 e0 ldi r25, 0x00 ; 0 2c046: 80 e0 ldi r24, 0x00 ; 0 2c048: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 2c04c: 4b 01 movw r8, r22 2c04e: 5c 01 movw r10, r24 / (z_res * cs.axis_steps_per_mm[Z_AXIS]) 2c050: be 01 movw r22, r28 2c052: 90 e0 ldi r25, 0x00 ; 0 2c054: 80 e0 ldi r24, 0x00 ; 0 2c056: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 2c05a: 20 91 c9 0d lds r18, 0x0DC9 ; 0x800dc9 2c05e: 30 91 ca 0d lds r19, 0x0DCA ; 0x800dca 2c062: 40 91 cb 0d lds r20, 0x0DCB ; 0x800dcb 2c066: 50 91 cc 0d lds r21, 0x0DCC ; 0x800dcc 2c06a: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__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 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> + UVLO_Z_AXIS_SHIFT; 2c07a: 2a e0 ldi r18, 0x0A ; 10 2c07c: 37 ed ldi r19, 0xD7 ; 215 2c07e: 43 e2 ldi r20, 0x23 ; 35 2c080: 5f e3 ldi r21, 0x3F ; 63 2c082: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> // a full step before powering off. NOTE: we need to ensure to schedule more // than "dropsegments" steps in order to move (this is always the case here // due to UVLO_Z_AXIS_SHIFT being used) uint16_t z_res = tmc2130_get_res(Z_AXIS); uint16_t z_microsteps = tmc2130_rd_MSCNT(Z_AXIS); current_position[Z_AXIS] += float(1024 - z_microsteps) 2c086: 20 91 99 06 lds r18, 0x0699 ; 0x800699 2c08a: 30 91 9a 06 lds r19, 0x069A ; 0x80069a 2c08e: 40 91 9b 06 lds r20, 0x069B ; 0x80069b 2c092: 50 91 9c 06 lds r21, 0x069C ; 0x80069c 2c096: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 2c09a: 60 93 99 06 sts 0x0699, r22 ; 0x800699 2c09e: 70 93 9a 06 sts 0x069A, r23 ; 0x80069a 2c0a2: 80 93 9b 06 sts 0x069B, r24 ; 0x80069b 2c0a6: 90 93 9c 06 sts 0x069C, r25 ; 0x80069c / (z_res * cs.axis_steps_per_mm[Z_AXIS]) + UVLO_Z_AXIS_SHIFT; plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS]/60); 2c0aa: 65 e5 ldi r22, 0x55 ; 85 2c0ac: 75 e5 ldi r23, 0x55 ; 85 2c0ae: 85 e5 ldi r24, 0x55 ; 85 2c0b0: 91 e4 ldi r25, 0x41 ; 65 2c0b2: 0f 94 04 c0 call 0x38008 ; 0x38008 st_synchronize(); 2c0b6: 0f 94 a3 42 call 0x28546 ; 0x28546 if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); 2c0ba: 40 91 5f 05 lds r20, 0x055F ; 0x80055f 2c0be: 50 91 60 05 lds r21, 0x0560 ; 0x800560 2c0c2: 60 91 61 05 lds r22, 0x0561 ; 0x800561 2c0c6: 70 91 62 05 lds r23, 0x0562 ; 0x800562 2c0ca: 81 e9 ldi r24, 0x91 ; 145 2c0cc: 9f e0 ldi r25, 0x0F ; 15 2c0ce: 0f 94 0d dc call 0x3b81a ; 0x3b81a 2c0d2: ce ea ldi r28, 0xAE ; 174 2c0d4: dd e0 ldi r29, 0x0D ; 13 // Store the mesh bed leveling offsets. This is 2*7*7=98 bytes, which takes 98*3.4us=333us in worst case. for (uint8_t mesh_point = 0; mesh_point < MESH_NUM_X_POINTS * MESH_NUM_Y_POINTS; ++ mesh_point) { uint8_t ix = mesh_point % MESH_NUM_X_POINTS; // from 0 to MESH_NUM_X_POINTS - 1 uint8_t iy = mesh_point / MESH_NUM_X_POINTS; 2c0d6: 97 e0 ldi r25, 0x07 ; 7 2c0d8: b9 2e mov r11, r25 // Scale the z value to 1u resolution. int16_t v = mbl_was_active ? int16_t(floor(mbl.z_values[iy][ix] * 1000.f + 0.5f)) : 0; 2c0da: 70 e0 ldi r23, 0x00 ; 0 2c0dc: 60 e0 ldi r22, 0x00 ; 0 2c0de: 00 23 and r16, r16 2c0e0: 19 f1 breq .+70 ; 0x2c128 <__vector_5+0x344> // Store the mesh bed leveling offsets. This is 2*7*7=98 bytes, which takes 98*3.4us=333us in worst case. for (uint8_t mesh_point = 0; mesh_point < MESH_NUM_X_POINTS * MESH_NUM_Y_POINTS; ++ mesh_point) { uint8_t ix = mesh_point % MESH_NUM_X_POINTS; // from 0 to MESH_NUM_X_POINTS - 1 uint8_t iy = mesh_point / MESH_NUM_X_POINTS; 2c0e2: 81 2f mov r24, r17 2c0e4: 6b 2d mov r22, r11 2c0e6: 0f 94 86 dc call 0x3b90c ; 0x3b90c <__udivmodqi4> // Scale the z value to 1u resolution. int16_t v = mbl_was_active ? int16_t(floor(mbl.z_values[iy][ix] * 1000.f + 0.5f)) : 0; 2c0ea: b8 9e mul r11, r24 2c0ec: f0 01 movw r30, r0 2c0ee: 11 24 eor r1, r1 2c0f0: e9 0f add r30, r25 2c0f2: f1 1d adc r31, r1 2c0f4: ee 0f add r30, r30 2c0f6: ff 1f adc r31, r31 2c0f8: ee 0f add r30, r30 2c0fa: ff 1f adc r31, r31 2c0fc: ef 53 subi r30, 0x3F ; 63 2c0fe: fc 4e sbci r31, 0xEC ; 236 2c100: 20 e0 ldi r18, 0x00 ; 0 2c102: 30 e0 ldi r19, 0x00 ; 0 2c104: 4a e7 ldi r20, 0x7A ; 122 2c106: 54 e4 ldi r21, 0x44 ; 68 2c108: 61 81 ldd r22, Z+1 ; 0x01 2c10a: 72 81 ldd r23, Z+2 ; 0x02 2c10c: 83 81 ldd r24, Z+3 ; 0x03 2c10e: 94 81 ldd r25, Z+4 ; 0x04 2c110: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 2c114: 20 e0 ldi r18, 0x00 ; 0 2c116: 30 e0 ldi r19, 0x00 ; 0 2c118: 40 e0 ldi r20, 0x00 ; 0 2c11a: 5f e3 ldi r21, 0x3F ; 63 2c11c: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 2c120: 0f 94 a6 de call 0x3bd4c ; 0x3bd4c 2c124: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 2c128: ce 01 movw r24, r28 2c12a: 0f 94 19 dc call 0x3b832 ; 0x3b832 // Write the file position. eeprom_update_dword_notify((uint32_t*)(EEPROM_FILE_POSITION), saved_sdpos); // Store the mesh bed leveling offsets. This is 2*7*7=98 bytes, which takes 98*3.4us=333us in worst case. for (uint8_t mesh_point = 0; mesh_point < MESH_NUM_X_POINTS * MESH_NUM_Y_POINTS; ++ mesh_point) 2c12e: 1f 5f subi r17, 0xFF ; 255 2c130: 22 96 adiw r28, 0x02 ; 2 2c132: 11 33 cpi r17, 0x31 ; 49 2c134: 91 f6 brne .-92 ; 0x2c0da <__vector_5+0x2f6> if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 2c136: 40 91 99 06 lds r20, 0x0699 ; 0x800699 2c13a: 50 91 9a 06 lds r21, 0x069A ; 0x80069a 2c13e: 60 91 9b 06 lds r22, 0x069B ; 0x80069b 2c142: 70 91 9c 06 lds r23, 0x069C ; 0x80069c 2c146: 8a ed ldi r24, 0xDA ; 218 2c148: 9e e0 ldi r25, 0x0E ; 14 2c14a: 0f 94 0d dc call 0x3b81a ; 0x3b81a 2c14e: 40 91 73 02 lds r20, 0x0273 ; 0x800273 2c152: 50 91 74 02 lds r21, 0x0274 ; 0x800274 2c156: 60 91 75 02 lds r22, 0x0275 ; 0x800275 2c15a: 70 91 76 02 lds r23, 0x0276 ; 0x800276 2c15e: 8d e9 ldi r24, 0x9D ; 157 2c160: 9f e0 ldi r25, 0x0F ; 15 2c162: 0f 94 0d dc call 0x3b81a ; 0x3b81a 2c166: 40 91 77 02 lds r20, 0x0277 ; 0x800277 2c16a: 50 91 78 02 lds r21, 0x0278 ; 0x800278 2c16e: 60 91 79 02 lds r22, 0x0279 ; 0x800279 2c172: 70 91 7a 02 lds r23, 0x027A ; 0x80027a 2c176: 81 ea ldi r24, 0xA1 ; 161 2c178: 9f e0 ldi r25, 0x0F ; 15 2c17a: 0f 94 0d dc call 0x3b81a ; 0x3b81a if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 2c17e: 60 91 5d 05 lds r22, 0x055D ; 0x80055d 2c182: 70 91 5e 05 lds r23, 0x055E ; 0x80055e 2c186: 89 e8 ldi r24, 0x89 ; 137 2c188: 9f e0 ldi r25, 0x0F ; 15 2c18a: 0f 94 19 dc call 0x3b832 ; 0x3b832 2c18e: 60 91 39 02 lds r22, 0x0239 ; 0x800239 2c192: 70 91 3a 02 lds r23, 0x023A ; 0x80023a 2c196: 85 e3 ldi r24, 0x35 ; 53 2c198: 9d e0 ldi r25, 0x0D ; 13 2c19a: 0f 94 19 dc call 0x3b832 ; 0x3b832 2c19e: 60 91 ab 05 lds r22, 0x05AB ; 0x8005ab 2c1a2: 70 91 ac 05 lds r23, 0x05AC ; 0x8005ac 2c1a6: 88 ed ldi r24, 0xD8 ; 216 2c1a8: 9e e0 ldi r25, 0x0E ; 14 2c1aa: 0f 94 19 dc call 0x3b832 ; 0x3b832 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 2c1ae: 60 91 ad 05 lds r22, 0x05AD ; 0x8005ad 2c1b2: 8b e8 ldi r24, 0x8B ; 139 2c1b4: 9f e0 ldi r25, 0x0F ; 15 2c1b6: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 2c1ba: 60 91 aa 05 lds r22, 0x05AA ; 0x8005aa 2c1be: 88 e8 ldi r24, 0x88 ; 136 2c1c0: 9f e0 ldi r25, 0x0F ; 15 2c1c2: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 2c1c6: 40 91 93 02 lds r20, 0x0293 ; 0x800293 2c1ca: 50 91 94 02 lds r21, 0x0294 ; 0x800294 2c1ce: 60 91 95 02 lds r22, 0x0295 ; 0x800295 2c1d2: 70 91 96 02 lds r23, 0x0296 ; 0x800296 2c1d6: 88 ee ldi r24, 0xE8 ; 232 2c1d8: 9e e0 ldi r25, 0x0E ; 14 2c1da: 0f 94 0d dc call 0x3b81a ; 0x3b81a if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 2c1de: 60 91 bc 02 lds r22, 0x02BC ; 0x8002bc 2c1e2: 70 91 bd 02 lds r23, 0x02BD ; 0x8002bd 2c1e6: 8e ed ldi r24, 0xDE ; 222 2c1e8: 9e e0 ldi r25, 0x0E ; 14 2c1ea: 0f 94 19 dc call 0x3b832 ; 0x3b832 if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 2c1ee: 40 91 f1 0d lds r20, 0x0DF1 ; 0x800df1 2c1f2: 50 91 f2 0d lds r21, 0x0DF2 ; 0x800df2 2c1f6: 60 91 f3 0d lds r22, 0x0DF3 ; 0x800df3 2c1fa: 70 91 f4 0d lds r23, 0x0DF4 ; 0x800df4 2c1fe: 81 e1 ldi r24, 0x11 ; 17 2c200: 9d e0 ldi r25, 0x0D ; 13 2c202: 0f 94 0d dc call 0x3b81a ; 0x3b81a 2c206: 40 91 f5 0d lds r20, 0x0DF5 ; 0x800df5 2c20a: 50 91 f6 0d lds r21, 0x0DF6 ; 0x800df6 2c20e: 60 91 f7 0d lds r22, 0x0DF7 ; 0x800df7 2c212: 70 91 f8 0d lds r23, 0x0DF8 ; 0x800df8 2c216: 8d e0 ldi r24, 0x0D ; 13 2c218: 9d e0 ldi r25, 0x0D ; 13 2c21a: 0f 94 0d dc call 0x3b81a ; 0x3b81a 2c21e: 40 91 7d 0e lds r20, 0x0E7D ; 0x800e7d 2c222: 50 91 7e 0e lds r21, 0x0E7E ; 0x800e7e 2c226: 60 91 7f 0e lds r22, 0x0E7F ; 0x800e7f 2c22a: 70 91 80 0e lds r23, 0x0E80 ; 0x800e80 2c22e: 89 e0 ldi r24, 0x09 ; 9 2c230: 9d e0 ldi r25, 0x0D ; 13 2c232: 0f 94 0d dc call 0x3b81a ; 0x3b81a #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); 2c236: 40 e1 ldi r20, 0x10 ; 16 2c238: 50 e0 ldi r21, 0x00 ; 0 2c23a: 67 e3 ldi r22, 0x37 ; 55 2c23c: 7d e0 ldi r23, 0x0D ; 13 2c23e: 83 e8 ldi r24, 0x83 ; 131 2c240: 92 e0 ldi r25, 0x02 ; 2 2c242: 0f 94 eb db call 0x3b7d6 ; 0x3b7d6 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 2c246: 60 91 68 05 lds r22, 0x0568 ; 0x800568 2c24a: 70 91 69 05 lds r23, 0x0569 ; 0x800569 2c24e: 8c e6 ldi r24, 0x6C ; 108 2c250: 9f e0 ldi r25, 0x0F ; 15 2c252: 0f 94 19 dc call 0x3b832 ; 0x3b832 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 2c256: 60 91 6a 02 lds r22, 0x026A ; 0x80026a 2c25a: 8c e8 ldi r24, 0x8C ; 140 2c25c: 9f e0 ldi r25, 0x0F ; 15 2c25e: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 2c262: 40 91 64 05 lds r20, 0x0564 ; 0x800564 2c266: 50 91 65 05 lds r21, 0x0565 ; 0x800565 2c26a: 60 91 66 05 lds r22, 0x0566 ; 0x800566 2c26e: 70 91 67 05 lds r23, 0x0567 ; 0x800567 2c272: 8c e2 ldi r24, 0x2C ; 44 2c274: 9d e0 ldi r25, 0x0D ; 13 2c276: 0f 94 0d dc call 0x3b81a ; 0x3b81a if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 2c27a: 60 91 6b 02 lds r22, 0x026B ; 0x80026b 2c27e: 70 91 6c 02 lds r23, 0x026C ; 0x80026c 2c282: 8d e7 ldi r24, 0x7D ; 125 2c284: 9c e0 ldi r25, 0x0C ; 12 2c286: 0f 94 19 dc call 0x3b832 ; 0x3b832 #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); 2c28a: 40 e1 ldi r20, 0x10 ; 16 2c28c: 50 e0 ldi r21, 0x00 ; 0 2c28e: 6d e6 ldi r22, 0x6D ; 109 2c290: 7c e0 ldi r23, 0x0C ; 12 2c292: 81 ee ldi r24, 0xE1 ; 225 2c294: 9d e0 ldi r25, 0x0D ; 13 2c296: 0f 94 eb db call 0x3b7d6 ; 0x3b7d6 2c29a: 40 e1 ldi r20, 0x10 ; 16 2c29c: 50 e0 ldi r21, 0x00 ; 0 2c29e: 6d e5 ldi r22, 0x5D ; 93 2c2a0: 7c e0 ldi r23, 0x0C ; 12 2c2a2: 89 e6 ldi r24, 0x69 ; 105 2c2a4: 9e e0 ldi r25, 0x0E ; 14 2c2a6: 0f 94 eb db call 0x3b7d6 ; 0x3b7d6 2c2aa: 40 e1 ldi r20, 0x10 ; 16 2c2ac: 50 e0 ldi r21, 0x00 ; 0 2c2ae: 6d e4 ldi r22, 0x4D ; 77 2c2b0: 7c e0 ldi r23, 0x0C ; 12 2c2b2: 81 ed ldi r24, 0xD1 ; 209 2c2b4: 9d e0 ldi r25, 0x0D ; 13 2c2b6: 0f 94 eb db call 0x3b7d6 ; 0x3b7d6 2c2ba: 40 e1 ldi r20, 0x10 ; 16 2c2bc: 50 e0 ldi r21, 0x00 ; 0 2c2be: 6d e3 ldi r22, 0x3D ; 61 2c2c0: 7c e0 ldi r23, 0x0C ; 12 2c2c2: 89 e5 ldi r24, 0x59 ; 89 2c2c4: 9e e0 ldi r25, 0x0E ; 14 2c2c6: 0f 94 eb db call 0x3b7d6 ; 0x3b7d6 if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 2c2ca: 40 91 f9 0d lds r20, 0x0DF9 ; 0x800df9 2c2ce: 50 91 fa 0d lds r21, 0x0DFA ; 0x800dfa 2c2d2: 60 91 fb 0d lds r22, 0x0DFB ; 0x800dfb 2c2d6: 70 91 fc 0d lds r23, 0x0DFC ; 0x800dfc 2c2da: 89 e3 ldi r24, 0x39 ; 57 2c2dc: 9c e0 ldi r25, 0x0C ; 12 2c2de: 0f 94 0d dc call 0x3b81a ; 0x3b81a 2c2e2: 40 91 fd 0d lds r20, 0x0DFD ; 0x800dfd 2c2e6: 50 91 fe 0d lds r21, 0x0DFE ; 0x800dfe 2c2ea: 60 91 ff 0d lds r22, 0x0DFF ; 0x800dff 2c2ee: 70 91 00 0e lds r23, 0x0E00 ; 0x800e00 2c2f2: 85 e3 ldi r24, 0x35 ; 53 2c2f4: 9c e0 ldi r25, 0x0C ; 12 2c2f6: 0f 94 0d dc call 0x3b81a ; 0x3b81a if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); 2c2fa: 40 91 01 0e lds r20, 0x0E01 ; 0x800e01 2c2fe: 50 91 02 0e lds r21, 0x0E02 ; 0x800e02 2c302: 60 91 03 0e lds r22, 0x0E03 ; 0x800e03 2c306: 70 91 04 0e lds r23, 0x0E04 ; 0x800e04 2c30a: 81 e3 ldi r24, 0x31 ; 49 2c30c: 9c e0 ldi r25, 0x0C ; 12 2c30e: 0f 94 0d dc call 0x3b81a ; 0x3b81a #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); 2c312: 40 e1 ldi r20, 0x10 ; 16 2c314: 50 e0 ldi r21, 0x00 ; 0 2c316: 61 e2 ldi r22, 0x21 ; 33 2c318: 7c e0 ldi r23, 0x0C ; 12 2c31a: 85 e0 ldi r24, 0x05 ; 5 2c31c: 9e e0 ldi r25, 0x0E ; 14 2c31e: 0f 94 eb db call 0x3b7d6 ; 0x3b7d6 eeprom_update_float_notify((float *)(EEPROM_UVLO_MIN_FEEDRATE), cs.minimumfeedrate); eeprom_update_float_notify((float *)(EEPROM_UVLO_MIN_TRAVEL_FEEDRATE), cs.mintravelfeedrate); eeprom_update_dword_notify((uint32_t *)(EEPROM_UVLO_MIN_SEGMENT_TIME_US), cs.min_segment_time_us); eeprom_update_block_notify(cs.max_jerk, (float *)EEPROM_UVLO_MAX_JERK, sizeof(cs.max_jerk)); // Finally store the "power outage" flag. if (did_pause_print) { 2c322: 80 91 e2 03 lds r24, 0x03E2 ; 0x8003e2 2c326: 88 23 and r24, r24 2c328: 29 f0 breq .+10 ; 0x2c334 <__vector_5+0x550> if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 2c32a: 61 e0 ldi r22, 0x01 ; 1 2c32c: 8f e7 ldi r24, 0x7F ; 127 2c32e: 9c e0 ldi r25, 0x0C ; 12 2c330: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 2c334: 61 e0 ldi r22, 0x01 ; 1 2c336: 85 ea ldi r24, 0xA5 ; 165 2c338: 9f e0 ldi r25, 0x0F ; 15 2c33a: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 } eeprom_update_byte_notify((uint8_t*)EEPROM_UVLO, PowerPanic::PENDING_RECOVERY); // Increment power failure counter eeprom_increment_byte((uint8_t*)EEPROM_POWER_COUNT); 2c33e: 84 e6 ldi r24, 0x64 ; 100 2c340: 9f e0 ldi r25, 0x0F ; 15 2c342: 0e 94 40 76 call 0xec80 ; 0xec80 eeprom_increment_word((uint16_t*)EEPROM_POWER_COUNT_TOT); 2c346: 8f ef ldi r24, 0xFF ; 255 2c348: 9e e0 ldi r25, 0x0E ; 14 2c34a: 0e 94 33 76 call 0xec66 ; 0xec66 printf_P(_N("UVLO - end %d\n"), _millis() - time_start); 2c34e: 0f 94 22 29 call 0x25244 ; 0x25244 2c352: dc 01 movw r26, r24 2c354: cb 01 movw r24, r22 2c356: 8c 19 sub r24, r12 2c358: 9d 09 sbc r25, r13 2c35a: ae 09 sbc r26, r14 2c35c: bf 09 sbc r27, r15 2c35e: bf 93 push r27 2c360: af 93 push r26 2c362: 9f 93 push r25 2c364: 8f 93 push r24 2c366: 86 e1 ldi r24, 0x16 ; 22 2c368: 9e e6 ldi r25, 0x6E ; 110 2c36a: 9f 93 push r25 2c36c: 8f 93 push r24 2c36e: 0f 94 99 da call 0x3b532 ; 0x3b532 WRITE(BEEPER,HIGH); 2c372: 9f b7 in r25, 0x3f ; 63 2c374: f8 94 cli 2c376: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c37a: 84 60 ori r24, 0x04 ; 4 2c37c: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c380: 9f bf out 0x3f, r25 ; 63 // All is set: with all the juice left, try to move extruder away to detach the nozzle completely from the print poweron_z(); 2c382: 15 98 cbi 0x02, 5 ; 2 current_position[X_AXIS] = (current_position[X_AXIS] < 0.5f * (X_MIN_POS + X_MAX_POS)) ? X_MIN_POS : X_MAX_POS; 2c384: 0f 90 pop r0 2c386: 0f 90 pop r0 2c388: 0f 90 pop r0 2c38a: 0f 90 pop r0 2c38c: 0f 90 pop r0 2c38e: 0f 90 pop r0 2c390: 20 e0 ldi r18, 0x00 ; 0 2c392: 30 e0 ldi r19, 0x00 ; 0 2c394: 4f ef ldi r20, 0xFF ; 255 2c396: 52 e4 ldi r21, 0x42 ; 66 2c398: 60 91 91 06 lds r22, 0x0691 ; 0x800691 2c39c: 70 91 92 06 lds r23, 0x0692 ; 0x800692 2c3a0: 80 91 93 06 lds r24, 0x0693 ; 0x800693 2c3a4: 90 91 94 06 lds r25, 0x0694 ; 0x800694 2c3a8: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 2c3ac: 87 fd sbrc r24, 7 2c3ae: 1f c0 rjmp .+62 ; 0x2c3ee <__vector_5+0x60a> 2c3b0: 80 e0 ldi r24, 0x00 ; 0 2c3b2: 90 e0 ldi r25, 0x00 ; 0 2c3b4: af e7 ldi r26, 0x7F ; 127 2c3b6: b3 e4 ldi r27, 0x43 ; 67 2c3b8: 80 93 91 06 sts 0x0691, r24 ; 0x800691 2c3bc: 90 93 92 06 sts 0x0692, r25 ; 0x800692 2c3c0: a0 93 93 06 sts 0x0693, r26 ; 0x800693 2c3c4: b0 93 94 06 sts 0x0694, r27 ; 0x800694 plan_buffer_line_curposXYZE(500); 2c3c8: 60 e0 ldi r22, 0x00 ; 0 2c3ca: 70 e0 ldi r23, 0x00 ; 0 2c3cc: 8a ef ldi r24, 0xFA ; 250 2c3ce: 93 e4 ldi r25, 0x43 ; 67 2c3d0: 0f 94 04 c0 call 0x38008 ; 0x38008 st_synchronize(); 2c3d4: 0f 94 a3 42 call 0x28546 ; 0x28546 2c3d8: 88 e1 ldi r24, 0x18 ; 24 2c3da: 9e e0 ldi r25, 0x0E ; 14 2c3dc: 0f b6 in r0, 0x3f ; 63 2c3de: f8 94 cli 2c3e0: a8 95 wdr 2c3e2: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 2c3e6: 0f be out 0x3f, r0 ; 63 2c3e8: 90 93 60 00 sts 0x0060, r25 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 2c3ec: ff cf rjmp .-2 ; 0x2c3ec <__vector_5+0x608> printf_P(_N("UVLO - end %d\n"), _millis() - time_start); WRITE(BEEPER,HIGH); // All is set: with all the juice left, try to move extruder away to detach the nozzle completely from the print poweron_z(); current_position[X_AXIS] = (current_position[X_AXIS] < 0.5f * (X_MIN_POS + X_MAX_POS)) ? X_MIN_POS : X_MAX_POS; 2c3ee: 80 e0 ldi r24, 0x00 ; 0 2c3f0: 90 e0 ldi r25, 0x00 ; 0 2c3f2: dc 01 movw r26, r24 2c3f4: e1 cf rjmp .-62 ; 0x2c3b8 <__vector_5+0x5d4> while(1); } static void uvlo_tiny() { unsigned long time_start = _millis(); 2c3f6: 0f 94 22 29 call 0x25244 ; 0x25244 2c3fa: 6b 01 movw r12, r22 2c3fc: 7c 01 movw r14, r24 // Conserve power as soon as possible. disable_x(); 2c3fe: 17 9a sbi 0x02, 7 ; 2 2c400: 10 92 8e 06 sts 0x068E, r1 ; 0x80068e disable_y(); 2c404: 16 9a sbi 0x02, 6 ; 2 2c406: 10 92 8f 06 sts 0x068F, r1 ; 0x80068f disable_e0(); 2c40a: 14 9a sbi 0x02, 4 ; 2 #ifdef TMC2130 currents[Z_AXIS].setiHold(20); 2c40c: 64 e1 ldi r22, 0x14 ; 20 2c40e: 83 e6 ldi r24, 0x63 ; 99 2c410: 92 e0 ldi r25, 0x02 ; 2 2c412: 0e 94 16 68 call 0xd02c ; 0xd02c currents[Z_AXIS].setiRun(20); 2c416: 64 e1 ldi r22, 0x14 ; 20 2c418: 83 e6 ldi r24, 0x63 ; 99 2c41a: 92 e0 ldi r25, 0x02 ; 2 2c41c: 0e 94 1e 68 call 0xd03c ; 0xd03c tmc2130_setup_chopper(Z_AXIS, tmc2130_mres[Z_AXIS]); 2c420: 50 e0 ldi r21, 0x00 ; 0 2c422: 40 e0 ldi r20, 0x00 ; 0 2c424: 60 91 f6 04 lds r22, 0x04F6 ; 0x8004f6 2c428: 82 e0 ldi r24, 0x02 ; 2 2c42a: 0f 94 65 24 call 0x248ca ; 0x248ca #endif //TMC2130 // Stop all heaters disable_heater(); 2c42e: 0f 94 ee 2e call 0x25ddc ; 0x25ddc // When power is interrupted on the _first_ recovery an attempt can be made to raise the // extruder, causing the Z position to change. Similarly, when recovering, the Z position is // lowered. In such cases we cannot just save Z, we need to re-align the steppers to a fullstep. // Disable MBL (if not already) to work with physical coordinates. mbl.active = false; 2c432: 10 92 c1 13 sts 0x13C1, r1 ; 0x8013c1 planner_abort_hard(); 2c436: 0f 94 7e c1 call 0x382fc ; 0x382fc // Allow for small roundoffs to be ignored if(fabs(current_position[Z_AXIS] - eeprom_read_float((float*)(EEPROM_UVLO_TINY_CURRENT_POSITION_Z))) >= 1.f/cs.axis_steps_per_mm[Z_AXIS]) 2c43a: 80 90 99 06 lds r8, 0x0699 ; 0x800699 2c43e: 90 90 9a 06 lds r9, 0x069A ; 0x80069a 2c442: a0 90 9b 06 lds r10, 0x069B ; 0x80069b 2c446: b0 90 9c 06 lds r11, 0x069C ; 0x80069c 2c44a: 8a ed ldi r24, 0xDA ; 218 2c44c: 9e e0 ldi r25, 0x0E ; 14 2c44e: 0f 94 df db call 0x3b7be ; 0x3b7be 2c452: 9b 01 movw r18, r22 2c454: ac 01 movw r20, r24 2c456: c5 01 movw r24, r10 2c458: b4 01 movw r22, r8 2c45a: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 2c45e: 4b 01 movw r8, r22 2c460: 5c 01 movw r10, r24 2c462: e8 94 clt 2c464: b7 f8 bld r11, 7 2c466: 20 91 c9 0d lds r18, 0x0DC9 ; 0x800dc9 2c46a: 30 91 ca 0d lds r19, 0x0DCA ; 0x800dca 2c46e: 40 91 cb 0d lds r20, 0x0DCB ; 0x800dcb 2c472: 50 91 cc 0d lds r21, 0x0DCC ; 0x800dcc 2c476: 60 e0 ldi r22, 0x00 ; 0 2c478: 70 e0 ldi r23, 0x00 ; 0 2c47a: 80 e8 ldi r24, 0x80 ; 128 2c47c: 9f e3 ldi r25, 0x3F ; 63 2c47e: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 2c482: 9b 01 movw r18, r22 2c484: ac 01 movw r20, r24 2c486: c5 01 movw r24, r10 2c488: b4 01 movw r22, r8 2c48a: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 2c48e: 87 fd sbrc r24, 7 2c490: 61 c0 rjmp .+194 ; 0x2c554 <__vector_5+0x770> { // Clean the input command queue, inhibit serial processing using saved_printing cmdqueue_reset(); 2c492: 0e 94 5c 7f call 0xfeb8 ; 0xfeb8 card.sdprinting = false; 2c496: 10 92 8f 14 sts 0x148F, r1 ; 0x80148f saved_printing = true; 2c49a: 81 e0 ldi r24, 0x01 ; 1 2c49c: 80 93 a8 0d sts 0x0DA8, r24 ; 0x800da8 // Enable stepper driver interrupt to move Z axis. This should be fine as the planner and // command queues are empty, SD card printing is disabled, usb is inhibited. planner_aborted = false; 2c4a0: 10 92 ab 0d sts 0x0DAB, r1 ; 0x800dab sei(); 2c4a4: 78 94 sei 2c4a6: 80 91 f6 04 lds r24, 0x04F6 ; 0x8004f6 2c4aa: c0 e0 ldi r28, 0x00 ; 0 2c4ac: d1 e0 ldi r29, 0x01 ; 1 2c4ae: 02 c0 rjmp .+4 ; 0x2c4b4 <__vector_5+0x6d0> 2c4b0: d6 95 lsr r29 2c4b2: c7 95 ror r28 2c4b4: 8a 95 dec r24 2c4b6: e2 f7 brpl .-8 ; 0x2c4b0 <__vector_5+0x6cc> // The axis was moved: adjust Z as done on a regular UVLO. uint16_t z_res = tmc2130_get_res(Z_AXIS); uint16_t z_microsteps = tmc2130_rd_MSCNT(Z_AXIS); 2c4b8: 82 e0 ldi r24, 0x02 ; 2 2c4ba: 0f 94 4b 24 call 0x24896 ; 0x24896 current_position[Z_AXIS] += float(1024 - z_microsteps) 2c4be: 60 e0 ldi r22, 0x00 ; 0 2c4c0: 74 e0 ldi r23, 0x04 ; 4 2c4c2: 68 1b sub r22, r24 2c4c4: 79 0b sbc r23, r25 2c4c6: 90 e0 ldi r25, 0x00 ; 0 2c4c8: 80 e0 ldi r24, 0x00 ; 0 2c4ca: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 2c4ce: 4b 01 movw r8, r22 2c4d0: 5c 01 movw r10, r24 / (z_res * cs.axis_steps_per_mm[Z_AXIS]) 2c4d2: be 01 movw r22, r28 2c4d4: 90 e0 ldi r25, 0x00 ; 0 2c4d6: 80 e0 ldi r24, 0x00 ; 0 2c4d8: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 2c4dc: 20 91 c9 0d lds r18, 0x0DC9 ; 0x800dc9 2c4e0: 30 91 ca 0d lds r19, 0x0DCA ; 0x800dca 2c4e4: 40 91 cb 0d lds r20, 0x0DCB ; 0x800dcb 2c4e8: 50 91 cc 0d lds r21, 0x0DCC ; 0x800dcc 2c4ec: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 2c4f0: 9b 01 movw r18, r22 2c4f2: ac 01 movw r20, r24 2c4f4: c5 01 movw r24, r10 2c4f6: b4 01 movw r22, r8 2c4f8: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> + UVLO_TINY_Z_AXIS_SHIFT; 2c4fc: 2a e0 ldi r18, 0x0A ; 10 2c4fe: 37 ed ldi r19, 0xD7 ; 215 2c500: 43 e2 ldi r20, 0x23 ; 35 2c502: 5e e3 ldi r21, 0x3E ; 62 2c504: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> sei(); // The axis was moved: adjust Z as done on a regular UVLO. uint16_t z_res = tmc2130_get_res(Z_AXIS); uint16_t z_microsteps = tmc2130_rd_MSCNT(Z_AXIS); current_position[Z_AXIS] += float(1024 - z_microsteps) 2c508: 20 91 99 06 lds r18, 0x0699 ; 0x800699 2c50c: 30 91 9a 06 lds r19, 0x069A ; 0x80069a 2c510: 40 91 9b 06 lds r20, 0x069B ; 0x80069b 2c514: 50 91 9c 06 lds r21, 0x069C ; 0x80069c 2c518: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 2c51c: 60 93 99 06 sts 0x0699, r22 ; 0x800699 2c520: 70 93 9a 06 sts 0x069A, r23 ; 0x80069a 2c524: 80 93 9b 06 sts 0x069B, r24 ; 0x80069b 2c528: 90 93 9c 06 sts 0x069C, r25 ; 0x80069c / (z_res * cs.axis_steps_per_mm[Z_AXIS]) + UVLO_TINY_Z_AXIS_SHIFT; plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS]/60); 2c52c: 65 e5 ldi r22, 0x55 ; 85 2c52e: 75 e5 ldi r23, 0x55 ; 85 2c530: 85 e5 ldi r24, 0x55 ; 85 2c532: 91 e4 ldi r25, 0x41 ; 65 2c534: 0f 94 04 c0 call 0x38008 ; 0x38008 st_synchronize(); 2c538: 0f 94 a3 42 call 0x28546 ; 0x28546 if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 2c53c: 40 91 99 06 lds r20, 0x0699 ; 0x800699 2c540: 50 91 9a 06 lds r21, 0x069A ; 0x80069a 2c544: 60 91 9b 06 lds r22, 0x069B ; 0x80069b 2c548: 70 91 9c 06 lds r23, 0x069C ; 0x80069c 2c54c: 8a ed ldi r24, 0xDA ; 218 2c54e: 9e e0 ldi r25, 0x0E ; 14 2c550: 0f 94 0d dc call 0x3b81a ; 0x3b81a if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 2c554: 62 e0 ldi r22, 0x02 ; 2 2c556: 85 ea ldi r24, 0xA5 ; 165 2c558: 9f e0 ldi r25, 0x0F ; 15 2c55a: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 // Update the the "power outage" flag. eeprom_update_byte_notify((uint8_t*)EEPROM_UVLO, PowerPanic::PENDING_RECOVERY_RETRY); // Increment power failure counter eeprom_increment_byte((uint8_t*)EEPROM_POWER_COUNT); 2c55e: 84 e6 ldi r24, 0x64 ; 100 2c560: 9f e0 ldi r25, 0x0F ; 15 2c562: 0e 94 40 76 call 0xec80 ; 0xec80 eeprom_increment_word((uint16_t*)EEPROM_POWER_COUNT_TOT); 2c566: 8f ef ldi r24, 0xFF ; 255 2c568: 9e e0 ldi r25, 0x0E ; 14 2c56a: 0e 94 33 76 call 0xec66 ; 0xec66 printf_P(_N("UVLO_TINY - end %d\n"), _millis() - time_start); 2c56e: 0f 94 22 29 call 0x25244 ; 0x25244 2c572: dc 01 movw r26, r24 2c574: cb 01 movw r24, r22 2c576: 8c 19 sub r24, r12 2c578: 9d 09 sbc r25, r13 2c57a: ae 09 sbc r26, r14 2c57c: bf 09 sbc r27, r15 2c57e: bf 93 push r27 2c580: af 93 push r26 2c582: 9f 93 push r25 2c584: 8f 93 push r24 2c586: 85 e2 ldi r24, 0x25 ; 37 2c588: 9e e6 ldi r25, 0x6E ; 110 2c58a: 9f 93 push r25 2c58c: 8f 93 push r24 2c58e: 0f 94 99 da call 0x3b532 ; 0x3b532 uvlo_drain_reset(); 2c592: 0f 94 d7 5e call 0x2bdae ; 0x2bdae // There is already a pending recovery waiting. Power outage in this scenario // arrives before we can fully recover the print. In that case call a 'tiny' // version of uvlo_() which doesn't overwrite the print state already waiting in EEPROM uvlo_tiny(); } } 2c596: ff 91 pop r31 2c598: ef 91 pop r30 2c59a: df 91 pop r29 2c59c: cf 91 pop r28 2c59e: bf 91 pop r27 2c5a0: af 91 pop r26 2c5a2: 9f 91 pop r25 2c5a4: 8f 91 pop r24 2c5a6: 7f 91 pop r23 2c5a8: 6f 91 pop r22 2c5aa: 5f 91 pop r21 2c5ac: 4f 91 pop r20 2c5ae: 3f 91 pop r19 2c5b0: 2f 91 pop r18 2c5b2: 1f 91 pop r17 2c5b4: 0f 91 pop r16 2c5b6: ff 90 pop r15 2c5b8: ef 90 pop r14 2c5ba: df 90 pop r13 2c5bc: cf 90 pop r12 2c5be: bf 90 pop r11 2c5c0: af 90 pop r10 2c5c2: 9f 90 pop r9 2c5c4: 8f 90 pop r8 2c5c6: 0f 90 pop r0 2c5c8: 0b be out 0x3b, r0 ; 59 2c5ca: 0f 90 pop r0 2c5cc: 0f be out 0x3f, r0 ; 63 2c5ce: 0f 90 pop r0 2c5d0: 1f 90 pop r1 2c5d2: 18 95 reti 0002c5d4 : } } uint16_t planner_calc_sd_length() { uint8_t _block_buffer_head = block_buffer_head; 2c5d4: 60 91 a4 0d lds r22, 0x0DA4 ; 0x800da4 uint8_t _block_buffer_tail = block_buffer_tail; 2c5d8: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 uint16_t sdlen = 0; 2c5dc: 30 e0 ldi r19, 0x00 ; 0 2c5de: 20 e0 ldi r18, 0x00 ; 0 while (_block_buffer_head != _block_buffer_tail) { sdlen += block_buffer[_block_buffer_tail].sdlen; 2c5e0: 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) 2c5e2: 96 17 cp r25, r22 2c5e4: 61 f0 breq .+24 ; 0x2c5fe { sdlen += block_buffer[_block_buffer_tail].sdlen; 2c5e6: 89 9f mul r24, r25 2c5e8: f0 01 movw r30, r0 2c5ea: 11 24 eor r1, r1 2c5ec: e0 5d subi r30, 0xD0 ; 208 2c5ee: f8 4f sbci r31, 0xF8 ; 248 2c5f0: 40 81 ld r20, Z 2c5f2: 51 81 ldd r21, Z+1 ; 0x01 2c5f4: 24 0f add r18, r20 2c5f6: 35 1f adc r19, r21 _block_buffer_tail = (_block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 2c5f8: 9f 5f subi r25, 0xFF ; 255 2c5fa: 9f 70 andi r25, 0x0F ; 15 2c5fc: f2 cf rjmp .-28 ; 0x2c5e2 } return sdlen; } 2c5fe: c9 01 movw r24, r18 2c600: 08 95 ret 0002c602 : } #endif /* PLANNER_DIAGNOSTICS */ void planner_add_sd_length(uint16_t sdlen) { if (block_buffer_head != block_buffer_tail) { 2c602: 30 91 a4 0d lds r19, 0x0DA4 ; 0x800da4 2c606: 20 91 a5 0d lds r18, 0x0DA5 ; 0x800da5 2c60a: 32 17 cp r19, r18 2c60c: 91 f0 breq .+36 ; 0x2c632 // 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; 2c60e: e0 91 a4 0d lds r30, 0x0DA4 ; 0x800da4 } // 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) 2c612: e1 11 cpse r30, r1 2c614: 01 c0 rjmp .+2 ; 0x2c618 block_index = BLOCK_BUFFER_SIZE; 2c616: e0 e1 ldi r30, 0x10 ; 16 -- block_index; 2c618: 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; 2c61a: 2e e6 ldi r18, 0x6E ; 110 2c61c: e2 9f mul r30, r18 2c61e: f0 01 movw r30, r0 2c620: 11 24 eor r1, r1 2c622: e0 5d subi r30, 0xD0 ; 208 2c624: f8 4f sbci r31, 0xF8 ; 248 2c626: 20 81 ld r18, Z 2c628: 31 81 ldd r19, Z+1 ; 0x01 2c62a: 82 0f add r24, r18 2c62c: 93 1f adc r25, r19 2c62e: 91 83 std Z+1, r25 ; 0x01 2c630: 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. } } 2c632: 08 95 ret 0002c634 : } #endif //PREVENT_DANGEROUS_EXTRUDE // Calculate the steps/s^2 acceleration rates, based on the mm/s^s void reset_acceleration_rates() { 2c634: 8f 92 push r8 2c636: 9f 92 push r9 2c638: af 92 push r10 2c63a: bf 92 push r11 2c63c: cf 92 push r12 2c63e: df 92 push r13 2c640: ef 92 push r14 2c642: ff 92 push r15 2c644: 0f 93 push r16 2c646: 1f 93 push r17 2c648: cf 93 push r28 2c64a: df 93 push r29 2c64c: c0 91 6f 02 lds r28, 0x026F ; 0x80026f 2c650: d0 91 70 02 lds r29, 0x0270 ; 0x800270 2c654: 81 ec ldi r24, 0xC1 ; 193 2c656: e8 2e mov r14, r24 2c658: 8d e0 ldi r24, 0x0D ; 13 2c65a: f8 2e mov r15, r24 2c65c: 0d e4 ldi r16, 0x4D ; 77 2c65e: 15 e0 ldi r17, 0x05 ; 5 2c660: 6e 01 movw r12, r28 2c662: 80 e1 ldi r24, 0x10 ; 16 2c664: c8 0e add r12, r24 2c666: d1 1c adc r13, r1 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]; 2c668: 69 91 ld r22, Y+ 2c66a: 79 91 ld r23, Y+ 2c66c: 89 91 ld r24, Y+ 2c66e: 99 91 ld r25, Y+ 2c670: f7 01 movw r30, r14 2c672: 81 90 ld r8, Z+ 2c674: 91 90 ld r9, Z+ 2c676: a1 90 ld r10, Z+ 2c678: b1 90 ld r11, Z+ 2c67a: 7f 01 movw r14, r30 2c67c: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 2c680: a5 01 movw r20, r10 2c682: 94 01 movw r18, r8 2c684: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 2c688: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 2c68c: f8 01 movw r30, r16 2c68e: 61 93 st Z+, r22 2c690: 71 93 st Z+, r23 2c692: 81 93 st Z+, r24 2c694: 91 93 st Z+, r25 2c696: 8f 01 movw r16, r30 #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++) 2c698: cc 15 cp r28, r12 2c69a: dd 05 cpc r29, r13 2c69c: 29 f7 brne .-54 ; 0x2c668 max_acceleration_steps_per_s2[i] = max_acceleration_mm_per_s2[i] * cs.axis_steps_per_mm[i]; } 2c69e: df 91 pop r29 2c6a0: cf 91 pop r28 2c6a2: 1f 91 pop r17 2c6a4: 0f 91 pop r16 2c6a6: ff 90 pop r15 2c6a8: ef 90 pop r14 2c6aa: df 90 pop r13 2c6ac: cf 90 pop r12 2c6ae: bf 90 pop r11 2c6b0: af 90 pop r10 2c6b2: 9f 90 pop r9 2c6b4: 8f 90 pop r8 2c6b6: 08 95 ret 0002c6b8 : #ifdef TMC2130 void update_mode_profile() { if (tmc2130_mode == TMC2130_MODE_NORMAL) 2c6b8: 80 91 8b 06 lds r24, 0x068B ; 0x80068b 2c6bc: 81 11 cpse r24, r1 2c6be: 0e c0 rjmp .+28 ; 0x2c6dc { max_feedrate = cs.max_feedrate_normal; 2c6c0: 81 ed ldi r24, 0xD1 ; 209 2c6c2: 9d e0 ldi r25, 0x0D ; 13 2c6c4: 90 93 72 02 sts 0x0272, r25 ; 0x800272 2c6c8: 80 93 71 02 sts 0x0271, r24 ; 0x800271 max_acceleration_mm_per_s2 = cs.max_acceleration_mm_per_s2_normal; 2c6cc: 81 ee ldi r24, 0xE1 ; 225 2c6ce: 9d e0 ldi r25, 0x0D ; 13 } else if (tmc2130_mode == TMC2130_MODE_SILENT) { max_feedrate = cs.max_feedrate_silent; max_acceleration_mm_per_s2 = cs.max_acceleration_mm_per_s2_silent; 2c6d0: 90 93 70 02 sts 0x0270, r25 ; 0x800270 2c6d4: 80 93 6f 02 sts 0x026F, r24 ; 0x80026f } reset_acceleration_rates(); 2c6d8: 0d 94 1a 63 jmp 0x2c634 ; 0x2c634 if (tmc2130_mode == TMC2130_MODE_NORMAL) { max_feedrate = cs.max_feedrate_normal; max_acceleration_mm_per_s2 = cs.max_acceleration_mm_per_s2_normal; } else if (tmc2130_mode == TMC2130_MODE_SILENT) 2c6dc: 81 30 cpi r24, 0x01 ; 1 2c6de: e1 f7 brne .-8 ; 0x2c6d8 { max_feedrate = cs.max_feedrate_silent; 2c6e0: 89 e5 ldi r24, 0x59 ; 89 2c6e2: 9e e0 ldi r25, 0x0E ; 14 2c6e4: 90 93 72 02 sts 0x0272, r25 ; 0x800272 2c6e8: 80 93 71 02 sts 0x0271, r24 ; 0x800271 max_acceleration_mm_per_s2 = cs.max_acceleration_mm_per_s2_silent; 2c6ec: 89 e6 ldi r24, 0x69 ; 105 2c6ee: 9e e0 ldi r25, 0x0E ; 14 2c6f0: ef cf rjmp .-34 ; 0x2c6d0 0002c6f2 : } void plan_set_e_position(const float &e) { #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 2c6f2: fc 01 movw r30, r24 2c6f4: 40 81 ld r20, Z 2c6f6: 51 81 ldd r21, Z+1 ; 0x01 2c6f8: 62 81 ldd r22, Z+2 ; 0x02 2c6fa: 73 81 ldd r23, Z+3 ; 0x03 2c6fc: 40 93 d8 04 sts 0x04D8, r20 ; 0x8004d8 2c700: 50 93 d9 04 sts 0x04D9, r21 ; 0x8004d9 2c704: 60 93 da 04 sts 0x04DA, r22 ; 0x8004da 2c708: 70 93 db 04 sts 0x04DB, r23 ; 0x8004db #endif position[E_AXIS] = lround(e*cs.axis_steps_per_mm[E_AXIS]); 2c70c: 20 91 cd 0d lds r18, 0x0DCD ; 0x800dcd 2c710: 30 91 ce 0d lds r19, 0x0DCE ; 0x800dce 2c714: 40 91 cf 0d lds r20, 0x0DCF ; 0x800dcf 2c718: 50 91 d0 0d lds r21, 0x0DD0 ; 0x800dd0 2c71c: 60 81 ld r22, Z 2c71e: 71 81 ldd r23, Z+1 ; 0x01 2c720: 82 81 ldd r24, Z+2 ; 0x02 2c722: 93 81 ldd r25, Z+3 ; 0x03 2c724: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 2c728: 0f 94 3c e0 call 0x3c078 ; 0x3c078 2c72c: e2 ea ldi r30, 0xA2 ; 162 2c72e: f6 e0 ldi r31, 0x06 ; 6 2c730: 64 87 std Z+12, r22 ; 0x0c 2c732: 75 87 std Z+13, r23 ; 0x0d 2c734: 86 87 std Z+14, r24 ; 0x0e 2c736: 97 87 std Z+15, r25 ; 0x0f CRITICAL_SECTION_END; } void st_set_e_position(const long &e) { CRITICAL_SECTION_START; 2c738: 8f b7 in r24, 0x3f ; 63 2c73a: f8 94 cli count_position[E_AXIS] = e; 2c73c: 44 85 ldd r20, Z+12 ; 0x0c 2c73e: 55 85 ldd r21, Z+13 ; 0x0d 2c740: 66 85 ldd r22, Z+14 ; 0x0e 2c742: 77 85 ldd r23, Z+15 ; 0x0f 2c744: 40 93 be 06 sts 0x06BE, r20 ; 0x8006be 2c748: 50 93 bf 06 sts 0x06BF, r21 ; 0x8006bf 2c74c: 60 93 c0 06 sts 0x06C0, r22 ; 0x8006c0 2c750: 70 93 c1 06 sts 0x06C1, r23 ; 0x8006c1 CRITICAL_SECTION_END; 2c754: 8f bf out 0x3f, r24 ; 63 st_set_e_position(position[E_AXIS]); } 2c756: 08 95 ret 0002c758 : // 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; 2c758: fc 01 movw r30, r24 2c75a: 40 81 ld r20, Z 2c75c: 51 81 ldd r21, Z+1 ; 0x01 2c75e: 62 81 ldd r22, Z+2 ; 0x02 2c760: 73 81 ldd r23, Z+3 ; 0x03 2c762: 40 93 d4 04 sts 0x04D4, r20 ; 0x8004d4 2c766: 50 93 d5 04 sts 0x04D5, r21 ; 0x8004d5 2c76a: 60 93 d6 04 sts 0x04D6, r22 ; 0x8004d6 2c76e: 70 93 d7 04 sts 0x04D7, r23 ; 0x8004d7 #endif position[Z_AXIS] = lround(z*cs.axis_steps_per_mm[Z_AXIS]); 2c772: 20 91 c9 0d lds r18, 0x0DC9 ; 0x800dc9 2c776: 30 91 ca 0d lds r19, 0x0DCA ; 0x800dca 2c77a: 40 91 cb 0d lds r20, 0x0DCB ; 0x800dcb 2c77e: 50 91 cc 0d lds r21, 0x0DCC ; 0x800dcc 2c782: 60 81 ld r22, Z 2c784: 71 81 ldd r23, Z+1 ; 0x01 2c786: 82 81 ldd r24, Z+2 ; 0x02 2c788: 93 81 ldd r25, Z+3 ; 0x03 2c78a: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 2c78e: 0f 94 3c e0 call 0x3c078 ; 0x3c078 2c792: 60 93 aa 06 sts 0x06AA, r22 ; 0x8006aa 2c796: 70 93 ab 06 sts 0x06AB, r23 ; 0x8006ab 2c79a: 80 93 ac 06 sts 0x06AC, r24 ; 0x8006ac 2c79e: 90 93 ad 06 sts 0x06AD, r25 ; 0x8006ad st_set_position(position); 2c7a2: 0d 94 a6 87 jmp 0x30f4c ; 0x30f4c 0002c7a6 : * 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) { 2c7a6: 2f 92 push r2 2c7a8: 3f 92 push r3 2c7aa: 4f 92 push r4 2c7ac: 5f 92 push r5 2c7ae: 6f 92 push r6 2c7b0: 7f 92 push r7 2c7b2: 8f 92 push r8 2c7b4: 9f 92 push r9 2c7b6: af 92 push r10 2c7b8: bf 92 push r11 2c7ba: cf 92 push r12 2c7bc: df 92 push r13 2c7be: ef 92 push r14 2c7c0: ff 92 push r15 2c7c2: 0f 93 push r16 2c7c4: 1f 93 push r17 2c7c6: cf 93 push r28 2c7c8: df 93 push r29 2c7ca: cd b7 in r28, 0x3d ; 61 2c7cc: de b7 in r29, 0x3e ; 62 2c7ce: c2 54 subi r28, 0x42 ; 66 2c7d0: d1 09 sbc r29, r1 2c7d2: 0f b6 in r0, 0x3f ; 63 2c7d4: f8 94 cli 2c7d6: de bf out 0x3e, r29 ; 62 2c7d8: 0f be out 0x3f, r0 ; 63 2c7da: cd bf out 0x3d, r28 ; 61 2c7dc: 4c 01 movw r8, r24 2c7de: 5b 01 movw r10, r22 2c7e0: 6a 01 movw r12, r20 2c7e2: 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) {} 2c7e4: 19 82 std Y+1, r1 ; 0x01 2c7e6: 1c 82 std Y+4, r1 ; 0x04 2c7e8: 1c 8e std Y+28, r1 ; 0x1c 2c7ea: 1f 8e std Y+31, r1 ; 0x1f uint8_t dname[11]; SdBaseFile dir1, dir2; SdBaseFile *parent = dirFile; SdBaseFile *sub = &dir1; if (!dirFile) goto fail; 2c7ec: 67 2b or r22, r23 2c7ee: 21 f5 brne .+72 ; 0x2c838 sub = parent != &dir1 ? &dir1 : &dir2; } return open(parent, dname, oflag); fail: return false; 2c7f0: 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; 2c7f2: ce 01 movw r24, r28 2c7f4: 4c 96 adiw r24, 0x1c ; 28 2c7f6: 0e 94 49 77 call 0xee92 ; 0xee92 2c7fa: ce 01 movw r24, r28 2c7fc: 01 96 adiw r24, 0x01 ; 1 2c7fe: 0e 94 49 77 call 0xee92 ; 0xee92 } return open(parent, dname, oflag); fail: return false; } 2c802: 81 2f mov r24, r17 2c804: ce 5b subi r28, 0xBE ; 190 2c806: df 4f sbci r29, 0xFF ; 255 2c808: 0f b6 in r0, 0x3f ; 63 2c80a: f8 94 cli 2c80c: de bf out 0x3e, r29 ; 62 2c80e: 0f be out 0x3f, r0 ; 63 2c810: cd bf out 0x3d, r28 ; 61 2c812: df 91 pop r29 2c814: cf 91 pop r28 2c816: 1f 91 pop r17 2c818: 0f 91 pop r16 2c81a: ff 90 pop r15 2c81c: ef 90 pop r14 2c81e: df 90 pop r13 2c820: cf 90 pop r12 2c822: bf 90 pop r11 2c824: af 90 pop r10 2c826: 9f 90 pop r9 2c828: 8f 90 pop r8 2c82a: 7f 90 pop r7 2c82c: 6f 90 pop r6 2c82e: 5f 90 pop r5 2c830: 4f 90 pop r4 2c832: 3f 90 pop r3 2c834: 2f 90 pop r2 2c836: 08 95 ret SdBaseFile *sub = &dir1; if (!dirFile) goto fail; // error if already open if (isOpen()) goto fail; 2c838: fc 01 movw r30, r24 2c83a: 83 81 ldd r24, Z+3 ; 0x03 2c83c: 81 11 cpse r24, r1 2c83e: d8 cf rjmp .-80 ; 0x2c7f0 if (*path == '/') { 2c840: fa 01 movw r30, r20 2c842: 80 81 ld r24, Z 2c844: 8f 32 cpi r24, 0x2F ; 47 2c846: c1 f4 brne .+48 ; 0x2c878 2c848: ca 01 movw r24, r20 2c84a: 6c 01 movw r12, r24 2c84c: 01 96 adiw r24, 0x01 ; 1 while (*path == '/') path++; 2c84e: f6 01 movw r30, r12 2c850: 20 81 ld r18, Z 2c852: 2f 32 cpi r18, 0x2F ; 47 2c854: d1 f3 breq .-12 ; 0x2c84a 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; 2c856: f5 01 movw r30, r10 2c858: 83 81 ldd r24, Z+3 ; 0x03 2c85a: 82 50 subi r24, 0x02 ; 2 if (!dirFile->isRoot()) { 2c85c: 82 30 cpi r24, 0x02 ; 2 2c85e: 60 f0 brcs .+24 ; 0x2c878 if (!dir2.openRoot(dirFile->vol_)) goto fail; 2c860: 61 8d ldd r22, Z+25 ; 0x19 2c862: 72 8d ldd r23, Z+26 ; 0x1a 2c864: ce 01 movw r24, r28 2c866: 4c 96 adiw r24, 0x1c ; 28 2c868: 0f 94 84 55 call 0x2ab08 ; 0x2ab08 parent = &dir2; 2c86c: 8e 01 movw r16, r28 2c86e: 04 5e subi r16, 0xE4 ; 228 2c870: 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; 2c872: 81 11 cpse r24, r1 2c874: 02 c0 rjmp .+4 ; 0x2c87a 2c876: bc cf rjmp .-136 ; 0x2c7f0 // error if already open if (isOpen()) goto fail; if (*path == '/') { while (*path == '/') path++; if (!dirFile->isRoot()) { 2c878: 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; 2c87a: ce 01 movw r24, r28 2c87c: 01 96 adiw r24, 0x01 ; 1 2c87e: 7c 01 movw r14, r24 2c880: 3c 01 movw r6, r24 2c882: 2e 01 movw r4, r28 2c884: 9c e1 ldi r25, 0x1C ; 28 2c886: 49 0e add r4, r25 2c888: 51 1c adc r5, r1 2c88a: 23 96 adiw r28, 0x03 ; 3 2c88c: ef ae std Y+63, r14 ; 0x3f 2c88e: 23 97 sbiw r28, 0x03 ; 3 2c890: 2f 2c mov r2, r15 2c892: fe 01 movw r30, r28 2c894: f7 96 adiw r30, 0x37 ; 55 2c896: cf 01 movw r24, r30 2c898: 0b 96 adiw r24, 0x0b ; 11 2c89a: 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++] = ' '; 2c89c: 20 e2 ldi r18, 0x20 ; 32 2c89e: 21 93 st Z+, r18 2c8a0: e8 17 cp r30, r24 2c8a2: f9 07 cpc r31, r25 2c8a4: d9 f7 brne .-10 ; 0x2c89c 2c8a6: 96 01 movw r18, r12 i = 0; 2c8a8: 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 2c8aa: 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 != '/') { 2c8ac: d9 01 movw r26, r18 2c8ae: 8d 91 ld r24, X+ 2c8b0: 88 23 and r24, r24 2c8b2: 49 f1 breq .+82 ; 0x2c906 2c8b4: 8f 32 cpi r24, 0x2F ; 47 2c8b6: 39 f1 breq .+78 ; 0x2c906 c = *str++; 2c8b8: 28 2f mov r18, r24 if (c == '.') { 2c8ba: 8e 32 cpi r24, 0x2E ; 46 2c8bc: 39 f4 brne .+14 ; 0x2c8cc if (n == 10) goto fail; // only one dot allowed 2c8be: 6a 30 cpi r22, 0x0A ; 10 2c8c0: 09 f4 brne .+2 ; 0x2c8c4 2c8c2: 96 cf rjmp .-212 ; 0x2c7f0 n = 10; // max index for full 8.3 name i = 8; // place for extension 2c8c4: 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 2c8c6: 6a e0 ldi r22, 0x0A ; 10 2c8c8: 9d 01 movw r18, r26 2c8ca: f0 cf rjmp .-32 ; 0x2c8ac 2c8cc: e5 e8 ldi r30, 0x85 ; 133 2c8ce: f2 e9 ldi r31, 0x92 ; 146 //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; 2c8d0: 34 91 lpm r19, Z 2c8d2: 33 23 and r19, r19 2c8d4: 21 f0 breq .+8 ; 0x2c8de 2c8d6: 31 96 adiw r30, 0x01 ; 1 2c8d8: 83 13 cpse r24, r19 2c8da: fa cf rjmp .-12 ; 0x2c8d0 2c8dc: 89 cf rjmp .-238 ; 0x2c7f0 // check size and only allow ASCII printable characters if (i > n || c < 0X21 || c > 0X7E)goto fail; 2c8de: 69 17 cp r22, r25 2c8e0: 08 f4 brcc .+2 ; 0x2c8e4 2c8e2: 86 cf rjmp .-244 ; 0x2c7f0 2c8e4: 3f ed ldi r19, 0xDF ; 223 2c8e6: 38 0f add r19, r24 2c8e8: 3e 35 cpi r19, 0x5E ; 94 2c8ea: 08 f0 brcs .+2 ; 0x2c8ee 2c8ec: 81 cf rjmp .-254 ; 0x2c7f0 // only upper case allowed in 8.3 names - convert lower to upper name[i++] = (c < 'a' || c > 'z') ? (c) : (c + ('A' - 'a')); 2c8ee: 3f e9 ldi r19, 0x9F ; 159 2c8f0: 38 0f add r19, r24 2c8f2: 3a 31 cpi r19, 0x1A ; 26 2c8f4: 10 f4 brcc .+4 ; 0x2c8fa 2c8f6: 20 ee ldi r18, 0xE0 ; 224 2c8f8: 28 0f add r18, r24 2c8fa: fa 01 movw r30, r20 2c8fc: e9 0f add r30, r25 2c8fe: f1 1d adc r31, r1 2c900: 20 83 st Z, r18 2c902: 9f 5f subi r25, 0xFF ; 255 2c904: e1 cf rjmp .-62 ; 0x2c8c8 if (!dir2.openRoot(dirFile->vol_)) goto fail; parent = &dir2; } } while (1) { if (!make83Name(path, dname, &path)) goto fail; 2c906: 8f a9 ldd r24, Y+55 ; 0x37 2c908: 80 32 cpi r24, 0x20 ; 32 2c90a: 09 f4 brne .+2 ; 0x2c90e 2c90c: 71 cf rjmp .-286 ; 0x2c7f0 2c90e: 69 01 movw r12, r18 while (*path == '/') path++; 2c910: f9 01 movw r30, r18 2c912: 80 81 ld r24, Z 2c914: 2f 5f subi r18, 0xFF ; 255 2c916: 3f 4f sbci r19, 0xFF ; 255 2c918: 8f 32 cpi r24, 0x2F ; 47 2c91a: c9 f3 breq .-14 ; 0x2c90e if (!*path) break; 2c91c: 88 23 and r24, r24 2c91e: d9 f0 breq .+54 ; 0x2c956 if (!sub->open(parent, dname, O_READ)) goto fail; 2c920: 21 e0 ldi r18, 0x01 ; 1 2c922: b8 01 movw r22, r16 2c924: c7 01 movw r24, r14 2c926: 0f 94 f2 59 call 0x2b3e4 ; 0x2b3e4 2c92a: 88 23 and r24, r24 2c92c: 09 f4 brne .+2 ; 0x2c930 2c92e: 60 cf rjmp .-320 ; 0x2c7f0 if (parent != dirFile) parent->close(); 2c930: 0a 15 cp r16, r10 2c932: 1b 05 cpc r17, r11 2c934: 19 f0 breq .+6 ; 0x2c93c 2c936: c8 01 movw r24, r16 2c938: 0f 94 2b 58 call 0x2b056 ; 0x2b056 parent = sub; sub = parent != &dir1 ? &dir1 : &dir2; 2c93c: 94 2d mov r25, r4 2c93e: 85 2d mov r24, r5 2c940: 6e 14 cp r6, r14 2c942: 7f 04 cpc r7, r15 2c944: 21 f0 breq .+8 ; 0x2c94e 2c946: 23 96 adiw r28, 0x03 ; 3 2c948: 9f ad ldd r25, Y+63 ; 0x3f 2c94a: 23 97 sbiw r28, 0x03 ; 3 2c94c: 82 2d mov r24, r2 2c94e: 87 01 movw r16, r14 2c950: e9 2e mov r14, r25 2c952: f8 2e mov r15, r24 2c954: 9e cf rjmp .-196 ; 0x2c892 } return open(parent, dname, oflag); 2c956: 23 2d mov r18, r3 2c958: b8 01 movw r22, r16 2c95a: c4 01 movw r24, r8 2c95c: 0f 94 f2 59 call 0x2b3e4 ; 0x2b3e4 2c960: 18 2f mov r17, r24 2c962: 47 cf rjmp .-370 ; 0x2c7f2 0002c964 : 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){ 2c964: 2f 92 push r2 2c966: 3f 92 push r3 2c968: 4f 92 push r4 2c96a: 5f 92 push r5 2c96c: 6f 92 push r6 2c96e: 7f 92 push r7 2c970: 8f 92 push r8 2c972: 9f 92 push r9 2c974: af 92 push r10 2c976: bf 92 push r11 2c978: cf 92 push r12 2c97a: df 92 push r13 2c97c: ef 92 push r14 2c97e: ff 92 push r15 2c980: 0f 93 push r16 2c982: 1f 93 push r17 2c984: cf 93 push r28 2c986: df 93 push r29 2c988: 00 d0 rcall .+0 ; 0x2c98a 2c98a: 1f 92 push r1 2c98c: 1f 92 push r1 2c98e: cd b7 in r28, 0x3d ; 61 2c990: de b7 in r29, 0x3e ; 62 2c992: 1c 01 movw r2, r24 2c994: 2a 01 movw r4, r20 2c996: 3b 01 movw r6, r22 2c998: 00 e2 ldi r16, 0x20 ; 32 2c99a: 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){ 2c99c: 19 82 std Y+1, r1 ; 0x01 2c99e: 99 81 ldd r25, Y+1 ; 0x01 2c9a0: 89 2f mov r24, r25 2c9a2: 90 e0 ldi r25, 0x00 ; 0 2c9a4: 9b 83 std Y+3, r25 ; 0x03 2c9a6: 8a 83 std Y+2, r24 ; 0x02 2c9a8: 80 17 cp r24, r16 2c9aa: 91 07 cpc r25, r17 2c9ac: 9c f5 brge .+102 ; 0x2ca14 if (points[j] > points[j + 1]) 2c9ae: 88 0f add r24, r24 2c9b0: 99 1f adc r25, r25 2c9b2: 88 0f add r24, r24 2c9b4: 99 1f adc r25, r25 2c9b6: 9d 83 std Y+5, r25 ; 0x05 2c9b8: 8c 83 std Y+4, r24 ; 0x04 2c9ba: 82 0d add r24, r2 2c9bc: 93 1d adc r25, r3 2c9be: 9b 83 std Y+3, r25 ; 0x03 2c9c0: 8a 83 std Y+2, r24 ; 0x02 2c9c2: fc 01 movw r30, r24 2c9c4: c0 80 ld r12, Z 2c9c6: d1 80 ldd r13, Z+1 ; 0x01 2c9c8: e2 80 ldd r14, Z+2 ; 0x02 2c9ca: f3 80 ldd r15, Z+3 ; 0x03 2c9cc: 8c 81 ldd r24, Y+4 ; 0x04 2c9ce: 9d 81 ldd r25, Y+5 ; 0x05 2c9d0: 04 96 adiw r24, 0x04 ; 4 2c9d2: 82 0d add r24, r2 2c9d4: 93 1d adc r25, r3 2c9d6: 9d 83 std Y+5, r25 ; 0x05 2c9d8: 8c 83 std Y+4, r24 ; 0x04 2c9da: fc 01 movw r30, r24 2c9dc: 80 80 ld r8, Z 2c9de: 91 80 ldd r9, Z+1 ; 0x01 2c9e0: a2 80 ldd r10, Z+2 ; 0x02 2c9e2: b3 80 ldd r11, Z+3 ; 0x03 2c9e4: a5 01 movw r20, r10 2c9e6: 94 01 movw r18, r8 2c9e8: c7 01 movw r24, r14 2c9ea: b6 01 movw r22, r12 2c9ec: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 2c9f0: 18 16 cp r1, r24 2c9f2: 64 f4 brge .+24 ; 0x2ca0c SWAP(points[j], points[j + 1]); 2c9f4: ea 81 ldd r30, Y+2 ; 0x02 2c9f6: fb 81 ldd r31, Y+3 ; 0x03 2c9f8: 80 82 st Z, r8 2c9fa: 91 82 std Z+1, r9 ; 0x01 2c9fc: a2 82 std Z+2, r10 ; 0x02 2c9fe: b3 82 std Z+3, r11 ; 0x03 2ca00: ec 81 ldd r30, Y+4 ; 0x04 2ca02: fd 81 ldd r31, Y+5 ; 0x05 2ca04: c0 82 st Z, r12 2ca06: d1 82 std Z+1, r13 ; 0x01 2ca08: e2 82 std Z+2, r14 ; 0x02 2ca0a: 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){ 2ca0c: f9 81 ldd r31, Y+1 ; 0x01 2ca0e: ff 5f subi r31, 0xFF ; 255 2ca10: f9 83 std Y+1, r31 ; 0x01 2ca12: c5 cf rjmp .-118 ; 0x2c99e 2ca14: 01 50 subi r16, 0x01 ; 1 2ca16: 11 09 sbc r17, r1 2ca18: 08 f6 brcc .-126 ; 0x2c99c /// 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]; 2ca1a: f1 01 movw r30, r2 2ca1c: e0 5c subi r30, 0xC0 ; 192 2ca1e: 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); 2ca20: 20 81 ld r18, Z 2ca22: 31 81 ldd r19, Z+1 ; 0x01 2ca24: 42 81 ldd r20, Z+2 ; 0x02 2ca26: 53 81 ldd r21, Z+3 ; 0x03 2ca28: c3 01 movw r24, r6 2ca2a: b2 01 movw r22, r4 2ca2c: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 2ca30: 6b 01 movw r12, r22 2ca32: 7c 01 movw r14, r24 2ca34: 20 e0 ldi r18, 0x00 ; 0 2ca36: 30 e0 ldi r19, 0x00 ; 0 2ca38: 40 e0 ldi r20, 0x00 ; 0 2ca3a: 5f eb ldi r21, 0xBF ; 191 2ca3c: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 2ca40: 87 fd sbrc r24, 7 2ca42: 10 c0 rjmp .+32 ; 0x2ca64 2ca44: 20 e0 ldi r18, 0x00 ; 0 2ca46: 30 e0 ldi r19, 0x00 ; 0 2ca48: 40 e0 ldi r20, 0x00 ; 0 2ca4a: 5f e3 ldi r21, 0x3F ; 63 2ca4c: c7 01 movw r24, r14 2ca4e: b6 01 movw r22, r12 2ca50: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 2ca54: 18 16 cp r1, r24 2ca56: 5c f4 brge .+22 ; 0x2ca6e 2ca58: c1 2c mov r12, r1 2ca5a: d1 2c mov r13, r1 2ca5c: e1 2c mov r14, r1 2ca5e: 8f e3 ldi r24, 0x3F ; 63 2ca60: f8 2e mov r15, r24 2ca62: 05 c0 rjmp .+10 ; 0x2ca6e 2ca64: c1 2c mov r12, r1 2ca66: d1 2c mov r13, r1 2ca68: e1 2c mov r14, r1 2ca6a: 9f eb ldi r25, 0xBF ; 191 2ca6c: f9 2e mov r15, r25 } 2ca6e: c7 01 movw r24, r14 2ca70: b6 01 movw r22, r12 2ca72: 0f 90 pop r0 2ca74: 0f 90 pop r0 2ca76: 0f 90 pop r0 2ca78: 0f 90 pop r0 2ca7a: 0f 90 pop r0 2ca7c: df 91 pop r29 2ca7e: cf 91 pop r28 2ca80: 1f 91 pop r17 2ca82: 0f 91 pop r16 2ca84: ff 90 pop r15 2ca86: ef 90 pop r14 2ca88: df 90 pop r13 2ca8a: cf 90 pop r12 2ca8c: bf 90 pop r11 2ca8e: af 90 pop r10 2ca90: 9f 90 pop r9 2ca92: 8f 90 pop r8 2ca94: 7f 90 pop r7 2ca96: 6f 90 pop r6 2ca98: 5f 90 pop r5 2ca9a: 4f 90 pop r4 2ca9c: 3f 90 pop r3 2ca9e: 2f 90 pop r2 2caa0: 08 95 ret 0002caa2 : bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); } void ProtocolLogic::RecordUARTActivity() { lastUARTActivityMs = _millis(); 2caa2: 0f 94 22 29 call 0x25244 ; 0x25244 2caa6: 60 93 59 13 sts 0x1359, r22 ; 0x801359 2caaa: 70 93 5a 13 sts 0x135A, r23 ; 0x80135a 2caae: 80 93 5b 13 sts 0x135B, r24 ; 0x80135b 2cab2: 90 93 5c 13 sts 0x135C, r25 ; 0x80135c } 2cab6: 08 95 ret 0002cab8 : } return (uint8_t)ReqMsg().code; } void ProtocolLogic::DecrementRetryAttempts() { if (inAutoRetry && retryAttempts) { 2cab8: 80 91 9f 13 lds r24, 0x139F ; 0x80139f 2cabc: 88 23 and r24, r24 2cabe: 69 f0 breq .+26 ; 0x2cada 2cac0: 80 91 9e 13 lds r24, 0x139E ; 0x80139e 2cac4: 88 23 and r24, r24 2cac6: 49 f0 breq .+18 ; 0x2cada SERIAL_ECHOLNPGM("DecrementRetryAttempts"); 2cac8: 89 e7 ldi r24, 0x79 ; 121 2caca: 9b ea ldi r25, 0xAB ; 171 2cacc: 0e 94 93 79 call 0xf326 ; 0xf326 retryAttempts--; 2cad0: 80 91 9e 13 lds r24, 0x139E ; 0x80139e 2cad4: 81 50 subi r24, 0x01 ; 1 2cad6: 80 93 9e 13 sts 0x139E, r24 ; 0x80139e } } 2cada: 08 95 ret 0002cadc : MMU2_ECHO_MSGLN(tmp); } strncpy(lastMsg, tmp, rqs); } void ProtocolLogic::LogError(const char *reason_P) { 2cadc: 9f 92 push r9 2cade: af 92 push r10 2cae0: bf 92 push r11 2cae2: cf 92 push r12 2cae4: df 92 push r13 2cae6: ef 92 push r14 2cae8: ff 92 push r15 2caea: 0f 93 push r16 2caec: 1f 93 push r17 2caee: cf 93 push r28 2caf0: df 93 push r29 2caf2: cd b7 in r28, 0x3d ; 61 2caf4: de b7 in r29, 0x3e ; 62 2caf6: e0 97 sbiw r28, 0x30 ; 48 2caf8: 0f b6 in r0, 0x3f ; 63 2cafa: f8 94 cli 2cafc: de bf out 0x3e, r29 ; 62 2cafe: 0f be out 0x3f, r0 ; 63 2cb00: cd bf out 0x3d, r28 ; 61 2cb02: 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()]; 2cb04: e0 90 87 13 lds r14, 0x1387 ; 0x801387 2cb08: fe 01 movw r30, r28 2cb0a: 31 96 adiw r30, 0x01 ; 1 2cb0c: 21 e0 ldi r18, 0x01 ; 1 2cb0e: 30 e0 ldi r19, 0x00 ; 0 2cb10: 5f 01 movw r10, r30 2cb12: f1 2c mov r15, r1 2cb14: 40 e1 ldi r20, 0x10 ; 16 2cb16: c4 2e mov r12, r20 2cb18: d1 2c mov r13, r1 dst[i * 3] = NibbleToChar(b >> 4); dst[i * 3 + 1] = NibbleToChar(b & 0xf); dst[i * 3 + 2] = ' '; 2cb1a: 50 e2 ldi r21, 0x20 ; 32 2cb1c: 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()]; 2cb1e: c7 01 movw r24, r14 2cb20: 82 1b sub r24, r18 2cb22: 93 0b sbc r25, r19 2cb24: b6 01 movw r22, r12 2cb26: 0f 94 b4 dc call 0x3b968 ; 0x3b968 <__divmodhi4> 2cb2a: dc 01 movw r26, r24 2cb2c: bb 27 eor r27, r27 2cb2e: a6 5b subi r26, 0xB6 ; 182 2cb30: bc 4e sbci r27, 0xEC ; 236 2cb32: 9d 96 adiw r26, 0x2d ; 45 2cb34: 8c 91 ld r24, X dst[i * 3] = NibbleToChar(b >> 4); 2cb36: 48 2f mov r20, r24 2cb38: 50 e0 ldi r21, 0x00 ; 0 2cb3a: 94 e0 ldi r25, 0x04 ; 4 2cb3c: 55 95 asr r21 2cb3e: 47 95 ror r20 2cb40: 9a 95 dec r25 2cb42: e1 f7 brne .-8 ; 0x2cb3c lastReceivedBytes[lrb] = c; lrb = (lrb + 1) % lastReceivedBytes.size(); } constexpr char NibbleToChar(uint8_t c) { switch (c) { 2cb44: 96 ef ldi r25, 0xF6 ; 246 2cb46: 94 0f add r25, r20 2cb48: 96 30 cpi r25, 0x06 ; 6 2cb4a: a8 f1 brcs .+106 ; 0x2cbb6 case 5: case 6: case 7: case 8: case 9: return c + '0'; 2cb4c: 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); 2cb4e: 40 83 st Z, r20 dst[i * 3 + 1] = NibbleToChar(b & 0xf); 2cb50: 8f 70 andi r24, 0x0F ; 15 lastReceivedBytes[lrb] = c; lrb = (lrb + 1) % lastReceivedBytes.size(); } constexpr char NibbleToChar(uint8_t c) { switch (c) { 2cb52: 96 ef ldi r25, 0xF6 ; 246 2cb54: 98 0f add r25, r24 2cb56: 96 30 cpi r25, 0x06 ; 6 2cb58: 80 f1 brcs .+96 ; 0x2cbba case 5: case 6: case 7: case 8: case 9: return c + '0'; 2cb5a: 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); 2cb5c: 81 83 std Z+1, r24 ; 0x01 dst[i * 3 + 2] = ' '; 2cb5e: 92 82 std Z+2, r9 ; 0x02 2cb60: 2f 5f subi r18, 0xFF ; 255 2cb62: 3f 4f sbci r19, 0xFF ; 255 2cb64: 33 96 adiw r30, 0x03 ; 3 return 0; } } void ProtocolLogic::FormatLastReceivedBytes(char *dst) { for (uint8_t i = 0; i < lastReceivedBytes.size(); ++i) { 2cb66: 21 31 cpi r18, 0x11 ; 17 2cb68: 31 05 cpc r19, r1 2cb6a: c9 f6 brne .-78 ; 0x2cb1e 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 2cb6c: 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); 2cb6e: 82 ef ldi r24, 0xF2 ; 242 2cb70: 9b ea ldi r25, 0xAB ; 171 2cb72: 0e 94 68 77 call 0xeed0 ; 0xeed0 2cb76: 8c ee ldi r24, 0xEC ; 236 2cb78: 9b ea ldi r25, 0xAB ; 171 2cb7a: 0e 94 68 77 call 0xeed0 ; 0xeed0 2cb7e: c8 01 movw r24, r16 2cb80: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHOPGM(", last bytes: "); 2cb84: 84 ea ldi r24, 0xA4 ; 164 2cb86: 9b ea ldi r25, 0xAB ; 171 2cb88: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHOLN(lrb); 2cb8c: c5 01 movw r24, r10 2cb8e: 0f 94 bb d5 call 0x3ab76 ; 0x3ab76 } 2cb92: e0 96 adiw r28, 0x30 ; 48 2cb94: 0f b6 in r0, 0x3f ; 63 2cb96: f8 94 cli 2cb98: de bf out 0x3e, r29 ; 62 2cb9a: 0f be out 0x3f, r0 ; 63 2cb9c: cd bf out 0x3d, r28 ; 61 2cb9e: df 91 pop r29 2cba0: cf 91 pop r28 2cba2: 1f 91 pop r17 2cba4: 0f 91 pop r16 2cba6: ff 90 pop r15 2cba8: ef 90 pop r14 2cbaa: df 90 pop r13 2cbac: cf 90 pop r12 2cbae: bf 90 pop r11 2cbb0: af 90 pop r10 2cbb2: 9f 90 pop r9 2cbb4: 08 95 ret case 11: case 12: case 13: case 14: case 15: return (c - 10) + 'a'; 2cbb6: 49 5a subi r20, 0xA9 ; 169 2cbb8: ca cf rjmp .-108 ; 0x2cb4e 2cbba: 89 5a subi r24, 0xA9 ; 169 2cbbc: cf cf rjmp .-98 ; 0x2cb5c 0002cbbe : char lrb[lastReceivedBytes.size()]; FormatLastResponseMsgAndClearLRB(lrb); MMU2_ECHO_MSGLN(lrb); } StepStatus ProtocolLogic::SuppressShortDropOuts(const char *msg_P, StepStatus ss) { 2cbbe: 9c 01 movw r18, r24 SERIAL_ECHOLNPGM("RSTCommTimeout"); dataTO.Reset(); } bool DropOutFilter::Record(StepStatus ss) { if (occurrences == maxOccurrences) { 2cbc0: 90 91 5e 13 lds r25, 0x135E ; 0x80135e 2cbc4: 9a 30 cpi r25, 0x0A ; 10 2cbc6: 11 f4 brne .+4 ; 0x2cbcc cause = ss; 2cbc8: 60 93 5d 13 sts 0x135D, r22 ; 0x80135d } --occurrences; 2cbcc: 91 50 subi r25, 0x01 ; 1 2cbce: 90 93 5e 13 sts 0x135E, r25 ; 0x80135e FormatLastResponseMsgAndClearLRB(lrb); MMU2_ECHO_MSGLN(lrb); } StepStatus ProtocolLogic::SuppressShortDropOuts(const char *msg_P, StepStatus ss) { if (dataTO.Record(ss)) { 2cbd2: 91 11 cpse r25, r1 2cbd4: 0d c0 rjmp .+26 ; 0x2cbf0 2cbd6: c9 01 movw r24, r18 LogError(msg_P); 2cbd8: 0f 94 6e 65 call 0x2cadc ; 0x2cadc SERIAL_ECHOLNPGM("ResetRetryAttempts"); retryAttempts = MAX_RETRIES; } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 2cbdc: 85 e9 ldi r24, 0x95 ; 149 2cbde: 9b ea ldi r25, 0xAB ; 171 2cbe0: 0e 94 93 79 call 0xf326 ; 0xf326 /// @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; } 2cbe4: 8a e0 ldi r24, 0x0A ; 10 2cbe6: 80 93 5e 13 sts 0x135E, r24 ; 0x80135e 2cbea: 80 91 5d 13 lds r24, 0x135D ; 0x80135d 2cbee: 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 2cbf0: 80 e0 ldi r24, 0x00 ; 0 } } 2cbf2: 08 95 ret 0002cbf4 : } *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) { 2cbf4: cf 93 push r28 2cbf6: df 93 push r29 2cbf8: cd b7 in r28, 0x3d ; 61 2cbfa: de b7 in r29, 0x3e ; 62 2cbfc: 2e 97 sbiw r28, 0x0e ; 14 2cbfe: 0f b6 in r0, 0x3f ; 63 2cc00: f8 94 cli 2cc02: de bf out 0x3e, r29 ; 62 2cc04: 0f be out 0x3f, r0 ; 63 2cc06: cd bf out 0x3d, r28 ; 61 constexpr uint_fast8_t rqs = modules::protocol::Protocol::MaxRequestSize() + 1; char tmp[rqs] = ">"; 2cc08: 2e e3 ldi r18, 0x3E ; 62 2cc0a: 30 e0 ldi r19, 0x00 ; 0 2cc0c: 3a 83 std Y+2, r19 ; 0x02 2cc0e: 29 83 std Y+1, r18 ; 0x01 2cc10: fe 01 movw r30, r28 2cc12: 33 96 adiw r30, 0x03 ; 3 2cc14: 2c e0 ldi r18, 0x0C ; 12 2cc16: df 01 movw r26, r30 2cc18: 1d 92 st X+, r1 2cc1a: 2a 95 dec r18 2cc1c: e9 f7 brne .-6 ; 0x2cc18 2cc1e: de 01 movw r26, r28 2cc20: 12 96 adiw r26, 0x02 ; 2 2cc22: 48 2f mov r20, r24 2cc24: fc 01 movw r30, r24 2cc26: 9d 01 movw r18, r26 static char lastMsg[rqs] = ""; for (uint8_t i = 0; i < size; ++i) { 2cc28: 8e 2f mov r24, r30 2cc2a: 84 1b sub r24, r20 2cc2c: 86 17 cp r24, r22 2cc2e: 40 f4 brcc .+16 ; 0x2cc40 uint8_t b = txbuff[i]; 2cc30: 81 91 ld r24, Z+ // Check for printable character, including space if (b < 32 || b > 127) { 2cc32: 90 ee ldi r25, 0xE0 ; 224 2cc34: 98 0f add r25, r24 2cc36: 90 36 cpi r25, 0x60 ; 96 2cc38: 08 f0 brcs .+2 ; 0x2cc3c b = '.'; 2cc3a: 8e e2 ldi r24, 0x2E ; 46 } tmp[i + 1] = b; 2cc3c: 8d 93 st X+, r24 2cc3e: f4 cf rjmp .-24 ; 0x2cc28 } tmp[size + 1] = 0; 2cc40: f9 01 movw r30, r18 2cc42: e6 0f add r30, r22 2cc44: f1 1d adc r31, r1 2cc46: 10 82 st Z, r1 if (!strncmp_P(tmp, PSTR(">S0*c6."), rqs) && !strncmp(lastMsg, tmp, rqs)) { 2cc48: 4e e0 ldi r20, 0x0E ; 14 2cc4a: 50 e0 ldi r21, 0x00 ; 0 2cc4c: 68 ef ldi r22, 0xF8 ; 248 2cc4e: 7b ea ldi r23, 0xAB ; 171 2cc50: ce 01 movw r24, r28 2cc52: 01 96 adiw r24, 0x01 ; 1 2cc54: 0f 94 b6 d9 call 0x3b36c ; 0x3b36c 2cc58: 89 2b or r24, r25 2cc5a: 59 f4 brne .+22 ; 0x2cc72 2cc5c: 4e e0 ldi r20, 0x0E ; 14 2cc5e: 50 e0 ldi r21, 0x00 ; 0 2cc60: be 01 movw r22, r28 2cc62: 6f 5f subi r22, 0xFF ; 255 2cc64: 7f 4f sbci r23, 0xFF ; 255 2cc66: 81 ea ldi r24, 0xA1 ; 161 2cc68: 92 e1 ldi r25, 0x12 ; 18 2cc6a: 0f 94 49 e2 call 0x3c492 ; 0x3c492 2cc6e: 89 2b or r24, r25 2cc70: 61 f0 breq .+24 ; 0x2cc8a // 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); 2cc72: 82 ef ldi r24, 0xF2 ; 242 2cc74: 9b ea ldi r25, 0xAB ; 171 2cc76: 0e 94 68 77 call 0xeed0 ; 0xeed0 2cc7a: 8c ee ldi r24, 0xEC ; 236 2cc7c: 9b ea ldi r25, 0xAB ; 171 2cc7e: 0e 94 68 77 call 0xeed0 ; 0xeed0 2cc82: ce 01 movw r24, r28 2cc84: 01 96 adiw r24, 0x01 ; 1 2cc86: 0f 94 bb d5 call 0x3ab76 ; 0x3ab76 } strncpy(lastMsg, tmp, rqs); 2cc8a: 4e e0 ldi r20, 0x0E ; 14 2cc8c: 50 e0 ldi r21, 0x00 ; 0 2cc8e: be 01 movw r22, r28 2cc90: 6f 5f subi r22, 0xFF ; 255 2cc92: 7f 4f sbci r23, 0xFF ; 255 2cc94: 81 ea ldi r24, 0xA1 ; 161 2cc96: 92 e1 ldi r25, 0x12 ; 18 2cc98: 0f 94 57 e2 call 0x3c4ae ; 0x3c4ae } 2cc9c: 2e 96 adiw r28, 0x0e ; 14 2cc9e: 0f b6 in r0, 0x3f ; 63 2cca0: f8 94 cli 2cca2: de bf out 0x3e, r29 ; 62 2cca4: 0f be out 0x3f, r0 ; 63 2cca6: cd bf out 0x3d, r28 ; 61 2cca8: df 91 pop r29 2ccaa: cf 91 pop r28 2ccac: 08 95 ret 0002ccae : return CommunicationTimeout; } return Processing; } void ProtocolLogic::SendMsg(RequestMsg rq) { 2ccae: cf 92 push r12 2ccb0: df 92 push r13 2ccb2: ef 92 push r14 2ccb4: ff 92 push r15 2ccb6: 1f 93 push r17 2ccb8: cf 93 push r28 2ccba: df 93 push r29 2ccbc: cd b7 in r28, 0x3d ; 61 2ccbe: de b7 in r29, 0x3e ; 62 2ccc0: 62 97 sbiw r28, 0x12 ; 18 2ccc2: 0f b6 in r0, 0x3f ; 63 2ccc4: f8 94 cli 2ccc6: de bf out 0x3e, r29 ; 62 2ccc8: 0f be out 0x3f, r0 ; 63 2ccca: cd bf out 0x3d, r28 ; 61 2cccc: 4e 87 std Y+14, r20 ; 0x0e 2ccce: 5f 87 std Y+15, r21 ; 0x0f 2ccd0: 68 8b std Y+16, r22 ; 0x10 2ccd2: 79 8b std Y+17, r23 ; 0x11 2ccd4: 8a 8b std Y+18, r24 ; 0x12 } } } uint8_t Protocol::EncodeRequest(const RequestMsg &msg, uint8_t *txbuff) { txbuff[0] = (uint8_t)msg.code; 2ccd6: 49 83 std Y+1, r20 ; 0x01 uint8_t i = 1 + UInt8ToHex(msg.value, txbuff + 1); 2ccd8: 85 2f mov r24, r21 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 2ccda: 51 11 cpse r21, r1 2ccdc: 31 c0 rjmp .+98 ; 0x2cd40 *dst = '0'; 2ccde: 80 e3 ldi r24, 0x30 ; 48 2cce0: 8a 83 std Y+2, r24 ; 0x02 return 1; 2cce2: 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); 2cce4: e1 e0 ldi r30, 0x01 ; 1 2cce6: e1 0f add r30, r17 2cce8: 81 e0 ldi r24, 0x01 ; 1 2ccea: 90 e0 ldi r25, 0x00 ; 0 2ccec: 8c 0f add r24, r28 2ccee: 9d 1f adc r25, r29 2ccf0: 8e 0f add r24, r30 2ccf2: 91 1d adc r25, r1 2ccf4: fc 01 movw r30, r24 2ccf6: 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 2ccf8: 9a e2 ldi r25, 0x2A ; 42 2ccfa: 90 83 st Z, r25 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 2ccfc: 81 11 cpse r24, r1 2ccfe: 27 c0 rjmp .+78 ; 0x2cd4e *dst = '0'; 2cd00: 80 e3 ldi r24, 0x30 ; 48 2cd02: 81 83 std Z+1, r24 ; 0x01 return 1; 2cd04: 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); 2cd06: 1e 5f subi r17, 0xFE ; 254 2cd08: 18 0f add r17, r24 txbuff[i] = '\n'; 2cd0a: e1 e0 ldi r30, 0x01 ; 1 2cd0c: f0 e0 ldi r31, 0x00 ; 0 2cd0e: ec 0f add r30, r28 2cd10: fd 1f adc r31, r29 2cd12: e1 0f add r30, r17 2cd14: f1 1d adc r31, r1 2cd16: 8a e0 ldi r24, 0x0A ; 10 2cd18: 80 83 st Z, r24 ++i; 2cd1a: 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); 2cd1c: fe 01 movw r30, r28 2cd1e: 31 96 adiw r30, 0x01 ; 1 2cd20: 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--){ 2cd22: 6f 01 movw r12, r30 2cd24: c1 0e add r12, r17 2cd26: d1 1c adc r13, r1 2cd28: ec 14 cp r14, r12 2cd2a: fd 04 cpc r15, r13 2cd2c: b1 f0 breq .+44 ; 0x2cd5a fputc(*buffer, uart2io); 2cd2e: f7 01 movw r30, r14 2cd30: 81 91 ld r24, Z+ 2cd32: 7f 01 movw r14, r30 2cd34: 63 e9 ldi r22, 0x93 ; 147 2cd36: 72 e1 ldi r23, 0x12 ; 18 2cd38: 90 e0 ldi r25, 0x00 ; 0 2cd3a: 0f 94 3f da call 0x3b47e ; 0x3b47e 2cd3e: f4 cf rjmp .-24 ; 0x2cd28 2cd40: be 01 movw r22, r28 2cd42: 6e 5f subi r22, 0xFE ; 254 2cd44: 7f 4f sbci r23, 0xFF ; 255 2cd46: 0f 94 f8 c4 call 0x389f0 ; 0x389f0 2cd4a: 18 2f mov r17, r24 2cd4c: cb cf rjmp .-106 ; 0x2cce4 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); 2cd4e: bf 01 movw r22, r30 2cd50: 6f 5f subi r22, 0xFF ; 255 2cd52: 7f 4f sbci r23, 0xFF ; 255 2cd54: 0f 94 f8 c4 call 0x389f0 ; 0x389f0 2cd58: d6 cf rjmp .-84 ; 0x2cd06 LogRequestMsg(txbuff, len); 2cd5a: 61 2f mov r22, r17 2cd5c: ce 01 movw r24, r28 2cd5e: 01 96 adiw r24, 0x01 ; 1 2cd60: 0f 94 fa 65 call 0x2cbf4 ; 0x2cbf4 RecordUARTActivity(); 2cd64: 0f 94 51 65 call 0x2caa2 ; 0x2caa2 } 2cd68: 62 96 adiw r28, 0x12 ; 18 2cd6a: 0f b6 in r0, 0x3f ; 63 2cd6c: f8 94 cli 2cd6e: de bf out 0x3e, r29 ; 62 2cd70: 0f be out 0x3f, r0 ; 63 2cd72: cd bf out 0x3d, r28 ; 61 2cd74: df 91 pop r29 2cd76: cf 91 pop r28 2cd78: 1f 91 pop r17 2cd7a: ff 90 pop r15 2cd7c: ef 90 pop r14 2cd7e: df 90 pop r13 2cd80: cf 90 pop r12 2cd82: 08 95 ret 0002cd84 : 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) { 2cd84: 8f 92 push r8 2cd86: 9f 92 push r9 2cd88: af 92 push r10 2cd8a: bf 92 push r11 2cd8c: df 92 push r13 2cd8e: ef 92 push r14 2cd90: ff 92 push r15 2cd92: 0f 93 push r16 2cd94: 1f 93 push r17 2cd96: cf 93 push r28 2cd98: df 93 push r29 2cd9a: cd b7 in r28, 0x3d ; 61 2cd9c: de b7 in r29, 0x3e ; 62 2cd9e: 67 97 sbiw r28, 0x17 ; 23 2cda0: 0f b6 in r0, 0x3f ; 63 2cda2: f8 94 cli 2cda4: de bf out 0x3e, r29 ; 62 2cda6: 0f be out 0x3f, r0 ; 63 2cda8: cd bf out 0x3d, r28 ; 61 2cdaa: 18 2f mov r17, r24 2cdac: 7b 01 movw r14, r22 2cdae: d4 2e mov r13, r20 2cdb0: 07 e5 ldi r16, 0x57 ; 87 2cdb2: 0b 8b std Y+19, r16 ; 0x13 2cdb4: 8c 8b std Y+20, r24 ; 0x14 2cdb6: 7e 8b std Y+22, r23 ; 0x16 2cdb8: 6d 8b std Y+21, r22 ; 0x15 2cdba: ce 01 movw r24, r28 2cdbc: 43 96 adiw r24, 0x13 ; 19 2cdbe: 0f 94 24 c5 call 0x38a48 ; 0x38a48 2cdc2: 8f 8b std Y+23, r24 ; 0x17 2cdc4: 0e 87 std Y+14, r16 ; 0x0e 2cdc6: 1f 87 std Y+15, r17 ; 0x0f 2cdc8: f9 8a std Y+17, r15 ; 0x11 2cdca: e8 8a std Y+16, r14 ; 0x10 2cdcc: ce 01 movw r24, r28 2cdce: 0e 96 adiw r24, 0x0e ; 14 2cdd0: 0f 94 24 c5 call 0x38a48 ; 0x38a48 2cdd4: 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; 2cdd6: 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) { 2cdd8: 11 11 cpse r17, r1 2cdda: 27 c0 rjmp .+78 ; 0x2ce2a *dst = '0'; 2cddc: 80 e3 ldi r24, 0x30 ; 48 2cdde: 8a 83 std Y+2, r24 ; 0x02 return 1; 2cde0: 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); 2cde2: e1 e0 ldi r30, 0x01 ; 1 2cde4: e8 0f add r30, r24 dst[i] = ' '; 2cde6: 21 e0 ldi r18, 0x01 ; 1 2cde8: 30 e0 ldi r19, 0x00 ; 0 2cdea: 2c 0f add r18, r28 2cdec: 3d 1f adc r19, r29 2cdee: 2e 0f add r18, r30 2cdf0: 31 1d adc r19, r1 2cdf2: f9 01 movw r30, r18 2cdf4: 90 e2 ldi r25, 0x20 ; 32 2cdf6: 90 83 st Z, r25 return i + 1; 2cdf8: 02 e0 ldi r16, 0x02 ; 2 2cdfa: 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); 2cdfc: aa 24 eor r10, r10 2cdfe: a3 94 inc r10 2ce00: b1 2c mov r11, r1 2ce02: ac 0e add r10, r28 2ce04: bd 1e adc r11, r29 2ce06: a0 0e add r10, r16 2ce08: 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) { 2ce0a: e1 14 cp r14, r1 2ce0c: f1 04 cpc r15, r1 2ce0e: 39 f1 breq .+78 ; 0x2ce5e *dst = '0'; return 1; } // skip initial zeros uint8_t charsOut = 4; 2ce10: 14 e0 ldi r17, 0x04 ; 4 while ((value & topNibbleMask) == 0) { 2ce12: c7 01 movw r24, r14 2ce14: 88 27 eor r24, r24 2ce16: 90 7f andi r25, 0xF0 ; 240 2ce18: 89 2b or r24, r25 2ce1a: 71 f4 brne .+28 ; 0x2ce38 value <<= 4U; 2ce1c: 24 e0 ldi r18, 0x04 ; 4 2ce1e: ee 0c add r14, r14 2ce20: ff 1c adc r15, r15 2ce22: 2a 95 dec r18 2ce24: e1 f7 brne .-8 ; 0x2ce1e --charsOut; 2ce26: 11 50 subi r17, 0x01 ; 1 2ce28: f4 cf rjmp .-24 ; 0x2ce12 2ce2a: be 01 movw r22, r28 2ce2c: 6e 5f subi r22, 0xFE ; 254 2ce2e: 7f 4f sbci r23, 0xFF ; 255 2ce30: 81 2f mov r24, r17 2ce32: 0f 94 f8 c4 call 0x389f0 ; 0x389f0 2ce36: d5 cf rjmp .-86 ; 0x2cde2 *dst = '0'; return 1; } // skip initial zeros uint8_t charsOut = 4; while ((value & topNibbleMask) == 0) { 2ce38: 45 01 movw r8, r10 value <<= 4U; --charsOut; } for (uint8_t i = 0; i < charsOut; ++i) { 2ce3a: 88 2d mov r24, r8 2ce3c: 8a 19 sub r24, r10 2ce3e: 81 17 cp r24, r17 2ce40: 90 f4 brcc .+36 ; 0x2ce66 uint8_t n = (value & topNibbleMask) >> (8U + 4U); value <<= 4U; *dst = Nibble2Char(n); 2ce42: 8f 2d mov r24, r15 2ce44: 82 95 swap r24 2ce46: 8f 70 andi r24, 0x0F ; 15 2ce48: 94 e0 ldi r25, 0x04 ; 4 2ce4a: ee 0c add r14, r14 2ce4c: ff 1c adc r15, r15 2ce4e: 9a 95 dec r25 2ce50: e1 f7 brne .-8 ; 0x2ce4a 2ce52: 0f 94 ee c4 call 0x389dc ; 0x389dc 2ce56: f4 01 movw r30, r8 2ce58: 81 93 st Z+, r24 2ce5a: 4f 01 movw r8, r30 2ce5c: ee cf rjmp .-36 ; 0x2ce3a } uint8_t Protocol::UInt16ToHex(uint16_t value, uint8_t *dst) { constexpr uint16_t topNibbleMask = 0xf000; if (value == 0) { *dst = '0'; 2ce5e: 80 e3 ldi r24, 0x30 ; 48 2ce60: f5 01 movw r30, r10 2ce62: 80 83 st Z, r24 return 1; 2ce64: 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); 2ce66: 10 0f add r17, r16 i += AppendCRC(msg.CRC(), txbuff + i); 2ce68: e1 e0 ldi r30, 0x01 ; 1 2ce6a: f0 e0 ldi r31, 0x00 ; 0 2ce6c: ec 0f add r30, r28 2ce6e: fd 1f adc r31, r29 2ce70: e1 0f add r30, r17 2ce72: f1 1d adc r31, r1 2ce74: 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 2ce76: 9a e2 ldi r25, 0x2A ; 42 2ce78: 90 83 st Z, r25 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 2ce7a: 81 11 cpse r24, r1 2ce7c: 21 c0 rjmp .+66 ; 0x2cec0 *dst = '0'; 2ce7e: 80 e3 ldi r24, 0x30 ; 48 2ce80: 81 83 std Z+1, r24 ; 0x01 return 1; 2ce82: 81 e0 ldi r24, 0x01 ; 1 2ce84: 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); 2ce86: 18 0f add r17, r24 txbuff[i] = '\n'; 2ce88: e1 e0 ldi r30, 0x01 ; 1 2ce8a: f0 e0 ldi r31, 0x00 ; 0 2ce8c: ec 0f add r30, r28 2ce8e: fd 1f adc r31, r29 2ce90: e1 0f add r30, r17 2ce92: f1 1d adc r31, r1 2ce94: 8a e0 ldi r24, 0x0A ; 10 2ce96: 80 83 st Z, r24 ++i; 2ce98: 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); 2ce9a: 9e 01 movw r18, r28 2ce9c: 2f 5f subi r18, 0xFF ; 255 2ce9e: 3f 4f sbci r19, 0xFF ; 255 2cea0: 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--){ 2cea2: 59 01 movw r10, r18 2cea4: a1 0e add r10, r17 2cea6: b1 1c adc r11, r1 2cea8: ea 14 cp r14, r10 2ceaa: fb 04 cpc r15, r11 2ceac: 79 f0 breq .+30 ; 0x2cecc fputc(*buffer, uart2io); 2ceae: f7 01 movw r30, r14 2ceb0: 81 91 ld r24, Z+ 2ceb2: 7f 01 movw r14, r30 2ceb4: 63 e9 ldi r22, 0x93 ; 147 2ceb6: 72 e1 ldi r23, 0x12 ; 18 2ceb8: 90 e0 ldi r25, 0x00 ; 0 2ceba: 0f 94 3f da call 0x3b47e ; 0x3b47e 2cebe: f4 cf rjmp .-24 ; 0x2cea8 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); 2cec0: bf 01 movw r22, r30 2cec2: 6f 5f subi r22, 0xFF ; 255 2cec4: 7f 4f sbci r23, 0xFF ; 255 2cec6: 0f 94 f8 c4 call 0x389f0 ; 0x389f0 2ceca: dc cf rjmp .-72 ; 0x2ce84 LogRequestMsg(txbuff, len); 2cecc: 61 2f mov r22, r17 2cece: ce 01 movw r24, r28 2ced0: 01 96 adiw r24, 0x01 ; 1 2ced2: 0f 94 fa 65 call 0x2cbf4 ; 0x2cbf4 RecordUARTActivity(); 2ced6: 0f 94 51 65 call 0x2caa2 ; 0x2caa2 scopeState = nextState; } void ProtocolLogic::SendWriteRegister(uint8_t index, uint16_t value, ScopeState nextState) { SendWriteMsg(RequestMsg(RequestMsgCodes::Write, index, value)); scopeState = nextState; 2ceda: d0 92 4d 13 sts 0x134D, r13 ; 0x80134d } 2cede: 67 96 adiw r28, 0x17 ; 23 2cee0: 0f b6 in r0, 0x3f ; 63 2cee2: f8 94 cli 2cee4: de bf out 0x3e, r29 ; 62 2cee6: 0f be out 0x3f, r0 ; 63 2cee8: cd bf out 0x3d, r28 ; 61 2ceea: df 91 pop r29 2ceec: cf 91 pop r28 2ceee: 1f 91 pop r17 2cef0: 0f 91 pop r16 2cef2: ff 90 pop r15 2cef4: ef 90 pop r14 2cef6: df 90 pop r13 2cef8: bf 90 pop r11 2cefa: af 90 pop r10 2cefc: 9f 90 pop r9 2cefe: 8f 90 pop r8 2cf00: 08 95 ret 0002cf02 : regIndex = 0; SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } bool __attribute__((noinline)) ProtocolLogic::ProcessWritingInitRegister() { ++regIndex; 2cf02: 20 91 98 13 lds r18, 0x1398 ; 0x801398 2cf06: 2f 5f subi r18, 0xFF ; 255 2cf08: 20 93 98 13 sts 0x1398, r18 ; 0x801398 if (regIndex >= initRegs8Count) { 2cf0c: 22 30 cpi r18, 0x02 ; 2 2cf0e: 78 f4 brcc .+30 ; 0x2cf2e return true; } else { SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); 2cf10: 30 e0 ldi r19, 0x00 ; 0 2cf12: f9 01 movw r30, r18 2cf14: ed 56 subi r30, 0x6D ; 109 2cf16: f4 45 sbci r31, 0x54 ; 84 2cf18: 84 91 lpm r24, Z 2cf1a: 2a 56 subi r18, 0x6A ; 106 2cf1c: 3c 4e sbci r19, 0xEC ; 236 2cf1e: f9 01 movw r30, r18 2cf20: 60 81 ld r22, Z 2cf22: 70 e0 ldi r23, 0x00 ; 0 2cf24: 49 e0 ldi r20, 0x09 ; 9 2cf26: 0f 94 c2 66 call 0x2cd84 ; 0x2cd84 } return false; 2cf2a: 80 e0 ldi r24, 0x00 ; 0 2cf2c: 08 95 ret } bool __attribute__((noinline)) ProtocolLogic::ProcessWritingInitRegister() { ++regIndex; if (regIndex >= initRegs8Count) { return true; 2cf2e: 81 e0 ldi r24, 0x01 ; 1 } else { SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } return false; } 2cf30: 08 95 ret 0002cf32 : } /// 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){ 2cf32: 2f 92 push r2 2cf34: 3f 92 push r3 2cf36: 4f 92 push r4 2cf38: 5f 92 push r5 2cf3a: 6f 92 push r6 2cf3c: 7f 92 push r7 2cf3e: 8f 92 push r8 2cf40: 9f 92 push r9 2cf42: af 92 push r10 2cf44: bf 92 push r11 2cf46: cf 92 push r12 2cf48: df 92 push r13 2cf4a: ef 92 push r14 2cf4c: ff 92 push r15 2cf4e: 0f 93 push r16 2cf50: 1f 93 push r17 2cf52: cf 93 push r28 2cf54: df 93 push r29 2cf56: 00 d0 rcall .+0 ; 0x2cf58 2cf58: 1f 92 push r1 2cf5a: 1f 92 push r1 2cf5c: cd b7 in r28, 0x3d ; 61 2cf5e: de b7 in r29, 0x3e ; 62 2cf60: 2b 01 movw r4, r22 2cf62: 1a 01 movw r2, r20 2cf64: f1 2c mov r15, r1 2cf66: 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; 2cf68: 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; 2cf6a: 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; 2cf6c: 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){ 2cf6e: 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); 2cf70: 66 24 eor r6, r6 2cf72: 63 94 inc r6 2cf74: 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){ 2cf76: 70 e0 ldi r23, 0x00 ; 0 2cf78: 60 e0 ldi r22, 0x00 ; 0 2cf7a: 97 01 movw r18, r14 2cf7c: 2c 53 subi r18, 0x3C ; 60 2cf7e: 39 4f sbci r19, 0xF9 ; 249 2cf80: 3a 83 std Y+2, r19 ; 0x02 2cf82: 29 83 std Y+1, r18 ; 0x01 2cf84: 86 2e mov r8, r22 2cf86: c9 80 ldd r12, Y+1 ; 0x01 2cf88: da 80 ldd r13, Y+2 ; 0x02 2cf8a: c6 0e add r12, r22 2cf8c: d7 1e adc r13, r23 2cf8e: 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; 2cf90: 00 e0 ldi r16, 0x00 ; 0 for (uint8_t i = 0; i < 12; ++i){ 2cf92: 40 e0 ldi r20, 0x00 ; 0 2cf94: 30 e0 ldi r19, 0x00 ; 0 2cf96: 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; 2cf98: ae ef ldi r26, 0xFE ; 254 2cf9a: a4 0f add r26, r20 2cf9c: 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; 2cf9e: 44 23 and r20, r20 2cfa0: 19 f0 breq .+6 ; 0x2cfa8 2cfa2: 4b 30 cpi r20, 0x0B ; 11 2cfa4: 09 f0 breq .+2 ; 0x2cfa8 2cfa6: 7d c0 rjmp .+250 ; 0x2d0a2 2cfa8: ae ef ldi r26, 0xFE ; 254 2cfaa: a2 0f add r26, r18 2cfac: a8 30 cpi r26, 0x08 ; 8 2cfae: 08 f4 brcc .+2 ; 0x2cfb2 2cfb0: 7a c0 rjmp .+244 ; 0x2d0a6 2cfb2: 2f 5f subi r18, 0xFF ; 255 2cfb4: 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){ 2cfb6: 2c 30 cpi r18, 0x0C ; 12 2cfb8: 31 05 cpc r19, r1 2cfba: 89 f7 brne .-30 ; 0x2cf9e /// 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){ 2cfbc: 4f 5f subi r20, 0xFF ; 255 2cfbe: 20 e2 ldi r18, 0x20 ; 32 2cfc0: c2 0e add r12, r18 2cfc2: d1 1c adc r13, r1 2cfc4: 32 96 adiw r30, 0x02 ; 2 2cfc6: 4c 30 cpi r20, 0x0C ; 12 2cfc8: 29 f7 brne .-54 ; 0x2cf94 // 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){ 2cfca: 3c 81 ldd r19, Y+4 ; 0x04 2cfcc: 30 17 cp r19, r16 2cfce: 18 f4 brcc .+6 ; 0x2cfd6 2cfd0: 0c 83 std Y+4, r16 ; 0x04 2cfd2: 5d 83 std Y+5, r21 ; 0x05 2cfd4: 18 2d mov r17, r8 2cfd6: 6f 5f subi r22, 0xFF ; 255 2cfd8: 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){ 2cfda: 64 31 cpi r22, 0x14 ; 20 2cfdc: 71 05 cpc r23, r1 2cfde: 91 f6 brne .-92 ; 0x2cf84 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){ 2cfe0: 5f 5f subi r21, 0xFF ; 255 2cfe2: a0 e2 ldi r26, 0x20 ; 32 2cfe4: ea 0e add r14, r26 2cfe6: f1 1c adc r15, r1 2cfe8: 54 31 cpi r21, 0x14 ; 20 2cfea: 29 f6 brne .-118 ; 0x2cf76 // 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); 2cfec: ec 81 ldd r30, Y+4 ; 0x04 2cfee: 6e 2f mov r22, r30 2cff0: 70 e0 ldi r23, 0x00 ; 0 2cff2: 90 e0 ldi r25, 0x00 ; 0 2cff4: 80 e0 ldi r24, 0x00 ; 0 2cff6: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 2cffa: 23 ec ldi r18, 0xC3 ; 195 2cffc: 35 ef ldi r19, 0xF5 ; 245 2cffe: 48 ea ldi r20, 0xA8 ; 168 2d000: 5f e3 ldi r21, 0x3F ; 63 2d002: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 2d006: 9f 93 push r25 2d008: 8f 93 push r24 2d00a: 7f 93 push r23 2d00c: 6f 93 push r22 2d00e: fd 81 ldd r31, Y+5 ; 0x05 2d010: 6f 2f mov r22, r31 2d012: 70 e0 ldi r23, 0x00 ; 0 2d014: 90 e0 ldi r25, 0x00 ; 0 2d016: 80 e0 ldi r24, 0x00 ; 0 2d018: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 2d01c: 20 e0 ldi r18, 0x00 ; 0 2d01e: 30 e0 ldi r19, 0x00 ; 0 2d020: 40 eb ldi r20, 0xB0 ; 176 2d022: 50 e4 ldi r21, 0x40 ; 64 2d024: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 2d028: 9f 93 push r25 2d02a: 8f 93 push r24 2d02c: 7f 93 push r23 2d02e: 6f 93 push r22 2d030: 61 2f mov r22, r17 2d032: 70 e0 ldi r23, 0x00 ; 0 2d034: 90 e0 ldi r25, 0x00 ; 0 2d036: 80 e0 ldi r24, 0x00 ; 0 2d038: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 2d03c: 20 e0 ldi r18, 0x00 ; 0 2d03e: 30 e0 ldi r19, 0x00 ; 0 2d040: 40 eb ldi r20, 0xB0 ; 176 2d042: 50 e4 ldi r21, 0x40 ; 64 2d044: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 2d048: 9f 93 push r25 2d04a: 8f 93 push r24 2d04c: 7f 93 push r23 2d04e: 6f 93 push r22 2d050: 8b ec ldi r24, 0xCB ; 203 2d052: 96 ea ldi r25, 0xA6 ; 166 2d054: 9f 93 push r25 2d056: 8f 93 push r24 2d058: 0f 94 99 da call 0x3b532 ; 0x3b532 *pc = max_c; 2d05c: f2 01 movw r30, r4 2d05e: 10 83 st Z, r17 *pr = max_r; 2d060: 2d 81 ldd r18, Y+5 ; 0x05 2d062: f1 01 movw r30, r2 2d064: 20 83 st Z, r18 2d066: 0f b6 in r0, 0x3f ; 63 2d068: f8 94 cli 2d06a: de bf out 0x3e, r29 ; 62 2d06c: 0f be out 0x3f, r0 ; 63 2d06e: cd bf out 0x3d, r28 ; 61 return max_match; } 2d070: 8c 81 ldd r24, Y+4 ; 0x04 2d072: 0f 90 pop r0 2d074: 0f 90 pop r0 2d076: 0f 90 pop r0 2d078: 0f 90 pop r0 2d07a: 0f 90 pop r0 2d07c: df 91 pop r29 2d07e: cf 91 pop r28 2d080: 1f 91 pop r17 2d082: 0f 91 pop r16 2d084: ff 90 pop r15 2d086: ef 90 pop r14 2d088: df 90 pop r13 2d08a: cf 90 pop r12 2d08c: bf 90 pop r11 2d08e: af 90 pop r10 2d090: 9f 90 pop r9 2d092: 8f 90 pop r8 2d094: 7f 90 pop r7 2d096: 6f 90 pop r6 2d098: 5f 90 pop r5 2d09a: 4f 90 pop r4 2d09c: 3f 90 pop r3 2d09e: 2f 90 pop r2 2d0a0: 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; 2d0a2: 22 23 and r18, r18 2d0a4: 11 f0 breq .+4 ; 0x2d0aa 2d0a6: 2b 30 cpi r18, 0x0B ; 11 2d0a8: 21 f4 brne .+8 ; 0x2d0b2 2d0aa: ab 81 ldd r26, Y+3 ; 0x03 2d0ac: a8 30 cpi r26, 0x08 ; 8 2d0ae: 08 f0 brcs .+2 ; 0x2d0b2 2d0b0: 80 cf rjmp .-256 ; 0x2cfb2 const uint16_t idx = (c + j) + 32 * ((uint16_t)r + i); const bool high_pix = pixels[idx] > thr; 2d0b2: 99 24 eor r9, r9 2d0b4: 93 94 inc r9 2d0b6: d6 01 movw r26, r12 2d0b8: a2 0f add r26, r18 2d0ba: b3 1f adc r27, r19 2d0bc: ac 91 ld r26, X 2d0be: a1 31 cpi r26, 0x11 ; 17 2d0c0: 08 f4 brcc .+2 ; 0x2d0c4 2d0c2: 91 2c mov r9, r1 const bool high_pat = pattern[i] & (1 << j); 2d0c4: a0 80 ld r10, Z 2d0c6: b1 80 ldd r11, Z+1 ; 0x01 2d0c8: d3 01 movw r26, r6 2d0ca: 02 2e mov r0, r18 2d0cc: 02 c0 rjmp .+4 ; 0x2d0d2 2d0ce: aa 0f add r26, r26 2d0d0: bb 1f adc r27, r27 2d0d2: 0a 94 dec r0 2d0d4: e2 f7 brpl .-8 ; 0x2d0ce 2d0d6: aa 21 and r26, r10 2d0d8: bb 21 and r27, r11 2d0da: bb 24 eor r11, r11 2d0dc: b3 94 inc r11 2d0de: ab 2b or r26, r27 2d0e0: 09 f4 brne .+2 ; 0x2d0e4 2d0e2: b1 2c mov r11, r1 if (high_pix == high_pat) 2d0e4: 9b 10 cpse r9, r11 2d0e6: 65 cf rjmp .-310 ; 0x2cfb2 match++; 2d0e8: 0f 5f subi r16, 0xFF ; 255 2d0ea: 63 cf rjmp .-314 ; 0x2cfb2 0002d0ec : * \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) { 2d0ec: 8f 92 push r8 2d0ee: 9f 92 push r9 2d0f0: af 92 push r10 2d0f2: bf 92 push r11 2d0f4: cf 92 push r12 2d0f6: df 92 push r13 2d0f8: ef 92 push r14 2d0fa: ff 92 push r15 2d0fc: cf 93 push r28 2d0fe: df 93 push r29 uint32_t totalBlocks; uint32_t volumeStartBlock = 0; fat32_boot_t* fbs; sdCard_ = dev; 2d100: 2c ef ldi r18, 0xFC ; 252 2d102: 36 e1 ldi r19, 0x16 ; 22 2d104: 30 93 9a 0e sts 0x0E9A, r19 ; 0x800e9a 2d108: 20 93 99 0e sts 0x0E99, r18 ; 0x800e99 fatType_ = 0; 2d10c: 10 92 18 17 sts 0x1718, r1 ; 0x801718 allocSearchStart_ = 2; 2d110: 42 e0 ldi r20, 0x02 ; 2 2d112: 50 e0 ldi r21, 0x00 ; 0 2d114: 60 e0 ldi r22, 0x00 ; 0 2d116: 70 e0 ldi r23, 0x00 ; 0 2d118: 40 93 01 17 sts 0x1701, r20 ; 0x801701 2d11c: 50 93 02 17 sts 0x1702, r21 ; 0x801702 2d120: 60 93 03 17 sts 0x1703, r22 ; 0x801703 2d124: 70 93 04 17 sts 0x1704, r23 ; 0x801704 cacheDirty_ = 0; // cacheFlush() will write block if true 2d128: 10 92 98 0e sts 0x0E98, r1 ; 0x800e98 cacheMirrorBlock_ = 0; 2d12c: 10 92 94 0e sts 0x0E94, r1 ; 0x800e94 2d130: 10 92 95 0e sts 0x0E95, r1 ; 0x800e95 2d134: 10 92 96 0e sts 0x0E96, r1 ; 0x800e96 2d138: 10 92 97 0e sts 0x0E97, r1 ; 0x800e97 cacheBlockNumber_ = 0XFFFFFFFF; 2d13c: 4f ef ldi r20, 0xFF ; 255 2d13e: 5f ef ldi r21, 0xFF ; 255 2d140: ba 01 movw r22, r20 2d142: 40 93 90 0e sts 0x0E90, r20 ; 0x800e90 2d146: 50 93 91 0e sts 0x0E91, r21 ; 0x800e91 2d14a: 60 93 92 0e sts 0x0E92, r22 ; 0x800e92 2d14e: 70 93 93 0e sts 0x0E93, r23 ; 0x800e93 // if part == 0 assume super floppy with FAT boot sector in block zero // if part > 0 assume mbr volume with partition table if (part) { 2d152: 88 23 and r24, r24 2d154: 09 f4 brne .+2 ; 0x2d158 2d156: 70 c0 rjmp .+224 ; 0x2d238 if (part > 4)goto fail; if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; 2d158: 40 e0 ldi r20, 0x00 ; 0 2d15a: 60 e0 ldi r22, 0x00 ; 0 2d15c: 70 e0 ldi r23, 0x00 ; 0 2d15e: cb 01 movw r24, r22 2d160: 0f 94 c8 53 call 0x2a790 ; 0x2a790 2d164: 81 11 cpse r24, r1 2d166: 0d c0 rjmp .+26 ; 0x2d182 fatType_ = 32; } return true; fail: return false; 2d168: c0 e0 ldi r28, 0x00 ; 0 } 2d16a: 8c 2f mov r24, r28 2d16c: df 91 pop r29 2d16e: cf 91 pop r28 2d170: ff 90 pop r15 2d172: ef 90 pop r14 2d174: df 90 pop r13 2d176: cf 90 pop r12 2d178: bf 90 pop r11 2d17a: af 90 pop r10 2d17c: 9f 90 pop r9 2d17e: 8f 90 pop r8 2d180: 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 || 2d182: 80 91 5a 10 lds r24, 0x105A ; 0x80105a 2d186: 8f 77 andi r24, 0x7F ; 127 2d188: 79 f7 brne .-34 ; 0x2d168 2d18a: 80 91 66 10 lds r24, 0x1066 ; 0x801066 2d18e: 90 91 67 10 lds r25, 0x1067 ; 0x801067 2d192: a0 91 68 10 lds r26, 0x1068 ; 0x801068 2d196: b0 91 69 10 lds r27, 0x1069 ; 0x801069 2d19a: 84 36 cpi r24, 0x64 ; 100 2d19c: 91 05 cpc r25, r1 2d19e: a1 05 cpc r26, r1 2d1a0: b1 05 cpc r27, r1 2d1a2: 10 f3 brcs .-60 ; 0x2d168 p->totalSectors < 100 || p->firstSector == 0) { 2d1a4: c0 90 62 10 lds r12, 0x1062 ; 0x801062 2d1a8: d0 90 63 10 lds r13, 0x1063 ; 0x801063 2d1ac: e0 90 64 10 lds r14, 0x1064 ; 0x801064 2d1b0: f0 90 65 10 lds r15, 0x1065 ; 0x801065 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 || 2d1b4: c1 14 cp r12, r1 2d1b6: d1 04 cpc r13, r1 2d1b8: e1 04 cpc r14, r1 2d1ba: f1 04 cpc r15, r1 2d1bc: a9 f2 breq .-86 ; 0x2d168 // not a valid partition goto fail; } volumeStartBlock = p->firstSector; } if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; 2d1be: 40 e0 ldi r20, 0x00 ; 0 2d1c0: c7 01 movw r24, r14 2d1c2: b6 01 movw r22, r12 2d1c4: 0f 94 c8 53 call 0x2a790 ; 0x2a790 2d1c8: c8 2f mov r28, r24 2d1ca: 88 23 and r24, r24 2d1cc: 69 f2 breq .-102 ; 0x2d168 fbs = &cacheBuffer_.fbs32; if (fbs->bytesPerSector != 512 || 2d1ce: 80 91 a7 0e lds r24, 0x0EA7 ; 0x800ea7 2d1d2: 90 91 a8 0e lds r25, 0x0EA8 ; 0x800ea8 2d1d6: 81 15 cp r24, r1 2d1d8: 92 40 sbci r25, 0x02 ; 2 2d1da: 31 f6 brne .-116 ; 0x2d168 fbs->fatCount == 0 || 2d1dc: a0 91 ac 0e lds r26, 0x0EAC ; 0x800eac } volumeStartBlock = p->firstSector; } if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; fbs = &cacheBuffer_.fbs32; if (fbs->bytesPerSector != 512 || 2d1e0: aa 23 and r26, r26 2d1e2: 11 f2 breq .-124 ; 0x2d168 fbs->fatCount == 0 || fbs->reservedSectorCount == 0 || 2d1e4: 60 91 aa 0e lds r22, 0x0EAA ; 0x800eaa 2d1e8: 70 91 ab 0e lds r23, 0x0EAB ; 0x800eab volumeStartBlock = p->firstSector; } if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; fbs = &cacheBuffer_.fbs32; if (fbs->bytesPerSector != 512 || fbs->fatCount == 0 || 2d1ec: 61 15 cp r22, r1 2d1ee: 71 05 cpc r23, r1 2d1f0: 09 f4 brne .+2 ; 0x2d1f4 2d1f2: ba cf rjmp .-140 ; 0x2d168 fbs->reservedSectorCount == 0 || fbs->sectorsPerCluster == 0) { 2d1f4: 20 91 a9 0e lds r18, 0x0EA9 ; 0x800ea9 } if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; fbs = &cacheBuffer_.fbs32; if (fbs->bytesPerSector != 512 || fbs->fatCount == 0 || fbs->reservedSectorCount == 0 || 2d1f8: 22 23 and r18, r18 2d1fa: 09 f4 brne .+2 ; 0x2d1fe 2d1fc: b5 cf rjmp .-150 ; 0x2d168 fbs->sectorsPerCluster == 0) { // not valid FAT volume goto fail; } fatCount_ = fbs->fatCount; 2d1fe: a0 93 13 17 sts 0x1713, r26 ; 0x801713 blocksPerCluster_ = fbs->sectorsPerCluster; 2d202: 20 93 05 17 sts 0x1705, r18 ; 0x801705 // determine shift that is same as multiply by blocksPerCluster_ clusterSizeShift_ = 0; 2d206: 90 e0 ldi r25, 0x00 ; 0 2d208: 80 e0 ldi r24, 0x00 ; 0 while (blocksPerCluster_ != (1 << clusterSizeShift_)) { 2d20a: 30 e0 ldi r19, 0x00 ; 0 2d20c: e1 e0 ldi r30, 0x01 ; 1 2d20e: f0 e0 ldi r31, 0x00 ; 0 2d210: d8 2f mov r29, r24 2d212: af 01 movw r20, r30 2d214: 08 2e mov r0, r24 2d216: 02 c0 rjmp .+4 ; 0x2d21c 2d218: 44 0f add r20, r20 2d21a: 55 1f adc r21, r21 2d21c: 0a 94 dec r0 2d21e: e2 f7 brpl .-8 ; 0x2d218 2d220: 24 17 cp r18, r20 2d222: 35 07 cpc r19, r21 2d224: 69 f0 breq .+26 ; 0x2d240 2d226: 41 e0 ldi r20, 0x01 ; 1 2d228: 48 0f add r20, r24 2d22a: 01 96 adiw r24, 0x01 ; 1 // error if not power of 2 if (clusterSizeShift_++ > 7) goto fail; 2d22c: 89 30 cpi r24, 0x09 ; 9 2d22e: 91 05 cpc r25, r1 2d230: 79 f7 brne .-34 ; 0x2d210 2d232: 40 93 0e 17 sts 0x170E, r20 ; 0x80170e 2d236: 98 cf rjmp .-208 ; 0x2d168 * 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; 2d238: c1 2c mov r12, r1 2d23a: d1 2c mov r13, r1 2d23c: 76 01 movw r14, r12 2d23e: bf cf rjmp .-130 ; 0x2d1be 2d240: 80 93 0e 17 sts 0x170E, r24 ; 0x80170e clusterSizeShift_ = 0; while (blocksPerCluster_ != (1 << clusterSizeShift_)) { // error if not power of 2 if (clusterSizeShift_++ > 7) goto fail; } blocksPerFat_ = fbs->sectorsPerFat16 ? 2d244: 20 91 b2 0e lds r18, 0x0EB2 ; 0x800eb2 2d248: 30 91 b3 0e lds r19, 0x0EB3 ; 0x800eb3 2d24c: 50 e0 ldi r21, 0x00 ; 0 2d24e: 40 e0 ldi r20, 0x00 ; 0 2d250: 21 15 cp r18, r1 2d252: 31 05 cpc r19, r1 2d254: 41 f4 brne .+16 ; 0x2d266 2d256: 20 91 c0 0e lds r18, 0x0EC0 ; 0x800ec0 2d25a: 30 91 c1 0e lds r19, 0x0EC1 ; 0x800ec1 2d25e: 40 91 c2 0e lds r20, 0x0EC2 ; 0x800ec2 2d262: 50 91 c3 0e lds r21, 0x0EC3 ; 0x800ec3 2d266: 20 93 06 17 sts 0x1706, r18 ; 0x801706 2d26a: 30 93 07 17 sts 0x1707, r19 ; 0x801707 2d26e: 40 93 08 17 sts 0x1708, r20 ; 0x801708 2d272: 50 93 09 17 sts 0x1709, r21 ; 0x801709 fbs->sectorsPerFat16 : fbs->sectorsPerFat32; fatStartBlock_ = volumeStartBlock + fbs->reservedSectorCount; 2d276: 46 01 movw r8, r12 2d278: 57 01 movw r10, r14 2d27a: 86 0e add r8, r22 2d27c: 97 1e adc r9, r23 2d27e: a1 1c adc r10, r1 2d280: b1 1c adc r11, r1 2d282: 80 92 14 17 sts 0x1714, r8 ; 0x801714 2d286: 90 92 15 17 sts 0x1715, r9 ; 0x801715 2d28a: a0 92 16 17 sts 0x1716, r10 ; 0x801716 2d28e: b0 92 17 17 sts 0x1717, r11 ; 0x801717 // count for FAT16 zero for FAT32 rootDirEntryCount_ = fbs->rootDirEntryCount; 2d292: e0 91 ad 0e lds r30, 0x0EAD ; 0x800ead 2d296: f0 91 ae 0e lds r31, 0x0EAE ; 0x800eae 2d29a: f0 93 1a 17 sts 0x171A, r31 ; 0x80171a 2d29e: e0 93 19 17 sts 0x1719, r30 ; 0x801719 // directory start for FAT16 dataStart for FAT32 rootDirStart_ = fatStartBlock_ + fbs->fatCount * blocksPerFat_; 2d2a2: b0 e0 ldi r27, 0x00 ; 0 2d2a4: 0f 94 6c dc call 0x3b8d8 ; 0x3b8d8 <__muluhisi3> 2d2a8: dc 01 movw r26, r24 2d2aa: cb 01 movw r24, r22 2d2ac: 88 0d add r24, r8 2d2ae: 99 1d adc r25, r9 2d2b0: aa 1d adc r26, r10 2d2b2: bb 1d adc r27, r11 2d2b4: 80 93 1b 17 sts 0x171B, r24 ; 0x80171b 2d2b8: 90 93 1c 17 sts 0x171C, r25 ; 0x80171c 2d2bc: a0 93 1d 17 sts 0x171D, r26 ; 0x80171d 2d2c0: b0 93 1e 17 sts 0x171E, r27 ; 0x80171e // data start for FAT16 and FAT32 dataStartBlock_ = rootDirStart_ + ((32 * fbs->rootDirEntryCount + 511)/512); 2d2c4: 25 e0 ldi r18, 0x05 ; 5 2d2c6: ee 0f add r30, r30 2d2c8: ff 1f adc r31, r31 2d2ca: 2a 95 dec r18 2d2cc: e1 f7 brne .-8 ; 0x2d2c6 2d2ce: e1 50 subi r30, 0x01 ; 1 2d2d0: fe 4f sbci r31, 0xFE ; 254 2d2d2: ef 2f mov r30, r31 2d2d4: ff 27 eor r31, r31 2d2d6: e6 95 lsr r30 2d2d8: 8e 0f add r24, r30 2d2da: 9f 1f adc r25, r31 2d2dc: a1 1d adc r26, r1 2d2de: b1 1d adc r27, r1 2d2e0: 80 93 0f 17 sts 0x170F, r24 ; 0x80170f 2d2e4: 90 93 10 17 sts 0x1710, r25 ; 0x801710 2d2e8: a0 93 11 17 sts 0x1711, r26 ; 0x801711 2d2ec: b0 93 12 17 sts 0x1712, r27 ; 0x801712 // total blocks for FAT16 or FAT32 totalBlocks = fbs->totalSectors16 ? 2d2f0: 80 90 af 0e lds r8, 0x0EAF ; 0x800eaf 2d2f4: 90 90 b0 0e lds r9, 0x0EB0 ; 0x800eb0 2d2f8: b1 2c mov r11, r1 2d2fa: a1 2c mov r10, r1 2d2fc: 81 14 cp r8, r1 2d2fe: 91 04 cpc r9, r1 2d300: 41 f4 brne .+16 ; 0x2d312 2d302: 80 90 bc 0e lds r8, 0x0EBC ; 0x800ebc 2d306: 90 90 bd 0e lds r9, 0x0EBD ; 0x800ebd 2d30a: a0 90 be 0e lds r10, 0x0EBE ; 0x800ebe 2d30e: b0 90 bf 0e lds r11, 0x0EBF ; 0x800ebf fbs->totalSectors16 : fbs->totalSectors32; // total data blocks clusterCount_ = totalBlocks - (dataStartBlock_ - volumeStartBlock); 2d312: c8 1a sub r12, r24 2d314: d9 0a sbc r13, r25 2d316: ea 0a sbc r14, r26 2d318: fb 0a sbc r15, r27 2d31a: c8 0c add r12, r8 2d31c: d9 1c adc r13, r9 2d31e: ea 1c adc r14, r10 2d320: fb 1c adc r15, r11 // divide by cluster size to get cluster count clusterCount_ >>= clusterSizeShift_; 2d322: 04 c0 rjmp .+8 ; 0x2d32c 2d324: f6 94 lsr r15 2d326: e7 94 ror r14 2d328: d7 94 ror r13 2d32a: c7 94 ror r12 2d32c: da 95 dec r29 2d32e: d2 f7 brpl .-12 ; 0x2d324 2d330: c0 92 0a 17 sts 0x170A, r12 ; 0x80170a 2d334: d0 92 0b 17 sts 0x170B, r13 ; 0x80170b 2d338: e0 92 0c 17 sts 0x170C, r14 ; 0x80170c 2d33c: f0 92 0d 17 sts 0x170D, r15 ; 0x80170d // FAT type is determined by cluster count if (clusterCount_ < 4085) { 2d340: 85 ef ldi r24, 0xF5 ; 245 2d342: c8 16 cp r12, r24 2d344: 8f e0 ldi r24, 0x0F ; 15 2d346: d8 06 cpc r13, r24 2d348: e1 04 cpc r14, r1 2d34a: f1 04 cpc r15, r1 2d34c: 20 f4 brcc .+8 ; 0x2d356 fatType_ = 12; 2d34e: 8c e0 ldi r24, 0x0C ; 12 2d350: 80 93 18 17 sts 0x1718, r24 ; 0x801718 2d354: 09 cf rjmp .-494 ; 0x2d168 if (!FAT12_SUPPORT) goto fail; } else if (clusterCount_ < 65525) { fatType_ = 16; 2d356: 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) { 2d358: 25 ef ldi r18, 0xF5 ; 245 2d35a: c2 16 cp r12, r18 2d35c: 2f ef ldi r18, 0xFF ; 255 2d35e: d2 06 cpc r13, r18 2d360: e1 04 cpc r14, r1 2d362: f1 04 cpc r15, r1 2d364: 88 f0 brcs .+34 ; 0x2d388 fatType_ = 16; } else { rootDirStart_ = fbs->fat32RootCluster; 2d366: 80 91 c8 0e lds r24, 0x0EC8 ; 0x800ec8 2d36a: 90 91 c9 0e lds r25, 0x0EC9 ; 0x800ec9 2d36e: a0 91 ca 0e lds r26, 0x0ECA ; 0x800eca 2d372: b0 91 cb 0e lds r27, 0x0ECB ; 0x800ecb 2d376: 80 93 1b 17 sts 0x171B, r24 ; 0x80171b 2d37a: 90 93 1c 17 sts 0x171C, r25 ; 0x80171c 2d37e: a0 93 1d 17 sts 0x171D, r26 ; 0x80171d 2d382: b0 93 1e 17 sts 0x171E, r27 ; 0x80171e fatType_ = 32; 2d386: 80 e2 ldi r24, 0x20 ; 32 2d388: 80 93 18 17 sts 0x1718, r24 ; 0x801718 2d38c: ee ce rjmp .-548 ; 0x2d16a 0002d38e : break; } } void __attribute__((noinline)) MMU2::HelpUnloadToFinda() { extruder_move(-MMU2_RETRY_UNLOAD_TO_FINDA_LENGTH, MMU2_RETRY_UNLOAD_TO_FINDA_FEED_RATE); 2d38e: 20 e0 ldi r18, 0x00 ; 0 2d390: 30 e0 ldi r19, 0x00 ; 0 2d392: 40 ea ldi r20, 0xA0 ; 160 2d394: 52 e4 ldi r21, 0x42 ; 66 2d396: 60 e0 ldi r22, 0x00 ; 0 2d398: 70 e0 ldi r23, 0x00 ; 0 2d39a: 80 ea ldi r24, 0xA0 ; 160 2d39c: 92 ec ldi r25, 0xC2 ; 194 2d39e: 0d 94 6c c5 jmp 0x38ad8 ; 0x38ad8 0002d3a2 : void MMU2::Home(uint8_t mode) { logic.Home(mode); } void MMU2::SaveHotendTemp(bool turn_off_nozzle) { if (mmu_print_saved & SavedState::Cooldown) { 2d3a2: 90 91 ba 13 lds r25, 0x13BA ; 0x8013ba 2d3a6: 91 fd sbrc r25, 1 2d3a8: 17 c0 rjmp .+46 ; 0x2d3d8 return; } if (turn_off_nozzle && !(mmu_print_saved & SavedState::CooldownPending)) { 2d3aa: 88 23 and r24, r24 2d3ac: a9 f0 breq .+42 ; 0x2d3d8 2d3ae: 92 fd sbrc r25, 2 2d3b0: 13 c0 rjmp .+38 ; 0x2d3d8 Disable_E0(); 2d3b2: 0f 94 6a c5 call 0x38ad4 ; 0x38ad4 resume_hotend_temp = thermal_degTargetHotend(); 2d3b6: 80 91 b5 0d lds r24, 0x0DB5 ; 0x800db5 2d3ba: 90 91 b6 0d lds r25, 0x0DB6 ; 0x800db6 2d3be: 90 93 af 13 sts 0x13AF, r25 ; 0x8013af 2d3c2: 80 93 ae 13 sts 0x13AE, r24 ; 0x8013ae mmu_print_saved |= SavedState::CooldownPending; 2d3c6: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 2d3ca: 84 60 ori r24, 0x04 ; 4 2d3cc: 80 93 ba 13 sts 0x13BA, r24 ; 0x8013ba LogEchoEvent_P(PSTR("Heater cooldown pending")); 2d3d0: 8f e1 ldi r24, 0x1F ; 31 2d3d2: 98 ea ldi r25, 0xA8 ; 168 2d3d4: 0d 94 90 c5 jmp 0x38b20 ; 0x38b20 } } 2d3d8: 08 95 ret 0002d3da : ScreenClear(); } } void MMU2::ResumeUnpark() { if (mmu_print_saved & SavedState::ParkExtruder) { 2d3da: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 2d3de: 80 ff sbrs r24, 0 2d3e0: 47 c0 rjmp .+142 ; 0x2d470 LogEchoEvent_P(PSTR("Resuming XYZ")); 2d3e2: 87 e3 ldi r24, 0x37 ; 55 2d3e4: 98 ea ldi r25, 0xA8 ; 168 2d3e6: 0f 94 90 c5 call 0x38b20 ; 0x38b20 // 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)); 2d3ea: 80 91 a6 13 lds r24, 0x13A6 ; 0x8013a6 2d3ee: 90 91 a7 13 lds r25, 0x13A7 ; 0x8013a7 2d3f2: a0 91 a8 13 lds r26, 0x13A8 ; 0x8013a8 2d3f6: b0 91 a9 13 lds r27, 0x13A9 ; 0x8013a9 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; 2d3fa: 40 91 a2 13 lds r20, 0x13A2 ; 0x8013a2 2d3fe: 50 91 a3 13 lds r21, 0x13A3 ; 0x8013a3 2d402: 60 91 a4 13 lds r22, 0x13A4 ; 0x8013a4 2d406: 70 91 a5 13 lds r23, 0x13A5 ; 0x8013a5 2d40a: 40 93 91 06 sts 0x0691, r20 ; 0x800691 2d40e: 50 93 92 06 sts 0x0692, r21 ; 0x800692 2d412: 60 93 93 06 sts 0x0693, r22 ; 0x800693 2d416: 70 93 94 06 sts 0x0694, r23 ; 0x800694 current_position[Y_AXIS] = ry; 2d41a: 80 93 95 06 sts 0x0695, r24 ; 0x800695 2d41e: 90 93 96 06 sts 0x0696, r25 ; 0x800696 2d422: a0 93 97 06 sts 0x0697, r26 ; 0x800697 2d426: b0 93 98 06 sts 0x0698, r27 ; 0x800698 planner_line_to_current_position_sync(feedRate_mm_s); 2d42a: 60 e0 ldi r22, 0x00 ; 0 2d42c: 70 e0 ldi r23, 0x00 ; 0 2d42e: 88 e4 ldi r24, 0x48 ; 72 2d430: 92 e4 ldi r25, 0x42 ; 66 2d432: 0f 94 8c c5 call 0x38b18 ; 0x38b18 } void motion_do_blocking_move_to_z(float z, float feedRate_mm_s) { current_position[Z_AXIS] = z; 2d436: 80 91 aa 13 lds r24, 0x13AA ; 0x8013aa 2d43a: 90 91 ab 13 lds r25, 0x13AB ; 0x8013ab 2d43e: a0 91 ac 13 lds r26, 0x13AC ; 0x8013ac 2d442: b0 91 ad 13 lds r27, 0x13AD ; 0x8013ad 2d446: 80 93 99 06 sts 0x0699, r24 ; 0x800699 2d44a: 90 93 9a 06 sts 0x069A, r25 ; 0x80069a 2d44e: a0 93 9b 06 sts 0x069B, r26 ; 0x80069b 2d452: b0 93 9c 06 sts 0x069C, r27 ; 0x80069c planner_line_to_current_position_sync(feedRate_mm_s); 2d456: 60 e0 ldi r22, 0x00 ; 0 2d458: 70 e0 ldi r23, 0x00 ; 0 2d45a: 80 e7 ldi r24, 0x70 ; 112 2d45c: 91 e4 ldi r25, 0x41 ; 65 2d45e: 0f 94 8c c5 call 0x38b18 ; 0x38b18 void clear_print_state_in_ram() { // Set flag to false in order to avoid using // the saved values during power panic isPartialBackupAvailable = false; 2d462: 10 92 a1 06 sts 0x06A1, r1 ; 0x8006a1 // 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); 2d466: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 2d46a: 8e 7f andi r24, 0xFE ; 254 2d46c: 80 93 ba 13 sts 0x13BA, r24 ; 0x8013ba } } 2d470: 08 95 ret 0002d472 : mmu_print_saved |= SavedState::CooldownPending; LogEchoEvent_P(PSTR("Heater cooldown pending")); } } void MMU2::SaveAndPark(bool move_axes) { 2d472: 0f 93 push r16 2d474: 1f 93 push r17 2d476: cf 93 push r28 if (mmu_print_saved == SavedState::None) { // First occurrence. Save current position, park print head, disable nozzle heater. 2d478: 90 91 ba 13 lds r25, 0x13BA ; 0x8013ba 2d47c: 91 11 cpse r25, r1 2d47e: 72 c0 rjmp .+228 ; 0x2d564 2d480: c8 2f mov r28, r24 LogEchoEvent_P(PSTR("Saving and parking")); 2d482: 8c e0 ldi r24, 0x0C ; 12 2d484: 98 ea ldi r25, 0xA8 ; 168 2d486: 0f 94 90 c5 call 0x38b20 ; 0x38b20 Disable_E0(); 2d48a: 0f 94 6a c5 call 0x38ad4 ; 0x38ad4 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 2d48e: 0f 94 a3 42 call 0x28546 ; 0x28546 /// 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; 2d492: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 2d496: 81 11 cpse r24, r1 2d498: 02 c0 rjmp .+4 ; 0x2d49e 2d49a: 0e 94 61 64 call 0xc8c2 ; 0xc8c2 // 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) { 2d49e: cc 23 and r28, r28 2d4a0: 09 f4 brne .+2 ; 0x2d4a4 2d4a2: 60 c0 rjmp .+192 ; 0x2d564 mmu_print_saved |= SavedState::ParkExtruder; 2d4a4: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 2d4a8: 81 60 ori r24, 0x01 ; 1 2d4aa: 80 93 ba 13 sts 0x13BA, r24 ; 0x8013ba 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]); 2d4ae: 80 91 99 06 lds r24, 0x0699 ; 0x800699 2d4b2: 90 91 9a 06 lds r25, 0x069A ; 0x80069a 2d4b6: a0 91 9b 06 lds r26, 0x069B ; 0x80069b 2d4ba: b0 91 9c 06 lds r27, 0x069C ; 0x80069c 2d4be: 40 91 95 06 lds r20, 0x0695 ; 0x800695 2d4c2: 50 91 96 06 lds r21, 0x0696 ; 0x800696 2d4c6: 60 91 97 06 lds r22, 0x0697 ; 0x800697 2d4ca: 70 91 98 06 lds r23, 0x0698 ; 0x800698 resume_position = planner_current_position(); // save current pos 2d4ce: 00 91 91 06 lds r16, 0x0691 ; 0x800691 2d4d2: 10 91 92 06 lds r17, 0x0692 ; 0x800692 2d4d6: 20 91 93 06 lds r18, 0x0693 ; 0x800693 2d4da: 30 91 94 06 lds r19, 0x0694 ; 0x800694 2d4de: 00 93 a2 13 sts 0x13A2, r16 ; 0x8013a2 2d4e2: 10 93 a3 13 sts 0x13A3, r17 ; 0x8013a3 2d4e6: 20 93 a4 13 sts 0x13A4, r18 ; 0x8013a4 2d4ea: 30 93 a5 13 sts 0x13A5, r19 ; 0x8013a5 2d4ee: 40 93 a6 13 sts 0x13A6, r20 ; 0x8013a6 2d4f2: 50 93 a7 13 sts 0x13A7, r21 ; 0x8013a7 2d4f6: 60 93 a8 13 sts 0x13A8, r22 ; 0x8013a8 2d4fa: 70 93 a9 13 sts 0x13A9, r23 ; 0x8013a9 2d4fe: 80 93 aa 13 sts 0x13AA, r24 ; 0x8013aa 2d502: 90 93 ab 13 sts 0x13AB, r25 ; 0x8013ab 2d506: a0 93 ac 13 sts 0x13AC, r26 ; 0x8013ac 2d50a: b0 93 ad 13 sts 0x13AD, r27 ; 0x8013ad current_position[E_AXIS] += delta; planner_line_to_current_position(feedRate); } float move_raise_z(float delta) { return raise_z(delta); 2d50e: 60 e0 ldi r22, 0x00 ; 0 2d510: 70 e0 ldi r23, 0x00 ; 0 2d512: 80 ea ldi r24, 0xA0 ; 160 2d514: 91 e4 ldi r25, 0x41 ; 65 2d516: 0e 94 f9 6d call 0xdbf2 ; 0xdbf2 void Disable_E0() { disable_e0(); } bool all_axes_homed() { return axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]; 2d51a: 80 91 8e 06 lds r24, 0x068E ; 0x80068e 2d51e: 88 23 and r24, r24 2d520: 09 f1 breq .+66 ; 0x2d564 2d522: 80 91 8f 06 lds r24, 0x068F ; 0x80068f 2d526: 88 23 and r24, r24 2d528: e9 f0 breq .+58 ; 0x2d564 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; 2d52a: 80 e0 ldi r24, 0x00 ; 0 2d52c: 90 e0 ldi r25, 0x00 ; 0 2d52e: aa ef ldi r26, 0xFA ; 250 2d530: b2 e4 ldi r27, 0x42 ; 66 2d532: 80 93 91 06 sts 0x0691, r24 ; 0x800691 2d536: 90 93 92 06 sts 0x0692, r25 ; 0x800692 2d53a: a0 93 93 06 sts 0x0693, r26 ; 0x800693 2d53e: b0 93 94 06 sts 0x0694, r27 ; 0x800694 current_position[Y_AXIS] = MMU_ERR_Y_PAUSE_POS; 2d542: 10 92 95 06 sts 0x0695, r1 ; 0x800695 2d546: 10 92 96 06 sts 0x0696, r1 ; 0x800696 2d54a: 10 92 97 06 sts 0x0697, r1 ; 0x800697 2d54e: 10 92 98 06 sts 0x0698, r1 ; 0x800698 planner_line_to_current_position_sync(NOZZLE_PARK_XY_FEEDRATE); 2d552: 60 e0 ldi r22, 0x00 ; 0 2d554: 70 e0 ldi r23, 0x00 ; 0 2d556: 88 e4 ldi r24, 0x48 ; 72 2d558: 92 e4 ldi r25, 0x42 ; 66 if (all_axes_homed()) { nozzle_park(); } } } } 2d55a: cf 91 pop r28 2d55c: 1f 91 pop r17 2d55e: 0f 91 pop r16 2d560: 0d 94 8c c5 jmp 0x38b18 ; 0x38b18 2d564: cf 91 pop r28 2d566: 1f 91 pop r17 2d568: 0f 91 pop r16 2d56a: 08 95 ret 0002d56c : /// 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){ 2d56c: 2f 92 push r2 2d56e: 3f 92 push r3 2d570: 4f 92 push r4 2d572: 5f 92 push r5 2d574: 6f 92 push r6 2d576: 7f 92 push r7 2d578: 8f 92 push r8 2d57a: 9f 92 push r9 2d57c: af 92 push r10 2d57e: bf 92 push r11 2d580: cf 92 push r12 2d582: df 92 push r13 2d584: ef 92 push r14 2d586: ff 92 push r15 2d588: 0f 93 push r16 2d58a: 1f 93 push r17 2d58c: cf 93 push r28 2d58e: df 93 push r29 2d590: cd b7 in r28, 0x3d ; 61 2d592: de b7 in r29, 0x3e ; 62 2d594: cd 5b subi r28, 0xBD ; 189 2d596: d1 40 sbci r29, 0x01 ; 1 2d598: 0f b6 in r0, 0x3f ; 63 2d59a: f8 94 cli 2d59c: de bf out 0x3e, r29 ; 62 2d59e: 0f be out 0x3f, r0 ; 63 2d5a0: cd bf out 0x3d, r28 ; 61 2d5a2: c3 57 subi r28, 0x73 ; 115 2d5a4: de 4f sbci r29, 0xFE ; 254 2d5a6: 99 83 std Y+1, r25 ; 0x01 2d5a8: 88 83 st Y, r24 2d5aa: cd 58 subi r28, 0x8D ; 141 2d5ac: d1 40 sbci r29, 0x01 ; 1 2d5ae: c1 57 subi r28, 0x71 ; 113 2d5b0: de 4f sbci r29, 0xFE ; 254 2d5b2: 79 83 std Y+1, r23 ; 0x01 2d5b4: 68 83 st Y, r22 2d5b6: cf 58 subi r28, 0x8F ; 143 2d5b8: d1 40 sbci r29, 0x01 ; 1 2d5ba: ce 56 subi r28, 0x6E ; 110 2d5bc: de 4f sbci r29, 0xFE ; 254 2d5be: 59 83 std Y+1, r21 ; 0x01 2d5c0: 48 83 st Y, r20 2d5c2: c2 59 subi r28, 0x92 ; 146 2d5c4: d1 40 sbci r29, 0x01 ; 1 2d5c6: 84 e1 ldi r24, 0x14 ; 20 2d5c8: cf 56 subi r28, 0x6F ; 111 2d5ca: de 4f sbci r29, 0xFE ; 254 2d5cc: 88 83 st Y, r24 2d5ce: c1 59 subi r28, 0x91 ; 145 2d5d0: 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; 2d5d2: ce 56 subi r28, 0x6E ; 110 2d5d4: de 4f sbci r29, 0xFE ; 254 2d5d6: a8 81 ld r26, Y 2d5d8: b9 81 ldd r27, Y+1 ; 0x01 2d5da: c2 59 subi r28, 0x92 ; 146 2d5dc: d1 40 sbci r29, 0x01 ; 1 2d5de: 8d 91 ld r24, X+ 2d5e0: 9d 91 ld r25, X+ 2d5e2: 0d 90 ld r0, X+ 2d5e4: bc 91 ld r27, X 2d5e6: a0 2d mov r26, r0 2d5e8: c6 56 subi r28, 0x66 ; 102 2d5ea: de 4f sbci r29, 0xFE ; 254 2d5ec: 88 83 st Y, r24 2d5ee: 99 83 std Y+1, r25 ; 0x01 2d5f0: aa 83 std Y+2, r26 ; 0x02 2d5f2: bb 83 std Y+3, r27 ; 0x03 2d5f4: ca 59 subi r28, 0x9A ; 154 2d5f6: d1 40 sbci r29, 0x01 ; 1 2d5f8: c1 57 subi r28, 0x71 ; 113 2d5fa: de 4f sbci r29, 0xFE ; 254 2d5fc: a8 81 ld r26, Y 2d5fe: b9 81 ldd r27, Y+1 ; 0x01 2d600: cf 58 subi r28, 0x8F ; 143 2d602: d1 40 sbci r29, 0x01 ; 1 2d604: 8d 91 ld r24, X+ 2d606: 9d 91 ld r25, X+ 2d608: 0d 90 ld r0, X+ 2d60a: bc 91 ld r27, X 2d60c: a0 2d mov r26, r0 2d60e: ca 54 subi r28, 0x4A ; 74 2d610: de 4f sbci r29, 0xFE ; 254 2d612: 88 83 st Y, r24 2d614: 99 83 std Y+1, r25 ; 0x01 2d616: aa 83 std Y+2, r26 ; 0x02 2d618: bb 83 std Y+3, r27 ; 0x03 2d61a: c6 5b subi r28, 0xB6 ; 182 2d61c: d1 40 sbci r29, 0x01 ; 1 2d61e: c3 57 subi r28, 0x73 ; 115 2d620: de 4f sbci r29, 0xFE ; 254 2d622: a8 81 ld r26, Y 2d624: b9 81 ldd r27, Y+1 ; 0x01 2d626: cd 58 subi r28, 0x8D ; 141 2d628: d1 40 sbci r29, 0x01 ; 1 2d62a: 8d 91 ld r24, X+ 2d62c: 9d 91 ld r25, X+ 2d62e: 0d 90 ld r0, X+ 2d630: bc 91 ld r27, X 2d632: a0 2d mov r26, r0 2d634: c6 54 subi r28, 0x46 ; 70 2d636: de 4f sbci r29, 0xFE ; 254 2d638: 88 83 st Y, r24 2d63a: 99 83 std Y+1, r25 ; 0x01 2d63c: aa 83 std Y+2, r26 ; 0x02 2d63e: bb 83 std Y+3, r27 ; 0x03 2d640: ca 5b subi r28, 0xBA ; 186 2d642: d1 40 sbci r29, 0x01 ; 1 2d644: fe 01 movw r30, r28 2d646: e7 5f subi r30, 0xF7 ; 247 2d648: fe 4f sbci r31, 0xFE ; 254 2d64a: c8 55 subi r28, 0x58 ; 88 2d64c: de 4f sbci r29, 0xFE ; 254 2d64e: f9 83 std Y+1, r31 ; 0x01 2d650: e8 83 st Y, r30 2d652: c8 5a subi r28, 0xA8 ; 168 2d654: d1 40 sbci r29, 0x01 ; 1 2d656: ce 01 movw r24, r28 2d658: 8b 57 subi r24, 0x7B ; 123 2d65a: 9f 4f sbci r25, 0xFF ; 255 2d65c: ca 55 subi r28, 0x5A ; 90 2d65e: de 4f sbci r29, 0xFE ; 254 2d660: 99 83 std Y+1, r25 ; 0x01 2d662: 88 83 st Y, r24 2d664: c6 5a subi r28, 0xA6 ; 166 2d666: d1 40 sbci r29, 0x01 ; 1 2d668: de 01 movw r26, r28 2d66a: 11 96 adiw r26, 0x01 ; 1 2d66c: c8 56 subi r28, 0x68 ; 104 2d66e: de 4f sbci r29, 0xFE ; 254 2d670: b9 83 std Y+1, r27 ; 0x01 2d672: a8 83 st Y, r26 2d674: c8 59 subi r28, 0x98 ; 152 2d676: d1 40 sbci r29, 0x01 ; 1 2d678: 31 2c mov r3, r1 2d67a: 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; 2d67c: b1 01 movw r22, r2 2d67e: 03 2c mov r0, r3 2d680: 00 0c add r0, r0 2d682: 88 0b sbc r24, r24 2d684: 99 0b sbc r25, r25 2d686: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 2d68a: 2a e1 ldi r18, 0x1A ; 26 2d68c: 38 ef ldi r19, 0xF8 ; 248 2d68e: 42 e4 ldi r20, 0x42 ; 66 2d690: 5e e3 ldi r21, 0x3E ; 62 2d692: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 2d696: 6b 01 movw r12, r22 2d698: 7c 01 movw r14, r24 const float height = get_value(matrix_32x32, r * cos(angle) + x, r * sin(angle) + y) - target_z; 2d69a: 0f 94 bf e0 call 0x3c17e ; 0x3c17e 2d69e: c2 56 subi r28, 0x62 ; 98 2d6a0: de 4f sbci r29, 0xFE ; 254 2d6a2: 68 83 st Y, r22 2d6a4: 79 83 std Y+1, r23 ; 0x01 2d6a6: 8a 83 std Y+2, r24 ; 0x02 2d6a8: 9b 83 std Y+3, r25 ; 0x03 2d6aa: ce 59 subi r28, 0x9E ; 158 2d6ac: d1 40 sbci r29, 0x01 ; 1 2d6ae: c7 01 movw r24, r14 2d6b0: b6 01 movw r22, r12 2d6b2: 0f 94 f9 dd call 0x3bbf2 ; 0x3bbf2 2d6b6: ce 55 subi r28, 0x5E ; 94 2d6b8: de 4f sbci r29, 0xFE ; 254 2d6ba: 68 83 st Y, r22 2d6bc: 79 83 std Y+1, r23 ; 0x01 2d6be: 8a 83 std Y+2, r24 ; 0x02 2d6c0: 9b 83 std Y+3, r25 ; 0x03 2d6c2: c2 5a subi r28, 0xA2 ; 162 2d6c4: d1 40 sbci r29, 0x01 ; 1 2d6c6: 9b 01 movw r18, r22 2d6c8: ac 01 movw r20, r24 2d6ca: c6 56 subi r28, 0x66 ; 102 2d6cc: de 4f sbci r29, 0xFE ; 254 2d6ce: 68 81 ld r22, Y 2d6d0: 79 81 ldd r23, Y+1 ; 0x01 2d6d2: 8a 81 ldd r24, Y+2 ; 0x02 2d6d4: 9b 81 ldd r25, Y+3 ; 0x03 2d6d6: ca 59 subi r28, 0x9A ; 154 2d6d8: d1 40 sbci r29, 0x01 ; 1 2d6da: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 2d6de: c6 54 subi r28, 0x46 ; 70 2d6e0: de 4f sbci r29, 0xFE ; 254 2d6e2: 28 81 ld r18, Y 2d6e4: 39 81 ldd r19, Y+1 ; 0x01 2d6e6: 4a 81 ldd r20, Y+2 ; 0x02 2d6e8: 5b 81 ldd r21, Y+3 ; 0x03 2d6ea: ca 5b subi r28, 0xBA ; 186 2d6ec: d1 40 sbci r29, 0x01 ; 1 2d6ee: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 2d6f2: 6b 01 movw r12, r22 2d6f4: 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) 2d6f6: 20 e0 ldi r18, 0x00 ; 0 2d6f8: 30 e0 ldi r19, 0x00 ; 0 2d6fa: a9 01 movw r20, r18 2d6fc: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 2d700: 18 16 cp r1, r24 2d702: 0c f0 brlt .+2 ; 0x2d706 2d704: 7a c2 rjmp .+1268 ; 0x2dbfa // 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; 2d706: c2 56 subi r28, 0x62 ; 98 2d708: de 4f sbci r29, 0xFE ; 254 2d70a: 28 81 ld r18, Y 2d70c: 39 81 ldd r19, Y+1 ; 0x01 2d70e: 4a 81 ldd r20, Y+2 ; 0x02 2d710: 5b 81 ldd r21, Y+3 ; 0x03 2d712: ce 59 subi r28, 0x9E ; 158 2d714: d1 40 sbci r29, 0x01 ; 1 2d716: c6 56 subi r28, 0x66 ; 102 2d718: de 4f sbci r29, 0xFE ; 254 2d71a: 68 81 ld r22, Y 2d71c: 79 81 ldd r23, Y+1 ; 0x01 2d71e: 8a 81 ldd r24, Y+2 ; 0x02 2d720: 9b 81 ldd r25, Y+3 ; 0x03 2d722: ca 59 subi r28, 0x9A ; 154 2d724: d1 40 sbci r29, 0x01 ; 1 2d726: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 2d72a: ca 54 subi r28, 0x4A ; 74 2d72c: de 4f sbci r29, 0xFE ; 254 2d72e: 28 81 ld r18, Y 2d730: 39 81 ldd r19, Y+1 ; 0x01 2d732: 4a 81 ldd r20, Y+2 ; 0x02 2d734: 5b 81 ldd r21, Y+3 ; 0x03 2d736: c6 5b subi r28, 0xB6 ; 182 2d738: d1 40 sbci r29, 0x01 ; 1 2d73a: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 2d73e: 4b 01 movw r8, r22 2d740: 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) 2d742: 20 e0 ldi r18, 0x00 ; 0 2d744: 30 e0 ldi r19, 0x00 ; 0 2d746: a9 01 movw r20, r18 2d748: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 2d74c: 18 16 cp r1, r24 2d74e: 0c f0 brlt .+2 ; 0x2d752 2d750: 54 c2 rjmp .+1192 ; 0x2dbfa 2d752: 20 e0 ldi r18, 0x00 ; 0 2d754: 30 e0 ldi r19, 0x00 ; 0 2d756: 48 ef ldi r20, 0xF8 ; 248 2d758: 51 e4 ldi r21, 0x41 ; 65 2d75a: c7 01 movw r24, r14 2d75c: b6 01 movw r22, r12 2d75e: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 2d762: 87 ff sbrs r24, 7 2d764: 4a c2 rjmp .+1172 ; 0x2dbfa 2d766: 20 e0 ldi r18, 0x00 ; 0 2d768: 30 e0 ldi r19, 0x00 ; 0 2d76a: 48 ef ldi r20, 0xF8 ; 248 2d76c: 51 e4 ldi r21, 0x41 ; 65 2d76e: c5 01 movw r24, r10 2d770: b4 01 movw r22, r8 2d772: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 2d776: 87 ff sbrs r24, 7 2d778: 40 c2 rjmp .+1152 ; 0x2dbfa return 0; /// calculate weights of nearby points const float wc1 = c - floor(c); 2d77a: c7 01 movw r24, r14 2d77c: b6 01 movw r22, r12 2d77e: 0f 94 a6 de call 0x3bd4c ; 0x3bd4c 2d782: 9b 01 movw r18, r22 2d784: ac 01 movw r20, r24 2d786: c7 01 movw r24, r14 2d788: b6 01 movw r22, r12 2d78a: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 2d78e: 2b 01 movw r4, r22 2d790: 3c 01 movw r6, r24 const float wr1 = r - floor(r); 2d792: c5 01 movw r24, r10 2d794: b4 01 movw r22, r8 2d796: 0f 94 a6 de call 0x3bd4c ; 0x3bd4c 2d79a: 9b 01 movw r18, r22 2d79c: ac 01 movw r20, r24 2d79e: c5 01 movw r24, r10 2d7a0: b4 01 movw r22, r8 2d7a2: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 2d7a6: cc 56 subi r28, 0x6C ; 108 2d7a8: de 4f sbci r29, 0xFE ; 254 2d7aa: 68 83 st Y, r22 2d7ac: 79 83 std Y+1, r23 ; 0x01 2d7ae: 8a 83 std Y+2, r24 ; 0x02 2d7b0: 9b 83 std Y+3, r25 ; 0x03 2d7b2: c4 59 subi r28, 0x94 ; 148 2d7b4: d1 40 sbci r29, 0x01 ; 1 const float wc0 = 1 - wc1; 2d7b6: a3 01 movw r20, r6 2d7b8: 92 01 movw r18, r4 2d7ba: 60 e0 ldi r22, 0x00 ; 0 2d7bc: 70 e0 ldi r23, 0x00 ; 0 2d7be: 80 e8 ldi r24, 0x80 ; 128 2d7c0: 9f e3 ldi r25, 0x3F ; 63 2d7c2: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 2d7c6: c2 55 subi r28, 0x52 ; 82 2d7c8: de 4f sbci r29, 0xFE ; 254 2d7ca: 68 83 st Y, r22 2d7cc: 79 83 std Y+1, r23 ; 0x01 2d7ce: 8a 83 std Y+2, r24 ; 0x02 2d7d0: 9b 83 std Y+3, r25 ; 0x03 2d7d2: ce 5a subi r28, 0xAE ; 174 2d7d4: d1 40 sbci r29, 0x01 ; 1 const float wr0 = 1 - wr1; 2d7d6: cc 56 subi r28, 0x6C ; 108 2d7d8: de 4f sbci r29, 0xFE ; 254 2d7da: 28 81 ld r18, Y 2d7dc: 39 81 ldd r19, Y+1 ; 0x01 2d7de: 4a 81 ldd r20, Y+2 ; 0x02 2d7e0: 5b 81 ldd r21, Y+3 ; 0x03 2d7e2: c4 59 subi r28, 0x94 ; 148 2d7e4: d1 40 sbci r29, 0x01 ; 1 2d7e6: 60 e0 ldi r22, 0x00 ; 0 2d7e8: 70 e0 ldi r23, 0x00 ; 0 2d7ea: 80 e8 ldi r24, 0x80 ; 128 2d7ec: 9f e3 ldi r25, 0x3F ; 63 2d7ee: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 2d7f2: ce 54 subi r28, 0x4E ; 78 2d7f4: de 4f sbci r29, 0xFE ; 254 2d7f6: 68 83 st Y, r22 2d7f8: 79 83 std Y+1, r23 ; 0x01 2d7fa: 8a 83 std Y+2, r24 ; 0x02 2d7fc: 9b 83 std Y+3, r25 ; 0x03 2d7fe: c2 5b subi r28, 0xB2 ; 178 2d800: 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; 2d802: c7 01 movw r24, r14 2d804: b6 01 movw r22, r12 2d806: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 2d80a: 6b 01 movw r12, r22 const uint16_t c1 = c0 + 1; 2d80c: fb 01 movw r30, r22 2d80e: 31 96 adiw r30, 0x01 ; 1 2d810: c6 55 subi r28, 0x56 ; 86 2d812: de 4f sbci r29, 0xFE ; 254 2d814: f9 83 std Y+1, r31 ; 0x01 2d816: e8 83 st Y, r30 2d818: ca 5a subi r28, 0xAA ; 170 2d81a: d1 40 sbci r29, 0x01 ; 1 const uint16_t r0 = r; 2d81c: c5 01 movw r24, r10 2d81e: b4 01 movw r22, r8 2d820: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> const uint16_t r1 = r0 + 1; const uint16_t idx00 = c0 + 32 * r0; 2d824: 8b 01 movw r16, r22 2d826: 95 e0 ldi r25, 0x05 ; 5 2d828: 00 0f add r16, r16 2d82a: 11 1f adc r17, r17 2d82c: 9a 95 dec r25 2d82e: e1 f7 brne .-8 ; 0x2d828 const uint16_t idx01 = c0 + 32 * r1; 2d830: c8 01 movw r24, r16 2d832: 80 96 adiw r24, 0x20 ; 32 2d834: c4 55 subi r28, 0x54 ; 84 2d836: de 4f sbci r29, 0xFE ; 254 2d838: 99 83 std Y+1, r25 ; 0x01 2d83a: 88 83 st Y, r24 2d83c: cc 5a subi r28, 0xAC ; 172 2d83e: 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]; 2d840: f8 01 movw r30, r16 2d842: ec 0d add r30, r12 2d844: fd 1d adc r31, r13 2d846: ec 53 subi r30, 0x3C ; 60 2d848: f9 4f sbci r31, 0xF9 ; 249 2d84a: 60 81 ld r22, Z 2d84c: 70 e0 ldi r23, 0x00 ; 0 2d84e: 90 e0 ldi r25, 0x00 ; 0 2d850: 80 e0 ldi r24, 0x00 ; 0 2d852: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 2d856: 4b 01 movw r8, r22 2d858: 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; 2d85a: ce 54 subi r28, 0x4E ; 78 2d85c: de 4f sbci r29, 0xFE ; 254 2d85e: 28 81 ld r18, Y 2d860: 39 81 ldd r19, Y+1 ; 0x01 2d862: 4a 81 ldd r20, Y+2 ; 0x02 2d864: 5b 81 ldd r21, Y+3 ; 0x03 2d866: c2 5b subi r28, 0xB2 ; 178 2d868: d1 40 sbci r29, 0x01 ; 1 2d86a: c2 55 subi r28, 0x52 ; 82 2d86c: de 4f sbci r29, 0xFE ; 254 2d86e: 68 81 ld r22, Y 2d870: 79 81 ldd r23, Y+1 ; 0x01 2d872: 8a 81 ldd r24, Y+2 ; 0x02 2d874: 9b 81 ldd r25, Y+3 ; 0x03 2d876: ce 5a subi r28, 0xAE ; 174 2d878: d1 40 sbci r29, 0x01 ; 1 2d87a: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 2d87e: 9b 01 movw r18, r22 2d880: 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]; 2d882: c5 01 movw r24, r10 2d884: b4 01 movw r22, r8 2d886: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 2d88a: 4b 01 movw r8, r22 2d88c: 5c 01 movw r10, r24 2d88e: c4 55 subi r28, 0x54 ; 84 2d890: de 4f sbci r29, 0xFE ; 254 2d892: e8 81 ld r30, Y 2d894: f9 81 ldd r31, Y+1 ; 0x01 2d896: cc 5a subi r28, 0xAC ; 172 2d898: d1 40 sbci r29, 0x01 ; 1 2d89a: ec 0d add r30, r12 2d89c: fd 1d adc r31, r13 2d89e: ec 53 subi r30, 0x3C ; 60 2d8a0: f9 4f sbci r31, 0xF9 ; 249 2d8a2: 60 81 ld r22, Z 2d8a4: 70 e0 ldi r23, 0x00 ; 0 2d8a6: 90 e0 ldi r25, 0x00 ; 0 2d8a8: 80 e0 ldi r24, 0x00 ; 0 2d8aa: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 2d8ae: 6b 01 movw r12, r22 2d8b0: 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; 2d8b2: c2 55 subi r28, 0x52 ; 82 2d8b4: de 4f sbci r29, 0xFE ; 254 2d8b6: 28 81 ld r18, Y 2d8b8: 39 81 ldd r19, Y+1 ; 0x01 2d8ba: 4a 81 ldd r20, Y+2 ; 0x02 2d8bc: 5b 81 ldd r21, Y+3 ; 0x03 2d8be: ce 5a subi r28, 0xAE ; 174 2d8c0: d1 40 sbci r29, 0x01 ; 1 2d8c2: cc 56 subi r28, 0x6C ; 108 2d8c4: de 4f sbci r29, 0xFE ; 254 2d8c6: 68 81 ld r22, Y 2d8c8: 79 81 ldd r23, Y+1 ; 0x01 2d8ca: 8a 81 ldd r24, Y+2 ; 0x02 2d8cc: 9b 81 ldd r25, Y+3 ; 0x03 2d8ce: c4 59 subi r28, 0x94 ; 148 2d8d0: d1 40 sbci r29, 0x01 ; 1 2d8d2: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 2d8d6: 9b 01 movw r18, r22 2d8d8: 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]; 2d8da: c7 01 movw r24, r14 2d8dc: b6 01 movw r22, r12 2d8de: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 2d8e2: 9b 01 movw r18, r22 2d8e4: ac 01 movw r20, r24 2d8e6: c5 01 movw r24, r10 2d8e8: b4 01 movw r22, r8 2d8ea: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 2d8ee: 6b 01 movw r12, r22 2d8f0: 7c 01 movw r14, r24 2d8f2: c6 55 subi r28, 0x56 ; 86 2d8f4: de 4f sbci r29, 0xFE ; 254 2d8f6: a8 81 ld r26, Y 2d8f8: b9 81 ldd r27, Y+1 ; 0x01 2d8fa: ca 5a subi r28, 0xAA ; 170 2d8fc: d1 40 sbci r29, 0x01 ; 1 2d8fe: 0a 0f add r16, r26 2d900: 1b 1f adc r17, r27 2d902: f8 01 movw r30, r16 2d904: ec 53 subi r30, 0x3C ; 60 2d906: f9 4f sbci r31, 0xF9 ; 249 2d908: 60 81 ld r22, Z 2d90a: 70 e0 ldi r23, 0x00 ; 0 2d90c: 90 e0 ldi r25, 0x00 ; 0 2d90e: 80 e0 ldi r24, 0x00 ; 0 2d910: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 2d914: 4b 01 movw r8, r22 2d916: 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; 2d918: ce 54 subi r28, 0x4E ; 78 2d91a: de 4f sbci r29, 0xFE ; 254 2d91c: 28 81 ld r18, Y 2d91e: 39 81 ldd r19, Y+1 ; 0x01 2d920: 4a 81 ldd r20, Y+2 ; 0x02 2d922: 5b 81 ldd r21, Y+3 ; 0x03 2d924: c2 5b subi r28, 0xB2 ; 178 2d926: d1 40 sbci r29, 0x01 ; 1 2d928: c3 01 movw r24, r6 2d92a: b2 01 movw r22, r4 2d92c: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 2d930: 9b 01 movw r18, r22 2d932: 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]; 2d934: c5 01 movw r24, r10 2d936: b4 01 movw r22, r8 2d938: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 2d93c: 9b 01 movw r18, r22 2d93e: ac 01 movw r20, r24 2d940: c7 01 movw r24, r14 2d942: b6 01 movw r22, r12 2d944: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 2d948: 6b 01 movw r12, r22 2d94a: 7c 01 movw r14, r24 2d94c: c6 55 subi r28, 0x56 ; 86 2d94e: de 4f sbci r29, 0xFE ; 254 2d950: e8 81 ld r30, Y 2d952: f9 81 ldd r31, Y+1 ; 0x01 2d954: ca 5a subi r28, 0xAA ; 170 2d956: d1 40 sbci r29, 0x01 ; 1 2d958: c4 55 subi r28, 0x54 ; 84 2d95a: de 4f sbci r29, 0xFE ; 254 2d95c: 88 81 ld r24, Y 2d95e: 99 81 ldd r25, Y+1 ; 0x01 2d960: cc 5a subi r28, 0xAC ; 172 2d962: d1 40 sbci r29, 0x01 ; 1 2d964: e8 0f add r30, r24 2d966: f9 1f adc r31, r25 2d968: ec 53 subi r30, 0x3C ; 60 2d96a: f9 4f sbci r31, 0xF9 ; 249 2d96c: 60 81 ld r22, Z 2d96e: 70 e0 ldi r23, 0x00 ; 0 2d970: 90 e0 ldi r25, 0x00 ; 0 2d972: 80 e0 ldi r24, 0x00 ; 0 2d974: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 2d978: 4b 01 movw r8, r22 2d97a: 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; 2d97c: cc 56 subi r28, 0x6C ; 108 2d97e: de 4f sbci r29, 0xFE ; 254 2d980: 28 81 ld r18, Y 2d982: 39 81 ldd r19, Y+1 ; 0x01 2d984: 4a 81 ldd r20, Y+2 ; 0x02 2d986: 5b 81 ldd r21, Y+3 ; 0x03 2d988: c4 59 subi r28, 0x94 ; 148 2d98a: d1 40 sbci r29, 0x01 ; 1 2d98c: c3 01 movw r24, r6 2d98e: b2 01 movw r22, r4 2d990: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 2d994: 9b 01 movw r18, r22 2d996: 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]; 2d998: c5 01 movw r24, r10 2d99a: b4 01 movw r22, r8 2d99c: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 2d9a0: 9b 01 movw r18, r22 2d9a2: ac 01 movw r20, r24 2d9a4: c7 01 movw r24, r14 2d9a6: b6 01 movw r22, r12 2d9a8: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__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; 2d9ac: 20 e0 ldi r18, 0x00 ; 0 2d9ae: 30 e0 ldi r19, 0x00 ; 0 2d9b0: 40 e0 ldi r20, 0x00 ; 0 2d9b2: 52 e4 ldi r21, 0x42 ; 66 2d9b4: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 2d9b8: 6b 01 movw r12, r22 2d9ba: 7c 01 movw r14, r24 // DBG(_n("%f "), point); shifts_x[p] = cos(angle) * height; 2d9bc: ac 01 movw r20, r24 2d9be: 9b 01 movw r18, r22 2d9c0: ce 55 subi r28, 0x5E ; 94 2d9c2: de 4f sbci r29, 0xFE ; 254 2d9c4: 68 81 ld r22, Y 2d9c6: 79 81 ldd r23, Y+1 ; 0x01 2d9c8: 8a 81 ldd r24, Y+2 ; 0x02 2d9ca: 9b 81 ldd r25, Y+3 ; 0x03 2d9cc: c2 5a subi r28, 0xA2 ; 162 2d9ce: d1 40 sbci r29, 0x01 ; 1 2d9d0: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 2d9d4: c8 55 subi r28, 0x58 ; 88 2d9d6: de 4f sbci r29, 0xFE ; 254 2d9d8: a8 81 ld r26, Y 2d9da: b9 81 ldd r27, Y+1 ; 0x01 2d9dc: c8 5a subi r28, 0xA8 ; 168 2d9de: d1 40 sbci r29, 0x01 ; 1 2d9e0: 6d 93 st X+, r22 2d9e2: 7d 93 st X+, r23 2d9e4: 8d 93 st X+, r24 2d9e6: 9d 93 st X+, r25 2d9e8: c8 55 subi r28, 0x58 ; 88 2d9ea: de 4f sbci r29, 0xFE ; 254 2d9ec: b9 83 std Y+1, r27 ; 0x01 2d9ee: a8 83 st Y, r26 2d9f0: c8 5a subi r28, 0xA8 ; 168 2d9f2: d1 40 sbci r29, 0x01 ; 1 shifts_y[p] = sin(angle) * height; 2d9f4: a7 01 movw r20, r14 2d9f6: 96 01 movw r18, r12 2d9f8: c2 56 subi r28, 0x62 ; 98 2d9fa: de 4f sbci r29, 0xFE ; 254 2d9fc: 68 81 ld r22, Y 2d9fe: 79 81 ldd r23, Y+1 ; 0x01 2da00: 8a 81 ldd r24, Y+2 ; 0x02 2da02: 9b 81 ldd r25, Y+3 ; 0x03 2da04: ce 59 subi r28, 0x9E ; 158 2da06: d1 40 sbci r29, 0x01 ; 1 2da08: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 2da0c: ca 55 subi r28, 0x5A ; 90 2da0e: de 4f sbci r29, 0xFE ; 254 2da10: e8 81 ld r30, Y 2da12: f9 81 ldd r31, Y+1 ; 0x01 2da14: c6 5a subi r28, 0xA6 ; 166 2da16: d1 40 sbci r29, 0x01 ; 1 2da18: 61 93 st Z+, r22 2da1a: 71 93 st Z+, r23 2da1c: 81 93 st Z+, r24 2da1e: 91 93 st Z+, r25 2da20: ca 55 subi r28, 0x5A ; 90 2da22: de 4f sbci r29, 0xFE ; 254 2da24: f9 83 std Y+1, r31 ; 0x01 2da26: e8 83 st Y, r30 2da28: c6 5a subi r28, 0xA6 ; 166 2da2a: d1 40 sbci r29, 0x01 ; 1 shifts_r[p] = height; 2da2c: c8 56 subi r28, 0x68 ; 104 2da2e: de 4f sbci r29, 0xFE ; 254 2da30: a8 81 ld r26, Y 2da32: b9 81 ldd r27, Y+1 ; 0x01 2da34: c8 59 subi r28, 0x98 ; 152 2da36: d1 40 sbci r29, 0x01 ; 1 2da38: cd 92 st X+, r12 2da3a: dd 92 st X+, r13 2da3c: ed 92 st X+, r14 2da3e: fd 92 st X+, r15 2da40: c8 56 subi r28, 0x68 ; 104 2da42: de 4f sbci r29, 0xFE ; 254 2da44: b9 83 std Y+1, r27 ; 0x01 2da46: a8 83 st Y, r26 2da48: c8 59 subi r28, 0x98 ; 152 2da4a: d1 40 sbci r29, 0x01 ; 1 2da4c: bf ef ldi r27, 0xFF ; 255 2da4e: 2b 1a sub r2, r27 2da50: 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){ 2da52: e1 e2 ldi r30, 0x21 ; 33 2da54: 2e 16 cp r2, r30 2da56: 31 04 cpc r3, r1 2da58: 09 f0 breq .+2 ; 0x2da5c 2da5a: 10 ce rjmp .-992 ; 0x2d67c 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); 2da5c: 40 e0 ldi r20, 0x00 ; 0 2da5e: 50 e0 ldi r21, 0x00 ; 0 2da60: 60 e0 ldi r22, 0x00 ; 0 2da62: 7d e3 ldi r23, 0x3D ; 61 2da64: ce 01 movw r24, r28 2da66: 87 5f subi r24, 0xF7 ; 247 2da68: 9e 4f sbci r25, 0xFE ; 254 2da6a: 0f 94 b2 64 call 0x2c964 ; 0x2c964 2da6e: 9b 01 movw r18, r22 2da70: ac 01 movw r20, r24 2da72: c3 57 subi r28, 0x73 ; 115 2da74: de 4f sbci r29, 0xFE ; 254 2da76: a8 81 ld r26, Y 2da78: b9 81 ldd r27, Y+1 ; 0x01 2da7a: cd 58 subi r28, 0x8D ; 141 2da7c: d1 40 sbci r29, 0x01 ; 1 2da7e: 6d 91 ld r22, X+ 2da80: 7d 91 ld r23, X+ 2da82: 8d 91 ld r24, X+ 2da84: 9c 91 ld r25, X 2da86: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 2da8a: c3 57 subi r28, 0x73 ; 115 2da8c: de 4f sbci r29, 0xFE ; 254 2da8e: e8 81 ld r30, Y 2da90: f9 81 ldd r31, Y+1 ; 0x01 2da92: cd 58 subi r28, 0x8D ; 141 2da94: d1 40 sbci r29, 0x01 ; 1 2da96: 60 83 st Z, r22 2da98: 71 83 std Z+1, r23 ; 0x01 2da9a: 82 83 std Z+2, r24 ; 0x02 2da9c: 93 83 std Z+3, r25 ; 0x03 y += CLAMP_median(shifts_y, blocks, norm); 2da9e: 40 e0 ldi r20, 0x00 ; 0 2daa0: 50 e0 ldi r21, 0x00 ; 0 2daa2: 60 e0 ldi r22, 0x00 ; 0 2daa4: 7d e3 ldi r23, 0x3D ; 61 2daa6: ce 01 movw r24, r28 2daa8: 8b 57 subi r24, 0x7B ; 123 2daaa: 9f 4f sbci r25, 0xFF ; 255 2daac: 0f 94 b2 64 call 0x2c964 ; 0x2c964 2dab0: 9b 01 movw r18, r22 2dab2: ac 01 movw r20, r24 2dab4: c1 57 subi r28, 0x71 ; 113 2dab6: de 4f sbci r29, 0xFE ; 254 2dab8: a8 81 ld r26, Y 2daba: b9 81 ldd r27, Y+1 ; 0x01 2dabc: cf 58 subi r28, 0x8F ; 143 2dabe: d1 40 sbci r29, 0x01 ; 1 2dac0: 6d 91 ld r22, X+ 2dac2: 7d 91 ld r23, X+ 2dac4: 8d 91 ld r24, X+ 2dac6: 9c 91 ld r25, X 2dac8: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 2dacc: c1 57 subi r28, 0x71 ; 113 2dace: de 4f sbci r29, 0xFE ; 254 2dad0: e8 81 ld r30, Y 2dad2: f9 81 ldd r31, Y+1 ; 0x01 2dad4: cf 58 subi r28, 0x8F ; 143 2dad6: d1 40 sbci r29, 0x01 ; 1 2dad8: 60 83 st Z, r22 2dada: 71 83 std Z+1, r23 ; 0x01 2dadc: 82 83 std Z+2, r24 ; 0x02 2dade: 93 83 std Z+3, r25 ; 0x03 r += CLAMP_median(shifts_r, blocks, norm * .5f); 2dae0: 40 e0 ldi r20, 0x00 ; 0 2dae2: 50 e0 ldi r21, 0x00 ; 0 2dae4: 60 e8 ldi r22, 0x80 ; 128 2dae6: 7c e3 ldi r23, 0x3C ; 60 2dae8: ce 01 movw r24, r28 2daea: 01 96 adiw r24, 0x01 ; 1 2daec: 0f 94 b2 64 call 0x2c964 ; 0x2c964 2daf0: ce 56 subi r28, 0x6E ; 110 2daf2: de 4f sbci r29, 0xFE ; 254 2daf4: a8 81 ld r26, Y 2daf6: b9 81 ldd r27, Y+1 ; 0x01 2daf8: c2 59 subi r28, 0x92 ; 146 2dafa: d1 40 sbci r29, 0x01 ; 1 2dafc: 2d 91 ld r18, X+ 2dafe: 3d 91 ld r19, X+ 2db00: 4d 91 ld r20, X+ 2db02: 5c 91 ld r21, X 2db04: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 2db08: 16 2f mov r17, r22 2db0a: 07 2f mov r16, r23 2db0c: f8 2e mov r15, r24 2db0e: e9 2e mov r14, r25 r = MAX(2, r); 2db10: 20 e0 ldi r18, 0x00 ; 0 2db12: 30 e0 ldi r19, 0x00 ; 0 2db14: 40 e0 ldi r20, 0x00 ; 0 2db16: 50 e4 ldi r21, 0x40 ; 64 2db18: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 2db1c: 18 16 cp r1, r24 2db1e: 2c f0 brlt .+10 ; 0x2db2a 2db20: 10 e0 ldi r17, 0x00 ; 0 2db22: 00 e0 ldi r16, 0x00 ; 0 2db24: f1 2c mov r15, r1 2db26: 80 e4 ldi r24, 0x40 ; 64 2db28: e8 2e mov r14, r24 2db2a: a8 01 movw r20, r16 2db2c: 97 01 movw r18, r14 2db2e: 85 2f mov r24, r21 2db30: 90 2f mov r25, r16 2db32: a3 2f mov r26, r19 2db34: be 2d mov r27, r14 2db36: ce 56 subi r28, 0x6E ; 110 2db38: de 4f sbci r29, 0xFE ; 254 2db3a: e8 81 ld r30, Y 2db3c: f9 81 ldd r31, Y+1 ; 0x01 2db3e: c2 59 subi r28, 0x92 ; 146 2db40: d1 40 sbci r29, 0x01 ; 1 2db42: 80 83 st Z, r24 2db44: 91 83 std Z+1, r25 ; 0x01 2db46: a2 83 std Z+2, r26 ; 0x02 2db48: b3 83 std Z+3, r27 ; 0x03 2db4a: cf 56 subi r28, 0x6F ; 111 2db4c: de 4f sbci r29, 0xFE ; 254 2db4e: f8 81 ld r31, Y 2db50: c1 59 subi r28, 0x91 ; 145 2db52: d1 40 sbci r29, 0x01 ; 1 2db54: f1 50 subi r31, 0x01 ; 1 2db56: cf 56 subi r28, 0x6F ; 111 2db58: de 4f sbci r29, 0xFE ; 254 2db5a: f8 83 st Y, r31 2db5c: c1 59 subi r28, 0x91 ; 145 2db5e: 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){ 2db60: f1 11 cpse r31, r1 2db62: 37 cd rjmp .-1426 ; 0x2d5d2 r = MAX(2, r); } //@size=118 DBG(_n(" [%f, %f][%f] final circle\n"), x, y, r); 2db64: ef 92 push r14 2db66: ff 92 push r15 2db68: 0f 93 push r16 2db6a: 1f 93 push r17 2db6c: c1 57 subi r28, 0x71 ; 113 2db6e: de 4f sbci r29, 0xFE ; 254 2db70: a8 81 ld r26, Y 2db72: b9 81 ldd r27, Y+1 ; 0x01 2db74: cf 58 subi r28, 0x8F ; 143 2db76: d1 40 sbci r29, 0x01 ; 1 2db78: 13 96 adiw r26, 0x03 ; 3 2db7a: 8c 91 ld r24, X 2db7c: 13 97 sbiw r26, 0x03 ; 3 2db7e: 8f 93 push r24 2db80: 12 96 adiw r26, 0x02 ; 2 2db82: 8c 91 ld r24, X 2db84: 12 97 sbiw r26, 0x02 ; 2 2db86: 8f 93 push r24 2db88: 11 96 adiw r26, 0x01 ; 1 2db8a: 8c 91 ld r24, X 2db8c: 11 97 sbiw r26, 0x01 ; 1 2db8e: 8f 93 push r24 2db90: 8c 91 ld r24, X 2db92: 8f 93 push r24 2db94: c3 57 subi r28, 0x73 ; 115 2db96: de 4f sbci r29, 0xFE ; 254 2db98: e8 81 ld r30, Y 2db9a: f9 81 ldd r31, Y+1 ; 0x01 2db9c: cd 58 subi r28, 0x8D ; 141 2db9e: d1 40 sbci r29, 0x01 ; 1 2dba0: 83 81 ldd r24, Z+3 ; 0x03 2dba2: 8f 93 push r24 2dba4: 82 81 ldd r24, Z+2 ; 0x02 2dba6: 8f 93 push r24 2dba8: 81 81 ldd r24, Z+1 ; 0x01 2dbaa: 8f 93 push r24 2dbac: 80 81 ld r24, Z 2dbae: 8f 93 push r24 2dbb0: 8f ee ldi r24, 0xEF ; 239 2dbb2: 96 ea ldi r25, 0xA6 ; 166 2dbb4: 9f 93 push r25 2dbb6: 8f 93 push r24 2dbb8: 0f 94 99 da call 0x3b532 ; 0x3b532 2dbbc: 0f b6 in r0, 0x3f ; 63 2dbbe: f8 94 cli 2dbc0: de bf out 0x3e, r29 ; 62 2dbc2: 0f be out 0x3f, r0 ; 63 2dbc4: cd bf out 0x3d, r28 ; 61 } 2dbc6: c3 54 subi r28, 0x43 ; 67 2dbc8: de 4f sbci r29, 0xFE ; 254 2dbca: 0f b6 in r0, 0x3f ; 63 2dbcc: f8 94 cli 2dbce: de bf out 0x3e, r29 ; 62 2dbd0: 0f be out 0x3f, r0 ; 63 2dbd2: cd bf out 0x3d, r28 ; 61 2dbd4: df 91 pop r29 2dbd6: cf 91 pop r28 2dbd8: 1f 91 pop r17 2dbda: 0f 91 pop r16 2dbdc: ff 90 pop r15 2dbde: ef 90 pop r14 2dbe0: df 90 pop r13 2dbe2: cf 90 pop r12 2dbe4: bf 90 pop r11 2dbe6: af 90 pop r10 2dbe8: 9f 90 pop r9 2dbea: 8f 90 pop r8 2dbec: 7f 90 pop r7 2dbee: 6f 90 pop r6 2dbf0: 5f 90 pop r5 2dbf2: 4f 90 pop r4 2dbf4: 3f 90 pop r3 2dbf6: 2f 90 pop r2 2dbf8: 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; 2dbfa: 60 e0 ldi r22, 0x00 ; 0 2dbfc: 70 e0 ldi r23, 0x00 ; 0 2dbfe: cb 01 movw r24, r22 2dc00: d5 ce rjmp .-598 ; 0x2d9ac 0002dc02 : 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){ 2dc02: ef 92 push r14 2dc04: ff 92 push r15 2dc06: 0f 93 push r16 2dc08: 1f 93 push r17 2dc0a: cf 93 push r28 2dc0c: df 93 push r29 2dc0e: 1f 92 push r1 2dc10: 1f 92 push r1 2dc12: cd b7 in r28, 0x3d ; 61 2dc14: de b7 in r29, 0x3e ; 62 2dc16: f8 2e mov r15, r24 2dc18: e6 2e mov r14, r22 if (steps == 0) return; uint16_t current_delay_us = MAX_DELAY; 2dc1a: 80 e1 ldi r24, 0x10 ; 16 2dc1c: 97 e2 ldi r25, 0x27 ; 39 2dc1e: 9a 83 std Y+2, r25 ; 0x02 2dc20: 89 83 std Y+1, r24 ; 0x01 const uint16_t half = steps / 2; 2dc22: 8a 01 movw r16, r20 2dc24: 16 95 lsr r17 2dc26: 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); 2dc28: 8f 2d mov r24, r15 2dc2a: 0e 94 f7 ea call 0x1d5ee ; 0x1d5ee while (steps--){ 2dc2e: 01 50 subi r16, 0x01 ; 1 2dc30: 11 09 sbc r17, r1 2dc32: 78 f0 brcs .+30 ; 0x2dc52 accelerate_1_step(axes, acc, delay_us, min_delay_us); 2dc34: 28 ec ldi r18, 0xC8 ; 200 2dc36: 30 e0 ldi r19, 0x00 ; 0 2dc38: ae 01 movw r20, r28 2dc3a: 4f 5f subi r20, 0xFF ; 255 2dc3c: 5f 4f sbci r21, 0xFF ; 255 2dc3e: 68 ee ldi r22, 0xE8 ; 232 2dc40: 73 e0 ldi r23, 0x03 ; 3 2dc42: 8f 2d mov r24, r15 2dc44: 0e 94 c8 e9 call 0x1d390 ; 0x1d390 update_position_1_step(axes, dir); 2dc48: 6e 2d mov r22, r14 2dc4a: 8f 2d mov r24, r15 2dc4c: 0e 94 10 eb call 0x1d620 ; 0x1d620 2dc50: ee cf rjmp .-36 ; 0x2dc2e } /// \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); 2dc52: 6e 2d mov r22, r14 2dc54: 8f 2d mov r24, r15 2dc56: 0e 94 f7 ea call 0x1d5ee ; 0x1d5ee 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); } 2dc5a: 0f 90 pop r0 2dc5c: 0f 90 pop r0 2dc5e: df 91 pop r29 2dc60: cf 91 pop r28 2dc62: 1f 91 pop r17 2dc64: 0f 91 pop r16 2dc66: ff 90 pop r15 2dc68: ef 90 pop r14 2dc6a: 08 95 ret 0002dc6c : /// 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) 2dc6c: 2f 92 push r2 2dc6e: 3f 92 push r3 2dc70: 4f 92 push r4 2dc72: 5f 92 push r5 2dc74: 6f 92 push r6 2dc76: 7f 92 push r7 2dc78: 8f 92 push r8 2dc7a: 9f 92 push r9 2dc7c: af 92 push r10 2dc7e: bf 92 push r11 2dc80: cf 92 push r12 2dc82: df 92 push r13 2dc84: ef 92 push r14 2dc86: ff 92 push r15 2dc88: 0f 93 push r16 2dc8a: 1f 93 push r17 2dc8c: cf 93 push r28 2dc8e: df 93 push r29 2dc90: cd b7 in r28, 0x3d ; 61 2dc92: de b7 in r29, 0x3e ; 62 2dc94: 6c 97 sbiw r28, 0x1c ; 28 2dc96: 0f b6 in r0, 0x3f ; 63 2dc98: f8 94 cli 2dc9a: de bf out 0x3e, r29 ; 62 2dc9c: 0f be out 0x3f, r0 ; 63 2dc9e: cd bf out 0x3d, r28 ; 61 2dca0: 6c 01 movw r12, r24 2dca2: 5b 01 movw r10, r22 2dca4: 4a 01 movw r8, r20 2dca6: 19 01 movw r2, r18 2dca8: 18 87 std Y+8, r17 ; 0x08 2dcaa: 0f 83 std Y+7, r16 ; 0x07 2dcac: fa 82 std Y+2, r15 ; 0x02 2dcae: 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; 2dcb0: d7 01 movw r26, r14 2dcb2: 8d 91 ld r24, X+ 2dcb4: 9c 91 ld r25, X 2dcb6: 60 ed ldi r22, 0xD0 ; 208 2dcb8: 72 e0 ldi r23, 0x02 ; 2 2dcba: 0f 94 a0 dc call 0x3b940 ; 0x3b940 <__udivmodhi4> 2dcbe: 9c 8f std Y+28, r25 ; 0x1c 2dcc0: 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); 2dcc2: 9f 93 push r25 2dcc4: 8f 93 push r24 2dcc6: 3f 92 push r3 2dcc8: 2f 93 push r18 2dcca: 1f 92 push r1 2dccc: 84 e6 ldi r24, 0x64 ; 100 2dcce: 8f 93 push r24 2dcd0: 9f 92 push r9 2dcd2: 8f 92 push r8 2dcd4: bf 92 push r11 2dcd6: af 92 push r10 2dcd8: df 92 push r13 2dcda: cf 92 push r12 2dcdc: 8d e6 ldi r24, 0x6D ; 109 2dcde: 96 ea ldi r25, 0xA6 ; 166 2dce0: 9f 93 push r25 2dce2: 8f 93 push r24 2dce4: 0f 94 99 da call 0x3b532 ; 0x3b532 2dce8: 0f b6 in r0, 0x3f ; 63 2dcea: f8 94 cli 2dcec: de bf out 0x3e, r29 ; 62 2dcee: 0f be out 0x3f, r0 ; 63 2dcf0: 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; 2dcf2: 22 27 eor r18, r18 2dcf4: 33 27 eor r19, r19 2dcf6: 22 19 sub r18, r2 2dcf8: 33 09 sbc r19, r3 2dcfa: 3a 8f std Y+26, r19 ; 0x1a 2dcfc: 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)); 2dcfe: c4 01 movw r24, r8 2dd00: 99 0c add r9, r9 2dd02: aa 0b sbc r26, r26 2dd04: bb 0b sbc r27, r27 2dd06: 89 87 std Y+9, r24 ; 0x09 2dd08: 9a 87 std Y+10, r25 ; 0x0a 2dd0a: ab 87 std Y+11, r26 ; 0x0b 2dd0c: 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)); 2dd0e: 95 01 movw r18, r10 2dd10: bb 0c add r11, r11 2dd12: 44 0b sbc r20, r20 2dd14: 55 0b sbc r21, r21 2dd16: 29 8b std Y+17, r18 ; 0x11 2dd18: 3a 8b std Y+18, r19 ; 0x12 2dd1a: 4b 8b std Y+19, r20 ; 0x13 2dd1c: 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)); 2dd1e: c6 01 movw r24, r12 2dd20: dd 0c add r13, r13 2dd22: aa 0b sbc r26, r26 2dd24: bb 0b sbc r27, r27 2dd26: 8d 8b std Y+21, r24 ; 0x15 2dd28: 9e 8b std Y+22, r25 ; 0x16 2dd2a: af 8b std Y+23, r26 ; 0x17 2dd2c: b8 8f std Y+24, r27 ; 0x18 // snprintf(text, 10, "%4d", z0); // lcd_print(text); for (; ad < 720; ad++) { if (radius > 0) 2dd2e: 12 14 cp r1, r2 2dd30: 13 04 cpc r1, r3 2dd32: 0c f0 brlt .+2 ; 0x2dd36 2dd34: ba c0 rjmp .+372 ; 0x2deaa { dad = dad_max - (ad / k); 2dd36: 8b 8d ldd r24, Y+27 ; 0x1b 2dd38: 9c 8d ldd r25, Y+28 ; 0x1c 2dd3a: 6c e3 ldi r22, 0x3C ; 60 2dd3c: 70 e0 ldi r23, 0x00 ; 0 2dd3e: 0f 94 a0 dc call 0x3b940 ; 0x3b940 <__udivmodhi4> 2dd42: 10 e1 ldi r17, 0x10 ; 16 2dd44: 16 1b sub r17, r22 r = (float)(((uint32_t)ad) * radius) / 720; 2dd46: 2b 8d ldd r18, Y+27 ; 0x1b 2dd48: 3c 8d ldd r19, Y+28 ; 0x1c 2dd4a: d1 01 movw r26, r2 } else { dad = dad_max - ((719 - ad) / k); r = (float)(((uint32_t)(719 - ad)) * (-radius)) / 720; 2dd4c: 0f 94 f7 dc call 0x3b9ee ; 0x3b9ee <__usmulhisi3> 2dd50: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 2dd54: 20 e0 ldi r18, 0x00 ; 0 2dd56: 30 e0 ldi r19, 0x00 ; 0 2dd58: 44 e3 ldi r20, 0x34 ; 52 2dd5a: 54 e4 ldi r21, 0x44 ; 68 2dd5c: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 2dd60: 6b 01 movw r12, r22 2dd62: 7c 01 movw r14, r24 } ar = radians(ad + rotation); 2dd64: 6f 81 ldd r22, Y+7 ; 0x07 2dd66: 78 85 ldd r23, Y+8 ; 0x08 2dd68: eb 8d ldd r30, Y+27 ; 0x1b 2dd6a: fc 8d ldd r31, Y+28 ; 0x1c 2dd6c: 6e 0f add r22, r30 2dd6e: 7f 1f adc r23, r31 2dd70: 90 e0 ldi r25, 0x00 ; 0 2dd72: 80 e0 ldi r24, 0x00 ; 0 2dd74: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 2dd78: 25 e3 ldi r18, 0x35 ; 53 2dd7a: 3a ef ldi r19, 0xFA ; 250 2dd7c: 4e e8 ldi r20, 0x8E ; 142 2dd7e: 5c e3 ldi r21, 0x3C ; 60 2dd80: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 2dd84: 4b 01 movw r8, r22 2dd86: 5c 01 movw r10, r24 int x = (int)(cx + (cos(ar) * r)); 2dd88: 0f 94 f9 dd call 0x3bbf2 ; 0x3bbf2 2dd8c: 6b 83 std Y+3, r22 ; 0x03 2dd8e: 7c 83 std Y+4, r23 ; 0x04 2dd90: 8d 83 std Y+5, r24 ; 0x05 2dd92: 9e 83 std Y+6, r25 ; 0x06 int y = (int)(cy + (sin(ar) * r)); 2dd94: c5 01 movw r24, r10 2dd96: b4 01 movw r22, r8 2dd98: 0f 94 bf e0 call 0x3c17e ; 0x3c17e 2dd9c: 2b 01 movw r4, r22 2dd9e: 3c 01 movw r6, r24 int z = (int)(z0 - ((float)((int32_t)dz * ad) / 720)); 2dda0: 69 85 ldd r22, Y+9 ; 0x09 2dda2: 7a 85 ldd r23, Y+10 ; 0x0a 2dda4: 8b 85 ldd r24, Y+11 ; 0x0b 2dda6: 9c 85 ldd r25, Y+12 ; 0x0c 2dda8: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 2ddac: 4b 01 movw r8, r22 2ddae: 5c 01 movw r10, r24 2ddb0: 2b 8d ldd r18, Y+27 ; 0x1b 2ddb2: 3c 8d ldd r19, Y+28 ; 0x1c 2ddb4: a4 e6 ldi r26, 0x64 ; 100 2ddb6: b0 e0 ldi r27, 0x00 ; 0 2ddb8: 0f 94 77 dc call 0x3b8ee ; 0x3b8ee <__umulhisi3> 2ddbc: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 2ddc0: 20 e0 ldi r18, 0x00 ; 0 2ddc2: 30 e0 ldi r19, 0x00 ; 0 2ddc4: 44 e3 ldi r20, 0x34 ; 52 2ddc6: 54 e4 ldi r21, 0x44 ; 68 2ddc8: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 2ddcc: 9b 01 movw r18, r22 2ddce: ac 01 movw r20, r24 2ddd0: c5 01 movw r24, r10 2ddd2: b4 01 movw r22, r8 2ddd4: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 2ddd8: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> 2dddc: 6d 87 std Y+13, r22 ; 0x0d 2ddde: 7e 87 std Y+14, r23 ; 0x0e 2dde0: 8f 87 std Y+15, r24 ; 0x0f 2dde2: 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)); 2dde4: 69 89 ldd r22, Y+17 ; 0x11 2dde6: 7a 89 ldd r23, Y+18 ; 0x12 2dde8: 8b 89 ldd r24, Y+19 ; 0x13 2ddea: 9c 89 ldd r25, Y+20 ; 0x14 2ddec: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 2ddf0: 4b 01 movw r8, r22 2ddf2: 5c 01 movw r10, r24 2ddf4: a3 01 movw r20, r6 2ddf6: 92 01 movw r18, r4 2ddf8: c7 01 movw r24, r14 2ddfa: b6 01 movw r22, r12 2ddfc: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 2de00: 9b 01 movw r18, r22 2de02: ac 01 movw r20, r24 2de04: c5 01 movw r24, r10 2de06: b4 01 movw r22, r8 2de08: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 2de0c: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> 2de10: 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)); 2de12: 6d 89 ldd r22, Y+21 ; 0x15 2de14: 7e 89 ldd r23, Y+22 ; 0x16 2de16: 8f 89 ldd r24, Y+23 ; 0x17 2de18: 98 8d ldd r25, Y+24 ; 0x18 2de1a: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 2de1e: 2b 01 movw r4, r22 2de20: 3c 01 movw r6, r24 2de22: a7 01 movw r20, r14 2de24: 96 01 movw r18, r12 2de26: 6b 81 ldd r22, Y+3 ; 0x03 2de28: 7c 81 ldd r23, Y+4 ; 0x04 2de2a: 8d 81 ldd r24, Y+5 ; 0x05 2de2c: 9e 81 ldd r25, Y+6 ; 0x06 2de2e: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 2de32: 9b 01 movw r18, r22 2de34: ac 01 movw r20, r24 2de36: c3 01 movw r24, r6 2de38: b2 01 movw r22, r4 2de3a: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 2de3e: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> 2de42: 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)) 2de44: 01 e0 ldi r16, 0x01 ; 1 2de46: 20 e4 ldi r18, 0x40 ; 64 2de48: 31 e0 ldi r19, 0x01 ; 1 2de4a: 4d 85 ldd r20, Y+13 ; 0x0d 2de4c: 5e 85 ldd r21, Y+14 ; 0x0e 2de4e: b4 01 movw r22, r8 2de50: 0e 94 50 eb call 0x1d6a0 ; 0x1d6a0 2de54: 21 2f mov r18, r17 2de56: 30 e0 ldi r19, 0x00 ; 0 2de58: 88 23 and r24, r24 2de5a: b9 f1 breq .+110 ; 0x2deca 2de5c: 4b 8d ldd r20, Y+27 ; 0x1b 2de5e: 5c 8d ldd r21, Y+28 ; 0x1c 2de60: 42 0f add r20, r18 2de62: 53 1f adc r21, r19 { ad += dad + 1; 2de64: 4f 5f subi r20, 0xFF ; 255 2de66: 5f 4f sbci r21, 0xFF ; 255 2de68: 5c 8f std Y+28, r21 ; 0x1c 2de6a: 4b 8f std Y+27, r20 ; 0x1b ret = true; break; } ad += dad; } if (pad) *pad = ad; 2de6c: eb 8d ldd r30, Y+27 ; 0x1b 2de6e: fc 8d ldd r31, Y+28 ; 0x1c 2de70: a9 81 ldd r26, Y+1 ; 0x01 2de72: ba 81 ldd r27, Y+2 ; 0x02 2de74: ed 93 st X+, r30 2de76: fc 93 st X, r31 // if(ret){ // lcd_set_cursor(0, 4); // lcd_print(" "); // } return ret; } 2de78: 6c 96 adiw r28, 0x1c ; 28 2de7a: 0f b6 in r0, 0x3f ; 63 2de7c: f8 94 cli 2de7e: de bf out 0x3e, r29 ; 62 2de80: 0f be out 0x3f, r0 ; 63 2de82: cd bf out 0x3d, r28 ; 61 2de84: df 91 pop r29 2de86: cf 91 pop r28 2de88: 1f 91 pop r17 2de8a: 0f 91 pop r16 2de8c: ff 90 pop r15 2de8e: ef 90 pop r14 2de90: df 90 pop r13 2de92: cf 90 pop r12 2de94: bf 90 pop r11 2de96: af 90 pop r10 2de98: 9f 90 pop r9 2de9a: 8f 90 pop r8 2de9c: 7f 90 pop r7 2de9e: 6f 90 pop r6 2dea0: 5f 90 pop r5 2dea2: 4f 90 pop r4 2dea4: 3f 90 pop r3 2dea6: 2f 90 pop r2 2dea8: 08 95 ret dad = dad_max - (ad / k); r = (float)(((uint32_t)ad) * radius) / 720; } else { dad = dad_max - ((719 - ad) / k); 2deaa: 2f ec ldi r18, 0xCF ; 207 2deac: 32 e0 ldi r19, 0x02 ; 2 2deae: ab 8d ldd r26, Y+27 ; 0x1b 2deb0: bc 8d ldd r27, Y+28 ; 0x1c 2deb2: 2a 1b sub r18, r26 2deb4: 3b 0b sbc r19, r27 2deb6: c9 01 movw r24, r18 2deb8: 6c e3 ldi r22, 0x3C ; 60 2deba: 70 e0 ldi r23, 0x00 ; 0 2debc: 0f 94 a0 dc call 0x3b940 ; 0x3b940 <__udivmodhi4> 2dec0: 10 e1 ldi r17, 0x10 ; 16 2dec2: 16 1b sub r17, r22 r = (float)(((uint32_t)(719 - ad)) * (-radius)) / 720; 2dec4: a9 8d ldd r26, Y+25 ; 0x19 2dec6: ba 8d ldd r27, Y+26 ; 0x1a 2dec8: 41 cf rjmp .-382 ; 0x2dd4c // lcd_set_cursor(0, 4); // char text[10]; // snprintf(text, 10, "%4d", z0); // lcd_print(text); for (; ad < 720; ad++) 2deca: 2f 5f subi r18, 0xFF ; 255 2decc: 3f 4f sbci r19, 0xFF ; 255 2dece: ab 8d ldd r26, Y+27 ; 0x1b 2ded0: bc 8d ldd r27, Y+28 ; 0x1c 2ded2: a2 0f add r26, r18 2ded4: b3 1f adc r27, r19 2ded6: bc 8f std Y+28, r27 ; 0x1c 2ded8: ab 8f std Y+27, r26 ; 0x1b 2deda: a0 3d cpi r26, 0xD0 ; 208 2dedc: b2 40 sbci r27, 0x02 ; 2 2dede: 08 f4 brcc .+2 ; 0x2dee2 2dee0: 26 cf rjmp .-436 ; 0x2dd2e 2dee2: c4 cf rjmp .-120 ; 0x2de6c 0002dee4 : 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){ 2dee4: 2f 92 push r2 2dee6: 3f 92 push r3 2dee8: 4f 92 push r4 2deea: 5f 92 push r5 2deec: 6f 92 push r6 2deee: 7f 92 push r7 2def0: 8f 92 push r8 2def2: 9f 92 push r9 2def4: af 92 push r10 2def6: bf 92 push r11 2def8: cf 92 push r12 2defa: df 92 push r13 2defc: ef 92 push r14 2defe: ff 92 push r15 2df00: 0f 93 push r16 2df02: 1f 93 push r17 2df04: cf 93 push r28 2df06: df 93 push r29 2df08: cd b7 in r28, 0x3d ; 61 2df0a: de b7 in r29, 0x3e ; 62 2df0c: ca 55 subi r28, 0x5A ; 90 2df0e: d1 09 sbc r29, r1 2df10: 0f b6 in r0, 0x3f ; 63 2df12: f8 94 cli 2df14: de bf out 0x3e, r29 ; 62 2df16: 0f be out 0x3f, r0 ; 63 2df18: cd bf out 0x3d, r28 ; 61 2df1a: 63 96 adiw r28, 0x13 ; 19 2df1c: 9f af std Y+63, r25 ; 0x3f 2df1e: 8e af std Y+62, r24 ; 0x3e 2df20: 63 97 sbiw r28, 0x13 ; 19 2df22: 8b 01 movw r16, r22 2df24: 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 2df26: 7e 01 movw r14, r28 2df28: 25 e4 ldi r18, 0x45 ; 69 2df2a: e2 0e add r14, r18 2df2c: f1 1c adc r15, r1 2df2e: 80 e1 ldi r24, 0x10 ; 16 2df30: 97 e2 ldi r25, 0x27 ; 39 2df32: f7 01 movw r30, r14 2df34: 91 83 std Z+1, r25 ; 0x01 2df36: 80 83 st Z, r24 int16_t start_z; uint16_t steps_to_go; DBG(_n("Scan countdown: ")); 2df38: 8a eb ldi r24, 0xBA ; 186 2df3a: 96 ea ldi r25, 0xA6 ; 166 2df3c: 9f 93 push r25 2df3e: 8f 93 push r24 2df40: 0f 94 99 da call 0x3b532 ; 0x3b532 2df44: 24 ec ldi r18, 0xC4 ; 196 2df46: 36 e0 ldi r19, 0x06 ; 6 2df48: 61 96 adiw r28, 0x11 ; 17 2df4a: 3f af std Y+63, r19 ; 0x3f 2df4c: 2e af std Y+62, r18 ; 0x3e 2df4e: 61 97 sbiw r28, 0x11 ; 17 2df50: c8 01 movw r24, r16 2df52: 80 5e subi r24, 0xE0 ; 224 2df54: 93 40 sbci r25, 0x03 ; 3 2df56: 2b 96 adiw r28, 0x0b ; 11 2df58: 9f af std Y+63, r25 ; 0x3f 2df5a: 8e af std Y+62, r24 ; 0x3e 2df5c: 2b 97 sbiw r28, 0x0b ; 11 2df5e: 0f 90 pop r0 2df60: 0f 90 pop r0 2df62: e0 e4 ldi r30, 0x40 ; 64 2df64: f0 e0 ldi r31, 0x00 ; 0 2df66: 29 96 adiw r28, 0x09 ; 9 2df68: ff af std Y+63, r31 ; 0x3f 2df6a: ee af std Y+62, r30 ; 0x3e 2df6c: 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); 2df6e: 63 96 adiw r28, 0x13 ; 19 2df70: 2e ad ldd r18, Y+62 ; 0x3e 2df72: 3f ad ldd r19, Y+63 ; 0x3f 2df74: 63 97 sbiw r28, 0x13 ; 19 2df76: 20 5e subi r18, 0xE0 ; 224 2df78: 33 40 sbci r19, 0x03 ; 3 2df7a: 69 96 adiw r28, 0x19 ; 25 2df7c: 3f af std Y+63, r19 ; 0x3f 2df7e: 2e af std Y+62, r18 ; 0x3e 2df80: 69 97 sbiw r28, 0x19 ; 25 2df82: 29 96 adiw r28, 0x09 ; 9 2df84: 4e ac ldd r4, Y+62 ; 0x3e 2df86: 5f ac ldd r5, Y+63 ; 0x3f 2df88: 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){ 2df8a: 31 2c mov r3, r1 go_manhattan((d & 1) ? (cx + 992) : (cx - 992), cy - 992 + r * 64, _Z, Z_ACCEL, Z_MIN_DELAY); 2df8c: 63 96 adiw r28, 0x13 ; 19 2df8e: 8e ad ldd r24, Y+62 ; 0x3e 2df90: 9f ad ldd r25, Y+63 ; 0x3f 2df92: 63 97 sbiw r28, 0x13 ; 19 2df94: 80 52 subi r24, 0x20 ; 32 2df96: 9c 4f sbci r25, 0xFC ; 252 2df98: 6b 96 adiw r28, 0x1b ; 27 2df9a: 9f af std Y+63, r25 ; 0x3f 2df9c: 8e af std Y+62, r24 ; 0x3e 2df9e: 6b 97 sbiw r28, 0x1b ; 27 2dfa0: 60 90 ba 06 lds r6, 0x06BA ; 0x8006ba 2dfa4: 70 90 bb 06 lds r7, 0x06BB ; 0x8006bb 2dfa8: 80 90 bc 06 lds r8, 0x06BC ; 0x8006bc 2dfac: 90 90 bd 06 lds r9, 0x06BD ; 0x8006bd 2dfb0: 6b 96 adiw r28, 0x1b ; 27 2dfb2: ae ac ldd r10, Y+62 ; 0x3e 2dfb4: bf ac ldd r11, Y+63 ; 0x3f 2dfb6: 6b 97 sbiw r28, 0x1b ; 27 2dfb8: 31 10 cpse r3, r1 2dfba: 04 c0 rjmp .+8 ; 0x2dfc4 2dfbc: 69 96 adiw r28, 0x19 ; 25 2dfbe: ae ac ldd r10, Y+62 ; 0x3e 2dfc0: bf ac ldd r11, Y+63 ; 0x3f 2dfc2: 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; 2dfc4: 80 91 b2 06 lds r24, 0x06B2 ; 0x8006b2 2dfc8: 90 91 b3 06 lds r25, 0x06B3 ; 0x8006b3 2dfcc: a0 91 b4 06 lds r26, 0x06B4 ; 0x8006b4 2dfd0: b0 91 b5 06 lds r27, 0x06B5 ; 0x8006b5 2dfd4: f5 01 movw r30, r10 2dfd6: e8 1b sub r30, r24 2dfd8: f9 0b sbc r31, r25 2dfda: 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) 2dfdc: 71 f0 breq .+28 ; 0x2dffa 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)); 2dfde: af 01 movw r20, r30 2dfe0: f7 ff sbrs r31, 7 2dfe2: 04 c0 rjmp .+8 ; 0x2dfec 2dfe4: 44 27 eor r20, r20 2dfe6: 55 27 eor r21, r21 2dfe8: 4e 1b sub r20, r30 2dfea: 5f 0b sbc r21, r31 2dfec: 69 2f mov r22, r25 2dfee: 66 1f adc r22, r22 2dff0: 66 27 eor r22, r22 2dff2: 66 1f adc r22, r22 2dff4: 81 e0 ldi r24, 0x01 ; 1 2dff6: 0f 94 01 6e call 0x2dc02 ; 0x2dc02 // DBG(_n("y %d -> %d, "), y, _Y); length = y - _Y; 2dffa: 80 91 b6 06 lds r24, 0x06B6 ; 0x8006b6 2dffe: 90 91 b7 06 lds r25, 0x06B7 ; 0x8006b7 2e002: a0 91 b8 06 lds r26, 0x06B8 ; 0x8006b8 2e006: b0 91 b9 06 lds r27, 0x06B9 ; 0x8006b9 2e00a: 2b 96 adiw r28, 0x0b ; 11 2e00c: 4e ad ldd r20, Y+62 ; 0x3e 2e00e: 5f ad ldd r21, Y+63 ; 0x3f 2e010: 2b 97 sbiw r28, 0x0b ; 11 2e012: 48 1b sub r20, r24 2e014: 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)); 2e016: 57 fd sbrc r21, 7 2e018: b2 c0 rjmp .+356 ; 0x2e17e 2e01a: 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) 2e01c: 41 15 cp r20, r1 2e01e: 51 05 cpc r21, r1 2e020: 09 f0 breq .+2 ; 0x2e024 2e022: ae c0 rjmp .+348 ; 0x2e180 // 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; 2e024: 80 91 ba 06 lds r24, 0x06BA ; 0x8006ba 2e028: 90 91 bb 06 lds r25, 0x06BB ; 0x8006bb 2e02c: a0 91 bc 06 lds r26, 0x06BC ; 0x8006bc 2e030: b0 91 bd 06 lds r27, 0x06BD ; 0x8006bd 2e034: 68 1a sub r6, r24 2e036: 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)); 2e038: 77 fc sbrc r7, 7 2e03a: ab c0 rjmp .+342 ; 0x2e192 2e03c: 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) 2e03e: 61 14 cp r6, r1 2e040: 71 04 cpc r7, r1 2e042: 09 f0 breq .+2 ; 0x2e046 2e044: a7 c0 rjmp .+334 ; 0x2e194 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); 2e046: 40 91 ba 06 lds r20, 0x06BA ; 0x8006ba 2e04a: 50 91 bb 06 lds r21, 0x06BB ; 0x8006bb 2e04e: 60 91 bc 06 lds r22, 0x06BC ; 0x8006bc 2e052: 70 91 bd 06 lds r23, 0x06BD ; 0x8006bd 2e056: 00 e0 ldi r16, 0x00 ; 0 2e058: 28 ec ldi r18, 0xC8 ; 200 2e05a: 30 e0 ldi r19, 0x00 ; 0 2e05c: 2b 96 adiw r28, 0x0b ; 11 2e05e: 6e ad ldd r22, Y+62 ; 0x3e 2e060: 7f ad ldd r23, Y+63 ; 0x3f 2e062: 2b 97 sbiw r28, 0x0b ; 11 2e064: c5 01 movw r24, r10 2e066: 0e 94 50 eb call 0x1d6a0 ; 0x1d6a0 sm4_set_dir(X_AXIS, d); 2e06a: 63 2d mov r22, r3 2e06c: 80 e0 ldi r24, 0x00 ; 0 2e06e: 0f 94 d7 51 call 0x2a3ae ; 0x2a3ae //@size=242 DBG(_n("%d\n"), 64 - (r * 2 + d)); ///< to keep host connection alive 2e072: 5f 92 push r5 2e074: 4f 92 push r4 2e076: 86 eb ldi r24, 0xB6 ; 182 2e078: 96 ea ldi r25, 0xA6 ; 166 2e07a: 9f 93 push r25 2e07c: 8f 93 push r24 2e07e: 0f 94 99 da call 0x3b532 ; 0x3b532 lcd_set_cursor(4,3); 2e082: 63 e0 ldi r22, 0x03 ; 3 2e084: 84 e0 ldi r24, 0x04 ; 4 2e086: 0e 94 f8 6e call 0xddf0 ; 0xddf0 lcd_printf_P(PSTR("Countdown: %d "),64 - (r * 2 + d)); ////MSG_COUNTDOWN c=12 2e08a: 5f 92 push r5 2e08c: 4f 92 push r4 2e08e: 87 ea ldi r24, 0xA7 ; 167 2e090: 96 ea ldi r25, 0xA6 ; 166 2e092: 9f 93 push r25 2e094: 8f 93 push r24 2e096: 0e 94 d1 6e call 0xdda2 ; 0xdda2 2e09a: 0f b6 in r0, 0x3f ; 63 2e09c: f8 94 cli 2e09e: de bf out 0x3e, r29 ; 62 2e0a0: 0f be out 0x3f, r0 ; 63 2e0a2: cd bf out 0x3d, r28 ; 61 2e0a4: 21 e0 ldi r18, 0x01 ; 1 2e0a6: 30 e0 ldi r19, 0x00 ; 0 2e0a8: 31 10 cpse r3, r1 2e0aa: 02 c0 rjmp .+4 ; 0x2e0b0 2e0ac: 2f ef ldi r18, 0xFF ; 255 2e0ae: 3f ef ldi r19, 0xFF ; 255 2e0b0: 40 ec ldi r20, 0xC0 ; 192 2e0b2: 42 03 mulsu r20, r18 2e0b4: c0 01 movw r24, r0 2e0b6: 43 9f mul r20, r19 2e0b8: 90 0d add r25, r0 2e0ba: 11 24 eor r1, r1 2e0bc: 67 96 adiw r28, 0x17 ; 23 2e0be: 9f af std Y+63, r25 ; 0x3f 2e0c0: 8e af std Y+62, r24 ; 0x3e 2e0c2: 67 97 sbiw r28, 0x17 ; 23 2e0c4: 40 ee ldi r20, 0xE0 ; 224 2e0c6: 53 e0 ldi r21, 0x03 ; 3 2e0c8: 24 9f mul r18, r20 2e0ca: 40 01 movw r8, r0 2e0cc: 25 9f mul r18, r21 2e0ce: 90 0c add r9, r0 2e0d0: 34 9f mul r19, r20 2e0d2: 90 0c add r9, r0 2e0d4: 11 24 eor r1, r1 2e0d6: 63 96 adiw r28, 0x13 ; 19 2e0d8: ee ad ldd r30, Y+62 ; 0x3e 2e0da: ff ad ldd r31, Y+63 ; 0x3f 2e0dc: 63 97 sbiw r28, 0x13 ; 19 2e0de: 8e 0e add r8, r30 2e0e0: 9f 1e adc r9, r31 2e0e2: 9e 01 movw r18, r28 2e0e4: 2f 5f subi r18, 0xFF ; 255 2e0e6: 3f 4f sbci r19, 0xFF ; 255 2e0e8: 2d 96 adiw r28, 0x0d ; 13 2e0ea: 3f af std Y+63, r19 ; 0x3f 2e0ec: 2e af std Y+62, r18 ; 0x3e 2e0ee: 2d 97 sbiw r28, 0x0d ; 13 2e0f0: 61 96 adiw r28, 0x11 ; 17 2e0f2: 8e ad ldd r24, Y+62 ; 0x3e 2e0f4: 9f ad ldd r25, Y+63 ; 0x3f 2e0f6: 61 97 sbiw r28, 0x11 ; 17 2e0f8: 2f 96 adiw r28, 0x0f ; 15 2e0fa: 9f af std Y+63, r25 ; 0x3f 2e0fc: 8e af std Y+62, r24 ; 0x3e 2e0fe: 2f 97 sbiw r28, 0x0f ; 15 2e100: 71 2c mov r7, r1 2e102: 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; 2e104: e0 e1 ldi r30, 0x10 ; 16 2e106: f7 e2 ldi r31, 0x27 ; 39 2e108: 27 96 adiw r28, 0x07 ; 7 2e10a: ff af std Y+63, r31 ; 0x3f 2e10c: ee af std Y+62, r30 ; 0x3e 2e10e: 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); 2e110: 80 91 b2 06 lds r24, 0x06B2 ; 0x8006b2 2e114: 90 91 b3 06 lds r25, 0x06B3 ; 0x8006b3 2e118: a0 91 b4 06 lds r26, 0x06B4 ; 0x8006b4 2e11c: b0 91 b5 06 lds r27, 0x06B5 ; 0x8006b5 2e120: 84 01 movw r16, r8 2e122: 08 1b sub r16, r24 2e124: 19 0b sbc r17, r25 2e126: 17 ff sbrs r17, 7 2e128: 03 c0 rjmp .+6 ; 0x2e130 2e12a: 11 95 neg r17 2e12c: 01 95 neg r16 2e12e: 11 09 sbc r17, r1 const int16_t half_x = length_x / 2; 2e130: 98 01 movw r18, r16 2e132: 35 95 asr r19 2e134: 27 95 ror r18 2e136: 65 96 adiw r28, 0x15 ; 21 2e138: 3f af std Y+63, r19 ; 0x3f 2e13a: 2e af std Y+62, r18 ; 0x3e 2e13c: 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; 2e13e: 1c 9b sbis 0x03, 4 ; 3 2e140: 33 c0 rjmp .+102 ; 0x2e1a8 2e142: 45 e0 ldi r20, 0x05 ; 5 2e144: 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); 2e146: 65 96 adiw r28, 0x15 ; 21 2e148: ae ac ldd r10, Y+62 ; 0x3e 2e14a: bf ac ldd r11, Y+63 ; 0x3f 2e14c: 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); 2e14e: 63 2d mov r22, r3 2e150: 82 2d mov r24, r2 2e152: 0e 94 f7 ea call 0x1d5ee ; 0x1d5ee while (steps--){ 2e156: 31 e0 ldi r19, 0x01 ; 1 2e158: a3 1a sub r10, r19 2e15a: b1 08 sbc r11, r1 2e15c: 40 f1 brcs .+80 ; 0x2e1ae accelerate_1_step(axes, acc, delay_us, min_delay_us); 2e15e: 28 ec ldi r18, 0xC8 ; 200 2e160: 30 e0 ldi r19, 0x00 ; 0 2e162: a7 01 movw r20, r14 2e164: 68 ee ldi r22, 0xE8 ; 232 2e166: 73 e0 ldi r23, 0x03 ; 3 2e168: 82 2d mov r24, r2 2e16a: 0e 94 c8 e9 call 0x1d390 ; 0x1d390 update_position_1_step(axes, dir); 2e16e: 63 2d mov r22, r3 2e170: 82 2d mov r24, r2 2e172: 0e 94 10 eb call 0x1d620 ; 0x1d620 2e176: ef cf rjmp .-34 ; 0x2e156 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){ 2e178: 33 24 eor r3, r3 2e17a: 33 94 inc r3 2e17c: 11 cf rjmp .-478 ; 0x2dfa0 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)); 2e17e: 62 e0 ldi r22, 0x02 ; 2 2e180: 57 ff sbrs r21, 7 2e182: 03 c0 rjmp .+6 ; 0x2e18a 2e184: 51 95 neg r21 2e186: 41 95 neg r20 2e188: 51 09 sbc r21, r1 2e18a: 82 e0 ldi r24, 0x02 ; 2 2e18c: 0f 94 01 6e call 0x2dc02 ; 0x2dc02 2e190: 49 cf rjmp .-366 ; 0x2e024 // 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)); 2e192: 64 e0 ldi r22, 0x04 ; 4 2e194: a3 01 movw r20, r6 2e196: 77 fe sbrs r7, 7 2e198: 03 c0 rjmp .+6 ; 0x2e1a0 2e19a: 51 95 neg r21 2e19c: 41 95 neg r20 2e19e: 51 09 sbc r21, r1 2e1a0: 84 e0 ldi r24, 0x04 ; 4 2e1a2: 0f 94 01 6e call 0x2dc02 ; 0x2dc02 2e1a6: 4f cf rjmp .-354 ; 0x2e046 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; 2e1a8: 22 24 eor r2, r2 2e1aa: 23 94 inc r2 2e1ac: cc cf rjmp .-104 ; 0x2e146 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); 2e1ae: 65 96 adiw r28, 0x15 ; 21 2e1b0: ee ad ldd r30, Y+62 ; 0x3e 2e1b2: ff ad ldd r31, Y+63 ; 0x3f 2e1b4: 65 97 sbiw r28, 0x15 ; 21 2e1b6: 0e 1b sub r16, r30 2e1b8: 1f 0b sbc r17, r31 2e1ba: 23 96 adiw r28, 0x03 ; 3 2e1bc: 1f af std Y+63, r17 ; 0x3f 2e1be: 0e af std Y+62, r16 ; 0x3e 2e1c0: 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); 2e1c2: 63 2d mov r22, r3 2e1c4: 82 2d mov r24, r2 2e1c6: 0e 94 f7 ea call 0x1d5ee ; 0x1d5ee while (go_and_stop_1_step(axes, dec, delay_us, steps)){ 2e1ca: 9e 01 movw r18, r28 2e1cc: 2f 5b subi r18, 0xBF ; 191 2e1ce: 3f 4f sbci r19, 0xFF ; 255 2e1d0: a7 01 movw r20, r14 2e1d2: 68 ee ldi r22, 0xE8 ; 232 2e1d4: 73 e0 ldi r23, 0x03 ; 3 2e1d6: 82 2d mov r24, r2 2e1d8: 0e 94 6e ea call 0x1d4dc ; 0x1d4dc 2e1dc: 88 23 and r24, r24 2e1de: 29 f0 breq .+10 ; 0x2e1ea update_position_1_step(axes, dir); 2e1e0: 63 2d mov r22, r3 2e1e2: 82 2d mov r24, r2 2e1e4: 0e 94 10 eb call 0x1d620 ; 0x1d620 2e1e8: f0 cf rjmp .-32 ; 0x2e1ca z_trig = min_z; /// move up to un-trigger (surpress hysteresis) sm4_set_dir(Z_AXIS, Z_PLUS); 2e1ea: 60 e0 ldi r22, 0x00 ; 0 2e1ec: 82 e0 ldi r24, 0x02 ; 2 2e1ee: 0f 94 d7 51 call 0x2a3ae ; 0x2a3ae /// speed up from stop, go half the way current_delay_us = MAX_DELAY; 2e1f2: 20 e1 ldi r18, 0x10 ; 16 2e1f4: 37 e2 ldi r19, 0x27 ; 39 2e1f6: 27 96 adiw r28, 0x07 ; 7 2e1f8: 3f af std Y+63, r19 ; 0x3f 2e1fa: 2e af std Y+62, r18 ; 0x3e 2e1fc: 27 97 sbiw r28, 0x07 ; 7 for (start_z = _Z; _Z < (max_z + start_z) / 2; ++_Z_){ 2e1fe: 00 91 ba 06 lds r16, 0x06BA ; 0x8006ba 2e202: 10 91 bb 06 lds r17, 0x06BB ; 0x8006bb 2e206: 20 91 bc 06 lds r18, 0x06BC ; 0x8006bc 2e20a: 30 91 bd 06 lds r19, 0x06BD ; 0x8006bd 2e20e: 00 5a subi r16, 0xA0 ; 160 2e210: 16 4f sbci r17, 0xF6 ; 246 2e212: 17 ff sbrs r17, 7 2e214: 02 c0 rjmp .+4 ; 0x2e21a 2e216: 0f 5f subi r16, 0xFF ; 255 2e218: 1f 4f sbci r17, 0xFF ; 255 2e21a: 15 95 asr r17 2e21c: 07 95 ror r16 2e21e: 80 91 ba 06 lds r24, 0x06BA ; 0x8006ba 2e222: 90 91 bb 06 lds r25, 0x06BB ; 0x8006bb 2e226: a0 91 bc 06 lds r26, 0x06BC ; 0x8006bc 2e22a: b0 91 bd 06 lds r27, 0x06BD ; 0x8006bd 2e22e: 80 17 cp r24, r16 2e230: 91 07 cpc r25, r17 2e232: f4 f4 brge .+60 ; 0x2e270 if (!_PINDA){ 2e234: 1c 9b sbis 0x03, 4 ; 3 2e236: 1c c0 rjmp .+56 ; 0x2e270 break; } accelerate_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, Z_MIN_DELAY); 2e238: 28 ec ldi r18, 0xC8 ; 200 2e23a: 30 e0 ldi r19, 0x00 ; 0 2e23c: a7 01 movw r20, r14 2e23e: 68 ee ldi r22, 0xE8 ; 232 2e240: 73 e0 ldi r23, 0x03 ; 3 2e242: 84 e0 ldi r24, 0x04 ; 4 2e244: 0e 94 c8 e9 call 0x1d390 ; 0x1d390 /// 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_){ 2e248: 80 91 ba 06 lds r24, 0x06BA ; 0x8006ba 2e24c: 90 91 bb 06 lds r25, 0x06BB ; 0x8006bb 2e250: a0 91 bc 06 lds r26, 0x06BC ; 0x8006bc 2e254: b0 91 bd 06 lds r27, 0x06BD ; 0x8006bd 2e258: 01 96 adiw r24, 0x01 ; 1 2e25a: a1 1d adc r26, r1 2e25c: b1 1d adc r27, r1 2e25e: 80 93 ba 06 sts 0x06BA, r24 ; 0x8006ba 2e262: 90 93 bb 06 sts 0x06BB, r25 ; 0x8006bb 2e266: a0 93 bc 06 sts 0x06BC, r26 ; 0x8006bc 2e26a: b0 93 bd 06 sts 0x06BD, r27 ; 0x8006bd 2e26e: d7 cf rjmp .-82 ; 0x2e21e break; } accelerate_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, Z_MIN_DELAY); } if (_PINDA){ 2e270: 1c 9b sbis 0x03, 4 ; 3 2e272: 3f c0 rjmp .+126 ; 0x2e2f2 steps_to_go = MAX(0, max_z - _Z); 2e274: 80 91 ba 06 lds r24, 0x06BA ; 0x8006ba 2e278: 90 91 bb 06 lds r25, 0x06BB ; 0x8006bb 2e27c: a0 91 bc 06 lds r26, 0x06BC ; 0x8006bc 2e280: b0 91 bd 06 lds r27, 0x06BD ; 0x8006bd 2e284: e0 e6 ldi r30, 0x60 ; 96 2e286: f9 e0 ldi r31, 0x09 ; 9 2e288: e8 1b sub r30, r24 2e28a: f9 0b sbc r31, r25 2e28c: cf 01 movw r24, r30 2e28e: f7 ff sbrs r31, 7 2e290: 02 c0 rjmp .+4 ; 0x2e296 2e292: 90 e0 ldi r25, 0x00 ; 0 2e294: 80 e0 ldi r24, 0x00 ; 0 2e296: 25 96 adiw r28, 0x05 ; 5 2e298: 9f af std Y+63, r25 ; 0x3f 2e29a: 8e af std Y+62, r24 ; 0x3e 2e29c: 25 97 sbiw r28, 0x05 ; 5 while (_PINDA && _Z < max_z){ 2e29e: 1c 9b sbis 0x03, 4 ; 3 2e2a0: 28 c0 rjmp .+80 ; 0x2e2f2 2e2a2: 80 91 ba 06 lds r24, 0x06BA ; 0x8006ba 2e2a6: 90 91 bb 06 lds r25, 0x06BB ; 0x8006bb 2e2aa: a0 91 bc 06 lds r26, 0x06BC ; 0x8006bc 2e2ae: b0 91 bd 06 lds r27, 0x06BD ; 0x8006bd 2e2b2: 80 36 cpi r24, 0x60 ; 96 2e2b4: 99 40 sbci r25, 0x09 ; 9 2e2b6: ec f4 brge .+58 ; 0x2e2f2 go_and_stop_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, steps_to_go); 2e2b8: 9e 01 movw r18, r28 2e2ba: 2d 5b subi r18, 0xBD ; 189 2e2bc: 3f 4f sbci r19, 0xFF ; 255 2e2be: a7 01 movw r20, r14 2e2c0: 68 ee ldi r22, 0xE8 ; 232 2e2c2: 73 e0 ldi r23, 0x03 ; 3 2e2c4: 84 e0 ldi r24, 0x04 ; 4 2e2c6: 0e 94 6e ea call 0x1d4dc ; 0x1d4dc ++_Z_; 2e2ca: 80 91 ba 06 lds r24, 0x06BA ; 0x8006ba 2e2ce: 90 91 bb 06 lds r25, 0x06BB ; 0x8006bb 2e2d2: a0 91 bc 06 lds r26, 0x06BC ; 0x8006bc 2e2d6: b0 91 bd 06 lds r27, 0x06BD ; 0x8006bd 2e2da: 01 96 adiw r24, 0x01 ; 1 2e2dc: a1 1d adc r26, r1 2e2de: b1 1d adc r27, r1 2e2e0: 80 93 ba 06 sts 0x06BA, r24 ; 0x8006ba 2e2e4: 90 93 bb 06 sts 0x06BB, r25 ; 0x8006bb 2e2e8: a0 93 bc 06 sts 0x06BC, r26 ; 0x8006bc 2e2ec: b0 93 bd 06 sts 0x06BD, r27 ; 0x8006bd 2e2f0: d6 cf rjmp .-84 ; 0x2e29e /// \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); 2e2f2: 60 e0 ldi r22, 0x00 ; 0 2e2f4: 84 e0 ldi r24, 0x04 ; 4 2e2f6: 0e 94 f7 ea call 0x1d5ee ; 0x1d5ee while (delay_us < MAX_DELAY){ 2e2fa: f7 01 movw r30, r14 2e2fc: 20 81 ld r18, Z 2e2fe: 31 81 ldd r19, Z+1 ; 0x01 2e300: 20 31 cpi r18, 0x10 ; 16 2e302: f7 e2 ldi r31, 0x27 ; 39 2e304: 3f 07 cpc r19, r31 2e306: 58 f4 brcc .+22 ; 0x2e31e accelerate_1_step(axes, -dec, delay_us, delay_us); 2e308: a7 01 movw r20, r14 2e30a: 68 e1 ldi r22, 0x18 ; 24 2e30c: 7c ef ldi r23, 0xFC ; 252 2e30e: 84 e0 ldi r24, 0x04 ; 4 2e310: 0e 94 c8 e9 call 0x1d390 ; 0x1d390 update_position_1_step(axes, dir); 2e314: 60 e0 ldi r22, 0x00 ; 0 2e316: 84 e0 ldi r24, 0x04 ; 4 2e318: 0e 94 10 eb call 0x1d620 ; 0x1d620 2e31c: ee cf rjmp .-36 ; 0x2e2fa } } stop_smoothly(Z_AXIS_MASK, Z_PLUS_MASK, Z_ACCEL, current_delay_us); /// move down to trigger sm4_set_dir(Z_AXIS, Z_MINUS); 2e31e: 61 e0 ldi r22, 0x01 ; 1 2e320: 82 e0 ldi r24, 0x02 ; 2 2e322: 0f 94 d7 51 call 0x2a3ae ; 0x2a3ae /// speed up current_delay_us = MAX_DELAY; 2e326: 20 e1 ldi r18, 0x10 ; 16 2e328: 37 e2 ldi r19, 0x27 ; 39 2e32a: f7 01 movw r30, r14 2e32c: 31 83 std Z+1, r19 ; 0x01 2e32e: 20 83 st Z, r18 for (start_z = _Z; _Z > (min_z + start_z) / 2; --_Z_){ 2e330: 00 91 ba 06 lds r16, 0x06BA ; 0x8006ba 2e334: 10 91 bb 06 lds r17, 0x06BB ; 0x8006bb 2e338: 20 91 bc 06 lds r18, 0x06BC ; 0x8006bc 2e33c: 30 91 bd 06 lds r19, 0x06BD ; 0x8006bd 2e340: 0c 0d add r16, r12 2e342: 1d 1d adc r17, r13 2e344: 17 ff sbrs r17, 7 2e346: 02 c0 rjmp .+4 ; 0x2e34c 2e348: 0f 5f subi r16, 0xFF ; 255 2e34a: 1f 4f sbci r17, 0xFF ; 255 2e34c: 15 95 asr r17 2e34e: 07 95 ror r16 2e350: 80 91 ba 06 lds r24, 0x06BA ; 0x8006ba 2e354: 90 91 bb 06 lds r25, 0x06BB ; 0x8006bb 2e358: a0 91 bc 06 lds r26, 0x06BC ; 0x8006bc 2e35c: b0 91 bd 06 lds r27, 0x06BD ; 0x8006bd 2e360: 08 17 cp r16, r24 2e362: 19 07 cpc r17, r25 2e364: 0c f0 brlt .+2 ; 0x2e368 2e366: d9 c0 rjmp .+434 ; 0x2e51a if (_PINDA){ 2e368: 1c 9b sbis 0x03, 4 ; 3 2e36a: bb c0 rjmp .+374 ; 0x2e4e2 z_trig = _Z; 2e36c: 00 91 ba 06 lds r16, 0x06BA ; 0x8006ba 2e370: 10 91 bb 06 lds r17, 0x06BB ; 0x8006bb 2e374: 20 91 bc 06 lds r18, 0x06BC ; 0x8006bc 2e378: 30 91 bd 06 lds r19, 0x06BD ; 0x8006bd break; } accelerate_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, Z_MIN_DELAY); } /// slow down if (!_PINDA){ 2e37c: 1c 99 sbic 0x03, 4 ; 3 2e37e: 28 c0 rjmp .+80 ; 0x2e3d0 steps_to_go = MAX(0, _Z - min_z); 2e380: 80 91 ba 06 lds r24, 0x06BA ; 0x8006ba 2e384: 90 91 bb 06 lds r25, 0x06BB ; 0x8006bb 2e388: a0 91 bc 06 lds r26, 0x06BC ; 0x8006bc 2e38c: b0 91 bd 06 lds r27, 0x06BD ; 0x8006bd 2e390: 8c 19 sub r24, r12 2e392: 9d 09 sbc r25, r13 2e394: 97 ff sbrs r25, 7 2e396: 02 c0 rjmp .+4 ; 0x2e39c 2e398: 90 e0 ldi r25, 0x00 ; 0 2e39a: 80 e0 ldi r24, 0x00 ; 0 2e39c: 25 96 adiw r28, 0x05 ; 5 2e39e: 9f af std Y+63, r25 ; 0x3f 2e3a0: 8e af std Y+62, r24 ; 0x3e 2e3a2: 25 97 sbiw r28, 0x05 ; 5 while (!_PINDA && _Z > min_z){ 2e3a4: 1c 99 sbic 0x03, 4 ; 3 2e3a6: 0c c0 rjmp .+24 ; 0x2e3c0 2e3a8: 80 91 ba 06 lds r24, 0x06BA ; 0x8006ba 2e3ac: 90 91 bb 06 lds r25, 0x06BB ; 0x8006bb 2e3b0: a0 91 bc 06 lds r26, 0x06BC ; 0x8006bc 2e3b4: b0 91 bd 06 lds r27, 0x06BD ; 0x8006bd 2e3b8: c8 16 cp r12, r24 2e3ba: d9 06 cpc r13, r25 2e3bc: 0c f4 brge .+2 ; 0x2e3c0 2e3be: af c0 rjmp .+350 ; 0x2e51e go_and_stop_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, steps_to_go); --_Z_; } z_trig = _Z; 2e3c0: 00 91 ba 06 lds r16, 0x06BA ; 0x8006ba 2e3c4: 10 91 bb 06 lds r17, 0x06BB ; 0x8006bb 2e3c8: 20 91 bc 06 lds r18, 0x06BC ; 0x8006bc 2e3cc: 30 91 bd 06 lds r19, 0x06BD ; 0x8006bd } /// slow down to stop but not lower than min_z while (_Z > min_z && current_delay_us < MAX_DELAY){ 2e3d0: 80 91 ba 06 lds r24, 0x06BA ; 0x8006ba 2e3d4: 90 91 bb 06 lds r25, 0x06BB ; 0x8006bb 2e3d8: a0 91 bc 06 lds r26, 0x06BC ; 0x8006bc 2e3dc: b0 91 bd 06 lds r27, 0x06BD ; 0x8006bd 2e3e0: c8 16 cp r12, r24 2e3e2: d9 06 cpc r13, r25 2e3e4: 3c f4 brge .+14 ; 0x2e3f4 2e3e6: f7 01 movw r30, r14 2e3e8: 80 81 ld r24, Z 2e3ea: 91 81 ldd r25, Z+1 ; 0x01 2e3ec: 80 31 cpi r24, 0x10 ; 16 2e3ee: 97 42 sbci r25, 0x27 ; 39 2e3f0: 08 f4 brcc .+2 ; 0x2e3f4 2e3f2: b2 c0 rjmp .+356 ; 0x2e558 2e3f4: 0c 19 sub r16, r12 2e3f6: 1d 09 sbc r17, r13 accelerate_1_step(Z_AXIS_MASK, -Z_ACCEL, current_delay_us, Z_MIN_DELAY); --_Z_; } if (d == 0){ 2e3f8: 31 10 cpse r3, r1 2e3fa: ca c0 rjmp .+404 ; 0x2e590 line_buffer[c] = (uint16_t)(z_trig - min_z); 2e3fc: f3 01 movw r30, r6 2e3fe: ee 0f add r30, r30 2e400: ff 1f adc r31, r31 2e402: 21 e0 ldi r18, 0x01 ; 1 2e404: 30 e0 ldi r19, 0x00 ; 0 2e406: 2c 0f add r18, r28 2e408: 3d 1f adc r19, r29 2e40a: e2 0f add r30, r18 2e40c: f3 1f adc r31, r19 2e40e: 11 83 std Z+1, r17 ; 0x01 2e410: 00 83 st Z, r16 2e412: ff ef ldi r31, 0xFF ; 255 2e414: 6f 1a sub r6, r31 2e416: 7f 0a sbc r7, r31 2e418: 67 96 adiw r28, 0x17 ; 23 2e41a: 2e ad ldd r18, Y+62 ; 0x3e 2e41c: 3f ad ldd r19, Y+63 ; 0x3f 2e41e: 67 97 sbiw r28, 0x17 ; 23 2e420: 82 0e add r8, r18 2e422: 93 1e adc r9, r19 2e424: 2d 96 adiw r28, 0x0d ; 13 2e426: 8e ad ldd r24, Y+62 ; 0x3e 2e428: 9f ad ldd r25, Y+63 ; 0x3f 2e42a: 2d 97 sbiw r28, 0x0d ; 13 2e42c: 02 97 sbiw r24, 0x02 ; 2 2e42e: 2d 96 adiw r28, 0x0d ; 13 2e430: 9f af std Y+63, r25 ; 0x3f 2e432: 8e af std Y+62, r24 ; 0x3e 2e434: 2d 97 sbiw r28, 0x0d ; 13 2e436: 2f 96 adiw r28, 0x0f ; 15 2e438: ee ad ldd r30, Y+62 ; 0x3e 2e43a: ff ad ldd r31, Y+63 ; 0x3f 2e43c: 2f 97 sbiw r28, 0x0f ; 15 2e43e: 31 97 sbiw r30, 0x01 ; 1 2e440: 2f 96 adiw r28, 0x0f ; 15 2e442: ff af std Y+63, r31 ; 0x3f 2e444: ee af std Y+62, r30 ; 0x3e 2e446: 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 2e448: f0 e2 ldi r31, 0x20 ; 32 2e44a: 6f 16 cp r6, r31 2e44c: 71 04 cpc r7, r1 2e44e: 09 f0 breq .+2 ; 0x2e452 2e450: 59 ce rjmp .-846 ; 0x2e104 2e452: 21 e0 ldi r18, 0x01 ; 1 2e454: 42 1a sub r4, r18 2e456: 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){ 2e458: 31 e0 ldi r19, 0x01 ; 1 2e45a: 33 12 cpse r3, r19 2e45c: 8d ce rjmp .-742 ; 0x2e178 2e45e: 61 96 adiw r28, 0x11 ; 17 2e460: 8e ad ldd r24, Y+62 ; 0x3e 2e462: 9f ad ldd r25, Y+63 ; 0x3f 2e464: 61 97 sbiw r28, 0x11 ; 17 2e466: 80 96 adiw r24, 0x20 ; 32 2e468: 61 96 adiw r28, 0x11 ; 17 2e46a: 9f af std Y+63, r25 ; 0x3f 2e46c: 8e af std Y+62, r24 ; 0x3e 2e46e: 61 97 sbiw r28, 0x11 ; 17 2e470: 2b 96 adiw r28, 0x0b ; 11 2e472: ee ad ldd r30, Y+62 ; 0x3e 2e474: ff ad ldd r31, Y+63 ; 0x3f 2e476: 2b 97 sbiw r28, 0x0b ; 11 2e478: e0 5c subi r30, 0xC0 ; 192 2e47a: ff 4f sbci r31, 0xFF ; 255 2e47c: 2b 96 adiw r28, 0x0b ; 11 2e47e: ff af std Y+63, r31 ; 0x3f 2e480: ee af std Y+62, r30 ; 0x3e 2e482: 2b 97 sbiw r28, 0x0b ; 11 2e484: 29 96 adiw r28, 0x09 ; 9 2e486: 2e ad ldd r18, Y+62 ; 0x3e 2e488: 3f ad ldd r19, Y+63 ; 0x3f 2e48a: 29 97 sbiw r28, 0x09 ; 9 2e48c: 22 50 subi r18, 0x02 ; 2 2e48e: 31 09 sbc r19, r1 2e490: 29 96 adiw r28, 0x09 ; 9 2e492: 3f af std Y+63, r19 ; 0x3f 2e494: 2e af std Y+62, r18 ; 0x3e 2e496: 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 2e498: 23 2b or r18, r19 2e49a: 09 f0 breq .+2 ; 0x2e49e 2e49c: 72 cd rjmp .-1308 ; 0x2df82 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); 2e49e: 85 ea ldi r24, 0xA5 ; 165 2e4a0: 96 ea ldi r25, 0xA6 ; 166 2e4a2: 9f 93 push r25 2e4a4: 8f 93 push r24 2e4a6: 0f 94 99 da call 0x3b532 ; 0x3b532 2e4aa: 0f 90 pop r0 2e4ac: 0f 90 pop r0 } 2e4ae: c6 5a subi r28, 0xA6 ; 166 2e4b0: df 4f sbci r29, 0xFF ; 255 2e4b2: 0f b6 in r0, 0x3f ; 63 2e4b4: f8 94 cli 2e4b6: de bf out 0x3e, r29 ; 62 2e4b8: 0f be out 0x3f, r0 ; 63 2e4ba: cd bf out 0x3d, r28 ; 61 2e4bc: df 91 pop r29 2e4be: cf 91 pop r28 2e4c0: 1f 91 pop r17 2e4c2: 0f 91 pop r16 2e4c4: ff 90 pop r15 2e4c6: ef 90 pop r14 2e4c8: df 90 pop r13 2e4ca: cf 90 pop r12 2e4cc: bf 90 pop r11 2e4ce: af 90 pop r10 2e4d0: 9f 90 pop r9 2e4d2: 8f 90 pop r8 2e4d4: 7f 90 pop r7 2e4d6: 6f 90 pop r6 2e4d8: 5f 90 pop r5 2e4da: 4f 90 pop r4 2e4dc: 3f 90 pop r3 2e4de: 2f 90 pop r2 2e4e0: 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); 2e4e2: 28 ec ldi r18, 0xC8 ; 200 2e4e4: 30 e0 ldi r19, 0x00 ; 0 2e4e6: a7 01 movw r20, r14 2e4e8: 68 ee ldi r22, 0xE8 ; 232 2e4ea: 73 e0 ldi r23, 0x03 ; 3 2e4ec: 84 e0 ldi r24, 0x04 ; 4 2e4ee: 0e 94 c8 e9 call 0x1d390 ; 0x1d390 /// 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_){ 2e4f2: 80 91 ba 06 lds r24, 0x06BA ; 0x8006ba 2e4f6: 90 91 bb 06 lds r25, 0x06BB ; 0x8006bb 2e4fa: a0 91 bc 06 lds r26, 0x06BC ; 0x8006bc 2e4fe: b0 91 bd 06 lds r27, 0x06BD ; 0x8006bd 2e502: 01 97 sbiw r24, 0x01 ; 1 2e504: a1 09 sbc r26, r1 2e506: b1 09 sbc r27, r1 2e508: 80 93 ba 06 sts 0x06BA, r24 ; 0x8006ba 2e50c: 90 93 bb 06 sts 0x06BB, r25 ; 0x8006bb 2e510: a0 93 bc 06 sts 0x06BC, r26 ; 0x8006bc 2e514: b0 93 bd 06 sts 0x06BD, r27 ; 0x8006bd 2e518: 1b cf rjmp .-458 ; 0x2e350 2e51a: 86 01 movw r16, r12 2e51c: 2f cf rjmp .-418 ; 0x2e37c } /// 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); 2e51e: 9e 01 movw r18, r28 2e520: 2d 5b subi r18, 0xBD ; 189 2e522: 3f 4f sbci r19, 0xFF ; 255 2e524: a7 01 movw r20, r14 2e526: 68 ee ldi r22, 0xE8 ; 232 2e528: 73 e0 ldi r23, 0x03 ; 3 2e52a: 84 e0 ldi r24, 0x04 ; 4 2e52c: 0e 94 6e ea call 0x1d4dc ; 0x1d4dc --_Z_; 2e530: 80 91 ba 06 lds r24, 0x06BA ; 0x8006ba 2e534: 90 91 bb 06 lds r25, 0x06BB ; 0x8006bb 2e538: a0 91 bc 06 lds r26, 0x06BC ; 0x8006bc 2e53c: b0 91 bd 06 lds r27, 0x06BD ; 0x8006bd 2e540: 01 97 sbiw r24, 0x01 ; 1 2e542: a1 09 sbc r26, r1 2e544: b1 09 sbc r27, r1 2e546: 80 93 ba 06 sts 0x06BA, r24 ; 0x8006ba 2e54a: 90 93 bb 06 sts 0x06BB, r25 ; 0x8006bb 2e54e: a0 93 bc 06 sts 0x06BC, r26 ; 0x8006bc 2e552: b0 93 bd 06 sts 0x06BD, r27 ; 0x8006bd 2e556: 26 cf rjmp .-436 ; 0x2e3a4 } 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); 2e558: 28 ec ldi r18, 0xC8 ; 200 2e55a: 30 e0 ldi r19, 0x00 ; 0 2e55c: a7 01 movw r20, r14 2e55e: 68 e1 ldi r22, 0x18 ; 24 2e560: 7c ef ldi r23, 0xFC ; 252 2e562: 84 e0 ldi r24, 0x04 ; 4 2e564: 0e 94 c8 e9 call 0x1d390 ; 0x1d390 --_Z_; 2e568: 80 91 ba 06 lds r24, 0x06BA ; 0x8006ba 2e56c: 90 91 bb 06 lds r25, 0x06BB ; 0x8006bb 2e570: a0 91 bc 06 lds r26, 0x06BC ; 0x8006bc 2e574: b0 91 bd 06 lds r27, 0x06BD ; 0x8006bd 2e578: 01 97 sbiw r24, 0x01 ; 1 2e57a: a1 09 sbc r26, r1 2e57c: b1 09 sbc r27, r1 2e57e: 80 93 ba 06 sts 0x06BA, r24 ; 0x8006ba 2e582: 90 93 bb 06 sts 0x06BB, r25 ; 0x8006bb 2e586: a0 93 bc 06 sts 0x06BC, r26 ; 0x8006bc 2e58a: b0 93 bd 06 sts 0x06BD, r27 ; 0x8006bd 2e58e: 20 cf rjmp .-448 ; 0x2e3d0 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); 2e590: 2d 96 adiw r28, 0x0d ; 13 2e592: ee ad ldd r30, Y+62 ; 0x3e 2e594: ff ad ldd r31, Y+63 ; 0x3f 2e596: 2d 97 sbiw r28, 0x0d ; 13 2e598: 86 ad ldd r24, Z+62 ; 0x3e 2e59a: 97 ad ldd r25, Z+63 ; 0x3f 2e59c: 01 2e mov r0, r17 2e59e: 00 0c add r0, r0 2e5a0: 22 0b sbc r18, r18 2e5a2: 33 0b sbc r19, r19 2e5a4: 08 0f add r16, r24 2e5a6: 19 1f adc r17, r25 2e5a8: 21 1d adc r18, r1 2e5aa: 31 1d adc r19, r1 2e5ac: 36 95 lsr r19 2e5ae: 27 95 ror r18 2e5b0: 17 95 ror r17 2e5b2: 07 95 ror r16 2e5b4: 0f 3f cpi r16, 0xFF ; 255 2e5b6: 11 05 cpc r17, r1 2e5b8: 21 05 cpc r18, r1 2e5ba: 31 05 cpc r19, r1 2e5bc: 29 f0 breq .+10 ; 0x2e5c8 2e5be: 20 f0 brcs .+8 ; 0x2e5c8 2e5c0: 0f ef ldi r16, 0xFF ; 255 2e5c2: 10 e0 ldi r17, 0x00 ; 0 2e5c4: 20 e0 ldi r18, 0x00 ; 0 2e5c6: 30 e0 ldi r19, 0x00 ; 0 2e5c8: 2f 96 adiw r28, 0x0f ; 15 2e5ca: ee ad ldd r30, Y+62 ; 0x3e 2e5cc: ff ad ldd r31, Y+63 ; 0x3f 2e5ce: 2f 97 sbiw r28, 0x0f ; 15 2e5d0: 07 8f std Z+31, r16 ; 0x1f 2e5d2: 1f cf rjmp .-450 ; 0x2e412 0002e5d4 : 2e5d4: ef 92 push r14 2e5d6: ff 92 push r15 2e5d8: 0f 93 push r16 2e5da: 1f 93 push r17 2e5dc: cf 93 push r28 2e5de: df 93 push r29 2e5e0: cd b7 in r28, 0x3d ; 61 2e5e2: de b7 in r29, 0x3e ; 62 2e5e4: 2f 97 sbiw r28, 0x0f ; 15 2e5e6: 0f b6 in r0, 0x3f ; 63 2e5e8: f8 94 cli 2e5ea: de bf out 0x3e, r29 ; 62 2e5ec: 0f be out 0x3f, r0 ; 63 2e5ee: cd bf out 0x3d, r28 ; 61 2e5f0: ef ea ldi r30, 0xAF ; 175 2e5f2: f2 e1 ldi r31, 0x12 ; 18 2e5f4: 10 a2 std Z+32, r1 ; 0x20 2e5f6: 11 a2 std Z+33, r1 ; 0x21 2e5f8: 12 a2 std Z+34, r1 ; 0x22 2e5fa: 13 a2 std Z+35, r1 ; 0x23 2e5fc: 14 a2 std Z+36, r1 ; 0x24 2e5fe: 15 a2 std Z+37, r1 ; 0x25 2e600: 16 a2 std Z+38, r1 ; 0x26 2e602: 17 a2 std Z+39, r1 ; 0x27 2e604: 10 a6 std Z+40, r1 ; 0x28 2e606: 11 a6 std Z+41, r1 ; 0x29 2e608: 10 92 48 13 sts 0x1348, r1 ; 0x801348 2e60c: 0a e4 ldi r16, 0x4A ; 74 2e60e: 13 e1 ldi r17, 0x13 ; 19 2e610: ee 24 eor r14, r14 2e612: e3 94 inc r14 2e614: f1 2c mov r15, r1 2e616: d8 01 movw r26, r16 2e618: 11 96 adiw r26, 0x01 ; 1 2e61a: fc 92 st X, r15 2e61c: ee 92 st -X, r14 2e61e: 12 96 adiw r26, 0x02 ; 2 2e620: 1c 92 st X, r1 2e622: 12 97 sbiw r26, 0x02 ; 2 2e624: 82 e8 ldi r24, 0x82 ; 130 2e626: 13 96 adiw r26, 0x03 ; 3 2e628: 8c 93 st X, r24 2e62a: 40 e0 ldi r20, 0x00 ; 0 2e62c: 60 e0 ldi r22, 0x00 ; 0 2e62e: 8f e4 ldi r24, 0x4F ; 79 2e630: 93 e1 ldi r25, 0x13 ; 19 2e632: 0f 94 48 c5 call 0x38a90 ; 0x38a90 2e636: 40 e0 ldi r20, 0x00 ; 0 2e638: 60 e0 ldi r22, 0x00 ; 0 2e63a: 84 e5 ldi r24, 0x54 ; 84 2e63c: 93 e1 ldi r25, 0x13 ; 19 2e63e: 0f 94 48 c5 call 0x38a90 ; 0x38a90 2e642: f8 01 movw r30, r16 2e644: 17 86 std Z+15, r1 ; 0x0f 2e646: 10 8a std Z+16, r1 ; 0x10 2e648: 11 8a std Z+17, r1 ; 0x11 2e64a: 12 8a std Z+18, r1 ; 0x12 2e64c: 13 8a std Z+19, r1 ; 0x13 2e64e: 8a e0 ldi r24, 0x0A ; 10 2e650: 84 8b std Z+20, r24 ; 0x14 2e652: 40 e0 ldi r20, 0x00 ; 0 2e654: 60 e0 ldi r22, 0x00 ; 0 2e656: ce 01 movw r24, r28 2e658: 01 96 adiw r24, 0x01 ; 1 2e65a: 0f 94 48 c5 call 0x38a90 ; 0x38a90 2e65e: 85 e0 ldi r24, 0x05 ; 5 2e660: fe 01 movw r30, r28 2e662: 31 96 adiw r30, 0x01 ; 1 2e664: de 01 movw r26, r28 2e666: 16 96 adiw r26, 0x06 ; 6 2e668: 01 90 ld r0, Z+ 2e66a: 0d 92 st X+, r0 2e66c: 8a 95 dec r24 2e66e: e1 f7 brne .-8 ; 0x2e668 2e670: 85 e0 ldi r24, 0x05 ; 5 2e672: fe 01 movw r30, r28 2e674: 36 96 adiw r30, 0x06 ; 6 2e676: af e5 ldi r26, 0x5F ; 95 2e678: b3 e1 ldi r27, 0x13 ; 19 2e67a: 01 90 ld r0, Z+ 2e67c: 0d 92 st X+, r0 2e67e: 8a 95 dec r24 2e680: e1 f7 brne .-8 ; 0x2e67a 2e682: d8 01 movw r26, r16 2e684: 5a 96 adiw r26, 0x1a ; 26 2e686: 1c 92 st X, r1 2e688: 5a 97 sbiw r26, 0x1a ; 26 2e68a: 5c 96 adiw r26, 0x1c ; 28 2e68c: 1c 92 st X, r1 2e68e: 1e 92 st -X, r1 2e690: 5b 97 sbiw r26, 0x1b ; 27 2e692: 8f e5 ldi r24, 0x5F ; 95 2e694: 93 e1 ldi r25, 0x13 ; 19 2e696: 0f 94 37 c5 call 0x38a6e ; 0x38a6e 2e69a: f8 01 movw r30, r16 2e69c: 81 8f std Z+25, r24 ; 0x19 2e69e: 15 8e std Z+29, r1 ; 0x1d 2e6a0: 16 8e std Z+30, r1 ; 0x1e 2e6a2: 40 e0 ldi r20, 0x00 ; 0 2e6a4: 60 e0 ldi r22, 0x00 ; 0 2e6a6: 89 e6 ldi r24, 0x69 ; 105 2e6a8: 93 e1 ldi r25, 0x13 ; 19 2e6aa: 0f 94 48 c5 call 0x38a90 ; 0x38a90 2e6ae: d8 01 movw r26, r16 2e6b0: 94 96 adiw r26, 0x24 ; 36 2e6b2: 1c 92 st X, r1 2e6b4: 40 e0 ldi r20, 0x00 ; 0 2e6b6: 60 e0 ldi r22, 0x00 ; 0 2e6b8: ce 01 movw r24, r28 2e6ba: 0b 96 adiw r24, 0x0b ; 11 2e6bc: 0f 94 48 c5 call 0x38a90 ; 0x38a90 2e6c0: 85 e0 ldi r24, 0x05 ; 5 2e6c2: fe 01 movw r30, r28 2e6c4: 3b 96 adiw r30, 0x0b ; 11 2e6c6: de 01 movw r26, r28 2e6c8: 11 96 adiw r26, 0x01 ; 1 2e6ca: 01 90 ld r0, Z+ 2e6cc: 0d 92 st X+, r0 2e6ce: 8a 95 dec r24 2e6d0: e1 f7 brne .-8 ; 0x2e6ca 2e6d2: 85 e0 ldi r24, 0x05 ; 5 2e6d4: fe 01 movw r30, r28 2e6d6: 31 96 adiw r30, 0x01 ; 1 2e6d8: af e6 ldi r26, 0x6F ; 111 2e6da: b3 e1 ldi r27, 0x13 ; 19 2e6dc: 01 90 ld r0, Z+ 2e6de: 0d 92 st X+, r0 2e6e0: 8a 95 dec r24 2e6e2: e1 f7 brne .-8 ; 0x2e6dc 2e6e4: f8 01 movw r30, r16 2e6e6: 12 a6 std Z+42, r1 ; 0x2a 2e6e8: 14 a6 std Z+44, r1 ; 0x2c 2e6ea: 13 a6 std Z+43, r1 ; 0x2b 2e6ec: 8f e6 ldi r24, 0x6F ; 111 2e6ee: 93 e1 ldi r25, 0x13 ; 19 2e6f0: 0f 94 37 c5 call 0x38a6e ; 0x38a6e 2e6f4: d8 01 movw r26, r16 2e6f6: 99 96 adiw r26, 0x29 ; 41 2e6f8: 8c 93 st X, r24 2e6fa: 99 97 sbiw r26, 0x29 ; 41 2e6fc: dd 96 adiw r26, 0x3d ; 61 2e6fe: 1c 92 st X, r1 2e700: dd 97 sbiw r26, 0x3d ; 61 2e702: 89 e4 ldi r24, 0x49 ; 73 2e704: 93 e1 ldi r25, 0x13 ; 19 2e706: df 96 adiw r26, 0x3f ; 63 2e708: 9c 93 st X, r25 2e70a: 8e 93 st -X, r24 2e70c: de 97 sbiw r26, 0x3e ; 62 2e70e: f0 92 8b 13 sts 0x138B, r15 ; 0x80138b 2e712: e0 92 8a 13 sts 0x138A, r14 ; 0x80138a 2e716: 10 92 8c 13 sts 0x138C, r1 ; 0x80138c 2e71a: 1f ef ldi r17, 0xFF ; 255 2e71c: 10 93 8d 13 sts 0x138D, r17 ; 0x80138d 2e720: 0f 94 a0 c5 call 0x38b40 ; 0x38b40 2e724: 80 93 8e 13 sts 0x138E, r24 ; 0x80138e 2e728: 10 92 8f 13 sts 0x138F, r1 ; 0x80138f 2e72c: 10 92 90 13 sts 0x1390, r1 ; 0x801390 2e730: 10 92 91 13 sts 0x1391, r1 ; 0x801391 2e734: 10 92 93 13 sts 0x1393, r1 ; 0x801393 2e738: 10 92 92 13 sts 0x1392, r1 ; 0x801392 2e73c: 10 92 95 13 sts 0x1395, r1 ; 0x801395 2e740: 10 92 94 13 sts 0x1394, r1 ; 0x801394 2e744: 10 92 98 13 sts 0x1398, r1 ; 0x801398 2e748: 10 92 99 13 sts 0x1399, r1 ; 0x801399 2e74c: 10 92 9a 13 sts 0x139A, r1 ; 0x80139a 2e750: 10 92 9b 13 sts 0x139B, r1 ; 0x80139b 2e754: 83 e0 ldi r24, 0x03 ; 3 2e756: 80 93 9e 13 sts 0x139E, r24 ; 0x80139e 2e75a: 10 92 9f 13 sts 0x139F, r1 ; 0x80139f 2e75e: 85 e1 ldi r24, 0x15 ; 21 2e760: 80 93 96 13 sts 0x1396, r24 ; 0x801396 2e764: 84 e1 ldi r24, 0x14 ; 20 2e766: 80 93 97 13 sts 0x1397, r24 ; 0x801397 2e76a: 83 e6 ldi r24, 0x63 ; 99 2e76c: 80 93 a0 13 sts 0x13A0, r24 ; 0x8013a0 2e770: 80 93 a1 13 sts 0x13A1, r24 ; 0x8013a1 2e774: 10 92 a2 13 sts 0x13A2, r1 ; 0x8013a2 2e778: 10 92 a3 13 sts 0x13A3, r1 ; 0x8013a3 2e77c: 10 92 a4 13 sts 0x13A4, r1 ; 0x8013a4 2e780: 10 92 a5 13 sts 0x13A5, r1 ; 0x8013a5 2e784: 10 92 a6 13 sts 0x13A6, r1 ; 0x8013a6 2e788: 10 92 a7 13 sts 0x13A7, r1 ; 0x8013a7 2e78c: 10 92 a8 13 sts 0x13A8, r1 ; 0x8013a8 2e790: 10 92 a9 13 sts 0x13A9, r1 ; 0x8013a9 2e794: 10 92 aa 13 sts 0x13AA, r1 ; 0x8013aa 2e798: 10 92 ab 13 sts 0x13AB, r1 ; 0x8013ab 2e79c: 10 92 ac 13 sts 0x13AC, r1 ; 0x8013ac 2e7a0: 10 92 ad 13 sts 0x13AD, r1 ; 0x8013ad 2e7a4: 10 92 af 13 sts 0x13AF, r1 ; 0x8013af 2e7a8: 10 92 ae 13 sts 0x13AE, r1 ; 0x8013ae 2e7ac: 10 92 b0 13 sts 0x13B0, r1 ; 0x8013b0 2e7b0: 8e e2 ldi r24, 0x2E ; 46 2e7b2: 90 e8 ldi r25, 0x80 ; 128 2e7b4: 90 93 b2 13 sts 0x13B2, r25 ; 0x8013b2 2e7b8: 80 93 b1 13 sts 0x13B1, r24 ; 0x8013b1 2e7bc: 10 93 b3 13 sts 0x13B3, r17 ; 0x8013b3 2e7c0: 10 93 b4 13 sts 0x13B4, r17 ; 0x8013b4 2e7c4: 10 92 b6 13 sts 0x13B6, r1 ; 0x8013b6 2e7c8: 10 92 b5 13 sts 0x13B5, r1 ; 0x8013b5 2e7cc: 10 93 b7 13 sts 0x13B7, r17 ; 0x8013b7 2e7d0: 82 e0 ldi r24, 0x02 ; 2 2e7d2: 80 93 b8 13 sts 0x13B8, r24 ; 0x8013b8 2e7d6: 10 92 b9 13 sts 0x13B9, r1 ; 0x8013b9 2e7da: 10 92 ba 13 sts 0x13BA, r1 ; 0x8013ba 2e7de: 10 92 bb 13 sts 0x13BB, r1 ; 0x8013bb 2e7e2: 10 92 bc 13 sts 0x13BC, r1 ; 0x8013bc 2e7e6: 10 92 be 13 sts 0x13BE, r1 ; 0x8013be 2e7ea: 10 92 bd 13 sts 0x13BD, r1 ; 0x8013bd 2e7ee: 10 92 c0 13 sts 0x13C0, r1 ; 0x8013c0 2e7f2: 10 92 bf 13 sts 0x13BF, r1 ; 0x8013bf 2e7f6: 0f 94 08 8c call 0x31810 ; 0x31810 2e7fa: ed e8 ldi r30, 0x8D ; 141 2e7fc: f4 e1 ldi r31, 0x14 ; 20 2e7fe: 10 92 15 15 sts 0x1515, r1 ; 0x801515 2e802: 10 92 18 15 sts 0x1518, r1 ; 0x801518 2e806: 10 92 3a 15 sts 0x153A, r1 ; 0x80153a 2e80a: 10 92 3d 15 sts 0x153D, r1 ; 0x80153d 2e80e: 89 e1 ldi r24, 0x19 ; 25 2e810: 80 93 fc 16 sts 0x16FC, r24 ; 0x8016fc 2e814: 10 92 ff 16 sts 0x16FF, r1 ; 0x8016ff 2e818: 10 92 00 17 sts 0x1700, r1 ; 0x801700 2e81c: 10 92 18 17 sts 0x1718, r1 ; 0x801718 2e820: 10 92 1f 17 sts 0x171F, r1 ; 0x80171f 2e824: 10 92 22 17 sts 0x1722, r1 ; 0x801722 2e828: 10 92 a0 17 sts 0x17A0, r1 ; 0x8017a0 2e82c: 10 92 a2 17 sts 0x17A2, r1 ; 0x8017a2 2e830: 10 92 a1 17 sts 0x17A1, r1 ; 0x8017a1 2e834: 10 92 31 16 sts 0x1631, r1 ; 0x801631 2e838: 10 92 30 16 sts 0x1630, r1 ; 0x801630 2e83c: 10 92 9c 17 sts 0x179C, r1 ; 0x80179c 2e840: 10 92 9d 17 sts 0x179D, r1 ; 0x80179d 2e844: 10 92 9e 17 sts 0x179E, r1 ; 0x80179e 2e848: 10 92 9f 17 sts 0x179F, r1 ; 0x80179f 2e84c: 10 92 a3 17 sts 0x17A3, r1 ; 0x8017a3 2e850: 10 92 a4 17 sts 0x17A4, r1 ; 0x8017a4 2e854: 10 92 a5 17 sts 0x17A5, r1 ; 0x8017a5 2e858: 10 92 a6 17 sts 0x17A6, r1 ; 0x8017a6 2e85c: 12 82 std Z+2, r1 ; 0x02 2e85e: 13 82 std Z+3, r1 ; 0x03 2e860: 10 82 st Z, r1 2e862: 11 82 std Z+1, r1 ; 0x01 2e864: 10 92 2f 16 sts 0x162F, r1 ; 0x80162f 2e868: 10 92 42 17 sts 0x1742, r1 ; 0x801742 2e86c: ed e5 ldi r30, 0x5D ; 93 2e86e: f5 e1 ldi r31, 0x15 ; 21 2e870: 82 ed ldi r24, 0xD2 ; 210 2e872: df 01 movw r26, r30 2e874: 1d 92 st X+, r1 2e876: 8a 95 dec r24 2e878: e9 f7 brne .-6 ; 0x2e874 2e87a: 10 92 de 14 sts 0x14DE, r1 ; 0x8014de 2e87e: 10 92 dd 14 sts 0x14DD, r1 ; 0x8014dd 2e882: 10 92 dc 14 sts 0x14DC, r1 ; 0x8014dc 2e886: 80 ea ldi r24, 0xA0 ; 160 2e888: 97 e1 ldi r25, 0x17 ; 23 2e88a: 0f 94 83 29 call 0x25306 ; 0x25306 ::start()> 2e88e: e6 e8 ldi r30, 0x86 ; 134 2e890: f4 e1 ldi r31, 0x14 ; 20 2e892: 11 82 std Z+1, r1 ; 0x01 2e894: 12 82 std Z+2, r1 ; 0x02 2e896: 13 82 std Z+3, r1 ; 0x03 2e898: 14 82 std Z+4, r1 ; 0x04 2e89a: 15 82 std Z+5, r1 ; 0x05 2e89c: 16 82 std Z+6, r1 ; 0x06 2e89e: 10 83 st Z, r17 2e8a0: e9 ea ldi r30, 0xA9 ; 169 2e8a2: f7 e1 ldi r31, 0x17 ; 23 2e8a4: 15 82 std Z+5, r1 ; 0x05 2e8a6: 17 82 std Z+7, r1 ; 0x07 2e8a8: 16 82 std Z+6, r1 ; 0x06 2e8aa: 11 86 std Z+9, r1 ; 0x09 2e8ac: 13 86 std Z+11, r1 ; 0x0b 2e8ae: 12 86 std Z+10, r1 ; 0x0a 2e8b0: 0f 94 22 29 call 0x25244 ; 0x25244 2e8b4: 60 93 bf 17 sts 0x17BF, r22 ; 0x8017bf 2e8b8: 70 93 c0 17 sts 0x17C0, r23 ; 0x8017c0 2e8bc: 80 93 c1 17 sts 0x17C1, r24 ; 0x8017c1 2e8c0: 90 93 c2 17 sts 0x17C2, r25 ; 0x8017c2 2e8c4: 2f 96 adiw r28, 0x0f ; 15 2e8c6: 0f b6 in r0, 0x3f ; 63 2e8c8: f8 94 cli 2e8ca: de bf out 0x3e, r29 ; 62 2e8cc: 0f be out 0x3f, r0 ; 63 2e8ce: cd bf out 0x3d, r28 ; 61 2e8d0: df 91 pop r29 2e8d2: cf 91 pop r28 2e8d4: 1f 91 pop r17 2e8d6: 0f 91 pop r16 2e8d8: ff 90 pop r15 2e8da: ef 90 pop r14 2e8dc: 08 95 ret 0002e8de : else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 2e8de: 42 e0 ldi r20, 0x02 ; 2 2e8e0: 0f 94 42 d5 call 0x3aa84 ; 0x3aa84 } void MarlinSerial::println(double n, int digits) { print(n, digits); println(); 2e8e4: 0d 94 b8 d5 jmp 0x3ab70 ; 0x3ab70 0002e8e8 : 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; 2e8e8: 80 91 a0 13 lds r24, 0x13A0 ; 0x8013a0 2e8ec: 83 36 cpi r24, 0x63 ; 99 2e8ee: 09 f4 brne .+2 ; 0x2e8f2 2e8f0: 8f ef ldi r24, 0xFF ; 255 } 2e8f2: 08 95 ret 0002e8f4 : return 0; } } //------------------------------------------------------------------------------ void Sd2Card::chipSelectHigh() { WRITE(SDSS, 1); 2e8f4: 9f b7 in r25, 0x3f ; 63 2e8f6: f8 94 cli 2e8f8: e5 e0 ldi r30, 0x05 ; 5 2e8fa: f1 e0 ldi r31, 0x01 ; 1 2e8fc: 80 81 ld r24, Z 2e8fe: 80 64 ori r24, 0x40 ; 64 2e900: 80 83 st Z, r24 2e902: 9f bf out 0x3f, r25 ; 63 } 2e904: 08 95 ret 0002e906 : spiRate_ = sckRateID; return true; } //------------------------------------------------------------------------------ // wait for card to go not busy bool Sd2Card::waitNotBusy(uint16_t timeoutMillis) { 2e906: 0f 93 push r16 2e908: 1f 93 push r17 2e90a: cf 93 push r28 2e90c: df 93 push r29 2e90e: ec 01 movw r28, r24 uint16_t t0 = _millis(); 2e910: 0f 94 22 29 call 0x25244 ; 0x25244 2e914: 8b 01 movw r16, r22 while (spiRec() != 0XFF) { 2e916: 0f 94 05 52 call 0x2a40a ; 0x2a40a 2e91a: 8f 3f cpi r24, 0xFF ; 255 2e91c: 69 f0 breq .+26 ; 0x2e938 if (((uint16_t)_millis() - t0) >= timeoutMillis) goto fail; 2e91e: 0f 94 22 29 call 0x25244 ; 0x25244 2e922: 60 1b sub r22, r16 2e924: 71 0b sbc r23, r17 2e926: 6c 17 cp r22, r28 2e928: 7d 07 cpc r23, r29 2e92a: a8 f3 brcs .-22 ; 0x2e916 } return true; fail: return false; 2e92c: 80 e0 ldi r24, 0x00 ; 0 } 2e92e: df 91 pop r29 2e930: cf 91 pop r28 2e932: 1f 91 pop r17 2e934: 0f 91 pop r16 2e936: 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; 2e938: 81 e0 ldi r24, 0x01 ; 1 2e93a: f9 cf rjmp .-14 ; 0x2e92e 0002e93c : , tmcFailures(0) { } void MMU2::Status() { // Useful information to see during bootup and change state SERIAL_ECHOPGM("MMU is "); 2e93c: 80 e0 ldi r24, 0x00 ; 0 2e93e: 9c ea ldi r25, 0xAC ; 172 2e940: 0e 94 68 77 call 0xeed0 ; 0xeed0 uint8_t status = eeprom_init_default_byte((uint8_t*)EEPROM_MMU_ENABLED, 0); 2e944: 60 e0 ldi r22, 0x00 ; 0 2e946: 8c ea ldi r24, 0xAC ; 172 2e948: 9c e0 ldi r25, 0x0C ; 12 2e94a: 0e 94 21 76 call 0xec42 ; 0xec42 if (status == 1) { 2e94e: 81 30 cpi r24, 0x01 ; 1 2e950: 21 f4 brne .+8 ; 0x2e95a SERIAL_ECHOLNRPGM(_O(MSG_ON)); 2e952: 85 e1 ldi r24, 0x15 ; 21 2e954: 9d e5 ldi r25, 0x5D ; 93 } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); 2e956: 0c 94 93 79 jmp 0xf326 ; 0xf326 2e95a: 8f e0 ldi r24, 0x0F ; 15 2e95c: 9d e5 ldi r25, 0x5D ; 93 2e95e: fb cf rjmp .-10 ; 0x2e956 0002e960 : print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 2e960: bc 01 movw r22, r24 2e962: 99 0f add r25, r25 2e964: 88 0b sbc r24, r24 2e966: 99 0b sbc r25, r25 2e968: 0f 94 26 d5 call 0x3aa4c ; 0x3aa4c } void MarlinSerial::println(int n, int base) { print(n, base); println(); 2e96c: 0d 94 b8 d5 jmp 0x3ab70 ; 0x3ab70 0002e970 : bool cmd_buffer_empty() { return (buflen == 0); } void enquecommand_front(const char *cmd, bool from_progmem) 2e970: 0f 93 push r16 2e972: 1f 93 push r17 2e974: cf 93 push r28 2e976: df 93 push r29 2e978: ec 01 movw r28, r24 2e97a: 0f 94 95 d9 call 0x3b32a ; 0x3b32a <__strlen_P> 2e97e: 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) 2e980: 80 36 cpi r24, 0x60 ; 96 2e982: 91 05 cpc r25, r1 2e984: 08 f0 brcs .+2 ; 0x2e988 2e986: 85 c0 rjmp .+266 ; 0x2ea92 return false; // Remove the currently processed command from the queue. if (! cmdbuffer_front_already_processed) { 2e988: 80 91 a1 10 lds r24, 0x10A1 ; 0x8010a1 2e98c: 81 11 cpse r24, r1 2e98e: 05 c0 rjmp .+10 ; 0x2e99a cmdqueue_pop_front(); 2e990: 0e 94 d4 76 call 0xeda8 ; 0xeda8 cmdbuffer_front_already_processed = true; 2e994: 81 e0 ldi r24, 0x01 ; 1 2e996: 80 93 a1 10 sts 0x10A1, r24 ; 0x8010a1 } if (bufindr == bufindw && buflen > 0) 2e99a: 40 91 91 12 lds r20, 0x1291 ; 0x801291 2e99e: 50 91 92 12 lds r21, 0x1292 ; 0x801292 2e9a2: 80 91 9f 10 lds r24, 0x109F ; 0x80109f <_ZL7bufindw.lto_priv.550> 2e9a6: 90 91 a0 10 lds r25, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.550+0x1> 2e9aa: 48 17 cp r20, r24 2e9ac: 59 07 cpc r21, r25 2e9ae: 41 f4 brne .+16 ; 0x2e9c0 2e9b0: 20 91 a2 10 lds r18, 0x10A2 ; 0x8010a2 2e9b4: 30 91 a3 10 lds r19, 0x10A3 ; 0x8010a3 2e9b8: 12 16 cp r1, r18 2e9ba: 13 06 cpc r1, r19 2e9bc: 0c f4 brge .+2 ; 0x2e9c0 2e9be: 69 c0 rjmp .+210 ; 0x2ea92 // 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; 2e9c0: 20 91 9d 10 lds r18, 0x109D ; 0x80109d 2e9c4: 30 91 9e 10 lds r19, 0x109E ; 0x80109e 2e9c8: 12 16 cp r1, r18 2e9ca: 13 06 cpc r1, r19 2e9cc: 0c f0 brlt .+2 ; 0x2e9d0 2e9ce: 41 c0 rjmp .+130 ; 0x2ea52 2e9d0: 9c 01 movw r18, r24 2e9d2: 2f 59 subi r18, 0x9F ; 159 2e9d4: 3f 4f sbci r19, 0xFF ; 255 if (bufindw < bufindr) { 2e9d6: 84 17 cp r24, r20 2e9d8: 95 07 cpc r25, r21 2e9da: e8 f5 brcc .+122 ; 0x2ea56 int bufindr_new = bufindr - len_asked - (1 + CMDHDRSIZE); 2e9dc: 44 50 subi r20, 0x04 ; 4 2e9de: 51 09 sbc r21, r1 2e9e0: 40 1b sub r20, r16 2e9e2: 51 0b sbc r21, r17 // Simple case. There is a contiguous space between the write buffer and the read buffer. if (endw <= bufindr_new) { 2e9e4: 42 17 cp r20, r18 2e9e6: 53 07 cpc r21, r19 2e9e8: 0c f4 brge .+2 ; 0x2e9ec 2e9ea: 53 c0 rjmp .+166 ; 0x2ea92 } } 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); 2e9ec: 50 93 92 12 sts 0x1292, r21 ; 0x801292 2e9f0: 40 93 91 12 sts 0x1291, r20 ; 0x801291 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; 2e9f4: 80 91 91 12 lds r24, 0x1291 ; 0x801291 2e9f8: 90 91 92 12 lds r25, 0x1292 ; 0x801292 2e9fc: fc 01 movw r30, r24 2e9fe: ec 55 subi r30, 0x5C ; 92 2ea00: ff 4e sbci r31, 0xEF ; 239 2ea02: 23 e0 ldi r18, 0x03 ; 3 2ea04: 20 83 st Z, r18 if (from_progmem) strcpy_P(cmdbuffer + bufindr + CMDHDRSIZE, cmd); 2ea06: be 01 movw r22, r28 2ea08: 89 55 subi r24, 0x59 ; 89 2ea0a: 9f 4e sbci r25, 0xEF ; 239 2ea0c: 0f 94 8e d9 call 0x3b31c ; 0x3b31c else strcpy(cmdbuffer + bufindr + CMDHDRSIZE, cmd); ++ buflen; 2ea10: 80 91 a2 10 lds r24, 0x10A2 ; 0x8010a2 2ea14: 90 91 a3 10 lds r25, 0x10A3 ; 0x8010a3 2ea18: 01 96 adiw r24, 0x01 ; 1 2ea1a: 90 93 a3 10 sts 0x10A3, r25 ; 0x8010a3 2ea1e: 80 93 a2 10 sts 0x10A2, r24 ; 0x8010a2 SERIAL_ECHO_START; 2ea22: 82 ef ldi r24, 0xF2 ; 242 2ea24: 9b ea ldi r25, 0xAB ; 171 2ea26: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHORPGM(enqueingFront); 2ea2a: 83 ed ldi r24, 0xD3 ; 211 2ea2c: 9b ea ldi r25, 0xAB ; 171 2ea2e: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHO(cmdbuffer + bufindr + CMDHDRSIZE); 2ea32: 80 91 91 12 lds r24, 0x1291 ; 0x801291 2ea36: 90 91 92 12 lds r25, 0x1292 ; 0x801292 } }*/ static FORCE_INLINE void print(const char *str) { write(str); 2ea3a: 89 55 subi r24, 0x59 ; 89 2ea3c: 9f 4e sbci r25, 0xEF ; 239 2ea3e: 0e 94 2c 88 call 0x11058 ; 0x11058 SERIAL_ECHOLNPGM("\""); 2ea42: 81 ed ldi r24, 0xD1 ; 209 2ea44: 9b ea ldi r25, 0xAB ; 171 SERIAL_ECHOLNRPGM(bufferFull); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } 2ea46: df 91 pop r29 2ea48: cf 91 pop r28 2ea4a: 1f 91 pop r17 2ea4c: 0f 91 pop r16 SERIAL_ECHORPGM(enqueingFront); if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 2ea4e: 0c 94 93 79 jmp 0xf326 ; 0xf326 // 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) 2ea52: 9c 01 movw r18, r24 2ea54: c0 cf rjmp .-128 ; 0x2e9d6 bufindr = bufindr_new; return true; } } else { // Otherwise the free space is split between the start and end. if (len_asked + (1 + CMDHDRSIZE) <= bufindr) { 2ea56: c8 01 movw r24, r16 2ea58: 04 96 adiw r24, 0x04 ; 4 2ea5a: 48 17 cp r20, r24 2ea5c: 59 07 cpc r21, r25 2ea5e: 28 f0 brcs .+10 ; 0x2ea6a // Could fit at the start. bufindr -= len_asked + (1 + CMDHDRSIZE); 2ea60: 44 50 subi r20, 0x04 ; 4 2ea62: 51 09 sbc r21, r1 2ea64: 40 1b sub r20, r16 2ea66: 51 0b sbc r21, r17 2ea68: c1 cf rjmp .-126 ; 0x2e9ec return true; } int bufindr_new = sizeof(cmdbuffer) - len_asked - (1 + CMDHDRSIZE); 2ea6a: 89 ee ldi r24, 0xE9 ; 233 2ea6c: 91 e0 ldi r25, 0x01 ; 1 2ea6e: bc 01 movw r22, r24 2ea70: 60 1b sub r22, r16 2ea72: 71 0b sbc r23, r17 2ea74: 8b 01 movw r16, r22 if (endw <= bufindr_new) { 2ea76: 62 17 cp r22, r18 2ea78: 73 07 cpc r23, r19 2ea7a: 5c f0 brlt .+22 ; 0x2ea92 memset(cmdbuffer, 0, bufindr); 2ea7c: 70 e0 ldi r23, 0x00 ; 0 2ea7e: 60 e0 ldi r22, 0x00 ; 0 2ea80: 84 ea ldi r24, 0xA4 ; 164 2ea82: 90 e1 ldi r25, 0x10 ; 16 2ea84: 0f 94 09 e2 call 0x3c412 ; 0x3c412 bufindr = bufindr_new; 2ea88: 10 93 92 12 sts 0x1292, r17 ; 0x801292 2ea8c: 00 93 91 12 sts 0x1291, r16 ; 0x801291 2ea90: b1 cf rjmp .-158 ; 0x2e9f4 SERIAL_ECHOLNPGM("\""); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; 2ea92: 8a ec ldi r24, 0xCA ; 202 2ea94: 9b ea ldi r25, 0xAB ; 171 2ea96: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHORPGM(enqueingFront); 2ea9a: 83 ed ldi r24, 0xD3 ; 211 2ea9c: 9b ea ldi r25, 0xAB ; 171 2ea9e: 0e 94 68 77 call 0xeed0 ; 0xeed0 if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); 2eaa2: ce 01 movw r24, r28 2eaa4: 0e 94 68 77 call 0xeed0 ; 0xeed0 else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 2eaa8: 83 eb ldi r24, 0xB3 ; 179 2eaaa: 9b ea ldi r25, 0xAB ; 171 2eaac: cc cf rjmp .-104 ; 0x2ea46 0002eaae : } else { return false; } } bool SdFile::seekSetFilteredGcode(uint32_t pos){ 2eaae: ab 01 movw r20, r22 2eab0: bc 01 movw r22, r24 if(! seekSet(pos) )return false; 2eab2: 8f e1 ldi r24, 0x1F ; 31 2eab4: 97 e1 ldi r25, 0x17 ; 23 2eab6: 0f 94 4d 56 call 0x2ac9a ; 0x2ac9a 2eaba: 81 11 cpse r24, r1 2eabc: 02 c0 rjmp .+4 ; 0x2eac2 2eabe: 80 e0 ldi r24, 0x00 ; 0 2eac0: 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() ) 2eac2: 8f e1 ldi r24, 0x1F ; 31 2eac4: 97 e1 ldi r25, 0x17 ; 23 2eac6: 0f 94 d4 55 call 0x2aba8 ; 0x2aba8 2eaca: 88 23 and r24, r24 2eacc: c1 f3 breq .-16 ; 0x2eabe 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; 2eace: 20 91 40 17 lds r18, 0x1740 ; 0x801740 2ead2: 30 91 41 17 lds r19, 0x1741 ; 0x801741 2ead6: 24 56 subi r18, 0x64 ; 100 2ead8: 31 4f sbci r19, 0xF1 ; 241 2eada: 30 93 3b 17 sts 0x173B, r19 ; 0x80173b 2eade: 20 93 3a 17 sts 0x173A, r18 ; 0x80173a bool SdFile::seekSetFilteredGcode(uint32_t pos){ if(! seekSet(pos) )return false; if(! gfComputeNextFileBlock() )return false; gfReset(); return true; } 2eae2: 08 95 ret 0002eae4 : SERIAL_PROTOCOLLNPGM("An error while writing to the SD Card."); } } void CardReader::checkautostart(bool force) 2eae4: 8f 92 push r8 2eae6: 9f 92 push r9 2eae8: af 92 push r10 2eaea: bf 92 push r11 2eaec: cf 92 push r12 2eaee: df 92 push r13 2eaf0: ef 92 push r14 2eaf2: ff 92 push r15 2eaf4: 0f 93 push r16 2eaf6: 1f 93 push r17 2eaf8: cf 93 push r28 2eafa: df 93 push r29 2eafc: cd b7 in r28, 0x3d ; 61 2eafe: de b7 in r29, 0x3e ; 62 2eb00: ee 97 sbiw r28, 0x3e ; 62 2eb02: 0f b6 in r0, 0x3f ; 63 2eb04: f8 94 cli 2eb06: de bf out 0x3e, r29 ; 62 2eb08: 0f be out 0x3f, r0 ; 63 2eb0a: cd bf out 0x3d, r28 ; 61 if(!mounted) //fail return; } char autoname[30]; sprintf_P(autoname, PSTR("auto%i.g"), lastnr); 2eb0c: 80 91 dd 14 lds r24, 0x14DD ; 0x8014dd 2eb10: 8f 93 push r24 2eb12: 80 91 dc 14 lds r24, 0x14DC ; 0x8014dc 2eb16: 8f 93 push r24 2eb18: 8e e6 ldi r24, 0x6E ; 110 2eb1a: 9b ea ldi r25, 0xAB ; 171 2eb1c: 9f 93 push r25 2eb1e: 8f 93 push r24 2eb20: 8e 01 movw r16, r28 2eb22: 0f 5d subi r16, 0xDF ; 223 2eb24: 1f 4f sbci r17, 0xFF ; 255 2eb26: 1f 93 push r17 2eb28: 0f 93 push r16 2eb2a: 0f 94 ee da call 0x3b5dc ; 0x3b5dc 2eb2e: 0f 90 pop r0 2eb30: 0f 90 pop r0 2eb32: 0f 90 pop r0 2eb34: 0f 90 pop r0 2eb36: 0f 90 pop r0 2eb38: 0f 90 pop r0 for(int8_t i=0;i<(int8_t)strlen(autoname);i++) 2eb3a: f1 2c mov r15, r1 2eb3c: f8 01 movw r30, r16 2eb3e: 01 90 ld r0, Z+ 2eb40: 00 20 and r0, r0 2eb42: e9 f7 brne .-6 ; 0x2eb3e 2eb44: 31 97 sbiw r30, 0x01 ; 1 2eb46: e0 1b sub r30, r16 2eb48: f1 0b sbc r31, r17 2eb4a: fe 16 cp r15, r30 2eb4c: 84 f4 brge .+32 ; 0x2eb6e autoname[i]=tolower(autoname[i]); 2eb4e: 68 01 movw r12, r16 2eb50: cf 0c add r12, r15 2eb52: d1 1c adc r13, r1 2eb54: f7 fc sbrc r15, 7 2eb56: da 94 dec r13 2eb58: f6 01 movw r30, r12 2eb5a: 80 81 ld r24, Z 2eb5c: 08 2e mov r0, r24 2eb5e: 00 0c add r0, r0 2eb60: 99 0b sbc r25, r25 2eb62: 0f 94 eb e1 call 0x3c3d6 ; 0x3c3d6 2eb66: f6 01 movw r30, r12 2eb68: 80 83 st Z, r24 2eb6a: f3 94 inc r15 2eb6c: e7 cf rjmp .-50 ; 0x2eb3c dir_t p; root.rewind(); 2eb6e: 85 e1 ldi r24, 0x15 ; 21 2eb70: 95 e1 ldi r25, 0x15 ; 21 2eb72: 0e 94 44 77 call 0xee88 ; 0xee88 bool found=false; 2eb76: a1 2c mov r10, r1 2eb78: ce 01 movw r24, r28 2eb7a: 01 96 adiw r24, 0x01 ; 1 2eb7c: 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); 2eb7e: 85 e3 ldi r24, 0x35 ; 53 2eb80: c8 2e mov r12, r24 2eb82: 81 e7 ldi r24, 0x71 ; 113 2eb84: 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; 2eb86: 80 91 18 15 lds r24, 0x1518 ; 0x801518 2eb8a: 82 30 cpi r24, 0x02 ; 2 2eb8c: 08 f4 brcc .+2 ; 0x2eb90 2eb8e: 50 c0 rjmp .+160 ; 0x2ec30 2eb90: 80 91 1d 15 lds r24, 0x151D ; 0x80151d 2eb94: 90 91 1e 15 lds r25, 0x151E ; 0x80151e 2eb98: a0 91 1f 15 lds r26, 0x151F ; 0x80151f 2eb9c: b0 91 20 15 lds r27, 0x1520 ; 0x801520 2eba0: 8f 71 andi r24, 0x1F ; 31 2eba2: 99 27 eor r25, r25 2eba4: aa 27 eor r26, r26 2eba6: bb 27 eor r27, r27 2eba8: 89 2b or r24, r25 2ebaa: 8a 2b or r24, r26 2ebac: 8b 2b or r24, r27 2ebae: 09 f0 breq .+2 ; 0x2ebb2 2ebb0: 3f c0 rjmp .+126 ; 0x2ec30 2ebb2: 50 e0 ldi r21, 0x00 ; 0 2ebb4: 40 e0 ldi r20, 0x00 ; 0 2ebb6: b7 01 movw r22, r14 2ebb8: 85 e1 ldi r24, 0x15 ; 21 2ebba: 95 e1 ldi r25, 0x15 ; 21 2ebbc: 0f 94 8a 59 call 0x2b314 ; 0x2b314 dir_t p; root.rewind(); bool found=false; while (root.readDir(p, NULL) > 0) 2ebc0: 18 16 cp r1, r24 2ebc2: b4 f5 brge .+108 ; 0x2ec30 { for(int8_t i=0;i<(int8_t)strlen((char*)p.name);i++) 2ebc4: b1 2c mov r11, r1 2ebc6: f7 01 movw r30, r14 2ebc8: 01 90 ld r0, Z+ 2ebca: 00 20 and r0, r0 2ebcc: e9 f7 brne .-6 ; 0x2ebc8 2ebce: 31 97 sbiw r30, 0x01 ; 1 2ebd0: ee 19 sub r30, r14 2ebd2: ff 09 sbc r31, r15 2ebd4: be 16 cp r11, r30 2ebd6: 74 f4 brge .+28 ; 0x2ebf4 p.name[i]=tolower(p.name[i]); 2ebd8: 47 01 movw r8, r14 2ebda: 8b 0c add r8, r11 2ebdc: 91 1c adc r9, r1 2ebde: b7 fc sbrc r11, 7 2ebe0: 9a 94 dec r9 2ebe2: f4 01 movw r30, r8 2ebe4: 80 81 ld r24, Z 2ebe6: 90 e0 ldi r25, 0x00 ; 0 2ebe8: 0f 94 eb e1 call 0x3c3d6 ; 0x3c3d6 2ebec: f4 01 movw r30, r8 2ebee: 80 83 st Z, r24 2ebf0: b3 94 inc r11 2ebf2: e9 cf rjmp .-46 ; 0x2ebc6 //Serial.print((char*)p.name); //Serial.print(" "); //Serial.println(autoname); if(p.name[9]!='~') //skip safety copies 2ebf4: 8a 85 ldd r24, Y+10 ; 0x0a 2ebf6: 8e 37 cpi r24, 0x7E ; 126 2ebf8: 31 f2 breq .-116 ; 0x2eb86 if(strncmp((char*)p.name,autoname,5)==0) 2ebfa: 45 e0 ldi r20, 0x05 ; 5 2ebfc: 50 e0 ldi r21, 0x00 ; 0 2ebfe: b8 01 movw r22, r16 2ec00: c7 01 movw r24, r14 2ec02: 0f 94 49 e2 call 0x3c492 ; 0x3c492 2ec06: 89 2b or r24, r25 2ec08: 09 f0 breq .+2 ; 0x2ec0c 2ec0a: bd cf rjmp .-134 ; 0x2eb86 { // M23: Select SD file enquecommandf_P(MSG_M23, autoname); 2ec0c: 1f 93 push r17 2ec0e: 0f 93 push r16 2ec10: df 92 push r13 2ec12: cf 92 push r12 2ec14: 0e 94 ce 88 call 0x1119c ; 0x1119c // M24: Start/resume SD print enquecommand_P(MSG_M24); 2ec18: 61 e0 ldi r22, 0x01 ; 1 2ec1a: 81 e3 ldi r24, 0x31 ; 49 2ec1c: 91 e7 ldi r25, 0x71 ; 113 2ec1e: 0e 94 38 88 call 0x11070 ; 0x11070 2ec22: 0f 90 pop r0 2ec24: 0f 90 pop r0 2ec26: 0f 90 pop r0 2ec28: 0f 90 pop r0 found=true; 2ec2a: aa 24 eor r10, r10 2ec2c: a3 94 inc r10 2ec2e: ab cf rjmp .-170 ; 0x2eb86 } } if(!found) lastnr=-1; 2ec30: 8f ef ldi r24, 0xFF ; 255 2ec32: 9f ef ldi r25, 0xFF ; 255 // M24: Start/resume SD print enquecommand_P(MSG_M24); found=true; } } if(!found) 2ec34: aa 20 and r10, r10 2ec36: 29 f0 breq .+10 ; 0x2ec42 lastnr=-1; else lastnr++; 2ec38: 80 91 dc 14 lds r24, 0x14DC ; 0x8014dc 2ec3c: 90 91 dd 14 lds r25, 0x14DD ; 0x8014dd 2ec40: 01 96 adiw r24, 0x01 ; 1 2ec42: 90 93 dd 14 sts 0x14DD, r25 ; 0x8014dd 2ec46: 80 93 dc 14 sts 0x14DC, r24 ; 0x8014dc } 2ec4a: ee 96 adiw r28, 0x3e ; 62 2ec4c: 0f b6 in r0, 0x3f ; 63 2ec4e: f8 94 cli 2ec50: de bf out 0x3e, r29 ; 62 2ec52: 0f be out 0x3f, r0 ; 63 2ec54: cd bf out 0x3d, r28 ; 61 2ec56: df 91 pop r29 2ec58: cf 91 pop r28 2ec5a: 1f 91 pop r17 2ec5c: 0f 91 pop r16 2ec5e: ff 90 pop r15 2ec60: ef 90 pop r14 2ec62: df 90 pop r13 2ec64: cf 90 pop r12 2ec66: bf 90 pop r11 2ec68: af 90 pop r10 2ec6a: 9f 90 pop r9 2ec6c: 8f 90 pop r8 2ec6e: 08 95 ret 0002ec70 : * \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) { 2ec70: 8f 92 push r8 2ec72: 9f 92 push r9 2ec74: af 92 push r10 2ec76: bf 92 push r11 2ec78: cf 92 push r12 2ec7a: df 92 push r13 2ec7c: ef 92 push r14 2ec7e: ff 92 push r15 2ec80: 0f 93 push r16 2ec82: 1f 93 push r17 2ec84: cf 93 push r28 2ec86: df 93 push r29 2ec88: 00 d0 rcall .+0 ; 0x2ec8a 2ec8a: 1f 92 push r1 2ec8c: cd b7 in r28, 0x3d ; 61 2ec8e: de b7 in r29, 0x3e ; 62 2ec90: fc 01 movw r30, r24 uint32_t newPos; // error if not a normal file or read-only if (!isFile() || !(flags_ & O_WRITE)) goto fail; 2ec92: 83 81 ldd r24, Z+3 ; 0x03 2ec94: 81 30 cpi r24, 0x01 ; 1 2ec96: 11 f0 breq .+4 ; 0x2ec9c // set file to correct position return seekSet(newPos); fail: return false; 2ec98: 80 e0 ldi r24, 0x00 ; 0 2ec9a: 60 c0 rjmp .+192 ; 0x2ed5c * \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; 2ec9c: 81 81 ldd r24, Z+1 ; 0x01 2ec9e: 81 ff sbrs r24, 1 2eca0: fb cf rjmp .-10 ; 0x2ec98 // 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; 2eca2: 81 89 ldd r24, Z+17 ; 0x11 2eca4: 92 89 ldd r25, Z+18 ; 0x12 2eca6: a3 89 ldd r26, Z+19 ; 0x13 2eca8: b4 89 ldd r27, Z+20 ; 0x14 2ecaa: 89 2b or r24, r25 2ecac: 8a 2b or r24, r26 2ecae: 8b 2b or r24, r27 2ecb0: 09 f4 brne .+2 ; 0x2ecb4 2ecb2: 6e c0 rjmp .+220 ; 0x2ed90 2ecb4: 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; 2ecb6: 40 e0 ldi r20, 0x00 ; 0 2ecb8: 50 e0 ldi r21, 0x00 ; 0 2ecba: ba 01 movw r22, r20 2ecbc: cf 01 movw r24, r30 2ecbe: 0f 94 4d 56 call 0x2ac9a ; 0x2ac9a 2ecc2: 88 23 and r24, r24 2ecc4: 49 f3 breq .-46 ; 0x2ec98 if (length == 0) { // free all clusters if (!vol_->freeChain(firstCluster_)) goto fail; 2ecc6: f7 01 movw r30, r14 2ecc8: c1 8c ldd r12, Z+25 ; 0x19 2ecca: d2 8c ldd r13, Z+26 ; 0x1a 2eccc: 85 88 ldd r8, Z+21 ; 0x15 2ecce: 96 88 ldd r9, Z+22 ; 0x16 2ecd0: a7 88 ldd r10, Z+23 ; 0x17 2ecd2: 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; 2ecd4: 82 e0 ldi r24, 0x02 ; 2 2ecd6: 90 e0 ldi r25, 0x00 ; 0 2ecd8: a0 e0 ldi r26, 0x00 ; 0 2ecda: b0 e0 ldi r27, 0x00 ; 0 2ecdc: f6 01 movw r30, r12 2ecde: 80 83 st Z, r24 2ece0: 91 83 std Z+1, r25 ; 0x01 2ece2: a2 83 std Z+2, r26 ; 0x02 2ece4: b3 83 std Z+3, r27 ; 0x03 do { if (!fatGet(cluster, &next)) goto fail; 2ece6: 9e 01 movw r18, r28 2ece8: 2f 5f subi r18, 0xFF ; 255 2ecea: 3f 4f sbci r19, 0xFF ; 255 2ecec: b5 01 movw r22, r10 2ecee: a4 01 movw r20, r8 2ecf0: c6 01 movw r24, r12 2ecf2: 0f 94 97 54 call 0x2a92e ; 0x2a92e 2ecf6: 88 23 and r24, r24 2ecf8: 79 f2 breq .-98 ; 0x2ec98 // free cluster if (!fatPut(cluster, 0)) goto fail; 2ecfa: 00 e0 ldi r16, 0x00 ; 0 2ecfc: 10 e0 ldi r17, 0x00 ; 0 2ecfe: 98 01 movw r18, r16 2ed00: b5 01 movw r22, r10 2ed02: a4 01 movw r20, r8 2ed04: c6 01 movw r24, r12 2ed06: 0f 94 05 54 call 0x2a80a ; 0x2a80a 2ed0a: 88 23 and r24, r24 2ed0c: 29 f2 breq .-118 ; 0x2ec98 cluster = next; 2ed0e: 89 80 ldd r8, Y+1 ; 0x01 2ed10: 9a 80 ldd r9, Y+2 ; 0x02 2ed12: ab 80 ldd r10, Y+3 ; 0x03 2ed14: 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; 2ed16: f6 01 movw r30, r12 2ed18: 87 89 ldd r24, Z+23 ; 0x17 2ed1a: 80 31 cpi r24, 0x10 ; 16 2ed1c: 81 f5 brne .+96 ; 0x2ed7e 2ed1e: f8 ef ldi r31, 0xF8 ; 248 2ed20: 8f 16 cp r8, r31 2ed22: ff ef ldi r31, 0xFF ; 255 2ed24: 9f 06 cpc r9, r31 2ed26: a1 04 cpc r10, r1 2ed28: b1 04 cpc r11, r1 2ed2a: e8 f2 brcs .-70 ; 0x2ece6 firstCluster_ = 0; 2ed2c: f7 01 movw r30, r14 2ed2e: 15 8a std Z+21, r1 ; 0x15 2ed30: 16 8a std Z+22, r1 ; 0x16 2ed32: 17 8a std Z+23, r1 ; 0x17 2ed34: 10 8e std Z+24, r1 ; 0x18 // current cluster is end of chain if (!vol_->fatPutEOC(curCluster_)) goto fail; } } fileSize_ = length; 2ed36: 11 8a std Z+17, r1 ; 0x11 2ed38: 12 8a std Z+18, r1 ; 0x12 2ed3a: 13 8a std Z+19, r1 ; 0x13 2ed3c: 14 8a std Z+20, r1 ; 0x14 // need to update directory entry flags_ |= F_FILE_DIR_DIRTY; 2ed3e: 81 81 ldd r24, Z+1 ; 0x01 2ed40: 80 68 ori r24, 0x80 ; 128 2ed42: 81 83 std Z+1, r24 ; 0x01 if (!sync()) goto fail; 2ed44: c7 01 movw r24, r14 2ed46: 0f 94 f6 57 call 0x2afec ; 0x2afec 2ed4a: 88 23 and r24, r24 2ed4c: 09 f4 brne .+2 ; 0x2ed50 2ed4e: a4 cf rjmp .-184 ; 0x2ec98 // set file to correct position return seekSet(newPos); 2ed50: 40 e0 ldi r20, 0x00 ; 0 2ed52: 50 e0 ldi r21, 0x00 ; 0 2ed54: ba 01 movw r22, r20 2ed56: c7 01 movw r24, r14 2ed58: 0f 94 4d 56 call 0x2ac9a ; 0x2ac9a fail: return false; } 2ed5c: 0f 90 pop r0 2ed5e: 0f 90 pop r0 2ed60: 0f 90 pop r0 2ed62: 0f 90 pop r0 2ed64: df 91 pop r29 2ed66: cf 91 pop r28 2ed68: 1f 91 pop r17 2ed6a: 0f 91 pop r16 2ed6c: ff 90 pop r15 2ed6e: ef 90 pop r14 2ed70: df 90 pop r13 2ed72: cf 90 pop r12 2ed74: bf 90 pop r11 2ed76: af 90 pop r10 2ed78: 9f 90 pop r9 2ed7a: 8f 90 pop r8 2ed7c: 08 95 ret return cluster >= FAT32EOC_MIN; 2ed7e: 88 ef ldi r24, 0xF8 ; 248 2ed80: 88 16 cp r8, r24 2ed82: 8f ef ldi r24, 0xFF ; 255 2ed84: 98 06 cpc r9, r24 2ed86: a8 06 cpc r10, r24 2ed88: 8f e0 ldi r24, 0x0F ; 15 2ed8a: b8 06 cpc r11, r24 2ed8c: 78 f6 brcc .-98 ; 0x2ed2c 2ed8e: ab cf rjmp .-170 ; 0x2ece6 // 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; 2ed90: 81 e0 ldi r24, 0x01 ; 1 2ed92: e4 cf rjmp .-56 ; 0x2ed5c 0002ed94 : +* 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) { 2ed94: 2f 92 push r2 2ed96: 3f 92 push r3 2ed98: 4f 92 push r4 2ed9a: 5f 92 push r5 2ed9c: 6f 92 push r6 2ed9e: 7f 92 push r7 2eda0: 8f 92 push r8 2eda2: 9f 92 push r9 2eda4: af 92 push r10 2eda6: bf 92 push r11 2eda8: cf 92 push r12 2edaa: df 92 push r13 2edac: ef 92 push r14 2edae: ff 92 push r15 2edb0: 0f 93 push r16 2edb2: 1f 93 push r17 2edb4: cf 93 push r28 2edb6: df 93 push r29 2edb8: cd b7 in r28, 0x3d ; 61 2edba: de b7 in r29, 0x3e ; 62 2edbc: c6 57 subi r28, 0x76 ; 118 2edbe: d1 09 sbc r29, r1 2edc0: 0f b6 in r0, 0x3f ; 63 2edc2: f8 94 cli 2edc4: de bf out 0x3e, r29 ; 62 2edc6: 0f be out 0x3f, r0 ; 63 2edc8: cd bf out 0x3d, r28 ; 61 2edca: 4c 01 movw r8, r24 2edcc: 6b 01 movw r12, r22 2edce: 3a 01 movw r6, r20 2edd0: e5 96 adiw r28, 0x35 ; 53 2edd2: 2f af std Y+63, r18 ; 0x3f 2edd4: e5 97 sbiw r28, 0x35 ; 53 2edd6: 50 2e mov r5, r16 cnt++; break; } } } // while readDir } 2edd8: 2d b6 in r2, 0x3d ; 61 2edda: 3e b6 in r3, 0x3e ; 62 2eddc: 10 2f mov r17, r16 2edde: 11 70 andi r17, 0x01 ; 1 static uint8_t recursionCnt = 0; // RAII incrementer for the recursionCnt class _incrementer { public: _incrementer() {recursionCnt++;} 2ede0: 80 91 9b 0e lds r24, 0x0E9B ; 0x800e9b 2ede4: 8f 5f subi r24, 0xFF ; 255 2ede6: 80 93 9b 0e sts 0x0E9B, r24 ; 0x800e9b } 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()) { 2edea: fb 01 movw r30, r22 2edec: 80 85 ldd r24, Z+8 ; 0x08 2edee: 91 85 ldd r25, Z+9 ; 0x09 2edf0: a2 85 ldd r26, Z+10 ; 0x0a 2edf2: b3 85 ldd r27, Z+11 ; 0x0b 2edf4: 80 93 a2 14 sts 0x14A2, r24 ; 0x8014a2 2edf8: 90 93 a3 14 sts 0x14A3, r25 ; 0x8014a3 2edfc: a0 93 a4 14 sts 0x14A4, r26 ; 0x8014a4 2ee00: b0 93 a5 14 sts 0x14A5, r27 ; 0x8014a5 _incrementer() {recursionCnt++;} ~_incrementer() {recursionCnt--;} } recursionCntIncrementer; dir_t p; uint8_t cnt = 0; 2ee04: 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); 2ee06: 5e 01 movw r10, r28 2ee08: f7 e6 ldi r31, 0x67 ; 103 2ee0a: af 0e add r10, r31 2ee0c: 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; 2ee0e: f6 01 movw r30, r12 2ee10: 83 81 ldd r24, Z+3 ; 0x03 2ee12: 82 30 cpi r24, 0x02 ; 2 2ee14: 08 f4 brcc .+2 ; 0x2ee18 2ee16: c0 c1 rjmp .+896 ; 0x2f198 2ee18: 80 85 ldd r24, Z+8 ; 0x08 2ee1a: 91 85 ldd r25, Z+9 ; 0x09 2ee1c: a2 85 ldd r26, Z+10 ; 0x0a 2ee1e: b3 85 ldd r27, Z+11 ; 0x0b 2ee20: 8f 71 andi r24, 0x1F ; 31 2ee22: 99 27 eor r25, r25 2ee24: aa 27 eor r26, r26 2ee26: bb 27 eor r27, r27 2ee28: 89 2b or r24, r25 2ee2a: 8a 2b or r24, r26 2ee2c: 8b 2b or r24, r27 2ee2e: 09 f0 breq .+2 ; 0x2ee32 2ee30: b3 c1 rjmp .+870 ; 0x2f198 //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'; 2ee32: 10 92 a6 14 sts 0x14A6, r1 ; 0x8014a6 2ee36: 46 ea ldi r20, 0xA6 ; 166 2ee38: 54 e1 ldi r21, 0x14 ; 20 2ee3a: be 01 movw r22, r28 2ee3c: 69 5b subi r22, 0xB9 ; 185 2ee3e: 7f 4f sbci r23, 0xFF ; 255 2ee40: c6 01 movw r24, r12 2ee42: 0f 94 8a 59 call 0x2b314 ; 0x2b314 } 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()) { 2ee46: 18 16 cp r1, r24 2ee48: 0c f0 brlt .+2 ; 0x2ee4c 2ee4a: a6 c1 rjmp .+844 ; 0x2f198 if (recursionCnt > MAX_DIR_DEPTH) 2ee4c: 80 91 9b 0e lds r24, 0x0E9B ; 0x800e9b 2ee50: 87 30 cpi r24, 0x07 ; 7 2ee52: 08 f0 brcs .+2 ; 0x2ee56 2ee54: a1 c1 rjmp .+834 ; 0x2f198 return; uint8_t pn0 = p.name[0]; 2ee56: 28 96 adiw r28, 0x08 ; 8 2ee58: 8f ad ldd r24, Y+63 ; 0x3f 2ee5a: 28 97 sbiw r28, 0x08 ; 8 if (pn0 == DIR_NAME_FREE) break; 2ee5c: 88 23 and r24, r24 2ee5e: 09 f4 brne .+2 ; 0x2ee62 2ee60: 9b c1 rjmp .+822 ; 0x2f198 if (pn0 == DIR_NAME_DELETED || pn0 == '.') continue; 2ee62: 85 3e cpi r24, 0xE5 ; 229 2ee64: 09 f4 brne .+2 ; 0x2ee68 2ee66: 39 c1 rjmp .+626 ; 0x2f0da 2ee68: 8e 32 cpi r24, 0x2E ; 46 2ee6a: 09 f4 brne .+2 ; 0x2ee6e 2ee6c: 36 c1 rjmp .+620 ; 0x2f0da if (longFilename[0] == '.') continue; 2ee6e: 80 91 a6 14 lds r24, 0x14A6 ; 0x8014a6 2ee72: 8e 32 cpi r24, 0x2E ; 46 2ee74: 09 f4 brne .+2 ; 0x2ee78 2ee76: 31 c1 rjmp .+610 ; 0x2f0da 2ee78: 63 96 adiw r28, 0x13 ; 19 2ee7a: 8f ad ldd r24, Y+63 ; 0x3f 2ee7c: 63 97 sbiw r28, 0x13 ; 19 if (!DIR_IS_FILE_OR_SUBDIR(&p) || (p.attributes & DIR_ATT_HIDDEN)) continue; 2ee7e: 98 2f mov r25, r24 2ee80: 9a 70 andi r25, 0x0A ; 10 2ee82: 09 f0 breq .+2 ; 0x2ee86 2ee84: 2a c1 rjmp .+596 ; 0x2f0da 2ee86: 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; 2ee88: 91 e0 ldi r25, 0x01 ; 1 2ee8a: 80 31 cpi r24, 0x10 ; 16 2ee8c: 19 f0 breq .+6 ; 0x2ee94 2ee8e: 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 2ee90: 80 31 cpi r24, 0x10 ; 16 2ee92: 31 f4 brne .+12 ; 0x2eea0 2ee94: e5 96 adiw r28, 0x35 ; 53 2ee96: ff ad ldd r31, Y+63 ; 0x3f 2ee98: e5 97 sbiw r28, 0x35 ; 53 2ee9a: ff 23 and r31, r31 2ee9c: 09 f4 brne .+2 ; 0x2eea0 2ee9e: 94 c0 rjmp .+296 ; 0x2efc8 if (lsParams.LFN) puts_P(PSTR("DIR_EXIT")); } else { filenameIsDir = DIR_IS_SUBDIR(&p); 2eea0: 90 93 db 14 sts 0x14DB, r25 ; 0x8014db if (!filenameIsDir && (p.name[8] != 'G' || p.name[9] == '~')) continue; 2eea4: 80 31 cpi r24, 0x10 ; 16 2eea6: 61 f0 breq .+24 ; 0x2eec0 2eea8: 60 96 adiw r28, 0x10 ; 16 2eeaa: 8f ad ldd r24, Y+63 ; 0x3f 2eeac: 60 97 sbiw r28, 0x10 ; 16 2eeae: 87 34 cpi r24, 0x47 ; 71 2eeb0: 09 f0 breq .+2 ; 0x2eeb4 2eeb2: 13 c1 rjmp .+550 ; 0x2f0da 2eeb4: 61 96 adiw r28, 0x11 ; 17 2eeb6: 8f ad ldd r24, Y+63 ; 0x3f 2eeb8: 61 97 sbiw r28, 0x11 ; 17 2eeba: 8e 37 cpi r24, 0x7E ; 126 2eebc: 09 f4 brne .+2 ; 0x2eec0 2eebe: 0d c1 rjmp .+538 ; 0x2f0da switch (lsAction) { 2eec0: e5 96 adiw r28, 0x35 ; 53 2eec2: ff ad ldd r31, Y+63 ; 0x3f 2eec4: e5 97 sbiw r28, 0x35 ; 53 2eec6: f1 30 cpi r31, 0x01 ; 1 2eec8: 09 f4 brne .+2 ; 0x2eecc 2eeca: 1b c1 rjmp .+566 ; 0x2f102 2eecc: f2 30 cpi r31, 0x02 ; 2 2eece: 09 f4 brne .+2 ; 0x2eed2 2eed0: 25 c1 rjmp .+586 ; 0x2f11c case LS_Count: nrFiles++; break; case LS_SerialPrint: createFilename(filename, p); 2eed2: be 01 movw r22, r28 2eed4: 69 5b subi r22, 0xB9 ; 185 2eed6: 7f 4f sbci r23, 0xFF ; 255 2eed8: 81 e9 ldi r24, 0x91 ; 145 2eeda: 94 e1 ldi r25, 0x14 ; 20 2eedc: 0e 94 2e 77 call 0xee5c ; 0xee5c 2eee0: c4 01 movw r24, r8 2eee2: 0e 94 2c 88 call 0x11058 ; 0x11058 2eee6: 81 e9 ldi r24, 0x91 ; 145 2eee8: 94 e1 ldi r25, 0x14 ; 20 2eeea: 0e 94 2c 88 call 0x11058 ; 0x11058 SERIAL_PROTOCOL(prepend); SERIAL_PROTOCOL(filename); MYSERIAL.write(' '); 2eeee: 80 e2 ldi r24, 0x20 ; 32 2eef0: 0e 94 4f 77 call 0xee9e ; 0xee9e } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 2eef4: a7 96 adiw r28, 0x27 ; 39 2eef6: 6c ad ldd r22, Y+60 ; 0x3c 2eef8: 7d ad ldd r23, Y+61 ; 0x3d 2eefa: 8e ad ldd r24, Y+62 ; 0x3e 2eefc: 9f ad ldd r25, Y+63 ; 0x3f 2eefe: a7 97 sbiw r28, 0x27 ; 39 2ef00: 4a e0 ldi r20, 0x0A ; 10 2ef02: 0f 94 c1 d4 call 0x3a982 ; 0x3a982 SERIAL_PROTOCOL(p.fileSize); if (lsParams.timestamp) 2ef06: 51 fe sbrs r5, 1 2ef08: 45 c0 rjmp .+138 ; 0x2ef94 { crmodDate = p.lastWriteDate; 2ef0a: a1 96 adiw r28, 0x21 ; 33 2ef0c: 2e ad ldd r18, Y+62 ; 0x3e 2ef0e: 3f ad ldd r19, Y+63 ; 0x3f 2ef10: a1 97 sbiw r28, 0x21 ; 33 2ef12: 30 93 a1 14 sts 0x14A1, r19 ; 0x8014a1 2ef16: 20 93 a0 14 sts 0x14A0, r18 ; 0x8014a0 crmodTime = p.lastWriteTime; 2ef1a: 6f 96 adiw r28, 0x1f ; 31 2ef1c: 4e ad ldd r20, Y+62 ; 0x3e 2ef1e: 5f ad ldd r21, Y+63 ; 0x3f 2ef20: 6f 97 sbiw r28, 0x1f ; 31 2ef22: 50 93 9f 14 sts 0x149F, r21 ; 0x80149f 2ef26: 40 93 9e 14 sts 0x149E, r20 ; 0x80149e if( crmodDate < p.creationDate || ( crmodDate == p.creationDate && crmodTime < p.creationTime ) ){ 2ef2a: 69 96 adiw r28, 0x19 ; 25 2ef2c: 8e ad ldd r24, Y+62 ; 0x3e 2ef2e: 9f ad ldd r25, Y+63 ; 0x3f 2ef30: 69 97 sbiw r28, 0x19 ; 25 2ef32: 28 17 cp r18, r24 2ef34: 39 07 cpc r19, r25 2ef36: 50 f0 brcs .+20 ; 0x2ef4c 2ef38: 28 17 cp r18, r24 2ef3a: 39 07 cpc r19, r25 2ef3c: 99 f4 brne .+38 ; 0x2ef64 2ef3e: 67 96 adiw r28, 0x17 ; 23 2ef40: 2e ad ldd r18, Y+62 ; 0x3e 2ef42: 3f ad ldd r19, Y+63 ; 0x3f 2ef44: 67 97 sbiw r28, 0x17 ; 23 2ef46: 42 17 cp r20, r18 2ef48: 53 07 cpc r21, r19 2ef4a: 60 f4 brcc .+24 ; 0x2ef64 crmodDate = p.creationDate; 2ef4c: 90 93 a1 14 sts 0x14A1, r25 ; 0x8014a1 2ef50: 80 93 a0 14 sts 0x14A0, r24 ; 0x8014a0 crmodTime = p.creationTime; 2ef54: 67 96 adiw r28, 0x17 ; 23 2ef56: 8e ad ldd r24, Y+62 ; 0x3e 2ef58: 9f ad ldd r25, Y+63 ; 0x3f 2ef5a: 67 97 sbiw r28, 0x17 ; 23 2ef5c: 90 93 9f 14 sts 0x149F, r25 ; 0x80149f 2ef60: 80 93 9e 14 sts 0x149E, r24 ; 0x80149e } printf_P(PSTR(" %#lx"), ((uint32_t)crmodDate << 16) | crmodTime); 2ef64: 80 91 a1 14 lds r24, 0x14A1 ; 0x8014a1 2ef68: 8f 93 push r24 2ef6a: 80 91 a0 14 lds r24, 0x14A0 ; 0x8014a0 2ef6e: 8f 93 push r24 2ef70: 80 91 9f 14 lds r24, 0x149F ; 0x80149f 2ef74: 8f 93 push r24 2ef76: 80 91 9e 14 lds r24, 0x149E ; 0x80149e 2ef7a: 8f 93 push r24 2ef7c: 2b e4 ldi r18, 0x4B ; 75 2ef7e: 3b ea ldi r19, 0xAB ; 171 2ef80: 3f 93 push r19 2ef82: 2f 93 push r18 2ef84: 0f 94 99 da call 0x3b532 ; 0x3b532 2ef88: 0f 90 pop r0 2ef8a: 0f 90 pop r0 2ef8c: 0f 90 pop r0 2ef8e: 0f 90 pop r0 2ef90: 0f 90 pop r0 2ef92: 0f 90 pop r0 } if (lsParams.LFN) 2ef94: 11 23 and r17, r17 2ef96: 99 f0 breq .+38 ; 0x2efbe printf_P(PSTR(" \"%s\""), LONGEST_FILENAME); 2ef98: 80 91 a6 14 lds r24, 0x14A6 ; 0x8014a6 2ef9c: 88 23 and r24, r24 2ef9e: 09 f4 brne .+2 ; 0x2efa2 2efa0: ba c0 rjmp .+372 ; 0x2f116 2efa2: 86 ea ldi r24, 0xA6 ; 166 2efa4: 94 e1 ldi r25, 0x14 ; 20 2efa6: 9f 93 push r25 2efa8: 8f 93 push r24 2efaa: e5 e4 ldi r30, 0x45 ; 69 2efac: fb ea ldi r31, 0xAB ; 171 2efae: ff 93 push r31 2efb0: ef 93 push r30 2efb2: 0f 94 99 da call 0x3b532 ; 0x3b532 2efb6: 0f 90 pop r0 2efb8: 0f 90 pop r0 2efba: 0f 90 pop r0 2efbc: 0f 90 pop r0 SERIAL_PROTOCOLLN(); 2efbe: 0f 94 b8 d5 call 0x3ab70 ; 0x3ab70 manage_heater(); 2efc2: 0f 94 2e 38 call 0x2705c ; 0x2705c 2efc6: 89 c0 rjmp .+274 ; 0x2f0da } lsDive(path, dir, NULL, lsAction, lsParams); // close() is done automatically by destructor of SdFile if (lsParams.LFN) puts_P(PSTR("DIR_EXIT")); 2efc8: 2d b7 in r18, 0x3d ; 61 2efca: 3e b7 in r19, 0x3e ; 62 2efcc: e7 96 adiw r28, 0x37 ; 55 2efce: 3f af std Y+63, r19 ; 0x3f 2efd0: 2e af std Y+62, r18 ; 0x3e 2efd2: 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); 2efd4: be 01 movw r22, r28 2efd6: 69 5b subi r22, 0xB9 ; 185 2efd8: 7f 4f sbci r23, 0xFF ; 255 2efda: c5 01 movw r24, r10 2efdc: 0e 94 2e 77 call 0xee5c ; 0xee5c // Allocate enough stack space for the full path to a folder, trailing slash, and nul bool prepend_is_empty = (prepend[0] == '\0'); 2efe0: f4 01 movw r30, r8 2efe2: 80 81 ld r24, Z int len = (prepend_is_empty ? 1 : strlen(prepend)) + strlen(lfilename) + 1 + 1; 2efe4: 88 23 and r24, r24 2efe6: 09 f4 brne .+2 ; 0x2efea 2efe8: 86 c0 rjmp .+268 ; 0x2f0f6 2efea: 01 90 ld r0, Z+ 2efec: 00 20 and r0, r0 2efee: e9 f7 brne .-6 ; 0x2efea 2eff0: 31 97 sbiw r30, 0x01 ; 1 2eff2: e8 19 sub r30, r8 2eff4: f9 09 sbc r31, r9 2eff6: d5 01 movw r26, r10 2eff8: 0d 90 ld r0, X+ 2effa: 00 20 and r0, r0 2effc: e9 f7 brne .-6 ; 0x2eff8 2effe: ea 19 sub r30, r10 2f000: fb 09 sbc r31, r11 char path[len]; 2f002: ea 0f add r30, r26 2f004: fb 1f adc r31, r27 2f006: 31 96 adiw r30, 0x01 ; 1 2f008: 2d b7 in r18, 0x3d ; 61 2f00a: 3e b7 in r19, 0x3e ; 62 2f00c: 2e 1b sub r18, r30 2f00e: 3f 0b sbc r19, r31 2f010: 0f b6 in r0, 0x3f ; 63 2f012: f8 94 cli 2f014: 3e bf out 0x3e, r19 ; 62 2f016: 0f be out 0x3f, r0 ; 63 2f018: 2d bf out 0x3d, r18 ; 61 2f01a: ed b7 in r30, 0x3d ; 61 2f01c: fe b7 in r31, 0x3e ; 62 2f01e: 31 96 adiw r30, 0x01 ; 1 2f020: 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 2f022: 6b e1 ldi r22, 0x1B ; 27 2f024: 73 e0 ldi r23, 0x03 ; 3 2f026: 81 11 cpse r24, r1 2f028: b4 01 movw r22, r8 2f02a: c7 01 movw r24, r14 2f02c: 0f 94 42 e2 call 0x3c484 ; 0x3c484 strcat(path, lfilename); // FILENAME_LENGTH-1 characters maximum 2f030: b5 01 movw r22, r10 2f032: c7 01 movw r24, r14 2f034: 0f 94 23 e2 call 0x3c446 ; 0x3c446 strcat(path, "/"); // 1 character 2f038: 6b e1 ldi r22, 0x1B ; 27 2f03a: 73 e0 ldi r23, 0x03 ; 3 2f03c: c7 01 movw r24, r14 2f03e: 0f 94 23 e2 call 0x3c446 ; 0x3c446 // Serial.print(path); // Get a new directory object using the full path // and dive recursively into it. if (lsParams.LFN) 2f042: 11 23 and r17, r17 2f044: a9 f0 breq .+42 ; 0x2f070 printf_P(PSTR("DIR_ENTER: %s \"%s\"\n"), path, longFilename[0] ? longFilename : lfilename); 2f046: 80 91 a6 14 lds r24, 0x14A6 ; 0x8014a6 2f04a: 81 11 cpse r24, r1 2f04c: 57 c0 rjmp .+174 ; 0x2f0fc 2f04e: c5 01 movw r24, r10 2f050: 9f 93 push r25 2f052: 8f 93 push r24 2f054: ff 92 push r15 2f056: ef 92 push r14 2f058: 2a e5 ldi r18, 0x5A ; 90 2f05a: 3b ea ldi r19, 0xAB ; 171 2f05c: 3f 93 push r19 2f05e: 2f 93 push r18 2f060: 0f 94 99 da call 0x3b532 ; 0x3b532 2f064: 0f 90 pop r0 2f066: 0f 90 pop r0 2f068: 0f 90 pop r0 2f06a: 0f 90 pop r0 2f06c: 0f 90 pop r0 2f06e: 0f 90 pop r0 * \brief Base class for SdFile with Print and C++ streams. */ class SdBaseFile { public: /** Create an instance. */ SdBaseFile() : writeError(false), type_(FAT_FILE_TYPE_CLOSED) {} 2f070: 1c a2 std Y+36, r1 ; 0x24 2f072: 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); 2f074: 21 e0 ldi r18, 0x01 ; 1 2f076: a5 01 movw r20, r10 2f078: b6 01 movw r22, r12 2f07a: ce 01 movw r24, r28 2f07c: 84 96 adiw r24, 0x24 ; 36 2f07e: 0f 94 d3 63 call 0x2c7a6 ; 0x2c7a6 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); 2f082: 83 e2 ldi r24, 0x23 ; 35 2f084: fe 01 movw r30, r28 2f086: b4 96 adiw r30, 0x24 ; 36 2f088: de 01 movw r26, r28 2f08a: 11 96 adiw r26, 0x01 ; 1 2f08c: 01 90 ld r0, Z+ 2f08e: 0d 92 st X+, r0 2f090: 8a 95 dec r24 2f092: e1 f7 brne .-8 ; 0x2f08c 2f094: 10 fb bst r17, 0 2f096: 50 f8 bld r5, 0 2f098: 05 2d mov r16, r5 2f09a: 20 e0 ldi r18, 0x00 ; 0 2f09c: 50 e0 ldi r21, 0x00 ; 0 2f09e: 40 e0 ldi r20, 0x00 ; 0 2f0a0: be 01 movw r22, r28 2f0a2: 6f 5f subi r22, 0xFF ; 255 2f0a4: 7f 4f sbci r23, 0xFF ; 255 2f0a6: c7 01 movw r24, r14 2f0a8: 0f 94 ca 76 call 0x2ed94 ; 0x2ed94 2f0ac: ce 01 movw r24, r28 2f0ae: 01 96 adiw r24, 0x01 ; 1 2f0b0: 0e 94 49 77 call 0xee92 ; 0xee92 // close() is done automatically by destructor of SdFile if (lsParams.LFN) 2f0b4: 11 23 and r17, r17 2f0b6: 21 f0 breq .+8 ; 0x2f0c0 puts_P(PSTR("DIR_EXIT")); 2f0b8: 81 e5 ldi r24, 0x51 ; 81 2f0ba: 9b ea ldi r25, 0xAB ; 171 2f0bc: 0f 94 c0 da call 0x3b580 ; 0x3b580 2f0c0: ce 01 movw r24, r28 2f0c2: 84 96 adiw r24, 0x24 ; 36 2f0c4: 0e 94 49 77 call 0xee92 ; 0xee92 2f0c8: e7 96 adiw r28, 0x37 ; 55 2f0ca: ee ad ldd r30, Y+62 ; 0x3e 2f0cc: ff ad ldd r31, Y+63 ; 0x3f 2f0ce: e7 97 sbiw r28, 0x37 ; 55 2f0d0: 0f b6 in r0, 0x3f ; 63 2f0d2: f8 94 cli 2f0d4: fe bf out 0x3e, r31 ; 62 2f0d6: 0f be out 0x3f, r0 ; 63 2f0d8: 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()) { 2f0da: f6 01 movw r30, r12 2f0dc: 80 85 ldd r24, Z+8 ; 0x08 2f0de: 91 85 ldd r25, Z+9 ; 0x09 2f0e0: a2 85 ldd r26, Z+10 ; 0x0a 2f0e2: b3 85 ldd r27, Z+11 ; 0x0b 2f0e4: 80 93 a2 14 sts 0x14A2, r24 ; 0x8014a2 2f0e8: 90 93 a3 14 sts 0x14A3, r25 ; 0x8014a3 2f0ec: a0 93 a4 14 sts 0x14A4, r26 ; 0x8014a4 2f0f0: b0 93 a5 14 sts 0x14A5, r27 ; 0x8014a5 2f0f4: 8c ce rjmp .-744 ; 0x2ee0e // 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; 2f0f6: e1 e0 ldi r30, 0x01 ; 1 2f0f8: f0 e0 ldi r31, 0x00 ; 0 2f0fa: 7d cf rjmp .-262 ; 0x2eff6 // 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); 2f0fc: 86 ea ldi r24, 0xA6 ; 166 2f0fe: 94 e1 ldi r25, 0x14 ; 20 2f100: a7 cf rjmp .-178 ; 0x2f050 else { filenameIsDir = DIR_IS_SUBDIR(&p); if (!filenameIsDir && (p.name[8] != 'G' || p.name[9] == '~')) continue; switch (lsAction) { case LS_Count: nrFiles++; 2f102: 80 91 a7 17 lds r24, 0x17A7 ; 0x8017a7 2f106: 90 91 a8 17 lds r25, 0x17A8 ; 0x8017a8 2f10a: 01 96 adiw r24, 0x01 ; 1 2f10c: 90 93 a8 17 sts 0x17A8, r25 ; 0x8017a8 2f110: 80 93 a7 17 sts 0x17A7, r24 ; 0x8017a7 2f114: e2 cf rjmp .-60 ; 0x2f0da } printf_P(PSTR(" %#lx"), ((uint32_t)crmodDate << 16) | crmodTime); } if (lsParams.LFN) printf_P(PSTR(" \"%s\""), LONGEST_FILENAME); 2f116: 81 e9 ldi r24, 0x91 ; 145 2f118: 94 e1 ldi r25, 0x14 ; 20 2f11a: 45 cf rjmp .-374 ; 0x2efa6 manage_heater(); break; case LS_GetFilename: //SERIAL_ECHOPGM("File: "); createFilename(filename, p); 2f11c: be 01 movw r22, r28 2f11e: 69 5b subi r22, 0xB9 ; 185 2f120: 7f 4f sbci r23, 0xFF ; 255 2f122: 81 e9 ldi r24, 0x91 ; 145 2f124: 94 e1 ldi r25, 0x14 ; 20 2f126: 0e 94 2e 77 call 0xee5c ; 0xee5c SERIAL_ECHOPGM("Creation date: "); MYSERIAL.println(p.creationDate); SERIAL_ECHOPGM("Access date: "); MYSERIAL.println(p.lastAccessDate); SERIAL_ECHOLNPGM("");*/ crmodDate = p.lastWriteDate; 2f12a: a1 96 adiw r28, 0x21 ; 33 2f12c: 2e ad ldd r18, Y+62 ; 0x3e 2f12e: 3f ad ldd r19, Y+63 ; 0x3f 2f130: a1 97 sbiw r28, 0x21 ; 33 2f132: 30 93 a1 14 sts 0x14A1, r19 ; 0x8014a1 2f136: 20 93 a0 14 sts 0x14A0, r18 ; 0x8014a0 crmodTime = p.lastWriteTime; 2f13a: 6f 96 adiw r28, 0x1f ; 31 2f13c: 4e ad ldd r20, Y+62 ; 0x3e 2f13e: 5f ad ldd r21, Y+63 ; 0x3f 2f140: 6f 97 sbiw r28, 0x1f ; 31 2f142: 50 93 9f 14 sts 0x149F, r21 ; 0x80149f 2f146: 40 93 9e 14 sts 0x149E, r20 ; 0x80149e // 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 ) ){ 2f14a: 69 96 adiw r28, 0x19 ; 25 2f14c: 8e ad ldd r24, Y+62 ; 0x3e 2f14e: 9f ad ldd r25, Y+63 ; 0x3f 2f150: 69 97 sbiw r28, 0x19 ; 25 2f152: 28 17 cp r18, r24 2f154: 39 07 cpc r19, r25 2f156: 50 f0 brcs .+20 ; 0x2f16c 2f158: 28 17 cp r18, r24 2f15a: 39 07 cpc r19, r25 2f15c: 99 f4 brne .+38 ; 0x2f184 2f15e: 67 96 adiw r28, 0x17 ; 23 2f160: 2e ad ldd r18, Y+62 ; 0x3e 2f162: 3f ad ldd r19, Y+63 ; 0x3f 2f164: 67 97 sbiw r28, 0x17 ; 23 2f166: 42 17 cp r20, r18 2f168: 53 07 cpc r21, r19 2f16a: 60 f4 brcc .+24 ; 0x2f184 crmodDate = p.creationDate; 2f16c: 90 93 a1 14 sts 0x14A1, r25 ; 0x8014a1 2f170: 80 93 a0 14 sts 0x14A0, r24 ; 0x8014a0 crmodTime = p.creationTime; 2f174: 67 96 adiw r28, 0x17 ; 23 2f176: 8e ad ldd r24, Y+62 ; 0x3e 2f178: 9f ad ldd r25, Y+63 ; 0x3f 2f17a: 67 97 sbiw r28, 0x17 ; 23 2f17c: 90 93 9f 14 sts 0x149F, r25 ; 0x80149f 2f180: 80 93 9e 14 sts 0x149E, r24 ; 0x80149e } //writeDate = p.lastAccessDate; if (match != NULL) { 2f184: 61 14 cp r6, r1 2f186: 71 04 cpc r7, r1 2f188: 59 f1 breq .+86 ; 0x2f1e0 if (strcasecmp(match, filename) == 0) return; 2f18a: 61 e9 ldi r22, 0x91 ; 145 2f18c: 74 e1 ldi r23, 0x14 ; 20 2f18e: c3 01 movw r24, r6 2f190: 0f 94 10 e2 call 0x3c420 ; 0x3c420 2f194: 89 2b or r24, r25 2f196: 59 f5 brne .+86 ; 0x2f1ee // RAII incrementer for the recursionCnt class _incrementer { public: _incrementer() {recursionCnt++;} ~_incrementer() {recursionCnt--;} 2f198: 80 91 9b 0e lds r24, 0x0E9B ; 0x800e9b 2f19c: 81 50 subi r24, 0x01 ; 1 2f19e: 80 93 9b 0e sts 0x0E9B, r24 ; 0x800e9b cnt++; break; } } } // while readDir } 2f1a2: 0f b6 in r0, 0x3f ; 63 2f1a4: f8 94 cli 2f1a6: 3e be out 0x3e, r3 ; 62 2f1a8: 0f be out 0x3f, r0 ; 63 2f1aa: 2d be out 0x3d, r2 ; 61 2f1ac: ca 58 subi r28, 0x8A ; 138 2f1ae: df 4f sbci r29, 0xFF ; 255 2f1b0: 0f b6 in r0, 0x3f ; 63 2f1b2: f8 94 cli 2f1b4: de bf out 0x3e, r29 ; 62 2f1b6: 0f be out 0x3f, r0 ; 63 2f1b8: cd bf out 0x3d, r28 ; 61 2f1ba: df 91 pop r29 2f1bc: cf 91 pop r28 2f1be: 1f 91 pop r17 2f1c0: 0f 91 pop r16 2f1c2: ff 90 pop r15 2f1c4: ef 90 pop r14 2f1c6: df 90 pop r13 2f1c8: cf 90 pop r12 2f1ca: bf 90 pop r11 2f1cc: af 90 pop r10 2f1ce: 9f 90 pop r9 2f1d0: 8f 90 pop r8 2f1d2: 7f 90 pop r7 2f1d4: 6f 90 pop r6 2f1d6: 5f 90 pop r5 2f1d8: 4f 90 pop r4 2f1da: 3f 90 pop r3 2f1dc: 2f 90 pop r2 2f1de: 08 95 ret } //writeDate = p.lastAccessDate; if (match != NULL) { if (strcasecmp(match, filename) == 0) return; } else if (cnt == nrFiles) return; 2f1e0: 80 91 a7 17 lds r24, 0x17A7 ; 0x8017a7 2f1e4: 90 91 a8 17 lds r25, 0x17A8 ; 0x8017a8 2f1e8: 48 16 cp r4, r24 2f1ea: 19 06 cpc r1, r25 2f1ec: a9 f2 breq .-86 ; 0x2f198 cnt++; 2f1ee: 43 94 inc r4 2f1f0: 74 cf rjmp .-280 ; 0x2f0da 0002f1f2 : } } void CardReader::getfilename(uint16_t nr, const char * const match/*=NULL*/) 2f1f2: cf 92 push r12 2f1f4: df 92 push r13 2f1f6: ef 92 push r14 2f1f8: ff 92 push r15 2f1fa: 0f 93 push r16 2f1fc: cf 93 push r28 2f1fe: df 93 push r29 2f200: cd b7 in r28, 0x3d ; 61 2f202: de b7 in r29, 0x3e ; 62 2f204: a3 97 sbiw r28, 0x23 ; 35 2f206: 0f b6 in r0, 0x3f ; 63 2f208: f8 94 cli 2f20a: de bf out 0x3e, r29 ; 62 2f20c: 0f be out 0x3f, r0 ; 63 2f20e: cd bf out 0x3d, r28 ; 61 2f210: 6c 01 movw r12, r24 { curDir=&workDir; 2f212: 88 e3 ldi r24, 0x38 ; 56 2f214: e8 2e mov r14, r24 2f216: 85 e1 ldi r24, 0x15 ; 21 2f218: f8 2e mov r15, r24 2f21a: 8a e3 ldi r24, 0x3A ; 58 2f21c: 95 e1 ldi r25, 0x15 ; 21 2f21e: d7 01 movw r26, r14 2f220: 8d 93 st X+, r24 2f222: 9c 93 st X, r25 nrFiles=nr; 2f224: 10 92 a8 17 sts 0x17A8, r1 ; 0x8017a8 2f228: 10 92 a7 17 sts 0x17A7, r1 ; 0x8017a7 curDir->rewind(); 2f22c: 0e 94 44 77 call 0xee88 ; 0xee88 }; struct ls_param { bool LFN : 1; bool timestamp : 1; inline ls_param():LFN(0), timestamp(0) { } 2f230: 00 e0 ldi r16, 0x00 ; 0 2f232: 0e 7f andi r16, 0xFE ; 254 2f234: 0d 7f andi r16, 0xFD ; 253 lsDive("",*curDir,match, LS_GetFilename); 2f236: d7 01 movw r26, r14 2f238: ed 91 ld r30, X+ 2f23a: fc 91 ld r31, X 2f23c: 83 e2 ldi r24, 0x23 ; 35 2f23e: de 01 movw r26, r28 2f240: 11 96 adiw r26, 0x01 ; 1 2f242: 01 90 ld r0, Z+ 2f244: 0d 92 st X+, r0 2f246: 8a 95 dec r24 2f248: e1 f7 brne .-8 ; 0x2f242 2f24a: 22 e0 ldi r18, 0x02 ; 2 2f24c: a6 01 movw r20, r12 2f24e: be 01 movw r22, r28 2f250: 6f 5f subi r22, 0xFF ; 255 2f252: 7f 4f sbci r23, 0xFF ; 255 2f254: 86 ef ldi r24, 0xF6 ; 246 2f256: 92 e0 ldi r25, 0x02 ; 2 2f258: 0f 94 ca 76 call 0x2ed94 ; 0x2ed94 2f25c: ce 01 movw r24, r28 2f25e: 01 96 adiw r24, 0x01 ; 1 2f260: 0e 94 49 77 call 0xee92 ; 0xee92 } 2f264: a3 96 adiw r28, 0x23 ; 35 2f266: 0f b6 in r0, 0x3f ; 63 2f268: f8 94 cli 2f26a: de bf out 0x3e, r29 ; 62 2f26c: 0f be out 0x3f, r0 ; 63 2f26e: cd bf out 0x3d, r28 ; 61 2f270: df 91 pop r29 2f272: cf 91 pop r28 2f274: 0f 91 pop r16 2f276: ff 90 pop r15 2f278: ef 90 pop r14 2f27a: df 90 pop r13 2f27c: cf 90 pop r12 2f27e: 08 95 ret 0002f280 : void CardReader::getfilename_simple(uint16_t entry, const char * const match/*=NULL*/) 2f280: ef 92 push r14 2f282: ff 92 push r15 2f284: 0f 93 push r16 2f286: cf 93 push r28 2f288: df 93 push r29 2f28a: cd b7 in r28, 0x3d ; 61 2f28c: de b7 in r29, 0x3e ; 62 2f28e: a3 97 sbiw r28, 0x23 ; 35 2f290: 0f b6 in r0, 0x3f ; 63 2f292: f8 94 cli 2f294: de bf out 0x3e, r29 ; 62 2f296: 0f be out 0x3f, r0 ; 63 2f298: cd bf out 0x3d, r28 ; 61 { curDir = &workDir; 2f29a: 28 e3 ldi r18, 0x38 ; 56 2f29c: e2 2e mov r14, r18 2f29e: 25 e1 ldi r18, 0x15 ; 21 2f2a0: f2 2e mov r15, r18 2f2a2: 2a e3 ldi r18, 0x3A ; 58 2f2a4: 35 e1 ldi r19, 0x15 ; 21 2f2a6: d7 01 movw r26, r14 2f2a8: 2d 93 st X+, r18 2f2aa: 3c 93 st X, r19 nrFiles = 0; 2f2ac: 10 92 a8 17 sts 0x17A8, r1 ; 0x8017a8 2f2b0: 10 92 a7 17 sts 0x17A7, r1 ; 0x8017a7 curDir->seekSet((uint32_t)entry << 5); 2f2b4: b0 e0 ldi r27, 0x00 ; 0 2f2b6: a0 e0 ldi r26, 0x00 ; 0 2f2b8: ac 01 movw r20, r24 2f2ba: bd 01 movw r22, r26 2f2bc: e5 e0 ldi r30, 0x05 ; 5 2f2be: 44 0f add r20, r20 2f2c0: 55 1f adc r21, r21 2f2c2: 66 1f adc r22, r22 2f2c4: 77 1f adc r23, r23 2f2c6: ea 95 dec r30 2f2c8: d1 f7 brne .-12 ; 0x2f2be 2f2ca: c9 01 movw r24, r18 2f2cc: 0f 94 4d 56 call 0x2ac9a ; 0x2ac9a 2f2d0: 00 e0 ldi r16, 0x00 ; 0 2f2d2: 0e 7f andi r16, 0xFE ; 254 2f2d4: 0d 7f andi r16, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 2f2d6: d7 01 movw r26, r14 2f2d8: ed 91 ld r30, X+ 2f2da: fc 91 ld r31, X 2f2dc: 83 e2 ldi r24, 0x23 ; 35 2f2de: de 01 movw r26, r28 2f2e0: 11 96 adiw r26, 0x01 ; 1 2f2e2: 01 90 ld r0, Z+ 2f2e4: 0d 92 st X+, r0 2f2e6: 8a 95 dec r24 2f2e8: e1 f7 brne .-8 ; 0x2f2e2 2f2ea: 22 e0 ldi r18, 0x02 ; 2 2f2ec: 50 e0 ldi r21, 0x00 ; 0 2f2ee: 40 e0 ldi r20, 0x00 ; 0 2f2f0: be 01 movw r22, r28 2f2f2: 6f 5f subi r22, 0xFF ; 255 2f2f4: 7f 4f sbci r23, 0xFF ; 255 2f2f6: 86 ef ldi r24, 0xF6 ; 246 2f2f8: 92 e0 ldi r25, 0x02 ; 2 2f2fa: 0f 94 ca 76 call 0x2ed94 ; 0x2ed94 2f2fe: ce 01 movw r24, r28 2f300: 01 96 adiw r24, 0x01 ; 1 2f302: 0e 94 49 77 call 0xee92 ; 0xee92 } 2f306: a3 96 adiw r28, 0x23 ; 35 2f308: 0f b6 in r0, 0x3f ; 63 2f30a: f8 94 cli 2f30c: de bf out 0x3e, r29 ; 62 2f30e: 0f be out 0x3f, r0 ; 63 2f310: cd bf out 0x3d, r28 ; 61 2f312: df 91 pop r29 2f314: cf 91 pop r28 2f316: 0f 91 pop r16 2f318: ff 90 pop r15 2f31a: ef 90 pop r14 2f31c: 08 95 ret 0002f31e : nrFiles = 1; curDir->seekSet(position); lsDive("", *curDir, match, LS_GetFilename); } uint16_t CardReader::getnrfilenames() 2f31e: cf 92 push r12 2f320: df 92 push r13 2f322: ef 92 push r14 2f324: ff 92 push r15 2f326: 0f 93 push r16 2f328: cf 93 push r28 2f32a: df 93 push r29 2f32c: cd b7 in r28, 0x3d ; 61 2f32e: de b7 in r29, 0x3e ; 62 2f330: a3 97 sbiw r28, 0x23 ; 35 2f332: 0f b6 in r0, 0x3f ; 63 2f334: f8 94 cli 2f336: de bf out 0x3e, r29 ; 62 2f338: 0f be out 0x3f, r0 ; 63 2f33a: cd bf out 0x3d, r28 ; 61 { curDir=&workDir; 2f33c: 88 e3 ldi r24, 0x38 ; 56 2f33e: c8 2e mov r12, r24 2f340: 85 e1 ldi r24, 0x15 ; 21 2f342: d8 2e mov r13, r24 2f344: 8a e3 ldi r24, 0x3A ; 58 2f346: 95 e1 ldi r25, 0x15 ; 21 2f348: d6 01 movw r26, r12 2f34a: 8d 93 st X+, r24 2f34c: 9c 93 st X, r25 nrFiles=0; 2f34e: 27 ea ldi r18, 0xA7 ; 167 2f350: e2 2e mov r14, r18 2f352: 27 e1 ldi r18, 0x17 ; 23 2f354: f2 2e mov r15, r18 2f356: f7 01 movw r30, r14 2f358: 11 82 std Z+1, r1 ; 0x01 2f35a: 10 82 st Z, r1 curDir->rewind(); 2f35c: 0e 94 44 77 call 0xee88 ; 0xee88 2f360: 00 e0 ldi r16, 0x00 ; 0 2f362: 0e 7f andi r16, 0xFE ; 254 2f364: 0d 7f andi r16, 0xFD ; 253 lsDive("",*curDir, NULL, LS_Count); 2f366: d6 01 movw r26, r12 2f368: ed 91 ld r30, X+ 2f36a: fc 91 ld r31, X 2f36c: 83 e2 ldi r24, 0x23 ; 35 2f36e: de 01 movw r26, r28 2f370: 11 96 adiw r26, 0x01 ; 1 2f372: 01 90 ld r0, Z+ 2f374: 0d 92 st X+, r0 2f376: 8a 95 dec r24 2f378: e1 f7 brne .-8 ; 0x2f372 2f37a: 21 e0 ldi r18, 0x01 ; 1 2f37c: 50 e0 ldi r21, 0x00 ; 0 2f37e: 40 e0 ldi r20, 0x00 ; 0 2f380: be 01 movw r22, r28 2f382: 6f 5f subi r22, 0xFF ; 255 2f384: 7f 4f sbci r23, 0xFF ; 255 2f386: 86 ef ldi r24, 0xF6 ; 246 2f388: 92 e0 ldi r25, 0x02 ; 2 2f38a: 0f 94 ca 76 call 0x2ed94 ; 0x2ed94 2f38e: ce 01 movw r24, r28 2f390: 01 96 adiw r24, 0x01 ; 1 2f392: 0e 94 49 77 call 0xee92 ; 0xee92 //SERIAL_ECHOLN(nrFiles); return nrFiles; } 2f396: f7 01 movw r30, r14 2f398: 80 81 ld r24, Z 2f39a: 91 81 ldd r25, Z+1 ; 0x01 2f39c: a3 96 adiw r28, 0x23 ; 35 2f39e: 0f b6 in r0, 0x3f ; 63 2f3a0: f8 94 cli 2f3a2: de bf out 0x3e, r29 ; 62 2f3a4: 0f be out 0x3f, r0 ; 63 2f3a6: cd bf out 0x3d, r28 ; 61 2f3a8: df 91 pop r29 2f3aa: cf 91 pop r28 2f3ac: 0f 91 pop r16 2f3ae: ff 90 pop r15 2f3b0: ef 90 pop r14 2f3b2: df 90 pop r13 2f3b4: cf 90 pop r12 2f3b6: 08 95 ret 0002f3b8 : file.getFilename(t); else t[0]=0; } void CardReader::printAbsFilenameFast() 2f3b8: cf 93 push r28 2f3ba: df 93 push r29 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 2f3bc: 8f e2 ldi r24, 0x2F ; 47 2f3be: 0e 94 4f 77 call 0xee9e ; 0xee9e { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 2f3c2: c0 e0 ldi r28, 0x00 ; 0 { SERIAL_PROTOCOL(dir_names[i]); 2f3c4: d9 e0 ldi r29, 0x09 ; 9 } void CardReader::printAbsFilenameFast() { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 2f3c6: 80 91 2f 16 lds r24, 0x162F ; 0x80162f 2f3ca: c8 17 cp r28, r24 2f3cc: 60 f4 brcc .+24 ; 0x2f3e6 { SERIAL_PROTOCOL(dir_names[i]); 2f3ce: cd 9f mul r28, r29 2f3d0: c0 01 movw r24, r0 2f3d2: 11 24 eor r1, r1 2f3d4: 81 52 subi r24, 0x21 ; 33 2f3d6: 9b 4e sbci r25, 0xEB ; 235 2f3d8: 0e 94 2c 88 call 0x11058 ; 0x11058 2f3dc: 8f e2 ldi r24, 0x2F ; 47 2f3de: 0e 94 4f 77 call 0xee9e ; 0xee9e } void CardReader::printAbsFilenameFast() { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 2f3e2: cf 5f subi r28, 0xFF ; 255 2f3e4: f0 cf rjmp .-32 ; 0x2f3c6 { SERIAL_PROTOCOL(dir_names[i]); SERIAL_PROTOCOL('/'); } SERIAL_PROTOCOL(LONGEST_FILENAME); 2f3e6: 80 91 a6 14 lds r24, 0x14A6 ; 0x8014a6 2f3ea: 81 11 cpse r24, r1 2f3ec: 06 c0 rjmp .+12 ; 0x2f3fa 2f3ee: 81 e9 ldi r24, 0x91 ; 145 2f3f0: 94 e1 ldi r25, 0x14 ; 20 } 2f3f2: df 91 pop r29 2f3f4: cf 91 pop r28 2f3f6: 0c 94 2c 88 jmp 0x11058 ; 0x11058 for (uint8_t i = 0; i < getWorkDirDepth(); i++) { SERIAL_PROTOCOL(dir_names[i]); SERIAL_PROTOCOL('/'); } SERIAL_PROTOCOL(LONGEST_FILENAME); 2f3fa: 86 ea ldi r24, 0xA6 ; 166 2f3fc: 94 e1 ldi r25, 0x14 ; 20 2f3fe: f9 cf rjmp .-14 ; 0x2f3f2 0002f400 : 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) { 2f400: cf 92 push r12 2f402: df 92 push r13 2f404: ef 92 push r14 2f406: ff 92 push r15 2f408: 6b 01 movw r12, r22 2f40a: 7c 01 movw r14, r24 eeprom_write_dword_notify(__p, eeprom_read_dword(__p) + add); 2f40c: 88 ea ldi r24, 0xA8 ; 168 2f40e: 9c e0 ldi r25, 0x0C ; 12 2f410: 0f 94 df db call 0x3b7be ; 0x3b7be 2f414: ab 01 movw r20, r22 2f416: bc 01 movw r22, r24 2f418: 4c 0d add r20, r12 2f41a: 5d 1d adc r21, r13 2f41c: 6e 1d adc r22, r14 2f41e: 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); 2f420: 88 ea ldi r24, 0xA8 ; 168 2f422: 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); } 2f424: ff 90 pop r15 2f426: ef 90 pop r14 2f428: df 90 pop r13 2f42a: 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); 2f42c: 0d 94 2d dc jmp 0x3b85a ; 0x3b85a 0002f430 : return def; } return val; } uint32_t __attribute__((noinline)) eeprom_init_default_dword(uint32_t *__p, uint32_t def) { 2f430: cf 93 push r28 2f432: df 93 push r29 2f434: ec 01 movw r28, r24 uint32_t val = eeprom_read_dword(__p); 2f436: 0f 94 df db call 0x3b7be ; 0x3b7be if (val == EEPROM_EMPTY_VALUE32) { 2f43a: 6f 3f cpi r22, 0xFF ; 255 2f43c: 2f ef ldi r18, 0xFF ; 255 2f43e: 72 07 cpc r23, r18 2f440: 82 07 cpc r24, r18 2f442: 92 07 cpc r25, r18 2f444: 49 f4 brne .+18 ; 0x2f458 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); 2f446: 40 e0 ldi r20, 0x00 ; 0 2f448: 50 e0 ldi r21, 0x00 ; 0 2f44a: ba 01 movw r22, r20 2f44c: ce 01 movw r24, r28 2f44e: 0f 94 2d dc call 0x3b85a ; 0x3b85a 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; 2f452: 60 e0 ldi r22, 0x00 ; 0 2f454: 70 e0 ldi r23, 0x00 ; 0 2f456: cb 01 movw r24, r22 } return val; } 2f458: df 91 pop r29 2f45a: cf 91 pop r28 2f45c: 08 95 ret 0002f45e : } // 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; 2f45e: e7 e2 ldi r30, 0x27 ; 39 2f460: f7 e1 ldi r31, 0x17 ; 23 2f462: 40 81 ld r20, Z 2f464: 51 81 ldd r21, Z+1 ; 0x01 2f466: 62 81 ldd r22, Z+2 ; 0x02 2f468: 73 81 ldd r23, Z+3 ; 0x03 2f46a: 48 0f add r20, r24 2f46c: 59 1f adc r21, r25 2f46e: 61 1d adc r22, r1 2f470: 71 1d adc r23, r1 2f472: 40 83 st Z, r20 2f474: 51 83 std Z+1, r21 ; 0x01 2f476: 62 83 std Z+2, r22 ; 0x02 2f478: 73 83 std Z+3, r23 ; 0x03 } 2f47a: 08 95 ret 0002f47c : // make the rdptr point to a safe location - end of file gfReadPtr = gfBlockBuffBegin() + 512; return -1; } bool SdFile::gfEnsureBlock(){ 2f47c: 0f 93 push r16 2f47e: 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_ ){ 2f480: 60 91 3c 17 lds r22, 0x173C ; 0x80173c 2f484: 70 91 3d 17 lds r23, 0x173D ; 0x80173d 2f488: 80 91 3e 17 lds r24, 0x173E ; 0x80173e 2f48c: 90 91 3f 17 lds r25, 0x173F ; 0x80173f 2f490: 00 91 90 0e lds r16, 0x0E90 ; 0x800e90 2f494: 10 91 91 0e lds r17, 0x0E91 ; 0x800e91 2f498: 20 91 92 0e lds r18, 0x0E92 ; 0x800e92 2f49c: 30 91 93 0e lds r19, 0x0E93 ; 0x800e93 2f4a0: 60 17 cp r22, r16 2f4a2: 71 07 cpc r23, r17 2f4a4: 82 07 cpc r24, r18 2f4a6: 93 07 cpc r25, r19 2f4a8: 39 f1 breq .+78 ; 0x2f4f8 if ( ! vol_->cacheRawBlock(gfBlock, SdVolume::CACHE_FOR_READ)){ 2f4aa: 40 e0 ldi r20, 0x00 ; 0 2f4ac: 0f 94 c8 53 call 0x2a790 ; 0x2a790 2f4b0: 88 23 and r24, r24 2f4b2: f9 f0 breq .+62 ; 0x2f4f2 return false; } // terminate with a '\n' const uint32_t terminateOfs = fileSize_ - gfOffset; 2f4b4: 20 91 40 17 lds r18, 0x1740 ; 0x801740 2f4b8: 30 91 41 17 lds r19, 0x1741 ; 0x801741 2f4bc: 40 91 30 17 lds r20, 0x1730 ; 0x801730 2f4c0: 50 91 31 17 lds r21, 0x1731 ; 0x801731 2f4c4: 60 91 32 17 lds r22, 0x1732 ; 0x801732 2f4c8: 70 91 33 17 lds r23, 0x1733 ; 0x801733 2f4cc: 42 1b sub r20, r18 2f4ce: 53 0b sbc r21, r19 2f4d0: 61 09 sbc r22, r1 2f4d2: 71 09 sbc r23, r1 vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; 2f4d4: 41 30 cpi r20, 0x01 ; 1 2f4d6: 92 e0 ldi r25, 0x02 ; 2 2f4d8: 59 07 cpc r21, r25 2f4da: 61 05 cpc r22, r1 2f4dc: 71 05 cpc r23, r1 2f4de: 20 f0 brcs .+8 ; 0x2f4e8 2f4e0: 40 e0 ldi r20, 0x00 ; 0 2f4e2: 52 e0 ldi r21, 0x02 ; 2 2f4e4: 60 e0 ldi r22, 0x00 ; 0 2f4e6: 70 e0 ldi r23, 0x00 ; 0 2f4e8: 44 56 subi r20, 0x64 ; 100 2f4ea: 51 4f sbci r21, 0xF1 ; 241 2f4ec: 9a e0 ldi r25, 0x0A ; 10 2f4ee: fa 01 movw r30, r20 2f4f0: 90 83 st Z, r25 } return true; } 2f4f2: 1f 91 pop r17 2f4f4: 0f 91 pop r16 2f4f6: 08 95 ret } // terminate with a '\n' const uint32_t terminateOfs = fileSize_ - gfOffset; vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; } return true; 2f4f8: 81 e0 ldi r24, 0x01 ; 1 2f4fa: fb cf rjmp .-10 ; 0x2f4f2 0002f4fc : } static uint8_t twi_start(uint8_t address, uint8_t reg) 2f4fc: cf 93 push r28 2f4fe: df 93 push r29 2f500: d8 2f mov r29, r24 { // send start condition TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTA); 2f502: 84 ea ldi r24, 0xA4 ; 164 2f504: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_START)) 2f508: 88 e0 ldi r24, 0x08 ; 8 2f50a: 0f 94 8f 29 call 0x2531e ; 0x2531e 2f50e: 81 11 cpse r24, r1 2f510: 16 c0 rjmp .+44 ; 0x2f53e return 1; // send address TWDR = TW_WRITE | (address << 1); 2f512: 8a ee ldi r24, 0xEA ; 234 2f514: 80 93 bb 00 sts 0x00BB, r24 ; 0x8000bb <__TEXT_REGION_LENGTH__+0x7c20bb> TWCR = _BV(TWEN) | _BV(TWINT); 2f518: c4 e8 ldi r28, 0x84 ; 132 2f51a: c0 93 bc 00 sts 0x00BC, r28 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_MT_SLA_ACK)) 2f51e: 88 e1 ldi r24, 0x18 ; 24 2f520: 0f 94 8f 29 call 0x2531e ; 0x2531e 2f524: 81 11 cpse r24, r1 2f526: 0f c0 rjmp .+30 ; 0x2f546 return 2; // send register TWDR = reg; 2f528: d0 93 bb 00 sts 0x00BB, r29 ; 0x8000bb <__TEXT_REGION_LENGTH__+0x7c20bb> TWCR = _BV(TWEN) | _BV(TWINT); 2f52c: c0 93 bc 00 sts 0x00BC, r28 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_MT_DATA_ACK)) 2f530: 88 e2 ldi r24, 0x28 ; 40 2f532: 0f 94 8f 29 call 0x2531e ; 0x2531e 2f536: 88 23 and r24, r24 2f538: 19 f0 breq .+6 ; 0x2f540 return 3; 2f53a: 83 e0 ldi r24, 0x03 ; 3 2f53c: 01 c0 rjmp .+2 ; 0x2f540 static uint8_t twi_start(uint8_t address, uint8_t reg) { // send start condition TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTA); if(twi_wait(TW_START)) return 1; 2f53e: 81 e0 ldi r24, 0x01 ; 1 TWCR = _BV(TWEN) | _BV(TWINT); if(twi_wait(TW_MT_DATA_ACK)) return 3; return 0; } 2f540: df 91 pop r29 2f542: cf 91 pop r28 2f544: 08 95 ret // send address TWDR = TW_WRITE | (address << 1); TWCR = _BV(TWEN) | _BV(TWINT); if(twi_wait(TW_MT_SLA_ACK)) return 2; 2f546: 82 e0 ldi r24, 0x02 ; 2 2f548: fb cf rjmp .-10 ; 0x2f540 0002f54a : ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { ret = stepCount; } return ret; } void PAT9125_sensor::resetStepCount() { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { stepCount = 0; } 2f54a: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 2f54c: f8 94 cli 2f54e: 10 92 bb 17 sts 0x17BB, r1 ; 0x8017bb 2f552: 10 92 ba 17 sts 0x17BA, r1 ; 0x8017ba (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 2f556: 8f bf out 0x3f, r24 ; 63 } 2f558: 08 95 ret 0002f55a : eeprom_update_byte_notify((uint8_t *)EEPROM_FSENSOR_ACTION_NA, (uint8_t)state); } } void Filament_sensor::settings_init_common() { bool enabled = eeprom_read_byte((uint8_t *)EEPROM_FSENSOR); 2f55a: 87 e6 ldi r24, 0x67 ; 103 2f55c: 9f e0 ldi r25, 0x0F ; 15 2f55e: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 2f562: 91 e0 ldi r25, 0x01 ; 1 2f564: 81 11 cpse r24, r1 2f566: 01 c0 rjmp .+2 ; 0x2f56a 2f568: 90 e0 ldi r25, 0x00 ; 0 if ((state != State::disabled) != enabled) { 2f56a: 81 e0 ldi r24, 0x01 ; 1 2f56c: 20 91 a9 17 lds r18, 0x17A9 ; 0x8017a9 2f570: 21 11 cpse r18, r1 2f572: 01 c0 rjmp .+2 ; 0x2f576 2f574: 80 e0 ldi r24, 0x00 ; 0 2f576: 98 13 cpse r25, r24 state = enabled ? State::initializing : State::disabled; 2f578: 90 93 a9 17 sts 0x17A9, r25 ; 0x8017a9 } autoLoadEnabled = eeprom_read_byte((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED); 2f57c: 87 e0 ldi r24, 0x07 ; 7 2f57e: 9f e0 ldi r25, 0x0F ; 15 2f580: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 2f584: 91 e0 ldi r25, 0x01 ; 1 2f586: 81 11 cpse r24, r1 2f588: 01 c0 rjmp .+2 ; 0x2f58c 2f58a: 90 e0 ldi r25, 0x00 ; 0 2f58c: 90 93 aa 17 sts 0x17AA, r25 ; 0x8017aa runoutEnabled = eeprom_read_byte((uint8_t *)EEPROM_FSENS_RUNOUT_ENABLED); 2f590: 85 ed ldi r24, 0xD5 ; 213 2f592: 9e e0 ldi r25, 0x0E ; 14 2f594: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 2f598: 91 e0 ldi r25, 0x01 ; 1 2f59a: 81 11 cpse r24, r1 2f59c: 01 c0 rjmp .+2 ; 0x2f5a0 2f59e: 90 e0 ldi r25, 0x00 ; 0 2f5a0: 90 93 ab 17 sts 0x17AB, r25 ; 0x8017ab sensorActionOnError = (SensorActionOnError)eeprom_read_byte((uint8_t *)EEPROM_FSENSOR_ACTION_NA); 2f5a4: 87 e4 ldi r24, 0x47 ; 71 2f5a6: 9d e0 ldi r25, 0x0D ; 13 2f5a8: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae if (sensorActionOnError == SensorActionOnError::_Undef) { 2f5ac: 8f 3f cpi r24, 0xFF ; 255 2f5ae: c9 f0 breq .+50 ; 0x2f5e2 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); 2f5b0: 80 93 b1 17 sts 0x17B1, r24 ; 0x8017b1 } void PAT9125_sensor::settings_init() { // puts_P(PSTR("settings_init")); Filament_sensor::settings_init_common(); setJamDetectionEnabled(eeprom_read_byte((uint8_t *)EEPROM_FSENSOR_JAM_DETECTION)); 2f5b4: 8d ea ldi r24, 0xAD ; 173 2f5b6: 9c e0 ldi r25, 0x0C ; 12 2f5b8: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 2f5bc: 91 e0 ldi r25, 0x01 ; 1 2f5be: 81 11 cpse r24, r1 2f5c0: 01 c0 rjmp .+2 ; 0x2f5c4 2f5c2: 90 e0 ldi r25, 0x00 ; 0 return fsensorDetected; } #endif void PAT9125_sensor::setJamDetectionEnabled(bool state, bool updateEEPROM) { jamDetection = state; 2f5c4: 90 93 b7 17 sts 0x17B7, r25 ; 0x8017b7 oldPos = pat9125_y; 2f5c8: 80 91 8e 0e lds r24, 0x0E8E ; 0x800e8e 2f5cc: 90 91 8f 0e lds r25, 0x0E8F ; 0x800e8f 2f5d0: 90 93 b9 17 sts 0x17B9, r25 ; 0x8017b9 2f5d4: 80 93 b8 17 sts 0x17B8, r24 ; 0x8017b8 resetStepCount(); 2f5d8: 0f 94 a5 7a call 0x2f54a ; 0x2f54a jamErrCnt = 0; 2f5dc: 10 92 be 17 sts 0x17BE, r1 ; 0x8017be void PAT9125_sensor::settings_init() { // puts_P(PSTR("settings_init")); Filament_sensor::settings_init_common(); setJamDetectionEnabled(eeprom_read_byte((uint8_t *)EEPROM_FSENSOR_JAM_DETECTION)); } 2f5e0: 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; 2f5e2: 10 92 b1 17 sts 0x17B1, r1 ; 0x8017b1 2f5e6: e6 cf rjmp .-52 ; 0x2f5b4 0002f5e8 : #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_IR) || (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) #if (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) void PAT9125_sensor::init() { if (state == State::error) { 2f5e8: 80 91 a9 17 lds r24, 0x17A9 ; 0x8017a9 2f5ec: 83 30 cpi r24, 0x03 ; 3 2f5ee: 21 f4 brne .+8 ; 0x2f5f8 } void PAT9125_sensor::deinit() { // puts_P(PSTR("fsensor::deinit()")); ; // state = State::disabled; 2f5f0: 10 92 a9 17 sts 0x17A9, r1 ; 0x8017a9 filter = 0; 2f5f4: 10 92 b5 17 sts 0x17B5, r1 ; 0x8017b5 if (state == State::error) { deinit(); // deinit first if there was an error. } // puts_P(PSTR("fsensor::init()")); settings_init(); // also sets the state to State::initializing 2f5f8: 0f 94 ad 7a call 0x2f55a ; 0x2f55a int16_t stepCount; int16_t chunkSteps; uint8_t jamErrCnt; constexpr void calcChunkSteps(float u) { chunkSteps = (int16_t)(1.25 * u); //[mm] 2f5fc: 20 e0 ldi r18, 0x00 ; 0 2f5fe: 30 e0 ldi r19, 0x00 ; 0 2f600: 40 ea ldi r20, 0xA0 ; 160 2f602: 5f e3 ldi r21, 0x3F ; 63 2f604: 60 91 cd 0d lds r22, 0x0DCD ; 0x800dcd 2f608: 70 91 ce 0d lds r23, 0x0DCE ; 0x800dce 2f60c: 80 91 cf 0d lds r24, 0x0DCF ; 0x800dcf 2f610: 90 91 d0 0d lds r25, 0x0DD0 ; 0x800dd0 2f614: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 2f618: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> 2f61c: 70 93 bd 17 sts 0x17BD, r23 ; 0x8017bd 2f620: 60 93 bc 17 sts 0x17BC, r22 ; 0x8017bc void twi_init(void) { // activate internal pullups for SDA SET_INPUT(SDA_PIN); 2f624: 51 98 cbi 0x0a, 1 ; 10 WRITE(SDA_PIN, 1); 2f626: 59 9a sbi 0x0b, 1 ; 11 // start with the SDA pulled low WRITE(SCL_PIN, 0); 2f628: 58 98 cbi 0x0b, 0 ; 11 SET_OUTPUT(SCL_PIN); 2f62a: 50 9a sbi 0x0a, 0 ; 10 2f62c: 8a e0 ldi r24, 0x0A ; 10 // clock 10 cycles to make sure that the sensor is not stuck in a register read. for (uint8_t i = 0; i < 10; i++) { WRITE(SCL_PIN, 1); 2f62e: 58 9a sbi 0x0b, 0 ; 11 #else //round up by default __ticks_dc = (uint32_t)(ceil(fabs(__tmp))); #endif __builtin_avr_delay_cycles(__ticks_dc); 2f630: 95 e0 ldi r25, 0x05 ; 5 2f632: 9a 95 dec r25 2f634: f1 f7 brne .-4 ; 0x2f632 2f636: 00 00 nop _delay_us((1000000 / TWI_FREQ) / 2); WRITE(SCL_PIN, 0); 2f638: 58 98 cbi 0x0b, 0 ; 11 2f63a: 95 e0 ldi r25, 0x05 ; 5 2f63c: 9a 95 dec r25 2f63e: f1 f7 brne .-4 ; 0x2f63c 2f640: 00 00 nop 2f642: 81 50 subi r24, 0x01 ; 1 // start with the SDA pulled low WRITE(SCL_PIN, 0); SET_OUTPUT(SCL_PIN); // clock 10 cycles to make sure that the sensor is not stuck in a register read. for (uint8_t i = 0; i < 10; i++) { 2f644: a1 f7 brne .-24 ; 0x2f62e WRITE(SCL_PIN, 0); _delay_us((1000000 / TWI_FREQ) / 2); } // activate internal pullups for SCL SET_INPUT(SCL_PIN); 2f646: 50 98 cbi 0x0a, 0 ; 10 WRITE(SCL_PIN, 1); 2f648: 58 9a sbi 0x0b, 0 ; 11 // initialize twi prescaler and bit rate TWSR &= ~(_BV(TWPS0) | _BV(TWPS1)); 2f64a: 80 91 b9 00 lds r24, 0x00B9 ; 0x8000b9 <__TEXT_REGION_LENGTH__+0x7c20b9> 2f64e: 8c 7f andi r24, 0xFC ; 252 2f650: 80 93 b9 00 sts 0x00B9, r24 ; 0x8000b9 <__TEXT_REGION_LENGTH__+0x7c20b9> TWBR = ((F_CPU / TWI_FREQ) - 16) / 2; 2f654: 8c e0 ldi r24, 0x0C ; 12 2f656: 80 93 b8 00 sts 0x00B8, r24 ; 0x8000b8 <__TEXT_REGION_LENGTH__+0x7c20b8> uint8_t twi_check(uint8_t address) { // send start condition TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTA); 2f65a: 84 ea ldi r24, 0xA4 ; 164 2f65c: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_START)) 2f660: 88 e0 ldi r24, 0x08 ; 8 2f662: 0f 94 8f 29 call 0x2531e ; 0x2531e 2f666: 81 11 cpse r24, r1 2f668: 68 c0 rjmp .+208 ; 0x2f73a return 1; // send address TWDR = TW_WRITE | (address << 1); 2f66a: 8a ee ldi r24, 0xEA ; 234 2f66c: 80 93 bb 00 sts 0x00BB, r24 ; 0x8000bb <__TEXT_REGION_LENGTH__+0x7c20bb> TWCR = _BV(TWEN) | _BV(TWINT); 2f670: 84 e8 ldi r24, 0x84 ; 132 2f672: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_MT_SLA_ACK)) 2f676: 88 e1 ldi r24, 0x18 ; 24 2f678: 0f 94 8f 29 call 0x2531e ; 0x2531e 2f67c: 81 11 cpse r24, r1 2f67e: 5d c0 rjmp .+186 ; 0x2f73a } static void twi_stop() { TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTO); 2f680: 84 e9 ldi r24, 0x94 ; 148 2f682: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> { if (!pat9125_probe()) return 0; // Switch to bank0, not allowed to perform pat9125_wr_reg_verify on this register. pat9125_wr_reg(PAT9125_BANK_SELECTION, 0); 2f686: 60 e0 ldi r22, 0x00 ; 0 2f688: 8f e7 ldi r24, 0x7F ; 127 2f68a: 0f 94 c9 c1 call 0x38392 ; 0x38392 // Verify that the sensor responds with its correct product ID. pat9125_PID1 = pat9125_rd_reg(PAT9125_PID1); 2f68e: 80 e0 ldi r24, 0x00 ; 0 2f690: 0f 94 e4 c1 call 0x383c8 ; 0x383c8 2f694: 80 93 bc 0d sts 0x0DBC, r24 ; 0x800dbc pat9125_PID2 = pat9125_rd_reg(PAT9125_PID2); 2f698: 81 e0 ldi r24, 0x01 ; 1 2f69a: 0f 94 e4 c1 call 0x383c8 ; 0x383c8 2f69e: 80 93 bb 0d sts 0x0DBB, r24 ; 0x800dbb if ((pat9125_PID1 != 0x31) || (pat9125_PID2 != 0x91)) 2f6a2: 90 91 bc 0d lds r25, 0x0DBC ; 0x800dbc 2f6a6: 91 33 cpi r25, 0x31 ; 49 2f6a8: b9 f5 brne .+110 ; 0x2f718 2f6aa: 81 39 cpi r24, 0x91 ; 145 2f6ac: a9 f5 brne .+106 ; 0x2f718 } #if PAT9125_NEW_INIT // Software reset (i.e. set bit7 to 1). It will reset to 0 automatically. // pat9125_wr_reg_verify is not allowed because the register contents will change as soon as they are written. No point in verifying those. pat9125_wr_reg(PAT9125_CONFIG, 0x97); 2f6ae: 67 e9 ldi r22, 0x97 ; 151 2f6b0: 86 e0 ldi r24, 0x06 ; 6 2f6b2: 0f 94 c9 c1 call 0x38392 ; 0x38392 #else //round up by default __ticks_dc = (uint32_t)(ceil(fabs(__tmp))); #endif __builtin_avr_delay_cycles(__ticks_dc); 2f6b6: 8f e9 ldi r24, 0x9F ; 159 2f6b8: 9f e0 ldi r25, 0x0F ; 15 2f6ba: 01 97 sbiw r24, 0x01 ; 1 2f6bc: f1 f7 brne .-4 ; 0x2f6ba 2f6be: 00 c0 rjmp .+0 ; 0x2f6c0 2f6c0: 00 00 nop // Wait until the sensor reboots. _delay_ms(1); //Write init sequence in bank0. MUST ALREADY BE IN bank0. if (!pat9125_wr_seq(pat9125_init_bank0)) 2f6c2: 84 e3 ldi r24, 0x34 ; 52 2f6c4: 9b ea ldi r25, 0xAB ; 171 2f6c6: 0f 94 11 c2 call 0x38422 ; 0x38422 2f6ca: 88 23 and r24, r24 2f6cc: b1 f1 breq .+108 ; 0x2f73a 2f6ce: 8f e3 ldi r24, 0x3F ; 63 2f6d0: 9c e9 ldi r25, 0x9C ; 156 2f6d2: 01 97 sbiw r24, 0x01 ; 1 2f6d4: f1 f7 brne .-4 ; 0x2f6d2 2f6d6: 00 c0 rjmp .+0 ; 0x2f6d8 2f6d8: 00 00 nop return 0; _delay_ms(10); // not sure why this is here. But I'll allow it. // Switch to bank1, not allowed to perform pat9125_wr_reg_verify on this register. pat9125_wr_reg(PAT9125_BANK_SELECTION, 0x01); 2f6da: 61 e0 ldi r22, 0x01 ; 1 2f6dc: 8f e7 ldi r24, 0x7F ; 127 2f6de: 0f 94 c9 c1 call 0x38392 ; 0x38392 //Write init sequence in bank1. MUST ALREADY BE IN bank1. if (!pat9125_wr_seq(pat9125_init_bank1)) 2f6e2: 81 e0 ldi r24, 0x01 ; 1 2f6e4: 9b ea ldi r25, 0xAB ; 171 2f6e6: 0f 94 11 c2 call 0x38422 ; 0x38422 2f6ea: 88 23 and r24, r24 2f6ec: 31 f1 breq .+76 ; 0x2f73a return 0; // Switch to bank0, not allowed to perform pat9125_wr_reg_verify on this register. pat9125_wr_reg(PAT9125_BANK_SELECTION, 0x00); 2f6ee: 60 e0 ldi r22, 0x00 ; 0 2f6f0: 8f e7 ldi r24, 0x7F ; 127 2f6f2: 0f 94 c9 c1 call 0x38392 ; 0x38392 // Enable write protect. pat9125_wr_reg(PAT9125_WP, 0x00); //prevents writing to registers over 0x09 2f6f6: 60 e0 ldi r22, 0x00 ; 0 2f6f8: 89 e0 ldi r24, 0x09 ; 9 2f6fa: 0f 94 c9 c1 call 0x38392 ; 0x38392 pat9125_PID1 = pat9125_rd_reg(PAT9125_PID1); 2f6fe: 80 e0 ldi r24, 0x00 ; 0 2f700: 0f 94 e4 c1 call 0x383c8 ; 0x383c8 2f704: 80 93 bc 0d sts 0x0DBC, r24 ; 0x800dbc pat9125_PID2 = pat9125_rd_reg(PAT9125_PID2); 2f708: 81 e0 ldi r24, 0x01 ; 1 2f70a: 0f 94 e4 c1 call 0x383c8 ; 0x383c8 2f70e: 80 93 bb 0d sts 0x0DBB, r24 ; 0x800dbb deinit(); triggerError(); ; // } #ifdef IR_SENSOR_PIN else if (!READ(IR_SENSOR_PIN)) { 2f712: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 2f716: 08 95 ret // Verify that the sensor responds with its correct product ID. pat9125_PID1 = pat9125_rd_reg(PAT9125_PID1); pat9125_PID2 = pat9125_rd_reg(PAT9125_PID2); if ((pat9125_PID1 != 0x31) || (pat9125_PID2 != 0x91)) { pat9125_PID1 = pat9125_rd_reg(PAT9125_PID1); 2f718: 80 e0 ldi r24, 0x00 ; 0 2f71a: 0f 94 e4 c1 call 0x383c8 ; 0x383c8 2f71e: 80 93 bc 0d sts 0x0DBC, r24 ; 0x800dbc pat9125_PID2 = pat9125_rd_reg(PAT9125_PID2); 2f722: 81 e0 ldi r24, 0x01 ; 1 2f724: 0f 94 e4 c1 call 0x383c8 ; 0x383c8 2f728: 80 93 bb 0d sts 0x0DBB, r24 ; 0x800dbb if ((pat9125_PID1 != 0x31) || (pat9125_PID2 != 0x91)) 2f72c: 90 91 bc 0d lds r25, 0x0DBC ; 0x800dbc 2f730: 91 33 cpi r25, 0x31 ; 49 2f732: 19 f4 brne .+6 ; 0x2f73a 2f734: 81 39 cpi r24, 0x91 ; 145 2f736: 09 f4 brne .+2 ; 0x2f73a 2f738: ba cf rjmp .-140 ; 0x2f6ae void PAT9125_sensor::deinit() { // puts_P(PSTR("fsensor::deinit()")); ; // state = State::disabled; filter = 0; 2f73a: 10 92 b5 17 sts 0x17B5, r1 ; 0x8017b5 eeprom_increment_word((uint16_t *)EEPROM_FERROR_COUNT_TOT); enquecommand_front_P(MSG_M600); } void Filament_sensor::triggerError() { state = State::error; 2f73e: 83 e0 ldi r24, 0x03 ; 3 2f740: 80 93 a9 17 sts 0x17A9, r24 ; 0x8017a9 #ifdef IR_SENSOR_PIN else if (!READ(IR_SENSOR_PIN)) { ; // MK3 fw on MK3S printer } #endif // IR_SENSOR_PIN } 2f744: 08 95 ret 0002f746 : eeprom_increment_byte((uint8_t *)EEPROM_FERROR_COUNT); eeprom_increment_word((uint16_t *)EEPROM_FERROR_COUNT_TOT); enquecommand_front_P(MSG_M600); } bool PAT9125_sensor::updatePAT9125() { 2f746: cf 93 push r28 2f748: df 93 push r29 if (jamDetection) { 2f74a: 80 91 b7 17 lds r24, 0x17B7 ; 0x8017b7 2f74e: 88 23 and r24, r24 2f750: 09 f4 brne .+2 ; 0x2f754 2f752: 62 c0 rjmp .+196 ; 0x2f818 setJamDetectionEnabled(eeprom_read_byte((uint8_t *)EEPROM_FSENSOR_JAM_DETECTION)); } int16_t PAT9125_sensor::getStepCount() { int16_t ret; ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { ret = stepCount; } 2f754: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 2f756: f8 94 cli 2f758: c0 91 ba 17 lds r28, 0x17BA ; 0x8017ba 2f75c: d0 91 bb 17 lds r29, 0x17BB ; 0x8017bb (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 2f760: 8f bf out 0x3f, r24 ; 63 } bool PAT9125_sensor::updatePAT9125() { if (jamDetection) { int16_t _stepCount = getStepCount(); if (abs(_stepCount) >= chunkSteps) { // end of chunk. Check distance 2f762: ce 01 movw r24, r28 2f764: d7 ff sbrs r29, 7 2f766: 04 c0 rjmp .+8 ; 0x2f770 2f768: 88 27 eor r24, r24 2f76a: 99 27 eor r25, r25 2f76c: 8c 1b sub r24, r28 2f76e: 9d 0b sbc r25, r29 2f770: 20 91 bc 17 lds r18, 0x17BC ; 0x8017bc 2f774: 30 91 bd 17 lds r19, 0x17BD ; 0x8017bd 2f778: 82 17 cp r24, r18 2f77a: 93 07 cpc r25, r19 2f77c: 4c f1 brlt .+82 ; 0x2f7d0 resetStepCount(); 2f77e: 0f 94 a5 7a call 0x2f54a ; 0x2f54a if (!pat9125_update()) { // get up to date data. reinit on error. 2f782: 0f 94 2f c2 call 0x3845e ; 0x3845e 2f786: 81 11 cpse r24, r1 2f788: 02 c0 rjmp .+4 ; 0x2f78e init(); // try to reinit. 2f78a: 0f 94 f4 7a call 0x2f5e8 ; 0x2f5e8 } bool fsDir = (pat9125_y - oldPos) > 0; 2f78e: 20 91 8e 0e lds r18, 0x0E8E ; 0x800e8e 2f792: 30 91 8f 0e lds r19, 0x0E8F ; 0x800e8f 2f796: 80 91 be 17 lds r24, 0x17BE ; 0x8017be 2f79a: 40 91 b8 17 lds r20, 0x17B8 ; 0x8017b8 2f79e: 50 91 b9 17 lds r21, 0x17B9 ; 0x8017b9 2f7a2: b9 01 movw r22, r18 2f7a4: 64 1b sub r22, r20 2f7a6: 75 0b sbc r23, r21 2f7a8: 41 e0 ldi r20, 0x01 ; 1 2f7aa: 16 16 cp r1, r22 2f7ac: 17 06 cpc r1, r23 2f7ae: 0c f0 brlt .+2 ; 0x2f7b2 2f7b0: 40 e0 ldi r20, 0x00 ; 0 bool stDir = _stepCount > 0; 2f7b2: 91 e0 ldi r25, 0x01 ; 1 2f7b4: 1c 16 cp r1, r28 2f7b6: 1d 06 cpc r1, r29 2f7b8: 0c f0 brlt .+2 ; 0x2f7bc 2f7ba: 90 e0 ldi r25, 0x00 ; 0 if (fsDir != stDir) { 2f7bc: 49 17 cp r20, r25 2f7be: 09 f4 brne .+2 ; 0x2f7c2 2f7c0: 63 c0 rjmp .+198 ; 0x2f888 jamErrCnt++; 2f7c2: 8f 5f subi r24, 0xFF ; 255 } else if (jamErrCnt) { jamErrCnt--; 2f7c4: 80 93 be 17 sts 0x17BE, r24 ; 0x8017be } oldPos = pat9125_y; 2f7c8: 30 93 b9 17 sts 0x17B9, r19 ; 0x8017b9 2f7cc: 20 93 b8 17 sts 0x17B8, r18 ; 0x8017b8 } if (jamErrCnt > 10) { 2f7d0: 80 91 be 17 lds r24, 0x17BE ; 0x8017be 2f7d4: 8b 30 cpi r24, 0x0B ; 11 2f7d6: 00 f1 brcs .+64 ; 0x2f818 jamErrCnt = 0; 2f7d8: 10 92 be 17 sts 0x17BE, r1 ; 0x8017be void PAT9125_sensor::resetStepCount() { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { stepCount = 0; } } void PAT9125_sensor::filJam() { runoutEnabled = false; 2f7dc: 10 92 ab 17 sts 0x17AB, r1 ; 0x8017ab autoLoadEnabled = false; 2f7e0: 10 92 aa 17 sts 0x17AA, r1 ; 0x8017aa jamDetection = false; 2f7e4: 10 92 b7 17 sts 0x17B7, r1 ; 0x8017b7 stop_and_save_print_to_ram(0, 0); 2f7e8: 20 e0 ldi r18, 0x00 ; 0 2f7ea: 30 e0 ldi r19, 0x00 ; 0 2f7ec: a9 01 movw r20, r18 2f7ee: ca 01 movw r24, r20 2f7f0: b9 01 movw r22, r18 2f7f2: 0e 94 4f 89 call 0x1129e ; 0x1129e restore_print_from_ram_and_continue(0); 2f7f6: 60 e0 ldi r22, 0x00 ; 0 2f7f8: 70 e0 ldi r23, 0x00 ; 0 2f7fa: cb 01 movw r24, r22 2f7fc: 0e 94 5c 68 call 0xd0b8 ; 0xd0b8 eeprom_increment_byte((uint8_t *)EEPROM_FERROR_COUNT); 2f800: 85 e6 ldi r24, 0x65 ; 101 2f802: 9f e0 ldi r25, 0x0F ; 15 2f804: 0e 94 40 76 call 0xec80 ; 0xec80 eeprom_increment_word((uint16_t *)EEPROM_FERROR_COUNT_TOT); 2f808: 81 e0 ldi r24, 0x01 ; 1 2f80a: 9f e0 ldi r25, 0x0F ; 15 2f80c: 0e 94 33 76 call 0xec66 ; 0xec66 enquecommand_front_P(MSG_M600); 2f810: 8c e2 ldi r24, 0x2C ; 44 2f812: 91 e7 ldi r25, 0x71 ; 113 2f814: 0f 94 b8 74 call 0x2e970 ; 0x2e970 jamErrCnt = 0; filJam(); } } if (pollingTimer.expired_cont(pollingPeriod)) { 2f818: 6a e0 ldi r22, 0x0A ; 10 2f81a: 70 e0 ldi r23, 0x00 ; 0 2f81c: 82 eb ldi r24, 0xB2 ; 178 2f81e: 97 e1 ldi r25, 0x17 ; 23 2f820: 0f 94 7c 29 call 0x252f8 ; 0x252f8 ::expired_cont(unsigned short)> 2f824: c8 2f mov r28, r24 2f826: 88 23 and r24, r24 2f828: 39 f1 breq .+78 ; 0x2f878 pollingTimer.start(); 2f82a: 82 eb ldi r24, 0xB2 ; 178 2f82c: 97 e1 ldi r25, 0x17 ; 23 2f82e: 0f 94 83 29 call 0x25306 ; 0x25306 ::start()> if (!pat9125_update()) { 2f832: 0f 94 2f c2 call 0x3845e ; 0x3845e 2f836: 81 11 cpse r24, r1 2f838: 02 c0 rjmp .+4 ; 0x2f83e init(); // try to reinit. 2f83a: 0f 94 f4 7a call 0x2f5e8 ; 0x2f5e8 } bool present = (pat9125_s < 17) || (pat9125_s >= 17 && pat9125_b >= 50); 2f83e: 80 91 ba 0d lds r24, 0x0DBA ; 0x800dba 2f842: 81 31 cpi r24, 0x11 ; 17 2f844: 30 f0 brcs .+12 ; 0x2f852 2f846: c1 e0 ldi r28, 0x01 ; 1 2f848: 80 91 b9 0d lds r24, 0x0DB9 ; 0x800db9 2f84c: 82 33 cpi r24, 0x32 ; 50 2f84e: 08 f4 brcc .+2 ; 0x2f852 2f850: c0 e0 ldi r28, 0x00 ; 0 2f852: 80 91 b5 17 lds r24, 0x17B5 ; 0x8017b5 if (present != filterFilPresent) { 2f856: 20 91 b6 17 lds r18, 0x17B6 ; 0x8017b6 2f85a: 30 e0 ldi r19, 0x00 ; 0 2f85c: c2 17 cp r28, r18 2f85e: 13 06 cpc r1, r19 2f860: c1 f0 breq .+48 ; 0x2f892 filter++; 2f862: 8f 5f subi r24, 0xFF ; 255 } else if (filter) { filter--; 2f864: 80 93 b5 17 sts 0x17B5, r24 ; 0x8017b5 } if (filter >= filterCnt) { 2f868: 80 91 b5 17 lds r24, 0x17B5 ; 0x8017b5 2f86c: 85 30 cpi r24, 0x05 ; 5 2f86e: 20 f0 brcs .+8 ; 0x2f878 filter = 0; 2f870: 10 92 b5 17 sts 0x17B5, r1 ; 0x8017b5 filterFilPresent = present; 2f874: c0 93 b6 17 sts 0x17B6, r28 ; 0x8017b6 } } return (filter == 0); // return stability 2f878: 81 e0 ldi r24, 0x01 ; 1 2f87a: 90 91 b5 17 lds r25, 0x17B5 ; 0x8017b5 2f87e: 91 11 cpse r25, r1 2f880: 80 e0 ldi r24, 0x00 ; 0 } 2f882: df 91 pop r29 2f884: cf 91 pop r28 2f886: 08 95 ret } bool fsDir = (pat9125_y - oldPos) > 0; bool stDir = _stepCount > 0; if (fsDir != stDir) { jamErrCnt++; } else if (jamErrCnt) { 2f888: 88 23 and r24, r24 2f88a: 09 f4 brne .+2 ; 0x2f88e 2f88c: 9d cf rjmp .-198 ; 0x2f7c8 jamErrCnt--; 2f88e: 81 50 subi r24, 0x01 ; 1 2f890: 99 cf rjmp .-206 ; 0x2f7c4 } bool present = (pat9125_s < 17) || (pat9125_s >= 17 && pat9125_b >= 50); if (present != filterFilPresent) { filter++; } else if (filter) { 2f892: 88 23 and r24, r24 2f894: 49 f3 breq .-46 ; 0x2f868 filter--; 2f896: 81 50 subi r24, 0x01 ; 1 2f898: e5 cf rjmp .-54 ; 0x2f864 0002f89a : * 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() { 2f89a: 2f 92 push r2 2f89c: 3f 92 push r3 2f89e: 4f 92 push r4 2f8a0: 5f 92 push r5 2f8a2: 6f 92 push r6 2f8a4: 7f 92 push r7 2f8a6: 8f 92 push r8 2f8a8: 9f 92 push r9 2f8aa: af 92 push r10 2f8ac: bf 92 push r11 2f8ae: cf 92 push r12 2f8b0: df 92 push r13 2f8b2: ef 92 push r14 2f8b4: ff 92 push r15 2f8b6: 0f 93 push r16 2f8b8: 1f 93 push r17 2f8ba: cf 93 push r28 2f8bc: df 93 push r29 2f8be: cd b7 in r28, 0x3d ; 61 2f8c0: de b7 in r29, 0x3e ; 62 2f8c2: ed 97 sbiw r28, 0x3d ; 61 2f8c4: 0f b6 in r0, 0x3f ; 63 2f8c6: f8 94 cli 2f8c8: de bf out 0x3e, r29 ; 62 2f8ca: 0f be out 0x3f, r0 ; 63 2f8cc: cd bf out 0x3d, r28 ; 61 KEEPALIVE_STATE(NOT_BUSY); } void CardReader::flush_presort() { sort_count = 0; 2f8ce: 10 92 31 16 sts 0x1631, r1 ; 0x801631 2f8d2: 10 92 30 16 sts 0x1630, r1 ; 0x801630 lastSortedFilePosition = 0; 2f8d6: 10 92 fb 16 sts 0x16FB, r1 ; 0x8016fb 2f8da: 10 92 fa 16 sts 0x16FA, r1 ; 0x8016fa */ void CardReader::presort() { // Throw away old sort index flush_presort(); if (IS_SD_INSERTED == false) return; //sorting is not used in farm mode 2f8de: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2f8e2: 80 fd sbrc r24, 0 2f8e4: ef c0 rjmp .+478 ; 0x2fac4 uint8_t sdSort = eeprom_read_byte((uint8_t*)EEPROM_SD_SORT); 2f8e6: 89 e0 ldi r24, 0x09 ; 9 2f8e8: 9f e0 ldi r25, 0x0F ; 15 2f8ea: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 2f8ee: 38 2e mov r3, r24 KEEPALIVE_STATE(IN_HANDLER); 2f8f0: 82 e0 ldi r24, 0x02 ; 2 2f8f2: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be // If there are files, sort up to the limit uint16_t fileCnt = getnrfilenames(); 2f8f6: 0f 94 8f 79 call 0x2f31e ; 0x2f31e 2f8fa: 6c 01 movw r12, r24 if (fileCnt > 0) { 2f8fc: 00 97 sbiw r24, 0x00 ; 0 2f8fe: 09 f4 brne .+2 ; 0x2f902 2f900: de c0 rjmp .+444 ; 0x2fabe // Never sort more than the max allowed // If you use folders to organize, 20 may be enough if (fileCnt > SDSORT_LIMIT) { 2f902: 85 36 cpi r24, 0x65 ; 101 2f904: 91 05 cpc r25, r1 2f906: 60 f0 brcs .+24 ; 0x2f920 if ((sdSort != SD_SORT_NONE) && !farm_mode) { 2f908: 32 e0 ldi r19, 0x02 ; 2 2f90a: 33 16 cp r3, r19 2f90c: 31 f0 breq .+12 ; 0x2f91a lcd_show_fullscreen_message_and_wait_P(_T(MSG_FILE_CNT)); 2f90e: 8a eb ldi r24, 0xBA ; 186 2f910: 9c e5 ldi r25, 0x5C ; 92 2f912: 0e 94 c4 72 call 0xe588 ; 0xe588 2f916: 0f 94 c7 1f call 0x23f8e ; 0x23f8e } fileCnt = SDSORT_LIMIT; 2f91a: f4 e6 ldi r31, 0x64 ; 100 2f91c: cf 2e mov r12, r31 2f91e: d1 2c mov r13, r1 } sort_count = fileCnt; 2f920: d0 92 31 16 sts 0x1631, r13 ; 0x801631 2f924: c0 92 30 16 sts 0x1630, r12 ; 0x801630 2f928: 62 e3 ldi r22, 0x32 ; 50 2f92a: 66 2e mov r6, r22 2f92c: 66 e1 ldi r22, 0x16 ; 22 2f92e: 76 2e mov r7, r22 // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { 2f930: f1 2c mov r15, r1 2f932: e1 2c mov r14, r1 lsDive("", *curDir, match, LS_GetFilename); } void CardReader::getfilename_next(uint32_t position, const char * const match/*=NULL*/) { curDir = &workDir; 2f934: 7a e3 ldi r23, 0x3A ; 58 2f936: a7 2e mov r10, r23 2f938: 75 e1 ldi r23, 0x15 ; 21 2f93a: b7 2e mov r11, r23 nrFiles = 1; 2f93c: 88 24 eor r8, r8 2f93e: 83 94 inc r8 2f940: 91 2c mov r9, r1 sort_count = fileCnt; // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { if (!IS_SD_INSERTED) return; 2f942: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2f946: 80 fd sbrc r24, 0 2f948: bd c0 rjmp .+378 ; 0x2fac4 manage_heater(); 2f94a: 0f 94 2e 38 call 0x2705c ; 0x2705c if (i == 0) 2f94e: e1 14 cp r14, r1 2f950: f1 04 cpc r15, r1 2f952: 09 f0 breq .+2 ; 0x2f956 2f954: d0 c0 rjmp .+416 ; 0x2faf6 getfilename(0); 2f956: 90 e0 ldi r25, 0x00 ; 0 2f958: 80 e0 ldi r24, 0x00 ; 0 2f95a: 0f 94 f9 78 call 0x2f1f2 ; 0x2f1f2 else getfilename_next(position); sort_entries[i] = position >> 5; 2f95e: 80 91 a2 14 lds r24, 0x14A2 ; 0x8014a2 2f962: 90 91 a3 14 lds r25, 0x14A3 ; 0x8014a3 2f966: a0 91 a4 14 lds r26, 0x14A4 ; 0x8014a4 2f96a: b0 91 a5 14 lds r27, 0x14A5 ; 0x8014a5 2f96e: 55 e0 ldi r21, 0x05 ; 5 2f970: b6 95 lsr r27 2f972: a7 95 ror r26 2f974: 97 95 ror r25 2f976: 87 95 ror r24 2f978: 5a 95 dec r21 2f97a: d1 f7 brne .-12 ; 0x2f970 2f97c: f3 01 movw r30, r6 2f97e: 81 93 st Z+, r24 2f980: 91 93 st Z+, r25 2f982: 3f 01 movw r6, r30 } sort_count = fileCnt; // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { 2f984: ff ef ldi r31, 0xFF ; 255 2f986: ef 1a sub r14, r31 2f988: ff 0a sbc r15, r31 2f98a: ce 14 cp r12, r14 2f98c: df 04 cpc r13, r15 2f98e: c9 f6 brne .-78 ; 0x2f942 else getfilename_next(position); sort_entries[i] = position >> 5; } if ((fileCnt > 1) && (sdSort != SD_SORT_NONE) && !farm_mode) { 2f990: 21 e0 ldi r18, 0x01 ; 1 2f992: e2 16 cp r14, r18 2f994: f1 04 cpc r15, r1 2f996: 09 f4 brne .+2 ; 0x2f99a 2f998: 92 c0 rjmp .+292 ; 0x2fabe 2f99a: 32 e0 ldi r19, 0x02 ; 2 2f99c: 33 16 cp r3, r19 2f99e: 09 f4 brne .+2 ; 0x2f9a2 2f9a0: 8e c0 rjmp .+284 ; 0x2fabe #ifdef SORTING_SPEEDTEST LongTimer sortingSpeedtestTimer; sortingSpeedtestTimer.start(); #endif //SORTING_SPEEDTEST lastSortedFilePosition = position >> 5; 2f9a2: 90 93 fb 16 sts 0x16FB, r25 ; 0x8016fb 2f9a6: 80 93 fa 16 sts 0x16FA, r24 ; 0x8016fa #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)); 2f9aa: 8a ea ldi r24, 0xAA ; 170 2f9ac: 9c e5 ldi r25, 0x5C ; 92 2f9ae: 0e 94 c4 72 call 0xe588 ; 0xe588 2f9b2: ee 9c mul r14, r14 2f9b4: 90 01 movw r18, r0 2f9b6: ef 9c mul r14, r15 2f9b8: 30 0d add r19, r0 2f9ba: 30 0d add r19, r0 2f9bc: 11 24 eor r1, r1 2f9be: bc 01 movw r22, r24 2f9c0: c9 01 movw r24, r18 2f9c2: 96 95 lsr r25 2f9c4: 87 95 ror r24 2f9c6: 0f 94 b3 cf call 0x39f66 ; 0x39f66 2f9ca: 34 e3 ldi r19, 0x34 ; 52 2f9cc: a3 2e mov r10, r19 2f9ce: 36 e1 ldi r19, 0x16 ; 22 2f9d0: 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; 2f9d2: 91 2c mov r9, r1 2f9d4: 81 2c mov r8, r1 menu_progressbar_init(fileCnt * fileCnt / 2, _T(MSG_SORTING_FILES)); for (uint16_t i = 1; i < fileCnt; ++i){ 2f9d6: cc 24 eor r12, r12 2f9d8: c3 94 inc r12 2f9da: d1 2c mov r13, r1 // if (!IS_SD_INSERTED) return; menu_progressbar_update(counter); 2f9dc: c4 01 movw r24, r8 2f9de: 0f 94 84 cf call 0x39f08 ; 0x39f08 counter += i; 2f9e2: 8c 0c add r8, r12 2f9e4: 9d 1c adc r9, r13 /// pop the position const uint16_t o1 = sort_entries[i]; 2f9e6: f5 01 movw r30, r10 2f9e8: 01 90 ld r0, Z+ 2f9ea: f0 81 ld r31, Z 2f9ec: e0 2d mov r30, r0 2f9ee: f9 af std Y+57, r31 ; 0x39 2f9f0: e8 af std Y+56, r30 ; 0x38 getfilename_simple(o1); 2f9f2: cf 01 movw r24, r30 2f9f4: 0f 94 40 79 call 0x2f280 ; 0x2f280 strcpy(name1, LONGEST_FILENAME); // save (or getfilename below will trounce it) 2f9f8: 80 91 a6 14 lds r24, 0x14A6 ; 0x8014a6 2f9fc: 61 e9 ldi r22, 0x91 ; 145 2f9fe: 74 e1 ldi r23, 0x14 ; 20 2fa00: 88 23 and r24, r24 2fa02: 11 f0 breq .+4 ; 0x2fa08 2fa04: 66 ea ldi r22, 0xA6 ; 166 2fa06: 74 e1 ldi r23, 0x14 ; 20 2fa08: ce 01 movw r24, r28 2fa0a: 01 96 adiw r24, 0x01 ; 1 2fa0c: 0f 94 42 e2 call 0x3c484 ; 0x3c484 crmod_date_bckp = crmodDate; 2fa10: 60 90 a0 14 lds r6, 0x14A0 ; 0x8014a0 2fa14: 70 90 a1 14 lds r7, 0x14A1 ; 0x8014a1 crmod_time_bckp = crmodTime; 2fa18: 20 91 9e 14 lds r18, 0x149E ; 0x80149e 2fa1c: 30 91 9f 14 lds r19, 0x149F ; 0x80149f 2fa20: 3b af std Y+59, r19 ; 0x3b 2fa22: 2a af std Y+58, r18 ; 0x3a #if HAS_FOLDER_SORTING bool dir1 = filenameIsDir; 2fa24: 20 90 db 14 lds r2, 0x14DB ; 0x8014db 2fa28: bf aa std Y+55, r11 ; 0x37 2fa2a: ae aa std Y+54, r10 ; 0x36 2fa2c: 86 01 movw r16, r12 #endif /// find proper place uint16_t j = i; for (; j > 0; --j){ if (!IS_SD_INSERTED) return; 2fa2e: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2fa32: 80 fd sbrc r24, 0 2fa34: 47 c0 rjmp .+142 ; 0x2fac4 printf_P(PSTR("%2u "), sort_entries[z]); } MYSERIAL.println(); #endif manage_heater(); 2fa36: 0f 94 2e 38 call 0x2705c ; 0x2705c const uint16_t o2 = sort_entries[j - 1]; 2fa3a: c8 01 movw r24, r16 2fa3c: 01 97 sbiw r24, 0x01 ; 1 2fa3e: 9d af std Y+61, r25 ; 0x3d 2fa40: 8c af std Y+60, r24 ; 0x3c 2fa42: ee a9 ldd r30, Y+54 ; 0x36 2fa44: ff a9 ldd r31, Y+55 ; 0x37 2fa46: 52 90 ld r5, -Z 2fa48: 42 90 ld r4, -Z 2fa4a: ff ab std Y+55, r31 ; 0x37 2fa4c: ee ab std Y+54, r30 ; 0x36 getfilename_simple(o2); 2fa4e: c2 01 movw r24, r4 2fa50: 0f 94 40 79 call 0x2f280 ; 0x2f280 char *name2 = LONGEST_FILENAME; // use the string in-place 2fa54: 80 91 a6 14 lds r24, 0x14A6 ; 0x8014a6 2fa58: 61 e9 ldi r22, 0x91 ; 145 2fa5a: 74 e1 ldi r23, 0x14 ; 20 2fa5c: 88 23 and r24, r24 2fa5e: 11 f0 breq .+4 ; 0x2fa64 2fa60: 66 ea ldi r22, 0xA6 ; 166 2fa62: 74 e1 ldi r23, 0x14 ; 20 // Sort the current pair according to settings. if ( 2fa64: 31 10 cpse r3, r1 2fa66: 8a c0 rjmp .+276 ; 0x2fb7c 2fa68: 80 91 db 14 lds r24, 0x14DB ; 0x8014db 2fa6c: 28 12 cpse r2, r24 2fa6e: 83 c0 rjmp .+262 ; 0x2fb76 #if HAS_FOLDER_SORTING (sdSort == SD_SORT_TIME && _SORT_CMP_TIME_DIR(FOLDER_SORTING)) || (sdSort == SD_SORT_ALPHA && !_SORT_CMP_DIR(FOLDER_SORTING)) 2fa70: 80 91 a0 14 lds r24, 0x14A0 ; 0x8014a0 2fa74: 90 91 a1 14 lds r25, 0x14A1 ; 0x8014a1 2fa78: 68 16 cp r6, r24 2fa7a: 79 06 cpc r7, r25 2fa7c: 09 f0 breq .+2 ; 0x2fa80 2fa7e: 6c c0 rjmp .+216 ; 0x2fb58 2fa80: 80 91 9e 14 lds r24, 0x149E ; 0x80149e 2fa84: 90 91 9f 14 lds r25, 0x149F ; 0x80149f 2fa88: 2a ad ldd r18, Y+58 ; 0x3a 2fa8a: 3b ad ldd r19, Y+59 ; 0x3b 2fa8c: 82 17 cp r24, r18 2fa8e: 93 07 cpc r25, r19 2fa90: 08 f0 brcs .+2 ; 0x2fa94 2fa92: 66 c0 rjmp .+204 ; 0x2fb60 #endif sort_entries[j] = o2; } } /// place the position sort_entries[j] = o1; 2fa94: 00 0f add r16, r16 2fa96: 11 1f adc r17, r17 2fa98: f8 01 movw r30, r16 2fa9a: ee 5c subi r30, 0xCE ; 206 2fa9c: f9 4e sbci r31, 0xE9 ; 233 2fa9e: 28 ad ldd r18, Y+56 ; 0x38 2faa0: 39 ad ldd r19, Y+57 ; 0x39 2faa2: 31 83 std Z+1, r19 ; 0x01 2faa4: 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){ 2faa6: 3f ef ldi r19, 0xFF ; 255 2faa8: c3 1a sub r12, r19 2faaa: d3 0a sbc r13, r19 2faac: 82 e0 ldi r24, 0x02 ; 2 2faae: a8 0e add r10, r24 2fab0: b1 1c adc r11, r1 2fab2: ec 14 cp r14, r12 2fab4: fd 04 cpc r15, r13 2fab6: 09 f0 breq .+2 ; 0x2faba 2fab8: 91 cf rjmp .-222 ; 0x2f9dc for (uint16_t z = 0; z < fileCnt; z++) printf_P(PSTR("%2u "), sort_entries[z]); SERIAL_PROTOCOLLN(); #endif menu_progressbar_finish(); 2faba: 0f 94 a5 cf call 0x39f4a ; 0x39f4a } } KEEPALIVE_STATE(NOT_BUSY); 2fabe: 81 e0 ldi r24, 0x01 ; 1 2fac0: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be } 2fac4: ed 96 adiw r28, 0x3d ; 61 2fac6: 0f b6 in r0, 0x3f ; 63 2fac8: f8 94 cli 2faca: de bf out 0x3e, r29 ; 62 2facc: 0f be out 0x3f, r0 ; 63 2face: cd bf out 0x3d, r28 ; 61 2fad0: df 91 pop r29 2fad2: cf 91 pop r28 2fad4: 1f 91 pop r17 2fad6: 0f 91 pop r16 2fad8: ff 90 pop r15 2fada: ef 90 pop r14 2fadc: df 90 pop r13 2fade: cf 90 pop r12 2fae0: bf 90 pop r11 2fae2: af 90 pop r10 2fae4: 9f 90 pop r9 2fae6: 8f 90 pop r8 2fae8: 7f 90 pop r7 2faea: 6f 90 pop r6 2faec: 5f 90 pop r5 2faee: 4f 90 pop r4 2faf0: 3f 90 pop r3 2faf2: 2f 90 pop r2 2faf4: 08 95 ret if (!IS_SD_INSERTED) return; manage_heater(); if (i == 0) getfilename(0); else getfilename_next(position); 2faf6: 40 91 a2 14 lds r20, 0x14A2 ; 0x8014a2 2fafa: 50 91 a3 14 lds r21, 0x14A3 ; 0x8014a3 2fafe: 60 91 a4 14 lds r22, 0x14A4 ; 0x8014a4 2fb02: 70 91 a5 14 lds r23, 0x14A5 ; 0x8014a5 lsDive("", *curDir, match, LS_GetFilename); } void CardReader::getfilename_next(uint32_t position, const char * const match/*=NULL*/) { curDir = &workDir; 2fb06: b0 92 39 15 sts 0x1539, r11 ; 0x801539 2fb0a: a0 92 38 15 sts 0x1538, r10 ; 0x801538 nrFiles = 1; 2fb0e: 90 92 a8 17 sts 0x17A8, r9 ; 0x8017a8 2fb12: 80 92 a7 17 sts 0x17A7, r8 ; 0x8017a7 curDir->seekSet(position); 2fb16: 8a e3 ldi r24, 0x3A ; 58 2fb18: 95 e1 ldi r25, 0x15 ; 21 2fb1a: 0f 94 4d 56 call 0x2ac9a ; 0x2ac9a 2fb1e: 1e 7f andi r17, 0xFE ; 254 2fb20: 1d 7f andi r17, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 2fb22: e0 91 38 15 lds r30, 0x1538 ; 0x801538 2fb26: f0 91 39 15 lds r31, 0x1539 ; 0x801539 2fb2a: 83 e2 ldi r24, 0x23 ; 35 2fb2c: de 01 movw r26, r28 2fb2e: 11 96 adiw r26, 0x01 ; 1 2fb30: 01 90 ld r0, Z+ 2fb32: 0d 92 st X+, r0 2fb34: 8a 95 dec r24 2fb36: e1 f7 brne .-8 ; 0x2fb30 2fb38: 01 2f mov r16, r17 2fb3a: 22 e0 ldi r18, 0x02 ; 2 2fb3c: 50 e0 ldi r21, 0x00 ; 0 2fb3e: 40 e0 ldi r20, 0x00 ; 0 2fb40: be 01 movw r22, r28 2fb42: 6f 5f subi r22, 0xFF ; 255 2fb44: 7f 4f sbci r23, 0xFF ; 255 2fb46: 86 ef ldi r24, 0xF6 ; 246 2fb48: 92 e0 ldi r25, 0x02 ; 2 2fb4a: 0f 94 ca 76 call 0x2ed94 ; 0x2ed94 2fb4e: ce 01 movw r24, r28 2fb50: 01 96 adiw r24, 0x01 ; 1 2fb52: 0e 94 49 77 call 0xee92 ; 0xee92 2fb56: 03 cf rjmp .-506 ; 0x2f95e 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)) 2fb58: 86 15 cp r24, r6 2fb5a: 97 05 cpc r25, r7 2fb5c: 08 f4 brcc .+2 ; 0x2fb60 2fb5e: 9a cf rjmp .-204 ; 0x2fa94 break; } else { #ifdef SORTING_DUMP puts_P(PSTR("shift")); #endif sort_entries[j] = o2; 2fb60: ee a9 ldd r30, Y+54 ; 0x36 2fb62: ff a9 ldd r31, Y+55 ; 0x37 2fb64: 53 82 std Z+3, r5 ; 0x03 2fb66: 42 82 std Z+2, r4 ; 0x02 2fb68: 0c ad ldd r16, Y+60 ; 0x3c 2fb6a: 1d ad ldd r17, Y+61 ; 0x3d bool dir1 = filenameIsDir; #endif /// find proper place uint16_t j = i; for (; j > 0; --j){ 2fb6c: 01 15 cp r16, r1 2fb6e: 11 05 cpc r17, r1 2fb70: 09 f0 breq .+2 ; 0x2fb74 2fb72: 5d cf rjmp .-326 ; 0x2fa2e 2fb74: 8f cf rjmp .-226 ; 0x2fa94 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)) 2fb76: 22 20 and r2, r2 2fb78: 99 f3 breq .-26 ; 0x2fb60 2fb7a: 8c cf rjmp .-232 ; 0x2fa94 2fb7c: 31 e0 ldi r19, 0x01 ; 1 2fb7e: 33 12 cpse r3, r19 2fb80: ef cf rjmp .-34 ; 0x2fb60 getfilename_simple(o2); char *name2 = LONGEST_FILENAME; // use the string in-place // Sort the current pair according to settings. if ( 2fb82: 80 91 db 14 lds r24, 0x14DB ; 0x8014db 2fb86: 28 12 cpse r2, r24 2fb88: 07 c0 rjmp .+14 ; 0x2fb98 #if HAS_FOLDER_SORTING (sdSort == SD_SORT_TIME && _SORT_CMP_TIME_DIR(FOLDER_SORTING)) || (sdSort == SD_SORT_ALPHA && !_SORT_CMP_DIR(FOLDER_SORTING)) 2fb8a: ce 01 movw r24, r28 2fb8c: 01 96 adiw r24, 0x01 ; 1 2fb8e: 0f 94 10 e2 call 0x3c420 ; 0x3c420 2fb92: 97 fd sbrc r25, 7 2fb94: e5 cf rjmp .-54 ; 0x2fb60 2fb96: 7e cf rjmp .-260 ; 0x2fa94 2fb98: 21 10 cpse r2, r1 2fb9a: e2 cf rjmp .-60 ; 0x2fb60 2fb9c: 7b cf rjmp .-266 ; 0x2fa94 0002fb9e : lsDive("",*curDir, NULL, LS_Count); //SERIAL_ECHOLN(nrFiles); return nrFiles; } bool CardReader::chdir(const char * relpath, bool doPresort) 2fb9e: cf 92 push r12 2fba0: df 92 push r13 2fba2: ef 92 push r14 2fba4: ff 92 push r15 2fba6: 0f 93 push r16 2fba8: 1f 93 push r17 2fbaa: cf 93 push r28 2fbac: df 93 push r29 2fbae: cd b7 in r28, 0x3d ; 61 2fbb0: de b7 in r29, 0x3e ; 62 2fbb2: a3 97 sbiw r28, 0x23 ; 35 2fbb4: 0f b6 in r0, 0x3f ; 63 2fbb6: f8 94 cli 2fbb8: de bf out 0x3e, r29 ; 62 2fbba: 0f be out 0x3f, r0 ; 63 2fbbc: cd bf out 0x3d, r28 ; 61 2fbbe: 7c 01 movw r14, r24 2fbc0: 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) {} 2fbc2: 19 82 std Y+1, r1 ; 0x01 2fbc4: 1c 82 std Y+4, r1 ; 0x04 { SdFile newfile; SdFile *parent=&root; if(workDir.isOpen()) 2fbc6: 80 91 3d 15 lds r24, 0x153D ; 0x80153d parent=&workDir; 2fbca: 9a e3 ldi r25, 0x3A ; 58 2fbcc: c9 2e mov r12, r25 2fbce: 95 e1 ldi r25, 0x15 ; 21 2fbd0: d9 2e mov r13, r25 bool CardReader::chdir(const char * relpath, bool doPresort) { SdFile newfile; SdFile *parent=&root; if(workDir.isOpen()) 2fbd2: 81 11 cpse r24, r1 2fbd4: 04 c0 rjmp .+8 ; 0x2fbde } bool CardReader::chdir(const char * relpath, bool doPresort) { SdFile newfile; SdFile *parent=&root; 2fbd6: 85 e1 ldi r24, 0x15 ; 21 2fbd8: c8 2e mov r12, r24 2fbda: 85 e1 ldi r24, 0x15 ; 21 2fbdc: 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); 2fbde: 21 e0 ldi r18, 0x01 ; 1 2fbe0: a7 01 movw r20, r14 2fbe2: b6 01 movw r22, r12 2fbe4: ce 01 movw r24, r28 2fbe6: 01 96 adiw r24, 0x01 ; 1 2fbe8: 0f 94 d3 63 call 0x2c7a6 ; 0x2c7a6 2fbec: 18 2f mov r17, r24 if(workDir.isOpen()) parent=&workDir; if(!newfile.open(*parent,relpath, O_READ) || ((workDirDepth + 1) >= MAX_DIR_DEPTH)) 2fbee: 88 23 and r24, r24 2fbf0: 21 f1 breq .+72 ; 0x2fc3a 2fbf2: 80 91 2f 16 lds r24, 0x162F ; 0x80162f 2fbf6: 85 30 cpi r24, 0x05 ; 5 2fbf8: 00 f5 brcc .+64 ; 0x2fc3a SERIAL_ECHOLN(relpath); return 0; } else { strcpy(dir_names[workDirDepth], relpath); 2fbfa: 29 e0 ldi r18, 0x09 ; 9 2fbfc: 82 9f mul r24, r18 2fbfe: c0 01 movw r24, r0 2fc00: 11 24 eor r1, r1 2fc02: b7 01 movw r22, r14 2fc04: 81 52 subi r24, 0x21 ; 33 2fc06: 9b 4e sbci r25, 0xEB ; 235 2fc08: 0f 94 42 e2 call 0x3c484 ; 0x3c484 puts(relpath); 2fc0c: c7 01 movw r24, r14 2fc0e: 0f 94 66 e2 call 0x3c4cc ; 0x3c4cc if (workDirDepth < MAX_DIR_DEPTH) { 2fc12: 80 91 2f 16 lds r24, 0x162F ; 0x80162f 2fc16: 86 30 cpi r24, 0x06 ; 6 2fc18: 80 f1 brcs .+96 ; 0x2fc7a for (uint8_t d = ++workDirDepth; d--;) workDirParents[d+1] = workDirParents[d]; workDirParents[0]=*parent; } workDir=newfile; 2fc1a: 83 e2 ldi r24, 0x23 ; 35 2fc1c: fe 01 movw r30, r28 2fc1e: 31 96 adiw r30, 0x01 ; 1 2fc20: aa e3 ldi r26, 0x3A ; 58 2fc22: b5 e1 ldi r27, 0x15 ; 21 2fc24: 01 90 ld r0, Z+ 2fc26: 0d 92 st X+, r0 2fc28: 8a 95 dec r24 2fc2a: e1 f7 brne .-8 ; 0x2fc24 #ifdef SDCARD_SORT_ALPHA if (doPresort) 2fc2c: 00 23 and r16, r16 2fc2e: 09 f4 brne .+2 ; 0x2fc32 2fc30: 4c c0 rjmp .+152 ; 0x2fcca presort(); 2fc32: 0f 94 4d 7c call 0x2f89a ; 0x2f89a else presort_flag = true; #endif return 1; 2fc36: 10 2f mov r17, r16 2fc38: 0c c0 rjmp .+24 ; 0x2fc52 if(workDir.isOpen()) parent=&workDir; if(!newfile.open(*parent,relpath, O_READ) || ((workDirDepth + 1) >= MAX_DIR_DEPTH)) { SERIAL_ECHO_START; 2fc3a: 82 ef ldi r24, 0xF2 ; 242 2fc3c: 9b ea ldi r25, 0xAB ; 171 2fc3e: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHORPGM(_n("Cannot enter subdir: "));////MSG_SD_CANT_ENTER_SUBDIR 2fc42: 86 e1 ldi r24, 0x16 ; 22 2fc44: 91 e7 ldi r25, 0x71 ; 113 2fc46: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHOLN(relpath); 2fc4a: c7 01 movw r24, r14 2fc4c: 0f 94 bb d5 call 0x3ab76 ; 0x3ab76 return 0; 2fc50: 10 e0 ldi r17, 0x00 ; 0 2fc52: ce 01 movw r24, r28 2fc54: 01 96 adiw r24, 0x01 ; 1 2fc56: 0e 94 49 77 call 0xee92 ; 0xee92 else presort_flag = true; #endif return 1; } } 2fc5a: 81 2f mov r24, r17 2fc5c: a3 96 adiw r28, 0x23 ; 35 2fc5e: 0f b6 in r0, 0x3f ; 63 2fc60: f8 94 cli 2fc62: de bf out 0x3e, r29 ; 62 2fc64: 0f be out 0x3f, r0 ; 63 2fc66: cd bf out 0x3d, r28 ; 61 2fc68: df 91 pop r29 2fc6a: cf 91 pop r28 2fc6c: 1f 91 pop r17 2fc6e: 0f 91 pop r16 2fc70: ff 90 pop r15 2fc72: ef 90 pop r14 2fc74: df 90 pop r13 2fc76: cf 90 pop r12 2fc78: 08 95 ret { strcpy(dir_names[workDirDepth], relpath); puts(relpath); if (workDirDepth < MAX_DIR_DEPTH) { for (uint8_t d = ++workDirDepth; d--;) 2fc7a: 8f 5f subi r24, 0xFF ; 255 2fc7c: 80 93 2f 16 sts 0x162F, r24 ; 0x80162f workDirParents[d+1] = workDirParents[d]; 2fc80: 93 e2 ldi r25, 0x23 ; 35 { strcpy(dir_names[workDirDepth], relpath); puts(relpath); if (workDirDepth < MAX_DIR_DEPTH) { for (uint8_t d = ++workDirDepth; d--;) 2fc82: 81 50 subi r24, 0x01 ; 1 2fc84: c8 f0 brcs .+50 ; 0x2fcb8 workDirParents[d+1] = workDirParents[d]; 2fc86: 28 2f mov r18, r24 2fc88: 30 e0 ldi r19, 0x00 ; 0 2fc8a: a9 01 movw r20, r18 2fc8c: 4f 5f subi r20, 0xFF ; 255 2fc8e: 5f 4f sbci r21, 0xFF ; 255 2fc90: 94 9f mul r25, r20 2fc92: d0 01 movw r26, r0 2fc94: 95 9f mul r25, r21 2fc96: b0 0d add r27, r0 2fc98: 11 24 eor r1, r1 2fc9a: a3 5a subi r26, 0xA3 ; 163 2fc9c: ba 4e sbci r27, 0xEA ; 234 2fc9e: 92 9f mul r25, r18 2fca0: f0 01 movw r30, r0 2fca2: 93 9f mul r25, r19 2fca4: f0 0d add r31, r0 2fca6: 11 24 eor r1, r1 2fca8: e3 5a subi r30, 0xA3 ; 163 2fcaa: fa 4e sbci r31, 0xEA ; 234 2fcac: 29 2f mov r18, r25 2fcae: 01 90 ld r0, Z+ 2fcb0: 0d 92 st X+, r0 2fcb2: 2a 95 dec r18 2fcb4: e1 f7 brne .-8 ; 0x2fcae 2fcb6: e5 cf rjmp .-54 ; 0x2fc82 workDirParents[0]=*parent; 2fcb8: 83 e2 ldi r24, 0x23 ; 35 2fcba: f6 01 movw r30, r12 2fcbc: ad e5 ldi r26, 0x5D ; 93 2fcbe: b5 e1 ldi r27, 0x15 ; 21 2fcc0: 01 90 ld r0, Z+ 2fcc2: 0d 92 st X+, r0 2fcc4: 8a 95 dec r24 2fcc6: e1 f7 brne .-8 ; 0x2fcc0 2fcc8: a8 cf rjmp .-176 ; 0x2fc1a #ifdef SDCARD_SORT_ALPHA if (doPresort) presort(); else presort_flag = true; 2fcca: 81 e0 ldi r24, 0x01 ; 1 2fccc: 80 93 de 14 sts 0x14DE, r24 ; 0x8014de 2fcd0: c0 cf rjmp .-128 ; 0x2fc52 0002fcd2 : } } void __attribute__((noinline)) CardReader::cdroot(bool doPresort) { workDir=root; 2fcd2: 93 e2 ldi r25, 0x23 ; 35 2fcd4: e5 e1 ldi r30, 0x15 ; 21 2fcd6: f5 e1 ldi r31, 0x15 ; 21 2fcd8: aa e3 ldi r26, 0x3A ; 58 2fcda: b5 e1 ldi r27, 0x15 ; 21 2fcdc: 01 90 ld r0, Z+ 2fcde: 0d 92 st X+, r0 2fce0: 9a 95 dec r25 2fce2: e1 f7 brne .-8 ; 0x2fcdc workDirDepth = 0; 2fce4: 10 92 2f 16 sts 0x162F, r1 ; 0x80162f curDir=&workDir; 2fce8: 2a e3 ldi r18, 0x3A ; 58 2fcea: 35 e1 ldi r19, 0x15 ; 21 2fcec: 30 93 39 15 sts 0x1539, r19 ; 0x801539 2fcf0: 20 93 38 15 sts 0x1538, r18 ; 0x801538 #ifdef SDCARD_SORT_ALPHA if (doPresort) 2fcf4: 81 11 cpse r24, r1 presort(); 2fcf6: 0d 94 4d 7c jmp 0x2f89a ; 0x2f89a else presort_flag = true; 2fcfa: 81 e0 ldi r24, 0x01 ; 1 2fcfc: 80 93 de 14 sts 0x14DE, r24 ; 0x8014de #endif } 2fd00: 08 95 ret 0002fd02 : * * @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) 2fd02: 8f 92 push r8 2fd04: 9f 92 push r9 2fd06: af 92 push r10 2fd08: bf 92 push r11 2fd0a: cf 92 push r12 2fd0c: df 92 push r13 2fd0e: ef 92 push r14 2fd10: ff 92 push r15 2fd12: 0f 93 push r16 2fd14: 1f 93 push r17 2fd16: cf 93 push r28 2fd18: df 93 push r29 2fd1a: cd b7 in r28, 0x3d ; 61 2fd1c: de b7 in r29, 0x3e ; 62 2fd1e: 2d 97 sbiw r28, 0x0d ; 13 2fd20: 0f b6 in r0, 0x3f ; 63 2fd22: f8 94 cli 2fd24: de bf out 0x3e, r29 ; 62 2fd26: 0f be out 0x3f, r0 ; 63 2fd28: cd bf out 0x3d, r28 ; 61 { curDir=&root; 2fd2a: 25 e1 ldi r18, 0x15 ; 21 2fd2c: 35 e1 ldi r19, 0x15 ; 21 2fd2e: 30 93 39 15 sts 0x1539, r19 ; 0x801539 2fd32: 20 93 38 15 sts 0x1538, r18 ; 0x801538 if (!fileName) 2fd36: dc 01 movw r26, r24 2fd38: ed 91 ld r30, X+ 2fd3a: fc 91 ld r31, X 2fd3c: 30 97 sbiw r30, 0x00 ; 0 2fd3e: a1 f4 brne .+40 ; 0x2fd68 } else //relative path { curDir = &workDir; } return 1; 2fd40: 81 e0 ldi r24, 0x01 ; 1 } 2fd42: 2d 96 adiw r28, 0x0d ; 13 2fd44: 0f b6 in r0, 0x3f ; 63 2fd46: f8 94 cli 2fd48: de bf out 0x3e, r29 ; 62 2fd4a: 0f be out 0x3f, r0 ; 63 2fd4c: cd bf out 0x3d, r28 ; 61 2fd4e: df 91 pop r29 2fd50: cf 91 pop r28 2fd52: 1f 91 pop r17 2fd54: 0f 91 pop r16 2fd56: ff 90 pop r15 2fd58: ef 90 pop r14 2fd5a: df 90 pop r13 2fd5c: cf 90 pop r12 2fd5e: bf 90 pop r11 2fd60: af 90 pop r10 2fd62: 9f 90 pop r9 2fd64: 8f 90 pop r8 2fd66: 08 95 ret curDir=&root; if (!fileName) return 1; const char *dirname_start, *dirname_end; if (fileName[0] == '/') // absolute path 2fd68: 20 81 ld r18, Z 2fd6a: 2f 32 cpi r18, 0x2F ; 47 2fd6c: 09 f0 breq .+2 ; 0x2fd70 2fd6e: 47 c0 rjmp .+142 ; 0x2fdfe 2fd70: 6c 01 movw r12, r24 { cdroot(false); 2fd72: 80 e0 ldi r24, 0x00 ; 0 2fd74: 0f 94 69 7e call 0x2fcd2 ; 0x2fcd2 dirname_start = fileName + 1; 2fd78: f6 01 movw r30, r12 2fd7a: 00 81 ld r16, Z 2fd7c: 11 81 ldd r17, Z+1 ; 0x01 2fd7e: 0f 5f subi r16, 0xFF ; 255 2fd80: 1f 4f sbci r17, 0xFF ; 255 strncpy(subdirname, dirname_start, len); subdirname[len] = 0; if (!chdir(subdirname, false)) return 0; curDir = &workDir; 2fd82: 9a e3 ldi r25, 0x3A ; 58 2fd84: 89 2e mov r8, r25 2fd86: 95 e1 ldi r25, 0x15 ; 21 2fd88: 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) 2fd8a: d8 01 movw r26, r16 2fd8c: 8c 91 ld r24, X 2fd8e: 88 23 and r24, r24 2fd90: b9 f2 breq .-82 ; 0x2fd40 { dirname_end = strchr(dirname_start, '/'); 2fd92: 6f e2 ldi r22, 0x2F ; 47 2fd94: 70 e0 ldi r23, 0x00 ; 0 2fd96: c8 01 movw r24, r16 2fd98: 0f 94 2e e2 call 0x3c45c ; 0x3c45c 2fd9c: 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) 2fd9e: 00 97 sbiw r24, 0x00 ; 0 2fda0: 51 f1 breq .+84 ; 0x2fdf6 2fda2: 08 17 cp r16, r24 2fda4: 19 07 cpc r17, r25 2fda6: 38 f5 brcc .+78 ; 0x2fdf6 { 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); 2fda8: 7c 01 movw r14, r24 2fdaa: e0 1a sub r14, r16 2fdac: f1 0a sbc r15, r17 2fdae: bd e0 ldi r27, 0x0D ; 13 2fdb0: eb 16 cp r14, r27 2fdb2: f1 04 cpc r15, r1 2fdb4: 18 f0 brcs .+6 ; 0x2fdbc 2fdb6: 8c e0 ldi r24, 0x0C ; 12 2fdb8: e8 2e mov r14, r24 2fdba: f1 2c mov r15, r1 strncpy(subdirname, dirname_start, len); 2fdbc: a7 01 movw r20, r14 2fdbe: b8 01 movw r22, r16 2fdc0: ce 01 movw r24, r28 2fdc2: 01 96 adiw r24, 0x01 ; 1 2fdc4: 0f 94 57 e2 call 0x3c4ae ; 0x3c4ae subdirname[len] = 0; 2fdc8: e1 e0 ldi r30, 0x01 ; 1 2fdca: f0 e0 ldi r31, 0x00 ; 0 2fdcc: ec 0f add r30, r28 2fdce: fd 1f adc r31, r29 2fdd0: ee 0d add r30, r14 2fdd2: ff 1d adc r31, r15 2fdd4: 10 82 st Z, r1 if (!chdir(subdirname, false)) 2fdd6: 60 e0 ldi r22, 0x00 ; 0 2fdd8: ce 01 movw r24, r28 2fdda: 01 96 adiw r24, 0x01 ; 1 2fddc: 0f 94 cf 7d call 0x2fb9e ; 0x2fb9e 2fde0: 88 23 and r24, r24 2fde2: 09 f4 brne .+2 ; 0x2fde6 2fde4: ae cf rjmp .-164 ; 0x2fd42 return 0; curDir = &workDir; 2fde6: 90 92 39 15 sts 0x1539, r9 ; 0x801539 2fdea: 80 92 38 15 sts 0x1538, r8 ; 0x801538 dirname_start = dirname_end + 1; 2fdee: 85 01 movw r16, r10 2fdf0: 0f 5f subi r16, 0xFF ; 255 2fdf2: 1f 4f sbci r17, 0xFF ; 255 2fdf4: ca cf rjmp .-108 ; 0x2fd8a } else // the reminder after all /fsa/fdsa/ is the filename { fileName = dirname_start; 2fdf6: f6 01 movw r30, r12 2fdf8: 11 83 std Z+1, r17 ; 0x01 2fdfa: 00 83 st Z, r16 2fdfc: a1 cf rjmp .-190 ; 0x2fd40 } } else //relative path { curDir = &workDir; 2fdfe: 8a e3 ldi r24, 0x3A ; 58 2fe00: 95 e1 ldi r25, 0x15 ; 21 2fe02: 90 93 39 15 sts 0x1539, r25 ; 0x801539 2fe06: 80 93 38 15 sts 0x1538, r24 ; 0x801538 2fe0a: 9a cf rjmp .-204 ; 0x2fd40 0002fe0c : 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*/){ 2fe0c: bf 92 push r11 2fe0e: cf 92 push r12 2fe10: df 92 push r13 2fe12: ef 92 push r14 2fe14: ff 92 push r15 2fe16: 0f 93 push r16 2fe18: 1f 93 push r17 2fe1a: cf 93 push r28 2fe1c: df 93 push r29 2fe1e: 1f 92 push r1 2fe20: 1f 92 push r1 2fe22: cd b7 in r28, 0x3d ; 61 2fe24: de b7 in r29, 0x3e ; 62 if(!mounted) 2fe26: 20 91 90 14 lds r18, 0x1490 ; 0x801490 2fe2a: 22 23 and r18, r18 2fe2c: 09 f4 brne .+2 ; 0x2fe30 2fe2e: ef c0 rjmp .+478 ; 0x3000e 2fe30: 7c 01 movw r14, r24 return; if(file.isOpen()){ //replacing current file by new file, or subfile call 2fe32: 80 91 22 17 lds r24, 0x1722 ; 0x801722 2fe36: 88 23 and r24, r24 2fe38: 09 f4 brne .+2 ; 0x2fe3c 2fe3a: 04 c1 rjmp .+520 ; 0x30044 if(!replace_current){ 2fe3c: 61 11 cpse r22, r1 2fe3e: f6 c0 rjmp .+492 ; 0x3002c if((int)file_subcall_ctr>(int)SD_PROCEDURE_DEPTH-1){ 2fe40: d0 90 42 17 lds r13, 0x1742 ; 0x801742 2fe44: dd 20 and r13, r13 2fe46: 21 f0 breq .+8 ; 0x2fe50 // 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); 2fe48: 8c ec ldi r24, 0xCC ; 204 2fe4a: 9a ea ldi r25, 0xAA ; 170 2fe4c: 0e 94 22 7a call 0xf444 ; 0xf444 return; } SERIAL_ECHO_START; 2fe50: 82 ef ldi r24, 0xF2 ; 242 2fe52: 9b ea ldi r25, 0xAB ; 171 2fe54: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHORPGM(ofSubroutineCallTgt); 2fe58: 83 eb ldi r24, 0xB3 ; 179 2fe5a: 9a ea ldi r25, 0xAA ; 170 2fe5c: 0e 94 68 77 call 0xeed0 ; 0xeed0 2fe60: c7 01 movw r24, r14 2fe62: 0e 94 2c 88 call 0x11058 ; 0x11058 SERIAL_ECHO(name); SERIAL_ECHORPGM(ofParent); 2fe66: 88 ea ldi r24, 0xA8 ; 168 2fe68: 9a ea ldi r25, 0xAA ; 170 2fe6a: 0e 94 68 77 call 0xeed0 ; 0xeed0 //store current filename and position getAbsFilename(filenames[file_subcall_ctr]); 2fe6e: 00 91 42 17 lds r16, 0x1742 ; 0x801742 2fe72: 25 e5 ldi r18, 0x55 ; 85 2fe74: 02 9f mul r16, r18 2fe76: 80 01 movw r16, r0 2fe78: 11 24 eor r1, r1 } void CardReader::getAbsFilename(char *t) { uint8_t cnt=0; *t='/';t++;cnt++; 2fe7a: 09 5b subi r16, 0xB9 ; 185 2fe7c: 18 4e sbci r17, 0xE8 ; 232 2fe7e: 8f e2 ldi r24, 0x2F ; 47 2fe80: f8 01 movw r30, r16 2fe82: 81 93 st Z+, r24 2fe84: 8f 01 movw r16, r30 2fe86: cc 24 eor r12, r12 2fe88: c3 94 inc r12 for(uint8_t i=0;i 2fe92: d8 16 cp r13, r24 2fe94: b0 f4 brcc .+44 ; 0x2fec2 { workDirParents[i].getFilename(t); //SDBaseFile.getfilename! 2fe96: db 9c mul r13, r11 2fe98: c0 01 movw r24, r0 2fe9a: 11 24 eor r1, r1 2fe9c: b8 01 movw r22, r16 2fe9e: 83 5a subi r24, 0xA3 ; 163 2fea0: 9a 4e sbci r25, 0xEA ; 234 2fea2: 0f 94 34 58 call 0x2b068 ; 0x2b068 2fea6: c8 01 movw r24, r16 2fea8: 8c 01 movw r16, r24 2feaa: 01 96 adiw r24, 0x01 ; 1 while(*t!=0 && cnt< MAXPATHNAMELENGTH) 2feac: f8 01 movw r30, r16 2feae: 20 81 ld r18, Z 2feb0: 22 23 and r18, r18 2feb2: 29 f0 breq .+10 ; 0x2febe 2feb4: f4 e5 ldi r31, 0x54 ; 84 2feb6: fc 15 cp r31, r12 2feb8: 10 f0 brcs .+4 ; 0x2febe {t++;cnt++;} //crawl counter forward. 2feba: c3 94 inc r12 2febc: f5 cf rjmp .-22 ; 0x2fea8 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) 2fec2: 27 e4 ldi r18, 0x47 ; 71 2fec4: 2c 15 cp r18, r12 2fec6: 08 f4 brcc .+2 ; 0x2feca 2fec8: ae c0 rjmp .+348 ; 0x30026 file.getFilename(t); 2feca: b8 01 movw r22, r16 2fecc: 8f e1 ldi r24, 0x1F ; 31 2fece: 97 e1 ldi r25, 0x17 ; 23 2fed0: 0f 94 34 58 call 0x2b068 ; 0x2b068 SERIAL_ECHORPGM(ofParent); //store current filename and position getAbsFilename(filenames[file_subcall_ctr]); SERIAL_ECHO(filenames[file_subcall_ctr]); 2fed4: 80 91 42 17 lds r24, 0x1742 ; 0x801742 2fed8: f5 e5 ldi r31, 0x55 ; 85 2feda: 8f 9f mul r24, r31 2fedc: c0 01 movw r24, r0 2fede: 11 24 eor r1, r1 2fee0: 89 5b subi r24, 0xB9 ; 185 2fee2: 98 4e sbci r25, 0xE8 ; 232 2fee4: 0e 94 2c 88 call 0x11058 ; 0x11058 SERIAL_ECHORPGM(ofPos); 2fee8: 82 ea ldi r24, 0xA2 ; 162 2feea: 9a ea ldi r25, 0xAA ; 170 2feec: 0e 94 68 77 call 0xeed0 ; 0xeed0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 2fef0: 60 91 a3 17 lds r22, 0x17A3 ; 0x8017a3 2fef4: 70 91 a4 17 lds r23, 0x17A4 ; 0x8017a4 2fef8: 80 91 a5 17 lds r24, 0x17A5 ; 0x8017a5 2fefc: 90 91 a6 17 lds r25, 0x17A6 ; 0x8017a6 2ff00: 4a e0 ldi r20, 0x0A ; 10 2ff02: 0f 94 c1 d4 call 0x3a982 ; 0x3a982 } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 2ff06: 0f 94 b8 d5 call 0x3ab70 ; 0x3ab70 SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; 2ff0a: 80 91 42 17 lds r24, 0x1742 ; 0x801742 2ff0e: 24 e0 ldi r18, 0x04 ; 4 2ff10: 82 9f mul r24, r18 2ff12: f0 01 movw r30, r0 2ff14: 11 24 eor r1, r1 2ff16: ed 5b subi r30, 0xBD ; 189 2ff18: f8 4e sbci r31, 0xE8 ; 232 2ff1a: 40 91 a3 17 lds r20, 0x17A3 ; 0x8017a3 2ff1e: 50 91 a4 17 lds r21, 0x17A4 ; 0x8017a4 2ff22: 60 91 a5 17 lds r22, 0x17A5 ; 0x8017a5 2ff26: 70 91 a6 17 lds r23, 0x17A6 ; 0x8017a6 2ff2a: 40 83 st Z, r20 2ff2c: 51 83 std Z+1, r21 ; 0x01 2ff2e: 62 83 std Z+2, r22 ; 0x02 2ff30: 73 83 std Z+3, r23 ; 0x03 file_subcall_ctr++; 2ff32: 8f 5f subi r24, 0xFF ; 255 2ff34: 80 93 42 17 sts 0x1742, r24 ; 0x801742 } else { SERIAL_ECHO_START; SERIAL_ECHORPGM(ofNowDoingFile); SERIAL_ECHOLN(name); } file.close(); 2ff38: 8f e1 ldi r24, 0x1F ; 31 2ff3a: 97 e1 ldi r25, 0x17 ; 23 2ff3c: 0f 94 2b 58 call 0x2b056 ; 0x2b056 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; 2ff40: 10 92 8f 14 sts 0x148F, r1 ; 0x80148f const char *fname=name; 2ff44: fa 82 std Y+2, r15 ; 0x02 2ff46: e9 82 std Y+1, r14 ; 0x01 if (!diveSubfolder(fname)) 2ff48: ce 01 movw r24, r28 2ff4a: 01 96 adiw r24, 0x01 ; 1 2ff4c: 0f 94 81 7e call 0x2fd02 ; 0x2fd02 2ff50: 88 23 and r24, r24 2ff52: 09 f4 brne .+2 ; 0x2ff56 2ff54: 5c c0 rjmp .+184 ; 0x3000e */ 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) ){ 2ff56: 49 81 ldd r20, Y+1 ; 0x01 2ff58: 5a 81 ldd r21, Y+2 ; 0x02 2ff5a: 60 91 38 15 lds r22, 0x1538 ; 0x801538 2ff5e: 70 91 39 15 lds r23, 0x1539 ; 0x801539 2ff62: 21 e0 ldi r18, 0x01 ; 1 2ff64: 8f e1 ldi r24, 0x1F ; 31 2ff66: 97 e1 ldi r25, 0x17 ; 23 2ff68: 0f 94 d3 63 call 0x2c7a6 ; 0x2c7a6 2ff6c: 88 23 and r24, r24 2ff6e: 09 f4 brne .+2 ; 0x2ff72 2ff70: 77 c0 rjmp .+238 ; 0x30060 // compute the block to start with if( ! gfComputeNextFileBlock() ) 2ff72: 8f e1 ldi r24, 0x1F ; 31 2ff74: 97 e1 ldi r25, 0x17 ; 23 2ff76: 0f 94 d4 55 call 0x2aba8 ; 0x2aba8 2ff7a: 88 23 and r24, r24 2ff7c: 09 f4 brne .+2 ; 0x2ff80 2ff7e: 70 c0 rjmp .+224 ; 0x30060 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; 2ff80: 80 91 40 17 lds r24, 0x1740 ; 0x801740 2ff84: 90 91 41 17 lds r25, 0x1741 ; 0x801741 2ff88: 84 56 subi r24, 0x64 ; 100 2ff8a: 91 4f sbci r25, 0xF1 ; 241 2ff8c: 90 93 3b 17 sts 0x173B, r25 ; 0x80173b 2ff90: 80 93 3a 17 sts 0x173A, r24 ; 0x80173a return; if (file.openFilteredGcode(curDir, fname)) { getfilename(0, fname); 2ff94: 89 81 ldd r24, Y+1 ; 0x01 2ff96: 9a 81 ldd r25, Y+2 ; 0x02 2ff98: 0f 94 f9 78 call 0x2f1f2 ; 0x2f1f2 filesize = file.fileSize(); 2ff9c: 80 91 30 17 lds r24, 0x1730 ; 0x801730 2ffa0: 90 91 31 17 lds r25, 0x1731 ; 0x801731 2ffa4: a0 91 32 17 lds r26, 0x1732 ; 0x801732 2ffa8: b0 91 33 17 lds r27, 0x1733 ; 0x801733 2ffac: 80 93 9c 17 sts 0x179C, r24 ; 0x80179c 2ffb0: 90 93 9d 17 sts 0x179D, r25 ; 0x80179d 2ffb4: a0 93 9e 17 sts 0x179E, r26 ; 0x80179e 2ffb8: b0 93 9f 17 sts 0x179F, r27 ; 0x80179f SERIAL_PROTOCOLRPGM(ofFileOpened);////MSG_SD_FILE_OPENED 2ffbc: 82 e7 ldi r24, 0x72 ; 114 2ffbe: 9a ea ldi r25, 0xAA ; 170 2ffc0: 0e 94 68 77 call 0xeed0 ; 0xeed0 printAbsFilenameFast(); 2ffc4: 0f 94 dc 79 call 0x2f3b8 ; 0x2f3b8 SERIAL_PROTOCOLRPGM(ofSize);////MSG_SD_SIZE 2ffc8: 8a e6 ldi r24, 0x6A ; 106 2ffca: 9a ea ldi r25, 0xAA ; 170 2ffcc: 0e 94 68 77 call 0xeed0 ; 0xeed0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 2ffd0: 60 91 9c 17 lds r22, 0x179C ; 0x80179c 2ffd4: 70 91 9d 17 lds r23, 0x179D ; 0x80179d 2ffd8: 80 91 9e 17 lds r24, 0x179E ; 0x80179e 2ffdc: 90 91 9f 17 lds r25, 0x179F ; 0x80179f 2ffe0: 4a e0 ldi r20, 0x0A ; 10 2ffe2: 0f 94 c1 d4 call 0x3a982 ; 0x3a982 } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 2ffe6: 0f 94 b8 d5 call 0x3ab70 ; 0x3ab70 SERIAL_PROTOCOLLN(filesize); sdpos = 0; 2ffea: 10 92 a3 17 sts 0x17A3, r1 ; 0x8017a3 2ffee: 10 92 a4 17 sts 0x17A4, r1 ; 0x8017a4 2fff2: 10 92 a5 17 sts 0x17A5, r1 ; 0x8017a5 2fff6: 10 92 a6 17 sts 0x17A6, r1 ; 0x8017a6 SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED 2fffa: 8c e5 ldi r24, 0x5C ; 92 2fffc: 9a ea ldi r25, 0xAA ; 170 2fffe: 0e 94 93 79 call 0xf326 ; 0xf326 lcd_setstatuspgm(ofFileSelected); 30002: 8c e5 ldi r24, 0x5C ; 92 30004: 9a ea ldi r25, 0xAA ; 170 30006: 0e 94 38 f1 call 0x1e270 ; 0x1e270 scrollstuff = 0; 3000a: 10 92 b8 0d sts 0x0DB8, r1 ; 0x800db8 } else { SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); SERIAL_PROTOCOL(fname); SERIAL_PROTOCOLLN('.'); } } 3000e: 0f 90 pop r0 30010: 0f 90 pop r0 30012: df 91 pop r29 30014: cf 91 pop r28 30016: 1f 91 pop r17 30018: 0f 91 pop r16 3001a: ff 90 pop r15 3001c: ef 90 pop r14 3001e: df 90 pop r13 30020: cf 90 pop r12 30022: bf 90 pop r11 30024: 08 95 ret {t++;cnt++;} //crawl counter forward. } if(cnt < MAXPATHNAMELENGTH - FILENAME_LENGTH) file.getFilename(t); else t[0]=0; 30026: f8 01 movw r30, r16 30028: 10 82 st Z, r1 3002a: 54 cf rjmp .-344 ; 0x2fed4 SERIAL_ECHORPGM(ofPos); SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; file_subcall_ctr++; } else { SERIAL_ECHO_START; 3002c: 82 ef ldi r24, 0xF2 ; 242 3002e: 9b ea ldi r25, 0xAB ; 171 30030: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHORPGM(ofNowDoingFile); 30034: 81 e9 ldi r24, 0x91 ; 145 30036: 9a ea ldi r25, 0xAA ; 170 30038: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHOLN(name); 3003c: c7 01 movw r24, r14 3003e: 0f 94 bb d5 call 0x3ab76 ; 0x3ab76 30042: 7a cf rjmp .-268 ; 0x2ff38 } file.close(); } else { //opening fresh file file_subcall_ctr=0; //resetting procedure depth in case user cancels print while in procedure 30044: 10 92 42 17 sts 0x1742, r1 ; 0x801742 SERIAL_ECHO_START; 30048: 82 ef ldi r24, 0xF2 ; 242 3004a: 9b ea ldi r25, 0xAB ; 171 3004c: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHORPGM(ofNowFreshFile); 30050: 80 e8 ldi r24, 0x80 ; 128 30052: 9a ea ldi r25, 0xAA ; 170 30054: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHOLN(name); 30058: c7 01 movw r24, r14 3005a: 0f 94 bb d5 call 0x3ab76 ; 0x3ab76 3005e: 70 cf rjmp .-288 ; 0x2ff40 SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED lcd_setstatuspgm(ofFileSelected); scrollstuff = 0; } else { SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); 30060: 82 e0 ldi r24, 0x02 ; 2 30062: 91 e7 ldi r25, 0x71 ; 113 30064: 0e 94 68 77 call 0xeed0 ; 0xeed0 30068: 89 81 ldd r24, Y+1 ; 0x01 3006a: 9a 81 ldd r25, Y+2 ; 0x02 3006c: 0e 94 2c 88 call 0x11058 ; 0x11058 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 30070: 8e e2 ldi r24, 0x2E ; 46 30072: 0e 94 4f 77 call 0xee9e ; 0xee9e } void MarlinSerial::println(char c, int base) { print(c, base); println(); 30076: 0f 94 b8 d5 call 0x3ab70 ; 0x3ab70 3007a: c9 cf rjmp .-110 ; 0x3000e 0003007c : void CardReader::printingHasFinished() { st_synchronize(); 3007c: 0f 94 a3 42 call 0x28546 ; 0x28546 file.close(); 30080: 8f e1 ldi r24, 0x1F ; 31 30082: 97 e1 ldi r25, 0x17 ; 23 30084: 0f 94 2b 58 call 0x2b056 ; 0x2b056 if(file_subcall_ctr>0) //heading up to a parent file that called current as a procedure. 30088: 80 91 42 17 lds r24, 0x1742 ; 0x801742 3008c: 88 23 and r24, r24 3008e: 69 f1 breq .+90 ; 0x300ea { file_subcall_ctr--; 30090: 81 50 subi r24, 0x01 ; 1 30092: 80 93 42 17 sts 0x1742, r24 ; 0x801742 openFileReadFilteredGcode(filenames[file_subcall_ctr],true); 30096: 25 e5 ldi r18, 0x55 ; 85 30098: 82 9f mul r24, r18 3009a: c0 01 movw r24, r0 3009c: 11 24 eor r1, r1 3009e: 61 e0 ldi r22, 0x01 ; 1 300a0: 89 5b subi r24, 0xB9 ; 185 300a2: 98 4e sbci r25, 0xE8 ; 232 300a4: 0f 94 06 7f call 0x2fe0c ; 0x2fe0c setIndex(filespos[file_subcall_ctr]); 300a8: e0 91 42 17 lds r30, 0x1742 ; 0x801742 300ac: 84 e0 ldi r24, 0x04 ; 4 300ae: e8 9f mul r30, r24 300b0: f0 01 movw r30, r0 300b2: 11 24 eor r1, r1 300b4: ed 5b subi r30, 0xBD ; 189 300b6: f8 4e sbci r31, 0xE8 ; 232 300b8: 60 81 ld r22, Z 300ba: 71 81 ldd r23, Z+1 ; 0x01 300bc: 82 81 ldd r24, Z+2 ; 0x02 300be: 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);}; 300c0: 60 93 a3 17 sts 0x17A3, r22 ; 0x8017a3 300c4: 70 93 a4 17 sts 0x17A4, r23 ; 0x8017a4 300c8: 80 93 a5 17 sts 0x17A5, r24 ; 0x8017a5 300cc: 90 93 a6 17 sts 0x17A6, r25 ; 0x8017a6 300d0: 0f 94 57 75 call 0x2eaae ; 0x2eaae SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED } void CardReader::startFileprint() { if(mounted) 300d4: 80 91 90 14 lds r24, 0x1490 ; 0x801490 300d8: 88 23 and r24, r24 300da: 71 f0 breq .+28 ; 0x300f8 { sdprinting = true; 300dc: 81 e0 ldi r24, 0x01 ; 1 300de: 80 93 8f 14 sts 0x148F, r24 ; 0x80148f 300e2: 85 e0 ldi r24, 0x05 ; 5 300e4: 80 93 b7 0d sts 0x0DB7, r24 ; 0x800db7 <_ZL13printer_state.lto_priv.401> 300e8: 08 95 ret setIndex(filespos[file_subcall_ctr]); startFileprint(); } else { sdprinting = false; 300ea: 10 92 8f 14 sts 0x148F, r1 ; 0x80148f 300ee: 83 e0 ldi r24, 0x03 ; 3 300f0: 80 93 b7 0d sts 0x0DB7, r24 ; 0x800db7 <_ZL13printer_state.lto_priv.401> SetPrinterState(PrinterState::SDPrintingFinished); //set printer state to show LCD menu after finished SD print if(SD_FINISHED_STEPPERRELEASE) { finishAndDisableSteppers(); 300f4: 0c 94 80 82 jmp 0x10500 ; 0x10500 autotempShutdown(); #ifdef SDCARD_SORT_ALPHA //presort(); #endif } } 300f8: 08 95 ret 000300fa : root.rewind(); lsDive("",root, NULL, LS_SerialPrint, params); } void CardReader::mount(bool doPresort/* = true*/) 300fa: cf 92 push r12 300fc: df 92 push r13 300fe: ef 92 push r14 30100: ff 92 push r15 30102: 0f 93 push r16 30104: 1f 93 push r17 30106: cf 93 push r28 30108: df 93 push r29 3010a: 08 2f mov r16, r24 { mounted = false; 3010c: 10 92 90 14 sts 0x1490, r1 ; 0x801490 if(root.isOpen()) 30110: 80 91 18 15 lds r24, 0x1518 ; 0x801518 30114: 88 23 and r24, r24 30116: 21 f0 breq .+8 ; 0x30120 root.close(); 30118: 85 e1 ldi r24, 0x15 ; 21 3011a: 95 e1 ldi r25, 0x15 ; 21 3011c: 0f 94 2b 58 call 0x2b056 ; 0x2b056 * \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; 30120: 10 92 ff 16 sts 0x16FF, r1 ; 0x8016ff 30124: 10 92 fc 16 sts 0x16FC, r1 ; 0x8016fc // 16-bit init start time allows over a minute uint16_t t0 = (uint16_t)_millis(); 30128: 0f 94 22 29 call 0x25244 ; 0x25244 3012c: eb 01 movw r28, r22 uint32_t arg; // set pin modes chipSelectHigh(); 3012e: 0f 94 7a 74 call 0x2e8f4 ; 0x2e8f4 SET_OUTPUT(SDSS); 30132: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 30136: 80 64 ori r24, 0x40 ; 64 30138: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> SET_INPUT(MISO); 3013c: 23 98 cbi 0x04, 3 ; 4 SET_OUTPUT(MOSI); 3013e: 22 9a sbi 0x04, 2 ; 4 SET_OUTPUT(SCK); 30140: 21 9a sbi 0x04, 1 ; 4 #ifndef SOFTWARE_SPI // SS must be in output mode even it is not chip select SET_OUTPUT(SS); 30142: 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); 30144: 28 9a sbi 0x05, 0 ; 5 #endif // SET_SPI_SS_HIGH // set SCK rate for initialization commands spiRate_ = SPI_SD_INIT_RATE; 30146: 85 e0 ldi r24, 0x05 ; 5 30148: 80 93 fd 16 sts 0x16FD, r24 ; 0x8016fd * 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); 3014c: 82 e5 ldi r24, 0x52 ; 82 3014e: 8c bd out 0x2c, r24 ; 44 SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; 30150: 1d bc out 0x2d, r1 ; 45 30152: 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); 30154: 8f ef ldi r24, 0xFF ; 255 30156: 0f 94 00 52 call 0x2a400 ; 0x2a400 3015a: 11 50 subi r17, 0x01 ; 1 3015c: d9 f7 brne .-10 ; 0x30154 WRITE(MISO, 1); // temporarily enable the MISO line pullup 3015e: 2b 9a sbi 0x05, 3 ; 5 // command to go idle in SPI mode while ((status_ = cardCommand(CMD0, 0)) != R1_IDLE_STATE) { 30160: 20 e0 ldi r18, 0x00 ; 0 30162: 30 e0 ldi r19, 0x00 ; 0 30164: a9 01 movw r20, r18 30166: 60 e0 ldi r22, 0x00 ; 0 30168: 8c ef ldi r24, 0xFC ; 252 3016a: 96 e1 ldi r25, 0x16 ; 22 3016c: 0f 94 0c 52 call 0x2a418 ; 0x2a418 30170: 80 93 fe 16 sts 0x16FE, r24 ; 0x8016fe 30174: 81 30 cpi r24, 0x01 ; 1 30176: 61 f0 breq .+24 ; 0x30190 if (((uint16_t)_millis() - t0) > SD_INIT_TIMEOUT) { 30178: 0f 94 22 29 call 0x25244 ; 0x25244 3017c: 6c 1b sub r22, r28 3017e: 7d 0b sbc r23, r29 30180: 61 3d cpi r22, 0xD1 ; 209 30182: 77 40 sbci r23, 0x07 ; 7 30184: 68 f3 brcs .-38 ; 0x30160 WRITE(MISO, 0); // disable the MISO line pullup 30186: 2b 98 cbi 0x05, 3 ; 5 30188: 81 e0 ldi r24, 0x01 ; 1 3018a: 80 93 fc 16 sts 0x16FC, r24 ; 0x8016fc 3018e: 22 c0 rjmp .+68 ; 0x301d4 error(SD_CARD_ERROR_CMD0); goto fail; } } WRITE(MISO, 0); // disable the MISO line pullup 30190: 2b 98 cbi 0x05, 3 ; 5 // send 0xFF until 0xFF received to give card some clock cycles t0 = (uint16_t)_millis(); 30192: 0f 94 22 29 call 0x25244 ; 0x25244 30196: eb 01 movw r28, r22 SERIAL_ECHOLNRPGM(PSTR("Sending 0xFF")); 30198: 8f e4 ldi r24, 0x4F ; 79 3019a: 9a ea ldi r25, 0xAA ; 170 3019c: 0e 94 93 79 call 0xf326 ; 0xf326 spiSend(0XFF); 301a0: 8f ef ldi r24, 0xFF ; 255 301a2: 0f 94 00 52 call 0x2a400 ; 0x2a400 while ((status_ = spiRec()) != 0xFF) 301a6: 0f 94 05 52 call 0x2a40a ; 0x2a40a 301aa: 80 93 fe 16 sts 0x16FE, r24 ; 0x8016fe 301ae: 8f 3f cpi r24, 0xFF ; 255 301b0: 59 f1 breq .+86 ; 0x30208 { spiSend(0XFF); 301b2: 8f ef ldi r24, 0xFF ; 255 301b4: 0f 94 00 52 call 0x2a400 ; 0x2a400 if (((uint16_t)_millis() - t0) > SD_CARD_ERROR_FF_TIMEOUT) 301b8: 0f 94 22 29 call 0x25244 ; 0x25244 301bc: 6c 1b sub r22, r28 301be: 7d 0b sbc r23, r29 301c0: 62 32 cpi r22, 0x22 ; 34 301c2: 71 05 cpc r23, r1 301c4: 80 f3 brcs .-32 ; 0x301a6 301c6: 82 e0 ldi r24, 0x02 ; 2 301c8: 80 93 fc 16 sts 0x16FC, r24 ; 0x8016fc { error(SD_CARD_ERROR_CMD8); SERIAL_ECHOLNRPGM(PSTR("No 0xFF received")); 301cc: 8e e3 ldi r24, 0x3E ; 62 301ce: 9a ea ldi r25, 0xAA ; 170 301d0: 0e 94 93 79 call 0xf326 ; 0xf326 #else // SOFTWARE_SPI return true; #endif // SOFTWARE_SPI fail: chipSelectHigh(); 301d4: 0f 94 7a 74 call 0x2e8f4 ; 0x2e8f4 #else if (!card.init(SPI_FULL_SPEED) ) #endif { SERIAL_ECHO_START; 301d8: 82 ef ldi r24, 0xF2 ; 242 301da: 9b ea ldi r25, 0xAB ; 171 301dc: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHOLNRPGM(_n("SD init fail"));////MSG_SD_INIT_FAIL 301e0: 85 ef ldi r24, 0xF5 ; 245 301e2: 90 e7 ldi r25, 0x70 ; 112 } else { mounted = true; SERIAL_ECHO_START; SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK 301e4: 0e 94 93 79 call 0xf326 ; 0xf326 } if (mounted) 301e8: 80 91 90 14 lds r24, 0x1490 ; 0x801490 301ec: 88 23 and r24, r24 301ee: 09 f4 brne .+2 ; 0x301f2 301f0: 9a c0 rjmp .+308 ; 0x30326 { cdroot(doPresort); 301f2: 80 2f mov r24, r16 } } 301f4: df 91 pop r29 301f6: cf 91 pop r28 301f8: 1f 91 pop r17 301fa: 0f 91 pop r16 301fc: ff 90 pop r15 301fe: ef 90 pop r14 30200: df 90 pop r13 30202: cf 90 pop r12 SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK } if (mounted) { cdroot(doPresort); 30204: 0d 94 69 7e jmp 0x2fcd2 ; 0x2fcd2 goto fail; } } // check SD version if ((cardCommand(CMD8, 0x1AA) & R1_ILLEGAL_COMMAND)) { 30208: 2a ea ldi r18, 0xAA ; 170 3020a: 31 e0 ldi r19, 0x01 ; 1 3020c: 40 e0 ldi r20, 0x00 ; 0 3020e: 50 e0 ldi r21, 0x00 ; 0 30210: 68 e0 ldi r22, 0x08 ; 8 30212: 8c ef ldi r24, 0xFC ; 252 30214: 96 e1 ldi r25, 0x16 ; 22 30216: 0f 94 0c 52 call 0x2a418 ; 0x2a418 3021a: 82 ff sbrs r24, 2 3021c: 2b c0 rjmp .+86 ; 0x30274 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;} 3021e: 81 e0 ldi r24, 0x01 ; 1 30220: 80 93 ff 16 sts 0x16FF, r24 ; 0x8016ff goto fail; } type(SD_CARD_TYPE_SD2); } // initialize card and send host supports SDHC if SD2 arg = type() == SD_CARD_TYPE_SD2 ? 0X40000000 : 0; 30224: 80 91 ff 16 lds r24, 0x16FF ; 0x8016ff 30228: c1 2c mov r12, r1 3022a: d1 2c mov r13, r1 3022c: 76 01 movw r14, r12 3022e: 82 30 cpi r24, 0x02 ; 2 30230: 29 f4 brne .+10 ; 0x3023c 30232: c1 2c mov r12, r1 30234: d1 2c mov r13, r1 30236: e1 2c mov r14, r1 30238: 80 e4 ldi r24, 0x40 ; 64 3023a: 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); 3023c: 20 e0 ldi r18, 0x00 ; 0 3023e: 30 e0 ldi r19, 0x00 ; 0 30240: a9 01 movw r20, r18 30242: 67 e3 ldi r22, 0x37 ; 55 30244: 8c ef ldi r24, 0xFC ; 252 30246: 96 e1 ldi r25, 0x16 ; 22 30248: 0f 94 0c 52 call 0x2a418 ; 0x2a418 return cardCommand(cmd, arg); 3024c: a7 01 movw r20, r14 3024e: 96 01 movw r18, r12 30250: 69 e2 ldi r22, 0x29 ; 41 30252: 8c ef ldi r24, 0xFC ; 252 30254: 96 e1 ldi r25, 0x16 ; 22 30256: 0f 94 0c 52 call 0x2a418 ; 0x2a418 while ((status_ = cardAcmd(ACMD41, arg)) != R1_READY_STATE) { 3025a: 80 93 fe 16 sts 0x16FE, r24 ; 0x8016fe 3025e: 88 23 and r24, r24 30260: b1 f0 breq .+44 ; 0x3028e // check for timeout if (((uint16_t)_millis() - t0) > SD_INIT_TIMEOUT) { 30262: 0f 94 22 29 call 0x25244 ; 0x25244 30266: 6c 1b sub r22, r28 30268: 7d 0b sbc r23, r29 3026a: 61 3d cpi r22, 0xD1 ; 209 3026c: 77 40 sbci r23, 0x07 ; 7 3026e: 30 f3 brcs .-52 ; 0x3023c bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 30270: 8a e0 ldi r24, 0x0A ; 10 30272: 8b cf rjmp .-234 ; 0x3018a goto fail; } } // check SD version if ((cardCommand(CMD8, 0x1AA) & R1_ILLEGAL_COMMAND)) { 30274: 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(); 30276: 0f 94 05 52 call 0x2a40a ; 0x2a40a 3027a: 80 93 fe 16 sts 0x16FE, r24 ; 0x8016fe 3027e: 11 50 subi r17, 0x01 ; 1 30280: d1 f7 brne .-12 ; 0x30276 if (status_ != 0XAA) { 30282: 8a 3a cpi r24, 0xAA ; 170 30284: 11 f0 breq .+4 ; 0x3028a 30286: 82 e0 ldi r24, 0x02 ; 2 30288: 80 cf rjmp .-256 ; 0x3018a 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;} 3028a: 82 e0 ldi r24, 0x02 ; 2 3028c: c9 cf rjmp .-110 ; 0x30220 error(SD_CARD_ERROR_ACMD41); goto fail; } } // if SD2 read OCR register to check for SDHC card if (type() == SD_CARD_TYPE_SD2) { 3028e: 80 91 ff 16 lds r24, 0x16FF ; 0x8016ff 30292: 82 30 cpi r24, 0x02 ; 2 30294: d1 f4 brne .+52 ; 0x302ca if (cardCommand(CMD58, 0)) { 30296: 20 e0 ldi r18, 0x00 ; 0 30298: 30 e0 ldi r19, 0x00 ; 0 3029a: a9 01 movw r20, r18 3029c: 6a e3 ldi r22, 0x3A ; 58 3029e: 8c ef ldi r24, 0xFC ; 252 302a0: 96 e1 ldi r25, 0x16 ; 22 302a2: 0f 94 0c 52 call 0x2a418 ; 0x2a418 302a6: 88 23 and r24, r24 302a8: 11 f0 breq .+4 ; 0x302ae bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 302aa: 88 e0 ldi r24, 0x08 ; 8 302ac: 6e cf rjmp .-292 ; 0x3018a error(SD_CARD_ERROR_CMD58); goto fail; } if ((spiRec() & 0XC0) == 0XC0) type(SD_CARD_TYPE_SDHC); 302ae: 0f 94 05 52 call 0x2a40a ; 0x2a40a 302b2: 80 7c andi r24, 0xC0 ; 192 302b4: 80 3c cpi r24, 0xC0 ; 192 302b6: 19 f4 brne .+6 ; 0x302be 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;} 302b8: 83 e0 ldi r24, 0x03 ; 3 302ba: 80 93 ff 16 sts 0x16FF, r24 ; 0x8016ff // discard rest of ocr - contains allowed voltage range for (uint8_t i = 0; i < 3; i++) spiRec(); 302be: 0f 94 05 52 call 0x2a40a ; 0x2a40a 302c2: 0f 94 05 52 call 0x2a40a ; 0x2a40a 302c6: 0f 94 05 52 call 0x2a40a ; 0x2a40a } chipSelectHigh(); 302ca: 0f 94 7a 74 call 0x2e8f4 ; 0x2e8f4 bool Sd2Card::setSckRate(uint8_t sckRateID) { if (sckRateID > 6) { error(SD_CARD_ERROR_SCK_RATE); return false; } spiRate_ = sckRateID; 302ce: 10 92 fd 16 sts 0x16FD, r1 ; 0x8016fd * \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);} 302d2: 81 e0 ldi r24, 0x01 ; 1 302d4: 0f 94 76 68 call 0x2d0ec ; 0x2d0ec 302d8: 81 11 cpse r24, r1 302da: 0c c0 rjmp .+24 ; 0x302f4 302dc: 80 e0 ldi r24, 0x00 ; 0 302de: 0f 94 76 68 call 0x2d0ec ; 0x2d0ec #endif { SERIAL_ECHO_START; SERIAL_ECHOLNRPGM(_n("SD init fail"));////MSG_SD_INIT_FAIL } else if (!volume.init(&card)) 302e2: 81 11 cpse r24, r1 302e4: 07 c0 rjmp .+14 ; 0x302f4 { SERIAL_ERROR_START; 302e6: 8a ec ldi r24, 0xCA ; 202 302e8: 9b ea ldi r25, 0xAB ; 171 302ea: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ERRORLNRPGM(_n("volume.init failed"));////MSG_SD_VOL_INIT_FAIL 302ee: 82 ee ldi r24, 0xE2 ; 226 302f0: 90 e7 ldi r25, 0x70 ; 112 302f2: 78 cf rjmp .-272 ; 0x301e4 } else if (!root.openRoot(&volume)) 302f4: 61 e0 ldi r22, 0x01 ; 1 302f6: 77 e1 ldi r23, 0x17 ; 23 302f8: 85 e1 ldi r24, 0x15 ; 21 302fa: 95 e1 ldi r25, 0x15 ; 21 302fc: 0f 94 84 55 call 0x2ab08 ; 0x2ab08 30300: 81 11 cpse r24, r1 30302: 07 c0 rjmp .+14 ; 0x30312 { SERIAL_ERROR_START; 30304: 8a ec ldi r24, 0xCA ; 202 30306: 9b ea ldi r25, 0xAB ; 171 30308: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ERRORLNRPGM(_n("openRoot failed"));////MSG_SD_OPENROOT_FAIL 3030c: 82 ed ldi r24, 0xD2 ; 210 3030e: 90 e7 ldi r25, 0x70 ; 112 30310: 69 cf rjmp .-302 ; 0x301e4 } else { mounted = true; 30312: 81 e0 ldi r24, 0x01 ; 1 30314: 80 93 90 14 sts 0x1490, r24 ; 0x801490 SERIAL_ECHO_START; 30318: 82 ef ldi r24, 0xF2 ; 242 3031a: 9b ea ldi r25, 0xAB ; 171 3031c: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK 30320: 87 ec ldi r24, 0xC7 ; 199 30322: 90 e7 ldi r25, 0x70 ; 112 30324: 5f cf rjmp .-322 ; 0x301e4 if (mounted) { cdroot(doPresort); } } 30326: df 91 pop r29 30328: cf 91 pop r28 3032a: 1f 91 pop r17 3032c: 0f 91 pop r16 3032e: ff 90 pop r15 30330: ef 90 pop r14 30332: df 90 pop r13 30334: cf 90 pop r12 30336: 08 95 ret 00030338 : ms = 0; } } } static void wait_for_heater(long codenum, uint8_t extruder) { 30338: 4f 92 push r4 3033a: 5f 92 push r5 3033c: 6f 92 push r6 3033e: 7f 92 push r7 30340: 8f 92 push r8 30342: 9f 92 push r9 30344: af 92 push r10 30346: bf 92 push r11 30348: cf 92 push r12 3034a: df 92 push r13 3034c: ef 92 push r14 3034e: ff 92 push r15 30350: 4b 01 movw r8, r22 30352: 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]; 30354: 60 91 b5 0d lds r22, 0x0DB5 ; 0x800db5 30358: 70 91 b6 0d lds r23, 0x0DB6 ; 0x800db6 3035c: 07 2e mov r0, r23 3035e: 00 0c add r0, r0 30360: 88 0b sbc r24, r24 30362: 99 0b sbc r25, r25 30364: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> if (!degTargetHotend(extruder)) 30368: 20 e0 ldi r18, 0x00 ; 0 3036a: 30 e0 ldi r19, 0x00 ; 0 3036c: a9 01 movw r20, r18 3036e: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 30372: 88 23 and r24, r24 30374: d1 f0 breq .+52 ; 0x303aa #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; 30376: 10 92 b4 0d sts 0x0DB4, r1 ; 0x800db4 <_ZL13cancel_heatup.lto_priv.408> if (!degTargetHotend(extruder)) return; #ifdef TEMP_RESIDENCY_TIME long residencyStart; residencyStart = -1; 3037a: cc 24 eor r12, r12 3037c: ca 94 dec r12 3037e: dc 2c mov r13, r12 30380: 76 01 movw r14, r12 #ifdef TEMP_RESIDENCY_TIME SERIAL_PROTOCOLPGM(" W:"); if (residencyStart > -1) { codenum = ((TEMP_RESIDENCY_TIME * 1000UL) - (_millis() - residencyStart)) / 1000UL; 30382: 98 ee ldi r25, 0xE8 ; 232 30384: 49 2e mov r4, r25 30386: 93 e0 ldi r25, 0x03 ; 3 30388: 59 2e mov r5, r25 3038a: 61 2c mov r6, r1 3038c: 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) || 3038e: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 <_ZL13cancel_heatup.lto_priv.408> 30392: 81 11 cpse r24, r1 30394: 0a c0 rjmp .+20 ; 0x303aa 30396: 2f ef ldi r18, 0xFF ; 255 30398: c2 16 cp r12, r18 3039a: d2 06 cpc r13, r18 3039c: e2 06 cpc r14, r18 3039e: f2 06 cpc r15, r18 303a0: 89 f4 brne .+34 ; 0x303c4 (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) { 303a2: 80 91 b3 0d lds r24, 0x0DB3 ; 0x800db3 303a6: 82 30 cpi r24, 0x02 ; 2 303a8: b9 f4 brne .+46 ; 0x303d8 { residencyStart = _millis(); } #endif //TEMP_RESIDENCY_TIME } } 303aa: ff 90 pop r15 303ac: ef 90 pop r14 303ae: df 90 pop r13 303b0: cf 90 pop r12 303b2: bf 90 pop r11 303b4: af 90 pop r10 303b6: 9f 90 pop r9 303b8: 8f 90 pop r8 303ba: 7f 90 pop r7 303bc: 6f 90 pop r6 303be: 5f 90 pop r5 303c0: 4f 90 pop r4 303c2: 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) || 303c4: f7 fc sbrc r15, 7 303c6: f1 cf rjmp .-30 ; 0x303aa (residencyStart >= 0 && (((unsigned int)(_millis() - residencyStart)) < (TEMP_RESIDENCY_TIME * 1000UL))))) { 303c8: 0f 94 22 29 call 0x25244 ; 0x25244 303cc: 6c 19 sub r22, r12 303ce: 7d 09 sbc r23, r13 303d0: 68 3b cpi r22, 0xB8 ; 184 303d2: 7b 40 sbci r23, 0x0B ; 11 303d4: 30 f3 brcs .-52 ; 0x303a2 303d6: e9 cf rjmp .-46 ; 0x303aa 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) 303d8: 0f 94 22 29 call 0x25244 ; 0x25244 303dc: 68 19 sub r22, r8 303de: 79 09 sbc r23, r9 303e0: 8a 09 sbc r24, r10 303e2: 9b 09 sbc r25, r11 303e4: 69 3e cpi r22, 0xE9 ; 233 303e6: 73 40 sbci r23, 0x03 ; 3 303e8: 81 05 cpc r24, r1 303ea: 91 05 cpc r25, r1 303ec: f0 f1 brcs .+124 ; 0x3046a { //Print Temp Reading and remaining time every 1 second while heating up/cooling down if (!farm_mode) { SERIAL_PROTOCOLPGM("T:"); 303ee: 8b e3 ldi r24, 0x3B ; 59 303f0: 9a ea ldi r25, 0xAA ; 170 303f2: 0e 94 68 77 call 0xeed0 ; 0xeed0 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 303f6: 60 91 af 0d lds r22, 0x0DAF ; 0x800daf 303fa: 70 91 b0 0d lds r23, 0x0DB0 ; 0x800db0 303fe: 80 91 b1 0d lds r24, 0x0DB1 ; 0x800db1 30402: 90 91 b2 0d lds r25, 0x0DB2 ; 0x800db2 30406: 41 e0 ldi r20, 0x01 ; 1 30408: 0f 94 42 d5 call 0x3aa84 ; 0x3aa84 SERIAL_PROTOCOL_F(degHotend(extruder), 1); SERIAL_PROTOCOLPGM(" E:"); 3040c: 87 e3 ldi r24, 0x37 ; 55 3040e: 9a ea ldi r25, 0xAA ; 170 30410: 0e 94 68 77 call 0xeed0 ; 0xeed0 30414: 60 e0 ldi r22, 0x00 ; 0 30416: 70 e0 ldi r23, 0x00 ; 0 30418: cb 01 movw r24, r22 3041a: 0f 94 26 d5 call 0x3aa4c ; 0x3aa4c SERIAL_PROTOCOL((int)extruder); #ifdef TEMP_RESIDENCY_TIME SERIAL_PROTOCOLPGM(" W:"); 3041e: 83 e3 ldi r24, 0x33 ; 51 30420: 9a ea ldi r25, 0xAA ; 170 30422: 0e 94 68 77 call 0xeed0 ; 0xeed0 if (residencyStart > -1) 30426: f7 fc sbrc r15, 7 30428: 52 c0 rjmp .+164 ; 0x304ce { codenum = ((TEMP_RESIDENCY_TIME * 1000UL) - (_millis() - residencyStart)) / 1000UL; 3042a: 0f 94 22 29 call 0x25244 ; 0x25244 3042e: 46 01 movw r8, r12 30430: 57 01 movw r10, r14 30432: 58 eb ldi r21, 0xB8 ; 184 30434: 85 0e add r8, r21 30436: 5b e0 ldi r21, 0x0B ; 11 30438: 95 1e adc r9, r21 3043a: a1 1c adc r10, r1 3043c: b1 1c adc r11, r1 3043e: a5 01 movw r20, r10 30440: 94 01 movw r18, r8 30442: 26 1b sub r18, r22 30444: 37 0b sbc r19, r23 30446: 48 0b sbc r20, r24 30448: 59 0b sbc r21, r25 3044a: ca 01 movw r24, r20 3044c: b9 01 movw r22, r18 3044e: a3 01 movw r20, r6 30450: 92 01 movw r18, r4 30452: 0f 94 4a dc call 0x3b894 ; 0x3b894 <__udivmodsi4> 30456: ca 01 movw r24, r20 30458: b9 01 movw r22, r18 3045a: 0f 94 26 d5 call 0x3aa4c ; 0x3aa4c } void MarlinSerial::println(char c, int base) { print(c, base); println(); 3045e: 0f 94 b8 d5 call 0x3ab70 ; 0x3ab70 } } #else SERIAL_PROTOCOLLN(); #endif codenum = _millis(); 30462: 0f 94 22 29 call 0x25244 ; 0x25244 30466: 4b 01 movw r8, r22 30468: 5c 01 movw r10, r24 } delay_keep_alive(0); //do not disable steppers 3046a: 90 e0 ldi r25, 0x00 ; 0 3046c: 80 e0 ldi r24, 0x00 ; 0 3046e: 0e 94 fc 8c call 0x119f8 ; 0x119f8 #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))) || 30472: 3f ef ldi r19, 0xFF ; 255 30474: c3 16 cp r12, r19 30476: d3 06 cpc r13, r19 30478: e3 06 cpc r14, r19 3047a: f3 06 cpc r15, r19 3047c: 09 f0 breq .+2 ; 0x30480 3047e: 46 c0 rjmp .+140 ; 0x3050c } 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))) || 30480: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZL16target_direction.lto_priv.532> 30484: 60 91 b5 0d lds r22, 0x0DB5 ; 0x800db5 30488: 70 91 b6 0d lds r23, 0x0DB6 ; 0x800db6 3048c: 88 23 and r24, r24 3048e: 19 f1 breq .+70 ; 0x304d6 30490: 07 2e mov r0, r23 30492: 00 0c add r0, r0 30494: 88 0b sbc r24, r24 30496: 99 0b sbc r25, r25 30498: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 3049c: 20 e0 ldi r18, 0x00 ; 0 3049e: 30 e0 ldi r19, 0x00 ; 0 304a0: 40 e8 ldi r20, 0x80 ; 128 304a2: 5f e3 ldi r21, 0x3F ; 63 304a4: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 304a8: 9b 01 movw r18, r22 304aa: ac 01 movw r20, r24 304ac: 60 91 af 0d lds r22, 0x0DAF ; 0x800daf 304b0: 70 91 b0 0d lds r23, 0x0DB0 ; 0x800db0 304b4: 80 91 b1 0d lds r24, 0x0DB1 ; 0x800db1 304b8: 90 91 b2 0d lds r25, 0x0DB2 ; 0x800db2 304bc: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 304c0: 87 fd sbrc r24, 7 304c2: 65 cf rjmp .-310 ; 0x3038e (residencyStart == -1 && !target_direction && (degHotend(extruder) <= (degTargetHotend(extruder) + TEMP_WINDOW))) || (residencyStart > -1 && fabs(degHotend(extruder) - degTargetHotend(extruder)) > TEMP_HYSTERESIS)) { residencyStart = _millis(); 304c4: 0f 94 22 29 call 0x25244 ; 0x25244 304c8: 6b 01 movw r12, r22 304ca: 7c 01 movw r14, r24 304cc: 60 cf rjmp .-320 ; 0x3038e } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 304ce: 8f e3 ldi r24, 0x3F ; 63 304d0: 0e 94 4f 77 call 0xee9e ; 0xee9e 304d4: c4 cf rjmp .-120 ; 0x3045e 304d6: 07 2e mov r0, r23 304d8: 00 0c add r0, r0 304da: 88 0b sbc r24, r24 304dc: 99 0b sbc r25, r25 304de: 0f 94 65 d6 call 0x3acca ; 0x3acca <__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))) || 304e2: 20 e0 ldi r18, 0x00 ; 0 304e4: 30 e0 ldi r19, 0x00 ; 0 304e6: 40 e8 ldi r20, 0x80 ; 128 304e8: 5f e3 ldi r21, 0x3F ; 63 304ea: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 304ee: 9b 01 movw r18, r22 304f0: ac 01 movw r20, r24 304f2: 60 91 af 0d lds r22, 0x0DAF ; 0x800daf 304f6: 70 91 b0 0d lds r23, 0x0DB0 ; 0x800db0 304fa: 80 91 b1 0d lds r24, 0x0DB1 ; 0x800db1 304fe: 90 91 b2 0d lds r25, 0x0DB2 ; 0x800db2 30502: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 30506: 18 16 cp r1, r24 30508: ec f6 brge .-70 ; 0x304c4 3050a: 41 cf rjmp .-382 ; 0x3038e 3050c: f7 fc sbrc r15, 7 3050e: 3f cf rjmp .-386 ; 0x3038e 30510: 60 91 b5 0d lds r22, 0x0DB5 ; 0x800db5 30514: 70 91 b6 0d lds r23, 0x0DB6 ; 0x800db6 30518: 07 2e mov r0, r23 3051a: 00 0c add r0, r0 3051c: 88 0b sbc r24, r24 3051e: 99 0b sbc r25, r25 30520: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 30524: 9b 01 movw r18, r22 30526: ac 01 movw r20, r24 (residencyStart > -1 && fabs(degHotend(extruder) - degTargetHotend(extruder)) > TEMP_HYSTERESIS)) 30528: 60 91 af 0d lds r22, 0x0DAF ; 0x800daf 3052c: 70 91 b0 0d lds r23, 0x0DB0 ; 0x800db0 30530: 80 91 b1 0d lds r24, 0x0DB1 ; 0x800db1 30534: 90 91 b2 0d lds r25, 0x0DB2 ; 0x800db2 30538: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 3053c: 9f 77 andi r25, 0x7F ; 127 3053e: 20 e0 ldi r18, 0x00 ; 0 30540: 30 e0 ldi r19, 0x00 ; 0 30542: 40 ea ldi r20, 0xA0 ; 160 30544: 50 e4 ldi r21, 0x40 ; 64 30546: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 3054a: 18 16 cp r1, r24 3054c: 0c f0 brlt .+2 ; 0x30550 3054e: 1f cf rjmp .-450 ; 0x3038e 30550: b9 cf rjmp .-142 ; 0x304c4 00030552 : // 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) { 30552: 1f 93 push r17 30554: cf 93 push r28 30556: df 93 push r29 30558: ec 01 movw r28, r24 3055a: 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()) { 3055c: 80 91 8c 13 lds r24, 0x138C ; 0x80138c 30560: 83 30 cpi r24, 0x03 ; 3 30562: 09 f4 brne .+2 ; 0x30566 30564: 4e c0 rjmp .+156 ; 0x30602 30566: 8c 31 cpi r24, 0x1C ; 28 30568: 09 f4 brne .+2 ; 0x3056c 3056a: 52 c0 rjmp .+164 ; 0x30610 break; default: break; } if (ec != lastErrorCode) { // deduplicate: only report changes in error codes into the log 3056c: 80 91 b1 13 lds r24, 0x13B1 ; 0x8013b1 30570: 90 91 b2 13 lds r25, 0x13B2 ; 0x8013b2 30574: 8c 17 cp r24, r28 30576: 9d 07 cpc r25, r29 30578: 79 f1 breq .+94 ; 0x305d8 lastErrorCode = ec; 3057a: d0 93 b2 13 sts 0x13B2, r29 ; 0x8013b2 3057e: c0 93 b1 13 sts 0x13B1, r28 ; 0x8013b1 lastErrorSource = res; 30582: 10 93 b3 13 sts 0x13B3, r17 ; 0x8013b3 LogErrorEvent_P(_O(PrusaErrorTitle(PrusaErrorCodeIndex(ec)))); 30586: ce 01 movw r24, r28 30588: 0f 94 a7 c5 call 0x38b4e ; 0x38b4e 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); 3058c: e8 2f mov r30, r24 3058e: f0 e0 ldi r31, 0x00 ; 0 30590: ee 0f add r30, r30 30592: ff 1f adc r31, r31 30594: e9 59 subi r30, 0x99 ; 153 30596: f6 45 sbci r31, 0x56 ; 86 30598: 85 91 lpm r24, Z+ 3059a: 94 91 lpm r25, Z 3059c: 02 96 adiw r24, 0x02 ; 2 3059e: 0f 94 90 c5 call 0x38b20 ; 0x38b20 if (ec != ErrorCode::OK && ec != ErrorCode::FILAMENT_EJECTED && ec != ErrorCode::FILAMENT_CHANGE) { 305a2: c1 30 cpi r28, 0x01 ; 1 305a4: d1 05 cpc r29, r1 305a6: c1 f0 breq .+48 ; 0x305d8 305a8: cc 30 cpi r28, 0x0C ; 12 305aa: 80 e8 ldi r24, 0x80 ; 128 305ac: d8 07 cpc r29, r24 305ae: a1 f0 breq .+40 ; 0x305d8 305b0: c9 32 cpi r28, 0x29 ; 41 305b2: 80 e8 ldi r24, 0x80 ; 128 305b4: d8 07 cpc r29, r24 305b6: 81 f0 breq .+32 ; 0x305d8 IncrementMMUFails(); 305b8: 0f 94 a9 c4 call 0x38952 ; 0x38952 | (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 305bc: ce 01 movw r24, r28 305be: 88 27 eor r24, r24 305c0: 9e 77 andi r25, 0x7E ; 126 305c2: 89 2b or r24, r25 305c4: 49 f0 breq .+18 ; 0x305d8 /// Set toolchange counter to zero inline void ClearToolChangeCounter() { toolchange_counter = 0; }; inline uint16_t TMCFailures() const { return tmcFailures; } inline void IncrementTMCFailures() { ++tmcFailures; } 305c6: 80 91 bf 13 lds r24, 0x13BF ; 0x8013bf 305ca: 90 91 c0 13 lds r25, 0x13C0 ; 0x8013c0 305ce: 01 96 adiw r24, 0x01 ; 1 305d0: 90 93 c0 13 sts 0x13C0, r25 ; 0x8013c0 305d4: 80 93 bf 13 sts 0x13BF, r24 ; 0x8013bf return true; } } bool MMU2::RetryIfPossible(ErrorCode ec) { if (logic.RetryAttempts()) { 305d8: 80 91 9e 13 lds r24, 0x139E ; 0x80139e 305dc: 88 23 and r24, r24 305de: d9 f0 breq .+54 ; 0x30616 return Buttons::NoButton; } void SetButtonResponse(ButtonOperations rsp) { buttonSelectedOperation = rsp; 305e0: 11 e0 ldi r17, 0x01 ; 1 305e2: 10 93 ad 0d sts 0x0DAD, r17 ; 0x800dad <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.493> SetButtonResponse(ButtonOperations::Retry); // check, that Retry is actually allowed on that operation if (ButtonAvailable(ec) != Buttons::NoButton) { 305e6: ce 01 movw r24, r28 305e8: 0f 94 32 c8 call 0x39064 ; 0x39064 305ec: 8f 3f cpi r24, 0xFF ; 255 305ee: 99 f0 breq .+38 ; 0x30616 void ResetCommunicationTimeoutAttempts(); constexpr bool InAutoRetry() const { return inAutoRetry; } void SetInAutoRetry(bool iar) { inAutoRetry = iar; 305f0: 10 93 9f 13 sts 0x139F, r17 ; 0x80139f logic.SetInAutoRetry(true); SERIAL_ECHOLNPGM("RetryButtonPressed"); 305f4: 84 e5 ldi r24, 0x54 ; 84 305f6: 99 ea ldi r25, 0xA9 ; 169 && mmu2Magic[2] == 'U' && mmu2Magic[3] == '2' && mmu2Magic[4] == ':' && strlen_constexpr(mmu2Magic) == 5, "MMU2 logging prefix mismatch, must be updated at various spots"); } 305f8: df 91 pop r29 305fa: cf 91 pop r28 305fc: 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"); 305fe: 0c 94 93 79 jmp 0xf326 ; 0xf326 // 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; 30602: 10 92 bc 13 sts 0x13BC, r1 ; 0x8013bc float move_raise_z(float delta) { return raise_z(delta); } void planner_abort_queued_moves() { planner_abort_hard(); 30606: 0f 94 7e c1 call 0x382fc ; 0x382fc // 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; 3060a: 10 92 ab 0d sts 0x0DAB, r1 ; 0x800dab 3060e: ae cf rjmp .-164 ; 0x3056c 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; 30610: 10 92 bb 13 sts 0x13BB, r1 ; 0x8013bb 30614: f8 cf rjmp .-16 ; 0x30606 30616: 10 92 9f 13 sts 0x139F, r1 ; 0x80139f bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { if (putErrorScreenToSleep) return; 3061a: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.496> 3061e: 81 11 cpse r24, r1 30620: 06 c0 rjmp .+12 ; 0x3062e 30622: 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"); } 30624: df 91 pop r29 30626: cf 91 pop r28 30628: 1f 91 pop r17 3062a: 0d 94 f8 c6 jmp 0x38df0 ; 0x38df0 3062e: df 91 pop r29 30630: cf 91 pop r28 30632: 1f 91 pop r17 30634: 08 95 ret 00030636 : * \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) { 30636: 2f 92 push r2 30638: 3f 92 push r3 3063a: 4f 92 push r4 3063c: 5f 92 push r5 3063e: 6f 92 push r6 30640: 7f 92 push r7 30642: 8f 92 push r8 30644: 9f 92 push r9 30646: af 92 push r10 30648: bf 92 push r11 3064a: cf 92 push r12 3064c: df 92 push r13 3064e: ef 92 push r14 30650: ff 92 push r15 30652: 0f 93 push r16 30654: 1f 93 push r17 30656: cf 93 push r28 30658: df 93 push r29 3065a: 00 d0 rcall .+0 ; 0x3065c 3065c: 1f 92 push r1 3065e: cd b7 in r28, 0x3d ; 61 30660: de b7 in r29, 0x3e ; 62 30662: 5c 01 movw r10, r24 30664: 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; 30666: 80 91 22 17 lds r24, 0x1722 ; 0x801722 3066a: 81 30 cpi r24, 0x01 ; 1 3066c: 09 f0 breq .+2 ; 0x30670 3066e: de c0 rjmp .+444 ; 0x3082c 30670: 80 91 20 17 lds r24, 0x1720 ; 0x801720 30674: 81 ff sbrs r24, 1 30676: da c0 rjmp .+436 ; 0x3082c // seek to end of file if append flag if ((flags_ & O_APPEND) && curPosition_ != fileSize_) { 30678: 82 fd sbrc r24, 2 3067a: bc c0 rjmp .+376 ; 0x307f4 * \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) { 3067c: 74 01 movw r14, r8 curCluster_ = next; } } } // max space in block uint16_t n = 512 - blockOffset; 3067e: 21 2c mov r2, r1 30680: 32 e0 ldi r19, 0x02 ; 2 30682: 33 2e mov r3, r19 30684: 00 91 27 17 lds r16, 0x1727 ; 0x801727 30688: 10 91 28 17 lds r17, 0x1728 ; 0x801728 3068c: 20 91 29 17 lds r18, 0x1729 ; 0x801729 30690: 30 91 2a 17 lds r19, 0x172A ; 0x80172a // seek to end of file if append flag if ((flags_ & O_APPEND) && curPosition_ != fileSize_) { if (!seekEnd()) goto fail; } while (nToWrite > 0) { 30694: e1 14 cp r14, r1 30696: f1 04 cpc r15, r1 30698: 09 f4 brne .+2 ; 0x3069c 3069a: 30 c1 rjmp .+608 ; 0x308fc uint8_t blockOfCluster = vol_->blockOfCluster(curPosition_); 3069c: 80 91 38 17 lds r24, 0x1738 ; 0x801738 306a0: 90 91 39 17 lds r25, 0x1739 ; 0x801739 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);} 306a4: dc 01 movw r26, r24 306a6: 14 96 adiw r26, 0x04 ; 4 306a8: 7c 90 ld r7, X 306aa: 7a 94 dec r7 306ac: b9 01 movw r22, r18 306ae: a8 01 movw r20, r16 306b0: 29 e0 ldi r18, 0x09 ; 9 306b2: 76 95 lsr r23 306b4: 67 95 ror r22 306b6: 57 95 ror r21 306b8: 47 95 ror r20 306ba: 2a 95 dec r18 306bc: d1 f7 brne .-12 ; 0x306b2 306be: 74 22 and r7, r20 uint16_t blockOffset = curPosition_ & 0X1FF; 306c0: 11 70 andi r17, 0x01 ; 1 if (blockOfCluster == 0 && blockOffset == 0) { 306c2: 71 10 cpse r7, r1 306c4: 25 c0 rjmp .+74 ; 0x30710 306c6: 01 15 cp r16, r1 306c8: 11 05 cpc r17, r1 306ca: 11 f5 brne .+68 ; 0x30710 306cc: 40 91 23 17 lds r20, 0x1723 ; 0x801723 306d0: 50 91 24 17 lds r21, 0x1724 ; 0x801724 306d4: 60 91 25 17 lds r22, 0x1725 ; 0x801725 306d8: 70 91 26 17 lds r23, 0x1726 ; 0x801726 // start of new cluster if (curCluster_ == 0) { 306dc: 41 15 cp r20, r1 306de: 51 05 cpc r21, r1 306e0: 61 05 cpc r22, r1 306e2: 71 05 cpc r23, r1 306e4: 09 f0 breq .+2 ; 0x306e8 306e6: a8 c0 rjmp .+336 ; 0x30838 if (firstCluster_ == 0) { 306e8: 80 91 34 17 lds r24, 0x1734 ; 0x801734 306ec: 90 91 35 17 lds r25, 0x1735 ; 0x801735 306f0: a0 91 36 17 lds r26, 0x1736 ; 0x801736 306f4: b0 91 37 17 lds r27, 0x1737 ; 0x801737 306f8: 00 97 sbiw r24, 0x00 ; 0 306fa: a1 05 cpc r26, r1 306fc: b1 05 cpc r27, r1 306fe: 09 f0 breq .+2 ; 0x30702 30700: b4 c0 rjmp .+360 ; 0x3086a } 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; 30702: 8f e1 ldi r24, 0x1F ; 31 30704: 97 e1 ldi r25, 0x17 ; 23 30706: 0f 94 e1 56 call 0x2adc2 ; 0x2adc2 3070a: 88 23 and r24, r24 3070c: 09 f4 brne .+2 ; 0x30710 3070e: 8e c0 rjmp .+284 ; 0x3082c curCluster_ = next; } } } // max space in block uint16_t n = 512 - blockOffset; 30710: c1 01 movw r24, r2 30712: 80 1b sub r24, r16 30714: 91 0b sbc r25, r17 30716: 67 01 movw r12, r14 30718: 8e 15 cp r24, r14 3071a: 9f 05 cpc r25, r15 3071c: 08 f4 brcc .+2 ; 0x30720 3071e: 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; 30720: e0 91 38 17 lds r30, 0x1738 ; 0x801738 30724: f0 91 39 17 lds r31, 0x1739 ; 0x801739 uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 30728: 80 91 23 17 lds r24, 0x1723 ; 0x801723 3072c: 90 91 24 17 lds r25, 0x1724 ; 0x801724 30730: a0 91 25 17 lds r26, 0x1725 ; 0x801725 30734: b0 91 26 17 lds r27, 0x1726 ; 0x801726 30738: 02 97 sbiw r24, 0x02 ; 2 3073a: a1 09 sbc r26, r1 3073c: b1 09 sbc r27, r1 3073e: 25 85 ldd r18, Z+13 ; 0x0d 30740: 04 c0 rjmp .+8 ; 0x3074a 30742: 88 0f add r24, r24 30744: 99 1f adc r25, r25 30746: aa 1f adc r26, r26 30748: bb 1f adc r27, r27 3074a: 2a 95 dec r18 3074c: d2 f7 brpl .-12 ; 0x30742 3074e: 46 85 ldd r20, Z+14 ; 0x0e 30750: 57 85 ldd r21, Z+15 ; 0x0f 30752: 60 89 ldd r22, Z+16 ; 0x10 30754: 71 89 ldd r23, Z+17 ; 0x11 30756: 84 0f add r24, r20 30758: 95 1f adc r25, r21 3075a: a6 1f adc r26, r22 3075c: b7 1f adc r27, r23 3075e: 9c 01 movw r18, r24 30760: ad 01 movw r20, r26 30762: 27 0d add r18, r7 30764: 31 1d adc r19, r1 30766: 41 1d adc r20, r1 30768: 51 1d adc r21, r1 3076a: 29 01 movw r4, r18 3076c: 3a 01 movw r6, r20 if (n == 512) { 3076e: c1 14 cp r12, r1 30770: 32 e0 ldi r19, 0x02 ; 2 30772: d3 06 cpc r13, r19 30774: 09 f0 breq .+2 ; 0x30778 30776: 8a c0 rjmp .+276 ; 0x3088c // full block - don't need to use cache if (vol_->cacheBlockNumber() == block) { 30778: 80 91 90 0e lds r24, 0x0E90 ; 0x800e90 3077c: 90 91 91 0e lds r25, 0x0E91 ; 0x800e91 30780: a0 91 92 0e lds r26, 0x0E92 ; 0x800e92 30784: b0 91 93 0e lds r27, 0x0E93 ; 0x800e93 30788: 48 16 cp r4, r24 3078a: 59 06 cpc r5, r25 3078c: 6a 06 cpc r6, r26 3078e: 7b 06 cpc r7, r27 30790: 69 f4 brne .+26 ; 0x307ac 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; 30792: 10 92 98 0e sts 0x0E98, r1 ; 0x800e98 cacheBlockNumber_ = blockNumber; 30796: 8f ef ldi r24, 0xFF ; 255 30798: 9f ef ldi r25, 0xFF ; 255 3079a: dc 01 movw r26, r24 3079c: 80 93 90 0e sts 0x0E90, r24 ; 0x800e90 307a0: 90 93 91 0e sts 0x0E91, r25 ; 0x800e91 307a4: a0 93 92 0e sts 0x0E92, r26 ; 0x800e92 307a8: b0 93 93 0e sts 0x0E93, r27 ; 0x800e93 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); 307ac: 95 01 movw r18, r10 307ae: b3 01 movw r22, r6 307b0: a2 01 movw r20, r4 307b2: 80 91 99 0e lds r24, 0x0E99 ; 0x800e99 307b6: 90 91 9a 0e lds r25, 0x0E9A ; 0x800e9a 307ba: 0f 94 6c 52 call 0x2a4d8 ; 0x2a4d8 // invalidate cache if block is in cache vol_->cacheSetBlockNumber(0XFFFFFFFF, false); } if (!vol_->writeBlock(block, src)) goto fail; 307be: 88 23 and r24, r24 307c0: a9 f1 breq .+106 ; 0x3082c if (!vol_->cacheRawBlock(block, SdVolume::CACHE_FOR_WRITE)) goto fail; } uint8_t* dst = vol_->cache()->data + blockOffset; memcpy(dst, src, n); } curPosition_ += n; 307c2: 80 91 27 17 lds r24, 0x1727 ; 0x801727 307c6: 90 91 28 17 lds r25, 0x1728 ; 0x801728 307ca: a0 91 29 17 lds r26, 0x1729 ; 0x801729 307ce: b0 91 2a 17 lds r27, 0x172A ; 0x80172a 307d2: 8c 0d add r24, r12 307d4: 9d 1d adc r25, r13 307d6: a1 1d adc r26, r1 307d8: b1 1d adc r27, r1 307da: 80 93 27 17 sts 0x1727, r24 ; 0x801727 307de: 90 93 28 17 sts 0x1728, r25 ; 0x801728 307e2: a0 93 29 17 sts 0x1729, r26 ; 0x801729 307e6: b0 93 2a 17 sts 0x172A, r27 ; 0x80172a src += n; 307ea: ac 0c add r10, r12 307ec: bd 1c adc r11, r13 nToWrite -= n; 307ee: ec 18 sub r14, r12 307f0: fd 08 sbc r15, r13 307f2: 48 cf rjmp .-368 ; 0x30684 // 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_) { 307f4: 40 91 30 17 lds r20, 0x1730 ; 0x801730 307f8: 50 91 31 17 lds r21, 0x1731 ; 0x801731 307fc: 60 91 32 17 lds r22, 0x1732 ; 0x801732 30800: 70 91 33 17 lds r23, 0x1733 ; 0x801733 30804: 80 91 27 17 lds r24, 0x1727 ; 0x801727 30808: 90 91 28 17 lds r25, 0x1728 ; 0x801728 3080c: a0 91 29 17 lds r26, 0x1729 ; 0x801729 30810: b0 91 2a 17 lds r27, 0x172A ; 0x80172a 30814: 48 17 cp r20, r24 30816: 59 07 cpc r21, r25 30818: 6a 07 cpc r22, r26 3081a: 7b 07 cpc r23, r27 3081c: 09 f4 brne .+2 ; 0x30820 3081e: 2e cf rjmp .-420 ; 0x3067c } /** 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);} 30820: 8f e1 ldi r24, 0x1F ; 31 30822: 97 e1 ldi r25, 0x17 ; 23 30824: 0f 94 4d 56 call 0x2ac9a ; 0x2ac9a if (!seekEnd()) goto fail; 30828: 81 11 cpse r24, r1 3082a: 28 cf rjmp .-432 ; 0x3067c } return nbyte; fail: // return for write error writeError = true; 3082c: 81 e0 ldi r24, 0x01 ; 1 3082e: 80 93 1f 17 sts 0x171F, r24 ; 0x80171f return -1; 30832: 8f ef ldi r24, 0xFF ; 255 30834: 9f ef ldi r25, 0xFF ; 255 30836: 81 c0 rjmp .+258 ; 0x3093a } else { curCluster_ = firstCluster_; } } else { uint32_t next; if (!vol_->fatGet(curCluster_, &next)) goto fail; 30838: 9e 01 movw r18, r28 3083a: 2f 5f subi r18, 0xFF ; 255 3083c: 3f 4f sbci r19, 0xFF ; 255 3083e: 0f 94 97 54 call 0x2a92e ; 0x2a92e 30842: 88 23 and r24, r24 30844: 99 f3 breq .-26 ; 0x3082c if (vol_->isEOC(next)) { 30846: 89 81 ldd r24, Y+1 ; 0x01 30848: 9a 81 ldd r25, Y+2 ; 0x02 3084a: ab 81 ldd r26, Y+3 ; 0x03 3084c: 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; 3084e: e0 91 38 17 lds r30, 0x1738 ; 0x801738 30852: f0 91 39 17 lds r31, 0x1739 ; 0x801739 30856: 27 89 ldd r18, Z+23 ; 0x17 30858: 20 31 cpi r18, 0x10 ; 16 3085a: 81 f4 brne .+32 ; 0x3087c 3085c: 88 3f cpi r24, 0xF8 ; 248 3085e: ef ef ldi r30, 0xFF ; 255 30860: 9e 07 cpc r25, r30 30862: a1 05 cpc r26, r1 30864: b1 05 cpc r27, r1 30866: 08 f0 brcs .+2 ; 0x3086a 30868: 4c cf rjmp .-360 ; 0x30702 // add cluster if at end of chain if (!addCluster()) goto fail; } else { curCluster_ = next; 3086a: 80 93 23 17 sts 0x1723, r24 ; 0x801723 3086e: 90 93 24 17 sts 0x1724, r25 ; 0x801724 30872: a0 93 25 17 sts 0x1725, r26 ; 0x801725 30876: b0 93 26 17 sts 0x1726, r27 ; 0x801726 3087a: 4a cf rjmp .-364 ; 0x30710 return cluster >= FAT32EOC_MIN; 3087c: 88 3f cpi r24, 0xF8 ; 248 3087e: ff ef ldi r31, 0xFF ; 255 30880: 9f 07 cpc r25, r31 30882: af 07 cpc r26, r31 30884: ff e0 ldi r31, 0x0F ; 15 30886: bf 07 cpc r27, r31 30888: 80 f3 brcs .-32 ; 0x3086a 3088a: 3b cf rjmp .-394 ; 0x30702 // invalidate cache if block is in cache vol_->cacheSetBlockNumber(0XFFFFFFFF, false); } if (!vol_->writeBlock(block, src)) goto fail; } else { if (blockOffset == 0 && curPosition_ >= fileSize_) { 3088c: 01 15 cp r16, r1 3088e: 11 05 cpc r17, r1 30890: 69 f5 brne .+90 ; 0x308ec 30892: 40 91 27 17 lds r20, 0x1727 ; 0x801727 30896: 50 91 28 17 lds r21, 0x1728 ; 0x801728 3089a: 60 91 29 17 lds r22, 0x1729 ; 0x801729 3089e: 70 91 2a 17 lds r23, 0x172A ; 0x80172a 308a2: 80 91 30 17 lds r24, 0x1730 ; 0x801730 308a6: 90 91 31 17 lds r25, 0x1731 ; 0x801731 308aa: a0 91 32 17 lds r26, 0x1732 ; 0x801732 308ae: b0 91 33 17 lds r27, 0x1733 ; 0x801733 308b2: 48 17 cp r20, r24 308b4: 59 07 cpc r21, r25 308b6: 6a 07 cpc r22, r26 308b8: 7b 07 cpc r23, r27 308ba: c0 f0 brcs .+48 ; 0x308ec // start of new block don't need to read into cache if (!vol_->cacheFlush()) goto fail; 308bc: 0f 94 d0 52 call 0x2a5a0 ; 0x2a5a0 308c0: 88 23 and r24, r24 308c2: 09 f4 brne .+2 ; 0x308c6 308c4: b3 cf rjmp .-154 ; 0x3082c 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; 308c6: 81 e0 ldi r24, 0x01 ; 1 308c8: 80 93 98 0e sts 0x0E98, r24 ; 0x800e98 cacheBlockNumber_ = blockNumber; 308cc: 40 92 90 0e sts 0x0E90, r4 ; 0x800e90 308d0: 50 92 91 0e sts 0x0E91, r5 ; 0x800e91 308d4: 60 92 92 0e sts 0x0E92, r6 ; 0x800e92 308d8: 70 92 93 0e sts 0x0E93, r7 ; 0x800e93 } 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); 308dc: a6 01 movw r20, r12 308de: b5 01 movw r22, r10 308e0: c8 01 movw r24, r16 308e2: 84 56 subi r24, 0x64 ; 100 308e4: 91 4f sbci r25, 0xF1 ; 241 308e6: 0f 94 00 e2 call 0x3c400 ; 0x3c400 308ea: 6b cf rjmp .-298 ; 0x307c2 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; 308ec: 41 e0 ldi r20, 0x01 ; 1 308ee: c3 01 movw r24, r6 308f0: b2 01 movw r22, r4 308f2: 0f 94 c8 53 call 0x2a790 ; 0x2a790 308f6: 81 11 cpse r24, r1 308f8: f1 cf rjmp .-30 ; 0x308dc 308fa: 98 cf rjmp .-208 ; 0x3082c } curPosition_ += n; src += n; nToWrite -= n; } if (curPosition_ > fileSize_) { 308fc: 80 91 30 17 lds r24, 0x1730 ; 0x801730 30900: 90 91 31 17 lds r25, 0x1731 ; 0x801731 30904: a0 91 32 17 lds r26, 0x1732 ; 0x801732 30908: b0 91 33 17 lds r27, 0x1733 ; 0x801733 3090c: 80 17 cp r24, r16 3090e: 91 07 cpc r25, r17 30910: a2 07 cpc r26, r18 30912: b3 07 cpc r27, r19 30914: 68 f4 brcc .+26 ; 0x30930 30916: 80 91 20 17 lds r24, 0x1720 ; 0x801720 // update fileSize and insure sync will update dir entry fileSize_ = curPosition_; 3091a: 00 93 30 17 sts 0x1730, r16 ; 0x801730 3091e: 10 93 31 17 sts 0x1731, r17 ; 0x801731 30922: 20 93 32 17 sts 0x1732, r18 ; 0x801732 30926: 30 93 33 17 sts 0x1733, r19 ; 0x801733 flags_ |= F_FILE_DIR_DIRTY; 3092a: 80 68 ori r24, 0x80 ; 128 3092c: 80 93 20 17 sts 0x1720, r24 ; 0x801720 } else if (dateTime_ && nbyte) { // insure sync will update modified date and time flags_ |= F_FILE_DIR_DIRTY; } if (flags_ & O_SYNC) { 30930: 80 91 20 17 lds r24, 0x1720 ; 0x801720 30934: 83 fd sbrc r24, 3 30936: 18 c0 rjmp .+48 ; 0x30968 if (!sync()) goto fail; } return nbyte; 30938: c4 01 movw r24, r8 fail: // return for write error writeError = true; return -1; } 3093a: 0f 90 pop r0 3093c: 0f 90 pop r0 3093e: 0f 90 pop r0 30940: 0f 90 pop r0 30942: df 91 pop r29 30944: cf 91 pop r28 30946: 1f 91 pop r17 30948: 0f 91 pop r16 3094a: ff 90 pop r15 3094c: ef 90 pop r14 3094e: df 90 pop r13 30950: cf 90 pop r12 30952: bf 90 pop r11 30954: af 90 pop r10 30956: 9f 90 pop r9 30958: 8f 90 pop r8 3095a: 7f 90 pop r7 3095c: 6f 90 pop r6 3095e: 5f 90 pop r5 30960: 4f 90 pop r4 30962: 3f 90 pop r3 30964: 2f 90 pop r2 30966: 08 95 ret // insure sync will update modified date and time flags_ |= F_FILE_DIR_DIRTY; } if (flags_ & O_SYNC) { if (!sync()) goto fail; 30968: 8f e1 ldi r24, 0x1F ; 31 3096a: 97 e1 ldi r25, 0x17 ; 23 3096c: 0f 94 f6 57 call 0x2afec ; 0x2afec 30970: 81 11 cpse r24, r1 30972: e2 cf rjmp .-60 ; 0x30938 30974: 5b cf rjmp .-330 ; 0x3082c 00030976 : #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) { 30976: 0f 93 push r16 30978: cf 93 push r28 3097a: df 93 push r29 3097c: cd b7 in r28, 0x3d ; 61 3097e: de b7 in r29, 0x3e ; 62 30980: a3 97 sbiw r28, 0x23 ; 35 30982: 0f b6 in r0, 0x3f ; 63 30984: f8 94 cli 30986: de bf out 0x3e, r29 ; 62 30988: 0f be out 0x3f, r0 ; 63 3098a: cd bf out 0x3d, r28 ; 61 if (nr < sort_count) 3098c: 20 91 30 16 lds r18, 0x1630 ; 0x801630 30990: 30 91 31 16 lds r19, 0x1631 ; 0x801631 30994: 82 17 cp r24, r18 30996: 93 07 cpc r25, r19 30998: d8 f4 brcc .+54 ; 0x309d0 getfilename_simple(sort_entries[(sdSort == SD_SORT_ALPHA) ? (sort_count - nr - 1) : nr]); 3099a: 61 30 cpi r22, 0x01 ; 1 3099c: 31 f4 brne .+12 ; 0x309aa 3099e: 21 50 subi r18, 0x01 ; 1 309a0: 31 09 sbc r19, r1 309a2: a9 01 movw r20, r18 309a4: 48 1b sub r20, r24 309a6: 59 0b sbc r21, r25 309a8: ca 01 movw r24, r20 309aa: 88 0f add r24, r24 309ac: 99 1f adc r25, r25 309ae: fc 01 movw r30, r24 309b0: ee 5c subi r30, 0xCE ; 206 309b2: f9 4e sbci r31, 0xE9 ; 233 309b4: 80 81 ld r24, Z 309b6: 91 81 ldd r25, Z+1 ; 0x01 309b8: 0f 94 40 79 call 0x2f280 ; 0x2f280 else getfilename_afterMaxSorting(nr); } 309bc: a3 96 adiw r28, 0x23 ; 35 309be: 0f b6 in r0, 0x3f ; 63 309c0: f8 94 cli 309c2: de bf out 0x3e, r29 ; 62 309c4: 0f be out 0x3f, r0 ; 63 309c6: cd bf out 0x3d, r28 ; 61 309c8: df 91 pop r29 309ca: cf 91 pop r28 309cc: 0f 91 pop r16 309ce: 08 95 ret void CardReader::getfilename_afterMaxSorting(uint16_t entry, const char * const match/*=NULL*/) { curDir = &workDir; 309d0: 4a e3 ldi r20, 0x3A ; 58 309d2: 55 e1 ldi r21, 0x15 ; 21 309d4: 50 93 39 15 sts 0x1539, r21 ; 0x801539 309d8: 40 93 38 15 sts 0x1538, r20 ; 0x801538 nrFiles = entry - sort_count + 1; 309dc: 82 1b sub r24, r18 309de: 93 0b sbc r25, r19 309e0: 01 96 adiw r24, 0x01 ; 1 309e2: 90 93 a8 17 sts 0x17A8, r25 ; 0x8017a8 309e6: 80 93 a7 17 sts 0x17A7, r24 ; 0x8017a7 curDir->seekSet(lastSortedFilePosition << 5); 309ea: 40 91 fa 16 lds r20, 0x16FA ; 0x8016fa 309ee: 50 91 fb 16 lds r21, 0x16FB ; 0x8016fb 309f2: 85 e0 ldi r24, 0x05 ; 5 309f4: 44 0f add r20, r20 309f6: 55 1f adc r21, r21 309f8: 8a 95 dec r24 309fa: e1 f7 brne .-8 ; 0x309f4 309fc: 70 e0 ldi r23, 0x00 ; 0 309fe: 60 e0 ldi r22, 0x00 ; 0 30a00: 8a e3 ldi r24, 0x3A ; 58 30a02: 95 e1 ldi r25, 0x15 ; 21 30a04: 0f 94 4d 56 call 0x2ac9a ; 0x2ac9a }; struct ls_param { bool LFN : 1; bool timestamp : 1; inline ls_param():LFN(0), timestamp(0) { } 30a08: 00 e0 ldi r16, 0x00 ; 0 30a0a: 0e 7f andi r16, 0xFE ; 254 30a0c: 0d 7f andi r16, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 30a0e: e0 91 38 15 lds r30, 0x1538 ; 0x801538 30a12: f0 91 39 15 lds r31, 0x1539 ; 0x801539 30a16: 83 e2 ldi r24, 0x23 ; 35 30a18: de 01 movw r26, r28 30a1a: 11 96 adiw r26, 0x01 ; 1 30a1c: 01 90 ld r0, Z+ 30a1e: 0d 92 st X+, r0 30a20: 8a 95 dec r24 30a22: e1 f7 brne .-8 ; 0x30a1c 30a24: 22 e0 ldi r18, 0x02 ; 2 30a26: 50 e0 ldi r21, 0x00 ; 0 30a28: 40 e0 ldi r20, 0x00 ; 0 30a2a: be 01 movw r22, r28 30a2c: 6f 5f subi r22, 0xFF ; 255 30a2e: 7f 4f sbci r23, 0xFF ; 255 30a30: 86 ef ldi r24, 0xF6 ; 246 30a32: 92 e0 ldi r25, 0x02 ; 2 30a34: 0f 94 ca 76 call 0x2ed94 ; 0x2ed94 30a38: ce 01 movw r24, r28 30a3a: 01 96 adiw r24, 0x01 ; 1 30a3c: 0e 94 49 77 call 0xee92 ; 0xee92 30a40: bd cf rjmp .-134 ; 0x309bc 00030a42 : SERIAL_PROTOCOL(fname); SERIAL_PROTOCOLLN('.'); } } void CardReader::openFileWrite(const char* name) 30a42: 0f 93 push r16 30a44: 1f 93 push r17 30a46: cf 93 push r28 30a48: df 93 push r29 30a4a: 1f 92 push r1 30a4c: 1f 92 push r1 30a4e: cd b7 in r28, 0x3d ; 61 30a50: de b7 in r29, 0x3e ; 62 { if(!mounted) 30a52: 20 91 90 14 lds r18, 0x1490 ; 0x801490 30a56: 22 23 and r18, r18 30a58: 69 f1 breq .+90 ; 0x30ab4 30a5a: 8c 01 movw r16, r24 return; if(file.isOpen()){ //replacing current file by new file, or subfile call 30a5c: 80 91 22 17 lds r24, 0x1722 ; 0x801722 30a60: 88 23 and r24, r24 30a62: 79 f1 breq .+94 ; 0x30ac2 SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; file_subcall_ctr++; file.close(); #else SERIAL_ECHOLNPGM("File already opened"); 30a64: 8b e7 ldi r24, 0x7B ; 123 30a66: 98 ea ldi r25, 0xA8 ; 168 30a68: 0e 94 93 79 call 0xf326 ; 0xf326 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; 30a6c: 10 92 8f 14 sts 0x148F, r1 ; 0x80148f const char *fname=name; 30a70: 1a 83 std Y+2, r17 ; 0x02 30a72: 09 83 std Y+1, r16 ; 0x01 if (!diveSubfolder(fname)) 30a74: ce 01 movw r24, r28 30a76: 01 96 adiw r24, 0x01 ; 1 30a78: 0f 94 81 7e call 0x2fd02 ; 0x2fd02 30a7c: 88 23 and r24, r24 30a7e: d1 f0 breq .+52 ; 0x30ab4 return; //write if (!file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)){ 30a80: 49 81 ldd r20, Y+1 ; 0x01 30a82: 5a 81 ldd r21, Y+2 ; 0x02 30a84: 60 91 38 15 lds r22, 0x1538 ; 0x801538 30a88: 70 91 39 15 lds r23, 0x1539 ; 0x801539 30a8c: 26 e5 ldi r18, 0x56 ; 86 30a8e: 8f e1 ldi r24, 0x1F ; 31 30a90: 97 e1 ldi r25, 0x17 ; 23 30a92: 0f 94 d3 63 call 0x2c7a6 ; 0x2c7a6 30a96: 81 11 cpse r24, r1 30a98: 22 c0 rjmp .+68 ; 0x30ade SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); 30a9a: 82 e0 ldi r24, 0x02 ; 2 30a9c: 91 e7 ldi r25, 0x71 ; 113 30a9e: 0e 94 68 77 call 0xeed0 ; 0xeed0 30aa2: 89 81 ldd r24, Y+1 ; 0x01 30aa4: 9a 81 ldd r25, Y+2 ; 0x02 30aa6: 0e 94 2c 88 call 0x11058 ; 0x11058 30aaa: 8e e2 ldi r24, 0x2E ; 46 30aac: 0e 94 4f 77 call 0xee9e ; 0xee9e } void MarlinSerial::println(char c, int base) { print(c, base); println(); 30ab0: 0f 94 b8 d5 call 0x3ab70 ; 0x3ab70 SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED lcd_setstatuspgm(ofFileSelected); scrollstuff = 0; } } 30ab4: 0f 90 pop r0 30ab6: 0f 90 pop r0 30ab8: df 91 pop r29 30aba: cf 91 pop r28 30abc: 1f 91 pop r17 30abe: 0f 91 pop r16 30ac0: 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 30ac2: 10 92 42 17 sts 0x1742, r1 ; 0x801742 SERIAL_ECHO_START; 30ac6: 82 ef ldi r24, 0xF2 ; 242 30ac8: 9b ea ldi r25, 0xAB ; 171 30aca: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHORPGM(ofNowFreshFile); 30ace: 80 e8 ldi r24, 0x80 ; 128 30ad0: 9a ea ldi r25, 0xAA ; 170 30ad2: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHOLN(name); 30ad6: c8 01 movw r24, r16 30ad8: 0f 94 bb d5 call 0x3ab76 ; 0x3ab76 30adc: c7 cf rjmp .-114 ; 0x30a6c 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; 30ade: 81 e0 ldi r24, 0x01 ; 1 30ae0: 80 93 8d 14 sts 0x148D, r24 ; 0x80148d getfilename(0, fname); 30ae4: 89 81 ldd r24, Y+1 ; 0x01 30ae6: 9a 81 ldd r25, Y+2 ; 0x02 30ae8: 0f 94 f9 78 call 0x2f1f2 ; 0x2f1f2 SERIAL_PROTOCOLRPGM(ofWritingToFile);////MSG_SD_WRITE_TO_FILE 30aec: 89 e6 ldi r24, 0x69 ; 105 30aee: 98 ea ldi r25, 0xA8 ; 168 30af0: 0e 94 68 77 call 0xeed0 ; 0xeed0 printAbsFilenameFast(); 30af4: 0f 94 dc 79 call 0x2f3b8 ; 0x2f3b8 SERIAL_PROTOCOLLN(); 30af8: 0f 94 b8 d5 call 0x3ab70 ; 0x3ab70 SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED 30afc: 8c e5 ldi r24, 0x5C ; 92 30afe: 9a ea ldi r25, 0xAA ; 170 30b00: 0e 94 93 79 call 0xf326 ; 0xf326 lcd_setstatuspgm(ofFileSelected); 30b04: 8c e5 ldi r24, 0x5C ; 92 30b06: 9a ea ldi r25, 0xAA ; 170 30b08: 0e 94 38 f1 call 0x1e270 ; 0x1e270 scrollstuff = 0; 30b0c: 10 92 b8 0d sts 0x0DB8, r1 ; 0x800db8 30b10: d1 cf rjmp .-94 ; 0x30ab4 00030b12 : //presort(); #endif } } bool CardReader::ToshibaFlashAir_GetIP(uint8_t *ip) 30b12: 0f 93 push r16 30b14: 1f 93 push r17 30b16: cf 93 push r28 30b18: df 93 push r29 30b1a: ec 01 movw r28, r24 { memset(ip, 0, 4); 30b1c: 84 e0 ldi r24, 0x04 ; 4 30b1e: fe 01 movw r30, r28 30b20: 11 92 st Z+, r1 30b22: 8a 95 dec r24 30b24: e9 f7 brne .-6 ; 0x30b20 /** 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 30b26: 23 e0 ldi r18, 0x03 ; 3 30b28: 30 ea ldi r19, 0xA0 ; 160 30b2a: 4a e0 ldi r20, 0x0A ; 10 30b2c: 50 e9 ldi r21, 0x90 ; 144 30b2e: 60 e3 ldi r22, 0x30 ; 48 30b30: 8c ef ldi r24, 0xFC ; 252 30b32: 96 e1 ldi r25, 0x16 ; 22 30b34: 0f 94 0c 52 call 0x2a418 ; 0x2a418 30b38: 88 23 and r24, r24 30b3a: 91 f0 breq .+36 ; 0x30b60 30b3c: 23 e0 ldi r18, 0x03 ; 3 30b3e: 30 ea ldi r19, 0xA0 ; 160 30b40: 4a e0 ldi r20, 0x0A ; 10 30b42: 50 e9 ldi r21, 0x90 ; 144 30b44: 61 e1 ldi r22, 0x11 ; 17 30b46: 8c ef ldi r24, 0xFC ; 252 30b48: 96 e1 ldi r25, 0x16 ; 22 30b4a: 0f 94 0c 52 call 0x2a418 ; 0x2a418 30b4e: 88 23 and r24, r24 30b50: 39 f0 breq .+14 ; 0x30b60 bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 30b52: 80 e8 ldi r24, 0x80 ; 128 30b54: 80 93 fc 16 sts 0x16FC, r24 ; 0x8016fc chipSelectHigh(); spiSend(0xFF); // dummy clock to force FlashAir finish the command. return true; fail: chipSelectHigh(); 30b58: 0f 94 7a 74 call 0x2e8f4 ; 0x2e8f4 return false; 30b5c: 80 e0 ldi r24, 0x00 ; 0 30b5e: 2f c0 rjmp .+94 ; 0x30bbe //------------------------------------------------------------------------------ /** 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(); 30b60: 0f 94 22 29 call 0x25244 ; 0x25244 30b64: 8b 01 movw r16, r22 while ((status_ = spiRec()) == 0XFF) { 30b66: 0f 94 05 52 call 0x2a40a ; 0x2a40a 30b6a: 80 93 fe 16 sts 0x16FE, r24 ; 0x8016fe 30b6e: 8f 3f cpi r24, 0xFF ; 255 30b70: 69 f4 brne .+26 ; 0x30b8c if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { 30b72: 0f 94 22 29 call 0x25244 ; 0x25244 30b76: 60 1b sub r22, r16 30b78: 71 0b sbc r23, r17 30b7a: 6d 32 cpi r22, 0x2D ; 45 30b7c: 71 40 sbci r23, 0x01 ; 1 30b7e: 98 f3 brcs .-26 ; 0x30b66 30b80: 81 e1 ldi r24, 0x11 ; 17 30b82: 80 93 fc 16 sts 0x16FC, r24 ; 0x8016fc goto fail; } return true; fail: chipSelectHigh(); 30b86: 0f 94 7a 74 call 0x2e8f4 ; 0x2e8f4 30b8a: e6 cf rjmp .-52 ; 0x30b58 if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { error(SD_CARD_ERROR_READ_TIMEOUT); goto fail; } } if (status_ != DATA_START_BLOCK) { 30b8c: 8e 3f cpi r24, 0xFE ; 254 30b8e: 11 f0 breq .+4 ; 0x30b94 30b90: 8f e0 ldi r24, 0x0F ; 15 30b92: f7 cf rjmp .-18 ; 0x30b82 30b94: 8e 01 movw r16, r28 30b96: 0c 5f subi r16, 0xFC ; 252 30b98: 1f 4f sbci r17, 0xFF ; 255 goto fail; } // receive data for (i = 0; i < count; ++i) { dst[i] = spiRec(); 30b9a: 0f 94 05 52 call 0x2a40a ; 0x2a40a 30b9e: 89 93 st Y+, r24 if (!waitStartBlock()) { goto fail; } // receive data for (i = 0; i < count; ++i) { 30ba0: c0 17 cp r28, r16 30ba2: d1 07 cpc r29, r17 30ba4: d1 f7 brne .-12 ; 0x30b9a 30ba6: ce ef ldi r28, 0xFE ; 254 30ba8: d1 e0 ldi r29, 0x01 ; 1 dst[i] = spiRec(); } // skip dummy bytes and 16-bit crc. for (; i < 514; ++i) { spiRec(); 30baa: 0f 94 05 52 call 0x2a40a ; 0x2a40a 30bae: 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) { 30bb0: e1 f7 brne .-8 ; 0x30baa spiRec(); } chipSelectHigh(); 30bb2: 0f 94 7a 74 call 0x2e8f4 ; 0x2e8f4 spiSend(0xFF); // dummy clock to force FlashAir finish the command. 30bb6: 8f ef ldi r24, 0xFF ; 255 30bb8: 0f 94 00 52 call 0x2a400 ; 0x2a400 30bbc: 81 e0 ldi r24, 0x01 ; 1 return card.readExtMemory(1, 1, 0x400+0x150, 4, ip); } 30bbe: df 91 pop r29 30bc0: cf 91 pop r28 30bc2: 1f 91 pop r17 30bc4: 0f 91 pop r16 30bc6: 08 95 ret 00030bc8 : } 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) 30bc8: 8f 92 push r8 30bca: 9f 92 push r9 30bcc: af 92 push r10 30bce: bf 92 push r11 30bd0: cf 92 push r12 30bd2: df 92 push r13 30bd4: ef 92 push r14 30bd6: ff 92 push r15 30bd8: 0f 93 push r16 30bda: 1f 93 push r17 30bdc: cf 93 push r28 30bde: df 93 push r29 30be0: 1f 92 push r1 30be2: cd b7 in r28, 0x3d ; 61 30be4: de b7 in r29, 0x3e ; 62 30be6: 6b 01 movw r12, r22 30be8: 7c 01 movw r14, r24 30bea: 49 01 movw r8, r18 30bec: 5a 01 movw r10, r20 { #if defined(DEBUG_DCODE6) || defined(DEBUG_DCODES) || defined(XFLASH_DUMP) if(type == dcode_mem_t::xflash) 30bee: 03 30 cpi r16, 0x03 ; 3 30bf0: 19 f4 brne .+6 ; 0x30bf8 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 30bf2: 8c e5 ldi r24, 0x5C ; 92 30bf4: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 30bf6: 1d bc out 0x2d, r1 ; 45 XFLASH_SPI_ENTER(); #endif while (count) 30bf8: 81 14 cp r8, r1 30bfa: 91 04 cpc r9, r1 30bfc: a1 04 cpc r10, r1 30bfe: b1 04 cpc r11, r1 30c00: 09 f4 brne .+2 ; 0x30c04 30c02: 59 c0 rjmp .+178 ; 0x30cb6 #endif void print_hex_word(daddr_t val) { #if DADDR_SIZE > 16 print_hex_byte((val >> 16) & 0xFF); 30c04: 8e 2d mov r24, r14 30c06: 0e 94 c9 76 call 0xed92 ; 0xed92 #endif print_hex_byte((val >> 8) & 0xFF); 30c0a: 8d 2d mov r24, r13 30c0c: 0e 94 c9 76 call 0xed92 ; 0xed92 print_hex_byte(val & 0xFF); 30c10: 8c 2d mov r24, r12 30c12: 0e 94 c9 76 call 0xed92 ; 0xed92 XFLASH_SPI_ENTER(); #endif while (count) { print_hex_word(address); putchar(' '); 30c16: 60 91 1b 18 lds r22, 0x181B ; 0x80181b <__iob+0x2> 30c1a: 70 91 1c 18 lds r23, 0x181C ; 0x80181c <__iob+0x3> 30c1e: 80 e2 ldi r24, 0x20 ; 32 30c20: 90 e0 ldi r25, 0x00 ; 0 30c22: 0f 94 3f da call 0x3b47e ; 0x3b47e uint8_t count_line = countperline; 30c26: 10 e1 ldi r17, 0x10 ; 16 while (count && count_line) { uint8_t data = 0; 30c28: 19 82 std Y+1, r1 ; 0x01 switch (type) 30c2a: 01 30 cpi r16, 0x01 ; 1 30c2c: b1 f1 breq .+108 ; 0x30c9a 30c2e: 88 f1 brcs .+98 ; 0x30c92 30c30: 03 30 cpi r16, 0x03 ; 3 30c32: b9 f1 breq .+110 ; 0x30ca2 case dcode_mem_t::xflash: xflash_rd_data(address, &data, 1); break; #else case dcode_mem_t::xflash: break; #endif } ++address; 30c34: 8f ef ldi r24, 0xFF ; 255 30c36: c8 1a sub r12, r24 30c38: d8 0a sbc r13, r24 30c3a: e8 0a sbc r14, r24 30c3c: f8 0a sbc r15, r24 putchar(' '); 30c3e: 60 91 1b 18 lds r22, 0x181B ; 0x80181b <__iob+0x2> 30c42: 70 91 1c 18 lds r23, 0x181C ; 0x80181c <__iob+0x3> 30c46: 80 e2 ldi r24, 0x20 ; 32 30c48: 90 e0 ldi r25, 0x00 ; 0 30c4a: 0f 94 3f da call 0x3b47e ; 0x3b47e print_hex_byte(data); 30c4e: 89 81 ldd r24, Y+1 ; 0x01 30c50: 0e 94 c9 76 call 0xed92 ; 0xed92 count_line--; 30c54: 11 50 subi r17, 0x01 ; 1 count--; 30c56: 81 e0 ldi r24, 0x01 ; 1 30c58: 88 1a sub r8, r24 30c5a: 91 08 sbc r9, r1 30c5c: a1 08 sbc r10, r1 30c5e: b1 08 sbc r11, 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)) 30c60: 0f b6 in r0, 0x3f ; 63 30c62: 07 fe sbrs r0, 7 30c64: 06 c0 rjmp .+12 ; 0x30c72 30c66: c4 01 movw r24, r8 30c68: 9f 71 andi r25, 0x1F ; 31 30c6a: 89 2b or r24, r25 30c6c: 11 f4 brne .+4 ; 0x30c72 manage_heater(); 30c6e: 0f 94 2e 38 call 0x2705c ; 0x2705c while (count) { print_hex_word(address); putchar(' '); uint8_t count_line = countperline; while (count && count_line) 30c72: 81 14 cp r8, r1 30c74: 91 04 cpc r9, r1 30c76: a1 04 cpc r10, r1 30c78: b1 04 cpc r11, r1 30c7a: 11 f0 breq .+4 ; 0x30c80 30c7c: 11 11 cpse r17, r1 30c7e: d4 cf rjmp .-88 ; 0x30c28 // 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'); 30c80: 60 91 1b 18 lds r22, 0x181B ; 0x80181b <__iob+0x2> 30c84: 70 91 1c 18 lds r23, 0x181C ; 0x80181c <__iob+0x3> 30c88: 8a e0 ldi r24, 0x0A ; 10 30c8a: 90 e0 ldi r25, 0x00 ; 0 30c8c: 0f 94 3f da call 0x3b47e ; 0x3b47e 30c90: b3 cf rjmp .-154 ; 0x30bf8 while (count && count_line) { uint8_t data = 0; switch (type) { case dcode_mem_t::sram: data = *((uint8_t*)address); break; 30c92: f6 01 movw r30, r12 30c94: 80 81 ld r24, Z case dcode_mem_t::eeprom: data = eeprom_read_byte((uint8_t*)address); break; 30c96: 89 83 std Y+1, r24 ; 0x01 30c98: cd cf rjmp .-102 ; 0x30c34 30c9a: c6 01 movw r24, r12 30c9c: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 30ca0: fa cf rjmp .-12 ; 0x30c96 case dcode_mem_t::progmem: break; #if defined(DEBUG_DCODE6) || defined(DEBUG_DCODES) || defined(XFLASH_DUMP) case dcode_mem_t::xflash: xflash_rd_data(address, &data, 1); break; 30ca2: 21 e0 ldi r18, 0x01 ; 1 30ca4: 30 e0 ldi r19, 0x00 ; 0 30ca6: ae 01 movw r20, r28 30ca8: 4f 5f subi r20, 0xFF ; 255 30caa: 5f 4f sbci r21, 0xFF ; 255 30cac: c7 01 movw r24, r14 30cae: b6 01 movw r22, r12 30cb0: 0e 94 c2 ec call 0x1d984 ; 0x1d984 30cb4: bf cf rjmp .-130 ; 0x30c34 if((SREG & (1 << SREG_I)) && !((uint16_t)count % 8192)) manage_heater(); } putchar('\n'); } } 30cb6: 0f 90 pop r0 30cb8: df 91 pop r29 30cba: cf 91 pop r28 30cbc: 1f 91 pop r17 30cbe: 0f 91 pop r16 30cc0: ff 90 pop r15 30cc2: ef 90 pop r14 30cc4: df 90 pop r13 30cc6: cf 90 pop r12 30cc8: bf 90 pop r11 30cca: af 90 pop r10 30ccc: 9f 90 pop r9 30cce: 8f 90 pop r8 30cd0: 08 95 ret 00030cd2 : #include "planner.h" #include "temperature.h" #include "ultralcd.h" #ifdef FILAMENT_SENSOR FSensorBlockRunout::FSensorBlockRunout() { 30cd2: cf 93 push r28 30cd4: df 93 push r29 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 30cd6: c9 ea ldi r28, 0xA9 ; 169 30cd8: d7 e1 ldi r29, 0x17 ; 23 30cda: 1a 82 std Y+2, r1 ; 0x02 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 30cdc: 19 82 std Y+1, r1 ; 0x01 return fsensorDetected; } #endif void PAT9125_sensor::setJamDetectionEnabled(bool state, bool updateEEPROM) { jamDetection = state; 30cde: 1e 86 std Y+14, r1 ; 0x0e oldPos = pat9125_y; 30ce0: 80 91 8e 0e lds r24, 0x0E8E ; 0x800e8e 30ce4: 90 91 8f 0e lds r25, 0x0E8F ; 0x800e8f 30ce8: 98 8b std Y+16, r25 ; 0x10 30cea: 8f 87 std Y+15, r24 ; 0x0f resetStepCount(); 30cec: 0f 94 a5 7a call 0x2f54a ; 0x2f54a jamErrCnt = 0; 30cf0: 1d 8a std Y+21, r1 ; 0x15 fsensor.setAutoLoadEnabled(false); //suppress filament autoloads while loading filament. #if (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) fsensor.setJamDetectionEnabled(false); //suppress filament jam detection while loading filament. #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) // SERIAL_ECHOLNPGM("FSBlockRunout"); } 30cf2: df 91 pop r29 30cf4: cf 91 pop r28 30cf6: 08 95 ret 00030cf8 : //! //! @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) 30cf8: cf 92 push r12 30cfa: df 92 push r13 30cfc: ef 92 push r14 30cfe: ff 92 push r15 30d00: 69 01 movw r12, r18 30d02: 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); 30d04: 2d ec ldi r18, 0xCD ; 205 30d06: 3c ec ldi r19, 0xCC ; 204 30d08: 4c e4 ldi r20, 0x4C ; 76 30d0a: 5e e3 ldi r21, 0x3E ; 62 30d0c: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 30d10: 2d ec ldi r18, 0xCD ; 205 30d12: 3c ec ldi r19, 0xCC ; 204 30d14: 4c e4 ldi r20, 0x4C ; 76 30d16: 5e e3 ldi r21, 0x3E ; 62 30d18: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 30d1c: 2d ef ldi r18, 0xFD ; 253 30d1e: 3d ea ldi r19, 0xAD ; 173 30d20: 40 e0 ldi r20, 0x00 ; 0 30d22: 5d e3 ldi r21, 0x3D ; 61 30d24: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 30d28: a7 01 movw r20, r14 30d2a: 96 01 movw r18, r12 30d2c: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 30d30: 24 e2 ldi r18, 0x24 ; 36 30d32: 30 ef ldi r19, 0xF0 ; 240 30d34: 49 e1 ldi r20, 0x19 ; 25 30d36: 50 e4 ldi r21, 0x40 ; 64 30d38: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> } 30d3c: ff 90 pop r15 30d3e: ef 90 pop r14 30d40: df 90 pop r13 30d42: cf 90 pop r12 30d44: 08 95 ret 00030d46 : //! //! 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) 30d46: 2f 92 push r2 30d48: 3f 92 push r3 30d4a: 4f 92 push r4 30d4c: 5f 92 push r5 30d4e: 6f 92 push r6 30d50: 7f 92 push r7 30d52: 8f 92 push r8 30d54: 9f 92 push r9 30d56: af 92 push r10 30d58: bf 92 push r11 30d5a: cf 92 push r12 30d5c: df 92 push r13 30d5e: ef 92 push r14 30d60: ff 92 push r15 30d62: 0f 93 push r16 30d64: 1f 93 push r17 30d66: cf 93 push r28 30d68: df 93 push r29 30d6a: 00 d0 rcall .+0 ; 0x30d6c 30d6c: 1f 92 push r1 30d6e: 1f 92 push r1 30d70: cd b7 in r28, 0x3d ; 61 30d72: de b7 in r29, 0x3e ; 62 30d74: 8c 83 std Y+4, r24 ; 0x04 30d76: 4a 01 movw r8, r20 30d78: 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); 30d7a: 23 e4 ldi r18, 0x43 ; 67 30d7c: 3d ec ldi r19, 0xCD ; 205 30d7e: 4f e2 ldi r20, 0x2F ; 47 30d80: 5d e3 ldi r21, 0x3D ; 61 30d82: cb 01 movw r24, r22 30d84: b4 01 movw r22, r8 30d86: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 30d8a: 6b 01 movw r12, r22 30d8c: 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); 30d8e: 20 e0 ldi r18, 0x00 ; 0 30d90: 30 e0 ldi r19, 0x00 ; 0 30d92: 40 ea ldi r20, 0xA0 ; 160 30d94: 51 e4 ldi r21, 0x41 ; 65 30d96: c5 01 movw r24, r10 30d98: b4 01 movw r22, r8 30d9a: 0f 94 7c 86 call 0x30cf8 ; 0x30cf8 30d9e: 56 2e mov r5, r22 30da0: 47 2e mov r4, r23 30da2: 38 2e mov r3, r24 30da4: 29 2e mov r2, r25 const float short_extrusion = count_e(layer_height, extrusion_width, short_length); 30da6: a7 01 movw r20, r14 30da8: 96 01 movw r18, r12 30daa: c5 01 movw r24, r10 30dac: b4 01 movw r22, r8 30dae: 0f 94 7c 86 call 0x30cf8 ; 0x30cf8 30db2: 69 83 std Y+1, r22 ; 0x01 30db4: 7a 83 std Y+2, r23 ; 0x02 30db6: 8b 83 std Y+3, r24 ; 0x03 30db8: 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) 30dba: bc 80 ldd r11, Y+4 ; 0x04 30dbc: 8b 2d mov r24, r11 30dbe: 90 e0 ldi r25, 0x00 ; 0 30dc0: 9c 01 movw r18, r24 30dc2: 2d 5f subi r18, 0xFD ; 253 30dc4: 3f 4f sbci r19, 0xFF ; 255 30dc6: 3d 83 std Y+5, r19 ; 0x05 30dc8: 2c 83 std Y+4, r18 ; 0x04 30dca: 0b 2d mov r16, r11 30dcc: 10 e0 ldi r17, 0x00 ; 0 30dce: 8c 81 ldd r24, Y+4 ; 0x04 30dd0: 9d 81 ldd r25, Y+5 ; 0x05 30dd2: 80 17 cp r24, r16 30dd4: 91 07 cpc r25, r17 30dd6: 0c f4 brge .+2 ; 0x30dda 30dd8: a1 c0 rjmp .+322 ; 0x30f1c { enquecommandf_P(fmt1, 70, (35 - i*short_length * 2), long_extrusion); 30dda: 2f 92 push r2 30ddc: 3f 92 push r3 30dde: 4f 92 push r4 30de0: 5f 92 push r5 30de2: b8 01 movw r22, r16 30de4: 01 2e mov r0, r17 30de6: 00 0c add r0, r0 30de8: 88 0b sbc r24, r24 30dea: 99 0b sbc r25, r25 30dec: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 30df0: a7 01 movw r20, r14 30df2: 96 01 movw r18, r12 30df4: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 30df8: 9b 01 movw r18, r22 30dfa: ac 01 movw r20, r24 30dfc: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 30e00: 9b 01 movw r18, r22 30e02: ac 01 movw r20, r24 30e04: 60 e0 ldi r22, 0x00 ; 0 30e06: 70 e0 ldi r23, 0x00 ; 0 30e08: 8c e0 ldi r24, 0x0C ; 12 30e0a: 92 e4 ldi r25, 0x42 ; 66 30e0c: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 30e10: 9f 93 push r25 30e12: 8f 93 push r24 30e14: 7f 93 push r23 30e16: 6f 93 push r22 30e18: 1f 92 push r1 30e1a: 96 e4 ldi r25, 0x46 ; 70 30e1c: 9f 93 push r25 30e1e: 24 e5 ldi r18, 0x54 ; 84 30e20: 38 ea ldi r19, 0xA8 ; 168 30e22: 3f 93 push r19 30e24: 2f 93 push r18 30e26: 0e 94 ce 88 call 0x1119c ; 0x1119c enquecommandf_P(fmt1, 70, (35 - (2 * i + 1)*short_length), short_extrusion); 30e2a: b8 01 movw r22, r16 30e2c: 66 0f add r22, r22 30e2e: 77 1f adc r23, r23 30e30: 6f 5f subi r22, 0xFF ; 255 30e32: 7f 4f sbci r23, 0xFF ; 255 30e34: 07 2e mov r0, r23 30e36: 00 0c add r0, r0 30e38: 88 0b sbc r24, r24 30e3a: 99 0b sbc r25, r25 30e3c: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 30e40: a7 01 movw r20, r14 30e42: 96 01 movw r18, r12 30e44: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 30e48: 9b 01 movw r18, r22 30e4a: ac 01 movw r20, r24 30e4c: 60 e0 ldi r22, 0x00 ; 0 30e4e: 70 e0 ldi r23, 0x00 ; 0 30e50: 8c e0 ldi r24, 0x0C ; 12 30e52: 92 e4 ldi r25, 0x42 ; 66 30e54: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 30e58: 96 2e mov r9, r22 30e5a: 87 2e mov r8, r23 30e5c: 78 2e mov r7, r24 30e5e: 69 2e mov r6, r25 30e60: af 92 push r10 30e62: 9b 81 ldd r25, Y+3 ; 0x03 30e64: 9f 93 push r25 30e66: 2a 81 ldd r18, Y+2 ; 0x02 30e68: 2f 93 push r18 30e6a: 39 81 ldd r19, Y+1 ; 0x01 30e6c: 3f 93 push r19 30e6e: 6f 92 push r6 30e70: 7f 92 push r7 30e72: 8f 92 push r8 30e74: 9f 92 push r9 30e76: 1f 92 push r1 30e78: 86 e4 ldi r24, 0x46 ; 70 30e7a: 8f 93 push r24 30e7c: 24 e5 ldi r18, 0x54 ; 84 30e7e: 38 ea ldi r19, 0xA8 ; 168 30e80: 3f 93 push r19 30e82: 2f 93 push r18 30e84: 0e 94 ce 88 call 0x1119c ; 0x1119c enquecommandf_P(fmt1, 50, (35 - (2 * i + 1)*short_length), long_extrusion); 30e88: 2f 92 push r2 30e8a: 3f 92 push r3 30e8c: 4f 92 push r4 30e8e: 5f 92 push r5 30e90: 6f 92 push r6 30e92: 7f 92 push r7 30e94: 8f 92 push r8 30e96: 9f 92 push r9 30e98: 1f 92 push r1 30e9a: 92 e3 ldi r25, 0x32 ; 50 30e9c: 9f 93 push r25 30e9e: 24 e5 ldi r18, 0x54 ; 84 30ea0: 38 ea ldi r19, 0xA8 ; 168 30ea2: 3f 93 push r19 30ea4: 2f 93 push r18 30ea6: 0e 94 ce 88 call 0x1119c ; 0x1119c enquecommandf_P(fmt1, 50, (35 - (i + 1)*short_length * 2), short_extrusion); 30eaa: 0f b6 in r0, 0x3f ; 63 30eac: f8 94 cli 30eae: de bf out 0x3e, r29 ; 62 30eb0: 0f be out 0x3f, r0 ; 63 30eb2: cd bf out 0x3d, r28 ; 61 30eb4: af 92 push r10 30eb6: 3b 81 ldd r19, Y+3 ; 0x03 30eb8: 3f 93 push r19 30eba: 8a 81 ldd r24, Y+2 ; 0x02 30ebc: 8f 93 push r24 30ebe: 99 81 ldd r25, Y+1 ; 0x01 30ec0: 9f 93 push r25 30ec2: b8 01 movw r22, r16 30ec4: 6f 5f subi r22, 0xFF ; 255 30ec6: 7f 4f sbci r23, 0xFF ; 255 30ec8: 07 2e mov r0, r23 30eca: 00 0c add r0, r0 30ecc: 88 0b sbc r24, r24 30ece: 99 0b sbc r25, r25 30ed0: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 30ed4: a7 01 movw r20, r14 30ed6: 96 01 movw r18, r12 30ed8: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 30edc: 9b 01 movw r18, r22 30ede: ac 01 movw r20, r24 30ee0: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 30ee4: 9b 01 movw r18, r22 30ee6: ac 01 movw r20, r24 30ee8: 60 e0 ldi r22, 0x00 ; 0 30eea: 70 e0 ldi r23, 0x00 ; 0 30eec: 8c e0 ldi r24, 0x0C ; 12 30eee: 92 e4 ldi r25, 0x42 ; 66 30ef0: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 30ef4: 9f 93 push r25 30ef6: 8f 93 push r24 30ef8: 7f 93 push r23 30efa: 6f 93 push r22 30efc: 1f 92 push r1 30efe: 22 e3 ldi r18, 0x32 ; 50 30f00: 2f 93 push r18 30f02: 84 e5 ldi r24, 0x54 ; 84 30f04: 98 ea ldi r25, 0xA8 ; 168 30f06: 9f 93 push r25 30f08: 8f 93 push r24 30f0a: 0e 94 ce 88 call 0x1119c ; 0x1119c 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) 30f0e: b3 94 inc r11 30f10: 0f b6 in r0, 0x3f ; 63 30f12: f8 94 cli 30f14: de bf out 0x3e, r29 ; 62 30f16: 0f be out 0x3f, r0 ; 63 30f18: cd bf out 0x3d, r28 ; 61 30f1a: 57 cf rjmp .-338 ; 0x30dca 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); } } 30f1c: 0f 90 pop r0 30f1e: 0f 90 pop r0 30f20: 0f 90 pop r0 30f22: 0f 90 pop r0 30f24: 0f 90 pop r0 30f26: df 91 pop r29 30f28: cf 91 pop r28 30f2a: 1f 91 pop r17 30f2c: 0f 91 pop r16 30f2e: ff 90 pop r15 30f30: ef 90 pop r14 30f32: df 90 pop r13 30f34: cf 90 pop r12 30f36: bf 90 pop r11 30f38: af 90 pop r10 30f3a: 9f 90 pop r9 30f3c: 8f 90 pop r8 30f3e: 7f 90 pop r7 30f40: 6f 90 pop r6 30f42: 5f 90 pop r5 30f44: 4f 90 pop r4 30f46: 3f 90 pop r3 30f48: 2f 90 pop r2 30f4a: 08 95 ret 00030f4c : } } void st_set_position(const long *pos) { CRITICAL_SECTION_START; 30f4c: 9f b7 in r25, 0x3f ; 63 30f4e: 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)); 30f50: 80 e1 ldi r24, 0x10 ; 16 30f52: e2 ea ldi r30, 0xA2 ; 162 30f54: f6 e0 ldi r31, 0x06 ; 6 30f56: a2 eb ldi r26, 0xB2 ; 178 30f58: b6 e0 ldi r27, 0x06 ; 6 30f5a: 01 90 ld r0, Z+ 30f5c: 0d 92 st X+, r0 30f5e: 8a 95 dec r24 30f60: e1 f7 brne .-8 ; 0x30f5a CRITICAL_SECTION_END; 30f62: 9f bf out 0x3f, r25 ; 63 } 30f64: 08 95 ret 00030f66 : #include "sound.h" namespace MMU2 { void BeginReport(CommandInProgress /*cip*/, ProgressCode ec) { custom_message_type = CustomMsg::MMUProgress; 30f66: 89 e0 ldi r24, 0x09 ; 9 30f68: 80 93 c3 06 sts 0x06C3, r24 ; 0x8006c3 }; 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])) 30f6c: e1 e9 ldi r30, 0x91 ; 145 30f6e: f8 ea ldi r31, 0xA8 ; 168 30f70: 85 91 lpm r24, Z+ 30f72: 94 91 lpm r25, Z lcd_setstatuspgm( _T(ProgressCodeToText(ec)) ); 30f74: 0e 94 c4 72 call 0xe588 ; 0xe588 30f78: 0c 94 38 f1 jmp 0x1e270 ; 0x1e270 00030f7c : 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){ 30f7c: cf 93 push r28 30f7e: c8 2f mov r28, r24 extruder = ex; 30f80: 80 93 a0 13 sts 0x13A0, r24 ; 0x8013a0 MMU2_ECHO_MSGRPGM(PSTR("MMU2tool=")); 30f84: 82 ef ldi r24, 0xF2 ; 242 30f86: 9b ea ldi r25, 0xAB ; 171 30f88: 0e 94 68 77 call 0xeed0 ; 0xeed0 30f8c: 8e e4 ldi r24, 0x4E ; 78 30f8e: 98 ea ldi r25, 0xA8 ; 168 30f90: 0e 94 68 77 call 0xeed0 ; 0xeed0 30f94: 84 e4 ldi r24, 0x44 ; 68 30f96: 98 ea ldi r25, 0xA8 ; 168 30f98: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHOLN((int)ex); 30f9c: 8c 2f mov r24, r28 30f9e: 90 e0 ldi r25, 0x00 ; 0 } 30fa0: cf 91 pop r28 } void MMU2::SetCurrentTool(uint8_t ex){ extruder = ex; MMU2_ECHO_MSGRPGM(PSTR("MMU2tool=")); SERIAL_ECHOLN((int)ex); 30fa2: 0d 94 b0 74 jmp 0x2e960 ; 0x2e960 00030fa6 : tmc2130_sg_measure = 0xff; return tmc2130_sg_measure_val / tmc2130_sg_measure_cnt; } bool tmc2130_wait_standstill_xy(int timeout) 30fa6: 0f 93 push r16 30fa8: 1f 93 push r17 30faa: cf 93 push r28 30fac: df 93 push r29 30fae: 00 d0 rcall .+0 ; 0x30fb0 30fb0: 00 d0 rcall .+0 ; 0x30fb2 30fb2: 1f 92 push r1 30fb4: 1f 92 push r1 30fb6: cd b7 in r28, 0x3d ; 61 30fb8: de b7 in r29, 0x3e ; 62 30fba: 08 ee ldi r16, 0xE8 ; 232 30fbc: 13 e0 ldi r17, 0x03 ; 3 { // DBG(_n("tmc2130_wait_standstill_xy(timeout=%d)\n"), timeout); bool standstill = false; while (!standstill && (timeout > 0)) { uint32_t drv_status_x = 0; 30fbe: 1d 82 std Y+5, r1 ; 0x05 30fc0: 1e 82 std Y+6, r1 ; 0x06 30fc2: 1f 82 std Y+7, r1 ; 0x07 30fc4: 18 86 std Y+8, r1 ; 0x08 uint32_t drv_status_y = 0; 30fc6: 19 82 std Y+1, r1 ; 0x01 30fc8: 1a 82 std Y+2, r1 ; 0x02 30fca: 1b 82 std Y+3, r1 ; 0x03 30fcc: 1c 82 std Y+4, r1 ; 0x04 tmc2130_rd(X_AXIS, TMC2130_REG_DRV_STATUS, &drv_status_x); 30fce: ae 01 movw r20, r28 30fd0: 4b 5f subi r20, 0xFB ; 251 30fd2: 5f 4f sbci r21, 0xFF ; 255 30fd4: 6f e6 ldi r22, 0x6F ; 111 30fd6: 80 e0 ldi r24, 0x00 ; 0 30fd8: 0f 94 c7 23 call 0x2478e ; 0x2478e tmc2130_rd(Y_AXIS, TMC2130_REG_DRV_STATUS, &drv_status_y); 30fdc: ae 01 movw r20, r28 30fde: 4f 5f subi r20, 0xFF ; 255 30fe0: 5f 4f sbci r21, 0xFF ; 255 30fe2: 6f e6 ldi r22, 0x6F ; 111 30fe4: 81 e0 ldi r24, 0x01 ; 1 30fe6: 0f 94 c7 23 call 0x2478e ; 0x2478e // DBG(_n("\tdrv_status_x=0x%08x drv_status_x=0x%08x\n"), drv_status_x, drv_status_y); standstill = (drv_status_x & 0x80000000) && (drv_status_y & 0x80000000); 30fea: 8d 81 ldd r24, Y+5 ; 0x05 30fec: 9e 81 ldd r25, Y+6 ; 0x06 30fee: af 81 ldd r26, Y+7 ; 0x07 30ff0: b8 85 ldd r27, Y+8 ; 0x08 30ff2: b7 fd sbrc r27, 7 30ff4: 07 c0 rjmp .+14 ; 0x31004 tmc2130_check_overtemp(); 30ff6: 0f 94 bd 29 call 0x2537a ; 0x2537a 30ffa: 01 50 subi r16, 0x01 ; 1 30ffc: 11 09 sbc r17, r1 bool tmc2130_wait_standstill_xy(int timeout) { // DBG(_n("tmc2130_wait_standstill_xy(timeout=%d)\n"), timeout); bool standstill = false; while (!standstill && (timeout > 0)) 30ffe: f9 f6 brne .-66 ; 0x30fbe 31000: 80 e0 ldi r24, 0x00 ; 0 31002: 09 c0 rjmp .+18 ; 0x31016 uint32_t drv_status_x = 0; uint32_t drv_status_y = 0; tmc2130_rd(X_AXIS, TMC2130_REG_DRV_STATUS, &drv_status_x); tmc2130_rd(Y_AXIS, TMC2130_REG_DRV_STATUS, &drv_status_y); // DBG(_n("\tdrv_status_x=0x%08x drv_status_x=0x%08x\n"), drv_status_x, drv_status_y); standstill = (drv_status_x & 0x80000000) && (drv_status_y & 0x80000000); 31004: 89 81 ldd r24, Y+1 ; 0x01 31006: 9a 81 ldd r25, Y+2 ; 0x02 31008: ab 81 ldd r26, Y+3 ; 0x03 3100a: bc 81 ldd r27, Y+4 ; 0x04 3100c: b7 ff sbrs r27, 7 3100e: f3 cf rjmp .-26 ; 0x30ff6 tmc2130_check_overtemp(); 31010: 0f 94 bd 29 call 0x2537a ; 0x2537a 31014: 81 e0 ldi r24, 0x01 ; 1 timeout--; } return standstill; } 31016: 28 96 adiw r28, 0x08 ; 8 31018: 0f b6 in r0, 0x3f ; 63 3101a: f8 94 cli 3101c: de bf out 0x3e, r29 ; 62 3101e: 0f be out 0x3f, r0 ; 63 31020: cd bf out 0x3d, r28 ; 61 31022: df 91 pop r29 31024: cf 91 pop r28 31026: 1f 91 pop r17 31028: 0f 91 pop r16 3102a: 08 95 ret 0003102c : 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) { 3102c: 1f 93 push r17 3102e: cf 93 push r28 31030: df 93 push r29 31032: ec 01 movw r28, r24 31034: 16 2f mov r17, r22 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 31036: 0f 94 a3 42 call 0x28546 ; 0x28546 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))); 3103a: fe 01 movw r30, r28 3103c: 34 96 adiw r30, 0x04 ; 4 3103e: 25 91 lpm r18, Z+ 31040: 35 91 lpm r19, Z+ 31042: 45 91 lpm r20, Z+ 31044: 54 91 lpm r21, Z 31046: fe 01 movw r30, r28 31048: 65 91 lpm r22, Z+ 3104a: 75 91 lpm r23, Z+ 3104c: 85 91 lpm r24, Z+ 3104e: 94 91 lpm r25, Z 31050: 0f 94 6c c5 call 0x38ad8 ; 0x38ad8 step++; 31054: 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) { 31056: 11 50 subi r17, 0x01 ; 1 31058: 81 f7 brne .-32 ; 0x3103a 3105a: 0f 94 a3 42 call 0x28546 ; 0x28546 // 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(); } 3105e: df 91 pop r29 31060: cf 91 pop r28 31062: 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(); 31064: 0d 94 6a c5 jmp 0x38ad4 ; 0x38ad4 00031068 : } void EndReport(CommandInProgress /*cip*/, ProgressCode /*ec*/) { // clear the status msg line - let the printed filename get visible again if (!printJobOngoing()) { 31068: 0e 94 a8 67 call 0xcf50 ; 0xcf50 3106c: 81 11 cpse r24, r1 3106e: 04 c0 rjmp .+8 ; 0x31078 lcd_setstatuspgm(MSG_WELCOME); 31070: 86 eb ldi r24, 0xB6 ; 182 31072: 90 e7 ldi r25, 0x70 ; 112 31074: 0e 94 38 f1 call 0x1e270 ; 0x1e270 } custom_message_type = CustomMsg::Status; 31078: 10 92 c3 06 sts 0x06C3, r1 ; 0x8006c3 } 3107c: 08 95 ret 0003107e : EndReport(cip, ProgressCode::OK); } }; bool MMU2::WaitForMMUReady() { switch (State()) { 3107e: 80 91 b9 13 lds r24, 0x13B9 ; 0x8013b9 31082: 88 23 and r24, r24 31084: 11 f0 breq .+4 ; 0x3108a 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; 31086: 81 e0 ldi r24, 0x01 ; 1 31088: 08 95 ret }; bool MMU2::WaitForMMUReady() { switch (State()) { case xState::Stopped: return false; 3108a: 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; } } 3108c: 08 95 ret 0003108e : } tmc2130_setup_chopper(axis, tmc2130_mres[axis]); tmc2130_set_pwr(axis, pwr); } void tmc2130_set_wave(uint8_t axis, uint8_t amp, uint8_t fac1000) 3108e: 2f 92 push r2 31090: 3f 92 push r3 31092: 4f 92 push r4 31094: 5f 92 push r5 31096: 6f 92 push r6 31098: 7f 92 push r7 3109a: 8f 92 push r8 3109c: 9f 92 push r9 3109e: af 92 push r10 310a0: bf 92 push r11 310a2: cf 92 push r12 310a4: df 92 push r13 310a6: ef 92 push r14 310a8: ff 92 push r15 310aa: 0f 93 push r16 310ac: 1f 93 push r17 310ae: cf 93 push r28 310b0: df 93 push r29 310b2: cd b7 in r28, 0x3d ; 61 310b4: de b7 in r29, 0x3e ; 62 310b6: 2d 97 sbiw r28, 0x0d ; 13 310b8: 0f b6 in r0, 0x3f ; 63 310ba: f8 94 cli 310bc: de bf out 0x3e, r29 ; 62 310be: 0f be out 0x3f, r0 ; 63 310c0: cd bf out 0x3d, r28 ; 61 310c2: e8 2e mov r14, r24 // TMC2130 wave compression algorithm // optimized for minimal memory requirements // printf_P(PSTR("tmc2130_set_wave %d %d\n"), axis, fac1000); if (fac1000 < TMC2130_WAVE_FAC1000_MIN) fac1000 = 0; if (fac1000 > TMC2130_WAVE_FAC1000_MAX) fac1000 = TMC2130_WAVE_FAC1000_MAX; float fac = 0; 310c4: 41 2c mov r4, r1 310c6: 51 2c mov r5, r1 310c8: 32 01 movw r6, r4 void tmc2130_set_wave(uint8_t axis, uint8_t amp, uint8_t fac1000) { // TMC2130 wave compression algorithm // optimized for minimal memory requirements // printf_P(PSTR("tmc2130_set_wave %d %d\n"), axis, fac1000); if (fac1000 < TMC2130_WAVE_FAC1000_MIN) fac1000 = 0; 310ca: 6e 31 cpi r22, 0x1E ; 30 310cc: 90 f0 brcs .+36 ; 0x310f2 if (fac1000 > TMC2130_WAVE_FAC1000_MAX) fac1000 = TMC2130_WAVE_FAC1000_MAX; float fac = 0; if (fac1000) fac = ((float)((uint16_t)fac1000 + 1000) / 1000); //correction factor 310ce: 69 3c cpi r22, 0xC9 ; 201 310d0: 08 f0 brcs .+2 ; 0x310d4 310d2: 68 ec ldi r22, 0xC8 ; 200 310d4: 70 e0 ldi r23, 0x00 ; 0 310d6: 68 51 subi r22, 0x18 ; 24 310d8: 7c 4f sbci r23, 0xFC ; 252 310da: 90 e0 ldi r25, 0x00 ; 0 310dc: 80 e0 ldi r24, 0x00 ; 0 310de: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 310e2: 20 e0 ldi r18, 0x00 ; 0 310e4: 30 e0 ldi r19, 0x00 ; 0 310e6: 4a e7 ldi r20, 0x7A ; 122 310e8: 54 e4 ldi r21, 0x44 ; 68 310ea: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 310ee: 2b 01 movw r4, r22 310f0: 3c 01 movw r6, r24 // printf_P(PSTR(" factor: %s\n"), ftostr43(fac)); uint8_t vA = 0; //value of currentA uint8_t va = 0; //previous vA int8_t d0 = 0; //delta0 int8_t d1 = 1; //delta1 uint8_t w[4] = {1,1,1,1}; //W bits (MSLUTSEL) 310f2: 80 91 bf 02 lds r24, 0x02BF ; 0x8002bf 310f6: 90 91 c0 02 lds r25, 0x02C0 ; 0x8002c0 310fa: a0 91 c1 02 lds r26, 0x02C1 ; 0x8002c1 310fe: b0 91 c2 02 lds r27, 0x02C2 ; 0x8002c2 31102: 89 83 std Y+1, r24 ; 0x01 31104: 9a 83 std Y+2, r25 ; 0x02 31106: ab 83 std Y+3, r26 ; 0x03 31108: bc 83 std Y+4, r27 ; 0x04 uint8_t x[3] = {255,255,255}; //X segment bounds (MSLUTSEL) 3110a: 80 91 c3 02 lds r24, 0x02C3 ; 0x8002c3 3110e: 90 91 c4 02 lds r25, 0x02C4 ; 0x8002c4 31112: a0 91 c5 02 lds r26, 0x02C5 ; 0x8002c5 31116: 8d 83 std Y+5, r24 ; 0x05 31118: 9e 83 std Y+6, r25 ; 0x06 3111a: af 83 std Y+7, r26 ; 0x07 void tmc2130_wr_MSLUTSTART(uint8_t axis, uint8_t start_sin, uint8_t start_sin90) { uint32_t val = 0; val |= (uint32_t)start_sin; val |= ((uint32_t)start_sin90) << 16; tmc2130_wr(axis, TMC2130_REG_MSLUTSTART, val); 3111c: 20 e0 ldi r18, 0x00 ; 0 3111e: 30 e0 ldi r19, 0x00 ; 0 31120: 47 ef ldi r20, 0xF7 ; 247 31122: 50 e0 ldi r21, 0x00 ; 0 31124: 69 ee ldi r22, 0xE9 ; 233 31126: 8e 2d mov r24, r14 31128: 0f 94 21 24 call 0x24842 ; 0x24842 uint8_t x[3] = {255,255,255}; //X segment bounds (MSLUTSEL) uint8_t s = 0; //current segment int8_t b; //encoded bit value int8_t dA; //delta value uint8_t i = 0; //microstep index uint32_t reg = 0; //tmc2130 register 3112c: 81 2c mov r8, r1 3112e: 91 2c mov r9, r1 31130: 54 01 movw r10, r8 uint8_t w[4] = {1,1,1,1}; //W bits (MSLUTSEL) uint8_t x[3] = {255,255,255}; //X segment bounds (MSLUTSEL) uint8_t s = 0; //current segment int8_t b; //encoded bit value int8_t dA; //delta value uint8_t i = 0; //microstep index 31132: f1 2c mov r15, r1 uint8_t va = 0; //previous vA int8_t d0 = 0; //delta0 int8_t d1 = 1; //delta1 uint8_t w[4] = {1,1,1,1}; //W bits (MSLUTSEL) uint8_t x[3] = {255,255,255}; //X segment bounds (MSLUTSEL) uint8_t s = 0; //current segment 31134: 10 e0 ldi r17, 0x00 ; 0 if (fac1000) fac = ((float)((uint16_t)fac1000 + 1000) / 1000); //correction factor // printf_P(PSTR(" factor: %s\n"), ftostr43(fac)); uint8_t vA = 0; //value of currentA uint8_t va = 0; //previous vA int8_t d0 = 0; //delta0 int8_t d1 = 1; //delta1 31136: 01 e0 ldi r16, 0x01 ; 1 float fac = 0; if (fac1000) fac = ((float)((uint16_t)fac1000 + 1000) / 1000); //correction factor // printf_P(PSTR(" factor: %s\n"), ftostr43(fac)); uint8_t vA = 0; //value of currentA uint8_t va = 0; //previous vA int8_t d0 = 0; //delta0 31138: d1 2c mov r13, r1 if (fac1000 > TMC2130_WAVE_FAC1000_MAX) fac1000 = TMC2130_WAVE_FAC1000_MAX; float fac = 0; if (fac1000) fac = ((float)((uint16_t)fac1000 + 1000) / 1000); //correction factor // printf_P(PSTR(" factor: %s\n"), ftostr43(fac)); uint8_t vA = 0; //value of currentA uint8_t va = 0; //previous vA 3113a: 19 86 std Y+9, r1 ; 0x09 uint8_t i = 0; //microstep index uint32_t reg = 0; //tmc2130 register tmc2130_wr_MSLUTSTART(axis, 0, amp); do { if ((i & 0x1f) == 0) 3113c: 2f 2c mov r2, r15 3113e: 31 2c mov r3, r1 31140: 8f 2d mov r24, r15 31142: 8f 71 andi r24, 0x1F ; 31 31144: 88 87 std Y+8, r24 ; 0x08 31146: 81 11 cpse r24, r1 31148: 03 c0 rjmp .+6 ; 0x31150 reg = 0; 3114a: 81 2c mov r8, r1 3114c: 91 2c mov r9, r1 3114e: 54 01 movw r10, r8 31150: b1 01 movw r22, r2 31152: 03 2c mov r0, r3 31154: 00 0c add r0, r0 31156: 88 0b sbc r24, r24 31158: 99 0b sbc r25, r25 3115a: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 3115e: 2b ed ldi r18, 0xDB ; 219 31160: 3f e0 ldi r19, 0x0F ; 15 31162: 49 ec ldi r20, 0xC9 ; 201 31164: 50 e4 ldi r21, 0x40 ; 64 31166: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 3116a: 6a 87 std Y+10, r22 ; 0x0a 3116c: 7b 87 std Y+11, r23 ; 0x0b 3116e: 8c 87 std Y+12, r24 ; 0x0c 31170: 9d 87 std Y+13, r25 ; 0x0d // calculate value if (fac == 0) // default TMC wave 31172: 20 e0 ldi r18, 0x00 ; 0 31174: 30 e0 ldi r19, 0x00 ; 0 31176: a9 01 movw r20, r18 31178: c3 01 movw r24, r6 3117a: b2 01 movw r22, r4 3117c: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 31180: 81 11 cpse r24, r1 31182: 4d c0 rjmp .+154 ; 0x3121e vA = (uint8_t)((amp+1) * sin((2*PI*i + PI)/1024) + 0.5) - 1; 31184: 2b ed ldi r18, 0xDB ; 219 31186: 3f e0 ldi r19, 0x0F ; 15 31188: 49 e4 ldi r20, 0x49 ; 73 3118a: 50 e4 ldi r21, 0x40 ; 64 3118c: 6a 85 ldd r22, Y+10 ; 0x0a 3118e: 7b 85 ldd r23, Y+11 ; 0x0b 31190: 8c 85 ldd r24, Y+12 ; 0x0c 31192: 9d 85 ldd r25, Y+13 ; 0x0d 31194: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 31198: 20 e0 ldi r18, 0x00 ; 0 3119a: 30 e0 ldi r19, 0x00 ; 0 3119c: 40 e8 ldi r20, 0x80 ; 128 3119e: 5a e3 ldi r21, 0x3A ; 58 311a0: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 311a4: 0f 94 bf e0 call 0x3c17e ; 0x3c17e 311a8: 20 e0 ldi r18, 0x00 ; 0 311aa: 30 e0 ldi r19, 0x00 ; 0 311ac: 48 e7 ldi r20, 0x78 ; 120 311ae: 53 e4 ldi r21, 0x43 ; 67 311b0: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 311b4: 20 e0 ldi r18, 0x00 ; 0 311b6: 30 e0 ldi r19, 0x00 ; 0 311b8: 40 e0 ldi r20, 0x00 ; 0 311ba: 5f e3 ldi r21, 0x3F ; 63 311bc: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 311c0: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 311c4: cc 24 eor r12, r12 311c6: ca 94 dec r12 311c8: c6 0e add r12, r22 else // corrected wave vA = (uint8_t)(amp * pow(sin(2*PI*i/1024), fac) + 0.5); dA = vA - va; // calculate delta 311ca: 8c 2d mov r24, r12 311cc: 99 85 ldd r25, Y+9 ; 0x09 311ce: 89 1b sub r24, r25 va = vA; b = -1; if (dA == d0) b = 0; //delta == delta0 => bit=0 311d0: 8d 15 cp r24, r13 311d2: f9 f0 breq .+62 ; 0x31212 else if (dA == d1) b = 1; //delta == delta1 => bit=1 311d4: 80 17 cp r24, r16 311d6: 09 f4 brne .+2 ; 0x311da 311d8: 71 c0 rjmp .+226 ; 0x312bc else { if (dA < d0) // delta < delta0 => switch wbit down 311da: 8d 15 cp r24, r13 311dc: 0c f0 brlt .+2 ; 0x311e0 311de: 53 c0 rjmp .+166 ; 0x31286 { //printf("dn\n"); b = 0; switch (dA) 311e0: 88 23 and r24, r24 311e2: e9 f1 breq .+122 ; 0x3125e 311e4: 81 30 cpi r24, 0x01 ; 1 311e6: 09 f4 brne .+2 ; 0x311ea 311e8: 44 c0 rjmp .+136 ; 0x31272 311ea: 8f 3f cpi r24, 0xFF ; 255 311ec: 09 f0 breq .+2 ; 0x311f0 311ee: 81 c0 rjmp .+258 ; 0x312f2 { case -1: d0 = -1; d1 = 0; w[s+1] = 0; break; 311f0: e2 e0 ldi r30, 0x02 ; 2 311f2: f0 e0 ldi r31, 0x00 ; 0 311f4: ec 0f add r30, r28 311f6: fd 1f adc r31, r29 311f8: e1 0f add r30, r17 311fa: f1 1d adc r31, r1 311fc: 10 82 st Z, r1 311fe: 00 e0 ldi r16, 0x00 ; 0 case 0: d0 = 0; d1 = 1; w[s+1] = 1; break; case 1: d0 = 1; d1 = 2; w[s+1] = 2; break; default: b = -1; break; } if (b >= 0) { x[s] = i; s++; } 31200: e5 e0 ldi r30, 0x05 ; 5 31202: f0 e0 ldi r31, 0x00 ; 0 31204: ec 0f add r30, r28 31206: fd 1f adc r31, r29 31208: e1 0f add r30, r17 3120a: f1 1d adc r31, r1 3120c: f0 82 st Z, r15 3120e: 1f 5f subi r17, 0xFF ; 255 31210: d8 2e mov r13, r24 } if (b >= 0) { x[s] = i; s++; } } } if (b < 0) break; // delta out of range (<-1 or >3) if (s > 3) break; // segment out of range (> 3) 31212: 14 30 cpi r17, 0x04 ; 4 31214: 08 f4 brcc .+2 ; 0x31218 31216: 56 c0 rjmp .+172 ; 0x312c4 31218: 6c c0 rjmp .+216 ; 0x312f2 if ((i & 31) == 31) tmc2130_wr_MSLUT(axis, (uint8_t)(i >> 5), reg); else reg >>= 1; // printf("%3d\t%3d\t%2d\t%2d\t%2d\t%2d %08x\n", i, vA, dA, b, w[s], s, reg); } while (i++ != 255); 3121a: f8 2e mov r15, r24 3121c: 8f cf rjmp .-226 ; 0x3113c reg = 0; // calculate value if (fac == 0) // default TMC wave vA = (uint8_t)((amp+1) * sin((2*PI*i + PI)/1024) + 0.5) - 1; else // corrected wave vA = (uint8_t)(amp * pow(sin(2*PI*i/1024), fac) + 0.5); 3121e: 20 e0 ldi r18, 0x00 ; 0 31220: 30 e0 ldi r19, 0x00 ; 0 31222: 40 e8 ldi r20, 0x80 ; 128 31224: 5a e3 ldi r21, 0x3A ; 58 31226: 6a 85 ldd r22, Y+10 ; 0x0a 31228: 7b 85 ldd r23, Y+11 ; 0x0b 3122a: 8c 85 ldd r24, Y+12 ; 0x0c 3122c: 9d 85 ldd r25, Y+13 ; 0x0d 3122e: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 31232: 0f 94 bf e0 call 0x3c17e ; 0x3c17e 31236: a3 01 movw r20, r6 31238: 92 01 movw r18, r4 3123a: 0f 94 6f e0 call 0x3c0de ; 0x3c0de 3123e: 20 e0 ldi r18, 0x00 ; 0 31240: 30 e0 ldi r19, 0x00 ; 0 31242: 47 e7 ldi r20, 0x77 ; 119 31244: 53 e4 ldi r21, 0x43 ; 67 31246: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 3124a: 20 e0 ldi r18, 0x00 ; 0 3124c: 30 e0 ldi r19, 0x00 ; 0 3124e: 40 e0 ldi r20, 0x00 ; 0 31250: 5f e3 ldi r21, 0x3F ; 63 31252: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 31256: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 3125a: c6 2e mov r12, r22 3125c: b6 cf rjmp .-148 ; 0x311ca //printf("dn\n"); b = 0; switch (dA) { case -1: d0 = -1; d1 = 0; w[s+1] = 0; break; case 0: d0 = 0; d1 = 1; w[s+1] = 1; break; 3125e: e2 e0 ldi r30, 0x02 ; 2 31260: f0 e0 ldi r31, 0x00 ; 0 31262: ec 0f add r30, r28 31264: fd 1f adc r31, r29 31266: e1 0f add r30, r17 31268: f1 1d adc r31, r1 3126a: 91 e0 ldi r25, 0x01 ; 1 3126c: 90 83 st Z, r25 3126e: 01 e0 ldi r16, 0x01 ; 1 31270: c7 cf rjmp .-114 ; 0x31200 case 1: d0 = 1; d1 = 2; w[s+1] = 2; break; 31272: e2 e0 ldi r30, 0x02 ; 2 31274: f0 e0 ldi r31, 0x00 ; 0 31276: ec 0f add r30, r28 31278: fd 1f adc r31, r29 3127a: e1 0f add r30, r17 3127c: f1 1d adc r31, r1 3127e: 92 e0 ldi r25, 0x02 ; 2 31280: 90 83 st Z, r25 31282: 02 e0 ldi r16, 0x02 ; 2 31284: bd cf rjmp .-134 ; 0x31200 default: b = -1; break; } if (b >= 0) { x[s] = i; s++; } } else if (dA > d1) // delta > delta0 => switch wbit up 31286: 08 17 cp r16, r24 31288: a4 f5 brge .+104 ; 0x312f2 { //printf("up\n"); b = 1; switch (dA) 3128a: 82 30 cpi r24, 0x02 ; 2 3128c: 09 f4 brne .+2 ; 0x31290 3128e: 80 c0 rjmp .+256 ; 0x31390 31290: 83 30 cpi r24, 0x03 ; 3 31292: 09 f4 brne .+2 ; 0x31296 31294: 88 c0 rjmp .+272 ; 0x313a6 31296: 81 30 cpi r24, 0x01 ; 1 31298: 61 f5 brne .+88 ; 0x312f2 { case 1: d0 = 0; d1 = 1; w[s+1] = 1; break; 3129a: e2 e0 ldi r30, 0x02 ; 2 3129c: f0 e0 ldi r31, 0x00 ; 0 3129e: ec 0f add r30, r28 312a0: fd 1f adc r31, r29 312a2: e1 0f add r30, r17 312a4: f1 1d adc r31, r1 312a6: 80 83 st Z, r24 312a8: 01 e0 ldi r16, 0x01 ; 1 312aa: d1 2c mov r13, r1 case 2: d0 = 1; d1 = 2; w[s+1] = 2; break; case 3: d0 = 2; d1 = 3; w[s+1] = 3; break; default: b = -1; break; } if (b >= 0) { x[s] = i; s++; } 312ac: e5 e0 ldi r30, 0x05 ; 5 312ae: f0 e0 ldi r31, 0x00 ; 0 312b0: ec 0f add r30, r28 312b2: fd 1f adc r31, r29 312b4: e1 0f add r30, r17 312b6: f1 1d adc r31, r1 312b8: f0 82 st Z, r15 312ba: 1f 5f subi r17, 0xFF ; 255 } } if (b < 0) break; // delta out of range (<-1 or >3) if (s > 3) break; // segment out of range (> 3) 312bc: 14 30 cpi r17, 0x04 ; 4 312be: c8 f4 brcc .+50 ; 0x312f2 //printf("%d\n", vA); if (b == 1) reg |= 0x80000000; 312c0: 68 94 set 312c2: b7 f8 bld r11, 7 if ((i & 31) == 31) 312c4: 88 85 ldd r24, Y+8 ; 0x08 312c6: 8f 31 cpi r24, 0x1F ; 31 312c8: 09 f0 breq .+2 ; 0x312cc 312ca: 78 c0 rjmp .+240 ; 0x313bc tmc2130_wr_MSLUT(axis, (uint8_t)(i >> 5), reg); 312cc: b1 01 movw r22, r2 312ce: e5 e0 ldi r30, 0x05 ; 5 312d0: 75 95 asr r23 312d2: 67 95 ror r22 312d4: ea 95 dec r30 312d6: e1 f7 brne .-8 ; 0x312d0 //printf_P(PSTR("MSLUTSEL=%08lx (x1=%d x2=%d x3=%d w0=%d w1=%d w2=%d w3=%d)\n"), val, x1, x2, x3, w0, w1, w2, w3); } void tmc2130_wr_MSLUT(uint8_t axis, uint8_t i, uint32_t val) { tmc2130_wr(axis, TMC2130_REG_MSLUT0 + (i & 7), val); 312d8: 60 5a subi r22, 0xA0 ; 160 312da: 60 68 ori r22, 0x80 ; 128 312dc: a5 01 movw r20, r10 312de: 94 01 movw r18, r8 312e0: 8e 2d mov r24, r14 312e2: 0f 94 21 24 call 0x24842 ; 0x24842 if ((i & 31) == 31) tmc2130_wr_MSLUT(axis, (uint8_t)(i >> 5), reg); else reg >>= 1; // printf("%3d\t%3d\t%2d\t%2d\t%2d\t%2d %08x\n", i, vA, dA, b, w[s], s, reg); } while (i++ != 255); 312e6: 81 e0 ldi r24, 0x01 ; 1 312e8: 8f 0d add r24, r15 if (fac == 0) // default TMC wave vA = (uint8_t)((amp+1) * sin((2*PI*i + PI)/1024) + 0.5) - 1; else // corrected wave vA = (uint8_t)(amp * pow(sin(2*PI*i/1024), fac) + 0.5); dA = vA - va; // calculate delta va = vA; 312ea: c9 86 std Y+9, r12 ; 0x09 if ((i & 31) == 31) tmc2130_wr_MSLUT(axis, (uint8_t)(i >> 5), reg); else reg >>= 1; // printf("%3d\t%3d\t%2d\t%2d\t%2d\t%2d %08x\n", i, vA, dA, b, w[s], s, reg); } while (i++ != 255); 312ec: 9f ef ldi r25, 0xFF ; 255 312ee: f9 12 cpse r15, r25 312f0: 94 cf rjmp .-216 ; 0x3121a void tmc2130_wr_MSLUTSEL(uint8_t axis, uint8_t x1, uint8_t x2, uint8_t x3, uint8_t w0, uint8_t w1, uint8_t w2, uint8_t w3) { uint32_t val = 0; val |= ((uint32_t)w0); val |= ((uint32_t)w1) << 2; 312f2: 2a 81 ldd r18, Y+2 ; 0x02 312f4: 30 e0 ldi r19, 0x00 ; 0 312f6: 50 e0 ldi r21, 0x00 ; 0 312f8: 40 e0 ldi r20, 0x00 ; 0 312fa: 82 e0 ldi r24, 0x02 ; 2 312fc: 22 0f add r18, r18 312fe: 33 1f adc r19, r19 31300: 44 1f adc r20, r20 31302: 55 1f adc r21, r21 31304: 8a 95 dec r24 31306: d1 f7 brne .-12 ; 0x312fc val |= ((uint32_t)w2) << 4; 31308: 8b 80 ldd r8, Y+3 ; 0x03 3130a: 91 2c mov r9, r1 3130c: b1 2c mov r11, r1 3130e: a1 2c mov r10, r1 31310: 94 e0 ldi r25, 0x04 ; 4 31312: 88 0c add r8, r8 31314: 99 1c adc r9, r9 31316: aa 1c adc r10, r10 31318: bb 1c adc r11, r11 3131a: 9a 95 dec r25 3131c: d1 f7 brne .-12 ; 0x31312 3131e: 82 2a or r8, r18 31320: 93 2a or r9, r19 31322: a4 2a or r10, r20 31324: b5 2a or r11, r21 } void tmc2130_wr_MSLUTSEL(uint8_t axis, uint8_t x1, uint8_t x2, uint8_t x3, uint8_t w0, uint8_t w1, uint8_t w2, uint8_t w3) { uint32_t val = 0; val |= ((uint32_t)w0); 31326: 89 81 ldd r24, Y+1 ; 0x01 val |= ((uint32_t)w1) << 2; val |= ((uint32_t)w2) << 4; 31328: 88 2a or r8, r24 val |= ((uint32_t)w3) << 6; 3132a: 8c 81 ldd r24, Y+4 ; 0x04 3132c: 90 e0 ldi r25, 0x00 ; 0 3132e: b0 e0 ldi r27, 0x00 ; 0 31330: a0 e0 ldi r26, 0x00 ; 0 31332: 9c 01 movw r18, r24 31334: ad 01 movw r20, r26 31336: 66 e0 ldi r22, 0x06 ; 6 31338: 22 0f add r18, r18 3133a: 33 1f adc r19, r19 3133c: 44 1f adc r20, r20 3133e: 55 1f adc r21, r21 31340: 6a 95 dec r22 31342: d1 f7 brne .-12 ; 0x31338 31344: 28 29 or r18, r8 31346: 39 29 or r19, r9 31348: 4a 29 or r20, r10 3134a: 5b 29 or r21, r11 val |= ((uint32_t)x1) << 8; 3134c: 8d 81 ldd r24, Y+5 ; 0x05 3134e: 38 2b or r19, r24 val |= ((uint32_t)x2) << 16; 31350: 8e 81 ldd r24, Y+6 ; 0x06 31352: 48 2b or r20, r24 val |= ((uint32_t)x3) << 24; 31354: 8f 81 ldd r24, Y+7 ; 0x07 31356: 58 2b or r21, r24 tmc2130_wr(axis, TMC2130_REG_MSLUTSEL, val); 31358: 68 ee ldi r22, 0xE8 ; 232 3135a: 8e 2d mov r24, r14 else reg >>= 1; // printf("%3d\t%3d\t%2d\t%2d\t%2d\t%2d %08x\n", i, vA, dA, b, w[s], s, reg); } while (i++ != 255); tmc2130_wr_MSLUTSEL(axis, x[0], x[1], x[2], w[0], w[1], w[2], w[3]); } 3135c: 2d 96 adiw r28, 0x0d ; 13 3135e: 0f b6 in r0, 0x3f ; 63 31360: f8 94 cli 31362: de bf out 0x3e, r29 ; 62 31364: 0f be out 0x3f, r0 ; 63 31366: cd bf out 0x3d, r28 ; 61 31368: df 91 pop r29 3136a: cf 91 pop r28 3136c: 1f 91 pop r17 3136e: 0f 91 pop r16 31370: ff 90 pop r15 31372: ef 90 pop r14 31374: df 90 pop r13 31376: cf 90 pop r12 31378: bf 90 pop r11 3137a: af 90 pop r10 3137c: 9f 90 pop r9 3137e: 8f 90 pop r8 31380: 7f 90 pop r7 31382: 6f 90 pop r6 31384: 5f 90 pop r5 31386: 4f 90 pop r4 31388: 3f 90 pop r3 3138a: 2f 90 pop r2 val |= ((uint32_t)w2) << 4; val |= ((uint32_t)w3) << 6; val |= ((uint32_t)x1) << 8; val |= ((uint32_t)x2) << 16; val |= ((uint32_t)x3) << 24; tmc2130_wr(axis, TMC2130_REG_MSLUTSEL, val); 3138c: 0d 94 21 24 jmp 0x24842 ; 0x24842 //printf("up\n"); b = 1; switch (dA) { case 1: d0 = 0; d1 = 1; w[s+1] = 1; break; case 2: d0 = 1; d1 = 2; w[s+1] = 2; break; 31390: e2 e0 ldi r30, 0x02 ; 2 31392: f0 e0 ldi r31, 0x00 ; 0 31394: ec 0f add r30, r28 31396: fd 1f adc r31, r29 31398: e1 0f add r30, r17 3139a: f1 1d adc r31, r1 3139c: 80 83 st Z, r24 3139e: 02 e0 ldi r16, 0x02 ; 2 313a0: dd 24 eor r13, r13 313a2: d3 94 inc r13 313a4: 83 cf rjmp .-250 ; 0x312ac case 3: d0 = 2; d1 = 3; w[s+1] = 3; break; 313a6: e2 e0 ldi r30, 0x02 ; 2 313a8: f0 e0 ldi r31, 0x00 ; 0 313aa: ec 0f add r30, r28 313ac: fd 1f adc r31, r29 313ae: e1 0f add r30, r17 313b0: f1 1d adc r31, r1 313b2: 80 83 st Z, r24 313b4: 03 e0 ldi r16, 0x03 ; 3 313b6: f2 e0 ldi r31, 0x02 ; 2 313b8: df 2e mov r13, r31 313ba: 78 cf rjmp .-272 ; 0x312ac //printf("%d\n", vA); if (b == 1) reg |= 0x80000000; if ((i & 31) == 31) tmc2130_wr_MSLUT(axis, (uint8_t)(i >> 5), reg); else reg >>= 1; 313bc: b6 94 lsr r11 313be: a7 94 ror r10 313c0: 97 94 ror r9 313c2: 87 94 ror r8 313c4: 90 cf rjmp .-224 ; 0x312e6 000313c6 : { previous_millis_cmd.start(); } #ifdef FWRETRACT void retract(bool retracting, bool swapretract = false) { 313c6: 8f 92 push r8 313c8: 9f 92 push r9 313ca: af 92 push r10 313cc: bf 92 push r11 313ce: cf 92 push r12 313d0: df 92 push r13 313d2: ef 92 push r14 313d4: ff 92 push r15 313d6: 90 91 8d 06 lds r25, 0x068D ; 0x80068d // 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]) { 313da: 88 23 and r24, r24 313dc: 09 f4 brne .+2 ; 0x313e0 313de: 9d c0 rjmp .+314 ; 0x3151a 313e0: 91 11 cpse r25, r1 313e2: 92 c0 rjmp .+292 ; 0x31508 st_synchronize(); 313e4: 0f 94 a3 42 call 0x28546 ; 0x28546 set_destination_to_current(); 313e8: 0e 94 52 68 call 0xd0a4 ; 0xd0a4 current_position[E_AXIS]+=(swapretract?retract_length_swap:cs.retract_length)*float(extrudemultiply)*0.01f; 313ec: 60 91 bc 02 lds r22, 0x02BC ; 0x8002bc 313f0: 70 91 bd 02 lds r23, 0x02BD ; 0x8002bd 313f4: 07 2e mov r0, r23 313f6: 00 0c add r0, r0 313f8: 88 0b sbc r24, r24 313fa: 99 0b sbc r25, r25 313fc: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 31400: 20 91 40 0e lds r18, 0x0E40 ; 0x800e40 31404: 30 91 41 0e lds r19, 0x0E41 ; 0x800e41 31408: 40 91 42 0e lds r20, 0x0E42 ; 0x800e42 3140c: 50 91 43 0e lds r21, 0x0E43 ; 0x800e43 31410: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 31414: 2a e0 ldi r18, 0x0A ; 10 31416: 37 ed ldi r19, 0xD7 ; 215 31418: 43 e2 ldi r20, 0x23 ; 35 3141a: 5c e3 ldi r21, 0x3C ; 60 3141c: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 31420: 20 91 9d 06 lds r18, 0x069D ; 0x80069d 31424: 30 91 9e 06 lds r19, 0x069E ; 0x80069e 31428: 40 91 9f 06 lds r20, 0x069F ; 0x80069f 3142c: 50 91 a0 06 lds r21, 0x06A0 ; 0x8006a0 31430: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 31434: 60 93 9d 06 sts 0x069D, r22 ; 0x80069d 31438: 70 93 9e 06 sts 0x069E, r23 ; 0x80069e 3143c: 80 93 9f 06 sts 0x069F, r24 ; 0x80069f 31440: 90 93 a0 06 sts 0x06A0, r25 ; 0x8006a0 plan_set_e_position(current_position[E_AXIS]); 31444: 8d e9 ldi r24, 0x9D ; 157 31446: 96 e0 ldi r25, 0x06 ; 6 31448: 0f 94 79 63 call 0x2c6f2 ; 0x2c6f2 float oldFeedrate = feedrate; 3144c: c0 90 b8 02 lds r12, 0x02B8 ; 0x8002b8 31450: d0 90 b9 02 lds r13, 0x02B9 ; 0x8002b9 31454: e0 90 ba 02 lds r14, 0x02BA ; 0x8002ba 31458: f0 90 bb 02 lds r15, 0x02BB ; 0x8002bb feedrate=cs.retract_feedrate*60; 3145c: 20 e0 ldi r18, 0x00 ; 0 3145e: 30 e0 ldi r19, 0x00 ; 0 31460: 40 e7 ldi r20, 0x70 ; 112 31462: 52 e4 ldi r21, 0x42 ; 66 31464: 60 91 44 0e lds r22, 0x0E44 ; 0x800e44 31468: 70 91 45 0e lds r23, 0x0E45 ; 0x800e45 3146c: 80 91 46 0e lds r24, 0x0E46 ; 0x800e46 31470: 90 91 47 0e lds r25, 0x0E47 ; 0x800e47 31474: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 31478: 60 93 b8 02 sts 0x02B8, r22 ; 0x8002b8 3147c: 70 93 b9 02 sts 0x02B9, r23 ; 0x8002b9 31480: 80 93 ba 02 sts 0x02BA, r24 ; 0x8002ba 31484: 90 93 bb 02 sts 0x02BB, r25 ; 0x8002bb retracted[active_extruder]=true; 31488: 81 e0 ldi r24, 0x01 ; 1 3148a: 80 93 8d 06 sts 0x068D, r24 ; 0x80068d prepare_move(); 3148e: 90 e0 ldi r25, 0x00 ; 0 31490: 80 e0 ldi r24, 0x00 ; 0 31492: 0e 94 20 6c call 0xd840 ; 0xd840 if(cs.retract_zlift) { 31496: 20 e0 ldi r18, 0x00 ; 0 31498: 30 e0 ldi r19, 0x00 ; 0 3149a: a9 01 movw r20, r18 3149c: 60 91 48 0e lds r22, 0x0E48 ; 0x800e48 314a0: 70 91 49 0e lds r23, 0x0E49 ; 0x800e49 314a4: 80 91 4a 0e lds r24, 0x0E4A ; 0x800e4a 314a8: 90 91 4b 0e lds r25, 0x0E4B ; 0x800e4b 314ac: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 314b0: 88 23 and r24, r24 314b2: 11 f1 breq .+68 ; 0x314f8 st_synchronize(); 314b4: 0f 94 a3 42 call 0x28546 ; 0x28546 current_position[Z_AXIS]-=cs.retract_zlift; 314b8: 20 91 48 0e lds r18, 0x0E48 ; 0x800e48 314bc: 30 91 49 0e lds r19, 0x0E49 ; 0x800e49 314c0: 40 91 4a 0e lds r20, 0x0E4A ; 0x800e4a 314c4: 50 91 4b 0e lds r21, 0x0E4B ; 0x800e4b 314c8: 60 91 99 06 lds r22, 0x0699 ; 0x800699 314cc: 70 91 9a 06 lds r23, 0x069A ; 0x80069a 314d0: 80 91 9b 06 lds r24, 0x069B ; 0x80069b 314d4: 90 91 9c 06 lds r25, 0x069C ; 0x80069c 314d8: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 314dc: 60 93 99 06 sts 0x0699, r22 ; 0x800699 314e0: 70 93 9a 06 sts 0x069A, r23 ; 0x80069a 314e4: 80 93 9b 06 sts 0x069B, r24 ; 0x80069b 314e8: 90 93 9c 06 sts 0x069C, r25 ; 0x80069c plan_set_position_curposXYZE(); 314ec: 0f 94 c4 be call 0x37d88 ; 0x37d88 prepare_move(); 314f0: 90 e0 ldi r25, 0x00 ; 0 314f2: 80 e0 ldi r24, 0x00 ; 0 314f4: 0e 94 20 6c call 0xd840 ; 0xd840 } feedrate = oldFeedrate; 314f8: c0 92 b8 02 sts 0x02B8, r12 ; 0x8002b8 314fc: d0 92 b9 02 sts 0x02B9, r13 ; 0x8002b9 31500: e0 92 ba 02 sts 0x02BA, r14 ; 0x8002ba 31504: f0 92 bb 02 sts 0x02BB, r15 ; 0x8002bb plan_set_e_position(current_position[E_AXIS]); retracted[active_extruder]=false; prepare_move(); feedrate = oldFeedrate; } } //retract 31508: ff 90 pop r15 3150a: ef 90 pop r14 3150c: df 90 pop r13 3150e: cf 90 pop r12 31510: bf 90 pop r11 31512: af 90 pop r10 31514: 9f 90 pop r9 31516: 8f 90 pop r8 31518: 08 95 ret current_position[Z_AXIS]-=cs.retract_zlift; plan_set_position_curposXYZE(); prepare_move(); } feedrate = oldFeedrate; } else if(!retracting && retracted[active_extruder]) { 3151a: 99 23 and r25, r25 3151c: a9 f3 breq .-22 ; 0x31508 st_synchronize(); 3151e: 0f 94 a3 42 call 0x28546 ; 0x28546 set_destination_to_current(); 31522: 0e 94 52 68 call 0xd0a4 ; 0xd0a4 float oldFeedrate = feedrate; 31526: 80 90 b8 02 lds r8, 0x02B8 ; 0x8002b8 3152a: 90 90 b9 02 lds r9, 0x02B9 ; 0x8002b9 3152e: a0 90 ba 02 lds r10, 0x02BA ; 0x8002ba 31532: b0 90 bb 02 lds r11, 0x02BB ; 0x8002bb feedrate=cs.retract_recover_feedrate*60; 31536: 20 e0 ldi r18, 0x00 ; 0 31538: 30 e0 ldi r19, 0x00 ; 0 3153a: 40 e7 ldi r20, 0x70 ; 112 3153c: 52 e4 ldi r21, 0x42 ; 66 3153e: 60 91 50 0e lds r22, 0x0E50 ; 0x800e50 31542: 70 91 51 0e lds r23, 0x0E51 ; 0x800e51 31546: 80 91 52 0e lds r24, 0x0E52 ; 0x800e52 3154a: 90 91 53 0e lds r25, 0x0E53 ; 0x800e53 3154e: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 31552: 60 93 b8 02 sts 0x02B8, r22 ; 0x8002b8 31556: 70 93 b9 02 sts 0x02B9, r23 ; 0x8002b9 3155a: 80 93 ba 02 sts 0x02BA, r24 ; 0x8002ba 3155e: 90 93 bb 02 sts 0x02BB, r25 ; 0x8002bb if(cs.retract_zlift) { 31562: c0 90 48 0e lds r12, 0x0E48 ; 0x800e48 31566: d0 90 49 0e lds r13, 0x0E49 ; 0x800e49 3156a: e0 90 4a 0e lds r14, 0x0E4A ; 0x800e4a 3156e: f0 90 4b 0e lds r15, 0x0E4B ; 0x800e4b 31572: 20 e0 ldi r18, 0x00 ; 0 31574: 30 e0 ldi r19, 0x00 ; 0 31576: a9 01 movw r20, r18 31578: c7 01 movw r24, r14 3157a: b6 01 movw r22, r12 3157c: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 31580: 88 23 and r24, r24 31582: e1 f0 breq .+56 ; 0x315bc current_position[Z_AXIS]+=cs.retract_zlift; 31584: a7 01 movw r20, r14 31586: 96 01 movw r18, r12 31588: 60 91 99 06 lds r22, 0x0699 ; 0x800699 3158c: 70 91 9a 06 lds r23, 0x069A ; 0x80069a 31590: 80 91 9b 06 lds r24, 0x069B ; 0x80069b 31594: 90 91 9c 06 lds r25, 0x069C ; 0x80069c 31598: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 3159c: 60 93 99 06 sts 0x0699, r22 ; 0x800699 315a0: 70 93 9a 06 sts 0x069A, r23 ; 0x80069a 315a4: 80 93 9b 06 sts 0x069B, r24 ; 0x80069b 315a8: 90 93 9c 06 sts 0x069C, r25 ; 0x80069c plan_set_position_curposXYZE(); 315ac: 0f 94 c4 be call 0x37d88 ; 0x37d88 prepare_move(); 315b0: 90 e0 ldi r25, 0x00 ; 0 315b2: 80 e0 ldi r24, 0x00 ; 0 315b4: 0e 94 20 6c call 0xd840 ; 0xd840 st_synchronize(); 315b8: 0f 94 a3 42 call 0x28546 ; 0x28546 } current_position[E_AXIS]-=(swapretract?(retract_length_swap+retract_recover_length_swap):(cs.retract_length+cs.retract_recover_length))*float(extrudemultiply)*0.01f; 315bc: 20 91 4c 0e lds r18, 0x0E4C ; 0x800e4c 315c0: 30 91 4d 0e lds r19, 0x0E4D ; 0x800e4d 315c4: 40 91 4e 0e lds r20, 0x0E4E ; 0x800e4e 315c8: 50 91 4f 0e lds r21, 0x0E4F ; 0x800e4f 315cc: 60 91 40 0e lds r22, 0x0E40 ; 0x800e40 315d0: 70 91 41 0e lds r23, 0x0E41 ; 0x800e41 315d4: 80 91 42 0e lds r24, 0x0E42 ; 0x800e42 315d8: 90 91 43 0e lds r25, 0x0E43 ; 0x800e43 315dc: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 315e0: 6b 01 movw r12, r22 315e2: 7c 01 movw r14, r24 315e4: 60 91 bc 02 lds r22, 0x02BC ; 0x8002bc 315e8: 70 91 bd 02 lds r23, 0x02BD ; 0x8002bd 315ec: 07 2e mov r0, r23 315ee: 00 0c add r0, r0 315f0: 88 0b sbc r24, r24 315f2: 99 0b sbc r25, r25 315f4: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 315f8: 9b 01 movw r18, r22 315fa: ac 01 movw r20, r24 315fc: c7 01 movw r24, r14 315fe: b6 01 movw r22, r12 31600: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 31604: 2a e0 ldi r18, 0x0A ; 10 31606: 37 ed ldi r19, 0xD7 ; 215 31608: 43 e2 ldi r20, 0x23 ; 35 3160a: 5c e3 ldi r21, 0x3C ; 60 3160c: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 31610: 9b 01 movw r18, r22 31612: ac 01 movw r20, r24 31614: 60 91 9d 06 lds r22, 0x069D ; 0x80069d 31618: 70 91 9e 06 lds r23, 0x069E ; 0x80069e 3161c: 80 91 9f 06 lds r24, 0x069F ; 0x80069f 31620: 90 91 a0 06 lds r25, 0x06A0 ; 0x8006a0 31624: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 31628: 60 93 9d 06 sts 0x069D, r22 ; 0x80069d 3162c: 70 93 9e 06 sts 0x069E, r23 ; 0x80069e 31630: 80 93 9f 06 sts 0x069F, r24 ; 0x80069f 31634: 90 93 a0 06 sts 0x06A0, r25 ; 0x8006a0 plan_set_e_position(current_position[E_AXIS]); 31638: 8d e9 ldi r24, 0x9D ; 157 3163a: 96 e0 ldi r25, 0x06 ; 6 3163c: 0f 94 79 63 call 0x2c6f2 ; 0x2c6f2 retracted[active_extruder]=false; 31640: 10 92 8d 06 sts 0x068D, r1 ; 0x80068d prepare_move(); 31644: 90 e0 ldi r25, 0x00 ; 0 31646: 80 e0 ldi r24, 0x00 ; 0 31648: 0e 94 20 6c call 0xd840 ; 0xd840 feedrate = oldFeedrate; 3164c: 80 92 b8 02 sts 0x02B8, r8 ; 0x8002b8 31650: 90 92 b9 02 sts 0x02B9, r9 ; 0x8002b9 31654: a0 92 ba 02 sts 0x02BA, r10 ; 0x8002ba 31658: b0 92 bb 02 sts 0x02BB, r11 ; 0x8002bb 3165c: 55 cf rjmp .-342 ; 0x31508 0003165e : case Z_AXIS: _DO_STEP_Z; break; case E_AXIS: _DO_STEP_E; break; } } void tmc2130_do_steps(uint8_t axis, uint16_t steps, uint8_t dir, uint16_t delay_us) 3165e: ef 92 push r14 31660: ff 92 push r15 31662: 0f 93 push r16 31664: 1f 93 push r17 31666: cf 93 push r28 31668: c8 2f mov r28, r24 3166a: 8b 01 movw r16, r22 uint8_t tmc2130_get_dir(uint8_t axis) { switch (axis) { case X_AXIS: return _GET_DIR_X; case Y_AXIS: return _GET_DIR_Y; 3166c: 80 91 09 01 lds r24, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> return 0; } uint8_t tmc2130_get_dir(uint8_t axis) { switch (axis) 31670: c1 30 cpi r28, 0x01 ; 1 31672: b9 f0 breq .+46 ; 0x316a2 31674: c2 30 cpi r28, 0x02 ; 2 31676: c1 f0 breq .+48 ; 0x316a8 { case X_AXIS: return _GET_DIR_X; case Y_AXIS: return _GET_DIR_Y; 31678: 81 70 andi r24, 0x01 ; 1 } } void tmc2130_do_steps(uint8_t axis, uint16_t steps, uint8_t dir, uint16_t delay_us) { if (tmc2130_get_dir(axis) != dir) 3167a: 48 17 cp r20, r24 3167c: 21 f0 breq .+8 ; 0x31686 tmc2130_set_dir(axis, dir); 3167e: 64 2f mov r22, r20 31680: 8c 2f mov r24, r28 31682: 0f 94 84 23 call 0x24708 ; 0x24708 31686: 8b e9 ldi r24, 0x9B ; 155 31688: e8 2e mov r14, r24 3168a: 8f e0 ldi r24, 0x0F ; 15 3168c: f8 2e mov r15, r24 while (steps--) 3168e: 01 50 subi r16, 0x01 ; 1 31690: 11 09 sbc r17, r1 31692: 70 f0 brcs .+28 ; 0x316b0 { tmc2130_do_step(axis); 31694: 8c 2f mov r24, r28 31696: 0f 94 73 23 call 0x246e6 ; 0x246e6 3169a: c7 01 movw r24, r14 3169c: 01 97 sbiw r24, 0x01 ; 1 3169e: f1 f7 brne .-4 ; 0x3169c 316a0: f6 cf rjmp .-20 ; 0x3168e uint8_t tmc2130_get_dir(uint8_t axis) { switch (axis) { case X_AXIS: return _GET_DIR_X; case Y_AXIS: return _GET_DIR_Y; 316a2: 86 95 lsr r24 316a4: 8c 27 eor r24, r28 316a6: e8 cf rjmp .-48 ; 0x31678 case Z_AXIS: return _GET_DIR_Z; 316a8: 82 fb bst r24, 2 316aa: 88 27 eor r24, r24 316ac: 80 f9 bld r24, 0 316ae: e5 cf rjmp .-54 ; 0x3167a while (steps--) { tmc2130_do_step(axis); delayMicroseconds(delay_us); } } 316b0: cf 91 pop r28 316b2: 1f 91 pop r17 316b4: 0f 91 pop r16 316b6: ff 90 pop r15 316b8: ef 90 pop r14 316ba: 08 95 ret 000316bc : void tmc2130_goto_step(uint8_t axis, uint8_t step, uint8_t dir, uint16_t delay_us, uint16_t microstep_resolution) 316bc: 8f 92 push r8 316be: 9f 92 push r9 316c0: af 92 push r10 316c2: bf 92 push r11 316c4: cf 92 push r12 316c6: df 92 push r13 316c8: ef 92 push r14 316ca: ff 92 push r15 316cc: 0f 93 push r16 316ce: 1f 93 push r17 316d0: cf 93 push r28 316d2: c8 2f mov r28, r24 316d4: 8a 01 movw r16, r20 { printf_P(PSTR("tmc2130_goto_step %d %d %d %d \n"), axis, step, dir, delay_us, microstep_resolution); 316d6: c6 2e mov r12, r22 316d8: d1 2c mov r13, r1 316da: 1f 93 push r17 316dc: 4f 93 push r20 316de: 83 e0 ldi r24, 0x03 ; 3 316e0: 8f 93 push r24 316e2: 88 ee ldi r24, 0xE8 ; 232 316e4: 8f 93 push r24 316e6: 1f 92 push r1 316e8: 82 e0 ldi r24, 0x02 ; 2 316ea: 8f 93 push r24 316ec: 1f 92 push r1 316ee: 6f 93 push r22 316f0: 1f 92 push r1 316f2: cf 93 push r28 316f4: 8b e0 ldi r24, 0x0B ; 11 316f6: 97 ea ldi r25, 0xA7 ; 167 316f8: 9f 93 push r25 316fa: 8f 93 push r24 316fc: 0f 94 99 da call 0x3b532 ; 0x3b532 31700: 8d b7 in r24, 0x3d ; 61 31702: 9e b7 in r25, 0x3e ; 62 31704: 0c 96 adiw r24, 0x0c ; 12 31706: 0f b6 in r0, 0x3f ; 63 31708: f8 94 cli 3170a: 9e bf out 0x3e, r25 ; 62 3170c: 0f be out 0x3f, r0 ; 63 3170e: 8d bf out 0x3d, r24 ; 61 31710: 90 e0 ldi r25, 0x00 ; 0 31712: 80 e0 ldi r24, 0x00 ; 0 uint8_t shift; for (shift = 0; shift < 8; shift++) if (microstep_resolution == (256u >> shift)) break; 31714: 40 e0 ldi r20, 0x00 ; 0 31716: 51 e0 ldi r21, 0x01 ; 1 31718: 28 2f mov r18, r24 3171a: ba 01 movw r22, r20 3171c: 08 2e mov r0, r24 3171e: 02 c0 rjmp .+4 ; 0x31724 31720: 76 95 lsr r23 31722: 67 95 ror r22 31724: 0a 94 dec r0 31726: e2 f7 brpl .-8 ; 0x31720 31728: 06 17 cp r16, r22 3172a: 17 07 cpc r17, r23 3172c: 29 f0 breq .+10 ; 0x31738 3172e: 01 96 adiw r24, 0x01 ; 1 31730: 88 30 cpi r24, 0x08 ; 8 31732: 91 05 cpc r25, r1 31734: 89 f7 brne .-30 ; 0x31718 31736: 28 e0 ldi r18, 0x08 ; 8 uint16_t cnt = 4 * (1 << (8 - shift)); 31738: e2 2e mov r14, r18 3173a: f1 2c mov r15, r1 3173c: 88 e0 ldi r24, 0x08 ; 8 3173e: 90 e0 ldi r25, 0x00 ; 0 31740: 8e 19 sub r24, r14 31742: 9f 09 sbc r25, r15 31744: 24 e0 ldi r18, 0x04 ; 4 31746: 30 e0 ldi r19, 0x00 ; 0 31748: 59 01 movw r10, r18 3174a: 02 c0 rjmp .+4 ; 0x31750 3174c: aa 0c add r10, r10 3174e: bb 1c adc r11, r11 31750: 8a 95 dec r24 31752: e2 f7 brpl .-8 ; 0x3174c uint16_t mscnt = tmc2130_rd_MSCNT(axis); 31754: 8c 2f mov r24, r28 31756: 0f 94 4b 24 call 0x24896 ; 0x24896 3175a: 9c 01 movw r18, r24 3175c: 90 e0 ldi r25, 0x00 ; 0 3175e: c4 30 cpi r28, 0x04 ; 4 31760: 28 f4 brcc .+10 ; 0x3176c 31762: ec 2f mov r30, r28 31764: f0 e0 ldi r31, 0x00 ; 0 31766: e3 5e subi r30, 0xE3 ; 227 31768: fc 4f sbci r31, 0xFC ; 252 3176a: 90 81 ld r25, Z if (dir == 2) { dir = tmc2130_get_inv(axis)?0:1; int steps = (int)step - (int)(mscnt >> shift); 3176c: 0e 2c mov r0, r14 3176e: 02 c0 rjmp .+4 ; 0x31774 31770: 36 95 lsr r19 31772: 27 95 ror r18 31774: 0a 94 dec r0 31776: e2 f7 brpl .-8 ; 0x31770 31778: 86 01 movw r16, r12 3177a: 02 1b sub r16, r18 3177c: 13 0b sbc r17, r19 if (steps > static_cast(cnt / 2)) 3177e: 95 01 movw r18, r10 31780: 36 95 lsr r19 31782: 27 95 ror r18 { dir ^= 1; 31784: 61 e0 ldi r22, 0x01 ; 1 uint16_t mscnt = tmc2130_rd_MSCNT(axis); if (dir == 2) { dir = tmc2130_get_inv(axis)?0:1; int steps = (int)step - (int)(mscnt >> shift); if (steps > static_cast(cnt / 2)) 31786: 20 17 cp r18, r16 31788: 31 07 cpc r19, r17 3178a: 74 f1 brlt .+92 ; 0x317e8 uint8_t shift; for (shift = 0; shift < 8; shift++) if (microstep_resolution == (256u >> shift)) break; uint16_t cnt = 4 * (1 << (8 - shift)); uint16_t mscnt = tmc2130_rd_MSCNT(axis); if (dir == 2) { dir = tmc2130_get_inv(axis)?0:1; 3178c: 91 11 cpse r25, r1 3178e: 60 e0 ldi r22, 0x00 ; 0 if (steps > static_cast(cnt / 2)) { dir ^= 1; steps = cnt - steps; // This can create a negative step value } if (steps < 0) 31790: 17 ff sbrs r17, 7 31792: 05 c0 rjmp .+10 ; 0x3179e { dir ^= 1; 31794: 81 e0 ldi r24, 0x01 ; 1 31796: 68 27 eor r22, r24 steps = -steps; 31798: 11 95 neg r17 3179a: 01 95 neg r16 3179c: 11 09 sbc r17, r1 } cnt = steps; } tmc2130_set_dir(axis, dir); 3179e: 8c 2f mov r24, r28 317a0: 0f 94 84 23 call 0x24708 ; 0x24708 mscnt = tmc2130_rd_MSCNT(axis); 317a4: 8c 2f mov r24, r28 317a6: 0f 94 4b 24 call 0x24896 ; 0x24896 317aa: b1 2c mov r11, r1 317ac: a1 2c mov r10, r1 317ae: 2b e9 ldi r18, 0x9B ; 155 317b0: 82 2e mov r8, r18 317b2: 2f e0 ldi r18, 0x0F ; 15 317b4: 92 2e mov r9, r18 while ((cnt--) && ((mscnt >> shift) != step)) 317b6: 0a 15 cp r16, r10 317b8: 1b 05 cpc r17, r11 317ba: f1 f0 breq .+60 ; 0x317f8 317bc: 2f ef ldi r18, 0xFF ; 255 317be: a2 1a sub r10, r18 317c0: b2 0a sbc r11, r18 317c2: 0e 2c mov r0, r14 317c4: 02 c0 rjmp .+4 ; 0x317ca 317c6: 96 95 lsr r25 317c8: 87 95 ror r24 317ca: 0a 94 dec r0 317cc: e2 f7 brpl .-8 ; 0x317c6 317ce: 8c 15 cp r24, r12 317d0: 9d 05 cpc r25, r13 317d2: 91 f0 breq .+36 ; 0x317f8 { tmc2130_do_step(axis); 317d4: 8c 2f mov r24, r28 317d6: 0f 94 73 23 call 0x246e6 ; 0x246e6 317da: c4 01 movw r24, r8 317dc: 01 97 sbiw r24, 0x01 ; 1 317de: f1 f7 brne .-4 ; 0x317dc delayMicroseconds(delay_us); mscnt = tmc2130_rd_MSCNT(axis); 317e0: 8c 2f mov r24, r28 317e2: 0f 94 4b 24 call 0x24896 ; 0x24896 317e6: e7 cf rjmp .-50 ; 0x317b6 { dir = tmc2130_get_inv(axis)?0:1; int steps = (int)step - (int)(mscnt >> shift); if (steps > static_cast(cnt / 2)) { dir ^= 1; 317e8: 91 11 cpse r25, r1 317ea: 01 c0 rjmp .+2 ; 0x317ee 317ec: 60 e0 ldi r22, 0x00 ; 0 steps = cnt - steps; // This can create a negative step value 317ee: c5 01 movw r24, r10 317f0: 80 1b sub r24, r16 317f2: 91 0b sbc r25, r17 317f4: 8c 01 movw r16, r24 317f6: cc cf rjmp .-104 ; 0x31790 { tmc2130_do_step(axis); delayMicroseconds(delay_us); mscnt = tmc2130_rd_MSCNT(axis); } } 317f8: cf 91 pop r28 317fa: 1f 91 pop r17 317fc: 0f 91 pop r16 317fe: ff 90 pop r15 31800: ef 90 pop r14 31802: df 90 pop r13 31804: cf 90 pop r12 31806: bf 90 pop r11 31808: af 90 pop r10 3180a: 9f 90 pop r9 3180c: 8f 90 pop r8 3180e: 08 95 ret 00031810 : #ifdef MESH_BED_LEVELING mesh_bed_leveling mbl; void mesh_bed_leveling::reset() { active = 0; 31810: 10 92 c1 13 sts 0x13C1, r1 ; 0x8013c1 memset(z_values, 0, sizeof(z_values)); 31814: e2 ec ldi r30, 0xC2 ; 194 31816: f3 e1 ldi r31, 0x13 ; 19 31818: 84 ec ldi r24, 0xC4 ; 196 3181a: df 01 movw r26, r30 3181c: 1d 92 st X+, r1 3181e: 8a 95 dec r24 31820: e9 f7 brne .-6 ; 0x3181c } 31822: 08 95 ret 00031824 : 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 31824: 2f 92 push r2 31826: 3f 92 push r3 31828: 4f 92 push r4 3182a: 5f 92 push r5 3182c: 6f 92 push r6 3182e: 7f 92 push r7 31830: 8f 92 push r8 31832: 9f 92 push r9 31834: af 92 push r10 31836: bf 92 push r11 31838: cf 92 push r12 3183a: df 92 push r13 3183c: ef 92 push r14 3183e: ff 92 push r15 31840: 0f 93 push r16 31842: 1f 93 push r17 31844: cf 93 push r28 31846: df 93 push r29 31848: 00 d0 rcall .+0 ; 0x3184a 3184a: 1f 92 push r1 3184c: cd b7 in r28, 0x3d ; 61 3184e: de b7 in r29, 0x3e ; 62 31850: 4b 01 movw r8, r22 31852: 5c 01 movw r10, r24 31854: 04 2f mov r16, r20 verbosity_level #endif //SUPPORT_VERBOSITY ) { bool high_deviation_occured = false; bedPWMDisabled = 1; 31856: 81 e0 ldi r24, 0x01 ; 1 31858: 80 93 8c 06 sts 0x068C, r24 ; 0x80068c #ifdef TMC2130 bool bHighPowerForced = false; if (tmc2130_mode == TMC2130_MODE_SILENT) 3185c: 80 91 8b 06 lds r24, 0x068B ; 0x80068b ) { bool high_deviation_occured = false; bedPWMDisabled = 1; #ifdef TMC2130 bool bHighPowerForced = false; 31860: 10 e0 ldi r17, 0x00 ; 0 if (tmc2130_mode == TMC2130_MODE_SILENT) 31862: 81 30 cpi r24, 0x01 ; 1 31864: 19 f4 brne .+6 ; 0x3186c { FORCE_HIGH_POWER_START; 31866: 0e 94 c8 66 call 0xcd90 ; 0xcd90 bHighPowerForced = true; 3186a: 11 e0 ldi r17, 0x01 ; 1 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 3186c: 20 91 b7 02 lds r18, 0x02B7 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> 31870: 2a 83 std Y+2, r18 ; 0x02 check_endstops = check; 31872: 81 e0 ldi r24, 0x01 ; 1 31874: 80 93 b7 02 sts 0x02B7, r24 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> //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); 31878: 80 e0 ldi r24, 0x00 ; 0 3187a: 0f 94 9d 4d call 0x29b3a ; 0x29b3a 3187e: 89 83 std Y+1, r24 ; 0x01 float z = 0.f; endstop_z_hit_on_purpose(); 31880: 0f 94 ab 4d call 0x29b56 ; 0x29b56 // move down until you find the bed current_position[Z_AXIS] = minimum_z; 31884: 80 92 99 06 sts 0x0699, r8 ; 0x800699 31888: 90 92 9a 06 sts 0x069A, r9 ; 0x80069a 3188c: a0 92 9b 06 sts 0x069B, r10 ; 0x80069b 31890: b0 92 9c 06 sts 0x069C, r11 ; 0x80069c go_to_current(homing_feedrate[Z_AXIS]/60); 31894: 65 e5 ldi r22, 0x55 ; 85 31896: 75 e5 ldi r23, 0x55 ; 85 31898: 85 e5 ldi r24, 0x55 ; 85 3189a: 91 e4 ldi r25, 0x41 ; 65 3189c: 0f 94 8c c5 call 0x38b18 ; 0x38b18 // 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(); 318a0: 0f 94 e5 cb call 0x397ca ; 0x397ca if (! endstop_z_hit_on_purpose()) 318a4: 0f 94 ab 4d call 0x29b56 ; 0x29b56 318a8: 8c 83 std Y+4, r24 ; 0x04 318aa: 88 23 and r24, r24 318ac: 09 f4 brne .+2 ; 0x318b0 318ae: f9 c0 rjmp .+498 ; 0x31aa2 { //printf_P(PSTR("endstop not hit 1, current_pos[Z]: %f \n"), current_position[Z_AXIS]); goto error; } #ifdef TMC2130 if (!READ(Z_TMC2130_DIAG)) 318b0: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 318b4: 86 ff sbrs r24, 6 318b6: f5 c0 rjmp .+490 ; 0x31aa2 { //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) 318b8: 1b 82 std Y+3, r1 ; 0x03 #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; 318ba: c1 2c mov r12, r1 318bc: d1 2c mov r13, r1 318be: 76 01 movw r14, r12 #ifdef SUPPORT_VERBOSITY verbosity_level #endif //SUPPORT_VERBOSITY ) { bool high_deviation_occured = false; 318c0: 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) 318c2: 8b 81 ldd r24, Y+3 ; 0x03 318c4: 80 17 cp r24, r16 318c6: 08 f0 brcs .+2 ; 0x318ca 318c8: a8 c0 rjmp .+336 ; 0x31a1a { current_position[Z_AXIS] += high_deviation_occured ? 0.5 : 0.2; 318ca: 60 91 99 06 lds r22, 0x0699 ; 0x800699 318ce: 70 91 9a 06 lds r23, 0x069A ; 0x80069a 318d2: 80 91 9b 06 lds r24, 0x069B ; 0x80069b 318d6: 90 91 9c 06 lds r25, 0x069C ; 0x80069c 318da: 20 e0 ldi r18, 0x00 ; 0 318dc: 30 e0 ldi r19, 0x00 ; 0 318de: 40 e0 ldi r20, 0x00 ; 0 318e0: 5f e3 ldi r21, 0x3F ; 63 318e2: 31 10 cpse r3, r1 318e4: 04 c0 rjmp .+8 ; 0x318ee 318e6: 2d ec ldi r18, 0xCD ; 205 318e8: 3c ec ldi r19, 0xCC ; 204 318ea: 4c e4 ldi r20, 0x4C ; 76 318ec: 5e e3 ldi r21, 0x3E ; 62 318ee: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 318f2: 2b 01 movw r4, r22 318f4: 3c 01 movw r6, r24 318f6: 40 92 99 06 sts 0x0699, r4 ; 0x800699 318fa: 50 92 9a 06 sts 0x069A, r5 ; 0x80069a 318fe: 60 92 9b 06 sts 0x069B, r6 ; 0x80069b 31902: 70 92 9c 06 sts 0x069C, r7 ; 0x80069c float z_bckp = current_position[Z_AXIS]; go_to_current(homing_feedrate[Z_AXIS]/60); 31906: 65 e5 ldi r22, 0x55 ; 85 31908: 75 e5 ldi r23, 0x55 ; 85 3190a: 85 e5 ldi r24, 0x55 ; 85 3190c: 91 e4 ldi r25, 0x41 ; 65 3190e: 0f 94 8c c5 call 0x38b18 ; 0x38b18 // Move back down slowly to find bed. current_position[Z_AXIS] = minimum_z; 31912: 80 92 99 06 sts 0x0699, r8 ; 0x800699 31916: 90 92 9a 06 sts 0x069A, r9 ; 0x80069a 3191a: a0 92 9b 06 sts 0x069B, r10 ; 0x80069b 3191e: b0 92 9c 06 sts 0x069C, r11 ; 0x80069c //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)); 31922: 65 e5 ldi r22, 0x55 ; 85 31924: 75 e5 ldi r23, 0x55 ; 85 31926: 85 e5 ldi r24, 0x55 ; 85 31928: 90 e4 ldi r25, 0x40 ; 64 3192a: 0f 94 8c c5 call 0x38b18 ; 0x38b18 // 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(); 3192e: 0f 94 e5 cb call 0x397ca ; 0x397ca //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) { 31932: a3 01 movw r20, r6 31934: 92 01 movw r18, r4 31936: 60 91 99 06 lds r22, 0x0699 ; 0x800699 3193a: 70 91 9a 06 lds r23, 0x069A ; 0x80069a 3193e: 80 91 9b 06 lds r24, 0x069B ; 0x80069b 31942: 90 91 9c 06 lds r25, 0x069C ; 0x80069c 31946: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 3194a: 9f 77 andi r25, 0x7F ; 127 3194c: 2d ec ldi r18, 0xCD ; 205 3194e: 3c ec ldi r19, 0xCC ; 204 31950: 4c ec ldi r20, 0xCC ; 204 31952: 5c e3 ldi r21, 0x3C ; 60 31954: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 31958: 87 ff sbrs r24, 7 3195a: 16 c0 rjmp .+44 ; 0x31988 //printf_P(PSTR("PINDA triggered immediately, move Z higher and repeat measurement\n")); raise_z(0.5); 3195c: 60 e0 ldi r22, 0x00 ; 0 3195e: 70 e0 ldi r23, 0x00 ; 0 31960: 80 e0 ldi r24, 0x00 ; 0 31962: 9f e3 ldi r25, 0x3F ; 63 31964: 0e 94 f9 6d call 0xdbf2 ; 0xdbf2 current_position[Z_AXIS] = minimum_z; 31968: 80 92 99 06 sts 0x0699, r8 ; 0x800699 3196c: 90 92 9a 06 sts 0x069A, r9 ; 0x80069a 31970: a0 92 9b 06 sts 0x069B, r10 ; 0x80069b 31974: b0 92 9c 06 sts 0x069C, r11 ; 0x80069c go_to_current(homing_feedrate[Z_AXIS]/(4*60)); 31978: 65 e5 ldi r22, 0x55 ; 85 3197a: 75 e5 ldi r23, 0x55 ; 85 3197c: 85 e5 ldi r24, 0x55 ; 85 3197e: 90 e4 ldi r25, 0x40 ; 64 31980: 0f 94 8c c5 call 0x38b18 ; 0x38b18 // 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(); 31984: 0f 94 e5 cb call 0x397ca ; 0x397ca } if (!endstop_z_hit_on_purpose()) 31988: 0f 94 ab 4d call 0x29b56 ; 0x29b56 3198c: 28 2e mov r2, r24 3198e: 88 23 and r24, r24 31990: 09 f4 brne .+2 ; 0x31994 31992: 87 c0 rjmp .+270 ; 0x31aa2 { //printf_P(PSTR("i = %d, endstop not hit 2, current_pos[Z]: %f \n"), i, current_position[Z_AXIS]); goto error; } #ifdef TMC2130 if (!READ(Z_TMC2130_DIAG)) { 31994: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 31998: 86 ff sbrs r24, 6 3199a: 83 c0 rjmp .+262 ; 0x31aa2 3199c: 40 90 99 06 lds r4, 0x0699 ; 0x800699 319a0: 50 90 9a 06 lds r5, 0x069A ; 0x80069a 319a4: 60 90 9b 06 lds r6, 0x069B ; 0x80069b 319a8: 70 90 9c 06 lds r7, 0x069C ; 0x80069c } #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; 319ac: 2b 81 ldd r18, Y+3 ; 0x03 319ae: 22 23 and r18, r18 319b0: d9 f0 breq .+54 ; 0x319e8 319b2: 62 2f mov r22, r18 319b4: 70 e0 ldi r23, 0x00 ; 0 319b6: 90 e0 ldi r25, 0x00 ; 0 319b8: 80 e0 ldi r24, 0x00 ; 0 319ba: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 319be: 9b 01 movw r18, r22 319c0: ac 01 movw r20, r24 319c2: c7 01 movw r24, r14 319c4: b6 01 movw r22, r12 319c6: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 319ca: 9b 01 movw r18, r22 319cc: ac 01 movw r20, r24 319ce: c3 01 movw r24, r6 319d0: b2 01 movw r22, r4 319d2: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 319d6: 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 319d8: 2d ec ldi r18, 0xCD ; 205 319da: 3c ec ldi r19, 0xCC ; 204 319dc: 4c e4 ldi r20, 0x4C ; 76 319de: 5d e3 ldi r21, 0x3D ; 61 319e0: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 319e4: 18 16 cp r1, r24 319e6: 64 f0 brlt .+24 ; 0x31a00 #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]; 319e8: a3 01 movw r20, r6 319ea: 92 01 movw r18, r4 319ec: c7 01 movw r24, r14 319ee: b6 01 movw r22, r12 319f0: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 319f4: 6b 01 movw r12, r22 319f6: 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) 319f8: 2b 81 ldd r18, Y+3 ; 0x03 319fa: 2f 5f subi r18, 0xFF ; 255 319fc: 2b 83 std Y+3, r18 ; 0x03 319fe: 61 cf rjmp .-318 ; 0x318c2 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 31a00: 31 10 cpse r3, r1 31a02: 4f c0 rjmp .+158 ; 0x31aa2 //printf_P(PSTR("high dev. first occurence\n")); delay_keep_alive(500); //damping 31a04: 84 ef ldi r24, 0xF4 ; 244 31a06: 91 e0 ldi r25, 0x01 ; 1 31a08: 0e 94 fc 8c call 0x119f8 ; 0x119f8 //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; 31a0c: 32 2c mov r3, r2 i = -1; 31a0e: 8f ef ldi r24, 0xFF ; 255 31a10: 8b 83 std Y+3, r24 ; 0x03 z = 0; 31a12: c1 2c mov r12, r1 31a14: d1 2c mov r13, r1 31a16: 76 01 movw r14, r12 31a18: ef cf rjmp .-34 ; 0x319f8 } } //printf_P(PSTR("PINDA triggered at %f\n"), current_position[Z_AXIS]); } current_position[Z_AXIS] = z; if (n_iter > 1) 31a1a: 02 30 cpi r16, 0x02 ; 2 31a1c: 68 f5 brcc .+90 ; 0x31a78 goto error; } } //printf_P(PSTR("PINDA triggered at %f\n"), current_position[Z_AXIS]); } current_position[Z_AXIS] = z; 31a1e: c0 92 99 06 sts 0x0699, r12 ; 0x800699 31a22: d0 92 9a 06 sts 0x069A, r13 ; 0x80069a 31a26: e0 92 9b 06 sts 0x069B, r14 ; 0x80069b 31a2a: f0 92 9c 06 sts 0x069C, r15 ; 0x80069c 31a2e: 8a 81 ldd r24, Y+2 ; 0x02 31a30: 80 93 b7 02 sts 0x02B7, r24 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> if (n_iter > 1) current_position[Z_AXIS] /= float(n_iter); enable_endstops(endstops_enabled); enable_z_endstop(endstop_z_enabled); 31a34: 89 81 ldd r24, Y+1 ; 0x01 31a36: 0f 94 9d 4d call 0x29b3a ; 0x29b3a // SERIAL_ECHOLNPGM("find_bed_induction_sensor_point_z 3"); #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; 31a3a: 11 23 and r17, r17 31a3c: 19 f0 breq .+6 ; 0x31a44 31a3e: 80 e0 ldi r24, 0x00 ; 0 31a40: 0e 94 c8 66 call 0xcd90 ; 0xcd90 #endif bedPWMDisabled = 0; 31a44: 10 92 8c 06 sts 0x068C, r1 ; 0x80068c #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; #endif bedPWMDisabled = 0; return false; } 31a48: 8c 81 ldd r24, Y+4 ; 0x04 31a4a: 0f 90 pop r0 31a4c: 0f 90 pop r0 31a4e: 0f 90 pop r0 31a50: 0f 90 pop r0 31a52: df 91 pop r29 31a54: cf 91 pop r28 31a56: 1f 91 pop r17 31a58: 0f 91 pop r16 31a5a: ff 90 pop r15 31a5c: ef 90 pop r14 31a5e: df 90 pop r13 31a60: cf 90 pop r12 31a62: bf 90 pop r11 31a64: af 90 pop r10 31a66: 9f 90 pop r9 31a68: 8f 90 pop r8 31a6a: 7f 90 pop r7 31a6c: 6f 90 pop r6 31a6e: 5f 90 pop r5 31a70: 4f 90 pop r4 31a72: 3f 90 pop r3 31a74: 2f 90 pop r2 31a76: 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); 31a78: 60 2f mov r22, r16 31a7a: 70 e0 ldi r23, 0x00 ; 0 31a7c: 90 e0 ldi r25, 0x00 ; 0 31a7e: 80 e0 ldi r24, 0x00 ; 0 31a80: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 31a84: 9b 01 movw r18, r22 31a86: ac 01 movw r20, r24 31a88: c7 01 movw r24, r14 31a8a: b6 01 movw r22, r12 31a8c: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 31a90: 60 93 99 06 sts 0x0699, r22 ; 0x800699 31a94: 70 93 9a 06 sts 0x069A, r23 ; 0x80069a 31a98: 80 93 9b 06 sts 0x069B, r24 ; 0x80069b 31a9c: 90 93 9c 06 sts 0x069C, r25 ; 0x80069c 31aa0: c6 cf rjmp .-116 ; 0x31a2e 31aa2: 2a 81 ldd r18, Y+2 ; 0x02 31aa4: 20 93 b7 02 sts 0x02B7, r18 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> return true; error: // SERIAL_ECHOLNPGM("find_bed_induction_sensor_point_z 4"); enable_endstops(endstops_enabled); enable_z_endstop(endstop_z_enabled); 31aa8: 89 81 ldd r24, Y+1 ; 0x01 31aaa: 0f 94 9d 4d call 0x29b3a ; 0x29b3a #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; 31aae: 11 23 and r17, r17 31ab0: 19 f0 breq .+6 ; 0x31ab8 31ab2: 80 e0 ldi r24, 0x00 ; 0 31ab4: 0e 94 c8 66 call 0xcd90 ; 0xcd90 #endif bedPWMDisabled = 0; 31ab8: 10 92 8c 06 sts 0x068C, r1 ; 0x80068c return false; 31abc: 1c 82 std Y+4, r1 ; 0x04 31abe: c4 cf rjmp .-120 ; 0x31a48 00031ac0 : //! @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) 31ac0: 2f 92 push r2 31ac2: 3f 92 push r3 31ac4: 4f 92 push r4 31ac6: 5f 92 push r5 31ac8: 6f 92 push r6 31aca: 7f 92 push r7 31acc: 8f 92 push r8 31ace: 9f 92 push r9 31ad0: af 92 push r10 31ad2: bf 92 push r11 31ad4: cf 92 push r12 31ad6: df 92 push r13 31ad8: ef 92 push r14 31ada: ff 92 push r15 31adc: 0f 93 push r16 31ade: 1f 93 push r17 31ae0: cf 93 push r28 31ae2: df 93 push r29 31ae4: cd b7 in r28, 0x3d ; 61 31ae6: de b7 in r29, 0x3e ; 62 31ae8: ce 5c subi r28, 0xCE ; 206 31aea: d1 09 sbc r29, r1 31aec: 0f b6 in r0, 0x3f ; 63 31aee: f8 94 cli 31af0: de bf out 0x3e, r29 ; 62 31af2: 0f be out 0x3f, r0 ; 63 31af4: cd bf out 0x3d, r28 ; 61 31af6: 18 2f mov r17, r24 { bool final_result = false; #ifdef TMC2130 FORCE_HIGH_POWER_START; 31af8: 81 e0 ldi r24, 0x01 ; 1 31afa: 0e 94 c8 66 call 0xcd90 ; 0xcd90 #endif // TMC2130 FORCE_BL_ON_START; 31afe: 81 e0 ldi r24, 0x01 ; 1 31b00: 0e 94 61 8a call 0x114c2 ; 0x114c2 // Only Z calibration? if (!onlyZ) 31b04: 11 11 cpse r17, r1 31b06: 04 c0 rjmp .+8 ; 0x31b10 { disable_heater(); 31b08: 0f 94 ee 2e call 0x25ddc ; 0x25ddc eeprom_adjust_bed_reset(); //reset bed level correction 31b0c: 0e 94 b0 76 call 0xed60 ; 0xed60 } // Disable the default update procedure of the display. We will do a modal dialog. lcd_update_enable(false); 31b10: 80 e0 ldi r24, 0x00 ; 0 31b12: 0e 94 3d 6f call 0xde7a ; 0xde7a // Let the planner use the uncorrected coordinates. mbl.reset(); 31b16: 0f 94 08 8c call 0x31810 ; 0x31810 // 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(); 31b1a: 0f 94 f1 cd call 0x39be2 ; 0x39be2 babystepLoadZ = 0; } void babystep_reset() { babystepLoadZ = 0; 31b1e: 10 92 8a 06 sts 0x068A, r1 ; 0x80068a <_ZL13babystepLoadZ.lto_priv.497+0x1> 31b22: 10 92 89 06 sts 0x0689, r1 ; 0x800689 <_ZL13babystepLoadZ.lto_priv.497> // 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)); 31b26: ee e8 ldi r30, 0x8E ; 142 31b28: f6 e0 ldi r31, 0x06 ; 6 31b2a: 83 e0 ldi r24, 0x03 ; 3 31b2c: df 01 movw r26, r30 31b2e: 1d 92 st X+, r1 31b30: 8a 95 dec r24 31b32: e9 f7 brne .-6 ; 0x31b2e // Home in the XY plane. //set_destination_to_current(); int l_feedmultiply = setup_for_endstop_move(); 31b34: 81 e0 ldi r24, 0x01 ; 1 31b36: 0e 94 00 67 call 0xce00 ; 0xce00 31b3a: c7 55 subi r28, 0x57 ; 87 31b3c: df 4f sbci r29, 0xFF ; 255 31b3e: 99 83 std Y+1, r25 ; 0x01 31b40: 88 83 st Y, r24 31b42: c9 5a subi r28, 0xA9 ; 169 31b44: d0 40 sbci r29, 0x00 ; 0 lcd_display_message_fullscreen_P(_T(MSG_AUTO_HOME)); 31b46: 85 e4 ldi r24, 0x45 ; 69 31b48: 9c e5 ldi r25, 0x5C ; 92 31b4a: 0e 94 c4 72 call 0xe588 ; 0xe588 31b4e: 0f 94 ba 1f call 0x23f74 ; 0x23f74 raise_z_above(MESH_HOME_Z_SEARCH); 31b52: 60 e0 ldi r22, 0x00 ; 0 31b54: 70 e0 ldi r23, 0x00 ; 0 31b56: 80 ea ldi r24, 0xA0 ; 160 31b58: 90 e4 ldi r25, 0x40 ; 64 31b5a: 0e 94 78 6e call 0xdcf0 ; 0xdcf0 } /**/ void home_xy() { set_destination_to_current(); 31b5e: 0e 94 52 68 call 0xd0a4 ; 0xd0a4 homeaxis(X_AXIS); 31b62: 50 e0 ldi r21, 0x00 ; 0 31b64: 40 e0 ldi r20, 0x00 ; 0 31b66: 61 e0 ldi r22, 0x01 ; 1 31b68: 80 e0 ldi r24, 0x00 ; 0 31b6a: 0e 94 83 7a call 0xf506 ; 0xf506 homeaxis(Y_AXIS); 31b6e: 50 e0 ldi r21, 0x00 ; 0 31b70: 40 e0 ldi r20, 0x00 ; 0 31b72: 61 e0 ldi r22, 0x01 ; 1 31b74: 81 e0 ldi r24, 0x01 ; 1 31b76: 0e 94 83 7a call 0xf506 ; 0xf506 plan_set_position_curposXYZE(); 31b7a: 0f 94 c4 be call 0x37d88 ; 0x37d88 endstops_hit_on_purpose(); 31b7e: 0f 94 b9 4d call 0x29b72 ; 0x29b72 31b82: 10 92 b7 02 sts 0x02B7, r1 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> 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; 31b86: 20 e0 ldi r18, 0x00 ; 0 31b88: 30 e0 ldi r19, 0x00 ; 0 31b8a: 40 ea ldi r20, 0xA0 ; 160 31b8c: 50 e4 ldi r21, 0x40 ; 64 31b8e: 60 91 91 06 lds r22, 0x0691 ; 0x800691 31b92: 70 91 92 06 lds r23, 0x0692 ; 0x800692 31b96: 80 91 93 06 lds r24, 0x0693 ; 0x800693 31b9a: 90 91 94 06 lds r25, 0x0694 ; 0x800694 31b9e: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 31ba2: 60 93 91 06 sts 0x0691, r22 ; 0x800691 31ba6: 70 93 92 06 sts 0x0692, r23 ; 0x800692 31baa: 80 93 93 06 sts 0x0693, r24 ; 0x800693 31bae: 90 93 94 06 sts 0x0694, r25 ; 0x800694 current_position[Y_AXIS] += 5; 31bb2: 20 e0 ldi r18, 0x00 ; 0 31bb4: 30 e0 ldi r19, 0x00 ; 0 31bb6: 40 ea ldi r20, 0xA0 ; 160 31bb8: 50 e4 ldi r21, 0x40 ; 64 31bba: 60 91 95 06 lds r22, 0x0695 ; 0x800695 31bbe: 70 91 96 06 lds r23, 0x0696 ; 0x800696 31bc2: 80 91 97 06 lds r24, 0x0697 ; 0x800697 31bc6: 90 91 98 06 lds r25, 0x0698 ; 0x800698 31bca: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 31bce: 60 93 95 06 sts 0x0695, r22 ; 0x800695 31bd2: 70 93 96 06 sts 0x0696, r23 ; 0x800696 31bd6: 80 93 97 06 sts 0x0697, r24 ; 0x800697 31bda: 90 93 98 06 sts 0x0698, r25 ; 0x800698 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40); 31bde: 60 e0 ldi r22, 0x00 ; 0 31be0: 70 e0 ldi r23, 0x00 ; 0 31be2: 80 ea ldi r24, 0xA0 ; 160 31be4: 91 e4 ldi r25, 0x41 ; 65 31be6: 0f 94 04 c0 call 0x38008 ; 0x38008 st_synchronize(); 31bea: 0f 94 a3 42 call 0x28546 ; 0x28546 // Let the user move the Z axes up to the end stoppers. #ifdef TMC2130 if (calibrate_z_auto()) 31bee: 0e 94 56 73 call 0xe6ac ; 0xe6ac 31bf2: e5 96 adiw r28, 0x35 ; 53 31bf4: 8f af std Y+63, r24 ; 0x3f 31bf6: e5 97 sbiw r28, 0x35 ; 53 31bf8: 81 11 cpse r24, r1 31bfa: 04 c0 rjmp .+8 ; 0x31c04 //! @param verbosity_level //! @retval true Succeeded //! @retval false Failed bool gcode_M45(bool onlyZ, int8_t verbosity_level) { bool final_result = false; 31bfc: e5 96 adiw r28, 0x35 ; 53 31bfe: 1f ae std Y+63, r1 ; 0x3f 31c00: e5 97 sbiw r28, 0x35 ; 53 31c02: 74 c4 rjmp .+2280 ; 0x324ec { #else //TMC2130 if (lcd_calibrate_z_end_stop_manual(onlyZ)) { #endif //TMC2130 lcd_show_fullscreen_message_and_wait_P(_T(MSG_CONFIRM_NOZZLE_CLEAN)); 31c04: 89 e0 ldi r24, 0x09 ; 9 31c06: 9c e5 ldi r25, 0x5C ; 92 31c08: 0e 94 c4 72 call 0xe588 ; 0xe588 31c0c: 0f 94 c7 1f call 0x23f8e ; 0x23f8e if(onlyZ){ 31c10: 11 23 and r17, r17 31c12: 09 f4 brne .+2 ; 0x31c16 31c14: 46 c4 rjmp .+2188 ; 0x324a2 prompt_steel_sheet_on_bed(true); 31c16: 81 e0 ldi r24, 0x01 ; 1 31c18: 0f 94 6f 0c call 0x218de ; 0x218de lcd_display_message_fullscreen_P(_T(MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1)); 31c1c: 87 ed ldi r24, 0xD7 ; 215 31c1e: 9b e5 ldi r25, 0x5B ; 91 31c20: 0e 94 c4 72 call 0xe588 ; 0xe588 31c24: 0f 94 ba 1f call 0x23f74 ; 0x23f74 lcd_puts_at_P(0,3,_n("1/9")); 31c28: 42 eb ldi r20, 0xB2 ; 178 31c2a: 50 e7 ldi r21, 0x70 ; 112 }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")); 31c2c: 63 e0 ldi r22, 0x03 ; 3 31c2e: 80 e0 ldi r24, 0x00 ; 0 31c30: 0e 94 0c 6f call 0xde18 ; 0xde18 } refresh_cmd_timeout(); 31c34: 0e 94 db 66 call 0xcdb6 ; 0xcdb6 if (((degHotend(0) > MAX_HOTEND_TEMP_CALIBRATION) || (degBed() > MAX_BED_TEMP_CALIBRATION)) && (!onlyZ)) { lcd_wait_for_cool_down(); } #endif //STEEL_SHEET if(!onlyZ) 31c38: 11 11 cpse r17, r1 31c3a: 1b c0 rjmp .+54 ; 0x31c72 { KEEPALIVE_STATE(PAUSED_FOR_USER); 31c3c: 84 e0 ldi r24, 0x04 ; 4 31c3e: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be prompt_steel_sheet_on_bed(false); 31c42: 80 e0 ldi r24, 0x00 ; 0 31c44: 0f 94 6f 0c call 0x218de ; 0x218de lcd_show_fullscreen_message_and_wait_P(_T(MSG_PAPER)); 31c48: 8d e1 ldi r24, 0x1D ; 29 31c4a: 9b e5 ldi r25, 0x5B ; 91 31c4c: 0e 94 c4 72 call 0xe588 ; 0xe588 31c50: 0f 94 c7 1f call 0x23f8e ; 0x23f8e KEEPALIVE_STATE(IN_HANDLER); 31c54: 82 e0 ldi r24, 0x02 ; 2 31c56: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be lcd_display_message_fullscreen_P(_T(MSG_FIND_BED_OFFSET_AND_SKEW_LINE1)); 31c5a: 85 eb ldi r24, 0xB5 ; 181 31c5c: 9b e5 ldi r25, 0x5B ; 91 31c5e: 0e 94 c4 72 call 0xe588 ; 0xe588 31c62: 0f 94 ba 1f call 0x23f74 ; 0x23f74 lcd_puts_at_P(0,3,_n("1/4")); 31c66: 4a ea ldi r20, 0xAA ; 170 31c68: 50 e7 ldi r21, 0x70 ; 112 31c6a: 63 e0 ldi r22, 0x03 ; 3 31c6c: 80 e0 ldi r24, 0x00 ; 0 31c6e: 0e 94 0c 6f call 0xde18 ; 0xde18 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 31c72: 00 91 b7 02 lds r16, 0x02B7 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> check_endstops = check; 31c76: 10 92 b7 02 sts 0x02B7, r1 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> } bool endstops_enabled = enable_endstops(false); raise_z(-1); 31c7a: 60 e0 ldi r22, 0x00 ; 0 31c7c: 70 e0 ldi r23, 0x00 ; 0 31c7e: 80 e8 ldi r24, 0x80 ; 128 31c80: 9f eb ldi r25, 0xBF ; 191 31c82: 0e 94 f9 6d call 0xdbf2 ; 0xdbf2 // Move the print head close to the bed. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 31c86: c1 2c mov r12, r1 31c88: d1 2c mov r13, r1 31c8a: b0 ea ldi r27, 0xA0 ; 160 31c8c: eb 2e mov r14, r27 31c8e: b0 e4 ldi r27, 0x40 ; 64 31c90: fb 2e mov r15, r27 31c92: c0 92 99 06 sts 0x0699, r12 ; 0x800699 31c96: d0 92 9a 06 sts 0x069A, r13 ; 0x80069a 31c9a: e0 92 9b 06 sts 0x069B, r14 ; 0x80069b 31c9e: f0 92 9c 06 sts 0x069C, r15 ; 0x80069c 31ca2: 81 e0 ldi r24, 0x01 ; 1 31ca4: 80 93 b7 02 sts 0x02B7, r24 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> enable_endstops(true); #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); 31ca8: 84 e0 ldi r24, 0x04 ; 4 31caa: 0f 94 ae 25 call 0x24b5c ; 0x24b5c #endif //TMC2130 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40); 31cae: 60 e0 ldi r22, 0x00 ; 0 31cb0: 70 e0 ldi r23, 0x00 ; 0 31cb2: 80 ea ldi r24, 0xA0 ; 160 31cb4: 91 e4 ldi r25, 0x41 ; 65 31cb6: 0f 94 04 c0 call 0x38008 ; 0x38008 st_synchronize(); 31cba: 0f 94 a3 42 call 0x28546 ; 0x28546 #ifdef TMC2130 tmc2130_home_exit(); 31cbe: 0f 94 7f 25 call 0x24afe ; 0x24afe 31cc2: 00 93 b7 02 sts 0x02B7, r16 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> #endif //TMC2130 enable_endstops(endstops_enabled); if ((st_get_position_mm(Z_AXIS) <= (MESH_HOME_Z_SEARCH + HOME_Z_SEARCH_THRESHOLD)) && 31cc6: 82 e0 ldi r24, 0x02 ; 2 31cc8: 0f 94 8f 42 call 0x2851e ; 0x2851e 31ccc: 2d ec ldi r18, 0xCD ; 205 31cce: 3c ec ldi r19, 0xCC ; 204 31cd0: 44 ea ldi r20, 0xA4 ; 164 31cd2: 50 e4 ldi r21, 0x40 ; 64 31cd4: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 31cd8: 18 16 cp r1, r24 31cda: 0c f4 brge .+2 ; 0x31cde 31cdc: eb c3 rjmp .+2006 ; 0x324b4 (st_get_position_mm(Z_AXIS) >= (MESH_HOME_Z_SEARCH - HOME_Z_SEARCH_THRESHOLD))) 31cde: 82 e0 ldi r24, 0x02 ; 2 31ce0: 0f 94 8f 42 call 0x2851e ; 0x2851e #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)) && 31ce4: 23 e3 ldi r18, 0x33 ; 51 31ce6: 33 e3 ldi r19, 0x33 ; 51 31ce8: 4b e9 ldi r20, 0x9B ; 155 31cea: 50 e4 ldi r21, 0x40 ; 64 31cec: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 31cf0: 87 fd sbrc r24, 7 31cf2: e0 c3 rjmp .+1984 ; 0x324b4 (st_get_position_mm(Z_AXIS) >= (MESH_HOME_Z_SEARCH - HOME_Z_SEARCH_THRESHOLD))) { if (onlyZ) 31cf4: 11 11 cpse r17, r1 31cf6: e3 c3 rjmp .+1990 ; 0x324be } } else { // Reset the baby step value and the baby step applied flag. calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 31cf8: 80 e1 ldi r24, 0x10 ; 16 31cfa: 0e 94 18 ee call 0x1dc30 ; 0x1dc30 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 31cfe: 81 ea ldi r24, 0xA1 ; 161 31d00: 9d e0 ldi r25, 0x0D ; 13 31d02: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 31d06: bb e0 ldi r27, 0x0B ; 11 31d08: 8b 9f mul r24, r27 31d0a: c0 01 movw r24, r0 31d0c: 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); 31d0e: 70 e0 ldi r23, 0x00 ; 0 31d10: 60 e0 ldi r22, 0x00 ; 0 31d12: 80 5b subi r24, 0xB0 ; 176 31d14: 92 4f sbci r25, 0xF2 ; 242 31d16: 0f 94 19 dc call 0x3b832 ; 0x3b832 } 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(); 31d1a: 0e 94 db 66 call 0xcdb6 ; 0xcdb6 // 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); 31d1e: e2 ec ldi r30, 0xC2 ; 194 31d20: f3 e1 ldi r31, 0x13 ; 19 31d22: 84 ec ldi r24, 0xC4 ; 196 31d24: df 01 movw r26, r30 31d26: 1d 92 st X+, r1 31d28: 8a 95 dec r24 31d2a: e9 f7 brne .-6 ; 0x31d26 { #else //NEW_XYZCAL while (iteration < 3) { #endif //NEW_XYZCAL SERIAL_ECHOPGM("Iteration: "); 31d2c: 8f e2 ldi r24, 0x2F ; 47 31d2e: 96 ea ldi r25, 0xA6 ; 166 31d30: 0e 94 68 77 call 0xeed0 ; 0xeed0 MYSERIAL.println(int(iteration + 1)); 31d34: 81 e0 ldi r24, 0x01 ; 1 31d36: 90 e0 ldi r25, 0x00 ; 0 31d38: 0f 94 b0 74 call 0x2e960 ; 0x2e960 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)); 31d3c: 85 eb ldi r24, 0xB5 ; 181 31d3e: 9b e5 ldi r25, 0x5B ; 91 31d40: 0e 94 c4 72 call 0xe588 ; 0xe588 31d44: 0f 94 ba 1f call 0x23f74 ; 0x23f74 #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; 31d48: c0 92 99 06 sts 0x0699, r12 ; 0x800699 31d4c: d0 92 9a 06 sts 0x069A, r13 ; 0x80069a 31d50: e0 92 9b 06 sts 0x069B, r14 ; 0x80069b 31d54: f0 92 9c 06 sts 0x069C, r15 ; 0x80069c 31d58: b2 e0 ldi r27, 0x02 ; 2 31d5a: e1 96 adiw r28, 0x31 ; 49 31d5c: bf af std Y+63, r27 ; 0x3f 31d5e: e1 97 sbiw r28, 0x31 ; 49 31d60: 2a e0 ldi r18, 0x0A ; 10 31d62: 36 ea ldi r19, 0xA6 ; 166 31d64: cd 56 subi r28, 0x6D ; 109 31d66: df 4f sbci r29, 0xFF ; 255 31d68: 39 83 std Y+1, r19 ; 0x01 31d6a: 28 83 st Y, r18 31d6c: c3 59 subi r28, 0x93 ; 147 31d6e: d0 40 sbci r29, 0x00 ; 0 31d70: 41 ec ldi r20, 0xC1 ; 193 31d72: 53 e1 ldi r21, 0x13 ; 19 31d74: cf 56 subi r28, 0x6F ; 111 31d76: df 4f sbci r29, 0xFF ; 255 31d78: 59 83 std Y+1, r21 ; 0x01 31d7a: 48 83 st Y, r20 31d7c: c1 59 subi r28, 0x91 ; 145 31d7e: d0 40 sbci r29, 0x00 ; 0 31d80: a0 96 adiw r28, 0x20 ; 32 31d82: 5f af std Y+63, r21 ; 0x3f 31d84: 4e af std Y+62, r20 ; 0x3e 31d86: a0 97 sbiw r28, 0x20 ; 32 31d88: e0 96 adiw r28, 0x30 ; 48 31d8a: 3f af std Y+63, r19 ; 0x3f 31d8c: 2e af std Y+62, r18 ; 0x3e 31d8e: 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; 31d90: a7 96 adiw r28, 0x27 ; 39 31d92: 1f ae std Y+63, r1 ; 0x3f 31d94: a7 97 sbiw r28, 0x27 ; 39 for (int k = 0; k < 4; ++k) { 31d96: 31 2c mov r3, r1 31d98: 21 2c mov r2, r1 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 31d9a: 0e 94 db 66 call 0xcdb6 ; 0xcdb6 #ifdef MESH_BED_CALIBRATION_SHOW_LCD lcd_set_cursor(0, 3); 31d9e: 63 e0 ldi r22, 0x03 ; 3 31da0: 80 e0 ldi r24, 0x00 ; 0 31da2: 0e 94 f8 6e call 0xddf0 ; 0xddf0 lcd_printf_P(PSTR("%d/4"),(k+1)); 31da6: bf ef ldi r27, 0xFF ; 255 31da8: 2b 1a sub r2, r27 31daa: 3b 0a sbc r3, r27 31dac: 3f 92 push r3 31dae: 2f 92 push r2 31db0: ea e2 ldi r30, 0x2A ; 42 31db2: f6 ea ldi r31, 0xA6 ; 166 31db4: ff 93 push r31 31db6: ef 93 push r30 31db8: 0e 94 d1 6e call 0xdda2 ; 0xdda2 } #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); 31dbc: 65 e5 ldi r22, 0x55 ; 85 31dbe: 75 e5 ldi r23, 0x55 ; 85 31dc0: 85 e5 ldi r24, 0x55 ; 85 31dc2: 91 e4 ldi r25, 0x41 ; 65 31dc4: 0f 94 8c c5 call 0x38b18 ; 0x38b18 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); 31dc8: e0 96 adiw r28, 0x30 ; 48 31dca: ee ad ldd r30, Y+62 ; 0x3e 31dcc: ff ad ldd r31, Y+63 ; 0x3f 31dce: e0 97 sbiw r28, 0x30 ; 48 31dd0: 85 91 lpm r24, Z+ 31dd2: 95 91 lpm r25, Z+ 31dd4: a5 91 lpm r26, Z+ 31dd6: b4 91 lpm r27, Z 31dd8: 80 93 91 06 sts 0x0691, r24 ; 0x800691 31ddc: 90 93 92 06 sts 0x0692, r25 ; 0x800692 31de0: a0 93 93 06 sts 0x0693, r26 ; 0x800693 31de4: b0 93 94 06 sts 0x0694, r27 ; 0x800694 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + k * 2 + 1); 31de8: e0 96 adiw r28, 0x30 ; 48 31dea: ee ad ldd r30, Y+62 ; 0x3e 31dec: ff ad ldd r31, Y+63 ; 0x3f 31dee: e0 97 sbiw r28, 0x30 ; 48 31df0: 34 96 adiw r30, 0x04 ; 4 31df2: 85 91 lpm r24, Z+ 31df4: 95 91 lpm r25, Z+ 31df6: a5 91 lpm r26, Z+ 31df8: b4 91 lpm r27, Z 31dfa: 80 93 95 06 sts 0x0695, r24 ; 0x800695 31dfe: 90 93 96 06 sts 0x0696, r25 ; 0x800696 31e02: a0 93 97 06 sts 0x0697, r26 ; 0x800697 31e06: b0 93 98 06 sts 0x0698, r27 ; 0x800698 MYSERIAL.print(current_position[Z_AXIS], 5); SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY go_to_current(homing_feedrate[X_AXIS] / 60.f); 31e0a: 60 e0 ldi r22, 0x00 ; 0 31e0c: 70 e0 ldi r23, 0x00 ; 0 31e0e: 88 e4 ldi r24, 0x48 ; 72 31e10: 92 e4 ldi r25, 0x42 ; 66 31e12: 0f 94 8c c5 call 0x38b18 ; 0x38b18 return pos * 0.01f; } void xyzcal_measure_enter(void) { DBG(_n("xyzcal_measure_enter\n")); 31e16: 4f e8 ldi r20, 0x8F ; 143 31e18: 54 ea ldi r21, 0xA4 ; 164 31e1a: 5f 93 push r21 31e1c: 4f 93 push r20 31e1e: 0f 94 99 da call 0x3b532 ; 0x3b532 lcd_puts_at_P(4,3,PSTR("Measure center ")); ////MSG_MEASURE_CENTER c=16 31e22: 4e e7 ldi r20, 0x7E ; 126 31e24: 54 ea ldi r21, 0xA4 ; 164 31e26: 63 e0 ldi r22, 0x03 ; 3 31e28: 84 e0 ldi r24, 0x04 ; 4 31e2a: 0e 94 0c 6f call 0xde18 ; 0xde18 // disable heaters and stop motion before we initialize sm4 disable_heater(); 31e2e: 0f 94 ee 2e call 0x25ddc ; 0x25ddc st_synchronize(); 31e32: 0f 94 a3 42 call 0x28546 ; 0x28546 // disable incompatible interrupts DISABLE_STEPPER_DRIVER_INTERRUPT(); 31e36: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 31e3a: 8d 7f andi r24, 0xFD ; 253 31e3c: 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" ); 31e40: 0f b6 in r0, 0x3f ; 63 31e42: f8 94 cli 31e44: a8 95 wdr 31e46: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 31e4a: 88 61 ori r24, 0x18 ; 24 31e4c: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 31e50: 10 92 60 00 sts 0x0060, r1 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 31e54: 0f be out 0x3f, r0 ; 63 #ifdef WATCHDOG wdt_disable(); #endif //WATCHDOG // setup internal callbacks sm4_stop_cb = 0; 31e56: 10 92 88 06 sts 0x0688, r1 ; 0x800688 31e5a: 10 92 87 06 sts 0x0687, r1 ; 0x800687 sm4_update_pos_cb = xyzcal_update_pos; 31e5e: 8d e3 ldi r24, 0x3D ; 61 31e60: 9d ec ldi r25, 0xCD ; 205 31e62: 90 93 86 06 sts 0x0686, r25 ; 0x800686 31e66: 80 93 85 06 sts 0x0685, r24 ; 0x800685 sm4_calc_delay_cb = xyzcal_calc_delay; 31e6a: a8 e3 ldi r26, 0x38 ; 56 31e6c: bd ec ldi r27, 0xCD ; 205 31e6e: b0 93 84 06 sts 0x0684, r27 ; 0x800684 31e72: a0 93 83 06 sts 0x0683, r26 ; 0x800683 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]); 31e76: 00 91 ba 06 lds r16, 0x06BA ; 0x8006ba 31e7a: 10 91 bb 06 lds r17, 0x06BB ; 0x8006bb 31e7e: 20 91 bc 06 lds r18, 0x06BC ; 0x8006bc 31e82: 30 91 bd 06 lds r19, 0x06BD ; 0x8006bd 31e86: 40 91 b6 06 lds r20, 0x06B6 ; 0x8006b6 31e8a: 50 91 b7 06 lds r21, 0x06B7 ; 0x8006b7 31e8e: 60 91 b8 06 lds r22, 0x06B8 ; 0x8006b8 31e92: 70 91 b9 06 lds r23, 0x06B9 ; 0x8006b9 31e96: 80 91 b2 06 lds r24, 0x06B2 ; 0x8006b2 31e9a: 90 91 b3 06 lds r25, 0x06B3 ; 0x8006b3 31e9e: a0 91 b4 06 lds r26, 0x06B4 ; 0x8006b4 31ea2: b0 91 b5 06 lds r27, 0x06B5 ; 0x8006b5 31ea6: 3f 93 push r19 31ea8: 2f 93 push r18 31eaa: 1f 93 push r17 31eac: 0f 93 push r16 31eae: 7f 93 push r23 31eb0: 6f 93 push r22 31eb2: 5f 93 push r21 31eb4: 4f 93 push r20 31eb6: bf 93 push r27 31eb8: af 93 push r26 31eba: 9f 93 push r25 31ebc: 8f 93 push r24 31ebe: ee e2 ldi r30, 0x2E ; 46 31ec0: f5 ea ldi r31, 0xA5 ; 165 31ec2: ff 93 push r31 31ec4: ef 93 push r30 31ec6: 0f 94 99 da call 0x3b532 ; 0x3b532 int16_t x0 = _X; 31eca: 40 90 b2 06 lds r4, 0x06B2 ; 0x8006b2 31ece: 50 90 b3 06 lds r5, 0x06B3 ; 0x8006b3 31ed2: 60 90 b4 06 lds r6, 0x06B4 ; 0x8006b4 31ed6: 70 90 b5 06 lds r7, 0x06B5 ; 0x8006b5 31eda: b4 2c mov r11, r4 31edc: a5 2c mov r10, r5 int16_t y0 = _Y; 31ede: 80 91 b6 06 lds r24, 0x06B6 ; 0x8006b6 31ee2: 90 91 b7 06 lds r25, 0x06B7 ; 0x8006b7 31ee6: a0 91 b8 06 lds r26, 0x06B8 ; 0x8006b8 31eea: b0 91 b9 06 lds r27, 0x06B9 ; 0x8006b9 31eee: a6 96 adiw r28, 0x26 ; 38 31ef0: 8c af std Y+60, r24 ; 0x3c 31ef2: 9d af std Y+61, r25 ; 0x3d 31ef4: ae af std Y+62, r26 ; 0x3e 31ef6: bf af std Y+63, r27 ; 0x3f 31ef8: a6 97 sbiw r28, 0x26 ; 38 31efa: a3 96 adiw r28, 0x23 ; 35 31efc: 9f ac ldd r9, Y+63 ; 0x3f 31efe: a3 97 sbiw r28, 0x23 ; 35 31f00: a4 96 adiw r28, 0x24 ; 36 31f02: 8f ac ldd r8, Y+63 ; 0x3f 31f04: a4 97 sbiw r28, 0x24 ; 36 int16_t z = _Z; 31f06: c0 90 ba 06 lds r12, 0x06BA ; 0x8006ba 31f0a: d0 90 bb 06 lds r13, 0x06BB ; 0x8006bb 31f0e: e0 90 bc 06 lds r14, 0x06BC ; 0x8006bc 31f12: f0 90 bd 06 lds r15, 0x06BD ; 0x8006bd 31f16: 0f b6 in r0, 0x3f ; 63 31f18: f8 94 cli 31f1a: de bf out 0x3e, r29 ; 62 31f1c: 0f be out 0x3f, r0 ; 63 31f1e: cd bf out 0x3d, r28 ; 61 // int16_t min_z = -6000; // int16_t dz = 100; while (z > -2300) { //-6mm + 0.25mm 31f20: b5 e0 ldi r27, 0x05 ; 5 31f22: cb 16 cp r12, r27 31f24: b7 ef ldi r27, 0xF7 ; 247 31f26: db 06 cpc r13, r27 31f28: 0c f4 brge .+2 ; 0x31f2c 31f2a: 40 c3 rjmp .+1664 ; 0x325ac } 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; 31f2c: 1a 82 std Y+2, r1 ; 0x02 31f2e: 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); 31f30: 1f 92 push r1 31f32: 1f 92 push r1 31f34: e3 e0 ldi r30, 0x03 ; 3 31f36: ef 93 push r30 31f38: f4 e8 ldi r31, 0x84 ; 132 31f3a: ff 93 push r31 31f3c: 1f 92 push r1 31f3e: 24 e6 ldi r18, 0x64 ; 100 31f40: 2f 93 push r18 31f42: df 92 push r13 31f44: cf 92 push r12 31f46: 8f 92 push r8 31f48: 9f 92 push r9 31f4a: af 92 push r10 31f4c: bf 92 push r11 31f4e: 45 ea ldi r20, 0xA5 ; 165 31f50: 54 ea ldi r21, 0xA4 ; 164 31f52: 5f 93 push r21 31f54: 4f 93 push r20 31f56: 0f 94 99 da call 0x3b532 ; 0x3b532 if (!ret && (ad < 720)) 31f5a: 0f b6 in r0, 0x3f ; 63 31f5c: f8 94 cli 31f5e: de bf out 0x3e, r29 ; 62 31f60: 0f be out 0x3f, r0 ; 63 31f62: cd bf out 0x3d, r28 ; 61 31f64: 89 81 ldd r24, Y+1 ; 0x01 31f66: 9a 81 ldd r25, Y+2 ; 0x02 31f68: 80 3d cpi r24, 0xD0 ; 208 31f6a: 92 40 sbci r25, 0x02 ; 2 31f6c: 08 f4 brcc .+2 ; 0x31f70 31f6e: e9 c2 rjmp .+1490 ; 0x32542 if ((ret = xyzcal_spiral2(cx, cy, z0 - 0*dz, dz, radius, 0, delay_us, check_pinda, &ad)) != 0) ad += 0; if (!ret && (ad < 1440)) 31f70: 89 81 ldd r24, Y+1 ; 0x01 31f72: 9a 81 ldd r25, Y+2 ; 0x02 31f74: 80 3a cpi r24, 0xA0 ; 160 31f76: 95 40 sbci r25, 0x05 ; 5 31f78: 10 f0 brcs .+4 ; 0x31f7e 31f7a: 0d 94 ab 9e jmp 0x33d56 ; 0x33d56 if ((ret = xyzcal_spiral2(cx, cy, z0 - 1*dz, dz, -radius, 0, delay_us, check_pinda, &ad)) != 0) 31f7e: 9e 01 movw r18, r28 31f80: 2f 5f subi r18, 0xFF ; 255 31f82: 3f 4f sbci r19, 0xFF ; 255 31f84: 79 01 movw r14, r18 31f86: 10 e0 ldi r17, 0x00 ; 0 31f88: 00 e0 ldi r16, 0x00 ; 0 31f8a: 2c e7 ldi r18, 0x7C ; 124 31f8c: 3c ef ldi r19, 0xFC ; 252 31f8e: a6 01 movw r20, r12 31f90: 44 56 subi r20, 0x64 ; 100 31f92: 51 09 sbc r21, r1 31f94: 69 2d mov r22, r9 31f96: 78 2d mov r23, r8 31f98: 8b 2d mov r24, r11 31f9a: 9a 2d mov r25, r10 31f9c: 0f 94 36 6e call 0x2dc6c ; 0x2dc6c 31fa0: 88 23 and r24, r24 31fa2: 11 f4 brne .+4 ; 0x31fa8 31fa4: 0d 94 ab 9e jmp 0x33d56 ; 0x33d56 ad += 720; 31fa8: 89 81 ldd r24, Y+1 ; 0x01 31faa: 9a 81 ldd r25, Y+2 ; 0x02 31fac: 80 53 subi r24, 0x30 ; 48 31fae: 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); 31fb0: c0 90 ba 06 lds r12, 0x06BA ; 0x8006ba 31fb4: d0 90 bb 06 lds r13, 0x06BB ; 0x8006bb 31fb8: e0 90 bc 06 lds r14, 0x06BC ; 0x8006bc 31fbc: f0 90 bd 06 lds r15, 0x06BD ; 0x8006bd 31fc0: 00 91 b6 06 lds r16, 0x06B6 ; 0x8006b6 31fc4: 10 91 b7 06 lds r17, 0x06B7 ; 0x8006b7 31fc8: 20 91 b8 06 lds r18, 0x06B8 ; 0x8006b8 31fcc: 30 91 b9 06 lds r19, 0x06B9 ; 0x8006b9 31fd0: 40 91 b2 06 lds r20, 0x06B2 ; 0x8006b2 31fd4: 50 91 b3 06 lds r21, 0x06B3 ; 0x8006b3 31fd8: 60 91 b4 06 lds r22, 0x06B4 ; 0x8006b4 31fdc: 70 91 b5 06 lds r23, 0x06B5 ; 0x8006b5 31fe0: 9f 93 push r25 31fe2: 8f 93 push r24 31fe4: df 92 push r13 31fe6: cf 92 push r12 31fe8: 1f 93 push r17 31fea: 0f 93 push r16 31fec: 5f 93 push r21 31fee: 4f 93 push r20 31ff0: 8a e0 ldi r24, 0x0A ; 10 31ff2: 95 ea ldi r25, 0xA5 ; 165 31ff4: 9f 93 push r25 31ff6: 8f 93 push r24 31ff8: 0f 94 99 da call 0x3b532 ; 0x3b532 /// 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); 31ffc: 40 91 ba 06 lds r20, 0x06BA ; 0x8006ba 32000: 50 91 bb 06 lds r21, 0x06BB ; 0x8006bb 32004: 60 91 bc 06 lds r22, 0x06BC ; 0x8006bc 32008: 70 91 bd 06 lds r23, 0x06BD ; 0x8006bd 3200c: 48 54 subi r20, 0x48 ; 72 3200e: 51 09 sbc r21, r1 32010: 00 e0 ldi r16, 0x00 ; 0 32012: 28 ec ldi r18, 0xC8 ; 200 32014: 30 e0 ldi r19, 0x00 ; 0 32016: a3 96 adiw r28, 0x23 ; 35 32018: 6f ad ldd r22, Y+63 ; 0x3f 3201a: a3 97 sbiw r28, 0x23 ; 35 3201c: a4 96 adiw r28, 0x24 ; 36 3201e: 7f ad ldd r23, Y+63 ; 0x3f 32020: a4 97 sbiw r28, 0x24 ; 36 32022: c2 01 movw r24, r4 32024: 0e 94 50 eb call 0x1d6a0 ; 0x1d6a0 /// 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; 32028: 20 91 b2 06 lds r18, 0x06B2 ; 0x8006b2 3202c: 30 91 b3 06 lds r19, 0x06B3 ; 0x8006b3 32030: 40 91 b4 06 lds r20, 0x06B4 ; 0x8006b4 32034: 50 91 b5 06 lds r21, 0x06B5 ; 0x8006b5 32038: 6e 96 adiw r28, 0x1e ; 30 3203a: 2c af std Y+60, r18 ; 0x3c 3203c: 3d af std Y+61, r19 ; 0x3d 3203e: 4e af std Y+62, r20 ; 0x3e 32040: 5f af std Y+63, r21 ; 0x3f 32042: 6e 97 sbiw r28, 0x1e ; 30 int16_t y = _Y; 32044: 80 91 b6 06 lds r24, 0x06B6 ; 0x8006b6 32048: 90 91 b7 06 lds r25, 0x06B7 ; 0x8006b7 3204c: a0 91 b8 06 lds r26, 0x06B8 ; 0x8006b8 32050: b0 91 b9 06 lds r27, 0x06B9 ; 0x8006b9 32054: ae 96 adiw r28, 0x2e ; 46 32056: 8c af std Y+60, r24 ; 0x3c 32058: 9d af std Y+61, r25 ; 0x3d 3205a: ae af std Y+62, r26 ; 0x3e 3205c: bf af std Y+63, r27 ; 0x3f 3205e: ae 97 sbiw r28, 0x2e ; 46 const int16_t z = _Z; 32060: 20 91 ba 06 lds r18, 0x06BA ; 0x8006ba 32064: 30 91 bb 06 lds r19, 0x06BB ; 0x8006bb 32068: 40 91 bc 06 lds r20, 0x06BC ; 0x8006bc 3206c: 50 91 bd 06 lds r21, 0x06BD ; 0x8006bd 32070: e9 96 adiw r28, 0x39 ; 57 32072: 2c af std Y+60, r18 ; 0x3c 32074: 3d af std Y+61, r19 ; 0x3d 32076: 4e af std Y+62, r20 ; 0x3e 32078: 5f af std Y+63, r21 ; 0x3f 3207a: e9 97 sbiw r28, 0x39 ; 57 3207c: a4 ec ldi r26, 0xC4 ; 196 3207e: ba e0 ldi r27, 0x0A ; 10 32080: 0f b6 in r0, 0x3f ; 63 32082: f8 94 cli 32084: de bf out 0x3e, r29 ; 62 32086: 0f be out 0x3f, r0 ; 63 32088: cd bf out 0x3d, r28 ; 61 3208a: 90 e0 ldi r25, 0x00 ; 0 3208c: 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)); 3208e: fc 01 movw r30, r24 32090: eb 55 subi r30, 0x5B ; 91 32092: fa 45 sbci r31, 0x5A ; 90 32094: 25 91 lpm r18, Z+ 32096: 34 91 lpm r19, Z 32098: 2d 93 st X+, r18 3209a: 3d 93 st X+, r19 pattern10[i] = pgm_read_word((uint16_t*)(xyzcal_point_pattern_10 + i)); 3209c: fc 01 movw r30, r24 3209e: e3 57 subi r30, 0x73 ; 115 320a0: fa 45 sbci r31, 0x5A ; 90 320a2: 25 91 lpm r18, Z+ 320a4: 34 91 lpm r19, Z 320a6: 57 96 adiw r26, 0x17 ; 23 320a8: 3c 93 st X, r19 320aa: 2e 93 st -X, r18 320ac: 56 97 sbiw r26, 0x16 ; 22 320ae: 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++){ 320b0: 88 31 cpi r24, 0x18 ; 24 320b2: 91 05 cpc r25, r1 320b4: 61 f7 brne .-40 ; 0x3208e 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); 320b6: e7 96 adiw r28, 0x37 ; 55 320b8: 4e ad ldd r20, Y+62 ; 0x3e 320ba: 5f ad ldd r21, Y+63 ; 0x3f 320bc: e7 97 sbiw r28, 0x37 ; 55 320be: ac 96 adiw r28, 0x2c ; 44 320c0: 6e ad ldd r22, Y+62 ; 0x3e 320c2: 7f ad ldd r23, Y+63 ; 0x3f 320c4: ac 97 sbiw r28, 0x2c ; 44 320c6: 6c 96 adiw r28, 0x1c ; 28 320c8: 8e ad ldd r24, Y+62 ; 0x3e 320ca: 9f ad ldd r25, Y+63 ; 0x3f 320cc: 6c 97 sbiw r28, 0x1c ; 28 320ce: 0f 94 72 6f call 0x2dee4 ; 0x2dee4 320d2: 24 ec ldi r18, 0xC4 ; 196 320d4: 36 e0 ldi r19, 0x06 ; 6 320d6: a4 96 adiw r28, 0x24 ; 36 320d8: 3f af std Y+63, r19 ; 0x3f 320da: 2e af std Y+62, r18 ; 0x3e 320dc: a4 97 sbiw r28, 0x24 ; 36 320de: 79 01 movw r14, r18 320e0: f0 e2 ldi r31, 0x20 ; 32 320e2: 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]); 320e4: a0 e5 ldi r26, 0x50 ; 80 320e6: ca 2e mov r12, r26 320e8: a5 ea ldi r26, 0xA5 ; 165 320ea: da 2e mov r13, r26 } DBG(endl); 320ec: 05 ea ldi r16, 0xA5 ; 165 320ee: 16 ea ldi r17, 0xA6 ; 166 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); 320f0: 57 01 movw r10, r14 320f2: e0 e2 ldi r30, 0x20 ; 32 320f4: 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]); 320f6: d5 01 movw r26, r10 320f8: 8d 91 ld r24, X+ 320fa: 5d 01 movw r10, r26 320fc: 1f 92 push r1 320fe: 8f 93 push r24 32100: df 92 push r13 32102: cf 92 push r12 32104: 0f 94 99 da call 0x3b532 ; 0x3b532 32108: 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){ 3210a: 0f 90 pop r0 3210c: 0f 90 pop r0 3210e: 0f 90 pop r0 32110: 0f 90 pop r0 32112: 81 10 cpse r8, r1 32114: f0 cf rjmp .-32 ; 0x320f6 DBG(_n("%02x"), matrix_32x32[idx_y + x]); } DBG(endl); 32116: 1f 93 push r17 32118: 0f 93 push r16 3211a: 0f 94 99 da call 0x3b532 ; 0x3b532 3211e: 9a 94 dec r9 32120: b0 e2 ldi r27, 0x20 ; 32 32122: eb 0e add r14, r27 32124: 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){ 32126: 0f 90 pop r0 32128: 0f 90 pop r0 3212a: 91 10 cpse r9, r1 3212c: e1 cf rjmp .-62 ; 0x320f0 for (uint8_t x = 0; x < 32; ++x){ DBG(_n("%02x"), matrix_32x32[idx_y + x]); } DBG(endl); } DBG(endl); 3212e: 1f 93 push r17 32130: 0f 93 push r16 32132: 0f 94 99 da call 0x3b532 ; 0x3b532 32136: 64 ec ldi r22, 0xC4 ; 196 32138: 7a e0 ldi r23, 0x0A ; 10 3213a: 0f 90 pop r0 3213c: 0f 90 pop r0 3213e: e4 ec ldi r30, 0xC4 ; 196 32140: 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; 32142: 90 e0 ldi r25, 0x00 ; 0 32144: 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; 32146: 50 e0 ldi r21, 0x00 ; 0 32148: 40 e0 ldi r20, 0x00 ; 0 int16_t maxs = 0; for (int16_t i = 0; i < 32*32;++i){ if (matrix32[i] == 0) { 3214a: 21 91 ld r18, Z+ 3214c: 21 11 cpse r18, r1 3214e: 6d c4 rjmp .+2266 ; 0x32a2a ++mins; 32150: 4f 5f subi r20, 0xFF ; 255 32152: 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){ 32154: 6e 17 cp r22, r30 32156: 7f 07 cpc r23, r31 32158: c1 f7 brne .-16 ; 0x3214a ++maxs; } } const int16_t rest = 1024 - mins - maxs; if (mins + maxs > threshold_total 3215a: 9a 01 movw r18, r20 3215c: 28 0f add r18, r24 3215e: 39 1f adc r19, r25 32160: 25 38 cpi r18, 0x85 ; 133 32162: 33 40 sbci r19, 0x03 ; 3 32164: a4 f0 brlt .+40 ; 0x3218e && mins > threshold_extreme 32166: 43 33 cpi r20, 0x33 ; 51 32168: 51 05 cpc r21, r1 3216a: 8c f0 brlt .+34 ; 0x3218e && maxs > threshold_extreme 3216c: 83 33 cpi r24, 0x33 ; 51 3216e: 91 05 cpc r25, r1 32170: 74 f0 brlt .+28 ; 0x3218e ++mins; } else if (matrix32[i] == 0xFF){ ++maxs; } } const int16_t rest = 1024 - mins - maxs; 32172: 20 e0 ldi r18, 0x00 ; 0 32174: 34 e0 ldi r19, 0x04 ; 4 32176: 24 1b sub r18, r20 32178: 35 0b sbc r19, r21 3217a: 28 1b sub r18, r24 3217c: 39 0b sbc r19, r25 if (mins + maxs > threshold_total && mins > threshold_extreme && maxs > threshold_extreme && mins > rest 3217e: 24 17 cp r18, r20 32180: 35 07 cpc r19, r21 32182: 2c f4 brge .+10 ; 0x3218e } 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; 32184: 1d ef ldi r17, 0xFD ; 253 if (mins + maxs > threshold_total && mins > threshold_extreme && maxs > threshold_extreme && mins > rest && maxs > rest) 32186: 28 17 cp r18, r24 32188: 39 07 cpc r19, r25 3218a: 0c f4 brge .+2 ; 0x3218e 3218c: 3f c2 rjmp .+1150 ; 0x3260c } /// 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; 3218e: 66 96 adiw r28, 0x16 ; 22 32190: 1f ae std Y+63, r1 ; 0x3f 32192: 66 97 sbiw r28, 0x16 ; 22 uint8_t r08 = 0; 32194: 62 96 adiw r28, 0x12 ; 18 32196: 1f ae std Y+63, r1 ; 0x3f 32198: 62 97 sbiw r28, 0x12 ; 18 uint8_t match08 = 0; uint8_t c10 = 0; 3219a: 22 96 adiw r28, 0x02 ; 2 3219c: 1f ae std Y+63, r1 ; 0x3f 3219e: 22 97 sbiw r28, 0x02 ; 2 uint8_t r10 = 0; 321a0: 19 82 std Y+1, r1 ; 0x01 321a2: ae 01 movw r20, r28 321a4: 4f 5a subi r20, 0xAF ; 175 321a6: 5f 4f sbci r21, 0xFF ; 255 321a8: be 01 movw r22, r28 321aa: 6b 5a subi r22, 0xAB ; 171 321ac: 7f 4f sbci r23, 0xFF ; 255 321ae: 84 ec ldi r24, 0xC4 ; 196 321b0: 9a e0 ldi r25, 0x0A ; 10 321b2: 0f 94 99 67 call 0x2cf32 ; 0x2cf32 321b6: 08 2f mov r16, r24 321b8: ae 01 movw r20, r28 321ba: 4f 5f subi r20, 0xFF ; 255 321bc: 5f 4f sbci r21, 0xFF ; 255 321be: be 01 movw r22, r28 321c0: 6f 5b subi r22, 0xBF ; 191 321c2: 7f 4f sbci r23, 0xFF ; 255 321c4: 8c ed ldi r24, 0xDC ; 220 321c6: 9a e0 ldi r25, 0x0A ; 10 321c8: 0f 94 99 67 call 0x2cf32 ; 0x2cf32 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; 321cc: 66 96 adiw r28, 0x16 ; 22 321ce: 6f ad ldd r22, Y+63 ; 0x3f 321d0: 66 97 sbiw r28, 0x16 ; 22 row = r08; 321d2: 62 96 adiw r28, 0x12 ; 18 321d4: 1f ad ldd r17, Y+63 ; 0x3f 321d6: 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){ 321d8: 80 17 cp r24, r16 321da: 28 f0 brcs .+10 ; 0x321e6 col = c08; row = r08; return match08; } col = c10; 321dc: 22 96 adiw r28, 0x02 ; 2 321de: 6f ad ldd r22, Y+63 ; 0x3f 321e0: 22 97 sbiw r28, 0x02 ; 2 row = r10; 321e2: 19 81 ldd r17, Y+1 ; 0x01 321e4: 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){ 321e6: 08 35 cpi r16, 0x58 ; 88 321e8: 08 f4 brcc .+2 ; 0x321ec 321ea: 24 c4 rjmp .+2120 ; 0x32a34 /// find precise circle /// move to the center of the pattern (+5.5) float xf = uc + 5.5f; 321ec: 70 e0 ldi r23, 0x00 ; 0 321ee: 90 e0 ldi r25, 0x00 ; 0 321f0: 80 e0 ldi r24, 0x00 ; 0 321f2: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 321f6: 20 e0 ldi r18, 0x00 ; 0 321f8: 30 e0 ldi r19, 0x00 ; 0 321fa: 40 eb ldi r20, 0xB0 ; 176 321fc: 50 e4 ldi r21, 0x40 ; 64 321fe: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 32202: 2b 01 movw r4, r22 32204: 3c 01 movw r6, r24 32206: 65 96 adiw r28, 0x15 ; 21 32208: 4c ae std Y+60, r4 ; 0x3c 3220a: 5d ae std Y+61, r5 ; 0x3d 3220c: 6e ae std Y+62, r6 ; 0x3e 3220e: 7f ae std Y+63, r7 ; 0x3f 32210: 65 97 sbiw r28, 0x15 ; 21 float yf = ur + 5.5f; 32212: 61 2f mov r22, r17 32214: 70 e0 ldi r23, 0x00 ; 0 32216: 90 e0 ldi r25, 0x00 ; 0 32218: 80 e0 ldi r24, 0x00 ; 0 3221a: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 3221e: 20 e0 ldi r18, 0x00 ; 0 32220: 30 e0 ldi r19, 0x00 ; 0 32222: 40 eb ldi r20, 0xB0 ; 176 32224: 50 e4 ldi r21, 0x40 ; 64 32226: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 3222a: 4b 01 movw r8, r22 3222c: 5c 01 movw r10, r24 3222e: 25 96 adiw r28, 0x05 ; 5 32230: 8c ae std Y+60, r8 ; 0x3c 32232: 9d ae std Y+61, r9 ; 0x3d 32234: ae ae std Y+62, r10 ; 0x3e 32236: bf ae std Y+63, r11 ; 0x3f 32238: 25 97 sbiw r28, 0x05 ; 5 float radius = 4.5f; ///< default radius 3223a: 20 e0 ldi r18, 0x00 ; 0 3223c: 30 e0 ldi r19, 0x00 ; 0 3223e: 40 e9 ldi r20, 0x90 ; 144 32240: 50 e4 ldi r21, 0x40 ; 64 32242: 29 83 std Y+1, r18 ; 0x01 32244: 3a 83 std Y+2, r19 ; 0x02 32246: 4b 83 std Y+3, r20 ; 0x03 32248: 5c 83 std Y+4, r21 ; 0x04 constexpr const uint8_t iterations = 20; dynamic_circle(matrix32, xf, yf, radius, iterations); 3224a: ae 01 movw r20, r28 3224c: 4f 5f subi r20, 0xFF ; 255 3224e: 5f 4f sbci r21, 0xFF ; 255 32250: be 01 movw r22, r28 32252: 6f 5b subi r22, 0xBF ; 191 32254: 7f 4f sbci r23, 0xFF ; 255 32256: ce 01 movw r24, r28 32258: 8f 5a subi r24, 0xAF ; 175 3225a: 9f 4f sbci r25, 0xFF ; 255 3225c: 0f 94 b6 6a call 0x2d56c ; 0x2d56c if (fabs(xf - (uc + 5.5f)) > 3 || fabs(yf - (ur + 5.5f)) > 3 || fabs(radius - 5) > 3){ 32260: a3 01 movw r20, r6 32262: 92 01 movw r18, r4 32264: 65 96 adiw r28, 0x15 ; 21 32266: 6c ad ldd r22, Y+60 ; 0x3c 32268: 7d ad ldd r23, Y+61 ; 0x3d 3226a: 8e ad ldd r24, Y+62 ; 0x3e 3226c: 9f ad ldd r25, Y+63 ; 0x3f 3226e: 65 97 sbiw r28, 0x15 ; 21 32270: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 32274: 6b 01 movw r12, r22 32276: 7c 01 movw r14, r24 32278: 9f 77 andi r25, 0x7F ; 127 3227a: 20 e0 ldi r18, 0x00 ; 0 3227c: 30 e0 ldi r19, 0x00 ; 0 3227e: 40 e4 ldi r20, 0x40 ; 64 32280: 50 e4 ldi r21, 0x40 ; 64 32282: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 32286: 18 16 cp r1, r24 32288: 34 f1 brlt .+76 ; 0x322d6 3228a: a5 01 movw r20, r10 3228c: 94 01 movw r18, r8 3228e: 25 96 adiw r28, 0x05 ; 5 32290: 6c ad ldd r22, Y+60 ; 0x3c 32292: 7d ad ldd r23, Y+61 ; 0x3d 32294: 8e ad ldd r24, Y+62 ; 0x3e 32296: 9f ad ldd r25, Y+63 ; 0x3f 32298: 25 97 sbiw r28, 0x05 ; 5 3229a: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 3229e: 9f 77 andi r25, 0x7F ; 127 322a0: 20 e0 ldi r18, 0x00 ; 0 322a2: 30 e0 ldi r19, 0x00 ; 0 322a4: 40 e4 ldi r20, 0x40 ; 64 322a6: 50 e4 ldi r21, 0x40 ; 64 322a8: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 322ac: 18 16 cp r1, r24 322ae: 9c f0 brlt .+38 ; 0x322d6 322b0: 20 e0 ldi r18, 0x00 ; 0 322b2: 30 e0 ldi r19, 0x00 ; 0 322b4: 40 ea ldi r20, 0xA0 ; 160 322b6: 50 e4 ldi r21, 0x40 ; 64 322b8: 69 81 ldd r22, Y+1 ; 0x01 322ba: 7a 81 ldd r23, Y+2 ; 0x02 322bc: 8b 81 ldd r24, Y+3 ; 0x03 322be: 9c 81 ldd r25, Y+4 ; 0x04 322c0: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 322c4: 9f 77 andi r25, 0x7F ; 127 322c6: 20 e0 ldi r18, 0x00 ; 0 322c8: 30 e0 ldi r19, 0x00 ; 0 322ca: 40 e4 ldi r20, 0x40 ; 64 322cc: 50 e4 ldi r21, 0x40 ; 64 322ce: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 322d2: 18 16 cp r1, r24 322d4: bc f5 brge .+110 ; 0x32344 //@size=88 DBG(_n(" [%f %f][%f] mm divergence\n"), xf - (uc + 5.5f), yf - (ur + 5.5f), radius - 5); 322d6: 20 e0 ldi r18, 0x00 ; 0 322d8: 30 e0 ldi r19, 0x00 ; 0 322da: 40 ea ldi r20, 0xA0 ; 160 322dc: 50 e4 ldi r21, 0x40 ; 64 322de: 69 81 ldd r22, Y+1 ; 0x01 322e0: 7a 81 ldd r23, Y+2 ; 0x02 322e2: 8b 81 ldd r24, Y+3 ; 0x03 322e4: 9c 81 ldd r25, Y+4 ; 0x04 322e6: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 322ea: 9f 93 push r25 322ec: 8f 93 push r24 322ee: 7f 93 push r23 322f0: 6f 93 push r22 322f2: a5 01 movw r20, r10 322f4: 94 01 movw r18, r8 322f6: 25 96 adiw r28, 0x05 ; 5 322f8: 6c ad ldd r22, Y+60 ; 0x3c 322fa: 7d ad ldd r23, Y+61 ; 0x3d 322fc: 8e ad ldd r24, Y+62 ; 0x3e 322fe: 9f ad ldd r25, Y+63 ; 0x3f 32300: 25 97 sbiw r28, 0x05 ; 5 32302: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 32306: 9f 93 push r25 32308: 8f 93 push r24 3230a: 7f 93 push r23 3230c: 6f 93 push r22 3230e: ff 92 push r15 32310: ef 92 push r14 32312: df 92 push r13 32314: cf 92 push r12 32316: 81 e7 ldi r24, 0x71 ; 113 32318: 95 ea ldi r25, 0xA5 ; 165 3231a: 9f 93 push r25 3231c: 8f 93 push r24 3231e: 0f 94 99 da call 0x3b532 ; 0x3b532 /// dynamic algorithm diverged, use original position instead xf = uc + 5.5f; 32322: 65 96 adiw r28, 0x15 ; 21 32324: 4c ae std Y+60, r4 ; 0x3c 32326: 5d ae std Y+61, r5 ; 0x3d 32328: 6e ae std Y+62, r6 ; 0x3e 3232a: 7f ae std Y+63, r7 ; 0x3f 3232c: 65 97 sbiw r28, 0x15 ; 21 yf = ur + 5.5f; 3232e: 25 96 adiw r28, 0x05 ; 5 32330: 8c ae std Y+60, r8 ; 0x3c 32332: 9d ae std Y+61, r9 ; 0x3d 32334: ae ae std Y+62, r10 ; 0x3e 32336: bf ae std Y+63, r11 ; 0x3f 32338: 25 97 sbiw r28, 0x05 ; 5 3233a: 0f b6 in r0, 0x3f ; 63 3233c: f8 94 cli 3233e: de bf out 0x3e, r29 ; 62 32340: 0f be out 0x3f, r0 ; 63 32342: cd bf out 0x3d, r28 ; 61 } /// move to the center of area and convert to position xf = (float)x + (xf - 15.5f) * 64; 32344: 20 e0 ldi r18, 0x00 ; 0 32346: 30 e0 ldi r19, 0x00 ; 0 32348: 48 e7 ldi r20, 0x78 ; 120 3234a: 51 e4 ldi r21, 0x41 ; 65 3234c: 65 96 adiw r28, 0x15 ; 21 3234e: 6c ad ldd r22, Y+60 ; 0x3c 32350: 7d ad ldd r23, Y+61 ; 0x3d 32352: 8e ad ldd r24, Y+62 ; 0x3e 32354: 9f ad ldd r25, Y+63 ; 0x3f 32356: 65 97 sbiw r28, 0x15 ; 21 32358: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 3235c: 20 e0 ldi r18, 0x00 ; 0 3235e: 30 e0 ldi r19, 0x00 ; 0 32360: 40 e8 ldi r20, 0x80 ; 128 32362: 52 e4 ldi r21, 0x42 ; 66 32364: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 32368: 6b 01 movw r12, r22 3236a: 7c 01 movw r14, r24 3236c: 6c 96 adiw r28, 0x1c ; 28 3236e: ae ad ldd r26, Y+62 ; 0x3e 32370: bf ad ldd r27, Y+63 ; 0x3f 32372: 6c 97 sbiw r28, 0x1c ; 28 32374: bd 01 movw r22, r26 32376: bb 0f add r27, r27 32378: 88 0b sbc r24, r24 3237a: 99 0b sbc r25, r25 3237c: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 32380: 9b 01 movw r18, r22 32382: ac 01 movw r20, r24 32384: c7 01 movw r24, r14 32386: b6 01 movw r22, r12 32388: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 3238c: 6b 01 movw r12, r22 3238e: 7c 01 movw r14, r24 32390: 65 96 adiw r28, 0x15 ; 21 32392: cc ae std Y+60, r12 ; 0x3c 32394: dd ae std Y+61, r13 ; 0x3d 32396: ee ae std Y+62, r14 ; 0x3e 32398: ff ae std Y+63, r15 ; 0x3f 3239a: 65 97 sbiw r28, 0x15 ; 21 yf = (float)y + (yf - 15.5f) * 64; 3239c: 20 e0 ldi r18, 0x00 ; 0 3239e: 30 e0 ldi r19, 0x00 ; 0 323a0: 48 e7 ldi r20, 0x78 ; 120 323a2: 51 e4 ldi r21, 0x41 ; 65 323a4: 25 96 adiw r28, 0x05 ; 5 323a6: 6c ad ldd r22, Y+60 ; 0x3c 323a8: 7d ad ldd r23, Y+61 ; 0x3d 323aa: 8e ad ldd r24, Y+62 ; 0x3e 323ac: 9f ad ldd r25, Y+63 ; 0x3f 323ae: 25 97 sbiw r28, 0x05 ; 5 323b0: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 323b4: 20 e0 ldi r18, 0x00 ; 0 323b6: 30 e0 ldi r19, 0x00 ; 0 323b8: 40 e8 ldi r20, 0x80 ; 128 323ba: 52 e4 ldi r21, 0x42 ; 66 323bc: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 323c0: 4b 01 movw r8, r22 323c2: 5c 01 movw r10, r24 323c4: ac 96 adiw r28, 0x2c ; 44 323c6: ee ad ldd r30, Y+62 ; 0x3e 323c8: ff ad ldd r31, Y+63 ; 0x3f 323ca: ac 97 sbiw r28, 0x2c ; 44 323cc: bf 01 movw r22, r30 323ce: ff 0f add r31, r31 323d0: 88 0b sbc r24, r24 323d2: 99 0b sbc r25, r25 323d4: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 323d8: 9b 01 movw r18, r22 323da: ac 01 movw r20, r24 323dc: c5 01 movw r24, r10 323de: b4 01 movw r22, r8 323e0: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 323e4: 25 96 adiw r28, 0x05 ; 5 323e6: 6c af std Y+60, r22 ; 0x3c 323e8: 7d af std Y+61, r23 ; 0x3d 323ea: 8e af std Y+62, r24 ; 0x3e 323ec: 9f af std Y+63, r25 ; 0x3f 323ee: 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; 323f0: 2a e0 ldi r18, 0x0A ; 10 323f2: 37 ed ldi r19, 0xD7 ; 215 323f4: 43 e2 ldi r20, 0x23 ; 35 323f6: 5c e3 ldi r21, 0x3C ; 60 323f8: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__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)); 323fc: 9f 93 push r25 323fe: 8f 93 push r24 32400: 7f 93 push r23 32402: 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; 32404: 2a e0 ldi r18, 0x0A ; 10 32406: 37 ed ldi r19, 0xD7 ; 215 32408: 43 e2 ldi r20, 0x23 ; 35 3240a: 5c e3 ldi r21, 0x3C ; 60 3240c: c7 01 movw r24, r14 3240e: b6 01 movw r22, r12 32410: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__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)); 32414: 9f 93 push r25 32416: 8f 93 push r24 32418: 7f 93 push r23 3241a: 6f 93 push r22 3241c: 85 e5 ldi r24, 0x55 ; 85 3241e: 95 ea ldi r25, 0xA5 ; 165 32420: 9f 93 push r25 32422: 8f 93 push r24 32424: 0f 94 99 da call 0x3b532 ; 0x3b532 uint16_t round_to_u16(float f){ return (uint16_t)(f + .5f); } int16_t round_to_i16(float f){ return (int16_t)(f + .5f); 32428: 20 e0 ldi r18, 0x00 ; 0 3242a: 30 e0 ldi r19, 0x00 ; 0 3242c: 40 e0 ldi r20, 0x00 ; 0 3242e: 5f e3 ldi r21, 0x3F ; 63 32430: 25 96 adiw r28, 0x05 ; 5 32432: 6c ad ldd r22, Y+60 ; 0x3c 32434: 7d ad ldd r23, Y+61 ; 0x3d 32436: 8e ad ldd r24, Y+62 ; 0x3e 32438: 9f ad ldd r25, Y+63 ; 0x3f 3243a: 25 97 sbiw r28, 0x05 ; 5 3243c: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 32440: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> 32444: 6b 01 movw r12, r22 32446: 20 e0 ldi r18, 0x00 ; 0 32448: 30 e0 ldi r19, 0x00 ; 0 3244a: 40 e0 ldi r20, 0x00 ; 0 3244c: 5f e3 ldi r21, 0x3F ; 63 3244e: 65 96 adiw r28, 0x15 ; 21 32450: 6c ad ldd r22, Y+60 ; 0x3c 32452: 7d ad ldd r23, Y+61 ; 0x3d 32454: 8e ad ldd r24, Y+62 ; 0x3e 32456: 9f ad ldd r25, Y+63 ; 0x3f 32458: 65 97 sbiw r28, 0x15 ; 21 3245a: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 3245e: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> 32462: 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); 32464: 00 e0 ldi r16, 0x00 ; 0 32466: 28 ec ldi r18, 0xC8 ; 200 32468: 30 e0 ldi r19, 0x00 ; 0 3246a: e7 96 adiw r28, 0x37 ; 55 3246c: 4e ad ldd r20, Y+62 ; 0x3e 3246e: 5f ad ldd r21, Y+63 ; 0x3f 32470: e7 97 sbiw r28, 0x37 ; 55 32472: b6 01 movw r22, r12 32474: 0e 94 50 eb call 0x1d6a0 ; 0x1d6a0 32478: 0f b6 in r0, 0x3f ; 63 3247a: f8 94 cli 3247c: de bf out 0x3e, r29 ; 62 3247e: 0f be out 0x3f, r0 ; 63 32480: cd bf out 0x3d, r28 ; 61 ret = BED_SKEW_OFFSET_DETECTION_POINT_FOUND; 32482: 10 e0 ldi r17, 0x00 ; 0 32484: 84 ea ldi r24, 0xA4 ; 164 32486: 9d e0 ldi r25, 0x0D ; 13 } /// wipe buffer for (uint16_t i = 0; i < sizeof(block_t)*BLOCK_BUFFER_SIZE; i++) matrix32[i] = 0; 32488: a4 96 adiw r28, 0x24 ; 36 3248a: ae ad ldd r26, Y+62 ; 0x3e 3248c: bf ad ldd r27, Y+63 ; 0x3f 3248e: a4 97 sbiw r28, 0x24 ; 36 32490: 1d 92 st X+, r1 32492: a4 96 adiw r28, 0x24 ; 36 32494: bf af std Y+63, r27 ; 0x3f 32496: ae af std Y+62, r26 ; 0x3e 32498: 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++) 3249a: 8a 17 cp r24, r26 3249c: 9b 07 cpc r25, r27 3249e: a1 f7 brne .-24 ; 0x32488 324a0: b5 c0 rjmp .+362 ; 0x3260c 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)); 324a2: 85 eb ldi r24, 0xB5 ; 181 324a4: 9b e5 ldi r25, 0x5B ; 91 324a6: 0e 94 c4 72 call 0xe588 ; 0xe588 324aa: 0f 94 ba 1f call 0x23f74 ; 0x23f74 lcd_puts_at_P(0,3,_n("1/4")); 324ae: 4e ea ldi r20, 0xAE ; 174 324b0: 50 e7 ldi r21, 0x70 ; 112 324b2: bc cb rjmp .-2184 ; 0x31c2c } } } else { lcd_show_fullscreen_message_and_wait_P(PSTR("Calibration failed! Check the axes and run again.")); 324b4: 8b e3 ldi r24, 0x3B ; 59 324b6: 96 ea ldi r25, 0xA6 ; 166 // 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); 324b8: 0f 94 c7 1f call 0x23f8e ; 0x23f8e 324bc: 9f cb rjmp .-2242 ; 0x31bfc 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); 324be: c7 55 subi r28, 0x57 ; 87 324c0: df 4f sbci r29, 0xFF ; 255 324c2: 88 81 ld r24, Y 324c4: 99 81 ldd r25, Y+1 ; 0x01 324c6: c9 5a subi r28, 0xA9 ; 169 324c8: d0 40 sbci r29, 0x00 ; 0 324ca: 0e 94 e6 66 call 0xcdcc ; 0xcdcc // Z only calibration. // Load the machine correction matrix world2machine_initialize(); 324ce: 0f 94 56 ce call 0x39cac ; 0x39cac // and correct the current_position to match the transformed coordinate system. world2machine_update_current(); 324d2: 0f 94 f4 cb call 0x397e8 ; 0x397e8 //FIXME bool result = sample_mesh_and_store_reference(); 324d6: 0f 94 03 ca call 0x39406 ; 0x39406 324da: e5 96 adiw r28, 0x35 ; 53 324dc: 8f af std Y+63, r24 ; 0x3f 324de: e5 97 sbiw r28, 0x35 ; 53 if (result) 324e0: 88 23 and r24, r24 324e2: 09 f4 brne .+2 ; 0x324e6 324e4: 8b cb rjmp .-2282 ; 0x31bfc { calibration_status_set(CALIBRATION_STATUS_Z); 324e6: 84 e0 ldi r24, 0x04 ; 4 324e8: 0e 94 6d ee call 0x1dcda ; 0x1dcda } else { // Timeouted. } lcd_update_enable(true); 324ec: 81 e0 ldi r24, 0x01 ; 1 324ee: 0e 94 3d 6f call 0xde7a ; 0xde7a #ifdef TMC2130 FORCE_HIGH_POWER_END; 324f2: 80 e0 ldi r24, 0x00 ; 0 324f4: 0e 94 c8 66 call 0xcd90 ; 0xcd90 #endif // TMC2130 FORCE_BL_ON_END; 324f8: 80 e0 ldi r24, 0x00 ; 0 324fa: 0e 94 61 8a call 0x114c2 ; 0x114c2 return final_result; } 324fe: e5 96 adiw r28, 0x35 ; 53 32500: 8f ad ldd r24, Y+63 ; 0x3f 32502: e5 97 sbiw r28, 0x35 ; 53 32504: c2 53 subi r28, 0x32 ; 50 32506: df 4f sbci r29, 0xFF ; 255 32508: 0f b6 in r0, 0x3f ; 63 3250a: f8 94 cli 3250c: de bf out 0x3e, r29 ; 62 3250e: 0f be out 0x3f, r0 ; 63 32510: cd bf out 0x3d, r28 ; 61 32512: df 91 pop r29 32514: cf 91 pop r28 32516: 1f 91 pop r17 32518: 0f 91 pop r16 3251a: ff 90 pop r15 3251c: ef 90 pop r14 3251e: df 90 pop r13 32520: cf 90 pop r12 32522: bf 90 pop r11 32524: af 90 pop r10 32526: 9f 90 pop r9 32528: 8f 90 pop r8 3252a: 7f 90 pop r7 3252c: 6f 90 pop r6 3252e: 5f 90 pop r5 32530: 4f 90 pop r4 32532: 3f 90 pop r3 32534: 2f 90 pop r2 32536: 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) { 32538: e1 e0 ldi r30, 0x01 ; 1 3253a: e1 96 adiw r28, 0x31 ; 49 3253c: ef af std Y+63, r30 ; 0x3f 3253e: e1 97 sbiw r28, 0x31 ; 49 32540: 0f cc rjmp .-2018 ; 0x31d60 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) 32542: fe 01 movw r30, r28 32544: 31 96 adiw r30, 0x01 ; 1 32546: 7f 01 movw r14, r30 32548: 10 e0 ldi r17, 0x00 ; 0 3254a: 00 e0 ldi r16, 0x00 ; 0 3254c: 24 e8 ldi r18, 0x84 ; 132 3254e: 33 e0 ldi r19, 0x03 ; 3 32550: a6 01 movw r20, r12 32552: 69 2d mov r22, r9 32554: 78 2d mov r23, r8 32556: 8b 2d mov r24, r11 32558: 9a 2d mov r25, r10 3255a: 0f 94 36 6e call 0x2dc6c ; 0x2dc6c ad += 0; if (!ret && (ad < 1440)) 3255e: 88 23 and r24, r24 32560: 09 f4 brne .+2 ; 0x32564 32562: 06 cd rjmp .-1524 ; 0x31f70 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; 32564: 89 81 ldd r24, Y+1 ; 0x01 32566: 9a 81 ldd r25, Y+2 ; 0x02 32568: 23 cd rjmp .-1466 ; 0x31fb0 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)) 3256a: 89 81 ldd r24, Y+1 ; 0x01 3256c: 9a 81 ldd r25, Y+2 ; 0x02 3256e: 80 34 cpi r24, 0x40 ; 64 32570: 9b 40 sbci r25, 0x0B ; 11 32572: b8 f4 brcc .+46 ; 0x325a2 if ((ret = xyzcal_spiral2(cx, cy, z0 - 3*dz, dz, -radius, 180, delay_us, check_pinda, &ad)) != 0) 32574: ce 01 movw r24, r28 32576: 01 96 adiw r24, 0x01 ; 1 32578: 7c 01 movw r14, r24 3257a: 04 eb ldi r16, 0xB4 ; 180 3257c: 10 e0 ldi r17, 0x00 ; 0 3257e: 2c e7 ldi r18, 0x7C ; 124 32580: 3c ef ldi r19, 0xFC ; 252 32582: a6 01 movw r20, r12 32584: 4c 52 subi r20, 0x2C ; 44 32586: 51 40 sbci r21, 0x01 ; 1 32588: 69 2d mov r22, r9 3258a: 78 2d mov r23, r8 3258c: 8b 2d mov r24, r11 3258e: 9a 2d mov r25, r10 32590: 0f 94 36 6e call 0x2dc6c ; 0x2dc6c 32594: 88 23 and r24, r24 32596: 29 f0 breq .+10 ; 0x325a2 ad += 2160; 32598: 89 81 ldd r24, Y+1 ; 0x01 3259a: 9a 81 ldd r25, Y+2 ; 0x02 3259c: 80 59 subi r24, 0x90 ; 144 3259e: 97 4f sbci r25, 0xF7 ; 247 325a0: 07 cd rjmp .-1522 ; 0x31fb0 /// 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; 325a2: 90 e9 ldi r25, 0x90 ; 144 325a4: c9 1a sub r12, r25 325a6: 91 e0 ldi r25, 0x01 ; 1 325a8: d9 0a sbc r13, r25 325aa: ba cc rjmp .-1676 ; 0x31f20 } //@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]); 325ac: 00 91 ba 06 lds r16, 0x06BA ; 0x8006ba 325b0: 10 91 bb 06 lds r17, 0x06BB ; 0x8006bb 325b4: 20 91 bc 06 lds r18, 0x06BC ; 0x8006bc 325b8: 30 91 bd 06 lds r19, 0x06BD ; 0x8006bd 325bc: 40 91 b6 06 lds r20, 0x06B6 ; 0x8006b6 325c0: 50 91 b7 06 lds r21, 0x06B7 ; 0x8006b7 325c4: 60 91 b8 06 lds r22, 0x06B8 ; 0x8006b8 325c8: 70 91 b9 06 lds r23, 0x06B9 ; 0x8006b9 325cc: 80 91 b2 06 lds r24, 0x06B2 ; 0x8006b2 325d0: 90 91 b3 06 lds r25, 0x06B3 ; 0x8006b3 325d4: a0 91 b4 06 lds r26, 0x06B4 ; 0x8006b4 325d8: b0 91 b5 06 lds r27, 0x06B5 ; 0x8006b5 325dc: 3f 93 push r19 325de: 2f 93 push r18 325e0: 1f 93 push r17 325e2: 0f 93 push r16 325e4: 7f 93 push r23 325e6: 6f 93 push r22 325e8: 5f 93 push r21 325ea: 4f 93 push r20 325ec: bf 93 push r27 325ee: af 93 push r26 325f0: 9f 93 push r25 325f2: 8f 93 push r24 325f4: 8d ed ldi r24, 0xDD ; 221 325f6: 94 ea ldi r25, 0xA4 ; 164 325f8: 9f 93 push r25 325fa: 8f 93 push r24 325fc: 0f 94 99 da call 0x3b532 ; 0x3b532 32600: 0f b6 in r0, 0x3f ; 63 32602: f8 94 cli 32604: de bf out 0x3e, r29 ; 62 32606: 0f be out 0x3f, r0 ; 63 32608: 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; 3260a: 1f ef ldi r17, 0xFF ; 255 sm4_calc_delay_cb = xyzcal_calc_delay; } void xyzcal_measure_leave(void) { DBG(_n("xyzcal_measure_leave\n")); 3260c: 8d eb ldi r24, 0xBD ; 189 3260e: 95 ea ldi r25, 0xA5 ; 165 32610: 9f 93 push r25 32612: 8f 93 push r24 32614: 0f 94 99 da call 0x3b532 ; 0x3b532 lcd_set_cursor(4,3); 32618: 63 e0 ldi r22, 0x03 ; 3 3261a: 84 e0 ldi r24, 0x04 ; 4 3261c: 0e 94 f8 6e call 0xddf0 ; 0xddf0 lcd_space(16); 32620: 80 e1 ldi r24, 0x10 ; 16 32622: 0e 94 ee 6e call 0xdddc ; 0xdddc // resync planner position from counters (changed by xyzcal_update_pos) planner_reset_position(); 32626: 0f 94 37 c0 call 0x3806e ; 0x3806e : "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" ); 3262a: 88 e1 ldi r24, 0x18 ; 24 3262c: 98 e2 ldi r25, 0x28 ; 40 3262e: 0f b6 in r0, 0x3f ; 63 32630: f8 94 cli 32632: a8 95 wdr 32634: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 32638: 0f be out 0x3f, r0 ; 63 3263a: 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); 3263e: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 32642: 80 64 ori r24, 0x40 ; 64 32644: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> #endif //EMERGENCY_HANDLERS #endif //WATCHDOG ENABLE_STEPPER_DRIVER_INTERRUPT(); 32648: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 3264c: 82 60 ori r24, 0x02 ; 2 3264e: 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){ 32652: 0f 90 pop r0 32654: 0f 90 pop r0 32656: 1d 3f cpi r17, 0xFD ; 253 32658: 09 f4 brne .+2 ; 0x3265c 3265a: ee c1 rjmp .+988 ; 0x32a38 3265c: 1f 3f cpi r17, 0xFF ; 255 3265e: 11 f4 brne .+4 ; 0x32664 32660: 0d 94 67 9e jmp 0x33cce ; 0x33cce 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); 32664: 20 e0 ldi r18, 0x00 ; 0 32666: 30 e0 ldi r19, 0x00 ; 0 32668: a9 01 movw r20, r18 3266a: a0 96 adiw r28, 0x20 ; 32 3266c: ee ad ldd r30, Y+62 ; 0x3e 3266e: ff ad ldd r31, Y+63 ; 0x3f 32670: a0 97 sbiw r28, 0x20 ; 32 32672: 61 81 ldd r22, Z+1 ; 0x01 32674: 72 81 ldd r23, Z+2 ; 0x02 32676: 83 81 ldd r24, Z+3 ; 0x03 32678: 94 81 ldd r25, Z+4 ; 0x04 3267a: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> pt[0] += (current_position[X_AXIS]/(iteration + 1)); //count average 3267e: 20 91 91 06 lds r18, 0x0691 ; 0x800691 32682: 30 91 92 06 lds r19, 0x0692 ; 0x800692 32686: 40 91 93 06 lds r20, 0x0693 ; 0x800693 3268a: 50 91 94 06 lds r21, 0x0694 ; 0x800694 3268e: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 32692: a0 96 adiw r28, 0x20 ; 32 32694: ae ad ldd r26, Y+62 ; 0x3e 32696: bf ad ldd r27, Y+63 ; 0x3f 32698: a0 97 sbiw r28, 0x20 ; 32 3269a: 11 96 adiw r26, 0x01 ; 1 3269c: 6d 93 st X+, r22 3269e: 7d 93 st X+, r23 326a0: 8d 93 st X+, r24 326a2: 9c 93 st X, r25 326a4: 14 97 sbiw r26, 0x04 ; 4 pt[1] = (pt[1] * iteration) / (iteration + 1); pt[1] += (current_position[Y_AXIS] / (iteration + 1)); 326a6: c0 90 95 06 lds r12, 0x0695 ; 0x800695 326aa: d0 90 96 06 lds r13, 0x0696 ; 0x800696 326ae: e0 90 97 06 lds r14, 0x0697 ; 0x800697 326b2: f0 90 98 06 lds r15, 0x0698 ; 0x800698 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); 326b6: 20 e0 ldi r18, 0x00 ; 0 326b8: 30 e0 ldi r19, 0x00 ; 0 326ba: a9 01 movw r20, r18 326bc: 15 96 adiw r26, 0x05 ; 5 326be: 6d 91 ld r22, X+ 326c0: 7d 91 ld r23, X+ 326c2: 8d 91 ld r24, X+ 326c4: 9c 91 ld r25, X 326c6: 18 97 sbiw r26, 0x08 ; 8 326c8: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> pt[1] += (current_position[Y_AXIS] / (iteration + 1)); 326cc: a7 01 movw r20, r14 326ce: 96 01 movw r18, r12 326d0: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 326d4: a0 96 adiw r28, 0x20 ; 32 326d6: ee ad ldd r30, Y+62 ; 0x3e 326d8: ff ad ldd r31, Y+63 ; 0x3f 326da: a0 97 sbiw r28, 0x20 ; 32 326dc: 65 83 std Z+5, r22 ; 0x05 326de: 76 83 std Z+6, r23 ; 0x06 326e0: 87 83 std Z+7, r24 ; 0x07 326e2: 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) 326e4: 20 e0 ldi r18, 0x00 ; 0 326e6: 30 e0 ldi r19, 0x00 ; 0 326e8: 40 e8 ldi r20, 0x80 ; 128 326ea: 50 ec ldi r21, 0xC0 ; 192 326ec: c7 01 movw r24, r14 326ee: b6 01 movw r22, r12 326f0: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 326f4: 87 ff sbrs r24, 7 326f6: 0c c0 rjmp .+24 ; 0x32710 current_position[Y_AXIS] = Y_MIN_POS; 326f8: 80 e0 ldi r24, 0x00 ; 0 326fa: 90 e0 ldi r25, 0x00 ; 0 326fc: a0 e8 ldi r26, 0x80 ; 128 326fe: b0 ec ldi r27, 0xC0 ; 192 32700: 80 93 95 06 sts 0x0695, r24 ; 0x800695 32704: 90 93 96 06 sts 0x0696, r25 ; 0x800696 32708: a0 93 97 06 sts 0x0697, r26 ; 0x800697 3270c: b0 93 98 06 sts 0x0698, r27 ; 0x800698 // 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; 32710: 20 e0 ldi r18, 0x00 ; 0 32712: 30 e0 ldi r19, 0x00 ; 0 32714: 40 e4 ldi r20, 0x40 ; 64 32716: 50 e4 ldi r21, 0x40 ; 64 32718: 60 91 99 06 lds r22, 0x0699 ; 0x800699 3271c: 70 91 9a 06 lds r23, 0x069A ; 0x80069a 32720: 80 91 9b 06 lds r24, 0x069B ; 0x80069b 32724: 90 91 9c 06 lds r25, 0x069C ; 0x80069c 32728: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 3272c: 60 93 99 06 sts 0x0699, r22 ; 0x800699 32730: 70 93 9a 06 sts 0x069A, r23 ; 0x80069a 32734: 80 93 9b 06 sts 0x069B, r24 ; 0x80069b 32738: 90 93 9c 06 sts 0x069C, r25 ; 0x80069c 3273c: e0 96 adiw r28, 0x30 ; 48 3273e: 2e ad ldd r18, Y+62 ; 0x3e 32740: 3f ad ldd r19, Y+63 ; 0x3f 32742: e0 97 sbiw r28, 0x30 ; 48 32744: 28 5f subi r18, 0xF8 ; 248 32746: 3f 4f sbci r19, 0xFF ; 255 32748: e0 96 adiw r28, 0x30 ; 48 3274a: 3f af std Y+63, r19 ; 0x3f 3274c: 2e af std Y+62, r18 ; 0x3e 3274e: e0 97 sbiw r28, 0x30 ; 48 32750: a0 96 adiw r28, 0x20 ; 32 32752: 4e ad ldd r20, Y+62 ; 0x3e 32754: 5f ad ldd r21, Y+63 ; 0x3f 32756: a0 97 sbiw r28, 0x20 ; 32 32758: 48 5f subi r20, 0xF8 ; 248 3275a: 5f 4f sbci r21, 0xFF ; 255 3275c: a0 96 adiw r28, 0x20 ; 32 3275e: 5f af std Y+63, r21 ; 0x3f 32760: 4e af std Y+62, r20 ; 0x3e 32762: 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) { 32764: 54 e0 ldi r21, 0x04 ; 4 32766: 25 16 cp r2, r21 32768: 31 04 cpc r3, r1 3276a: 09 f0 breq .+2 ; 0x3276e 3276c: 16 cb rjmp .-2516 ; 0x31d9a go_to_current(homing_feedrate[X_AXIS] / 60.f); delay_keep_alive(3000); } #endif // SUPPORT_VERBOSITY } if (!retry) 3276e: a7 96 adiw r28, 0x27 ; 39 32770: 6f ad ldd r22, Y+63 ; 0x3f 32772: a7 97 sbiw r28, 0x27 ; 39 32774: 66 23 and r22, r22 32776: 31 f0 breq .+12 ; 0x32784 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) { 32778: e1 96 adiw r28, 0x31 ; 49 3277a: 8f ad ldd r24, Y+63 ; 0x3f 3277c: e1 97 sbiw r28, 0x31 ; 49 3277e: 81 30 cpi r24, 0x01 ; 1 32780: 09 f0 breq .+2 ; 0x32784 32782: da ce rjmp .-588 ; 0x32538 #endif // SUPPORT_VERBOSITY } if (!retry) break; } DBG(_n("All 4 calibration points found.\n")); 32784: 89 e8 ldi r24, 0x89 ; 137 32786: 90 e7 ldi r25, 0x70 ; 112 32788: 9f 93 push r25 3278a: 8f 93 push r24 3278c: 0f 94 99 da call 0x3b532 ; 0x3b532 delay_keep_alive(0); //manage_heater, reset watchdog, manage inactivity 32790: 90 e0 ldi r25, 0x00 ; 0 32792: 80 e0 ldi r24, 0x00 ; 0 32794: 0e 94 fc 8c call 0x119f8 ; 0x119f8 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) { 32798: 0f 90 pop r0 3279a: 0f 90 pop r0 3279c: 20 e0 ldi r18, 0x00 ; 0 3279e: 30 e0 ldi r19, 0x00 ; 0 327a0: 40 e9 ldi r20, 0x90 ; 144 327a2: 50 ec ldi r21, 0xC0 ; 192 327a4: 60 91 c6 13 lds r22, 0x13C6 ; 0x8013c6 327a8: 70 91 c7 13 lds r23, 0x13C7 ; 0x8013c7 327ac: 80 91 c8 13 lds r24, 0x13C8 ; 0x8013c8 327b0: 90 91 c9 13 lds r25, 0x13C9 ; 0x8013c9 327b4: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 327b8: 87 ff sbrs r24, 7 327ba: 45 c1 rjmp .+650 ; 0x32a46 too_far_mask |= 1 << 1; //front center point is out of reach SERIAL_ECHOLNPGM(""); 327bc: 89 e0 ldi r24, 0x09 ; 9 327be: 96 ea ldi r25, 0xA6 ; 166 327c0: 0e 94 93 79 call 0xf326 ; 0xf326 SERIAL_ECHOPGM("WARNING: Front point not reachable. Y coordinate:"); 327c4: 87 ed ldi r24, 0xD7 ; 215 327c6: 95 ea ldi r25, 0xA5 ; 165 327c8: 0e 94 68 77 call 0xeed0 ; 0xeed0 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 327cc: 60 91 c6 13 lds r22, 0x13C6 ; 0x8013c6 327d0: 70 91 c7 13 lds r23, 0x13C7 ; 0x8013c7 327d4: 80 91 c8 13 lds r24, 0x13C8 ; 0x8013c8 327d8: 90 91 c9 13 lds r25, 0x13C9 ; 0x8013c9 327dc: 42 e0 ldi r20, 0x02 ; 2 327de: 0f 94 42 d5 call 0x3aa84 ; 0x3aa84 MYSERIAL.print(pts[1]); SERIAL_ECHOPGM(" < "); 327e2: 83 ed ldi r24, 0xD3 ; 211 327e4: 95 ea ldi r25, 0xA5 ; 165 327e6: 0e 94 68 77 call 0xeed0 ; 0xeed0 MYSERIAL.println(Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 327ea: 60 e0 ldi r22, 0x00 ; 0 327ec: 70 e0 ldi r23, 0x00 ; 0 327ee: 80 e9 ldi r24, 0x90 ; 144 327f0: 90 ec ldi r25, 0xC0 ; 192 327f2: 0f 94 6f 74 call 0x2e8de ; 0x2e8de 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 327f6: 92 e0 ldi r25, 0x02 ; 2 327f8: af 96 adiw r28, 0x2f ; 47 327fa: 9f af std Y+63, r25 ; 0x3f 327fc: 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; 327fe: 10 92 f2 13 sts 0x13F2, r1 ; 0x8013f2 32802: 10 92 f3 13 sts 0x13F3, r1 ; 0x8013f3 32806: 10 92 f4 13 sts 0x13F4, r1 ; 0x8013f4 3280a: 10 92 f5 13 sts 0x13F5, r1 ; 0x8013f5 cntr[1] = 0.f; 3280e: 10 92 f6 13 sts 0x13F6, r1 ; 0x8013f6 32812: 10 92 f7 13 sts 0x13F7, r1 ; 0x8013f7 32816: 10 92 f8 13 sts 0x13F8, r1 ; 0x8013f8 3281a: 10 92 f9 13 sts 0x13F9, r1 ; 0x8013f9 3281e: a4 e6 ldi r26, 0x64 ; 100 32820: e6 96 adiw r28, 0x36 ; 54 32822: af af std Y+63, r26 ; 0x3f 32824: 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; 32826: a2 96 adiw r28, 0x22 ; 34 32828: 1c ae std Y+60, r1 ; 0x3c 3282a: 1d ae std Y+61, r1 ; 0x3d 3282c: 1e ae std Y+62, r1 ; 0x3e 3282e: 1f ae std Y+63, r1 ; 0x3f 32830: 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; 32832: a6 96 adiw r28, 0x26 ; 38 32834: 1c ae std Y+60, r1 ; 0x3c 32836: 1d ae std Y+61, r1 ; 0x3d 32838: 1e ae std Y+62, r1 ; 0x3e 3283a: 1f ae std Y+63, r1 ; 0x3f 3283c: 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 }; 3283e: fe 01 movw r30, r28 32840: 31 96 adiw r30, 0x01 ; 1 32842: 68 96 adiw r28, 0x18 ; 24 32844: ff af std Y+63, r31 ; 0x3f 32846: ee af std Y+62, r30 ; 0x3e 32848: 68 97 sbiw r28, 0x18 ; 24 float b[4] = { 0.f }; 3284a: 9e 01 movw r18, r28 3284c: 2f 5b subi r18, 0xBF ; 191 3284e: 3f 4f sbci r19, 0xFF ; 255 32850: 6a 96 adiw r28, 0x1a ; 26 32852: 3f af std Y+63, r19 ; 0x3f 32854: 2e af std Y+62, r18 ; 0x3e 32856: 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; 32858: a6 96 adiw r28, 0x26 ; 38 3285a: 6c ad ldd r22, Y+60 ; 0x3c 3285c: 7d ad ldd r23, Y+61 ; 0x3d 3285e: 8e ad ldd r24, Y+62 ; 0x3e 32860: 9f ad ldd r25, Y+63 ; 0x3f 32862: a6 97 sbiw r28, 0x26 ; 38 32864: 0f 94 f9 dd call 0x3bbf2 ; 0x3bbf2 32868: 6e 96 adiw r28, 0x1e ; 30 3286a: 6c af std Y+60, r22 ; 0x3c 3286c: 7d af std Y+61, r23 ; 0x3d 3286e: 8e af std Y+62, r24 ; 0x3e 32870: 9f af std Y+63, r25 ; 0x3f 32872: 6e 97 sbiw r28, 0x1e ; 30 float s1 = sin(a1) * MACHINE_AXIS_SCALE_X; 32874: a6 96 adiw r28, 0x26 ; 38 32876: 6c ad ldd r22, Y+60 ; 0x3c 32878: 7d ad ldd r23, Y+61 ; 0x3d 3287a: 8e ad ldd r24, Y+62 ; 0x3e 3287c: 9f ad ldd r25, Y+63 ; 0x3f 3287e: a6 97 sbiw r28, 0x26 ; 38 32880: 0f 94 bf e0 call 0x3c17e ; 0x3c17e 32884: cb 57 subi r28, 0x7B ; 123 32886: df 4f sbci r29, 0xFF ; 255 32888: 68 83 st Y, r22 3288a: 79 83 std Y+1, r23 ; 0x01 3288c: 8a 83 std Y+2, r24 ; 0x02 3288e: 9b 83 std Y+3, r25 ; 0x03 32890: c5 58 subi r28, 0x85 ; 133 32892: d0 40 sbci r29, 0x00 ; 0 float c2 = cos(a2) * MACHINE_AXIS_SCALE_Y; 32894: a2 96 adiw r28, 0x22 ; 34 32896: 6c ad ldd r22, Y+60 ; 0x3c 32898: 7d ad ldd r23, Y+61 ; 0x3d 3289a: 8e ad ldd r24, Y+62 ; 0x3e 3289c: 9f ad ldd r25, Y+63 ; 0x3f 3289e: a2 97 sbiw r28, 0x22 ; 34 328a0: 0f 94 f9 dd call 0x3bbf2 ; 0x3bbf2 328a4: c7 57 subi r28, 0x77 ; 119 328a6: df 4f sbci r29, 0xFF ; 255 328a8: 68 83 st Y, r22 328aa: 79 83 std Y+1, r23 ; 0x01 328ac: 8a 83 std Y+2, r24 ; 0x02 328ae: 9b 83 std Y+3, r25 ; 0x03 328b0: c9 58 subi r28, 0x89 ; 137 328b2: d0 40 sbci r29, 0x00 ; 0 float s2 = sin(a2) * MACHINE_AXIS_SCALE_Y; 328b4: a2 96 adiw r28, 0x22 ; 34 328b6: 6c ad ldd r22, Y+60 ; 0x3c 328b8: 7d ad ldd r23, Y+61 ; 0x3d 328ba: 8e ad ldd r24, Y+62 ; 0x3e 328bc: 9f ad ldd r25, Y+63 ; 0x3f 328be: a2 97 sbiw r28, 0x22 ; 34 328c0: 0f 94 bf e0 call 0x3c17e ; 0x3c17e 328c4: cb 56 subi r28, 0x6B ; 107 328c6: df 4f sbci r29, 0xFF ; 255 328c8: 68 83 st Y, r22 328ca: 79 83 std Y+1, r23 ; 0x01 328cc: 8a 83 std Y+2, r24 ; 0x02 328ce: 9b 83 std Y+3, r25 ; 0x03 328d0: c5 59 subi r28, 0x95 ; 149 328d2: d0 40 sbci r29, 0x00 ; 0 // Prepare the Normal equation for the Gauss-Newton method. float A[4][4] = { 0.f }; 328d4: 68 96 adiw r28, 0x18 ; 24 328d6: ae ad ldd r26, Y+62 ; 0x3e 328d8: bf ad ldd r27, Y+63 ; 0x3f 328da: 68 97 sbiw r28, 0x18 ; 24 328dc: e0 e4 ldi r30, 0x40 ; 64 328de: 1d 92 st X+, r1 328e0: ea 95 dec r30 328e2: e9 f7 brne .-6 ; 0x328de float b[4] = { 0.f }; 328e4: 80 e1 ldi r24, 0x10 ; 16 328e6: 6a 96 adiw r28, 0x1a ; 26 328e8: ae ad ldd r26, Y+62 ; 0x3e 328ea: bf ad ldd r27, Y+63 ; 0x3f 328ec: 6a 97 sbiw r28, 0x1a ; 26 328ee: 1d 92 st X+, r1 328f0: 8a 95 dec r24 328f2: e9 f7 brne .-6 ; 0x328ee float acc; delay_keep_alive(0); //manage heater, reset watchdog, manage inactivity 328f4: 90 e0 ldi r25, 0x00 ; 0 328f6: 80 e0 ldi r24, 0x00 ; 0 328f8: 0e 94 fc 8c call 0x119f8 ; 0x119f8 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); 328fc: 20 91 f2 13 lds r18, 0x13F2 ; 0x8013f2 32900: 30 91 f3 13 lds r19, 0x13F3 ; 0x8013f3 32904: 40 91 f4 13 lds r20, 0x13F4 ; 0x8013f4 32908: 50 91 f5 13 lds r21, 0x13F5 ; 0x8013f5 3290c: c5 55 subi r28, 0x55 ; 85 3290e: df 4f sbci r29, 0xFF ; 255 32910: 28 83 st Y, r18 32912: 39 83 std Y+1, r19 ; 0x01 32914: 4a 83 std Y+2, r20 ; 0x02 32916: 5b 83 std Y+3, r21 ; 0x03 32918: cb 5a subi r28, 0xAB ; 171 3291a: 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); 3291c: 80 91 f6 13 lds r24, 0x13F6 ; 0x8013f6 32920: 90 91 f7 13 lds r25, 0x13F7 ; 0x8013f7 32924: a0 91 f8 13 lds r26, 0x13F8 ; 0x8013f8 32928: b0 91 f9 13 lds r27, 0x13F9 ; 0x8013f9 3292c: c1 55 subi r28, 0x51 ; 81 3292e: df 4f sbci r29, 0xFF ; 255 32930: 88 83 st Y, r24 32932: 99 83 std Y+1, r25 ; 0x01 32934: aa 83 std Y+2, r26 ; 0x02 32936: bb 83 std Y+3, r27 ; 0x03 32938: cf 5a subi r28, 0xAF ; 175 3293a: d0 40 sbci r29, 0x00 ; 0 3293c: de 01 movw r26, r28 3293e: af 5b subi r26, 0xBF ; 191 32940: bf 4f sbci r27, 0xFF ; 255 32942: c7 56 subi r28, 0x67 ; 103 32944: df 4f sbci r29, 0xFF ; 255 32946: b9 83 std Y+1, r27 ; 0x01 32948: a8 83 st Y, r26 3294a: c9 59 subi r28, 0x99 ; 153 3294c: d0 40 sbci r29, 0x00 ; 0 3294e: fe 01 movw r30, r28 32950: 31 96 adiw r30, 0x01 ; 1 32952: ac 96 adiw r28, 0x2c ; 44 32954: ff af std Y+63, r31 ; 0x3f 32956: ee af std Y+62, r30 ; 0x3e 32958: 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) { 3295a: 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])); 3295c: cb 56 subi r28, 0x6B ; 107 3295e: df 4f sbci r29, 0xFF ; 255 32960: 28 81 ld r18, Y 32962: 39 81 ldd r19, Y+1 ; 0x01 32964: 4a 81 ldd r20, Y+2 ; 0x02 32966: 5b 81 ldd r21, Y+3 ; 0x03 32968: c5 59 subi r28, 0x95 ; 149 3296a: d0 40 sbci r29, 0x00 ; 0 3296c: 50 58 subi r21, 0x80 ; 128 3296e: ed 96 adiw r28, 0x3d ; 61 32970: 2c af std Y+60, r18 ; 0x3c 32972: 3d af std Y+61, r19 ; 0x3d 32974: 4e af std Y+62, r20 ; 0x3e 32976: 5f af std Y+63, r21 ; 0x3f 32978: 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])); 3297a: c7 57 subi r28, 0x77 ; 119 3297c: df 4f sbci r29, 0xFF ; 255 3297e: 88 81 ld r24, Y 32980: 99 81 ldd r25, Y+1 ; 0x01 32982: aa 81 ldd r26, Y+2 ; 0x02 32984: bb 81 ldd r27, Y+3 ; 0x03 32986: c9 58 subi r28, 0x89 ; 137 32988: d0 40 sbci r29, 0x00 ; 0 3298a: b0 58 subi r27, 0x80 ; 128 3298c: c3 58 subi r28, 0x83 ; 131 3298e: df 4f sbci r29, 0xFF ; 255 32990: 88 83 st Y, r24 32992: 99 83 std Y+1, r25 ; 0x01 32994: aa 83 std Y+2, r26 ; 0x02 32996: bb 83 std Y+3, r27 ; 0x03 32998: cd 57 subi r28, 0x7D ; 125 3299a: 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]) : 3299c: cb 57 subi r28, 0x7B ; 123 3299e: df 4f sbci r29, 0xFF ; 255 329a0: 28 81 ld r18, Y 329a2: 39 81 ldd r19, Y+1 ; 0x01 329a4: 4a 81 ldd r20, Y+2 ; 0x02 329a6: 5b 81 ldd r21, Y+3 ; 0x03 329a8: c5 58 subi r28, 0x85 ; 133 329aa: d0 40 sbci r29, 0x00 ; 0 329ac: 50 58 subi r21, 0x80 ; 128 329ae: cf 57 subi r28, 0x7F ; 127 329b0: df 4f sbci r29, 0xFF ; 255 329b2: 28 83 st Y, r18 329b4: 39 83 std Y+1, r19 ; 0x01 329b6: 4a 83 std Y+2, r20 ; 0x02 329b8: 5b 83 std Y+3, r21 ; 0x03 329ba: c1 58 subi r28, 0x81 ; 129 329bc: 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) { 329be: ac 96 adiw r28, 0x2c ; 44 329c0: 2e ac ldd r2, Y+62 ; 0x3e 329c2: 3f ac ldd r3, Y+63 ; 0x3f 329c4: ac 97 sbiw r28, 0x2c ; 44 for (uint8_t c = 0; c < 4; ++c) { 329c6: 10 e0 ldi r17, 0x00 ; 0 329c8: 61 ec ldi r22, 0xC1 ; 193 329ca: 46 2e mov r4, r22 329cc: 63 e1 ldi r22, 0x13 ; 19 329ce: 56 2e mov r5, r22 329d0: 74 e0 ldi r23, 0x04 ; 4 329d2: 77 2e mov r7, r23 acc = 0; 329d4: c1 2c mov r12, r1 329d6: d1 2c mov r13, r1 329d8: 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) { 329da: 01 30 cpi r16, 0x01 ; 1 329dc: 11 f4 brne .+4 ; 0x329e2 329de: 0d 94 1b 9f jmp 0x33e36 ; 0x33e36 329e2: 11 30 cpi r17, 0x01 ; 1 329e4: 11 f4 brne .+4 ; 0x329ea 329e6: 0d 94 cd 9e jmp 0x33d9a ; 0x33d9a float a = (r == 0) ? 1.f : 329ea: 00 23 and r16, r16 329ec: 11 f4 brne .+4 ; 0x329f2 329ee: 0d 94 0d 9f jmp 0x33e1a ; 0x33e1a ((r == 2) ? (-s1 * measured_pts[2 * i]) : 329f2: 02 30 cpi r16, 0x02 ; 2 329f4: 61 f5 brne .+88 ; 0x32a4e 329f6: d2 01 movw r26, r4 329f8: 11 96 adiw r26, 0x01 ; 1 329fa: 2d 91 ld r18, X+ 329fc: 3d 91 ld r19, X+ 329fe: 4d 91 ld r20, X+ 32a00: 5c 91 ld r21, X 32a02: 14 97 sbiw r26, 0x04 ; 4 32a04: cf 57 subi r28, 0x7F ; 127 32a06: df 4f sbci r29, 0xFF ; 255 32a08: 68 81 ld r22, Y 32a0a: 79 81 ldd r23, Y+1 ; 0x01 32a0c: 8a 81 ldd r24, Y+2 ; 0x02 32a0e: 9b 81 ldd r25, Y+3 ; 0x03 32a10: c1 58 subi r28, 0x81 ; 129 32a12: d0 40 sbci r29, 0x00 ; 0 32a14: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 32a18: 4b 01 movw r8, r22 32a1a: 5c 01 movw r10, r24 (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : 32a1c: 11 11 cpse r17, r1 32a1e: 25 c0 rjmp .+74 ; 0x32a6a 32a20: 60 e0 ldi r22, 0x00 ; 0 32a22: 70 e0 ldi r23, 0x00 ; 0 32a24: 80 e8 ldi r24, 0x80 ; 128 32a26: 9f e3 ldi r25, 0x3F ; 63 32a28: 35 c0 rjmp .+106 ; 0x32a94 int16_t maxs = 0; for (int16_t i = 0; i < 32*32;++i){ if (matrix32[i] == 0) { ++mins; } else if (matrix32[i] == 0xFF){ 32a2a: 2f 3f cpi r18, 0xFF ; 255 32a2c: 09 f0 breq .+2 ; 0x32a30 32a2e: 92 cb rjmp .-2268 ; 0x32154 ++maxs; 32a30: 01 96 adiw r24, 0x01 ; 1 32a32: 90 cb rjmp .-2272 ; 0x32154 /// 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; 32a34: 1f ef ldi r17, 0xFF ; 255 32a36: 26 cd rjmp .-1460 ; 0x32484 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; 32a38: e5 96 adiw r28, 0x35 ; 53 32a3a: bf ad ldd r27, Y+63 ; 0x3f 32a3c: e5 97 sbiw r28, 0x35 ; 53 32a3e: a7 96 adiw r28, 0x27 ; 39 32a40: bf af std Y+63, r27 ; 0x3f 32a42: a7 97 sbiw r28, 0x27 ; 39 32a44: 0f ce rjmp .-994 ; 0x32664 // 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; 32a46: af 96 adiw r28, 0x2f ; 47 32a48: 1f ae std Y+63, r1 ; 0x3f 32a4a: af 97 sbiw r28, 0x2f ; 47 32a4c: d8 ce rjmp .-592 ; 0x327fe 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]) : 32a4e: f2 01 movw r30, r4 32a50: 25 81 ldd r18, Z+5 ; 0x05 32a52: 36 81 ldd r19, Z+6 ; 0x06 32a54: 47 81 ldd r20, Z+7 ; 0x07 32a56: 50 85 ldd r21, Z+8 ; 0x08 32a58: c3 58 subi r28, 0x83 ; 131 32a5a: df 4f sbci r29, 0xFF ; 255 32a5c: 68 81 ld r22, Y 32a5e: 79 81 ldd r23, Y+1 ; 0x01 32a60: 8a 81 ldd r24, Y+2 ; 0x02 32a62: 9b 81 ldd r25, Y+3 ; 0x03 32a64: cd 57 subi r28, 0x7D ; 125 32a66: d0 40 sbci r29, 0x00 ; 0 32a68: d5 cf rjmp .-86 ; 0x32a14 (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : ((c == 2) ? (-s1 * measured_pts[2 * i]) : 32a6a: 12 30 cpi r17, 0x02 ; 2 32a6c: 11 f0 breq .+4 ; 0x32a72 32a6e: 0d 94 0e 9e jmp 0x33c1c ; 0x33c1c 32a72: d2 01 movw r26, r4 32a74: 11 96 adiw r26, 0x01 ; 1 32a76: 2d 91 ld r18, X+ 32a78: 3d 91 ld r19, X+ 32a7a: 4d 91 ld r20, X+ 32a7c: 5c 91 ld r21, X 32a7e: 14 97 sbiw r26, 0x04 ; 4 32a80: cf 57 subi r28, 0x7F ; 127 32a82: df 4f sbci r29, 0xFF ; 255 32a84: 68 81 ld r22, Y 32a86: 79 81 ldd r23, Y+1 ; 0x01 32a88: 8a 81 ldd r24, Y+2 ; 0x02 32a8a: 9b 81 ldd r25, Y+3 ; 0x03 32a8c: c1 58 subi r28, 0x81 ; 129 32a8e: d0 40 sbci r29, 0x00 ; 0 32a90: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> (-c2 * measured_pts[2 * i + 1])); float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += a * b * w; 32a94: 9b 01 movw r18, r22 32a96: ac 01 movw r20, r24 32a98: c5 01 movw r24, r10 32a9a: b4 01 movw r22, r8 32a9c: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 32aa0: 9b 01 movw r18, r22 32aa2: ac 01 movw r20, r24 32aa4: c7 01 movw r24, r14 32aa6: b6 01 movw r22, r12 32aa8: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 32aac: 6b 01 movw r12, r22 32aae: 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) { 32ab0: 01 11 cpse r16, r1 32ab2: 0d 94 25 9f jmp 0x33e4a ; 0x33e4a 32ab6: 7a 94 dec r7 32ab8: f8 e0 ldi r31, 0x08 ; 8 32aba: 4f 0e add r4, r31 32abc: 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) { 32abe: 71 10 cpse r7, r1 32ac0: 8c cf rjmp .-232 ; 0x329da (-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; 32ac2: d1 01 movw r26, r2 32ac4: cd 92 st X+, r12 32ac6: dd 92 st X+, r13 32ac8: ed 92 st X+, r14 32aca: fd 92 st X+, r15 32acc: 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) { 32ace: 1f 5f subi r17, 0xFF ; 255 32ad0: 14 30 cpi r17, 0x04 ; 4 32ad2: 09 f0 breq .+2 ; 0x32ad6 32ad4: 79 cf rjmp .-270 ; 0x329c8 32ad6: 3a e0 ldi r19, 0x0A ; 10 32ad8: 23 2e mov r2, r19 32ada: 36 ea ldi r19, 0xA6 ; 166 32adc: 33 2e mov r3, r19 32ade: e1 ec ldi r30, 0xC1 ; 193 32ae0: f3 e1 ldi r31, 0x13 ; 19 32ae2: a8 96 adiw r28, 0x28 ; 40 32ae4: ff af std Y+63, r31 ; 0x3f 32ae6: ee af std Y+62, r30 ; 0x3e 32ae8: a8 97 sbiw r28, 0x28 ; 40 } } A[r][c] = acc; } // J^T times f(x) acc = 0.f; 32aea: c3 57 subi r28, 0x73 ; 115 32aec: df 4f sbci r29, 0xFF ; 255 32aee: 18 82 st Y, r1 32af0: cd 58 subi r28, 0x8D ; 141 32af2: d0 40 sbci r29, 0x00 ; 0 32af4: c3 56 subi r28, 0x63 ; 99 32af6: df 4f sbci r29, 0xFF ; 255 32af8: 18 82 st Y, r1 32afa: cd 59 subi r28, 0x9D ; 157 32afc: d0 40 sbci r29, 0x00 ; 0 32afe: cf 55 subi r28, 0x5F ; 95 32b00: df 4f sbci r29, 0xFF ; 255 32b02: 18 82 st Y, r1 32b04: c1 5a subi r28, 0xA1 ; 161 32b06: d0 40 sbci r29, 0x00 ; 0 32b08: 10 e0 ldi r17, 0x00 ; 0 32b0a: a8 96 adiw r28, 0x28 ; 40 32b0c: ae ad ldd r26, Y+62 ; 0x3e 32b0e: bf ad ldd r27, Y+63 ; 0x3f 32b10: a8 97 sbiw r28, 0x28 ; 40 32b12: 11 96 adiw r26, 0x01 ; 1 32b14: 2d 91 ld r18, X+ 32b16: 3d 91 ld r19, X+ 32b18: 4d 91 ld r20, X+ 32b1a: 5c 91 ld r21, X 32b1c: 14 97 sbiw r26, 0x04 ; 4 32b1e: e4 96 adiw r28, 0x34 ; 52 32b20: 2c af std Y+60, r18 ; 0x3c 32b22: 3d af std Y+61, r19 ; 0x3d 32b24: 4e af std Y+62, r20 ; 0x3e 32b26: 5f af std Y+63, r21 ; 0x3f 32b28: e4 97 sbiw r28, 0x34 ; 52 32b2a: 15 96 adiw r26, 0x05 ; 5 32b2c: 4d 90 ld r4, X+ 32b2e: 5d 90 ld r5, X+ 32b30: 6d 90 ld r6, X+ 32b32: 7c 90 ld r7, X 32b34: 18 97 sbiw r26, 0x08 ; 8 for (uint8_t i = 0; i < npts; ++i) { { float j = (r == 0) ? 1.f : 32b36: 00 23 and r16, r16 32b38: 11 f4 brne .+4 ; 0x32b3e 32b3a: 0d 94 41 9e jmp 0x33c82 ; 0x33c82 ((r == 1) ? 0.f : 32b3e: 81 2c mov r8, r1 32b40: 91 2c mov r9, r1 32b42: 54 01 movw r10, r8 32b44: 01 30 cpi r16, 0x01 ; 1 32b46: 81 f0 breq .+32 ; 0x32b68 ((r == 2) ? (-s1 * measured_pts[2 * i]) : 32b48: 02 30 cpi r16, 0x02 ; 2 32b4a: 11 f0 breq .+4 ; 0x32b50 32b4c: 0d 94 35 9e jmp 0x33c6a ; 0x33c6a 32b50: cf 57 subi r28, 0x7F ; 127 32b52: df 4f sbci r29, 0xFF ; 255 32b54: 68 81 ld r22, Y 32b56: 79 81 ldd r23, Y+1 ; 0x01 32b58: 8a 81 ldd r24, Y+2 ; 0x02 32b5a: 9b 81 ldd r25, Y+3 ; 0x03 32b5c: c1 58 subi r28, 0x81 ; 129 32b5e: d0 40 sbci r29, 0x00 ; 0 32b60: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 32b64: 4b 01 movw r8, r22 32b66: 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); 32b68: e4 96 adiw r28, 0x34 ; 52 32b6a: 2c ad ldd r18, Y+60 ; 0x3c 32b6c: 3d ad ldd r19, Y+61 ; 0x3d 32b6e: 4e ad ldd r20, Y+62 ; 0x3e 32b70: 5f ad ldd r21, Y+63 ; 0x3f 32b72: e4 97 sbiw r28, 0x34 ; 52 32b74: 6e 96 adiw r28, 0x1e ; 30 32b76: 6c ad ldd r22, Y+60 ; 0x3c 32b78: 7d ad ldd r23, Y+61 ; 0x3d 32b7a: 8e ad ldd r24, Y+62 ; 0x3e 32b7c: 9f ad ldd r25, Y+63 ; 0x3f 32b7e: 6e 97 sbiw r28, 0x1e ; 30 32b80: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 32b84: 6b 01 movw r12, r22 32b86: 7c 01 movw r14, r24 32b88: f1 01 movw r30, r2 32b8a: 25 91 lpm r18, Z+ 32b8c: 35 91 lpm r19, Z+ 32b8e: 45 91 lpm r20, Z+ 32b90: 54 91 lpm r21, Z 32b92: cb 55 subi r28, 0x5B ; 91 32b94: df 4f sbci r29, 0xFF ; 255 32b96: 28 83 st Y, r18 32b98: 39 83 std Y+1, r19 ; 0x01 32b9a: 4a 83 std Y+2, r20 ; 0x02 32b9c: 5b 83 std Y+3, r21 ; 0x03 32b9e: c5 5a subi r28, 0xA5 ; 165 32ba0: d0 40 sbci r29, 0x00 ; 0 32ba2: a3 01 movw r20, r6 32ba4: 92 01 movw r18, r4 32ba6: cb 56 subi r28, 0x6B ; 107 32ba8: df 4f sbci r29, 0xFF ; 255 32baa: 68 81 ld r22, Y 32bac: 79 81 ldd r23, Y+1 ; 0x01 32bae: 8a 81 ldd r24, Y+2 ; 0x02 32bb0: 9b 81 ldd r25, Y+3 ; 0x03 32bb2: c5 59 subi r28, 0x95 ; 149 32bb4: d0 40 sbci r29, 0x00 ; 0 32bb6: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 32bba: 9b 01 movw r18, r22 32bbc: ac 01 movw r20, r24 32bbe: c7 01 movw r24, r14 32bc0: b6 01 movw r22, r12 32bc2: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 32bc6: c5 55 subi r28, 0x55 ; 85 32bc8: df 4f sbci r29, 0xFF ; 255 32bca: 28 81 ld r18, Y 32bcc: 39 81 ldd r19, Y+1 ; 0x01 32bce: 4a 81 ldd r20, Y+2 ; 0x02 32bd0: 5b 81 ldd r21, Y+3 ; 0x03 32bd2: cb 5a subi r28, 0xAB ; 171 32bd4: d0 40 sbci r29, 0x00 ; 0 32bd6: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 32bda: cb 55 subi r28, 0x5B ; 91 32bdc: df 4f sbci r29, 0xFF ; 255 32bde: 28 81 ld r18, Y 32be0: 39 81 ldd r19, Y+1 ; 0x01 32be2: 4a 81 ldd r20, Y+2 ; 0x02 32be4: 5b 81 ldd r21, Y+3 ; 0x03 32be6: c5 5a subi r28, 0xA5 ; 165 32be8: d0 40 sbci r29, 0x00 ; 0 32bea: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += j * fx * w; 32bee: a5 01 movw r20, r10 32bf0: 94 01 movw r18, r8 32bf2: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 32bf6: c3 57 subi r28, 0x73 ; 115 32bf8: df 4f sbci r29, 0xFF ; 255 32bfa: 28 81 ld r18, Y 32bfc: cd 58 subi r28, 0x8D ; 141 32bfe: d0 40 sbci r29, 0x00 ; 0 32c00: c3 56 subi r28, 0x63 ; 99 32c02: df 4f sbci r29, 0xFF ; 255 32c04: 38 81 ld r19, Y 32c06: cd 59 subi r28, 0x9D ; 157 32c08: d0 40 sbci r29, 0x00 ; 0 32c0a: cf 55 subi r28, 0x5F ; 95 32c0c: df 4f sbci r29, 0xFF ; 255 32c0e: 48 81 ld r20, Y 32c10: c1 5a subi r28, 0xA1 ; 161 32c12: d0 40 sbci r29, 0x00 ; 0 32c14: 51 2f mov r21, r17 32c16: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 32c1a: c3 57 subi r28, 0x73 ; 115 32c1c: df 4f sbci r29, 0xFF ; 255 32c1e: 68 83 st Y, r22 32c20: 79 83 std Y+1, r23 ; 0x01 32c22: 8a 83 std Y+2, r24 ; 0x02 32c24: 9b 83 std Y+3, r25 ; 0x03 32c26: cd 58 subi r28, 0x8D ; 141 32c28: d0 40 sbci r29, 0x00 ; 0 } { float j = (r == 0) ? 0.f : 32c2a: 00 23 and r16, r16 32c2c: 11 f4 brne .+4 ; 0x32c32 32c2e: 0d 94 49 9e jmp 0x33c92 ; 0x33c92 ((r == 1) ? 1.f : 32c32: 01 30 cpi r16, 0x01 ; 1 32c34: 11 f4 brne .+4 ; 0x32c3a 32c36: 0d 94 4e 9e jmp 0x33c9c ; 0x33c9c ((r == 2) ? ( c1 * measured_pts[2 * i]) : 32c3a: 02 30 cpi r16, 0x02 ; 2 32c3c: 61 f0 breq .+24 ; 0x32c56 32c3e: a3 01 movw r20, r6 32c40: 92 01 movw r18, r4 32c42: ed 96 adiw r28, 0x3d ; 61 32c44: 6c ad ldd r22, Y+60 ; 0x3c 32c46: 7d ad ldd r23, Y+61 ; 0x3d 32c48: 8e ad ldd r24, Y+62 ; 0x3e 32c4a: 9f ad ldd r25, Y+63 ; 0x3f 32c4c: ed 97 sbiw r28, 0x3d ; 61 32c4e: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 32c52: 6b 01 movw r12, r22 32c54: 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); 32c56: f1 01 movw r30, r2 32c58: 34 96 adiw r30, 0x04 ; 4 32c5a: 85 90 lpm r8, Z+ 32c5c: 95 90 lpm r9, Z+ 32c5e: a5 90 lpm r10, Z+ 32c60: b4 90 lpm r11, Z 32c62: e4 96 adiw r28, 0x34 ; 52 32c64: 2c ad ldd r18, Y+60 ; 0x3c 32c66: 3d ad ldd r19, Y+61 ; 0x3d 32c68: 4e ad ldd r20, Y+62 ; 0x3e 32c6a: 5f ad ldd r21, Y+63 ; 0x3f 32c6c: e4 97 sbiw r28, 0x34 ; 52 32c6e: cb 57 subi r28, 0x7B ; 123 32c70: df 4f sbci r29, 0xFF ; 255 32c72: 68 81 ld r22, Y 32c74: 79 81 ldd r23, Y+1 ; 0x01 32c76: 8a 81 ldd r24, Y+2 ; 0x02 32c78: 9b 81 ldd r25, Y+3 ; 0x03 32c7a: c5 58 subi r28, 0x85 ; 133 32c7c: d0 40 sbci r29, 0x00 ; 0 32c7e: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 32c82: e4 96 adiw r28, 0x34 ; 52 32c84: 6c af std Y+60, r22 ; 0x3c 32c86: 7d af std Y+61, r23 ; 0x3d 32c88: 8e af std Y+62, r24 ; 0x3e 32c8a: 9f af std Y+63, r25 ; 0x3f 32c8c: e4 97 sbiw r28, 0x34 ; 52 32c8e: a3 01 movw r20, r6 32c90: 92 01 movw r18, r4 32c92: c7 57 subi r28, 0x77 ; 119 32c94: df 4f sbci r29, 0xFF ; 255 32c96: 68 81 ld r22, Y 32c98: 79 81 ldd r23, Y+1 ; 0x01 32c9a: 8a 81 ldd r24, Y+2 ; 0x02 32c9c: 9b 81 ldd r25, Y+3 ; 0x03 32c9e: c9 58 subi r28, 0x89 ; 137 32ca0: d0 40 sbci r29, 0x00 ; 0 32ca2: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 32ca6: 9b 01 movw r18, r22 32ca8: ac 01 movw r20, r24 32caa: e4 96 adiw r28, 0x34 ; 52 32cac: 6c ad ldd r22, Y+60 ; 0x3c 32cae: 7d ad ldd r23, Y+61 ; 0x3d 32cb0: 8e ad ldd r24, Y+62 ; 0x3e 32cb2: 9f ad ldd r25, Y+63 ; 0x3f 32cb4: e4 97 sbiw r28, 0x34 ; 52 32cb6: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 32cba: c1 55 subi r28, 0x51 ; 81 32cbc: df 4f sbci r29, 0xFF ; 255 32cbe: 28 81 ld r18, Y 32cc0: 39 81 ldd r19, Y+1 ; 0x01 32cc2: 4a 81 ldd r20, Y+2 ; 0x02 32cc4: 5b 81 ldd r21, Y+3 ; 0x03 32cc6: cf 5a subi r28, 0xAF ; 175 32cc8: d0 40 sbci r29, 0x00 ; 0 32cca: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 32cce: a5 01 movw r20, r10 32cd0: 94 01 movw r18, r8 32cd2: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> float w = point_weight_y(i, measured_pts[2 * i + 1]); acc += j * fy * w; 32cd6: a7 01 movw r20, r14 32cd8: 96 01 movw r18, r12 32cda: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 32cde: c3 57 subi r28, 0x73 ; 115 32ce0: df 4f sbci r29, 0xFF ; 255 32ce2: 28 81 ld r18, Y 32ce4: 39 81 ldd r19, Y+1 ; 0x01 32ce6: 4a 81 ldd r20, Y+2 ; 0x02 32ce8: 5b 81 ldd r21, Y+3 ; 0x03 32cea: cd 58 subi r28, 0x8D ; 141 32cec: d0 40 sbci r29, 0x00 ; 0 32cee: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 32cf2: c3 57 subi r28, 0x73 ; 115 32cf4: df 4f sbci r29, 0xFF ; 255 32cf6: 68 83 st Y, r22 32cf8: cd 58 subi r28, 0x8D ; 141 32cfa: d0 40 sbci r29, 0x00 ; 0 32cfc: c3 56 subi r28, 0x63 ; 99 32cfe: df 4f sbci r29, 0xFF ; 255 32d00: 78 83 st Y, r23 32d02: cd 59 subi r28, 0x9D ; 157 32d04: d0 40 sbci r29, 0x00 ; 0 32d06: cf 55 subi r28, 0x5F ; 95 32d08: df 4f sbci r29, 0xFF ; 255 32d0a: 88 83 st Y, r24 32d0c: c1 5a subi r28, 0xA1 ; 161 32d0e: d0 40 sbci r29, 0x00 ; 0 32d10: 19 2f mov r17, r25 32d12: a8 96 adiw r28, 0x28 ; 40 32d14: 4e ad ldd r20, Y+62 ; 0x3e 32d16: 5f ad ldd r21, Y+63 ; 0x3f 32d18: a8 97 sbiw r28, 0x28 ; 40 32d1a: 48 5f subi r20, 0xF8 ; 248 32d1c: 5f 4f sbci r21, 0xFF ; 255 32d1e: a8 96 adiw r28, 0x28 ; 40 32d20: 5f af std Y+63, r21 ; 0x3f 32d22: 4e af std Y+62, r20 ; 0x3e 32d24: a8 97 sbiw r28, 0x28 ; 40 32d26: 58 e0 ldi r21, 0x08 ; 8 32d28: 25 0e add r2, r21 32d2a: 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) { 32d2c: a1 ee ldi r26, 0xE1 ; 225 32d2e: b3 e1 ldi r27, 0x13 ; 19 32d30: a8 96 adiw r28, 0x28 ; 40 32d32: ee ad ldd r30, Y+62 ; 0x3e 32d34: ff ad ldd r31, Y+63 ; 0x3f 32d36: a8 97 sbiw r28, 0x28 ; 40 32d38: ae 17 cp r26, r30 32d3a: bf 07 cpc r27, r31 32d3c: 09 f0 breq .+2 ; 0x32d40 32d3e: e5 ce rjmp .-566 ; 0x32b0a 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; 32d40: 90 58 subi r25, 0x80 ; 128 32d42: c7 56 subi r28, 0x67 ; 103 32d44: df 4f sbci r29, 0xFF ; 255 32d46: a8 81 ld r26, Y 32d48: b9 81 ldd r27, Y+1 ; 0x01 32d4a: c9 59 subi r28, 0x99 ; 153 32d4c: d0 40 sbci r29, 0x00 ; 0 32d4e: 6d 93 st X+, r22 32d50: 7d 93 st X+, r23 32d52: 8d 93 st X+, r24 32d54: 9d 93 st X+, r25 32d56: c7 56 subi r28, 0x67 ; 103 32d58: df 4f sbci r29, 0xFF ; 255 32d5a: b9 83 std Y+1, r27 ; 0x01 32d5c: a8 83 st Y, r26 32d5e: c9 59 subi r28, 0x99 ; 153 32d60: 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) { 32d62: 0f 5f subi r16, 0xFF ; 255 32d64: ac 96 adiw r28, 0x2c ; 44 32d66: ee ad ldd r30, Y+62 ; 0x3e 32d68: ff ad ldd r31, Y+63 ; 0x3f 32d6a: ac 97 sbiw r28, 0x2c ; 44 32d6c: 70 96 adiw r30, 0x10 ; 16 32d6e: ac 96 adiw r28, 0x2c ; 44 32d70: ff af std Y+63, r31 ; 0x3f 32d72: ee af std Y+62, r30 ; 0x3e 32d74: ac 97 sbiw r28, 0x2c ; 44 32d76: 04 30 cpi r16, 0x04 ; 4 32d78: 09 f0 breq .+2 ; 0x32d7c 32d7a: 21 ce rjmp .-958 ; 0x329be } // 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]; 32d7c: 25 96 adiw r28, 0x05 ; 5 32d7e: 2c ad ldd r18, Y+60 ; 0x3c 32d80: 3d ad ldd r19, Y+61 ; 0x3d 32d82: 4e ad ldd r20, Y+62 ; 0x3e 32d84: 5f ad ldd r21, Y+63 ; 0x3f 32d86: 25 97 sbiw r28, 0x05 ; 5 32d88: ae 96 adiw r28, 0x2e ; 46 32d8a: 2c af std Y+60, r18 ; 0x3c 32d8c: 3d af std Y+61, r19 ; 0x3d 32d8e: 4e af std Y+62, r20 ; 0x3e 32d90: 5f af std Y+63, r21 ; 0x3f 32d92: ae 97 sbiw r28, 0x2e ; 46 32d94: 8d 81 ldd r24, Y+5 ; 0x05 32d96: 9e 81 ldd r25, Y+6 ; 0x06 32d98: af 81 ldd r26, Y+7 ; 0x07 32d9a: b8 85 ldd r27, Y+8 ; 0x08 32d9c: e4 96 adiw r28, 0x34 ; 52 32d9e: 8c af std Y+60, r24 ; 0x3c 32da0: 9d af std Y+61, r25 ; 0x3d 32da2: ae af std Y+62, r26 ; 0x3e 32da4: bf af std Y+63, r27 ; 0x3f 32da6: e4 97 sbiw r28, 0x34 ; 52 32da8: 29 85 ldd r18, Y+9 ; 0x09 32daa: 3a 85 ldd r19, Y+10 ; 0x0a 32dac: 4b 85 ldd r20, Y+11 ; 0x0b 32dae: 5c 85 ldd r21, Y+12 ; 0x0c 32db0: ed 96 adiw r28, 0x3d ; 61 32db2: 2c af std Y+60, r18 ; 0x3c 32db4: 3d af std Y+61, r19 ; 0x3d 32db6: 4e af std Y+62, r20 ; 0x3e 32db8: 5f af std Y+63, r21 ; 0x3f 32dba: ed 97 sbiw r28, 0x3d ; 61 32dbc: 8d 85 ldd r24, Y+13 ; 0x0d 32dbe: 9e 85 ldd r25, Y+14 ; 0x0e 32dc0: af 85 ldd r26, Y+15 ; 0x0f 32dc2: b8 89 ldd r27, Y+16 ; 0x10 32dc4: c3 58 subi r28, 0x83 ; 131 32dc6: df 4f sbci r29, 0xFF ; 255 32dc8: 88 83 st Y, r24 32dca: 99 83 std Y+1, r25 ; 0x01 32dcc: aa 83 std Y+2, r26 ; 0x02 32dce: bb 83 std Y+3, r27 ; 0x03 32dd0: cd 57 subi r28, 0x7D ; 125 32dd2: d0 40 sbci r29, 0x00 ; 0 32dd4: 29 81 ldd r18, Y+1 ; 0x01 32dd6: 3a 81 ldd r19, Y+2 ; 0x02 32dd8: 4b 81 ldd r20, Y+3 ; 0x03 32dda: 5c 81 ldd r21, Y+4 ; 0x04 32ddc: cf 57 subi r28, 0x7F ; 127 32dde: df 4f sbci r29, 0xFF ; 255 32de0: 28 83 st Y, r18 32de2: 39 83 std Y+1, r19 ; 0x01 32de4: 4a 83 std Y+2, r20 ; 0x02 32de6: 5b 83 std Y+3, r21 ; 0x03 32de8: c1 58 subi r28, 0x81 ; 129 32dea: 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]; 32dec: 29 96 adiw r28, 0x09 ; 9 32dee: 8c ad ldd r24, Y+60 ; 0x3c 32df0: 9d ad ldd r25, Y+61 ; 0x3d 32df2: ae ad ldd r26, Y+62 ; 0x3e 32df4: bf ad ldd r27, Y+63 ; 0x3f 32df6: 29 97 sbiw r28, 0x09 ; 9 32df8: cb 57 subi r28, 0x7B ; 123 32dfa: df 4f sbci r29, 0xFF ; 255 32dfc: 88 83 st Y, r24 32dfe: 99 83 std Y+1, r25 ; 0x01 32e00: aa 83 std Y+2, r26 ; 0x02 32e02: bb 83 std Y+3, r27 ; 0x03 32e04: c5 58 subi r28, 0x85 ; 133 32e06: d0 40 sbci r29, 0x00 ; 0 32e08: 29 89 ldd r18, Y+17 ; 0x11 32e0a: 3a 89 ldd r19, Y+18 ; 0x12 32e0c: 4b 89 ldd r20, Y+19 ; 0x13 32e0e: 5c 89 ldd r21, Y+20 ; 0x14 32e10: c7 57 subi r28, 0x77 ; 119 32e12: df 4f sbci r29, 0xFF ; 255 32e14: 28 83 st Y, r18 32e16: 39 83 std Y+1, r19 ; 0x01 32e18: 4a 83 std Y+2, r20 ; 0x02 32e1a: 5b 83 std Y+3, r21 ; 0x03 32e1c: c9 58 subi r28, 0x89 ; 137 32e1e: d0 40 sbci r29, 0x00 ; 0 32e20: 89 8d ldd r24, Y+25 ; 0x19 32e22: 9a 8d ldd r25, Y+26 ; 0x1a 32e24: ab 8d ldd r26, Y+27 ; 0x1b 32e26: bc 8d ldd r27, Y+28 ; 0x1c 32e28: cb 56 subi r28, 0x6B ; 107 32e2a: df 4f sbci r29, 0xFF ; 255 32e2c: 88 83 st Y, r24 32e2e: 99 83 std Y+1, r25 ; 0x01 32e30: aa 83 std Y+2, r26 ; 0x02 32e32: bb 83 std Y+3, r27 ; 0x03 32e34: c5 59 subi r28, 0x95 ; 149 32e36: d0 40 sbci r29, 0x00 ; 0 32e38: 2d 8d ldd r18, Y+29 ; 0x1d 32e3a: 3e 8d ldd r19, Y+30 ; 0x1e 32e3c: 4f 8d ldd r20, Y+31 ; 0x1f 32e3e: 58 a1 ldd r21, Y+32 ; 0x20 32e40: c7 56 subi r28, 0x67 ; 103 32e42: df 4f sbci r29, 0xFF ; 255 32e44: 28 83 st Y, r18 32e46: 39 83 std Y+1, r19 ; 0x01 32e48: 4a 83 std Y+2, r20 ; 0x02 32e4a: 5b 83 std Y+3, r21 ; 0x03 32e4c: c9 59 subi r28, 0x99 ; 153 32e4e: d0 40 sbci r29, 0x00 ; 0 32e50: 8d 89 ldd r24, Y+21 ; 0x15 32e52: 9e 89 ldd r25, Y+22 ; 0x16 32e54: af 89 ldd r26, Y+23 ; 0x17 32e56: b8 8d ldd r27, Y+24 ; 0x18 32e58: c3 57 subi r28, 0x73 ; 115 32e5a: df 4f sbci r29, 0xFF ; 255 32e5c: 88 83 st Y, r24 32e5e: 99 83 std Y+1, r25 ; 0x01 32e60: aa 83 std Y+2, r26 ; 0x02 32e62: bb 83 std Y+3, r27 ; 0x03 32e64: cd 58 subi r28, 0x8D ; 141 32e66: 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]; 32e68: 2d 96 adiw r28, 0x0d ; 13 32e6a: 2c ad ldd r18, Y+60 ; 0x3c 32e6c: 3d ad ldd r19, Y+61 ; 0x3d 32e6e: 4e ad ldd r20, Y+62 ; 0x3e 32e70: 5f ad ldd r21, Y+63 ; 0x3f 32e72: 2d 97 sbiw r28, 0x0d ; 13 32e74: c3 56 subi r28, 0x63 ; 99 32e76: df 4f sbci r29, 0xFF ; 255 32e78: 28 83 st Y, r18 32e7a: 39 83 std Y+1, r19 ; 0x01 32e7c: 4a 83 std Y+2, r20 ; 0x02 32e7e: 5b 83 std Y+3, r21 ; 0x03 32e80: cd 59 subi r28, 0x9D ; 157 32e82: d0 40 sbci r29, 0x00 ; 0 32e84: 89 a1 ldd r24, Y+33 ; 0x21 32e86: 9a a1 ldd r25, Y+34 ; 0x22 32e88: ab a1 ldd r26, Y+35 ; 0x23 32e8a: bc a1 ldd r27, Y+36 ; 0x24 32e8c: cf 55 subi r28, 0x5F ; 95 32e8e: df 4f sbci r29, 0xFF ; 255 32e90: 88 83 st Y, r24 32e92: 99 83 std Y+1, r25 ; 0x01 32e94: aa 83 std Y+2, r26 ; 0x02 32e96: bb 83 std Y+3, r27 ; 0x03 32e98: c1 5a subi r28, 0xA1 ; 161 32e9a: d0 40 sbci r29, 0x00 ; 0 32e9c: 2d a1 ldd r18, Y+37 ; 0x25 32e9e: 3e a1 ldd r19, Y+38 ; 0x26 32ea0: 4f a1 ldd r20, Y+39 ; 0x27 32ea2: 58 a5 ldd r21, Y+40 ; 0x28 32ea4: cb 55 subi r28, 0x5B ; 91 32ea6: df 4f sbci r29, 0xFF ; 255 32ea8: 28 83 st Y, r18 32eaa: 39 83 std Y+1, r19 ; 0x01 32eac: 4a 83 std Y+2, r20 ; 0x02 32eae: 5b 83 std Y+3, r21 ; 0x03 32eb0: c5 5a subi r28, 0xA5 ; 165 32eb2: d0 40 sbci r29, 0x00 ; 0 32eb4: 8d a5 ldd r24, Y+45 ; 0x2d 32eb6: 9e a5 ldd r25, Y+46 ; 0x2e 32eb8: af a5 ldd r26, Y+47 ; 0x2f 32eba: b8 a9 ldd r27, Y+48 ; 0x30 32ebc: cd 54 subi r28, 0x4D ; 77 32ebe: df 4f sbci r29, 0xFF ; 255 32ec0: 88 83 st Y, r24 32ec2: 99 83 std Y+1, r25 ; 0x01 32ec4: aa 83 std Y+2, r26 ; 0x02 32ec6: bb 83 std Y+3, r27 ; 0x03 32ec8: c3 5b subi r28, 0xB3 ; 179 32eca: d0 40 sbci r29, 0x00 ; 0 32ecc: 29 a5 ldd r18, Y+41 ; 0x29 32ece: 3a a5 ldd r19, Y+42 ; 0x2a 32ed0: 4b a5 ldd r20, Y+43 ; 0x2b 32ed2: 5c a5 ldd r21, Y+44 ; 0x2c 32ed4: c9 54 subi r28, 0x49 ; 73 32ed6: df 4f sbci r29, 0xFF ; 255 32ed8: 28 83 st Y, r18 32eda: 39 83 std Y+1, r19 ; 0x01 32edc: 4a 83 std Y+2, r20 ; 0x02 32ede: 5b 83 std Y+3, r21 ; 0x03 32ee0: c7 5b subi r28, 0xB7 ; 183 32ee2: 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]; 32ee4: 61 96 adiw r28, 0x11 ; 17 32ee6: 8c ad ldd r24, Y+60 ; 0x3c 32ee8: 9d ad ldd r25, Y+61 ; 0x3d 32eea: ae ad ldd r26, Y+62 ; 0x3e 32eec: bf ad ldd r27, Y+63 ; 0x3f 32eee: 61 97 sbiw r28, 0x11 ; 17 32ef0: c5 54 subi r28, 0x45 ; 69 32ef2: df 4f sbci r29, 0xFF ; 255 32ef4: 88 83 st Y, r24 32ef6: 99 83 std Y+1, r25 ; 0x01 32ef8: aa 83 std Y+2, r26 ; 0x02 32efa: bb 83 std Y+3, r27 ; 0x03 32efc: cb 5b subi r28, 0xBB ; 187 32efe: d0 40 sbci r29, 0x00 ; 0 32f00: 29 a9 ldd r18, Y+49 ; 0x31 32f02: 3a a9 ldd r19, Y+50 ; 0x32 32f04: 4b a9 ldd r20, Y+51 ; 0x33 32f06: 5c a9 ldd r21, Y+52 ; 0x34 32f08: c1 54 subi r28, 0x41 ; 65 32f0a: df 4f sbci r29, 0xFF ; 255 32f0c: 28 83 st Y, r18 32f0e: 39 83 std Y+1, r19 ; 0x01 32f10: 4a 83 std Y+2, r20 ; 0x02 32f12: 5b 83 std Y+3, r21 ; 0x03 32f14: cf 5b subi r28, 0xBF ; 191 32f16: d0 40 sbci r29, 0x00 ; 0 32f18: 8d a9 ldd r24, Y+53 ; 0x35 32f1a: 9e a9 ldd r25, Y+54 ; 0x36 32f1c: af a9 ldd r26, Y+55 ; 0x37 32f1e: b8 ad ldd r27, Y+56 ; 0x38 32f20: cd 53 subi r28, 0x3D ; 61 32f22: df 4f sbci r29, 0xFF ; 255 32f24: 88 83 st Y, r24 32f26: 99 83 std Y+1, r25 ; 0x01 32f28: aa 83 std Y+2, r26 ; 0x02 32f2a: bb 83 std Y+3, r27 ; 0x03 32f2c: c3 5c subi r28, 0xC3 ; 195 32f2e: d0 40 sbci r29, 0x00 ; 0 32f30: 29 ad ldd r18, Y+57 ; 0x39 32f32: 3a ad ldd r19, Y+58 ; 0x3a 32f34: 4b ad ldd r20, Y+59 ; 0x3b 32f36: 5c ad ldd r21, Y+60 ; 0x3c 32f38: c9 53 subi r28, 0x39 ; 57 32f3a: df 4f sbci r29, 0xFF ; 255 32f3c: 28 83 st Y, r18 32f3e: 39 83 std Y+1, r19 ; 0x01 32f40: 4a 83 std Y+2, r20 ; 0x02 32f42: 5b 83 std Y+3, r21 ; 0x03 32f44: c7 5c subi r28, 0xC7 ; 199 32f46: d0 40 sbci r29, 0x00 ; 0 32f48: 21 96 adiw r28, 0x01 ; 1 32f4a: 8c ad ldd r24, Y+60 ; 0x3c 32f4c: 9d ad ldd r25, Y+61 ; 0x3d 32f4e: ae ad ldd r26, Y+62 ; 0x3e 32f50: bf ad ldd r27, Y+63 ; 0x3f 32f52: 21 97 sbiw r28, 0x01 ; 1 32f54: c5 53 subi r28, 0x35 ; 53 32f56: df 4f sbci r29, 0xFF ; 255 32f58: 88 83 st Y, r24 32f5a: 99 83 std Y+1, r25 ; 0x01 32f5c: aa 83 std Y+2, r26 ; 0x02 32f5e: bb 83 std Y+3, r27 ; 0x03 32f60: cb 5c subi r28, 0xCB ; 203 32f62: d0 40 sbci r29, 0x00 ; 0 32f64: 14 e6 ldi r17, 0x64 ; 100 } b[r] = -acc; } // Solve for h by a Gauss iteration method. float h[4] = { 0.f }; 32f66: c1 2c mov r12, r1 32f68: d1 2c mov r13, r1 32f6a: 76 01 movw r14, r12 32f6c: 46 01 movw r8, r12 32f6e: 57 01 movw r10, r14 32f70: 26 01 movw r4, r12 32f72: 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]; 32f74: a3 01 movw r20, r6 32f76: 92 01 movw r18, r4 32f78: e4 96 adiw r28, 0x34 ; 52 32f7a: 6c ad ldd r22, Y+60 ; 0x3c 32f7c: 7d ad ldd r23, Y+61 ; 0x3d 32f7e: 8e ad ldd r24, Y+62 ; 0x3e 32f80: 9f ad ldd r25, Y+63 ; 0x3f 32f82: e4 97 sbiw r28, 0x34 ; 52 32f84: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 32f88: 9b 01 movw r18, r22 32f8a: ac 01 movw r20, r24 32f8c: ae 96 adiw r28, 0x2e ; 46 32f8e: 6c ad ldd r22, Y+60 ; 0x3c 32f90: 7d ad ldd r23, Y+61 ; 0x3d 32f92: 8e ad ldd r24, Y+62 ; 0x3e 32f94: 9f ad ldd r25, Y+63 ; 0x3f 32f96: ae 97 sbiw r28, 0x2e ; 46 32f98: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 32f9c: 2b 01 movw r4, r22 32f9e: 3c 01 movw r6, r24 32fa0: a5 01 movw r20, r10 32fa2: 94 01 movw r18, r8 32fa4: ed 96 adiw r28, 0x3d ; 61 32fa6: 6c ad ldd r22, Y+60 ; 0x3c 32fa8: 7d ad ldd r23, Y+61 ; 0x3d 32faa: 8e ad ldd r24, Y+62 ; 0x3e 32fac: 9f ad ldd r25, Y+63 ; 0x3f 32fae: ed 97 sbiw r28, 0x3d ; 61 32fb0: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 32fb4: 9b 01 movw r18, r22 32fb6: ac 01 movw r20, r24 32fb8: c3 01 movw r24, r6 32fba: b2 01 movw r22, r4 32fbc: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 32fc0: 2b 01 movw r4, r22 32fc2: 3c 01 movw r6, r24 32fc4: a7 01 movw r20, r14 32fc6: 96 01 movw r18, r12 32fc8: c3 58 subi r28, 0x83 ; 131 32fca: df 4f sbci r29, 0xFF ; 255 32fcc: 68 81 ld r22, Y 32fce: 79 81 ldd r23, Y+1 ; 0x01 32fd0: 8a 81 ldd r24, Y+2 ; 0x02 32fd2: 9b 81 ldd r25, Y+3 ; 0x03 32fd4: cd 57 subi r28, 0x7D ; 125 32fd6: d0 40 sbci r29, 0x00 ; 0 32fd8: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 32fdc: 9b 01 movw r18, r22 32fde: ac 01 movw r20, r24 32fe0: c3 01 movw r24, r6 32fe2: b2 01 movw r22, r4 32fe4: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 32fe8: cf 57 subi r28, 0x7F ; 127 32fea: df 4f sbci r29, 0xFF ; 255 32fec: 28 81 ld r18, Y 32fee: 39 81 ldd r19, Y+1 ; 0x01 32ff0: 4a 81 ldd r20, Y+2 ; 0x02 32ff2: 5b 81 ldd r21, Y+3 ; 0x03 32ff4: c1 58 subi r28, 0x81 ; 129 32ff6: d0 40 sbci r29, 0x00 ; 0 32ff8: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 32ffc: 6e 96 adiw r28, 0x1e ; 30 32ffe: 6c af std Y+60, r22 ; 0x3c 33000: 7d af std Y+61, r23 ; 0x3d 33002: 8e af std Y+62, r24 ; 0x3e 33004: 9f af std Y+63, r25 ; 0x3f 33006: 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]; 33008: c7 57 subi r28, 0x77 ; 119 3300a: df 4f sbci r29, 0xFF ; 255 3300c: 28 81 ld r18, Y 3300e: 39 81 ldd r19, Y+1 ; 0x01 33010: 4a 81 ldd r20, Y+2 ; 0x02 33012: 5b 81 ldd r21, Y+3 ; 0x03 33014: c9 58 subi r28, 0x89 ; 137 33016: d0 40 sbci r29, 0x00 ; 0 33018: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 3301c: 9b 01 movw r18, r22 3301e: ac 01 movw r20, r24 33020: cb 57 subi r28, 0x7B ; 123 33022: df 4f sbci r29, 0xFF ; 255 33024: 68 81 ld r22, Y 33026: 79 81 ldd r23, Y+1 ; 0x01 33028: 8a 81 ldd r24, Y+2 ; 0x02 3302a: 9b 81 ldd r25, Y+3 ; 0x03 3302c: c5 58 subi r28, 0x85 ; 133 3302e: d0 40 sbci r29, 0x00 ; 0 33030: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 33034: 2b 01 movw r4, r22 33036: 3c 01 movw r6, r24 33038: a5 01 movw r20, r10 3303a: 94 01 movw r18, r8 3303c: cb 56 subi r28, 0x6B ; 107 3303e: df 4f sbci r29, 0xFF ; 255 33040: 68 81 ld r22, Y 33042: 79 81 ldd r23, Y+1 ; 0x01 33044: 8a 81 ldd r24, Y+2 ; 0x02 33046: 9b 81 ldd r25, Y+3 ; 0x03 33048: c5 59 subi r28, 0x95 ; 149 3304a: d0 40 sbci r29, 0x00 ; 0 3304c: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 33050: 9b 01 movw r18, r22 33052: ac 01 movw r20, r24 33054: c3 01 movw r24, r6 33056: b2 01 movw r22, r4 33058: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 3305c: 4b 01 movw r8, r22 3305e: 5c 01 movw r10, r24 33060: a7 01 movw r20, r14 33062: 96 01 movw r18, r12 33064: c7 56 subi r28, 0x67 ; 103 33066: df 4f sbci r29, 0xFF ; 255 33068: 68 81 ld r22, Y 3306a: 79 81 ldd r23, Y+1 ; 0x01 3306c: 8a 81 ldd r24, Y+2 ; 0x02 3306e: 9b 81 ldd r25, Y+3 ; 0x03 33070: c9 59 subi r28, 0x99 ; 153 33072: d0 40 sbci r29, 0x00 ; 0 33074: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 33078: 9b 01 movw r18, r22 3307a: ac 01 movw r20, r24 3307c: c5 01 movw r24, r10 3307e: b4 01 movw r22, r8 33080: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 33084: c3 57 subi r28, 0x73 ; 115 33086: df 4f sbci r29, 0xFF ; 255 33088: 28 81 ld r18, Y 3308a: 39 81 ldd r19, Y+1 ; 0x01 3308c: 4a 81 ldd r20, Y+2 ; 0x02 3308e: 5b 81 ldd r21, Y+3 ; 0x03 33090: cd 58 subi r28, 0x8D ; 141 33092: d0 40 sbci r29, 0x00 ; 0 33094: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 33098: 2b 01 movw r4, r22 3309a: 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]; 3309c: cf 55 subi r28, 0x5F ; 95 3309e: df 4f sbci r29, 0xFF ; 255 330a0: 28 81 ld r18, Y 330a2: 39 81 ldd r19, Y+1 ; 0x01 330a4: 4a 81 ldd r20, Y+2 ; 0x02 330a6: 5b 81 ldd r21, Y+3 ; 0x03 330a8: c1 5a subi r28, 0xA1 ; 161 330aa: d0 40 sbci r29, 0x00 ; 0 330ac: 6e 96 adiw r28, 0x1e ; 30 330ae: 6c ad ldd r22, Y+60 ; 0x3c 330b0: 7d ad ldd r23, Y+61 ; 0x3d 330b2: 8e ad ldd r24, Y+62 ; 0x3e 330b4: 9f ad ldd r25, Y+63 ; 0x3f 330b6: 6e 97 sbiw r28, 0x1e ; 30 330b8: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 330bc: 9b 01 movw r18, r22 330be: ac 01 movw r20, r24 330c0: c3 56 subi r28, 0x63 ; 99 330c2: df 4f sbci r29, 0xFF ; 255 330c4: 68 81 ld r22, Y 330c6: 79 81 ldd r23, Y+1 ; 0x01 330c8: 8a 81 ldd r24, Y+2 ; 0x02 330ca: 9b 81 ldd r25, Y+3 ; 0x03 330cc: cd 59 subi r28, 0x9D ; 157 330ce: d0 40 sbci r29, 0x00 ; 0 330d0: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 330d4: 4b 01 movw r8, r22 330d6: 5c 01 movw r10, r24 330d8: cb 55 subi r28, 0x5B ; 91 330da: df 4f sbci r29, 0xFF ; 255 330dc: 28 81 ld r18, Y 330de: 39 81 ldd r19, Y+1 ; 0x01 330e0: 4a 81 ldd r20, Y+2 ; 0x02 330e2: 5b 81 ldd r21, Y+3 ; 0x03 330e4: c5 5a subi r28, 0xA5 ; 165 330e6: d0 40 sbci r29, 0x00 ; 0 330e8: c3 01 movw r24, r6 330ea: b2 01 movw r22, r4 330ec: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 330f0: 9b 01 movw r18, r22 330f2: ac 01 movw r20, r24 330f4: c5 01 movw r24, r10 330f6: b4 01 movw r22, r8 330f8: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 330fc: 4b 01 movw r8, r22 330fe: 5c 01 movw r10, r24 33100: a7 01 movw r20, r14 33102: 96 01 movw r18, r12 33104: cd 54 subi r28, 0x4D ; 77 33106: df 4f sbci r29, 0xFF ; 255 33108: 68 81 ld r22, Y 3310a: 79 81 ldd r23, Y+1 ; 0x01 3310c: 8a 81 ldd r24, Y+2 ; 0x02 3310e: 9b 81 ldd r25, Y+3 ; 0x03 33110: c3 5b subi r28, 0xB3 ; 179 33112: d0 40 sbci r29, 0x00 ; 0 33114: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 33118: 9b 01 movw r18, r22 3311a: ac 01 movw r20, r24 3311c: c5 01 movw r24, r10 3311e: b4 01 movw r22, r8 33120: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 33124: c9 54 subi r28, 0x49 ; 73 33126: df 4f sbci r29, 0xFF ; 255 33128: 28 81 ld r18, Y 3312a: 39 81 ldd r19, Y+1 ; 0x01 3312c: 4a 81 ldd r20, Y+2 ; 0x02 3312e: 5b 81 ldd r21, Y+3 ; 0x03 33130: c7 5b subi r28, 0xB7 ; 183 33132: d0 40 sbci r29, 0x00 ; 0 33134: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 33138: 4b 01 movw r8, r22 3313a: 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]; 3313c: c1 54 subi r28, 0x41 ; 65 3313e: df 4f sbci r29, 0xFF ; 255 33140: 28 81 ld r18, Y 33142: 39 81 ldd r19, Y+1 ; 0x01 33144: 4a 81 ldd r20, Y+2 ; 0x02 33146: 5b 81 ldd r21, Y+3 ; 0x03 33148: cf 5b subi r28, 0xBF ; 191 3314a: d0 40 sbci r29, 0x00 ; 0 3314c: 6e 96 adiw r28, 0x1e ; 30 3314e: 6c ad ldd r22, Y+60 ; 0x3c 33150: 7d ad ldd r23, Y+61 ; 0x3d 33152: 8e ad ldd r24, Y+62 ; 0x3e 33154: 9f ad ldd r25, Y+63 ; 0x3f 33156: 6e 97 sbiw r28, 0x1e ; 30 33158: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 3315c: 9b 01 movw r18, r22 3315e: ac 01 movw r20, r24 33160: c5 54 subi r28, 0x45 ; 69 33162: df 4f sbci r29, 0xFF ; 255 33164: 68 81 ld r22, Y 33166: 79 81 ldd r23, Y+1 ; 0x01 33168: 8a 81 ldd r24, Y+2 ; 0x02 3316a: 9b 81 ldd r25, Y+3 ; 0x03 3316c: cb 5b subi r28, 0xBB ; 187 3316e: d0 40 sbci r29, 0x00 ; 0 33170: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 33174: 6b 01 movw r12, r22 33176: 7c 01 movw r14, r24 33178: cd 53 subi r28, 0x3D ; 61 3317a: df 4f sbci r29, 0xFF ; 255 3317c: 28 81 ld r18, Y 3317e: 39 81 ldd r19, Y+1 ; 0x01 33180: 4a 81 ldd r20, Y+2 ; 0x02 33182: 5b 81 ldd r21, Y+3 ; 0x03 33184: c3 5c subi r28, 0xC3 ; 195 33186: d0 40 sbci r29, 0x00 ; 0 33188: c3 01 movw r24, r6 3318a: b2 01 movw r22, r4 3318c: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 33190: 9b 01 movw r18, r22 33192: ac 01 movw r20, r24 33194: c7 01 movw r24, r14 33196: b6 01 movw r22, r12 33198: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 3319c: 6b 01 movw r12, r22 3319e: 7c 01 movw r14, r24 331a0: c9 53 subi r28, 0x39 ; 57 331a2: df 4f sbci r29, 0xFF ; 255 331a4: 28 81 ld r18, Y 331a6: 39 81 ldd r19, Y+1 ; 0x01 331a8: 4a 81 ldd r20, Y+2 ; 0x02 331aa: 5b 81 ldd r21, Y+3 ; 0x03 331ac: c7 5c subi r28, 0xC7 ; 199 331ae: d0 40 sbci r29, 0x00 ; 0 331b0: c5 01 movw r24, r10 331b2: b4 01 movw r22, r8 331b4: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 331b8: 9b 01 movw r18, r22 331ba: ac 01 movw r20, r24 331bc: c7 01 movw r24, r14 331be: b6 01 movw r22, r12 331c0: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 331c4: c5 53 subi r28, 0x35 ; 53 331c6: df 4f sbci r29, 0xFF ; 255 331c8: 28 81 ld r18, Y 331ca: 39 81 ldd r19, Y+1 ; 0x01 331cc: 4a 81 ldd r20, Y+2 ; 0x02 331ce: 5b 81 ldd r21, Y+3 ; 0x03 331d0: cb 5c subi r28, 0xCB ; 203 331d2: d0 40 sbci r29, 0x00 ; 0 331d4: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 331d8: 6b 01 movw r12, r22 331da: 7c 01 movw r14, r24 331dc: 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) { 331de: 09 f0 breq .+2 ; 0x331e2 331e0: c9 ce rjmp .-622 ; 0x32f74 // 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]; 331e2: 6e 96 adiw r28, 0x1e ; 30 331e4: 2c ad ldd r18, Y+60 ; 0x3c 331e6: 3d ad ldd r19, Y+61 ; 0x3d 331e8: 4e ad ldd r20, Y+62 ; 0x3e 331ea: 5f ad ldd r21, Y+63 ; 0x3f 331ec: 6e 97 sbiw r28, 0x1e ; 30 331ee: c5 55 subi r28, 0x55 ; 85 331f0: df 4f sbci r29, 0xFF ; 255 331f2: 68 81 ld r22, Y 331f4: 79 81 ldd r23, Y+1 ; 0x01 331f6: 8a 81 ldd r24, Y+2 ; 0x02 331f8: 9b 81 ldd r25, Y+3 ; 0x03 331fa: cb 5a subi r28, 0xAB ; 171 331fc: d0 40 sbci r29, 0x00 ; 0 331fe: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 33202: 60 93 f2 13 sts 0x13F2, r22 ; 0x8013f2 33206: 70 93 f3 13 sts 0x13F3, r23 ; 0x8013f3 3320a: 80 93 f4 13 sts 0x13F4, r24 ; 0x8013f4 3320e: 90 93 f5 13 sts 0x13F5, r25 ; 0x8013f5 cntr[1] += h[1]; 33212: a3 01 movw r20, r6 33214: 92 01 movw r18, r4 33216: c1 55 subi r28, 0x51 ; 81 33218: df 4f sbci r29, 0xFF ; 255 3321a: 68 81 ld r22, Y 3321c: 79 81 ldd r23, Y+1 ; 0x01 3321e: 8a 81 ldd r24, Y+2 ; 0x02 33220: 9b 81 ldd r25, Y+3 ; 0x03 33222: cf 5a subi r28, 0xAF ; 175 33224: d0 40 sbci r29, 0x00 ; 0 33226: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 3322a: 60 93 f6 13 sts 0x13F6, r22 ; 0x8013f6 3322e: 70 93 f7 13 sts 0x13F7, r23 ; 0x8013f7 33232: 80 93 f8 13 sts 0x13F8, r24 ; 0x8013f8 33236: 90 93 f9 13 sts 0x13F9, r25 ; 0x8013f9 a1 += h[2]; 3323a: a5 01 movw r20, r10 3323c: 94 01 movw r18, r8 3323e: a6 96 adiw r28, 0x26 ; 38 33240: 6c ad ldd r22, Y+60 ; 0x3c 33242: 7d ad ldd r23, Y+61 ; 0x3d 33244: 8e ad ldd r24, Y+62 ; 0x3e 33246: 9f ad ldd r25, Y+63 ; 0x3f 33248: a6 97 sbiw r28, 0x26 ; 38 3324a: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 3324e: a6 96 adiw r28, 0x26 ; 38 33250: 6c af std Y+60, r22 ; 0x3c 33252: 7d af std Y+61, r23 ; 0x3d 33254: 8e af std Y+62, r24 ; 0x3e 33256: 9f af std Y+63, r25 ; 0x3f 33258: a6 97 sbiw r28, 0x26 ; 38 a2 += h[3]; 3325a: a7 01 movw r20, r14 3325c: 96 01 movw r18, r12 3325e: a2 96 adiw r28, 0x22 ; 34 33260: 6c ad ldd r22, Y+60 ; 0x3c 33262: 7d ad ldd r23, Y+61 ; 0x3d 33264: 8e ad ldd r24, Y+62 ; 0x3e 33266: 9f ad ldd r25, Y+63 ; 0x3f 33268: a2 97 sbiw r28, 0x22 ; 34 3326a: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 3326e: a2 96 adiw r28, 0x22 ; 34 33270: 6c af std Y+60, r22 ; 0x3c 33272: 7d af std Y+61, r23 ; 0x3d 33274: 8e af std Y+62, r24 ; 0x3e 33276: 9f af std Y+63, r25 ; 0x3f 33278: a2 97 sbiw r28, 0x22 ; 34 3327a: e6 96 adiw r28, 0x36 ; 54 3327c: 9f ad ldd r25, Y+63 ; 0x3f 3327e: e6 97 sbiw r28, 0x36 ; 54 33280: 91 50 subi r25, 0x01 ; 1 33282: e6 96 adiw r28, 0x36 ; 54 33284: 9f af std Y+63, r25 ; 0x3f 33286: 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) { 33288: 91 11 cpse r25, r1 3328a: e6 ca rjmp .-2612 ; 0x32858 SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY } vec_x[0] = cos(a1) * MACHINE_AXIS_SCALE_X; 3328c: a6 96 adiw r28, 0x26 ; 38 3328e: 6c ad ldd r22, Y+60 ; 0x3c 33290: 7d ad ldd r23, Y+61 ; 0x3d 33292: 8e ad ldd r24, Y+62 ; 0x3e 33294: 9f ad ldd r25, Y+63 ; 0x3f 33296: a6 97 sbiw r28, 0x26 ; 38 33298: 0f 94 f9 dd call 0x3bbf2 ; 0x3bbf2 3329c: 60 93 e2 13 sts 0x13E2, r22 ; 0x8013e2 332a0: 70 93 e3 13 sts 0x13E3, r23 ; 0x8013e3 332a4: 80 93 e4 13 sts 0x13E4, r24 ; 0x8013e4 332a8: 90 93 e5 13 sts 0x13E5, r25 ; 0x8013e5 vec_x[1] = sin(a1) * MACHINE_AXIS_SCALE_X; 332ac: a6 96 adiw r28, 0x26 ; 38 332ae: 6c ad ldd r22, Y+60 ; 0x3c 332b0: 7d ad ldd r23, Y+61 ; 0x3d 332b2: 8e ad ldd r24, Y+62 ; 0x3e 332b4: 9f ad ldd r25, Y+63 ; 0x3f 332b6: a6 97 sbiw r28, 0x26 ; 38 332b8: 0f 94 bf e0 call 0x3c17e ; 0x3c17e 332bc: 60 93 e6 13 sts 0x13E6, r22 ; 0x8013e6 332c0: 70 93 e7 13 sts 0x13E7, r23 ; 0x8013e7 332c4: 80 93 e8 13 sts 0x13E8, r24 ; 0x8013e8 332c8: 90 93 e9 13 sts 0x13E9, r25 ; 0x8013e9 vec_y[0] = -sin(a2) * MACHINE_AXIS_SCALE_Y; 332cc: a2 96 adiw r28, 0x22 ; 34 332ce: 6c ad ldd r22, Y+60 ; 0x3c 332d0: 7d ad ldd r23, Y+61 ; 0x3d 332d2: 8e ad ldd r24, Y+62 ; 0x3e 332d4: 9f ad ldd r25, Y+63 ; 0x3f 332d6: a2 97 sbiw r28, 0x22 ; 34 332d8: 0f 94 bf e0 call 0x3c17e ; 0x3c17e 332dc: 90 58 subi r25, 0x80 ; 128 332de: 60 93 ea 13 sts 0x13EA, r22 ; 0x8013ea 332e2: 70 93 eb 13 sts 0x13EB, r23 ; 0x8013eb 332e6: 80 93 ec 13 sts 0x13EC, r24 ; 0x8013ec 332ea: 90 93 ed 13 sts 0x13ED, r25 ; 0x8013ed vec_y[1] = cos(a2) * MACHINE_AXIS_SCALE_Y; 332ee: a2 96 adiw r28, 0x22 ; 34 332f0: 6c ad ldd r22, Y+60 ; 0x3c 332f2: 7d ad ldd r23, Y+61 ; 0x3d 332f4: 8e ad ldd r24, Y+62 ; 0x3e 332f6: 9f ad ldd r25, Y+63 ; 0x3f 332f8: a2 97 sbiw r28, 0x22 ; 34 332fa: 0f 94 f9 dd call 0x3bbf2 ; 0x3bbf2 332fe: 60 93 ee 13 sts 0x13EE, r22 ; 0x8013ee 33302: 70 93 ef 13 sts 0x13EF, r23 ; 0x8013ef 33306: 80 93 f0 13 sts 0x13F0, r24 ; 0x8013f0 3330a: 90 93 f1 13 sts 0x13F1, r25 ; 0x8013f1 BedSkewOffsetDetectionResultType result = BED_SKEW_OFFSET_DETECTION_PERFECT; { angleDiff = fabs(a2 - a1); 3330e: a6 96 adiw r28, 0x26 ; 38 33310: 2c ad ldd r18, Y+60 ; 0x3c 33312: 3d ad ldd r19, Y+61 ; 0x3d 33314: 4e ad ldd r20, Y+62 ; 0x3e 33316: 5f ad ldd r21, Y+63 ; 0x3f 33318: a6 97 sbiw r28, 0x26 ; 38 3331a: a2 96 adiw r28, 0x22 ; 34 3331c: 6c ad ldd r22, Y+60 ; 0x3c 3331e: 7d ad ldd r23, Y+61 ; 0x3d 33320: 8e ad ldd r24, Y+62 ; 0x3e 33322: 9f ad ldd r25, Y+63 ; 0x3f 33324: a2 97 sbiw r28, 0x22 ; 34 33326: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 3332a: 4b 01 movw r8, r22 3332c: 5c 01 movw r10, r24 3332e: 7c 01 movw r14, r24 33330: 6b 01 movw r12, r22 33332: e8 94 clt 33334: f7 f8 bld r15, 7 /// XY skew and Y-bed skew DBG(_n("Measured skews: %f %f\n"), degrees(a2 - a1), degrees(a2)); 33336: 21 ee ldi r18, 0xE1 ; 225 33338: 3e e2 ldi r19, 0x2E ; 46 3333a: 45 e6 ldi r20, 0x65 ; 101 3333c: 52 e4 ldi r21, 0x42 ; 66 3333e: a2 96 adiw r28, 0x22 ; 34 33340: 6c ad ldd r22, Y+60 ; 0x3c 33342: 7d ad ldd r23, Y+61 ; 0x3d 33344: 8e ad ldd r24, Y+62 ; 0x3e 33346: 9f ad ldd r25, Y+63 ; 0x3f 33348: a2 97 sbiw r28, 0x22 ; 34 3334a: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 3334e: 9f 93 push r25 33350: 8f 93 push r24 33352: 7f 93 push r23 33354: 6f 93 push r22 33356: 21 ee ldi r18, 0xE1 ; 225 33358: 3e e2 ldi r19, 0x2E ; 46 3335a: 45 e6 ldi r20, 0x65 ; 101 3335c: 52 e4 ldi r21, 0x42 ; 66 3335e: c5 01 movw r24, r10 33360: b4 01 movw r22, r8 33362: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 33366: 9f 93 push r25 33368: 8f 93 push r24 3336a: 7f 93 push r23 3336c: 6f 93 push r22 3336e: 85 e3 ldi r24, 0x35 ; 53 33370: 90 e7 ldi r25, 0x70 ; 112 33372: 9f 93 push r25 33374: 8f 93 push r24 33376: 0f 94 99 da call 0x3b532 ; 0x3b532 if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 3337a: b7 01 movw r22, r14 3337c: a6 01 movw r20, r12 3337e: 80 e6 ldi r24, 0x60 ; 96 33380: 9f e0 ldi r25, 0x0F ; 15 33382: 0f 94 0d dc call 0x3b81a ; 0x3b81a 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) 33386: 0f b6 in r0, 0x3f ; 63 33388: f8 94 cli 3338a: de bf out 0x3e, r29 ; 62 3338c: 0f be out 0x3f, r0 ; 63 3338e: cd bf out 0x3d, r28 ; 61 33390: 2f e1 ldi r18, 0x1F ; 31 33392: 32 e4 ldi r19, 0x42 ; 66 33394: 49 e0 ldi r20, 0x09 ; 9 33396: 5b e3 ldi r21, 0x3B ; 59 33398: c7 01 movw r24, r14 3339a: b6 01 movw r22, r12 3339c: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__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; 333a0: 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) 333a2: 18 16 cp r1, r24 333a4: 64 f4 brge .+24 ; 0x333be result = (angleDiff > bed_skew_angle_extreme) ? 333a6: 25 e3 ldi r18, 0x35 ; 53 333a8: 3a ef ldi r19, 0xFA ; 250 333aa: 4e e8 ldi r20, 0x8E ; 142 333ac: 5b e3 ldi r21, 0x3B ; 59 333ae: c7 01 movw r24, r14 333b0: b6 01 movw r22, r12 333b2: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 333b6: 12 e0 ldi r17, 0x02 ; 2 333b8: 18 16 cp r1, r24 333ba: 0c f0 brlt .+2 ; 0x333be 333bc: 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 || 333be: 25 e3 ldi r18, 0x35 ; 53 333c0: 3a ef ldi r19, 0xFA ; 250 333c2: 4e e8 ldi r20, 0x8E ; 142 333c4: 5b e3 ldi r21, 0x3B ; 59 333c6: a6 96 adiw r28, 0x26 ; 38 333c8: 6c ad ldd r22, Y+60 ; 0x3c 333ca: 7d ad ldd r23, Y+61 ; 0x3d 333cc: 8e ad ldd r24, Y+62 ; 0x3e 333ce: 9f ad ldd r25, Y+63 ; 0x3f 333d0: a6 97 sbiw r28, 0x26 ; 38 333d2: 9f 77 andi r25, 0x7F ; 127 333d4: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 333d8: 18 16 cp r1, r24 333da: 0c f4 brge .+2 ; 0x333de 333dc: 67 c4 rjmp .+2254 ; 0x33cac 333de: 25 e3 ldi r18, 0x35 ; 53 333e0: 3a ef ldi r19, 0xFA ; 250 333e2: 4e e8 ldi r20, 0x8E ; 142 333e4: 5b e3 ldi r21, 0x3B ; 59 333e6: a2 96 adiw r28, 0x22 ; 34 333e8: 6c ad ldd r22, Y+60 ; 0x3c 333ea: 7d ad ldd r23, Y+61 ; 0x3d 333ec: 8e ad ldd r24, Y+62 ; 0x3e 333ee: 9f ad ldd r25, Y+63 ; 0x3f 333f0: a2 97 sbiw r28, 0x22 ; 34 333f2: 9f 77 andi r25, 0x7F ; 127 333f4: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 333f8: 18 16 cp r1, r24 333fa: 0c f4 brge .+2 ; 0x333fe 333fc: 57 c4 rjmp .+2222 ; 0x33cac 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]; 333fe: 20 91 e2 13 lds r18, 0x13E2 ; 0x8013e2 33402: 30 91 e3 13 lds r19, 0x13E3 ; 0x8013e3 33406: 40 91 e4 13 lds r20, 0x13E4 ; 0x8013e4 3340a: 50 91 e5 13 lds r21, 0x13E5 ; 0x8013e5 3340e: ae 96 adiw r28, 0x2e ; 46 33410: 2c af std Y+60, r18 ; 0x3c 33412: 3d af std Y+61, r19 ; 0x3d 33414: 4e af std Y+62, r20 ; 0x3e 33416: 5f af std Y+63, r21 ; 0x3f 33418: ae 97 sbiw r28, 0x2e ; 46 3341a: 80 91 ea 13 lds r24, 0x13EA ; 0x8013ea 3341e: 90 91 eb 13 lds r25, 0x13EB ; 0x8013eb 33422: a0 91 ec 13 lds r26, 0x13EC ; 0x8013ec 33426: b0 91 ed 13 lds r27, 0x13ED ; 0x8013ed 3342a: e9 96 adiw r28, 0x39 ; 57 3342c: 8c af std Y+60, r24 ; 0x3c 3342e: 9d af std Y+61, r25 ; 0x3d 33430: ae af std Y+62, r26 ; 0x3e 33432: bf af std Y+63, r27 ; 0x3f 33434: e9 97 sbiw r28, 0x39 ; 57 33436: 20 91 f2 13 lds r18, 0x13F2 ; 0x8013f2 3343a: 30 91 f3 13 lds r19, 0x13F3 ; 0x8013f3 3343e: 40 91 f4 13 lds r20, 0x13F4 ; 0x8013f4 33442: 50 91 f5 13 lds r21, 0x13F5 ; 0x8013f5 33446: e4 96 adiw r28, 0x34 ; 52 33448: 2c af std Y+60, r18 ; 0x3c 3344a: 3d af std Y+61, r19 ; 0x3d 3344c: 4e af std Y+62, r20 ; 0x3e 3344e: 5f af std Y+63, r21 ; 0x3f 33450: 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]; 33452: 80 91 e6 13 lds r24, 0x13E6 ; 0x8013e6 33456: 90 91 e7 13 lds r25, 0x13E7 ; 0x8013e7 3345a: a0 91 e8 13 lds r26, 0x13E8 ; 0x8013e8 3345e: b0 91 e9 13 lds r27, 0x13E9 ; 0x8013e9 33462: ed 96 adiw r28, 0x3d ; 61 33464: 8c af std Y+60, r24 ; 0x3c 33466: 9d af std Y+61, r25 ; 0x3d 33468: ae af std Y+62, r26 ; 0x3e 3346a: bf af std Y+63, r27 ; 0x3f 3346c: ed 97 sbiw r28, 0x3d ; 61 3346e: 20 91 ee 13 lds r18, 0x13EE ; 0x8013ee 33472: 30 91 ef 13 lds r19, 0x13EF ; 0x8013ef 33476: 40 91 f0 13 lds r20, 0x13F0 ; 0x8013f0 3347a: 50 91 f1 13 lds r21, 0x13F1 ; 0x8013f1 3347e: c3 58 subi r28, 0x83 ; 131 33480: df 4f sbci r29, 0xFF ; 255 33482: 28 83 st Y, r18 33484: 39 83 std Y+1, r19 ; 0x01 33486: 4a 83 std Y+2, r20 ; 0x02 33488: 5b 83 std Y+3, r21 ; 0x03 3348a: cd 57 subi r28, 0x7D ; 125 3348c: d0 40 sbci r29, 0x00 ; 0 3348e: 80 91 f6 13 lds r24, 0x13F6 ; 0x8013f6 33492: 90 91 f7 13 lds r25, 0x13F7 ; 0x8013f7 33496: a0 91 f8 13 lds r26, 0x13F8 ; 0x8013f8 3349a: b0 91 f9 13 lds r27, 0x13F9 ; 0x8013f9 3349e: cf 57 subi r28, 0x7F ; 127 334a0: df 4f sbci r29, 0xFF ; 255 334a2: 88 83 st Y, r24 334a4: 99 83 std Y+1, r25 ; 0x01 334a6: aa 83 std Y+2, r26 ; 0x02 334a8: bb 83 std Y+3, r27 ; 0x03 334aa: c1 58 subi r28, 0x81 ; 129 334ac: d0 40 sbci r29, 0x00 ; 0 334ae: aa e0 ldi r26, 0x0A ; 10 334b0: b6 ea ldi r27, 0xA6 ; 166 334b2: 6c 96 adiw r28, 0x1c ; 28 334b4: bf af std Y+63, r27 ; 0x3f 334b6: ae af std Y+62, r26 ; 0x3e 334b8: 6c 97 sbiw r28, 0x1c ; 28 334ba: 81 ec ldi r24, 0xC1 ; 193 334bc: 28 2e mov r2, r24 334be: 83 e1 ldi r24, 0x13 ; 19 334c0: 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]; 334c2: f1 01 movw r30, r2 334c4: c1 80 ldd r12, Z+1 ; 0x01 334c6: d2 80 ldd r13, Z+2 ; 0x02 334c8: e3 80 ldd r14, Z+3 ; 0x03 334ca: f4 80 ldd r15, Z+4 ; 0x04 334cc: 45 80 ldd r4, Z+5 ; 0x05 334ce: 56 80 ldd r5, Z+6 ; 0x06 334d0: 67 80 ldd r6, Z+7 ; 0x07 334d2: 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; 334d4: 6c 96 adiw r28, 0x1c ; 28 334d6: ee ad ldd r30, Y+62 ; 0x3e 334d8: ff ad ldd r31, Y+63 ; 0x3f 334da: 6c 97 sbiw r28, 0x1c ; 28 334dc: 25 91 lpm r18, Z+ 334de: 35 91 lpm r19, Z+ 334e0: 45 91 lpm r20, Z+ 334e2: 54 91 lpm r21, Z 334e4: cb 57 subi r28, 0x7B ; 123 334e6: df 4f sbci r29, 0xFF ; 255 334e8: 28 83 st Y, r18 334ea: 39 83 std Y+1, r19 ; 0x01 334ec: 4a 83 std Y+2, r20 ; 0x02 334ee: 5b 83 std Y+3, r21 ; 0x03 334f0: c5 58 subi r28, 0x85 ; 133 334f2: d0 40 sbci r29, 0x00 ; 0 float errY = pgm_read_float(true_pts + i * 2 + 1) - y; 334f4: 6c 96 adiw r28, 0x1c ; 28 334f6: ee ad ldd r30, Y+62 ; 0x3e 334f8: ff ad ldd r31, Y+63 ; 0x3f 334fa: 6c 97 sbiw r28, 0x1c ; 28 334fc: 34 96 adiw r30, 0x04 ; 4 334fe: 85 90 lpm r8, Z+ 33500: 95 90 lpm r9, Z+ 33502: a5 90 lpm r10, Z+ 33504: 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]; 33506: ed 96 adiw r28, 0x3d ; 61 33508: 2c ad ldd r18, Y+60 ; 0x3c 3350a: 3d ad ldd r19, Y+61 ; 0x3d 3350c: 4e ad ldd r20, Y+62 ; 0x3e 3350e: 5f ad ldd r21, Y+63 ; 0x3f 33510: ed 97 sbiw r28, 0x3d ; 61 33512: c7 01 movw r24, r14 33514: b6 01 movw r22, r12 33516: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 3351a: c7 57 subi r28, 0x77 ; 119 3351c: df 4f sbci r29, 0xFF ; 255 3351e: 68 83 st Y, r22 33520: 79 83 std Y+1, r23 ; 0x01 33522: 8a 83 std Y+2, r24 ; 0x02 33524: 9b 83 std Y+3, r25 ; 0x03 33526: c9 58 subi r28, 0x89 ; 137 33528: d0 40 sbci r29, 0x00 ; 0 3352a: c3 58 subi r28, 0x83 ; 131 3352c: df 4f sbci r29, 0xFF ; 255 3352e: 28 81 ld r18, Y 33530: 39 81 ldd r19, Y+1 ; 0x01 33532: 4a 81 ldd r20, Y+2 ; 0x02 33534: 5b 81 ldd r21, Y+3 ; 0x03 33536: cd 57 subi r28, 0x7D ; 125 33538: d0 40 sbci r29, 0x00 ; 0 3353a: c3 01 movw r24, r6 3353c: b2 01 movw r22, r4 3353e: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 33542: 9b 01 movw r18, r22 33544: ac 01 movw r20, r24 33546: c7 57 subi r28, 0x77 ; 119 33548: df 4f sbci r29, 0xFF ; 255 3354a: 68 81 ld r22, Y 3354c: 79 81 ldd r23, Y+1 ; 0x01 3354e: 8a 81 ldd r24, Y+2 ; 0x02 33550: 9b 81 ldd r25, Y+3 ; 0x03 33552: c9 58 subi r28, 0x89 ; 137 33554: d0 40 sbci r29, 0x00 ; 0 33556: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 3355a: cf 57 subi r28, 0x7F ; 127 3355c: df 4f sbci r29, 0xFF ; 255 3355e: 28 81 ld r18, Y 33560: 39 81 ldd r19, Y+1 ; 0x01 33562: 4a 81 ldd r20, Y+2 ; 0x02 33564: 5b 81 ldd r21, Y+3 ; 0x03 33566: c1 58 subi r28, 0x81 ; 129 33568: d0 40 sbci r29, 0x00 ; 0 3356a: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 3356e: 9b 01 movw r18, r22 33570: 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; 33572: c5 01 movw r24, r10 33574: b4 01 movw r22, r8 33576: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 3357a: 4b 01 movw r8, r22 3357c: 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]; 3357e: a7 01 movw r20, r14 33580: 96 01 movw r18, r12 33582: ae 96 adiw r28, 0x2e ; 46 33584: 6c ad ldd r22, Y+60 ; 0x3c 33586: 7d ad ldd r23, Y+61 ; 0x3d 33588: 8e ad ldd r24, Y+62 ; 0x3e 3358a: 9f ad ldd r25, Y+63 ; 0x3f 3358c: ae 97 sbiw r28, 0x2e ; 46 3358e: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 33592: 6b 01 movw r12, r22 33594: 7c 01 movw r14, r24 33596: a3 01 movw r20, r6 33598: 92 01 movw r18, r4 3359a: e9 96 adiw r28, 0x39 ; 57 3359c: 6c ad ldd r22, Y+60 ; 0x3c 3359e: 7d ad ldd r23, Y+61 ; 0x3d 335a0: 8e ad ldd r24, Y+62 ; 0x3e 335a2: 9f ad ldd r25, Y+63 ; 0x3f 335a4: e9 97 sbiw r28, 0x39 ; 57 335a6: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 335aa: 9b 01 movw r18, r22 335ac: ac 01 movw r20, r24 335ae: c7 01 movw r24, r14 335b0: b6 01 movw r22, r12 335b2: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 335b6: e4 96 adiw r28, 0x34 ; 52 335b8: 2c ad ldd r18, Y+60 ; 0x3c 335ba: 3d ad ldd r19, Y+61 ; 0x3d 335bc: 4e ad ldd r20, Y+62 ; 0x3e 335be: 5f ad ldd r21, Y+63 ; 0x3f 335c0: e4 97 sbiw r28, 0x34 ; 52 335c2: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 335c6: 9b 01 movw r18, r22 335c8: 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; 335ca: cb 57 subi r28, 0x7B ; 123 335cc: df 4f sbci r29, 0xFF ; 255 335ce: 68 81 ld r22, Y 335d0: 79 81 ldd r23, Y+1 ; 0x01 335d2: 8a 81 ldd r24, Y+2 ; 0x02 335d4: 9b 81 ldd r25, Y+3 ; 0x03 335d6: c5 58 subi r28, 0x85 ; 133 335d8: d0 40 sbci r29, 0x00 ; 0 335da: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> float errY = pgm_read_float(true_pts + i * 2 + 1) - y; float err = hypot(errX, errY); 335de: a5 01 movw r20, r10 335e0: 94 01 movw r18, r8 335e2: 0f 94 9b df call 0x3bf36 ; 0x3bf36 } 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) { 335e6: 2d ec ldi r18, 0xCD ; 205 335e8: 3c ec ldi r19, 0xCC ; 204 335ea: 4c e4 ldi r20, 0x4C ; 76 335ec: 5f e3 ldi r21, 0x3F ; 63 335ee: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 335f2: 18 16 cp r1, r24 335f4: 0c f4 brge .+2 ; 0x335f8 result = BED_SKEW_OFFSET_DETECTION_FITTING_FAILED; 335f6: 1e ef ldi r17, 0xFE ; 254 335f8: 38 e0 ldi r19, 0x08 ; 8 335fa: 23 0e add r2, r19 335fc: 31 1c adc r3, r1 335fe: 6c 96 adiw r28, 0x1c ; 28 33600: 4e ad ldd r20, Y+62 ; 0x3e 33602: 5f ad ldd r21, Y+63 ; 0x3f 33604: 6c 97 sbiw r28, 0x1c ; 28 33606: 48 5f subi r20, 0xF8 ; 248 33608: 5f 4f sbci r21, 0xFF ; 255 3360a: 6c 96 adiw r28, 0x1c ; 28 3360c: 5f af std Y+63, r21 ; 0x3f 3360e: 4e af std Y+62, r20 ; 0x3e 33610: 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) { 33612: a8 96 adiw r28, 0x28 ; 40 33614: 8e ad ldd r24, Y+62 ; 0x3e 33616: 9f ad ldd r25, Y+63 ; 0x3f 33618: a8 97 sbiw r28, 0x28 ; 40 3361a: 82 15 cp r24, r2 3361c: 93 05 cpc r25, r3 3361e: 09 f0 breq .+2 ; 0x33622 33620: 50 cf rjmp .-352 ; 0x334c2 MYSERIAL.println(BED_CALIBRATION_POINT_OFFSET_MAX_EUCLIDIAN); SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY if (result == BED_SKEW_OFFSET_DETECTION_PERFECT) { 33622: 11 11 cpse r17, r1 33624: 62 c1 rjmp .+708 ; 0x338ea #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); 33626: a2 96 adiw r28, 0x22 ; 34 33628: 2c ad ldd r18, Y+60 ; 0x3c 3362a: 3d ad ldd r19, Y+61 ; 0x3d 3362c: 4e ad ldd r20, Y+62 ; 0x3e 3362e: 5f ad ldd r21, Y+63 ; 0x3f 33630: a2 97 sbiw r28, 0x22 ; 34 33632: a6 96 adiw r28, 0x26 ; 38 33634: 6c ad ldd r22, Y+60 ; 0x3c 33636: 7d ad ldd r23, Y+61 ; 0x3d 33638: 8e ad ldd r24, Y+62 ; 0x3e 3363a: 9f ad ldd r25, Y+63 ; 0x3f 3363c: a6 97 sbiw r28, 0x26 ; 38 3363e: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 33642: 20 e0 ldi r18, 0x00 ; 0 33644: 30 e0 ldi r19, 0x00 ; 0 33646: 40 e0 ldi r20, 0x00 ; 0 33648: 5f e3 ldi r21, 0x3F ; 63 3364a: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 3364e: 6b 01 movw r12, r22 33650: 7c 01 movw r14, r24 vec_x[0] = cos(a1) * MACHINE_AXIS_SCALE_X; 33652: 0f 94 f9 dd call 0x3bbf2 ; 0x3bbf2 33656: a2 96 adiw r28, 0x22 ; 34 33658: 6c af std Y+60, r22 ; 0x3c 3365a: 7d af std Y+61, r23 ; 0x3d 3365c: 8e af std Y+62, r24 ; 0x3e 3365e: 9f af std Y+63, r25 ; 0x3f 33660: a2 97 sbiw r28, 0x22 ; 34 33662: 60 93 e2 13 sts 0x13E2, r22 ; 0x8013e2 33666: 70 93 e3 13 sts 0x13E3, r23 ; 0x8013e3 3366a: 80 93 e4 13 sts 0x13E4, r24 ; 0x8013e4 3366e: 90 93 e5 13 sts 0x13E5, r25 ; 0x8013e5 vec_x[1] = sin(a1) * MACHINE_AXIS_SCALE_X; 33672: c7 01 movw r24, r14 33674: b6 01 movw r22, r12 33676: 0f 94 bf e0 call 0x3c17e ; 0x3c17e 3367a: a6 96 adiw r28, 0x26 ; 38 3367c: 6c af std Y+60, r22 ; 0x3c 3367e: 7d af std Y+61, r23 ; 0x3d 33680: 8e af std Y+62, r24 ; 0x3e 33682: 9f af std Y+63, r25 ; 0x3f 33684: a6 97 sbiw r28, 0x26 ; 38 33686: 60 93 e6 13 sts 0x13E6, r22 ; 0x8013e6 3368a: 70 93 e7 13 sts 0x13E7, r23 ; 0x8013e7 3368e: 80 93 e8 13 sts 0x13E8, r24 ; 0x8013e8 33692: 90 93 e9 13 sts 0x13E9, r25 ; 0x8013e9 vec_y[0] = -sin(a1) * MACHINE_AXIS_SCALE_Y; 33696: 9b 01 movw r18, r22 33698: ac 01 movw r20, r24 3369a: 50 58 subi r21, 0x80 ; 128 3369c: aa 96 adiw r28, 0x2a ; 42 3369e: 2c af std Y+60, r18 ; 0x3c 336a0: 3d af std Y+61, r19 ; 0x3d 336a2: 4e af std Y+62, r20 ; 0x3e 336a4: 5f af std Y+63, r21 ; 0x3f 336a6: aa 97 sbiw r28, 0x2a ; 42 336a8: 20 93 ea 13 sts 0x13EA, r18 ; 0x8013ea 336ac: 30 93 eb 13 sts 0x13EB, r19 ; 0x8013eb 336b0: 40 93 ec 13 sts 0x13EC, r20 ; 0x8013ec 336b4: 50 93 ed 13 sts 0x13ED, r21 ; 0x8013ed vec_y[1] = cos(a1) * MACHINE_AXIS_SCALE_Y; 336b8: a2 96 adiw r28, 0x22 ; 34 336ba: 8c ad ldd r24, Y+60 ; 0x3c 336bc: 9d ad ldd r25, Y+61 ; 0x3d 336be: ae ad ldd r26, Y+62 ; 0x3e 336c0: bf ad ldd r27, Y+63 ; 0x3f 336c2: a2 97 sbiw r28, 0x22 ; 34 336c4: 80 93 ee 13 sts 0x13EE, r24 ; 0x8013ee 336c8: 90 93 ef 13 sts 0x13EF, r25 ; 0x8013ef 336cc: a0 93 f0 13 sts 0x13F0, r26 ; 0x8013f0 336d0: b0 93 f1 13 sts 0x13F1, r27 ; 0x8013f1 // Refresh the offset. cntr[0] = 0.f; 336d4: 10 92 f2 13 sts 0x13F2, r1 ; 0x8013f2 336d8: 10 92 f3 13 sts 0x13F3, r1 ; 0x8013f3 336dc: 10 92 f4 13 sts 0x13F4, r1 ; 0x8013f4 336e0: 10 92 f5 13 sts 0x13F5, r1 ; 0x8013f5 cntr[1] = 0.f; 336e4: 10 92 f6 13 sts 0x13F6, r1 ; 0x8013f6 336e8: 10 92 f7 13 sts 0x13F7, r1 ; 0x8013f7 336ec: 10 92 f8 13 sts 0x13F8, r1 ; 0x8013f8 336f0: 10 92 f9 13 sts 0x13F9, r1 ; 0x8013f9 float wx = 0.f; 336f4: 41 2c mov r4, r1 336f6: 51 2c mov r5, r1 336f8: 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]; 336fa: cf 56 subi r28, 0x6F ; 111 336fc: df 4f sbci r29, 0xFF ; 255 336fe: a8 81 ld r26, Y 33700: b9 81 ldd r27, Y+1 ; 0x01 33702: c1 59 subi r28, 0x91 ; 145 33704: d0 40 sbci r29, 0x00 ; 0 33706: 11 96 adiw r26, 0x01 ; 1 33708: 8d 90 ld r8, X+ 3370a: 9d 90 ld r9, X+ 3370c: ad 90 ld r10, X+ 3370e: bc 90 ld r11, X 33710: 14 97 sbiw r26, 0x04 ; 4 33712: 15 96 adiw r26, 0x05 ; 5 33714: 2d 91 ld r18, X+ 33716: 3d 91 ld r19, X+ 33718: 4d 91 ld r20, X+ 3371a: 5c 91 ld r21, X 3371c: 18 97 sbiw r26, 0x08 ; 8 3371e: 6e 96 adiw r28, 0x1e ; 30 33720: 2c af std Y+60, r18 ; 0x3c 33722: 3d af std Y+61, r19 ; 0x3d 33724: 4e af std Y+62, r20 ; 0x3e 33726: 5f af std Y+63, r21 ; 0x3f 33728: 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); 3372a: cd 56 subi r28, 0x6D ; 109 3372c: df 4f sbci r29, 0xFF ; 255 3372e: e8 81 ld r30, Y 33730: f9 81 ldd r31, Y+1 ; 0x01 33732: c3 59 subi r28, 0x93 ; 147 33734: d0 40 sbci r29, 0x00 ; 0 33736: c5 90 lpm r12, Z+ 33738: d5 90 lpm r13, Z+ 3373a: e5 90 lpm r14, Z+ 3373c: 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]; 3373e: a5 01 movw r20, r10 33740: 94 01 movw r18, r8 33742: a2 96 adiw r28, 0x22 ; 34 33744: 6c ad ldd r22, Y+60 ; 0x3c 33746: 7d ad ldd r23, Y+61 ; 0x3d 33748: 8e ad ldd r24, Y+62 ; 0x3e 3374a: 9f ad ldd r25, Y+63 ; 0x3f 3374c: a2 97 sbiw r28, 0x22 ; 34 3374e: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 33752: ae 96 adiw r28, 0x2e ; 46 33754: 6c af std Y+60, r22 ; 0x3c 33756: 7d af std Y+61, r23 ; 0x3d 33758: 8e af std Y+62, r24 ; 0x3e 3375a: 9f af std Y+63, r25 ; 0x3f 3375c: ae 97 sbiw r28, 0x2e ; 46 3375e: 6e 96 adiw r28, 0x1e ; 30 33760: 2c ad ldd r18, Y+60 ; 0x3c 33762: 3d ad ldd r19, Y+61 ; 0x3d 33764: 4e ad ldd r20, Y+62 ; 0x3e 33766: 5f ad ldd r21, Y+63 ; 0x3f 33768: 6e 97 sbiw r28, 0x1e ; 30 3376a: aa 96 adiw r28, 0x2a ; 42 3376c: 6c ad ldd r22, Y+60 ; 0x3c 3376e: 7d ad ldd r23, Y+61 ; 0x3d 33770: 8e ad ldd r24, Y+62 ; 0x3e 33772: 9f ad ldd r25, Y+63 ; 0x3f 33774: aa 97 sbiw r28, 0x2a ; 42 33776: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 3377a: 9b 01 movw r18, r22 3377c: ac 01 movw r20, r24 3377e: ae 96 adiw r28, 0x2e ; 46 33780: 6c ad ldd r22, Y+60 ; 0x3c 33782: 7d ad ldd r23, Y+61 ; 0x3d 33784: 8e ad ldd r24, Y+62 ; 0x3e 33786: 9f ad ldd r25, Y+63 ; 0x3f 33788: ae 97 sbiw r28, 0x2e ; 46 3378a: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 3378e: 9b 01 movw r18, r22 33790: 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); 33792: c7 01 movw r24, r14 33794: b6 01 movw r22, r12 33796: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 3379a: 20 91 f2 13 lds r18, 0x13F2 ; 0x8013f2 3379e: 30 91 f3 13 lds r19, 0x13F3 ; 0x8013f3 337a2: 40 91 f4 13 lds r20, 0x13F4 ; 0x8013f4 337a6: 50 91 f5 13 lds r21, 0x13F5 ; 0x8013f5 337aa: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 337ae: 6b 01 movw r12, r22 337b0: 7c 01 movw r14, r24 337b2: c0 92 f2 13 sts 0x13F2, r12 ; 0x8013f2 337b6: d0 92 f3 13 sts 0x13F3, r13 ; 0x8013f3 337ba: e0 92 f4 13 sts 0x13F4, r14 ; 0x8013f4 337be: f0 92 f5 13 sts 0x13F5, r15 ; 0x8013f5 wx += w; 337c2: 20 e0 ldi r18, 0x00 ; 0 337c4: 30 e0 ldi r19, 0x00 ; 0 337c6: 40 e8 ldi r20, 0x80 ; 128 337c8: 5f e3 ldi r21, 0x3F ; 63 337ca: c3 01 movw r24, r6 337cc: b2 01 movw r22, r4 337ce: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 337d2: 2b 01 movw r4, r22 337d4: 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); 337d6: cd 56 subi r28, 0x6D ; 109 337d8: df 4f sbci r29, 0xFF ; 255 337da: e8 81 ld r30, Y 337dc: f9 81 ldd r31, Y+1 ; 0x01 337de: c3 59 subi r28, 0x93 ; 147 337e0: d0 40 sbci r29, 0x00 ; 0 337e2: 34 96 adiw r30, 0x04 ; 4 337e4: 25 91 lpm r18, Z+ 337e6: 35 91 lpm r19, Z+ 337e8: 45 91 lpm r20, Z+ 337ea: 54 91 lpm r21, Z 337ec: ae 96 adiw r28, 0x2e ; 46 337ee: 2c af std Y+60, r18 ; 0x3c 337f0: 3d af std Y+61, r19 ; 0x3d 337f2: 4e af std Y+62, r20 ; 0x3e 337f4: 5f af std Y+63, r21 ; 0x3f 337f6: 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]; 337f8: a5 01 movw r20, r10 337fa: 94 01 movw r18, r8 337fc: a6 96 adiw r28, 0x26 ; 38 337fe: 6c ad ldd r22, Y+60 ; 0x3c 33800: 7d ad ldd r23, Y+61 ; 0x3d 33802: 8e ad ldd r24, Y+62 ; 0x3e 33804: 9f ad ldd r25, Y+63 ; 0x3f 33806: a6 97 sbiw r28, 0x26 ; 38 33808: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 3380c: 4b 01 movw r8, r22 3380e: 5c 01 movw r10, r24 33810: 6e 96 adiw r28, 0x1e ; 30 33812: 2c ad ldd r18, Y+60 ; 0x3c 33814: 3d ad ldd r19, Y+61 ; 0x3d 33816: 4e ad ldd r20, Y+62 ; 0x3e 33818: 5f ad ldd r21, Y+63 ; 0x3f 3381a: 6e 97 sbiw r28, 0x1e ; 30 3381c: a2 96 adiw r28, 0x22 ; 34 3381e: 6c ad ldd r22, Y+60 ; 0x3c 33820: 7d ad ldd r23, Y+61 ; 0x3d 33822: 8e ad ldd r24, Y+62 ; 0x3e 33824: 9f ad ldd r25, Y+63 ; 0x3f 33826: a2 97 sbiw r28, 0x22 ; 34 33828: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 3382c: 9b 01 movw r18, r22 3382e: ac 01 movw r20, r24 33830: c5 01 movw r24, r10 33832: b4 01 movw r22, r8 33834: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 33838: 9b 01 movw r18, r22 3383a: 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); 3383c: ae 96 adiw r28, 0x2e ; 46 3383e: 6c ad ldd r22, Y+60 ; 0x3c 33840: 7d ad ldd r23, Y+61 ; 0x3d 33842: 8e ad ldd r24, Y+62 ; 0x3e 33844: 9f ad ldd r25, Y+63 ; 0x3f 33846: ae 97 sbiw r28, 0x2e ; 46 33848: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 3384c: 20 91 f6 13 lds r18, 0x13F6 ; 0x8013f6 33850: 30 91 f7 13 lds r19, 0x13F7 ; 0x8013f7 33854: 40 91 f8 13 lds r20, 0x13F8 ; 0x8013f8 33858: 50 91 f9 13 lds r21, 0x13F9 ; 0x8013f9 3385c: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 33860: 4b 01 movw r8, r22 33862: 5c 01 movw r10, r24 33864: 80 92 f6 13 sts 0x13F6, r8 ; 0x8013f6 33868: 90 92 f7 13 sts 0x13F7, r9 ; 0x8013f7 3386c: a0 92 f8 13 sts 0x13F8, r10 ; 0x8013f8 33870: b0 92 f9 13 sts 0x13F9, r11 ; 0x8013f9 33874: cf 56 subi r28, 0x6F ; 111 33876: df 4f sbci r29, 0xFF ; 255 33878: 48 81 ld r20, Y 3387a: 59 81 ldd r21, Y+1 ; 0x01 3387c: c1 59 subi r28, 0x91 ; 145 3387e: d0 40 sbci r29, 0x00 ; 0 33880: 48 5f subi r20, 0xF8 ; 248 33882: 5f 4f sbci r21, 0xFF ; 255 33884: cf 56 subi r28, 0x6F ; 111 33886: df 4f sbci r29, 0xFF ; 255 33888: 59 83 std Y+1, r21 ; 0x01 3388a: 48 83 st Y, r20 3388c: c1 59 subi r28, 0x91 ; 145 3388e: d0 40 sbci r29, 0x00 ; 0 33890: cd 56 subi r28, 0x6D ; 109 33892: df 4f sbci r29, 0xFF ; 255 33894: 88 81 ld r24, Y 33896: 99 81 ldd r25, Y+1 ; 0x01 33898: c3 59 subi r28, 0x93 ; 147 3389a: d0 40 sbci r29, 0x00 ; 0 3389c: 08 96 adiw r24, 0x08 ; 8 3389e: cd 56 subi r28, 0x6D ; 109 338a0: df 4f sbci r29, 0xFF ; 255 338a2: 99 83 std Y+1, r25 ; 0x01 338a4: 88 83 st Y, r24 338a6: c3 59 subi r28, 0x93 ; 147 338a8: 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) { 338aa: 24 16 cp r2, r20 338ac: 35 06 cpc r3, r21 338ae: 09 f0 breq .+2 ; 0x338b2 338b0: 24 cf rjmp .-440 ; 0x336fa SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY } cntr[0] /= wx; 338b2: a3 01 movw r20, r6 338b4: 92 01 movw r18, r4 338b6: c7 01 movw r24, r14 338b8: b6 01 movw r22, r12 338ba: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 338be: 60 93 f2 13 sts 0x13F2, r22 ; 0x8013f2 338c2: 70 93 f3 13 sts 0x13F3, r23 ; 0x8013f3 338c6: 80 93 f4 13 sts 0x13F4, r24 ; 0x8013f4 338ca: 90 93 f5 13 sts 0x13F5, r25 ; 0x8013f5 cntr[1] /= wy; 338ce: a3 01 movw r20, r6 338d0: 92 01 movw r18, r4 338d2: c5 01 movw r24, r10 338d4: b4 01 movw r22, r8 338d6: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 338da: 60 93 f6 13 sts 0x13F6, r22 ; 0x8013f6 338de: 70 93 f7 13 sts 0x13F7, r23 ; 0x8013f7 338e2: 80 93 f8 13 sts 0x13F8, r24 ; 0x8013f8 338e6: 90 93 f9 13 sts 0x13F9, r25 ; 0x8013f9 #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]; 338ea: 40 90 e2 13 lds r4, 0x13E2 ; 0x8013e2 338ee: 50 90 e3 13 lds r5, 0x13E3 ; 0x8013e3 338f2: 60 90 e4 13 lds r6, 0x13E4 ; 0x8013e4 338f6: 70 90 e5 13 lds r7, 0x13E5 ; 0x8013e5 338fa: c0 90 ee 13 lds r12, 0x13EE ; 0x8013ee 338fe: d0 90 ef 13 lds r13, 0x13EF ; 0x8013ef 33902: e0 90 f0 13 lds r14, 0x13F0 ; 0x8013f0 33906: f0 90 f1 13 lds r15, 0x13F1 ; 0x8013f1 3390a: 20 91 e6 13 lds r18, 0x13E6 ; 0x8013e6 3390e: 30 91 e7 13 lds r19, 0x13E7 ; 0x8013e7 33912: 40 91 e8 13 lds r20, 0x13E8 ; 0x8013e8 33916: 50 91 e9 13 lds r21, 0x13E9 ; 0x8013e9 3391a: a2 96 adiw r28, 0x22 ; 34 3391c: 2c af std Y+60, r18 ; 0x3c 3391e: 3d af std Y+61, r19 ; 0x3d 33920: 4e af std Y+62, r20 ; 0x3e 33922: 5f af std Y+63, r21 ; 0x3f 33924: a2 97 sbiw r28, 0x22 ; 34 33926: 80 91 ea 13 lds r24, 0x13EA ; 0x8013ea 3392a: 90 91 eb 13 lds r25, 0x13EB ; 0x8013eb 3392e: a0 91 ec 13 lds r26, 0x13EC ; 0x8013ec 33932: b0 91 ed 13 lds r27, 0x13ED ; 0x8013ed 33936: a6 96 adiw r28, 0x26 ; 38 33938: 8c af std Y+60, r24 ; 0x3c 3393a: 9d af std Y+61, r25 ; 0x3d 3393c: ae af std Y+62, r26 ; 0x3e 3393e: bf af std Y+63, r27 ; 0x3f 33940: a6 97 sbiw r28, 0x26 ; 38 33942: a7 01 movw r20, r14 33944: 96 01 movw r18, r12 33946: c3 01 movw r24, r6 33948: b2 01 movw r22, r4 3394a: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 3394e: 4b 01 movw r8, r22 33950: 5c 01 movw r10, r24 33952: a6 96 adiw r28, 0x26 ; 38 33954: 2c ad ldd r18, Y+60 ; 0x3c 33956: 3d ad ldd r19, Y+61 ; 0x3d 33958: 4e ad ldd r20, Y+62 ; 0x3e 3395a: 5f ad ldd r21, Y+63 ; 0x3f 3395c: a6 97 sbiw r28, 0x26 ; 38 3395e: a2 96 adiw r28, 0x22 ; 34 33960: 6c ad ldd r22, Y+60 ; 0x3c 33962: 7d ad ldd r23, Y+61 ; 0x3d 33964: 8e ad ldd r24, Y+62 ; 0x3e 33966: 9f ad ldd r25, Y+63 ; 0x3f 33968: a2 97 sbiw r28, 0x22 ; 34 3396a: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 3396e: 9b 01 movw r18, r22 33970: ac 01 movw r20, r24 33972: c5 01 movw r24, r10 33974: b4 01 movw r22, r8 33976: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 3397a: 4b 01 movw r8, r22 3397c: 5c 01 movw r10, r24 float Ainv[2][2] = { { vec_y[1] / d, -vec_y[0] / d }, 3397e: ac 01 movw r20, r24 33980: 9b 01 movw r18, r22 33982: c7 01 movw r24, r14 33984: b6 01 movw r22, r12 33986: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 3398a: 6b 01 movw r12, r22 3398c: 7c 01 movw r14, r24 3398e: a6 96 adiw r28, 0x26 ; 38 33990: 6c ad ldd r22, Y+60 ; 0x3c 33992: 7d ad ldd r23, Y+61 ; 0x3d 33994: 8e ad ldd r24, Y+62 ; 0x3e 33996: 9f ad ldd r25, Y+63 ; 0x3f 33998: a6 97 sbiw r28, 0x26 ; 38 3399a: 90 58 subi r25, 0x80 ; 128 3399c: a5 01 movw r20, r10 3399e: 94 01 movw r18, r8 339a0: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 339a4: a6 96 adiw r28, 0x26 ; 38 339a6: 6c af std Y+60, r22 ; 0x3c 339a8: 7d af std Y+61, r23 ; 0x3d 339aa: 8e af std Y+62, r24 ; 0x3e 339ac: 9f af std Y+63, r25 ; 0x3f 339ae: a6 97 sbiw r28, 0x26 ; 38 { -vec_x[1] / d, vec_x[0] / d } 339b0: a2 96 adiw r28, 0x22 ; 34 339b2: 6c ad ldd r22, Y+60 ; 0x3c 339b4: 7d ad ldd r23, Y+61 ; 0x3d 339b6: 8e ad ldd r24, Y+62 ; 0x3e 339b8: 9f ad ldd r25, Y+63 ; 0x3f 339ba: a2 97 sbiw r28, 0x22 ; 34 339bc: 90 58 subi r25, 0x80 ; 128 339be: a5 01 movw r20, r10 339c0: 94 01 movw r18, r8 339c2: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 339c6: aa 96 adiw r28, 0x2a ; 42 339c8: 6c af std Y+60, r22 ; 0x3c 339ca: 7d af std Y+61, r23 ; 0x3d 339cc: 8e af std Y+62, r24 ; 0x3e 339ce: 9f af std Y+63, r25 ; 0x3f 339d0: aa 97 sbiw r28, 0x2a ; 42 339d2: a5 01 movw r20, r10 339d4: 94 01 movw r18, r8 339d6: c3 01 movw r24, r6 339d8: b2 01 movw r22, r4 339da: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 339de: 4b 01 movw r8, r22 339e0: 5c 01 movw r10, r24 }; float cntrInv[2] = { -Ainv[0][0] * cntr[0] - Ainv[0][1] * cntr[1], 339e2: 40 90 f2 13 lds r4, 0x13F2 ; 0x8013f2 339e6: 50 90 f3 13 lds r5, 0x13F3 ; 0x8013f3 339ea: 60 90 f4 13 lds r6, 0x13F4 ; 0x8013f4 339ee: 70 90 f5 13 lds r7, 0x13F5 ; 0x8013f5 339f2: 20 91 f6 13 lds r18, 0x13F6 ; 0x8013f6 339f6: 30 91 f7 13 lds r19, 0x13F7 ; 0x8013f7 339fa: 40 91 f8 13 lds r20, 0x13F8 ; 0x8013f8 339fe: 50 91 f9 13 lds r21, 0x13F9 ; 0x8013f9 33a02: a2 96 adiw r28, 0x22 ; 34 33a04: 2c af std Y+60, r18 ; 0x3c 33a06: 3d af std Y+61, r19 ; 0x3d 33a08: 4e af std Y+62, r20 ; 0x3e 33a0a: 5f af std Y+63, r21 ; 0x3f 33a0c: a2 97 sbiw r28, 0x22 ; 34 -Ainv[1][0] * cntr[0] - Ainv[1][1] * cntr[1] }; vec_x[0] = Ainv[0][0]; 33a0e: c0 92 e2 13 sts 0x13E2, r12 ; 0x8013e2 33a12: d0 92 e3 13 sts 0x13E3, r13 ; 0x8013e3 33a16: e0 92 e4 13 sts 0x13E4, r14 ; 0x8013e4 33a1a: f0 92 e5 13 sts 0x13E5, r15 ; 0x8013e5 vec_x[1] = Ainv[1][0]; 33a1e: aa 96 adiw r28, 0x2a ; 42 33a20: 8c ad ldd r24, Y+60 ; 0x3c 33a22: 9d ad ldd r25, Y+61 ; 0x3d 33a24: ae ad ldd r26, Y+62 ; 0x3e 33a26: bf ad ldd r27, Y+63 ; 0x3f 33a28: aa 97 sbiw r28, 0x2a ; 42 33a2a: 80 93 e6 13 sts 0x13E6, r24 ; 0x8013e6 33a2e: 90 93 e7 13 sts 0x13E7, r25 ; 0x8013e7 33a32: a0 93 e8 13 sts 0x13E8, r26 ; 0x8013e8 33a36: b0 93 e9 13 sts 0x13E9, r27 ; 0x8013e9 vec_y[0] = Ainv[0][1]; 33a3a: a6 96 adiw r28, 0x26 ; 38 33a3c: 2c ad ldd r18, Y+60 ; 0x3c 33a3e: 3d ad ldd r19, Y+61 ; 0x3d 33a40: 4e ad ldd r20, Y+62 ; 0x3e 33a42: 5f ad ldd r21, Y+63 ; 0x3f 33a44: a6 97 sbiw r28, 0x26 ; 38 33a46: 20 93 ea 13 sts 0x13EA, r18 ; 0x8013ea 33a4a: 30 93 eb 13 sts 0x13EB, r19 ; 0x8013eb 33a4e: 40 93 ec 13 sts 0x13EC, r20 ; 0x8013ec 33a52: 50 93 ed 13 sts 0x13ED, r21 ; 0x8013ed vec_y[1] = Ainv[1][1]; 33a56: 80 92 ee 13 sts 0x13EE, r8 ; 0x8013ee 33a5a: 90 92 ef 13 sts 0x13EF, r9 ; 0x8013ef 33a5e: a0 92 f0 13 sts 0x13F0, r10 ; 0x8013f0 33a62: b0 92 f1 13 sts 0x13F1, r11 ; 0x8013f1 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], 33a66: c7 01 movw r24, r14 33a68: b6 01 movw r22, r12 33a6a: 90 58 subi r25, 0x80 ; 128 33a6c: a3 01 movw r20, r6 33a6e: 92 01 movw r18, r4 33a70: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 33a74: 6b 01 movw r12, r22 33a76: 7c 01 movw r14, r24 33a78: a2 96 adiw r28, 0x22 ; 34 33a7a: 2c ad ldd r18, Y+60 ; 0x3c 33a7c: 3d ad ldd r19, Y+61 ; 0x3d 33a7e: 4e ad ldd r20, Y+62 ; 0x3e 33a80: 5f ad ldd r21, Y+63 ; 0x3f 33a82: a2 97 sbiw r28, 0x22 ; 34 33a84: a6 96 adiw r28, 0x26 ; 38 33a86: 6c ad ldd r22, Y+60 ; 0x3c 33a88: 7d ad ldd r23, Y+61 ; 0x3d 33a8a: 8e ad ldd r24, Y+62 ; 0x3e 33a8c: 9f ad ldd r25, Y+63 ; 0x3f 33a8e: a6 97 sbiw r28, 0x26 ; 38 33a90: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 33a94: 9b 01 movw r18, r22 33a96: ac 01 movw r20, r24 33a98: c7 01 movw r24, r14 33a9a: b6 01 movw r22, r12 33a9c: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__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]; 33aa0: 60 93 f2 13 sts 0x13F2, r22 ; 0x8013f2 33aa4: 70 93 f3 13 sts 0x13F3, r23 ; 0x8013f3 33aa8: 80 93 f4 13 sts 0x13F4, r24 ; 0x8013f4 33aac: 90 93 f5 13 sts 0x13F5, r25 ; 0x8013f5 { 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] 33ab0: aa 96 adiw r28, 0x2a ; 42 33ab2: 6c ad ldd r22, Y+60 ; 0x3c 33ab4: 7d ad ldd r23, Y+61 ; 0x3d 33ab6: 8e ad ldd r24, Y+62 ; 0x3e 33ab8: 9f ad ldd r25, Y+63 ; 0x3f 33aba: aa 97 sbiw r28, 0x2a ; 42 33abc: 90 58 subi r25, 0x80 ; 128 33abe: a3 01 movw r20, r6 33ac0: 92 01 movw r18, r4 33ac2: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 33ac6: 6b 01 movw r12, r22 33ac8: 7c 01 movw r14, r24 33aca: a2 96 adiw r28, 0x22 ; 34 33acc: 2c ad ldd r18, Y+60 ; 0x3c 33ace: 3d ad ldd r19, Y+61 ; 0x3d 33ad0: 4e ad ldd r20, Y+62 ; 0x3e 33ad2: 5f ad ldd r21, Y+63 ; 0x3f 33ad4: a2 97 sbiw r28, 0x22 ; 34 33ad6: c5 01 movw r24, r10 33ad8: b4 01 movw r22, r8 33ada: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 33ade: 9b 01 movw r18, r22 33ae0: ac 01 movw r20, r24 33ae2: c7 01 movw r24, r14 33ae4: b6 01 movw r22, r12 33ae6: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__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]; 33aea: 60 93 f6 13 sts 0x13F6, r22 ; 0x8013f6 33aee: 70 93 f7 13 sts 0x13F7, r23 ; 0x8013f7 33af2: 80 93 f8 13 sts 0x13F8, r24 ; 0x8013f8 33af6: 90 93 f9 13 sts 0x13F9, r25 ; 0x8013f9 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 33afa: 90 e0 ldi r25, 0x00 ; 0 33afc: 80 e0 ldi r24, 0x00 ; 0 33afe: 0e 94 fc 8c call 0x119f8 ; 0x119f8 if (result >= 0) { 33b02: 17 fd sbrc r17, 7 33b04: d5 c0 rjmp .+426 ; 0x33cb0 DBG(_n("Calibration success.\n")); 33b06: 83 e7 ldi r24, 0x73 ; 115 33b08: 90 e7 ldi r25, 0x70 ; 112 33b0a: 9f 93 push r25 33b0c: 8f 93 push r24 33b0e: 0f 94 99 da call 0x3b532 ; 0x3b532 world2machine_update(vec_x, vec_y, cntr); 33b12: 42 ef ldi r20, 0xF2 ; 242 33b14: 53 e1 ldi r21, 0x13 ; 19 33b16: 6a ee ldi r22, 0xEA ; 234 33b18: 73 e1 ldi r23, 0x13 ; 19 33b1a: 82 ee ldi r24, 0xE2 ; 226 33b1c: 93 e1 ldi r25, 0x13 ; 19 33b1e: 0f 94 6f cc call 0x398de ; 0x398de #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); 33b22: 48 e0 ldi r20, 0x08 ; 8 33b24: 50 e0 ldi r21, 0x00 ; 0 33b26: 65 ee ldi r22, 0xE5 ; 229 33b28: 7f e0 ldi r23, 0x0F ; 15 33b2a: 82 ef ldi r24, 0xF2 ; 242 33b2c: 93 e1 ldi r25, 0x13 ; 19 33b2e: 0f 94 eb db call 0x3b7d6 ; 0x3b7d6 33b32: 48 e0 ldi r20, 0x08 ; 8 33b34: 50 e0 ldi r21, 0x00 ; 0 33b36: 6d ed ldi r22, 0xDD ; 221 33b38: 7f e0 ldi r23, 0x0F ; 15 33b3a: 82 ee ldi r24, 0xE2 ; 226 33b3c: 93 e1 ldi r25, 0x13 ; 19 33b3e: 0f 94 eb db call 0x3b7d6 ; 0x3b7d6 33b42: 48 e0 ldi r20, 0x08 ; 8 33b44: 50 e0 ldi r21, 0x00 ; 0 33b46: 65 ed ldi r22, 0xD5 ; 213 33b48: 7f e0 ldi r23, 0x0F ; 15 33b4a: 8a ee ldi r24, 0xEA ; 234 33b4c: 93 e1 ldi r25, 0x13 ; 19 33b4e: 0f 94 eb db call 0x3b7d6 ; 0x3b7d6 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(); 33b52: 0f 94 f4 cb call 0x397e8 ; 0x397e8 } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ DBG(_n("Fitting failed => calibration failed.\n")); 33b56: 0f 90 pop r0 33b58: 0f 90 pop r0 BedSkewOffsetDetectionResultType result = find_bed_offset_and_skew(verbosity_level, point_too_far_mask); clean_up_after_endstop_move(l_feedmultiply); 33b5a: c7 55 subi r28, 0x57 ; 87 33b5c: df 4f sbci r29, 0xFF ; 255 33b5e: 88 81 ld r24, Y 33b60: 99 81 ldd r25, Y+1 ; 0x01 33b62: c9 5a subi r28, 0xA9 ; 169 33b64: d0 40 sbci r29, 0x00 ; 0 33b66: 0e 94 e6 66 call 0xcdcc ; 0xcdcc // Print head up. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 33b6a: 80 e0 ldi r24, 0x00 ; 0 33b6c: 90 e0 ldi r25, 0x00 ; 0 33b6e: a0 ea ldi r26, 0xA0 ; 160 33b70: b0 e4 ldi r27, 0x40 ; 64 33b72: 80 93 99 06 sts 0x0699, r24 ; 0x800699 33b76: 90 93 9a 06 sts 0x069A, r25 ; 0x80069a 33b7a: a0 93 9b 06 sts 0x069B, r26 ; 0x80069b 33b7e: b0 93 9c 06 sts 0x069C, r27 ; 0x80069c plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40); 33b82: 60 e0 ldi r22, 0x00 ; 0 33b84: 70 e0 ldi r23, 0x00 ; 0 33b86: 80 ea ldi r24, 0xA0 ; 160 33b88: 91 e4 ldi r25, 0x41 ; 65 33b8a: 0f 94 04 c0 call 0x38008 ; 0x38008 st_synchronize(); 33b8e: 0f 94 a3 42 call 0x28546 ; 0x28546 //#ifndef NEW_XYZCAL if (result >= 0) 33b92: 17 fd sbrc r17, 7 33b94: 22 c0 rjmp .+68 ; 0x33bda 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; 33b96: 10 92 99 06 sts 0x0699, r1 ; 0x800699 33b9a: 10 92 9a 06 sts 0x069A, r1 ; 0x80069a 33b9e: 10 92 9b 06 sts 0x069B, r1 ; 0x80069b 33ba2: 10 92 9c 06 sts 0x069C, r1 ; 0x80069c destination[Z_AXIS] = 150.F; 33ba6: 80 e0 ldi r24, 0x00 ; 0 33ba8: 90 e0 ldi r25, 0x00 ; 0 33baa: a6 e1 ldi r26, 0x16 ; 22 33bac: b3 e4 ldi r27, 0x43 ; 67 33bae: 80 93 7b 06 sts 0x067B, r24 ; 0x80067b 33bb2: 90 93 7c 06 sts 0x067C, r25 ; 0x80067c 33bb6: a0 93 7d 06 sts 0x067D, r26 ; 0x80067d 33bba: b0 93 7e 06 sts 0x067E, r27 ; 0x80067e plan_buffer_line_destinationXYZE(homing_feedrate[Z_AXIS] / 60); 33bbe: 65 e5 ldi r22, 0x55 ; 85 33bc0: 75 e5 ldi r23, 0x55 ; 85 33bc2: 85 e5 ldi r24, 0x55 ; 85 33bc4: 91 e4 ldi r25, 0x41 ; 65 33bc6: 0f 94 d1 bf call 0x37fa2 ; 0x37fa2 lcd_show_fullscreen_message_and_wait_P(_T(MSG_PLACE_STEEL_SHEET)); 33bca: 87 e5 ldi r24, 0x57 ; 87 33bcc: 9a e5 ldi r25, 0x5A ; 90 33bce: 0e 94 c4 72 call 0xe588 ; 0xe588 33bd2: 0f 94 c7 1f call 0x23f8e ; 0x23f8e // 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()) 33bd6: 0f 94 03 ca call 0x39406 ; 0x39406 st_synchronize(); // if (result >= 0) babystep_apply(); #endif //HEATBED_V2 } //#endif //NEW_XYZCAL lcd_update_enable(true); 33bda: 81 e0 ldi r24, 0x01 ; 1 33bdc: 0e 94 3d 6f call 0xde7a ; 0xde7a lcd_update(2); 33be0: 82 e0 ldi r24, 0x02 ; 2 33be2: 0e 94 bf 6e call 0xdd7e ; 0xdd7e 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)); 33be6: 88 e1 ldi r24, 0x18 ; 24 33be8: 9a e5 ldi r25, 0x5A ; 90 } 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) { 33bea: 1f 3f cpi r17, 0xFF ; 255 33bec: 99 f0 breq .+38 ; 0x33c14 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) { 33bee: 1e 3f cpi r17, 0xFE ; 254 33bf0: 09 f0 breq .+2 ; 0x33bf4 33bf2: 73 c0 rjmp .+230 ; 0x33cda if (point_too_far_mask == 0) 33bf4: af 96 adiw r28, 0x2f ; 47 33bf6: 4f ad ldd r20, Y+63 ; 0x3f 33bf8: af 97 sbiw r28, 0x2f ; 47 msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); 33bfa: 83 ee ldi r24, 0xE3 ; 227 33bfc: 99 e5 ldi r25, 0x59 ; 89 { 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) 33bfe: 44 23 and r20, r20 33c00: 49 f0 breq .+18 ; 0x33c14 msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); else if (point_too_far_mask == 2 || point_too_far_mask == 7) 33c02: af 96 adiw r28, 0x2f ; 47 33c04: 5f ad ldd r21, Y+63 ; 0x3f 33c06: 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); 33c08: 81 ea ldi r24, 0xA1 ; 161 33c0a: 99 e5 ldi r25, 0x59 ; 89 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) 33c0c: 52 30 cpi r21, 0x02 ; 2 33c0e: 11 f0 breq .+4 ; 0x33c14 // 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); 33c10: 8a e5 ldi r24, 0x5A ; 90 33c12: 99 e5 ldi r25, 0x59 ; 89 33c14: 0e 94 c4 72 call 0xe588 ; 0xe588 33c18: 0d 94 5c 92 jmp 0x324b8 ; 0x324b8 (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]) : 33c1c: f2 01 movw r30, r4 33c1e: 25 81 ldd r18, Z+5 ; 0x05 33c20: 36 81 ldd r19, Z+6 ; 0x06 33c22: 47 81 ldd r20, Z+7 ; 0x07 33c24: 50 85 ldd r21, Z+8 ; 0x08 33c26: c3 58 subi r28, 0x83 ; 131 33c28: df 4f sbci r29, 0xFF ; 255 33c2a: 68 81 ld r22, Y 33c2c: 79 81 ldd r23, Y+1 ; 0x01 33c2e: 8a 81 ldd r24, Y+2 ; 0x02 33c30: 9b 81 ldd r25, Y+3 ; 0x03 33c32: cd 57 subi r28, 0x7D ; 125 33c34: d0 40 sbci r29, 0x00 ; 0 33c36: 0d 94 48 95 jmp 0x32a90 ; 0x32a90 // 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]) : 33c3a: f2 01 movw r30, r4 33c3c: 25 81 ldd r18, Z+5 ; 0x05 33c3e: 36 81 ldd r19, Z+6 ; 0x06 33c40: 47 81 ldd r20, Z+7 ; 0x07 33c42: 50 85 ldd r21, Z+8 ; 0x08 33c44: ed 96 adiw r28, 0x3d ; 61 33c46: 6c ad ldd r22, Y+60 ; 0x3c 33c48: 7d ad ldd r23, Y+61 ; 0x3d 33c4a: 8e ad ldd r24, Y+62 ; 0x3e 33c4c: 9f ad ldd r25, Y+63 ; 0x3f 33c4e: ed 97 sbiw r28, 0x3d ; 61 33c50: b8 c0 rjmp .+368 ; 0x33dc2 (-s2 * measured_pts[2 * i + 1])); float b = (c == 1) ? 1.f : ((c == 2) ? ( c1 * measured_pts[2 * i]) : 33c52: f2 01 movw r30, r4 33c54: 25 81 ldd r18, Z+5 ; 0x05 33c56: 36 81 ldd r19, Z+6 ; 0x06 33c58: 47 81 ldd r20, Z+7 ; 0x07 33c5a: 50 85 ldd r21, Z+8 ; 0x08 33c5c: ed 96 adiw r28, 0x3d ; 61 33c5e: 6c ad ldd r22, Y+60 ; 0x3c 33c60: 7d ad ldd r23, Y+61 ; 0x3d 33c62: 8e ad ldd r24, Y+62 ; 0x3e 33c64: 9f ad ldd r25, Y+63 ; 0x3f 33c66: ed 97 sbiw r28, 0x3d ; 61 33c68: c6 c0 rjmp .+396 ; 0x33df6 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]) : 33c6a: a3 01 movw r20, r6 33c6c: 92 01 movw r18, r4 33c6e: c3 58 subi r28, 0x83 ; 131 33c70: df 4f sbci r29, 0xFF ; 255 33c72: 68 81 ld r22, Y 33c74: 79 81 ldd r23, Y+1 ; 0x01 33c76: 8a 81 ldd r24, Y+2 ; 0x02 33c78: 9b 81 ldd r25, Y+3 ; 0x03 33c7a: cd 57 subi r28, 0x7D ; 125 33c7c: d0 40 sbci r29, 0x00 ; 0 33c7e: 0d 94 b0 95 jmp 0x32b60 ; 0x32b60 // J^T times f(x) acc = 0.f; for (uint8_t i = 0; i < npts; ++i) { { float j = (r == 0) ? 1.f : 33c82: 81 2c mov r8, r1 33c84: 91 2c mov r9, r1 33c86: 20 e8 ldi r18, 0x80 ; 128 33c88: a2 2e mov r10, r18 33c8a: 2f e3 ldi r18, 0x3F ; 63 33c8c: b2 2e mov r11, r18 33c8e: 0d 94 b4 95 jmp 0x32b68 ; 0x32b68 float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += j * fx * w; } { float j = (r == 0) ? 0.f : 33c92: c1 2c mov r12, r1 33c94: d1 2c mov r13, r1 33c96: 76 01 movw r14, r12 33c98: 0d 94 2b 96 jmp 0x32c56 ; 0x32c56 ((r == 1) ? 1.f : 33c9c: c1 2c mov r12, r1 33c9e: d1 2c mov r13, r1 33ca0: 90 e8 ldi r25, 0x80 ; 128 33ca2: e9 2e mov r14, r25 33ca4: 9f e3 ldi r25, 0x3F ; 63 33ca6: f9 2e mov r15, r25 33ca8: 0d 94 2b 96 jmp 0x32c56 ; 0x32c56 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; 33cac: 12 e0 ldi r17, 0x02 ; 2 33cae: a7 cb rjmp .-2226 ; 0x333fe } } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ 33cb0: 1e 3f cpi r17, 0xFE ; 254 33cb2: 89 f4 brne .+34 ; 0x33cd6 33cb4: af 96 adiw r28, 0x2f ; 47 33cb6: 3f ad ldd r19, Y+63 ; 0x3f 33cb8: af 97 sbiw r28, 0x2f ; 47 33cba: 32 30 cpi r19, 0x02 ; 2 33cbc: 09 f0 breq .+2 ; 0x33cc0 33cbe: 4d cf rjmp .-358 ; 0x33b5a DBG(_n("Fitting failed => calibration failed.\n")); 33cc0: 8c e4 ldi r24, 0x4C ; 76 33cc2: 90 e7 ldi r25, 0x70 ; 112 33cc4: 9f 93 push r25 33cc6: 8f 93 push r24 33cc8: 0f 94 99 da call 0x3b532 ; 0x3b532 33ccc: 44 cf rjmp .-376 ; 0x33b56 // 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; 33cce: af 96 adiw r28, 0x2f ; 47 33cd0: 1f ae std Y+63, r1 ; 0x3f 33cd2: af 97 sbiw r28, 0x2f ; 47 33cd4: 42 cf rjmp .-380 ; 0x33b5a } } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ 33cd6: 1f ef ldi r17, 0xFF ; 255 33cd8: 40 cf rjmp .-384 ; 0x33b5a 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) { 33cda: af 96 adiw r28, 0x2f ; 47 33cdc: 6f ad ldd r22, Y+63 ; 0x3f 33cde: af 97 sbiw r28, 0x2f ; 47 33ce0: 61 11 cpse r22, r1 33ce2: 13 c0 rjmp .+38 ; 0x33d0a 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); 33ce4: 8f e3 ldi r24, 0x3F ; 63 33ce6: 98 e5 ldi r25, 0x58 ; 88 // 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) { 33ce8: 11 30 cpi r17, 0x01 ; 1 33cea: 51 f0 breq .+20 ; 0x33d00 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); 33cec: 8c ef ldi r24, 0xFC ; 252 33cee: 97 e5 ldi r25, 0x57 ; 87 // 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) { 33cf0: 12 30 cpi r17, 0x02 ; 2 33cf2: 31 f0 breq .+12 ; 0x33d00 default: // should not happen msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); 33cf4: 83 ee ldi r24, 0xE3 ; 227 33cf6: 99 e5 ldi r25, 0x59 ; 89 // 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) { 33cf8: 11 11 cpse r17, r1 33cfa: 02 c0 rjmp .+4 ; 0x33d00 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); 33cfc: 84 e8 ldi r24, 0x84 ; 132 33cfe: 98 e5 ldi r25, 0x58 ; 88 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); 33d00: 0e 94 c4 72 call 0xe588 ; 0xe588 break; } lcd_show_fullscreen_message_and_wait_P(msg); 33d04: 0f 94 c7 1f call 0x23f8e ; 0x23f8e 33d08: 0d c0 rjmp .+26 ; 0x33d24 // 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) 33d0a: af 96 adiw r28, 0x2f ; 47 33d0c: 8f ad ldd r24, Y+63 ; 0x3f 33d0e: af 97 sbiw r28, 0x2f ; 47 33d10: 82 30 cpi r24, 0x02 ; 2 33d12: f1 f4 brne .+60 ; 0x33d50 // Only the center point or all the three front points. msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_BOTH_FAR); 33d14: 83 e1 ldi r24, 0x13 ; 19 33d16: 99 e5 ldi r25, 0x59 ; 89 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); 33d18: 0e 94 c4 72 call 0xe588 ; 0xe588 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); 33d1c: 0f 94 c7 1f call 0x23f8e ; 0x23f8e } if (point_too_far_mask == 0 || result > 0) { 33d20: 11 16 cp r1, r17 33d22: 04 f3 brlt .-64 ; 0x33ce4 //#endif //NEW_XYZCAL lcd_update_enable(true); lcd_update(2); lcd_bed_calibration_show_result(result, point_too_far_mask); if (result >= 0) 33d24: 1f 3f cpi r17, 0xFF ; 255 33d26: 11 f4 brne .+4 ; 0x33d2c 33d28: 0d 94 fe 8d jmp 0x31bfc ; 0x31bfc { // 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); 33d2c: 86 e0 ldi r24, 0x06 ; 6 33d2e: 0e 94 6d ee call 0x1dcda ; 0x1dcda if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 33d32: 8f e5 ldi r24, 0x5F ; 95 33d34: 9f e0 ldi r25, 0x0F ; 15 33d36: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 33d3a: 81 11 cpse r24, r1 33d3c: 0d 94 76 92 jmp 0x324ec ; 0x324ec lcd_show_fullscreen_message_and_wait_P(_T(MSG_BABYSTEP_Z_NOT_SET)); 33d40: 8e e7 ldi r24, 0x7E ; 126 33d42: 9a e5 ldi r25, 0x5A ; 90 33d44: 0e 94 c4 72 call 0xe588 ; 0xe588 33d48: 0f 94 c7 1f call 0x23f8e ; 0x23f8e 33d4c: 0d 94 76 92 jmp 0x324ec ; 0x324ec 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); 33d50: 87 ec ldi r24, 0xC7 ; 199 33d52: 98 e5 ldi r25, 0x58 ; 88 33d54: e1 cf rjmp .-62 ; 0x33d18 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)) 33d56: 89 81 ldd r24, Y+1 ; 0x01 33d58: 9a 81 ldd r25, Y+2 ; 0x02 33d5a: 80 37 cpi r24, 0x70 ; 112 33d5c: 98 40 sbci r25, 0x08 ; 8 33d5e: 10 f0 brcs .+4 ; 0x33d64 33d60: 0d 94 b5 92 jmp 0x3256a ; 0x3256a if ((ret = xyzcal_spiral2(cx, cy, z0 - 2*dz, dz, radius, 180, delay_us, check_pinda, &ad)) != 0) 33d64: ae 01 movw r20, r28 33d66: 4f 5f subi r20, 0xFF ; 255 33d68: 5f 4f sbci r21, 0xFF ; 255 33d6a: 7a 01 movw r14, r20 33d6c: 04 eb ldi r16, 0xB4 ; 180 33d6e: 10 e0 ldi r17, 0x00 ; 0 33d70: 24 e8 ldi r18, 0x84 ; 132 33d72: 33 e0 ldi r19, 0x03 ; 3 33d74: a6 01 movw r20, r12 33d76: 48 5c subi r20, 0xC8 ; 200 33d78: 51 09 sbc r21, r1 33d7a: 69 2d mov r22, r9 33d7c: 78 2d mov r23, r8 33d7e: 8b 2d mov r24, r11 33d80: 9a 2d mov r25, r10 33d82: 0f 94 36 6e call 0x2dc6c ; 0x2dc6c 33d86: 88 23 and r24, r24 33d88: 11 f4 brne .+4 ; 0x33d8e 33d8a: 0d 94 b5 92 jmp 0x3256a ; 0x3256a ad += 1440; 33d8e: 89 81 ldd r24, Y+1 ; 0x01 33d90: 9a 81 ldd r25, Y+2 ; 0x02 33d92: 80 56 subi r24, 0x60 ; 96 33d94: 9a 4f sbci r25, 0xFA ; 250 33d96: 0d 94 d8 8f jmp 0x31fb0 ; 0x31fb0 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) { 33d9a: 00 23 and r16, r16 33d9c: 11 f4 brne .+4 ; 0x33da2 33d9e: 0d 94 5b 95 jmp 0x32ab6 ; 0x32ab6 float a = (r == 1) ? 1.f : ((r == 2) ? ( c1 * measured_pts[2 * i]) : 33da2: 02 30 cpi r16, 0x02 ; 2 33da4: 09 f0 breq .+2 ; 0x33da8 33da6: 49 cf rjmp .-366 ; 0x33c3a 33da8: d2 01 movw r26, r4 33daa: 11 96 adiw r26, 0x01 ; 1 33dac: 2d 91 ld r18, X+ 33dae: 3d 91 ld r19, X+ 33db0: 4d 91 ld r20, X+ 33db2: 5c 91 ld r21, X 33db4: 14 97 sbiw r26, 0x04 ; 4 33db6: 6e 96 adiw r28, 0x1e ; 30 33db8: 6c ad ldd r22, Y+60 ; 0x3c 33dba: 7d ad ldd r23, Y+61 ; 0x3d 33dbc: 8e ad ldd r24, Y+62 ; 0x3e 33dbe: 9f ad ldd r25, Y+63 ; 0x3f 33dc0: 6e 97 sbiw r28, 0x1e ; 30 33dc2: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 33dc6: 4b 01 movw r8, r22 33dc8: 5c 01 movw r10, r24 (-s2 * measured_pts[2 * i + 1])); float b = (c == 1) ? 1.f : 33dca: 60 e0 ldi r22, 0x00 ; 0 33dcc: 70 e0 ldi r23, 0x00 ; 0 33dce: 80 e8 ldi r24, 0x80 ; 128 33dd0: 9f e3 ldi r25, 0x3F ; 63 33dd2: 11 30 cpi r17, 0x01 ; 1 33dd4: 91 f0 breq .+36 ; 0x33dfa ((c == 2) ? ( c1 * measured_pts[2 * i]) : 33dd6: 12 30 cpi r17, 0x02 ; 2 33dd8: 09 f0 breq .+2 ; 0x33ddc 33dda: 3b cf rjmp .-394 ; 0x33c52 33ddc: d2 01 movw r26, r4 33dde: 11 96 adiw r26, 0x01 ; 1 33de0: 2d 91 ld r18, X+ 33de2: 3d 91 ld r19, X+ 33de4: 4d 91 ld r20, X+ 33de6: 5c 91 ld r21, X 33de8: 14 97 sbiw r26, 0x04 ; 4 33dea: 6e 96 adiw r28, 0x1e ; 30 33dec: 6c ad ldd r22, Y+60 ; 0x3c 33dee: 7d ad ldd r23, Y+61 ; 0x3d 33df0: 8e ad ldd r24, Y+62 ; 0x3e 33df2: 9f ad ldd r25, Y+63 ; 0x3f 33df4: 6e 97 sbiw r28, 0x1e ; 30 33df6: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> (-s2 * measured_pts[2 * i + 1])); float w = point_weight_y(i, measured_pts[2 * i + 1]); acc += a * b * w; 33dfa: 9b 01 movw r18, r22 33dfc: ac 01 movw r20, r24 33dfe: c5 01 movw r24, r10 33e00: b4 01 movw r22, r8 33e02: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 33e06: 9b 01 movw r18, r22 33e08: ac 01 movw r20, r24 33e0a: c7 01 movw r24, r14 33e0c: b6 01 movw r22, r12 33e0e: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 33e12: 6b 01 movw r12, r22 33e14: 7c 01 movw r14, r24 33e16: 0d 94 5b 95 jmp 0x32ab6 ; 0x32ab6 // 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 : 33e1a: 81 2c mov r8, r1 33e1c: 91 2c mov r9, r1 33e1e: 50 e8 ldi r21, 0x80 ; 128 33e20: a5 2e mov r10, r21 33e22: 5f e3 ldi r21, 0x3F ; 63 33e24: b5 2e mov r11, r21 ((r == 2) ? (-s1 * measured_pts[2 * i]) : (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : 33e26: 11 11 cpse r17, r1 33e28: 0d 94 35 95 jmp 0x32a6a ; 0x32a6a ((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; 33e2c: 20 e0 ldi r18, 0x00 ; 0 33e2e: 30 e0 ldi r19, 0x00 ; 0 33e30: 40 e8 ldi r20, 0x80 ; 128 33e32: 5f e3 ldi r21, 0x3F ; 63 33e34: ea cf rjmp .-44 ; 0x33e0a // 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) { float a = (r == 1) ? 1.f : 33e36: 81 2c mov r8, r1 33e38: 91 2c mov r9, r1 33e3a: 40 e8 ldi r20, 0x80 ; 128 33e3c: a4 2e mov r10, r20 33e3e: 4f e3 ldi r20, 0x3F ; 63 33e40: 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) { 33e42: 11 11 cpse r17, r1 33e44: c2 cf rjmp .-124 ; 0x33dca 33e46: 0d 94 5b 95 jmp 0x32ab6 ; 0x32ab6 33e4a: 11 11 cpse r17, r1 33e4c: aa cf rjmp .-172 ; 0x33da2 33e4e: 0d 94 5b 95 jmp 0x32ab6 ; 0x32ab6 00033e52 : manage_heater(); manage_inactivity(true); return _stepresult; } static void lcd_selftest_error(TestError testError, const char *_error_1, const char *_error_2) 33e52: 1f 93 push r17 33e54: cf 93 push r28 33e56: df 93 push r29 33e58: 18 2f mov r17, r24 33e5a: eb 01 movw r28, r22 33e5c: 80 e0 ldi r24, 0x00 ; 0 33e5e: 0f 94 c2 4d call 0x29b84 ; 0x29b84 { lcd_beeper_quick_feedback(); FORCE_BL_ON_END; 33e62: 80 e0 ldi r24, 0x00 ; 0 33e64: 0e 94 61 8a call 0x114c2 ; 0x114c2 target_temperature[0] = 0; 33e68: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 33e6c: 10 92 b5 0d sts 0x0DB5, r1 ; 0x800db5 target_temperature_bed = 0; 33e70: 10 92 72 06 sts 0x0672, r1 ; 0x800672 33e74: 10 92 71 06 sts 0x0671, r1 ; 0x800671 manage_heater(); 33e78: 0f 94 2e 38 call 0x2705c ; 0x2705c manage_inactivity(); 33e7c: 80 e0 ldi r24, 0x00 ; 0 33e7e: 0e 94 c7 8a call 0x1158e ; 0x1158e lcd_clear(); 33e82: 0e 94 2b 6f call 0xde56 ; 0xde56 lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_ERROR)); 33e86: 8a ee ldi r24, 0xEA ; 234 33e88: 97 e5 ldi r25, 0x57 ; 87 33e8a: 0e 94 c4 72 call 0xe588 ; 0xe588 33e8e: ac 01 movw r20, r24 33e90: 60 e0 ldi r22, 0x00 ; 0 33e92: 80 e0 ldi r24, 0x00 ; 0 33e94: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_puts_at_P(0, 1, _T(MSG_SELFTEST_PLEASECHECK)); 33e98: 8a ed ldi r24, 0xDA ; 218 33e9a: 97 e5 ldi r25, 0x57 ; 87 33e9c: 0e 94 c4 72 call 0xe588 ; 0xe588 33ea0: ac 01 movw r20, r24 33ea2: 61 e0 ldi r22, 0x01 ; 1 33ea4: 80 e0 ldi r24, 0x00 ; 0 33ea6: 0e 94 0c 6f call 0xde18 ; 0xde18 switch (testError) 33eaa: 11 50 subi r17, 0x01 ; 1 33eac: 1a 30 cpi r17, 0x0A ; 10 33eae: 90 f4 brcc .+36 ; 0x33ed4 33eb0: e1 2f mov r30, r17 33eb2: f0 e0 ldi r31, 0x00 ; 0 33eb4: 88 27 eor r24, r24 33eb6: e0 5a subi r30, 0xA0 ; 160 33eb8: f0 46 sbci r31, 0x60 ; 96 33eba: 8e 4f sbci r24, 0xFE ; 254 33ebc: 0d 94 e7 dc jmp 0x3b9ce ; 0x3b9ce <__tablejump2__> 33ec0: 18 3a cpi r17, 0xA8 ; 168 33ec2: 3c 3b cpi r19, 0xBC ; 188 33ec4: 50 39 cpi r21, 0x90 ; 144 33ec6: 22 3b cpi r18, 0xB2 ; 178 33ec8: 18 3b cpi r17, 0xB8 ; 184 33eca: 22 3a cpi r18, 0xA2 ; 162 33ecc: fe 39 cpi r31, 0x9E ; 158 33ece: 58 3a cpi r21, 0xA8 ; 168 33ed0: bc 3a cpi r27, 0xAC ; 172 33ed2: 62 3a cpi r22, 0xA2 ; 162 { case TestError::Heater: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_HEATERTHERMISTOR)); 33ed4: 86 ec ldi r24, 0xC6 ; 198 33ed6: 97 e5 ldi r25, 0x57 ; 87 33ed8: 0e 94 c4 72 call 0xe588 ; 0xe588 33edc: ac 01 movw r20, r24 33ede: 62 e0 ldi r22, 0x02 ; 2 33ee0: 80 e0 ldi r24, 0x00 ; 0 33ee2: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_NOTCONNECTED)); 33ee6: 86 eb ldi r24, 0xB6 ; 182 33ee8: 97 e5 ldi r25, 0x57 ; 87 lcd_set_cursor(18, 3); lcd_print(_error_1); break; case TestError::WiringFsensor: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR)); lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR)); 33eea: 0e 94 c4 72 call 0xe588 ; 0xe588 33eee: ac 01 movw r20, r24 33ef0: 63 e0 ldi r22, 0x03 ; 3 33ef2: 80 e0 ldi r24, 0x00 ; 0 33ef4: 0e 94 0c 6f call 0xde18 ; 0xde18 33ef8: 45 c0 rjmp .+138 ; 0x33f84 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)); 33efa: 89 ea ldi r24, 0xA9 ; 169 33efc: 97 e5 ldi r25, 0x57 ; 87 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_SWAPPED)); lcd_set_cursor(18, 3); lcd_print(_error_1); break; case TestError::WiringFsensor: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR)); 33efe: 0e 94 c4 72 call 0xe588 ; 0xe588 33f02: ac 01 movw r20, r24 33f04: 62 e0 ldi r22, 0x02 ; 2 33f06: 80 e0 ldi r24, 0x00 ; 0 33f08: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR)); 33f0c: 8a e9 ldi r24, 0x9A ; 154 33f0e: 97 e5 ldi r25, 0x57 ; 87 33f10: ec cf rjmp .-40 ; 0x33eea case TestError::Bed: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_BEDHEATER)); lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR)); break; case TestError::Endstops: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_ENDSTOPS)); 33f12: 8f e8 ldi r24, 0x8F ; 143 33f14: 97 e5 ldi r25, 0x57 ; 87 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)); 33f16: 0e 94 c4 72 call 0xe588 ; 0xe588 33f1a: ac 01 movw r20, r24 33f1c: 62 e0 ldi r22, 0x02 ; 2 33f1e: 80 e0 ldi r24, 0x00 ; 0 33f20: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR)); 33f24: 8a e9 ldi r24, 0x9A ; 154 33f26: 97 e5 ldi r25, 0x57 ; 87 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)); 33f28: 0e 94 c4 72 call 0xe588 ; 0xe588 33f2c: ac 01 movw r20, r24 33f2e: 63 e0 ldi r22, 0x03 ; 3 33f30: 80 e0 ldi r24, 0x00 ; 0 33f32: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_set_cursor(18, 3); 33f36: 63 e0 ldi r22, 0x03 ; 3 33f38: 82 e1 ldi r24, 0x12 ; 18 33f3a: 0e 94 f8 6e call 0xddf0 ; 0xddf0 lcd_print(_error_1); 33f3e: ce 01 movw r24, r28 33f40: 1f c0 rjmp .+62 ; 0x33f80 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)); 33f42: 87 e8 ldi r24, 0x87 ; 135 33f44: 97 e5 ldi r25, 0x57 ; 87 33f46: 0e 94 c4 72 call 0xe588 ; 0xe588 33f4a: ac 01 movw r20, r24 33f4c: 62 e0 ldi r22, 0x02 ; 2 33f4e: 80 e0 ldi r24, 0x00 ; 0 33f50: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_set_cursor(18, 2); 33f54: 62 e0 ldi r22, 0x02 ; 2 33f56: 82 e1 ldi r24, 0x12 ; 18 33f58: 0e 94 f8 6e call 0xddf0 ; 0xddf0 lcd_print(_error_1); 33f5c: ce 01 movw r24, r28 33f5e: 0e 94 ff 70 call 0xe1fe ; 0xe1fe lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_ENDSTOP)); 33f62: 8d e7 ldi r24, 0x7D ; 125 33f64: 97 e5 ldi r25, 0x57 ; 87 33f66: 0e 94 c4 72 call 0xe588 ; 0xe588 33f6a: ac 01 movw r20, r24 33f6c: 63 e0 ldi r22, 0x03 ; 3 33f6e: 80 e0 ldi r24, 0x00 ; 0 33f70: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_set_cursor(18, 3); 33f74: 63 e0 ldi r22, 0x03 ; 3 33f76: 82 e1 ldi r24, 0x12 ; 18 33f78: 0e 94 f8 6e call 0xddf0 ; 0xddf0 lcd_print(_error_2); 33f7c: 86 ef ldi r24, 0xF6 ; 246 33f7e: 92 e0 ldi r25, 0x02 ; 2 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); 33f80: 0e 94 ff 70 call 0xe1fe ; 0xe1fe lcd_set_cursor(0, 3); lcd_printf_P(_T(MSG_SELFTEST_FS_LEVEL),_error_1); break; } _delay(1000); 33f84: 68 ee ldi r22, 0xE8 ; 232 33f86: 73 e0 ldi r23, 0x03 ; 3 33f88: 80 e0 ldi r24, 0x00 ; 0 33f8a: 90 e0 ldi r25, 0x00 ; 0 33f8c: 0f 94 29 27 call 0x24e52 ; 0x24e52 33f90: 80 e0 ldi r24, 0x00 ; 0 33f92: 0f 94 c2 4d call 0x29b84 ; 0x29b84 lcd_beeper_quick_feedback(); do { _delay(100); 33f96: 64 e6 ldi r22, 0x64 ; 100 33f98: 70 e0 ldi r23, 0x00 ; 0 33f9a: 80 e0 ldi r24, 0x00 ; 0 33f9c: 90 e0 ldi r25, 0x00 ; 0 33f9e: 0f 94 29 27 call 0x24e52 ; 0x24e52 manage_heater(); 33fa2: 0f 94 2e 38 call 0x2705c ; 0x2705c manage_inactivity(); 33fa6: 80 e0 ldi r24, 0x00 ; 0 33fa8: 0e 94 c7 8a call 0x1158e ; 0x1158e } while (!lcd_clicked()); 33fac: 0e 94 15 71 call 0xe22a ; 0xe22a 33fb0: 88 23 and r24, r24 33fb2: 89 f3 breq .-30 ; 0x33f96 LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); 33fb4: 81 ee ldi r24, 0xE1 ; 225 33fb6: 96 e5 ldi r25, 0x56 ; 86 33fb8: 0e 94 c4 72 call 0xe588 ; 0xe588 33fbc: 62 e0 ldi r22, 0x02 ; 2 33fbe: 0e 94 f8 f0 call 0x1e1f0 ; 0x1e1f0 lcd_return_to_status(); } 33fc2: df 91 pop r29 33fc4: cf 91 pop r28 33fc6: 1f 91 pop r17 manage_heater(); manage_inactivity(); } while (!lcd_clicked()); LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); lcd_return_to_status(); 33fc8: 0d 94 7c 1e jmp 0x23cf8 ; 0x23cf8 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)); 33fcc: 8b e6 ldi r24, 0x6B ; 107 33fce: 97 e5 ldi r25, 0x57 ; 87 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)); 33fd0: 0e 94 c4 72 call 0xe588 ; 0xe588 33fd4: ac 01 movw r20, r24 33fd6: 62 e0 ldi r22, 0x02 ; 2 33fd8: 80 e0 ldi r24, 0x00 ; 0 33fda: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_MOTOR)); 33fde: 87 e8 ldi r24, 0x87 ; 135 33fe0: 97 e5 ldi r25, 0x57 ; 87 33fe2: a2 cf rjmp .-188 ; 0x33f28 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)); 33fe4: 88 e5 ldi r24, 0x58 ; 88 33fe6: 97 e5 ldi r25, 0x57 ; 87 33fe8: 96 cf rjmp .-212 ; 0x33f16 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)); 33fea: 85 e4 ldi r24, 0x45 ; 69 33fec: 97 e5 ldi r25, 0x57 ; 87 33fee: 93 cf rjmp .-218 ; 0x33f16 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)); 33ff0: 86 e3 ldi r24, 0x36 ; 54 33ff2: 97 e5 ldi r25, 0x57 ; 87 33ff4: ed cf rjmp .-38 ; 0x33fd0 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)); 33ff6: 88 e2 ldi r24, 0x28 ; 40 33ff8: 97 e5 ldi r25, 0x57 ; 87 33ffa: 0e 94 c4 72 call 0xe588 ; 0xe588 33ffe: ac 01 movw r20, r24 34000: 62 e0 ldi r22, 0x02 ; 2 34002: 80 e0 ldi r24, 0x00 ; 0 34004: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_AXIS)); 34008: 81 e2 ldi r24, 0x21 ; 33 3400a: 97 e5 ldi r25, 0x57 ; 87 3400c: 8d cf rjmp .-230 ; 0x33f28 lcd_set_cursor(18, 3); lcd_print(_error_1); break; case TestError::SwappedFan: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FANS)); 3400e: 8f e0 ldi r24, 0x0F ; 15 34010: 97 e5 ldi r25, 0x57 ; 87 34012: 0e 94 c4 72 call 0xe588 ; 0xe588 34016: ac 01 movw r20, r24 34018: 62 e0 ldi r22, 0x02 ; 2 3401a: 80 e0 ldi r24, 0x00 ; 0 3401c: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_SWAPPED)); 34020: 85 e0 ldi r24, 0x05 ; 5 34022: 97 e5 ldi r25, 0x57 ; 87 34024: 81 cf rjmp .-254 ; 0x33f28 lcd_set_cursor(18, 3); lcd_print(_error_1); break; case TestError::WiringFsensor: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR)); 34026: 83 ef ldi r24, 0xF3 ; 243 34028: 96 e5 ldi r25, 0x56 ; 86 3402a: 69 cf rjmp .-302 ; 0x33efe 0003402c : 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, 3402c: 1f 93 push r17 3402e: cf 93 push r28 34030: df 93 push r29 34032: c8 2f mov r28, r24 34034: d6 2f mov r29, r22 const bool _default) { bool _result = check_opposite; lcd_clear(); 34036: 0e 94 2b 6f call 0xde56 ; 0xde56 lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_FAN)); 3403a: 86 ed ldi r24, 0xD6 ; 214 3403c: 96 e5 ldi r25, 0x56 ; 86 3403e: 0e 94 c4 72 call 0xe588 ; 0xe588 34042: ac 01 movw r20, r24 34044: 60 e0 ldi r22, 0x00 ; 0 34046: 80 e0 ldi r24, 0x00 ; 0 34048: 0e 94 0c 6f call 0xde18 ; 0xde18 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)); 3404c: 85 e4 ldi r24, 0x45 ; 69 3404e: 97 e5 ldi r25, 0x57 ; 87 34050: c1 11 cpse r28, r1 34052: 02 c0 rjmp .+4 ; 0x34058 34054: 88 e5 ldi r24, 0x58 ; 88 34056: 97 e5 ldi r25, 0x57 ; 87 34058: 0e 94 c4 72 call 0xe588 ; 0xe588 3405c: ac 01 movw r20, r24 3405e: 61 e0 ldi r22, 0x01 ; 1 34060: 80 e0 ldi r24, 0x00 ; 0 34062: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_selftest_setfan(255); 34066: 8f ef ldi r24, 0xFF ; 255 34068: 0e 94 35 f5 call 0x1ea6a ; 0x1ea6a break; } _delay(500); 3406c: 64 ef ldi r22, 0xF4 ; 244 3406e: 71 e0 ldi r23, 0x01 ; 1 34070: 80 e0 ldi r24, 0x00 ; 0 34072: 90 e0 ldi r25, 0x00 ; 0 34074: 0f 94 29 27 call 0x24e52 ; 0x24e52 lcd_puts_at_P(1, 2, _T(MSG_SELFTEST_FAN_YES)); 34078: 8b ec ldi r24, 0xCB ; 203 3407a: 96 e5 ldi r25, 0x56 ; 86 3407c: 0e 94 c4 72 call 0xe588 ; 0xe588 34080: ac 01 movw r20, r24 34082: 62 e0 ldi r22, 0x02 ; 2 34084: 81 e0 ldi r24, 0x01 ; 1 34086: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_putc_at(0, 3, '>'); 3408a: 4e e3 ldi r20, 0x3E ; 62 3408c: 63 e0 ldi r22, 0x03 ; 3 3408e: 80 e0 ldi r24, 0x00 ; 0 34090: 0e 94 18 6f call 0xde30 ; 0xde30 lcd_puts_P(_T(MSG_SELFTEST_FAN_NO)); 34094: 8c eb ldi r24, 0xBC ; 188 34096: 96 e5 ldi r25, 0x56 ; 86 34098: 0e 94 c4 72 call 0xe588 ; 0xe588 3409c: 0e 94 e3 6e call 0xddc6 ; 0xddc6 lcd_encoder = _default; 340a0: 6d 2f mov r22, r29 340a2: 70 e0 ldi r23, 0x00 ; 0 340a4: 70 93 70 06 sts 0x0670, r23 ; 0x800670 340a8: 60 93 6f 06 sts 0x066F, r22 ; 0x80066f KEEPALIVE_STATE(PAUSED_FOR_USER); 340ac: 84 e0 ldi r24, 0x04 ; 4 340ae: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be lcd_consume_click(); 340b2: 0e 94 10 71 call 0xe220 ; 0xe220 340b6: dc 2f mov r29, r28 do { if (lcd_encoder) { if (lcd_encoder < 0) { _result = !check_opposite; 340b8: 11 e0 ldi r17, 0x01 ; 1 340ba: 1c 27 eor r17, r28 KEEPALIVE_STATE(PAUSED_FOR_USER); lcd_consume_click(); do { if (lcd_encoder) { 340bc: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 340c0: 90 91 70 06 lds r25, 0x0670 ; 0x800670 340c4: 00 97 sbiw r24, 0x00 ; 0 340c6: 19 f1 breq .+70 ; 0x3410e if (lcd_encoder < 0) { 340c8: 97 ff sbrs r25, 7 340ca: 0b c0 rjmp .+22 ; 0x340e2 _result = !check_opposite; 340cc: d1 2f mov r29, r17 lcd_putc_at(0, 2, '>'); 340ce: 4e e3 ldi r20, 0x3E ; 62 340d0: 62 e0 ldi r22, 0x02 ; 2 340d2: 80 e0 ldi r24, 0x00 ; 0 340d4: 0e 94 18 6f call 0xde30 ; 0xde30 lcd_putc_at(0, 3, ' '); 340d8: 40 e2 ldi r20, 0x20 ; 32 340da: 63 e0 ldi r22, 0x03 ; 3 340dc: 80 e0 ldi r24, 0x00 ; 0 340de: 0e 94 18 6f call 0xde30 ; 0xde30 } if (lcd_encoder > 0) { 340e2: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 340e6: 90 91 70 06 lds r25, 0x0670 ; 0x800670 340ea: 18 16 cp r1, r24 340ec: 19 06 cpc r1, r25 340ee: 5c f4 brge .+22 ; 0x34106 _result = check_opposite; lcd_putc_at(0, 2, ' '); 340f0: 40 e2 ldi r20, 0x20 ; 32 340f2: 62 e0 ldi r22, 0x02 ; 2 340f4: 80 e0 ldi r24, 0x00 ; 0 340f6: 0e 94 18 6f call 0xde30 ; 0xde30 lcd_putc_at(0, 3, '>'); 340fa: 4e e3 ldi r20, 0x3E ; 62 340fc: 63 e0 ldi r22, 0x03 ; 3 340fe: 80 e0 ldi r24, 0x00 ; 0 34100: 0e 94 18 6f call 0xde30 ; 0xde30 34104: dc 2f mov r29, r28 } lcd_encoder = 0; 34106: 10 92 70 06 sts 0x0670, r1 ; 0x800670 3410a: 10 92 6f 06 sts 0x066F, r1 ; 0x80066f } manage_heater(); 3410e: 0f 94 2e 38 call 0x2705c ; 0x2705c manage_inactivity(true); 34112: 81 e0 ldi r24, 0x01 ; 1 34114: 0e 94 c7 8a call 0x1158e ; 0x1158e _delay(100); 34118: 64 e6 ldi r22, 0x64 ; 100 3411a: 70 e0 ldi r23, 0x00 ; 0 3411c: 80 e0 ldi r24, 0x00 ; 0 3411e: 90 e0 ldi r25, 0x00 ; 0 34120: 0f 94 29 27 call 0x24e52 ; 0x24e52 } while (!lcd_clicked()); 34124: 0e 94 15 71 call 0xe22a ; 0xe22a 34128: 88 23 and r24, r24 3412a: 41 f2 breq .-112 ; 0x340bc KEEPALIVE_STATE(IN_HANDLER); 3412c: 82 e0 ldi r24, 0x02 ; 2 3412e: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be setExtruderAutoFanState(0); // Turn off hotend fan 34132: 80 e0 ldi r24, 0x00 ; 0 34134: 0e 94 73 75 call 0xeae6 ; 0xeae6 lcd_selftest_setfan(0); // Turn off print fan 34138: 80 e0 ldi r24, 0x00 ; 0 3413a: 0e 94 35 f5 call 0x1ea6a ; 0x1ea6a return _result; } 3413e: 8d 2f mov r24, r29 34140: df 91 pop r29 34142: cf 91 pop r28 34144: 1f 91 pop r17 34146: 08 95 ret 00034148 : #ifdef FANCHECK // Wait for the specified number of seconds while displaying some single-character indicator on the // screen coordinate col/row, then perform fan measurement static void lcd_selftest_measure_fans(uint8_t delay, uint8_t col, uint8_t row) { 34148: cf 93 push r28 3414a: df 93 push r29 3414c: c8 2f mov r28, r24 3414e: d6 2f mov r29, r22 // spin-up delay static char symbols[] = {'-', '|'}; static_assert(1000 / sizeof(symbols) * sizeof(symbols) == 1000); while(delay--) { 34150: c1 50 subi r28, 0x01 ; 1 34152: 98 f0 brcs .+38 ; 0x3417a for(uint8_t i = 0; i != sizeof(symbols); ++i) { lcd_putc_at(col, row, symbols[i]); 34154: 4d e2 ldi r20, 0x2D ; 45 34156: 6d 2f mov r22, r29 34158: 82 e1 ldi r24, 0x12 ; 18 3415a: 0e 94 18 6f call 0xde30 ; 0xde30 delay_keep_alive(1000 / sizeof(symbols)); 3415e: 84 ef ldi r24, 0xF4 ; 244 34160: 91 e0 ldi r25, 0x01 ; 1 34162: 0e 94 fc 8c call 0x119f8 ; 0x119f8 // 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]); 34166: 4c e7 ldi r20, 0x7C ; 124 34168: 6d 2f mov r22, r29 3416a: 82 e1 ldi r24, 0x12 ; 18 3416c: 0e 94 18 6f call 0xde30 ; 0xde30 delay_keep_alive(1000 / sizeof(symbols)); 34170: 84 ef ldi r24, 0xF4 ; 244 34172: 91 e0 ldi r25, 0x01 ; 1 34174: 0e 94 fc 8c call 0x119f8 ; 0x119f8 34178: eb cf rjmp .-42 ; 0x34150 } } #ifdef FANCHECK extruder_autofan_last_check = _millis(); 3417a: 0f 94 22 29 call 0x25244 ; 0x25244 3417e: 60 93 bf 17 sts 0x17BF, r22 ; 0x8017bf 34182: 70 93 c0 17 sts 0x17C0, r23 ; 0x8017c0 34186: 80 93 c1 17 sts 0x17C1, r24 ; 0x8017c1 3418a: 90 93 c2 17 sts 0x17C2, r25 ; 0x8017c2 #endif fan_measuring = true; 3418e: 81 e0 ldi r24, 0x01 ; 1 34190: 80 93 6e 06 sts 0x066E, r24 ; 0x80066e while(fan_measuring) { 34194: 80 91 6e 06 lds r24, 0x066E ; 0x80066e 34198: 88 23 and r24, r24 3419a: 29 f0 breq .+10 ; 0x341a6 delay_keep_alive(100); 3419c: 84 e6 ldi r24, 0x64 ; 100 3419e: 90 e0 ldi r25, 0x00 ; 0 341a0: 0e 94 fc 8c call 0x119f8 ; 0x119f8 341a4: f7 cf rjmp .-18 ; 0x34194 } gcode_M123(); } 341a6: df 91 pop r29 341a8: cf 91 pop r28 fan_measuring = true; while(fan_measuring) { delay_keep_alive(100); } gcode_M123(); 341aa: 0c 94 9c 66 jmp 0xcd38 ; 0xcd38 000341ae : } #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) { 341ae: 4f 92 push r4 341b0: 5f 92 push r5 341b2: 6f 92 push r6 341b4: 7f 92 push r7 341b6: af 92 push r10 341b8: bf 92 push r11 341ba: cf 92 push r12 341bc: df 92 push r13 341be: ef 92 push r14 341c0: ff 92 push r15 341c2: 0f 93 push r16 341c4: 1f 93 push r17 341c6: cf 93 push r28 341c8: df 93 push r29 341ca: 24 e0 ldi r18, 0x04 ; 4 341cc: 30 e0 ldi r19, 0x00 ; 0 341ce: 41 e0 ldi r20, 0x01 ; 1 341d0: 50 e0 ldi r21, 0x00 ; 0 341d2: d9 01 movw r26, r18 341d4: a2 50 subi r26, 0x02 ; 2 341d6: bc 45 sbci r27, 0x5C ; 92 uint8_t i; short (*tt)[][2] = (short (*)[][2])(heater_ttbl_map[e]); for (i=1; i raw) 341d8: fd 01 movw r30, r26 341da: 65 91 lpm r22, Z+ 341dc: 74 91 lpm r23, Z 341de: 86 17 cp r24, r22 341e0: 97 07 cpc r25, r23 341e2: 0c f0 brlt .+2 ; 0x341e6 341e4: 66 c0 rjmp .+204 ; 0x342b2 { celsius = PGM_RD_W((*tt)[i-1][1]) + 341e6: 41 50 subi r20, 0x01 ; 1 341e8: 51 09 sbc r21, r1 341ea: 44 0f add r20, r20 341ec: 55 1f adc r21, r21 341ee: 44 0f add r20, r20 341f0: 55 1f adc r21, r21 341f2: ea 01 movw r28, r20 341f4: c0 50 subi r28, 0x00 ; 0 341f6: dc 45 sbci r29, 0x5C ; 92 341f8: fe 01 movw r30, r28 341fa: 05 91 lpm r16, Z+ 341fc: 14 91 lpm r17, Z (raw - PGM_RD_W((*tt)[i-1][0])) * 341fe: 42 50 subi r20, 0x02 ; 2 34200: 5c 45 sbci r21, 0x5C ; 92 34202: fa 01 movw r30, r20 34204: 65 91 lpm r22, Z+ 34206: 74 91 lpm r23, Z (float)(PGM_RD_W((*tt)[i][1]) - PGM_RD_W((*tt)[i-1][1])) / 34208: f9 01 movw r30, r18 3420a: e0 50 subi r30, 0x00 ; 0 3420c: fc 45 sbci r31, 0x5C ; 92 3420e: e5 90 lpm r14, Z+ 34210: f4 90 lpm r15, Z 34212: fe 01 movw r30, r28 34214: c5 90 lpm r12, Z+ 34216: d4 90 lpm r13, Z (float)(PGM_RD_W((*tt)[i][0]) - PGM_RD_W((*tt)[i-1][0])); 34218: fd 01 movw r30, r26 3421a: c5 91 lpm r28, Z+ 3421c: d4 91 lpm r29, Z 3421e: fa 01 movw r30, r20 34220: a5 90 lpm r10, Z+ 34222: 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])) * 34224: 86 1b sub r24, r22 34226: 97 0b sbc r25, r23 34228: bc 01 movw r22, r24 3422a: 99 0f add r25, r25 3422c: 88 0b sbc r24, r24 3422e: 99 0b sbc r25, r25 34230: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 34234: 2b 01 movw r4, r22 34236: 3c 01 movw r6, r24 (float)(PGM_RD_W((*tt)[i][1]) - PGM_RD_W((*tt)[i-1][1])) / 34238: b7 01 movw r22, r14 3423a: 6c 19 sub r22, r12 3423c: 7d 09 sbc r23, r13 3423e: 07 2e mov r0, r23 34240: 00 0c add r0, r0 34242: 88 0b sbc r24, r24 34244: 99 0b sbc r25, r25 34246: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 3424a: 9b 01 movw r18, r22 3424c: 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])) * 3424e: c3 01 movw r24, r6 34250: b2 01 movw r22, r4 34252: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 34256: 6b 01 movw r12, r22 34258: 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])); 3425a: be 01 movw r22, r28 3425c: 6a 19 sub r22, r10 3425e: 7b 09 sbc r23, r11 34260: 07 2e mov r0, r23 34262: 00 0c add r0, r0 34264: 88 0b sbc r24, r24 34266: 99 0b sbc r25, r25 34268: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 3426c: 9b 01 movw r18, r22 3426e: 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])) / 34270: c7 01 movw r24, r14 34272: b6 01 movw r22, r12 34274: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 34278: 6b 01 movw r12, r22 3427a: 7c 01 movw r14, r24 for (i=1; i raw) { celsius = PGM_RD_W((*tt)[i-1][1]) + 3427c: b8 01 movw r22, r16 3427e: 11 0f add r17, r17 34280: 88 0b sbc r24, r24 34282: 99 0b sbc r25, r25 34284: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 34288: 9b 01 movw r18, r22 3428a: ac 01 movw r20, r24 3428c: c7 01 movw r24, r14 3428e: b6 01 movw r22, r12 34290: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__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; } 34294: df 91 pop r29 34296: cf 91 pop r28 34298: 1f 91 pop r17 3429a: 0f 91 pop r16 3429c: ff 90 pop r15 3429e: ef 90 pop r14 342a0: df 90 pop r13 342a2: cf 90 pop r12 342a4: bf 90 pop r11 342a6: af 90 pop r10 342a8: 7f 90 pop r7 342aa: 6f 90 pop r6 342ac: 5f 90 pop r5 342ae: 4f 90 pop r4 342b0: 08 95 ret 342b2: 4f 5f subi r20, 0xFF ; 255 342b4: 5f 4f sbci r21, 0xFF ; 255 342b6: 2c 5f subi r18, 0xFC ; 252 342b8: 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 342c0: 88 cf rjmp .-240 ; 0x341d2 break; } } // Overflow: Set to last value in the table if (i == heater_ttbllen_map[e]) celsius = PGM_RD_W((*tt)[i-1][1]); 342c2: ec e7 ldi r30, 0x7C ; 124 342c4: f4 ea ldi r31, 0xA4 ; 164 342c6: 65 91 lpm r22, Z+ 342c8: 74 91 lpm r23, Z 342ca: 07 2e mov r0, r23 342cc: 00 0c add r0, r0 342ce: 88 0b sbc r24, r24 342d0: 99 0b sbc r25, r25 342d2: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 342d6: de cf rjmp .-68 ; 0x34294 000342d8 : float mesh_bed_leveling::get_z(float x, float y) { 342d8: 2f 92 push r2 342da: 3f 92 push r3 342dc: 4f 92 push r4 342de: 5f 92 push r5 342e0: 6f 92 push r6 342e2: 7f 92 push r7 342e4: 8f 92 push r8 342e6: 9f 92 push r9 342e8: af 92 push r10 342ea: bf 92 push r11 342ec: cf 92 push r12 342ee: df 92 push r13 342f0: ef 92 push r14 342f2: ff 92 push r15 342f4: 0f 93 push r16 342f6: 1f 93 push r17 342f8: cf 93 push r28 342fa: df 93 push r29 342fc: 00 d0 rcall .+0 ; 0x342fe 342fe: 00 d0 rcall .+0 ; 0x34300 34300: 00 d0 rcall .+0 ; 0x34302 34302: 1f 92 push r1 34304: cd b7 in r28, 0x3d ; 61 34306: de b7 in r29, 0x3e ; 62 34308: 2b 01 movw r4, r22 3430a: 3c 01 movw r6, r24 3430c: 49 01 movw r8, r18 3430e: 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)); 34310: 20 e0 ldi r18, 0x00 ; 0 34312: 30 e0 ldi r19, 0x00 ; 0 34314: 40 ec ldi r20, 0xC0 ; 192 34316: 51 e4 ldi r21, 0x41 ; 65 34318: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 3431c: 20 e0 ldi r18, 0x00 ; 0 3431e: 30 e0 ldi r19, 0x00 ; 0 34320: 48 e0 ldi r20, 0x08 ; 8 34322: 52 e4 ldi r21, 0x42 ; 66 34324: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 34328: 6b 01 movw r12, r22 3432a: 7c 01 movw r14, r24 3432c: 0f 94 a6 de call 0x3bd4c ; 0x3bd4c 34330: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> if (i < 0) { i = 0; 34334: 31 2c mov r3, r1 34336: 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) { 34338: 77 fd sbrc r23, 7 3433a: 1e c0 rjmp .+60 ; 0x34378 3433c: 1b 01 movw r2, r22 3433e: 66 30 cpi r22, 0x06 ; 6 34340: 71 05 cpc r23, r1 34342: 1c f0 brlt .+6 ; 0x3434a 34344: 45 e0 ldi r20, 0x05 ; 5 34346: 24 2e mov r2, r20 34348: 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; } 3434a: 82 2d mov r24, r2 3434c: 0f 94 f0 c9 call 0x393e0 ; 0x393e0 34350: 20 e0 ldi r18, 0x00 ; 0 34352: 30 e0 ldi r19, 0x00 ; 0 34354: 48 eb ldi r20, 0xB8 ; 184 34356: 51 e4 ldi r21, 0x41 ; 65 34358: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 3435c: 9b 01 movw r18, r22 3435e: 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; 34360: c3 01 movw r24, r6 34362: b2 01 movw r22, r4 34364: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 34368: 20 e0 ldi r18, 0x00 ; 0 3436a: 30 e0 ldi r19, 0x00 ; 0 3436c: 48 e0 ldi r20, 0x08 ; 8 3436e: 52 e4 ldi r21, 0x42 ; 66 34370: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 34374: 6b 01 movw r12, r22 34376: 7c 01 movw r14, r24 } j = int(floor((y - (BED_Y0 + Y_PROBE_OFFSET_FROM_EXTRUDER)) / y_mesh_density)); 34378: 20 e0 ldi r18, 0x00 ; 0 3437a: 30 e0 ldi r19, 0x00 ; 0 3437c: 40 ec ldi r20, 0xC0 ; 192 3437e: 50 e4 ldi r21, 0x40 ; 64 34380: c5 01 movw r24, r10 34382: b4 01 movw r22, r8 34384: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 34388: 20 e0 ldi r18, 0x00 ; 0 3438a: 30 e0 ldi r19, 0x00 ; 0 3438c: 48 e0 ldi r20, 0x08 ; 8 3438e: 52 e4 ldi r21, 0x42 ; 66 34390: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 34394: 69 83 std Y+1, r22 ; 0x01 34396: 7a 83 std Y+2, r23 ; 0x02 34398: 8b 83 std Y+3, r24 ; 0x03 3439a: 9c 83 std Y+4, r25 ; 0x04 3439c: 0f 94 a6 de call 0x3bd4c ; 0x3bd4c 343a0: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> if (j < 0) { 343a4: 77 fd sbrc r23, 7 343a6: da c0 rjmp .+436 ; 0x3455c 343a8: 7a 87 std Y+10, r23 ; 0x0a 343aa: 69 87 std Y+9, r22 ; 0x09 343ac: 66 30 cpi r22, 0x06 ; 6 343ae: 71 05 cpc r23, r1 343b0: 24 f0 brlt .+8 ; 0x343ba 343b2: e5 e0 ldi r30, 0x05 ; 5 343b4: f0 e0 ldi r31, 0x00 ; 0 343b6: fa 87 std Y+10, r31 ; 0x0a 343b8: e9 87 std Y+9, r30 ; 0x09 static float get_y(int i) { return BED_Y(i) + Y_PROBE_OFFSET_FROM_EXTRUDER; } 343ba: 89 85 ldd r24, Y+9 ; 0x09 343bc: 0f 94 f0 c9 call 0x393e0 ; 0x393e0 343c0: 20 e0 ldi r18, 0x00 ; 0 343c2: 30 e0 ldi r19, 0x00 ; 0 343c4: 40 ea ldi r20, 0xA0 ; 160 343c6: 50 e4 ldi r21, 0x40 ; 64 343c8: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 343cc: 9b 01 movw r18, r22 343ce: 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; 343d0: c5 01 movw r24, r10 343d2: b4 01 movw r22, r8 343d4: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 343d8: 20 e0 ldi r18, 0x00 ; 0 343da: 30 e0 ldi r19, 0x00 ; 0 343dc: 48 e0 ldi r20, 0x08 ; 8 343de: 52 e4 ldi r21, 0x42 ; 66 343e0: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 343e4: 69 83 std Y+1, r22 ; 0x01 343e6: 7a 83 std Y+2, r23 ; 0x02 343e8: 8b 83 std Y+3, r24 ; 0x03 343ea: 9c 83 std Y+4, r25 ; 0x04 } float si = 1.f-s; 343ec: a7 01 movw r20, r14 343ee: 96 01 movw r18, r12 343f0: 60 e0 ldi r22, 0x00 ; 0 343f2: 70 e0 ldi r23, 0x00 ; 0 343f4: 80 e8 ldi r24, 0x80 ; 128 343f6: 9f e3 ldi r25, 0x3F ; 63 343f8: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 343fc: 2b 01 movw r4, r22 343fe: 3c 01 movw r6, r24 float z0 = si * z_values[j ][i] + s * z_values[j ][i+1]; 34400: 91 01 movw r18, r2 34402: 2f 5f subi r18, 0xFF ; 255 34404: 3f 4f sbci r19, 0xFF ; 255 34406: 3e 83 std Y+6, r19 ; 0x06 34408: 2d 83 std Y+5, r18 ; 0x05 float z1 = si * z_values[j+1][i] + s * z_values[j+1][i+1]; 3440a: 89 85 ldd r24, Y+9 ; 0x09 3440c: 9a 85 ldd r25, Y+10 ; 0x0a 3440e: 01 96 adiw r24, 0x01 ; 1 34410: 98 87 std Y+8, r25 ; 0x08 34412: 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]; 34414: 27 e0 ldi r18, 0x07 ; 7 34416: e9 85 ldd r30, Y+9 ; 0x09 34418: fa 85 ldd r31, Y+10 ; 0x0a 3441a: 2e 9f mul r18, r30 3441c: 80 01 movw r16, r0 3441e: 2f 9f mul r18, r31 34420: 10 0d add r17, r0 34422: 11 24 eor r1, r1 34424: f8 01 movw r30, r16 34426: e2 0d add r30, r2 34428: f3 1d adc r31, r3 3442a: ee 0f add r30, r30 3442c: ff 1f adc r31, r31 3442e: ee 0f add r30, r30 34430: ff 1f adc r31, r31 34432: ef 53 subi r30, 0x3F ; 63 34434: fc 4e sbci r31, 0xEC ; 236 34436: 21 81 ldd r18, Z+1 ; 0x01 34438: 32 81 ldd r19, Z+2 ; 0x02 3443a: 43 81 ldd r20, Z+3 ; 0x03 3443c: 54 81 ldd r21, Z+4 ; 0x04 3443e: c3 01 movw r24, r6 34440: b2 01 movw r22, r4 34442: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 34446: 4b 01 movw r8, r22 34448: 5c 01 movw r10, r24 3444a: ed 81 ldd r30, Y+5 ; 0x05 3444c: fe 81 ldd r31, Y+6 ; 0x06 3444e: e0 0f add r30, r16 34450: f1 1f adc r31, r17 34452: ee 0f add r30, r30 34454: ff 1f adc r31, r31 34456: ee 0f add r30, r30 34458: ff 1f adc r31, r31 3445a: ef 53 subi r30, 0x3F ; 63 3445c: fc 4e sbci r31, 0xEC ; 236 3445e: 21 81 ldd r18, Z+1 ; 0x01 34460: 32 81 ldd r19, Z+2 ; 0x02 34462: 43 81 ldd r20, Z+3 ; 0x03 34464: 54 81 ldd r21, Z+4 ; 0x04 34466: c7 01 movw r24, r14 34468: b6 01 movw r22, r12 3446a: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 3446e: 9b 01 movw r18, r22 34470: ac 01 movw r20, r24 34472: c5 01 movw r24, r10 34474: b4 01 movw r22, r8 34476: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 3447a: 4b 01 movw r8, r22 3447c: 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; 3447e: 29 81 ldd r18, Y+1 ; 0x01 34480: 3a 81 ldd r19, Y+2 ; 0x02 34482: 4b 81 ldd r20, Y+3 ; 0x03 34484: 5c 81 ldd r21, Y+4 ; 0x04 34486: 60 e0 ldi r22, 0x00 ; 0 34488: 70 e0 ldi r23, 0x00 ; 0 3448a: 80 e8 ldi r24, 0x80 ; 128 3448c: 9f e3 ldi r25, 0x3F ; 63 3448e: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 34492: 9b 01 movw r18, r22 34494: ac 01 movw r20, r24 34496: c5 01 movw r24, r10 34498: b4 01 movw r22, r8 3449a: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 3449e: 4b 01 movw r8, r22 344a0: 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]; 344a2: 27 e0 ldi r18, 0x07 ; 7 344a4: ef 81 ldd r30, Y+7 ; 0x07 344a6: f8 85 ldd r31, Y+8 ; 0x08 344a8: 2e 9f mul r18, r30 344aa: c0 01 movw r24, r0 344ac: 2f 9f mul r18, r31 344ae: 90 0d add r25, r0 344b0: 11 24 eor r1, r1 344b2: 9a 87 std Y+10, r25 ; 0x0a 344b4: 89 87 std Y+9, r24 ; 0x09 344b6: fc 01 movw r30, r24 344b8: e2 0d add r30, r2 344ba: f3 1d adc r31, r3 344bc: ee 0f add r30, r30 344be: ff 1f adc r31, r31 344c0: ee 0f add r30, r30 344c2: ff 1f adc r31, r31 344c4: ef 53 subi r30, 0x3F ; 63 344c6: fc 4e sbci r31, 0xEC ; 236 344c8: 21 81 ldd r18, Z+1 ; 0x01 344ca: 32 81 ldd r19, Z+2 ; 0x02 344cc: 43 81 ldd r20, Z+3 ; 0x03 344ce: 54 81 ldd r21, Z+4 ; 0x04 344d0: c3 01 movw r24, r6 344d2: b2 01 movw r22, r4 344d4: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 344d8: 2b 01 movw r4, r22 344da: 3c 01 movw r6, r24 344dc: 89 85 ldd r24, Y+9 ; 0x09 344de: 9a 85 ldd r25, Y+10 ; 0x0a 344e0: ed 81 ldd r30, Y+5 ; 0x05 344e2: fe 81 ldd r31, Y+6 ; 0x06 344e4: 8e 0f add r24, r30 344e6: 9f 1f adc r25, r31 344e8: 88 0f add r24, r24 344ea: 99 1f adc r25, r25 344ec: 88 0f add r24, r24 344ee: 99 1f adc r25, r25 344f0: 8f 53 subi r24, 0x3F ; 63 344f2: 9c 4e sbci r25, 0xEC ; 236 344f4: fc 01 movw r30, r24 344f6: 21 81 ldd r18, Z+1 ; 0x01 344f8: 32 81 ldd r19, Z+2 ; 0x02 344fa: 43 81 ldd r20, Z+3 ; 0x03 344fc: 54 81 ldd r21, Z+4 ; 0x04 344fe: c7 01 movw r24, r14 34500: b6 01 movw r22, r12 34502: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 34506: 9b 01 movw r18, r22 34508: ac 01 movw r20, r24 3450a: c3 01 movw r24, r6 3450c: b2 01 movw r22, r4 3450e: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> return (1.f-t) * z0 + t * z1; 34512: 29 81 ldd r18, Y+1 ; 0x01 34514: 3a 81 ldd r19, Y+2 ; 0x02 34516: 4b 81 ldd r20, Y+3 ; 0x03 34518: 5c 81 ldd r21, Y+4 ; 0x04 3451a: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 3451e: 9b 01 movw r18, r22 34520: ac 01 movw r20, r24 34522: c5 01 movw r24, r10 34524: b4 01 movw r22, r8 34526: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> } 3452a: 2a 96 adiw r28, 0x0a ; 10 3452c: 0f b6 in r0, 0x3f ; 63 3452e: f8 94 cli 34530: de bf out 0x3e, r29 ; 62 34532: 0f be out 0x3f, r0 ; 63 34534: cd bf out 0x3d, r28 ; 61 34536: df 91 pop r29 34538: cf 91 pop r28 3453a: 1f 91 pop r17 3453c: 0f 91 pop r16 3453e: ff 90 pop r15 34540: ef 90 pop r14 34542: df 90 pop r13 34544: cf 90 pop r12 34546: bf 90 pop r11 34548: af 90 pop r10 3454a: 9f 90 pop r9 3454c: 8f 90 pop r8 3454e: 7f 90 pop r7 34550: 6f 90 pop r6 34552: 5f 90 pop r5 34554: 4f 90 pop r4 34556: 3f 90 pop r3 34558: 2f 90 pop r2 3455a: 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; 3455c: 1a 86 std Y+10, r1 ; 0x0a 3455e: 19 86 std Y+9, r1 ; 0x09 34560: 45 cf rjmp .-374 ; 0x343ec 00034562 : 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() 34562: 2f 92 push r2 34564: 3f 92 push r3 34566: 4f 92 push r4 34568: 5f 92 push r5 3456a: 6f 92 push r6 3456c: 7f 92 push r7 3456e: 8f 92 push r8 34570: 9f 92 push r9 34572: af 92 push r10 34574: bf 92 push r11 34576: cf 92 push r12 34578: df 92 push r13 3457a: ef 92 push r14 3457c: ff 92 push r15 3457e: 0f 93 push r16 34580: 1f 93 push r17 34582: cf 93 push r28 34584: df 93 push r29 34586: 00 d0 rcall .+0 ; 0x34588 34588: 00 d0 rcall .+0 ; 0x3458a 3458a: 00 d0 rcall .+0 ; 0x3458c 3458c: cd b7 in r28, 0x3d ; 61 3458e: de b7 in r29, 0x3e ; 62 34590: 01 ec ldi r16, 0xC1 ; 193 34592: 13 e1 ldi r17, 0x13 ; 19 34594: 1f 83 std Y+7, r17 ; 0x07 34596: 0e 83 std Y+6, r16 ; 0x06 34598: 2e 80 ldd r2, Y+6 ; 0x06 3459a: 3f 80 ldd r3, Y+7 ; 0x07 3459c: 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])) 3459e: f1 01 movw r30, r2 345a0: 61 81 ldd r22, Z+1 ; 0x01 345a2: 72 81 ldd r23, Z+2 ; 0x02 345a4: 83 81 ldd r24, Z+3 ; 0x03 345a6: 94 81 ldd r25, Z+4 ; 0x04 345a8: 9b 01 movw r18, r22 345aa: ac 01 movw r20, r24 345ac: 0f 94 0d e1 call 0x3c21a ; 0x3c21a <__unordsf2> 345b0: 88 23 and r24, r24 345b2: 09 f4 brne .+2 ; 0x345b6 345b4: 7c c0 rjmp .+248 ; 0x346ae mesh_bed_leveling() { reset(); } void reset(); static float get_x(int i) { return BED_X(i) + X_PROBE_OFFSET_FROM_EXTRUDER; } 345b6: 89 81 ldd r24, Y+1 ; 0x01 345b8: 0f 94 f0 c9 call 0x393e0 ; 0x393e0 345bc: 20 e0 ldi r18, 0x00 ; 0 345be: 30 e0 ldi r19, 0x00 ; 0 345c0: 48 eb ldi r20, 0xB8 ; 184 345c2: 51 e4 ldi r21, 0x41 ; 65 345c4: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 345c8: 6b 01 movw r12, r22 345ca: 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)) + 345cc: 20 e0 ldi r18, 0x00 ; 0 345ce: 30 e0 ldi r19, 0x00 ; 0 345d0: 4c ef ldi r20, 0xFC ; 252 345d2: 52 e4 ldi r21, 0x42 ; 66 345d4: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 345d8: 2b 01 movw r4, r22 345da: 3c 01 movw r6, r24 345dc: 20 e0 ldi r18, 0x00 ; 0 345de: 30 e0 ldi r19, 0x00 ; 0 345e0: 44 e6 ldi r20, 0x64 ; 100 345e2: 53 e4 ldi r21, 0x43 ; 67 345e4: c7 01 movw r24, r14 345e6: b6 01 movw r22, r12 345e8: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 345ec: 4b 01 movw r8, r22 345ee: 5c 01 movw r10, r24 z_values[j][idx1] * (x - x0) * (x - x2) / ((x1 - x0) * (x1 - x2)) + 345f0: 20 e0 ldi r18, 0x00 ; 0 345f2: 30 e0 ldi r19, 0x00 ; 0 345f4: 40 ec ldi r20, 0xC0 ; 192 345f6: 51 e4 ldi r21, 0x41 ; 65 345f8: c7 01 movw r24, r14 345fa: b6 01 movw r22, r12 345fc: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 34600: 6b 01 movw r12, r22 34602: 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)) + 34604: ee 81 ldd r30, Y+6 ; 0x06 34606: ff 81 ldd r31, Y+7 ; 0x07 34608: 21 81 ldd r18, Z+1 ; 0x01 3460a: 32 81 ldd r19, Z+2 ; 0x02 3460c: 43 81 ldd r20, Z+3 ; 0x03 3460e: 54 81 ldd r21, Z+4 ; 0x04 34610: c3 01 movw r24, r6 34612: b2 01 movw r22, r4 34614: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 34618: a5 01 movw r20, r10 3461a: 94 01 movw r18, r8 3461c: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 34620: 20 e0 ldi r18, 0x00 ; 0 34622: 30 e9 ldi r19, 0x90 ; 144 34624: 42 ea ldi r20, 0xA2 ; 162 34626: 56 e4 ldi r21, 0x46 ; 70 34628: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 3462c: 6a 83 std Y+2, r22 ; 0x02 3462e: 7b 83 std Y+3, r23 ; 0x03 34630: 8c 83 std Y+4, r24 ; 0x04 34632: 9d 83 std Y+5, r25 ; 0x05 z_values[j][idx1] * (x - x0) * (x - x2) / ((x1 - x0) * (x1 - x2)) + 34634: ee 81 ldd r30, Y+6 ; 0x06 34636: ff 81 ldd r31, Y+7 ; 0x07 34638: 25 85 ldd r18, Z+13 ; 0x0d 3463a: 36 85 ldd r19, Z+14 ; 0x0e 3463c: 47 85 ldd r20, Z+15 ; 0x0f 3463e: 50 89 ldd r21, Z+16 ; 0x10 34640: c7 01 movw r24, r14 34642: b6 01 movw r22, r12 34644: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 34648: a5 01 movw r20, r10 3464a: 94 01 movw r18, r8 3464c: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 34650: 20 e0 ldi r18, 0x00 ; 0 34652: 30 e9 ldi r19, 0x90 ; 144 34654: 42 e2 ldi r20, 0x22 ; 34 34656: 56 ec ldi r21, 0xC6 ; 198 34658: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 3465c: 9b 01 movw r18, r22 3465e: 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)) + 34660: 6a 81 ldd r22, Y+2 ; 0x02 34662: 7b 81 ldd r23, Y+3 ; 0x03 34664: 8c 81 ldd r24, Y+4 ; 0x04 34666: 9d 81 ldd r25, Y+5 ; 0x05 34668: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 3466c: 4b 01 movw r8, r22 3466e: 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)); 34670: ee 81 ldd r30, Y+6 ; 0x06 34672: ff 81 ldd r31, Y+7 ; 0x07 34674: 21 8d ldd r18, Z+25 ; 0x19 34676: 32 8d ldd r19, Z+26 ; 0x1a 34678: 43 8d ldd r20, Z+27 ; 0x1b 3467a: 54 8d ldd r21, Z+28 ; 0x1c 3467c: c7 01 movw r24, r14 3467e: b6 01 movw r22, r12 34680: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 34684: a3 01 movw r20, r6 34686: 92 01 movw r18, r4 34688: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 3468c: 20 e0 ldi r18, 0x00 ; 0 3468e: 30 e9 ldi r19, 0x90 ; 144 34690: 42 ea ldi r20, 0xA2 ; 162 34692: 56 e4 ldi r21, 0x46 ; 70 34694: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 34698: 9b 01 movw r18, r22 3469a: 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)) + 3469c: c5 01 movw r24, r10 3469e: b4 01 movw r22, r8 346a0: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__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] = 346a4: f1 01 movw r30, r2 346a6: 61 83 std Z+1, r22 ; 0x01 346a8: 72 83 std Z+2, r23 ; 0x02 346aa: 83 83 std Z+3, r24 ; 0x03 346ac: 94 83 std Z+4, r25 ; 0x04 346ae: f4 e0 ldi r31, 0x04 ; 4 346b0: 2f 0e add r2, r31 346b2: 31 1c adc r3, r1 346b4: 29 81 ldd r18, Y+1 ; 0x01 346b6: 2f 5f subi r18, 0xFF ; 255 346b8: 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) { 346ba: 27 30 cpi r18, 0x07 ; 7 346bc: 09 f0 breq .+2 ; 0x346c0 346be: 6f cf rjmp .-290 ; 0x3459e 346c0: 8e 81 ldd r24, Y+6 ; 0x06 346c2: 9f 81 ldd r25, Y+7 ; 0x07 346c4: 4c 96 adiw r24, 0x1c ; 28 346c6: 9f 83 std Y+7, r25 ; 0x07 346c8: 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) { 346ca: 85 58 subi r24, 0x85 ; 133 346cc: 94 41 sbci r25, 0x14 ; 20 346ce: 09 f0 breq .+2 ; 0x346d2 346d0: 63 cf rjmp .-314 ; 0x34598 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() 346d2: 19 87 std Y+9, r17 ; 0x09 346d4: 08 87 std Y+8, r16 ; 0x08 346d6: f1 e0 ldi r31, 0x01 ; 1 346d8: 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)) + 346da: c8 01 movw r24, r16 346dc: 8b 5a subi r24, 0xAB ; 171 346de: 9f 4f sbci r25, 0xFF ; 255 346e0: 9f 83 std Y+7, r25 ; 0x07 346e2: 8e 83 std Y+6, r24 ; 0x06 z_values[idx2][i] * (y - y0) * (y - y1) / ((y2 - y0) * (y2 - y1)); 346e4: 18 01 movw r2, r16 346e6: 99 ea ldi r25, 0xA9 ; 169 346e8: 29 0e add r2, r25 346ea: 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])) 346ec: e8 85 ldd r30, Y+8 ; 0x08 346ee: f9 85 ldd r31, Y+9 ; 0x09 346f0: 65 8d ldd r22, Z+29 ; 0x1d 346f2: 76 8d ldd r23, Z+30 ; 0x1e 346f4: 87 8d ldd r24, Z+31 ; 0x1f 346f6: 90 a1 ldd r25, Z+32 ; 0x20 346f8: 9b 01 movw r18, r22 346fa: ac 01 movw r20, r24 346fc: 0f 94 0d e1 call 0x3c21a ; 0x3c21a <__unordsf2> 34700: 88 23 and r24, r24 34702: 09 f4 brne .+2 ; 0x34706 34704: 79 c0 rjmp .+242 ; 0x347f8 static float get_y(int i) { return BED_Y(i) + Y_PROBE_OFFSET_FROM_EXTRUDER; } 34706: 89 81 ldd r24, Y+1 ; 0x01 34708: 0f 94 f0 c9 call 0x393e0 ; 0x393e0 3470c: 20 e0 ldi r18, 0x00 ; 0 3470e: 30 e0 ldi r19, 0x00 ; 0 34710: 40 ea ldi r20, 0xA0 ; 160 34712: 50 e4 ldi r21, 0x40 ; 64 34714: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 34718: 6b 01 movw r12, r22 3471a: 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)) + 3471c: 20 e0 ldi r18, 0x00 ; 0 3471e: 30 e0 ldi r19, 0x00 ; 0 34720: 48 ed ldi r20, 0xD8 ; 216 34722: 52 e4 ldi r21, 0x42 ; 66 34724: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 34728: 2b 01 movw r4, r22 3472a: 3c 01 movw r6, r24 3472c: 20 e0 ldi r18, 0x00 ; 0 3472e: 30 e0 ldi r19, 0x00 ; 0 34730: 42 e5 ldi r20, 0x52 ; 82 34732: 53 e4 ldi r21, 0x43 ; 67 34734: c7 01 movw r24, r14 34736: b6 01 movw r22, r12 34738: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 3473c: 4b 01 movw r8, r22 3473e: 5c 01 movw r10, r24 z_values[idx1][i] * (y - y0) * (y - y2) / ((y1 - y0) * (y1 - y2)) + 34740: 20 e0 ldi r18, 0x00 ; 0 34742: 30 e0 ldi r19, 0x00 ; 0 34744: 40 ec ldi r20, 0xC0 ; 192 34746: 50 e4 ldi r21, 0x40 ; 64 34748: c7 01 movw r24, r14 3474a: b6 01 movw r22, r12 3474c: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 34750: 6b 01 movw r12, r22 34752: 7c 01 movw r14, r24 34754: ee 81 ldd r30, Y+6 ; 0x06 34756: ff 81 ldd r31, Y+7 ; 0x07 34758: 20 81 ld r18, Z 3475a: 31 81 ldd r19, Z+1 ; 0x01 3475c: 42 81 ldd r20, Z+2 ; 0x02 3475e: 53 81 ldd r21, Z+3 ; 0x03 34760: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 34764: a5 01 movw r20, r10 34766: 94 01 movw r18, r8 34768: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 3476c: 20 e0 ldi r18, 0x00 ; 0 3476e: 30 e9 ldi r19, 0x90 ; 144 34770: 42 e2 ldi r20, 0x22 ; 34 34772: 56 ec ldi r21, 0xC6 ; 198 34774: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 34778: 6a 83 std Y+2, r22 ; 0x02 3477a: 7b 83 std Y+3, r23 ; 0x03 3477c: 8c 83 std Y+4, r24 ; 0x04 3477e: 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)) + 34780: f8 01 movw r30, r16 34782: 21 81 ldd r18, Z+1 ; 0x01 34784: 32 81 ldd r19, Z+2 ; 0x02 34786: 43 81 ldd r20, Z+3 ; 0x03 34788: 54 81 ldd r21, Z+4 ; 0x04 3478a: c3 01 movw r24, r6 3478c: b2 01 movw r22, r4 3478e: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 34792: a5 01 movw r20, r10 34794: 94 01 movw r18, r8 34796: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 3479a: 20 e0 ldi r18, 0x00 ; 0 3479c: 30 e9 ldi r19, 0x90 ; 144 3479e: 42 ea ldi r20, 0xA2 ; 162 347a0: 56 e4 ldi r21, 0x46 ; 70 347a2: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 347a6: 9b 01 movw r18, r22 347a8: ac 01 movw r20, r24 347aa: 6a 81 ldd r22, Y+2 ; 0x02 347ac: 7b 81 ldd r23, Y+3 ; 0x03 347ae: 8c 81 ldd r24, Y+4 ; 0x04 347b0: 9d 81 ldd r25, Y+5 ; 0x05 347b2: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 347b6: 4b 01 movw r8, r22 347b8: 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)); 347ba: f1 01 movw r30, r2 347bc: 20 81 ld r18, Z 347be: 31 81 ldd r19, Z+1 ; 0x01 347c0: 42 81 ldd r20, Z+2 ; 0x02 347c2: 53 81 ldd r21, Z+3 ; 0x03 347c4: c7 01 movw r24, r14 347c6: b6 01 movw r22, r12 347c8: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 347cc: a3 01 movw r20, r6 347ce: 92 01 movw r18, r4 347d0: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 347d4: 20 e0 ldi r18, 0x00 ; 0 347d6: 30 e9 ldi r19, 0x90 ; 144 347d8: 42 ea ldi r20, 0xA2 ; 162 347da: 56 e4 ldi r21, 0x46 ; 70 347dc: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 347e0: 9b 01 movw r18, r22 347e2: 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)) + 347e4: c5 01 movw r24, r10 347e6: b4 01 movw r22, r8 347e8: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__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] = 347ec: e8 85 ldd r30, Y+8 ; 0x08 347ee: f9 85 ldd r31, Y+9 ; 0x09 347f0: 65 8f std Z+29, r22 ; 0x1d 347f2: 76 8f std Z+30, r23 ; 0x1e 347f4: 87 8f std Z+31, r24 ; 0x1f 347f6: 90 a3 std Z+32, r25 ; 0x20 347f8: 88 85 ldd r24, Y+8 ; 0x08 347fa: 99 85 ldd r25, Y+9 ; 0x09 347fc: 4c 96 adiw r24, 0x1c ; 28 347fe: 99 87 std Y+9, r25 ; 0x09 34800: 88 87 std Y+8, r24 ; 0x08 34802: 99 81 ldd r25, Y+1 ; 0x01 34804: 9f 5f subi r25, 0xFF ; 255 34806: 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) { 34808: 96 30 cpi r25, 0x06 ; 6 3480a: 09 f0 breq .+2 ; 0x3480e 3480c: 6f cf rjmp .-290 ; 0x346ec 3480e: 0c 5f subi r16, 0xFC ; 252 34810: 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) { 34812: e3 e1 ldi r30, 0x13 ; 19 34814: 0d 3d cpi r16, 0xDD ; 221 34816: 1e 07 cpc r17, r30 34818: 09 f0 breq .+2 ; 0x3481c 3481a: 5b cf rjmp .-330 ; 0x346d2 z_values[idx1][i] * (y - y0) * (y - y2) / ((y1 - y0) * (y1 - y2)) + z_values[idx2][i] * (y - y0) * (y - y1) / ((y2 - y0) * (y2 - y1)); } } } } 3481c: 29 96 adiw r28, 0x09 ; 9 3481e: 0f b6 in r0, 0x3f ; 63 34820: f8 94 cli 34822: de bf out 0x3e, r29 ; 62 34824: 0f be out 0x3f, r0 ; 63 34826: cd bf out 0x3d, r28 ; 61 34828: df 91 pop r29 3482a: cf 91 pop r28 3482c: 1f 91 pop r17 3482e: 0f 91 pop r16 34830: ff 90 pop r15 34832: ef 90 pop r14 34834: df 90 pop r13 34836: cf 90 pop r12 34838: bf 90 pop r11 3483a: af 90 pop r10 3483c: 9f 90 pop r9 3483e: 8f 90 pop r8 34840: 7f 90 pop r7 34842: 6f 90 pop r6 34844: 5f 90 pop r5 34846: 4f 90 pop r4 34848: 3f 90 pop r3 3484a: 2f 90 pop r2 3484c: 08 95 ret 0003484e : 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) { 3484e: 1f 93 push r17 34850: cf 93 push r28 34852: df 93 push r29 34854: 00 d0 rcall .+0 ; 0x34856 34856: 1f 92 push r1 34858: 1f 92 push r1 3485a: cd b7 in r28, 0x3d ; 61 3485c: de b7 in r29, 0x3e ; 62 3485e: 16 2f mov r17, r22 SendMsg(RequestMsg(RequestMsgCodes::Read, index)); 34860: 48 2f mov r20, r24 34862: 62 e5 ldi r22, 0x52 ; 82 34864: ce 01 movw r24, r28 34866: 01 96 adiw r24, 0x01 ; 1 34868: 0f 94 48 c5 call 0x38a90 ; 0x38a90 3486c: 49 81 ldd r20, Y+1 ; 0x01 3486e: 5a 81 ldd r21, Y+2 ; 0x02 34870: 6b 81 ldd r22, Y+3 ; 0x03 34872: 7c 81 ldd r23, Y+4 ; 0x04 34874: 8d 81 ldd r24, Y+5 ; 0x05 34876: 0f 94 57 66 call 0x2ccae ; 0x2ccae scopeState = nextState; 3487a: 10 93 4d 13 sts 0x134D, r17 ; 0x80134d } 3487e: 0f 90 pop r0 34880: 0f 90 pop r0 34882: 0f 90 pop r0 34884: 0f 90 pop r0 34886: 0f 90 pop r0 34888: df 91 pop r29 3488a: cf 91 pop r28 3488c: 1f 91 pop r17 3488e: 08 95 ret 00034890 : SendMsg(RequestMsg(RequestMsgCodes::Query, 0)); scopeState = ScopeState::QuerySent; } void ProtocolLogic::StartReading8bitRegisters() { regIndex = 0; 34890: 10 92 98 13 sts 0x1398, r1 ; 0x801398 SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); 34894: e0 e9 ldi r30, 0x90 ; 144 34896: fb ea ldi r31, 0xAB ; 171 34898: 84 91 lpm r24, Z 3489a: 67 e0 ldi r22, 0x07 ; 7 3489c: 0d 94 27 a4 jmp 0x3484e ; 0x3484e 000348a0 : regIndex = 0; SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); } ProtocolLogic::ScopeState __attribute__((noinline)) ProtocolLogic::ProcessRead16bitRegister(ProtocolLogic::ScopeState stateAtEnd) { regs16[regIndex] = rsp.paramValue; 348a0: e0 91 98 13 lds r30, 0x1398 ; 0x801398 348a4: ae 2f mov r26, r30 348a6: b0 e0 ldi r27, 0x00 ; 0 348a8: aa 0f add r26, r26 348aa: bb 1f adc r27, r27 348ac: ae 56 subi r26, 0x6E ; 110 348ae: bc 4e sbci r27, 0xEC ; 236 348b0: 20 91 65 13 lds r18, 0x1365 ; 0x801365 348b4: 30 91 66 13 lds r19, 0x1366 ; 0x801366 348b8: 2d 93 st X+, r18 348ba: 3c 93 st X, r19 ++regIndex; 348bc: ef 5f subi r30, 0xFF ; 255 348be: e0 93 98 13 sts 0x1398, r30 ; 0x801398 if (regIndex >= regs16Count) { 348c2: e2 30 cpi r30, 0x02 ; 2 348c4: 40 f4 brcc .+16 ; 0x348d6 return stateAtEnd; } else { SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); 348c6: f0 e0 ldi r31, 0x00 ; 0 348c8: e9 58 subi r30, 0x89 ; 137 348ca: f4 45 sbci r31, 0x54 ; 84 348cc: 84 91 lpm r24, Z 348ce: 68 e0 ldi r22, 0x08 ; 8 348d0: 0f 94 27 a4 call 0x3484e ; 0x3484e } return ScopeState::Reading16bitRegisters; 348d4: 88 e0 ldi r24, 0x08 ; 8 } 348d6: 08 95 ret 000348d8 : regIndex = 0; SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); } void ProtocolLogic::ProcessRead8bitRegister() { regs8[regIndex] = rsp.paramValue; 348d8: e0 91 98 13 lds r30, 0x1398 ; 0x801398 348dc: ae 2f mov r26, r30 348de: b0 e0 ldi r27, 0x00 ; 0 348e0: a1 57 subi r26, 0x71 ; 113 348e2: bc 4e sbci r27, 0xEC ; 236 348e4: 80 91 65 13 lds r24, 0x1365 ; 0x801365 348e8: 8c 93 st X, r24 ++regIndex; 348ea: ef 5f subi r30, 0xFF ; 255 348ec: e0 93 98 13 sts 0x1398, r30 ; 0x801398 if (regIndex >= regs8Count) { 348f0: e3 30 cpi r30, 0x03 ; 3 348f2: 40 f0 brcs .+16 ; 0x34904 SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); } } void ProtocolLogic::StartReading16bitRegisters() { regIndex = 0; 348f4: 10 92 98 13 sts 0x1398, r1 ; 0x801398 SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); 348f8: e7 e7 ldi r30, 0x77 ; 119 348fa: fb ea ldi r31, 0xAB ; 171 348fc: 84 91 lpm r24, Z 348fe: 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); 34900: 0d 94 27 a4 jmp 0x3484e ; 0x3484e 34904: f0 e0 ldi r31, 0x00 ; 0 34906: e0 57 subi r30, 0x70 ; 112 34908: f4 45 sbci r31, 0x54 ; 84 3490a: 84 91 lpm r24, Z 3490c: 67 e0 ldi r22, 0x07 ; 7 3490e: f8 cf rjmp .-16 ; 0x34900 00034910 : if (!ExpectsResponse()) { ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } bool ProtocolLogic::ActivatePlannedRequest() { 34910: cf 93 push r28 34912: df 93 push r29 34914: 00 d0 rcall .+0 ; 0x34916 34916: 00 d0 rcall .+0 ; 0x34918 34918: 00 d0 rcall .+0 ; 0x3491a 3491a: 1f 92 push r1 3491c: cd b7 in r28, 0x3d ; 61 3491e: de b7 in r29, 0x3e ; 62 switch (plannedRq.code) { 34920: 80 91 54 13 lds r24, 0x1354 ; 0x801354 34924: 82 34 cpi r24, 0x42 ; 66 34926: 09 f4 brne .+2 ; 0x3492a 34928: 46 c0 rjmp .+140 ; 0x349b6 3492a: b8 f5 brcc .+110 ; 0x3499a 3492c: 88 23 and r24, r24 3492e: 09 f4 brne .+2 ; 0x34932 34930: 72 c0 rjmp .+228 ; 0x34a16 plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); return true; case RequestMsgCodes::unknown: return false; default: // commands currentScope = Scope::Command; 34932: 84 e0 ldi r24, 0x04 ; 4 34934: 80 93 4c 13 sts 0x134C, r24 ; 0x80134c 34938: 85 e0 ldi r24, 0x05 ; 5 3493a: e4 e5 ldi r30, 0x54 ; 84 3493c: f3 e1 ldi r31, 0x13 ; 19 3493e: de 01 movw r26, r28 34940: 16 96 adiw r26, 0x06 ; 6 34942: 01 90 ld r0, Z+ 34944: 0d 92 st X+, r0 34946: 8a 95 dec r24 34948: e1 f7 brne .-8 ; 0x34942 StepStatus StoppedStep() { return Processing; } StepStatus ProcessCommandQueryResponse(); inline void SetRequestMsg(RequestMsg msg) { rq = msg; 3494a: 85 e0 ldi r24, 0x05 ; 5 3494c: fe 01 movw r30, r28 3494e: 36 96 adiw r30, 0x06 ; 6 34950: af e4 ldi r26, 0x4F ; 79 34952: b3 e1 ldi r27, 0x13 ; 19 34954: 01 90 ld r0, Z+ 34956: 0d 92 st X+, r0 34958: 8a 95 dec r24 3495a: e1 f7 brne .-8 ; 0x34954 SetRequestMsg(plannedRq); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); 3495c: 40 e0 ldi r20, 0x00 ; 0 3495e: 60 e0 ldi r22, 0x00 ; 0 34960: ce 01 movw r24, r28 34962: 01 96 adiw r24, 0x01 ; 1 34964: 0f 94 48 c5 call 0x38a90 ; 0x38a90 34968: 85 e0 ldi r24, 0x05 ; 5 3496a: fe 01 movw r30, r28 3496c: 31 96 adiw r30, 0x01 ; 1 3496e: a4 e5 ldi r26, 0x54 ; 84 34970: b3 e1 ldi r27, 0x13 ; 19 34972: 01 90 ld r0, Z+ 34974: 0d 92 st X+, r0 34976: 8a 95 dec r24 34978: e1 f7 brne .-8 ; 0x34972 void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; } void ProtocolLogic::CommandRestart() { scopeState = ScopeState::CommandSent; 3497a: 85 e0 ldi r24, 0x05 ; 5 3497c: 80 93 4d 13 sts 0x134D, r24 ; 0x80134d SendMsg(rq); 34980: 40 91 4f 13 lds r20, 0x134F ; 0x80134f 34984: 50 91 50 13 lds r21, 0x1350 ; 0x801350 34988: 60 91 51 13 lds r22, 0x1351 ; 0x801351 3498c: 70 91 52 13 lds r23, 0x1352 ; 0x801352 34990: 80 91 53 13 lds r24, 0x1353 ; 0x801353 34994: 0f 94 57 66 call 0x2ccae ; 0x2ccae 34998: 2e c0 rjmp .+92 ; 0x349f6 ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } bool ProtocolLogic::ActivatePlannedRequest() { switch (plannedRq.code) { 3499a: 82 35 cpi r24, 0x52 ; 82 3499c: b1 f1 breq .+108 ; 0x34a0a 3499e: 87 35 cpi r24, 0x57 ; 87 349a0: 41 f6 brne .-112 ; 0x34932 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); 349a2: 60 91 56 13 lds r22, 0x1356 ; 0x801356 349a6: 70 91 57 13 lds r23, 0x1357 ; 0x801357 349aa: 4c e0 ldi r20, 0x0C ; 12 349ac: 80 91 55 13 lds r24, 0x1355 ; 0x801355 349b0: 0f 94 c2 66 call 0x2cd84 ; 0x2cd84 349b4: 11 c0 rjmp .+34 ; 0x349d8 SendMsg(RequestMsg(RequestMsgCodes::FilamentSensor, lastFSensor = (uint8_t)WhereIsFilament())); scopeState = ScopeState::FilamentSensorStateSent; } void ProtocolLogic::SendButton(uint8_t btn) { SendMsg(RequestMsg(RequestMsgCodes::Button, btn)); 349b6: 40 91 55 13 lds r20, 0x1355 ; 0x801355 349ba: 62 e4 ldi r22, 0x42 ; 66 349bc: ce 01 movw r24, r28 349be: 01 96 adiw r24, 0x01 ; 1 349c0: 0f 94 48 c5 call 0x38a90 ; 0x38a90 349c4: 49 81 ldd r20, Y+1 ; 0x01 349c6: 5a 81 ldd r21, Y+2 ; 0x02 349c8: 6b 81 ldd r22, Y+3 ; 0x03 349ca: 7c 81 ldd r23, Y+4 ; 0x04 349cc: 8d 81 ldd r24, Y+5 ; 0x05 349ce: 0f 94 57 66 call 0x2ccae ; 0x2ccae scopeState = ScopeState::ButtonSent; 349d2: 8a e0 ldi r24, 0x0A ; 10 349d4: 80 93 4d 13 sts 0x134D, r24 ; 0x80134d 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); 349d8: 40 e0 ldi r20, 0x00 ; 0 349da: 60 e0 ldi r22, 0x00 ; 0 349dc: ce 01 movw r24, r28 349de: 01 96 adiw r24, 0x01 ; 1 349e0: 0f 94 48 c5 call 0x38a90 ; 0x38a90 349e4: 85 e0 ldi r24, 0x05 ; 5 349e6: fe 01 movw r30, r28 349e8: 31 96 adiw r30, 0x01 ; 1 349ea: a4 e5 ldi r26, 0x54 ; 84 349ec: b3 e1 ldi r27, 0x13 ; 19 349ee: 01 90 ld r0, Z+ 349f0: 0d 92 st X+, r0 349f2: 8a 95 dec r24 349f4: e1 f7 brne .-8 ; 0x349ee default: // commands currentScope = Scope::Command; SetRequestMsg(plannedRq); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); CommandRestart(); return true; 349f6: 81 e0 ldi r24, 0x01 ; 1 } } 349f8: 2a 96 adiw r28, 0x0a ; 10 349fa: 0f b6 in r0, 0x3f ; 63 349fc: f8 94 cli 349fe: de bf out 0x3e, r29 ; 62 34a00: 0f be out 0x3f, r0 ; 63 34a02: cd bf out 0x3d, r28 ; 61 34a04: df 91 pop r29 34a06: cf 91 pop r28 34a08: 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); 34a0a: 6b e0 ldi r22, 0x0B ; 11 34a0c: 80 91 55 13 lds r24, 0x1355 ; 0x801355 34a10: 0f 94 27 a4 call 0x3484e ; 0x3484e 34a14: e1 cf rjmp .-62 ; 0x349d8 case RequestMsgCodes::Write: SendWriteRegister(plannedRq.value, plannedRq.value2, ScopeState::WriteRegisterSent); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); return true; case RequestMsgCodes::unknown: return false; 34a16: 80 e0 ldi r24, 0x00 ; 0 34a18: ef cf rjmp .-34 ; 0x349f8 00034a1a : void ProtocolLogic::WriteRegister(uint8_t address, uint16_t data) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Write, address, data)); } void ProtocolLogic::PlanGenericRequest(RequestMsg rq) { 34a1a: cf 93 push r28 34a1c: df 93 push r29 34a1e: 00 d0 rcall .+0 ; 0x34a20 34a20: 1f 92 push r1 34a22: 1f 92 push r1 34a24: cd b7 in r28, 0x3d ; 61 34a26: de b7 in r29, 0x3e ; 62 34a28: 49 83 std Y+1, r20 ; 0x01 34a2a: 5a 83 std Y+2, r21 ; 0x02 34a2c: 6b 83 std Y+3, r22 ; 0x03 34a2e: 7c 83 std Y+4, r23 ; 0x04 34a30: 8d 83 std Y+5, r24 ; 0x05 plannedRq = rq; 34a32: 85 e0 ldi r24, 0x05 ; 5 34a34: fe 01 movw r30, r28 34a36: 31 96 adiw r30, 0x01 ; 1 34a38: a4 e5 ldi r26, 0x54 ; 84 34a3a: b3 e1 ldi r27, 0x13 ; 19 34a3c: 01 90 ld r0, Z+ 34a3e: 0d 92 st X+, r0 34a40: 8a 95 dec r24 34a42: e1 f7 brne .-8 ; 0x34a3c if (!ExpectsResponse()) { 34a44: 80 91 4d 13 lds r24, 0x134D ; 0x80134d 34a48: 87 ff sbrs r24, 7 34a4a: 09 c0 rjmp .+18 ; 0x34a5e ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } 34a4c: 0f 90 pop r0 34a4e: 0f 90 pop r0 34a50: 0f 90 pop r0 34a52: 0f 90 pop r0 34a54: 0f 90 pop r0 34a56: df 91 pop r29 34a58: cf 91 pop r28 } void ProtocolLogic::PlanGenericRequest(RequestMsg rq) { plannedRq = rq; if (!ExpectsResponse()) { ActivatePlannedRequest(); 34a5a: 0d 94 88 a4 jmp 0x34910 ; 0x34910 } // otherwise wait for an empty window to activate the request } 34a5e: 0f 90 pop r0 34a60: 0f 90 pop r0 34a62: 0f 90 pop r0 34a64: 0f 90 pop r0 34a66: 0f 90 pop r0 34a68: df 91 pop r29 34a6a: cf 91 pop r28 34a6c: 08 95 ret 00034a6e : void ProtocolLogic::SendButton(uint8_t btn) { SendMsg(RequestMsg(RequestMsgCodes::Button, btn)); scopeState = ScopeState::ButtonSent; } void ProtocolLogic::SendVersion(uint8_t stage) { 34a6e: 1f 93 push r17 34a70: cf 93 push r28 34a72: df 93 push r29 34a74: 00 d0 rcall .+0 ; 0x34a76 34a76: 1f 92 push r1 34a78: 1f 92 push r1 34a7a: cd b7 in r28, 0x3d ; 61 34a7c: de b7 in r29, 0x3e ; 62 34a7e: 18 2f mov r17, r24 SendMsg(RequestMsg(RequestMsgCodes::Version, stage)); 34a80: 48 2f mov r20, r24 34a82: 63 e5 ldi r22, 0x53 ; 83 34a84: ce 01 movw r24, r28 34a86: 01 96 adiw r24, 0x01 ; 1 34a88: 0f 94 48 c5 call 0x38a90 ; 0x38a90 34a8c: 49 81 ldd r20, Y+1 ; 0x01 34a8e: 5a 81 ldd r21, Y+2 ; 0x02 34a90: 6b 81 ldd r22, Y+3 ; 0x03 34a92: 7c 81 ldd r23, Y+4 ; 0x04 34a94: 8d 81 ldd r24, Y+5 ; 0x05 34a96: 0f 94 57 66 call 0x2ccae ; 0x2ccae scopeState = (ScopeState)((uint_fast8_t)ScopeState::S0Sent + stage); 34a9a: 10 93 4d 13 sts 0x134D, r17 ; 0x80134d } 34a9e: 0f 90 pop r0 34aa0: 0f 90 pop r0 34aa2: 0f 90 pop r0 34aa4: 0f 90 pop r0 34aa6: 0f 90 pop r0 34aa8: df 91 pop r29 34aaa: cf 91 pop r28 34aac: 1f 91 pop r17 34aae: 08 95 ret 00034ab0 : if (fs != lastFSensor) { SendAndUpdateFilamentSensor(); } } void ProtocolLogic::SendQuery() { 34ab0: cf 93 push r28 34ab2: df 93 push r29 34ab4: 00 d0 rcall .+0 ; 0x34ab6 34ab6: 1f 92 push r1 34ab8: 1f 92 push r1 34aba: cd b7 in r28, 0x3d ; 61 34abc: de b7 in r29, 0x3e ; 62 SendMsg(RequestMsg(RequestMsgCodes::Query, 0)); 34abe: 40 e0 ldi r20, 0x00 ; 0 34ac0: 61 e5 ldi r22, 0x51 ; 81 34ac2: ce 01 movw r24, r28 34ac4: 01 96 adiw r24, 0x01 ; 1 34ac6: 0f 94 48 c5 call 0x38a90 ; 0x38a90 34aca: 49 81 ldd r20, Y+1 ; 0x01 34acc: 5a 81 ldd r21, Y+2 ; 0x02 34ace: 6b 81 ldd r22, Y+3 ; 0x03 34ad0: 7c 81 ldd r23, Y+4 ; 0x04 34ad2: 8d 81 ldd r24, Y+5 ; 0x05 34ad4: 0f 94 57 66 call 0x2ccae ; 0x2ccae scopeState = ScopeState::QuerySent; 34ad8: 84 e0 ldi r24, 0x04 ; 4 34ada: 80 93 4d 13 sts 0x134D, r24 ; 0x80134d } 34ade: 0f 90 pop r0 34ae0: 0f 90 pop r0 34ae2: 0f 90 pop r0 34ae4: 0f 90 pop r0 34ae6: 0f 90 pop r0 34ae8: df 91 pop r29 34aea: cf 91 pop r28 34aec: 08 95 ret 00034aee : SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } return false; } void ProtocolLogic::SendAndUpdateFilamentSensor() { 34aee: cf 93 push r28 34af0: df 93 push r29 34af2: 00 d0 rcall .+0 ; 0x34af4 34af4: 1f 92 push r1 34af6: 1f 92 push r1 34af8: cd b7 in r28, 0x3d ; 61 34afa: de b7 in r29, 0x3e ; 62 SendMsg(RequestMsg(RequestMsgCodes::FilamentSensor, lastFSensor = (uint8_t)WhereIsFilament())); 34afc: 0f 94 a0 c5 call 0x38b40 ; 0x38b40 34b00: 80 93 8e 13 sts 0x138E, r24 ; 0x80138e 34b04: 48 2f mov r20, r24 34b06: 66 e6 ldi r22, 0x66 ; 102 34b08: ce 01 movw r24, r28 34b0a: 01 96 adiw r24, 0x01 ; 1 34b0c: 0f 94 48 c5 call 0x38a90 ; 0x38a90 34b10: 49 81 ldd r20, Y+1 ; 0x01 34b12: 5a 81 ldd r21, Y+2 ; 0x02 34b14: 6b 81 ldd r22, Y+3 ; 0x03 34b16: 7c 81 ldd r23, Y+4 ; 0x04 34b18: 8d 81 ldd r24, Y+5 ; 0x05 34b1a: 0f 94 57 66 call 0x2ccae ; 0x2ccae scopeState = ScopeState::FilamentSensorStateSent; 34b1e: 86 e0 ldi r24, 0x06 ; 6 34b20: 80 93 4d 13 sts 0x134D, r24 ; 0x80134d } 34b24: 0f 90 pop r0 34b26: 0f 90 pop r0 34b28: 0f 90 pop r0 34b2a: 0f 90 pop r0 34b2c: 0f 90 pop r0 34b2e: df 91 pop r29 34b30: cf 91 pop r28 34b32: 08 95 ret 00034b34 : CheckAndReportAsyncEvents(); } return Processing; } StepStatus ProtocolLogic::ProcessCommandQueryResponse() { 34b34: cf 93 push r28 34b36: df 93 push r29 34b38: 00 d0 rcall .+0 ; 0x34b3a 34b3a: 1f 92 push r1 34b3c: 1f 92 push r1 34b3e: cd b7 in r28, 0x3d ; 61 34b40: de b7 in r29, 0x3e ; 62 switch (rsp.paramCode) { 34b42: 80 91 64 13 lds r24, 0x1364 ; 0x801364 34b46: 85 34 cpi r24, 0x45 ; 69 34b48: f1 f0 breq .+60 ; 0x34b86 34b4a: 20 f4 brcc .+8 ; 0x34b54 34b4c: 82 34 cpi r24, 0x42 ; 66 34b4e: 51 f1 breq .+84 ; 0x34ba4 } else { // got response to some other command - the originally issued command was interrupted! return Interrupted; } default: return ProtocolError; 34b50: 85 e0 ldi r24, 0x05 ; 5 34b52: 11 c0 rjmp .+34 ; 0x34b76 } return Processing; } StepStatus ProtocolLogic::ProcessCommandQueryResponse() { switch (rsp.paramCode) { 34b54: 86 34 cpi r24, 0x46 ; 70 34b56: 71 f1 breq .+92 ; 0x34bb4 34b58: 80 35 cpi r24, 0x50 ; 80 34b5a: d1 f7 brne .-12 ; 0x34b50 case ResponseMsgParamCodes::Processing: progressCode = static_cast(rsp.paramValue); 34b5c: 80 91 65 13 lds r24, 0x1365 ; 0x801365 34b60: 80 93 8c 13 sts 0x138C, r24 ; 0x80138c errorCode = ErrorCode::OK; 34b64: 81 e0 ldi r24, 0x01 ; 1 34b66: 90 e0 ldi r25, 0x00 ; 0 34b68: 90 93 8b 13 sts 0x138B, r25 ; 0x80138b 34b6c: 80 93 8a 13 sts 0x138A, r24 ; 0x80138a SendAndUpdateFilamentSensor(); // keep on reporting the state of fsensor regularly 34b70: 0f 94 77 a5 call 0x34aee ; 0x34aee return Processing; 34b74: 80 e0 ldi r24, 0x00 ; 0 return Interrupted; } default: return ProtocolError; } } 34b76: 0f 90 pop r0 34b78: 0f 90 pop r0 34b7a: 0f 90 pop r0 34b7c: 0f 90 pop r0 34b7e: 0f 90 pop r0 34b80: df 91 pop r29 34b82: cf 91 pop r28 34b84: 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; 34b86: 8c e0 ldi r24, 0x0C ; 12 34b88: 80 93 8c 13 sts 0x138C, r24 ; 0x80138c errorCode = static_cast(rsp.paramValue); 34b8c: 80 91 65 13 lds r24, 0x1365 ; 0x801365 34b90: 90 91 66 13 lds r25, 0x1366 ; 0x801366 34b94: 90 93 8b 13 sts 0x138B, r25 ; 0x80138b 34b98: 80 93 8a 13 sts 0x138A, r24 ; 0x80138a // 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(); 34b9c: 0f 94 77 a5 call 0x34aee ; 0x34aee return CommandError; 34ba0: 87 e0 ldi r24, 0x07 ; 7 34ba2: e9 cf rjmp .-46 ; 0x34b76 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); 34ba4: 80 91 65 13 lds r24, 0x1365 ; 0x801365 34ba8: 80 93 8d 13 sts 0x138D, r24 ; 0x80138d SendAndUpdateFilamentSensor(); 34bac: 0f 94 77 a5 call 0x34aee ; 0x34aee return ButtonPushed; 34bb0: 8b e0 ldi r24, 0x0B ; 11 34bb2: e1 cf rjmp .-62 ; 0x34b76 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) { 34bb4: 90 91 4f 13 lds r25, 0x134F ; 0x80134f 34bb8: 80 91 5f 13 lds r24, 0x135F ; 0x80135f 34bbc: 98 13 cpse r25, r24 34bbe: 22 c0 rjmp .+68 ; 0x34c04 34bc0: 90 91 50 13 lds r25, 0x1350 ; 0x801350 34bc4: 80 91 60 13 lds r24, 0x1360 ; 0x801360 34bc8: 98 13 cpse r25, r24 34bca: 1c c0 rjmp .+56 ; 0x34c04 progressCode = ProgressCode::OK; 34bcc: 10 92 8c 13 sts 0x138C, r1 ; 0x80138c errorCode = ErrorCode::OK; 34bd0: 81 e0 ldi r24, 0x01 ; 1 34bd2: 90 e0 ldi r25, 0x00 ; 0 34bd4: 90 93 8b 13 sts 0x138B, r25 ; 0x80138b 34bd8: 80 93 8a 13 sts 0x138A, r24 ; 0x80138a scopeState = ScopeState::Ready; 34bdc: 82 e8 ldi r24, 0x82 ; 130 34bde: 80 93 4d 13 sts 0x134D, r24 ; 0x80134d rq = RequestMsg(RequestMsgCodes::unknown, 0); // clear the successfully finished request 34be2: 40 e0 ldi r20, 0x00 ; 0 34be4: 60 e0 ldi r22, 0x00 ; 0 34be6: ce 01 movw r24, r28 34be8: 01 96 adiw r24, 0x01 ; 1 34bea: 0f 94 48 c5 call 0x38a90 ; 0x38a90 34bee: 85 e0 ldi r24, 0x05 ; 5 34bf0: fe 01 movw r30, r28 34bf2: 31 96 adiw r30, 0x01 ; 1 34bf4: af e4 ldi r26, 0x4F ; 79 34bf6: b3 e1 ldi r27, 0x13 ; 19 34bf8: 01 90 ld r0, Z+ 34bfa: 0d 92 st X+, r0 34bfc: 8a 95 dec r24 34bfe: e1 f7 brne .-8 ; 0x34bf8 34c00: 82 e0 ldi r24, 0x02 ; 2 34c02: b9 cf rjmp .-142 ; 0x34b76 return Finished; } else { // got response to some other command - the originally issued command was interrupted! return Interrupted; 34c04: 83 e0 ldi r24, 0x03 ; 3 34c06: b7 cf rjmp .-146 ; 0x34b76 00034c08 : mmu_print_saved &= ~(SavedState::ParkExtruder); } } void MMU2::CheckUserInput() { 34c08: 1f 93 push r17 34c0a: cf 93 push r28 34c0c: df 93 push r29 34c0e: 00 d0 rcall .+0 ; 0x34c10 34c10: 1f 92 push r1 34c12: 1f 92 push r1 34c14: cd b7 in r28, 0x3d ; 61 34c16: de b7 in r29, 0x3e ; 62 const char *PrusaErrorButtonMore() { return MSG_BTN_MORE; } Buttons ButtonPressed(ErrorCode ec) { if (buttonSelectedOperation == ButtonOperations::NoOperation) { 34c18: 80 91 ad 0d lds r24, 0x0DAD ; 0x800dad <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.493> 34c1c: 81 11 cpse r24, r1 34c1e: 2a c0 rjmp .+84 ; 0x34c74 auto btn = ButtonPressed(lastErrorCode); // Was a button pressed on the MMU itself instead of the LCD? if (btn == Buttons::NoButton && lastButton != Buttons::NoButton) { 34c20: 10 91 b4 13 lds r17, 0x13B4 ; 0x8013b4 34c24: 1f 3f cpi r17, 0xFF ; 255 34c26: 91 f5 brne .+100 ; 0x34c8c btn = lastButton; lastButton = Buttons::NoButton; // Clear it. } if (mmu2.MMULastErrorSource() == ErrorSourcePrinter && btn != Buttons::NoButton) { 34c28: 80 91 b3 13 lds r24, 0x13B3 ; 0x8013b3 34c2c: 81 11 cpse r24, r1 34c2e: 60 c0 rjmp .+192 ; 0x34cf0 34c30: 1f 3f cpi r17, 0xFF ; 255 34c32: b9 f0 breq .+46 ; 0x34c62 inline void SetPrinterError(ErrorCode ec) { explicitPrinterError = ec; } inline void ClearPrinterError() { explicitPrinterError = ErrorCode::OK; 34c34: 81 e0 ldi r24, 0x01 ; 1 34c36: 90 e0 ldi r25, 0x00 ; 0 34c38: 90 93 4b 13 sts 0x134B, r25 ; 0x80134b 34c3c: 80 93 4a 13 sts 0x134A, r24 ; 0x80134a } } void ClearPrinterError() { logic.ClearPrinterError(); lastErrorCode = ErrorCode::OK; 34c40: 90 93 b2 13 sts 0x13B2, r25 ; 0x8013b2 34c44: 80 93 b1 13 sts 0x13B1, r24 ; 0x8013b1 lastErrorSource = ErrorSource::ErrorSourceNone; 34c48: 8f ef ldi r24, 0xFF ; 255 34c4a: 80 93 b3 13 sts 0x13B3, r24 ; 0x8013b3 // 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) { 34c4e: 13 30 cpi r17, 0x03 ; 3 34c50: 09 f4 brne .+2 ; 0x34c54 34c52: 82 c0 rjmp .+260 ; 0x34d58 34c54: f8 f0 brcs .+62 ; 0x34c94 34c56: 16 30 cpi r17, 0x06 ; 6 34c58: 08 f4 brcc .+2 ; 0x34c5c 34c5a: 7b c0 rjmp .+246 ; 0x34d52 34c5c: 17 30 cpi r17, 0x07 ; 7 34c5e: 09 f4 brne .+2 ; 0x34c62 34c60: 7e c0 rjmp .+252 ; 0x34d5e // @@TODO not sure if we shall handle this high level operation at this spot break; default: break; } } 34c62: 0f 90 pop r0 34c64: 0f 90 pop r0 34c66: 0f 90 pop r0 34c68: 0f 90 pop r0 34c6a: 0f 90 pop r0 34c6c: df 91 pop r29 34c6e: cf 91 pop r28 34c70: 1f 91 pop r17 34c72: 08 95 ret return Buttons::NoButton; // no button } const auto result = ButtonAvailable(ec); 34c74: 80 91 b1 13 lds r24, 0x13B1 ; 0x8013b1 34c78: 90 91 b2 13 lds r25, 0x13B2 ; 0x8013b2 34c7c: 0f 94 32 c8 call 0x39064 ; 0x39064 34c80: 18 2f mov r17, r24 buttonSelectedOperation = ButtonOperations::NoOperation; // Reset operation 34c82: 10 92 ad 0d sts 0x0DAD, r1 ; 0x800dad <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.493> 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) { 34c86: 8f 3f cpi r24, 0xFF ; 255 34c88: 79 f6 brne .-98 ; 0x34c28 34c8a: ca cf rjmp .-108 ; 0x34c20 btn = lastButton; lastButton = Buttons::NoButton; // Clear it. 34c8c: 8f ef ldi r24, 0xFF ; 255 34c8e: 80 93 b4 13 sts 0x13B4, r24 ; 0x8013b4 34c92: ca cf rjmp .-108 ; 0x34c28 switch (btn) { case Buttons::Left: case Buttons::Middle: case Buttons::Right: SERIAL_ECHOPGM("CheckUserInput-btnLMR "); 34c94: 88 ec ldi r24, 0xC8 ; 200 34c96: 99 ea ldi r25, 0xA9 ; 169 34c98: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHOLN((int)buttons_to_uint8t(btn)); 34c9c: 81 2f mov r24, r17 34c9e: 90 e0 ldi r25, 0x00 ; 0 34ca0: 0f 94 b0 74 call 0x2e960 ; 0x2e960 ResumeHotendTemp(); // Recover the hotend temp before we attempt to do anything else... 34ca4: 0f 94 cf ab call 0x3579e ; 0x3579e if (mmu2.MMULastErrorSource() == ErrorSourceMMU) { 34ca8: 80 91 b3 13 lds r24, 0x13B3 ; 0x8013b3 34cac: 81 30 cpi r24, 0x01 ; 1 34cae: 89 f4 brne .+34 ; 0x34cd2 ScreenUpdateEnable(); return true; } void MMU2::Button(uint8_t index) { LogEchoEvent_P(PSTR("Button")); 34cb0: 81 ec ldi r24, 0xC1 ; 193 34cb2: 99 ea ldi r25, 0xA9 ; 169 34cb4: 0f 94 90 c5 call 0x38b20 ; 0x38b20 void ProtocolLogic::ResetMMU(uint8_t mode /* = 0 */) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Reset, mode)); } void ProtocolLogic::Button(uint8_t index) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Button, index)); 34cb8: 41 2f mov r20, r17 34cba: 62 e4 ldi r22, 0x42 ; 66 34cbc: ce 01 movw r24, r28 34cbe: 01 96 adiw r24, 0x01 ; 1 34cc0: 0f 94 48 c5 call 0x38a90 ; 0x38a90 34cc4: 49 81 ldd r20, Y+1 ; 0x01 34cc6: 5a 81 ldd r21, Y+2 ; 0x02 34cc8: 6b 81 ldd r22, Y+3 ; 0x03 34cca: 7c 81 ldd r23, Y+4 ; 0x04 34ccc: 8d 81 ldd r24, Y+5 ; 0x05 34cce: 0f 94 0d a5 call 0x34a1a ; 0x34a1a } // 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) { 34cd2: 80 91 b1 13 lds r24, 0x13B1 ; 0x8013b1 34cd6: 90 91 b2 13 lds r25, 0x13B2 ; 0x8013b2 34cda: 84 30 cpi r24, 0x04 ; 4 34cdc: 20 e8 ldi r18, 0x80 ; 128 34cde: 92 07 cpc r25, r18 34ce0: 21 f0 breq .+8 ; 0x34cea 34ce2: 89 30 cpi r24, 0x09 ; 9 34ce4: 90 48 sbci r25, 0x80 ; 128 34ce6: 09 f0 breq .+2 ; 0x34cea 34ce8: bc cf rjmp .-136 ; 0x34c62 case ErrorCode::FSENSOR_DIDNT_SWITCH_OFF: case ErrorCode::FSENSOR_TOO_EARLY: HelpUnloadToFinda(); 34cea: 0f 94 c7 69 call 0x2d38e ; 0x2d38e 34cee: b9 cf rjmp .-142 ; 0x34c62 // 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) { 34cf0: 19 30 cpi r17, 0x09 ; 9 34cf2: 08 f0 brcs .+2 ; 0x34cf6 34cf4: b6 cf rjmp .-148 ; 0x34c62 34cf6: e1 2f mov r30, r17 34cf8: f0 e0 ldi r31, 0x00 ; 0 34cfa: 88 27 eor r24, r24 34cfc: ed 57 subi r30, 0x7D ; 125 34cfe: f9 45 sbci r31, 0x59 ; 89 34d00: 8e 4f sbci r24, 0xFE ; 254 34d02: 0d 94 e7 dc jmp 0x3b9ce ; 0x3b9ce <__tablejump2__> 34d06: 34 3a cpi r19, 0xA4 ; 164 34d08: 34 3a cpi r19, 0xA4 ; 164 34d0a: 34 3a cpi r19, 0xA4 ; 164 34d0c: d8 39 cpi r29, 0x98 ; 152 34d0e: 6c 39 cpi r22, 0x9C ; 156 34d10: 6c 39 cpi r22, 0x9C ; 156 34d12: f2 39 cpi r31, 0x92 ; 146 34d14: 04 3a cpi r16, 0xA4 ; 164 34d16: 40 3a cpi r20, 0xA0 ; 160 logic.Stop(); mmu2Serial.close(); } void MMU2::Tune() { switch (lastErrorCode) { 34d18: 80 91 b1 13 lds r24, 0x13B1 ; 0x8013b1 34d1c: 90 91 b2 13 lds r25, 0x13B2 ; 0x8013b2 34d20: 87 38 cpi r24, 0x87 ; 135 34d22: 20 e8 ldi r18, 0x80 ; 128 34d24: 92 07 cpc r25, r18 34d26: 21 f0 breq .+8 ; 0x34d30 34d28: 87 30 cpi r24, 0x07 ; 7 34d2a: 91 48 sbci r25, 0x81 ; 129 34d2c: 09 f0 breq .+2 ; 0x34d30 34d2e: 99 cf rjmp .-206 ; 0x34c62 // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { 34d30: 80 91 4c 13 lds r24, 0x134C ; 0x80134c 34d34: 84 30 cpi r24, 0x04 ; 4 34d36: 21 f4 brne .+8 ; 0x34d40 ); MENU_END(); } void tuneIdlerStallguardThreshold() { if ((CommandInProgress)mmu2.GetCommandInProgress() != NoCommand) 34d38: 80 91 4f 13 lds r24, 0x134F ; 0x80134f 34d3c: 81 11 cpse r24, r1 34d3e: 91 cf rjmp .-222 ; 0x34c62 // homing fails during toolchange. // To save the print, make the Tune button unresponsive for now. return; } putErrorScreenToSleep = true; 34d40: 81 e0 ldi r24, 0x01 ; 1 34d42: 80 93 ac 0d sts 0x0DAC, r24 ; 0x800dac <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.496> menu_submenu(tuneIdlerStallguardThresholdMenu); 34d46: 60 e0 ldi r22, 0x00 ; 0 34d48: 80 ee ldi r24, 0xE0 ; 224 34d4a: 9a e3 ldi r25, 0x3A ; 58 34d4c: 0f 94 be d2 call 0x3a57c ; 0x3a57c 34d50: 88 cf rjmp .-240 ; 0x34c62 } /// @brief Queue a button operation which the printer can act upon /// @param btn Button operation inline void SetPrinterButtonOperation(Buttons btn) { printerButtonOperation = btn; 34d52: 10 93 b7 13 sts 0x13B7, r17 ; 0x8013b7 34d56: 85 cf rjmp .-246 ; 0x34c62 void MMU2::ResetX42() { logic.ResetMMU(42); } void MMU2::TriggerResetPin() { reset(); 34d58: 0f 94 55 c5 call 0x38aaa ; 0x38aaa 34d5c: 82 cf rjmp .-252 ; 0x34c62 StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 34d5e: 10 92 b9 13 sts 0x13B9, r1 ; 0x8013b9 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 34d62: 10 92 67 13 sts 0x1367, r1 ; 0x801367 currentScope = Scope::Stopped; 34d66: 10 92 4c 13 sts 0x134C, r1 ; 0x80134c if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 34d6a: 60 e0 ldi r22, 0x00 ; 0 34d6c: 8c ea ldi r24, 0xAC ; 172 34d6e: 9c e0 ldi r25, 0x0C ; 12 34d70: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 } /// Disables MMU in EEPROM void DisableMMUInSettings() { eeprom_update_byte_notify((uint8_t *)EEPROM_MMU_ENABLED, false); mmu2.Status(); 34d74: 0f 94 9e 74 call 0x2e93c ; 0x2e93c 34d78: 74 cf rjmp .-280 ; 0x34c62 00034d7a : avoidRecursion = true; mmu_loop_inner(true); avoidRecursion = false; } void __attribute__((noinline)) MMU2::mmu_loop_inner(bool reportErrors) { 34d7a: 4f 92 push r4 34d7c: 5f 92 push r5 34d7e: 6f 92 push r6 34d80: 7f 92 push r7 34d82: 8f 92 push r8 34d84: 9f 92 push r9 34d86: af 92 push r10 34d88: bf 92 push r11 34d8a: cf 92 push r12 34d8c: df 92 push r13 34d8e: ef 92 push r14 34d90: ff 92 push r15 34d92: 0f 93 push r16 34d94: 1f 93 push r17 34d96: cf 93 push r28 34d98: df 93 push r29 34d9a: cd b7 in r28, 0x3d ; 61 34d9c: de b7 in r29, 0x3e ; 62 34d9e: a0 97 sbiw r28, 0x20 ; 32 34da0: 0f b6 in r0, 0x3f ; 63 34da2: f8 94 cli 34da4: de bf out 0x3e, r29 ; 62 34da6: 0f be out 0x3f, r0 ; 63 34da8: cd bf out 0x3d, r28 ; 61 34daa: 08 2f mov r16, r24 } } StepStatus MMU2::LogicStep(bool reportErrors) { // Process any buttons before proceeding with another MMU Query CheckUserInput(); 34dac: 0f 94 04 a6 call 0x34c08 ; 0x34c08 DelayedRestartRestart(); return SuppressShortDropOuts(PSTR("Protocol Error"), ProtocolError); } StepStatus ProtocolLogic::Step() { if (!ExpectsResponse()) { // if not waiting for a response, activate a planned request immediately 34db0: 80 91 4d 13 lds r24, 0x134D ; 0x80134d 34db4: 87 fd sbrc r24, 7 ActivatePlannedRequest(); 34db6: 0f 94 88 a4 call 0x34910 ; 0x34910 34dba: 90 91 4d 13 lds r25, 0x134D ; 0x80134d } return Processing; } StepStatus ProtocolLogic::ScopeStep() { if (!ExpectsResponse()) { 34dbe: 97 ff sbrs r25, 7 34dc0: 7d c0 rjmp .+250 ; 0x34ebc // we are waiting for something switch (currentScope) { 34dc2: 80 91 4c 13 lds r24, 0x134C ; 0x80134c 34dc6: 82 30 cpi r24, 0x02 ; 2 34dc8: b1 f0 breq .+44 ; 0x34df6 34dca: 08 f4 brcc .+2 ; 0x34dce 34dcc: 75 c0 rjmp .+234 ; 0x34eb8 34dce: 83 30 cpi r24, 0x03 ; 3 34dd0: e1 f1 breq .+120 ; 0x34e4a 34dd2: 84 30 cpi r24, 0x04 ; 4 34dd4: 09 f4 brne .+2 ; 0x34dd8 34dd6: 54 c0 rjmp .+168 ; 0x34e80 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 34dd8: 0f 94 88 a4 call 0x34910 ; 0x34910 34ddc: 81 11 cpse r24, r1 34dde: 6b c3 rjmp .+1750 ; 0x354b6 // and we have just received a response to a Q0 message about a command progress return ProcessCommandQueryResponse(); } void ProtocolLogic::SwitchToIdle() { state = State::Running; 34de0: 82 e0 ldi r24, 0x02 ; 2 34de2: 80 93 67 13 sts 0x1367, r24 ; 0x801367 currentScope = Scope::Idle; 34de6: 83 e0 ldi r24, 0x03 ; 3 34de8: 80 93 4c 13 sts 0x134C, r24 ; 0x80134c scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 34dec: 82 e8 ldi r24, 0x82 ; 130 34dee: 80 93 4d 13 sts 0x134D, r24 ; 0x80134d // 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()) { 34df2: 12 e0 ldi r17, 0x02 ; 2 34df4: db c2 rjmp .+1462 ; 0x353ac IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 34df6: 0f 94 22 29 call 0x25244 ; 0x25244 34dfa: ab 01 movw r20, r22 34dfc: bc 01 movw r22, r24 34dfe: 80 91 59 13 lds r24, 0x1359 ; 0x801359 34e02: 90 91 5a 13 lds r25, 0x135A ; 0x80135a 34e06: a0 91 5b 13 lds r26, 0x135B ; 0x80135b 34e0a: b0 91 5c 13 lds r27, 0x135C ; 0x80135c 34e0e: 88 51 subi r24, 0x18 ; 24 34e10: 9c 4f sbci r25, 0xFC ; 252 34e12: af 4f sbci r26, 0xFF ; 255 34e14: 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 34e16: 48 17 cp r20, r24 34e18: 59 07 cpc r21, r25 34e1a: 6a 07 cpc r22, r26 34e1c: 7b 07 cpc r23, r27 34e1e: 08 f4 brcc .+2 ; 0x34e22 34e20: 4b c0 rjmp .+150 ; 0x34eb8 void MMU2Serial::close() { // @@TODO - probably turn off the UART } int MMU2Serial::read() { return fgetc(uart2io); 34e22: 83 e9 ldi r24, 0x93 ; 147 34e24: 92 e1 ldi r25, 0x12 ; 18 34e26: 0f 94 03 da call 0x3b406 ; 0x3b406 while (uart->read() != -1) 34e2a: 01 96 adiw r24, 0x01 ; 1 34e2c: d1 f7 brne .-12 ; 0x34e22 initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 34e2e: 81 e0 ldi r24, 0x01 ; 1 34e30: 80 93 67 13 sts 0x1367, r24 ; 0x801367 currentScope = Scope::StartSeq; 34e34: 80 93 4c 13 sts 0x134C, r24 ; 0x80134c rqState = RequestStates::Code; } /// resets the internal response decoding state (typically after an error) void ResetResponseDecoder() { rspState = ResponseStates::RequestCode; 34e38: 10 92 6e 13 sts 0x136E, r1 ; 0x80136e LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 34e3c: 86 e0 ldi r24, 0x06 ; 6 34e3e: 80 93 4e 13 sts 0x134E, r24 ; 0x80134e SendVersion(0); 34e42: 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); 34e44: 0f 94 37 a5 call 0x34a6e ; 0x34a6e 34e48: 37 c0 rjmp .+110 ; 0x34eb8 } return Processing; } StepStatus ProtocolLogic::IdleWait() { if (scopeState == ScopeState::Ready) { // check timeout 34e4a: 92 38 cpi r25, 0x82 ; 130 34e4c: 29 f6 brne .-118 ; 0x34dd8 IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 34e4e: 0f 94 22 29 call 0x25244 ; 0x25244 34e52: ab 01 movw r20, r22 34e54: bc 01 movw r22, r24 34e56: 80 91 59 13 lds r24, 0x1359 ; 0x801359 34e5a: 90 91 5a 13 lds r25, 0x135A ; 0x80135a 34e5e: a0 91 5b 13 lds r26, 0x135B ; 0x80135b 34e62: b0 91 5c 13 lds r27, 0x135C ; 0x80135c 34e66: 88 51 subi r24, 0x18 ; 24 34e68: 9c 4f sbci r25, 0xFC ; 252 34e6a: af 4f sbci r26, 0xFF ; 255 34e6c: bf 4f sbci r27, 0xFF ; 255 return Processing; } StepStatus ProtocolLogic::IdleWait() { if (scopeState == ScopeState::Ready) { // check timeout if (Elapsed(heartBeatPeriod)) { 34e6e: 48 17 cp r20, r24 34e70: 59 07 cpc r21, r25 34e72: 6a 07 cpc r22, r26 34e74: 7b 07 cpc r23, r27 34e76: 08 f4 brcc .+2 ; 0x34e7a 34e78: af cf rjmp .-162 ; 0x34dd8 void ProtocolLogic::SwitchFromStartToIdle() { state = State::Running; currentScope = Scope::Idle; IdleRestart(); SendQuery(); // force sending Q0 immediately 34e7a: 0f 94 58 a5 call 0x34ab0 ; 0x34ab0 34e7e: 1c c0 rjmp .+56 ; 0x34eb8 } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 34e80: 0f 94 22 29 call 0x25244 ; 0x25244 34e84: ab 01 movw r20, r22 34e86: bc 01 movw r22, r24 34e88: 80 91 59 13 lds r24, 0x1359 ; 0x801359 34e8c: 90 91 5a 13 lds r25, 0x135A ; 0x80135a 34e90: a0 91 5b 13 lds r26, 0x135B ; 0x80135b 34e94: b0 91 5c 13 lds r27, 0x135C ; 0x80135c 34e98: 88 51 subi r24, 0x18 ; 24 34e9a: 9c 4f sbci r25, 0xFC ; 252 34e9c: af 4f sbci r26, 0xFF ; 255 34e9e: bf 4f sbci r27, 0xFF ; 255 } return Processing; } StepStatus ProtocolLogic::CommandWait() { if (Elapsed(heartBeatPeriod)) { 34ea0: 48 17 cp r20, r24 34ea2: 59 07 cpc r21, r25 34ea4: 6a 07 cpc r22, r26 34ea6: 7b 07 cpc r23, r27 34ea8: 40 f7 brcc .-48 ; 0x34e7a }; 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(); 34eaa: 0f 94 a0 c5 call 0x38b40 ; 0x38b40 if (fs != lastFSensor) { 34eae: 90 91 8e 13 lds r25, 0x138E ; 0x80138e 34eb2: 89 13 cpse r24, r25 SendAndUpdateFilamentSensor(); 34eb4: 0f 94 77 a5 call 0x34aee ; 0x34aee // 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; 34eb8: 10 e0 ldi r17, 0x00 ; 0 34eba: 78 c2 rjmp .+1264 ; 0x353ac StepStatus ProtocolLogic::ExpectingMessage() { int bytesConsumed = 0; int c = -1; OldMMUFWDetector oldMMUh4x0r; // old MMU FW hacker ;) 34ebc: a1 2c mov r10, r1 return State::SomethingElse; } }; StepStatus ProtocolLogic::ExpectingMessage() { int bytesConsumed = 0; 34ebe: d1 2c mov r13, r1 34ec0: 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; 34ec2: 99 24 eor r9, r9 34ec4: 93 94 inc r9 responseMsg.paramCode = (ResponseMsgParamCodes)c; responseMsg.paramValue = 0; return DecodeStatus::NeedMoreData; default: responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; 34ec6: 55 e0 ldi r21, 0x05 ; 5 34ec8: b5 2e mov r11, r21 case 'E': case 'F': case 'A': case 'R': case 'B': rspState = ResponseStates::ParamValue; 34eca: 63 e0 ldi r22, 0x03 ; 3 34ecc: 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; 34ece: 74 e0 ldi r23, 0x04 ; 4 34ed0: 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; 34ed2: e2 e0 ldi r30, 0x02 ; 2 34ed4: 6e 2e mov r6, r30 34ed6: 66 c0 rjmp .+204 ; 0x34fa4 ++i; return i; } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { 34ed8: 23 30 cpi r18, 0x03 ; 3 34eda: 09 f4 brne .+2 ; 0x34ede 34edc: e0 c0 rjmp .+448 ; 0x3509e 34ede: 24 30 cpi r18, 0x04 ; 4 34ee0: 09 f0 breq .+2 ; 0x34ee4 34ee2: 83 c0 rjmp .+262 ; 0x34fea } 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'); 34ee4: 20 ed ldi r18, 0xD0 ; 208 34ee6: 28 0f add r18, r24 34ee8: 2a 30 cpi r18, 0x0A ; 10 34eea: 08 f4 brcc .+2 ; 0x34eee 34eec: f8 c0 rjmp .+496 ; 0x350de 34eee: 2f e9 ldi r18, 0x9F ; 159 34ef0: 28 0f add r18, r24 34ef2: 26 30 cpi r18, 0x06 ; 6 34ef4: 08 f4 brcc .+2 ; 0x34ef8 34ef6: f3 c0 rjmp .+486 ; 0x350de ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 34ef8: 8a 30 cpi r24, 0x0A ; 10 34efa: 09 f0 breq .+2 ; 0x34efe 34efc: fa c0 rjmp .+500 ; 0x350f2 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()) { 34efe: 40 90 73 13 lds r4, 0x1373 ; 0x801373 34f02: 8f e6 ldi r24, 0x6F ; 111 34f04: 93 e1 ldi r25, 0x13 ; 19 34f06: 0f 94 37 c5 call 0x38a6e ; 0x38a6e 34f0a: 48 12 cpse r4, r24 34f0c: b8 c0 rjmp .+368 ; 0x3507e // CRC mismatch responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; return DecodeStatus::Error; } else { rspState = ResponseStates::RequestCode; 34f0e: 10 92 6e 13 sts 0x136E, r1 ; 0x80136e /// @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; } 34f12: 88 e0 ldi r24, 0x08 ; 8 34f14: ef e6 ldi r30, 0x6F ; 111 34f16: f3 e1 ldi r31, 0x13 ; 19 34f18: de 01 movw r26, r28 34f1a: 51 96 adiw r26, 0x11 ; 17 34f1c: 01 90 ld r0, Z+ 34f1e: 0d 92 st X+, r0 34f20: 8a 95 dec r24 34f22: e1 f7 brne .-8 ; 0x34f1c 34f24: 88 e0 ldi r24, 0x08 ; 8 34f26: fe 01 movw r30, r28 34f28: 71 96 adiw r30, 0x11 ; 17 34f2a: de 01 movw r26, r28 34f2c: 59 96 adiw r26, 0x19 ; 25 34f2e: 01 90 ld r0, Z+ 34f30: 0d 92 st X+, r0 34f32: 8a 95 dec r24 34f34: e1 f7 brne .-8 ; 0x34f2e while ((c = uart->read()) >= 0) { ++bytesConsumed; RecordReceivedByte(c); switch (protocol.DecodeResponse(c)) { case DecodeStatus::MessageCompleted: rsp = protocol.GetResponseMsg(); 34f36: 88 e0 ldi r24, 0x08 ; 8 34f38: fe 01 movw r30, r28 34f3a: 79 96 adiw r30, 0x19 ; 25 34f3c: af e5 ldi r26, 0x5F ; 95 34f3e: b3 e1 ldi r27, 0x13 ; 19 34f40: 01 90 ld r0, Z+ 34f42: 0d 92 st X+, r0 34f44: 8a 95 dec r24 34f46: e1 f7 brne .-8 ; 0x34f40 } dst[(lastReceivedBytes.size() - 1) * 3 + 2] = 0; // terminate properly } void ProtocolLogic::FormatLastResponseMsgAndClearLRB(char *dst) { *dst++ = '<'; 34f48: 8c e3 ldi r24, 0x3C ; 60 34f4a: 89 83 std Y+1, r24 ; 0x01 34f4c: fe 01 movw r30, r28 34f4e: 32 96 adiw r30, 0x02 ; 2 34f50: a7 e7 ldi r26, 0x77 ; 119 34f52: b3 e1 ldi r27, 0x13 ; 19 for (uint8_t i = 0; i < lrb; ++i) { 34f54: 20 e0 ldi r18, 0x00 ; 0 34f56: cf 01 movw r24, r30 34f58: 52 16 cp r5, r18 34f5a: 09 f4 brne .+2 ; 0x34f5e 34f5c: cd c0 rjmp .+410 ; 0x350f8 uint8_t b = lastReceivedBytes[i]; 34f5e: 3d 91 ld r19, X+ // Check for printable character, including space if (b < 32 || b > 127) { 34f60: 40 ee ldi r20, 0xE0 ; 224 34f62: 43 0f add r20, r19 34f64: 40 36 cpi r20, 0x60 ; 96 34f66: 08 f0 brcs .+2 ; 0x34f6a b = '.'; 34f68: 3e e2 ldi r19, 0x2E ; 46 } *dst++ = b; 34f6a: 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) { 34f6c: 2f 5f subi r18, 0xFF ; 255 34f6e: f4 cf rjmp .-24 ; 0x34f58 } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 34f70: 8e 34 cpi r24, 0x4E ; 78 34f72: 08 f0 brcs .+2 ; 0x34f76 34f74: 56 c0 rjmp .+172 ; 0x35022 34f76: 8b 34 cpi r24, 0x4B ; 75 34f78: 08 f0 brcs .+2 ; 0x34f7c 34f7a: 46 c0 rjmp .+140 ; 0x35008 34f7c: 82 34 cpi r24, 0x42 ; 66 34f7e: 09 f4 brne .+2 ; 0x34f82 34f80: 43 c0 rjmp .+134 ; 0x35008 34f82: e0 f5 brcc .+120 ; 0x34ffc 34f84: 8a 30 cpi r24, 0x0A ; 10 34f86: 59 f0 breq .+22 ; 0x34f9e 34f88: 8d 30 cpi r24, 0x0D ; 13 34f8a: 49 f0 breq .+18 ; 0x34f9e } else if (IsCRCSeparator(c)) { rspState = ResponseStates::CRC; return DecodeStatus::NeedMoreData; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; 34f8c: b0 92 6e 13 sts 0x136E, r11 ; 0x80136e 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') { 34f90: a1 10 cpse r10, r1 34f92: 05 c1 rjmp .+522 ; 0x3519e 34f94: 1f 36 cpi r17, 0x6F ; 111 34f96: 09 f0 breq .+2 ; 0x34f9a 34f98: fc c3 rjmp .+2040 ; 0x35792 ++ok; 34f9a: aa 24 eor r10, r10 34f9c: 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; 34f9e: 4f ef ldi r20, 0xFF ; 255 34fa0: c4 1a sub r12, r20 34fa2: d4 0a sbc r13, r20 34fa4: 83 e9 ldi r24, 0x93 ; 147 34fa6: 92 e1 ldi r25, 0x12 ; 18 34fa8: 0f 94 03 da call 0x3b406 ; 0x3b406 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) { 34fac: 97 fd sbrc r25, 7 34fae: 00 c1 rjmp .+512 ; 0x351b0 ++bytesConsumed; RecordReceivedByte(c); 34fb0: 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]; 34fb2: 20 91 87 13 lds r18, 0x1387 ; 0x801387 34fb6: 30 e0 ldi r19, 0x00 ; 0 void ProtocolLogic::RecordUARTActivity() { lastUARTActivityMs = _millis(); } void ProtocolLogic::RecordReceivedByte(uint8_t c) { lastReceivedBytes[lrb] = c; 34fb8: f9 01 movw r30, r18 34fba: e6 5b subi r30, 0xB6 ; 182 34fbc: fc 4e sbci r31, 0xEC ; 236 34fbe: 85 a7 std Z+45, r24 ; 0x2d lrb = (lrb + 1) % lastReceivedBytes.size(); 34fc0: 79 01 movw r14, r18 34fc2: ef ef ldi r30, 0xFF ; 255 34fc4: ee 1a sub r14, r30 34fc6: fe 0a sbc r15, r30 34fc8: ff e0 ldi r31, 0x0F ; 15 34fca: ef 22 and r14, r31 34fcc: ff 24 eor r15, r15 34fce: 5e 2c mov r5, r14 34fd0: e0 92 87 13 sts 0x1387, r14 ; 0x801387 ++i; return i; } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { 34fd4: 20 91 6e 13 lds r18, 0x136E ; 0x80136e 34fd8: 22 30 cpi r18, 0x02 ; 2 34fda: 09 f4 brne .+2 ; 0x34fde 34fdc: 48 c0 rjmp .+144 ; 0x3506e 34fde: 08 f0 brcs .+2 ; 0x34fe2 34fe0: 7b cf rjmp .-266 ; 0x34ed8 34fe2: 22 23 and r18, r18 34fe4: 29 f2 breq .-118 ; 0x34f70 34fe6: 21 30 cpi r18, 0x01 ; 1 34fe8: 51 f1 breq .+84 ; 0x3503e ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 34fea: 1a 30 cpi r17, 0x0A ; 10 34fec: 09 f4 brne .+2 ; 0x34ff0 34fee: 8f cf rjmp .-226 ; 0x34f0e 34ff0: 1d 30 cpi r17, 0x0D ; 13 34ff2: 09 f4 brne .+2 ; 0x34ff6 34ff4: 8c cf rjmp .-232 ; 0x34f0e default: //case error: if (IsNewLine(c)) { rspState = ResponseStates::RequestCode; return DecodeStatus::MessageCompleted; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; 34ff6: 10 92 74 13 sts 0x1374, r1 ; 0x801374 34ffa: ca cf rjmp .-108 ; 0x34f90 } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 34ffc: 85 34 cpi r24, 0x45 ; 69 34ffe: 30 f2 brcs .-116 ; 0x34f8c 35000: 87 34 cpi r24, 0x47 ; 71 35002: 10 f0 brcs .+4 ; 0x35008 35004: 88 34 cpi r24, 0x48 ; 72 35006: 11 f6 brne .-124 ; 0x34f8c case 'K': case 'F': case 'f': case 'H': case 'R': responseMsg.request.code = (RequestMsgCodes)c; 35008: 80 93 6f 13 sts 0x136F, r24 ; 0x80136f responseMsg.request.value = 0; 3500c: 10 92 70 13 sts 0x1370, r1 ; 0x801370 responseMsg.request.value2 = 0; 35010: 10 92 72 13 sts 0x1372, r1 ; 0x801372 35014: 10 92 71 13 sts 0x1371, r1 ; 0x801371 responseMsg.request.crc8 = 0; 35018: 10 92 73 13 sts 0x1373, r1 ; 0x801373 rspState = ResponseStates::RequestValue; 3501c: 90 92 6e 13 sts 0x136E, r9 ; 0x80136e 35020: be cf rjmp .-132 ; 0x34f9e } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 35022: 89 35 cpi r24, 0x59 ; 89 35024: 40 f4 brcc .+16 ; 0x35036 35026: 87 35 cpi r24, 0x57 ; 87 35028: 78 f7 brcc .-34 ; 0x35008 3502a: 20 eb ldi r18, 0xB0 ; 176 3502c: 28 0f add r18, r24 3502e: 26 30 cpi r18, 0x06 ; 6 35030: 08 f0 brcs .+2 ; 0x35034 35032: ac cf rjmp .-168 ; 0x34f8c 35034: e9 cf rjmp .-46 ; 0x35008 35036: 86 36 cpi r24, 0x66 ; 102 35038: 09 f0 breq .+2 ; 0x3503c 3503a: a8 cf rjmp .-176 ; 0x34f8c 3503c: e5 cf rjmp .-54 ; 0x35008 } 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'); 3503e: 20 ed ldi r18, 0xD0 ; 208 35040: 28 0f add r18, r24 35042: 2a 30 cpi r18, 0x0A ; 10 35044: 50 f0 brcs .+20 ; 0x3505a 35046: 2f e9 ldi r18, 0x9F ; 159 35048: 28 0f add r18, r24 3504a: 26 30 cpi r18, 0x06 ; 6 3504c: 30 f0 brcs .+12 ; 0x3505a case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; responseMsg.request.value += Char2Nibble(c); return DecodeStatus::NeedMoreData; } else if (c == ' ') { 3504e: 80 32 cpi r24, 0x20 ; 32 35050: 09 f0 breq .+2 ; 0x35054 35052: 9c cf rjmp .-200 ; 0x34f8c rspState = ResponseStates::ParamCode; 35054: 60 92 6e 13 sts 0x136E, r6 ; 0x80136e 35058: a2 cf rjmp .-188 ; 0x34f9e return DecodeStatus::Error; } case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; responseMsg.request.value += Char2Nibble(c); 3505a: 0f 94 16 c5 call 0x38a2c ; 0x38a2c rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; 3505e: 90 91 70 13 lds r25, 0x1370 ; 0x801370 35062: 92 95 swap r25 35064: 90 7f andi r25, 0xF0 ; 240 responseMsg.request.value += Char2Nibble(c); 35066: 89 0f add r24, r25 35068: 80 93 70 13 sts 0x1370, r24 ; 0x801370 3506c: 98 cf rjmp .-208 ; 0x34f9e } else { rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamCode: switch (c) { 3506e: 87 34 cpi r24, 0x47 ; 71 35070: 48 f4 brcc .+18 ; 0x35084 35072: 85 34 cpi r24, 0x45 ; 69 35074: 58 f4 brcc .+22 ; 0x3508c 35076: 2f eb ldi r18, 0xBF ; 191 35078: 28 0f add r18, r24 3507a: 22 30 cpi r18, 0x02 ; 2 3507c: 38 f0 brcs .+14 ; 0x3508c return DecodeStatus::NeedMoreData; } else if (IsCRCSeparator(c)) { rspState = ResponseStates::CRC; return DecodeStatus::NeedMoreData; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; 3507e: 10 92 74 13 sts 0x1374, r1 ; 0x801374 35082: 84 cf rjmp .-248 ; 0x34f8c } else { rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamCode: switch (c) { 35084: 80 35 cpi r24, 0x50 ; 80 35086: 11 f0 breq .+4 ; 0x3508c 35088: 82 35 cpi r24, 0x52 ; 82 3508a: c9 f7 brne .-14 ; 0x3507e case 'E': case 'F': case 'A': case 'R': case 'B': rspState = ResponseStates::ParamValue; 3508c: 80 92 6e 13 sts 0x136E, r8 ; 0x80136e responseMsg.paramCode = (ResponseMsgParamCodes)c; 35090: 80 93 74 13 sts 0x1374, r24 ; 0x801374 responseMsg.paramValue = 0; 35094: 10 92 76 13 sts 0x1376, r1 ; 0x801376 35098: 10 92 75 13 sts 0x1375, r1 ; 0x801375 3509c: 80 cf rjmp .-256 ; 0x34f9e 3509e: 20 ed ldi r18, 0xD0 ; 208 350a0: 28 0f add r18, r24 350a2: 2a 30 cpi r18, 0x0A ; 10 350a4: 48 f0 brcs .+18 ; 0x350b8 350a6: 2f e9 ldi r18, 0x9F ; 159 350a8: 28 0f add r18, r24 350aa: 26 30 cpi r18, 0x06 ; 6 350ac: 28 f0 brcs .+10 ; 0x350b8 case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; responseMsg.paramValue += Char2Nibble(c); return DecodeStatus::NeedMoreData; } else if (IsCRCSeparator(c)) { 350ae: 8a 32 cpi r24, 0x2A ; 42 350b0: 31 f7 brne .-52 ; 0x3507e rspState = ResponseStates::CRC; 350b2: 70 92 6e 13 sts 0x136E, r7 ; 0x80136e 350b6: 73 cf rjmp .-282 ; 0x34f9e return DecodeStatus::Error; } case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; responseMsg.paramValue += Char2Nibble(c); 350b8: 0f 94 16 c5 call 0x38a2c ; 0x38a2c rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; 350bc: 20 91 75 13 lds r18, 0x1375 ; 0x801375 350c0: 30 91 76 13 lds r19, 0x1376 ; 0x801376 350c4: 44 e0 ldi r20, 0x04 ; 4 350c6: 22 0f add r18, r18 350c8: 33 1f adc r19, r19 350ca: 4a 95 dec r20 350cc: e1 f7 brne .-8 ; 0x350c6 responseMsg.paramValue += Char2Nibble(c); 350ce: 82 0f add r24, r18 350d0: 93 2f mov r25, r19 350d2: 91 1d adc r25, r1 350d4: 90 93 76 13 sts 0x1376, r25 ; 0x801376 350d8: 80 93 75 13 sts 0x1375, r24 ; 0x801375 350dc: 60 cf rjmp .-320 ; 0x34f9e return DecodeStatus::Error; } case ResponseStates::CRC: if (IsHexDigit(c)) { responseMsg.request.crc8 <<= 4U; responseMsg.request.crc8 += Char2Nibble(c); 350de: 0f 94 16 c5 call 0x38a2c ; 0x38a2c rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::CRC: if (IsHexDigit(c)) { responseMsg.request.crc8 <<= 4U; 350e2: 90 91 73 13 lds r25, 0x1373 ; 0x801373 350e6: 92 95 swap r25 350e8: 90 7f andi r25, 0xF0 ; 240 responseMsg.request.crc8 += Char2Nibble(c); 350ea: 89 0f add r24, r25 350ec: 80 93 73 13 sts 0x1373, r24 ; 0x801373 350f0: 56 cf rjmp .-340 ; 0x34f9e ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 350f2: 8d 30 cpi r24, 0x0D ; 13 350f4: 21 f6 brne .-120 ; 0x3507e 350f6: 03 cf rjmp .-506 ; 0x34efe if (b < 32 || b > 127) { b = '.'; } *dst++ = b; } *dst = 0; // terminate properly 350f8: e8 0e add r14, r24 350fa: f9 1e adc r15, r25 350fc: f7 01 movw r30, r14 350fe: 10 82 st Z, r1 lrb = 0; // reset the input buffer index in case of a clean message 35100: 10 92 87 13 sts 0x1387, r1 ; 0x801387 } void ProtocolLogic::LogResponse() { char lrb[lastReceivedBytes.size()]; FormatLastResponseMsgAndClearLRB(lrb); MMU2_ECHO_MSGLN(lrb); 35104: 82 ef ldi r24, 0xF2 ; 242 35106: 9b ea ldi r25, 0xAB ; 171 35108: 0e 94 68 77 call 0xeed0 ; 0xeed0 3510c: 8c ee ldi r24, 0xEC ; 236 3510e: 9b ea ldi r25, 0xAB ; 171 35110: 0e 94 68 77 call 0xeed0 ; 0xeed0 35114: ce 01 movw r24, r28 35116: 01 96 adiw r24, 0x01 ; 1 35118: 0f 94 bb d5 call 0x3ab76 ; 0x3ab76 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 3511c: 0f 94 51 65 call 0x2caa2 ; 0x2caa2 if (auto expmsg = ExpectingMessage(); expmsg != MessageReady) { // this whole statement takes 12B return expmsg; } // process message switch (currentScope) { 35120: 80 91 4c 13 lds r24, 0x134C ; 0x80134c 35124: 81 30 cpi r24, 0x01 ; 1 35126: 09 f4 brne .+2 ; 0x3512a 35128: 74 c0 rjmp .+232 ; 0x35212 3512a: 08 f4 brcc .+2 ; 0x3512e 3512c: c5 ce rjmp .-630 ; 0x34eb8 3512e: 83 30 cpi r24, 0x03 ; 3 35130: 09 f4 brne .+2 ; 0x35134 35132: d1 c0 rjmp .+418 ; 0x352d6 35134: 84 30 cpi r24, 0x04 ; 4 35136: 09 f0 breq .+2 ; 0x3513a 35138: 4f ce rjmp .-866 ; 0x34dd8 return ProtocolError; } } StepStatus ProtocolLogic::CommandStep() { switch (scopeState) { 3513a: 80 91 4d 13 lds r24, 0x134D ; 0x80134d 3513e: 86 30 cpi r24, 0x06 ; 6 35140: 09 f4 brne .+2 ; 0x35144 35142: 6c c1 rjmp .+728 ; 0x3541c 35144: 08 f0 brcs .+2 ; 0x35148 35146: 93 c1 rjmp .+806 ; 0x3546e 35148: 84 30 cpi r24, 0x04 ; 4 3514a: 09 f4 brne .+2 ; 0x3514e 3514c: 09 c1 rjmp .+530 ; 0x35360 3514e: 85 30 cpi r24, 0x05 ; 5 35150: 09 f0 breq .+2 ; 0x35154 35152: cc c0 rjmp .+408 ; 0x352ec case ScopeState::CommandSent: { switch (rsp.paramCode) { // the response should be either accepted or rejected 35154: 80 91 64 13 lds r24, 0x1364 ; 0x801364 35158: 81 34 cpi r24, 0x41 ; 65 3515a: 09 f4 brne .+2 ; 0x3515e 3515c: 96 c1 rjmp .+812 ; 0x3548a 3515e: 82 35 cpi r24, 0x52 ; 82 35160: 09 f0 breq .+2 ; 0x35164 35162: c4 c0 rjmp .+392 ; 0x352ec errorCode = ErrorCode::RUNNING; scopeState = ScopeState::Wait; break; case ResponseMsgParamCodes::Rejected: // rejected - should normally not happen, but report the error up progressCode = ProgressCode::OK; 35164: 10 92 8c 13 sts 0x138C, r1 ; 0x80138c errorCode = ErrorCode::PROTOCOL_ERROR; 35168: 8d e2 ldi r24, 0x2D ; 45 3516a: 90 e8 ldi r25, 0x80 ; 128 3516c: 90 93 8b 13 sts 0x138B, r25 ; 0x80138b 35170: 80 93 8a 13 sts 0x138A, r24 ; 0x80138a } 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")); 35174: 81 e3 ldi r24, 0x31 ; 49 35176: 99 ea ldi r25, 0xA9 ; 169 35178: 0f 94 6e 65 call 0x2cadc ; 0x2cadc void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; } void ProtocolLogic::CommandRestart() { scopeState = ScopeState::CommandSent; 3517c: 85 e0 ldi r24, 0x05 ; 5 3517e: 80 93 4d 13 sts 0x134D, r24 ; 0x80134d SendMsg(rq); 35182: 40 91 4f 13 lds r20, 0x134F ; 0x80134f 35186: 50 91 50 13 lds r21, 0x1350 ; 0x801350 3518a: 60 91 51 13 lds r22, 0x1351 ; 0x801351 3518e: 70 91 52 13 lds r23, 0x1352 ; 0x801352 35192: 80 91 53 13 lds r24, 0x1353 ; 0x801353 35196: 0f 94 57 66 call 0x2ccae ; 0x2ccae 3519a: 16 e0 ldi r17, 0x06 ; 6 3519c: 07 c1 rjmp .+526 ; 0x353ac 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') { 3519e: 1b 36 cpi r17, 0x6B ; 107 351a0: 09 f0 breq .+2 ; 0x351a4 351a2: f7 c2 rjmp .+1518 ; 0x35792 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")); 351a4: 82 e1 ldi r24, 0x12 ; 18 351a6: 99 ea ldi r25, 0xA9 ; 169 351a8: 0f 94 6e 65 call 0x2cadc ; 0x2cadc 351ac: 18 e0 ldi r17, 0x08 ; 8 351ae: fe c0 rjmp .+508 ; 0x353ac default: RecordUARTActivity(); // something has happened on the UART, update the timeout record return ProtocolError; } } if (bytesConsumed != 0) { 351b0: cd 28 or r12, r13 351b2: 19 f0 breq .+6 ; 0x351ba RecordUARTActivity(); // something has happened on the UART, update the timeout record 351b4: 0f 94 51 65 call 0x2caa2 ; 0x2caa2 351b8: 7f ce rjmp .-770 ; 0x34eb8 IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 351ba: 0f 94 22 29 call 0x25244 ; 0x25244 351be: ab 01 movw r20, r22 351c0: bc 01 movw r22, r24 351c2: 80 91 59 13 lds r24, 0x1359 ; 0x801359 351c6: 90 91 5a 13 lds r25, 0x135A ; 0x80135a 351ca: a0 91 5b 13 lds r26, 0x135B ; 0x80135b 351ce: b0 91 5c 13 lds r27, 0x135C ; 0x80135c 351d2: 80 53 subi r24, 0x30 ; 48 351d4: 98 4f sbci r25, 0xF8 ; 248 351d6: af 4f sbci r26, 0xFF ; 255 351d8: 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) { 351da: 48 17 cp r20, r24 351dc: 59 07 cpc r21, r25 351de: 6a 07 cpc r22, r26 351e0: 7b 07 cpc r23, r27 351e2: 08 f4 brcc .+2 ; 0x351e6 351e4: 69 ce rjmp .-814 ; 0x34eb8 351e6: 80 91 4c 13 lds r24, 0x134C ; 0x80134c 351ea: 88 23 and r24, r24 351ec: 09 f4 brne .+2 ; 0x351f0 351ee: 64 ce rjmp .-824 ; 0x34eb8 rqState = RequestStates::Code; } /// resets the internal response decoding state (typically after an error) void ResetResponseDecoder() { rspState = ResponseStates::RequestCode; 351f0: 10 92 6e 13 sts 0x136E, r1 ; 0x80136e initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 351f4: 81 e0 ldi r24, 0x01 ; 1 351f6: 80 93 67 13 sts 0x1367, r24 ; 0x801367 currentScope = Scope::StartSeq; 351fa: 80 93 4c 13 sts 0x134C, r24 ; 0x80134c LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 351fe: 86 e0 ldi r24, 0x06 ; 6 35200: 80 93 4e 13 sts 0x134E, r24 ; 0x80134e SendVersion(0); 35204: 80 e0 ldi r24, 0x00 ; 0 35206: 0f 94 37 a5 call 0x34a6e ; 0x34a6e StepStatus ProtocolLogic::HandleCommunicationTimeout() { uart->flush(); // clear the output buffer protocol.ResetResponseDecoder(); Start(); return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); 3520a: 64 e0 ldi r22, 0x04 ; 4 3520c: 8a ee ldi r24, 0xEA ; 234 3520e: 98 ea ldi r25, 0xA8 ; 168 35210: 79 c0 rjmp .+242 ; 0x35304 return Finished; } StepStatus ProtocolLogic::StartSeqStep() { // solve initial handshake switch (scopeState) { 35212: 10 91 4d 13 lds r17, 0x134D ; 0x80134d 35216: 13 30 cpi r17, 0x03 ; 3 35218: b1 f1 breq .+108 ; 0x35286 3521a: 60 f0 brcs .+24 ; 0x35234 3521c: 16 30 cpi r17, 0x06 ; 6 3521e: 09 f4 brne .+2 ; 0x35222 35220: 50 c0 rjmp .+160 ; 0x352c2 35222: 19 30 cpi r17, 0x09 ; 9 35224: 09 f0 breq .+2 ; 0x35228 35226: be cf rjmp .-132 ; 0x351a4 // Start General Interrogation after line up - initial parametrization is started StartWritingInitRegisters(); } return Processing; case ScopeState::WritingInitRegisters: if (ProcessWritingInitRegister()) { 35228: 0f 94 81 67 call 0x2cf02 ; 0x2cf02 3522c: 88 23 and r24, r24 3522e: 09 f4 brne .+2 ; 0x35232 35230: 43 ce rjmp .-890 ; 0x34eb8 35232: 40 ce rjmp .-896 ; 0x34eb4 void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; } StepStatus ProtocolLogic::ProcessVersionResponse(uint8_t stage) { if (rsp.request.code != RequestMsgCodes::Version || rsp.request.value != stage) { 35234: 80 91 5f 13 lds r24, 0x135F ; 0x80135f 35238: 83 35 cpi r24, 0x53 ; 83 3523a: 21 f4 brne .+8 ; 0x35244 3523c: 80 91 60 13 lds r24, 0x1360 ; 0x801360 35240: 18 17 cp r17, r24 35242: 11 f0 breq .+4 ; 0x35248 mmuFwVersion[stage] = rsp.paramValue; if (mmuFwVersion[stage] != pgm_read_byte(supportedMmuFWVersion + stage)) { if (--retries == 0) { return VersionMismatch; } else { SendVersion(stage); 35244: 81 2f mov r24, r17 35246: fe cd rjmp .-1028 ; 0x34e44 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; 35248: 80 91 65 13 lds r24, 0x1365 ; 0x801365 3524c: e1 2f mov r30, r17 3524e: f0 e0 ldi r31, 0x00 ; 0 35250: df 01 movw r26, r30 35252: a7 56 subi r26, 0x67 ; 103 35254: bc 4e sbci r27, 0xEC ; 236 35256: 8c 93 st X, r24 if (mmuFwVersion[stage] != pgm_read_byte(supportedMmuFWVersion + stage)) { 35258: e1 5f subi r30, 0xF1 ; 241 3525a: f6 45 sbci r31, 0x56 ; 86 3525c: e4 91 lpm r30, Z 3525e: 8e 17 cp r24, r30 35260: 41 f0 breq .+16 ; 0x35272 if (--retries == 0) { 35262: 80 91 4e 13 lds r24, 0x134E ; 0x80134e 35266: 81 50 subi r24, 0x01 ; 1 35268: 80 93 4e 13 sts 0x134E, r24 ; 0x80134e 3526c: 81 11 cpse r24, r1 3526e: ea cf rjmp .-44 ; 0x35244 35270: 99 cf rjmp .-206 ; 0x351a4 SERIAL_ECHOLNPGM("ResetRetryAttempts"); retryAttempts = MAX_RETRIES; } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 35272: 85 e9 ldi r24, 0x95 ; 149 35274: 9b ea ldi r25, 0xAB ; 171 35276: 0e 94 93 79 call 0xf326 ; 0xf326 /// @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; } 3527a: 8a e0 ldi r24, 0x0A ; 10 3527c: 80 93 5e 13 sts 0x135E, r24 ; 0x80135e } else { SendVersion(stage); } } else { ResetCommunicationTimeoutAttempts(); // got a meaningful response from the MMU, stop data layer timeout tracking SendVersion(stage + 1); 35280: 81 e0 ldi r24, 0x01 ; 1 35282: 81 0f add r24, r17 35284: df cd rjmp .-1090 ; 0x34e44 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) { 35286: 80 91 5f 13 lds r24, 0x135F ; 0x80135f 3528a: 83 35 cpi r24, 0x53 ; 83 3528c: 21 f4 brne .+8 ; 0x35296 3528e: 80 91 60 13 lds r24, 0x1360 ; 0x801360 35292: 83 30 cpi r24, 0x03 ; 3 35294: 11 f0 breq .+4 ; 0x3529a // got a response to something else - protocol corruption probably, repeat the query OR restart the comm by issuing S0? SendVersion(3); 35296: 83 e0 ldi r24, 0x03 ; 3 35298: d5 cd rjmp .-1110 ; 0x34e44 } else { mmuFwVersionBuild = rsp.paramValue; // just register the build number 3529a: 80 91 65 13 lds r24, 0x1365 ; 0x801365 3529e: 90 91 66 13 lds r25, 0x1366 ; 0x801366 352a2: 90 93 9d 13 sts 0x139D, r25 ; 0x80139d 352a6: 80 93 9c 13 sts 0x139C, r24 ; 0x80139c } return ScopeState::Reading16bitRegisters; } void ProtocolLogic::StartWritingInitRegisters() { regIndex = 0; 352aa: 10 92 98 13 sts 0x1398, r1 ; 0x801398 SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); 352ae: e3 e9 ldi r30, 0x93 ; 147 352b0: fb ea ldi r31, 0xAB ; 171 352b2: 84 91 lpm r24, Z 352b4: 60 91 96 13 lds r22, 0x1396 ; 0x801396 352b8: 70 e0 ldi r23, 0x00 ; 0 352ba: 49 e0 ldi r20, 0x09 ; 9 352bc: 0f 94 c2 66 call 0x2cd84 ; 0x2cd84 352c0: fb cd rjmp .-1034 ; 0x34eb8 currentScope = Scope::Idle; IdleRestart(); } void ProtocolLogic::SwitchFromStartToIdle() { state = State::Running; 352c2: 82 e0 ldi r24, 0x02 ; 2 352c4: 80 93 67 13 sts 0x1367, r24 ; 0x801367 currentScope = Scope::Idle; 352c8: 83 e0 ldi r24, 0x03 ; 3 352ca: 80 93 4c 13 sts 0x134C, r24 ; 0x80134c scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 352ce: 82 e8 ldi r24, 0x82 ; 130 352d0: 80 93 4d 13 sts 0x134D, r24 ; 0x80134d 352d4: d2 cd rjmp .-1116 ; 0x34e7a } return Finished; } StepStatus ProtocolLogic::IdleStep() { switch (scopeState) { 352d6: 80 91 4d 13 lds r24, 0x134D ; 0x80134d 352da: 88 30 cpi r24, 0x08 ; 8 352dc: 09 f4 brne .+2 ; 0x352e0 352de: b7 c0 rjmp .+366 ; 0x3544e 352e0: a8 f4 brcc .+42 ; 0x3530c 352e2: 84 30 cpi r24, 0x04 ; 4 352e4: d9 f0 breq .+54 ; 0x3531c 352e6: 87 30 cpi r24, 0x07 ; 7 352e8: 09 f4 brne .+2 ; 0x352ec 352ea: ae c0 rjmp .+348 ; 0x35448 return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); } StepStatus ProtocolLogic::HandleProtocolError() { uart->flush(); // clear the output buffer state = State::InitSequence; 352ec: 81 e0 ldi r24, 0x01 ; 1 352ee: 80 93 67 13 sts 0x1367, r24 ; 0x801367 currentScope = Scope::DelayedRestart; 352f2: 82 e0 ldi r24, 0x02 ; 2 352f4: 80 93 4c 13 sts 0x134C, r24 ; 0x80134c retries = maxRetries; SendVersion(0); } void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; 352f8: 83 e8 ldi r24, 0x83 ; 131 352fa: 80 93 4d 13 sts 0x134D, r24 ; 0x80134d StepStatus ProtocolLogic::HandleProtocolError() { uart->flush(); // clear the output buffer state = State::InitSequence; currentScope = Scope::DelayedRestart; DelayedRestartRestart(); return SuppressShortDropOuts(PSTR("Protocol Error"), ProtocolError); 352fe: 65 e0 ldi r22, 0x05 ; 5 35300: 80 e0 ldi r24, 0x00 ; 0 35302: 99 ea ldi r25, 0xA9 ; 169 StepStatus ProtocolLogic::HandleCommunicationTimeout() { uart->flush(); // clear the output buffer protocol.ResetResponseDecoder(); Start(); return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); 35304: 0f 94 df 65 call 0x2cbbe ; 0x2cbbe 35308: 18 2f mov r17, r24 3530a: 50 c0 rjmp .+160 ; 0x353ac } return Finished; } StepStatus ProtocolLogic::IdleStep() { switch (scopeState) { 3530c: 8a 30 cpi r24, 0x0A ; 10 3530e: 09 f4 brne .+2 ; 0x35312 35310: a7 c0 rjmp .+334 ; 0x35460 35312: 60 f3 brcs .-40 ; 0x352ec 35314: 8d 30 cpi r24, 0x0D ; 13 35316: 08 f4 brcc .+2 ; 0x3531a 35318: 5f cd rjmp .-1346 ; 0x34dd8 3531a: e8 cf rjmp .-48 ; 0x352ec 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) { 3531c: 80 91 5f 13 lds r24, 0x135F ; 0x80135f 35320: 8e 34 cpi r24, 0x4E ; 78 35322: 60 f5 brcc .+88 ; 0x3537c 35324: 8b 34 cpi r24, 0x4B ; 75 35326: 10 f4 brcc .+4 ; 0x3532c 35328: 85 34 cpi r24, 0x45 ; 69 3532a: 01 f7 brne .-64 ; 0x352ec case RequestMsgCodes::Eject: case RequestMsgCodes::Load: case RequestMsgCodes::Mode: case RequestMsgCodes::Tool: case RequestMsgCodes::Unload: if (rsp.paramCode != ResponseMsgParamCodes::Finished) { 3532c: 80 91 64 13 lds r24, 0x1364 ; 0x801364 35330: 86 34 cpi r24, 0x46 ; 70 35332: 09 f4 brne .+2 ; 0x35336 35334: 73 c0 rjmp .+230 ; 0x3541c return true; } } StepStatus ProtocolLogic::SwitchFromIdleToCommand() { currentScope = Scope::Command; 35336: 84 e0 ldi r24, 0x04 ; 4 35338: 80 93 4c 13 sts 0x134C, r24 ; 0x80134c 3533c: 85 e0 ldi r24, 0x05 ; 5 3533e: ef e5 ldi r30, 0x5F ; 95 35340: f3 e1 ldi r31, 0x13 ; 19 35342: de 01 movw r26, r28 35344: 11 96 adiw r26, 0x01 ; 1 35346: 01 90 ld r0, Z+ 35348: 0d 92 st X+, r0 3534a: 8a 95 dec r24 3534c: e1 f7 brne .-8 ; 0x35346 StepStatus StoppedStep() { return Processing; } StepStatus ProcessCommandQueryResponse(); inline void SetRequestMsg(RequestMsg msg) { rq = msg; 3534e: 85 e0 ldi r24, 0x05 ; 5 35350: fe 01 movw r30, r28 35352: 31 96 adiw r30, 0x01 ; 1 35354: af e4 ldi r26, 0x4F ; 79 35356: b3 e1 ldi r27, 0x13 ; 19 35358: 01 90 ld r0, Z+ 3535a: 0d 92 st X+, r0 3535c: 8a 95 dec r24 3535e: e1 f7 brne .-8 ; 0x35358 default: return ProtocolError; } } break; case ScopeState::QuerySent: return ProcessCommandQueryResponse(); 35360: 0f 94 9a a5 call 0x34b34 ; 0x34b34 35364: 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) { 35366: 85 30 cpi r24, 0x05 ; 5 35368: 09 f2 breq .-126 ; 0x352ec 3536a: 08 f0 brcs .+2 ; 0x3536e 3536c: 9c c0 rjmp .+312 ; 0x354a6 3536e: 82 30 cpi r24, 0x02 ; 2 35370: 09 f4 brne .+2 ; 0x35374 35372: 32 cd rjmp .-1436 ; 0x34dd8 35374: 84 30 cpi r24, 0x04 ; 4 35376: 09 f4 brne .+2 ; 0x3537a 35378: 3b cf rjmp .-394 ; 0x351f0 3537a: 18 c0 rjmp .+48 ; 0x353ac 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) { 3537c: 84 35 cpi r24, 0x54 ; 84 3537e: 08 f4 brcc .+2 ; 0x35382 35380: b5 cf rjmp .-150 ; 0x352ec 35382: 86 35 cpi r24, 0x56 ; 86 35384: 98 f2 brcs .-90 ; 0x3532c 35386: 88 35 cpi r24, 0x58 ; 88 35388: 09 f0 breq .+2 ; 0x3538c 3538a: b0 cf rjmp .-160 ; 0x352ec 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) { 3538c: 80 91 64 13 lds r24, 0x1364 ; 0x801364 35390: 86 34 cpi r24, 0x46 ; 70 35392: 89 f1 breq .+98 ; 0x353f6 35394: 80 35 cpi r24, 0x50 ; 80 35396: c1 f1 breq .+112 ; 0x35408 35398: 82 34 cpi r24, 0x42 ; 66 3539a: 09 f0 breq .+2 ; 0x3539e 3539c: 42 c0 rjmp .+132 ; 0x35422 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); 3539e: 80 91 65 13 lds r24, 0x1365 ; 0x801365 353a2: 80 93 8d 13 sts 0x138D, r24 ; 0x80138d StartReading8bitRegisters(); 353a6: 0f 94 48 a4 call 0x34890 ; 0x34890 return ButtonPushed; 353aa: 1b e0 ldi r17, 0x0B ; 11 353ac: 80 91 4a 13 lds r24, 0x134A ; 0x80134a 353b0: 90 91 4b 13 lds r25, 0x134B ; 0x80134b break; default: break; } // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; 353b4: 81 30 cpi r24, 0x01 ; 1 353b6: 91 05 cpc r25, r1 353b8: 09 f0 breq .+2 ; 0x353bc 353ba: ee c1 rjmp .+988 ; 0x35798 const StepStatus ss = logic.Step(); switch (ss) { 353bc: 12 30 cpi r17, 0x02 ; 2 353be: 09 f4 brne .+2 ; 0x353c2 353c0: 90 c0 rjmp .+288 ; 0x354e2 353c2: 08 f0 brcs .+2 ; 0x353c6 353c4: 7d c0 rjmp .+250 ; 0x354c0 353c6: 11 23 and r17, r17 353c8: 09 f4 brne .+2 ; 0x353cc 353ca: 18 c1 rjmp .+560 ; 0x355fc case Interrupted: // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { 353cc: 00 23 and r16, r16 353ce: 09 f4 brne .+2 ; 0x353d2 353d0: e4 c0 rjmp .+456 ; 0x3559a switch (ss) { 353d2: 17 30 cpi r17, 0x07 ; 7 353d4: 09 f4 brne .+2 ; 0x353d8 353d6: c4 c1 rjmp .+904 ; 0x35760 353d8: 08 f0 brcs .+2 ; 0x353dc 353da: b8 c1 rjmp .+880 ; 0x3574c 353dc: 14 30 cpi r17, 0x04 ; 4 353de: 09 f4 brne .+2 ; 0x353e2 353e0: c7 c1 rjmp .+910 ; 0x35770 353e2: 15 30 cpi r17, 0x05 ; 5 353e4: 09 f0 breq .+2 ; 0x353e8 353e6: d9 c0 rjmp .+434 ; 0x3559a state = xState::Connecting; ReportError(ErrorCode::MMU_NOT_RESPONDING, ErrorSourcePrinter); break; case ProtocolError: state = xState::Connecting; 353e8: 82 e0 ldi r24, 0x02 ; 2 353ea: 80 93 b9 13 sts 0x13B9, r24 ; 0x8013b9 ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); 353ee: 60 e0 ldi r22, 0x00 ; 0 353f0: 8d e2 ldi r24, 0x2D ; 45 353f2: 90 e8 ldi r25, 0x80 ; 128 353f4: ba c1 rjmp .+884 ; 0x3576a // 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) { 353f6: 80 91 4f 13 lds r24, 0x134F ; 0x80134f 353fa: 88 23 and r24, r24 353fc: 29 f0 breq .+10 ; 0x35408 scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 353fe: 82 e8 ldi r24, 0x82 ; 130 35400: 80 93 4d 13 sts 0x134D, r24 ; 0x80134d 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; 35404: 13 e0 ldi r17, 0x03 ; 3 35406: d2 cf rjmp .-92 ; 0x353ac } [[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); 35408: 80 91 65 13 lds r24, 0x1365 ; 0x801365 3540c: 80 93 8c 13 sts 0x138C, r24 ; 0x80138c errorCode = ErrorCode::OK; 35410: 81 e0 ldi r24, 0x01 ; 1 35412: 90 e0 ldi r25, 0x00 ; 0 35414: 90 93 8b 13 sts 0x138B, r25 ; 0x80138b 35418: 80 93 8a 13 sts 0x138A, r24 ; 0x80138a } } break; case ScopeState::QuerySent: return ProcessCommandQueryResponse(); case ScopeState::FilamentSensorStateSent: StartReading8bitRegisters(); 3541c: 0f 94 48 a4 call 0x34890 ; 0x34890 35420: 4b cd rjmp .-1386 ; 0x34eb8 // 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; 35422: 8c e0 ldi r24, 0x0C ; 12 35424: 80 93 8c 13 sts 0x138C, r24 ; 0x80138c errorCode = static_cast(rsp.paramValue); 35428: 80 91 65 13 lds r24, 0x1365 ; 0x801365 3542c: 90 91 66 13 lds r25, 0x1366 ; 0x801366 35430: 90 93 8b 13 sts 0x138B, r25 ; 0x80138b 35434: 80 93 8a 13 sts 0x138A, r24 ; 0x80138a StartReading8bitRegisters(); // continue Idle state without restarting the communication 35438: 0f 94 48 a4 call 0x34890 ; 0x34890 // @@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")); 3543c: 83 e2 ldi r24, 0x23 ; 35 3543e: 99 ea ldi r25, 0xA9 ; 169 35440: 0f 94 6e 65 call 0x2cadc ; 0x2cadc 35444: 17 e0 ldi r17, 0x07 ; 7 35446: b2 cf rjmp .-156 ; 0x353ac return ProtocolError; } StartReading8bitRegisters(); return Processing; case ScopeState::Reading8bitRegisters: ProcessRead8bitRegister(); 35448: 0f 94 6c a4 call 0x348d8 ; 0x348d8 3544c: 35 cd rjmp .-1430 ; 0x34eb8 return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Ready); 3544e: 82 e8 ldi r24, 0x82 ; 130 35450: 0f 94 50 a4 call 0x348a0 ; 0x348a0 35454: 80 93 4d 13 sts 0x134D, r24 ; 0x80134d return scopeState == ScopeState::Ready ? Finished : Processing; 35458: 82 38 cpi r24, 0x82 ; 130 3545a: 09 f0 breq .+2 ; 0x3545e 3545c: 2d cd rjmp .-1446 ; 0x34eb8 3545e: bc cc rjmp .-1672 ; 0x34dd8 case ScopeState::ButtonSent: if (rsp.paramCode == ResponseMsgParamCodes::Accepted) { 35460: 80 91 64 13 lds r24, 0x1364 ; 0x801364 35464: 81 34 cpi r24, 0x41 ; 65 35466: d1 f6 brne .-76 ; 0x3541c // Button was accepted, decrement the retry. DecrementRetryAttempts(); 35468: 0f 94 5c 65 call 0x2cab8 ; 0x2cab8 3546c: d7 cf rjmp .-82 ; 0x3541c return ProtocolError; } } StepStatus ProtocolLogic::CommandStep() { switch (scopeState) { 3546e: 88 30 cpi r24, 0x08 ; 8 35470: b1 f0 breq .+44 ; 0x3549e 35472: 50 f3 brcs .-44 ; 0x35448 35474: 8a 30 cpi r24, 0x0A ; 10 35476: 09 f0 breq .+2 ; 0x3547a 35478: 39 cf rjmp .-398 ; 0x352ec return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Wait); return Processing; case ScopeState::ButtonSent: if (rsp.paramCode == ResponseMsgParamCodes::Accepted) { 3547a: 80 91 64 13 lds r24, 0x1364 ; 0x801364 3547e: 81 34 cpi r24, 0x41 ; 65 35480: 09 f0 breq .+2 ; 0x35484 35482: 18 cd rjmp .-1488 ; 0x34eb4 // Button was accepted, decrement the retry. DecrementRetryAttempts(); 35484: 0f 94 5c 65 call 0x2cab8 ; 0x2cab8 35488: 15 cd rjmp .-1494 ; 0x34eb4 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; 3548a: 10 92 8c 13 sts 0x138C, r1 ; 0x80138c errorCode = ErrorCode::RUNNING; 3548e: 10 92 8b 13 sts 0x138B, r1 ; 0x80138b 35492: 10 92 8a 13 sts 0x138A, r1 ; 0x80138a scopeState = ScopeState::Wait; 35496: 81 e8 ldi r24, 0x81 ; 129 return Processing; case ScopeState::Reading8bitRegisters: ProcessRead8bitRegister(); return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Wait); 35498: 80 93 4d 13 sts 0x134D, r24 ; 0x80134d 3549c: 0d cd rjmp .-1510 ; 0x34eb8 3549e: 81 e8 ldi r24, 0x81 ; 129 354a0: 0f 94 50 a4 call 0x348a0 ; 0x348a0 354a4: f9 cf rjmp .-14 ; 0x35498 StepStatus ProtocolLogic::Step() { if (!ExpectsResponse()) { // if not waiting for a response, activate a planned request immediately ActivatePlannedRequest(); } auto currentStatus = ScopeStep(); switch (currentStatus) { 354a6: 87 30 cpi r24, 0x07 ; 7 354a8: 49 f2 breq .-110 ; 0x3543c 354aa: 08 f4 brcc .+2 ; 0x354ae 354ac: 63 ce rjmp .-826 ; 0x35174 354ae: 88 30 cpi r24, 0x08 ; 8 354b0: 09 f4 brne .+2 ; 0x354b4 354b2: 78 ce rjmp .-784 ; 0x351a4 354b4: 7b cf rjmp .-266 ; 0x353ac // 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()) { 354b6: 80 91 4d 13 lds r24, 0x134D ; 0x80134d 354ba: 87 fd sbrc r24, 7 354bc: 9a cc rjmp .-1740 ; 0x34df2 354be: fc cc rjmp .-1544 ; 0x34eb8 StepStatus MMU2::LogicStep(bool reportErrors) { // Process any buttons before proceeding with another MMU Query CheckUserInput(); const StepStatus ss = logic.Step(); switch (ss) { 354c0: 13 30 cpi r17, 0x03 ; 3 354c2: 09 f4 brne .+2 ; 0x354c6 354c4: 6a c0 rjmp .+212 ; 0x3559a 354c6: 1b 30 cpi r17, 0x0B ; 11 354c8: 09 f0 breq .+2 ; 0x354cc 354ca: 80 cf rjmp .-256 ; 0x353cc case Processing: OnMMUProgressMsg(logic.Progress()); break; case ButtonPushed: lastButton = logic.Button(); 354cc: 80 91 8d 13 lds r24, 0x138D ; 0x80138d 354d0: 80 93 b4 13 sts 0x13B4, r24 ; 0x8013b4 LogEchoEvent_P(PSTR("MMU Button pushed")); 354d4: 82 e4 ldi r24, 0x42 ; 66 354d6: 99 ea ldi r25, 0xA9 ; 169 354d8: 0f 94 90 c5 call 0x38b20 ; 0x38b20 CheckUserInput(); // Process the button immediately 354dc: 0f 94 04 a6 call 0x34c08 ; 0x34c08 354e0: 5c c0 rjmp .+184 ; 0x3559a CheckErrorScreenUserInput(); } void MMU2::CheckFINDARunout() { // Check for FINDA filament runout if (!FindaDetectsFilament() && check_fsensor()) { // Check if we have filament runout detected from sensors 354e2: 80 91 8f 13 lds r24, 0x138F ; 0x80138f 354e6: 81 11 cpse r24, r1 354e8: 58 c0 rjmp .+176 ; 0x3559a 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() 354ea: 0e 94 a8 67 call 0xcf50 ; 0xcf50 && mcode_in_progress != 600 && !saved_printing && !mesh_bed_leveling_flag && !homing_flag && e_active(); 354ee: 88 23 and r24, r24 354f0: 09 f4 brne .+2 ; 0x354f4 354f2: 53 c0 rjmp .+166 ; 0x3559a } // Currently only used in one place, allowed to be inlined bool check_fsensor() { return printJobOngoing() && mcode_in_progress != 600 354f4: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 <_ZL17mcode_in_progress.lto_priv.530> 354f8: 90 91 aa 0d lds r25, 0x0DAA ; 0x800daa <_ZL17mcode_in_progress.lto_priv.530+0x1> 354fc: 88 35 cpi r24, 0x58 ; 88 354fe: 92 40 sbci r25, 0x02 ; 2 35500: 09 f4 brne .+2 ; 0x35504 35502: 4b c0 rjmp .+150 ; 0x3559a && !saved_printing 35504: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 35508: 81 11 cpse r24, r1 3550a: 47 c0 rjmp .+142 ; 0x3559a && !mesh_bed_leveling_flag 3550c: 80 91 a7 0d lds r24, 0x0DA7 ; 0x800da7 35510: 81 11 cpse r24, r1 35512: 43 c0 rjmp .+134 ; 0x3559a && !homing_flag 35514: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 35518: 81 11 cpse r24, r1 3551a: 3f c0 rjmp .+126 ; 0x3559a bool e_active() { unsigned char e_active = 0; block_t *block; if(block_buffer_tail != block_buffer_head) 3551c: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 35520: 80 91 a4 0d lds r24, 0x0DA4 ; 0x800da4 35524: 98 17 cp r25, r24 35526: c9 f1 breq .+114 ; 0x3559a { uint8_t block_index = block_buffer_tail; 35528: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 } #endif bool e_active() { unsigned char e_active = 0; 3552c: 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++; 3552e: 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) 35530: 30 91 a4 0d lds r19, 0x0DA4 ; 0x800da4 35534: 38 17 cp r19, r24 35536: 89 f0 breq .+34 ; 0x3555a { block = &block_buffer[block_index]; if(block->steps[E_AXIS].wide != 0) e_active++; 35538: 28 9f mul r18, r24 3553a: f0 01 movw r30, r0 3553c: 11 24 eor r1, r1 3553e: ec 53 subi r30, 0x3C ; 60 35540: f9 4f sbci r31, 0xF9 ; 249 35542: 44 85 ldd r20, Z+12 ; 0x0c 35544: 55 85 ldd r21, Z+13 ; 0x0d 35546: 66 85 ldd r22, Z+14 ; 0x0e 35548: 77 85 ldd r23, Z+15 ; 0x0f 3554a: 45 2b or r20, r21 3554c: 46 2b or r20, r22 3554e: 47 2b or r20, r23 35550: 09 f0 breq .+2 ; 0x35554 35552: 9f 5f subi r25, 0xFF ; 255 block_index = (block_index+1) & (BLOCK_BUFFER_SIZE - 1); 35554: 8f 5f subi r24, 0xFF ; 255 35556: 8f 70 andi r24, 0x0F ; 15 35558: eb cf rjmp .-42 ; 0x35530 && e_active(); 3555a: 99 23 and r25, r25 3555c: f1 f0 breq .+60 ; 0x3559a SERIAL_ECHOLNPGM("FINDA filament runout!"); 3555e: 83 ed ldi r24, 0xD3 ; 211 35560: 98 ea ldi r25, 0xA8 ; 168 35562: 0e 94 93 79 call 0xf326 ; 0xf326 void marlin_clear_print_state_in_ram() { clear_print_state_in_ram(); } void marlin_stop_and_save_print_to_ram() { stop_and_save_print_to_ram(0,0); 35566: 20 e0 ldi r18, 0x00 ; 0 35568: 30 e0 ldi r19, 0x00 ; 0 3556a: a9 01 movw r20, r18 3556c: ca 01 movw r24, r20 3556e: b9 01 movw r22, r18 35570: 0e 94 4f 89 call 0x1129e ; 0x1129e marlin_stop_and_save_print_to_ram(); restore_print_from_ram_and_continue(0); 35574: 60 e0 ldi r22, 0x00 ; 0 35576: 70 e0 ldi r23, 0x00 ; 0 35578: cb 01 movw r24, r22 3557a: 0e 94 5c 68 call 0xd0b8 ; 0xd0b8 } } bool SpoolJoin::isSpoolJoinEnabled() { if(eeprom_read_byte((uint8_t*)EEPROM_SPOOL_JOIN) == (uint8_t)EEPROM::Enabled) { 3557e: 86 ed ldi r24, 0xD6 ; 214 35580: 9e e0 ldi r25, 0x0E ; 14 35582: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 35586: 81 30 cpi r24, 0x01 ; 1 35588: 21 f4 brne .+8 ; 0x35592 if (SpoolJoin::spooljoin.isSpoolJoinEnabled() && get_current_tool() != (uint8_t)FILAMENT_UNKNOWN){ // Can't auto if F=? 3558a: 0f 94 74 74 call 0x2e8e8 ; 0x2e8e8 3558e: 8f 3f cpi r24, 0xFF ; 255 35590: 91 f5 brne .+100 ; 0x355f6 enquecommand_front_P(PSTR("M600 AUTO")); // save print and run M600 command } else { enquecommand_front_P(MSG_M600); // save print and run M600 command 35592: 8c e2 ldi r24, 0x2C ; 44 35594: 91 e7 ldi r25, 0x71 ; 113 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 35596: 0f 94 b8 74 call 0x2e970 ; 0x2e970 break; } } } if (logic.Running()) { 3559a: 80 91 67 13 lds r24, 0x1367 ; 0x801367 3559e: 82 30 cpi r24, 0x02 ; 2 355a0: 19 f4 brne .+6 ; 0x355a8 state = xState::Active; 355a2: 81 e0 ldi r24, 0x01 ; 1 355a4: 80 93 b9 13 sts 0x13B9, r24 ; 0x8013b9 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 355a8: 10 93 b8 13 sts 0x13B8, r17 ; 0x8013b8 // 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) { 355ac: 80 91 c2 06 lds r24, 0x06C2 ; 0x8006c2 <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.490> 355b0: 88 23 and r24, r24 355b2: 51 f0 breq .+20 ; 0x355c8 bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { if (putErrorScreenToSleep) return; 355b4: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.496> 355b8: 81 11 cpse r24, r1 355ba: 06 c0 rjmp .+12 ; 0x355c8 355bc: 80 91 b1 13 lds r24, 0x13B1 ; 0x8013b1 355c0: 90 91 b2 13 lds r25, 0x13B2 ; 0x8013b2 355c4: 0f 94 f8 c6 call 0x38df0 ; 0x38df0 CheckErrorScreenUserInput(); } 355c8: a0 96 adiw r28, 0x20 ; 32 355ca: 0f b6 in r0, 0x3f ; 63 355cc: f8 94 cli 355ce: de bf out 0x3e, r29 ; 62 355d0: 0f be out 0x3f, r0 ; 63 355d2: cd bf out 0x3d, r28 ; 61 355d4: df 91 pop r29 355d6: cf 91 pop r28 355d8: 1f 91 pop r17 355da: 0f 91 pop r16 355dc: ff 90 pop r15 355de: ef 90 pop r14 355e0: df 90 pop r13 355e2: cf 90 pop r12 355e4: bf 90 pop r11 355e6: af 90 pop r10 355e8: 9f 90 pop r9 355ea: 8f 90 pop r8 355ec: 7f 90 pop r7 355ee: 6f 90 pop r6 355f0: 5f 90 pop r5 355f2: 4f 90 pop r4 355f4: 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 355f6: 89 ec ldi r24, 0xC9 ; 201 355f8: 98 ea ldi r25, 0xA8 ; 168 355fa: cd cf rjmp .-102 ; 0x35596 355fc: 00 91 8c 13 lds r16, 0x138C ; 0x80138c ReportProgressHook((CommandInProgress)logic.CommandInProgress(), pc); LogEchoEvent_P(_O(ProgressCodeToText(pc))); } void MMU2::OnMMUProgressMsg(ProgressCode pc) { if (pc != lastProgressCode) { 35600: 80 91 b0 13 lds r24, 0x13B0 ; 0x8013b0 35604: 08 17 cp r16, r24 35606: 09 f4 brne .+2 ; 0x3560a 35608: 49 c0 rjmp .+146 ; 0x3569c // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { 3560a: 80 91 4c 13 lds r24, 0x134C ; 0x80134c 3560e: 84 30 cpi r24, 0x04 ; 4 35610: b9 f4 brne .+46 ; 0x35640 break; } } void ReportProgressHook(CommandInProgress cip, ProgressCode ec) { if (cip != CommandInProgress::NoCommand) { 35612: 80 91 4f 13 lds r24, 0x134F ; 0x80134f 35616: 88 23 and r24, r24 35618: 99 f0 breq .+38 ; 0x35640 custom_message_type = CustomMsg::MMUProgress; 3561a: 89 e0 ldi r24, 0x09 ; 9 3561c: 80 93 c3 06 sts 0x06C3, r24 ; 0x8006c3 : static_cast(pgm_read_ptr(&progressTexts[0])); 35620: ef e8 ldi r30, 0x8F ; 143 35622: f8 ea ldi r31, 0xA8 ; 168 }; 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])) 35624: 0e 31 cpi r16, 0x1E ; 30 35626: 30 f4 brcc .+12 ; 0x35634 35628: e0 2f mov r30, r16 3562a: f0 e0 ldi r31, 0x00 ; 0 3562c: ee 0f add r30, r30 3562e: ff 1f adc r31, r31 35630: e1 57 subi r30, 0x71 ; 113 35632: f7 45 sbci r31, 0x57 ; 87 : static_cast(pgm_read_ptr(&progressTexts[0])); 35634: 85 91 lpm r24, Z+ 35636: 94 91 lpm r25, Z lcd_setstatuspgm( _T(ProgressCodeToText(ec)) ); 35638: 0e 94 c4 72 call 0xe588 ; 0xe588 3563c: 0e 94 38 f1 call 0x1e270 ; 0x1e270 35640: ef e8 ldi r30, 0x8F ; 143 35642: f8 ea ldi r31, 0xA8 ; 168 }; 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])) 35644: 0e 31 cpi r16, 0x1E ; 30 35646: 30 f4 brcc .+12 ; 0x35654 35648: e0 2f mov r30, r16 3564a: f0 e0 ldi r31, 0x00 ; 0 3564c: ee 0f add r30, r30 3564e: ff 1f adc r31, r31 35650: e1 57 subi r30, 0x71 ; 113 35652: f7 45 sbci r31, 0x57 ; 87 : static_cast(pgm_read_ptr(&progressTexts[0])); 35654: 85 91 lpm r24, Z+ 35656: 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))); 35658: 02 96 adiw r24, 0x02 ; 2 3565a: 0f 94 90 c5 call 0x38b20 ; 0x38b20 } } void MMU2::OnMMUProgressMsgChanged(ProgressCode pc) { ReportProgress(pc); lastProgressCode = pc; 3565e: 00 93 b0 13 sts 0x13B0, r16 ; 0x8013b0 switch (pc) { 35662: 03 30 cpi r16, 0x03 ; 3 35664: 49 f0 breq .+18 ; 0x35678 35666: 0c 31 cpi r16, 0x1C ; 28 35668: 09 f0 breq .+2 ; 0x3566c 3566a: 97 cf rjmp .-210 ; 0x3559a bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 3566c: 0f 94 a3 42 call 0x28546 ; 0x28546 } break; case ProgressCode::FeedingToFSensor: // prepare for the movement of the E-motor planner_synchronize(); loadFilamentStarted = true; 35670: 81 e0 ldi r24, 0x01 ; 1 35672: 80 93 bb 13 sts 0x13BB, r24 ; 0x8013bb 35676: 91 cf rjmp .-222 ; 0x3559a 35678: 80 91 4c 13 lds r24, 0x134C ; 0x80134c 3567c: 84 30 cpi r24, 0x04 ; 4 3567e: 31 f4 brne .+12 ; 0x3568c ReportProgress(pc); lastProgressCode = pc; switch (pc) { case ProgressCode::UnloadingToFinda: if ((CommandInProgress)logic.CommandInProgress() == CommandInProgress::UnloadFilament || ((CommandInProgress)logic.CommandInProgress() == CommandInProgress::ToolChange)) { 35680: 80 91 4f 13 lds r24, 0x134F ; 0x80134f 35684: 84 55 subi r24, 0x54 ; 84 35686: 82 30 cpi r24, 0x02 ; 2 35688: 08 f4 brcc .+2 ; 0x3568c 3568a: 87 cf rjmp .-242 ; 0x3559a 3568c: 0f 94 a3 42 call 0x28546 ; 0x28546 // 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; 35690: 81 e0 ldi r24, 0x01 ; 1 35692: 80 93 bc 13 sts 0x13BC, r24 ; 0x8013bc 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(); 35696: 0f 94 c7 69 call 0x2d38e ; 0x2d38e 3569a: 7f cf rjmp .-258 ; 0x3559a 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) { 3569c: 03 30 cpi r16, 0x03 ; 3 3569e: 71 f1 breq .+92 ; 0x356fc 356a0: 0c 31 cpi r16, 0x1C ; 28 356a2: 09 f0 breq .+2 ; 0x356a6 356a4: 7a cf rjmp .-268 ; 0x3559a unloadFilamentStarted = false; } } break; case ProgressCode::FeedingToFSensor: if (loadFilamentStarted) { 356a6: 80 91 bb 13 lds r24, 0x13BB ; 0x8013bb 356aa: 88 23 and r24, r24 356ac: 09 f4 brne .+2 ; 0x356b0 356ae: 75 cf rjmp .-278 ; 0x3559a switch (WhereIsFilament()) { 356b0: 0f 94 a0 c5 call 0x38b40 ; 0x38b40 356b4: 88 23 and r24, r24 356b6: b1 f1 breq .+108 ; 0x35724 356b8: 81 30 cpi r24, 0x01 ; 1 356ba: 09 f0 breq .+2 ; 0x356be 356bc: 6e cf rjmp .-292 ; 0x3559a case FilamentState::AT_FSENSOR: // fsensor triggered, finish FeedingToExtruder state loadFilamentStarted = false; 356be: 10 92 bb 13 sts 0x13BB, r1 ; 0x8013bb float move_raise_z(float delta) { return raise_z(delta); } void planner_abort_queued_moves() { planner_abort_hard(); 356c2: 0f 94 7e c1 call 0x382fc ; 0x382fc // 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; 356c6: 10 92 ab 0d sts 0x0DAB, r1 ; 0x800dab planner_abort_queued_moves(); { extruder_move(logic.ExtraLoadDistance() + 2, logic.PulleySlowFeedRate()); 356ca: 60 91 97 13 lds r22, 0x1397 ; 0x801397 356ce: 70 e0 ldi r23, 0x00 ; 0 356d0: 90 e0 ldi r25, 0x00 ; 0 356d2: 80 e0 ldi r24, 0x00 ; 0 356d4: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 356d8: 6b 01 movw r12, r22 356da: 7c 01 movw r14, r24 356dc: 60 91 96 13 lds r22, 0x1396 ; 0x801396 356e0: 70 e0 ldi r23, 0x00 ; 0 356e2: 6e 5f subi r22, 0xFE ; 254 356e4: 7f 4f sbci r23, 0xFF ; 255 356e6: 07 2e mov r0, r23 356e8: 00 0c add r0, r0 356ea: 88 0b sbc r24, r24 356ec: 99 0b sbc r25, r25 356ee: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 356f2: a7 01 movw r20, r14 356f4: 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()); 356f6: 0f 94 6c c5 call 0x38ad8 ; 0x38ad8 356fa: 4f cf rjmp .-354 ; 0x3559a } 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 356fc: 80 91 bc 13 lds r24, 0x13BC ; 0x8013bc 35700: 88 23 and r24, r24 35702: 09 f4 brne .+2 ; 0x35706 35704: 4a cf rjmp .-364 ; 0x3559a 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); 35706: 90 91 a4 0d lds r25, 0x0DA4 ; 0x800da4 3570a: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 3570e: 98 13 cpse r25, r24 35710: 44 cf rjmp .-376 ; 0x3559a switch (WhereIsFilament()) { 35712: 0f 94 a0 c5 call 0x38b40 ; 0x38b40 35716: 81 50 subi r24, 0x01 ; 1 35718: 83 30 cpi r24, 0x03 ; 3 3571a: 08 f4 brcc .+2 ; 0x3571e 3571c: bc cf rjmp .-136 ; 0x35696 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; 3571e: 10 92 bc 13 sts 0x13BC, r1 ; 0x8013bc 35722: 3b cf rjmp .-394 ; 0x3559a 35724: 90 91 a4 0d lds r25, 0x0DA4 ; 0x800da4 35728: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 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 3572c: 98 13 cpse r25, r24 3572e: 35 cf rjmp .-406 ; 0x3559a // 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()); 35730: 60 91 97 13 lds r22, 0x1397 ; 0x801397 35734: 70 e0 ldi r23, 0x00 ; 0 35736: 90 e0 ldi r25, 0x00 ; 0 35738: 80 e0 ldi r24, 0x00 ; 0 3573a: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 3573e: 9b 01 movw r18, r22 35740: ac 01 movw r20, r24 35742: 60 e0 ldi r22, 0x00 ; 0 35744: 70 e0 ldi r23, 0x00 ; 0 35746: 8f ea ldi r24, 0xAF ; 175 35748: 93 e4 ldi r25, 0x43 ; 67 3574a: d5 cf rjmp .-86 ; 0x356f6 // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { switch (ss) { 3574c: 18 30 cpi r17, 0x08 ; 8 3574e: b9 f0 breq .+46 ; 0x3577e 35750: 19 30 cpi r17, 0x09 ; 9 35752: 09 f0 breq .+2 ; 0x35756 35754: 22 cf rjmp .-444 ; 0x3559a StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); break; case PrinterError: ReportError(logic.PrinterError(), ErrorSourcePrinter); 35756: 60 e0 ldi r22, 0x00 ; 0 35758: 0f 94 a9 82 call 0x30552 ; 0x30552 3575c: 19 e0 ldi r17, 0x09 ; 9 3575e: 1d cf rjmp .-454 ; 0x3559a default: if (reportErrors) { switch (ss) { case CommandError: ReportError(logic.Error(), ErrorSourceMMU); 35760: 61 e0 ldi r22, 0x01 ; 1 35762: 80 91 8a 13 lds r24, 0x138A ; 0x80138a 35766: 90 91 8b 13 lds r25, 0x138B ; 0x80138b ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); break; case VersionMismatch: StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); 3576a: 0f 94 a9 82 call 0x30552 ; 0x30552 3576e: 15 cf rjmp .-470 ; 0x3559a case CommandError: ReportError(logic.Error(), ErrorSourceMMU); break; case CommunicationTimeout: state = xState::Connecting; 35770: 82 e0 ldi r24, 0x02 ; 2 35772: 80 93 b9 13 sts 0x13B9, r24 ; 0x8013b9 ReportError(ErrorCode::MMU_NOT_RESPONDING, ErrorSourcePrinter); 35776: 60 e0 ldi r22, 0x00 ; 0 35778: 8e e2 ldi r24, 0x2E ; 46 3577a: 90 e8 ldi r25, 0x80 ; 128 3577c: f6 cf rjmp .-20 ; 0x3576a StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 3577e: 10 92 b9 13 sts 0x13B9, r1 ; 0x8013b9 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 35782: 10 92 67 13 sts 0x1367, r1 ; 0x801367 currentScope = Scope::Stopped; 35786: 10 92 4c 13 sts 0x134C, r1 ; 0x80134c ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); break; case VersionMismatch: StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); 3578a: 60 e0 ldi r22, 0x00 ; 0 3578c: 8c e2 ldi r24, 0x2C ; 44 3578e: 90 e8 ldi r25, 0x80 ; 128 35790: ec cf rjmp .-40 ; 0x3576a break; } } [[fallthrough]]; // otherwise default: RecordUARTActivity(); // something has happened on the UART, update the timeout record 35792: 0f 94 51 65 call 0x2caa2 ; 0x2caa2 35796: aa cd rjmp .-1196 ; 0x352ec case Interrupted: // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { 35798: 00 23 and r16, r16 3579a: 01 f3 breq .-64 ; 0x3575c 3579c: dc cf rjmp .-72 ; 0x35756 0003579e : } } } void MMU2::ResumeHotendTemp() { if ((mmu_print_saved & SavedState::CooldownPending)) { 3579e: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 357a2: 82 ff sbrs r24, 2 357a4: 07 c0 rjmp .+14 ; 0x357b4 // Clear the "pending" flag if we haven't cooled yet. mmu_print_saved &= ~(SavedState::CooldownPending); 357a6: 8b 7f andi r24, 0xFB ; 251 357a8: 80 93 ba 13 sts 0x13BA, r24 ; 0x8013ba LogEchoEvent_P(PSTR("Cooldown flag cleared")); 357ac: 8d e1 ldi r24, 0x1D ; 29 357ae: 9a ea ldi r25, 0xAA ; 170 357b0: 0f 94 90 c5 call 0x38b20 ; 0x38b20 } if ((mmu_print_saved & SavedState::Cooldown) && resume_hotend_temp) { 357b4: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 357b8: 81 ff sbrs r24, 1 357ba: 52 c0 rjmp .+164 ; 0x35860 357bc: 80 91 ae 13 lds r24, 0x13AE ; 0x8013ae 357c0: 90 91 af 13 lds r25, 0x13AF ; 0x8013af 357c4: 89 2b or r24, r25 357c6: 09 f4 brne .+2 ; 0x357ca 357c8: 4b c0 rjmp .+150 ; 0x35860 LogEchoEvent_P(PSTR("Resuming Temp")); 357ca: 8f e0 ldi r24, 0x0F ; 15 357cc: 9a ea ldi r25, 0xAA ; 170 357ce: 0f 94 90 c5 call 0x38b20 ; 0x38b20 // @@TODO MMU2_ECHO_MSGRPGM(PSTR("Restoring hotend temperature ")); SERIAL_ECHOLN(resume_hotend_temp); 357d2: 80 91 ae 13 lds r24, 0x13AE ; 0x8013ae 357d6: 90 91 af 13 lds r25, 0x13AF ; 0x8013af 357da: 0f 94 b0 74 call 0x2e960 ; 0x2e960 mmu_print_saved &= ~(SavedState::Cooldown); 357de: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 357e2: 8d 7f andi r24, 0xFD ; 253 357e4: 80 93 ba 13 sts 0x13BA, r24 ; 0x8013ba return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 357e8: 80 91 ae 13 lds r24, 0x13AE ; 0x8013ae 357ec: 90 91 af 13 lds r25, 0x13AF ; 0x8013af 357f0: 90 93 b6 0d sts 0x0DB6, r25 ; 0x800db6 357f4: 80 93 b5 0d sts 0x0DB5, r24 ; 0x800db5 void FullScreenMsgLoad(uint8_t slot){ FullScreenMsg(_T(MSG_LOADING_FILAMENT), slot); } void FullScreenMsgRestoringTemperature(){ lcd_display_message_fullscreen_P(_T(MSG_MMU_RESTORE_TEMP)); 357f8: 84 e8 ldi r24, 0x84 ; 132 357fa: 9c e5 ldi r25, 0x5C ; 92 357fc: 0e 94 c4 72 call 0xe588 ; 0xe588 35800: 0f 94 ba 1f call 0x23f74 ; 0x23f74 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)); 35804: 4f ed ldi r20, 0xDF ; 223 35806: 59 ea ldi r21, 0xA9 ; 169 35808: 62 e0 ldi r22, 0x02 ; 2 3580a: 80 e0 ldi r24, 0x00 ; 0 3580c: 0e 94 0c 6f call 0xde18 ; 0xde18 int16_t thermal_degTargetHotend() { return degTargetHotend(0); } int16_t thermal_degHotend() { return degHotend(0); 35810: 60 91 af 0d lds r22, 0x0DAF ; 0x800daf 35814: 70 91 b0 0d lds r23, 0x0DB0 ; 0x800db0 35818: 80 91 b1 0d lds r24, 0x0DB1 ; 0x800db1 3581c: 90 91 b2 0d lds r25, 0x0DB2 ; 0x800db2 35820: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> namespace MMU2 { template void waitForHotendTargetTemp(uint16_t delay, F f) { while (((thermal_degTargetHotend() - thermal_degHotend()) > 5)) { 35824: 20 91 b5 0d lds r18, 0x0DB5 ; 0x800db5 35828: 30 91 b6 0d lds r19, 0x0DB6 ; 0x800db6 3582c: c9 01 movw r24, r18 3582e: 86 1b sub r24, r22 35830: 97 0b sbc r25, r23 35832: 06 97 sbiw r24, 0x06 ; 6 35834: 6c f0 brlt .+26 ; 0x35850 void marlin_manage_heater() { manage_heater(); } void marlin_manage_inactivity(bool ignore_stepper_queue) { manage_inactivity(ignore_stepper_queue); 35836: 81 e0 ldi r24, 0x01 ; 1 35838: 0e 94 c7 8a call 0x1158e ; 0x1158e 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); 3583c: 80 e0 ldi r24, 0x00 ; 0 3583e: 0f 94 bd a6 call 0x34d7a ; 0x34d7a ReportErrorHookDynamicRender(); 35842: 0f 94 b1 c4 call 0x38962 ; 0x38962 void thermal_setTargetHotend(int16_t t) { setTargetHotend(t); } void safe_delay_keep_alive(uint16_t t) { delay_keep_alive(t); 35846: 84 e6 ldi r24, 0x64 ; 100 35848: 90 e0 ldi r25, 0x00 ; 0 3584a: 0e 94 fc 8c call 0x119f8 ; 0x119f8 3584e: e0 cf rjmp .-64 ; 0x35810 }); ScreenUpdateEnable(); // temporary hack to stop this locking the printer... 35850: 0f 94 87 c4 call 0x3890e ; 0x3890e LogEchoEvent_P(PSTR("Hotend temperature reached")); 35854: 84 ef ldi r24, 0xF4 ; 244 35856: 99 ea ldi r25, 0xA9 ; 169 35858: 0f 94 90 c5 call 0x38b20 ; 0x38b20 void ScreenUpdateEnable(){ lcd_update_enable(true); } void ScreenClear(){ lcd_clear(); 3585c: 0c 94 2b 6f jmp 0xde56 ; 0xde56 ScreenClear(); } } 35860: 08 95 ret 00035862 : /// 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) { 35862: 0f 93 push r16 35864: 1f 93 push r17 35866: cf 93 push r28 35868: df 93 push r29 3586a: 00 d0 rcall .+0 ; 0x3586c 3586c: 1f 92 push r1 3586e: 1f 92 push r1 35870: cd b7 in r28, 0x3d ; 61 35872: de b7 in r29, 0x3e ; 62 35874: 18 2f mov r17, r24 35876: 06 2f mov r16, r22 mmu_print_saved = SavedState::None; 35878: 10 92 ba 13 sts 0x13BA, r1 ; 0x8013ba MARLIN_KEEPALIVE_STATE_IN_PROCESS; 3587c: 83 e0 ldi r24, 0x03 ; 3 3587e: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be LongTimer nozzleTimeout; 35882: 19 82 std Y+1, r1 ; 0x01 35884: 1a 82 std Y+2, r1 ; 0x02 35886: 1b 82 std Y+3, r1 ; 0x03 35888: 1c 82 std Y+4, r1 ; 0x04 3588a: 1d 82 std Y+5, r1 ; 0x05 3588c: 90 e0 ldi r25, 0x00 ; 0 3588e: 80 e0 ldi r24, 0x00 ; 0 35890: 0e 94 fc 8c call 0x119f8 ; 0x119f8 // - 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) { 35894: 90 91 ba 13 lds r25, 0x13BA ; 0x8013ba 35898: 89 81 ldd r24, Y+1 ; 0x01 3589a: 92 ff sbrs r25, 2 3589c: 37 c0 rjmp .+110 ; 0x3590c if (!nozzleTimeout.running()) { 3589e: 81 11 cpse r24, r1 358a0: 1e c0 rjmp .+60 ; 0x358de nozzleTimeout.start(); 358a2: ce 01 movw r24, r28 358a4: 01 96 adiw r24, 0x01 ; 1 358a6: 0f 94 c5 2b call 0x2578a ; 0x2578a ::start()> LogEchoEvent_P(PSTR("Cooling Timeout started")); 358aa: 84 ef ldi r24, 0xF4 ; 244 358ac: 97 ea ldi r25, 0xA7 ; 167 thermal_setTargetHotend(0); LogEchoEvent_P(PSTR("Heater cooldown")); } } else if (nozzleTimeout.running()) { nozzleTimeout.stop(); LogEchoEvent_P(PSTR("Cooling timer stopped")); 358ae: 0f 94 90 c5 call 0x38b20 ; 0x38b20 } switch (logicStepLastStatus) { 358b2: e0 91 b8 13 lds r30, 0x13B8 ; 0x8013b8 358b6: e2 50 subi r30, 0x02 ; 2 358b8: ea 30 cpi r30, 0x0A ; 10 358ba: 40 f7 brcc .-48 ; 0x3588c 358bc: f0 e0 ldi r31, 0x00 ; 0 358be: 88 27 eor r24, r24 358c0: eb 59 subi r30, 0x9B ; 155 358c2: f3 45 sbci r31, 0x53 ; 83 358c4: 8e 4f sbci r24, 0xFE ; 254 358c6: 0d 94 e7 dc jmp 0x3b9ce ; 0x3b9ce <__tablejump2__> 358ca: ce 39 cpi r28, 0x9E ; 158 358cc: da 3a cpi r29, 0xAA ; 170 358ce: 76 39 cpi r23, 0x96 ; 150 358d0: 76 39 cpi r23, 0x96 ; 150 358d2: 26 3b cpi r18, 0xB6 ; 182 358d4: 76 39 cpi r23, 0x96 ; 150 358d6: ba 3a cpi r27, 0xAA ; 170 358d8: 16 3b cpi r17, 0xB6 ; 182 358da: 72 39 cpi r23, 0x92 ; 146 358dc: 76 39 cpi r23, 0x96 ; 150 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. 358de: 40 e4 ldi r20, 0x40 ; 64 358e0: 57 e7 ldi r21, 0x77 ; 119 358e2: 6b e1 ldi r22, 0x1B ; 27 358e4: 70 e0 ldi r23, 0x00 ; 0 358e6: ce 01 movw r24, r28 358e8: 01 96 adiw r24, 0x01 ; 1 358ea: 0f 94 06 2a call 0x2540c ; 0x2540c ::expired(unsigned long)> 358ee: 88 23 and r24, r24 358f0: 01 f3 breq .-64 ; 0x358b2 mmu_print_saved &= ~(SavedState::CooldownPending); 358f2: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 358f6: 8b 7f andi r24, 0xFB ; 251 mmu_print_saved |= SavedState::Cooldown; 358f8: 82 60 ori r24, 0x02 ; 2 358fa: 80 93 ba 13 sts 0x13BA, r24 ; 0x8013ba 358fe: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 35902: 10 92 b5 0d sts 0x0DB5, r1 ; 0x800db5 thermal_setTargetHotend(0); LogEchoEvent_P(PSTR("Heater cooldown")); 35906: 84 ee ldi r24, 0xE4 ; 228 35908: 97 ea ldi r25, 0xA7 ; 167 3590a: d1 cf rjmp .-94 ; 0x358ae } } else if (nozzleTimeout.running()) { 3590c: 88 23 and r24, r24 3590e: 89 f2 breq .-94 ; 0x358b2 35910: 19 82 std Y+1, r1 ; 0x01 nozzleTimeout.stop(); LogEchoEvent_P(PSTR("Cooling timer stopped")); 35912: 8e ec ldi r24, 0xCE ; 206 35914: 97 ea ldi r25, 0xA7 ; 167 35916: cb cf rjmp .-106 ; 0x358ae 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(); 35918: 0f 94 cf ab call 0x3579e ; 0x3579e ResumeUnpark(); // We can now travel back to the tower or wherever we were when we saved. 3591c: 0f 94 ed 69 call 0x2d3da ; 0x2d3da if (!TuneMenuEntered()) { 35920: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.496> 35924: 81 11 cpse r24, r1 35926: 07 c0 rjmp .+14 ; 0x35936 retryAttempts--; } } void ProtocolLogic::ResetRetryAttempts() { SERIAL_ECHOLNPGM("ResetRetryAttempts"); 35928: 8b eb ldi r24, 0xBB ; 187 3592a: 97 ea ldi r25, 0xA7 ; 167 3592c: 0e 94 93 79 call 0xf326 ; 0xf326 retryAttempts = MAX_RETRIES; 35930: 83 e0 ldi r24, 0x03 ; 3 35932: 80 93 9e 13 sts 0x139E, r24 ; 0x80139e bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 35936: 0f 94 a3 42 call 0x28546 ; 0x28546 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; 3593a: 81 e0 ldi r24, 0x01 ; 1 case Processing: // wait for the MMU to respond default: break; } } } 3593c: 0f 90 pop r0 3593e: 0f 90 pop r0 35940: 0f 90 pop r0 35942: 0f 90 pop r0 35944: 0f 90 pop r0 35946: df 91 pop r29 35948: cf 91 pop r28 3594a: 1f 91 pop r17 3594c: 0f 91 pop r16 3594e: 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(); 35950: 0f 94 04 a6 call 0x34c08 ; 0x34c08 35954: f2 cf rjmp .-28 ; 0x3593a break; case CommandError: case CommunicationTimeout: case ProtocolError: case ButtonPushed: if (!logic.InAutoRetry()) { 35956: 80 91 9f 13 lds r24, 0x139F ; 0x80139f 3595a: 81 11 cpse r24, r1 3595c: 97 cf rjmp .-210 ; 0x3588c // Don't proceed to the park/save if we are doing an autoretry. SaveAndPark(move_axes); 3595e: 81 2f mov r24, r17 35960: 0f 94 39 6a call 0x2d472 ; 0x2d472 SaveHotendTemp(turn_off_nozzle); 35964: 80 2f mov r24, r16 35966: 0f 94 d1 69 call 0x2d3a2 ; 0x2d3a2 CheckUserInput(); 3596a: 0f 94 04 a6 call 0x34c08 ; 0x34c08 3596e: 8e cf rjmp .-228 ; 0x3588c } 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(); 35970: 0f 94 cf ab call 0x3579e ; 0x3579e ResumeUnpark(); 35974: 0f 94 ed 69 call 0x2d3da ; 0x2d3da 35978: 89 cf rjmp .-238 ; 0x3588c } planner_synchronize(); return true; case Interrupted: // now what :D ... big bad ... ramming, unload, retry the whole command originally issued return false; 3597a: 80 e0 ldi r24, 0x00 ; 0 3597c: df cf rjmp .-66 ; 0x3593c 0003597e : } // true, true); -- Comment: how is it possible for a filament type set to fail? return true; } void MMU2::UnloadInner() { 3597e: cf 93 push r28 35980: df 93 push r29 35982: 00 d0 rcall .+0 ; 0x35984 35984: 1f 92 push r1 35986: 1f 92 push r1 35988: cd b7 in r28, 0x3d ; 61 3598a: de b7 in r29, 0x3e ; 62 FSensorBlockRunout blockRunout; 3598c: 0f 94 69 86 call 0x30cd2 ; 0x30cd2 return ss; } void MMU2::filament_ramming() { execute_extruder_sequence(ramming_sequence, sizeof(ramming_sequence) / sizeof(E_Step)); 35990: 62 e1 ldi r22, 0x12 ; 18 35992: 8b e2 ldi r24, 0x2B ; 43 35994: 97 ea ldi r25, 0xA7 ; 167 35996: 0f 94 16 88 call 0x3102c ; 0x3102c 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(); 3599a: 0f 94 6a c5 call 0x38ad4 ; 0x38ad4 void ProtocolLogic::Statistics() { PlanGenericRequest(RequestMsg(RequestMsgCodes::Version, 3)); } void ProtocolLogic::UnloadFilament() { PlanGenericRequest(RequestMsg(RequestMsgCodes::Unload, 0)); 3599e: 40 e0 ldi r20, 0x00 ; 0 359a0: 65 e5 ldi r22, 0x55 ; 85 359a2: ce 01 movw r24, r28 359a4: 01 96 adiw r24, 0x01 ; 1 359a6: 0f 94 48 c5 call 0x38a90 ; 0x38a90 359aa: 49 81 ldd r20, Y+1 ; 0x01 359ac: 5a 81 ldd r21, Y+2 ; 0x02 359ae: 6b 81 ldd r22, Y+3 ; 0x03 359b0: 7c 81 ldd r23, Y+4 ; 0x04 359b2: 8d 81 ldd r24, Y+5 ; 0x05 359b4: 0f 94 0d a5 call 0x34a1a ; 0x34a1a logic.UnloadFilament(); if (manage_response(false, true)) { 359b8: 61 e0 ldi r22, 0x01 ; 1 359ba: 80 e0 ldi r24, 0x00 ; 0 359bc: 0f 94 31 ac call 0x35862 ; 0x35862 359c0: 81 11 cpse r24, r1 359c2: 03 c0 rjmp .+6 ; 0x359ca break; } IncrementMMUFails(); 359c4: 0f 94 a9 c4 call 0x38952 ; 0x38952 359c8: e8 cf rjmp .-48 ; 0x3599a 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); 359ca: 83 e0 ldi r24, 0x03 ; 3 359cc: 0f 94 c2 4d call 0x29b84 ; 0x29b84 } MakeSound(Confirm); // no active tool SetCurrentTool(MMU2_NO_TOOL); 359d0: 83 e6 ldi r24, 0x63 ; 99 359d2: 0f 94 be 87 call 0x30f7c ; 0x30f7c tool_change_extruder = MMU2_NO_TOOL; 359d6: 83 e6 ldi r24, 0x63 ; 99 359d8: 80 93 a1 13 sts 0x13A1, r24 ; 0x8013a1 FSensorBlockRunout::~FSensorBlockRunout() { fsensor.settings_init(); // restore filament runout state. 359dc: 0f 94 ad 7a call 0x2f55a ; 0x2f55a } 359e0: 0f 90 pop r0 359e2: 0f 90 pop r0 359e4: 0f 90 pop r0 359e6: 0f 90 pop r0 359e8: 0f 90 pop r0 359ea: df 91 pop r29 359ec: cf 91 pop r28 359ee: 08 95 ret 000359f0 : bool MMU2::unload() { 359f0: cf 93 push r28 if (!WaitForMMUReady()) { 359f2: 0f 94 3f 88 call 0x3107e ; 0x3107e 359f6: c8 2f mov r28, r24 359f8: 88 23 and r24, r24 359fa: 79 f0 breq .+30 ; 0x35a1a safe_delay_keep_alive(delay); } } void WaitForHotendTargetTempBeep() { waitForHotendTargetTemp(200, [] {}); 359fc: 88 ec ldi r24, 0xC8 ; 200 359fe: 90 e0 ldi r25, 0x00 ; 0 35a00: 0f 94 ee c8 call 0x391dc ; 0x391dc (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.385]> 35a04: 82 e0 ldi r24, 0x02 ; 2 35a06: 0f 94 c2 4d call 0x29b84 ; 0x29b84 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 35a0a: 0f 94 b3 87 call 0x30f66 ; 0x30f66 WaitForHotendTargetTempBeep(); { ReportingRAII rep(CommandInProgress::UnloadFilament); UnloadInner(); 35a0e: 0f 94 bf ac call 0x3597e ; 0x3597e explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 35a12: 0f 94 34 88 call 0x31068 ; 0x31068 { ReportingRAII rep(CommandInProgress::UnloadFilament); UnloadInner(); } ScreenUpdateEnable(); 35a16: 0f 94 87 c4 call 0x3890e ; 0x3890e return true; } 35a1a: 8c 2f mov r24, r28 35a1c: cf 91 pop r28 35a1e: 08 95 ret 00035a20 : unload(); ScreenUpdateEnable(); return true; } bool MMU2::load_filament(uint8_t slot) { 35a20: 0f 93 push r16 35a22: 1f 93 push r17 35a24: cf 93 push r28 35a26: df 93 push r29 35a28: 00 d0 rcall .+0 ; 0x35a2a 35a2a: 1f 92 push r1 35a2c: 1f 92 push r1 35a2e: cd b7 in r28, 0x3d ; 61 35a30: de b7 in r29, 0x3e ; 62 35a32: 08 2f mov r16, r24 if (!WaitForMMUReady()) { 35a34: 0f 94 3f 88 call 0x3107e ; 0x3107e 35a38: 18 2f mov r17, r24 35a3a: 88 23 and r24, r24 35a3c: 49 f1 breq .+82 ; 0x35a90 void FullScreenMsgTest(uint8_t slot){ FullScreenMsg(_T(MSG_TESTING_FILAMENT), slot); } void FullScreenMsgLoad(uint8_t slot){ FullScreenMsg(_T(MSG_LOADING_FILAMENT), slot); 35a3e: 81 e7 ldi r24, 0x71 ; 113 35a40: 9c e5 ldi r25, 0x5C ; 92 35a42: 0e 94 c4 72 call 0xe588 ; 0xe588 35a46: 60 2f mov r22, r16 35a48: 0f 94 8a c4 call 0x38914 ; 0x38914 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 35a4c: 0f 94 b3 87 call 0x30f66 ; 0x30f66 FullScreenMsgLoad(slot); { ReportingRAII rep(CommandInProgress::LoadFilament); for (;;) { Disable_E0(); 35a50: 0f 94 6a c5 call 0x38ad4 ; 0x38ad4 } void ProtocolLogic::LoadFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Load, slot)); 35a54: 40 2f mov r20, r16 35a56: 6c e4 ldi r22, 0x4C ; 76 35a58: ce 01 movw r24, r28 35a5a: 01 96 adiw r24, 0x01 ; 1 35a5c: 0f 94 48 c5 call 0x38a90 ; 0x38a90 35a60: 49 81 ldd r20, Y+1 ; 0x01 35a62: 5a 81 ldd r21, Y+2 ; 0x02 35a64: 6b 81 ldd r22, Y+3 ; 0x03 35a66: 7c 81 ldd r23, Y+4 ; 0x04 35a68: 8d 81 ldd r24, Y+5 ; 0x05 35a6a: 0f 94 0d a5 call 0x34a1a ; 0x34a1a logic.LoadFilament(slot); if (manage_response(false, false)) { 35a6e: 60 e0 ldi r22, 0x00 ; 0 35a70: 80 e0 ldi r24, 0x00 ; 0 35a72: 0f 94 31 ac call 0x35862 ; 0x35862 35a76: 18 2f mov r17, r24 35a78: 81 11 cpse r24, r1 35a7a: 03 c0 rjmp .+6 ; 0x35a82 break; } IncrementMMUFails(); 35a7c: 0f 94 a9 c4 call 0x38952 ; 0x38952 35a80: e7 cf rjmp .-50 ; 0x35a50 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); 35a82: 83 e0 ldi r24, 0x03 ; 3 35a84: 0f 94 c2 4d call 0x29b84 ; 0x29b84 explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 35a88: 0f 94 34 88 call 0x31068 ; 0x31068 } IncrementMMUFails(); } MakeSound(SoundType::Confirm); } ScreenUpdateEnable(); 35a8c: 0f 94 87 c4 call 0x3890e ; 0x3890e return true; } 35a90: 81 2f mov r24, r17 35a92: 0f 90 pop r0 35a94: 0f 90 pop r0 35a96: 0f 90 pop r0 35a98: 0f 90 pop r0 35a9a: 0f 90 pop r0 35a9c: df 91 pop r29 35a9e: cf 91 pop r28 35aa0: 1f 91 pop r17 35aa2: 0f 91 pop r16 35aa4: 08 95 ret 00035aa6 : } ScreenUpdateEnable(); return true; } bool MMU2::eject_filament(uint8_t slot, bool enableFullScreenMsg /* = true */) { 35aa6: ff 92 push r15 35aa8: 0f 93 push r16 35aaa: 1f 93 push r17 35aac: cf 93 push r28 35aae: df 93 push r29 35ab0: 00 d0 rcall .+0 ; 0x35ab2 35ab2: 1f 92 push r1 35ab4: 1f 92 push r1 35ab6: cd b7 in r28, 0x3d ; 61 35ab8: de b7 in r29, 0x3e ; 62 35aba: 08 2f mov r16, r24 35abc: f6 2e mov r15, r22 if (!WaitForMMUReady()) { 35abe: 0f 94 3f 88 call 0x3107e ; 0x3107e 35ac2: 18 2f mov r17, r24 35ac4: 88 23 and r24, r24 35ac6: b1 f1 breq .+108 ; 0x35b34 return false; } if (enableFullScreenMsg) { 35ac8: ff 20 and r15, r15 35aca: 39 f0 breq .+14 ; 0x35ada void FullScreenMsgCut(uint8_t slot){ FullScreenMsg(_T(MSG_CUT_FILAMENT), slot); } void FullScreenMsgEject(uint8_t slot){ FullScreenMsg(_T(MSG_EJECT_FROM_MMU), slot); 35acc: 80 e6 ldi r24, 0x60 ; 96 35ace: 9c e5 ldi r25, 0x5C ; 92 35ad0: 0e 94 c4 72 call 0xe588 ; 0xe588 35ad4: 60 2f mov r22, r16 35ad6: 0f 94 8a c4 call 0x38914 ; 0x38914 FullScreenMsgEject(slot); } { if (FindaDetectsFilament()) { 35ada: 80 91 8f 13 lds r24, 0x138F ; 0x80138f 35ade: 81 11 cpse r24, r1 unload(); 35ae0: 0f 94 f8 ac call 0x359f0 ; 0x359f0 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 35ae4: 0f 94 b3 87 call 0x30f66 ; 0x30f66 unload(); } ReportingRAII rep(CommandInProgress::EjectFilament); for (;;) { Disable_E0(); 35ae8: 0f 94 6a c5 call 0x38ad4 ; 0x38ad4 } void ProtocolLogic::EjectFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Eject, slot)); 35aec: 40 2f mov r20, r16 35aee: 65 e4 ldi r22, 0x45 ; 69 35af0: ce 01 movw r24, r28 35af2: 01 96 adiw r24, 0x01 ; 1 35af4: 0f 94 48 c5 call 0x38a90 ; 0x38a90 35af8: 49 81 ldd r20, Y+1 ; 0x01 35afa: 5a 81 ldd r21, Y+2 ; 0x02 35afc: 6b 81 ldd r22, Y+3 ; 0x03 35afe: 7c 81 ldd r23, Y+4 ; 0x04 35b00: 8d 81 ldd r24, Y+5 ; 0x05 35b02: 0f 94 0d a5 call 0x34a1a ; 0x34a1a logic.EjectFilament(slot); if (manage_response(false, true)) { 35b06: 61 e0 ldi r22, 0x01 ; 1 35b08: 80 e0 ldi r24, 0x00 ; 0 35b0a: 0f 94 31 ac call 0x35862 ; 0x35862 35b0e: 18 2f mov r17, r24 35b10: 81 11 cpse r24, r1 35b12: 03 c0 rjmp .+6 ; 0x35b1a break; } IncrementMMUFails(); 35b14: 0f 94 a9 c4 call 0x38952 ; 0x38952 35b18: e7 cf rjmp .-50 ; 0x35ae8 } SetCurrentTool(MMU2_NO_TOOL); 35b1a: 83 e6 ldi r24, 0x63 ; 99 35b1c: 0f 94 be 87 call 0x30f7c ; 0x30f7c tool_change_extruder = MMU2_NO_TOOL; 35b20: 83 e6 ldi r24, 0x63 ; 99 35b22: 80 93 a1 13 sts 0x13A1, r24 ; 0x8013a1 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); 35b26: 83 e0 ldi r24, 0x03 ; 3 35b28: 0f 94 c2 4d call 0x29b84 ; 0x29b84 explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 35b2c: 0f 94 34 88 call 0x31068 ; 0x31068 } SetCurrentTool(MMU2_NO_TOOL); tool_change_extruder = MMU2_NO_TOOL; MakeSound(Confirm); } ScreenUpdateEnable(); 35b30: 0f 94 87 c4 call 0x3890e ; 0x3890e return true; } 35b34: 81 2f mov r24, r17 35b36: 0f 90 pop r0 35b38: 0f 90 pop r0 35b3a: 0f 90 pop r0 35b3c: 0f 90 pop r0 35b3e: 0f 90 pop r0 35b40: df 91 pop r29 35b42: cf 91 pop r28 35b44: 1f 91 pop r17 35b46: 0f 91 pop r16 35b48: ff 90 pop r15 35b4a: 08 95 ret 00035b4c : ScreenUpdateEnable(); return true; } void MMU2::CutFilamentInner(uint8_t slot) { 35b4c: 1f 93 push r17 35b4e: cf 93 push r28 35b50: df 93 push r29 35b52: 00 d0 rcall .+0 ; 0x35b54 35b54: 1f 92 push r1 35b56: 1f 92 push r1 35b58: cd b7 in r28, 0x3d ; 61 35b5a: de b7 in r29, 0x3e ; 62 35b5c: 18 2f mov r17, r24 for (;;) { Disable_E0(); 35b5e: 0f 94 6a c5 call 0x38ad4 ; 0x38ad4 } void ProtocolLogic::CutFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Cut, slot)); 35b62: 41 2f mov r20, r17 35b64: 6b e4 ldi r22, 0x4B ; 75 35b66: ce 01 movw r24, r28 35b68: 01 96 adiw r24, 0x01 ; 1 35b6a: 0f 94 48 c5 call 0x38a90 ; 0x38a90 35b6e: 49 81 ldd r20, Y+1 ; 0x01 35b70: 5a 81 ldd r21, Y+2 ; 0x02 35b72: 6b 81 ldd r22, Y+3 ; 0x03 35b74: 7c 81 ldd r23, Y+4 ; 0x04 35b76: 8d 81 ldd r24, Y+5 ; 0x05 35b78: 0f 94 0d a5 call 0x34a1a ; 0x34a1a logic.CutFilament(slot); if (manage_response(false, true)) { 35b7c: 61 e0 ldi r22, 0x01 ; 1 35b7e: 80 e0 ldi r24, 0x00 ; 0 35b80: 0f 94 31 ac call 0x35862 ; 0x35862 35b84: 81 11 cpse r24, r1 35b86: 03 c0 rjmp .+6 ; 0x35b8e break; } IncrementMMUFails(); 35b88: 0f 94 a9 c4 call 0x38952 ; 0x38952 35b8c: e8 cf rjmp .-48 ; 0x35b5e } } 35b8e: 0f 90 pop r0 35b90: 0f 90 pop r0 35b92: 0f 90 pop r0 35b94: 0f 90 pop r0 35b96: 0f 90 pop r0 35b98: df 91 pop r29 35b9a: cf 91 pop r28 35b9c: 1f 91 pop r17 35b9e: 08 95 ret 00035ba0 : bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) { 35ba0: cf 93 push r28 35ba2: c8 2f mov r28, r24 lcd_print(' '); lcd_print(slot + 1); } void FullScreenMsgCut(uint8_t slot){ FullScreenMsg(_T(MSG_CUT_FILAMENT), slot); 35ba4: 81 e5 ldi r24, 0x51 ; 81 35ba6: 9c e5 ldi r25, 0x5C ; 92 35ba8: 0e 94 c4 72 call 0xe588 ; 0xe588 35bac: 6c 2f mov r22, r28 35bae: 0f 94 8a c4 call 0x38914 ; 0x38914 if (enableFullScreenMsg) { FullScreenMsgCut(slot); } { if (FindaDetectsFilament()) { 35bb2: 80 91 8f 13 lds r24, 0x138F ; 0x80138f 35bb6: 81 11 cpse r24, r1 unload(); 35bb8: 0f 94 f8 ac call 0x359f0 ; 0x359f0 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 35bbc: 0f 94 b3 87 call 0x30f66 ; 0x30f66 if (FindaDetectsFilament()) { unload(); } ReportingRAII rep(CommandInProgress::CutFilament); CutFilamentInner(slot); 35bc0: 8c 2f mov r24, r28 35bc2: 0f 94 a6 ad call 0x35b4c ; 0x35b4c SetCurrentTool(MMU2_NO_TOOL); 35bc6: 83 e6 ldi r24, 0x63 ; 99 35bc8: 0f 94 be 87 call 0x30f7c ; 0x30f7c tool_change_extruder = MMU2_NO_TOOL; 35bcc: 83 e6 ldi r24, 0x63 ; 99 35bce: 80 93 a1 13 sts 0x13A1, r24 ; 0x8013a1 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); 35bd2: 83 e0 ldi r24, 0x03 ; 3 35bd4: 0f 94 c2 4d call 0x29b84 ; 0x29b84 explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 35bd8: 0f 94 34 88 call 0x31068 ; 0x31068 CutFilamentInner(slot); SetCurrentTool(MMU2_NO_TOOL); tool_change_extruder = MMU2_NO_TOOL; MakeSound(SoundType::Confirm); } ScreenUpdateEnable(); 35bdc: 0f 94 87 c4 call 0x3890e ; 0x3890e return true; } 35be0: 81 e0 ldi r24, 0x01 ; 1 35be2: cf 91 pop r28 35be4: 08 95 ret 00035be6 : ch = UDR0; return ch; } static void putch(char ch) { while (!(UCSR0A & _BV(UDRE0))); 35be6: 90 91 c0 00 lds r25, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> 35bea: 95 ff sbrs r25, 5 35bec: fc cf rjmp .-8 ; 0x35be6 UDR0 = ch; 35bee: 80 93 c6 00 sts 0x00C6, r24 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> } 35bf2: 08 95 ret 00035bf4 : #define RECV_READY ((UCSR0A & _BV(RXC0)) != 0) static uint8_t getch(void) { uint8_t ch; while(! RECV_READY) ; 35bf4: 80 91 c0 00 lds r24, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> 35bf8: 87 ff sbrs r24, 7 35bfa: fc cf rjmp .-8 ; 0x35bf4 if (!(UCSR0A & _BV(FE0))) { 35bfc: 80 91 c0 00 lds r24, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> 35c00: 84 fd sbrc r24, 4 35c02: 01 c0 rjmp .+2 ; 0x35c06 * expects to be talking to the application, and DON'T reset the * watchdog. This should cause the bootloader to abort and run * the application "soon", if it keeps happening. (Note that we * don't care that an invalid char is returned...) */ wdt_reset(); 35c04: a8 95 wdr } ch = UDR0; 35c06: 80 91 c6 00 lds r24, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> return ch; } 35c0a: 08 95 ret 00035c0c : /// 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; 35c0c: 86 27 eor r24, r22 35c0e: 98 e0 ldi r25, 0x08 ; 8 for (uint8_t i = 0; i < 8; i++) { if ((data & 0x80U) != 0) { data <<= 1U; data ^= 0x07U; 35c10: 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) { 35c12: 38 2f mov r19, r24 35c14: 88 0f add r24, r24 35c16: 37 fd sbrc r19, 7 data <<= 1U; data ^= 0x07U; 35c18: 82 27 eor r24, r18 35c1a: 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++) { 35c1c: d1 f7 brne .-12 ; 0x35c12 } else { data <<= 1U; } } return data; } 35c1e: 08 95 ret 00035c20 : // 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) { 35c20: 2f 92 push r2 35c22: 3f 92 push r3 35c24: 4f 92 push r4 35c26: 5f 92 push r5 35c28: 6f 92 push r6 35c2a: 7f 92 push r7 35c2c: 8f 92 push r8 35c2e: 9f 92 push r9 35c30: af 92 push r10 35c32: bf 92 push r11 35c34: cf 92 push r12 35c36: df 92 push r13 35c38: ef 92 push r14 35c3a: ff 92 push r15 35c3c: 0f 93 push r16 35c3e: 1f 93 push r17 35c40: cf 93 push r28 35c42: df 93 push r29 35c44: cd b7 in r28, 0x3d ; 61 35c46: de b7 in r29, 0x3e ; 62 35c48: a1 97 sbiw r28, 0x21 ; 33 35c4a: 0f b6 in r0, 0x3f ; 63 35c4c: f8 94 cli 35c4e: de bf out 0x3e, r29 ; 62 35c50: 0f be out 0x3f, r0 ; 63 35c52: cd bf out 0x3d, r28 ; 61 35c54: 1c 01 movw r2, r24 35c56: 48 01 movw r8, r16 35c58: 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) 35c5a: fc 01 movw r30, r24 35c5c: e8 5b subi r30, 0xB8 ; 184 35c5e: ff 4f sbci r31, 0xFF ; 255 35c60: c0 80 ld r12, Z 35c62: d1 80 ldd r13, Z+1 ; 0x01 35c64: e2 80 ldd r14, Z+2 ; 0x02 35c66: f3 80 ldd r15, Z+3 ; 0x03 35c68: 9a 01 movw r18, r20 35c6a: ab 01 movw r20, r22 35c6c: c7 01 movw r24, r14 35c6e: b6 01 movw r22, r12 35c70: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 35c74: 0f 94 dd dd call 0x3bbba ; 0x3bbba 35c78: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 35c7c: 8b 01 movw r16, r22 35c7e: 8d 83 std Y+5, r24 ; 0x05 35c80: 99 83 std Y+1, r25 ; 0x01 uint32_t final_rate = ceil(exit_speed * block->speed_factor); // (step/min) 35c82: a5 01 movw r20, r10 35c84: 94 01 movw r18, r8 35c86: c7 01 movw r24, r14 35c88: b6 01 movw r22, r12 35c8a: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 35c8e: 0f 94 dd dd call 0x3bbba ; 0x3bbba 35c92: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 35c96: 36 2f mov r19, r22 35c98: 27 2f mov r18, r23 35c9a: a8 01 movw r20, r16 35c9c: 6d 81 ldd r22, Y+5 ; 0x05 35c9e: 79 81 ldd r23, Y+1 ; 0x01 35ca0: 48 37 cpi r20, 0x78 ; 120 35ca2: 51 05 cpc r21, r1 35ca4: 61 05 cpc r22, r1 35ca6: 71 05 cpc r23, r1 35ca8: 20 f4 brcc .+8 ; 0x35cb2 35caa: 48 e7 ldi r20, 0x78 ; 120 35cac: 50 e0 ldi r21, 0x00 ; 0 35cae: 60 e0 ldi r22, 0x00 ; 0 35cb0: 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) 35cb2: d1 01 movw r26, r2 35cb4: d6 96 adiw r26, 0x36 ; 54 35cb6: 8d 90 ld r8, X+ 35cb8: 9d 90 ld r9, X+ 35cba: ad 90 ld r10, X+ 35cbc: bc 90 ld r11, X 35cbe: d9 97 sbiw r26, 0x39 ; 57 35cc0: 8f 8a std Y+23, r8 ; 0x17 35cc2: 98 8e std Y+24, r9 ; 0x18 35cc4: a9 8e std Y+25, r10 ; 0x19 35cc6: ba 8e std Y+26, r11 ; 0x1a 35cc8: 48 15 cp r20, r8 35cca: 59 05 cpc r21, r9 35ccc: 6a 05 cpc r22, r10 35cce: 7b 05 cpc r23, r11 35cd0: 20 f4 brcc .+8 ; 0x35cda 35cd2: 4f 8b std Y+23, r20 ; 0x17 35cd4: 58 8f std Y+24, r21 ; 0x18 35cd6: 69 8f std Y+25, r22 ; 0x19 35cd8: 7a 8f std Y+26, r23 ; 0x1a 35cda: 43 2f mov r20, r19 35cdc: 52 2f mov r21, r18 35cde: bc 01 movw r22, r24 35ce0: 48 37 cpi r20, 0x78 ; 120 35ce2: 51 05 cpc r21, r1 35ce4: 61 05 cpc r22, r1 35ce6: 71 05 cpc r23, r1 35ce8: 20 f4 brcc .+8 ; 0x35cf2 35cea: 48 e7 ldi r20, 0x78 ; 120 35cec: 50 e0 ldi r21, 0x00 ; 0 35cee: 60 e0 ldi r22, 0x00 ; 0 35cf0: 70 e0 ldi r23, 0x00 ; 0 35cf2: 18 2d mov r17, r8 35cf4: 09 2d mov r16, r9 35cf6: a9 a2 std Y+33, r10 ; 0x21 35cf8: b8 a2 std Y+32, r11 ; 0x20 35cfa: 48 15 cp r20, r8 35cfc: 59 05 cpc r21, r9 35cfe: 6a 05 cpc r22, r10 35d00: 7b 05 cpc r23, r11 35d02: 20 f4 brcc .+8 ; 0x35d0c 35d04: 14 2f mov r17, r20 35d06: 05 2f mov r16, r21 35d08: 69 a3 std Y+33, r22 ; 0x21 35d0a: 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; 35d0c: f1 01 movw r30, r2 35d0e: ee 5b subi r30, 0xBE ; 190 35d10: ff 4f sbci r31, 0xFF ; 255 35d12: c0 80 ld r12, Z 35d14: d1 80 ldd r13, Z+1 ; 0x01 35d16: e2 80 ldd r14, Z+2 ; 0x02 35d18: f3 80 ldd r15, Z+3 ; 0x03 35d1a: cd 82 std Y+5, r12 ; 0x05 35d1c: de 82 std Y+6, r13 ; 0x06 35d1e: ef 82 std Y+7, r14 ; 0x07 35d20: f8 86 std Y+8, r15 ; 0x08 if (acceleration == 0) 35d22: cd 28 or r12, r13 35d24: ce 28 or r12, r14 35d26: cf 28 or r12, r15 35d28: 41 f4 brne .+16 ; 0x35d3a // Don't allow zero acceleration. acceleration = 1; 35d2a: c1 2c mov r12, r1 35d2c: d1 2c mov r13, r1 35d2e: 76 01 movw r14, r12 35d30: c3 94 inc r12 35d32: cd 82 std Y+5, r12 ; 0x05 35d34: de 82 std Y+6, r13 ; 0x06 35d36: ef 82 std Y+7, r14 ; 0x07 35d38: 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; 35d3a: 2f 89 ldd r18, Y+23 ; 0x17 35d3c: 38 8d ldd r19, Y+24 ; 0x18 35d3e: 49 8d ldd r20, Y+25 ; 0x19 35d40: 5a 8d ldd r21, Y+26 ; 0x1a 35d42: b9 01 movw r22, r18 35d44: ca 01 movw r24, r20 35d46: 0f 94 3a dc call 0x3b874 ; 0x3b874 <__mulsi3> 35d4a: 6d 87 std Y+13, r22 ; 0x0d 35d4c: 7e 87 std Y+14, r23 ; 0x0e 35d4e: 8f 87 std Y+15, r24 ; 0x0f 35d50: 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; 35d52: a5 01 movw r20, r10 35d54: 94 01 movw r18, r8 35d56: c5 01 movw r24, r10 35d58: b4 01 movw r22, r8 35d5a: 0f 94 3a dc call 0x3b874 ; 0x3b874 <__mulsi3> 35d5e: 2b 01 movw r4, r22 35d60: 3c 01 movw r6, r24 uint32_t final_rate_sqr = final_rate*final_rate; 35d62: 21 2f mov r18, r17 35d64: 30 2f mov r19, r16 35d66: 49 a1 ldd r20, Y+33 ; 0x21 35d68: 58 a1 ldd r21, Y+32 ; 0x20 35d6a: 61 2f mov r22, r17 35d6c: 70 2f mov r23, r16 35d6e: ca 01 movw r24, r20 35d70: 0f 94 3a dc call 0x3b874 ; 0x3b874 <__mulsi3> 35d74: 69 8b std Y+17, r22 ; 0x11 35d76: 7a 8b std Y+18, r23 ; 0x12 35d78: 8b 8b std Y+19, r24 ; 0x13 35d7a: 9c 8b std Y+20, r25 ; 0x14 uint32_t acceleration_x2 = acceleration << 1; 35d7c: cd 80 ldd r12, Y+5 ; 0x05 35d7e: de 80 ldd r13, Y+6 ; 0x06 35d80: ef 80 ldd r14, Y+7 ; 0x07 35d82: f8 84 ldd r15, Y+8 ; 0x08 35d84: cc 0c add r12, r12 35d86: dd 1c adc r13, r13 35d88: ee 1c adc r14, r14 35d8a: ff 1c adc r15, r15 35d8c: c9 86 std Y+9, r12 ; 0x09 35d8e: da 86 std Y+10, r13 ; 0x0a 35d90: eb 86 std Y+11, r14 ; 0x0b 35d92: 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; 35d94: c3 01 movw r24, r6 35d96: b2 01 movw r22, r4 35d98: 61 50 subi r22, 0x01 ; 1 35d9a: 71 09 sbc r23, r1 35d9c: 81 09 sbc r24, r1 35d9e: 91 09 sbc r25, r1 35da0: cd 84 ldd r12, Y+13 ; 0x0d 35da2: de 84 ldd r13, Y+14 ; 0x0e 35da4: ef 84 ldd r14, Y+15 ; 0x0f 35da6: f8 88 ldd r15, Y+16 ; 0x10 35da8: 6c 19 sub r22, r12 35daa: 7d 09 sbc r23, r13 35dac: 8e 09 sbc r24, r14 35dae: 9f 09 sbc r25, r15 35db0: c9 84 ldd r12, Y+9 ; 0x09 35db2: da 84 ldd r13, Y+10 ; 0x0a 35db4: eb 84 ldd r14, Y+11 ; 0x0b 35db6: fc 84 ldd r15, Y+12 ; 0x0c 35db8: 6c 0d add r22, r12 35dba: 7d 1d adc r23, r13 35dbc: 8e 1d adc r24, r14 35dbe: 9f 1d adc r25, r15 35dc0: a7 01 movw r20, r14 35dc2: 96 01 movw r18, r12 35dc4: 0f 94 4a dc call 0x3b894 ; 0x3b894 <__udivmodsi4> 35dc8: 69 01 movw r12, r18 35dca: 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; 35dcc: c3 01 movw r24, r6 35dce: b2 01 movw r22, r4 35dd0: 29 89 ldd r18, Y+17 ; 0x11 35dd2: 3a 89 ldd r19, Y+18 ; 0x12 35dd4: 4b 89 ldd r20, Y+19 ; 0x13 35dd6: 5c 89 ldd r21, Y+20 ; 0x14 35dd8: 62 1b sub r22, r18 35dda: 73 0b sbc r23, r19 35ddc: 84 0b sbc r24, r20 35dde: 95 0b sbc r25, r21 35de0: 29 85 ldd r18, Y+9 ; 0x09 35de2: 3a 85 ldd r19, Y+10 ; 0x0a 35de4: 4b 85 ldd r20, Y+11 ; 0x0b 35de6: 5c 85 ldd r21, Y+12 ; 0x0c 35de8: 0f 94 4a dc call 0x3b894 ; 0x3b894 <__udivmodsi4> 35dec: 29 01 movw r4, r18 35dee: 3a 01 movw r6, r20 uint32_t accel_decel_steps = accelerate_steps + decelerate_steps; 35df0: d7 01 movw r26, r14 35df2: c6 01 movw r24, r12 35df4: 84 0d add r24, r4 35df6: 95 1d adc r25, r5 35df8: a6 1d adc r26, r6 35dfa: b7 1d adc r27, r7 35dfc: 8c 8f std Y+28, r24 ; 0x1c 35dfe: 9d 8f std Y+29, r25 ; 0x1d 35e00: ae 8f std Y+30, r26 ; 0x1e 35e02: 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) { 35e04: f1 01 movw r30, r2 35e06: e4 5b subi r30, 0xB4 ; 180 35e08: ff 4f sbci r31, 0xFF ; 255 35e0a: 90 81 ld r25, Z 35e0c: 9b 8f std Y+27, r25 ; 0x1b 35e0e: 99 23 and r25, r25 35e10: 09 f4 brne .+2 ; 0x35e14 35e12: 8d c0 rjmp .+282 ; 0x35f2e final_adv_steps = final_rate * block->adv_comp; 35e14: 61 2f mov r22, r17 35e16: 70 2f mov r23, r16 35e18: 89 a1 ldd r24, Y+33 ; 0x21 35e1a: 98 a1 ldd r25, Y+32 ; 0x20 35e1c: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 35e20: f1 01 movw r30, r2 35e22: ec 5a subi r30, 0xAC ; 172 35e24: ff 4f sbci r31, 0xFF ; 255 35e26: 20 81 ld r18, Z 35e28: 31 81 ldd r19, Z+1 ; 0x01 35e2a: 42 81 ldd r20, Z+2 ; 0x02 35e2c: 53 81 ldd r21, Z+3 ; 0x03 35e2e: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 35e32: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 35e36: 6d 8b std Y+21, r22 ; 0x15 35e38: 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) { 35e3a: d1 01 movw r26, r2 35e3c: 50 96 adiw r26, 0x10 ; 16 35e3e: 2d 91 ld r18, X+ 35e40: 3d 91 ld r19, X+ 35e42: 4d 91 ld r20, X+ 35e44: 5c 91 ld r21, X 35e46: 53 97 sbiw r26, 0x13 ; 19 35e48: 29 83 std Y+1, r18 ; 0x01 35e4a: 3a 83 std Y+2, r19 ; 0x02 35e4c: 4b 83 std Y+3, r20 ; 0x03 35e4e: 5c 83 std Y+4, r21 ; 0x04 35e50: 8c 8d ldd r24, Y+28 ; 0x1c 35e52: 9d 8d ldd r25, Y+29 ; 0x1d 35e54: ae 8d ldd r26, Y+30 ; 0x1e 35e56: bf 8d ldd r27, Y+31 ; 0x1f 35e58: 82 17 cp r24, r18 35e5a: 93 07 cpc r25, r19 35e5c: a4 07 cpc r26, r20 35e5e: b5 07 cpc r27, r21 35e60: 08 f0 brcs .+2 ; 0x35e64 35e62: 68 c0 rjmp .+208 ; 0x35f34 plateau_steps = block->step_event_count.wide - accel_decel_steps; 35e64: 29 01 movw r4, r18 35e66: 3a 01 movw r6, r20 35e68: 48 1a sub r4, r24 35e6a: 59 0a sbc r5, r25 35e6c: 6a 0a sbc r6, r26 35e6e: 7b 0a sbc r7, r27 #ifdef LIN_ADVANCE if (block->use_advance_lead) 35e70: 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; 35e72: 40 e0 ldi r20, 0x00 ; 0 35e74: 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) 35e76: 99 23 and r25, r25 35e78: 89 f0 breq .+34 ; 0x35e9c max_adv_steps = block->nominal_rate * block->adv_comp; 35e7a: c5 01 movw r24, r10 35e7c: b4 01 movw r22, r8 35e7e: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 35e82: f1 01 movw r30, r2 35e84: ec 5a subi r30, 0xAC ; 172 35e86: ff 4f sbci r31, 0xFF ; 255 35e88: 20 81 ld r18, Z 35e8a: 31 81 ldd r19, Z+1 ; 0x01 35e8c: 42 81 ldd r20, Z+2 ; 0x02 35e8e: 53 81 ldd r21, Z+3 ; 0x03 35e90: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 35e94: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 35e98: 46 2f mov r20, r22 35e9a: 87 2f mov r24, r23 } } #endif } CRITICAL_SECTION_START; // Fill variables used by the stepper in a critical section 35e9c: 3f b7 in r19, 0x3f ; 63 35e9e: 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. 35ea0: f1 01 movw r30, r2 35ea2: e9 5b subi r30, 0xB9 ; 185 35ea4: ff 4f sbci r31, 0xFF ; 255 35ea6: 20 81 ld r18, Z 35ea8: 21 11 cpse r18, r1 35eaa: 27 c0 rjmp .+78 ; 0x35efa block->accelerate_until = accelerate_steps; 35eac: d1 01 movw r26, r2 35eae: 59 96 adiw r26, 0x19 ; 25 35eb0: cd 92 st X+, r12 35eb2: dd 92 st X+, r13 35eb4: ed 92 st X+, r14 35eb6: fc 92 st X, r15 35eb8: 5c 97 sbiw r26, 0x1c ; 28 block->decelerate_after = accelerate_steps+plateau_steps; 35eba: c4 0c add r12, r4 35ebc: d5 1c adc r13, r5 35ebe: e6 1c adc r14, r6 35ec0: f7 1c adc r15, r7 35ec2: f1 01 movw r30, r2 35ec4: c5 8e std Z+29, r12 ; 0x1d 35ec6: d6 8e std Z+30, r13 ; 0x1e 35ec8: e7 8e std Z+31, r14 ; 0x1f 35eca: f0 a2 std Z+32, r15 ; 0x20 block->initial_rate = initial_rate; 35ecc: cf 88 ldd r12, Y+23 ; 0x17 35ece: c2 ae std Z+58, r12 ; 0x3a 35ed0: d8 8c ldd r13, Y+24 ; 0x18 35ed2: d3 ae std Z+59, r13 ; 0x3b 35ed4: e9 8c ldd r14, Y+25 ; 0x19 35ed6: e4 ae std Z+60, r14 ; 0x3c 35ed8: fa 8c ldd r15, Y+26 ; 0x1a 35eda: f5 ae std Z+61, r15 ; 0x3d block->final_rate = final_rate; 35edc: fe 96 adiw r30, 0x3e ; 62 35ede: 10 83 st Z, r17 35ee0: 01 83 std Z+1, r16 ; 0x01 35ee2: c9 a0 ldd r12, Y+33 ; 0x21 35ee4: c2 82 std Z+2, r12 ; 0x02 35ee6: d8 a0 ldd r13, Y+32 ; 0x20 35ee8: d3 82 std Z+3, r13 ; 0x03 #ifdef LIN_ADVANCE block->final_adv_steps = final_adv_steps; 35eea: 73 96 adiw r30, 0x13 ; 19 35eec: ed 88 ldd r14, Y+21 ; 0x15 35eee: e0 82 st Z, r14 35ef0: fe 88 ldd r15, Y+22 ; 0x16 35ef2: f1 82 std Z+1, r15 ; 0x01 block->max_adv_steps = max_adv_steps; 35ef4: 32 97 sbiw r30, 0x02 ; 2 35ef6: 40 83 st Z, r20 35ef8: 81 83 std Z+1, r24 ; 0x01 #endif } CRITICAL_SECTION_END; 35efa: 3f bf out 0x3f, r19 ; 63 } 35efc: a1 96 adiw r28, 0x21 ; 33 35efe: 0f b6 in r0, 0x3f ; 63 35f00: f8 94 cli 35f02: de bf out 0x3e, r29 ; 62 35f04: 0f be out 0x3f, r0 ; 63 35f06: cd bf out 0x3d, r28 ; 61 35f08: df 91 pop r29 35f0a: cf 91 pop r28 35f0c: 1f 91 pop r17 35f0e: 0f 91 pop r16 35f10: ff 90 pop r15 35f12: ef 90 pop r14 35f14: df 90 pop r13 35f16: cf 90 pop r12 35f18: bf 90 pop r11 35f1a: af 90 pop r10 35f1c: 9f 90 pop r9 35f1e: 8f 90 pop r8 35f20: 7f 90 pop r7 35f22: 6f 90 pop r6 35f24: 5f 90 pop r5 35f26: 4f 90 pop r4 35f28: 3f 90 pop r3 35f2a: 2f 90 pop r2 35f2c: 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; 35f2e: 1d 8a std Y+21, r1 ; 0x15 35f30: 1e 8a std Y+22, r1 ; 0x16 35f32: 83 cf rjmp .-250 ; 0x35e3a #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; 35f34: 2d 81 ldd r18, Y+5 ; 0x05 35f36: 3e 81 ldd r19, Y+6 ; 0x06 35f38: 4f 81 ldd r20, Y+7 ; 0x07 35f3a: 58 85 ldd r21, Y+8 ; 0x08 35f3c: 82 e0 ldi r24, 0x02 ; 2 35f3e: 22 0f add r18, r18 35f40: 33 1f adc r19, r19 35f42: 44 1f adc r20, r20 35f44: 55 1f adc r21, r21 35f46: 8a 95 dec r24 35f48: d1 f7 brne .-12 ; 0x35f3e 35f4a: 89 81 ldd r24, Y+1 ; 0x01 35f4c: 9a 81 ldd r25, Y+2 ; 0x02 35f4e: ab 81 ldd r26, Y+3 ; 0x03 35f50: bc 81 ldd r27, Y+4 ; 0x04 35f52: 81 70 andi r24, 0x01 ; 1 35f54: 99 27 eor r25, r25 35f56: aa 27 eor r26, r26 35f58: bb 27 eor r27, r27 35f5a: 8d 83 std Y+5, r24 ; 0x05 35f5c: 9e 83 std Y+6, r25 ; 0x06 35f5e: af 83 std Y+7, r26 ; 0x07 35f60: b8 87 std Y+8, r27 ; 0x08 35f62: 89 80 ldd r8, Y+1 ; 0x01 35f64: 9a 80 ldd r9, Y+2 ; 0x02 35f66: ab 80 ldd r10, Y+3 ; 0x03 35f68: bc 80 ldd r11, Y+4 ; 0x04 35f6a: b6 94 lsr r11 35f6c: a7 94 ror r10 35f6e: 97 94 ror r9 35f70: 87 94 ror r8 // Avoid negative numbers if (final_rate_sqr >= initial_rate_sqr) { 35f72: cd 84 ldd r12, Y+13 ; 0x0d 35f74: de 84 ldd r13, Y+14 ; 0x0e 35f76: ef 84 ldd r14, Y+15 ; 0x0f 35f78: f8 88 ldd r15, Y+16 ; 0x10 35f7a: 89 89 ldd r24, Y+17 ; 0x11 35f7c: 9a 89 ldd r25, Y+18 ; 0x12 35f7e: ab 89 ldd r26, Y+19 ; 0x13 35f80: bc 89 ldd r27, Y+20 ; 0x14 35f82: 8c 15 cp r24, r12 35f84: 9d 05 cpc r25, r13 35f86: ae 05 cpc r26, r14 35f88: bf 05 cpc r27, r15 35f8a: 08 f4 brcc .+2 ; 0x35f8e 35f8c: 6f c0 rjmp .+222 ; 0x3606c // 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; 35f8e: 6c 01 movw r12, r24 35f90: 7d 01 movw r14, r26 35f92: 91 e0 ldi r25, 0x01 ; 1 35f94: c9 1a sub r12, r25 35f96: d1 08 sbc r13, r1 35f98: e1 08 sbc r14, r1 35f9a: f1 08 sbc r15, r1 35f9c: 8d 85 ldd r24, Y+13 ; 0x0d 35f9e: 9e 85 ldd r25, Y+14 ; 0x0e 35fa0: af 85 ldd r26, Y+15 ; 0x0f 35fa2: b8 89 ldd r27, Y+16 ; 0x10 35fa4: c8 1a sub r12, r24 35fa6: d9 0a sbc r13, r25 35fa8: ea 0a sbc r14, r26 35faa: fb 0a sbc r15, r27 35fac: c7 01 movw r24, r14 35fae: b6 01 movw r22, r12 35fb0: 62 0f add r22, r18 35fb2: 73 1f adc r23, r19 35fb4: 84 1f adc r24, r20 35fb6: 95 1f adc r25, r21 if (block->step_event_count.wide & 1) 35fb8: cd 80 ldd r12, Y+5 ; 0x05 35fba: de 80 ldd r13, Y+6 ; 0x06 35fbc: ef 80 ldd r14, Y+7 ; 0x07 35fbe: f8 84 ldd r15, Y+8 ; 0x08 35fc0: cd 28 or r12, r13 35fc2: ce 28 or r12, r14 35fc4: cf 28 or r12, r15 35fc6: 41 f0 breq .+16 ; 0x35fd8 accelerate_steps += acceleration_x2; 35fc8: c9 84 ldd r12, Y+9 ; 0x09 35fca: da 84 ldd r13, Y+10 ; 0x0a 35fcc: eb 84 ldd r14, Y+11 ; 0x0b 35fce: fc 84 ldd r15, Y+12 ; 0x0c 35fd0: 6c 0d add r22, r12 35fd2: 7d 1d adc r23, r13 35fd4: 8e 1d adc r24, r14 35fd6: 9f 1d adc r25, r15 accelerate_steps /= acceleration_x4; 35fd8: 0f 94 4a dc call 0x3b894 ; 0x3b894 <__udivmodsi4> 35fdc: 75 01 movw r14, r10 35fde: 64 01 movw r12, r8 35fe0: c2 0e add r12, r18 35fe2: d3 1e adc r13, r19 35fe4: e4 1e adc r14, r20 35fe6: f5 1e adc r15, r21 35fe8: 29 81 ldd r18, Y+1 ; 0x01 35fea: 3a 81 ldd r19, Y+2 ; 0x02 35fec: 4b 81 ldd r20, Y+3 ; 0x03 35fee: 5c 81 ldd r21, Y+4 ; 0x04 35ff0: 2c 15 cp r18, r12 35ff2: 3d 05 cpc r19, r13 35ff4: 4e 05 cpc r20, r14 35ff6: 5f 05 cpc r21, r15 35ff8: 10 f4 brcc .+4 ; 0x35ffe 35ffa: 69 01 movw r12, r18 35ffc: 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) { 35ffe: 2b 8d ldd r18, Y+27 ; 0x1b 36000: 22 23 and r18, r18 36002: 09 f4 brne .+2 ; 0x36006 36004: 69 c0 rjmp .+210 ; 0x360d8 if(!accelerate_steps || !decelerate_steps) { 36006: c1 14 cp r12, r1 36008: d1 04 cpc r13, r1 3600a: e1 04 cpc r14, r1 3600c: f1 04 cpc r15, r1 3600e: 09 f4 brne .+2 ; 0x36012 36010: 66 c0 rjmp .+204 ; 0x360de // 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; 36012: 4d 89 ldd r20, Y+21 ; 0x15 36014: 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) { 36016: 41 14 cp r4, r1 36018: 51 04 cpc r5, r1 3601a: 61 04 cpc r6, r1 3601c: 71 04 cpc r7, r1 3601e: 09 f4 brne .+2 ; 0x36022 36020: 3d cf rjmp .-390 ; 0x35e9c // 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); 36022: a7 01 movw r20, r14 36024: 96 01 movw r18, r12 36026: 69 85 ldd r22, Y+9 ; 0x09 36028: 7a 85 ldd r23, Y+10 ; 0x0a 3602a: 8b 85 ldd r24, Y+11 ; 0x0b 3602c: 9c 85 ldd r25, Y+12 ; 0x0c 3602e: 0f 94 3a dc call 0x3b874 ; 0x3b874 <__mulsi3> 36032: 2d 85 ldd r18, Y+13 ; 0x0d 36034: 3e 85 ldd r19, Y+14 ; 0x0e 36036: 4f 85 ldd r20, Y+15 ; 0x0f 36038: 58 89 ldd r21, Y+16 ; 0x10 3603a: 62 0f add r22, r18 3603c: 73 1f adc r23, r19 3603e: 84 1f adc r24, r20 36040: 95 1f adc r25, r21 36042: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 36046: 0f 94 cd e0 call 0x3c19a ; 0x3c19a max_adv_steps = max_rate * block->adv_comp; 3604a: f1 01 movw r30, r2 3604c: ec 5a subi r30, 0xAC ; 172 3604e: ff 4f sbci r31, 0xFF ; 255 36050: 20 81 ld r18, Z 36052: 31 81 ldd r19, Z+1 ; 0x01 36054: 42 81 ldd r20, Z+2 ; 0x02 36056: 53 81 ldd r21, Z+3 ; 0x03 36058: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 3605c: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 36060: 46 2f mov r20, r22 36062: 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; 36064: 41 2c mov r4, r1 36066: 51 2c mov r5, r1 36068: 32 01 movw r6, r4 3606a: 18 cf rjmp .-464 ; 0x35e9c 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; 3606c: 6d 85 ldd r22, Y+13 ; 0x0d 3606e: 7e 85 ldd r23, Y+14 ; 0x0e 36070: 8f 85 ldd r24, Y+15 ; 0x0f 36072: 98 89 ldd r25, Y+16 ; 0x10 36074: c9 88 ldd r12, Y+17 ; 0x11 36076: da 88 ldd r13, Y+18 ; 0x12 36078: eb 88 ldd r14, Y+19 ; 0x13 3607a: fc 88 ldd r15, Y+20 ; 0x14 3607c: 6c 19 sub r22, r12 3607e: 7d 09 sbc r23, r13 36080: 8e 09 sbc r24, r14 36082: 9f 09 sbc r25, r15 if (block->step_event_count.wide & 1) 36084: cd 80 ldd r12, Y+5 ; 0x05 36086: de 80 ldd r13, Y+6 ; 0x06 36088: ef 80 ldd r14, Y+7 ; 0x07 3608a: f8 84 ldd r15, Y+8 ; 0x08 3608c: cd 28 or r12, r13 3608e: ce 28 or r12, r14 36090: cf 28 or r12, r15 36092: 41 f0 breq .+16 ; 0x360a4 decelerate_steps += acceleration_x2; 36094: c9 84 ldd r12, Y+9 ; 0x09 36096: da 84 ldd r13, Y+10 ; 0x0a 36098: eb 84 ldd r14, Y+11 ; 0x0b 3609a: fc 84 ldd r15, Y+12 ; 0x0c 3609c: 6c 0d add r22, r12 3609e: 7d 1d adc r23, r13 360a0: 8e 1d adc r24, r14 360a2: 9f 1d adc r25, r15 decelerate_steps /= acceleration_x4; 360a4: 0f 94 4a dc call 0x3b894 ; 0x3b894 <__udivmodsi4> decelerate_steps += (block->step_event_count.wide >> 1); 360a8: 82 0e add r8, r18 360aa: 93 1e adc r9, r19 360ac: a4 1e adc r10, r20 360ae: b5 1e adc r11, r21 360b0: 49 80 ldd r4, Y+1 ; 0x01 360b2: 5a 80 ldd r5, Y+2 ; 0x02 360b4: 6b 80 ldd r6, Y+3 ; 0x03 360b6: 7c 80 ldd r7, Y+4 ; 0x04 360b8: 84 14 cp r8, r4 360ba: 95 04 cpc r9, r5 360bc: a6 04 cpc r10, r6 360be: b7 04 cpc r11, r7 360c0: 10 f4 brcc .+4 ; 0x360c6 360c2: 24 01 movw r4, r8 360c4: 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; 360c6: c9 80 ldd r12, Y+1 ; 0x01 360c8: da 80 ldd r13, Y+2 ; 0x02 360ca: eb 80 ldd r14, Y+3 ; 0x03 360cc: fc 80 ldd r15, Y+4 ; 0x04 360ce: c4 18 sub r12, r4 360d0: d5 08 sbc r13, r5 360d2: e6 08 sbc r14, r6 360d4: f7 08 sbc r15, r7 360d6: 93 cf rjmp .-218 ; 0x35ffe // 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; 360d8: 40 e0 ldi r20, 0x00 ; 0 360da: 80 e0 ldi r24, 0x00 ; 0 360dc: c3 cf rjmp .-122 ; 0x36064 #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; 360de: 4d 89 ldd r20, Y+21 ; 0x15 360e0: 8e 89 ldd r24, Y+22 ; 0x16 360e2: c0 cf rjmp .-128 ; 0x36064 000360e4 : while (!(UCSR0A & _BV(UDRE0))); UDR0 = ch; } static void verifySpace() { if (getch() != CRC_EOP) { 360e4: 0f 94 fa ad call 0x35bf4 ; 0x35bf4 360e8: 80 32 cpi r24, 0x20 ; 32 360ea: 29 f0 breq .+10 ; 0x360f6 putch(STK_FAILED); 360ec: 81 e1 ldi r24, 0x11 ; 17 360ee: 0f 94 f3 ad call 0x35be6 ; 0x35be6 softReset(); 360f2: 0e 94 64 67 call 0xcec8 ; 0xcec8 } putch(STK_INSYNC); 360f6: 84 e1 ldi r24, 0x14 ; 20 360f8: 0d 94 f3 ad jmp 0x35be6 ; 0x35be6 000360fc : } static void getNch(uint8_t count) { 360fc: cf 93 push r28 360fe: c8 2f mov r28, r24 do getch(); while (--count); 36100: 0f 94 fa ad call 0x35bf4 ; 0x35bf4 36104: c1 50 subi r28, 0x01 ; 1 36106: e1 f7 brne .-8 ; 0x36100 verifySpace(); } 36108: cf 91 pop r28 putch(STK_INSYNC); } static void getNch(uint8_t count) { do getch(); while (--count); verifySpace(); 3610a: 0d 94 72 b0 jmp 0x360e4 ; 0x360e4 0003610e : /// @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) { 3610e: 0f 93 push r16 36110: 1f 93 push r17 36112: cf 93 push r28 36114: df 93 push r29 36116: eb 01 movw r28, r22 36118: 14 2f mov r17, r20 3611a: 05 2f mov r16, r21 lcd_putc(chr); 3611c: 0e 94 e7 6e call 0xddce ; 0xddce lcd_puts_P(str); 36120: ce 01 movw r24, r28 36122: 0e 94 e3 6e call 0xddc6 ; 0xddc6 lcd_putc(':'); 36126: 8a e3 ldi r24, 0x3A ; 58 36128: 0e 94 e7 6e call 0xddce ; 0xddce 3612c: ce 01 movw r24, r28 3612e: 0f 94 95 d9 call 0x3b32a ; 0x3b32a <__strlen_P> // Padding to compensate variable string length const uint8_t len = strlen_P(str); lcd_space((LCD_WIDTH - 4) - (2 + len)); 36132: 9e e0 ldi r25, 0x0E ; 14 36134: 98 1b sub r25, r24 36136: 89 2f mov r24, r25 36138: 0e 94 ee 6e call 0xdddc ; 0xdddc // Right adjusted value lcd_printf_P(PSTR("%4d"), val); 3613c: 0f 93 push r16 3613e: 1f 93 push r17 36140: 8f e0 ldi r24, 0x0F ; 15 36142: 9c ea ldi r25, 0xAC ; 172 36144: 9f 93 push r25 36146: 8f 93 push r24 36148: 0e 94 d1 6e call 0xdda2 ; 0xdda2 3614c: 0f 90 pop r0 3614e: 0f 90 pop r0 36150: 0f 90 pop r0 36152: 0f 90 pop r0 } 36154: df 91 pop r29 36156: cf 91 pop r28 36158: 1f 91 pop r17 3615a: 0f 91 pop r16 3615c: 08 95 ret 0003615e : // 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) { 3615e: 2f 92 push r2 36160: 3f 92 push r3 36162: 4f 92 push r4 36164: 5f 92 push r5 36166: 6f 92 push r6 36168: 7f 92 push r7 3616a: 8f 92 push r8 3616c: 9f 92 push r9 3616e: af 92 push r10 36170: bf 92 push r11 36172: cf 92 push r12 36174: df 92 push r13 36176: ef 92 push r14 36178: ff 92 push r15 3617a: 0f 93 push r16 3617c: 1f 93 push r17 3617e: cf 93 push r28 36180: df 93 push r29 36182: cd b7 in r28, 0x3d ; 61 36184: de b7 in r29, 0x3e ; 62 36186: c5 58 subi r28, 0x85 ; 133 36188: d1 09 sbc r29, r1 3618a: 0f b6 in r0, 0x3f ; 63 3618c: f8 94 cli 3618e: de bf out 0x3e, r29 ; 62 36190: 0f be out 0x3f, r0 ; 63 36192: cd bf out 0x3d, r28 ; 61 36194: 69 a3 std Y+33, r22 ; 0x21 36196: 7a a3 std Y+34, r23 ; 0x22 36198: 8b a3 std Y+35, r24 ; 0x23 3619a: 9c a3 std Y+36, r25 ; 0x24 3619c: 2d a3 std Y+37, r18 ; 0x25 3619e: 3e a3 std Y+38, r19 ; 0x26 361a0: 4f a3 std Y+39, r20 ; 0x27 361a2: 58 a7 std Y+40, r21 ; 0x28 361a4: a8 96 adiw r28, 0x28 ; 40 361a6: ec ae std Y+60, r14 ; 0x3c 361a8: fd ae std Y+61, r15 ; 0x3d 361aa: 0e af std Y+62, r16 ; 0x3e 361ac: 1f af std Y+63, r17 ; 0x3f 361ae: a8 97 sbiw r28, 0x28 ; 40 361b0: aa 96 adiw r28, 0x2a ; 42 361b2: df ae std Y+63, r13 ; 0x3f 361b4: ce ae std Y+62, r12 ; 0x3e 361b6: aa 97 sbiw r28, 0x2a ; 42 361b8: 89 aa std Y+49, r8 ; 0x31 361ba: 99 ae std Y+57, r9 ; 0x39 361bc: ad ae std Y+61, r10 ; 0x3d 361be: bd aa std Y+53, r11 ; 0x35 361c0: c5 56 subi r28, 0x65 ; 101 361c2: df 4f sbci r29, 0xFF ; 255 361c4: 08 81 ld r16, Y 361c6: 19 81 ldd r17, Y+1 ; 0x01 361c8: cb 59 subi r28, 0x9B ; 155 361ca: 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); 361cc: 80 91 a4 0d lds r24, 0x0DA4 ; 0x800da4 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) 361d0: 8f 5f subi r24, 0xFF ; 255 361d2: a1 96 adiw r28, 0x21 ; 33 361d4: 8f af std Y+63, r24 ; 0x3f 361d6: a1 97 sbiw r28, 0x21 ; 33 361d8: 80 31 cpi r24, 0x10 ; 16 361da: 19 f4 brne .+6 ; 0x361e2 block_index = 0; 361dc: a1 96 adiw r28, 0x21 ; 33 361de: 1f ae std Y+63, r1 ; 0x3f 361e0: a1 97 sbiw r28, 0x21 ; 33 // 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) { 361e2: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 361e6: a1 96 adiw r28, 0x21 ; 33 361e8: 2f ad ldd r18, Y+63 ; 0x3f 361ea: a1 97 sbiw r28, 0x21 ; 33 361ec: 82 13 cpse r24, r18 361ee: 0f c0 rjmp .+30 ; 0x3620e do { manage_heater(); 361f0: 0f 94 2e 38 call 0x2705c ; 0x2705c // Vojtech: Don't disable motors inside the planner! manage_inactivity(false); 361f4: 80 e0 ldi r24, 0x00 ; 0 361f6: 0e 94 c7 8a call 0x1158e ; 0x1158e lcd_update(0); 361fa: 80 e0 ldi r24, 0x00 ; 0 361fc: 0e 94 bf 6e call 0xdd7e ; 0xdd7e } while (block_buffer_tail == next_buffer_head); 36200: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 36204: a1 96 adiw r28, 0x21 ; 33 36206: 3f ad ldd r19, Y+63 ; 0x3f 36208: a1 97 sbiw r28, 0x21 ; 33 3620a: 83 17 cp r24, r19 3620c: 89 f3 breq .-30 ; 0x361f0 } #ifdef PLANNER_DIAGNOSTICS planner_update_queue_min_counter(); #endif /* PLANNER_DIAGNOSTICS */ if(planner_aborted) { 3620e: 40 91 ab 0d lds r20, 0x0DAB ; 0x800dab 36212: a2 96 adiw r28, 0x22 ; 34 36214: 4f af std Y+63, r20 ; 0x3f 36216: a2 97 sbiw r28, 0x22 ; 34 36218: 44 23 and r20, r20 3621a: 11 f1 breq .+68 ; 0x36260 // avoid planning the block early if aborted SERIAL_ECHO_START; 3621c: 82 ef ldi r24, 0xF2 ; 242 3621e: 9b ea ldi r25, 0xAB ; 171 36220: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHOLNRPGM(_n("Move aborted")); 36224: 8a e7 ldi r24, 0x7A ; 122 36226: 91 e7 ldi r25, 0x71 ; 113 36228: 0e 94 93 79 call 0xf326 ; 0xf326 // 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(); } 3622c: cb 57 subi r28, 0x7B ; 123 3622e: df 4f sbci r29, 0xFF ; 255 36230: 0f b6 in r0, 0x3f ; 63 36232: f8 94 cli 36234: de bf out 0x3e, r29 ; 62 36236: 0f be out 0x3f, r0 ; 63 36238: cd bf out 0x3d, r28 ; 61 3623a: df 91 pop r29 3623c: cf 91 pop r28 3623e: 1f 91 pop r17 36240: 0f 91 pop r16 36242: ff 90 pop r15 36244: ef 90 pop r14 36246: df 90 pop r13 36248: cf 90 pop r12 3624a: bf 90 pop r11 3624c: af 90 pop r10 3624e: 9f 90 pop r9 36250: 8f 90 pop r8 36252: 7f 90 pop r7 36254: 6f 90 pop r6 36256: 5f 90 pop r5 36258: 4f 90 pop r4 3625a: 3f 90 pop r3 3625c: 2f 90 pop r2 3625e: 08 95 ret SERIAL_ECHOLNRPGM(_n("Move aborted")); return; } // Prepare to set up new block block_t *block = &block_buffer[block_buffer_head]; 36260: 90 91 a4 0d lds r25, 0x0DA4 ; 0x800da4 36264: 29 2e mov r2, r25 36266: 31 2c mov r3, r1 36268: 8e e6 ldi r24, 0x6E ; 110 3626a: 98 9f mul r25, r24 3626c: d0 01 movw r26, r0 3626e: 11 24 eor r1, r1 36270: a4 96 adiw r28, 0x24 ; 36 36272: bf af std Y+63, r27 ; 0x3f 36274: ae af std Y+62, r26 ; 0x3e 36276: a4 97 sbiw r28, 0x24 ; 36 // Mark block as not busy (Not executed by the stepper interrupt, could be still tinkered with.) block->busy = false; 36278: cd 01 movw r24, r26 3627a: 8c 53 subi r24, 0x3C ; 60 3627c: 99 4f sbci r25, 0xF9 ; 249 3627e: fc 01 movw r30, r24 36280: e9 5b subi r30, 0xB9 ; 185 36282: ff 4f sbci r31, 0xFF ; 255 36284: 10 82 st Z, r1 // Set sdlen for calculating sd position block->sdlen = 0; 36286: 84 59 subi r24, 0x94 ; 148 36288: 9f 4f sbci r25, 0xFF ; 255 3628a: fc 01 movw r30, r24 3628c: 11 82 std Z+1, r1 ; 0x01 3628e: 10 82 st Z, r1 // Save original start position of the move if (gcode_start_position) 36290: 01 15 cp r16, r1 36292: 11 05 cpc r17, r1 36294: 11 f4 brne .+4 ; 0x3629a 36296: 0d 94 a3 bb jmp 0x37746 ; 0x37746 memcpy(block->gcode_start_position, gcode_start_position, sizeof(block_t::gcode_start_position)); 3629a: 80 e1 ldi r24, 0x10 ; 16 3629c: f8 01 movw r30, r16 3629e: a4 5e subi r26, 0xE4 ; 228 362a0: b8 4f sbci r27, 0xF8 ; 248 else memcpy(block->gcode_start_position, current_position, sizeof(block_t::gcode_start_position)); 362a2: 01 90 ld r0, Z+ 362a4: 0d 92 st X+, r0 362a6: 8a 95 dec r24 362a8: e1 f7 brne .-8 ; 0x362a2 // Save the index of this segment (when a single G0/1/2/3 command plans multiple segments) block->segment_idx = segment_idx; 362aa: 8e e6 ldi r24, 0x6E ; 110 362ac: 82 9d mul r24, r2 362ae: 80 01 movw r16, r0 362b0: 83 9d mul r24, r3 362b2: 10 0d add r17, r0 362b4: 11 24 eor r1, r1 362b6: 0c 53 subi r16, 0x3C ; 60 362b8: 19 4f sbci r17, 0xF9 ; 249 362ba: f8 01 movw r30, r16 362bc: e8 59 subi r30, 0x98 ; 152 362be: ff 4f sbci r31, 0xFF ; 255 362c0: c3 56 subi r28, 0x63 ; 99 362c2: df 4f sbci r29, 0xFF ; 255 362c4: 88 81 ld r24, Y 362c6: 99 81 ldd r25, Y+1 ; 0x01 362c8: cd 59 subi r28, 0x9D ; 157 362ca: d0 40 sbci r29, 0x00 ; 0 362cc: 91 83 std Z+1, r25 ; 0x01 362ce: 80 83 st Z, r24 // Save the global feedrate at scheduling time block->gcode_feedrate = feedrate; 362d0: 06 59 subi r16, 0x96 ; 150 362d2: 1f 4f sbci r17, 0xFF ; 255 362d4: 60 91 b8 02 lds r22, 0x02B8 ; 0x8002b8 362d8: 70 91 b9 02 lds r23, 0x02B9 ; 0x8002b9 362dc: 80 91 ba 02 lds r24, 0x02BA ; 0x8002ba 362e0: 90 91 bb 02 lds r25, 0x02BB ; 0x8002bb 362e4: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 362e8: d8 01 movw r26, r16 362ea: 6d 93 st X+, r22 362ec: 7c 93 st X, r23 // Reset the starting E position when requested if (plan_reset_next_e_queue) 362ee: 80 91 b7 04 lds r24, 0x04B7 ; 0x8004b7 <_ZL23plan_reset_next_e_queue.lto_priv.486> 362f2: 88 23 and r24, r24 362f4: a9 f0 breq .+42 ; 0x36320 { position[E_AXIS] = 0; 362f6: 10 92 ae 06 sts 0x06AE, r1 ; 0x8006ae 362fa: 10 92 af 06 sts 0x06AF, r1 ; 0x8006af 362fe: 10 92 b0 06 sts 0x06B0, r1 ; 0x8006b0 36302: 10 92 b1 06 sts 0x06B1, r1 ; 0x8006b1 #ifdef LIN_ADVANCE position_float[E_AXIS] = 0; 36306: 10 92 d8 04 sts 0x04D8, r1 ; 0x8004d8 3630a: 10 92 d9 04 sts 0x04D9, r1 ; 0x8004d9 3630e: 10 92 da 04 sts 0x04DA, r1 ; 0x8004da 36312: 10 92 db 04 sts 0x04DB, r1 ; 0x8004db #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; 36316: 10 92 b7 04 sts 0x04B7, r1 ; 0x8004b7 <_ZL23plan_reset_next_e_queue.lto_priv.486> plan_reset_next_e_sched = true; 3631a: 81 e0 ldi r24, 0x01 ; 1 3631c: 80 93 b6 04 sts 0x04B6, r24 ; 0x8004b6 <_ZL23plan_reset_next_e_sched.lto_priv.487> } // Apply the machine correction matrix. world2machine(x, y); 36320: be 01 movw r22, r28 36322: 6b 5d subi r22, 0xDB ; 219 36324: 7f 4f sbci r23, 0xFF ; 255 36326: ce 01 movw r24, r28 36328: 81 96 adiw r24, 0x21 ; 33 3632a: 0e 94 1a 6a call 0xd434 ; 0xd434 // 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]); 3632e: c9 a0 ldd r12, Y+33 ; 0x21 36330: da a0 ldd r13, Y+34 ; 0x22 36332: eb a0 ldd r14, Y+35 ; 0x23 36334: fc a0 ldd r15, Y+36 ; 0x24 36336: 20 91 c1 0d lds r18, 0x0DC1 ; 0x800dc1 3633a: 30 91 c2 0d lds r19, 0x0DC2 ; 0x800dc2 3633e: 40 91 c3 0d lds r20, 0x0DC3 ; 0x800dc3 36342: 50 91 c4 0d lds r21, 0x0DC4 ; 0x800dc4 36346: c7 01 movw r24, r14 36348: b6 01 movw r22, r12 3634a: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 3634e: 0f 94 3c e0 call 0x3c078 ; 0x3c078 36352: c2 58 subi r28, 0x82 ; 130 36354: df 4f sbci r29, 0xFF ; 255 36356: 68 83 st Y, r22 36358: 79 83 std Y+1, r23 ; 0x01 3635a: 8a 83 std Y+2, r24 ; 0x02 3635c: 9b 83 std Y+3, r25 ; 0x03 3635e: ce 57 subi r28, 0x7E ; 126 36360: d0 40 sbci r29, 0x00 ; 0 target[Y_AXIS] = lround(y*cs.axis_steps_per_mm[Y_AXIS]); 36362: 8d a0 ldd r8, Y+37 ; 0x25 36364: 9e a0 ldd r9, Y+38 ; 0x26 36366: af a0 ldd r10, Y+39 ; 0x27 36368: b8 a4 ldd r11, Y+40 ; 0x28 3636a: 20 91 c5 0d lds r18, 0x0DC5 ; 0x800dc5 3636e: 30 91 c6 0d lds r19, 0x0DC6 ; 0x800dc6 36372: 40 91 c7 0d lds r20, 0x0DC7 ; 0x800dc7 36376: 50 91 c8 0d lds r21, 0x0DC8 ; 0x800dc8 3637a: c5 01 movw r24, r10 3637c: b4 01 movw r22, r8 3637e: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 36382: 0f 94 3c e0 call 0x3c078 ; 0x3c078 36386: ce 57 subi r28, 0x7E ; 126 36388: df 4f sbci r29, 0xFF ; 255 3638a: 68 83 st Y, r22 3638c: 79 83 std Y+1, r23 ; 0x01 3638e: 8a 83 std Y+2, r24 ; 0x02 36390: 9b 83 std Y+3, r25 ; 0x03 36392: c2 58 subi r28, 0x82 ; 130 36394: d0 40 sbci r29, 0x00 ; 0 #ifdef MESH_BED_LEVELING if (mbl.active){ 36396: 80 91 c1 13 lds r24, 0x13C1 ; 0x8013c1 3639a: 88 23 and r24, r24 3639c: 11 f4 brne .+4 ; 0x363a2 3639e: 0d 94 aa bb jmp 0x37754 ; 0x37754 target[Z_AXIS] = lround((z+mbl.get_z(x, y))*cs.axis_steps_per_mm[Z_AXIS]); 363a2: a5 01 movw r20, r10 363a4: 94 01 movw r18, r8 363a6: c7 01 movw r24, r14 363a8: b6 01 movw r22, r12 363aa: 0f 94 6c a1 call 0x342d8 ; 0x342d8 363ae: a8 96 adiw r28, 0x28 ; 40 363b0: 2c ad ldd r18, Y+60 ; 0x3c 363b2: 3d ad ldd r19, Y+61 ; 0x3d 363b4: 4e ad ldd r20, Y+62 ; 0x3e 363b6: 5f ad ldd r21, Y+63 ; 0x3f 363b8: a8 97 sbiw r28, 0x28 ; 40 363ba: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 363be: 20 91 c9 0d lds r18, 0x0DC9 ; 0x800dc9 363c2: 30 91 ca 0d lds r19, 0x0DCA ; 0x800dca 363c6: 40 91 cb 0d lds r20, 0x0DCB ; 0x800dcb 363ca: 50 91 cc 0d lds r21, 0x0DCC ; 0x800dcc }else{ target[Z_AXIS] = lround(z*cs.axis_steps_per_mm[Z_AXIS]); 363ce: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 363d2: 0f 94 3c e0 call 0x3c078 ; 0x3c078 363d6: e6 96 adiw r28, 0x36 ; 54 363d8: 6c af std Y+60, r22 ; 0x3c 363da: 7d af std Y+61, r23 ; 0x3d 363dc: 8e af std Y+62, r24 ; 0x3e 363de: 9f af std Y+63, r25 ; 0x3f 363e0: e6 97 sbiw r28, 0x36 ; 54 } #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]); 363e2: aa 96 adiw r28, 0x2a ; 42 363e4: ee ad ldd r30, Y+62 ; 0x3e 363e6: ff ad ldd r31, Y+63 ; 0x3f 363e8: aa 97 sbiw r28, 0x2a ; 42 363ea: 80 80 ld r8, Z 363ec: 91 80 ldd r9, Z+1 ; 0x01 363ee: a2 80 ldd r10, Z+2 ; 0x02 363f0: b3 80 ldd r11, Z+3 ; 0x03 363f2: 20 91 cd 0d lds r18, 0x0DCD ; 0x800dcd 363f6: 30 91 ce 0d lds r19, 0x0DCE ; 0x800dce 363fa: 40 91 cf 0d lds r20, 0x0DCF ; 0x800dcf 363fe: 50 91 d0 0d lds r21, 0x0DD0 ; 0x800dd0 36402: c5 01 movw r24, r10 36404: b4 01 movw r22, r8 36406: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 3640a: 0f 94 3c e0 call 0x3c078 ; 0x3c078 3640e: ae 96 adiw r28, 0x2e ; 46 36410: 6c af std Y+60, r22 ; 0x3c 36412: 7d af std Y+61, r23 ; 0x3d 36414: 8e af std Y+62, r24 ; 0x3e 36416: 9f af std Y+63, r25 ; 0x3f 36418: ae 97 sbiw r28, 0x2e ; 46 // 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]; 3641a: 80 91 ae 06 lds r24, 0x06AE ; 0x8006ae 3641e: 90 91 af 06 lds r25, 0x06AF ; 0x8006af 36422: a0 91 b0 06 lds r26, 0x06B0 ; 0x8006b0 36426: b0 91 b1 06 lds r27, 0x06B1 ; 0x8006b1 3642a: ae 96 adiw r28, 0x2e ; 46 3642c: 4c ac ldd r4, Y+60 ; 0x3c 3642e: 5d ac ldd r5, Y+61 ; 0x3d 36430: 6e ac ldd r6, Y+62 ; 0x3e 36432: 7f ac ldd r7, Y+63 ; 0x3f 36434: ae 97 sbiw r28, 0x2e ; 46 36436: 48 1a sub r4, r24 36438: 59 0a sbc r5, r25 3643a: 6a 0a sbc r6, r26 3643c: 7b 0a sbc r7, r27 int32_t dx = target[X_AXIS] - position[X_AXIS]; 3643e: 80 91 a2 06 lds r24, 0x06A2 ; 0x8006a2 36442: 90 91 a3 06 lds r25, 0x06A3 ; 0x8006a3 36446: a0 91 a4 06 lds r26, 0x06A4 ; 0x8006a4 3644a: b0 91 a5 06 lds r27, 0x06A5 ; 0x8006a5 3644e: c2 58 subi r28, 0x82 ; 130 36450: df 4f sbci r29, 0xFF ; 255 36452: c8 80 ld r12, Y 36454: d9 80 ldd r13, Y+1 ; 0x01 36456: ea 80 ldd r14, Y+2 ; 0x02 36458: fb 80 ldd r15, Y+3 ; 0x03 3645a: ce 57 subi r28, 0x7E ; 126 3645c: d0 40 sbci r29, 0x00 ; 0 3645e: c8 1a sub r12, r24 36460: d9 0a sbc r13, r25 36462: ea 0a sbc r14, r26 36464: fb 0a sbc r15, r27 int32_t dy = target[Y_AXIS] - position[Y_AXIS]; 36466: 80 91 a6 06 lds r24, 0x06A6 ; 0x8006a6 3646a: 90 91 a7 06 lds r25, 0x06A7 ; 0x8006a7 3646e: a0 91 a8 06 lds r26, 0x06A8 ; 0x8006a8 36472: b0 91 a9 06 lds r27, 0x06A9 ; 0x8006a9 36476: ce 57 subi r28, 0x7E ; 126 36478: df 4f sbci r29, 0xFF ; 255 3647a: 28 81 ld r18, Y 3647c: 39 81 ldd r19, Y+1 ; 0x01 3647e: 4a 81 ldd r20, Y+2 ; 0x02 36480: 5b 81 ldd r21, Y+3 ; 0x03 36482: c2 58 subi r28, 0x82 ; 130 36484: d0 40 sbci r29, 0x00 ; 0 36486: 28 1b sub r18, r24 36488: 39 0b sbc r19, r25 3648a: 4a 0b sbc r20, r26 3648c: 5b 0b sbc r21, r27 3648e: 29 a7 std Y+41, r18 ; 0x29 36490: 3a a7 std Y+42, r19 ; 0x2a 36492: 4b a7 std Y+43, r20 ; 0x2b 36494: 5c a7 std Y+44, r21 ; 0x2c int32_t dz = target[Z_AXIS] - position[Z_AXIS]; 36496: 80 91 aa 06 lds r24, 0x06AA ; 0x8006aa 3649a: 90 91 ab 06 lds r25, 0x06AB ; 0x8006ab 3649e: a0 91 ac 06 lds r26, 0x06AC ; 0x8006ac 364a2: b0 91 ad 06 lds r27, 0x06AD ; 0x8006ad 364a6: e6 96 adiw r28, 0x36 ; 54 364a8: 2c ad ldd r18, Y+60 ; 0x3c 364aa: 3d ad ldd r19, Y+61 ; 0x3d 364ac: 4e ad ldd r20, Y+62 ; 0x3e 364ae: 5f ad ldd r21, Y+63 ; 0x3f 364b0: e6 97 sbiw r28, 0x36 ; 54 364b2: 28 1b sub r18, r24 364b4: 39 0b sbc r19, r25 364b6: 4a 0b sbc r20, r26 364b8: 5b 0b sbc r21, r27 364ba: 2d a7 std Y+45, r18 ; 0x2d 364bc: 3e a7 std Y+46, r19 ; 0x2e 364be: 4f a7 std Y+47, r20 ; 0x2f 364c0: 58 ab std Y+48, r21 ; 0x30 #ifdef PREVENT_DANGEROUS_EXTRUDE if(de) 364c2: 41 14 cp r4, r1 364c4: 51 04 cpc r5, r1 364c6: 61 04 cpc r6, r1 364c8: 71 04 cpc r7, r1 364ca: 09 f4 brne .+2 ; 0x364ce 364cc: 80 c0 rjmp .+256 ; 0x365ce { if((int)degHotend(active_extruder) 364d2: 70 91 b0 0d lds r23, 0x0DB0 ; 0x800db0 364d6: 80 91 b1 0d lds r24, 0x0DB1 ; 0x800db1 364da: 90 91 b2 0d lds r25, 0x0DB2 ; 0x800db2 364de: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> 364e2: 20 91 6b 02 lds r18, 0x026B ; 0x80026b 364e6: 30 91 6c 02 lds r19, 0x026C ; 0x80026c 364ea: 62 17 cp r22, r18 364ec: 73 07 cpc r23, r19 364ee: 0c f5 brge .+66 ; 0x36532 { position[E_AXIS]=target[E_AXIS]; //behave as if the move really took place, but ignore E part 364f0: ae 96 adiw r28, 0x2e ; 46 364f2: 8c ad ldd r24, Y+60 ; 0x3c 364f4: 9d ad ldd r25, Y+61 ; 0x3d 364f6: ae ad ldd r26, Y+62 ; 0x3e 364f8: bf ad ldd r27, Y+63 ; 0x3f 364fa: ae 97 sbiw r28, 0x2e ; 46 364fc: 80 93 ae 06 sts 0x06AE, r24 ; 0x8006ae 36500: 90 93 af 06 sts 0x06AF, r25 ; 0x8006af 36504: a0 93 b0 06 sts 0x06B0, r26 ; 0x8006b0 36508: b0 93 b1 06 sts 0x06B1, r27 ; 0x8006b1 #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 3650c: 80 92 d8 04 sts 0x04D8, r8 ; 0x8004d8 36510: 90 92 d9 04 sts 0x04D9, r9 ; 0x8004d9 36514: a0 92 da 04 sts 0x04DA, r10 ; 0x8004da 36518: b0 92 db 04 sts 0x04DB, r11 ; 0x8004db #endif de = 0; // no difference SERIAL_ECHO_START; 3651c: 82 ef ldi r24, 0xF2 ; 242 3651e: 9b ea ldi r25, 0xAB ; 171 36520: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHOLNRPGM(_n(" cold extrusion prevented"));////MSG_ERR_COLD_EXTRUDE_STOP 36524: 80 e6 ldi r24, 0x60 ; 96 36526: 91 e7 ldi r25, 0x71 ; 113 36528: 0e 94 93 79 call 0xf326 ; 0xf326 { 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 3652c: 41 2c mov r4, r1 3652e: 51 2c mov r5, r1 36530: 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) 36532: c3 01 movw r24, r6 36534: b2 01 movw r22, r4 36536: 77 fe sbrs r7, 7 36538: 07 c0 rjmp .+14 ; 0x36548 3653a: 66 27 eor r22, r22 3653c: 77 27 eor r23, r23 3653e: cb 01 movw r24, r22 36540: 64 19 sub r22, r4 36542: 75 09 sbc r23, r5 36544: 86 09 sbc r24, r6 36546: 97 09 sbc r25, r7 36548: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 3654c: 4b 01 movw r8, r22 3654e: 5c 01 movw r10, r24 36550: 20 e0 ldi r18, 0x00 ; 0 36552: 30 ec ldi r19, 0xC0 ; 192 36554: 4b ee ldi r20, 0xEB ; 235 36556: 53 e4 ldi r21, 0x43 ; 67 36558: 60 91 cd 0d lds r22, 0x0DCD ; 0x800dcd 3655c: 70 91 ce 0d lds r23, 0x0DCE ; 0x800dce 36560: 80 91 cf 0d lds r24, 0x0DCF ; 0x800dcf 36564: 90 91 d0 0d lds r25, 0x0DD0 ; 0x800dd0 36568: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 3656c: 9b 01 movw r18, r22 3656e: ac 01 movw r20, r24 36570: c5 01 movw r24, r10 36572: b4 01 movw r22, r8 36574: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 36578: 18 16 cp r1, r24 3657a: 4c f5 brge .+82 ; 0x365ce { position[E_AXIS]=target[E_AXIS]; //behave as if the move really took place, but ignore E part 3657c: ae 96 adiw r28, 0x2e ; 46 3657e: 2c ad ldd r18, Y+60 ; 0x3c 36580: 3d ad ldd r19, Y+61 ; 0x3d 36582: 4e ad ldd r20, Y+62 ; 0x3e 36584: 5f ad ldd r21, Y+63 ; 0x3f 36586: ae 97 sbiw r28, 0x2e ; 46 36588: 20 93 ae 06 sts 0x06AE, r18 ; 0x8006ae 3658c: 30 93 af 06 sts 0x06AF, r19 ; 0x8006af 36590: 40 93 b0 06 sts 0x06B0, r20 ; 0x8006b0 36594: 50 93 b1 06 sts 0x06B1, r21 ; 0x8006b1 #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 36598: aa 96 adiw r28, 0x2a ; 42 3659a: ee ad ldd r30, Y+62 ; 0x3e 3659c: ff ad ldd r31, Y+63 ; 0x3f 3659e: aa 97 sbiw r28, 0x2a ; 42 365a0: 80 81 ld r24, Z 365a2: 91 81 ldd r25, Z+1 ; 0x01 365a4: a2 81 ldd r26, Z+2 ; 0x02 365a6: b3 81 ldd r27, Z+3 ; 0x03 365a8: 80 93 d8 04 sts 0x04D8, r24 ; 0x8004d8 365ac: 90 93 d9 04 sts 0x04D9, r25 ; 0x8004d9 365b0: a0 93 da 04 sts 0x04DA, r26 ; 0x8004da 365b4: b0 93 db 04 sts 0x04DB, r27 ; 0x8004db #endif de = 0; // no difference SERIAL_ECHO_START; 365b8: 82 ef ldi r24, 0xF2 ; 242 365ba: 9b ea ldi r25, 0xAB ; 171 365bc: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHOLNRPGM(_n(" too long extrusion prevented"));////MSG_ERR_LONG_EXTRUDE_STOP 365c0: 82 e4 ldi r24, 0x42 ; 66 365c2: 91 e7 ldi r25, 0x71 ; 113 365c4: 0e 94 93 79 call 0xf326 ; 0xf326 { 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 365c8: 41 2c mov r4, r1 365ca: 51 2c mov r5, r1 365cc: 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); 365ce: 8e e6 ldi r24, 0x6E ; 110 365d0: 82 9d mul r24, r2 365d2: f0 01 movw r30, r0 365d4: 83 9d mul r24, r3 365d6: f0 0d add r31, r0 365d8: 11 24 eor r1, r1 365da: ec 53 subi r30, 0x3C ; 60 365dc: f9 4f sbci r31, 0xF9 ; 249 365de: d7 01 movw r26, r14 365e0: c6 01 movw r24, r12 365e2: f7 fe sbrs r15, 7 365e4: 07 c0 rjmp .+14 ; 0x365f4 365e6: 88 27 eor r24, r24 365e8: 99 27 eor r25, r25 365ea: dc 01 movw r26, r24 365ec: 8c 19 sub r24, r12 365ee: 9d 09 sbc r25, r13 365f0: ae 09 sbc r26, r14 365f2: bf 09 sbc r27, r15 365f4: 80 83 st Z, r24 365f6: 91 83 std Z+1, r25 ; 0x01 365f8: a2 83 std Z+2, r26 ; 0x02 365fa: b3 83 std Z+3, r27 ; 0x03 block->steps[Y_AXIS].wide = labs(dy); 365fc: 8e e6 ldi r24, 0x6E ; 110 365fe: 82 9d mul r24, r2 36600: f0 01 movw r30, r0 36602: 83 9d mul r24, r3 36604: f0 0d add r31, r0 36606: 11 24 eor r1, r1 36608: ec 53 subi r30, 0x3C ; 60 3660a: f9 4f sbci r31, 0xF9 ; 249 3660c: 89 a5 ldd r24, Y+41 ; 0x29 3660e: 9a a5 ldd r25, Y+42 ; 0x2a 36610: ab a5 ldd r26, Y+43 ; 0x2b 36612: bc a5 ldd r27, Y+44 ; 0x2c 36614: b7 ff sbrs r27, 7 36616: 07 c0 rjmp .+14 ; 0x36626 36618: b0 95 com r27 3661a: a0 95 com r26 3661c: 90 95 com r25 3661e: 81 95 neg r24 36620: 9f 4f sbci r25, 0xFF ; 255 36622: af 4f sbci r26, 0xFF ; 255 36624: bf 4f sbci r27, 0xFF ; 255 36626: 84 83 std Z+4, r24 ; 0x04 36628: 95 83 std Z+5, r25 ; 0x05 3662a: a6 83 std Z+6, r26 ; 0x06 3662c: 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); 3662e: 8e e6 ldi r24, 0x6E ; 110 36630: 82 9d mul r24, r2 36632: f0 01 movw r30, r0 36634: 83 9d mul r24, r3 36636: f0 0d add r31, r0 36638: 11 24 eor r1, r1 3663a: ec 53 subi r30, 0x3C ; 60 3663c: f9 4f sbci r31, 0xF9 ; 249 3663e: 8d a5 ldd r24, Y+45 ; 0x2d 36640: 9e a5 ldd r25, Y+46 ; 0x2e 36642: af a5 ldd r26, Y+47 ; 0x2f 36644: b8 a9 ldd r27, Y+48 ; 0x30 36646: b7 ff sbrs r27, 7 36648: 07 c0 rjmp .+14 ; 0x36658 3664a: b0 95 com r27 3664c: a0 95 com r26 3664e: 90 95 com r25 36650: 81 95 neg r24 36652: 9f 4f sbci r25, 0xFF ; 255 36654: af 4f sbci r26, 0xFF ; 255 36656: bf 4f sbci r27, 0xFF ; 255 36658: 80 87 std Z+8, r24 ; 0x08 3665a: 91 87 std Z+9, r25 ; 0x09 3665c: a2 87 std Z+10, r26 ; 0x0a 3665e: b3 87 std Z+11, r27 ; 0x0b block->steps[E_AXIS].wide = labs(de); 36660: b3 01 movw r22, r6 36662: a2 01 movw r20, r4 36664: 77 fe sbrs r7, 7 36666: 07 c0 rjmp .+14 ; 0x36676 36668: 44 27 eor r20, r20 3666a: 55 27 eor r21, r21 3666c: ba 01 movw r22, r20 3666e: 44 19 sub r20, r4 36670: 55 09 sbc r21, r5 36672: 66 09 sbc r22, r6 36674: 77 09 sbc r23, r7 36676: 8e e6 ldi r24, 0x6E ; 110 36678: 82 9d mul r24, r2 3667a: f0 01 movw r30, r0 3667c: 83 9d mul r24, r3 3667e: f0 0d add r31, r0 36680: 11 24 eor r1, r1 36682: ec 53 subi r30, 0x3C ; 60 36684: f9 4f sbci r31, 0xF9 ; 249 36686: 44 87 std Z+12, r20 ; 0x0c 36688: 55 87 std Z+13, r21 ; 0x0d 3668a: 66 87 std Z+14, r22 ; 0x0e 3668c: 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))); 3668e: 00 81 ld r16, Z 36690: 11 81 ldd r17, Z+1 ; 0x01 36692: 22 81 ldd r18, Z+2 ; 0x02 36694: 33 81 ldd r19, Z+3 ; 0x03 36696: 84 81 ldd r24, Z+4 ; 0x04 36698: 95 81 ldd r25, Z+5 ; 0x05 3669a: a6 81 ldd r26, Z+6 ; 0x06 3669c: b7 81 ldd r27, Z+7 ; 0x07 3669e: 80 17 cp r24, r16 366a0: 91 07 cpc r25, r17 366a2: a2 07 cpc r26, r18 366a4: b3 07 cpc r27, r19 366a6: 14 f4 brge .+4 ; 0x366ac 366a8: d9 01 movw r26, r18 366aa: c8 01 movw r24, r16 366ac: ee e6 ldi r30, 0x6E ; 110 366ae: be 2e mov r11, r30 366b0: b2 9c mul r11, r2 366b2: f0 01 movw r30, r0 366b4: b3 9c mul r11, r3 366b6: f0 0d add r31, r0 366b8: 11 24 eor r1, r1 366ba: ec 53 subi r30, 0x3C ; 60 366bc: f9 4f sbci r31, 0xF9 ; 249 366be: 80 84 ldd r8, Z+8 ; 0x08 366c0: 91 84 ldd r9, Z+9 ; 0x09 366c2: a2 84 ldd r10, Z+10 ; 0x0a 366c4: b3 84 ldd r11, Z+11 ; 0x0b 366c6: 88 15 cp r24, r8 366c8: 99 05 cpc r25, r9 366ca: aa 05 cpc r26, r10 366cc: bb 05 cpc r27, r11 366ce: 14 f4 brge .+4 ; 0x366d4 366d0: d5 01 movw r26, r10 366d2: c4 01 movw r24, r8 366d4: 84 17 cp r24, r20 366d6: 95 07 cpc r25, r21 366d8: a6 07 cpc r26, r22 366da: b7 07 cpc r27, r23 366dc: 14 f4 brge .+4 ; 0x366e2 366de: db 01 movw r26, r22 366e0: ca 01 movw r24, r20 366e2: 4e e6 ldi r20, 0x6E ; 110 366e4: 42 9d mul r20, r2 366e6: f0 01 movw r30, r0 366e8: 43 9d mul r20, r3 366ea: f0 0d add r31, r0 366ec: 11 24 eor r1, r1 366ee: ec 53 subi r30, 0x3C ; 60 366f0: f9 4f sbci r31, 0xF9 ; 249 366f2: 80 8b std Z+16, r24 ; 0x10 366f4: 91 8b std Z+17, r25 ; 0x11 366f6: a2 8b std Z+18, r26 ; 0x12 366f8: b3 8b std Z+19, r27 ; 0x13 // Bail if this is a zero-length block if (block->step_event_count.wide <= dropsegments) 366fa: 06 97 sbiw r24, 0x06 ; 6 366fc: a1 05 cpc r26, r1 366fe: b1 05 cpc r27, r1 36700: 0c f4 brge .+2 ; 0x36704 36702: 94 cd rjmp .-1240 ; 0x3622c planner_update_queue_min_counter(); #endif /* PLANNER_DIAGNOSTICS */ return; } block->fan_speed = fanSpeed; 36704: 80 91 e5 03 lds r24, 0x03E5 ; 0x8003e5 36708: df 01 movw r26, r30 3670a: aa 5b subi r26, 0xBA ; 186 3670c: bf 4f sbci r27, 0xFF ; 255 3670e: 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); 36710: f7 fe sbrs r15, 7 36712: 02 c0 rjmp .+4 ; 0x36718 36714: 0d 94 ba bb jmp 0x37774 ; 0x37774 } block->fan_speed = fanSpeed; // Compute direction bits for this block block->direction_bits = 0; 36718: 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); 3671a: 89 a5 ldd r24, Y+41 ; 0x29 3671c: 9a a5 ldd r25, Y+42 ; 0x2a 3671e: ab a5 ldd r26, Y+43 ; 0x2b 36720: bc a5 ldd r27, Y+44 ; 0x2c 36722: b7 ff sbrs r27, 7 36724: 0b c0 rjmp .+22 ; 0x3673c 36726: 8e e6 ldi r24, 0x6E ; 110 36728: 82 9d mul r24, r2 3672a: f0 01 movw r30, r0 3672c: 83 9d mul r24, r3 3672e: f0 0d add r31, r0 36730: 11 24 eor r1, r1 36732: ec 53 subi r30, 0x3C ; 60 36734: f9 4f sbci r31, 0xF9 ; 249 36736: 80 8d ldd r24, Z+24 ; 0x18 36738: 82 60 ori r24, 0x02 ; 2 3673a: 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); 3673c: 8d a5 ldd r24, Y+45 ; 0x2d 3673e: 9e a5 ldd r25, Y+46 ; 0x2e 36740: af a5 ldd r26, Y+47 ; 0x2f 36742: b8 a9 ldd r27, Y+48 ; 0x30 36744: b7 ff sbrs r27, 7 36746: 0b c0 rjmp .+22 ; 0x3675e 36748: 8e e6 ldi r24, 0x6E ; 110 3674a: 82 9d mul r24, r2 3674c: f0 01 movw r30, r0 3674e: 83 9d mul r24, r3 36750: f0 0d add r31, r0 36752: 11 24 eor r1, r1 36754: ec 53 subi r30, 0x3C ; 60 36756: f9 4f sbci r31, 0xF9 ; 249 36758: 80 8d ldd r24, Z+24 ; 0x18 3675a: 84 60 ori r24, 0x04 ; 4 3675c: 80 8f std Z+24, r24 ; 0x18 if (de < 0) block->direction_bits |= _BV(E_AXIS); 3675e: 77 fe sbrs r7, 7 36760: 0b c0 rjmp .+22 ; 0x36778 36762: 8e e6 ldi r24, 0x6E ; 110 36764: 82 9d mul r24, r2 36766: f0 01 movw r30, r0 36768: 83 9d mul r24, r3 3676a: f0 0d add r31, r0 3676c: 11 24 eor r1, r1 3676e: ec 53 subi r30, 0x3C ; 60 36770: f9 4f sbci r31, 0xF9 ; 249 36772: 80 8d ldd r24, Z+24 ; 0x18 36774: 88 60 ori r24, 0x08 ; 8 36776: 80 8f std Z+24, r24 ; 0x18 { enable_x(); enable_y(); } #else if(block->steps[X_AXIS].wide != 0) enable_x(); 36778: 01 2b or r16, r17 3677a: 02 2b or r16, r18 3677c: 03 2b or r16, r19 3677e: 09 f0 breq .+2 ; 0x36782 36780: 17 98 cbi 0x02, 7 ; 2 if(block->steps[Y_AXIS].wide != 0) enable_y(); 36782: 8e e6 ldi r24, 0x6E ; 110 36784: 82 9d mul r24, r2 36786: f0 01 movw r30, r0 36788: 83 9d mul r24, r3 3678a: f0 0d add r31, r0 3678c: 11 24 eor r1, r1 3678e: ec 53 subi r30, 0x3C ; 60 36790: f9 4f sbci r31, 0xF9 ; 249 36792: 84 81 ldd r24, Z+4 ; 0x04 36794: 95 81 ldd r25, Z+5 ; 0x05 36796: a6 81 ldd r26, Z+6 ; 0x06 36798: b7 81 ldd r27, Z+7 ; 0x07 3679a: 89 2b or r24, r25 3679c: 8a 2b or r24, r26 3679e: 8b 2b or r24, r27 367a0: 09 f0 breq .+2 ; 0x367a4 367a2: 16 98 cbi 0x02, 6 ; 2 #endif if(block->steps[Z_AXIS].wide != 0) enable_z(); 367a4: 8e e6 ldi r24, 0x6E ; 110 367a6: 82 9d mul r24, r2 367a8: f0 01 movw r30, r0 367aa: 83 9d mul r24, r3 367ac: f0 0d add r31, r0 367ae: 11 24 eor r1, r1 367b0: ec 53 subi r30, 0x3C ; 60 367b2: f9 4f sbci r31, 0xF9 ; 249 367b4: 80 85 ldd r24, Z+8 ; 0x08 367b6: 91 85 ldd r25, Z+9 ; 0x09 367b8: a2 85 ldd r26, Z+10 ; 0x0a 367ba: b3 85 ldd r27, Z+11 ; 0x0b 367bc: 89 2b or r24, r25 367be: 8a 2b or r24, r26 367c0: 8b 2b or r24, r27 367c2: 09 f0 breq .+2 ; 0x367c6 367c4: 15 98 cbi 0x02, 5 ; 2 if(block->steps[E_AXIS].wide != 0) enable_e0(); 367c6: 8e e6 ldi r24, 0x6E ; 110 367c8: 82 9d mul r24, r2 367ca: f0 01 movw r30, r0 367cc: 83 9d mul r24, r3 367ce: f0 0d add r31, r0 367d0: 11 24 eor r1, r1 367d2: ec 53 subi r30, 0x3C ; 60 367d4: f9 4f sbci r31, 0xF9 ; 249 367d6: 84 85 ldd r24, Z+12 ; 0x0c 367d8: 95 85 ldd r25, Z+13 ; 0x0d 367da: a6 85 ldd r26, Z+14 ; 0x0e 367dc: b7 85 ldd r27, Z+15 ; 0x0f 367de: 89 2b or r24, r25 367e0: 8a 2b or r24, r26 367e2: 8b 2b or r24, r27 367e4: 09 f0 breq .+2 ; 0x367e8 367e6: 14 98 cbi 0x02, 4 ; 2 if (block->steps[E_AXIS].wide == 0) 367e8: 8e e6 ldi r24, 0x6E ; 110 367ea: 82 9d mul r24, r2 367ec: f0 01 movw r30, r0 367ee: 83 9d mul r24, r3 367f0: f0 0d add r31, r0 367f2: 11 24 eor r1, r1 367f4: ec 53 subi r30, 0x3C ; 60 367f6: f9 4f sbci r31, 0xF9 ; 249 367f8: 24 85 ldd r18, Z+12 ; 0x0c 367fa: 35 85 ldd r19, Z+13 ; 0x0d 367fc: 46 85 ldd r20, Z+14 ; 0x0e 367fe: 57 85 ldd r21, Z+15 ; 0x0f 36800: 2a 96 adiw r28, 0x0a ; 10 36802: 2c af std Y+60, r18 ; 0x3c 36804: 3d af std Y+61, r19 ; 0x3d 36806: 4e af std Y+62, r20 ; 0x3e 36808: 5f af std Y+63, r21 ; 0x3f 3680a: 2a 97 sbiw r28, 0x0a ; 10 3680c: 23 2b or r18, r19 3680e: 24 2b or r18, r20 36810: 25 2b or r18, r21 36812: 09 f0 breq .+2 ; 0x36816 36814: b3 c7 rjmp .+3942 ; 0x3777c { if(feed_rate 3681a: b0 90 fe 0d lds r11, 0x0DFE ; 0x800dfe 3681e: 00 91 ff 0d lds r16, 0x0DFF ; 0x800dff 36822: 10 91 00 0e lds r17, 0x0E00 ; 0x800e00 } else { if(feed_rate 36836: 18 16 cp r1, r24 36838: 24 f4 brge .+8 ; 0x36842 3683a: a9 aa std Y+49, r10 ; 0x31 3683c: b9 ae std Y+57, r11 ; 0x39 3683e: 0d af std Y+61, r16 ; 0x3d 36840: 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]; 36842: c7 01 movw r24, r14 36844: b6 01 movw r22, r12 36846: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 3684a: 20 91 c1 0d lds r18, 0x0DC1 ; 0x800dc1 3684e: 30 91 c2 0d lds r19, 0x0DC2 ; 0x800dc2 36852: 40 91 c3 0d lds r20, 0x0DC3 ; 0x800dc3 36856: 50 91 c4 0d lds r21, 0x0DC4 ; 0x800dc4 3685a: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 3685e: 4b 01 movw r8, r22 36860: 5c 01 movw r10, r24 36862: 89 82 std Y+1, r8 ; 0x01 36864: 9a 82 std Y+2, r9 ; 0x02 36866: ab 82 std Y+3, r10 ; 0x03 36868: bc 82 std Y+4, r11 ; 0x04 delta_mm[Y_AXIS] = dy / cs.axis_steps_per_mm[Y_AXIS]; 3686a: 69 a5 ldd r22, Y+41 ; 0x29 3686c: 7a a5 ldd r23, Y+42 ; 0x2a 3686e: 8b a5 ldd r24, Y+43 ; 0x2b 36870: 9c a5 ldd r25, Y+44 ; 0x2c 36872: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 36876: 20 91 c5 0d lds r18, 0x0DC5 ; 0x800dc5 3687a: 30 91 c6 0d lds r19, 0x0DC6 ; 0x800dc6 3687e: 40 91 c7 0d lds r20, 0x0DC7 ; 0x800dc7 36882: 50 91 c8 0d lds r21, 0x0DC8 ; 0x800dc8 36886: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 3688a: 6b 01 movw r12, r22 3688c: 7c 01 movw r14, r24 3688e: cd 82 std Y+5, r12 ; 0x05 36890: de 82 std Y+6, r13 ; 0x06 36892: ef 82 std Y+7, r14 ; 0x07 36894: 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]; 36896: 6d a5 ldd r22, Y+45 ; 0x2d 36898: 7e a5 ldd r23, Y+46 ; 0x2e 3689a: 8f a5 ldd r24, Y+47 ; 0x2f 3689c: 98 a9 ldd r25, Y+48 ; 0x30 3689e: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 368a2: 20 91 c9 0d lds r18, 0x0DC9 ; 0x800dc9 368a6: 30 91 ca 0d lds r19, 0x0DCA ; 0x800dca 368aa: 40 91 cb 0d lds r20, 0x0DCB ; 0x800dcb 368ae: 50 91 cc 0d lds r21, 0x0DCC ; 0x800dcc 368b2: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 368b6: 22 96 adiw r28, 0x02 ; 2 368b8: 6c af std Y+60, r22 ; 0x3c 368ba: 7d af std Y+61, r23 ; 0x3d 368bc: 8e af std Y+62, r24 ; 0x3e 368be: 9f af std Y+63, r25 ; 0x3f 368c0: 22 97 sbiw r28, 0x02 ; 2 368c2: 69 87 std Y+9, r22 ; 0x09 368c4: 7a 87 std Y+10, r23 ; 0x0a 368c6: 8b 87 std Y+11, r24 ; 0x0b 368c8: 9c 87 std Y+12, r25 ; 0x0c delta_mm[E_AXIS] = de / cs.axis_steps_per_mm[E_AXIS]; 368ca: c3 01 movw r24, r6 368cc: b2 01 movw r22, r4 368ce: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 368d2: 20 91 cd 0d lds r18, 0x0DCD ; 0x800dcd 368d6: 30 91 ce 0d lds r19, 0x0DCE ; 0x800dce 368da: 40 91 cf 0d lds r20, 0x0DCF ; 0x800dcf 368de: 50 91 d0 0d lds r21, 0x0DD0 ; 0x800dd0 368e2: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 368e6: 26 96 adiw r28, 0x06 ; 6 368e8: 6c af std Y+60, r22 ; 0x3c 368ea: 7d af std Y+61, r23 ; 0x3d 368ec: 8e af std Y+62, r24 ; 0x3e 368ee: 9f af std Y+63, r25 ; 0x3f 368f0: 26 97 sbiw r28, 0x06 ; 6 368f2: 6d 87 std Y+13, r22 ; 0x0d 368f4: 7e 87 std Y+14, r23 ; 0x0e 368f6: 8f 87 std Y+15, r24 ; 0x0f 368f8: 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 ) 368fa: 8e e6 ldi r24, 0x6E ; 110 368fc: 82 9d mul r24, r2 368fe: f0 01 movw r30, r0 36900: 83 9d mul r24, r3 36902: f0 0d add r31, r0 36904: 11 24 eor r1, r1 36906: ec 53 subi r30, 0x3C ; 60 36908: f9 4f sbci r31, 0xF9 ; 249 3690a: 80 81 ld r24, Z 3690c: 91 81 ldd r25, Z+1 ; 0x01 3690e: a2 81 ldd r26, Z+2 ; 0x02 36910: b3 81 ldd r27, Z+3 ; 0x03 36912: 2e 96 adiw r28, 0x0e ; 14 36914: 8c af std Y+60, r24 ; 0x3c 36916: 9d af std Y+61, r25 ; 0x3d 36918: ae af std Y+62, r26 ; 0x3e 3691a: bf af std Y+63, r27 ; 0x3f 3691c: 2e 97 sbiw r28, 0x0e ; 14 3691e: 06 97 sbiw r24, 0x06 ; 6 36920: a1 05 cpc r26, r1 36922: b1 05 cpc r27, r1 36924: 0c f0 brlt .+2 ; 0x36928 36926: 33 c7 rjmp .+3686 ; 0x3778e 36928: 84 81 ldd r24, Z+4 ; 0x04 3692a: 95 81 ldd r25, Z+5 ; 0x05 3692c: a6 81 ldd r26, Z+6 ; 0x06 3692e: b7 81 ldd r27, Z+7 ; 0x07 36930: 06 97 sbiw r24, 0x06 ; 6 36932: a1 05 cpc r26, r1 36934: b1 05 cpc r27, r1 36936: 0c f0 brlt .+2 ; 0x3693a 36938: 2a c7 rjmp .+3668 ; 0x3778e 3693a: 80 85 ldd r24, Z+8 ; 0x08 3693c: 91 85 ldd r25, Z+9 ; 0x09 3693e: a2 85 ldd r26, Z+10 ; 0x0a 36940: b3 85 ldd r27, Z+11 ; 0x0b 36942: 06 97 sbiw r24, 0x06 ; 6 36944: a1 05 cpc r26, r1 36946: b1 05 cpc r27, r1 36948: 0c f0 brlt .+2 ; 0x3694c 3694a: 21 c7 rjmp .+3650 ; 0x3778e { block->millimeters = fabs(delta_mm[E_AXIS]); 3694c: 26 96 adiw r28, 0x06 ; 6 3694e: 8c ad ldd r24, Y+60 ; 0x3c 36950: 9d ad ldd r25, Y+61 ; 0x3d 36952: ae ad ldd r26, Y+62 ; 0x3e 36954: bf ad ldd r27, Y+63 ; 0x3f 36956: 26 97 sbiw r28, 0x06 ; 6 36958: bf 77 andi r27, 0x7F ; 127 3695a: 85 a7 std Z+45, r24 ; 0x2d 3695c: 96 a7 std Z+46, r25 ; 0x2e 3695e: a7 a7 std Z+47, r26 ; 0x2f 36960: 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 36962: 8e e6 ldi r24, 0x6E ; 110 36964: 82 9d mul r24, r2 36966: f0 01 movw r30, r0 36968: 83 9d mul r24, r3 3696a: f0 0d add r31, r0 3696c: 11 24 eor r1, r1 3696e: ec 53 subi r30, 0x3C ; 60 36970: f9 4f sbci r31, 0xF9 ; 249 36972: 45 a4 ldd r4, Z+45 ; 0x2d 36974: 56 a4 ldd r5, Z+46 ; 0x2e 36976: 67 a4 ldd r6, Z+47 ; 0x2f 36978: 70 a8 ldd r7, Z+48 ; 0x30 3697a: a3 01 movw r20, r6 3697c: 92 01 movw r18, r4 3697e: 60 e0 ldi r22, 0x00 ; 0 36980: 70 e0 ldi r23, 0x00 ; 0 36982: 80 e8 ldi r24, 0x80 ; 128 36984: 9f e3 ldi r25, 0x3F ; 63 36986: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> // Calculate speed in mm/second for each axis. No divide by zero due to previous checks. float inverse_second = feed_rate * inverse_millimeters; 3698a: 29 a9 ldd r18, Y+49 ; 0x31 3698c: 39 ad ldd r19, Y+57 ; 0x39 3698e: 4d ad ldd r20, Y+61 ; 0x3d 36990: 5d a9 ldd r21, Y+53 ; 0x35 36992: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 36996: 6b 01 movw r12, r22 36998: 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); 3699a: 80 91 a4 0d lds r24, 0x0DA4 ; 0x800da4 3699e: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 369a2: 89 1b sub r24, r25 369a4: 8f 70 andi r24, 0x0F ; 15 369a6: 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)) { 369a8: 82 50 subi r24, 0x02 ; 2 369aa: 86 30 cpi r24, 0x06 ; 6 369ac: 08 f0 brcs .+2 ; 0x369b0 369ae: 40 c0 rjmp .+128 ; 0x36a30 // segment time in micro seconds unsigned long segment_time = lround(1000000.0/inverse_second); 369b0: a7 01 movw r20, r14 369b2: 96 01 movw r18, r12 369b4: 60 e0 ldi r22, 0x00 ; 0 369b6: 74 e2 ldi r23, 0x24 ; 36 369b8: 84 e7 ldi r24, 0x74 ; 116 369ba: 99 e4 ldi r25, 0x49 ; 73 369bc: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 369c0: 0f 94 3c e0 call 0x3c078 ; 0x3c078 369c4: 4b 01 movw r8, r22 369c6: 5c 01 movw r10, r24 if (segment_time < cs.min_segment_time_us) 369c8: 80 91 01 0e lds r24, 0x0E01 ; 0x800e01 369cc: 90 91 02 0e lds r25, 0x0E02 ; 0x800e02 369d0: a0 91 03 0e lds r26, 0x0E03 ; 0x800e03 369d4: b0 91 04 0e lds r27, 0x0E04 ; 0x800e04 369d8: 88 16 cp r8, r24 369da: 99 06 cpc r9, r25 369dc: aa 06 cpc r10, r26 369de: bb 06 cpc r11, r27 369e0: 38 f5 brcc .+78 ; 0x36a30 // 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)); 369e2: bc 01 movw r22, r24 369e4: cd 01 movw r24, r26 369e6: 68 19 sub r22, r8 369e8: 79 09 sbc r23, r9 369ea: 8a 09 sbc r24, r10 369ec: 9b 09 sbc r25, r11 369ee: 66 0f add r22, r22 369f0: 77 1f adc r23, r23 369f2: 88 1f adc r24, r24 369f4: 99 1f adc r25, r25 369f6: ad ad ldd r26, Y+61 ; 0x3d 369f8: 2a 2f mov r18, r26 369fa: 30 e0 ldi r19, 0x00 ; 0 369fc: 50 e0 ldi r21, 0x00 ; 0 369fe: 40 e0 ldi r20, 0x00 ; 0 36a00: 0f 94 4a dc call 0x3b894 ; 0x3b894 <__udivmodsi4> 36a04: ca 01 movw r24, r20 36a06: b9 01 movw r22, r18 36a08: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 36a0c: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> 36a10: 68 0d add r22, r8 36a12: 79 1d adc r23, r9 36a14: 8a 1d adc r24, r10 36a16: 9b 1d adc r25, r11 36a18: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 36a1c: 9b 01 movw r18, r22 36a1e: ac 01 movw r20, r24 36a20: 60 e0 ldi r22, 0x00 ; 0 36a22: 74 e2 ldi r23, 0x24 ; 36 36a24: 84 e7 ldi r24, 0x74 ; 116 36a26: 99 e4 ldi r25, 0x49 ; 73 36a28: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 36a2c: 6b 01 movw r12, r22 36a2e: 7c 01 movw r14, r24 } #endif // SLOWDOWN block->nominal_speed = block->millimeters * inverse_second; // (mm/sec) Always > 0 36a30: a3 01 movw r20, r6 36a32: 92 01 movw r18, r4 36a34: c7 01 movw r24, r14 36a36: b6 01 movw r22, r12 36a38: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 36a3c: 6d ab std Y+53, r22 ; 0x35 36a3e: 7e ab std Y+54, r23 ; 0x36 36a40: 8f ab std Y+55, r24 ; 0x37 36a42: 98 af std Y+56, r25 ; 0x38 36a44: 8e e6 ldi r24, 0x6E ; 110 36a46: 82 9d mul r24, r2 36a48: 80 01 movw r16, r0 36a4a: 83 9d mul r24, r3 36a4c: 10 0d add r17, r0 36a4e: 11 24 eor r1, r1 36a50: 0c 53 subi r16, 0x3C ; 60 36a52: 19 4f sbci r17, 0xF9 ; 249 36a54: 2d a9 ldd r18, Y+53 ; 0x35 36a56: 3e a9 ldd r19, Y+54 ; 0x36 36a58: 4f a9 ldd r20, Y+55 ; 0x37 36a5a: 58 ad ldd r21, Y+56 ; 0x38 36a5c: d8 01 movw r26, r16 36a5e: 91 96 adiw r26, 0x21 ; 33 36a60: 2d 93 st X+, r18 36a62: 3d 93 st X+, r19 36a64: 4d 93 st X+, r20 36a66: 5c 93 st X, r21 36a68: 94 97 sbiw r26, 0x24 ; 36 block->nominal_rate = ceil(block->step_event_count.wide * inverse_second); // (step/sec) Always > 0 36a6a: 50 96 adiw r26, 0x10 ; 16 36a6c: 6d 91 ld r22, X+ 36a6e: 7d 91 ld r23, X+ 36a70: 8d 91 ld r24, X+ 36a72: 9c 91 ld r25, X 36a74: 53 97 sbiw r26, 0x13 ; 19 36a76: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 36a7a: 69 af std Y+57, r22 ; 0x39 36a7c: 7a af std Y+58, r23 ; 0x3a 36a7e: 8b af std Y+59, r24 ; 0x3b 36a80: 9c af std Y+60, r25 ; 0x3c 36a82: 9b 01 movw r18, r22 36a84: ac 01 movw r20, r24 36a86: c7 01 movw r24, r14 36a88: b6 01 movw r22, r12 36a8a: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 36a8e: 0f 94 dd dd call 0x3bbba ; 0x3bbba 36a92: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 36a96: 62 96 adiw r28, 0x12 ; 18 36a98: 6c af std Y+60, r22 ; 0x3c 36a9a: 7d af std Y+61, r23 ; 0x3d 36a9c: 8e af std Y+62, r24 ; 0x3e 36a9e: 9f af std Y+63, r25 ; 0x3f 36aa0: 62 97 sbiw r28, 0x12 ; 18 36aa2: f8 01 movw r30, r16 36aa4: 66 ab std Z+54, r22 ; 0x36 36aa6: 77 ab std Z+55, r23 ; 0x37 36aa8: 80 af std Z+56, r24 ; 0x38 36aaa: 91 af std Z+57, r25 ; 0x39 36aac: 9e 01 movw r18, r28 36aae: 2f 5f subi r18, 0xFF ; 255 36ab0: 3f 4f sbci r19, 0xFF ; 255 36ab2: 6c 96 adiw r28, 0x1c ; 28 36ab4: 3f af std Y+63, r19 ; 0x3f 36ab6: 2e af std Y+62, r18 ; 0x3e 36ab8: 6c 97 sbiw r28, 0x1c ; 28 36aba: ae 01 movw r20, r28 36abc: 4f 5e subi r20, 0xEF ; 239 36abe: 5f 4f sbci r21, 0xFF ; 255 36ac0: a0 96 adiw r28, 0x20 ; 32 36ac2: 5f af std Y+63, r21 ; 0x3f 36ac4: 4e af std Y+62, r20 ; 0x3e 36ac6: a0 97 sbiw r28, 0x20 ; 32 36ac8: 80 91 71 02 lds r24, 0x0271 ; 0x800271 36acc: 90 91 72 02 lds r25, 0x0272 ; 0x800272 36ad0: 9a ab std Y+50, r25 ; 0x32 36ad2: 89 ab std Y+49, r24 ; 0x31 36ad4: 40 96 adiw r24, 0x10 ; 16 36ad6: 6e 96 adiw r28, 0x1e ; 30 36ad8: 9f af std Y+63, r25 ; 0x3f 36ada: 8e af std Y+62, r24 ; 0x3e 36adc: 6e 97 sbiw r28, 0x1e ; 30 float current_speed[4]; float speed_factor = 1.0; //factor <=1 do decrease speed for(int i=0; i < 4; i++) { current_speed[i] = delta_mm[i] * inverse_second; if(fabs(current_speed[i]) > max_feedrate[i]) 36ade: 68 96 adiw r28, 0x18 ; 24 36ae0: 5f af std Y+63, r21 ; 0x3f 36ae2: 4e af std Y+62, r20 ; 0x3e 36ae4: 68 97 sbiw r28, 0x18 ; 24 block->nominal_speed = block->millimeters * inverse_second; // (mm/sec) Always > 0 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 36ae6: 19 a6 std Y+41, r1 ; 0x29 36ae8: 1d a6 std Y+45, r1 ; 0x2d 36aea: 00 e8 ldi r16, 0x80 ; 128 36aec: 1f e3 ldi r17, 0x3F ; 63 for(int i=0; i < 4; i++) { current_speed[i] = delta_mm[i] * inverse_second; 36aee: 6c 96 adiw r28, 0x1c ; 28 36af0: ae ad ldd r26, Y+62 ; 0x3e 36af2: bf ad ldd r27, Y+63 ; 0x3f 36af4: 6c 97 sbiw r28, 0x1c ; 28 36af6: 2d 91 ld r18, X+ 36af8: 3d 91 ld r19, X+ 36afa: 4d 91 ld r20, X+ 36afc: 5d 91 ld r21, X+ 36afe: 6c 96 adiw r28, 0x1c ; 28 36b00: bf af std Y+63, r27 ; 0x3f 36b02: ae af std Y+62, r26 ; 0x3e 36b04: 6c 97 sbiw r28, 0x1c ; 28 36b06: c7 01 movw r24, r14 36b08: b6 01 movw r22, r12 36b0a: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 36b0e: 68 96 adiw r28, 0x18 ; 24 36b10: ee ad ldd r30, Y+62 ; 0x3e 36b12: ff ad ldd r31, Y+63 ; 0x3f 36b14: 68 97 sbiw r28, 0x18 ; 24 36b16: 61 93 st Z+, r22 36b18: 71 93 st Z+, r23 36b1a: 81 93 st Z+, r24 36b1c: 91 93 st Z+, r25 36b1e: 68 96 adiw r28, 0x18 ; 24 36b20: ff af std Y+63, r31 ; 0x3f 36b22: ee af std Y+62, r30 ; 0x3e 36b24: 68 97 sbiw r28, 0x18 ; 24 if(fabs(current_speed[i]) > max_feedrate[i]) 36b26: 4b 01 movw r8, r22 36b28: 5c 01 movw r10, r24 36b2a: e8 94 clt 36b2c: b7 f8 bld r11, 7 36b2e: a9 a9 ldd r26, Y+49 ; 0x31 36b30: ba a9 ldd r27, Y+50 ; 0x32 36b32: 2d 91 ld r18, X+ 36b34: 3d 91 ld r19, X+ 36b36: 4d 91 ld r20, X+ 36b38: 5d 91 ld r21, X+ 36b3a: ba ab std Y+50, r27 ; 0x32 36b3c: a9 ab std Y+49, r26 ; 0x31 36b3e: 66 96 adiw r28, 0x16 ; 22 36b40: 2c af std Y+60, r18 ; 0x3c 36b42: 3d af std Y+61, r19 ; 0x3d 36b44: 4e af std Y+62, r20 ; 0x3e 36b46: 5f af std Y+63, r21 ; 0x3f 36b48: 66 97 sbiw r28, 0x16 ; 22 36b4a: c5 01 movw r24, r10 36b4c: b4 01 movw r22, r8 36b4e: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 36b52: 18 16 cp r1, r24 36b54: b4 f4 brge .+44 ; 0x36b82 { speed_factor = min(speed_factor, max_feedrate[i] / fabs(current_speed[i])); 36b56: a5 01 movw r20, r10 36b58: 94 01 movw r18, r8 36b5a: 66 96 adiw r28, 0x16 ; 22 36b5c: 6c ad ldd r22, Y+60 ; 0x3c 36b5e: 7d ad ldd r23, Y+61 ; 0x3d 36b60: 8e ad ldd r24, Y+62 ; 0x3e 36b62: 9f ad ldd r25, Y+63 ; 0x3f 36b64: 66 97 sbiw r28, 0x16 ; 22 36b66: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 36b6a: 4b 01 movw r8, r22 36b6c: 5c 01 movw r10, r24 36b6e: 29 a5 ldd r18, Y+41 ; 0x29 36b70: 3d a5 ldd r19, Y+45 ; 0x2d 36b72: a8 01 movw r20, r16 36b74: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 36b78: 18 16 cp r1, r24 36b7a: 1c f0 brlt .+6 ; 0x36b82 36b7c: 89 a6 std Y+41, r8 ; 0x29 36b7e: 9d a6 std Y+45, r9 ; 0x2d 36b80: 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++) 36b82: 6e 96 adiw r28, 0x1e ; 30 36b84: ee ad ldd r30, Y+62 ; 0x3e 36b86: ff ad ldd r31, Y+63 ; 0x3f 36b88: 6e 97 sbiw r28, 0x1e ; 30 36b8a: 29 a9 ldd r18, Y+49 ; 0x31 36b8c: 3a a9 ldd r19, Y+50 ; 0x32 36b8e: e2 17 cp r30, r18 36b90: f3 07 cpc r31, r19 36b92: 09 f0 breq .+2 ; 0x36b96 36b94: ac cf rjmp .-168 ; 0x36aee speed_factor = min(speed_factor, max_feedrate[i] / fabs(current_speed[i])); } } // Correct the speed if( speed_factor < 1.0) 36b96: 20 e0 ldi r18, 0x00 ; 0 36b98: 30 e0 ldi r19, 0x00 ; 0 36b9a: 40 e8 ldi r20, 0x80 ; 128 36b9c: 5f e3 ldi r21, 0x3F ; 63 36b9e: 69 a5 ldd r22, Y+41 ; 0x29 36ba0: 7d a5 ldd r23, Y+45 ; 0x2d 36ba2: c8 01 movw r24, r16 36ba4: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 36ba8: 87 ff sbrs r24, 7 36baa: 50 c0 rjmp .+160 ; 0x36c4c 36bac: a0 96 adiw r28, 0x20 ; 32 36bae: ae ac ldd r10, Y+62 ; 0x3e 36bb0: bf ac ldd r11, Y+63 ; 0x3f 36bb2: a0 97 sbiw r28, 0x20 ; 32 36bb4: 30 e1 ldi r19, 0x10 ; 16 36bb6: a3 0e add r10, r19 36bb8: b1 1c adc r11, r1 36bba: a0 96 adiw r28, 0x20 ; 32 36bbc: ce ac ldd r12, Y+62 ; 0x3e 36bbe: df ac ldd r13, Y+63 ; 0x3f 36bc0: a0 97 sbiw r28, 0x20 ; 32 { for(unsigned char i=0; i < 4; i++) { current_speed[i] *= speed_factor; 36bc2: d6 01 movw r26, r12 36bc4: 6d 91 ld r22, X+ 36bc6: 7d 91 ld r23, X+ 36bc8: 8d 91 ld r24, X+ 36bca: 9d 91 ld r25, X+ 36bcc: 6d 01 movw r12, r26 36bce: 7d 01 movw r14, r26 36bd0: b4 e0 ldi r27, 0x04 ; 4 36bd2: eb 1a sub r14, r27 36bd4: f1 08 sbc r15, r1 36bd6: 29 a5 ldd r18, Y+41 ; 0x29 36bd8: 3d a5 ldd r19, Y+45 ; 0x2d 36bda: a8 01 movw r20, r16 36bdc: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 36be0: f7 01 movw r30, r14 36be2: 60 83 st Z, r22 36be4: 71 83 std Z+1, r23 ; 0x01 36be6: 82 83 std Z+2, r24 ; 0x02 36be8: 93 83 std Z+3, r25 ; 0x03 } // Correct the speed if( speed_factor < 1.0) { for(unsigned char i=0; i < 4; i++) 36bea: ac 14 cp r10, r12 36bec: bd 04 cpc r11, r13 36bee: 49 f7 brne .-46 ; 0x36bc2 { current_speed[i] *= speed_factor; } block->nominal_speed *= speed_factor; 36bf0: 2e e6 ldi r18, 0x6E ; 110 36bf2: 22 9d mul r18, r2 36bf4: c0 01 movw r24, r0 36bf6: 23 9d mul r18, r3 36bf8: 90 0d add r25, r0 36bfa: 11 24 eor r1, r1 36bfc: 9c 01 movw r18, r24 36bfe: 2c 53 subi r18, 0x3C ; 60 36c00: 39 4f sbci r19, 0xF9 ; 249 36c02: 79 01 movw r14, r18 36c04: 29 a5 ldd r18, Y+41 ; 0x29 36c06: 3d a5 ldd r19, Y+45 ; 0x2d 36c08: a8 01 movw r20, r16 36c0a: 6d a9 ldd r22, Y+53 ; 0x35 36c0c: 7e a9 ldd r23, Y+54 ; 0x36 36c0e: 8f a9 ldd r24, Y+55 ; 0x37 36c10: 98 ad ldd r25, Y+56 ; 0x38 36c12: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 36c16: d7 01 movw r26, r14 36c18: 91 96 adiw r26, 0x21 ; 33 36c1a: 6d 93 st X+, r22 36c1c: 7d 93 st X+, r23 36c1e: 8d 93 st X+, r24 36c20: 9c 93 st X, r25 36c22: 94 97 sbiw r26, 0x24 ; 36 block->nominal_rate *= speed_factor; 36c24: 62 96 adiw r28, 0x12 ; 18 36c26: 6c ad ldd r22, Y+60 ; 0x3c 36c28: 7d ad ldd r23, Y+61 ; 0x3d 36c2a: 8e ad ldd r24, Y+62 ; 0x3e 36c2c: 9f ad ldd r25, Y+63 ; 0x3f 36c2e: 62 97 sbiw r28, 0x12 ; 18 36c30: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 36c34: 29 a5 ldd r18, Y+41 ; 0x29 36c36: 3d a5 ldd r19, Y+45 ; 0x2d 36c38: a8 01 movw r20, r16 36c3a: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 36c3e: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 36c42: f7 01 movw r30, r14 36c44: 66 ab std Z+54, r22 ; 0x36 36c46: 77 ab std Z+55, r23 ; 0x37 36c48: 80 af std Z+56, r24 ; 0x38 36c4a: 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; 36c4c: a3 01 movw r20, r6 36c4e: 92 01 movw r18, r4 36c50: 69 ad ldd r22, Y+57 ; 0x39 36c52: 7a ad ldd r23, Y+58 ; 0x3a 36c54: 8b ad ldd r24, Y+59 ; 0x3b 36c56: 9c ad ldd r25, Y+60 ; 0x3c 36c58: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 36c5c: 69 a7 std Y+41, r22 ; 0x29 36c5e: 7a a7 std Y+42, r23 ; 0x2a 36c60: 8b a7 std Y+43, r24 ; 0x2b 36c62: 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) 36c64: 2e 96 adiw r28, 0x0e ; 14 36c66: 2c ad ldd r18, Y+60 ; 0x3c 36c68: 3d ad ldd r19, Y+61 ; 0x3d 36c6a: 4e ad ldd r20, Y+62 ; 0x3e 36c6c: 5f ad ldd r21, Y+63 ; 0x3f 36c6e: 2e 97 sbiw r28, 0x0e ; 14 36c70: 23 2b or r18, r19 36c72: 24 2b or r18, r20 36c74: 25 2b or r18, r21 36c76: 09 f0 breq .+2 ; 0x36c7a 36c78: b9 c5 rjmp .+2930 ; 0x377ec 36c7a: 8e e6 ldi r24, 0x6E ; 110 36c7c: 82 9d mul r24, r2 36c7e: 80 01 movw r16, r0 36c80: 83 9d mul r24, r3 36c82: 10 0d add r17, r0 36c84: 11 24 eor r1, r1 36c86: 0c 53 subi r16, 0x3C ; 60 36c88: 19 4f sbci r17, 0xF9 ; 249 36c8a: f8 01 movw r30, r16 36c8c: 84 81 ldd r24, Z+4 ; 0x04 36c8e: 95 81 ldd r25, Z+5 ; 0x05 36c90: a6 81 ldd r26, Z+6 ; 0x06 36c92: b7 81 ldd r27, Z+7 ; 0x07 36c94: 89 2b or r24, r25 36c96: 8a 2b or r24, r26 36c98: 8b 2b or r24, r27 36c9a: 09 f0 breq .+2 ; 0x36c9e 36c9c: a7 c5 rjmp .+2894 ; 0x377ec 36c9e: 80 85 ldd r24, Z+8 ; 0x08 36ca0: 91 85 ldd r25, Z+9 ; 0x09 36ca2: a2 85 ldd r26, Z+10 ; 0x0a 36ca4: b3 85 ldd r27, Z+11 ; 0x0b 36ca6: 89 2b or r24, r25 36ca8: 8a 2b or r24, r26 36caa: 8b 2b or r24, r27 36cac: 09 f0 breq .+2 ; 0x36cb0 36cae: 9e c5 rjmp .+2876 ; 0x377ec { accel = ceil(cs.retract_acceleration * steps_per_mm); // convert to: acceleration steps/sec^2 36cb0: 20 91 f5 0d lds r18, 0x0DF5 ; 0x800df5 36cb4: 30 91 f6 0d lds r19, 0x0DF6 ; 0x800df6 36cb8: 40 91 f7 0d lds r20, 0x0DF7 ; 0x800df7 36cbc: 50 91 f8 0d lds r21, 0x0DF8 ; 0x800df8 36cc0: 69 a5 ldd r22, Y+41 ; 0x29 36cc2: 7a a5 ldd r23, Y+42 ; 0x2a 36cc4: 8b a5 ldd r24, Y+43 ; 0x2b 36cc6: 9c a5 ldd r25, Y+44 ; 0x2c 36cc8: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 36ccc: 0f 94 dd dd call 0x3bbba ; 0x3bbba 36cd0: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 36cd4: 2b 01 movw r4, r22 36cd6: 3c 01 movw r6, r24 #ifdef LIN_ADVANCE block->use_advance_lead = false; 36cd8: f8 01 movw r30, r16 36cda: e4 5b subi r30, 0xB4 ; 180 36cdc: ff 4f sbci r31, 0xFF ; 255 36cde: 10 82 st Z, r1 block->nominal_speed *= speed_factor; block->nominal_rate *= speed_factor; } #ifdef LIN_ADVANCE float e_D_ratio = 0; 36ce0: 6a 96 adiw r28, 0x1a ; 26 36ce2: 1c ae std Y+60, r1 ; 0x3c 36ce4: 1d ae std Y+61, r1 ; 0x3d 36ce6: 1e ae std Y+62, r1 ; 0x3e 36ce8: 1f ae std Y+63, r1 ; 0x3f 36cea: 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; 36cec: 8e e6 ldi r24, 0x6E ; 110 36cee: 82 9d mul r24, r2 36cf0: 80 01 movw r16, r0 36cf2: 83 9d mul r24, r3 36cf4: 10 0d add r17, r0 36cf6: 11 24 eor r1, r1 36cf8: 0c 53 subi r16, 0x3C ; 60 36cfa: 19 4f sbci r17, 0xF9 ; 249 36cfc: f8 01 movw r30, r16 36cfe: ee 5b subi r30, 0xBE ; 190 36d00: ff 4f sbci r31, 0xFF ; 255 36d02: 40 82 st Z, r4 36d04: 51 82 std Z+1, r5 ; 0x01 36d06: 62 82 std Z+2, r6 ; 0x02 36d08: 73 82 std Z+3, r7 ; 0x03 block->acceleration = accel / steps_per_mm; 36d0a: c3 01 movw r24, r6 36d0c: b2 01 movw r22, r4 36d0e: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 36d12: 6b 01 movw r12, r22 36d14: 7c 01 movw r14, r24 36d16: 29 a5 ldd r18, Y+41 ; 0x29 36d18: 3a a5 ldd r19, Y+42 ; 0x2a 36d1a: 4b a5 ldd r20, Y+43 ; 0x2b 36d1c: 5c a5 ldd r21, Y+44 ; 0x2c 36d1e: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 36d22: e2 96 adiw r28, 0x32 ; 50 36d24: 6c af std Y+60, r22 ; 0x3c 36d26: 7d af std Y+61, r23 ; 0x3d 36d28: 8e af std Y+62, r24 ; 0x3e 36d2a: 9f af std Y+63, r25 ; 0x3f 36d2c: e2 97 sbiw r28, 0x32 ; 50 36d2e: f8 01 movw r30, r16 36d30: 61 ab std Z+49, r22 ; 0x31 36d32: 72 ab std Z+50, r23 ; 0x32 36d34: 83 ab std Z+51, r24 ; 0x33 36d36: 94 ab std Z+52, r25 ; 0x34 block->acceleration_rate = (uint32_t)(accel * (float(1UL << 24) / ((F_CPU) / 8.0f))); 36d38: 2d eb ldi r18, 0xBD ; 189 36d3a: 37 e3 ldi r19, 0x37 ; 55 36d3c: 46 e0 ldi r20, 0x06 ; 6 36d3e: 51 e4 ldi r21, 0x41 ; 65 36d40: c7 01 movw r24, r14 36d42: b6 01 movw r22, r12 36d44: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 36d48: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 36d4c: d8 01 movw r26, r16 36d4e: 54 96 adiw r26, 0x14 ; 20 36d50: 6d 93 st X+, r22 36d52: 7d 93 st X+, r23 36d54: 8d 93 st X+, r24 36d56: 9c 93 st X, r25 36d58: 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; 36d5a: 91 96 adiw r26, 0x21 ; 33 36d5c: bc 91 ld r27, X 36d5e: 27 96 adiw r28, 0x07 ; 7 36d60: bf af std Y+63, r27 ; 0x3f 36d62: 27 97 sbiw r28, 0x07 ; 7 36d64: f8 01 movw r30, r16 36d66: f2 a1 ldd r31, Z+34 ; 0x22 36d68: 2b 96 adiw r28, 0x0b ; 11 36d6a: ff af std Y+63, r31 ; 0x3f 36d6c: 2b 97 sbiw r28, 0x0b ; 11 36d6e: d8 01 movw r26, r16 36d70: 93 96 adiw r26, 0x23 ; 35 36d72: bc 91 ld r27, X 36d74: 2f 96 adiw r28, 0x0f ; 15 36d76: bf af std Y+63, r27 ; 0x3f 36d78: 2f 97 sbiw r28, 0x0f ; 15 36d7a: f8 01 movw r30, r16 36d7c: f4 a1 ldd r31, Z+36 ; 0x24 36d7e: 63 96 adiw r28, 0x13 ; 19 36d80: ff af std Y+63, r31 ; 0x3f 36d82: 63 97 sbiw r28, 0x13 ; 19 36d84: 25 e0 ldi r18, 0x05 ; 5 36d86: 3e e0 ldi r19, 0x0E ; 14 36d88: ee 96 adiw r28, 0x3e ; 62 36d8a: 3f af std Y+63, r19 ; 0x3f 36d8c: 2e af std Y+62, r18 ; 0x3e 36d8e: ee 97 sbiw r28, 0x3e ; 62 36d90: a0 96 adiw r28, 0x20 ; 32 36d92: 4e ac ldd r4, Y+62 ; 0x3e 36d94: 5f ac ldd r5, Y+63 ; 0x3f 36d96: a0 97 sbiw r28, 0x20 ; 32 36d98: 30 e1 ldi r19, 0x10 ; 16 36d9a: 43 0e add r4, r19 36d9c: 51 1c adc r5, r1 36d9e: 05 e0 ldi r16, 0x05 ; 5 36da0: 1e e0 ldi r17, 0x0E ; 14 36da2: a0 96 adiw r28, 0x20 ; 32 36da4: 6e ac ldd r6, Y+62 ; 0x3e 36da6: 7f ac ldd r7, Y+63 ; 0x3f 36da8: a0 97 sbiw r28, 0x20 ; 32 36daa: 27 96 adiw r28, 0x07 ; 7 36dac: 4f ad ldd r20, Y+63 ; 0x3f 36dae: 27 97 sbiw r28, 0x07 ; 7 36db0: 49 a7 std Y+41, r20 ; 0x29 36db2: 2b 96 adiw r28, 0x0b ; 11 36db4: 5f ad ldd r21, Y+63 ; 0x3f 36db6: 2b 97 sbiw r28, 0x0b ; 11 36db8: 5d a7 std Y+45, r21 ; 0x2d 36dba: b9 ab std Y+49, r27 ; 0x31 36dbc: f9 af std Y+57, r31 ; 0x39 bool limited = false; 36dbe: 1d aa std Y+53, r1 ; 0x35 for (uint8_t axis = 0; axis < 4; ++ axis) { float jerk = fabs(current_speed[axis]); 36dc0: d3 01 movw r26, r6 36dc2: 8d 90 ld r8, X+ 36dc4: 9d 90 ld r9, X+ 36dc6: ad 90 ld r10, X+ 36dc8: bd 90 ld r11, X+ 36dca: 3d 01 movw r6, r26 36dcc: e8 94 clt 36dce: b7 f8 bld r11, 7 if (jerk > cs.max_jerk[axis]) { 36dd0: f8 01 movw r30, r16 36dd2: c1 90 ld r12, Z+ 36dd4: d1 90 ld r13, Z+ 36dd6: e1 90 ld r14, Z+ 36dd8: f1 90 ld r15, Z+ 36dda: 8f 01 movw r16, r30 36ddc: a5 01 movw r20, r10 36dde: 94 01 movw r18, r8 36de0: c7 01 movw r24, r14 36de2: b6 01 movw r22, r12 36de4: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 36de8: 87 ff sbrs r24, 7 36dea: 3a c0 rjmp .+116 ; 0x36e60 // The actual jerk is lower, if it has been limited by the XY jerk. if (limited) { 36dec: fd a9 ldd r31, Y+53 ; 0x35 36dee: ff 23 and r31, r31 36df0: 09 f4 brne .+2 ; 0x36df4 36df2: 7e c6 rjmp .+3324 ; 0x37af0 // 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; 36df4: 29 a5 ldd r18, Y+41 ; 0x29 36df6: 3d a5 ldd r19, Y+45 ; 0x2d 36df8: 49 a9 ldd r20, Y+49 ; 0x31 36dfa: 59 ad ldd r21, Y+57 ; 0x39 36dfc: c5 01 movw r24, r10 36dfe: b4 01 movw r22, r8 36e00: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 36e04: 4b 01 movw r8, r22 36e06: 5c 01 movw r10, r24 float mjerk = cs.max_jerk[axis] * block->nominal_speed; 36e08: a7 01 movw r20, r14 36e0a: 96 01 movw r18, r12 36e0c: 27 96 adiw r28, 0x07 ; 7 36e0e: 6f ad ldd r22, Y+63 ; 0x3f 36e10: 27 97 sbiw r28, 0x07 ; 7 36e12: 2b 96 adiw r28, 0x0b ; 11 36e14: 7f ad ldd r23, Y+63 ; 0x3f 36e16: 2b 97 sbiw r28, 0x0b ; 11 36e18: 2f 96 adiw r28, 0x0f ; 15 36e1a: 8f ad ldd r24, Y+63 ; 0x3f 36e1c: 2f 97 sbiw r28, 0x0f ; 15 36e1e: 63 96 adiw r28, 0x13 ; 19 36e20: 9f ad ldd r25, Y+63 ; 0x3f 36e22: 63 97 sbiw r28, 0x13 ; 19 36e24: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 36e28: 6b 01 movw r12, r22 36e2a: 7c 01 movw r14, r24 if (jerk > mjerk) { 36e2c: ac 01 movw r20, r24 36e2e: 9b 01 movw r18, r22 36e30: c5 01 movw r24, r10 36e32: b4 01 movw r22, r8 36e34: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 36e38: 18 16 cp r1, r24 36e3a: 94 f4 brge .+36 ; 0x36e60 safe_speed *= mjerk / jerk; 36e3c: a5 01 movw r20, r10 36e3e: 94 01 movw r18, r8 36e40: c7 01 movw r24, r14 36e42: b6 01 movw r22, r12 36e44: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 36e48: 9b 01 movw r18, r22 36e4a: ac 01 movw r20, r24 36e4c: 69 a5 ldd r22, Y+41 ; 0x29 36e4e: 7d a5 ldd r23, Y+45 ; 0x2d 36e50: 89 a9 ldd r24, Y+49 ; 0x31 36e52: 99 ad ldd r25, Y+57 ; 0x39 36e54: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 36e58: 69 a7 std Y+41, r22 ; 0x29 36e5a: 7d a7 std Y+45, r23 ; 0x2d 36e5c: 89 ab std Y+49, r24 ; 0x31 36e5e: 99 af std Y+57, r25 ; 0x39 // 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) { 36e60: 46 14 cp r4, r6 36e62: 57 04 cpc r5, r7 36e64: 09 f0 breq .+2 ; 0x36e68 36e66: ac cf rjmp .-168 ; 0x36dc0 } } } // Reset the block flag. block->flag = 0; 36e68: 8e e6 ldi r24, 0x6E ; 110 36e6a: 82 9d mul r24, r2 36e6c: f0 01 movw r30, r0 36e6e: 83 9d mul r24, r3 36e70: f0 0d add r31, r0 36e72: 11 24 eor r1, r1 36e74: ec 53 subi r30, 0x3C ; 60 36e76: f9 4f sbci r31, 0xF9 ; 249 36e78: 15 aa std Z+53, r1 ; 0x35 if (plan_reset_next_e_sched) 36e7a: 80 91 b6 04 lds r24, 0x04B6 ; 0x8004b6 <_ZL23plan_reset_next_e_sched.lto_priv.487> 36e7e: 88 23 and r24, r24 36e80: 21 f0 breq .+8 ; 0x36e8a { // finally propagate a pending reset block->flag |= BLOCK_FLAG_E_RESET; 36e82: 80 e1 ldi r24, 0x10 ; 16 36e84: 85 ab std Z+53, r24 ; 0x35 plan_reset_next_e_sched = false; 36e86: 10 92 b6 04 sts 0x04B6, r1 ; 0x8004b6 <_ZL23plan_reset_next_e_sched.lto_priv.487> 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) { 36e8a: 3d ad ldd r19, Y+61 ; 0x3d 36e8c: 32 30 cpi r19, 0x02 ; 2 36e8e: 08 f4 brcc .+2 ; 0x36e92 36e90: 8f c6 rjmp .+3358 ; 0x37bb0 36e92: 40 91 b8 04 lds r20, 0x04B8 ; 0x8004b8 <_ZL22previous_nominal_speed.lto_priv.488> 36e96: 6b 96 adiw r28, 0x1b ; 27 36e98: 4f af std Y+63, r20 ; 0x3f 36e9a: 6b 97 sbiw r28, 0x1b ; 27 36e9c: 50 91 b9 04 lds r21, 0x04B9 ; 0x8004b9 <_ZL22previous_nominal_speed.lto_priv.488+0x1> 36ea0: 6d 96 adiw r28, 0x1d ; 29 36ea2: 5f af std Y+63, r21 ; 0x3f 36ea4: 6d 97 sbiw r28, 0x1d ; 29 36ea6: 00 91 ba 04 lds r16, 0x04BA ; 0x8004ba <_ZL22previous_nominal_speed.lto_priv.488+0x2> 36eaa: 10 91 bb 04 lds r17, 0x04BB ; 0x8004bb <_ZL22previous_nominal_speed.lto_priv.488+0x3> 36eae: 27 e1 ldi r18, 0x17 ; 23 36eb0: 37 eb ldi r19, 0xB7 ; 183 36eb2: 41 ed ldi r20, 0xD1 ; 209 36eb4: 58 e3 ldi r21, 0x38 ; 56 36eb6: 6b 96 adiw r28, 0x1b ; 27 36eb8: 6f ad ldd r22, Y+63 ; 0x3f 36eba: 6b 97 sbiw r28, 0x1b ; 27 36ebc: 6d 96 adiw r28, 0x1d ; 29 36ebe: 7f ad ldd r23, Y+63 ; 0x3f 36ec0: 6d 97 sbiw r28, 0x1d ; 29 36ec2: c8 01 movw r24, r16 36ec4: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 36ec8: 18 16 cp r1, r24 36eca: 0c f0 brlt .+2 ; 0x36ece 36ecc: 71 c6 rjmp .+3298 ; 0x37bb0 // 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); 36ece: 6b 96 adiw r28, 0x1b ; 27 36ed0: 2f ad ldd r18, Y+63 ; 0x3f 36ed2: 6b 97 sbiw r28, 0x1b ; 27 36ed4: 6d 96 adiw r28, 0x1d ; 29 36ed6: 3f ad ldd r19, Y+63 ; 0x3f 36ed8: 6d 97 sbiw r28, 0x1d ; 29 36eda: a8 01 movw r20, r16 36edc: 27 96 adiw r28, 0x07 ; 7 36ede: 6f ad ldd r22, Y+63 ; 0x3f 36ee0: 27 97 sbiw r28, 0x07 ; 7 36ee2: 2b 96 adiw r28, 0x0b ; 11 36ee4: 7f ad ldd r23, Y+63 ; 0x3f 36ee6: 2b 97 sbiw r28, 0x0b ; 11 36ee8: 2f 96 adiw r28, 0x0f ; 15 36eea: 8f ad ldd r24, Y+63 ; 0x3f 36eec: 2f 97 sbiw r28, 0x0f ; 15 36eee: 63 96 adiw r28, 0x13 ; 19 36ef0: 9f ad ldd r25, Y+63 ; 0x3f 36ef2: 63 97 sbiw r28, 0x13 ; 19 36ef4: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 36ef8: 87 ff sbrs r24, 7 36efa: 01 c6 rjmp .+3074 ; 0x37afe 36efc: 6b 96 adiw r28, 0x1b ; 27 36efe: 2f ad ldd r18, Y+63 ; 0x3f 36f00: 6b 97 sbiw r28, 0x1b ; 27 36f02: 6d 96 adiw r28, 0x1d ; 29 36f04: 3f ad ldd r19, Y+63 ; 0x3f 36f06: 6d 97 sbiw r28, 0x1d ; 29 36f08: a8 01 movw r20, r16 36f0a: 27 96 adiw r28, 0x07 ; 7 36f0c: 6f ad ldd r22, Y+63 ; 0x3f 36f0e: 27 97 sbiw r28, 0x07 ; 7 36f10: 2b 96 adiw r28, 0x0b ; 11 36f12: 7f ad ldd r23, Y+63 ; 0x3f 36f14: 2b 97 sbiw r28, 0x0b ; 11 36f16: 2f 96 adiw r28, 0x0f ; 15 36f18: 8f ad ldd r24, Y+63 ; 0x3f 36f1a: 2f 97 sbiw r28, 0x0f ; 15 36f1c: 63 96 adiw r28, 0x13 ; 19 36f1e: 9f ad ldd r25, Y+63 ; 0x3f 36f20: 63 97 sbiw r28, 0x13 ; 19 36f22: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 36f26: ec 96 adiw r28, 0x3c ; 60 36f28: 6c af std Y+60, r22 ; 0x3c 36f2a: 7d af std Y+61, r23 ; 0x3d 36f2c: 8e af std Y+62, r24 ; 0x3e 36f2e: 9f af std Y+63, r25 ; 0x3f 36f30: ec 97 sbiw r28, 0x3c ; 60 // 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; 36f32: 27 96 adiw r28, 0x07 ; 7 36f34: 8f ad ldd r24, Y+63 ; 0x3f 36f36: 27 97 sbiw r28, 0x07 ; 7 36f38: 8d af std Y+61, r24 ; 0x3d 36f3a: 2b 96 adiw r28, 0x0b ; 11 36f3c: 9f ad ldd r25, Y+63 ; 0x3f 36f3e: 2b 97 sbiw r28, 0x0b ; 11 36f40: 9d ab std Y+53, r25 ; 0x35 36f42: 2f 96 adiw r28, 0x0f ; 15 36f44: af ad ldd r26, Y+63 ; 0x3f 36f46: 2f 97 sbiw r28, 0x0f ; 15 36f48: ae af std Y+62, r26 ; 0x3e 36f4a: 63 96 adiw r28, 0x13 ; 19 36f4c: bf ad ldd r27, Y+63 ; 0x3f 36f4e: 63 97 sbiw r28, 0x13 ; 19 36f50: 23 96 adiw r28, 0x03 ; 3 36f52: bf af std Y+63, r27 ; 0x3f 36f54: 23 97 sbiw r28, 0x03 ; 3 36f56: 2c eb ldi r18, 0xBC ; 188 36f58: 34 e0 ldi r19, 0x04 ; 4 36f5a: e8 96 adiw r28, 0x38 ; 56 36f5c: 3f af std Y+63, r19 ; 0x3f 36f5e: 2e af std Y+62, r18 ; 0x3e 36f60: e8 97 sbiw r28, 0x38 ; 56 // Factor to multiply the previous / current nominal velocities to get componentwise limited velocities. float v_factor = 1.f; 36f62: 41 2c mov r4, r1 36f64: 51 2c mov r5, r1 36f66: 30 e8 ldi r19, 0x80 ; 128 36f68: 63 2e mov r6, r19 36f6a: 3f e3 ldi r19, 0x3F ; 63 36f6c: 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]; 36f6e: e8 96 adiw r28, 0x38 ; 56 36f70: ae ad ldd r26, Y+62 ; 0x3e 36f72: bf ad ldd r27, Y+63 ; 0x3f 36f74: e8 97 sbiw r28, 0x38 ; 56 36f76: 8d 90 ld r8, X+ 36f78: 9d 90 ld r9, X+ 36f7a: ad 90 ld r10, X+ 36f7c: bd 90 ld r11, X+ 36f7e: e8 96 adiw r28, 0x38 ; 56 36f80: bf af std Y+63, r27 ; 0x3f 36f82: ae af std Y+62, r26 ; 0x3e 36f84: e8 97 sbiw r28, 0x38 ; 56 float v_entry = current_speed [axis]; 36f86: a0 96 adiw r28, 0x20 ; 32 36f88: ee ad ldd r30, Y+62 ; 0x3e 36f8a: ff ad ldd r31, Y+63 ; 0x3f 36f8c: a0 97 sbiw r28, 0x20 ; 32 36f8e: c1 90 ld r12, Z+ 36f90: d1 90 ld r13, Z+ 36f92: e1 90 ld r14, Z+ 36f94: f1 90 ld r15, Z+ 36f96: a0 96 adiw r28, 0x20 ; 32 36f98: ff af std Y+63, r31 ; 0x3f 36f9a: ee af std Y+62, r30 ; 0x3e 36f9c: a0 97 sbiw r28, 0x20 ; 32 if (prev_speed_larger) 36f9e: 6b 96 adiw r28, 0x1b ; 27 36fa0: 2f ad ldd r18, Y+63 ; 0x3f 36fa2: 6b 97 sbiw r28, 0x1b ; 27 36fa4: 6d 96 adiw r28, 0x1d ; 29 36fa6: 3f ad ldd r19, Y+63 ; 0x3f 36fa8: 6d 97 sbiw r28, 0x1d ; 29 36faa: a8 01 movw r20, r16 36fac: 27 96 adiw r28, 0x07 ; 7 36fae: 6f ad ldd r22, Y+63 ; 0x3f 36fb0: 27 97 sbiw r28, 0x07 ; 7 36fb2: 2b 96 adiw r28, 0x0b ; 11 36fb4: 7f ad ldd r23, Y+63 ; 0x3f 36fb6: 2b 97 sbiw r28, 0x0b ; 11 36fb8: 2f 96 adiw r28, 0x0f ; 15 36fba: 8f ad ldd r24, Y+63 ; 0x3f 36fbc: 2f 97 sbiw r28, 0x0f ; 15 36fbe: 63 96 adiw r28, 0x13 ; 19 36fc0: 9f ad ldd r25, Y+63 ; 0x3f 36fc2: 63 97 sbiw r28, 0x13 ; 19 36fc4: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 36fc8: 87 ff sbrs r24, 7 36fca: 0c c0 rjmp .+24 ; 0x36fe4 v_exit *= smaller_speed_factor; 36fcc: ec 96 adiw r28, 0x3c ; 60 36fce: 2c ad ldd r18, Y+60 ; 0x3c 36fd0: 3d ad ldd r19, Y+61 ; 0x3d 36fd2: 4e ad ldd r20, Y+62 ; 0x3e 36fd4: 5f ad ldd r21, Y+63 ; 0x3f 36fd6: ec 97 sbiw r28, 0x3c ; 60 36fd8: c5 01 movw r24, r10 36fda: b4 01 movw r22, r8 36fdc: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 36fe0: 4b 01 movw r8, r22 36fe2: 5c 01 movw r10, r24 if (limited) { 36fe4: a2 96 adiw r28, 0x22 ; 34 36fe6: ff ad ldd r31, Y+63 ; 0x3f 36fe8: a2 97 sbiw r28, 0x22 ; 34 36fea: ff 23 and r31, r31 36fec: 81 f0 breq .+32 ; 0x3700e v_exit *= v_factor; 36fee: a3 01 movw r20, r6 36ff0: 92 01 movw r18, r4 36ff2: c5 01 movw r24, r10 36ff4: b4 01 movw r22, r8 36ff6: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 36ffa: 4b 01 movw r8, r22 36ffc: 5c 01 movw r10, r24 v_entry *= v_factor; 36ffe: a3 01 movw r20, r6 37000: 92 01 movw r18, r4 37002: c7 01 movw r24, r14 37004: b6 01 movw r22, r12 37006: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 3700a: 6b 01 movw r12, r22 3700c: 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) ? 3700e: a7 01 movw r20, r14 37010: 96 01 movw r18, r12 37012: c5 01 movw r24, r10 37014: b4 01 movw r22, r8 37016: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> ((v_entry > 0.f || v_exit < 0.f) ? 3701a: 20 e0 ldi r18, 0x00 ; 0 3701c: 30 e0 ldi r19, 0x00 ; 0 3701e: 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) ? 37020: 18 16 cp r1, r24 37022: 0c f0 brlt .+2 ; 0x37026 37024: a3 c5 rjmp .+2886 ; 0x37b6c ((v_entry > 0.f || v_exit < 0.f) ? 37026: c7 01 movw r24, r14 37028: b6 01 movw r22, r12 3702a: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 3702e: 18 16 cp r1, r24 37030: 4c f0 brlt .+18 ; 0x37044 37032: 20 e0 ldi r18, 0x00 ; 0 37034: 30 e0 ldi r19, 0x00 ; 0 37036: a9 01 movw r20, r18 37038: c5 01 movw r24, r10 3703a: b4 01 movw r22, r8 3703c: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 37040: 87 ff sbrs r24, 7 37042: 85 c5 rjmp .+2826 ; 0x37b4e 37044: a7 01 movw r20, r14 37046: 96 01 movw r18, r12 37048: c5 01 movw r24, r10 3704a: 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) ? 3704c: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 37050: 6b 01 movw r12, r22 37052: 7c 01 movw r14, r24 // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); if (jerk > cs.max_jerk[axis]) { 37054: ee 96 adiw r28, 0x3e ; 62 37056: ae ad ldd r26, Y+62 ; 0x3e 37058: bf ad ldd r27, Y+63 ; 0x3f 3705a: ee 97 sbiw r28, 0x3e ; 62 3705c: 8d 90 ld r8, X+ 3705e: 9d 90 ld r9, X+ 37060: ad 90 ld r10, X+ 37062: bd 90 ld r11, X+ 37064: ee 96 adiw r28, 0x3e ; 62 37066: bf af std Y+63, r27 ; 0x3f 37068: ae af std Y+62, r26 ; 0x3e 3706a: ee 97 sbiw r28, 0x3e ; 62 3706c: a5 01 movw r20, r10 3706e: 94 01 movw r18, r8 37070: c7 01 movw r24, r14 37072: b6 01 movw r22, r12 37074: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 37078: 18 16 cp r1, r24 3707a: 94 f4 brge .+36 ; 0x370a0 v_factor *= cs.max_jerk[axis] / jerk; 3707c: a7 01 movw r20, r14 3707e: 96 01 movw r18, r12 37080: c5 01 movw r24, r10 37082: b4 01 movw r22, r8 37084: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 37088: 9b 01 movw r18, r22 3708a: ac 01 movw r20, r24 3708c: c3 01 movw r24, r6 3708e: b2 01 movw r22, r4 37090: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 37094: 2b 01 movw r4, r22 37096: 3c 01 movw r6, r24 limited = true; 37098: b1 e0 ldi r27, 0x01 ; 1 3709a: a2 96 adiw r28, 0x22 ; 34 3709c: bf af std Y+63, r27 ; 0x3f 3709e: a2 97 sbiw r28, 0x22 ; 34 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) { 370a0: ec ec ldi r30, 0xCC ; 204 370a2: f4 e0 ldi r31, 0x04 ; 4 370a4: e8 96 adiw r28, 0x38 ; 56 370a6: 2e ad ldd r18, Y+62 ; 0x3e 370a8: 3f ad ldd r19, Y+63 ; 0x3f 370aa: e8 97 sbiw r28, 0x38 ; 56 370ac: e2 17 cp r30, r18 370ae: f3 07 cpc r31, r19 370b0: 09 f0 breq .+2 ; 0x370b4 370b2: 5d cf rjmp .-326 ; 0x36f6e if (jerk > cs.max_jerk[axis]) { v_factor *= cs.max_jerk[axis] / jerk; limited = true; } } if (limited) 370b4: a2 96 adiw r28, 0x22 ; 34 370b6: 3f ad ldd r19, Y+63 ; 0x3f 370b8: a2 97 sbiw r28, 0x22 ; 34 370ba: 33 23 and r19, r19 370bc: 81 f0 breq .+32 ; 0x370de vmax_junction *= v_factor; 370be: a3 01 movw r20, r6 370c0: 92 01 movw r18, r4 370c2: 6d ad ldd r22, Y+61 ; 0x3d 370c4: 7d a9 ldd r23, Y+53 ; 0x35 370c6: 8e ad ldd r24, Y+62 ; 0x3e 370c8: 23 96 adiw r28, 0x03 ; 3 370ca: 9f ad ldd r25, Y+63 ; 0x3f 370cc: 23 97 sbiw r28, 0x03 ; 3 370ce: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 370d2: 6d af std Y+61, r22 ; 0x3d 370d4: 7d ab std Y+53, r23 ; 0x35 370d6: 8e af std Y+62, r24 ; 0x3e 370d8: 23 96 adiw r28, 0x03 ; 3 370da: 9f af std Y+63, r25 ; 0x3f 370dc: 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; 370de: 24 ea ldi r18, 0xA4 ; 164 370e0: 30 e7 ldi r19, 0x70 ; 112 370e2: 4d e7 ldi r20, 0x7D ; 125 370e4: 5f e3 ldi r21, 0x3F ; 63 370e6: 6d ad ldd r22, Y+61 ; 0x3d 370e8: 7d a9 ldd r23, Y+53 ; 0x35 370ea: 8e ad ldd r24, Y+62 ; 0x3e 370ec: 23 96 adiw r28, 0x03 ; 3 370ee: 9f ad ldd r25, Y+63 ; 0x3f 370f0: 23 97 sbiw r28, 0x03 ; 3 370f2: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 370f6: 6b 01 movw r12, r22 370f8: 7c 01 movw r14, r24 if (previous_safe_speed > vmax_junction_threshold && safe_speed > vmax_junction_threshold) { 370fa: ac 01 movw r20, r24 370fc: 9b 01 movw r18, r22 370fe: 60 91 0f 18 lds r22, 0x180F ; 0x80180f 37102: 70 91 10 18 lds r23, 0x1810 ; 0x801810 37106: 80 91 11 18 lds r24, 0x1811 ; 0x801811 3710a: 90 91 12 18 lds r25, 0x1812 ; 0x801812 3710e: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 37112: 18 16 cp r1, r24 37114: fc f4 brge .+62 ; 0x37154 37116: 29 a5 ldd r18, Y+41 ; 0x29 37118: 3d a5 ldd r19, Y+45 ; 0x2d 3711a: 49 a9 ldd r20, Y+49 ; 0x31 3711c: 59 ad ldd r21, Y+57 ; 0x39 3711e: c7 01 movw r24, r14 37120: b6 01 movw r22, r12 37122: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 37126: 87 ff sbrs r24, 7 37128: 15 c0 rjmp .+42 ; 0x37154 // 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; 3712a: 8e e6 ldi r24, 0x6E ; 110 3712c: 82 9d mul r24, r2 3712e: f0 01 movw r30, r0 37130: 83 9d mul r24, r3 37132: f0 0d add r31, r0 37134: 11 24 eor r1, r1 37136: ec 53 subi r30, 0x3C ; 60 37138: f9 4f sbci r31, 0xF9 ; 249 3713a: 85 a9 ldd r24, Z+53 ; 0x35 3713c: 84 60 ori r24, 0x04 ; 4 3713e: 85 ab std Z+53, r24 ; 0x35 37140: 49 a5 ldd r20, Y+41 ; 0x29 37142: 4d af std Y+61, r20 ; 0x3d 37144: 5d a5 ldd r21, Y+45 ; 0x2d 37146: 5d ab std Y+53, r21 ; 0x35 37148: 89 a9 ldd r24, Y+49 ; 0x31 3714a: 8e af std Y+62, r24 ; 0x3e 3714c: 99 ad ldd r25, Y+57 ; 0x39 3714e: 23 96 adiw r28, 0x03 ; 3 37150: 9f af std Y+63, r25 ; 0x3f 37152: 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; 37154: 8e e6 ldi r24, 0x6E ; 110 37156: 82 9d mul r24, r2 37158: 80 01 movw r16, r0 3715a: 83 9d mul r24, r3 3715c: 10 0d add r17, r0 3715e: 11 24 eor r1, r1 37160: 0c 53 subi r16, 0x3C ; 60 37162: 19 4f sbci r17, 0xF9 ; 249 37164: 8d ad ldd r24, Y+61 ; 0x3d 37166: 9d a9 ldd r25, Y+53 ; 0x35 37168: ae ad ldd r26, Y+62 ; 0x3e 3716a: 23 96 adiw r28, 0x03 ; 3 3716c: bf ad ldd r27, Y+63 ; 0x3f 3716e: 23 97 sbiw r28, 0x03 ; 3 37170: f8 01 movw r30, r16 37172: 81 a7 std Z+41, r24 ; 0x29 37174: 92 a7 std Z+42, r25 ; 0x2a 37176: a3 a7 std Z+43, r26 ; 0x2b 37178: 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); 3717a: 29 a5 ldd r18, Y+41 ; 0x29 3717c: 3d a5 ldd r19, Y+45 ; 0x2d 3717e: 49 a9 ldd r20, Y+49 ; 0x31 37180: 59 ad ldd r21, Y+57 ; 0x39 37182: 69 a5 ldd r22, Y+41 ; 0x29 37184: 7d a5 ldd r23, Y+45 ; 0x2d 37186: 89 a9 ldd r24, Y+49 ; 0x31 37188: 99 ad ldd r25, Y+57 ; 0x39 3718a: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 3718e: 6b 01 movw r12, r22 37190: 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); 37192: e2 96 adiw r28, 0x32 ; 50 37194: 6c ad ldd r22, Y+60 ; 0x3c 37196: 7d ad ldd r23, Y+61 ; 0x3d 37198: 8e ad ldd r24, Y+62 ; 0x3e 3719a: 9f ad ldd r25, Y+63 ; 0x3f 3719c: e2 97 sbiw r28, 0x32 ; 50 3719e: 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); 371a0: 9b 01 movw r18, r22 371a2: ac 01 movw r20, r24 371a4: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 371a8: d8 01 movw r26, r16 371aa: 9d 96 adiw r26, 0x2d ; 45 371ac: 2d 91 ld r18, X+ 371ae: 3d 91 ld r19, X+ 371b0: 4d 91 ld r20, X+ 371b2: 5c 91 ld r21, X 371b4: d0 97 sbiw r26, 0x30 ; 48 371b6: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 371ba: 9b 01 movw r18, r22 371bc: ac 01 movw r20, r24 371be: c7 01 movw r24, r14 371c0: b6 01 movw r22, r12 371c2: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 371c6: 0f 94 cd e0 call 0x3c19a ; 0x3c19a 371ca: d6 2e mov r13, r22 371cc: e7 2e mov r14, r23 371ce: 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); 371d0: 2d ad ldd r18, Y+61 ; 0x3d 371d2: 3d a9 ldd r19, Y+53 ; 0x35 371d4: 4e ad ldd r20, Y+62 ; 0x3e 371d6: 23 96 adiw r28, 0x03 ; 3 371d8: 5f ad ldd r21, Y+63 ; 0x3f 371da: 23 97 sbiw r28, 0x03 ; 3 371dc: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 371e0: 18 16 cp r1, r24 371e2: 34 f0 brlt .+12 ; 0x371f0 371e4: dd ae std Y+61, r13 ; 0x3d 371e6: ed aa std Y+53, r14 ; 0x35 371e8: 0e af std Y+62, r16 ; 0x3e 371ea: 23 96 adiw r28, 0x03 ; 3 371ec: 1f af std Y+63, r17 ; 0x3f 371ee: 23 97 sbiw r28, 0x03 ; 3 371f0: 8e e6 ldi r24, 0x6E ; 110 371f2: 82 9d mul r24, r2 371f4: f0 01 movw r30, r0 371f6: 83 9d mul r24, r3 371f8: f0 0d add r31, r0 371fa: 11 24 eor r1, r1 371fc: ec 53 subi r30, 0x3C ; 60 371fe: f9 4f sbci r31, 0xF9 ; 249 37200: 8d ad ldd r24, Y+61 ; 0x3d 37202: 9d a9 ldd r25, Y+53 ; 0x35 37204: ae ad ldd r26, Y+62 ; 0x3e 37206: 23 96 adiw r28, 0x03 ; 3 37208: bf ad ldd r27, Y+63 ; 0x3f 3720a: 23 97 sbiw r28, 0x03 ; 3 3720c: 85 a3 std Z+37, r24 ; 0x25 3720e: 96 a3 std Z+38, r25 ; 0x26 37210: a7 a3 std Z+39, r26 ; 0x27 37212: 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; 37214: f5 a8 ldd r15, Z+53 ; 0x35 37216: 2d 2d mov r18, r13 37218: 3e 2d mov r19, r14 3721a: a8 01 movw r20, r16 3721c: 27 96 adiw r28, 0x07 ; 7 3721e: 6f ad ldd r22, Y+63 ; 0x3f 37220: 27 97 sbiw r28, 0x07 ; 7 37222: 2b 96 adiw r28, 0x0b ; 11 37224: 7f ad ldd r23, Y+63 ; 0x3f 37226: 2b 97 sbiw r28, 0x0b ; 11 37228: 2f 96 adiw r28, 0x0f ; 15 3722a: 8f ad ldd r24, Y+63 ; 0x3f 3722c: 2f 97 sbiw r28, 0x0f ; 15 3722e: 63 96 adiw r28, 0x13 ; 19 37230: 9f ad ldd r25, Y+63 ; 0x3f 37232: 63 97 sbiw r28, 0x13 ; 19 37234: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 37238: 18 16 cp r1, r24 3723a: 0c f4 brge .+2 ; 0x3723e 3723c: cf c4 rjmp .+2462 ; 0x37bdc 3723e: 83 e0 ldi r24, 0x03 ; 3 37240: 9e e6 ldi r25, 0x6E ; 110 37242: 92 9d mul r25, r2 37244: 80 01 movw r16, r0 37246: 93 9d mul r25, r3 37248: 10 0d add r17, r0 3724a: 11 24 eor r1, r1 3724c: 0c 53 subi r16, 0x3C ; 60 3724e: 19 4f sbci r17, 0xF9 ; 249 37250: f8 2a or r15, r24 37252: f8 01 movw r30, r16 37254: 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[] 37256: 80 e1 ldi r24, 0x10 ; 16 37258: fe 01 movw r30, r28 3725a: 71 96 adiw r30, 0x11 ; 17 3725c: ac eb ldi r26, 0xBC ; 188 3725e: b4 e0 ldi r27, 0x04 ; 4 37260: 01 90 ld r0, Z+ 37262: 0d 92 st X+, r0 37264: 8a 95 dec r24 37266: e1 f7 brne .-8 ; 0x37260 previous_nominal_speed = block->nominal_speed; 37268: 27 96 adiw r28, 0x07 ; 7 3726a: 8f ad ldd r24, Y+63 ; 0x3f 3726c: 27 97 sbiw r28, 0x07 ; 7 3726e: 2b 96 adiw r28, 0x0b ; 11 37270: 9f ad ldd r25, Y+63 ; 0x3f 37272: 2b 97 sbiw r28, 0x0b ; 11 37274: 2f 96 adiw r28, 0x0f ; 15 37276: af ad ldd r26, Y+63 ; 0x3f 37278: 2f 97 sbiw r28, 0x0f ; 15 3727a: 63 96 adiw r28, 0x13 ; 19 3727c: bf ad ldd r27, Y+63 ; 0x3f 3727e: 63 97 sbiw r28, 0x13 ; 19 37280: 80 93 b8 04 sts 0x04B8, r24 ; 0x8004b8 <_ZL22previous_nominal_speed.lto_priv.488> 37284: 90 93 b9 04 sts 0x04B9, r25 ; 0x8004b9 <_ZL22previous_nominal_speed.lto_priv.488+0x1> 37288: a0 93 ba 04 sts 0x04BA, r26 ; 0x8004ba <_ZL22previous_nominal_speed.lto_priv.488+0x2> 3728c: b0 93 bb 04 sts 0x04BB, r27 ; 0x8004bb <_ZL22previous_nominal_speed.lto_priv.488+0x3> previous_safe_speed = safe_speed; 37290: 89 a5 ldd r24, Y+41 ; 0x29 37292: 9d a5 ldd r25, Y+45 ; 0x2d 37294: a9 a9 ldd r26, Y+49 ; 0x31 37296: b9 ad ldd r27, Y+57 ; 0x39 37298: 80 93 0f 18 sts 0x180F, r24 ; 0x80180f 3729c: 90 93 10 18 sts 0x1810, r25 ; 0x801810 372a0: a0 93 11 18 sts 0x1811, r26 ; 0x801811 372a4: b0 93 12 18 sts 0x1812, r27 ; 0x801812 // 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; 372a8: d8 01 movw r26, r16 372aa: d6 96 adiw r26, 0x36 ; 54 372ac: 6d 91 ld r22, X+ 372ae: 7d 91 ld r23, X+ 372b0: 8d 91 ld r24, X+ 372b2: 9c 91 ld r25, X 372b4: d9 97 sbiw r26, 0x39 ; 57 372b6: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 372ba: 27 96 adiw r28, 0x07 ; 7 372bc: 2f ad ldd r18, Y+63 ; 0x3f 372be: 27 97 sbiw r28, 0x07 ; 7 372c0: 2b 96 adiw r28, 0x0b ; 11 372c2: 3f ad ldd r19, Y+63 ; 0x3f 372c4: 2b 97 sbiw r28, 0x0b ; 11 372c6: 2f 96 adiw r28, 0x0f ; 15 372c8: 4f ad ldd r20, Y+63 ; 0x3f 372ca: 2f 97 sbiw r28, 0x0f ; 15 372cc: 63 96 adiw r28, 0x13 ; 19 372ce: 5f ad ldd r21, Y+63 ; 0x3f 372d0: 63 97 sbiw r28, 0x13 ; 19 372d2: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 372d6: 2b 01 movw r4, r22 372d8: 3c 01 movw r6, r24 372da: f8 01 movw r30, r16 372dc: e8 5b subi r30, 0xB8 ; 184 372de: ff 4f sbci r31, 0xFF ; 255 372e0: 40 82 st Z, r4 372e2: 51 82 std Z+1, r5 ; 0x01 372e4: 62 82 std Z+2, r6 ; 0x02 372e6: 73 82 std Z+3, r7 ; 0x03 #ifdef LIN_ADVANCE if (block->use_advance_lead) { 372e8: 34 96 adiw r30, 0x04 ; 4 372ea: 80 81 ld r24, Z 372ec: 88 23 and r24, r24 372ee: 09 f4 brne .+2 ; 0x372f2 372f0: 89 c0 rjmp .+274 ; 0x37404 // 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)) 372f2: 20 91 64 05 lds r18, 0x0564 ; 0x800564 372f6: 30 91 65 05 lds r19, 0x0565 ; 0x800565 372fa: 40 91 66 05 lds r20, 0x0566 ; 0x800566 372fe: 50 91 67 05 lds r21, 0x0567 ; 0x800567 37302: 6a 96 adiw r28, 0x1a ; 26 37304: 6c ad ldd r22, Y+60 ; 0x3c 37306: 7d ad ldd r23, Y+61 ; 0x3d 37308: 8e ad ldd r24, Y+62 ; 0x3e 3730a: 9f ad ldd r25, Y+63 ; 0x3f 3730c: 6a 97 sbiw r28, 0x1a ; 26 3730e: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 37312: 4b 01 movw r8, r22 37314: 5c 01 movw r10, r24 37316: c0 90 cd 0d lds r12, 0x0DCD ; 0x800dcd 3731a: d0 90 ce 0d lds r13, 0x0DCE ; 0x800dce 3731e: e0 90 cf 0d lds r14, 0x0DCF ; 0x800dcf 37322: f0 90 d0 0d lds r15, 0x0DD0 ; 0x800dd0 block->adv_comp = adv_comp / block->speed_factor; // step/(step/min) 37326: 0c 5a subi r16, 0xAC ; 172 37328: 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)) 3732a: a7 01 movw r20, r14 3732c: 96 01 movw r18, r12 3732e: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> block->adv_comp = adv_comp / block->speed_factor; // step/(step/min) 37332: a3 01 movw r20, r6 37334: 92 01 movw r18, r4 37336: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 3733a: f8 01 movw r30, r16 3733c: 60 83 st Z, r22 3733e: 71 83 std Z+1, r23 ; 0x01 37340: 82 83 std Z+2, r24 ; 0x02 37342: 93 83 std Z+3, r25 ; 0x03 float advance_speed; if (e_D_ratio > 0) 37344: 20 e0 ldi r18, 0x00 ; 0 37346: 30 e0 ldi r19, 0x00 ; 0 37348: a9 01 movw r20, r18 3734a: 6a 96 adiw r28, 0x1a ; 26 3734c: 6c ad ldd r22, Y+60 ; 0x3c 3734e: 7d ad ldd r23, Y+61 ; 0x3d 37350: 8e ad ldd r24, Y+62 ; 0x3e 37352: 9f ad ldd r25, Y+63 ; 0x3f 37354: 6a 97 sbiw r28, 0x1a ; 26 37356: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 3735a: 18 16 cp r1, r24 3735c: 0c f0 brlt .+2 ; 0x37360 3735e: 40 c4 rjmp .+2176 ; 0x37be0 advance_speed = (extruder_advance_K * e_D_ratio * block->acceleration * cs.axis_steps_per_mm[E_AXIS]); 37360: a5 01 movw r20, r10 37362: 94 01 movw r18, r8 37364: e2 96 adiw r28, 0x32 ; 50 37366: 6c ad ldd r22, Y+60 ; 0x3c 37368: 7d ad ldd r23, Y+61 ; 0x3d 3736a: 8e ad ldd r24, Y+62 ; 0x3e 3736c: 9f ad ldd r25, Y+63 ; 0x3f 3736e: e2 97 sbiw r28, 0x32 ; 50 37370: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 37374: a7 01 movw r20, r14 37376: 96 01 movw r18, r12 else advance_speed = cs.max_jerk[E_AXIS] * cs.axis_steps_per_mm[E_AXIS]; 37378: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 3737c: 6b 01 movw r12, r22 3737e: 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; 37380: 20 e0 ldi r18, 0x00 ; 0 37382: 30 e4 ldi r19, 0x40 ; 64 37384: 4c e1 ldi r20, 0x1C ; 28 37386: 57 e4 ldi r21, 0x47 ; 71 37388: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 3738c: 18 16 cp r1, r24 3738e: 3c f4 brge .+14 ; 0x3739e 37390: c1 2c mov r12, r1 37392: 20 e4 ldi r18, 0x40 ; 64 37394: d2 2e mov r13, r18 37396: 2c e1 ldi r18, 0x1C ; 28 37398: e2 2e mov r14, r18 3739a: 27 e4 ldi r18, 0x47 ; 71 3739c: f2 2e mov r15, r18 float advance_rate = (F_CPU / 8.0) / advance_speed; 3739e: a7 01 movw r20, r14 373a0: 96 01 movw r18, r12 373a2: 60 e0 ldi r22, 0x00 ; 0 373a4: 74 e2 ldi r23, 0x24 ; 36 373a6: 84 ef ldi r24, 0xF4 ; 244 373a8: 99 e4 ldi r25, 0x49 ; 73 373aa: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 373ae: 4b 01 movw r8, r22 373b0: 5c 01 movw r10, r24 if (advance_speed > 20000) { 373b2: 20 e0 ldi r18, 0x00 ; 0 373b4: 30 e4 ldi r19, 0x40 ; 64 373b6: 4c e9 ldi r20, 0x9C ; 156 373b8: 56 e4 ldi r21, 0x46 ; 70 373ba: c7 01 movw r24, r14 373bc: b6 01 movw r22, r12 373be: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 373c2: 18 16 cp r1, r24 373c4: 0c f0 brlt .+2 ; 0x373c8 373c6: 17 c4 rjmp .+2094 ; 0x37bf6 block->advance_rate = advance_rate * 4; 373c8: 8e e6 ldi r24, 0x6E ; 110 373ca: 82 9d mul r24, r2 373cc: 80 01 movw r16, r0 373ce: 83 9d mul r24, r3 373d0: 10 0d add r17, r0 373d2: 11 24 eor r1, r1 373d4: 0c 53 subi r16, 0x3C ; 60 373d6: 19 4f sbci r17, 0xF9 ; 249 373d8: 78 01 movw r14, r16 373da: fd e4 ldi r31, 0x4D ; 77 373dc: ef 0e add r14, r31 373de: f1 1c adc r15, r1 373e0: 20 e0 ldi r18, 0x00 ; 0 373e2: 30 e0 ldi r19, 0x00 ; 0 373e4: 40 e8 ldi r20, 0x80 ; 128 373e6: 50 e4 ldi r21, 0x40 ; 64 373e8: c5 01 movw r24, r10 373ea: b4 01 movw r22, r8 373ec: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 373f0: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 373f4: d7 01 movw r26, r14 373f6: 6d 93 st X+, r22 373f8: 7c 93 st X, r23 block->advance_step_loops = 4; 373fa: f8 01 movw r30, r16 373fc: ed 5a subi r30, 0xAD ; 173 373fe: ff 4f sbci r31, 0xFF ; 255 37400: 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; 37402: 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); 37404: 09 a5 ldd r16, Y+41 ; 0x29 37406: 1d a5 ldd r17, Y+45 ; 0x2d 37408: 29 a9 ldd r18, Y+49 ; 0x31 3740a: 39 ad ldd r19, Y+57 ; 0x39 3740c: 4d ad ldd r20, Y+61 ; 0x3d 3740e: 5d a9 ldd r21, Y+53 ; 0x35 37410: 6e ad ldd r22, Y+62 ; 0x3e 37412: 23 96 adiw r28, 0x03 ; 3 37414: 7f ad ldd r23, Y+63 ; 0x3f 37416: 23 97 sbiw r28, 0x03 ; 3 37418: a4 96 adiw r28, 0x24 ; 36 3741a: 8e ad ldd r24, Y+62 ; 0x3e 3741c: 9f ad ldd r25, Y+63 ; 0x3f 3741e: a4 97 sbiw r28, 0x24 ; 36 37420: 8c 53 subi r24, 0x3C ; 60 37422: 99 4f sbci r25, 0xF9 ; 249 37424: 0f 94 10 ae call 0x35c20 ; 0x35c20 if (block->step_event_count.wide <= 32767) 37428: 8e e6 ldi r24, 0x6E ; 110 3742a: 82 9d mul r24, r2 3742c: f0 01 movw r30, r0 3742e: 83 9d mul r24, r3 37430: f0 0d add r31, r0 37432: 11 24 eor r1, r1 37434: ec 53 subi r30, 0x3C ; 60 37436: f9 4f sbci r31, 0xF9 ; 249 37438: 80 89 ldd r24, Z+16 ; 0x10 3743a: 91 89 ldd r25, Z+17 ; 0x11 3743c: a2 89 ldd r26, Z+18 ; 0x12 3743e: b3 89 ldd r27, Z+19 ; 0x13 37440: 81 15 cp r24, r1 37442: 90 48 sbci r25, 0x80 ; 128 37444: a1 05 cpc r26, r1 37446: b1 05 cpc r27, r1 37448: 18 f4 brcc .+6 ; 0x37450 block->flag |= BLOCK_FLAG_DDA_LOWRES; 3744a: 85 a9 ldd r24, Z+53 ; 0x35 3744c: 88 60 ori r24, 0x08 ; 8 3744e: 85 ab std Z+53, r24 ; 0x35 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 37450: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 37452: 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; 37454: 90 91 ab 0d lds r25, 0x0DAB ; 0x800dab 37458: 91 11 cpse r25, r1 3745a: 93 c4 rjmp .+2342 ; 0x37d82 block_buffer_head = next_buffer_head; 3745c: a1 96 adiw r28, 0x21 ; 33 3745e: 3f ad ldd r19, Y+63 ; 0x3f 37460: a1 97 sbiw r28, 0x21 ; 33 37462: 30 93 a4 0d sts 0x0DA4, r19 ; 0x800da4 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 37466: 8f bf out 0x3f, r24 ; 63 } // Update position memcpy(position, target, sizeof(target)); // position[] = target[] 37468: c2 58 subi r28, 0x82 ; 130 3746a: df 4f sbci r29, 0xFF ; 255 3746c: 88 81 ld r24, Y 3746e: 99 81 ldd r25, Y+1 ; 0x01 37470: aa 81 ldd r26, Y+2 ; 0x02 37472: bb 81 ldd r27, Y+3 ; 0x03 37474: ce 57 subi r28, 0x7E ; 126 37476: d0 40 sbci r29, 0x00 ; 0 37478: 80 93 a2 06 sts 0x06A2, r24 ; 0x8006a2 3747c: 90 93 a3 06 sts 0x06A3, r25 ; 0x8006a3 37480: a0 93 a4 06 sts 0x06A4, r26 ; 0x8006a4 37484: b0 93 a5 06 sts 0x06A5, r27 ; 0x8006a5 37488: ce 57 subi r28, 0x7E ; 126 3748a: df 4f sbci r29, 0xFF ; 255 3748c: 28 81 ld r18, Y 3748e: 39 81 ldd r19, Y+1 ; 0x01 37490: 4a 81 ldd r20, Y+2 ; 0x02 37492: 5b 81 ldd r21, Y+3 ; 0x03 37494: c2 58 subi r28, 0x82 ; 130 37496: d0 40 sbci r29, 0x00 ; 0 37498: 20 93 a6 06 sts 0x06A6, r18 ; 0x8006a6 3749c: 30 93 a7 06 sts 0x06A7, r19 ; 0x8006a7 374a0: 40 93 a8 06 sts 0x06A8, r20 ; 0x8006a8 374a4: 50 93 a9 06 sts 0x06A9, r21 ; 0x8006a9 374a8: e6 96 adiw r28, 0x36 ; 54 374aa: 8c ad ldd r24, Y+60 ; 0x3c 374ac: 9d ad ldd r25, Y+61 ; 0x3d 374ae: ae ad ldd r26, Y+62 ; 0x3e 374b0: bf ad ldd r27, Y+63 ; 0x3f 374b2: e6 97 sbiw r28, 0x36 ; 54 374b4: 80 93 aa 06 sts 0x06AA, r24 ; 0x8006aa 374b8: 90 93 ab 06 sts 0x06AB, r25 ; 0x8006ab 374bc: a0 93 ac 06 sts 0x06AC, r26 ; 0x8006ac 374c0: b0 93 ad 06 sts 0x06AD, r27 ; 0x8006ad 374c4: ae 96 adiw r28, 0x2e ; 46 374c6: 2c ad ldd r18, Y+60 ; 0x3c 374c8: 3d ad ldd r19, Y+61 ; 0x3d 374ca: 4e ad ldd r20, Y+62 ; 0x3e 374cc: 5f ad ldd r21, Y+63 ; 0x3f 374ce: ae 97 sbiw r28, 0x2e ; 46 374d0: 20 93 ae 06 sts 0x06AE, r18 ; 0x8006ae 374d4: 30 93 af 06 sts 0x06AF, r19 ; 0x8006af 374d8: 40 93 b0 06 sts 0x06B0, r20 ; 0x8006b0 374dc: 50 93 b1 06 sts 0x06B1, r21 ; 0x8006b1 #ifdef LIN_ADVANCE position_float[X_AXIS] = x; 374e0: 89 a1 ldd r24, Y+33 ; 0x21 374e2: 9a a1 ldd r25, Y+34 ; 0x22 374e4: ab a1 ldd r26, Y+35 ; 0x23 374e6: bc a1 ldd r27, Y+36 ; 0x24 374e8: 80 93 cc 04 sts 0x04CC, r24 ; 0x8004cc 374ec: 90 93 cd 04 sts 0x04CD, r25 ; 0x8004cd 374f0: a0 93 ce 04 sts 0x04CE, r26 ; 0x8004ce 374f4: b0 93 cf 04 sts 0x04CF, r27 ; 0x8004cf position_float[Y_AXIS] = y; 374f8: 8d a1 ldd r24, Y+37 ; 0x25 374fa: 9e a1 ldd r25, Y+38 ; 0x26 374fc: af a1 ldd r26, Y+39 ; 0x27 374fe: b8 a5 ldd r27, Y+40 ; 0x28 37500: 80 93 d0 04 sts 0x04D0, r24 ; 0x8004d0 37504: 90 93 d1 04 sts 0x04D1, r25 ; 0x8004d1 37508: a0 93 d2 04 sts 0x04D2, r26 ; 0x8004d2 3750c: b0 93 d3 04 sts 0x04D3, r27 ; 0x8004d3 position_float[Z_AXIS] = z; 37510: a8 96 adiw r28, 0x28 ; 40 37512: 8c ad ldd r24, Y+60 ; 0x3c 37514: 9d ad ldd r25, Y+61 ; 0x3d 37516: ae ad ldd r26, Y+62 ; 0x3e 37518: bf ad ldd r27, Y+63 ; 0x3f 3751a: a8 97 sbiw r28, 0x28 ; 40 3751c: 80 93 d4 04 sts 0x04D4, r24 ; 0x8004d4 37520: 90 93 d5 04 sts 0x04D5, r25 ; 0x8004d5 37524: a0 93 d6 04 sts 0x04D6, r26 ; 0x8004d6 37528: b0 93 d7 04 sts 0x04D7, r27 ; 0x8004d7 position_float[E_AXIS] = e; 3752c: aa 96 adiw r28, 0x2a ; 42 3752e: ee ad ldd r30, Y+62 ; 0x3e 37530: ff ad ldd r31, Y+63 ; 0x3f 37532: aa 97 sbiw r28, 0x2a ; 42 37534: 80 81 ld r24, Z 37536: 91 81 ldd r25, Z+1 ; 0x01 37538: a2 81 ldd r26, Z+2 ; 0x02 3753a: b3 81 ldd r27, Z+3 ; 0x03 3753c: 80 93 d8 04 sts 0x04D8, r24 ; 0x8004d8 37540: 90 93 d9 04 sts 0x04D9, r25 ; 0x8004d9 37544: a0 93 da 04 sts 0x04DA, r26 ; 0x8004da 37548: b0 93 db 04 sts 0x04DB, r27 ; 0x8004db 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; 3754c: f0 90 a5 0d lds r15, 0x0DA5 ; 0x800da5 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); 37550: 80 91 a4 0d lds r24, 0x0DA4 ; 0x800da4 37554: 8f 19 sub r24, r15 37556: 8f 70 andi r24, 0x0F ; 15 if (n_blocks >= 3) { 37558: 83 30 cpi r24, 0x03 ; 3 3755a: 40 f1 brcs .+80 ; 0x375ac // Initialize the last tripple of blocks. block_index = prev_block_index(block_buffer_head); 3755c: 10 91 a4 0d lds r17, 0x0DA4 ; 0x800da4 } // 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) 37560: 11 11 cpse r17, r1 37562: 01 c0 rjmp .+2 ; 0x37566 block_index = BLOCK_BUFFER_SIZE; 37564: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 37566: 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; 37568: fe e6 ldi r31, 0x6E ; 110 3756a: 1f 9f mul r17, r31 3756c: c0 01 movw r24, r0 3756e: 11 24 eor r1, r1 37570: 9c 01 movw r18, r24 37572: 2c 53 subi r18, 0x3C ; 60 37574: 39 4f sbci r19, 0xF9 ; 249 37576: 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) 37578: 11 11 cpse r17, r1 3757a: 01 c0 rjmp .+2 ; 0x3757e block_index = BLOCK_BUFFER_SIZE; 3757c: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 3757e: 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)); 37580: 3e e6 ldi r19, 0x6E ; 110 37582: 13 9f mul r17, r19 37584: c0 01 movw r24, r0 37586: 11 24 eor r1, r1 37588: ac 01 movw r20, r24 3758a: 4c 53 subi r20, 0x3C ; 60 3758c: 59 4f sbci r21, 0xF9 ; 249 3758e: 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)); 37590: 9e e6 ldi r25, 0x6E ; 110 37592: 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) { 37594: f1 16 cp r15, r17 37596: 69 f0 breq .+26 ; 0x375b2 if (current->flag & BLOCK_FLAG_START_FROM_FULL_HALT) { 37598: d6 01 movw r26, r12 3759a: d5 96 adiw r26, 0x35 ; 53 3759c: 0c 91 ld r16, X 3759e: 02 ff sbrs r16, 2 375a0: 7e c3 rjmp .+1788 ; 0x37c9e // 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); 375a2: 80 91 a4 0d lds r24, 0x0DA4 ; 0x800da4 375a6: 81 1b sub r24, r17 375a8: 8f 70 andi r24, 0x0F ; 15 375aa: f1 2e mov r15, r17 } // SERIAL_ECHOLNPGM("planner_recalculate - 2"); // Forward pass and recalculate the trapezoids. if (n_blocks >= 2) { 375ac: 82 30 cpi r24, 0x02 ; 2 375ae: 08 f4 brcc .+2 ; 0x375b2 375b0: a3 c0 rjmp .+326 ; 0x376f8 // 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; 375b2: 3e e6 ldi r19, 0x6E ; 110 375b4: f3 9e mul r15, r19 375b6: c0 01 movw r24, r0 375b8: 11 24 eor r1, r1 375ba: ac 01 movw r20, r24 375bc: 4c 53 subi r20, 0x3C ; 60 375be: 59 4f sbci r21, 0xF9 ; 249 375c0: 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) 375c2: f3 94 inc r15 375c4: 50 e1 ldi r21, 0x10 ; 16 375c6: f5 12 cpse r15, r21 375c8: 01 c0 rjmp .+2 ; 0x375cc block_index = 0; 375ca: 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)); 375cc: ae e6 ldi r26, 0x6E ; 110 375ce: fa 9e mul r15, r26 375d0: c0 01 movw r24, r0 375d2: 11 24 eor r1, r1 375d4: fc 01 movw r30, r24 375d6: ec 53 subi r30, 0x3C ; 60 375d8: f9 4f sbci r31, 0xF9 ; 249 375da: 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)); 375dc: 8e e6 ldi r24, 0x6E ; 110 375de: 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) { 375e0: d5 01 movw r26, r10 375e2: d5 96 adiw r26, 0x35 ; 53 375e4: 8c 91 ld r24, X 375e6: d5 97 sbiw r26, 0x35 ; 53 375e8: 81 fd sbrc r24, 1 375ea: 5a c0 rjmp .+180 ; 0x376a0 375ec: 95 96 adiw r26, 0x25 ; 37 375ee: 4d 90 ld r4, X+ 375f0: 5d 90 ld r5, X+ 375f2: 6d 90 ld r6, X+ 375f4: 7c 90 ld r7, X 375f6: 98 97 sbiw r26, 0x28 ; 40 375f8: f6 01 movw r30, r12 375fa: 95 a0 ldd r9, Z+37 ; 0x25 375fc: e6 a0 ldd r14, Z+38 ; 0x26 375fe: 07 a1 ldd r16, Z+39 ; 0x27 37600: 10 a5 ldd r17, Z+40 ; 0x28 37602: 29 2d mov r18, r9 37604: 3e 2d mov r19, r14 37606: a8 01 movw r20, r16 37608: c3 01 movw r24, r6 3760a: b2 01 movw r22, r4 3760c: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 37610: 87 ff sbrs r24, 7 37612: 46 c0 rjmp .+140 ; 0x376a0 // 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); 37614: a3 01 movw r20, r6 37616: 92 01 movw r18, r4 37618: c3 01 movw r24, r6 3761a: b2 01 movw r22, r4 3761c: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 37620: 2b 01 movw r4, r22 37622: 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)); 37624: d5 01 movw r26, r10 37626: d1 96 adiw r26, 0x31 ; 49 37628: 6d 91 ld r22, X+ 3762a: 7d 91 ld r23, X+ 3762c: 8d 91 ld r24, X+ 3762e: 9c 91 ld r25, X 37630: d4 97 sbiw r26, 0x34 ; 52 37632: 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); 37634: 9b 01 movw r18, r22 37636: ac 01 movw r20, r24 37638: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 3763c: f5 01 movw r30, r10 3763e: 25 a5 ldd r18, Z+45 ; 0x2d 37640: 36 a5 ldd r19, Z+46 ; 0x2e 37642: 47 a5 ldd r20, Z+47 ; 0x2f 37644: 50 a9 ldd r21, Z+48 ; 0x30 37646: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 3764a: 9b 01 movw r18, r22 3764c: ac 01 movw r20, r24 3764e: c3 01 movw r24, r6 37650: b2 01 movw r22, r4 37652: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 37656: 0f 94 cd e0 call 0x3c19a ; 0x3c19a 3765a: 2b 01 movw r4, r22 3765c: 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)); 3765e: 9b 01 movw r18, r22 37660: ac 01 movw r20, r24 37662: 69 2d mov r22, r9 37664: 7e 2d mov r23, r14 37666: c8 01 movw r24, r16 37668: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 3766c: 87 ff sbrs r24, 7 3766e: 03 c0 rjmp .+6 ; 0x37676 37670: 49 2c mov r4, r9 37672: 5e 2c mov r5, r14 37674: 38 01 movw r6, r16 // Check for junction speed change if (current->entry_speed != entry_speed) { 37676: 92 01 movw r18, r4 37678: a3 01 movw r20, r6 3767a: 69 2d mov r22, r9 3767c: 7e 2d mov r23, r14 3767e: c8 01 movw r24, r16 37680: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 37684: 88 23 and r24, r24 37686: 61 f0 breq .+24 ; 0x376a0 37688: d6 01 movw r26, r12 3768a: d5 96 adiw r26, 0x35 ; 53 3768c: 2c 91 ld r18, X current->entry_speed = entry_speed; 3768e: c2 01 movw r24, r4 37690: d3 01 movw r26, r6 37692: f6 01 movw r30, r12 37694: 85 a3 std Z+37, r24 ; 0x25 37696: 96 a3 std Z+38, r25 ; 0x26 37698: a7 a3 std Z+39, r26 ; 0x27 3769a: b0 a7 std Z+40, r27 ; 0x28 current->flag |= BLOCK_FLAG_RECALCULATE; 3769c: 21 60 ori r18, 0x01 ; 1 3769e: 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) { 376a0: d5 01 movw r26, r10 376a2: d5 96 adiw r26, 0x35 ; 53 376a4: 8c 91 ld r24, X 376a6: d5 97 sbiw r26, 0x35 ; 53 376a8: f6 01 movw r30, r12 376aa: 95 a9 ldd r25, Z+53 ; 0x35 376ac: 89 2b or r24, r25 376ae: 80 ff sbrs r24, 0 376b0: 14 c0 rjmp .+40 ; 0x376da // NOTE: Entry and exit factors always > 0 by all previous logic operations. calculate_trapezoid_for_block(prev, prev->entry_speed, current->entry_speed); 376b2: 05 a1 ldd r16, Z+37 ; 0x25 376b4: 16 a1 ldd r17, Z+38 ; 0x26 376b6: 27 a1 ldd r18, Z+39 ; 0x27 376b8: 30 a5 ldd r19, Z+40 ; 0x28 376ba: 95 96 adiw r26, 0x25 ; 37 376bc: 4d 91 ld r20, X+ 376be: 5d 91 ld r21, X+ 376c0: 6d 91 ld r22, X+ 376c2: 7c 91 ld r23, X 376c4: 98 97 sbiw r26, 0x28 ; 40 376c6: c5 01 movw r24, r10 376c8: 0f 94 10 ae call 0x35c20 ; 0x35c20 // Reset current only to ensure next trapezoid is computed. prev->flag &= ~BLOCK_FLAG_RECALCULATE; 376cc: d5 01 movw r26, r10 376ce: d5 96 adiw r26, 0x35 ; 53 376d0: 8c 91 ld r24, X 376d2: d5 97 sbiw r26, 0x35 ; 53 376d4: 8e 7f andi r24, 0xFE ; 254 376d6: d5 96 adiw r26, 0x35 ; 53 376d8: 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) 376da: f3 94 inc r15 376dc: b0 e1 ldi r27, 0x10 ; 16 376de: fb 12 cpse r15, r27 376e0: 01 c0 rjmp .+2 ; 0x376e4 block_index = 0; 376e2: 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)); 376e4: f8 9c mul r15, r8 376e6: c0 01 movw r24, r0 376e8: 11 24 eor r1, r1 376ea: 8c 53 subi r24, 0x3C ; 60 376ec: 99 4f sbci r25, 0xF9 ; 249 } while (block_index != block_buffer_head); 376ee: 20 91 a4 0d lds r18, 0x0DA4 ; 0x800da4 // 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; 376f2: 56 01 movw r10, r12 current = block_buffer + (block_index = next_block_index(block_index)); } while (block_index != block_buffer_head); 376f4: f2 12 cpse r15, r18 376f6: 43 c3 rjmp .+1670 ; 0x37d7e } // 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); 376f8: 80 91 a4 0d lds r24, 0x0DA4 ; 0x800da4 } // 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) 376fc: 81 11 cpse r24, r1 376fe: 01 c0 rjmp .+2 ; 0x37702 block_index = BLOCK_BUFFER_SIZE; 37700: 80 e1 ldi r24, 0x10 ; 16 -- block_index; 37702: 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); 37704: ee e6 ldi r30, 0x6E ; 110 37706: 8e 9f mul r24, r30 37708: c0 01 movw r24, r0 3770a: 11 24 eor r1, r1 3770c: 9c 01 movw r18, r24 3770e: 2c 53 subi r18, 0x3C ; 60 37710: 39 4f sbci r19, 0xF9 ; 249 37712: 79 01 movw r14, r18 calculate_trapezoid_for_block(current, current->entry_speed, safe_final_speed); 37714: d9 01 movw r26, r18 37716: 95 96 adiw r26, 0x25 ; 37 37718: 4d 91 ld r20, X+ 3771a: 5d 91 ld r21, X+ 3771c: 6d 91 ld r22, X+ 3771e: 7c 91 ld r23, X 37720: 98 97 sbiw r26, 0x28 ; 40 37722: 09 a5 ldd r16, Y+41 ; 0x29 37724: 1d a5 ldd r17, Y+45 ; 0x2d 37726: 29 a9 ldd r18, Y+49 ; 0x31 37728: 39 ad ldd r19, Y+57 ; 0x39 3772a: c7 01 movw r24, r14 3772c: 0f 94 10 ae call 0x35c20 ; 0x35c20 current->flag &= ~BLOCK_FLAG_RECALCULATE; 37730: f7 01 movw r30, r14 37732: 85 a9 ldd r24, Z+53 ; 0x35 37734: 8e 7f andi r24, 0xFE ; 254 37736: 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(); 37738: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 3773c: 82 60 ori r24, 0x02 ; 2 3773e: 80 93 6f 00 sts 0x006F, r24 ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 37742: 0d 94 16 b1 jmp 0x3622c ; 0x3622c // 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)); 37746: a4 5e subi r26, 0xE4 ; 228 37748: b8 4f sbci r27, 0xF8 ; 248 3774a: 80 e1 ldi r24, 0x10 ; 16 3774c: e1 e9 ldi r30, 0x91 ; 145 3774e: f6 e0 ldi r31, 0x06 ; 6 37750: 0d 94 51 b1 jmp 0x362a2 ; 0x362a2 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]); 37754: 20 91 c9 0d lds r18, 0x0DC9 ; 0x800dc9 37758: 30 91 ca 0d lds r19, 0x0DCA ; 0x800dca 3775c: 40 91 cb 0d lds r20, 0x0DCB ; 0x800dcb 37760: 50 91 cc 0d lds r21, 0x0DCC ; 0x800dcc 37764: a8 96 adiw r28, 0x28 ; 40 37766: 6c ad ldd r22, Y+60 ; 0x3c 37768: 7d ad ldd r23, Y+61 ; 0x3d 3776a: 8e ad ldd r24, Y+62 ; 0x3e 3776c: 9f ad ldd r25, Y+63 ; 0x3f 3776e: a8 97 sbiw r28, 0x28 ; 40 37770: 0d 94 e7 b1 jmp 0x363ce ; 0x363ce 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); 37774: 81 e0 ldi r24, 0x01 ; 1 37776: 80 8f std Z+24, r24 ; 0x18 37778: 0d 94 8d b3 jmp 0x3671a ; 0x3671a { if(feed_rate 37780: b0 90 fa 0d lds r11, 0x0DFA ; 0x800dfa 37784: 00 91 fb 0d lds r16, 0x0DFB ; 0x800dfb 37788: 10 91 fc 0d lds r17, 0x0DFC ; 0x800dfc 3778c: 4c c8 rjmp .-3944 ; 0x36826 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])); 3778e: c5 01 movw r24, r10 37790: b4 01 movw r22, r8 37792: 0f 94 a0 d6 call 0x3ad40 ; 0x3ad40 37796: 4b 01 movw r8, r22 37798: 5c 01 movw r10, r24 3779a: c7 01 movw r24, r14 3779c: b6 01 movw r22, r12 3779e: 0f 94 a0 d6 call 0x3ad40 ; 0x3ad40 377a2: 9b 01 movw r18, r22 377a4: ac 01 movw r20, r24 377a6: c5 01 movw r24, r10 377a8: b4 01 movw r22, r8 377aa: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 377ae: 6b 01 movw r12, r22 377b0: 7c 01 movw r14, r24 377b2: 22 96 adiw r28, 0x02 ; 2 377b4: 6c ad ldd r22, Y+60 ; 0x3c 377b6: 7d ad ldd r23, Y+61 ; 0x3d 377b8: 8e ad ldd r24, Y+62 ; 0x3e 377ba: 9f ad ldd r25, Y+63 ; 0x3f 377bc: 22 97 sbiw r28, 0x02 ; 2 377be: 0f 94 a0 d6 call 0x3ad40 ; 0x3ad40 377c2: 9b 01 movw r18, r22 377c4: ac 01 movw r20, r24 377c6: c7 01 movw r24, r14 377c8: b6 01 movw r22, r12 377ca: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 377ce: 0f 94 cd e0 call 0x3c19a ; 0x3c19a 377d2: 2e e6 ldi r18, 0x6E ; 110 377d4: 22 9d mul r18, r2 377d6: f0 01 movw r30, r0 377d8: 23 9d mul r18, r3 377da: f0 0d add r31, r0 377dc: 11 24 eor r1, r1 377de: ec 53 subi r30, 0x3C ; 60 377e0: f9 4f sbci r31, 0xF9 ; 249 377e2: 65 a7 std Z+45, r22 ; 0x2d 377e4: 76 a7 std Z+46, r23 ; 0x2e 377e6: 87 a7 std Z+47, r24 ; 0x2f 377e8: 90 ab std Z+48, r25 ; 0x30 377ea: bb c8 rjmp .-3722 ; 0x36962 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 377ec: 2a 96 adiw r28, 0x0a ; 10 377ee: 2c ad ldd r18, Y+60 ; 0x3c 377f0: 3d ad ldd r19, Y+61 ; 0x3d 377f2: 4e ad ldd r20, Y+62 ; 0x3e 377f4: 5f ad ldd r21, Y+63 ; 0x3f 377f6: 2a 97 sbiw r28, 0x0a ; 10 377f8: 23 2b or r18, r19 377fa: 24 2b or r18, r20 377fc: 25 2b or r18, r21 377fe: 09 f4 brne .+2 ; 0x37802 37800: 0e c1 rjmp .+540 ; 0x37a1e 37802: 60 91 f1 0d lds r22, 0x0DF1 ; 0x800df1 37806: 70 91 f2 0d lds r23, 0x0DF2 ; 0x800df2 3780a: 80 91 f3 0d lds r24, 0x0DF3 ; 0x800df3 3780e: 90 91 f4 0d lds r25, 0x0DF4 ; 0x800df4 37812: 29 a5 ldd r18, Y+41 ; 0x29 37814: 3a a5 ldd r19, Y+42 ; 0x2a 37816: 4b a5 ldd r20, Y+43 ; 0x2b 37818: 5c a5 ldd r21, Y+44 ; 0x2c 3781a: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 3781e: 0f 94 dd dd call 0x3bbba ; 0x3bbba 37822: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 37826: 2b 01 movw r4, r22 37828: 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 3782a: 80 91 64 05 lds r24, 0x0564 ; 0x800564 3782e: 90 91 65 05 lds r25, 0x0565 ; 0x800565 37832: a0 91 66 05 lds r26, 0x0566 ; 0x800566 37836: b0 91 67 05 lds r27, 0x0567 ; 0x800567 3783a: 8d a7 std Y+45, r24 ; 0x2d 3783c: 9e a7 std Y+46, r25 ; 0x2e 3783e: af a7 std Y+47, r26 ; 0x2f 37840: b8 ab std Y+48, r27 ; 0x30 && delta_mm[E_AXIS] >= 0 && fabs(delta_mm[Z_AXIS]) < 0.5; 37842: 20 e0 ldi r18, 0x00 ; 0 37844: 30 e0 ldi r19, 0x00 ; 0 37846: a9 01 movw r20, r18 37848: bc 01 movw r22, r24 3784a: cd 01 movw r24, r26 3784c: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 37850: 18 16 cp r1, r24 37852: 0c f0 brlt .+2 ; 0x37856 37854: ed c0 rjmp .+474 ; 0x37a30 * 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 37856: 20 e0 ldi r18, 0x00 ; 0 37858: 30 e0 ldi r19, 0x00 ; 0 3785a: a9 01 movw r20, r18 3785c: 26 96 adiw r28, 0x06 ; 6 3785e: 6c ad ldd r22, Y+60 ; 0x3c 37860: 7d ad ldd r23, Y+61 ; 0x3d 37862: 8e ad ldd r24, Y+62 ; 0x3e 37864: 9f ad ldd r25, Y+63 ; 0x3f 37866: 26 97 sbiw r28, 0x06 ; 6 37868: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 3786c: 87 fd sbrc r24, 7 3786e: e0 c0 rjmp .+448 ; 0x37a30 && fabs(delta_mm[Z_AXIS]) < 0.5; 37870: 22 96 adiw r28, 0x02 ; 2 37872: 6c ad ldd r22, Y+60 ; 0x3c 37874: 7d ad ldd r23, Y+61 ; 0x3d 37876: 8e ad ldd r24, Y+62 ; 0x3e 37878: 9f ad ldd r25, Y+63 ; 0x3f 3787a: 22 97 sbiw r28, 0x02 ; 2 3787c: 9f 77 andi r25, 0x7F ; 127 3787e: 20 e0 ldi r18, 0x00 ; 0 37880: 30 e0 ldi r19, 0x00 ; 0 37882: 40 e0 ldi r20, 0x00 ; 0 37884: 5f e3 ldi r21, 0x3F ; 63 37886: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 3788a: 87 ff sbrs r24, 7 3788c: d1 c0 rjmp .+418 ; 0x37a30 * * 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 3788e: 8e e6 ldi r24, 0x6E ; 110 37890: 82 9d mul r24, r2 37892: 80 01 movw r16, r0 37894: 83 9d mul r24, r3 37896: 10 0d add r17, r0 37898: 11 24 eor r1, r1 3789a: 00 5f subi r16, 0xF0 ; 240 3789c: 18 4f sbci r17, 0xF8 ; 248 3789e: 81 e0 ldi r24, 0x01 ; 1 378a0: d8 01 movw r26, r16 378a2: 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]) 378a4: 20 91 cc 04 lds r18, 0x04CC ; 0x8004cc 378a8: 30 91 cd 04 lds r19, 0x04CD ; 0x8004cd 378ac: 40 91 ce 04 lds r20, 0x04CE ; 0x8004ce 378b0: 50 91 cf 04 lds r21, 0x04CF ; 0x8004cf 378b4: 69 a1 ldd r22, Y+33 ; 0x21 378b6: 7a a1 ldd r23, Y+34 ; 0x22 378b8: 8b a1 ldd r24, Y+35 ; 0x23 378ba: 9c a1 ldd r25, Y+36 ; 0x24 378bc: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 378c0: 69 ab std Y+49, r22 ; 0x31 378c2: 7a ab std Y+50, r23 ; 0x32 378c4: 8b ab std Y+51, r24 ; 0x33 378c6: 9c ab std Y+52, r25 ; 0x34 + sq(y - position_float[Y_AXIS]) 378c8: 20 91 d0 04 lds r18, 0x04D0 ; 0x8004d0 378cc: 30 91 d1 04 lds r19, 0x04D1 ; 0x8004d1 378d0: 40 91 d2 04 lds r20, 0x04D2 ; 0x8004d2 378d4: 50 91 d3 04 lds r21, 0x04D3 ; 0x8004d3 378d8: 6d a1 ldd r22, Y+37 ; 0x25 378da: 7e a1 ldd r23, Y+38 ; 0x26 378dc: 8f a1 ldd r24, Y+39 ; 0x27 378de: 98 a5 ldd r25, Y+40 ; 0x28 378e0: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 378e4: 4b 01 movw r8, r22 378e6: 5c 01 movw r10, r24 + sq(z - position_float[Z_AXIS])); 378e8: 20 91 d4 04 lds r18, 0x04D4 ; 0x8004d4 378ec: 30 91 d5 04 lds r19, 0x04D5 ; 0x8004d5 378f0: 40 91 d6 04 lds r20, 0x04D6 ; 0x8004d6 378f4: 50 91 d7 04 lds r21, 0x04D7 ; 0x8004d7 378f8: a8 96 adiw r28, 0x28 ; 40 378fa: 6c ad ldd r22, Y+60 ; 0x3c 378fc: 7d ad ldd r23, Y+61 ; 0x3d 378fe: 8e ad ldd r24, Y+62 ; 0x3e 37900: 9f ad ldd r25, Y+63 ; 0x3f 37902: a8 97 sbiw r28, 0x28 ; 40 37904: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 37908: 6b 01 movw r12, r22 3790a: 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]) 3790c: 29 a9 ldd r18, Y+49 ; 0x31 3790e: 3a a9 ldd r19, Y+50 ; 0x32 37910: 4b a9 ldd r20, Y+51 ; 0x33 37912: 5c a9 ldd r21, Y+52 ; 0x34 37914: ca 01 movw r24, r20 37916: b9 01 movw r22, r18 37918: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 3791c: 69 ab std Y+49, r22 ; 0x31 3791e: 7a ab std Y+50, r23 ; 0x32 37920: 8b ab std Y+51, r24 ; 0x33 37922: 9c ab std Y+52, r25 ; 0x34 + sq(y - position_float[Y_AXIS]) 37924: a5 01 movw r20, r10 37926: 94 01 movw r18, r8 37928: c5 01 movw r24, r10 3792a: b4 01 movw r22, r8 3792c: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 37930: 9b 01 movw r18, r22 37932: ac 01 movw r20, r24 37934: 69 a9 ldd r22, Y+49 ; 0x31 37936: 7a a9 ldd r23, Y+50 ; 0x32 37938: 8b a9 ldd r24, Y+51 ; 0x33 3793a: 9c a9 ldd r25, Y+52 ; 0x34 3793c: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 37940: 4b 01 movw r8, r22 37942: 5c 01 movw r10, r24 + sq(z - position_float[Z_AXIS])); 37944: a7 01 movw r20, r14 37946: 96 01 movw r18, r12 37948: c7 01 movw r24, r14 3794a: b6 01 movw r22, r12 3794c: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 37950: 9b 01 movw r18, r22 37952: ac 01 movw r20, r24 37954: c5 01 movw r24, r10 37956: b4 01 movw r22, r8 37958: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__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]) 3795c: 0f 94 cd e0 call 0x3c19a ; 0x3c19a 37960: 6b 01 movw r12, r22 37962: 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]); 37964: 20 91 d8 04 lds r18, 0x04D8 ; 0x8004d8 37968: 30 91 d9 04 lds r19, 0x04D9 ; 0x8004d9 3796c: 40 91 da 04 lds r20, 0x04DA ; 0x8004da 37970: 50 91 db 04 lds r21, 0x04DB ; 0x8004db 37974: aa 96 adiw r28, 0x2a ; 42 37976: ee ad ldd r30, Y+62 ; 0x3e 37978: ff ad ldd r31, Y+63 ; 0x3f 3797a: aa 97 sbiw r28, 0x2a ; 42 3797c: 60 81 ld r22, Z 3797e: 71 81 ldd r23, Z+1 ; 0x01 37980: 82 81 ldd r24, Z+2 ; 0x02 37982: 93 81 ldd r25, Z+3 ; 0x03 37984: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__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; 37988: a7 01 movw r20, r14 3798a: 96 01 movw r18, r12 3798c: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 37990: 6a 96 adiw r28, 0x1a ; 26 37992: 6c af std Y+60, r22 ; 0x3c 37994: 7d af std Y+61, r23 ; 0x3d 37996: 8e af std Y+62, r24 ; 0x3e 37998: 9f af std Y+63, r25 ; 0x3f 3799a: 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) 3799c: 20 e0 ldi r18, 0x00 ; 0 3799e: 30 e0 ldi r19, 0x00 ; 0 379a0: 40 e4 ldi r20, 0x40 ; 64 379a2: 50 e4 ldi r21, 0x40 ; 64 379a4: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 379a8: 18 16 cp r1, r24 379aa: 0c f4 brge .+2 ; 0x379ae 379ac: 9e c0 rjmp .+316 ; 0x37aea block->use_advance_lead = false; else if (e_D_ratio > 0) { 379ae: 20 e0 ldi r18, 0x00 ; 0 379b0: 30 e0 ldi r19, 0x00 ; 0 379b2: a9 01 movw r20, r18 379b4: 6a 96 adiw r28, 0x1a ; 26 379b6: 6c ad ldd r22, Y+60 ; 0x3c 379b8: 7d ad ldd r23, Y+61 ; 0x3d 379ba: 8e ad ldd r24, Y+62 ; 0x3e 379bc: 9f ad ldd r25, Y+63 ; 0x3f 379be: 6a 97 sbiw r28, 0x1a ; 26 379c0: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 379c4: 18 16 cp r1, r24 379c6: 0c f0 brlt .+2 ; 0x379ca 379c8: 42 c0 rjmp .+132 ; 0x37a4e const uint32_t max_accel_steps_per_s2 = ceil(cs.max_jerk[E_AXIS] / (extruder_advance_K * e_D_ratio) * steps_per_mm); 379ca: 6a 96 adiw r28, 0x1a ; 26 379cc: 2c ad ldd r18, Y+60 ; 0x3c 379ce: 3d ad ldd r19, Y+61 ; 0x3d 379d0: 4e ad ldd r20, Y+62 ; 0x3e 379d2: 5f ad ldd r21, Y+63 ; 0x3f 379d4: 6a 97 sbiw r28, 0x1a ; 26 379d6: 6d a5 ldd r22, Y+45 ; 0x2d 379d8: 7e a5 ldd r23, Y+46 ; 0x2e 379da: 8f a5 ldd r24, Y+47 ; 0x2f 379dc: 98 a9 ldd r25, Y+48 ; 0x30 379de: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 379e2: 9b 01 movw r18, r22 379e4: ac 01 movw r20, r24 379e6: 60 91 11 0e lds r22, 0x0E11 ; 0x800e11 379ea: 70 91 12 0e lds r23, 0x0E12 ; 0x800e12 379ee: 80 91 13 0e lds r24, 0x0E13 ; 0x800e13 379f2: 90 91 14 0e lds r25, 0x0E14 ; 0x800e14 379f6: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 379fa: 29 a5 ldd r18, Y+41 ; 0x29 379fc: 3a a5 ldd r19, Y+42 ; 0x2a 379fe: 4b a5 ldd r20, Y+43 ; 0x2b 37a00: 5c a5 ldd r21, Y+44 ; 0x2c 37a02: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 37a06: 0f 94 dd dd call 0x3bbba ; 0x3bbba 37a0a: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 37a0e: 64 15 cp r22, r4 37a10: 75 05 cpc r23, r5 37a12: 86 05 cpc r24, r6 37a14: 97 05 cpc r25, r7 37a16: d8 f4 brcc .+54 ; 0x37a4e 37a18: 2b 01 movw r4, r22 37a1a: 3c 01 movw r6, r24 37a1c: 18 c0 rjmp .+48 ; 0x37a4e 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 37a1e: 60 91 7d 0e lds r22, 0x0E7D ; 0x800e7d 37a22: 70 91 7e 0e lds r23, 0x0E7E ; 0x800e7e 37a26: 80 91 7f 0e lds r24, 0x0E7F ; 0x800e7f 37a2a: 90 91 80 0e lds r25, 0x0E80 ; 0x800e80 37a2e: f1 ce rjmp .-542 ; 0x37812 * * 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 37a30: 8e e6 ldi r24, 0x6E ; 110 37a32: 82 9d mul r24, r2 37a34: f0 01 movw r30, r0 37a36: 83 9d mul r24, r3 37a38: f0 0d add r31, r0 37a3a: 11 24 eor r1, r1 37a3c: e0 5f subi r30, 0xF0 ; 240 37a3e: f8 4f sbci r31, 0xF8 ; 248 37a40: 10 82 st Z, r1 block->nominal_speed *= speed_factor; block->nominal_rate *= speed_factor; } #ifdef LIN_ADVANCE float e_D_ratio = 0; 37a42: 6a 96 adiw r28, 0x1a ; 26 37a44: 1c ae std Y+60, r1 ; 0x3c 37a46: 1d ae std Y+61, r1 ; 0x3d 37a48: 1e ae std Y+62, r1 ; 0x3e 37a4a: 1f ae std Y+63, r1 ; 0x3f 37a4c: 6a 97 sbiw r28, 0x1a ; 26 37a4e: 10 e0 ldi r17, 0x00 ; 0 37a50: 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) 37a52: a4 96 adiw r28, 0x24 ; 36 37a54: ee ad ldd r30, Y+62 ; 0x3e 37a56: ff ad ldd r31, Y+63 ; 0x3f 37a58: a4 97 sbiw r28, 0x24 ; 36 37a5a: e0 0f add r30, r16 37a5c: f1 1f adc r31, r17 37a5e: ec 53 subi r30, 0x3C ; 60 37a60: f9 4f sbci r31, 0xF9 ; 249 37a62: c0 80 ld r12, Z 37a64: d1 80 ldd r13, Z+1 ; 0x01 37a66: e2 80 ldd r14, Z+2 ; 0x02 37a68: f3 80 ldd r15, Z+3 ; 0x03 37a6a: c1 14 cp r12, r1 37a6c: d1 04 cpc r13, r1 37a6e: e1 04 cpc r14, r1 37a70: f1 04 cpc r15, r1 37a72: a1 f1 breq .+104 ; 0x37adc 37a74: f8 01 movw r30, r16 37a76: e3 5b subi r30, 0xB3 ; 179 37a78: fa 4f sbci r31, 0xFA ; 250 37a7a: 60 81 ld r22, Z 37a7c: 71 81 ldd r23, Z+1 ; 0x01 37a7e: 82 81 ldd r24, Z+2 ; 0x02 37a80: 93 81 ldd r25, Z+3 ; 0x03 37a82: 64 15 cp r22, r4 37a84: 75 05 cpc r23, r5 37a86: 86 05 cpc r24, r6 37a88: 97 05 cpc r25, r7 37a8a: 40 f5 brcc .+80 ; 0x37adc { const float max_possible = float(max_acceleration_steps_per_s2[axis]) * float(block->step_event_count.wide) / float(block->steps[axis].wide); 37a8c: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 37a90: 29 ad ldd r18, Y+57 ; 0x39 37a92: 3a ad ldd r19, Y+58 ; 0x3a 37a94: 4b ad ldd r20, Y+59 ; 0x3b 37a96: 5c ad ldd r21, Y+60 ; 0x3c 37a98: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 37a9c: 4b 01 movw r8, r22 37a9e: 5c 01 movw r10, r24 37aa0: c7 01 movw r24, r14 37aa2: b6 01 movw r22, r12 37aa4: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 37aa8: 9b 01 movw r18, r22 37aaa: ac 01 movw r20, r24 37aac: c5 01 movw r24, r10 37aae: b4 01 movw r22, r8 37ab0: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 37ab4: 6b 01 movw r12, r22 37ab6: 7c 01 movw r14, r24 if (max_possible < accel) accel = max_possible; 37ab8: c3 01 movw r24, r6 37aba: b2 01 movw r22, r4 37abc: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 37ac0: 9b 01 movw r18, r22 37ac2: ac 01 movw r20, r24 37ac4: c7 01 movw r24, r14 37ac6: b6 01 movw r22, r12 37ac8: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 37acc: 87 ff sbrs r24, 7 37ace: 06 c0 rjmp .+12 ; 0x37adc 37ad0: c7 01 movw r24, r14 37ad2: b6 01 movw r22, r12 37ad4: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 37ad8: 2b 01 movw r4, r22 37ada: 3c 01 movw r6, r24 37adc: 0c 5f subi r16, 0xFC ; 252 37ade: 1f 4f sbci r17, 0xFF ; 255 } } #endif // Limit acceleration per axis for (uint8_t axis = 0; axis < NUM_AXIS; axis++) 37ae0: 00 31 cpi r16, 0x10 ; 16 37ae2: 11 05 cpc r17, r1 37ae4: 09 f0 breq .+2 ; 0x37ae8 37ae6: b5 cf rjmp .-150 ; 0x37a52 37ae8: 01 c9 rjmp .-3582 ; 0x36cec // 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; 37aea: d8 01 movw r26, r16 37aec: 1c 92 st X, r1 37aee: af cf rjmp .-162 ; 0x37a4e if (jerk > mjerk) { safe_speed *= mjerk / jerk; limited = true; } } else { safe_speed = cs.max_jerk[axis]; 37af0: c9 a6 std Y+41, r12 ; 0x29 37af2: dd a6 std Y+45, r13 ; 0x2d 37af4: e9 aa std Y+49, r14 ; 0x31 37af6: f9 ae std Y+57, r15 ; 0x39 limited = true; 37af8: 21 e0 ldi r18, 0x01 ; 1 37afa: 2d ab std Y+53, r18 ; 0x35 37afc: b1 c9 rjmp .-3230 ; 0x36e60 // 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); 37afe: 27 96 adiw r28, 0x07 ; 7 37b00: 2f ad ldd r18, Y+63 ; 0x3f 37b02: 27 97 sbiw r28, 0x07 ; 7 37b04: 2b 96 adiw r28, 0x0b ; 11 37b06: 3f ad ldd r19, Y+63 ; 0x3f 37b08: 2b 97 sbiw r28, 0x0b ; 11 37b0a: 2f 96 adiw r28, 0x0f ; 15 37b0c: 4f ad ldd r20, Y+63 ; 0x3f 37b0e: 2f 97 sbiw r28, 0x0f ; 15 37b10: 63 96 adiw r28, 0x13 ; 19 37b12: 5f ad ldd r21, Y+63 ; 0x3f 37b14: 63 97 sbiw r28, 0x13 ; 19 37b16: 6b 96 adiw r28, 0x1b ; 27 37b18: 6f ad ldd r22, Y+63 ; 0x3f 37b1a: 6b 97 sbiw r28, 0x1b ; 27 37b1c: 6d 96 adiw r28, 0x1d ; 29 37b1e: 7f ad ldd r23, Y+63 ; 0x3f 37b20: 6d 97 sbiw r28, 0x1d ; 29 37b22: c8 01 movw r24, r16 37b24: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 37b28: ec 96 adiw r28, 0x3c ; 60 37b2a: 6c af std Y+60, r22 ; 0x3c 37b2c: 7d af std Y+61, r23 ; 0x3d 37b2e: 8e af std Y+62, r24 ; 0x3e 37b30: 9f af std Y+63, r25 ; 0x3f 37b32: ec 97 sbiw r28, 0x3c ; 60 // 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; 37b34: 6b 96 adiw r28, 0x1b ; 27 37b36: ef ad ldd r30, Y+63 ; 0x3f 37b38: 6b 97 sbiw r28, 0x1b ; 27 37b3a: ed af std Y+61, r30 ; 0x3d 37b3c: 6d 96 adiw r28, 0x1d ; 29 37b3e: ff ad ldd r31, Y+63 ; 0x3f 37b40: 6d 97 sbiw r28, 0x1d ; 29 37b42: fd ab std Y+53, r31 ; 0x35 37b44: 0e af std Y+62, r16 ; 0x3e 37b46: 23 96 adiw r28, 0x03 ; 3 37b48: 1f af std Y+63, r17 ; 0x3f 37b4a: 23 97 sbiw r28, 0x03 ; 3 37b4c: 04 ca rjmp .-3064 ; 0x36f56 (v_exit > v_entry) ? ((v_entry > 0.f || v_exit < 0.f) ? // coasting (v_exit - v_entry) : // axis reversal max(v_exit, - v_entry)) : 37b4e: f7 fa bst r15, 7 37b50: f0 94 com r15 37b52: f7 f8 bld r15, 7 37b54: f0 94 com r15 37b56: a5 01 movw r20, r10 37b58: 94 01 movw r18, r8 37b5a: c7 01 movw r24, r14 37b5c: b6 01 movw r22, r12 37b5e: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 37b62: 87 ff sbrs r24, 7 37b64: 77 ca rjmp .-2834 ; 0x37054 // v_exit <= v_entry ((v_entry < 0.f || v_exit > 0.f) ? // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); 37b66: 75 01 movw r14, r10 37b68: 64 01 movw r12, r8 37b6a: 74 ca rjmp .-2840 ; 0x37054 // coasting (v_exit - v_entry) : // axis reversal max(v_exit, - v_entry)) : // v_exit <= v_entry ((v_entry < 0.f || v_exit > 0.f) ? 37b6c: c7 01 movw r24, r14 37b6e: b6 01 movw r22, r12 37b70: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 37b74: 87 fd sbrc r24, 7 37b76: 09 c0 rjmp .+18 ; 0x37b8a 37b78: 20 e0 ldi r18, 0x00 ; 0 37b7a: 30 e0 ldi r19, 0x00 ; 0 37b7c: a9 01 movw r20, r18 37b7e: c5 01 movw r24, r10 37b80: b4 01 movw r22, r8 37b82: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 37b86: 18 16 cp r1, r24 37b88: 2c f4 brge .+10 ; 0x37b94 37b8a: a5 01 movw r20, r10 37b8c: 94 01 movw r18, r8 37b8e: c7 01 movw r24, r14 37b90: b6 01 movw r22, r12 37b92: 5c ca rjmp .-2888 ; 0x3704c // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); 37b94: b7 fa bst r11, 7 37b96: b0 94 com r11 37b98: b7 f8 bld r11, 7 37b9a: b0 94 com r11 37b9c: a7 01 movw r20, r14 37b9e: 96 01 movw r18, r12 37ba0: c5 01 movw r24, r10 37ba2: b4 01 movw r22, r8 37ba4: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 37ba8: 18 16 cp r1, r24 37baa: 0c f0 brlt .+2 ; 0x37bae 37bac: 53 ca rjmp .-2906 ; 0x37054 37bae: db cf rjmp .-74 ; 0x37b66 // 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; 37bb0: 8e e6 ldi r24, 0x6E ; 110 37bb2: 82 9d mul r24, r2 37bb4: f0 01 movw r30, r0 37bb6: 83 9d mul r24, r3 37bb8: f0 0d add r31, r0 37bba: 11 24 eor r1, r1 37bbc: ec 53 subi r30, 0x3C ; 60 37bbe: f9 4f sbci r31, 0xF9 ; 249 37bc0: 85 a9 ldd r24, Z+53 ; 0x35 37bc2: 84 60 ori r24, 0x04 ; 4 37bc4: 85 ab std Z+53, r24 ; 0x35 37bc6: a9 a5 ldd r26, Y+41 ; 0x29 37bc8: ad af std Y+61, r26 ; 0x3d 37bca: bd a5 ldd r27, Y+45 ; 0x2d 37bcc: bd ab std Y+53, r27 ; 0x35 37bce: e9 a9 ldd r30, Y+49 ; 0x31 37bd0: ee af std Y+62, r30 ; 0x3e 37bd2: f9 ad ldd r31, Y+57 ; 0x39 37bd4: 23 96 adiw r28, 0x03 ; 3 37bd6: ff af std Y+63, r31 ; 0x3f 37bd8: 23 97 sbiw r28, 0x03 ; 3 37bda: bc ca rjmp .-2696 ; 0x37154 // 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; 37bdc: 81 e0 ldi r24, 0x01 ; 1 37bde: 30 cb rjmp .-2464 ; 0x37240 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]; 37be0: 20 91 11 0e lds r18, 0x0E11 ; 0x800e11 37be4: 30 91 12 0e lds r19, 0x0E12 ; 0x800e12 37be8: 40 91 13 0e lds r20, 0x0E13 ; 0x800e13 37bec: 50 91 14 0e lds r21, 0x0E14 ; 0x800e14 37bf0: c7 01 movw r24, r14 37bf2: b6 01 movw r22, r12 37bf4: c1 cb rjmp .-2174 ; 0x37378 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) { 37bf6: 20 e0 ldi r18, 0x00 ; 0 37bf8: 30 e4 ldi r19, 0x40 ; 64 37bfa: 4c e1 ldi r20, 0x1C ; 28 37bfc: 56 e4 ldi r21, 0x46 ; 70 37bfe: c7 01 movw r24, r14 37c00: b6 01 movw r22, r12 37c02: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 37c06: 18 16 cp r1, r24 37c08: d4 f4 brge .+52 ; 0x37c3e block->advance_rate = advance_rate * 2; 37c0a: 8e e6 ldi r24, 0x6E ; 110 37c0c: 82 9d mul r24, r2 37c0e: 80 01 movw r16, r0 37c10: 83 9d mul r24, r3 37c12: 10 0d add r17, r0 37c14: 11 24 eor r1, r1 37c16: 0c 53 subi r16, 0x3C ; 60 37c18: 19 4f sbci r17, 0xF9 ; 249 37c1a: 78 01 movw r14, r16 37c1c: bd e4 ldi r27, 0x4D ; 77 37c1e: eb 0e add r14, r27 37c20: f1 1c adc r15, r1 37c22: a5 01 movw r20, r10 37c24: 94 01 movw r18, r8 37c26: c5 01 movw r24, r10 37c28: b4 01 movw r22, r8 37c2a: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 37c2e: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 37c32: f7 01 movw r30, r14 37c34: 71 83 std Z+1, r23 ; 0x01 37c36: 60 83 st Z, r22 block->advance_step_loops = 2; 37c38: 36 96 adiw r30, 0x06 ; 6 37c3a: 82 e0 ldi r24, 0x02 ; 2 37c3c: e2 cb rjmp .-2108 ; 0x37402 } else { // never overflow the internal accumulator with very low rates if (advance_rate < UINT16_MAX) 37c3e: 20 e0 ldi r18, 0x00 ; 0 37c40: 3f ef ldi r19, 0xFF ; 255 37c42: 4f e7 ldi r20, 0x7F ; 127 37c44: 57 e4 ldi r21, 0x47 ; 71 37c46: c5 01 movw r24, r10 37c48: b4 01 movw r22, r8 37c4a: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 37c4e: 87 ff sbrs r24, 7 37c50: 19 c0 rjmp .+50 ; 0x37c84 block->advance_rate = advance_rate; 37c52: 8e e6 ldi r24, 0x6E ; 110 37c54: 82 9d mul r24, r2 37c56: 80 01 movw r16, r0 37c58: 83 9d mul r24, r3 37c5a: 10 0d add r17, r0 37c5c: 11 24 eor r1, r1 37c5e: 0f 5e subi r16, 0xEF ; 239 37c60: 18 4f sbci r17, 0xF8 ; 248 37c62: c5 01 movw r24, r10 37c64: b4 01 movw r22, r8 37c66: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 37c6a: d8 01 movw r26, r16 37c6c: 6d 93 st X+, r22 37c6e: 7c 93 st X, r23 else block->advance_rate = UINT16_MAX; block->advance_step_loops = 1; 37c70: 8e e6 ldi r24, 0x6E ; 110 37c72: 82 9d mul r24, r2 37c74: f0 01 movw r30, r0 37c76: 83 9d mul r24, r3 37c78: f0 0d add r31, r0 37c7a: 11 24 eor r1, r1 37c7c: e9 5e subi r30, 0xE9 ; 233 37c7e: f8 4f sbci r31, 0xF8 ; 248 37c80: 81 e0 ldi r24, 0x01 ; 1 37c82: bf cb rjmp .-2178 ; 0x37402 { // 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; 37c84: 8e e6 ldi r24, 0x6E ; 110 37c86: 82 9d mul r24, r2 37c88: f0 01 movw r30, r0 37c8a: 83 9d mul r24, r3 37c8c: f0 0d add r31, r0 37c8e: 11 24 eor r1, r1 37c90: ef 5e subi r30, 0xEF ; 239 37c92: f8 4f sbci r31, 0xF8 ; 248 37c94: 8f ef ldi r24, 0xFF ; 255 37c96: 9f ef ldi r25, 0xFF ; 255 37c98: 91 83 std Z+1, r25 ; 0x01 37c9a: 80 83 st Z, r24 37c9c: e9 cf rjmp .-46 ; 0x37c70 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) { 37c9e: f6 01 movw r30, r12 37ca0: 71 a4 ldd r7, Z+41 ; 0x29 37ca2: 82 a4 ldd r8, Z+42 ; 0x2a 37ca4: 93 a4 ldd r9, Z+43 ; 0x2b 37ca6: e4 a4 ldd r14, Z+44 ; 0x2c 37ca8: 27 2d mov r18, r7 37caa: 38 2d mov r19, r8 37cac: 49 2d mov r20, r9 37cae: 5e 2d mov r21, r14 37cb0: 65 a1 ldd r22, Z+37 ; 0x25 37cb2: 76 a1 ldd r23, Z+38 ; 0x26 37cb4: 87 a1 ldd r24, Z+39 ; 0x27 37cb6: 90 a5 ldd r25, Z+40 ; 0x28 37cb8: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 37cbc: 88 23 and r24, r24 37cbe: 09 f4 brne .+2 ; 0x37cc2 37cc0: 51 c0 rjmp .+162 ; 0x37d64 // 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) ? 37cc2: 01 fd sbrc r16, 1 37cc4: 44 c0 rjmp .+136 ; 0x37d4e 37cc6: d5 01 movw r26, r10 37cc8: 95 96 adiw r26, 0x25 ; 37 37cca: 2d 90 ld r2, X+ 37ccc: 3d 90 ld r3, X+ 37cce: 4d 90 ld r4, X+ 37cd0: 5c 90 ld r5, X 37cd2: 98 97 sbiw r26, 0x28 ; 40 37cd4: a2 01 movw r20, r4 37cd6: 91 01 movw r18, r2 37cd8: 67 2d mov r22, r7 37cda: 78 2d mov r23, r8 37cdc: 89 2d mov r24, r9 37cde: 9e 2d mov r25, r14 37ce0: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 37ce4: 18 16 cp r1, r24 37ce6: 9c f5 brge .+102 ; 0x37d4e // 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); 37ce8: a2 01 movw r20, r4 37cea: 91 01 movw r18, r2 37cec: c2 01 movw r24, r4 37cee: b1 01 movw r22, r2 37cf0: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 37cf4: 1b 01 movw r2, r22 37cf6: 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)); 37cf8: f6 01 movw r30, r12 37cfa: 61 a9 ldd r22, Z+49 ; 0x31 37cfc: 72 a9 ldd r23, Z+50 ; 0x32 37cfe: 83 a9 ldd r24, Z+51 ; 0x33 37d00: 94 a9 ldd r25, Z+52 ; 0x34 37d02: 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); 37d04: 9b 01 movw r18, r22 37d06: ac 01 movw r20, r24 37d08: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 37d0c: d6 01 movw r26, r12 37d0e: 9d 96 adiw r26, 0x2d ; 45 37d10: 2d 91 ld r18, X+ 37d12: 3d 91 ld r19, X+ 37d14: 4d 91 ld r20, X+ 37d16: 5c 91 ld r21, X 37d18: d0 97 sbiw r26, 0x30 ; 48 37d1a: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 37d1e: 9b 01 movw r18, r22 37d20: ac 01 movw r20, r24 37d22: c2 01 movw r24, r4 37d24: b1 01 movw r22, r2 37d26: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 37d2a: 0f 94 cd e0 call 0x3c19a ; 0x3c19a 37d2e: 2b 01 movw r4, r22 37d30: 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)); 37d32: 9b 01 movw r18, r22 37d34: ac 01 movw r20, r24 37d36: 67 2d mov r22, r7 37d38: 78 2d mov r23, r8 37d3a: 89 2d mov r24, r9 37d3c: 9e 2d mov r25, r14 37d3e: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 37d42: 87 fd sbrc r24, 7 37d44: 04 c0 rjmp .+8 ; 0x37d4e 37d46: 74 2c mov r7, r4 37d48: 85 2c mov r8, r5 37d4a: 9a 2c mov r9, r10 37d4c: 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) ? 37d4e: 87 2d mov r24, r7 37d50: 98 2d mov r25, r8 37d52: a9 2d mov r26, r9 37d54: be 2d mov r27, r14 37d56: f6 01 movw r30, r12 37d58: 85 a3 std Z+37, r24 ; 0x25 37d5a: 96 a3 std Z+38, r25 ; 0x26 37d5c: a7 a3 std Z+39, r26 ; 0x27 37d5e: 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; 37d60: 01 60 ori r16, 0x01 ; 1 37d62: 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) 37d64: 11 11 cpse r17, r1 37d66: 01 c0 rjmp .+2 ; 0x37d6a block_index = BLOCK_BUFFER_SIZE; 37d68: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 37d6a: 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)); 37d6c: 16 9d mul r17, r6 37d6e: c0 01 movw r24, r0 37d70: 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; 37d72: 56 01 movw r10, r12 current = block_buffer + (block_index = prev_block_index(block_index)); 37d74: 9c 01 movw r18, r24 37d76: 2c 53 subi r18, 0x3C ; 60 37d78: 39 4f sbci r19, 0xF9 ; 249 37d7a: 69 01 movw r12, r18 37d7c: 0b cc rjmp .-2026 ; 0x37594 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)); 37d7e: 6c 01 movw r12, r24 37d80: 2f cc rjmp .-1954 ; 0x375e0 37d82: 8f bf out 0x3f, r24 ; 63 __asm__ volatile ("" ::: "memory"); 37d84: 0d 94 16 b1 jmp 0x3622c ; 0x3622c 00037d88 : 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(){ 37d88: 4f 92 push r4 37d8a: 5f 92 push r5 37d8c: 6f 92 push r6 37d8e: 7f 92 push r7 37d90: 8f 92 push r8 37d92: 9f 92 push r9 37d94: af 92 push r10 37d96: bf 92 push r11 37d98: cf 92 push r12 37d9a: df 92 push r13 37d9c: ef 92 push r14 37d9e: ff 92 push r15 37da0: cf 93 push r28 37da2: df 93 push r29 37da4: cd b7 in r28, 0x3d ; 61 37da6: de b7 in r29, 0x3e ; 62 37da8: 2c 97 sbiw r28, 0x0c ; 12 37daa: 0f b6 in r0, 0x3f ; 63 37dac: f8 94 cli 37dae: de bf out 0x3e, r29 ; 62 37db0: 0f be out 0x3f, r0 ; 63 37db2: 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]); 37db4: c0 90 99 06 lds r12, 0x0699 ; 0x800699 37db8: d0 90 9a 06 lds r13, 0x069A ; 0x80069a 37dbc: e0 90 9b 06 lds r14, 0x069B ; 0x80069b 37dc0: f0 90 9c 06 lds r15, 0x069C ; 0x80069c 37dc4: 80 91 95 06 lds r24, 0x0695 ; 0x800695 37dc8: 90 91 96 06 lds r25, 0x0696 ; 0x800696 37dcc: a0 91 97 06 lds r26, 0x0697 ; 0x800697 37dd0: b0 91 98 06 lds r27, 0x0698 ; 0x800698 37dd4: 40 91 91 06 lds r20, 0x0691 ; 0x800691 37dd8: 50 91 92 06 lds r21, 0x0692 ; 0x800692 37ddc: 60 91 93 06 lds r22, 0x0693 ; 0x800693 37de0: 70 91 94 06 lds r23, 0x0694 ; 0x800694 37de4: 4d 83 std Y+5, r20 ; 0x05 37de6: 5e 83 std Y+6, r21 ; 0x06 37de8: 6f 83 std Y+7, r22 ; 0x07 37dea: 78 87 std Y+8, r23 ; 0x08 37dec: 89 83 std Y+1, r24 ; 0x01 37dee: 9a 83 std Y+2, r25 ; 0x02 37df0: ab 83 std Y+3, r26 ; 0x03 37df2: 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); 37df4: be 01 movw r22, r28 37df6: 6f 5f subi r22, 0xFF ; 255 37df8: 7f 4f sbci r23, 0xFF ; 255 37dfa: ce 01 movw r24, r28 37dfc: 05 96 adiw r24, 0x05 ; 5 37dfe: 0e 94 1a 6a call 0xd434 ; 0xd434 position[X_AXIS] = lround(x*cs.axis_steps_per_mm[X_AXIS]); 37e02: 4d 80 ldd r4, Y+5 ; 0x05 37e04: 5e 80 ldd r5, Y+6 ; 0x06 37e06: 6f 80 ldd r6, Y+7 ; 0x07 37e08: 78 84 ldd r7, Y+8 ; 0x08 37e0a: 20 91 c1 0d lds r18, 0x0DC1 ; 0x800dc1 37e0e: 30 91 c2 0d lds r19, 0x0DC2 ; 0x800dc2 37e12: 40 91 c3 0d lds r20, 0x0DC3 ; 0x800dc3 37e16: 50 91 c4 0d lds r21, 0x0DC4 ; 0x800dc4 37e1a: c3 01 movw r24, r6 37e1c: b2 01 movw r22, r4 37e1e: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 37e22: 0f 94 3c e0 call 0x3c078 ; 0x3c078 37e26: 60 93 a2 06 sts 0x06A2, r22 ; 0x8006a2 37e2a: 70 93 a3 06 sts 0x06A3, r23 ; 0x8006a3 37e2e: 80 93 a4 06 sts 0x06A4, r24 ; 0x8006a4 37e32: 90 93 a5 06 sts 0x06A5, r25 ; 0x8006a5 position[Y_AXIS] = lround(y*cs.axis_steps_per_mm[Y_AXIS]); 37e36: 89 80 ldd r8, Y+1 ; 0x01 37e38: 9a 80 ldd r9, Y+2 ; 0x02 37e3a: ab 80 ldd r10, Y+3 ; 0x03 37e3c: bc 80 ldd r11, Y+4 ; 0x04 37e3e: 20 91 c5 0d lds r18, 0x0DC5 ; 0x800dc5 37e42: 30 91 c6 0d lds r19, 0x0DC6 ; 0x800dc6 37e46: 40 91 c7 0d lds r20, 0x0DC7 ; 0x800dc7 37e4a: 50 91 c8 0d lds r21, 0x0DC8 ; 0x800dc8 37e4e: c5 01 movw r24, r10 37e50: b4 01 movw r22, r8 37e52: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 37e56: 0f 94 3c e0 call 0x3c078 ; 0x3c078 37e5a: 60 93 a6 06 sts 0x06A6, r22 ; 0x8006a6 37e5e: 70 93 a7 06 sts 0x06A7, r23 ; 0x8006a7 37e62: 80 93 a8 06 sts 0x06A8, r24 ; 0x8006a8 37e66: 90 93 a9 06 sts 0x06A9, r25 ; 0x8006a9 #ifdef MESH_BED_LEVELING position[Z_AXIS] = mbl.active ? 37e6a: 80 91 c1 13 lds r24, 0x13C1 ; 0x8013c1 37e6e: 88 23 and r24, r24 37e70: 09 f4 brne .+2 ; 0x37e74 37e72: 8c c0 rjmp .+280 ; 0x37f8c lround((z+mbl.get_z(x, y))*cs.axis_steps_per_mm[Z_AXIS]) : 37e74: a5 01 movw r20, r10 37e76: 94 01 movw r18, r8 37e78: c3 01 movw r24, r6 37e7a: b2 01 movw r22, r4 37e7c: 0f 94 6c a1 call 0x342d8 ; 0x342d8 37e80: 9b 01 movw r18, r22 37e82: ac 01 movw r20, r24 37e84: c7 01 movw r24, r14 37e86: b6 01 movw r22, r12 37e88: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 37e8c: 20 91 c9 0d lds r18, 0x0DC9 ; 0x800dc9 37e90: 30 91 ca 0d lds r19, 0x0DCA ; 0x800dca 37e94: 40 91 cb 0d lds r20, 0x0DCB ; 0x800dcb 37e98: 50 91 cc 0d lds r21, 0x0DCC ; 0x800dcc lround(z*cs.axis_steps_per_mm[Z_AXIS]); 37e9c: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__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 ? 37ea0: 0f 94 3c e0 call 0x3c078 ; 0x3c078 37ea4: 60 93 aa 06 sts 0x06AA, r22 ; 0x8006aa 37ea8: 70 93 ab 06 sts 0x06AB, r23 ; 0x8006ab 37eac: 80 93 ac 06 sts 0x06AC, r24 ; 0x8006ac 37eb0: 90 93 ad 06 sts 0x06AD, r25 ; 0x8006ad 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]); 37eb4: 80 91 9d 06 lds r24, 0x069D ; 0x80069d 37eb8: 90 91 9e 06 lds r25, 0x069E ; 0x80069e 37ebc: a0 91 9f 06 lds r26, 0x069F ; 0x80069f 37ec0: b0 91 a0 06 lds r27, 0x06A0 ; 0x8006a0 37ec4: 89 87 std Y+9, r24 ; 0x09 37ec6: 9a 87 std Y+10, r25 ; 0x0a 37ec8: ab 87 std Y+11, r26 ; 0x0b 37eca: bc 87 std Y+12, r27 ; 0x0c 37ecc: 20 91 cd 0d lds r18, 0x0DCD ; 0x800dcd 37ed0: 30 91 ce 0d lds r19, 0x0DCE ; 0x800dce 37ed4: 40 91 cf 0d lds r20, 0x0DCF ; 0x800dcf 37ed8: 50 91 d0 0d lds r21, 0x0DD0 ; 0x800dd0 37edc: bc 01 movw r22, r24 37ede: cd 01 movw r24, r26 37ee0: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 37ee4: 0f 94 3c e0 call 0x3c078 ; 0x3c078 37ee8: 60 93 ae 06 sts 0x06AE, r22 ; 0x8006ae 37eec: 70 93 af 06 sts 0x06AF, r23 ; 0x8006af 37ef0: 80 93 b0 06 sts 0x06B0, r24 ; 0x8006b0 37ef4: 90 93 b1 06 sts 0x06B1, r25 ; 0x8006b1 #ifdef LIN_ADVANCE position_float[X_AXIS] = x; 37ef8: 40 92 cc 04 sts 0x04CC, r4 ; 0x8004cc 37efc: 50 92 cd 04 sts 0x04CD, r5 ; 0x8004cd 37f00: 60 92 ce 04 sts 0x04CE, r6 ; 0x8004ce 37f04: 70 92 cf 04 sts 0x04CF, r7 ; 0x8004cf position_float[Y_AXIS] = y; 37f08: 80 92 d0 04 sts 0x04D0, r8 ; 0x8004d0 37f0c: 90 92 d1 04 sts 0x04D1, r9 ; 0x8004d1 37f10: a0 92 d2 04 sts 0x04D2, r10 ; 0x8004d2 37f14: b0 92 d3 04 sts 0x04D3, r11 ; 0x8004d3 position_float[Z_AXIS] = z; 37f18: c0 92 d4 04 sts 0x04D4, r12 ; 0x8004d4 37f1c: d0 92 d5 04 sts 0x04D5, r13 ; 0x8004d5 37f20: e0 92 d6 04 sts 0x04D6, r14 ; 0x8004d6 37f24: f0 92 d7 04 sts 0x04D7, r15 ; 0x8004d7 position_float[E_AXIS] = e; 37f28: 89 85 ldd r24, Y+9 ; 0x09 37f2a: 9a 85 ldd r25, Y+10 ; 0x0a 37f2c: ab 85 ldd r26, Y+11 ; 0x0b 37f2e: bc 85 ldd r27, Y+12 ; 0x0c 37f30: 80 93 d8 04 sts 0x04D8, r24 ; 0x8004d8 37f34: 90 93 d9 04 sts 0x04D9, r25 ; 0x8004d9 37f38: a0 93 da 04 sts 0x04DA, r26 ; 0x8004da 37f3c: b0 93 db 04 sts 0x04DB, r27 ; 0x8004db #endif st_set_position(position); 37f40: 0f 94 a6 87 call 0x30f4c ; 0x30f4c previous_nominal_speed = 0.0; // Resets planner junction speeds. Assumes start from rest. 37f44: 10 92 b8 04 sts 0x04B8, r1 ; 0x8004b8 <_ZL22previous_nominal_speed.lto_priv.488> 37f48: 10 92 b9 04 sts 0x04B9, r1 ; 0x8004b9 <_ZL22previous_nominal_speed.lto_priv.488+0x1> 37f4c: 10 92 ba 04 sts 0x04BA, r1 ; 0x8004ba <_ZL22previous_nominal_speed.lto_priv.488+0x2> 37f50: 10 92 bb 04 sts 0x04BB, r1 ; 0x8004bb <_ZL22previous_nominal_speed.lto_priv.488+0x3> memset(previous_speed, 0, sizeof(previous_speed)); 37f54: ec eb ldi r30, 0xBC ; 188 37f56: f4 e0 ldi r31, 0x04 ; 4 37f58: 80 e1 ldi r24, 0x10 ; 16 37f5a: df 01 movw r26, r30 37f5c: 1d 92 st X+, r1 37f5e: 8a 95 dec r24 37f60: e9 f7 brne .-6 ; 0x37f5c 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]); } 37f62: 2c 96 adiw r28, 0x0c ; 12 37f64: 0f b6 in r0, 0x3f ; 63 37f66: f8 94 cli 37f68: de bf out 0x3e, r29 ; 62 37f6a: 0f be out 0x3f, r0 ; 63 37f6c: cd bf out 0x3d, r28 ; 61 37f6e: df 91 pop r29 37f70: cf 91 pop r28 37f72: ff 90 pop r15 37f74: ef 90 pop r14 37f76: df 90 pop r13 37f78: cf 90 pop r12 37f7a: bf 90 pop r11 37f7c: af 90 pop r10 37f7e: 9f 90 pop r9 37f80: 8f 90 pop r8 37f82: 7f 90 pop r7 37f84: 6f 90 pop r6 37f86: 5f 90 pop r5 37f88: 4f 90 pop r4 37f8a: 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]); 37f8c: 20 91 c9 0d lds r18, 0x0DC9 ; 0x800dc9 37f90: 30 91 ca 0d lds r19, 0x0DCA ; 0x800dca 37f94: 40 91 cb 0d lds r20, 0x0DCB ; 0x800dcb 37f98: 50 91 cc 0d lds r21, 0x0DCC ; 0x800dcc 37f9c: c7 01 movw r24, r14 37f9e: b6 01 movw r22, r12 37fa0: 7d cf rjmp .-262 ; 0x37e9c 00037fa2 : 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) { 37fa2: 8f 92 push r8 37fa4: 9f 92 push r9 37fa6: af 92 push r10 37fa8: bf 92 push r11 37faa: cf 92 push r12 37fac: df 92 push r13 37fae: ef 92 push r14 37fb0: ff 92 push r15 37fb2: 0f 93 push r16 37fb4: 1f 93 push r17 37fb6: 4b 01 movw r8, r22 37fb8: 5c 01 movw r10, r24 plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feed_rate); 37fba: e3 e7 ldi r30, 0x73 ; 115 37fbc: f6 e0 ldi r31, 0x06 ; 6 37fbe: e0 84 ldd r14, Z+8 ; 0x08 37fc0: f1 84 ldd r15, Z+9 ; 0x09 37fc2: 02 85 ldd r16, Z+10 ; 0x0a 37fc4: 13 85 ldd r17, Z+11 ; 0x0b 37fc6: 24 81 ldd r18, Z+4 ; 0x04 37fc8: 35 81 ldd r19, Z+5 ; 0x05 37fca: 46 81 ldd r20, Z+6 ; 0x06 37fcc: 57 81 ldd r21, Z+7 ; 0x07 37fce: 60 81 ld r22, Z 37fd0: 71 81 ldd r23, Z+1 ; 0x01 37fd2: 82 81 ldd r24, Z+2 ; 0x02 37fd4: 93 81 ldd r25, Z+3 ; 0x03 37fd6: 1f 92 push r1 37fd8: 1f 92 push r1 37fda: 1f 92 push r1 37fdc: 1f 92 push r1 37fde: ef e7 ldi r30, 0x7F ; 127 37fe0: ce 2e mov r12, r30 37fe2: e6 e0 ldi r30, 0x06 ; 6 37fe4: de 2e mov r13, r30 37fe6: 0f 94 af b0 call 0x3615e ; 0x3615e 37fea: 0f 90 pop r0 37fec: 0f 90 pop r0 37fee: 0f 90 pop r0 37ff0: 0f 90 pop r0 } 37ff2: 1f 91 pop r17 37ff4: 0f 91 pop r16 37ff6: ff 90 pop r15 37ff8: ef 90 pop r14 37ffa: df 90 pop r13 37ffc: cf 90 pop r12 37ffe: bf 90 pop r11 38000: af 90 pop r10 38002: 9f 90 pop r9 38004: 8f 90 pop r8 38006: 08 95 ret 00038008 : // Reset position sync requests plan_reset_next_e_queue = false; plan_reset_next_e_sched = false; } void plan_buffer_line_curposXYZE(float feed_rate) { 38008: 8f 92 push r8 3800a: 9f 92 push r9 3800c: af 92 push r10 3800e: bf 92 push r11 38010: cf 92 push r12 38012: df 92 push r13 38014: ef 92 push r14 38016: ff 92 push r15 38018: 0f 93 push r16 3801a: 1f 93 push r17 3801c: 4b 01 movw r8, r22 3801e: 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); 38020: e1 e9 ldi r30, 0x91 ; 145 38022: f6 e0 ldi r31, 0x06 ; 6 38024: e0 84 ldd r14, Z+8 ; 0x08 38026: f1 84 ldd r15, Z+9 ; 0x09 38028: 02 85 ldd r16, Z+10 ; 0x0a 3802a: 13 85 ldd r17, Z+11 ; 0x0b 3802c: 24 81 ldd r18, Z+4 ; 0x04 3802e: 35 81 ldd r19, Z+5 ; 0x05 38030: 46 81 ldd r20, Z+6 ; 0x06 38032: 57 81 ldd r21, Z+7 ; 0x07 38034: 60 81 ld r22, Z 38036: 71 81 ldd r23, Z+1 ; 0x01 38038: 82 81 ldd r24, Z+2 ; 0x02 3803a: 93 81 ldd r25, Z+3 ; 0x03 3803c: 1f 92 push r1 3803e: 1f 92 push r1 38040: 1f 92 push r1 38042: 1f 92 push r1 38044: ed e9 ldi r30, 0x9D ; 157 38046: ce 2e mov r12, r30 38048: e6 e0 ldi r30, 0x06 ; 6 3804a: de 2e mov r13, r30 3804c: 0f 94 af b0 call 0x3615e ; 0x3615e 38050: 0f 90 pop r0 38052: 0f 90 pop r0 38054: 0f 90 pop r0 38056: 0f 90 pop r0 } 38058: 1f 91 pop r17 3805a: 0f 91 pop r16 3805c: ff 90 pop r15 3805e: ef 90 pop r14 38060: df 90 pop r13 38062: cf 90 pop r12 38064: bf 90 pop r11 38066: af 90 pop r10 38068: 9f 90 pop r9 3806a: 8f 90 pop r8 3806c: 08 95 ret 0003806e : #endif /* PLANNER_DIAGNOSTICS */ extern volatile uint32_t step_events_completed; // The number of step events executed in the current block void planner_reset_position() { 3806e: 4f 92 push r4 38070: 5f 92 push r5 38072: 6f 92 push r6 38074: 7f 92 push r7 38076: 8f 92 push r8 38078: 9f 92 push r9 3807a: af 92 push r10 3807c: bf 92 push r11 3807e: cf 92 push r12 38080: df 92 push r13 38082: ef 92 push r14 38084: ff 92 push r15 38086: cf 93 push r28 // First update the planner's current position in the physical motor steps. position[X_AXIS] = st_get_position(X_AXIS); 38088: 80 e0 ldi r24, 0x00 ; 0 3808a: 0f 94 81 42 call 0x28502 ; 0x28502 3808e: 60 93 a2 06 sts 0x06A2, r22 ; 0x8006a2 38092: 70 93 a3 06 sts 0x06A3, r23 ; 0x8006a3 38096: 80 93 a4 06 sts 0x06A4, r24 ; 0x8006a4 3809a: 90 93 a5 06 sts 0x06A5, r25 ; 0x8006a5 position[Y_AXIS] = st_get_position(Y_AXIS); 3809e: 81 e0 ldi r24, 0x01 ; 1 380a0: 0f 94 81 42 call 0x28502 ; 0x28502 380a4: 60 93 a6 06 sts 0x06A6, r22 ; 0x8006a6 380a8: 70 93 a7 06 sts 0x06A7, r23 ; 0x8006a7 380ac: 80 93 a8 06 sts 0x06A8, r24 ; 0x8006a8 380b0: 90 93 a9 06 sts 0x06A9, r25 ; 0x8006a9 position[Z_AXIS] = st_get_position(Z_AXIS); 380b4: 82 e0 ldi r24, 0x02 ; 2 380b6: 0f 94 81 42 call 0x28502 ; 0x28502 380ba: 60 93 aa 06 sts 0x06AA, r22 ; 0x8006aa 380be: 70 93 ab 06 sts 0x06AB, r23 ; 0x8006ab 380c2: 80 93 ac 06 sts 0x06AC, r24 ; 0x8006ac 380c6: 90 93 ad 06 sts 0x06AD, r25 ; 0x8006ad position[E_AXIS] = st_get_position(E_AXIS); 380ca: 83 e0 ldi r24, 0x03 ; 3 380cc: 0f 94 81 42 call 0x28502 ; 0x28502 380d0: 60 93 ae 06 sts 0x06AE, r22 ; 0x8006ae 380d4: 70 93 af 06 sts 0x06AF, r23 ; 0x8006af 380d8: 80 93 b0 06 sts 0x06B0, r24 ; 0x8006b0 380dc: 90 93 b1 06 sts 0x06B1, r25 ; 0x8006b1 // Second update the current position of the front end. current_position[X_AXIS] = st_get_position_mm(X_AXIS); 380e0: 80 e0 ldi r24, 0x00 ; 0 380e2: 0f 94 8f 42 call 0x2851e ; 0x2851e 380e6: 60 93 91 06 sts 0x0691, r22 ; 0x800691 380ea: 70 93 92 06 sts 0x0692, r23 ; 0x800692 380ee: 80 93 93 06 sts 0x0693, r24 ; 0x800693 380f2: 90 93 94 06 sts 0x0694, r25 ; 0x800694 current_position[Y_AXIS] = st_get_position_mm(Y_AXIS); 380f6: 81 e0 ldi r24, 0x01 ; 1 380f8: 0f 94 8f 42 call 0x2851e ; 0x2851e 380fc: 60 93 95 06 sts 0x0695, r22 ; 0x800695 38100: 70 93 96 06 sts 0x0696, r23 ; 0x800696 38104: 80 93 97 06 sts 0x0697, r24 ; 0x800697 38108: 90 93 98 06 sts 0x0698, r25 ; 0x800698 current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); 3810c: 82 e0 ldi r24, 0x02 ; 2 3810e: 0f 94 8f 42 call 0x2851e ; 0x2851e 38112: 60 93 99 06 sts 0x0699, r22 ; 0x800699 38116: 70 93 9a 06 sts 0x069A, r23 ; 0x80069a 3811a: 80 93 9b 06 sts 0x069B, r24 ; 0x80069b 3811e: 90 93 9c 06 sts 0x069C, r25 ; 0x80069c current_position[E_AXIS] = st_get_position_mm(E_AXIS); 38122: 83 e0 ldi r24, 0x03 ; 3 38124: 0f 94 8f 42 call 0x2851e ; 0x2851e 38128: 60 93 9d 06 sts 0x069D, r22 ; 0x80069d 3812c: 70 93 9e 06 sts 0x069E, r23 ; 0x80069e 38130: 80 93 9f 06 sts 0x069F, r24 ; 0x80069f 38134: 90 93 a0 06 sts 0x06A0, r25 ; 0x8006a0 // Apply the mesh bed leveling correction to the Z axis. #ifdef MESH_BED_LEVELING if (mbl.active) { 38138: 80 91 c1 13 lds r24, 0x13C1 ; 0x8013c1 3813c: 88 23 and r24, r24 3813e: 31 f1 breq .+76 ; 0x3818c #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]); 38140: 20 91 95 06 lds r18, 0x0695 ; 0x800695 38144: 30 91 96 06 lds r19, 0x0696 ; 0x800696 38148: 40 91 97 06 lds r20, 0x0697 ; 0x800697 3814c: 50 91 98 06 lds r21, 0x0698 ; 0x800698 38150: 60 91 91 06 lds r22, 0x0691 ; 0x800691 38154: 70 91 92 06 lds r23, 0x0692 ; 0x800692 38158: 80 91 93 06 lds r24, 0x0693 ; 0x800693 3815c: 90 91 94 06 lds r25, 0x0694 ; 0x800694 38160: 0f 94 6c a1 call 0x342d8 ; 0x342d8 38164: 9b 01 movw r18, r22 38166: ac 01 movw r20, r24 38168: 60 91 99 06 lds r22, 0x0699 ; 0x800699 3816c: 70 91 9a 06 lds r23, 0x069A ; 0x80069a 38170: 80 91 9b 06 lds r24, 0x069B ; 0x80069b 38174: 90 91 9c 06 lds r25, 0x069C ; 0x80069c 38178: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 3817c: 60 93 99 06 sts 0x0699, r22 ; 0x800699 38180: 70 93 9a 06 sts 0x069A, r23 ; 0x80069a 38184: 80 93 9b 06 sts 0x069B, r24 ; 0x80069b 38188: 90 93 9c 06 sts 0x069C, r25 ; 0x80069c } } inline void machine2world(float &x, float &y) { if (world2machine_correction_mode == WORLD2MACHINE_CORRECTION_NONE) { 3818c: c0 91 0e 18 lds r28, 0x180E ; 0x80180e 38190: cc 23 and r28, r28 38192: 09 f4 brne .+2 ; 0x38196 38194: 9a c0 rjmp .+308 ; 0x382ca // No correction. } else { if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SHIFT) { 38196: c0 ff sbrs r28, 0 38198: 34 c0 rjmp .+104 ; 0x38202 // Then add the offset. x -= world2machine_shift[0]; 3819a: 20 91 06 18 lds r18, 0x1806 ; 0x801806 3819e: 30 91 07 18 lds r19, 0x1807 ; 0x801807 381a2: 40 91 08 18 lds r20, 0x1808 ; 0x801808 381a6: 50 91 09 18 lds r21, 0x1809 ; 0x801809 381aa: 60 91 91 06 lds r22, 0x0691 ; 0x800691 381ae: 70 91 92 06 lds r23, 0x0692 ; 0x800692 381b2: 80 91 93 06 lds r24, 0x0693 ; 0x800693 381b6: 90 91 94 06 lds r25, 0x0694 ; 0x800694 381ba: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 381be: 60 93 91 06 sts 0x0691, r22 ; 0x800691 381c2: 70 93 92 06 sts 0x0692, r23 ; 0x800692 381c6: 80 93 93 06 sts 0x0693, r24 ; 0x800693 381ca: 90 93 94 06 sts 0x0694, r25 ; 0x800694 y -= world2machine_shift[1]; 381ce: 20 91 0a 18 lds r18, 0x180A ; 0x80180a 381d2: 30 91 0b 18 lds r19, 0x180B ; 0x80180b 381d6: 40 91 0c 18 lds r20, 0x180C ; 0x80180c 381da: 50 91 0d 18 lds r21, 0x180D ; 0x80180d 381de: 60 91 95 06 lds r22, 0x0695 ; 0x800695 381e2: 70 91 96 06 lds r23, 0x0696 ; 0x800696 381e6: 80 91 97 06 lds r24, 0x0697 ; 0x800697 381ea: 90 91 98 06 lds r25, 0x0698 ; 0x800698 381ee: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 381f2: 60 93 95 06 sts 0x0695, r22 ; 0x800695 381f6: 70 93 96 06 sts 0x0696, r23 ; 0x800696 381fa: 80 93 97 06 sts 0x0697, r24 ; 0x800697 381fe: 90 93 98 06 sts 0x0698, r25 ; 0x800698 } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { 38202: c1 ff sbrs r28, 1 38204: 62 c0 rjmp .+196 ; 0x382ca // Firs the skew & rotation correction. float out_x = world2machine_rotation_and_skew_inv[0][0] * x + world2machine_rotation_and_skew_inv[0][1] * y; 38206: 80 90 91 06 lds r8, 0x0691 ; 0x800691 3820a: 90 90 92 06 lds r9, 0x0692 ; 0x800692 3820e: a0 90 93 06 lds r10, 0x0693 ; 0x800693 38212: b0 90 94 06 lds r11, 0x0694 ; 0x800694 38216: c0 90 95 06 lds r12, 0x0695 ; 0x800695 3821a: d0 90 96 06 lds r13, 0x0696 ; 0x800696 3821e: e0 90 97 06 lds r14, 0x0697 ; 0x800697 38222: f0 90 98 06 lds r15, 0x0698 ; 0x800698 float out_y = world2machine_rotation_and_skew_inv[1][0] * x + world2machine_rotation_and_skew_inv[1][1] * y; 38226: 20 91 fe 17 lds r18, 0x17FE ; 0x8017fe 3822a: 30 91 ff 17 lds r19, 0x17FF ; 0x8017ff 3822e: 40 91 00 18 lds r20, 0x1800 ; 0x801800 38232: 50 91 01 18 lds r21, 0x1801 ; 0x801801 38236: c5 01 movw r24, r10 38238: b4 01 movw r22, r8 3823a: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 3823e: 2b 01 movw r4, r22 38240: 3c 01 movw r6, r24 38242: 20 91 02 18 lds r18, 0x1802 ; 0x801802 38246: 30 91 03 18 lds r19, 0x1803 ; 0x801803 3824a: 40 91 04 18 lds r20, 0x1804 ; 0x801804 3824e: 50 91 05 18 lds r21, 0x1805 ; 0x801805 38252: c7 01 movw r24, r14 38254: b6 01 movw r22, r12 38256: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 3825a: 9b 01 movw r18, r22 3825c: ac 01 movw r20, r24 3825e: c3 01 movw r24, r6 38260: b2 01 movw r22, r4 38262: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 38266: 2b 01 movw r4, r22 38268: 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; 3826a: 20 91 f6 17 lds r18, 0x17F6 ; 0x8017f6 3826e: 30 91 f7 17 lds r19, 0x17F7 ; 0x8017f7 38272: 40 91 f8 17 lds r20, 0x17F8 ; 0x8017f8 38276: 50 91 f9 17 lds r21, 0x17F9 ; 0x8017f9 3827a: c5 01 movw r24, r10 3827c: b4 01 movw r22, r8 3827e: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 38282: 4b 01 movw r8, r22 38284: 5c 01 movw r10, r24 38286: 20 91 fa 17 lds r18, 0x17FA ; 0x8017fa 3828a: 30 91 fb 17 lds r19, 0x17FB ; 0x8017fb 3828e: 40 91 fc 17 lds r20, 0x17FC ; 0x8017fc 38292: 50 91 fd 17 lds r21, 0x17FD ; 0x8017fd 38296: c7 01 movw r24, r14 38298: b6 01 movw r22, r12 3829a: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 3829e: 9b 01 movw r18, r22 382a0: ac 01 movw r20, r24 382a2: c5 01 movw r24, r10 382a4: b4 01 movw r22, r8 382a6: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> float out_y = world2machine_rotation_and_skew_inv[1][0] * x + world2machine_rotation_and_skew_inv[1][1] * y; x = out_x; 382aa: 60 93 91 06 sts 0x0691, r22 ; 0x800691 382ae: 70 93 92 06 sts 0x0692, r23 ; 0x800692 382b2: 80 93 93 06 sts 0x0693, r24 ; 0x800693 382b6: 90 93 94 06 sts 0x0694, r25 ; 0x800694 y = out_y; 382ba: 40 92 95 06 sts 0x0695, r4 ; 0x800695 382be: 50 92 96 06 sts 0x0696, r5 ; 0x800696 382c2: 60 92 97 06 sts 0x0697, r6 ; 0x800697 382c6: 70 92 98 06 sts 0x0698, r7 ; 0x800698 } #endif // Apply inverse world correction matrix. machine2world(current_position[X_AXIS], current_position[Y_AXIS]); set_destination_to_current(); 382ca: 0e 94 52 68 call 0xd0a4 ; 0xd0a4 #ifdef LIN_ADVANCE memcpy(position_float, current_position, sizeof(position_float)); 382ce: 80 e1 ldi r24, 0x10 ; 16 382d0: e1 e9 ldi r30, 0x91 ; 145 382d2: f6 e0 ldi r31, 0x06 ; 6 382d4: ac ec ldi r26, 0xCC ; 204 382d6: b4 e0 ldi r27, 0x04 ; 4 382d8: 01 90 ld r0, Z+ 382da: 0d 92 st X+, r0 382dc: 8a 95 dec r24 382de: e1 f7 brne .-8 ; 0x382d8 #endif } 382e0: cf 91 pop r28 382e2: ff 90 pop r15 382e4: ef 90 pop r14 382e6: df 90 pop r13 382e8: cf 90 pop r12 382ea: bf 90 pop r11 382ec: af 90 pop r10 382ee: 9f 90 pop r9 382f0: 8f 90 pop r8 382f2: 7f 90 pop r7 382f4: 6f 90 pop r6 382f6: 5f 90 pop r5 382f8: 4f 90 pop r4 382fa: 08 95 ret 000382fc : void planner_abort_hard() { // Abort the stepper routine and flush the planner queue. DISABLE_STEPPER_DRIVER_INTERRUPT(); 382fc: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 38300: 8d 7f andi r24, 0xFD ; 253 38302: 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(); 38306: 0f 94 37 c0 call 0x3806e ; 0x3806e // Relay to planner wait routine that the current line shall be canceled. planner_aborted = true; 3830a: 81 e0 ldi r24, 0x01 ; 1 3830c: 80 93 ab 0d sts 0x0DAB, r24 ; 0x800dab } void quickStop() { DISABLE_STEPPER_DRIVER_INTERRUPT(); 38310: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 38314: 8d 7f andi r24, 0xFD ; 253 38316: 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); 3831a: 90 91 a4 0d lds r25, 0x0DA4 ; 0x800da4 3831e: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 while (blocks_queued()) plan_discard_current_block(); 38322: 98 17 cp r25, r24 38324: 69 f0 breq .+26 ; 0x38340 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) { 38326: 90 91 a4 0d lds r25, 0x0DA4 ; 0x800da4 3832a: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 3832e: 98 17 cp r25, r24 38330: a1 f3 breq .-24 ; 0x3831a block_buffer_tail = (block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 38332: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 38336: 8f 5f subi r24, 0xFF ; 255 38338: 8f 70 andi r24, 0x0F ; 15 3833a: 80 93 a5 0d sts 0x0DA5, r24 ; 0x800da5 3833e: ed cf rjmp .-38 ; 0x3831a current_block = NULL; 38340: 10 92 a1 05 sts 0x05A1, r1 ; 0x8005a1 38344: 10 92 a0 05 sts 0x05A0, r1 ; 0x8005a0 #ifdef LIN_ADVANCE nextAdvanceISR = ADV_NEVER; 38348: 8f ef ldi r24, 0xFF ; 255 3834a: 9f ef ldi r25, 0xFF ; 255 3834c: 90 93 e3 04 sts 0x04E3, r25 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.477+0x1> 38350: 80 93 e2 04 sts 0x04E2, r24 ; 0x8004e2 <_ZL14nextAdvanceISR.lto_priv.477> current_adv_steps = 0; 38354: 10 92 df 04 sts 0x04DF, r1 ; 0x8004df <_ZL17current_adv_steps.lto_priv.479+0x1> 38358: 10 92 de 04 sts 0x04DE, r1 ; 0x8004de <_ZL17current_adv_steps.lto_priv.479> #endif st_reset_timer(); 3835c: 0f 94 fd 42 call 0x285fa ; 0x285fa ENABLE_STEPPER_DRIVER_INTERRUPT(); 38360: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 38364: 82 60 ori r24, 0x02 ; 2 38366: 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; 3836a: 10 92 b8 04 sts 0x04B8, r1 ; 0x8004b8 <_ZL22previous_nominal_speed.lto_priv.488> 3836e: 10 92 b9 04 sts 0x04B9, r1 ; 0x8004b9 <_ZL22previous_nominal_speed.lto_priv.488+0x1> 38372: 10 92 ba 04 sts 0x04BA, r1 ; 0x8004ba <_ZL22previous_nominal_speed.lto_priv.488+0x2> 38376: 10 92 bb 04 sts 0x04BB, r1 ; 0x8004bb <_ZL22previous_nominal_speed.lto_priv.488+0x3> memset(previous_speed, 0, sizeof(previous_speed)); 3837a: ec eb ldi r30, 0xBC ; 188 3837c: f4 e0 ldi r31, 0x04 ; 4 3837e: 80 e1 ldi r24, 0x10 ; 16 38380: df 01 movw r26, r30 38382: 1d 92 st X+, r1 38384: 8a 95 dec r24 38386: e9 f7 brne .-6 ; 0x38382 // Reset position sync requests plan_reset_next_e_queue = false; 38388: 10 92 b7 04 sts 0x04B7, r1 ; 0x8004b7 <_ZL23plan_reset_next_e_queue.lto_priv.486> plan_reset_next_e_sched = false; 3838c: 10 92 b6 04 sts 0x04B6, r1 ; 0x8004b6 <_ZL23plan_reset_next_e_sched.lto_priv.487> } 38390: 08 95 ret 00038392 : pat9125_PID2 = 0xff; return 0; } static void pat9125_wr_reg(uint8_t addr, uint8_t data) { 38392: cf 93 push r28 38394: c6 2f mov r28, r22 } uint8_t twi_w8(uint8_t address, uint8_t reg, uint8_t data) { if(twi_start(address, reg)) 38396: 0f 94 7e 7a call 0x2f4fc ; 0x2f4fc 3839a: 81 11 cpse r24, r1 3839c: 0f c0 rjmp .+30 ; 0x383bc return 1; // send data TWDR = data; 3839e: c0 93 bb 00 sts 0x00BB, r28 ; 0x8000bb <__TEXT_REGION_LENGTH__+0x7c20bb> TWCR = _BV(TWEN) | _BV(TWINT); 383a2: 84 e8 ldi r24, 0x84 ; 132 383a4: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_MT_DATA_ACK)) 383a8: 88 e2 ldi r24, 0x28 ; 40 383aa: 0f 94 8f 29 call 0x2531e ; 0x2531e 383ae: 81 11 cpse r24, r1 383b0: 05 c0 rjmp .+10 ; 0x383bc } static void twi_stop() { TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTO); 383b2: 84 e9 ldi r24, 0x94 ; 148 383b4: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> error: pat9125_PID1 = 0xff; pat9125_PID2 = 0xff; return; } 383b8: cf 91 pop r28 383ba: 08 95 ret goto error; #endif return; error: pat9125_PID1 = 0xff; 383bc: 8f ef ldi r24, 0xFF ; 255 383be: 80 93 bc 0d sts 0x0DBC, r24 ; 0x800dbc pat9125_PID2 = 0xff; 383c2: 80 93 bb 0d sts 0x0DBB, r24 ; 0x800dbb 383c6: f8 cf rjmp .-16 ; 0x383b8 000383c8 : } return 0; } static uint8_t pat9125_rd_reg(uint8_t addr) { 383c8: cf 93 push r28 } uint8_t twi_r8(uint8_t address, uint8_t reg, uint8_t* data) { if(twi_start(address, reg)) 383ca: 0f 94 7e 7a call 0x2f4fc ; 0x2f4fc 383ce: 81 11 cpse r24, r1 383d0: 21 c0 rjmp .+66 ; 0x38414 return 1; // repeat start TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTA); 383d2: 84 ea ldi r24, 0xA4 ; 164 383d4: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_REP_START)) 383d8: 80 e1 ldi r24, 0x10 ; 16 383da: 0f 94 8f 29 call 0x2531e ; 0x2531e 383de: 81 11 cpse r24, r1 383e0: 19 c0 rjmp .+50 ; 0x38414 return 2; // start receiving TWDR = TW_READ | (address << 1); 383e2: 8b ee ldi r24, 0xEB ; 235 383e4: 80 93 bb 00 sts 0x00BB, r24 ; 0x8000bb <__TEXT_REGION_LENGTH__+0x7c20bb> TWCR = _BV(TWEN) | _BV(TWINT); 383e8: c4 e8 ldi r28, 0x84 ; 132 383ea: c0 93 bc 00 sts 0x00BC, r28 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_MR_SLA_ACK)) 383ee: 80 e4 ldi r24, 0x40 ; 64 383f0: 0f 94 8f 29 call 0x2531e ; 0x2531e 383f4: 81 11 cpse r24, r1 383f6: 0e c0 rjmp .+28 ; 0x38414 return 3; // receive data TWCR = _BV(TWEN) | _BV(TWINT); 383f8: c0 93 bc 00 sts 0x00BC, r28 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_MR_DATA_NACK)) 383fc: 88 e5 ldi r24, 0x58 ; 88 383fe: 0f 94 8f 29 call 0x2531e ; 0x2531e 38402: 81 11 cpse r24, r1 38404: 07 c0 rjmp .+14 ; 0x38414 return 4; *data = TWDR; 38406: 80 91 bb 00 lds r24, 0x00BB ; 0x8000bb <__TEXT_REGION_LENGTH__+0x7c20bb> } static void twi_stop() { TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTO); 3840a: 94 e9 ldi r25, 0x94 ; 148 3840c: 90 93 bc 00 sts 0x00BC, r25 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> error: pat9125_PID1 = 0xff; pat9125_PID2 = 0xff; return 0; } 38410: cf 91 pop r28 38412: 08 95 ret goto error; #endif return data; error: pat9125_PID1 = 0xff; 38414: 8f ef ldi r24, 0xFF ; 255 38416: 80 93 bc 0d sts 0x0DBC, r24 ; 0x800dbc pat9125_PID2 = 0xff; 3841a: 80 93 bb 0d sts 0x0DBB, r24 ; 0x800dbb return 0; 3841e: 80 e0 ldi r24, 0x00 ; 0 38420: f7 cf rjmp .-18 ; 0x38410 00038422 : pat9125_wr_reg(addr, data); return pat9125_rd_reg(addr) == data; } static uint8_t pat9125_wr_seq(const uint8_t* seq) { 38422: 0f 93 push r16 38424: 1f 93 push r17 38426: cf 93 push r28 38428: df 93 push r29 3842a: 8c 01 movw r16, r24 for (;;) { const uint8_t addr = pgm_read_byte(seq++); 3842c: f8 01 movw r30, r16 3842e: d4 91 lpm r29, Z if (addr == 0xff) 38430: df 3f cpi r29, 0xFF ; 255 38432: 99 f0 breq .+38 ; 0x3845a break; if (!pat9125_wr_reg_verify(addr, pgm_read_byte(seq++))) 38434: 31 96 adiw r30, 0x01 ; 1 38436: c4 91 lpm r28, Z return; } static uint8_t pat9125_wr_reg_verify(uint8_t addr, uint8_t data) { pat9125_wr_reg(addr, data); 38438: 6c 2f mov r22, r28 3843a: 8d 2f mov r24, r29 3843c: 0f 94 c9 c1 call 0x38392 ; 0x38392 return pat9125_rd_reg(addr) == data; 38440: 8d 2f mov r24, r29 38442: 0f 94 e4 c1 call 0x383c8 ; 0x383c8 { for (;;) { const uint8_t addr = pgm_read_byte(seq++); if (addr == 0xff) break; if (!pat9125_wr_reg_verify(addr, pgm_read_byte(seq++))) 38446: 0e 5f subi r16, 0xFE ; 254 38448: 1f 4f sbci r17, 0xFF ; 255 3844a: c8 17 cp r28, r24 3844c: 79 f3 breq .-34 ; 0x3842c // Verification of the register write failed. return 0; 3844e: 80 e0 ldi r24, 0x00 ; 0 } return 1; } 38450: df 91 pop r29 38452: cf 91 pop r28 38454: 1f 91 pop r17 38456: 0f 91 pop r16 38458: 08 95 ret break; if (!pat9125_wr_reg_verify(addr, pgm_read_byte(seq++))) // Verification of the register write failed. return 0; } return 1; 3845a: 81 e0 ldi r24, 0x01 ; 1 3845c: f9 cf rjmp .-14 ; 0x38450 0003845e : return 1; } uint8_t pat9125_update(void) { 3845e: cf 93 push r28 38460: df 93 push r29 if ((pat9125_PID1 == 0x31) && (pat9125_PID2 == 0x91)) 38462: 80 91 bc 0d lds r24, 0x0DBC ; 0x800dbc 38466: 81 33 cpi r24, 0x31 ; 49 38468: 21 f0 breq .+8 ; 0x38472 pat9125_x += iDX; pat9125_y += iDY; } return 1; } return 0; 3846a: 80 e0 ldi r24, 0x00 ; 0 } 3846c: df 91 pop r29 3846e: cf 91 pop r28 38470: 08 95 ret return 1; } uint8_t pat9125_update(void) { if ((pat9125_PID1 == 0x31) && (pat9125_PID2 == 0x91)) 38472: 80 91 bb 0d lds r24, 0x0DBB ; 0x800dbb 38476: 81 39 cpi r24, 0x91 ; 145 38478: c1 f7 brne .-16 ; 0x3846a { uint8_t ucMotion = pat9125_rd_reg(PAT9125_MOTION); 3847a: 82 e0 ldi r24, 0x02 ; 2 3847c: 0f 94 e4 c1 call 0x383c8 ; 0x383c8 38480: c8 2f mov r28, r24 pat9125_b = pat9125_rd_reg(PAT9125_FRAME); 38482: 87 e1 ldi r24, 0x17 ; 23 38484: 0f 94 e4 c1 call 0x383c8 ; 0x383c8 38488: 80 93 b9 0d sts 0x0DB9, r24 ; 0x800db9 pat9125_s = pat9125_rd_reg(PAT9125_SHUTTER); 3848c: 84 e1 ldi r24, 0x14 ; 20 3848e: 0f 94 e4 c1 call 0x383c8 ; 0x383c8 38492: 80 93 ba 0d sts 0x0DBA, r24 ; 0x800dba if (pat9125_PID1 == 0xff) return 0; 38496: 80 91 bc 0d lds r24, 0x0DBC ; 0x800dbc 3849a: 8f 3f cpi r24, 0xFF ; 255 3849c: 31 f3 breq .-52 ; 0x3846a if (ucMotion & 0x80) 3849e: c7 ff sbrs r28, 7 384a0: 36 c0 rjmp .+108 ; 0x3850e { uint16_t ucXL = pat9125_rd_reg(PAT9125_DELTA_XL); 384a2: 83 e0 ldi r24, 0x03 ; 3 384a4: 0f 94 e4 c1 call 0x383c8 ; 0x383c8 384a8: d8 2f mov r29, r24 uint16_t ucYL = pat9125_rd_reg(PAT9125_DELTA_YL); 384aa: 84 e0 ldi r24, 0x04 ; 4 384ac: 0f 94 e4 c1 call 0x383c8 ; 0x383c8 384b0: c8 2f mov r28, r24 uint16_t ucXYH = pat9125_rd_reg(PAT9125_DELTA_XYH); 384b2: 82 e1 ldi r24, 0x12 ; 18 384b4: 0f 94 e4 c1 call 0x383c8 ; 0x383c8 if (pat9125_PID1 == 0xff) return 0; 384b8: 90 91 bc 0d lds r25, 0x0DBC ; 0x800dbc 384bc: 9f 3f cpi r25, 0xFF ; 255 384be: a9 f2 breq .-86 ; 0x3846a if (pat9125_PID1 == 0xff) return 0; if (ucMotion & 0x80) { uint16_t ucXL = pat9125_rd_reg(PAT9125_DELTA_XL); uint16_t ucYL = pat9125_rd_reg(PAT9125_DELTA_YL); uint16_t ucXYH = pat9125_rd_reg(PAT9125_DELTA_XYH); 384c0: 90 e0 ldi r25, 0x00 ; 0 if (pat9125_PID1 == 0xff) return 0; int16_t iDX = ucXL | ((ucXYH << 4) & 0xf00); 384c2: 9c 01 movw r18, r24 384c4: 44 e0 ldi r20, 0x04 ; 4 384c6: 22 0f add r18, r18 384c8: 33 1f adc r19, r19 384ca: 4a 95 dec r20 384cc: e1 f7 brne .-8 ; 0x384c6 384ce: 22 27 eor r18, r18 384d0: 3f 70 andi r19, 0x0F ; 15 384d2: 2d 2b or r18, r29 int16_t iDY = ucYL | ((ucXYH << 8) & 0xf00); 384d4: 98 2f mov r25, r24 384d6: 88 27 eor r24, r24 384d8: 88 27 eor r24, r24 384da: 9f 70 andi r25, 0x0F ; 15 384dc: 8c 2b or r24, r28 if (iDX & 0x800) iDX -= 4096; 384de: 33 fd sbrc r19, 3 384e0: 30 51 subi r19, 0x10 ; 16 if (iDY & 0x800) iDY -= 4096; 384e2: 93 fd sbrc r25, 3 384e4: 90 51 subi r25, 0x10 ; 16 pat9125_x += iDX; 384e6: 40 91 95 03 lds r20, 0x0395 ; 0x800395 384ea: 50 91 96 03 lds r21, 0x0396 ; 0x800396 384ee: 24 0f add r18, r20 384f0: 35 1f adc r19, r21 384f2: 30 93 96 03 sts 0x0396, r19 ; 0x800396 384f6: 20 93 95 03 sts 0x0395, r18 ; 0x800395 pat9125_y += iDY; 384fa: 20 91 8e 0e lds r18, 0x0E8E ; 0x800e8e 384fe: 30 91 8f 0e lds r19, 0x0E8F ; 0x800e8f 38502: 82 0f add r24, r18 38504: 93 1f adc r25, r19 38506: 90 93 8f 0e sts 0x0E8F, r25 ; 0x800e8f 3850a: 80 93 8e 0e sts 0x0E8E, r24 ; 0x800e8e } return 1; 3850e: 81 e0 ldi r24, 0x01 ; 1 38510: ad cf rjmp .-166 ; 0x3846c 00038512 : extern "C" { #endif //defined(__cplusplus) static inline void spi_init() { DDRB &= ~((1 << DD_SCK) | (1 << DD_MOSI) | (1 << DD_MISO)); 38512: 84 b1 in r24, 0x04 ; 4 38514: 81 7f andi r24, 0xF1 ; 241 38516: 84 b9 out 0x04, r24 ; 4 DDRB |= (1 << DD_SS) | (1 << DD_SCK) | (1 << DD_MOSI); 38518: 84 b1 in r24, 0x04 ; 4 3851a: 87 60 ori r24, 0x07 ; 7 3851c: 84 b9 out 0x04, r24 ; 4 PORTB &= ~((1 << DD_SCK) | (1 << DD_MOSI) | (1 << DD_MISO)); 3851e: 85 b1 in r24, 0x05 ; 5 38520: 81 7f andi r24, 0xF1 ; 241 38522: 85 b9 out 0x05, r24 ; 5 PORTB |= (1 << DD_SS); 38524: 28 9a sbi 0x05, 0 ; 5 SPCR = SPI_SPCR(0, 0, 0, 1, 0); //SPE=1, MSTR=1 (0x50) 38526: 80 e5 ldi r24, 0x50 ; 80 38528: 8c bd out 0x2c, r24 ; 44 SPSR = 0x00; 3852a: 1d bc out 0x2d, r1 ; 45 } 3852c: 08 95 ret 0003852e : //! @brief Enter an STK500 compatible Optiboot boot loader waiting for flashing the languages to an external flash memory. //! @return 1 if "start\n" was not sent. Optiboot was skipped //! @return 0 if "start\n" was sent. Optiboot ran normally. No need to send "start\n" in setup() uint8_t optiboot_xflash_enter() { 3852e: 2f 92 push r2 38530: 3f 92 push r3 38532: 4f 92 push r4 38534: 5f 92 push r5 38536: 6f 92 push r6 38538: 7f 92 push r7 3853a: 8f 92 push r8 3853c: 9f 92 push r9 3853e: af 92 push r10 38540: bf 92 push r11 38542: cf 92 push r12 38544: df 92 push r13 38546: ef 92 push r14 38548: ff 92 push r15 3854a: 0f 93 push r16 3854c: 1f 93 push r17 3854e: cf 93 push r28 38550: df 93 push r29 38552: cd b7 in r28, 0x3d ; 61 38554: de b7 in r29, 0x3e ; 62 38556: c6 50 subi r28, 0x06 ; 6 38558: d1 40 sbci r29, 0x01 ; 1 3855a: 0f b6 in r0, 0x3f ; 63 3855c: f8 94 cli 3855e: de bf out 0x3e, r29 ; 62 38560: 0f be out 0x3f, r0 ; 63 38562: cd bf out 0x3d, r28 ; 61 // Make sure to check boot_app_magic as well. Since these bootapp flags are located right in the middle of the stack, // they can be unintentionally changed. As a workaround to the language upload problem, do not only check for one bit if it's set, // but rather test 33 bits for the correct value before exiting optiboot early. if ((boot_app_magic == BOOT_APP_MAGIC) && (boot_app_flags & BOOT_APP_FLG_USER0)) return 1; 38564: 80 91 fc 1f lds r24, 0x1FFC ; 0x801ffc <__bss_end+0x7dd> 38568: 90 91 fd 1f lds r25, 0x1FFD ; 0x801ffd <__bss_end+0x7de> 3856c: a0 91 fe 1f lds r26, 0x1FFE ; 0x801ffe <__bss_end+0x7df> 38570: b0 91 ff 1f lds r27, 0x1FFF ; 0x801fff <__bss_end+0x7e0> 38574: 8a 3a cpi r24, 0xAA ; 170 38576: 95 45 sbci r25, 0x55 ; 85 38578: aa 4a sbci r26, 0xAA ; 170 3857a: b5 45 sbci r27, 0x55 ; 85 3857c: 21 f4 brne .+8 ; 0x38586 3857e: 80 91 fb 1f lds r24, 0x1FFB ; 0x801ffb <__bss_end+0x7dc> 38582: 87 fd sbrc r24, 7 38584: c2 c1 rjmp .+900 ; 0x3890a uint8_t pages_erased = 0; // Handshake sequence: Initialize the serial line, flush serial line, send magic, receive magic. // If the magic is not received on time, or it is not received correctly, continue to the application. { wdt_reset(); 38586: a8 95 wdr const char *ptr = entry_magic_send; const char *end = strlen_P(entry_magic_send) + ptr; const uint8_t selectedSerialPort_bak = selectedSerialPort; 38588: d0 90 38 05 lds r13, 0x0538 ; 0x800538 // Flush the serial line. while (RECV_READY) { 3858c: 80 91 c0 00 lds r24, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> 38590: 87 ff sbrs r24, 7 38592: 04 c0 rjmp .+8 ; 0x3859c wdt_reset(); 38594: a8 95 wdr // Dummy register read (discard) (void)(*(char *)UDR0); 38596: 80 91 c6 00 lds r24, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> 3859a: f8 cf rjmp .-16 ; 0x3858c } selectedSerialPort = 0; //switch to Serial0 3859c: 10 92 38 05 sts 0x0538, r1 ; 0x800538 // 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; 385a0: 00 91 9a 04 lds r16, 0x049A ; 0x80049a 385a4: 10 91 9b 04 lds r17, 0x049B ; 0x80049b 385a8: 10 93 99 04 sts 0x0499, r17 ; 0x800499 385ac: 00 93 98 04 sts 0x0498, r16 ; 0x800498 385b0: 51 e9 ldi r21, 0x91 ; 145 385b2: e5 2e mov r14, r21 385b4: 5d ea ldi r21, 0xAD ; 173 385b6: f5 2e mov r15, r21 385b8: 67 e9 ldi r22, 0x97 ; 151 385ba: a6 2e mov r10, r22 385bc: 6d ea ldi r22, 0xAD ; 173 385be: b6 2e mov r11, r22 MYSERIAL.flush(); //clear RX buffer int SerialHead = rx_buffer.head; // Send the initial magic string. while (ptr != end) putch(pgm_read_byte(ptr ++)); 385c0: f7 01 movw r30, r14 385c2: 84 91 lpm r24, Z 385c4: 0f 94 f3 ad call 0x35be6 ; 0x35be6 385c8: ff ef ldi r31, 0xFF ; 255 385ca: ef 1a sub r14, r31 385cc: ff 0a sbc r15, r31 } selectedSerialPort = 0; //switch to Serial0 MYSERIAL.flush(); //clear RX buffer int SerialHead = rx_buffer.head; // Send the initial magic string. while (ptr != end) 385ce: ae 14 cp r10, r14 385d0: bf 04 cpc r11, r15 385d2: b1 f7 brne .-20 ; 0x385c0 putch(pgm_read_byte(ptr ++)); wdt_reset(); 385d4: a8 95 wdr 385d6: 8f e0 ldi r24, 0x0F ; 15 385d8: 90 e0 ldi r25, 0x00 ; 0 return 0; } } ch = rx_buffer.buffer[SerialHead]; SerialHead = (unsigned int)(SerialHead + 1) % RX_BUFFER_SIZE; if (pgm_read_byte(ptr ++) != ch) 385da: 20 e9 ldi r18, 0x90 ; 144 385dc: 3d ea ldi r19, 0xAD ; 173 MYSERIAL.flush(); //clear RX buffer int SerialHead = rx_buffer.head; // Send the initial magic string. while (ptr != end) putch(pgm_read_byte(ptr ++)); wdt_reset(); 385de: 40 e8 ldi r20, 0x80 ; 128 385e0: 54 e8 ldi r21, 0x84 ; 132 385e2: 6e e1 ldi r22, 0x1E ; 30 385e4: 70 e0 ldi r23, 0x00 ; 0 // thus the compiler is allowed to remove the check from the cycle // i.e. rx_buffer.head == SerialHead would not be checked at all! // With the volatile keyword the compiler generates exactly the same code as without it with only one difference: // the last brne instruction jumps onto the (*rx_head == SerialHead) check and NOT onto the wdr instruction bypassing the check. volatile int *rx_head = &rx_buffer.head; while (*rx_head == SerialHead) { 385e6: e0 91 98 04 lds r30, 0x0498 ; 0x800498 385ea: f0 91 99 04 lds r31, 0x0499 ; 0x800499 385ee: e0 17 cp r30, r16 385f0: f1 07 cpc r31, r17 385f2: 19 f5 brne .+70 ; 0x3863a wdt_reset(); 385f4: a8 95 wdr 385f6: 41 50 subi r20, 0x01 ; 1 385f8: 51 09 sbc r21, r1 385fa: 61 09 sbc r22, r1 385fc: 71 09 sbc r23, r1 if ( --boot_timer == 0) { 385fe: 99 f7 brne .-26 ; 0x385e6 ch = rx_buffer.buffer[SerialHead]; SerialHead = (unsigned int)(SerialHead + 1) % RX_BUFFER_SIZE; if (pgm_read_byte(ptr ++) != ch) { // Magic was not received correctly, continue with the application selectedSerialPort = selectedSerialPort_bak; //revert Serial setting 38600: d0 92 38 05 sts 0x0538, r13 ; 0x800538 return 0; 38604: 80 e0 ldi r24, 0x00 ; 0 // This covers the response to commands like STK_ENTER_PROGMODE verifySpace(); } putch(STK_OK); } } 38606: ca 5f subi r28, 0xFA ; 250 38608: de 4f sbci r29, 0xFE ; 254 3860a: 0f b6 in r0, 0x3f ; 63 3860c: f8 94 cli 3860e: de bf out 0x3e, r29 ; 62 38610: 0f be out 0x3f, r0 ; 63 38612: cd bf out 0x3d, r28 ; 61 38614: df 91 pop r29 38616: cf 91 pop r28 38618: 1f 91 pop r17 3861a: 0f 91 pop r16 3861c: ff 90 pop r15 3861e: ef 90 pop r14 38620: df 90 pop r13 38622: cf 90 pop r12 38624: bf 90 pop r11 38626: af 90 pop r10 38628: 9f 90 pop r9 3862a: 8f 90 pop r8 3862c: 7f 90 pop r7 3862e: 6f 90 pop r6 38630: 5f 90 pop r5 38632: 4f 90 pop r4 38634: 3f 90 pop r3 38636: 2f 90 pop r2 38638: 08 95 ret // Timeout expired, continue with the application. selectedSerialPort = selectedSerialPort_bak; //revert Serial setting return 0; } } ch = rx_buffer.buffer[SerialHead]; 3863a: f8 01 movw r30, r16 3863c: e8 5e subi r30, 0xE8 ; 232 3863e: fb 4f sbci r31, 0xFB ; 251 38640: 40 81 ld r20, Z SerialHead = (unsigned int)(SerialHead + 1) % RX_BUFFER_SIZE; 38642: 0f 5f subi r16, 0xFF ; 255 38644: 1f 4f sbci r17, 0xFF ; 255 38646: 0f 77 andi r16, 0x7F ; 127 38648: 11 27 eor r17, r17 if (pgm_read_byte(ptr ++) != ch) 3864a: f9 01 movw r30, r18 3864c: e8 1b sub r30, r24 3864e: f9 0b sbc r31, r25 38650: e4 91 lpm r30, Z 38652: 4e 13 cpse r20, r30 38654: d5 cf rjmp .-86 ; 0x38600 { // Magic was not received correctly, continue with the application selectedSerialPort = selectedSerialPort_bak; //revert Serial setting return 0; } wdt_reset(); 38656: a8 95 wdr 38658: 01 97 sbiw r24, 0x01 ; 1 wdt_reset(); // Wait for two seconds until a magic string (constant entry_magic) is received // from the serial line. ptr = entry_magic_receive; end = strlen_P(entry_magic_receive) + ptr; while (ptr != end) { 3865a: 09 f0 breq .+2 ; 0x3865e 3865c: c0 cf rjmp .-128 ; 0x385de selectedSerialPort = selectedSerialPort_bak; //revert Serial setting return 0; } wdt_reset(); } cbi(UCSR0B, RXCIE0); //disable the MarlinSerial0 interrupt 3865e: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 38662: 8f 77 andi r24, 0x7F ; 127 38664: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 38668: 03 e7 ldi r16, 0x73 ; 115 3866a: 1d ea ldi r17, 0xAD ; 173 // Send the cfm magic string. ptr = entry_magic_cfm; end = strlen_P(entry_magic_cfm) + ptr; while (ptr != end) putch(pgm_read_byte(ptr ++)); 3866c: f8 01 movw r30, r16 3866e: 84 91 lpm r24, Z 38670: 0f 94 f3 ad call 0x35be6 ; 0x35be6 38674: 0f 5f subi r16, 0xFF ; 255 38676: 1f 4f sbci r17, 0xFF ; 255 } cbi(UCSR0B, RXCIE0); //disable the MarlinSerial0 interrupt // Send the cfm magic string. ptr = entry_magic_cfm; end = strlen_P(entry_magic_cfm) + ptr; while (ptr != end) 38678: fd ea ldi r31, 0xAD ; 173 3867a: 00 38 cpi r16, 0x80 ; 128 3867c: 1f 07 cpc r17, r31 3867e: b1 f7 brne .-20 ; 0x3866c putch(pgm_read_byte(ptr ++)); } spi_init(); 38680: 0f 94 89 c2 call 0x38512 ; 0x38512 xflash_init(); 38684: 0e 94 f2 ed call 0x1dbe4 ; 0x1dbe4 "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" ); 38688: 0f b6 in r0, 0x3f ; 63 3868a: f8 94 cli 3868c: a8 95 wdr 3868e: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 38692: 88 61 ori r24, 0x18 ; 24 38694: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 38698: 10 92 60 00 sts 0x0060, r1 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 3869c: 0f be out 0x3f, r0 ; 63 wdt_disable(); lcd_clear(); 3869e: 0e 94 2b 6f call 0xde56 ; 0xde56 lcd_puts_at_P(0, 1, PSTR(" Upgrading xflash\n Do not disconnect!")); 386a2: 4d e4 ldi r20, 0x4D ; 77 386a4: 5d ea ldi r21, 0xAD ; 173 386a6: 61 e0 ldi r22, 0x01 ; 1 386a8: 80 e0 ldi r24, 0x00 ; 0 386aa: 0e 94 0c 6f call 0xde18 ; 0xde18 boot_app_magic = 0; //disable the bootapp if a watchdog reset is going to be used 386ae: 10 92 fc 1f sts 0x1FFC, r1 ; 0x801ffc <__bss_end+0x7dd> 386b2: 10 92 fd 1f sts 0x1FFD, r1 ; 0x801ffd <__bss_end+0x7de> 386b6: 10 92 fe 1f sts 0x1FFE, r1 ; 0x801ffe <__bss_end+0x7df> 386ba: 10 92 ff 1f sts 0x1FFF, r1 ; 0x801fff <__bss_end+0x7e0> pagelen_t length; // Use the planner's queue for the receive / transmit buffers. // uint8_t *buff = (uint8_t*)block_buffer; uint8_t buff[260]; // bitmap of pages to be written. Bit is set to 1 if the page has already been erased. uint8_t pages_erased = 0; 386be: cb 5f subi r28, 0xFB ; 251 386c0: de 4f sbci r29, 0xFE ; 254 386c2: 18 82 st Y, r1 386c4: c5 50 subi r28, 0x05 ; 5 386c6: d1 40 sbci r29, 0x01 ; 1 // they can be unintentionally changed. As a workaround to the language upload problem, do not only check for one bit if it's set, // but rather test 33 bits for the correct value before exiting optiboot early. if ((boot_app_magic == BOOT_APP_MAGIC) && (boot_app_flags & BOOT_APP_FLG_USER0)) return 1; uint8_t ch; uint8_t rampz = 0; uint16_t address = 0; 386c8: 10 e0 ldi r17, 0x00 ; 0 386ca: 00 e0 ldi r16, 0x00 ; 0 // Make sure to check boot_app_magic as well. Since these bootapp flags are located right in the middle of the stack, // they can be unintentionally changed. As a workaround to the language upload problem, do not only check for one bit if it's set, // but rather test 33 bits for the correct value before exiting optiboot early. if ((boot_app_magic == BOOT_APP_MAGIC) && (boot_app_flags & BOOT_APP_FLG_USER0)) return 1; uint8_t ch; uint8_t rampz = 0; 386cc: f1 2c mov r15, r1 length |= getch(); // Read the destination type. It should always be 'F' as flash. It is not checked. (void)getch(); verifySpace(); xflash_wait_busy(); xflash_rd_data(addr, buff, length); 386ce: ae 01 movw r20, r28 386d0: 4f 5f subi r20, 0xFF ; 255 386d2: 5f 4f sbci r21, 0xFF ; 255 386d4: 3a 01 movw r6, r20 boot_app_magic = 0; //disable the bootapp if a watchdog reset is going to be used /* Forever loop: exits by causing WDT reset */ for (;;) { /* get character from UART */ ch = getch(); 386d6: 0f 94 fa ad call 0x35bf4 ; 0x35bf4 if(ch == STK_GET_PARAMETER) { 386da: 81 34 cpi r24, 0x41 ; 65 386dc: a9 f4 brne .+42 ; 0x38708 unsigned char which = getch(); 386de: 0f 94 fa ad call 0x35bf4 ; 0x35bf4 386e2: e8 2e mov r14, r24 verifySpace(); 386e4: 0f 94 72 b0 call 0x360e4 ; 0x360e4 /* * Send optiboot version as "SW version" * Note that the references to memory are optimized away. */ if (which == STK_SW_MINOR) { 386e8: 52 e8 ldi r21, 0x82 ; 130 putch(optiboot_version & 0xFF); 386ea: 82 e0 ldi r24, 0x02 ; 2 verifySpace(); /* * Send optiboot version as "SW version" * Note that the references to memory are optimized away. */ if (which == STK_SW_MINOR) { 386ec: e5 16 cp r14, r21 386ee: 21 f0 breq .+8 ; 0x386f8 putch(optiboot_version & 0xFF); } else if (which == STK_SW_MAJOR) { 386f0: 81 e8 ldi r24, 0x81 ; 129 386f2: e8 12 cpse r14, r24 386f4: 07 c0 rjmp .+14 ; 0x38704 putch(optiboot_version >> 8); 386f6: 86 e0 ldi r24, 0x06 ; 6 386f8: 0f 94 f3 ad call 0x35be6 ; 0x35be6 } else { // This covers the response to commands like STK_ENTER_PROGMODE verifySpace(); } putch(STK_OK); 386fc: 80 e1 ldi r24, 0x10 ; 16 386fe: 0f 94 f3 ad call 0x35be6 ; 0x35be6 38702: e9 cf rjmp .-46 ; 0x386d6 } else { /* * GET PARAMETER returns a generic 0x03 reply for * other parameters - enough to keep Avrdude happy */ putch(0x03); 38704: 83 e0 ldi r24, 0x03 ; 3 38706: f8 cf rjmp .-16 ; 0x386f8 } } else if(ch == STK_SET_DEVICE) { 38708: 82 34 cpi r24, 0x42 ; 66 3870a: 21 f4 brne .+8 ; 0x38714 // SET DEVICE is ignored getNch(20); 3870c: 84 e1 ldi r24, 0x14 ; 20 } else if(ch == STK_SET_DEVICE_EXT) { // SET DEVICE EXT is ignored getNch(5); 3870e: 0f 94 7e b0 call 0x360fc ; 0x360fc 38712: f4 cf rjmp .-24 ; 0x386fc } else if(ch == STK_SET_DEVICE) { // SET DEVICE is ignored getNch(20); } else if(ch == STK_SET_DEVICE_EXT) { 38714: 85 34 cpi r24, 0x45 ; 69 38716: 11 f4 brne .+4 ; 0x3871c // SET DEVICE EXT is ignored getNch(5); 38718: 85 e0 ldi r24, 0x05 ; 5 3871a: f9 cf rjmp .-14 ; 0x3870e } else if(ch == STK_LOAD_ADDRESS) { 3871c: 85 35 cpi r24, 0x55 ; 85 3871e: c9 f4 brne .+50 ; 0x38752 // LOAD ADDRESS uint16_t newAddress; // Workaround for the infamous ';' bug in the Prusa3D usb to serial converter. // Send the binary data by nibbles to avoid transmitting the ';' character. newAddress = getch(); 38720: 0f 94 fa ad call 0x35bf4 ; 0x35bf4 38724: 08 2f mov r16, r24 newAddress |= getch(); 38726: 0f 94 fa ad call 0x35bf4 ; 0x35bf4 3872a: 08 2b or r16, r24 3872c: 10 e0 ldi r17, 0x00 ; 0 newAddress |= (((uint16_t)getch()) << 8); 3872e: 0f 94 fa ad call 0x35bf4 ; 0x35bf4 38732: 18 2b or r17, r24 newAddress |= (((uint16_t)getch()) << 8); 38734: 0f 94 fa ad call 0x35bf4 ; 0x35bf4 38738: 18 2b or r17, r24 // Transfer top bit to LSB in rampz if (newAddress & 0x8000) 3873a: 17 ff sbrs r17, 7 3873c: 07 c0 rjmp .+14 ; 0x3874c rampz |= 0x01; 3873e: 68 94 set 38740: f0 f8 bld r15, 0 else rampz &= 0xFE; newAddress += newAddress; // Convert from word address to byte address 38742: 00 0f add r16, r16 38744: 11 1f adc r17, r17 wdt_enable(WATCHDOG_SOFT_RESET_VALUE); verifySpace(); } else { // This covers the response to commands like STK_ENTER_PROGMODE verifySpace(); 38746: 0f 94 72 b0 call 0x360e4 ; 0x360e4 3874a: d8 cf rjmp .-80 ; 0x386fc newAddress |= (((uint16_t)getch()) << 8); // Transfer top bit to LSB in rampz if (newAddress & 0x8000) rampz |= 0x01; else rampz &= 0xFE; 3874c: e8 94 clt 3874e: f0 f8 bld r15, 0 38750: f8 cf rjmp .-16 ; 0x38742 newAddress += newAddress; // Convert from word address to byte address address = newAddress; verifySpace(); } else if(ch == STK_UNIVERSAL) { 38752: 86 35 cpi r24, 0x56 ; 86 38754: a1 f4 brne .+40 ; 0x3877e // LOAD_EXTENDED_ADDRESS is needed in STK_UNIVERSAL for addressing more than 128kB if ( AVR_OP_LOAD_EXT_ADDR == getch() ) { 38756: 0f 94 fa ad call 0x35bf4 ; 0x35bf4 3875a: 8d 34 cpi r24, 0x4D ; 77 3875c: 71 f4 brne .+28 ; 0x3877a // get address getch(); // get '0' 3875e: 0f 94 fa ad call 0x35bf4 ; 0x35bf4 rampz = (rampz & 0x01) | ((getch() << 1) & 0xff); // get address and put it in rampz 38762: 0f 94 fa ad call 0x35bf4 ; 0x35bf4 38766: 9f 2d mov r25, r15 38768: 91 70 andi r25, 0x01 ; 1 3876a: f9 2e mov r15, r25 3876c: 88 0f add r24, r24 3876e: f8 2a or r15, r24 getNch(1); // get last '0' 38770: 81 e0 ldi r24, 0x01 ; 1 // response putch(0x00); } else { // everything else is ignored getNch(3); 38772: 0f 94 7e b0 call 0x360fc ; 0x360fc putch(0x00); 38776: 80 e0 ldi r24, 0x00 ; 0 38778: bf cf rjmp .-130 ; 0x386f8 // response putch(0x00); } else { // everything else is ignored getNch(3); 3877a: 83 e0 ldi r24, 0x03 ; 3 3877c: fa cf rjmp .-12 ; 0x38772 putch(0x00); } } /* Write memory, length is big endian and is in bytes */ else if(ch == STK_PROG_PAGE) { 3877e: 84 36 cpi r24, 0x64 ; 100 38780: 09 f0 breq .+2 ; 0x38784 38782: 77 c0 rjmp .+238 ; 0x38872 uint8_t desttype; uint8_t *bufPtr; pagelen_t savelength; // Read the page length, with the length transferred each nibble separately to work around // the Prusa's USB to serial infamous semicolon issue. length = ((pagelen_t)getch()) << 8; 38784: 0f 94 fa ad call 0x35bf4 ; 0x35bf4 38788: b8 2e mov r11, r24 length |= ((pagelen_t)getch()) << 8; 3878a: 0f 94 fa ad call 0x35bf4 ; 0x35bf4 3878e: c8 2e mov r12, r24 length |= getch(); 38790: 0f 94 fa ad call 0x35bf4 ; 0x35bf4 38794: e8 2e mov r14, r24 length |= getch(); 38796: 0f 94 fa ad call 0x35bf4 ; 0x35bf4 uint8_t *bufPtr; pagelen_t savelength; // Read the page length, with the length transferred each nibble separately to work around // the Prusa's USB to serial infamous semicolon issue. length = ((pagelen_t)getch()) << 8; length |= ((pagelen_t)getch()) << 8; 3879a: d1 2c mov r13, r1 3879c: dc 2c mov r13, r12 3879e: cc 24 eor r12, r12 387a0: db 28 or r13, r11 length |= getch(); length |= getch(); 387a2: 8e 29 or r24, r14 387a4: c8 2a or r12, r24 savelength = length; // Read the destination type. It should always be 'F' as flash. desttype = getch(); 387a6: 0f 94 fa ad call 0x35bf4 ; 0x35bf4 387aa: 58 2e mov r5, r24 387ac: fe 01 movw r30, r28 387ae: 31 96 adiw r30, 0x01 ; 1 387b0: 5f 01 movw r10, r30 387b2: 46 01 movw r8, r12 387b4: 8e 0e add r8, r30 387b6: 9f 1e adc r9, r31 387b8: ee 2e mov r14, r30 387ba: ca 5f subi r28, 0xFA ; 250 387bc: de 4f sbci r29, 0xFE ; 254 387be: b8 82 st Y, r11 387c0: c6 50 subi r28, 0x06 ; 6 387c2: d1 40 sbci r29, 0x01 ; 1 // read a page worth of contents bufPtr = buff; do *bufPtr++ = getch(); 387c4: 0f 94 fa ad call 0x35bf4 ; 0x35bf4 387c8: f5 01 movw r30, r10 387ca: 81 93 st Z+, r24 387cc: 5f 01 movw r10, r30 while (--length); 387ce: 8e 16 cp r8, r30 387d0: 9f 06 cpc r9, r31 387d2: c1 f7 brne .-16 ; 0x387c4 // Read command terminator, start reply verifySpace(); 387d4: 0f 94 72 b0 call 0x360e4 ; 0x360e4 if (desttype == 'E') { 387d8: f5 e4 ldi r31, 0x45 ; 69 387da: 5f 12 cpse r5, r31 387dc: 01 c0 rjmp .+2 ; 0x387e0 387de: ff cf rjmp .-2 ; 0x387de while (1) ; // Error: wait for WDT } else { uint32_t addr = (((uint32_t)rampz) << 16) | address; 387e0: 18 01 movw r2, r16 387e2: 51 2c mov r5, r1 387e4: 4f 2c mov r4, r15 // During a single bootloader run, only erase a 64kB block once. // An 8bit bitmask 'pages_erased' covers 512kB of FLASH memory. if ((address == 0) && (pages_erased & (1 << (addr >> 16))) == 0) { 387e6: 01 15 cp r16, r1 387e8: 11 05 cpc r17, r1 387ea: 61 f5 brne .+88 ; 0x38844 387ec: 42 01 movw r8, r4 387ee: aa 24 eor r10, r10 387f0: bb 24 eor r11, r11 387f2: cb 5f subi r28, 0xFB ; 251 387f4: de 4f sbci r29, 0xFE ; 254 387f6: 28 81 ld r18, Y 387f8: c5 50 subi r28, 0x05 ; 5 387fa: d1 40 sbci r29, 0x01 ; 1 387fc: 82 2f mov r24, r18 387fe: 90 e0 ldi r25, 0x00 ; 0 38800: 08 2c mov r0, r8 38802: 02 c0 rjmp .+4 ; 0x38808 38804: 95 95 asr r25 38806: 87 95 ror r24 38808: 0a 94 dec r0 3880a: e2 f7 brpl .-8 ; 0x38804 3880c: 80 fd sbrc r24, 0 3880e: 1a c0 rjmp .+52 ; 0x38844 xflash_wait_busy(); 38810: 0e 94 7f ec call 0x1d8fe ; 0x1d8fe xflash_enable_wr(); 38814: 0e 94 1b ed call 0x1da36 ; 0x1da36 return xflash_erase(_CMD_BLOCK32_ERASE, addr); } void xflash_block64_erase(uint32_t addr) { return xflash_erase(_CMD_BLOCK64_ERASE, addr); 38818: b2 01 movw r22, r4 3881a: a8 01 movw r20, r16 3881c: 88 ed ldi r24, 0xD8 ; 216 3881e: 0e 94 9d ec call 0x1d93a ; 0x1d93a xflash_block64_erase(addr); pages_erased |= (1 << (addr >> 16)); 38822: 81 e0 ldi r24, 0x01 ; 1 38824: 90 e0 ldi r25, 0x00 ; 0 38826: 01 c0 rjmp .+2 ; 0x3882a 38828: 88 0f add r24, r24 3882a: 8a 94 dec r8 3882c: ea f7 brpl .-6 ; 0x38828 3882e: cb 5f subi r28, 0xFB ; 251 38830: de 4f sbci r29, 0xFE ; 254 38832: 48 81 ld r20, Y 38834: c5 50 subi r28, 0x05 ; 5 38836: d1 40 sbci r29, 0x01 ; 1 38838: 48 2b or r20, r24 3883a: cb 5f subi r28, 0xFB ; 251 3883c: de 4f sbci r29, 0xFE ; 254 3883e: 48 83 st Y, r20 38840: c5 50 subi r28, 0x05 ; 5 38842: d1 40 sbci r29, 0x01 ; 1 } xflash_wait_busy(); 38844: 0e 94 7f ec call 0x1d8fe ; 0x1d8fe xflash_enable_wr(); 38848: 0e 94 1b ed call 0x1da36 ; 0x1da36 xflash_page_program(addr, buff, savelength); 3884c: 96 01 movw r18, r12 3884e: 4e 2d mov r20, r14 38850: ca 5f subi r28, 0xFA ; 250 38852: de 4f sbci r29, 0xFE ; 254 38854: 58 81 ld r21, Y 38856: c6 50 subi r28, 0x06 ; 6 38858: d1 40 sbci r29, 0x01 ; 1 3885a: c2 01 movw r24, r4 3885c: b1 01 movw r22, r2 3885e: 0e 94 a2 ec call 0x1d944 ; 0x1d944 xflash_wait_busy(); 38862: 0e 94 7f ec call 0x1d8fe ; 0x1d8fe _CS_HIGH(); } void xflash_disable_wr(void) { _CS_LOW(); 38866: 45 98 cbi 0x08, 5 ; 8 _SPI_TX(_CMD_DISABLE_WR); // send command 0x04 38868: 84 e0 ldi r24, 0x04 ; 4 3886a: 0e 94 79 ec call 0x1d8f2 ; 0x1d8f2 _CS_HIGH(); 3886e: 45 9a sbi 0x08, 5 ; 8 38870: 45 cf rjmp .-374 ; 0x386fc xflash_disable_wr(); } } /* Read memory block mode, length is big endian. */ else if(ch == STK_READ_PAGE) { 38872: 84 37 cpi r24, 0x74 ; 116 38874: 81 f5 brne .+96 ; 0x388d6 uint32_t addr = (((uint32_t)rampz) << 16) | address; 38876: b1 2c mov r11, r1 38878: af 2c mov r10, r15 pagelen_t i; // Read the page length, with the length transferred each nibble separately to work around // the Prusa's USB to serial infamous semicolon issue. length = ((pagelen_t)getch()) << 8; 3887a: 0f 94 fa ad call 0x35bf4 ; 0x35bf4 3887e: d8 2e mov r13, r24 length |= ((pagelen_t)getch()) << 8; 38880: 0f 94 fa ad call 0x35bf4 ; 0x35bf4 38884: c8 2e mov r12, r24 length |= getch(); 38886: 0f 94 fa ad call 0x35bf4 ; 0x35bf4 3888a: e8 2e mov r14, r24 length |= getch(); 3888c: 0f 94 fa ad call 0x35bf4 ; 0x35bf4 uint32_t addr = (((uint32_t)rampz) << 16) | address; pagelen_t i; // Read the page length, with the length transferred each nibble separately to work around // the Prusa's USB to serial infamous semicolon issue. length = ((pagelen_t)getch()) << 8; length |= ((pagelen_t)getch()) << 8; 38890: 2c 2d mov r18, r12 38892: 30 e0 ldi r19, 0x00 ; 0 38894: 32 2f mov r19, r18 38896: 22 27 eor r18, r18 38898: f9 01 movw r30, r18 3889a: fd 29 or r31, r13 3889c: 6f 01 movw r12, r30 length |= getch(); length |= getch(); 3889e: 8e 29 or r24, r14 388a0: c8 2a or r12, r24 // Read the destination type. It should always be 'F' as flash. It is not checked. (void)getch(); 388a2: 0f 94 fa ad call 0x35bf4 ; 0x35bf4 verifySpace(); 388a6: 0f 94 72 b0 call 0x360e4 ; 0x360e4 xflash_wait_busy(); 388aa: 0e 94 7f ec call 0x1d8fe ; 0x1d8fe xflash_rd_data(addr, buff, length); 388ae: 96 01 movw r18, r12 388b0: a3 01 movw r20, r6 388b2: c5 01 movw r24, r10 388b4: b8 01 movw r22, r16 388b6: 0e 94 c2 ec call 0x1d984 ; 0x1d984 388ba: 53 01 movw r10, r6 for (i = 0; i < length; ++ i) 388bc: c5 01 movw r24, r10 388be: 86 19 sub r24, r6 388c0: 97 09 sbc r25, r7 388c2: 8c 15 cp r24, r12 388c4: 9d 05 cpc r25, r13 388c6: 08 f0 brcs .+2 ; 0x388ca 388c8: 19 cf rjmp .-462 ; 0x386fc putch(buff[i]); 388ca: f5 01 movw r30, r10 388cc: 81 91 ld r24, Z+ 388ce: 5f 01 movw r10, r30 388d0: 0f 94 f3 ad call 0x35be6 ; 0x35be6 388d4: f3 cf rjmp .-26 ; 0x388bc } /* Get device signature bytes */ else if(ch == STK_READ_SIGN) { 388d6: 85 37 cpi r24, 0x75 ; 117 388d8: 51 f4 brne .+20 ; 0x388ee // READ SIGN - return what Avrdude wants to hear verifySpace(); 388da: 0f 94 72 b0 call 0x360e4 ; 0x360e4 putch(XFLASH_SIGNATURE_0); 388de: 8e e1 ldi r24, 0x1E ; 30 388e0: 0f 94 f3 ad call 0x35be6 ; 0x35be6 putch(XFLASH_SIGNATURE_1); 388e4: 88 e9 ldi r24, 0x98 ; 152 388e6: 0f 94 f3 ad call 0x35be6 ; 0x35be6 putch(XFLASH_SIGNATURE_2); 388ea: 81 e0 ldi r24, 0x01 ; 1 388ec: 05 cf rjmp .-502 ; 0x386f8 } else if (ch == STK_LEAVE_PROGMODE) { /* 'Q' */ 388ee: 81 35 cpi r24, 0x51 ; 81 388f0: 09 f0 breq .+2 ; 0x388f4 388f2: 29 cf rjmp .-430 ; 0x38746 : "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" ); 388f4: f8 e1 ldi r31, 0x18 ; 24 388f6: 28 e0 ldi r18, 0x08 ; 8 388f8: 0f b6 in r0, 0x3f ; 63 388fa: f8 94 cli 388fc: a8 95 wdr 388fe: f0 93 60 00 sts 0x0060, r31 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 38902: 0f be out 0x3f, r0 ; 63 38904: 20 93 60 00 sts 0x0060, r18 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 38908: 1e cf rjmp .-452 ; 0x38746 uint8_t optiboot_xflash_enter() { // Make sure to check boot_app_magic as well. Since these bootapp flags are located right in the middle of the stack, // they can be unintentionally changed. As a workaround to the language upload problem, do not only check for one bit if it's set, // but rather test 33 bits for the correct value before exiting optiboot early. if ((boot_app_magic == BOOT_APP_MAGIC) && (boot_app_flags & BOOT_APP_FLG_USER0)) return 1; 3890a: 81 e0 ldi r24, 0x01 ; 1 3890c: 7c ce rjmp .-776 ; 0x38606 0003890e : void FullScreenMsgRestoringTemperature(){ lcd_display_message_fullscreen_P(_T(MSG_MMU_RESTORE_TEMP)); } void ScreenUpdateEnable(){ lcd_update_enable(true); 3890e: 81 e0 ldi r24, 0x01 ; 1 38910: 0c 94 3d 6f jmp 0xde7a ; 0xde7a 00038914 : void MakeSound(SoundType s){ Sound_MakeSound( (eSOUND_TYPE)s); } static void FullScreenMsg(const char *pgmS, uint8_t slot){ 38914: 0f 93 push r16 38916: 1f 93 push r17 38918: cf 93 push r28 3891a: 8c 01 movw r16, r24 3891c: c6 2f mov r28, r22 lcd_update_enable(false); 3891e: 80 e0 ldi r24, 0x00 ; 0 38920: 0e 94 3d 6f call 0xde7a ; 0xde7a lcd_clear(); 38924: 0e 94 2b 6f call 0xde56 ; 0xde56 lcd_puts_at_P(0, 1, pgmS); 38928: a8 01 movw r20, r16 3892a: 61 e0 ldi r22, 0x01 ; 1 3892c: 80 e0 ldi r24, 0x00 ; 0 3892e: 0e 94 0c 6f call 0xde18 ; 0xde18 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 38932: 80 e2 ldi r24, 0x20 ; 32 38934: 0e 94 a7 6f call 0xdf4e ; 0xdf4e lcd_print(' '); lcd_print(slot + 1); 38938: 6c 2f mov r22, r28 3893a: 70 e0 ldi r23, 0x00 ; 0 3893c: 6f 5f subi r22, 0xFF ; 255 3893e: 7f 4f sbci r23, 0xFF ; 255 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); 38940: 07 2e mov r0, r23 38942: 00 0c add r0, r0 38944: 88 0b sbc r24, r24 38946: 99 0b sbc r25, r25 } 38948: cf 91 pop r28 3894a: 1f 91 pop r17 3894c: 0f 91 pop r16 3894e: 0c 94 b1 70 jmp 0xe162 ; 0xe162 00038952 : 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); 38952: 82 ed ldi r24, 0xD2 ; 210 38954: 9e e0 ldi r25, 0x0E ; 14 38956: 0e 94 40 76 call 0xec80 ; 0xec80 eeprom_increment_word((uint16_t *)EEPROM_MMU_FAIL_TOT); 3895a: 83 ed ldi r24, 0xD3 ; 211 3895c: 9e e0 ldi r25, 0x0E ; 14 3895e: 0c 94 33 76 jmp 0xec66 ; 0xec66 00038962 : inline bool Running() const { return state == State::Running; } inline bool FindaPressed() const { return regs8[0]; 38962: 41 e0 ldi r20, 0x01 ; 1 38964: 80 91 8f 13 lds r24, 0x138F ; 0x80138f 38968: 81 11 cpse r24, r1 3896a: 01 c0 rjmp .+2 ; 0x3896e 3896c: 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'); 3896e: 40 5d subi r20, 0xD0 ; 208 38970: 62 e0 ldi r22, 0x02 ; 2 38972: 83 e0 ldi r24, 0x03 ; 3 38974: 0e 94 18 6f call 0xde30 ; 0xde30 class PAT9125_sensor: public Filament_sensor { public: void init(); void deinit(); bool update(); bool getFilamentPresent() const { return filterFilPresent; } 38978: 41 e0 ldi r20, 0x01 ; 1 3897a: 80 91 b6 17 lds r24, 0x17B6 ; 0x8017b6 3897e: 81 11 cpse r24, r1 38980: 01 c0 rjmp .+2 ; 0x38984 38982: 40 e0 ldi r20, 0x00 ; 0 lcd_putc_at(8, 2, fsensor.getFilamentPresent() + '0'); 38984: 40 5d subi r20, 0xD0 ; 208 38986: 62 e0 ldi r22, 0x02 ; 2 38988: 88 e0 ldi r24, 0x08 ; 8 3898a: 0e 94 18 6f call 0xde30 ; 0xde30 // print active/changing filament slot lcd_set_cursor(10, 2); 3898e: 62 e0 ldi r22, 0x02 ; 2 38990: 8a e0 ldi r24, 0x0A ; 10 38992: 0e 94 f8 6e call 0xddf0 ; 0xddf0 lcdui_print_extruder(); 38996: 0f 94 1e 21 call 0x2423c ; 0x2423c // Print active extruder temperature lcd_set_cursor(16, 2); 3899a: 62 e0 ldi r22, 0x02 ; 2 3899c: 80 e1 ldi r24, 0x10 ; 16 3899e: 0e 94 f8 6e call 0xddf0 ; 0xddf0 lcd_printf_P(PSTR("%3d"), (int)(degHotend(0) + 0.5)); 389a2: 20 e0 ldi r18, 0x00 ; 0 389a4: 30 e0 ldi r19, 0x00 ; 0 389a6: 40 e0 ldi r20, 0x00 ; 0 389a8: 5f e3 ldi r21, 0x3F ; 63 389aa: 60 91 af 0d lds r22, 0x0DAF ; 0x800daf 389ae: 70 91 b0 0d lds r23, 0x0DB0 ; 0x800db0 389b2: 80 91 b1 0d lds r24, 0x0DB1 ; 0x800db1 389b6: 90 91 b2 0d lds r25, 0x0DB2 ; 0x800db2 389ba: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 389be: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> 389c2: 7f 93 push r23 389c4: 6f 93 push r22 389c6: 8b e3 ldi r24, 0x3B ; 59 389c8: 9c ea ldi r25, 0xAC ; 172 389ca: 9f 93 push r25 389cc: 8f 93 push r24 389ce: 0e 94 d1 6e call 0xdda2 ; 0xdda2 389d2: 0f 90 pop r0 389d4: 0f 90 pop r0 389d6: 0f 90 pop r0 389d8: 0f 90 pop r0 } 389da: 08 95 ret 000389dc : return 0; } } static constexpr uint8_t Nibble2Char(uint8_t n) { switch (n) { 389dc: 8a 30 cpi r24, 0x0A ; 10 389de: 20 f0 brcs .+8 ; 0x389e8 389e0: 80 31 cpi r24, 0x10 ; 16 389e2: 20 f4 brcc .+8 ; 0x389ec case 0xb: case 0xc: case 0xd: case 0xe: case 0xf: return n - 10 + 'a'; 389e4: 89 5a subi r24, 0xA9 ; 169 389e6: 08 95 ret case 5: case 6: case 7: case 8: case 9: return n + '0'; 389e8: 80 5d subi r24, 0xD0 ; 208 389ea: 08 95 ret case 0xd: case 0xe: case 0xf: return n - 10 + 'a'; default: return 0; 389ec: 80 e0 ldi r24, 0x00 ; 0 } } 389ee: 08 95 ret 000389f0 : i += AppendCRC(rsp.CRC(), txbuff + i); txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { 389f0: 0f 93 push r16 389f2: 1f 93 push r17 389f4: cf 93 push r28 389f6: df 93 push r29 389f8: 08 2f mov r16, r24 389fa: eb 01 movw r28, r22 if (value == 0) { *dst = '0'; return 1; } uint8_t v = value >> 4U; 389fc: 90 e0 ldi r25, 0x00 ; 0 389fe: 24 e0 ldi r18, 0x04 ; 4 38a00: 95 95 asr r25 38a02: 87 95 ror r24 38a04: 2a 95 dec r18 38a06: e1 f7 brne .-8 ; 0x38a00 uint8_t charsOut = 1; 38a08: 11 e0 ldi r17, 0x01 ; 1 if (v != 0) { // skip the first '0' if any 38a0a: 00 97 sbiw r24, 0x00 ; 0 38a0c: 21 f0 breq .+8 ; 0x38a16 *dst = Nibble2Char(v); 38a0e: 0f 94 ee c4 call 0x389dc ; 0x389dc 38a12: 89 93 st Y+, r24 ++dst; charsOut = 2; 38a14: 12 e0 ldi r17, 0x02 ; 2 } v = value & 0xfU; *dst = Nibble2Char(v); 38a16: 80 2f mov r24, r16 38a18: 8f 70 andi r24, 0x0F ; 15 38a1a: 0f 94 ee c4 call 0x389dc ; 0x389dc 38a1e: 88 83 st Y, r24 return charsOut; } 38a20: 81 2f mov r24, r17 38a22: df 91 pop r29 38a24: cf 91 pop r28 38a26: 1f 91 pop r17 38a28: 0f 91 pop r16 38a2a: 08 95 ret 00038a2c : } 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) { 38a2c: 80 33 cpi r24, 0x30 ; 48 38a2e: 30 f0 brcs .+12 ; 0x38a3c 38a30: 8a 33 cpi r24, 0x3A ; 58 38a32: 30 f0 brcs .+12 ; 0x38a40 38a34: 9f e9 ldi r25, 0x9F ; 159 38a36: 98 0f add r25, r24 38a38: 96 30 cpi r25, 0x06 ; 6 38a3a: 20 f0 brcs .+8 ; 0x38a44 case 'd': case 'e': case 'f': return c - 'a' + 10; default: return 0; 38a3c: 80 e0 ldi r24, 0x00 ; 0 } } 38a3e: 08 95 ret case '5': case '6': case '7': case '8': case '9': return c - '0'; 38a40: 80 53 subi r24, 0x30 ; 48 38a42: 08 95 ret case 'b': case 'c': case 'd': case 'e': case 'f': return c - 'a' + 10; 38a44: 87 55 subi r24, 0x57 ; 87 38a46: 08 95 ret 00038a48 : /// 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 { 38a48: cf 93 push r28 38a4a: df 93 push r29 38a4c: ec 01 movw r28, r24 uint8_t crc = 0; crc = modules::crc::CRC8::CCITT_updateCX(0, (uint8_t)code); 38a4e: 68 81 ld r22, Y 38a50: 80 e0 ldi r24, 0x00 ; 0 38a52: 0f 94 06 ae call 0x35c0c ; 0x35c0c crc = modules::crc::CRC8::CCITT_updateCX(crc, value); 38a56: 69 81 ldd r22, Y+1 ; 0x01 38a58: 0f 94 06 ae call 0x35c0c ; 0x35c0c crc = modules::crc::CRC8::CCITT_updateW(crc, value2); 38a5c: 6a 81 ldd r22, Y+2 ; 0x02 38a5e: 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]); 38a60: 0f 94 06 ae call 0x35c0c ; 0x35c0c 38a64: 6c 2f mov r22, r28 return crc; } 38a66: df 91 pop r29 38a68: cf 91 pop r28 38a6a: 0d 94 06 ae jmp 0x35c0c ; 0x35c0c 00038a6e : 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 { 38a6e: cf 93 push r28 38a70: df 93 push r29 38a72: ec 01 movw r28, r24 uint8_t crc = request.ComputeCRC8(); 38a74: 0f 94 24 c5 call 0x38a48 ; 0x38a48 crc = modules::crc::CRC8::CCITT_updateCX(crc, (uint8_t)paramCode); 38a78: 6d 81 ldd r22, Y+5 ; 0x05 38a7a: 0f 94 06 ae call 0x35c0c ; 0x35c0c crc = modules::crc::CRC8::CCITT_updateW(crc, paramValue); 38a7e: 6e 81 ldd r22, Y+6 ; 0x06 38a80: cf 81 ldd r28, Y+7 ; 0x07 38a82: 0f 94 06 ae call 0x35c0c ; 0x35c0c 38a86: 6c 2f mov r22, r28 return crc; } 38a88: df 91 pop r29 38a8a: cf 91 pop r28 38a8c: 0d 94 06 ae jmp 0x35c0c ; 0x35c0c 00038a90 : return crc; } /// @param code of the request message /// @param value of the request message inline constexpr RequestMsg(RequestMsgCodes code, uint8_t value) 38a90: cf 93 push r28 38a92: df 93 push r29 38a94: ec 01 movw r28, r24 : code(code) , value(value) , value2(0) , crc8(ComputeCRC8()) { 38a96: 68 83 st Y, r22 38a98: 49 83 std Y+1, r20 ; 0x01 38a9a: 1b 82 std Y+3, r1 ; 0x03 38a9c: 1a 82 std Y+2, r1 ; 0x02 38a9e: 0f 94 24 c5 call 0x38a48 ; 0x38a48 38aa2: 8c 83 std Y+4, r24 ; 0x04 } 38aa4: df 91 pop r29 38aa6: cf 91 pop r28 38aa8: 08 95 ret 00038aaa : void power_off() { } void reset() { #ifdef MMU_HWRESET // HW - pulse reset pin WRITE(MMU_RST_PIN, 0); 38aaa: 9f b7 in r25, 0x3f ; 63 38aac: f8 94 cli 38aae: e5 e0 ldi r30, 0x05 ; 5 38ab0: f1 e0 ldi r31, 0x01 ; 1 38ab2: 80 81 ld r24, Z 38ab4: 8f 7d andi r24, 0xDF ; 223 38ab6: 80 83 st Z, r24 38ab8: 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); 38aba: 8f e8 ldi r24, 0x8F ; 143 38abc: 91 e0 ldi r25, 0x01 ; 1 38abe: 01 97 sbiw r24, 0x01 ; 1 38ac0: f1 f7 brne .-4 ; 0x38abe 38ac2: 00 c0 rjmp .+0 ; 0x38ac4 38ac4: 00 00 nop _delay_us(100); WRITE(MMU_RST_PIN, 1); 38ac6: 9f b7 in r25, 0x3f ; 63 38ac8: f8 94 cli 38aca: 80 81 ld r24, Z 38acc: 80 62 ori r24, 0x20 ; 32 38ace: 80 83 st Z, r24 38ad0: 9f bf out 0x3f, r25 ; 63 #else mmu2.Reset(MMU2::Software); // @@TODO needs to be redesigned, this power implementation shall not know anything about the MMU itself #endif // otherwise HW reset is not available } 38ad2: 08 95 ret 00038ad4 : void Enable_E0() { enable_e0(); } void Disable_E0() { disable_e0(); 38ad4: 14 9a sbi 0x02, 4 ; 2 } 38ad6: 08 95 ret 00038ad8 : 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) { 38ad8: cf 92 push r12 38ada: df 92 push r13 38adc: ef 92 push r14 38ade: ff 92 push r15 38ae0: cf 93 push r28 38ae2: df 93 push r29 38ae4: 69 01 movw r12, r18 38ae6: 7a 01 movw r14, r20 current_position[E_AXIS] += delta; 38ae8: c1 e9 ldi r28, 0x91 ; 145 38aea: d6 e0 ldi r29, 0x06 ; 6 38aec: 9b 01 movw r18, r22 38aee: ac 01 movw r20, r24 38af0: 6c 85 ldd r22, Y+12 ; 0x0c 38af2: 7d 85 ldd r23, Y+13 ; 0x0d 38af4: 8e 85 ldd r24, Y+14 ; 0x0e 38af6: 9f 85 ldd r25, Y+15 ; 0x0f 38af8: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 38afc: 6c 87 std Y+12, r22 ; 0x0c 38afe: 7d 87 std Y+13, r23 ; 0x0d 38b00: 8e 87 std Y+14, r24 ; 0x0e 38b02: 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); 38b04: c7 01 movw r24, r14 38b06: b6 01 movw r22, r12 } void extruder_move(float delta, float feedRate) { current_position[E_AXIS] += delta; planner_line_to_current_position(feedRate); } 38b08: df 91 pop r29 38b0a: cf 91 pop r28 38b0c: ff 90 pop r15 38b0e: ef 90 pop r14 38b10: df 90 pop r13 38b12: 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); 38b14: 0d 94 04 c0 jmp 0x38008 ; 0x38008 00038b18 : st_synchronize(); } static inline void go_to_current(float fr) { plan_buffer_line_curposXYZE(fr); 38b18: 0f 94 04 c0 call 0x38008 ; 0x38008 st_synchronize(); 38b1c: 0d 94 a3 42 jmp 0x28546 ; 0x28546 00038b20 : #include "mmu2_log.h" namespace MMU2 { void LogErrorEvent_P(const char *msg){ 38b20: cf 93 push r28 38b22: df 93 push r29 38b24: ec 01 movw r28, r24 SERIAL_ECHO_START; //!@todo Decide MMU errors on serial line 38b26: 82 ef ldi r24, 0xF2 ; 242 38b28: 9b ea ldi r25, 0xAB ; 171 38b2a: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_MMU2(); 38b2e: 85 e3 ldi r24, 0x35 ; 53 38b30: 9c ea ldi r25, 0xAC ; 172 38b32: 0e 94 68 77 call 0xeed0 ; 0xeed0 SERIAL_ECHOLNRPGM(msg); 38b36: ce 01 movw r24, r28 } 38b38: df 91 pop r29 38b3a: 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); 38b3c: 0c 94 93 79 jmp 0xf326 ; 0xf326 00038b40 : #include "Filament_sensor.h" namespace MMU2 { FilamentState WhereIsFilament(){ return fsensor.getFilamentPresent() ? FilamentState::AT_FSENSOR : FilamentState::NOT_PRESENT; 38b40: 81 e0 ldi r24, 0x01 ; 1 38b42: 90 91 b6 17 lds r25, 0x17B6 ; 0x8017b6 38b46: 91 11 cpse r25, r1 38b48: 01 c0 rjmp .+2 ; 0x38b4c 38b4a: 80 e0 ldi r24, 0x00 ; 0 } 38b4c: 08 95 ret 00038b4e : constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38b4e: 89 32 cpi r24, 0x29 ; 41 38b50: 20 e8 ldi r18, 0x80 ; 128 38b52: 92 07 cpc r25, r18 38b54: 09 f4 brne .+2 ; 0x38b58 38b56: 97 c0 rjmp .+302 ; 0x38c86 38b58: 08 f0 brcs .+2 ; 0x38b5c 38b5a: 48 c0 rjmp .+144 ; 0x38bec 38b5c: 86 30 cpi r24, 0x06 ; 6 38b5e: 60 e8 ldi r22, 0x80 ; 128 38b60: 96 07 cpc r25, r22 38b62: 09 f4 brne .+2 ; 0x38b66 38b64: 9a c0 rjmp .+308 ; 0x38c9a 38b66: 30 f5 brcc .+76 ; 0x38bb4 38b68: 83 30 cpi r24, 0x03 ; 3 38b6a: 40 e8 ldi r20, 0x80 ; 128 38b6c: 94 07 cpc r25, r20 38b6e: 09 f4 brne .+2 ; 0x38b72 38b70: 80 c0 rjmp .+256 ; 0x38c72 38b72: a8 f4 brcc .+42 ; 0x38b9e 38b74: 81 30 cpi r24, 0x01 ; 1 38b76: 20 e8 ldi r18, 0x80 ; 128 38b78: 92 07 cpc r25, r18 38b7a: 09 f4 brne .+2 ; 0x38b7e 38b7c: 17 c1 rjmp .+558 ; 0x38dac 38b7e: 82 30 cpi r24, 0x02 ; 2 38b80: 40 e8 ldi r20, 0x80 ; 128 38b82: 94 07 cpc r25, r20 38b84: 09 f4 brne .+2 ; 0x38b88 38b86: 73 c0 rjmp .+230 ; 0x38c6e 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); 38b88: 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)) { 38b8a: 86 ff sbrs r24, 6 38b8c: 8e c0 rjmp .+284 ; 0x38caa 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); 38b8e: 22 27 eor r18, r18 38b90: 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) { 38b92: 21 15 cp r18, r1 38b94: 32 4c sbci r19, 0xC2 ; 194 38b96: 09 f0 breq .+2 ; 0x38b9a 38b98: 9e c0 rjmp .+316 ; 0x38cd6 return FindErrorIndex(ERR_ELECTRICAL_MMU_PULLEY_SELFTEST_FAILED); 38b9a: 8e e1 ldi r24, 0x1E ; 30 38b9c: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38b9e: 84 30 cpi r24, 0x04 ; 4 38ba0: 60 e8 ldi r22, 0x80 ; 128 38ba2: 96 07 cpc r25, r22 38ba4: 09 f4 brne .+2 ; 0x38ba8 38ba6: 67 c0 rjmp .+206 ; 0x38c76 38ba8: 85 30 cpi r24, 0x05 ; 5 38baa: 20 e8 ldi r18, 0x80 ; 128 38bac: 92 07 cpc r25, r18 38bae: 61 f7 brne .-40 ; 0x38b88 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); 38bb0: 84 e2 ldi r24, 0x24 ; 36 38bb2: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38bb4: 8a 30 cpi r24, 0x0A ; 10 38bb6: 40 e8 ldi r20, 0x80 ; 128 38bb8: 94 07 cpc r25, r20 38bba: 09 f4 brne .+2 ; 0x38bbe 38bbc: 5e c0 rjmp .+188 ; 0x38c7a 38bbe: 58 f4 brcc .+22 ; 0x38bd6 38bc0: 88 30 cpi r24, 0x08 ; 8 38bc2: 20 e8 ldi r18, 0x80 ; 128 38bc4: 92 07 cpc r25, r18 38bc6: 09 f4 brne .+2 ; 0x38bca 38bc8: 6e c0 rjmp .+220 ; 0x38ca6 38bca: 89 30 cpi r24, 0x09 ; 9 38bcc: 40 e8 ldi r20, 0x80 ; 128 38bce: 94 07 cpc r25, r20 38bd0: d9 f6 brne .-74 ; 0x38b88 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); 38bd2: 85 e0 ldi r24, 0x05 ; 5 38bd4: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38bd6: 8c 30 cpi r24, 0x0C ; 12 38bd8: 60 e8 ldi r22, 0x80 ; 128 38bda: 96 07 cpc r25, r22 38bdc: 09 f4 brne .+2 ; 0x38be0 38bde: 51 c0 rjmp .+162 ; 0x38c82 38be0: 8d 30 cpi r24, 0x0D ; 13 38be2: 20 e8 ldi r18, 0x80 ; 128 38be4: 92 07 cpc r25, r18 38be6: 81 f6 brne .-96 ; 0x38b88 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); 38be8: 81 e2 ldi r24, 0x21 ; 33 38bea: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38bec: 8f 32 cpi r24, 0x2F ; 47 38bee: 40 e8 ldi r20, 0x80 ; 128 38bf0: 94 07 cpc r25, r20 38bf2: 09 f4 brne .+2 ; 0x38bf6 38bf4: 56 c0 rjmp .+172 ; 0x38ca2 38bf6: e0 f4 brcc .+56 ; 0x38c30 38bf8: 8c 32 cpi r24, 0x2C ; 44 38bfa: 20 e8 ldi r18, 0x80 ; 128 38bfc: 92 07 cpc r25, r18 38bfe: 09 f4 brne .+2 ; 0x38c02 38c00: 4e c0 rjmp .+156 ; 0x38c9e 38c02: 58 f4 brcc .+22 ; 0x38c1a 38c04: 8a 32 cpi r24, 0x2A ; 42 38c06: 60 e8 ldi r22, 0x80 ; 128 38c08: 96 07 cpc r25, r22 38c0a: c9 f1 breq .+114 ; 0x38c7e 38c0c: 8b 32 cpi r24, 0x2B ; 43 38c0e: 20 e8 ldi r18, 0x80 ; 128 38c10: 92 07 cpc r25, r18 38c12: 09 f0 breq .+2 ; 0x38c16 38c14: b9 cf rjmp .-142 ; 0x38b88 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); 38c16: 86 e2 ldi r24, 0x26 ; 38 38c18: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38c1a: 8d 32 cpi r24, 0x2D ; 45 38c1c: 40 e8 ldi r20, 0x80 ; 128 38c1e: 94 07 cpc r25, r20 38c20: d1 f1 breq .+116 ; 0x38c96 38c22: 8e 32 cpi r24, 0x2E ; 46 38c24: 60 e8 ldi r22, 0x80 ; 128 38c26: 96 07 cpc r25, r22 38c28: 09 f0 breq .+2 ; 0x38c2c 38c2a: ae cf rjmp .-164 ; 0x38b88 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); 38c2c: 82 e2 ldi r24, 0x22 ; 34 38c2e: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38c30: 87 38 cpi r24, 0x87 ; 135 38c32: 20 e8 ldi r18, 0x80 ; 128 38c34: 92 07 cpc r25, r18 38c36: 49 f1 breq .+82 ; 0x38c8a 38c38: 58 f4 brcc .+22 ; 0x38c50 38c3a: 87 34 cpi r24, 0x47 ; 71 38c3c: 60 e8 ldi r22, 0x80 ; 128 38c3e: 96 07 cpc r25, r22 38c40: 29 f0 breq .+10 ; 0x38c4c 38c42: 8b 34 cpi r24, 0x4B ; 75 38c44: 20 e8 ldi r18, 0x80 ; 128 38c46: 92 07 cpc r25, r18 38c48: 09 f0 breq .+2 ; 0x38c4c 38c4a: 9e cf rjmp .-196 ; 0x38b88 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); 38c4c: 84 e0 ldi r24, 0x04 ; 4 38c4e: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38c50: 87 30 cpi r24, 0x07 ; 7 38c52: 41 e8 ldi r20, 0x81 ; 129 38c54: 94 07 cpc r25, r20 38c56: d9 f0 breq .+54 ; 0x38c8e 38c58: 8b 30 cpi r24, 0x0B ; 11 38c5a: 61 e8 ldi r22, 0x81 ; 129 38c5c: 96 07 cpc r25, r22 38c5e: c9 f0 breq .+50 ; 0x38c92 38c60: 8b 38 cpi r24, 0x8B ; 139 38c62: 20 e8 ldi r18, 0x80 ; 128 38c64: 92 07 cpc r25, r18 38c66: 09 f0 breq .+2 ; 0x38c6a 38c68: 8f cf rjmp .-226 ; 0x38b88 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); 38c6a: 89 e0 ldi r24, 0x09 ; 9 38c6c: 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); 38c6e: 81 e0 ldi r24, 0x01 ; 1 38c70: 08 95 ret case ErrorCode::FSENSOR_DIDNT_SWITCH_ON: return FindErrorIndex(ERR_MECHANICAL_FSENSOR_DIDNT_TRIGGER); 38c72: 82 e0 ldi r24, 0x02 ; 2 38c74: 08 95 ret case ErrorCode::FSENSOR_DIDNT_SWITCH_OFF: return FindErrorIndex(ERR_MECHANICAL_FSENSOR_FILAMENT_STUCK); 38c76: 83 e0 ldi r24, 0x03 ; 3 38c78: 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); 38c7a: 86 e0 ldi r24, 0x06 ; 6 38c7c: 08 95 ret case ErrorCode::LOAD_TO_EXTRUDER_FAILED: return FindErrorIndex(ERR_MECHANICAL_LOAD_TO_EXTRUDER_FAILED); 38c7e: 87 e0 ldi r24, 0x07 ; 7 38c80: 08 95 ret case ErrorCode::FILAMENT_EJECTED: return FindErrorIndex(ERR_SYSTEM_FILAMENT_EJECTED); 38c82: 8a e2 ldi r24, 0x2A ; 42 38c84: 08 95 ret case ErrorCode::FILAMENT_CHANGE: return FindErrorIndex(ERR_SYSTEM_FILAMENT_CHANGE); 38c86: 8b e2 ldi r24, 0x2B ; 43 38c88: 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); 38c8a: 88 e0 ldi r24, 0x08 ; 8 38c8c: 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); 38c8e: 8a e0 ldi r24, 0x0A ; 10 38c90: 08 95 ret case ErrorCode::MOVE_IDLER_FAILED: return FindErrorIndex(ERR_MECHANICAL_IDLER_CANNOT_MOVE); 38c92: 8b e0 ldi r24, 0x0B ; 11 38c94: 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); 38c96: 83 e2 ldi r24, 0x23 ; 35 38c98: 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); 38c9a: 85 e2 ldi r24, 0x25 ; 37 38c9c: 08 95 ret case ErrorCode::QUEUE_FULL: return FindErrorIndex(ERR_SYSTEM_QUEUE_FULL); case ErrorCode::VERSION_MISMATCH: return FindErrorIndex(ERR_SYSTEM_FW_UPDATE_NEEDED); 38c9e: 87 e2 ldi r24, 0x27 ; 39 38ca0: 08 95 ret case ErrorCode::INTERNAL: return FindErrorIndex(ERR_SYSTEM_FW_RUNTIME_ERROR); 38ca2: 88 e2 ldi r24, 0x28 ; 40 38ca4: 08 95 ret case ErrorCode::FINDA_VS_EEPROM_DISREPANCY: return FindErrorIndex(ERR_SYSTEM_UNLOAD_MANUALLY); 38ca6: 89 e2 ldi r24, 0x29 ; 41 38ca8: 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)) { 38caa: 87 ff sbrs r24, 7 38cac: 07 c0 rjmp .+14 ; 0x38cbc 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); 38cae: 22 27 eor r18, r18 38cb0: 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) { 38cb2: 21 15 cp r18, r1 38cb4: 32 4c sbci r19, 0xC2 ; 194 38cb6: a1 f5 brne .+104 ; 0x38d20 return FindErrorIndex(ERR_ELECTRICAL_MMU_SELECTOR_SELFTEST_FAILED); 38cb8: 8f e1 ldi r24, 0x1F ; 31 38cba: 08 95 ret } } else if (ContainsBit(ec, ErrorCode::TMC_IDLER_BIT)) { 38cbc: 22 27 eor r18, r18 38cbe: 31 70 andi r19, 0x01 ; 1 38cc0: 90 ff sbrs r25, 0 38cc2: 52 c0 rjmp .+164 ; 0x38d68 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); 38cc4: ac 01 movw r20, r24 38cc6: 44 27 eor r20, r20 38cc8: 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) { 38cca: 41 15 cp r20, r1 38ccc: 52 4c sbci r21, 0xC2 ; 194 38cce: 09 f0 breq .+2 ; 0x38cd2 38cd0: 4b c0 rjmp .+150 ; 0x38d68 return FindErrorIndex(ERR_ELECTRICAL_MMU_IDLER_SELFTEST_FAILED); 38cd2: 80 e2 ldi r24, 0x20 ; 32 38cd4: 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; 38cd6: 9c 01 movw r18, r24 38cd8: 22 27 eor r18, r18 38cda: 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)) { 38cdc: 23 2b or r18, r19 38cde: 09 f0 breq .+2 ; 0x38ce2 38ce0: 67 c0 rjmp .+206 ; 0x38db0 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; 38ce2: 9c 01 movw r18, r24 38ce4: 22 27 eor r18, r18 38ce6: 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)) { 38ce8: 23 2b or r18, r19 38cea: 09 f0 breq .+2 ; 0x38cee 38cec: 63 c0 rjmp .+198 ; 0x38db4 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; 38cee: 9c 01 movw r18, r24 38cf0: 22 27 eor r18, r18 38cf2: 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)) { 38cf4: 23 2b or r18, r19 38cf6: 09 f0 breq .+2 ; 0x38cfa 38cf8: 5f c0 rjmp .+190 ; 0x38db8 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; 38cfa: 9c 01 movw r18, r24 38cfc: 22 27 eor r18, r18 38cfe: 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)) { 38d00: 23 2b or r18, r19 38d02: 09 f0 breq .+2 ; 0x38d06 38d04: 5b c0 rjmp .+182 ; 0x38dbc 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; 38d06: 9c 01 movw r18, r24 38d08: 22 27 eor r18, r18 38d0a: 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)) { 38d0c: 23 2b or r18, r19 38d0e: 09 f0 breq .+2 ; 0x38d12 38d10: 57 c0 rjmp .+174 ; 0x38dc0 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; 38d12: 88 27 eor r24, r24 38d14: 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)) { 38d16: 89 2b or r24, r25 38d18: 09 f4 brne .+2 ; 0x38d1c 38d1a: 68 c0 rjmp .+208 ; 0x38dec return FindErrorIndex(ERR_TEMPERATURE_TMC_PULLEY_OVERHEAT_ERROR); 38d1c: 8f e0 ldi r24, 0x0F ; 15 38d1e: 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; 38d20: 9c 01 movw r18, r24 38d22: 22 27 eor r18, r18 38d24: 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)) { 38d26: 23 2b or r18, r19 38d28: 09 f0 breq .+2 ; 0x38d2c 38d2a: 4c c0 rjmp .+152 ; 0x38dc4 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; 38d2c: 9c 01 movw r18, r24 38d2e: 22 27 eor r18, r18 38d30: 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)) { 38d32: 23 2b or r18, r19 38d34: 09 f0 breq .+2 ; 0x38d38 38d36: 48 c0 rjmp .+144 ; 0x38dc8 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; 38d38: 9c 01 movw r18, r24 38d3a: 22 27 eor r18, r18 38d3c: 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)) { 38d3e: 23 2b or r18, r19 38d40: 09 f0 breq .+2 ; 0x38d44 38d42: 44 c0 rjmp .+136 ; 0x38dcc 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; 38d44: 9c 01 movw r18, r24 38d46: 22 27 eor r18, r18 38d48: 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)) { 38d4a: 23 2b or r18, r19 38d4c: 09 f0 breq .+2 ; 0x38d50 38d4e: 40 c0 rjmp .+128 ; 0x38dd0 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; 38d50: 9c 01 movw r18, r24 38d52: 22 27 eor r18, r18 38d54: 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)) { 38d56: 23 2b or r18, r19 38d58: e9 f5 brne .+122 ; 0x38dd4 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; 38d5a: 88 27 eor r24, r24 38d5c: 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)) { 38d5e: 89 2b or r24, r25 38d60: 09 f4 brne .+2 ; 0x38d64 38d62: 44 c0 rjmp .+136 ; 0x38dec return FindErrorIndex(ERR_TEMPERATURE_TMC_SELECTOR_OVERHEAT_ERROR); 38d64: 80 e1 ldi r24, 0x10 ; 16 38d66: 08 95 ret } } else if (ContainsBit(ec, ErrorCode::TMC_IDLER_BIT)) { 38d68: 23 2b or r18, r19 38d6a: 09 f4 brne .+2 ; 0x38d6e 38d6c: 3f c0 rjmp .+126 ; 0x38dec 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; 38d6e: 9c 01 movw r18, r24 38d70: 22 27 eor r18, r18 38d72: 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)) { 38d74: 23 2b or r18, r19 38d76: 81 f5 brne .+96 ; 0x38dd8 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; 38d78: 9c 01 movw r18, r24 38d7a: 22 27 eor r18, r18 38d7c: 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)) { 38d7e: 23 2b or r18, r19 38d80: 69 f5 brne .+90 ; 0x38ddc 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; 38d82: 9c 01 movw r18, r24 38d84: 22 27 eor r18, r18 38d86: 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)) { 38d88: 23 2b or r18, r19 38d8a: 51 f5 brne .+84 ; 0x38de0 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; 38d8c: 9c 01 movw r18, r24 38d8e: 22 27 eor r18, r18 38d90: 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)) { 38d92: 23 2b or r18, r19 38d94: 39 f5 brne .+78 ; 0x38de4 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; 38d96: 9c 01 movw r18, r24 38d98: 22 27 eor r18, r18 38d9a: 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)) { 38d9c: 23 2b or r18, r19 38d9e: 21 f5 brne .+72 ; 0x38de8 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; 38da0: 88 27 eor r24, r24 38da2: 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)) { 38da4: 89 2b or r24, r25 38da6: 11 f1 breq .+68 ; 0x38dec return FindErrorIndex(ERR_TEMPERATURE_TMC_IDLER_OVERHEAT_ERROR); 38da8: 81 e1 ldi r24, 0x11 ; 17 38daa: 08 95 ret } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { case ErrorCode::FINDA_DIDNT_SWITCH_ON: return FindErrorIndex(ERR_MECHANICAL_FINDA_DIDNT_TRIGGER); 38dac: 80 e0 ldi r24, 0x00 ; 0 38dae: 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); 38db0: 82 e1 ldi r24, 0x12 ; 18 38db2: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_DRIVER_RESET); 38db4: 85 e1 ldi r24, 0x15 ; 21 38db6: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_UNDERVOLTAGE_ERROR); 38db8: 88 e1 ldi r24, 0x18 ; 24 38dba: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_DRIVER_SHORTED); 38dbc: 8b e1 ldi r24, 0x1B ; 27 38dbe: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_PULLEY_TOO_HOT); 38dc0: 8c e0 ldi r24, 0x0C ; 12 38dc2: 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); 38dc4: 83 e1 ldi r24, 0x13 ; 19 38dc6: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_DRIVER_RESET); 38dc8: 86 e1 ldi r24, 0x16 ; 22 38dca: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_UNDERVOLTAGE_ERROR); 38dcc: 89 e1 ldi r24, 0x19 ; 25 38dce: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_DRIVER_SHORTED); 38dd0: 8c e1 ldi r24, 0x1C ; 28 38dd2: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_SELECTOR_TOO_HOT); 38dd4: 8d e0 ldi r24, 0x0D ; 13 38dd6: 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); 38dd8: 84 e1 ldi r24, 0x14 ; 20 38dda: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_DRIVER_RESET); 38ddc: 87 e1 ldi r24, 0x17 ; 23 38dde: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_UNDERVOLTAGE_ERROR); 38de0: 8a e1 ldi r24, 0x1A ; 26 38de2: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_DRIVER_SHORTED); 38de4: 8d e1 ldi r24, 0x1D ; 29 38de6: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_IDLER_TOO_HOT); 38de8: 8e e0 ldi r24, 0x0E ; 14 38dea: 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); 38dec: 8c e2 ldi r24, 0x2C ; 44 } 38dee: 08 95 ret 00038df0 : bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { 38df0: cf 92 push r12 38df2: df 92 push r13 38df4: ef 92 push r14 38df6: ff 92 push r15 38df8: 0f 93 push r16 38dfa: 1f 93 push r17 38dfc: cf 93 push r28 38dfe: df 93 push r29 if (putErrorScreenToSleep) return; if (mmu2.MMUCurrentErrorCode() == ErrorCode::OK && mmu2.MMULastErrorSource() == MMU2::ErrorSourceMMU) { 38e00: 20 91 8a 13 lds r18, 0x138A ; 0x80138a 38e04: 30 91 8b 13 lds r19, 0x138B ; 0x80138b 38e08: 21 30 cpi r18, 0x01 ; 1 38e0a: 31 05 cpc r19, r1 38e0c: 39 f4 brne .+14 ; 0x38e1c 38e0e: 20 91 b3 13 lds r18, 0x13B3 ; 0x8013b3 38e12: 21 30 cpi r18, 0x01 ; 1 38e14: 19 f4 brne .+6 ; 0x38e1c // 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; 38e16: 22 e0 ldi r18, 0x02 ; 2 38e18: 20 93 f5 17 sts 0x17F5, r18 ; 0x8017f5 } const uint8_t ei = PrusaErrorCodeIndex((ErrorCode)ec); 38e1c: 0f 94 a7 c5 call 0x38b4e ; 0x38b4e 38e20: d8 2f mov r29, r24 switch ((uint8_t)ReportErrorHookState) { 38e22: 80 91 f5 17 lds r24, 0x17F5 ; 0x8017f5 38e26: 81 30 cpi r24, 0x01 ; 1 38e28: 09 f4 brne .+2 ; 0x38e2c 38e2a: 64 c0 rjmp .+200 ; 0x38ef4 38e2c: 60 f0 brcs .+24 ; 0x38e46 38e2e: 82 30 cpi r24, 0x02 ; 2 38e30: 09 f4 brne .+2 ; 0x38e34 38e32: f4 c0 rjmp .+488 ; 0x3901c ReportErrorHookState = ReportErrorHookStates::RENDER_ERROR_SCREEN; break; default: break; } } 38e34: df 91 pop r29 38e36: cf 91 pop r28 38e38: 1f 91 pop r17 38e3a: 0f 91 pop r16 38e3c: ff 90 pop r15 38e3e: ef 90 pop r14 38e40: df 90 pop r13 38e42: cf 90 pop r12 38e44: 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); 38e46: 84 e0 ldi r24, 0x04 ; 4 38e48: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be 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); 38e4c: 0d 2f mov r16, r29 38e4e: 10 e0 ldi r17, 0x00 ; 0 38e50: f8 01 movw r30, r16 38e52: e1 56 subi r30, 0x61 ; 97 38e54: f3 45 sbci r31, 0x53 ; 83 38e56: 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); 38e58: fc 2e mov r15, r28 38e5a: f2 94 swap r15 38e5c: 6f e0 ldi r22, 0x0F ; 15 38e5e: f6 22 and r15, r22 const uint8_t button_op_middle = BUTTON_OP_MIDDLE(button_operation); 38e60: 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); 38e62: 80 e0 ldi r24, 0x00 ; 0 38e64: 0e 94 3d 6f call 0xde7a ; 0xde7a lcd_clear(); 38e68: 0e 94 2b 6f call 0xde56 ; 0xde56 // 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); 38e6c: 00 0f add r16, r16 38e6e: 11 1f adc r17, r17 38e70: f8 01 movw r30, r16 38e72: e4 53 subi r30, 0x34 ; 52 38e74: f3 45 sbci r31, 0x53 ; 83 38e76: c5 90 lpm r12, Z+ 38e78: d4 90 lpm r13, Z } const char *PrusaErrorTitle(uint8_t i) { return (const char *)pgm_read_ptr(errorTitles + i); 38e7a: 09 59 subi r16, 0x99 ; 153 38e7c: 16 45 sbci r17, 0x56 ; 86 38e7e: f8 01 movw r30, r16 38e80: 85 91 lpm r24, Z+ 38e82: 94 91 lpm r25, Z // Print title and header lcd_printf_P(PSTR("%.20S\nprusa.io/04%hu"), _T(PrusaErrorTitle(ei)), PrusaErrorCode(ei) ); 38e84: 0e 94 c4 72 call 0xe588 ; 0xe588 38e88: df 92 push r13 38e8a: cf 92 push r12 38e8c: 9f 93 push r25 38e8e: 8f 93 push r24 38e90: 88 e3 ldi r24, 0x38 ; 56 38e92: 9d ea ldi r25, 0xAD ; 173 38e94: 9f 93 push r25 38e96: 8f 93 push r24 38e98: 0e 94 d1 6e call 0xdda2 ; 0xdda2 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)); 38e9c: 4f ed ldi r20, 0xDF ; 223 38e9e: 59 ea ldi r21, 0xA9 ; 169 38ea0: 62 e0 ldi r22, 0x02 ; 2 38ea2: 80 e0 ldi r24, 0x00 ; 0 38ea4: 0e 94 0c 6f call 0xde18 ; 0xde18 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()); 38ea8: 0f 90 pop r0 38eaa: 0f 90 pop r0 38eac: 0f 90 pop r0 38eae: 0f 90 pop r0 38eb0: 0f 90 pop r0 38eb2: 0f 90 pop r0 38eb4: f1 10 cpse r15, r1 38eb6: c6 c0 rjmp .+396 ; 0x39044 38eb8: 10 e0 ldi r17, 0x00 ; 0 38eba: 00 e0 ldi r16, 0x00 ; 0 38ebc: 42 e1 ldi r20, 0x12 ; 18 38ebe: e4 2e mov r14, r20 38ec0: 50 e4 ldi r21, 0x40 ; 64 38ec2: c5 2e mov r12, r21 38ec4: 51 e7 ldi r21, 0x71 ; 113 38ec6: 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); 38ec8: ec 2f mov r30, r28 38eca: f0 e0 ldi r31, 0x00 ; 0 38ecc: ee 0f add r30, r30 38ece: ff 1f adc r31, r31 38ed0: ec 5d subi r30, 0xDC ; 220 38ed2: f2 45 sbci r31, 0x52 ; 82 38ed4: 85 91 lpm r24, Z+ 38ed6: 94 91 lpm r25, Z 38ed8: 0e 94 c4 72 call 0xe588 ; 0xe588 38edc: bc 01 movw r22, r24 38ede: 81 e0 ldi r24, 0x01 ; 1 38ee0: f1 10 cpse r15, r1 38ee2: 01 c0 rjmp .+2 ; 0x38ee6 38ee4: 80 e0 ldi r24, 0x00 ; 0 38ee6: 2e 2d mov r18, r14 38ee8: a6 01 movw r20, r12 38eea: 0f 94 69 1f call 0x23ed2 ; 0x23ed2 switch ((uint8_t)ReportErrorHookState) { case (uint8_t)ReportErrorHookStates::RENDER_ERROR_SCREEN: KEEPALIVE_STATE(PAUSED_FOR_USER); ReportErrorHookStaticRender(ei); ReportErrorHookState = ReportErrorHookStates::MONITOR_SELECTION; 38eee: 81 e0 ldi r24, 0x01 ; 1 38ef0: 80 93 f5 17 sts 0x17F5, r24 ; 0x8017f5 [[fallthrough]]; case (uint8_t)ReportErrorHookStates::MONITOR_SELECTION: is_mmu_error_monitor_active = true; 38ef4: 81 e0 ldi r24, 0x01 ; 1 38ef6: 80 93 c2 06 sts 0x06C2, r24 ; 0x8006c2 <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.490> ReportErrorHookDynamicRender(); // Render dynamic characters 38efa: 0f 94 b1 c4 call 0x38962 ; 0x38962 sound_wait_for_user(); 38efe: 0f 94 a5 51 call 0x2a34a ; 0x2a34a 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); 38f02: 0d 2f mov r16, r29 38f04: 10 e0 ldi r17, 0x00 ; 0 38f06: f8 01 movw r30, r16 38f08: e1 56 subi r30, 0x61 ; 97 38f0a: f3 45 sbci r31, 0x53 ; 83 38f0c: 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); 38f0e: dc 2f mov r29, r28 38f10: d2 95 swap r29 38f12: 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; 38f14: 80 91 ed 17 lds r24, 0x17ED ; 0x8017ed 38f18: 81 11 cpse r24, r1 38f1a: 09 c0 rjmp .+18 ; 0x38f2e 38f1c: 81 e0 ldi r24, 0x01 ; 1 38f1e: d1 11 cpse r29, r1 38f20: 01 c0 rjmp .+2 ; 0x38f24 38f22: 80 e0 ldi r24, 0x00 ; 0 38f24: 80 93 ec 17 sts 0x17EC, r24 ; 0x8017ec 38f28: 81 e0 ldi r24, 0x01 ; 1 38f2a: 80 93 ed 17 sts 0x17ED, r24 ; 0x8017ed static int8_t choice_selected = -1; if (reset_button_selection) { 38f2e: 80 91 eb 17 lds r24, 0x17EB ; 0x8017eb 38f32: 88 23 and r24, r24 38f34: 41 f0 breq .+16 ; 0x38f46 // 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; 38f36: 81 e0 ldi r24, 0x01 ; 1 38f38: d1 11 cpse r29, r1 38f3a: 01 c0 rjmp .+2 ; 0x38f3e 38f3c: 80 e0 ldi r24, 0x00 ; 0 38f3e: 80 93 ec 17 sts 0x17EC, r24 ; 0x8017ec choice_selected = -1; reset_button_selection = 0; 38f42: 10 92 eb 17 sts 0x17EB, r1 ; 0x8017eb } // Check if knob was rotated if (lcd_encoder) { 38f46: 20 91 6f 06 lds r18, 0x066F ; 0x80066f 38f4a: 30 91 70 06 lds r19, 0x0670 ; 0x800670 38f4e: 21 15 cp r18, r1 38f50: 31 05 cpc r19, r1 38f52: b9 f1 breq .+110 ; 0x38fc2 38f54: 80 91 ec 17 lds r24, 0x17EC ; 0x8017ec if (two_choices == false) { // third_choice is not nullptr, safe to dereference 38f58: dd 23 and r29, r29 38f5a: 61 f0 breq .+24 ; 0x38f74 if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 38f5c: 37 ff sbrs r19, 7 38f5e: 06 c0 rjmp .+12 ; 0x38f6c 38f60: 88 23 and r24, r24 38f62: 69 f0 breq .+26 ; 0x38f7e // Rotating knob counter clockwise current_selection--; 38f64: 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; 38f66: 80 93 ec 17 sts 0x17EC, r24 ; 0x8017ec 38f6a: 09 c0 rjmp .+18 ; 0x38f7e 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) { 38f6c: 82 30 cpi r24, 0x02 ; 2 38f6e: 39 f0 breq .+14 ; 0x38f7e // Rotating knob clockwise current_selection++; 38f70: 8f 5f subi r24, 0xFF ; 255 38f72: f9 cf rjmp .-14 ; 0x38f66 } } else { if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 38f74: 37 ff sbrs r19, 7 38f76: 41 c0 rjmp .+130 ; 0x38ffa 38f78: 81 11 cpse r24, r1 // Rotating knob counter clockwise current_selection = LCD_LEFT_BUTTON_CHOICE; 38f7a: 10 92 ec 17 sts 0x17EC, r1 ; 0x8017ec //! ---------------------- //! |>(left) >(mid) | //! ---------------------- //! @endcode // lcd_putc_at(0, 3, current_selection == LCD_LEFT_BUTTON_CHOICE ? '>': ' '); 38f7e: 80 91 ec 17 lds r24, 0x17EC ; 0x8017ec 38f82: 4e e3 ldi r20, 0x3E ; 62 38f84: 81 11 cpse r24, r1 38f86: 40 e2 ldi r20, 0x20 ; 32 38f88: 63 e0 ldi r22, 0x03 ; 3 38f8a: 80 e0 ldi r24, 0x00 ; 0 38f8c: 0e 94 18 6f call 0xde30 ; 0xde30 38f90: 80 91 ec 17 lds r24, 0x17EC ; 0x8017ec if (two_choices == false) 38f94: dd 23 and r29, r29 38f96: b1 f1 breq .+108 ; 0x39004 { lcd_putc_at(9, 3, current_selection == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 38f98: 4e e3 ldi r20, 0x3E ; 62 38f9a: 81 30 cpi r24, 0x01 ; 1 38f9c: 09 f0 breq .+2 ; 0x38fa0 38f9e: 40 e2 ldi r20, 0x20 ; 32 38fa0: 63 e0 ldi r22, 0x03 ; 3 38fa2: 89 e0 ldi r24, 0x09 ; 9 38fa4: 0e 94 18 6f call 0xde30 ; 0xde30 lcd_putc_at(18, 3, current_selection == LCD_RIGHT_BUTTON_CHOICE ? '>': ' '); 38fa8: 80 91 ec 17 lds r24, 0x17EC ; 0x8017ec 38fac: 82 30 cpi r24, 0x02 ; 2 38fae: 61 f5 brne .+88 ; 0x39008 } else { // More button for two button screen lcd_putc_at(18, 3, current_selection == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 38fb0: 4e e3 ldi r20, 0x3E ; 62 38fb2: 63 e0 ldi r22, 0x03 ; 3 38fb4: 82 e1 ldi r24, 0x12 ; 18 38fb6: 0e 94 18 6f call 0xde30 ; 0xde30 } // Consume rotation event lcd_encoder = 0; 38fba: 10 92 70 06 sts 0x0670, r1 ; 0x800670 38fbe: 10 92 6f 06 sts 0x066F, r1 ; 0x80066f } // Check if knob was clicked and consume the event if (lcd_clicked()) { 38fc2: 0e 94 15 71 call 0xe22a ; 0xe22a 38fc6: 88 23 and r24, r24 38fc8: 09 f4 brne .+2 ; 0x38fcc 38fca: 34 cf rjmp .-408 ; 0x38e34 choice_selected = current_selection; 38fcc: 80 91 ec 17 lds r24, 0x17EC ; 0x8017ec } else { // continue monitoring return ret; } if ((two_choices && choice_selected == LCD_MIDDLE_BUTTON_CHOICE) // Two choices and middle button selected 38fd0: d1 11 cpse r29, r1 38fd2: 1c c0 rjmp .+56 ; 0x3900c 38fd4: 81 30 cpi r24, 0x01 ; 1 38fd6: 89 f5 brne .+98 ; 0x3903a 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); 38fd8: f8 01 movw r30, r16 38fda: ee 0f add r30, r30 38fdc: ff 1f adc r31, r31 38fde: eb 5b subi r30, 0xBB ; 187 38fe0: f3 45 sbci r31, 0x53 ; 83 38fe2: 85 91 lpm r24, Z+ 38fe4: 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))); 38fe6: 0e 94 c4 72 call 0xe588 ; 0xe588 38fea: 0f 94 c7 1f call 0x23f8e ; 0x23f8e SetButtonResponse((ButtonOperations)button_op_middle); ret = 2; } // Next MMU error screen should reset the choice selection reset_button_selection = 1; 38fee: 81 e0 ldi r24, 0x01 ; 1 38ff0: 80 93 eb 17 sts 0x17EB, r24 ; 0x8017eb 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; 38ff4: 10 92 f5 17 sts 0x17F5, r1 ; 0x8017f5 38ff8: 1d cf rjmp .-454 ; 0x38e34 } } 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) { 38ffa: 81 30 cpi r24, 0x01 ; 1 38ffc: 09 f4 brne .+2 ; 0x39000 38ffe: bf cf rjmp .-130 ; 0x38f7e // Rotating knob clockwise current_selection = LCD_MIDDLE_BUTTON_CHOICE; 39000: 81 e0 ldi r24, 0x01 ; 1 39002: b1 cf rjmp .-158 ; 0x38f66 { 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 ? '>': ' '); 39004: 81 30 cpi r24, 0x01 ; 1 39006: a1 f2 breq .-88 ; 0x38fb0 39008: 40 e2 ldi r20, 0x20 ; 32 3900a: d3 cf rjmp .-90 ; 0x38fb2 // 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 3900c: 82 30 cpi r24, 0x02 ; 2 3900e: 21 f3 breq .-56 ; 0x38fd8 { // 'More' show error description lcd_show_fullscreen_message_and_wait_P(_T(PrusaErrorDesc(ei))); ret = 1; } else if(choice_selected == LCD_MIDDLE_BUTTON_CHOICE) { 39010: 81 30 cpi r24, 0x01 ; 1 39012: 99 f4 brne .+38 ; 0x3903a return Buttons::NoButton; } void SetButtonResponse(ButtonOperations rsp) { buttonSelectedOperation = rsp; 39014: d0 93 ad 0d sts 0x0DAD, r29 ; 0x800dad <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.493> SetButtonResponse((ButtonOperations)button_op_middle); ret = 2; } // Next MMU error screen should reset the choice selection reset_button_selection = 1; 39018: 80 93 eb 17 sts 0x17EB, r24 ; 0x8017eb // More button selected, change state ReportErrorHookState = ReportErrorHookStates::RENDER_ERROR_SCREEN; break; case 2: // Exit error screen and enable lcd updates lcd_update_enable(true); 3901c: 81 e0 ldi r24, 0x01 ; 1 3901e: 0e 94 3d 6f call 0xde7a ; 0xde7a lcd_return_to_status(); 39022: 0f 94 7c 1e call 0x23cf8 ; 0x23cf8 39026: 10 92 6a 05 sts 0x056A, r1 ; 0x80056a <_ZL10beep_timer.lto_priv.494> /// @brief Resets the global state of sound_wait_for_user() void sound_wait_for_user_reset() { beep_timer.stop(); bFirst = false; 3902a: 10 92 6d 05 sts 0x056D, r1 ; 0x80056d <_ZL6bFirst.lto_priv.495> sound_wait_for_user_reset(); // Reset the state in case a new error is reported is_mmu_error_monitor_active = false; 3902e: 10 92 c2 06 sts 0x06C2, r1 ; 0x8006c2 <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.490> KEEPALIVE_STATE(IN_HANDLER); 39032: 82 e0 ldi r24, 0x02 ; 2 39034: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be 39038: dd cf rjmp .-70 ; 0x38ff4 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); 3903a: cf 70 andi r28, 0x0F ; 15 3903c: c0 93 ad 0d sts 0x0DAD, r28 ; 0x800dad <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.493> SetButtonResponse((ButtonOperations)button_op_middle); ret = 2; } // Next MMU error screen should reset the choice selection reset_button_selection = 1; 39040: 81 e0 ldi r24, 0x01 ; 1 39042: ea cf rjmp .-44 ; 0x39018 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); 39044: ef 2d mov r30, r15 39046: f0 e0 ldi r31, 0x00 ; 0 39048: ee 0f add r30, r30 3904a: ff 1f adc r31, r31 3904c: ec 5d subi r30, 0xDC ; 220 3904e: f2 45 sbci r31, 0x52 ; 82 39050: 85 91 lpm r24, Z+ 39052: 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()); 39054: 0e 94 c4 72 call 0xe588 ; 0xe588 39058: 6c 01 movw r12, r24 3905a: 00 e4 ldi r16, 0x40 ; 64 3905c: 11 e7 ldi r17, 0x71 ; 113 3905e: 99 e0 ldi r25, 0x09 ; 9 39060: e9 2e mov r14, r25 39062: 32 cf rjmp .-412 ; 0x38ec8 00039064 : buttonSelectedOperation = ButtonOperations::NoOperation; // Reset operation return result; } Buttons ButtonAvailable(ErrorCode ec) { uint8_t ei = PrusaErrorCodeIndex(ec); 39064: 0f 94 a7 c5 call 0x38b4e ; 0x38b4e // 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); 39068: e8 2f mov r30, r24 3906a: f0 e0 ldi r31, 0x00 ; 0 3906c: ee 0f add r30, r30 3906e: ff 1f adc r31, r31 39070: e4 53 subi r30, 0x34 ; 52 39072: f3 45 sbci r31, 0x53 ; 83 39074: 25 91 lpm r18, Z+ 39076: 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) ) { 39078: 23 33 cpi r18, 0x33 ; 51 3907a: 81 e0 ldi r24, 0x01 ; 1 3907c: 38 07 cpc r19, r24 3907e: 08 f0 brcs .+2 ; 0x39082 39080: 41 c0 rjmp .+130 ; 0x39104 39082: 2d 32 cpi r18, 0x2D ; 45 39084: 81 e0 ldi r24, 0x01 ; 1 39086: 38 07 cpc r19, r24 39088: 78 f5 brcc .+94 ; 0x390e8 3908a: 2e 37 cpi r18, 0x7E ; 126 3908c: 31 05 cpc r19, r1 3908e: 09 f4 brne .+2 ; 0x39092 39090: 83 c0 rjmp .+262 ; 0x39198 39092: f0 f4 brcc .+60 ; 0x390d0 39094: 2c 36 cpi r18, 0x6C ; 108 39096: 31 05 cpc r19, r1 39098: 09 f4 brne .+2 ; 0x3909c 3909a: 85 c0 rjmp .+266 ; 0x391a6 3909c: 30 f4 brcc .+12 ; 0x390aa 3909e: 25 36 cpi r18, 0x65 ; 101 390a0: 31 05 cpc r19, r1 390a2: 08 f0 brcs .+2 ; 0x390a6 390a4: 79 c0 rjmp .+242 ; 0x39198 default: break; } return Buttons::NoButton; 390a6: 8f ef ldi r24, 0xFF ; 255 390a8: 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) ) { 390aa: 24 37 cpi r18, 0x74 ; 116 390ac: 31 05 cpc r19, r1 390ae: 09 f4 brne .+2 ; 0x390b2 390b0: 73 c0 rjmp .+230 ; 0x39198 390b2: 2d 37 cpi r18, 0x7D ; 125 390b4: 31 05 cpc r19, r1 390b6: 19 f0 breq .+6 ; 0x390be 390b8: 23 37 cpi r18, 0x73 ; 115 390ba: 31 05 cpc r19, r1 390bc: a1 f7 brne .-24 ; 0x390a6 break; } break; case ERR_MECHANICAL_SELECTOR_CANNOT_HOME: case ERR_MECHANICAL_IDLER_CANNOT_HOME: switch (buttonSelectedOperation) { 390be: 80 91 ad 0d lds r24, 0x0DAD ; 0x800dad <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.493> 390c2: 81 30 cpi r24, 0x01 ; 1 390c4: 09 f4 brne .+2 ; 0x390c8 390c6: 6d c0 rjmp .+218 ; 0x391a2 390c8: 87 30 cpi r24, 0x07 ; 7 390ca: 69 f7 brne .-38 ; 0x390a6 // may be allow move selector right and left in the future case ButtonOperations::Tune: // Tune Stallguard threshold return Buttons::TuneMMU; 390cc: 88 e0 ldi r24, 0x08 ; 8 390ce: 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) ) { 390d0: 23 3d cpi r18, 0xD3 ; 211 390d2: 31 05 cpc r19, r1 390d4: 09 f4 brne .+2 ; 0x390d8 390d6: 6e c0 rjmp .+220 ; 0x391b4 390d8: 50 f4 brcc .+20 ; 0x390ee 390da: 29 3c cpi r18, 0xC9 ; 201 390dc: 31 05 cpc r19, r1 390de: 09 f4 brne .+2 ; 0x390e2 390e0: 69 c0 rjmp .+210 ; 0x391b4 390e2: 2a 3c cpi r18, 0xCA ; 202 390e4: 31 05 cpc r19, r1 390e6: f9 f6 brne .-66 ; 0x390a6 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) { 390e8: 80 91 ad 0d lds r24, 0x0DAD ; 0x800dad <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.493> 390ec: 67 c0 rjmp .+206 ; 0x391bc // 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) ) { 390ee: 2d 3d cpi r18, 0xDD ; 221 390f0: 31 05 cpc r19, r1 390f2: 09 f4 brne .+2 ; 0x390f6 390f4: 5f c0 rjmp .+190 ; 0x391b4 390f6: 2e 3d cpi r18, 0xDE ; 222 390f8: 31 05 cpc r19, r1 390fa: b1 f3 breq .-20 ; 0x390e8 390fc: 24 3d cpi r18, 0xD4 ; 212 390fe: 31 05 cpc r19, r1 39100: 91 f6 brne .-92 ; 0x390a6 39102: f2 cf rjmp .-28 ; 0x390e8 39104: 25 3f cpi r18, 0xF5 ; 245 39106: 81 e0 ldi r24, 0x01 ; 1 39108: 38 07 cpc r19, r24 3910a: 09 f4 brne .+2 ; 0x3910e 3910c: 5c c0 rjmp .+184 ; 0x391c6 3910e: f8 f4 brcc .+62 ; 0x3914e 39110: 26 34 cpi r18, 0x46 ; 70 39112: 81 e0 ldi r24, 0x01 ; 1 39114: 38 07 cpc r19, r24 39116: 58 f4 brcc .+22 ; 0x3912e 39118: 21 34 cpi r18, 0x41 ; 65 3911a: 81 e0 ldi r24, 0x01 ; 1 3911c: 38 07 cpc r19, r24 3911e: 20 f7 brcc .-56 ; 0x390e8 39120: 27 53 subi r18, 0x37 ; 55 39122: 31 40 sbci r19, 0x01 ; 1 39124: 25 30 cpi r18, 0x05 ; 5 39126: 31 05 cpc r19, r1 39128: 08 f0 brcs .+2 ; 0x3912c 3912a: bd cf rjmp .-134 ; 0x390a6 3912c: dd cf rjmp .-70 ; 0x390e8 3912e: 21 59 subi r18, 0x91 ; 145 39130: 31 40 sbci r19, 0x01 ; 1 39132: 22 30 cpi r18, 0x02 ; 2 39134: 31 05 cpc r19, r1 39136: 08 f0 brcs .+2 ; 0x3913a 39138: b6 cf rjmp .-148 ; 0x390a6 } break; case ERR_CONNECT_MMU_NOT_RESPONDING: case ERR_CONNECT_COMMUNICATION_ERROR: case ERR_SYSTEM_FW_UPDATE_NEEDED: switch (buttonSelectedOperation) { 3913a: 80 91 ad 0d lds r24, 0x0DAD ; 0x800dad <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.493> 3913e: 83 30 cpi r24, 0x03 ; 3 39140: 09 f4 brne .+2 ; 0x39144 39142: 3f c0 rjmp .+126 ; 0x391c2 39144: 89 30 cpi r24, 0x09 ; 9 39146: 09 f0 breq .+2 ; 0x3914a 39148: ae cf rjmp .-164 ; 0x390a6 case ButtonOperations::DisableMMU: // "Disable" return Buttons::DisableMMU; 3914a: 87 e0 ldi r24, 0x07 ; 7 3914c: 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) ) { 3914e: 29 3f cpi r18, 0xF9 ; 249 39150: 81 e0 ldi r24, 0x01 ; 1 39152: 38 07 cpc r19, r24 39154: 49 f2 breq .-110 ; 0x390e8 39156: 70 f4 brcc .+28 ; 0x39174 39158: 27 3f cpi r18, 0xF7 ; 247 3915a: 81 e0 ldi r24, 0x01 ; 1 3915c: 38 07 cpc r19, r24 3915e: 21 f2 breq .-120 ; 0x390e8 39160: 60 f7 brcc .-40 ; 0x3913a break; } break; case ERR_SYSTEM_INVALID_TOOL: switch (buttonSelectedOperation) { 39162: 80 91 ad 0d lds r24, 0x0DAD ; 0x800dad <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.493> 39166: 83 30 cpi r24, 0x03 ; 3 39168: 61 f1 breq .+88 ; 0x391c2 3916a: 88 30 cpi r24, 0x08 ; 8 3916c: 09 f0 breq .+2 ; 0x39170 3916e: 9b cf rjmp .-202 ; 0x390a6 case ButtonOperations::StopPrint: // "Stop print" return Buttons::StopPrint; 39170: 86 e0 ldi r24, 0x06 ; 6 39172: 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) ) { 39174: 2b 3f cpi r18, 0xFB ; 251 39176: 81 e0 ldi r24, 0x01 ; 1 39178: 38 07 cpc r19, r24 3917a: a9 f0 breq .+42 ; 0x391a6 3917c: 68 f0 brcs .+26 ; 0x39198 3917e: 2c 3f cpi r18, 0xFC ; 252 39180: 31 40 sbci r19, 0x01 ; 1 39182: 09 f0 breq .+2 ; 0x39186 39184: 90 cf rjmp .-224 ; 0x390a6 default: break; } break; case ERR_SYSTEM_FILAMENT_CHANGE: switch (buttonSelectedOperation) { 39186: 80 91 ad 0d lds r24, 0x0DAD ; 0x800dad <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.493> 3918a: 85 30 cpi r24, 0x05 ; 5 3918c: 89 f0 breq .+34 ; 0x391b0 3918e: 86 30 cpi r24, 0x06 ; 6 39190: 09 f0 breq .+2 ; 0x39194 39192: 89 cf rjmp .-238 ; 0x390a6 case ButtonOperations::Load: return Buttons::Load; case ButtonOperations::Eject: return Buttons::Eject; 39194: 85 e0 ldi r24, 0x05 ; 5 39196: 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) { 39198: 80 91 ad 0d lds r24, 0x0DAD ; 0x800dad <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.493> 3919c: 81 30 cpi r24, 0x01 ; 1 3919e: 09 f0 breq .+2 ; 0x391a2 391a0: 82 cf rjmp .-252 ; 0x390a6 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; 391a2: 81 e0 ldi r24, 0x01 ; 1 391a4: 08 95 ret break; } break; case ERR_MECHANICAL_LOAD_TO_EXTRUDER_FAILED: case ERR_SYSTEM_FILAMENT_EJECTED: switch (buttonSelectedOperation) { 391a6: 80 91 ad 0d lds r24, 0x0DAD ; 0x800dad <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.493> 391aa: 82 30 cpi r24, 0x02 ; 2 391ac: d1 f3 breq .-12 ; 0x391a2 391ae: 7b cf rjmp .-266 ; 0x390a6 } break; case ERR_SYSTEM_FILAMENT_CHANGE: switch (buttonSelectedOperation) { case ButtonOperations::Load: return Buttons::Load; 391b0: 84 e0 ldi r24, 0x04 ; 4 391b2: 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) { 391b4: 80 91 ad 0d lds r24, 0x0DAD ; 0x800dad <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.493> 391b8: 82 30 cpi r24, 0x02 ; 2 391ba: 61 f0 breq .+24 ; 0x391d4 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) { 391bc: 83 30 cpi r24, 0x03 ; 3 391be: 09 f0 breq .+2 ; 0x391c2 391c0: 72 cf rjmp .-284 ; 0x390a6 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; 391c2: 83 e0 ldi r24, 0x03 ; 3 default: break; } return Buttons::NoButton; } 391c4: 08 95 ret default: break; } break; case ERR_SYSTEM_FILAMENT_ALREADY_LOADED: switch (buttonSelectedOperation) { 391c6: 80 91 ad 0d lds r24, 0x0DAD ; 0x800dad <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.493> 391ca: 82 30 cpi r24, 0x02 ; 2 391cc: 29 f0 breq .+10 ; 0x391d8 391ce: 84 30 cpi r24, 0x04 ; 4 391d0: 09 f0 breq .+2 ; 0x391d4 391d2: 69 cf rjmp .-302 ; 0x390a6 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; 391d4: 82 e0 ldi r24, 0x02 ; 2 391d6: 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; 391d8: 80 e0 ldi r24, 0x00 ; 0 391da: 08 95 ret 000391dc (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.385]>: #endif namespace MMU2 { template void waitForHotendTargetTemp(uint16_t delay, F f) { 391dc: cf 93 push r28 391de: df 93 push r29 391e0: ec 01 movw r28, r24 int16_t thermal_degTargetHotend() { return degTargetHotend(0); } int16_t thermal_degHotend() { return degHotend(0); 391e2: 60 91 af 0d lds r22, 0x0DAF ; 0x800daf 391e6: 70 91 b0 0d lds r23, 0x0DB0 ; 0x800db0 391ea: 80 91 b1 0d lds r24, 0x0DB1 ; 0x800db1 391ee: 90 91 b2 0d lds r25, 0x0DB2 ; 0x800db2 391f2: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> while (((thermal_degTargetHotend() - thermal_degHotend()) > 5)) { 391f6: 20 91 b5 0d lds r18, 0x0DB5 ; 0x800db5 391fa: 30 91 b6 0d lds r19, 0x0DB6 ; 0x800db6 391fe: c9 01 movw r24, r18 39200: 86 1b sub r24, r22 39202: 97 0b sbc r25, r23 39204: 06 97 sbiw r24, 0x06 ; 6 39206: 24 f0 brlt .+8 ; 0x39210 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.385]+0x34> void thermal_setTargetHotend(int16_t t) { setTargetHotend(t); } void safe_delay_keep_alive(uint16_t t) { delay_keep_alive(t); 39208: ce 01 movw r24, r28 3920a: 0e 94 fc 8c call 0x119f8 ; 0x119f8 3920e: e9 cf rjmp .-46 ; 0x391e2 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.385]+0x6> f(); safe_delay_keep_alive(delay); } } 39210: df 91 pop r29 39212: cf 91 pop r28 39214: 08 95 ret 00039216 : } //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) { 39216: cf 93 push r28 39218: df 93 push r29 3921a: 00 d0 rcall .+0 ; 0x3921c 3921c: 00 d0 rcall .+0 ; 0x3921e 3921e: 1f 92 push r1 39220: cd b7 in r28, 0x3d ; 61 39222: 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)) 39224: 87 30 cpi r24, 0x07 ; 7 39226: 50 f5 brcc .+84 ; 0x3927c 39228: 67 30 cpi r22, 0x07 ; 7 3922a: 40 f5 brcc .+80 ; 0x3927c return false; uint8_t valid_points_mask[7] = { 3922c: 97 e0 ldi r25, 0x07 ; 7 3922e: e6 ec ldi r30, 0xC6 ; 198 39230: f2 e0 ldi r31, 0x02 ; 2 39232: de 01 movw r26, r28 39234: 11 96 adiw r26, 0x01 ; 1 39236: 01 90 ld r0, Z+ 39238: 0d 92 st X+, r0 3923a: 9a 95 dec r25 3923c: e1 f7 brne .-8 ; 0x39236 0b1110111,//2 0b1111111,//1 0b1111111,//0 //[0,0] }; return (valid_points_mask[6 - iy] & (1 << (6 - ix))); 3923e: 46 e0 ldi r20, 0x06 ; 6 39240: 50 e0 ldi r21, 0x00 ; 0 39242: fa 01 movw r30, r20 39244: e6 1b sub r30, r22 39246: f1 09 sbc r31, r1 39248: 21 e0 ldi r18, 0x01 ; 1 3924a: 30 e0 ldi r19, 0x00 ; 0 3924c: 2c 0f add r18, r28 3924e: 3d 1f adc r19, r29 39250: e2 0f add r30, r18 39252: f3 1f adc r31, r19 39254: 20 81 ld r18, Z 39256: 30 e0 ldi r19, 0x00 ; 0 39258: 48 1b sub r20, r24 3925a: 51 09 sbc r21, r1 3925c: c9 01 movw r24, r18 3925e: 02 c0 rjmp .+4 ; 0x39264 39260: 95 95 asr r25 39262: 87 95 ror r24 39264: 4a 95 dec r20 39266: e2 f7 brpl .-8 ; 0x39260 39268: 81 70 andi r24, 0x01 ; 1 } 3926a: 27 96 adiw r28, 0x07 ; 7 3926c: 0f b6 in r0, 0x3f ; 63 3926e: f8 94 cli 39270: de bf out 0x3e, r29 ; 62 39272: 0f be out 0x3f, r0 ; 63 39274: cd bf out 0x3d, r28 ; 61 39276: df 91 pop r29 39278: cf 91 pop r28 3927a: 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; 3927c: 80 e0 ldi r24, 0x00 ; 0 3927e: f5 cf rjmp .-22 ; 0x3926a 00039280 : // Number of baby steps applied static int babystepLoadZ = 0; void babystep_load() { babystepLoadZ = 0; 39280: 10 92 8a 06 sts 0x068A, r1 ; 0x80068a <_ZL13babystepLoadZ.lto_priv.497+0x1> 39284: 10 92 89 06 sts 0x0689, r1 ; 0x800689 <_ZL13babystepLoadZ.lto_priv.497> // Apply Z height correction aka baby stepping before mesh bed leveling gets activated. if (calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) 39288: 80 e1 ldi r24, 0x10 ; 16 3928a: 0e 94 7a ee call 0x1dcf4 ; 0x1dcf4 3928e: 88 23 and r24, r24 39290: 91 f0 breq .+36 ; 0x392b6 { check_babystep(); //checking if babystep is in allowed range, otherwise setting babystep to 0 39292: 0e 94 97 79 call 0xf32e ; 0xf32e // 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))); 39296: 81 ea ldi r24, 0xA1 ; 161 39298: 9d e0 ldi r25, 0x0D ; 13 3929a: 0f 94 d7 db call 0x3b7ae ; 0x3b7ae 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-> 3929e: 2b e0 ldi r18, 0x0B ; 11 392a0: 82 9f mul r24, r18 392a2: c0 01 movw r24, r0 392a4: 11 24 eor r1, r1 392a6: 80 5b subi r24, 0xB0 ; 176 392a8: 92 4f sbci r25, 0xF2 ; 242 392aa: 0f 94 e5 db call 0x3b7ca ; 0x3b7ca 392ae: 90 93 8a 06 sts 0x068A, r25 ; 0x80068a <_ZL13babystepLoadZ.lto_priv.497+0x1> 392b2: 80 93 89 06 sts 0x0689, r24 ; 0x800689 <_ZL13babystepLoadZ.lto_priv.497> SERIAL_ECHO("correction: "); SERIAL_ECHO(float(babystepLoadZ) / float(axis_steps_per_mm[Z_AXIS])); SERIAL_ECHOLN(""); #endif } } 392b6: 08 95 ret 000392b8 : #endif //NEW_XYZCAL // Shift a Z axis by a given delta. // To replace loading of the babystep correction. static void shift_z(float delta) { 392b8: 0f 93 push r16 392ba: 1f 93 push r17 392bc: cf 93 push r28 392be: df 93 push r29 392c0: 00 d0 rcall .+0 ; 0x392c2 392c2: 1f 92 push r1 392c4: cd b7 in r28, 0x3d ; 61 392c6: de b7 in r29, 0x3e ; 62 392c8: 9b 01 movw r18, r22 392ca: ac 01 movw r20, r24 const float curpos_z = current_position[Z_AXIS]; 392cc: 01 e9 ldi r16, 0x91 ; 145 392ce: 16 e0 ldi r17, 0x06 ; 6 392d0: f8 01 movw r30, r16 392d2: 60 85 ldd r22, Z+8 ; 0x08 392d4: 71 85 ldd r23, Z+9 ; 0x09 392d6: 82 85 ldd r24, Z+10 ; 0x0a 392d8: 93 85 ldd r25, Z+11 ; 0x0b 392da: 69 83 std Y+1, r22 ; 0x01 392dc: 7a 83 std Y+2, r23 ; 0x02 392de: 8b 83 std Y+3, r24 ; 0x03 392e0: 9c 83 std Y+4, r25 ; 0x04 current_position[Z_AXIS] -= delta; 392e2: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 392e6: f8 01 movw r30, r16 392e8: 60 87 std Z+8, r22 ; 0x08 392ea: 71 87 std Z+9, r23 ; 0x09 392ec: 82 87 std Z+10, r24 ; 0x0a 392ee: 93 87 std Z+11, r25 ; 0x0b plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); 392f0: 65 e5 ldi r22, 0x55 ; 85 392f2: 75 e5 ldi r23, 0x55 ; 85 392f4: 85 e5 ldi r24, 0x55 ; 85 392f6: 91 e4 ldi r25, 0x41 ; 65 392f8: 0f 94 04 c0 call 0x38008 ; 0x38008 st_synchronize(); 392fc: 0f 94 a3 42 call 0x28546 ; 0x28546 current_position[Z_AXIS] = curpos_z; 39300: 89 81 ldd r24, Y+1 ; 0x01 39302: 9a 81 ldd r25, Y+2 ; 0x02 39304: ab 81 ldd r26, Y+3 ; 0x03 39306: bc 81 ldd r27, Y+4 ; 0x04 39308: f8 01 movw r30, r16 3930a: 80 87 std Z+8, r24 ; 0x08 3930c: 91 87 std Z+9, r25 ; 0x09 3930e: a2 87 std Z+10, r26 ; 0x0a 39310: b3 87 std Z+11, r27 ; 0x0b plan_set_z_position(curpos_z); 39312: ce 01 movw r24, r28 39314: 01 96 adiw r24, 0x01 ; 1 39316: 0f 94 ac 63 call 0x2c758 ; 0x2c758 } 3931a: 0f 90 pop r0 3931c: 0f 90 pop r0 3931e: 0f 90 pop r0 39320: 0f 90 pop r0 39322: df 91 pop r29 39324: cf 91 pop r28 39326: 1f 91 pop r17 39328: 0f 91 pop r16 3932a: 08 95 ret 0003932c : 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])); 3932c: 60 91 89 06 lds r22, 0x0689 ; 0x800689 <_ZL13babystepLoadZ.lto_priv.497> 39330: 70 91 8a 06 lds r23, 0x068A ; 0x80068a <_ZL13babystepLoadZ.lto_priv.497+0x1> 39334: 07 2e mov r0, r23 39336: 00 0c add r0, r0 39338: 88 0b sbc r24, r24 3933a: 99 0b sbc r25, r25 3933c: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 39340: 20 91 c9 0d lds r18, 0x0DC9 ; 0x800dc9 39344: 30 91 ca 0d lds r19, 0x0DCA ; 0x800dca 39348: 40 91 cb 0d lds r20, 0x0DCB ; 0x800dcb 3934c: 50 91 cc 0d lds r21, 0x0DCC ; 0x800dcc 39350: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 39354: 0f 94 5c c9 call 0x392b8 ; 0x392b8 babystepLoadZ = 0; 39358: 10 92 8a 06 sts 0x068A, r1 ; 0x80068a <_ZL13babystepLoadZ.lto_priv.497+0x1> 3935c: 10 92 89 06 sts 0x0689, r1 ; 0x800689 <_ZL13babystepLoadZ.lto_priv.497> } 39360: 08 95 ret 00039362 : return sampled; } void go_home_with_z_lift() { 39362: cf 93 push r28 39364: df 93 push r29 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 39366: 0e 94 db 66 call 0xcdb6 ; 0xcdb6 // Go home. // First move up to a safe height. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 3936a: c1 e9 ldi r28, 0x91 ; 145 3936c: d6 e0 ldi r29, 0x06 ; 6 3936e: 80 e0 ldi r24, 0x00 ; 0 39370: 90 e0 ldi r25, 0x00 ; 0 39372: a0 ea ldi r26, 0xA0 ; 160 39374: b0 e4 ldi r27, 0x40 ; 64 39376: 88 87 std Y+8, r24 ; 0x08 39378: 99 87 std Y+9, r25 ; 0x09 3937a: aa 87 std Y+10, r26 ; 0x0a 3937c: bb 87 std Y+11, r27 ; 0x0b go_to_current(homing_feedrate[Z_AXIS] / 60); 3937e: 65 e5 ldi r22, 0x55 ; 85 39380: 75 e5 ldi r23, 0x55 ; 85 39382: 85 e5 ldi r24, 0x55 ; 85 39384: 91 e4 ldi r25, 0x41 ; 65 39386: 0f 94 8c c5 call 0x38b18 ; 0x38b18 // Second move to XY [0, 0]. current_position[X_AXIS] = X_MIN_POS + 0.2; 3938a: 8d ec ldi r24, 0xCD ; 205 3938c: 9c ec ldi r25, 0xCC ; 204 3938e: ac e4 ldi r26, 0x4C ; 76 39390: be e3 ldi r27, 0x3E ; 62 39392: 88 83 st Y, r24 39394: 99 83 std Y+1, r25 ; 0x01 39396: aa 83 std Y+2, r26 ; 0x02 39398: bb 83 std Y+3, r27 ; 0x03 current_position[Y_AXIS] = Y_MIN_POS + 0.2; 3939a: 83 e3 ldi r24, 0x33 ; 51 3939c: 93 e3 ldi r25, 0x33 ; 51 3939e: a3 e7 ldi r26, 0x73 ; 115 393a0: b0 ec ldi r27, 0xC0 ; 192 393a2: 8c 83 std Y+4, r24 ; 0x04 393a4: 9d 83 std Y+5, r25 ; 0x05 393a6: ae 83 std Y+6, r26 ; 0x06 393a8: bf 83 std Y+7, r27 ; 0x07 // Clamp to the physical coordinates. world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 393aa: 65 e9 ldi r22, 0x95 ; 149 393ac: 76 e0 ldi r23, 0x06 ; 6 393ae: ce 01 movw r24, r28 393b0: 0e 94 c2 6a call 0xd584 ; 0xd584 go_to_current((3 * homing_feedrate[X_AXIS]) / 60); 393b4: 60 e0 ldi r22, 0x00 ; 0 393b6: 70 e0 ldi r23, 0x00 ; 0 393b8: 86 e1 ldi r24, 0x16 ; 22 393ba: 93 e4 ldi r25, 0x43 ; 67 393bc: 0f 94 8c c5 call 0x38b18 ; 0x38b18 // Third move up to a safe height. current_position[Z_AXIS] = Z_MIN_POS; 393c0: 8a e9 ldi r24, 0x9A ; 154 393c2: 99 e9 ldi r25, 0x99 ; 153 393c4: a9 e1 ldi r26, 0x19 ; 25 393c6: be e3 ldi r27, 0x3E ; 62 393c8: 88 87 std Y+8, r24 ; 0x08 393ca: 99 87 std Y+9, r25 ; 0x09 393cc: aa 87 std Y+10, r26 ; 0x0a 393ce: bb 87 std Y+11, r27 ; 0x0b go_to_current(homing_feedrate[Z_AXIS] / 60); 393d0: 65 e5 ldi r22, 0x55 ; 85 393d2: 75 e5 ldi r23, 0x55 ; 85 393d4: 85 e5 ldi r24, 0x55 ; 85 393d6: 91 e4 ldi r25, 0x41 ; 65 } 393d8: df 91 pop r29 393da: 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); 393dc: 0d 94 8c c5 jmp 0x38b18 ; 0x38b18 000393e0 : #define MESH_BED_CALIBRATION_SHOW_LCD float __attribute__((noinline)) BED_X(const uint8_t col) { return ((float)col * x_mesh_density + BED_X0); 393e0: 68 2f mov r22, r24 393e2: 70 e0 ldi r23, 0x00 ; 0 393e4: 90 e0 ldi r25, 0x00 ; 0 393e6: 80 e0 ldi r24, 0x00 ; 0 393e8: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 393ec: 20 e0 ldi r18, 0x00 ; 0 393ee: 30 e0 ldi r19, 0x00 ; 0 393f0: 48 e0 ldi r20, 0x08 ; 8 393f2: 52 e4 ldi r21, 0x42 ; 66 393f4: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 393f8: 20 e0 ldi r18, 0x00 ; 0 393fa: 30 e0 ldi r19, 0x00 ; 0 393fc: 40 e8 ldi r20, 0x80 ; 128 393fe: 5f e3 ldi r21, 0x3F ; 63 39400: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> } 39404: 08 95 ret 00039406 : // 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() { 39406: 2f 92 push r2 39408: 3f 92 push r3 3940a: 4f 92 push r4 3940c: 5f 92 push r5 3940e: 6f 92 push r6 39410: 7f 92 push r7 39412: 8f 92 push r8 39414: 9f 92 push r9 39416: af 92 push r10 39418: bf 92 push r11 3941a: cf 92 push r12 3941c: df 92 push r13 3941e: ef 92 push r14 39420: ff 92 push r15 39422: 0f 93 push r16 39424: 1f 93 push r17 39426: cf 93 push r28 39428: df 93 push r29 3942a: 00 d0 rcall .+0 ; 0x3942c 3942c: 00 d0 rcall .+0 ; 0x3942e 3942e: cd b7 in r28, 0x3d ; 61 39430: de b7 in r29, 0x3e ; 62 bool result = false; #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); 39432: 84 e0 ldi r24, 0x04 ; 4 39434: 0f 94 ae 25 call 0x24b5c ; 0x24b5c return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 39438: 80 91 b7 02 lds r24, 0x02B7 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> 3943c: 8c 83 std Y+4, r24 ; 0x04 check_endstops = check; 3943e: 10 92 b7 02 sts 0x02B7, r1 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> #endif bool endstops_enabled = enable_endstops(false); bool endstop_z_enabled = enable_z_endstop(false); 39442: 80 e0 ldi r24, 0x00 ; 0 39444: 0f 94 9d 4d call 0x29b3a ; 0x29b3a 39448: 8b 83 std Y+3, r24 ; 0x03 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 3944a: 0e 94 db 66 call 0xcdb6 ; 0xcdb6 #ifdef MESH_BED_CALIBRATION_SHOW_LCD lcd_display_message_fullscreen_P(_T(MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1)); 3944e: 87 ed ldi r24, 0xD7 ; 215 39450: 9b e5 ldi r25, 0x5B ; 91 39452: 0e 94 c4 72 call 0xe588 ; 0xe588 39456: 0f 94 ba 1f call 0x23f74 ; 0x23f74 // display "point xx of yy" lcd_puts_at_P(0,3,_n("1/9")); 3945a: 4c e3 ldi r20, 0x3C ; 60 3945c: 51 e7 ldi r21, 0x71 ; 113 3945e: 63 e0 ldi r22, 0x03 ; 3 39460: 80 e0 ldi r24, 0x00 ; 0 39462: 0e 94 0c 6f call 0xde18 ; 0xde18 39466: 81 e0 ldi r24, 0x01 ; 1 39468: 80 93 b7 02 sts 0x02B7, r24 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> // 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; 3946c: 80 e0 ldi r24, 0x00 ; 0 3946e: 90 e0 ldi r25, 0x00 ; 0 39470: a0 ea ldi r26, 0xA0 ; 160 39472: b0 e4 ldi r27, 0x40 ; 64 39474: 80 93 99 06 sts 0x0699, r24 ; 0x800699 39478: 90 93 9a 06 sts 0x069A, r25 ; 0x80069a 3947c: a0 93 9b 06 sts 0x069B, r26 ; 0x80069b 39480: b0 93 9c 06 sts 0x069C, r27 ; 0x80069c go_to_current(homing_feedrate[Z_AXIS]/60); 39484: 65 e5 ldi r22, 0x55 ; 85 39486: 75 e5 ldi r23, 0x55 ; 85 39488: 85 e5 ldi r24, 0x55 ; 85 3948a: 91 e4 ldi r25, 0x41 ; 65 3948c: 0f 94 8c c5 call 0x38b18 ; 0x38b18 #ifdef TMC2130 check_Z_crash(); 39490: 0e 94 49 7a call 0xf492 ; 0xf492 39494: 10 92 b7 02 sts 0x02B7, r1 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> #endif enable_endstops(false); // Move XY to first point current_position[X_AXIS] = BED_X0; 39498: 80 e0 ldi r24, 0x00 ; 0 3949a: 90 e0 ldi r25, 0x00 ; 0 3949c: a0 e8 ldi r26, 0x80 ; 128 3949e: bf e3 ldi r27, 0x3F ; 63 394a0: 80 93 91 06 sts 0x0691, r24 ; 0x800691 394a4: 90 93 92 06 sts 0x0692, r25 ; 0x800692 394a8: a0 93 93 06 sts 0x0693, r26 ; 0x800693 394ac: b0 93 94 06 sts 0x0694, r27 ; 0x800694 current_position[Y_AXIS] = BED_Y0; 394b0: 80 93 95 06 sts 0x0695, r24 ; 0x800695 394b4: 90 93 96 06 sts 0x0696, r25 ; 0x800696 394b8: a0 93 97 06 sts 0x0697, r26 ; 0x800697 394bc: b0 93 98 06 sts 0x0698, r27 ; 0x800698 world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 394c0: 65 e9 ldi r22, 0x95 ; 149 394c2: 76 e0 ldi r23, 0x06 ; 6 394c4: 81 e9 ldi r24, 0x91 ; 145 394c6: 96 e0 ldi r25, 0x06 ; 6 394c8: 0e 94 c2 6a call 0xd584 ; 0xd584 go_to_current(homing_feedrate[X_AXIS]/60); 394cc: 60 e0 ldi r22, 0x00 ; 0 394ce: 70 e0 ldi r23, 0x00 ; 0 394d0: 88 e4 ldi r24, 0x48 ; 72 394d2: 92 e4 ldi r25, 0x42 ; 66 394d4: 0f 94 8c c5 call 0x38b18 ; 0x38b18 set_destination_to_current(); 394d8: 0e 94 52 68 call 0xd0a4 ; 0xd0a4 homeaxis(Z_AXIS); 394dc: 50 e0 ldi r21, 0x00 ; 0 394de: 40 e0 ldi r20, 0x00 ; 0 394e0: 61 e0 ldi r22, 0x01 ; 1 394e2: 82 e0 ldi r24, 0x02 ; 2 394e4: 0e 94 83 7a call 0xf506 ; 0xf506 if (!find_bed_induction_sensor_point_z()) //Z crash or deviation > 50um 394e8: 43 e0 ldi r20, 0x03 ; 3 394ea: 60 e0 ldi r22, 0x00 ; 0 394ec: 70 e0 ldi r23, 0x00 ; 0 394ee: 80 e2 ldi r24, 0x20 ; 32 394f0: 91 ec ldi r25, 0xC1 ; 193 394f2: 0f 94 12 8c call 0x31824 ; 0x31824 394f6: 81 11 cpse r24, r1 394f8: 06 c0 rjmp .+12 ; 0x39506 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)); 394fa: 8b e8 ldi r24, 0x8B ; 139 394fc: 94 e6 ldi r25, 0x64 ; 100 394fe: 0e 94 c4 72 call 0xe588 ; 0xe588 39502: 0e 94 22 7a call 0xf444 ; 0xf444 float get_z(float x, float y); void set_z(uint8_t ix, uint8_t iy, float z) { z_values[iy][ix] = z; } 39506: 80 91 99 06 lds r24, 0x0699 ; 0x800699 3950a: 90 91 9a 06 lds r25, 0x069A ; 0x80069a 3950e: a0 91 9b 06 lds r26, 0x069B ; 0x80069b 39512: b0 91 9c 06 lds r27, 0x069C ; 0x80069c 39516: 80 93 c2 13 sts 0x13C2, r24 ; 0x8013c2 3951a: 90 93 c3 13 sts 0x13C3, r25 ; 0x8013c3 3951e: a0 93 c4 13 sts 0x13C4, r26 ; 0x8013c4 39522: b0 93 c5 13 sts 0x13C5, r27 ; 0x8013c5 39526: e2 e0 ldi r30, 0x02 ; 2 39528: f0 e0 ldi r31, 0x00 ; 0 3952a: fa 83 std Y+2, r31 ; 0x02 3952c: 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; 3952e: c1 2c mov r12, r1 39530: d1 2c mov r13, r1 39532: 30 ea ldi r19, 0xA0 ; 160 39534: e3 2e mov r14, r19 39536: 30 e4 ldi r19, 0x40 ; 64 39538: f3 2e mov r15, r19 go_to_current(homing_feedrate[Z_AXIS]/60); uint8_t ix = mesh_point % MESH_MEAS_NUM_X_POINTS; 3953a: 43 e0 ldi r20, 0x03 ; 3 3953c: 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 3953e: 52 e0 ldi r21, 0x02 ; 2 39540: 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); 39542: 00 e3 ldi r16, 0x30 ; 48 39544: 1c ea ldi r17, 0xAC ; 172 39546: 67 e0 ldi r22, 0x07 ; 7 39548: 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(); 3954a: 0e 94 db 66 call 0xcdb6 ; 0xcdb6 // Print the decrasing ID of the measurement point. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 3954e: c0 92 99 06 sts 0x0699, r12 ; 0x800699 39552: d0 92 9a 06 sts 0x069A, r13 ; 0x80069a 39556: e0 92 9b 06 sts 0x069B, r14 ; 0x80069b 3955a: f0 92 9c 06 sts 0x069C, r15 ; 0x80069c go_to_current(homing_feedrate[Z_AXIS]/60); 3955e: 65 e5 ldi r22, 0x55 ; 85 39560: 75 e5 ldi r23, 0x55 ; 85 39562: 85 e5 ldi r24, 0x55 ; 85 39564: 91 e4 ldi r25, 0x41 ; 65 39566: 0f 94 8c c5 call 0x38b18 ; 0x38b18 uint8_t ix = mesh_point % MESH_MEAS_NUM_X_POINTS; 3956a: 29 81 ldd r18, Y+1 ; 0x01 3956c: 21 50 subi r18, 0x01 ; 1 3956e: 82 2f mov r24, r18 39570: 6b 2d mov r22, r11 39572: 0f 94 86 dc call 0x3b90c ; 0x3b90c <__udivmodqi4> 39576: 89 2e mov r8, r25 uint8_t iy = mesh_point / MESH_MEAS_NUM_X_POINTS; 39578: 82 2f mov r24, r18 3957a: 0f 94 92 dc call 0x3b924 ; 0x3b924 <__divmodqi4> 3957e: 78 2e mov r7, r24 if (iy & 1) ix = (MESH_MEAS_NUM_X_POINTS - 1) - ix; // Zig zag 39580: 80 ff sbrs r24, 0 39582: 03 c0 rjmp .+6 ; 0x3958a 39584: f9 2d mov r31, r9 39586: f8 19 sub r31, r8 39588: 8f 2e mov r8, r31 current_position[X_AXIS] = BED_X(ix * 3); 3958a: 88 2d mov r24, r8 3958c: 88 0f add r24, r24 3958e: 88 0d add r24, r8 39590: 0f 94 f0 c9 call 0x393e0 ; 0x393e0 39594: 60 93 91 06 sts 0x0691, r22 ; 0x800691 39598: 70 93 92 06 sts 0x0692, r23 ; 0x800692 3959c: 80 93 93 06 sts 0x0693, r24 ; 0x800693 395a0: 90 93 94 06 sts 0x0694, r25 ; 0x800694 current_position[Y_AXIS] = BED_Y(iy * 3); 395a4: 87 2d mov r24, r7 395a6: 88 0f add r24, r24 395a8: 87 0d add r24, r7 395aa: 0f 94 f0 c9 call 0x393e0 ; 0x393e0 395ae: 60 93 95 06 sts 0x0695, r22 ; 0x800695 395b2: 70 93 96 06 sts 0x0696, r23 ; 0x800696 395b6: 80 93 97 06 sts 0x0697, r24 ; 0x800697 395ba: 90 93 98 06 sts 0x0698, r25 ; 0x800698 world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 395be: 65 e9 ldi r22, 0x95 ; 149 395c0: 76 e0 ldi r23, 0x06 ; 6 395c2: 81 e9 ldi r24, 0x91 ; 145 395c4: 96 e0 ldi r25, 0x06 ; 6 395c6: 0e 94 c2 6a call 0xd584 ; 0xd584 go_to_current(homing_feedrate[X_AXIS]/60); 395ca: 60 e0 ldi r22, 0x00 ; 0 395cc: 70 e0 ldi r23, 0x00 ; 0 395ce: 88 e4 ldi r24, 0x48 ; 72 395d0: 92 e4 ldi r25, 0x42 ; 66 395d2: 0f 94 8c c5 call 0x38b18 ; 0x38b18 #ifdef MESH_BED_CALIBRATION_SHOW_LCD // display "point xx of yy" lcd_set_cursor(0, 3); 395d6: 63 e0 ldi r22, 0x03 ; 3 395d8: 80 e0 ldi r24, 0x00 ; 0 395da: 0e 94 f8 6e call 0xddf0 ; 0xddf0 lcd_printf_P(PSTR("%d/9"),mesh_point+1); 395de: 8a 81 ldd r24, Y+2 ; 0x02 395e0: 8f 93 push r24 395e2: 99 81 ldd r25, Y+1 ; 0x01 395e4: 9f 93 push r25 395e6: 1f 93 push r17 395e8: 0f 93 push r16 395ea: 0e 94 d1 6e call 0xdda2 ; 0xdda2 #endif /* MESH_BED_CALIBRATION_SHOW_LCD */ if (!find_bed_induction_sensor_point_z()) //Z crash or deviation > 50um 395ee: 43 e0 ldi r20, 0x03 ; 3 395f0: 60 e0 ldi r22, 0x00 ; 0 395f2: 70 e0 ldi r23, 0x00 ; 0 395f4: 80 e2 ldi r24, 0x20 ; 32 395f6: 91 ec ldi r25, 0xC1 ; 193 395f8: 0f 94 12 8c call 0x31824 ; 0x31824 395fc: 58 2e mov r5, r24 395fe: 0f 90 pop r0 39600: 0f 90 pop r0 39602: 0f 90 pop r0 39604: 0f 90 pop r0 39606: 88 23 and r24, r24 39608: 09 f4 brne .+2 ; 0x3960c 3960a: 77 cf rjmp .-274 ; 0x394fa 3960c: a7 9c mul r10, r7 3960e: f0 01 movw r30, r0 39610: 11 24 eor r1, r1 39612: e8 0d add r30, r8 39614: f1 1d adc r31, r1 39616: ee 0f add r30, r30 39618: ff 1f adc r31, r31 3961a: ee 0f add r30, r30 3961c: ff 1f adc r31, r31 3961e: ef 53 subi r30, 0x3F ; 63 39620: fc 4e sbci r31, 0xEC ; 236 39622: 80 91 99 06 lds r24, 0x0699 ; 0x800699 39626: 90 91 9a 06 lds r25, 0x069A ; 0x80069a 3962a: a0 91 9b 06 lds r26, 0x069B ; 0x80069b 3962e: b0 91 9c 06 lds r27, 0x069C ; 0x80069c 39632: 81 83 std Z+1, r24 ; 0x01 39634: 92 83 std Z+2, r25 ; 0x02 39636: a3 83 std Z+3, r26 ; 0x03 39638: b4 83 std Z+4, r27 ; 0x04 3963a: e9 81 ldd r30, Y+1 ; 0x01 3963c: fa 81 ldd r31, Y+2 ; 0x02 3963e: 31 96 adiw r30, 0x01 ; 1 39640: fa 83 std Y+2, r31 ; 0x02 39642: 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) { 39644: 3a 97 sbiw r30, 0x0a ; 10 39646: 09 f0 breq .+2 ; 0x3964a 39648: 80 cf rjmp .-256 ; 0x3954a mbl.set_z(ix, iy, current_position[Z_AXIS]); } { // Verify the span of the Z values. float zmin = mbl.z_values[0][0]; 3964a: 60 90 c2 13 lds r6, 0x13C2 ; 0x8013c2 3964e: 70 90 c3 13 lds r7, 0x13C3 ; 0x8013c3 39652: 80 90 c4 13 lds r8, 0x13C4 ; 0x8013c4 39656: 90 90 c5 13 lds r9, 0x13C5 ; 0x8013c5 float zmax = zmin; 3965a: 46 2c mov r4, r6 3965c: a7 2c mov r10, r7 3965e: b8 2c mov r11, r8 39660: 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]; 39662: 1e 82 std Y+6, r1 ; 0x06 39664: 1d 82 std Y+5, r1 ; 0x05 39666: 01 ec ldi r16, 0xC1 ; 193 39668: 13 e1 ldi r17, 0x13 ; 19 3966a: 8d 81 ldd r24, Y+5 ; 0x05 3966c: 9e 81 ldd r25, Y+6 ; 0x06 3966e: 8e 53 subi r24, 0x3E ; 62 39670: 9c 4e sbci r25, 0xEC ; 236 39672: 9a 83 std Y+2, r25 ; 0x02 39674: 89 83 std Y+1, r24 ; 0x01 39676: 93 e0 ldi r25, 0x03 ; 3 39678: 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]); 3967a: e9 81 ldd r30, Y+1 ; 0x01 3967c: fa 81 ldd r31, Y+2 ; 0x02 3967e: c1 90 ld r12, Z+ 39680: d1 90 ld r13, Z+ 39682: e1 90 ld r14, Z+ 39684: f1 90 ld r15, Z+ 39686: fa 83 std Y+2, r31 ; 0x02 39688: e9 83 std Y+1, r30 ; 0x01 3968a: 93 01 movw r18, r6 3968c: a4 01 movw r20, r8 3968e: c7 01 movw r24, r14 39690: b6 01 movw r22, r12 39692: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 39696: 18 16 cp r1, r24 39698: 14 f0 brlt .+4 ; 0x3969e 3969a: 36 01 movw r6, r12 3969c: 47 01 movw r8, r14 zmax = max(zmax, mbl.z_values[j][i]); 3969e: 24 2d mov r18, r4 396a0: 3a 2d mov r19, r10 396a2: 4b 2d mov r20, r11 396a4: 52 2d mov r21, r2 396a6: c7 01 movw r24, r14 396a8: b6 01 movw r22, r12 396aa: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 396ae: 87 fd sbrc r24, 7 396b0: 04 c0 rjmp .+8 ; 0x396ba 396b2: 4c 2c mov r4, r12 396b4: ad 2c mov r10, r13 396b6: be 2c mov r11, r14 396b8: 2f 2c mov r2, r15 396ba: 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) { 396bc: 31 10 cpse r3, r1 396be: dd cf rjmp .-70 ; 0x3967a 396c0: 8d 81 ldd r24, Y+5 ; 0x05 396c2: 9e 81 ldd r25, Y+6 ; 0x06 396c4: 4c 96 adiw r24, 0x1c ; 28 396c6: 9e 83 std Y+6, r25 ; 0x06 396c8: 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) 396ca: 84 35 cpi r24, 0x54 ; 84 396cc: 91 05 cpc r25, r1 396ce: 59 f6 brne .-106 ; 0x39666 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) { 396d0: 93 01 movw r18, r6 396d2: a4 01 movw r20, r8 396d4: 64 2d mov r22, r4 396d6: 7a 2d mov r23, r10 396d8: 8b 2d mov r24, r11 396da: 92 2d mov r25, r2 396dc: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 396e0: 20 e0 ldi r18, 0x00 ; 0 396e2: 30 e0 ldi r19, 0x00 ; 0 396e4: 40 e4 ldi r20, 0x40 ; 64 396e6: 50 e4 ldi r21, 0x40 ; 64 396e8: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 396ec: 18 16 cp r1, r24 396ee: 3c f5 brge .+78 ; 0x3973e // 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!"); 396f0: 83 e1 ldi r24, 0x13 ; 19 396f2: 9c ea ldi r25, 0xAC ; 172 396f4: 0e 94 93 79 call 0xf326 ; 0xf326 // 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; 396f8: 51 2c mov r5, r1 396fa: fc 81 ldd r31, Y+4 ; 0x04 396fc: f0 93 b7 02 sts 0x02B7, r31 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> go_home_with_z_lift(); result = true; end: enable_endstops(endstops_enabled); enable_z_endstop(endstop_z_enabled); 39700: 8b 81 ldd r24, Y+3 ; 0x03 39702: 0f 94 9d 4d call 0x29b3a ; 0x29b3a #ifdef TMC2130 tmc2130_home_exit(); 39706: 0f 94 7f 25 call 0x24afe ; 0x24afe #endif return result; } 3970a: 85 2d mov r24, r5 3970c: 26 96 adiw r28, 0x06 ; 6 3970e: 0f b6 in r0, 0x3f ; 63 39710: f8 94 cli 39712: de bf out 0x3e, r29 ; 62 39714: 0f be out 0x3f, r0 ; 63 39716: cd bf out 0x3d, r28 ; 61 39718: df 91 pop r29 3971a: cf 91 pop r28 3971c: 1f 91 pop r17 3971e: 0f 91 pop r16 39720: ff 90 pop r15 39722: ef 90 pop r14 39724: df 90 pop r13 39726: cf 90 pop r12 39728: bf 90 pop r11 3972a: af 90 pop r10 3972c: 9f 90 pop r9 3972e: 8f 90 pop r8 39730: 7f 90 pop r7 39732: 6f 90 pop r6 39734: 5f 90 pop r5 39736: 4f 90 pop r4 39738: 3f 90 pop r3 3973a: 2f 90 pop r2 3973c: 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) 3973e: 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; 39740: 85 ec ldi r24, 0xC5 ; 197 39742: e8 2e mov r14, r24 39744: 8f e0 ldi r24, 0x0F ; 15 39746: f8 2e mov r15, r24 39748: 68 01 movw r12, r16 for (int8_t j = 0; j < 3; ++ j) for (int8_t i = 0; i < 3; ++ i) { 3974a: 1d 82 std Y+5, r1 ; 0x05 if (i == 0 && j == 0) 3974c: 9d 81 ldd r25, Y+5 ; 0x05 3974e: 91 11 cpse r25, r1 39750: 03 c0 rjmp .+6 ; 0x39758 39752: e9 81 ldd r30, Y+1 ; 0x01 39754: ee 23 and r30, r30 39756: 29 f1 breq .+74 ; 0x397a2 continue; float dif = mbl.z_values[j][i] - mbl.z_values[0][0]; 39758: 20 91 c2 13 lds r18, 0x13C2 ; 0x8013c2 3975c: 30 91 c3 13 lds r19, 0x13C3 ; 0x8013c3 39760: 40 91 c4 13 lds r20, 0x13C4 ; 0x8013c4 39764: 50 91 c5 13 lds r21, 0x13C5 ; 0x8013c5 39768: f6 01 movw r30, r12 3976a: 61 81 ldd r22, Z+1 ; 0x01 3976c: 72 81 ldd r23, Z+2 ; 0x02 3976e: 83 81 ldd r24, Z+3 ; 0x03 39770: 94 81 ldd r25, Z+4 ; 0x04 39772: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> int16_t dif_quantized = int16_t(floor(dif * 100.f + 0.5f)); 39776: 20 e0 ldi r18, 0x00 ; 0 39778: 30 e0 ldi r19, 0x00 ; 0 3977a: 48 ec ldi r20, 0xC8 ; 200 3977c: 52 e4 ldi r21, 0x42 ; 66 3977e: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 39782: 20 e0 ldi r18, 0x00 ; 0 39784: 30 e0 ldi r19, 0x00 ; 0 39786: 40 e0 ldi r20, 0x00 ; 0 39788: 5f e3 ldi r21, 0x3F ; 63 3978a: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 3978e: 0f 94 a6 de call 0x3bd4c ; 0x3bd4c 39792: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 39796: c7 01 movw r24, r14 39798: 0f 94 19 dc call 0x3b832 ; 0x3b832 SERIAL_ECHOPGM(", read: "); MYSERIAL.print(dif2, 5); SERIAL_ECHOLNPGM(""); } #endif addr += 2; 3979c: f2 e0 ldi r31, 0x02 ; 2 3979e: ef 0e add r14, r31 397a0: f1 1c adc r15, r1 397a2: 84 e0 ldi r24, 0x04 ; 4 397a4: c8 0e add r12, r24 397a6: d1 1c adc r13, r1 397a8: 9d 81 ldd r25, Y+5 ; 0x05 397aa: 9f 5f subi r25, 0xFF ; 255 397ac: 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) { 397ae: 93 30 cpi r25, 0x03 ; 3 397b0: 69 f6 brne .-102 ; 0x3974c 397b2: 04 5e subi r16, 0xE4 ; 228 397b4: 1f 4f sbci r17, 0xFF ; 255 397b6: e9 81 ldd r30, Y+1 ; 0x01 397b8: ef 5f subi r30, 0xFF ; 255 397ba: 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) 397bc: e3 30 cpi r30, 0x03 ; 3 397be: 21 f6 brne .-120 ; 0x39748 #endif addr += 2; } } mbl.reset(); 397c0: 0f 94 08 8c call 0x31810 ; 0x31810 go_home_with_z_lift(); 397c4: 0f 94 b1 c9 call 0x39362 ; 0x39362 397c8: 98 cf rjmp .-208 ; 0x396fa 000397ca : plan_set_position_curposXYZE(); } static inline void update_current_position_z() { current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); 397ca: 82 e0 ldi r24, 0x02 ; 2 397cc: 0f 94 8f 42 call 0x2851e ; 0x2851e 397d0: 60 93 99 06 sts 0x0699, r22 ; 0x800699 397d4: 70 93 9a 06 sts 0x069A, r23 ; 0x80069a 397d8: 80 93 9b 06 sts 0x069B, r24 ; 0x80069b 397dc: 90 93 9c 06 sts 0x069C, r25 ; 0x80069c plan_set_z_position(current_position[Z_AXIS]); 397e0: 89 e9 ldi r24, 0x99 ; 153 397e2: 96 e0 ldi r25, 0x06 ; 6 397e4: 0d 94 ac 63 jmp 0x2c758 ; 0x2c758 000397e8 : * 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() { 397e8: 4f 92 push r4 397ea: 5f 92 push r5 397ec: 6f 92 push r6 397ee: 7f 92 push r7 397f0: 8f 92 push r8 397f2: 9f 92 push r9 397f4: af 92 push r10 397f6: bf 92 push r11 397f8: cf 92 push r12 397fa: df 92 push r13 397fc: ef 92 push r14 397fe: ff 92 push r15 39800: 0f 93 push r16 39802: 1f 93 push r17 39804: cf 93 push r28 39806: df 93 push r29 float x = current_position[X_AXIS] - world2machine_shift[0]; 39808: 01 e9 ldi r16, 0x91 ; 145 3980a: 16 e0 ldi r17, 0x06 ; 6 3980c: c6 e0 ldi r28, 0x06 ; 6 3980e: d8 e1 ldi r29, 0x18 ; 24 39810: 28 81 ld r18, Y 39812: 39 81 ldd r19, Y+1 ; 0x01 39814: 4a 81 ldd r20, Y+2 ; 0x02 39816: 5b 81 ldd r21, Y+3 ; 0x03 39818: f8 01 movw r30, r16 3981a: 60 81 ld r22, Z 3981c: 71 81 ldd r23, Z+1 ; 0x01 3981e: 82 81 ldd r24, Z+2 ; 0x02 39820: 93 81 ldd r25, Z+3 ; 0x03 39822: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 39826: 4b 01 movw r8, r22 39828: 5c 01 movw r10, r24 float y = current_position[Y_AXIS] - world2machine_shift[1]; 3982a: 2c 81 ldd r18, Y+4 ; 0x04 3982c: 3d 81 ldd r19, Y+5 ; 0x05 3982e: 4e 81 ldd r20, Y+6 ; 0x06 39830: 5f 81 ldd r21, Y+7 ; 0x07 39832: f8 01 movw r30, r16 39834: 64 81 ldd r22, Z+4 ; 0x04 39836: 75 81 ldd r23, Z+5 ; 0x05 39838: 86 81 ldd r24, Z+6 ; 0x06 3983a: 97 81 ldd r25, Z+7 ; 0x07 3983c: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 39840: 6b 01 movw r12, r22 39842: 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; 39844: c6 ef ldi r28, 0xF6 ; 246 39846: d7 e1 ldi r29, 0x17 ; 23 39848: 28 81 ld r18, Y 3984a: 39 81 ldd r19, Y+1 ; 0x01 3984c: 4a 81 ldd r20, Y+2 ; 0x02 3984e: 5b 81 ldd r21, Y+3 ; 0x03 39850: c5 01 movw r24, r10 39852: b4 01 movw r22, r8 39854: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 39858: 2b 01 movw r4, r22 3985a: 3c 01 movw r6, r24 3985c: 2c 81 ldd r18, Y+4 ; 0x04 3985e: 3d 81 ldd r19, Y+5 ; 0x05 39860: 4e 81 ldd r20, Y+6 ; 0x06 39862: 5f 81 ldd r21, Y+7 ; 0x07 39864: c7 01 movw r24, r14 39866: b6 01 movw r22, r12 39868: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 3986c: 9b 01 movw r18, r22 3986e: ac 01 movw r20, r24 39870: c3 01 movw r24, r6 39872: b2 01 movw r22, r4 39874: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 39878: f8 01 movw r30, r16 3987a: 60 83 st Z, r22 3987c: 71 83 std Z+1, r23 ; 0x01 3987e: 82 83 std Z+2, r24 ; 0x02 39880: 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; 39882: 28 85 ldd r18, Y+8 ; 0x08 39884: 39 85 ldd r19, Y+9 ; 0x09 39886: 4a 85 ldd r20, Y+10 ; 0x0a 39888: 5b 85 ldd r21, Y+11 ; 0x0b 3988a: c5 01 movw r24, r10 3988c: b4 01 movw r22, r8 3988e: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 39892: 4b 01 movw r8, r22 39894: 5c 01 movw r10, r24 39896: 2c 85 ldd r18, Y+12 ; 0x0c 39898: 3d 85 ldd r19, Y+13 ; 0x0d 3989a: 4e 85 ldd r20, Y+14 ; 0x0e 3989c: 5f 85 ldd r21, Y+15 ; 0x0f 3989e: c7 01 movw r24, r14 398a0: b6 01 movw r22, r12 398a2: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 398a6: 9b 01 movw r18, r22 398a8: ac 01 movw r20, r24 398aa: c5 01 movw r24, r10 398ac: b4 01 movw r22, r8 398ae: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 398b2: f8 01 movw r30, r16 398b4: 64 83 std Z+4, r22 ; 0x04 398b6: 75 83 std Z+5, r23 ; 0x05 398b8: 86 83 std Z+6, r24 ; 0x06 398ba: 97 83 std Z+7, r25 ; 0x07 } 398bc: df 91 pop r29 398be: cf 91 pop r28 398c0: 1f 91 pop r17 398c2: 0f 91 pop r16 398c4: ff 90 pop r15 398c6: ef 90 pop r14 398c8: df 90 pop r13 398ca: cf 90 pop r12 398cc: bf 90 pop r11 398ce: af 90 pop r10 398d0: 9f 90 pop r9 398d2: 8f 90 pop r8 398d4: 7f 90 pop r7 398d6: 6f 90 pop r6 398d8: 5f 90 pop r5 398da: 4f 90 pop r4 398dc: 08 95 ret 000398de : } return false; } static void world2machine_update(const float vec_x[2], const float vec_y[2], const float cntr[2]) { 398de: 4f 92 push r4 398e0: 5f 92 push r5 398e2: 6f 92 push r6 398e4: 7f 92 push r7 398e6: 8f 92 push r8 398e8: 9f 92 push r9 398ea: af 92 push r10 398ec: bf 92 push r11 398ee: cf 92 push r12 398f0: df 92 push r13 398f2: ef 92 push r14 398f4: ff 92 push r15 398f6: 0f 93 push r16 398f8: 1f 93 push r17 398fa: cf 93 push r28 398fc: df 93 push r29 398fe: 00 d0 rcall .+0 ; 0x39900 39900: 00 d0 rcall .+0 ; 0x39902 39902: 1f 92 push r1 39904: 1f 92 push r1 39906: cd b7 in r28, 0x3d ; 61 39908: de b7 in r29, 0x3e ; 62 world2machine_rotation_and_skew[0][0] = vec_x[0]; 3990a: dc 01 movw r26, r24 3990c: cd 90 ld r12, X+ 3990e: dd 90 ld r13, X+ 39910: ed 90 ld r14, X+ 39912: fc 90 ld r15, X 39914: 13 97 sbiw r26, 0x03 ; 3 39916: c0 92 db 17 sts 0x17DB, r12 ; 0x8017db 3991a: d0 92 dc 17 sts 0x17DC, r13 ; 0x8017dc 3991e: e0 92 dd 17 sts 0x17DD, r14 ; 0x8017dd 39922: f0 92 de 17 sts 0x17DE, r15 ; 0x8017de world2machine_rotation_and_skew[1][0] = vec_x[1]; 39926: 14 96 adiw r26, 0x04 ; 4 39928: 0d 91 ld r16, X+ 3992a: 1d 91 ld r17, X+ 3992c: 2d 91 ld r18, X+ 3992e: 3c 91 ld r19, X 39930: 17 97 sbiw r26, 0x07 ; 7 39932: 09 83 std Y+1, r16 ; 0x01 39934: 1a 83 std Y+2, r17 ; 0x02 39936: 2b 83 std Y+3, r18 ; 0x03 39938: 3c 83 std Y+4, r19 ; 0x04 3993a: 00 93 e3 17 sts 0x17E3, r16 ; 0x8017e3 3993e: 10 93 e4 17 sts 0x17E4, r17 ; 0x8017e4 39942: 20 93 e5 17 sts 0x17E5, r18 ; 0x8017e5 39946: 30 93 e6 17 sts 0x17E6, r19 ; 0x8017e6 world2machine_rotation_and_skew[0][1] = vec_y[0]; 3994a: db 01 movw r26, r22 3994c: 0d 91 ld r16, X+ 3994e: 1d 91 ld r17, X+ 39950: 2d 91 ld r18, X+ 39952: 3c 91 ld r19, X 39954: 13 97 sbiw r26, 0x03 ; 3 39956: 0d 83 std Y+5, r16 ; 0x05 39958: 1e 83 std Y+6, r17 ; 0x06 3995a: 2f 83 std Y+7, r18 ; 0x07 3995c: 38 87 std Y+8, r19 ; 0x08 3995e: 00 93 df 17 sts 0x17DF, r16 ; 0x8017df 39962: 10 93 e0 17 sts 0x17E0, r17 ; 0x8017e0 39966: 20 93 e1 17 sts 0x17E1, r18 ; 0x8017e1 3996a: 30 93 e2 17 sts 0x17E2, r19 ; 0x8017e2 world2machine_rotation_and_skew[1][1] = vec_y[1]; 3996e: 14 96 adiw r26, 0x04 ; 4 39970: 4d 90 ld r4, X+ 39972: 5d 90 ld r5, X+ 39974: 6d 90 ld r6, X+ 39976: 7c 90 ld r7, X 39978: 17 97 sbiw r26, 0x07 ; 7 3997a: 40 92 e7 17 sts 0x17E7, r4 ; 0x8017e7 3997e: 50 92 e8 17 sts 0x17E8, r5 ; 0x8017e8 39982: 60 92 e9 17 sts 0x17E9, r6 ; 0x8017e9 39986: 70 92 ea 17 sts 0x17EA, r7 ; 0x8017ea world2machine_shift[0] = cntr[0]; 3998a: fa 01 movw r30, r20 3998c: 60 81 ld r22, Z 3998e: 71 81 ldd r23, Z+1 ; 0x01 39990: 82 81 ldd r24, Z+2 ; 0x02 39992: 93 81 ldd r25, Z+3 ; 0x03 39994: 60 93 06 18 sts 0x1806, r22 ; 0x801806 39998: 70 93 07 18 sts 0x1807, r23 ; 0x801807 3999c: 80 93 08 18 sts 0x1808, r24 ; 0x801808 399a0: 90 93 09 18 sts 0x1809, r25 ; 0x801809 world2machine_shift[1] = cntr[1]; 399a4: 84 80 ldd r8, Z+4 ; 0x04 399a6: 95 80 ldd r9, Z+5 ; 0x05 399a8: a6 80 ldd r10, Z+6 ; 0x06 399aa: b7 80 ldd r11, Z+7 ; 0x07 399ac: 80 92 0a 18 sts 0x180A, r8 ; 0x80180a 399b0: 90 92 0b 18 sts 0x180B, r9 ; 0x80180b 399b4: a0 92 0c 18 sts 0x180C, r10 ; 0x80180c 399b8: b0 92 0d 18 sts 0x180D, r11 ; 0x80180d // No correction. world2machine_correction_mode = WORLD2MACHINE_CORRECTION_NONE; if (world2machine_shift[0] != 0.f || world2machine_shift[1] != 0.f) 399bc: 20 e0 ldi r18, 0x00 ; 0 399be: 30 e0 ldi r19, 0x00 ; 0 399c0: a9 01 movw r20, r18 399c2: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 399c6: 81 11 cpse r24, r1 399c8: aa c0 rjmp .+340 ; 0x39b1e 399ca: 20 e0 ldi r18, 0x00 ; 0 399cc: 30 e0 ldi r19, 0x00 ; 0 399ce: a9 01 movw r20, r18 399d0: c5 01 movw r24, r10 399d2: b4 01 movw r22, r8 399d4: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 399d8: 81 11 cpse r24, r1 399da: a1 c0 rjmp .+322 ; 0x39b1e 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; 399dc: 10 92 0e 18 sts 0x180E, r1 ; 0x80180e 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 || 399e0: 20 e0 ldi r18, 0x00 ; 0 399e2: 30 e0 ldi r19, 0x00 ; 0 399e4: 40 e8 ldi r20, 0x80 ; 128 399e6: 5f e3 ldi r21, 0x3F ; 63 399e8: c7 01 movw r24, r14 399ea: b6 01 movw r22, r12 399ec: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 399f0: 81 11 cpse r24, r1 399f2: 21 c0 rjmp .+66 ; 0x39a36 399f4: 20 e0 ldi r18, 0x00 ; 0 399f6: 30 e0 ldi r19, 0x00 ; 0 399f8: a9 01 movw r20, r18 399fa: 6d 81 ldd r22, Y+5 ; 0x05 399fc: 7e 81 ldd r23, Y+6 ; 0x06 399fe: 8f 81 ldd r24, Y+7 ; 0x07 39a00: 98 85 ldd r25, Y+8 ; 0x08 39a02: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 39a06: 81 11 cpse r24, r1 39a08: 16 c0 rjmp .+44 ; 0x39a36 39a0a: 20 e0 ldi r18, 0x00 ; 0 39a0c: 30 e0 ldi r19, 0x00 ; 0 39a0e: a9 01 movw r20, r18 39a10: 69 81 ldd r22, Y+1 ; 0x01 39a12: 7a 81 ldd r23, Y+2 ; 0x02 39a14: 8b 81 ldd r24, Y+3 ; 0x03 39a16: 9c 81 ldd r25, Y+4 ; 0x04 39a18: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 39a1c: 81 11 cpse r24, r1 39a1e: 0b c0 rjmp .+22 ; 0x39a36 world2machine_rotation_and_skew[1][0] != 0.f || world2machine_rotation_and_skew[1][1] != 1.f) { 39a20: 20 e0 ldi r18, 0x00 ; 0 39a22: 30 e0 ldi r19, 0x00 ; 0 39a24: 40 e8 ldi r20, 0x80 ; 128 39a26: 5f e3 ldi r21, 0x3F ; 63 39a28: c3 01 movw r24, r6 39a2a: b2 01 movw r22, r4 39a2c: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 39a30: 88 23 and r24, r24 39a32: 09 f4 brne .+2 ; 0x39a36 39a34: 78 c0 rjmp .+240 ; 0x39b26 // Rotation & skew correction. world2machine_correction_mode |= WORLD2MACHINE_CORRECTION_SKEW; 39a36: 80 91 0e 18 lds r24, 0x180E ; 0x80180e 39a3a: 82 60 ori r24, 0x02 ; 2 39a3c: 80 93 0e 18 sts 0x180E, r24 ; 0x80180e // 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]; 39a40: a3 01 movw r20, r6 39a42: 92 01 movw r18, r4 39a44: c7 01 movw r24, r14 39a46: b6 01 movw r22, r12 39a48: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 39a4c: 4b 01 movw r8, r22 39a4e: 5c 01 movw r10, r24 39a50: 2d 81 ldd r18, Y+5 ; 0x05 39a52: 3e 81 ldd r19, Y+6 ; 0x06 39a54: 4f 81 ldd r20, Y+7 ; 0x07 39a56: 58 85 ldd r21, Y+8 ; 0x08 39a58: 69 81 ldd r22, Y+1 ; 0x01 39a5a: 7a 81 ldd r23, Y+2 ; 0x02 39a5c: 8b 81 ldd r24, Y+3 ; 0x03 39a5e: 9c 81 ldd r25, Y+4 ; 0x04 39a60: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 39a64: 9b 01 movw r18, r22 39a66: ac 01 movw r20, r24 39a68: c5 01 movw r24, r10 39a6a: b4 01 movw r22, r8 39a6c: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 39a70: 4b 01 movw r8, r22 39a72: 5c 01 movw r10, r24 world2machine_rotation_and_skew_inv[0][0] = world2machine_rotation_and_skew[1][1] / d; 39a74: ac 01 movw r20, r24 39a76: 9b 01 movw r18, r22 39a78: c3 01 movw r24, r6 39a7a: b2 01 movw r22, r4 39a7c: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 39a80: 60 93 f6 17 sts 0x17F6, r22 ; 0x8017f6 39a84: 70 93 f7 17 sts 0x17F7, r23 ; 0x8017f7 39a88: 80 93 f8 17 sts 0x17F8, r24 ; 0x8017f8 39a8c: 90 93 f9 17 sts 0x17F9, r25 ; 0x8017f9 world2machine_rotation_and_skew_inv[0][1] = -world2machine_rotation_and_skew[0][1] / d; 39a90: 6d 81 ldd r22, Y+5 ; 0x05 39a92: 7e 81 ldd r23, Y+6 ; 0x06 39a94: 8f 81 ldd r24, Y+7 ; 0x07 39a96: 98 85 ldd r25, Y+8 ; 0x08 39a98: 90 58 subi r25, 0x80 ; 128 39a9a: a5 01 movw r20, r10 39a9c: 94 01 movw r18, r8 39a9e: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 39aa2: 60 93 fa 17 sts 0x17FA, r22 ; 0x8017fa 39aa6: 70 93 fb 17 sts 0x17FB, r23 ; 0x8017fb 39aaa: 80 93 fc 17 sts 0x17FC, r24 ; 0x8017fc 39aae: 90 93 fd 17 sts 0x17FD, r25 ; 0x8017fd world2machine_rotation_and_skew_inv[1][0] = -world2machine_rotation_and_skew[1][0] / d; 39ab2: 69 81 ldd r22, Y+1 ; 0x01 39ab4: 7a 81 ldd r23, Y+2 ; 0x02 39ab6: 8b 81 ldd r24, Y+3 ; 0x03 39ab8: 9c 81 ldd r25, Y+4 ; 0x04 39aba: 90 58 subi r25, 0x80 ; 128 39abc: a5 01 movw r20, r10 39abe: 94 01 movw r18, r8 39ac0: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 39ac4: 60 93 fe 17 sts 0x17FE, r22 ; 0x8017fe 39ac8: 70 93 ff 17 sts 0x17FF, r23 ; 0x8017ff 39acc: 80 93 00 18 sts 0x1800, r24 ; 0x801800 39ad0: 90 93 01 18 sts 0x1801, r25 ; 0x801801 world2machine_rotation_and_skew_inv[1][1] = world2machine_rotation_and_skew[0][0] / d; 39ad4: a5 01 movw r20, r10 39ad6: 94 01 movw r18, r8 39ad8: c7 01 movw r24, r14 39ada: b6 01 movw r22, r12 39adc: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__divsf3> 39ae0: 60 93 02 18 sts 0x1802, r22 ; 0x801802 39ae4: 70 93 03 18 sts 0x1803, r23 ; 0x801803 39ae8: 80 93 04 18 sts 0x1804, r24 ; 0x801804 39aec: 90 93 05 18 sts 0x1805, r25 ; 0x801805 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; } } 39af0: 28 96 adiw r28, 0x08 ; 8 39af2: 0f b6 in r0, 0x3f ; 63 39af4: f8 94 cli 39af6: de bf out 0x3e, r29 ; 62 39af8: 0f be out 0x3f, r0 ; 63 39afa: cd bf out 0x3d, r28 ; 61 39afc: df 91 pop r29 39afe: cf 91 pop r28 39b00: 1f 91 pop r17 39b02: 0f 91 pop r16 39b04: ff 90 pop r15 39b06: ef 90 pop r14 39b08: df 90 pop r13 39b0a: cf 90 pop r12 39b0c: bf 90 pop r11 39b0e: af 90 pop r10 39b10: 9f 90 pop r9 39b12: 8f 90 pop r8 39b14: 7f 90 pop r7 39b16: 6f 90 pop r6 39b18: 5f 90 pop r5 39b1a: 4f 90 pop r4 39b1c: 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; 39b1e: 81 e0 ldi r24, 0x01 ; 1 39b20: 80 93 0e 18 sts 0x180E, r24 ; 0x80180e 39b24: 5d cf rjmp .-326 ; 0x399e0 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; 39b26: 80 e0 ldi r24, 0x00 ; 0 39b28: 90 e0 ldi r25, 0x00 ; 0 39b2a: a0 e8 ldi r26, 0x80 ; 128 39b2c: bf e3 ldi r27, 0x3F ; 63 39b2e: 80 93 f6 17 sts 0x17F6, r24 ; 0x8017f6 39b32: 90 93 f7 17 sts 0x17F7, r25 ; 0x8017f7 39b36: a0 93 f8 17 sts 0x17F8, r26 ; 0x8017f8 39b3a: b0 93 f9 17 sts 0x17F9, r27 ; 0x8017f9 world2machine_rotation_and_skew_inv[0][1] = 0.f; 39b3e: 10 92 fa 17 sts 0x17FA, r1 ; 0x8017fa 39b42: 10 92 fb 17 sts 0x17FB, r1 ; 0x8017fb 39b46: 10 92 fc 17 sts 0x17FC, r1 ; 0x8017fc 39b4a: 10 92 fd 17 sts 0x17FD, r1 ; 0x8017fd world2machine_rotation_and_skew_inv[1][0] = 0.f; 39b4e: 10 92 fe 17 sts 0x17FE, r1 ; 0x8017fe 39b52: 10 92 ff 17 sts 0x17FF, r1 ; 0x8017ff 39b56: 10 92 00 18 sts 0x1800, r1 ; 0x801800 39b5a: 10 92 01 18 sts 0x1801, r1 ; 0x801801 world2machine_rotation_and_skew_inv[1][1] = 1.f; 39b5e: 80 93 02 18 sts 0x1802, r24 ; 0x801802 39b62: 90 93 03 18 sts 0x1803, r25 ; 0x801803 39b66: a0 93 04 18 sts 0x1804, r26 ; 0x801804 39b6a: b0 93 05 18 sts 0x1805, r27 ; 0x801805 39b6e: c0 cf rjmp .-128 ; 0x39af0 00039b70 : * * 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() { 39b70: cf 93 push r28 39b72: df 93 push r29 39b74: cd b7 in r28, 0x3d ; 61 39b76: de b7 in r29, 0x3e ; 62 39b78: 68 97 sbiw r28, 0x18 ; 24 39b7a: 0f b6 in r0, 0x3f ; 63 39b7c: f8 94 cli 39b7e: de bf out 0x3e, r29 ; 62 39b80: 0f be out 0x3f, r0 ; 63 39b82: cd bf out 0x3d, r28 ; 61 const float vx[] = { 1.f, 0.f }; 39b84: 80 e0 ldi r24, 0x00 ; 0 39b86: 90 e0 ldi r25, 0x00 ; 0 39b88: a0 e8 ldi r26, 0x80 ; 128 39b8a: bf e3 ldi r27, 0x3F ; 63 39b8c: 89 83 std Y+1, r24 ; 0x01 39b8e: 9a 83 std Y+2, r25 ; 0x02 39b90: ab 83 std Y+3, r26 ; 0x03 39b92: bc 83 std Y+4, r27 ; 0x04 39b94: 1d 82 std Y+5, r1 ; 0x05 39b96: 1e 82 std Y+6, r1 ; 0x06 39b98: 1f 82 std Y+7, r1 ; 0x07 39b9a: 18 86 std Y+8, r1 ; 0x08 const float vy[] = { 0.f, 1.f }; 39b9c: 19 86 std Y+9, r1 ; 0x09 39b9e: 1a 86 std Y+10, r1 ; 0x0a 39ba0: 1b 86 std Y+11, r1 ; 0x0b 39ba2: 1c 86 std Y+12, r1 ; 0x0c 39ba4: 8d 87 std Y+13, r24 ; 0x0d 39ba6: 9e 87 std Y+14, r25 ; 0x0e 39ba8: af 87 std Y+15, r26 ; 0x0f 39baa: b8 8b std Y+16, r27 ; 0x10 const float cntr[] = { 0.f, 0.f }; 39bac: 19 8a std Y+17, r1 ; 0x11 39bae: 1a 8a std Y+18, r1 ; 0x12 39bb0: 1b 8a std Y+19, r1 ; 0x13 39bb2: 1c 8a std Y+20, r1 ; 0x14 39bb4: 1d 8a std Y+21, r1 ; 0x15 39bb6: 1e 8a std Y+22, r1 ; 0x16 39bb8: 1f 8a std Y+23, r1 ; 0x17 39bba: 18 8e std Y+24, r1 ; 0x18 world2machine_update(vx, vy, cntr); 39bbc: ae 01 movw r20, r28 39bbe: 4f 5e subi r20, 0xEF ; 239 39bc0: 5f 4f sbci r21, 0xFF ; 255 39bc2: be 01 movw r22, r28 39bc4: 67 5f subi r22, 0xF7 ; 247 39bc6: 7f 4f sbci r23, 0xFF ; 255 39bc8: ce 01 movw r24, r28 39bca: 01 96 adiw r24, 0x01 ; 1 39bcc: 0f 94 6f cc call 0x398de ; 0x398de } 39bd0: 68 96 adiw r28, 0x18 ; 24 39bd2: 0f b6 in r0, 0x3f ; 63 39bd4: f8 94 cli 39bd6: de bf out 0x3e, r29 ; 62 39bd8: 0f be out 0x3f, r0 ; 63 39bda: cd bf out 0x3d, r28 ; 61 39bdc: df 91 pop r29 39bde: cf 91 pop r28 39be0: 08 95 ret 00039be2 : * * 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) { 39be2: 80 91 0e 18 lds r24, 0x180E ; 0x80180e 39be6: 88 23 and r24, r24 39be8: d1 f0 breq .+52 ; 0x39c1e world2machine_reset(); 39bea: 0f 94 b8 cd call 0x39b70 ; 0x39b70 st_synchronize(); 39bee: 0f 94 a3 42 call 0x28546 ; 0x28546 current_position[X_AXIS] = st_get_position_mm(X_AXIS); 39bf2: 80 e0 ldi r24, 0x00 ; 0 39bf4: 0f 94 8f 42 call 0x2851e ; 0x2851e 39bf8: 60 93 91 06 sts 0x0691, r22 ; 0x800691 39bfc: 70 93 92 06 sts 0x0692, r23 ; 0x800692 39c00: 80 93 93 06 sts 0x0693, r24 ; 0x800693 39c04: 90 93 94 06 sts 0x0694, r25 ; 0x800694 current_position[Y_AXIS] = st_get_position_mm(Y_AXIS); 39c08: 81 e0 ldi r24, 0x01 ; 1 39c0a: 0f 94 8f 42 call 0x2851e ; 0x2851e 39c0e: 60 93 95 06 sts 0x0695, r22 ; 0x800695 39c12: 70 93 96 06 sts 0x0696, r23 ; 0x800696 39c16: 80 93 97 06 sts 0x0697, r24 ; 0x800697 39c1a: 90 93 98 06 sts 0x0698, r25 ; 0x800698 } } 39c1e: 08 95 ret 00039c20 : if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); 39c20: 4f ef ldi r20, 0xFF ; 255 39c22: 5f ef ldi r21, 0xFF ; 255 39c24: ba 01 movw r22, r20 39c26: 85 ee ldi r24, 0xE5 ; 229 39c28: 9f e0 ldi r25, 0x0F ; 15 39c2a: 0f 94 0d dc call 0x3b81a ; 0x3b81a 39c2e: 4f ef ldi r20, 0xFF ; 255 39c30: 5f ef ldi r21, 0xFF ; 255 39c32: ba 01 movw r22, r20 39c34: 89 ee ldi r24, 0xE9 ; 233 39c36: 9f e0 ldi r25, 0x0F ; 15 39c38: 0f 94 0d dc call 0x3b81a ; 0x3b81a 39c3c: 4f ef ldi r20, 0xFF ; 255 39c3e: 5f ef ldi r21, 0xFF ; 255 39c40: ba 01 movw r22, r20 39c42: 8d ed ldi r24, 0xDD ; 221 39c44: 9f e0 ldi r25, 0x0F ; 15 39c46: 0f 94 0d dc call 0x3b81a ; 0x3b81a 39c4a: 4f ef ldi r20, 0xFF ; 255 39c4c: 5f ef ldi r21, 0xFF ; 255 39c4e: ba 01 movw r22, r20 39c50: 81 ee ldi r24, 0xE1 ; 225 39c52: 9f e0 ldi r25, 0x0F ; 15 39c54: 0f 94 0d dc call 0x3b81a ; 0x3b81a 39c58: 4f ef ldi r20, 0xFF ; 255 39c5a: 5f ef ldi r21, 0xFF ; 255 39c5c: ba 01 movw r22, r20 39c5e: 85 ed ldi r24, 0xD5 ; 213 39c60: 9f e0 ldi r25, 0x0F ; 15 39c62: 0f 94 0d dc call 0x3b81a ; 0x3b81a 39c66: 4f ef ldi r20, 0xFF ; 255 39c68: 5f ef ldi r21, 0xFF ; 255 39c6a: ba 01 movw r22, r20 39c6c: 89 ed ldi r24, 0xD9 ; 217 39c6e: 9f e0 ldi r25, 0x0F ; 15 39c70: 0f 94 0d dc call 0x3b81a ; 0x3b81a 39c74: 4f ef ldi r20, 0xFF ; 255 39c76: 5f ef ldi r21, 0xFF ; 255 39c78: ba 01 movw r22, r20 39c7a: 85 ec ldi r24, 0xC5 ; 197 39c7c: 9f e0 ldi r25, 0x0F ; 15 39c7e: 0f 94 0d dc call 0x3b81a ; 0x3b81a 39c82: 4f ef ldi r20, 0xFF ; 255 39c84: 5f ef ldi r21, 0xFF ; 255 39c86: ba 01 movw r22, r20 39c88: 89 ec ldi r24, 0xC9 ; 201 39c8a: 9f e0 ldi r25, 0x0F ; 15 39c8c: 0f 94 0d dc call 0x3b81a ; 0x3b81a 39c90: 4f ef ldi r20, 0xFF ; 255 39c92: 5f ef ldi r21, 0xFF ; 255 39c94: ba 01 movw r22, r20 39c96: 8d ec ldi r24, 0xCD ; 205 39c98: 9f e0 ldi r25, 0x0F ; 15 39c9a: 0f 94 0d dc call 0x3b81a ; 0x3b81a 39c9e: 4f ef ldi r20, 0xFF ; 255 39ca0: 5f ef ldi r21, 0xFF ; 255 39ca2: ba 01 movw r22, r20 39ca4: 81 ed ldi r24, 0xD1 ; 209 39ca6: 9f e0 ldi r25, 0x0F ; 15 39ca8: 0d 94 0d dc jmp 0x3b81a ; 0x3b81a 00039cac : /** * @brief Read and apply validated calibration data from EEPROM */ void world2machine_initialize() { 39cac: 4f 92 push r4 39cae: 5f 92 push r5 39cb0: 6f 92 push r6 39cb2: 7f 92 push r7 39cb4: 8f 92 push r8 39cb6: 9f 92 push r9 39cb8: af 92 push r10 39cba: bf 92 push r11 39cbc: cf 92 push r12 39cbe: df 92 push r13 39cc0: ef 92 push r14 39cc2: ff 92 push r15 39cc4: 1f 93 push r17 39cc6: cf 93 push r28 39cc8: df 93 push r29 39cca: cd b7 in r28, 0x3d ; 61 39ccc: de b7 in r29, 0x3e ; 62 39cce: a8 97 sbiw r28, 0x28 ; 40 39cd0: 0f b6 in r0, 0x3f ; 63 39cd2: f8 94 cli 39cd4: de bf out 0x3e, r29 ; 62 39cd6: 0f be out 0x3f, r0 ; 63 39cd8: 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); 39cda: 48 e0 ldi r20, 0x08 ; 8 39cdc: 50 e0 ldi r21, 0x00 ; 0 39cde: 6d ed ldi r22, 0xDD ; 221 39ce0: 7f e0 ldi r23, 0x0F ; 15 39ce2: ce 01 movw r24, r28 39ce4: 01 96 adiw r24, 0x01 ; 1 39ce6: 0f 94 c7 db call 0x3b78e ; 0x3b78e eeprom_read_block(&vec_y[0], (float*)(EEPROM_BED_CALIBRATION_VEC_Y), 8); 39cea: 48 e0 ldi r20, 0x08 ; 8 39cec: 50 e0 ldi r21, 0x00 ; 0 39cee: 65 ed ldi r22, 0xD5 ; 213 39cf0: 7f e0 ldi r23, 0x0F ; 15 39cf2: ce 01 movw r24, r28 39cf4: 09 96 adiw r24, 0x09 ; 9 39cf6: 0f 94 c7 db call 0x3b78e ; 0x3b78e eeprom_read_block(&cntr[0], (float*)(EEPROM_BED_CALIBRATION_CENTER), 8); 39cfa: 48 e0 ldi r20, 0x08 ; 8 39cfc: 50 e0 ldi r21, 0x00 ; 0 39cfe: 65 ee ldi r22, 0xE5 ; 229 39d00: 7f e0 ldi r23, 0x0F ; 15 39d02: ce 01 movw r24, r28 39d04: 41 96 adiw r24, 0x11 ; 17 39d06: 0f 94 c7 db call 0x3b78e ; 0x3b78e } static inline bool vec_undef(const float v[2]) { const uint32_t *vx = (const uint32_t*)v; return vx[0] == 0xFFFFFFFF || vx[1] == 0xFFFFFFFF; 39d0a: 89 89 ldd r24, Y+17 ; 0x11 39d0c: 9a 89 ldd r25, Y+18 ; 0x12 39d0e: ab 89 ldd r26, Y+19 ; 0x13 39d10: bc 89 ldd r27, Y+20 ; 0x14 39d12: 89 a3 std Y+33, r24 ; 0x21 39d14: 9a a3 std Y+34, r25 ; 0x22 39d16: ab a3 std Y+35, r26 ; 0x23 39d18: bc a3 std Y+36, r27 ; 0x24 39d1a: 8f 3f cpi r24, 0xFF ; 255 39d1c: 9f 4f sbci r25, 0xFF ; 255 39d1e: af 4f sbci r26, 0xFF ; 255 39d20: bf 4f sbci r27, 0xFF ; 255 39d22: 09 f4 brne .+2 ; 0x39d26 39d24: b1 c0 rjmp .+354 ; 0x39e88 39d26: 8d 89 ldd r24, Y+21 ; 0x15 39d28: 9e 89 ldd r25, Y+22 ; 0x16 39d2a: af 89 ldd r26, Y+23 ; 0x17 39d2c: b8 8d ldd r27, Y+24 ; 0x18 39d2e: 8d a3 std Y+37, r24 ; 0x25 39d30: 9e a3 std Y+38, r25 ; 0x26 39d32: af a3 std Y+39, r26 ; 0x27 39d34: b8 a7 std Y+40, r27 ; 0x28 39d36: 8f 3f cpi r24, 0xFF ; 255 39d38: 9f 4f sbci r25, 0xFF ; 255 39d3a: af 4f sbci r26, 0xFF ; 255 39d3c: bf 4f sbci r27, 0xFF ; 255 39d3e: 09 f4 brne .+2 ; 0x39d42 39d40: a3 c0 rjmp .+326 ; 0x39e88 39d42: 89 80 ldd r8, Y+1 ; 0x01 39d44: 9a 80 ldd r9, Y+2 ; 0x02 39d46: ab 80 ldd r10, Y+3 ; 0x03 39d48: bc 80 ldd r11, Y+4 ; 0x04 39d4a: 8f ef ldi r24, 0xFF ; 255 39d4c: 88 16 cp r8, r24 39d4e: 98 06 cpc r9, r24 39d50: a8 06 cpc r10, r24 39d52: b8 06 cpc r11, r24 39d54: 09 f4 brne .+2 ; 0x39d58 39d56: 98 c0 rjmp .+304 ; 0x39e88 39d58: 8d 81 ldd r24, Y+5 ; 0x05 39d5a: 9e 81 ldd r25, Y+6 ; 0x06 39d5c: af 81 ldd r26, Y+7 ; 0x07 39d5e: b8 85 ldd r27, Y+8 ; 0x08 39d60: 89 8f std Y+25, r24 ; 0x19 39d62: 9a 8f std Y+26, r25 ; 0x1a 39d64: ab 8f std Y+27, r26 ; 0x1b 39d66: bc 8f std Y+28, r27 ; 0x1c 39d68: 8f 3f cpi r24, 0xFF ; 255 39d6a: 9f 4f sbci r25, 0xFF ; 255 39d6c: af 4f sbci r26, 0xFF ; 255 39d6e: bf 4f sbci r27, 0xFF ; 255 39d70: 09 f4 brne .+2 ; 0x39d74 39d72: 8a c0 rjmp .+276 ; 0x39e88 39d74: c9 84 ldd r12, Y+9 ; 0x09 39d76: da 84 ldd r13, Y+10 ; 0x0a 39d78: eb 84 ldd r14, Y+11 ; 0x0b 39d7a: fc 84 ldd r15, Y+12 ; 0x0c 39d7c: 8f ef ldi r24, 0xFF ; 255 39d7e: c8 16 cp r12, r24 39d80: d8 06 cpc r13, r24 39d82: e8 06 cpc r14, r24 39d84: f8 06 cpc r15, r24 39d86: 09 f4 brne .+2 ; 0x39d8a 39d88: 7f c0 rjmp .+254 ; 0x39e88 39d8a: 8d 85 ldd r24, Y+13 ; 0x0d 39d8c: 9e 85 ldd r25, Y+14 ; 0x0e 39d8e: af 85 ldd r26, Y+15 ; 0x0f 39d90: b8 89 ldd r27, Y+16 ; 0x10 39d92: 8d 8f std Y+29, r24 ; 0x1d 39d94: 9e 8f std Y+30, r25 ; 0x1e 39d96: af 8f std Y+31, r26 ; 0x1f 39d98: b8 a3 std Y+32, r27 ; 0x20 39d9a: 8f 3f cpi r24, 0xFF ; 255 39d9c: 9f 4f sbci r25, 0xFF ; 255 39d9e: af 4f sbci r26, 0xFF ; 255 39da0: bf 4f sbci r27, 0xFF ; 255 39da2: 09 f4 brne .+2 ; 0x39da6 39da4: 71 c0 rjmp .+226 ; 0x39e88 reset = true; } else { // Length of the vec_x shall be close to unity. float l = hypot(vec_x[0], vec_x[1]); 39da6: 29 8d ldd r18, Y+25 ; 0x19 39da8: 3a 8d ldd r19, Y+26 ; 0x1a 39daa: 4b 8d ldd r20, Y+27 ; 0x1b 39dac: 5c 8d ldd r21, Y+28 ; 0x1c 39dae: c5 01 movw r24, r10 39db0: b4 01 movw r22, r8 39db2: 0f 94 9b df call 0x3bf36 ; 0x3bf36 39db6: 2b 01 movw r4, r22 39db8: 3c 01 movw r6, r24 if (l < 0.9 || l > 1.1) 39dba: 26 e6 ldi r18, 0x66 ; 102 39dbc: 36 e6 ldi r19, 0x66 ; 102 39dbe: 46 e6 ldi r20, 0x66 ; 102 39dc0: 5f e3 ldi r21, 0x3F ; 63 39dc2: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__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; 39dc6: 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) 39dc8: 87 fd sbrc r24, 7 39dca: 0b c0 rjmp .+22 ; 0x39de2 39dcc: 2d ec ldi r18, 0xCD ; 205 39dce: 3c ec ldi r19, 0xCC ; 204 39dd0: 4c e8 ldi r20, 0x8C ; 140 39dd2: 5f e3 ldi r21, 0x3F ; 63 39dd4: c3 01 movw r24, r6 39dd6: b2 01 movw r22, r4 39dd8: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 39ddc: 18 16 cp r1, r24 39dde: 0c f0 brlt .+2 ; 0x39de2 39de0: 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]); 39de2: 2d 8d ldd r18, Y+29 ; 0x1d 39de4: 3e 8d ldd r19, Y+30 ; 0x1e 39de6: 4f 8d ldd r20, Y+31 ; 0x1f 39de8: 58 a1 ldd r21, Y+32 ; 0x20 39dea: c7 01 movw r24, r14 39dec: b6 01 movw r22, r12 39dee: 0f 94 9b df call 0x3bf36 ; 0x3bf36 39df2: 2b 01 movw r4, r22 39df4: 3c 01 movw r6, r24 if (l < 0.9 || l > 1.1) 39df6: 26 e6 ldi r18, 0x66 ; 102 39df8: 36 e6 ldi r19, 0x66 ; 102 39dfa: 46 e6 ldi r20, 0x66 ; 102 39dfc: 5f e3 ldi r21, 0x3F ; 63 39dfe: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 39e02: 87 fd sbrc r24, 7 39e04: 7f c0 rjmp .+254 ; 0x39f04 39e06: 2d ec ldi r18, 0xCD ; 205 39e08: 3c ec ldi r19, 0xCC ; 204 39e0a: 4c e8 ldi r20, 0x8C ; 140 39e0c: 5f e3 ldi r21, 0x3F ; 63 39e0e: c3 01 movw r24, r6 39e10: b2 01 movw r22, r4 39e12: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 39e16: 18 16 cp r1, r24 39e18: 0c f4 brge .+2 ; 0x39e1c 39e1a: 74 c0 rjmp .+232 ; 0x39f04 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]); 39e1c: 2d a1 ldd r18, Y+37 ; 0x25 39e1e: 3e a1 ldd r19, Y+38 ; 0x26 39e20: 4f a1 ldd r20, Y+39 ; 0x27 39e22: 58 a5 ldd r21, Y+40 ; 0x28 39e24: 69 a1 ldd r22, Y+33 ; 0x21 39e26: 7a a1 ldd r23, Y+34 ; 0x22 39e28: 8b a1 ldd r24, Y+35 ; 0x23 39e2a: 9c a1 ldd r25, Y+36 ; 0x24 39e2c: 0f 94 9b df call 0x3bf36 ; 0x3bf36 if (l > 15.f) 39e30: 20 e0 ldi r18, 0x00 ; 0 39e32: 30 e0 ldi r19, 0x00 ; 0 39e34: 40 e7 ldi r20, 0x70 ; 112 39e36: 51 e4 ldi r21, 0x41 ; 65 39e38: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 39e3c: 18 16 cp r1, r24 39e3e: 0c f4 brge .+2 ; 0x39e42 #if 0 SERIAL_ECHOLNPGM("Zero point correction:"); MYSERIAL.println(l); SERIAL_ECHOLNPGM("Invalid bed correction matrix. Shift out of range."); #endif reset = true; 39e40: 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]; 39e42: a5 01 movw r20, r10 39e44: 94 01 movw r18, r8 39e46: c7 01 movw r24, r14 39e48: b6 01 movw r22, r12 39e4a: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 39e4e: 6b 01 movw r12, r22 39e50: 7c 01 movw r14, r24 39e52: 2d 8d ldd r18, Y+29 ; 0x1d 39e54: 3e 8d ldd r19, Y+30 ; 0x1e 39e56: 4f 8d ldd r20, Y+31 ; 0x1f 39e58: 58 a1 ldd r21, Y+32 ; 0x20 39e5a: 69 8d ldd r22, Y+25 ; 0x19 39e5c: 7a 8d ldd r23, Y+26 ; 0x1a 39e5e: 8b 8d ldd r24, Y+27 ; 0x1b 39e60: 9c 8d ldd r25, Y+28 ; 0x1c 39e62: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 39e66: 9b 01 movw r18, r22 39e68: ac 01 movw r20, r24 39e6a: c7 01 movw r24, r14 39e6c: b6 01 movw r22, r12 39e6e: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> if (fabs(l) > 0.1f) 39e72: 9f 77 andi r25, 0x7F ; 127 39e74: 2d ec ldi r18, 0xCD ; 205 39e76: 3c ec ldi r19, 0xCC ; 204 39e78: 4c ec ldi r20, 0xCC ; 204 39e7a: 5d e3 ldi r21, 0x3D ; 61 39e7c: 0f 94 88 df call 0x3bf10 ; 0x3bf10 <__gesf2> 39e80: 18 16 cp r1, r24 39e82: 14 f0 brlt .+4 ; 0x39e88 #endif reset = true; } } if (reset) 39e84: 11 23 and r17, r17 39e86: f1 f0 breq .+60 ; 0x39ec4 { #if 0 SERIAL_ECHOLNPGM("Invalid bed correction matrix. Resetting to identity."); #endif reset_bed_offset_and_skew(); 39e88: 0f 94 10 ce call 0x39c20 ; 0x39c20 * @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; 39e8c: 80 e0 ldi r24, 0x00 ; 0 39e8e: 90 e0 ldi r25, 0x00 ; 0 39e90: a0 e8 ldi r26, 0x80 ; 128 39e92: bf e3 ldi r27, 0x3F ; 63 39e94: 89 83 std Y+1, r24 ; 0x01 39e96: 9a 83 std Y+2, r25 ; 0x02 39e98: ab 83 std Y+3, r26 ; 0x03 39e9a: bc 83 std Y+4, r27 ; 0x04 vec_x[1] = 0.f; 39e9c: 1d 82 std Y+5, r1 ; 0x05 39e9e: 1e 82 std Y+6, r1 ; 0x06 39ea0: 1f 82 std Y+7, r1 ; 0x07 39ea2: 18 86 std Y+8, r1 ; 0x08 vec_y[0] = 0.f; 39ea4: 19 86 std Y+9, r1 ; 0x09 39ea6: 1a 86 std Y+10, r1 ; 0x0a 39ea8: 1b 86 std Y+11, r1 ; 0x0b 39eaa: 1c 86 std Y+12, r1 ; 0x0c vec_y[1] = 1.f; 39eac: 8d 87 std Y+13, r24 ; 0x0d 39eae: 9e 87 std Y+14, r25 ; 0x0e 39eb0: af 87 std Y+15, r26 ; 0x0f 39eb2: b8 8b std Y+16, r27 ; 0x10 cntr[0] = 0.f; 39eb4: 19 8a std Y+17, r1 ; 0x11 39eb6: 1a 8a std Y+18, r1 ; 0x12 39eb8: 1b 8a std Y+19, r1 ; 0x13 39eba: 1c 8a std Y+20, r1 ; 0x14 #ifdef DEFAULT_Y_OFFSET cntr[1] = DEFAULT_Y_OFFSET; #else cntr[1] = 0.f; 39ebc: 1d 8a std Y+21, r1 ; 0x15 39ebe: 1e 8a std Y+22, r1 ; 0x16 39ec0: 1f 8a std Y+23, r1 ; 0x17 39ec2: 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); 39ec4: ae 01 movw r20, r28 39ec6: 4f 5e subi r20, 0xEF ; 239 39ec8: 5f 4f sbci r21, 0xFF ; 255 39eca: be 01 movw r22, r28 39ecc: 67 5f subi r22, 0xF7 ; 247 39ece: 7f 4f sbci r23, 0xFF ; 255 39ed0: ce 01 movw r24, r28 39ed2: 01 96 adiw r24, 0x01 ; 1 39ed4: 0f 94 6f cc call 0x398de ; 0x398de MYSERIAL.print(world2machine_shift[0], 5); SERIAL_ECHOPGM(", "); MYSERIAL.print(world2machine_shift[1], 5); SERIAL_ECHOLNPGM(""); #endif } 39ed8: a8 96 adiw r28, 0x28 ; 40 39eda: 0f b6 in r0, 0x3f ; 63 39edc: f8 94 cli 39ede: de bf out 0x3e, r29 ; 62 39ee0: 0f be out 0x3f, r0 ; 63 39ee2: cd bf out 0x3d, r28 ; 61 39ee4: df 91 pop r29 39ee6: cf 91 pop r28 39ee8: 1f 91 pop r17 39eea: ff 90 pop r15 39eec: ef 90 pop r14 39eee: df 90 pop r13 39ef0: cf 90 pop r12 39ef2: bf 90 pop r11 39ef4: af 90 pop r10 39ef6: 9f 90 pop r9 39ef8: 8f 90 pop r8 39efa: 7f 90 pop r7 39efc: 6f 90 pop r6 39efe: 5f 90 pop r5 39f00: 4f 90 pop r4 39f02: 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; 39f04: 11 e0 ldi r17, 0x01 ; 1 39f06: 8a cf rjmp .-236 ; 0x39e1c 00039f08 : lcd_print_pad_P(title, LCD_WIDTH); lcd_set_cursor(0, 2); } void menu_progressbar_update(uint16_t newVal) { 39f08: cf 93 push r28 uint8_t newCnt = (newVal * LCD_WIDTH) / progressbar_total; 39f0a: 24 e1 ldi r18, 0x14 ; 20 39f0c: ac 01 movw r20, r24 39f0e: 24 9f mul r18, r20 39f10: c0 01 movw r24, r0 39f12: 25 9f mul r18, r21 39f14: 90 0d add r25, r0 39f16: 11 24 eor r1, r1 39f18: 60 91 d9 17 lds r22, 0x17D9 ; 0x8017d9 39f1c: 70 91 da 17 lds r23, 0x17DA ; 0x8017da 39f20: 0f 94 a0 dc call 0x3b940 ; 0x3b940 <__udivmodhi4> 39f24: c6 2f mov r28, r22 39f26: 65 31 cpi r22, 0x15 ; 21 39f28: 08 f0 brcs .+2 ; 0x39f2c 39f2a: c4 e1 ldi r28, 0x14 ; 20 if (newCnt > LCD_WIDTH) newCnt = LCD_WIDTH; while (newCnt > progressbar_block_count) 39f2c: 80 91 d8 17 lds r24, 0x17D8 ; 0x8017d8 39f30: 8c 17 cp r24, r28 39f32: 48 f4 brcc .+18 ; 0x39f46 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 39f34: 8f ef ldi r24, 0xFF ; 255 39f36: 0e 94 a7 6f call 0xdf4e ; 0xdf4e { lcd_print(LCD_STR_SOLID_BLOCK[0]); progressbar_block_count++; 39f3a: 80 91 d8 17 lds r24, 0x17D8 ; 0x8017d8 39f3e: 8f 5f subi r24, 0xFF ; 255 39f40: 80 93 d8 17 sts 0x17D8, r24 ; 0x8017d8 39f44: f3 cf rjmp .-26 ; 0x39f2c } } 39f46: cf 91 pop r28 39f48: 08 95 ret 00039f4a : void menu_progressbar_finish(void) { progressbar_total = 1; 39f4a: 81 e0 ldi r24, 0x01 ; 1 39f4c: 90 e0 ldi r25, 0x00 ; 0 39f4e: 90 93 da 17 sts 0x17DA, r25 ; 0x8017da 39f52: 80 93 d9 17 sts 0x17D9, r24 ; 0x8017d9 menu_progressbar_update(1); 39f56: 0f 94 84 cf call 0x39f08 ; 0x39f08 _delay(300); 39f5a: 6c e2 ldi r22, 0x2C ; 44 39f5c: 71 e0 ldi r23, 0x01 ; 1 39f5e: 80 e0 ldi r24, 0x00 ; 0 39f60: 90 e0 ldi r25, 0x00 ; 0 39f62: 0d 94 29 27 jmp 0x24e52 ; 0x24e52 00039f66 : } static uint8_t progressbar_block_count = 0; static uint16_t progressbar_total = 0; void menu_progressbar_init(uint16_t total, const char* title) { 39f66: 0f 93 push r16 39f68: 1f 93 push r17 39f6a: cf 93 push r28 39f6c: df 93 push r29 39f6e: 8c 01 movw r16, r24 39f70: eb 01 movw r28, r22 lcd_clear(); 39f72: 0e 94 2b 6f call 0xde56 ; 0xde56 progressbar_block_count = 0; 39f76: 10 92 d8 17 sts 0x17D8, r1 ; 0x8017d8 progressbar_total = total; 39f7a: 10 93 da 17 sts 0x17DA, r17 ; 0x8017da 39f7e: 00 93 d9 17 sts 0x17D9, r16 ; 0x8017d9 lcd_set_cursor(0, 1); 39f82: 61 e0 ldi r22, 0x01 ; 1 39f84: 80 e0 ldi r24, 0x00 ; 0 39f86: 0e 94 f8 6e call 0xddf0 ; 0xddf0 lcd_print_pad_P(title, LCD_WIDTH); 39f8a: 64 e1 ldi r22, 0x14 ; 20 39f8c: ce 01 movw r24, r28 39f8e: 0e 94 cd 70 call 0xe19a ; 0xe19a lcd_set_cursor(0, 2); 39f92: 62 e0 ldi r22, 0x02 ; 2 39f94: 80 e0 ldi r24, 0x00 ; 0 } 39f96: df 91 pop r29 39f98: cf 91 pop r28 39f9a: 1f 91 pop r17 39f9c: 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); 39f9e: 0c 94 f8 6e jmp 0xddf0 ; 0xddf0 00039fa2 : } menu_item++; } bool __attribute__((noinline)) menu_item_leave(){ return ((menu_item == menu_line) && menu_clicked && (lcd_encoder == menu_item)) || menu_leaving; 39fa2: 80 91 14 05 lds r24, 0x0514 ; 0x800514 39fa6: 90 91 13 05 lds r25, 0x0513 ; 0x800513 39faa: 89 13 cpse r24, r25 39fac: 0b c0 rjmp .+22 ; 0x39fc4 39fae: 90 91 12 05 lds r25, 0x0512 ; 0x800512 39fb2: 99 23 and r25, r25 39fb4: 39 f0 breq .+14 ; 0x39fc4 39fb6: 20 91 6f 06 lds r18, 0x066F ; 0x80066f 39fba: 30 91 70 06 lds r19, 0x0670 ; 0x800670 39fbe: 82 17 cp r24, r18 39fc0: 13 06 cpc r1, r19 39fc2: 39 f0 breq .+14 ; 0x39fd2 39fc4: 81 e0 ldi r24, 0x01 ; 1 39fc6: 90 91 d5 03 lds r25, 0x03D5 ; 0x8003d5 39fca: 91 11 cpse r25, r1 39fcc: 03 c0 rjmp .+6 ; 0x39fd4 39fce: 80 e0 ldi r24, 0x00 ; 0 39fd0: 08 95 ret 39fd2: 81 e0 ldi r24, 0x01 ; 1 } 39fd4: 08 95 ret 00039fd6 : //! @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) { 39fd6: 0f 93 push r16 39fd8: 1f 93 push r17 39fda: cf 93 push r28 39fdc: df 93 push r29 39fde: 8c 01 movw r16, r24 39fe0: eb 01 movw r28, r22 uint_least8_t index = sprintf_P(buffer.c, PSTR("%.10S "), _T(MSG_SHEET)); 39fe2: 8d ec ldi r24, 0xCD ; 205 39fe4: 9d e4 ldi r25, 0x4D ; 77 39fe6: 0e 94 c4 72 call 0xe588 ; 0xe588 39fea: 9f 93 push r25 39fec: 8f 93 push r24 39fee: 88 e0 ldi r24, 0x08 ; 8 39ff0: 9c ea ldi r25, 0xAC ; 172 39ff2: 9f 93 push r25 39ff4: 8f 93 push r24 39ff6: df 93 push r29 39ff8: cf 93 push r28 39ffa: 0f 94 ee da call 0x3b5dc ; 0x3b5dc eeprom_read_block(&(buffer.c[index]), sheet_E.name, 7); 39ffe: c8 0f add r28, r24 3a000: d1 1d adc r29, r1 3a002: 47 e0 ldi r20, 0x07 ; 7 3a004: 50 e0 ldi r21, 0x00 ; 0 3a006: b8 01 movw r22, r16 3a008: ce 01 movw r24, r28 3a00a: 0f 94 c7 db call 0x3b78e ; 0x3b78e //index += 7; buffer.c[index + 7] = '\0'; 3a00e: 1f 82 std Y+7, r1 ; 0x07 3a010: 0f 90 pop r0 3a012: 0f 90 pop r0 3a014: 0f 90 pop r0 3a016: 0f 90 pop r0 3a018: 0f 90 pop r0 3a01a: 0f 90 pop r0 } 3a01c: df 91 pop r29 3a01e: cf 91 pop r28 3a020: 1f 91 pop r17 3a022: 0f 91 pop r16 3a024: 08 95 ret 0003a026 : 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)?'>':' '; 3a026: 20 91 14 05 lds r18, 0x0514 ; 0x800514 3a02a: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 3a02e: 90 91 70 06 lds r25, 0x0670 ; 0x800670 3a032: 28 17 cp r18, r24 3a034: 19 06 cpc r1, r25 3a036: 11 f0 breq .+4 ; 0x3a03c 3a038: 80 e2 ldi r24, 0x20 ; 32 3a03a: 08 95 ret 3a03c: 8e e3 ldi r24, 0x3E ; 62 } 3a03e: 08 95 ret 0003a040 : static void menu_draw_item_puts_P(char type_char, const char* str) { 3a040: 0f 93 push r16 3a042: 1f 93 push r17 3a044: cf 93 push r28 3a046: c8 2f mov r28, r24 3a048: 8b 01 movw r16, r22 lcd_putc_at(0, menu_row, menu_selection_mark()); 3a04a: 0f 94 13 d0 call 0x3a026 ; 0x3a026 3a04e: 48 2f mov r20, r24 3a050: 60 91 11 05 lds r22, 0x0511 ; 0x800511 3a054: 80 e0 ldi r24, 0x00 ; 0 3a056: 0e 94 18 6f call 0xde30 ; 0xde30 lcd_print_pad_P(str, LCD_WIDTH - 2); 3a05a: 62 e1 ldi r22, 0x12 ; 18 3a05c: c8 01 movw r24, r16 3a05e: 0e 94 cd 70 call 0xe19a ; 0xe19a lcd_putc(type_char); 3a062: 8c 2f mov r24, r28 } 3a064: cf 91 pop r28 3a066: 1f 91 pop r17 3a068: 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); 3a06a: 0c 94 e7 6e jmp 0xddce ; 0xddce 0003a06e : } } void menu_item_ret(void) { lcd_draw_update = 2; 3a06e: 82 e0 ldi r24, 0x02 ; 2 3a070: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d menu_item++; 3a074: 80 91 14 05 lds r24, 0x0514 ; 0x800514 3a078: 8f 5f subi r24, 0xFF ; 255 3a07a: 80 93 14 05 sts 0x0514, r24 ; 0x800514 //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 3a07e: 84 e0 ldi r24, 0x04 ; 4 3a080: 80 93 11 05 sts 0x0511, r24 ; 0x800511 menu_line = 0; // prevent subsequent menu items from rendering at all in the current MENU_BEGIN() for loop cycle 3a084: 10 92 13 05 sts 0x0513, r1 ; 0x800513 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 3a088: 10 92 12 05 sts 0x0512, r1 ; 0x800512 } 3a08c: 08 95 ret 0003a08e : } menu_item++; } void menu_item_gcode_P(const char* str, const char* str_gcode) { 3a08e: cf 93 push r28 3a090: df 93 push r29 if (menu_item == menu_line) 3a092: 30 91 14 05 lds r19, 0x0514 ; 0x800514 3a096: 20 91 13 05 lds r18, 0x0513 ; 0x800513 3a09a: 32 13 cpse r19, r18 3a09c: 20 c0 rjmp .+64 ; 0x3a0de 3a09e: eb 01 movw r28, r22 3a0a0: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); 3a0a2: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a0a6: 88 23 and r24, r24 3a0a8: 19 f0 breq .+6 ; 0x3a0b0 3a0aa: 80 e2 ldi r24, 0x20 ; 32 3a0ac: 0f 94 20 d0 call 0x3a040 ; 0x3a040 if (menu_clicked && (lcd_encoder == menu_item)) 3a0b0: 80 91 12 05 lds r24, 0x0512 ; 0x800512 3a0b4: 88 23 and r24, r24 3a0b6: 99 f0 breq .+38 ; 0x3a0de 3a0b8: 20 91 14 05 lds r18, 0x0514 ; 0x800514 3a0bc: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 3a0c0: 90 91 70 06 lds r25, 0x0670 ; 0x800670 3a0c4: 28 17 cp r18, r24 3a0c6: 19 06 cpc r1, r25 3a0c8: 51 f4 brne .+20 ; 0x3a0de { if (str_gcode) enquecommand_P(str_gcode); 3a0ca: 20 97 sbiw r28, 0x00 ; 0 3a0cc: 21 f0 breq .+8 ; 0x3a0d6 3a0ce: 61 e0 ldi r22, 0x01 ; 1 3a0d0: ce 01 movw r24, r28 3a0d2: 0e 94 38 88 call 0x11070 ; 0x11070 menu_item_ret(); return; } } menu_item++; } 3a0d6: df 91 pop r29 3a0d8: 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(); 3a0da: 0d 94 37 d0 jmp 0x3a06e ; 0x3a06e return; } } menu_item++; 3a0de: 80 91 14 05 lds r24, 0x0514 ; 0x800514 3a0e2: 8f 5f subi r24, 0xFF ; 255 3a0e4: 80 93 14 05 sts 0x0514, r24 ; 0x800514 } 3a0e8: df 91 pop r29 3a0ea: cf 91 pop r28 3a0ec: 08 95 ret 0003a0ee : //! @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) { 3a0ee: ef 92 push r14 3a0f0: ff 92 push r15 3a0f2: 0f 93 push r16 3a0f4: 1f 93 push r17 3a0f6: cf 93 push r28 3a0f8: df 93 push r29 if (menu_item == menu_line) 3a0fa: 70 91 14 05 lds r23, 0x0514 ; 0x800514 3a0fe: 30 91 13 05 lds r19, 0x0513 ; 0x800513 3a102: 73 13 cpse r23, r19 3a104: 3f c0 rjmp .+126 ; 0x3a184 3a106: 12 2f mov r17, r18 3a108: ea 01 movw r28, r20 3a10a: 06 2f mov r16, r22 3a10c: 7c 01 movw r14, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str, number); 3a10e: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a112: 88 23 and r24, r24 3a114: d1 f0 breq .+52 ; 0x3a14a } 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()); 3a116: 0f 94 13 d0 call 0x3a026 ; 0x3a026 3a11a: 48 2f mov r20, r24 3a11c: 60 91 11 05 lds r22, 0x0511 ; 0x800511 3a120: 80 e0 ldi r24, 0x00 ; 0 3a122: 0e 94 18 6f call 0xde30 ; 0xde30 uint8_t len = lcd_print_pad_P(str, max_strlen); 3a126: 61 e1 ldi r22, 0x11 ; 17 3a128: c7 01 movw r24, r14 3a12a: 0e 94 cd 70 call 0xe19a ; 0xe19a lcd_putc_at((max_strlen - len) + 2, menu_row, num); 3a12e: 40 2f mov r20, r16 3a130: 60 91 11 05 lds r22, 0x0511 ; 0x800511 3a134: 93 e1 ldi r25, 0x13 ; 19 3a136: 98 1b sub r25, r24 3a138: 89 2f mov r24, r25 3a13a: 0e 94 18 6f call 0xde30 ; 0xde30 lcd_putc_at(LCD_WIDTH - 1, menu_row, type_char); 3a13e: 40 e2 ldi r20, 0x20 ; 32 3a140: 60 91 11 05 lds r22, 0x0511 ; 0x800511 3a144: 83 e1 ldi r24, 0x13 ; 19 3a146: 0e 94 18 6f call 0xde30 ; 0xde30 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)) 3a14a: 80 91 12 05 lds r24, 0x0512 ; 0x800512 3a14e: 88 23 and r24, r24 3a150: c9 f0 breq .+50 ; 0x3a184 3a152: 20 91 14 05 lds r18, 0x0514 ; 0x800514 3a156: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 3a15a: 90 91 70 06 lds r25, 0x0670 ; 0x800670 3a15e: 28 17 cp r18, r24 3a160: 19 06 cpc r1, r25 3a162: 81 f4 brne .+32 ; 0x3a184 { lcd_update_enabled = 0; 3a164: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e if (func) func(fn_par); 3a168: 81 2f mov r24, r17 3a16a: fe 01 movw r30, r28 3a16c: 19 95 eicall lcd_update_enabled = 1; 3a16e: 81 e0 ldi r24, 0x01 ; 1 3a170: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e menu_item_ret(); return; } } menu_item++; } 3a174: df 91 pop r29 3a176: cf 91 pop r28 3a178: 1f 91 pop r17 3a17a: 0f 91 pop r16 3a17c: ff 90 pop r15 3a17e: 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(); 3a180: 0d 94 37 d0 jmp 0x3a06e ; 0x3a06e return; } } menu_item++; 3a184: 80 91 14 05 lds r24, 0x0514 ; 0x800514 3a188: 8f 5f subi r24, 0xFF ; 255 3a18a: 80 93 14 05 sts 0x0514, r24 ; 0x800514 } 3a18e: df 91 pop r29 3a190: cf 91 pop r28 3a192: 1f 91 pop r17 3a194: 0f 91 pop r16 3a196: ff 90 pop r15 3a198: ef 90 pop r14 3a19a: 08 95 ret 0003a19c : 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) { 3a19c: cf 93 push r28 3a19e: df 93 push r29 if (menu_item == menu_line) 3a1a0: 30 91 14 05 lds r19, 0x0514 ; 0x800514 3a1a4: 20 91 13 05 lds r18, 0x0513 ; 0x800513 3a1a8: 32 13 cpse r19, r18 3a1aa: 21 c0 rjmp .+66 ; 0x3a1ee 3a1ac: eb 01 movw r28, r22 3a1ae: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); 3a1b0: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a1b4: 88 23 and r24, r24 3a1b6: 19 f0 breq .+6 ; 0x3a1be 3a1b8: 80 e2 ldi r24, 0x20 ; 32 3a1ba: 0f 94 20 d0 call 0x3a040 ; 0x3a040 if (menu_clicked && (lcd_encoder == menu_item)) 3a1be: 80 91 12 05 lds r24, 0x0512 ; 0x800512 3a1c2: 88 23 and r24, r24 3a1c4: a1 f0 breq .+40 ; 0x3a1ee 3a1c6: 20 91 14 05 lds r18, 0x0514 ; 0x800514 3a1ca: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 3a1ce: 90 91 70 06 lds r25, 0x0670 ; 0x800670 3a1d2: 28 17 cp r18, r24 3a1d4: 19 06 cpc r1, r25 3a1d6: 59 f4 brne .+22 ; 0x3a1ee { lcd_update_enabled = 0; 3a1d8: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e if (func) func(); 3a1dc: fe 01 movw r30, r28 3a1de: 19 95 eicall lcd_update_enabled = 1; 3a1e0: 81 e0 ldi r24, 0x01 ; 1 3a1e2: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e menu_item_ret(); return; } } menu_item++; } 3a1e6: df 91 pop r29 3a1e8: 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(); 3a1ea: 0d 94 37 d0 jmp 0x3a06e ; 0x3a06e return; } } menu_item++; 3a1ee: 80 91 14 05 lds r24, 0x0514 ; 0x800514 3a1f2: 8f 5f subi r24, 0xFF ; 255 3a1f4: 80 93 14 05 sts 0x0514, r24 ; 0x800514 } 3a1f8: df 91 pop r29 3a1fa: cf 91 pop r28 3a1fc: 08 95 ret 0003a1fe : menu_item++; } uint8_t menu_item_text_P(const char* str) { if (menu_item == menu_line) 3a1fe: 30 91 14 05 lds r19, 0x0514 ; 0x800514 3a202: 20 91 13 05 lds r18, 0x0513 ; 0x800513 3a206: 32 13 cpse r19, r18 3a208: 19 c0 rjmp .+50 ; 0x3a23c 3a20a: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); 3a20c: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a210: 88 23 and r24, r24 3a212: 19 f0 breq .+6 ; 0x3a21a 3a214: 80 e2 ldi r24, 0x20 ; 32 3a216: 0f 94 20 d0 call 0x3a040 ; 0x3a040 if (menu_clicked && (lcd_encoder == menu_item)) 3a21a: 80 91 12 05 lds r24, 0x0512 ; 0x800512 3a21e: 88 23 and r24, r24 3a220: 69 f0 breq .+26 ; 0x3a23c 3a222: 20 91 14 05 lds r18, 0x0514 ; 0x800514 3a226: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 3a22a: 90 91 70 06 lds r25, 0x0670 ; 0x800670 3a22e: 28 17 cp r18, r24 3a230: 19 06 cpc r1, r25 3a232: 21 f4 brne .+8 ; 0x3a23c { menu_item_ret(); 3a234: 0f 94 37 d0 call 0x3a06e ; 0x3a06e return 1; 3a238: 81 e0 ldi r24, 0x01 ; 1 3a23a: 08 95 ret } } menu_item++; 3a23c: 80 91 14 05 lds r24, 0x0514 ; 0x800514 3a240: 8f 5f subi r24, 0xFF ; 255 3a242: 80 93 14 05 sts 0x0514, r24 ; 0x800514 return 0; 3a246: 80 e0 ldi r24, 0x00 ; 0 } 3a248: 08 95 ret 0003a24a : menu_clicked = lcd_clicked(); // Consume click event } void menu_end(void) { if (menu_row >= LCD_HEIGHT) 3a24a: 80 91 11 05 lds r24, 0x0511 ; 0x800511 3a24e: 84 30 cpi r24, 0x04 ; 4 3a250: 38 f5 brcc .+78 ; 0x3a2a0 { // Early abort if the menu was clicked. The current menu might have changed because of the click event return; } if (lcd_encoder >= menu_item) 3a252: 80 91 14 05 lds r24, 0x0514 ; 0x800514 3a256: 90 e0 ldi r25, 0x00 ; 0 3a258: 20 91 6f 06 lds r18, 0x066F ; 0x80066f 3a25c: 30 91 70 06 lds r19, 0x0670 ; 0x800670 3a260: 28 17 cp r18, r24 3a262: 39 07 cpc r19, r25 3a264: 44 f0 brlt .+16 ; 0x3a276 { lcd_encoder = menu_item - 1; 3a266: 01 97 sbiw r24, 0x01 ; 1 3a268: 90 93 70 06 sts 0x0670, r25 ; 0x800670 3a26c: 80 93 6f 06 sts 0x066F, r24 ; 0x80066f Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 3a270: 87 e0 ldi r24, 0x07 ; 7 3a272: 0f 94 c2 4d call 0x29b84 ; 0x29b84 } if (((uint8_t)lcd_encoder) >= menu_top + LCD_HEIGHT) 3a276: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 3a27a: 20 91 a3 03 lds r18, 0x03A3 ; 0x8003a3 3a27e: 30 e0 ldi r19, 0x00 ; 0 3a280: 2d 5f subi r18, 0xFD ; 253 3a282: 3f 4f sbci r19, 0xFF ; 255 3a284: 82 17 cp r24, r18 3a286: 13 06 cpc r1, r19 3a288: 59 f0 breq .+22 ; 0x3a2a0 3a28a: 54 f0 brlt .+20 ; 0x3a2a0 { menu_top = lcd_encoder - LCD_HEIGHT + 1; 3a28c: 9d ef ldi r25, 0xFD ; 253 3a28e: 98 0f add r25, r24 3a290: 90 93 a3 03 sts 0x03A3, r25 ; 0x8003a3 menu_line = menu_top - 1; 3a294: 84 50 subi r24, 0x04 ; 4 3a296: 80 93 13 05 sts 0x0513, r24 ; 0x800513 menu_row = -1; 3a29a: 8f ef ldi r24, 0xFF ; 255 3a29c: 80 93 11 05 sts 0x0511, r24 ; 0x800511 } } 3a2a0: 08 95 ret 0003a2a2 : CRITICAL_SECTION_END; } void menu_start(void) { if (lcd_encoder < 0) 3a2a2: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 3a2a6: 90 91 70 06 lds r25, 0x0670 ; 0x800670 3a2aa: 97 ff sbrs r25, 7 3a2ac: 07 c0 rjmp .+14 ; 0x3a2bc { lcd_encoder = 0; 3a2ae: 10 92 70 06 sts 0x0670, r1 ; 0x800670 3a2b2: 10 92 6f 06 sts 0x066F, r1 ; 0x80066f Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 3a2b6: 87 e0 ldi r24, 0x07 ; 7 3a2b8: 0f 94 c2 4d call 0x29b84 ; 0x29b84 } if (lcd_encoder < menu_top) 3a2bc: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 3a2c0: 90 91 70 06 lds r25, 0x0670 ; 0x800670 3a2c4: 20 91 a3 03 lds r18, 0x03A3 ; 0x8003a3 3a2c8: 28 17 cp r18, r24 3a2ca: 19 06 cpc r1, r25 3a2cc: 19 f0 breq .+6 ; 0x3a2d4 3a2ce: 14 f0 brlt .+4 ; 0x3a2d4 menu_top = lcd_encoder; 3a2d0: 80 93 a3 03 sts 0x03A3, r24 ; 0x8003a3 menu_line = menu_top; 3a2d4: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 3a2d8: 80 93 13 05 sts 0x0513, r24 ; 0x800513 menu_clicked = lcd_clicked(); // Consume click event 3a2dc: 0e 94 15 71 call 0xe22a ; 0xe22a 3a2e0: 80 93 12 05 sts 0x0512, r24 ; 0x800512 } 3a2e4: 08 95 ret 0003a2e6 : 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)); 3a2e6: e7 ea ldi r30, 0xA7 ; 167 3a2e8: f3 e0 ldi r31, 0x03 ; 3 3a2ea: 80 e2 ldi r24, 0x20 ; 32 3a2ec: df 01 movw r26, r30 3a2ee: 1d 92 st X+, r1 3a2f0: 8a 95 dec r24 3a2f2: e9 f7 brne .-6 ; 0x3a2ee } 3a2f4: 08 95 ret 0003a2f6 : void menu_goto(menu_func_t menu, const int16_t encoder, bool reset_menu_state, const bool feedback) { 3a2f6: cf 93 push r28 CRITICAL_SECTION_START; 3a2f8: 3f b7 in r19, 0x3f ; 63 3a2fa: f8 94 cli if (menu_menu != menu) 3a2fc: e0 91 12 04 lds r30, 0x0412 ; 0x800412 3a300: f0 91 13 04 lds r31, 0x0413 ; 0x800413 3a304: e8 17 cp r30, r24 3a306: f9 07 cpc r31, r25 3a308: c9 f0 breq .+50 ; 0x3a33c 3a30a: c4 2f mov r28, r20 { menu_menu = menu; 3a30c: 90 93 13 04 sts 0x0413, r25 ; 0x800413 3a310: 80 93 12 04 sts 0x0412, r24 ; 0x800412 lcd_encoder = encoder; 3a314: 70 93 70 06 sts 0x0670, r23 ; 0x800670 3a318: 60 93 6f 06 sts 0x066F, r22 ; 0x80066f menu_top = 0; //reset menu view. Needed if menu_back() is called from deep inside a menu, such as Support 3a31c: 10 92 a3 03 sts 0x03A3, r1 ; 0x8003a3 lcd_draw_update = 2; // Full LCD re-draw 3a320: 82 e0 ldi r24, 0x02 ; 2 3a322: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d CRITICAL_SECTION_END; 3a326: 3f bf out 0x3f, r19 ; 63 if (feedback) lcd_beeper_quick_feedback(); 3a328: 22 23 and r18, r18 3a32a: 19 f0 breq .+6 ; 0x3a332 } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 3a32c: 80 e0 ldi r24, 0x00 ; 0 3a32e: 0f 94 c2 4d call 0x29b84 ; 0x29b84 if (reset_menu_state) menu_data_reset(); 3a332: cc 23 and r28, r28 3a334: 21 f0 breq .+8 ; 0x3a33e } else CRITICAL_SECTION_END; } 3a336: 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(); 3a338: 0d 94 73 d1 jmp 0x3a2e6 ; 0x3a2e6 } else CRITICAL_SECTION_END; 3a33c: 3f bf out 0x3f, r19 ; 63 } 3a33e: cf 91 pop r28 3a340: 08 95 ret 0003a342 : 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) { 3a342: 7f 92 push r7 3a344: 8f 92 push r8 3a346: 9f 92 push r9 3a348: af 92 push r10 3a34a: bf 92 push r11 3a34c: cf 92 push r12 3a34e: df 92 push r13 3a350: ef 92 push r14 3a352: ff 92 push r15 3a354: 0f 93 push r16 3a356: 1f 93 push r17 3a358: cf 93 push r28 3a35a: df 93 push r29 menu_data_edit_t* _md = (menu_data_edit_t*)&(menu_data[0]); if (menu_item == menu_line) 3a35c: e0 91 14 05 lds r30, 0x0514 ; 0x800514 3a360: 50 91 13 05 lds r21, 0x0513 ; 0x800513 3a364: e5 13 cpse r30, r21 3a366: 73 c0 rjmp .+230 ; 0x3a44e { int16_t cur_val = (pbits == 8 ? *((uint8_t*)pval) : *((int16_t*)pval)); 3a368: fb 01 movw r30, r22 3a36a: 48 30 cpi r20, 0x08 ; 8 3a36c: 09 f0 breq .+2 ; 0x3a370 3a36e: 6c c0 rjmp .+216 ; 0x3a448 3a370: c0 81 ld r28, Z 3a372: d0 e0 ldi r29, 0x00 ; 0 3a374: 49 01 movw r8, r18 3a376: 74 2e mov r7, r20 3a378: 6b 01 movw r12, r22 3a37a: 5c 01 movw r10, r24 if (lcd_draw_update) 3a37c: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a380: 88 23 and r24, r24 3a382: 59 f0 breq .+22 ; 0x3a39a { lcd_set_cursor(0, menu_row); 3a384: 60 91 11 05 lds r22, 0x0511 ; 0x800511 3a388: 80 e0 ldi r24, 0x00 ; 0 3a38a: 0e 94 f8 6e call 0xddf0 ; 0xddf0 menu_draw_P(menu_selection_mark(), str, cur_val); 3a38e: 0f 94 13 d0 call 0x3a026 ; 0x3a026 3a392: ae 01 movw r20, r28 3a394: b5 01 movw r22, r10 3a396: 0f 94 87 b0 call 0x3610e ; 0x3610e } if (menu_clicked && (lcd_encoder == menu_item)) 3a39a: 80 91 12 05 lds r24, 0x0512 ; 0x800512 3a39e: 88 23 and r24, r24 3a3a0: 09 f4 brne .+2 ; 0x3a3a4 3a3a2: 55 c0 rjmp .+170 ; 0x3a44e 3a3a4: 90 91 14 05 lds r25, 0x0514 ; 0x800514 3a3a8: 20 91 6f 06 lds r18, 0x066F ; 0x80066f 3a3ac: 30 91 70 06 lds r19, 0x0670 ; 0x800670 3a3b0: 92 17 cp r25, r18 3a3b2: 13 06 cpc r1, r19 3a3b4: 09 f0 breq .+2 ; 0x3a3b8 3a3b6: 4b c0 rjmp .+150 ; 0x3a44e } } void menu_submenu_no_reset(menu_func_t submenu, const bool feedback) { if (menu_depth < MENU_DEPTH_MAX) 3a3b8: 80 91 f7 03 lds r24, 0x03F7 ; 0x8003f7 3a3bc: 87 30 cpi r24, 0x07 ; 7 3a3be: d8 f4 brcc .+54 ; 0x3a3f6 { menu_stack[menu_depth].menu = menu_menu; 3a3c0: 28 2f mov r18, r24 3a3c2: 30 e0 ldi r19, 0x00 ; 0 3a3c4: f9 01 movw r30, r18 3a3c6: ee 0f add r30, r30 3a3c8: ff 1f adc r31, r31 3a3ca: e2 0f add r30, r18 3a3cc: f3 1f adc r31, r19 3a3ce: ed 53 subi r30, 0x3D ; 61 3a3d0: f8 4e sbci r31, 0xE8 ; 232 3a3d2: 20 91 12 04 lds r18, 0x0412 ; 0x800412 3a3d6: 30 91 13 04 lds r19, 0x0413 ; 0x800413 3a3da: 31 83 std Z+1, r19 ; 0x01 3a3dc: 20 83 st Z, r18 menu_stack[menu_depth++].position = lcd_encoder; 3a3de: 8f 5f subi r24, 0xFF ; 255 3a3e0: 80 93 f7 03 sts 0x03F7, r24 ; 0x8003f7 3a3e4: 92 83 std Z+2, r25 ; 0x02 menu_goto(submenu, 0, false, feedback); 3a3e6: 20 e0 ldi r18, 0x00 ; 0 3a3e8: 40 e0 ldi r20, 0x00 ; 0 3a3ea: 70 e0 ldi r23, 0x00 ; 0 3a3ec: 60 e0 ldi r22, 0x00 ; 0 3a3ee: 8a e9 ldi r24, 0x9A ; 154 3a3f0: 99 e3 ldi r25, 0x39 ; 57 3a3f2: 0f 94 7b d1 call 0x3a2f6 ; 0x3a2f6 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; 3a3f6: b0 92 a8 03 sts 0x03A8, r11 ; 0x8003a8 3a3fa: a0 92 a7 03 sts 0x03A7, r10 ; 0x8003a7 _md->editValuePtr = pval; 3a3fe: d0 92 ab 03 sts 0x03AB, r13 ; 0x8003ab 3a402: c0 92 aa 03 sts 0x03AA, r12 ; 0x8003aa _md->editValueBits = pbits; 3a406: 70 92 a9 03 sts 0x03A9, r7 ; 0x8003a9 _md->currentValue = cur_val; 3a40a: d0 93 ad 03 sts 0x03AD, r29 ; 0x8003ad 3a40e: c0 93 ac 03 sts 0x03AC, r28 ; 0x8003ac _md->minEditValue = min_val; 3a412: 90 92 af 03 sts 0x03AF, r9 ; 0x8003af 3a416: 80 92 ae 03 sts 0x03AE, r8 ; 0x8003ae _md->maxEditValue = max_val; 3a41a: 10 93 b1 03 sts 0x03B1, r17 ; 0x8003b1 3a41e: 00 93 b0 03 sts 0x03B0, r16 ; 0x8003b0 _md->minJumpValue = jmp_val; 3a422: f0 92 b3 03 sts 0x03B3, r15 ; 0x8003b3 3a426: e0 92 b2 03 sts 0x03B2, r14 ; 0x8003b2 menu_item_ret(); return; } } menu_item++; } 3a42a: df 91 pop r29 3a42c: cf 91 pop r28 3a42e: 1f 91 pop r17 3a430: 0f 91 pop r16 3a432: ff 90 pop r15 3a434: ef 90 pop r14 3a436: df 90 pop r13 3a438: cf 90 pop r12 3a43a: bf 90 pop r11 3a43c: af 90 pop r10 3a43e: 9f 90 pop r9 3a440: 8f 90 pop r8 3a442: 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(); 3a444: 0d 94 37 d0 jmp 0x3a06e ; 0x3a06e 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)); 3a448: c0 81 ld r28, Z 3a44a: d1 81 ldd r29, Z+1 ; 0x01 3a44c: 93 cf rjmp .-218 ; 0x3a374 _md->minJumpValue = jmp_val; menu_item_ret(); return; } } menu_item++; 3a44e: 80 91 14 05 lds r24, 0x0514 ; 0x800514 3a452: 8f 5f subi r24, 0xFF ; 255 3a454: 80 93 14 05 sts 0x0514, r24 ; 0x800514 } 3a458: df 91 pop r29 3a45a: cf 91 pop r28 3a45c: 1f 91 pop r17 3a45e: 0f 91 pop r16 3a460: ff 90 pop r15 3a462: ef 90 pop r14 3a464: df 90 pop r13 3a466: cf 90 pop r12 3a468: bf 90 pop r11 3a46a: af 90 pop r10 3a46c: 9f 90 pop r9 3a46e: 8f 90 pop r8 3a470: 7f 90 pop r7 3a472: 08 95 ret 0003a474 <_menu_edit_P()>: } static void _menu_edit_P() { menu_data_edit_t* _md = (menu_data_edit_t*)&(menu_data[0]); if (lcd_draw_update) 3a474: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a478: 88 23 and r24, r24 3a47a: 09 f4 brne .+2 ; 0x3a47e <_menu_edit_P()+0xa> 3a47c: 52 c0 rjmp .+164 ; 0x3a522 <_menu_edit_P()+0xae> { // handle initial value jumping if (_md->minJumpValue && lcd_encoder) { 3a47e: 20 91 b2 03 lds r18, 0x03B2 ; 0x8003b2 3a482: 30 91 b3 03 lds r19, 0x03B3 ; 0x8003b3 3a486: 80 91 ae 03 lds r24, 0x03AE ; 0x8003ae 3a48a: 90 91 af 03 lds r25, 0x03AF ; 0x8003af 3a48e: 21 15 cp r18, r1 3a490: 31 05 cpc r19, r1 3a492: d9 f0 breq .+54 ; 0x3a4ca <_menu_edit_P()+0x56> 3a494: 40 91 6f 06 lds r20, 0x066F ; 0x80066f 3a498: 50 91 70 06 lds r21, 0x0670 ; 0x800670 3a49c: 41 15 cp r20, r1 3a49e: 51 05 cpc r21, r1 3a4a0: a1 f0 breq .+40 ; 0x3a4ca <_menu_edit_P()+0x56> if (lcd_encoder > 0 && _md->currentValue == _md->minEditValue) { 3a4a2: 7c f0 brlt .+30 ; 0x3a4c2 <_menu_edit_P()+0x4e> 3a4a4: 40 91 ac 03 lds r20, 0x03AC ; 0x8003ac 3a4a8: 50 91 ad 03 lds r21, 0x03AD ; 0x8003ad 3a4ac: 48 17 cp r20, r24 3a4ae: 59 07 cpc r21, r25 3a4b0: 41 f4 brne .+16 ; 0x3a4c2 <_menu_edit_P()+0x4e> _md->currentValue = _md->minJumpValue; 3a4b2: 30 93 ad 03 sts 0x03AD, r19 ; 0x8003ad 3a4b6: 20 93 ac 03 sts 0x03AC, r18 ; 0x8003ac lcd_encoder = 0; 3a4ba: 10 92 70 06 sts 0x0670, r1 ; 0x800670 3a4be: 10 92 6f 06 sts 0x066F, r1 ; 0x80066f } // disable after first use and/or if the initial value is not minEditValue _md->minJumpValue = 0; 3a4c2: 10 92 b3 03 sts 0x03B3, r1 ; 0x8003b3 3a4c6: 10 92 b2 03 sts 0x03B2, r1 ; 0x8003b2 } _md->currentValue += lcd_encoder; 3a4ca: 20 91 ac 03 lds r18, 0x03AC ; 0x8003ac 3a4ce: 30 91 ad 03 lds r19, 0x03AD ; 0x8003ad 3a4d2: 40 91 6f 06 lds r20, 0x066F ; 0x80066f 3a4d6: 50 91 70 06 lds r21, 0x0670 ; 0x800670 3a4da: 24 0f add r18, r20 3a4dc: 35 1f adc r19, r21 lcd_encoder = 0; // Consume knob rotation event 3a4de: 10 92 70 06 sts 0x0670, r1 ; 0x800670 3a4e2: 10 92 6f 06 sts 0x066F, r1 ; 0x80066f // Constrain the value in case it's outside the allowed limits _md->currentValue = constrain(_md->currentValue, _md->minEditValue, _md->maxEditValue); 3a4e6: 28 17 cp r18, r24 3a4e8: 39 07 cpc r19, r25 3a4ea: 44 f0 brlt .+16 ; 0x3a4fc <_menu_edit_P()+0x88> 3a4ec: 80 91 b0 03 lds r24, 0x03B0 ; 0x8003b0 3a4f0: 90 91 b1 03 lds r25, 0x03B1 ; 0x8003b1 3a4f4: 28 17 cp r18, r24 3a4f6: 39 07 cpc r19, r25 3a4f8: 0c f4 brge .+2 ; 0x3a4fc <_menu_edit_P()+0x88> 3a4fa: c9 01 movw r24, r18 3a4fc: 90 93 ad 03 sts 0x03AD, r25 ; 0x8003ad 3a500: 80 93 ac 03 sts 0x03AC, r24 ; 0x8003ac lcd_set_cursor(0, 1); 3a504: 61 e0 ldi r22, 0x01 ; 1 3a506: 80 e0 ldi r24, 0x00 ; 0 3a508: 0e 94 f8 6e call 0xddf0 ; 0xddf0 menu_draw_P(' ', _md->editLabel, _md->currentValue); 3a50c: 40 91 ac 03 lds r20, 0x03AC ; 0x8003ac 3a510: 50 91 ad 03 lds r21, 0x03AD ; 0x8003ad 3a514: 60 91 a7 03 lds r22, 0x03A7 ; 0x8003a7 3a518: 70 91 a8 03 lds r23, 0x03A8 ; 0x8003a8 3a51c: 80 e2 ldi r24, 0x20 ; 32 3a51e: 0f 94 87 b0 call 0x3610e ; 0x3610e } if (lcd_clicked()) 3a522: 0e 94 15 71 call 0xe22a ; 0xe22a 3a526: 88 23 and r24, r24 3a528: 41 f1 breq .+80 ; 0x3a57a <_menu_edit_P()+0x106> 3a52a: e0 91 aa 03 lds r30, 0x03AA ; 0x8003aa 3a52e: f0 91 ab 03 lds r31, 0x03AB ; 0x8003ab 3a532: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 3a536: 90 91 ad 03 lds r25, 0x03AD ; 0x8003ad { if (_md->editValueBits == 8) 3a53a: 20 91 a9 03 lds r18, 0x03A9 ; 0x8003a9 *((uint8_t*)(_md->editValuePtr)) = _md->currentValue; 3a53e: 80 83 st Z, r24 lcd_set_cursor(0, 1); menu_draw_P(' ', _md->editLabel, _md->currentValue); } if (lcd_clicked()) { if (_md->editValueBits == 8) 3a540: 28 30 cpi r18, 0x08 ; 8 3a542: c9 f4 brne .+50 ; 0x3a576 <_menu_edit_P()+0x102> menu_back(1); } void menu_back_no_reset(void) { if (menu_depth > 0) 3a544: 80 91 f7 03 lds r24, 0x03F7 ; 0x8003f7 3a548: 88 23 and r24, r24 3a54a: b9 f0 breq .+46 ; 0x3a57a <_menu_edit_P()+0x106> { menu_depth--; 3a54c: 81 50 subi r24, 0x01 ; 1 3a54e: 80 93 f7 03 sts 0x03F7, r24 ; 0x8003f7 menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, false); 3a552: 90 e0 ldi r25, 0x00 ; 0 3a554: fc 01 movw r30, r24 3a556: ee 0f add r30, r30 3a558: ff 1f adc r31, r31 3a55a: e8 0f add r30, r24 3a55c: f9 1f adc r31, r25 3a55e: ed 53 subi r30, 0x3D ; 61 3a560: f8 4e sbci r31, 0xE8 ; 232 3a562: 62 81 ldd r22, Z+2 ; 0x02 3a564: 06 2e mov r0, r22 3a566: 00 0c add r0, r0 3a568: 77 0b sbc r23, r23 3a56a: 20 e0 ldi r18, 0x00 ; 0 3a56c: 40 e0 ldi r20, 0x00 ; 0 3a56e: 80 81 ld r24, Z 3a570: 91 81 ldd r25, Z+1 ; 0x01 3a572: 0d 94 7b d1 jmp 0x3a2f6 ; 0x3a2f6 if (lcd_clicked()) { if (_md->editValueBits == 8) *((uint8_t*)(_md->editValuePtr)) = _md->currentValue; else *((int16_t*)(_md->editValuePtr)) = _md->currentValue; 3a576: 91 83 std Z+1, r25 ; 0x01 3a578: e5 cf rjmp .-54 ; 0x3a544 <_menu_edit_P()+0xd0> menu_back_no_reset(); } } 3a57a: 08 95 ret 0003a57c : if (lcd_clicked()) menu_back(); } void menu_submenu(menu_func_t submenu, const bool feedback) { 3a57c: dc 01 movw r26, r24 3a57e: 26 2f mov r18, r22 if (menu_depth < MENU_DEPTH_MAX) 3a580: 90 91 f7 03 lds r25, 0x03F7 ; 0x8003f7 3a584: 97 30 cpi r25, 0x07 ; 7 3a586: d8 f4 brcc .+54 ; 0x3a5be { menu_stack[menu_depth].menu = menu_menu; 3a588: 49 2f mov r20, r25 3a58a: 50 e0 ldi r21, 0x00 ; 0 3a58c: fa 01 movw r30, r20 3a58e: ee 0f add r30, r30 3a590: ff 1f adc r31, r31 3a592: e4 0f add r30, r20 3a594: f5 1f adc r31, r21 3a596: ed 53 subi r30, 0x3D ; 61 3a598: f8 4e sbci r31, 0xE8 ; 232 3a59a: 40 91 12 04 lds r20, 0x0412 ; 0x800412 3a59e: 50 91 13 04 lds r21, 0x0413 ; 0x800413 3a5a2: 51 83 std Z+1, r21 ; 0x01 3a5a4: 40 83 st Z, r20 menu_stack[menu_depth++].position = lcd_encoder; 3a5a6: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 3a5aa: 9f 5f subi r25, 0xFF ; 255 3a5ac: 90 93 f7 03 sts 0x03F7, r25 ; 0x8003f7 3a5b0: 82 83 std Z+2, r24 ; 0x02 menu_goto(submenu, 0, true, feedback); 3a5b2: 41 e0 ldi r20, 0x01 ; 1 3a5b4: 70 e0 ldi r23, 0x00 ; 0 3a5b6: 60 e0 ldi r22, 0x00 ; 0 3a5b8: cd 01 movw r24, r26 3a5ba: 0d 94 7b d1 jmp 0x3a2f6 ; 0x3a2f6 } } 3a5be: 08 95 ret 0003a5c0 : } menu_item++; } void menu_item_toggle_P(const char* str, const char* toggle, menu_func_t func, const uint8_t settings) { 3a5c0: 8f 92 push r8 3a5c2: 9f 92 push r9 3a5c4: af 92 push r10 3a5c6: bf 92 push r11 3a5c8: cf 92 push r12 3a5ca: df 92 push r13 3a5cc: ef 92 push r14 3a5ce: ff 92 push r15 3a5d0: 0f 93 push r16 3a5d2: 1f 93 push r17 3a5d4: cf 93 push r28 3a5d6: df 93 push r29 if (menu_item == menu_line) 3a5d8: e0 91 14 05 lds r30, 0x0514 ; 0x800514 3a5dc: 30 91 13 05 lds r19, 0x0513 ; 0x800513 3a5e0: e3 13 cpse r30, r19 3a5e2: 73 c0 rjmp .+230 ; 0x3a6ca 3a5e4: c2 2f mov r28, r18 3a5e6: 6a 01 movw r12, r20 3a5e8: 7b 01 movw r14, r22 3a5ea: 5c 01 movw r10, r24 { if (lcd_draw_update) menu_draw_toggle_puts_P(str, toggle, settings | (menu_selection_mark()=='>')); 3a5ec: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a5f0: 88 23 and r24, r24 3a5f2: a1 f1 breq .+104 ; 0x3a65c 3a5f4: 0f 94 13 d0 call 0x3a026 ; 0x3a026 3a5f8: 01 e0 ldi r16, 0x01 ; 1 3a5fa: 8e 33 cpi r24, 0x3E ; 62 3a5fc: 09 f0 breq .+2 ; 0x3a600 3a5fe: 00 e0 ldi r16, 0x00 ; 0 3a600: 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; 3a602: 80 2f mov r24, r16 3a604: 82 70 andi r24, 0x02 ; 2 3a606: 88 2e mov r8, r24 const char eol = (toggle == NULL) ? LCD_STR_ARROW_RIGHT[0] : ' '; 3a608: e1 14 cp r14, r1 3a60a: f1 04 cpc r15, r1 3a60c: 09 f4 brne .+2 ; 0x3a610 3a60e: 6f c0 rjmp .+222 ; 0x3a6ee 3a610: e7 01 movw r28, r14 3a612: 90 e2 ldi r25, 0x20 ; 32 3a614: 99 2e mov r9, r25 if (toggle == NULL) toggle = _T(MSG_NA); uint8_t len = 4 + (is_progmem ? strlen_P(toggle) : strlen(toggle)); 3a616: 88 20 and r8, r8 3a618: 09 f4 brne .+2 ; 0x3a61c 3a61a: 41 c0 rjmp .+130 ; 0x3a69e 3a61c: ce 01 movw r24, r28 3a61e: 0f 94 95 d9 call 0x3b32a ; 0x3b32a <__strlen_P> 3a622: 14 e0 ldi r17, 0x04 ; 4 3a624: 18 0f add r17, r24 lcd_putc_at(0, menu_row, (settings & 0x01) ? '>' : ' '); 3a626: 4e e3 ldi r20, 0x3E ; 62 3a628: 00 ff sbrs r16, 0 3a62a: 40 e2 ldi r20, 0x20 ; 32 3a62c: 60 91 11 05 lds r22, 0x0511 ; 0x800511 3a630: 80 e0 ldi r24, 0x00 ; 0 3a632: 0e 94 18 6f call 0xde30 ; 0xde30 lcd_print_pad_P(str, LCD_WIDTH - len); 3a636: 64 e1 ldi r22, 0x14 ; 20 3a638: 61 1b sub r22, r17 3a63a: c5 01 movw r24, r10 3a63c: 0e 94 cd 70 call 0xe19a ; 0xe19a lcd_putc('['); 3a640: 8b e5 ldi r24, 0x5B ; 91 3a642: 0e 94 e7 6e call 0xddce ; 0xddce if (is_progmem) { lcd_puts_P(toggle); 3a646: 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) 3a648: 88 20 and r8, r8 3a64a: 89 f1 breq .+98 ; 0x3a6ae { lcd_puts_P(toggle); 3a64c: 0e 94 e3 6e call 0xddc6 ; 0xddc6 } else { lcd_print(toggle); } lcd_putc(']'); 3a650: 8d e5 ldi r24, 0x5D ; 93 3a652: 0e 94 e7 6e call 0xddce ; 0xddce lcd_putc(eol); 3a656: 89 2d mov r24, r9 3a658: 0e 94 e7 6e call 0xddce ; 0xddce 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)) 3a65c: 80 91 12 05 lds r24, 0x0512 ; 0x800512 3a660: 88 23 and r24, r24 3a662: 99 f1 breq .+102 ; 0x3a6ca 3a664: 20 91 14 05 lds r18, 0x0514 ; 0x800514 3a668: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 3a66c: 90 91 70 06 lds r25, 0x0670 ; 0x800670 3a670: 28 17 cp r18, r24 3a672: 19 06 cpc r1, r25 3a674: 51 f5 brne .+84 ; 0x3a6ca { if (toggle == NULL) // print N/A warning message 3a676: ef 28 or r14, r15 3a678: e9 f4 brne .+58 ; 0x3a6b4 { menu_submenu(func); 3a67a: 60 e0 ldi r22, 0x00 ; 0 3a67c: c6 01 movw r24, r12 3a67e: 0f 94 be d2 call 0x3a57c ; 0x3a57c menu_item_ret(); return; } } menu_item++; } 3a682: df 91 pop r29 3a684: cf 91 pop r28 3a686: 1f 91 pop r17 3a688: 0f 91 pop r16 3a68a: ff 90 pop r15 3a68c: ef 90 pop r14 3a68e: df 90 pop r13 3a690: cf 90 pop r12 3a692: bf 90 pop r11 3a694: af 90 pop r10 3a696: 9f 90 pop r9 3a698: 8f 90 pop r8 { lcd_update_enabled = 0; if (func) func(); lcd_update_enabled = 1; } menu_item_ret(); 3a69a: 0d 94 37 d0 jmp 0x3a06e ; 0x3a06e //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)); 3a69e: fe 01 movw r30, r28 3a6a0: 01 90 ld r0, Z+ 3a6a2: 00 20 and r0, r0 3a6a4: e9 f7 brne .-6 ; 0x3a6a0 3a6a6: ec 1b sub r30, r28 3a6a8: 13 e0 ldi r17, 0x03 ; 3 3a6aa: 1e 0f add r17, r30 3a6ac: bc cf rjmp .-136 ; 0x3a626 lcd_putc('['); if (is_progmem) { lcd_puts_P(toggle); } else { lcd_print(toggle); 3a6ae: 0e 94 ff 70 call 0xe1fe ; 0xe1fe 3a6b2: ce cf rjmp .-100 ; 0x3a650 { menu_submenu(func); } else // do the actual toggling { lcd_update_enabled = 0; 3a6b4: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e if (func) func(); 3a6b8: c1 14 cp r12, r1 3a6ba: d1 04 cpc r13, r1 3a6bc: 11 f0 breq .+4 ; 0x3a6c2 3a6be: f6 01 movw r30, r12 3a6c0: 19 95 eicall lcd_update_enabled = 1; 3a6c2: 81 e0 ldi r24, 0x01 ; 1 3a6c4: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e 3a6c8: dc cf rjmp .-72 ; 0x3a682 } menu_item_ret(); return; } } menu_item++; 3a6ca: 80 91 14 05 lds r24, 0x0514 ; 0x800514 3a6ce: 8f 5f subi r24, 0xFF ; 255 3a6d0: 80 93 14 05 sts 0x0514, r24 ; 0x800514 } 3a6d4: df 91 pop r29 3a6d6: cf 91 pop r28 3a6d8: 1f 91 pop r17 3a6da: 0f 91 pop r16 3a6dc: ff 90 pop r15 3a6de: ef 90 pop r14 3a6e0: df 90 pop r13 3a6e2: cf 90 pop r12 3a6e4: bf 90 pop r11 3a6e6: af 90 pop r10 3a6e8: 9f 90 pop r9 3a6ea: 8f 90 pop r8 3a6ec: 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); 3a6ee: 86 ee ldi r24, 0xE6 ; 230 3a6f0: 97 e4 ldi r25, 0x47 ; 71 3a6f2: 0e 94 c4 72 call 0xe588 ; 0xe588 3a6f6: 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] : ' '; 3a6f8: 8e e7 ldi r24, 0x7E ; 126 3a6fa: 98 2e mov r9, r24 3a6fc: 8c cf rjmp .-232 ; 0x3a616 0003a6fe : } menu_item++; } void menu_item_submenu_E(const Sheet &sheet, menu_func_t submenu) { 3a6fe: 0f 93 push r16 3a700: 1f 93 push r17 3a702: cf 93 push r28 3a704: df 93 push r29 3a706: cd b7 in r28, 0x3d ; 61 3a708: de b7 in r29, 0x3e ; 62 3a70a: 63 97 sbiw r28, 0x13 ; 19 3a70c: 0f b6 in r0, 0x3f ; 63 3a70e: f8 94 cli 3a710: de bf out 0x3e, r29 ; 62 3a712: 0f be out 0x3f, r0 ; 63 3a714: cd bf out 0x3d, r28 ; 61 if (menu_item == menu_line) 3a716: 30 91 14 05 lds r19, 0x0514 ; 0x800514 3a71a: 20 91 13 05 lds r18, 0x0513 ; 0x800513 3a71e: 32 13 cpse r19, r18 3a720: 38 c0 rjmp .+112 ; 0x3a792 3a722: 8b 01 movw r16, r22 { if (lcd_draw_update) menu_draw_item_puts_E(LCD_STR_ARROW_RIGHT[0], sheet); 3a724: 20 91 6d 02 lds r18, 0x026D ; 0x80026d 3a728: 22 23 and r18, r18 3a72a: a9 f0 breq .+42 ; 0x3a756 static void menu_draw_item_puts_E(char type_char, const Sheet &sheet) { SheetFormatBuffer buffer; menu_format_sheet_E(sheet, buffer); 3a72c: be 01 movw r22, r28 3a72e: 6f 5f subi r22, 0xFF ; 255 3a730: 7f 4f sbci r23, 0xFF ; 255 3a732: 0f 94 eb cf call 0x39fd6 ; 0x39fd6 lcd_putc_at(0, menu_row, menu_selection_mark()); 3a736: 0f 94 13 d0 call 0x3a026 ; 0x3a026 3a73a: 48 2f mov r20, r24 3a73c: 60 91 11 05 lds r22, 0x0511 ; 0x800511 3a740: 80 e0 ldi r24, 0x00 ; 0 3a742: 0e 94 18 6f call 0xde30 ; 0xde30 lcd_print_pad(buffer.c, LCD_WIDTH - 2); 3a746: 62 e1 ldi r22, 0x12 ; 18 3a748: ce 01 movw r24, r28 3a74a: 01 96 adiw r24, 0x01 ; 1 3a74c: 0e 94 e7 70 call 0xe1ce ; 0xe1ce lcd_putc(type_char); 3a750: 8e e7 ldi r24, 0x7E ; 126 3a752: 0e 94 e7 6e call 0xddce ; 0xddce 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)) 3a756: 80 91 12 05 lds r24, 0x0512 ; 0x800512 3a75a: 88 23 and r24, r24 3a75c: d1 f0 breq .+52 ; 0x3a792 3a75e: 20 91 14 05 lds r18, 0x0514 ; 0x800514 3a762: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 3a766: 90 91 70 06 lds r25, 0x0670 ; 0x800670 3a76a: 28 17 cp r18, r24 3a76c: 19 06 cpc r1, r25 3a76e: 89 f4 brne .+34 ; 0x3a792 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); 3a770: 60 e0 ldi r22, 0x00 ; 0 3a772: c8 01 movw r24, r16 3a774: 0f 94 be d2 call 0x3a57c ; 0x3a57c menu_item_ret(); 3a778: 0f 94 37 d0 call 0x3a06e ; 0x3a06e menu_item_ret(); return; } } menu_item++; } 3a77c: 63 96 adiw r28, 0x13 ; 19 3a77e: 0f b6 in r0, 0x3f ; 63 3a780: f8 94 cli 3a782: de bf out 0x3e, r29 ; 62 3a784: 0f be out 0x3f, r0 ; 63 3a786: cd bf out 0x3d, r28 ; 61 3a788: df 91 pop r29 3a78a: cf 91 pop r28 3a78c: 1f 91 pop r17 3a78e: 0f 91 pop r16 3a790: 08 95 ret menu_submenu(submenu); menu_item_ret(); return; } } menu_item++; 3a792: 80 91 14 05 lds r24, 0x0514 ; 0x800514 3a796: 8f 5f subi r24, 0xFF ; 255 3a798: 80 93 14 05 sts 0x0514, r24 ; 0x800514 3a79c: ef cf rjmp .-34 ; 0x3a77c 0003a79e : menu_item++; return 0; } void menu_item_submenu_P(const char* str, menu_func_t submenu) { 3a79e: cf 93 push r28 3a7a0: df 93 push r29 if (menu_item == menu_line) 3a7a2: 30 91 14 05 lds r19, 0x0514 ; 0x800514 3a7a6: 20 91 13 05 lds r18, 0x0513 ; 0x800513 3a7aa: 32 13 cpse r19, r18 3a7ac: 1e c0 rjmp .+60 ; 0x3a7ea 3a7ae: eb 01 movw r28, r22 3a7b0: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(LCD_STR_ARROW_RIGHT[0], str); 3a7b2: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a7b6: 88 23 and r24, r24 3a7b8: 19 f0 breq .+6 ; 0x3a7c0 3a7ba: 8e e7 ldi r24, 0x7E ; 126 3a7bc: 0f 94 20 d0 call 0x3a040 ; 0x3a040 if (menu_clicked && (lcd_encoder == menu_item)) 3a7c0: 80 91 12 05 lds r24, 0x0512 ; 0x800512 3a7c4: 88 23 and r24, r24 3a7c6: 89 f0 breq .+34 ; 0x3a7ea 3a7c8: 20 91 14 05 lds r18, 0x0514 ; 0x800514 3a7cc: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 3a7d0: 90 91 70 06 lds r25, 0x0670 ; 0x800670 3a7d4: 28 17 cp r18, r24 3a7d6: 19 06 cpc r1, r25 3a7d8: 41 f4 brne .+16 ; 0x3a7ea { menu_submenu(submenu); 3a7da: 60 e0 ldi r22, 0x00 ; 0 3a7dc: ce 01 movw r24, r28 3a7de: 0f 94 be d2 call 0x3a57c ; 0x3a57c menu_item_ret(); return; } } menu_item++; } 3a7e2: df 91 pop r29 3a7e4: 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(); 3a7e6: 0d 94 37 d0 jmp 0x3a06e ; 0x3a06e return; } } menu_item++; 3a7ea: 80 91 14 05 lds r24, 0x0514 ; 0x800514 3a7ee: 8f 5f subi r24, 0xFF ; 255 3a7f0: 80 93 14 05 sts 0x0514, r24 ; 0x800514 } 3a7f4: df 91 pop r29 3a7f6: cf 91 pop r28 3a7f8: 08 95 ret 0003a7fa : menu_row = -1; } } void menu_back(uint8_t nLevel) { 3a7fa: 98 2f mov r25, r24 menu_depth = ((menu_depth > nLevel) ? (menu_depth - nLevel) : 0); 3a7fc: 80 91 f7 03 lds r24, 0x03F7 ; 0x8003f7 3a800: 98 17 cp r25, r24 3a802: a8 f4 brcc .+42 ; 0x3a82e 3a804: 89 1b sub r24, r25 3a806: 80 93 f7 03 sts 0x03F7, r24 ; 0x8003f7 menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, true); 3a80a: 90 e0 ldi r25, 0x00 ; 0 3a80c: fc 01 movw r30, r24 3a80e: ee 0f add r30, r30 3a810: ff 1f adc r31, r31 3a812: e8 0f add r30, r24 3a814: f9 1f adc r31, r25 3a816: ed 53 subi r30, 0x3D ; 61 3a818: f8 4e sbci r31, 0xE8 ; 232 3a81a: 62 81 ldd r22, Z+2 ; 0x02 3a81c: 06 2e mov r0, r22 3a81e: 00 0c add r0, r0 3a820: 77 0b sbc r23, r23 3a822: 20 e0 ldi r18, 0x00 ; 0 3a824: 41 e0 ldi r20, 0x01 ; 1 3a826: 80 81 ld r24, Z 3a828: 91 81 ldd r25, Z+1 ; 0x01 3a82a: 0d 94 7b d1 jmp 0x3a2f6 ; 0x3a2f6 } } void menu_back(uint8_t nLevel) { menu_depth = ((menu_depth > nLevel) ? (menu_depth - nLevel) : 0); 3a82e: 80 e0 ldi r24, 0x00 ; 0 3a830: ea cf rjmp .-44 ; 0x3a806 0003a832 : menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, true); } void menu_back(void) { menu_back(1); 3a832: 81 e0 ldi r24, 0x01 ; 1 3a834: 0d 94 fd d3 jmp 0x3a7fa ; 0x3a7fa 0003a838 : menu_item++; } void menu_item_back_P(const char* str) { if (menu_item == menu_line) 3a838: 30 91 14 05 lds r19, 0x0514 ; 0x800514 3a83c: 20 91 13 05 lds r18, 0x0513 ; 0x800513 3a840: 32 13 cpse r19, r18 3a842: 19 c0 rjmp .+50 ; 0x3a876 3a844: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(LCD_STR_UPLEVEL[0], str); 3a846: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a84a: 88 23 and r24, r24 3a84c: 19 f0 breq .+6 ; 0x3a854 3a84e: 83 e8 ldi r24, 0x83 ; 131 3a850: 0f 94 20 d0 call 0x3a040 ; 0x3a040 if (menu_clicked && (lcd_encoder == menu_item)) 3a854: 80 91 12 05 lds r24, 0x0512 ; 0x800512 3a858: 88 23 and r24, r24 3a85a: 69 f0 breq .+26 ; 0x3a876 3a85c: 20 91 14 05 lds r18, 0x0514 ; 0x800514 3a860: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 3a864: 90 91 70 06 lds r25, 0x0670 ; 0x800670 3a868: 28 17 cp r18, r24 3a86a: 19 06 cpc r1, r25 3a86c: 21 f4 brne .+8 ; 0x3a876 { menu_back(); 3a86e: 0f 94 19 d4 call 0x3a832 ; 0x3a832 menu_item_ret(); 3a872: 0d 94 37 d0 jmp 0x3a06e ; 0x3a06e return; } } menu_item++; 3a876: 80 91 14 05 lds r24, 0x0514 ; 0x800514 3a87a: 8f 5f subi r24, 0xFF ; 255 3a87c: 80 93 14 05 sts 0x0514, r24 ; 0x800514 } 3a880: 08 95 ret 0003a882 : }; 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() { 3a882: ef 92 push r14 3a884: ff 92 push r15 3a886: 0f 93 push r16 3a888: 1f 93 push r17 3a88a: cf 93 push r28 3a88c: df 93 push r29 3a88e: 10 92 da 03 sts 0x03DA, r1 ; 0x8003da 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) 3a892: 80 91 b4 03 lds r24, 0x03B4 ; 0x8003b4 3a896: 81 11 cpse r24, r1 3a898: 23 c0 rjmp .+70 ; 0x3a8e0 { _md->status = 1; // Menu entered for the first time 3a89a: 81 e0 ldi r24, 0x01 ; 1 3a89c: 80 93 b4 03 sts 0x03B4, r24 ; 0x8003b4 // Fetch the TuneItem from PROGMEM const uint8_t offset = (mmu2.MMUCurrentErrorCode() == ErrorCode::HOMING_IDLER_FAILED) ? 1 : 0; 3a8a0: 81 e0 ldi r24, 0x01 ; 1 3a8a2: 90 e0 ldi r25, 0x00 ; 0 3a8a4: 20 91 8a 13 lds r18, 0x138A ; 0x80138a 3a8a8: 30 91 8b 13 lds r19, 0x138B ; 0x80138b 3a8ac: 27 30 cpi r18, 0x07 ; 7 3a8ae: 31 48 sbci r19, 0x81 ; 129 3a8b0: 11 f0 breq .+4 ; 0x3a8b6 3a8b2: 90 e0 ldi r25, 0x00 ; 0 3a8b4: 80 e0 ldi r24, 0x00 ; 0 memcpy_P(&(_md->item), &TuneItems[offset], sizeof(TuneItem)); 3a8b6: bc 01 movw r22, r24 3a8b8: 66 0f add r22, r22 3a8ba: 77 1f adc r23, r23 3a8bc: 68 0f add r22, r24 3a8be: 79 1f adc r23, r25 3a8c0: 61 5c subi r22, 0xC1 ; 193 3a8c2: 73 45 sbci r23, 0x53 ; 83 3a8c4: 43 e0 ldi r20, 0x03 ; 3 3a8c6: 50 e0 ldi r21, 0x00 ; 0 3a8c8: 86 eb ldi r24, 0xB6 ; 182 3a8ca: 93 e0 ldi r25, 0x03 ; 3 3a8cc: 0f 94 71 d9 call 0x3b2e2 ; 0x3b2e2 // Fetch the value which is currently in MMU EEPROM mmu2.ReadRegister(_md->item.address); 3a8d0: 80 91 b6 03 lds r24, 0x03B6 ; 0x8003b6 3a8d4: 0f 94 71 0f call 0x21ee2 ; 0x21ee2 _md->currentValue = mmu2.GetLastReadRegisterValue(); 3a8d8: 80 91 b5 13 lds r24, 0x13B5 ; 0x8013b5 3a8dc: 80 93 b5 03 sts 0x03B5, r24 ; 0x8003b5 } MENU_BEGIN(); 3a8e0: 0f 94 51 d1 call 0x3a2a2 ; 0x3a2a2 3a8e4: 10 92 11 05 sts 0x0511, r1 ; 0x800511 3a8e8: 80 91 11 05 lds r24, 0x0511 ; 0x800511 3a8ec: 84 30 cpi r24, 0x04 ; 4 3a8ee: e0 f5 brcc .+120 ; 0x3a968 3a8f0: 10 92 14 05 sts 0x0514, r1 ; 0x800514 ON_MENU_LEAVE( 3a8f4: 0f 94 d1 cf call 0x39fa2 ; 0x39fa2 3a8f8: 88 23 and r24, r24 3a8fa: 89 f0 breq .+34 ; 0x3a91e 3a8fc: 60 91 b5 03 lds r22, 0x03B5 ; 0x8003b5 3a900: 70 e0 ldi r23, 0x00 ; 0 3a902: 80 91 b6 03 lds r24, 0x03B6 ; 0x8003b6 3a906: 0e 94 1f e8 call 0x1d03e ; 0x1d03e 3a90a: 10 92 ac 0d sts 0x0DAC, r1 ; 0x800dac <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.496> &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); } 3a90e: df 91 pop r29 3a910: cf 91 pop r28 3a912: 1f 91 pop r17 3a914: 0f 91 pop r16 3a916: ff 90 pop r15 3a918: ef 90 pop r14 mmu2.ReadRegister(_md->item.address); _md->currentValue = mmu2.GetLastReadRegisterValue(); } MENU_BEGIN(); ON_MENU_LEAVE( 3a91a: 0d 94 7c 1e jmp 0x23cf8 ; 0x23cf8 mmu2.WriteRegister(_md->item.address, (uint16_t)_md->currentValue); putErrorScreenToSleep = false; lcd_return_to_status(); return; ); MENU_ITEM_BACK_P(_T(MSG_DONE)); 3a91e: 8c ee ldi r24, 0xEC ; 236 3a920: 94 e6 ldi r25, 0x64 ; 100 3a922: 0e 94 c4 72 call 0xe588 ; 0xe588 3a926: 0f 94 1c d4 call 0x3a838 ; 0x3a838 MENU_ITEM_EDIT_int3_P( 3a92a: 00 91 b8 03 lds r16, 0x03B8 ; 0x8003b8 3a92e: 10 e0 ldi r17, 0x00 ; 0 3a930: c0 91 b7 03 lds r28, 0x03B7 ; 0x8003b7 3a934: d0 e0 ldi r29, 0x00 ; 0 3a936: 8e ed ldi r24, 0xDE ; 222 3a938: 94 e6 ldi r25, 0x64 ; 100 3a93a: 0e 94 c4 72 call 0xe588 ; 0xe588 3a93e: f1 2c mov r15, r1 3a940: e1 2c mov r14, r1 3a942: 9e 01 movw r18, r28 3a944: 48 e0 ldi r20, 0x08 ; 8 3a946: 65 eb ldi r22, 0xB5 ; 181 3a948: 73 e0 ldi r23, 0x03 ; 3 3a94a: 0f 94 a1 d1 call 0x3a342 ; 0x3a342 _T(MSG_MMU_SENSITIVITY), &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); 3a94e: 0f 94 25 d1 call 0x3a24a ; 0x3a24a // Fetch the value which is currently in MMU EEPROM mmu2.ReadRegister(_md->item.address); _md->currentValue = mmu2.GetLastReadRegisterValue(); } MENU_BEGIN(); 3a952: 80 91 11 05 lds r24, 0x0511 ; 0x800511 3a956: 8f 5f subi r24, 0xFF ; 255 3a958: 80 93 11 05 sts 0x0511, r24 ; 0x800511 3a95c: 80 91 13 05 lds r24, 0x0513 ; 0x800513 3a960: 8f 5f subi r24, 0xFF ; 255 3a962: 80 93 13 05 sts 0x0513, r24 ; 0x800513 3a966: c0 cf rjmp .-128 ; 0x3a8e8 &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); } 3a968: df 91 pop r29 3a96a: cf 91 pop r28 3a96c: 1f 91 pop r17 3a96e: 0f 91 pop r16 3a970: ff 90 pop r15 3a972: ef 90 pop r14 3a974: 08 95 ret 0003a976 : } } void menu_back_if_clicked(void) { if (lcd_clicked()) 3a976: 0e 94 15 71 call 0xe22a ; 0xe22a 3a97a: 81 11 cpse r24, r1 menu_back(); 3a97c: 0d 94 19 d4 jmp 0x3a832 ; 0x3a832 } 3a980: 08 95 ret 0003a982 : } // Private Methods ///////////////////////////////////////////////////////////// void MarlinSerial::printNumber(unsigned long n, uint8_t base) { 3a982: 8f 92 push r8 3a984: 9f 92 push r9 3a986: af 92 push r10 3a988: bf 92 push r11 3a98a: ef 92 push r14 3a98c: ff 92 push r15 3a98e: 0f 93 push r16 3a990: 1f 93 push r17 3a992: cf 93 push r28 3a994: df 93 push r29 3a996: cd b7 in r28, 0x3d ; 61 3a998: de b7 in r29, 0x3e ; 62 3a99a: a0 97 sbiw r28, 0x20 ; 32 3a99c: 0f b6 in r0, 0x3f ; 63 3a99e: f8 94 cli 3a9a0: de bf out 0x3e, r29 ; 62 3a9a2: 0f be out 0x3f, r0 ; 63 3a9a4: cd bf out 0x3d, r28 ; 61 unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; if (n == 0) { 3a9a6: 61 15 cp r22, r1 3a9a8: 71 05 cpc r23, r1 3a9aa: 81 05 cpc r24, r1 3a9ac: 91 05 cpc r25, r1 3a9ae: 99 f4 brne .+38 ; 0x3a9d6 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3a9b0: 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)); } 3a9b2: a0 96 adiw r28, 0x20 ; 32 3a9b4: 0f b6 in r0, 0x3f ; 63 3a9b6: f8 94 cli 3a9b8: de bf out 0x3e, r29 ; 62 3a9ba: 0f be out 0x3f, r0 ; 63 3a9bc: cd bf out 0x3d, r28 ; 61 3a9be: df 91 pop r29 3a9c0: cf 91 pop r28 3a9c2: 1f 91 pop r17 3a9c4: 0f 91 pop r16 3a9c6: ff 90 pop r15 3a9c8: ef 90 pop r14 3a9ca: bf 90 pop r11 3a9cc: af 90 pop r10 3a9ce: 9f 90 pop r9 3a9d0: 8f 90 pop r8 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3a9d2: 0c 94 4f 77 jmp 0xee9e ; 0xee9e // 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; 3a9d6: 00 e0 ldi r16, 0x00 ; 0 print('0'); return; } while (n > 0) { buf[i++] = n % base; 3a9d8: 84 2e mov r8, r20 3a9da: 91 2c mov r9, r1 3a9dc: b1 2c mov r11, r1 3a9de: a1 2c mov r10, r1 3a9e0: 9e 01 movw r18, r28 3a9e2: 2f 5f subi r18, 0xFF ; 255 3a9e4: 3f 4f sbci r19, 0xFF ; 255 3a9e6: 79 01 movw r14, r18 3a9e8: a5 01 movw r20, r10 3a9ea: 94 01 movw r18, r8 3a9ec: 0f 94 4a dc call 0x3b894 ; 0x3b894 <__udivmodsi4> 3a9f0: f7 01 movw r30, r14 3a9f2: e0 0f add r30, r16 3a9f4: f1 1d adc r31, r1 3a9f6: 60 83 st Z, r22 n /= base; 3a9f8: b9 01 movw r22, r18 3a9fa: ca 01 movw r24, r20 print('0'); return; } while (n > 0) { buf[i++] = n % base; 3a9fc: 0f 5f subi r16, 0xFF ; 255 if (n == 0) { print('0'); return; } while (n > 0) { 3a9fe: 61 15 cp r22, r1 3aa00: 71 05 cpc r23, r1 3aa02: 81 05 cpc r24, r1 3aa04: 91 05 cpc r25, r1 3aa06: 81 f7 brne .-32 ; 0x3a9e8 3aa08: 0e 0d add r16, r14 3aa0a: 1f 2d mov r17, r15 3aa0c: 11 1d adc r17, r1 buf[i++] = n % base; n /= base; } for (; i > 0; i--) 3aa0e: e0 16 cp r14, r16 3aa10: f1 06 cpc r15, r17 3aa12: 59 f0 breq .+22 ; 0x3aa2a print((char) (buf[i - 1] < 10 ? 3aa14: f8 01 movw r30, r16 3aa16: 82 91 ld r24, -Z 3aa18: 8f 01 movw r16, r30 3aa1a: 8a 30 cpi r24, 0x0A ; 10 3aa1c: 20 f4 brcc .+8 ; 0x3aa26 '0' + buf[i - 1] : 3aa1e: 80 5d subi r24, 0xD0 ; 208 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3aa20: 0e 94 4f 77 call 0xee9e ; 0xee9e 3aa24: f4 cf rjmp .-24 ; 0x3aa0e } for (; i > 0; i--) print((char) (buf[i - 1] < 10 ? '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); 3aa26: 89 5c subi r24, 0xC9 ; 201 3aa28: fb cf rjmp .-10 ; 0x3aa20 } 3aa2a: a0 96 adiw r28, 0x20 ; 32 3aa2c: 0f b6 in r0, 0x3f ; 63 3aa2e: f8 94 cli 3aa30: de bf out 0x3e, r29 ; 62 3aa32: 0f be out 0x3f, r0 ; 63 3aa34: cd bf out 0x3d, r28 ; 61 3aa36: df 91 pop r29 3aa38: cf 91 pop r28 3aa3a: 1f 91 pop r17 3aa3c: 0f 91 pop r16 3aa3e: ff 90 pop r15 3aa40: ef 90 pop r14 3aa42: bf 90 pop r11 3aa44: af 90 pop r10 3aa46: 9f 90 pop r9 3aa48: 8f 90 pop r8 3aa4a: 08 95 ret 0003aa4c : void MarlinSerial::print(unsigned int n, int base) { print((unsigned long) n, base); } void MarlinSerial::print(long n, int base) 3aa4c: cf 92 push r12 3aa4e: df 92 push r13 3aa50: ef 92 push r14 3aa52: ff 92 push r15 3aa54: 6b 01 movw r12, r22 3aa56: 7c 01 movw r14, r24 { if (base == 0) { write(n); } else if (base == 10) { if (n < 0) { 3aa58: f7 fe sbrs r15, 7 3aa5a: 0b c0 rjmp .+22 ; 0x3aa72 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3aa5c: 8d e2 ldi r24, 0x2D ; 45 3aa5e: 0e 94 4f 77 call 0xee9e ; 0xee9e } else if (base == 10) { if (n < 0) { print('-'); n = -n; 3aa62: f0 94 com r15 3aa64: e0 94 com r14 3aa66: d0 94 com r13 3aa68: c0 94 com r12 3aa6a: c1 1c adc r12, r1 3aa6c: d1 1c adc r13, r1 3aa6e: e1 1c adc r14, r1 3aa70: f1 1c adc r15, r1 } printNumber(n, 10); 3aa72: 4a e0 ldi r20, 0x0A ; 10 3aa74: c7 01 movw r24, r14 3aa76: b6 01 movw r22, r12 } else { printNumber(n, base); } } 3aa78: ff 90 pop r15 3aa7a: ef 90 pop r14 3aa7c: df 90 pop r13 3aa7e: cf 90 pop r12 } else if (base == 10) { if (n < 0) { print('-'); n = -n; } printNumber(n, 10); 3aa80: 0d 94 c1 d4 jmp 0x3a982 ; 0x3a982 0003aa84 : '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); } void MarlinSerial::printFloat(double number, uint8_t digits) { 3aa84: 8f 92 push r8 3aa86: 9f 92 push r9 3aa88: af 92 push r10 3aa8a: bf 92 push r11 3aa8c: cf 92 push r12 3aa8e: df 92 push r13 3aa90: ef 92 push r14 3aa92: ff 92 push r15 3aa94: cf 93 push r28 3aa96: 6b 01 movw r12, r22 3aa98: 7c 01 movw r14, r24 3aa9a: b4 2e mov r11, r20 // Handle negative numbers if (number < 0.0) 3aa9c: 20 e0 ldi r18, 0x00 ; 0 3aa9e: 30 e0 ldi r19, 0x00 ; 0 3aaa0: a9 01 movw r20, r18 3aaa2: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__cmpsf2> 3aaa6: 87 ff sbrs r24, 7 3aaa8: 07 c0 rjmp .+14 ; 0x3aab8 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3aaaa: 8d e2 ldi r24, 0x2D ; 45 3aaac: 0e 94 4f 77 call 0xee9e ; 0xee9e { // Handle negative numbers if (number < 0.0) { print('-'); number = -number; 3aab0: f7 fa bst r15, 7 3aab2: f0 94 com r15 3aab4: f7 f8 bld r15, 7 3aab6: 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; 3aac6: 20 e0 ldi r18, 0x00 ; 0 3aac8: 30 e0 ldi r19, 0x00 ; 0 3aaca: 40 e2 ldi r20, 0x20 ; 32 3aacc: 51 e4 ldi r21, 0x41 ; 65 3aace: 0f 94 fe dd call 0x3bbfc ; 0x3bbfc <__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; 3aad6: 9b 01 movw r18, r22 3aad8: ac 01 movw r20, r24 3aada: c7 01 movw r24, r14 3aadc: b6 01 movw r22, r12 3aade: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 3aae2: 6b 01 movw r12, r22 3aae4: 7c 01 movw r14, r24 // Extract the integer part of the number and print it unsigned long int_part = (unsigned long)number; 3aae6: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 3aaea: 4b 01 movw r8, r22 3aaec: 5c 01 movw r10, r24 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 3aaee: 4a e0 ldi r20, 0x0A ; 10 3aaf0: 0f 94 c1 d4 call 0x3a982 ; 0x3a982 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) 3aaf4: cc 23 and r28, r28 3aaf6: 91 f1 breq .+100 ; 0x3ab5c 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; 3aaf8: c5 01 movw r24, r10 3aafa: b4 01 movw r22, r8 3aafc: 0f 94 63 d6 call 0x3acc6 ; 0x3acc6 <__floatunsisf> 3ab00: 9b 01 movw r18, r22 3ab02: ac 01 movw r20, r24 3ab04: c7 01 movw r24, r14 3ab06: b6 01 movw r22, r12 3ab08: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 3ab0c: 6b 01 movw r12, r22 3ab0e: 7c 01 movw r14, r24 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3ab10: 8e e2 ldi r24, 0x2E ; 46 3ab12: 0e 94 4f 77 call 0xee9e ; 0xee9e // 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) 3ab16: c1 50 subi r28, 0x01 ; 1 3ab18: 08 f1 brcs .+66 ; 0x3ab5c { remainder *= 10.0; 3ab1a: 20 e0 ldi r18, 0x00 ; 0 3ab1c: 30 e0 ldi r19, 0x00 ; 0 3ab1e: 40 e2 ldi r20, 0x20 ; 32 3ab20: 51 e4 ldi r21, 0x41 ; 65 3ab22: c7 01 movw r24, r14 3ab24: b6 01 movw r22, r12 3ab26: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 3ab2a: 4b 01 movw r8, r22 3ab2c: 5c 01 movw r10, r24 int toPrint = int(remainder); 3ab2e: 0f 94 70 de call 0x3bce0 ; 0x3bce0 <__fixsfsi> print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 3ab32: 6b 01 movw r12, r22 3ab34: 77 0f add r23, r23 3ab36: ee 08 sbc r14, r14 3ab38: ff 08 sbc r15, r15 3ab3a: c7 01 movw r24, r14 3ab3c: b6 01 movw r22, r12 3ab3e: 0f 94 26 d5 call 0x3aa4c ; 0x3aa4c while (digits-- > 0) { remainder *= 10.0; int toPrint = int(remainder); print(toPrint); remainder -= toPrint; 3ab42: c7 01 movw r24, r14 3ab44: b6 01 movw r22, r12 3ab46: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 3ab4a: 9b 01 movw r18, r22 3ab4c: ac 01 movw r20, r24 3ab4e: c5 01 movw r24, r10 3ab50: b4 01 movw r22, r8 3ab52: 0f 94 fe dc call 0x3b9fc ; 0x3b9fc <__subsf3> 3ab56: 6b 01 movw r12, r22 3ab58: 7c 01 movw r14, r24 3ab5a: dd cf rjmp .-70 ; 0x3ab16 } } 3ab5c: cf 91 pop r28 3ab5e: ff 90 pop r15 3ab60: ef 90 pop r14 3ab62: df 90 pop r13 3ab64: cf 90 pop r12 3ab66: bf 90 pop r11 3ab68: af 90 pop r10 3ab6a: 9f 90 pop r9 3ab6c: 8f 90 pop r8 3ab6e: 08 95 ret 0003ab70 : } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3ab70: 8a e0 ldi r24, 0x0A ; 10 3ab72: 0c 94 4f 77 jmp 0xee9e ; 0xee9e 0003ab76 : 3ab76: 0e 94 2c 88 call 0x11058 ; 0x11058 }*/ void MarlinSerial::println(const char c[]) { print(c); println(); 3ab7a: 0d 94 b8 d5 jmp 0x3ab70 ; 0x3ab70 0003ab7e : } 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) { 3ab7e: 20 91 9a 04 lds r18, 0x049A ; 0x80049a 3ab82: 30 91 9b 04 lds r19, 0x049B ; 0x80049b 3ab86: 80 91 98 04 lds r24, 0x0498 ; 0x800498 3ab8a: 90 91 99 04 lds r25, 0x0499 ; 0x800499 3ab8e: 82 17 cp r24, r18 3ab90: 93 07 cpc r25, r19 3ab92: 71 f0 breq .+28 ; 0x3abb0 return -1; } else { unsigned char c = rx_buffer.buffer[rx_buffer.tail]; 3ab94: f9 01 movw r30, r18 3ab96: e8 5e subi r30, 0xE8 ; 232 3ab98: fb 4f sbci r31, 0xFB ; 251 3ab9a: 80 81 ld r24, Z rx_buffer.tail = (unsigned int)(rx_buffer.tail + 1) % RX_BUFFER_SIZE; 3ab9c: 2f 5f subi r18, 0xFF ; 255 3ab9e: 3f 4f sbci r19, 0xFF ; 255 3aba0: 2f 77 andi r18, 0x7F ; 127 3aba2: 33 27 eor r19, r19 3aba4: 30 93 9b 04 sts 0x049B, r19 ; 0x80049b 3aba8: 20 93 9a 04 sts 0x049A, r18 ; 0x80049a return c; 3abac: 90 e0 ldi r25, 0x00 ; 0 3abae: 08 95 ret 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) { return -1; 3abb0: 8f ef ldi r24, 0xFF ; 255 3abb2: 9f ef ldi r25, 0xFF ; 255 } else { unsigned char c = rx_buffer.buffer[rx_buffer.tail]; rx_buffer.tail = (unsigned int)(rx_buffer.tail + 1) % RX_BUFFER_SIZE; return c; } } 3abb4: 08 95 ret 0003abb6 <__vector_36>: #endif //DEBUG_DUMP_TO_2ND_SERIAL } } ISR(USART1_RX_vect) { 3abb6: 1f 92 push r1 3abb8: 0f 92 push r0 3abba: 0f b6 in r0, 0x3f ; 63 3abbc: 0f 92 push r0 3abbe: 11 24 eor r1, r1 3abc0: 0b b6 in r0, 0x3b ; 59 3abc2: 0f 92 push r0 3abc4: 2f 93 push r18 3abc6: 3f 93 push r19 3abc8: 4f 93 push r20 3abca: 6f 93 push r22 3abcc: 7f 93 push r23 3abce: 8f 93 push r24 3abd0: 9f 93 push r25 3abd2: ef 93 push r30 3abd4: ff 93 push r31 // Test for a framing error. if (UCSR1A & (1< 3abda: 84 ff sbrs r24, 4 3abdc: 12 c0 rjmp .+36 ; 0x3ac02 <__vector_36+0x4c> { // Characters received with the framing errors will be ignored. // Dummy register read (discard) (void)(*(char *)UDR1); 3abde: 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 } } 3abe2: ff 91 pop r31 3abe4: ef 91 pop r30 3abe6: 9f 91 pop r25 3abe8: 8f 91 pop r24 3abea: 7f 91 pop r23 3abec: 6f 91 pop r22 3abee: 4f 91 pop r20 3abf0: 3f 91 pop r19 3abf2: 2f 91 pop r18 3abf4: 0f 90 pop r0 3abf6: 0b be out 0x3b, r0 ; 59 3abf8: 0f 90 pop r0 3abfa: 0f be out 0x3f, r0 ; 63 3abfc: 0f 90 pop r0 3abfe: 1f 90 pop r1 3ac00: 18 95 reti (void)(*(char *)UDR1); } else { // Read the input register. unsigned char c = UDR1; 3ac02: 40 91 ce 00 lds r20, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> if (selectedSerialPort == 1) 3ac06: 80 91 38 05 lds r24, 0x0538 ; 0x800538 3ac0a: 81 30 cpi r24, 0x01 ; 1 3ac0c: 51 f7 brne .-44 ; 0x3abe2 <__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; 3ac0e: 20 91 98 04 lds r18, 0x0498 ; 0x800498 3ac12: 30 91 99 04 lds r19, 0x0499 ; 0x800499 3ac16: c9 01 movw r24, r18 3ac18: 01 96 adiw r24, 0x01 ; 1 3ac1a: 8f 77 andi r24, 0x7F ; 127 3ac1c: 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) { 3ac1e: 60 91 9a 04 lds r22, 0x049A ; 0x80049a 3ac22: 70 91 9b 04 lds r23, 0x049B ; 0x80049b 3ac26: 86 17 cp r24, r22 3ac28: 97 07 cpc r25, r23 3ac2a: d9 f2 breq .-74 ; 0x3abe2 <__vector_36+0x2c> rx_buffer.buffer[rx_buffer.head] = c; 3ac2c: 28 5e subi r18, 0xE8 ; 232 3ac2e: 3b 4f sbci r19, 0xFB ; 251 3ac30: f9 01 movw r30, r18 3ac32: 40 83 st Z, r20 rx_buffer.head = i; 3ac34: 90 93 99 04 sts 0x0499, r25 ; 0x800499 3ac38: 80 93 98 04 sts 0x0498, r24 ; 0x800498 3ac3c: d2 cf rjmp .-92 ; 0x3abe2 <__vector_36+0x2c> 0003ac3e <__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) { 3ac3e: 1f 92 push r1 3ac40: 0f 92 push r0 3ac42: 0f b6 in r0, 0x3f ; 63 3ac44: 0f 92 push r0 3ac46: 11 24 eor r1, r1 3ac48: 0b b6 in r0, 0x3b ; 59 3ac4a: 0f 92 push r0 3ac4c: 2f 93 push r18 3ac4e: 3f 93 push r19 3ac50: 4f 93 push r20 3ac52: 6f 93 push r22 3ac54: 7f 93 push r23 3ac56: 8f 93 push r24 3ac58: 9f 93 push r25 3ac5a: ef 93 push r30 3ac5c: ff 93 push r31 // Test for a framing error. if (M_UCSRxA & (1< 3ac62: 84 ff sbrs r24, 4 3ac64: 12 c0 rjmp .+36 ; 0x3ac8a <__vector_25+0x4c> { // Characters received with the framing errors will be ignored. // Dummy register read (discard) (void)(*(char *)M_UDRx); 3ac66: 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 } } 3ac6a: ff 91 pop r31 3ac6c: ef 91 pop r30 3ac6e: 9f 91 pop r25 3ac70: 8f 91 pop r24 3ac72: 7f 91 pop r23 3ac74: 6f 91 pop r22 3ac76: 4f 91 pop r20 3ac78: 3f 91 pop r19 3ac7a: 2f 91 pop r18 3ac7c: 0f 90 pop r0 3ac7e: 0b be out 0x3b, r0 ; 59 3ac80: 0f 90 pop r0 3ac82: 0f be out 0x3f, r0 ; 63 3ac84: 0f 90 pop r0 3ac86: 1f 90 pop r1 3ac88: 18 95 reti (void)(*(char *)M_UDRx); } else { // Read the input register. unsigned char c = M_UDRx; 3ac8a: 40 91 c6 00 lds r20, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> if (selectedSerialPort == 0) 3ac8e: 80 91 38 05 lds r24, 0x0538 ; 0x800538 3ac92: 81 11 cpse r24, r1 3ac94: ea cf rjmp .-44 ; 0x3ac6a <__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; 3ac96: 20 91 98 04 lds r18, 0x0498 ; 0x800498 3ac9a: 30 91 99 04 lds r19, 0x0499 ; 0x800499 3ac9e: c9 01 movw r24, r18 3aca0: 01 96 adiw r24, 0x01 ; 1 3aca2: 8f 77 andi r24, 0x7F ; 127 3aca4: 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) { 3aca6: 60 91 9a 04 lds r22, 0x049A ; 0x80049a 3acaa: 70 91 9b 04 lds r23, 0x049B ; 0x80049b 3acae: 86 17 cp r24, r22 3acb0: 97 07 cpc r25, r23 3acb2: d9 f2 breq .-74 ; 0x3ac6a <__vector_25+0x2c> rx_buffer.buffer[rx_buffer.head] = c; 3acb4: 28 5e subi r18, 0xE8 ; 232 3acb6: 3b 4f sbci r19, 0xFB ; 251 3acb8: f9 01 movw r30, r18 3acba: 40 83 st Z, r20 rx_buffer.head = i; 3acbc: 90 93 99 04 sts 0x0499, r25 ; 0x800499 3acc0: 80 93 98 04 sts 0x0498, r24 ; 0x800498 3acc4: d2 cf rjmp .-92 ; 0x3ac6a <__vector_25+0x2c> 0003acc6 <__floatunsisf>: 3acc6: e8 94 clt 3acc8: 09 c0 rjmp .+18 ; 0x3acdc <__floatsisf+0x12> 0003acca <__floatsisf>: 3acca: 97 fb bst r25, 7 3accc: 3e f4 brtc .+14 ; 0x3acdc <__floatsisf+0x12> 3acce: 90 95 com r25 3acd0: 80 95 com r24 3acd2: 70 95 com r23 3acd4: 61 95 neg r22 3acd6: 7f 4f sbci r23, 0xFF ; 255 3acd8: 8f 4f sbci r24, 0xFF ; 255 3acda: 9f 4f sbci r25, 0xFF ; 255 3acdc: 99 23 and r25, r25 3acde: a9 f0 breq .+42 ; 0x3ad0a <__floatsisf+0x40> 3ace0: f9 2f mov r31, r25 3ace2: 96 e9 ldi r25, 0x96 ; 150 3ace4: bb 27 eor r27, r27 3ace6: 93 95 inc r25 3ace8: f6 95 lsr r31 3acea: 87 95 ror r24 3acec: 77 95 ror r23 3acee: 67 95 ror r22 3acf0: b7 95 ror r27 3acf2: f1 11 cpse r31, r1 3acf4: f8 cf rjmp .-16 ; 0x3ace6 <__floatsisf+0x1c> 3acf6: fa f4 brpl .+62 ; 0x3ad36 <__floatsisf+0x6c> 3acf8: bb 0f add r27, r27 3acfa: 11 f4 brne .+4 ; 0x3ad00 <__floatsisf+0x36> 3acfc: 60 ff sbrs r22, 0 3acfe: 1b c0 rjmp .+54 ; 0x3ad36 <__floatsisf+0x6c> 3ad00: 6f 5f subi r22, 0xFF ; 255 3ad02: 7f 4f sbci r23, 0xFF ; 255 3ad04: 8f 4f sbci r24, 0xFF ; 255 3ad06: 9f 4f sbci r25, 0xFF ; 255 3ad08: 16 c0 rjmp .+44 ; 0x3ad36 <__floatsisf+0x6c> 3ad0a: 88 23 and r24, r24 3ad0c: 11 f0 breq .+4 ; 0x3ad12 <__floatsisf+0x48> 3ad0e: 96 e9 ldi r25, 0x96 ; 150 3ad10: 11 c0 rjmp .+34 ; 0x3ad34 <__floatsisf+0x6a> 3ad12: 77 23 and r23, r23 3ad14: 21 f0 breq .+8 ; 0x3ad1e <__floatsisf+0x54> 3ad16: 9e e8 ldi r25, 0x8E ; 142 3ad18: 87 2f mov r24, r23 3ad1a: 76 2f mov r23, r22 3ad1c: 05 c0 rjmp .+10 ; 0x3ad28 <__floatsisf+0x5e> 3ad1e: 66 23 and r22, r22 3ad20: 71 f0 breq .+28 ; 0x3ad3e <__floatsisf+0x74> 3ad22: 96 e8 ldi r25, 0x86 ; 134 3ad24: 86 2f mov r24, r22 3ad26: 70 e0 ldi r23, 0x00 ; 0 3ad28: 60 e0 ldi r22, 0x00 ; 0 3ad2a: 2a f0 brmi .+10 ; 0x3ad36 <__floatsisf+0x6c> 3ad2c: 9a 95 dec r25 3ad2e: 66 0f add r22, r22 3ad30: 77 1f adc r23, r23 3ad32: 88 1f adc r24, r24 3ad34: da f7 brpl .-10 ; 0x3ad2c <__floatsisf+0x62> 3ad36: 88 0f add r24, r24 3ad38: 96 95 lsr r25 3ad3a: 87 95 ror r24 3ad3c: 97 f9 bld r25, 7 3ad3e: 08 95 ret 0003ad40 : 3ad40: 9b 01 movw r18, r22 3ad42: ac 01 movw r20, r24 3ad44: 0d 94 a4 d6 jmp 0x3ad48 ; 0x3ad48 <__mulsf3> 0003ad48 <__mulsf3>: 3ad48: 0f 94 b7 d6 call 0x3ad6e ; 0x3ad6e <__mulsf3x> 3ad4c: 0d 94 28 d7 jmp 0x3ae50 ; 0x3ae50 <__fp_round> 3ad50: 0f 94 1a d7 call 0x3ae34 ; 0x3ae34 <__fp_pscA> 3ad54: 38 f0 brcs .+14 ; 0x3ad64 <__mulsf3+0x1c> 3ad56: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__fp_pscB> 3ad5a: 20 f0 brcs .+8 ; 0x3ad64 <__mulsf3+0x1c> 3ad5c: 95 23 and r25, r21 3ad5e: 11 f0 breq .+4 ; 0x3ad64 <__mulsf3+0x1c> 3ad60: 0d 94 11 d7 jmp 0x3ae22 ; 0x3ae22 <__fp_inf> 3ad64: 0d 94 17 d7 jmp 0x3ae2e ; 0x3ae2e <__fp_nan> 3ad68: 11 24 eor r1, r1 3ad6a: 0d 94 5c d7 jmp 0x3aeb8 ; 0x3aeb8 <__fp_szero> 0003ad6e <__mulsf3x>: 3ad6e: 0f 94 39 d7 call 0x3ae72 ; 0x3ae72 <__fp_split3> 3ad72: 70 f3 brcs .-36 ; 0x3ad50 <__mulsf3+0x8> 0003ad74 <__mulsf3_pse>: 3ad74: 95 9f mul r25, r21 3ad76: c1 f3 breq .-16 ; 0x3ad68 <__mulsf3+0x20> 3ad78: 95 0f add r25, r21 3ad7a: 50 e0 ldi r21, 0x00 ; 0 3ad7c: 55 1f adc r21, r21 3ad7e: 62 9f mul r22, r18 3ad80: f0 01 movw r30, r0 3ad82: 72 9f mul r23, r18 3ad84: bb 27 eor r27, r27 3ad86: f0 0d add r31, r0 3ad88: b1 1d adc r27, r1 3ad8a: 63 9f mul r22, r19 3ad8c: aa 27 eor r26, r26 3ad8e: f0 0d add r31, r0 3ad90: b1 1d adc r27, r1 3ad92: aa 1f adc r26, r26 3ad94: 64 9f mul r22, r20 3ad96: 66 27 eor r22, r22 3ad98: b0 0d add r27, r0 3ad9a: a1 1d adc r26, r1 3ad9c: 66 1f adc r22, r22 3ad9e: 82 9f mul r24, r18 3ada0: 22 27 eor r18, r18 3ada2: b0 0d add r27, r0 3ada4: a1 1d adc r26, r1 3ada6: 62 1f adc r22, r18 3ada8: 73 9f mul r23, r19 3adaa: b0 0d add r27, r0 3adac: a1 1d adc r26, r1 3adae: 62 1f adc r22, r18 3adb0: 83 9f mul r24, r19 3adb2: a0 0d add r26, r0 3adb4: 61 1d adc r22, r1 3adb6: 22 1f adc r18, r18 3adb8: 74 9f mul r23, r20 3adba: 33 27 eor r19, r19 3adbc: a0 0d add r26, r0 3adbe: 61 1d adc r22, r1 3adc0: 23 1f adc r18, r19 3adc2: 84 9f mul r24, r20 3adc4: 60 0d add r22, r0 3adc6: 21 1d adc r18, r1 3adc8: 82 2f mov r24, r18 3adca: 76 2f mov r23, r22 3adcc: 6a 2f mov r22, r26 3adce: 11 24 eor r1, r1 3add0: 9f 57 subi r25, 0x7F ; 127 3add2: 50 40 sbci r21, 0x00 ; 0 3add4: 9a f0 brmi .+38 ; 0x3adfc <__mulsf3_pse+0x88> 3add6: f1 f0 breq .+60 ; 0x3ae14 <__mulsf3_pse+0xa0> 3add8: 88 23 and r24, r24 3adda: 4a f0 brmi .+18 ; 0x3adee <__mulsf3_pse+0x7a> 3addc: ee 0f add r30, r30 3adde: ff 1f adc r31, r31 3ade0: bb 1f adc r27, r27 3ade2: 66 1f adc r22, r22 3ade4: 77 1f adc r23, r23 3ade6: 88 1f adc r24, r24 3ade8: 91 50 subi r25, 0x01 ; 1 3adea: 50 40 sbci r21, 0x00 ; 0 3adec: a9 f7 brne .-22 ; 0x3add8 <__mulsf3_pse+0x64> 3adee: 9e 3f cpi r25, 0xFE ; 254 3adf0: 51 05 cpc r21, r1 3adf2: 80 f0 brcs .+32 ; 0x3ae14 <__mulsf3_pse+0xa0> 3adf4: 0d 94 11 d7 jmp 0x3ae22 ; 0x3ae22 <__fp_inf> 3adf8: 0d 94 5c d7 jmp 0x3aeb8 ; 0x3aeb8 <__fp_szero> 3adfc: 5f 3f cpi r21, 0xFF ; 255 3adfe: e4 f3 brlt .-8 ; 0x3adf8 <__mulsf3_pse+0x84> 3ae00: 98 3e cpi r25, 0xE8 ; 232 3ae02: d4 f3 brlt .-12 ; 0x3adf8 <__mulsf3_pse+0x84> 3ae04: 86 95 lsr r24 3ae06: 77 95 ror r23 3ae08: 67 95 ror r22 3ae0a: b7 95 ror r27 3ae0c: f7 95 ror r31 3ae0e: e7 95 ror r30 3ae10: 9f 5f subi r25, 0xFF ; 255 3ae12: c1 f7 brne .-16 ; 0x3ae04 <__mulsf3_pse+0x90> 3ae14: fe 2b or r31, r30 3ae16: 88 0f add r24, r24 3ae18: 91 1d adc r25, r1 3ae1a: 96 95 lsr r25 3ae1c: 87 95 ror r24 3ae1e: 97 f9 bld r25, 7 3ae20: 08 95 ret 0003ae22 <__fp_inf>: 3ae22: 97 f9 bld r25, 7 3ae24: 9f 67 ori r25, 0x7F ; 127 3ae26: 80 e8 ldi r24, 0x80 ; 128 3ae28: 70 e0 ldi r23, 0x00 ; 0 3ae2a: 60 e0 ldi r22, 0x00 ; 0 3ae2c: 08 95 ret 0003ae2e <__fp_nan>: 3ae2e: 9f ef ldi r25, 0xFF ; 255 3ae30: 80 ec ldi r24, 0xC0 ; 192 3ae32: 08 95 ret 0003ae34 <__fp_pscA>: 3ae34: 00 24 eor r0, r0 3ae36: 0a 94 dec r0 3ae38: 16 16 cp r1, r22 3ae3a: 17 06 cpc r1, r23 3ae3c: 18 06 cpc r1, r24 3ae3e: 09 06 cpc r0, r25 3ae40: 08 95 ret 0003ae42 <__fp_pscB>: 3ae42: 00 24 eor r0, r0 3ae44: 0a 94 dec r0 3ae46: 12 16 cp r1, r18 3ae48: 13 06 cpc r1, r19 3ae4a: 14 06 cpc r1, r20 3ae4c: 05 06 cpc r0, r21 3ae4e: 08 95 ret 0003ae50 <__fp_round>: 3ae50: 09 2e mov r0, r25 3ae52: 03 94 inc r0 3ae54: 00 0c add r0, r0 3ae56: 11 f4 brne .+4 ; 0x3ae5c <__fp_round+0xc> 3ae58: 88 23 and r24, r24 3ae5a: 52 f0 brmi .+20 ; 0x3ae70 <__fp_round+0x20> 3ae5c: bb 0f add r27, r27 3ae5e: 40 f4 brcc .+16 ; 0x3ae70 <__fp_round+0x20> 3ae60: bf 2b or r27, r31 3ae62: 11 f4 brne .+4 ; 0x3ae68 <__fp_round+0x18> 3ae64: 60 ff sbrs r22, 0 3ae66: 04 c0 rjmp .+8 ; 0x3ae70 <__fp_round+0x20> 3ae68: 6f 5f subi r22, 0xFF ; 255 3ae6a: 7f 4f sbci r23, 0xFF ; 255 3ae6c: 8f 4f sbci r24, 0xFF ; 255 3ae6e: 9f 4f sbci r25, 0xFF ; 255 3ae70: 08 95 ret 0003ae72 <__fp_split3>: 3ae72: 57 fd sbrc r21, 7 3ae74: 90 58 subi r25, 0x80 ; 128 3ae76: 44 0f add r20, r20 3ae78: 55 1f adc r21, r21 3ae7a: 59 f0 breq .+22 ; 0x3ae92 <__fp_splitA+0x10> 3ae7c: 5f 3f cpi r21, 0xFF ; 255 3ae7e: 71 f0 breq .+28 ; 0x3ae9c <__fp_splitA+0x1a> 3ae80: 47 95 ror r20 0003ae82 <__fp_splitA>: 3ae82: 88 0f add r24, r24 3ae84: 97 fb bst r25, 7 3ae86: 99 1f adc r25, r25 3ae88: 61 f0 breq .+24 ; 0x3aea2 <__fp_splitA+0x20> 3ae8a: 9f 3f cpi r25, 0xFF ; 255 3ae8c: 79 f0 breq .+30 ; 0x3aeac <__fp_splitA+0x2a> 3ae8e: 87 95 ror r24 3ae90: 08 95 ret 3ae92: 12 16 cp r1, r18 3ae94: 13 06 cpc r1, r19 3ae96: 14 06 cpc r1, r20 3ae98: 55 1f adc r21, r21 3ae9a: f2 cf rjmp .-28 ; 0x3ae80 <__fp_split3+0xe> 3ae9c: 46 95 lsr r20 3ae9e: f1 df rcall .-30 ; 0x3ae82 <__fp_splitA> 3aea0: 08 c0 rjmp .+16 ; 0x3aeb2 <__fp_splitA+0x30> 3aea2: 16 16 cp r1, r22 3aea4: 17 06 cpc r1, r23 3aea6: 18 06 cpc r1, r24 3aea8: 99 1f adc r25, r25 3aeaa: f1 cf rjmp .-30 ; 0x3ae8e <__fp_splitA+0xc> 3aeac: 86 95 lsr r24 3aeae: 71 05 cpc r23, r1 3aeb0: 61 05 cpc r22, r1 3aeb2: 08 94 sec 3aeb4: 08 95 ret 0003aeb6 <__fp_zero>: 3aeb6: e8 94 clt 0003aeb8 <__fp_szero>: 3aeb8: bb 27 eor r27, r27 3aeba: 66 27 eor r22, r22 3aebc: 77 27 eor r23, r23 3aebe: cb 01 movw r24, r22 3aec0: 97 f9 bld r25, 7 3aec2: 08 95 ret 0003aec4 : 3aec4: 3f 92 push r3 3aec6: 4f 92 push r4 3aec8: 5f 92 push r5 3aeca: 6f 92 push r6 3aecc: 7f 92 push r7 3aece: 8f 92 push r8 3aed0: 9f 92 push r9 3aed2: af 92 push r10 3aed4: bf 92 push r11 3aed6: cf 92 push r12 3aed8: df 92 push r13 3aeda: ef 92 push r14 3aedc: ff 92 push r15 3aede: 0f 93 push r16 3aee0: 1f 93 push r17 3aee2: cf 93 push r28 3aee4: df 93 push r29 3aee6: 5c 01 movw r10, r24 3aee8: 6b 01 movw r12, r22 3aeea: 7a 01 movw r14, r20 3aeec: 61 15 cp r22, r1 3aeee: 71 05 cpc r23, r1 3aef0: 19 f0 breq .+6 ; 0x3aef8 3aef2: fb 01 movw r30, r22 3aef4: 91 83 std Z+1, r25 ; 0x01 3aef6: 80 83 st Z, r24 3aef8: e1 14 cp r14, r1 3aefa: f1 04 cpc r15, r1 3aefc: 51 f0 breq .+20 ; 0x3af12 3aefe: c7 01 movw r24, r14 3af00: 02 97 sbiw r24, 0x02 ; 2 3af02: 83 97 sbiw r24, 0x23 ; 35 3af04: 30 f0 brcs .+12 ; 0x3af12 3af06: 40 e0 ldi r20, 0x00 ; 0 3af08: 30 e0 ldi r19, 0x00 ; 0 3af0a: 20 e0 ldi r18, 0x00 ; 0 3af0c: 90 e0 ldi r25, 0x00 ; 0 3af0e: 6b c0 rjmp .+214 ; 0x3afe6 3af10: 5e 01 movw r10, r28 3af12: e5 01 movw r28, r10 3af14: 21 96 adiw r28, 0x01 ; 1 3af16: f5 01 movw r30, r10 3af18: 10 81 ld r17, Z 3af1a: 81 2f mov r24, r17 3af1c: 90 e0 ldi r25, 0x00 ; 0 3af1e: 0f 94 68 d9 call 0x3b2d0 ; 0x3b2d0 3af22: 89 2b or r24, r25 3af24: a9 f7 brne .-22 ; 0x3af10 3af26: 1d 32 cpi r17, 0x2D ; 45 3af28: 01 f5 brne .+64 ; 0x3af6a 3af2a: 21 96 adiw r28, 0x01 ; 1 3af2c: f5 01 movw r30, r10 3af2e: 11 81 ldd r17, Z+1 ; 0x01 3af30: 01 e0 ldi r16, 0x01 ; 1 3af32: e1 14 cp r14, r1 3af34: f1 04 cpc r15, r1 3af36: 09 f4 brne .+2 ; 0x3af3a 3af38: e6 c0 rjmp .+460 ; 0x3b106 3af3a: f0 e1 ldi r31, 0x10 ; 16 3af3c: ef 16 cp r14, r31 3af3e: f1 04 cpc r15, r1 3af40: 09 f0 breq .+2 ; 0x3af44 3af42: 88 c0 rjmp .+272 ; 0x3b054 3af44: 10 33 cpi r17, 0x30 ; 48 3af46: 59 f4 brne .+22 ; 0x3af5e 3af48: 88 81 ld r24, Y 3af4a: 8f 7d andi r24, 0xDF ; 223 3af4c: 88 35 cpi r24, 0x58 ; 88 3af4e: 09 f0 breq .+2 ; 0x3af52 3af50: 7c c0 rjmp .+248 ; 0x3b04a 3af52: 19 81 ldd r17, Y+1 ; 0x01 3af54: 22 96 adiw r28, 0x02 ; 2 3af56: 02 60 ori r16, 0x02 ; 2 3af58: f0 e1 ldi r31, 0x10 ; 16 3af5a: ef 2e mov r14, r31 3af5c: f1 2c mov r15, r1 3af5e: 81 2c mov r8, r1 3af60: 91 2c mov r9, r1 3af62: a1 2c mov r10, r1 3af64: 88 e0 ldi r24, 0x08 ; 8 3af66: b8 2e mov r11, r24 3af68: 92 c0 rjmp .+292 ; 0x3b08e 3af6a: 1b 32 cpi r17, 0x2B ; 43 3af6c: 21 f4 brne .+8 ; 0x3af76 3af6e: e5 01 movw r28, r10 3af70: 22 96 adiw r28, 0x02 ; 2 3af72: f5 01 movw r30, r10 3af74: 11 81 ldd r17, Z+1 ; 0x01 3af76: 00 e0 ldi r16, 0x00 ; 0 3af78: dc cf rjmp .-72 ; 0x3af32 3af7a: ea e0 ldi r30, 0x0A ; 10 3af7c: ee 16 cp r14, r30 3af7e: f1 04 cpc r15, r1 3af80: 09 f4 brne .+2 ; 0x3af84 3af82: c7 c0 rjmp .+398 ; 0x3b112 3af84: f0 e1 ldi r31, 0x10 ; 16 3af86: ef 16 cp r14, r31 3af88: f1 04 cpc r15, r1 3af8a: 09 f0 breq .+2 ; 0x3af8e 3af8c: 73 c0 rjmp .+230 ; 0x3b074 3af8e: e7 cf rjmp .-50 ; 0x3af5e 3af90: 78 e0 ldi r23, 0x08 ; 8 3af92: e7 2e mov r14, r23 3af94: f1 2c mov r15, r1 3af96: 81 2c mov r8, r1 3af98: 91 2c mov r9, r1 3af9a: a1 2c mov r10, r1 3af9c: 60 e1 ldi r22, 0x10 ; 16 3af9e: b6 2e mov r11, r22 3afa0: 76 c0 rjmp .+236 ; 0x3b08e 3afa2: 21 e0 ldi r18, 0x01 ; 1 3afa4: ad c0 rjmp .+346 ; 0x3b100 3afa6: 30 2f mov r19, r16 3afa8: 31 70 andi r19, 0x01 ; 1 3afaa: c1 14 cp r12, r1 3afac: d1 04 cpc r13, r1 3afae: 31 f0 breq .+12 ; 0x3afbc 3afb0: 22 23 and r18, r18 3afb2: 71 f1 breq .+92 ; 0x3b010 3afb4: 21 97 sbiw r28, 0x01 ; 1 3afb6: f6 01 movw r30, r12 3afb8: d1 83 std Z+1, r29 ; 0x01 3afba: c0 83 st Z, r28 3afbc: 27 ff sbrs r18, 7 3afbe: 2e c0 rjmp .+92 ; 0x3b01c 3afc0: 60 e0 ldi r22, 0x00 ; 0 3afc2: 70 e0 ldi r23, 0x00 ; 0 3afc4: 80 e0 ldi r24, 0x00 ; 0 3afc6: 90 e8 ldi r25, 0x80 ; 128 3afc8: 31 11 cpse r19, r1 3afca: 04 c0 rjmp .+8 ; 0x3afd4 3afcc: 6f ef ldi r22, 0xFF ; 255 3afce: 7f ef ldi r23, 0xFF ; 255 3afd0: 8f ef ldi r24, 0xFF ; 255 3afd2: 9f e7 ldi r25, 0x7F ; 127 3afd4: 22 e2 ldi r18, 0x22 ; 34 3afd6: 30 e0 ldi r19, 0x00 ; 0 3afd8: 30 93 14 18 sts 0x1814, r19 ; 0x801814 3afdc: 20 93 13 18 sts 0x1813, r18 ; 0x801813 3afe0: 46 2f mov r20, r22 3afe2: 37 2f mov r19, r23 3afe4: 28 2f mov r18, r24 3afe6: 64 2f mov r22, r20 3afe8: 73 2f mov r23, r19 3afea: 82 2f mov r24, r18 3afec: df 91 pop r29 3afee: cf 91 pop r28 3aff0: 1f 91 pop r17 3aff2: 0f 91 pop r16 3aff4: ff 90 pop r15 3aff6: ef 90 pop r14 3aff8: df 90 pop r13 3affa: cf 90 pop r12 3affc: bf 90 pop r11 3affe: af 90 pop r10 3b000: 9f 90 pop r9 3b002: 8f 90 pop r8 3b004: 7f 90 pop r7 3b006: 6f 90 pop r6 3b008: 5f 90 pop r5 3b00a: 4f 90 pop r4 3b00c: 3f 90 pop r3 3b00e: 08 95 ret 3b010: 01 ff sbrs r16, 1 3b012: 04 c0 rjmp .+8 ; 0x3b01c 3b014: 22 97 sbiw r28, 0x02 ; 2 3b016: f6 01 movw r30, r12 3b018: d1 83 std Z+1, r29 ; 0x01 3b01a: c0 83 st Z, r28 3b01c: 33 23 and r19, r19 3b01e: 41 f0 breq .+16 ; 0x3b030 3b020: 90 95 com r25 3b022: 80 95 com r24 3b024: 70 95 com r23 3b026: 61 95 neg r22 3b028: 7f 4f sbci r23, 0xFF ; 255 3b02a: 8f 4f sbci r24, 0xFF ; 255 3b02c: 9f 4f sbci r25, 0xFF ; 255 3b02e: d8 cf rjmp .-80 ; 0x3afe0 3b030: 97 ff sbrs r25, 7 3b032: d6 cf rjmp .-84 ; 0x3afe0 3b034: 82 e2 ldi r24, 0x22 ; 34 3b036: 90 e0 ldi r25, 0x00 ; 0 3b038: 90 93 14 18 sts 0x1814, r25 ; 0x801814 3b03c: 80 93 13 18 sts 0x1813, r24 ; 0x801813 3b040: 6f ef ldi r22, 0xFF ; 255 3b042: 7f ef ldi r23, 0xFF ; 255 3b044: 8f ef ldi r24, 0xFF ; 255 3b046: 9f e7 ldi r25, 0x7F ; 127 3b048: cb cf rjmp .-106 ; 0x3afe0 3b04a: 10 e3 ldi r17, 0x30 ; 48 3b04c: e1 14 cp r14, r1 3b04e: f1 04 cpc r15, r1 3b050: 09 f4 brne .+2 ; 0x3b054 3b052: 9e cf rjmp .-196 ; 0x3af90 3b054: 28 e0 ldi r18, 0x08 ; 8 3b056: e2 16 cp r14, r18 3b058: f1 04 cpc r15, r1 3b05a: 09 f4 brne .+2 ; 0x3b05e 3b05c: 9c cf rjmp .-200 ; 0x3af96 3b05e: 0c f0 brlt .+2 ; 0x3b062 3b060: 8c cf rjmp .-232 ; 0x3af7a 3b062: 81 2c mov r8, r1 3b064: 91 2c mov r9, r1 3b066: a1 2c mov r10, r1 3b068: e0 e4 ldi r30, 0x40 ; 64 3b06a: be 2e mov r11, r30 3b06c: 82 e0 ldi r24, 0x02 ; 2 3b06e: e8 16 cp r14, r24 3b070: f1 04 cpc r15, r1 3b072: 69 f0 breq .+26 ; 0x3b08e 3b074: 60 e0 ldi r22, 0x00 ; 0 3b076: 70 e0 ldi r23, 0x00 ; 0 3b078: 80 e0 ldi r24, 0x00 ; 0 3b07a: 90 e8 ldi r25, 0x80 ; 128 3b07c: 97 01 movw r18, r14 3b07e: 0f 2c mov r0, r15 3b080: 00 0c add r0, r0 3b082: 44 0b sbc r20, r20 3b084: 55 0b sbc r21, r21 3b086: 0f 94 4a dc call 0x3b894 ; 0x3b894 <__udivmodsi4> 3b08a: 49 01 movw r8, r18 3b08c: 5a 01 movw r10, r20 3b08e: 20 e0 ldi r18, 0x00 ; 0 3b090: 60 e0 ldi r22, 0x00 ; 0 3b092: 70 e0 ldi r23, 0x00 ; 0 3b094: cb 01 movw r24, r22 3b096: 27 01 movw r4, r14 3b098: 0f 2c mov r0, r15 3b09a: 00 0c add r0, r0 3b09c: 66 08 sbc r6, r6 3b09e: 77 08 sbc r7, r7 3b0a0: fe 01 movw r30, r28 3b0a2: 50 ed ldi r21, 0xD0 ; 208 3b0a4: 35 2e mov r3, r21 3b0a6: 31 0e add r3, r17 3b0a8: 39 e0 ldi r19, 0x09 ; 9 3b0aa: 33 15 cp r19, r3 3b0ac: 70 f4 brcc .+28 ; 0x3b0ca 3b0ae: 3f eb ldi r19, 0xBF ; 191 3b0b0: 31 0f add r19, r17 3b0b2: 49 ec ldi r20, 0xC9 ; 201 3b0b4: 34 2e mov r3, r20 3b0b6: 3a 31 cpi r19, 0x1A ; 26 3b0b8: 38 f0 brcs .+14 ; 0x3b0c8 3b0ba: 3f e9 ldi r19, 0x9F ; 159 3b0bc: 31 0f add r19, r17 3b0be: 3a 31 cpi r19, 0x1A ; 26 3b0c0: 08 f0 brcs .+2 ; 0x3b0c4 3b0c2: 71 cf rjmp .-286 ; 0x3afa6 3b0c4: 39 ea ldi r19, 0xA9 ; 169 3b0c6: 33 2e mov r3, r19 3b0c8: 31 0e add r3, r17 3b0ca: 3e 14 cp r3, r14 3b0cc: 1f 04 cpc r1, r15 3b0ce: 0c f0 brlt .+2 ; 0x3b0d2 3b0d0: 6a cf rjmp .-300 ; 0x3afa6 3b0d2: 27 fd sbrc r18, 7 3b0d4: 15 c0 rjmp .+42 ; 0x3b100 3b0d6: 86 16 cp r8, r22 3b0d8: 97 06 cpc r9, r23 3b0da: a8 06 cpc r10, r24 3b0dc: b9 06 cpc r11, r25 3b0de: 78 f0 brcs .+30 ; 0x3b0fe 3b0e0: a3 01 movw r20, r6 3b0e2: 92 01 movw r18, r4 3b0e4: 0f 94 3a dc call 0x3b874 ; 0x3b874 <__mulsi3> 3b0e8: 63 0d add r22, r3 3b0ea: 71 1d adc r23, r1 3b0ec: 81 1d adc r24, r1 3b0ee: 91 1d adc r25, r1 3b0f0: 61 30 cpi r22, 0x01 ; 1 3b0f2: 71 05 cpc r23, r1 3b0f4: 81 05 cpc r24, r1 3b0f6: 20 e8 ldi r18, 0x80 ; 128 3b0f8: 92 07 cpc r25, r18 3b0fa: 08 f4 brcc .+2 ; 0x3b0fe 3b0fc: 52 cf rjmp .-348 ; 0x3afa2 3b0fe: 2f ef ldi r18, 0xFF ; 255 3b100: 21 96 adiw r28, 0x01 ; 1 3b102: 10 81 ld r17, Z 3b104: cd cf rjmp .-102 ; 0x3b0a0 3b106: 10 33 cpi r17, 0x30 ; 48 3b108: 09 f4 brne .+2 ; 0x3b10c 3b10a: 1e cf rjmp .-452 ; 0x3af48 3b10c: 2a e0 ldi r18, 0x0A ; 10 3b10e: e2 2e mov r14, r18 3b110: f1 2c mov r15, r1 3b112: 9c ec ldi r25, 0xCC ; 204 3b114: 89 2e mov r8, r25 3b116: 98 2c mov r9, r8 3b118: a8 2c mov r10, r8 3b11a: 9c e0 ldi r25, 0x0C ; 12 3b11c: b9 2e mov r11, r25 3b11e: b7 cf rjmp .-146 ; 0x3b08e 0003b120 <__ftoa_engine>: 3b120: 28 30 cpi r18, 0x08 ; 8 3b122: 08 f0 brcs .+2 ; 0x3b126 <__ftoa_engine+0x6> 3b124: 27 e0 ldi r18, 0x07 ; 7 3b126: 33 27 eor r19, r19 3b128: da 01 movw r26, r20 3b12a: 99 0f add r25, r25 3b12c: 31 1d adc r19, r1 3b12e: 87 fd sbrc r24, 7 3b130: 91 60 ori r25, 0x01 ; 1 3b132: 00 96 adiw r24, 0x00 ; 0 3b134: 61 05 cpc r22, r1 3b136: 71 05 cpc r23, r1 3b138: 39 f4 brne .+14 ; 0x3b148 <__ftoa_engine+0x28> 3b13a: 32 60 ori r19, 0x02 ; 2 3b13c: 2e 5f subi r18, 0xFE ; 254 3b13e: 3d 93 st X+, r19 3b140: 30 e3 ldi r19, 0x30 ; 48 3b142: 2a 95 dec r18 3b144: e1 f7 brne .-8 ; 0x3b13e <__ftoa_engine+0x1e> 3b146: 08 95 ret 3b148: 9f 3f cpi r25, 0xFF ; 255 3b14a: 30 f0 brcs .+12 ; 0x3b158 <__ftoa_engine+0x38> 3b14c: 80 38 cpi r24, 0x80 ; 128 3b14e: 71 05 cpc r23, r1 3b150: 61 05 cpc r22, r1 3b152: 09 f0 breq .+2 ; 0x3b156 <__ftoa_engine+0x36> 3b154: 3c 5f subi r19, 0xFC ; 252 3b156: 3c 5f subi r19, 0xFC ; 252 3b158: 3d 93 st X+, r19 3b15a: 91 30 cpi r25, 0x01 ; 1 3b15c: 08 f0 brcs .+2 ; 0x3b160 <__ftoa_engine+0x40> 3b15e: 80 68 ori r24, 0x80 ; 128 3b160: 91 1d adc r25, r1 3b162: df 93 push r29 3b164: cf 93 push r28 3b166: 1f 93 push r17 3b168: 0f 93 push r16 3b16a: ff 92 push r15 3b16c: ef 92 push r14 3b16e: 19 2f mov r17, r25 3b170: 98 7f andi r25, 0xF8 ; 248 3b172: 96 95 lsr r25 3b174: e9 2f mov r30, r25 3b176: 96 95 lsr r25 3b178: 96 95 lsr r25 3b17a: e9 0f add r30, r25 3b17c: ff 27 eor r31, r31 3b17e: e2 51 subi r30, 0x12 ; 18 3b180: f9 48 sbci r31, 0x89 ; 137 3b182: 99 27 eor r25, r25 3b184: 33 27 eor r19, r19 3b186: ee 24 eor r14, r14 3b188: ff 24 eor r15, r15 3b18a: a7 01 movw r20, r14 3b18c: e7 01 movw r28, r14 3b18e: 05 90 lpm r0, Z+ 3b190: 08 94 sec 3b192: 07 94 ror r0 3b194: 28 f4 brcc .+10 ; 0x3b1a0 <__ftoa_engine+0x80> 3b196: 36 0f add r19, r22 3b198: e7 1e adc r14, r23 3b19a: f8 1e adc r15, r24 3b19c: 49 1f adc r20, r25 3b19e: 51 1d adc r21, r1 3b1a0: 66 0f add r22, r22 3b1a2: 77 1f adc r23, r23 3b1a4: 88 1f adc r24, r24 3b1a6: 99 1f adc r25, r25 3b1a8: 06 94 lsr r0 3b1aa: a1 f7 brne .-24 ; 0x3b194 <__ftoa_engine+0x74> 3b1ac: 05 90 lpm r0, Z+ 3b1ae: 07 94 ror r0 3b1b0: 28 f4 brcc .+10 ; 0x3b1bc <__ftoa_engine+0x9c> 3b1b2: e7 0e add r14, r23 3b1b4: f8 1e adc r15, r24 3b1b6: 49 1f adc r20, r25 3b1b8: 56 1f adc r21, r22 3b1ba: c1 1d adc r28, r1 3b1bc: 77 0f add r23, r23 3b1be: 88 1f adc r24, r24 3b1c0: 99 1f adc r25, r25 3b1c2: 66 1f adc r22, r22 3b1c4: 06 94 lsr r0 3b1c6: a1 f7 brne .-24 ; 0x3b1b0 <__ftoa_engine+0x90> 3b1c8: 05 90 lpm r0, Z+ 3b1ca: 07 94 ror r0 3b1cc: 28 f4 brcc .+10 ; 0x3b1d8 <__ftoa_engine+0xb8> 3b1ce: f8 0e add r15, r24 3b1d0: 49 1f adc r20, r25 3b1d2: 56 1f adc r21, r22 3b1d4: c7 1f adc r28, r23 3b1d6: d1 1d adc r29, r1 3b1d8: 88 0f add r24, r24 3b1da: 99 1f adc r25, r25 3b1dc: 66 1f adc r22, r22 3b1de: 77 1f adc r23, r23 3b1e0: 06 94 lsr r0 3b1e2: a1 f7 brne .-24 ; 0x3b1cc <__ftoa_engine+0xac> 3b1e4: 05 90 lpm r0, Z+ 3b1e6: 07 94 ror r0 3b1e8: 20 f4 brcc .+8 ; 0x3b1f2 <__ftoa_engine+0xd2> 3b1ea: 49 0f add r20, r25 3b1ec: 56 1f adc r21, r22 3b1ee: c7 1f adc r28, r23 3b1f0: d8 1f adc r29, r24 3b1f2: 99 0f add r25, r25 3b1f4: 66 1f adc r22, r22 3b1f6: 77 1f adc r23, r23 3b1f8: 88 1f adc r24, r24 3b1fa: 06 94 lsr r0 3b1fc: a9 f7 brne .-22 ; 0x3b1e8 <__ftoa_engine+0xc8> 3b1fe: 84 91 lpm r24, Z 3b200: 10 95 com r17 3b202: 17 70 andi r17, 0x07 ; 7 3b204: 41 f0 breq .+16 ; 0x3b216 <__ftoa_engine+0xf6> 3b206: d6 95 lsr r29 3b208: c7 95 ror r28 3b20a: 57 95 ror r21 3b20c: 47 95 ror r20 3b20e: f7 94 ror r15 3b210: e7 94 ror r14 3b212: 1a 95 dec r17 3b214: c1 f7 brne .-16 ; 0x3b206 <__ftoa_engine+0xe6> 3b216: e4 e9 ldi r30, 0x94 ; 148 3b218: f6 e7 ldi r31, 0x76 ; 118 3b21a: 68 94 set 3b21c: 15 90 lpm r1, Z+ 3b21e: 15 91 lpm r17, Z+ 3b220: 35 91 lpm r19, Z+ 3b222: 65 91 lpm r22, Z+ 3b224: 95 91 lpm r25, Z+ 3b226: 05 90 lpm r0, Z+ 3b228: 7f e2 ldi r23, 0x2F ; 47 3b22a: 73 95 inc r23 3b22c: e1 18 sub r14, r1 3b22e: f1 0a sbc r15, r17 3b230: 43 0b sbc r20, r19 3b232: 56 0b sbc r21, r22 3b234: c9 0b sbc r28, r25 3b236: d0 09 sbc r29, r0 3b238: c0 f7 brcc .-16 ; 0x3b22a <__ftoa_engine+0x10a> 3b23a: e1 0c add r14, r1 3b23c: f1 1e adc r15, r17 3b23e: 43 1f adc r20, r19 3b240: 56 1f adc r21, r22 3b242: c9 1f adc r28, r25 3b244: d0 1d adc r29, r0 3b246: 7e f4 brtc .+30 ; 0x3b266 <__ftoa_engine+0x146> 3b248: 70 33 cpi r23, 0x30 ; 48 3b24a: 11 f4 brne .+4 ; 0x3b250 <__ftoa_engine+0x130> 3b24c: 8a 95 dec r24 3b24e: e6 cf rjmp .-52 ; 0x3b21c <__ftoa_engine+0xfc> 3b250: e8 94 clt 3b252: 01 50 subi r16, 0x01 ; 1 3b254: 30 f0 brcs .+12 ; 0x3b262 <__ftoa_engine+0x142> 3b256: 08 0f add r16, r24 3b258: 0a f4 brpl .+2 ; 0x3b25c <__ftoa_engine+0x13c> 3b25a: 00 27 eor r16, r16 3b25c: 02 17 cp r16, r18 3b25e: 08 f4 brcc .+2 ; 0x3b262 <__ftoa_engine+0x142> 3b260: 20 2f mov r18, r16 3b262: 23 95 inc r18 3b264: 02 2f mov r16, r18 3b266: 7a 33 cpi r23, 0x3A ; 58 3b268: 28 f0 brcs .+10 ; 0x3b274 <__ftoa_engine+0x154> 3b26a: 79 e3 ldi r23, 0x39 ; 57 3b26c: 7d 93 st X+, r23 3b26e: 2a 95 dec r18 3b270: e9 f7 brne .-6 ; 0x3b26c <__ftoa_engine+0x14c> 3b272: 10 c0 rjmp .+32 ; 0x3b294 <__ftoa_engine+0x174> 3b274: 7d 93 st X+, r23 3b276: 2a 95 dec r18 3b278: 89 f6 brne .-94 ; 0x3b21c <__ftoa_engine+0xfc> 3b27a: 06 94 lsr r0 3b27c: 97 95 ror r25 3b27e: 67 95 ror r22 3b280: 37 95 ror r19 3b282: 17 95 ror r17 3b284: 17 94 ror r1 3b286: e1 18 sub r14, r1 3b288: f1 0a sbc r15, r17 3b28a: 43 0b sbc r20, r19 3b28c: 56 0b sbc r21, r22 3b28e: c9 0b sbc r28, r25 3b290: d0 09 sbc r29, r0 3b292: 98 f0 brcs .+38 ; 0x3b2ba <__ftoa_engine+0x19a> 3b294: 23 95 inc r18 3b296: 7e 91 ld r23, -X 3b298: 73 95 inc r23 3b29a: 7a 33 cpi r23, 0x3A ; 58 3b29c: 08 f0 brcs .+2 ; 0x3b2a0 <__ftoa_engine+0x180> 3b29e: 70 e3 ldi r23, 0x30 ; 48 3b2a0: 7c 93 st X, r23 3b2a2: 20 13 cpse r18, r16 3b2a4: b8 f7 brcc .-18 ; 0x3b294 <__ftoa_engine+0x174> 3b2a6: 7e 91 ld r23, -X 3b2a8: 70 61 ori r23, 0x10 ; 16 3b2aa: 7d 93 st X+, r23 3b2ac: 30 f0 brcs .+12 ; 0x3b2ba <__ftoa_engine+0x19a> 3b2ae: 83 95 inc r24 3b2b0: 71 e3 ldi r23, 0x31 ; 49 3b2b2: 7d 93 st X+, r23 3b2b4: 70 e3 ldi r23, 0x30 ; 48 3b2b6: 2a 95 dec r18 3b2b8: e1 f7 brne .-8 ; 0x3b2b2 <__ftoa_engine+0x192> 3b2ba: 11 24 eor r1, r1 3b2bc: ef 90 pop r14 3b2be: ff 90 pop r15 3b2c0: 0f 91 pop r16 3b2c2: 1f 91 pop r17 3b2c4: cf 91 pop r28 3b2c6: df 91 pop r29 3b2c8: 99 27 eor r25, r25 3b2ca: 87 fd sbrc r24, 7 3b2cc: 90 95 com r25 3b2ce: 08 95 ret 0003b2d0 : 3b2d0: 91 11 cpse r25, r1 3b2d2: 0d 94 c4 db jmp 0x3b788 ; 0x3b788 <__ctype_isfalse> 3b2d6: 80 32 cpi r24, 0x20 ; 32 3b2d8: 19 f0 breq .+6 ; 0x3b2e0 3b2da: 89 50 subi r24, 0x09 ; 9 3b2dc: 85 50 subi r24, 0x05 ; 5 3b2de: c8 f7 brcc .-14 ; 0x3b2d2 3b2e0: 08 95 ret 0003b2e2 : 3b2e2: fb 01 movw r30, r22 3b2e4: dc 01 movw r26, r24 3b2e6: 02 c0 rjmp .+4 ; 0x3b2ec 3b2e8: 05 90 lpm r0, Z+ 3b2ea: 0d 92 st X+, r0 3b2ec: 41 50 subi r20, 0x01 ; 1 3b2ee: 50 40 sbci r21, 0x00 ; 0 3b2f0: d8 f7 brcc .-10 ; 0x3b2e8 3b2f2: 08 95 ret 0003b2f4 : 3b2f4: fb 01 movw r30, r22 3b2f6: dc 01 movw r26, r24 3b2f8: 0d 90 ld r0, X+ 3b2fa: 00 20 and r0, r0 3b2fc: e9 f7 brne .-6 ; 0x3b2f8 3b2fe: 11 97 sbiw r26, 0x01 ; 1 3b300: 05 90 lpm r0, Z+ 3b302: 0d 92 st X+, r0 3b304: 00 20 and r0, r0 3b306: e1 f7 brne .-8 ; 0x3b300 3b308: 08 95 ret 0003b30a : 3b30a: fb 01 movw r30, r22 3b30c: dc 01 movw r26, r24 3b30e: 8d 91 ld r24, X+ 3b310: 05 90 lpm r0, Z+ 3b312: 80 19 sub r24, r0 3b314: 01 10 cpse r0, r1 3b316: d9 f3 breq .-10 ; 0x3b30e 3b318: 99 0b sbc r25, r25 3b31a: 08 95 ret 0003b31c : 3b31c: fb 01 movw r30, r22 3b31e: dc 01 movw r26, r24 3b320: 05 90 lpm r0, Z+ 3b322: 0d 92 st X+, r0 3b324: 00 20 and r0, r0 3b326: e1 f7 brne .-8 ; 0x3b320 3b328: 08 95 ret 0003b32a <__strlen_P>: 3b32a: fc 01 movw r30, r24 3b32c: 05 90 lpm r0, Z+ 3b32e: 00 20 and r0, r0 3b330: e9 f7 brne .-6 ; 0x3b32c <__strlen_P+0x2> 3b332: 80 95 com r24 3b334: 90 95 com r25 3b336: 8e 0f add r24, r30 3b338: 9f 1f adc r25, r31 3b33a: 08 95 ret 0003b33c : 3b33c: fb 01 movw r30, r22 3b33e: dc 01 movw r26, r24 3b340: 41 50 subi r20, 0x01 ; 1 3b342: 50 40 sbci r21, 0x00 ; 0 3b344: 88 f0 brcs .+34 ; 0x3b368 3b346: 8d 91 ld r24, X+ 3b348: 81 34 cpi r24, 0x41 ; 65 3b34a: 1c f0 brlt .+6 ; 0x3b352 3b34c: 8b 35 cpi r24, 0x5B ; 91 3b34e: 0c f4 brge .+2 ; 0x3b352 3b350: 80 5e subi r24, 0xE0 ; 224 3b352: 65 91 lpm r22, Z+ 3b354: 61 34 cpi r22, 0x41 ; 65 3b356: 1c f0 brlt .+6 ; 0x3b35e 3b358: 6b 35 cpi r22, 0x5B ; 91 3b35a: 0c f4 brge .+2 ; 0x3b35e 3b35c: 60 5e subi r22, 0xE0 ; 224 3b35e: 86 1b sub r24, r22 3b360: 61 11 cpse r22, r1 3b362: 71 f3 breq .-36 ; 0x3b340 3b364: 99 0b sbc r25, r25 3b366: 08 95 ret 3b368: 88 1b sub r24, r24 3b36a: fc cf rjmp .-8 ; 0x3b364 0003b36c : 3b36c: fb 01 movw r30, r22 3b36e: dc 01 movw r26, r24 3b370: 41 50 subi r20, 0x01 ; 1 3b372: 50 40 sbci r21, 0x00 ; 0 3b374: 30 f0 brcs .+12 ; 0x3b382 3b376: 8d 91 ld r24, X+ 3b378: 05 90 lpm r0, Z+ 3b37a: 80 19 sub r24, r0 3b37c: 19 f4 brne .+6 ; 0x3b384 3b37e: 00 20 and r0, r0 3b380: b9 f7 brne .-18 ; 0x3b370 3b382: 88 1b sub r24, r24 3b384: 99 0b sbc r25, r25 3b386: 08 95 ret 0003b388 : 3b388: fb 01 movw r30, r22 3b38a: dc 01 movw r26, r24 3b38c: 41 50 subi r20, 0x01 ; 1 3b38e: 50 40 sbci r21, 0x00 ; 0 3b390: 48 f0 brcs .+18 ; 0x3b3a4 3b392: 05 90 lpm r0, Z+ 3b394: 0d 92 st X+, r0 3b396: 00 20 and r0, r0 3b398: c9 f7 brne .-14 ; 0x3b38c 3b39a: 01 c0 rjmp .+2 ; 0x3b39e 3b39c: 1d 92 st X+, r1 3b39e: 41 50 subi r20, 0x01 ; 1 3b3a0: 50 40 sbci r21, 0x00 ; 0 3b3a2: e0 f7 brcc .-8 ; 0x3b39c 3b3a4: 08 95 ret 0003b3a6 : 3b3a6: fc 01 movw r30, r24 3b3a8: 05 90 lpm r0, Z+ 3b3aa: 61 50 subi r22, 0x01 ; 1 3b3ac: 70 40 sbci r23, 0x00 ; 0 3b3ae: 01 10 cpse r0, r1 3b3b0: d8 f7 brcc .-10 ; 0x3b3a8 3b3b2: 80 95 com r24 3b3b4: 90 95 com r25 3b3b6: 8e 0f add r24, r30 3b3b8: 9f 1f adc r25, r31 3b3ba: 08 95 ret 0003b3bc : 3b3bc: fb 01 movw r30, r22 3b3be: 55 91 lpm r21, Z+ 3b3c0: 55 23 and r21, r21 3b3c2: a9 f0 breq .+42 ; 0x3b3ee 3b3c4: bf 01 movw r22, r30 3b3c6: dc 01 movw r26, r24 3b3c8: 4d 91 ld r20, X+ 3b3ca: 45 17 cp r20, r21 3b3cc: 41 11 cpse r20, r1 3b3ce: e1 f7 brne .-8 ; 0x3b3c8 3b3d0: 59 f4 brne .+22 ; 0x3b3e8 3b3d2: cd 01 movw r24, r26 3b3d4: 05 90 lpm r0, Z+ 3b3d6: 00 20 and r0, r0 3b3d8: 49 f0 breq .+18 ; 0x3b3ec 3b3da: 4d 91 ld r20, X+ 3b3dc: 40 15 cp r20, r0 3b3de: 41 11 cpse r20, r1 3b3e0: c9 f3 breq .-14 ; 0x3b3d4 3b3e2: fb 01 movw r30, r22 3b3e4: 41 11 cpse r20, r1 3b3e6: ef cf rjmp .-34 ; 0x3b3c6 3b3e8: 81 e0 ldi r24, 0x01 ; 1 3b3ea: 90 e0 ldi r25, 0x00 ; 0 3b3ec: 01 97 sbiw r24, 0x01 ; 1 3b3ee: 08 95 ret 0003b3f0 : 3b3f0: fc 01 movw r30, r24 3b3f2: 61 50 subi r22, 0x01 ; 1 3b3f4: 70 40 sbci r23, 0x00 ; 0 3b3f6: 01 90 ld r0, Z+ 3b3f8: 01 10 cpse r0, r1 3b3fa: d8 f7 brcc .-10 ; 0x3b3f2 3b3fc: 80 95 com r24 3b3fe: 90 95 com r25 3b400: 8e 0f add r24, r30 3b402: 9f 1f adc r25, r31 3b404: 08 95 ret 0003b406 : 3b406: cf 93 push r28 3b408: df 93 push r29 3b40a: ec 01 movw r28, r24 3b40c: 2b 81 ldd r18, Y+3 ; 0x03 3b40e: 20 ff sbrs r18, 0 3b410: 1a c0 rjmp .+52 ; 0x3b446 3b412: 26 ff sbrs r18, 6 3b414: 0c c0 rjmp .+24 ; 0x3b42e 3b416: 2f 7b andi r18, 0xBF ; 191 3b418: 2b 83 std Y+3, r18 ; 0x03 3b41a: 8e 81 ldd r24, Y+6 ; 0x06 3b41c: 9f 81 ldd r25, Y+7 ; 0x07 3b41e: 01 96 adiw r24, 0x01 ; 1 3b420: 9f 83 std Y+7, r25 ; 0x07 3b422: 8e 83 std Y+6, r24 ; 0x06 3b424: 8a 81 ldd r24, Y+2 ; 0x02 3b426: 90 e0 ldi r25, 0x00 ; 0 3b428: df 91 pop r29 3b42a: cf 91 pop r28 3b42c: 08 95 ret 3b42e: 22 ff sbrs r18, 2 3b430: 18 c0 rjmp .+48 ; 0x3b462 3b432: e8 81 ld r30, Y 3b434: f9 81 ldd r31, Y+1 ; 0x01 3b436: 80 81 ld r24, Z 3b438: 08 2e mov r0, r24 3b43a: 00 0c add r0, r0 3b43c: 99 0b sbc r25, r25 3b43e: 00 97 sbiw r24, 0x00 ; 0 3b440: 29 f4 brne .+10 ; 0x3b44c 3b442: 20 62 ori r18, 0x20 ; 32 3b444: 2b 83 std Y+3, r18 ; 0x03 3b446: 8f ef ldi r24, 0xFF ; 255 3b448: 9f ef ldi r25, 0xFF ; 255 3b44a: ee cf rjmp .-36 ; 0x3b428 3b44c: 31 96 adiw r30, 0x01 ; 1 3b44e: f9 83 std Y+1, r31 ; 0x01 3b450: e8 83 st Y, r30 3b452: 2e 81 ldd r18, Y+6 ; 0x06 3b454: 3f 81 ldd r19, Y+7 ; 0x07 3b456: 2f 5f subi r18, 0xFF ; 255 3b458: 3f 4f sbci r19, 0xFF ; 255 3b45a: 3f 83 std Y+7, r19 ; 0x07 3b45c: 2e 83 std Y+6, r18 ; 0x06 3b45e: 99 27 eor r25, r25 3b460: e3 cf rjmp .-58 ; 0x3b428 3b462: ea 85 ldd r30, Y+10 ; 0x0a 3b464: fb 85 ldd r31, Y+11 ; 0x0b 3b466: 19 95 eicall 3b468: 97 ff sbrs r25, 7 3b46a: f3 cf rjmp .-26 ; 0x3b452 3b46c: 2b 81 ldd r18, Y+3 ; 0x03 3b46e: 01 96 adiw r24, 0x01 ; 1 3b470: 21 f0 breq .+8 ; 0x3b47a 3b472: 80 e2 ldi r24, 0x20 ; 32 3b474: 82 2b or r24, r18 3b476: 8b 83 std Y+3, r24 ; 0x03 3b478: e6 cf rjmp .-52 ; 0x3b446 3b47a: 80 e1 ldi r24, 0x10 ; 16 3b47c: fb cf rjmp .-10 ; 0x3b474 0003b47e : 3b47e: 0f 93 push r16 3b480: 1f 93 push r17 3b482: cf 93 push r28 3b484: df 93 push r29 3b486: 18 2f mov r17, r24 3b488: 09 2f mov r16, r25 3b48a: eb 01 movw r28, r22 3b48c: 8b 81 ldd r24, Y+3 ; 0x03 3b48e: 81 fd sbrc r24, 1 3b490: 09 c0 rjmp .+18 ; 0x3b4a4 3b492: 1f ef ldi r17, 0xFF ; 255 3b494: 0f ef ldi r16, 0xFF ; 255 3b496: 81 2f mov r24, r17 3b498: 90 2f mov r25, r16 3b49a: df 91 pop r29 3b49c: cf 91 pop r28 3b49e: 1f 91 pop r17 3b4a0: 0f 91 pop r16 3b4a2: 08 95 ret 3b4a4: 82 ff sbrs r24, 2 3b4a6: 14 c0 rjmp .+40 ; 0x3b4d0 3b4a8: 2e 81 ldd r18, Y+6 ; 0x06 3b4aa: 3f 81 ldd r19, Y+7 ; 0x07 3b4ac: 8c 81 ldd r24, Y+4 ; 0x04 3b4ae: 9d 81 ldd r25, Y+5 ; 0x05 3b4b0: 28 17 cp r18, r24 3b4b2: 39 07 cpc r19, r25 3b4b4: 3c f4 brge .+14 ; 0x3b4c4 3b4b6: e8 81 ld r30, Y 3b4b8: f9 81 ldd r31, Y+1 ; 0x01 3b4ba: cf 01 movw r24, r30 3b4bc: 01 96 adiw r24, 0x01 ; 1 3b4be: 99 83 std Y+1, r25 ; 0x01 3b4c0: 88 83 st Y, r24 3b4c2: 10 83 st Z, r17 3b4c4: 8e 81 ldd r24, Y+6 ; 0x06 3b4c6: 9f 81 ldd r25, Y+7 ; 0x07 3b4c8: 01 96 adiw r24, 0x01 ; 1 3b4ca: 9f 83 std Y+7, r25 ; 0x07 3b4cc: 8e 83 std Y+6, r24 ; 0x06 3b4ce: e3 cf rjmp .-58 ; 0x3b496 3b4d0: e8 85 ldd r30, Y+8 ; 0x08 3b4d2: f9 85 ldd r31, Y+9 ; 0x09 3b4d4: 81 2f mov r24, r17 3b4d6: 19 95 eicall 3b4d8: 89 2b or r24, r25 3b4da: a1 f3 breq .-24 ; 0x3b4c4 3b4dc: da cf rjmp .-76 ; 0x3b492 0003b4de : 3b4de: ef 92 push r14 3b4e0: ff 92 push r15 3b4e2: 0f 93 push r16 3b4e4: 1f 93 push r17 3b4e6: cf 93 push r28 3b4e8: df 93 push r29 3b4ea: 8c 01 movw r16, r24 3b4ec: 7b 01 movw r14, r22 3b4ee: db 01 movw r26, r22 3b4f0: 13 96 adiw r26, 0x03 ; 3 3b4f2: 8c 91 ld r24, X 3b4f4: d0 e0 ldi r29, 0x00 ; 0 3b4f6: c0 e0 ldi r28, 0x00 ; 0 3b4f8: 81 fd sbrc r24, 1 3b4fa: 0f c0 rjmp .+30 ; 0x3b51a 3b4fc: cf ef ldi r28, 0xFF ; 255 3b4fe: df ef ldi r29, 0xFF ; 255 3b500: 10 c0 rjmp .+32 ; 0x3b522 3b502: d7 01 movw r26, r14 3b504: 18 96 adiw r26, 0x08 ; 8 3b506: ed 91 ld r30, X+ 3b508: fc 91 ld r31, X 3b50a: b7 01 movw r22, r14 3b50c: 19 95 eicall 3b50e: 89 2b or r24, r25 3b510: 11 f0 breq .+4 ; 0x3b516 3b512: cf ef ldi r28, 0xFF ; 255 3b514: df ef ldi r29, 0xFF ; 255 3b516: 0f 5f subi r16, 0xFF ; 255 3b518: 1f 4f sbci r17, 0xFF ; 255 3b51a: f8 01 movw r30, r16 3b51c: 84 91 lpm r24, Z 3b51e: 81 11 cpse r24, r1 3b520: f0 cf rjmp .-32 ; 0x3b502 3b522: ce 01 movw r24, r28 3b524: df 91 pop r29 3b526: cf 91 pop r28 3b528: 1f 91 pop r17 3b52a: 0f 91 pop r16 3b52c: ff 90 pop r15 3b52e: ef 90 pop r14 3b530: 08 95 ret 0003b532 : 3b532: 0f 93 push r16 3b534: 1f 93 push r17 3b536: cf 93 push r28 3b538: df 93 push r29 3b53a: cd b7 in r28, 0x3d ; 61 3b53c: de b7 in r29, 0x3e ; 62 3b53e: ae 01 movw r20, r28 3b540: 48 5f subi r20, 0xF8 ; 248 3b542: 5f 4f sbci r21, 0xFF ; 255 3b544: da 01 movw r26, r20 3b546: 6d 91 ld r22, X+ 3b548: 7d 91 ld r23, X+ 3b54a: ad 01 movw r20, r26 3b54c: 09 e1 ldi r16, 0x19 ; 25 3b54e: 18 e1 ldi r17, 0x18 ; 24 3b550: f8 01 movw r30, r16 3b552: 82 81 ldd r24, Z+2 ; 0x02 3b554: 93 81 ldd r25, Z+3 ; 0x03 3b556: dc 01 movw r26, r24 3b558: 13 96 adiw r26, 0x03 ; 3 3b55a: 2c 91 ld r18, X 3b55c: 13 97 sbiw r26, 0x03 ; 3 3b55e: 28 60 ori r18, 0x08 ; 8 3b560: 13 96 adiw r26, 0x03 ; 3 3b562: 2c 93 st X, r18 3b564: 0e 94 01 57 call 0xae02 ; 0xae02 3b568: d8 01 movw r26, r16 3b56a: 12 96 adiw r26, 0x02 ; 2 3b56c: ed 91 ld r30, X+ 3b56e: fc 91 ld r31, X 3b570: 23 81 ldd r18, Z+3 ; 0x03 3b572: 27 7f andi r18, 0xF7 ; 247 3b574: 23 83 std Z+3, r18 ; 0x03 3b576: df 91 pop r29 3b578: cf 91 pop r28 3b57a: 1f 91 pop r17 3b57c: 0f 91 pop r16 3b57e: 08 95 ret 0003b580 : 3b580: 0f 93 push r16 3b582: 1f 93 push r17 3b584: cf 93 push r28 3b586: df 93 push r29 3b588: 8c 01 movw r16, r24 3b58a: e0 91 1b 18 lds r30, 0x181B ; 0x80181b <__iob+0x2> 3b58e: f0 91 1c 18 lds r31, 0x181C ; 0x80181c <__iob+0x3> 3b592: 83 81 ldd r24, Z+3 ; 0x03 3b594: d0 e0 ldi r29, 0x00 ; 0 3b596: c0 e0 ldi r28, 0x00 ; 0 3b598: 81 fd sbrc r24, 1 3b59a: 0a c0 rjmp .+20 ; 0x3b5b0 3b59c: cf ef ldi r28, 0xFF ; 255 3b59e: df ef ldi r29, 0xFF ; 255 3b5a0: 17 c0 rjmp .+46 ; 0x3b5d0 3b5a2: 19 95 eicall 3b5a4: 89 2b or r24, r25 3b5a6: 11 f0 breq .+4 ; 0x3b5ac 3b5a8: cf ef ldi r28, 0xFF ; 255 3b5aa: df ef ldi r29, 0xFF ; 255 3b5ac: 0f 5f subi r16, 0xFF ; 255 3b5ae: 1f 4f sbci r17, 0xFF ; 255 3b5b0: f8 01 movw r30, r16 3b5b2: 84 91 lpm r24, Z 3b5b4: 60 91 1b 18 lds r22, 0x181B ; 0x80181b <__iob+0x2> 3b5b8: 70 91 1c 18 lds r23, 0x181C ; 0x80181c <__iob+0x3> 3b5bc: db 01 movw r26, r22 3b5be: 18 96 adiw r26, 0x08 ; 8 3b5c0: ed 91 ld r30, X+ 3b5c2: fc 91 ld r31, X 3b5c4: 81 11 cpse r24, r1 3b5c6: ed cf rjmp .-38 ; 0x3b5a2 3b5c8: 8a e0 ldi r24, 0x0A ; 10 3b5ca: 19 95 eicall 3b5cc: 89 2b or r24, r25 3b5ce: 31 f7 brne .-52 ; 0x3b59c 3b5d0: ce 01 movw r24, r28 3b5d2: df 91 pop r29 3b5d4: cf 91 pop r28 3b5d6: 1f 91 pop r17 3b5d8: 0f 91 pop r16 3b5da: 08 95 ret 0003b5dc : 3b5dc: 0f 93 push r16 3b5de: 1f 93 push r17 3b5e0: cf 93 push r28 3b5e2: df 93 push r29 3b5e4: cd b7 in r28, 0x3d ; 61 3b5e6: de b7 in r29, 0x3e ; 62 3b5e8: 2e 97 sbiw r28, 0x0e ; 14 3b5ea: 0f b6 in r0, 0x3f ; 63 3b5ec: f8 94 cli 3b5ee: de bf out 0x3e, r29 ; 62 3b5f0: 0f be out 0x3f, r0 ; 63 3b5f2: cd bf out 0x3d, r28 ; 61 3b5f4: 0e 89 ldd r16, Y+22 ; 0x16 3b5f6: 1f 89 ldd r17, Y+23 ; 0x17 3b5f8: 8e e0 ldi r24, 0x0E ; 14 3b5fa: 8c 83 std Y+4, r24 ; 0x04 3b5fc: 1a 83 std Y+2, r17 ; 0x02 3b5fe: 09 83 std Y+1, r16 ; 0x01 3b600: 8f ef ldi r24, 0xFF ; 255 3b602: 9f e7 ldi r25, 0x7F ; 127 3b604: 9e 83 std Y+6, r25 ; 0x06 3b606: 8d 83 std Y+5, r24 ; 0x05 3b608: ae 01 movw r20, r28 3b60a: 46 5e subi r20, 0xE6 ; 230 3b60c: 5f 4f sbci r21, 0xFF ; 255 3b60e: 68 8d ldd r22, Y+24 ; 0x18 3b610: 79 8d ldd r23, Y+25 ; 0x19 3b612: ce 01 movw r24, r28 3b614: 01 96 adiw r24, 0x01 ; 1 3b616: 0e 94 01 57 call 0xae02 ; 0xae02 3b61a: 2f 81 ldd r18, Y+7 ; 0x07 3b61c: 38 85 ldd r19, Y+8 ; 0x08 3b61e: 02 0f add r16, r18 3b620: 13 1f adc r17, r19 3b622: f8 01 movw r30, r16 3b624: 10 82 st Z, r1 3b626: 2e 96 adiw r28, 0x0e ; 14 3b628: 0f b6 in r0, 0x3f ; 63 3b62a: f8 94 cli 3b62c: de bf out 0x3e, r29 ; 62 3b62e: 0f be out 0x3f, r0 ; 63 3b630: cd bf out 0x3d, r28 ; 61 3b632: df 91 pop r29 3b634: cf 91 pop r28 3b636: 1f 91 pop r17 3b638: 0f 91 pop r16 3b63a: 08 95 ret 0003b63c : 3b63c: cf 93 push r28 3b63e: df 93 push r29 3b640: ec 01 movw r28, r24 3b642: 8b 81 ldd r24, Y+3 ; 0x03 3b644: 88 60 ori r24, 0x08 ; 8 3b646: 8b 83 std Y+3, r24 ; 0x03 3b648: ce 01 movw r24, r28 3b64a: 0e 94 01 57 call 0xae02 ; 0xae02 3b64e: 2b 81 ldd r18, Y+3 ; 0x03 3b650: 27 7f andi r18, 0xF7 ; 247 3b652: 2b 83 std Y+3, r18 ; 0x03 3b654: df 91 pop r29 3b656: cf 91 pop r28 3b658: 08 95 ret 0003b65a : 3b65a: 0f 93 push r16 3b65c: 1f 93 push r17 3b65e: cf 93 push r28 3b660: df 93 push r29 3b662: cd b7 in r28, 0x3d ; 61 3b664: de b7 in r29, 0x3e ; 62 3b666: 2e 97 sbiw r28, 0x0e ; 14 3b668: 0f b6 in r0, 0x3f ; 63 3b66a: f8 94 cli 3b66c: de bf out 0x3e, r29 ; 62 3b66e: 0f be out 0x3f, r0 ; 63 3b670: cd bf out 0x3d, r28 ; 61 3b672: 8c 01 movw r16, r24 3b674: fa 01 movw r30, r20 3b676: 8e e0 ldi r24, 0x0E ; 14 3b678: 8c 83 std Y+4, r24 ; 0x04 3b67a: 1a 83 std Y+2, r17 ; 0x02 3b67c: 09 83 std Y+1, r16 ; 0x01 3b67e: 77 ff sbrs r23, 7 3b680: 02 c0 rjmp .+4 ; 0x3b686 3b682: 60 e0 ldi r22, 0x00 ; 0 3b684: 70 e8 ldi r23, 0x80 ; 128 3b686: 61 50 subi r22, 0x01 ; 1 3b688: 71 09 sbc r23, r1 3b68a: 7e 83 std Y+6, r23 ; 0x06 3b68c: 6d 83 std Y+5, r22 ; 0x05 3b68e: a9 01 movw r20, r18 3b690: bf 01 movw r22, r30 3b692: ce 01 movw r24, r28 3b694: 01 96 adiw r24, 0x01 ; 1 3b696: 0e 94 01 57 call 0xae02 ; 0xae02 3b69a: 4d 81 ldd r20, Y+5 ; 0x05 3b69c: 5e 81 ldd r21, Y+6 ; 0x06 3b69e: 57 fd sbrc r21, 7 3b6a0: 0a c0 rjmp .+20 ; 0x3b6b6 3b6a2: 2f 81 ldd r18, Y+7 ; 0x07 3b6a4: 38 85 ldd r19, Y+8 ; 0x08 3b6a6: 42 17 cp r20, r18 3b6a8: 53 07 cpc r21, r19 3b6aa: 0c f4 brge .+2 ; 0x3b6ae 3b6ac: 9a 01 movw r18, r20 3b6ae: 02 0f add r16, r18 3b6b0: 13 1f adc r17, r19 3b6b2: f8 01 movw r30, r16 3b6b4: 10 82 st Z, r1 3b6b6: 2e 96 adiw r28, 0x0e ; 14 3b6b8: 0f b6 in r0, 0x3f ; 63 3b6ba: f8 94 cli 3b6bc: de bf out 0x3e, r29 ; 62 3b6be: 0f be out 0x3f, r0 ; 63 3b6c0: cd bf out 0x3d, r28 ; 61 3b6c2: df 91 pop r29 3b6c4: cf 91 pop r28 3b6c6: 1f 91 pop r17 3b6c8: 0f 91 pop r16 3b6ca: 08 95 ret 0003b6cc <__ultoa_invert>: 3b6cc: fa 01 movw r30, r20 3b6ce: aa 27 eor r26, r26 3b6d0: 28 30 cpi r18, 0x08 ; 8 3b6d2: 51 f1 breq .+84 ; 0x3b728 <__ultoa_invert+0x5c> 3b6d4: 20 31 cpi r18, 0x10 ; 16 3b6d6: 81 f1 breq .+96 ; 0x3b738 <__ultoa_invert+0x6c> 3b6d8: e8 94 clt 3b6da: 6f 93 push r22 3b6dc: 6e 7f andi r22, 0xFE ; 254 3b6de: 6e 5f subi r22, 0xFE ; 254 3b6e0: 7f 4f sbci r23, 0xFF ; 255 3b6e2: 8f 4f sbci r24, 0xFF ; 255 3b6e4: 9f 4f sbci r25, 0xFF ; 255 3b6e6: af 4f sbci r26, 0xFF ; 255 3b6e8: b1 e0 ldi r27, 0x01 ; 1 3b6ea: 3e d0 rcall .+124 ; 0x3b768 <__ultoa_invert+0x9c> 3b6ec: b4 e0 ldi r27, 0x04 ; 4 3b6ee: 3c d0 rcall .+120 ; 0x3b768 <__ultoa_invert+0x9c> 3b6f0: 67 0f add r22, r23 3b6f2: 78 1f adc r23, r24 3b6f4: 89 1f adc r24, r25 3b6f6: 9a 1f adc r25, r26 3b6f8: a1 1d adc r26, r1 3b6fa: 68 0f add r22, r24 3b6fc: 79 1f adc r23, r25 3b6fe: 8a 1f adc r24, r26 3b700: 91 1d adc r25, r1 3b702: a1 1d adc r26, r1 3b704: 6a 0f add r22, r26 3b706: 71 1d adc r23, r1 3b708: 81 1d adc r24, r1 3b70a: 91 1d adc r25, r1 3b70c: a1 1d adc r26, r1 3b70e: 20 d0 rcall .+64 ; 0x3b750 <__ultoa_invert+0x84> 3b710: 09 f4 brne .+2 ; 0x3b714 <__ultoa_invert+0x48> 3b712: 68 94 set 3b714: 3f 91 pop r19 3b716: 2a e0 ldi r18, 0x0A ; 10 3b718: 26 9f mul r18, r22 3b71a: 11 24 eor r1, r1 3b71c: 30 19 sub r19, r0 3b71e: 30 5d subi r19, 0xD0 ; 208 3b720: 31 93 st Z+, r19 3b722: de f6 brtc .-74 ; 0x3b6da <__ultoa_invert+0xe> 3b724: cf 01 movw r24, r30 3b726: 08 95 ret 3b728: 46 2f mov r20, r22 3b72a: 47 70 andi r20, 0x07 ; 7 3b72c: 40 5d subi r20, 0xD0 ; 208 3b72e: 41 93 st Z+, r20 3b730: b3 e0 ldi r27, 0x03 ; 3 3b732: 0f d0 rcall .+30 ; 0x3b752 <__ultoa_invert+0x86> 3b734: c9 f7 brne .-14 ; 0x3b728 <__ultoa_invert+0x5c> 3b736: f6 cf rjmp .-20 ; 0x3b724 <__ultoa_invert+0x58> 3b738: 46 2f mov r20, r22 3b73a: 4f 70 andi r20, 0x0F ; 15 3b73c: 40 5d subi r20, 0xD0 ; 208 3b73e: 4a 33 cpi r20, 0x3A ; 58 3b740: 18 f0 brcs .+6 ; 0x3b748 <__ultoa_invert+0x7c> 3b742: 49 5d subi r20, 0xD9 ; 217 3b744: 31 fd sbrc r19, 1 3b746: 40 52 subi r20, 0x20 ; 32 3b748: 41 93 st Z+, r20 3b74a: 02 d0 rcall .+4 ; 0x3b750 <__ultoa_invert+0x84> 3b74c: a9 f7 brne .-22 ; 0x3b738 <__ultoa_invert+0x6c> 3b74e: ea cf rjmp .-44 ; 0x3b724 <__ultoa_invert+0x58> 3b750: b4 e0 ldi r27, 0x04 ; 4 3b752: a6 95 lsr r26 3b754: 97 95 ror r25 3b756: 87 95 ror r24 3b758: 77 95 ror r23 3b75a: 67 95 ror r22 3b75c: ba 95 dec r27 3b75e: c9 f7 brne .-14 ; 0x3b752 <__ultoa_invert+0x86> 3b760: 00 97 sbiw r24, 0x00 ; 0 3b762: 61 05 cpc r22, r1 3b764: 71 05 cpc r23, r1 3b766: 08 95 ret 3b768: 9b 01 movw r18, r22 3b76a: ac 01 movw r20, r24 3b76c: 0a 2e mov r0, r26 3b76e: 06 94 lsr r0 3b770: 57 95 ror r21 3b772: 47 95 ror r20 3b774: 37 95 ror r19 3b776: 27 95 ror r18 3b778: ba 95 dec r27 3b77a: c9 f7 brne .-14 ; 0x3b76e <__ultoa_invert+0xa2> 3b77c: 62 0f add r22, r18 3b77e: 73 1f adc r23, r19 3b780: 84 1f adc r24, r20 3b782: 95 1f adc r25, r21 3b784: a0 1d adc r26, r0 3b786: 08 95 ret 0003b788 <__ctype_isfalse>: 3b788: 99 27 eor r25, r25 3b78a: 88 27 eor r24, r24 0003b78c <__ctype_istrue>: 3b78c: 08 95 ret 0003b78e : 3b78e: dc 01 movw r26, r24 3b790: cb 01 movw r24, r22 0003b792 : 3b792: fc 01 movw r30, r24 3b794: f9 99 sbic 0x1f, 1 ; 31 3b796: fe cf rjmp .-4 ; 0x3b794 3b798: 06 c0 rjmp .+12 ; 0x3b7a6 3b79a: f2 bd out 0x22, r31 ; 34 3b79c: e1 bd out 0x21, r30 ; 33 3b79e: f8 9a sbi 0x1f, 0 ; 31 3b7a0: 31 96 adiw r30, 0x01 ; 1 3b7a2: 00 b4 in r0, 0x20 ; 32 3b7a4: 0d 92 st X+, r0 3b7a6: 41 50 subi r20, 0x01 ; 1 3b7a8: 50 40 sbci r21, 0x00 ; 0 3b7aa: b8 f7 brcc .-18 ; 0x3b79a 3b7ac: 08 95 ret 0003b7ae : 3b7ae: f9 99 sbic 0x1f, 1 ; 31 3b7b0: fe cf rjmp .-4 ; 0x3b7ae 3b7b2: 92 bd out 0x22, r25 ; 34 3b7b4: 81 bd out 0x21, r24 ; 33 3b7b6: f8 9a sbi 0x1f, 0 ; 31 3b7b8: 99 27 eor r25, r25 3b7ba: 80 b5 in r24, 0x20 ; 32 3b7bc: 08 95 ret 0003b7be : 3b7be: a6 e1 ldi r26, 0x16 ; 22 3b7c0: b0 e0 ldi r27, 0x00 ; 0 3b7c2: 44 e0 ldi r20, 0x04 ; 4 3b7c4: 50 e0 ldi r21, 0x00 ; 0 3b7c6: 0d 94 c9 db jmp 0x3b792 ; 0x3b792 0003b7ca : 3b7ca: a8 e1 ldi r26, 0x18 ; 24 3b7cc: b0 e0 ldi r27, 0x00 ; 0 3b7ce: 42 e0 ldi r20, 0x02 ; 2 3b7d0: 50 e0 ldi r21, 0x00 ; 0 3b7d2: 0d 94 c9 db jmp 0x3b792 ; 0x3b792 0003b7d6 : 3b7d6: dc 01 movw r26, r24 3b7d8: a4 0f add r26, r20 3b7da: b5 1f adc r27, r21 3b7dc: 41 50 subi r20, 0x01 ; 1 3b7de: 50 40 sbci r21, 0x00 ; 0 3b7e0: 48 f0 brcs .+18 ; 0x3b7f4 3b7e2: cb 01 movw r24, r22 3b7e4: 84 0f add r24, r20 3b7e6: 95 1f adc r25, r21 3b7e8: 2e 91 ld r18, -X 3b7ea: 0f 94 fc db call 0x3b7f8 ; 0x3b7f8 3b7ee: 41 50 subi r20, 0x01 ; 1 3b7f0: 50 40 sbci r21, 0x00 ; 0 3b7f2: d0 f7 brcc .-12 ; 0x3b7e8 3b7f4: 08 95 ret 0003b7f6 : 3b7f6: 26 2f mov r18, r22 0003b7f8 : 3b7f8: f9 99 sbic 0x1f, 1 ; 31 3b7fa: fe cf rjmp .-4 ; 0x3b7f8 3b7fc: 92 bd out 0x22, r25 ; 34 3b7fe: 81 bd out 0x21, r24 ; 33 3b800: f8 9a sbi 0x1f, 0 ; 31 3b802: 01 97 sbiw r24, 0x01 ; 1 3b804: 00 b4 in r0, 0x20 ; 32 3b806: 02 16 cp r0, r18 3b808: 39 f0 breq .+14 ; 0x3b818 3b80a: 1f ba out 0x1f, r1 ; 31 3b80c: 20 bd out 0x20, r18 ; 32 3b80e: 0f b6 in r0, 0x3f ; 63 3b810: f8 94 cli 3b812: fa 9a sbi 0x1f, 2 ; 31 3b814: f9 9a sbi 0x1f, 1 ; 31 3b816: 0f be out 0x3f, r0 ; 63 3b818: 08 95 ret 0003b81a : 3b81a: 03 96 adiw r24, 0x03 ; 3 3b81c: 27 2f mov r18, r23 3b81e: 0f 94 fc db call 0x3b7f8 ; 0x3b7f8 3b822: 0f 94 fb db call 0x3b7f6 ; 0x3b7f6 3b826: 25 2f mov r18, r21 3b828: 0f 94 fc db call 0x3b7f8 ; 0x3b7f8 3b82c: 24 2f mov r18, r20 3b82e: 0d 94 fc db jmp 0x3b7f8 ; 0x3b7f8 0003b832 : 3b832: 01 96 adiw r24, 0x01 ; 1 3b834: 27 2f mov r18, r23 3b836: 0f 94 fc db call 0x3b7f8 ; 0x3b7f8 3b83a: 0d 94 fb db jmp 0x3b7f6 ; 0x3b7f6 0003b83e : 3b83e: 26 2f mov r18, r22 0003b840 : 3b840: f9 99 sbic 0x1f, 1 ; 31 3b842: fe cf rjmp .-4 ; 0x3b840 3b844: 1f ba out 0x1f, r1 ; 31 3b846: 92 bd out 0x22, r25 ; 34 3b848: 81 bd out 0x21, r24 ; 33 3b84a: 20 bd out 0x20, r18 ; 32 3b84c: 0f b6 in r0, 0x3f ; 63 3b84e: f8 94 cli 3b850: fa 9a sbi 0x1f, 2 ; 31 3b852: f9 9a sbi 0x1f, 1 ; 31 3b854: 0f be out 0x3f, r0 ; 63 3b856: 01 96 adiw r24, 0x01 ; 1 3b858: 08 95 ret 0003b85a : 3b85a: 24 2f mov r18, r20 3b85c: 0f 94 20 dc call 0x3b840 ; 0x3b840 3b860: 25 2f mov r18, r21 3b862: 0f 94 20 dc call 0x3b840 ; 0x3b840 3b866: 0d 94 35 dc jmp 0x3b86a ; 0x3b86a 0003b86a : 3b86a: 0f 94 1f dc call 0x3b83e ; 0x3b83e 3b86e: 27 2f mov r18, r23 3b870: 0d 94 20 dc jmp 0x3b840 ; 0x3b840 0003b874 <__mulsi3>: 3b874: db 01 movw r26, r22 3b876: 8f 93 push r24 3b878: 9f 93 push r25 3b87a: 0f 94 6c dc call 0x3b8d8 ; 0x3b8d8 <__muluhisi3> 3b87e: bf 91 pop r27 3b880: af 91 pop r26 3b882: a2 9f mul r26, r18 3b884: 80 0d add r24, r0 3b886: 91 1d adc r25, r1 3b888: a3 9f mul r26, r19 3b88a: 90 0d add r25, r0 3b88c: b2 9f mul r27, r18 3b88e: 90 0d add r25, r0 3b890: 11 24 eor r1, r1 3b892: 08 95 ret 0003b894 <__udivmodsi4>: 3b894: a1 e2 ldi r26, 0x21 ; 33 3b896: 1a 2e mov r1, r26 3b898: aa 1b sub r26, r26 3b89a: bb 1b sub r27, r27 3b89c: fd 01 movw r30, r26 3b89e: 0d c0 rjmp .+26 ; 0x3b8ba <__udivmodsi4_ep> 0003b8a0 <__udivmodsi4_loop>: 3b8a0: aa 1f adc r26, r26 3b8a2: bb 1f adc r27, r27 3b8a4: ee 1f adc r30, r30 3b8a6: ff 1f adc r31, r31 3b8a8: a2 17 cp r26, r18 3b8aa: b3 07 cpc r27, r19 3b8ac: e4 07 cpc r30, r20 3b8ae: f5 07 cpc r31, r21 3b8b0: 20 f0 brcs .+8 ; 0x3b8ba <__udivmodsi4_ep> 3b8b2: a2 1b sub r26, r18 3b8b4: b3 0b sbc r27, r19 3b8b6: e4 0b sbc r30, r20 3b8b8: f5 0b sbc r31, r21 0003b8ba <__udivmodsi4_ep>: 3b8ba: 66 1f adc r22, r22 3b8bc: 77 1f adc r23, r23 3b8be: 88 1f adc r24, r24 3b8c0: 99 1f adc r25, r25 3b8c2: 1a 94 dec r1 3b8c4: 69 f7 brne .-38 ; 0x3b8a0 <__udivmodsi4_loop> 3b8c6: 60 95 com r22 3b8c8: 70 95 com r23 3b8ca: 80 95 com r24 3b8cc: 90 95 com r25 3b8ce: 9b 01 movw r18, r22 3b8d0: ac 01 movw r20, r24 3b8d2: bd 01 movw r22, r26 3b8d4: cf 01 movw r24, r30 3b8d6: 08 95 ret 0003b8d8 <__muluhisi3>: 3b8d8: 0f 94 77 dc call 0x3b8ee ; 0x3b8ee <__umulhisi3> 3b8dc: a5 9f mul r26, r21 3b8de: 90 0d add r25, r0 3b8e0: b4 9f mul r27, r20 3b8e2: 90 0d add r25, r0 3b8e4: a4 9f mul r26, r20 3b8e6: 80 0d add r24, r0 3b8e8: 91 1d adc r25, r1 3b8ea: 11 24 eor r1, r1 3b8ec: 08 95 ret 0003b8ee <__umulhisi3>: 3b8ee: a2 9f mul r26, r18 3b8f0: b0 01 movw r22, r0 3b8f2: b3 9f mul r27, r19 3b8f4: c0 01 movw r24, r0 3b8f6: a3 9f mul r26, r19 3b8f8: 70 0d add r23, r0 3b8fa: 81 1d adc r24, r1 3b8fc: 11 24 eor r1, r1 3b8fe: 91 1d adc r25, r1 3b900: b2 9f mul r27, r18 3b902: 70 0d add r23, r0 3b904: 81 1d adc r24, r1 3b906: 11 24 eor r1, r1 3b908: 91 1d adc r25, r1 3b90a: 08 95 ret 0003b90c <__udivmodqi4>: 3b90c: 99 1b sub r25, r25 3b90e: 79 e0 ldi r23, 0x09 ; 9 3b910: 04 c0 rjmp .+8 ; 0x3b91a <__udivmodqi4_ep> 0003b912 <__udivmodqi4_loop>: 3b912: 99 1f adc r25, r25 3b914: 96 17 cp r25, r22 3b916: 08 f0 brcs .+2 ; 0x3b91a <__udivmodqi4_ep> 3b918: 96 1b sub r25, r22 0003b91a <__udivmodqi4_ep>: 3b91a: 88 1f adc r24, r24 3b91c: 7a 95 dec r23 3b91e: c9 f7 brne .-14 ; 0x3b912 <__udivmodqi4_loop> 3b920: 80 95 com r24 3b922: 08 95 ret 0003b924 <__divmodqi4>: 3b924: 87 fb bst r24, 7 3b926: 08 2e mov r0, r24 3b928: 06 26 eor r0, r22 3b92a: 87 fd sbrc r24, 7 3b92c: 81 95 neg r24 3b92e: 67 fd sbrc r22, 7 3b930: 61 95 neg r22 3b932: 0f 94 86 dc call 0x3b90c ; 0x3b90c <__udivmodqi4> 3b936: 0e f4 brtc .+2 ; 0x3b93a <__divmodqi4_1> 3b938: 91 95 neg r25 0003b93a <__divmodqi4_1>: 3b93a: 07 fc sbrc r0, 7 3b93c: 81 95 neg r24 0003b93e <__divmodqi4_exit>: 3b93e: 08 95 ret 0003b940 <__udivmodhi4>: 3b940: aa 1b sub r26, r26 3b942: bb 1b sub r27, r27 3b944: 51 e1 ldi r21, 0x11 ; 17 3b946: 07 c0 rjmp .+14 ; 0x3b956 <__udivmodhi4_ep> 0003b948 <__udivmodhi4_loop>: 3b948: aa 1f adc r26, r26 3b94a: bb 1f adc r27, r27 3b94c: a6 17 cp r26, r22 3b94e: b7 07 cpc r27, r23 3b950: 10 f0 brcs .+4 ; 0x3b956 <__udivmodhi4_ep> 3b952: a6 1b sub r26, r22 3b954: b7 0b sbc r27, r23 0003b956 <__udivmodhi4_ep>: 3b956: 88 1f adc r24, r24 3b958: 99 1f adc r25, r25 3b95a: 5a 95 dec r21 3b95c: a9 f7 brne .-22 ; 0x3b948 <__udivmodhi4_loop> 3b95e: 80 95 com r24 3b960: 90 95 com r25 3b962: bc 01 movw r22, r24 3b964: cd 01 movw r24, r26 3b966: 08 95 ret 0003b968 <__divmodhi4>: 3b968: 97 fb bst r25, 7 3b96a: 07 2e mov r0, r23 3b96c: 16 f4 brtc .+4 ; 0x3b972 <__divmodhi4+0xa> 3b96e: 00 94 com r0 3b970: 07 d0 rcall .+14 ; 0x3b980 <__divmodhi4_neg1> 3b972: 77 fd sbrc r23, 7 3b974: 09 d0 rcall .+18 ; 0x3b988 <__divmodhi4_neg2> 3b976: 0f 94 a0 dc call 0x3b940 ; 0x3b940 <__udivmodhi4> 3b97a: 07 fc sbrc r0, 7 3b97c: 05 d0 rcall .+10 ; 0x3b988 <__divmodhi4_neg2> 3b97e: 3e f4 brtc .+14 ; 0x3b98e <__divmodhi4_exit> 0003b980 <__divmodhi4_neg1>: 3b980: 90 95 com r25 3b982: 81 95 neg r24 3b984: 9f 4f sbci r25, 0xFF ; 255 3b986: 08 95 ret 0003b988 <__divmodhi4_neg2>: 3b988: 70 95 com r23 3b98a: 61 95 neg r22 3b98c: 7f 4f sbci r23, 0xFF ; 255 0003b98e <__divmodhi4_exit>: 3b98e: 08 95 ret 0003b990 <__divmodsi4>: 3b990: 05 2e mov r0, r21 3b992: 97 fb bst r25, 7 3b994: 1e f4 brtc .+6 ; 0x3b99c <__divmodsi4+0xc> 3b996: 00 94 com r0 3b998: 0f 94 df dc call 0x3b9be ; 0x3b9be <__negsi2> 3b99c: 57 fd sbrc r21, 7 3b99e: 07 d0 rcall .+14 ; 0x3b9ae <__divmodsi4_neg2> 3b9a0: 0f 94 4a dc call 0x3b894 ; 0x3b894 <__udivmodsi4> 3b9a4: 07 fc sbrc r0, 7 3b9a6: 03 d0 rcall .+6 ; 0x3b9ae <__divmodsi4_neg2> 3b9a8: 4e f4 brtc .+18 ; 0x3b9bc <__divmodsi4_exit> 3b9aa: 0d 94 df dc jmp 0x3b9be ; 0x3b9be <__negsi2> 0003b9ae <__divmodsi4_neg2>: 3b9ae: 50 95 com r21 3b9b0: 40 95 com r20 3b9b2: 30 95 com r19 3b9b4: 21 95 neg r18 3b9b6: 3f 4f sbci r19, 0xFF ; 255 3b9b8: 4f 4f sbci r20, 0xFF ; 255 3b9ba: 5f 4f sbci r21, 0xFF ; 255 0003b9bc <__divmodsi4_exit>: 3b9bc: 08 95 ret 0003b9be <__negsi2>: 3b9be: 90 95 com r25 3b9c0: 80 95 com r24 3b9c2: 70 95 com r23 3b9c4: 61 95 neg r22 3b9c6: 7f 4f sbci r23, 0xFF ; 255 3b9c8: 8f 4f sbci r24, 0xFF ; 255 3b9ca: 9f 4f sbci r25, 0xFF ; 255 3b9cc: 08 95 ret 0003b9ce <__tablejump2__>: 3b9ce: ee 0f add r30, r30 3b9d0: ff 1f adc r31, r31 3b9d2: 88 1f adc r24, r24 3b9d4: 8b bf out 0x3b, r24 ; 59 3b9d6: 07 90 elpm r0, Z+ 3b9d8: f6 91 elpm r31, Z 3b9da: e0 2d mov r30, r0 3b9dc: 19 94 eijmp 0003b9de <__mulhisi3>: 3b9de: 0f 94 77 dc call 0x3b8ee ; 0x3b8ee <__umulhisi3> 3b9e2: 33 23 and r19, r19 3b9e4: 12 f4 brpl .+4 ; 0x3b9ea <__mulhisi3+0xc> 3b9e6: 8a 1b sub r24, r26 3b9e8: 9b 0b sbc r25, r27 3b9ea: 0d 94 f9 dc jmp 0x3b9f2 ; 0x3b9f2 <__usmulhisi3_tail> 0003b9ee <__usmulhisi3>: 3b9ee: 0f 94 77 dc call 0x3b8ee ; 0x3b8ee <__umulhisi3> 0003b9f2 <__usmulhisi3_tail>: 3b9f2: b7 ff sbrs r27, 7 3b9f4: 08 95 ret 3b9f6: 82 1b sub r24, r18 3b9f8: 93 0b sbc r25, r19 3b9fa: 08 95 ret 0003b9fc <__subsf3>: 3b9fc: 50 58 subi r21, 0x80 ; 128 0003b9fe <__addsf3>: 3b9fe: bb 27 eor r27, r27 3ba00: aa 27 eor r26, r26 3ba02: 0f 94 16 dd call 0x3ba2c ; 0x3ba2c <__addsf3x> 3ba06: 0d 94 28 d7 jmp 0x3ae50 ; 0x3ae50 <__fp_round> 3ba0a: 0f 94 1a d7 call 0x3ae34 ; 0x3ae34 <__fp_pscA> 3ba0e: 38 f0 brcs .+14 ; 0x3ba1e <__addsf3+0x20> 3ba10: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__fp_pscB> 3ba14: 20 f0 brcs .+8 ; 0x3ba1e <__addsf3+0x20> 3ba16: 39 f4 brne .+14 ; 0x3ba26 <__addsf3+0x28> 3ba18: 9f 3f cpi r25, 0xFF ; 255 3ba1a: 19 f4 brne .+6 ; 0x3ba22 <__addsf3+0x24> 3ba1c: 26 f4 brtc .+8 ; 0x3ba26 <__addsf3+0x28> 3ba1e: 0d 94 17 d7 jmp 0x3ae2e ; 0x3ae2e <__fp_nan> 3ba22: 0e f4 brtc .+2 ; 0x3ba26 <__addsf3+0x28> 3ba24: e0 95 com r30 3ba26: e7 fb bst r30, 7 3ba28: 0d 94 11 d7 jmp 0x3ae22 ; 0x3ae22 <__fp_inf> 0003ba2c <__addsf3x>: 3ba2c: e9 2f mov r30, r25 3ba2e: 0f 94 39 d7 call 0x3ae72 ; 0x3ae72 <__fp_split3> 3ba32: 58 f3 brcs .-42 ; 0x3ba0a <__addsf3+0xc> 3ba34: ba 17 cp r27, r26 3ba36: 62 07 cpc r22, r18 3ba38: 73 07 cpc r23, r19 3ba3a: 84 07 cpc r24, r20 3ba3c: 95 07 cpc r25, r21 3ba3e: 20 f0 brcs .+8 ; 0x3ba48 <__addsf3x+0x1c> 3ba40: 79 f4 brne .+30 ; 0x3ba60 <__addsf3x+0x34> 3ba42: a6 f5 brtc .+104 ; 0x3baac <__addsf3x+0x80> 3ba44: 0d 94 5b d7 jmp 0x3aeb6 ; 0x3aeb6 <__fp_zero> 3ba48: 0e f4 brtc .+2 ; 0x3ba4c <__addsf3x+0x20> 3ba4a: e0 95 com r30 3ba4c: 0b 2e mov r0, r27 3ba4e: ba 2f mov r27, r26 3ba50: a0 2d mov r26, r0 3ba52: 0b 01 movw r0, r22 3ba54: b9 01 movw r22, r18 3ba56: 90 01 movw r18, r0 3ba58: 0c 01 movw r0, r24 3ba5a: ca 01 movw r24, r20 3ba5c: a0 01 movw r20, r0 3ba5e: 11 24 eor r1, r1 3ba60: ff 27 eor r31, r31 3ba62: 59 1b sub r21, r25 3ba64: 99 f0 breq .+38 ; 0x3ba8c <__addsf3x+0x60> 3ba66: 59 3f cpi r21, 0xF9 ; 249 3ba68: 50 f4 brcc .+20 ; 0x3ba7e <__addsf3x+0x52> 3ba6a: 50 3e cpi r21, 0xE0 ; 224 3ba6c: 68 f1 brcs .+90 ; 0x3bac8 <__addsf3x+0x9c> 3ba6e: 1a 16 cp r1, r26 3ba70: f0 40 sbci r31, 0x00 ; 0 3ba72: a2 2f mov r26, r18 3ba74: 23 2f mov r18, r19 3ba76: 34 2f mov r19, r20 3ba78: 44 27 eor r20, r20 3ba7a: 58 5f subi r21, 0xF8 ; 248 3ba7c: f3 cf rjmp .-26 ; 0x3ba64 <__addsf3x+0x38> 3ba7e: 46 95 lsr r20 3ba80: 37 95 ror r19 3ba82: 27 95 ror r18 3ba84: a7 95 ror r26 3ba86: f0 40 sbci r31, 0x00 ; 0 3ba88: 53 95 inc r21 3ba8a: c9 f7 brne .-14 ; 0x3ba7e <__addsf3x+0x52> 3ba8c: 7e f4 brtc .+30 ; 0x3baac <__addsf3x+0x80> 3ba8e: 1f 16 cp r1, r31 3ba90: ba 0b sbc r27, r26 3ba92: 62 0b sbc r22, r18 3ba94: 73 0b sbc r23, r19 3ba96: 84 0b sbc r24, r20 3ba98: ba f0 brmi .+46 ; 0x3bac8 <__addsf3x+0x9c> 3ba9a: 91 50 subi r25, 0x01 ; 1 3ba9c: a1 f0 breq .+40 ; 0x3bac6 <__addsf3x+0x9a> 3ba9e: ff 0f add r31, r31 3baa0: bb 1f adc r27, r27 3baa2: 66 1f adc r22, r22 3baa4: 77 1f adc r23, r23 3baa6: 88 1f adc r24, r24 3baa8: c2 f7 brpl .-16 ; 0x3ba9a <__addsf3x+0x6e> 3baaa: 0e c0 rjmp .+28 ; 0x3bac8 <__addsf3x+0x9c> 3baac: ba 0f add r27, r26 3baae: 62 1f adc r22, r18 3bab0: 73 1f adc r23, r19 3bab2: 84 1f adc r24, r20 3bab4: 48 f4 brcc .+18 ; 0x3bac8 <__addsf3x+0x9c> 3bab6: 87 95 ror r24 3bab8: 77 95 ror r23 3baba: 67 95 ror r22 3babc: b7 95 ror r27 3babe: f7 95 ror r31 3bac0: 9e 3f cpi r25, 0xFE ; 254 3bac2: 08 f0 brcs .+2 ; 0x3bac6 <__addsf3x+0x9a> 3bac4: b0 cf rjmp .-160 ; 0x3ba26 <__addsf3+0x28> 3bac6: 93 95 inc r25 3bac8: 88 0f add r24, r24 3baca: 08 f0 brcs .+2 ; 0x3bace <__addsf3x+0xa2> 3bacc: 99 27 eor r25, r25 3bace: ee 0f add r30, r30 3bad0: 97 95 ror r25 3bad2: 87 95 ror r24 3bad4: 08 95 ret 3bad6: 0f 94 1a d7 call 0x3ae34 ; 0x3ae34 <__fp_pscA> 3bada: 60 f0 brcs .+24 ; 0x3baf4 <__addsf3x+0xc8> 3badc: 80 e8 ldi r24, 0x80 ; 128 3bade: 91 e0 ldi r25, 0x01 ; 1 3bae0: 09 f4 brne .+2 ; 0x3bae4 <__addsf3x+0xb8> 3bae2: 9e ef ldi r25, 0xFE ; 254 3bae4: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__fp_pscB> 3bae8: 28 f0 brcs .+10 ; 0x3baf4 <__addsf3x+0xc8> 3baea: 40 e8 ldi r20, 0x80 ; 128 3baec: 51 e0 ldi r21, 0x01 ; 1 3baee: 71 f4 brne .+28 ; 0x3bb0c 3baf0: 5e ef ldi r21, 0xFE ; 254 3baf2: 0c c0 rjmp .+24 ; 0x3bb0c 3baf4: 0d 94 17 d7 jmp 0x3ae2e ; 0x3ae2e <__fp_nan> 3baf8: 0d 94 5b d7 jmp 0x3aeb6 ; 0x3aeb6 <__fp_zero> 0003bafc : 3bafc: e9 2f mov r30, r25 3bafe: e0 78 andi r30, 0x80 ; 128 3bb00: 0f 94 39 d7 call 0x3ae72 ; 0x3ae72 <__fp_split3> 3bb04: 40 f3 brcs .-48 ; 0x3bad6 <__addsf3x+0xaa> 3bb06: 09 2e mov r0, r25 3bb08: 05 2a or r0, r21 3bb0a: b1 f3 breq .-20 ; 0x3baf8 <__addsf3x+0xcc> 3bb0c: 26 17 cp r18, r22 3bb0e: 37 07 cpc r19, r23 3bb10: 48 07 cpc r20, r24 3bb12: 59 07 cpc r21, r25 3bb14: 38 f0 brcs .+14 ; 0x3bb24 3bb16: 0e 2e mov r0, r30 3bb18: 07 f8 bld r0, 7 3bb1a: e0 25 eor r30, r0 3bb1c: 69 f0 breq .+26 ; 0x3bb38 3bb1e: e0 25 eor r30, r0 3bb20: e0 64 ori r30, 0x40 ; 64 3bb22: 0a c0 rjmp .+20 ; 0x3bb38 3bb24: ef 63 ori r30, 0x3F ; 63 3bb26: 07 f8 bld r0, 7 3bb28: 00 94 com r0 3bb2a: 07 fa bst r0, 7 3bb2c: db 01 movw r26, r22 3bb2e: b9 01 movw r22, r18 3bb30: 9d 01 movw r18, r26 3bb32: dc 01 movw r26, r24 3bb34: ca 01 movw r24, r20 3bb36: ad 01 movw r20, r26 3bb38: ef 93 push r30 3bb3a: 0f 94 15 de call 0x3bc2a ; 0x3bc2a <__divsf3_pse> 3bb3e: 0f 94 28 d7 call 0x3ae50 ; 0x3ae50 <__fp_round> 3bb42: 0f 94 ae dd call 0x3bb5c ; 0x3bb5c 3bb46: 5f 91 pop r21 3bb48: 55 23 and r21, r21 3bb4a: 39 f0 breq .+14 ; 0x3bb5a 3bb4c: 2b ed ldi r18, 0xDB ; 219 3bb4e: 3f e0 ldi r19, 0x0F ; 15 3bb50: 49 e4 ldi r20, 0x49 ; 73 3bb52: 50 fd sbrc r21, 0 3bb54: 49 ec ldi r20, 0xC9 ; 201 3bb56: 0d 94 ff dc jmp 0x3b9fe ; 0x3b9fe <__addsf3> 3bb5a: 08 95 ret 0003bb5c : 3bb5c: df 93 push r29 3bb5e: dd 27 eor r29, r29 3bb60: b9 2f mov r27, r25 3bb62: bf 77 andi r27, 0x7F ; 127 3bb64: 40 e8 ldi r20, 0x80 ; 128 3bb66: 5f e3 ldi r21, 0x3F ; 63 3bb68: 16 16 cp r1, r22 3bb6a: 17 06 cpc r1, r23 3bb6c: 48 07 cpc r20, r24 3bb6e: 5b 07 cpc r21, r27 3bb70: 18 f4 brcc .+6 ; 0x3bb78 3bb72: d9 2f mov r29, r25 3bb74: 0f 94 fa df call 0x3bff4 ; 0x3bff4 3bb78: 9f 93 push r25 3bb7a: 8f 93 push r24 3bb7c: 7f 93 push r23 3bb7e: 6f 93 push r22 3bb80: 0f 94 a0 d6 call 0x3ad40 ; 0x3ad40 3bb84: e7 e8 ldi r30, 0x87 ; 135 3bb86: f1 e7 ldi r31, 0x71 ; 113 3bb88: 0f 94 0a df call 0x3be14 ; 0x3be14 <__fp_powser> 3bb8c: 0f 94 28 d7 call 0x3ae50 ; 0x3ae50 <__fp_round> 3bb90: 2f 91 pop r18 3bb92: 3f 91 pop r19 3bb94: 4f 91 pop r20 3bb96: 5f 91 pop r21 3bb98: 0f 94 b7 d6 call 0x3ad6e ; 0x3ad6e <__mulsf3x> 3bb9c: dd 23 and r29, r29 3bb9e: 51 f0 breq .+20 ; 0x3bbb4 3bba0: 90 58 subi r25, 0x80 ; 128 3bba2: a2 ea ldi r26, 0xA2 ; 162 3bba4: 2a ed ldi r18, 0xDA ; 218 3bba6: 3f e0 ldi r19, 0x0F ; 15 3bba8: 49 ec ldi r20, 0xC9 ; 201 3bbaa: 5f e3 ldi r21, 0x3F ; 63 3bbac: d0 78 andi r29, 0x80 ; 128 3bbae: 5d 27 eor r21, r29 3bbb0: 0f 94 16 dd call 0x3ba2c ; 0x3ba2c <__addsf3x> 3bbb4: df 91 pop r29 3bbb6: 0d 94 28 d7 jmp 0x3ae50 ; 0x3ae50 <__fp_round> 0003bbba : 3bbba: 0f 94 70 df call 0x3bee0 ; 0x3bee0 <__fp_trunc> 3bbbe: 90 f0 brcs .+36 ; 0x3bbe4 3bbc0: 9f 37 cpi r25, 0x7F ; 127 3bbc2: 48 f4 brcc .+18 ; 0x3bbd6 3bbc4: 91 11 cpse r25, r1 3bbc6: 16 f4 brtc .+4 ; 0x3bbcc 3bbc8: 0d 94 5c d7 jmp 0x3aeb8 ; 0x3aeb8 <__fp_szero> 3bbcc: 60 e0 ldi r22, 0x00 ; 0 3bbce: 70 e0 ldi r23, 0x00 ; 0 3bbd0: 80 e8 ldi r24, 0x80 ; 128 3bbd2: 9f e3 ldi r25, 0x3F ; 63 3bbd4: 08 95 ret 3bbd6: 26 f0 brts .+8 ; 0x3bbe0 3bbd8: 1b 16 cp r1, r27 3bbda: 61 1d adc r22, r1 3bbdc: 71 1d adc r23, r1 3bbde: 81 1d adc r24, r1 3bbe0: 0d 94 e1 de jmp 0x3bdc2 ; 0x3bdc2 <__fp_mintl> 3bbe4: 0d 94 fc de jmp 0x3bdf8 ; 0x3bdf8 <__fp_mpack> 0003bbe8 <__cmpsf2>: 3bbe8: 0f 94 bd de call 0x3bd7a ; 0x3bd7a <__fp_cmp> 3bbec: 08 f4 brcc .+2 ; 0x3bbf0 <__cmpsf2+0x8> 3bbee: 81 e0 ldi r24, 0x01 ; 1 3bbf0: 08 95 ret 0003bbf2 : 3bbf2: 0f 94 33 df call 0x3be66 ; 0x3be66 <__fp_rempio2> 3bbf6: e3 95 inc r30 3bbf8: 0d 94 5c df jmp 0x3beb8 ; 0x3beb8 <__fp_sinus> 0003bbfc <__divsf3>: 3bbfc: 0f 94 12 de call 0x3bc24 ; 0x3bc24 <__divsf3x> 3bc00: 0d 94 28 d7 jmp 0x3ae50 ; 0x3ae50 <__fp_round> 3bc04: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__fp_pscB> 3bc08: 58 f0 brcs .+22 ; 0x3bc20 <__divsf3+0x24> 3bc0a: 0f 94 1a d7 call 0x3ae34 ; 0x3ae34 <__fp_pscA> 3bc0e: 40 f0 brcs .+16 ; 0x3bc20 <__divsf3+0x24> 3bc10: 29 f4 brne .+10 ; 0x3bc1c <__divsf3+0x20> 3bc12: 5f 3f cpi r21, 0xFF ; 255 3bc14: 29 f0 breq .+10 ; 0x3bc20 <__divsf3+0x24> 3bc16: 0d 94 11 d7 jmp 0x3ae22 ; 0x3ae22 <__fp_inf> 3bc1a: 51 11 cpse r21, r1 3bc1c: 0d 94 5c d7 jmp 0x3aeb8 ; 0x3aeb8 <__fp_szero> 3bc20: 0d 94 17 d7 jmp 0x3ae2e ; 0x3ae2e <__fp_nan> 0003bc24 <__divsf3x>: 3bc24: 0f 94 39 d7 call 0x3ae72 ; 0x3ae72 <__fp_split3> 3bc28: 68 f3 brcs .-38 ; 0x3bc04 <__divsf3+0x8> 0003bc2a <__divsf3_pse>: 3bc2a: 99 23 and r25, r25 3bc2c: b1 f3 breq .-20 ; 0x3bc1a <__divsf3+0x1e> 3bc2e: 55 23 and r21, r21 3bc30: 91 f3 breq .-28 ; 0x3bc16 <__divsf3+0x1a> 3bc32: 95 1b sub r25, r21 3bc34: 55 0b sbc r21, r21 3bc36: bb 27 eor r27, r27 3bc38: aa 27 eor r26, r26 3bc3a: 62 17 cp r22, r18 3bc3c: 73 07 cpc r23, r19 3bc3e: 84 07 cpc r24, r20 3bc40: 38 f0 brcs .+14 ; 0x3bc50 <__divsf3_pse+0x26> 3bc42: 9f 5f subi r25, 0xFF ; 255 3bc44: 5f 4f sbci r21, 0xFF ; 255 3bc46: 22 0f add r18, r18 3bc48: 33 1f adc r19, r19 3bc4a: 44 1f adc r20, r20 3bc4c: aa 1f adc r26, r26 3bc4e: a9 f3 breq .-22 ; 0x3bc3a <__divsf3_pse+0x10> 3bc50: 35 d0 rcall .+106 ; 0x3bcbc <__divsf3_pse+0x92> 3bc52: 0e 2e mov r0, r30 3bc54: 3a f0 brmi .+14 ; 0x3bc64 <__divsf3_pse+0x3a> 3bc56: e0 e8 ldi r30, 0x80 ; 128 3bc58: 32 d0 rcall .+100 ; 0x3bcbe <__divsf3_pse+0x94> 3bc5a: 91 50 subi r25, 0x01 ; 1 3bc5c: 50 40 sbci r21, 0x00 ; 0 3bc5e: e6 95 lsr r30 3bc60: 00 1c adc r0, r0 3bc62: ca f7 brpl .-14 ; 0x3bc56 <__divsf3_pse+0x2c> 3bc64: 2b d0 rcall .+86 ; 0x3bcbc <__divsf3_pse+0x92> 3bc66: fe 2f mov r31, r30 3bc68: 29 d0 rcall .+82 ; 0x3bcbc <__divsf3_pse+0x92> 3bc6a: 66 0f add r22, r22 3bc6c: 77 1f adc r23, r23 3bc6e: 88 1f adc r24, r24 3bc70: bb 1f adc r27, r27 3bc72: 26 17 cp r18, r22 3bc74: 37 07 cpc r19, r23 3bc76: 48 07 cpc r20, r24 3bc78: ab 07 cpc r26, r27 3bc7a: b0 e8 ldi r27, 0x80 ; 128 3bc7c: 09 f0 breq .+2 ; 0x3bc80 <__divsf3_pse+0x56> 3bc7e: bb 0b sbc r27, r27 3bc80: 80 2d mov r24, r0 3bc82: bf 01 movw r22, r30 3bc84: ff 27 eor r31, r31 3bc86: 93 58 subi r25, 0x83 ; 131 3bc88: 5f 4f sbci r21, 0xFF ; 255 3bc8a: 3a f0 brmi .+14 ; 0x3bc9a <__divsf3_pse+0x70> 3bc8c: 9e 3f cpi r25, 0xFE ; 254 3bc8e: 51 05 cpc r21, r1 3bc90: 78 f0 brcs .+30 ; 0x3bcb0 <__divsf3_pse+0x86> 3bc92: 0d 94 11 d7 jmp 0x3ae22 ; 0x3ae22 <__fp_inf> 3bc96: 0d 94 5c d7 jmp 0x3aeb8 ; 0x3aeb8 <__fp_szero> 3bc9a: 5f 3f cpi r21, 0xFF ; 255 3bc9c: e4 f3 brlt .-8 ; 0x3bc96 <__divsf3_pse+0x6c> 3bc9e: 98 3e cpi r25, 0xE8 ; 232 3bca0: d4 f3 brlt .-12 ; 0x3bc96 <__divsf3_pse+0x6c> 3bca2: 86 95 lsr r24 3bca4: 77 95 ror r23 3bca6: 67 95 ror r22 3bca8: b7 95 ror r27 3bcaa: f7 95 ror r31 3bcac: 9f 5f subi r25, 0xFF ; 255 3bcae: c9 f7 brne .-14 ; 0x3bca2 <__divsf3_pse+0x78> 3bcb0: 88 0f add r24, r24 3bcb2: 91 1d adc r25, r1 3bcb4: 96 95 lsr r25 3bcb6: 87 95 ror r24 3bcb8: 97 f9 bld r25, 7 3bcba: 08 95 ret 3bcbc: e1 e0 ldi r30, 0x01 ; 1 3bcbe: 66 0f add r22, r22 3bcc0: 77 1f adc r23, r23 3bcc2: 88 1f adc r24, r24 3bcc4: bb 1f adc r27, r27 3bcc6: 62 17 cp r22, r18 3bcc8: 73 07 cpc r23, r19 3bcca: 84 07 cpc r24, r20 3bccc: ba 07 cpc r27, r26 3bcce: 20 f0 brcs .+8 ; 0x3bcd8 <__divsf3_pse+0xae> 3bcd0: 62 1b sub r22, r18 3bcd2: 73 0b sbc r23, r19 3bcd4: 84 0b sbc r24, r20 3bcd6: ba 0b sbc r27, r26 3bcd8: ee 1f adc r30, r30 3bcda: 88 f7 brcc .-30 ; 0x3bcbe <__divsf3_pse+0x94> 3bcdc: e0 95 com r30 3bcde: 08 95 ret 0003bce0 <__fixsfsi>: 3bce0: 0f 94 77 de call 0x3bcee ; 0x3bcee <__fixunssfsi> 3bce4: 68 94 set 3bce6: b1 11 cpse r27, r1 3bce8: 0d 94 5c d7 jmp 0x3aeb8 ; 0x3aeb8 <__fp_szero> 3bcec: 08 95 ret 0003bcee <__fixunssfsi>: 3bcee: 0f 94 41 d7 call 0x3ae82 ; 0x3ae82 <__fp_splitA> 3bcf2: 88 f0 brcs .+34 ; 0x3bd16 <__fixunssfsi+0x28> 3bcf4: 9f 57 subi r25, 0x7F ; 127 3bcf6: 98 f0 brcs .+38 ; 0x3bd1e <__fixunssfsi+0x30> 3bcf8: b9 2f mov r27, r25 3bcfa: 99 27 eor r25, r25 3bcfc: b7 51 subi r27, 0x17 ; 23 3bcfe: b0 f0 brcs .+44 ; 0x3bd2c <__fixunssfsi+0x3e> 3bd00: e1 f0 breq .+56 ; 0x3bd3a <__fixunssfsi+0x4c> 3bd02: 66 0f add r22, r22 3bd04: 77 1f adc r23, r23 3bd06: 88 1f adc r24, r24 3bd08: 99 1f adc r25, r25 3bd0a: 1a f0 brmi .+6 ; 0x3bd12 <__fixunssfsi+0x24> 3bd0c: ba 95 dec r27 3bd0e: c9 f7 brne .-14 ; 0x3bd02 <__fixunssfsi+0x14> 3bd10: 14 c0 rjmp .+40 ; 0x3bd3a <__fixunssfsi+0x4c> 3bd12: b1 30 cpi r27, 0x01 ; 1 3bd14: 91 f0 breq .+36 ; 0x3bd3a <__fixunssfsi+0x4c> 3bd16: 0f 94 5b d7 call 0x3aeb6 ; 0x3aeb6 <__fp_zero> 3bd1a: b1 e0 ldi r27, 0x01 ; 1 3bd1c: 08 95 ret 3bd1e: 0d 94 5b d7 jmp 0x3aeb6 ; 0x3aeb6 <__fp_zero> 3bd22: 67 2f mov r22, r23 3bd24: 78 2f mov r23, r24 3bd26: 88 27 eor r24, r24 3bd28: b8 5f subi r27, 0xF8 ; 248 3bd2a: 39 f0 breq .+14 ; 0x3bd3a <__fixunssfsi+0x4c> 3bd2c: b9 3f cpi r27, 0xF9 ; 249 3bd2e: cc f3 brlt .-14 ; 0x3bd22 <__fixunssfsi+0x34> 3bd30: 86 95 lsr r24 3bd32: 77 95 ror r23 3bd34: 67 95 ror r22 3bd36: b3 95 inc r27 3bd38: d9 f7 brne .-10 ; 0x3bd30 <__fixunssfsi+0x42> 3bd3a: 3e f4 brtc .+14 ; 0x3bd4a <__fixunssfsi+0x5c> 3bd3c: 90 95 com r25 3bd3e: 80 95 com r24 3bd40: 70 95 com r23 3bd42: 61 95 neg r22 3bd44: 7f 4f sbci r23, 0xFF ; 255 3bd46: 8f 4f sbci r24, 0xFF ; 255 3bd48: 9f 4f sbci r25, 0xFF ; 255 3bd4a: 08 95 ret 0003bd4c : 3bd4c: 0f 94 70 df call 0x3bee0 ; 0x3bee0 <__fp_trunc> 3bd50: 90 f0 brcs .+36 ; 0x3bd76 3bd52: 9f 37 cpi r25, 0x7F ; 127 3bd54: 48 f4 brcc .+18 ; 0x3bd68 3bd56: 91 11 cpse r25, r1 3bd58: 16 f0 brts .+4 ; 0x3bd5e 3bd5a: 0d 94 5c d7 jmp 0x3aeb8 ; 0x3aeb8 <__fp_szero> 3bd5e: 60 e0 ldi r22, 0x00 ; 0 3bd60: 70 e0 ldi r23, 0x00 ; 0 3bd62: 80 e8 ldi r24, 0x80 ; 128 3bd64: 9f eb ldi r25, 0xBF ; 191 3bd66: 08 95 ret 3bd68: 26 f4 brtc .+8 ; 0x3bd72 3bd6a: 1b 16 cp r1, r27 3bd6c: 61 1d adc r22, r1 3bd6e: 71 1d adc r23, r1 3bd70: 81 1d adc r24, r1 3bd72: 0d 94 e1 de jmp 0x3bdc2 ; 0x3bdc2 <__fp_mintl> 3bd76: 0d 94 fc de jmp 0x3bdf8 ; 0x3bdf8 <__fp_mpack> 0003bd7a <__fp_cmp>: 3bd7a: 99 0f add r25, r25 3bd7c: 00 08 sbc r0, r0 3bd7e: 55 0f add r21, r21 3bd80: aa 0b sbc r26, r26 3bd82: e0 e8 ldi r30, 0x80 ; 128 3bd84: fe ef ldi r31, 0xFE ; 254 3bd86: 16 16 cp r1, r22 3bd88: 17 06 cpc r1, r23 3bd8a: e8 07 cpc r30, r24 3bd8c: f9 07 cpc r31, r25 3bd8e: c0 f0 brcs .+48 ; 0x3bdc0 <__fp_cmp+0x46> 3bd90: 12 16 cp r1, r18 3bd92: 13 06 cpc r1, r19 3bd94: e4 07 cpc r30, r20 3bd96: f5 07 cpc r31, r21 3bd98: 98 f0 brcs .+38 ; 0x3bdc0 <__fp_cmp+0x46> 3bd9a: 62 1b sub r22, r18 3bd9c: 73 0b sbc r23, r19 3bd9e: 84 0b sbc r24, r20 3bda0: 95 0b sbc r25, r21 3bda2: 39 f4 brne .+14 ; 0x3bdb2 <__fp_cmp+0x38> 3bda4: 0a 26 eor r0, r26 3bda6: 61 f0 breq .+24 ; 0x3bdc0 <__fp_cmp+0x46> 3bda8: 23 2b or r18, r19 3bdaa: 24 2b or r18, r20 3bdac: 25 2b or r18, r21 3bdae: 21 f4 brne .+8 ; 0x3bdb8 <__fp_cmp+0x3e> 3bdb0: 08 95 ret 3bdb2: 0a 26 eor r0, r26 3bdb4: 09 f4 brne .+2 ; 0x3bdb8 <__fp_cmp+0x3e> 3bdb6: a1 40 sbci r26, 0x01 ; 1 3bdb8: a6 95 lsr r26 3bdba: 8f ef ldi r24, 0xFF ; 255 3bdbc: 81 1d adc r24, r1 3bdbe: 81 1d adc r24, r1 3bdc0: 08 95 ret 0003bdc2 <__fp_mintl>: 3bdc2: 88 23 and r24, r24 3bdc4: 71 f4 brne .+28 ; 0x3bde2 <__fp_mintl+0x20> 3bdc6: 77 23 and r23, r23 3bdc8: 21 f0 breq .+8 ; 0x3bdd2 <__fp_mintl+0x10> 3bdca: 98 50 subi r25, 0x08 ; 8 3bdcc: 87 2b or r24, r23 3bdce: 76 2f mov r23, r22 3bdd0: 07 c0 rjmp .+14 ; 0x3bde0 <__fp_mintl+0x1e> 3bdd2: 66 23 and r22, r22 3bdd4: 11 f4 brne .+4 ; 0x3bdda <__fp_mintl+0x18> 3bdd6: 99 27 eor r25, r25 3bdd8: 0d c0 rjmp .+26 ; 0x3bdf4 <__fp_mintl+0x32> 3bdda: 90 51 subi r25, 0x10 ; 16 3bddc: 86 2b or r24, r22 3bdde: 70 e0 ldi r23, 0x00 ; 0 3bde0: 60 e0 ldi r22, 0x00 ; 0 3bde2: 2a f0 brmi .+10 ; 0x3bdee <__fp_mintl+0x2c> 3bde4: 9a 95 dec r25 3bde6: 66 0f add r22, r22 3bde8: 77 1f adc r23, r23 3bdea: 88 1f adc r24, r24 3bdec: da f7 brpl .-10 ; 0x3bde4 <__fp_mintl+0x22> 3bdee: 88 0f add r24, r24 3bdf0: 96 95 lsr r25 3bdf2: 87 95 ror r24 3bdf4: 97 f9 bld r25, 7 3bdf6: 08 95 ret 0003bdf8 <__fp_mpack>: 3bdf8: 9f 3f cpi r25, 0xFF ; 255 3bdfa: 31 f0 breq .+12 ; 0x3be08 <__fp_mpack_finite+0xc> 0003bdfc <__fp_mpack_finite>: 3bdfc: 91 50 subi r25, 0x01 ; 1 3bdfe: 20 f4 brcc .+8 ; 0x3be08 <__fp_mpack_finite+0xc> 3be00: 87 95 ror r24 3be02: 77 95 ror r23 3be04: 67 95 ror r22 3be06: b7 95 ror r27 3be08: 88 0f add r24, r24 3be0a: 91 1d adc r25, r1 3be0c: 96 95 lsr r25 3be0e: 87 95 ror r24 3be10: 97 f9 bld r25, 7 3be12: 08 95 ret 0003be14 <__fp_powser>: 3be14: df 93 push r29 3be16: cf 93 push r28 3be18: 1f 93 push r17 3be1a: 0f 93 push r16 3be1c: ff 92 push r15 3be1e: ef 92 push r14 3be20: df 92 push r13 3be22: 7b 01 movw r14, r22 3be24: 8c 01 movw r16, r24 3be26: 68 94 set 3be28: 06 c0 rjmp .+12 ; 0x3be36 <__fp_powser+0x22> 3be2a: da 2e mov r13, r26 3be2c: ef 01 movw r28, r30 3be2e: 0f 94 b7 d6 call 0x3ad6e ; 0x3ad6e <__mulsf3x> 3be32: fe 01 movw r30, r28 3be34: e8 94 clt 3be36: a5 91 lpm r26, Z+ 3be38: 25 91 lpm r18, Z+ 3be3a: 35 91 lpm r19, Z+ 3be3c: 45 91 lpm r20, Z+ 3be3e: 55 91 lpm r21, Z+ 3be40: a6 f3 brts .-24 ; 0x3be2a <__fp_powser+0x16> 3be42: ef 01 movw r28, r30 3be44: 0f 94 16 dd call 0x3ba2c ; 0x3ba2c <__addsf3x> 3be48: fe 01 movw r30, r28 3be4a: 97 01 movw r18, r14 3be4c: a8 01 movw r20, r16 3be4e: da 94 dec r13 3be50: 69 f7 brne .-38 ; 0x3be2c <__fp_powser+0x18> 3be52: df 90 pop r13 3be54: ef 90 pop r14 3be56: ff 90 pop r15 3be58: 0f 91 pop r16 3be5a: 1f 91 pop r17 3be5c: cf 91 pop r28 3be5e: df 91 pop r29 3be60: 08 95 ret 3be62: 0d 94 17 d7 jmp 0x3ae2e ; 0x3ae2e <__fp_nan> 0003be66 <__fp_rempio2>: 3be66: 0f 94 41 d7 call 0x3ae82 ; 0x3ae82 <__fp_splitA> 3be6a: d8 f3 brcs .-10 ; 0x3be62 <__fp_powser+0x4e> 3be6c: e8 94 clt 3be6e: e0 e0 ldi r30, 0x00 ; 0 3be70: bb 27 eor r27, r27 3be72: 9f 57 subi r25, 0x7F ; 127 3be74: f0 f0 brcs .+60 ; 0x3beb2 <__fp_rempio2+0x4c> 3be76: 2a ed ldi r18, 0xDA ; 218 3be78: 3f e0 ldi r19, 0x0F ; 15 3be7a: 49 ec ldi r20, 0xC9 ; 201 3be7c: 06 c0 rjmp .+12 ; 0x3be8a <__fp_rempio2+0x24> 3be7e: ee 0f add r30, r30 3be80: bb 0f add r27, r27 3be82: 66 1f adc r22, r22 3be84: 77 1f adc r23, r23 3be86: 88 1f adc r24, r24 3be88: 28 f0 brcs .+10 ; 0x3be94 <__fp_rempio2+0x2e> 3be8a: b2 3a cpi r27, 0xA2 ; 162 3be8c: 62 07 cpc r22, r18 3be8e: 73 07 cpc r23, r19 3be90: 84 07 cpc r24, r20 3be92: 28 f0 brcs .+10 ; 0x3be9e <__fp_rempio2+0x38> 3be94: b2 5a subi r27, 0xA2 ; 162 3be96: 62 0b sbc r22, r18 3be98: 73 0b sbc r23, r19 3be9a: 84 0b sbc r24, r20 3be9c: e3 95 inc r30 3be9e: 9a 95 dec r25 3bea0: 72 f7 brpl .-36 ; 0x3be7e <__fp_rempio2+0x18> 3bea2: 80 38 cpi r24, 0x80 ; 128 3bea4: 30 f4 brcc .+12 ; 0x3beb2 <__fp_rempio2+0x4c> 3bea6: 9a 95 dec r25 3bea8: bb 0f add r27, r27 3beaa: 66 1f adc r22, r22 3beac: 77 1f adc r23, r23 3beae: 88 1f adc r24, r24 3beb0: d2 f7 brpl .-12 ; 0x3bea6 <__fp_rempio2+0x40> 3beb2: 90 48 sbci r25, 0x80 ; 128 3beb4: 0d 94 fe de jmp 0x3bdfc ; 0x3bdfc <__fp_mpack_finite> 0003beb8 <__fp_sinus>: 3beb8: ef 93 push r30 3beba: e0 ff sbrs r30, 0 3bebc: 07 c0 rjmp .+14 ; 0x3becc <__fp_sinus+0x14> 3bebe: a2 ea ldi r26, 0xA2 ; 162 3bec0: 2a ed ldi r18, 0xDA ; 218 3bec2: 3f e0 ldi r19, 0x0F ; 15 3bec4: 49 ec ldi r20, 0xC9 ; 201 3bec6: 5f eb ldi r21, 0xBF ; 191 3bec8: 0f 94 16 dd call 0x3ba2c ; 0x3ba2c <__addsf3x> 3becc: 0f 94 28 d7 call 0x3ae50 ; 0x3ae50 <__fp_round> 3bed0: 0f 90 pop r0 3bed2: 03 94 inc r0 3bed4: 01 fc sbrc r0, 1 3bed6: 90 58 subi r25, 0x80 ; 128 3bed8: e4 eb ldi r30, 0xB4 ; 180 3beda: f1 e7 ldi r31, 0x71 ; 113 3bedc: 0d 94 53 e1 jmp 0x3c2a6 ; 0x3c2a6 <__fp_powsodd> 0003bee0 <__fp_trunc>: 3bee0: 0f 94 41 d7 call 0x3ae82 ; 0x3ae82 <__fp_splitA> 3bee4: a0 f0 brcs .+40 ; 0x3bf0e <__fp_trunc+0x2e> 3bee6: be e7 ldi r27, 0x7E ; 126 3bee8: b9 17 cp r27, r25 3beea: 88 f4 brcc .+34 ; 0x3bf0e <__fp_trunc+0x2e> 3beec: bb 27 eor r27, r27 3beee: 9f 38 cpi r25, 0x8F ; 143 3bef0: 60 f4 brcc .+24 ; 0x3bf0a <__fp_trunc+0x2a> 3bef2: 16 16 cp r1, r22 3bef4: b1 1d adc r27, r1 3bef6: 67 2f mov r22, r23 3bef8: 78 2f mov r23, r24 3befa: 88 27 eor r24, r24 3befc: 98 5f subi r25, 0xF8 ; 248 3befe: f7 cf rjmp .-18 ; 0x3beee <__fp_trunc+0xe> 3bf00: 86 95 lsr r24 3bf02: 77 95 ror r23 3bf04: 67 95 ror r22 3bf06: b1 1d adc r27, r1 3bf08: 93 95 inc r25 3bf0a: 96 39 cpi r25, 0x96 ; 150 3bf0c: c8 f3 brcs .-14 ; 0x3bf00 <__fp_trunc+0x20> 3bf0e: 08 95 ret 0003bf10 <__gesf2>: 3bf10: 0f 94 bd de call 0x3bd7a ; 0x3bd7a <__fp_cmp> 3bf14: 08 f4 brcc .+2 ; 0x3bf18 <__gesf2+0x8> 3bf16: 8f ef ldi r24, 0xFF ; 255 3bf18: 08 95 ret 3bf1a: 0f 94 1a d7 call 0x3ae34 ; 0x3ae34 <__fp_pscA> 3bf1e: 29 f0 breq .+10 ; 0x3bf2a <__gesf2+0x1a> 3bf20: 0f 94 21 d7 call 0x3ae42 ; 0x3ae42 <__fp_pscB> 3bf24: 11 f0 breq .+4 ; 0x3bf2a <__gesf2+0x1a> 3bf26: 0d 94 17 d7 jmp 0x3ae2e ; 0x3ae2e <__fp_nan> 3bf2a: 0d 94 11 d7 jmp 0x3ae22 ; 0x3ae22 <__fp_inf> 3bf2e: b9 01 movw r22, r18 3bf30: ca 01 movw r24, r20 3bf32: 0d 94 fc de jmp 0x3bdf8 ; 0x3bdf8 <__fp_mpack> 0003bf36 : 3bf36: 9f 77 andi r25, 0x7F ; 127 3bf38: 5f 77 andi r21, 0x7F ; 127 3bf3a: 0f 94 39 d7 call 0x3ae72 ; 0x3ae72 <__fp_split3> 3bf3e: 68 f3 brcs .-38 ; 0x3bf1a <__gesf2+0xa> 3bf40: 99 23 and r25, r25 3bf42: a9 f3 breq .-22 ; 0x3bf2e <__gesf2+0x1e> 3bf44: 55 23 and r21, r21 3bf46: a9 f3 breq .-22 ; 0x3bf32 <__gesf2+0x22> 3bf48: ff 27 eor r31, r31 3bf4a: 95 17 cp r25, r21 3bf4c: 58 f4 brcc .+22 ; 0x3bf64 3bf4e: e5 2f mov r30, r21 3bf50: e9 1b sub r30, r25 3bf52: ed 30 cpi r30, 0x0D ; 13 3bf54: 60 f7 brcc .-40 ; 0x3bf2e <__gesf2+0x1e> 3bf56: 5e 3b cpi r21, 0xBE ; 190 3bf58: 10 f0 brcs .+4 ; 0x3bf5e 3bf5a: f1 e4 ldi r31, 0x41 ; 65 3bf5c: 1c c0 rjmp .+56 ; 0x3bf96 3bf5e: 90 34 cpi r25, 0x40 ; 64 3bf60: e0 f4 brcc .+56 ; 0x3bf9a 3bf62: 0a c0 rjmp .+20 ; 0x3bf78 3bf64: e9 2f mov r30, r25 3bf66: e5 1b sub r30, r21 3bf68: ed 30 cpi r30, 0x0D ; 13 3bf6a: 18 f7 brcc .-58 ; 0x3bf32 <__gesf2+0x22> 3bf6c: 9e 3b cpi r25, 0xBE ; 190 3bf6e: 10 f0 brcs .+4 ; 0x3bf74 3bf70: f1 e4 ldi r31, 0x41 ; 65 3bf72: 11 c0 rjmp .+34 ; 0x3bf96 3bf74: 50 34 cpi r21, 0x40 ; 64 3bf76: 88 f4 brcc .+34 ; 0x3bf9a 3bf78: f9 ea ldi r31, 0xA9 ; 169 3bf7a: 88 23 and r24, r24 3bf7c: 2a f0 brmi .+10 ; 0x3bf88 3bf7e: 9a 95 dec r25 3bf80: 66 0f add r22, r22 3bf82: 77 1f adc r23, r23 3bf84: 88 1f adc r24, r24 3bf86: da f7 brpl .-10 ; 0x3bf7e 3bf88: 44 23 and r20, r20 3bf8a: 2a f0 brmi .+10 ; 0x3bf96 3bf8c: 5a 95 dec r21 3bf8e: 22 0f add r18, r18 3bf90: 33 1f adc r19, r19 3bf92: 44 1f adc r20, r20 3bf94: da f7 brpl .-10 ; 0x3bf8c 3bf96: 9f 1b sub r25, r31 3bf98: 5f 1b sub r21, r31 3bf9a: ff 93 push r31 3bf9c: 1f 93 push r17 3bf9e: 0f 93 push r16 3bfa0: ff 92 push r15 3bfa2: ef 92 push r14 3bfa4: 79 01 movw r14, r18 3bfa6: 8a 01 movw r16, r20 3bfa8: bb 27 eor r27, r27 3bfaa: ab 2f mov r26, r27 3bfac: 9b 01 movw r18, r22 3bfae: ac 01 movw r20, r24 3bfb0: 0f 94 ba d6 call 0x3ad74 ; 0x3ad74 <__mulsf3_pse> 3bfb4: 97 01 movw r18, r14 3bfb6: a8 01 movw r20, r16 3bfb8: bf 93 push r27 3bfba: 7b 01 movw r14, r22 3bfbc: 8c 01 movw r16, r24 3bfbe: aa 27 eor r26, r26 3bfc0: ba 2f mov r27, r26 3bfc2: b9 01 movw r22, r18 3bfc4: ca 01 movw r24, r20 3bfc6: 0f 94 ba d6 call 0x3ad74 ; 0x3ad74 <__mulsf3_pse> 3bfca: af 91 pop r26 3bfcc: 97 01 movw r18, r14 3bfce: a8 01 movw r20, r16 3bfd0: ef 90 pop r14 3bfd2: ff 90 pop r15 3bfd4: 0f 91 pop r16 3bfd6: 1f 91 pop r17 3bfd8: 0f 94 16 dd call 0x3ba2c ; 0x3ba2c <__addsf3x> 3bfdc: 0f 94 28 d7 call 0x3ae50 ; 0x3ae50 <__fp_round> 3bfe0: 0f 94 cd e0 call 0x3c19a ; 0x3c19a 3bfe4: 4f 91 pop r20 3bfe6: 40 ff sbrs r20, 0 3bfe8: 08 95 ret 3bfea: 55 27 eor r21, r21 3bfec: 47 fd sbrc r20, 7 3bfee: 50 95 com r21 3bff0: 0d 94 06 e0 jmp 0x3c00c ; 0x3c00c 0003bff4 : 3bff4: 9b 01 movw r18, r22 3bff6: ac 01 movw r20, r24 3bff8: 60 e0 ldi r22, 0x00 ; 0 3bffa: 70 e0 ldi r23, 0x00 ; 0 3bffc: 80 e8 ldi r24, 0x80 ; 128 3bffe: 9f e3 ldi r25, 0x3F ; 63 3c000: 0d 94 fe dd jmp 0x3bbfc ; 0x3bbfc <__divsf3> 3c004: 0d 94 11 d7 jmp 0x3ae22 ; 0x3ae22 <__fp_inf> 3c008: 0d 94 fc de jmp 0x3bdf8 ; 0x3bdf8 <__fp_mpack> 0003c00c : 3c00c: 0f 94 41 d7 call 0x3ae82 ; 0x3ae82 <__fp_splitA> 3c010: d8 f3 brcs .-10 ; 0x3c008 3c012: 99 23 and r25, r25 3c014: c9 f3 breq .-14 ; 0x3c008 3c016: 94 0f add r25, r20 3c018: 51 1d adc r21, r1 3c01a: a3 f3 brvs .-24 ; 0x3c004 3c01c: 91 50 subi r25, 0x01 ; 1 3c01e: 50 40 sbci r21, 0x00 ; 0 3c020: 94 f0 brlt .+36 ; 0x3c046 3c022: 59 f0 breq .+22 ; 0x3c03a 3c024: 88 23 and r24, r24 3c026: 32 f0 brmi .+12 ; 0x3c034 3c028: 66 0f add r22, r22 3c02a: 77 1f adc r23, r23 3c02c: 88 1f adc r24, r24 3c02e: 91 50 subi r25, 0x01 ; 1 3c030: 50 40 sbci r21, 0x00 ; 0 3c032: c1 f7 brne .-16 ; 0x3c024 3c034: 9e 3f cpi r25, 0xFE ; 254 3c036: 51 05 cpc r21, r1 3c038: 2c f7 brge .-54 ; 0x3c004 3c03a: 88 0f add r24, r24 3c03c: 91 1d adc r25, r1 3c03e: 96 95 lsr r25 3c040: 87 95 ror r24 3c042: 97 f9 bld r25, 7 3c044: 08 95 ret 3c046: 5f 3f cpi r21, 0xFF ; 255 3c048: ac f0 brlt .+42 ; 0x3c074 3c04a: 98 3e cpi r25, 0xE8 ; 232 3c04c: 9c f0 brlt .+38 ; 0x3c074 3c04e: bb 27 eor r27, r27 3c050: 86 95 lsr r24 3c052: 77 95 ror r23 3c054: 67 95 ror r22 3c056: b7 95 ror r27 3c058: 08 f4 brcc .+2 ; 0x3c05c 3c05a: b1 60 ori r27, 0x01 ; 1 3c05c: 93 95 inc r25 3c05e: c1 f7 brne .-16 ; 0x3c050 3c060: bb 0f add r27, r27 3c062: 58 f7 brcc .-42 ; 0x3c03a 3c064: 11 f4 brne .+4 ; 0x3c06a 3c066: 60 ff sbrs r22, 0 3c068: e8 cf rjmp .-48 ; 0x3c03a 3c06a: 6f 5f subi r22, 0xFF ; 255 3c06c: 7f 4f sbci r23, 0xFF ; 255 3c06e: 8f 4f sbci r24, 0xFF ; 255 3c070: 9f 4f sbci r25, 0xFF ; 255 3c072: e3 cf rjmp .-58 ; 0x3c03a 3c074: 0d 94 5c d7 jmp 0x3aeb8 ; 0x3aeb8 <__fp_szero> 0003c078 : 3c078: 0f 94 41 d7 call 0x3ae82 ; 0x3ae82 <__fp_splitA> 3c07c: 58 f1 brcs .+86 ; 0x3c0d4 3c07e: 9e 57 subi r25, 0x7E ; 126 3c080: 60 f1 brcs .+88 ; 0x3c0da 3c082: 98 51 subi r25, 0x18 ; 24 3c084: a0 f0 brcs .+40 ; 0x3c0ae 3c086: e9 f0 breq .+58 ; 0x3c0c2 3c088: 98 30 cpi r25, 0x08 ; 8 3c08a: 20 f5 brcc .+72 ; 0x3c0d4 3c08c: 09 2e mov r0, r25 3c08e: 99 27 eor r25, r25 3c090: 66 0f add r22, r22 3c092: 77 1f adc r23, r23 3c094: 88 1f adc r24, r24 3c096: 99 1f adc r25, r25 3c098: 0a 94 dec r0 3c09a: d1 f7 brne .-12 ; 0x3c090 3c09c: 12 c0 rjmp .+36 ; 0x3c0c2 3c09e: 06 2e mov r0, r22 3c0a0: 67 2f mov r22, r23 3c0a2: 78 2f mov r23, r24 3c0a4: 88 27 eor r24, r24 3c0a6: 98 5f subi r25, 0xF8 ; 248 3c0a8: 11 f4 brne .+4 ; 0x3c0ae 3c0aa: 00 0c add r0, r0 3c0ac: 07 c0 rjmp .+14 ; 0x3c0bc 3c0ae: 99 3f cpi r25, 0xF9 ; 249 3c0b0: b4 f3 brlt .-20 ; 0x3c09e 3c0b2: 86 95 lsr r24 3c0b4: 77 95 ror r23 3c0b6: 67 95 ror r22 3c0b8: 93 95 inc r25 3c0ba: d9 f7 brne .-10 ; 0x3c0b2 3c0bc: 61 1d adc r22, r1 3c0be: 71 1d adc r23, r1 3c0c0: 81 1d adc r24, r1 3c0c2: 3e f4 brtc .+14 ; 0x3c0d2 3c0c4: 90 95 com r25 3c0c6: 80 95 com r24 3c0c8: 70 95 com r23 3c0ca: 61 95 neg r22 3c0cc: 7f 4f sbci r23, 0xFF ; 255 3c0ce: 8f 4f sbci r24, 0xFF ; 255 3c0d0: 9f 4f sbci r25, 0xFF ; 255 3c0d2: 08 95 ret 3c0d4: 68 94 set 3c0d6: 0d 94 5c d7 jmp 0x3aeb8 ; 0x3aeb8 <__fp_szero> 3c0da: 0d 94 5b d7 jmp 0x3aeb6 ; 0x3aeb6 <__fp_zero> 0003c0de : 3c0de: fa 01 movw r30, r20 3c0e0: ee 0f add r30, r30 3c0e2: ff 1f adc r31, r31 3c0e4: 30 96 adiw r30, 0x00 ; 0 3c0e6: 21 05 cpc r18, r1 3c0e8: 31 05 cpc r19, r1 3c0ea: a1 f1 breq .+104 ; 0x3c154 3c0ec: 61 15 cp r22, r1 3c0ee: 71 05 cpc r23, r1 3c0f0: 61 f4 brne .+24 ; 0x3c10a 3c0f2: 80 38 cpi r24, 0x80 ; 128 3c0f4: bf e3 ldi r27, 0x3F ; 63 3c0f6: 9b 07 cpc r25, r27 3c0f8: 49 f1 breq .+82 ; 0x3c14c 3c0fa: 68 94 set 3c0fc: 90 38 cpi r25, 0x80 ; 128 3c0fe: 81 05 cpc r24, r1 3c100: 61 f0 breq .+24 ; 0x3c11a 3c102: 80 38 cpi r24, 0x80 ; 128 3c104: bf ef ldi r27, 0xFF ; 255 3c106: 9b 07 cpc r25, r27 3c108: 41 f0 breq .+16 ; 0x3c11a 3c10a: 99 23 and r25, r25 3c10c: 4a f5 brpl .+82 ; 0x3c160 3c10e: ff 3f cpi r31, 0xFF ; 255 3c110: e1 05 cpc r30, r1 3c112: 31 05 cpc r19, r1 3c114: 21 05 cpc r18, r1 3c116: 19 f1 breq .+70 ; 0x3c15e 3c118: e8 94 clt 3c11a: 08 94 sec 3c11c: e7 95 ror r30 3c11e: d9 01 movw r26, r18 3c120: aa 23 and r26, r26 3c122: 29 f4 brne .+10 ; 0x3c12e 3c124: ab 2f mov r26, r27 3c126: be 2f mov r27, r30 3c128: f8 5f subi r31, 0xF8 ; 248 3c12a: d0 f3 brcs .-12 ; 0x3c120 3c12c: 10 c0 rjmp .+32 ; 0x3c14e 3c12e: ff 5f subi r31, 0xFF ; 255 3c130: 70 f4 brcc .+28 ; 0x3c14e 3c132: a6 95 lsr r26 3c134: e0 f7 brcc .-8 ; 0x3c12e 3c136: f7 39 cpi r31, 0x97 ; 151 3c138: 50 f0 brcs .+20 ; 0x3c14e 3c13a: 19 f0 breq .+6 ; 0x3c142 3c13c: ff 3a cpi r31, 0xAF ; 175 3c13e: 38 f4 brcc .+14 ; 0x3c14e 3c140: 9f 77 andi r25, 0x7F ; 127 3c142: 9f 93 push r25 3c144: 0d d0 rcall .+26 ; 0x3c160 3c146: 0f 90 pop r0 3c148: 07 fc sbrc r0, 7 3c14a: 90 58 subi r25, 0x80 ; 128 3c14c: 08 95 ret 3c14e: 46 f0 brts .+16 ; 0x3c160 3c150: 0d 94 17 d7 jmp 0x3ae2e ; 0x3ae2e <__fp_nan> 3c154: 60 e0 ldi r22, 0x00 ; 0 3c156: 70 e0 ldi r23, 0x00 ; 0 3c158: 80 e8 ldi r24, 0x80 ; 128 3c15a: 9f e3 ldi r25, 0x3F ; 63 3c15c: 08 95 ret 3c15e: 4f e7 ldi r20, 0x7F ; 127 3c160: 9f 77 andi r25, 0x7F ; 127 3c162: 5f 93 push r21 3c164: 4f 93 push r20 3c166: 3f 93 push r19 3c168: 2f 93 push r18 3c16a: 0f 94 6f e1 call 0x3c2de ; 0x3c2de 3c16e: 2f 91 pop r18 3c170: 3f 91 pop r19 3c172: 4f 91 pop r20 3c174: 5f 91 pop r21 3c176: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 3c17a: 0d 94 1a e1 jmp 0x3c234 ; 0x3c234 0003c17e : 3c17e: 9f 93 push r25 3c180: 0f 94 33 df call 0x3be66 ; 0x3be66 <__fp_rempio2> 3c184: 0f 90 pop r0 3c186: 07 fc sbrc r0, 7 3c188: ee 5f subi r30, 0xFE ; 254 3c18a: 0d 94 5c df jmp 0x3beb8 ; 0x3beb8 <__fp_sinus> 3c18e: 19 f4 brne .+6 ; 0x3c196 3c190: 16 f4 brtc .+4 ; 0x3c196 3c192: 0d 94 17 d7 jmp 0x3ae2e ; 0x3ae2e <__fp_nan> 3c196: 0d 94 fc de jmp 0x3bdf8 ; 0x3bdf8 <__fp_mpack> 0003c19a : 3c19a: 0f 94 41 d7 call 0x3ae82 ; 0x3ae82 <__fp_splitA> 3c19e: b8 f3 brcs .-18 ; 0x3c18e 3c1a0: 99 23 and r25, r25 3c1a2: c9 f3 breq .-14 ; 0x3c196 3c1a4: b6 f3 brts .-20 ; 0x3c192 3c1a6: 9f 57 subi r25, 0x7F ; 127 3c1a8: 55 0b sbc r21, r21 3c1aa: 87 ff sbrs r24, 7 3c1ac: 0f 94 4c e1 call 0x3c298 ; 0x3c298 <__fp_norm2> 3c1b0: 00 24 eor r0, r0 3c1b2: a0 e6 ldi r26, 0x60 ; 96 3c1b4: 40 ea ldi r20, 0xA0 ; 160 3c1b6: 90 01 movw r18, r0 3c1b8: 80 58 subi r24, 0x80 ; 128 3c1ba: 56 95 lsr r21 3c1bc: 97 95 ror r25 3c1be: 28 f4 brcc .+10 ; 0x3c1ca 3c1c0: 80 5c subi r24, 0xC0 ; 192 3c1c2: 66 0f add r22, r22 3c1c4: 77 1f adc r23, r23 3c1c6: 88 1f adc r24, r24 3c1c8: 20 f0 brcs .+8 ; 0x3c1d2 3c1ca: 26 17 cp r18, r22 3c1cc: 37 07 cpc r19, r23 3c1ce: 48 07 cpc r20, r24 3c1d0: 30 f4 brcc .+12 ; 0x3c1de 3c1d2: 62 1b sub r22, r18 3c1d4: 73 0b sbc r23, r19 3c1d6: 84 0b sbc r24, r20 3c1d8: 20 29 or r18, r0 3c1da: 31 29 or r19, r1 3c1dc: 4a 2b or r20, r26 3c1de: a6 95 lsr r26 3c1e0: 17 94 ror r1 3c1e2: 07 94 ror r0 3c1e4: 20 25 eor r18, r0 3c1e6: 31 25 eor r19, r1 3c1e8: 4a 27 eor r20, r26 3c1ea: 58 f7 brcc .-42 ; 0x3c1c2 3c1ec: 66 0f add r22, r22 3c1ee: 77 1f adc r23, r23 3c1f0: 88 1f adc r24, r24 3c1f2: 20 f0 brcs .+8 ; 0x3c1fc 3c1f4: 26 17 cp r18, r22 3c1f6: 37 07 cpc r19, r23 3c1f8: 48 07 cpc r20, r24 3c1fa: 30 f4 brcc .+12 ; 0x3c208 3c1fc: 62 0b sbc r22, r18 3c1fe: 73 0b sbc r23, r19 3c200: 84 0b sbc r24, r20 3c202: 20 0d add r18, r0 3c204: 31 1d adc r19, r1 3c206: 41 1d adc r20, r1 3c208: a0 95 com r26 3c20a: 81 f7 brne .-32 ; 0x3c1ec 3c20c: b9 01 movw r22, r18 3c20e: 84 2f mov r24, r20 3c210: 91 58 subi r25, 0x81 ; 129 3c212: 88 0f add r24, r24 3c214: 96 95 lsr r25 3c216: 87 95 ror r24 3c218: 08 95 ret 0003c21a <__unordsf2>: 3c21a: 0f 94 bd de call 0x3bd7a ; 0x3bd7a <__fp_cmp> 3c21e: 88 0b sbc r24, r24 3c220: 99 0b sbc r25, r25 3c222: 08 95 ret 3c224: 29 f4 brne .+10 ; 0x3c230 <__unordsf2+0x16> 3c226: 16 f0 brts .+4 ; 0x3c22c <__unordsf2+0x12> 3c228: 0d 94 11 d7 jmp 0x3ae22 ; 0x3ae22 <__fp_inf> 3c22c: 0d 94 5b d7 jmp 0x3aeb6 ; 0x3aeb6 <__fp_zero> 3c230: 0d 94 17 d7 jmp 0x3ae2e ; 0x3ae2e <__fp_nan> 0003c234 : 3c234: 0f 94 41 d7 call 0x3ae82 ; 0x3ae82 <__fp_splitA> 3c238: a8 f3 brcs .-22 ; 0x3c224 <__unordsf2+0xa> 3c23a: 96 38 cpi r25, 0x86 ; 134 3c23c: a0 f7 brcc .-24 ; 0x3c226 <__unordsf2+0xc> 3c23e: 07 f8 bld r0, 7 3c240: 0f 92 push r0 3c242: e8 94 clt 3c244: 2b e3 ldi r18, 0x3B ; 59 3c246: 3a ea ldi r19, 0xAA ; 170 3c248: 48 eb ldi r20, 0xB8 ; 184 3c24a: 5f e7 ldi r21, 0x7F ; 127 3c24c: 0f 94 ba d6 call 0x3ad74 ; 0x3ad74 <__mulsf3_pse> 3c250: 0f 92 push r0 3c252: 0f 92 push r0 3c254: 0f 92 push r0 3c256: 4d b7 in r20, 0x3d ; 61 3c258: 5e b7 in r21, 0x3e ; 62 3c25a: 0f 92 push r0 3c25c: 0f 94 b7 e1 call 0x3c36e ; 0x3c36e 3c260: e2 ed ldi r30, 0xD2 ; 210 3c262: f1 e7 ldi r31, 0x71 ; 113 3c264: 0f 94 0a df call 0x3be14 ; 0x3be14 <__fp_powser> 3c268: 4f 91 pop r20 3c26a: 5f 91 pop r21 3c26c: ef 91 pop r30 3c26e: ff 91 pop r31 3c270: e5 95 asr r30 3c272: ee 1f adc r30, r30 3c274: ff 1f adc r31, r31 3c276: 49 f0 breq .+18 ; 0x3c28a 3c278: fe 57 subi r31, 0x7E ; 126 3c27a: e0 68 ori r30, 0x80 ; 128 3c27c: 44 27 eor r20, r20 3c27e: ee 0f add r30, r30 3c280: 44 1f adc r20, r20 3c282: fa 95 dec r31 3c284: e1 f7 brne .-8 ; 0x3c27e 3c286: 41 95 neg r20 3c288: 55 0b sbc r21, r21 3c28a: 0f 94 06 e0 call 0x3c00c ; 0x3c00c 3c28e: 0f 90 pop r0 3c290: 07 fe sbrs r0, 7 3c292: 0d 94 fa df jmp 0x3bff4 ; 0x3bff4 3c296: 08 95 ret 0003c298 <__fp_norm2>: 3c298: 91 50 subi r25, 0x01 ; 1 3c29a: 50 40 sbci r21, 0x00 ; 0 3c29c: 66 0f add r22, r22 3c29e: 77 1f adc r23, r23 3c2a0: 88 1f adc r24, r24 3c2a2: d2 f7 brpl .-12 ; 0x3c298 <__fp_norm2> 3c2a4: 08 95 ret 0003c2a6 <__fp_powsodd>: 3c2a6: 9f 93 push r25 3c2a8: 8f 93 push r24 3c2aa: 7f 93 push r23 3c2ac: 6f 93 push r22 3c2ae: ff 93 push r31 3c2b0: ef 93 push r30 3c2b2: 9b 01 movw r18, r22 3c2b4: ac 01 movw r20, r24 3c2b6: 0f 94 a4 d6 call 0x3ad48 ; 0x3ad48 <__mulsf3> 3c2ba: ef 91 pop r30 3c2bc: ff 91 pop r31 3c2be: 0f 94 0a df call 0x3be14 ; 0x3be14 <__fp_powser> 3c2c2: 2f 91 pop r18 3c2c4: 3f 91 pop r19 3c2c6: 4f 91 pop r20 3c2c8: 5f 91 pop r21 3c2ca: 0d 94 a4 d6 jmp 0x3ad48 ; 0x3ad48 <__mulsf3> 3c2ce: 16 f0 brts .+4 ; 0x3c2d4 <__fp_powsodd+0x2e> 3c2d0: 0d 94 fc de jmp 0x3bdf8 ; 0x3bdf8 <__fp_mpack> 3c2d4: 0d 94 17 d7 jmp 0x3ae2e ; 0x3ae2e <__fp_nan> 3c2d8: 68 94 set 3c2da: 0d 94 11 d7 jmp 0x3ae22 ; 0x3ae22 <__fp_inf> 0003c2de : 3c2de: 0f 94 41 d7 call 0x3ae82 ; 0x3ae82 <__fp_splitA> 3c2e2: a8 f3 brcs .-22 ; 0x3c2ce <__fp_powsodd+0x28> 3c2e4: 99 23 and r25, r25 3c2e6: c1 f3 breq .-16 ; 0x3c2d8 <__fp_powsodd+0x32> 3c2e8: ae f3 brts .-22 ; 0x3c2d4 <__fp_powsodd+0x2e> 3c2ea: df 93 push r29 3c2ec: cf 93 push r28 3c2ee: 1f 93 push r17 3c2f0: 0f 93 push r16 3c2f2: ff 92 push r15 3c2f4: c9 2f mov r28, r25 3c2f6: dd 27 eor r29, r29 3c2f8: 88 23 and r24, r24 3c2fa: 2a f0 brmi .+10 ; 0x3c306 3c2fc: 21 97 sbiw r28, 0x01 ; 1 3c2fe: 66 0f add r22, r22 3c300: 77 1f adc r23, r23 3c302: 88 1f adc r24, r24 3c304: da f7 brpl .-10 ; 0x3c2fc 3c306: 20 e0 ldi r18, 0x00 ; 0 3c308: 30 e0 ldi r19, 0x00 ; 0 3c30a: 40 e8 ldi r20, 0x80 ; 128 3c30c: 5f eb ldi r21, 0xBF ; 191 3c30e: 9f e3 ldi r25, 0x3F ; 63 3c310: 88 39 cpi r24, 0x98 ; 152 3c312: 20 f0 brcs .+8 ; 0x3c31c 3c314: 80 3e cpi r24, 0xE0 ; 224 3c316: 38 f0 brcs .+14 ; 0x3c326 3c318: 21 96 adiw r28, 0x01 ; 1 3c31a: 8f 77 andi r24, 0x7F ; 127 3c31c: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 3c320: ea ef ldi r30, 0xFA ; 250 3c322: f1 e7 ldi r31, 0x71 ; 113 3c324: 04 c0 rjmp .+8 ; 0x3c32e 3c326: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe <__addsf3> 3c32a: e7 e2 ldi r30, 0x27 ; 39 3c32c: f2 e7 ldi r31, 0x72 ; 114 3c32e: 0f 94 0a df call 0x3be14 ; 0x3be14 <__fp_powser> 3c332: 8b 01 movw r16, r22 3c334: be 01 movw r22, r28 3c336: ec 01 movw r28, r24 3c338: fb 2e mov r15, r27 3c33a: 6f 57 subi r22, 0x7F ; 127 3c33c: 71 09 sbc r23, r1 3c33e: 75 95 asr r23 3c340: 77 1f adc r23, r23 3c342: 88 0b sbc r24, r24 3c344: 99 0b sbc r25, r25 3c346: 0f 94 65 d6 call 0x3acca ; 0x3acca <__floatsisf> 3c34a: 28 e1 ldi r18, 0x18 ; 24 3c34c: 32 e7 ldi r19, 0x72 ; 114 3c34e: 41 e3 ldi r20, 0x31 ; 49 3c350: 5f e3 ldi r21, 0x3F ; 63 3c352: 0f 94 b7 d6 call 0x3ad6e ; 0x3ad6e <__mulsf3x> 3c356: af 2d mov r26, r15 3c358: 98 01 movw r18, r16 3c35a: ae 01 movw r20, r28 3c35c: ff 90 pop r15 3c35e: 0f 91 pop r16 3c360: 1f 91 pop r17 3c362: cf 91 pop r28 3c364: df 91 pop r29 3c366: 0f 94 16 dd call 0x3ba2c ; 0x3ba2c <__addsf3x> 3c36a: 0d 94 28 d7 jmp 0x3ae50 ; 0x3ae50 <__fp_round> 0003c36e : 3c36e: fa 01 movw r30, r20 3c370: dc 01 movw r26, r24 3c372: aa 0f add r26, r26 3c374: bb 1f adc r27, r27 3c376: 9b 01 movw r18, r22 3c378: ac 01 movw r20, r24 3c37a: bf 57 subi r27, 0x7F ; 127 3c37c: 28 f4 brcc .+10 ; 0x3c388 3c37e: 22 27 eor r18, r18 3c380: 33 27 eor r19, r19 3c382: 44 27 eor r20, r20 3c384: 50 78 andi r21, 0x80 ; 128 3c386: 20 c0 rjmp .+64 ; 0x3c3c8 3c388: b7 51 subi r27, 0x17 ; 23 3c38a: 90 f4 brcc .+36 ; 0x3c3b0 3c38c: ab 2f mov r26, r27 3c38e: 00 24 eor r0, r0 3c390: 46 95 lsr r20 3c392: 37 95 ror r19 3c394: 27 95 ror r18 3c396: 01 1c adc r0, r1 3c398: a3 95 inc r26 3c39a: d2 f3 brmi .-12 ; 0x3c390 3c39c: 00 20 and r0, r0 3c39e: 71 f0 breq .+28 ; 0x3c3bc 3c3a0: 22 0f add r18, r18 3c3a2: 33 1f adc r19, r19 3c3a4: 44 1f adc r20, r20 3c3a6: b3 95 inc r27 3c3a8: da f3 brmi .-10 ; 0x3c3a0 3c3aa: 0e d0 rcall .+28 ; 0x3c3c8 3c3ac: 0d 94 fe dc jmp 0x3b9fc ; 0x3b9fc <__subsf3> 3c3b0: 61 30 cpi r22, 0x01 ; 1 3c3b2: 71 05 cpc r23, r1 3c3b4: a0 e8 ldi r26, 0x80 ; 128 3c3b6: 8a 07 cpc r24, r26 3c3b8: b9 46 sbci r27, 0x69 ; 105 3c3ba: 30 f4 brcc .+12 ; 0x3c3c8 3c3bc: 9b 01 movw r18, r22 3c3be: ac 01 movw r20, r24 3c3c0: 66 27 eor r22, r22 3c3c2: 77 27 eor r23, r23 3c3c4: 88 27 eor r24, r24 3c3c6: 90 78 andi r25, 0x80 ; 128 3c3c8: 30 96 adiw r30, 0x00 ; 0 3c3ca: 21 f0 breq .+8 ; 0x3c3d4 3c3cc: 20 83 st Z, r18 3c3ce: 31 83 std Z+1, r19 ; 0x01 3c3d0: 42 83 std Z+2, r20 ; 0x02 3c3d2: 53 83 std Z+3, r21 ; 0x03 3c3d4: 08 95 ret 0003c3d6 : 3c3d6: 91 11 cpse r25, r1 3c3d8: 08 95 ret 3c3da: 81 54 subi r24, 0x41 ; 65 3c3dc: 8a 51 subi r24, 0x1A ; 26 3c3de: 08 f4 brcc .+2 ; 0x3c3e2 3c3e0: 80 5e subi r24, 0xE0 ; 224 3c3e2: 85 5a subi r24, 0xA5 ; 165 3c3e4: 08 95 ret 0003c3e6 : 3c3e6: fb 01 movw r30, r22 3c3e8: dc 01 movw r26, r24 3c3ea: 04 c0 rjmp .+8 ; 0x3c3f4 3c3ec: 8d 91 ld r24, X+ 3c3ee: 01 90 ld r0, Z+ 3c3f0: 80 19 sub r24, r0 3c3f2: 21 f4 brne .+8 ; 0x3c3fc 3c3f4: 41 50 subi r20, 0x01 ; 1 3c3f6: 50 40 sbci r21, 0x00 ; 0 3c3f8: c8 f7 brcc .-14 ; 0x3c3ec 3c3fa: 88 1b sub r24, r24 3c3fc: 99 0b sbc r25, r25 3c3fe: 08 95 ret 0003c400 : 3c400: fb 01 movw r30, r22 3c402: dc 01 movw r26, r24 3c404: 02 c0 rjmp .+4 ; 0x3c40a 3c406: 01 90 ld r0, Z+ 3c408: 0d 92 st X+, r0 3c40a: 41 50 subi r20, 0x01 ; 1 3c40c: 50 40 sbci r21, 0x00 ; 0 3c40e: d8 f7 brcc .-10 ; 0x3c406 3c410: 08 95 ret 0003c412 : 3c412: dc 01 movw r26, r24 3c414: 01 c0 rjmp .+2 ; 0x3c418 3c416: 6d 93 st X+, r22 3c418: 41 50 subi r20, 0x01 ; 1 3c41a: 50 40 sbci r21, 0x00 ; 0 3c41c: e0 f7 brcc .-8 ; 0x3c416 3c41e: 08 95 ret 0003c420 : 3c420: fb 01 movw r30, r22 3c422: dc 01 movw r26, r24 3c424: 8d 91 ld r24, X+ 3c426: 81 34 cpi r24, 0x41 ; 65 3c428: 1c f0 brlt .+6 ; 0x3c430 3c42a: 8b 35 cpi r24, 0x5B ; 91 3c42c: 0c f4 brge .+2 ; 0x3c430 3c42e: 80 5e subi r24, 0xE0 ; 224 3c430: 61 91 ld r22, Z+ 3c432: 61 34 cpi r22, 0x41 ; 65 3c434: 1c f0 brlt .+6 ; 0x3c43c 3c436: 6b 35 cpi r22, 0x5B ; 91 3c438: 0c f4 brge .+2 ; 0x3c43c 3c43a: 60 5e subi r22, 0xE0 ; 224 3c43c: 86 1b sub r24, r22 3c43e: 61 11 cpse r22, r1 3c440: 89 f3 breq .-30 ; 0x3c424 3c442: 99 0b sbc r25, r25 3c444: 08 95 ret 0003c446 : 3c446: fb 01 movw r30, r22 3c448: dc 01 movw r26, r24 3c44a: 0d 90 ld r0, X+ 3c44c: 00 20 and r0, r0 3c44e: e9 f7 brne .-6 ; 0x3c44a 3c450: 11 97 sbiw r26, 0x01 ; 1 3c452: 01 90 ld r0, Z+ 3c454: 0d 92 st X+, r0 3c456: 00 20 and r0, r0 3c458: e1 f7 brne .-8 ; 0x3c452 3c45a: 08 95 ret 0003c45c : 3c45c: fc 01 movw r30, r24 3c45e: 81 91 ld r24, Z+ 3c460: 86 17 cp r24, r22 3c462: 21 f0 breq .+8 ; 0x3c46c 3c464: 88 23 and r24, r24 3c466: d9 f7 brne .-10 ; 0x3c45e 3c468: 99 27 eor r25, r25 3c46a: 08 95 ret 3c46c: 31 97 sbiw r30, 0x01 ; 1 3c46e: cf 01 movw r24, r30 3c470: 08 95 ret 0003c472 : 3c472: fb 01 movw r30, r22 3c474: dc 01 movw r26, r24 3c476: 8d 91 ld r24, X+ 3c478: 01 90 ld r0, Z+ 3c47a: 80 19 sub r24, r0 3c47c: 01 10 cpse r0, r1 3c47e: d9 f3 breq .-10 ; 0x3c476 3c480: 99 0b sbc r25, r25 3c482: 08 95 ret 0003c484 : 3c484: fb 01 movw r30, r22 3c486: dc 01 movw r26, r24 3c488: 01 90 ld r0, Z+ 3c48a: 0d 92 st X+, r0 3c48c: 00 20 and r0, r0 3c48e: e1 f7 brne .-8 ; 0x3c488 3c490: 08 95 ret 0003c492 : 3c492: fb 01 movw r30, r22 3c494: dc 01 movw r26, r24 3c496: 41 50 subi r20, 0x01 ; 1 3c498: 50 40 sbci r21, 0x00 ; 0 3c49a: 30 f0 brcs .+12 ; 0x3c4a8 3c49c: 8d 91 ld r24, X+ 3c49e: 01 90 ld r0, Z+ 3c4a0: 80 19 sub r24, r0 3c4a2: 19 f4 brne .+6 ; 0x3c4aa 3c4a4: 00 20 and r0, r0 3c4a6: b9 f7 brne .-18 ; 0x3c496 3c4a8: 88 1b sub r24, r24 3c4aa: 99 0b sbc r25, r25 3c4ac: 08 95 ret 0003c4ae : 3c4ae: fb 01 movw r30, r22 3c4b0: dc 01 movw r26, r24 3c4b2: 41 50 subi r20, 0x01 ; 1 3c4b4: 50 40 sbci r21, 0x00 ; 0 3c4b6: 48 f0 brcs .+18 ; 0x3c4ca 3c4b8: 01 90 ld r0, Z+ 3c4ba: 0d 92 st X+, r0 3c4bc: 00 20 and r0, r0 3c4be: c9 f7 brne .-14 ; 0x3c4b2 3c4c0: 01 c0 rjmp .+2 ; 0x3c4c4 3c4c2: 1d 92 st X+, r1 3c4c4: 41 50 subi r20, 0x01 ; 1 3c4c6: 50 40 sbci r21, 0x00 ; 0 3c4c8: e0 f7 brcc .-8 ; 0x3c4c2 3c4ca: 08 95 ret 0003c4cc : 3c4cc: 0f 93 push r16 3c4ce: 1f 93 push r17 3c4d0: cf 93 push r28 3c4d2: df 93 push r29 3c4d4: e0 91 1b 18 lds r30, 0x181B ; 0x80181b <__iob+0x2> 3c4d8: f0 91 1c 18 lds r31, 0x181C ; 0x80181c <__iob+0x3> 3c4dc: 23 81 ldd r18, Z+3 ; 0x03 3c4de: ec 01 movw r28, r24 3c4e0: 10 e0 ldi r17, 0x00 ; 0 3c4e2: 00 e0 ldi r16, 0x00 ; 0 3c4e4: 21 fd sbrc r18, 1 3c4e6: 08 c0 rjmp .+16 ; 0x3c4f8 3c4e8: 0f ef ldi r16, 0xFF ; 255 3c4ea: 1f ef ldi r17, 0xFF ; 255 3c4ec: 14 c0 rjmp .+40 ; 0x3c516 3c4ee: 19 95 eicall 3c4f0: 89 2b or r24, r25 3c4f2: 11 f0 breq .+4 ; 0x3c4f8 3c4f4: 0f ef ldi r16, 0xFF ; 255 3c4f6: 1f ef ldi r17, 0xFF ; 255 3c4f8: 89 91 ld r24, Y+ 3c4fa: 60 91 1b 18 lds r22, 0x181B ; 0x80181b <__iob+0x2> 3c4fe: 70 91 1c 18 lds r23, 0x181C ; 0x80181c <__iob+0x3> 3c502: db 01 movw r26, r22 3c504: 18 96 adiw r26, 0x08 ; 8 3c506: ed 91 ld r30, X+ 3c508: fc 91 ld r31, X 3c50a: 81 11 cpse r24, r1 3c50c: f0 cf rjmp .-32 ; 0x3c4ee 3c50e: 8a e0 ldi r24, 0x0A ; 10 3c510: 19 95 eicall 3c512: 89 2b or r24, r25 3c514: 49 f7 brne .-46 ; 0x3c4e8 3c516: c8 01 movw r24, r16 3c518: df 91 pop r29 3c51a: cf 91 pop r28 3c51c: 1f 91 pop r17 3c51e: 0f 91 pop r16 3c520: 08 95 ret 0003c522 <__do_global_dtors>: 3c522: 16 e5 ldi r17, 0x56 ; 86 3c524: cd ec ldi r28, 0xCD ; 205 3c526: d6 e5 ldi r29, 0x56 ; 86 3c528: 00 e0 ldi r16, 0x00 ; 0 3c52a: 06 c0 rjmp .+12 ; 0x3c538 <__do_global_dtors+0x16> 3c52c: 80 2f mov r24, r16 3c52e: fe 01 movw r30, r28 3c530: 0f 94 e7 dc call 0x3b9ce ; 0x3b9ce <__tablejump2__> 3c534: 21 96 adiw r28, 0x01 ; 1 3c536: 01 1d adc r16, r1 3c538: ce 3c cpi r28, 0xCE ; 206 3c53a: d1 07 cpc r29, r17 3c53c: 80 e0 ldi r24, 0x00 ; 0 3c53e: 08 07 cpc r16, r24 3c540: a9 f7 brne .-22 ; 0x3c52c <__do_global_dtors+0xa> 3c542: f8 94 cli 0003c544 <__stop_program>: 3c544: ff cf rjmp .-2 ; 0x3c544 <__stop_program>