MK3-E3DREVO_lang_base: file format elf32-avr Disassembly of section .text: 00000000 <__vectors>: 0: 0c 94 b6 56 jmp 0xad6c ; 0xad6c <__dtors_end> 4: 0c 94 e7 56 jmp 0xadce ; 0xadce <__bad_interrupt> 8: 0c 94 e7 56 jmp 0xadce ; 0xadce <__bad_interrupt> c: 0c 94 e7 56 jmp 0xadce ; 0xadce <__bad_interrupt> 10: 0c 94 e7 56 jmp 0xadce ; 0xadce <__bad_interrupt> 14: 0d 94 37 5f jmp 0x2be6e ; 0x2be6e <__vector_5> 18: 0c 94 e7 56 jmp 0xadce ; 0xadce <__bad_interrupt> 1c: 0c 94 e7 56 jmp 0xadce ; 0xadce <__bad_interrupt> 20: 0c 94 ee 74 jmp 0xe9dc ; 0xe9dc <__vector_8> 24: 0c 94 e7 56 jmp 0xadce ; 0xadce <__bad_interrupt> 28: 0c 94 e7 56 jmp 0xadce ; 0xadce <__bad_interrupt> 2c: 0c 94 e7 56 jmp 0xadce ; 0xadce <__bad_interrupt> 30: 0c 94 73 67 jmp 0xcee6 ; 0xcee6 <__vector_12> 34: 0c 94 e7 56 jmp 0xadce ; 0xadce <__bad_interrupt> 38: 0d 94 d6 32 jmp 0x265ac ; 0x265ac <__vector_14> 3c: 0d 94 63 2c jmp 0x258c6 ; 0x258c6 <__vector_15> 40: 0c 94 e7 56 jmp 0xadce ; 0xadce <__bad_interrupt> 44: 0d 94 5e 43 jmp 0x286bc ; 0x286bc <__vector_17> 48: 0c 94 e7 56 jmp 0xadce ; 0xadce <__bad_interrupt> 4c: 0c 94 e7 56 jmp 0xadce ; 0xadce <__bad_interrupt> 50: 0c 94 e7 56 jmp 0xadce ; 0xadce <__bad_interrupt> 54: 0c 94 e7 56 jmp 0xadce ; 0xadce <__bad_interrupt> 58: 0c 94 e7 56 jmp 0xadce ; 0xadce <__bad_interrupt> 5c: 0c 94 22 74 jmp 0xe844 ; 0xe844 <__vector_23> 60: 0c 94 e7 56 jmp 0xadce ; 0xadce <__bad_interrupt> 64: 0d 94 64 d6 jmp 0x3acc8 ; 0x3acc8 <__vector_25> 68: 0c 94 e7 56 jmp 0xadce ; 0xadce <__bad_interrupt> 6c: 0c 94 e7 56 jmp 0xadce ; 0xadce <__bad_interrupt> 70: 0c 94 e7 56 jmp 0xadce ; 0xadce <__bad_interrupt> 74: 0c 94 3f 8d jmp 0x11a7e ; 0x11a7e <__vector_29> 78: 0c 94 e7 56 jmp 0xadce ; 0xadce <__bad_interrupt> 7c: 0c 94 e7 56 jmp 0xadce ; 0xadce <__bad_interrupt> 80: 0c 94 e7 56 jmp 0xadce ; 0xadce <__bad_interrupt> 84: 0c 94 e7 56 jmp 0xadce ; 0xadce <__bad_interrupt> 88: 0c 94 e7 56 jmp 0xadce ; 0xadce <__bad_interrupt> 8c: 0c 94 e7 56 jmp 0xadce ; 0xadce <__bad_interrupt> 90: 0d 94 20 d6 jmp 0x3ac40 ; 0x3ac40 <__vector_36> 94: 0c 94 e7 56 jmp 0xadce ; 0xadce <__bad_interrupt> 98: 0c 94 e7 56 jmp 0xadce ; 0xadce <__bad_interrupt> 9c: 0c 94 e7 56 jmp 0xadce ; 0xadce <__bad_interrupt> a0: 0c 94 e7 56 jmp 0xadce ; 0xadce <__bad_interrupt> a4: 0c 94 e7 56 jmp 0xadce ; 0xadce <__bad_interrupt> a8: 0d 94 7d 22 jmp 0x244fa ; 0x244fa <__vector_42> ac: 0c 94 e7 56 jmp 0xadce ; 0xadce <__bad_interrupt> b0: 0c 94 e7 56 jmp 0xadce ; 0xadce <__bad_interrupt> b4: 0d 94 5f 22 jmp 0x244be ; 0x244be <__vector_45> b8: 0c 94 e7 56 jmp 0xadce ; 0xadce <__bad_interrupt> bc: 0d 94 20 38 jmp 0x27040 ; 0x27040 <__vector_47> c0: 0c 94 e7 56 jmp 0xadce ; 0xadce <__bad_interrupt> c4: 0c 94 e7 56 jmp 0xadce ; 0xadce <__bad_interrupt> c8: 0c 94 e7 56 jmp 0xadce ; 0xadce <__bad_interrupt> cc: 0d 94 1f 22 jmp 0x2443e ; 0x2443e <__vector_51> d0: 0c 94 e7 56 jmp 0xadce ; 0xadce <__bad_interrupt> d4: 0c 94 e7 56 jmp 0xadce ; 0xadce <__bad_interrupt> d8: 0c 94 e7 56 jmp 0xadce ; 0xadce <__bad_interrupt> dc: 0c 94 e7 56 jmp 0xadce ; 0xadce <__bad_interrupt> e0: 0c 94 e7 56 jmp 0xadce ; 0xadce <__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 41 6c 70 68 61 62 65 74 00 ..Alphabet. 0000447a : 447a: ff ff 53 6f 72 74 00 ..Sort. 00004481 : 4481: ff ff 54 69 6d 65 00 ..Time. 00004488 : 4488: ff ff 4e 6f 72 6d 61 6c 00 ..Normal. 00004491 : 4491: ff ff 53 44 20 63 61 72 64 00 ..SD card. 0000449b : 449b: ff ff 53 65 6c 65 63 74 20 6c 61 6e 67 75 61 67 ..Select languag 44ab: 65 00 e. 000044ad : 44ad: ff ff 52 50 69 20 70 6f 72 74 00 ..RPi port. 000044b8 : 44b8: ff ff 4c 69 6e 2e 20 63 6f 72 72 65 63 74 69 6f ..Lin. correctio 44c8: 6e 00 n. 000044ca : 44ca: ff ff 48 57 20 53 65 74 75 70 00 ..HW Setup. 000044d5 : 44d5: ff ff 4c 6f 61 64 69 6e 67 20 54 65 73 74 00 ..Loading Test. 000044e4 : 44e4: ff ff 44 69 73 61 62 6c 65 20 73 74 65 70 70 65 ..Disable steppe 44f4: 72 73 00 rs. 000044f7 : 44f7: ff ff 4d 6f 76 65 20 61 78 69 73 00 ..Move axis. 00004503 : 4503: ff ff 54 65 6d 70 65 72 61 74 75 72 65 00 ..Temperature. 00004511 : 4511: ff ff 50 49 4e 44 41 20 63 61 6c 2e 00 ..PINDA cal.. 0000451e : 451e: ff ff 52 65 73 65 74 20 58 59 5a 20 63 61 6c 69 ..Reset XYZ cali 452e: 62 72 2e 00 br.. 00004532 : 4532: ff ff 50 49 44 20 63 61 6c 69 62 72 61 74 69 6f ..PID calibratio 4542: 6e 00 n. 00004544 : 4544: ff ff 42 65 64 20 6c 65 76 65 6c 20 63 6f 72 72 ..Bed level corr 4554: 65 63 74 00 ect. 00004558 : 4558: ff ff 4d 65 73 68 20 42 65 64 20 4c 65 76 65 6c ..Mesh Bed Level 4568: 69 6e 67 00 ing. 0000456c : 456c: ff ff 43 61 6c 69 62 72 61 74 65 20 5a 00 ..Calibrate Z. 0000457a : 457a: ff ff 43 61 6c 69 62 72 61 74 65 20 58 59 5a 00 ..Calibrate XYZ. 0000458a : 458a: ff ff 53 65 6c 66 74 65 73 74 00 ..Selftest. 00004595 : 4595: ff ff 42 65 6c 74 20 74 65 73 74 00 ..Belt test. 000045a1 : 45a1: ff ff 57 69 7a 61 72 64 00 ..Wizard. 000045aa : 45aa: ff ff 54 65 73 74 69 6e 67 20 66 69 6c 61 6d 65 ..Testing filame 45ba: 6e 74 00 nt. 000045bd : 45bd: ff ff 4c 6f 61 64 20 41 6c 6c 00 ..Load All. 000045c8 : 45c8: ff ff 50 6c 65 61 73 65 20 70 75 6c 6c 20 6f 75 ..Please pull ou 45d8: 74 20 66 69 6c 61 6d 65 6e 74 20 69 6d 6d 65 64 t filament immed 45e8: 69 61 74 65 6c 79 00 iately. 000045ef : 45ef: ff ff 52 65 73 65 74 00 ..Reset. 000045f7 : 45f7: ff ff 52 65 6e 61 6d 65 00 ..Rename. 00004600 : 4600: ff ff 46 69 72 73 74 20 6c 61 79 65 72 20 63 61 ..First layer ca 4610: 6c 2e 00 l.. 00004613 : 4613: ff ff 53 65 6c 65 63 74 00 ..Select. 0000461c : 461c: ff ff 53 74 65 65 6c 20 73 68 65 65 74 73 00 ..Steel sheets. 0000462b : 462b: ff ff 53 75 70 70 6f 72 74 00 ..Support. 00004635 : 4635: ff ff 46 61 69 6c 20 73 74 61 74 73 20 4d 4d 55 ..Fail stats MMU ... 00004646 : 4646: ff ff 46 61 69 6c 20 73 74 61 74 73 00 ..Fail stats. 00004653 : 4653: ff ff 53 74 61 74 69 73 74 69 63 73 00 ..Statistics. 00004660 : 4660: ff ff 43 61 6c 69 62 72 61 74 69 6f 6e 00 ..Calibration. 0000466e : 466e: ff ff 41 75 74 6f 4c 6f 61 64 20 66 69 6c 61 6d ..AutoLoad filam 467e: 65 6e 74 00 ent. 00004682 : 4682: ff ff 4c 6f 61 64 20 66 69 6c 61 6d 65 6e 74 00 ..Load filament. 00004692 : 4692: ff ff 55 6e 6c 6f 61 64 20 66 69 6c 61 6d 65 6e ..Unload filamen 46a2: 74 00 t. 000046a4 : 46a4: ff ff 4c 6f 61 64 20 74 6f 20 6e 6f 7a 7a 6c 65 ..Load to nozzle ... 000046b5 : 46b5: ff ff 50 72 65 6c 6f 61 64 20 74 6f 20 4d 4d 55 ..Preload to MMU ... 000046c6 : 46c6: ff ff 4e 6f 7a 7a 6c 65 20 64 2e 00 ..Nozzle d.. 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 4e 6f 7a 7a 6c 65 20 63 68 61 6e 67 65 64 ..Nozzle changed 49ea: 3f 00 ?. 000049ec : 49ec: ff ff 4e 6f 7a 7a 6c 65 20 69 73 20 68 6f 74 21 ..Nozzle is hot! 49fc: 20 57 61 69 74 20 66 6f 72 20 63 6f 6f 6c 64 6f Wait for cooldo 4a0c: 77 6e 2e 00 wn.. 00004a10 : 4a10: ff ff 50 49 44 20 63 61 6c 2e 20 66 69 6e 69 73 ..PID cal. finis 4a20: 68 65 64 00 hed. 00004a24 : 4a24: ff ff 50 49 44 20 63 61 6c 2e 00 ..PID cal.. 00004a2f : 4a2f: ff ff 50 72 69 6e 74 20 70 61 75 73 65 64 00 ..Print paused. 00004a3e : 4a3e: ff ff 50 72 69 6e 74 20 61 62 6f 72 74 65 64 00 ..Print aborted. 00004a4e : 4a4e: ff ff 4e 6f 7a 7a 6c 65 20 64 69 61 6d 65 74 65 ..Nozzle diamete 4a5e: 72 20 64 69 66 66 65 72 73 20 66 72 6f 6d 20 74 r differs from t 4a6e: 68 65 20 47 2d 63 6f 64 65 2e 20 43 6f 6e 74 69 he G-code. Conti 4a7e: 6e 75 65 3f 00 nue?. 00004a83 : 4a83: ff ff 4e 6f 7a 7a 6c 65 20 64 69 61 6d 65 74 65 ..Nozzle diamete 4a93: 72 20 64 69 66 66 65 72 73 20 66 72 6f 6d 20 74 r differs from t 4aa3: 68 65 20 47 2d 63 6f 64 65 2e 20 50 6c 65 61 73 he G-code. Pleas 4ab3: 65 20 63 68 65 63 6b 20 74 68 65 20 76 61 6c 75 e check the valu 4ac3: 65 20 69 6e 20 73 65 74 74 69 6e 67 73 2e 20 50 e in settings. P 4ad3: 72 69 6e 74 20 63 61 6e 63 65 6c 6c 65 64 2e 00 rint cancelled.. 00004ae3 : 4ae3: ff ff 54 68 65 72 65 20 69 73 20 6e 6f 20 66 69 ..There is no fi 4af3: 6c 61 6d 65 6e 74 20 6c 6f 61 64 65 64 2e 20 43 lament loaded. C 4b03: 6f 6e 74 69 6e 75 65 3f 00 ontinue?. 00004b0c : 4b0c: ff ff 54 68 65 72 65 20 69 73 20 6e 6f 20 66 69 ..There is no fi 4b1c: 6c 61 6d 65 6e 74 20 6c 6f 61 64 65 64 2e 20 50 lament loaded. P 4b2c: 72 69 6e 74 20 63 61 6e 63 65 6c 6c 65 64 2e 00 rint cancelled.. 00004b3c : 4b3c: ff ff 4d 4b 33 20 66 69 72 6d 77 61 72 65 20 64 ..MK3 firmware d 4b4c: 65 74 65 63 74 65 64 20 6f 6e 20 4d 4b 33 53 20 etected on MK3S 4b5c: 70 72 69 6e 74 65 72 00 printer. 00004b64 : 4b64: ff ff 42 6c 61 63 6b 6f 75 74 20 6f 63 63 75 72 ..Blackout occur 4b74: 72 65 64 2e 20 52 65 63 6f 76 65 72 20 70 72 69 red. Recover pri 4b84: 6e 74 3f 00 nt?. 00004b88 : 4b88: ff ff 54 68 65 72 6d 61 6c 20 6d 6f 64 65 6c 20 ..Thermal model 4b98: 6e 6f 74 20 63 61 6c 69 62 72 61 74 65 64 20 79 not calibrated y 4ba8: 65 74 2e 00 et.. 00004bac : 4bac: ff ff 54 68 65 72 65 20 69 73 20 73 74 69 6c 6c ..There is still 4bbc: 20 61 20 6e 65 65 64 20 74 6f 20 6d 61 6b 65 20 a need to make 4bcc: 5a 20 63 61 6c 69 62 72 61 74 69 6f 6e 2e 20 50 Z calibration. P 4bdc: 6c 65 61 73 65 20 66 6f 6c 6c 6f 77 20 74 68 65 lease follow the 4bec: 20 6d 61 6e 75 61 6c 2c 20 63 68 61 70 74 65 72 manual, chapter 4bfc: 20 46 69 72 73 74 20 73 74 65 70 73 2c 20 73 65 First steps, se 4c0c: 63 74 69 6f 6e 20 43 61 6c 69 62 72 61 74 69 6f ction Calibratio 4c1c: 6e 20 66 6c 6f 77 2e 00 n flow.. 00004c24 : 4c24: ff ff 50 72 69 6e 74 65 72 20 68 61 73 20 6e 6f ..Printer has no 4c34: 74 20 62 65 65 6e 20 63 61 6c 69 62 72 61 74 65 t been calibrate 4c44: 64 20 79 65 74 2e 20 50 6c 65 61 73 65 20 66 6f d yet. Please fo 4c54: 6c 6c 6f 77 20 74 68 65 20 6d 61 6e 75 61 6c 2c llow the manual, 4c64: 20 63 68 61 70 74 65 72 20 46 69 72 73 74 20 73 chapter First s 4c74: 74 65 70 73 2c 20 73 65 63 74 69 6f 6e 20 43 61 teps, section Ca 4c84: 6c 69 62 72 61 74 69 6f 6e 20 66 6c 6f 77 2e 00 libration flow.. 00004c94 : 4c94: ff ff 53 65 6c 66 74 65 73 74 20 77 69 6c 6c 20 ..Selftest will 4ca4: 62 65 20 72 75 6e 20 74 6f 20 63 61 6c 69 62 72 be run to calibr 4cb4: 61 74 65 20 61 63 63 75 72 61 74 65 20 73 65 6e ate accurate sen 4cc4: 73 6f 72 6c 65 73 73 20 72 65 68 6f 6d 69 6e 67 sorless rehoming 4cd4: 2e 00 .. 00004cd6 : 4cd6: ff ff 4f 6c 64 20 73 65 74 74 69 6e 67 73 20 66 ..Old settings f 4ce6: 6f 75 6e 64 2e 20 44 65 66 61 75 6c 74 20 50 49 ound. Default PI 4cf6: 44 2c 20 45 73 74 65 70 73 20 65 74 63 2e 20 77 D, Esteps etc. w 4d06: 69 6c 6c 20 62 65 20 73 65 74 2e 00 ill be set.. 00004d12 : 4d12: ff ff 57 61 72 6e 69 6e 67 3a 20 62 6f 74 68 20 ..Warning: both 4d22: 70 72 69 6e 74 65 72 20 74 79 70 65 20 61 6e 64 printer type and 4d32: 20 6d 6f 74 68 65 72 62 6f 61 72 64 20 74 79 70 motherboard typ 4d42: 65 20 63 68 61 6e 67 65 64 2e 00 e changed.. 00004d4d : 4d4d: ff ff 57 61 72 6e 69 6e 67 3a 20 70 72 69 6e 74 ..Warning: print 4d5d: 65 72 20 74 79 70 65 20 63 68 61 6e 67 65 64 2e er type changed. ... 00004d6e : 4d6e: ff ff 57 61 72 6e 69 6e 67 3a 20 6d 6f 74 68 65 ..Warning: mothe 4d7e: 72 62 6f 61 72 64 20 74 79 70 65 20 63 68 61 6e rboard type chan 4d8e: 67 65 64 2e 00 ged.. 00004d93 : 4d93: ff ff 53 68 65 65 74 00 ..Sheet. 00004d9b : 4d9b: ff ff 52 65 63 6f 76 65 72 69 6e 67 20 70 72 69 ..Recovering pri 4dab: 6e 74 00 nt. 00004dae : 4dae: ff ff 54 48 45 52 4d 41 4c 20 41 4e 4f 4d 41 4c ..THERMAL ANOMAL 4dbe: 59 00 Y. 00004dc0 : 4dc0: ff ff 52 65 73 75 6d 69 6e 67 20 70 72 69 6e 74 ..Resuming print ... 00004dd1 : 4dd1: ff ff 50 49 4e 44 41 20 48 65 61 74 69 6e 67 00 ..PINDA Heating. 00004de1 : 4de1: ff ff 43 61 6c 69 62 72 61 74 69 6f 6e 20 64 6f ..Calibration do 4df1: 6e 65 00 ne. 00004df4 : 4df4: ff ff 43 61 6c 69 62 72 61 74 69 6e 67 20 5a 00 ..Calibrating Z. 00004e04 : 4e04: ff ff 42 65 64 20 64 6f 6e 65 00 ..Bed done. 00004e0f : 4e0f: ff ff 42 65 64 20 48 65 61 74 69 6e 67 00 ..Bed Heating. 00004e1d : 4e1d: ff ff 48 65 61 74 69 6e 67 20 64 6f 6e 65 2e 00 ..Heating done.. 00004e2d : 4e2d: ff ff 48 65 61 74 69 6e 67 00 ..Heating. 00004e37 : 4e37: ff ff 4d 4d 55 20 66 61 69 6c 73 00 ..MMU fails. 00004e43 : 4e43: ff ff 4d 4d 55 20 6c 6f 61 64 20 66 61 69 6c 73 ..MMU load fails ... 00004e54 : 4e54: ff ff 4d 4d 55 20 70 6f 77 65 72 20 66 61 69 6c ..MMU power fail 4e64: 73 00 s. 00004e66 : 4e66: ff ff 4d 61 74 65 72 69 61 6c 20 63 68 61 6e 67 ..Material chang 4e76: 65 73 00 es. 00004e79 : 4e79: ff ff 54 6f 74 61 6c 20 66 61 69 6c 75 72 65 73 ..Total failures ... 00004e8a : 4e8a: ff ff 4c 61 73 74 20 70 72 69 6e 74 20 66 61 69 ..Last print fai 4e9a: 6c 75 72 65 73 00 lures. 00004ea0 : 4ea0: ff ff 50 6f 77 65 72 20 66 61 69 6c 75 72 65 73 ..Power failures ... 00004eb1 : 4eb1: ff ff 46 69 6c 2e 20 72 75 6e 6f 75 74 73 00 ..Fil. runouts. 00004ec0 : 4ec0: ff ff 43 72 61 73 68 00 ..Crash. 00004ec8 : 4ec8: ff ff 54 6f 74 61 6c 00 ..Total. 00004ed0 : 4ed0: ff ff 4c 61 73 74 20 70 72 69 6e 74 00 ..Last print. 00004edd : 4edd: ff ff 41 6d 62 69 65 6e 74 00 ..Ambient. 00004ee7 : 4ee7: ff ff 56 6f 6c 74 61 67 65 73 00 ..Voltages. 00004ef2 : 4ef2: ff ff 54 65 6d 70 65 72 61 74 75 72 65 73 00 ..Temperatures. 00004f01 : 4f01: ff ff 42 65 6c 74 20 73 74 61 74 75 73 00 ..Belt status. 00004f0f : 4f0f: ff ff 53 65 6e 73 6f 72 20 69 6e 66 6f 00 ..Sensor info. 00004f1d : 4f1d: ff ff 45 78 74 72 75 64 65 72 20 69 6e 66 6f 00 ..Extruder info. 00004f2d : 4f2d: ff ff 58 59 5a 20 63 61 6c 2e 20 64 65 74 61 69 ..XYZ cal. detai 4f3d: 6c 73 00 ls. 00004f40 : 4f40: ff ff 50 72 69 6e 74 65 72 20 49 50 20 41 64 64 ..Printer IP Add 4f50: 72 3a 00 r:. 00004f53 : 4f53: ff ff 75 6e 6b 6e 6f 77 6e 00 ..unknown. 00004f5d : 4f5d: ff ff 4d 4d 55 20 63 6f 6e 6e 65 63 74 65 64 00 ..MMU connected. 00004f6d : 4f6d: ff ff 44 61 74 65 3a 00 ..Date:. 00004f75 : 4f75: ff ff 74 6f 20 75 6e 6c 6f 61 64 20 66 69 6c 61 ..to unload fila 4f85: 6d 65 6e 74 00 ment. 00004f8a : 4f8a: ff ff 74 6f 20 6c 6f 61 64 20 66 69 6c 61 6d 65 ..to load filame 4f9a: 6e 74 00 nt. 00004f9d : 4f9d: ff ff 50 72 65 73 73 20 74 68 65 20 6b 6e 6f 62 ..Press the knob ... 00004fae : 4fae: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 4fbe: 63 75 74 00 cut. 00004fc2 : 4fc2: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 4fd2: 65 6a 65 63 74 00 eject. 00004fd8 : 4fd8: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 4fe8: 75 6e 6c 6f 61 64 00 unload. 00004fef : 4fef: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 4fff: 6c 6f 61 64 00 load. 00005004 : 5004: ff ff 43 6f 6f 6c 64 6f 77 6e 00 ..Cooldown. 0000500f : 500f: ff ff 46 69 6c 61 6d 65 6e 74 20 65 78 74 72 75 ..Filament extru 501f: 64 69 6e 67 20 26 20 77 69 74 68 20 63 6f 72 72 ding & with corr 502f: 65 63 74 20 63 6f 6c 6f 72 3f 00 ect color?. 0000503a : 503a: ff ff 45 6a 65 63 74 00 ..Eject. 00005042 : 5042: ff ff 41 75 74 6f 6c 6f 61 64 69 6e 67 20 66 69 ..Autoloading fi 5052: 6c 61 6d 65 6e 74 20 69 73 20 61 63 74 69 76 65 lament is active 5062: 2c 20 6a 75 73 74 20 70 72 65 73 73 20 74 68 65 , just press the 5072: 20 6b 6e 6f 62 20 61 6e 64 20 69 6e 73 65 72 74 knob and insert 5082: 20 66 69 6c 61 6d 65 6e 74 2e 2e 2e 00 filament.... 0000508f : 508f: ff ff 54 6f 74 61 6c 20 66 69 6c 61 6d 65 6e 74 ..Total filament ... 000050a0 : 50a0: ff ff 54 6f 74 61 6c 20 70 72 69 6e 74 20 74 69 ..Total print ti 50b0: 6d 65 00 me. 000050b3 : 50b3: ff ff 46 69 6c 61 6d 65 6e 74 20 75 73 65 64 00 ..Filament used. 000050c3 : 50c3: ff ff 50 72 69 6e 74 20 74 69 6d 65 00 ..Print time. 000050d0 : 50d0: ff ff 50 72 65 68 65 61 74 20 74 68 65 20 6e 6f ..Preheat the no 50e0: 7a 7a 6c 65 21 00 zzle!. 000050e6 : 50e6: ff ff 45 52 52 4f 52 3a 00 ..ERROR:. 000050ef : 50ef: ff ff 59 20 64 69 73 74 61 6e 63 65 20 66 72 6f ..Y distance fro 50ff: 6d 20 6d 69 6e 00 m min. 00005105 : 5105: ff ff 4c 65 66 74 00 ..Left. 0000510c : 510c: ff ff 52 69 67 68 74 00 ..Right. 00005114 : 5114: ff ff 4d 65 61 73 75 72 65 64 20 73 6b 65 77 00 ..Measured skew. 00005124 : 5124: ff ff 53 6c 69 67 68 74 20 73 6b 65 77 00 ..Slight skew. 00005132 : 5132: ff ff 53 65 76 65 72 65 20 73 6b 65 77 00 ..Severe skew. 00005140 : 5140: ff ff 5b 30 3b 30 5d 20 70 6f 69 6e 74 20 6f 66 ..[0;0] point of 5150: 66 73 65 74 00 fset. 00005155 : 5155: ff ff 41 64 6a 75 73 74 69 6e 67 20 5a 00 ..Adjusting Z. 00005163 : 5163: ff ff 52 65 61 72 20 73 69 64 65 20 5b e4 6d 5d ..Rear side [.m] ... 00005174 : 5174: ff ff 46 72 6f 6e 74 20 73 69 64 65 5b e4 6d 5d ..Front side[.m] ... 00005185 : 5185: ff ff 52 69 67 68 74 20 73 69 64 65 5b e4 6d 5d ..Right side[.m] ... 00005196 : 5196: ff ff 4c 65 66 74 20 73 69 64 65 20 5b e4 6d 5d ..Left side [.m] ... 000051a7 : 51a7: ff ff 53 65 74 20 74 65 6d 70 65 72 61 74 75 72 ..Set temperatur 51b7: 65 3a 00 e:. 000051ba : 51ba: ff ff 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 ..PINDA calibrat 51ca: 69 6f 6e 20 66 61 69 6c 65 64 00 ion failed. 000051d5 : 51d5: ff ff 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 ..PINDA calibrat 51e5: 69 6f 6e 20 69 73 20 66 69 6e 69 73 68 65 64 20 ion is finished 51f5: 61 6e 64 20 61 63 74 69 76 65 2e 20 49 74 20 63 and active. It c 5205: 61 6e 20 62 65 20 64 69 73 61 62 6c 65 64 20 69 an be disabled i 5215: 6e 20 6d 65 6e 75 20 53 65 74 74 69 6e 67 73 2d n menu Settings- 5225: 3e 50 49 4e 44 41 20 63 61 6c 2e 00 >PINDA cal.. 00005231 : 5231: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 46 53 65 ..Feeding to FSe 5241: 6e 73 6f 72 00 nsor. 00005246 : 5246: ff ff 4d 6f 76 69 6e 67 20 73 65 6c 65 63 74 6f ..Moving selecto 5256: 72 00 r. 00005258 : 5258: ff ff 48 6f 6d 69 6e 67 00 ..Homing. 00005261 : 5261: ff ff 52 65 74 72 61 63 74 20 66 72 6f 6d 20 46 ..Retract from F 5271: 49 4e 44 41 00 INDA. 00005276 : 5276: ff ff 45 6a 65 63 74 69 6e 67 20 66 69 6c 61 6d ..Ejecting filam 5286: 65 6e 74 00 ent. 0000528a : 528a: ff ff 50 61 72 6b 69 6e 67 20 73 65 6c 65 63 74 ..Parking select 529a: 6f 72 00 or. 0000529d : 529d: ff ff 52 65 74 75 72 6e 69 6e 67 20 73 65 6c 65 ..Returning sele 52ad: 63 74 6f 72 00 ctor. 000052b2 : 52b2: ff ff 50 65 72 66 6f 72 6d 69 6e 67 20 63 75 74 ..Performing cut ... 000052c3 : 52c3: ff ff 50 75 73 68 69 6e 67 20 66 69 6c 61 6d 65 ..Pushing filame 52d3: 6e 74 00 nt. 000052d6 : 52d6: ff ff 50 72 65 70 61 72 69 6e 67 20 62 6c 61 64 ..Preparing blad 52e6: 65 00 e. 000052e8 : 52e8: ff ff 53 65 6c 65 63 74 69 6e 67 20 66 69 6c 2e ..Selecting fil. 52f8: 20 73 6c 6f 74 00 slot. 000052fe : 52fe: ff ff 55 6e 6c 6f 61 64 69 6e 67 20 66 69 6c 61 ..Unloading fila 530e: 6d 65 6e 74 00 ment. 00005313 : 5313: ff ff 45 52 52 20 54 4d 43 20 66 61 69 6c 65 64 ..ERR TMC failed ... 00005324 : 5324: ff ff 45 52 52 20 48 65 6c 70 20 66 69 6c 61 6d ..ERR Help filam 5334: 65 6e 74 00 ent. 00005338 : 5338: ff ff 45 52 52 20 49 6e 74 65 72 6e 61 6c 00 ..ERR Internal. 00005347 : 5347: ff ff 45 52 52 20 57 61 69 74 20 66 6f 72 20 55 ..ERR Wait for U 5357: 73 65 72 00 ser. 0000535b : 535b: ff ff 46 69 6e 69 73 68 69 6e 67 20 6d 6f 76 65 ..Finishing move 536b: 6d 65 6e 74 73 00 ments. 00005371 : 5371: ff ff 41 76 6f 69 64 69 6e 67 20 67 72 69 6e 64 ..Avoiding grind ... 00005382 : 5382: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 6e 6f 7a ..Feeding to noz 5392: 7a 6c 65 00 zle. 00005396 : 5396: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 65 78 74 ..Feeding to ext 53a6: 72 75 64 65 72 00 ruder. 000053ac : 53ac: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 46 49 4e ..Feeding to FIN 53bc: 44 41 00 DA. 000053bf : 53bf: ff ff 55 6e 6c 6f 61 64 69 6e 67 20 74 6f 20 70 ..Unloading to p 53cf: 75 6c 6c 65 79 00 ulley. 000053d5 : 53d5: ff ff 55 6e 6c 6f 61 64 69 6e 67 20 74 6f 20 46 ..Unloading to F 53e5: 49 4e 44 41 00 INDA. 000053ea : 53ea: ff ff 44 69 73 65 6e 67 61 67 69 6e 67 20 69 64 ..Disengaging id 53fa: 6c 65 72 00 ler. 000053fe : 53fe: ff ff 45 6e 67 61 67 69 6e 67 20 69 64 6c 65 72 ..Engaging idler ... 0000540f : 540f: ff ff 4f 4b 00 ..OK. 00005414 <_ZN4MMU2L23MSG_TITLE_UNKNOWN_ERRORE.lto_priv.528>: 5414: ff ff 55 4e 4b 4e 4f 57 4e 20 45 52 52 4f 52 00 ..UNKNOWN ERROR. 00005424 <_ZN4MMU2L25MSG_TITLE_FILAMENT_CHANGEE.lto_priv.527>: 5424: ff ff 46 49 4c 41 4d 45 4e 54 20 43 48 41 4e 47 ..FILAMENT CHANG 5434: 45 00 E. 00005436 <_ZN4MMU2L26MSG_TITLE_FILAMENT_EJECTEDE.lto_priv.526>: 5436: ff ff 46 49 4c 41 4d 45 4e 54 20 45 4a 45 43 54 ..FILAMENT EJECT 5446: 45 44 00 ED. 00005449 <_ZN4MMU2L25MSG_TITLE_UNLOAD_MANUALLYE.lto_priv.525>: 5449: ff ff 55 4e 4c 4f 41 44 20 4d 41 4e 55 41 4c 4c ..UNLOAD MANUALL 5459: 59 00 Y. 0000545b <_ZN4MMU2L26MSG_TITLE_FW_RUNTIME_ERRORE.lto_priv.524>: 545b: ff ff 46 57 20 52 55 4e 54 49 4d 45 20 45 52 52 ..FW RUNTIME ERR 546b: 4f 52 00 OR. 0000546e <_ZN4MMU2L26MSG_TITLE_FW_UPDATE_NEEDEDE.lto_priv.523>: 546e: ff ff 4d 4d 55 20 46 57 20 55 50 44 41 54 45 20 ..MMU FW UPDATE 547e: 4e 45 45 44 45 44 00 NEEDED. 00005485 <_ZN4MMU2L20MSG_TITLE_QUEUE_FULLE.lto_priv.522>: 5485: ff ff 51 55 45 55 45 20 46 55 4c 4c 00 ..QUEUE FULL. 00005492 <_ZN4MMU2L22MSG_TITLE_INVALID_TOOLE.lto_priv.521>: 5492: ff ff 49 4e 56 41 4c 49 44 20 54 4f 4f 4c 00 ..INVALID TOOL. 000054a1 <_ZN4MMU2L33MSG_TITLE_FILAMENT_ALREADY_LOADEDE.lto_priv.520>: 54a1: ff ff 46 49 4c 2e 20 41 4c 52 45 41 44 59 20 4c ..FIL. ALREADY L 54b1: 4f 41 44 45 44 00 OADED. 000054b7 <_ZN4MMU2L29MSG_TITLE_COMMUNICATION_ERRORE.lto_priv.519>: 54b7: ff ff 43 4f 4d 4d 55 4e 49 43 41 54 49 4f 4e 20 ..COMMUNICATION 54c7: 45 52 52 4f 52 00 ERROR. 000054cd <_ZN4MMU2L28MSG_TITLE_MMU_NOT_RESPONDINGE.lto_priv.518>: 54cd: ff ff 4d 4d 55 20 4e 4f 54 20 52 45 53 50 4f 4e ..MMU NOT RESPON 54dd: 44 49 4e 47 00 DING. 000054e2 <_ZN4MMU2L23MSG_TITLE_MMU_MCU_ERRORE.lto_priv.517>: 54e2: ff ff 4d 4d 55 20 4d 43 55 20 45 52 52 4f 52 00 ..MMU MCU ERROR. 000054f2 <_ZN4MMU2L25MSG_TITLE_SELFTEST_FAILEDE.lto_priv.516>: 54f2: ff ff 4d 4d 55 20 53 45 4c 46 54 45 53 54 20 46 ..MMU SELFTEST F 5502: 41 49 4c 45 44 00 AILED. 00005508 <_ZN4MMU2L28MSG_TITLE_TMC_DRIVER_SHORTEDE.lto_priv.515>: 5508: ff ff 54 4d 43 20 44 52 49 56 45 52 20 53 48 4f ..TMC DRIVER SHO 5518: 52 54 45 44 00 RTED. 0000551d <_ZN4MMU2L32MSG_TITLE_TMC_UNDERVOLTAGE_ERRORE.lto_priv.514>: 551d: ff ff 54 4d 43 20 55 4e 44 45 52 56 4f 4c 54 41 ..TMC UNDERVOLTA 552d: 47 45 20 45 52 52 00 GE ERR. 00005534 <_ZN4MMU2L26MSG_TITLE_TMC_DRIVER_RESETE.lto_priv.513>: 5534: ff ff 54 4d 43 20 44 52 49 56 45 52 20 52 45 53 ..TMC DRIVER RES 5544: 45 54 00 ET. 00005547 <_ZN4MMU2L26MSG_TITLE_TMC_DRIVER_ERRORE.lto_priv.512>: 5547: ff ff 54 4d 43 20 44 52 49 56 45 52 20 45 52 52 ..TMC DRIVER ERR 5557: 4f 52 00 OR. 0000555a <_ZN4MMU2L28MSG_TITLE_TMC_OVERHEAT_ERRORE.lto_priv.511>: 555a: ff ff 54 4d 43 20 4f 56 45 52 48 45 41 54 20 45 ..TMC OVERHEAT E 556a: 52 52 4f 52 00 RROR. 0000556f <_ZN4MMU2L33MSG_TITLE_TMC_WARNING_TMC_TOO_HOTE.lto_priv.510>: 556f: ff ff 57 41 52 4e 49 4e 47 20 54 4d 43 20 54 4f ..WARNING TMC TO 557f: 4f 20 48 4f 54 00 O HOT. 00005585 <_ZN4MMU2L27MSG_TITLE_IDLER_CANNOT_MOVEE.lto_priv.509>: 5585: ff ff 49 44 4c 45 52 20 43 41 4e 4e 4f 54 20 4d ..IDLER CANNOT M 5595: 4f 56 45 00 OVE. 00005599 <_ZN4MMU2L27MSG_TITLE_IDLER_CANNOT_HOMEE.lto_priv.508>: 5599: ff ff 49 44 4c 45 52 20 43 41 4e 4e 4f 54 20 48 ..IDLER CANNOT H 55a9: 4f 4d 45 00 OME. 000055ad <_ZN4MMU2L30MSG_TITLE_SELECTOR_CANNOT_MOVEE.lto_priv.507>: 55ad: ff ff 53 45 4c 45 43 54 4f 52 20 43 41 4e 4e 4f ..SELECTOR CANNO 55bd: 54 20 4d 4f 56 45 00 T MOVE. 000055c4 <_ZN4MMU2L30MSG_TITLE_SELECTOR_CANNOT_HOMEE.lto_priv.506>: 55c4: ff ff 53 45 4c 45 43 54 4f 52 20 43 41 4e 4e 4f ..SELECTOR CANNO 55d4: 54 20 48 4f 4d 45 00 T HOME. 000055db <_ZN4MMU2L33MSG_TITLE_LOAD_TO_EXTRUDER_FAILEDE.lto_priv.505>: 55db: ff ff 4c 4f 41 44 20 54 4f 20 45 58 54 52 2e 20 ..LOAD TO EXTR. 55eb: 46 41 49 4c 45 44 00 FAILED. 000055f2 <_ZN4MMU2L23MSG_TITLE_INSPECT_FINDAE.lto_priv.504>: 55f2: ff ff 49 4e 53 50 45 43 54 20 46 49 4e 44 41 00 ..INSPECT FINDA. 00005602 <_ZN4MMU2L27MSG_TITLE_FSENSOR_TOO_EARLYE.lto_priv.503>: 5602: ff ff 46 53 45 4e 53 4f 52 20 54 4f 4f 20 45 41 ..FSENSOR TOO EA 5612: 52 4c 59 00 RLY. 00005616 <_ZN4MMU2L28MSG_TITLE_PULLEY_CANNOT_MOVEE.lto_priv.502>: 5616: ff ff 50 55 4c 4c 45 59 20 43 41 4e 4e 4f 54 20 ..PULLEY CANNOT 5626: 4d 4f 56 45 00 MOVE. 0000562b <_ZN4MMU2L32MSG_TITLE_FSENSOR_FILAMENT_STUCKE.lto_priv.501>: 562b: ff ff 46 53 45 4e 53 4f 52 20 46 49 4c 2e 20 53 ..FSENSOR FIL. S 563b: 54 55 43 4b 00 TUCK. 00005640 <_ZN4MMU2L31MSG_TITLE_FSENSOR_DIDNT_TRIGGERE.lto_priv.500>: 5640: ff ff 46 53 45 4e 53 4f 52 20 44 49 44 4e 54 20 ..FSENSOR DIDNT 5650: 54 52 49 47 47 2e 00 TRIGG.. 00005657 <_ZN4MMU2L30MSG_TITLE_FINDA_FILAMENT_STUCKE.lto_priv.499>: 5657: ff ff 46 49 4e 44 41 20 46 49 4c 41 4d 2e 20 53 ..FINDA FILAM. S 5667: 54 55 43 4b 00 TUCK. 0000566c <_ZN4MMU2L29MSG_TITLE_FINDA_DIDNT_TRIGGERE.lto_priv.498>: 566c: ff ff 46 49 4e 44 41 20 44 49 44 4e 54 20 54 52 ..FINDA DIDNT TR 567c: 49 47 47 45 52 00 IGGER. 00005682 : 5682: ff ff 4e 6f 74 20 73 70 69 6e 6e 69 6e 67 00 ..Not spinning. 00005691 : 5691: ff ff 53 70 69 6e 6e 69 6e 67 00 ..Spinning. 0000569c : 569c: ff ff 46 61 6e 20 74 65 73 74 00 ..Fan test. 000056a7 : 56a7: ff ff 53 65 6c 66 74 65 73 74 20 66 61 69 6c 65 ..Selftest faile 56b7: 64 00 d. 000056b9 : 56b9: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 56c9: 72 00 r. 000056cb : 56cb: ff ff 53 77 61 70 70 65 64 00 ..Swapped. 000056d5 : 56d5: ff ff 46 72 6f 6e 74 2f 6c 65 66 74 20 66 61 6e ..Front/left fan 56e5: 73 00 s. 000056e7 : 56e7: ff ff 41 78 69 73 00 ..Axis. 000056ee : 56ee: ff ff 41 78 69 73 20 6c 65 6e 67 74 68 00 ..Axis length. 000056fc : 56fc: ff ff 4c 6f 6f 73 65 20 70 75 6c 6c 65 79 00 ..Loose pulley. 0000570b : 570b: ff ff 4c 65 66 74 20 68 6f 74 65 6e 64 20 66 61 ..Left hotend fa 571b: 6e 3f 00 n?. 0000571e : 571e: ff ff 46 72 6f 6e 74 20 70 72 69 6e 74 20 66 61 ..Front print fa 572e: 6e 3f 00 n?. 00005731 : 5731: ff ff 45 6e 64 73 74 6f 70 20 6e 6f 74 20 68 69 ..Endstop not hi 5741: 74 00 t. 00005743 : 5743: ff ff 45 6e 64 73 74 6f 70 00 ..Endstop. 0000574d : 574d: ff ff 4d 6f 74 6f 72 00 ..Motor. 00005755 : 5755: ff ff 45 6e 64 73 74 6f 70 73 00 ..Endstops. 00005760 : 5760: ff ff 57 69 72 69 6e 67 20 65 72 72 6f 72 00 ..Wiring error. 0000576f : 576f: ff ff 42 65 64 2f 48 65 61 74 65 72 00 ..Bed/Heater. 0000577c : 577c: ff ff 4e 6f 74 20 63 6f 6e 6e 65 63 74 65 64 00 ..Not connected. 0000578c : 578c: ff ff 48 65 61 74 65 72 2f 54 68 65 72 6d 69 73 ..Heater/Thermis 579c: 74 6f 72 00 tor. 000057a0 : 57a0: ff ff 50 6c 65 61 73 65 20 63 68 65 63 6b 3a 00 ..Please check:. 000057b0 : 57b0: ff ff 53 65 6c 66 74 65 73 74 20 65 72 72 6f 72 ..Selftest error 57c0: 21 00 !. 000057c2 : 57c2: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 57d2: 6e 20 61 6c 6c 20 72 69 67 68 74 2e 20 53 6b 65 n all right. Ske 57e2: 77 20 77 69 6c 6c 20 62 65 20 63 6f 72 72 65 63 w will be correc 57f2: 74 65 64 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c ted automaticall 5802: 79 2e 00 y.. 00005805 : 5805: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 5815: 6e 20 61 6c 6c 20 72 69 67 68 74 2e 20 58 2f 59 n all right. X/Y 5825: 20 61 78 65 73 20 61 72 65 20 73 6c 69 67 68 74 axes are slight 5835: 6c 79 20 73 6b 65 77 65 64 2e 20 47 6f 6f 64 20 ly skewed. Good 5845: 6a 6f 62 21 00 job!. 0000584a : 584a: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 585a: 6e 20 6f 6b 2e 20 58 2f 59 20 61 78 65 73 20 61 n ok. X/Y axes a 586a: 72 65 20 70 65 72 70 65 6e 64 69 63 75 6c 61 72 re perpendicular 587a: 2e 20 43 6f 6e 67 72 61 74 75 6c 61 74 69 6f 6e . Congratulation 588a: 73 21 00 s!. 0000588d : 588d: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 589d: 6e 20 63 6f 6d 70 72 6f 6d 69 73 65 64 2e 20 52 n compromised. R 58ad: 69 67 68 74 20 66 72 6f 6e 74 20 63 61 6c 69 62 ight front calib 58bd: 72 61 74 69 6f 6e 20 70 6f 69 6e 74 20 6e 6f 74 ration point not 58cd: 20 72 65 61 63 68 61 62 6c 65 2e 00 reachable.. 000058d9 : 58d9: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 58e9: 6e 20 63 6f 6d 70 72 6f 6d 69 73 65 64 2e 20 46 n compromised. F 58f9: 72 6f 6e 74 20 63 61 6c 69 62 72 61 74 69 6f 6e ront calibration 5909: 20 70 6f 69 6e 74 73 20 6e 6f 74 20 72 65 61 63 points not reac 5919: 68 61 62 6c 65 2e 00 hable.. 00005920 : 5920: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 5930: 6e 20 66 61 69 6c 65 64 2e 20 52 69 67 68 74 20 n failed. Right 5940: 66 72 6f 6e 74 20 63 61 6c 69 62 72 61 74 69 6f front calibratio 5950: 6e 20 70 6f 69 6e 74 20 6e 6f 74 20 72 65 61 63 n point not reac 5960: 68 61 62 6c 65 2e 00 hable.. 00005967 : 5967: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 5977: 6e 20 66 61 69 6c 65 64 2e 20 46 72 6f 6e 74 20 n failed. Front 5987: 63 61 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e calibration poin 5997: 74 73 20 6e 6f 74 20 72 65 61 63 68 61 62 6c 65 ts not reachable 59a7: 2e 00 .. 000059a9 : 59a9: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 59b9: 6e 20 66 61 69 6c 65 64 2e 20 50 6c 65 61 73 65 n failed. Please 59c9: 20 63 6f 6e 73 75 6c 74 20 74 68 65 20 6d 61 6e consult the man 59d9: 75 61 6c 2e 00 ual.. 000059de : 59de: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 59ee: 6e 20 66 61 69 6c 65 64 2e 20 42 65 64 20 63 61 n failed. Bed ca 59fe: 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e 74 20 libration point 5a0e: 77 61 73 20 6e 6f 74 20 66 6f 75 6e 64 2e 00 was not found.. 00005a1d : 5a1d: ff ff 50 6c 65 61 73 65 20 70 6c 61 63 65 20 73 ..Please place s 5a2d: 74 65 65 6c 20 73 68 65 65 74 20 6f 6e 20 68 65 teel sheet on he 5a3d: 61 74 62 65 64 2e 00 atbed.. 00005a44 : 5a44: ff ff 44 69 73 74 61 6e 63 65 20 62 65 74 77 65 ..Distance betwe 5a54: 65 6e 20 74 69 70 20 6f 66 20 74 68 65 20 6e 6f en tip of the no 5a64: 7a 7a 6c 65 20 61 6e 64 20 74 68 65 20 62 65 64 zzle and the bed 5a74: 20 73 75 72 66 61 63 65 20 68 61 73 20 6e 6f 74 surface has not 5a84: 20 62 65 65 6e 20 73 65 74 20 79 65 74 2e 20 50 been set yet. P 5a94: 6c 65 61 73 65 20 66 6f 6c 6c 6f 77 20 74 68 65 lease follow the 5aa4: 20 6d 61 6e 75 61 6c 2c 20 63 68 61 70 74 65 72 manual, chapter 5ab4: 20 46 69 72 73 74 20 73 74 65 70 73 2c 20 73 65 First steps, se 5ac4: 63 74 69 6f 6e 20 46 69 72 73 74 20 6c 61 79 65 ction First laye 5ad4: 72 20 63 61 6c 69 62 72 61 74 69 6f 6e 2e 00 r calibration.. 00005ae3 : 5ae3: ff ff 50 6c 61 63 65 20 61 20 73 68 65 65 74 20 ..Place a sheet 5af3: 6f 66 20 70 61 70 65 72 20 75 6e 64 65 72 20 74 of paper under t 5b03: 68 65 20 6e 6f 7a 7a 6c 65 20 64 75 72 69 6e 67 he nozzle during 5b13: 20 74 68 65 20 63 61 6c 69 62 72 61 74 69 6f 6e the calibration 5b23: 20 6f 66 20 66 69 72 73 74 20 34 20 70 6f 69 6e of first 4 poin 5b33: 74 73 2e 20 49 66 20 74 68 65 20 6e 6f 7a 7a 6c ts. If the nozzl 5b43: 65 20 63 61 74 63 68 65 73 20 74 68 65 20 70 61 e catches the pa 5b53: 70 65 72 2c 20 70 6f 77 65 72 20 6f 66 66 20 74 per, power off t 5b63: 68 65 20 70 72 69 6e 74 65 72 20 69 6d 6d 65 64 he printer immed 5b73: 69 61 74 65 6c 79 2e 00 iately.. 00005b7b : 5b7b: ff ff 53 65 61 72 63 68 69 6e 67 20 62 65 64 20 ..Searching bed 5b8b: 63 61 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e calibration poin 5b9b: 74 00 t. 00005b9d : 5b9d: ff ff 4d 65 61 73 75 72 69 6e 67 20 72 65 66 65 ..Measuring refe 5bad: 72 65 6e 63 65 20 68 65 69 67 68 74 20 6f 66 20 rence height of 5bbd: 63 61 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e calibration poin 5bcd: 74 00 t. 00005bcf : 5bcf: ff ff 50 6c 65 61 73 65 20 63 6c 65 61 6e 20 74 ..Please clean t 5bdf: 68 65 20 6e 6f 7a 7a 6c 65 20 66 6f 72 20 63 61 he nozzle for ca 5bef: 6c 69 62 72 61 74 69 6f 6e 2e 20 43 6c 69 63 6b libration. Click 5bff: 20 77 68 65 6e 20 64 6f 6e 65 2e 00 when done.. 00005c0b : 5c0b: ff ff 41 75 74 6f 20 68 6f 6d 65 00 ..Auto home. 00005c17 : 5c17: ff ff 43 75 74 20 66 69 6c 61 6d 65 6e 74 00 ..Cut filament. 00005c26 : 5c26: ff ff 45 6a 65 63 74 20 66 72 6f 6d 20 4d 4d 55 ..Eject from MMU ... 00005c37 : 5c37: ff ff 4c 6f 61 64 69 6e 67 20 66 69 6c 61 6d 65 ..Loading filame 5c47: 6e 74 00 nt. 00005c4a : 5c4a: ff ff 4d 4d 55 20 52 65 74 72 79 3a 20 52 65 73 ..MMU Retry: Res 5c5a: 74 6f 72 69 6e 67 20 74 65 6d 70 65 72 61 74 75 toring temperatu 5c6a: 72 65 2e 2e 2e 00 re.... 00005c70 : 5c70: ff ff 53 6f 72 74 69 6e 67 20 66 69 6c 65 73 00 ..Sorting files. 00005c80 : 5c80: ff ff 53 6f 6d 65 20 66 69 6c 65 73 20 77 69 6c ..Some files wil 5c90: 6c 20 6e 6f 74 20 62 65 20 73 6f 72 74 65 64 2e l not be sorted. 5ca0: 20 4d 61 78 2e 20 4e 6f 2e 20 6f 66 20 66 69 6c Max. No. of fil 5cb0: 65 73 20 69 6e 20 31 20 66 6f 6c 64 65 72 20 66 es in 1 folder f 5cc0: 6f 72 20 73 6f 72 74 69 6e 67 20 69 73 20 31 30 or sorting is 10 5cd0: 30 2e 00 0.. 00005cd3 : 5cd3: ff ff 4f 66 66 00 ..Off. 00005cd9 : 5cd9: ff ff 4f 6e 00 ..On. 00005cde : 5cde: ff ff 55 6e 65 78 70 65 63 74 65 64 20 65 72 72 ..Unexpected err 5cee: 6f 72 20 6f 63 63 75 72 72 65 64 2e 00 or occurred.. 00005cfb : 5cfb: ff ff 4d 36 30 30 20 46 69 6c 61 6d 65 6e 74 20 ..M600 Filament 5d0b: 43 68 61 6e 67 65 2e 20 4c 6f 61 64 20 61 20 6e Change. Load a n 5d1b: 65 77 20 66 69 6c 61 6d 65 6e 74 20 6f 72 20 65 ew filament or e 5d2b: 6a 65 63 74 20 74 68 65 20 6f 6c 64 20 6f 6e 65 ject the old one 5d3b: 2e 00 .. 00005d3d : 5d3d: ff ff 52 65 6d 6f 76 65 20 74 68 65 20 65 6a 65 ..Remove the eje 5d4d: 63 74 65 64 20 66 69 6c 61 6d 65 6e 74 20 66 72 cted filament fr 5d5d: 6f 6d 20 74 68 65 20 66 72 6f 6e 74 20 6f 66 20 om the front of 5d6d: 74 68 65 20 4d 4d 55 2e 00 the MMU.. 00005d76 : 5d76: ff ff 46 69 6c 61 6d 65 6e 74 20 64 65 74 65 63 ..Filament detec 5d86: 74 65 64 20 75 6e 65 78 70 65 63 74 65 64 6c 79 ted unexpectedly 5d96: 2e 20 45 6e 73 75 72 65 20 6e 6f 20 66 69 6c 61 . Ensure no fila 5da6: 6d 65 6e 74 20 69 73 20 6c 6f 61 64 65 64 2e 20 ment is loaded. 5db6: 43 68 65 63 6b 20 74 68 65 20 73 65 6e 73 6f 72 Check the sensor 5dc6: 73 20 61 6e 64 20 77 69 72 69 6e 67 2e 00 s and wiring.. 00005dd4 : 5dd4: ff ff 49 6e 74 65 72 6e 61 6c 20 72 75 6e 74 69 ..Internal runti 5de4: 6d 65 20 65 72 72 6f 72 2e 20 54 72 79 20 72 65 me error. Try re 5df4: 73 65 74 74 69 6e 67 20 74 68 65 20 4d 4d 55 20 setting the MMU 5e04: 6f 72 20 75 70 64 61 74 69 6e 67 20 74 68 65 20 or updating the 5e14: 66 69 72 6d 77 61 72 65 2e 00 firmware.. 00005e1e : 5e1e: ff ff 4d 4d 55 20 46 57 20 76 65 72 73 69 6f 6e ..MMU FW version 5e2e: 20 69 73 20 69 6e 63 6f 6d 70 61 74 69 62 6c 65 is incompatible 5e3e: 20 77 69 74 68 20 70 72 69 6e 74 65 72 20 46 57 with printer FW 5e4e: 2e 55 70 64 61 74 65 20 74 6f 20 76 65 72 73 69 .Update to versi 5e5e: 6f 6e 20 33 2e 30 2e 33 2e 00 on 3.0.3.. 00005e68 : 5e68: ff ff 4d 4d 55 20 46 69 72 6d 77 61 72 65 20 69 ..MMU Firmware i 5e78: 6e 74 65 72 6e 61 6c 20 65 72 72 6f 72 2c 20 70 nternal error, p 5e88: 6c 65 61 73 65 20 72 65 73 65 74 20 74 68 65 20 lease reset the 5e98: 4d 4d 55 2e 00 MMU.. 00005e9d : 5e9d: ff ff 52 65 71 75 65 73 74 65 64 20 66 69 6c 61 ..Requested fila 5ead: 6d 65 6e 74 20 74 6f 6f 6c 20 69 73 20 6e 6f 74 ment tool is not 5ebd: 20 61 76 61 69 6c 61 62 6c 65 20 6f 6e 20 74 68 available on th 5ecd: 69 73 20 68 61 72 64 77 61 72 65 2e 20 43 68 65 is hardware. Che 5edd: 63 6b 20 74 68 65 20 47 2d 63 6f 64 65 20 66 6f ck the G-code fo 5eed: 72 20 74 6f 6f 6c 20 69 6e 64 65 78 20 6f 75 74 r tool index out 5efd: 20 6f 66 20 72 61 6e 67 65 20 28 54 30 2d 54 34 of range (T0-T4 5f0d: 29 2e 00 ).. 00005f10 : 5f10: ff ff 43 61 6e 6e 6f 74 20 70 65 72 66 6f 72 6d ..Cannot perform 5f20: 20 74 68 65 20 61 63 74 69 6f 6e 2c 20 66 69 6c the action, fil 5f30: 61 6d 65 6e 74 20 69 73 20 61 6c 72 65 61 64 79 ament is already 5f40: 20 6c 6f 61 64 65 64 2e 20 55 6e 6c 6f 61 64 20 loaded. Unload 5f50: 69 74 20 66 69 72 73 74 2e 00 it first.. 00005f5a : 5f5a: ff ff 4d 4d 55 20 6e 6f 74 20 72 65 73 70 6f 6e ..MMU not respon 5f6a: 64 69 6e 67 20 63 6f 72 72 65 63 74 6c 79 2e 20 ding correctly. 5f7a: 43 68 65 63 6b 20 74 68 65 20 77 69 72 69 6e 67 Check the wiring 5f8a: 20 61 6e 64 20 63 6f 6e 6e 65 63 74 6f 72 73 2e and connectors. ... 00005f9b : 5f9b: ff ff 4d 4d 55 20 6e 6f 74 20 72 65 73 70 6f 6e ..MMU not respon 5fab: 64 69 6e 67 2e 20 43 68 65 63 6b 20 74 68 65 20 ding. Check the 5fbb: 77 69 72 69 6e 67 20 61 6e 64 20 63 6f 6e 6e 65 wiring and conne 5fcb: 63 74 6f 72 73 2e 00 ctors.. 00005fd2 : 5fd2: ff ff 4d 6f 72 65 20 64 65 74 61 69 6c 73 20 6f ..More details o 5fe2: 6e 6c 69 6e 65 2e 00 nline.. 00005fe9 : 5fe9: ff ff 54 68 65 20 49 64 6c 65 72 20 63 61 6e 6e ..The Idler cann 5ff9: 6f 74 20 68 6f 6d 65 20 70 72 6f 70 65 72 6c 79 ot home properly 6009: 2e 20 43 68 65 63 6b 20 66 6f 72 20 61 6e 79 74 . Check for anyt 6019: 68 69 6e 67 20 62 6c 6f 63 6b 69 6e 67 20 69 74 hing blocking it 6029: 73 20 6d 6f 76 65 6d 65 6e 74 2e 00 s movement.. 00006035 : 6035: ff ff 43 61 6e 27 74 20 6d 6f 76 65 20 53 65 6c ..Can't move Sel 6045: 65 63 74 6f 72 20 6f 72 20 49 64 6c 65 72 2e 00 ector or Idler.. 00006055 : 6055: ff ff 54 68 65 20 53 65 6c 65 63 74 6f 72 20 63 ..The Selector c 6065: 61 6e 6e 6f 74 20 68 6f 6d 65 20 70 72 6f 70 65 annot home prope 6075: 72 6c 79 2e 20 43 68 65 63 6b 20 66 6f 72 20 61 rly. Check for a 6085: 6e 79 74 68 69 6e 67 20 62 6c 6f 63 6b 69 6e 67 nything blocking 6095: 20 69 74 73 20 6d 6f 76 65 6d 65 6e 74 2e 00 its movement.. 000060a4 : 60a4: ff ff 4c 6f 61 64 69 6e 67 20 74 6f 20 65 78 74 ..Loading to ext 60b4: 72 75 64 65 72 20 66 61 69 6c 65 64 2e 20 49 6e ruder failed. In 60c4: 73 70 65 63 74 20 74 68 65 20 66 69 6c 61 6d 65 spect the filame 60d4: 6e 74 20 74 69 70 20 73 68 61 70 65 2e 20 52 65 nt tip shape. Re 60e4: 66 69 6e 65 20 74 68 65 20 73 65 6e 73 6f 72 20 fine the sensor 60f4: 63 61 6c 69 62 72 61 74 69 6f 6e 2c 20 69 66 20 calibration, if 6104: 6e 65 65 64 65 64 2e 00 needed.. 0000610c : 610c: ff ff 53 65 6c 65 63 74 6f 72 20 63 61 6e 27 74 ..Selector can't 611c: 20 6d 6f 76 65 20 64 75 65 20 74 6f 20 46 49 4e move due to FIN 612c: 44 41 20 64 65 74 65 63 74 69 6e 67 20 61 20 66 DA detecting a f 613c: 69 6c 61 6d 65 6e 74 2e 20 4d 61 6b 65 20 73 75 ilament. Make su 614c: 72 65 20 6e 6f 20 66 69 6c 61 6d 65 6e 74 20 69 re no filament i 615c: 73 20 69 6e 20 53 65 6c 65 63 74 6f 72 20 61 6e s in Selector an 616c: 64 20 46 49 4e 44 41 20 77 6f 72 6b 73 20 70 72 d FINDA works pr 617c: 6f 70 65 72 6c 79 2e 00 operly.. 00006184 : 6184: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 6194: 72 20 74 72 69 67 67 65 72 65 64 20 74 6f 6f 20 r triggered too 61a4: 65 61 72 6c 79 20 77 68 69 6c 65 20 6c 6f 61 64 early while load 61b4: 69 6e 67 20 74 6f 20 65 78 74 72 75 64 65 72 2e ing to extruder. 61c4: 20 43 68 65 63 6b 20 74 68 65 72 65 20 69 73 6e Check there isn 61d4: 27 74 20 61 6e 79 74 68 69 6e 67 20 73 74 75 63 't anything stuc 61e4: 6b 20 69 6e 20 50 54 46 45 20 74 75 62 65 2e 20 k in PTFE tube. 61f4: 43 68 65 63 6b 20 74 68 61 74 20 73 65 6e 73 6f Check that senso 6204: 72 20 72 65 61 64 73 20 70 72 6f 70 65 72 6c 79 r reads properly 6214: 2e 00 .. 00006216 : 6216: ff ff 50 75 6c 6c 65 79 20 6d 6f 74 6f 72 20 73 ..Pulley motor s 6226: 74 61 6c 6c 65 64 2e 20 45 6e 73 75 72 65 20 74 talled. Ensure t 6236: 68 65 20 70 75 6c 6c 65 79 20 63 61 6e 20 6d 6f he pulley can mo 6246: 76 65 20 61 6e 64 20 63 68 65 63 6b 20 74 68 65 ve and check the 6256: 20 77 69 72 69 6e 67 2e 00 wiring.. 0000625f : 625f: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 626f: 72 20 64 69 64 6e 27 74 20 73 77 69 74 63 68 20 r didn't switch 627f: 6f 66 66 20 77 68 69 6c 65 20 75 6e 6c 6f 61 64 off while unload 628f: 69 6e 67 20 66 69 6c 61 6d 65 6e 74 2e 20 45 6e ing filament. En 629f: 73 75 72 65 20 66 69 6c 61 6d 65 6e 74 20 63 61 sure filament ca 62af: 6e 20 6d 6f 76 65 20 61 6e 64 20 74 68 65 20 73 n move and the s 62bf: 65 6e 73 6f 72 20 77 6f 72 6b 73 2e 00 ensor works.. 000062cc : 62cc: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 62dc: 72 20 64 69 64 6e 27 74 20 74 72 69 67 67 65 72 r didn't trigger 62ec: 20 77 68 69 6c 65 20 6c 6f 61 64 69 6e 67 20 74 while loading t 62fc: 68 65 20 66 69 6c 61 6d 65 6e 74 2e 20 45 6e 73 he filament. Ens 630c: 75 72 65 20 74 68 65 20 73 65 6e 73 6f 72 20 69 ure the sensor i 631c: 73 20 63 61 6c 69 62 72 61 74 65 64 20 61 6e 64 s calibrated and 632c: 20 74 68 65 20 66 69 6c 61 6d 65 6e 74 20 72 65 the filament re 633c: 61 63 68 65 64 20 69 74 2e 00 ached it.. 00006346 : 6346: ff ff 46 49 4e 44 41 20 64 69 64 6e 27 74 20 73 ..FINDA didn't s 6356: 77 69 74 63 68 20 6f 66 66 20 77 68 69 6c 65 20 witch off while 6366: 75 6e 6c 6f 61 64 69 6e 67 20 66 69 6c 61 6d 65 unloading filame 6376: 6e 74 2e 20 54 72 79 20 75 6e 6c 6f 61 64 69 6e nt. Try unloadin 6386: 67 20 6d 61 6e 75 61 6c 6c 79 2e 20 45 6e 73 75 g manually. Ensu 6396: 72 65 20 66 69 6c 61 6d 65 6e 74 20 63 61 6e 20 re filament can 63a6: 6d 6f 76 65 20 61 6e 64 20 46 49 4e 44 41 20 77 move and FINDA w 63b6: 6f 72 6b 73 2e 00 orks.. 000063bc : 63bc: ff ff 46 49 4e 44 41 20 64 69 64 6e 27 74 20 74 ..FINDA didn't t 63cc: 72 69 67 67 65 72 20 77 68 69 6c 65 20 6c 6f 61 rigger while loa 63dc: 64 69 6e 67 20 74 68 65 20 66 69 6c 61 6d 65 6e ding the filamen 63ec: 74 2e 20 45 6e 73 75 72 65 20 74 68 65 20 66 69 t. Ensure the fi 63fc: 6c 61 6d 65 6e 74 20 63 61 6e 20 6d 6f 76 65 20 lament can move 640c: 61 6e 64 20 46 49 4e 44 41 20 77 6f 72 6b 73 2e and FINDA works. ... 0000641d : 641d: ff ff 44 69 73 61 62 6c 65 00 ..Disable. 00006427 : 6427: ff ff 53 74 6f 70 00 ..Stop. 0000642e : 642e: ff ff 4c 6f 61 64 00 ..Load. 00006435 : 6435: ff ff 55 6e 6c 6f 61 64 00 ..Unload. 0000643e : 643e: ff ff 52 65 73 65 74 4d 4d 55 00 ..ResetMMU. 00006449 : 6449: ff ff 52 65 74 72 79 00 ..Retry. 00006451 : 6451: ff ff 42 65 64 20 6c 65 76 65 6c 69 6e 67 20 66 ..Bed leveling f 6461: 61 69 6c 65 64 2e 20 53 65 6e 73 6f 72 20 64 69 ailed. Sensor di 6471: 64 6e 27 74 20 74 72 69 67 67 65 72 2e 20 44 65 dn't trigger. De 6481: 62 72 69 73 20 6f 6e 20 6e 6f 7a 7a 6c 65 3f 20 bris on nozzle? 6491: 57 61 69 74 69 6e 67 20 66 6f 72 20 72 65 73 65 Waiting for rese 64a1: 74 2e 00 t.. 000064a4 : 64a4: ff ff 53 65 6e 73 69 74 69 76 69 74 79 00 ..Sensitivity. 000064b2 : 64b2: ff ff 44 6f 6e 65 00 ..Done. 000064b9 <__loc_pri_end>: 64b9: 65 6e ori r22, 0xE5 ; 229 64bb: 71 75 andi r23, 0x51 ; 81 64bd: 65 69 ori r22, 0x95 ; 149 64bf: 6e 67 ori r22, 0x7E ; 126 64c1: 20 22 and r2, r16 ... 000064c4 : 64c4: 44 6f 6e 65 20 70 72 69 6e 74 69 6e 67 20 66 69 Done printing fi 64d4: 6c 65 00 le. 000064d7 : 64d7: 4e 6f 20 4c 69 6e 65 20 4e 75 6d 62 65 72 20 77 No Line Number w 64e7: 69 74 68 20 63 68 65 63 6b 73 75 6d 2c 20 4c 61 ith checksum, La 64f7: 73 74 20 4c 69 6e 65 3a 20 00 st Line: . 00006501 : 6501: 4e 6f 20 43 68 65 63 6b 73 75 6d 20 77 69 74 68 No Checksum with 6511: 20 6c 69 6e 65 20 6e 75 6d 62 65 72 2c 20 4c 61 line number, La 6521: 73 74 20 4c 69 6e 65 3a 20 00 st Line: . 0000652b : 652b: 63 68 65 63 6b 73 75 6d 20 6d 69 73 6d 61 74 63 checksum mismatc 653b: 68 2c 20 4c 61 73 74 20 4c 69 6e 65 3a 20 00 h, Last Line: . 0000654a : 654a: 4c 69 6e 65 20 4e 75 6d 62 65 72 20 69 73 20 6e Line Number is n 655a: 6f 74 20 4c 61 73 74 20 4c 69 6e 65 20 4e 75 6d ot Last Line Num 656a: 62 65 72 2b 31 2c 20 4c 61 73 74 20 4c 69 6e 65 ber+1, Last Line 657a: 3a 20 00 : . 0000657d : 657d: 25 6c 75 20 62 79 74 65 73 20 77 72 69 74 74 65 %lu bytes writte 658d: 6e 20 74 6f 20 25 53 20 61 74 20 61 64 64 72 65 n to %S at addre 659d: 73 73 20 30 78 25 30 34 6c 78 0a 00 ss 0x%04lx.. 000065a9 : 65a9: 44 25 64 20 2d 20 52 65 61 64 2f 57 72 69 74 65 D%d - Read/Write 65b9: 20 25 53 0a 00 %S.. 000065be <__c.2367>: 65be: 3f 3f 00 ??. 000065c1 <__c.2365>: 65c1: 52 6f 6d 61 6e 61 00 Romana. 000065c8 <__c.2362>: 65c8: 48 72 76 61 74 73 6b 69 00 Hrvatski. 000065d1 <__c.2359>: 65d1: 4d 61 67 79 61 72 00 Magyar. 000065d8 <__c.2356>: 65d8: 53 6c 6f 76 65 6e 63 69 6e 61 00 Slovencina. 000065e3 <__c.2353>: 65e3: 4e 6f 72 73 6b 00 Norsk. 000065e9 <__c.2350>: 65e9: 53 76 65 6e 73 6b 61 00 Svenska. 000065f1 <__c.2347>: 65f1: 4e 65 64 65 72 6c 61 6e 64 73 00 Nederlands. 000065fc <__c.2344>: 65fc: 50 6f 6c 73 6b 69 00 Polski. 00006603 <__c.2341>: 6603: 49 74 61 6c 69 61 6e 6f 00 Italiano. 0000660c <__c.2338>: 660c: 46 72 61 6e 63 61 69 73 00 Francais. 00006615 <__c.2335>: 6615: 45 73 70 61 6e 6f 6c 00 Espanol. 0000661d <__c.2332>: 661d: 44 65 75 74 73 63 68 00 Deutsch. 00006625 <__c.2329>: 6625: 43 65 73 74 69 6e 61 00 Cestina. 0000662d <__c.2326>: 662d: 45 6e 67 6c 69 73 68 00 English. 00006635 : 6635: 20 43 6f 75 6e 74 20 58 3a 20 00 Count X: . 00006640 : 6640: 45 30 3a 25 64 20 52 50 4d 20 50 52 4e 31 3a 25 E0:%d RPM PRN1:% 6650: 64 20 52 50 4d 20 45 30 40 3a 25 75 20 50 52 4e d RPM E0@:%u PRN 6660: 31 40 3a 25 75 0a 00 1@:%u.. 00006667 : 6667: 52 65 73 65 6e 64 00 Resend. 0000666e : 666e: 25 53 3a 20 25 6c 64 0a 25 53 0a 00 %S: %ld.%S.. 0000667a : 667a: 2f 2f 61 63 74 69 6f 6e 3a 6e 6f 74 69 66 69 63 //action:notific 668a: 61 74 69 6f 6e 20 25 53 0a 00 ation %S.. 00006694 : 6694: 46 69 6c 61 6d 65 6e 74 20 72 75 6e 6f 75 74 20 Filament runout 66a4: 64 65 74 65 63 74 65 64 21 00 detected!. 000066ae : 66ae: 50 72 69 6e 74 65 72 20 73 74 6f 70 70 65 64 20 Printer stopped 66be: 64 75 65 20 74 6f 20 65 72 72 6f 72 73 2e 20 53 due to errors. S 66ce: 75 70 65 72 76 69 73 69 6f 6e 20 72 65 71 75 69 upervision requi 66de: 72 65 64 2e 00 red.. 000066e3 : 66e3: 64 75 6d 70 20 63 6c 65 61 72 65 64 0a 00 dump cleared.. 000066f1 : 66f1: 6e 6f 20 64 75 6d 70 20 61 76 61 69 6c 61 62 6c no dump availabl 6701: 65 0a 00 e.. 00006704 : 6704: 44 32 31 20 2d 20 72 65 61 64 20 63 72 61 73 68 D21 - read crash 6714: 20 64 75 6d 70 0a 00 dump.. 0000671b : 671b: 6e 6f 20 64 75 6d 70 20 61 76 61 69 6c 61 62 6c no dump availabl 672b: 65 0a 00 e.. 0000672e : 672e: 64 75 6d 70 20 63 6f 6d 70 6c 65 74 65 64 20 69 dump completed i 673e: 6e 20 25 6c 75 6d 73 0a 00 n %lums.. 00006747 : 6747: 58 46 4c 41 53 48 00 XFLASH. 0000674e : 674e: 45 45 50 52 4f 4d 00 EEPROM. 00006755 : 6755: 53 52 41 4d 00 SRAM. 0000675a : 675a: 44 2d 31 20 2d 20 45 6e 64 6c 65 73 73 20 6c 6f D-1 - Endless lo 676a: 6f 70 0a 00 op.. 0000676e : 676e: 41 63 74 69 76 65 20 45 78 74 72 75 64 65 72 3a Active Extruder: 677e: 20 30 00 0. 00006781 : 6781: 49 6e 76 61 6c 69 64 20 65 78 74 72 75 64 65 72 Invalid extruder ... 00006792 : 6792: 74 6d 63 32 31 33 30 5f 70 72 69 6e 74 5f 63 75 tmc2130_print_cu 67a2: 72 72 65 6e 74 73 28 29 0a 09 48 09 52 0a 58 09 rrents()..H.R.X. 67b2: 25 64 09 25 64 0a 59 09 25 64 09 25 64 0a 5a 09 %d.%d.Y.%d.%d.Z. 67c2: 25 64 09 25 64 0a 45 09 25 64 09 25 64 0a 00 %d.%d.E.%d.%d.. 000067d1 : 67d1: 53 44 20 70 72 69 6e 74 69 6e 67 20 62 79 74 65 SD printing byte 67e1: 20 00 . 000067e3 : 67e3: 55 6e 6b 6e 6f 77 6e 20 63 6f 6d 6d 61 6e 64 3a Unknown command: 67f3: 20 22 00 ". 000067f6 <_ZZ16process_commandsvE3__c__67_>: 67f6: 4d 32 30 30 20 49 6e 76 61 6c 69 64 20 65 78 74 M200 Invalid ext 6806: 72 75 64 65 72 20 00 ruder . 0000680d : 680d: 7a 5f 6d 61 78 3a 20 00 z_max: . 00006815 : 6815: 7a 5f 6d 69 6e 3a 20 00 z_min: . 0000681d <_ZZ16process_commandsvE3__c__66_>: 681d: 79 5f 6d 61 78 3a 20 00 y_max: . 00006825 <_ZZ16process_commandsvE3__c__65_>: 6825: 79 5f 6d 69 6e 3a 20 00 y_min: . 0000682d <_ZZ16process_commandsvE3__c__64_>: 682d: 78 5f 6d 61 78 3a 20 00 x_max: . 00006835 : 6835: 54 52 49 47 47 45 52 45 44 00 TRIGGERED. 0000683f : 683f: 6f 70 65 6e 00 open. 00006844 <_ZZ16process_commandsvE3__c__63_>: 6844: 78 5f 6d 69 6e 3a 20 00 x_min: . 0000684c <_ZZ16process_commandsvE3__c__62_>: 684c: 52 65 70 6f 72 74 69 6e 67 20 65 6e 64 73 74 6f Reporting endsto 685c: 70 20 73 74 61 74 75 73 00 p status. 00006865 : 6865: 4d 31 31 32 20 63 61 6c 6c 65 64 2e 20 45 6d 65 M112 called. Eme 6875: 72 67 65 6e 63 79 20 53 74 6f 70 2e 00 rgency Stop.. 00006882 : 6882: 2f 2f 61 63 74 69 6f 6e 3a 75 76 6c 6f 5f 72 65 //action:uvlo_re 6892: 63 6f 76 65 72 79 5f 72 65 61 64 79 00 covery_ready. 0000689f : 689f: 2f 2f 61 63 74 69 6f 6e 3a 75 76 6c 6f 5f 61 75 //action:uvlo_au 68af: 74 6f 5f 72 65 63 6f 76 65 72 79 5f 72 65 61 64 to_recovery_read 68bf: 79 00 y. 000068c1 <_ZZ16process_commandsvE3__c__45_>: 68c1: 53 49 4c 45 4e 54 00 SILENT. 000068c8 <_ZZ16process_commandsvE3__c__44_>: 68c8: 4e 4f 52 4d 41 4c 00 NORMAL. 000068cf <_ZZ16process_commandsvE3__c__43_>: 68cf: 25 53 20 4d 4f 44 45 3a 20 50 65 72 63 65 6e 74 %S MODE: Percent 68df: 20 64 6f 6e 65 3a 20 25 68 68 64 3b 20 70 72 69 done: %hhd; pri 68ef: 6e 74 20 74 69 6d 65 20 72 65 6d 61 69 6e 69 6e nt time remainin 68ff: 67 20 69 6e 20 6d 69 6e 73 3a 20 25 64 3b 20 43 g in mins: %d; C 690f: 68 61 6e 67 65 20 69 6e 20 6d 69 6e 73 3a 20 25 hange in mins: % 691f: 64 0a 00 d.. 00006922 <_ZZ16process_commandsvE3__c__42_>: 6922: 50 72 69 6e 74 65 72 53 74 61 74 65 3a 20 25 64 PrinterState: %d 6932: 0a 00 .. 00006934 <_ZZ16process_commandsvE3__c__38_>: 6934: 45 6e 64 20 66 69 6c 65 20 6c 69 73 74 00 End file list. 00006942 <_ZZ16process_commandsvE3__c__37_>: 6942: 42 65 67 69 6e 20 66 69 6c 65 20 6c 69 73 74 00 Begin file list. 00006952 : 6952: 55 6e 6b 6e 6f 77 6e 20 25 63 20 63 6f 64 65 3a Unknown %c code: 6962: 20 25 73 0a 00 %s.. 00006967 <_ZZ16process_commandsvE3__c__35_>: 6967: 0a 50 49 4e 44 41 20 74 65 6d 70 65 72 61 74 75 .PINDA temperatu 6977: 72 65 3a 20 25 2e 31 66 20 5a 20 73 68 69 66 74 re: %.1f Z shift 6987: 20 28 6d 6d 29 3a 20 25 2e 33 66 00 (mm): %.3f. 00006993 <_ZZ16process_commandsvE3__c__34_>: 6993: 0a 53 74 65 70 3a 20 25 64 2f 36 0a 00 .Step: %d/6.. 000069a0 <_ZZ16process_commandsvE3__c__33_>: 69a0: 0a 53 74 65 70 3a 20 25 64 2f 36 20 28 73 6b 69 .Step: %d/6 (ski 69b0: 70 70 65 64 29 0a 50 49 4e 44 41 20 74 65 6d 70 pped).PINDA temp 69c0: 65 72 61 74 75 72 65 3a 20 25 64 20 5a 20 73 68 erature: %d Z sh 69d0: 69 66 74 20 28 6d 6d 29 3a 30 0a 00 ift (mm):0.. 000069dc <_ZZ16process_commandsvE3__c__32_>: 69dc: 0a 5a 45 52 4f 3a 20 25 2e 33 66 0a 00 .ZERO: %.3f.. 000069e9 <_ZZ16process_commandsvE3__c__31_>: 69e9: 73 74 61 72 74 20 74 65 6d 70 65 72 61 74 75 72 start temperatur 69f9: 65 3a 20 25 2e 31 66 0a 00 e: %.1f.. 00006a02 <_ZZ16process_commandsvE3__c__28_>: 6a02: 25 64 20 20 25 2e 32 66 00 %d %.2f. 00006a0b <_ZZ16process_commandsvE3__c__27_>: 6a0b: 25 53 20 58 3a 20 25 2e 35 66 20 59 3a 20 25 2e %S X: %.5f Y: %. 6a1b: 35 66 20 5a 3a 20 25 2e 35 66 0a 00 5f Z: %.5f.. 00006a27 <_ZZ16process_commandsvE3__c__26_>: 6a27: 53 6c 65 65 70 2e 2e 2e 00 Sleep.... 00006a30 <_ZZ16process_commandsvE3__c__10_>: 6a30: 45 30 3a 25 64 20 52 50 4d 0a 50 52 4e 30 3a 25 E0:%d RPM.PRN0:% 6a40: 64 20 52 50 4d 0a 00 d RPM.. 00006a47 : 6a47: 4d 31 30 37 00 M107. 00006a4c : 6a4c: 42 3a 20 25 33 64 20 20 20 20 20 58 64 3a 25 36 B: %3d Xd:%6 6a5c: 64 0a 53 3a 20 25 33 64 20 20 20 20 20 59 64 3a d.S: %3d Yd: 6a6c: 25 36 64 00 %6d. 00006a70 : 6a70: 46 49 4e 44 41 00 FINDA. 00006a76 : 6a76: 50 49 4e 44 41 00 PINDA. 00006a7c : 6a7c: 57 69 7a 61 72 64 20 65 6e 64 20 73 74 61 74 65 Wizard end state 6a8c: 3a 20 25 64 0a 00 : %d.. 00006a92 : 6a92: 53 70 6f 6f 6c 4a 6f 69 6e 00 SpoolJoin. 00006a9c : 6a9c: 46 69 72 6d 77 61 72 65 00 Firmware. 00006aa5 : 6aa5: 48 42 65 64 20 6f 6e 20 6c 6f 61 64 00 HBed on load. 00006ab2 : 6ab2: 46 6c 61 73 68 41 69 72 00 FlashAir. 00006abb : 6abb: 54 68 65 72 6d 61 6c 20 4d 6f 64 65 6c 20 63 61 Thermal Model ca 6acb: 6c 2e 00 l.. 00006ace : 6ace: 45 72 72 3a 50 52 49 4e 54 20 46 41 4e 20 45 52 Err:PRINT FAN ER 6ade: 52 4f 52 00 ROR. 00006ae2 : 6ae2: 45 72 72 3a 48 4f 54 45 4e 44 20 46 41 4e 20 45 Err:HOTEND FAN E 6af2: 52 52 4f 52 00 RROR. 00006af7 : 6af7: 2f 2f 61 63 74 69 6f 6e 3a 72 65 73 75 6d 65 64 //action:resumed ... 00006b08 : 6b08: 2f 2f 61 63 74 69 6f 6e 3a 72 65 73 75 6d 65 00 //action:resume. 00006b18 : 6b18: 2f 2f 61 63 74 69 6f 6e 3a 72 65 61 64 79 00 //action:ready. 00006b27 : 6b27: 2f 2f 61 63 74 69 6f 6e 3a 6e 6f 74 5f 72 65 61 //action:not_rea 6b37: 64 79 00 dy. 00006b3a : 6b3a: 2f 2f 61 63 74 69 6f 6e 3a 63 61 6e 63 65 6c 00 //action:cancel. 00006b4a : 6b4a: 41 78 69 73 20 6c 65 6e 67 74 68 20 64 69 66 66 Axis length diff 6b5a: 65 72 65 6e 63 65 3a 25 2e 33 66 0a 00 erence:%.3f.. 00006b67 : 6b67: 4d 65 61 73 75 72 65 64 20 61 78 69 73 20 6c 65 Measured axis le 6b77: 6e 67 74 68 3a 25 2e 33 66 0a 00 ngth:%.3f.. 00006b82 : 6b82: 4f 4b 00 OK. 00006b85 : 6b85: 4c 43 44 20 73 74 61 74 75 73 20 63 68 61 6e 67 LCD status chang 6b95: 65 64 00 ed. 00006b98 <_ZZN10CardReader7releaseEvE3__c.lto_priv.534>: 6b98: 53 44 20 63 61 72 64 20 72 65 6c 65 61 73 65 64 SD card released ... 00006ba9 : 6ba9: 46 61 6b 65 20 73 65 72 69 61 6c 20 6e 75 6d 62 Fake serial numb 6bb9: 65 72 00 er. 00006bbc : 6bbc: 45 2d 63 6f 6f 6c 20 6d 6f 64 65 00 E-cool mode. 00006bc8 : 6bc8: 2f 2f 61 63 74 69 6f 6e 3a 73 74 61 72 74 00 //action:start. 00006bd7 : 6bd7: 4d 38 34 00 M84. 00006bdb : 6bdb: 4d 37 30 32 00 M702. 00006be0 : 6be0: 4d 38 33 00 M83. 00006be4 : 6be4: 47 32 38 20 57 00 G28 W. 00006bea : 6bea: 4d 35 30 30 00 M500. 00006bef : 6bef: 45 78 74 65 72 6e 61 6c 20 53 50 49 20 66 6c 61 External SPI fla 6bff: 73 68 0a 58 46 4c 41 53 48 20 69 73 20 6e 6f 74 sh.XFLASH is not 6c0f: 20 72 65 73 2d 0a 70 6f 6e 64 69 6e 67 2e 20 4c res-.ponding. L 6c1f: 61 6e 67 75 61 67 65 0a 73 77 69 74 63 68 20 75 anguage.switch u 6c2f: 6e 61 76 61 69 6c 61 62 6c 65 2e 00 navailable.. 00006c3b : 6c3b: 58 46 4c 41 53 48 20 6e 6f 74 20 72 65 73 70 6f XFLASH not respo 6c4b: 6e 64 69 6e 67 2e 00 nding.. 00006c52 : 6c52: 46 57 20 63 72 61 73 68 20 64 65 74 65 63 74 65 FW crash detecte 6c62: 64 21 20 59 6f 75 20 63 61 6e 20 63 6f 6e 74 69 d! You can conti 6c72: 6e 75 65 20 70 72 69 6e 74 69 6e 67 2e 20 44 65 nue printing. De 6c82: 62 75 67 20 64 61 74 61 20 61 76 61 69 6c 61 62 bug data availab 6c92: 6c 65 20 66 6f 72 20 61 6e 61 6c 79 73 69 73 2e le for analysis. 6ca2: 20 43 6f 6e 74 61 63 74 20 73 75 70 70 6f 72 74 Contact support 6cb2: 20 74 6f 20 73 75 62 6d 69 74 20 64 65 74 61 69 to submit detai 6cc2: 6c 73 2e 00 ls.. 00006cc6 : 6cc6: 2f 2f 61 63 74 69 6f 6e 3a 64 75 6d 70 5f 61 76 //action:dump_av 6cd6: 61 69 6c 61 62 6c 65 00 ailable. 00006cde <_ZZ5setupE3__c__11_>: 6cde: 43 72 61 73 68 44 65 74 65 63 74 20 44 49 53 41 CrashDetect DISA 6cee: 42 4c 45 44 00 BLED. 00006cf3 <_ZZ5setupE3__c__10_>: 6cf3: 43 72 61 73 68 44 65 74 65 63 74 20 45 4e 41 42 CrashDetect ENAB 6d03: 4c 45 44 21 00 LED!. 00006d08 : 6d08: 20 20 50 6c 61 6e 6e 65 72 42 75 66 66 65 72 42 PlannerBufferB 6d18: 79 74 65 73 3a 20 00 ytes: . 00006d1f : 6d1f: 20 46 72 65 65 20 4d 65 6d 6f 72 79 3a 20 00 Free Memory: . 00006d2e : 6d2e: 20 7c 20 41 75 74 68 6f 72 3a 20 00 | Author: . 00006d3a : 6d3a: 20 4c 61 73 74 20 55 70 64 61 74 65 64 3a 20 00 Last Updated: . 00006d4a : 6d4a: 20 53 6f 66 74 77 61 72 65 20 52 65 73 65 74 00 Software Reset. 00006d5a : 6d5a: 20 57 61 74 63 68 64 6f 67 20 52 65 73 65 74 00 Watchdog Reset. 00006d6a : 6d6a: 20 42 72 6f 77 6e 20 6f 75 74 20 52 65 73 65 74 Brown out Reset ... 00006d7b : 6d7b: 20 45 78 74 65 72 6e 61 6c 20 52 65 73 65 74 00 External Reset. 00006d8b : 6d8b: 50 6f 77 65 72 55 70 00 PowerUp. 00006d93 : 6d93: 65 72 72 6f 72 20 77 72 69 74 69 6e 67 20 74 6f error writing to 6da3: 20 66 69 6c 65 00 file. 00006da9 : 6da9: 44 6f 6e 65 20 73 61 76 69 6e 67 20 66 69 6c 65 Done saving file 6db9: 2e 00 .. 00006dbb : 6dbb: 6f 6b 00 ok. 00006dbe : 6dbe: 46 69 6c 61 6d 65 6e 74 00 Filament. 00006dc7 : 6dc7: 50 4f 57 45 52 20 50 41 4e 49 43 20 44 45 54 45 POWER PANIC DETE 6dd7: 43 54 45 44 00 CTED. 00006ddc : 6ddc: 55 56 4c 4f 20 2d 20 65 6e 64 20 25 64 0a 00 UVLO - end %d.. 00006deb : 6deb: 55 56 4c 4f 5f 54 49 4e 59 20 2d 20 65 6e 64 20 UVLO_TINY - end 6dfb: 25 64 0a 00 %d.. 00006dff : 6dff: 77 6f 72 6c 64 20 63 6f 6f 72 64 69 6e 61 74 65 world coordinate 6e0f: 73 3a 20 28 25 2e 33 66 2c 20 25 2e 33 66 2c 20 s: (%.3f, %.3f, 6e1f: 25 2e 33 66 29 0a 00 %.3f).. 00006e26 : 6e26: 4d 32 32 30 20 53 25 64 00 M220 S%d. 00006e2f : 6e2f: 44 6f 6e 65 20 72 65 61 64 69 6e 67 20 45 45 50 Done reading EEP 6e3f: 52 4f 4d 0a 00 ROM.. 00006e44 : 6e44: 54 65 6d 70 65 72 61 74 75 72 65 20 52 65 73 74 Temperature Rest 6e54: 6f 72 65 64 0a 00 ored.. 00006e5a : 6e5a: 47 31 20 45 25 2d 2e 33 66 20 46 32 37 30 30 00 G1 E%-.3f F2700. 00006e6a : 6e6a: 54 4d 43 20 44 52 49 56 45 52 20 4f 56 45 52 54 TMC DRIVER OVERT 6e7a: 45 4d 50 00 EMP. 00006e7e : 6e7e: 48 6f 6c 64 20 63 75 72 72 65 6e 74 20 74 72 75 Hold current tru 6e8e: 6e 63 61 74 65 64 20 74 6f 20 52 75 6e 20 63 75 ncated to Run cu 6e9e: 72 72 65 6e 74 00 rrent. 00006ea4 : 6ea4: 25 63 25 33 64 2f 25 64 81 00 %c%3d/%d.. 00006eae : 6eae: 5a 25 36 2e 32 66 25 63 00 Z%6.2f%c. 00006eb7 : 6eb7: 5a 20 20 20 2d 2d 2d 20 00 Z --- . 00006ec0 : 6ec0: 86 25 33 64 25 25 00 .%3d%%. 00006ec7 : 6ec7: 2d 2d 2d 25 25 00 ---%%. 00006ecd : 6ecd: 25 33 64 25 25 00 %3d%%. 00006ed3 : 6ed3: 20 53 44 00 SD. 00006ed7 : 6ed7: 20 20 20 00 . 00006edb : 6edb: 20 48 4f 00 HO. 00006edf : 6edf: 87 25 33 75 68 20 25 63 25 63 00 .%3uh %c%c. 00006eea : 6eea: 87 25 30 32 75 3a 25 30 32 75 25 63 25 63 00 .%02u:%02u%c%c. 00006ef9 : 6ef9: 2f 2f 61 63 74 69 6f 6e 3a 70 61 75 73 65 64 00 //action:paused. 00006f09 : 6f09: 2f 2f 61 63 74 69 6f 6e 3a 70 61 75 73 65 00 //action:pause. 00006f18 <_ZZL16lcd_support_menuvE3__c__16_>: 6f18: 44 75 6d 70 20 6d 65 6d 6f 72 79 00 Dump memory. 00006f24 : 6f24: 68 65 6c 70 2e 70 72 75 73 61 33 64 2e 63 6f 6d help.prusa3d.com ... 00006f35 : 6f35: 66 6f 72 75 6d 2e 70 72 75 73 61 33 64 2e 63 6f forum.prusa3d.co 6f45: 6d 00 m. 00006f47 : 6f47: 70 72 75 73 61 33 64 2e 63 6f 6d 00 prusa3d.com. 00006f53 : 6f53: 4d 37 30 31 00 M701. 00006f58 : 6f58: 25 53 3a 0a 25 31 38 2e 32 66 6d 20 0a 25 53 3a %S:.%18.2fm .%S: 6f68: 0a 25 31 30 6c 64 64 20 25 30 32 64 68 20 25 30 .%10ldd %02dh %0 6f78: 32 64 6d 00 2dm. 00006f7c : 6f7c: 25 53 3a 0a 25 31 38 2e 32 66 6d 20 0a 25 53 3a %S:.%18.2fm .%S: 6f8c: 0a 25 31 30 6c 64 68 20 25 30 32 64 6d 20 25 30 .%10ldh %02dm %0 6f9c: 32 64 73 00 2ds. 00006fa0 : 6fa0: 25 36 2e 32 66 6d 6d 00 %6.2fmm. 00006fa8 : 6fa8: 25 53 0a 25 53 0a 25 53 3a 0a 25 53 3a 00 %S.%S.%S:.%S:. 00006fb6 : 6fb6: 25 33 2e 32 66 81 00 %3.2f.. 00006fbd : 6fbd: 25 2d 31 34 2e 31 34 53 3a 0a 25 53 0a 25 2d 31 %-14.14S:.%S.%-1 6fcd: 34 2e 31 34 53 3a 25 33 2e 32 66 81 0a 25 2d 31 4.14S:%3.2f..%-1 6fdd: 34 2e 31 34 53 3a 25 33 2e 32 66 81 00 4.14S:%3.2f.. 00006fea : 6fea: 20 20 30 00 0. 00006fee : 6fee: 20 20 31 00 1. 00006ff2 : 6ff2: 4d 65 61 73 75 72 65 64 20 73 6b 65 77 73 3a 20 Measured skews: 7002: 25 66 20 25 66 0a 00 %f %f.. 00007009 : 7009: 46 69 74 74 69 6e 67 20 66 61 69 6c 65 64 20 3d Fitting failed = 7019: 3e 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 66 61 > calibration fa 7029: 69 6c 65 64 2e 0a 00 iled... 00007030 : 7030: 43 61 6c 69 62 72 61 74 69 6f 6e 20 73 75 63 63 Calibration succ 7040: 65 73 73 2e 0a 00 ess... 00007046 : 7046: 41 6c 6c 20 34 20 63 61 6c 69 62 72 61 74 69 6f All 4 calibratio 7056: 6e 20 70 6f 69 6e 74 73 20 66 6f 75 6e 64 2e 0a n points found.. ... 00007067 : 7067: 31 2f 34 00 1/4. 0000706b : 706b: 31 2f 34 00 1/4. 0000706f : 706f: 31 2f 39 00 1/9. 00007073 : 7073: 50 72 75 73 61 20 69 33 20 4d 4b 33 2d 52 20 4f Prusa i3 MK3-R O 7083: 4b 2e 00 K.. 00007086 : 7086: 53 44 20 63 61 72 64 20 6f 6b 00 SD card ok. 00007091 : 7091: 6f 70 65 6e 52 6f 6f 74 20 66 61 69 6c 65 64 00 openRoot failed. 000070a1 : 70a1: 76 6f 6c 75 6d 65 2e 69 6e 69 74 20 66 61 69 6c volume.init fail 70b1: 65 64 00 ed. 000070b4 : 70b4: 53 44 20 69 6e 69 74 20 66 61 69 6c 00 SD init fail. 000070c1 : 70c1: 6f 70 65 6e 20 66 61 69 6c 65 64 2c 20 46 69 6c open failed, Fil 70d1: 65 3a 20 00 e: . 000070d5 : 70d5: 43 61 6e 6e 6f 74 20 65 6e 74 65 72 20 73 75 62 Cannot enter sub 70e5: 64 69 72 3a 20 00 dir: . 000070eb : 70eb: 4d 36 30 30 00 M600. 000070f0 : 70f0: 4d 32 34 00 M24. 000070f4 : 70f4: 4d 32 33 20 25 73 00 M23 %s. 000070fb : 70fb: 31 2f 39 00 1/9. 000070ff : 70ff: 88 00 .. 00007101 : 7101: 20 74 6f 6f 20 6c 6f 6e 67 20 65 78 74 72 75 73 too long extrus 7111: 69 6f 6e 20 70 72 65 76 65 6e 74 65 64 00 ion prevented. 0000711f : 711f: 20 63 6f 6c 64 20 65 78 74 72 75 73 69 6f 6e 20 cold extrusion 712f: 70 72 65 76 65 6e 74 65 64 00 prevented. 00007139 : 7139: 4d 6f 76 65 20 61 62 6f 72 74 65 64 00 Move aborted. 00007146 <__noloc_end>: 7146: 08 4a sbci r16, 0xA8 ; 168 7148: d7 3b cpi r29, 0xB7 ; 183 714a: 3b ce rjmp .-906 ; 0x6dc2 714c: 01 6e ori r16, 0xE1 ; 225 714e: 84 bc out 0x24, r8 ; 36 7150: bf fd .word 0xfdbf ; ???? 7152: c1 2f mov r28, r17 7154: 3d 6c ori r19, 0xCD ; 205 7156: 74 31 cpi r23, 0x14 ; 20 7158: 9a bd out 0x2a, r25 ; 42 715a: 56 83 std Z+6, r21 ; 0x06 715c: 3d da rcall .-2950 ; 0x65d8 <__c.2356> 715e: 3d 00 .word 0x003d ; ???? 7160: c7 7f andi r28, 0xF7 ; 247 7162: 11 be out 0x31, r1 ; 49 7164: d9 e4 ldi r29, 0x49 ; 73 7166: bb 4c sbci r27, 0xCB ; 203 7168: 3e 91 ld r19, -X 716a: 6b aa std Y+51, r6 ; 0x33 716c: aa be out 0x3a, r10 ; 58 716e: 00 00 nop 7170: 00 80 ld r0, Z 7172: 3f 05 cpc r19, r15 7174: a8 4c sbci r26, 0xC8 ; 200 7176: cd b2 in r12, 0x1d ; 29 7178: d4 4e sbci r29, 0xE4 ; 228 717a: b9 38 cpi r27, 0x89 ; 137 717c: 36 a9 ldd r19, Z+54 ; 0x36 717e: 02 0c add r0, r2 7180: 50 b9 out 0x00, r21 ; 0 7182: 91 86 std Z+9, r9 ; 0x09 7184: 88 08 sbc r8, r8 7186: 3c a6 std Y+44, r3 ; 0x2c 7188: aa aa std Y+50, r10 ; 0x32 718a: 2a be out 0x3a, r2 ; 58 718c: 00 00 nop 718e: 00 80 ld r0, Z 7190: 3f 07 cpc r19, r31 7192: 63 42 sbci r22, 0x23 ; 35 7194: 36 b7 in r19, 0x36 ; 54 7196: 9b d8 rcall .-3786 ; 0x62ce 7198: a7 1a sub r10, r23 719a: 39 68 ori r19, 0x89 ; 137 719c: 56 18 sub r5, r6 719e: ae ba out 0x1e, r10 ; 30 71a0: ab 55 subi r26, 0x5B ; 91 71a2: 8c 1d adc r24, r12 71a4: 3c b7 in r19, 0x3c ; 60 71a6: cc 57 subi r28, 0x7C ; 124 71a8: 63 bd out 0x23, r22 ; 35 71aa: 6d ed ldi r22, 0xDD ; 221 71ac: fd 75 andi r31, 0x5D ; 93 71ae: 3e f6 brtc .-114 ; 0x713e 71b0: 17 72 andi r17, 0x27 ; 39 71b2: 31 bf out 0x31, r19 ; 49 71b4: 00 00 nop 71b6: 00 80 ld r0, Z 71b8: 3f 08 sbc r3, r15 71ba: 00 00 nop 71bc: 00 be out 0x30, r0 ; 48 71be: 92 24 eor r9, r2 71c0: 49 12 cpse r4, r25 71c2: 3e ab std Y+54, r19 ; 0x36 71c4: aa aa std Y+50, r10 ; 0x32 71c6: 2a be out 0x3a, r2 ; 58 71c8: cd cc rjmp .-1638 ; 0x6b64 71ca: cc 4c sbci r28, 0xCC ; 204 71cc: 3e 00 .word 0x003e ; ???? 71ce: 00 00 nop 71d0: 80 be out 0x30, r8 ; 48 71d2: ab aa std Y+51, r10 ; 0x33 71d4: aa aa std Y+50, r10 ; 0x32 71d6: 3e 00 .word 0x003e ; ???? 71d8: 00 00 nop 71da: 00 bf out 0x30, r16 ; 48 71dc: 00 00 nop 71de: 00 80 ld r0, Z 71e0: 3f 00 .word 0x003f ; ???? 71e2: 00 00 nop 71e4: 00 00 nop 71e6: 08 41 sbci r16, 0x18 ; 24 71e8: 78 d3 rcall .+1776 ; 0x78da 71ea: bb 43 sbci r27, 0x3B ; 59 71ec: 87 d1 rcall .+782 ; 0x74fc <__trampolines_start+0x2e8> 71ee: 13 3d cpi r17, 0xD3 ; 211 71f0: 19 0e add r1, r25 71f2: 3c c3 rjmp .+1656 ; 0x786c 71f4: bd 42 sbci r27, 0x2D ; 45 71f6: 82 ad ldd r24, Z+58 ; 0x3a 71f8: 2b 3e cpi r18, 0xEB ; 235 71fa: 68 ec ldi r22, 0xC8 ; 200 71fc: 82 76 andi r24, 0x62 ; 98 71fe: be d9 rcall .-3204 ; 0x657c 7200: 8f e1 ldi r24, 0x1F ; 31 7202: a9 3e cpi r26, 0xE9 ; 233 7204: 4c 80 ldd r4, Y+4 ; 0x04 7206: ef ff .word 0xffef ; ???? 7208: be 01 movw r22, r28 720a: c4 ff sbrs r28, 4 720c: 7f 3f cpi r23, 0xFF ; 255 720e: 00 00 nop 7210: 00 00 nop ... 00007214 <__trampolines_start>: 7214: 0c 94 e6 cc jmp 0x199cc ; 0x199cc 7218: 0c 94 ae d0 jmp 0x1a15c ; 0x1a15c 721c: 0c 94 4b ee jmp 0x1dc96 ; 0x1dc96 7220: 0c 94 b5 d0 jmp 0x1a16a ; 0x1a16a 7224: 0c 94 f9 cc jmp 0x199f2 ; 0x199f2 7228: 0c 94 fd cc jmp 0x199fa ; 0x199fa 722c: 0d 94 6b 19 jmp 0x232d6 ; 0x232d6 7230: 0d 94 b5 3f jmp 0x27f6a ; 0x27f6a 7234: 0c 94 da cc jmp 0x199b4 ; 0x199b4 7238: 0c 94 57 e1 jmp 0x1c2ae ; 0x1c2ae 723c: 0c 94 34 df jmp 0x1be68 ; 0x1be68 7240: 0c 94 2a f0 jmp 0x1e054 ; 0x1e054 7244: 0c 94 d4 e9 jmp 0x1d3a8 ; 0x1d3a8 7248: 0c 94 79 e9 jmp 0x1d2f2 ; 0x1d2f2 724c: 0c 94 48 df jmp 0x1be90 ; 0x1be90 7250: 0c 94 75 64 jmp 0xc8ea ; 0xc8ea <_GLOBAL__sub_D_card> 7254: 0c 94 6f e9 jmp 0x1d2de ; 0x1d2de 7258: 0c 94 d9 cf jmp 0x19fb2 ; 0x19fb2 725c: 0c 94 75 f4 jmp 0x1e8ea ; 0x1e8ea 7260: 0c 94 02 d4 jmp 0x1a804 ; 0x1a804 7264: 0d 94 ae 16 jmp 0x22d5c ; 0x22d5c 7268: 0d 94 3d a0 jmp 0x3407a ; 0x3407a 726c: 0c 94 ce e1 jmp 0x1c39c ; 0x1c39c 7270: 0c 94 40 fa jmp 0x1f480 ; 0x1f480 7274: 0c 94 8d db jmp 0x1b71a ; 0x1b71a 7278: 0c 94 8a 74 jmp 0xe914 ; 0xe914 <__vector_23+0xd0> 727c: 0d 94 d9 0a jmp 0x215b2 ; 0x215b2 7280: 0c 94 99 d8 jmp 0x1b132 ; 0x1b132 7284: 0c 94 b7 cd jmp 0x19b6e ; 0x19b6e 7288: 0c 94 66 74 jmp 0xe8cc ; 0xe8cc <__vector_23+0x88> 728c: 0d 94 cd 09 jmp 0x2139a ; 0x2139a 7290: 0c 94 d1 d0 jmp 0x1a1a2 ; 0x1a1a2 7294: 0d 94 99 14 jmp 0x22932 ; 0x22932 7298: 0d 94 68 16 jmp 0x22cd0 ; 0x22cd0 729c: 0c 94 14 cd jmp 0x19a28 ; 0x19a28 72a0: 0d 94 b2 50 jmp 0x2a164 ; 0x2a164 72a4: 0c 94 c7 cf jmp 0x19f8e ; 0x19f8e 72a8: 0c 94 b6 d3 jmp 0x1a76c ; 0x1a76c ()> 72ac: 0d 94 0f 51 jmp 0x2a21e ; 0x2a21e 72b0: 0c 94 e8 e9 jmp 0x1d3d0 ; 0x1d3d0 72b4: 0c 94 8b d9 jmp 0x1b316 ; 0x1b316 72b8: 0c 94 93 e9 jmp 0x1d326 ; 0x1d326 72bc: 0d 94 a6 1e jmp 0x23d4c ; 0x23d4c 72c0: 0c 94 73 e1 jmp 0x1c2e6 ; 0x1c2e6 72c4: 0d 94 b7 1e jmp 0x23d6e ; 0x23d6e 72c8: 0c 94 46 f8 jmp 0x1f08c ; 0x1f08c 72cc: 0d 94 02 ad jmp 0x35a04 ; 0x35a04 72d0: 0d 94 f4 a6 jmp 0x34de8 ; 0x34de8 72d4: 0d 94 98 0f jmp 0x21f30 ; 0x21f30 72d8: 0d 94 3a a0 jmp 0x34074 ; 0x34074 72dc: 0c 94 8d e1 jmp 0x1c31a ; 0x1c31a 72e0: 0c 94 7e e1 jmp 0x1c2fc ; 0x1c2fc 72e4: 0c 94 6e f0 jmp 0x1e0dc ; 0x1e0dc 72e8: 0c 94 9d cf jmp 0x19f3a ; 0x19f3a 72ec: 0d 94 26 19 jmp 0x2324c ; 0x2324c 72f0: 0d 94 43 16 jmp 0x22c86 ; 0x22c86 72f4: 0d 94 96 20 jmp 0x2412c ; 0x2412c 72f8: 0c 94 5b fa jmp 0x1f4b6 ; 0x1f4b6 72fc: 0d 94 ee a6 jmp 0x34ddc ; 0x34ddc 7300: 0d 94 fd ac jmp 0x359fa ; 0x359fa 7304: 0c 94 f3 cc jmp 0x199e6 ; 0x199e6 7308: 0c 94 56 e9 jmp 0x1d2ac ; 0x1d2ac 730c: 0d 94 2f 73 jmp 0x2e65e ; 0x2e65e 7310: 0d 94 f0 ac jmp 0x359e0 ; 0x359e0 7314: 0d 94 49 50 jmp 0x2a092 ; 0x2a092 7318: 0c 94 ca e0 jmp 0x1c194 ; 0x1c194 731c: 0c 94 b1 d3 jmp 0x1a762 ; 0x1a762 ()> 7320: 0d 94 56 0a jmp 0x214ac ; 0x214ac 7324: 0d 94 58 29 jmp 0x252b0 ; 0x252b0 7328: 0c 94 5b 74 jmp 0xe8b6 ; 0xe8b6 <__vector_23+0x72> 732c: 0c 94 bf f9 jmp 0x1f37e ; 0x1f37e 7330: 0c 94 e2 cc jmp 0x199c4 ; 0x199c4 7334: 0d 94 50 50 jmp 0x2a0a0 ; 0x2a0a0 7338: 0c 94 26 cd jmp 0x19a4c ; 0x19a4c 733c: 0c 94 a7 d3 jmp 0x1a74e ; 0x1a74e ()> 7340: 0c 94 de e9 jmp 0x1d3bc ; 0x1d3bc 7344: 0c 94 9d e9 jmp 0x1d33a ; 0x1d33a 7348: 0d 94 00 17 jmp 0x22e00 ; 0x22e00 734c: 0c 94 6a cf jmp 0x19ed4 ; 0x19ed4 7350: 0c 94 0e d0 jmp 0x1a01c ; 0x1a01c 7354: 0c 94 c1 e0 jmp 0x1c182 ; 0x1c182 7358: 0c 94 89 d2 jmp 0x1a512 ; 0x1a512 735c: 0c 94 26 d7 jmp 0x1ae4c ; 0x1ae4c 7360: 0c 94 46 d4 jmp 0x1a88c ; 0x1a88c 7364: 0c 94 06 e2 jmp 0x1c40c ; 0x1c40c 7368: 0c 94 c0 d3 jmp 0x1a780 ; 0x1a780 ()> 736c: 0c 94 c8 74 jmp 0xe990 ; 0xe990 <__vector_23+0x14c> 7370: 0d 94 58 a0 jmp 0x340b0 ; 0x340b0 7374: 0d 94 4c a0 jmp 0x34098 ; 0x34098 7378: 0c 94 6b d9 jmp 0x1b2d6 ; 0x1b2d6 737c: 0d 94 30 2b jmp 0x25660 ; 0x25660 7380: 0c 94 5f e1 jmp 0x1c2be ; 0x1c2be 7384: 0c 94 67 e1 jmp 0x1c2ce ; 0x1c2ce 7388: 0d 94 cc 17 jmp 0x22f98 ; 0x22f98 738c: 0c 94 69 ef jmp 0x1ded2 ; 0x1ded2 7390: 0c 94 3c cf jmp 0x19e78 ; 0x19e78 7394: 0c 94 7a e0 jmp 0x1c0f4 ; 0x1c0f4 7398: 0c 94 15 cd jmp 0x19a2a ; 0x19a2a 739c: 0d 94 d5 0a jmp 0x215aa ; 0x215aa 73a0: 0c 94 52 fa jmp 0x1f4a4 ; 0x1f4a4 73a4: 0c 94 bb d3 jmp 0x1a776 ; 0x1a776 ()> 73a8: 0c 94 01 e0 jmp 0x1c002 ; 0x1c002 73ac: 0d 94 09 50 jmp 0x2a012 ; 0x2a012 73b0: 0c 94 fb cf jmp 0x19ff6 ; 0x19ff6 73b4: 0c 94 c4 d3 jmp 0x1a788 ; 0x1a788 73b8: 0d 94 5b 16 jmp 0x22cb6 ; 0x22cb6 73bc: 0c 94 07 cd jmp 0x19a0e ; 0x19a0e 73c0: 0c 94 ed f4 jmp 0x1e9da ; 0x1e9da 73c4: 0d 94 ff 50 jmp 0x2a1fe ; 0x2a1fe 73c8: 0d 94 07 51 jmp 0x2a20e ; 0x2a20e 73cc: 0d 94 86 27 jmp 0x24f0c ; 0x24f0c 73d0: 0c 94 04 cf jmp 0x19e08 ; 0x19e08 73d4: 0c 94 6f fa jmp 0x1f4de ; 0x1f4de 73d8: 0d 94 b8 50 jmp 0x2a170 ; 0x2a170 73dc: 0c 94 b6 74 jmp 0xe96c ; 0xe96c <__vector_23+0x128> 73e0: 0d 94 17 51 jmp 0x2a22e ; 0x2a22e 73e4: 0c 94 8e ce jmp 0x19d1c ; 0x19d1c 73e8: 0d 94 ca 1c jmp 0x23994 ; 0x23994 73ec: 0d 94 9d 14 jmp 0x2293a ; 0x2293a 73f0: 0d 94 f7 50 jmp 0x2a1ee ; 0x2a1ee 73f4: 0c 94 63 76 jmp 0xecc6 ; 0xecc6 73f8: 0d 94 8c 2b jmp 0x25718 ; 0x25718 73fc: 0c 94 75 cf jmp 0x19eea ; 0x19eea 7400: 0d 94 ed ac jmp 0x359da ; 0x359da 7404: 0d 94 f3 0a jmp 0x215e6 ; 0x215e6 7408: 0c 94 bd cf jmp 0x19f7a ; 0x19f7a 740c: 0d 94 e5 0e jmp 0x21dca ; 0x21dca 7410: 0c 94 7f cf jmp 0x19efe ; 0x19efe 7414: 0d 94 d5 3e jmp 0x27daa ; 0x27daa 7418: 0d 94 c7 0c jmp 0x2198e ; 0x2198e 741c: 0c 94 19 cd jmp 0x19a32 ; 0x19a32 7420: 0d 94 8b 1c jmp 0x23916 ; 0x23916 7424: 0c 94 b6 e9 jmp 0x1d36c ; 0x1d36c 7428: 0c 94 8d f9 jmp 0x1f31a ; 0x1f31a 742c: 0d 94 86 d4 jmp 0x3a90c ; 0x3a90c 7430: 0c 94 5b e9 jmp 0x1d2b6 ; 0x1d2b6 7434: 0c 94 25 e3 jmp 0x1c64a ; 0x1c64a 7438: 0c 94 ec e3 jmp 0x1c7d8 ; 0x1c7d8 743c: 0c 94 74 74 jmp 0xe8e8 ; 0xe8e8 <__vector_23+0xa4> 7440: 0d 94 4a 18 jmp 0x23094 ; 0x23094 7444: 0c 94 95 ce jmp 0x19d2a ; 0x19d2a 7448: 0c 94 d7 d4 jmp 0x1a9ae ; 0x1a9ae 744c: 0d 94 f6 07 jmp 0x20fec ; 0x20fec 7450: 0c 94 4f d4 jmp 0x1a89e ; 0x1a89e 7454: 0d 94 60 16 jmp 0x22cc0 ; 0x22cc0 7458: 0c 94 aa ce jmp 0x19d54 ; 0x19d54 745c: 0d 94 dd 0a jmp 0x215ba ; 0x215ba 7460: 0d 94 7f d2 jmp 0x3a4fe ; 0x3a4fe <_menu_edit_P()> 7464: 0c 94 cf e2 jmp 0x1c59e ; 0x1c59e 7468: 0c 94 a9 cf jmp 0x19f52 ; 0x19f52 746c: 0c 94 89 cf jmp 0x19f12 ; 0x19f12 7470: 0d 94 4b 1c jmp 0x23896 ; 0x23896 7474: 0c 94 c9 cd jmp 0x19b92 ; 0x19b92 7478: 0d 94 37 a0 jmp 0x3406e ; 0x3406e 747c: 0d 94 d1 0a jmp 0x215a2 ; 0x215a2 7480: 0c 94 e1 ef jmp 0x1dfc2 ; 0x1dfc2 7484: 0d 94 d1 ac jmp 0x359a2 ; 0x359a2 7488: 0d 94 ce 9f jmp 0x33f9c ; 0x33f9c 748c: 0c 94 ac ee jmp 0x1dd58 ; 0x1dd58 7490: 0c 94 b3 cf jmp 0x19f66 ; 0x19f66 7494: 0c 94 a3 ce jmp 0x19d46 ; 0x19d46 7498: 0c 94 c9 f9 jmp 0x1f392 ; 0x1f392 749c: 0d 94 1f 51 jmp 0x2a23e ; 0x2a23e 74a0: 0d 94 3f 51 jmp 0x2a27e ; 0x2a27e 74a4: 0d 94 f4 ac jmp 0x359e8 ; 0x359e8 74a8: 0c 94 9d d3 jmp 0x1a73a ; 0x1a73a ()> 74ac: 0d 94 bf 2b jmp 0x2577e ; 0x2577e 74b0: 0d 94 e6 9f jmp 0x33fcc ; 0x33fcc 74b4: 0c 94 6e f1 jmp 0x1e2dc ; 0x1e2dc 74b8: 0c 94 41 74 jmp 0xe882 ; 0xe882 <__vector_23+0x3e> 74bc: 0d 94 27 51 jmp 0x2a24e ; 0x2a24e 74c0: 0d 94 7c 0c jmp 0x218f8 ; 0x218f8 74c4: 0c 94 8a e0 jmp 0x1c114 ; 0x1c114 74c8: 0c 94 4e e9 jmp 0x1d29c ; 0x1d29c 74cc: 0c 94 0b cd jmp 0x19a16 ; 0x19a16 74d0: 0c 94 de cc jmp 0x199bc ; 0x199bc 74d4: 0c 94 d0 e0 jmp 0x1c1a0 ; 0x1c1a0 74d8: 0c 94 89 e9 jmp 0x1d312 ; 0x1d312 74dc: 0c 94 18 f0 jmp 0x1e030 ; 0x1e030 74e0: 0c 94 3a fa jmp 0x1f474 ; 0x1f474 74e4: 0d 94 ec 2b jmp 0x257d8 ; 0x257d8 74e8: 0d 94 c2 9f jmp 0x33f84 ; 0x33f84 74ec: 0c 94 01 cd jmp 0x19a02 ; 0x19a02 74f0: 0c 94 0f cd jmp 0x19a1e ; 0x19a1e 74f4: 0d 94 cc 21 jmp 0x24398 ; 0x24398 74f8: 0c 94 a7 e9 jmp 0x1d34e ; 0x1d34e 74fc: 0c 94 c4 e0 jmp 0x1c188 ; 0x1c188 7500: 0d 94 97 0b jmp 0x2172e ; 0x2172e 7504: 0d 94 54 1c jmp 0x238a8 ; 0x238a8 7508: 0d 94 40 a0 jmp 0x34080 ; 0x34080 750c: 0d 94 6b 17 jmp 0x22ed6 ; 0x22ed6 7510: 0d 94 86 50 jmp 0x2a10c ; 0x2a10c 7514: 0d 94 ec 50 jmp 0x2a1d8 ; 0x2a1d8 7518: 0c 94 93 cf jmp 0x19f26 ; 0x19f26 751c: 0c 94 4b 77 jmp 0xee96 ; 0xee96 7520: 0c 94 ef cc jmp 0x199de ; 0x199de 7524: 0d 94 46 50 jmp 0x2a08c ; 0x2a08c 7528: 0d 94 ef 50 jmp 0x2a1de ; 0x2a1de 752c: 0c 94 4c d2 jmp 0x1a498 ; 0x1a498 7530: 0d 94 2f 51 jmp 0x2a25e ; 0x2a25e 7534: 0d 94 f1 a6 jmp 0x34de2 ; 0x34de2 7538: 0c 94 5e cf jmp 0x19ebc ; 0x19ebc 753c: 0d 94 64 0f jmp 0x21ec8 ; 0x21ec8 7540: 0c 94 e9 cc jmp 0x199d2 ; 0x199d2 7544: 0d 94 8b ac jmp 0x35916 ; 0x35916 7548: 0d 94 b7 28 jmp 0x2516e ; 0x2516e 754c: 0c 94 1d cd jmp 0x19a3a ; 0x19a3a 7550: 0c 94 93 74 jmp 0xe926 ; 0xe926 <__vector_23+0xe2> 7554: 0c 94 2e df jmp 0x1be5c ; 0x1be5c 7558: 0c 94 d4 cc jmp 0x199a8 ; 0x199a8 755c: 0d 94 e6 50 jmp 0x2a1cc ; 0x2a1cc 7560: 0c 94 4f cf jmp 0x19e9e ; 0x19e9e 7564: 0c 94 e4 cf jmp 0x19fc8 ; 0x19fc8 7568: 0d 94 d1 a6 jmp 0x34da2 ; 0x34da2 756c: 0d 94 43 2b jmp 0x25686 ; 0x25686 7570: 0c 94 a2 d3 jmp 0x1a744 ; 0x1a744 ()> 7574: 0d 94 4a 10 jmp 0x22094 ; 0x22094 7578: 0d 94 37 51 jmp 0x2a26e ; 0x2a26e 757c: 0c 94 ac d3 jmp 0x1a758 ; 0x1a758 ()> 7580: 0d 94 d0 2b jmp 0x257a0 ; 0x257a0 7584: 0d 94 21 50 jmp 0x2a042 ; 0x2a042 7588: 0c 94 3e df jmp 0x1be7c ; 0x1be7c 758c: 0c 94 44 fa jmp 0x1f488 ; 0x1f488 7590: 0d 94 8f a6 jmp 0x34d1e ; 0x34d1e 7594: 0c 94 ca e9 jmp 0x1d394 ; 0x1d394 7598: 0d 94 32 10 jmp 0x22064 ; 0x22064 759c: 0d 94 cb 0a jmp 0x21596 ; 0x21596 75a0: 0c 94 d6 df jmp 0x1bfac ; 0x1bfac 75a4: 0d 94 43 21 jmp 0x24286 ; 0x24286 75a8: 0c 94 c0 e9 jmp 0x1d380 ; 0x1d380 75ac: 0d 94 7b 15 jmp 0x22af6 ; 0x22af6 75b0: 0d 94 2b a0 jmp 0x34056 ; 0x34056 75b4: 0d 94 76 a6 jmp 0x34cec ; 0x34cec 75b8: 0d 94 e9 50 jmp 0x2a1d2 ; 0x2a1d2 75bc: 0c 94 c7 e0 jmp 0x1c18e ; 0x1c18e 75c0: 0c 94 29 fa jmp 0x1f452 ; 0x1f452 75c4: 0d 94 42 1c jmp 0x23884 ; 0x23884 75c8: 0c 94 cf f7 jmp 0x1ef9e ; 0x1ef9e 75cc: 0d 94 bf 18 jmp 0x2317e ; 0x2317e 75d0: 0d 94 53 50 jmp 0x2a0a6 ; 0x2a0a6 75d4: 0c 94 03 fa jmp 0x1f406 ; 0x1f406 75d8: 0c 94 65 e9 jmp 0x1d2ca ; 0x1d2ca 75dc: 0c 94 cc df jmp 0x1bf98 ; 0x1bf98 75e0: 0c 94 cd e0 jmp 0x1c19a ; 0x1c19a 75e4: 0c 94 3d f9 jmp 0x1f27a ; 0x1f27a 75e8: 0c 94 d9 e0 jmp 0x1c1b2 ; 0x1c1b2 75ec: 0c 94 17 f8 jmp 0x1f02e ; 0x1f02e 75f0: 0d 94 d1 09 jmp 0x213a2 ; 0x213a2 75f4: 0d 94 4f 16 jmp 0x22c9e ; 0x22c9e 75f8: 0c 94 0f fa jmp 0x1f41e ; 0x1f41e 75fc: 0c 94 d5 e4 jmp 0x1c9aa ; 0x1c9aa 7600: 0d 94 87 1e jmp 0x23d0e ; 0x23d0e 7604: 0c 94 30 cf jmp 0x19e60 ; 0x19e60 7608: 0c 94 b3 f9 jmp 0x1f366 ; 0x1f366 760c: 0d 94 4f 0f jmp 0x21e9e ; 0x21e9e 7610: 0d 94 00 1a jmp 0x23400 ; 0x23400 7614: 0c 94 4f da jmp 0x1b49e ; 0x1b49e 7618: 0c 94 cf cd jmp 0x19b9e ; 0x19b9e 761c: 0d 94 1b 18 jmp 0x23036 ; 0x23036 7620: 0d 94 b5 50 jmp 0x2a16a ; 0x2a16a 7624: 0d 94 66 09 jmp 0x212cc ; 0x212cc 7628: 0c 94 4f e1 jmp 0x1c29e ; 0x1c29e 762c: 0c 94 81 e9 jmp 0x1d302 ; 0x1d302 7630: 0c 94 21 cd jmp 0x19a42 ; 0x19a42 7634: 0d 94 f0 07 jmp 0x20fe0 ; 0x20fe0 7638: 0d 94 2d 2f jmp 0x25e5a ; 0x25e5a 763c: 0d 94 5d 1c jmp 0x238ba ; 0x238ba 7640: 0c 94 9c ce jmp 0x19d38 ; 0x19d38 7644: 0c 94 f3 70 jmp 0xe1e6 ; 0xe1e6 7648: 0c 94 ba d1 jmp 0x1a374 ; 0x1a374 0000764c <__trampolines_end>: 764c: 6e 61 ori r22, 0x1E ; 30 764e: 6e 00 .word 0x006e ; ???? 00007650 <__c.2228>: 7650: 69 6e 66 00 00 40 7a 10 f3 5a 00 a0 72 4e 18 09 inf..@z..Z..rN.. 7660: 00 10 a5 d4 e8 00 00 e8 76 48 17 00 00 e4 0b 54 ........vH.....T 7670: 02 00 00 ca 9a 3b 00 00 00 e1 f5 05 00 00 80 96 .....;.......... 7680: 98 00 00 00 40 42 0f 00 00 00 a0 86 01 00 00 00 ....@B.......... 7690: 10 27 00 00 00 00 e8 03 00 00 00 00 64 00 00 00 .'..........d... 76a0: 00 00 0a 00 00 00 00 00 01 00 00 00 00 00 2c 76 ..............,v 76b0: d8 88 dc 67 4f 08 23 df c1 df ae 59 e1 b1 b7 96 ...gO.#....Y.... 76c0: e5 e3 e4 53 c6 3a e6 51 99 76 96 e8 e6 c2 84 26 ...S.:.Q.v.....& 76d0: eb 89 8c 9b 62 ed 40 7c 6f fc ef bc 9c 9f 40 f2 ....b.@|o.....@. 76e0: ba a5 6f a5 f4 90 05 5a 2a f7 5c 93 6b 6c f9 67 ..o....Z*.\.kl.g 76f0: 6d c1 1b fc e0 e4 0d 47 fe f5 20 e6 b5 00 d0 ed m......G.. ..... 7700: 90 2e 03 00 94 35 77 05 00 80 84 1e 08 00 00 20 .....5w........ 7710: 4e 0a 00 00 00 c8 0c 33 33 33 33 0f 98 6e 12 83 N......3333..n.. 7720: 11 41 ef 8d 21 14 89 3b e6 55 16 cf fe e6 db 18 .A..!..;.U...... 7730: d1 84 4b 38 1b f7 7c 1d 90 1d a4 bb e4 24 20 32 ..K8..|......$ 2 7740: 84 72 5e 22 81 00 c9 f1 24 ec a1 e5 3d 27 .r^"....$...=' 0000774e : 774e: 22 00 ". 00007750 : ... 00007751 : 7751: 20 45 53 50 00 ESP. 00007756 : 7756: 20 4e 53 50 00 NSP. 0000775b : 775b: 20 4f 46 46 00 OFF. 00007760 : 7760: 20 4f 4e 00 ON. 00007764 : 7764: 50 56 30 31 00 PV01. 00007769 : 7769: 20 5b 4d 50 5d 20 00 [MP] . 00007770 : 7770: 25 69 20 68 6f 75 72 73 20 25 69 20 6d 69 6e 75 %i hours %i minu 7780: 74 65 73 00 tes. 00007784 : 7784: 52 58 20 74 69 6d 65 6f 75 74 00 RX timeout. 0000778f : 778f: 4d 33 31 30 00 M310. 00007794 : 7794: 4d 31 31 32 00 M112. 00007799 : 7799: 4d 31 31 30 00 M110. 0000779e : 779e: 46 75 6c 6c 20 52 58 20 42 75 66 66 65 72 00 Full RX Buffer. 000077ad : 77ad: 53 65 74 74 69 6e 67 73 20 53 74 6f 72 65 64 00 Settings Stored. 000077bd : 77bd: 54 4d 3a 20 73 74 6f 72 65 64 20 63 61 6c 69 62 TM: stored calib 77cd: 72 61 74 69 6f 6e 20 69 6e 76 61 6c 69 64 2c 20 ration invalid, 77dd: 72 65 73 65 74 74 69 6e 67 00 resetting. 000077e7 : 77e7: 53 74 6f 72 65 64 20 73 65 74 74 69 6e 67 73 20 Stored settings 77f7: 72 65 74 72 69 65 76 65 64 00 retrieved. 00007801 : 7801: 48 61 72 64 63 6f 64 65 64 20 44 65 66 61 75 6c Hardcoded Defaul 7811: 74 20 53 65 74 74 69 6e 67 73 20 4c 6f 61 64 65 t Settings Loade 7821: 64 00 d. 00007823 : 7823: 56 32 00 00 00 00 c8 42 00 00 c8 42 00 00 c8 43 V2.....B...B...C 7833: 00 00 8c 43 00 00 48 43 00 00 48 43 00 00 40 41 ...C..HC..HC..@A 7843: 00 00 f0 42 e8 03 00 00 e8 03 00 00 c8 00 00 00 ...B............ 7853: 88 13 00 00 00 40 9c 44 00 40 9c 44 00 00 00 00 .....@.D.@.D.... 7863: 00 00 00 00 20 4e 00 00 00 00 20 41 00 00 20 41 .... N.... A.. A 7873: cd cc cc 3e 00 00 90 40 00 00 00 00 00 00 00 00 ...>...@........ 7883: 00 00 00 00 cd cc cc 3e 00 00 c8 41 9c 53 49 3f .......>...A.SI? 7893: 80 f9 46 43 8f 42 fc 42 e6 5a 34 3f 4c 62 b0 45 ..FC.B.B.Z4?Lb.E 78a3: 00 00 00 00 00 40 40 00 00 34 42 00 00 00 00 00 .....@@..4B..... 78b3: 00 00 00 00 00 00 41 00 00 00 e0 3f 00 00 c8 42 ......A....?...B 78c3: 00 00 c8 42 00 00 40 41 00 00 f0 42 c0 03 00 00 ...B..@A...B.... 78d3: c0 03 00 00 c8 00 00 00 88 13 00 00 10 10 10 20 ............... 78e3: 00 40 9c 44 00 00 80 3f 00 00 00 3f 19 14 00 00 .@.D...?...?.... ... 000078f4 : 78f4: 43 75 73 74 6f 6d 00 Custom. 000078fb : 78fb: 4e 79 6c 6f 6e 50 41 00 NylonPA. 00007903 : 7903: 53 61 74 69 6e 20 20 00 Satin . 0000790b : 790b: 54 65 78 74 75 72 00 Textur. 00007912 : 7912: 53 6d 6f 6f 74 68 00 Smooth. 00007919 : 7919: 48 6f 74 65 6e 64 20 66 61 6e 20 73 70 65 65 64 Hotend fan speed 7929: 20 69 73 20 6c 6f 77 65 72 20 74 68 61 6e 20 65 is lower than e 7939: 78 70 65 63 74 65 64 00 xpected. 00007941 : 7941: 50 72 69 6e 74 20 66 61 6e 20 73 70 65 65 64 20 Print fan speed 7951: 69 73 20 6c 6f 77 65 72 20 74 68 61 6e 20 65 78 is lower than ex 7961: 70 65 63 74 65 64 00 pected. 00007968 : 7968: 31 2e 30 00 1.0. 0000796c : 796c: 31 2e 35 00 1.5. 00007970 : 7970: 55 4e 4b 4e 4f 57 4e 00 UNKNOWN. 00007978 : 7978: 4c 41 31 30 43 3a 20 4c 69 6e 65 61 72 20 41 64 LA10C: Linear Ad 7988: 76 61 6e 63 65 20 6d 6f 64 65 3a 20 00 vance mode: . 00007995 : 7995: 4c 41 31 30 43 3a 20 41 64 6a 75 73 74 65 64 20 LA10C: Adjusted 79a5: 45 2d 4a 65 72 6b 3a 20 00 E-Jerk: . 000079ae <_PRI_LANG_SIGNATURE>: 79ae: ff ff ff ff .... 000079b2 : 79b2: 3e 0f a8 af 00 48 00 69 96 00 00 df 60 25 55 58 >....H.i....`%UX 79c2: 87 68 04 27 f2 e0 00 5e 34 03 cc 19 60 f3 3c 0e .h.'...^4...`.<. 79d2: f8 8f 00 db 08 02 94 92 00 3e 1c 07 9a 87 00 e5 .........>...... 79e2: 24 00 85 28 52 7e 06 00 1b e4 00 7e 78 12 70 78 $..(R~.....~x.px 79f2: 70 61 f8 12 78 8f 88 41 78 42 70 78 70 61 78 25 pa..x..AxBpxpax% 7a02: 70 78 70 61 f8 50 78 8f 88 d1 f0 25 27 07 87 61 pxpa.Px....%'..a 7a12: f0 25 27 8f 88 41 2c 0d 27 aa 50 d1 bc 07 07 87 .%'..A,.'.P..... 7a22: 11 61 be 78 8f 88 11 41 78 52 70 78 70 61 f8 52 .a.x...AxRpxpa.R 7a32: 78 8f 88 41 20 12 78 88 70 63 20 52 78 88 70 63 x..A .x.pc Rx.pc 7a42: 48 52 78 88 87 43 03 11 17 99 70 64 18 12 78 f8 HRx..C....pd..x. 7a52: 70 65 44 12 f8 f8 f0 45 18 42 78 f8 70 65 18 25 peD....E.Bx.pe.% 7a62: 78 f8 70 65 18 52 78 f8 70 65 18 50 78 f8 70 65 x.pe.Rx.pe.Px.pe 7a72: 0c 07 8f 87 23 65 a2 0f 8f 8f 11 45 00 12 06 22 ....#e.....E..." 7a82: 70 69 00 12 07 22 27 49 00 25 06 22 70 69 00 25 pi..."'I.%."pi.% 7a92: 07 22 27 49 00 12 06 22 27 6c 02 62 36 a2 70 6c ."'I..."'l.b6.pl 7aa2: 40 45 6c 44 70 4c 03 62 22 22 70 6c 43 88 88 88 @ElDpL.b""plC... 7ab2: f0 4c 78 12 bc 88 80 6e 78 52 bc 88 80 6e 38 12 .Lx....nxR...n8. 7ac2: 78 88 70 6f 78 12 78 88 87 4f 38 42 78 88 70 6f x.pox.x..O8Bx.po 7ad2: 38 25 78 88 70 6f 3a 00 79 ac 78 6f 3d 07 9a ac 8%x.po:.y.xo=... 7ae2: 78 6f 78 50 78 88 87 ef 39 49 78 88 70 6f 08 52 xoxPx...9Ix.po.R 7af2: bc 88 80 72 98 52 f8 8f 98 52 20 12 78 70 f0 73 ...r.R...R .xp.s 7b02: 48 12 78 63 87 53 20 52 78 70 f0 73 48 52 78 63 H.xc.S Rxp.sHRxc 7b12: 87 53 10 07 87 0f 24 73 12 78 63 87 24 53 60 69 .S....$s.xc.$S`i 7b22: 9a 98 8b e2 23 04 e4 44 30 74 10 4e 44 43 24 74 ....#..D0t.NDC$t 7b32: 7c 12 88 89 60 75 3c 50 88 88 70 55 78 25 28 89 |...`u: 7b6e: 00 40 14 54 .@.T 00007b72 : 7b72: cd cc cc 3d 0a d7 23 3c 17 b7 d1 38 77 cc 2b 32 ...=..#<...8w.+2 7b82: 95 95 e6 24 1f b1 4f 0a ...$..O. 00007b8a : 7b8a: 00 00 20 41 00 00 c8 42 00 40 1c 46 20 bc be 4c .. A...B.@.F ..L 7b9a: ca 1b 0e 5a ae c5 9d 74 ...Z...t 00007ba2 : 7ba2: 4e 41 4e NAN 00007ba5 : 7ba5: 49 4e 46 INF 00007ba8 : 7ba8: 62 75 73 79 3a 20 70 61 75 73 65 64 20 66 6f 72 busy: paused for 7bb8: 20 69 6e 70 75 74 00 input. 00007bbf : 7bbf: 62 75 73 79 3a 20 70 61 75 73 65 64 20 66 6f 72 busy: paused for 7bcf: 20 75 73 65 72 00 user. 00007bd5 : 7bd5: 62 75 73 79 3a 20 70 72 6f 63 65 73 73 69 6e 67 busy: processing ... 00007be6 : 7be6: 00 00 7f 43 00 80 54 43 00 00 52 43 ...C..TC..RC 00007bf2 : 7bf2: 00 00 00 00 00 00 80 c0 9a 99 19 3e ...........> 00007bfe : 7bfe: 00 00 00 00 00 00 80 c0 9a 99 19 3e ...........> 00007c0a : 7c0a: 00 00 a0 40 00 00 a0 40 00 00 00 40 ...@...@...@ 00007c16 : 7c16: 25 33 64 20 73 74 65 70 3d 25 32 64 20 6d 73 63 %3d step=%2d msc 7c26: 6e 74 3d 25 34 64 0a 00 nt=%4d.. 00007c2e : 7c2e: 00 00 7f 43 00 80 58 43 9a d9 51 43 ...C..XC..QC 00007c3a : 7c3a: ff ff ff ... 00007c3d : 7c3d: 20 41 3a 00 A:. 00007c41 : 7c41: 20 50 3a 00 P:. 00007c45 : 7c45: 20 42 40 3a 00 B@:. 00007c4a : 7c4a: 20 40 3a 00 @:. 00007c4e : 7c4e: 20 2f 00 /. 00007c51 : 7c51: 20 54 30 3a 00 T0:. 00007c56 : 7c56: 20 2f 00 /. 00007c59 : 7c59: 20 42 3a 00 B:. 00007c5d : 7c5d: 20 2f 00 /. 00007c60 : 7c60: 54 3a 00 T:. 00007c63 : 7c63: 25 53 45 78 63 65 73 73 69 76 65 20 62 65 64 20 %SExcessive bed 7c73: 6c 65 76 65 6c 69 6e 67 20 63 6f 72 72 65 63 74 leveling correct 7c83: 69 6f 6e 3a 20 25 69 20 6d 69 63 72 6f 6e 73 0a ion: %i microns. ... 00007c94 : 7c94: 42 65 64 20 6c 65 76 65 6c 69 6e 67 20 66 61 69 Bed leveling fai 7ca4: 6c 65 64 2e 20 54 6f 6f 20 6d 75 63 68 20 76 61 led. Too much va 7cb4: 72 69 61 74 69 6f 6e 20 66 72 6f 6d 20 65 65 70 riation from eep 7cc4: 72 6f 6d 20 6d 65 73 68 00 rom mesh. 00007ccd : 7ccd: 42 65 64 20 6c 65 76 65 6c 69 6e 67 20 66 61 69 Bed leveling fai 7cdd: 6c 65 64 2e 20 53 65 6e 73 6f 72 20 74 72 69 67 led. Sensor trig 7ced: 67 65 72 65 64 20 74 6f 6f 20 73 6f 6f 6e 00 gered too soon. 00007cfc : 7cfc: 20 20 00 . 00007cff : 7cff: 4d 65 61 73 75 72 65 64 20 70 6f 69 6e 74 73 3a Measured points: ... 00007d10 : 7d10: 5a 20 73 65 61 72 63 68 20 68 65 69 67 68 74 3a Z search height: 7d20: 20 35 2e 30 66 00 5.0f. 00007d26 : 7d26: 4e 75 6d 20 58 2c 59 3a 20 37 2c 37 00 Num X,Y: 7,7. 00007d33 : 7d33: 4d 65 73 68 20 62 65 64 20 6c 65 76 65 6c 69 6e Mesh bed levelin 7d43: 67 20 6e 6f 74 20 61 63 74 69 76 65 2e 00 g not active.. 00007d51 : 7d51: 20 45 3a 00 E:. 00007d55 : 7d55: 20 5a 3a 00 Z:. 00007d59 : 7d59: 20 59 3a 00 Y:. 00007d5d : 7d5d: 20 45 3a 00 E:. 00007d61 : 7d61: 20 5a 3a 00 Z:. 00007d65 : 7d65: 20 59 3a 00 Y:. 00007d69 : 7d69: 58 3a 00 X:. 00007d6c : 7d6c: 20 2d 3e 20 00 -> . 00007d71 : 7d71: 53 70 6f 6f 6c 4a 6f 69 6e 3a 20 00 SpoolJoin: . 00007d7d : 7d7d: 2c 20 00 , . 00007d80 : 7d80: 49 6e 61 63 74 69 76 69 74 79 20 53 68 75 74 64 Inactivity Shutd 7d90: 6f 77 6e 00 own. 00007d94 : 7d94: 4b 49 4c 4c 45 44 2e 00 KILLED.. 00007d9c : 7d9c: 50 72 69 6e 74 65 72 20 68 61 6c 74 65 64 2e 20 Printer halted. 7dac: 6b 69 6c 6c 28 29 20 63 61 6c 6c 65 64 21 00 kill() called!. 00007dbb : 7dbb: 5a 20 6c 69 76 65 20 61 64 6a 75 73 74 20 6f 75 Z live adjust ou 7dcb: 74 20 6f 66 20 72 61 6e 67 65 2e 20 53 65 74 74 t of range. Sett 7ddb: 69 6e 67 20 74 6f 20 30 2e 20 43 6c 69 63 6b 20 ing to 0. Click 7deb: 74 6f 20 63 6f 6e 74 69 6e 75 65 2e 00 to continue.. 00007df8 : 7df8: 5a 20 6c 69 76 65 20 61 64 6a 75 73 74 20 6f 75 Z live adjust ou 7e08: 74 20 6f 66 20 72 61 6e 67 65 2e 20 53 65 74 74 t of range. Sett 7e18: 69 6e 67 20 74 6f 20 30 00 ing to 0. 00007e21 : 7e21: 20 45 3a 30 20 42 3a 00 E:0 B:. 00007e29 : 7e29: 54 3a 00 T:. 00007e2c : 7e2c: 47 31 20 5a 25 2d 2e 33 66 20 46 25 2d 2e 33 66 G1 Z%-.3f F%-.3f ... 00007e3d : 7e3d: 49 6e 76 61 6c 69 64 20 54 20 63 6f 64 65 2e 00 Invalid T code.. 00007e4d : 7e4d: 44 75 70 6c 69 63 61 74 65 20 54 2d 63 6f 64 65 Duplicate T-code 7e5d: 20 69 67 6e 6f 72 65 64 2e 00 ignored.. 00007e67 : 7e67: 41 64 76 61 6e 63 65 20 4b 3d 00 Advance K=. 00007e72 : 7e72: 4b 20 6f 75 74 20 6f 66 20 61 6c 6c 6f 77 65 64 K out of allowed 7e82: 20 72 61 6e 67 65 21 00 range!. 00007e8a <_sPrinterName>: 7e8a: 4d 4b 33 00 MK3. 00007e8e <_sPrinterMmuName>: 7e8e: 4d 4b 33 4d 4d 55 33 00 MK3MMU3. 00007e96 <_nPrinterMmuType>: 7e96: 5c 76 \v 00007e98 <_nPrinterType>: 7e98: 2c 01 ,. 00007e9a : 7e9a: 25 33 64 2f 25 33 64 00 %3d/%3d. 00007ea2 : 7ea2: 25 33 64 00 %3d. 00007ea6 : 7ea6: 20 0a 20 0a 20 0a 20 00 . . . . 00007eae : 7eae: 25 53 41 72 63 20 53 65 74 74 69 6e 67 73 3a 20 %SArc Settings: 7ebe: 50 3a 4d 61 78 20 6c 65 6e 67 74 68 28 6d 6d 29 P:Max length(mm) 7ece: 20 53 3a 4d 69 6e 20 6c 65 6e 67 74 68 20 28 6d S:Min length (m 7ede: 6d 29 20 4e 3a 43 6f 72 72 65 63 74 69 6f 6e 73 m) N:Corrections 7eee: 20 52 3a 4d 69 6e 20 73 65 67 6d 65 6e 74 73 20 R:Min segments 7efe: 46 3a 53 65 67 6d 65 6e 74 73 2f 73 65 63 2e 0a F:Segments/sec.. 7f0e: 25 53 20 20 4d 32 31 34 20 50 25 2e 32 66 20 53 %S M214 P%.2f S 7f1e: 25 2e 32 66 20 4e 25 64 20 52 25 64 20 46 25 64 %.2f N%d R%d F%d 7f2e: 0a 00 .. 00007f30 : 7f30: 25 53 46 69 6c 61 6d 65 6e 74 20 73 65 74 74 69 %SFilament setti 7f40: 6e 67 73 3a 20 44 69 73 61 62 6c 65 64 0a 00 ngs: Disabled.. 00007f4f : 7f4f: 25 53 46 69 6c 61 6d 65 6e 74 20 73 65 74 74 69 %SFilament setti 7f5f: 6e 67 73 3a 0a 25 53 20 20 20 4d 32 30 30 20 44 ngs:.%S M200 D 7f6f: 25 2e 32 66 0a 00 %.2f.. 00007f75 : 7f75: 25 53 52 65 74 72 61 63 74 3a 20 53 3d 4c 65 6e %SRetract: S=Len 7f85: 67 74 68 20 28 6d 6d 29 20 46 3a 53 70 65 65 64 gth (mm) F:Speed 7f95: 20 28 6d 6d 2f 6d 29 20 5a 3a 20 5a 4c 69 66 74 (mm/m) Z: ZLift 7fa5: 20 28 6d 6d 29 0a 25 53 20 20 20 4d 32 30 37 20 (mm).%S M207 7fb5: 53 25 2e 32 66 20 46 25 2e 32 66 20 5a 25 2e 32 S%.2f F%.2f Z%.2 7fc5: 66 0a 25 53 52 65 63 6f 76 65 72 3a 20 53 3d 45 f.%SRecover: S=E 7fd5: 78 74 72 61 20 6c 65 6e 67 74 68 20 28 6d 6d 29 xtra length (mm) 7fe5: 20 46 3a 53 70 65 65 64 20 28 6d 6d 2f 6d 29 0a F:Speed (mm/m). 7ff5: 25 53 20 20 20 4d 32 30 38 20 53 25 2e 32 66 20 %S M208 S%.2f 8005: 46 25 2e 32 66 0a 25 53 41 75 74 6f 2d 52 65 74 F%.2f.%SAuto-Ret 8015: 72 61 63 74 3a 20 53 3d 30 20 74 6f 20 64 69 73 ract: S=0 to dis 8025: 61 62 6c 65 2c 20 31 20 74 6f 20 69 6e 74 65 72 able, 1 to inter 8035: 70 72 65 74 20 65 78 74 72 75 64 65 2d 6f 6e 6c pret extrude-onl 8045: 79 20 6d 6f 76 65 73 20 61 73 20 72 65 74 72 61 y moves as retra 8055: 63 74 73 20 6f 72 20 72 65 63 6f 76 65 72 69 65 cts or recoverie 8065: 73 0a 25 53 20 20 20 4d 32 30 39 20 53 25 64 0a s.%S M209 S%d. ... 00008076 : 8076: 25 53 50 49 44 20 68 65 61 74 62 65 64 20 73 65 %SPID heatbed se 8086: 74 74 69 6e 67 73 3a 0a 25 53 20 20 20 4d 33 30 ttings:.%S M30 8096: 34 20 50 25 2e 32 66 20 49 25 2e 32 66 20 44 25 4 P%.2f I%.2f D% 80a6: 2e 32 66 0a 00 .2f.. 000080ab : 80ab: 25 53 50 49 44 20 73 65 74 74 69 6e 67 73 3a 0a %SPID settings:. 80bb: 25 53 20 20 20 4d 33 30 31 20 50 25 2e 32 66 20 %S M301 P%.2f 80cb: 49 25 2e 32 66 20 44 25 2e 32 66 0a 00 I%.2f D%.2f.. 000080d8 : 80d8: 25 53 53 74 65 70 73 20 70 65 72 20 75 6e 69 74 %SSteps per unit 80e8: 3a 0a 25 53 20 20 4d 39 32 20 58 25 2e 32 66 20 :.%S M92 X%.2f 80f8: 59 25 2e 32 66 20 5a 25 2e 32 66 20 45 25 2e 32 Y%.2f Z%.2f E%.2 8108: 66 0a 25 53 55 53 74 65 70 20 72 65 73 6f 6c 75 f.%SUStep resolu 8118: 74 69 6f 6e 3a 20 0a 25 53 20 4d 33 35 30 20 58 tion: .%S M350 X 8128: 25 64 20 59 25 64 20 5a 25 64 20 45 25 64 0a 25 %d Y%d Z%d E%d.% 8138: 53 4d 61 78 69 6d 75 6d 20 66 65 65 64 72 61 74 SMaximum feedrat 8148: 65 73 20 2d 20 6e 6f 72 6d 61 6c 20 28 6d 6d 2f es - normal (mm/ 8158: 73 29 3a 0a 25 53 20 20 4d 32 30 33 20 58 25 2e s):.%S M203 X%. 8168: 32 66 20 59 25 2e 32 66 20 5a 25 2e 32 66 20 45 2f Y%.2f Z%.2f E 8178: 25 2e 32 66 0a 25 53 4d 61 78 69 6d 75 6d 20 66 %.2f.%SMaximum f 8188: 65 65 64 72 61 74 65 73 20 2d 20 73 74 65 61 6c eedrates - steal 8198: 74 68 20 28 6d 6d 2f 73 29 3a 0a 25 53 20 20 4d th (mm/s):.%S M 81a8: 32 30 33 20 58 25 2e 32 66 20 59 25 2e 32 66 20 203 X%.2f Y%.2f 81b8: 5a 25 2e 32 66 20 45 25 2e 32 66 0a 25 53 4d 61 Z%.2f E%.2f.%SMa 81c8: 78 69 6d 75 6d 20 61 63 63 65 6c 65 72 61 74 69 ximum accelerati 81d8: 6f 6e 20 2d 20 6e 6f 72 6d 61 6c 20 28 6d 6d 2f on - normal (mm/ 81e8: 73 32 29 3a 0a 25 53 20 20 4d 32 30 31 20 58 25 s2):.%S M201 X% 81f8: 6c 75 20 59 25 6c 75 20 5a 25 6c 75 20 45 25 6c lu Y%lu Z%lu E%l 8208: 75 0a 25 53 4d 61 78 69 6d 75 6d 20 61 63 63 65 u.%SMaximum acce 8218: 6c 65 72 61 74 69 6f 6e 20 2d 20 73 74 65 61 6c leration - steal 8228: 74 68 20 28 6d 6d 2f 73 32 29 3a 0a 25 53 20 20 th (mm/s2):.%S 8238: 4d 32 30 31 20 58 25 6c 75 20 59 25 6c 75 20 5a M201 X%lu Y%lu Z 8248: 25 6c 75 20 45 25 6c 75 0a 25 53 41 63 63 65 6c %lu E%lu.%SAccel 8258: 65 72 61 74 69 6f 6e 3a 20 50 3d 70 72 69 6e 74 eration: P=print 8268: 2c 20 52 3d 72 65 74 72 61 63 74 2c 20 54 3d 74 , R=retract, T=t 8278: 72 61 76 65 6c 0a 25 53 20 20 4d 32 30 34 20 50 ravel.%S M204 P 8288: 25 2e 32 66 20 52 25 2e 32 66 20 54 25 2e 32 66 %.2f R%.2f T%.2f 8298: 0a 25 53 41 64 76 61 6e 63 65 64 20 76 61 72 69 .%SAdvanced vari 82a8: 61 62 6c 65 73 3a 20 53 3d 4d 69 6e 20 66 65 65 ables: S=Min fee 82b8: 64 72 61 74 65 20 28 6d 6d 2f 73 29 2c 20 54 3d drate (mm/s), T= 82c8: 4d 69 6e 20 74 72 61 76 65 6c 20 66 65 65 64 72 Min travel feedr 82d8: 61 74 65 20 28 6d 6d 2f 73 29 2c 20 42 3d 6d 69 ate (mm/s), B=mi 82e8: 6e 69 6d 75 6d 20 73 65 67 6d 65 6e 74 20 74 69 nimum segment ti 82f8: 6d 65 20 28 75 73 29 2c 20 58 3d 6d 61 78 69 6d me (us), X=maxim 8308: 75 6d 20 58 59 20 6a 65 72 6b 20 28 6d 6d 2f 73 um XY jerk (mm/s 8318: 29 2c 20 20 5a 3d 6d 61 78 69 6d 75 6d 20 5a 20 ), Z=maximum Z 8328: 6a 65 72 6b 20 28 6d 6d 2f 73 29 2c 20 20 45 3d jerk (mm/s), E= 8338: 6d 61 78 69 6d 75 6d 20 45 20 6a 65 72 6b 20 28 maximum E jerk ( 8348: 6d 6d 2f 73 29 0a 25 53 20 20 4d 32 30 35 20 53 mm/s).%S M205 S 8358: 25 2e 32 66 20 54 25 2e 32 66 20 42 25 6c 75 20 %.2f T%.2f B%lu 8368: 58 25 2e 32 66 20 59 25 2e 32 66 20 5a 25 2e 32 X%.2f Y%.2f Z%.2 8378: 66 20 45 25 2e 32 66 0a 25 53 48 6f 6d 65 20 6f f E%.2f.%SHome o 8388: 66 66 73 65 74 20 28 6d 6d 29 3a 0a 25 53 20 20 ffset (mm):.%S 8398: 4d 32 30 36 20 58 25 2e 32 66 20 59 25 2e 32 66 M206 X%.2f Y%.2f 83a8: 20 5a 25 2e 32 66 0a 00 Z%.2f.. 000083b0 : 83b0: 54 4d 3a 20 52 5b 25 75 5d 20 65 73 74 69 6d 61 TM: R[%u] estima 83c0: 74 65 2e 00 te.. 000083c4 : 83c4: 54 4d 3a 20 25 53 20 52 20 25 64 43 00 TM: %S R %dC. 000083d1 : 83d1: 54 4d 3a 20 25 53 20 43 20 65 73 74 2e 00 TM: %S C est.. 000083df : 83df: 54 4d 3a 20 63 6f 6f 6c 20 64 6f 77 6e 20 3c 25 TM: cool down <% 83ef: 64 43 00 dC. 000083f2 : 83f2: 72 65 66 69 6e 65 00 refine. 000083f9 : 83f9: 69 6e 69 74 69 61 6c 00 initial. 00008401 : 8401: 54 4d 3a 20 63 61 6c 69 62 72 2e 20 66 61 69 6c TM: calibr. fail 8411: 65 64 21 00 ed!. 00008415 : 8415: 54 4d 3a 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 TM: calibration 8425: 73 74 61 72 74 00 start. 0000842b : 842b: 54 4d 3a 20 43 61 6c 2e 20 4e 4f 54 20 49 44 4c TM: Cal. NOT IDL 843b: 45 00 E. 0000843d : 843d: 43 61 70 3a 25 53 3a 25 63 0a 00 Cap:%S:%c.. 00008448 : 8448: 50 52 55 53 41 5f 4d 4d 55 32 00 PRUSA_MMU2. 00008453 : 8453: 45 58 54 45 4e 44 45 44 5f 4d 32 30 00 EXTENDED_M20. 00008460 : 8460: 41 55 54 4f 52 45 50 4f 52 54 5f 50 4f 53 49 54 AUTOREPORT_POSIT 8470: 49 4f 4e 00 ION. 00008474 : 8474: 41 55 54 4f 52 45 50 4f 52 54 5f 46 41 4e 53 00 AUTOREPORT_FANS. 00008484 : 8484: 41 55 54 4f 52 45 50 4f 52 54 5f 54 45 4d 50 00 AUTOREPORT_TEMP. 00008494 : ... 00008495 : 8495: 33 2e 31 34 2e 31 00 3.14.1. 0000849c : 849c: 44 65 6c 65 74 69 6f 6e 20 66 61 69 6c 65 64 2c Deletion failed, 84ac: 20 46 69 6c 65 3a 20 00 File: . 000084b4 : 84b4: 46 69 6c 65 20 64 65 6c 65 74 65 64 3a 00 File deleted:. 000084c2 : 84c2: 4e 6f 74 20 53 44 20 70 72 69 6e 74 69 6e 67 00 Not SD printing. 000084d2 : 84d2: 50 72 69 6e 74 20 73 61 76 65 64 00 Print saved. 000084de : 84de: 53 44 20 70 72 69 6e 74 20 70 61 75 73 65 64 00 SD print paused. 000084ee : 84ee: 25 33 64 2f 25 33 64 00 %3d/%3d. 000084f6 : 84f6: 4f 4b 00 OK. 000084f9 : 84f9: 42 41 44 00 BAD. 000084fd : 84fd: 52 41 4d 42 6f 20 46 41 4e 20 00 RAMBo FAN . 00008508 : 8508: 43 52 41 53 48 5f 43 41 4e 43 45 4c 00 CRASH_CANCEL. 00008515 : 8515: 43 52 41 53 48 5f 52 45 43 4f 56 45 52 00 CRASH_RECOVER. 00008523 : 8523: 43 52 41 53 48 5f 52 45 43 4f 56 45 52 00 CRASH_RECOVER. 00008531 <_ZZ16process_commandsvE3__c__98_>: 8531: 22 28 32 29 00 "(2). 00008536 <_ZZ16process_commandsvE3__c__97_>: 8536: 25 53 3a 20 25 53 0a 00 %S: %S.. 0000853e <_ZZ16process_commandsvE3__c__96_>: 853e: 2c 20 4d 39 30 37 20 45 20 69 67 6e 6f 72 65 64 , M907 E ignored ... 0000854f <_ZZ16process_commandsvE3__c__95_>: 854f: 6e 6f 20 76 61 6c 69 64 20 63 6f 6d 6d 61 6e 64 no valid command ... 00008560 <_ZZ16process_commandsvE3__c__94_>: 8560: 7a 65 72 6f 72 69 7a 65 64 00 zerorized. 0000856a <_ZZ16process_commandsvE3__c__93_>: 856a: 66 61 63 74 6f 72 79 20 72 65 73 74 6f 72 65 64 factory restored ... 0000857b <_ZZ16process_commandsvE3__c__91_>: 857b: 69 6e 64 65 78 2c 20 74 65 6d 70 2c 20 75 73 74 index, temp, ust 858b: 65 70 2c 20 75 6d 00 ep, um. 00008592 <_ZZ16process_commandsvE3__c__92_>: 8592: 50 49 4e 44 41 20 63 61 6c 20 73 74 61 74 75 73 PINDA cal status 85a2: 3a 20 00 : . 000085a5 <_ZZ16process_commandsvE3__c__90_>: 85a5: 50 3a 00 P:. 000085a8 <_ZZ16process_commandsvE3__c__89_>: 85a8: 57 61 69 74 20 66 6f 72 20 50 49 4e 44 41 20 74 Wait for PINDA t 85b8: 61 72 67 65 74 20 74 65 6d 70 65 72 61 74 75 72 arget temperatur 85c8: 65 3a 00 e:. 000085cb <_ZZ16process_commandsvE3__c__88_>: 85cb: 20 41 00 A. 000085ce <_ZZ16process_commandsvE3__c__87_>: 85ce: 20 50 00 P. 000085d1 <_ZZ16process_commandsvE3__c__86_>: 85d1: 20 42 00 B. 000085d4 <_ZZ16process_commandsvE3__c__85_>: 85d4: 20 4c 00 L. 000085d7 <_ZZ16process_commandsvE3__c__84_>: 85d7: 20 52 00 R. 000085da <_ZZ16process_commandsvE3__c__83_>: 85da: 20 5a 00 Z. 000085dd <_ZZ16process_commandsvE3__c__82_>: 85dd: 20 4e 4f 54 20 49 4e 49 54 49 41 4c 49 5a 45 44 NOT INITIALIZED ... 000085ee <_ZZ16process_commandsvE3__c__81_>: 85ee: 53 68 65 65 74 20 00 Sheet . 000085f5 <_ZZ16process_commandsvE3__c__80_>: 85f5: 20 5a 20 56 41 4c 55 45 20 4f 55 54 20 4f 46 20 Z VALUE OUT OF 8605: 52 41 4e 47 45 00 RANGE. 0000860b <_ZZ16process_commandsvE3__c__79_>: 860b: 49 6e 76 61 6c 69 64 20 73 68 65 65 74 20 49 44 Invalid sheet ID 861b: 2e 20 41 6c 6c 6f 77 65 64 3a 20 30 2e 2e 00 . Allowed: 0... 0000862a <_ZZ16process_commandsvE3__c__78_>: 862a: 41 55 54 4f 00 AUTO. 0000862f <_ZZ16process_commandsvE3__c__77_>: 862f: 4c 41 4e 47 20 53 45 4c 20 46 4f 52 43 45 44 00 LANG SEL FORCED. 0000863f <_ZZ16process_commandsvE3__c__76_>: 863f: 20 64 3a 00 d:. 00008643 <_ZZ16process_commandsvE3__c__75_>: 8643: 20 69 3a 00 i:. 00008647 <_ZZ16process_commandsvE3__c__74_>: 8647: 20 70 3a 00 p:. 0000864b <_ZZ16process_commandsvE3__c__73_>: 864b: 20 64 3a 00 d:. 0000864f <_ZZ16process_commandsvE3__c__72_>: 864f: 20 69 3a 00 i:. 00008653 <_ZZ16process_commandsvE3__c__71_>: 8653: 20 70 3a 00 p:. 00008657 <_ZZ16process_commandsvE3__c__70_>: 8657: 25 69 25 25 0a 00 %i%%.. 0000865d <_ZZ16process_commandsvE3__c__69_>: 865d: 25 69 25 25 0a 00 %i%%.. 00008663 <_ZZ16process_commandsvE3__c__68_>: 8663: 22 28 31 29 00 "(1). 00008668 <_ZZ16process_commandsvE3__c__61_>: 8668: 2f 2f 00 //. 0000866b <_ZZ16process_commandsvE3__c__60_>: ... 0000866c <_ZZ16process_commandsvE3__c__59_>: 866c: 20 45 58 54 52 55 44 45 52 5f 43 4f 55 4e 54 3a EXTRUDER_COUNT: 867c: 31 00 1. 0000867e <_ZZ16process_commandsvE3__c__58_>: 867e: 20 4d 41 43 48 49 4e 45 5f 54 59 50 45 3a 00 MACHINE_TYPE:. 0000868d <_ZZ16process_commandsvE3__c__57_>: 868d: 31 2e 30 00 1.0. 00008691 <_ZZ16process_commandsvE3__c__56_>: 8691: 20 62 61 73 65 64 20 6f 6e 20 4d 61 72 6c 69 6e based on Marlin 86a1: 20 46 49 52 4d 57 41 52 45 5f 55 52 4c 3a 68 74 FIRMWARE_URL:ht 86b1: 74 70 73 3a 2f 2f 67 69 74 68 75 62 2e 63 6f 6d tps://github.com 86c1: 2f 70 72 75 73 61 33 64 2f 50 72 75 73 61 2d 46 /prusa3d/Prusa-F 86d1: 69 72 6d 77 61 72 65 20 50 52 4f 54 4f 43 4f 4c irmware PROTOCOL 86e1: 5f 56 45 52 53 49 4f 4e 3a 00 _VERSION:. 000086eb <_ZZ16process_commandsvE3__c__55_>: 86eb: 30 30 30 30 30 30 30 30 30 00 000000000. 000086f5 <_ZZ16process_commandsvE3__c__54_>: 86f5: 5f 00 _. 000086f7 <_ZZ16process_commandsvE3__c__53_>: 86f7: 38 32 33 37 00 8237. 000086fc <_ZZ16process_commandsvE3__c__52_>: 86fc: 2b 00 +. 000086fe <_ZZ16process_commandsvE3__c__51_>: 86fe: 46 49 52 4d 57 41 52 45 5f 4e 41 4d 45 3a 50 72 FIRMWARE_NAME:Pr 870e: 75 73 61 2d 46 69 72 6d 77 61 72 65 20 00 usa-Firmware . 0000871c <_ZZ16process_commandsvE3__c__50_>: 871c: 4d 31 31 33 20 53 00 M113 S. 00008723 <_ZZ16process_commandsvE3__c__49_>: 8723: 6f 6b 20 00 ok . 00008727 <_ZZ16process_commandsvE3__c__48_>: 8727: 20 63 6d 2e 00 cm.. 0000872c <_ZZ16process_commandsvE3__c__47_>: 872c: 20 6d 69 6e 20 00 min . 00008732 <_ZZ16process_commandsvE3__c__46_>: 8732: 53 54 41 54 53 20 00 STATS . 00008739 <_ZZ16process_commandsvE3__c__41_>: 8739: 6e 2f 61 00 n/a. 0000873d <_ZZ16process_commandsvE3__c__40_>: 873d: 3f 54 6f 73 68 69 62 61 20 46 6c 61 73 68 41 69 ?Toshiba FlashAi 874d: 72 20 47 65 74 49 50 20 66 61 69 6c 65 64 0a 00 r GetIP failed.. 0000875d : 875d: 00 01 25 31 1d 0c 40 24 30 1c 0b 45 23 2f 1b 0a ..%1..@$0..E#/.. 876d: 17 ff 04 06 22 2b 1a 03 36 37 35 38 ...."+..6758 00008779 <_ZZ16process_commandsvE3__c__39_>: 8779: 25 69 20 6d 69 6e 2c 20 25 69 20 73 65 63 00 %i min, %i sec. 00008788 <_ZZ16process_commandsvE3__c__36_>: 8788: 49 6e 76 61 6c 69 64 20 4d 20 63 6f 64 65 3a 20 Invalid M code: 8798: 25 73 0a 00 %s.. 0000879c <_ZZ16process_commandsvE3__c__30_>: 879c: 50 49 4e 44 41 20 70 72 6f 62 65 20 63 61 6c 69 PINDA probe cali 87ac: 62 72 61 74 69 6f 6e 20 73 74 61 72 74 00 bration start. 000087ba <_ZZ16process_commandsvE3__c__29_>: 87ba: 4e 6f 20 50 49 4e 44 41 20 74 68 65 72 6d 69 73 No PINDA thermis 87ca: 74 6f 72 00 tor. 000087ce <_ZZ16process_commandsvE3__c__25_>: 87ce: 73 65 74 00 set. 000087d2 <_ZZ16process_commandsvE3__c__24_>: 87d2: 6e 6f 7a 7a 6c 65 00 nozzle. 000087d9 <_ZZ16process_commandsvE3__c__23_>: 87d9: 4d 42 4c 00 MBL. 000087dd <_ZZ16process_commandsvE3__c__22_>: 87dd: 46 52 00 FR. 000087e0 <_ZZ16process_commandsvE3__c__21_>: 87e0: 4c 7a 00 Lz. 000087e3 <_ZZ16process_commandsvE3__c__20_>: 87e3: 4c 61 6e 67 00 Lang. 000087e8 <_ZZ16process_commandsvE3__c__19_>: 87e8: 31 5f 37 35 6d 6d 5f 4d 4b 33 2d 45 49 4e 53 79 1_75mm_MK3-EINSy 87f8: 5f 31 30 61 2d 45 33 44 52 45 56 4f 00 _10a-E3DREVO. 00008805 <_ZZ16process_commandsvE3__c__18_>: 8805: 52 65 76 00 Rev. 00008809 <_ZZ16process_commandsvE3__c__17_>: 8809: 33 2e 31 34 2e 31 2d 38 32 33 37 00 3.14.1-8237. 00008815 <_ZZ16process_commandsvE3__c__16_>: 8815: 46 69 72 00 Fir. 00008819 <_ZZ16process_commandsvE3__c__15_>: 8819: 53 4e 20 69 6e 76 61 6c 69 64 00 SN invalid. 00008824 <_ZZ16process_commandsvE3__c__14_>: 8824: 53 4e 00 SN. 00008827 <_ZZ16process_commandsvE3__c__13_>: 8827: 52 45 53 45 54 00 RESET. 0000882d <_ZZ16process_commandsvE3__c__12_>: 882d: 4d 4d 55 52 45 53 00 MMURES. 00008834 <_ZZ16process_commandsvE3__c__11_>: 8834: 75 76 6c 6f 00 uvlo. 00008839 : 8839: 46 41 4e 00 FAN. 0000883d : 883d: 46 41 4e 50 49 4e 54 53 54 00 FANPINTST. 00008847 : 8847: 50 52 55 53 41 00 PRUSA. 0000884d : 884d: 53 45 54 5f 43 48 4f 50 5f 00 SET_CHOP_. 00008857 : 8857: 53 45 54 5f 53 54 45 50 5f 00 SET_STEP_. 00008861 : 8861: 53 45 54 5f 57 41 56 45 5f 00 SET_WAVE_. 0000886b : 886b: 54 4d 43 5f 00 TMC_. 00008870 : 8870: 43 52 41 53 48 5f 43 41 4e 43 45 4c 00 CRASH_CANCEL. 0000887d : 887d: 43 52 41 53 48 5f 52 45 43 4f 56 45 52 00 CRASH_RECOVER. 0000888b : 888b: 43 52 41 53 48 5f 44 45 54 45 43 54 45 44 00 CRASH_DETECTED. 0000889a : 889a: 43 52 41 53 48 5f 00 CRASH_. 000088a1 : 88a1: 47 31 20 58 31 30 20 59 31 38 30 20 46 34 30 30 G1 X10 Y180 F400 88b1: 30 00 0. 000088b3 : 88b3: 47 31 20 5a 31 30 20 46 31 33 30 30 00 G1 Z10 F1300. 000088c0 : 88c0: 4d 31 34 30 20 53 30 00 M140 S0. 000088c8 : 88c8: 4d 31 30 34 20 53 30 00 M104 S0. 000088d0 : 88d0: 47 31 20 45 2d 30 2e 30 37 35 20 46 32 31 30 30 G1 E-0.075 F2100 ... 000088e1 : 88e1: 47 31 20 46 34 30 30 30 00 G1 F4000. 000088ea : 88ea: 4d 32 30 34 20 53 31 30 30 30 00 M204 S1000. 000088f5 : 88f5: 47 31 20 5a 35 20 46 37 32 30 30 00 G1 Z5 F7200. 00008901 : 8901: 47 31 20 45 2d 31 2e 35 20 46 32 31 30 30 00 G1 E-1.5 F2100. 00008910 : 8910: 47 39 30 00 G90. 00008914 : 8914: 47 31 20 58 35 20 45 34 20 46 31 30 30 30 00 G1 X5 E4 F1000. 00008923 : 8923: 47 31 20 5a 30 2e 32 20 46 31 30 30 30 00 G1 Z0.2 F1000. 00008931 : 8931: 47 31 20 58 35 35 20 45 32 35 20 46 31 34 30 30 G1 X55 E25 F1400 ... 00008942 : 8942: 47 31 20 59 2d 32 20 46 31 30 30 30 00 G1 Y-2 F1000. 0000894f : 894f: 47 31 20 58 32 34 30 20 45 32 35 20 20 46 32 32 G1 X240 E25 F22 895f: 30 30 00 00. 00008962 : 8962: 47 31 20 5a 30 2e 33 20 46 31 30 30 30 00 G1 Z0.3 F1000. 00008970 : 8970: 47 31 20 58 35 35 20 45 38 20 46 32 30 30 30 00 G1 X55 E8 F2000. 00008980 : 8980: 47 31 20 58 35 20 45 32 39 20 46 31 38 30 30 00 G1 X5 E29 F1800. 00008990 : 8990: 47 31 20 58 35 35 20 45 32 39 20 46 31 30 37 33 G1 X55 E29 F1073 ... 000089a1 : 89a1: 47 39 32 20 45 30 00 G92 E0. 000089a8 : 89a8: 47 32 38 00 G28. 000089ac : 89ac: 4d 31 30 39 00 M109. 000089b1 : 89b1: 4d 31 39 30 00 M190. 000089b6 : 89b6: 47 38 30 00 G80. 000089ba : 89ba: 4d 34 35 00 M45. 000089be : 89be: 4d 34 35 20 5a 00 M45 Z. 000089c4 : 89c4: 47 37 36 00 G76. 000089c8 : 89c8: 4d 37 30 31 20 50 30 00 M701 P0. 000089d0 : 89d0: 57 69 7a 61 72 64 20 73 74 61 74 65 3a 20 25 64 Wizard state: %d 89e0: 0a 00 .. 000089e2 : 89e2: 4d 39 31 34 00 M914. 000089e7 : 89e7: 4d 39 31 35 00 M915. 000089ec : 89ec: 45 78 70 65 72 69 6d 65 6e 74 61 6c 00 Experimental. 000089f9 : 89f9: 30 2e 38 30 00 0.80. 000089fe : 89fe: 30 2e 36 30 00 0.60. 00008a03 : 8a03: 30 2e 34 30 00 0.40. 00008a08 : 8a08: 30 2e 32 35 00 0.25. 00008a0d : 8a0d: 52 65 73 65 74 20 4d 4d 55 00 Reset MMU. 00008a17 : 8a17: 4d 4d 55 00 MMU. 00008a1b : 8a1b: 4d 34 34 00 M44. 00008a1f : 8a1f: 30 2e 38 30 00 0.80. 00008a24 : 8a24: 30 2e 36 30 00 0.60. 00008a29 : 8a29: 30 2e 34 30 00 0.40. 00008a2e : 8a2e: 30 2e 32 35 00 0.25. 00008a33 : 8a33: 47 32 38 20 58 59 00 G28 XY. 00008a3a : 8a3a: 4d 20 38 34 00 M 84. 00008a3f : 8a3f: 85 2e 2e 00 .... 00008a43 : 8a43: 59 3a 20 25 75 20 2d 3e 20 2e 2e 2e 00 Y: %u -> .... 00008a50 : 8a50: 58 3a 20 25 75 20 2d 3e 20 2e 2e 2e 00 X: %u -> .... 00008a5d : 8a5d: 25 33 64 2f 30 00 %3d/0. 00008a63 : 8a63: 25 33 64 2f 30 00 %3d/0. 00008a69 : 8a69: 25 63 20 41 58 49 53 20 53 47 31 3d 25 64 0a 00 %c AXIS SG1=%d.. 00008a79 : 8a79: 48 6f 74 65 6e 64 00 Hotend. 00008a80 : 8a80: 42 65 64 00 Bed. 00008a84 : 8a84: 5a 00 Z. 00008a86 : 8a86: 59 00 Y. 00008a88 : 8a88: 58 00 X. 00008a8a <_ZL13STR_SEPARATOR.lto_priv.442>: 8a8a: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ---------------- 8a9a: 2d 2d 2d 2d 00 ----. 00008a9f : 8a9f: 43 5a 50 58 49 6e 76 61 6c 69 64 53 65 72 69 61 CZPXInvalidSeria 8aaf: 6c 4e 72 00 lNr. 00008ab3 : 8ab3: 47 6a d0 88 c8 88 c0 88 b3 88 a1 88 Gj.......... 00008abf : 8abf: 47 31 20 58 25 64 20 59 25 64 20 45 25 2d 2e 35 G1 X%d Y%d E%-.5 8acf: 66 00 f. 00008ad1 : 8ad1: 47 31 20 46 31 30 38 30 00 G1 F1080. 00008ada : 8ada: 47 31 20 5a 25 2d 2e 33 66 20 46 37 32 30 30 00 G1 Z%-.3f F7200. 00008aea : 8aea: 47 31 20 58 35 30 20 59 31 35 35 00 G1 X50 Y155. 00008af6 : 8af6: a1 89 10 89 e0 6b 01 89 f5 88 ea 88 e1 88 .....k........ 00008b04 : 8b04: 47 31 20 58 25 64 20 45 25 2d 2e 33 66 20 46 31 G1 X%d E%-.3f F1 8b14: 30 30 30 00 000. 00008b18 : 8b18: 90 89 80 89 70 89 62 89 a1 89 4f 89 42 89 31 89 ....p.b...O.B.1. 8b28: 23 89 14 89 #... 00008b2c : 8b2c: 54 25 64 00 T%d. 00008b30 : 8b30: 47 31 20 5a 30 2e 34 20 46 31 30 30 30 00 G1 Z0.4 F1000. 00008b3e : 8b3e: 47 31 20 59 2d 33 20 46 31 30 30 30 00 G1 Y-3 F1000. 00008b4b : 8b4b: 47 6a b1 89 ac 89 a8 89 a1 89 Gj........ 00008b55 : 8b55: 4d 38 34 20 58 59 00 M84 XY. 00008b5c : 8b5c: 47 31 20 58 31 32 35 20 5a 32 30 30 20 46 31 30 G1 X125 Z200 F10 8b6c: 30 30 00 00. 00008b6f : 8b6f: 4d 33 31 30 20 41 20 46 31 00 M310 A F1. 00008b79 : 8b79: 47 31 20 58 31 32 35 20 59 31 30 35 20 5a 31 20 G1 X125 Y105 Z1 8b89: 46 38 30 30 30 00 F8000. 00008b8f : 8b8f: 49 6e 76 61 6c 69 64 20 50 49 44 20 63 61 6c 2e Invalid PID cal. 8b9f: 20 72 65 73 75 6c 74 73 2e 20 4e 6f 74 20 73 74 results. Not st 8baf: 6f 72 65 64 20 74 6f 20 45 45 50 52 4f 4d 2e 00 ored to EEPROM.. 00008bbf : 8bbf: 4d 33 30 31 20 50 25 2e 32 66 20 49 25 2e 32 66 M301 P%.2f I%.2f 8bcf: 20 44 25 2e 32 66 00 D%.2f. 00008bd6 : 8bd6: 4d 33 30 33 20 45 30 20 53 25 33 75 00 M303 E0 S%3u. 00008be3 : 8be3: 52 43 00 RC. 00008be6 : 8be6: 44 45 56 00 DEV. 00008bea : 8bea: 42 45 54 41 00 BETA. 00008bef : 8bef: 41 4c 50 48 41 00 ALPHA. 00008bf5 : 8bf5: 00 00 21 00 24 00 27 00 2a 00 2d 00 30 00 33 00 ..!.$.'.*.-.0.3. 8c05: 01 01 00 00 04 01 07 01 0a 01 .......... 00008c0f : 8c0f: 00 00 22 00 25 00 28 00 2b 00 2e 00 31 00 34 00 ..".%.(.+...1.4. 8c1f: 02 01 00 00 05 01 08 01 0b 01 .......... 00008c29 : 8c29: 00 00 20 00 23 00 26 00 29 00 2c 00 2f 00 32 00 .. .#.&.).,./.2. 8c39: 00 01 00 00 03 01 06 01 09 01 .......... 00008c43 : 8c43: 05 05 05 05 07 05 08 08 08 08 02 02 02 02 0a 0a ................ 8c53: 08 08 04 04 04 04 01 01 01 01 01 01 01 01 03 03 ................ 8c63: 03 03 03 03 03 03 04 07 07 07 0c 0c 0c 0c 0c 0c ................ 8c73: 0c 0c 02 02 02 02 06 06 06 06 06 06 06 06 0b 0b ................ 8c83: 0b 0b 0b 0b 0b 0b 07 07 0a 0a 0a 0a 0a 0a 05 05 ................ 8c93: 05 04 04 04 08 08 ...... 00008c99 : 8c99: 01 02 10 20 20 08 08 10 20 40 10 20 40 80 02 01 ... ... @. @... 8ca9: 02 01 08 04 02 01 01 02 04 08 10 20 40 80 80 40 ........... @..@ 8cb9: 20 10 08 04 02 01 80 04 02 01 80 40 20 10 08 04 ..........@ ... 8cc9: 02 01 08 04 02 01 01 02 04 08 10 20 40 80 01 02 ........... @... 8cd9: 04 08 10 20 40 80 10 08 04 08 80 10 20 40 04 40 ... @....... @.@ 8ce9: 80 10 20 40 04 80 .. @.. 00008cef : 8cef: 00 00 0a 0b 02 09 0c 0d 0e 08 07 03 04 01 00 00 ................ ... 8d1b: 12 11 10 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ ... 00008d45 : 8d45: 33 2e 31 34 2e 31 00 3.14.1. 00008d4c : 8d4c: 0a 20 4f 72 69 67 69 6e 61 6c 20 50 72 75 73 61 . Original Prusa 8d5c: 20 69 33 0a 20 20 20 50 72 75 73 61 20 52 65 73 i3. Prusa Res 8d6c: 65 61 72 63 68 0a 25 32 30 2e 32 30 53 00 earch.%20.20S. 00008d7a : 8d7a: 4c 61 6e 67 75 61 67 65 20 75 70 64 61 74 65 00 Language update. 00008d8a : 8d8a: 43 5a 50 58 00 CZPX. 00008d8f : 8d8f: 3b 53 00 ;S. 00008d92 : 8d92: 53 70 6f 6f 6c 4a 6f 69 6e 20 69 73 20 00 SpoolJoin is . 00008da0 : 8da0: 61 64 63 5f 69 6e 69 74 00 adc_init. 00008da9 : 8da9: 20 0a 20 0a 20 0a 20 00 . . . . 00008db1 : 8db1: 41 6c 6c 20 44 61 74 61 00 All Data. 00008dba : 8dba: 53 65 72 76 69 63 65 20 70 72 65 70 00 Service prep. 00008dc7 : 8dc7: 53 68 69 70 70 69 6e 67 20 70 72 65 70 00 Shipping prep. 00008dd5 : 8dd5: 53 74 61 74 69 73 74 69 63 73 00 Statistics. 00008de0 : 8de0: 4c 61 6e 67 75 61 67 65 00 Language. 00008de9 <_ZZL13factory_resetcE3__c.lto_priv.533>: 8de9: 45 52 41 53 49 4e 47 20 61 6c 6c 20 64 61 74 61 ERASING all data ... 00008dfa : 8dfa: 46 61 63 74 6f 72 79 20 52 45 53 45 54 00 Factory RESET. 00008e08 : 8e08: 50 52 55 53 41 33 44 46 57 00 PRUSA3DFW. 00008e12 <_ZL8MSG_INT4.lto_priv.482>: 8e12: 49 4e 54 34 00 INT4. 00008e17 : 8e17: 03 00 0e 00 01 00 40 00 ......@. 00008e1f : 8e1f: 03 00 02 00 00 00 04 00 ........ 00008e27 : 8e27: 55 6e 6b 6e 6f 77 6e 00 Unknown. 00008e2f : 8e2f: 31 39 37 30 2d 30 31 2d 30 31 20 30 31 3a 30 30 1970-01-01 01:00 8e3f: 3a 30 30 00 :00. 00008e43 : 8e43: 20 33 2e 31 34 2e 31 2d 38 32 33 37 5f 30 30 30 3.14.1-8237_000 8e53: 30 30 30 30 30 30 00 000000. 00008e5a : 8e5a: 73 74 61 72 74 00 start. 00008e60 : 8e60: 53 4e 20 75 70 64 61 74 65 20 66 61 69 6c 65 64 SN update failed ... 00008e71 : 8e71: 53 4e 20 75 70 64 61 74 65 64 00 SN updated. 00008e7c : 8e7c: 43 5a 50 58 00 CZPX. 00008e81 : 8e81: 43 52 41 53 48 5f 44 45 54 45 43 54 45 44 58 59 CRASH_DETECTEDXY ... 00008e92 : 8e92: 43 52 41 53 48 5f 44 45 54 45 43 54 45 44 59 00 CRASH_DETECTEDY. 00008ea2 : 8ea2: 43 52 41 53 48 5f 44 45 54 45 43 54 45 44 58 00 CRASH_DETECTEDX. 00008eb2 : 8eb2: 4d 32 39 00 M29. 00008eb6 : 8eb6: 25 2d 39 2e 39 53 5b 00 %-9.9S[. 00008ebe : 8ebe: 54 4d 20 65 73 74 69 6d 61 74 69 6f 6e 20 64 69 TM estimation di 8ece: 64 20 6e 6f 74 20 63 6f 6e 76 65 72 67 65 00 d not converge. 00008edd : 8edd: 54 4d 20 69 74 65 72 3a 25 75 20 76 3a 25 2e 32 TM iter:%u v:%.2 8eed: 66 20 65 3a 25 2e 33 66 0a 00 f e:%.3f.. 00008ef7 : 8ef7: 20 0a 20 0a 20 00 . . . 00008efd : 8efd: 00 00 48 42 00 00 58 41 9a 99 8d 41 33 33 53 40 ..HB..XA...A33S@ 00008f0d : 8f0d: 4d 4d 55 32 3a 00 MMU2:. 00008f13 : 8f13: 4d 49 4e 54 45 4d 50 20 42 45 44 20 66 69 78 65 MINTEMP BED fixe 8f23: 64 00 d. 00008f25 : 8f25: 4d 49 4e 54 45 4d 50 20 48 4f 54 45 4e 44 20 66 MINTEMP HOTEND f 8f35: 69 78 65 64 00 ixed. 00008f3a : 8f3a: 72 65 63 6f 76 65 72 5f 6d 61 63 68 69 6e 65 5f recover_machine_ 8f4a: 73 74 61 74 65 5f 61 66 74 65 72 5f 70 6f 77 65 state_after_powe 8f5a: 72 5f 70 61 6e 69 63 2c 20 69 6e 69 74 69 61 6c r_panic, initial 8f6a: 20 00 . 00008f6c <_ZZL25restore_print_from_eeprombE3__c__12_>: 8f6c: 50 52 55 53 41 20 75 76 6c 6f 00 PRUSA uvlo. 00008f77 <_ZZL25restore_print_from_eeprombE3__c__11_>: 8f77: 47 34 20 53 30 00 G4 S0. 00008f7d <_ZZL25restore_print_from_eeprombE3__c__10_>: 8f7d: 4d 31 31 30 20 4e 25 6c 75 00 M110 N%lu. 00008f87 : 8f87: 4d 32 36 20 53 25 6c 75 00 M26 S%lu. 00008f90 : 8f90: 4d 31 30 36 20 53 25 75 00 M106 S%u. 00008f99 : 8f99: 47 31 20 46 25 64 00 G1 F%d. 00008fa0 : 8fa0: 4d 38 32 00 M82. 00008fa4 : 8fa4: 47 39 32 20 45 25 2d 2e 33 66 00 G92 E%-.3f. 00008faf : 8faf: 4d 32 30 34 20 50 25 2d 2e 31 66 20 52 25 2d 2e M204 P%-.1f R%-. 8fbf: 31 66 20 54 25 2d 2e 31 66 00 1f T%-.1f. 00008fc9 : 8fc9: 47 31 20 5a 25 2d 2e 33 66 00 G1 Z%-.3f. 00008fd3 : 8fd3: 50 52 55 53 41 20 4d 42 4c 20 56 31 00 PRUSA MBL V1. 00008fe0 : 8fe0: 47 31 20 58 25 2d 2e 33 66 20 59 25 2d 2e 33 66 G1 X%-.3f Y%-.3f 8ff0: 20 46 33 30 30 30 00 F3000. 00008ff7 : 8ff7: 2c 20 66 65 65 64 6d 75 6c 74 69 70 6c 79 3a 00 , feedmultiply:. 00009007 : 9007: 46 65 65 64 72 61 74 65 3a 00 Feedrate:. 00009011 : 9011: 47 31 20 45 35 20 46 31 32 30 00 G1 E5 F120. 0000901c : 901c: 4d 31 30 39 20 53 25 64 00 M109 S%d. 00009025 : 9025: 4d 31 34 30 20 53 25 64 00 M140 S%d. 0000902e : 902e: 4d 31 30 34 20 53 25 64 00 M104 S%d. 00009037 : 9037: 47 32 38 20 58 20 59 00 G28 X Y. 0000903f : 903f: 47 31 20 5a 25 2e 33 66 20 46 38 30 30 00 G1 Z%.3f F800. 0000904d : 904d: 00 00 21 10 42 20 63 30 84 40 a5 50 c6 60 e7 70 ..!.B c0.@.P.`.p 905d: 08 81 29 91 4a a1 6b b1 8c c1 ad d1 ce e1 ef f1 ..).J.k......... 906d: 31 12 10 02 73 32 52 22 b5 52 94 42 f7 72 d6 62 1...s2R".R.B.r.b 907d: 39 93 18 83 7b b3 5a a3 bd d3 9c c3 ff f3 de e3 9...{.Z......... 908d: 62 24 43 34 20 04 01 14 e6 64 c7 74 a4 44 85 54 b$C4 ....d.t.D.T 909d: 6a a5 4b b5 28 85 09 95 ee e5 cf f5 ac c5 8d d5 j.K.(........... 90ad: 53 36 72 26 11 16 30 06 d7 76 f6 66 95 56 b4 46 S6r&..0..v.f.V.F 90bd: 5b b7 7a a7 19 97 38 87 df f7 fe e7 9d d7 bc c7 [.z...8......... 90cd: c4 48 e5 58 86 68 a7 78 40 08 61 18 02 28 23 38 .H.X.h.x@.a..(#8 90dd: cc c9 ed d9 8e e9 af f9 48 89 69 99 0a a9 2b b9 ........H.i...+. 90ed: f5 5a d4 4a b7 7a 96 6a 71 1a 50 0a 33 3a 12 2a .Z.J.z.jq.P.3:.* 90fd: fd db dc cb bf fb 9e eb 79 9b 58 8b 3b bb 1a ab ........y.X.;... 910d: a6 6c 87 7c e4 4c c5 5c 22 2c 03 3c 60 0c 41 1c .l.|.L.\",.<`.A. 911d: ae ed 8f fd ec cd cd dd 2a ad 0b bd 68 8d 49 9d ........*...h.I. 912d: 97 7e b6 6e d5 5e f4 4e 13 3e 32 2e 51 1e 70 0e .~.n.^.N.>2.Q.p. 913d: 9f ff be ef dd df fc cf 1b bf 3a af 59 9f 78 8f ..........:.Y.x. 914d: 88 91 a9 81 ca b1 eb a1 0c d1 2d c1 4e f1 6f e1 ..........-.N.o. 915d: 80 10 a1 00 c2 30 e3 20 04 50 25 40 46 70 67 60 .....0. .P%@Fpg` 916d: b9 83 98 93 fb a3 da b3 3d c3 1c d3 7f e3 5e f3 ........=.....^. 917d: b1 02 90 12 f3 22 d2 32 35 42 14 52 77 62 56 72 .....".25B.RwbVr 918d: ea b5 cb a5 a8 95 89 85 6e f5 4f e5 2c d5 0d c5 ........n.O.,... 919d: e2 34 c3 24 a0 14 81 04 66 74 47 64 24 54 05 44 .4.$....ftGd$T.D 91ad: db a7 fa b7 99 87 b8 97 5f e7 7e f7 1d c7 3c d7 ........_.~...<. 91bd: d3 26 f2 36 91 06 b0 16 57 66 76 76 15 46 34 56 .&.6....Wfvv.F4V 91cd: 4c d9 6d c9 0e f9 2f e9 c8 99 e9 89 8a b9 ab a9 L.m.../......... 91dd: 44 58 65 48 06 78 27 68 c0 18 e1 08 82 38 a3 28 DXeH.x'h.....8.( 91ed: 7d cb 5c db 3f eb 1e fb f9 8b d8 9b bb ab 9a bb }.\.?........... 91fd: 75 4a 54 5a 37 6a 16 7a f1 0a d0 1a b3 2a 92 3a uJTZ7j.z.....*.: 920d: 2e fd 0f ed 6c dd 4d cd aa bd 8b ad e8 9d c9 8d ....l.M......... 921d: 26 7c 07 6c 64 5c 45 4c a2 3c 83 2c e0 1c c1 0c &|.ld\EL.<.,.... 922d: 1f ef 3e ff 5d cf 7c df 9b af ba bf d9 8f f8 9f ..>.].|......... 923d: 17 6e 36 7e 55 4e 74 5e 93 2e b2 3e d1 0e f0 1e .n6~UNt^...>.... 0000924d : 924d: 7c 3c 3e 3f 2f 2a 22 5c 00 |<>?/*"\. 00009256 : 9256: 24 f4 d4 30 50 c3 8e 20 c2 a2 40 17 82 8b 70 11 $..0P.. ..@...p. 9266: 12 7a 91 0d 81 6c d9 0a a8 61 e1 08 c7 58 66 07 .z...l...a...Xf. 9276: 61 51 43 06 1e 4b 5d 05 c1 45 a7 04 1a 41 11 04 aQC..K]..E...A.. 9286: 09 3d 98 03 71 39 31 03 40 36 db 02 65 33 91 02 .=..q91.@6..e3.. 9296: d4 30 54 02 80 2e 1d 02 63 2c ee 01 75 2a c5 01 .0T.....c,..u*.. 92a6: b0 28 a0 01 10 27 81 01 8f 25 64 01 2b 24 4b 01 .(...'...%d.+$K. 92b6: e0 22 34 01 ac 21 1f 01 8d 20 0d 01 80 1f fc 00 ."4..!... ...... 92c6: 84 1e ed 00 97 1d df 00 b8 1c d2 00 e6 1b c6 00 ................ 92d6: 20 1b bc 00 64 1a b2 00 b2 19 a8 00 0a 19 a0 00 ...d........... 92e6: 6a 18 99 00 d1 17 91 00 40 17 8b 00 b5 16 84 00 j.......@....... 92f6: 31 16 7e 00 b3 15 79 00 3a 15 73 00 c7 14 6f 00 1.~...y.:.s...o. 9306: 58 14 6a 00 ee 13 66 00 88 13 63 00 25 13 5e 00 X.j...f...c.%.^. 9316: c7 12 5b 00 6c 12 57 00 15 12 54 00 c1 11 51 00 ..[.l.W...T...Q. 9326: 70 11 4f 00 21 11 4b 00 d6 10 49 00 8d 10 47 00 p.O.!.K...I...G. 9336: 46 10 44 00 02 10 42 00 c0 0f 40 00 80 0f 3e 00 F.D...B...@...>. 9346: 42 0f 3c 00 06 0f 3b 00 cb 0e 38 00 93 0e 37 00 B.<...;...8...7. 9356: 5c 0e 35 00 27 0e 34 00 f3 0d 32 00 c1 0d 31 00 \.5.'.4...2...1. 9366: 90 0d 30 00 60 0d 2e 00 32 0d 2d 00 05 0d 2c 00 ..0.`...2.-...,. 9376: d9 0c 2b 00 ae 0c 29 00 85 0c 29 00 5c 0c 27 00 ..+...)...).\.'. 9386: 35 0c 27 00 0e 0c 26 00 e8 0b 24 00 c4 0b 24 00 5.'...&...$...$. 9396: a0 0b 23 00 7d 0b 23 00 5a 0b 21 00 39 0b 21 00 ..#.}.#.Z.!.9.!. 93a6: 18 0b 20 00 f8 0a 1f 00 d9 0a 1e 00 bb 0a 1e 00 .. ............. 93b6: 9d 0a 1d 00 80 0a 1d 00 63 0a 1c 00 47 0a 1b 00 ........c...G... 93c6: 2c 0a 1b 00 11 0a 1a 00 f7 09 1a 00 dd 09 19 00 ,............... 93d6: c4 09 19 00 ab 09 19 00 92 09 17 00 7b 09 18 00 ............{... 93e6: 63 09 17 00 4c 09 16 00 36 09 16 00 20 09 16 00 c...L...6... ... 93f6: 0a 09 15 00 f5 08 15 00 e0 08 14 00 cc 08 14 00 ................ 9406: b8 08 14 00 a4 08 14 00 90 08 13 00 7d 08 12 00 ............}... 9416: 6b 08 13 00 58 08 12 00 46 08 12 00 34 08 11 00 k...X...F...4... 9426: 23 08 11 00 12 08 11 00 01 08 11 00 f0 07 10 00 #............... 9436: e0 07 10 00 d0 07 10 00 c0 07 10 00 b0 07 0f 00 ................ 9446: a1 07 10 00 91 07 0e 00 83 07 0f 00 74 07 0f 00 ............t... 9456: 65 07 0e 00 57 07 0e 00 49 07 0e 00 3b 07 0d 00 e...W...I...;... 9466: 2e 07 0e 00 20 07 0d 00 13 07 0d 00 06 07 0d 00 .... ........... 9476: f9 06 0c 00 ed 06 0d 00 e0 06 0c 00 d4 06 0c 00 ................ 9486: c8 06 0c 00 bc 06 0c 00 b0 06 0c 00 a4 06 0b 00 ................ 9496: 99 06 0c 00 8d 06 0b 00 82 06 0b 00 77 06 0b 00 ............w... 94a6: 6c 06 0b 00 61 06 0a 00 57 06 0b 00 4c 06 0a 00 l...a...W...L... 94b6: 42 06 0a 00 38 06 0a 00 2e 06 0a 00 24 06 0a 00 B...8.......$... 94c6: 1a 06 0a 00 10 06 09 00 07 06 0a 00 fd 05 09 00 ................ 94d6: f4 05 09 00 eb 05 09 00 e2 05 09 00 d9 05 09 00 ................ 94e6: d0 05 09 00 c7 05 09 00 be 05 09 00 b5 05 08 00 ................ 94f6: ad 05 08 00 a5 05 09 00 9c 05 08 00 94 05 08 00 ................ 9506: 8c 05 08 00 84 05 08 00 7c 05 08 00 74 05 08 00 ........|...t... 9516: 6c 05 07 00 65 05 08 00 5d 05 07 00 56 05 08 00 l...e...]...V... 9526: 4e 05 07 00 47 05 07 00 40 05 08 00 38 05 07 00 N...G...@...8... 9536: 31 05 07 00 2a 05 07 00 23 05 07 00 1c 05 06 00 1...*...#....... 9546: 16 05 07 00 0f 05 07 00 08 05 06 00 02 05 07 00 ................ 9556: fb 04 06 00 f5 04 07 00 ee 04 06 00 e8 04 06 00 ................ 9566: e2 04 07 00 db 04 06 00 d5 04 06 00 cf 04 06 00 ................ 9576: c9 04 06 00 c3 04 06 00 bd 04 06 00 b7 04 06 00 ................ 9586: b1 04 05 00 ac 04 06 00 a6 04 06 00 a0 04 05 00 ................ 9596: 9b 04 06 00 95 04 05 00 90 04 06 00 8a 04 05 00 ................ 95a6: 85 04 05 00 80 04 06 00 7a 04 05 00 75 04 05 00 ........z...u... 95b6: 70 04 05 00 6b 04 05 00 66 04 05 00 61 04 05 00 p...k...f...a... 95c6: 5c 04 05 00 57 04 05 00 52 04 05 00 4d 04 05 00 \...W...R...M... 95d6: 48 04 05 00 43 04 05 00 3e 04 04 00 3a 04 05 00 H...C...>...:... 95e6: 35 04 05 00 30 04 04 00 2c 04 05 00 27 04 04 00 5...0...,...'... 95f6: 23 04 05 00 1e 04 04 00 1a 04 04 00 16 04 05 00 #............... 9606: 11 04 04 00 0d 04 04 00 09 04 05 00 04 04 04 00 ................ 9616: 00 04 04 00 fc 03 04 00 f8 03 04 00 f4 03 04 00 ................ 9626: f0 03 04 00 ec 03 04 00 e8 03 04 00 e4 03 04 00 ................ 9636: e0 03 04 00 dc 03 04 00 d8 03 04 00 d4 03 04 00 ................ 9646: d0 03 04 00 cc 03 04 00 c8 03 03 00 c5 03 03 00 ................ 00009656 : 9656: 24 f4 04 d9 20 1b c4 0c 5c 0e 98 04 c4 09 5f 02 $... ...\....._. 9666: 65 07 71 01 f4 05 f9 00 fb 04 b3 00 48 04 87 00 e.q.........H... 9676: c1 03 69 00 58 03 55 00 03 03 45 00 be 02 3a 00 ..i.X.U...E...:. 9686: 84 02 31 00 53 02 2a 00 29 02 25 00 04 02 20 00 ..1.S.*.).%... . 9696: e4 01 1c 00 c8 01 19 00 af 01 17 00 98 01 14 00 ................ 96a6: 84 01 13 00 71 01 10 00 61 01 10 00 51 01 0e 00 ....q...a...Q... 96b6: 43 01 0d 00 36 01 0b 00 2b 01 0b 00 20 01 0b 00 C...6...+... ... 96c6: 15 01 09 00 0c 01 09 00 03 01 08 00 fb 00 08 00 ................ 96d6: f3 00 08 00 eb 00 07 00 e4 00 06 00 de 00 06 00 ................ 96e6: d8 00 06 00 d2 00 06 00 cc 00 05 00 c7 00 05 00 ................ 96f6: c2 00 05 00 bd 00 04 00 b9 00 04 00 b5 00 04 00 ................ 9706: b1 00 04 00 ad 00 04 00 a9 00 04 00 a5 00 03 00 ................ 9716: a2 00 03 00 9f 00 04 00 9b 00 03 00 98 00 03 00 ................ 9726: 95 00 02 00 93 00 03 00 90 00 03 00 8d 00 02 00 ................ 9736: 8b 00 03 00 88 00 02 00 86 00 02 00 84 00 03 00 ................ 9746: 81 00 02 00 7f 00 02 00 7d 00 02 00 7b 00 02 00 ........}...{... 9756: 79 00 02 00 77 00 01 00 76 00 02 00 74 00 02 00 y...w...v...t... 9766: 72 00 01 00 71 00 02 00 6f 00 02 00 6d 00 01 00 r...q...o...m... 9776: 6c 00 02 00 6a 00 01 00 69 00 02 00 67 00 01 00 l...j...i...g... 9786: 66 00 01 00 65 00 01 00 64 00 02 00 62 00 01 00 f...e...d...b... 9796: 61 00 01 00 60 00 01 00 5f 00 02 00 5d 00 01 00 a...`..._...]... 97a6: 5c 00 01 00 5b 00 01 00 5a 00 01 00 59 00 01 00 \...[...Z...Y... 97b6: 58 00 01 00 57 00 01 00 56 00 01 00 55 00 01 00 X...W...V...U... 97c6: 54 00 01 00 53 00 00 00 53 00 01 00 52 00 01 00 T...S...S...R... 97d6: 51 00 01 00 50 00 01 00 4f 00 01 00 4e 00 00 00 Q...P...O...N... 97e6: 4e 00 01 00 4d 00 01 00 4c 00 01 00 4b 00 00 00 N...M...L...K... 97f6: 4b 00 01 00 4a 00 01 00 49 00 01 00 48 00 00 00 K...J...I...H... 9806: 48 00 01 00 47 00 01 00 46 00 00 00 46 00 01 00 H...G...F...F... 9816: 45 00 00 00 45 00 01 00 44 00 01 00 43 00 00 00 E...E...D...C... 9826: 43 00 01 00 42 00 00 00 42 00 01 00 41 00 00 00 C...B...B...A... 9836: 41 00 01 00 40 00 01 00 3f 00 00 00 3f 00 01 00 A...@...?...?... 9846: 3e 00 00 00 3e 00 01 00 3d 00 00 00 3d 00 01 00 >...>...=...=... 9856: 3c 00 00 00 3c 00 00 00 3c 00 01 00 3b 00 00 00 <...<...<...;... 9866: 3b 00 01 00 3a 00 00 00 3a 00 01 00 39 00 00 00 ;...:...:...9... 9876: 39 00 01 00 38 00 00 00 38 00 00 00 38 00 01 00 9...8...8...8... 9886: 37 00 00 00 37 00 01 00 36 00 00 00 36 00 00 00 7...7...6...6... 9896: 36 00 01 00 35 00 00 00 35 00 00 00 35 00 01 00 6...5...5...5... 98a6: 34 00 00 00 34 00 00 00 34 00 01 00 33 00 00 00 4...4...4...3... 98b6: 33 00 00 00 33 00 01 00 32 00 00 00 32 00 00 00 3...3...2...2... 98c6: 32 00 01 00 31 00 00 00 31 00 00 00 31 00 01 00 2...1...1...1... 98d6: 30 00 00 00 30 00 00 00 30 00 01 00 2f 00 00 00 0...0...0.../... 98e6: 2f 00 00 00 2f 00 00 00 2f 00 01 00 2e 00 00 00 /.../.../....... 98f6: 2e 00 00 00 2e 00 01 00 2d 00 00 00 2d 00 00 00 ........-...-... 9906: 2d 00 00 00 2d 00 01 00 2c 00 00 00 2c 00 00 00 -...-...,...,... 9916: 2c 00 00 00 2c 00 01 00 2b 00 00 00 2b 00 00 00 ,...,...+...+... 9926: 2b 00 00 00 2b 00 01 00 2a 00 00 00 2a 00 00 00 +...+...*...*... 9936: 2a 00 00 00 2a 00 01 00 29 00 00 00 29 00 00 00 *...*...)...)... 9946: 29 00 00 00 29 00 00 00 29 00 01 00 28 00 00 00 )...)...)...(... 9956: 28 00 00 00 28 00 00 00 28 00 00 00 28 00 01 00 (...(...(...(... 9966: 27 00 00 00 27 00 00 00 27 00 00 00 27 00 00 00 '...'...'...'... 9976: 27 00 01 00 26 00 00 00 26 00 00 00 26 00 00 00 '...&...&...&... 9986: 26 00 00 00 26 00 01 00 25 00 00 00 25 00 00 00 &...&...%...%... 9996: 25 00 00 00 25 00 00 00 25 00 00 00 25 00 01 00 %...%...%...%... 99a6: 24 00 00 00 24 00 00 00 24 00 00 00 24 00 00 00 $...$...$...$... 99b6: 24 00 01 00 23 00 00 00 23 00 00 00 23 00 00 00 $...#...#...#... 99c6: 23 00 00 00 23 00 00 00 23 00 00 00 23 00 01 00 #...#...#...#... 99d6: 22 00 00 00 22 00 00 00 22 00 00 00 22 00 00 00 "..."..."..."... 99e6: 22 00 00 00 22 00 01 00 21 00 00 00 21 00 00 00 "..."...!...!... 99f6: 21 00 00 00 21 00 00 00 21 00 00 00 21 00 00 00 !...!...!...!... 9a06: 21 00 01 00 20 00 00 00 20 00 00 00 20 00 00 00 !... ... ... ... 9a16: 20 00 00 00 20 00 00 00 20 00 00 00 20 00 00 00 ... ... ... ... 9a26: 20 00 01 00 1f 00 00 00 1f 00 00 00 1f 00 00 00 ............... 9a36: 1f 00 00 00 1f 00 00 00 1f 00 00 00 1f 00 01 00 ................ 9a46: 1e 00 00 00 1e 00 00 00 1e 00 00 00 1e 00 00 00 ................ 00009a56 <_ZZ12PID_autotunefiiE3__c__16_>: 9a56: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 69 6e PID Autotune fin 9a66: 69 73 68 65 64 21 20 50 75 74 20 74 68 65 20 6c ished! Put the l 9a76: 61 73 74 20 4b 70 2c 20 4b 69 20 61 6e 64 20 4b ast Kp, Ki and K 9a86: 64 20 63 6f 6e 73 74 61 6e 74 73 20 66 72 6f 6d d constants from 9a96: 20 61 62 6f 76 65 20 69 6e 74 6f 20 43 6f 6e 66 above into Conf 9aa6: 69 67 75 72 61 74 69 6f 6e 2e 68 00 iguration.h. 00009ab2 <_ZZ12PID_autotunefiiE3__c__15_>: 9ab2: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 61 69 PID Autotune fai 9ac2: 6c 65 64 21 20 74 69 6d 65 6f 75 74 00 led! timeout. 00009acf <_ZZ12PID_autotunefiiE3__c__14_>: 9acf: 20 40 3a 00 @:. 00009ad3 <_ZZ12PID_autotunefiiE3__c__13_>: 9ad3: 54 3a 00 T:. 00009ad6 <_ZZ12PID_autotunefiiE3__c__12_>: 9ad6: 42 3a 00 B:. 00009ad9 <_ZZ12PID_autotunefiiE3__c__11_>: 9ad9: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 61 69 PID Autotune fai 9ae9: 6c 65 64 21 20 54 65 6d 70 65 72 61 74 75 72 65 led! Temperature 9af9: 20 74 6f 6f 20 68 69 67 68 00 too high. 00009b03 <_ZZ12PID_autotunefiiE3__c__10_>: 9b03: 20 4b 64 3a 20 00 Kd: . 00009b09 : 9b09: 20 4b 69 3a 20 00 Ki: . 00009b0f : 9b0f: 20 4b 70 3a 20 00 Kp: . 00009b15 : 9b15: 20 43 6c 61 73 73 69 63 20 50 49 44 20 00 Classic PID . 00009b23 : 9b23: 20 54 75 3a 20 00 Tu: . 00009b29 : 9b29: 20 4b 75 3a 20 00 Ku: . 00009b2f : 9b2f: 20 6d 61 78 3a 20 00 max: . 00009b36 : 9b36: 20 6d 69 6e 3a 20 00 min: . 00009b3d : 9b3d: 20 64 3a 20 00 d: . 00009b42 : 9b42: 20 62 69 61 73 3a 20 00 bias: . 00009b4a : 9b4a: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 73 74 61 PID Autotune sta 9b5a: 72 74 00 rt. 00009b5d : 9b5d: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 61 69 PID Autotune fai 9b6d: 6c 65 64 2e 20 42 61 64 20 65 78 74 72 75 64 65 led. Bad extrude 9b7d: 72 20 6e 75 6d 62 65 72 2e 00 r number.. 00009b87 : 9b87: 54 4d 4c 20 25 64 20 25 64 20 25 78 20 25 6c 78 TML %d %d %x %lx 9b97: 20 25 6c 78 0a 00 %lx.. 00009b9d : 9b9d: 4d 49 4e 54 45 4d 50 00 MINTEMP. 00009ba5 : 9ba5: 4d 49 4e 54 45 4d 50 20 42 45 44 00 MINTEMP BED. 00009bb1 : 9bb1: 4d 49 4e 54 45 4d 50 20 41 4d 42 00 MINTEMP AMB. 00009bbd : 9bbd: 4d 41 58 54 45 4d 50 00 MAXTEMP. 00009bc5 : 9bc5: 4d 41 58 54 45 4d 50 20 42 45 44 00 MAXTEMP BED. 00009bd1 : 9bd1: 4d 41 58 54 45 4d 50 20 41 4d 42 00 MAXTEMP AMB. 00009bdd : 9bdd: 54 4d 3a 20 65 72 72 6f 72 20 63 6c 65 61 72 65 TM: error cleare 9bed: 64 00 d. 00009bef : 9bef: 54 4d 3a 20 65 72 72 6f 72 20 74 72 69 67 67 65 TM: error trigge 9bff: 72 65 64 21 00 red!. 00009c04 : 9c04: 54 4d 3a 20 65 72 72 6f 72 20 7c 25 66 7c 3e 25 TM: error |%f|>% 9c14: 66 0a 00 f.. 00009c17 : 9c17: 70 01 2c 01 90 01 27 01 b0 01 22 01 c0 01 1d 01 p.,...'..."..... 9c27: f0 01 18 01 10 02 13 01 30 02 0e 01 60 02 09 01 ........0...`... 9c37: 90 02 04 01 c0 02 ff 00 00 03 fa 00 40 03 f5 00 ............@... 9c47: 80 03 f0 00 d0 03 eb 00 20 04 e6 00 70 04 e1 00 ........ ...p... 9c57: e0 04 dc 00 40 05 d7 00 c0 05 d2 00 40 06 cd 00 ....@.......@... 9c67: d0 06 c8 00 80 07 c3 00 30 08 be 00 f0 08 b9 00 ........0....... 9c77: c0 09 b4 00 b0 0a af 00 b0 0b aa 00 d0 0c a5 00 ................ 9c87: 00 0e a0 00 50 0f 9b 00 c0 10 96 00 50 12 91 00 ....P.......P... 9c97: 00 14 8c 00 c0 15 87 00 b0 17 82 00 b0 19 7d 00 ..............}. 9ca7: d0 1b 78 00 00 1e 73 00 40 20 6e 00 90 22 69 00 ..x...s.@ n.."i. 9cb7: f0 24 64 00 40 27 5f 00 90 29 5a 00 e0 2b 55 00 .$d.@'_..)Z..+U. 9cc7: 10 2e 50 00 20 30 4b 00 10 32 46 00 e0 33 41 00 ..P. 0K..2F..3A. 9cd7: 90 35 3c 00 10 37 37 00 70 38 32 00 a0 39 2d 00 .5<..77.p82..9-. 9ce7: b0 3a 28 00 a0 3b 23 00 60 3c 1e 00 10 3d 19 00 .:(..;#.`<...=.. 9cf7: 90 3d 14 00 10 3e 0f 00 70 3e 0a 00 c0 3e 05 00 .=...>..p>...>.. 9d07: 00 3f 00 00 .?.. 00009d0b : 9d0b: 90 13 7d 00 b0 15 78 00 f0 17 73 00 60 1a 6e 00 ..}...x...s.`.n. 9d1b: f0 1c 69 00 a0 1f 64 00 50 22 5f 00 20 25 5a 00 ..i...d.P"_. %Z. 9d2b: e0 27 55 00 90 2a 50 00 20 2d 4b 00 a0 2f 46 00 .'U..*P. -K../F. 9d3b: f0 31 41 00 10 34 3c 00 f0 35 37 00 a0 37 32 00 .1A..4<..57..72. 9d4b: 20 39 2d 00 60 3a 28 00 70 3b 23 00 60 3c 1e 00 9-.`:(.p;#.`<.. 9d5b: 20 3d 19 00 c0 3d 14 00 40 3e 0f 00 a0 3e 0a 00 =...=..@>...>.. 9d6b: f0 3e 05 00 40 3f 00 00 70 3f fb ff 90 3f f6 ff .>..@?..p?...?.. 9d7b: b0 3f f1 ff c0 3f ec ff d0 3f e7 ff e0 3f e2 ff .?...?...?...?.. 9d8b: f0 3f dd ff f0 3f d8 ff .?...?.. 00009d93 : 9d93: 20 48 4f 54 45 4e 44 20 54 48 45 52 4d 41 4c 20 HOTEND THERMAL 9da3: 52 55 4e 41 57 41 59 00 RUNAWAY. 00009dab : 9dab: 20 48 45 41 54 42 45 44 20 54 48 45 52 4d 41 4c HEATBED THERMAL 9dbb: 20 52 55 4e 41 57 41 59 00 RUNAWAY. 00009dc4 : 9dc4: 54 48 45 52 4d 41 4c 20 52 55 4e 41 57 41 59 00 THERMAL RUNAWAY. 00009dd4 : 9dd4: 42 45 44 20 54 48 45 52 4d 41 4c 20 52 55 4e 41 BED THERMAL RUNA 9de4: 57 41 59 00 WAY. 00009de8 : 9de8: 20 54 48 45 52 4d 41 4c 20 52 55 4e 41 57 41 59 THERMAL RUNAWAY 9df8: 20 28 50 52 45 48 45 41 54 20 48 4f 54 45 4e 44 (PREHEAT HOTEND 9e08: 29 00 ). 00009e0a : 9e0a: 20 54 48 45 52 4d 41 4c 20 52 55 4e 41 57 41 59 THERMAL RUNAWAY 9e1a: 20 28 50 52 45 48 45 41 54 20 48 45 41 54 42 45 (PREHEAT HEATBE 9e2a: 44 29 00 D). 00009e2d : 9e2d: 50 52 45 48 45 41 54 20 45 52 52 4f 52 00 PREHEAT ERROR. 00009e3b : 9e3b: 42 45 44 20 50 52 45 48 45 41 54 20 45 52 52 4f BED PREHEAT ERRO 9e4b: 52 00 R. 00009e4d : 9e4d: 20 74 72 69 67 67 65 72 65 64 21 00 triggered!. 00009e59 : 9e59: 48 65 61 74 65 72 73 20 73 77 69 74 63 68 65 64 Heaters switched 9e69: 20 6f 66 66 2e 20 00 off. . 00009e70 : 9e70: 3a 20 00 : . 00009e73 : 9e73: 45 72 72 3a 20 00 Err: . 00009e79 : 9e79: 00 ff 01 02 01 00 02 ff ff fe 00 01 fe 01 ff 00 ................ 00009e89 : 9e89: 50 6c 65 61 73 65 20 72 65 73 74 61 72 74 00 Please restart. 00009e98 : 9e98: 54 4d 3a 20 69 6e 76 61 6c 69 64 20 70 61 72 61 TM: invalid para 9ea8: 6d 65 74 65 72 73 2c 20 63 61 6e 6e 6f 74 20 65 meters, cannot e 9eb8: 6e 61 62 6c 65 00 nable. 00009ebe : 9ebe: 25 53 20 20 4d 33 31 30 20 50 25 2e 32 66 20 55 %S M310 P%.2f U 9ece: 25 2e 34 66 20 56 25 2e 32 66 20 43 25 2e 32 66 %.4f V%.2f C%.2f 9ede: 20 44 25 2e 34 66 20 4c 25 75 20 53 25 75 20 42 D%.4f L%u S%u B 9eee: 25 75 20 45 25 2e 32 66 20 57 25 2e 32 66 20 54 %u E%.2f W%.2f T 9efe: 25 2e 32 66 0a 00 %.2f.. 00009f04 : 9f04: 25 53 20 20 4d 33 31 30 20 49 25 75 20 52 25 2e %S M310 I%u R%. 9f14: 32 66 0a 00 2f.. 00009f18 : 9f18: 54 68 65 72 6d 61 6c 20 4d 6f 64 65 6c 20 73 65 Thermal Model se 9f28: 74 74 69 6e 67 73 3a 00 ttings:. 00009f30 : 9f30: 66 66 ca 41 33 33 bf 41 00 00 b4 41 cd cc 9c 41 ff.A33.A...A...A 9f40: 00 00 98 41 66 66 92 41 9a 99 8d 41 cd cc 88 41 ...Aff.A...A...A 9f50: 66 66 86 41 00 00 84 41 66 66 82 41 00 00 80 41 ff.A...Aff.A...A 9f60: 66 66 7e 41 33 33 7b 41 9a 99 79 41 66 66 76 41 ff~A33{A..yAffvA 00009f70 : 9f70: 45 2d 6d 6f 74 6f 72 20 63 75 72 72 65 6e 74 20 E-motor current 9f80: 73 63 61 6c 69 6e 67 20 65 6e 61 62 6c 65 64 00 scaling enabled. 00009f90 : 9f90: 01 08 08 01 0a 0a 01 14 14 01 12 12 ............ 00009f9c : 9f9c: 74 6d 63 32 31 33 30 5f 68 6f 6d 65 5f 65 6e 74 tmc2130_home_ent 9fac: 65 72 28 61 78 65 73 5f 6d 61 73 6b 3d 30 78 25 er(axes_mask=0x% 9fbc: 30 32 78 29 0a 00 02x).. 00009fc2 : 9fc2: 74 6d 63 32 31 33 30 5f 68 6f 6d 65 5f 65 78 69 tmc2130_home_exi 9fd2: 74 20 74 6d 63 32 31 33 30 5f 73 67 5f 68 6f 6d t tmc2130_sg_hom 9fe2: 69 6e 67 5f 61 78 65 73 5f 6d 61 73 6b 3d 30 78 ing_axes_mask=0x 9ff2: 25 30 32 78 0a 00 %02x.. 00009ff8 : 9ff8: 72 65 73 75 6c 74 20 76 61 6c 75 65 3a 20 25 64 result value: %d a008: 0a 00 .. 0000a00a : a00a: 20 69 3d 25 32 64 20 63 6e 74 3d 25 32 64 20 76 i=%2d cnt=%2d v a01a: 61 6c 3d 25 32 64 0a 00 al=%2d.. 0000a022 : a022: 63 6c 75 73 74 65 72 73 3a 00 clusters:. 0000a02c : a02c: 20 69 3d 25 32 64 20 73 74 65 70 3d 25 32 64 0a i=%2d step=%2d. ... 0000a03d : a03d: 73 6f 72 74 65 64 20 73 61 6d 70 6c 65 73 3a 00 sorted samples:. 0000a04d <__c.1906>: a04d: 55 53 41 52 54 32 20 72 78 20 46 75 6c 6c 21 21 USART2 rx Full!! a05d: 21 00 !. 0000a05f : a05f: 3a 20 00 : . 0000a062 : a062: 25 2d 31 32 2e 31 32 53 25 2d 64 2f 36 00 %-12.12S%-d/6. 0000a070 : a070: 25 33 64 2f 25 2d 33 64 00 %3d/%-3d. 0000a079 : a079: 20 3a 20 00 : . 0000a07d : a07d: 25 33 53 00 %3S. 0000a081 : a081: 25 2d 37 73 00 %-7s. 0000a086 : a086: 4e 64 20 25 34 2e 32 66 20 00 Nd %4.2f . 0000a090 : a090: 25 2d 31 35 2e 31 35 53 25 2d 35 64 0a 25 2d 31 %-15.15S%-5d.%-1 a0a0: 35 2e 31 35 53 25 2d 35 64 0a 00 5.15S%-5d.. 0000a0ab : a0ab: 25 53 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 %S. %-16.16S%-3d a0bb: 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 00 . %-16.16S%-3d. 0000a0ca : a0ca: 25 53 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 %S. %-16.16S%-3d a0da: 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 0a 20 . %-16.16S%-3d. a0ea: 25 2d 31 36 2e 31 36 53 25 2d 33 64 00 %-16.16S%-3d. 0000a0f7 : a0f7: 25 53 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 %S. %-16.16S%-3d a107: 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 0a 20 . %-16.16S%-3d. a117: 25 2d 37 2e 37 53 58 20 25 2d 33 64 20 20 59 20 %-7.7SX %-3d Y a127: 25 2d 33 64 00 %-3d. 0000a12c : a12c: 20 25 73 25 33 64 81 20 0a 00 %s%3d. .. 0000a136 : a136: 20 50 57 52 3a 20 20 20 20 20 20 25 34 2e 31 66 PWR: %4.1f a146: 56 0a 20 42 45 44 3a 20 20 20 20 20 20 25 34 2e V. BED: %4. a156: 31 66 56 00 1fV. 0000a15a : a15a: 25 53 0a 20 58 20 25 64 0a 20 59 20 25 64 00 %S. X %d. Y %d. 0000a169 : a169: 25 75 2e 25 75 2e 25 75 2e 25 75 00 %u.%u.%u.%u. 0000a175 <_ZZL16lcd_support_menuvE3__c__15_>: a175: 20 00 . 0000a177 <_ZZL16lcd_support_menuvE3__c__14_>: a177: 20 00 . 0000a179 <_ZZL16lcd_support_menuvE3__c__13_>: a179: 46 6c 61 73 68 41 69 72 20 49 50 20 41 64 64 72 FlashAir IP Addr a189: 3a 00 :. 0000a18b <_ZZL16lcd_support_menuvE3__c__12_>: a18b: 4d 4d 55 20 20 20 20 20 20 20 20 4e 2f 41 00 MMU N/A. 0000a19a <_ZZL16lcd_support_menuvE3__c__11_>: a19a: 25 64 2e 25 64 2e 25 64 00 %d.%d.%d. 0000a1a3 <_ZZL16lcd_support_menuvE3__c__10_>: a1a3: 20 46 57 3a 00 FW:. 0000a1a8 : a1a8: 31 39 37 30 2d 30 31 2d 30 31 00 1970-01-01. 0000a1b3 : a1b3: 45 33 44 52 45 56 4f 00 E3DREVO. 0000a1bb : a1bb: 45 49 4e 53 79 5f 31 30 61 00 EINSy_10a. 0000a1c5 : a1c5: 31 5f 37 35 6d 6d 5f 4d 4b 33 00 1_75mm_MK3. 0000a1d0 : a1d0: 20 48 61 73 68 3a 30 30 30 30 30 30 30 30 30 00 Hash:000000000. 0000a1e0 : a1e0: 20 52 65 70 6f 3a 55 6e 6b 6e 6f 77 6e 00 Repo:Unknown. 0000a1ee : a1ee: 20 33 2e 31 34 2e 31 2d 38 32 33 37 00 3.14.1-8237. 0000a1fb : a1fb: 46 69 72 6d 77 61 72 65 3a 00 Firmware:. 0000a205 <_ZZ24lcd_generic_preheat_menuvE3__c__20_>: a205: 46 4c 45 58 20 2d 20 20 32 34 30 2f 35 30 00 FLEX - 240/50. 0000a214 <_ZZ24lcd_generic_preheat_menuvE3__c__19_>: a214: 46 4c 45 58 20 2d 20 20 32 34 30 00 FLEX - 240. 0000a220 <_ZZ24lcd_generic_preheat_menuvE3__c__18_>: a220: 50 50 20 20 20 2d 20 20 32 35 34 2f 31 30 30 00 PP - 254/100. 0000a230 <_ZZ24lcd_generic_preheat_menuvE3__c__17_>: a230: 50 50 20 20 20 2d 20 20 32 35 34 00 PP - 254. 0000a23c <_ZZ24lcd_generic_preheat_menuvE3__c__16_>: a23c: 48 49 50 53 20 2d 20 20 32 32 30 2f 31 30 30 00 HIPS - 220/100. 0000a24c <_ZZ24lcd_generic_preheat_menuvE3__c__15_>: a24c: 48 49 50 53 20 2d 20 20 32 32 30 00 HIPS - 220. 0000a258 <_ZZ24lcd_generic_preheat_menuvE3__c__14_>: a258: 41 42 53 20 20 2d 20 20 32 35 35 2f 31 30 30 00 ABS - 255/100. 0000a268 <_ZZ24lcd_generic_preheat_menuvE3__c__13_>: a268: 41 42 53 20 20 2d 20 20 32 35 35 00 ABS - 255. 0000a274 <_ZZ24lcd_generic_preheat_menuvE3__c__12_>: a274: 50 41 20 20 20 2d 20 20 32 37 35 2f 39 30 00 PA - 275/90. 0000a283 <_ZZ24lcd_generic_preheat_menuvE3__c__11_>: a283: 50 41 20 20 20 2d 20 20 32 37 35 00 PA - 275. 0000a28f <_ZZ24lcd_generic_preheat_menuvE3__c__10_>: a28f: 50 56 42 20 20 2d 20 20 32 31 35 2f 37 35 00 PVB - 215/75. 0000a29e : a29e: 50 56 42 20 20 2d 20 20 32 31 35 00 PVB - 215. 0000a2aa : a2aa: 50 43 20 20 20 2d 20 20 32 37 35 2f 31 31 30 00 PC - 275/110. 0000a2ba : a2ba: 50 43 20 20 20 2d 20 20 32 37 35 00 PC - 275. 0000a2c6 : a2c6: 41 53 41 20 20 2d 20 20 32 36 30 2f 31 30 35 00 ASA - 260/105. 0000a2d6 : a2d6: 41 53 41 20 20 2d 20 20 32 36 30 00 ASA - 260. 0000a2e2 : a2e2: 50 45 54 20 20 2d 20 20 32 33 30 2f 38 35 00 PET - 230/85. 0000a2f1 : a2f1: 50 45 54 20 20 2d 20 20 32 33 30 00 PET - 230. 0000a2fd : a2fd: 50 4c 41 20 20 2d 20 20 32 31 35 2f 36 30 00 PLA - 215/60. 0000a30c : a30c: 50 4c 41 20 20 2d 20 20 32 31 35 00 PLA - 215. 0000a318 : a318: 25 2d 31 32 2e 31 32 53 25 2b 38 2e 31 66 00 %-12.12S%+8.1f. 0000a327 : a327: 45 78 74 72 75 64 65 72 3a 00 Extruder:. 0000a331 : a331: 25 63 25 31 37 2e 32 66 6d 6d 00 %c%17.2fmm. 0000a33c : a33c: 58 3a 00 X:. 0000a33f : a33f: 59 3a 00 Y:. 0000a342 : a342: 5a 3a 00 Z:. 0000a345 : a345: 25 63 25 2d 31 33 2e 31 33 53 25 2b 35 2e 33 66 %c%-13.13S%+5.3f ... 0000a356 : a356: 25 33 75 00 %3u. 0000a35a : a35a: 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 69 6f PINDA calibratio a36a: 6e 20 66 61 69 6c 65 64 2e 20 43 6f 6e 74 69 6e n failed. Contin a37a: 75 65 20 77 69 74 68 20 70 72 65 73 73 69 6e 67 ue with pressing a38a: 20 74 68 65 20 6b 6e 6f 62 2e 00 the knob.. 0000a395 : a395: 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 69 6f PINDA calibratio a3a5: 6e 20 64 6f 6e 65 2e 20 43 6f 6e 74 69 6e 75 65 n done. Continue a3b5: 20 77 69 74 68 20 70 72 65 73 73 69 6e 67 20 74 with pressing t a3c5: 68 65 20 6b 6e 6f 62 2e 00 he knob.. 0000a3ce : a3ce: 10 00 c9 02 10 01 2c 01 40 01 22 01 70 01 18 01 ......,.@.".p... a3de: b0 01 0e 01 f0 01 04 01 50 02 fa 00 b0 02 f0 00 ........P....... a3ee: 30 03 e6 00 d0 03 dc 00 90 04 d2 00 70 05 c8 00 0...........p... a3fe: a0 06 be 00 00 08 b4 00 b0 09 aa 00 d0 0b a0 00 ................ a40e: 60 0e 96 00 60 11 8c 00 00 15 82 00 20 19 78 00 `...`....... .x. a41e: c0 1d 6e 00 a0 22 64 00 b0 27 5a 00 90 2c 50 00 ..n.."d..'Z..,P. a42e: 00 31 46 00 e0 34 3c 00 10 38 32 00 90 3a 28 00 .1F..4<..82..:(. a43e: 60 3c 1e 00 a0 3d 14 00 80 3e 0a 00 20 3f 00 00 `<...=...>.. ?.. 0000a44e : a44e: 4d 65 61 73 75 72 65 20 63 65 6e 74 65 72 20 20 Measure center ... 0000a45f : a45f: 78 79 7a 63 61 6c 5f 6d 65 61 73 75 72 65 5f 65 xyzcal_measure_e a46f: 6e 74 65 72 0a 00 nter.. 0000a475 : a475: 78 79 7a 63 61 6c 5f 73 70 69 72 61 6c 38 20 63 xyzcal_spiral8 c a485: 78 3d 25 64 20 63 79 3d 25 64 20 7a 30 3d 25 64 x=%d cy=%d z0=%d a495: 20 64 7a 3d 25 64 20 72 61 64 69 75 73 3d 25 64 dz=%d radius=%d a4a5: 20 61 64 3d 25 64 0a 00 ad=%d.. 0000a4ad : a4ad: 78 79 7a 63 61 6c 5f 73 65 61 72 63 68 5a 20 6e xyzcal_searchZ n a4bd: 6f 20 73 69 67 6e 61 6c 0a 20 78 3d 25 6c 64 20 o signal. x=%ld a4cd: 79 3d 25 6c 64 20 7a 3d 25 6c 64 0a 00 y=%ld z=%ld.. 0000a4da : a4da: 20 4f 4e 2d 53 49 47 4e 41 4c 20 61 74 20 78 3d ON-SIGNAL at x= a4ea: 25 64 20 79 3d 25 64 20 7a 3d 25 64 20 61 64 3d %d y=%d z=%d ad= a4fa: 25 64 0a 00 %d.. 0000a4fe : a4fe: 78 79 7a 63 61 6c 5f 73 65 61 72 63 68 5a 20 78 xyzcal_searchZ x a50e: 3d 25 6c 64 20 79 3d 25 6c 64 20 7a 3d 25 6c 64 =%ld y=%ld z=%ld a51e: 0a 00 .. 0000a520 : a520: 25 30 32 78 00 %02x. 0000a525 : a525: 20 5b 25 66 20 25 66 5d 20 6d 6d 20 70 61 74 74 [%f %f] mm patt a535: 65 72 6e 20 63 65 6e 74 65 72 0a 00 ern center.. 0000a541 : a541: 20 5b 25 66 20 25 66 5d 5b 25 66 5d 20 6d 6d 20 [%f %f][%f] mm a551: 64 69 76 65 72 67 65 6e 63 65 0a 00 divergence.. 0000a55d : a55d: 00 00 f0 00 f8 01 fc 03 fe 07 fe 07 fe 07 fe 07 ................ a56d: fc 03 f8 01 f0 00 00 00 ........ 0000a575 : a575: 00 00 00 00 f0 00 f8 01 fc 03 fc 03 fc 03 fc 03 ................ a585: f8 01 f0 00 00 00 00 00 ........ 0000a58d : a58d: 78 79 7a 63 61 6c 5f 6d 65 61 73 75 72 65 5f 6c xyzcal_measure_l a59d: 65 61 76 65 0a 00 eave.. 0000a5a3 : a5a3: 20 3c 20 00 < . 0000a5a7 : a5a7: 57 41 52 4e 49 4e 47 3a 20 46 72 6f 6e 74 20 70 WARNING: Front p a5b7: 6f 69 6e 74 20 6e 6f 74 20 72 65 61 63 68 61 62 oint not reachab a5c7: 6c 65 2e 20 59 20 63 6f 6f 72 64 69 6e 61 74 65 le. Y coordinate a5d7: 3a 00 :. 0000a5d9 : ... 0000a5da : a5da: 00 00 40 41 00 00 c0 40 00 00 5c 43 00 00 c0 40 ..@A...@..\C...@ a5ea: 00 00 5c 43 00 00 46 43 00 00 40 41 00 00 46 43 ..\C..FC..@A..FC 0000a5fa : a5fa: 25 64 2f 34 00 %d/4. 0000a5ff : a5ff: 49 74 65 72 61 74 69 6f 6e 3a 20 00 Iteration: . 0000a60b : a60b: 43 61 6c 69 62 72 61 74 69 6f 6e 20 66 61 69 6c Calibration fail a61b: 65 64 21 20 43 68 65 63 6b 20 74 68 65 20 61 78 ed! Check the ax a62b: 65 73 20 61 6e 64 20 72 75 6e 20 61 67 61 69 6e es and run again a63b: 2e 00 .. 0000a63d : a63d: 78 79 7a 63 61 6c 5f 73 70 69 72 61 6c 32 20 63 xyzcal_spiral2 c a64d: 78 3d 25 64 20 63 79 3d 25 64 20 7a 30 3d 25 64 x=%d cy=%d z0=%d a65d: 20 64 7a 3d 25 64 20 72 61 64 69 75 73 3d 25 64 dz=%d radius=%d a66d: 20 61 64 3d 25 64 0a 00 ad=%d.. 0000a675 : a675: 0a 00 .. 0000a677 : a677: 43 6f 75 6e 74 64 6f 77 6e 3a 20 25 64 20 00 Countdown: %d . 0000a686 : a686: 25 64 0a 00 %d.. 0000a68a : a68a: 53 63 61 6e 20 63 6f 75 6e 74 64 6f 77 6e 3a 20 Scan countdown: ... 0000a69b : a69b: 50 61 74 74 65 72 6e 20 63 65 6e 74 65 72 20 5b Pattern center [ a6ab: 25 66 20 25 66 5d 2c 20 6d 61 74 63 68 20 25 66 %f %f], match %f a6bb: 25 25 0a 00 %%.. 0000a6bf : a6bf: 20 5b 25 66 2c 20 25 66 5d 5b 25 66 5d 20 66 69 [%f, %f][%f] fi a6cf: 6e 61 6c 20 63 69 72 63 6c 65 0a 00 nal circle.. 0000a6db : a6db: 74 6d 63 32 31 33 30 5f 67 6f 74 6f 5f 73 74 65 tmc2130_goto_ste a6eb: 70 20 25 64 20 25 64 20 25 64 20 25 64 20 0a 00 p %d %d %d %d .. 0000a6fb <_ZL16ramming_sequence.lto_priv.399>: a6fb: e0 2d 90 3e 89 88 b2 41 11 36 9c 3e 77 77 c1 41 .-.>...A.6.>ww.A a70b: 29 cb b0 3e ef ee da 41 ba 49 cc 3e ef ee fc 41 )..>...A.I.>...A a71b: 61 c3 f3 3e ef ee 16 42 9c a2 13 3f cd cc 36 42 a..>...B...?..6B a72b: 8a b0 11 3f ab aa 56 42 88 63 dd 3d ab aa 56 42 ...?..VB.c.=..VB a73b: b8 af 43 3f 55 55 72 42 18 26 53 3f 33 b3 82 42 ..C?UUrB.&S?3..B a74b: 30 2a 59 3f ef 6e 86 42 00 00 70 c1 00 00 c8 42 0*Y?.n.B..p....B a75b: 00 00 c4 c1 00 00 a0 41 00 00 e0 c0 00 00 20 41 .......A...... A a76b: 00 00 60 c0 00 00 c0 40 00 00 a0 41 22 22 f2 40 ..`....@...A"".@ a77b: 00 00 a0 c1 9a 99 a1 40 00 00 0c c2 55 55 05 42 .......@....UU.B 0000a78b <_ZZN4MMU213ProtocolLogic18ResetRetryAttemptsEvE3__c.lto_priv.397>: a78b: 52 65 73 65 74 52 65 74 72 79 41 74 74 65 6d 70 ResetRetryAttemp a79b: 74 73 00 ts. 0000a79e : a79e: 43 6f 6f 6c 69 6e 67 20 74 69 6d 65 72 20 73 74 Cooling timer st a7ae: 6f 70 70 65 64 00 opped. 0000a7b4 : a7b4: 48 65 61 74 65 72 20 63 6f 6f 6c 64 6f 77 6e 00 Heater cooldown. 0000a7c4 : a7c4: 43 6f 6f 6c 69 6e 67 20 54 69 6d 65 6f 75 74 20 Cooling Timeout a7d4: 73 74 61 72 74 65 64 00 started. 0000a7dc : a7dc: 53 61 76 69 6e 67 20 61 6e 64 20 70 61 72 6b 69 Saving and parki a7ec: 6e 67 00 ng. 0000a7ef : a7ef: 48 65 61 74 65 72 20 63 6f 6f 6c 64 6f 77 6e 20 Heater cooldown a7ff: 70 65 6e 64 69 6e 67 00 pending. 0000a807 : a807: 52 65 73 75 6d 69 6e 67 20 58 59 5a 00 Resuming XYZ. 0000a814 : a814: 4d 4d 55 32 74 6f 6f 6c 3d 00 MMU2tool=. 0000a81e <_ZL9mmu2Magic.lto_priv.374>: a81e: 4d 4d 55 32 3a 00 MMU2:. 0000a824 : a824: 47 31 20 58 25 64 20 59 25 2d 2e 32 66 20 45 25 G1 X%d Y%-.2f E% a834: 2d 2e 33 66 00 -.3f. 0000a839 : a839: 57 72 69 74 69 6e 67 20 74 6f 20 66 69 6c 65 3a Writing to file: a849: 20 00 . 0000a84b : a84b: 46 69 6c 65 20 61 6c 72 65 61 64 79 20 6f 70 65 File already ope a85b: 6e 65 64 00 ned. 0000a85f : a85f: 0f 54 fe 53 ea 53 d5 53 bf 53 ac 53 96 53 82 53 .T.S.S.S.S.S.S.S a86f: 71 53 5b 53 ea 53 fe 53 47 53 38 53 24 53 13 53 qS[S.S.SGS8S$S.S a87f: fe 52 37 5c e8 52 d6 52 c3 52 b2 52 9d 52 8a 52 .R7\.R.R.R.R.R.R a88f: 76 52 61 52 58 52 46 52 31 52 vRaRXRFR1R 0000a899 : a899: 4d 36 30 30 20 41 55 54 4f 00 M600 AUTO. 0000a8a3 : a8a3: 46 49 4e 44 41 20 66 69 6c 61 6d 65 6e 74 20 72 FINDA filament r a8b3: 75 6e 6f 75 74 21 00 unout!. 0000a8ba : a8ba: 43 6f 6d 6d 75 6e 69 63 61 74 69 6f 6e 20 74 69 Communication ti a8ca: 6d 65 6f 75 74 00 meout. 0000a8d0 : a8d0: 50 72 6f 74 6f 63 6f 6c 20 45 72 72 6f 72 00 Protocol Error. 0000a8df : a8df: 03 00 03 ... 0000a8e2 : a8e2: 56 65 72 73 69 6f 6e 20 6d 69 73 6d 61 74 63 68 Version mismatch ... 0000a8f3 : a8f3: 43 6f 6d 6d 61 6e 64 20 45 72 72 6f 72 00 Command Error. 0000a901 : a901: 43 6f 6d 6d 61 6e 64 20 72 65 6a 65 63 74 65 64 Command rejected ... 0000a912 : a912: 4d 4d 55 20 42 75 74 74 6f 6e 20 70 75 73 68 65 MMU Button pushe a922: 64 00 d. 0000a924 : a924: 52 65 74 72 79 42 75 74 74 6f 6e 50 72 65 73 73 RetryButtonPress a934: 65 64 00 ed. 0000a937 <_ZN4MMU2L11errorTitlesE.lto_priv.492>: a937: 6c 56 57 56 40 56 2b 56 16 56 02 56 f2 55 db 55 lVWV@V+V.V.V.U.U a947: c4 55 ad 55 99 55 85 55 6f 55 6f 55 6f 55 5a 55 .U.U.U.UoUoUoUZU a957: 5a 55 5a 55 47 55 47 55 47 55 34 55 34 55 34 55 ZUZUGUGUGU4U4U4U a967: 1d 55 1d 55 1d 55 08 55 08 55 08 55 f2 54 f2 54 .U.U.U.U.U.U.T.T a977: f2 54 e2 54 cd 54 b7 54 a1 54 92 54 85 54 6e 54 .T.T.T.T.T.T.TnT a987: 5b 54 49 54 36 54 24 54 14 54 [TIT6T$T.T 0000a991 : a991: 42 75 74 74 6f 6e 00 Button. 0000a998 : a998: 43 68 65 63 6b 55 73 65 72 49 6e 70 75 74 2d 62 CheckUserInput-b a9a8: 74 6e 4c 4d 52 20 00 tnLMR . 0000a9af <_ZZN4MMU231ReportErrorHookSensorLineRenderEvE3__c.lto_priv.491>: a9af: 46 49 3a 20 20 46 53 3a 20 20 20 20 3e 20 20 82 FI: FS: > . a9bf: 20 20 20 81 00 .. 0000a9c4 : a9c4: 48 6f 74 65 6e 64 20 74 65 6d 70 65 72 61 74 75 Hotend temperatu a9d4: 72 65 20 72 65 61 63 68 65 64 00 re reached. 0000a9df : a9df: 52 65 73 75 6d 69 6e 67 20 54 65 6d 70 00 Resuming Temp. 0000a9ed : a9ed: 43 6f 6f 6c 64 6f 77 6e 20 66 6c 61 67 20 63 6c Cooldown flag cl a9fd: 65 61 72 65 64 00 eared. 0000aa03 : aa03: 20 57 3a 00 W:. 0000aa07 : aa07: 20 45 3a 00 E:. 0000aa0b : aa0b: 54 3a 00 T:. 0000aa0e : aa0e: 4e 6f 20 30 78 46 46 20 72 65 63 65 69 76 65 64 No 0xFF received ... 0000aa1f : aa1f: 53 65 6e 64 69 6e 67 20 30 78 46 46 00 Sending 0xFF. 0000aa2c : aa2c: 46 69 6c 65 20 73 65 6c 65 63 74 65 64 00 File selected. 0000aa3a : aa3a: 20 53 69 7a 65 3a 20 00 Size: . 0000aa42 : aa42: 46 69 6c 65 20 6f 70 65 6e 65 64 3a 20 00 File opened: . 0000aa50 : aa50: 4e 6f 77 20 66 72 65 73 68 20 66 69 6c 65 3a 20 Now fresh file: ... 0000aa61 : aa61: 4e 6f 77 20 64 6f 69 6e 67 20 66 69 6c 65 3a 20 Now doing file: ... 0000aa72 : aa72: 22 20 70 6f 73 00 " pos. 0000aa78 : aa78: 22 20 70 61 72 65 6e 74 3a 22 00 " parent:". 0000aa83 : aa83: 53 55 42 52 4f 55 54 49 4e 45 20 43 41 4c 4c 20 SUBROUTINE CALL aa93: 74 61 72 67 65 74 3a 22 00 target:". 0000aa9c : aa9c: 74 72 79 69 6e 67 20 74 6f 20 63 61 6c 6c 20 73 trying to call s aaac: 75 62 2d 67 63 6f 64 65 20 66 69 6c 65 73 20 77 ub-gcode files w aabc: 69 74 68 20 74 6f 6f 20 6d 61 6e 79 20 6c 65 76 ith too many lev aacc: 65 6c 73 2e 00 els.. 0000aad1 : aad1: 06 28 33 d0 36 c2 3e 01 3f 15 41 32 42 3b 43 f2 .(3.6.>.?.A2B;C. aae1: 44 3b 45 f2 46 22 47 3b 48 f2 49 3b 4a f0 58 98 D;E.F"G;H.I;J.X. aaf1: 59 0c 5a 08 5b 0c 5c 08 61 10 67 9b 6e 22 71 07 Y.Z.[.\.a.g.n"q. ab01: 72 08 ff r.. 0000ab04 : ab04: 09 5a 0d 00 0e f0 19 14 5e 08 20 64 2b 6d 32 2f .Z......^. d+m2/ ab14: ff . 0000ab15 : ab15: 20 22 25 73 22 00 "%s". 0000ab1b : ab1b: 20 25 23 6c 78 00 %#lx. 0000ab21 : ab21: 44 49 52 5f 45 58 49 54 00 DIR_EXIT. 0000ab2a : ab2a: 44 49 52 5f 45 4e 54 45 52 3a 20 25 73 20 22 25 DIR_ENTER: %s "% ab3a: 73 22 0a 00 s".. 0000ab3e : ab3e: 61 75 74 6f 25 69 2e 67 00 auto%i.g. 0000ab47 : ab47: 04 1a .. 0000ab49 : ab49: 44 65 63 72 65 6d 65 6e 74 52 65 74 72 79 41 74 DecrementRetryAt ab59: 74 65 6d 70 74 73 00 tempts. 0000ab60 : ab60: 08 1b 1c ... 0000ab63 : ab63: 0b 14 .. 0000ab65 <_ZZN4MMU213ProtocolLogic33ResetCommunicationTimeoutAttemptsEvE3__c.lto_priv.398>: ab65: 52 53 54 43 6f 6d 6d 54 69 6d 65 6f 75 74 00 RSTCommTimeout. 0000ab74 : ab74: 2c 20 6c 61 73 74 20 62 79 74 65 73 3a 20 00 , last bytes: . 0000ab83 <_ZL10bufferFull.lto_priv.552>: ab83: 22 20 66 61 69 6c 65 64 3a 20 42 75 66 66 65 72 " failed: Buffer ab93: 20 66 75 6c 6c 21 00 full!. 0000ab9a : ab9a: 45 72 72 6f 72 3a 00 Error:. 0000aba1 : aba1: 22 00 ". 0000aba3 : aba3: 45 6e 71 75 65 69 6e 67 20 74 6f 20 74 68 65 20 Enqueing to the abb3: 66 72 6f 6e 74 3a 20 22 00 front: ". 0000abbc <_ZL9mmu2Magic.lto_priv.375>: abbc: 4d 4d 55 32 3a 00 MMU2:. 0000abc2 : abc2: 65 63 68 6f 3a 00 echo:. 0000abc8 : abc8: 3e 53 30 2a 63 36 2e 00 >S0*c6.. 0000abd0 : abd0: 4d 4d 55 20 69 73 20 00 MMU is . 0000abd8 : abd8: 25 2e 31 30 53 20 00 %.10S . 0000abdf : abdf: 25 34 64 00 %4d. 0000abe3 : abe3: 45 78 72 65 6d 65 20 73 70 61 6e 20 6f 66 20 74 Exreme span of t abf3: 68 65 20 5a 20 76 61 6c 75 65 73 21 00 he Z values!. 0000ac00 : ac00: 25 64 2f 39 00 %d/9. 0000ac05 : ac05: 4d 4d 55 32 3a 00 MMU2:. 0000ac0b : ac0b: 25 33 64 00 %3d. 0000ac0f : ac0f: 18 01 04 19 02 0a ...... 0000ac15 : ac15: bc 63 46 63 cc 62 5f 62 16 62 84 61 0c 61 a4 60 .cFc.b_b.b.a.a.` ac25: 55 60 35 60 e9 5f 35 60 d2 5f d2 5f d2 5f d2 5f U`5`._5`._._._._ ac35: d2 5f d2 5f d2 5f d2 5f d2 5f d2 5f d2 5f d2 5f ._._._._._._._._ ac45: d2 5f d2 5f d2 5f d2 5f d2 5f d2 5f d2 5f d2 5f ._._._._._._._._ ac55: d2 5f d2 5f 9b 5f 5a 5f 10 5f 9d 5e 68 5e 1e 5e ._._._Z_._.^h^.^ ac65: d4 5d 76 5d 3d 5d fb 5c de 5c .]v]=].\.\ 0000ac6f : ac6f: 01 01 01 01 01 01 01 02 71 01 71 01 32 32 32 03 ........q.q.222. ac7f: 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 ................ ac8f: 03 03 93 93 24 38 03 93 03 01 02 56 03 ....$8.....V. 0000ac9c : ac9c: 65 00 66 00 67 00 68 00 69 00 6a 00 6b 00 6c 00 e.f.g.h.i.j.k.l. acac: 73 00 74 00 7d 00 7e 00 c9 00 d3 00 dd 00 ca 00 s.t.}.~......... acbc: d4 00 de 00 2d 01 37 01 41 01 2e 01 38 01 42 01 ....-.7.A...8.B. accc: 2f 01 39 01 43 01 30 01 3a 01 44 01 31 01 3b 01 /.9.C.0.:.D.1.;. acdc: 45 01 32 01 91 01 92 01 f5 01 f6 01 f7 01 f8 01 E.2............. acec: f9 01 fa 01 fb 01 fc 01 84 03 .......... 0000acf6 : acf6: 49 64 b2 64 3e 64 35 64 2e 64 3a 50 43 47 27 64 Id.d>d5d.d:PCG'd ad06: 1d 64 .d 0000ad08 : ad08: 25 2e 32 30 53 0a 70 72 75 73 61 2e 69 6f 2f 30 %.20S.prusa.io/0 ad18: 34 25 68 75 00 4%hu. 0000ad1d : ad1d: 20 55 70 67 72 61 64 69 6e 67 20 78 66 6c 61 73 Upgrading xflas ad2d: 68 0a 20 44 6f 20 6e 6f 74 20 64 69 73 63 6f 6e h. Do not discon ad3d: 6e 65 63 74 21 00 nect!. 0000ad43 : ad43: 77 32 35 78 32 30 63 6c 5f 63 66 6d 0a 00 w25x20cl_cfm.. 0000ad51 : ad51: 77 32 35 78 32 30 63 6c 5f 65 6e 74 65 72 0a 00 w25x20cl_enter.. 0000ad61 : ad61: 73 74 61 72 74 0a 00 start.. 0000ad68 <__ctors_start>: ad68: 86 39 cpi r24, 0x96 ; 150 0000ad6a <__ctors_end>: ad6a: 75 64 ori r23, 0x45 ; 69 0000ad6c <__dtors_end>: ad6c: 11 24 eor r1, r1 ad6e: 1f be out 0x3f, r1 ; 63 ad70: cf ef ldi r28, 0xFF ; 255 ad72: d1 e2 ldi r29, 0x21 ; 33 ad74: de bf out 0x3e, r29 ; 62 ad76: cd bf out 0x3d, r28 ; 61 ad78: 00 e0 ldi r16, 0x00 ; 0 ad7a: 0c bf out 0x3c, r16 ; 60 0000ad7c <__do_copy_data>: ad7c: 13 e0 ldi r17, 0x03 ; 3 ad7e: a0 e0 ldi r26, 0x00 ; 0 ad80: b2 e0 ldi r27, 0x02 ; 2 ad82: e0 ed ldi r30, 0xD0 ; 208 ad84: f5 ec ldi r31, 0xC5 ; 197 ad86: 03 e0 ldi r16, 0x03 ; 3 ad88: 0b bf out 0x3b, r16 ; 59 ad8a: 02 c0 rjmp .+4 ; 0xad90 <__do_copy_data+0x14> ad8c: 07 90 elpm r0, Z+ ad8e: 0d 92 st X+, r0 ad90: a4 32 cpi r26, 0x24 ; 36 ad92: b1 07 cpc r27, r17 ad94: d9 f7 brne .-10 ; 0xad8c <__do_copy_data+0x10> 0000ad96 <__do_clear_bss>: ad96: 28 e1 ldi r18, 0x18 ; 24 ad98: a4 e2 ldi r26, 0x24 ; 36 ad9a: b3 e0 ldi r27, 0x03 ; 3 ad9c: 01 c0 rjmp .+2 ; 0xada0 <.do_clear_bss_start> 0000ad9e <.do_clear_bss_loop>: ad9e: 1d 92 st X+, r1 0000ada0 <.do_clear_bss_start>: ada0: a0 32 cpi r26, 0x20 ; 32 ada2: b2 07 cpc r27, r18 ada4: e1 f7 brne .-8 ; 0xad9e <.do_clear_bss_loop> 0000ada6 <__do_global_ctors>: ada6: 16 e5 ldi r17, 0x56 ; 86 ada8: c5 eb ldi r28, 0xB5 ; 181 adaa: d6 e5 ldi r29, 0x56 ; 86 adac: 00 e0 ldi r16, 0x00 ; 0 adae: 06 c0 rjmp .+12 ; 0xadbc <__do_global_ctors+0x16> adb0: 21 97 sbiw r28, 0x01 ; 1 adb2: 01 09 sbc r16, r1 adb4: 80 2f mov r24, r16 adb6: fe 01 movw r30, r28 adb8: 0f 94 2c dd call 0x3ba58 ; 0x3ba58 <__tablejump2__> adbc: c4 3b cpi r28, 0xB4 ; 180 adbe: d1 07 cpc r29, r17 adc0: 80 e0 ldi r24, 0x00 ; 0 adc2: 08 07 cpc r16, r24 adc4: a9 f7 brne .-22 ; 0xadb0 <__do_global_ctors+0xa> adc6: 0e 94 90 fa call 0x1f520 ; 0x1f520
adca: 0d 94 d6 e2 jmp 0x3c5ac ; 0x3c5ac <__do_global_dtors> 0000adce <__bad_interrupt>: adce: 0c 94 6b 67 jmp 0xced6 ; 0xced6 <__vector_default> 0000add2 : add2: 2f 92 push r2 add4: 3f 92 push r3 add6: 4f 92 push r4 add8: 5f 92 push r5 adda: 6f 92 push r6 addc: 7f 92 push r7 adde: 8f 92 push r8 ade0: 9f 92 push r9 ade2: af 92 push r10 ade4: bf 92 push r11 ade6: cf 92 push r12 ade8: df 92 push r13 adea: ef 92 push r14 adec: ff 92 push r15 adee: 0f 93 push r16 adf0: 1f 93 push r17 adf2: cf 93 push r28 adf4: df 93 push r29 adf6: cd b7 in r28, 0x3d ; 61 adf8: de b7 in r29, 0x3e ; 62 adfa: 2f 97 sbiw r28, 0x0f ; 15 adfc: 0f b6 in r0, 0x3f ; 63 adfe: f8 94 cli ae00: de bf out 0x3e, r29 ; 62 ae02: 0f be out 0x3f, r0 ; 63 ae04: cd bf out 0x3d, r28 ; 61 ae06: 6c 01 movw r12, r24 ae08: 1b 01 movw r2, r22 ae0a: 5a 01 movw r10, r20 ae0c: fc 01 movw r30, r24 ae0e: 17 82 std Z+7, r1 ; 0x07 ae10: 16 82 std Z+6, r1 ; 0x06 ae12: 83 81 ldd r24, Z+3 ; 0x03 ae14: 9e 01 movw r18, r28 ae16: 2f 5f subi r18, 0xFF ; 255 ae18: 3f 4f sbci r19, 0xFF ; 255 ae1a: 49 01 movw r8, r18 ae1c: 81 fd sbrc r24, 1 ae1e: d2 c0 rjmp .+420 ; 0xafc4 ae20: 8f ef ldi r24, 0xFF ; 255 ae22: 9f ef ldi r25, 0xFF ; 255 ae24: ee c2 rjmp .+1500 ; 0xb402 ae26: f1 2c mov r15, r1 ae28: 51 2c mov r5, r1 ae2a: 00 e0 ldi r16, 0x00 ; 0 ae2c: 00 32 cpi r16, 0x20 ; 32 ae2e: 38 f4 brcc .+14 ; 0xae3e ae30: 8b 32 cpi r24, 0x2B ; 43 ae32: 09 f1 breq .+66 ; 0xae76 ae34: 90 f4 brcc .+36 ; 0xae5a ae36: 80 32 cpi r24, 0x20 ; 32 ae38: f9 f0 breq .+62 ; 0xae78 ae3a: 83 32 cpi r24, 0x23 ; 35 ae3c: 09 f1 breq .+66 ; 0xae80 ae3e: 07 fd sbrc r16, 7 ae40: 34 c0 rjmp .+104 ; 0xaeaa ae42: 20 ed ldi r18, 0xD0 ; 208 ae44: 28 0f add r18, r24 ae46: 2a 30 cpi r18, 0x0A ; 10 ae48: 20 f5 brcc .+72 ; 0xae92 ae4a: 06 ff sbrs r16, 6 ae4c: 1b c0 rjmp .+54 ; 0xae84 ae4e: fa e0 ldi r31, 0x0A ; 10 ae50: ff 9e mul r15, r31 ae52: 20 0d add r18, r0 ae54: 11 24 eor r1, r1 ae56: f2 2e mov r15, r18 ae58: 05 c0 rjmp .+10 ; 0xae64 ae5a: 8d 32 cpi r24, 0x2D ; 45 ae5c: 79 f0 breq .+30 ; 0xae7c ae5e: 80 33 cpi r24, 0x30 ; 48 ae60: 71 f7 brne .-36 ; 0xae3e ae62: 01 60 ori r16, 0x01 ; 1 ae64: f1 01 movw r30, r2 ae66: 93 fd sbrc r25, 3 ae68: 85 91 lpm r24, Z+ ae6a: 93 ff sbrs r25, 3 ae6c: 81 91 ld r24, Z+ ae6e: 1f 01 movw r2, r30 ae70: 81 11 cpse r24, r1 ae72: dc cf rjmp .-72 ; 0xae2c ae74: 1a c0 rjmp .+52 ; 0xaeaa ae76: 02 60 ori r16, 0x02 ; 2 ae78: 04 60 ori r16, 0x04 ; 4 ae7a: f4 cf rjmp .-24 ; 0xae64 ae7c: 08 60 ori r16, 0x08 ; 8 ae7e: f2 cf rjmp .-28 ; 0xae64 ae80: 00 61 ori r16, 0x10 ; 16 ae82: f0 cf rjmp .-32 ; 0xae64 ae84: 3a e0 ldi r19, 0x0A ; 10 ae86: 53 9e mul r5, r19 ae88: 20 0d add r18, r0 ae8a: 11 24 eor r1, r1 ae8c: 52 2e mov r5, r18 ae8e: 00 62 ori r16, 0x20 ; 32 ae90: e9 cf rjmp .-46 ; 0xae64 ae92: 8e 32 cpi r24, 0x2E ; 46 ae94: 21 f4 brne .+8 ; 0xae9e ae96: 06 fd sbrc r16, 6 ae98: b1 c2 rjmp .+1378 ; 0xb3fc ae9a: 00 64 ori r16, 0x40 ; 64 ae9c: e3 cf rjmp .-58 ; 0xae64 ae9e: 8c 36 cpi r24, 0x6C ; 108 aea0: 11 f4 brne .+4 ; 0xaea6 aea2: 00 68 ori r16, 0x80 ; 128 aea4: df cf rjmp .-66 ; 0xae64 aea6: 88 36 cpi r24, 0x68 ; 104 aea8: e9 f2 breq .-70 ; 0xae64 aeaa: 9b eb ldi r25, 0xBB ; 187 aeac: 98 0f add r25, r24 aeae: 93 30 cpi r25, 0x03 ; 3 aeb0: 08 f0 brcs .+2 ; 0xaeb4 aeb2: 5f c0 rjmp .+190 ; 0xaf72 aeb4: 00 61 ori r16, 0x10 ; 16 aeb6: 80 5e subi r24, 0xE0 ; 224 aeb8: 06 fd sbrc r16, 6 aeba: 02 c0 rjmp .+4 ; 0xaec0 aebc: 46 e0 ldi r20, 0x06 ; 6 aebe: f4 2e mov r15, r20 aec0: 10 2f mov r17, r16 aec2: 1f 73 andi r17, 0x3F ; 63 aec4: 85 36 cpi r24, 0x65 ; 101 aec6: 09 f0 breq .+2 ; 0xaeca aec8: 5b c0 rjmp .+182 ; 0xaf80 aeca: 10 64 ori r17, 0x40 ; 64 aecc: 17 ff sbrs r17, 7 aece: 61 c0 rjmp .+194 ; 0xaf92 aed0: 8f 2d mov r24, r15 aed2: 9b e3 ldi r25, 0x3B ; 59 aed4: 9f 15 cp r25, r15 aed6: 08 f4 brcc .+2 ; 0xaeda aed8: 8b e3 ldi r24, 0x3B ; 59 aeda: 44 24 eor r4, r4 aedc: 43 94 inc r4 aede: 48 0e add r4, r24 aee0: 27 e0 ldi r18, 0x07 ; 7 aee2: 35 01 movw r6, r10 aee4: f4 e0 ldi r31, 0x04 ; 4 aee6: 6f 0e add r6, r31 aee8: 71 1c adc r7, r1 aeea: f5 01 movw r30, r10 aeec: 60 81 ld r22, Z aeee: 71 81 ldd r23, Z+1 ; 0x01 aef0: 82 81 ldd r24, Z+2 ; 0x02 aef2: 93 81 ldd r25, Z+3 ; 0x03 aef4: 04 2d mov r16, r4 aef6: a4 01 movw r20, r8 aef8: 0f 94 d5 d8 call 0x3b1aa ; 0x3b1aa <__ftoa_engine> aefc: 5c 01 movw r10, r24 aefe: f9 81 ldd r31, Y+1 ; 0x01 af00: fc 87 std Y+12, r31 ; 0x0c af02: f0 ff sbrs r31, 0 af04: 03 c0 rjmp .+6 ; 0xaf0c af06: 0d e2 ldi r16, 0x2D ; 45 af08: f3 ff sbrs r31, 3 af0a: 07 c0 rjmp .+14 ; 0xaf1a af0c: 0b e2 ldi r16, 0x2B ; 43 af0e: 11 fd sbrc r17, 1 af10: 04 c0 rjmp .+8 ; 0xaf1a af12: 01 2f mov r16, r17 af14: 04 70 andi r16, 0x04 ; 4 af16: 12 fd sbrc r17, 2 af18: 00 e2 ldi r16, 0x20 ; 32 af1a: 2c 85 ldd r18, Y+12 ; 0x0c af1c: 2c 70 andi r18, 0x0C ; 12 af1e: e2 2e mov r14, r18 af20: 09 f4 brne .+2 ; 0xaf24 af22: 6b c0 rjmp .+214 ; 0xaffa af24: 01 11 cpse r16, r1 af26: d8 c2 rjmp .+1456 ; 0xb4d8 af28: f3 e0 ldi r31, 0x03 ; 3 af2a: e1 2c mov r14, r1 af2c: f5 15 cp r31, r5 af2e: a0 f4 brcc .+40 ; 0xaf58 af30: 83 e0 ldi r24, 0x03 ; 3 af32: e5 2c mov r14, r5 af34: e8 1a sub r14, r24 af36: 13 fd sbrc r17, 3 af38: 08 c0 rjmp .+16 ; 0xaf4a af3a: b6 01 movw r22, r12 af3c: 80 e2 ldi r24, 0x20 ; 32 af3e: 90 e0 ldi r25, 0x00 ; 0 af40: 0f 94 84 da call 0x3b508 ; 0x3b508 af44: ea 94 dec r14 af46: e1 10 cpse r14, r1 af48: f8 cf rjmp .-16 ; 0xaf3a af4a: 00 23 and r16, r16 af4c: 29 f0 breq .+10 ; 0xaf58 af4e: b6 01 movw r22, r12 af50: 80 2f mov r24, r16 af52: 90 e0 ldi r25, 0x00 ; 0 af54: 0f 94 84 da call 0x3b508 ; 0x3b508 af58: 3c 85 ldd r19, Y+12 ; 0x0c af5a: 2c e4 ldi r18, 0x4C ; 76 af5c: a2 2e mov r10, r18 af5e: 26 e7 ldi r18, 0x76 ; 118 af60: b2 2e mov r11, r18 af62: 33 fd sbrc r19, 3 af64: 04 c0 rjmp .+8 ; 0xaf6e af66: 90 e5 ldi r25, 0x50 ; 80 af68: a9 2e mov r10, r25 af6a: 96 e7 ldi r25, 0x76 ; 118 af6c: b9 2e mov r11, r25 af6e: 10 71 andi r17, 0x10 ; 16 af70: 22 c0 rjmp .+68 ; 0xafb6 af72: 9b e9 ldi r25, 0x9B ; 155 af74: 98 0f add r25, r24 af76: 93 30 cpi r25, 0x03 ; 3 af78: 08 f0 brcs .+2 ; 0xaf7c af7a: 47 c1 rjmp .+654 ; 0xb20a af7c: 0f 7e andi r16, 0xEF ; 239 af7e: 9c cf rjmp .-200 ; 0xaeb8 af80: 86 36 cpi r24, 0x66 ; 102 af82: 11 f4 brne .+4 ; 0xaf88 af84: 10 68 ori r17, 0x80 ; 128 af86: a2 cf rjmp .-188 ; 0xaecc af88: ff 20 and r15, r15 af8a: 09 f4 brne .+2 ; 0xaf8e af8c: 9f cf rjmp .-194 ; 0xaecc af8e: fa 94 dec r15 af90: 9d cf rjmp .-198 ; 0xaecc af92: e7 e0 ldi r30, 0x07 ; 7 af94: 2f 2d mov r18, r15 af96: ef 15 cp r30, r15 af98: 18 f4 brcc .+6 ; 0xafa0 af9a: 27 e0 ldi r18, 0x07 ; 7 af9c: 37 e0 ldi r19, 0x07 ; 7 af9e: f3 2e mov r15, r19 afa0: 41 2c mov r4, r1 afa2: 9f cf rjmp .-194 ; 0xaee2 afa4: 11 11 cpse r17, r1 afa6: 80 52 subi r24, 0x20 ; 32 afa8: b6 01 movw r22, r12 afaa: 90 e0 ldi r25, 0x00 ; 0 afac: 0f 94 84 da call 0x3b508 ; 0x3b508 afb0: 8f ef ldi r24, 0xFF ; 255 afb2: a8 1a sub r10, r24 afb4: b8 0a sbc r11, r24 afb6: f5 01 movw r30, r10 afb8: 84 91 lpm r24, Z afba: 81 11 cpse r24, r1 afbc: f3 cf rjmp .-26 ; 0xafa4 afbe: e1 10 cpse r14, r1 afc0: 84 c2 rjmp .+1288 ; 0xb4ca afc2: 53 01 movw r10, r6 afc4: f6 01 movw r30, r12 afc6: 93 81 ldd r25, Z+3 ; 0x03 afc8: f1 01 movw r30, r2 afca: 93 fd sbrc r25, 3 afcc: 85 91 lpm r24, Z+ afce: 93 ff sbrs r25, 3 afd0: 81 91 ld r24, Z+ afd2: 1f 01 movw r2, r30 afd4: 88 23 and r24, r24 afd6: 09 f4 brne .+2 ; 0xafda afd8: 11 c2 rjmp .+1058 ; 0xb3fc afda: 85 32 cpi r24, 0x25 ; 37 afdc: 41 f4 brne .+16 ; 0xafee afde: 93 fd sbrc r25, 3 afe0: 85 91 lpm r24, Z+ afe2: 93 ff sbrs r25, 3 afe4: 81 91 ld r24, Z+ afe6: 1f 01 movw r2, r30 afe8: 85 32 cpi r24, 0x25 ; 37 afea: 09 f0 breq .+2 ; 0xafee afec: 1c cf rjmp .-456 ; 0xae26 afee: b6 01 movw r22, r12 aff0: 90 e0 ldi r25, 0x00 ; 0 aff2: 0f 94 84 da call 0x3b508 ; 0x3b508 aff6: 35 01 movw r6, r10 aff8: e4 cf rjmp .-56 ; 0xafc2 affa: 17 ff sbrs r17, 7 affc: 6f c0 rjmp .+222 ; 0xb0dc affe: 4a 0c add r4, r10 b000: fc 85 ldd r31, Y+12 ; 0x0c b002: f4 ff sbrs r31, 4 b004: 04 c0 rjmp .+8 ; 0xb00e b006: 8a 81 ldd r24, Y+2 ; 0x02 b008: 81 33 cpi r24, 0x31 ; 49 b00a: 09 f4 brne .+2 ; 0xb00e b00c: 4a 94 dec r4 b00e: 14 14 cp r1, r4 b010: 0c f0 brlt .+2 ; 0xb014 b012: 86 c0 rjmp .+268 ; 0xb120 b014: 28 e0 ldi r18, 0x08 ; 8 b016: 24 15 cp r18, r4 b018: 10 f4 brcc .+4 ; 0xb01e b01a: 88 e0 ldi r24, 0x08 ; 8 b01c: 48 2e mov r4, r24 b01e: 85 e0 ldi r24, 0x05 ; 5 b020: 90 e0 ldi r25, 0x00 ; 0 b022: 17 ff sbrs r17, 7 b024: 06 c0 rjmp .+12 ; 0xb032 b026: c5 01 movw r24, r10 b028: b7 fe sbrs r11, 7 b02a: 02 c0 rjmp .+4 ; 0xb030 b02c: 90 e0 ldi r25, 0x00 ; 0 b02e: 80 e0 ldi r24, 0x00 ; 0 b030: 01 96 adiw r24, 0x01 ; 1 b032: 01 11 cpse r16, r1 b034: 01 96 adiw r24, 0x01 ; 1 b036: ff 20 and r15, r15 b038: 31 f0 breq .+12 ; 0xb046 b03a: 2f 2d mov r18, r15 b03c: 30 e0 ldi r19, 0x00 ; 0 b03e: 2f 5f subi r18, 0xFF ; 255 b040: 3f 4f sbci r19, 0xFF ; 255 b042: 82 0f add r24, r18 b044: 93 1f adc r25, r19 b046: 58 16 cp r5, r24 b048: 19 06 cpc r1, r25 b04a: 19 f0 breq .+6 ; 0xb052 b04c: 14 f0 brlt .+4 ; 0xb052 b04e: e5 2c mov r14, r5 b050: e8 1a sub r14, r24 b052: 81 2f mov r24, r17 b054: 89 70 andi r24, 0x09 ; 9 b056: 11 f4 brne .+4 ; 0xb05c b058: e1 10 cpse r14, r1 b05a: 67 c0 rjmp .+206 ; 0xb12a b05c: 00 23 and r16, r16 b05e: 29 f0 breq .+10 ; 0xb06a b060: b6 01 movw r22, r12 b062: 80 2f mov r24, r16 b064: 90 e0 ldi r25, 0x00 ; 0 b066: 0f 94 84 da call 0x3b508 ; 0x3b508 b06a: 13 fd sbrc r17, 3 b06c: 02 c0 rjmp .+4 ; 0xb072 b06e: e1 10 cpse r14, r1 b070: 63 c0 rjmp .+198 ; 0xb138 b072: 17 ff sbrs r17, 7 b074: 7c c0 rjmp .+248 ; 0xb16e b076: 85 01 movw r16, r10 b078: b7 fe sbrs r11, 7 b07a: 02 c0 rjmp .+4 ; 0xb080 b07c: 10 e0 ldi r17, 0x00 ; 0 b07e: 00 e0 ldi r16, 0x00 ; 0 b080: c5 01 movw r24, r10 b082: 84 19 sub r24, r4 b084: 91 09 sbc r25, r1 b086: 2c 01 movw r4, r24 b088: 6f 2d mov r22, r15 b08a: 70 e0 ldi r23, 0x00 ; 0 b08c: ee 27 eor r30, r30 b08e: ff 27 eor r31, r31 b090: e6 1b sub r30, r22 b092: f7 0b sbc r31, r23 b094: ff 87 std Y+15, r31 ; 0x0f b096: ee 87 std Y+14, r30 ; 0x0e b098: 0f 3f cpi r16, 0xFF ; 255 b09a: 10 07 cpc r17, r16 b09c: 29 f4 brne .+10 ; 0xb0a8 b09e: b6 01 movw r22, r12 b0a0: 8e e2 ldi r24, 0x2E ; 46 b0a2: 90 e0 ldi r25, 0x00 ; 0 b0a4: 0f 94 84 da call 0x3b508 ; 0x3b508 b0a8: a0 16 cp r10, r16 b0aa: b1 06 cpc r11, r17 b0ac: 0c f4 brge .+2 ; 0xb0b0 b0ae: 4b c0 rjmp .+150 ; 0xb146 b0b0: 40 16 cp r4, r16 b0b2: 51 06 cpc r5, r17 b0b4: 0c f0 brlt .+2 ; 0xb0b8 b0b6: 47 c0 rjmp .+142 ; 0xb146 b0b8: f5 01 movw r30, r10 b0ba: e0 1b sub r30, r16 b0bc: f1 0b sbc r31, r17 b0be: e8 0d add r30, r8 b0c0: f9 1d adc r31, r9 b0c2: 81 81 ldd r24, Z+1 ; 0x01 b0c4: 01 50 subi r16, 0x01 ; 1 b0c6: 11 09 sbc r17, r1 b0c8: 2e 85 ldd r18, Y+14 ; 0x0e b0ca: 3f 85 ldd r19, Y+15 ; 0x0f b0cc: 02 17 cp r16, r18 b0ce: 13 07 cpc r17, r19 b0d0: e4 f1 brlt .+120 ; 0xb14a b0d2: b6 01 movw r22, r12 b0d4: 90 e0 ldi r25, 0x00 ; 0 b0d6: 0f 94 84 da call 0x3b508 ; 0x3b508 b0da: de cf rjmp .-68 ; 0xb098 b0dc: 16 fd sbrc r17, 6 b0de: 9f cf rjmp .-194 ; 0xb01e b0e0: ef 2d mov r30, r15 b0e2: f0 e0 ldi r31, 0x00 ; 0 b0e4: ea 15 cp r30, r10 b0e6: fb 05 cpc r31, r11 b0e8: 34 f0 brlt .+12 ; 0xb0f6 b0ea: 3c ef ldi r19, 0xFC ; 252 b0ec: a3 16 cp r10, r19 b0ee: 3f ef ldi r19, 0xFF ; 255 b0f0: b3 06 cpc r11, r19 b0f2: 0c f0 brlt .+2 ; 0xb0f6 b0f4: 10 68 ori r17, 0x80 ; 128 b0f6: 32 96 adiw r30, 0x02 ; 2 b0f8: e8 0d add r30, r8 b0fa: f9 1d adc r31, r9 b0fc: 01 c0 rjmp .+2 ; 0xb100 b0fe: fa 94 dec r15 b100: ff 20 and r15, r15 b102: 19 f0 breq .+6 ; 0xb10a b104: 82 91 ld r24, -Z b106: 80 33 cpi r24, 0x30 ; 48 b108: d1 f3 breq .-12 ; 0xb0fe b10a: 17 ff sbrs r17, 7 b10c: 88 cf rjmp .-240 ; 0xb01e b10e: 44 24 eor r4, r4 b110: 43 94 inc r4 b112: 4f 0c add r4, r15 b114: fa 14 cp r15, r10 b116: 1b 04 cpc r1, r11 b118: 31 f0 breq .+12 ; 0xb126 b11a: 2c f0 brlt .+10 ; 0xb126 b11c: fa 18 sub r15, r10 b11e: 7f cf rjmp .-258 ; 0xb01e b120: 44 24 eor r4, r4 b122: 43 94 inc r4 b124: 7c cf rjmp .-264 ; 0xb01e b126: f1 2c mov r15, r1 b128: 7a cf rjmp .-268 ; 0xb01e b12a: b6 01 movw r22, r12 b12c: 80 e2 ldi r24, 0x20 ; 32 b12e: 90 e0 ldi r25, 0x00 ; 0 b130: 0f 94 84 da call 0x3b508 ; 0x3b508 b134: ea 94 dec r14 b136: 90 cf rjmp .-224 ; 0xb058 b138: b6 01 movw r22, r12 b13a: 80 e3 ldi r24, 0x30 ; 48 b13c: 90 e0 ldi r25, 0x00 ; 0 b13e: 0f 94 84 da call 0x3b508 ; 0x3b508 b142: ea 94 dec r14 b144: 94 cf rjmp .-216 ; 0xb06e b146: 80 e3 ldi r24, 0x30 ; 48 b148: bd cf rjmp .-134 ; 0xb0c4 b14a: a0 16 cp r10, r16 b14c: b1 06 cpc r11, r17 b14e: 41 f4 brne .+16 ; 0xb160 b150: 9a 81 ldd r25, Y+2 ; 0x02 b152: 96 33 cpi r25, 0x36 ; 54 b154: 50 f4 brcc .+20 ; 0xb16a b156: 95 33 cpi r25, 0x35 ; 53 b158: 19 f4 brne .+6 ; 0xb160 b15a: 3c 85 ldd r19, Y+12 ; 0x0c b15c: 34 ff sbrs r19, 4 b15e: 05 c0 rjmp .+10 ; 0xb16a b160: b6 01 movw r22, r12 b162: 90 e0 ldi r25, 0x00 ; 0 b164: 0f 94 84 da call 0x3b508 ; 0x3b508 b168: 2a cf rjmp .-428 ; 0xafbe b16a: 81 e3 ldi r24, 0x31 ; 49 b16c: f9 cf rjmp .-14 ; 0xb160 b16e: 8a 81 ldd r24, Y+2 ; 0x02 b170: 81 33 cpi r24, 0x31 ; 49 b172: 19 f0 breq .+6 ; 0xb17a b174: 9c 85 ldd r25, Y+12 ; 0x0c b176: 9f 7e andi r25, 0xEF ; 239 b178: 9c 87 std Y+12, r25 ; 0x0c b17a: b6 01 movw r22, r12 b17c: 90 e0 ldi r25, 0x00 ; 0 b17e: 0f 94 84 da call 0x3b508 ; 0x3b508 b182: ff 20 and r15, r15 b184: a9 f0 breq .+42 ; 0xb1b0 b186: b6 01 movw r22, r12 b188: 8e e2 ldi r24, 0x2E ; 46 b18a: 90 e0 ldi r25, 0x00 ; 0 b18c: 0f 94 84 da call 0x3b508 ; 0x3b508 b190: f3 94 inc r15 b192: f3 94 inc r15 b194: e2 e0 ldi r30, 0x02 ; 2 b196: 01 e0 ldi r16, 0x01 ; 1 b198: 0e 0f add r16, r30 b19a: e8 0d add r30, r8 b19c: f9 2d mov r31, r9 b19e: f1 1d adc r31, r1 b1a0: 80 81 ld r24, Z b1a2: b6 01 movw r22, r12 b1a4: 90 e0 ldi r25, 0x00 ; 0 b1a6: 0f 94 84 da call 0x3b508 ; 0x3b508 b1aa: e0 2f mov r30, r16 b1ac: 0f 11 cpse r16, r15 b1ae: f3 cf rjmp .-26 ; 0xb196 b1b0: 85 e6 ldi r24, 0x65 ; 101 b1b2: 90 e0 ldi r25, 0x00 ; 0 b1b4: 14 ff sbrs r17, 4 b1b6: 02 c0 rjmp .+4 ; 0xb1bc b1b8: 85 e4 ldi r24, 0x45 ; 69 b1ba: 90 e0 ldi r25, 0x00 ; 0 b1bc: b6 01 movw r22, r12 b1be: 0f 94 84 da call 0x3b508 ; 0x3b508 b1c2: b7 fc sbrc r11, 7 b1c4: 06 c0 rjmp .+12 ; 0xb1d2 b1c6: a1 14 cp r10, r1 b1c8: b1 04 cpc r11, r1 b1ca: c1 f4 brne .+48 ; 0xb1fc b1cc: ec 85 ldd r30, Y+12 ; 0x0c b1ce: e4 ff sbrs r30, 4 b1d0: 15 c0 rjmp .+42 ; 0xb1fc b1d2: b1 94 neg r11 b1d4: a1 94 neg r10 b1d6: b1 08 sbc r11, r1 b1d8: 8d e2 ldi r24, 0x2D ; 45 b1da: b6 01 movw r22, r12 b1dc: 90 e0 ldi r25, 0x00 ; 0 b1de: 0f 94 84 da call 0x3b508 ; 0x3b508 b1e2: 80 e3 ldi r24, 0x30 ; 48 b1e4: 2a e0 ldi r18, 0x0A ; 10 b1e6: a2 16 cp r10, r18 b1e8: b1 04 cpc r11, r1 b1ea: 54 f4 brge .+20 ; 0xb200 b1ec: b6 01 movw r22, r12 b1ee: 90 e0 ldi r25, 0x00 ; 0 b1f0: 0f 94 84 da call 0x3b508 ; 0x3b508 b1f4: b6 01 movw r22, r12 b1f6: c5 01 movw r24, r10 b1f8: c0 96 adiw r24, 0x30 ; 48 b1fa: b4 cf rjmp .-152 ; 0xb164 b1fc: 8b e2 ldi r24, 0x2B ; 43 b1fe: ed cf rjmp .-38 ; 0xb1da b200: 8f 5f subi r24, 0xFF ; 255 b202: fa e0 ldi r31, 0x0A ; 10 b204: af 1a sub r10, r31 b206: b1 08 sbc r11, r1 b208: ed cf rjmp .-38 ; 0xb1e4 b20a: 83 36 cpi r24, 0x63 ; 99 b20c: c9 f0 breq .+50 ; 0xb240 b20e: 83 37 cpi r24, 0x73 ; 115 b210: 71 f1 breq .+92 ; 0xb26e b212: 83 35 cpi r24, 0x53 ; 83 b214: 09 f0 breq .+2 ; 0xb218 b216: 5b c0 rjmp .+182 ; 0xb2ce b218: 35 01 movw r6, r10 b21a: f2 e0 ldi r31, 0x02 ; 2 b21c: 6f 0e add r6, r31 b21e: 71 1c adc r7, r1 b220: f5 01 movw r30, r10 b222: a0 80 ld r10, Z b224: b1 80 ldd r11, Z+1 ; 0x01 b226: 6f 2d mov r22, r15 b228: 70 e0 ldi r23, 0x00 ; 0 b22a: 06 fd sbrc r16, 6 b22c: 02 c0 rjmp .+4 ; 0xb232 b22e: 6f ef ldi r22, 0xFF ; 255 b230: 7f ef ldi r23, 0xFF ; 255 b232: c5 01 movw r24, r10 b234: 0f 94 18 da call 0x3b430 ; 0x3b430 b238: 9d 87 std Y+13, r25 ; 0x0d b23a: 8c 87 std Y+12, r24 ; 0x0c b23c: 00 68 ori r16, 0x80 ; 128 b23e: 0d c0 rjmp .+26 ; 0xb25a b240: 35 01 movw r6, r10 b242: 32 e0 ldi r19, 0x02 ; 2 b244: 63 0e add r6, r19 b246: 71 1c adc r7, r1 b248: f5 01 movw r30, r10 b24a: 80 81 ld r24, Z b24c: 89 83 std Y+1, r24 ; 0x01 b24e: 21 e0 ldi r18, 0x01 ; 1 b250: 30 e0 ldi r19, 0x00 ; 0 b252: 3d 87 std Y+13, r19 ; 0x0d b254: 2c 87 std Y+12, r18 ; 0x0c b256: 54 01 movw r10, r8 b258: 0f 77 andi r16, 0x7F ; 127 b25a: 03 fd sbrc r16, 3 b25c: 06 c0 rjmp .+12 ; 0xb26a b25e: 2c 85 ldd r18, Y+12 ; 0x0c b260: 3d 85 ldd r19, Y+13 ; 0x0d b262: 52 16 cp r5, r18 b264: 13 06 cpc r1, r19 b266: 09 f0 breq .+2 ; 0xb26a b268: a8 f4 brcc .+42 ; 0xb294 b26a: e5 2c mov r14, r5 b26c: 2b c0 rjmp .+86 ; 0xb2c4 b26e: 35 01 movw r6, r10 b270: 32 e0 ldi r19, 0x02 ; 2 b272: 63 0e add r6, r19 b274: 71 1c adc r7, r1 b276: f5 01 movw r30, r10 b278: a0 80 ld r10, Z b27a: b1 80 ldd r11, Z+1 ; 0x01 b27c: 6f 2d mov r22, r15 b27e: 70 e0 ldi r23, 0x00 ; 0 b280: 06 fd sbrc r16, 6 b282: 02 c0 rjmp .+4 ; 0xb288 b284: 6f ef ldi r22, 0xFF ; 255 b286: 7f ef ldi r23, 0xFF ; 255 b288: c5 01 movw r24, r10 b28a: 0f 94 3d da call 0x3b47a ; 0x3b47a b28e: 9d 87 std Y+13, r25 ; 0x0d b290: 8c 87 std Y+12, r24 ; 0x0c b292: e2 cf rjmp .-60 ; 0xb258 b294: b6 01 movw r22, r12 b296: 80 e2 ldi r24, 0x20 ; 32 b298: 90 e0 ldi r25, 0x00 ; 0 b29a: 0f 94 84 da call 0x3b508 ; 0x3b508 b29e: 5a 94 dec r5 b2a0: de cf rjmp .-68 ; 0xb25e b2a2: f5 01 movw r30, r10 b2a4: 07 fd sbrc r16, 7 b2a6: 85 91 lpm r24, Z+ b2a8: 07 ff sbrs r16, 7 b2aa: 81 91 ld r24, Z+ b2ac: 5f 01 movw r10, r30 b2ae: b6 01 movw r22, r12 b2b0: 90 e0 ldi r25, 0x00 ; 0 b2b2: 0f 94 84 da call 0x3b508 ; 0x3b508 b2b6: e1 10 cpse r14, r1 b2b8: ea 94 dec r14 b2ba: 8c 85 ldd r24, Y+12 ; 0x0c b2bc: 9d 85 ldd r25, Y+13 ; 0x0d b2be: 01 97 sbiw r24, 0x01 ; 1 b2c0: 9d 87 std Y+13, r25 ; 0x0d b2c2: 8c 87 std Y+12, r24 ; 0x0c b2c4: ec 85 ldd r30, Y+12 ; 0x0c b2c6: fd 85 ldd r31, Y+13 ; 0x0d b2c8: ef 2b or r30, r31 b2ca: 59 f7 brne .-42 ; 0xb2a2 b2cc: 78 ce rjmp .-784 ; 0xafbe b2ce: 84 36 cpi r24, 0x64 ; 100 b2d0: 19 f0 breq .+6 ; 0xb2d8 b2d2: 89 36 cpi r24, 0x69 ; 105 b2d4: 09 f0 breq .+2 ; 0xb2d8 b2d6: 74 c0 rjmp .+232 ; 0xb3c0 b2d8: 35 01 movw r6, r10 b2da: 07 ff sbrs r16, 7 b2dc: 66 c0 rjmp .+204 ; 0xb3aa b2de: f4 e0 ldi r31, 0x04 ; 4 b2e0: 6f 0e add r6, r31 b2e2: 71 1c adc r7, r1 b2e4: f5 01 movw r30, r10 b2e6: 60 81 ld r22, Z b2e8: 71 81 ldd r23, Z+1 ; 0x01 b2ea: 82 81 ldd r24, Z+2 ; 0x02 b2ec: 93 81 ldd r25, Z+3 ; 0x03 b2ee: 10 2f mov r17, r16 b2f0: 1f 76 andi r17, 0x6F ; 111 b2f2: 97 ff sbrs r25, 7 b2f4: 08 c0 rjmp .+16 ; 0xb306 b2f6: 90 95 com r25 b2f8: 80 95 com r24 b2fa: 70 95 com r23 b2fc: 61 95 neg r22 b2fe: 7f 4f sbci r23, 0xFF ; 255 b300: 8f 4f sbci r24, 0xFF ; 255 b302: 9f 4f sbci r25, 0xFF ; 255 b304: 10 68 ori r17, 0x80 ; 128 b306: 2a e0 ldi r18, 0x0A ; 10 b308: 30 e0 ldi r19, 0x00 ; 0 b30a: a4 01 movw r20, r8 b30c: 0f 94 ab db call 0x3b756 ; 0x3b756 <__ultoa_invert> b310: a8 2e mov r10, r24 b312: a8 18 sub r10, r8 b314: ba 2c mov r11, r10 b316: 01 2f mov r16, r17 b318: 16 ff sbrs r17, 6 b31a: 0a c0 rjmp .+20 ; 0xb330 b31c: 0e 7f andi r16, 0xFE ; 254 b31e: af 14 cp r10, r15 b320: 38 f4 brcc .+14 ; 0xb330 b322: 14 ff sbrs r17, 4 b324: 04 c0 rjmp .+8 ; 0xb32e b326: 12 fd sbrc r17, 2 b328: 02 c0 rjmp .+4 ; 0xb32e b32a: 01 2f mov r16, r17 b32c: 0e 7e andi r16, 0xEE ; 238 b32e: bf 2c mov r11, r15 b330: 04 ff sbrs r16, 4 b332: a3 c0 rjmp .+326 ; 0xb47a b334: fe 01 movw r30, r28 b336: ea 0d add r30, r10 b338: f1 1d adc r31, r1 b33a: 80 81 ld r24, Z b33c: 80 33 cpi r24, 0x30 ; 48 b33e: 09 f0 breq .+2 ; 0xb342 b340: 95 c0 rjmp .+298 ; 0xb46c b342: 09 7e andi r16, 0xE9 ; 233 b344: f0 2f mov r31, r16 b346: f8 70 andi r31, 0x08 ; 8 b348: ef 2e mov r14, r31 b34a: 03 fd sbrc r16, 3 b34c: a5 c0 rjmp .+330 ; 0xb498 b34e: 00 ff sbrs r16, 0 b350: 9f c0 rjmp .+318 ; 0xb490 b352: fa 2c mov r15, r10 b354: b5 14 cp r11, r5 b356: 10 f4 brcc .+4 ; 0xb35c b358: f5 0c add r15, r5 b35a: fb 18 sub r15, r11 b35c: 04 ff sbrs r16, 4 b35e: a2 c0 rjmp .+324 ; 0xb4a4 b360: b6 01 movw r22, r12 b362: 80 e3 ldi r24, 0x30 ; 48 b364: 90 e0 ldi r25, 0x00 ; 0 b366: 0f 94 84 da call 0x3b508 ; 0x3b508 b36a: 02 ff sbrs r16, 2 b36c: 09 c0 rjmp .+18 ; 0xb380 b36e: 88 e7 ldi r24, 0x78 ; 120 b370: 90 e0 ldi r25, 0x00 ; 0 b372: 01 ff sbrs r16, 1 b374: 02 c0 rjmp .+4 ; 0xb37a b376: 88 e5 ldi r24, 0x58 ; 88 b378: 90 e0 ldi r25, 0x00 ; 0 b37a: b6 01 movw r22, r12 b37c: 0f 94 84 da call 0x3b508 ; 0x3b508 b380: af 14 cp r10, r15 b382: 08 f4 brcc .+2 ; 0xb386 b384: 9b c0 rjmp .+310 ; 0xb4bc b386: aa 94 dec r10 b388: 0a 2d mov r16, r10 b38a: 10 e0 ldi r17, 0x00 ; 0 b38c: 0f 5f subi r16, 0xFF ; 255 b38e: 1f 4f sbci r17, 0xFF ; 255 b390: 08 0d add r16, r8 b392: 19 1d adc r17, r9 b394: f8 01 movw r30, r16 b396: 82 91 ld r24, -Z b398: 8f 01 movw r16, r30 b39a: b6 01 movw r22, r12 b39c: 90 e0 ldi r25, 0x00 ; 0 b39e: 0f 94 84 da call 0x3b508 ; 0x3b508 b3a2: 80 16 cp r8, r16 b3a4: 91 06 cpc r9, r17 b3a6: b1 f7 brne .-20 ; 0xb394 b3a8: 0a ce rjmp .-1004 ; 0xafbe b3aa: f2 e0 ldi r31, 0x02 ; 2 b3ac: 6f 0e add r6, r31 b3ae: 71 1c adc r7, r1 b3b0: f5 01 movw r30, r10 b3b2: 60 81 ld r22, Z b3b4: 71 81 ldd r23, Z+1 ; 0x01 b3b6: 07 2e mov r0, r23 b3b8: 00 0c add r0, r0 b3ba: 88 0b sbc r24, r24 b3bc: 99 0b sbc r25, r25 b3be: 97 cf rjmp .-210 ; 0xb2ee b3c0: 10 2f mov r17, r16 b3c2: 85 37 cpi r24, 0x75 ; 117 b3c4: a9 f4 brne .+42 ; 0xb3f0 b3c6: 1f 7e andi r17, 0xEF ; 239 b3c8: 2a e0 ldi r18, 0x0A ; 10 b3ca: 30 e0 ldi r19, 0x00 ; 0 b3cc: 35 01 movw r6, r10 b3ce: 17 ff sbrs r17, 7 b3d0: 44 c0 rjmp .+136 ; 0xb45a b3d2: f4 e0 ldi r31, 0x04 ; 4 b3d4: 6f 0e add r6, r31 b3d6: 71 1c adc r7, r1 b3d8: f5 01 movw r30, r10 b3da: 60 81 ld r22, Z b3dc: 71 81 ldd r23, Z+1 ; 0x01 b3de: 82 81 ldd r24, Z+2 ; 0x02 b3e0: 93 81 ldd r25, Z+3 ; 0x03 b3e2: a4 01 movw r20, r8 b3e4: 0f 94 ab db call 0x3b756 ; 0x3b756 <__ultoa_invert> b3e8: a8 2e mov r10, r24 b3ea: a8 18 sub r10, r8 b3ec: 1f 77 andi r17, 0x7F ; 127 b3ee: 92 cf rjmp .-220 ; 0xb314 b3f0: 19 7f andi r17, 0xF9 ; 249 b3f2: 8f 36 cpi r24, 0x6F ; 111 b3f4: 79 f1 breq .+94 ; 0xb454 b3f6: f0 f4 brcc .+60 ; 0xb434 b3f8: 88 35 cpi r24, 0x58 ; 88 b3fa: 39 f1 breq .+78 ; 0xb44a b3fc: f6 01 movw r30, r12 b3fe: 86 81 ldd r24, Z+6 ; 0x06 b400: 97 81 ldd r25, Z+7 ; 0x07 b402: 2f 96 adiw r28, 0x0f ; 15 b404: 0f b6 in r0, 0x3f ; 63 b406: f8 94 cli b408: de bf out 0x3e, r29 ; 62 b40a: 0f be out 0x3f, r0 ; 63 b40c: cd bf out 0x3d, r28 ; 61 b40e: df 91 pop r29 b410: cf 91 pop r28 b412: 1f 91 pop r17 b414: 0f 91 pop r16 b416: ff 90 pop r15 b418: ef 90 pop r14 b41a: df 90 pop r13 b41c: cf 90 pop r12 b41e: bf 90 pop r11 b420: af 90 pop r10 b422: 9f 90 pop r9 b424: 8f 90 pop r8 b426: 7f 90 pop r7 b428: 6f 90 pop r6 b42a: 5f 90 pop r5 b42c: 4f 90 pop r4 b42e: 3f 90 pop r3 b430: 2f 90 pop r2 b432: 08 95 ret b434: 80 37 cpi r24, 0x70 ; 112 b436: 39 f0 breq .+14 ; 0xb446 b438: 88 37 cpi r24, 0x78 ; 120 b43a: 01 f7 brne .-64 ; 0xb3fc b43c: 14 fd sbrc r17, 4 b43e: 14 60 ori r17, 0x04 ; 4 b440: 20 e1 ldi r18, 0x10 ; 16 b442: 30 e0 ldi r19, 0x00 ; 0 b444: c3 cf rjmp .-122 ; 0xb3cc b446: 10 61 ori r17, 0x10 ; 16 b448: f9 cf rjmp .-14 ; 0xb43c b44a: 04 fd sbrc r16, 4 b44c: 16 60 ori r17, 0x06 ; 6 b44e: 20 e1 ldi r18, 0x10 ; 16 b450: 32 e0 ldi r19, 0x02 ; 2 b452: bc cf rjmp .-136 ; 0xb3cc b454: 28 e0 ldi r18, 0x08 ; 8 b456: 30 e0 ldi r19, 0x00 ; 0 b458: b9 cf rjmp .-142 ; 0xb3cc b45a: f2 e0 ldi r31, 0x02 ; 2 b45c: 6f 0e add r6, r31 b45e: 71 1c adc r7, r1 b460: f5 01 movw r30, r10 b462: 60 81 ld r22, Z b464: 71 81 ldd r23, Z+1 ; 0x01 b466: 90 e0 ldi r25, 0x00 ; 0 b468: 80 e0 ldi r24, 0x00 ; 0 b46a: bb cf rjmp .-138 ; 0xb3e2 b46c: 02 fd sbrc r16, 2 b46e: 02 c0 rjmp .+4 ; 0xb474 b470: b3 94 inc r11 b472: 68 cf rjmp .-304 ; 0xb344 b474: b3 94 inc r11 b476: b3 94 inc r11 b478: 65 cf rjmp .-310 ; 0xb344 b47a: 80 2f mov r24, r16 b47c: 86 78 andi r24, 0x86 ; 134 b47e: 09 f4 brne .+2 ; 0xb482 b480: 61 cf rjmp .-318 ; 0xb344 b482: f6 cf rjmp .-20 ; 0xb470 b484: b6 01 movw r22, r12 b486: 80 e2 ldi r24, 0x20 ; 32 b488: 90 e0 ldi r25, 0x00 ; 0 b48a: 0f 94 84 da call 0x3b508 ; 0x3b508 b48e: b3 94 inc r11 b490: b5 14 cp r11, r5 b492: c0 f3 brcs .-16 ; 0xb484 b494: e1 2c mov r14, r1 b496: 62 cf rjmp .-316 ; 0xb35c b498: e5 2c mov r14, r5 b49a: eb 18 sub r14, r11 b49c: b5 14 cp r11, r5 b49e: 08 f4 brcc .+2 ; 0xb4a2 b4a0: 5d cf rjmp .-326 ; 0xb35c b4a2: f8 cf rjmp .-16 ; 0xb494 b4a4: 80 2f mov r24, r16 b4a6: 86 78 andi r24, 0x86 ; 134 b4a8: 09 f4 brne .+2 ; 0xb4ac b4aa: 6a cf rjmp .-300 ; 0xb380 b4ac: 8b e2 ldi r24, 0x2B ; 43 b4ae: 01 ff sbrs r16, 1 b4b0: 80 e2 ldi r24, 0x20 ; 32 b4b2: 07 fd sbrc r16, 7 b4b4: 8d e2 ldi r24, 0x2D ; 45 b4b6: b6 01 movw r22, r12 b4b8: 90 e0 ldi r25, 0x00 ; 0 b4ba: 60 cf rjmp .-320 ; 0xb37c b4bc: b6 01 movw r22, r12 b4be: 80 e3 ldi r24, 0x30 ; 48 b4c0: 90 e0 ldi r25, 0x00 ; 0 b4c2: 0f 94 84 da call 0x3b508 ; 0x3b508 b4c6: fa 94 dec r15 b4c8: 5b cf rjmp .-330 ; 0xb380 b4ca: b6 01 movw r22, r12 b4cc: 80 e2 ldi r24, 0x20 ; 32 b4ce: 90 e0 ldi r25, 0x00 ; 0 b4d0: 0f 94 84 da call 0x3b508 ; 0x3b508 b4d4: ea 94 dec r14 b4d6: 73 cd rjmp .-1306 ; 0xafbe b4d8: 24 e0 ldi r18, 0x04 ; 4 b4da: e1 2c mov r14, r1 b4dc: 25 15 cp r18, r5 b4de: 08 f0 brcs .+2 ; 0xb4e2 b4e0: 36 cd rjmp .-1428 ; 0xaf4e b4e2: 84 e0 ldi r24, 0x04 ; 4 b4e4: 26 cd rjmp .-1460 ; 0xaf32 0000b4e6 : 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 ( b4e6: 20 e0 ldi r18, 0x00 ; 0 b4e8: 30 e0 ldi r19, 0x00 ; 0 b4ea: 40 e8 ldi r20, 0x80 ; 128 b4ec: 5f eb ldi r21, 0xBF ; 191 b4ee: 60 91 83 02 lds r22, 0x0283 ; 0x800283 b4f2: 70 91 84 02 lds r23, 0x0284 ; 0x800284 b4f6: 80 91 85 02 lds r24, 0x0285 ; 0x800285 b4fa: 90 91 86 02 lds r25, 0x0286 ; 0x800286 b4fe: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> b502: 88 23 and r24, r24 b504: 21 f1 breq .+72 ; 0xb54e (saved_start_position[0] != SAVED_START_POSITION_UNSET) && ( (CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_SDCARD) || b506: e0 91 92 12 lds r30, 0x1292 ; 0x801292 b50a: f0 91 93 12 lds r31, 0x1293 ; 0x801293 b50e: eb 55 subi r30, 0x5B ; 91 b510: 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) && ( b512: 80 81 ld r24, Z b514: 8b 7f andi r24, 0xFB ; 251 b516: 82 30 cpi r24, 0x02 ; 2 b518: d1 f4 brne .+52 ; 0xb54e (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)); b51a: 80 e1 ldi r24, 0x10 ; 16 b51c: e3 e8 ldi r30, 0x83 ; 131 b51e: f2 e0 ldi r31, 0x02 ; 2 b520: a2 e9 ldi r26, 0x92 ; 146 b522: b6 e0 ldi r27, 0x06 ; 6 b524: 01 90 ld r0, Z+ b526: 0d 92 st X+, r0 b528: 8a 95 dec r24 b52a: e1 f7 brne .-8 ; 0xb524 saved_start_position[0] = SAVED_START_POSITION_UNSET; b52c: 80 e0 ldi r24, 0x00 ; 0 b52e: 90 e0 ldi r25, 0x00 ; 0 b530: a0 e8 ldi r26, 0x80 ; 128 b532: bf eb ldi r27, 0xBF ; 191 b534: 80 93 83 02 sts 0x0283, r24 ; 0x800283 b538: 90 93 84 02 sts 0x0284, r25 ; 0x800284 b53c: a0 93 85 02 sts 0x0285, r26 ; 0x800285 b540: b0 93 86 02 sts 0x0286, r27 ; 0x800286 return saved_segment_idx; b544: 80 91 69 05 lds r24, 0x0569 ; 0x800569 b548: 90 91 6a 05 lds r25, 0x056A ; 0x80056a b54c: 08 95 ret } else return 1; //begin with the first segment b54e: 81 e0 ldi r24, 0x01 ; 1 b550: 90 e0 ldi r25, 0x00 ; 0 } b552: 08 95 ret 0000b554 : 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) { b554: cf 92 push r12 b556: df 92 push r13 b558: ef 92 push r14 b55a: ff 92 push r15 b55c: 0f 93 push r16 b55e: 1f 93 push r17 b560: cf 93 push r28 b562: 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); b564: 90 e0 ldi r25, 0x00 ; 0 b566: ec 01 movw r28, r24 b568: cc 0f add r28, r28 b56a: dd 1f adc r29, r29 b56c: cc 0f add r28, r28 b56e: dd 1f adc r29, r29 b570: fe 01 movw r30, r28 b572: e2 50 subi r30, 0x02 ; 2 b574: f4 48 sbci r31, 0x84 ; 132 #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); b576: 25 91 lpm r18, Z+ b578: 35 91 lpm r19, Z+ b57a: 45 91 lpm r20, Z+ b57c: 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]; b57e: fe 01 movw r30, r28 b580: ea 5e subi r30, 0xEA ; 234 b582: f1 4f sbci r31, 0xF1 ; 241 b584: c0 80 ld r12, Z b586: d1 80 ldd r13, Z+1 ; 0x01 b588: e2 80 ldd r14, Z+2 ; 0x02 b58a: f3 80 ldd r15, Z+3 ; 0x03 b58c: 8e 01 movw r16, r28 b58e: 0e 56 subi r16, 0x6E ; 110 b590: 19 4f sbci r17, 0xF9 ; 249 b592: c7 01 movw r24, r14 b594: b6 01 movw r22, r12 b596: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> b59a: f8 01 movw r30, r16 b59c: 60 83 st Z, r22 b59e: 71 83 std Z+1, r23 ; 0x01 b5a0: 82 83 std Z+2, r24 ; 0x02 b5a2: 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); b5a4: fe 01 movw r30, r28 b5a6: ee 50 subi r30, 0x0E ; 14 b5a8: f4 48 sbci r31, 0x84 ; 132 #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); b5aa: 25 91 lpm r18, Z+ b5ac: 35 91 lpm r19, Z+ b5ae: 45 91 lpm r20, Z+ b5b0: 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]; b5b2: 8e 01 movw r16, r28 b5b4: 0f 5d subi r16, 0xDF ; 223 b5b6: 1d 4f sbci r17, 0xFD ; 253 b5b8: c7 01 movw r24, r14 b5ba: b6 01 movw r22, r12 b5bc: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> b5c0: f8 01 movw r30, r16 b5c2: 60 83 st Z, r22 b5c4: 71 83 std Z+1, r23 ; 0x01 b5c6: 82 83 std Z+2, r24 ; 0x02 b5c8: 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); b5ca: fe 01 movw r30, r28 b5cc: ea 51 subi r30, 0x1A ; 26 b5ce: f4 48 sbci r31, 0x84 ; 132 #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); b5d0: 25 91 lpm r18, Z+ b5d2: 35 91 lpm r19, Z+ b5d4: 45 91 lpm r20, Z+ b5d6: 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]; b5d8: cb 5e subi r28, 0xEB ; 235 b5da: dd 4f sbci r29, 0xFD ; 253 b5dc: c7 01 movw r24, r14 b5de: b6 01 movw r22, r12 b5e0: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> b5e4: 68 83 st Y, r22 b5e6: 79 83 std Y+1, r23 ; 0x01 b5e8: 8a 83 std Y+2, r24 ; 0x02 b5ea: 9b 83 std Y+3, r25 ; 0x03 } b5ec: df 91 pop r29 b5ee: cf 91 pop r28 b5f0: 1f 91 pop r17 b5f2: 0f 91 pop r16 b5f4: ff 90 pop r15 b5f6: ef 90 pop r14 b5f8: df 90 pop r13 b5fa: cf 90 pop r12 b5fc: 08 95 ret 0000b5fe : 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)); } b5fe: 80 e1 ldi r24, 0x10 ; 16 b600: e4 e7 ldi r30, 0x74 ; 116 b602: f6 e0 ldi r31, 0x06 ; 6 b604: a2 e9 ldi r26, 0x92 ; 146 b606: b6 e0 ldi r27, 0x06 ; 6 b608: 01 90 ld r0, Z+ b60a: 0d 92 st X+, r0 b60c: 8a 95 dec r24 b60e: e1 f7 brne .-8 ; 0xb608 b610: 08 95 ret 0000b612 : /// @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)); b612: e1 e7 ldi r30, 0x71 ; 113 b614: fb e7 ldi r31, 0x7B ; 123 b616: 83 30 cpi r24, 0x03 ; 3 b618: 21 f0 breq .+8 ; 0xb622 b61a: e8 2f mov r30, r24 b61c: f0 e0 ldi r31, 0x00 ; 0 b61e: e2 59 subi r30, 0x92 ; 146 b620: f4 48 sbci r31, 0x84 ; 132 b622: 84 91 lpm r24, Z } b624: 08 95 ret 0000b626 : #endif //SDSUPPORT } uint16_t cmdqueue_calc_sd_length() { if (buflen == 0) b626: 40 91 a3 10 lds r20, 0x10A3 ; 0x8010a3 b62a: 50 91 a4 10 lds r21, 0x10A4 ; 0x8010a4 return 0; b62e: 90 e0 ldi r25, 0x00 ; 0 b630: 80 e0 ldi r24, 0x00 ; 0 #endif //SDSUPPORT } uint16_t cmdqueue_calc_sd_length() { if (buflen == 0) b632: 41 15 cp r20, r1 b634: 51 05 cpc r21, r1 b636: b1 f1 breq .+108 ; 0xb6a4 char hi; } lohi; uint16_t value; } sdlen_single; uint16_t sdlen = 0; for (size_t _buflen = buflen, _bufindr = bufindr;;) { b638: 20 91 92 12 lds r18, 0x1292 ; 0x801292 b63c: 30 91 93 12 lds r19, 0x1293 ; 0x801293 char lo; char hi; } lohi; uint16_t value; } sdlen_single; uint16_t sdlen = 0; b640: 90 e0 ldi r25, 0x00 ; 0 b642: 80 e0 ldi r24, 0x00 ; 0 for (size_t _buflen = buflen, _bufindr = bufindr;;) { if (cmdbuffer[_bufindr] == CMDBUFFER_CURRENT_TYPE_SDCARD) { b644: f9 01 movw r30, r18 b646: eb 55 subi r30, 0x5B ; 91 b648: ff 4e sbci r31, 0xEF ; 239 b64a: a0 81 ld r26, Z b64c: a2 30 cpi r26, 0x02 ; 2 b64e: 21 f4 brne .+8 ; 0xb658 sdlen_single.lohi.lo = cmdbuffer[_bufindr + 1]; b650: 61 81 ldd r22, Z+1 ; 0x01 sdlen_single.lohi.hi = cmdbuffer[_bufindr + 2]; b652: 72 81 ldd r23, Z+2 ; 0x02 sdlen += sdlen_single.value; b654: 86 0f add r24, r22 b656: 97 1f adc r25, r23 } if (-- _buflen == 0) b658: 41 50 subi r20, 0x01 ; 1 b65a: 51 09 sbc r21, r1 b65c: 19 f1 breq .+70 ; 0xb6a4 b65e: f9 01 movw r30, r18 b660: e8 55 subi r30, 0x58 ; 88 b662: 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) ; b664: a1 91 ld r26, Z+ b666: 9f 01 movw r18, r30 b668: 25 5a subi r18, 0xA5 ; 165 b66a: 30 41 sbci r19, 0x10 ; 16 b66c: a1 11 cpse r26, r1 b66e: fa cf rjmp .-12 ; 0xb664 b670: f9 01 movw r30, r18 b672: eb 55 subi r30, 0x5B ; 91 b674: 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) ; b676: 2d 3e cpi r18, 0xED ; 237 b678: a1 e0 ldi r26, 0x01 ; 1 b67a: 3a 07 cpc r19, r26 b67c: 30 f4 brcc .+12 ; 0xb68a b67e: a1 91 ld r26, Z+ b680: a1 11 cpse r26, r1 b682: e0 cf rjmp .-64 ; 0xb644 b684: 2f 5f subi r18, 0xFF ; 255 b686: 3f 4f sbci r19, 0xFF ; 255 b688: f6 cf rjmp .-20 ; 0xb676 // If the end of the buffer was empty, if (_bufindr == sizeof(cmdbuffer)) { b68a: 2d 3e cpi r18, 0xED ; 237 b68c: e1 e0 ldi r30, 0x01 ; 1 b68e: 3e 07 cpc r19, r30 b690: c9 f6 brne .-78 ; 0xb644 b692: e5 ea ldi r30, 0xA5 ; 165 b694: f0 e1 ldi r31, 0x10 ; 16 b696: 9f 01 movw r18, r30 b698: 25 5a subi r18, 0xA5 ; 165 b69a: 30 41 sbci r19, 0x10 ; 16 // skip to the start and find the nonzero command. for (_bufindr = 0; cmdbuffer[_bufindr] == 0; ++ _bufindr) ; b69c: a1 91 ld r26, Z+ b69e: aa 23 and r26, r26 b6a0: d1 f3 breq .-12 ; 0xb696 b6a2: d0 cf rjmp .-96 ; 0xb644 } } return sdlen; } b6a4: 08 95 ret 0000b6a6 : memset((void*)adc_values, 0, sizeof(adc_values)); } static void adc_setmux(uint8_t ch) { ch &= 0x0f; b6a6: 98 2f mov r25, r24 b6a8: 9f 70 andi r25, 0x0F ; 15 if (ch & 0x08) ADCSRB |= (1 << MUX5); b6aa: 83 ff sbrs r24, 3 b6ac: 0d c0 rjmp .+26 ; 0xb6c8 b6ae: 80 91 7b 00 lds r24, 0x007B ; 0x80007b <__TEXT_REGION_LENGTH__+0x7c207b> b6b2: 88 60 ori r24, 0x08 ; 8 else ADCSRB &= ~(1 << MUX5); b6b4: 80 93 7b 00 sts 0x007B, r24 ; 0x80007b <__TEXT_REGION_LENGTH__+0x7c207b> ADMUX = (ADMUX & ~(0x07)) | (ch & 0x07); b6b8: 80 91 7c 00 lds r24, 0x007C ; 0x80007c <__TEXT_REGION_LENGTH__+0x7c207c> b6bc: 88 7f andi r24, 0xF8 ; 248 b6be: 97 70 andi r25, 0x07 ; 7 b6c0: 89 2b or r24, r25 b6c2: 80 93 7c 00 sts 0x007C, r24 ; 0x80007c <__TEXT_REGION_LENGTH__+0x7c207c> } b6c6: 08 95 ret static void adc_setmux(uint8_t ch) { ch &= 0x0f; if (ch & 0x08) ADCSRB |= (1 << MUX5); else ADCSRB &= ~(1 << MUX5); b6c8: 80 91 7b 00 lds r24, 0x007B ; 0x80007b <__TEXT_REGION_LENGTH__+0x7c207b> b6cc: 87 7f andi r24, 0xF7 ; 247 b6ce: f2 cf rjmp .-28 ; 0xb6b4 0000b6d0 : 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)); }; b6d0: 80 91 95 03 lds r24, 0x0395 ; 0x800395 b6d4: 90 91 96 03 lds r25, 0x0396 ; 0x800396 b6d8: 4a e0 ldi r20, 0x0A ; 10 b6da: 50 e0 ldi r21, 0x00 ; 0 b6dc: 70 e0 ldi r23, 0x00 ; 0 b6de: 60 e0 ldi r22, 0x00 ; 0 b6e0: 01 96 adiw r24, 0x01 ; 1 b6e2: 0f 94 a7 d7 call 0x3af4e ; 0x3af4e b6e6: 86 2f mov r24, r22 b6e8: 08 95 ret 0000b6ea : // 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)); }; b6ea: 80 91 95 03 lds r24, 0x0395 ; 0x800395 b6ee: 90 91 96 03 lds r25, 0x0396 ; 0x800396 b6f2: 4a e0 ldi r20, 0x0A ; 10 b6f4: 50 e0 ldi r21, 0x00 ; 0 b6f6: 70 e0 ldi r23, 0x00 ; 0 b6f8: 60 e0 ldi r22, 0x00 ; 0 b6fa: 01 96 adiw r24, 0x01 ; 1 b6fc: 0f 94 a7 d7 call 0x3af4e ; 0x3af4e b700: cb 01 movw r24, r22 b702: 08 95 ret 0000b704 : // 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); } b704: 80 91 95 03 lds r24, 0x0395 ; 0x800395 b708: 90 91 96 03 lds r25, 0x0396 ; 0x800396 b70c: 4a e0 ldi r20, 0x0A ; 10 b70e: 50 e0 ldi r21, 0x00 ; 0 b710: 70 e0 ldi r23, 0x00 ; 0 b712: 60 e0 ldi r22, 0x00 ; 0 b714: 01 96 adiw r24, 0x01 ; 1 b716: 0d 94 a7 d7 jmp 0x3af4e ; 0x3af4e 0000b71a : // 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; b71a: 80 91 9b 04 lds r24, 0x049B ; 0x80049b b71e: 90 91 9c 04 lds r25, 0x049C ; 0x80049c b722: 90 93 9a 04 sts 0x049A, r25 ; 0x80049a b726: 80 93 99 04 sts 0x0499, r24 ; 0x800499 void FlushSerialRequestResend() { //char cmdbuffer[bufindr][100]="Resend:"; MYSERIAL.flush(); printf_P(_N("%S: %ld\n%S\n"), _n("Resend"), gcode_LastN + 1, MSG_OK); b72a: 8b eb ldi r24, 0xBB ; 187 b72c: 9d e6 ldi r25, 0x6D ; 109 b72e: 9f 93 push r25 b730: 8f 93 push r24 b732: 80 91 7a 03 lds r24, 0x037A ; 0x80037a b736: 90 91 7b 03 lds r25, 0x037B ; 0x80037b b73a: a0 91 7c 03 lds r26, 0x037C ; 0x80037c b73e: b0 91 7d 03 lds r27, 0x037D ; 0x80037d b742: 01 96 adiw r24, 0x01 ; 1 b744: a1 1d adc r26, r1 b746: b1 1d adc r27, r1 b748: bf 93 push r27 b74a: af 93 push r26 b74c: 9f 93 push r25 b74e: 8f 93 push r24 b750: 87 e6 ldi r24, 0x67 ; 103 b752: 96 e6 ldi r25, 0x66 ; 102 b754: 9f 93 push r25 b756: 8f 93 push r24 b758: 8e e6 ldi r24, 0x6E ; 110 b75a: 96 e6 ldi r25, 0x66 ; 102 b75c: 9f 93 push r25 b75e: 8f 93 push r24 b760: 0f 94 de da call 0x3b5bc ; 0x3b5bc b764: 8d b7 in r24, 0x3d ; 61 b766: 9e b7 in r25, 0x3e ; 62 b768: 0a 96 adiw r24, 0x0a ; 10 b76a: 0f b6 in r0, 0x3f ; 63 b76c: f8 94 cli b76e: 9e bf out 0x3e, r25 ; 62 b770: 0f be out 0x3f, r0 ; 63 b772: 8d bf out 0x3d, r24 ; 61 } b774: 08 95 ret 0000b776 : 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) { b776: 0f 93 push r16 b778: 1f 93 push r17 b77a: cf 93 push r28 b77c: df 93 push r29 b77e: ec 01 movw r28, r24 b780: c6 0f add r28, r22 b782: d7 1f adc r29, r23 const uint8_t *p = (const uint8_t*)__p; while (__n--) { b784: 8c 17 cp r24, r28 b786: 9d 07 cpc r25, r29 b788: 79 f0 breq .+30 ; 0xb7a8 if (eeprom_read_byte(p++) != EEPROM_EMPTY_VALUE) b78a: 8c 01 movw r16, r24 b78c: 0f 5f subi r16, 0xFF ; 255 b78e: 1f 4f sbci r17, 0xFF ; 255 b790: 0f 94 1c dc call 0x3b838 ; 0x3b838 b794: 8f 3f cpi r24, 0xFF ; 255 b796: 31 f0 breq .+12 ; 0xb7a4 return true; b798: 81 e0 ldi r24, 0x01 ; 1 } return false; } b79a: df 91 pop r29 b79c: cf 91 pop r28 b79e: 1f 91 pop r17 b7a0: 0f 91 pop r16 b7a2: 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) b7a4: c8 01 movw r24, r16 b7a6: ee cf rjmp .-36 ; 0xb784 return true; } return false; b7a8: 80 e0 ldi r24, 0x00 ; 0 b7aa: f7 cf rjmp .-18 ; 0xb79a 0000b7ac : #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; } b7ac: 68 2f mov r22, r24 b7ae: 88 0f add r24, r24 b7b0: 77 0b sbc r23, r23 b7b2: 80 91 92 12 lds r24, 0x1292 ; 0x801292 b7b6: 90 91 93 12 lds r25, 0x1293 ; 0x801293 b7ba: 88 55 subi r24, 0x58 ; 88 b7bc: 9f 4e sbci r25, 0xEF ; 239 b7be: 0f 94 73 e2 call 0x3c4e6 ; 0x3c4e6 b7c2: 9c 01 movw r18, r24 b7c4: 90 93 96 03 sts 0x0396, r25 ; 0x800396 b7c8: 80 93 95 03 sts 0x0395, r24 ; 0x800395 b7cc: 81 e0 ldi r24, 0x01 ; 1 b7ce: 23 2b or r18, r19 b7d0: 09 f4 brne .+2 ; 0xb7d4 b7d2: 80 e0 ldi r24, 0x00 ; 0 b7d4: 08 95 ret 0000b7d6 : #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 { b7d6: 0f 93 push r16 b7d8: 1f 93 push r17 b7da: cf 93 push r28 b7dc: df 93 push r29 b7de: 8c 01 movw r16, r24 b7e0: 86 2f mov r24, r22 b7e2: ea 01 movw r28, r20 if (code_seen(code)) { b7e4: 0e 94 d6 5b call 0xb7ac ; 0xb7ac b7e8: 88 23 and r24, r24 b7ea: 19 f1 breq .+70 ; 0xb832 // Verify value is within allowed range int16_t temp = code_value_short(); b7ec: 0e 94 75 5b call 0xb6ea ; 0xb6ea if (abs(temp) > BED_ADJUSTMENT_UM_MAX) { b7f0: 9c 01 movw r18, r24 b7f2: 97 ff sbrs r25, 7 b7f4: 03 c0 rjmp .+6 ; 0xb7fc b7f6: 31 95 neg r19 b7f8: 21 95 neg r18 b7fa: 31 09 sbc r19, r1 b7fc: 25 36 cpi r18, 0x65 ; 101 b7fe: 31 05 cpc r19, r1 b800: 9c f0 brlt .+38 ; 0xb828 printf_P(PSTR("%SExcessive bed leveling correction: %i microns\n"), errormagic, temp); b802: 9f 93 push r25 b804: 8f 93 push r24 b806: 8a e9 ldi r24, 0x9A ; 154 b808: 9b ea ldi r25, 0xAB ; 171 b80a: 9f 93 push r25 b80c: 8f 93 push r24 b80e: 83 e6 ldi r24, 0x63 ; 99 b810: 9c e7 ldi r25, 0x7C ; 124 b812: 9f 93 push r25 b814: 8f 93 push r24 b816: 0f 94 de da call 0x3b5bc ; 0x3b5bc b81a: 0f 90 pop r0 b81c: 0f 90 pop r0 b81e: 0f 90 pop r0 b820: 0f 90 pop r0 b822: 0f 90 pop r0 b824: 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; b826: 80 e0 ldi r24, 0x00 ; 0 }; b828: df 91 pop r29 b82a: cf 91 pop r28 b82c: 1f 91 pop r17 b82e: 0f 91 pop r16 b830: 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) { b832: f8 01 movw r30, r16 b834: 80 81 ld r24, Z b836: 88 23 and r24, r24 b838: b1 f3 breq .-20 ; 0xb826 return (int8_t)eeprom_read_byte(eep_address); b83a: ce 01 movw r24, r28 } return 0; }; b83c: df 91 pop r29 b83e: cf 91 pop r28 b840: 1f 91 pop r17 b842: 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); b844: 0d 94 1c dc jmp 0x3b838 ; 0x3b838 0000b848 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); b848: 60 e0 ldi r22, 0x00 ; 0 b84a: 86 e6 ldi r24, 0x66 ; 102 b84c: 9f e0 ldi r25, 0x0F ; 15 b84e: 0f 94 40 dc call 0x3b880 ; 0x3b880 b852: 60 e0 ldi r22, 0x00 ; 0 b854: 88 e6 ldi r24, 0x68 ; 104 b856: 9f e0 ldi r25, 0x0F ; 15 b858: 0f 94 40 dc call 0x3b880 ; 0x3b880 b85c: 60 e0 ldi r22, 0x00 ; 0 b85e: 85 e6 ldi r24, 0x65 ; 101 b860: 9f e0 ldi r25, 0x0F ; 15 b862: 0f 94 40 dc call 0x3b880 ; 0x3b880 b866: 60 e0 ldi r22, 0x00 ; 0 b868: 84 e6 ldi r24, 0x64 ; 100 b86a: 9f e0 ldi r25, 0x0F ; 15 b86c: 0f 94 40 dc call 0x3b880 ; 0x3b880 b870: 60 e0 ldi r22, 0x00 ; 0 b872: 82 ed ldi r24, 0xD2 ; 210 b874: 9e e0 ldi r25, 0x0E ; 14 b876: 0f 94 40 dc call 0x3b880 ; 0x3b880 b87a: 60 e0 ldi r22, 0x00 ; 0 b87c: 8f ec ldi r24, 0xCF ; 207 b87e: 9e e0 ldi r25, 0x0E ; 14 b880: 0d 94 40 dc jmp 0x3b880 ; 0x3b880 0000b884 : // 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) b884: 80 36 cpi r24, 0x60 ; 96 b886: 91 05 cpc r25, r1 b888: f8 f4 brcc .+62 ; 0xb8c8 return false; if (bufindr == bufindw && buflen > 0) b88a: 40 91 92 12 lds r20, 0x1292 ; 0x801292 b88e: 50 91 93 12 lds r21, 0x1293 ; 0x801293 b892: 20 91 a0 10 lds r18, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.550> b896: 30 91 a1 10 lds r19, 0x10A1 ; 0x8010a1 <_ZL7bufindw.lto_priv.550+0x1> b89a: 42 17 cp r20, r18 b89c: 53 07 cpc r21, r19 b89e: 39 f4 brne .+14 ; 0xb8ae b8a0: 60 91 a3 10 lds r22, 0x10A3 ; 0x8010a3 b8a4: 70 91 a4 10 lds r23, 0x10A4 ; 0x8010a4 b8a8: 16 16 cp r1, r22 b8aa: 17 06 cpc r1, r23 b8ac: 6c f0 brlt .+26 ; 0xb8c8 // 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); b8ae: b9 01 movw r22, r18 b8b0: 68 0f add r22, r24 b8b2: 79 1f adc r23, r25 b8b4: fb 01 movw r30, r22 b8b6: e3 59 subi r30, 0x93 ; 147 b8b8: ff 4f sbci r31, 0xFF ; 255 if (bufindw < bufindr) b8ba: 24 17 cp r18, r20 b8bc: 35 07 cpc r19, r21 b8be: 30 f4 brcc .+12 ; 0xb8cc // Simple case. There is a contiguous space between the write buffer and the read buffer. return endw + CMDBUFFER_RESERVE_FRONT <= bufindr; b8c0: 81 e0 ldi r24, 0x01 ; 1 b8c2: 4e 17 cp r20, r30 b8c4: 5f 07 cpc r21, r31 b8c6: 08 f4 brcc .+2 ; 0xb8ca // 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; b8c8: 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; } b8ca: 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? b8cc: ee 3e cpi r30, 0xEE ; 238 b8ce: f1 40 sbci r31, 0x01 ; 1 b8d0: f8 f0 brcs .+62 ; 0xb910 // 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); b8d2: 6c 5f subi r22, 0xFC ; 252 b8d4: 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) || b8d6: 6e 3e cpi r22, 0xEE ; 238 b8d8: 71 40 sbci r23, 0x01 ; 1 b8da: 18 f4 brcc .+6 ; 0xb8e2 // Could one fit to the end, and the reserve to the start? (endw <= sizeof(cmdbuffer) && CMDBUFFER_RESERVE_FRONT <= bufindr)) b8dc: 49 36 cpi r20, 0x69 ; 105 b8de: 51 05 cpc r21, r1 b8e0: b8 f4 brcc .+46 ; 0xb910 return true; // Could one fit both to the start? if (len_asked + (1 + CMDHDRSIZE) + CMDBUFFER_RESERVE_FRONT <= bufindr) { b8e2: 83 59 subi r24, 0x93 ; 147 b8e4: 9f 4f sbci r25, 0xFF ; 255 b8e6: 48 17 cp r20, r24 b8e8: 59 07 cpc r21, r25 b8ea: 70 f3 brcs .-36 ; 0xb8c8 // Mark the rest of the buffer as used. memset(cmdbuffer+bufindw, 0, sizeof(cmdbuffer)-bufindw); b8ec: 4d ee ldi r20, 0xED ; 237 b8ee: 51 e0 ldi r21, 0x01 ; 1 b8f0: 42 1b sub r20, r18 b8f2: 53 0b sbc r21, r19 b8f4: 70 e0 ldi r23, 0x00 ; 0 b8f6: 60 e0 ldi r22, 0x00 ; 0 b8f8: c9 01 movw r24, r18 b8fa: 8b 55 subi r24, 0x5B ; 91 b8fc: 9f 4e sbci r25, 0xEF ; 239 b8fe: 0f 94 4e e2 call 0x3c49c ; 0x3c49c // 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; } b902: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); b904: f8 94 cli b906: 10 92 a1 10 sts 0x10A1, r1 ; 0x8010a1 <_ZL7bufindw.lto_priv.550+0x1> b90a: 10 92 a0 10 sts 0x10A0, r1 ; 0x8010a0 <_ZL7bufindw.lto_priv.550> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; b90e: 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; b910: 81 e0 ldi r24, 0x01 ; 1 b912: 08 95 ret 0000b914 : //we have no temp compensation data } } #endif //ndef PINDA_THERMISTOR float temp_comp_interpolation(float inp_temperature) { b914: 2f 92 push r2 b916: 3f 92 push r3 b918: 4f 92 push r4 b91a: 5f 92 push r5 b91c: 6f 92 push r6 b91e: 7f 92 push r7 b920: 8f 92 push r8 b922: 9f 92 push r9 b924: af 92 push r10 b926: bf 92 push r11 b928: cf 92 push r12 b92a: df 92 push r13 b92c: ef 92 push r14 b92e: ff 92 push r15 b930: 0f 93 push r16 b932: 1f 93 push r17 b934: cf 93 push r28 b936: df 93 push r29 b938: cd b7 in r28, 0x3d ; 61 b93a: de b7 in r29, 0x3e ; 62 b93c: cc 58 subi r28, 0x8C ; 140 b93e: d2 40 sbci r29, 0x02 ; 2 b940: 0f b6 in r0, 0x3f ; 63 b942: f8 94 cli b944: de bf out 0x3e, r29 ; 62 b946: 0f be out 0x3f, r0 ; 63 b948: cd bf out 0x3d, r28 ; 61 b94a: cb 58 subi r28, 0x8B ; 139 b94c: dd 4f sbci r29, 0xFD ; 253 b94e: 68 83 st Y, r22 b950: 79 83 std Y+1, r23 ; 0x01 b952: 8a 83 std Y+2, r24 ; 0x02 b954: 9b 83 std Y+3, r25 ; 0x03 b956: c5 57 subi r28, 0x75 ; 117 b958: 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; b95a: fe 01 movw r30, r28 b95c: e7 54 subi r30, 0x47 ; 71 b95e: fe 4f sbci r31, 0xFE ; 254 b960: 88 e2 ldi r24, 0x28 ; 40 b962: df 01 movw r26, r30 b964: 1d 92 st X+, r1 b966: 8a 95 dec r24 b968: e9 f7 brne .-6 ; 0xb964 b96a: e8 5b subi r30, 0xB8 ; 184 b96c: f1 40 sbci r31, 0x01 ; 1 b96e: 1f 01 movw r2, r30 b970: 80 e9 ldi r24, 0x90 ; 144 b972: 91 e0 ldi r25, 0x01 ; 1 b974: df 01 movw r26, r30 b976: fc 01 movw r30, r24 b978: 1d 92 st X+, r1 b97a: 31 97 sbiw r30, 0x01 ; 1 b97c: e9 f7 brne .-6 ; 0xb978 int shift[10]; int temp_C[10]; n = 6; //number of measured points shift[0] = 0; b97e: c7 5a subi r28, 0xA7 ; 167 b980: dd 4f sbci r29, 0xFD ; 253 b982: 19 82 std Y+1, r1 ; 0x01 b984: 18 82 st Y, r1 b986: c9 55 subi r28, 0x59 ; 89 b988: d2 40 sbci r29, 0x02 ; 2 b98a: 9e 01 movw r18, r28 b98c: 2f 51 subi r18, 0x1F ; 31 b98e: 3e 4f sbci r19, 0xFE ; 254 b990: c1 59 subi r28, 0x91 ; 145 b992: dd 4f sbci r29, 0xFD ; 253 b994: 39 83 std Y+1, r19 ; 0x01 b996: 28 83 st Y, r18 b998: cf 56 subi r28, 0x6F ; 111 b99a: d2 40 sbci r29, 0x02 ; 2 b99c: 8e 01 movw r16, r28 b99e: 07 5a subi r16, 0xA7 ; 167 b9a0: 1d 4f sbci r17, 0xFD ; 253 b9a2: ce 01 movw r24, r28 b9a4: 8f 5c subi r24, 0xCF ; 207 b9a6: 9d 4f sbci r25, 0xFD ; 253 b9a8: c3 59 subi r28, 0x93 ; 147 b9aa: dd 4f sbci r29, 0xFD ; 253 b9ac: 99 83 std Y+1, r25 ; 0x01 b9ae: 88 83 st Y, r24 b9b0: cd 56 subi r28, 0x6D ; 109 b9b2: d2 40 sbci r29, 0x02 ; 2 b9b4: 3c 01 movw r6, r24 b9b6: 49 01 movw r8, r18 b9b8: 40 eb ldi r20, 0xB0 ; 176 b9ba: a4 2e mov r10, r20 b9bc: 4f e0 ldi r20, 0x0F ; 15 b9be: b4 2e mov r11, r20 b9c0: 53 e2 ldi r21, 0x23 ; 35 b9c2: c5 2e mov r12, r21 b9c4: d1 2c mov r13, r1 for (i = 0; i < n; i++) { b9c6: f1 2c mov r15, r1 b9c8: 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]; b9ca: b6 01 movw r22, r12 b9cc: 0d 2c mov r0, r13 b9ce: 00 0c add r0, r0 b9d0: 88 0b sbc r24, r24 b9d2: 99 0b sbc r25, r25 b9d4: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> b9d8: d4 01 movw r26, r8 b9da: 6d 93 st X+, r22 b9dc: 7d 93 st X+, r23 b9de: 8d 93 st X+, r24 b9e0: 9d 93 st X+, r25 b9e2: 4d 01 movw r8, r26 f[i] = (float)shift[i]; b9e4: f8 01 movw r30, r16 b9e6: 61 91 ld r22, Z+ b9e8: 71 91 ld r23, Z+ b9ea: 8f 01 movw r16, r30 b9ec: 07 2e mov r0, r23 b9ee: 00 0c add r0, r0 b9f0: 88 0b sbc r24, r24 b9f2: 99 0b sbc r25, r25 b9f4: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> b9f8: d3 01 movw r26, r6 b9fa: 6d 93 st X+, r22 b9fc: 7d 93 st X+, r23 b9fe: 8d 93 st X+, r24 ba00: 9d 93 st X+, r25 ba02: 3d 01 movw r6, r26 int temp_C[10]; n = 6; //number of measured points shift[0] = 0; for (i = 0; i < n; i++) { ba04: bf ef ldi r27, 0xFF ; 255 ba06: eb 1a sub r14, r27 ba08: fb 0a sbc r15, r27 ba0a: e6 e0 ldi r30, 0x06 ; 6 ba0c: ee 16 cp r14, r30 ba0e: f1 04 cpc r15, r1 ba10: 09 f0 breq .+2 ; 0xba14 ba12: 38 c3 rjmp .+1648 ; 0xc084 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; ba14: cb 58 subi r28, 0x8B ; 139 ba16: dd 4f sbci r29, 0xFD ; 253 ba18: 28 81 ld r18, Y ba1a: 39 81 ldd r19, Y+1 ; 0x01 ba1c: 4a 81 ldd r20, Y+2 ; 0x02 ba1e: 5b 81 ldd r21, Y+3 ; 0x03 ba20: c5 57 subi r28, 0x75 ; 117 ba22: d2 40 sbci r29, 0x02 ; 2 ba24: c1 59 subi r28, 0x91 ; 145 ba26: dd 4f sbci r29, 0xFD ; 253 ba28: a8 81 ld r26, Y ba2a: b9 81 ldd r27, Y+1 ; 0x01 ba2c: cf 56 subi r28, 0x6F ; 111 ba2e: d2 40 sbci r29, 0x02 ; 2 ba30: 6d 91 ld r22, X+ ba32: 7d 91 ld r23, X+ ba34: 8d 91 ld r24, X+ ba36: 9c 91 ld r25, X ba38: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> ba3c: 41 2c mov r4, r1 ba3e: 51 2c mov r5, r1 ba40: 32 01 movw r6, r4 ba42: 18 16 cp r1, r24 ba44: 0c f4 brge .+2 ; 0xba48 ba46: 02 c3 rjmp .+1540 ; 0xc04c ba48: c3 59 subi r28, 0x93 ; 147 ba4a: dd 4f sbci r29, 0xFD ; 253 ba4c: 08 81 ld r16, Y ba4e: 19 81 ldd r17, Y+1 ; 0x01 ba50: cd 56 subi r28, 0x6D ; 109 ba52: d2 40 sbci r29, 0x02 ; 2 ba54: 0c 5e subi r16, 0xEC ; 236 ba56: 1f 4f sbci r17, 0xFF ; 255 ba58: c1 59 subi r28, 0x91 ; 145 ba5a: dd 4f sbci r29, 0xFD ; 253 ba5c: e8 80 ld r14, Y ba5e: f9 80 ldd r15, Y+1 ; 0x01 ba60: cf 56 subi r28, 0x6F ; 111 ba62: d2 40 sbci r29, 0x02 ; 2 ba64: b4 e1 ldi r27, 0x14 ; 20 ba66: eb 0e add r14, r27 ba68: f1 1c adc r15, r1 ba6a: 6e 01 movw r12, r28 ba6c: ef ed ldi r30, 0xDF ; 223 ba6e: ce 1a sub r12, r30 ba70: ed ef ldi r30, 0xFD ; 253 ba72: de 0a sbc r13, r30 ba74: 9e 01 movw r18, r28 ba76: 2b 55 subi r18, 0x5B ; 91 ba78: 3e 4f sbci r19, 0xFE ; 254 ba7a: cf 58 subi r28, 0x8F ; 143 ba7c: dd 4f sbci r29, 0xFD ; 253 ba7e: 39 83 std Y+1, r19 ; 0x01 ba80: 28 83 st Y, r18 ba82: c1 57 subi r28, 0x71 ; 113 ba84: 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]); ba86: d8 01 movw r26, r16 ba88: 4d 90 ld r4, X+ ba8a: 5d 90 ld r5, X+ ba8c: 6d 90 ld r6, X+ ba8e: 7c 90 ld r7, X ba90: f7 01 movw r30, r14 ba92: 60 81 ld r22, Z ba94: 71 81 ldd r23, Z+1 ; 0x01 ba96: 82 81 ldd r24, Z+2 ; 0x02 ba98: 93 81 ldd r25, Z+3 ; 0x03 ba9a: d7 01 movw r26, r14 ba9c: 5e 91 ld r21, -X ba9e: 4e 91 ld r20, -X baa0: 3e 91 ld r19, -X baa2: 2e 91 ld r18, -X baa4: 7d 01 movw r14, r26 baa6: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> baaa: 4b 01 movw r8, r22 baac: 5c 01 movw r10, r24 baae: f8 01 movw r30, r16 bab0: 52 91 ld r21, -Z bab2: 42 91 ld r20, -Z bab4: 32 91 ld r19, -Z bab6: 22 91 ld r18, -Z bab8: 8f 01 movw r16, r30 baba: c3 01 movw r24, r6 babc: b2 01 movw r22, r4 babe: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> bac2: a5 01 movw r20, r10 bac4: 94 01 movw r18, r8 bac6: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> baca: d6 01 movw r26, r12 bacc: 9e 93 st -X, r25 bace: 8e 93 st -X, r24 bad0: 7e 93 st -X, r23 bad2: 6e 93 st -X, r22 bad4: 6d 01 movw r12, r26 h[i - 1] = x[i] - x[i - 1]; bad6: cf 58 subi r28, 0x8F ; 143 bad8: dd 4f sbci r29, 0xFD ; 253 bada: e8 81 ld r30, Y badc: f9 81 ldd r31, Y+1 ; 0x01 bade: c1 57 subi r28, 0x71 ; 113 bae0: d2 40 sbci r29, 0x02 ; 2 bae2: b2 92 st -Z, r11 bae4: a2 92 st -Z, r10 bae6: 92 92 st -Z, r9 bae8: 82 92 st -Z, r8 baea: cf 58 subi r28, 0x8F ; 143 baec: dd 4f sbci r29, 0xFD ; 253 baee: f9 83 std Y+1, r31 ; 0x01 baf0: e8 83 st Y, r30 baf2: c1 57 subi r28, 0x71 ; 113 baf4: 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--) { baf6: c3 59 subi r28, 0x93 ; 147 baf8: dd 4f sbci r29, 0xFD ; 253 bafa: 28 81 ld r18, Y bafc: 39 81 ldd r19, Y+1 ; 0x01 bafe: cd 56 subi r28, 0x6D ; 109 bb00: d2 40 sbci r29, 0x02 ; 2 bb02: 02 17 cp r16, r18 bb04: 13 07 cpc r17, r19 bb06: 09 f0 breq .+2 ; 0xbb0a bb08: be cf rjmp .-132 ; 0xba86 bb0a: 4e 01 movw r8, r28 bb0c: 3f e6 ldi r19, 0x6F ; 111 bb0e: 83 1a sub r8, r19 bb10: 3e ef ldi r19, 0xFE ; 254 bb12: 93 0a sbc r9, r19 bb14: 5e 01 movw r10, r28 bb16: 83 ef ldi r24, 0xF3 ; 243 bb18: a8 1a sub r10, r24 bb1a: 8d ef ldi r24, 0xFD ; 253 bb1c: b8 0a sbc r11, r24 bb1e: 61 01 movw r12, r2 bb20: 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 bb44: 9b 01 movw r18, r22 bb46: ac 01 movw r20, r24 bb48: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> bb4c: f8 01 movw r30, r16 bb4e: 64 a7 std Z+44, r22 ; 0x2c bb50: 75 a7 std Z+45, r23 ; 0x2d bb52: 86 a7 std Z+46, r24 ; 0x2e bb54: 97 a7 std Z+47, r25 ; 0x2f if (i != 1) { bb56: f1 e0 ldi r31, 0x01 ; 1 bb58: ef 16 cp r14, r31 bb5a: f1 04 cpc r15, r1 bb5c: 61 f0 breq .+24 ; 0xbb76 m[i][i - 1] = h[i - 1]; bb5e: d8 01 movw r26, r16 bb60: 98 96 adiw r26, 0x28 ; 40 bb62: 4d 92 st X+, r4 bb64: 5d 92 st X+, r5 bb66: 6d 92 st X+, r6 bb68: 7c 92 st X, r7 bb6a: 9b 97 sbiw r26, 0x2b ; 43 m[i - 1][i] = h[i - 1]; bb6c: f8 01 movw r30, r16 bb6e: 44 82 std Z+4, r4 ; 0x04 bb70: 55 82 std Z+5, r5 ; 0x05 bb72: 66 82 std Z+6, r6 ; 0x06 bb74: 77 82 std Z+7, r7 ; 0x07 } m[i][n - 1] = 6 * (F[i + 1] - F[i]); bb76: ff ef ldi r31, 0xFF ; 255 bb78: ef 1a sub r14, r31 bb7a: ff 0a sbc r15, r31 bb7c: f5 01 movw r30, r10 bb7e: 20 81 ld r18, Z bb80: 31 81 ldd r19, Z+1 ; 0x01 bb82: 42 81 ldd r20, Z+2 ; 0x02 bb84: 53 81 ldd r21, Z+3 ; 0x03 bb86: 84 e0 ldi r24, 0x04 ; 4 bb88: a8 0e add r10, r24 bb8a: b1 1c adc r11, r1 bb8c: 64 81 ldd r22, Z+4 ; 0x04 bb8e: 75 81 ldd r23, Z+5 ; 0x05 bb90: 86 81 ldd r24, Z+6 ; 0x06 bb92: 97 81 ldd r25, Z+7 ; 0x07 bb94: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> bb98: 20 e0 ldi r18, 0x00 ; 0 bb9a: 30 e0 ldi r19, 0x00 ; 0 bb9c: 40 ec ldi r20, 0xC0 ; 192 bb9e: 50 e4 ldi r21, 0x40 ; 64 bba0: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> bba4: d6 01 movw r26, r12 bba6: dc 96 adiw r26, 0x3c ; 60 bba8: 6d 93 st X+, r22 bbaa: 7d 93 st X+, r23 bbac: 8d 93 st X+, r24 bbae: 9c 93 st X, r25 bbb0: df 97 sbiw r26, 0x3f ; 63 bbb2: 04 5d subi r16, 0xD4 ; 212 bbb4: 1f 4f sbci r17, 0xFF ; 255 bbb6: b8 e2 ldi r27, 0x28 ; 40 bbb8: cb 0e add r12, r27 bbba: 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 bbc4: b1 cf rjmp .-158 ; 0xbb28 bbc6: 7e 01 movw r14, r28 bbc8: fd e2 ldi r31, 0x2D ; 45 bbca: ef 0e add r14, r31 bbcc: f1 1c adc r15, r1 bbce: 28 e2 ldi r18, 0x28 ; 40 bbd0: a2 2e mov r10, r18 bbd2: b1 2c mov r11, r1 bbd4: 00 eb ldi r16, 0xB0 ; 176 bbd6: 1f ef ldi r17, 0xFF ; 255 bbd8: 24 e0 ldi r18, 0x04 ; 4 bbda: 22 0e add r2, r18 bbdc: 31 1c adc r3, r1 } m[i][n - 1] = 6 * (F[i + 1] - F[i]); } //*********** forward elimination ************** for (i = 1; i bbfa: 2b 01 movw r4, r22 bbfc: 3c 01 movw r6, r24 bbfe: 61 01 movw r12, r2 bc00: c0 1a sub r12, r16 bc02: d1 0a sbc r13, r17 for (j = 1; j <= n - 1; j++) bc04: 88 24 eor r8, r8 bc06: 83 94 inc r8 bc08: 91 2c mov r9, r1 m[i + 1][j] -= temp*m[i][j]; bc0a: f6 01 movw r30, r12 bc0c: e0 0f add r30, r16 bc0e: f1 1f adc r31, r17 bc10: ea 0d add r30, r10 bc12: fb 1d adc r31, r11 bc14: 20 81 ld r18, Z bc16: 31 81 ldd r19, Z+1 ; 0x01 bc18: 42 81 ldd r20, Z+2 ; 0x02 bc1a: 53 81 ldd r21, Z+3 ; 0x03 bc1c: c3 01 movw r24, r6 bc1e: b2 01 movw r22, r4 bc20: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> bc24: 9b 01 movw r18, r22 bc26: ac 01 movw r20, r24 bc28: f6 01 movw r30, r12 bc2a: 60 81 ld r22, Z bc2c: 71 81 ldd r23, Z+1 ; 0x01 bc2e: 82 81 ldd r24, Z+2 ; 0x02 bc30: 93 81 ldd r25, Z+3 ; 0x03 bc32: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> bc36: d6 01 movw r26, r12 bc38: 6d 93 st X+, r22 bc3a: 7d 93 st X+, r23 bc3c: 8d 93 st X+, r24 bc3e: 9d 93 st X+, r25 bc40: 6d 01 movw r12, r26 m[i][n - 1] = 6 * (F[i + 1] - F[i]); } //*********** forward elimination ************** for (i = 1; i bc50: 3c e2 ldi r19, 0x2C ; 44 bc52: e3 0e add r14, r19 bc54: f1 1c adc r15, r1 bc56: 08 52 subi r16, 0x28 ; 40 bc58: 11 09 sbc r17, r1 bc5a: 88 e2 ldi r24, 0x28 ; 40 bc5c: a8 0e add r10, r24 bc5e: 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 bc68: ba cf rjmp .-140 ; 0xbbde bc6a: 1e 01 movw r2, r28 bc6c: f5 eb ldi r31, 0xB5 ; 181 bc6e: 2f 0e add r2, r31 bc70: 31 1c adc r3, r1 bc72: 6e 01 movw r12, r28 bc74: 21 eb ldi r18, 0xB1 ; 177 bc76: c2 0e add r12, r18 bc78: d1 1c adc r13, r1 bc7a: 7e 01 movw r14, r28 bc7c: 37 e3 ldi r19, 0x37 ; 55 bc7e: e3 1a sub r14, r19 bc80: 3e ef ldi r19, 0xFE ; 254 bc82: 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--) { bc84: 04 e0 ldi r16, 0x04 ; 4 bc86: 10 e0 ldi r17, 0x00 ; 0 bc88: 48 01 movw r8, r16 bc8a: b1 2c mov r11, r1 bc8c: a1 2c mov r10, r1 sum = 0; bc8e: 41 2c mov r4, r1 bc90: 51 2c mov r5, r1 bc92: 32 01 movw r6, r4 for (j = i; j <= n - 2; j++) sum += m[i][j] * s[j]; bc94: f6 01 movw r30, r12 bc96: ea 0d add r30, r10 bc98: fb 1d adc r31, r11 bc9a: d7 01 movw r26, r14 bc9c: aa 0d add r26, r10 bc9e: bb 1d adc r27, r11 bca0: 2d 91 ld r18, X+ bca2: 3d 91 ld r19, X+ bca4: 4d 91 ld r20, X+ bca6: 5c 91 ld r21, X bca8: 60 81 ld r22, Z bcaa: 71 81 ldd r23, Z+1 ; 0x01 bcac: 82 81 ldd r24, Z+2 ; 0x02 bcae: 93 81 ldd r25, Z+3 ; 0x03 bcb0: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> bcb4: 9b 01 movw r18, r22 bcb6: ac 01 movw r20, r24 bcb8: c3 01 movw r24, r6 bcba: b2 01 movw r22, r4 bcbc: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> bcc0: 2b 01 movw r4, r22 bcc2: 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++) bcc4: 8f ef ldi r24, 0xFF ; 255 bcc6: 88 1a sub r8, r24 bcc8: 98 0a sbc r9, r24 bcca: 94 e0 ldi r25, 0x04 ; 4 bccc: a9 0e add r10, r25 bcce: b1 1c adc r11, r1 bcd0: a5 e0 ldi r26, 0x05 ; 5 bcd2: 8a 16 cp r8, r26 bcd4: 91 04 cpc r9, r1 bcd6: f1 f6 brne .-68 ; 0xbc94 sum += m[i][j] * s[j]; s[i] = (m[i][n - 1] - sum) / m[i][i]; bcd8: a3 01 movw r20, r6 bcda: 92 01 movw r18, r4 bcdc: f1 01 movw r30, r2 bcde: 60 81 ld r22, Z bce0: 71 81 ldd r23, Z+1 ; 0x01 bce2: 82 81 ldd r24, Z+2 ; 0x02 bce4: 93 81 ldd r25, Z+3 ; 0x03 bce6: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> bcea: d6 01 movw r26, r12 bcec: 2d 91 ld r18, X+ bcee: 3d 91 ld r19, X+ bcf0: 4d 91 ld r20, X+ bcf2: 5c 91 ld r21, X bcf4: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> bcf8: f7 01 movw r30, r14 bcfa: 60 83 st Z, r22 bcfc: 71 83 std Z+1, r23 ; 0x01 bcfe: 82 83 std Z+2, r24 ; 0x02 bd00: 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--) { bd02: 01 50 subi r16, 0x01 ; 1 bd04: 11 09 sbc r17, r1 bd06: f8 e2 ldi r31, 0x28 ; 40 bd08: 2f 1a sub r2, r31 bd0a: 31 08 sbc r3, r1 bd0c: 2c e2 ldi r18, 0x2C ; 44 bd0e: c2 1a sub r12, r18 bd10: d1 08 sbc r13, r1 bd12: 34 e0 ldi r19, 0x04 ; 4 bd14: e3 1a sub r14, r19 bd16: f1 08 sbc r15, r1 bd18: 01 15 cp r16, r1 bd1a: 11 05 cpc r17, r1 bd1c: 09 f0 breq .+2 ; 0xbd20 bd1e: b4 cf rjmp .-152 ; 0xbc88 sum += m[i][j] * s[j]; s[i] = (m[i][n - 1] - sum) / m[i][i]; } for (i = 0; i x[i + 1])) { bd20: cb 50 subi r28, 0x0B ; 11 bd22: de 4f sbci r29, 0xFE ; 254 bd24: 88 81 ld r24, Y bd26: 99 81 ldd r25, Y+1 ; 0x01 bd28: aa 81 ldd r26, Y+2 ; 0x02 bd2a: bb 81 ldd r27, Y+3 ; 0x03 bd2c: c5 5f subi r28, 0xF5 ; 245 bd2e: d1 40 sbci r29, 0x01 ; 1 bd30: cf 57 subi r28, 0x7F ; 127 bd32: dd 4f sbci r29, 0xFD ; 253 bd34: 88 83 st Y, r24 bd36: 99 83 std Y+1, r25 ; 0x01 bd38: aa 83 std Y+2, r26 ; 0x02 bd3a: bb 83 std Y+3, r27 ; 0x03 bd3c: c1 58 subi r28, 0x81 ; 129 bd3e: d2 40 sbci r29, 0x02 ; 2 bd40: 1e 01 movw r2, r28 bd42: 97 e4 ldi r25, 0x47 ; 71 bd44: 29 1a sub r2, r25 bd46: 9e ef ldi r25, 0xFE ; 254 bd48: 39 0a sbc r3, r25 bd4a: 10 e0 ldi r17, 0x00 ; 0 bd4c: 00 e0 ldi r16, 0x00 ; 0 bd4e: c1 59 subi r28, 0x91 ; 145 bd50: dd 4f sbci r29, 0xFD ; 253 bd52: a8 81 ld r26, Y bd54: b9 81 ldd r27, Y+1 ; 0x01 bd56: cf 56 subi r28, 0x6F ; 111 bd58: d2 40 sbci r29, 0x02 ; 2 bd5a: cd 90 ld r12, X+ bd5c: dd 90 ld r13, X+ bd5e: ed 90 ld r14, X+ bd60: fd 90 ld r15, X+ bd62: c1 59 subi r28, 0x91 ; 145 bd64: dd 4f sbci r29, 0xFD ; 253 bd66: b9 83 std Y+1, r27 ; 0x01 bd68: a8 83 st Y, r26 bd6a: cf 56 subi r28, 0x6F ; 111 bd6c: d2 40 sbci r29, 0x02 ; 2 bd6e: cb 58 subi r28, 0x8B ; 139 bd70: dd 4f sbci r29, 0xFD ; 253 bd72: 28 81 ld r18, Y bd74: 39 81 ldd r19, Y+1 ; 0x01 bd76: 4a 81 ldd r20, Y+2 ; 0x02 bd78: 5b 81 ldd r21, Y+3 ; 0x03 bd7a: c5 57 subi r28, 0x75 ; 117 bd7c: d2 40 sbci r29, 0x02 ; 2 bd7e: c7 01 movw r24, r14 bd80: b6 01 movw r22, r12 bd82: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> bd86: 18 16 cp r1, r24 bd88: b4 f0 brlt .+44 ; 0xbdb6 bd8a: cb 58 subi r28, 0x8B ; 139 bd8c: dd 4f sbci r29, 0xFD ; 253 bd8e: 28 81 ld r18, Y bd90: 39 81 ldd r19, Y+1 ; 0x01 bd92: 4a 81 ldd r20, Y+2 ; 0x02 bd94: 5b 81 ldd r21, Y+3 ; 0x03 bd96: c5 57 subi r28, 0x75 ; 117 bd98: d2 40 sbci r29, 0x02 ; 2 bd9a: c1 59 subi r28, 0x91 ; 145 bd9c: dd 4f sbci r29, 0xFD ; 253 bd9e: e8 81 ld r30, Y bda0: f9 81 ldd r31, Y+1 ; 0x01 bda2: cf 56 subi r28, 0x6F ; 111 bda4: d2 40 sbci r29, 0x02 ; 2 bda6: 60 81 ld r22, Z bda8: 71 81 ldd r23, Z+1 ; 0x01 bdaa: 82 81 ldd r24, Z+2 ; 0x02 bdac: 93 81 ldd r25, Z+3 ; 0x03 bdae: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> bdb2: 87 ff sbrs r24, 7 bdb4: 18 c0 rjmp .+48 ; 0xbde6 bdb6: 04 30 cpi r16, 0x04 ; 4 bdb8: 11 05 cpc r17, r1 bdba: 09 f0 breq .+2 ; 0xbdbe bdbc: 30 c1 rjmp .+608 ; 0xc01e bdbe: cb 58 subi r28, 0x8B ; 139 bdc0: dd 4f sbci r29, 0xFD ; 253 bdc2: 28 81 ld r18, Y bdc4: 39 81 ldd r19, Y+1 ; 0x01 bdc6: 4a 81 ldd r20, Y+2 ; 0x02 bdc8: 5b 81 ldd r21, Y+3 ; 0x03 bdca: c5 57 subi r28, 0x75 ; 117 bdcc: d2 40 sbci r29, 0x02 ; 2 bdce: cf 57 subi r28, 0x7F ; 127 bdd0: dd 4f sbci r29, 0xFD ; 253 bdd2: 68 81 ld r22, Y bdd4: 79 81 ldd r23, Y+1 ; 0x01 bdd6: 8a 81 ldd r24, Y+2 ; 0x02 bdd8: 9b 81 ldd r25, Y+3 ; 0x03 bdda: c1 58 subi r28, 0x81 ; 129 bddc: d2 40 sbci r29, 0x02 ; 2 bdde: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> bde2: 87 ff sbrs r24, 7 bde4: 1c c1 rjmp .+568 ; 0xc01e a = (s[i + 1] - s[i]) / (6 * h[i]); bde6: d1 01 movw r26, r2 bde8: 14 96 adiw r26, 0x04 ; 4 bdea: 8d 90 ld r8, X+ bdec: 9d 90 ld r9, X+ bdee: ad 90 ld r10, X+ bdf0: bc 90 ld r11, X bdf2: 17 97 sbiw r26, 0x07 ; 7 bdf4: 8d 91 ld r24, X+ bdf6: 9d 91 ld r25, X+ bdf8: 0d 90 ld r0, X+ bdfa: bc 91 ld r27, X bdfc: a0 2d mov r26, r0 bdfe: cf 58 subi r28, 0x8F ; 143 be00: dd 4f sbci r29, 0xFD ; 253 be02: 88 83 st Y, r24 be04: 99 83 std Y+1, r25 ; 0x01 be06: aa 83 std Y+2, r26 ; 0x02 be08: bb 83 std Y+3, r27 ; 0x03 be0a: c1 57 subi r28, 0x71 ; 113 be0c: d2 40 sbci r29, 0x02 ; 2 be0e: f8 01 movw r30, r16 be10: ee 0f add r30, r30 be12: ff 1f adc r31, r31 be14: ee 0f add r30, r30 be16: ff 1f adc r31, r31 be18: 21 e9 ldi r18, 0x91 ; 145 be1a: 31 e0 ldi r19, 0x01 ; 1 be1c: 2c 0f add r18, r28 be1e: 3d 1f adc r19, r29 be20: e2 0f add r30, r18 be22: f3 1f adc r31, r19 be24: 40 80 ld r4, Z be26: 51 80 ldd r5, Z+1 ; 0x01 be28: 62 80 ldd r6, Z+2 ; 0x02 be2a: 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; be2c: c3 59 subi r28, 0x93 ; 147 be2e: dd 4f sbci r29, 0xFD ; 253 be30: a8 81 ld r26, Y be32: b9 81 ldd r27, Y+1 ; 0x01 be34: cd 56 subi r28, 0x6D ; 109 be36: d2 40 sbci r29, 0x02 ; 2 be38: 8d 91 ld r24, X+ be3a: 9d 91 ld r25, X+ be3c: 0d 90 ld r0, X+ be3e: bc 91 ld r27, X be40: a0 2d mov r26, r0 be42: c3 58 subi r28, 0x83 ; 131 be44: dd 4f sbci r29, 0xFD ; 253 be46: 88 83 st Y, r24 be48: 99 83 std Y+1, r25 ; 0x01 be4a: aa 83 std Y+2, r26 ; 0x02 be4c: bb 83 std Y+3, r27 ; 0x03 be4e: cd 57 subi r28, 0x7D ; 125 be50: 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; be52: a7 01 movw r20, r14 be54: 96 01 movw r18, r12 be56: cb 58 subi r28, 0x8B ; 139 be58: dd 4f sbci r29, 0xFD ; 253 be5a: 68 81 ld r22, Y be5c: 79 81 ldd r23, Y+1 ; 0x01 be5e: 8a 81 ldd r24, Y+2 ; 0x02 be60: 9b 81 ldd r25, Y+3 ; 0x03 be62: c5 57 subi r28, 0x75 ; 117 be64: d2 40 sbci r29, 0x02 ; 2 be66: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> be6a: 6b 01 movw r12, r22 be6c: 7c 01 movw r14, r24 be6e: 20 e0 ldi r18, 0x00 ; 0 be70: 30 e0 ldi r19, 0x00 ; 0 be72: 40 e4 ldi r20, 0x40 ; 64 be74: 50 e4 ldi r21, 0x40 ; 64 be76: 0f 94 b4 e0 call 0x3c168 ; 0x3c168 be7a: cb 57 subi r28, 0x7B ; 123 be7c: dd 4f sbci r29, 0xFD ; 253 be7e: 68 83 st Y, r22 be80: 79 83 std Y+1, r23 ; 0x01 be82: 8a 83 std Y+2, r24 ; 0x02 be84: 9b 83 std Y+3, r25 ; 0x03 be86: c5 58 subi r28, 0x85 ; 133 be88: 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; be8a: c3 58 subi r28, 0x83 ; 131 be8c: dd 4f sbci r29, 0xFD ; 253 be8e: 28 81 ld r18, Y be90: 39 81 ldd r19, Y+1 ; 0x01 be92: 4a 81 ldd r20, Y+2 ; 0x02 be94: 5b 81 ldd r21, Y+3 ; 0x03 be96: cd 57 subi r28, 0x7D ; 125 be98: d2 40 sbci r29, 0x02 ; 2 be9a: c3 59 subi r28, 0x93 ; 147 be9c: dd 4f sbci r29, 0xFD ; 253 be9e: e8 81 ld r30, Y bea0: f9 81 ldd r31, Y+1 ; 0x01 bea2: cd 56 subi r28, 0x6D ; 109 bea4: d2 40 sbci r29, 0x02 ; 2 bea6: 64 81 ldd r22, Z+4 ; 0x04 bea8: 75 81 ldd r23, Z+5 ; 0x05 beaa: 86 81 ldd r24, Z+6 ; 0x06 beac: 97 81 ldd r25, Z+7 ; 0x07 beae: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> beb2: a3 01 movw r20, r6 beb4: 92 01 movw r18, r4 beb6: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> beba: c7 58 subi r28, 0x87 ; 135 bebc: dd 4f sbci r29, 0xFD ; 253 bebe: 68 83 st Y, r22 bec0: 79 83 std Y+1, r23 ; 0x01 bec2: 8a 83 std Y+2, r24 ; 0x02 bec4: 9b 83 std Y+3, r25 ; 0x03 bec6: c9 57 subi r28, 0x79 ; 121 bec8: d2 40 sbci r29, 0x02 ; 2 beca: a3 01 movw r20, r6 becc: 92 01 movw r18, r4 bece: c3 01 movw r24, r6 bed0: b2 01 movw r22, r4 bed2: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> bed6: cf 58 subi r28, 0x8F ; 143 bed8: dd 4f sbci r29, 0xFD ; 253 beda: 28 81 ld r18, Y bedc: 39 81 ldd r19, Y+1 ; 0x01 bede: 4a 81 ldd r20, Y+2 ; 0x02 bee0: 5b 81 ldd r21, Y+3 ; 0x03 bee2: c1 57 subi r28, 0x71 ; 113 bee4: d2 40 sbci r29, 0x02 ; 2 bee6: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> beea: c7 57 subi r28, 0x77 ; 119 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 58 subi r28, 0x89 ; 137 bef8: d2 40 sbci r29, 0x02 ; 2 befa: a3 01 movw r20, r6 befc: 92 01 movw r18, r4 befe: c5 01 movw r24, r10 bf00: b4 01 movw r22, r8 bf02: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> bf06: 9b 01 movw r18, r22 bf08: ac 01 movw r20, r24 bf0a: c7 57 subi r28, 0x77 ; 119 bf0c: dd 4f sbci r29, 0xFD ; 253 bf0e: 68 81 ld r22, Y bf10: 79 81 ldd r23, Y+1 ; 0x01 bf12: 8a 81 ldd r24, Y+2 ; 0x02 bf14: 9b 81 ldd r25, Y+3 ; 0x03 bf16: c9 58 subi r28, 0x89 ; 137 bf18: d2 40 sbci r29, 0x02 ; 2 bf1a: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> bf1e: 20 e0 ldi r18, 0x00 ; 0 bf20: 30 e0 ldi r19, 0x00 ; 0 bf22: 40 ec ldi r20, 0xC0 ; 192 bf24: 50 e4 ldi r21, 0x40 ; 64 bf26: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> bf2a: 9b 01 movw r18, r22 bf2c: ac 01 movw r20, r24 bf2e: c7 58 subi r28, 0x87 ; 135 bf30: dd 4f sbci r29, 0xFD ; 253 bf32: 68 81 ld r22, Y bf34: 79 81 ldd r23, Y+1 ; 0x01 bf36: 8a 81 ldd r24, Y+2 ; 0x02 bf38: 9b 81 ldd r25, Y+3 ; 0x03 bf3a: c9 57 subi r28, 0x79 ; 121 bf3c: d2 40 sbci r29, 0x02 ; 2 bf3e: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__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; bf42: a7 01 movw r20, r14 bf44: 96 01 movw r18, r12 bf46: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> bf4a: c7 58 subi r28, 0x87 ; 135 bf4c: dd 4f sbci r29, 0xFD ; 253 bf4e: 68 83 st Y, r22 bf50: 79 83 std Y+1, r23 ; 0x01 bf52: 8a 83 std Y+2, r24 ; 0x02 bf54: 9b 83 std Y+3, r25 ; 0x03 bf56: c9 57 subi r28, 0x79 ; 121 bf58: 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]); bf5a: cf 58 subi r28, 0x8F ; 143 bf5c: dd 4f sbci r29, 0xFD ; 253 bf5e: 28 81 ld r18, Y bf60: 39 81 ldd r19, Y+1 ; 0x01 bf62: 4a 81 ldd r20, Y+2 ; 0x02 bf64: 5b 81 ldd r21, Y+3 ; 0x03 bf66: c1 57 subi r28, 0x71 ; 113 bf68: d2 40 sbci r29, 0x02 ; 2 bf6a: c5 01 movw r24, r10 bf6c: b4 01 movw r22, r8 bf6e: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> bf72: 4b 01 movw r8, r22 bf74: 5c 01 movw r10, r24 bf76: 20 e0 ldi r18, 0x00 ; 0 bf78: 30 e0 ldi r19, 0x00 ; 0 bf7a: 40 ec ldi r20, 0xC0 ; 192 bf7c: 50 e4 ldi r21, 0x40 ; 64 bf7e: c3 01 movw r24, r6 bf80: b2 01 movw r22, r4 bf82: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> bf86: 9b 01 movw r18, r22 bf88: ac 01 movw r20, r24 bf8a: c5 01 movw r24, r10 bf8c: b4 01 movw r22, r8 bf8e: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__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; bf92: cb 57 subi r28, 0x7B ; 123 bf94: dd 4f sbci r29, 0xFD ; 253 bf96: 28 81 ld r18, Y bf98: 39 81 ldd r19, Y+1 ; 0x01 bf9a: 4a 81 ldd r20, Y+2 ; 0x02 bf9c: 5b 81 ldd r21, Y+3 ; 0x03 bf9e: c5 58 subi r28, 0x85 ; 133 bfa0: d2 40 sbci r29, 0x02 ; 2 bfa2: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> bfa6: 4b 01 movw r8, r22 bfa8: 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; bfaa: 20 e0 ldi r18, 0x00 ; 0 bfac: 30 e0 ldi r19, 0x00 ; 0 bfae: 40 e0 ldi r20, 0x00 ; 0 bfb0: 5f e3 ldi r21, 0x3F ; 63 bfb2: cf 58 subi r28, 0x8F ; 143 bfb4: dd 4f sbci r29, 0xFD ; 253 bfb6: 68 81 ld r22, Y bfb8: 79 81 ldd r23, Y+1 ; 0x01 bfba: 8a 81 ldd r24, Y+2 ; 0x02 bfbc: 9b 81 ldd r25, Y+3 ; 0x03 bfbe: c1 57 subi r28, 0x71 ; 113 bfc0: d2 40 sbci r29, 0x02 ; 2 bfc2: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> bfc6: 2b 01 movw r4, r22 bfc8: 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; bfca: a7 01 movw r20, r14 bfcc: 96 01 movw r18, r12 bfce: c7 01 movw r24, r14 bfd0: b6 01 movw r22, r12 bfd2: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> bfd6: 9b 01 movw r18, r22 bfd8: ac 01 movw r20, r24 bfda: c3 01 movw r24, r6 bfdc: b2 01 movw r22, r4 bfde: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> bfe2: 9b 01 movw r18, r22 bfe4: ac 01 movw r20, r24 bfe6: c5 01 movw r24, r10 bfe8: b4 01 movw r22, r8 bfea: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> bfee: 9b 01 movw r18, r22 bff0: ac 01 movw r20, r24 bff2: c7 58 subi r28, 0x87 ; 135 bff4: dd 4f sbci r29, 0xFD ; 253 bff6: 68 81 ld r22, Y bff8: 79 81 ldd r23, Y+1 ; 0x01 bffa: 8a 81 ldd r24, Y+2 ; 0x02 bffc: 9b 81 ldd r25, Y+3 ; 0x03 bffe: c9 57 subi r28, 0x79 ; 121 c000: d2 40 sbci r29, 0x02 ; 2 c002: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> c006: c3 58 subi r28, 0x83 ; 131 c008: dd 4f sbci r29, 0xFD ; 253 c00a: 28 81 ld r18, Y c00c: 39 81 ldd r19, Y+1 ; 0x01 c00e: 4a 81 ldd r20, Y+2 ; 0x02 c010: 5b 81 ldd r21, Y+3 ; 0x03 c012: cd 57 subi r28, 0x7D ; 125 c014: d2 40 sbci r29, 0x02 ; 2 c016: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> c01a: 2b 01 movw r4, r22 c01c: 3c 01 movw r6, r24 c01e: 0f 5f subi r16, 0xFF ; 255 c020: 1f 4f sbci r17, 0xFF ; 255 c022: f4 e0 ldi r31, 0x04 ; 4 c024: 2f 0e add r2, r31 c026: 31 1c adc r3, r1 c028: c3 59 subi r28, 0x93 ; 147 c02a: dd 4f sbci r29, 0xFD ; 253 c02c: 28 81 ld r18, Y c02e: 39 81 ldd r19, Y+1 ; 0x01 c030: cd 56 subi r28, 0x6D ; 109 c032: d2 40 sbci r29, 0x02 ; 2 c034: 2c 5f subi r18, 0xFC ; 252 c036: 3f 4f sbci r19, 0xFF ; 255 c038: c3 59 subi r28, 0x93 ; 147 c03a: dd 4f sbci r29, 0xFD ; 253 c03c: 39 83 std Y+1, r19 ; 0x01 c03e: 28 83 st Y, r18 c040: cd 56 subi r28, 0x6D ; 109 c042: 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 c04a: 81 ce rjmp .-766 ; 0xbd4e sum = a*pow((inp_temperature - x[i]), 3) + b*pow((inp_temperature - x[i]), 2) + c*(inp_temperature - x[i]) + d; } return sum; } c04c: c3 01 movw r24, r6 c04e: b2 01 movw r22, r4 c050: c4 57 subi r28, 0x74 ; 116 c052: dd 4f sbci r29, 0xFD ; 253 c054: 0f b6 in r0, 0x3f ; 63 c056: f8 94 cli c058: de bf out 0x3e, r29 ; 62 c05a: 0f be out 0x3f, r0 ; 63 c05c: cd bf out 0x3d, r28 ; 61 c05e: df 91 pop r29 c060: cf 91 pop r28 c062: 1f 91 pop r17 c064: 0f 91 pop r16 c066: ff 90 pop r15 c068: ef 90 pop r14 c06a: df 90 pop r13 c06c: cf 90 pop r12 c06e: bf 90 pop r11 c070: af 90 pop r10 c072: 9f 90 pop r9 c074: 8f 90 pop r8 c076: 7f 90 pop r7 c078: 6f 90 pop r6 c07a: 5f 90 pop r5 c07c: 4f 90 pop r4 c07e: 3f 90 pop r3 c080: 2f 90 pop r2 c082: 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)); c084: c5 01 movw r24, r10 c086: 0f 94 2a dc call 0x3b854 ; 0x3b854 c08a: d8 01 movw r26, r16 c08c: 8d 93 st X+, r24 c08e: 9c 93 st X, r25 c090: b5 e0 ldi r27, 0x05 ; 5 c092: cb 0e add r12, r27 c094: d1 1c adc r13, r1 c096: e2 e0 ldi r30, 0x02 ; 2 c098: ae 0e add r10, r30 c09a: b1 1c adc r11, r1 c09c: 96 cc rjmp .-1748 ; 0xb9ca 0000c09e : eFilamentAction = FilamentAction::None; } // Common gcode shared by the gcodes. This saves some flash memory static void gcodes_M704_M705_M706(uint16_t gcode) { c09e: 0f 93 push r16 c0a0: 1f 93 push r17 c0a2: cf 93 push r28 uint8_t mmuSlotIndex = 0xffU; if (MMU2::mmu2.Enabled() && code_seen('P')) c0a4: 20 91 ba 13 lds r18, 0x13BA ; 0x8013ba c0a8: 21 30 cpi r18, 0x01 ; 1 c0aa: 79 f5 brne .+94 ; 0xc10a c0ac: 8c 01 movw r16, r24 c0ae: 80 e5 ldi r24, 0x50 ; 80 c0b0: 0e 94 d6 5b call 0xb7ac ; 0xb7ac c0b4: 88 23 and r24, r24 c0b6: 49 f1 breq .+82 ; 0xc10a { mmuSlotIndex = code_value_uint8(); c0b8: 0e 94 68 5b call 0xb6d0 ; 0xb6d0 c0bc: c8 2f mov r28, r24 if (mmuSlotIndex < MMU_FILAMENT_COUNT) { c0be: 85 30 cpi r24, 0x05 ; 5 c0c0: 20 f5 brcc .+72 ; 0xc10a switch (gcode) c0c2: 01 3c cpi r16, 0xC1 ; 193 c0c4: 82 e0 ldi r24, 0x02 ; 2 c0c6: 18 07 cpc r17, r24 c0c8: 49 f0 breq .+18 ; 0xc0dc c0ca: 02 3c cpi r16, 0xC2 ; 194 c0cc: 12 40 sbci r17, 0x02 ; 2 c0ce: 69 f0 breq .+26 ; 0xc0ea { case 704: MMU2::mmu2.load_filament(mmuSlotIndex); c0d0: 8c 2f mov r24, r28 default: break; } } } } c0d2: cf 91 pop r28 c0d4: 1f 91 pop r17 c0d6: 0f 91 pop r16 mmuSlotIndex = code_value_uint8(); if (mmuSlotIndex < MMU_FILAMENT_COUNT) { switch (gcode) { case 704: MMU2::mmu2.load_filament(mmuSlotIndex); c0d8: 0d 94 55 ad jmp 0x35aaa ; 0x35aaa break; case 705: MMU2::mmu2.eject_filament(mmuSlotIndex, false); c0dc: 60 e0 ldi r22, 0x00 ; 0 c0de: 8c 2f mov r24, r28 default: break; } } } } c0e0: cf 91 pop r28 c0e2: 1f 91 pop r17 c0e4: 0f 91 pop r16 { case 704: MMU2::mmu2.load_filament(mmuSlotIndex); break; case 705: MMU2::mmu2.eject_filament(mmuSlotIndex, false); c0e6: 0d 94 98 ad jmp 0x35b30 ; 0x35b30 break; case 706: #ifdef MMU_HAS_CUTTER if (eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED) != 0){ c0ea: 8e ec ldi r24, 0xCE ; 206 c0ec: 9e e0 ldi r25, 0x0E ; 14 c0ee: 0f 94 1c dc call 0x3b838 ; 0x3b838 c0f2: 88 23 and r24, r24 c0f4: 51 f0 breq .+20 ; 0xc10a IncrementMMUFails(); } } bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) { if (!WaitForMMUReady()) { c0f6: 0f 94 84 88 call 0x31108 ; 0x31108 c0fa: 88 23 and r24, r24 c0fc: 31 f0 breq .+12 ; 0xc10a c0fe: 8c 2f mov r24, r28 default: break; } } } } c100: cf 91 pop r28 c102: 1f 91 pop r17 c104: 0f 91 pop r16 c106: 0d 94 15 ae jmp 0x35c2a ; 0x35c2a c10a: cf 91 pop r28 c10c: 1f 91 pop r17 c10e: 0f 91 pop r16 c110: 08 95 ret 0000c112 : #ifdef TMC2130 void change_power_mode_live(uint8_t mode) { c112: cf 93 push r28 c114: 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(); c116: 0f 94 e8 42 call 0x285d0 ; 0x285d0 cli(); c11a: f8 94 cli tmc2130_mode = mode; c11c: c0 93 8c 06 sts 0x068C, r28 ; 0x80068c update_mode_profile(); c120: 0f 94 a1 63 call 0x2c742 ; 0x2c742 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(); c124: 0e 94 d1 ef call 0x1dfa2 ; 0x1dfa2 1 #else 0 #endif ) , enableECool(enableECool) { } c128: 88 0f add r24, r24 tmc2130_init(TMCInitParams(FarmOrUserECool())); c12a: 82 70 andi r24, 0x02 ; 2 c12c: 0f 94 60 26 call 0x24cc0 ; 0x24cc0 // 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(); c130: 0f 94 42 43 call 0x28684 ; 0x28684 sei(); c134: 78 94 sei } c136: cf 91 pop r28 c138: 08 95 ret 0000c13a : 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);} c13a: 8f 92 push r8 c13c: 9f 92 push r9 c13e: af 92 push r10 c140: bf 92 push r11 c142: cf 92 push r12 c144: df 92 push r13 c146: ef 92 push r14 c148: ff 92 push r15 c14a: 0f 93 push r16 c14c: 1f 93 push r17 c14e: cf 93 push r28 c150: df 93 push r29 c152: 00 91 95 03 lds r16, 0x0395 ; 0x800395 c156: 10 91 96 03 lds r17, 0x0396 ; 0x800396 c15a: 0f 5f subi r16, 0xFF ; 255 c15c: 1f 4f sbci r17, 0xFF ; 255 if (endptr) *endptr = (char*)nptr; do { c = *nptr++; c15e: 68 01 movw r12, r16 c160: 8f ef ldi r24, 0xFF ; 255 c162: c8 1a sub r12, r24 c164: d8 0a sbc r13, r24 c166: d8 01 movw r26, r16 c168: dc 91 ld r29, X } while (isspace(c)); c16a: 8d 2f mov r24, r29 c16c: 90 e0 ldi r25, 0x00 ; 0 c16e: 0f 94 ad d9 call 0x3b35a ; 0x3b35a c172: 7c 01 movw r14, r24 c174: 89 2b or r24, r25 c176: 01 f5 brne .+64 ; 0xc1b8 flag = 0; if (c == '-') { c178: dd 32 cpi r29, 0x2D ; 45 c17a: 01 f5 brne .+64 ; 0xc1bc flag = FL_MINUS; c = *nptr++; c17c: 68 01 movw r12, r16 c17e: b2 e0 ldi r27, 0x02 ; 2 c180: cb 0e add r12, r27 c182: d1 1c adc r13, r1 c184: f8 01 movw r30, r16 c186: d1 81 ldd r29, Z+1 ; 0x01 c = *nptr++; } while (isspace(c)); flag = 0; if (c == '-') { flag = FL_MINUS; c188: c1 e0 ldi r28, 0x01 ; 1 } else if (c == '+') { c = *nptr++; } if (!strncasecmp_P(nptr - 1, pstr_inf, 3)) { c18a: 86 01 movw r16, r12 c18c: 01 50 subi r16, 0x01 ; 1 c18e: 11 09 sbc r17, r1 c190: 43 e0 ldi r20, 0x03 ; 3 c192: 50 e0 ldi r21, 0x00 ; 0 c194: 65 ea ldi r22, 0xA5 ; 165 c196: 7b e7 ldi r23, 0x7B ; 123 c198: c8 01 movw r24, r16 c19a: 0f 94 e3 d9 call 0x3b3c6 ; 0x3b3c6 c19e: 89 2b or r24, r25 c1a0: c1 f4 brne .+48 ; 0xc1d2 nptr += 2; if (!strncasecmp_P(nptr, pstr_inity, 5)) nptr += 5; if (endptr) *endptr = (char*)nptr; return flag & FL_MINUS ? -INFINITY : +INFINITY; c1a2: 60 e0 ldi r22, 0x00 ; 0 c1a4: 70 e0 ldi r23, 0x00 ; 0 c1a6: 80 e8 ldi r24, 0x80 ; 128 c1a8: 9f ef ldi r25, 0xFF ; 255 c1aa: c1 11 cpse r28, r1 c1ac: db c0 rjmp .+438 ; 0xc364 c1ae: 60 e0 ldi r22, 0x00 ; 0 c1b0: 70 e0 ldi r23, 0x00 ; 0 c1b2: 80 e8 ldi r24, 0x80 ; 128 c1b4: 9f e7 ldi r25, 0x7F ; 127 c1b6: d6 c0 rjmp .+428 ; 0xc364 if (endptr) *endptr = (char*)nptr; do { c = *nptr++; c1b8: 86 01 movw r16, r12 c1ba: d1 cf rjmp .-94 ; 0xc15e flag = 0; if (c == '-') { flag = FL_MINUS; c = *nptr++; } else if (c == '+') { c1bc: db 32 cpi r29, 0x2B ; 43 c1be: 39 f4 brne .+14 ; 0xc1ce c = *nptr++; c1c0: 68 01 movw r12, r16 c1c2: f2 e0 ldi r31, 0x02 ; 2 c1c4: cf 0e add r12, r31 c1c6: d1 1c adc r13, r1 c1c8: d8 01 movw r26, r16 c1ca: 11 96 adiw r26, 0x01 ; 1 c1cc: dc 91 ld r29, X do { c = *nptr++; } while (isspace(c)); flag = 0; c1ce: c0 e0 ldi r28, 0x00 ; 0 c1d0: dc cf rjmp .-72 ; 0xc18a 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)) { c1d2: 43 e0 ldi r20, 0x03 ; 3 c1d4: 50 e0 ldi r21, 0x00 ; 0 c1d6: 62 ea ldi r22, 0xA2 ; 162 c1d8: 7b e7 ldi r23, 0x7B ; 123 c1da: c8 01 movw r24, r16 c1dc: 0f 94 e3 d9 call 0x3b3c6 ; 0x3b3c6 c1e0: 89 2b or r24, r25 c1e2: 09 f4 brne .+2 ; 0xc1e6 c1e4: cc c0 rjmp .+408 ; 0xc37e c1e6: f6 01 movw r30, r12 *endptr = (char*)nptr + 2; return NAN; } x.u32 = 0; exp = 0; c1e8: 10 e0 ldi r17, 0x00 ; 0 c1ea: 00 e0 ldi r16, 0x00 ; 0 if (endptr) *endptr = (char*)nptr + 2; return NAN; } x.u32 = 0; c1ec: 20 e0 ldi r18, 0x00 ; 0 c1ee: 30 e0 ldi r19, 0x00 ; 0 c1f0: a9 01 movw r20, r18 c1f2: 6f 01 movw r12, r30 exp = 0; while (1) { c -= '0'; c1f4: d0 53 subi r29, 0x30 ; 48 if (c <= 9) { c1f6: da 30 cpi r29, 0x0A ; 10 c1f8: 60 f5 brcc .+88 ; 0xc252 flag |= FL_ANY; c1fa: bc 2e mov r11, r28 c1fc: 68 94 set c1fe: b1 f8 bld r11, 1 c200: 8c 2f mov r24, r28 c202: 88 70 andi r24, 0x08 ; 8 if (flag & FL_OVFL) { c204: c2 ff sbrs r28, 2 c206: 09 c0 rjmp .+18 ; 0xc21a if (!(flag & FL_DOT)) c208: 81 11 cpse r24, r1 c20a: 02 c0 rjmp .+4 ; 0xc210 exp += 1; c20c: 0f 5f subi r16, 0xFF ; 255 c20e: 1f 4f sbci r17, 0xFF ; 255 c210: 31 96 adiw r30, 0x01 ; 1 flag |= FL_DOT; } else { break; } c = *nptr++; c212: d6 01 movw r26, r12 c214: dc 91 ld r29, X c216: cb 2d mov r28, r11 c218: ec cf rjmp .-40 ; 0xc1f2 if (flag & FL_OVFL) { if (!(flag & FL_DOT)) exp += 1; } else { if (flag & FL_DOT) c21a: 88 23 and r24, r24 c21c: 11 f0 breq .+4 ; 0xc222 exp -= 1; c21e: 01 50 subi r16, 0x01 ; 1 c220: 11 09 sbc r17, r1 /* x.u32 = x.u32 * 10 + c */ x.u32 = (((x.u32 << 2) + x.u32) << 1) + c; c222: a5 e0 ldi r26, 0x05 ; 5 c224: b0 e0 ldi r27, 0x00 ; 0 c226: 0f 94 b1 dc call 0x3b962 ; 0x3b962 <__muluhisi3> c22a: 9b 01 movw r18, r22 c22c: ac 01 movw r20, r24 c22e: 22 0f add r18, r18 c230: 33 1f adc r19, r19 c232: 44 1f adc r20, r20 c234: 55 1f adc r21, r21 c236: 2d 0f add r18, r29 c238: 31 1d adc r19, r1 c23a: 41 1d adc r20, r1 c23c: 51 1d adc r21, r1 if (x.u32 >= (ULONG_MAX - 9) / 10) c23e: 28 39 cpi r18, 0x98 ; 152 c240: b9 e9 ldi r27, 0x99 ; 153 c242: 3b 07 cpc r19, r27 c244: 4b 07 cpc r20, r27 c246: b9 e1 ldi r27, 0x19 ; 25 c248: 5b 07 cpc r21, r27 c24a: 10 f3 brcs .-60 ; 0xc210 flag |= FL_OVFL; c24c: c6 60 ori r28, 0x06 ; 6 c24e: bc 2e mov r11, r28 c250: df cf rjmp .-66 ; 0xc210 } } else if (c == (('.' - '0') & 0xff) && !(flag & FL_DOT)) { c252: de 3f cpi r29, 0xFE ; 254 c254: 31 f4 brne .+12 ; 0xc262 c256: c3 fd sbrc r28, 3 c258: 33 c0 rjmp .+102 ; 0xc2c0 flag |= FL_DOT; c25a: bc 2e mov r11, r28 c25c: 68 94 set c25e: b3 f8 bld r11, 3 c260: d7 cf rjmp .-82 ; 0xc210 } c = *nptr++; } // Check for exponent "E", but disable capital E if (c == (('e' - '0') & 0xff) /*|| c == (('E' - '0') & 0xff)*/) c262: d5 33 cpi r29, 0x35 ; 53 c264: 69 f5 brne .+90 ; 0xc2c0 { int i; c = *nptr++; c266: 80 81 ld r24, Z i = 2; if (c == '-') { c268: 8d 32 cpi r24, 0x2D ; 45 c26a: 31 f4 brne .+12 ; 0xc278 flag |= FL_MEXP; c26c: c0 61 ori r28, 0x10 ; 16 c = *nptr++; c26e: bf 01 movw r22, r30 } else if (c == '+') { c = *nptr++; c270: 6e 5f subi r22, 0xFE ; 254 c272: 7f 4f sbci r23, 0xFF ; 255 c274: 81 81 ldd r24, Z+1 ; 0x01 c276: 05 c0 rjmp .+10 ; 0xc282 c278: bf 01 movw r22, r30 i = 2; if (c == '-') { flag |= FL_MEXP; c = *nptr++; } else if (c == '+') { c27a: 8b 32 cpi r24, 0x2B ; 43 c27c: c9 f3 breq .-14 ; 0xc270 // Check for exponent "E", but disable capital E if (c == (('e' - '0') & 0xff) /*|| c == (('E' - '0') & 0xff)*/) { int i; c = *nptr++; c27e: 6f 5f subi r22, 0xFF ; 255 c280: 7f 4f sbci r23, 0xFF ; 255 c = *nptr++; } else { i = 1; } c -= '0'; c282: 80 53 subi r24, 0x30 ; 48 if (c > 9) { c284: 8a 30 cpi r24, 0x0A ; 10 c286: e0 f4 brcc .+56 ; 0xc2c0 c288: fb 01 movw r30, r22 nptr -= i; } else { i = 0; do { if (i < 3200) c28a: b0 e8 ldi r27, 0x80 ; 128 c28c: eb 16 cp r14, r27 c28e: bc e0 ldi r27, 0x0C ; 12 c290: fb 06 cpc r15, r27 c292: 5c f4 brge .+22 ; 0xc2aa i = (((i << 2) + i) << 1) + c; /* i = 10*i + c */ c294: b7 01 movw r22, r14 c296: 66 0f add r22, r22 c298: 77 1f adc r23, r23 c29a: 66 0f add r22, r22 c29c: 77 1f adc r23, r23 c29e: e6 0e add r14, r22 c2a0: f7 1e adc r15, r23 c2a2: ee 0c add r14, r14 c2a4: ff 1c adc r15, r15 c2a6: e8 0e add r14, r24 c2a8: f1 1c adc r15, r1 c = *nptr++ - '0'; c2aa: 81 91 ld r24, Z+ c2ac: 80 53 subi r24, 0x30 ; 48 } while (c <= 9); c2ae: 8a 30 cpi r24, 0x0A ; 10 c2b0: 60 f3 brcs .-40 ; 0xc28a if (flag & FL_MEXP) c2b2: c4 ff sbrs r28, 4 c2b4: 03 c0 rjmp .+6 ; 0xc2bc i = -i; c2b6: f1 94 neg r15 c2b8: e1 94 neg r14 c2ba: f1 08 sbc r15, r1 exp += i; c2bc: 0e 0d add r16, r14 c2be: 1f 1d adc r17, r15 } if ((flag & FL_ANY) && endptr) *endptr = (char*)nptr - 1; x.flt = __floatunsisf(x.u32); /* manually */ c2c0: ca 01 movw r24, r20 c2c2: b9 01 movw r22, r18 c2c4: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> if ((flag & FL_MINUS) && (flag & FL_ANY)) c2c8: c3 70 andi r28, 0x03 ; 3 c2ca: c3 30 cpi r28, 0x03 ; 3 c2cc: 09 f4 brne .+2 ; 0xc2d0 x.flt = -x.flt; c2ce: 90 58 subi r25, 0x80 ; 128 c2d0: 4b 01 movw r8, r22 c2d2: 5c 01 movw r10, r24 if (x.flt != 0) { c2d4: 20 e0 ldi r18, 0x00 ; 0 c2d6: 30 e0 ldi r19, 0x00 ; 0 c2d8: a9 01 movw r20, r18 c2da: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> c2de: 88 23 and r24, r24 c2e0: 09 f4 brne .+2 ; 0xc2e4 c2e2: 3e c0 rjmp .+124 ; 0xc360 if (exp < 0) { nptr = (void*)(pwr_m10 + 5); exp = -exp; } else { nptr = (void*)(pwr_p10 + 5); c2e4: ce e9 ldi r28, 0x9E ; 158 c2e6: 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) { c2e8: 17 ff sbrs r17, 7 c2ea: 05 c0 rjmp .+10 ; 0xc2f6 nptr = (void*)(pwr_m10 + 5); exp = -exp; c2ec: 11 95 neg r17 c2ee: 01 95 neg r16 c2f0: 11 09 sbc r17, r1 x.flt = -x.flt; if (x.flt != 0) { int pwr; if (exp < 0) { nptr = (void*)(pwr_m10 + 5); c2f2: c6 e8 ldi r28, 0x86 ; 134 c2f4: db e7 ldi r29, 0x7B ; 123 c2f6: 6e 01 movw r12, r28 c2f8: e8 e1 ldi r30, 0x18 ; 24 c2fa: ce 1a sub r12, r30 c2fc: d1 08 sbc r13, r1 exp = -exp; } else { nptr = (void*)(pwr_p10 + 5); c2fe: 80 e2 ldi r24, 0x20 ; 32 c300: e8 2e mov r14, r24 c302: f1 2c mov r15, r1 c304: 0d c0 rjmp .+26 ; 0xc320 for (; exp >= pwr; exp -= pwr) { union { unsigned long u32; float flt; } y; y.u32 = pgm_read_dword((float*)nptr); c306: fe 01 movw r30, r28 c308: 25 91 lpm r18, Z+ c30a: 35 91 lpm r19, Z+ c30c: 45 91 lpm r20, Z+ c30e: 54 91 lpm r21, Z } else { nptr = (void*)(pwr_p10 + 5); } for (pwr = 32; pwr; pwr >>= 1) { for (; exp >= pwr; exp -= pwr) { c310: 0e 19 sub r16, r14 c312: 1f 09 sbc r17, r15 union { unsigned long u32; float flt; } y; y.u32 = pgm_read_dword((float*)nptr); x.flt *= y.flt; c314: c5 01 movw r24, r10 c316: b4 01 movw r22, r8 c318: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> c31c: 4b 01 movw r8, r22 c31e: 5c 01 movw r10, r24 c320: d5 01 movw r26, r10 c322: c4 01 movw r24, r8 } else { nptr = (void*)(pwr_p10 + 5); } for (pwr = 32; pwr; pwr >>= 1) { for (; exp >= pwr; exp -= pwr) { c324: 0e 15 cp r16, r14 c326: 1f 05 cpc r17, r15 c328: 74 f7 brge .-36 ; 0xc306 float flt; } y; y.u32 = pgm_read_dword((float*)nptr); x.flt *= y.flt; } nptr -= sizeof(float); c32a: 24 97 sbiw r28, 0x04 ; 4 exp = -exp; } else { nptr = (void*)(pwr_p10 + 5); } for (pwr = 32; pwr; pwr >>= 1) { c32c: f5 94 asr r15 c32e: e7 94 ror r14 c330: cc 16 cp r12, r28 c332: dd 06 cpc r13, r29 c334: a9 f7 brne .-22 ; 0xc320 not plus or minus infinity, and not NaN. */ __ATTR_CONST__ static inline int isfinite (double __x) { unsigned char __exp; __asm__ ( c336: 8a 2f mov r24, r26 c338: 88 0f add r24, r24 c33a: 8b 2f mov r24, r27 c33c: 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) c33e: 8f 3f cpi r24, 0xFF ; 255 c340: 49 f0 breq .+18 ; 0xc354 c342: 20 e0 ldi r18, 0x00 ; 0 c344: 30 e0 ldi r19, 0x00 ; 0 c346: a9 01 movw r20, r18 c348: c5 01 movw r24, r10 c34a: b4 01 movw r22, r8 c34c: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> c350: 81 11 cpse r24, r1 c352: 06 c0 rjmp .+12 ; 0xc360 errno = ERANGE; c354: 82 e2 ldi r24, 0x22 ; 34 c356: 90 e0 ldi r25, 0x00 ; 0 c358: 90 93 15 18 sts 0x1815, r25 ; 0x801815 c35c: 80 93 14 18 sts 0x1814, r24 ; 0x801814 } return x.flt; c360: c5 01 movw r24, r10 c362: b4 01 movw r22, r8 c364: df 91 pop r29 c366: cf 91 pop r28 c368: 1f 91 pop r17 c36a: 0f 91 pop r16 c36c: ff 90 pop r15 c36e: ef 90 pop r14 c370: df 90 pop r13 c372: cf 90 pop r12 c374: bf 90 pop r11 c376: af 90 pop r10 c378: 9f 90 pop r9 c37a: 8f 90 pop r8 c37c: 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; c37e: 60 e0 ldi r22, 0x00 ; 0 c380: 70 e0 ldi r23, 0x00 ; 0 c382: 80 ec ldi r24, 0xC0 ; 192 c384: 9f e7 ldi r25, 0x7F ; 127 c386: ee cf rjmp .-36 ; 0xc364 0000c388 : } } } #endif //MOTHERBOARD == BOARD_RAMBO_MINI_1_0 || MOTHERBOARD == BOARD_RAMBO_MINI_1_3 void get_coordinates() { c388: 2f 92 push r2 c38a: 3f 92 push r3 c38c: 4f 92 push r4 c38e: 5f 92 push r5 c390: 6f 92 push r6 c392: 7f 92 push r7 c394: 8f 92 push r8 c396: 9f 92 push r9 c398: af 92 push r10 c39a: bf 92 push r11 c39c: cf 92 push r12 c39e: df 92 push r13 c3a0: ef 92 push r14 c3a2: ff 92 push r15 c3a4: 0f 93 push r16 c3a6: 1f 93 push r17 c3a8: cf 93 push r28 c3aa: df 93 push r29 c3ac: 00 d0 rcall .+0 ; 0xc3ae c3ae: cd b7 in r28, 0x3d ; 61 c3b0: de b7 in r29, 0x3e ; 62 c3b2: 8d ed ldi r24, 0xDD ; 221 c3b4: c8 2e mov r12, r24 c3b6: 82 e0 ldi r24, 0x02 ; 2 c3b8: d8 2e mov r13, r24 c3ba: 84 e7 ldi r24, 0x74 ; 116 c3bc: 96 e0 ldi r25, 0x06 ; 6 c3be: 9b 83 std Y+3, r25 ; 0x03 c3c0: 8a 83 std Y+2, r24 ; 0x02 c3c2: 92 e9 ldi r25, 0x92 ; 146 c3c4: e9 2e mov r14, r25 c3c6: 96 e0 ldi r25, 0x06 ; 6 c3c8: f9 2e mov r15, r25 for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i < NUM_AXIS; i++, mask <<= 1) { c3ca: 33 24 eor r3, r3 c3cc: 33 94 inc r3 c3ce: 00 e0 ldi r16, 0x00 ; 0 if(code_seen(axis_codes[i])) c3d0: f6 01 movw r30, r12 c3d2: 81 91 ld r24, Z+ c3d4: 6f 01 movw r12, r30 c3d6: 0e 94 d6 5b call 0xb7ac ; 0xb7ac c3da: 28 2e mov r2, r24 c3dc: 88 23 and r24, r24 c3de: 09 f4 brne .+2 ; 0xc3e2 c3e0: a6 c0 rjmp .+332 ; 0xc52e { bool relative = axis_relative_modes & mask; c3e2: 10 91 e5 03 lds r17, 0x03E5 ; 0x8003e5 c3e6: 13 21 and r17, r3 destination[i] = code_value(); c3e8: 0e 94 9d 60 call 0xc13a ; 0xc13a c3ec: 2b 01 movw r4, r22 c3ee: 3c 01 movw r6, r24 c3f0: ea 81 ldd r30, Y+2 ; 0x02 c3f2: fb 81 ldd r31, Y+3 ; 0x03 c3f4: 40 82 st Z, r4 c3f6: 51 82 std Z+1, r5 ; 0x01 c3f8: 62 82 std Z+2, r6 ; 0x02 c3fa: 73 82 std Z+3, r7 ; 0x03 if (i == E_AXIS) { c3fc: 03 30 cpi r16, 0x03 ; 3 c3fe: 09 f0 breq .+2 ; 0xc402 c400: 46 c0 rjmp .+140 ; 0xc48e 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; c402: f1 e0 ldi r31, 0x01 ; 1 c404: f9 83 std Y+1, r31 ; 0x01 c406: 11 11 cpse r17, r1 c408: 01 c0 rjmp .+2 ; 0xc40c c40a: 19 82 std Y+1, r1 ; 0x01 destination[i] = code_value(); if (i == E_AXIS) { float emult = extruder_multiplier[active_extruder]; c40c: 80 90 93 02 lds r8, 0x0293 ; 0x800293 c410: 90 90 94 02 lds r9, 0x0294 ; 0x800294 c414: a0 90 95 02 lds r10, 0x0295 ; 0x800295 c418: b0 90 96 02 lds r11, 0x0296 ; 0x800296 if (emult != 1.) { c41c: 20 e0 ldi r18, 0x00 ; 0 c41e: 30 e0 ldi r19, 0x00 ; 0 c420: 40 e8 ldi r20, 0x80 ; 128 c422: 5f e3 ldi r21, 0x3F ; 63 c424: c5 01 movw r24, r10 c426: b4 01 movw r22, r8 c428: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> c42c: 88 23 and r24, r24 c42e: 59 f1 breq .+86 ; 0xc486 if (! relative) { c430: 11 11 cpse r17, r1 c432: 15 c0 rjmp .+42 ; 0xc45e destination[i] -= current_position[i]; c434: 20 91 9e 06 lds r18, 0x069E ; 0x80069e c438: 30 91 9f 06 lds r19, 0x069F ; 0x80069f c43c: 40 91 a0 06 lds r20, 0x06A0 ; 0x8006a0 c440: 50 91 a1 06 lds r21, 0x06A1 ; 0x8006a1 c444: c3 01 movw r24, r6 c446: b2 01 movw r22, r4 c448: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> c44c: 60 93 80 06 sts 0x0680, r22 ; 0x800680 c450: 70 93 81 06 sts 0x0681, r23 ; 0x800681 c454: 80 93 82 06 sts 0x0682, r24 ; 0x800682 c458: 90 93 83 06 sts 0x0683, r25 ; 0x800683 relative = true; c45c: 29 82 std Y+1, r2 ; 0x01 } destination[i] *= emult; c45e: a5 01 movw r20, r10 c460: 94 01 movw r18, r8 c462: 60 91 80 06 lds r22, 0x0680 ; 0x800680 c466: 70 91 81 06 lds r23, 0x0681 ; 0x800681 c46a: 80 91 82 06 lds r24, 0x0682 ; 0x800682 c46e: 90 91 83 06 lds r25, 0x0683 ; 0x800683 c472: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> c476: 60 93 80 06 sts 0x0680, r22 ; 0x800680 c47a: 70 93 81 06 sts 0x0681, r23 ; 0x800681 c47e: 80 93 82 06 sts 0x0682, r24 ; 0x800682 c482: 90 93 83 06 sts 0x0683, r25 ; 0x800683 } } if (relative) c486: e9 81 ldd r30, Y+1 ; 0x01 c488: e1 11 cpse r30, r1 c48a: 03 c0 rjmp .+6 ; 0xc492 c48c: 22 c0 rjmp .+68 ; 0xc4d2 c48e: 11 23 and r17, r17 c490: 99 f0 breq .+38 ; 0xc4b8 destination[i] += current_position[i]; c492: f7 01 movw r30, r14 c494: 20 81 ld r18, Z c496: 31 81 ldd r19, Z+1 ; 0x01 c498: 42 81 ldd r20, Z+2 ; 0x02 c49a: 53 81 ldd r21, Z+3 ; 0x03 c49c: ea 81 ldd r30, Y+2 ; 0x02 c49e: fb 81 ldd r31, Y+3 ; 0x03 c4a0: 60 81 ld r22, Z c4a2: 71 81 ldd r23, Z+1 ; 0x01 c4a4: 82 81 ldd r24, Z+2 ; 0x02 c4a6: 93 81 ldd r25, Z+3 ; 0x03 c4a8: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> c4ac: ea 81 ldd r30, Y+2 ; 0x02 c4ae: fb 81 ldd r31, Y+3 ; 0x03 c4b0: 60 83 st Z, r22 c4b2: 71 83 std Z+1, r23 ; 0x01 c4b4: 82 83 std Z+2, r24 ; 0x02 c4b6: 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) { c4b8: 0f 5f subi r16, 0xFF ; 255 c4ba: 33 0c add r3, r3 c4bc: 8a 81 ldd r24, Y+2 ; 0x02 c4be: 9b 81 ldd r25, Y+3 ; 0x03 c4c0: 04 96 adiw r24, 0x04 ; 4 c4c2: 9b 83 std Y+3, r25 ; 0x03 c4c4: 8a 83 std Y+2, r24 ; 0x02 c4c6: 94 e0 ldi r25, 0x04 ; 4 c4c8: e9 0e add r14, r25 c4ca: f1 1c adc r15, r1 c4cc: 04 30 cpi r16, 0x04 ; 4 c4ce: 09 f0 breq .+2 ; 0xc4d2 c4d0: 7f cf rjmp .-258 ; 0xc3d0 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')) { c4d2: 86 e4 ldi r24, 0x46 ; 70 c4d4: 0e 94 d6 5b call 0xb7ac ; 0xb7ac c4d8: 88 23 and r24, r24 c4da: 99 f0 breq .+38 ; 0xc502 const float next_feedrate = code_value(); c4dc: 0e 94 9d 60 call 0xc13a ; 0xc13a c4e0: 6b 01 movw r12, r22 c4e2: 7c 01 movw r14, r24 if(next_feedrate > 0.f) feedrate = next_feedrate; c4e4: 20 e0 ldi r18, 0x00 ; 0 c4e6: 30 e0 ldi r19, 0x00 ; 0 c4e8: a9 01 movw r20, r18 c4ea: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> c4ee: 18 16 cp r1, r24 c4f0: 44 f4 brge .+16 ; 0xc502 c4f2: c0 92 b8 02 sts 0x02B8, r12 ; 0x8002b8 c4f6: d0 92 b9 02 sts 0x02B9, r13 ; 0x8002b9 c4fa: e0 92 ba 02 sts 0x02BA, r14 ; 0x8002ba c4fe: f0 92 bb 02 sts 0x02BB, r15 ; 0x8002bb } } c502: 0f 90 pop r0 c504: 0f 90 pop r0 c506: 0f 90 pop r0 c508: df 91 pop r29 c50a: cf 91 pop r28 c50c: 1f 91 pop r17 c50e: 0f 91 pop r16 c510: ff 90 pop r15 c512: ef 90 pop r14 c514: df 90 pop r13 c516: cf 90 pop r12 c518: bf 90 pop r11 c51a: af 90 pop r10 c51c: 9f 90 pop r9 c51e: 8f 90 pop r8 c520: 7f 90 pop r7 c522: 6f 90 pop r6 c524: 5f 90 pop r5 c526: 4f 90 pop r4 c528: 3f 90 pop r3 c52a: 2f 90 pop r2 c52c: 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? c52e: f7 01 movw r30, r14 c530: 80 81 ld r24, Z c532: 91 81 ldd r25, Z+1 ; 0x01 c534: a2 81 ldd r26, Z+2 ; 0x02 c536: b3 81 ldd r27, Z+3 ; 0x03 c538: ea 81 ldd r30, Y+2 ; 0x02 c53a: fb 81 ldd r31, Y+3 ; 0x03 c53c: 80 83 st Z, r24 c53e: 91 83 std Z+1, r25 ; 0x01 c540: a2 83 std Z+2, r26 ; 0x02 c542: b3 83 std Z+3, r27 ; 0x03 c544: b9 cf rjmp .-142 ; 0xc4b8 0000c546 : } } void dcode_core(daddr_t addr_start, const daddr_t addr_end, const dcode_mem_t type, uint8_t dcode, const char* type_desc) { c546: 2f 92 push r2 c548: 3f 92 push r3 c54a: 4f 92 push r4 c54c: 5f 92 push r5 c54e: 6f 92 push r6 c550: 7f 92 push r7 c552: 8f 92 push r8 c554: 9f 92 push r9 c556: af 92 push r10 c558: bf 92 push r11 c55a: cf 92 push r12 c55c: df 92 push r13 c55e: ef 92 push r14 c560: ff 92 push r15 c562: 0f 93 push r16 c564: 1f 93 push r17 c566: cf 93 push r28 c568: df 93 push r29 c56a: cd b7 in r28, 0x3d ; 61 c56c: de b7 in r29, 0x3e ; 62 c56e: 65 97 sbiw r28, 0x15 ; 21 c570: 0f b6 in r0, 0x3f ; 63 c572: f8 94 cli c574: de bf out 0x3e, r29 ; 62 c576: 0f be out 0x3f, r0 ; 63 c578: cd bf out 0x3d, r28 ; 61 c57a: 69 8b std Y+17, r22 ; 0x11 c57c: 7a 8b std Y+18, r23 ; 0x12 c57e: 8b 8b std Y+19, r24 ; 0x13 c580: 9c 8b std Y+20, r25 ; 0x14 c582: 49 01 movw r8, r18 c584: 5a 01 movw r10, r20 c586: 30 2e mov r3, r16 c588: cd 8a std Y+21, r12 ; 0x15 c58a: 2d 2c mov r2, r13 KEEPALIVE_STATE(NOT_BUSY); c58c: 81 e0 ldi r24, 0x01 ; 1 c58e: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be DBG(_N("D%d - Read/Write %S\n"), dcode, type_desc); c592: df 92 push r13 c594: 2d 89 ldd r18, Y+21 ; 0x15 c596: 2f 93 push r18 c598: 1f 92 push r1 c59a: ef 92 push r14 c59c: 89 ea ldi r24, 0xA9 ; 169 c59e: 95 e6 ldi r25, 0x65 ; 101 c5a0: 9f 93 push r25 c5a2: 8f 93 push r24 c5a4: 0f 94 de da call 0x3b5bc ; 0x3b5bc daddr_t count = -1; // RW the entire space by default if (code_seen('A')) c5a8: 81 e4 ldi r24, 0x41 ; 65 c5aa: 0e 94 d6 5b call 0xb7ac ; 0xb7ac c5ae: 0f 90 pop r0 c5b0: 0f 90 pop r0 c5b2: 0f 90 pop r0 c5b4: 0f 90 pop r0 c5b6: 0f 90 pop r0 c5b8: 0f 90 pop r0 c5ba: 88 23 and r24, r24 c5bc: a1 f0 breq .+40 ; 0xc5e6 addr_start = (strchr_pointer[1] == 'x')?strtol(strchr_pointer + 2, 0, 16):(int)code_value(); c5be: 80 91 95 03 lds r24, 0x0395 ; 0x800395 c5c2: 90 91 96 03 lds r25, 0x0396 ; 0x800396 c5c6: fc 01 movw r30, r24 c5c8: 21 81 ldd r18, Z+1 ; 0x01 c5ca: 28 37 cpi r18, 0x78 ; 120 c5cc: 09 f0 breq .+2 ; 0xc5d0 c5ce: 69 c0 rjmp .+210 ; 0xc6a2 c5d0: 40 e1 ldi r20, 0x10 ; 16 c5d2: 50 e0 ldi r21, 0x00 ; 0 c5d4: 70 e0 ldi r23, 0x00 ; 0 c5d6: 60 e0 ldi r22, 0x00 ; 0 c5d8: 02 96 adiw r24, 0x02 ; 2 c5da: 0f 94 a7 d7 call 0x3af4e ; 0x3af4e c5de: 69 8b std Y+17, r22 ; 0x11 c5e0: 7a 8b std Y+18, r23 ; 0x12 c5e2: 8b 8b std Y+19, r24 ; 0x13 c5e4: 9c 8b std Y+20, r25 ; 0x14 if (code_seen('C')) c5e6: 83 e4 ldi r24, 0x43 ; 67 c5e8: 0e 94 d6 5b call 0xb7ac ; 0xb7ac c5ec: 88 23 and r24, r24 c5ee: 09 f4 brne .+2 ; 0xc5f2 c5f0: 65 c0 rjmp .+202 ; 0xc6bc count = code_value_long(); c5f2: 0e 94 82 5b call 0xb704 ; 0xb704 c5f6: 2b 01 movw r4, r22 c5f8: 3c 01 movw r6, r24 c5fa: c9 88 ldd r12, Y+17 ; 0x11 c5fc: da 88 ldd r13, Y+18 ; 0x12 c5fe: eb 88 ldd r14, Y+19 ; 0x13 c600: fc 88 ldd r15, Y+20 ; 0x14 c602: 8c 14 cp r8, r12 c604: 9d 04 cpc r9, r13 c606: ae 04 cpc r10, r14 c608: bf 04 cpc r11, r15 c60a: 10 f4 brcc .+4 ; 0xc610 c60c: 75 01 movw r14, r10 c60e: 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) c610: d3 01 movw r26, r6 c612: c2 01 movw r24, r4 c614: 8c 0d add r24, r12 c616: 9d 1d adc r25, r13 c618: ae 1d adc r26, r14 c61a: bf 1d adc r27, r15 c61c: 88 16 cp r8, r24 c61e: 99 06 cpc r9, r25 c620: aa 06 cpc r10, r26 c622: bb 06 cpc r11, r27 c624: 28 f0 brcs .+10 ; 0xc630 c626: 8c 15 cp r24, r12 c628: 9d 05 cpc r25, r13 c62a: ae 05 cpc r26, r14 c62c: bf 05 cpc r27, r15 c62e: 30 f4 brcc .+12 ; 0xc63c count = addr_end - addr_start; c630: 24 01 movw r4, r8 c632: 35 01 movw r6, r10 c634: 4c 18 sub r4, r12 c636: 5d 08 sbc r5, r13 c638: 6e 08 sbc r6, r14 c63a: 7f 08 sbc r7, r15 if (code_seen('X')) c63c: 88 e5 ldi r24, 0x58 ; 88 c63e: 0e 94 d6 5b call 0xb7ac ; 0xb7ac c642: 88 23 and r24, r24 c644: 09 f4 brne .+2 ; 0xc648 c646: 91 c0 rjmp .+290 ; 0xc76a { uint8_t data[16]; count = parse_hex(strchr_pointer + 1, data, 16); c648: 20 91 95 03 lds r18, 0x0395 ; 0x800395 c64c: 30 91 96 03 lds r19, 0x0396 ; 0x800396 c650: 2f 5f subi r18, 0xFF ; 255 c652: 3f 4f sbci r19, 0xFF ; 255 c654: fe 01 movw r30, r28 c656: 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; c658: 10 e0 ldi r17, 0x00 ; 0 c65a: 00 e0 ldi r16, 0x00 ; 0 c65c: 4f 01 movw r8, r30 c65e: d9 01 movw r26, r18 while (*hex) c660: 8c 91 ld r24, X c662: 2f 5f subi r18, 0xFF ; 255 c664: 3f 4f sbci r19, 0xFF ; 255 c666: 88 23 and r24, r24 c668: 09 f4 brne .+2 ; 0xc66c c66a: 3f c0 rjmp .+126 ; 0xc6ea { if (count && (parsed >= count)) break; c66c: 00 31 cpi r16, 0x10 ; 16 c66e: 11 05 cpc r17, r1 c670: e1 f1 breq .+120 ; 0xc6ea char c = *(hex++); if (c == ' ') continue; c672: 80 32 cpi r24, 0x20 ; 32 c674: a1 f3 breq .-24 ; 0xc65e if (c == '\n') break; c676: 8a 30 cpi r24, 0x0A ; 10 c678: c1 f1 breq .+112 ; 0xc6ea uint8_t val = 0x00; if ((c >= '0') && (c <= '9')) val |= ((c - '0') << 4); c67a: 90 ed ldi r25, 0xD0 ; 208 c67c: 98 0f add r25, r24 c67e: 9a 30 cpi r25, 0x0A ; 10 c680: 10 f5 brcc .+68 ; 0xc6c6 c682: 82 95 swap r24 c684: 80 7f andi r24, 0xF0 ; 240 else if ((c >= 'a') && (c <= 'f')) val |= ((c - 'a' + 10) << 4); else return -parsed; c = *(hex++); c686: 9d 01 movw r18, r26 c688: 2e 5f subi r18, 0xFE ; 254 c68a: 3f 4f sbci r19, 0xFF ; 255 if ((c >= '0') && (c <= '9')) val |= (c - '0'); c68c: 11 96 adiw r26, 0x01 ; 1 c68e: 9c 91 ld r25, X c690: 40 ed ldi r20, 0xD0 ; 208 c692: 49 0f add r20, r25 c694: 4a 30 cpi r20, 0x0A ; 10 c696: f8 f4 brcc .+62 ; 0xc6d6 c698: 84 2b or r24, r20 else if ((c >= 'a') && (c <= 'f')) val |= (c - 'a' + 10); else return -parsed; data[parsed] = val; c69a: 81 93 st Z+, r24 parsed++; c69c: 0f 5f subi r16, 0xFF ; 255 c69e: 1f 4f sbci r17, 0xFF ; 255 c6a0: de cf rjmp .-68 ; 0xc65e { 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(); c6a2: 0e 94 9d 60 call 0xc13a ; 0xc13a c6a6: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> c6aa: 9b 01 movw r18, r22 c6ac: 77 0f add r23, r23 c6ae: 44 0b sbc r20, r20 c6b0: 55 0b sbc r21, r21 c6b2: 29 8b std Y+17, r18 ; 0x11 c6b4: 3a 8b std Y+18, r19 ; 0x12 c6b6: 4b 8b std Y+19, r20 ; 0x13 c6b8: 5c 8b std Y+20, r21 ; 0x14 c6ba: 95 cf rjmp .-214 ; 0xc5e6 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 c6bc: 44 24 eor r4, r4 c6be: 4a 94 dec r4 c6c0: 54 2c mov r5, r4 c6c2: 32 01 movw r6, r4 c6c4: 9a cf rjmp .-204 ; 0xc5fa 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); c6c6: 9f e9 ldi r25, 0x9F ; 159 c6c8: 98 0f add r25, r24 c6ca: 96 30 cpi r25, 0x06 ; 6 c6cc: 58 f4 brcc .+22 ; 0xc6e4 c6ce: 82 95 swap r24 c6d0: 80 7f andi r24, 0xF0 ; 240 c6d2: 80 57 subi r24, 0x70 ; 112 c6d4: d8 cf rjmp .-80 ; 0xc686 else return -parsed; c = *(hex++); if ((c >= '0') && (c <= '9')) val |= (c - '0'); else if ((c >= 'a') && (c <= 'f')) val |= (c - 'a' + 10); c6d6: 4f e9 ldi r20, 0x9F ; 159 c6d8: 49 0f add r20, r25 c6da: 46 30 cpi r20, 0x06 ; 6 c6dc: 18 f4 brcc .+6 ; 0xc6e4 c6de: 97 55 subi r25, 0x57 ; 87 c6e0: 89 2b or r24, r25 c6e2: db cf rjmp .-74 ; 0xc69a else return -parsed; c6e4: 11 95 neg r17 c6e6: 01 95 neg r16 c6e8: 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); c6ea: 28 01 movw r4, r16 c6ec: 01 2e mov r0, r17 c6ee: 00 0c add r0, r0 c6f0: 66 08 sbc r6, r6 c6f2: 77 08 sbc r7, r7 write_mem(addr_start, count, data, type); c6f4: da 8a std Y+18, r13 ; 0x12 c6f6: 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++) c6f8: b1 2c mov r11, r1 c6fa: a1 2c mov r10, r1 c6fc: 0a 15 cp r16, r10 c6fe: 1b 05 cpc r17, r11 c700: f1 f0 breq .+60 ; 0xc73e { switch (type) c702: 33 20 and r3, r3 c704: 39 f0 breq .+14 ; 0xc714 c706: 31 e0 ldi r19, 0x01 ; 1 c708: 33 16 cp r3, r19 c70a: 71 f0 breq .+28 ; 0xc728 } // 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++) c70c: 4f ef ldi r20, 0xFF ; 255 c70e: a4 1a sub r10, r20 c710: b4 0a sbc r11, r20 c712: f4 cf rjmp .-24 ; 0xc6fc { switch (type) { case dcode_mem_t::sram: *((uint8_t*)address) = data[i]; break; c714: f4 01 movw r30, r8 c716: ea 0d add r30, r10 c718: fb 1d adc r31, r11 c71a: 80 81 ld r24, Z c71c: e9 89 ldd r30, Y+17 ; 0x11 c71e: fa 89 ldd r31, Y+18 ; 0x12 c720: ea 0d add r30, r10 c722: fb 1d adc r31, r11 c724: 80 83 st Z, r24 c726: f2 cf rjmp .-28 ; 0xc70c case dcode_mem_t::eeprom: eeprom_write_byte_notify((uint8_t*)address, data[i]); break; c728: f4 01 movw r30, r8 c72a: ea 0d add r30, r10 c72c: 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); c72e: 60 81 ld r22, Z c730: 89 89 ldd r24, Y+17 ; 0x11 c732: 9a 89 ldd r25, Y+18 ; 0x12 c734: 8a 0d add r24, r10 c736: 9b 1d adc r25, r11 c738: 0f 94 64 dc call 0x3b8c8 ; 0x3b8c8 c73c: e7 cf rjmp .-50 ; 0xc70c { 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); c73e: ff 92 push r15 c740: ef 92 push r14 c742: df 92 push r13 c744: cf 92 push r12 c746: 2f 92 push r2 c748: 5d 89 ldd r21, Y+21 ; 0x15 c74a: 5f 93 push r21 c74c: 7f 92 push r7 c74e: 6f 92 push r6 c750: 5f 92 push r5 c752: 4f 92 push r4 c754: 8d e7 ldi r24, 0x7D ; 125 c756: 95 e6 ldi r25, 0x65 ; 101 c758: 9f 93 push r25 c75a: 8f 93 push r24 c75c: 0f 94 de da call 0x3b5bc ; 0x3b5bc c760: 0f b6 in r0, 0x3f ; 63 c762: f8 94 cli c764: de bf out 0x3e, r29 ; 62 c766: 0f be out 0x3f, r0 ; 63 c768: 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); c76a: 03 2d mov r16, r3 c76c: a3 01 movw r20, r6 c76e: 92 01 movw r18, r4 c770: c7 01 movw r24, r14 c772: b6 01 movw r22, r12 c774: 0f 94 29 86 call 0x30c52 ; 0x30c52 } c778: 65 96 adiw r28, 0x15 ; 21 c77a: 0f b6 in r0, 0x3f ; 63 c77c: f8 94 cli c77e: de bf out 0x3e, r29 ; 62 c780: 0f be out 0x3f, r0 ; 63 c782: cd bf out 0x3d, r28 ; 61 c784: df 91 pop r29 c786: cf 91 pop r28 c788: 1f 91 pop r17 c78a: 0f 91 pop r16 c78c: ff 90 pop r15 c78e: ef 90 pop r14 c790: df 90 pop r13 c792: cf 90 pop r12 c794: bf 90 pop r11 c796: af 90 pop r10 c798: 9f 90 pop r9 c79a: 8f 90 pop r8 c79c: 7f 90 pop r7 c79e: 6f 90 pop r6 c7a0: 5f 90 pop r5 c7a2: 4f 90 pop r4 c7a4: 3f 90 pop r3 c7a6: 2f 90 pop r2 c7a8: 08 95 ret 0000c7aa : #define DBG(args...) printf_P(args) inline void print_hex_nibble(uint8_t val) { putchar((val > 9)?(val - 10 + 'a'):(val + '0')); c7aa: 60 91 1c 18 lds r22, 0x181C ; 0x80181c <__iob+0x2> c7ae: 70 91 1d 18 lds r23, 0x181D ; 0x80181d <__iob+0x3> c7b2: 90 e0 ldi r25, 0x00 ; 0 c7b4: 8a 30 cpi r24, 0x0A ; 10 c7b6: 20 f0 brcs .+8 ; 0xc7c0 c7b8: 89 5a subi r24, 0xA9 ; 169 c7ba: 9f 4f sbci r25, 0xFF ; 255 c7bc: 0d 94 84 da jmp 0x3b508 ; 0x3b508 c7c0: c0 96 adiw r24, 0x30 ; 48 c7c2: fc cf rjmp .-8 ; 0xc7bc 0000c7c4 : 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); c7c4: 84 ff sbrs r24, 4 c7c6: 18 c0 rjmp .+48 ; 0xc7f8 c7c8: 8d 9a sbi 0x11, 5 ; 17 WRITE(LCD_PINS_D5, value & 0x20); c7ca: 85 ff sbrs r24, 5 c7cc: 17 c0 rjmp .+46 ; 0xc7fc c7ce: a4 9a sbi 0x14, 4 ; 20 WRITE(LCD_PINS_D6, value & 0x40); c7d0: 2f b7 in r18, 0x3f ; 63 c7d2: 86 ff sbrs r24, 6 c7d4: 15 c0 rjmp .+42 ; 0xc800 c7d6: f8 94 cli c7d8: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> c7dc: 90 68 ori r25, 0x80 ; 128 c7de: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> c7e2: 2f bf out 0x3f, r18 ; 63 WRITE(LCD_PINS_D7, value & 0x80); c7e4: 87 ff sbrs r24, 7 c7e6: 11 c0 rjmp .+34 ; 0xc80a c7e8: 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); c7ea: 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); c7ec: 85 e0 ldi r24, 0x05 ; 5 c7ee: 8a 95 dec r24 c7f0: f1 f7 brne .-4 ; 0xc7ee c7f2: 00 00 nop _delay_us(1); // enable pulse must be >450ns WRITE(LCD_PINS_ENABLE,LOW); c7f4: 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(); } c7f6: 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); c7f8: 8d 98 cbi 0x11, 5 ; 17 c7fa: e7 cf rjmp .-50 ; 0xc7ca WRITE(LCD_PINS_D5, value & 0x20); c7fc: a4 98 cbi 0x14, 4 ; 20 c7fe: e8 cf rjmp .-48 ; 0xc7d0 WRITE(LCD_PINS_D6, value & 0x40); c800: f8 94 cli c802: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> c806: 9f 77 andi r25, 0x7F ; 127 c808: ea cf rjmp .-44 ; 0xc7de WRITE(LCD_PINS_D7, value & 0x80); c80a: a3 98 cbi 0x14, 3 ; 20 c80c: ee cf rjmp .-36 ; 0xc7ea 0000c80e : lcd_pulseEnable(); } static void lcd_send(uint8_t data, uint8_t flags, uint16_t duration = LCD_DEFAULT_DELAY) { c80e: 0f 93 push r16 c810: 1f 93 push r17 c812: cf 93 push r28 c814: df 93 push r29 c816: c8 2f mov r28, r24 c818: d6 2f mov r29, r22 c81a: 8a 01 movw r16, r20 WRITE(LCD_PINS_RS,flags&LCD_RS_FLAG); c81c: 60 ff sbrs r22, 0 c81e: 15 c0 rjmp .+42 ; 0xc84a c820: 5d 9a sbi 0x0b, 5 ; 11 c822: 8a e1 ldi r24, 0x1A ; 26 c824: 8a 95 dec r24 c826: f1 f7 brne .-4 ; 0xc824 c828: 00 c0 rjmp .+0 ; 0xc82a _delay_us(5); lcd_writebits(data); c82a: 8c 2f mov r24, r28 c82c: 0e 94 e2 63 call 0xc7c4 ; 0xc7c4 #ifndef LCD_8BIT if (!(flags & LCD_HALF_FLAG)) { c830: d1 fd sbrc r29, 1 c832: 04 c0 rjmp .+8 ; 0xc83c // _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 c834: 8c 2f mov r24, r28 c836: 82 95 swap r24 c838: 0e 94 e2 63 call 0xc7c4 ; 0xc7c4 } #endif delayMicroseconds(duration); c83c: c8 01 movw r24, r16 } c83e: df 91 pop r29 c840: cf 91 pop r28 c842: 1f 91 pop r17 c844: 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); c846: 0c 94 83 e8 jmp 0x1d106 ; 0x1d106 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); c84a: 5d 98 cbi 0x0b, 5 ; 11 c84c: ea cf rjmp .-44 ; 0xc822 0000c84e : return def; } return val; } void __attribute__((noinline)) eeprom_init_default_float(float *__p, float def) { c84e: cf 92 push r12 c850: df 92 push r13 c852: ef 92 push r14 c854: ff 92 push r15 c856: cf 93 push r28 c858: df 93 push r29 c85a: ec 01 movw r28, r24 c85c: 6a 01 movw r12, r20 c85e: 7b 01 movw r14, r22 if (eeprom_read_dword((uint32_t*)__p) == EEPROM_EMPTY_VALUE32) c860: 0f 94 24 dc call 0x3b848 ; 0x3b848 c864: 6f 3f cpi r22, 0xFF ; 255 c866: 7f 4f sbci r23, 0xFF ; 255 c868: 8f 4f sbci r24, 0xFF ; 255 c86a: 9f 4f sbci r25, 0xFF ; 255 c86c: 59 f4 brne .+22 ; 0xc884 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); c86e: b7 01 movw r22, r14 c870: a6 01 movw r20, r12 c872: 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); } c874: df 91 pop r29 c876: cf 91 pop r28 c878: ff 90 pop r15 c87a: ef 90 pop r14 c87c: df 90 pop r13 c87e: 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); c880: 0d 94 72 dc jmp 0x3b8e4 ; 0x3b8e4 } 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); } c884: df 91 pop r29 c886: cf 91 pop r28 c888: ff 90 pop r15 c88a: ef 90 pop r14 c88c: df 90 pop r13 c88e: cf 90 pop r12 c890: 08 95 ret 0000c892 : /// 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)); c892: 80 e1 ldi r24, 0x10 ; 16 c894: e2 e9 ldi r30, 0x92 ; 146 c896: f6 e0 ldi r31, 0x06 ; 6 c898: a3 e7 ldi r26, 0x73 ; 115 c89a: b2 e0 ldi r27, 0x02 ; 2 c89c: 01 90 ld r0, Z+ c89e: 0d 92 st X+, r0 c8a0: 8a 95 dec r24 c8a2: e1 f7 brne .-8 ; 0xc89c saved_feedmultiply2 = feedmultiply; //save feedmultiply c8a4: 80 91 39 02 lds r24, 0x0239 ; 0x800239 c8a8: 90 91 3a 02 lds r25, 0x023A ; 0x80023a c8ac: 90 93 72 03 sts 0x0372, r25 ; 0x800372 c8b0: 80 93 71 03 sts 0x0371, r24 ; 0x800371 saved_extruder_temperature = (uint16_t)degTargetHotend(active_extruder); c8b4: 80 91 b6 0d lds r24, 0x0DB6 ; 0x800db6 c8b8: 90 91 b7 0d lds r25, 0x0DB7 ; 0x800db7 c8bc: 90 93 ad 05 sts 0x05AD, r25 ; 0x8005ad c8c0: 80 93 ac 05 sts 0x05AC, r24 ; 0x8005ac saved_bed_temperature = (uint8_t)degTargetBed(); c8c4: 80 91 72 06 lds r24, 0x0672 ; 0x800672 c8c8: 80 93 ae 05 sts 0x05AE, r24 ; 0x8005ae saved_extruder_relative_mode = axis_relative_modes & E_AXIS_MASK; c8cc: 80 91 e5 03 lds r24, 0x03E5 ; 0x8003e5 c8d0: 83 fb bst r24, 3 c8d2: 88 27 eor r24, r24 c8d4: 80 f9 bld r24, 0 c8d6: 80 93 64 05 sts 0x0564, r24 ; 0x800564 saved_fan_speed = fanSpeed; c8da: 80 91 e7 03 lds r24, 0x03E7 ; 0x8003e7 c8de: 80 93 ab 05 sts 0x05AB, r24 ; 0x8005ab isPartialBackupAvailable = true; c8e2: 81 e0 ldi r24, 0x01 ; 1 c8e4: 80 93 a2 06 sts 0x06A2, r24 ; 0x8006a2 } c8e8: 08 95 ret 0000c8ea <_GLOBAL__sub_D_card>: while(!lcd_clicked()) { delay_keep_alive(0); } KEEPALIVE_STATE(busy_state_backup); } c8ea: cf 93 push r28 c8ec: df 93 push r29 //------------------------------------------------------------------------------ /** * \class SdFile * \brief SdBaseFile with Print. */ class SdFile : public SdBaseFile/*, public Print*/ { c8ee: 80 e2 ldi r24, 0x20 ; 32 c8f0: 97 e1 ldi r25, 0x17 ; 23 c8f2: 0e 94 31 77 call 0xee62 ; 0xee62 #ifdef SDSUPPORT #define MAX_DIR_DEPTH 6 #include "SdFile.h" class CardReader c8f6: 8e e5 ldi r24, 0x5E ; 94 c8f8: 95 e1 ldi r25, 0x15 ; 21 c8fa: 89 2b or r24, r25 c8fc: 51 f0 breq .+20 ; 0xc912 <_GLOBAL__sub_D_card+0x28> c8fe: c0 e3 ldi r28, 0x30 ; 48 c900: d6 e1 ldi r29, 0x16 ; 22 c902: a3 97 sbiw r28, 0x23 ; 35 c904: ce 01 movw r24, r28 c906: 0e 94 31 77 call 0xee62 ; 0xee62 c90a: 85 e1 ldi r24, 0x15 ; 21 c90c: ce 35 cpi r28, 0x5E ; 94 c90e: d8 07 cpc r29, r24 c910: c1 f7 brne .-16 ; 0xc902 <_GLOBAL__sub_D_card+0x18> c912: 8b e3 ldi r24, 0x3B ; 59 c914: 95 e1 ldi r25, 0x15 ; 21 c916: 0e 94 31 77 call 0xee62 ; 0xee62 c91a: 86 e1 ldi r24, 0x16 ; 22 c91c: 95 e1 ldi r25, 0x15 ; 21 c91e: df 91 pop r29 c920: cf 91 pop r28 c922: 0c 94 31 77 jmp 0xee62 ; 0xee62 0000c926 : print_time_to_change_normal = PRINT_TIME_REMAINING_INIT; print_time_to_change_silent = PRINT_TIME_REMAINING_INIT; } void load_filament_final_feed() { c926: cf 93 push r28 c928: df 93 push r29 current_position[E_AXIS]+= FILAMENTCHANGE_FINALFEED; c92a: c2 e9 ldi r28, 0x92 ; 146 c92c: d6 e0 ldi r29, 0x06 ; 6 c92e: 20 e0 ldi r18, 0x00 ; 0 c930: 30 e0 ldi r19, 0x00 ; 0 c932: 48 ec ldi r20, 0xC8 ; 200 c934: 51 e4 ldi r21, 0x41 ; 65 c936: 6c 85 ldd r22, Y+12 ; 0x0c c938: 7d 85 ldd r23, Y+13 ; 0x0d c93a: 8e 85 ldd r24, Y+14 ; 0x0e c93c: 9f 85 ldd r25, Y+15 ; 0x0f c93e: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> c942: 6c 87 std Y+12, r22 ; 0x0c c944: 7d 87 std Y+13, r23 ; 0x0d c946: 8e 87 std Y+14, r24 ; 0x0e c948: 9f 87 std Y+15, r25 ; 0x0f plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FINAL); c94a: 63 e3 ldi r22, 0x33 ; 51 c94c: 73 e3 ldi r23, 0x33 ; 51 c94e: 83 e5 ldi r24, 0x53 ; 83 c950: 90 e4 ldi r25, 0x40 ; 64 } c952: df 91 pop r29 c954: cf 91 pop r28 } void load_filament_final_feed() { current_position[E_AXIS]+= FILAMENTCHANGE_FINALFEED; plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FINAL); c956: 0d 94 49 c0 jmp 0x38092 ; 0x38092 0000c95a : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); c95a: 60 e0 ldi r22, 0x00 ; 0 c95c: 85 ea ldi r24, 0xA5 ; 165 c95e: 9f e0 ldi r25, 0x0F ; 15 c960: 0f 94 40 dc call 0x3b880 ; 0x3b880 c964: 60 e0 ldi r22, 0x00 ; 0 c966: 8f e7 ldi r24, 0x7F ; 127 c968: 9c e0 ldi r25, 0x0C ; 12 c96a: 0f 94 40 dc call 0x3b880 ; 0x3b880 // 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; c96e: 80 e0 ldi r24, 0x00 ; 0 c970: 90 e0 ldi r25, 0x00 ; 0 c972: a0 e8 ldi r26, 0x80 ; 128 c974: bf eb ldi r27, 0xBF ; 191 c976: 80 93 83 02 sts 0x0283, r24 ; 0x800283 c97a: 90 93 84 02 sts 0x0284, r25 ; 0x800284 c97e: a0 93 85 02 sts 0x0285, r26 ; 0x800285 c982: b0 93 86 02 sts 0x0286, r27 ; 0x800286 saved_printing_type = PowerPanic::PRINT_TYPE_NONE; c986: 82 e0 ldi r24, 0x02 ; 2 c988: 80 93 6a 02 sts 0x026A, r24 ; 0x80026a saved_printing = false; c98c: 10 92 a9 0d sts 0x0DA9, r1 ; 0x800da9 } c990: 08 95 ret 0000c992 : enquecommandf_P(MSG_M23, filename); } void restore_extruder_temperature_from_ram() { if ((uint16_t)degTargetHotend(active_extruder) != saved_extruder_temperature) c992: 80 91 ac 05 lds r24, 0x05AC ; 0x8005ac c996: 90 91 ad 05 lds r25, 0x05AD ; 0x8005ad c99a: 20 91 b6 0d lds r18, 0x0DB6 ; 0x800db6 c99e: 30 91 b7 0d lds r19, 0x0DB7 ; 0x800db7 c9a2: 28 17 cp r18, r24 c9a4: 39 07 cpc r19, r25 c9a6: 71 f0 breq .+28 ; 0xc9c4 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; c9a8: 90 93 b7 0d sts 0x0DB7, r25 ; 0x800db7 c9ac: 80 93 b6 0d sts 0x0DB6, r24 ; 0x800db6 { setTargetHotend(saved_extruder_temperature); heating_status = HeatingStatus::EXTRUDER_HEATING; c9b0: 81 e0 ldi r24, 0x01 ; 1 c9b2: 80 93 e3 03 sts 0x03E3, r24 ; 0x8003e3 wait_for_heater(_millis(), active_extruder); c9b6: 0f 94 4c 29 call 0x25298 ; 0x25298 c9ba: 0f 94 e1 81 call 0x303c2 ; 0x303c2 heating_status = HeatingStatus::EXTRUDER_HEATING_COMPLETE; c9be: 82 e0 ldi r24, 0x02 ; 2 c9c0: 80 93 e3 03 sts 0x03E3, r24 ; 0x8003e3 } } c9c4: 08 95 ret 0000c9c6 : saved_fan_speed = fanSpeed; isPartialBackupAvailable = true; } void __attribute__((noinline)) refresh_saved_feedrate_multiplier_in_ram() { if (!saved_printing) { c9c6: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 c9ca: 88 23 and r24, r24 c9cc: 41 f0 breq .+16 ; 0xc9de // There is no saved print, therefore nothing to refresh return; } saved_feedmultiply2 = feedmultiply; c9ce: 80 91 39 02 lds r24, 0x0239 ; 0x800239 c9d2: 90 91 3a 02 lds r25, 0x023A ; 0x80023a c9d6: 90 93 72 03 sts 0x0372, r25 ; 0x800372 c9da: 80 93 71 03 sts 0x0371, r24 ; 0x800371 } c9de: 08 95 ret 0000c9e0 : //not sd printing nor usb printing } } void save_planner_global_state() { if (current_block && !(mesh_bed_leveling_flag || homing_flag)) c9e0: 80 91 a1 05 lds r24, 0x05A1 ; 0x8005a1 c9e4: 90 91 a2 05 lds r25, 0x05A2 ; 0x8005a2 c9e8: 00 97 sbiw r24, 0x00 ; 0 c9ea: 29 f1 breq .+74 ; 0xca36 c9ec: 20 91 a8 0d lds r18, 0x0DA8 ; 0x800da8 c9f0: 21 11 cpse r18, r1 c9f2: 21 c0 rjmp .+66 ; 0xca36 c9f4: 20 91 a7 0d lds r18, 0x0DA7 ; 0x800da7 c9f8: 21 11 cpse r18, r1 c9fa: 1d c0 rjmp .+58 ; 0xca36 { memcpy(saved_start_position, current_block->gcode_start_position, sizeof(saved_start_position)); c9fc: fc 01 movw r30, r24 c9fe: e8 5a subi r30, 0xA8 ; 168 ca00: ff 4f sbci r31, 0xFF ; 255 ca02: 20 e1 ldi r18, 0x10 ; 16 ca04: a3 e8 ldi r26, 0x83 ; 131 ca06: b2 e0 ldi r27, 0x02 ; 2 ca08: 01 90 ld r0, Z+ ca0a: 0d 92 st X+, r0 ca0c: 2a 95 dec r18 ca0e: e1 f7 brne .-8 ; 0xca08 saved_feedrate2 = current_block->gcode_feedrate; ca10: fc 01 movw r30, r24 ca12: e6 59 subi r30, 0x96 ; 150 ca14: ff 4f sbci r31, 0xFF ; 255 ca16: 20 81 ld r18, Z ca18: 31 81 ldd r19, Z+1 ; 0x01 ca1a: 30 93 5f 05 sts 0x055F, r19 ; 0x80055f ca1e: 20 93 5e 05 sts 0x055E, r18 ; 0x80055e saved_segment_idx = current_block->segment_idx; ca22: 88 59 subi r24, 0x98 ; 152 ca24: 9f 4f sbci r25, 0xFF ; 255 ca26: fc 01 movw r30, r24 ca28: 80 81 ld r24, Z ca2a: 91 81 ldd r25, Z+1 ; 0x01 ca2c: 90 93 6a 05 sts 0x056A, r25 ; 0x80056a ca30: 80 93 69 05 sts 0x0569, r24 ; 0x800569 ca34: 08 95 ret } else { saved_start_position[0] = SAVED_START_POSITION_UNSET; ca36: 80 e0 ldi r24, 0x00 ; 0 ca38: 90 e0 ldi r25, 0x00 ; 0 ca3a: a0 e8 ldi r26, 0x80 ; 128 ca3c: bf eb ldi r27, 0xBF ; 191 ca3e: 80 93 83 02 sts 0x0283, r24 ; 0x800283 ca42: 90 93 84 02 sts 0x0284, r25 ; 0x800284 ca46: a0 93 85 02 sts 0x0285, r26 ; 0x800285 ca4a: b0 93 86 02 sts 0x0286, r27 ; 0x800286 saved_feedrate2 = feedrate; ca4e: 60 91 b8 02 lds r22, 0x02B8 ; 0x8002b8 ca52: 70 91 b9 02 lds r23, 0x02B9 ; 0x8002b9 ca56: 80 91 ba 02 lds r24, 0x02BA ; 0x8002ba ca5a: 90 91 bb 02 lds r25, 0x02BB ; 0x8002bb ca5e: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> ca62: 70 93 5f 05 sts 0x055F, r23 ; 0x80055f ca66: 60 93 5e 05 sts 0x055E, r22 ; 0x80055e saved_segment_idx = 0; ca6a: 10 92 6a 05 sts 0x056A, r1 ; 0x80056a ca6e: 10 92 69 05 sts 0x0569, r1 ; 0x800569 } } ca72: 08 95 ret 0000ca74 : SERIAL_PROTOCOLPGM(" E:0 B:"); SERIAL_PROTOCOL_F(degBed(), 1); SERIAL_PROTOCOLLN(); } void save_print_file_state() { ca74: cf 92 push r12 ca76: df 92 push r13 ca78: ef 92 push r14 ca7a: ff 92 push r15 uint8_t nlines; uint16_t sdlen_cmdqueue; uint16_t sdlen_planner; if (card.sdprinting) { ca7c: 80 91 90 14 lds r24, 0x1490 ; 0x801490 ca80: 88 23 and r24, r24 ca82: d9 f1 breq .+118 ; 0xcafa saved_sdpos = sdpos_atomic; //atomic sd position of last command added in queue ca84: 80 91 82 03 lds r24, 0x0382 ; 0x800382 ca88: 90 91 83 03 lds r25, 0x0383 ; 0x800383 ca8c: a0 91 84 03 lds r26, 0x0384 ; 0x800384 ca90: b0 91 85 03 lds r27, 0x0385 ; 0x800385 ca94: 80 93 60 05 sts 0x0560, r24 ; 0x800560 ca98: 90 93 61 05 sts 0x0561, r25 ; 0x800561 ca9c: a0 93 62 05 sts 0x0562, r26 ; 0x800562 caa0: b0 93 63 05 sts 0x0563, r27 ; 0x800563 sdlen_planner = planner_calc_sd_length(); //length of sd commands in planner caa4: 0f 94 2f 63 call 0x2c65e ; 0x2c65e saved_sdpos -= sdlen_planner; caa8: c0 90 60 05 lds r12, 0x0560 ; 0x800560 caac: d0 90 61 05 lds r13, 0x0561 ; 0x800561 cab0: e0 90 62 05 lds r14, 0x0562 ; 0x800562 cab4: f0 90 63 05 lds r15, 0x0563 ; 0x800563 cab8: c8 1a sub r12, r24 caba: d9 0a sbc r13, r25 cabc: e1 08 sbc r14, r1 cabe: f1 08 sbc r15, r1 cac0: c0 92 60 05 sts 0x0560, r12 ; 0x800560 cac4: d0 92 61 05 sts 0x0561, r13 ; 0x800561 cac8: e0 92 62 05 sts 0x0562, r14 ; 0x800562 cacc: f0 92 63 05 sts 0x0563, r15 ; 0x800563 sdlen_cmdqueue = cmdqueue_calc_sd_length(); //length of sd commands in cmdqueue cad0: 0e 94 13 5b call 0xb626 ; 0xb626 saved_sdpos -= sdlen_cmdqueue; cad4: c8 1a sub r12, r24 cad6: d9 0a sbc r13, r25 cad8: e1 08 sbc r14, r1 cada: f1 08 sbc r15, r1 cadc: c0 92 60 05 sts 0x0560, r12 ; 0x800560 cae0: d0 92 61 05 sts 0x0561, r13 ; 0x800561 cae4: e0 92 62 05 sts 0x0562, r14 ; 0x800562 cae8: f0 92 63 05 sts 0x0563, r15 ; 0x800563 saved_printing_type = PowerPanic::PRINT_TYPE_SD; caec: 10 92 6a 02 sts 0x026A, r1 ; 0x80026a } else { saved_printing_type = PowerPanic::PRINT_TYPE_NONE; //not sd printing nor usb printing } } caf0: ff 90 pop r15 caf2: ef 90 pop r14 caf4: df 90 pop r13 caf6: cf 90 pop r12 caf8: 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 cafa: 80 91 0e 05 lds r24, 0x050E ; 0x80050e cafe: 88 23 and r24, r24 cb00: b1 f1 breq .+108 ; 0xcb6e saved_sdpos = gcode_LastN; //start with line number of command added recently to cmd queue cb02: 80 91 7a 03 lds r24, 0x037A ; 0x80037a cb06: 90 91 7b 03 lds r25, 0x037B ; 0x80037b cb0a: a0 91 7c 03 lds r26, 0x037C ; 0x80037c cb0e: b0 91 7d 03 lds r27, 0x037D ; 0x80037d cb12: 80 93 60 05 sts 0x0560, r24 ; 0x800560 cb16: 90 93 61 05 sts 0x0561, r25 ; 0x800561 cb1a: a0 93 62 05 sts 0x0562, r26 ; 0x800562 cb1e: b0 93 63 05 sts 0x0563, r27 ; 0x800563 //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 cb22: 0f 94 2f 63 call 0x2c65e ; 0x2c65e saved_sdpos -= nlines; cb26: 40 91 60 05 lds r20, 0x0560 ; 0x800560 cb2a: 50 91 61 05 lds r21, 0x0561 ; 0x800561 cb2e: 60 91 62 05 lds r22, 0x0562 ; 0x800562 cb32: 70 91 63 05 lds r23, 0x0563 ; 0x800563 cb36: 48 1b sub r20, r24 cb38: 51 09 sbc r21, r1 cb3a: 61 09 sbc r22, r1 cb3c: 71 09 sbc r23, r1 saved_sdpos -= buflen; //number of blocks in cmd buffer cb3e: 80 91 a3 10 lds r24, 0x10A3 ; 0x8010a3 cb42: 90 91 a4 10 lds r25, 0x10A4 ; 0x8010a4 cb46: 09 2e mov r0, r25 cb48: 00 0c add r0, r0 cb4a: aa 0b sbc r26, r26 cb4c: bb 0b sbc r27, r27 cb4e: 48 1b sub r20, r24 cb50: 59 0b sbc r21, r25 cb52: 6a 0b sbc r22, r26 cb54: 7b 0b sbc r23, r27 cb56: 40 93 60 05 sts 0x0560, r20 ; 0x800560 cb5a: 50 93 61 05 sts 0x0561, r21 ; 0x800561 cb5e: 60 93 62 05 sts 0x0562, r22 ; 0x800562 cb62: 70 93 63 05 sts 0x0563, r23 ; 0x800563 saved_printing_type = PowerPanic::PRINT_TYPE_HOST; cb66: 81 e0 ldi r24, 0x01 ; 1 } else { saved_printing_type = PowerPanic::PRINT_TYPE_NONE; cb68: 80 93 6a 02 sts 0x026A, r24 ; 0x80026a cb6c: c1 cf rjmp .-126 ; 0xcaf0 cb6e: 82 e0 ldi r24, 0x02 ; 2 cb70: fb cf rjmp .-10 ; 0xcb68 0000cb72 : if (extrudemultiply != 100) out *= float(extrudemultiply) * 0.01f; return out; } void calculate_extruder_multipliers() { cb72: cf 92 push r12 cb74: df 92 push r13 cb76: ef 92 push r14 cb78: ff 92 push r15 extruder_multiplier[0] = calculate_extruder_multiplier(cs.filament_size[0]); cb7a: c0 90 56 0e lds r12, 0x0E56 ; 0x800e56 cb7e: d0 90 57 0e lds r13, 0x0E57 ; 0x800e57 cb82: e0 90 58 0e lds r14, 0x0E58 ; 0x800e58 cb86: f0 90 59 0e lds r15, 0x0E59 ; 0x800e59 } } float calculate_extruder_multiplier(float diameter) { float out = 1.f; if (cs.volumetric_enabled && diameter > 0.f) { cb8a: 80 91 55 0e lds r24, 0x0E55 ; 0x800e55 cb8e: 88 23 and r24, r24 cb90: 09 f4 brne .+2 ; 0xcb94 cb92: 4e c0 rjmp .+156 ; 0xcc30 cb94: 20 e0 ldi r18, 0x00 ; 0 cb96: 30 e0 ldi r19, 0x00 ; 0 cb98: a9 01 movw r20, r18 cb9a: c7 01 movw r24, r14 cb9c: b6 01 movw r22, r12 cb9e: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> cba2: 18 16 cp r1, r24 cba4: 0c f0 brlt .+2 ; 0xcba8 cba6: 44 c0 rjmp .+136 ; 0xcc30 float area = M_PI * diameter * diameter * 0.25; cba8: 2b ed ldi r18, 0xDB ; 219 cbaa: 3f e0 ldi r19, 0x0F ; 15 cbac: 49 e4 ldi r20, 0x49 ; 73 cbae: 50 e4 ldi r21, 0x40 ; 64 cbb0: c7 01 movw r24, r14 cbb2: b6 01 movw r22, r12 cbb4: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> cbb8: a7 01 movw r20, r14 cbba: 96 01 movw r18, r12 cbbc: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> cbc0: 20 e0 ldi r18, 0x00 ; 0 cbc2: 30 e0 ldi r19, 0x00 ; 0 cbc4: 40 e8 ldi r20, 0x80 ; 128 cbc6: 5e e3 ldi r21, 0x3E ; 62 cbc8: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> cbcc: 9b 01 movw r18, r22 cbce: ac 01 movw r20, r24 out = 1.f / area; cbd0: 60 e0 ldi r22, 0x00 ; 0 cbd2: 70 e0 ldi r23, 0x00 ; 0 cbd4: 80 e8 ldi r24, 0x80 ; 128 cbd6: 9f e3 ldi r25, 0x3F ; 63 cbd8: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> cbdc: 6b 01 movw r12, r22 cbde: 7c 01 movw r14, r24 } if (extrudemultiply != 100) cbe0: 60 91 bc 02 lds r22, 0x02BC ; 0x8002bc cbe4: 70 91 bd 02 lds r23, 0x02BD ; 0x8002bd cbe8: 64 36 cpi r22, 0x64 ; 100 cbea: 71 05 cpc r23, r1 cbec: a1 f0 breq .+40 ; 0xcc16 out *= float(extrudemultiply) * 0.01f; cbee: 07 2e mov r0, r23 cbf0: 00 0c add r0, r0 cbf2: 88 0b sbc r24, r24 cbf4: 99 0b sbc r25, r25 cbf6: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> cbfa: 2a e0 ldi r18, 0x0A ; 10 cbfc: 37 ed ldi r19, 0xD7 ; 215 cbfe: 43 e2 ldi r20, 0x23 ; 35 cc00: 5c e3 ldi r21, 0x3C ; 60 cc02: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> cc06: 9b 01 movw r18, r22 cc08: ac 01 movw r20, r24 cc0a: c7 01 movw r24, r14 cc0c: b6 01 movw r22, r12 cc0e: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> cc12: 6b 01 movw r12, r22 cc14: 7c 01 movw r14, r24 return out; } void calculate_extruder_multipliers() { extruder_multiplier[0] = calculate_extruder_multiplier(cs.filament_size[0]); cc16: c0 92 93 02 sts 0x0293, r12 ; 0x800293 cc1a: d0 92 94 02 sts 0x0294, r13 ; 0x800294 cc1e: e0 92 95 02 sts 0x0295, r14 ; 0x800295 cc22: 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 } cc26: ff 90 pop r15 cc28: ef 90 pop r14 cc2a: df 90 pop r13 cc2c: cf 90 pop r12 cc2e: 08 95 ret MMU2::mmu2.ClearTMCFailures(); // not stored into EEPROM } } float calculate_extruder_multiplier(float diameter) { float out = 1.f; cc30: c1 2c mov r12, r1 cc32: d1 2c mov r13, r1 cc34: 80 e8 ldi r24, 0x80 ; 128 cc36: e8 2e mov r14, r24 cc38: 8f e3 ldi r24, 0x3F ; 63 cc3a: f8 2e mov r15, r24 cc3c: d1 cf rjmp .-94 ; 0xcbe0 0000cc3e : } } #endif //FAST_PWM_FAN void save_statistics() { cc3e: 8f 92 push r8 cc40: 9f 92 push r9 cc42: af 92 push r10 cc44: bf 92 push r11 cc46: cf 92 push r12 cc48: df 92 push r13 cc4a: ef 92 push r14 cc4c: ff 92 push r15 uint32_t _previous_filament = eeprom_init_default_dword((uint32_t *)EEPROM_FILAMENTUSED, 0); //_previous_filament unit: meter cc4e: 81 ef ldi r24, 0xF1 ; 241 cc50: 9f e0 ldi r25, 0x0F ; 15 cc52: 0f 94 5d 7a call 0x2f4ba ; 0x2f4ba cc56: 6b 01 movw r12, r22 cc58: 7c 01 movw r14, r24 uint32_t _previous_time = eeprom_init_default_dword((uint32_t *)EEPROM_TOTALTIME, 0); //_previous_time unit: min cc5a: 8d ee ldi r24, 0xED ; 237 cc5c: 9f e0 ldi r25, 0x0F ; 15 cc5e: 0f 94 5d 7a call 0x2f4ba ; 0x2f4ba cc62: 4b 01 movw r8, r22 cc64: 5c 01 movw r10, r24 uint32_t time_minutes = print_job_timer.duration() / 60; cc66: 0f 94 a3 3e call 0x27d46 ; 0x27d46 cc6a: 2c e3 ldi r18, 0x3C ; 60 cc6c: 30 e0 ldi r19, 0x00 ; 0 cc6e: 40 e0 ldi r20, 0x00 ; 0 cc70: 50 e0 ldi r21, 0x00 ; 0 cc72: 0f 94 8f dc call 0x3b91e ; 0x3b91e <__udivmodsi4> eeprom_update_dword_notify((uint32_t *)EEPROM_TOTALTIME, _previous_time + time_minutes); // EEPROM_TOTALTIME unit: min cc76: ba 01 movw r22, r20 cc78: a9 01 movw r20, r18 cc7a: 48 0d add r20, r8 cc7c: 59 1d adc r21, r9 cc7e: 6a 1d adc r22, r10 cc80: 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); cc82: 8d ee ldi r24, 0xED ; 237 cc84: 9f e0 ldi r25, 0x0F ; 15 cc86: 0f 94 52 dc call 0x3b8a4 ; 0x3b8a4 eeprom_update_dword_notify((uint32_t *)EEPROM_FILAMENTUSED, _previous_filament + (total_filament_used / 1000)); cc8a: 60 91 65 06 lds r22, 0x0665 ; 0x800665 cc8e: 70 91 66 06 lds r23, 0x0666 ; 0x800666 cc92: 80 91 67 06 lds r24, 0x0667 ; 0x800667 cc96: 90 91 68 06 lds r25, 0x0668 ; 0x800668 cc9a: 28 ee ldi r18, 0xE8 ; 232 cc9c: 33 e0 ldi r19, 0x03 ; 3 cc9e: 40 e0 ldi r20, 0x00 ; 0 cca0: 50 e0 ldi r21, 0x00 ; 0 cca2: 0f 94 8f dc call 0x3b91e ; 0x3b91e <__udivmodsi4> cca6: ba 01 movw r22, r20 cca8: a9 01 movw r20, r18 ccaa: 4c 0d add r20, r12 ccac: 5d 1d adc r21, r13 ccae: 6e 1d adc r22, r14 ccb0: 7f 1d adc r23, r15 ccb2: 81 ef ldi r24, 0xF1 ; 241 ccb4: 9f e0 ldi r25, 0x0F ; 15 ccb6: 0f 94 52 dc call 0x3b8a4 ; 0x3b8a4 print_job_timer.reset(); ccba: 0f 94 72 42 call 0x284e4 ; 0x284e4 total_filament_used = 0; ccbe: 10 92 65 06 sts 0x0665, r1 ; 0x800665 ccc2: 10 92 66 06 sts 0x0666, r1 ; 0x800666 ccc6: 10 92 67 06 sts 0x0667, r1 ; 0x800667 ccca: 10 92 68 06 sts 0x0668, r1 ; 0x800668 if (MMU2::mmu2.Enabled()) { ccce: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba ccd2: 81 30 cpi r24, 0x01 ; 1 ccd4: 81 f4 brne .+32 ; 0xccf6 eeprom_add_dword((uint32_t *)EEPROM_MMU_MATERIAL_CHANGES, MMU2::mmu2.ToolChangeCounter()); ccd6: 60 91 be 13 lds r22, 0x13BE ; 0x8013be ccda: 70 91 bf 13 lds r23, 0x13BF ; 0x8013bf ccde: 90 e0 ldi r25, 0x00 ; 0 cce0: 80 e0 ldi r24, 0x00 ; 0 cce2: 0f 94 45 7a call 0x2f48a ; 0x2f48a /// @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; }; cce6: 10 92 bf 13 sts 0x13BF, r1 ; 0x8013bf ccea: 10 92 be 13 sts 0x13BE, r1 ; 0x8013be inline uint16_t TMCFailures() const { return tmcFailures; } inline void IncrementTMCFailures() { ++tmcFailures; } inline void ClearTMCFailures() { tmcFailures = 0; } ccee: 10 92 c1 13 sts 0x13C1, r1 ; 0x8013c1 ccf2: 10 92 c0 13 sts 0x13C0, r1 ; 0x8013c0 // @@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 } } ccf6: ff 90 pop r15 ccf8: ef 90 pop r14 ccfa: df 90 pop r13 ccfc: cf 90 pop r12 ccfe: bf 90 pop r11 cd00: af 90 pop r10 cd02: 9f 90 pop r9 cd04: 8f 90 pop r8 cd06: 08 95 ret 0000cd08 : } #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); cd08: 80 91 e7 03 lds r24, 0x03E7 ; 0x8003e7 cd0c: 1f 92 push r1 cd0e: 8f 93 push r24 cd10: 80 91 6b 03 lds r24, 0x036B ; 0x80036b cd14: 1f 92 push r1 cd16: 8f 93 push r24 cd18: e9 ec ldi r30, 0xC9 ; 201 cd1a: f3 e0 ldi r31, 0x03 ; 3 cd1c: 42 81 ldd r20, Z+2 ; 0x02 cd1e: 53 81 ldd r21, Z+3 ; 0x03 cd20: 2c e3 ldi r18, 0x3C ; 60 cd22: 24 9f mul r18, r20 cd24: c0 01 movw r24, r0 cd26: 25 9f mul r18, r21 cd28: 90 0d add r25, r0 cd2a: 11 24 eor r1, r1 cd2c: 9f 93 push r25 cd2e: 8f 93 push r24 cd30: 40 81 ld r20, Z cd32: 51 81 ldd r21, Z+1 ; 0x01 cd34: 24 9f mul r18, r20 cd36: c0 01 movw r24, r0 cd38: 25 9f mul r18, r21 cd3a: 90 0d add r25, r0 cd3c: 11 24 eor r1, r1 cd3e: 9f 93 push r25 cd40: 8f 93 push r24 cd42: 80 e4 ldi r24, 0x40 ; 64 cd44: 96 e6 ldi r25, 0x66 ; 102 cd46: 9f 93 push r25 cd48: 8f 93 push r24 cd4a: 0f 94 de da call 0x3b5bc ; 0x3b5bc cd4e: 8d b7 in r24, 0x3d ; 61 cd50: 9e b7 in r25, 0x3e ; 62 cd52: 0a 96 adiw r24, 0x0a ; 10 cd54: 0f b6 in r0, 0x3f ; 63 cd56: f8 94 cli cd58: 9e bf out 0x3e, r25 ; 62 cd5a: 0f be out 0x3f, r0 ; 63 cd5c: 8d bf out 0x3d, r24 ; 61 } cd5e: 08 95 ret 0000cd60 : // 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) { cd60: cf 93 push r28 cd62: 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); cd64: 8f ef ldi r24, 0xFF ; 255 cd66: 9f e0 ldi r25, 0x0F ; 15 cd68: 0f 94 1c dc call 0x3b838 ; 0x3b838 if (silent == 1 || tmc2130_mode == TMC2130_MODE_SILENT) { cd6c: 81 30 cpi r24, 0x01 ; 1 cd6e: 21 f0 breq .+8 ; 0xcd78 cd70: 80 91 8c 06 lds r24, 0x068C ; 0x80068c cd74: 81 30 cpi r24, 0x01 ; 1 cd76: 29 f4 brne .+10 ; 0xcd82 //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); cd78: 81 e0 ldi r24, 0x01 ; 1 cd7a: 8c 27 eor r24, r28 } } cd7c: 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); cd7e: 0c 94 89 60 jmp 0xc112 ; 0xc112 } } cd82: cf 91 pop r28 cd84: 08 95 ret 0000cd86 : endstops_hit_on_purpose(); } void refresh_cmd_timeout(void) { previous_millis_cmd.start(); cd86: 86 e8 ldi r24, 0x86 ; 134 cd88: 93 e0 ldi r25, 0x03 ; 3 cd8a: 0d 94 ef 2b jmp 0x257de ; 0x257de ::start()> 0000cd8e : } } #endif //TMC2130 float __attribute__((noinline)) get_feedrate_mm_s(const float feedrate_mm_min) { return feedrate_mm_min / 60.f; cd8e: 20 e0 ldi r18, 0x00 ; 0 cd90: 30 e0 ldi r19, 0x00 ; 0 cd92: 40 e7 ldi r20, 0x70 ; 112 cd94: 52 e4 ldi r21, 0x42 ; 66 cd96: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> } cd9a: 08 95 ret 0000cd9c : } bool enable_endstops(bool check) { bool old = check_endstops; check_endstops = check; cd9c: 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; cda0: 40 91 66 03 lds r20, 0x0366 ; 0x800366 cda4: 50 91 67 03 lds r21, 0x0367 ; 0x800367 cda8: 60 91 68 03 lds r22, 0x0368 ; 0x800368 cdac: 70 91 69 03 lds r23, 0x0369 ; 0x800369 cdb0: 40 93 b8 02 sts 0x02B8, r20 ; 0x8002b8 cdb4: 50 93 b9 02 sts 0x02B9, r21 ; 0x8002b9 cdb8: 60 93 ba 02 sts 0x02BA, r22 ; 0x8002ba cdbc: 70 93 bb 02 sts 0x02BB, r23 ; 0x8002bb feedmultiply = original_feedmultiply; cdc0: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a cdc4: 80 93 39 02 sts 0x0239, r24 ; 0x800239 previous_millis_cmd.start(); cdc8: 86 e8 ldi r24, 0x86 ; 134 cdca: 93 e0 ldi r25, 0x03 ; 3 cdcc: 0d 94 ef 2b jmp 0x257de ; 0x257de ::start()> 0000cdd0 : 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) { cdd0: 1f 93 push r17 cdd2: cf 93 push r28 cdd4: df 93 push r29 cdd6: 18 2f mov r17, r24 saved_feedrate = feedrate; cdd8: 80 91 b8 02 lds r24, 0x02B8 ; 0x8002b8 cddc: 90 91 b9 02 lds r25, 0x02B9 ; 0x8002b9 cde0: a0 91 ba 02 lds r26, 0x02BA ; 0x8002ba cde4: b0 91 bb 02 lds r27, 0x02BB ; 0x8002bb cde8: 80 93 66 03 sts 0x0366, r24 ; 0x800366 cdec: 90 93 67 03 sts 0x0367, r25 ; 0x800367 cdf0: a0 93 68 03 sts 0x0368, r26 ; 0x800368 cdf4: b0 93 69 03 sts 0x0369, r27 ; 0x800369 int l_feedmultiply = feedmultiply; cdf8: c0 91 39 02 lds r28, 0x0239 ; 0x800239 cdfc: d0 91 3a 02 lds r29, 0x023A ; 0x80023a feedmultiply = 100; ce00: 84 e6 ldi r24, 0x64 ; 100 ce02: 90 e0 ldi r25, 0x00 ; 0 ce04: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a ce08: 80 93 39 02 sts 0x0239, r24 ; 0x800239 previous_millis_cmd.start(); ce0c: 86 e8 ldi r24, 0x86 ; 134 ce0e: 93 e0 ldi r25, 0x03 ; 3 ce10: 0f 94 ef 2b call 0x257de ; 0x257de ::start()> ce14: 10 93 b7 02 sts 0x02B7, r17 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> enable_endstops(enable_endstops_now); return l_feedmultiply; } ce18: ce 01 movw r24, r28 ce1a: df 91 pop r29 ce1c: cf 91 pop r28 ce1e: 1f 91 pop r17 ce20: 08 95 ret 0000ce22 : ce22: 40 e0 ldi r20, 0x00 ; 0 ce24: 50 e0 ldi r21, 0x00 ; 0 ce26: ba 01 movw r22, r20 ce28: 8d ee ldi r24, 0xED ; 237 ce2a: 9f e0 ldi r25, 0x0F ; 15 ce2c: 0f 94 52 dc call 0x3b8a4 ; 0x3b8a4 ce30: 40 e0 ldi r20, 0x00 ; 0 ce32: 50 e0 ldi r21, 0x00 ; 0 ce34: ba 01 movw r22, r20 ce36: 81 ef ldi r24, 0xF1 ; 241 ce38: 9f e0 ldi r25, 0x0F ; 15 ce3a: 0f 94 52 dc call 0x3b8a4 ; 0x3b8a4 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(); ce3e: 0e 94 24 5c call 0xb848 ; 0xb848 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); ce42: 70 e0 ldi r23, 0x00 ; 0 ce44: 60 e0 ldi r22, 0x00 ; 0 ce46: 85 e0 ldi r24, 0x05 ; 5 ce48: 9f e0 ldi r25, 0x0F ; 15 ce4a: 0f 94 5e dc call 0x3b8bc ; 0x3b8bc ce4e: 70 e0 ldi r23, 0x00 ; 0 ce50: 60 e0 ldi r22, 0x00 ; 0 ce52: 83 e0 ldi r24, 0x03 ; 3 ce54: 9f e0 ldi r25, 0x0F ; 15 ce56: 0f 94 5e dc call 0x3b8bc ; 0x3b8bc ce5a: 70 e0 ldi r23, 0x00 ; 0 ce5c: 60 e0 ldi r22, 0x00 ; 0 ce5e: 81 e0 ldi r24, 0x01 ; 1 ce60: 9f e0 ldi r25, 0x0F ; 15 ce62: 0f 94 5e dc call 0x3b8bc ; 0x3b8bc ce66: 70 e0 ldi r23, 0x00 ; 0 ce68: 60 e0 ldi r22, 0x00 ; 0 ce6a: 8f ef ldi r24, 0xFF ; 255 ce6c: 9e e0 ldi r25, 0x0E ; 14 ce6e: 0f 94 5e dc call 0x3b8bc ; 0x3b8bc ce72: 70 e0 ldi r23, 0x00 ; 0 ce74: 60 e0 ldi r22, 0x00 ; 0 ce76: 83 ed ldi r24, 0xD3 ; 211 ce78: 9e e0 ldi r25, 0x0E ; 14 ce7a: 0f 94 5e dc call 0x3b8bc ; 0x3b8bc ce7e: 70 e0 ldi r23, 0x00 ; 0 ce80: 60 e0 ldi r22, 0x00 ; 0 ce82: 80 ed ldi r24, 0xD0 ; 208 ce84: 9e e0 ldi r25, 0x0E ; 14 ce86: 0f 94 5e dc call 0x3b8bc ; 0x3b8bc if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); ce8a: 40 e0 ldi r20, 0x00 ; 0 ce8c: 50 e0 ldi r21, 0x00 ; 0 ce8e: ba 01 movw r22, r20 ce90: 88 ea ldi r24, 0xA8 ; 168 ce92: 9c e0 ldi r25, 0x0C ; 12 ce94: 0d 94 52 dc jmp 0x3b8a4 ; 0x3b8a4 0000ce98 : wdt_disable(); } } void softReset(void) { cli(); ce98: 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" ); ce9a: 88 e1 ldi r24, 0x18 ; 24 ce9c: 98 e0 ldi r25, 0x08 ; 8 ce9e: 0f b6 in r0, 0x3f ; 63 cea0: f8 94 cli cea2: a8 95 wdr cea4: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> cea8: 0f be out 0x3f, r0 ; 63 ceaa: 90 93 60 00 sts 0x0060, r25 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> ceae: ff cf rjmp .-2 ; 0xceae 0000ceb0 : #endif //EMERGENCY_HANDLERS #endif //WATCHDOG } static inline void crash_and_burn(dump_crash_reason reason) { ceb0: c8 2f mov r28, r24 WRITE(BEEPER, HIGH); ceb2: 9f b7 in r25, 0x3f ; 63 ceb4: f8 94 cli ceb6: e2 e0 ldi r30, 0x02 ; 2 ceb8: f1 e0 ldi r31, 0x01 ; 1 ceba: 80 81 ld r24, Z cebc: 84 60 ori r24, 0x04 ; 4 cebe: 80 83 st Z, r24 cec0: 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); cec2: 6c 2f mov r22, r28 cec4: 83 e0 ldi r24, 0x03 ; 3 cec6: 9d e0 ldi r25, 0x0D ; 13 cec8: 0f 94 40 dc call 0x3b880 ; 0x3b880 eeprom_update_byte_notify((uint8_t*)EEPROM_FW_CRASH_FLAG, (uint8_t)reason); #ifdef EMERGENCY_DUMP xfdump_full_dump_and_reset(reason); cecc: 8c 2f mov r24, r28 cece: 0e 94 bc ed call 0x1db78 ; 0x1db78 #elif defined(EMERGENCY_SERIAL_DUMP) if(emergency_serial_dump) serial_dump_and_reset(reason); #endif softReset(); ced2: 0e 94 4c 67 call 0xce98 ; 0xce98 0000ced6 <__vector_default>: crash_and_burn(dump_crash_reason::watchdog); } #endif ISR(BADISR_vect) { ced6: 1f 92 push r1 ced8: 0f 92 push r0 ceda: 0f b6 in r0, 0x3f ; 63 cedc: 0f 92 push r0 cede: 11 24 eor r1, r1 crash_and_burn(dump_crash_reason::bad_isr); cee0: 83 e0 ldi r24, 0x03 ; 3 cee2: 0e 94 58 67 call 0xceb0 ; 0xceb0 0000cee6 <__vector_12>: } #ifdef EMERGENCY_HANDLERS #ifdef WATCHDOG ISR(WDT_vect) { cee6: 1f 92 push r1 cee8: 0f 92 push r0 ceea: 0f b6 in r0, 0x3f ; 63 ceec: 0f 92 push r0 ceee: 11 24 eor r1, r1 crash_and_burn(dump_crash_reason::watchdog); cef0: 82 e0 ldi r24, 0x02 ; 2 cef2: 0e 94 58 67 call 0xceb0 ; 0xceb0 0000cef6 : } #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); cef6: 85 ea ldi r24, 0xA5 ; 165 cef8: 9f e0 ldi r25, 0x0F ; 15 cefa: 0f 94 1c dc call 0x3b838 ; 0x3b838 cefe: 91 e0 ldi r25, 0x01 ; 1 cf00: 81 11 cpse r24, r1 cf02: 01 c0 rjmp .+2 ; 0xcf06 cf04: 90 e0 ldi r25, 0x00 ; 0 } cf06: 89 2f mov r24, r25 cf08: 08 95 ret 0000cf0a : 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(); cf0a: 80 91 e4 03 lds r24, 0x03E4 ; 0x8003e4 cf0e: 81 11 cpse r24, r1 cf10: 06 c0 rjmp .+12 ; 0xcf1e cf12: 81 e0 ldi r24, 0x01 ; 1 cf14: 90 91 9d 03 lds r25, 0x039D ; 0x80039d cf18: 92 30 cpi r25, 0x02 ; 2 cf1a: 09 f0 breq .+2 ; 0xcf1e cf1c: 80 e0 ldi r24, 0x00 ; 0 } cf1e: 08 95 ret 0000cf20 : WRITE(SUICIDE_PIN, LOW); #endif } bool __attribute__((noinline)) printJobOngoing() { return (IS_SD_PRINTING || usb_timer.running() || print_job_timer.isRunning()); cf20: 80 91 90 14 lds r24, 0x1490 ; 0x801490 cf24: 81 11 cpse r24, r1 cf26: 0a c0 rjmp .+20 ; 0xcf3c cf28: 80 91 0e 05 lds r24, 0x050E ; 0x80050e cf2c: 81 11 cpse r24, r1 cf2e: 06 c0 rjmp .+12 ; 0xcf3c cf30: 81 e0 ldi r24, 0x01 ; 1 cf32: 90 91 9d 03 lds r25, 0x039D ; 0x80039d cf36: 91 30 cpi r25, 0x01 ; 1 cf38: 09 f0 breq .+2 ; 0xcf3c cf3a: 80 e0 ldi r24, 0x00 ; 0 } cf3c: 08 95 ret 0000cf3e : && !mesh_bed_leveling_flag && !homing_flag && e_active(); } bool __attribute__((noinline)) babystep_allowed() { cf3e: cf 93 push r28 cf40: df 93 push r29 return ( !homing_flag cf42: c0 91 a7 0d lds r28, 0x0DA7 ; 0x800da7 && !mesh_bed_leveling_flag && !printingIsPaused() && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) cf46: c1 11 cpse r28, r1 cf48: 1f c0 rjmp .+62 ; 0xcf88 && e_active(); } bool __attribute__((noinline)) babystep_allowed() { return ( !homing_flag && !mesh_bed_leveling_flag cf4a: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 cf4e: 81 11 cpse r24, r1 cf50: 1c c0 rjmp .+56 ; 0xcf8a && !printingIsPaused() cf52: 0e 94 85 67 call 0xcf0a ; 0xcf0a cf56: 81 11 cpse r24, r1 cf58: 18 c0 rjmp .+48 ; 0xcf8a && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) cf5a: d0 91 b4 0d lds r29, 0x0DB4 ; 0x800db4 cf5e: d4 30 cpi r29, 0x04 ; 4 cf60: 61 f4 brne .+24 ; 0xcf7a cf62: 80 91 b6 0d lds r24, 0x0DB6 ; 0x800db6 cf66: 90 91 b7 0d lds r25, 0x0DB7 ; 0x800db7 cf6a: 89 2b or r24, r25 cf6c: 91 f4 brne .+36 ; 0xcf92 cf6e: 80 91 72 06 lds r24, 0x0672 ; 0x800672 cf72: 90 91 73 06 lds r25, 0x0673 ; 0x800673 cf76: 89 2b or r24, r25 cf78: 61 f4 brne .+24 ; 0xcf92 || printJobOngoing() cf7a: 0e 94 90 67 call 0xcf20 ; 0xcf20 cf7e: c8 2f mov r28, r24 cf80: 81 11 cpse r24, r1 cf82: 03 c0 rjmp .+6 ; 0xcf8a || lcd_commands_type == LcdCommands::Idle cf84: c1 e0 ldi r28, 0x01 ; 1 cf86: 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) cf88: c0 e0 ldi r28, 0x00 ; 0 || printJobOngoing() || lcd_commands_type == LcdCommands::Idle ) ); } cf8a: 8c 2f mov r24, r28 cf8c: df 91 pop r29 cf8e: cf 91 pop r28 cf90: 08 95 ret bool __attribute__((noinline)) babystep_allowed() { return ( !homing_flag && !mesh_bed_leveling_flag && !printingIsPaused() && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) cf92: c1 e0 ldi r28, 0x01 ; 1 cf94: fa cf rjmp .-12 ; 0xcf8a 0000cf96 : ) ); } bool __attribute__((noinline)) babystep_allowed_strict() { return ( babystep_allowed() && current_position[Z_AXIS] < Z_HEIGHT_HIDE_LIVE_ADJUST_MENU); cf96: 0e 94 9f 67 call 0xcf3e ; 0xcf3e cf9a: 88 23 and r24, r24 cf9c: 89 f0 breq .+34 ; 0xcfc0 cf9e: 20 e0 ldi r18, 0x00 ; 0 cfa0: 30 e0 ldi r19, 0x00 ; 0 cfa2: 40 e0 ldi r20, 0x00 ; 0 cfa4: 50 e4 ldi r21, 0x40 ; 64 cfa6: 60 91 9a 06 lds r22, 0x069A ; 0x80069a cfaa: 70 91 9b 06 lds r23, 0x069B ; 0x80069b cfae: 80 91 9c 06 lds r24, 0x069C ; 0x80069c cfb2: 90 91 9d 06 lds r25, 0x069D ; 0x80069d cfb6: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> cfba: 88 1f adc r24, r24 cfbc: 88 27 eor r24, r24 cfbe: 88 1f adc r24, r24 } cfc0: 08 95 ret 0000cfc2 : bool printingIsPaused() { return did_pause_print || print_job_timer.isPaused(); } bool __attribute__((noinline)) printer_active() { return printJobOngoing() cfc2: 0e 94 90 67 call 0xcf20 ; 0xcf20 || printingIsPaused() || saved_printing || (lcd_commands_type != LcdCommands::Idle) || MMU2::mmu2.MMU_PRINT_SAVED() || homing_flag || mesh_bed_leveling_flag; cfc6: 81 11 cpse r24, r1 cfc8: 18 c0 rjmp .+48 ; 0xcffa return did_pause_print || print_job_timer.isPaused(); } bool __attribute__((noinline)) printer_active() { return printJobOngoing() || printingIsPaused() cfca: 0e 94 85 67 call 0xcf0a ; 0xcf0a cfce: 81 11 cpse r24, r1 cfd0: 14 c0 rjmp .+40 ; 0xcffa || saved_printing cfd2: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 cfd6: 81 11 cpse r24, r1 cfd8: 10 c0 rjmp .+32 ; 0xcffa || (lcd_commands_type != LcdCommands::Idle) cfda: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 cfde: 81 11 cpse r24, r1 cfe0: 0b c0 rjmp .+22 ; 0xcff8 || MMU2::mmu2.MMU_PRINT_SAVED() cfe2: 80 91 bb 13 lds r24, 0x13BB ; 0x8013bb cfe6: 81 11 cpse r24, r1 cfe8: 07 c0 rjmp .+14 ; 0xcff8 || homing_flag cfea: 80 91 a7 0d lds r24, 0x0DA7 ; 0x800da7 cfee: 81 11 cpse r24, r1 cff0: 04 c0 rjmp .+8 ; 0xcffa || mesh_bed_leveling_flag; cff2: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 cff6: 08 95 ret cff8: 81 e0 ldi r24, 0x01 ; 1 } cffa: 08 95 ret 0000cffc : // accordingly refreshCurrentScaling(); } void __attribute__((noinline)) setiHold(uint8_t ih) { iHold = vSense ? ih : ih >> 1; cffc: fc 01 movw r30, r24 cffe: 20 81 ld r18, Z d000: 21 11 cpse r18, r1 d002: 01 c0 rjmp .+2 ; 0xd006 d004: 66 95 lsr r22 d006: fc 01 movw r30, r24 d008: 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() } d00a: 08 95 ret 0000d00c : 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) { d00c: fc 01 movw r30, r24 iRun = ir; d00e: 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); d010: 21 e0 ldi r18, 0x01 ; 1 d012: 60 32 cpi r22, 0x20 ; 32 d014: 08 f0 brcs .+2 ; 0xd018 d016: 20 e0 ldi r18, 0x00 ; 0 if (vSense != newvSense) { d018: 90 81 ld r25, Z d01a: 29 17 cp r18, r25 d01c: 81 f0 breq .+32 ; 0xd03e d01e: 82 81 ldd r24, Z+2 ; 0x02 // Update currents to match current scaling if (vSense) { d020: 99 23 and r25, r25 d022: 51 f0 breq .+20 ; 0xd038 // 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; d024: 90 e0 ldi r25, 0x00 ; 0 d026: 95 95 asr r25 d028: 87 95 ror r24 d02a: 82 83 std Z+2, r24 ; 0x02 iRun >>= 1; d02c: 70 e0 ldi r23, 0x00 ; 0 d02e: 75 95 asr r23 d030: 67 95 ror r22 d032: 61 83 std Z+1, r22 ; 0x01 // Keep in mind, only a change in iRun can change vSense. iHold <<= 1; } // Update vSense vSense = newvSense; d034: 20 83 st Z, r18 d036: 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; d038: 88 0f add r24, r24 d03a: 82 83 std Z+2, r24 ; 0x02 d03c: fb cf rjmp .-10 ; 0xd034 } // Update vSense vSense = newvSense; } else if (!vSense) { d03e: 21 11 cpse r18, r1 d040: 04 c0 rjmp .+8 ; 0xd04a // 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; d042: 70 e0 ldi r23, 0x00 ; 0 d044: 75 95 asr r23 d046: 67 95 ror r22 d048: 61 83 std Z+1, r22 ; 0x01 iRun = ir; // Refresh the vSense bit and take care of updating Hold/Run currents // accordingly refreshCurrentScaling(); } d04a: 08 95 ret 0000d04c : } #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; } d04c: 20 91 92 12 lds r18, 0x1292 ; 0x801292 d050: 30 91 93 12 lds r19, 0x1293 ; 0x801293 d054: bc 01 movw r22, r24 d056: c9 01 movw r24, r18 d058: 88 55 subi r24, 0x58 ; 88 d05a: 9f 4e sbci r25, 0xEF ; 239 d05c: 0f 94 23 da call 0x3b446 ; 0x3b446 d060: 9c 01 movw r18, r24 d062: 90 93 96 03 sts 0x0396, r25 ; 0x800396 d066: 80 93 95 03 sts 0x0395, r24 ; 0x800395 d06a: 81 e0 ldi r24, 0x01 ; 1 d06c: 23 2b or r18, r19 d06e: 09 f4 brne .+2 ; 0xd072 d070: 80 e0 ldi r24, 0x00 ; 0 d072: 08 95 ret 0000d074 : inline void set_destination_to_current() { memcpy(destination, current_position, sizeof(destination)); } d074: 80 e1 ldi r24, 0x10 ; 16 d076: e2 e9 ldi r30, 0x92 ; 146 d078: f6 e0 ldi r31, 0x06 ; 6 d07a: a4 e7 ldi r26, 0x74 ; 116 d07c: b6 e0 ldi r27, 0x06 ; 6 d07e: 01 90 ld r0, Z+ d080: 0d 92 st X+, r0 d082: 8a 95 dec r24 d084: e1 f7 brne .-8 ; 0xd07e d086: 08 95 ret 0000d088 : //! //! Internally lcd_update() is called by wait_for_heater(). //! //! @param e_move void restore_print_from_ram_and_continue(float e_move) { d088: 4f 92 push r4 d08a: 5f 92 push r5 d08c: 6f 92 push r6 d08e: 7f 92 push r7 d090: 8f 92 push r8 d092: 9f 92 push r9 d094: af 92 push r10 d096: bf 92 push r11 d098: cf 92 push r12 d09a: df 92 push r13 d09c: ef 92 push r14 d09e: ff 92 push r15 d0a0: 0f 93 push r16 d0a2: 1f 93 push r17 d0a4: cf 93 push r28 d0a6: df 93 push r29 d0a8: 00 d0 rcall .+0 ; 0xd0aa d0aa: 00 d0 rcall .+0 ; 0xd0ac d0ac: 1f 92 push r1 d0ae: 1f 92 push r1 d0b0: cd b7 in r28, 0x3d ; 61 d0b2: de b7 in r29, 0x3e ; 62 if (!saved_printing) return; d0b4: 20 91 a9 0d lds r18, 0x0DA9 ; 0x800da9 d0b8: 22 23 and r18, r18 d0ba: 09 f4 brne .+2 ; 0xd0be d0bc: 73 c1 rjmp .+742 ; 0xd3a4 #ifdef FANCHECK // Do not allow resume printing if fans are still not ok if (fan_check_error == EFCE_REPORTED) return; d0be: 20 91 e6 03 lds r18, 0x03E6 ; 0x8003e6 d0c2: 22 30 cpi r18, 0x02 ; 2 d0c4: 09 f4 brne .+2 ; 0xd0c8 d0c6: 6e c1 rjmp .+732 ; 0xd3a4 if (fan_check_error == EFCE_FIXED) fan_check_error = EFCE_OK; //reenable serial stream processing if printing from usb d0c8: 20 91 e6 03 lds r18, 0x03E6 ; 0x8003e6 d0cc: 21 30 cpi r18, 0x01 ; 1 d0ce: 11 f4 brne .+4 ; 0xd0d4 d0d0: 10 92 e6 03 sts 0x03E6, r1 ; 0x8003e6 d0d4: 2b 01 movw r4, r22 d0d6: 3c 01 movw r6, r24 #endif // Make sure fan is turned off fanSpeed = 0; d0d8: 10 92 e7 03 sts 0x03E7, r1 ; 0x8003e7 // restore bed temperature (bed can be disabled during a thermal warning) if ((uint8_t)degBed() != saved_bed_temperature) d0dc: 10 91 ae 05 lds r17, 0x05AE ; 0x8005ae d0e0: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee d0e4: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef d0e8: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 d0ec: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 d0f0: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> d0f4: 61 17 cp r22, r17 d0f6: 31 f0 breq .+12 ; 0xd104 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; d0f8: 81 2f mov r24, r17 d0fa: 90 e0 ldi r25, 0x00 ; 0 d0fc: 90 93 73 06 sts 0x0673, r25 ; 0x800673 d100: 80 93 72 06 sts 0x0672, r24 ; 0x800672 setTargetBed(saved_bed_temperature); restore_extruder_temperature_from_ram(); d104: 0e 94 c9 64 call 0xc992 ; 0xc992 // Restore saved fan speed fanSpeed = saved_fan_speed; d108: 80 91 ab 05 lds r24, 0x05AB ; 0x8005ab d10c: 80 93 e7 03 sts 0x03E7, r24 ; 0x8003e7 axis_relative_modes ^= (-saved_extruder_relative_mode ^ axis_relative_modes) & E_AXIS_MASK; d110: 90 91 e5 03 lds r25, 0x03E5 ; 0x8003e5 d114: 80 91 64 05 lds r24, 0x0564 ; 0x800564 d118: 81 95 neg r24 d11a: 89 27 eor r24, r25 d11c: 88 70 andi r24, 0x08 ; 8 d11e: 89 27 eor r24, r25 d120: 80 93 e5 03 sts 0x03E5, r24 ; 0x8003e5 float e = saved_pos[E_AXIS] - e_move; d124: a3 01 movw r20, r6 d126: 92 01 movw r18, r4 d128: 60 91 7f 02 lds r22, 0x027F ; 0x80027f d12c: 70 91 80 02 lds r23, 0x0280 ; 0x800280 d130: 80 91 81 02 lds r24, 0x0281 ; 0x800281 d134: 90 91 82 02 lds r25, 0x0282 ; 0x800282 d138: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> d13c: 6d 83 std Y+5, r22 ; 0x05 d13e: 7e 83 std Y+6, r23 ; 0x06 d140: 8f 83 std Y+7, r24 ; 0x07 d142: 98 87 std Y+8, r25 ; 0x08 plan_set_e_position(e); d144: ce 01 movw r24, r28 d146: 05 96 adiw r24, 0x05 ; 5 d148: 0f 94 be 63 call 0x2c77c ; 0x2c77c #ifdef FANCHECK fans_check_enabled = false; d14c: 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) d150: 20 e0 ldi r18, 0x00 ; 0 d152: 30 e0 ldi r19, 0x00 ; 0 d154: 40 e8 ldi r20, 0x80 ; 128 d156: 5f eb ldi r21, 0xBF ; 191 d158: 60 91 73 02 lds r22, 0x0273 ; 0x800273 d15c: 70 91 74 02 lds r23, 0x0274 ; 0x800274 d160: 80 91 75 02 lds r24, 0x0275 ; 0x800275 d164: 90 91 76 02 lds r25, 0x0276 ; 0x800276 d168: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> d16c: 81 11 cpse r24, r1 d16e: 20 c0 rjmp .+64 ; 0xd1b0 { saved_pos[X_AXIS] = current_position[X_AXIS]; d170: 80 91 92 06 lds r24, 0x0692 ; 0x800692 d174: 90 91 93 06 lds r25, 0x0693 ; 0x800693 d178: a0 91 94 06 lds r26, 0x0694 ; 0x800694 d17c: b0 91 95 06 lds r27, 0x0695 ; 0x800695 d180: 80 93 73 02 sts 0x0273, r24 ; 0x800273 d184: 90 93 74 02 sts 0x0274, r25 ; 0x800274 d188: a0 93 75 02 sts 0x0275, r26 ; 0x800275 d18c: b0 93 76 02 sts 0x0276, r27 ; 0x800276 saved_pos[Y_AXIS] = current_position[Y_AXIS]; d190: 80 91 96 06 lds r24, 0x0696 ; 0x800696 d194: 90 91 97 06 lds r25, 0x0697 ; 0x800697 d198: a0 91 98 06 lds r26, 0x0698 ; 0x800698 d19c: b0 91 99 06 lds r27, 0x0699 ; 0x800699 d1a0: 80 93 77 02 sts 0x0277, r24 ; 0x800277 d1a4: 90 93 78 02 sts 0x0278, r25 ; 0x800278 d1a8: a0 93 79 02 sts 0x0279, r26 ; 0x800279 d1ac: 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); d1b0: a3 01 movw r20, r6 d1b2: 92 01 movw r18, r4 d1b4: 60 91 7f 02 lds r22, 0x027F ; 0x80027f d1b8: 70 91 80 02 lds r23, 0x0280 ; 0x800280 d1bc: 80 91 81 02 lds r24, 0x0281 ; 0x800281 d1c0: 90 91 82 02 lds r25, 0x0282 ; 0x800282 d1c4: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> d1c8: 69 83 std Y+1, r22 ; 0x01 d1ca: 7a 83 std Y+2, r23 ; 0x02 d1cc: 8b 83 std Y+3, r24 ; 0x03 d1ce: 9c 83 std Y+4, r25 ; 0x04 d1d0: e0 90 9a 06 lds r14, 0x069A ; 0x80069a d1d4: f0 90 9b 06 lds r15, 0x069B ; 0x80069b d1d8: 00 91 9c 06 lds r16, 0x069C ; 0x80069c d1dc: 10 91 9d 06 lds r17, 0x069D ; 0x80069d d1e0: 20 91 77 02 lds r18, 0x0277 ; 0x800277 d1e4: 30 91 78 02 lds r19, 0x0278 ; 0x800278 d1e8: 40 91 79 02 lds r20, 0x0279 ; 0x800279 d1ec: 50 91 7a 02 lds r21, 0x027A ; 0x80027a d1f0: 60 91 73 02 lds r22, 0x0273 ; 0x800273 d1f4: 70 91 74 02 lds r23, 0x0274 ; 0x800274 d1f8: 80 91 75 02 lds r24, 0x0275 ; 0x800275 d1fc: 90 91 76 02 lds r25, 0x0276 ; 0x800276 d200: 1f 92 push r1 d202: 1f 92 push r1 d204: 1f 92 push r1 d206: 1f 92 push r1 d208: e2 e6 ldi r30, 0x62 ; 98 d20a: 8e 2e mov r8, r30 d20c: e7 e2 ldi r30, 0x27 ; 39 d20e: 9e 2e mov r9, r30 d210: e6 e7 ldi r30, 0x76 ; 118 d212: ae 2e mov r10, r30 d214: e2 e4 ldi r30, 0x42 ; 66 d216: be 2e mov r11, r30 d218: fe 01 movw r30, r28 d21a: 31 96 adiw r30, 0x01 ; 1 d21c: 6f 01 movw r12, r30 d21e: 0f 94 f4 b0 call 0x361e8 ; 0x361e8 //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); d222: a3 01 movw r20, r6 d224: 92 01 movw r18, r4 d226: 60 91 7f 02 lds r22, 0x027F ; 0x80027f d22a: 70 91 80 02 lds r23, 0x0280 ; 0x800280 d22e: 80 91 81 02 lds r24, 0x0281 ; 0x800281 d232: 90 91 82 02 lds r25, 0x0282 ; 0x800282 d236: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> d23a: 69 83 std Y+1, r22 ; 0x01 d23c: 7a 83 std Y+2, r23 ; 0x02 d23e: 8b 83 std Y+3, r24 ; 0x03 d240: 9c 83 std Y+4, r25 ; 0x04 d242: e0 90 7b 02 lds r14, 0x027B ; 0x80027b d246: f0 90 7c 02 lds r15, 0x027C ; 0x80027c d24a: 00 91 7d 02 lds r16, 0x027D ; 0x80027d d24e: 10 91 7e 02 lds r17, 0x027E ; 0x80027e d252: 20 91 77 02 lds r18, 0x0277 ; 0x800277 d256: 30 91 78 02 lds r19, 0x0278 ; 0x800278 d25a: 40 91 79 02 lds r20, 0x0279 ; 0x800279 d25e: 50 91 7a 02 lds r21, 0x027A ; 0x80027a d262: 60 91 73 02 lds r22, 0x0273 ; 0x800273 d266: 70 91 74 02 lds r23, 0x0274 ; 0x800274 d26a: 80 91 75 02 lds r24, 0x0275 ; 0x800275 d26e: 90 91 76 02 lds r25, 0x0276 ; 0x800276 d272: 1f 92 push r1 d274: 1f 92 push r1 d276: 1f 92 push r1 d278: 1f 92 push r1 d27a: 0f 94 f4 b0 call 0x361e8 ; 0x361e8 //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); d27e: e0 90 7b 02 lds r14, 0x027B ; 0x80027b d282: f0 90 7c 02 lds r15, 0x027C ; 0x80027c d286: 00 91 7d 02 lds r16, 0x027D ; 0x80027d d28a: 10 91 7e 02 lds r17, 0x027E ; 0x80027e d28e: 20 91 77 02 lds r18, 0x0277 ; 0x800277 d292: 30 91 78 02 lds r19, 0x0278 ; 0x800278 d296: 40 91 79 02 lds r20, 0x0279 ; 0x800279 d29a: 50 91 7a 02 lds r21, 0x027A ; 0x80027a d29e: 60 91 73 02 lds r22, 0x0273 ; 0x800273 d2a2: 70 91 74 02 lds r23, 0x0274 ; 0x800274 d2a6: 80 91 75 02 lds r24, 0x0275 ; 0x800275 d2aa: 90 91 76 02 lds r25, 0x0276 ; 0x800276 d2ae: 1f 92 push r1 d2b0: 1f 92 push r1 d2b2: 1f 92 push r1 d2b4: 1f 92 push r1 d2b6: 81 2c mov r8, r1 d2b8: 91 2c mov r9, r1 d2ba: f8 ee ldi r31, 0xE8 ; 232 d2bc: af 2e mov r10, r31 d2be: f2 e4 ldi r31, 0x42 ; 66 d2c0: bf 2e mov r11, r31 d2c2: af e7 ldi r26, 0x7F ; 127 d2c4: ca 2e mov r12, r26 d2c6: a2 e0 ldi r26, 0x02 ; 2 d2c8: da 2e mov r13, r26 d2ca: 0f 94 f4 b0 call 0x361e8 ; 0x361e8 st_synchronize(); d2ce: 0f 94 e8 42 call 0x285d0 ; 0x285d0 #ifdef FANCHECK fans_check_enabled = true; d2d2: 11 e0 ldi r17, 0x01 ; 1 d2d4: 10 93 38 02 sts 0x0238, r17 ; 0x800238 #endif // restore original feedrate/feedmultiply _after_ restoring the extruder position feedrate = saved_feedrate2; d2d8: 60 91 5e 05 lds r22, 0x055E ; 0x80055e d2dc: 70 91 5f 05 lds r23, 0x055F ; 0x80055f d2e0: 90 e0 ldi r25, 0x00 ; 0 d2e2: 80 e0 ldi r24, 0x00 ; 0 d2e4: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> d2e8: 60 93 b8 02 sts 0x02B8, r22 ; 0x8002b8 d2ec: 70 93 b9 02 sts 0x02B9, r23 ; 0x8002b9 d2f0: 80 93 ba 02 sts 0x02BA, r24 ; 0x8002ba d2f4: 90 93 bb 02 sts 0x02BB, r25 ; 0x8002bb feedmultiply = saved_feedmultiply2; d2f8: 80 91 71 03 lds r24, 0x0371 ; 0x800371 d2fc: 90 91 72 03 lds r25, 0x0372 ; 0x800372 d300: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a d304: 80 93 39 02 sts 0x0239, r24 ; 0x800239 memcpy(current_position, saved_pos, sizeof(saved_pos)); d308: 80 e1 ldi r24, 0x10 ; 16 d30a: e3 e7 ldi r30, 0x73 ; 115 d30c: f2 e0 ldi r31, 0x02 ; 2 d30e: a2 e9 ldi r26, 0x92 ; 146 d310: b6 e0 ldi r27, 0x06 ; 6 d312: 01 90 ld r0, Z+ d314: 0d 92 st X+, r0 d316: 8a 95 dec r24 d318: e1 f7 brne .-8 ; 0xd312 set_destination_to_current(); d31a: 0e 94 3a 68 call 0xd074 ; 0xd074 //not sd printing nor usb printing } } void restore_print_file_state() { if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) { //was sd printing d31e: 80 91 6a 02 lds r24, 0x026A ; 0x80026a d322: 0f b6 in r0, 0x3f ; 63 d324: f8 94 cli d326: de bf out 0x3e, r29 ; 62 d328: 0f be out 0x3f, r0 ; 63 d32a: cd bf out 0x3d, r28 ; 61 d32c: 81 11 cpse r24, r1 d32e: 51 c0 rjmp .+162 ; 0xd3d2 card.setIndex(saved_sdpos); d330: 60 91 60 05 lds r22, 0x0560 ; 0x800560 d334: 70 91 61 05 lds r23, 0x0561 ; 0x800561 d338: 80 91 62 05 lds r24, 0x0562 ; 0x800562 d33c: 90 91 63 05 lds r25, 0x0563 ; 0x800563 { int16_t c = (int16_t)file.readFilteredGcode(); sdpos = file.curPosition(); return c; }; void setIndex(long index) {sdpos = index;file.seekSetFilteredGcode(index);}; d340: 60 93 a4 17 sts 0x17A4, r22 ; 0x8017a4 d344: 70 93 a5 17 sts 0x17A5, r23 ; 0x8017a5 d348: 80 93 a6 17 sts 0x17A6, r24 ; 0x8017a6 d34c: 90 93 a7 17 sts 0x17A7, r25 ; 0x8017a7 d350: 0f 94 9c 75 call 0x2eb38 ; 0x2eb38 sdpos_atomic = saved_sdpos; d354: 80 91 60 05 lds r24, 0x0560 ; 0x800560 d358: 90 91 61 05 lds r25, 0x0561 ; 0x800561 d35c: a0 91 62 05 lds r26, 0x0562 ; 0x800562 d360: b0 91 63 05 lds r27, 0x0563 ; 0x800563 d364: 80 93 82 03 sts 0x0382, r24 ; 0x800382 d368: 90 93 83 03 sts 0x0383, r25 ; 0x800383 d36c: a0 93 84 03 sts 0x0384, r26 ; 0x800384 d370: b0 93 85 03 sts 0x0385, r27 ; 0x800385 card.sdprinting = true; d374: 10 93 90 14 sts 0x1490, r17 ; 0x801490 d378: 60 e0 ldi r22, 0x00 ; 0 d37a: 85 ea ldi r24, 0xA5 ; 165 d37c: 9f e0 ldi r25, 0x0F ; 15 d37e: 0f 94 40 dc call 0x3b880 ; 0x3b880 d382: 60 e0 ldi r22, 0x00 ; 0 d384: 8f e7 ldi r24, 0x7F ; 127 d386: 9c e0 ldi r25, 0x0C ; 12 d388: 0f 94 40 dc call 0x3b880 ; 0x3b880 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); d38c: 83 e7 ldi r24, 0x73 ; 115 d38e: 90 e7 ldi r25, 0x70 ; 112 d390: 0e 94 5d f1 call 0x1e2ba ; 0x1e2ba saved_printing_type = PowerPanic::PRINT_TYPE_NONE; d394: 82 e0 ldi r24, 0x02 ; 2 d396: 80 93 6a 02 sts 0x026A, r24 ; 0x80026a saved_printing = false; d39a: 10 92 a9 0d sts 0x0DA9, r1 ; 0x800da9 planner_aborted = true; // unroll the stack d39e: 81 e0 ldi r24, 0x01 ; 1 d3a0: 80 93 ac 0d sts 0x0DAC, r24 ; 0x800dac } d3a4: 28 96 adiw r28, 0x08 ; 8 d3a6: 0f b6 in r0, 0x3f ; 63 d3a8: f8 94 cli d3aa: de bf out 0x3e, r29 ; 62 d3ac: 0f be out 0x3f, r0 ; 63 d3ae: cd bf out 0x3d, r28 ; 61 d3b0: df 91 pop r29 d3b2: cf 91 pop r28 d3b4: 1f 91 pop r17 d3b6: 0f 91 pop r16 d3b8: ff 90 pop r15 d3ba: ef 90 pop r14 d3bc: df 90 pop r13 d3be: cf 90 pop r12 d3c0: bf 90 pop r11 d3c2: af 90 pop r10 d3c4: 9f 90 pop r9 d3c6: 8f 90 pop r8 d3c8: 7f 90 pop r7 d3ca: 6f 90 pop r6 d3cc: 5f 90 pop r5 d3ce: 4f 90 pop r4 d3d0: 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 d3d2: 81 30 cpi r24, 0x01 ; 1 d3d4: 89 f6 brne .-94 ; 0xd378 gcode_LastN = saved_sdpos; //saved_sdpos was reused for storing line number when usb printing d3d6: 80 91 60 05 lds r24, 0x0560 ; 0x800560 d3da: 90 91 61 05 lds r25, 0x0561 ; 0x800561 d3de: a0 91 62 05 lds r26, 0x0562 ; 0x800562 d3e2: b0 91 63 05 lds r27, 0x0563 ; 0x800563 d3e6: 80 93 7a 03 sts 0x037A, r24 ; 0x80037a d3ea: 90 93 7b 03 sts 0x037B, r25 ; 0x80037b d3ee: a0 93 7c 03 sts 0x037C, r26 ; 0x80037c d3f2: b0 93 7d 03 sts 0x037D, r27 ; 0x80037d serial_count = 0; d3f6: 10 92 9f 10 sts 0x109F, r1 ; 0x80109f d3fa: 10 92 9e 10 sts 0x109E, r1 ; 0x80109e FlushSerialRequestResend(); d3fe: 0e 94 8d 5b call 0xb71a ; 0xb71a d402: ba cf rjmp .-140 ; 0xd378 0000d404 : 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) { d404: 3f 92 push r3 d406: 4f 92 push r4 d408: 5f 92 push r5 d40a: 6f 92 push r6 d40c: 7f 92 push r7 d40e: 8f 92 push r8 d410: 9f 92 push r9 d412: af 92 push r10 d414: bf 92 push r11 d416: cf 92 push r12 d418: df 92 push r13 d41a: ef 92 push r14 d41c: ff 92 push r15 d41e: 0f 93 push r16 d420: 1f 93 push r17 d422: cf 93 push r28 d424: df 93 push r29 if (world2machine_correction_mode == WORLD2MACHINE_CORRECTION_NONE) { d426: 30 90 0f 18 lds r3, 0x180F ; 0x80180f d42a: 33 20 and r3, r3 d42c: 09 f4 brne .+2 ; 0xd430 d42e: 80 c0 rjmp .+256 ; 0xd530 d430: 8b 01 movw r16, r22 d432: ec 01 movw r28, r24 // No correction. } else { if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { d434: 31 fe sbrs r3, 1 d436: 54 c0 rjmp .+168 ; 0xd4e0 // Firs the skew & rotation correction. float out_x = world2machine_rotation_and_skew[0][0] * x + world2machine_rotation_and_skew[0][1] * y; d438: 88 80 ld r8, Y d43a: 99 80 ldd r9, Y+1 ; 0x01 d43c: aa 80 ldd r10, Y+2 ; 0x02 d43e: bb 80 ldd r11, Y+3 ; 0x03 d440: fb 01 movw r30, r22 d442: c0 80 ld r12, Z d444: d1 80 ldd r13, Z+1 ; 0x01 d446: e2 80 ldd r14, Z+2 ; 0x02 d448: f3 80 ldd r15, Z+3 ; 0x03 float out_y = world2machine_rotation_and_skew[1][0] * x + world2machine_rotation_and_skew[1][1] * y; d44a: 20 91 e4 17 lds r18, 0x17E4 ; 0x8017e4 d44e: 30 91 e5 17 lds r19, 0x17E5 ; 0x8017e5 d452: 40 91 e6 17 lds r20, 0x17E6 ; 0x8017e6 d456: 50 91 e7 17 lds r21, 0x17E7 ; 0x8017e7 d45a: c5 01 movw r24, r10 d45c: b4 01 movw r22, r8 d45e: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> d462: 2b 01 movw r4, r22 d464: 3c 01 movw r6, r24 d466: 20 91 e8 17 lds r18, 0x17E8 ; 0x8017e8 d46a: 30 91 e9 17 lds r19, 0x17E9 ; 0x8017e9 d46e: 40 91 ea 17 lds r20, 0x17EA ; 0x8017ea d472: 50 91 eb 17 lds r21, 0x17EB ; 0x8017eb d476: c7 01 movw r24, r14 d478: b6 01 movw r22, r12 d47a: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> d47e: 9b 01 movw r18, r22 d480: ac 01 movw r20, r24 d482: c3 01 movw r24, r6 d484: b2 01 movw r22, r4 d486: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> d48a: 2b 01 movw r4, r22 d48c: 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; d48e: 20 91 dc 17 lds r18, 0x17DC ; 0x8017dc d492: 30 91 dd 17 lds r19, 0x17DD ; 0x8017dd d496: 40 91 de 17 lds r20, 0x17DE ; 0x8017de d49a: 50 91 df 17 lds r21, 0x17DF ; 0x8017df d49e: c5 01 movw r24, r10 d4a0: b4 01 movw r22, r8 d4a2: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> d4a6: 4b 01 movw r8, r22 d4a8: 5c 01 movw r10, r24 d4aa: 20 91 e0 17 lds r18, 0x17E0 ; 0x8017e0 d4ae: 30 91 e1 17 lds r19, 0x17E1 ; 0x8017e1 d4b2: 40 91 e2 17 lds r20, 0x17E2 ; 0x8017e2 d4b6: 50 91 e3 17 lds r21, 0x17E3 ; 0x8017e3 d4ba: c7 01 movw r24, r14 d4bc: b6 01 movw r22, r12 d4be: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> d4c2: 9b 01 movw r18, r22 d4c4: ac 01 movw r20, r24 d4c6: c5 01 movw r24, r10 d4c8: b4 01 movw r22, r8 d4ca: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> float out_y = world2machine_rotation_and_skew[1][0] * x + world2machine_rotation_and_skew[1][1] * y; x = out_x; d4ce: 68 83 st Y, r22 d4d0: 79 83 std Y+1, r23 ; 0x01 d4d2: 8a 83 std Y+2, r24 ; 0x02 d4d4: 9b 83 std Y+3, r25 ; 0x03 y = out_y; d4d6: f8 01 movw r30, r16 d4d8: 40 82 st Z, r4 d4da: 51 82 std Z+1, r5 ; 0x01 d4dc: 62 82 std Z+2, r6 ; 0x02 d4de: 73 82 std Z+3, r7 ; 0x03 } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SHIFT) { d4e0: 30 fe sbrs r3, 0 d4e2: 26 c0 rjmp .+76 ; 0xd530 // Then add the offset. x += world2machine_shift[0]; d4e4: 20 91 07 18 lds r18, 0x1807 ; 0x801807 d4e8: 30 91 08 18 lds r19, 0x1808 ; 0x801808 d4ec: 40 91 09 18 lds r20, 0x1809 ; 0x801809 d4f0: 50 91 0a 18 lds r21, 0x180A ; 0x80180a d4f4: 68 81 ld r22, Y d4f6: 79 81 ldd r23, Y+1 ; 0x01 d4f8: 8a 81 ldd r24, Y+2 ; 0x02 d4fa: 9b 81 ldd r25, Y+3 ; 0x03 d4fc: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> d500: 68 83 st Y, r22 d502: 79 83 std Y+1, r23 ; 0x01 d504: 8a 83 std Y+2, r24 ; 0x02 d506: 9b 83 std Y+3, r25 ; 0x03 y += world2machine_shift[1]; d508: 20 91 0b 18 lds r18, 0x180B ; 0x80180b d50c: 30 91 0c 18 lds r19, 0x180C ; 0x80180c d510: 40 91 0d 18 lds r20, 0x180D ; 0x80180d d514: 50 91 0e 18 lds r21, 0x180E ; 0x80180e d518: f8 01 movw r30, r16 d51a: 60 81 ld r22, Z d51c: 71 81 ldd r23, Z+1 ; 0x01 d51e: 82 81 ldd r24, Z+2 ; 0x02 d520: 93 81 ldd r25, Z+3 ; 0x03 d522: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> d526: f8 01 movw r30, r16 d528: 60 83 st Z, r22 d52a: 71 83 std Z+1, r23 ; 0x01 d52c: 82 83 std Z+2, r24 ; 0x02 d52e: 93 83 std Z+3, r25 ; 0x03 } } } d530: df 91 pop r29 d532: cf 91 pop r28 d534: 1f 91 pop r17 d536: 0f 91 pop r16 d538: ff 90 pop r15 d53a: ef 90 pop r14 d53c: df 90 pop r13 d53e: cf 90 pop r12 d540: bf 90 pop r11 d542: af 90 pop r10 d544: 9f 90 pop r9 d546: 8f 90 pop r8 d548: 7f 90 pop r7 d54a: 6f 90 pop r6 d54c: 5f 90 pop r5 d54e: 4f 90 pop r4 d550: 3f 90 pop r3 d552: 08 95 ret 0000d554 : } } } inline bool world2machine_clamp(float &x, float &y) { d554: 2f 92 push r2 d556: 3f 92 push r3 d558: 4f 92 push r4 d55a: 5f 92 push r5 d55c: 6f 92 push r6 d55e: 7f 92 push r7 d560: 8f 92 push r8 d562: 9f 92 push r9 d564: af 92 push r10 d566: bf 92 push r11 d568: cf 92 push r12 d56a: df 92 push r13 d56c: ef 92 push r14 d56e: ff 92 push r15 d570: 0f 93 push r16 d572: 1f 93 push r17 d574: cf 93 push r28 d576: df 93 push r29 d578: 00 d0 rcall .+0 ; 0xd57a d57a: 00 d0 rcall .+0 ; 0xd57c d57c: 1f 92 push r1 d57e: 1f 92 push r1 d580: cd b7 in r28, 0x3d ; 61 d582: de b7 in r29, 0x3e ; 62 d584: 8c 01 movw r16, r24 d586: 1b 01 movw r2, r22 } } inline void world2machine(const float &x, const float &y, float &out_x, float &out_y) { out_x = x; d588: fc 01 movw r30, r24 d58a: 80 81 ld r24, Z d58c: 91 81 ldd r25, Z+1 ; 0x01 d58e: a2 81 ldd r26, Z+2 ; 0x02 d590: b3 81 ldd r27, Z+3 ; 0x03 d592: 89 83 std Y+1, r24 ; 0x01 d594: 9a 83 std Y+2, r25 ; 0x02 d596: ab 83 std Y+3, r26 ; 0x03 d598: bc 83 std Y+4, r27 ; 0x04 out_y = y; d59a: fb 01 movw r30, r22 d59c: 80 81 ld r24, Z d59e: 91 81 ldd r25, Z+1 ; 0x01 d5a0: a2 81 ldd r26, Z+2 ; 0x02 d5a2: b3 81 ldd r27, Z+3 ; 0x03 d5a4: 8d 83 std Y+5, r24 ; 0x05 d5a6: 9e 83 std Y+6, r25 ; 0x06 d5a8: af 83 std Y+7, r26 ; 0x07 d5aa: b8 87 std Y+8, r27 ; 0x08 world2machine(out_x, out_y); d5ac: be 01 movw r22, r28 d5ae: 6b 5f subi r22, 0xFB ; 251 d5b0: 7f 4f sbci r23, 0xFF ; 255 d5b2: ce 01 movw r24, r28 d5b4: 01 96 adiw r24, 0x01 ; 1 d5b6: 0e 94 02 6a call 0xd404 ; 0xd404 inline bool world2machine_clamp(float &x, float &y) { bool clamped = false; float tmpx, tmpy; world2machine(x, y, tmpx, tmpy); if (tmpx < X_MIN_POS) { d5ba: c9 80 ldd r12, Y+1 ; 0x01 d5bc: da 80 ldd r13, Y+2 ; 0x02 d5be: eb 80 ldd r14, Y+3 ; 0x03 d5c0: fc 80 ldd r15, Y+4 ; 0x04 d5c2: 20 e0 ldi r18, 0x00 ; 0 d5c4: 30 e0 ldi r19, 0x00 ; 0 d5c6: a9 01 movw r20, r18 d5c8: c7 01 movw r24, r14 d5ca: b6 01 movw r22, r12 d5cc: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> d5d0: 87 ff sbrs r24, 7 d5d2: 35 c0 rjmp .+106 ; 0xd63e tmpx = X_MIN_POS; d5d4: 19 82 std Y+1, r1 ; 0x01 d5d6: 1a 82 std Y+2, r1 ; 0x02 d5d8: 1b 82 std Y+3, r1 ; 0x03 d5da: 1c 82 std Y+4, r1 ; 0x04 clamped = true; } else if (tmpx > X_MAX_POS) { tmpx = X_MAX_POS; clamped = true; d5dc: ff 24 eor r15, r15 d5de: f3 94 inc r15 } if (tmpy < Y_MIN_POS) { d5e0: 8d 80 ldd r8, Y+5 ; 0x05 d5e2: 9e 80 ldd r9, Y+6 ; 0x06 d5e4: af 80 ldd r10, Y+7 ; 0x07 d5e6: b8 84 ldd r11, Y+8 ; 0x08 d5e8: 20 e0 ldi r18, 0x00 ; 0 d5ea: 30 e0 ldi r19, 0x00 ; 0 d5ec: 40 e8 ldi r20, 0x80 ; 128 d5ee: 50 ec ldi r21, 0xC0 ; 192 d5f0: c5 01 movw r24, r10 d5f2: b4 01 movw r22, r8 d5f4: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> d5f8: 87 ff sbrs r24, 7 d5fa: 35 c0 rjmp .+106 ; 0xd666 tmpy = Y_MIN_POS; d5fc: 80 e0 ldi r24, 0x00 ; 0 d5fe: 90 e0 ldi r25, 0x00 ; 0 d600: a0 e8 ldi r26, 0x80 ; 128 d602: b0 ec ldi r27, 0xC0 ; 192 clamped = true; } else if (tmpy > Y_MAX_POS) { tmpy = Y_MAX_POS; d604: 8d 83 std Y+5, r24 ; 0x05 d606: 9e 83 std Y+6, r25 ; 0x06 d608: af 83 std Y+7, r26 ; 0x07 d60a: b8 87 std Y+8, r27 ; 0x08 clamped = true; } if (clamped) machine2world(tmpx, tmpy, x, y); d60c: cd 80 ldd r12, Y+5 ; 0x05 d60e: de 80 ldd r13, Y+6 ; 0x06 d610: ef 80 ldd r14, Y+7 ; 0x07 d612: f8 84 ldd r15, Y+8 ; 0x08 d614: 89 80 ldd r8, Y+1 ; 0x01 d616: 9a 80 ldd r9, Y+2 ; 0x02 d618: ab 80 ldd r10, Y+3 ; 0x03 d61a: 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) { d61c: 70 90 0f 18 lds r7, 0x180F ; 0x80180f d620: 71 10 cpse r7, r1 d622: 4c c0 rjmp .+152 ; 0xd6bc // No correction. out_x = x; d624: f8 01 movw r30, r16 d626: 80 82 st Z, r8 d628: 91 82 std Z+1, r9 ; 0x01 d62a: a2 82 std Z+2, r10 ; 0x02 d62c: b3 82 std Z+3, r11 ; 0x03 out_y = y; d62e: f1 01 movw r30, r2 d630: c0 82 st Z, r12 d632: d1 82 std Z+1, r13 ; 0x01 d634: e2 82 std Z+2, r14 ; 0x02 d636: 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) { d638: ff 24 eor r15, r15 d63a: f3 94 inc r15 d63c: 25 c0 rjmp .+74 ; 0xd688 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) { d63e: 20 e0 ldi r18, 0x00 ; 0 d640: 30 e0 ldi r19, 0x00 ; 0 d642: 4f e7 ldi r20, 0x7F ; 127 d644: 53 e4 ldi r21, 0x43 ; 67 d646: c7 01 movw r24, r14 d648: b6 01 movw r22, r12 d64a: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> } } inline bool world2machine_clamp(float &x, float &y) { bool clamped = false; d64e: 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) { d650: 18 16 cp r1, r24 d652: 34 f6 brge .-116 ; 0xd5e0 tmpx = X_MAX_POS; d654: 80 e0 ldi r24, 0x00 ; 0 d656: 90 e0 ldi r25, 0x00 ; 0 d658: af e7 ldi r26, 0x7F ; 127 d65a: b3 e4 ldi r27, 0x43 ; 67 d65c: 89 83 std Y+1, r24 ; 0x01 d65e: 9a 83 std Y+2, r25 ; 0x02 d660: ab 83 std Y+3, r26 ; 0x03 d662: bc 83 std Y+4, r27 ; 0x04 d664: bb cf rjmp .-138 ; 0xd5dc } if (tmpy < Y_MIN_POS) { tmpy = Y_MIN_POS; clamped = true; } else if (tmpy > Y_MAX_POS) { d666: 20 e0 ldi r18, 0x00 ; 0 d668: 30 e8 ldi r19, 0x80 ; 128 d66a: 44 e5 ldi r20, 0x54 ; 84 d66c: 53 e4 ldi r21, 0x43 ; 67 d66e: c5 01 movw r24, r10 d670: b4 01 movw r22, r8 d672: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> d676: 18 16 cp r1, r24 d678: 2c f4 brge .+10 ; 0xd684 tmpy = Y_MAX_POS; d67a: 80 e0 ldi r24, 0x00 ; 0 d67c: 90 e8 ldi r25, 0x80 ; 128 d67e: a4 e5 ldi r26, 0x54 ; 84 d680: b3 e4 ldi r27, 0x43 ; 67 d682: c0 cf rjmp .-128 ; 0xd604 clamped = true; } if (clamped) d684: f1 10 cpse r15, r1 d686: c2 cf rjmp .-124 ; 0xd60c machine2world(tmpx, tmpy, x, y); return clamped; } d688: 8f 2d mov r24, r15 d68a: 28 96 adiw r28, 0x08 ; 8 d68c: 0f b6 in r0, 0x3f ; 63 d68e: f8 94 cli d690: de bf out 0x3e, r29 ; 62 d692: 0f be out 0x3f, r0 ; 63 d694: cd bf out 0x3d, r28 ; 61 d696: df 91 pop r29 d698: cf 91 pop r28 d69a: 1f 91 pop r17 d69c: 0f 91 pop r16 d69e: ff 90 pop r15 d6a0: ef 90 pop r14 d6a2: df 90 pop r13 d6a4: cf 90 pop r12 d6a6: bf 90 pop r11 d6a8: af 90 pop r10 d6aa: 9f 90 pop r9 d6ac: 8f 90 pop r8 d6ae: 7f 90 pop r7 d6b0: 6f 90 pop r6 d6b2: 5f 90 pop r5 d6b4: 4f 90 pop r4 d6b6: 3f 90 pop r3 d6b8: 2f 90 pop r2 d6ba: 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) { d6bc: 70 fe sbrs r7, 0 d6be: 1c c0 rjmp .+56 ; 0xd6f8 // Then add the offset. x -= world2machine_shift[0]; d6c0: 20 91 07 18 lds r18, 0x1807 ; 0x801807 d6c4: 30 91 08 18 lds r19, 0x1808 ; 0x801808 d6c8: 40 91 09 18 lds r20, 0x1809 ; 0x801809 d6cc: 50 91 0a 18 lds r21, 0x180A ; 0x80180a d6d0: c5 01 movw r24, r10 d6d2: b4 01 movw r22, r8 d6d4: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> d6d8: 4b 01 movw r8, r22 d6da: 5c 01 movw r10, r24 y -= world2machine_shift[1]; d6dc: 20 91 0b 18 lds r18, 0x180B ; 0x80180b d6e0: 30 91 0c 18 lds r19, 0x180C ; 0x80180c d6e4: 40 91 0d 18 lds r20, 0x180D ; 0x80180d d6e8: 50 91 0e 18 lds r21, 0x180E ; 0x80180e d6ec: c7 01 movw r24, r14 d6ee: b6 01 movw r22, r12 d6f0: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> d6f4: 6b 01 movw r12, r22 d6f6: 7c 01 movw r14, r24 } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { d6f8: 71 fe sbrs r7, 1 d6fa: 9e cf rjmp .-196 ; 0xd638 // Firs the skew & rotation correction. out_x = world2machine_rotation_and_skew_inv[0][0] * x + world2machine_rotation_and_skew_inv[0][1] * y; d6fc: 20 91 f7 17 lds r18, 0x17F7 ; 0x8017f7 d700: 30 91 f8 17 lds r19, 0x17F8 ; 0x8017f8 d704: 40 91 f9 17 lds r20, 0x17F9 ; 0x8017f9 d708: 50 91 fa 17 lds r21, 0x17FA ; 0x8017fa d70c: c5 01 movw r24, r10 d70e: b4 01 movw r22, r8 d710: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> d714: 2b 01 movw r4, r22 d716: 3c 01 movw r6, r24 d718: 20 91 fb 17 lds r18, 0x17FB ; 0x8017fb d71c: 30 91 fc 17 lds r19, 0x17FC ; 0x8017fc d720: 40 91 fd 17 lds r20, 0x17FD ; 0x8017fd d724: 50 91 fe 17 lds r21, 0x17FE ; 0x8017fe d728: c7 01 movw r24, r14 d72a: b6 01 movw r22, r12 d72c: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> d730: 9b 01 movw r18, r22 d732: ac 01 movw r20, r24 d734: c3 01 movw r24, r6 d736: b2 01 movw r22, r4 d738: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> d73c: f8 01 movw r30, r16 d73e: 60 83 st Z, r22 d740: 71 83 std Z+1, r23 ; 0x01 d742: 82 83 std Z+2, r24 ; 0x02 d744: 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; d746: 20 91 ff 17 lds r18, 0x17FF ; 0x8017ff d74a: 30 91 00 18 lds r19, 0x1800 ; 0x801800 d74e: 40 91 01 18 lds r20, 0x1801 ; 0x801801 d752: 50 91 02 18 lds r21, 0x1802 ; 0x801802 d756: c5 01 movw r24, r10 d758: b4 01 movw r22, r8 d75a: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> d75e: 4b 01 movw r8, r22 d760: 5c 01 movw r10, r24 d762: 20 91 03 18 lds r18, 0x1803 ; 0x801803 d766: 30 91 04 18 lds r19, 0x1804 ; 0x801804 d76a: 40 91 05 18 lds r20, 0x1805 ; 0x801805 d76e: 50 91 06 18 lds r21, 0x1806 ; 0x801806 d772: c7 01 movw r24, r14 d774: b6 01 movw r22, r12 d776: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> d77a: 9b 01 movw r18, r22 d77c: ac 01 movw r20, r24 d77e: c5 01 movw r24, r10 d780: b4 01 movw r22, r8 d782: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> d786: f1 01 movw r30, r2 d788: 60 83 st Z, r22 d78a: 71 83 std Z+1, r23 ; 0x01 d78c: 82 83 std Z+2, r24 ; 0x02 d78e: 93 83 std Z+3, r25 ; 0x03 d790: 53 cf rjmp .-346 ; 0xd638 0000d792 : if(next_feedrate > 0.f) feedrate = next_feedrate; } } void clamp_to_software_endstops(float target[3]) { d792: cf 92 push r12 d794: df 92 push r13 d796: ef 92 push r14 d798: ff 92 push r15 d79a: cf 93 push r28 d79c: df 93 push r29 d79e: ec 01 movw r28, r24 #ifdef DEBUG_DISABLE_SWLIMITS return; #endif //DEBUG_DISABLE_SWLIMITS world2machine_clamp(target[0], target[1]); d7a0: bc 01 movw r22, r24 d7a2: 6c 5f subi r22, 0xFC ; 252 d7a4: 7f 4f sbci r23, 0xFF ; 255 d7a6: 0e 94 aa 6a call 0xd554 ; 0xd554 // Clamp the Z coordinate. if (min_software_endstops) { if (target[Z_AXIS] < min_pos[Z_AXIS]) target[Z_AXIS] = min_pos[Z_AXIS]; d7aa: c0 90 29 02 lds r12, 0x0229 ; 0x800229 d7ae: d0 90 2a 02 lds r13, 0x022A ; 0x80022a d7b2: e0 90 2b 02 lds r14, 0x022B ; 0x80022b d7b6: f0 90 2c 02 lds r15, 0x022C ; 0x80022c d7ba: a7 01 movw r20, r14 d7bc: 96 01 movw r18, r12 d7be: 68 85 ldd r22, Y+8 ; 0x08 d7c0: 79 85 ldd r23, Y+9 ; 0x09 d7c2: 8a 85 ldd r24, Y+10 ; 0x0a d7c4: 9b 85 ldd r25, Y+11 ; 0x0b d7c6: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> d7ca: 87 ff sbrs r24, 7 d7cc: 04 c0 rjmp .+8 ; 0xd7d6 d7ce: c8 86 std Y+8, r12 ; 0x08 d7d0: d9 86 std Y+9, r13 ; 0x09 d7d2: ea 86 std Y+10, r14 ; 0x0a d7d4: 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]; d7d6: c0 90 1d 02 lds r12, 0x021D ; 0x80021d d7da: d0 90 1e 02 lds r13, 0x021E ; 0x80021e d7de: e0 90 1f 02 lds r14, 0x021F ; 0x80021f d7e2: f0 90 20 02 lds r15, 0x0220 ; 0x800220 d7e6: a7 01 movw r20, r14 d7e8: 96 01 movw r18, r12 d7ea: 68 85 ldd r22, Y+8 ; 0x08 d7ec: 79 85 ldd r23, Y+9 ; 0x09 d7ee: 8a 85 ldd r24, Y+10 ; 0x0a d7f0: 9b 85 ldd r25, Y+11 ; 0x0b d7f2: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> d7f6: 18 16 cp r1, r24 d7f8: 24 f4 brge .+8 ; 0xd802 d7fa: c8 86 std Y+8, r12 ; 0x08 d7fc: d9 86 std Y+9, r13 ; 0x09 d7fe: ea 86 std Y+10, r14 ; 0x0a d800: fb 86 std Y+11, r15 ; 0x0b } } d802: df 91 pop r29 d804: cf 91 pop r28 d806: ff 90 pop r15 d808: ef 90 pop r14 d80a: df 90 pop r13 d80c: cf 90 pop r12 d80e: 08 95 ret 0000d810 : plan_buffer_line(x, y, z, e, feed_rate, current_position); } #endif // MESH_BED_LEVELING void prepare_move(uint16_t start_segment_idx) { d810: 2f 92 push r2 d812: 3f 92 push r3 d814: 4f 92 push r4 d816: 5f 92 push r5 d818: 6f 92 push r6 d81a: 7f 92 push r7 d81c: 8f 92 push r8 d81e: 9f 92 push r9 d820: af 92 push r10 d822: bf 92 push r11 d824: cf 92 push r12 d826: df 92 push r13 d828: ef 92 push r14 d82a: ff 92 push r15 d82c: 0f 93 push r16 d82e: 1f 93 push r17 d830: cf 93 push r28 d832: df 93 push r29 d834: cd b7 in r28, 0x3d ; 61 d836: de b7 in r29, 0x3e ; 62 d838: a2 97 sbiw r28, 0x22 ; 34 d83a: 0f b6 in r0, 0x3f ; 63 d83c: f8 94 cli d83e: de bf out 0x3e, r29 ; 62 d840: 0f be out 0x3f, r0 ; 63 d842: cd bf out 0x3d, r28 ; 61 d844: 1c 01 movw r2, r24 clamp_to_software_endstops(destination); d846: 84 e7 ldi r24, 0x74 ; 116 d848: 96 e0 ldi r25, 0x06 ; 6 d84a: 0e 94 c9 6b call 0xd792 ; 0xd792 previous_millis_cmd.start(); d84e: 86 e8 ldi r24, 0x86 ; 134 d850: 93 e0 ldi r25, 0x03 ; 3 d852: 0f 94 ef 2b call 0x257de ; 0x257de ::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])) { d856: 40 90 92 06 lds r4, 0x0692 ; 0x800692 d85a: 50 90 93 06 lds r5, 0x0693 ; 0x800693 d85e: 60 90 94 06 lds r6, 0x0694 ; 0x800694 d862: 70 90 95 06 lds r7, 0x0695 ; 0x800695 d866: c0 90 74 06 lds r12, 0x0674 ; 0x800674 d86a: d0 90 75 06 lds r13, 0x0675 ; 0x800675 d86e: e0 90 76 06 lds r14, 0x0676 ; 0x800676 d872: f0 90 77 06 lds r15, 0x0677 ; 0x800677 d876: a7 01 movw r20, r14 d878: 96 01 movw r18, r12 d87a: c3 01 movw r24, r6 d87c: b2 01 movw r22, r4 d87e: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> d882: 81 11 cpse r24, r1 d884: 3f c0 rjmp .+126 ; 0xd904 d886: 20 91 78 06 lds r18, 0x0678 ; 0x800678 d88a: 30 91 79 06 lds r19, 0x0679 ; 0x800679 d88e: 40 91 7a 06 lds r20, 0x067A ; 0x80067a d892: 50 91 7b 06 lds r21, 0x067B ; 0x80067b d896: 60 91 96 06 lds r22, 0x0696 ; 0x800696 d89a: 70 91 97 06 lds r23, 0x0697 ; 0x800697 d89e: 80 91 98 06 lds r24, 0x0698 ; 0x800698 d8a2: 90 91 99 06 lds r25, 0x0699 ; 0x800699 d8a6: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> d8aa: 81 11 cpse r24, r1 d8ac: 2b c0 rjmp .+86 ; 0xd904 plan_buffer_line_destinationXYZE(feedrate/60); d8ae: 20 e0 ldi r18, 0x00 ; 0 d8b0: 30 e0 ldi r19, 0x00 ; 0 d8b2: 40 e7 ldi r20, 0x70 ; 112 d8b4: 52 e4 ldi r21, 0x42 ; 66 d8b6: 60 91 b8 02 lds r22, 0x02B8 ; 0x8002b8 d8ba: 70 91 b9 02 lds r23, 0x02B9 ; 0x8002b9 d8be: 80 91 ba 02 lds r24, 0x02BA ; 0x8002ba d8c2: 90 91 bb 02 lds r25, 0x02BB ; 0x8002bb d8c6: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> d8ca: 0f 94 16 c0 call 0x3802c ; 0x3802c #else plan_buffer_line_destinationXYZE(feedrate*feedmultiply*(1./(60.f*100.f))); #endif } set_current_to_destination(); d8ce: 0e 94 ff 5a call 0xb5fe ; 0xb5fe } d8d2: a2 96 adiw r28, 0x22 ; 34 d8d4: 0f b6 in r0, 0x3f ; 63 d8d6: f8 94 cli d8d8: de bf out 0x3e, r29 ; 62 d8da: 0f be out 0x3f, r0 ; 63 d8dc: cd bf out 0x3d, r28 ; 61 d8de: df 91 pop r29 d8e0: cf 91 pop r28 d8e2: 1f 91 pop r17 d8e4: 0f 91 pop r16 d8e6: ff 90 pop r15 d8e8: ef 90 pop r14 d8ea: df 90 pop r13 d8ec: cf 90 pop r12 d8ee: bf 90 pop r11 d8f0: af 90 pop r10 d8f2: 9f 90 pop r9 d8f4: 8f 90 pop r8 d8f6: 7f 90 pop r7 d8f8: 6f 90 pop r6 d8fa: 5f 90 pop r5 d8fc: 4f 90 pop r4 d8fe: 3f 90 pop r3 d900: 2f 90 pop r2 d902: 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); d904: 60 91 39 02 lds r22, 0x0239 ; 0x800239 d908: 70 91 3a 02 lds r23, 0x023A ; 0x80023a d90c: 07 2e mov r0, r23 d90e: 00 0c add r0, r0 d910: 88 0b sbc r24, r24 d912: 99 0b sbc r25, r25 d914: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> d918: 20 91 b8 02 lds r18, 0x02B8 ; 0x8002b8 d91c: 30 91 b9 02 lds r19, 0x02B9 ; 0x8002b9 d920: 40 91 ba 02 lds r20, 0x02BA ; 0x8002ba d924: 50 91 bb 02 lds r21, 0x02BB ; 0x8002bb d928: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> d92c: 2e e3 ldi r18, 0x3E ; 62 d92e: 33 ec ldi r19, 0xC3 ; 195 d930: 4e e2 ldi r20, 0x2E ; 46 d932: 59 e3 ldi r21, 0x39 ; 57 d934: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> d938: 6f 83 std Y+7, r22 ; 0x07 d93a: 78 87 std Y+8, r23 ; 0x08 d93c: 89 87 std Y+9, r24 ; 0x09 d93e: 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) { d940: 80 91 c2 13 lds r24, 0x13C2 ; 0x8013c2 d944: 88 23 and r24, r24 d946: 09 f4 brne .+2 ; 0xd94a d948: 0f c1 rjmp .+542 ; 0xdb68 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]; d94a: a3 01 movw r20, r6 d94c: 92 01 movw r18, r4 d94e: c7 01 movw r24, r14 d950: b6 01 movw r22, r12 d952: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> d956: 2b 01 movw r4, r22 d958: 3c 01 movw r6, r24 float dy = y - current_position[Y_AXIS]; d95a: 20 91 96 06 lds r18, 0x0696 ; 0x800696 d95e: 30 91 97 06 lds r19, 0x0697 ; 0x800697 d962: 40 91 98 06 lds r20, 0x0698 ; 0x800698 d966: 50 91 99 06 lds r21, 0x0699 ; 0x800699 d96a: 60 91 78 06 lds r22, 0x0678 ; 0x800678 d96e: 70 91 79 06 lds r23, 0x0679 ; 0x800679 d972: 80 91 7a 06 lds r24, 0x067A ; 0x80067a d976: 90 91 7b 06 lds r25, 0x067B ; 0x80067b d97a: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> d97e: 6b 87 std Y+11, r22 ; 0x0b d980: 7c 87 std Y+12, r23 ; 0x0c d982: 8d 87 std Y+13, r24 ; 0x0d d984: 9e 87 std Y+14, r25 ; 0x0e uint16_t n_segments = 0; if (mbl.active) { float len = fabs(dx) + fabs(dy); d986: c3 01 movw r24, r6 d988: b2 01 movw r22, r4 d98a: 9f 77 andi r25, 0x7F ; 127 d98c: 2b 85 ldd r18, Y+11 ; 0x0b d98e: 3c 85 ldd r19, Y+12 ; 0x0c d990: 4d 85 ldd r20, Y+13 ; 0x0d d992: 5e 85 ldd r21, Y+14 ; 0x0e d994: 5f 77 andi r21, 0x7F ; 127 d996: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> d99a: 6b 01 movw r12, r22 d99c: 7c 01 movw r14, r24 if (len > 0) d99e: 20 e0 ldi r18, 0x00 ; 0 d9a0: 30 e0 ldi r19, 0x00 ; 0 d9a2: a9 01 movw r20, r18 d9a4: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> d9a8: 18 16 cp r1, r24 d9aa: 0c f0 brlt .+2 ; 0xd9ae d9ac: dd c0 rjmp .+442 ; 0xdb68 // Split to 3cm segments or shorter. n_segments = uint16_t(ceil(len / 30.f)); d9ae: 20 e0 ldi r18, 0x00 ; 0 d9b0: 30 e0 ldi r19, 0x00 ; 0 d9b2: 40 ef ldi r20, 0xF0 ; 240 d9b4: 51 e4 ldi r21, 0x41 ; 65 d9b6: c7 01 movw r24, r14 d9b8: b6 01 movw r22, r12 d9ba: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> d9be: 0f 94 22 de call 0x3bc44 ; 0x3bc44 d9c2: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> d9c6: 7e 83 std Y+6, r23 ; 0x06 d9c8: 6d 83 std Y+5, r22 ; 0x05 } if (n_segments > 1 && start_segment_idx) { d9ca: 62 30 cpi r22, 0x02 ; 2 d9cc: 71 05 cpc r23, r1 d9ce: 08 f4 brcc .+2 ; 0xd9d2 d9d0: cb c0 rjmp .+406 ; 0xdb68 d9d2: 21 14 cp r2, r1 d9d4: 31 04 cpc r3, r1 d9d6: 09 f4 brne .+2 ; 0xd9da d9d8: c7 c0 rjmp .+398 ; 0xdb68 float dz = z - current_position[Z_AXIS]; d9da: 20 91 9a 06 lds r18, 0x069A ; 0x80069a d9de: 30 91 9b 06 lds r19, 0x069B ; 0x80069b d9e2: 40 91 9c 06 lds r20, 0x069C ; 0x80069c d9e6: 50 91 9d 06 lds r21, 0x069D ; 0x80069d d9ea: 60 91 7c 06 lds r22, 0x067C ; 0x80067c d9ee: 70 91 7d 06 lds r23, 0x067D ; 0x80067d d9f2: 80 91 7e 06 lds r24, 0x067E ; 0x80067e d9f6: 90 91 7f 06 lds r25, 0x067F ; 0x80067f d9fa: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> d9fe: 6f 87 std Y+15, r22 ; 0x0f da00: 78 8b std Y+16, r23 ; 0x10 da02: 89 8b std Y+17, r24 ; 0x11 da04: 9a 8b std Y+18, r25 ; 0x12 float de = e - current_position[E_AXIS]; da06: 20 91 9e 06 lds r18, 0x069E ; 0x80069e da0a: 30 91 9f 06 lds r19, 0x069F ; 0x80069f da0e: 40 91 a0 06 lds r20, 0x06A0 ; 0x8006a0 da12: 50 91 a1 06 lds r21, 0x06A1 ; 0x8006a1 da16: 60 91 80 06 lds r22, 0x0680 ; 0x800680 da1a: 70 91 81 06 lds r23, 0x0681 ; 0x800681 da1e: 80 91 82 06 lds r24, 0x0682 ; 0x800682 da22: 90 91 83 06 lds r25, 0x0683 ; 0x800683 da26: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> da2a: 6b 8b std Y+19, r22 ; 0x13 da2c: 7c 8b std Y+20, r23 ; 0x14 da2e: 8d 8b std Y+21, r24 ; 0x15 da30: 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); da32: ad 81 ldd r26, Y+5 ; 0x05 da34: be 81 ldd r27, Y+6 ; 0x06 da36: cd 01 movw r24, r26 da38: b0 e0 ldi r27, 0x00 ; 0 da3a: a0 e0 ldi r26, 0x00 ; 0 da3c: 8f 8f std Y+31, r24 ; 0x1f da3e: 98 a3 std Y+32, r25 ; 0x20 da40: a9 a3 std Y+33, r26 ; 0x21 da42: 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) { da44: 2d 81 ldd r18, Y+5 ; 0x05 da46: 3e 81 ldd r19, Y+6 ; 0x06 da48: 22 16 cp r2, r18 da4a: 33 06 cpc r3, r19 da4c: 08 f0 brcs .+2 ; 0xda50 da4e: 8c c0 rjmp .+280 ; 0xdb68 float t = float(i) / float(n_segments); da50: b1 01 movw r22, r2 da52: 90 e0 ldi r25, 0x00 ; 0 da54: 80 e0 ldi r24, 0x00 ; 0 da56: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> da5a: 6b 01 movw r12, r22 da5c: 7c 01 movw r14, r24 da5e: 6f 8d ldd r22, Y+31 ; 0x1f da60: 78 a1 ldd r23, Y+32 ; 0x20 da62: 89 a1 ldd r24, Y+33 ; 0x21 da64: 9a a1 ldd r25, Y+34 ; 0x22 da66: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> da6a: 9b 01 movw r18, r22 da6c: ac 01 movw r20, r24 da6e: c7 01 movw r24, r14 da70: b6 01 movw r22, r12 da72: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> da76: 6b 01 movw r12, r22 da78: 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, da7a: ac 01 movw r20, r24 da7c: 9b 01 movw r18, r22 da7e: 6b 89 ldd r22, Y+19 ; 0x13 da80: 7c 89 ldd r23, Y+20 ; 0x14 da82: 8d 89 ldd r24, Y+21 ; 0x15 da84: 9e 89 ldd r25, Y+22 ; 0x16 da86: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> da8a: 9b 01 movw r18, r22 da8c: ac 01 movw r20, r24 da8e: 60 91 9e 06 lds r22, 0x069E ; 0x80069e da92: 70 91 9f 06 lds r23, 0x069F ; 0x80069f da96: 80 91 a0 06 lds r24, 0x06A0 ; 0x8006a0 da9a: 90 91 a1 06 lds r25, 0x06A1 ; 0x8006a1 da9e: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> daa2: 69 83 std Y+1, r22 ; 0x01 daa4: 7a 83 std Y+2, r23 ; 0x02 daa6: 8b 83 std Y+3, r24 ; 0x03 daa8: 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, daaa: a7 01 movw r20, r14 daac: 96 01 movw r18, r12 daae: 6f 85 ldd r22, Y+15 ; 0x0f dab0: 78 89 ldd r23, Y+16 ; 0x10 dab2: 89 89 ldd r24, Y+17 ; 0x11 dab4: 9a 89 ldd r25, Y+18 ; 0x12 dab6: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__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, daba: 20 91 9a 06 lds r18, 0x069A ; 0x80069a dabe: 30 91 9b 06 lds r19, 0x069B ; 0x80069b dac2: 40 91 9c 06 lds r20, 0x069C ; 0x80069c dac6: 50 91 9d 06 lds r21, 0x069D ; 0x80069d daca: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> dace: 6f 8b std Y+23, r22 ; 0x17 dad0: 78 8f std Y+24, r23 ; 0x18 dad2: 89 8f std Y+25, r24 ; 0x19 dad4: 9a 8f std Y+26, r25 ; 0x1a current_position[Y_AXIS] + t * dy, dad6: a7 01 movw r20, r14 dad8: 96 01 movw r18, r12 dada: 6b 85 ldd r22, Y+11 ; 0x0b dadc: 7c 85 ldd r23, Y+12 ; 0x0c dade: 8d 85 ldd r24, Y+13 ; 0x0d dae0: 9e 85 ldd r25, Y+14 ; 0x0e dae2: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__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, dae6: 20 91 96 06 lds r18, 0x0696 ; 0x800696 daea: 30 91 97 06 lds r19, 0x0697 ; 0x800697 daee: 40 91 98 06 lds r20, 0x0698 ; 0x800698 daf2: 50 91 99 06 lds r21, 0x0699 ; 0x800699 daf6: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> dafa: 6b 8f std Y+27, r22 ; 0x1b dafc: 7c 8f std Y+28, r23 ; 0x1c dafe: 8d 8f std Y+29, r24 ; 0x1d db00: 9e 8f std Y+30, r25 ; 0x1e db02: a7 01 movw r20, r14 db04: 96 01 movw r18, r12 db06: c3 01 movw r24, r6 db08: b2 01 movw r22, r4 db0a: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> db0e: 20 91 92 06 lds r18, 0x0692 ; 0x800692 db12: 30 91 93 06 lds r19, 0x0693 ; 0x800693 db16: 40 91 94 06 lds r20, 0x0694 ; 0x800694 db1a: 50 91 95 06 lds r21, 0x0695 ; 0x800695 db1e: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> db22: 3f 92 push r3 db24: 2f 92 push r2 db26: a2 e9 ldi r26, 0x92 ; 146 db28: b6 e0 ldi r27, 0x06 ; 6 db2a: bf 93 push r27 db2c: af 93 push r26 db2e: 8f 80 ldd r8, Y+7 ; 0x07 db30: 98 84 ldd r9, Y+8 ; 0x08 db32: a9 84 ldd r10, Y+9 ; 0x09 db34: ba 84 ldd r11, Y+10 ; 0x0a db36: de 01 movw r26, r28 db38: 11 96 adiw r26, 0x01 ; 1 db3a: 6d 01 movw r12, r26 db3c: ef 88 ldd r14, Y+23 ; 0x17 db3e: f8 8c ldd r15, Y+24 ; 0x18 db40: 09 8d ldd r16, Y+25 ; 0x19 db42: 1a 8d ldd r17, Y+26 ; 0x1a db44: 2b 8d ldd r18, Y+27 ; 0x1b db46: 3c 8d ldd r19, Y+28 ; 0x1c db48: 4d 8d ldd r20, Y+29 ; 0x1d db4a: 5e 8d ldd r21, Y+30 ; 0x1e db4c: 0f 94 f4 b0 call 0x361e8 ; 0x361e8 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) db50: 0f 90 pop r0 db52: 0f 90 pop r0 db54: 0f 90 pop r0 db56: 0f 90 pop r0 db58: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac db5c: 81 11 cpse r24, r1 db5e: b7 ce rjmp .-658 ; 0xd8ce 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) { db60: bf ef ldi r27, 0xFF ; 255 db62: 2b 1a sub r2, r27 db64: 3b 0a sbc r3, r27 db66: 6e cf rjmp .-292 ; 0xda44 if (planner_aborted) return; } } // The rest of the path. plan_buffer_line(x, y, z, e, feed_rate, current_position); db68: e0 90 7c 06 lds r14, 0x067C ; 0x80067c db6c: f0 90 7d 06 lds r15, 0x067D ; 0x80067d db70: 00 91 7e 06 lds r16, 0x067E ; 0x80067e db74: 10 91 7f 06 lds r17, 0x067F ; 0x80067f db78: 20 91 78 06 lds r18, 0x0678 ; 0x800678 db7c: 30 91 79 06 lds r19, 0x0679 ; 0x800679 db80: 40 91 7a 06 lds r20, 0x067A ; 0x80067a db84: 50 91 7b 06 lds r21, 0x067B ; 0x80067b db88: 60 91 74 06 lds r22, 0x0674 ; 0x800674 db8c: 70 91 75 06 lds r23, 0x0675 ; 0x800675 db90: 80 91 76 06 lds r24, 0x0676 ; 0x800676 db94: 90 91 77 06 lds r25, 0x0677 ; 0x800677 db98: 1f 92 push r1 db9a: 1f 92 push r1 db9c: e2 e9 ldi r30, 0x92 ; 146 db9e: f6 e0 ldi r31, 0x06 ; 6 dba0: ff 93 push r31 dba2: ef 93 push r30 dba4: 8f 80 ldd r8, Y+7 ; 0x07 dba6: 98 84 ldd r9, Y+8 ; 0x08 dba8: a9 84 ldd r10, Y+9 ; 0x09 dbaa: ba 84 ldd r11, Y+10 ; 0x0a dbac: e0 e8 ldi r30, 0x80 ; 128 dbae: ce 2e mov r12, r30 dbb0: e6 e0 ldi r30, 0x06 ; 6 dbb2: de 2e mov r13, r30 dbb4: 0f 94 f4 b0 call 0x361e8 ; 0x361e8 dbb8: 0f 90 pop r0 dbba: 0f 90 pop r0 dbbc: 0f 90 pop r0 dbbe: 0f 90 pop r0 dbc0: 86 ce rjmp .-756 ; 0xd8ce 0000dbc2 : /// @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) { dbc2: cf 92 push r12 dbc4: df 92 push r13 dbc6: ef 92 push r14 dbc8: ff 92 push r15 dbca: cf 93 push r28 dbcc: 9b 01 movw r18, r22 dbce: ac 01 movw r20, r24 float travel_z = current_position[Z_AXIS]; dbd0: c0 90 9a 06 lds r12, 0x069A ; 0x80069a dbd4: d0 90 9b 06 lds r13, 0x069B ; 0x80069b dbd8: e0 90 9c 06 lds r14, 0x069C ; 0x80069c dbdc: f0 90 9d 06 lds r15, 0x069D ; 0x80069d // Prepare to move Z axis current_position[Z_AXIS] += delta; dbe0: c7 01 movw r24, r14 dbe2: b6 01 movw r22, r12 dbe4: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> dbe8: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a dbec: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b dbf0: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c dbf4: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d #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); dbf8: 83 b1 in r24, 0x03 ; 3 #else bool z_min_endstop = false; #endif if (axis_known_position[Z_AXIS] || z_min_endstop) dbfa: 90 91 91 06 lds r25, 0x0691 ; 0x800691 dbfe: 91 11 cpse r25, r1 dc00: 02 c0 rjmp .+4 ; 0xdc06 dc02: 84 ff sbrs r24, 4 dc04: 26 c0 rjmp .+76 ; 0xdc52 { // current position is known or very low, it's safe to raise Z clamp_to_software_endstops(current_position); dc06: 82 e9 ldi r24, 0x92 ; 146 dc08: 96 e0 ldi r25, 0x06 ; 6 dc0a: 0e 94 c9 6b call 0xd792 ; 0xd792 plan_buffer_line_curposXYZE(max_feedrate[Z_AXIS]); dc0e: e0 91 71 02 lds r30, 0x0271 ; 0x800271 dc12: f0 91 72 02 lds r31, 0x0272 ; 0x800272 dc16: 60 85 ldd r22, Z+8 ; 0x08 dc18: 71 85 ldd r23, Z+9 ; 0x09 dc1a: 82 85 ldd r24, Z+10 ; 0x0a dc1c: 93 85 ldd r25, Z+11 ; 0x0b dc1e: 0f 94 49 c0 call 0x38092 ; 0x38092 st_synchronize(); dc22: 0f 94 e8 42 call 0x285d0 ; 0x285d0 // Get the final travel distance travel_z = current_position[Z_AXIS] - travel_z; dc26: a7 01 movw r20, r14 dc28: 96 01 movw r18, r12 dc2a: 60 91 9a 06 lds r22, 0x069A ; 0x80069a dc2e: 70 91 9b 06 lds r23, 0x069B ; 0x80069b dc32: 80 91 9c 06 lds r24, 0x069C ; 0x80069c dc36: 90 91 9d 06 lds r25, 0x069D ; 0x80069d dc3a: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> dc3e: 6b 01 movw r12, r22 dc40: 7c 01 movw r14, r24 #endif //TMC2130 enable_z_endstop(z_endstop_enabled); } return travel_z; } dc42: c7 01 movw r24, r14 dc44: b6 01 movw r22, r12 dc46: cf 91 pop r28 dc48: ff 90 pop r15 dc4a: ef 90 pop r14 dc4c: df 90 pop r13 dc4e: cf 90 pop r12 dc50: 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(); dc52: 15 98 cbi 0x02, 5 ; 2 st_synchronize(); dc54: 0f 94 e8 42 call 0x285d0 ; 0x285d0 // rely on crashguard to limit damage bool z_endstop_enabled = enable_z_endstop(true); dc58: 81 e0 ldi r24, 0x01 ; 1 dc5a: 0f 94 e2 4d call 0x29bc4 ; 0x29bc4 dc5e: c8 2f mov r28, r24 #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); dc60: 84 e0 ldi r24, 0x04 ; 4 dc62: 0f 94 d8 25 call 0x24bb0 ; 0x24bb0 #endif //TMC2130 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); dc66: 65 e5 ldi r22, 0x55 ; 85 dc68: 75 e5 ldi r23, 0x55 ; 85 dc6a: 85 e5 ldi r24, 0x55 ; 85 dc6c: 91 e4 ldi r25, 0x41 ; 65 dc6e: 0f 94 49 c0 call 0x38092 ; 0x38092 st_synchronize(); dc72: 0f 94 e8 42 call 0x285d0 ; 0x285d0 // Get the final travel distance travel_z = st_get_position_mm(Z_AXIS) - travel_z; dc76: 82 e0 ldi r24, 0x02 ; 2 dc78: 0f 94 d4 42 call 0x285a8 ; 0x285a8 dc7c: a7 01 movw r20, r14 dc7e: 96 01 movw r18, r12 dc80: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> dc84: 6b 01 movw r12, r22 dc86: 7c 01 movw r14, r24 #ifdef TMC2130 if (endstop_z_hit_on_purpose()) dc88: 0f 94 f0 4d call 0x29be0 ; 0x29be0 dc8c: 88 23 and r24, r24 dc8e: 91 f0 breq .+36 ; 0xdcb4 { // not necessarily exact, but will avoid further vertical moves current_position[Z_AXIS] = max_pos[Z_AXIS]; dc90: 80 91 1d 02 lds r24, 0x021D ; 0x80021d dc94: 90 91 1e 02 lds r25, 0x021E ; 0x80021e dc98: a0 91 1f 02 lds r26, 0x021F ; 0x80021f dc9c: b0 91 20 02 lds r27, 0x0220 ; 0x800220 dca0: 80 93 9a 06 sts 0x069A, r24 ; 0x80069a dca4: 90 93 9b 06 sts 0x069B, r25 ; 0x80069b dca8: a0 93 9c 06 sts 0x069C, r26 ; 0x80069c dcac: b0 93 9d 06 sts 0x069D, r27 ; 0x80069d plan_set_position_curposXYZE(); dcb0: 0f 94 09 bf call 0x37e12 ; 0x37e12 } tmc2130_home_exit(); dcb4: 0f 94 a9 25 call 0x24b52 ; 0x24b52 #endif //TMC2130 enable_z_endstop(z_endstop_enabled); dcb8: 8c 2f mov r24, r28 dcba: 0f 94 e2 4d call 0x29bc4 ; 0x29bc4 dcbe: c1 cf rjmp .-126 ; 0xdc42 0000dcc0 : // // 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) { dcc0: 8f 92 push r8 dcc2: 9f 92 push r9 dcc4: af 92 push r10 dcc6: bf 92 push r11 dcc8: cf 92 push r12 dcca: df 92 push r13 dccc: ef 92 push r14 dcce: ff 92 push r15 dcd0: 4b 01 movw r8, r22 dcd2: 5c 01 movw r10, r24 if (current_position[Z_AXIS] >= target) dcd4: c0 90 9a 06 lds r12, 0x069A ; 0x80069a dcd8: d0 90 9b 06 lds r13, 0x069B ; 0x80069b dcdc: e0 90 9c 06 lds r14, 0x069C ; 0x80069c dce0: f0 90 9d 06 lds r15, 0x069D ; 0x80069d dce4: ac 01 movw r20, r24 dce6: 9b 01 movw r18, r22 dce8: c7 01 movw r24, r14 dcea: b6 01 movw r22, r12 dcec: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> dcf0: 87 ff sbrs r24, 7 dcf2: 11 c0 rjmp .+34 ; 0xdd16 return; // Use absolute value in case the current position is unknown raise_z(fabs(current_position[Z_AXIS] - target)); dcf4: a5 01 movw r20, r10 dcf6: 94 01 movw r18, r8 dcf8: c7 01 movw r24, r14 dcfa: b6 01 movw r22, r12 dcfc: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> dd00: 9f 77 andi r25, 0x7F ; 127 } dd02: ff 90 pop r15 dd04: ef 90 pop r14 dd06: df 90 pop r13 dd08: cf 90 pop r12 dd0a: bf 90 pop r11 dd0c: af 90 pop r10 dd0e: 9f 90 pop r9 dd10: 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)); dd12: 0c 94 e1 6d jmp 0xdbc2 ; 0xdbc2 } dd16: ff 90 pop r15 dd18: ef 90 pop r14 dd1a: df 90 pop r13 dd1c: cf 90 pop r12 dd1e: bf 90 pop r11 dd20: af 90 pop r10 dd22: 9f 90 pop r9 dd24: 8f 90 pop r8 dd26: 08 95 ret 0000dd28 : static void lcd_invalidate_custom_characters() { memset(lcd_custom_characters, 0x7F, sizeof(lcd_custom_characters)); } void lcd_frame_start() { dd28: ee e5 ldi r30, 0x5E ; 94 dd2a: 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; dd2c: 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]; dd2e: 81 91 ld r24, Z+ if (c == 0x7F) { //slot empty dd30: 8f 37 cpi r24, 0x7F ; 127 dd32: 31 f0 breq .+12 ; 0xdd40 dd34: df 01 movw r26, r30 dd36: 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 dd38: 87 ff sbrs r24, 7 dd3a: 07 c0 rjmp .+14 ; 0xdd4a lcd_custom_characters[i] = c & 0x7F; dd3c: 8f 77 andi r24, 0x7F ; 127 dd3e: 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++) { dd40: 83 e0 ldi r24, 0x03 ; 3 dd42: e6 36 cpi r30, 0x66 ; 102 dd44: f8 07 cpc r31, r24 dd46: 99 f7 brne .-26 ; 0xdd2e for (uint8_t i = 0; i < 8; i++) { printf_P(PSTR(" %02x"), lcd_custom_characters[i]); } printf_P(PSTR("\n")); #endif // DEBUG_CUSTOM_CHARACTERS } dd48: 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; dd4a: 9c 93 st X, r25 dd4c: f9 cf rjmp .-14 ; 0xdd40 0000dd4e : } } void lcd_update(uint8_t lcdDrawUpdateOverride) { if (lcd_draw_update < lcdDrawUpdateOverride) dd4e: 90 91 6d 02 lds r25, 0x026D ; 0x80026d dd52: 98 17 cp r25, r24 dd54: 10 f4 brcc .+4 ; 0xdd5a lcd_draw_update = lcdDrawUpdateOverride; dd56: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d if (!lcd_update_enabled) return; dd5a: 80 91 6e 02 lds r24, 0x026E ; 0x80026e dd5e: 88 23 and r24, r24 dd60: 39 f0 breq .+14 ; 0xdd70 if (lcd_lcdupdate_func) dd62: e0 91 15 04 lds r30, 0x0415 ; 0x800415 dd66: f0 91 16 04 lds r31, 0x0416 ; 0x800416 dd6a: 30 97 sbiw r30, 0x00 ; 0 dd6c: 09 f0 breq .+2 ; 0xdd70 lcd_lcdupdate_func(); dd6e: 19 94 eijmp } dd70: 08 95 ret 0000dd72 : lcd_set_cursor(c, r); return fputs_P(str, lcdout); } int lcd_printf_P(const char* format, ...) { dd72: cf 93 push r28 dd74: df 93 push r29 dd76: cd b7 in r28, 0x3d ; 61 dd78: de b7 in r29, 0x3e ; 62 dd7a: ae 01 movw r20, r28 dd7c: 4a 5f subi r20, 0xFA ; 250 dd7e: 5f 4f sbci r21, 0xFF ; 255 dd80: fa 01 movw r30, r20 dd82: 61 91 ld r22, Z+ dd84: 71 91 ld r23, Z+ dd86: af 01 movw r20, r30 va_list args; va_start(args, format); int ret = vfprintf_P(lcdout, format, args); dd88: 83 e0 ldi r24, 0x03 ; 3 dd8a: 94 e0 ldi r25, 0x04 ; 4 dd8c: 0f 94 63 db call 0x3b6c6 ; 0x3b6c6 va_end(args); return ret; } dd90: df 91 pop r29 dd92: cf 91 pop r28 dd94: 08 95 ret 0000dd96 : return fputc(ch, lcdout); } int lcd_puts_P(const char* str) { return fputs_P(str, lcdout); dd96: 63 e0 ldi r22, 0x03 ; 3 dd98: 74 e0 ldi r23, 0x04 ; 4 dd9a: 0d 94 b4 da jmp 0x3b568 ; 0x3b568 0000dd9e : lcd_command(LCD_SETDDRAMADDR | lcd_ddram_address); // no need for masking the address } int lcd_putc(char c) { return fputc(c, lcdout); dd9e: 63 e0 ldi r22, 0x03 ; 3 dda0: 74 e0 ldi r23, 0x04 ; 4 dda2: 08 2e mov r0, r24 dda4: 00 0c add r0, r0 dda6: 99 0b sbc r25, r25 dda8: 0d 94 84 da jmp 0x3b508 ; 0x3b508 0000ddac : va_end(args); return ret; } void lcd_space(uint8_t n) { ddac: cf 93 push r28 ddae: c8 2f mov r28, r24 while (n--) lcd_putc(' '); ddb0: c1 50 subi r28, 0x01 ; 1 ddb2: 20 f0 brcs .+8 ; 0xddbc ddb4: 80 e2 ldi r24, 0x20 ; 32 ddb6: 0e 94 cf 6e call 0xdd9e ; 0xdd9e ddba: fa cf rjmp .-12 ; 0xddb0 } ddbc: cf 91 pop r28 ddbe: 08 95 ret 0000ddc0 : { return pgm_read_byte(row_offsets + min(row, LCD_HEIGHT - 1)); } void lcd_set_cursor(uint8_t col, uint8_t row) { ddc0: cf 93 push r28 ddc2: c8 2f mov r28, r24 ddc4: 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); ddc6: 64 30 cpi r22, 0x04 ; 4 ddc8: 08 f0 brcs .+2 ; 0xddcc ddca: 83 e0 ldi r24, 0x03 ; 3 ddcc: 80 93 5d 03 sts 0x035D, r24 ; 0x80035d } 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); ddd0: 0e 94 09 5b call 0xb612 ; 0xb612 ddd4: 8c 0f add r24, r28 lcd_ddram_address = addr; ddd6: 80 93 5c 03 sts 0x035C, r24 ; 0x80035c delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); ddda: 44 e6 ldi r20, 0x64 ; 100 dddc: 50 e0 ldi r21, 0x00 ; 0 ddde: 60 e0 ldi r22, 0x00 ; 0 dde0: 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); } dde2: cf 91 pop r28 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); dde4: 0c 94 07 64 jmp 0xc80e ; 0xc80e 0000dde8 : { return fputs_P(str, lcdout); } int lcd_puts_at_P(uint8_t c, uint8_t r, const char* str) { dde8: cf 93 push r28 ddea: df 93 push r29 ddec: ea 01 movw r28, r20 lcd_set_cursor(c, r); ddee: 0e 94 e0 6e call 0xddc0 ; 0xddc0 return fputs_P(str, lcdout); ddf2: 63 e0 ldi r22, 0x03 ; 3 ddf4: 74 e0 ldi r23, 0x04 ; 4 ddf6: ce 01 movw r24, r28 } ddf8: df 91 pop r29 ddfa: 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); ddfc: 0d 94 b4 da jmp 0x3b568 ; 0x3b568 0000de00 : { return fputc(c, lcdout); } int lcd_putc_at(uint8_t c, uint8_t r, char ch) { de00: cf 93 push r28 de02: c4 2f mov r28, r20 lcd_set_cursor(c, r); de04: 0e 94 e0 6e call 0xddc0 ; 0xddc0 return fputc(ch, lcdout); de08: 63 e0 ldi r22, 0x03 ; 3 de0a: 74 e0 ldi r23, 0x04 ; 4 de0c: 8c 2f mov r24, r28 de0e: cc 0f add r28, r28 de10: 99 0b sbc r25, r25 } de12: 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); de14: 0d 94 84 da jmp 0x3b508 ; 0x3b508 0000de18 : } // Set cursor position to zero and in DDRAM. It does not unshift the display. void lcd_home(void) { lcd_set_cursor(0, 0); de18: 60 e0 ldi r22, 0x00 ; 0 de1a: 80 e0 ldi r24, 0x00 ; 0 de1c: 0e 94 e0 6e call 0xddc0 ; 0xddc0 lcd_ddram_address = 0; de20: 10 92 5c 03 sts 0x035C, r1 ; 0x80035c } de24: 08 95 ret 0000de26 : delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); de26: 40 e4 ldi r20, 0x40 ; 64 de28: 56 e0 ldi r21, 0x06 ; 6 de2a: 60 e0 ldi r22, 0x00 ; 0 de2c: 81 e0 ldi r24, 0x01 ; 1 de2e: 0e 94 07 64 call 0xc80e ; 0xc80e // 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; de32: 10 92 5d 03 sts 0x035D, r1 ; 0x80035d lcd_ddram_address = 0; de36: 10 92 5c 03 sts 0x035C, r1 ; 0x80035c 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)); de3a: 48 e0 ldi r20, 0x08 ; 8 de3c: 50 e0 ldi r21, 0x00 ; 0 de3e: 6f e7 ldi r22, 0x7F ; 127 de40: 70 e0 ldi r23, 0x00 ; 0 de42: 8e e5 ldi r24, 0x5E ; 94 de44: 93 e0 ldi r25, 0x03 ; 3 de46: 0d 94 4e e2 jmp 0x3c49c ; 0x3c49c 0000de4a : } 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) de4a: 90 91 6e 02 lds r25, 0x026E ; 0x80026e de4e: 98 17 cp r25, r24 de50: 09 f1 breq .+66 ; 0xde94 { lcd_update_enabled = enabled; de52: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e if (enabled) de56: 88 23 and r24, r24 de58: e9 f0 breq .+58 ; 0xde94 { // Reset encoder position. This is equivalent to re-entering a menu. lcd_encoder = 0; de5a: 10 92 71 06 sts 0x0671, r1 ; 0x800671 de5e: 10 92 70 06 sts 0x0670, r1 ; 0x800670 lcd_encoder_diff = 0; de62: 10 92 d1 05 sts 0x05D1, r1 ; 0x8005d1 <_ZL16lcd_encoder_diff.lto_priv.539> // Enabling the normal LCD update procedure. // Reset the timeout interval. lcd_timeoutToStatus.start(); de66: 8c ed ldi r24, 0xDC ; 220 de68: 93 e0 ldi r25, 0x03 ; 3 de6a: 0f 94 ef 2b call 0x257de ; 0x257de ::start()> // Force the keypad update now. lcd_next_update_millis = _millis() - 1; de6e: 0f 94 4c 29 call 0x25298 ; 0x25298 de72: 61 50 subi r22, 0x01 ; 1 de74: 71 09 sbc r23, r1 de76: 81 09 sbc r24, r1 de78: 91 09 sbc r25, r1 de7a: 60 93 d8 03 sts 0x03D8, r22 ; 0x8003d8 de7e: 70 93 d9 03 sts 0x03D9, r23 ; 0x8003d9 de82: 80 93 da 03 sts 0x03DA, r24 ; 0x8003da de86: 90 93 db 03 sts 0x03DB, r25 ; 0x8003db // Full update. lcd_clear(); de8a: 0e 94 13 6f call 0xde26 ; 0xde26 lcd_update(2); de8e: 82 e0 ldi r24, 0x02 ; 2 de90: 0c 94 a7 6e jmp 0xdd4e ; 0xdd4e } else { // Clear the LCD always, or let it to the caller? } } } de94: 08 95 ret 0000de96 : lcd_ddram_address++; // no need for preventing ddram overflow } } static void lcd_begin(uint8_t clear) { de96: cf 93 push r28 de98: c8 2f mov r28, r24 lcd_currline = 0; de9a: 10 92 5d 03 sts 0x035D, r1 ; 0x80035d lcd_ddram_address = 0; de9e: 10 92 5c 03 sts 0x035C, r1 ; 0x80035c 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)); dea2: 48 e0 ldi r20, 0x08 ; 8 dea4: 50 e0 ldi r21, 0x00 ; 0 dea6: 6f e7 ldi r22, 0x7F ; 127 dea8: 70 e0 ldi r23, 0x00 ; 0 deaa: 8e e5 ldi r24, 0x5E ; 94 deac: 93 e0 ldi r25, 0x03 ; 3 deae: 0f 94 4e e2 call 0x3c49c ; 0x3c49c 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 deb2: 44 e9 ldi r20, 0x94 ; 148 deb4: 51 e1 ldi r21, 0x11 ; 17 deb6: 62 e0 ldi r22, 0x02 ; 2 deb8: 80 e3 ldi r24, 0x30 ; 48 deba: 0e 94 07 64 call 0xc80e ; 0xc80e // second try lcd_send(LCD_FUNCTIONSET | LCD_8BITMODE, LOW | LCD_HALF_FLAG, 150); debe: 46 e9 ldi r20, 0x96 ; 150 dec0: 50 e0 ldi r21, 0x00 ; 0 dec2: 62 e0 ldi r22, 0x02 ; 2 dec4: 80 e3 ldi r24, 0x30 ; 48 dec6: 0e 94 07 64 call 0xc80e ; 0xc80e // third go! lcd_send(LCD_FUNCTIONSET | LCD_8BITMODE, LOW | LCD_HALF_FLAG, 150); deca: 46 e9 ldi r20, 0x96 ; 150 decc: 50 e0 ldi r21, 0x00 ; 0 dece: 62 e0 ldi r22, 0x02 ; 2 ded0: 80 e3 ldi r24, 0x30 ; 48 ded2: 0e 94 07 64 call 0xc80e ; 0xc80e #ifndef LCD_8BIT // set to 4-bit interface lcd_send(LCD_FUNCTIONSET | LCD_4BITMODE, LOW | LCD_HALF_FLAG, 150); ded6: 46 e9 ldi r20, 0x96 ; 150 ded8: 50 e0 ldi r21, 0x00 ; 0 deda: 62 e0 ldi r22, 0x02 ; 2 dedc: 80 e2 ldi r24, 0x20 ; 32 dede: 0e 94 07 64 call 0xc80e ; 0xc80e #endif // finally, set # lines, font size, etc.0 lcd_command(LCD_FUNCTIONSET | lcd_displayfunction); dee2: 80 91 11 04 lds r24, 0x0411 ; 0x800411 <_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); dee6: 44 e6 ldi r20, 0x64 ; 100 dee8: 50 e0 ldi r21, 0x00 ; 0 deea: 60 e0 ldi r22, 0x00 ; 0 deec: 80 62 ori r24, 0x20 ; 32 deee: 0e 94 07 64 call 0xc80e ; 0xc80e } // Turn the display on/off (quickly) void lcd_display(void) { lcd_displaycontrol |= LCD_DISPLAYON; def2: 84 e0 ldi r24, 0x04 ; 4 def4: 80 93 5b 03 sts 0x035B, r24 ; 0x80035b delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); def8: 44 e6 ldi r20, 0x64 ; 100 defa: 50 e0 ldi r21, 0x00 ; 0 defc: 60 e0 ldi r22, 0x00 ; 0 defe: 8c e0 ldi r24, 0x0C ; 12 df00: 0e 94 07 64 call 0xc80e ; 0xc80e 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(); df04: c1 11 cpse r28, r1 df06: 0e 94 13 6f call 0xde26 ; 0xde26 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); df0a: 44 e6 ldi r20, 0x64 ; 100 df0c: 50 e0 ldi r21, 0x00 ; 0 df0e: 60 e0 ldi r22, 0x00 ; 0 df10: 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); } df12: cf 91 pop r28 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); df14: 0c 94 07 64 jmp 0xc80e ; 0xc80e 0000df18 : fdev_setup_stream(lcdout, lcd_putchar, NULL, _FDEV_SETUP_WRITE); //setup lcdout stream } void lcd_refresh(void) { lcd_begin(1); df18: 81 e0 ldi r24, 0x01 ; 1 df1a: 0c 94 4b 6f jmp 0xde96 ; 0xde96 0000df1e : { lcd_send(value, LOW, duration); } static void lcd_write(uint8_t value) { df1e: cf 92 push r12 df20: df 92 push r13 df22: ff 92 push r15 df24: 0f 93 push r16 df26: 1f 93 push r17 df28: cf 93 push r28 df2a: df 93 push r29 df2c: 00 d0 rcall .+0 ; 0xdf2e df2e: 00 d0 rcall .+0 ; 0xdf30 df30: 1f 92 push r1 df32: 1f 92 push r1 df34: cd b7 in r28, 0x3d ; 61 df36: de b7 in r29, 0x3e ; 62 if (value == '\n') { df38: 8a 30 cpi r24, 0x0A ; 10 df3a: d9 f4 brne .+54 ; 0xdf72 if (lcd_currline > 3) lcd_currline = -1; df3c: 80 91 5d 03 lds r24, 0x035D ; 0x80035d df40: 84 30 cpi r24, 0x04 ; 4 df42: 18 f0 brcs .+6 ; 0xdf4a df44: 8f ef ldi r24, 0xFF ; 255 df46: 80 93 5d 03 sts 0x035D, r24 ; 0x80035d lcd_set_cursor(0, lcd_currline + 1); // LF df4a: 60 91 5d 03 lds r22, 0x035D ; 0x80035d df4e: 6f 5f subi r22, 0xFF ; 255 df50: 80 e0 ldi r24, 0x00 ; 0 df52: 0e 94 e0 6e call 0xddc0 ; 0xddc0 lcd_print_custom(value); } else { lcd_send(value, HIGH); lcd_ddram_address++; // no need for preventing ddram overflow } } df56: 28 96 adiw r28, 0x08 ; 8 df58: 0f b6 in r0, 0x3f ; 63 df5a: f8 94 cli df5c: de bf out 0x3e, r29 ; 62 df5e: 0f be out 0x3f, r0 ; 63 df60: cd bf out 0x3d, r28 ; 61 df62: df 91 pop r29 df64: cf 91 pop r28 df66: 1f 91 pop r17 df68: 0f 91 pop r16 df6a: ff 90 pop r15 df6c: df 90 pop r13 df6e: cf 90 pop r12 df70: 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))) { df72: 90 e8 ldi r25, 0x80 ; 128 df74: 98 0f add r25, r24 lcd_print_custom(value); } else { lcd_send(value, HIGH); df76: 44 e6 ldi r20, 0x64 ; 100 df78: 50 e0 ldi r21, 0x00 ; 0 df7a: 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))) { df7c: 9a 34 cpi r25, 0x4A ; 74 df7e: 08 f5 brcc .+66 ; 0xdfc2 // 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. df80: 48 2f mov r20, r24 df82: 40 58 subi r20, 0x80 ; 128 df84: 55 0b sbc r21, r21 df86: 9a 01 movw r18, r20 df88: 96 e0 ldi r25, 0x06 ; 6 df8a: 92 9f mul r25, r18 df8c: a0 01 movw r20, r0 df8e: 93 9f mul r25, r19 df90: 50 0d add r21, r0 df92: 11 24 eor r1, r1 df94: fa 01 movw r30, r20 df96: e9 54 subi r30, 0x49 ; 73 df98: f6 48 sbci r31, 0x86 ; 134 df9a: f4 90 lpm r15, Z df9c: ee e5 ldi r30, 0x5E ; 94 df9e: f3 e0 ldi r31, 0x03 ; 3 dfa0: 30 e0 ldi r19, 0x00 ; 0 dfa2: 20 e0 ldi r18, 0x00 ; 0 int8_t slotToUse = -1; dfa4: 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)) { dfa6: 61 91 ld r22, Z+ dfa8: 78 2f mov r23, r24 dfaa: 76 27 eor r23, r22 dfac: 7f 77 andi r23, 0x7F ; 127 dfae: 89 f4 brne .+34 ; 0xdfd2 lcd_custom_characters[i] = c; // mark the custom character as used dfb0: f9 01 movw r30, r18 dfb2: e2 5a subi r30, 0xA2 ; 162 dfb4: fc 4f sbci r31, 0xFC ; 252 dfb6: 80 83 st Z, r24 dfb8: 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); dfba: 44 e6 ldi r20, 0x64 ; 100 dfbc: 50 e0 ldi r21, 0x00 ; 0 dfbe: 61 e0 ldi r22, 0x01 ; 1 dfc0: 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); dfc2: 0e 94 07 64 call 0xc80e ; 0xc80e lcd_ddram_address++; // no need for preventing ddram overflow dfc6: 80 91 5c 03 lds r24, 0x035C ; 0x80035c dfca: 8f 5f subi r24, 0xFF ; 255 dfcc: 80 93 5c 03 sts 0x035C, r24 ; 0x80035c dfd0: c2 cf rjmp .-124 ; 0xdf56 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 dfd2: 6f 37 cpi r22, 0x7F ; 127 dfd4: 09 f0 breq .+2 ; 0xdfd8 dfd6: 3c c0 rjmp .+120 ; 0xe050 lcd_custom_characters[i] = c; // mark the custom character as used dfd8: f9 01 movw r30, r18 dfda: e2 5a subi r30, 0xA2 ; 162 dfdc: fc 4f sbci r31, 0xFC ; 252 dfde: 80 83 st Z, r24 slotToUse = i; dfe0: 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; dfe2: f9 2e mov r15, r25 lcd_createChar_P(slotToUse, &Font[c - 0x80]); dfe4: fa 01 movw r30, r20 dfe6: ee 54 subi r30, 0x4E ; 78 dfe8: f6 48 sbci r31, 0x86 ; 134 "dec __zero_reg__" "\n\t" "brne forBegin_%=" "\n\t" : "=&d" (temp), "=&r" (colByte) : "z" (char_p), "e" (charmap) ); dfea: 8e 01 movw r16, r28 dfec: 0f 5f subi r16, 0xFF ; 255 dfee: 1f 4f sbci r17, 0xFF ; 255 dff0: d8 01 movw r26, r16 dff2: 95 91 lpm r25, Z+ dff4: 88 e0 ldi r24, 0x08 ; 8 dff6: 18 2e mov r1, r24 0000dff8 : dff8: 10 fe sbrs r1, 0 dffa: 05 90 lpm r0, Z+ dffc: 02 94 swap r0 dffe: 80 2d mov r24, r0 e000: 97 95 ror r25 e002: 88 1f adc r24, r24 e004: 8d 93 st X+, r24 e006: 1a 94 dec r1 e008: b9 f7 brne .-18 ; 0xdff8 lcd_command(LCD_SETCGRAMADDR | (location << 3)); e00a: bf 2d mov r27, r15 e00c: e8 e0 ldi r30, 0x08 ; 8 e00e: be 02 muls r27, r30 e010: c0 01 movw r24, r0 e012: 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); e014: 44 e6 ldi r20, 0x64 ; 100 e016: 50 e0 ldi r21, 0x00 ; 0 e018: 60 e0 ldi r22, 0x00 ; 0 e01a: 80 64 ori r24, 0x40 ; 64 e01c: 0e 94 07 64 call 0xc80e ; 0xc80e e020: 6e 01 movw r12, r28 e022: f9 e0 ldi r31, 0x09 ; 9 e024: cf 0e add r12, r31 e026: 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); e028: 44 e6 ldi r20, 0x64 ; 100 e02a: 50 e0 ldi r21, 0x00 ; 0 e02c: 61 e0 ldi r22, 0x01 ; 1 e02e: d8 01 movw r26, r16 e030: 8d 91 ld r24, X+ e032: 8d 01 movw r16, r26 e034: 0e 94 07 64 call 0xc80e ; 0xc80e : "=&d" (temp), "=&r" (colByte) : "z" (char_p), "e" (charmap) ); lcd_command(LCD_SETCGRAMADDR | (location << 3)); for (uint8_t i = 0; i < 8; i++) { e038: c0 16 cp r12, r16 e03a: d1 06 cpc r13, r17 e03c: a9 f7 brne .-22 ; 0xe028 lcd_send(charmap[i], HIGH); } lcd_command(LCD_SETDDRAMADDR | lcd_ddram_address); // no need for masking the address e03e: 80 91 5c 03 lds r24, 0x035C ; 0x80035c delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); e042: 44 e6 ldi r20, 0x64 ; 100 e044: 50 e0 ldi r21, 0x00 ; 0 e046: 60 e0 ldi r22, 0x00 ; 0 e048: 80 68 ori r24, 0x80 ; 128 e04a: 0e 94 07 64 call 0xc80e ; 0xc80e e04e: b5 cf rjmp .-150 ; 0xdfba 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 e050: 67 ff sbrs r22, 7 slotToUse = i; e052: 92 2f mov r25, r18 e054: 2f 5f subi r18, 0xFF ; 255 e056: 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++) { e058: 28 30 cpi r18, 0x08 ; 8 e05a: 31 05 cpc r19, r1 e05c: 09 f0 breq .+2 ; 0xe060 e05e: a3 cf rjmp .-186 ; 0xdfa6 } // 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) { e060: 9f 3f cpi r25, 0xFF ; 255 e062: 09 f0 breq .+2 ; 0xe066 e064: be cf rjmp .-132 ; 0xdfe2 e066: a9 cf rjmp .-174 ; 0xdfba 0000e068 : else lcd_printNumber(n, base); } void lcd_printNumber(unsigned long n, uint8_t base) { e068: 8f 92 push r8 e06a: 9f 92 push r9 e06c: af 92 push r10 e06e: bf 92 push r11 e070: ef 92 push r14 e072: ff 92 push r15 e074: 0f 93 push r16 e076: 1f 93 push r17 e078: cf 93 push r28 e07a: df 93 push r29 e07c: cd b7 in r28, 0x3d ; 61 e07e: de b7 in r29, 0x3e ; 62 e080: a0 97 sbiw r28, 0x20 ; 32 e082: 0f b6 in r0, 0x3f ; 63 e084: f8 94 cli e086: de bf out 0x3e, r29 ; 62 e088: 0f be out 0x3f, r0 ; 63 e08a: cd bf out 0x3d, r28 ; 61 unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; if (n == 0) e08c: 61 15 cp r22, r1 e08e: 71 05 cpc r23, r1 e090: 81 05 cpc r24, r1 e092: 91 05 cpc r25, r1 e094: 99 f4 brne .+38 ; 0xe0bc } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e096: 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)); } e098: a0 96 adiw r28, 0x20 ; 32 e09a: 0f b6 in r0, 0x3f ; 63 e09c: f8 94 cli e09e: de bf out 0x3e, r29 ; 62 e0a0: 0f be out 0x3f, r0 ; 63 e0a2: cd bf out 0x3d, r28 ; 61 e0a4: df 91 pop r29 e0a6: cf 91 pop r28 e0a8: 1f 91 pop r17 e0aa: 0f 91 pop r16 e0ac: ff 90 pop r15 e0ae: ef 90 pop r14 e0b0: bf 90 pop r11 e0b2: af 90 pop r10 e0b4: 9f 90 pop r9 e0b6: 8f 90 pop r8 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e0b8: 0c 94 8f 6f jmp 0xdf1e ; 0xdf1e } void lcd_printNumber(unsigned long n, uint8_t base) { unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; e0bc: 00 e0 ldi r16, 0x00 ; 0 lcd_print('0'); return; } while (n > 0) { buf[i++] = n % base; e0be: 84 2e mov r8, r20 e0c0: 91 2c mov r9, r1 e0c2: b1 2c mov r11, r1 e0c4: a1 2c mov r10, r1 e0c6: 9e 01 movw r18, r28 e0c8: 2f 5f subi r18, 0xFF ; 255 e0ca: 3f 4f sbci r19, 0xFF ; 255 e0cc: 79 01 movw r14, r18 e0ce: a5 01 movw r20, r10 e0d0: 94 01 movw r18, r8 e0d2: 0f 94 8f dc call 0x3b91e ; 0x3b91e <__udivmodsi4> e0d6: f7 01 movw r30, r14 e0d8: e0 0f add r30, r16 e0da: f1 1d adc r31, r1 e0dc: 60 83 st Z, r22 n /= base; e0de: b9 01 movw r22, r18 e0e0: ca 01 movw r24, r20 lcd_print('0'); return; } while (n > 0) { buf[i++] = n % base; e0e2: 0f 5f subi r16, 0xFF ; 255 if (n == 0) { lcd_print('0'); return; } while (n > 0) e0e4: 61 15 cp r22, r1 e0e6: 71 05 cpc r23, r1 e0e8: 81 05 cpc r24, r1 e0ea: 91 05 cpc r25, r1 e0ec: 81 f7 brne .-32 ; 0xe0ce e0ee: 0e 0d add r16, r14 e0f0: 1f 2d mov r17, r15 e0f2: 11 1d adc r17, r1 { buf[i++] = n % base; n /= base; } for (; i > 0; i--) e0f4: e0 16 cp r14, r16 e0f6: f1 06 cpc r15, r17 e0f8: 59 f0 breq .+22 ; 0xe110 lcd_print((char) (buf[i - 1] < 10 ? '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); e0fa: f8 01 movw r30, r16 e0fc: 82 91 ld r24, -Z e0fe: 8f 01 movw r16, r30 e100: 8a 30 cpi r24, 0x0A ; 10 e102: 20 f4 brcc .+8 ; 0xe10c e104: 80 5d subi r24, 0xD0 ; 208 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e106: 0e 94 8f 6f call 0xdf1e ; 0xdf1e e10a: f4 cf rjmp .-24 ; 0xe0f4 { 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)); e10c: 89 5c subi r24, 0xC9 ; 201 e10e: fb cf rjmp .-10 ; 0xe106 } e110: a0 96 adiw r28, 0x20 ; 32 e112: 0f b6 in r0, 0x3f ; 63 e114: f8 94 cli e116: de bf out 0x3e, r29 ; 62 e118: 0f be out 0x3f, r0 ; 63 e11a: cd bf out 0x3d, r28 ; 61 e11c: df 91 pop r29 e11e: cf 91 pop r28 e120: 1f 91 pop r17 e122: 0f 91 pop r16 e124: ff 90 pop r15 e126: ef 90 pop r14 e128: bf 90 pop r11 e12a: af 90 pop r10 e12c: 9f 90 pop r9 e12e: 8f 90 pop r8 e130: 08 95 ret 0000e132 : void lcd_print(unsigned int n, int base) { lcd_print((unsigned long) n, base); } void lcd_print(long n, int base) e132: cf 92 push r12 e134: df 92 push r13 e136: ef 92 push r14 e138: ff 92 push r15 e13a: 6b 01 movw r12, r22 e13c: 7c 01 movw r14, r24 { if (base == 0) lcd_write(n); else if (base == 10) { if (n < 0) e13e: f7 fe sbrs r15, 7 e140: 0b c0 rjmp .+22 ; 0xe158 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e142: 8d e2 ldi r24, 0x2D ; 45 e144: 0e 94 8f 6f call 0xdf1e ; 0xdf1e else if (base == 10) { if (n < 0) { lcd_print('-'); n = -n; e148: f0 94 com r15 e14a: e0 94 com r14 e14c: d0 94 com r13 e14e: c0 94 com r12 e150: c1 1c adc r12, r1 e152: d1 1c adc r13, r1 e154: e1 1c adc r14, r1 e156: f1 1c adc r15, r1 } lcd_printNumber(n, 10); e158: 4a e0 ldi r20, 0x0A ; 10 e15a: c7 01 movw r24, r14 e15c: b6 01 movw r22, r12 } else lcd_printNumber(n, base); } e15e: ff 90 pop r15 e160: ef 90 pop r14 e162: df 90 pop r13 e164: cf 90 pop r12 if (n < 0) { lcd_print('-'); n = -n; } lcd_printNumber(n, 10); e166: 0c 94 34 70 jmp 0xe068 ; 0xe068 0000e16a : lcd_space(len); return len; } uint8_t lcd_print_pad_P(const char* s, uint8_t len) { e16a: 0f 93 push r16 e16c: 1f 93 push r17 e16e: cf 93 push r28 e170: 8c 01 movw r16, r24 e172: c6 2f mov r28, r22 while (len && pgm_read_byte(s)) { e174: cc 23 and r28, r28 e176: 59 f0 breq .+22 ; 0xe18e e178: f8 01 movw r30, r16 e17a: 24 91 lpm r18, Z e17c: 22 23 and r18, r18 e17e: 39 f0 breq .+14 ; 0xe18e lcd_write(pgm_read_byte(s++)); e180: 0f 5f subi r16, 0xFF ; 255 e182: 1f 4f sbci r17, 0xFF ; 255 e184: 84 91 lpm r24, Z e186: 0e 94 8f 6f call 0xdf1e ; 0xdf1e --len; e18a: c1 50 subi r28, 0x01 ; 1 e18c: f3 cf rjmp .-26 ; 0xe174 } lcd_space(len); e18e: 8c 2f mov r24, r28 e190: 0e 94 d6 6e call 0xddac ; 0xddac return len; } e194: 8c 2f mov r24, r28 e196: cf 91 pop r28 e198: 1f 91 pop r17 e19a: 0f 91 pop r16 e19c: 08 95 ret 0000e19e : { while (*s) lcd_write(*(s++)); } uint8_t lcd_print_pad(const char* s, uint8_t len) { e19e: 0f 93 push r16 e1a0: 1f 93 push r17 e1a2: cf 93 push r28 e1a4: 8c 01 movw r16, r24 e1a6: c6 2f mov r28, r22 while (len && *s) { e1a8: cc 23 and r28, r28 e1aa: 49 f0 breq .+18 ; 0xe1be e1ac: f8 01 movw r30, r16 e1ae: 81 91 ld r24, Z+ e1b0: 8f 01 movw r16, r30 e1b2: 88 23 and r24, r24 e1b4: 21 f0 breq .+8 ; 0xe1be lcd_write(*(s++)); e1b6: 0e 94 8f 6f call 0xdf1e ; 0xdf1e --len; e1ba: c1 50 subi r28, 0x01 ; 1 e1bc: f5 cf rjmp .-22 ; 0xe1a8 } lcd_space(len); e1be: 8c 2f mov r24, r28 e1c0: 0e 94 d6 6e call 0xddac ; 0xddac 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 (n--) lcd_putc(' '); } void lcd_print(const char* s) { e1ce: cf 93 push r28 e1d0: df 93 push r29 e1d2: ec 01 movw r28, r24 while (*s) lcd_write(*(s++)); e1d4: 89 91 ld r24, Y+ e1d6: 88 23 and r24, r24 e1d8: 19 f0 breq .+6 ; 0xe1e0 e1da: 0e 94 8f 6f call 0xdf1e ; 0xdf1e e1de: fa cf rjmp .-12 ; 0xe1d4 } e1e0: df 91 pop r29 e1e2: cf 91 pop r28 e1e4: 08 95 ret 0000e1e6 : lcd_command(LCD_ENTRYMODESET | lcd_displaymode); } static int lcd_putchar(char c, FILE *) { lcd_write(c); e1e6: 0e 94 8f 6f call 0xdf1e ; 0xdf1e return 0; } e1ea: 90 e0 ldi r25, 0x00 ; 0 e1ec: 80 e0 ldi r24, 0x00 ; 0 e1ee: 08 95 ret 0000e1f0 : extern void lcd_frame_start(); //! @brief Consume click and longpress event inline void lcd_consume_click() { lcd_click_trigger = 0; e1f0: 10 92 a8 03 sts 0x03A8, r1 ; 0x8003a8 lcd_longpress_trigger = 0; e1f4: 10 92 d4 05 sts 0x05D4, r1 ; 0x8005d4 } e1f8: 08 95 ret 0000e1fa : //! Generally is used in modal dialogs. //! //! @retval 0 not clicked //! @retval nonzero clicked uint8_t lcd_clicked(void) { e1fa: cf 93 push r28 bool clicked = LCD_CLICKED; e1fc: 80 91 a8 03 lds r24, 0x03A8 ; 0x8003a8 e200: c1 e0 ldi r28, 0x01 ; 1 e202: 81 11 cpse r24, r1 e204: 04 c0 rjmp .+8 ; 0xe20e e206: c0 e0 ldi r28, 0x00 ; 0 if(clicked) { lcd_consume_click(); } return clicked; } e208: 8c 2f mov r24, r28 e20a: cf 91 pop r28 e20c: 08 95 ret uint8_t lcd_clicked(void) { bool clicked = LCD_CLICKED; if(clicked) { lcd_consume_click(); e20e: 0e 94 f8 70 call 0xe1f0 ; 0xe1f0 e212: fa cf rjmp .-12 ; 0xe208 0000e214 : 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 e214: e0 e0 ldi r30, 0x00 ; 0 e216: f1 e0 ldi r31, 0x01 ; 1 e218: 85 91 lpm r24, Z+ e21a: 95 91 lpm r25, Z+ e21c: a5 91 lpm r26, Z+ e21e: b4 91 lpm r27, Z e220: 85 3a cpi r24, 0xA5 ; 165 e222: 9a 45 sbci r25, 0x5A ; 90 e224: a4 4b sbci r26, 0xB4 ; 180 e226: bb 44 sbci r27, 0x4B ; 75 e228: 29 f4 brne .+10 ; 0xe234 return pgm_read_word(((uint32_t*)(ui + 10))); //return lang code from progmem e22a: ea e0 ldi r30, 0x0A ; 10 e22c: f1 e0 ldi r31, 0x01 ; 1 e22e: 85 91 lpm r24, Z+ e230: 94 91 lpm r25, Z e232: 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 e234: 8f e3 ldi r24, 0x3F ; 63 e236: 9f e3 ldi r25, 0x3F ; 63 table += pgm_read_word((uint16_t*)(table + 4)); count++; } #endif //XFLASH return LANG_CODE_XX; } e238: 08 95 ret 0000e23a : 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); e23a: 8e ef ldi r24, 0xFE ; 254 e23c: 9f e0 ldi r25, 0x0F ; 15 e23e: 0f 94 1c dc call 0x3b838 ; 0x3b838 return (lang_eeprom != LANG_ID_FORCE_SELECTION) && (lang_eeprom == lang_selected); e242: 8e 3f cpi r24, 0xFE ; 254 e244: 39 f0 breq .+14 ; 0xe254 e246: 91 e0 ldi r25, 0x01 ; 1 e248: 20 91 5a 03 lds r18, 0x035A ; 0x80035a e24c: 28 13 cpse r18, r24 e24e: 90 e0 ldi r25, 0x00 ; 0 e250: 89 2f mov r24, r25 e252: 08 95 ret e254: 80 e0 ldi r24, 0x00 ; 0 } e256: 08 95 ret 0000e258 : return _n("??"); } void lang_reset(void) { lang_selected = 0; e258: 10 92 5a 03 sts 0x035A, r1 ; 0x80035a eeprom_update_byte((unsigned char*)EEPROM_LANG, LANG_ID_FORCE_SELECTION); e25c: 6e ef ldi r22, 0xFE ; 254 e25e: 8e ef ldi r24, 0xFE ; 254 e260: 9f e0 ldi r25, 0x0F ; 15 e262: 0d 94 40 dc jmp 0x3b880 ; 0x3b880 0000e266 : return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e266: 85 37 cpi r24, 0x75 ; 117 e268: 28 e6 ldi r18, 0x68 ; 104 e26a: 92 07 cpc r25, r18 e26c: 09 f4 brne .+2 ; 0xe270 e26e: 59 c0 rjmp .+178 ; 0xe322 e270: f8 f4 brcc .+62 ; 0xe2b0 e272: 8e 36 cpi r24, 0x6E ; 110 e274: 25 e6 ldi r18, 0x65 ; 101 e276: 92 07 cpc r25, r18 e278: 09 f4 brne .+2 ; 0xe27c e27a: 59 c0 rjmp .+178 ; 0xe32e e27c: 50 f4 brcc .+20 ; 0xe292 e27e: 83 37 cpi r24, 0x73 ; 115 e280: 23 e6 ldi r18, 0x63 ; 99 e282: 92 07 cpc r25, r18 e284: b1 f1 breq .+108 ; 0xe2f2 e286: 85 36 cpi r24, 0x65 ; 101 e288: 94 46 sbci r25, 0x64 ; 100 e28a: b1 f1 breq .+108 ; 0xe2f8 //#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("??"); e28c: 8e eb ldi r24, 0xBE ; 190 e28e: 95 e6 ldi r25, 0x65 ; 101 e290: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e292: 82 37 cpi r24, 0x72 ; 114 e294: 26 e6 ldi r18, 0x66 ; 102 e296: 92 07 cpc r25, r18 e298: 91 f1 breq .+100 ; 0xe2fe e29a: 82 37 cpi r24, 0x72 ; 114 e29c: 28 e6 ldi r18, 0x68 ; 104 e29e: 92 07 cpc r25, r18 e2a0: 09 f4 brne .+2 ; 0xe2a4 e2a2: 42 c0 rjmp .+132 ; 0xe328 e2a4: 83 37 cpi r24, 0x73 ; 115 e2a6: 95 46 sbci r25, 0x65 ; 101 e2a8: 89 f7 brne .-30 ; 0xe28c { 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"); e2aa: 85 e1 ldi r24, 0x15 ; 21 e2ac: 96 e6 ldi r25, 0x66 ; 102 e2ae: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e2b0: 8c 36 cpi r24, 0x6C ; 108 e2b2: 20 e7 ldi r18, 0x70 ; 112 e2b4: 92 07 cpc r25, r18 e2b6: 31 f1 breq .+76 ; 0xe304 e2b8: 70 f4 brcc .+28 ; 0xe2d6 e2ba: 8c 36 cpi r24, 0x6C ; 108 e2bc: 2e e6 ldi r18, 0x6E ; 110 e2be: 92 07 cpc r25, r18 e2c0: 21 f1 breq .+72 ; 0xe30a e2c2: 8f 36 cpi r24, 0x6F ; 111 e2c4: 2e e6 ldi r18, 0x6E ; 110 e2c6: 92 07 cpc r25, r18 e2c8: 31 f1 breq .+76 ; 0xe316 e2ca: 84 37 cpi r24, 0x74 ; 116 e2cc: 99 46 sbci r25, 0x69 ; 105 e2ce: f1 f6 brne .-68 ; 0xe28c 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"); e2d0: 83 e0 ldi r24, 0x03 ; 3 e2d2: 96 e6 ldi r25, 0x66 ; 102 e2d4: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e2d6: 8b 36 cpi r24, 0x6B ; 107 e2d8: 23 e7 ldi r18, 0x73 ; 115 e2da: 92 07 cpc r25, r18 e2dc: f9 f0 breq .+62 ; 0xe31c e2de: 86 37 cpi r24, 0x76 ; 118 e2e0: 23 e7 ldi r18, 0x73 ; 115 e2e2: 92 07 cpc r25, r18 e2e4: a9 f0 breq .+42 ; 0xe310 e2e6: 8f 36 cpi r24, 0x6F ; 111 e2e8: 92 47 sbci r25, 0x72 ; 114 e2ea: 81 f6 brne .-96 ; 0xe28c #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 e2ec: 81 ec ldi r24, 0xC1 ; 193 e2ee: 95 e6 ldi r25, 0x65 ; 101 e2f0: 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"); e2f2: 85 e2 ldi r24, 0x25 ; 37 e2f4: 96 e6 ldi r25, 0x66 ; 102 e2f6: 08 95 ret case LANG_CODE_DE: return _n("Deutsch"); e2f8: 8d e1 ldi r24, 0x1D ; 29 e2fa: 96 e6 ldi r25, 0x66 ; 102 e2fc: 08 95 ret case LANG_CODE_ES: return _n("Espanol"); case LANG_CODE_FR: return _n("Francais"); e2fe: 8c e0 ldi r24, 0x0C ; 12 e300: 96 e6 ldi r25, 0x66 ; 102 e302: 08 95 ret case LANG_CODE_IT: return _n("Italiano"); case LANG_CODE_PL: return _n("Polski"); e304: 8c ef ldi r24, 0xFC ; 252 e306: 95 e6 ldi r25, 0x65 ; 101 e308: 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 e30a: 81 ef ldi r24, 0xF1 ; 241 e30c: 95 e6 ldi r25, 0x65 ; 101 e30e: 08 95 ret #endif // COMMUNITY_LANG_GROUP1_NL #ifdef COMMUNITY_LANG_GROUP1_SV case LANG_CODE_SV: return _n("Svenska"); //community Swedish contribution e310: 89 ee ldi r24, 0xE9 ; 233 e312: 95 e6 ldi r25, 0x65 ; 101 e314: 08 95 ret #endif // COMMUNITY_LANG_GROUP1_SV #ifdef COMMUNITY_LANG_GROUP1_NO case LANG_CODE_NO: return _n("Norsk"); //community Swedish contribution e316: 83 ee ldi r24, 0xE3 ; 227 e318: 95 e6 ldi r25, 0x65 ; 101 e31a: 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 e31c: 88 ed ldi r24, 0xD8 ; 216 e31e: 95 e6 ldi r25, 0x65 ; 101 e320: 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 e322: 81 ed ldi r24, 0xD1 ; 209 e324: 95 e6 ldi r25, 0x65 ; 101 e326: 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 e328: 88 ec ldi r24, 0xC8 ; 200 e32a: 95 e6 ldi r25, 0x65 ; 101 e32c: 08 95 ret const char* lang_get_name_by_code(uint16_t code) { switch (code) { case LANG_CODE_EN: return _n("English"); e32e: 8d e2 ldi r24, 0x2D ; 45 e330: 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("??"); } e332: 08 95 ret 0000e334 : #endif //XFLASH return 0; } uint16_t lang_get_code(uint8_t lang) { e334: cf 92 push r12 e336: df 92 push r13 e338: ef 92 push r14 e33a: ff 92 push r15 e33c: 1f 93 push r17 e33e: cf 93 push r28 e340: df 93 push r29 e342: cd b7 in r28, 0x3d ; 61 e344: de b7 in r29, 0x3e ; 62 e346: 60 97 sbiw r28, 0x10 ; 16 e348: 0f b6 in r0, 0x3f ; 63 e34a: f8 94 cli e34c: de bf out 0x3e, r29 ; 62 e34e: 0f be out 0x3f, r0 ; 63 e350: cd bf out 0x3d, r28 ; 61 if (lang == LANG_ID_PRI) return LANG_CODE_EN; //primary lang = EN e352: 88 23 and r24, r24 e354: c1 f1 breq .+112 ; 0xe3c6 e356: 18 2f mov r17, r24 #ifdef XFLASH if (lang == LANG_ID_SEC) e358: 81 30 cpi r24, 0x01 ; 1 e35a: 81 f4 brne .+32 ; 0xe37c e35c: 0e 94 0a 71 call 0xe214 ; 0xe214 table += pgm_read_word((uint16_t*)(table + 4)); count++; } #endif //XFLASH return LANG_CODE_XX; } e360: 60 96 adiw r28, 0x10 ; 16 e362: 0f b6 in r0, 0x3f ; 63 e364: f8 94 cli e366: de bf out 0x3e, r29 ; 62 e368: 0f be out 0x3f, r0 ; 63 e36a: cd bf out 0x3d, r28 ; 61 e36c: df 91 pop r29 e36e: cf 91 pop r28 e370: 1f 91 pop r17 e372: ff 90 pop r15 e374: ef 90 pop r14 e376: df 90 pop r13 e378: cf 90 pop r12 e37a: 08 95 ret SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; e37c: 8c e5 ldi r24, 0x5C ; 92 e37e: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; e380: 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--; e382: 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; e384: c1 2c mov r12, r1 e386: d1 2c mov r13, r1 e388: 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 e38a: 20 e1 ldi r18, 0x10 ; 16 e38c: 30 e0 ldi r19, 0x00 ; 0 e38e: ae 01 movw r20, r28 e390: 4f 5f subi r20, 0xFF ; 255 e392: 5f 4f sbci r21, 0xFF ; 255 e394: c7 01 movw r24, r14 e396: b6 01 movw r22, r12 e398: 0e 94 e7 ec call 0x1d9ce ; 0x1d9ce if (header.magic != LANG_MAGIC) break; //break if not valid e39c: 89 81 ldd r24, Y+1 ; 0x01 e39e: 9a 81 ldd r25, Y+2 ; 0x02 e3a0: ab 81 ldd r26, Y+3 ; 0x03 e3a2: bc 81 ldd r27, Y+4 ; 0x04 e3a4: 85 3a cpi r24, 0xA5 ; 165 e3a6: 9a 45 sbci r25, 0x5A ; 90 e3a8: a4 4b sbci r26, 0xB4 ; 180 e3aa: bb 44 sbci r27, 0x4B ; 75 e3ac: 79 f4 brne .+30 ; 0xe3cc if (--lang == 0) return header.code; e3ae: 11 50 subi r17, 0x01 ; 1 e3b0: 19 f4 brne .+6 ; 0xe3b8 e3b2: 8b 85 ldd r24, Y+11 ; 0x0b e3b4: 9c 85 ldd r25, Y+12 ; 0x0c e3b6: d4 cf rjmp .-88 ; 0xe360 addr += header.size; //calc address of next table e3b8: 8d 81 ldd r24, Y+5 ; 0x05 e3ba: 9e 81 ldd r25, Y+6 ; 0x06 e3bc: c8 0e add r12, r24 e3be: d9 1e adc r13, r25 e3c0: e1 1c adc r14, r1 e3c2: f1 1c adc r15, r1 e3c4: e2 cf rjmp .-60 ; 0xe38a return 0; } uint16_t lang_get_code(uint8_t lang) { if (lang == LANG_ID_PRI) return LANG_CODE_EN; //primary lang = EN e3c6: 8e e6 ldi r24, 0x6E ; 110 e3c8: 95 e6 ldi r25, 0x65 ; 101 e3ca: ca cf rjmp .-108 ; 0xe360 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; e3cc: 8f e3 ldi r24, 0x3F ; 63 e3ce: 9f e3 ldi r25, 0x3F ; 63 e3d0: c7 cf rjmp .-114 ; 0xe360 0000e3d2 : sum = (sum >> 8) | ((sum & 0xff) << 8); //swap bytes return (sum == lt_sum); } uint8_t lang_get_count() { e3d2: cf 92 push r12 e3d4: df 92 push r13 e3d6: ef 92 push r14 e3d8: ff 92 push r15 e3da: 1f 93 push r17 e3dc: cf 93 push r28 e3de: df 93 push r29 e3e0: cd b7 in r28, 0x3d ; 61 e3e2: de b7 in r29, 0x3e ; 62 e3e4: 60 97 sbiw r28, 0x10 ; 16 e3e6: 0f b6 in r0, 0x3f ; 63 e3e8: f8 94 cli e3ea: de bf out 0x3e, r29 ; 62 e3ec: 0f be out 0x3f, r0 ; 63 e3ee: cd bf out 0x3d, r28 ; 61 if (pgm_read_dword(((uint32_t*)(_PRI_LANG_SIGNATURE))) == 0xffffffff) e3f0: ee ea ldi r30, 0xAE ; 174 e3f2: f9 e7 ldi r31, 0x79 ; 121 e3f4: 85 91 lpm r24, Z+ e3f6: 95 91 lpm r25, Z+ e3f8: a5 91 lpm r26, Z+ e3fa: b4 91 lpm r27, Z return 1; //signature not set - only primary language will be available e3fc: 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) e3fe: 8f 3f cpi r24, 0xFF ; 255 e400: 9f 4f sbci r25, 0xFF ; 255 e402: af 4f sbci r26, 0xFF ; 255 e404: bf 4f sbci r27, 0xFF ; 255 e406: 09 f1 breq .+66 ; 0xe44a SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; e408: 8c e5 ldi r24, 0x5C ; 92 e40a: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; e40c: 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; e40e: c1 2c mov r12, r1 e410: d1 2c mov r13, r1 e412: 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) e414: 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 e416: 20 e1 ldi r18, 0x10 ; 16 e418: 30 e0 ldi r19, 0x00 ; 0 e41a: ae 01 movw r20, r28 e41c: 4f 5f subi r20, 0xFF ; 255 e41e: 5f 4f sbci r21, 0xFF ; 255 e420: c7 01 movw r24, r14 e422: b6 01 movw r22, r12 e424: 0e 94 e7 ec call 0x1d9ce ; 0x1d9ce if (header.magic != LANG_MAGIC) break; //break if magic not valid e428: 89 81 ldd r24, Y+1 ; 0x01 e42a: 9a 81 ldd r25, Y+2 ; 0x02 e42c: ab 81 ldd r26, Y+3 ; 0x03 e42e: bc 81 ldd r27, Y+4 ; 0x04 e430: 85 3a cpi r24, 0xA5 ; 165 e432: 9a 45 sbci r25, 0x5A ; 90 e434: a4 4b sbci r26, 0xB4 ; 180 e436: bb 44 sbci r27, 0x4B ; 75 e438: 41 f4 brne .+16 ; 0xe44a addr += header.size; //calc address of next table e43a: 8d 81 ldd r24, Y+5 ; 0x05 e43c: 9e 81 ldd r25, Y+6 ; 0x06 e43e: c8 0e add r12, r24 e440: d9 1e adc r13, r25 e442: e1 1c adc r14, r1 e444: f1 1c adc r15, r1 count++; //inc counter e446: 1f 5f subi r17, 0xFF ; 255 e448: e6 cf rjmp .-52 ; 0xe416 table += pgm_read_word((uint16_t*)(table + 4)); count++; } #endif //XFLASH return count; } e44a: 81 2f mov r24, r17 e44c: 60 96 adiw r28, 0x10 ; 16 e44e: 0f b6 in r0, 0x3f ; 63 e450: f8 94 cli e452: de bf out 0x3e, r29 ; 62 e454: 0f be out 0x3f, r0 ; 63 e456: cd bf out 0x3d, r28 ; 61 e458: df 91 pop r29 e45a: cf 91 pop r28 e45c: 1f 91 pop r17 e45e: ff 90 pop r15 e460: ef 90 pop r14 e462: df 90 pop r13 e464: cf 90 pop r12 e466: 08 95 ret 0000e468 : 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) { e468: 0f 93 push r16 e46a: 1f 93 push r17 e46c: cf 93 push r28 e46e: c8 2f mov r28, r24 if (lang == LANG_ID_PRI) //primary language e470: 81 11 cpse r24, r1 e472: 06 c0 rjmp .+12 ; 0xe480 { lang_table = 0; e474: 10 92 59 03 sts 0x0359, r1 ; 0x800359 e478: 10 92 58 03 sts 0x0358, r1 ; 0x800358 lang_selected = lang; e47c: 10 92 5a 03 sts 0x035A, r1 ; 0x80035a } #ifdef XFLASH if (lang_get_code(lang) == lang_get_code(LANG_ID_SEC)) lang = LANG_ID_SEC; e480: 8c 2f mov r24, r28 e482: 0e 94 9a 71 call 0xe334 ; 0xe334 e486: 8c 01 movw r16, r24 e488: 0e 94 0a 71 call 0xe214 ; 0xe214 e48c: 08 17 cp r16, r24 e48e: 19 07 cpc r17, r25 e490: 19 f0 breq .+6 ; 0xe498 if (lang == LANG_ID_SEC) //current secondary language e492: c1 30 cpi r28, 0x01 ; 1 e494: 09 f0 breq .+2 ; 0xe498 e496: 3e c0 rjmp .+124 ; 0xe514 { if (pgm_read_dword(((uint32_t*)_SEC_LANG_TABLE)) == LANG_MAGIC) //magic valid e498: e0 e0 ldi r30, 0x00 ; 0 e49a: f1 e0 ldi r31, 0x01 ; 1 e49c: 85 91 lpm r24, Z+ e49e: 95 91 lpm r25, Z+ e4a0: a5 91 lpm r26, Z+ e4a2: b4 91 lpm r27, Z e4a4: 85 3a cpi r24, 0xA5 ; 165 e4a6: 9a 45 sbci r25, 0x5A ; 90 e4a8: a4 4b sbci r26, 0xB4 ; 180 e4aa: bb 44 sbci r27, 0x4B ; 75 e4ac: 09 f0 breq .+2 ; 0xe4b0 e4ae: 31 c0 rjmp .+98 ; 0xe512 } uint8_t lang_check(uint16_t addr) { uint16_t sum = 0; uint16_t size = pgm_read_word((uint16_t*)(addr + 4)); e4b0: e4 e0 ldi r30, 0x04 ; 4 e4b2: f1 e0 ldi r31, 0x01 ; 1 e4b4: 65 91 lpm r22, Z+ e4b6: 74 91 lpm r23, Z uint16_t lt_sum = pgm_read_word((uint16_t*)(addr + 8)); e4b8: e8 e0 ldi r30, 0x08 ; 8 e4ba: f1 e0 ldi r31, 0x01 ; 1 e4bc: 45 91 lpm r20, Z+ e4be: 54 91 lpm r21, Z uint16_t i; for (i = 0; i < size; i++) e4c0: 30 e0 ldi r19, 0x00 ; 0 e4c2: 20 e0 ldi r18, 0x00 ; 0 return 0; } uint8_t lang_check(uint16_t addr) { uint16_t sum = 0; e4c4: 90 e0 ldi r25, 0x00 ; 0 e4c6: 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++) e4c8: 62 17 cp r22, r18 e4ca: 73 07 cpc r23, r19 e4cc: 89 f5 brne .+98 ; 0xe530 sum += (uint16_t)pgm_read_byte((uint8_t*)(addr + i)) << ((i & 1)?0:8); sum -= lt_sum; //subtract checksum e4ce: 84 1b sub r24, r20 e4d0: 95 0b sbc r25, r21 sum = (sum >> 8) | ((sum & 0xff) << 8); //swap bytes e4d2: 98 27 eor r25, r24 e4d4: 89 27 eor r24, r25 e4d6: 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)) e4d8: 48 17 cp r20, r24 e4da: 59 07 cpc r21, r25 e4dc: d1 f4 brne .+52 ; 0xe512 if (pgm_read_dword(((uint32_t*)(_SEC_LANG_TABLE + 12))) == pgm_read_dword(((uint32_t*)(_PRI_LANG_SIGNATURE)))) //signature valid e4de: ec e0 ldi r30, 0x0C ; 12 e4e0: f1 e0 ldi r31, 0x01 ; 1 e4e2: 45 91 lpm r20, Z+ e4e4: 55 91 lpm r21, Z+ e4e6: 65 91 lpm r22, Z+ e4e8: 74 91 lpm r23, Z e4ea: ee ea ldi r30, 0xAE ; 174 e4ec: f9 e7 ldi r31, 0x79 ; 121 e4ee: 85 91 lpm r24, Z+ e4f0: 95 91 lpm r25, Z+ e4f2: a5 91 lpm r26, Z+ e4f4: b4 91 lpm r27, Z e4f6: 48 17 cp r20, r24 e4f8: 59 07 cpc r21, r25 e4fa: 6a 07 cpc r22, r26 e4fc: 7b 07 cpc r23, r27 e4fe: 49 f4 brne .+18 ; 0xe512 { lang_table = (lang_table_t*)(_SEC_LANG_TABLE); // set table pointer e500: 80 e0 ldi r24, 0x00 ; 0 e502: 91 e0 ldi r25, 0x01 ; 1 e504: 90 93 59 03 sts 0x0359, r25 ; 0x800359 e508: 80 93 58 03 sts 0x0358, r24 ; 0x800358 lang_selected = lang; // set language id e50c: 81 e0 ldi r24, 0x01 ; 1 e50e: 80 93 5a 03 sts 0x035A, r24 ; 0x80035a 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 e512: c1 e0 ldi r28, 0x01 ; 1 lang_selected = lang; // set language id } } } #endif //XFLASH if (lang_selected == lang) e514: 80 91 5a 03 lds r24, 0x035A ; 0x80035a e518: 8c 13 cpse r24, r28 e51a: 1c c0 rjmp .+56 ; 0xe554 { eeprom_update_byte((unsigned char*)EEPROM_LANG, lang_selected); e51c: 6c 2f mov r22, r28 e51e: 8e ef ldi r24, 0xFE ; 254 e520: 9f e0 ldi r25, 0x0F ; 15 e522: 0f 94 40 dc call 0x3b880 ; 0x3b880 return 1; e526: 81 e0 ldi r24, 0x01 ; 1 } return 0; } e528: cf 91 pop r28 e52a: 1f 91 pop r17 e52c: 0f 91 pop r16 e52e: 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); e530: f9 01 movw r30, r18 e532: e0 50 subi r30, 0x00 ; 0 e534: ff 4f sbci r31, 0xFF ; 255 e536: e4 91 lpm r30, Z e538: f0 e0 ldi r31, 0x00 ; 0 e53a: a8 e0 ldi r26, 0x08 ; 8 e53c: 20 fd sbrc r18, 0 e53e: a0 e0 ldi r26, 0x00 ; 0 e540: 02 c0 rjmp .+4 ; 0xe546 e542: ee 0f add r30, r30 e544: ff 1f adc r31, r31 e546: aa 95 dec r26 e548: e2 f7 brpl .-8 ; 0xe542 e54a: 8e 0f add r24, r30 e54c: 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++) e54e: 2f 5f subi r18, 0xFF ; 255 e550: 3f 4f sbci r19, 0xFF ; 255 e552: ba cf rjmp .-140 ; 0xe4c8 if (lang_selected == lang) { eeprom_update_byte((unsigned char*)EEPROM_LANG, lang_selected); return 1; } return 0; e554: 80 e0 ldi r24, 0x00 ; 0 e556: e8 cf rjmp .-48 ; 0xe528 0000e558 : //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. e558: 20 91 5a 03 lds r18, 0x035A ; 0x80035a e55c: 21 11 cpse r18, r1 e55e: 04 c0 rjmp .+8 ; 0xe568 e560: fc 01 movw r30, r24 e562: 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 } e564: cf 01 movw r24, r30 e566: 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. e568: 40 91 58 03 lds r20, 0x0358 ; 0x800358 e56c: 50 91 59 03 lds r21, 0x0359 ; 0x800359 e570: 41 15 cp r20, r1 e572: 51 05 cpc r21, r1 e574: a9 f3 breq .-22 ; 0xe560 uint16_t ui = pgm_read_word(((uint16_t*)s)); //read string id e576: fc 01 movw r30, r24 e578: 25 91 lpm r18, Z+ e57a: 34 91 lpm r19, Z if (ui == 0xffff) return s + 2; //id not assigned, return orig. str. e57c: 2f 3f cpi r18, 0xFF ; 255 e57e: 32 07 cpc r19, r18 e580: 79 f3 breq .-34 ; 0xe560 ui = pgm_read_word(((uint16_t*)(((char*)lang_table + 16 + ui*2)))); //read relative offset e582: f9 01 movw r30, r18 e584: 38 96 adiw r30, 0x08 ; 8 e586: ee 0f add r30, r30 e588: ff 1f adc r31, r31 e58a: e4 0f add r30, r20 e58c: f5 1f adc r31, r21 e58e: 25 91 lpm r18, Z+ e590: 34 91 lpm r19, Z if (pgm_read_byte(((uint8_t*)((char*)lang_table + ui))) == 0) //read first character e592: fa 01 movw r30, r20 e594: e2 0f add r30, r18 e596: f3 1f adc r31, r19 e598: 24 91 lpm r18, Z e59a: 22 23 and r18, r18 e59c: 09 f3 breq .-62 ; 0xe560 e59e: e2 cf rjmp .-60 ; 0xe564 0000e5a0 : } sound_wait_for_user_reset(); } void M600_load_filament_movements(const char* filament_name) { e5a0: cf 93 push r28 e5a2: df 93 push r29 e5a4: ec 01 movw r28, r24 current_position[E_AXIS]+= FILAMENTCHANGE_FIRSTFEED; e5a6: 20 e0 ldi r18, 0x00 ; 0 e5a8: 30 e0 ldi r19, 0x00 ; 0 e5aa: 4c e8 ldi r20, 0x8C ; 140 e5ac: 52 e4 ldi r21, 0x42 ; 66 e5ae: 60 91 9e 06 lds r22, 0x069E ; 0x80069e e5b2: 70 91 9f 06 lds r23, 0x069F ; 0x80069f e5b6: 80 91 a0 06 lds r24, 0x06A0 ; 0x8006a0 e5ba: 90 91 a1 06 lds r25, 0x06A1 ; 0x8006a1 e5be: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> e5c2: 60 93 9e 06 sts 0x069E, r22 ; 0x80069e e5c6: 70 93 9f 06 sts 0x069F, r23 ; 0x80069f e5ca: 80 93 a0 06 sts 0x06A0, r24 ; 0x8006a0 e5ce: 90 93 a1 06 sts 0x06A1, r25 ; 0x8006a1 plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FIRST); e5d2: 60 e0 ldi r22, 0x00 ; 0 e5d4: 70 e0 ldi r23, 0x00 ; 0 e5d6: 80 ea ldi r24, 0xA0 ; 160 e5d8: 91 e4 ldi r25, 0x41 ; 65 e5da: 0f 94 49 c0 call 0x38092 ; 0x38092 load_filament_final_feed(); e5de: 0e 94 93 64 call 0xc926 ; 0xc926 } void lcd_loading_filament(const char* filament_name) { lcd_clear(); e5e2: 0e 94 13 6f call 0xde26 ; 0xde26 lcd_puts_at_P(0, 0, _T(MSG_LOADING_FILAMENT)); e5e6: 87 e3 ldi r24, 0x37 ; 55 e5e8: 9c e5 ldi r25, 0x5C ; 92 e5ea: 0e 94 ac 72 call 0xe558 ; 0xe558 e5ee: ac 01 movw r20, r24 e5f0: 60 e0 ldi r22, 0x00 ; 0 e5f2: 80 e0 ldi r24, 0x00 ; 0 e5f4: 0e 94 f4 6e call 0xdde8 ; 0xdde8 if (filament_name[0]) { e5f8: 88 81 ld r24, Y e5fa: 88 23 and r24, r24 e5fc: 39 f0 breq .+14 ; 0xe60c lcd_set_cursor(0, 1); e5fe: 61 e0 ldi r22, 0x01 ; 1 e600: 80 e0 ldi r24, 0x00 ; 0 e602: 0e 94 e0 6e call 0xddc0 ; 0xddc0 lcd_print(filament_name); e606: ce 01 movw r24, r28 e608: 0e 94 e7 70 call 0xe1ce ; 0xe1ce } lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); e60c: 8a ee ldi r24, 0xEA ; 234 e60e: 99 e3 ldi r25, 0x39 ; 57 e610: 0e 94 ac 72 call 0xe558 ; 0xe558 e614: ac 01 movw r20, r24 e616: 62 e0 ldi r22, 0x02 ; 2 e618: 80 e0 ldi r24, 0x00 ; 0 e61a: 0e 94 f4 6e call 0xdde8 ; 0xdde8 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 e61e: 83 e4 ldi r24, 0x43 ; 67 e620: 9b e2 ldi r25, 0x2B ; 43 e622: 0f 94 6f 20 call 0x240de ; 0x240de lcd_loading_filament(filament_name); st_synchronize(); } e626: df 91 pop r29 e628: 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(); e62a: 0d 94 e8 42 jmp 0x285d0 ; 0x285d0 0000e62e : * 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; e62e: 0f 94 b9 74 call 0x2e972 ; 0x2e972 e632: 8f 3f cpi r24, 0xFF ; 255 e634: 11 f1 breq .+68 ; 0xe67a lcd_update_enable(false); e636: 80 e0 ldi r24, 0x00 ; 0 e638: 0e 94 25 6f call 0xde4a ; 0xde4a lcd_clear(); e63c: 0e 94 13 6f call 0xde26 ; 0xde26 lcd_puts_at_P(0, 1, _T(MSG_UNLOADING_FILAMENT)); e640: 8e ef ldi r24, 0xFE ; 254 e642: 92 e5 ldi r25, 0x52 ; 82 e644: 0e 94 ac 72 call 0xe558 ; 0xe558 e648: ac 01 movw r20, r24 e64a: 61 e0 ldi r22, 0x01 ; 1 e64c: 80 e0 ldi r24, 0x00 ; 0 e64e: 0e 94 f4 6e call 0xdde8 ; 0xdde8 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e652: 80 e2 ldi r24, 0x20 ; 32 e654: 0e 94 8f 6f call 0xdf1e ; 0xdf1e lcd_print(' '); lcd_print(MMU2::mmu2.get_current_tool() + 1); e658: 0f 94 b9 74 call 0x2e972 ; 0x2e972 e65c: 68 2f mov r22, r24 e65e: 70 e0 ldi r23, 0x00 ; 0 e660: 6f 5f subi r22, 0xFF ; 255 e662: 7f 4f sbci r23, 0xFF ; 255 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); e664: 07 2e mov r0, r23 e666: 00 0c add r0, r0 e668: 88 0b sbc r24, r24 e66a: 99 0b sbc r25, r25 e66c: 0e 94 99 70 call 0xe132 ; 0xe132 // unload just current filament for multimaterial printers (used also in M702) MMU2::mmu2.unload(); e670: 0f 94 3d ad call 0x35a7a ; 0x35a7a lcd_update_enable(true); e674: 81 e0 ldi r24, 0x01 ; 1 e676: 0c 94 25 6f jmp 0xde4a ; 0xde4a } e67a: 08 95 ret 0000e67c : } #ifdef TMC2130 bool calibrate_z_auto() { e67c: 4f 92 push r4 e67e: 5f 92 push r5 e680: 6f 92 push r6 e682: 7f 92 push r7 e684: 8f 92 push r8 e686: 9f 92 push r9 e688: af 92 push r10 e68a: bf 92 push r11 e68c: ef 92 push r14 e68e: ff 92 push r15 e690: 0f 93 push r16 e692: 1f 93 push r17 e694: cf 93 push r28 e696: df 93 push r29 //lcd_display_message_fullscreen_P(_T(MSG_CALIBRATE_Z_AUTO)); lcd_clear(); e698: 0e 94 13 6f call 0xde26 ; 0xde26 lcd_puts_at_P(0, 1, _T(MSG_CALIBRATE_Z_AUTO)); e69c: 84 ef ldi r24, 0xF4 ; 244 e69e: 9d e4 ldi r25, 0x4D ; 77 e6a0: 0e 94 ac 72 call 0xe558 ; 0xe558 e6a4: ac 01 movw r20, r24 e6a6: 61 e0 ldi r22, 0x01 ; 1 e6a8: 80 e0 ldi r24, 0x00 ; 0 e6aa: 0e 94 f4 6e call 0xdde8 ; 0xdde8 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; e6ae: d0 91 b7 02 lds r29, 0x02B7 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> check_endstops = check; e6b2: 81 e0 ldi r24, 0x01 ; 1 e6b4: 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); e6b8: ec e3 ldi r30, 0x3C ; 60 e6ba: fc e7 ldi r31, 0x7C ; 124 e6bc: 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); e6be: 84 e0 ldi r24, 0x04 ; 4 e6c0: 0f 94 d8 25 call 0x24bb0 ; 0x24bb0 current_position[Z_AXIS] = 0; e6c4: 82 e9 ldi r24, 0x92 ; 146 e6c6: e8 2e mov r14, r24 e6c8: 86 e0 ldi r24, 0x06 ; 6 e6ca: f8 2e mov r15, r24 e6cc: f7 01 movw r30, r14 e6ce: 10 86 std Z+8, r1 ; 0x08 e6d0: 11 86 std Z+9, r1 ; 0x09 e6d2: 12 86 std Z+10, r1 ; 0x0a e6d4: 13 86 std Z+11, r1 ; 0x0b plan_set_position_curposXYZE(); e6d6: 0f 94 09 bf call 0x37e12 ; 0x37e12 set_destination_to_current(); e6da: 0e 94 3a 68 call 0xd074 ; 0xd074 #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); e6de: e6 e3 ldi r30, 0x36 ; 54 e6e0: fc e7 ldi r31, 0x7C ; 124 e6e2: 85 90 lpm r8, Z+ e6e4: 95 90 lpm r9, Z+ e6e6: a5 90 lpm r10, Z+ e6e8: 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); e6ea: 04 e7 ldi r16, 0x74 ; 116 e6ec: 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); e6ee: 8c 2f mov r24, r28 e6f0: 99 27 eor r25, r25 e6f2: 81 95 neg r24 e6f4: 0c f4 brge .+2 ; 0xe6f8 e6f6: 90 95 com r25 e6f8: 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); e6fa: 07 2e mov r0, r23 e6fc: 00 0c add r0, r0 e6fe: 88 0b sbc r24, r24 e700: 99 0b sbc r25, r25 e702: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> e706: 2b 01 movw r4, r22 e708: 3c 01 movw r6, r24 e70a: 2d ec ldi r18, 0xCD ; 205 e70c: 3c ec ldi r19, 0xCC ; 204 e70e: 4c e8 ldi r20, 0x8C ; 140 e710: 5f e3 ldi r21, 0x3F ; 63 e712: c5 01 movw r24, r10 e714: b4 01 movw r22, r8 e716: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> e71a: 9b 01 movw r18, r22 e71c: ac 01 movw r20, r24 e71e: c3 01 movw r24, r6 e720: b2 01 movw r22, r4 e722: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> e726: f8 01 movw r30, r16 e728: 20 85 ldd r18, Z+8 ; 0x08 e72a: 31 85 ldd r19, Z+9 ; 0x09 e72c: 42 85 ldd r20, Z+10 ; 0x0a e72e: 53 85 ldd r21, Z+11 ; 0x0b e730: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> e734: f8 01 movw r30, r16 e736: 60 87 std Z+8, r22 ; 0x08 e738: 71 87 std Z+9, r23 ; 0x09 e73a: 82 87 std Z+10, r24 ; 0x0a e73c: 93 87 std Z+11, r25 ; 0x0b feedrate = homing_feedrate[Z_AXIS]; e73e: 80 e0 ldi r24, 0x00 ; 0 e740: 90 e0 ldi r25, 0x00 ; 0 e742: a8 e4 ldi r26, 0x48 ; 72 e744: b4 e4 ldi r27, 0x44 ; 68 e746: 80 93 b8 02 sts 0x02B8, r24 ; 0x8002b8 e74a: 90 93 b9 02 sts 0x02B9, r25 ; 0x8002b9 e74e: a0 93 ba 02 sts 0x02BA, r26 ; 0x8002ba e752: b0 93 bb 02 sts 0x02BB, r27 ; 0x8002bb plan_buffer_line_destinationXYZE(feedrate / 60); e756: 65 e5 ldi r22, 0x55 ; 85 e758: 75 e5 ldi r23, 0x55 ; 85 e75a: 85 e5 ldi r24, 0x55 ; 85 e75c: 91 e4 ldi r25, 0x41 ; 65 e75e: 0f 94 16 c0 call 0x3802c ; 0x3802c st_synchronize(); e762: 0f 94 e8 42 call 0x285d0 ; 0x285d0 // current_position[axis] = 0; // plan_set_position_curposXYZE(); tmc2130_home_exit(); e766: 0f 94 a9 25 call 0x24b52 ; 0x24b52 e76a: 10 92 b7 02 sts 0x02B7, r1 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> enable_endstops(false); current_position[Z_AXIS] = 0; e76e: f7 01 movw r30, r14 e770: 10 86 std Z+8, r1 ; 0x08 e772: 11 86 std Z+9, r1 ; 0x09 e774: 12 86 std Z+10, r1 ; 0x0a e776: 13 86 std Z+11, r1 ; 0x0b plan_set_position_curposXYZE(); e778: 0f 94 09 bf call 0x37e12 ; 0x37e12 set_destination_to_current(); e77c: 0e 94 3a 68 call 0xd074 ; 0xd074 destination[Z_AXIS] += 10 * axis_up_dir; //10mm up e780: f6 ef ldi r31, 0xF6 ; 246 e782: cf 02 muls r28, r31 e784: b0 01 movw r22, r0 e786: 11 24 eor r1, r1 e788: 07 2e mov r0, r23 e78a: 00 0c add r0, r0 e78c: 88 0b sbc r24, r24 e78e: 99 0b sbc r25, r25 e790: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> e794: 9b 01 movw r18, r22 e796: ac 01 movw r20, r24 e798: f8 01 movw r30, r16 e79a: 60 85 ldd r22, Z+8 ; 0x08 e79c: 71 85 ldd r23, Z+9 ; 0x09 e79e: 82 85 ldd r24, Z+10 ; 0x0a e7a0: 93 85 ldd r25, Z+11 ; 0x0b e7a2: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> e7a6: f8 01 movw r30, r16 e7a8: 60 87 std Z+8, r22 ; 0x08 e7aa: 71 87 std Z+9, r23 ; 0x09 e7ac: 82 87 std Z+10, r24 ; 0x0a e7ae: 93 87 std Z+11, r25 ; 0x0b feedrate = homing_feedrate[Z_AXIS] / 2; e7b0: 80 e0 ldi r24, 0x00 ; 0 e7b2: 90 e0 ldi r25, 0x00 ; 0 e7b4: a8 ec ldi r26, 0xC8 ; 200 e7b6: b3 e4 ldi r27, 0x43 ; 67 e7b8: 80 93 b8 02 sts 0x02B8, r24 ; 0x8002b8 e7bc: 90 93 b9 02 sts 0x02B9, r25 ; 0x8002b9 e7c0: a0 93 ba 02 sts 0x02BA, r26 ; 0x8002ba e7c4: b0 93 bb 02 sts 0x02BB, r27 ; 0x8002bb plan_buffer_line_destinationXYZE(feedrate / 60); e7c8: 65 e5 ldi r22, 0x55 ; 85 e7ca: 75 e5 ldi r23, 0x55 ; 85 e7cc: 85 ed ldi r24, 0xD5 ; 213 e7ce: 90 e4 ldi r25, 0x40 ; 64 e7d0: 0f 94 16 c0 call 0x3802c ; 0x3802c st_synchronize(); e7d4: 0f 94 e8 42 call 0x285d0 ; 0x285d0 e7d8: 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; e7dc: 80 e0 ldi r24, 0x00 ; 0 e7de: 90 e0 ldi r25, 0x00 ; 0 e7e0: a4 e5 ldi r26, 0x54 ; 84 e7e2: b3 e4 ldi r27, 0x43 ; 67 e7e4: f7 01 movw r30, r14 e7e6: 80 87 std Z+8, r24 ; 0x08 e7e8: 91 87 std Z+9, r25 ; 0x09 e7ea: a2 87 std Z+10, r26 ; 0x0a e7ec: b3 87 std Z+11, r27 ; 0x0b plan_set_position_curposXYZE(); e7ee: 0f 94 09 bf call 0x37e12 ; 0x37e12 return true; } e7f2: 81 e0 ldi r24, 0x01 ; 1 e7f4: df 91 pop r29 e7f6: cf 91 pop r28 e7f8: 1f 91 pop r17 e7fa: 0f 91 pop r16 e7fc: ff 90 pop r15 e7fe: ef 90 pop r14 e800: bf 90 pop r11 e802: af 90 pop r10 e804: 9f 90 pop r9 e806: 8f 90 pop r8 e808: 7f 90 pop r7 e80a: 6f 90 pop r6 e80c: 5f 90 pop r5 e80e: 4f 90 pop r4 e810: 08 95 ret 0000e812 : restore_print_from_ram_and_continue(default_retraction); //XYZ = orig, E +1mm unretract //babystep_apply(); } void crashdet_fmt_error(char* buf, uint8_t mask) { e812: cf 93 push r28 e814: df 93 push r29 e816: ec 01 movw r28, r24 if(mask & X_AXIS_MASK) *buf++ = axis_codes[X_AXIS]; e818: 60 ff sbrs r22, 0 e81a: 03 c0 rjmp .+6 ; 0xe822 e81c: 28 e5 ldi r18, 0x58 ; 88 e81e: 28 83 st Y, r18 e820: 21 96 adiw r28, 0x01 ; 1 if(mask & Y_AXIS_MASK) *buf++ = axis_codes[Y_AXIS]; e822: 61 ff sbrs r22, 1 e824: 03 c0 rjmp .+6 ; 0xe82c e826: 29 e5 ldi r18, 0x59 ; 89 e828: 28 83 st Y, r18 e82a: 21 96 adiw r28, 0x01 ; 1 *buf++ = ' '; e82c: 80 e2 ldi r24, 0x20 ; 32 e82e: 89 93 st Y+, r24 strcpy_P(buf, _T(MSG_CRASH_DETECTED)); e830: 80 e0 ldi r24, 0x00 ; 0 e832: 96 e3 ldi r25, 0x36 ; 54 e834: 0e 94 ac 72 call 0xe558 ; 0xe558 e838: bc 01 movw r22, r24 e83a: ce 01 movw r24, r28 } e83c: df 91 pop r29 e83e: 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)); e840: 0d 94 d3 d9 jmp 0x3b3a6 ; 0x3b3a6 0000e844 <__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 { e844: 1f 92 push r1 e846: 0f 92 push r0 e848: 0f b6 in r0, 0x3f ; 63 e84a: 0f 92 push r0 e84c: 11 24 eor r1, r1 e84e: 0b b6 in r0, 0x3b ; 59 e850: 0f 92 push r0 e852: 2f 93 push r18 e854: 8f 93 push r24 e856: 9f 93 push r25 e858: ef 93 push r30 e85a: ff 93 push r31 switch(state){ e85c: e0 91 53 03 lds r30, 0x0353 ; 0x800353 e860: e8 30 cpi r30, 0x08 ; 8 e862: e8 f4 brcc .+58 ; 0xe89e <__vector_23+0x5a> e864: f0 e0 ldi r31, 0x00 ; 0 e866: 88 27 eor r24, r24 e868: e7 5c subi r30, 0xC7 ; 199 e86a: fb 48 sbci r31, 0x8B ; 139 e86c: 8f 4f sbci r24, 0xFF ; 255 e86e: 0d 94 2c dd jmp 0x3ba58 ; 0x3ba58 <__tablejump2__> e872: 41 74 andi r20, 0x41 ; 65 e874: 5b 74 andi r21, 0x4B ; 75 e876: 66 74 andi r22, 0x46 ; 70 e878: 74 74 andi r23, 0x44 ; 68 e87a: 8a 74 andi r24, 0x4A ; 74 e87c: 93 74 andi r25, 0x43 ; 67 e87e: b6 74 andi r27, 0x46 ; 70 e880: c8 74 andi r28, 0x48 ; 72 case States::ZERO_START: if (bedPWMDisabled) return; // stay in the OFF state and do not change the output pin e882: 80 91 8d 06 lds r24, 0x068D ; 0x80068d e886: 81 11 cpse r24, r1 e888: 0a c0 rjmp .+20 ; 0xe89e <__vector_23+0x5a> pwm = soft_pwm_bed << 1;// expecting soft_pwm_bed to be 7bit! e88a: 80 91 1d 06 lds r24, 0x061D ; 0x80061d e88e: 88 0f add r24, r24 e890: 80 93 52 03 sts 0x0352, r24 ; 0x800352 if( pwm != 0 ){ e894: 88 23 and r24, r24 e896: 19 f0 breq .+6 ; 0xe89e <__vector_23+0x5a> state = States::ZERO; // do nothing, let it tick once again after the 30Hz period e898: 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 e89a: 80 93 53 03 sts 0x0353, r24 ; 0x800353 TCNT0 = 128; OCR0B = 255; TCCR0B = (1 << CS01); // change prescaler to 8, i.e. 7.8kHz break; } } e89e: ff 91 pop r31 e8a0: ef 91 pop r30 e8a2: 9f 91 pop r25 e8a4: 8f 91 pop r24 e8a6: 2f 91 pop r18 e8a8: 0f 90 pop r0 e8aa: 0b be out 0x3b, r0 ; 59 e8ac: 0f 90 pop r0 e8ae: 0f be out 0x3f, r0 ; 63 e8b0: 0f 90 pop r0 e8b2: 1f 90 pop r1 e8b4: 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) e8b6: 80 91 51 03 lds r24, 0x0351 ; 0x800351 e8ba: 8f 5f subi r24, 0xFF ; 255 e8bc: 80 93 51 03 sts 0x0351, r24 ; 0x800351 if( slowCounter > pwm ){ e8c0: 90 91 52 03 lds r25, 0x0352 ; 0x800352 e8c4: 98 17 cp r25, r24 e8c6: 58 f3 brcs .-42 ; 0xe89e <__vector_23+0x5a> return; } // otherwise moving towards RISE state = States::ZERO_TO_RISE; // and finalize the change in a transitional state RISE0 e8c8: 82 e0 ldi r24, 0x02 ; 2 e8ca: e7 cf rjmp .-50 ; 0xe89a <__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 e8cc: 83 e0 ldi r24, 0x03 ; 3 e8ce: 80 93 53 03 sts 0x0353, r24 ; 0x800353 fastCounter = fastMax - 1;// we'll do 16-1 cycles of RISE e8d2: 8f e0 ldi r24, 0x0F ; 15 e8d4: 80 93 50 03 sts 0x0350, r24 ; 0x800350 TCNT0 = 255; // force overflow on the next clock cycle e8d8: 8f ef ldi r24, 0xFF ; 255 e8da: 86 bd out 0x26, r24 ; 38 TCCR0B = (1 << CS00); // change prescaler to 1, i.e. 62.5kHz e8dc: 81 e0 ldi r24, 0x01 ; 1 e8de: 85 bd out 0x25, r24 ; 37 TCCR0A &= ~(1 << COM0B0); // Clear OC0B on Compare Match, set OC0B at BOTTOM (non-inverting mode) e8e0: 84 b5 in r24, 0x24 ; 36 e8e2: 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 e8e4: 84 bd out 0x24, r24 ; 36 e8e6: db cf rjmp .-74 ; 0xe89e <__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; e8e8: 80 91 50 03 lds r24, 0x0350 ; 0x800350 e8ec: 82 95 swap r24 e8ee: 80 7f andi r24, 0xF0 ; 240 e8f0: 81 95 neg r24 e8f2: 88 bd out 0x28, r24 ; 40 if( fastCounter ){ e8f4: 80 91 50 03 lds r24, 0x0350 ; 0x800350 e8f8: 88 23 and r24, r24 e8fa: 21 f0 breq .+8 ; 0xe904 <__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; e8fc: 81 50 subi r24, 0x01 ; 1 e8fe: 80 93 50 03 sts 0x0350, r24 ; 0x800350 e902: cd cf rjmp .-102 ; 0xe89e <__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; e904: 84 e0 ldi r24, 0x04 ; 4 e906: 80 93 53 03 sts 0x0353, r24 ; 0x800353 OCR0B = 255; // full duty e90a: 8f ef ldi r24, 0xFF ; 255 e90c: 88 bd out 0x28, r24 ; 40 TCNT0 = 254; // make the timer overflow in the next cycle e90e: 8e ef ldi r24, 0xFE ; 254 e910: 86 bd out 0x26, r24 ; 38 e912: c5 cf rjmp .-118 ; 0xe89e <__vector_23+0x5a> // @@TODO these constants are still subject to investigation } break; case States::RISE_TO_ONE: state = States::ONE; e914: 85 e0 ldi r24, 0x05 ; 5 e916: 80 93 53 03 sts 0x0353, r24 ; 0x800353 OCR0B = 255; // full duty e91a: 8f ef ldi r24, 0xFF ; 255 e91c: 88 bd out 0x28, r24 ; 40 TCNT0 = 255; // make the timer overflow in the next cycle e91e: 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 e920: 82 e0 ldi r24, 0x02 ; 2 e922: 85 bd out 0x25, r24 ; 37 e924: bc cf rjmp .-136 ; 0xe89e <__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; e926: 2f ef ldi r18, 0xFF ; 255 e928: 28 bd out 0x28, r18 ; 40 if (bedPWMDisabled) return; // stay in the ON state and do not change the output pin e92a: 80 91 8d 06 lds r24, 0x068D ; 0x80068d e92e: 81 11 cpse r24, r1 e930: b6 cf rjmp .-148 ; 0xe89e <__vector_23+0x5a> slowCounter += slowInc; // this does software timer_clk/256 or less e932: 80 91 51 03 lds r24, 0x0351 ; 0x800351 e936: 8f 5f subi r24, 0xFF ; 255 e938: 80 93 51 03 sts 0x0351, r24 ; 0x800351 if( slowCounter < pwm ){ e93c: 90 91 52 03 lds r25, 0x0352 ; 0x800352 e940: 89 17 cp r24, r25 e942: 08 f4 brcc .+2 ; 0xe946 <__vector_23+0x102> e944: ac cf rjmp .-168 ; 0xe89e <__vector_23+0x5a> return; } if( (soft_pwm_bed << 1) >= (255 - slowInc - 1) ){ //@@TODO simplify & explain e946: 80 91 1d 06 lds r24, 0x061D ; 0x80061d e94a: 90 e0 ldi r25, 0x00 ; 0 e94c: 8f 37 cpi r24, 0x7F ; 127 e94e: 91 05 cpc r25, r1 e950: 0c f0 brlt .+2 ; 0xe954 <__vector_23+0x110> e952: a5 cf rjmp .-182 ; 0xe89e <__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; e954: 86 e0 ldi r24, 0x06 ; 6 e956: 80 93 53 03 sts 0x0353, r24 ; 0x800353 fastCounter = fastMax - 1;// we'll do 16-1 cycles of RISE e95a: 8f e0 ldi r24, 0x0F ; 15 e95c: 80 93 50 03 sts 0x0350, r24 ; 0x800350 TCNT0 = 255; // force overflow on the next clock cycle e960: 26 bd out 0x26, r18 ; 38 TCCR0B = (1 << CS00); // change prescaler to 1, i.e. 62.5kHz e962: 81 e0 ldi r24, 0x01 ; 1 e964: 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 e966: 84 b5 in r24, 0x24 ; 36 e968: 80 61 ori r24, 0x10 ; 16 e96a: bc cf rjmp .-136 ; 0xe8e4 <__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 e96c: 80 91 50 03 lds r24, 0x0350 ; 0x800350 e970: 82 95 swap r24 e972: 80 7f andi r24, 0xF0 ; 240 e974: 81 95 neg r24 e976: 88 bd out 0x28, r24 ; 40 //TCCR0A |= (1 << COM0B0); // already set in ONE_TO_FALL if( fastCounter ){ e978: 80 91 50 03 lds r24, 0x0350 ; 0x800350 e97c: 81 11 cpse r24, r1 e97e: be cf rjmp .-132 ; 0xe8fc <__vector_23+0xb8> --fastCounter; } else { // end of FALL cycles, changing into state ZERO state = States::FALL_TO_ZERO; e980: 87 e0 ldi r24, 0x07 ; 7 e982: 80 93 53 03 sts 0x0353, r24 ; 0x800353 TCNT0 = 128; //@@TODO again - need to wait long enough to propagate the timer state changes e986: 80 e8 ldi r24, 0x80 ; 128 e988: 86 bd out 0x26, r24 ; 38 OCR0B = 255; e98a: 8f ef ldi r24, 0xFF ; 255 e98c: 88 bd out 0x28, r24 ; 40 e98e: 87 cf rjmp .-242 ; 0xe89e <__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 e990: 10 92 53 03 sts 0x0353, r1 ; 0x800353 TCNT0 = 128; e994: 80 e8 ldi r24, 0x80 ; 128 e996: 86 bd out 0x26, r24 ; 38 OCR0B = 255; e998: 8f ef ldi r24, 0xFF ; 255 e99a: 88 bd out 0x28, r24 ; 40 e99c: c1 cf rjmp .-126 ; 0xe920 <__vector_23+0xdc> 0000e99e : #else // FILAMENT_SENSOR FSensorBlockRunout::FSensorBlockRunout() { } FSensorBlockRunout::~FSensorBlockRunout() { } #endif // FILAMENT_SENSOR void Filament_sensor::setEnabled(bool enabled) { e99e: cf 93 push r28 e9a0: c8 2f mov r28, r24 e9a2: 68 2f mov r22, r24 e9a4: 87 e6 ldi r24, 0x67 ; 103 e9a6: 9f e0 ldi r25, 0x0F ; 15 e9a8: 0f 94 40 dc call 0x3b880 ; 0x3b880 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENSOR, enabled); if (enabled) { e9ac: cc 23 and r28, r28 e9ae: 19 f0 breq .+6 ; 0xe9b6 fsensor.init(); } else { fsensor.deinit(); } } e9b0: 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(); e9b2: 0d 94 39 7b jmp 0x2f672 ; 0x2f672 } void PAT9125_sensor::deinit() { // puts_P(PSTR("fsensor::deinit()")); ; // state = State::disabled; e9b6: 10 92 aa 17 sts 0x17AA, r1 ; 0x8017aa filter = 0; e9ba: 10 92 b6 17 sts 0x17B6, r1 ; 0x8017b6 if (enabled) { fsensor.init(); } else { fsensor.deinit(); } } e9be: cf 91 pop r28 e9c0: 08 95 ret 0000e9c2 : #endif #endif //DEBUG_DISABLE_FANCHECK } void resetFanCheck() { fan_measuring = false; e9c2: 10 92 6f 06 sts 0x066F, r1 ; 0x80066f extruder_autofan_last_check = _millis(); e9c6: 0f 94 4c 29 call 0x25298 ; 0x25298 e9ca: 60 93 c0 17 sts 0x17C0, r22 ; 0x8017c0 e9ce: 70 93 c1 17 sts 0x17C1, r23 ; 0x8017c1 e9d2: 80 93 c2 17 sts 0x17C2, r24 ; 0x8017c2 e9d6: 90 93 c3 17 sts 0x17C3, r25 ; 0x8017c3 } e9da: 08 95 ret 0000e9dc <__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) { e9dc: 1f 92 push r1 e9de: 0f 92 push r0 e9e0: 0f b6 in r0, 0x3f ; 63 e9e2: 0f 92 push r0 e9e4: 11 24 eor r1, r1 e9e6: 2f 93 push r18 e9e8: 4f 93 push r20 e9ea: 5f 93 push r21 e9ec: 6f 93 push r22 e9ee: 7f 93 push r23 e9f0: 8f 93 push r24 e9f2: 9f 93 push r25 e9f4: af 93 push r26 e9f6: 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; e9f8: 80 91 6f 06 lds r24, 0x066F ; 0x80066f e9fc: 88 23 and r24, r24 e9fe: f1 f0 breq .+60 ; 0xea3c <__vector_8+0x60> ea00: 80 91 a6 04 lds r24, 0x04A6 ; 0x8004a6 ea04: 8b 34 cpi r24, 0x4B ; 75 ea06: d0 f0 brcs .+52 ; 0xea3c <__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 ea08: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> ea0c: 86 ff sbrs r24, 6 ea0e: 24 c0 rjmp .+72 ; 0xea58 <__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; ea10: 80 91 3b 06 lds r24, 0x063B ; 0x80063b ea14: 90 91 3c 06 lds r25, 0x063C ; 0x80063c ea18: a0 91 3d 06 lds r26, 0x063D ; 0x80063d ea1c: b0 91 3e 06 lds r27, 0x063E ; 0x80063e t_fan_rising_edge = millis_nc(); ea20: 80 93 49 03 sts 0x0349, r24 ; 0x800349 ea24: 90 93 4a 03 sts 0x034A, r25 ; 0x80034a ea28: a0 93 4b 03 sts 0x034B, r26 ; 0x80034b ea2c: b0 93 4c 03 sts 0x034C, r27 ; 0x80034c 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 ea30: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> ea34: 90 e4 ldi r25, 0x40 ; 64 ea36: 89 27 eor r24, r25 ea38: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> } ea3c: bf 91 pop r27 ea3e: af 91 pop r26 ea40: 9f 91 pop r25 ea42: 8f 91 pop r24 ea44: 7f 91 pop r23 ea46: 6f 91 pop r22 ea48: 5f 91 pop r21 ea4a: 4f 91 pop r20 ea4c: 2f 91 pop r18 ea4e: 0f 90 pop r0 ea50: 0f be out 0x3f, r0 ; 63 ea52: 0f 90 pop r0 ea54: 1f 90 pop r1 ea56: 18 95 reti ea58: 80 91 3b 06 lds r24, 0x063B ; 0x80063b ea5c: 90 91 3c 06 lds r25, 0x063C ; 0x80063c ea60: a0 91 3d 06 lds r26, 0x063D ; 0x80063d ea64: b0 91 3e 06 lds r27, 0x063E ; 0x80063e 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 ea68: 40 91 49 03 lds r20, 0x0349 ; 0x800349 ea6c: 50 91 4a 03 lds r21, 0x034A ; 0x80034a ea70: 60 91 4b 03 lds r22, 0x034B ; 0x80034b ea74: 70 91 4c 03 lds r23, 0x034C ; 0x80034c ea78: 84 1b sub r24, r20 ea7a: 95 0b sbc r25, r21 ea7c: a6 0b sbc r26, r22 ea7e: b7 0b sbc r27, r23 ea80: 20 91 e7 03 lds r18, 0x03E7 ; 0x8003e7 ea84: 44 e0 ldi r20, 0x04 ; 4 ea86: 50 e0 ldi r21, 0x00 ; 0 ea88: 60 e0 ldi r22, 0x00 ; 0 ea8a: 70 e0 ldi r23, 0x00 ; 0 ea8c: 25 36 cpi r18, 0x65 ; 101 ea8e: 20 f0 brcs .+8 ; 0xea98 <__vector_8+0xbc> ea90: 43 e0 ldi r20, 0x03 ; 3 ea92: 50 e0 ldi r21, 0x00 ; 0 ea94: 60 e0 ldi r22, 0x00 ; 0 ea96: 70 e0 ldi r23, 0x00 ; 0 ea98: 84 17 cp r24, r20 ea9a: 95 07 cpc r25, r21 ea9c: a6 07 cpc r26, r22 ea9e: b7 07 cpc r27, r23 eaa0: 38 f2 brcs .-114 ; 0xea30 <__vector_8+0x54> fan_edge_counter[1] += 2; //we are currently counting all edges so lets count two edges for one pulse eaa2: 80 91 e4 05 lds r24, 0x05E4 ; 0x8005e4 eaa6: 90 91 e5 05 lds r25, 0x05E5 ; 0x8005e5 eaaa: 02 96 adiw r24, 0x02 ; 2 eaac: 90 93 e5 05 sts 0x05E5, r25 ; 0x8005e5 eab0: 80 93 e4 05 sts 0x05E4, r24 ; 0x8005e4 eab4: bd cf rjmp .-134 ; 0xea30 <__vector_8+0x54> 0000eab6 : 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; eab6: 80 93 4d 03 sts 0x034D, r24 ; 0x80034d newFanSpeed = 0; if (fanState & 0x01) eaba: 80 fd sbrc r24, 0 eabc: 1c c0 rjmp .+56 ; 0xeaf6 { //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; eabe: 10 92 6b 03 sts 0x036B, r1 ; 0x80036b else newFanSpeed = EXTRUDER_AUTO_FAN_SPEED; #else //EXTRUDER_ALTFAN_DETECT newFanSpeed = EXTRUDER_AUTO_FAN_SPEED; #endif //EXTRUDER_ALTFAN_DETECT } timer4_set_fan0(newFanSpeed); eac2: 20 91 6b 03 lds r18, 0x036B ; 0x80036b } #ifdef EXTRUDER_0_AUTO_FAN_PIN void timer4_set_fan0(uint8_t duty) { if (duty == 0 || duty == 255) eac6: 8f ef ldi r24, 0xFF ; 255 eac8: 82 0f add r24, r18 eaca: 8e 3f cpi r24, 0xFE ; 254 eacc: e8 f0 brcs .+58 ; 0xeb08 { // We use digital logic if the duty cycle is 0% or 100% TCCR4A &= ~_BV(COM4C1); eace: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> ead2: 87 7f andi r24, 0xF7 ; 247 ead4: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = 0; ead8: 10 92 ad 00 sts 0x00AD, r1 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> eadc: 10 92 ac 00 sts 0x00AC, r1 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> WRITE(EXTRUDER_0_AUTO_FAN_PIN, duty); eae0: 9f b7 in r25, 0x3f ; 63 eae2: 22 23 and r18, r18 eae4: 61 f0 breq .+24 ; 0xeafe eae6: f8 94 cli eae8: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> eaec: 80 62 ori r24, 0x20 ; 32 eaee: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> eaf2: 9f bf out 0x3f, r25 ; 63 eaf4: 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; eaf6: 8f ef ldi r24, 0xFF ; 255 eaf8: 80 93 6b 03 sts 0x036B, r24 ; 0x80036b eafc: e2 cf rjmp .-60 ; 0xeac2 eafe: f8 94 cli eb00: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> eb04: 8f 7d andi r24, 0xDF ; 223 eb06: f3 cf rjmp .-26 ; 0xeaee 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; eb08: ef b7 in r30, 0x3f ; 63 eb0a: f8 94 cli // Enable the PWM output on the fan pin. TCCR4A |= _BV(COM4C1); eb0c: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> eb10: 88 60 ori r24, 0x08 ; 8 eb12: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = (((uint16_t)duty) * ((uint16_t)((TIMSK4 & _BV(OCIE4A)) ? OCR4A : 255U))) / 255U; eb16: 30 e0 ldi r19, 0x00 ; 0 eb18: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> eb1c: 4f ef ldi r20, 0xFF ; 255 eb1e: 50 e0 ldi r21, 0x00 ; 0 eb20: 81 ff sbrs r24, 1 eb22: 04 c0 rjmp .+8 ; 0xeb2c eb24: 40 91 a8 00 lds r20, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> eb28: 50 91 a9 00 lds r21, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> eb2c: 24 9f mul r18, r20 eb2e: c0 01 movw r24, r0 eb30: 25 9f mul r18, r21 eb32: 90 0d add r25, r0 eb34: 34 9f mul r19, r20 eb36: 90 0d add r25, r0 eb38: 11 24 eor r1, r1 eb3a: 6f ef ldi r22, 0xFF ; 255 eb3c: 70 e0 ldi r23, 0x00 ; 0 eb3e: 0f 94 e5 dc call 0x3b9ca ; 0x3b9ca <__udivmodhi4> eb42: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> eb46: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> CRITICAL_SECTION_END; eb4a: ef bf out 0x3f, r30 ; 63 #endif //EXTRUDER_ALTFAN_DETECT } timer4_set_fan0(newFanSpeed); } eb4c: 08 95 ret 0000eb4e : } #endif //EXTRUDER_ALTFAN_DETECT void checkExtruderAutoFans() { eb4e: 1f 93 push r17 eb50: cf 93 push r28 eb52: df 93 push r29 #if defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN > -1 if (!(fanState & 0x02)) eb54: d0 91 4d 03 lds r29, 0x034D ; 0x80034d eb58: d1 fd sbrc r29, 1 eb5a: 1d c0 rjmp .+58 ; 0xeb96 temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; eb5c: 10 91 1b 05 lds r17, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> { fanState &= ~1; fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; eb60: c1 e0 ldi r28, 0x01 ; 1 eb62: 20 e0 ldi r18, 0x00 ; 0 eb64: 30 e0 ldi r19, 0x00 ; 0 eb66: 48 e4 ldi r20, 0x48 ; 72 eb68: 52 e4 ldi r21, 0x42 ; 66 eb6a: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 eb6e: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 eb72: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 eb76: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 eb7a: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> eb7e: 18 16 cp r1, r24 eb80: 0c f0 brlt .+2 ; 0xeb84 eb82: 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; eb84: de 7f andi r29, 0xFE ; 254 fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; eb86: cd 2b or r28, r29 eb88: 81 e0 ldi r24, 0x01 ; 1 eb8a: 11 11 cpse r17, r1 eb8c: 01 c0 rjmp .+2 ; 0xeb90 eb8e: 80 e0 ldi r24, 0x00 ; 0 fanState |= get_temp_error(); eb90: c8 2b or r28, r24 eb92: c0 93 4d 03 sts 0x034D, r28 ; 0x80034d } setExtruderAutoFanState(fanState); eb96: 80 91 4d 03 lds r24, 0x034D ; 0x80034d #endif } eb9a: df 91 pop r29 eb9c: cf 91 pop r28 eb9e: 1f 91 pop r17 { fanState &= ~1; fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; fanState |= get_temp_error(); } setExtruderAutoFanState(fanState); eba0: 0c 94 5b 75 jmp 0xeab6 ; 0xeab6 0000eba4 : 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) { eba4: ef 92 push r14 eba6: ff 92 push r15 eba8: 0f 93 push r16 ebaa: 1f 93 push r17 ebac: cf 93 push r28 ebae: df 93 push r29 ebb0: ec 01 movw r28, r24 ebb2: 8b 01 movw r16, r22 ebb4: 7a 01 movw r14, r20 if (!eeprom_is_initialized_block(__p, __n)) ebb6: 0e 94 bb 5b call 0xb776 ; 0xb776 ebba: 81 11 cpse r24, r1 ebbc: 0b c0 rjmp .+22 ; 0xebd4 #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); ebbe: a8 01 movw r20, r16 ebc0: be 01 movw r22, r28 ebc2: 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); } ebc4: df 91 pop r29 ebc6: cf 91 pop r28 ebc8: 1f 91 pop r17 ebca: 0f 91 pop r16 ebcc: ff 90 pop r15 ebce: 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); ebd0: 0d 94 30 dc jmp 0x3b860 ; 0x3b860 } 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); } ebd4: df 91 pop r29 ebd6: cf 91 pop r28 ebd8: 1f 91 pop r17 ebda: 0f 91 pop r16 ebdc: ff 90 pop r15 ebde: ef 90 pop r14 ebe0: 08 95 ret 0000ebe2 : return def; } return val; } uint16_t __attribute__((noinline)) eeprom_init_default_word(uint16_t *__p, uint16_t def) { ebe2: 0f 93 push r16 ebe4: 1f 93 push r17 ebe6: cf 93 push r28 ebe8: df 93 push r29 ebea: 8c 01 movw r16, r24 ebec: d6 2f mov r29, r22 ebee: c7 2f mov r28, r23 uint16_t val = eeprom_read_word(__p); ebf0: 0f 94 2a dc call 0x3b854 ; 0x3b854 if (val == EEPROM_EMPTY_VALUE16) { ebf4: 8f 3f cpi r24, 0xFF ; 255 ebf6: 98 07 cpc r25, r24 ebf8: 39 f4 brne .+14 ; 0xec08 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); ebfa: 6d 2f mov r22, r29 ebfc: 7c 2f mov r23, r28 ebfe: c8 01 movw r24, r16 ec00: 0f 94 7a dc call 0x3b8f4 ; 0x3b8f4 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; ec04: 8d 2f mov r24, r29 ec06: 9c 2f mov r25, r28 } return val; } ec08: df 91 pop r29 ec0a: cf 91 pop r28 ec0c: 1f 91 pop r17 ec0e: 0f 91 pop r16 ec10: 08 95 ret 0000ec12 : 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) { ec12: 0f 93 push r16 ec14: 1f 93 push r17 ec16: cf 93 push r28 ec18: 8c 01 movw r16, r24 ec1a: c6 2f mov r28, r22 uint8_t val = eeprom_read_byte(__p); ec1c: 0f 94 1c dc call 0x3b838 ; 0x3b838 if (val == EEPROM_EMPTY_VALUE) { ec20: 8f 3f cpi r24, 0xFF ; 255 ec22: 29 f4 brne .+10 ; 0xec2e 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); ec24: 6c 2f mov r22, r28 ec26: c8 01 movw r24, r16 ec28: 0f 94 64 dc call 0x3b8c8 ; 0x3b8c8 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; ec2c: 8c 2f mov r24, r28 } return val; } ec2e: cf 91 pop r28 ec30: 1f 91 pop r17 ec32: 0f 91 pop r16 ec34: 08 95 ret 0000ec36 : 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) { ec36: cf 93 push r28 ec38: df 93 push r29 ec3a: ec 01 movw r28, r24 eeprom_write_word_notify(__p, eeprom_read_word(__p) + 1); ec3c: 0f 94 2a dc call 0x3b854 ; 0x3b854 ec40: bc 01 movw r22, r24 ec42: 6f 5f subi r22, 0xFF ; 255 ec44: 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); ec46: 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); } ec48: df 91 pop r29 ec4a: 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); ec4c: 0d 94 7a dc jmp 0x3b8f4 ; 0x3b8f4 0000ec50 : void eeprom_toggle(uint8_t *__p) { eeprom_write_byte_notify(__p, !eeprom_read_byte(__p)); } void __attribute__((noinline)) eeprom_increment_byte(uint8_t *__p) { ec50: cf 93 push r28 ec52: df 93 push r29 ec54: ec 01 movw r28, r24 eeprom_write_byte_notify(__p, eeprom_read_byte(__p) + 1); ec56: 0f 94 1c dc call 0x3b838 ; 0x3b838 ec5a: 61 e0 ldi r22, 0x01 ; 1 ec5c: 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); ec5e: 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); } ec60: df 91 pop r29 ec62: 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); ec64: 0d 94 64 dc jmp 0x3b8c8 ; 0x3b8c8 0000ec68 : while (__n--) { eeprom_update_byte_notify(dst++, pgm_read_byte(src++)); } } void eeprom_toggle(uint8_t *__p) { ec68: cf 93 push r28 ec6a: df 93 push r29 ec6c: ec 01 movw r28, r24 eeprom_write_byte_notify(__p, !eeprom_read_byte(__p)); ec6e: 0f 94 1c dc call 0x3b838 ; 0x3b838 ec72: 61 e0 ldi r22, 0x01 ; 1 ec74: 81 11 cpse r24, r1 ec76: 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); ec78: ce 01 movw r24, r28 } } void eeprom_toggle(uint8_t *__p) { eeprom_write_byte_notify(__p, !eeprom_read_byte(__p)); } ec7a: df 91 pop r29 ec7c: 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); ec7e: 0d 94 64 dc jmp 0x3b8c8 ; 0x3b8c8 0000ec82 : 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); ec82: 2b e0 ldi r18, 0x0B ; 11 ec84: 82 9f mul r24, r18 ec86: c0 01 movw r24, r0 ec88: 11 24 eor r1, r1 ec8a: 80 5b subi r24, 0xB0 ; 176 ec8c: 92 4f sbci r25, 0xF2 ; 242 ec8e: 0f 94 2a dc call 0x3b854 ; 0x3b854 ec92: 21 e0 ldi r18, 0x01 ; 1 ec94: 01 96 adiw r24, 0x01 ; 1 ec96: 09 f4 brne .+2 ; 0xec9a ec98: 20 e0 ldi r18, 0x00 ; 0 } ec9a: 82 2f mov r24, r18 ec9c: 08 95 ret 0000ec9e : //! //! @param sheet Current sheet //! @return next initialized sheet //! @retval -1 no sheet is initialized int8_t eeprom_next_initialized_sheet(int8_t sheet) { ec9e: cf 93 push r28 eca0: df 93 push r29 eca2: c8 2f mov r28, r24 eca4: d8 e0 ldi r29, 0x08 ; 8 for (int8_t i = 0; i < static_cast(sizeof(Sheets::s)/sizeof(Sheet)); ++i) { ++sheet; eca6: cf 5f subi r28, 0xFF ; 255 if (sheet >= static_cast(sizeof(Sheets::s)/sizeof(Sheet))) sheet = 0; eca8: c8 30 cpi r28, 0x08 ; 8 ecaa: 0c f0 brlt .+2 ; 0xecae ecac: c0 e0 ldi r28, 0x00 ; 0 if (eeprom_is_sheet_initialized(sheet)) return sheet; ecae: 8c 2f mov r24, r28 ecb0: 0e 94 41 76 call 0xec82 ; 0xec82 ecb4: 81 11 cpse r24, r1 ecb6: 03 c0 rjmp .+6 ; 0xecbe ecb8: 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) ecba: a9 f7 brne .-22 ; 0xeca6 { ++sheet; if (sheet >= static_cast(sizeof(Sheets::s)/sizeof(Sheet))) sheet = 0; if (eeprom_is_sheet_initialized(sheet)) return sheet; } return -1; ecbc: cf ef ldi r28, 0xFF ; 255 } ecbe: 8c 2f mov r24, r28 ecc0: df 91 pop r29 ecc2: cf 91 pop r28 ecc4: 08 95 ret 0000ecc6 : #endif //DEBUG_EEPROM_CHANGES } void eeprom_switch_to_next_sheet() { int8_t sheet = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); ecc6: 81 ea ldi r24, 0xA1 ; 161 ecc8: 9d e0 ldi r25, 0x0D ; 13 ecca: 0f 94 1c dc call 0x3b838 ; 0x3b838 sheet = eeprom_next_initialized_sheet(sheet); ecce: 0e 94 4f 76 call 0xec9e ; 0xec9e if (sheet >= 0) eeprom_update_byte_notify(&(EEPROM_Sheets_base->active_sheet), sheet); ecd2: 87 fd sbrc r24, 7 ecd4: 05 c0 rjmp .+10 ; 0xece0 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); ecd6: 68 2f mov r22, r24 ecd8: 81 ea ldi r24, 0xA1 ; 161 ecda: 9d e0 ldi r25, 0x0D ; 13 ecdc: 0d 94 40 dc jmp 0x3b880 ; 0x3b880 { 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); } ece0: 08 95 ret 0000ece2 : //! | 7 | Custom2 | //! //! @param[in] index //! @param[out] sheetName void eeprom_default_sheet_name(uint8_t index, SheetName &sheetName) { ece2: 0f 93 push r16 ece4: 1f 93 push r17 ece6: cf 93 push r28 ece8: c8 2f mov r28, r24 ecea: 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")); ecec: 62 e1 ldi r22, 0x12 ; 18 ecee: 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) ecf0: 82 30 cpi r24, 0x02 ; 2 ecf2: 70 f0 brcs .+28 ; 0xed10 { strcpy_P(sheetName.c, PSTR("Smooth")); } else if (index < 4) { strcpy_P(sheetName.c, PSTR("Textur")); ecf4: 6b e0 ldi r22, 0x0B ; 11 ecf6: 79 e7 ldi r23, 0x79 ; 121 if (index < 2) { strcpy_P(sheetName.c, PSTR("Smooth")); } else if (index < 4) ecf8: 84 30 cpi r24, 0x04 ; 4 ecfa: 50 f0 brcs .+20 ; 0xed10 { strcpy_P(sheetName.c, PSTR("Textur")); } else if (index < 5) { strcpy_P(sheetName.c, PSTR("Satin ")); ecfc: 63 e0 ldi r22, 0x03 ; 3 ecfe: 79 e7 ldi r23, 0x79 ; 121 } else if (index < 4) { strcpy_P(sheetName.c, PSTR("Textur")); } else if (index < 5) ed00: 84 30 cpi r24, 0x04 ; 4 ed02: 31 f0 breq .+12 ; 0xed10 { strcpy_P(sheetName.c, PSTR("Satin ")); } else if (index < 6) { strcpy_P(sheetName.c, PSTR("NylonPA")); ed04: 6b ef ldi r22, 0xFB ; 251 ed06: 78 e7 ldi r23, 0x78 ; 120 } else if (index < 5) { strcpy_P(sheetName.c, PSTR("Satin ")); } else if (index < 6) ed08: 85 30 cpi r24, 0x05 ; 5 ed0a: 11 f0 breq .+4 ; 0xed10 { strcpy_P(sheetName.c, PSTR("NylonPA")); } else { strcpy_P(sheetName.c, PSTR("Custom")); ed0c: 64 ef ldi r22, 0xF4 ; 244 ed0e: 78 e7 ldi r23, 0x78 ; 120 ed10: c8 01 movw r24, r16 ed12: 0f 94 d3 d9 call 0x3b3a6 ; 0x3b3a6 } if (index <4 || index >5) ed16: 8c ef ldi r24, 0xFC ; 252 ed18: 8c 0f add r24, r28 ed1a: 82 30 cpi r24, 0x02 ; 2 ed1c: 28 f0 brcs .+10 ; 0xed28 { sheetName.c[6] = '0' + ((index % 2)+1); ed1e: c1 70 andi r28, 0x01 ; 1 ed20: cf 5c subi r28, 0xCF ; 207 ed22: f8 01 movw r30, r16 ed24: c6 83 std Z+6, r28 ; 0x06 sheetName.c[7] = '\0'; ed26: 17 82 std Z+7, r1 ; 0x07 } } ed28: cf 91 pop r28 ed2a: 1f 91 pop r17 ed2c: 0f 91 pop r16 ed2e: 08 95 ret 0000ed30 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); ed30: 61 e0 ldi r22, 0x01 ; 1 ed32: 80 ec ldi r24, 0xC0 ; 192 ed34: 9f e0 ldi r25, 0x0F ; 15 ed36: 0f 94 40 dc call 0x3b880 ; 0x3b880 ed3a: 60 e0 ldi r22, 0x00 ; 0 ed3c: 8f eb ldi r24, 0xBF ; 191 ed3e: 9f e0 ldi r25, 0x0F ; 15 ed40: 0f 94 40 dc call 0x3b880 ; 0x3b880 ed44: 60 e0 ldi r22, 0x00 ; 0 ed46: 8e eb ldi r24, 0xBE ; 190 ed48: 9f e0 ldi r25, 0x0F ; 15 ed4a: 0f 94 40 dc call 0x3b880 ; 0x3b880 ed4e: 60 e0 ldi r22, 0x00 ; 0 ed50: 8d eb ldi r24, 0xBD ; 189 ed52: 9f e0 ldi r25, 0x0F ; 15 ed54: 0f 94 40 dc call 0x3b880 ; 0x3b880 ed58: 60 e0 ldi r22, 0x00 ; 0 ed5a: 8c eb ldi r24, 0xBC ; 188 ed5c: 9f e0 ldi r25, 0x0F ; 15 ed5e: 0d 94 40 dc jmp 0x3b880 ; 0x3b880 0000ed62 : } void print_hex_byte(uint8_t val) { ed62: cf 93 push r28 ed64: c8 2f mov r28, r24 print_hex_nibble(val >> 4); ed66: 82 95 swap r24 ed68: 8f 70 andi r24, 0x0F ; 15 ed6a: 0e 94 d5 63 call 0xc7aa ; 0xc7aa print_hex_nibble(val & 15); ed6e: 8c 2f mov r24, r28 ed70: 8f 70 andi r24, 0x0F ; 15 } ed72: cf 91 pop r28 } void print_hex_byte(uint8_t val) { print_hex_nibble(val >> 4); print_hex_nibble(val & 15); ed74: 0c 94 d5 63 jmp 0xc7aa ; 0xc7aa 0000ed78 : // 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) { ed78: 80 91 a3 10 lds r24, 0x10A3 ; 0x8010a3 ed7c: 90 91 a4 10 lds r25, 0x10A4 ; 0x8010a4 ed80: 18 16 cp r1, r24 ed82: 19 06 cpc r1, r25 ed84: 0c f0 brlt .+2 ; 0xed88 ed86: 43 c0 rjmp .+134 ; 0xee0e SERIAL_ECHO(serial_count); SERIAL_ECHOPGM(", bufsize "); SERIAL_ECHO(sizeof(cmdbuffer)); SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ if (-- buflen == 0) { ed88: 01 97 sbiw r24, 0x01 ; 1 ed8a: 90 93 a4 10 sts 0x10A4, r25 ; 0x8010a4 ed8e: 80 93 a3 10 sts 0x10A3, r24 ; 0x8010a3 ed92: 89 2b or r24, r25 ed94: a1 f4 brne .+40 ; 0xedbe // Empty buffer. if (serial_count == 0) ed96: 80 91 9e 10 lds r24, 0x109E ; 0x80109e ed9a: 90 91 9f 10 lds r25, 0x109F ; 0x80109f ed9e: 89 2b or r24, r25 eda0: 21 f4 brne .+8 ; 0xedaa // No serial communication is pending. Reset both pointers to zero. bufindw = 0; eda2: 10 92 a1 10 sts 0x10A1, r1 ; 0x8010a1 <_ZL7bufindw.lto_priv.550+0x1> eda6: 10 92 a0 10 sts 0x10A0, r1 ; 0x8010a0 <_ZL7bufindw.lto_priv.550> bufindr = bufindw; edaa: 80 91 a0 10 lds r24, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.550> edae: 90 91 a1 10 lds r25, 0x10A1 ; 0x8010a1 <_ZL7bufindw.lto_priv.550+0x1> edb2: 90 93 93 12 sts 0x1293, r25 ; 0x801293 edb6: 80 93 92 12 sts 0x1292, r24 ; 0x801292 SERIAL_ECHOPGM(" new command on the top: "); SERIAL_ECHO(cmdbuffer+bufindr+CMDHDRSIZE); SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ } return true; edba: 81 e0 ldi r24, 0x01 ; 1 edbc: 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) ; edbe: 80 91 92 12 lds r24, 0x1292 ; 0x801292 edc2: 90 91 93 12 lds r25, 0x1293 ; 0x801293 edc6: 03 96 adiw r24, 0x03 ; 3 edc8: fc 01 movw r30, r24 edca: eb 55 subi r30, 0x5B ; 91 edcc: ff 4e sbci r31, 0xEF ; 239 edce: 20 81 ld r18, Z edd0: 01 96 adiw r24, 0x01 ; 1 edd2: 21 11 cpse r18, r1 edd4: f9 cf rjmp .-14 ; 0xedc8 edd6: fc 01 movw r30, r24 edd8: eb 55 subi r30, 0x5B ; 91 edda: 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) ; eddc: 8d 3e cpi r24, 0xED ; 237 edde: 21 e0 ldi r18, 0x01 ; 1 ede0: 92 07 cpc r25, r18 ede2: 40 f4 brcc .+16 ; 0xedf4 ede4: 41 91 ld r20, Z+ ede6: 9c 01 movw r18, r24 ede8: 2f 5f subi r18, 0xFF ; 255 edea: 3f 4f sbci r19, 0xFF ; 255 edec: 41 11 cpse r20, r1 edee: e1 cf rjmp .-62 ; 0xedb2 edf0: c9 01 movw r24, r18 edf2: f4 cf rjmp .-24 ; 0xeddc // If the end of the buffer was empty, if (bufindr == sizeof(cmdbuffer)) { edf4: e5 ea ldi r30, 0xA5 ; 165 edf6: f0 e1 ldi r31, 0x10 ; 16 edf8: 8d 3e cpi r24, 0xED ; 237 edfa: 21 e0 ldi r18, 0x01 ; 1 edfc: 92 07 cpc r25, r18 edfe: c9 f6 brne .-78 ; 0xedb2 ee00: cf 01 movw r24, r30 ee02: 85 5a subi r24, 0xA5 ; 165 ee04: 90 41 sbci r25, 0x10 ; 16 // skip to the start and find the nonzero command. for (bufindr = 0; cmdbuffer[bufindr] == 0; ++ bufindr) ; ee06: 21 91 ld r18, Z+ ee08: 22 23 and r18, r18 ee0a: d1 f3 breq .-12 ; 0xee00 ee0c: d2 cf rjmp .-92 ; 0xedb2 SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ } return true; } return false; ee0e: 80 e0 ldi r24, 0x00 ; 0 } ee10: 08 95 ret 0000ee12 : 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; ee12: 80 91 99 04 lds r24, 0x0499 ; 0x800499 ee16: 90 91 9a 04 lds r25, 0x049A ; 0x80049a ee1a: 20 91 9b 04 lds r18, 0x049B ; 0x80049b ee1e: 30 91 9c 04 lds r19, 0x049C ; 0x80049c ee22: 82 1b sub r24, r18 ee24: 93 0b sbc r25, r19 } ee26: 8f 77 andi r24, 0x7F ; 127 ee28: 99 27 eor r25, r25 ee2a: 08 95 ret 0000ee2c : autostart_atmillis.start(); // reset timer } char *createFilename(char *buffer,const dir_t &p) //buffer>12characters { char *pos=buffer; ee2c: fc 01 movw r30, r24 for (uint8_t i = 0; i < 11; i++) ee2e: 20 e0 ldi r18, 0x00 ; 0 { if (p.name[i] == ' ')continue; if (i == 8) { *pos++='.'; ee30: 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; ee32: db 01 movw r26, r22 ee34: 4d 91 ld r20, X+ ee36: bd 01 movw r22, r26 ee38: 40 32 cpi r20, 0x20 ; 32 ee3a: 49 f0 breq .+18 ; 0xee4e if (i == 8) ee3c: 28 30 cpi r18, 0x08 ; 8 ee3e: 11 f4 brne .+4 ; 0xee44 { *pos++='.'; ee40: 30 83 st Z, r19 ee42: 31 96 adiw r30, 0x01 ; 1 } *pos++=p.name[i]; ee44: db 01 movw r26, r22 ee46: 11 97 sbiw r26, 0x01 ; 1 ee48: 4c 91 ld r20, X ee4a: 40 83 st Z, r20 ee4c: 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++) ee4e: 2f 5f subi r18, 0xFF ; 255 ee50: 2b 30 cpi r18, 0x0B ; 11 ee52: 79 f7 brne .-34 ; 0xee32 { *pos++='.'; } *pos++=p.name[i]; } *pos++=0; ee54: 10 82 st Z, r1 return buffer; } ee56: 08 95 ret 0000ee58 : 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);} ee58: 40 e0 ldi r20, 0x00 ; 0 ee5a: 50 e0 ldi r21, 0x00 ; 0 ee5c: ba 01 movw r22, r20 ee5e: 0d 94 92 56 jmp 0x2ad24 ; 0x2ad24 0000ee62 : 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();} ee62: fc 01 movw r30, r24 ee64: 23 81 ldd r18, Z+3 ; 0x03 ee66: 21 11 cpse r18, r1 ee68: 0d 94 70 58 jmp 0x2b0e0 ; 0x2b0e0 ee6c: 08 95 ret 0000ee6e : M_UDRx = c; } */ static void write(uint8_t c) { if (selectedSerialPort == 0) ee6e: 90 91 39 05 lds r25, 0x0539 ; 0x800539 ee72: 91 11 cpse r25, r1 ee74: 07 c0 rjmp .+14 ; 0xee84 { while (!((M_UCSRxA) & (1 << M_UDREx))); ee76: 90 91 c0 00 lds r25, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> ee7a: 95 ff sbrs r25, 5 ee7c: fc cf rjmp .-8 ; 0xee76 M_UDRx = c; ee7e: 80 93 c6 00 sts 0x00C6, r24 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> ee82: 08 95 ret } else if (selectedSerialPort == 1) ee84: 91 30 cpi r25, 0x01 ; 1 ee86: 31 f4 brne .+12 ; 0xee94 { while (!((UCSR1A) & (1 << UDRE1))); ee88: 90 91 c8 00 lds r25, 0x00C8 ; 0x8000c8 <__TEXT_REGION_LENGTH__+0x7c20c8> ee8c: 95 ff sbrs r25, 5 ee8e: fc cf rjmp .-8 ; 0xee88 UDR1 = c; ee90: 80 93 ce 00 sts 0x00CE, r24 ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> } } ee94: 08 95 ret 0000ee96 : static FILE _uartout; #define uartout (&_uartout) int uart_putchar(char c, FILE *) { MYSERIAL.write(c); ee96: 0e 94 37 77 call 0xee6e ; 0xee6e return 0; } ee9a: 90 e0 ldi r25, 0x00 ; 0 ee9c: 80 e0 ldi r24, 0x00 ; 0 ee9e: 08 95 ret 0000eea0 : 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) { eea0: cf 93 push r28 eea2: df 93 push r29 eea4: ec 01 movw r28, r24 while(uint8_t ch = pgm_read_byte(str)) { eea6: fe 01 movw r30, r28 eea8: 84 91 lpm r24, Z eeaa: 88 23 and r24, r24 eeac: 21 f0 breq .+8 ; 0xeeb6 MYSERIAL.write((char)ch); eeae: 0e 94 37 77 call 0xee6e ; 0xee6e ++str; eeb2: 21 96 adiw r28, 0x01 ; 1 eeb4: f8 cf rjmp .-16 ; 0xeea6 } } eeb6: df 91 pop r29 eeb8: cf 91 pop r28 eeba: 08 95 ret 0000eebc : // Turn off the print fan fanSpeed = 0; } } void serialecho_temperatures() { eebc: cf 92 push r12 eebe: df 92 push r13 eec0: ef 92 push r14 eec2: 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]; eec4: c0 90 b0 0d lds r12, 0x0DB0 ; 0x800db0 eec8: d0 90 b1 0d lds r13, 0x0DB1 ; 0x800db1 eecc: e0 90 b2 0d lds r14, 0x0DB2 ; 0x800db2 eed0: f0 90 b3 0d lds r15, 0x0DB3 ; 0x800db3 float tt = degHotend(active_extruder); SERIAL_PROTOCOLPGM("T:"); eed4: 89 e2 ldi r24, 0x29 ; 41 eed6: 9e e7 ldi r25, 0x7E ; 126 eed8: 0e 94 50 77 call 0xeea0 ; 0xeea0 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); eedc: 42 e0 ldi r20, 0x02 ; 2 eede: c7 01 movw r24, r14 eee0: b6 01 movw r22, r12 eee2: 0f 94 87 d5 call 0x3ab0e ; 0x3ab0e SERIAL_PROTOCOL(tt); SERIAL_PROTOCOLPGM(" E:0 B:"); eee6: 81 e2 ldi r24, 0x21 ; 33 eee8: 9e e7 ldi r25, 0x7E ; 126 eeea: 0e 94 50 77 call 0xeea0 ; 0xeea0 eeee: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee eef2: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef eef6: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 eefa: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 eefe: 41 e0 ldi r20, 0x01 ; 1 ef00: 0f 94 87 d5 call 0x3ab0e ; 0x3ab0e SERIAL_PROTOCOL_F(degBed(), 1); SERIAL_PROTOCOLLN(); } ef04: ff 90 pop r15 ef06: ef 90 pop r14 ef08: df 90 pop r13 ef0a: 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(); ef0c: 0d 94 fd d5 jmp 0x3abfa ; 0x3abfa 0000ef10 : } } /// @brief Helper function to reduce code size in M861 /// by extracting common code into one function static void gcode_M861_print_pinda_cal_eeprom() { ef10: 4f 92 push r4 ef12: 5f 92 push r5 ef14: 6f 92 push r6 ef16: 7f 92 push r7 ef18: 8f 92 push r8 ef1a: 9f 92 push r9 ef1c: af 92 push r10 ef1e: bf 92 push r11 ef20: cf 92 push r12 ef22: df 92 push r13 ef24: ef 92 push r14 ef26: ff 92 push r15 ef28: 0f 93 push r16 ef2a: 1f 93 push r17 ef2c: cf 93 push r28 ef2e: df 93 push r29 ef30: cc 24 eor r12, r12 ef32: ca 94 dec r12 ef34: dc 2c mov r13, r12 ef36: 76 01 movw r14, r12 ef38: 0e ea ldi r16, 0xAE ; 174 ef3a: 1f e0 ldi r17, 0x0F ; 15 ef3c: 93 e2 ldi r25, 0x23 ; 35 ef3e: 89 2e mov r8, r25 ef40: 91 2c mov r9, r1 ef42: a1 2c mov r10, r1 ef44: b1 2c mov r11, r1 int16_t usteps = 0; float mm = 0; ef46: 41 2c mov r4, r1 ef48: 51 2c mov r5, r1 ef4a: 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; ef4c: d0 e0 ldi r29, 0x00 ; 0 ef4e: 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) { ef50: 8f ef ldi r24, 0xFF ; 255 ef52: c8 16 cp r12, r24 ef54: 09 f4 brne .+2 ; 0xef58 ef56: 5d c0 rjmp .+186 ; 0xf012 usteps = eeprom_read_word((uint16_t*) EEPROM_PROBE_TEMP_SHIFT + (i - 1)); ef58: c8 01 movw r24, r16 ef5a: 0f 94 2a dc call 0x3b854 ; 0x3b854 ef5e: ec 01 movw r28, r24 mm = ((float)usteps) / cs.axis_steps_per_mm[Z_AXIS]; ef60: bc 01 movw r22, r24 ef62: 99 0f add r25, r25 ef64: 88 0b sbc r24, r24 ef66: 99 0b sbc r25, r25 ef68: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> ef6c: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca ef70: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb ef74: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc ef78: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd ef7c: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> ef80: 2b 01 movw r4, r22 ef82: 3c 01 movw r6, r24 ef84: c7 01 movw r24, r14 ef86: b6 01 movw r22, r12 ef88: 0f 94 6b d5 call 0x3aad6 ; 0x3aad6 SERIAL_PROTOCOL(i - 1); } else { SERIAL_PROTOCOLRPGM(MSG_NA); } SERIAL_PROTOCOLRPGM(comma_sep); ef8c: 8d e7 ldi r24, 0x7D ; 125 ef8e: 9d e7 ldi r25, 0x7D ; 125 ef90: 0e 94 50 77 call 0xeea0 ; 0xeea0 ef94: c5 01 movw r24, r10 ef96: b4 01 movw r22, r8 ef98: 0f 94 6b d5 call 0x3aad6 ; 0x3aad6 SERIAL_PROTOCOL(35 + (i * 5)); SERIAL_PROTOCOLRPGM(comma_sep); ef9c: 8d e7 ldi r24, 0x7D ; 125 ef9e: 9d e7 ldi r25, 0x7D ; 125 efa0: 0e 94 50 77 call 0xeea0 ; 0xeea0 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); efa4: be 01 movw r22, r28 efa6: 0d 2e mov r0, r29 efa8: 00 0c add r0, r0 efaa: 88 0b sbc r24, r24 efac: 99 0b sbc r25, r25 efae: 0f 94 6b d5 call 0x3aad6 ; 0x3aad6 SERIAL_PROTOCOL(usteps); SERIAL_PROTOCOLRPGM(comma_sep); efb2: 8d e7 ldi r24, 0x7D ; 125 efb4: 9d e7 ldi r25, 0x7D ; 125 efb6: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_PROTOCOLLN(mm * 1000); efba: 20 e0 ldi r18, 0x00 ; 0 efbc: 30 e0 ldi r19, 0x00 ; 0 efbe: 4a e7 ldi r20, 0x7A ; 122 efc0: 54 e4 ldi r21, 0x44 ; 68 efc2: c3 01 movw r24, r6 efc4: b2 01 movw r22, r4 efc6: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> efca: 0f 94 b4 74 call 0x2e968 ; 0x2e968 efce: 85 e0 ldi r24, 0x05 ; 5 efd0: 88 0e add r8, r24 efd2: 91 1c adc r9, r1 efd4: a1 1c adc r10, r1 efd6: b1 1c adc r11, r1 efd8: 0e 5f subi r16, 0xFE ; 254 efda: 1f 4f sbci r17, 0xFF ; 255 efdc: 8f ef ldi r24, 0xFF ; 255 efde: c8 1a sub r12, r24 efe0: d8 0a sbc r13, r24 efe2: e8 0a sbc r14, r24 efe4: 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++) { efe6: 0a 3b cpi r16, 0xBA ; 186 efe8: 8f e0 ldi r24, 0x0F ; 15 efea: 18 07 cpc r17, r24 efec: 09 f0 breq .+2 ; 0xeff0 efee: b0 cf rjmp .-160 ; 0xef50 SERIAL_PROTOCOLRPGM(comma_sep); SERIAL_PROTOCOL(usteps); SERIAL_PROTOCOLRPGM(comma_sep); SERIAL_PROTOCOLLN(mm * 1000); } } eff0: df 91 pop r29 eff2: cf 91 pop r28 eff4: 1f 91 pop r17 eff6: 0f 91 pop r16 eff8: ff 90 pop r15 effa: ef 90 pop r14 effc: df 90 pop r13 effe: cf 90 pop r12 f000: bf 90 pop r11 f002: af 90 pop r10 f004: 9f 90 pop r9 f006: 8f 90 pop r8 f008: 7f 90 pop r7 f00a: 6f 90 pop r6 f00c: 5f 90 pop r5 f00e: 4f 90 pop r4 f010: 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); f012: 86 ee ldi r24, 0xE6 ; 230 f014: 97 e4 ldi r25, 0x47 ; 71 f016: 0e 94 50 77 call 0xeea0 ; 0xeea0 f01a: b8 cf rjmp .-144 ; 0xef8c 0000f01c : /// @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) { f01c: 88 23 and r24, r24 f01e: 71 f1 breq .+92 ; 0xf07c currentMMUSlot = slot; } uint8_t SpoolJoin::nextSlot() { SERIAL_ECHOPGM("SpoolJoin: "); f020: 81 e7 ldi r24, 0x71 ; 113 f022: 9d e7 ldi r25, 0x7D ; 125 f024: 0e 94 50 77 call 0xeea0 ; 0xeea0 f028: 60 91 49 13 lds r22, 0x1349 ; 0x801349 f02c: 70 e0 ldi r23, 0x00 ; 0 f02e: 90 e0 ldi r25, 0x00 ; 0 f030: 80 e0 ldi r24, 0x00 ; 0 f032: 0f 94 6b d5 call 0x3aad6 ; 0x3aad6 SERIAL_ECHO((int)currentMMUSlot); if (currentMMUSlot >= 4) currentMMUSlot = 0; f036: 80 91 49 13 lds r24, 0x1349 ; 0x801349 f03a: 84 30 cpi r24, 0x04 ; 4 f03c: d8 f0 brcs .+54 ; 0xf074 f03e: 10 92 49 13 sts 0x1349, r1 ; 0x801349 else currentMMUSlot++; SERIAL_ECHOPGM(" -> "); f042: 8c e6 ldi r24, 0x6C ; 108 f044: 9d e7 ldi r25, 0x7D ; 125 f046: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHOLN((int)currentMMUSlot); f04a: 80 91 49 13 lds r24, 0x1349 ; 0x801349 f04e: 90 e0 ldi r25, 0x00 ; 0 f050: 0f 94 f5 74 call 0x2e9ea ; 0x2e9ea return currentMMUSlot; f054: 80 91 49 13 lds r24, 0x1349 ; 0x801349 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; f058: 20 91 ac 05 lds r18, 0x05AC ; 0x8005ac f05c: 30 91 ad 05 lds r19, 0x05AD ; 0x8005ad f060: 30 93 b7 0d sts 0x0DB7, r19 ; 0x800db7 f064: 20 93 b6 0d sts 0x0DB6, r18 ; 0x800db6 slot = choose_menu_P(_T(MSG_SELECT_FILAMENT), MSG_FILAMENT); } setTargetHotend(saved_extruder_temperature); MMU2::mmu2.load_filament_to_nozzle(slot); f068: 0f 94 b0 0e call 0x21d60 ; 0x21d60 load_filament_final_feed(); // @@TODO verify f06c: 0e 94 93 64 call 0xc926 ; 0xc926 st_synchronize(); f070: 0d 94 e8 42 jmp 0x285d0 ; 0x285d0 { SERIAL_ECHOPGM("SpoolJoin: "); SERIAL_ECHO((int)currentMMUSlot); if (currentMMUSlot >= 4) currentMMUSlot = 0; else currentMMUSlot++; f074: 8f 5f subi r24, 0xFF ; 255 f076: 80 93 49 13 sts 0x1349, r24 ; 0x801349 f07a: e3 cf rjmp .-58 ; 0xf042 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); f07c: 8d ea ldi r24, 0xAD ; 173 f07e: 9b e3 ldi r25, 0x3B ; 59 f080: 0e 94 ac 72 call 0xe558 ; 0xe558 f084: 70 e0 ldi r23, 0x00 ; 0 f086: 60 e0 ldi r22, 0x00 ; 0 f088: 0e 94 01 e4 call 0x1c802 ; 0x1c802 f08c: e5 cf rjmp .-54 ; 0xf058 0000f08e : return final_result; } void gcode_M114() { f08e: cf 93 push r28 f090: df 93 push r29 SERIAL_PROTOCOLPGM("X:"); f092: 89 e6 ldi r24, 0x69 ; 105 f094: 9d e7 ldi r25, 0x7D ; 125 f096: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_PROTOCOL(current_position[X_AXIS]); f09a: c2 e9 ldi r28, 0x92 ; 146 f09c: d6 e0 ldi r29, 0x06 ; 6 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); f09e: 68 81 ld r22, Y f0a0: 79 81 ldd r23, Y+1 ; 0x01 f0a2: 8a 81 ldd r24, Y+2 ; 0x02 f0a4: 9b 81 ldd r25, Y+3 ; 0x03 f0a6: 42 e0 ldi r20, 0x02 ; 2 f0a8: 0f 94 87 d5 call 0x3ab0e ; 0x3ab0e SERIAL_PROTOCOLPGM(" Y:"); f0ac: 85 e6 ldi r24, 0x65 ; 101 f0ae: 9d e7 ldi r25, 0x7D ; 125 f0b0: 0e 94 50 77 call 0xeea0 ; 0xeea0 f0b4: 6c 81 ldd r22, Y+4 ; 0x04 f0b6: 7d 81 ldd r23, Y+5 ; 0x05 f0b8: 8e 81 ldd r24, Y+6 ; 0x06 f0ba: 9f 81 ldd r25, Y+7 ; 0x07 f0bc: 42 e0 ldi r20, 0x02 ; 2 f0be: 0f 94 87 d5 call 0x3ab0e ; 0x3ab0e SERIAL_PROTOCOL(current_position[Y_AXIS]); SERIAL_PROTOCOLPGM(" Z:"); f0c2: 81 e6 ldi r24, 0x61 ; 97 f0c4: 9d e7 ldi r25, 0x7D ; 125 f0c6: 0e 94 50 77 call 0xeea0 ; 0xeea0 f0ca: 68 85 ldd r22, Y+8 ; 0x08 f0cc: 79 85 ldd r23, Y+9 ; 0x09 f0ce: 8a 85 ldd r24, Y+10 ; 0x0a f0d0: 9b 85 ldd r25, Y+11 ; 0x0b f0d2: 42 e0 ldi r20, 0x02 ; 2 f0d4: 0f 94 87 d5 call 0x3ab0e ; 0x3ab0e SERIAL_PROTOCOL(current_position[Z_AXIS]); SERIAL_PROTOCOLPGM(" E:"); f0d8: 8d e5 ldi r24, 0x5D ; 93 f0da: 9d e7 ldi r25, 0x7D ; 125 f0dc: 0e 94 50 77 call 0xeea0 ; 0xeea0 f0e0: 6c 85 ldd r22, Y+12 ; 0x0c f0e2: 7d 85 ldd r23, Y+13 ; 0x0d f0e4: 8e 85 ldd r24, Y+14 ; 0x0e f0e6: 9f 85 ldd r25, Y+15 ; 0x0f f0e8: 42 e0 ldi r20, 0x02 ; 2 f0ea: 0f 94 87 d5 call 0x3ab0e ; 0x3ab0e SERIAL_PROTOCOL(current_position[E_AXIS]); SERIAL_PROTOCOLRPGM(_n(" Count X: "));////MSG_COUNT_X f0ee: 85 e3 ldi r24, 0x35 ; 53 f0f0: 96 e6 ldi r25, 0x66 ; 102 f0f2: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_PROTOCOL(float(st_get_position(X_AXIS)) / cs.axis_steps_per_mm[X_AXIS]); f0f6: 80 e0 ldi r24, 0x00 ; 0 f0f8: 0f 94 c6 42 call 0x2858c ; 0x2858c f0fc: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> f100: ce eb ldi r28, 0xBE ; 190 f102: dd e0 ldi r29, 0x0D ; 13 f104: 2c 81 ldd r18, Y+4 ; 0x04 f106: 3d 81 ldd r19, Y+5 ; 0x05 f108: 4e 81 ldd r20, Y+6 ; 0x06 f10a: 5f 81 ldd r21, Y+7 ; 0x07 f10c: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> f110: 42 e0 ldi r20, 0x02 ; 2 f112: 0f 94 87 d5 call 0x3ab0e ; 0x3ab0e SERIAL_PROTOCOLPGM(" Y:"); f116: 89 e5 ldi r24, 0x59 ; 89 f118: 9d e7 ldi r25, 0x7D ; 125 f11a: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_PROTOCOL(float(st_get_position(Y_AXIS)) / cs.axis_steps_per_mm[Y_AXIS]); f11e: 81 e0 ldi r24, 0x01 ; 1 f120: 0f 94 c6 42 call 0x2858c ; 0x2858c f124: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> f128: 28 85 ldd r18, Y+8 ; 0x08 f12a: 39 85 ldd r19, Y+9 ; 0x09 f12c: 4a 85 ldd r20, Y+10 ; 0x0a f12e: 5b 85 ldd r21, Y+11 ; 0x0b f130: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> f134: 42 e0 ldi r20, 0x02 ; 2 f136: 0f 94 87 d5 call 0x3ab0e ; 0x3ab0e SERIAL_PROTOCOLPGM(" Z:"); f13a: 85 e5 ldi r24, 0x55 ; 85 f13c: 9d e7 ldi r25, 0x7D ; 125 f13e: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_PROTOCOL(float(st_get_position(Z_AXIS)) / cs.axis_steps_per_mm[Z_AXIS]); f142: 82 e0 ldi r24, 0x02 ; 2 f144: 0f 94 c6 42 call 0x2858c ; 0x2858c f148: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> f14c: 2c 85 ldd r18, Y+12 ; 0x0c f14e: 3d 85 ldd r19, Y+13 ; 0x0d f150: 4e 85 ldd r20, Y+14 ; 0x0e f152: 5f 85 ldd r21, Y+15 ; 0x0f f154: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> f158: 42 e0 ldi r20, 0x02 ; 2 f15a: 0f 94 87 d5 call 0x3ab0e ; 0x3ab0e SERIAL_PROTOCOLPGM(" E:"); f15e: 81 e5 ldi r24, 0x51 ; 81 f160: 9d e7 ldi r25, 0x7D ; 125 f162: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_PROTOCOLLN(float(st_get_position(E_AXIS)) / cs.axis_steps_per_mm[E_AXIS]); f166: 83 e0 ldi r24, 0x03 ; 3 f168: 0f 94 c6 42 call 0x2858c ; 0x2858c f16c: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> f170: 28 89 ldd r18, Y+16 ; 0x10 f172: 39 89 ldd r19, Y+17 ; 0x11 f174: 4a 89 ldd r20, Y+18 ; 0x12 f176: 5b 89 ldd r21, Y+19 ; 0x13 f178: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> } f17c: df 91 pop r29 f17e: 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]); f180: 0d 94 b4 74 jmp 0x2e968 ; 0x2e968 0000f184 : #endif //TMC2130 void gcode_M105() { #if defined(TEMP_0_PIN) && TEMP_0_PIN > -1 SERIAL_PROTOCOLPGM("T:"); f184: 80 e6 ldi r24, 0x60 ; 96 f186: 9c e7 ldi r25, 0x7C ; 124 f188: 0e 94 50 77 call 0xeea0 ; 0xeea0 f18c: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 f190: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 f194: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 f198: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 f19c: 41 e0 ldi r20, 0x01 ; 1 f19e: 0f 94 87 d5 call 0x3ab0e ; 0x3ab0e SERIAL_PROTOCOL_F(degHotend(active_extruder),1); SERIAL_PROTOCOLPGM(" /"); f1a2: 8d e5 ldi r24, 0x5D ; 93 f1a4: 9c e7 ldi r25, 0x7C ; 124 f1a6: 0e 94 50 77 call 0xeea0 ; 0xeea0 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; f1aa: 60 91 b6 0d lds r22, 0x0DB6 ; 0x800db6 f1ae: 70 91 b7 0d lds r23, 0x0DB7 ; 0x800db7 f1b2: 07 2e mov r0, r23 f1b4: 00 0c add r0, r0 f1b6: 88 0b sbc r24, r24 f1b8: 99 0b sbc r25, r25 f1ba: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> f1be: 41 e0 ldi r20, 0x01 ; 1 f1c0: 0f 94 87 d5 call 0x3ab0e ; 0x3ab0e SERIAL_PROTOCOL_F(degTargetHotend(active_extruder),1); #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1 SERIAL_PROTOCOLPGM(" B:"); f1c4: 89 e5 ldi r24, 0x59 ; 89 f1c6: 9c e7 ldi r25, 0x7C ; 124 f1c8: 0e 94 50 77 call 0xeea0 ; 0xeea0 f1cc: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee f1d0: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef f1d4: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 f1d8: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 f1dc: 41 e0 ldi r20, 0x01 ; 1 f1de: 0f 94 87 d5 call 0x3ab0e ; 0x3ab0e SERIAL_PROTOCOL_F(degBed(),1); SERIAL_PROTOCOLPGM(" /"); f1e2: 86 e5 ldi r24, 0x56 ; 86 f1e4: 9c e7 ldi r25, 0x7C ; 124 f1e6: 0e 94 50 77 call 0xeea0 ; 0xeea0 }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; f1ea: 60 91 72 06 lds r22, 0x0672 ; 0x800672 f1ee: 70 91 73 06 lds r23, 0x0673 ; 0x800673 f1f2: 07 2e mov r0, r23 f1f4: 00 0c add r0, r0 f1f6: 88 0b sbc r24, r24 f1f8: 99 0b sbc r25, r25 f1fa: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> f1fe: 41 e0 ldi r20, 0x01 ; 1 f200: 0f 94 87 d5 call 0x3ab0e ; 0x3ab0e SERIAL_PROTOCOL_F(degTargetBed(),1); #endif //TEMP_BED_PIN SERIAL_PROTOCOLPGM(" T0:"); f204: 81 e5 ldi r24, 0x51 ; 81 f206: 9c e7 ldi r25, 0x7C ; 124 f208: 0e 94 50 77 call 0xeea0 ; 0xeea0 f20c: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 f210: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 f214: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 f218: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 f21c: 41 e0 ldi r20, 0x01 ; 1 f21e: 0f 94 87 d5 call 0x3ab0e ; 0x3ab0e SERIAL_PROTOCOL_F(degHotend(active_extruder),1); SERIAL_PROTOCOLPGM(" /"); f222: 8e e4 ldi r24, 0x4E ; 78 f224: 9c e7 ldi r25, 0x7C ; 124 f226: 0e 94 50 77 call 0xeea0 ; 0xeea0 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; f22a: 60 91 b6 0d lds r22, 0x0DB6 ; 0x800db6 f22e: 70 91 b7 0d lds r23, 0x0DB7 ; 0x800db7 f232: 07 2e mov r0, r23 f234: 00 0c add r0, r0 f236: 88 0b sbc r24, r24 f238: 99 0b sbc r25, r25 f23a: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> f23e: 41 e0 ldi r20, 0x01 ; 1 f240: 0f 94 87 d5 call 0x3ab0e ; 0x3ab0e #else SERIAL_ERROR_START; SERIAL_ERRORLNRPGM(_n("No thermistors - no temperature"));////MSG_ERR_NO_THERMISTORS #endif SERIAL_PROTOCOLPGM(" @:"); f244: 8a e4 ldi r24, 0x4A ; 74 f246: 9c e7 ldi r25, 0x7C ; 124 f248: 0e 94 50 77 call 0xeea0 ; 0xeea0 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); f24c: 60 91 16 05 lds r22, 0x0516 ; 0x800516 <_ZL8soft_pwm.lto_priv.459> f250: 70 e0 ldi r23, 0x00 ; 0 f252: 90 e0 ldi r25, 0x00 ; 0 f254: 80 e0 ldi r24, 0x00 ; 0 f256: 0f 94 6b d5 call 0x3aad6 ; 0x3aad6 SERIAL_PROTOCOLPGM("W"); #else SERIAL_PROTOCOL(getHeaterPower(active_extruder)); #endif SERIAL_PROTOCOLPGM(" B@:"); f25a: 85 e4 ldi r24, 0x45 ; 69 f25c: 9c e7 ldi r25, 0x7C ; 124 f25e: 0e 94 50 77 call 0xeea0 ; 0xeea0 f262: 60 91 1d 06 lds r22, 0x061D ; 0x80061d f266: 70 e0 ldi r23, 0x00 ; 0 f268: 90 e0 ldi r25, 0x00 ; 0 f26a: 80 e0 ldi r24, 0x00 ; 0 f26c: 0f 94 6b d5 call 0x3aad6 ; 0x3aad6 #else SERIAL_PROTOCOL(getHeaterPower(-1)); #endif #ifdef PINDA_THERMISTOR SERIAL_PROTOCOLPGM(" P:"); f270: 81 e4 ldi r24, 0x41 ; 65 f272: 9c e7 ldi r25, 0x7C ; 124 f274: 0e 94 50 77 call 0xeea0 ; 0xeea0 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); f278: 60 91 99 03 lds r22, 0x0399 ; 0x800399 f27c: 70 91 9a 03 lds r23, 0x039A ; 0x80039a f280: 80 91 9b 03 lds r24, 0x039B ; 0x80039b f284: 90 91 9c 03 lds r25, 0x039C ; 0x80039c f288: 41 e0 ldi r20, 0x01 ; 1 f28a: 0f 94 87 d5 call 0x3ab0e ; 0x3ab0e SERIAL_PROTOCOL_F(current_temperature_pinda,1); #endif //PINDA_THERMISTOR #ifdef AMBIENT_THERMISTOR SERIAL_PROTOCOLPGM(" A:"); f28e: 8d e3 ldi r24, 0x3D ; 61 f290: 9c e7 ldi r25, 0x7C ; 124 f292: 0e 94 50 77 call 0xeea0 ; 0xeea0 f296: 60 91 56 06 lds r22, 0x0656 ; 0x800656 f29a: 70 91 57 06 lds r23, 0x0657 ; 0x800657 f29e: 80 91 58 06 lds r24, 0x0658 ; 0x800658 f2a2: 90 91 59 06 lds r25, 0x0659 ; 0x800659 f2a6: 41 e0 ldi r20, 0x01 ; 1 f2a8: 0f 94 87 d5 call 0x3ab0e ; 0x3ab0e SERIAL_PROTOCOL_F(100 * (1 + (PtA * (raw/OVERSAMPLENR)) + (PtB * sq((raw/OVERSAMPLENR)))), 5); SERIAL_PROTOCOLPGM(" Rx0->"); SERIAL_PROTOCOL_F(raw, 5); } #endif SERIAL_PROTOCOLLN(); f2ac: 0d 94 fd d5 jmp 0x3abfa ; 0x3abfa 0000f2b0 : } } 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); } f2b0: 20 91 88 14 lds r18, 0x1488 ; 0x801488 f2b4: 30 e0 ldi r19, 0x00 ; 0 f2b6: a8 ee ldi r26, 0xE8 ; 232 f2b8: b3 e0 ldi r27, 0x03 ; 3 f2ba: 0f 94 bc dc call 0x3b978 ; 0x3b978 <__umulhisi3> f2be: ab 01 movw r20, r22 f2c0: bc 01 movw r22, r24 f2c2: 89 e8 ldi r24, 0x89 ; 137 f2c4: 94 e1 ldi r25, 0x14 ; 20 f2c6: 0f 94 30 2a call 0x25460 ; 0x25460 ::expired(unsigned long)> * Output autoreport values according to features requested in M155 */ #if defined(AUTO_REPORT) void host_autoreport() { if (autoReportFeatures.TimerExpired()) f2ca: 88 23 and r24, r24 f2cc: 99 f0 breq .+38 ; 0xf2f4 f2ce: 80 91 87 14 lds r24, 0x1487 ; 0x801487 { if(autoReportFeatures.Temp()){ f2d2: 80 fd sbrc r24, 0 gcode_M105(); f2d4: 0e 94 c2 78 call 0xf184 ; 0xf184 f2d8: 80 91 87 14 lds r24, 0x1487 ; 0x801487 } if(autoReportFeatures.Pos()){ f2dc: 82 fd sbrc r24, 2 gcode_M114(); f2de: 0e 94 47 78 call 0xf08e ; 0xf08e f2e2: 80 91 87 14 lds r24, 0x1487 ; 0x801487 } #if defined(AUTO_REPORT) && (defined(FANCHECK) && (((defined(TACH_0) && (TACH_0 >-1)) || (defined(TACH_1) && (TACH_1 > -1))))) if(autoReportFeatures.Fans()){ f2e6: 81 fd sbrc r24, 1 gcode_M123(); f2e8: 0e 94 84 66 call 0xcd08 ; 0xcd08 } else{ auto_report_timer.stop(); } } inline void TimerStart() { auto_report_timer.start(); } f2ec: 89 e8 ldi r24, 0x89 ; 137 f2ee: 94 e1 ldi r25, 0x14 ; 20 f2f0: 0d 94 ef 2b jmp 0x257de ; 0x257de ::start()> gcode_M123(); } #endif //AUTO_REPORT and (FANCHECK and TACH_0 or TACH_1) autoReportFeatures.TimerStart(); } } f2f4: 08 95 ret 0000f2f6 : ++str; } } void serialprintlnPGM(const char *str) { serialprintPGM(str); f2f6: 0e 94 50 77 call 0xeea0 ; 0xeea0 MYSERIAL.println(); f2fa: 0d 94 fd d5 jmp 0x3abfa ; 0x3abfa 0000f2fe : #endif //TEMP_RESIDENCY_TIME } } void check_babystep() { f2fe: 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))); f300: 81 ea ldi r24, 0xA1 ; 161 f302: 9d e0 ldi r25, 0x0D ; 13 f304: 0f 94 1c dc call 0x3b838 ; 0x3b838 } } void check_babystep() { int babystep_z = eeprom_read_word(reinterpret_cast(&(EEPROM_Sheets_base-> f308: cb e0 ldi r28, 0x0B ; 11 f30a: 8c 9f mul r24, r28 f30c: c0 01 movw r24, r0 f30e: 11 24 eor r1, r1 f310: 80 5b subi r24, 0xB0 ; 176 f312: 92 4f sbci r25, 0xF2 ; 242 f314: 0f 94 2a dc call 0x3b854 ; 0x3b854 s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset))); if ((babystep_z < Z_BABYSTEP_MIN) || (babystep_z > Z_BABYSTEP_MAX)) { f318: 81 56 subi r24, 0x61 ; 97 f31a: 90 4f sbci r25, 0xF0 ; 240 f31c: 80 3a cpi r24, 0xA0 ; 160 f31e: 9f 40 sbci r25, 0x0F ; 15 f320: c8 f0 brcs .+50 ; 0xf354 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"); f322: 88 ef ldi r24, 0xF8 ; 248 f324: 9d e7 ldi r25, 0x7D ; 125 f326: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 eeprom_write_word_notify(reinterpret_cast(&(EEPROM_Sheets_base-> s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)), f32a: 81 ea ldi r24, 0xA1 ; 161 f32c: 9d e0 ldi r25, 0x0D ; 13 f32e: 0f 94 1c dc call 0x3b838 ; 0x3b838 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-> f332: 8c 9f mul r24, r28 f334: c0 01 movw r24, r0 f336: 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); f338: 70 e0 ldi r23, 0x00 ; 0 f33a: 60 e0 ldi r22, 0x00 ; 0 f33c: 80 5b subi r24, 0xB0 ; 176 f33e: 92 4f sbci r25, 0xF2 ; 242 f340: 0f 94 7a dc call 0x3b8f4 ; 0x3b8f4 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.")); f344: 8b eb ldi r24, 0xBB ; 187 f346: 9d e7 ldi r25, 0x7D ; 125 f348: 0f 94 f1 1f call 0x23fe2 ; 0x23fe2 lcd_update_enable(true); f34c: 81 e0 ldi r24, 0x01 ; 1 } } f34e: 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); f350: 0c 94 25 6f jmp 0xde4a ; 0xde4a } } f354: cf 91 pop r28 f356: 08 95 ret 0000f358 : // 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) { f358: ff 92 push r15 f35a: 0f 93 push r16 f35c: 1f 93 push r17 f35e: cf 93 push r28 f360: df 93 push r29 if(Stopped == false) { f362: 90 91 11 05 lds r25, 0x0511 ; 0x800511 f366: 91 11 cpse r25, r1 f368: 4f c0 rjmp .+158 ; 0xf408 f36a: c8 2f mov r28, r24 Stopped = true; f36c: 81 e0 ldi r24, 0x01 ; 1 f36e: 80 93 11 05 sts 0x0511, r24 ; 0x800511 // Either pause or stop the print if(allow_recovery && printJobOngoing()) { f372: cc 23 and r28, r28 f374: 11 f1 breq .+68 ; 0xf3ba f376: 0e 94 90 67 call 0xcf20 ; 0xcf20 f37a: 88 23 and r24, r24 f37c: f1 f0 breq .+60 ; 0xf3ba if (!printingIsPaused()) { f37e: 0e 94 85 67 call 0xcf0a ; 0xcf0a f382: 81 11 cpse r24, r1 f384: 22 c0 rjmp .+68 ; 0xf3ca lcd_setalertstatuspgm(_T(MSG_PAUSED_THERMAL_ERROR), LCD_STATUS_CRITICAL); f386: 81 ea ldi r24, 0xA1 ; 161 f388: 96 e3 ldi r25, 0x36 ; 54 f38a: 0e 94 ac 72 call 0xe558 ; 0xe558 f38e: 63 e0 ldi r22, 0x03 ; 3 f390: 0e 94 1d f1 call 0x1e23a ; 0x1e23a // 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; f394: f0 90 ae 05 lds r15, 0x05AE ; 0x8005ae uint16_t ext_temp = saved_extruder_temperature; f398: 00 91 ac 05 lds r16, 0x05AC ; 0x8005ac f39c: 10 91 ad 05 lds r17, 0x05AD ; 0x8005ad uint8_t fan_speed = saved_fan_speed; f3a0: d0 91 ab 05 lds r29, 0x05AB ; 0x8005ab lcd_pause_print(); f3a4: 0f 94 58 29 call 0x252b0 ; 0x252b0 saved_bed_temperature = bed_temp; f3a8: f0 92 ae 05 sts 0x05AE, r15 ; 0x8005ae saved_extruder_temperature = ext_temp; f3ac: 10 93 ad 05 sts 0x05AD, r17 ; 0x8005ad f3b0: 00 93 ac 05 sts 0x05AC, r16 ; 0x8005ac saved_fan_speed = fan_speed; f3b4: d0 93 ab 05 sts 0x05AB, r29 ; 0x8005ab f3b8: 08 c0 rjmp .+16 ; 0xf3ca } } else { // We got a hard thermal error and/or there is no print going on. Just stop. print_stop(false, true); f3ba: 61 e0 ldi r22, 0x01 ; 1 f3bc: 80 e0 ldi r24, 0x00 ; 0 f3be: 0e 94 9a f4 call 0x1e934 ; 0x1e934 } // Report the error on the serial serialprintPGM(allow_recovery ? echomagic : errormagic); f3c2: 8a e9 ldi r24, 0x9A ; 154 f3c4: 9b ea ldi r25, 0xAB ; 171 f3c6: cc 23 and r28, r28 f3c8: 11 f0 breq .+4 ; 0xf3ce f3ca: 82 ec ldi r24, 0xC2 ; 194 f3cc: 9b ea ldi r25, 0xAB ; 171 f3ce: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ERRORLNRPGM(MSG_ERR_STOPPED); f3d2: 8e ea ldi r24, 0xAE ; 174 f3d4: 96 e6 ldi r25, 0x66 ; 102 f3d6: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 // 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)); f3da: 86 e9 ldi r24, 0x96 ; 150 f3dc: 96 e3 ldi r25, 0x36 ; 54 f3de: 0e 94 ac 72 call 0xe558 ; 0xe558 f3e2: 0e 94 5d f1 call 0x1e2ba ; 0x1e2ba // 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); f3e6: 9f b7 in r25, 0x3f ; 63 f3e8: f8 94 cli f3ea: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> f3ee: 84 60 ori r24, 0x04 ; 4 f3f0: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> f3f4: 9f bf out 0x3f, r25 ; 63 // Always return to the status screen to ensure the NEW error is immediately shown. lcd_return_to_status(); f3f6: 0f 94 a6 1e call 0x23d4c ; 0x23d4c if(!allow_recovery) { f3fa: c1 11 cpse r28, r1 f3fc: 05 c0 rjmp .+10 ; 0xf408 // prevent menu access for all fatal errors menu_set_block(MENU_BLOCK_THERMAL_ERROR); f3fe: 80 91 d6 03 lds r24, 0x03D6 ; 0x8003d6 f402: 81 60 ori r24, 0x01 ; 1 f404: 80 93 d6 03 sts 0x03D6, r24 ; 0x8003d6 } } } f408: df 91 pop r29 f40a: cf 91 pop r28 f40c: 1f 91 pop r17 f40e: 0f 91 pop r16 f410: ff 90 pop r15 f412: 08 95 ret 0000f414 : #endif //AUTO_REPORT host_keepalive(); M79_timer_update_status(); } void kill(const char *full_screen_message) { f414: ec 01 movw r28, r24 cli(); // Stop interrupts f416: f8 94 cli disable_heater(); f418: 0f 94 18 2f call 0x25e30 ; 0x25e30 disable_x(); f41c: 17 9a sbi 0x02, 7 ; 2 f41e: 10 92 8f 06 sts 0x068F, r1 ; 0x80068f disable_y(); f422: 16 9a sbi 0x02, 6 ; 2 f424: 10 92 90 06 sts 0x0690, r1 ; 0x800690 poweroff_z(); disable_e0(); f428: 14 9a sbi 0x02, 4 ; 2 SERIAL_ERROR_START; f42a: 8a e9 ldi r24, 0x9A ; 154 f42c: 9b ea ldi r25, 0xAB ; 171 f42e: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ERRORLNRPGM(PSTR("Printer halted. kill() called!")); f432: 8c e9 ldi r24, 0x9C ; 156 f434: 9d e7 ldi r25, 0x7D ; 125 f436: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 if (full_screen_message != NULL) { f43a: 20 97 sbiw r28, 0x00 ; 0 f43c: 79 f0 breq .+30 ; 0xf45c SERIAL_ERRORLNRPGM(full_screen_message); f43e: ce 01 movw r24, r28 f440: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 f444: be 01 movw r22, r28 f446: 85 e9 ldi r24, 0x95 ; 149 f448: 9c e0 ldi r25, 0x0C ; 12 f44a: 0f 94 7a dc call 0x3b8f4 ; 0x3b8f4 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); f44e: 62 e4 ldi r22, 0x42 ; 66 f450: 84 e9 ldi r24, 0x94 ; 148 f452: 9c e0 ldi r25, 0x0C ; 12 f454: 0f 94 64 dc call 0x3b8c8 ; 0x3b8c8 // 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(); f458: 0e 94 4c 67 call 0xce98 ; 0xce98 SERIAL_ERRORLNRPGM(PSTR("Printer halted. kill() called!")); if (full_screen_message != NULL) { SERIAL_ERRORLNRPGM(full_screen_message); } else { full_screen_message = PSTR("KILLED."); f45c: c4 e9 ldi r28, 0x94 ; 148 f45e: dd e7 ldi r29, 0x7D ; 125 f460: f1 cf rjmp .-30 ; 0xf444 0000f462 : #endif //TMC2130 #ifdef TMC2130 void check_Z_crash(void) { if (!READ(Z_TMC2130_DIAG)) { //Z crash f462: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> f466: 86 fd sbrc r24, 6 f468: 35 c0 rjmp .+106 ; 0xf4d4 FORCE_HIGH_POWER_END; f46a: 80 e0 ldi r24, 0x00 ; 0 f46c: 0e 94 b0 66 call 0xcd60 ; 0xcd60 current_position[Z_AXIS] = 0; f470: 10 92 9a 06 sts 0x069A, r1 ; 0x80069a f474: 10 92 9b 06 sts 0x069B, r1 ; 0x80069b f478: 10 92 9c 06 sts 0x069C, r1 ; 0x80069c f47c: 10 92 9d 06 sts 0x069D, r1 ; 0x80069d plan_set_position_curposXYZE(); f480: 0f 94 09 bf call 0x37e12 ; 0x37e12 current_position[Z_AXIS] += MESH_HOME_Z_SEARCH; f484: 20 e0 ldi r18, 0x00 ; 0 f486: 30 e0 ldi r19, 0x00 ; 0 f488: 40 ea ldi r20, 0xA0 ; 160 f48a: 50 e4 ldi r21, 0x40 ; 64 f48c: 60 91 9a 06 lds r22, 0x069A ; 0x80069a f490: 70 91 9b 06 lds r23, 0x069B ; 0x80069b f494: 80 91 9c 06 lds r24, 0x069C ; 0x80069c f498: 90 91 9d 06 lds r25, 0x069D ; 0x80069d f49c: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> f4a0: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a f4a4: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b f4a8: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c f4ac: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d plan_buffer_line_curposXYZE(max_feedrate[Z_AXIS]); f4b0: e0 91 71 02 lds r30, 0x0271 ; 0x800271 f4b4: f0 91 72 02 lds r31, 0x0272 ; 0x800272 f4b8: 60 85 ldd r22, Z+8 ; 0x08 f4ba: 71 85 ldd r23, Z+9 ; 0x09 f4bc: 82 85 ldd r24, Z+10 ; 0x0a f4be: 93 85 ldd r25, Z+11 ; 0x0b f4c0: 0f 94 49 c0 call 0x38092 ; 0x38092 st_synchronize(); f4c4: 0f 94 e8 42 call 0x285d0 ; 0x285d0 kill(_T(MSG_BED_LEVELING_FAILED_POINT_LOW)); f4c8: 81 e5 ldi r24, 0x51 ; 81 f4ca: 94 e6 ldi r25, 0x64 ; 100 f4cc: 0e 94 ac 72 call 0xe558 ; 0xe558 f4d0: 0e 94 0a 7a call 0xf414 ; 0xf414 } } f4d4: 08 95 ret 0000f4d6 : #ifdef TMC2130 void homeaxis(uint8_t axis, uint8_t cnt, uint8_t* pstep) #else void homeaxis(uint8_t axis, uint8_t cnt) #endif //TMC2130 { f4d6: 2f 92 push r2 f4d8: 3f 92 push r3 f4da: 4f 92 push r4 f4dc: 5f 92 push r5 f4de: 6f 92 push r6 f4e0: 7f 92 push r7 f4e2: 8f 92 push r8 f4e4: 9f 92 push r9 f4e6: af 92 push r10 f4e8: bf 92 push r11 f4ea: cf 92 push r12 f4ec: df 92 push r13 f4ee: ef 92 push r14 f4f0: ff 92 push r15 f4f2: 0f 93 push r16 f4f4: 1f 93 push r17 f4f6: cf 93 push r28 f4f8: df 93 push r29 f4fa: cd b7 in r28, 0x3d ; 61 f4fc: de b7 in r29, 0x3e ; 62 f4fe: 60 97 sbiw r28, 0x10 ; 16 f500: 0f b6 in r0, 0x3f ; 63 f502: f8 94 cli f504: de bf out 0x3e, r29 ; 62 f506: 0f be out 0x3f, r0 ; 63 f508: cd bf out 0x3d, r28 ; 61 f50a: 28 2e mov r2, r24 f50c: 6e 87 std Y+14, r22 ; 0x0e f50e: 5a 87 std Y+10, r21 ; 0x0a f510: 49 87 std Y+9, r20 ; 0x09 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; f512: 20 91 b7 02 lds r18, 0x02B7 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> f516: 2d 87 std Y+13, r18 ; 0x0d check_endstops = check; f518: 77 24 eor r7, r7 f51a: 73 94 inc r7 f51c: 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) f520: 42 e0 ldi r20, 0x02 ; 2 f522: 84 17 cp r24, r20 f524: 09 f4 brne .+2 ; 0xf528 f526: d4 c1 rjmp .+936 ; 0xf8d0 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); f528: 08 2f mov r16, r24 f52a: 10 e0 ldi r17, 0x00 ; 0 f52c: f8 01 movw r30, r16 f52e: e6 5c subi r30, 0xC6 ; 198 f530: 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); f532: 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); f534: 83 2d mov r24, r3 f536: 03 2c mov r0, r3 f538: 00 0c add r0, r0 f53a: 99 0b sbc r25, r25 f53c: 9c 87 std Y+12, r25 ; 0x0c f53e: 8b 87 std Y+11, r24 ; 0x0b feedrate = homing_feedrate[axis]; f540: d8 01 movw r26, r16 f542: aa 0f add r26, r26 f544: bb 1f adc r27, r27 f546: aa 0f add r26, r26 f548: bb 1f adc r27, r27 f54a: ba 83 std Y+2, r27 ; 0x02 f54c: a9 83 std Y+1, r26 ; 0x01 f54e: fd 01 movw r30, r26 f550: e3 53 subi r30, 0x33 ; 51 f552: fd 4f sbci r31, 0xFD ; 253 f554: 80 81 ld r24, Z f556: 91 81 ldd r25, Z+1 ; 0x01 f558: a2 81 ldd r26, Z+2 ; 0x02 f55a: b3 81 ldd r27, Z+3 ; 0x03 f55c: 8b 83 std Y+3, r24 ; 0x03 f55e: 9c 83 std Y+4, r25 ; 0x04 f560: ad 83 std Y+5, r26 ; 0x05 f562: be 83 std Y+6, r27 ; 0x06 f564: 80 93 b8 02 sts 0x02B8, r24 ; 0x8002b8 f568: 90 93 b9 02 sts 0x02B9, r25 ; 0x8002b9 f56c: a0 93 ba 02 sts 0x02BA, r26 ; 0x8002ba f570: b0 93 bb 02 sts 0x02BB, r27 ; 0x8002bb float feedrate_mm_s = get_feedrate_mm_s(feedrate); f574: bc 01 movw r22, r24 f576: cd 01 movw r24, r26 f578: 0e 94 c7 66 call 0xcd8e ; 0xcd8e f57c: 6b 01 movw r12, r22 f57e: 7c 01 movw r14, r24 #ifdef TMC2130 tmc2130_home_enter(X_AXIS_MASK << axis); f580: 81 e0 ldi r24, 0x01 ; 1 f582: 02 2c mov r0, r2 f584: 01 c0 rjmp .+2 ; 0xf588 f586: 88 0f add r24, r24 f588: 0a 94 dec r0 f58a: ea f7 brpl .-6 ; 0xf586 f58c: 0f 94 d8 25 call 0x24bb0 ; 0x24bb0 // 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; f590: a9 81 ldd r26, Y+1 ; 0x01 f592: ba 81 ldd r27, Y+2 ; 0x02 f594: ae 56 subi r26, 0x6E ; 110 f596: b9 4f sbci r27, 0xF9 ; 249 f598: b8 87 std Y+8, r27 ; 0x08 f59a: af 83 std Y+7, r26 ; 0x07 f59c: fd 01 movw r30, r26 f59e: 10 82 st Z, r1 f5a0: 11 82 std Z+1, r1 ; 0x01 f5a2: 12 82 std Z+2, r1 ; 0x02 f5a4: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); f5a6: 0f 94 09 bf call 0x37e12 ; 0x37e12 set_destination_to_current(); f5aa: 0e 94 3a 68 call 0xd074 ; 0xd074 // destination[axis] = 11.f; destination[axis] = -3.f * axis_home_dir; f5ae: 63 2d mov r22, r3 f5b0: 03 2c mov r0, r3 f5b2: 00 0c add r0, r0 f5b4: 77 0b sbc r23, r23 f5b6: 88 0b sbc r24, r24 f5b8: 99 0b sbc r25, r25 f5ba: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> f5be: 4b 01 movw r8, r22 f5c0: 5c 01 movw r10, r24 f5c2: 49 81 ldd r20, Y+1 ; 0x01 f5c4: 5a 81 ldd r21, Y+2 ; 0x02 f5c6: 4c 58 subi r20, 0x8C ; 140 f5c8: 59 4f sbci r21, 0xF9 ; 249 f5ca: 58 8b std Y+16, r21 ; 0x10 f5cc: 4f 87 std Y+15, r20 ; 0x0f f5ce: 20 e0 ldi r18, 0x00 ; 0 f5d0: 30 e0 ldi r19, 0x00 ; 0 f5d2: 40 e4 ldi r20, 0x40 ; 64 f5d4: 50 ec ldi r21, 0xC0 ; 192 f5d6: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> f5da: af 85 ldd r26, Y+15 ; 0x0f f5dc: b8 89 ldd r27, Y+16 ; 0x10 f5de: 6d 93 st X+, r22 f5e0: 7d 93 st X+, r23 f5e2: 8d 93 st X+, r24 f5e4: 9c 93 st X, r25 f5e6: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(feedrate_mm_s); f5e8: c7 01 movw r24, r14 f5ea: b6 01 movw r22, r12 f5ec: 0f 94 16 c0 call 0x3802c ; 0x3802c st_synchronize(); f5f0: 0f 94 e8 42 call 0x285d0 ; 0x285d0 // Move away from the possible collision with opposite endstop with the collision detection disabled. endstops_hit_on_purpose(); f5f4: 0f 94 fe 4d call 0x29bfc ; 0x29bfc f5f8: 10 92 b7 02 sts 0x02B7, r1 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> enable_endstops(false); current_position[axis] = 0; f5fc: ef 81 ldd r30, Y+7 ; 0x07 f5fe: f8 85 ldd r31, Y+8 ; 0x08 f600: 10 82 st Z, r1 f602: 11 82 std Z+1, r1 ; 0x01 f604: 12 82 std Z+2, r1 ; 0x02 f606: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); f608: 0f 94 09 bf call 0x37e12 ; 0x37e12 destination[axis] = 1. * axis_home_dir; f60c: af 85 ldd r26, Y+15 ; 0x0f f60e: b8 89 ldd r27, Y+16 ; 0x10 f610: 8d 92 st X+, r8 f612: 9d 92 st X+, r9 f614: ad 92 st X+, r10 f616: bc 92 st X, r11 f618: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(feedrate_mm_s); f61a: c7 01 movw r24, r14 f61c: b6 01 movw r22, r12 f61e: 0f 94 16 c0 call 0x3802c ; 0x3802c st_synchronize(); f622: 0f 94 e8 42 call 0x285d0 ; 0x285d0 f626: 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); f62a: e9 81 ldd r30, Y+1 ; 0x01 f62c: fa 81 ldd r31, Y+2 ; 0x02 f62e: e2 5d subi r30, 0xD2 ; 210 f630: 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); f632: 45 90 lpm r4, Z+ f634: 55 90 lpm r5, Z+ f636: 65 90 lpm r6, Z+ f638: 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); f63a: 2d ec ldi r18, 0xCD ; 205 f63c: 3c ec ldi r19, 0xCC ; 204 f63e: 4c e8 ldi r20, 0x8C ; 140 f640: 5f e3 ldi r21, 0x3F ; 63 f642: c5 01 movw r24, r10 f644: b4 01 movw r22, r8 f646: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> f64a: a3 01 movw r20, r6 f64c: 92 01 movw r18, r4 f64e: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> f652: ef 85 ldd r30, Y+15 ; 0x0f f654: f8 89 ldd r31, Y+16 ; 0x10 f656: 60 83 st Z, r22 f658: 71 83 std Z+1, r23 ; 0x01 f65a: 82 83 std Z+2, r24 ; 0x02 f65c: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_destinationXYZE(feedrate_mm_s); f65e: c7 01 movw r24, r14 f660: b6 01 movw r22, r12 f662: 0f 94 16 c0 call 0x3802c ; 0x3802c st_synchronize(); f666: 0f 94 e8 42 call 0x285d0 ; 0x285d0 f66a: 71 2c mov r7, r1 f66c: 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; f66e: 4f 80 ldd r4, Y+7 ; 0x07 f670: 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(); f672: 0f 94 fe 4d call 0x29bfc ; 0x29bfc f676: 10 92 b7 02 sts 0x02B7, r1 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> enable_endstops(false); current_position[axis] = 0; f67a: d2 01 movw r26, r4 f67c: 1d 92 st X+, r1 f67e: 1d 92 st X+, r1 f680: 1d 92 st X+, r1 f682: 1c 92 st X, r1 f684: 13 97 sbiw r26, 0x03 ; 3 plan_set_position_curposXYZE(); f686: 0f 94 09 bf call 0x37e12 ; 0x37e12 destination[axis] = -10.f * axis_home_dir; f68a: 20 e0 ldi r18, 0x00 ; 0 f68c: 30 e0 ldi r19, 0x00 ; 0 f68e: 40 e2 ldi r20, 0x20 ; 32 f690: 51 ec ldi r21, 0xC1 ; 193 f692: c5 01 movw r24, r10 f694: b4 01 movw r22, r8 f696: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> f69a: ef 85 ldd r30, Y+15 ; 0x0f f69c: f8 89 ldd r31, Y+16 ; 0x10 f69e: 60 83 st Z, r22 f6a0: 71 83 std Z+1, r23 ; 0x01 f6a2: 82 83 std Z+2, r24 ; 0x02 f6a4: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_destinationXYZE(feedrate_mm_s); f6a6: c7 01 movw r24, r14 f6a8: b6 01 movw r22, r12 f6aa: 0f 94 16 c0 call 0x3802c ; 0x3802c st_synchronize(); f6ae: 0f 94 e8 42 call 0x285d0 ; 0x285d0 endstops_hit_on_purpose(); f6b2: 0f 94 fe 4d call 0x29bfc ; 0x29bfc f6b6: f1 e0 ldi r31, 0x01 ; 1 f6b8: 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; f6bc: 20 e0 ldi r18, 0x00 ; 0 f6be: 30 e0 ldi r19, 0x00 ; 0 f6c0: 40 e3 ldi r20, 0x30 ; 48 f6c2: 51 e4 ldi r21, 0x41 ; 65 f6c4: c5 01 movw r24, r10 f6c6: b4 01 movw r22, r8 f6c8: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> f6cc: af 85 ldd r26, Y+15 ; 0x0f f6ce: b8 89 ldd r27, Y+16 ; 0x10 f6d0: 6d 93 st X+, r22 f6d2: 7d 93 st X+, r23 f6d4: 8d 93 st X+, r24 f6d6: 9c 93 st X, r25 f6d8: 13 97 sbiw r26, 0x03 ; 3 #ifdef TMC2130 feedrate = homing_feedrate[axis]; f6da: 8b 81 ldd r24, Y+3 ; 0x03 f6dc: 9c 81 ldd r25, Y+4 ; 0x04 f6de: ad 81 ldd r26, Y+5 ; 0x05 f6e0: be 81 ldd r27, Y+6 ; 0x06 f6e2: 80 93 b8 02 sts 0x02B8, r24 ; 0x8002b8 f6e6: 90 93 b9 02 sts 0x02B9, r25 ; 0x8002b9 f6ea: a0 93 ba 02 sts 0x02BA, r26 ; 0x8002ba f6ee: 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); f6f2: c7 01 movw r24, r14 f6f4: b6 01 movw r22, r12 f6f6: 0f 94 16 c0 call 0x3802c ; 0x3802c st_synchronize(); f6fa: 0f 94 e8 42 call 0x285d0 ; 0x285d0 #ifdef TMC2130 uint16_t mscnt = tmc2130_rd_MSCNT(axis); f6fe: 82 2d mov r24, r2 f700: 0f 94 75 24 call 0x248ea ; 0x248ea f704: 9c 01 movw r18, r24 f706: 44 e0 ldi r20, 0x04 ; 4 f708: 36 95 lsr r19 f70a: 27 95 ror r18 f70c: 4a 95 dec r20 f70e: e1 f7 brne .-8 ; 0xf708 if (pstep) pstep[i] = mscnt >> 4; f710: a9 85 ldd r26, Y+9 ; 0x09 f712: ba 85 ldd r27, Y+10 ; 0x0a f714: 10 97 sbiw r26, 0x00 ; 0 f716: 21 f0 breq .+8 ; 0xf720 f718: fd 01 movw r30, r26 f71a: e6 0d add r30, r6 f71c: f7 1d adc r31, r7 f71e: 20 83 st Z, r18 printf_P(PSTR("%3d step=%2d mscnt=%4d\n"), i, mscnt >> 4, mscnt); f720: 9f 93 push r25 f722: 8f 93 push r24 f724: 3f 93 push r19 f726: 2f 93 push r18 f728: 7f 92 push r7 f72a: 6f 92 push r6 f72c: e6 e1 ldi r30, 0x16 ; 22 f72e: fc e7 ldi r31, 0x7C ; 124 f730: ff 93 push r31 f732: ef 93 push r30 f734: 0f 94 de da call 0x3b5bc ; 0x3b5bc f738: 4f ef ldi r20, 0xFF ; 255 f73a: 64 1a sub r6, r20 f73c: 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++) f73e: 0f b6 in r0, 0x3f ; 63 f740: f8 94 cli f742: de bf out 0x3e, r29 ; 62 f744: 0f be out 0x3f, r0 ; 63 f746: cd bf out 0x3d, r28 ; 61 f748: 9e 85 ldd r25, Y+14 ; 0x0e f74a: 69 16 cp r6, r25 f74c: 08 f4 brcc .+2 ; 0xf750 f74e: 91 cf rjmp .-222 ; 0xf672 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(); f750: 0f 94 fe 4d call 0x29bfc ; 0x29bfc f754: 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)) f758: 80 91 f2 04 lds r24, 0x04F2 ; 0x8004f2 f75c: 88 23 and r24, r24 f75e: 09 f4 brne .+2 ; 0xf762 f760: b2 c0 rjmp .+356 ; 0xf8c6 } endstops_hit_on_purpose(); enable_endstops(false); #ifdef TMC2130 uint8_t orig = tmc2130_home_origin[axis]; f762: f8 01 movw r30, r16 f764: ed 50 subi r30, 0x0D ; 13 f766: fb 4f sbci r31, 0xFB ; 251 f768: 60 81 ld r22, Z uint8_t back = tmc2130_home_bsteps[axis]; if (tmc2130_home_enabled && (orig <= 63)) f76a: 60 34 cpi r22, 0x40 ; 64 f76c: 08 f0 brcs .+2 ; 0xf770 f76e: ab c0 rjmp .+342 ; 0xf8c6 endstops_hit_on_purpose(); enable_endstops(false); #ifdef TMC2130 uint8_t orig = tmc2130_home_origin[axis]; uint8_t back = tmc2130_home_bsteps[axis]; f770: f8 01 movw r30, r16 f772: e6 5a subi r30, 0xA6 ; 166 f774: fd 4f sbci r31, 0xFD ; 253 f776: a0 81 ld r26, Z f778: ab 83 std Y+3, r26 ; 0x03 return stat; } uint16_t tmc2130_get_res(uint8_t axis) { return tmc2130_mres2usteps(tmc2130_mres[axis]); f77a: f8 01 movw r30, r16 f77c: eb 50 subi r30, 0x0B ; 11 f77e: fb 4f sbci r31, 0xFB ; 251 f780: 80 81 ld r24, Z f782: 40 e0 ldi r20, 0x00 ; 0 f784: 51 e0 ldi r21, 0x01 ; 1 f786: 02 c0 rjmp .+4 ; 0xf78c f788: 56 95 lsr r21 f78a: 47 95 ror r20 f78c: 8a 95 dec r24 f78e: e2 f7 brpl .-8 ; 0xf788 if (tmc2130_home_enabled && (orig <= 63)) { tmc2130_goto_step(axis, orig, 2, 1000, tmc2130_get_res(axis)); f790: 82 2d mov r24, r2 f792: 0f 94 a3 8b call 0x31746 ; 0x31746 if (back > 0) f796: bb 81 ldd r27, Y+3 ; 0x03 f798: bb 23 and r27, r27 f79a: 39 f0 breq .+14 ; 0xf7aa tmc2130_do_steps(axis, back, -axis_home_dir, 1000); f79c: 43 2d mov r20, r3 f79e: 41 95 neg r20 f7a0: 6b 2f mov r22, r27 f7a2: 70 e0 ldi r23, 0x00 ; 0 } else tmc2130_do_steps(axis, 8, -axis_home_dir, 1000); f7a4: 82 2d mov r24, r2 f7a6: 0f 94 74 8b call 0x316e8 ; 0x316e8 tmc2130_home_exit(); f7aa: 0f 94 a9 25 call 0x24b52 ; 0x24b52 #endif //TMC2130 axis_is_at_home(axis); f7ae: 82 2d mov r24, r2 f7b0: 0e 94 aa 5a call 0xb554 ; 0xb554 axis_known_position[axis] = true; f7b4: f8 01 movw r30, r16 f7b6: e1 57 subi r30, 0x71 ; 113 f7b8: f9 4f sbci r31, 0xF9 ; 249 f7ba: 81 e0 ldi r24, 0x01 ; 1 f7bc: 80 83 st Z, r24 // Move from minimum #ifdef TMC2130 float dist = - axis_home_dir * 0.01f * tmc2130_home_fsteps[axis]; f7be: 6b 85 ldd r22, Y+11 ; 0x0b f7c0: 7c 85 ldd r23, Y+12 ; 0x0c f7c2: 71 95 neg r23 f7c4: 61 95 neg r22 f7c6: 71 09 sbc r23, r1 f7c8: 07 2e mov r0, r23 f7ca: 00 0c add r0, r0 f7cc: 88 0b sbc r24, r24 f7ce: 99 0b sbc r25, r25 f7d0: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> f7d4: 2a e0 ldi r18, 0x0A ; 10 f7d6: 37 ed ldi r19, 0xD7 ; 215 f7d8: 43 e2 ldi r20, 0x23 ; 35 f7da: 5c e3 ldi r21, 0x3C ; 60 f7dc: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> f7e0: 4b 01 movw r8, r22 f7e2: 5c 01 movw r10, r24 f7e4: f8 01 movw r30, r16 f7e6: e8 5a subi r30, 0xA8 ; 168 f7e8: fd 4f sbci r31, 0xFD ; 253 f7ea: 60 81 ld r22, Z f7ec: 70 e0 ldi r23, 0x00 ; 0 f7ee: 90 e0 ldi r25, 0x00 ; 0 f7f0: 80 e0 ldi r24, 0x00 ; 0 f7f2: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> f7f6: 9b 01 movw r18, r22 f7f8: ac 01 movw r20, r24 f7fa: c5 01 movw r24, r10 f7fc: b4 01 movw r22, r8 f7fe: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> f802: 4b 01 movw r8, r22 f804: 5c 01 movw r10, r24 #else //TMC2130 float dist = - axis_home_dir * 0.01f * 64; #endif //TMC2130 current_position[axis] -= dist; f806: e9 81 ldd r30, Y+1 ; 0x01 f808: fa 81 ldd r31, Y+2 ; 0x02 f80a: ee 56 subi r30, 0x6E ; 110 f80c: f9 4f sbci r31, 0xF9 ; 249 f80e: fc 83 std Y+4, r31 ; 0x04 f810: eb 83 std Y+3, r30 ; 0x03 f812: ac 01 movw r20, r24 f814: 9b 01 movw r18, r22 f816: 60 81 ld r22, Z f818: 71 81 ldd r23, Z+1 ; 0x01 f81a: 82 81 ldd r24, Z+2 ; 0x02 f81c: 93 81 ldd r25, Z+3 ; 0x03 f81e: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> f822: ab 81 ldd r26, Y+3 ; 0x03 f824: bc 81 ldd r27, Y+4 ; 0x04 f826: 6d 93 st X+, r22 f828: 7d 93 st X+, r23 f82a: 8d 93 st X+, r24 f82c: 9c 93 st X, r25 f82e: 13 97 sbiw r26, 0x03 ; 3 plan_set_position_curposXYZE(); f830: 0f 94 09 bf call 0x37e12 ; 0x37e12 current_position[axis] += dist; f834: eb 81 ldd r30, Y+3 ; 0x03 f836: fc 81 ldd r31, Y+4 ; 0x04 f838: 20 81 ld r18, Z f83a: 31 81 ldd r19, Z+1 ; 0x01 f83c: 42 81 ldd r20, Z+2 ; 0x02 f83e: 53 81 ldd r21, Z+3 ; 0x03 f840: c5 01 movw r24, r10 f842: b4 01 movw r22, r8 f844: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> f848: ab 81 ldd r26, Y+3 ; 0x03 f84a: bc 81 ldd r27, Y+4 ; 0x04 f84c: 6d 93 st X+, r22 f84e: 7d 93 st X+, r23 f850: 8d 93 st X+, r24 f852: 9c 93 st X, r25 f854: 13 97 sbiw r26, 0x03 ; 3 destination[axis] = current_position[axis]; f856: e9 81 ldd r30, Y+1 ; 0x01 f858: fa 81 ldd r31, Y+2 ; 0x02 f85a: ec 58 subi r30, 0x8C ; 140 f85c: f9 4f sbci r31, 0xF9 ; 249 f85e: 60 83 st Z, r22 f860: 71 83 std Z+1, r23 ; 0x01 f862: 82 83 std Z+2, r24 ; 0x02 f864: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_destinationXYZE(0.5f*feedrate_mm_s); f866: 20 e0 ldi r18, 0x00 ; 0 f868: 30 e0 ldi r19, 0x00 ; 0 f86a: 40 e0 ldi r20, 0x00 ; 0 f86c: 5f e3 ldi r21, 0x3F ; 63 f86e: c7 01 movw r24, r14 f870: b6 01 movw r22, r12 f872: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> f876: 0f 94 16 c0 call 0x3802c ; 0x3802c st_synchronize(); f87a: 0f 94 e8 42 call 0x285d0 ; 0x285d0 feedrate = 0.0; f87e: 10 92 b8 02 sts 0x02B8, r1 ; 0x8002b8 f882: 10 92 b9 02 sts 0x02B9, r1 ; 0x8002b9 f886: 10 92 ba 02 sts 0x02BA, r1 ; 0x8002ba f88a: 10 92 bb 02 sts 0x02BB, r1 ; 0x8002bb f88e: fd 85 ldd r31, Y+13 ; 0x0d f890: f0 93 b7 02 sts 0x02B7, r31 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> #ifdef TMC2130 FORCE_HIGH_POWER_END; #endif } enable_endstops(endstops_enabled); } f894: 60 96 adiw r28, 0x10 ; 16 f896: 0f b6 in r0, 0x3f ; 63 f898: f8 94 cli f89a: de bf out 0x3e, r29 ; 62 f89c: 0f be out 0x3f, r0 ; 63 f89e: cd bf out 0x3d, r28 ; 61 f8a0: df 91 pop r29 f8a2: cf 91 pop r28 f8a4: 1f 91 pop r17 f8a6: 0f 91 pop r16 f8a8: ff 90 pop r15 f8aa: ef 90 pop r14 f8ac: df 90 pop r13 f8ae: cf 90 pop r12 f8b0: bf 90 pop r11 f8b2: af 90 pop r10 f8b4: 9f 90 pop r9 f8b6: 8f 90 pop r8 f8b8: 7f 90 pop r7 f8ba: 6f 90 pop r6 f8bc: 5f 90 pop r5 f8be: 4f 90 pop r4 f8c0: 3f 90 pop r3 f8c2: 2f 90 pop r2 f8c4: 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); f8c6: 43 2d mov r20, r3 f8c8: 41 95 neg r20 f8ca: 68 e0 ldi r22, 0x08 ; 8 f8cc: 70 e0 ldi r23, 0x00 ; 0 f8ce: 6a cf rjmp .-300 ; 0xf7a4 feedrate = 0.0; } else if ((axis==Z_AXIS)?HOMEAXIS_DO(Z):0) { #ifdef TMC2130 FORCE_HIGH_POWER_START; f8d0: 81 e0 ldi r24, 0x01 ; 1 f8d2: 0e 94 b0 66 call 0xcd60 ; 0xcd60 #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); f8d6: ec e3 ldi r30, 0x3C ; 60 f8d8: fc e7 ldi r31, 0x7C ; 124 f8da: b4 91 lpm r27, Z f8dc: 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; f8de: 10 92 9a 06 sts 0x069A, r1 ; 0x80069a f8e2: 10 92 9b 06 sts 0x069B, r1 ; 0x80069b f8e6: 10 92 9c 06 sts 0x069C, r1 ; 0x80069c f8ea: 10 92 9d 06 sts 0x069D, r1 ; 0x80069d plan_set_position_curposXYZE(); f8ee: 0f 94 09 bf call 0x37e12 ; 0x37e12 #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); f8f2: e6 e3 ldi r30, 0x36 ; 54 f8f4: fc e7 ldi r31, 0x7C ; 124 f8f6: 85 90 lpm r8, Z+ f8f8: 95 90 lpm r9, Z+ f8fa: a5 90 lpm r10, Z+ f8fc: 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; f8fe: e9 81 ldd r30, Y+1 ; 0x01 f900: 6e 2f mov r22, r30 f902: ee 0f add r30, r30 f904: 77 0b sbc r23, r23 f906: 88 0b sbc r24, r24 f908: 99 0b sbc r25, r25 f90a: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> f90e: 6b 01 movw r12, r22 f910: 7c 01 movw r14, r24 f912: 20 e0 ldi r18, 0x00 ; 0 f914: 30 e0 ldi r19, 0x00 ; 0 f916: 40 ec ldi r20, 0xC0 ; 192 f918: 5f e3 ldi r21, 0x3F ; 63 f91a: c5 01 movw r24, r10 f91c: b4 01 movw r22, r8 f91e: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> f922: a7 01 movw r20, r14 f924: 96 01 movw r18, r12 f926: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> f92a: 60 93 7c 06 sts 0x067C, r22 ; 0x80067c f92e: 70 93 7d 06 sts 0x067D, r23 ; 0x80067d f932: 80 93 7e 06 sts 0x067E, r24 ; 0x80067e f936: 90 93 7f 06 sts 0x067F, r25 ; 0x80067f feedrate = homing_feedrate[axis]; f93a: 80 e0 ldi r24, 0x00 ; 0 f93c: 90 e0 ldi r25, 0x00 ; 0 f93e: a8 e4 ldi r26, 0x48 ; 72 f940: b4 e4 ldi r27, 0x44 ; 68 f942: 80 93 b8 02 sts 0x02B8, r24 ; 0x8002b8 f946: 90 93 b9 02 sts 0x02B9, r25 ; 0x8002b9 f94a: a0 93 ba 02 sts 0x02BA, r26 ; 0x8002ba f94e: b0 93 bb 02 sts 0x02BB, r27 ; 0x8002bb float feedrate_mm_s = get_feedrate_mm_s(feedrate); f952: bc 01 movw r22, r24 f954: cd 01 movw r24, r26 f956: 0e 94 c7 66 call 0xcd8e ; 0xcd8e f95a: 4b 01 movw r8, r22 f95c: 5c 01 movw r10, r24 plan_buffer_line_destinationXYZE(feedrate_mm_s); f95e: 0f 94 16 c0 call 0x3802c ; 0x3802c st_synchronize(); f962: 0f 94 e8 42 call 0x285d0 ; 0x285d0 #ifdef TMC2130 check_Z_crash(); f966: 0e 94 31 7a call 0xf462 ; 0xf462 #endif //TMC2130 current_position[axis] = 0; f96a: 10 92 9a 06 sts 0x069A, r1 ; 0x80069a f96e: 10 92 9b 06 sts 0x069B, r1 ; 0x80069b f972: 10 92 9c 06 sts 0x069C, r1 ; 0x80069c f976: 10 92 9d 06 sts 0x069D, r1 ; 0x80069d plan_set_position_curposXYZE(); f97a: 0f 94 09 bf call 0x37e12 ; 0x37e12 #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); f97e: e2 e1 ldi r30, 0x12 ; 18 f980: fc e7 ldi r31, 0x7C ; 124 f982: 65 91 lpm r22, Z+ f984: 75 91 lpm r23, Z+ f986: 85 91 lpm r24, Z+ f988: 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; f98a: 90 58 subi r25, 0x80 ; 128 f98c: a7 01 movw r20, r14 f98e: 96 01 movw r18, r12 f990: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> f994: 60 93 7c 06 sts 0x067C, r22 ; 0x80067c f998: 70 93 7d 06 sts 0x067D, r23 ; 0x80067d f99c: 80 93 7e 06 sts 0x067E, r24 ; 0x80067e f9a0: 90 93 7f 06 sts 0x067F, r25 ; 0x80067f plan_buffer_line_destinationXYZE(feedrate_mm_s); f9a4: c5 01 movw r24, r10 f9a6: b4 01 movw r22, r8 f9a8: 0f 94 16 c0 call 0x3802c ; 0x3802c st_synchronize(); f9ac: 0f 94 e8 42 call 0x285d0 ; 0x285d0 #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); f9b0: e2 e1 ldi r30, 0x12 ; 18 f9b2: fc e7 ldi r31, 0x7C ; 124 f9b4: 65 91 lpm r22, Z+ f9b6: 75 91 lpm r23, Z+ f9b8: 85 91 lpm r24, Z+ f9ba: 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; f9bc: 9b 01 movw r18, r22 f9be: ac 01 movw r20, r24 f9c0: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> f9c4: a7 01 movw r20, r14 f9c6: 96 01 movw r18, r12 f9c8: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> f9cc: 60 93 7c 06 sts 0x067C, r22 ; 0x80067c f9d0: 70 93 7d 06 sts 0x067D, r23 ; 0x80067d f9d4: 80 93 7e 06 sts 0x067E, r24 ; 0x80067e f9d8: 90 93 7f 06 sts 0x067F, r25 ; 0x80067f feedrate = homing_feedrate[axis] / 2; f9dc: 80 e0 ldi r24, 0x00 ; 0 f9de: 90 e0 ldi r25, 0x00 ; 0 f9e0: a8 ec ldi r26, 0xC8 ; 200 f9e2: b3 e4 ldi r27, 0x43 ; 67 f9e4: 80 93 b8 02 sts 0x02B8, r24 ; 0x8002b8 f9e8: 90 93 b9 02 sts 0x02B9, r25 ; 0x8002b9 f9ec: a0 93 ba 02 sts 0x02BA, r26 ; 0x8002ba f9f0: b0 93 bb 02 sts 0x02BB, r27 ; 0x8002bb feedrate_mm_s = get_feedrate_mm_s(feedrate); f9f4: bc 01 movw r22, r24 f9f6: cd 01 movw r24, r26 f9f8: 0e 94 c7 66 call 0xcd8e ; 0xcd8e plan_buffer_line_destinationXYZE(feedrate_mm_s); f9fc: 0f 94 16 c0 call 0x3802c ; 0x3802c st_synchronize(); fa00: 0f 94 e8 42 call 0x285d0 ; 0x285d0 #ifdef TMC2130 check_Z_crash(); fa04: 0e 94 31 7a call 0xf462 ; 0xf462 #endif //TMC2130 axis_is_at_home(axis); fa08: 82 e0 ldi r24, 0x02 ; 2 fa0a: 0e 94 aa 5a call 0xb554 ; 0xb554 destination[axis] = current_position[axis]; fa0e: 80 91 9a 06 lds r24, 0x069A ; 0x80069a fa12: 90 91 9b 06 lds r25, 0x069B ; 0x80069b fa16: a0 91 9c 06 lds r26, 0x069C ; 0x80069c fa1a: b0 91 9d 06 lds r27, 0x069D ; 0x80069d fa1e: 80 93 7c 06 sts 0x067C, r24 ; 0x80067c fa22: 90 93 7d 06 sts 0x067D, r25 ; 0x80067d fa26: a0 93 7e 06 sts 0x067E, r26 ; 0x80067e fa2a: b0 93 7f 06 sts 0x067F, r27 ; 0x80067f feedrate = 0.0; fa2e: 10 92 b8 02 sts 0x02B8, r1 ; 0x8002b8 fa32: 10 92 b9 02 sts 0x02B9, r1 ; 0x8002b9 fa36: 10 92 ba 02 sts 0x02BA, r1 ; 0x8002ba fa3a: 10 92 bb 02 sts 0x02BB, r1 ; 0x8002bb endstops_hit_on_purpose(); fa3e: 0f 94 fe 4d call 0x29bfc ; 0x29bfc axis_known_position[axis] = true; fa42: 70 92 91 06 sts 0x0691, r7 ; 0x800691 #ifdef TMC2130 FORCE_HIGH_POWER_END; fa46: 80 e0 ldi r24, 0x00 ; 0 fa48: 0e 94 b0 66 call 0xcd60 ; 0xcd60 fa4c: 20 cf rjmp .-448 ; 0xf88e 0000fa4e : #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 { fa4e: 2f 92 push r2 fa50: 3f 92 push r3 fa52: 4f 92 push r4 fa54: 5f 92 push r5 fa56: 6f 92 push r6 fa58: 7f 92 push r7 fa5a: 8f 92 push r8 fa5c: 9f 92 push r9 fa5e: af 92 push r10 fa60: bf 92 push r11 fa62: cf 92 push r12 fa64: df 92 push r13 fa66: ef 92 push r14 fa68: ff 92 push r15 fa6a: 0f 93 push r16 fa6c: 1f 93 push r17 fa6e: cf 93 push r28 fa70: df 93 push r29 fa72: 00 d0 rcall .+0 ; 0xfa74 fa74: 1f 92 push r1 fa76: 1f 92 push r1 fa78: cd b7 in r28, 0x3d ; 61 fa7a: de b7 in r29, 0x3e ; 62 fa7c: d8 2e mov r13, r24 fa7e: 2a 01 movw r4, r20 fa80: 3b 01 movw r6, r22 fa82: 32 2e mov r3, r18 fa84: e9 82 std Y+1, r14 ; 0x01 fa86: fa 82 std Y+2, r15 ; 0x02 fa88: 0b 83 std Y+3, r16 ; 0x03 fa8a: 1c 83 std Y+4, r17 ; 0x04 // Flag for the display update routine and to disable the print cancelation during homing. st_synchronize(); fa8c: 0f 94 e8 42 call 0x285d0 ; 0x285d0 homing_flag = true; fa90: 81 e0 ldi r24, 0x01 ; 1 fa92: 80 93 a7 0d sts 0x0DA7, r24 ; 0x800da7 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; fa96: fc 2c mov r15, r12 fa98: e3 2c mov r14, r3 fa9a: d3 10 cpse r13, r3 fa9c: 10 c0 rjmp .+32 ; 0xfabe fa9e: ed 2c mov r14, r13 faa0: dc 10 cpse r13, r12 faa2: 0d c0 rjmp .+26 ; 0xfabe // 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); faa4: 60 e0 ldi r22, 0x00 ; 0 faa6: 70 e0 ldi r23, 0x00 ; 0 faa8: 80 ea ldi r24, 0xA0 ; 160 faaa: 90 e4 ldi r25, 0x40 ; 64 faac: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 // 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; fab0: ff 24 eor r15, r15 fab2: f3 94 inc r15 fab4: ee 24 eor r14, r14 fab6: e3 94 inc r14 fab8: 22 24 eor r2, r2 faba: 23 94 inc r2 fabc: 01 c0 rjmp .+2 ; 0xfac0 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; fabe: 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(); fac0: 0f 94 36 ce call 0x39c6c ; 0x39c6c // 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; fac4: 80 91 c2 13 lds r24, 0x13C2 ; 0x8013c2 fac8: 8d 83 std Y+5, r24 ; 0x05 mbl.active = 0; faca: 10 92 c2 13 sts 0x13C2, r1 ; 0x8013c2 current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); face: 82 e0 ldi r24, 0x02 ; 2 fad0: 0f 94 d4 42 call 0x285a8 ; 0x285a8 fad4: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a fad8: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b fadc: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c fae0: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d #endif // Reset baby stepping to zero, if the babystepping has already been loaded before. if (home_z) fae4: f1 10 cpse r15, r1 babystep_undo(); fae6: 0f 94 db c9 call 0x393b6 ; 0x393b6 int l_feedmultiply = setup_for_endstop_move(); faea: 81 e0 ldi r24, 0x01 ; 1 faec: 0e 94 e8 66 call 0xcdd0 ; 0xcdd0 faf0: 8c 01 movw r16, r24 set_destination_to_current(); faf2: 0e 94 3a 68 call 0xd074 ; 0xd074 feedrate = 0.0; faf6: 10 92 b8 02 sts 0x02B8, r1 ; 0x8002b8 fafa: 10 92 b9 02 sts 0x02B9, r1 ; 0x8002b9 fafe: 10 92 ba 02 sts 0x02BA, r1 ; 0x8002ba fb02: 10 92 bb 02 sts 0x02BB, r1 ; 0x8002bb current_position[Z_AXIS] = destination[Z_AXIS]; } #endif /* QUICK_HOME */ #ifdef TMC2130 if(home_x) fb06: 22 20 and r2, r2 fb08: 09 f4 brne .+2 ; 0xfb0c fb0a: 77 c1 rjmp .+750 ; 0xfdfa { if (!calib) fb0c: 9b 8d ldd r25, Y+27 ; 0x1b fb0e: 91 11 cpse r25, r1 fb10: 6a c1 rjmp .+724 ; 0xfde6 homeaxis(X_AXIS); fb12: 50 e0 ldi r21, 0x00 ; 0 fb14: 40 e0 ldi r20, 0x00 ; 0 fb16: 61 e0 ldi r22, 0x01 ; 1 fb18: 80 e0 ldi r24, 0x00 ; 0 fb1a: 0e 94 6b 7a call 0xf4d6 ; 0xf4d6 else tmc2130_home_calibrate(X_AXIS); } if(home_y) fb1e: ee 20 and r14, r14 fb20: 31 f0 breq .+12 ; 0xfb2e { if (!calib) homeaxis(Y_AXIS); fb22: 50 e0 ldi r21, 0x00 ; 0 fb24: 40 e0 ldi r20, 0x00 ; 0 fb26: 61 e0 ldi r22, 0x01 ; 1 fb28: 81 e0 ldi r24, 0x01 ; 1 fb2a: 0e 94 6b 7a call 0xf4d6 ; 0xf4d6 if(home_x) homeaxis(X_AXIS); if(home_y) homeaxis(Y_AXIS); #endif //TMC2130 if(home_x_axis && home_x_value != 0) fb2e: dd 20 and r13, r13 fb30: e9 f0 breq .+58 ; 0xfb6c fb32: 41 14 cp r4, r1 fb34: 51 04 cpc r5, r1 fb36: 61 04 cpc r6, r1 fb38: 71 04 cpc r7, r1 fb3a: c1 f0 breq .+48 ; 0xfb6c current_position[X_AXIS]=home_x_value+cs.add_homing[X_AXIS]; fb3c: c3 01 movw r24, r6 fb3e: b2 01 movw r22, r4 fb40: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> fb44: 9b 01 movw r18, r22 fb46: ac 01 movw r20, r24 fb48: 60 91 16 0e lds r22, 0x0E16 ; 0x800e16 fb4c: 70 91 17 0e lds r23, 0x0E17 ; 0x800e17 fb50: 80 91 18 0e lds r24, 0x0E18 ; 0x800e18 fb54: 90 91 19 0e lds r25, 0x0E19 ; 0x800e19 fb58: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> fb5c: 60 93 92 06 sts 0x0692, r22 ; 0x800692 fb60: 70 93 93 06 sts 0x0693, r23 ; 0x800693 fb64: 80 93 94 06 sts 0x0694, r24 ; 0x800694 fb68: 90 93 95 06 sts 0x0695, r25 ; 0x800695 if(home_y_axis && home_y_value != 0) fb6c: 33 20 and r3, r3 fb6e: 01 f1 breq .+64 ; 0xfbb0 fb70: 89 81 ldd r24, Y+1 ; 0x01 fb72: 9a 81 ldd r25, Y+2 ; 0x02 fb74: ab 81 ldd r26, Y+3 ; 0x03 fb76: bc 81 ldd r27, Y+4 ; 0x04 fb78: 00 97 sbiw r24, 0x00 ; 0 fb7a: a1 05 cpc r26, r1 fb7c: b1 05 cpc r27, r1 fb7e: c1 f0 breq .+48 ; 0xfbb0 current_position[Y_AXIS]=home_y_value+cs.add_homing[Y_AXIS]; fb80: bc 01 movw r22, r24 fb82: cd 01 movw r24, r26 fb84: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> fb88: 9b 01 movw r18, r22 fb8a: ac 01 movw r20, r24 fb8c: 60 91 1a 0e lds r22, 0x0E1A ; 0x800e1a fb90: 70 91 1b 0e lds r23, 0x0E1B ; 0x800e1b fb94: 80 91 1c 0e lds r24, 0x0E1C ; 0x800e1c fb98: 90 91 1d 0e lds r25, 0x0E1D ; 0x800e1d fb9c: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> fba0: 60 93 96 06 sts 0x0696, r22 ; 0x800696 fba4: 70 93 97 06 sts 0x0697, r23 ; 0x800697 fba8: 80 93 98 06 sts 0x0698, r24 ; 0x800698 fbac: 90 93 99 06 sts 0x0699, r25 ; 0x800699 #if Z_HOME_DIR < 0 // If homing towards BED do Z last if(home_z) { fbb0: ff 20 and r15, r15 fbb2: 09 f4 brne .+2 ; 0xfbb6 fbb4: a2 c0 rjmp .+324 ; 0xfcfa #ifdef MESH_BED_LEVELING // If Mesh bed leveling, move X&Y to safe position for home raise_z_above(MESH_HOME_Z_SEARCH); fbb6: 60 e0 ldi r22, 0x00 ; 0 fbb8: 70 e0 ldi r23, 0x00 ; 0 fbba: 80 ea ldi r24, 0xA0 ; 160 fbbc: 90 e4 ldi r25, 0x40 ; 64 fbbe: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 if (!axis_known_position[X_AXIS]) homeaxis(X_AXIS); fbc2: 80 91 8f 06 lds r24, 0x068F ; 0x80068f fbc6: 81 11 cpse r24, r1 fbc8: 05 c0 rjmp .+10 ; 0xfbd4 fbca: 50 e0 ldi r21, 0x00 ; 0 fbcc: 40 e0 ldi r20, 0x00 ; 0 fbce: 61 e0 ldi r22, 0x01 ; 1 fbd0: 0e 94 6b 7a call 0xf4d6 ; 0xf4d6 if (!axis_known_position[Y_AXIS]) homeaxis(Y_AXIS); fbd4: 80 91 90 06 lds r24, 0x0690 ; 0x800690 fbd8: 81 11 cpse r24, r1 fbda: 06 c0 rjmp .+12 ; 0xfbe8 fbdc: 50 e0 ldi r21, 0x00 ; 0 fbde: 40 e0 ldi r20, 0x00 ; 0 fbe0: 61 e0 ldi r22, 0x01 ; 1 fbe2: 81 e0 ldi r24, 0x01 ; 1 fbe4: 0e 94 6b 7a call 0xf4d6 ; 0xf4d6 // 1st mesh bed leveling measurement point, corrected. world2machine_initialize(); fbe8: 0f 94 9b ce call 0x39d36 ; 0x39d36 world2machine(pgm_read_float(bed_ref_points_4), pgm_read_float(bed_ref_points_4+1), destination[X_AXIS], destination[Y_AXIS]); fbec: ee ed ldi r30, 0xDE ; 222 fbee: f5 ea ldi r31, 0xA5 ; 165 fbf0: 85 91 lpm r24, Z+ fbf2: 95 91 lpm r25, Z+ fbf4: a5 91 lpm r26, Z+ fbf6: b4 91 lpm r27, Z fbf8: ea ed ldi r30, 0xDA ; 218 fbfa: f5 ea ldi r31, 0xA5 ; 165 fbfc: 45 91 lpm r20, Z+ fbfe: 55 91 lpm r21, Z+ fc00: 65 91 lpm r22, Z+ fc02: 74 91 lpm r23, Z } } inline void world2machine(const float &x, const float &y, float &out_x, float &out_y) { out_x = x; fc04: 40 93 74 06 sts 0x0674, r20 ; 0x800674 fc08: 50 93 75 06 sts 0x0675, r21 ; 0x800675 fc0c: 60 93 76 06 sts 0x0676, r22 ; 0x800676 fc10: 70 93 77 06 sts 0x0677, r23 ; 0x800677 out_y = y; fc14: 80 93 78 06 sts 0x0678, r24 ; 0x800678 fc18: 90 93 79 06 sts 0x0679, r25 ; 0x800679 fc1c: a0 93 7a 06 sts 0x067A, r26 ; 0x80067a fc20: b0 93 7b 06 sts 0x067B, r27 ; 0x80067b world2machine(out_x, out_y); fc24: 68 e7 ldi r22, 0x78 ; 120 fc26: 76 e0 ldi r23, 0x06 ; 6 fc28: 84 e7 ldi r24, 0x74 ; 116 fc2a: 96 e0 ldi r25, 0x06 ; 6 fc2c: 0e 94 02 6a call 0xd404 ; 0xd404 world2machine_reset(); fc30: 0f 94 fd cd call 0x39bfa ; 0x39bfa if (destination[Y_AXIS] < Y_MIN_POS) fc34: 20 e0 ldi r18, 0x00 ; 0 fc36: 30 e0 ldi r19, 0x00 ; 0 fc38: 40 e8 ldi r20, 0x80 ; 128 fc3a: 50 ec ldi r21, 0xC0 ; 192 fc3c: 60 91 78 06 lds r22, 0x0678 ; 0x800678 fc40: 70 91 79 06 lds r23, 0x0679 ; 0x800679 fc44: 80 91 7a 06 lds r24, 0x067A ; 0x80067a fc48: 90 91 7b 06 lds r25, 0x067B ; 0x80067b fc4c: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> fc50: 87 ff sbrs r24, 7 fc52: 0c c0 rjmp .+24 ; 0xfc6c destination[Y_AXIS] = Y_MIN_POS; fc54: 80 e0 ldi r24, 0x00 ; 0 fc56: 90 e0 ldi r25, 0x00 ; 0 fc58: a0 e8 ldi r26, 0x80 ; 128 fc5a: b0 ec ldi r27, 0xC0 ; 192 fc5c: 80 93 78 06 sts 0x0678, r24 ; 0x800678 fc60: 90 93 79 06 sts 0x0679, r25 ; 0x800679 fc64: a0 93 7a 06 sts 0x067A, r26 ; 0x80067a fc68: b0 93 7b 06 sts 0x067B, r27 ; 0x80067b feedrate = homing_feedrate[X_AXIS] / 20; fc6c: 80 e0 ldi r24, 0x00 ; 0 fc6e: 90 e0 ldi r25, 0x00 ; 0 fc70: a6 e1 ldi r26, 0x16 ; 22 fc72: b3 e4 ldi r27, 0x43 ; 67 fc74: 80 93 b8 02 sts 0x02B8, r24 ; 0x8002b8 fc78: 90 93 b9 02 sts 0x02B9, r25 ; 0x8002b9 fc7c: a0 93 ba 02 sts 0x02BA, r26 ; 0x8002ba fc80: b0 93 bb 02 sts 0x02BB, r27 ; 0x8002bb fc84: 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(); fc88: 0f 94 09 bf call 0x37e12 ; 0x37e12 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); fc8c: 60 91 b8 02 lds r22, 0x02B8 ; 0x8002b8 fc90: 70 91 b9 02 lds r23, 0x02B9 ; 0x8002b9 fc94: 80 91 ba 02 lds r24, 0x02BA ; 0x8002ba fc98: 90 91 bb 02 lds r25, 0x02BB ; 0x8002bb fc9c: 0f 94 16 c0 call 0x3802c ; 0x3802c st_synchronize(); fca0: 0f 94 e8 42 call 0x285d0 ; 0x285d0 current_position[X_AXIS] = destination[X_AXIS]; fca4: 80 91 74 06 lds r24, 0x0674 ; 0x800674 fca8: 90 91 75 06 lds r25, 0x0675 ; 0x800675 fcac: a0 91 76 06 lds r26, 0x0676 ; 0x800676 fcb0: b0 91 77 06 lds r27, 0x0677 ; 0x800677 fcb4: 80 93 92 06 sts 0x0692, r24 ; 0x800692 fcb8: 90 93 93 06 sts 0x0693, r25 ; 0x800693 fcbc: a0 93 94 06 sts 0x0694, r26 ; 0x800694 fcc0: b0 93 95 06 sts 0x0695, r27 ; 0x800695 current_position[Y_AXIS] = destination[Y_AXIS]; fcc4: 80 91 78 06 lds r24, 0x0678 ; 0x800678 fcc8: 90 91 79 06 lds r25, 0x0679 ; 0x800679 fccc: a0 91 7a 06 lds r26, 0x067A ; 0x80067a fcd0: b0 91 7b 06 lds r27, 0x067B ; 0x80067b fcd4: 80 93 96 06 sts 0x0696, r24 ; 0x800696 fcd8: 90 93 97 06 sts 0x0697, r25 ; 0x800697 fcdc: a0 93 98 06 sts 0x0698, r26 ; 0x800698 fce0: b0 93 99 06 sts 0x0699, r27 ; 0x800699 fce4: 81 e0 ldi r24, 0x01 ; 1 fce6: 80 93 b7 02 sts 0x02B7, r24 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> enable_endstops(true); endstops_hit_on_purpose(); fcea: 0f 94 fe 4d call 0x29bfc ; 0x29bfc homeaxis(Z_AXIS); fcee: 50 e0 ldi r21, 0x00 ; 0 fcf0: 40 e0 ldi r20, 0x00 ; 0 fcf2: 61 e0 ldi r22, 0x01 ; 1 fcf4: 82 e0 ldi r24, 0x02 ; 2 fcf6: 0e 94 6b 7a call 0xf4d6 ; 0xf4d6 homeaxis(Z_AXIS); #endif // MESH_BED_LEVELING } #endif // Z_HOME_DIR < 0 if(home_z_axis && home_z_value != 0) fcfa: cc 20 and r12, r12 fcfc: e9 f0 breq .+58 ; 0xfd38 fcfe: 81 14 cp r8, r1 fd00: 91 04 cpc r9, r1 fd02: a1 04 cpc r10, r1 fd04: b1 04 cpc r11, r1 fd06: c1 f0 breq .+48 ; 0xfd38 current_position[Z_AXIS]=home_z_value+cs.add_homing[Z_AXIS]; fd08: c5 01 movw r24, r10 fd0a: b4 01 movw r22, r8 fd0c: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> fd10: 9b 01 movw r18, r22 fd12: ac 01 movw r20, r24 fd14: 60 91 1e 0e lds r22, 0x0E1E ; 0x800e1e fd18: 70 91 1f 0e lds r23, 0x0E1F ; 0x800e1f fd1c: 80 91 20 0e lds r24, 0x0E20 ; 0x800e20 fd20: 90 91 21 0e lds r25, 0x0E21 ; 0x800e21 fd24: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> fd28: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a fd2c: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b fd30: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c fd34: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d // 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(); fd38: 0f 94 09 bf call 0x37e12 ; 0x37e12 clean_up_after_endstop_move(l_feedmultiply); fd3c: c8 01 movw r24, r16 fd3e: 0e 94 ce 66 call 0xcd9c ; 0xcd9c endstops_hit_on_purpose(); fd42: 0f 94 fe 4d call 0x29bfc ; 0x29bfc // Load the machine correction matrix world2machine_initialize(); fd46: 0f 94 9b ce call 0x39d36 ; 0x39d36 // and correct the current_position XY axes to match the transformed coordinate system. world2machine_update_current(); fd4a: 0f 94 39 cc call 0x39872 ; 0x39872 #ifdef MESH_BED_LEVELING if (home_x_axis || home_y_axis || without_mbl || home_z_axis) fd4e: d1 10 cpse r13, r1 fd50: 07 c0 rjmp .+14 ; 0xfd60 fd52: 31 10 cpse r3, r1 fd54: 05 c0 rjmp .+10 ; 0xfd60 fd56: 8c 8d ldd r24, Y+28 ; 0x1c fd58: 81 11 cpse r24, r1 fd5a: 02 c0 rjmp .+4 ; 0xfd60 fd5c: cc 20 and r12, r12 fd5e: 39 f1 breq .+78 ; 0xfdae { if (! home_z && mbl_was_active) { fd60: f1 10 cpse r15, r1 fd62: 25 c0 rjmp .+74 ; 0xfdae fd64: 9d 81 ldd r25, Y+5 ; 0x05 fd66: 99 23 and r25, r25 fd68: 11 f1 breq .+68 ; 0xfdae // Re-enable the mesh bed leveling if only the X and Y axes were re-homed. mbl.active = true; fd6a: 81 e0 ldi r24, 0x01 ; 1 fd6c: 80 93 c2 13 sts 0x13C2, r24 ; 0x8013c2 // 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)); fd70: 0f 94 d4 42 call 0x285a8 ; 0x285a8 fd74: 6b 01 movw r12, r22 fd76: 7c 01 movw r14, r24 fd78: 80 e0 ldi r24, 0x00 ; 0 fd7a: 0f 94 d4 42 call 0x285a8 ; 0x285a8 fd7e: a7 01 movw r20, r14 fd80: 96 01 movw r18, r12 fd82: 0f 94 b1 a1 call 0x34362 ; 0x34362 fd86: 9b 01 movw r18, r22 fd88: ac 01 movw r20, r24 fd8a: 60 91 9a 06 lds r22, 0x069A ; 0x80069a fd8e: 70 91 9b 06 lds r23, 0x069B ; 0x80069b fd92: 80 91 9c 06 lds r24, 0x069C ; 0x80069c fd96: 90 91 9d 06 lds r25, 0x069D ; 0x80069d fd9a: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> fd9e: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a fda2: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b fda6: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c fdaa: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d } #endif prusa_statistics(20); st_synchronize(); fdae: 0f 94 e8 42 call 0x285d0 ; 0x285d0 homing_flag = false; fdb2: 10 92 a7 0d sts 0x0DA7, r1 ; 0x800da7 #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 } fdb6: 0f 90 pop r0 fdb8: 0f 90 pop r0 fdba: 0f 90 pop r0 fdbc: 0f 90 pop r0 fdbe: 0f 90 pop r0 fdc0: df 91 pop r29 fdc2: cf 91 pop r28 fdc4: 1f 91 pop r17 fdc6: 0f 91 pop r16 fdc8: ff 90 pop r15 fdca: ef 90 pop r14 fdcc: df 90 pop r13 fdce: cf 90 pop r12 fdd0: bf 90 pop r11 fdd2: af 90 pop r10 fdd4: 9f 90 pop r9 fdd6: 8f 90 pop r8 fdd8: 7f 90 pop r7 fdda: 6f 90 pop r6 fddc: 5f 90 pop r5 fdde: 4f 90 pop r4 fde0: 3f 90 pop r3 fde2: 2f 90 pop r2 fde4: 08 95 ret if(home_x) { if (!calib) homeaxis(X_AXIS); else tmc2130_home_calibrate(X_AXIS); fde6: 80 e0 ldi r24, 0x00 ; 0 fde8: 0f 94 9b 22 call 0x24536 ; 0x24536 } if(home_y) fdec: ee 20 and r14, r14 fdee: 09 f4 brne .+2 ; 0xfdf2 fdf0: 9e ce rjmp .-708 ; 0xfb2e { if (!calib) homeaxis(Y_AXIS); else tmc2130_home_calibrate(Y_AXIS); fdf2: 81 e0 ldi r24, 0x01 ; 1 fdf4: 0f 94 9b 22 call 0x24536 ; 0x24536 fdf8: 9a ce rjmp .-716 ; 0xfb2e homeaxis(X_AXIS); else tmc2130_home_calibrate(X_AXIS); } if(home_y) fdfa: ee 20 and r14, r14 fdfc: 09 f4 brne .+2 ; 0xfe00 fdfe: 97 ce rjmp .-722 ; 0xfb2e { if (!calib) fe00: ab 8d ldd r26, Y+27 ; 0x1b fe02: aa 23 and r26, r26 fe04: 09 f4 brne .+2 ; 0xfe08 fe06: 8d ce rjmp .-742 ; 0xfb22 fe08: f4 cf rjmp .-24 ; 0xfdf2 0000fe0a : 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) { fe0a: 8f 92 push r8 fe0c: 9f 92 push r9 fe0e: af 92 push r10 fe10: bf 92 push r11 fe12: cf 92 push r12 fe14: ef 92 push r14 fe16: ff 92 push r15 fe18: 0f 93 push r16 fe1a: 1f 93 push r17 fe1c: 26 2f mov r18, r22 #ifdef TMC2130 gcode_G28(home_x_axis, 0, home_y_axis, 0, home_z_axis, 0, false, true); fe1e: 91 e0 ldi r25, 0x01 ; 1 fe20: 9f 93 push r25 fe22: 1f 92 push r1 fe24: 81 2c mov r8, r1 fe26: 91 2c mov r9, r1 fe28: 54 01 movw r10, r8 fe2a: c4 2e mov r12, r20 fe2c: e1 2c mov r14, r1 fe2e: f1 2c mov r15, r1 fe30: 87 01 movw r16, r14 fe32: 40 e0 ldi r20, 0x00 ; 0 fe34: 50 e0 ldi r21, 0x00 ; 0 fe36: ba 01 movw r22, r20 fe38: 0e 94 27 7d call 0xfa4e ; 0xfa4e fe3c: 0f 90 pop r0 fe3e: 0f 90 pop r0 #else gcode_G28(home_x_axis, 0, home_y_axis, 0, home_z_axis, 0, true); #endif //TMC2130 } fe40: 1f 91 pop r17 fe42: 0f 91 pop r16 fe44: ff 90 pop r15 fe46: ef 90 pop r14 fe48: cf 90 pop r12 fe4a: bf 90 pop r11 fe4c: af 90 pop r10 fe4e: 9f 90 pop r9 fe50: 8f 90 pop r8 fe52: 08 95 ret 0000fe54 : // 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(); fe54: 86 e8 ldi r24, 0x86 ; 134 fe56: 93 e0 ldi r25, 0x03 ; 3 fe58: 0f 94 ef 2b call 0x257de ; 0x257de ::start()> if (buflen && ((CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_USB) || (CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_USB_WITH_LINENR))) fe5c: 80 91 a3 10 lds r24, 0x10A3 ; 0x8010a3 fe60: 90 91 a4 10 lds r25, 0x10A4 ; 0x8010a4 fe64: 89 2b or r24, r25 fe66: 79 f0 breq .+30 ; 0xfe86 fe68: e0 91 92 12 lds r30, 0x1292 ; 0x801292 fe6c: f0 91 93 12 lds r31, 0x1293 ; 0x801293 fe70: eb 55 subi r30, 0x5B ; 91 fe72: ff 4e sbci r31, 0xEF ; 239 fe74: 80 81 ld r24, Z fe76: 81 30 cpi r24, 0x01 ; 1 fe78: 11 f0 breq .+4 ; 0xfe7e fe7a: 86 30 cpi r24, 0x06 ; 6 fe7c: 21 f4 brne .+8 ; 0xfe86 SERIAL_PROTOCOLLNRPGM(MSG_OK); fe7e: 8b eb ldi r24, 0xBB ; 187 fe80: 9d e6 ldi r25, 0x6D ; 109 fe82: 0c 94 7b 79 jmp 0xf2f6 ; 0xf2f6 } fe86: 08 95 ret 0000fe88 : void cmdqueue_reset() { while (buflen) fe88: 80 91 a3 10 lds r24, 0x10A3 ; 0x8010a3 fe8c: 90 91 a4 10 lds r25, 0x10A4 ; 0x8010a4 fe90: 89 2b or r24, r25 fe92: 29 f0 breq .+10 ; 0xfe9e { // printf_P(PSTR("dumping: \"%s\" of type %u\n"), cmdbuffer+bufindr+CMDHDRSIZE, CMDBUFFER_CURRENT_TYPE); ClearToSend(); fe94: 0e 94 2a 7f call 0xfe54 ; 0xfe54 cmdqueue_pop_front(); fe98: 0e 94 bc 76 call 0xed78 ; 0xed78 fe9c: f5 cf rjmp .-22 ; 0xfe88 } bufindr = 0; fe9e: 10 92 93 12 sts 0x1293, r1 ; 0x801293 fea2: 10 92 92 12 sts 0x1292, r1 ; 0x801292 bufindw = 0; fea6: 10 92 a1 10 sts 0x10A1, r1 ; 0x8010a1 <_ZL7bufindw.lto_priv.550+0x1> feaa: 10 92 a0 10 sts 0x10A0, r1 ; 0x8010a0 <_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; feae: 81 e0 ldi r24, 0x01 ; 1 feb0: 80 93 a2 10 sts 0x10A2, r24 ; 0x8010a2 } feb4: 08 95 ret 0000feb6 : } // G81_M420 Mesh bed leveling status static void gcode_G81_M420() { feb6: ef 92 push r14 feb8: ff 92 push r15 feba: 0f 93 push r16 febc: 1f 93 push r17 febe: cf 93 push r28 fec0: df 93 push r29 if (mbl.active) { fec2: 80 91 c2 13 lds r24, 0x13C2 ; 0x8013c2 fec6: 88 23 and r24, r24 fec8: 89 f1 breq .+98 ; 0xff2c } } } void mesh_bed_leveling::print() { SERIAL_PROTOCOLLNPGM("Num X,Y: " STRINGIFY(MESH_NUM_X_POINTS) "," STRINGIFY(MESH_NUM_Y_POINTS)); feca: 86 e2 ldi r24, 0x26 ; 38 fecc: 9d e7 ldi r25, 0x7D ; 125 fece: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 SERIAL_PROTOCOLLNPGM("Z search height: " STRINGIFY(MESH_HOME_Z_SEARCH)); fed2: 80 e1 ldi r24, 0x10 ; 16 fed4: 9d e7 ldi r25, 0x7D ; 125 fed6: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 SERIAL_PROTOCOLLNPGM("Measured points:"); feda: 8f ef ldi r24, 0xFF ; 255 fedc: 9c e7 ldi r25, 0x7C ; 124 fede: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 for (uint8_t y = MESH_NUM_Y_POINTS; y-- > 0;) { fee2: c7 e0 ldi r28, 0x07 ; 7 fee4: dc e1 ldi r29, 0x1C ; 28 fee6: c1 50 subi r28, 0x01 ; 1 fee8: 58 f1 brcs .+86 ; 0xff40 feea: cd 9f mul r28, r29 feec: 70 01 movw r14, r0 feee: 11 24 eor r1, r1 fef0: 01 e0 ldi r16, 0x01 ; 1 fef2: 10 e0 ldi r17, 0x00 ; 0 for (uint8_t x = 0; x < MESH_NUM_X_POINTS; x++) { SERIAL_PROTOCOLPGM(" "); fef4: 8c ef ldi r24, 0xFC ; 252 fef6: 9c e7 ldi r25, 0x7C ; 124 fef8: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_PROTOCOL_F(z_values[y][x], 5); fefc: f8 01 movw r30, r16 fefe: ee 0f add r30, r30 ff00: ff 1f adc r31, r31 ff02: ee 0f add r30, r30 ff04: ff 1f adc r31, r31 ff06: ee 0d add r30, r14 ff08: ff 1d adc r31, r15 ff0a: e1 54 subi r30, 0x41 ; 65 ff0c: fc 4e sbci r31, 0xEC ; 236 ff0e: 60 81 ld r22, Z ff10: 71 81 ldd r23, Z+1 ; 0x01 ff12: 82 81 ldd r24, Z+2 ; 0x02 ff14: 93 81 ldd r25, Z+3 ; 0x03 ff16: 45 e0 ldi r20, 0x05 ; 5 ff18: 0f 94 87 d5 call 0x3ab0e ; 0x3ab0e ff1c: 0f 5f subi r16, 0xFF ; 255 ff1e: 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++) { ff20: 08 30 cpi r16, 0x08 ; 8 ff22: 11 05 cpc r17, r1 ff24: 39 f7 brne .-50 ; 0xfef4 SERIAL_PROTOCOLPGM(" "); SERIAL_PROTOCOL_F(z_values[y][x], 5); } SERIAL_PROTOCOLLN(); ff26: 0f 94 fd d5 call 0x3abfa ; 0x3abfa ff2a: dd cf rjmp .-70 ; 0xfee6 mbl.print(); } else SERIAL_PROTOCOLLNPGM("Mesh bed leveling not active."); ff2c: 83 e3 ldi r24, 0x33 ; 51 ff2e: 9d e7 ldi r25, 0x7D ; 125 return; } ff30: df 91 pop r29 ff32: cf 91 pop r28 ff34: 1f 91 pop r17 ff36: 0f 91 pop r16 ff38: ff 90 pop r15 ff3a: ef 90 pop r14 static void gcode_G81_M420() { if (mbl.active) { mbl.print(); } else SERIAL_PROTOCOLLNPGM("Mesh bed leveling not active."); ff3c: 0c 94 7b 79 jmp 0xf2f6 ; 0xf2f6 return; } ff40: df 91 pop r29 ff42: cf 91 pop r28 ff44: 1f 91 pop r17 ff46: 0f 91 pop r16 ff48: ff 90 pop r15 ff4a: ef 90 pop r14 ff4c: 08 95 ret 0000ff4e : /** * Output a "busy" message at regular intervals * while the machine is not accepting commands. */ void host_keepalive() { ff4e: 8f 92 push r8 ff50: 9f 92 push r9 ff52: af 92 push r10 ff54: bf 92 push r11 ff56: cf 92 push r12 ff58: df 92 push r13 ff5a: ef 92 push r14 ff5c: ff 92 push r15 #ifndef HOST_KEEPALIVE_FEATURE return; #endif //HOST_KEEPALIVE_FEATURE if (farm_mode) return; long ms = _millis(); ff5e: 0f 94 4c 29 call 0x25298 ; 0x25298 ff62: 6b 01 movw r12, r22 ff64: 7c 01 movw r14, r24 if (host_keepalive_interval && busy_state != NOT_BUSY) { ff66: 20 91 2f 02 lds r18, 0x022F ; 0x80022f ff6a: 22 23 and r18, r18 ff6c: 09 f1 breq .+66 ; 0xffb0 ff6e: 40 91 be 02 lds r20, 0x02BE ; 0x8002be ff72: 41 30 cpi r20, 0x01 ; 1 ff74: e9 f0 breq .+58 ; 0xffb0 if ((ms - prev_busy_signal_ms) < (long)(1000L * host_keepalive_interval)) return; ff76: 80 91 10 02 lds r24, 0x0210 ; 0x800210 ff7a: 90 91 11 02 lds r25, 0x0211 ; 0x800211 ff7e: a0 91 12 02 lds r26, 0x0212 ; 0x800212 ff82: b0 91 13 02 lds r27, 0x0213 ; 0x800213 ff86: 46 01 movw r8, r12 ff88: 57 01 movw r10, r14 ff8a: 88 1a sub r8, r24 ff8c: 99 0a sbc r9, r25 ff8e: aa 0a sbc r10, r26 ff90: bb 0a sbc r11, r27 ff92: 30 e0 ldi r19, 0x00 ; 0 ff94: a8 ee ldi r26, 0xE8 ; 232 ff96: b3 e0 ldi r27, 0x03 ; 3 ff98: 0f 94 bc dc call 0x3b978 ; 0x3b978 <__umulhisi3> ff9c: 86 16 cp r8, r22 ff9e: 97 06 cpc r9, r23 ffa0: a8 06 cpc r10, r24 ffa2: b9 06 cpc r11, r25 ffa4: 6c f0 brlt .+26 ; 0xffc0 switch (busy_state) { ffa6: 44 30 cpi r20, 0x04 ; 4 ffa8: 31 f1 breq .+76 ; 0xfff6 ffaa: 9c f4 brge .+38 ; 0xffd2 ffac: 42 30 cpi r20, 0x02 ; 2 ffae: d4 f4 brge .+52 ; 0xffe4 break; default: break; } } prev_busy_signal_ms = ms; ffb0: c0 92 10 02 sts 0x0210, r12 ; 0x800210 ffb4: d0 92 11 02 sts 0x0211, r13 ; 0x800211 ffb8: e0 92 12 02 sts 0x0212, r14 ; 0x800212 ffbc: f0 92 13 02 sts 0x0213, r15 ; 0x800213 } ffc0: ff 90 pop r15 ffc2: ef 90 pop r14 ffc4: df 90 pop r13 ffc6: cf 90 pop r12 ffc8: bf 90 pop r11 ffca: af 90 pop r10 ffcc: 9f 90 pop r9 ffce: 8f 90 pop r8 ffd0: 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) { ffd2: 45 30 cpi r20, 0x05 ; 5 ffd4: 69 f7 brne .-38 ; 0xffb0 case PAUSED_FOR_USER: SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: paused for user"); break; case PAUSED_FOR_INPUT: SERIAL_ECHO_START; ffd6: 82 ec ldi r24, 0xC2 ; 194 ffd8: 9b ea ldi r25, 0xAB ; 171 ffda: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHOLNPGM("busy: paused for input"); ffde: 88 ea ldi r24, 0xA8 ; 168 ffe0: 9b e7 ldi r25, 0x7B ; 123 ffe2: 06 c0 rjmp .+12 ; 0xfff0 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; ffe4: 82 ec ldi r24, 0xC2 ; 194 ffe6: 9b ea ldi r25, 0xAB ; 171 ffe8: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHOLNPGM("busy: processing"); ffec: 85 ed ldi r24, 0xD5 ; 213 ffee: 9b e7 ldi r25, 0x7B ; 123 SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: paused for user"); break; case PAUSED_FOR_INPUT: SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: paused for input"); fff0: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 fff4: dd cf rjmp .-70 ; 0xffb0 case IN_PROCESS: SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: processing"); break; case PAUSED_FOR_USER: SERIAL_ECHO_START; fff6: 82 ec ldi r24, 0xC2 ; 194 fff8: 9b ea ldi r25, 0xAB ; 171 fffa: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHOLNPGM("busy: paused for user"); fffe: 8f eb ldi r24, 0xBF ; 191 10000: 9b e7 ldi r25, 0x7B ; 123 10002: f6 cf rjmp .-20 ; 0xfff0 00010004 : //} } #endif //TACH_0 void checkFans() { 10004: cf 92 push r12 10006: df 92 push r13 10008: ef 92 push r14 1000a: ff 92 push r15 1000c: 0f 93 push r16 1000e: 1f 93 push r17 10010: cf 93 push r28 10012: df 93 push r29 10014: 1f 92 push r1 10016: 1f 92 push r1 10018: cd b7 in r28, 0x3d ; 61 1001a: 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)) { 1001c: 0f 94 4c 29 call 0x25298 ; 0x25298 10020: 00 91 c0 17 lds r16, 0x17C0 ; 0x8017c0 10024: 10 91 c1 17 lds r17, 0x17C1 ; 0x8017c1 10028: 20 91 c2 17 lds r18, 0x17C2 ; 0x8017c2 1002c: 30 91 c3 17 lds r19, 0x17C3 ; 0x8017c3 10030: 60 1b sub r22, r16 10032: 71 0b sbc r23, r17 10034: 82 0b sbc r24, r18 10036: 93 0b sbc r25, r19 10038: 69 38 cpi r22, 0x89 ; 137 1003a: 73 41 sbci r23, 0x13 ; 19 1003c: 81 05 cpc r24, r1 1003e: 91 05 cpc r25, r1 10040: d0 f0 brcs .+52 ; 0x10076 10042: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 10046: 81 11 cpse r24, r1 10048: 16 c0 rjmp .+44 ; 0x10076 extruder_autofan_last_check = _millis(); 1004a: 0f 94 4c 29 call 0x25298 ; 0x25298 1004e: 60 93 c0 17 sts 0x17C0, r22 ; 0x8017c0 10052: 70 93 c1 17 sts 0x17C1, r23 ; 0x8017c1 10056: 80 93 c2 17 sts 0x17C2, r24 ; 0x8017c2 1005a: 90 93 c3 17 sts 0x17C3, r25 ; 0x8017c3 fanSpeedBckp = fanSpeedSoftPwm; 1005e: 80 91 a6 04 lds r24, 0x04A6 ; 0x8004a6 10062: 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 10066: 8b 34 cpi r24, 0x4B ; 75 10068: 18 f0 brcs .+6 ; 0x10070 // printf_P(PSTR("fanSpeedSoftPwm 1: %d\n"), fanSpeedSoftPwm); fanSpeedSoftPwm = 255; 1006a: 8f ef ldi r24, 0xFF ; 255 1006c: 80 93 a6 04 sts 0x04A6, r24 ; 0x8004a6 } fan_measuring = true; 10070: 81 e0 ldi r24, 0x01 ; 1 10072: 80 93 6f 06 sts 0x066F, r24 ; 0x80066f } if ((_millis() - extruder_autofan_last_check > FAN_CHECK_DURATION) && (fan_measuring)) { 10076: 0f 94 4c 29 call 0x25298 ; 0x25298 1007a: 00 91 c0 17 lds r16, 0x17C0 ; 0x8017c0 1007e: 10 91 c1 17 lds r17, 0x17C1 ; 0x8017c1 10082: 20 91 c2 17 lds r18, 0x17C2 ; 0x8017c2 10086: 30 91 c3 17 lds r19, 0x17C3 ; 0x8017c3 1008a: 60 1b sub r22, r16 1008c: 71 0b sbc r23, r17 1008e: 82 0b sbc r24, r18 10090: 93 0b sbc r25, r19 10092: 65 36 cpi r22, 0x65 ; 101 10094: 71 05 cpc r23, r1 10096: 81 05 cpc r24, r1 10098: 91 05 cpc r25, r1 1009a: 08 f4 brcc .+2 ; 0x1009e 1009c: 57 c1 rjmp .+686 ; 0x1034c 1009e: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 100a2: 88 23 and r24, r24 100a4: 09 f4 brne .+2 ; 0x100a8 100a6: 52 c1 rjmp .+676 ; 0x1034c #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))); 100a8: 60 91 e2 05 lds r22, 0x05E2 ; 0x8005e2 100ac: 70 91 e3 05 lds r23, 0x05E3 ; 0x8005e3 100b0: 07 2e mov r0, r23 100b2: 00 0c add r0, r0 100b4: 88 0b sbc r24, r24 100b6: 99 0b sbc r25, r25 100b8: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 100bc: 6b 01 movw r12, r22 100be: 7c 01 movw r14, r24 100c0: 0f 94 4c 29 call 0x25298 ; 0x25298 100c4: 00 91 c0 17 lds r16, 0x17C0 ; 0x8017c0 100c8: 10 91 c1 17 lds r17, 0x17C1 ; 0x8017c1 100cc: 20 91 c2 17 lds r18, 0x17C2 ; 0x8017c2 100d0: 30 91 c3 17 lds r19, 0x17C3 ; 0x8017c3 100d4: 60 1b sub r22, r16 100d6: 71 0b sbc r23, r17 100d8: 82 0b sbc r24, r18 100da: 93 0b sbc r25, r19 100dc: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 100e0: 9b 01 movw r18, r22 100e2: ac 01 movw r20, r24 100e4: 60 e0 ldi r22, 0x00 ; 0 100e6: 70 e0 ldi r23, 0x00 ; 0 100e8: 8a e7 ldi r24, 0x7A ; 122 100ea: 93 e4 ldi r25, 0x43 ; 67 100ec: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 100f0: a7 01 movw r20, r14 100f2: 96 01 movw r18, r12 100f4: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 100f8: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> 100fc: 70 93 ca 03 sts 0x03CA, r23 ; 0x8003ca 10100: 60 93 c9 03 sts 0x03C9, r22 ; 0x8003c9 fan_speed[1] = (fan_edge_counter[1] * (float(250) / (_millis() - extruder_autofan_last_check))); 10104: 60 91 e4 05 lds r22, 0x05E4 ; 0x8005e4 10108: 70 91 e5 05 lds r23, 0x05E5 ; 0x8005e5 1010c: 07 2e mov r0, r23 1010e: 00 0c add r0, r0 10110: 88 0b sbc r24, r24 10112: 99 0b sbc r25, r25 10114: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 10118: 6b 01 movw r12, r22 1011a: 7c 01 movw r14, r24 1011c: 0f 94 4c 29 call 0x25298 ; 0x25298 10120: 00 91 c0 17 lds r16, 0x17C0 ; 0x8017c0 10124: 10 91 c1 17 lds r17, 0x17C1 ; 0x8017c1 10128: 20 91 c2 17 lds r18, 0x17C2 ; 0x8017c2 1012c: 30 91 c3 17 lds r19, 0x17C3 ; 0x8017c3 10130: 60 1b sub r22, r16 10132: 71 0b sbc r23, r17 10134: 82 0b sbc r24, r18 10136: 93 0b sbc r25, r19 10138: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 1013c: 9b 01 movw r18, r22 1013e: ac 01 movw r20, r24 10140: 60 e0 ldi r22, 0x00 ; 0 10142: 70 e0 ldi r23, 0x00 ; 0 10144: 8a e7 ldi r24, 0x7A ; 122 10146: 93 e4 ldi r25, 0x43 ; 67 10148: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 1014c: a7 01 movw r20, r14 1014e: 96 01 movw r18, r12 10150: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 10154: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> 10158: 8b 01 movw r16, r22 1015a: 70 93 cc 03 sts 0x03CC, r23 ; 0x8003cc 1015e: 60 93 cb 03 sts 0x03CB, r22 ; 0x8003cb /*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; 10162: 10 92 e3 05 sts 0x05E3, r1 ; 0x8005e3 10166: 10 92 e2 05 sts 0x05E2, r1 ; 0x8005e2 fan_edge_counter[1] = 0; 1016a: 10 92 e5 05 sts 0x05E5, r1 ; 0x8005e5 1016e: 10 92 e4 05 sts 0x05E4, r1 ; 0x8005e4 void checkFanSpeed() { uint8_t max_fan_errors[2]; #ifdef FAN_SOFT_PWM max_fan_errors[1] = 3; // 15 seconds (Print fan) 10172: 83 e0 ldi r24, 0x03 ; 3 10174: 8a 83 std Y+2, r24 ; 0x02 max_fan_errors[0] = 2; // 10 seconds (Hotend fan) 10176: 82 e0 ldi r24, 0x02 ; 2 10178: 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) 1017a: 80 91 38 02 lds r24, 0x0238 ; 0x800238 1017e: 88 23 and r24, r24 10180: 51 f0 breq .+20 ; 0x10196 fans_check_enabled = (eeprom_read_byte((uint8_t*)EEPROM_FAN_CHECK_ENABLED) > 0); 10182: 87 e8 ldi r24, 0x87 ; 135 10184: 9f e0 ldi r25, 0x0F ; 15 10186: 0f 94 1c dc call 0x3b838 ; 0x3b838 1018a: 91 e0 ldi r25, 0x01 ; 1 1018c: 81 11 cpse r24, r1 1018e: 01 c0 rjmp .+2 ; 0x10192 10190: 90 e0 ldi r25, 0x00 ; 0 10192: 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]++;} 10196: 80 91 c9 03 lds r24, 0x03C9 ; 0x8003c9 1019a: 90 91 ca 03 lds r25, 0x03CA ; 0x8003ca 1019e: 44 97 sbiw r24, 0x14 ; 20 101a0: 0c f0 brlt .+2 ; 0x101a4 101a2: 9d c0 rjmp .+314 ; 0x102de 101a4: 20 e0 ldi r18, 0x00 ; 0 101a6: 30 e0 ldi r19, 0x00 ; 0 101a8: 48 e4 ldi r20, 0x48 ; 72 101aa: 52 e4 ldi r21, 0x42 ; 66 101ac: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 101b0: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 101b4: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 101b8: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 101bc: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 101c0: 18 16 cp r1, r24 101c2: 0c f0 brlt .+2 ; 0x101c6 101c4: 8c c0 rjmp .+280 ; 0x102de 101c6: 80 91 4e 03 lds r24, 0x034E ; 0x80034e 101ca: 8f 5f subi r24, 0xFF ; 255 101cc: 80 93 4e 03 sts 0x034E, r24 ; 0x80034e 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]++; 101d0: 05 30 cpi r16, 0x05 ; 5 101d2: 11 05 cpc r17, r1 101d4: 0c f0 brlt .+2 ; 0x101d8 101d6: 89 c0 rjmp .+274 ; 0x102ea 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); 101d8: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 101dc: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 101e0: 98 17 cp r25, r24 101e2: 09 f4 brne .+2 ; 0x101e6 101e4: 7f c0 rjmp .+254 ; 0x102e4 101e6: e0 91 a6 0d lds r30, 0x0DA6 ; 0x800da6 101ea: 8e e6 ldi r24, 0x6E ; 110 101ec: e8 9f mul r30, r24 101ee: f0 01 movw r30, r0 101f0: 11 24 eor r1, r1 101f2: e5 5f subi r30, 0xF5 ; 245 101f4: f8 4f sbci r31, 0xF8 ; 248 101f6: 80 81 ld r24, Z 101f8: 8c 34 cpi r24, 0x4C ; 76 101fa: 08 f4 brcc .+2 ; 0x101fe 101fc: 76 c0 rjmp .+236 ; 0x102ea 101fe: 80 91 4f 03 lds r24, 0x034F ; 0x80034f 10202: 8f 5f subi r24, 0xFF ; 255 10204: 80 93 4f 03 sts 0x034F, r24 ; 0x80034f 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){ 10208: 80 91 4e 03 lds r24, 0x034E ; 0x80034e 1020c: 81 11 cpse r24, r1 1020e: 0b c0 rjmp .+22 ; 0x10226 10210: 80 91 4f 03 lds r24, 0x034F ; 0x80034f 10214: 81 11 cpse r24, r1 10216: 07 c0 rjmp .+14 ; 0x10226 10218: 80 91 e6 03 lds r24, 0x03E6 ; 0x8003e6 1021c: 82 30 cpi r24, 0x02 ; 2 1021e: 19 f4 brne .+6 ; 0x10226 // we may even send some info to the LCD from here fan_check_error = EFCE_FIXED; 10220: 81 e0 ldi r24, 0x01 ; 1 10222: 80 93 e6 03 sts 0x03E6, r24 ; 0x8003e6 } if ((fan_check_error == EFCE_FIXED) && !printer_active()){ 10226: 80 91 e6 03 lds r24, 0x03E6 ; 0x8003e6 1022a: 81 30 cpi r24, 0x01 ; 1 1022c: 61 f4 brne .+24 ; 0x10246 1022e: 0e 94 e1 67 call 0xcfc2 ; 0xcfc2 10232: 81 11 cpse r24, r1 10234: 08 c0 rjmp .+16 ; 0x10246 fan_check_error = EFCE_OK; //if the issue is fixed while the printer is doing nothing, reenable processing immediately. 10236: 10 92 e6 03 sts 0x03E6, r1 ; 0x8003e6 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 1023a: 10 92 d5 03 sts 0x03D5, r1 ; 0x8003d5 <_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 1023e: 83 e7 ldi r24, 0x73 ; 115 10240: 90 e7 ldi r25, 0x70 ; 112 10242: 0e 94 5d f1 call 0x1e2ba ; 0x1e2ba } if (fans_check_enabled && (fan_check_error != EFCE_REPORTED)) 10246: 80 91 38 02 lds r24, 0x0238 ; 0x800238 1024a: 88 23 and r24, r24 1024c: 09 f4 brne .+2 ; 0x10250 1024e: 6e c0 rjmp .+220 ; 0x1032c 10250: 80 91 e6 03 lds r24, 0x03E6 ; 0x8003e6 10254: 82 30 cpi r24, 0x02 ; 2 10256: 09 f4 brne .+2 ; 0x1025a 10258: 69 c0 rjmp .+210 ; 0x1032c 1025a: 8e e4 ldi r24, 0x4E ; 78 1025c: e8 2e mov r14, r24 1025e: 83 e0 ldi r24, 0x03 ; 3 10260: f8 2e mov r15, r24 10262: fe 01 movw r30, r28 10264: 31 96 adiw r30, 0x01 ; 1 10266: 6f 01 movw r12, r30 { for (uint8_t fan = 0; fan < 2; fan++) 10268: 10 e0 ldi r17, 0x00 ; 0 } } void fanSpeedError(unsigned char _fan) { if (fan_check_error == EFCE_REPORTED) return; fan_check_error = EFCE_REPORTED; 1026a: 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]) 1026c: f7 01 movw r30, r14 1026e: 91 91 ld r25, Z+ 10270: 7f 01 movw r14, r30 10272: f6 01 movw r30, r12 10274: 81 91 ld r24, Z+ 10276: 6f 01 movw r12, r30 10278: 89 17 cp r24, r25 1027a: 68 f5 brcc .+90 ; 0x102d6 { fan_speed_errors[fan] = 0; 1027c: f7 01 movw r30, r14 1027e: 31 97 sbiw r30, 0x01 ; 1 10280: 10 82 st Z, r1 LCD_ALERTMESSAGERPGM(lcdMsg); } } void fanSpeedError(unsigned char _fan) { if (fan_check_error == EFCE_REPORTED) return; 10282: 80 91 e6 03 lds r24, 0x03E6 ; 0x8003e6 10286: 82 30 cpi r24, 0x02 ; 2 10288: 31 f1 breq .+76 ; 0x102d6 fan_check_error = EFCE_REPORTED; 1028a: 00 93 e6 03 sts 0x03E6, r16 ; 0x8003e6 if (printJobOngoing()) { 1028e: 0e 94 90 67 call 0xcf20 ; 0xcf20 10292: 88 23 and r24, r24 10294: 81 f1 breq .+96 ; 0x102f6 // A print is ongoing, pause the print normally if(!printingIsPaused()) { 10296: 0e 94 85 67 call 0xcf0a ; 0xcf0a 1029a: 81 11 cpse r24, r1 1029c: 06 c0 rjmp .+12 ; 0x102aa if (usb_timer.running()) 1029e: 80 91 0e 05 lds r24, 0x050E ; 0x80050e 102a2: 88 23 and r24, r24 102a4: 29 f1 breq .+74 ; 0x102f0 lcd_pause_usb_print(); 102a6: 0f 94 99 14 call 0x22932 ; 0x22932 else { // Nothing is going on, but still turn off heaters and report the error setTargetHotend(0); heating_status = HeatingStatus::NO_HEATING; } switch (_fan) { 102aa: 11 30 cpi r17, 0x01 ; 1 102ac: 59 f1 breq .+86 ; 0x10304 //! 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); 102ae: 89 e1 ldi r24, 0x19 ; 25 102b0: 99 e7 ldi r25, 0x79 ; 121 102b2: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 if (get_message_level() == 0) { 102b6: 80 91 d5 03 lds r24, 0x03D5 ; 0x8003d5 <_ZL24lcd_status_message_level.lto_priv.451> 102ba: 81 11 cpse r24, r1 102bc: 0c c0 rjmp .+24 ; 0x102d6 Sound_MakeCustom(200,0,true); 102be: 41 e0 ldi r20, 0x01 ; 1 102c0: 70 e0 ldi r23, 0x00 ; 0 102c2: 60 e0 ldi r22, 0x00 ; 0 102c4: 88 ec ldi r24, 0xC8 ; 200 102c6: 90 e0 ldi r25, 0x00 ; 0 102c8: 0f 94 46 51 call 0x2a28c ; 0x2a28c LCD_ALERTMESSAGERPGM(lcdMsg); 102cc: 62 e0 ldi r22, 0x02 ; 2 102ce: 82 ee ldi r24, 0xE2 ; 226 102d0: 9a e6 ldi r25, 0x6A ; 106 102d2: 0e 94 1d f1 call 0x1e23a ; 0x1e23a 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++) 102d6: 11 30 cpi r17, 0x01 ; 1 102d8: 49 f1 breq .+82 ; 0x1032c 102da: 11 e0 ldi r17, 0x01 ; 1 102dc: c7 cf rjmp .-114 ; 0x1026c 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; 102de: 10 92 4e 03 sts 0x034E, r1 ; 0x80034e 102e2: 76 cf rjmp .-276 ; 0x101d0 #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]++; 102e4: 80 91 e7 03 lds r24, 0x03E7 ; 0x8003e7 102e8: 87 cf rjmp .-242 ; 0x101f8 else fan_speed_errors[1] = 0; 102ea: 10 92 4f 03 sts 0x034F, r1 ; 0x80034f 102ee: 8c cf rjmp .-232 ; 0x10208 // A print is ongoing, pause the print normally if(!printingIsPaused()) { if (usb_timer.running()) lcd_pause_usb_print(); else lcd_pause_print(); 102f0: 0f 94 58 29 call 0x252b0 ; 0x252b0 102f4: da cf rjmp .-76 ; 0x102aa return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 102f6: 10 92 b7 0d sts 0x0DB7, r1 ; 0x800db7 102fa: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 } } else { // Nothing is going on, but still turn off heaters and report the error setTargetHotend(0); heating_status = HeatingStatus::NO_HEATING; 102fe: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 10302: d3 cf rjmp .-90 ; 0x102aa //! 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); 10304: 81 e4 ldi r24, 0x41 ; 65 10306: 99 e7 ldi r25, 0x79 ; 121 10308: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 if (get_message_level() == 0) { 1030c: 80 91 d5 03 lds r24, 0x03D5 ; 0x8003d5 <_ZL24lcd_status_message_level.lto_priv.451> 10310: 81 11 cpse r24, r1 10312: 0c c0 rjmp .+24 ; 0x1032c Sound_MakeCustom(200,0,true); 10314: 41 e0 ldi r20, 0x01 ; 1 10316: 70 e0 ldi r23, 0x00 ; 0 10318: 60 e0 ldi r22, 0x00 ; 0 1031a: 88 ec ldi r24, 0xC8 ; 200 1031c: 90 e0 ldi r25, 0x00 ; 0 1031e: 0f 94 46 51 call 0x2a28c ; 0x2a28c LCD_ALERTMESSAGERPGM(lcdMsg); 10322: 62 e0 ldi r22, 0x02 ; 2 10324: 8e ec ldi r24, 0xCE ; 206 10326: 9a e6 ldi r25, 0x6A ; 106 10328: 0e 94 1d f1 call 0x1e23a ; 0x1e23a } if ((_millis() - extruder_autofan_last_check > FAN_CHECK_DURATION) && (fan_measuring)) { countFanSpeed(); checkFanSpeed(); //printf_P(PSTR("fanSpeedSoftPwm 1: %d\n"), fanSpeedSoftPwm); fanSpeedSoftPwm = fanSpeedBckp; 1032c: 80 91 14 02 lds r24, 0x0214 ; 0x800214 10330: 80 93 a6 04 sts 0x04A6, r24 ; 0x8004a6 //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(); 10334: 0f 94 4c 29 call 0x25298 ; 0x25298 10338: 60 93 c0 17 sts 0x17C0, r22 ; 0x8017c0 1033c: 70 93 c1 17 sts 0x17C1, r23 ; 0x8017c1 10340: 80 93 c2 17 sts 0x17C2, r24 ; 0x8017c2 10344: 90 93 c3 17 sts 0x17C3, r25 ; 0x8017c3 fan_measuring = false; 10348: 10 92 6f 06 sts 0x066F, r1 ; 0x80066f } #endif //FAN_SOFT_PWM #endif #endif //DEBUG_DISABLE_FANCHECK } 1034c: 0f 90 pop r0 1034e: 0f 90 pop r0 10350: df 91 pop r29 10352: cf 91 pop r28 10354: 1f 91 pop r17 10356: 0f 91 pop r16 10358: ff 90 pop r15 1035a: ef 90 pop r14 1035c: df 90 pop r13 1035e: 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(); 10360: 0c 94 a7 75 jmp 0xeb4e ; 0xeb4e 00010364 : return (k >= 0? la10c_convert(k): -1); } float la10c_jerk(float j) { 10364: cf 92 push r12 10366: df 92 push r13 10368: ef 92 push r14 1036a: ff 92 push r15 1036c: 6b 01 movw r12, r22 1036e: 7c 01 movw r14, r24 la10c_orig_jerk = j; 10370: c0 92 54 03 sts 0x0354, r12 ; 0x800354 10374: d0 92 55 03 sts 0x0355, r13 ; 0x800355 10378: e0 92 56 03 sts 0x0356, r14 ; 0x800356 1037c: f0 92 57 03 sts 0x0357, r15 ; 0x800357 if(la10c_mode != LA10C_LA10) 10380: 80 91 70 03 lds r24, 0x0370 ; 0x800370 10384: 82 30 cpi r24, 0x02 ; 2 10386: b1 f4 brne .+44 ; 0x103b4 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) 10388: 20 e0 ldi r18, 0x00 ; 0 1038a: 30 e0 ldi r19, 0x00 ; 0 1038c: 40 e9 ldi r20, 0x90 ; 144 1038e: 50 e4 ldi r21, 0x40 ; 64 10390: c7 01 movw r24, r14 10392: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 10396: 87 ff sbrs r24, 7 10398: 14 c0 rjmp .+40 ; 0x103c2 1039a: 80 91 ee 0d lds r24, 0x0DEE ; 0x800dee 1039e: 90 91 ef 0d lds r25, 0x0DEF ; 0x800def 103a2: a0 91 f0 0d lds r26, 0x0DF0 ; 0x800df0 103a6: b0 91 f1 0d lds r27, 0x0DF1 ; 0x800df1 103aa: 80 3d cpi r24, 0xD0 ; 208 103ac: 97 40 sbci r25, 0x07 ; 7 103ae: a1 05 cpc r26, r1 103b0: b1 05 cpc r27, r1 103b2: 20 f5 brcc .+72 ; 0x103fc j; SERIAL_ECHOPGM("LA10C: Adjusted E-Jerk: "); SERIAL_ECHOLN(j); return j; } 103b4: c7 01 movw r24, r14 103b6: b6 01 movw r22, r12 103b8: ff 90 pop r15 103ba: ef 90 pop r14 103bc: df 90 pop r13 103be: cf 90 pop r12 103c0: 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: 103c2: 2a e9 ldi r18, 0x9A ; 154 103c4: 39 e9 ldi r19, 0x99 ; 153 103c6: 49 e9 ldi r20, 0x99 ; 153 103c8: 5e e3 ldi r21, 0x3E ; 62 103ca: c7 01 movw r24, r14 103cc: b6 01 movw r22, r12 103ce: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 103d2: 87 ff sbrs r24, 7 103d4: 0a c0 rjmp .+20 ; 0x103ea 103d6: 20 e0 ldi r18, 0x00 ; 0 103d8: 30 e0 ldi r19, 0x00 ; 0 103da: 48 e3 ldi r20, 0x38 ; 56 103dc: 51 e4 ldi r21, 0x41 ; 65 103de: c7 01 movw r24, r14 103e0: b6 01 movw r22, r12 103e2: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 103e6: 6b 01 movw r12, r22 103e8: 7c 01 movw r14, r24 j < 4.5? j * 0.25 + 3.375: j; SERIAL_ECHOPGM("LA10C: Adjusted E-Jerk: "); 103ea: 85 e9 ldi r24, 0x95 ; 149 103ec: 99 e7 ldi r25, 0x79 ; 121 103ee: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHOLN(j); 103f2: c7 01 movw r24, r14 103f4: b6 01 movw r22, r12 103f6: 0f 94 b4 74 call 0x2e968 ; 0x2e968 103fa: dc cf rjmp .-72 ; 0x103b4 // 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: 103fc: 2a e9 ldi r18, 0x9A ; 154 103fe: 39 e9 ldi r19, 0x99 ; 153 10400: 49 e9 ldi r20, 0x99 ; 153 10402: 5e e3 ldi r21, 0x3E ; 62 10404: c7 01 movw r24, r14 10406: b6 01 movw r22, r12 10408: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 1040c: 87 fd sbrc r24, 7 1040e: e3 cf rjmp .-58 ; 0x103d6 j < 4.5? j * 0.25 + 3.375: 10410: 20 e0 ldi r18, 0x00 ; 0 10412: 30 e0 ldi r19, 0x00 ; 0 10414: 40 e8 ldi r20, 0x80 ; 128 10416: 5e e3 ldi r21, 0x3E ; 62 10418: c7 01 movw r24, r14 1041a: b6 01 movw r22, r12 1041c: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__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: 10420: 20 e0 ldi r18, 0x00 ; 0 10422: 30 e0 ldi r19, 0x00 ; 0 10424: 48 e5 ldi r20, 0x58 ; 88 10426: 50 e4 ldi r21, 0x40 ; 64 10428: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 1042c: dc cf rjmp .-72 ; 0x103e6 0001042e : return la10c_mode; } void la10c_mode_change(LA10C_MODE mode) { 1042e: cf 92 push r12 10430: df 92 push r13 10432: ef 92 push r14 10434: ff 92 push r15 10436: cf 93 push r28 if(mode == la10c_mode) return; 10438: 90 91 70 03 lds r25, 0x0370 ; 0x800370 1043c: 98 17 cp r25, r24 1043e: b9 f1 breq .+110 ; 0x104ae 10440: c8 2f mov r28, r24 // always restore to the last unadjusted E-jerk value if(la10c_orig_jerk) 10442: c0 90 54 03 lds r12, 0x0354 ; 0x800354 10446: d0 90 55 03 lds r13, 0x0355 ; 0x800355 1044a: e0 90 56 03 lds r14, 0x0356 ; 0x800356 1044e: f0 90 57 03 lds r15, 0x0357 ; 0x800357 10452: 20 e0 ldi r18, 0x00 ; 0 10454: 30 e0 ldi r19, 0x00 ; 0 10456: a9 01 movw r20, r18 10458: c7 01 movw r24, r14 1045a: b6 01 movw r22, r12 1045c: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 10460: 88 23 and r24, r24 10462: 41 f0 breq .+16 ; 0x10474 cs.max_jerk[E_AXIS] = la10c_orig_jerk; 10464: c0 92 12 0e sts 0x0E12, r12 ; 0x800e12 10468: d0 92 13 0e sts 0x0E13, r13 ; 0x800e13 1046c: e0 92 14 0e sts 0x0E14, r14 ; 0x800e14 10470: f0 92 15 0e sts 0x0E15, r15 ; 0x800e15 SERIAL_ECHOPGM("LA10C: Linear Advance mode: "); 10474: 88 e7 ldi r24, 0x78 ; 120 10476: 99 e7 ldi r25, 0x79 ; 121 10478: 0e 94 50 77 call 0xeea0 ; 0xeea0 switch(mode) 1047c: c1 30 cpi r28, 0x01 ; 1 1047e: 11 f1 breq .+68 ; 0x104c4 10480: e0 f0 brcs .+56 ; 0x104ba 10482: c2 30 cpi r28, 0x02 ; 2 10484: 11 f1 breq .+68 ; 0x104ca { 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; 10486: c0 93 70 03 sts 0x0370, r28 ; 0x800370 // adjust the E-jerk if needed cs.max_jerk[E_AXIS] = la10c_jerk(cs.max_jerk[E_AXIS]); 1048a: 60 91 12 0e lds r22, 0x0E12 ; 0x800e12 1048e: 70 91 13 0e lds r23, 0x0E13 ; 0x800e13 10492: 80 91 14 0e lds r24, 0x0E14 ; 0x800e14 10496: 90 91 15 0e lds r25, 0x0E15 ; 0x800e15 1049a: 0e 94 b2 81 call 0x10364 ; 0x10364 1049e: 60 93 12 0e sts 0x0E12, r22 ; 0x800e12 104a2: 70 93 13 0e sts 0x0E13, r23 ; 0x800e13 104a6: 80 93 14 0e sts 0x0E14, r24 ; 0x800e14 104aa: 90 93 15 0e sts 0x0E15, r25 ; 0x800e15 } 104ae: cf 91 pop r28 104b0: ff 90 pop r15 104b2: ef 90 pop r14 104b4: df 90 pop r13 104b6: cf 90 pop r12 104b8: 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; 104ba: 80 e7 ldi r24, 0x70 ; 112 104bc: 99 e7 ldi r25, 0x79 ; 121 case LA10C_LA15: SERIAL_ECHOLNPGM("1.5"); break; case LA10C_LA10: SERIAL_ECHOLNPGM("1.0"); break; 104be: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 104c2: e1 cf rjmp .-62 ; 0x10486 SERIAL_ECHOPGM("LA10C: Linear Advance mode: "); switch(mode) { case LA10C_UNKNOWN: SERIAL_ECHOLNPGM("UNKNOWN"); break; case LA10C_LA15: SERIAL_ECHOLNPGM("1.5"); break; 104c4: 8c e6 ldi r24, 0x6C ; 108 104c6: 99 e7 ldi r25, 0x79 ; 121 104c8: fa cf rjmp .-12 ; 0x104be case LA10C_LA10: SERIAL_ECHOLNPGM("1.0"); break; 104ca: 88 e6 ldi r24, 0x68 ; 104 104cc: 99 e7 ldi r25, 0x79 ; 121 104ce: f7 cf rjmp .-18 ; 0x104be 000104d0 : bool IsStopped() { return Stopped; }; void finishAndDisableSteppers() { st_synchronize(); 104d0: 0f 94 e8 42 call 0x285d0 ; 0x285d0 disable_x(); 104d4: 17 9a sbi 0x02, 7 ; 2 104d6: ef e8 ldi r30, 0x8F ; 143 104d8: f6 e0 ldi r31, 0x06 ; 6 104da: 10 82 st Z, r1 disable_y(); 104dc: 16 9a sbi 0x02, 6 ; 2 104de: 11 82 std Z+1, r1 ; 0x01 disable_z(); disable_e0(); 104e0: 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); } 104e2: 80 e0 ldi r24, 0x00 ; 0 104e4: 0e 94 17 82 call 0x1042e ; 0x1042e return percent_done; } static void print_time_remaining_init() { print_time_remaining_normal = PRINT_TIME_REMAINING_INIT; 104e8: 8f ef ldi r24, 0xFF ; 255 104ea: 9f ef ldi r25, 0xFF ; 255 104ec: 90 93 b2 02 sts 0x02B2, r25 ; 0x8002b2 104f0: 80 93 b1 02 sts 0x02B1, r24 ; 0x8002b1 print_percent_done_normal = PRINT_PERCENT_DONE_INIT; 104f4: 2f ef ldi r18, 0xFF ; 255 104f6: 20 93 ae 02 sts 0x02AE, r18 ; 0x8002ae print_time_remaining_silent = PRINT_TIME_REMAINING_INIT; 104fa: 90 93 b6 02 sts 0x02B6, r25 ; 0x8002b6 104fe: 80 93 b5 02 sts 0x02B5, r24 ; 0x8002b5 print_percent_done_silent = PRINT_PERCENT_DONE_INIT; 10502: 20 93 ad 02 sts 0x02AD, r18 ; 0x8002ad print_time_to_change_normal = PRINT_TIME_REMAINING_INIT; 10506: 90 93 b0 02 sts 0x02B0, r25 ; 0x8002b0 1050a: 80 93 af 02 sts 0x02AF, r24 ; 0x8002af print_time_to_change_silent = PRINT_TIME_REMAINING_INIT; 1050e: 90 93 b4 02 sts 0x02B4, r25 ; 0x8002b4 10512: 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(); } 10516: 08 95 ret 00010518 : } #endif void Config_ResetDefault() { memcpy_P(&cs,&default_conf, sizeof(cs)); 10518: 41 ed ldi r20, 0xD1 ; 209 1051a: 50 e0 ldi r21, 0x00 ; 0 1051c: 63 e2 ldi r22, 0x23 ; 35 1051e: 78 e7 ldi r23, 0x78 ; 120 10520: 8e eb ldi r24, 0xBE ; 190 10522: 9d e0 ldi r25, 0x0D ; 13 10524: 0f 94 b6 d9 call 0x3b36c ; 0x3b36c // steps per sq second need to be updated to agree with the units per sq second reset_acceleration_rates(); 10528: 0f 94 5f 63 call 0x2c6be ; 0x2c6be #ifdef PIDTEMP updatePID(); 1052c: 0f 94 d3 3a call 0x275a6 ; 0x275a6 #endif//PIDTEMP #ifdef THERMAL_MODEL thermal_model_reset_settings(); 10530: 0f 94 a8 31 call 0x26350 ; 0x26350 #endif calculate_extruder_multipliers(); 10534: 0e 94 b9 65 call 0xcb72 ; 0xcb72 SERIAL_ECHO_START; 10538: 82 ec ldi r24, 0xC2 ; 194 1053a: 9b ea ldi r25, 0xAB ; 171 1053c: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHOLNPGM("Hardcoded Default Settings Loaded"); 10540: 81 e0 ldi r24, 0x01 ; 1 10542: 98 e7 ldi r25, 0x78 ; 120 10544: 0c 94 7b 79 jmp 0xf2f6 ; 0xf2f6 00010548 : DEFAULT_ARC_SEGMENTS_PER_SEC }; void Config_StoreSettings() { 10548: cf 93 push r28 1054a: df 93 push r29 strcpy_P(cs.version, default_conf.version); 1054c: 63 e2 ldi r22, 0x23 ; 35 1054e: 78 e7 ldi r23, 0x78 ; 120 10550: 8e eb ldi r24, 0xBE ; 190 10552: 9d e0 ldi r25, 0x0D ; 13 10554: 0f 94 d3 d9 call 0x3b3a6 ; 0x3b3a6 #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); 10558: 41 ed ldi r20, 0xD1 ; 209 1055a: 50 e0 ldi r21, 0x00 ; 0 1055c: 64 e1 ldi r22, 0x14 ; 20 1055e: 70 e0 ldi r23, 0x00 ; 0 10560: 8e eb ldi r24, 0xBE ; 190 10562: 9d e0 ldi r25, 0x0D ; 13 10564: 0f 94 30 dc call 0x3b860 ; 0x3b860 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 10568: 60 91 1d 05 lds r22, 0x051D ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.456> 1056c: 82 e0 ldi r24, 0x02 ; 2 1056e: 9d e0 ldi r25, 0x0D ; 13 10570: 0f 94 40 dc call 0x3b880 ; 0x3b880 } 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); 10574: c0 eb ldi r28, 0xB0 ; 176 10576: 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); 10578: 4a a5 ldd r20, Y+42 ; 0x2a 1057a: 5b a5 ldd r21, Y+43 ; 0x2b 1057c: 6c a5 ldd r22, Y+44 ; 0x2c 1057e: 7d a5 ldd r23, Y+45 ; 0x2d 10580: 8e ef ldi r24, 0xFE ; 254 10582: 9c e0 ldi r25, 0x0C ; 12 10584: 0f 94 52 dc call 0x3b8a4 ; 0x3b8a4 10588: 4e a5 ldd r20, Y+46 ; 0x2e 1058a: 5f a5 ldd r21, Y+47 ; 0x2f 1058c: 68 a9 ldd r22, Y+48 ; 0x30 1058e: 79 a9 ldd r23, Y+49 ; 0x31 10590: 82 ea ldi r24, 0xA2 ; 162 10592: 9c e0 ldi r25, 0x0C ; 12 10594: 0f 94 52 dc call 0x3b8a4 ; 0x3b8a4 10598: 4a a9 ldd r20, Y+50 ; 0x32 1059a: 5b a9 ldd r21, Y+51 ; 0x33 1059c: 6c a9 ldd r22, Y+52 ; 0x34 1059e: 7d a9 ldd r23, Y+53 ; 0x35 105a0: 8e e9 ldi r24, 0x9E ; 158 105a2: 9c e0 ldi r25, 0x0C ; 12 105a4: 0f 94 52 dc call 0x3b8a4 ; 0x3b8a4 105a8: 4e a9 ldd r20, Y+54 ; 0x36 105aa: 5f a9 ldd r21, Y+55 ; 0x37 105ac: 68 ad ldd r22, Y+56 ; 0x38 105ae: 79 ad ldd r23, Y+57 ; 0x39 105b0: 8a ef ldi r24, 0xFA ; 250 105b2: 9c e0 ldi r25, 0x0C ; 12 105b4: 0f 94 52 dc call 0x3b8a4 ; 0x3b8a4 105b8: 4a ad ldd r20, Y+58 ; 0x3a 105ba: 5b ad ldd r21, Y+59 ; 0x3b 105bc: 6c ad ldd r22, Y+60 ; 0x3c 105be: 7d ad ldd r23, Y+61 ; 0x3d 105c0: 8a e9 ldi r24, 0x9A ; 154 105c2: 9c e0 ldi r25, 0x0C ; 12 105c4: 0f 94 52 dc call 0x3b8a4 ; 0x3b8a4 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 105c8: 6e ad ldd r22, Y+62 ; 0x3e 105ca: 7f ad ldd r23, Y+63 ; 0x3f 105cc: 88 e9 ldi r24, 0x98 ; 152 105ce: 9c e0 ldi r25, 0x0C ; 12 105d0: 0f 94 5e dc call 0x3b8bc ; 0x3b8bc #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); 105d4: 40 e4 ldi r20, 0x40 ; 64 105d6: 50 e0 ldi r21, 0x00 ; 0 105d8: 6a eb ldi r22, 0xBA ; 186 105da: 7c e0 ldi r23, 0x0C ; 12 105dc: 80 ef ldi r24, 0xF0 ; 240 105de: 92 e1 ldi r25, 0x12 ; 18 105e0: 0f 94 30 dc call 0x3b860 ; 0x3b860 if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 105e4: 40 91 30 13 lds r20, 0x1330 ; 0x801330 <_ZN13thermal_modelL4dataE.lto_priv.400+0x80> 105e8: 50 91 31 13 lds r21, 0x1331 ; 0x801331 <_ZN13thermal_modelL4dataE.lto_priv.400+0x81> 105ec: 60 91 32 13 lds r22, 0x1332 ; 0x801332 <_ZN13thermal_modelL4dataE.lto_priv.400+0x82> 105f0: 70 91 33 13 lds r23, 0x1333 ; 0x801333 <_ZN13thermal_modelL4dataE.lto_priv.400+0x83> 105f4: 86 eb ldi r24, 0xB6 ; 182 105f6: 9c e0 ldi r25, 0x0C ; 12 105f8: 0f 94 52 dc call 0x3b8a4 ; 0x3b8a4 105fc: 40 91 34 13 lds r20, 0x1334 ; 0x801334 <_ZN13thermal_modelL4dataE.lto_priv.400+0x84> 10600: 50 91 35 13 lds r21, 0x1335 ; 0x801335 <_ZN13thermal_modelL4dataE.lto_priv.400+0x85> 10604: 60 91 36 13 lds r22, 0x1336 ; 0x801336 <_ZN13thermal_modelL4dataE.lto_priv.400+0x86> 10608: 70 91 37 13 lds r23, 0x1337 ; 0x801337 <_ZN13thermal_modelL4dataE.lto_priv.400+0x87> 1060c: 82 eb ldi r24, 0xB2 ; 178 1060e: 9c e0 ldi r25, 0x0C ; 12 10610: 0f 94 52 dc call 0x3b8a4 ; 0x3b8a4 10614: 40 91 38 13 lds r20, 0x1338 ; 0x801338 <_ZN13thermal_modelL4dataE.lto_priv.400+0x88> 10618: 50 91 39 13 lds r21, 0x1339 ; 0x801339 <_ZN13thermal_modelL4dataE.lto_priv.400+0x89> 1061c: 60 91 3a 13 lds r22, 0x133A ; 0x80133a <_ZN13thermal_modelL4dataE.lto_priv.400+0x8a> 10620: 70 91 3b 13 lds r23, 0x133B ; 0x80133b <_ZN13thermal_modelL4dataE.lto_priv.400+0x8b> 10624: 8e ea ldi r24, 0xAE ; 174 10626: 9c e0 ldi r25, 0x0C ; 12 10628: 0f 94 52 dc call 0x3b8a4 ; 0x3b8a4 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; 1062c: 82 ec ldi r24, 0xC2 ; 194 1062e: 9b ea ldi r25, 0xAB ; 171 10630: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHOLNPGM("Settings Stored"); 10634: 8d ea ldi r24, 0xAD ; 173 10636: 97 e7 ldi r25, 0x77 ; 119 } 10638: df 91 pop r29 1063a: cf 91 pop r28 #ifdef THERMAL_MODEL thermal_model_save_settings(); #endif SERIAL_ECHO_START; SERIAL_ECHOLNPGM("Settings Stored"); 1063c: 0c 94 7b 79 jmp 0xf2f6 ; 0xf2f6 00010640 : { cmdbuffer_front_already_processed = true; } void get_command() { 10640: 2f 92 push r2 10642: 3f 92 push r3 10644: 4f 92 push r4 10646: 5f 92 push r5 10648: 6f 92 push r6 1064a: 7f 92 push r7 1064c: 8f 92 push r8 1064e: 9f 92 push r9 10650: af 92 push r10 10652: bf 92 push r11 10654: cf 92 push r12 10656: df 92 push r13 10658: ef 92 push r14 1065a: ff 92 push r15 1065c: 0f 93 push r16 1065e: 1f 93 push r17 10660: cf 93 push r28 10662: df 93 push r29 10664: cd b7 in r28, 0x3d ; 61 10666: de b7 in r29, 0x3e ; 62 10668: a2 97 sbiw r28, 0x22 ; 34 1066a: 0f b6 in r0, 0x3f ; 63 1066c: f8 94 cli 1066e: de bf out 0x3e, r29 ; 62 10670: 0f be out 0x3f, r0 ; 63 10672: cd bf out 0x3d, r28 ; 61 // Test and reserve space for the new command string. if (! cmdqueue_could_enqueue_back(MAX_CMD_SIZE - 1)) 10674: 8f e5 ldi r24, 0x5F ; 95 10676: 90 e0 ldi r25, 0x00 ; 0 10678: 0e 94 42 5c call 0xb884 ; 0xb884 1067c: 88 23 and r24, r24 1067e: 09 f4 brne .+2 ; 0x10682 10680: 91 c0 rjmp .+290 ; 0x107a4 return; if (MYSERIAL.available() == RX_BUFFER_SIZE - 1) { //compare number of chars buffered in rx buffer with rx buffer size 10682: 0e 94 09 77 call 0xee12 ; 0xee12 10686: 8f 37 cpi r24, 0x7F ; 127 10688: 91 05 cpc r25, r1 1068a: 61 f4 brne .+24 ; 0x106a4 // 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; 1068c: 80 91 9b 04 lds r24, 0x049B ; 0x80049b 10690: 90 91 9c 04 lds r25, 0x049C ; 0x80049c 10694: 90 93 9a 04 sts 0x049A, r25 ; 0x80049a 10698: 80 93 99 04 sts 0x0499, r24 ; 0x800499 MYSERIAL.flush(); SERIAL_ECHOLNPGM("Full RX Buffer"); //if buffer was full, there is danger that reading of last gcode will not be completed 1069c: 8e e9 ldi r24, 0x9E ; 158 1069e: 97 e7 ldi r25, 0x77 ; 119 106a0: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 106a4: 1e 01 movw r2, r28 106a6: 2f e1 ldi r18, 0x1F ; 31 106a8: 22 0e add r2, r18 106aa: 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; 106ac: dd 24 eor r13, r13 106ae: 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 106b0: 0e 94 09 77 call 0xee12 ; 0xee12 106b4: 18 16 cp r1, r24 106b6: 19 06 cpc r1, r25 106b8: 0c f0 brlt .+2 ; 0x106bc 106ba: 68 c0 rjmp .+208 ; 0x1078c 106bc: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 106c0: 88 23 and r24, r24 106c2: 29 f0 breq .+10 ; 0x106ce 106c4: 0e 94 85 67 call 0xcf0a ; 0xcf0a 106c8: 88 23 and r24, r24 106ca: 09 f4 brne .+2 ; 0x106ce 106cc: 5f c0 rjmp .+190 ; 0x1078c 106ce: 80 91 a6 03 lds r24, 0x03A6 ; 0x8003a6 106d2: 81 11 cpse r24, r1 106d4: 5b c0 rjmp .+182 ; 0x1078c #ifdef ENABLE_MEATPACK // MeatPack Changes // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - const int rec = MYSERIAL.read(); 106d6: 0f 94 04 d6 call 0x3ac08 ; 0x3ac08 if (rec < 0) continue; 106da: 97 fd sbrc r25, 7 106dc: e9 cf rjmp .-46 ; 0x106b0 mp_handle_rx_char((uint8_t)rec); 106de: 28 2f mov r18, r24 //========================================================================== void mp_handle_rx_char(const uint8_t c) { // Check for commit complete // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (c == (uint8_t)(MeatPack_CommandByte)) { 106e0: 8f 3f cpi r24, 0xFF ; 255 106e2: 09 f0 breq .+2 ; 0x106e6 106e4: 7b c0 rjmp .+246 ; 0x107dc if (mp_cmd_count > 0) { 106e6: 80 91 40 03 lds r24, 0x0340 ; 0x800340 106ea: 88 23 and r24, r24 106ec: 09 f4 brne .+2 ; 0x106f0 106ee: 73 c0 rjmp .+230 ; 0x107d6 mp_cmd_active = 1; 106f0: d0 92 3f 03 sts 0x033F, r13 ; 0x80033f mp_cmd_count = 0; 106f4: 10 92 40 03 sts 0x0340, r1 ; 0x800340 char c_res[2] = {0, 0}; 106f8: 1f 8e std Y+31, r1 ; 0x1f 106fa: 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) { 106fc: c0 90 43 03 lds r12, 0x0343 ; 0x800343 10700: cc 20 and r12, r12 10702: b1 f2 breq .-84 ; 0x106b0 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]; 10704: 80 91 41 03 lds r24, 0x0341 ; 0x800341 10708: 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) 1070a: 91 e0 ldi r25, 0x01 ; 1 1070c: 9c 15 cp r25, r12 1070e: 18 f4 brcc .+6 ; 0x10716 out[i] = (char)mp_char_out_buf[i]; 10710: 80 91 42 03 lds r24, 0x0342 ; 0x800342 10714: 88 a3 std Y+32, r24 ; 0x20 mp_char_out_count = 0; 10716: 10 92 43 03 sts 0x0343, r1 ; 0x800343 1071a: 3a a2 std Y+34, r3 ; 0x22 1071c: 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]; 1071e: 89 a1 ldd r24, Y+33 ; 0x21 10720: 82 19 sub r24, r2 10722: 8c 15 cp r24, r12 10724: 28 f6 brcc .-118 ; 0x106b0 10726: e9 a1 ldd r30, Y+33 ; 0x21 10728: fa a1 ldd r31, Y+34 ; 0x22 1072a: 11 91 ld r17, Z+ 1072c: fa a3 std Y+34, r31 ; 0x22 1072e: e9 a3 std Y+33, r30 ; 0x21 #else char serial_char = MYSERIAL.read(); #endif serialTimeoutTimer.start(); 10730: 86 e4 ldi r24, 0x46 ; 70 10732: 93 e0 ldi r25, 0x03 ; 3 10734: 0f 94 ad 29 call 0x2535a ; 0x2535a ::start()> if (serial_char < 0) 10738: 17 fd sbrc r17, 7 1073a: f1 cf rjmp .-30 ; 0x1071e 1073c: 80 91 9e 10 lds r24, 0x109E ; 0x80109e 10740: 90 91 9f 10 lds r25, 0x109F ; 0x80109f // 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' || 10744: 1a 30 cpi r17, 0x0A ; 10 10746: 09 f4 brne .+2 ; 0x1074a 10748: 4a c1 rjmp .+660 ; 0x109de 1074a: 1d 30 cpi r17, 0x0D ; 13 1074c: 09 f4 brne .+2 ; 0x10750 1074e: 47 c1 rjmp .+654 ; 0x109de serial_char == '\r' || 10750: 8f 35 cpi r24, 0x5F ; 95 10752: 91 05 cpc r25, r1 10754: 0c f0 brlt .+2 ; 0x10758 10756: 48 c1 rjmp .+656 ; 0x109e8 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; 10758: 1b 33 cpi r17, 0x3B ; 59 1075a: 11 f4 brne .+4 ; 0x10760 1075c: d0 92 45 03 sts 0x0345, r13 ; 0x800345 if(!comment_mode) cmdbuffer[bufindw+CMDHDRSIZE+serial_count++] = serial_char; 10760: 20 91 45 03 lds r18, 0x0345 ; 0x800345 10764: 21 11 cpse r18, r1 10766: db cf rjmp .-74 ; 0x1071e 10768: 9c 01 movw r18, r24 1076a: 2f 5f subi r18, 0xFF ; 255 1076c: 3f 4f sbci r19, 0xFF ; 255 1076e: 30 93 9f 10 sts 0x109F, r19 ; 0x80109f 10772: 20 93 9e 10 sts 0x109E, r18 ; 0x80109e 10776: 20 91 a0 10 lds r18, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.550> 1077a: 30 91 a1 10 lds r19, 0x10A1 ; 0x8010a1 <_ZL7bufindw.lto_priv.550+0x1> 1077e: 2b 55 subi r18, 0x5B ; 91 10780: 3f 4e sbci r19, 0xEF ; 239 10782: 82 0f add r24, r18 10784: 93 1f adc r25, r19 10786: fc 01 movw r30, r24 10788: 13 83 std Z+3, r17 ; 0x03 1078a: c9 cf rjmp .-110 ; 0x1071e #ifdef ENABLE_MEATPACK } #endif } // end of serial line processing loop if (serial_count > 0 && serialTimeoutTimer.expired(farm_mode ? 800 : 2000)) { 1078c: 80 91 9e 10 lds r24, 0x109E ; 0x80109e 10790: 90 91 9f 10 lds r25, 0x109F ; 0x80109f 10794: 18 16 cp r1, r24 10796: 19 06 cpc r1, r25 10798: 0c f4 brge .+2 ; 0x1079c 1079a: 56 c2 rjmp .+1196 ; 0x10c48 SERIAL_ECHOLNPGM("RX timeout"); return; } #ifdef SDSUPPORT if(!card.sdprinting || !card.isFileOpen() || serial_count!=0){ 1079c: 80 91 90 14 lds r24, 0x1490 ; 0x801490 107a0: 81 11 cpse r24, r1 107a2: 66 c2 rjmp .+1228 ; 0x10c70 prusa_statistics(6); } } #endif //SDSUPPORT } 107a4: a2 96 adiw r28, 0x22 ; 34 107a6: 0f b6 in r0, 0x3f ; 63 107a8: f8 94 cli 107aa: de bf out 0x3e, r29 ; 62 107ac: 0f be out 0x3f, r0 ; 63 107ae: cd bf out 0x3d, r28 ; 61 107b0: df 91 pop r29 107b2: cf 91 pop r28 107b4: 1f 91 pop r17 107b6: 0f 91 pop r16 107b8: ff 90 pop r15 107ba: ef 90 pop r14 107bc: df 90 pop r13 107be: cf 90 pop r12 107c0: bf 90 pop r11 107c2: af 90 pop r10 107c4: 9f 90 pop r9 107c6: 8f 90 pop r8 107c8: 7f 90 pop r7 107ca: 6f 90 pop r6 107cc: 5f 90 pop r5 107ce: 4f 90 pop r4 107d0: 3f 90 pop r3 107d2: 2f 90 pop r2 107d4: 08 95 ret if (mp_cmd_count > 0) { mp_cmd_active = 1; mp_cmd_count = 0; } else ++mp_cmd_count; 107d6: d0 92 40 03 sts 0x0340, r13 ; 0x800340 107da: 8e cf rjmp .-228 ; 0x106f8 return; } if (mp_cmd_active > 0) { 107dc: 30 91 3f 03 lds r19, 0x033F ; 0x80033f 107e0: 33 23 and r19, r19 107e2: 09 f4 brne .+2 ; 0x107e6 107e4: 57 c0 rjmp .+174 ; 0x10894 } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { 107e6: 89 3f cpi r24, 0xF9 ; 249 107e8: 09 f4 brne .+2 ; 0x107ec 107ea: 3f c0 rjmp .+126 ; 0x1086a 107ec: 80 f5 brcc .+96 ; 0x1084e 107ee: 86 3f cpi r24, 0xF6 ; 246 107f0: 09 f4 brne .+2 ; 0x107f4 107f2: 48 c0 rjmp .+144 ; 0x10884 #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] RESET REC"); #endif } break; case MPCommand_EnableNoSpaces: { mp_config |= MPConfig_NoSpaces; 107f4: 80 91 3e 03 lds r24, 0x033E ; 0x80033e 107f8: 82 60 ori r24, 0x02 ; 2 } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { 107fa: 27 3f cpi r18, 0xF7 ; 247 107fc: 79 f1 breq .+94 ; 0x1085c 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. 107fe: 89 e6 ldi r24, 0x69 ; 105 10800: 97 e7 ldi r25, 0x77 ; 119 10802: 0e 94 50 77 call 0xeea0 ; 0xeea0 // 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); 10806: 84 e6 ldi r24, 0x64 ; 100 10808: 97 e7 ldi r25, 0x77 ; 119 1080a: 0e 94 50 77 call 0xeea0 ; 0xeea0 // Echo current state if (mp_config & MPConfig_Active) 1080e: 10 91 3e 03 lds r17, 0x033E ; 0x80033e SERIAL_ECHOPGM(" ON"); 10812: 80 e6 ldi r24, 0x60 ; 96 10814: 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) 10816: 10 fd sbrc r17, 0 10818: 02 c0 rjmp .+4 ; 0x1081e SERIAL_ECHOPGM(" ON"); else SERIAL_ECHOPGM(" OFF"); 1081a: 8b e5 ldi r24, 0x5B ; 91 1081c: 97 e7 ldi r25, 0x77 ; 119 1081e: 0e 94 50 77 call 0xeea0 ; 0xeea0 if (mp_config & MPConfig_NoSpaces) 10822: 01 2f mov r16, r17 10824: 02 70 andi r16, 0x02 ; 2 SERIAL_ECHOPGM(" NSP"); // [N]o [SP]aces 10826: 86 e5 ldi r24, 0x56 ; 86 10828: 97 e7 ldi r25, 0x77 ; 119 if (mp_config & MPConfig_Active) SERIAL_ECHOPGM(" ON"); else SERIAL_ECHOPGM(" OFF"); if (mp_config & MPConfig_NoSpaces) 1082a: 11 fd sbrc r17, 1 1082c: 02 c0 rjmp .+4 ; 0x10832 SERIAL_ECHOPGM(" NSP"); // [N]o [SP]aces else SERIAL_ECHOPGM(" ESP"); // [E]nabled [SP]aces 1082e: 81 e5 ldi r24, 0x51 ; 81 10830: 97 e7 ldi r25, 0x77 ; 119 10832: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHOLNPGM(""); 10836: 80 e5 ldi r24, 0x50 ; 80 10838: 97 e7 ldi r25, 0x77 ; 119 1083a: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 // Validate config vars #ifdef USE_LOOKUP_TABLE if (mp_config & MPConfig_NoSpaces) 1083e: 00 23 and r16, r16 10840: 29 f1 breq .+74 ; 0x1088c MeatPackLookupTbl[MeatPack_SpaceCharIdx] = (uint8_t)(MeatPack_SpaceCharReplace); 10842: 45 e4 ldi r20, 0x45 ; 69 10844: 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; 10848: 10 92 3f 03 sts 0x033F, r1 ; 0x80033f 1084c: 55 cf rjmp .-342 ; 0x106f8 } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { 1084e: 8a 3f cpi r24, 0xFA ; 250 10850: 41 f0 breq .+16 ; 0x10862 case MPCommand_EnablePacking: { mp_config |= MPConfig_Active; 10852: 80 91 3e 03 lds r24, 0x033E ; 0x80033e 10856: 81 60 ori r24, 0x01 ; 1 } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { 10858: 2b 3f cpi r18, 0xFB ; 251 1085a: 89 f6 brne .-94 ; 0x107fe #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL NSP"); #endif } break; case MPCommand_DisableNoSpaces: { mp_config &= ~(MPConfig_NoSpaces); 1085c: 80 93 3e 03 sts 0x033E, r24 ; 0x80033e 10860: ce cf rjmp .-100 ; 0x107fe #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL REC"); #endif } break; case MPCommand_DisablePacking: { mp_config &= ~(MPConfig_Active); 10862: 80 91 3e 03 lds r24, 0x033E ; 0x80033e 10866: 8e 7f andi r24, 0xFE ; 254 10868: f9 cf rjmp .-14 ; 0x1085c return out; } //============================================================================== void FORCE_INLINE mp_reset_state() { mp_char_out_count = 0; 1086a: 10 92 43 03 sts 0x0343, r1 ; 0x800343 mp_cmd_active = MPCommand_None; 1086e: 10 92 3f 03 sts 0x033F, r1 ; 0x80033f mp_config = MPConfig_None; 10872: 10 92 3e 03 sts 0x033E, r1 ; 0x80033e mp_char_buf = 0; 10876: 10 92 3d 03 sts 0x033D, r1 ; 0x80033d mp_cmd_count = 0; 1087a: 10 92 40 03 sts 0x0340, r1 ; 0x800340 mp_cmd_active = 0; mp_full_char_queue = 0; 1087e: 10 92 3c 03 sts 0x033C, r1 ; 0x80033c 10882: bd cf rjmp .-134 ; 0x107fe #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL NSP"); #endif } break; case MPCommand_DisableNoSpaces: { mp_config &= ~(MPConfig_NoSpaces); 10884: 80 91 3e 03 lds r24, 0x033E ; 0x80033e 10888: 8d 7f andi r24, 0xFD ; 253 1088a: e8 cf rjmp .-48 ; 0x1085c // Validate config vars #ifdef USE_LOOKUP_TABLE if (mp_config & MPConfig_NoSpaces) MeatPackLookupTbl[MeatPack_SpaceCharIdx] = (uint8_t)(MeatPack_SpaceCharReplace); else MeatPackLookupTbl[MeatPack_SpaceCharIdx] = ' '; 1088c: 50 e2 ldi r21, 0x20 ; 32 1088e: 50 93 0b 02 sts 0x020B, r21 ; 0x80020b <__DATA_REGION_ORIGIN__+0xb> 10892: da cf rjmp .-76 ; 0x10848 mp_handle_cmd((MeatPack_Command)c); mp_cmd_active = 0; return; } if (mp_cmd_count > 0) { 10894: 20 91 40 03 lds r18, 0x0340 ; 0x800340 10898: 40 91 3e 03 lds r20, 0x033E ; 0x80033e 1089c: 22 23 and r18, r18 1089e: 31 f1 breq .+76 ; 0x108ec 108a0: e0 91 43 03 lds r30, 0x0343 ; 0x800343 //========================================================================== 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) { 108a4: 40 ff sbrs r20, 0 108a6: 49 c0 rjmp .+146 ; 0x1093a if (mp_full_char_queue > 0) { 108a8: 30 91 3c 03 lds r19, 0x033C ; 0x80033c 108ac: 33 23 and r19, r19 108ae: 09 f4 brne .+2 ; 0x108b2 108b0: 40 c0 rjmp .+128 ; 0x10932 #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; 108b2: 21 e0 ldi r18, 0x01 ; 1 108b4: 2e 0f add r18, r30 108b6: 20 93 43 03 sts 0x0343, r18 ; 0x800343 108ba: ae 2f mov r26, r30 108bc: b0 e0 ldi r27, 0x00 ; 0 108be: af 5b subi r26, 0xBF ; 191 108c0: bc 4f sbci r27, 0xFC ; 252 108c2: ff ef ldi r31, 0xFF ; 255 108c4: 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) { 108c6: 50 91 3d 03 lds r21, 0x033D ; 0x80033d 108ca: 55 23 and r21, r21 108cc: 51 f0 breq .+20 ; 0x108e2 #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; 108ce: ee 5f subi r30, 0xFE ; 254 108d0: e0 93 43 03 sts 0x0343, r30 ; 0x800343 108d4: e2 2f mov r30, r18 108d6: f0 e0 ldi r31, 0x00 ; 0 108d8: ef 5b subi r30, 0xBF ; 191 108da: fc 4f sbci r31, 0xFC ; 252 108dc: 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; 108de: 10 92 3d 03 sts 0x033D, r1 ; 0x80033d } --mp_full_char_queue; 108e2: 31 50 subi r19, 0x01 ; 1 108e4: 30 93 3c 03 sts 0x033C, r19 ; 0x80033c return; } if (mp_cmd_count > 0) { mp_handle_rx_char_inner((uint8_t)(MeatPack_CommandByte)); mp_cmd_count = 0; 108e8: 10 92 40 03 sts 0x0340, r1 ; 0x800340 108ec: e0 91 43 03 lds r30, 0x0343 ; 0x800343 //========================================================================== 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) { 108f0: 40 ff sbrs r20, 0 108f2: 6c c0 rjmp .+216 ; 0x109cc if (mp_full_char_queue > 0) { 108f4: 20 91 3c 03 lds r18, 0x033C ; 0x80033c 108f8: 22 23 and r18, r18 108fa: 49 f1 breq .+82 ; 0x1094e #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; 108fc: 91 e0 ldi r25, 0x01 ; 1 108fe: 9e 0f add r25, r30 10900: 90 93 43 03 sts 0x0343, r25 ; 0x800343 10904: ae 2f mov r26, r30 10906: b0 e0 ldi r27, 0x00 ; 0 10908: af 5b subi r26, 0xBF ; 191 1090a: bc 4f sbci r27, 0xFC ; 252 1090c: 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) { 1090e: 80 91 3d 03 lds r24, 0x033D ; 0x80033d 10912: 88 23 and r24, r24 10914: 51 f0 breq .+20 ; 0x1092a #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; 10916: ee 5f subi r30, 0xFE ; 254 10918: e0 93 43 03 sts 0x0343, r30 ; 0x800343 1091c: e9 2f mov r30, r25 1091e: f0 e0 ldi r31, 0x00 ; 0 10920: ef 5b subi r30, 0xBF ; 191 10922: fc 4f sbci r31, 0xFC ; 252 10924: 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; 10926: 10 92 3d 03 sts 0x033D, r1 ; 0x80033d } --mp_full_char_queue; 1092a: 21 50 subi r18, 0x01 ; 1 1092c: 20 93 3c 03 sts 0x033C, r18 ; 0x80033c 10930: e3 ce rjmp .-570 ; 0x106f8 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; 10932: 22 e0 ldi r18, 0x02 ; 2 10934: 20 93 3c 03 sts 0x033C, r18 ; 0x80033c 10938: d7 cf rjmp .-82 ; 0x108e8 #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; 1093a: 21 e0 ldi r18, 0x01 ; 1 1093c: 2e 0f add r18, r30 1093e: 20 93 43 03 sts 0x0343, r18 ; 0x800343 10942: f0 e0 ldi r31, 0x00 ; 0 10944: ef 5b subi r30, 0xBF ; 191 10946: fc 4f sbci r31, 0xFC ; 252 10948: 5f ef ldi r21, 0xFF ; 255 1094a: 50 83 st Z, r21 1094c: cd cf rjmp .-102 ; 0x108e8 1094e: a8 2f mov r26, r24 10950: af 70 andi r26, 0x0F ; 15 mp_char_buf = 0; } --mp_full_char_queue; } else { uint8_t buf[2] = { 0,0 }; 10952: 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; 10954: 31 e0 ldi r19, 0x01 ; 1 10956: af 30 cpi r26, 0x0F ; 15 10958: 29 f0 breq .+10 ; 0x10964 1095a: b0 e0 ldi r27, 0x00 ; 0 else chars_out[0] = MeatPackLookupTbl[(pk & 0xF)]; // Assign lower char 1095c: a0 50 subi r26, 0x00 ; 0 1095e: be 4f sbci r27, 0xFE ; 254 10960: 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; 10962: 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; 10964: 58 2f mov r21, r24 10966: 50 7f andi r21, 0xF0 ; 240 10968: 50 3f cpi r21, 0xF0 ; 240 1096a: 59 f4 brne .+22 ; 0x10982 1096c: 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) { 1096e: 30 ff sbrs r19, 0 10970: 13 c0 rjmp .+38 ; 0x10998 ++mp_full_char_queue; 10972: d0 92 3c 03 sts 0x033C, r13 ; 0x80033c if (res & MeatPack_NextPackedSecond) ++mp_full_char_queue; 10976: 31 ff sbrs r19, 1 10978: 0c c0 rjmp .+24 ; 0x10992 1097a: 82 e0 ldi r24, 0x02 ; 2 1097c: 80 93 3c 03 sts 0x033C, r24 ; 0x80033c 10980: bb ce rjmp .-650 ; 0x106f8 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 10982: 82 95 swap r24 10984: 8f 70 andi r24, 0x0F ; 15 10986: a8 2f mov r26, r24 10988: b0 e0 ldi r27, 0x00 ; 0 1098a: a0 50 subi r26, 0x00 ; 0 1098c: be 4f sbci r27, 0xFE ; 254 1098e: 2c 91 ld r18, X 10990: ee cf rjmp .-36 ; 0x1096e 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]; 10992: 20 93 3d 03 sts 0x033D, r18 ; 0x80033d 10996: b0 ce rjmp .-672 ; 0x106f8 #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; 10998: 81 e0 ldi r24, 0x01 ; 1 1099a: 8e 0f add r24, r30 1099c: 80 93 43 03 sts 0x0343, r24 ; 0x800343 109a0: ae 2f mov r26, r30 109a2: b0 e0 ldi r27, 0x00 ; 0 109a4: af 5b subi r26, 0xBF ; 191 109a6: bc 4f sbci r27, 0xFC ; 252 109a8: 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') { 109aa: 4a 30 cpi r20, 0x0A ; 10 109ac: 09 f4 brne .+2 ; 0x109b0 109ae: a4 ce rjmp .-696 ; 0x106f8 if (res & MeatPack_NextPackedSecond) ++mp_full_char_queue; 109b0: 31 ff sbrs r19, 1 109b2: 03 c0 rjmp .+6 ; 0x109ba 109b4: d0 92 3c 03 sts 0x033C, r13 ; 0x80033c 109b8: 9f ce rjmp .-706 ; 0x106f8 #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; 109ba: ee 5f subi r30, 0xFE ; 254 109bc: e0 93 43 03 sts 0x0343, r30 ; 0x800343 109c0: e8 2f mov r30, r24 109c2: f0 e0 ldi r31, 0x00 ; 0 109c4: ef 5b subi r30, 0xBF ; 191 109c6: fc 4f sbci r31, 0xFC ; 252 109c8: 20 83 st Z, r18 109ca: 96 ce rjmp .-724 ; 0x106f8 109cc: 91 e0 ldi r25, 0x01 ; 1 109ce: 9e 0f add r25, r30 109d0: 90 93 43 03 sts 0x0343, r25 ; 0x800343 109d4: f0 e0 ldi r31, 0x00 ; 0 109d6: ef 5b subi r30, 0xBF ; 191 109d8: fc 4f sbci r31, 0xFC ; 252 109da: 80 83 st Z, r24 109dc: 8d ce rjmp .-742 ; 0x106f8 continue; if(serial_char == '\n' || serial_char == '\r' || serial_count >= (MAX_CMD_SIZE - 1) ) { if(!serial_count) { //if empty line 109de: 00 97 sbiw r24, 0x00 ; 0 109e0: 19 f4 brne .+6 ; 0x109e8 comment_mode = false; //for new command 109e2: 10 92 45 03 sts 0x0345, r1 ; 0x800345 109e6: de ce rjmp .-580 ; 0x107a4 109e8: 00 91 a0 10 lds r16, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.550> 109ec: 10 91 a1 10 lds r17, 0x10A1 ; 0x8010a1 <_ZL7bufindw.lto_priv.550+0x1> return; } cmdbuffer[bufindw+serial_count+CMDHDRSIZE] = 0; // terminate string 109f0: 08 55 subi r16, 0x58 ; 88 109f2: 1f 4e sbci r17, 0xEF ; 239 109f4: 80 0f add r24, r16 109f6: 91 1f adc r25, r17 109f8: fc 01 movw r30, r24 109fa: 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) 109fc: 1a 83 std Y+2, r17 ; 0x02 109fe: 09 83 std Y+1, r16 ; 0x01 if(!comment_mode){ 10a00: 80 91 45 03 lds r24, 0x0345 ; 0x800345 10a04: 81 11 cpse r24, r1 10a06: 03 c1 rjmp .+518 ; 0x10c0e long gcode_N = -1; // seen line number // Line numbers must be first in buffer if (*cmd_head == 'N') { 10a08: f8 01 movw r30, r16 10a0a: 80 81 ld r24, Z 10a0c: 8e 34 cpi r24, 0x4E ; 78 10a0e: 09 f0 breq .+2 ; 0x10a12 10a10: 8a c0 rjmp .+276 ; 0x10b26 // Line number met: decode the number, then move cmd_start past all spaces. gcode_N = (strtol(cmd_head+1, &cmd_start, 10)); 10a12: 4a e0 ldi r20, 0x0A ; 10 10a14: 50 e0 ldi r21, 0x00 ; 0 10a16: be 01 movw r22, r28 10a18: 6f 5f subi r22, 0xFF ; 255 10a1a: 7f 4f sbci r23, 0xFF ; 255 10a1c: c8 01 movw r24, r16 10a1e: 01 96 adiw r24, 0x01 ; 1 10a20: 0f 94 a7 d7 call 0x3af4e ; 0x3af4e 10a24: 2b 01 movw r4, r22 10a26: 3c 01 movw r6, r24 while (*cmd_start == ' ') ++cmd_start; 10a28: e9 80 ldd r14, Y+1 ; 0x01 10a2a: fa 80 ldd r15, Y+2 ; 0x02 10a2c: f7 01 movw r30, r14 10a2e: 80 81 ld r24, Z 10a30: 80 32 cpi r24, 0x20 ; 32 10a32: 31 f4 brne .+12 ; 0x10a40 10a34: ff ef ldi r31, 0xFF ; 255 10a36: ef 1a sub r14, r31 10a38: ff 0a sbc r15, r31 10a3a: fa 82 std Y+2, r15 ; 0x02 10a3c: e9 82 std Y+1, r14 ; 0x01 10a3e: f4 cf rjmp .-24 ; 0x10a28 // 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)) { 10a40: 80 90 7a 03 lds r8, 0x037A ; 0x80037a 10a44: 90 90 7b 03 lds r9, 0x037B ; 0x80037b 10a48: a0 90 7c 03 lds r10, 0x037C ; 0x80037c 10a4c: b0 90 7d 03 lds r11, 0x037D ; 0x80037d 10a50: d5 01 movw r26, r10 10a52: c4 01 movw r24, r8 10a54: 01 96 adiw r24, 0x01 ; 1 10a56: a1 1d adc r26, r1 10a58: b1 1d adc r27, r1 10a5a: 84 15 cp r24, r4 10a5c: 95 05 cpc r25, r5 10a5e: a6 05 cpc r26, r6 10a60: b7 05 cpc r27, r7 10a62: 49 f0 breq .+18 ; 0x10a76 10a64: 44 e0 ldi r20, 0x04 ; 4 10a66: 50 e0 ldi r21, 0x00 ; 0 10a68: 69 e9 ldi r22, 0x99 ; 153 10a6a: 77 e7 ldi r23, 0x77 ; 119 10a6c: c7 01 movw r24, r14 10a6e: 0f 94 fb d9 call 0x3b3f6 ; 0x3b3f6 10a72: 89 2b or r24, r25 10a74: a1 f4 brne .+40 ; 0x10a9e FlushSerialRequestResend(); serial_count = 0; return; } if((strchr_pointer = strchr(cmd_start, '*')) != NULL) 10a76: 6a e2 ldi r22, 0x2A ; 42 10a78: 70 e0 ldi r23, 0x00 ; 0 10a7a: c7 01 movw r24, r14 10a7c: 0f 94 73 e2 call 0x3c4e6 ; 0x3c4e6 10a80: 90 93 96 03 sts 0x0396, r25 ; 0x800396 10a84: 80 93 95 03 sts 0x0395, r24 ; 0x800395 10a88: 00 97 sbiw r24, 0x00 ; 0 10a8a: 09 f4 brne .+2 ; 0x10a8e 10a8c: 45 c0 rjmp .+138 ; 0x10b18 10a8e: f8 01 movw r30, r16 { byte checksum = 0; 10a90: f1 2c mov r15, r1 char *p = cmd_head; while (p != strchr_pointer) 10a92: e8 17 cp r30, r24 10a94: f9 07 cpc r31, r25 10a96: 71 f0 breq .+28 ; 0x10ab4 checksum = checksum^(*p++); 10a98: 21 91 ld r18, Z+ 10a9a: f2 26 eor r15, r18 10a9c: fa cf rjmp .-12 ; 0x10a92 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; 10a9e: 8a e9 ldi r24, 0x9A ; 154 10aa0: 9b ea ldi r25, 0xAB ; 171 10aa2: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ERRORRPGM(_n("Line Number is not Last Line Number+1, Last Line: "));////MSG_ERR_LINE_NO 10aa6: 8a e4 ldi r24, 0x4A ; 74 10aa8: 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 10aaa: 0e 94 50 77 call 0xeea0 ; 0xeea0 10aae: c5 01 movw r24, r10 10ab0: b4 01 movw r22, r8 10ab2: 15 c0 rjmp .+42 ; 0x10ade { byte checksum = 0; char *p = cmd_head; while (p != strchr_pointer) checksum = checksum^(*p++); if (code_value_short() != (int16_t)checksum) { 10ab4: 0e 94 75 5b call 0xb6ea ; 0xb6ea 10ab8: f8 16 cp r15, r24 10aba: 19 06 cpc r1, r25 10abc: d9 f0 breq .+54 ; 0x10af4 SERIAL_ERROR_START; 10abe: 8a e9 ldi r24, 0x9A ; 154 10ac0: 9b ea ldi r25, 0xAB ; 171 10ac2: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ERRORRPGM(_n("checksum mismatch, Last Line: "));////MSG_ERR_CHECKSUM_MISMATCH 10ac6: 8b e2 ldi r24, 0x2B ; 43 10ac8: 95 e6 ldi r25, 0x65 ; 101 10aca: 0e 94 50 77 call 0xeea0 ; 0xeea0 10ace: 60 91 7a 03 lds r22, 0x037A ; 0x80037a 10ad2: 70 91 7b 03 lds r23, 0x037B ; 0x80037b 10ad6: 80 91 7c 03 lds r24, 0x037C ; 0x80037c 10ada: 90 91 7d 03 lds r25, 0x037D ; 0x80037d 10ade: 0f 94 6b d5 call 0x3aad6 ; 0x3aad6 } void MarlinSerial::println(long n, int base) { print(n, base); println(); 10ae2: 0f 94 fd d5 call 0x3abfa ; 0x3abfa SERIAL_ERRORLN(gcode_LastN); FlushSerialRequestResend(); 10ae6: 0e 94 8d 5b call 0xb71a ; 0xb71a serial_count = 0; 10aea: 10 92 9f 10 sts 0x109F, r1 ; 0x80109f 10aee: 10 92 9e 10 sts 0x109E, r1 ; 0x80109e 10af2: 58 ce rjmp .-848 ; 0x107a4 return; } // If no errors, remove the checksum and continue parsing. *strchr_pointer = 0; 10af4: e0 91 95 03 lds r30, 0x0395 ; 0x800395 10af8: f0 91 96 03 lds r31, 0x0396 ; 0x800396 10afc: 10 82 st Z, r1 return; } } // Handle KILL early, even when Stopped if(strcmp_P(cmd_start, PSTR("M112")) == 0) 10afe: e9 80 ldd r14, Y+1 ; 0x01 10b00: fa 80 ldd r15, Y+2 ; 0x02 10b02: 64 e9 ldi r22, 0x94 ; 148 10b04: 77 e7 ldi r23, 0x77 ; 119 10b06: c7 01 movw r24, r14 10b08: 0f 94 ca d9 call 0x3b394 ; 0x3b394 10b0c: 89 2b or r24, r25 10b0e: 39 f5 brne .+78 ; 0x10b5e kill(MSG_M112_KILL); 10b10: 85 e6 ldi r24, 0x65 ; 101 10b12: 98 e6 ldi r25, 0x68 ; 104 10b14: 0e 94 0a 7a call 0xf414 ; 0xf414 // If no errors, remove the checksum and continue parsing. *strchr_pointer = 0; } else { SERIAL_ERROR_START; 10b18: 8a e9 ldi r24, 0x9A ; 154 10b1a: 9b ea ldi r25, 0xAB ; 171 10b1c: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ERRORRPGM(_n("No Checksum with line number, Last Line: "));////MSG_ERR_NO_CHECKSUM 10b20: 81 e0 ldi r24, 0x01 ; 1 10b22: 95 e6 ldi r25, 0x65 ; 101 10b24: c2 cf rjmp .-124 ; 0x10aaa } } else { // move cmd_start past all spaces while (*cmd_start == ' ') ++cmd_start; 10b26: 89 81 ldd r24, Y+1 ; 0x01 10b28: 9a 81 ldd r25, Y+2 ; 0x02 10b2a: fc 01 movw r30, r24 10b2c: 20 81 ld r18, Z 10b2e: 20 32 cpi r18, 0x20 ; 32 10b30: 21 f4 brne .+8 ; 0x10b3a 10b32: 01 96 adiw r24, 0x01 ; 1 10b34: 9a 83 std Y+2, r25 ; 0x02 10b36: 89 83 std Y+1, r24 ; 0x01 10b38: f6 cf rjmp .-20 ; 0x10b26 // if we didn't receive 'N' but still see '*' if (strchr(cmd_start, '*') != NULL) 10b3a: 6a e2 ldi r22, 0x2A ; 42 10b3c: 70 e0 ldi r23, 0x00 ; 0 10b3e: 0f 94 73 e2 call 0x3c4e6 ; 0x3c4e6 10b42: 89 2b or r24, r25 10b44: 39 f0 breq .+14 ; 0x10b54 { SERIAL_ERROR_START; 10b46: 8a e9 ldi r24, 0x9A ; 154 10b48: 9b ea ldi r25, 0xAB ; 171 10b4a: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ERRORRPGM(_n("No Line Number with checksum, Last Line: "));////MSG_ERR_NO_LINENUMBER_WITH_CHECKSUM 10b4e: 87 ed ldi r24, 0xD7 ; 215 10b50: 94 e6 ldi r25, 0x64 ; 100 10b52: bb cf rjmp .-138 ; 0x10aca 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 10b54: 44 24 eor r4, r4 10b56: 4a 94 dec r4 10b58: 54 2c mov r5, r4 10b5a: 32 01 movw r6, r4 10b5c: d0 cf rjmp .-96 ; 0x10afe 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) 10b5e: 44 e0 ldi r20, 0x04 ; 4 10b60: 50 e0 ldi r21, 0x00 ; 0 10b62: 6f e8 ldi r22, 0x8F ; 143 10b64: 77 e7 ldi r23, 0x77 ; 119 10b66: c7 01 movw r24, r14 10b68: 0f 94 fb d9 call 0x3b3f6 ; 0x3b3f6 10b6c: 5c 01 movw r10, r24 allow_when_stopped = true; // Handle the USB timer if ((*cmd_start == 'G') && (GetPrinterState() != PrinterState::IsSDPrinting)) { 10b6e: f7 01 movw r30, r14 10b70: 80 81 ld r24, Z 10b72: 87 34 cpi r24, 0x47 ; 71 10b74: 81 f4 brne .+32 ; 0x10b96 10b76: 80 91 b8 0d lds r24, 0x0DB8 ; 0x800db8 <_ZL13printer_state.lto_priv.401> 10b7a: 85 30 cpi r24, 0x05 ; 5 10b7c: 61 f0 breq .+24 ; 0x10b96 usb_timer.start(); 10b7e: 8e e0 ldi r24, 0x0E ; 14 10b80: 95 e0 ldi r25, 0x05 ; 5 10b82: 0f 94 ad 29 call 0x2535a ; 0x2535a ::start()> PrinterState GetPrinterState() { return printer_state; } PrinterState SetPrinterState(PrinterState status) { return printer_state = status; 10b86: f6 e0 ldi r31, 0x06 ; 6 10b88: f0 93 b8 0d sts 0x0DB8, r31 ; 0x800db8 <_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); 10b8c: 60 e0 ldi r22, 0x00 ; 0 10b8e: 85 ea ldi r24, 0xA5 ; 165 10b90: 9f e0 ldi r25, 0x0F ; 15 10b92: 0f 94 40 dc call 0x3b880 ; 0x3b880 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) { 10b96: ab 28 or r10, r11 10b98: 21 f0 breq .+8 ; 0x10ba2 10b9a: 80 91 11 05 lds r24, 0x0511 ; 0x800511 10b9e: 81 11 cpse r24, r1 10ba0: a4 cf rjmp .-184 ; 0x10aea } // 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; 10ba2: 26 e0 ldi r18, 0x06 ; 6 10ba4: 77 fc sbrc r7, 7 10ba6: 21 e0 ldi r18, 0x01 ; 1 10ba8: 80 91 a0 10 lds r24, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.550> 10bac: 90 91 a1 10 lds r25, 0x10A1 ; 0x8010a1 <_ZL7bufindw.lto_priv.550+0x1> 10bb0: fc 01 movw r30, r24 10bb2: eb 55 subi r30, 0x5B ; 91 10bb4: ff 4e sbci r31, 0xEF ; 239 10bb6: 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) 10bb8: 49 81 ldd r20, Y+1 ; 0x01 10bba: 5a 81 ldd r21, Y+2 ; 0x02 cmd_len = strlen(cmd_start) + 1; 10bbc: 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) 10bbe: da 01 movw r26, r20 10bc0: 40 17 cp r20, r16 10bc2: 51 07 cpc r21, r17 10bc4: a1 f5 brne .+104 ; 0x10c2e cmd_len = strlen(cmd_start) + 1; 10bc6: 01 90 ld r0, Z+ 10bc8: 00 20 and r0, r0 10bca: e9 f7 brne .-6 ; 0x10bc6 10bcc: 9f 01 movw r18, r30 10bce: 20 1b sub r18, r16 10bd0: 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; 10bd2: 03 96 adiw r24, 0x03 ; 3 10bd4: 28 0f add r18, r24 10bd6: 39 1f adc r19, r25 if (bufindw == sizeof(cmdbuffer)) 10bd8: 2d 3e cpi r18, 0xED ; 237 10bda: f1 e0 ldi r31, 0x01 ; 1 10bdc: 3f 07 cpc r19, r31 10bde: 79 f1 breq .+94 ; 0x10c3e // 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; 10be0: 30 93 a1 10 sts 0x10A1, r19 ; 0x8010a1 <_ZL7bufindw.lto_priv.550+0x1> 10be4: 20 93 a0 10 sts 0x10A0, r18 ; 0x8010a0 <_ZL7bufindw.lto_priv.550> if (bufindw == sizeof(cmdbuffer)) bufindw = 0; ++ buflen; 10be8: 80 91 a3 10 lds r24, 0x10A3 ; 0x8010a3 10bec: 90 91 a4 10 lds r25, 0x10A4 ; 0x8010a4 10bf0: 01 96 adiw r24, 0x01 ; 1 10bf2: 90 93 a4 10 sts 0x10A4, r25 ; 0x8010a4 10bf6: 80 93 a3 10 sts 0x10A3, r24 ; 0x8010a3 // Update the processed gcode line if (gcode_N >= 0) 10bfa: 77 fc sbrc r7, 7 10bfc: 08 c0 rjmp .+16 ; 0x10c0e gcode_LastN = gcode_N; 10bfe: 40 92 7a 03 sts 0x037A, r4 ; 0x80037a 10c02: 50 92 7b 03 sts 0x037B, r5 ; 0x80037b 10c06: 60 92 7c 03 sts 0x037C, r6 ; 0x80037c 10c0a: 70 92 7d 03 sts 0x037D, r7 ; 0x80037d 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 10c0e: 10 92 9f 10 sts 0x109F, r1 ; 0x80109f 10c12: 10 92 9e 10 sts 0x109E, r1 ; 0x80109e // 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)) 10c16: 0e 94 09 77 call 0xee12 ; 0xee12 10c1a: 89 2b or r24, r25 10c1c: 09 f4 brne .+2 ; 0x10c20 10c1e: c2 cd rjmp .-1148 ; 0x107a4 10c20: 8f e5 ldi r24, 0x5F ; 95 10c22: 90 e0 ldi r25, 0x00 ; 0 10c24: 0e 94 42 5c call 0xb884 ; 0xb884 10c28: 81 11 cpse r24, r1 10c2a: 79 cd rjmp .-1294 ; 0x1071e 10c2c: bb cd rjmp .-1162 ; 0x107a4 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]; } 10c2e: 6d 91 ld r22, X+ 10c30: 61 93 st Z+, r22 10c32: 9d 01 movw r18, r26 10c34: 24 1b sub r18, r20 10c36: 35 0b sbc r19, r21 while (cmd_head[cmd_len++]); 10c38: 61 11 cpse r22, r1 10c3a: f9 cf rjmp .-14 ; 0x10c2e 10c3c: ca cf rjmp .-108 ; 0x10bd2 } bufindw += cmd_len + CMDHDRSIZE; if (bufindw == sizeof(cmdbuffer)) bufindw = 0; 10c3e: 10 92 a1 10 sts 0x10A1, r1 ; 0x8010a1 <_ZL7bufindw.lto_priv.550+0x1> 10c42: 10 92 a0 10 sts 0x10A0, r1 ; 0x8010a0 <_ZL7bufindw.lto_priv.550> 10c46: d0 cf rjmp .-96 ; 0x10be8 #ifdef ENABLE_MEATPACK } #endif } // end of serial line processing loop if (serial_count > 0 && serialTimeoutTimer.expired(farm_mode ? 800 : 2000)) { 10c48: 60 ed ldi r22, 0xD0 ; 208 10c4a: 77 e0 ldi r23, 0x07 ; 7 10c4c: 86 e4 ldi r24, 0x46 ; 70 10c4e: 93 e0 ldi r25, 0x03 ; 3 10c50: 0f 94 7e 29 call 0x252fc ; 0x252fc ::expired(unsigned short)> 10c54: 88 23 and r24, r24 10c56: 09 f4 brne .+2 ; 0x10c5a 10c58: a1 cd rjmp .-1214 ; 0x1079c comment_mode = false; 10c5a: 10 92 45 03 sts 0x0345, r1 ; 0x800345 serial_count = 0; 10c5e: 10 92 9f 10 sts 0x109F, r1 ; 0x80109f 10c62: 10 92 9e 10 sts 0x109E, r1 ; 0x80109e SERIAL_ECHOLNPGM("RX timeout"); 10c66: 84 e8 ldi r24, 0x84 ; 132 10c68: 97 e7 ldi r25, 0x77 ; 119 10c6a: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 10c6e: 9a cd rjmp .-1228 ; 0x107a4 return; } #ifdef SDSUPPORT if(!card.sdprinting || !card.isFileOpen() || serial_count!=0){ 10c70: 80 91 23 17 lds r24, 0x1723 ; 0x801723 10c74: 88 23 and r24, r24 10c76: 09 f4 brne .+2 ; 0x10c7a 10c78: 95 cd rjmp .-1238 ; 0x107a4 10c7a: 80 91 9e 10 lds r24, 0x109E ; 0x80109e 10c7e: 90 91 9f 10 lds r25, 0x109F ; 0x80109f 10c82: 89 2b or r24, r25 10c84: 09 f0 breq .+2 ; 0x10c88 10c86: 8e cd rjmp .-1252 ; 0x107a4 //'#' 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; 10c88: 80 91 a3 10 lds r24, 0x10A3 ; 0x8010a3 10c8c: 90 91 a4 10 lds r25, 0x10A4 ; 0x8010a4 10c90: 89 2b or r24, r25 10c92: 11 f4 brne .+4 ; 0x10c98 10c94: 10 92 44 03 sts 0x0344, r1 ; 0x800344 } eof_or_fail: // make the rdptr point to a safe location - end of file gfReadPtr = gfBlockBuffBegin() + 512; 10c98: 2d e9 ldi r18, 0x9D ; 157 10c9a: e2 2e mov r14, r18 10c9c: 20 e1 ldi r18, 0x10 ; 16 10c9e: 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; 10ca0: 32 e0 ldi r19, 0x02 ; 2 10ca2: d3 2e mov r13, r19 || serial_char == '#' || serial_count >= (MAX_CMD_SIZE - 1) || n==-1 ){ if(serial_char=='#') stop_buffering=true; 10ca4: cc 24 eor r12, r12 10ca6: 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) { 10ca8: 40 91 a4 17 lds r20, 0x17A4 ; 0x8017a4 10cac: 50 91 a5 17 lds r21, 0x17A5 ; 0x8017a5 10cb0: 60 91 a6 17 lds r22, 0x17A6 ; 0x8017a6 10cb4: 70 91 a7 17 lds r23, 0x17A7 ; 0x8017a7 10cb8: 80 91 9d 17 lds r24, 0x179D ; 0x80179d 10cbc: 90 91 9e 17 lds r25, 0x179E ; 0x80179e 10cc0: a0 91 9f 17 lds r26, 0x179F ; 0x80179f 10cc4: b0 91 a0 17 lds r27, 0x17A0 ; 0x8017a0 10cc8: 48 17 cp r20, r24 10cca: 59 07 cpc r21, r25 10ccc: 6a 07 cpc r22, r26 10cce: 7b 07 cpc r23, r27 10cd0: 08 f0 brcs .+2 ; 0x10cd4 10cd2: 2f c1 rjmp .+606 ; 0x10f32 10cd4: 80 91 44 03 lds r24, 0x0344 ; 0x800344 10cd8: 81 11 cpse r24, r1 10cda: 2b c1 rjmp .+598 ; 0x10f32 : "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() ){ 10cdc: 0f 94 83 7a call 0x2f506 ; 0x2f506 10ce0: 88 23 and r24, r24 10ce2: 49 f1 breq .+82 ; 0x10d36 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; 10ce4: 20 91 3b 17 lds r18, 0x173B ; 0x80173b 10ce8: 30 91 3c 17 lds r19, 0x173C ; 0x80173c // 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; 10cec: 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; 10cee: 9b ef ldi r25, 0xFB ; 251 10cf0: 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 == ';' ){ 10cf2: f8 01 movw r30, r16 10cf4: 80 81 ld r24, Z 10cf6: 8b 33 cpi r24, 0x3B ; 59 10cf8: 51 f5 brne .+84 ; 0x10d4e // 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); 10cfa: f8 01 movw r30, r16 00010cfc : 10cfc: 61 91 ld r22, Z+ 10cfe: 6a 30 cpi r22, 0x0A ; 10 10d00: e9 f7 brne .-6 ; 0x10cfc 10d02: 8f 01 movw r16, r30 // found a newline, prepare the next block if block cache end reached if( rdPtr - blockBuffBegin > 512 ){ 10d04: cf 01 movw r24, r30 10d06: 8d 59 subi r24, 0x9D ; 157 10d08: 9e 40 sbci r25, 0x0E ; 14 10d0a: 81 30 cpi r24, 0x01 ; 1 10d0c: 92 40 sbci r25, 0x02 ; 2 10d0e: d4 f0 brlt .+52 ; 0x10d44 // at the end of block cache, fill new data in gfUpdateCurrentPosition( rdPtr - start - 1 ); 10d10: c8 01 movw r24, r16 10d12: 82 1b sub r24, r18 10d14: 93 0b sbc r25, r19 10d16: 01 97 sbiw r24, 0x01 ; 1 10d18: 0f 94 74 7a call 0x2f4e8 ; 0x2f4e8 if( ! gfComputeNextFileBlock() )goto eof_or_fail; 10d1c: 80 e2 ldi r24, 0x20 ; 32 10d1e: 97 e1 ldi r25, 0x17 ; 23 10d20: 0f 94 19 56 call 0x2ac32 ; 0x2ac32 10d24: 88 23 and r24, r24 10d26: 39 f0 breq .+14 ; 0x10d36 if( ! gfEnsureBlock() )goto eof_or_fail; // fetch it into RAM 10d28: 0f 94 83 7a call 0x2f506 ; 0x2f506 rdPtr = start = blockBuffBegin; 10d2c: 2d e9 ldi r18, 0x9D ; 157 10d2e: 3e e0 ldi r19, 0x0E ; 14 10d30: 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 10d32: 81 11 cpse r24, r1 10d34: e2 cf rjmp .-60 ; 0x10cfa } eof_or_fail: // make the rdptr point to a safe location - end of file gfReadPtr = gfBlockBuffBegin() + 512; 10d36: f0 92 3c 17 sts 0x173C, r15 ; 0x80173c 10d3a: e0 92 3b 17 sts 0x173B, r14 ; 0x80173b return -1; 10d3e: 0f ef ldi r16, 0xFF ; 255 10d40: 1f ef ldi r17, 0xFF ; 255 10d42: 37 c0 rjmp .+110 ; 0x10db2 10d44: 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){ 10d46: b1 10 cpse r11, r1 10d48: d5 c0 rjmp .+426 ; 0x10ef4 // 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 10d4a: 01 50 subi r16, 0x01 ; 1 10d4c: 11 09 sbc r17, r1 } } } emit_char: { gfUpdateCurrentPosition( rdPtr - start + 1 ); 10d4e: c8 01 movw r24, r16 10d50: 82 1b sub r24, r18 10d52: 93 0b sbc r25, r19 10d54: 01 96 adiw r24, 0x01 ; 1 10d56: 0f 94 74 7a call 0x2f4e8 ; 0x2f4e8 int16_t rv = *rdPtr++; 10d5a: c8 01 movw r24, r16 10d5c: 01 96 adiw r24, 0x01 ; 1 10d5e: f8 01 movw r30, r16 10d60: 00 81 ld r16, Z 10d62: 10 e0 ldi r17, 0x00 ; 0 if( curPosition_ >= fileSize_ ){ 10d64: 80 90 28 17 lds r8, 0x1728 ; 0x801728 10d68: 90 90 29 17 lds r9, 0x1729 ; 0x801729 10d6c: a0 90 2a 17 lds r10, 0x172A ; 0x80172a 10d70: b0 90 2b 17 lds r11, 0x172B ; 0x80172b 10d74: 40 91 31 17 lds r20, 0x1731 ; 0x801731 10d78: 50 91 32 17 lds r21, 0x1732 ; 0x801732 10d7c: 60 91 33 17 lds r22, 0x1733 ; 0x801733 10d80: 70 91 34 17 lds r23, 0x1734 ; 0x801734 10d84: 84 16 cp r8, r20 10d86: 95 06 cpc r9, r21 10d88: a6 06 cpc r10, r22 10d8a: b7 06 cpc r11, r23 10d8c: a0 f6 brcc .-88 ; 0x10d36 // past the end of file goto eof_or_fail; } else if( rdPtr - blockBuffBegin >= 512 ){ 10d8e: 9c 01 movw r18, r24 10d90: 2d 59 subi r18, 0x9D ; 157 10d92: 3e 40 sbci r19, 0x0E ; 14 10d94: 21 15 cp r18, r1 10d96: 32 40 sbci r19, 0x02 ; 2 10d98: 44 f0 brlt .+16 ; 0x10daa // past the end of current bufferred block - prepare the next one... if( ! gfComputeNextFileBlock() )goto eof_or_fail; 10d9a: 80 e2 ldi r24, 0x20 ; 32 10d9c: 97 e1 ldi r25, 0x17 ; 23 10d9e: 0f 94 19 56 call 0x2ac32 ; 0x2ac32 10da2: 88 23 and r24, r24 10da4: 41 f2 breq .-112 ; 0x10d36 // don't need to force fetch the block here, it will get loaded on the next call rdPtr = blockBuffBegin; 10da6: 8d e9 ldi r24, 0x9D ; 157 10da8: 9e e0 ldi r25, 0x0E ; 14 } // save the current read ptr for the next run gfReadPtr = rdPtr; 10daa: 90 93 3c 17 sts 0x173C, r25 ; 0x80173c 10dae: 80 93 3b 17 sts 0x173B, r24 ; 0x80173b 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_;} 10db2: 40 91 28 17 lds r20, 0x1728 ; 0x801728 10db6: 50 91 29 17 lds r21, 0x1729 ; 0x801729 10dba: 60 91 2a 17 lds r22, 0x172A ; 0x80172a 10dbe: 70 91 2b 17 lds r23, 0x172B ; 0x80172b 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(); 10dc2: 40 93 a4 17 sts 0x17A4, r20 ; 0x8017a4 10dc6: 50 93 a5 17 sts 0x17A5, r21 ; 0x8017a5 10dca: 60 93 a6 17 sts 0x17A6, r22 ; 0x8017a6 10dce: 70 93 a7 17 sts 0x17A7, r23 ; 0x8017a7 10dd2: 80 91 9e 10 lds r24, 0x109E ; 0x80109e 10dd6: 90 91 9f 10 lds r25, 0x109F ; 0x80109f int16_t n=card.getFilteredGcodeChar(); char serial_char = (char)n; if( serial_char == '\n' 10dda: 0a 30 cpi r16, 0x0A ; 10 10ddc: 61 f0 breq .+24 ; 0x10df6 || serial_char == '\r' 10dde: 0d 30 cpi r16, 0x0D ; 13 10de0: 51 f0 breq .+20 ; 0x10df6 || serial_char == '#' 10de2: 03 32 cpi r16, 0x23 ; 35 10de4: 09 f4 brne .+2 ; 0x10de8 10de6: 8c c0 rjmp .+280 ; 0x10f00 || serial_count >= (MAX_CMD_SIZE - 1) 10de8: 8f 35 cpi r24, 0x5F ; 95 10dea: 91 05 cpc r25, r1 10dec: 3c f4 brge .+14 ; 0x10dfc || n==-1 10dee: 0f 3f cpi r16, 0xFF ; 255 10df0: 10 07 cpc r17, r16 10df2: 09 f0 breq .+2 ; 0x10df6 10df4: 8c c0 rjmp .+280 ; 0x10f0e ){ if(serial_char=='#') stop_buffering=true; if(!serial_count) 10df6: 00 97 sbiw r24, 0x00 ; 0 10df8: 09 f4 brne .+2 ; 0x10dfc 10dfa: d4 cc rjmp .-1624 ; 0x107a4 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); }; 10dfc: 20 91 23 17 lds r18, 0x1723 ; 0x801723 10e00: 21 11 cpse r18, r1 10e02: 03 c0 rjmp .+6 ; 0x10e0a 10e04: 40 e0 ldi r20, 0x00 ; 0 10e06: 50 e0 ldi r21, 0x00 ; 0 10e08: 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; 10e0a: 20 91 82 03 lds r18, 0x0382 ; 0x800382 10e0e: 30 91 83 03 lds r19, 0x0383 ; 0x800383 10e12: 42 1b sub r20, r18 10e14: 53 0b sbc r21, r19 cmdbuffer[bufindw] = CMDBUFFER_CURRENT_TYPE_SDCARD; 10e16: a0 91 a0 10 lds r26, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.550> 10e1a: b0 91 a1 10 lds r27, 0x10A1 ; 0x8010a1 <_ZL7bufindw.lto_priv.550+0x1> 10e1e: fd 01 movw r30, r26 10e20: eb 55 subi r30, 0x5B ; 91 10e22: ff 4e sbci r31, 0xEF ; 239 10e24: d0 82 st Z, r13 cmdbuffer[bufindw+1] = sd_count.lohi.lo; 10e26: 41 83 std Z+1, r20 ; 0x01 cmdbuffer[bufindw+2] = sd_count.lohi.hi; 10e28: 52 83 std Z+2, r21 ; 0x02 10e2a: 13 96 adiw r26, 0x03 ; 3 cmdbuffer[bufindw+serial_count+CMDHDRSIZE] = 0; //terminate string 10e2c: 8b 55 subi r24, 0x5B ; 91 10e2e: 9f 4e sbci r25, 0xEF ; 239 10e30: fc 01 movw r30, r24 10e32: ea 0f add r30, r26 10e34: fb 1f adc r31, r27 10e36: 10 82 st Z, r1 // Calculate the length before disabling the interrupts. uint8_t len = strlen(cmdbuffer+bufindw+CMDHDRSIZE) + (1 + CMDHDRSIZE); 10e38: ab 55 subi r26, 0x5B ; 91 10e3a: bf 4e sbci r27, 0xEF ; 239 10e3c: fd 01 movw r30, r26 10e3e: 01 90 ld r0, Z+ 10e40: 00 20 and r0, r0 10e42: e9 f7 brne .-6 ; 0x10e3e 10e44: 31 97 sbiw r30, 0x01 ; 1 10e46: ea 1b sub r30, r26 10e48: fb 0b sbc r31, r27 // MYSERIAL.print(cmdbuffer); // SERIAL_ECHOPGM("buflen:"); // MYSERIAL.print(buflen+1); sd_count.value = 0; cli(); 10e4a: 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; 10e4c: 80 91 a3 10 lds r24, 0x10A3 ; 0x8010a3 10e50: 90 91 a4 10 lds r25, 0x10A4 ; 0x8010a4 10e54: 01 96 adiw r24, 0x01 ; 1 10e56: 90 93 a4 10 sts 0x10A4, r25 ; 0x8010a4 10e5a: 80 93 a3 10 sts 0x10A3, r24 ; 0x8010a3 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); 10e5e: 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; 10e60: 80 91 a0 10 lds r24, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.550> 10e64: 90 91 a1 10 lds r25, 0x10A1 ; 0x8010a1 <_ZL7bufindw.lto_priv.550+0x1> 10e68: e8 0f add r30, r24 10e6a: f9 2f mov r31, r25 10e6c: f1 1d adc r31, r1 10e6e: f0 93 a1 10 sts 0x10A1, r31 ; 0x8010a1 <_ZL7bufindw.lto_priv.550+0x1> 10e72: e0 93 a0 10 sts 0x10A0, r30 ; 0x8010a0 <_ZL7bufindw.lto_priv.550> 10e76: 80 91 23 17 lds r24, 0x1723 ; 0x801723 10e7a: 88 23 and r24, r24 10e7c: 09 f4 brne .+2 ; 0x10e80 10e7e: 43 c0 rjmp .+134 ; 0x10f06 10e80: 80 91 a4 17 lds r24, 0x17A4 ; 0x8017a4 10e84: 90 91 a5 17 lds r25, 0x17A5 ; 0x8017a5 10e88: a0 91 a6 17 lds r26, 0x17A6 ; 0x8017a6 10e8c: b0 91 a7 17 lds r27, 0x17A7 ; 0x8017a7 sdpos_atomic = card.get_sdpos(); 10e90: 80 93 82 03 sts 0x0382, r24 ; 0x800382 10e94: 90 93 83 03 sts 0x0383, r25 ; 0x800383 10e98: a0 93 84 03 sts 0x0384, r26 ; 0x800384 10e9c: b0 93 85 03 sts 0x0385, r27 ; 0x800385 if (bufindw == sizeof(cmdbuffer)) 10ea0: ed 3e cpi r30, 0xED ; 237 10ea2: f1 40 sbci r31, 0x01 ; 1 10ea4: 21 f4 brne .+8 ; 0x10eae bufindw = 0; 10ea6: 10 92 a1 10 sts 0x10A1, r1 ; 0x8010a1 <_ZL7bufindw.lto_priv.550+0x1> 10eaa: 10 92 a0 10 sts 0x10A0, r1 ; 0x8010a0 <_ZL7bufindw.lto_priv.550> sei(); 10eae: 78 94 sei comment_mode = false; //for new command 10eb0: 10 92 45 03 sts 0x0345, r1 ; 0x800345 serial_count = 0; //clear buffer 10eb4: 10 92 9f 10 sts 0x109F, r1 ; 0x80109f 10eb8: 10 92 9e 10 sts 0x109E, r1 ; 0x80109e if(card.eof()) break; 10ebc: 40 91 a4 17 lds r20, 0x17A4 ; 0x8017a4 10ec0: 50 91 a5 17 lds r21, 0x17A5 ; 0x8017a5 10ec4: 60 91 a6 17 lds r22, 0x17A6 ; 0x8017a6 10ec8: 70 91 a7 17 lds r23, 0x17A7 ; 0x8017a7 10ecc: 80 91 9d 17 lds r24, 0x179D ; 0x80179d 10ed0: 90 91 9e 17 lds r25, 0x179E ; 0x80179e 10ed4: a0 91 9f 17 lds r26, 0x179F ; 0x80179f 10ed8: b0 91 a0 17 lds r27, 0x17A0 ; 0x8017a0 10edc: 48 17 cp r20, r24 10ede: 59 07 cpc r21, r25 10ee0: 6a 07 cpc r22, r26 10ee2: 7b 07 cpc r23, r27 10ee4: 30 f5 brcc .+76 ; 0x10f32 // The following line will reserve buffer space if available. if (! cmdqueue_could_enqueue_back(MAX_CMD_SIZE-1)) 10ee6: 8f e5 ldi r24, 0x5F ; 95 10ee8: 90 e0 ldi r25, 0x00 ; 0 10eea: 0e 94 42 5c call 0xb884 ; 0xb884 10eee: 81 11 cpse r24, r1 10ef0: db ce rjmp .-586 ; 0x10ca8 10ef2: 58 cc rjmp .-1872 ; 0x107a4 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 == ';' ){ 10ef4: f8 01 movw r30, r16 10ef6: 80 81 ld r24, Z 10ef8: 8b 33 cpi r24, 0x3B ; 59 10efa: 09 f4 brne .+2 ; 0x10efe 10efc: fa ce rjmp .-524 ; 0x10cf2 10efe: 25 cf rjmp .-438 ; 0x10d4a || serial_char == '#' || serial_count >= (MAX_CMD_SIZE - 1) || n==-1 ){ if(serial_char=='#') stop_buffering=true; 10f00: c0 92 44 03 sts 0x0344, r12 ; 0x800344 10f04: 78 cf rjmp .-272 ; 0x10df6 10f06: 80 e0 ldi r24, 0x00 ; 0 10f08: 90 e0 ldi r25, 0x00 ; 0 10f0a: dc 01 movw r26, r24 10f0c: c1 cf rjmp .-126 ; 0x10e90 return; } else { // there are no comments coming from the filtered file cmdbuffer[bufindw+CMDHDRSIZE+serial_count++] = serial_char; 10f0e: 9c 01 movw r18, r24 10f10: 2f 5f subi r18, 0xFF ; 255 10f12: 3f 4f sbci r19, 0xFF ; 255 10f14: 30 93 9f 10 sts 0x109F, r19 ; 0x80109f 10f18: 20 93 9e 10 sts 0x109E, r18 ; 0x80109e 10f1c: 20 91 a0 10 lds r18, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.550> 10f20: 30 91 a1 10 lds r19, 0x10A1 ; 0x8010a1 <_ZL7bufindw.lto_priv.550+0x1> 10f24: 2b 55 subi r18, 0x5B ; 91 10f26: 3f 4e sbci r19, 0xEF ; 239 10f28: 82 0f add r24, r18 10f2a: 93 1f adc r25, r19 10f2c: fc 01 movw r30, r24 10f2e: 03 83 std Z+3, r16 ; 0x03 10f30: bb ce rjmp .-650 ; 0x10ca8 } } if(card.eof()) 10f32: 40 91 a4 17 lds r20, 0x17A4 ; 0x8017a4 10f36: 50 91 a5 17 lds r21, 0x17A5 ; 0x8017a5 10f3a: 60 91 a6 17 lds r22, 0x17A6 ; 0x8017a6 10f3e: 70 91 a7 17 lds r23, 0x17A7 ; 0x8017a7 10f42: 80 91 9d 17 lds r24, 0x179D ; 0x80179d 10f46: 90 91 9e 17 lds r25, 0x179E ; 0x80179e 10f4a: a0 91 9f 17 lds r26, 0x179F ; 0x80179f 10f4e: b0 91 a0 17 lds r27, 0x17A0 ; 0x8017a0 10f52: 48 17 cp r20, r24 10f54: 59 07 cpc r21, r25 10f56: 6a 07 cpc r22, r26 10f58: 7b 07 cpc r23, r27 10f5a: 08 f4 brcc .+2 ; 0x10f5e 10f5c: 23 cc rjmp .-1978 ; 0x107a4 { // 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()) 10f5e: 0e 94 13 5b call 0xb626 ; 0xb626 10f62: 89 2b or r24, r25 10f64: 09 f0 breq .+2 ; 0x10f68 10f66: 1e cc rjmp .-1988 ; 0x107a4 lastnr++; } void CardReader::closefile(bool store_location) { file.sync(); 10f68: 80 e2 ldi r24, 0x20 ; 32 10f6a: 97 e1 ldi r25, 0x17 ; 23 10f6c: 0f 94 3b 58 call 0x2b076 ; 0x2b076 file.close(); 10f70: 80 e2 ldi r24, 0x20 ; 32 10f72: 97 e1 ldi r25, 0x17 ; 23 10f74: 0f 94 70 58 call 0x2b0e0 ; 0x2b0e0 saving = false; 10f78: 10 92 8e 14 sts 0x148E, r1 ; 0x80148e logging = false; 10f7c: 10 92 8f 14 sts 0x148F, r1 ; 0x80148f { // 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 10f80: 84 ec ldi r24, 0xC4 ; 196 10f82: 94 e6 ldi r25, 0x64 ; 100 10f84: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 char time[30]; uint32_t t = print_job_timer.duration() / 60; 10f88: 0f 94 a3 3e call 0x27d46 ; 0x27d46 10f8c: 6b 01 movw r12, r22 10f8e: 7c 01 movw r14, r24 int hours, minutes; minutes = t % 60; hours = t / 60; save_statistics(); 10f90: 0e 94 1f 66 call 0xcc3e ; 0xcc3e // 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; 10f94: 8c e3 ldi r24, 0x3C ; 60 10f96: 88 2e mov r8, r24 10f98: 91 2c mov r9, r1 10f9a: a1 2c mov r10, r1 10f9c: b1 2c mov r11, r1 10f9e: c7 01 movw r24, r14 10fa0: b6 01 movw r22, r12 10fa2: a5 01 movw r20, r10 10fa4: 94 01 movw r18, r8 10fa6: 0f 94 8f dc call 0x3b91e ; 0x3b91e <__udivmodsi4> int hours, minutes; minutes = t % 60; 10faa: ca 01 movw r24, r20 10fac: b9 01 movw r22, r18 10fae: a5 01 movw r20, r10 10fb0: 94 01 movw r18, r8 10fb2: 0f 94 8f dc call 0x3b91e ; 0x3b91e <__udivmodsi4> hours = t / 60; save_statistics(); sprintf_P(time, PSTR("%i hours %i minutes"),hours, minutes); 10fb6: 7f 93 push r23 10fb8: 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; 10fba: c7 01 movw r24, r14 10fbc: b6 01 movw r22, r12 10fbe: 20 e1 ldi r18, 0x10 ; 16 10fc0: 3e e0 ldi r19, 0x0E ; 14 10fc2: 40 e0 ldi r20, 0x00 ; 0 10fc4: 50 e0 ldi r21, 0x00 ; 0 10fc6: 0f 94 8f dc call 0x3b91e ; 0x3b91e <__udivmodsi4> save_statistics(); sprintf_P(time, PSTR("%i hours %i minutes"),hours, minutes); 10fca: 3f 93 push r19 10fcc: 2f 93 push r18 10fce: 80 e7 ldi r24, 0x70 ; 112 10fd0: 97 e7 ldi r25, 0x77 ; 119 10fd2: 9f 93 push r25 10fd4: 8f 93 push r24 10fd6: 8e 01 movw r16, r28 10fd8: 0f 5f subi r16, 0xFF ; 255 10fda: 1f 4f sbci r17, 0xFF ; 255 10fdc: 1f 93 push r17 10fde: 0f 93 push r16 10fe0: 0f 94 33 db call 0x3b666 ; 0x3b666 SERIAL_ECHO_START; 10fe4: 82 ec ldi r24, 0xC2 ; 194 10fe6: 9b ea ldi r25, 0xAB ; 171 10fe8: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHOLN(time); 10fec: c8 01 movw r24, r16 10fee: 0f 94 00 d6 call 0x3ac00 ; 0x3ac00 lcd_setstatus(time); 10ff2: c8 01 movw r24, r16 10ff4: 0e 94 89 f4 call 0x1e912 ; 0x1e912 card.printingHasFinished(); 10ff8: 0f 94 83 80 call 0x30106 ; 0x30106 if(!autostart_stilltocheck) return; if(autostart_atmillis.expired(5000)) return; } autostart_stilltocheck = false; 10ffc: 10 92 69 02 sts 0x0269, r1 ; 0x800269 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.551> if(!mounted) 11000: 0f b6 in r0, 0x3f ; 63 11002: f8 94 cli 11004: de bf out 0x3e, r29 ; 62 11006: 0f be out 0x3f, r0 ; 63 11008: cd bf out 0x3d, r28 ; 61 1100a: 80 91 91 14 lds r24, 0x1491 ; 0x801491 1100e: 88 23 and r24, r24 11010: 19 f0 breq .+6 ; 0x11018 11012: 0f 94 b7 75 call 0x2eb6e ; 0x2eb6e 11016: c6 cb rjmp .-2164 ; 0x107a4 { mount(); 11018: 81 e0 ldi r24, 0x01 ; 1 1101a: 0f 94 c2 80 call 0x30184 ; 0x30184 if(!mounted) //fail 1101e: 80 91 91 14 lds r24, 0x1491 ; 0x801491 11022: 81 11 cpse r24, r1 11024: f6 cf rjmp .-20 ; 0x11012 11026: be cb rjmp .-2180 ; 0x107a4 00011028 : static void printFloat(double, uint8_t); public: static /*FORCE_INLINE*/ void write(const char *str) 11028: cf 93 push r28 1102a: df 93 push r29 1102c: ec 01 movw r28, r24 { while (*str) 1102e: 89 91 ld r24, Y+ 11030: 88 23 and r24, r24 11032: 19 f0 breq .+6 ; 0x1103a write(*str++); 11034: 0e 94 37 77 call 0xee6e ; 0xee6e 11038: fa cf rjmp .-12 ; 0x1102e } 1103a: df 91 pop r29 1103c: cf 91 pop r28 1103e: 08 95 ret 00011040 : //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) { 11040: ff 92 push r15 11042: 0f 93 push r16 11044: 1f 93 push r17 11046: cf 93 push r28 11048: df 93 push r29 1104a: ec 01 movw r28, r24 1104c: f6 2e mov r15, r22 size_t len = from_progmem ? strlen_P(cmd) : strlen(cmd); 1104e: 66 23 and r22, r22 11050: 09 f4 brne .+2 ; 0x11054 11052: 4b c0 rjmp .+150 ; 0x110ea #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); 11054: 0f 94 da d9 call 0x3b3b4 ; 0x3b3b4 <__strlen_P> 11058: 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)) { 1105a: c8 01 movw r24, r16 1105c: 0e 94 42 5c call 0xb884 ; 0xb884 11060: 88 23 and r24, r24 11062: 09 f4 brne .+2 ; 0x11066 11064: 53 c0 rjmp .+166 ; 0x1110c // 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; 11066: 80 91 a0 10 lds r24, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.550> 1106a: 90 91 a1 10 lds r25, 0x10A1 ; 0x8010a1 <_ZL7bufindw.lto_priv.550+0x1> 1106e: fc 01 movw r30, r24 11070: eb 55 subi r30, 0x5B ; 91 11072: ff 4e sbci r31, 0xEF ; 239 11074: 23 e0 ldi r18, 0x03 ; 3 11076: 20 83 st Z, r18 11078: 88 55 subi r24, 0x58 ; 88 1107a: 9f 4e sbci r25, 0xEF ; 239 if (from_progmem) strcpy_P(cmdbuffer + bufindw + CMDHDRSIZE, cmd); 1107c: 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) 1107e: ff 20 and r15, r15 11080: e9 f1 breq .+122 ; 0x110fc strcpy_P(cmdbuffer + bufindw + CMDHDRSIZE, cmd); 11082: 0f 94 d3 d9 call 0x3b3a6 ; 0x3b3a6 else strcpy(cmdbuffer + bufindw + CMDHDRSIZE, cmd); SERIAL_ECHO_START; 11086: 82 ec ldi r24, 0xC2 ; 194 11088: 9b ea ldi r25, 0xAB ; 171 1108a: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHORPGM(MSG_Enqueing); 1108e: 89 eb ldi r24, 0xB9 ; 185 11090: 94 e6 ldi r25, 0x64 ; 100 11092: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); 11096: 80 91 a0 10 lds r24, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.550> 1109a: 90 91 a1 10 lds r25, 0x10A1 ; 0x8010a1 <_ZL7bufindw.lto_priv.550+0x1> } }*/ static FORCE_INLINE void print(const char *str) { write(str); 1109e: 88 55 subi r24, 0x58 ; 88 110a0: 9f 4e sbci r25, 0xEF ; 239 110a2: 0e 94 14 88 call 0x11028 ; 0x11028 SERIAL_ECHOLNPGM("\""); 110a6: 8e e4 ldi r24, 0x4E ; 78 110a8: 97 e7 ldi r25, 0x77 ; 119 110aa: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 bufindw += len + (CMDHDRSIZE + 1); 110ae: 80 91 a0 10 lds r24, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.550> 110b2: 90 91 a1 10 lds r25, 0x10A1 ; 0x8010a1 <_ZL7bufindw.lto_priv.550+0x1> 110b6: 04 96 adiw r24, 0x04 ; 4 110b8: 08 0f add r16, r24 110ba: 19 1f adc r17, r25 if (bufindw == sizeof(cmdbuffer)) 110bc: 0d 3e cpi r16, 0xED ; 237 110be: 81 e0 ldi r24, 0x01 ; 1 110c0: 18 07 cpc r17, r24 110c2: f9 f0 breq .+62 ; 0x11102 strcpy(cmdbuffer + bufindw + CMDHDRSIZE, cmd); SERIAL_ECHO_START; SERIAL_ECHORPGM(MSG_Enqueing); SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); SERIAL_ECHOLNPGM("\""); bufindw += len + (CMDHDRSIZE + 1); 110c4: 10 93 a1 10 sts 0x10A1, r17 ; 0x8010a1 <_ZL7bufindw.lto_priv.550+0x1> 110c8: 00 93 a0 10 sts 0x10A0, r16 ; 0x8010a0 <_ZL7bufindw.lto_priv.550> if (bufindw == sizeof(cmdbuffer)) bufindw = 0; ++ buflen; 110cc: 80 91 a3 10 lds r24, 0x10A3 ; 0x8010a3 110d0: 90 91 a4 10 lds r25, 0x10A4 ; 0x8010a4 110d4: 01 96 adiw r24, 0x01 ; 1 110d6: 90 93 a4 10 sts 0x10A4, r25 ; 0x8010a4 110da: 80 93 a3 10 sts 0x10A3, r24 ; 0x8010a3 SERIAL_ECHOLNRPGM(bufferFull); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } 110de: df 91 pop r29 110e0: cf 91 pop r28 110e2: 1f 91 pop r17 110e4: 0f 91 pop r16 110e6: ff 90 pop r15 110e8: 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); 110ea: fc 01 movw r30, r24 110ec: 01 90 ld r0, Z+ 110ee: 00 20 and r0, r0 110f0: e9 f7 brne .-6 ; 0x110ec 110f2: 31 97 sbiw r30, 0x01 ; 1 110f4: 8f 01 movw r16, r30 110f6: 08 1b sub r16, r24 110f8: 19 0b sbc r17, r25 110fa: af cf rjmp .-162 ; 0x1105a // 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); 110fc: 0f 94 87 e2 call 0x3c50e ; 0x3c50e 11100: c2 cf rjmp .-124 ; 0x11086 SERIAL_ECHORPGM(MSG_Enqueing); SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); SERIAL_ECHOLNPGM("\""); bufindw += len + (CMDHDRSIZE + 1); if (bufindw == sizeof(cmdbuffer)) bufindw = 0; 11102: 10 92 a1 10 sts 0x10A1, r1 ; 0x8010a1 <_ZL7bufindw.lto_priv.550+0x1> 11106: 10 92 a0 10 sts 0x10A0, r1 ; 0x8010a0 <_ZL7bufindw.lto_priv.550> 1110a: e0 cf rjmp .-64 ; 0x110cc ++ buflen; #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; 1110c: 8a e9 ldi r24, 0x9A ; 154 1110e: 9b ea ldi r25, 0xAB ; 171 11110: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHORPGM(MSG_Enqueing); 11114: 89 eb ldi r24, 0xB9 ; 185 11116: 94 e6 ldi r25, 0x64 ; 100 11118: 0e 94 50 77 call 0xeea0 ; 0xeea0 if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); 1111c: ce 01 movw r24, r28 cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; SERIAL_ECHORPGM(MSG_Enqueing); if (from_progmem) 1111e: ff 20 and r15, r15 11120: 59 f0 breq .+22 ; 0x11138 SERIAL_PROTOCOLRPGM(cmd); 11122: 0e 94 50 77 call 0xeea0 ; 0xeea0 else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 11126: 83 e8 ldi r24, 0x83 ; 131 11128: 9b ea ldi r25, 0xAB ; 171 #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } 1112a: df 91 pop r29 1112c: cf 91 pop r28 1112e: 1f 91 pop r17 11130: 0f 91 pop r16 11132: ff 90 pop r15 SERIAL_ECHORPGM(MSG_Enqueing); if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 11134: 0c 94 7b 79 jmp 0xf2f6 ; 0xf2f6 11138: 0e 94 14 88 call 0x11028 ; 0x11028 1113c: f4 cf rjmp .-24 ; 0x11126 0001113e : { 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) { 1113e: 0f 93 push r16 11140: 1f 93 push r17 11142: cf 93 push r28 11144: df 93 push r29 11146: d6 2f mov r29, r22 11148: 8c 01 movw r16, r24 for (uint8_t i = 0; i < steps; ++i) 1114a: c0 e0 ldi r28, 0x00 ; 0 { enquecommand_P(static_cast(pgm_read_ptr(cmd_sequence + i))); 1114c: f8 01 movw r30, r16 1114e: 85 91 lpm r24, Z+ 11150: 94 91 lpm r25, Z 11152: 61 e0 ldi r22, 0x01 ; 1 11154: 0e 94 20 88 call 0x11040 ; 0x11040 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) 11158: cf 5f subi r28, 0xFF ; 255 1115a: 0e 5f subi r16, 0xFE ; 254 1115c: 1f 4f sbci r17, 0xFF ; 255 1115e: dc 13 cpse r29, r28 11160: f5 cf rjmp .-22 ; 0x1114c { enquecommand_P(static_cast(pgm_read_ptr(cmd_sequence + i))); } } 11162: df 91 pop r29 11164: cf 91 pop r28 11166: 1f 91 pop r17 11168: 0f 91 pop r16 1116a: 08 95 ret 0001116c : static const char bufferFull[] PROGMEM = "\" failed: Buffer full!"; static const char enqueingFront[] PROGMEM = "Enqueing to the front: \""; void enquecommandf_P(const char *fmt, ...) { 1116c: cf 93 push r28 1116e: df 93 push r29 11170: cd b7 in r28, 0x3d ; 61 11172: de b7 in r29, 0x3e ; 62 11174: 6e 97 sbiw r28, 0x1e ; 30 11176: 0f b6 in r0, 0x3f ; 63 11178: f8 94 cli 1117a: de bf out 0x3e, r29 ; 62 1117c: 0f be out 0x3f, r0 ; 63 1117e: cd bf out 0x3d, r28 ; 61 11180: 9e 01 movw r18, r28 11182: 2c 5d subi r18, 0xDC ; 220 11184: 3f 4f sbci r19, 0xFF ; 255 11186: f9 01 movw r30, r18 11188: 41 91 ld r20, Z+ 1118a: 51 91 ld r21, Z+ 1118c: 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); 1118e: 6e e1 ldi r22, 0x1E ; 30 11190: 70 e0 ldi r23, 0x00 ; 0 11192: ce 01 movw r24, r28 11194: 01 96 adiw r24, 0x01 ; 1 11196: 0f 94 72 db call 0x3b6e4 ; 0x3b6e4 va_end(ap); enquecommand(cmd_buffer, false); 1119a: 60 e0 ldi r22, 0x00 ; 0 1119c: ce 01 movw r24, r28 1119e: 01 96 adiw r24, 0x01 ; 1 111a0: 0e 94 20 88 call 0x11040 ; 0x11040 } 111a4: 6e 96 adiw 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: df 91 pop r29 111b2: cf 91 pop r28 111b4: 08 95 ret 000111b6 : } } /// @brief Read saved filename from EEPROM and send g-code command: M23 void restore_file_from_sd() { 111b6: ef 92 push r14 111b8: ff 92 push r15 111ba: 0f 93 push r16 111bc: 1f 93 push r17 111be: cf 93 push r28 111c0: df 93 push r29 111c2: cd b7 in r28, 0x3d ; 61 111c4: de b7 in r29, 0x3e ; 62 111c6: 6b 97 sbiw r28, 0x1b ; 27 111c8: 0f b6 in r0, 0x3f ; 63 111ca: f8 94 cli 111cc: de bf out 0x3e, r29 ; 62 111ce: 0f be out 0x3f, r0 ; 63 111d0: 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); 111d2: 8a e5 ldi r24, 0x5A ; 90 111d4: 9f e0 ldi r25, 0x0F ; 15 111d6: 0f 94 1c dc call 0x3b838 ; 0x3b838 111da: e8 2e mov r14, r24 111dc: 0a e0 ldi r16, 0x0A ; 10 111de: 1f e0 ldi r17, 0x0F ; 15 for (uint8_t i = 0; i < depth; i++) { 111e0: 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); 111e2: 48 e0 ldi r20, 0x08 ; 8 111e4: 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++) { 111e6: fe 14 cp r15, r14 111e8: 79 f0 breq .+30 ; 0x11208 eeprom_read_block(dir_name, (const char *)EEPROM_DIRS + 8 * i, 8); 111ea: b8 01 movw r22, r16 111ec: ce 01 movw r24, r28 111ee: 0e 96 adiw r24, 0x0e ; 14 111f0: 0f 94 0c dc call 0x3b818 ; 0x3b818 dir_name[8] = '\0'; 111f4: 1e 8a std Y+22, r1 ; 0x16 card.chdir(dir_name, false); 111f6: 60 e0 ldi r22, 0x00 ; 0 111f8: ce 01 movw r24, r28 111fa: 0e 96 adiw r24, 0x0e ; 14 111fc: 0f 94 14 7e call 0x2fc28 ; 0x2fc28 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++) { 11200: f3 94 inc r15 11202: 08 5f subi r16, 0xF8 ; 248 11204: 1f 4f sbci r17, 0xFF ; 255 11206: ed cf rjmp .-38 ; 0x111e2 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); 11208: 65 e9 ldi r22, 0x95 ; 149 1120a: 7f e0 ldi r23, 0x0F ; 15 1120c: 8e 01 movw r16, r28 1120e: 0f 5f subi r16, 0xFF ; 255 11210: 1f 4f sbci r17, 0xFF ; 255 11212: c8 01 movw r24, r16 11214: 0f 94 0c dc call 0x3b818 ; 0x3b818 // Add null delimiter in case all 8 characters were not NULL filename[8] = '\0'; 11218: 19 86 std Y+9, r1 ; 0x09 // Add extension to complete the DOS 8.3 filename e.g. ".gco" or ".g" extension_ptr[0] = '.'; 1121a: 8e e2 ldi r24, 0x2E ; 46 1121c: 8f 8b std Y+23, r24 ; 0x17 eeprom_read_block(&extension_ptr[1], (const char *)EEPROM_FILENAME_EXTENSION, 3); 1121e: 43 e0 ldi r20, 0x03 ; 3 11220: 50 e0 ldi r21, 0x00 ; 0 11222: 61 e9 ldi r22, 0x91 ; 145 11224: 7c e0 ldi r23, 0x0C ; 12 11226: ce 01 movw r24, r28 11228: 48 96 adiw r24, 0x18 ; 24 1122a: 0f 94 0c dc call 0x3b818 ; 0x3b818 extension_ptr[4] = '\0'; 1122e: 1b 8e std Y+27, r1 ; 0x1b strcat(filename, extension_ptr); 11230: be 01 movw r22, r28 11232: 69 5e subi r22, 0xE9 ; 233 11234: 7f 4f sbci r23, 0xFF ; 255 11236: c8 01 movw r24, r16 11238: 0f 94 68 e2 call 0x3c4d0 ; 0x3c4d0 enquecommandf_P(MSG_M23, filename); 1123c: 1f 93 push r17 1123e: 0f 93 push r16 11240: 84 ef ldi r24, 0xF4 ; 244 11242: 90 e7 ldi r25, 0x70 ; 112 11244: 9f 93 push r25 11246: 8f 93 push r24 11248: 0e 94 b6 88 call 0x1116c ; 0x1116c 1124c: 0f 90 pop r0 1124e: 0f 90 pop r0 11250: 0f 90 pop r0 11252: 0f 90 pop r0 } 11254: 6b 96 adiw r28, 0x1b ; 27 11256: 0f b6 in r0, 0x3f ; 63 11258: f8 94 cli 1125a: de bf out 0x3e, r29 ; 62 1125c: 0f be out 0x3f, r0 ; 63 1125e: cd bf out 0x3d, r28 ; 61 11260: df 91 pop r29 11262: cf 91 pop r28 11264: 1f 91 pop r17 11266: 0f 91 pop r16 11268: ff 90 pop r15 1126a: ef 90 pop r14 1126c: 08 95 ret 0001126e : //! 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) { 1126e: bf 92 push r11 11270: cf 92 push r12 11272: df 92 push r13 11274: ef 92 push r14 11276: ff 92 push r15 11278: 0f 93 push r16 1127a: 1f 93 push r17 1127c: cf 93 push r28 1127e: df 93 push r29 if (saved_printing) return; 11280: e0 91 a9 0d lds r30, 0x0DA9 ; 0x800da9 11284: e1 11 cpse r30, r1 11286: b1 c0 rjmp .+354 ; 0x113ea 11288: 05 2f mov r16, r21 1128a: 14 2f mov r17, r20 1128c: e9 01 movw r28, r18 1128e: 6b 01 movw r12, r22 11290: 7c 01 movw r14, r24 cli(); 11292: f8 94 cli save_print_file_state(); 11294: 0e 94 3a 65 call 0xca74 ; 0xca74 // save the global state at planning time const bool pos_invalid = mesh_bed_leveling_flag || homing_flag; 11298: b0 90 a8 0d lds r11, 0x0DA8 ; 0x800da8 1129c: b1 10 cpse r11, r1 1129e: 02 c0 rjmp .+4 ; 0x112a4 112a0: b0 90 a7 0d lds r11, 0x0DA7 ; 0x800da7 save_planner_global_state(); 112a4: 0e 94 f0 64 call 0xc9e0 ; 0xc9e0 planner_abort_hard(); //abort printing 112a8: 0f 94 c3 c1 call 0x38386 ; 0x38386 memcpy(saved_pos, current_position, sizeof(saved_pos)); 112ac: 80 e1 ldi r24, 0x10 ; 16 112ae: e2 e9 ldi r30, 0x92 ; 146 112b0: f6 e0 ldi r31, 0x06 ; 6 112b2: a3 e7 ldi r26, 0x73 ; 115 112b4: b2 e0 ldi r27, 0x02 ; 2 112b6: 01 90 ld r0, Z+ 112b8: 0d 92 st X+, r0 112ba: 8a 95 dec r24 112bc: e1 f7 brne .-8 ; 0x112b6 if (pos_invalid) saved_pos[X_AXIS] = X_COORD_INVALID; 112be: bb 20 and r11, r11 112c0: 61 f0 breq .+24 ; 0x112da 112c2: 80 e0 ldi r24, 0x00 ; 0 112c4: 90 e0 ldi r25, 0x00 ; 0 112c6: a0 e8 ldi r26, 0x80 ; 128 112c8: bf eb ldi r27, 0xBF ; 191 112ca: 80 93 73 02 sts 0x0273, r24 ; 0x800273 112ce: 90 93 74 02 sts 0x0274, r25 ; 0x800274 112d2: a0 93 75 02 sts 0x0275, r26 ; 0x800275 112d6: b0 93 76 02 sts 0x0276, r27 ; 0x800276 saved_feedmultiply2 = feedmultiply; //save feedmultiply 112da: 80 91 39 02 lds r24, 0x0239 ; 0x800239 112de: 90 91 3a 02 lds r25, 0x023A ; 0x80023a 112e2: 90 93 72 03 sts 0x0372, r25 ; 0x800372 112e6: 80 93 71 03 sts 0x0371, r24 ; 0x800371 saved_extruder_temperature = (uint16_t)degTargetHotend(active_extruder); 112ea: 80 91 b6 0d lds r24, 0x0DB6 ; 0x800db6 112ee: 90 91 b7 0d lds r25, 0x0DB7 ; 0x800db7 112f2: 90 93 ad 05 sts 0x05AD, r25 ; 0x8005ad 112f6: 80 93 ac 05 sts 0x05AC, r24 ; 0x8005ac saved_bed_temperature = (uint8_t)degTargetBed(); 112fa: 80 91 72 06 lds r24, 0x0672 ; 0x800672 112fe: 80 93 ae 05 sts 0x05AE, r24 ; 0x8005ae saved_extruder_relative_mode = axis_relative_modes & E_AXIS_MASK; 11302: 80 91 e5 03 lds r24, 0x03E5 ; 0x8003e5 11306: 83 fb bst r24, 3 11308: 88 27 eor r24, r24 1130a: 80 f9 bld r24, 0 1130c: 80 93 64 05 sts 0x0564, r24 ; 0x800564 saved_fan_speed = fanSpeed; 11310: 80 91 e7 03 lds r24, 0x03E7 ; 0x8003e7 11314: 80 93 ab 05 sts 0x05AB, r24 ; 0x8005ab cmdqueue_reset(); //empty cmdqueue 11318: 0e 94 44 7f call 0xfe88 ; 0xfe88 card.sdprinting = false; 1131c: 10 92 90 14 sts 0x1490, r1 ; 0x801490 // card.closefile(); saved_printing = true; 11320: 81 e0 ldi r24, 0x01 ; 1 11322: 80 93 a9 0d sts 0x0DA9, r24 ; 0x800da9 // We may have missed a stepper timer interrupt. Be safe than sorry, reset the stepper timer before re-enabling interrupts. st_reset_timer(); 11326: 0f 94 42 43 call 0x28684 ; 0x28684 sei(); 1132a: 78 94 sei if ((z_move != 0) || (e_move != 0)) { // extruder or z move 1132c: 20 e0 ldi r18, 0x00 ; 0 1132e: 30 e0 ldi r19, 0x00 ; 0 11330: a9 01 movw r20, r18 11332: c7 01 movw r24, r14 11334: b6 01 movw r22, r12 11336: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__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) 1133a: 20 e0 ldi r18, 0x00 ; 0 1133c: 30 e0 ldi r19, 0x00 ; 0 1133e: a9 01 movw r20, r18 11340: f8 01 movw r30, r16 11342: 6c 2f mov r22, r28 11344: 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 11346: 81 11 cpse r24, r1 11348: 5a c0 rjmp .+180 ; 0x113fe 1134a: 8f 2f mov r24, r31 1134c: 90 2f mov r25, r16 1134e: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 11352: 88 23 and r24, r24 11354: 09 f4 brne .+2 ; 0x11358 11356: 49 c0 rjmp .+146 ; 0x113ea // move away from the print. if(e_move) { // First unretract (relative extrusion) if(!saved_extruder_relative_mode){ 11358: 80 91 64 05 lds r24, 0x0564 ; 0x800564 1135c: 81 11 cpse r24, r1 1135e: 05 c0 rjmp .+10 ; 0x1136a enquecommand_P(MSG_M83); 11360: 61 e0 ldi r22, 0x01 ; 1 11362: 80 ee ldi r24, 0xE0 ; 224 11364: 9b e6 ldi r25, 0x6B ; 107 11366: 0e 94 20 88 call 0x11040 ; 0x11040 // 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); 1136a: 0f 93 push r16 1136c: 1f 93 push r17 1136e: df 93 push r29 11370: cf 93 push r28 11372: 8a e5 ldi r24, 0x5A ; 90 11374: 9e e6 ldi r25, 0x6E ; 110 11376: 9f 93 push r25 11378: 8f 93 push r24 1137a: 0e 94 b6 88 call 0x1116c ; 0x1116c } if(z_move) 1137e: 0f 90 pop r0 11380: 0f 90 pop r0 11382: 0f 90 pop r0 11384: 0f 90 pop r0 11386: 0f 90 pop r0 11388: 0f 90 pop r0 1138a: 20 e0 ldi r18, 0x00 ; 0 1138c: 30 e0 ldi r19, 0x00 ; 0 1138e: a9 01 movw r20, r18 11390: c7 01 movw r24, r14 11392: b6 01 movw r22, r12 11394: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 11398: 88 23 and r24, r24 1139a: 21 f1 breq .+72 ; 0x113e4 { // Then lift Z axis enquecommandf_P(PSTR("G1 Z%-.3f F%-.3f"), saved_pos[Z_AXIS] + z_move, homing_feedrate[Z_AXIS]); 1139c: 84 e4 ldi r24, 0x44 ; 68 1139e: 8f 93 push r24 113a0: 88 e4 ldi r24, 0x48 ; 72 113a2: 8f 93 push r24 113a4: 1f 92 push r1 113a6: 1f 92 push r1 113a8: 20 91 7b 02 lds r18, 0x027B ; 0x80027b 113ac: 30 91 7c 02 lds r19, 0x027C ; 0x80027c 113b0: 40 91 7d 02 lds r20, 0x027D ; 0x80027d 113b4: 50 91 7e 02 lds r21, 0x027E ; 0x80027e 113b8: c7 01 movw r24, r14 113ba: b6 01 movw r22, r12 113bc: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 113c0: 9f 93 push r25 113c2: 8f 93 push r24 113c4: 7f 93 push r23 113c6: 6f 93 push r22 113c8: 8c e2 ldi r24, 0x2C ; 44 113ca: 9e e7 ldi r25, 0x7E ; 126 113cc: 9f 93 push r25 113ce: 8f 93 push r24 113d0: 0e 94 b6 88 call 0x1116c ; 0x1116c 113d4: 8d b7 in r24, 0x3d ; 61 113d6: 9e b7 in r25, 0x3e ; 62 113d8: 0a 96 adiw r24, 0x0a ; 10 113da: 0f b6 in r0, 0x3f ; 63 113dc: f8 94 cli 113de: 9e bf out 0x3e, r25 ; 62 113e0: 0f be out 0x3f, r0 ; 63 113e2: 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; 113e4: 81 e0 ldi r24, 0x01 ; 1 113e6: 80 93 a2 10 sts 0x10A2, r24 ; 0x8010a2 // 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(); } } 113ea: df 91 pop r29 113ec: cf 91 pop r28 113ee: 1f 91 pop r17 113f0: 0f 91 pop r16 113f2: ff 90 pop r15 113f4: ef 90 pop r14 113f6: df 90 pop r13 113f8: cf 90 pop r12 113fa: bf 90 pop r11 113fc: 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) 113fe: 8f 2f mov r24, r31 11400: 90 2f mov r25, r16 11402: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 11406: 88 23 and r24, r24 11408: 49 f2 breq .-110 ; 0x1139c 1140a: a6 cf rjmp .-180 ; 0x11358 0001140c : eeprom_update_word_notify((uint16_t *)EEPROM_BACKLIGHT_TIMEOUT, backlightTimer_period); } void backlight_update() { if (!backlightSupport) return; 1140c: 80 91 02 04 lds r24, 0x0402 ; 0x800402 11410: 88 23 and r24, r24 11412: 21 f1 breq .+72 ; 0x1145c if (backlightMode == BACKLIGHT_MODE_AUTO) 11414: 80 91 4f 02 lds r24, 0x024F ; 0x80024f 11418: 82 30 cpi r24, 0x02 ; 2 1141a: e9 f4 brne .+58 ; 0x11456 { if (backlightTimer.expired((uint32_t)backlightTimer_period * 1000ul)) analogWrite(LCD_BL_PIN, backlightLevel_LOW); 1141c: a0 91 4d 02 lds r26, 0x024D ; 0x80024d 11420: b0 91 4e 02 lds r27, 0x024E ; 0x80024e 11424: 28 ee ldi r18, 0xE8 ; 232 11426: 33 e0 ldi r19, 0x03 ; 3 11428: 0f 94 3c dd call 0x3ba78 ; 0x3ba78 <__usmulhisi3> 1142c: ab 01 movw r20, r22 1142e: bc 01 movw r22, r24 11430: 87 e3 ldi r24, 0x37 ; 55 11432: 93 e0 ldi r25, 0x03 ; 3 11434: 0f 94 30 2a call 0x25460 ; 0x25460 ::expired(unsigned long)> 11438: 88 23 and r24, r24 1143a: 31 f0 breq .+12 ; 0x11448 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); 1143c: 60 91 00 04 lds r22, 0x0400 ; 0x800400 else analogWrite(LCD_BL_PIN, backlightLevel_HIGH); 11440: 70 e0 ldi r23, 0x00 ; 0 11442: 85 e0 ldi r24, 0x05 ; 5 11444: 0c 94 16 e9 jmp 0x1d22c ; 0x1d22c 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); 11448: 80 91 37 03 lds r24, 0x0337 ; 0x800337 1144c: 88 23 and r24, r24 1144e: 31 f0 breq .+12 ; 0x1145c 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); 11450: 60 91 01 04 lds r22, 0x0401 ; 0x800401 11454: f5 cf rjmp .-22 ; 0x11440 { 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); 11456: 81 11 cpse r24, r1 11458: fb cf rjmp .-10 ; 0x11450 1145a: f0 cf rjmp .-32 ; 0x1143c else analogWrite(LCD_BL_PIN, backlightLevel_HIGH); } 1145c: 08 95 ret 0001145e : 1145e: 60 91 01 04 lds r22, 0x0401 ; 0x800401 11462: 84 e3 ldi r24, 0x34 ; 52 11464: 9d e0 ldi r25, 0x0D ; 13 11466: 0f 94 40 dc call 0x3b880 ; 0x3b880 1146a: 60 91 00 04 lds r22, 0x0400 ; 0x800400 1146e: 83 e3 ldi r24, 0x33 ; 51 11470: 9d e0 ldi r25, 0x0D ; 13 11472: 0f 94 40 dc call 0x3b880 ; 0x3b880 11476: 60 91 4f 02 lds r22, 0x024F ; 0x80024f 1147a: 82 e3 ldi r24, 0x32 ; 50 1147c: 9d e0 ldi r25, 0x0D ; 13 1147e: 0f 94 40 dc call 0x3b880 ; 0x3b880 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 11482: 60 91 4d 02 lds r22, 0x024D ; 0x80024d 11486: 70 91 4e 02 lds r23, 0x024E ; 0x80024e 1148a: 80 e3 ldi r24, 0x30 ; 48 1148c: 9d e0 ldi r25, 0x0D ; 13 1148e: 0d 94 5e dc jmp 0x3b8bc ; 0x3b8bc 00011492 : backlight_update(); } void force_bl_on(bool section_start) { if (section_start) 11492: 88 23 and r24, r24 11494: 61 f0 breq .+24 ; 0x114ae { backlightMode = BACKLIGHT_MODE_BRIGHT; 11496: 81 e0 ldi r24, 0x01 ; 1 11498: 80 93 4f 02 sts 0x024F, r24 ; 0x80024f if (backlightLevel_HIGH < 30) backlightLevel_HIGH = 30; 1149c: 80 91 01 04 lds r24, 0x0401 ; 0x800401 114a0: 8e 31 cpi r24, 0x1E ; 30 114a2: 18 f4 brcc .+6 ; 0x114aa 114a4: 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); 114a6: 80 93 01 04 sts 0x0401, r24 ; 0x800401 } backlight_update(); 114aa: 0c 94 06 8a jmp 0x1140c ; 0x1140c backlightMode = BACKLIGHT_MODE_BRIGHT; if (backlightLevel_HIGH < 30) backlightLevel_HIGH = 30; } else { backlightMode = eeprom_read_byte((uint8_t *)EEPROM_BACKLIGHT_MODE); 114ae: 82 e3 ldi r24, 0x32 ; 50 114b0: 9d e0 ldi r25, 0x0D ; 13 114b2: 0f 94 1c dc call 0x3b838 ; 0x3b838 114b6: 80 93 4f 02 sts 0x024F, r24 ; 0x80024f backlightLevel_HIGH = eeprom_read_byte((uint8_t *)EEPROM_BACKLIGHT_LEVEL_HIGH); 114ba: 84 e3 ldi r24, 0x34 ; 52 114bc: 9d e0 ldi r25, 0x0D ; 13 114be: 0f 94 1c dc call 0x3b838 ; 0x3b838 114c2: f1 cf rjmp .-30 ; 0x114a6 000114c4 : 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; 114c4: 80 91 02 04 lds r24, 0x0402 ; 0x800402 114c8: 88 23 and r24, r24 114ca: 31 f0 breq .+12 ; 0x114d8 backlightTimer.start(); 114cc: 87 e3 ldi r24, 0x37 ; 55 114ce: 93 e0 ldi r25, 0x03 ; 3 114d0: 0f 94 ef 2b call 0x257de ; 0x257de ::start()> backlight_update(); 114d4: 0c 94 06 8a jmp 0x1140c ; 0x1140c } 114d8: 08 95 ret 000114da : } backlight_update(); } void backlight_wake(const uint8_t flashNo) { 114da: ff 92 push r15 114dc: 0f 93 push r16 114de: 1f 93 push r17 114e0: cf 93 push r28 114e2: df 93 push r29 if (!backlightSupport) return; 114e4: 90 91 02 04 lds r25, 0x0402 ; 0x800402 114e8: 99 23 and r25, r25 114ea: 99 f1 breq .+102 ; 0x11552 if (flashNo) 114ec: 88 23 and r24, r24 114ee: 51 f1 breq .+84 ; 0x11544 { uint8_t backlightMode_bck = backlightMode; 114f0: 00 91 4f 02 lds r16, 0x024F ; 0x80024f for (uint8_t i = 0; i < (((backlightMode_bck == BACKLIGHT_MODE_AUTO) && !backlightTimer.running()) + (flashNo * 2)); i++) 114f4: c8 2f mov r28, r24 114f6: d0 e0 ldi r29, 0x00 ; 0 114f8: cc 0f add r28, r28 114fa: dd 1f adc r29, r29 114fc: 10 e0 ldi r17, 0x00 ; 0 114fe: ff 24 eor r15, r15 11500: f3 94 inc r15 11502: 21 2f mov r18, r17 11504: 30 e0 ldi r19, 0x00 ; 0 11506: 80 91 37 03 lds r24, 0x0337 ; 0x800337 1150a: 8f 25 eor r24, r15 1150c: 02 30 cpi r16, 0x02 ; 2 1150e: 09 f0 breq .+2 ; 0x11512 11510: 80 e0 ldi r24, 0x00 ; 0 11512: 8c 0f add r24, r28 11514: 9d 2f mov r25, r29 11516: 91 1d adc r25, r1 11518: 28 17 cp r18, r24 1151a: 39 07 cpc r19, r25 1151c: 8c f4 brge .+34 ; 0x11540 { backlightMode = !backlightMode; //toggles between BACKLIGHT_MODE_BRIGHT and BACKLIGHT_MODE_DIM 1151e: 81 e0 ldi r24, 0x01 ; 1 11520: 90 91 4f 02 lds r25, 0x024F ; 0x80024f 11524: 91 11 cpse r25, r1 11526: 80 e0 ldi r24, 0x00 ; 0 11528: 80 93 4f 02 sts 0x024F, r24 ; 0x80024f backlight_update(); 1152c: 0e 94 06 8a call 0x1140c ; 0x1140c _delay(BL_FLASH_DELAY_MS); 11530: 69 e1 ldi r22, 0x19 ; 25 11532: 70 e0 ldi r23, 0x00 ; 0 11534: 80 e0 ldi r24, 0x00 ; 0 11536: 90 e0 ldi r25, 0x00 ; 0 11538: 0f 94 53 27 call 0x24ea6 ; 0x24ea6 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++) 1153c: 1f 5f subi r17, 0xFF ; 255 1153e: e1 cf rjmp .-62 ; 0x11502 { backlightMode = !backlightMode; //toggles between BACKLIGHT_MODE_BRIGHT and BACKLIGHT_MODE_DIM backlight_update(); _delay(BL_FLASH_DELAY_MS); } backlightMode = backlightMode_bck; 11540: 00 93 4f 02 sts 0x024F, r16 ; 0x80024f } backlightTimer_reset(); } 11544: df 91 pop r29 11546: cf 91 pop r28 11548: 1f 91 pop r17 1154a: 0f 91 pop r16 1154c: ff 90 pop r15 backlight_update(); _delay(BL_FLASH_DELAY_MS); } backlightMode = backlightMode_bck; } backlightTimer_reset(); 1154e: 0c 94 62 8a jmp 0x114c4 ; 0x114c4 } 11552: df 91 pop r29 11554: cf 91 pop r28 11556: 1f 91 pop r17 11558: 0f 91 pop r16 1155a: ff 90 pop r15 1155c: 08 95 ret 0001155e : } } #endif //SAFETYTIMER void manage_inactivity(bool ignore_stepper_queue/*=false*/) //default argument set in Marlin.h { 1155e: 0f 93 push r16 11560: 1f 93 push r17 11562: cf 93 push r28 11564: df 93 push r29 11566: c8 2f mov r28, r24 state = State::disabled; filter = 0; } bool PAT9125_sensor::update() { switch (state) { 11568: 80 91 aa 17 lds r24, 0x17AA ; 0x8017aa 1156c: 81 30 cpi r24, 0x01 ; 1 1156e: 09 f4 brne .+2 ; 0x11572 11570: 41 c0 rjmp .+130 ; 0x115f4 11572: 82 30 cpi r24, 0x02 ; 2 11574: 09 f4 brne .+2 ; 0x11578 11576: 57 c0 rjmp .+174 ; 0x11626 * * 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) 11578: 0e 94 e1 67 call 0xcfc2 ; 0xcfc2 1157c: 81 11 cpse r24, r1 1157e: f9 c0 rjmp .+498 ; 0x11772 11580: 80 91 b6 0d lds r24, 0x0DB6 ; 0x800db6 11584: 90 91 b7 0d lds r25, 0x0DB7 ; 0x800db7 11588: 00 97 sbiw r24, 0x00 ; 0 1158a: 39 f4 brne .+14 ; 0x1159a 1158c: 20 91 72 06 lds r18, 0x0672 ; 0x800672 11590: 30 91 73 06 lds r19, 0x0673 ; 0x800673 11594: 23 2b or r18, r19 11596: 09 f4 brne .+2 ; 0x1159a 11598: ec c0 rjmp .+472 ; 0x11772 1159a: 40 91 30 02 lds r20, 0x0230 ; 0x800230 1159e: 50 91 31 02 lds r21, 0x0231 ; 0x800231 115a2: 60 91 32 02 lds r22, 0x0232 ; 0x800232 115a6: 70 91 33 02 lds r23, 0x0233 ; 0x800233 115aa: 41 15 cp r20, r1 115ac: 51 05 cpc r21, r1 115ae: 61 05 cpc r22, r1 115b0: 71 05 cpc r23, r1 115b2: 09 f4 brne .+2 ; 0x115b6 115b4: de c0 rjmp .+444 ; 0x11772 { safetyTimer.stop(); } else if ((CHECK_ALL_HEATERS) && !safetyTimer.running()) 115b6: 89 2b or r24, r25 115b8: 31 f4 brne .+12 ; 0x115c6 115ba: 80 91 72 06 lds r24, 0x0672 ; 0x800672 115be: 90 91 73 06 lds r25, 0x0673 ; 0x800673 115c2: 89 2b or r24, r25 115c4: 29 f0 breq .+10 ; 0x115d0 115c6: 80 91 da 05 lds r24, 0x05DA ; 0x8005da 115ca: 88 23 and r24, r24 115cc: 09 f4 brne .+2 ; 0x115d0 115ce: 39 c1 rjmp .+626 ; 0x11842 { safetyTimer.start(); } else if (safetyTimer.expired(farm_mode?FARM_DEFAULT_SAFETYTIMER_TIME_ms:safetytimer_inactive_time)) 115d0: 8a ed ldi r24, 0xDA ; 218 115d2: 95 e0 ldi r25, 0x05 ; 5 115d4: 0f 94 30 2a call 0x25460 ; 0x25460 ::expired(unsigned long)> 115d8: 88 23 and r24, r24 115da: 09 f4 brne .+2 ; 0x115de 115dc: cc c0 rjmp .+408 ; 0x11776 { disable_heater(); 115de: 0f 94 18 2f call 0x25e30 ; 0x25e30 lcd_show_fullscreen_message_and_wait_P(_T(MSG_BED_HEATING_SAFETY_DISABLED)); 115e2: 82 e7 ldi r24, 0x72 ; 114 115e4: 96 e3 ldi r25, 0x36 ; 54 115e6: 0e 94 ac 72 call 0xe558 ; 0xe558 115ea: 0f 94 f1 1f call 0x23fe2 ; 0x23fe2 lcd_return_to_status(); 115ee: 0f 94 a6 1e call 0x23d4c ; 0x23d4c 115f2: c1 c0 rjmp .+386 ; 0x11776 case State::initializing: if (!updatePAT9125()) { 115f4: 0f 94 e8 7b call 0x2f7d0 ; 0x2f7d0 115f8: 88 23 and r24, r24 115fa: 09 f4 brne .+2 ; 0x115fe 115fc: bd cf rjmp .-134 ; 0x11578 class PAT9125_sensor: public Filament_sensor { public: void init(); void deinit(); bool update(); bool getFilamentPresent() const { return filterFilPresent; } 115fe: 81 e0 ldi r24, 0x01 ; 1 11600: 90 91 b7 17 lds r25, 0x17B7 ; 0x8017b7 11604: 91 11 cpse r25, r1 11606: 01 c0 rjmp .+2 ; 0x1160a 11608: 80 e0 ldi r24, 0x00 ; 0 break; // still not stable. Stay in the initialization state. } oldFilamentPresent = 1160a: 80 93 ad 17 sts 0x17AD, r24 ; 0x8017ad getFilamentPresent(); // initialize the current filament state so that we don't create a switching event right after the sensor is ready. oldPos = pat9125_y; 1160e: 80 91 8f 0e lds r24, 0x0E8F ; 0x800e8f 11612: 90 91 90 0e lds r25, 0x0E90 ; 0x800e90 11616: 90 93 ba 17 sts 0x17BA, r25 ; 0x8017ba 1161a: 80 93 b9 17 sts 0x17B9, r24 ; 0x8017b9 state = State::ready; 1161e: 82 e0 ldi r24, 0x02 ; 2 11620: 80 93 aa 17 sts 0x17AA, r24 ; 0x8017aa 11624: a9 cf rjmp .-174 ; 0x11578 break; case State::ready: { updatePAT9125(); 11626: 0f 94 e8 7b call 0x2f7d0 ; 0x2f7d0 postponedLoadEvent = false; 1162a: 10 92 ae 17 sts 0x17AE, r1 ; 0x8017ae sensorActionOnError = SensorActionOnError::_Continue; } } bool Filament_sensor::checkFilamentEvents() { if (state != State::ready) 1162e: 80 91 aa 17 lds r24, 0x17AA ; 0x8017aa 11632: 82 30 cpi r24, 0x02 ; 2 11634: 09 f0 breq .+2 ; 0x11638 11636: a0 cf rjmp .-192 ; 0x11578 return false; if (eventBlankingTimer.running() && !eventBlankingTimer.expired(100)) { // event blanking for 100ms 11638: 80 91 af 17 lds r24, 0x17AF ; 0x8017af 1163c: 81 11 cpse r24, r1 1163e: 40 c0 rjmp .+128 ; 0x116c0 11640: d0 91 b7 17 lds r29, 0x17B7 ; 0x8017b7 11644: 81 e0 ldi r24, 0x01 ; 1 11646: d1 11 cpse r29, r1 11648: 01 c0 rjmp .+2 ; 0x1164c 1164a: 80 e0 ldi r24, 0x00 ; 0 return false; } bool newFilamentPresent = fsensor.getFilamentPresent(); if (oldFilamentPresent != newFilamentPresent) { 1164c: 90 91 ad 17 lds r25, 0x17AD ; 0x8017ad 11650: 89 17 cp r24, r25 11652: 09 f4 brne .+2 ; 0x11656 11654: 91 cf rjmp .-222 ; 0x11578 oldFilamentPresent = newFilamentPresent; 11656: 80 93 ad 17 sts 0x17AD, r24 ; 0x8017ad eventBlankingTimer.start(); 1165a: 8f ea ldi r24, 0xAF ; 175 1165c: 97 e1 ldi r25, 0x17 ; 23 1165e: 0f 94 ad 29 call 0x2535a ; 0x2535a ::start()> if (newFilamentPresent) { // filament insertion 11662: dd 23 and r29, r29 11664: b1 f1 breq .+108 ; 0x116d2 } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) && !( 11666: 80 91 ab 17 lds r24, 0x17AB ; 0x8017ab 1166a: 88 23 and r24, r24 1166c: 11 f1 breq .+68 ; 0x116b2 return false; } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) 1166e: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 11672: 81 11 cpse r24, r1 11674: 1e c0 rjmp .+60 ; 0x116b2 && !( 11676: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 1167a: 81 30 cpi r24, 0x01 ; 1 1167c: d1 f0 breq .+52 ; 0x116b2 } //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); 1167e: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 11682: 90 91 a6 0d lds r25, 0x0DA6 ; 0x800da6 11686: 89 1b sub r24, r25 11688: 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 1168a: 99 f4 brne .+38 ; 0x116b2 || printJobOngoing() 1168c: 0e 94 90 67 call 0xcf20 ; 0xcf20 11690: 81 11 cpse r24, r1 11692: 0f c0 rjmp .+30 ; 0x116b2 || (lcd_commands_type == LcdCommands::Layer1Cal) 11694: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 11698: 84 30 cpi r24, 0x04 ; 4 1169a: 59 f0 breq .+22 ; 0x116b2 || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) 1169c: 8f e5 ldi r24, 0x5F ; 95 1169e: 9f e0 ldi r25, 0x0F ; 15 116a0: 0f 94 1c dc call 0x3b838 ; 0x3b838 } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) && !( 116a4: 81 11 cpse r24, r1 116a6: 05 c0 rjmp .+10 ; 0x116b2 || printJobOngoing() || (lcd_commands_type == LcdCommands::Layer1Cal) || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) ) ) { menu_submenu(lcd_AutoLoadFilament, true); 116a8: 61 e0 ldi r22, 0x01 ; 1 116aa: 8e ea ldi r24, 0xAE ; 174 116ac: 9a e3 ldi r25, 0x3A ; 58 116ae: 0f 94 03 d3 call 0x3a606 ; 0x3a606 oldFilamentPresent = newFilamentPresent; eventBlankingTimer.start(); if (newFilamentPresent) { // filament insertion // puts_P(PSTR("filament inserted")); triggerFilamentInserted(); postponedLoadEvent = true; 116b2: 81 e0 ldi r24, 0x01 ; 1 116b4: 80 93 ae 17 sts 0x17AE, r24 ; 0x8017ae 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. 116b8: 81 e0 ldi r24, 0x01 ; 1 116ba: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d 116be: 5c cf rjmp .-328 ; 0x11578 } bool Filament_sensor::checkFilamentEvents() { if (state != State::ready) return false; if (eventBlankingTimer.running() && !eventBlankingTimer.expired(100)) { // event blanking for 100ms 116c0: 64 e6 ldi r22, 0x64 ; 100 116c2: 70 e0 ldi r23, 0x00 ; 0 116c4: 8f ea ldi r24, 0xAF ; 175 116c6: 97 e1 ldi r25, 0x17 ; 23 116c8: 0f 94 7e 29 call 0x252fc ; 0x252fc ::expired(unsigned short)> 116cc: 81 11 cpse r24, r1 116ce: b8 cf rjmp .-144 ; 0x11640 116d0: 53 cf rjmp .-346 ; 0x11578 && (eFilamentAction == FilamentAction::None) && ( moves_planned() != 0 || printJobOngoing() ) && !( 116d2: 80 91 ac 17 lds r24, 0x17AC ; 0x8017ac 116d6: 88 23 and r24, r24 116d8: 79 f3 breq .-34 ; 0x116b8 } void Filament_sensor::triggerFilamentRemoved() { // SERIAL_ECHOLNPGM("triggerFilamentRemoved"); if (runoutEnabled && (eFilamentAction == FilamentAction::None) 116da: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 116de: 81 11 cpse r24, r1 116e0: eb cf rjmp .-42 ; 0x116b8 116e2: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 116e6: 90 91 a6 0d lds r25, 0x0DA6 ; 0x800da6 116ea: 89 1b sub r24, r25 116ec: 8f 70 andi r24, 0x0F ; 15 && ( 116ee: 21 f4 brne .+8 ; 0x116f8 moves_planned() != 0 || printJobOngoing() 116f0: 0e 94 90 67 call 0xcf20 ; 0xcf20 116f4: 88 23 and r24, r24 116f6: 01 f3 breq .-64 ; 0x116b8 ) && !( 116f8: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 116fc: 81 11 cpse r24, r1 116fe: dc cf rjmp .-72 ; 0x116b8 saved_printing || MMU2::mmu2.Enabled() // quick and dirty hack to prevent spurious runouts just before the toolchange 11700: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 11704: 81 30 cpi r24, 0x01 ; 1 11706: c1 f2 breq .-80 ; 0x116b8 || (lcd_commands_type == LcdCommands::Layer1Cal) 11708: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 1170c: 84 30 cpi r24, 0x04 ; 4 1170e: a1 f2 breq .-88 ; 0x116b8 || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) 11710: 8f e5 ldi r24, 0x5F ; 95 11712: 9f e0 ldi r25, 0x0F ; 15 11714: 0f 94 1c dc call 0x3b838 ; 0x3b838 && (eFilamentAction == FilamentAction::None) && ( moves_planned() != 0 || printJobOngoing() ) && !( 11718: 81 11 cpse r24, r1 1171a: ce cf rjmp .-100 ; 0x116b8 } //! @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); 1171c: 84 e9 ldi r24, 0x94 ; 148 1171e: 96 e6 ldi r25, 0x66 ; 102 11720: 9f 93 push r25 11722: 8f 93 push r24 11724: 8a e7 ldi r24, 0x7A ; 122 11726: 96 e6 ldi r25, 0x66 ; 102 11728: 9f 93 push r25 1172a: 8f 93 push r24 1172c: 0f 94 de da call 0x3b5bc ; 0x3b5bc void Filament_sensor::filRunout() { // SERIAL_ECHOLNPGM("filRunout"); sendHostNotification_P(MSG_FILAMENT_RUNOUT_DETECTED); runoutEnabled = false; 11730: 10 92 ac 17 sts 0x17AC, r1 ; 0x8017ac autoLoadEnabled = false; 11734: 10 92 ab 17 sts 0x17AB, r1 ; 0x8017ab stop_and_save_print_to_ram(0, 0); 11738: 20 e0 ldi r18, 0x00 ; 0 1173a: 30 e0 ldi r19, 0x00 ; 0 1173c: a9 01 movw r20, r18 1173e: ca 01 movw r24, r20 11740: b9 01 movw r22, r18 11742: 0e 94 37 89 call 0x1126e ; 0x1126e restore_print_from_ram_and_continue(0); 11746: 60 e0 ldi r22, 0x00 ; 0 11748: 70 e0 ldi r23, 0x00 ; 0 1174a: cb 01 movw r24, r22 1174c: 0e 94 44 68 call 0xd088 ; 0xd088 eeprom_increment_byte((uint8_t *)EEPROM_FERROR_COUNT); 11750: 85 e6 ldi r24, 0x65 ; 101 11752: 9f e0 ldi r25, 0x0F ; 15 11754: 0e 94 28 76 call 0xec50 ; 0xec50 eeprom_increment_word((uint16_t *)EEPROM_FERROR_COUNT_TOT); 11758: 81 e0 ldi r24, 0x01 ; 1 1175a: 9f e0 ldi r25, 0x0F ; 15 1175c: 0e 94 1b 76 call 0xec36 ; 0xec36 enquecommand_front_P(MSG_M600); 11760: 8b ee ldi r24, 0xEB ; 235 11762: 90 e7 ldi r25, 0x70 ; 112 11764: 0f 94 fd 74 call 0x2e9fa ; 0x2e9fa 11768: 0f 90 pop r0 1176a: 0f 90 pop r0 1176c: 0f 90 pop r0 1176e: 0f 90 pop r0 11770: a3 cf rjmp .-186 ; 0x116b8 inline constexpr Timer() : m_isRunning(false) , m_started(0) {}; void start(); void stop(){m_isRunning = false;} 11772: 10 92 da 05 sts 0x05DA, r1 ; 0x8005da #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)){ 11776: 80 91 a3 10 lds r24, 0x10A3 ; 0x8010a3 1177a: 90 91 a4 10 lds r25, 0x10A4 ; 0x8010a4 1177e: 03 97 sbiw r24, 0x03 ; 3 11780: 14 f4 brge .+4 ; 0x11786 get_command(); 11782: 0e 94 20 83 call 0x10640 ; 0x10640 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); 11786: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 1178a: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 } if (blocks_queued() && GetPrinterState() == PrinterState::IsHostPrinting && usb_timer.expired((USB_TIMER_TIMEOUT) / 2)) 1178e: 98 17 cp r25, r24 11790: 81 f0 breq .+32 ; 0x117b2 11792: 80 91 b8 0d lds r24, 0x0DB8 ; 0x800db8 <_ZL13printer_state.lto_priv.401> 11796: 86 30 cpi r24, 0x06 ; 6 11798: 61 f4 brne .+24 ; 0x117b2 1179a: 68 e8 ldi r22, 0x88 ; 136 1179c: 73 e1 ldi r23, 0x13 ; 19 1179e: 8e e0 ldi r24, 0x0E ; 14 117a0: 95 e0 ldi r25, 0x05 ; 5 117a2: 0f 94 7e 29 call 0x252fc ; 0x252fc ::expired(unsigned short)> 117a6: 88 23 and r24, r24 117a8: 21 f0 breq .+8 ; 0x117b2 { // 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(); 117aa: 8e e0 ldi r24, 0x0E ; 14 117ac: 95 e0 ldi r25, 0x05 ; 5 117ae: 0f 94 ad 29 call 0x2535a ; 0x2535a ::start()> } if(max_inactive_time && previous_millis_cmd.expired(max_inactive_time)) 117b2: 40 91 7e 03 lds r20, 0x037E ; 0x80037e 117b6: 50 91 7f 03 lds r21, 0x037F ; 0x80037f 117ba: 60 91 80 03 lds r22, 0x0380 ; 0x800380 117be: 70 91 81 03 lds r23, 0x0381 ; 0x800381 117c2: 41 15 cp r20, r1 117c4: 51 05 cpc r21, r1 117c6: 61 05 cpc r22, r1 117c8: 71 05 cpc r23, r1 117ca: 09 f0 breq .+2 ; 0x117ce 117cc: 3f c0 rjmp .+126 ; 0x1184c kill(PSTR("Inactivity Shutdown")); if(stepper_inactive_time && previous_millis_cmd.expired(stepper_inactive_time)) { 117ce: 40 91 34 02 lds r20, 0x0234 ; 0x800234 117d2: 50 91 35 02 lds r21, 0x0235 ; 0x800235 117d6: 60 91 36 02 lds r22, 0x0236 ; 0x800236 117da: 70 91 37 02 lds r23, 0x0237 ; 0x800237 117de: 41 15 cp r20, r1 117e0: 51 05 cpc r21, r1 117e2: 61 05 cpc r22, r1 117e4: 71 05 cpc r23, r1 117e6: a9 f0 breq .+42 ; 0x11812 117e8: 86 e8 ldi r24, 0x86 ; 134 117ea: 93 e0 ldi r25, 0x03 ; 3 117ec: 0f 94 30 2a call 0x25460 ; 0x25460 ::expired(unsigned long)> 117f0: 88 23 and r24, r24 117f2: 79 f0 breq .+30 ; 0x11812 117f4: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 117f8: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 if(blocks_queued() == false && ignore_stepper_queue == false) { 117fc: 98 13 cpse r25, r24 117fe: 09 c0 rjmp .+18 ; 0x11812 11800: c1 11 cpse r28, r1 11802: 07 c0 rjmp .+14 ; 0x11812 disable_x(); 11804: 17 9a sbi 0x02, 7 ; 2 11806: 10 92 8f 06 sts 0x068F, r1 ; 0x80068f disable_y(); 1180a: 16 9a sbi 0x02, 6 ; 2 1180c: 10 92 90 06 sts 0x0690, r1 ; 0x800690 disable_z(); disable_e0(); 11810: 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; 11812: c0 91 e7 03 lds r28, 0x03E7 ; 0x8003e7 block_t *block; if(block_buffer_tail != block_buffer_head) 11816: 90 91 a6 0d lds r25, 0x0DA6 ; 0x800da6 1181a: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 1181e: 98 17 cp r25, r24 11820: 01 f1 breq .+64 ; 0x11862 { uint8_t block_index = block_buffer_tail; 11822: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 tail_fan_speed = block_buffer[block_index].fan_speed; 11826: 9e e6 ldi r25, 0x6E ; 110 11828: 89 9f mul r24, r25 1182a: f0 01 movw r30, r0 1182c: 11 24 eor r1, r1 1182e: e5 5f subi r30, 0xF5 ; 245 11830: f8 4f sbci r31, 0xF8 ; 248 11832: c0 81 ld r28, Z while(block_index != block_buffer_head) 11834: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 11838: 98 17 cp r25, r24 1183a: 99 f0 breq .+38 ; 0x11862 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); 1183c: 8f 5f subi r24, 0xFF ; 255 1183e: 8f 70 andi r24, 0x0F ; 15 11840: f9 cf rjmp .-14 ; 0x11834 { safetyTimer.stop(); } else if ((CHECK_ALL_HEATERS) && !safetyTimer.running()) { safetyTimer.start(); 11842: 8a ed ldi r24, 0xDA ; 218 11844: 95 e0 ldi r25, 0x05 ; 5 11846: 0f 94 ef 2b call 0x257de ; 0x257de ::start()> 1184a: 95 cf rjmp .-214 ; 0x11776 // 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)) 1184c: 86 e8 ldi r24, 0x86 ; 134 1184e: 93 e0 ldi r25, 0x03 ; 3 11850: 0f 94 30 2a call 0x25460 ; 0x25460 ::expired(unsigned long)> 11854: 88 23 and r24, r24 11856: 09 f4 brne .+2 ; 0x1185a 11858: ba cf rjmp .-140 ; 0x117ce kill(PSTR("Inactivity Shutdown")); 1185a: 80 e8 ldi r24, 0x80 ; 128 1185c: 9d e7 ldi r25, 0x7D ; 125 1185e: 0e 94 0a 7a call 0xf414 ; 0xf414 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) { 11862: cc 23 and r28, r28 11864: 09 f4 brne .+2 ; 0x11868 11866: 9f c0 rjmp .+318 ; 0x119a6 if (fan_kick_end == 0) { 11868: 80 91 6c 03 lds r24, 0x036C ; 0x80036c 1186c: 90 91 6d 03 lds r25, 0x036D ; 0x80036d 11870: a0 91 6e 03 lds r26, 0x036E ; 0x80036e 11874: b0 91 6f 03 lds r27, 0x036F ; 0x80036f 11878: 89 2b or r24, r25 1187a: 8a 2b or r24, r26 1187c: 8b 2b or r24, r27 1187e: 81 f4 brne .+32 ; 0x118a0 // Just starting up fan - run at full power. fan_kick_end = _millis() + FAN_KICKSTART_TIME; 11880: 0f 94 4c 29 call 0x25298 ; 0x25298 11884: 60 5e subi r22, 0xE0 ; 224 11886: 7c 4f sbci r23, 0xFC ; 252 11888: 8f 4f sbci r24, 0xFF ; 255 1188a: 9f 4f sbci r25, 0xFF ; 255 1188c: 60 93 6c 03 sts 0x036C, r22 ; 0x80036c 11890: 70 93 6d 03 sts 0x036D, r23 ; 0x80036d 11894: 80 93 6e 03 sts 0x036E, r24 ; 0x80036e 11898: 90 93 6f 03 sts 0x036F, r25 ; 0x80036f tail_fan_speed = 255; } else if (fan_kick_end > _millis()) // Fan still spinning up. tail_fan_speed = 255; 1189c: cf ef ldi r28, 0xFF ; 255 1189e: 0f c0 rjmp .+30 ; 0x118be 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()) 118a0: 0f 94 4c 29 call 0x25298 ; 0x25298 118a4: 00 91 6c 03 lds r16, 0x036C ; 0x80036c 118a8: 10 91 6d 03 lds r17, 0x036D ; 0x80036d 118ac: 20 91 6e 03 lds r18, 0x036E ; 0x80036e 118b0: 30 91 6f 03 lds r19, 0x036F ; 0x80036f 118b4: 60 17 cp r22, r16 118b6: 71 07 cpc r23, r17 118b8: 82 07 cpc r24, r18 118ba: 93 07 cpc r25, r19 118bc: 78 f3 brcs .-34 ; 0x1189c } 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 118be: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 118c2: 88 23 and r24, r24 118c4: 09 f4 brne .+2 ; 0x118c8 118c6: 78 c0 rjmp .+240 ; 0x119b8 fanSpeedBckp = tail_fan_speed; 118c8: 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) { 118cc: 80 91 0c 05 lds r24, 0x050C ; 0x80050c <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.540> 118d0: 81 11 cpse r24, r1 118d2: 07 c0 rjmp .+14 ; 0x118e2 return; } avoidRecursion = true; 118d4: 81 e0 ldi r24, 0x01 ; 1 118d6: 80 93 0c 05 sts 0x050C, r24 ; 0x80050c <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.540> mmu_loop_inner(true); 118da: 0f 94 02 a7 call 0x34e04 ; 0x34e04 avoidRecursion = false; 118de: 10 92 0c 05 sts 0x050C, r1 ; 0x80050c <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.540> lcd_draw_update = 2; lcd_beeper_quick_feedback(); } void lcd_knob_update() { if (lcd_backlight_wake_trigger) { 118e2: 80 91 d3 05 lds r24, 0x05D3 ; 0x8005d3 <_ZL26lcd_backlight_wake_trigger.lto_priv.538> 118e6: 88 23 and r24, r24 118e8: e1 f1 breq .+120 ; 0x11962 lcd_backlight_wake_trigger = false; 118ea: 10 92 d3 05 sts 0x05D3, r1 ; 0x8005d3 <_ZL26lcd_backlight_wake_trigger.lto_priv.538> backlight_wake(); 118ee: 80 e0 ldi r24, 0x00 ; 0 118f0: 0e 94 6d 8a call 0x114da ; 0x114da bool did_rotate = false; ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 118f4: 4f b7 in r20, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 118f6: f8 94 cli if (abs(lcd_encoder_diff) >= ENCODER_PULSES_PER_STEP) { 118f8: 80 91 d1 05 lds r24, 0x05D1 ; 0x8005d1 <_ZL16lcd_encoder_diff.lto_priv.539> 118fc: 28 2f mov r18, r24 118fe: 08 2e mov r0, r24 11900: 00 0c add r0, r0 11902: 33 0b sbc r19, r19 11904: 37 ff sbrs r19, 7 11906: 03 c0 rjmp .+6 ; 0x1190e 11908: 31 95 neg r19 1190a: 21 95 neg r18 1190c: 31 09 sbc r19, r1 1190e: 24 30 cpi r18, 0x04 ; 4 11910: 31 05 cpc r19, r1 11912: 0c f4 brge .+2 ; 0x11916 11914: 54 c0 rjmp .+168 ; 0x119be lcd_encoder += lcd_encoder_diff / ENCODER_PULSES_PER_STEP; 11916: 98 2f mov r25, r24 11918: 87 ff sbrs r24, 7 1191a: 02 c0 rjmp .+4 ; 0x11920 1191c: 93 e0 ldi r25, 0x03 ; 3 1191e: 98 0f add r25, r24 11920: 95 95 asr r25 11922: 95 95 asr r25 11924: 20 91 70 06 lds r18, 0x0670 ; 0x800670 11928: 30 91 71 06 lds r19, 0x0671 ; 0x800671 1192c: 29 0f add r18, r25 1192e: 31 1d adc r19, r1 11930: 97 fd sbrc r25, 7 11932: 3a 95 dec r19 11934: 30 93 71 06 sts 0x0671, r19 ; 0x800671 11938: 20 93 70 06 sts 0x0670, r18 ; 0x800670 lcd_encoder_diff %= ENCODER_PULSES_PER_STEP; 1193c: 83 78 andi r24, 0x83 ; 131 1193e: 87 ff sbrs r24, 7 11940: 03 c0 rjmp .+6 ; 0x11948 11942: 81 50 subi r24, 0x01 ; 1 11944: 8c 6f ori r24, 0xFC ; 252 11946: 8f 5f subi r24, 0xFF ; 255 11948: 80 93 d1 05 sts 0x05D1, r24 ; 0x8005d1 <_ZL16lcd_encoder_diff.lto_priv.539> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 1194c: 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); 1194e: 86 e0 ldi r24, 0x06 ; 6 11950: 0f 94 07 4e call 0x29c0e ; 0x29c0e if (lcd_draw_update == 0) { 11954: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 11958: 81 11 cpse r24, r1 1195a: 03 c0 rjmp .+6 ; 0x11962 // Update LCD rendering at minimum lcd_draw_update = 1; 1195c: 81 e0 ldi r24, 0x01 ; 1 1195e: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d #endif check_axes_activity(); MMU2::mmu2.mmu_loop(); lcd_knob_update(); backlight_update(); 11962: 0e 94 06 8a call 0x1140c ; 0x1140c // handle longpress if(lcd_longpress_trigger) 11966: 80 91 d4 05 lds r24, 0x05D4 ; 0x8005d4 1196a: 88 23 and r24, r24 1196c: 61 f0 breq .+24 ; 0x11986 { lcd_consume_click(); // Reset trigger to prevent recursion 1196e: 0e 94 f8 70 call 0xe1f0 ; 0xe1f0 // long press is not possible in modal mode, wait until ready if (lcd_longpress_func && lcd_update_enabled) 11972: e0 91 17 04 lds r30, 0x0417 ; 0x800417 11976: f0 91 18 04 lds r31, 0x0418 ; 0x800418 1197a: 30 97 sbiw r30, 0x00 ; 0 1197c: 21 f0 breq .+8 ; 0x11986 1197e: 80 91 6e 02 lds r24, 0x026E ; 0x80026e 11982: 81 11 cpse r24, r1 { lcd_longpress_func(); 11984: 19 95 eicall } } #if defined(AUTO_REPORT) host_autoreport(); 11986: 0e 94 58 79 call 0xf2b0 ; 0xf2b0 #endif //AUTO_REPORT host_keepalive(); 1198a: 0e 94 a7 7f call 0xff4e ; 0xff4e bool M79_timer_get_status() { return M79_timer.running(); } void M79_timer_update_status() { M79_timer.expired(M79_TIMEOUT); 1198e: 40 e3 ldi r20, 0x30 ; 48 11990: 55 e7 ldi r21, 0x75 ; 117 11992: 60 e0 ldi r22, 0x00 ; 0 11994: 70 e0 ldi r23, 0x00 ; 0 11996: 8e e9 ldi r24, 0x9E ; 158 11998: 93 e0 ldi r25, 0x03 ; 3 M79_timer_update_status(); } 1199a: df 91 pop r29 1199c: cf 91 pop r28 1199e: 1f 91 pop r17 119a0: 0f 91 pop r16 119a2: 0d 94 30 2a jmp 0x25460 ; 0x25460 ::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; 119a6: 10 92 6c 03 sts 0x036C, r1 ; 0x80036c 119aa: 10 92 6d 03 sts 0x036D, r1 ; 0x80036d 119ae: 10 92 6e 03 sts 0x036E, r1 ; 0x80036e 119b2: 10 92 6f 03 sts 0x036F, r1 ; 0x80036f 119b6: 83 cf rjmp .-250 ; 0x118be #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; 119b8: c0 93 a6 04 sts 0x04A6, r28 ; 0x8004a6 119bc: 87 cf rjmp .-242 ; 0x118cc 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; 119be: 10 92 d1 05 sts 0x05D1, r1 ; 0x8005d1 <_ZL16lcd_encoder_diff.lto_priv.539> 119c2: 4f bf out 0x3f, r20 ; 63 } } Sound_MakeSound(did_rotate ? e_SOUND_TYPE_EncoderMove : e_SOUND_TYPE_ButtonEcho); 119c4: 80 e0 ldi r24, 0x00 ; 0 119c6: c4 cf rjmp .-120 ; 0x11950 000119c8 : #endif #endif } void delay_keep_alive(unsigned int ms) { 119c8: cf 93 push r28 119ca: df 93 push r29 119cc: ec 01 movw r28, r24 for (;;) { manage_heater(); 119ce: 0f 94 5c 38 call 0x270b8 ; 0x270b8 // Manage inactivity, but don't disable steppers on timeout. manage_inactivity(true); 119d2: 81 e0 ldi r24, 0x01 ; 1 119d4: 0e 94 af 8a call 0x1155e ; 0x1155e lcd_update(0); 119d8: 80 e0 ldi r24, 0x00 ; 0 119da: 0e 94 a7 6e call 0xdd4e ; 0xdd4e if (ms == 0) 119de: 20 97 sbiw r28, 0x00 ; 0 119e0: 99 f0 breq .+38 ; 0x11a08 break; else if (ms >= 50) { 119e2: c2 33 cpi r28, 0x32 ; 50 119e4: d1 05 cpc r29, r1 119e6: 40 f0 brcs .+16 ; 0x119f8 _delay(50); 119e8: 62 e3 ldi r22, 0x32 ; 50 119ea: 70 e0 ldi r23, 0x00 ; 0 119ec: 80 e0 ldi r24, 0x00 ; 0 119ee: 90 e0 ldi r25, 0x00 ; 0 119f0: 0f 94 53 27 call 0x24ea6 ; 0x24ea6 ms -= 50; 119f4: e2 97 sbiw r28, 0x32 ; 50 119f6: eb cf rjmp .-42 ; 0x119ce } else { _delay(ms); 119f8: be 01 movw r22, r28 119fa: 90 e0 ldi r25, 0x00 ; 0 119fc: 80 e0 ldi r24, 0x00 ; 0 119fe: 0f 94 53 27 call 0x24ea6 ; 0x24ea6 ms = 0; 11a02: d0 e0 ldi r29, 0x00 ; 0 11a04: c0 e0 ldi r28, 0x00 ; 0 11a06: e3 cf rjmp .-58 ; 0x119ce } } } 11a08: df 91 pop r29 11a0a: cf 91 pop r28 11a0c: 08 95 ret 00011a0e : /// @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) { 11a0e: cf 93 push r28 11a10: df 93 push r29 11a12: c8 2f mov r28, r24 inline Buttons GetPrinterButtonOperation() { return printerButtonOperation; } inline void ClearPrinterButtonOperation() { printerButtonOperation = Buttons::NoButton; 11a14: df ef ldi r29, 0xFF ; 255 MMU2::Buttons btn; for(;;) { manage_heater(); 11a16: 0f 94 5c 38 call 0x270b8 ; 0x270b8 manage_inactivity(true); 11a1a: 81 e0 ldi r24, 0x01 ; 1 11a1c: 0e 94 af 8a call 0x1155e ; 0x1155e 11a20: 80 91 b8 13 lds r24, 0x13B8 ; 0x8013b8 btn = MMU2::mmu2.GetPrinterButtonOperation(); if (btn != MMU2::Buttons::NoButton) 11a24: 8f 3f cpi r24, 0xFF ; 255 11a26: d9 f4 brne .+54 ; 0x11a5e // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { 11a28: 80 91 4d 13 lds r24, 0x134D ; 0x80134d 11a2c: 84 30 cpi r24, 0x04 ; 4 11a2e: 21 f4 brne .+8 ; 0x11a38 }; 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 11a30: 80 91 50 13 lds r24, 0x1350 ; 0x801350 11a34: 81 11 cpse r24, r1 11a36: ef cf rjmp .-34 ; 0x11a16 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 11a38: 80 91 8b 13 lds r24, 0x138B ; 0x80138b 11a3c: 90 91 8c 13 lds r25, 0x138C ; 0x80138c 11a40: 01 97 sbiw r24, 0x01 ; 1 11a42: 49 f7 brne .-46 ; 0x11a16 && lastErrorCode != ec) // The error code is not a duplicate 11a44: 80 91 b2 13 lds r24, 0x13B2 ; 0x8013b2 11a48: 90 91 b3 13 lds r25, 0x13B3 ; 0x8013b3 11a4c: 89 32 cpi r24, 0x29 ; 41 11a4e: 90 48 sbci r25, 0x80 ; 128 11a50: 11 f3 breq .-60 ; 0x11a16 { ReportError(ec, ErrorSource::ErrorSourcePrinter); 11a52: 60 e0 ldi r22, 0x00 ; 0 11a54: 89 e2 ldi r24, 0x29 ; 41 11a56: 90 e8 ldi r25, 0x80 ; 128 11a58: 0f 94 ee 82 call 0x305dc ; 0x305dc 11a5c: dc cf rjmp .-72 ; 0x11a16 inline Buttons GetPrinterButtonOperation() { return printerButtonOperation; } inline void ClearPrinterButtonOperation() { printerButtonOperation = Buttons::NoButton; 11a5e: d0 93 b8 13 sts 0x13B8, r29 ; 0x8013b8 { MMU2::mmu2.ClearPrinterButtonOperation(); if (btn == MMU2::Buttons::Eject) { 11a62: 85 30 cpi r24, 0x05 ; 5 11a64: 39 f4 brne .+14 ; 0x11a74 if (eject_slot != (uint8_t)MMU2::FILAMENT_UNKNOWN) { 11a66: cf 3f cpi r28, 0xFF ; 255 11a68: f9 f2 breq .-66 ; 0x11a28 MMU2::mmu2.eject_filament(eject_slot, true); 11a6a: 61 e0 ldi r22, 0x01 ; 1 11a6c: 8c 2f mov r24, r28 11a6e: 0f 94 98 ad call 0x35b30 ; 0x35b30 11a72: d1 cf rjmp .-94 ; 0x11a16 // the operation is done. We must be careful to not raise FILAMENT_CHANGE // screen too quickly continue; } } else if (btn == MMU2::Buttons::Load) 11a74: 84 30 cpi r24, 0x04 ; 4 11a76: c1 f6 brne .-80 ; 0x11a28 } } MMU2::mmu2.InvokeErrorScreen(ErrorCode::FILAMENT_CHANGE); } } 11a78: df 91 pop r29 11a7a: cf 91 pop r28 11a7c: 08 95 ret 00011a7e <__vector_29>: #ifdef ADC_CALLBACK extern void ADC_CALLBACK(); #endif //ADC_CALLBACK ISR(ADC_vect) { 11a7e: 1f 92 push r1 11a80: 0f 92 push r0 11a82: 0f b6 in r0, 0x3f ; 63 11a84: 0f 92 push r0 11a86: 11 24 eor r1, r1 11a88: 0b b6 in r0, 0x3b ; 59 11a8a: 0f 92 push r0 11a8c: 2f 93 push r18 11a8e: 3f 93 push r19 11a90: 4f 93 push r20 11a92: 5f 93 push r21 11a94: 6f 93 push r22 11a96: 7f 93 push r23 11a98: 8f 93 push r24 11a9a: 9f 93 push r25 11a9c: af 93 push r26 11a9e: bf 93 push r27 11aa0: ef 93 push r30 11aa2: ff 93 push r31 adc_values[adc_channel] += ADC; 11aa4: 20 91 78 00 lds r18, 0x0078 ; 0x800078 <__TEXT_REGION_LENGTH__+0x7c2078> 11aa8: 30 91 79 00 lds r19, 0x0079 ; 0x800079 <__TEXT_REGION_LENGTH__+0x7c2079> 11aac: e0 91 36 03 lds r30, 0x0336 ; 0x800336 11ab0: f0 e0 ldi r31, 0x00 ; 0 11ab2: ee 0f add r30, r30 11ab4: ff 1f adc r31, r31 11ab6: ea 5d subi r30, 0xDA ; 218 11ab8: fc 4f sbci r31, 0xFC ; 252 11aba: 80 81 ld r24, Z 11abc: 91 81 ldd r25, Z+1 ; 0x01 11abe: 82 0f add r24, r18 11ac0: 93 1f adc r25, r19 11ac2: 91 83 std Z+1, r25 ; 0x01 11ac4: 80 83 st Z, r24 if (++adc_count == ADC_OVRSAMPL) 11ac6: 80 91 25 03 lds r24, 0x0325 ; 0x800325 11aca: 8f 5f subi r24, 0xFF ; 255 11acc: 80 93 25 03 sts 0x0325, r24 ; 0x800325 11ad0: 80 31 cpi r24, 0x10 ; 16 11ad2: 09 f0 breq .+2 ; 0x11ad6 <__vector_29+0x58> 11ad4: 56 c0 rjmp .+172 ; 0x11b82 <__vector_29+0x104> { // go to the next channel if (++adc_channel == ADC_CHAN_CNT) { 11ad6: 80 91 36 03 lds r24, 0x0336 ; 0x800336 11ada: 8f 5f subi r24, 0xFF ; 255 11adc: 80 93 36 03 sts 0x0336, r24 ; 0x800336 11ae0: 88 30 cpi r24, 0x08 ; 8 11ae2: 09 f0 breq .+2 ; 0x11ae6 <__vector_29+0x68> 11ae4: 46 c0 rjmp .+140 ; 0x11b72 <__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 11ae6: 80 91 26 03 lds r24, 0x0326 ; 0x800326 11aea: 90 91 27 03 lds r25, 0x0327 ; 0x800327 11aee: 90 93 0c 06 sts 0x060C, r25 ; 0x80060c 11af2: 80 93 0b 06 sts 0x060B, r24 ; 0x80060b current_temperature_bed_raw = adc_values[ADC_PIN_IDX(TEMP_BED_PIN)]; 11af6: 80 91 2a 03 lds r24, 0x032A ; 0x80032a 11afa: 90 91 2b 03 lds r25, 0x032B ; 0x80032b 11afe: 90 93 0a 06 sts 0x060A, r25 ; 0x80060a 11b02: 80 93 09 06 sts 0x0609, r24 ; 0x800609 #ifdef PINDA_THERMISTOR current_temperature_raw_pinda = adc_values[ADC_PIN_IDX(TEMP_PINDA_PIN)]; 11b06: 80 91 2c 03 lds r24, 0x032C ; 0x80032c 11b0a: 90 91 2d 03 lds r25, 0x032D ; 0x80032d 11b0e: 90 93 08 06 sts 0x0608, r25 ; 0x800608 11b12: 80 93 07 06 sts 0x0607, r24 ; 0x800607 #endif //PINDA_THERMISTOR #ifdef AMBIENT_THERMISTOR current_temperature_raw_ambient = adc_values[ADC_PIN_IDX(TEMP_AMBIENT_PIN)]; // 5->6 11b16: 80 91 30 03 lds r24, 0x0330 ; 0x800330 11b1a: 90 91 31 03 lds r25, 0x0331 ; 0x800331 11b1e: 90 93 16 06 sts 0x0616, r25 ; 0x800616 11b22: 80 93 15 06 sts 0x0615, r24 ; 0x800615 #endif //AMBIENT_THERMISTOR #ifdef VOLT_PWR_PIN current_voltage_raw_pwr = adc_values[ADC_PIN_IDX(VOLT_PWR_PIN)]; 11b26: 80 91 2e 03 lds r24, 0x032E ; 0x80032e 11b2a: 90 91 2f 03 lds r25, 0x032F ; 0x80032f 11b2e: 90 93 5d 06 sts 0x065D, r25 ; 0x80065d 11b32: 80 93 5c 06 sts 0x065C, r24 ; 0x80065c #endif #ifdef VOLT_BED_PIN current_voltage_raw_bed = adc_values[ADC_PIN_IDX(VOLT_BED_PIN)]; // 6->9 11b36: 80 91 34 03 lds r24, 0x0334 ; 0x800334 11b3a: 90 91 35 03 lds r25, 0x0335 ; 0x800335 11b3e: 90 93 5b 06 sts 0x065B, r25 ; 0x80065b 11b42: 80 93 5a 06 sts 0x065A, r24 ; 0x80065a #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; 11b46: 81 e0 ldi r24, 0x01 ; 1 11b48: 80 93 1c 05 sts 0x051C, r24 ; 0x80051c <_ZL16adc_values_ready.lto_priv.457> break; } } } ADCSRA |= (1 << ADSC); //start conversion } 11b4c: ff 91 pop r31 11b4e: ef 91 pop r30 11b50: bf 91 pop r27 11b52: af 91 pop r26 11b54: 9f 91 pop r25 11b56: 8f 91 pop r24 11b58: 7f 91 pop r23 11b5a: 6f 91 pop r22 11b5c: 5f 91 pop r21 11b5e: 4f 91 pop r20 11b60: 3f 91 pop r19 11b62: 2f 91 pop r18 11b64: 0f 90 pop r0 11b66: 0b be out 0x3b, r0 ; 59 11b68: 0f 90 pop r0 11b6a: 0f be out 0x3f, r0 ; 63 11b6c: 0f 90 pop r0 11b6e: 1f 90 pop r1 11b70: 18 95 reti 11b72: 80 91 24 03 lds r24, 0x0324 ; 0x800324 <__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)) { 11b76: 4f e5 ldi r20, 0x5F ; 95 11b78: 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) { 11b7a: 8f 5f subi r24, 0xFF ; 255 11b7c: 41 f4 brne .+16 ; 0x11b8e <__vector_29+0x110> 11b7e: 10 92 24 03 sts 0x0324, r1 ; 0x800324 <__data_end> adc_count = 0; break; } } } ADCSRA |= (1 << ADSC); //start conversion 11b82: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 11b86: 80 64 ori r24, 0x40 ; 64 11b88: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 11b8c: df cf rjmp .-66 ; 0x11b4c <__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)) { 11b8e: 9a 01 movw r18, r20 11b90: 08 2e mov r0, r24 11b92: 02 c0 rjmp .+4 ; 0x11b98 <__vector_29+0x11a> 11b94: 35 95 asr r19 11b96: 27 95 ror r18 11b98: 0a 94 dec r0 11b9a: e2 f7 brpl .-8 ; 0x11b94 <__vector_29+0x116> 11b9c: 20 ff sbrs r18, 0 11b9e: ed cf rjmp .-38 ; 0x11b7a <__vector_29+0xfc> 11ba0: 80 93 24 03 sts 0x0324, r24 ; 0x800324 <__data_end> adc_setmux(adc_channel_idx); 11ba4: 0e 94 53 5b call 0xb6a6 ; 0xb6a6 adc_count = 0; 11ba8: 10 92 25 03 sts 0x0325, r1 ; 0x800325 11bac: ea cf rjmp .-44 ; 0x11b82 <__vector_29+0x104> 00011bae : if (ch & 0x08) ADCSRB |= (1 << MUX5); else ADCSRB &= ~(1 << MUX5); ADMUX = (ADMUX & ~(0x07)) | (ch & 0x07); } void adc_start_cycle() { 11bae: cf 93 push r28 11bb0: 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 11bb2: ca e7 ldi r28, 0x7A ; 122 11bb4: d0 e0 ldi r29, 0x00 ; 0 11bb6: 88 81 ld r24, Y 11bb8: 8f 7b andi r24, 0xBF ; 191 11bba: 88 83 st Y, r24 adc_count = 0; 11bbc: 10 92 25 03 sts 0x0325, r1 ; 0x800325 adc_channel = 0; 11bc0: 10 92 36 03 sts 0x0336, r1 ; 0x800336 adc_channel_idx = first_channel_idx; 11bc4: 10 92 24 03 sts 0x0324, r1 ; 0x800324 <__data_end> adc_setmux(adc_channel_idx); 11bc8: 80 e0 ldi r24, 0x00 ; 0 11bca: 0e 94 53 5b call 0xb6a6 ; 0xb6a6 memset((void*)adc_values, 0, sizeof(adc_values)); 11bce: e6 e2 ldi r30, 0x26 ; 38 11bd0: f3 e0 ldi r31, 0x03 ; 3 11bd2: 80 e1 ldi r24, 0x10 ; 16 11bd4: df 01 movw r26, r30 11bd6: 1d 92 st X+, r1 11bd8: 8a 95 dec r24 11bda: e9 f7 brne .-6 ; 0x11bd6 ADMUX = (ADMUX & ~(0x07)) | (ch & 0x07); } void adc_start_cycle() { adc_reset(); ADCSRA |= (1 << ADSC); //start conversion 11bdc: 88 81 ld r24, Y 11bde: 80 64 ori r24, 0x40 ; 64 11be0: 88 83 st Y, r24 } 11be2: df 91 pop r29 11be4: cf 91 pop r28 11be6: 08 95 ret 00011be8 : } // G80 - Automatic mesh bed leveling static void gcode_G80() { 11be8: 2f 92 push r2 11bea: 3f 92 push r3 11bec: 4f 92 push r4 11bee: 5f 92 push r5 11bf0: 6f 92 push r6 11bf2: 7f 92 push r7 11bf4: 8f 92 push r8 11bf6: 9f 92 push r9 11bf8: af 92 push r10 11bfa: bf 92 push r11 11bfc: cf 92 push r12 11bfe: df 92 push r13 11c00: ef 92 push r14 11c02: ff 92 push r15 11c04: 0f 93 push r16 11c06: 1f 93 push r17 11c08: cf 93 push r28 11c0a: df 93 push r29 11c0c: cd b7 in r28, 0x3d ; 61 11c0e: de b7 in r29, 0x3e ; 62 11c10: a4 97 sbiw r28, 0x24 ; 36 11c12: 0f b6 in r0, 0x3f ; 63 11c14: f8 94 cli 11c16: de bf out 0x3e, r29 ; 62 11c18: 0f be out 0x3f, r0 ; 63 11c1a: 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(); 11c1c: 0f 94 e8 42 call 0x285d0 ; 0x285d0 if (planner_aborted) 11c20: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 11c24: 81 11 cpse r24, r1 11c26: 17 c0 rjmp .+46 ; 0x11c56 return; mesh_bed_leveling_flag = true; 11c28: 81 e0 ldi r24, 0x01 ; 1 11c2a: 80 93 a8 0d sts 0x0DA8, r24 ; 0x800da8 // Firstly check if we know where we are if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS])) { 11c2e: 80 91 8f 06 lds r24, 0x068F ; 0x80068f 11c32: 88 23 and r24, r24 11c34: 49 f0 breq .+18 ; 0x11c48 11c36: 80 91 90 06 lds r24, 0x0690 ; 0x800690 11c3a: 88 23 and r24, r24 11c3c: 29 f0 breq .+10 ; 0x11c48 11c3e: 20 91 91 06 lds r18, 0x0691 ; 0x800691 11c42: 2f 83 std Y+7, r18 ; 0x07 11c44: 21 11 cpse r18, r1 11c46: 20 c0 rjmp .+64 ; 0x11c88 11c48: 81 e0 ldi r24, 0x01 ; 1 11c4a: 80 93 a2 10 sts 0x10A2, r24 ; 0x8010a2 // 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); 11c4e: 84 ee ldi r24, 0xE4 ; 228 11c50: 9b e6 ldi r25, 0x6B ; 107 11c52: 0f 94 fd 74 call 0x2e9fa ; 0x2e9fa custom_message_state = custom_message_state_old; lcd_update(2); st_synchronize(); mesh_bed_leveling_flag = false; } 11c56: a4 96 adiw r28, 0x24 ; 36 11c58: 0f b6 in r0, 0x3f ; 63 11c5a: f8 94 cli 11c5c: de bf out 0x3e, r29 ; 62 11c5e: 0f be out 0x3f, r0 ; 63 11c60: cd bf out 0x3d, r28 ; 61 11c62: df 91 pop r29 11c64: cf 91 pop r28 11c66: 1f 91 pop r17 11c68: 0f 91 pop r16 11c6a: ff 90 pop r15 11c6c: ef 90 pop r14 11c6e: df 90 pop r13 11c70: cf 90 pop r12 11c72: bf 90 pop r11 11c74: af 90 pop r10 11c76: 9f 90 pop r9 11c78: 8f 90 pop r8 11c7a: 7f 90 pop r7 11c7c: 6f 90 pop r6 11c7e: 5f 90 pop r5 11c80: 4f 90 pop r4 11c82: 3f 90 pop r3 11c84: 2f 90 pop r2 11c86: 08 95 ret return; } run = false; #endif //PINDA_THERMISTOR uint8_t nMeasPoints = eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR); 11c88: 8b ea ldi r24, 0xAB ; 171 11c8a: 9d e0 ldi r25, 0x0D ; 13 11c8c: 0f 94 1c dc call 0x3b838 ; 0x3b838 11c90: 18 2f mov r17, r24 if (uint8_t codeSeen = code_seen('N'), value = code_value_uint8(); codeSeen && (value == 7 || value == 3)) 11c92: 8e e4 ldi r24, 0x4E ; 78 11c94: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 11c98: 08 2f mov r16, r24 11c9a: 0e 94 68 5b call 0xb6d0 ; 0xb6d0 11c9e: 8e 83 std Y+6, r24 ; 0x06 11ca0: 00 23 and r16, r16 11ca2: 29 f0 breq .+10 ; 0x11cae 11ca4: 87 30 cpi r24, 0x07 ; 7 11ca6: 09 f4 brne .+2 ; 0x11caa 11ca8: c9 c0 rjmp .+402 ; 0x11e3c 11caa: 83 30 cpi r24, 0x03 ; 3 11cac: 29 f0 breq .+10 ; 0x11cb8 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; 11cae: 13 30 cpi r17, 0x03 ; 3 11cb0: 09 f0 breq .+2 ; 0x11cb4 11cb2: c3 c0 rjmp .+390 ; 0x11e3a 11cb4: 63 e0 ldi r22, 0x03 ; 3 11cb6: 6e 83 std Y+6, r22 ; 0x06 11cb8: 80 e0 ldi r24, 0x00 ; 0 11cba: 90 e0 ldi r25, 0x00 ; 0 11cbc: a0 e8 ldi r26, 0x80 ; 128 11cbe: bf e3 ldi r27, 0x3F ; 63 11cc0: 8a 83 std Y+2, r24 ; 0x02 11cc2: 9b 83 std Y+3, r25 ; 0x03 11cc4: ac 83 std Y+4, r26 ; 0x04 11cc6: bd 83 std Y+5, r27 ; 0x05 uint8_t nProbeRetryCount = eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR); 11cc8: 8a ea ldi r24, 0xAA ; 170 11cca: 9d e0 ldi r25, 0x0D ; 13 11ccc: 0f 94 1c dc call 0x3b838 ; 0x3b838 11cd0: 88 8f std Y+24, r24 ; 0x18 if (uint8_t codeSeen = code_seen('C'), value = code_value_uint8(); codeSeen && value >= 1 && value <= 10) 11cd2: 83 e4 ldi r24, 0x43 ; 67 11cd4: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 11cd8: 18 2f mov r17, r24 11cda: 0e 94 68 5b call 0xb6d0 ; 0xb6d0 11cde: 11 23 and r17, r17 11ce0: 29 f0 breq .+10 ; 0x11cec 11ce2: 88 23 and r24, r24 11ce4: 19 f0 breq .+6 ; 0x11cec 11ce6: 8b 30 cpi r24, 0x0B ; 11 11ce8: 08 f4 brcc .+2 ; 0x11cec 11cea: 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; 11cec: 88 e5 ldi r24, 0x58 ; 88 11cee: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 11cf2: 88 23 and r24, r24 11cf4: 09 f4 brne .+2 ; 0x11cf8 11cf6: ab c0 rjmp .+342 ; 0x11e4e 11cf8: 0e 94 9d 60 call 0xc13a ; 0xc13a 11cfc: 20 e0 ldi r18, 0x00 ; 0 11cfe: 30 e0 ldi r19, 0x00 ; 0 11d00: 48 e0 ldi r20, 0x08 ; 8 11d02: 52 e4 ldi r21, 0x42 ; 66 11d04: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 11d08: 20 e0 ldi r18, 0x00 ; 0 11d0a: 30 e0 ldi r19, 0x00 ; 0 11d0c: 48 eb ldi r20, 0xB8 ; 184 11d0e: 51 e4 ldi r21, 0x41 ; 65 11d10: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 11d14: 6a 87 std Y+10, r22 ; 0x0a 11d16: 7b 87 std Y+11, r23 ; 0x0b 11d18: 8c 87 std Y+12, r24 ; 0x0c 11d1a: 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; 11d1c: 89 e5 ldi r24, 0x59 ; 89 11d1e: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 11d22: 88 23 and r24, r24 11d24: 09 f4 brne .+2 ; 0x11d28 11d26: 9c c0 rjmp .+312 ; 0x11e60 11d28: 0e 94 9d 60 call 0xc13a ; 0xc13a 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 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 11d38: 20 e0 ldi r18, 0x00 ; 0 11d3a: 30 e0 ldi r19, 0x00 ; 0 11d3c: 40 ea ldi r20, 0xA0 ; 160 11d3e: 50 e4 ldi r21, 0x40 ; 64 11d40: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 11d44: 6c 8b std Y+20, r22 ; 0x14 11d46: 7d 8b std Y+21, r23 ; 0x15 11d48: 8e 8b std Y+22, r24 ; 0x16 11d4a: 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; 11d4c: 87 e5 ldi r24, 0x57 ; 87 11d4e: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 11d52: 88 23 and r24, r24 11d54: 09 f4 brne .+2 ; 0x11d58 11d56: 89 c0 rjmp .+274 ; 0x11e6a 11d58: 0e 94 9d 60 call 0xc13a ; 0xc13a 11d5c: 2a 85 ldd r18, Y+10 ; 0x0a 11d5e: 3b 85 ldd r19, Y+11 ; 0x0b 11d60: 4c 85 ldd r20, Y+12 ; 0x0c 11d62: 5d 85 ldd r21, Y+13 ; 0x0d 11d64: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 11d68: 20 e0 ldi r18, 0x00 ; 0 11d6a: 30 e0 ldi r19, 0x00 ; 0 11d6c: 48 e8 ldi r20, 0x88 ; 136 11d6e: 52 e4 ldi r21, 0x42 ; 66 11d70: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 11d74: 69 8f std Y+25, r22 ; 0x19 11d76: 7a 8f std Y+26, r23 ; 0x1a 11d78: 8b 8f std Y+27, r24 ; 0x1b 11d7a: 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; 11d7c: 88 e4 ldi r24, 0x48 ; 72 11d7e: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 11d82: 88 23 and r24, r24 11d84: 09 f4 brne .+2 ; 0x11d88 11d86: 7a c0 rjmp .+244 ; 0x11e7c 11d88: 0e 94 9d 60 call 0xc13a ; 0xc13a 11d8c: 2c 89 ldd r18, Y+20 ; 0x14 11d8e: 3d 89 ldd r19, Y+21 ; 0x15 11d90: 4e 89 ldd r20, Y+22 ; 0x16 11d92: 5f 89 ldd r21, Y+23 ; 0x17 11d94: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__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 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 11da4: 6d 8f std Y+29, r22 ; 0x1d 11da6: 7e 8f std Y+30, r23 ; 0x1e 11da8: 8f 8f std Y+31, r24 ; 0x1f 11daa: 98 a3 std Y+32, r25 ; 0x20 mbl.reset(); //reset mesh bed leveling 11dac: 0f 94 4d 8c call 0x3189a ; 0x3189a mbl.z_values[0][0] = min_pos[Z_AXIS]; 11db0: 80 91 29 02 lds r24, 0x0229 ; 0x800229 11db4: 90 91 2a 02 lds r25, 0x022A ; 0x80022a 11db8: a0 91 2b 02 lds r26, 0x022B ; 0x80022b 11dbc: b0 91 2c 02 lds r27, 0x022C ; 0x80022c 11dc0: 80 93 c3 13 sts 0x13C3, r24 ; 0x8013c3 11dc4: 90 93 c4 13 sts 0x13C4, r25 ; 0x8013c4 11dc8: a0 93 c5 13 sts 0x13C5, r26 ; 0x8013c5 11dcc: b0 93 c6 13 sts 0x13C6, r27 ; 0x8013c6 // Reset baby stepping to zero, if the babystepping has already been loaded before. babystep_undo(); 11dd0: 0f 94 db c9 call 0x393b6 ; 0x393b6 11dd4: 05 ec ldi r16, 0xC5 ; 197 11dd6: 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) 11dd8: c8 01 movw r24, r16 11dda: 0f 94 2a dc call 0x3b854 ; 0x3b854 11dde: 01 96 adiw r24, 0x01 ; 1 11de0: 09 f0 breq .+2 ; 0x11de4 11de2: 51 c0 rjmp .+162 ; 0x11e86 11de4: 0e 5f subi r16, 0xFE ; 254 11de6: 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) { 11de8: 05 3d cpi r16, 0xD5 ; 213 11dea: 8f e0 ldi r24, 0x0F ; 15 11dec: 18 07 cpc r17, r24 11dee: a1 f7 brne .-24 ; 0x11dd8 if (eeprom_read_word((uint16_t*)(EEPROM_BED_CALIBRATION_Z_JITTER + i * 2)) != 0x0FFFF) return true; } return false; 11df0: 21 2c mov r2, r1 11df2: a2 ec ldi r26, 0xC2 ; 194 11df4: b3 e1 ldi r27, 0x13 ; 19 11df6: ba a3 std Y+34, r27 ; 0x22 11df8: 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; 11dfa: b9 87 std Y+9, r27 ; 0x09 11dfc: a8 87 std Y+8, r26 ; 0x08 11dfe: 51 2c mov r5, r1 11e00: 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; 11e02: 31 2c mov r3, r1 11e04: 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)); 11e06: 84 2d mov r24, r4 11e08: 63 e0 ldi r22, 0x03 ; 3 11e0a: 0f 94 cb dc call 0x3b996 ; 0x3b996 <__udivmodqi4> 11e0e: 98 8b std Y+16, r25 ; 0x10 11e10: 68 84 ldd r6, Y+8 ; 0x08 11e12: 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++) { 11e14: 10 e0 ldi r17, 0x00 ; 0 bool isOn3x3Mesh = ((row % 3 == 0) && (col % 3 == 0)); 11e16: f8 89 ldd r31, Y+16 ; 0x10 11e18: f1 11 cpse r31, r1 11e1a: 37 c0 rjmp .+110 ; 0x11e8a 11e1c: 81 2f mov r24, r17 11e1e: 63 e0 ldi r22, 0x03 ; 3 11e20: 0f 94 cb dc call 0x3b996 ; 0x3b996 <__udivmodqi4> 11e24: 91 11 cpse r25, r1 11e26: 31 c0 rjmp .+98 ; 0x11e8a if (isOn3x3Mesh) { if (has_z && (row || col)) { 11e28: 21 10 cpse r2, r1 11e2a: 3f c1 rjmp .+638 ; 0x120aa } else { mbl.set_z(col, row, NAN); } // check for points that are skipped if (nMeasPoints == 3) { 11e2c: 7e 81 ldd r23, Y+6 ; 0x06 11e2e: 73 30 cpi r23, 0x03 ; 3 11e30: 09 f4 brne .+2 ; 0x11e34 11e32: 70 c0 rjmp .+224 ; 0x11f14 11e34: 8f 81 ldd r24, Y+7 ; 0x07 11e36: 8e 87 std Y+14, r24 ; 0x0e 11e38: 37 c0 rjmp .+110 ; 0x11ea8 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; 11e3a: 1e 83 std Y+6, r17 ; 0x06 11e3c: 6a e9 ldi r22, 0x9A ; 154 11e3e: 79 e9 ldi r23, 0x99 ; 153 11e40: 89 e1 ldi r24, 0x19 ; 25 11e42: 9f e3 ldi r25, 0x3F ; 63 11e44: 6a 83 std Y+2, r22 ; 0x02 11e46: 7b 83 std Y+3, r23 ; 0x03 11e48: 8c 83 std Y+4, r24 ; 0x04 11e4a: 9d 83 std Y+5, r25 ; 0x05 11e4c: 3d cf rjmp .-390 ; 0x11cc8 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; 11e4e: 80 e0 ldi r24, 0x00 ; 0 11e50: 90 e0 ldi r25, 0x00 ; 0 11e52: a0 e8 ldi r26, 0x80 ; 128 11e54: bf ef ldi r27, 0xFF ; 255 11e56: 8a 87 std Y+10, r24 ; 0x0a 11e58: 9b 87 std Y+11, r25 ; 0x0b 11e5a: ac 87 std Y+12, r26 ; 0x0c 11e5c: bd 87 std Y+13, r27 ; 0x0d 11e5e: 5e cf rjmp .-324 ; 0x11d1c const float area_min_y = code_seen('Y') ? code_value() - y_mesh_density - Y_PROBE_OFFSET_FROM_EXTRUDER : -INFINITY; 11e60: 60 e0 ldi r22, 0x00 ; 0 11e62: 70 e0 ldi r23, 0x00 ; 0 11e64: 80 e8 ldi r24, 0x80 ; 128 11e66: 9f ef ldi r25, 0xFF ; 255 11e68: 6d cf rjmp .-294 ; 0x11d44 const float area_max_x = code_seen('W') ? area_min_x + code_value() + 2 * x_mesh_density : INFINITY; 11e6a: 80 e0 ldi r24, 0x00 ; 0 11e6c: 90 e0 ldi r25, 0x00 ; 0 11e6e: a0 e8 ldi r26, 0x80 ; 128 11e70: bf e7 ldi r27, 0x7F ; 127 11e72: 89 8f std Y+25, r24 ; 0x19 11e74: 9a 8f std Y+26, r25 ; 0x1a 11e76: ab 8f std Y+27, r26 ; 0x1b 11e78: bc 8f std Y+28, r27 ; 0x1c 11e7a: 80 cf rjmp .-256 ; 0x11d7c const float area_max_y = code_seen('H') ? area_min_y + code_value() + 2 * y_mesh_density : INFINITY; 11e7c: 60 e0 ldi r22, 0x00 ; 0 11e7e: 70 e0 ldi r23, 0x00 ; 0 11e80: 80 e8 ldi r24, 0x80 ; 128 11e82: 9f e7 ldi r25, 0x7F ; 127 11e84: 8f cf rjmp .-226 ; 0x11da4 11e86: 2f 80 ldd r2, Y+7 ; 0x07 11e88: b4 cf rjmp .-152 ; 0x11df2 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; } 11e8a: 60 e0 ldi r22, 0x00 ; 0 11e8c: 70 e0 ldi r23, 0x00 ; 0 11e8e: 80 ec ldi r24, 0xC0 ; 192 11e90: 9f e7 ldi r25, 0x7F ; 127 11e92: d3 01 movw r26, r6 11e94: 11 96 adiw r26, 0x01 ; 1 11e96: 6d 93 st X+, r22 11e98: 7d 93 st X+, r23 11e9a: 8d 93 st X+, r24 11e9c: 9c 93 st X, r25 11e9e: 14 97 sbiw r26, 0x04 ; 4 } else { mbl.set_z(col, row, NAN); } // check for points that are skipped if (nMeasPoints == 3) { 11ea0: be 81 ldd r27, Y+6 ; 0x06 11ea2: b3 30 cpi r27, 0x03 ; 3 11ea4: c1 f1 breq .+112 ; 0x11f16 11ea6: 1e 86 std Y+14, r1 ; 0x0e if (!isOn3x3Mesh) continue; } else { const float x_pos = BED_X(col); 11ea8: 81 2f mov r24, r17 11eaa: 0f 94 35 ca call 0x3946a ; 0x3946a 11eae: 4b 01 movw r8, r22 11eb0: 5c 01 movw r10, r24 const float y_pos = BED_Y(row); 11eb2: 80 2f mov r24, r16 11eb4: 0f 94 35 ca call 0x3946a ; 0x3946a 11eb8: 6b 01 movw r12, r22 11eba: 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)) { 11ebc: a5 01 movw r20, r10 11ebe: 94 01 movw r18, r8 11ec0: 6a 85 ldd r22, Y+10 ; 0x0a 11ec2: 7b 85 ldd r23, Y+11 ; 0x0b 11ec4: 8c 85 ldd r24, Y+12 ; 0x0c 11ec6: 9d 85 ldd r25, Y+13 ; 0x0d 11ec8: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 11ecc: 18 16 cp r1, r24 11ece: 0c f4 brge .+2 ; 0x11ed2 11ed0: 1c c1 rjmp .+568 ; 0x1210a 11ed2: 29 8d ldd r18, Y+25 ; 0x19 11ed4: 3a 8d ldd r19, Y+26 ; 0x1a 11ed6: 4b 8d ldd r20, Y+27 ; 0x1b 11ed8: 5c 8d ldd r21, Y+28 ; 0x1c 11eda: c5 01 movw r24, r10 11edc: b4 01 movw r22, r8 11ede: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 11ee2: 18 16 cp r1, r24 11ee4: 0c f4 brge .+2 ; 0x11ee8 11ee6: 11 c1 rjmp .+546 ; 0x1210a 11ee8: a7 01 movw r20, r14 11eea: 96 01 movw r18, r12 11eec: 6c 89 ldd r22, Y+20 ; 0x14 11eee: 7d 89 ldd r23, Y+21 ; 0x15 11ef0: 8e 89 ldd r24, Y+22 ; 0x16 11ef2: 9f 89 ldd r25, Y+23 ; 0x17 11ef4: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 11ef8: 18 16 cp r1, r24 11efa: 0c f4 brge .+2 ; 0x11efe 11efc: 06 c1 rjmp .+524 ; 0x1210a 11efe: 2d 8d ldd r18, Y+29 ; 0x1d 11f00: 3e 8d ldd r19, Y+30 ; 0x1e 11f02: 4f 8d ldd r20, Y+31 ; 0x1f 11f04: 58 a1 ldd r21, Y+32 ; 0x20 11f06: c7 01 movw r24, r14 11f08: b6 01 movw r22, r12 11f0a: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 11f0e: 18 16 cp r1, r24 11f10: 0c f4 brge .+2 ; 0x11f14 11f12: fb c0 rjmp .+502 ; 0x1210a continue; } } // increment the total point counter if the points are not skipped meshPointsToProbe++; 11f14: 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++) { 11f16: 1f 5f subi r17, 0xFF ; 255 11f18: 24 e0 ldi r18, 0x04 ; 4 11f1a: 62 0e add r6, r18 11f1c: 71 1c adc r7, r1 11f1e: 17 30 cpi r17, 0x07 ; 7 11f20: 09 f0 breq .+2 ; 0x11f24 11f22: 79 cf rjmp .-270 ; 0x11e16 11f24: 6f ef ldi r22, 0xFF ; 255 11f26: 46 1a sub r4, r22 11f28: 56 0a sbc r5, r22 11f2a: 88 85 ldd r24, Y+8 ; 0x08 11f2c: 99 85 ldd r25, Y+9 ; 0x09 11f2e: 4c 96 adiw r24, 0x1c ; 28 11f30: 99 87 std Y+9, r25 ; 0x09 11f32: 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++) { 11f34: 97 e0 ldi r25, 0x07 ; 7 11f36: 49 16 cp r4, r25 11f38: 51 04 cpc r5, r1 11f3a: 09 f0 breq .+2 ; 0x11f3e 11f3c: 63 cf rjmp .-314 ; 0x11e04 // increment the total point counter if the points are not skipped meshPointsToProbe++; } } mbl.upsample_3x3(); //upsample the default mesh 11f3e: 0f 94 f6 a2 call 0x345ec ; 0x345ec // Save custom message state, set a new custom message state to display: Calibrating point 9. CustomMsg custom_message_type_old = custom_message_type; 11f42: a0 91 c4 06 lds r26, 0x06C4 ; 0x8006c4 11f46: af 83 std Y+7, r26 ; 0x07 uint8_t custom_message_state_old = custom_message_state; 11f48: b0 91 f7 03 lds r27, 0x03F7 ; 0x8003f7 11f4c: b8 87 std Y+8, r27 ; 0x08 custom_message_type = CustomMsg::MeshBedLeveling; 11f4e: 81 e0 ldi r24, 0x01 ; 1 11f50: 80 93 c4 06 sts 0x06C4, r24 ; 0x8006c4 custom_message_state = meshPointsToProbe + 10; 11f54: 8a e0 ldi r24, 0x0A ; 10 11f56: 83 0d add r24, r3 11f58: 80 93 f7 03 sts 0x03F7, r24 ; 0x8003f7 lcd_update(1); 11f5c: 81 e0 ldi r24, 0x01 ; 1 11f5e: 0e 94 a7 6e call 0xdd4e ; 0xdd4e // Lift Z to a safe position before probing the first point current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 11f62: 80 e0 ldi r24, 0x00 ; 0 11f64: 90 e0 ldi r25, 0x00 ; 0 11f66: a0 ea ldi r26, 0xA0 ; 160 11f68: b0 e4 ldi r27, 0x40 ; 64 11f6a: 80 93 9a 06 sts 0x069A, r24 ; 0x80069a 11f6e: 90 93 9b 06 sts 0x069B, r25 ; 0x80069b 11f72: a0 93 9c 06 sts 0x069C, r26 ; 0x80069c 11f76: b0 93 9d 06 sts 0x069D, r27 ; 0x80069d plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 11f7a: 65 e5 ldi r22, 0x55 ; 85 11f7c: 75 e5 ldi r23, 0x55 ; 85 11f7e: 85 e5 ldi r24, 0x55 ; 85 11f80: 91 e4 ldi r25, 0x41 ; 65 11f82: 0f 94 49 c0 call 0x38092 ; 0x38092 // Cycle through all points and probe them int l_feedmultiply = setup_for_endstop_move(false); //save feedrate and feedmultiply, sets feedmultiply to 100 11f86: 80 e0 ldi r24, 0x00 ; 0 11f88: 0e 94 e8 66 call 0xcdd0 ; 0xcdd0 11f8c: 9c a3 std Y+36, r25 ; 0x24 11f8e: 8b a3 std Y+35, r24 ; 0x23 11f90: 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 11f92: 83 2d mov r24, r3 11f94: 67 e0 ldi r22, 0x07 ; 7 11f96: 0f 94 cb dc call 0x3b996 ; 0x3b996 <__udivmodqi4> 11f9a: f8 2e mov r15, r24 11f9c: 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 11f9e: 68 2f mov r22, r24 11fa0: 70 e0 ldi r23, 0x00 ; 0 11fa2: 7f 87 std Y+15, r23 ; 0x0f 11fa4: 6e 87 std Y+14, r22 ; 0x0e 11fa6: 80 ff sbrs r24, 0 11fa8: 03 c0 rjmp .+6 ; 0x11fb0 11faa: 76 e0 ldi r23, 0x06 ; 6 11fac: 79 1b sub r23, r25 11fae: 07 2f mov r16, r23 bool isOn3x3Mesh = ((ix % 3 == 0) && (iy % 3 == 0)); 11fb0: 80 2f mov r24, r16 11fb2: 63 e0 ldi r22, 0x03 ; 3 11fb4: 0f 94 cb dc call 0x3b996 ; 0x3b996 <__udivmodqi4> 11fb8: 91 11 cpse r25, r1 11fba: 05 c0 rjmp .+10 ; 0x11fc6 11fbc: 8f 2d mov r24, r15 11fbe: 0f 94 cb dc call 0x3b996 ; 0x3b996 <__udivmodqi4> 11fc2: 11 e0 ldi r17, 0x01 ; 1 11fc4: 91 11 cpse r25, r1 11fc6: 10 e0 ldi r17, 0x00 ; 0 float x_pos = BED_X(ix); 11fc8: 80 2f mov r24, r16 11fca: 0f 94 35 ca call 0x3946a ; 0x3946a 11fce: 68 8b std Y+16, r22 ; 0x10 11fd0: 79 8b std Y+17, r23 ; 0x11 11fd2: 8a 8b std Y+18, r24 ; 0x12 11fd4: 9b 8b std Y+19, r25 ; 0x13 float y_pos = BED_Y(iy); 11fd6: 8f 2d mov r24, r15 11fd8: 0f 94 35 ca call 0x3946a ; 0x3946a 11fdc: 4b 01 movw r8, r22 11fde: 5c 01 movw r10, r24 if (nMeasPoints == 3) { 11fe0: 8e 81 ldd r24, Y+6 ; 0x06 11fe2: 83 30 cpi r24, 0x03 ; 3 11fe4: 09 f0 breq .+2 ; 0x11fe8 11fe6: 99 c0 rjmp .+306 ; 0x1211a if (!isOn3x3Mesh) { 11fe8: 11 11 cpse r17, r1 11fea: c8 c0 rjmp .+400 ; 0x1217c 11fec: 27 e0 ldi r18, 0x07 ; 7 11fee: ae 85 ldd r26, Y+14 ; 0x0e 11ff0: bf 85 ldd r27, Y+15 ; 0x0f 11ff2: 2a 9f mul r18, r26 11ff4: f0 01 movw r30, r0 11ff6: 2b 9f mul r18, r27 11ff8: f0 0d add r31, r0 11ffa: 11 24 eor r1, r1 11ffc: e0 0f add r30, r16 11ffe: f1 1d adc r31, r1 12000: ee 0f add r30, r30 12002: ff 1f adc r31, r31 12004: ee 0f add r30, r30 12006: ff 1f adc r31, r31 12008: ee 53 subi r30, 0x3E ; 62 1200a: fc 4e sbci r31, 0xEC ; 236 1200c: 60 e0 ldi r22, 0x00 ; 0 1200e: 70 e0 ldi r23, 0x00 ; 0 12010: 80 ec ldi r24, 0xC0 ; 192 12012: 9f e7 ldi r25, 0x7F ; 127 12014: 61 83 std Z+1, r22 ; 0x01 12016: 72 83 std Z+2, r23 ; 0x02 12018: 83 83 std Z+3, r24 ; 0x03 1201a: 94 83 std Z+4, r25 ; 0x04 1201c: 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) { 1201e: e1 e3 ldi r30, 0x31 ; 49 12020: 3e 12 cpse r3, r30 12022: b7 cf rjmp .-146 ; 0x11f92 custom_message_state--; mesh_point++; lcd_update(1); } current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 12024: 80 e0 ldi r24, 0x00 ; 0 12026: 90 e0 ldi r25, 0x00 ; 0 12028: a0 ea ldi r26, 0xA0 ; 160 1202a: b0 e4 ldi r27, 0x40 ; 64 1202c: 80 93 9a 06 sts 0x069A, r24 ; 0x80069a 12030: 90 93 9b 06 sts 0x069B, r25 ; 0x80069b 12034: a0 93 9c 06 sts 0x069C, r26 ; 0x80069c 12038: b0 93 9d 06 sts 0x069D, r27 ; 0x80069d plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 1203c: 65 e5 ldi r22, 0x55 ; 85 1203e: 75 e5 ldi r23, 0x55 ; 85 12040: 85 e5 ldi r24, 0x55 ; 85 12042: 91 e4 ldi r25, 0x41 ; 65 12044: 0f 94 49 c0 call 0x38092 ; 0x38092 st_synchronize(); 12048: 0f 94 e8 42 call 0x285d0 ; 0x285d0 static uint8_t g80_fail_cnt = 0; if (mesh_point != MESH_NUM_X_POINTS * MESH_NUM_Y_POINTS) { 1204c: b1 e3 ldi r27, 0x31 ; 49 1204e: 3b 16 cp r3, r27 12050: 09 f4 brne .+2 ; 0x12054 12052: 33 c2 rjmp .+1126 ; 0x124ba if (g80_fail_cnt++ >= 1) { 12054: 80 91 6a 03 lds r24, 0x036A ; 0x80036a 12058: 91 e0 ldi r25, 0x01 ; 1 1205a: 98 0f add r25, r24 1205c: 90 93 6a 03 sts 0x036A, r25 ; 0x80036a 12060: 88 23 and r24, r24 12062: 09 f4 brne .+2 ; 0x12066 12064: d3 c1 rjmp .+934 ; 0x1240c print_stop(); 12066: 60 e0 ldi r22, 0x00 ; 0 12068: 80 e0 ldi r24, 0x00 ; 0 1206a: 0e 94 9a f4 call 0x1e934 ; 0x1e934 lcd_show_fullscreen_message_and_wait_P(_T(MSG_MBL_FAILED)); 1206e: 86 e4 ldi r24, 0x46 ; 70 12070: 96 e3 ldi r25, 0x36 ; 54 12072: 0e 94 ac 72 call 0xe558 ; 0xe558 12076: 0f 94 f1 1f call 0x23fe2 ; 0x23fe2 lcd_z_calibration_prompt(false); 1207a: 80 e0 ldi r24, 0x00 ; 0 1207c: 0f 94 b6 0c call 0x2196c ; 0x2196c current_position[E_AXIS] += default_retraction; plan_buffer_line_curposXYZE(400); } #endif // !PINDA_THERMISTOR exit: KEEPALIVE_STATE(NOT_BUSY); 12080: 81 e0 ldi r24, 0x01 ; 1 12082: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be // Restore custom message state lcd_setstatuspgm(MSG_WELCOME); 12086: 83 e7 ldi r24, 0x73 ; 115 12088: 90 e7 ldi r25, 0x70 ; 112 1208a: 0e 94 5d f1 call 0x1e2ba ; 0x1e2ba custom_message_type = custom_message_type_old; 1208e: 2f 81 ldd r18, Y+7 ; 0x07 12090: 20 93 c4 06 sts 0x06C4, r18 ; 0x8006c4 custom_message_state = custom_message_state_old; 12094: 68 85 ldd r22, Y+8 ; 0x08 12096: 60 93 f7 03 sts 0x03F7, r22 ; 0x8003f7 lcd_update(2); 1209a: 82 e0 ldi r24, 0x02 ; 2 1209c: 0e 94 a7 6e call 0xdd4e ; 0xdd4e st_synchronize(); 120a0: 0f 94 e8 42 call 0x285d0 ; 0x285d0 mesh_bed_leveling_flag = false; 120a4: 10 92 a8 0d sts 0x0DA8, r1 ; 0x800da8 120a8: d6 cd rjmp .-1108 ; 0x11c56 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)) { 120aa: 01 11 cpse r16, r1 120ac: 03 c0 rjmp .+6 ; 0x120b4 120ae: 11 23 and r17, r17 120b0: 09 f4 brne .+2 ; 0x120b4 120b2: bc ce rjmp .-648 ; 0x11e2c // 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))); 120b4: 81 2f mov r24, r17 120b6: 63 e0 ldi r22, 0x03 ; 3 120b8: 0f 94 d7 dc call 0x3b9ae ; 0x3b9ae <__divmodqi4> 120bc: 84 0d add r24, r4 120be: 95 2d mov r25, r5 120c0: 91 1d adc r25, r1 120c2: 88 0f add r24, r24 120c4: 99 1f adc r25, r25 120c6: 8d 53 subi r24, 0x3D ; 61 120c8: 90 4f sbci r25, 0xF0 ; 240 120ca: 0f 94 2a dc call 0x3b854 ; 0x3b854 const float z0 = mbl.z_values[0][0] + *reinterpret_cast(&z_offset_u) * 0.01; 120ce: bc 01 movw r22, r24 120d0: 99 0f add r25, r25 120d2: 88 0b sbc r24, r24 120d4: 99 0b sbc r25, r25 120d6: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 120da: 2a e0 ldi r18, 0x0A ; 10 120dc: 37 ed ldi r19, 0xD7 ; 215 120de: 43 e2 ldi r20, 0x23 ; 35 120e0: 5c e3 ldi r21, 0x3C ; 60 120e2: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 120e6: 9b 01 movw r18, r22 120e8: ac 01 movw r20, r24 120ea: 60 91 c3 13 lds r22, 0x13C3 ; 0x8013c3 120ee: 70 91 c4 13 lds r23, 0x13C4 ; 0x8013c4 120f2: 80 91 c5 13 lds r24, 0x13C5 ; 0x8013c5 120f6: 90 91 c6 13 lds r25, 0x13C6 ; 0x8013c6 120fa: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 120fe: f3 01 movw r30, r6 12100: 61 83 std Z+1, r22 ; 0x01 12102: 72 83 std Z+2, r23 ; 0x02 12104: 83 83 std Z+3, r24 ; 0x03 12106: 94 83 std Z+4, r25 ; 0x04 12108: 91 ce rjmp .-734 ; 0x11e2c 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)) { 1210a: fe 85 ldd r31, Y+14 ; 0x0e 1210c: ff 23 and r31, r31 1210e: 09 f4 brne .+2 ; 0x12112 12110: 02 cf rjmp .-508 ; 0x11f16 12112: 22 20 and r2, r2 12114: 09 f4 brne .+2 ; 0x12118 12116: fe ce rjmp .-516 ; 0x11f14 12118: fe ce rjmp .-516 ; 0x11f16 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)) { 1211a: 28 89 ldd r18, Y+16 ; 0x10 1211c: 39 89 ldd r19, Y+17 ; 0x11 1211e: 4a 89 ldd r20, Y+18 ; 0x12 12120: 5b 89 ldd r21, Y+19 ; 0x13 12122: 6a 85 ldd r22, Y+10 ; 0x0a 12124: 7b 85 ldd r23, Y+11 ; 0x0b 12126: 8c 85 ldd r24, Y+12 ; 0x0c 12128: 9d 85 ldd r25, Y+13 ; 0x0d 1212a: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 1212e: 18 16 cp r1, r24 12130: 04 f1 brlt .+64 ; 0x12172 12132: 28 89 ldd r18, Y+16 ; 0x10 12134: 39 89 ldd r19, Y+17 ; 0x11 12136: 4a 89 ldd r20, Y+18 ; 0x12 12138: 5b 89 ldd r21, Y+19 ; 0x13 1213a: 69 8d ldd r22, Y+25 ; 0x19 1213c: 7a 8d ldd r23, Y+26 ; 0x1a 1213e: 8b 8d ldd r24, Y+27 ; 0x1b 12140: 9c 8d ldd r25, Y+28 ; 0x1c 12142: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 12146: 87 fd sbrc r24, 7 12148: 14 c0 rjmp .+40 ; 0x12172 1214a: a5 01 movw r20, r10 1214c: 94 01 movw r18, r8 1214e: 6c 89 ldd r22, Y+20 ; 0x14 12150: 7d 89 ldd r23, Y+21 ; 0x15 12152: 8e 89 ldd r24, Y+22 ; 0x16 12154: 9f 89 ldd r25, Y+23 ; 0x17 12156: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 1215a: 18 16 cp r1, r24 1215c: 54 f0 brlt .+20 ; 0x12172 1215e: a5 01 movw r20, r10 12160: 94 01 movw r18, r8 12162: 6d 8d ldd r22, Y+29 ; 0x1d 12164: 7e 8d ldd r23, Y+30 ; 0x1e 12166: 8f 8d ldd r24, Y+31 ; 0x1f 12168: 98 a1 ldd r25, Y+32 ; 0x20 1216a: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 1216e: 87 ff sbrs r24, 7 12170: 05 c0 rjmp .+10 ; 0x1217c 12172: 11 23 and r17, r17 12174: 09 f4 brne .+2 ; 0x12178 12176: 52 cf rjmp .-348 ; 0x1201c 12178: 21 10 cpse r2, r1 1217a: 50 cf rjmp .-352 ; 0x1201c mesh_point++; continue; //skip } // Move Z up to the probe height of the current Z point. const float z0 = mbl.z_values[iy][ix]; 1217c: 10 e0 ldi r17, 0x00 ; 0 1217e: a7 e0 ldi r26, 0x07 ; 7 12180: 8e 85 ldd r24, Y+14 ; 0x0e 12182: 9f 85 ldd r25, Y+15 ; 0x0f 12184: a8 9f mul r26, r24 12186: f0 01 movw r30, r0 12188: a9 9f mul r26, r25 1218a: f0 0d add r31, r0 1218c: 11 24 eor r1, r1 1218e: e0 0f add r30, r16 12190: f1 1f adc r31, r17 12192: ee 0f add r30, r30 12194: ff 1f adc r31, r31 12196: ee 0f add r30, r30 12198: ff 1f adc r31, r31 1219a: ee 53 subi r30, 0x3E ; 62 1219c: fc 4e sbci r31, 0xEC ; 236 1219e: 41 80 ldd r4, Z+1 ; 0x01 121a0: 52 80 ldd r5, Z+2 ; 0x02 121a2: 63 80 ldd r6, Z+3 ; 0x03 121a4: 74 80 ldd r7, Z+4 ; 0x04 const float init_z_bckp = !has_z ? MESH_HOME_Z_SEARCH : z0 + MESH_HOME_Z_SEARCH_FAST; 121a6: c1 2c mov r12, r1 121a8: d1 2c mov r13, r1 121aa: e0 ea ldi r30, 0xA0 ; 160 121ac: ee 2e mov r14, r30 121ae: e0 e4 ldi r30, 0x40 ; 64 121b0: fe 2e mov r15, r30 121b2: 22 20 and r2, r2 121b4: 51 f0 breq .+20 ; 0x121ca 121b6: 23 e3 ldi r18, 0x33 ; 51 121b8: 33 e3 ldi r19, 0x33 ; 51 121ba: 43 eb ldi r20, 0xB3 ; 179 121bc: 5e e3 ldi r21, 0x3E ; 62 121be: c3 01 movw r24, r6 121c0: b2 01 movw r22, r4 121c2: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 121c6: 6b 01 movw r12, r22 121c8: 7c 01 movw r14, r24 if (init_z_bckp > current_position[Z_AXIS]) { 121ca: a7 01 movw r20, r14 121cc: 96 01 movw r18, r12 121ce: 60 91 9a 06 lds r22, 0x069A ; 0x80069a 121d2: 70 91 9b 06 lds r23, 0x069B ; 0x80069b 121d6: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 121da: 90 91 9d 06 lds r25, 0x069D ; 0x80069d 121de: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 121e2: 87 ff sbrs r24, 7 121e4: 10 c0 rjmp .+32 ; 0x12206 current_position[Z_AXIS] = init_z_bckp; 121e6: c0 92 9a 06 sts 0x069A, r12 ; 0x80069a 121ea: d0 92 9b 06 sts 0x069B, r13 ; 0x80069b 121ee: e0 92 9c 06 sts 0x069C, r14 ; 0x80069c 121f2: f0 92 9d 06 sts 0x069D, r15 ; 0x80069d plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 121f6: 65 e5 ldi r22, 0x55 ; 85 121f8: 75 e5 ldi r23, 0x55 ; 85 121fa: 85 e5 ldi r24, 0x55 ; 85 121fc: 91 e4 ldi r25, 0x41 ; 65 121fe: 0f 94 49 c0 call 0x38092 ; 0x38092 st_synchronize(); 12202: 0f 94 e8 42 call 0x285d0 ; 0x285d0 } // Move to XY position of the sensor point. current_position[X_AXIS] = x_pos; 12206: 68 89 ldd r22, Y+16 ; 0x10 12208: 79 89 ldd r23, Y+17 ; 0x11 1220a: 8a 89 ldd r24, Y+18 ; 0x12 1220c: 9b 89 ldd r25, Y+19 ; 0x13 1220e: 60 93 92 06 sts 0x0692, r22 ; 0x800692 12212: 70 93 93 06 sts 0x0693, r23 ; 0x800693 12216: 80 93 94 06 sts 0x0694, r24 ; 0x800694 1221a: 90 93 95 06 sts 0x0695, r25 ; 0x800695 current_position[Y_AXIS] = y_pos; 1221e: 80 92 96 06 sts 0x0696, r8 ; 0x800696 12222: 90 92 97 06 sts 0x0697, r9 ; 0x800697 12226: a0 92 98 06 sts 0x0698, r10 ; 0x800698 1222a: b0 92 99 06 sts 0x0699, r11 ; 0x800699 world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 1222e: 66 e9 ldi r22, 0x96 ; 150 12230: 76 e0 ldi r23, 0x06 ; 6 12232: 82 e9 ldi r24, 0x92 ; 146 12234: 96 e0 ldi r25, 0x06 ; 6 12236: 0e 94 aa 6a call 0xd554 ; 0xd554 plan_buffer_line_curposXYZE(XY_AXIS_FEEDRATE); 1223a: 60 e0 ldi r22, 0x00 ; 0 1223c: 70 e0 ldi r23, 0x00 ; 0 1223e: 86 e1 ldi r24, 0x16 ; 22 12240: 93 e4 ldi r25, 0x43 ; 67 12242: 0f 94 49 c0 call 0x38092 ; 0x38092 st_synchronize(); 12246: 0f 94 e8 42 call 0x285d0 ; 0x285d0 if (planner_aborted) 1224a: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 1224e: 88 23 and r24, r24 12250: 39 f0 breq .+14 ; 0x12260 { custom_message_type = custom_message_type_old; 12252: 7f 81 ldd r23, Y+7 ; 0x07 12254: 70 93 c4 06 sts 0x06C4, r23 ; 0x8006c4 custom_message_state = custom_message_state_old; 12258: 88 85 ldd r24, Y+8 ; 0x08 1225a: 80 93 f7 03 sts 0x03F7, r24 ; 0x8003f7 1225e: fb cc rjmp .-1546 ; 0x11c56 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 12260: 81 2c mov r8, r1 12262: 91 2c mov r9, r1 12264: 70 e2 ldi r23, 0x20 ; 32 12266: a7 2e mov r10, r23 12268: 71 ec ldi r23, 0xC1 ; 193 1226a: b7 2e mov r11, r23 1226c: 22 20 and r2, r2 1226e: 51 f0 breq .+20 ; 0x12284 12270: 2a 81 ldd r18, Y+2 ; 0x02 12272: 3b 81 ldd r19, Y+3 ; 0x03 12274: 4c 81 ldd r20, Y+4 ; 0x04 12276: 5d 81 ldd r21, Y+5 ; 0x05 12278: c3 01 movw r24, r6 1227a: b2 01 movw r22, r4 1227c: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 12280: 4b 01 movw r8, r22 12282: 5c 01 movw r10, r24 12284: 48 8d ldd r20, Y+24 ; 0x18 12286: c5 01 movw r24, r10 12288: b4 01 movw r22, r8 1228a: 0f 94 57 8c call 0x318ae ; 0x318ae 1228e: 81 11 cpse r24, r1 12290: 0b c0 rjmp .+22 ; 0x122a8 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)); 12292: 81 e5 ldi r24, 0x51 ; 81 12294: 94 e6 ldi r25, 0x64 ; 100 12296: 0e 94 ac 72 call 0xe558 ; 0xe558 1229a: 9f 93 push r25 1229c: 8f 93 push r24 1229e: 0f 94 de da call 0x3b5bc ; 0x3b5bc 122a2: 0f 90 pop r0 122a4: 0f 90 pop r0 122a6: be ce rjmp .-644 ; 0x12024 // 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. 122a8: 20 91 9a 06 lds r18, 0x069A ; 0x80069a 122ac: 30 91 9b 06 lds r19, 0x069B ; 0x80069b 122b0: 40 91 9c 06 lds r20, 0x069C ; 0x80069c 122b4: 50 91 9d 06 lds r21, 0x069D ; 0x80069d 122b8: c7 01 movw r24, r14 122ba: b6 01 movw r22, r12 122bc: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 122c0: 20 e0 ldi r18, 0x00 ; 0 122c2: 30 e0 ldi r19, 0x00 ; 0 122c4: a9 01 movw r20, r18 122c6: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 122ca: 87 ff sbrs r24, 7 122cc: 36 c0 rjmp .+108 ; 0x1233a current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 122ce: 60 e0 ldi r22, 0x00 ; 0 122d0: 70 e0 ldi r23, 0x00 ; 0 122d2: 80 ea ldi r24, 0xA0 ; 160 122d4: 90 e4 ldi r25, 0x40 ; 64 122d6: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a 122da: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b 122de: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c 122e2: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 122e6: 65 e5 ldi r22, 0x55 ; 85 122e8: 75 e5 ldi r23, 0x55 ; 85 122ea: 85 e5 ldi r24, 0x55 ; 85 122ec: 91 e4 ldi r25, 0x41 ; 65 122ee: 0f 94 49 c0 call 0x38092 ; 0x38092 st_synchronize(); 122f2: 0f 94 e8 42 call 0x285d0 ; 0x285d0 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 122f6: 48 8d ldd r20, Y+24 ; 0x18 122f8: c5 01 movw r24, r10 122fa: b4 01 movw r22, r8 122fc: 0f 94 57 8c call 0x318ae ; 0x318ae 12300: 88 23 and r24, r24 12302: 39 f2 breq .-114 ; 0x12292 printf_P(_T(MSG_BED_LEVELING_FAILED_POINT_LOW)); break; } if (MESH_HOME_Z_SEARCH - current_position[Z_AXIS] < 0.1f) { 12304: 20 91 9a 06 lds r18, 0x069A ; 0x80069a 12308: 30 91 9b 06 lds r19, 0x069B ; 0x80069b 1230c: 40 91 9c 06 lds r20, 0x069C ; 0x80069c 12310: 50 91 9d 06 lds r21, 0x069D ; 0x80069d 12314: 60 e0 ldi r22, 0x00 ; 0 12316: 70 e0 ldi r23, 0x00 ; 0 12318: 80 ea ldi r24, 0xA0 ; 160 1231a: 90 e4 ldi r25, 0x40 ; 64 1231c: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 12320: 2d ec ldi r18, 0xCD ; 205 12322: 3c ec ldi r19, 0xCC ; 204 12324: 4c ec ldi r20, 0xCC ; 204 12326: 5d e3 ldi r21, 0x3D ; 61 12328: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 1232c: 87 ff sbrs r24, 7 1232e: 05 c0 rjmp .+10 ; 0x1233a puts_P(PSTR("Bed leveling failed. Sensor triggered too soon")); 12330: 8d ec ldi r24, 0xCD ; 205 12332: 9c e7 ldi r25, 0x7C ; 124 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")); 12334: 0f 94 05 db call 0x3b60a ; 0x3b60a 12338: 75 ce rjmp .-790 ; 0x12024 1233a: c0 90 9a 06 lds r12, 0x069A ; 0x80069a 1233e: d0 90 9b 06 lds r13, 0x069B ; 0x80069b 12342: e0 90 9c 06 lds r14, 0x069C ; 0x80069c 12346: f0 90 9d 06 lds r15, 0x069D ; 0x80069d 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 1234a: 22 20 and r2, r2 1234c: a1 f0 breq .+40 ; 0x12376 1234e: a7 01 movw r20, r14 12350: 96 01 movw r18, r12 12352: c3 01 movw r24, r6 12354: b2 01 movw r22, r4 12356: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 1235a: 9b 01 movw r18, r22 1235c: ac 01 movw r20, r24 1235e: 5f 77 andi r21, 0x7F ; 127 12360: 6a 81 ldd r22, Y+2 ; 0x02 12362: 7b 81 ldd r23, Y+3 ; 0x03 12364: 8c 81 ldd r24, Y+4 ; 0x04 12366: 9d 81 ldd r25, Y+5 ; 0x05 12368: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 1236c: 87 ff sbrs r24, 7 1236e: 03 c0 rjmp .+6 ; 0x12376 puts_P(PSTR("Bed leveling failed. Too much variation from eeprom mesh")); 12370: 84 e9 ldi r24, 0x94 ; 148 12372: 9c e7 ldi r25, 0x7C ; 124 12374: df cf rjmp .-66 ; 0x12334 } #ifdef PINDA_THERMISTOR float temp_compensation_pinda_thermistor_offset(float temperature_pinda) { if (!eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE)) return 0; 12376: 8f ea ldi r24, 0xAF ; 175 12378: 9f e0 ldi r25, 0x0F ; 15 1237a: 0f 94 1c dc call 0x3b838 ; 0x3b838 1237e: 88 23 and r24, r24 12380: 09 f4 brne .+2 ; 0x12384 12382: 40 c0 rjmp .+128 ; 0x12404 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); } 12384: 86 ea ldi r24, 0xA6 ; 166 12386: 9f e0 ldi r25, 0x0F ; 15 12388: 0f 94 1c dc call 0x3b838 ; 0x3b838 if (!calibration_status_pinda()) return 0; 1238c: 88 23 and r24, r24 1238e: d1 f1 breq .+116 ; 0x12404 return temp_comp_interpolation(temperature_pinda) / cs.axis_steps_per_mm[Z_AXIS]; 12390: 60 91 99 03 lds r22, 0x0399 ; 0x800399 12394: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 12398: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 1239c: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 123a0: 0e 94 8a 5c call 0xb914 ; 0xb914 123a4: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 123a8: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 123ac: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 123b0: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 123b4: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 123b8: 9b 01 movw r18, r22 123ba: ac 01 movw r20, r24 123bc: e7 e0 ldi r30, 0x07 ; 7 123be: ae 85 ldd r26, Y+14 ; 0x0e 123c0: bf 85 ldd r27, Y+15 ; 0x0f 123c2: ea 9f mul r30, r26 123c4: c0 01 movw r24, r0 123c6: eb 9f mul r30, r27 123c8: 90 0d add r25, r0 123ca: 11 24 eor r1, r1 123cc: 08 0f add r16, r24 123ce: 19 1f adc r17, r25 123d0: 00 0f add r16, r16 123d2: 11 1f adc r17, r17 123d4: 00 0f add r16, r16 123d6: 11 1f adc r17, r17 123d8: 0e 53 subi r16, 0x3E ; 62 123da: 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; 123dc: c7 01 movw r24, r14 123de: b6 01 movw r22, r12 123e0: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 123e4: d8 01 movw r26, r16 123e6: 11 96 adiw r26, 0x01 ; 1 123e8: 6d 93 st X+, r22 123ea: 7d 93 st X+, r23 123ec: 8d 93 st X+, r24 123ee: 9c 93 st X, r25 123f0: 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--; 123f2: 80 91 f7 03 lds r24, 0x03F7 ; 0x8003f7 123f6: 81 50 subi r24, 0x01 ; 1 123f8: 80 93 f7 03 sts 0x03F7, r24 ; 0x8003f7 mesh_point++; lcd_update(1); 123fc: 81 e0 ldi r24, 0x01 ; 1 123fe: 0e 94 a7 6e call 0xdd4e ; 0xdd4e 12402: 0c ce rjmp .-1000 ; 0x1201c } #ifdef PINDA_THERMISTOR float temp_compensation_pinda_thermistor_offset(float temperature_pinda) { if (!eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE)) return 0; 12404: 20 e0 ldi r18, 0x00 ; 0 12406: 30 e0 ldi r19, 0x00 ; 0 12408: a9 01 movw r20, r18 1240a: d8 cf rjmp .-80 ; 0x123bc 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); 1240c: 85 e0 ldi r24, 0x05 ; 5 1240e: 0f 94 07 4e call 0x29c0e ; 0x29c0e 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; 12412: c1 2c mov r12, r1 12414: d1 2c mov r13, r1 12416: 90 ea ldi r25, 0xA0 ; 160 12418: e9 2e mov r14, r25 1241a: 90 e4 ldi r25, 0x40 ; 64 1241c: 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)); 1241e: 82 e1 ldi r24, 0x12 ; 18 12420: 96 e3 ldi r25, 0x36 ; 54 12422: 0e 94 ac 72 call 0xe558 ; 0xe558 12426: 0f 94 e4 1f call 0x23fc8 ; 0x23fc8 #ifdef TMC2130 lcd_wait_for_click_delay(MSG_BED_LEVELING_FAILED_TIMEOUT); 1242a: 8e e1 ldi r24, 0x1E ; 30 1242c: 90 e0 ldi r25, 0x00 ; 0 1242e: 0f 94 2f 3a call 0x2745e ; 0x2745e calibrate_z_auto(); // Z-leveling (X-assembly stay up!!!) 12432: 0e 94 3e 73 call 0xe67c ; 0xe67c #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); 12436: 80 e0 ldi r24, 0x00 ; 0 12438: 0f 94 e2 4d call 0x29bc4 ; 0x29bc4 1243c: 18 2f mov r17, r24 raise_z(-1); 1243e: 60 e0 ldi r22, 0x00 ; 0 12440: 70 e0 ldi r23, 0x00 ; 0 12442: 80 e8 ldi r24, 0x80 ; 128 12444: 9f eb ldi r25, 0xBF ; 191 12446: 0e 94 e1 6d call 0xdbc2 ; 0xdbc2 enable_z_endstop(true); 1244a: 81 e0 ldi r24, 0x01 ; 1 1244c: 0f 94 e2 4d call 0x29bc4 ; 0x29bc4 #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); 12450: 84 e0 ldi r24, 0x04 ; 4 12452: 0f 94 d8 25 call 0x24bb0 ; 0x24bb0 #endif // TMC2130 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 12456: c0 92 9a 06 sts 0x069A, r12 ; 0x80069a 1245a: d0 92 9b 06 sts 0x069B, r13 ; 0x80069b 1245e: e0 92 9c 06 sts 0x069C, r14 ; 0x80069c 12462: f0 92 9d 06 sts 0x069D, r15 ; 0x80069d plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 12466: 65 e5 ldi r22, 0x55 ; 85 12468: 75 e5 ldi r23, 0x55 ; 85 1246a: 85 e5 ldi r24, 0x55 ; 85 1246c: 91 e4 ldi r25, 0x41 ; 65 1246e: 0f 94 49 c0 call 0x38092 ; 0x38092 st_synchronize(); 12472: 0f 94 e8 42 call 0x285d0 ; 0x285d0 #ifdef TMC2130 tmc2130_home_exit(); 12476: 0f 94 a9 25 call 0x24b52 ; 0x24b52 #endif // TMC2130 enable_z_endstop(bState); 1247a: 81 2f mov r24, r17 1247c: 0f 94 e2 4d call 0x29bc4 ; 0x29bc4 } while (st_get_position_mm(Z_AXIS) > MESH_HOME_Z_SEARCH); // i.e. Z-leveling not o.k. 12480: 82 e0 ldi r24, 0x02 ; 2 12482: 0f 94 d4 42 call 0x285a8 ; 0x285a8 12486: 20 e0 ldi r18, 0x00 ; 0 12488: 30 e0 ldi r19, 0x00 ; 0 1248a: 40 ea ldi r20, 0xA0 ; 160 1248c: 50 e4 ldi r21, 0x40 ; 64 1248e: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 12492: 18 16 cp r1, r24 12494: 24 f2 brlt .-120 ; 0x1241e custom_message_type = custom_message_type_old; 12496: ef 81 ldd r30, Y+7 ; 0x07 12498: e0 93 c4 06 sts 0x06C4, r30 ; 0x8006c4 custom_message_state = custom_message_state_old; 1249c: f8 85 ldd r31, Y+8 ; 0x08 1249e: f0 93 f7 03 sts 0x03F7, r31 ; 0x8003f7 lcd_update_enable(true); // display / status-line recovery 124a2: 81 e0 ldi r24, 0x01 ; 1 124a4: 0e 94 25 6f call 0xde4a ; 0xde4a gcode_G28(true, true, true); // X & Y & Z-homing (must be after individual Z-homing (problem with spool-holder)!) 124a8: 41 e0 ldi r20, 0x01 ; 1 124aa: 61 e0 ldi r22, 0x01 ; 1 124ac: 81 e0 ldi r24, 0x01 ; 1 124ae: 0e 94 05 7f call 0xfe0a ; 0xfe0a 124b2: 81 e0 ldi r24, 0x01 ; 1 124b4: 80 93 a2 10 sts 0x10A2, r24 ; 0x8010a2 124b8: ce cb rjmp .-2148 ; 0x11c56 repeatcommand_front(); // re-run (i.e. of "G80") return; } g80_fail_cnt = 0; // no fail was detected. Reset the error counter. 124ba: 10 92 6a 03 sts 0x036A, r1 ; 0x80036a clean_up_after_endstop_move(l_feedmultiply); 124be: 8b a1 ldd r24, Y+35 ; 0x23 124c0: 9c a1 ldd r25, Y+36 ; 0x24 124c2: 0e 94 ce 66 call 0xcd9c ; 0xcd9c } } void babystep_apply() { babystep_load(); 124c6: 0f 94 85 c9 call 0x3930a ; 0x3930a shift_z(- float(babystepLoadZ) / float(cs.axis_steps_per_mm[Z_AXIS])); 124ca: 60 91 8a 06 lds r22, 0x068A ; 0x80068a <_ZL13babystepLoadZ.lto_priv.497> 124ce: 70 91 8b 06 lds r23, 0x068B ; 0x80068b <_ZL13babystepLoadZ.lto_priv.497+0x1> 124d2: 07 2e mov r0, r23 124d4: 00 0c add r0, r0 124d6: 88 0b sbc r24, r24 124d8: 99 0b sbc r25, r25 124da: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 124de: 90 58 subi r25, 0x80 ; 128 124e0: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 124e4: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 124e8: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 124ec: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 124f0: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 124f4: 0f 94 a1 c9 call 0x39342 ; 0x39342 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; 124f8: 80 ec ldi r24, 0xC0 ; 192 124fa: 9f e0 ldi r25, 0x0F ; 15 124fc: 0f 94 1c dc call 0x3b838 ; 0x3b838 12500: 91 e0 ldi r25, 0x01 ; 1 12502: 81 30 cpi r24, 0x01 ; 1 12504: 09 f0 breq .+2 ; 0x12508 12506: 90 e0 ldi r25, 0x00 ; 0 } } else if (eeprom_bed_correction_valid) { return (int8_t)eeprom_read_byte(eep_address); } return 0; }; 12508: 99 83 std Y+1, r25 ; 0x01 const int8_t correction[4] = { bedCorrectHelper('L', (uint8_t*)EEPROM_BED_CORRECTION_LEFT), 1250a: 4f eb ldi r20, 0xBF ; 191 1250c: 5f e0 ldi r21, 0x0F ; 15 1250e: 6c e4 ldi r22, 0x4C ; 76 12510: ce 01 movw r24, r28 12512: 01 96 adiw r24, 0x01 ; 1 12514: 0e 94 eb 5b call 0xb7d6 ; 0xb7d6 12518: f8 2e mov r15, r24 bedCorrectHelper('R', (uint8_t*)EEPROM_BED_CORRECTION_RIGHT), 1251a: 4e eb ldi r20, 0xBE ; 190 1251c: 5f e0 ldi r21, 0x0F ; 15 1251e: 62 e5 ldi r22, 0x52 ; 82 12520: ce 01 movw r24, r28 12522: 01 96 adiw r24, 0x01 ; 1 12524: 0e 94 eb 5b call 0xb7d6 ; 0xb7d6 12528: 08 2f mov r16, r24 bedCorrectHelper('F', (uint8_t*)EEPROM_BED_CORRECTION_FRONT), 1252a: 4d eb ldi r20, 0xBD ; 189 1252c: 5f e0 ldi r21, 0x0F ; 15 1252e: 66 e4 ldi r22, 0x46 ; 70 12530: ce 01 movw r24, r28 12532: 01 96 adiw r24, 0x01 ; 1 12534: 0e 94 eb 5b call 0xb7d6 ; 0xb7d6 12538: 18 2f mov r17, r24 bedCorrectHelper('B', (uint8_t*)EEPROM_BED_CORRECTION_REAR), 1253a: 4c eb ldi r20, 0xBC ; 188 1253c: 5f e0 ldi r21, 0x0F ; 15 1253e: 62 e4 ldi r22, 0x42 ; 66 12540: ce 01 movw r24, r28 12542: 01 96 adiw r24, 0x01 ; 1 12544: 0e 94 eb 5b call 0xb7d6 ; 0xb7d6 12548: 21 2f mov r18, r17 1254a: 11 0f add r17, r17 1254c: 33 0b sbc r19, r19 1254e: 08 2e mov r0, r24 12550: 00 0c add r0, r0 12552: 99 0b sbc r25, r25 12554: 5c 01 movw r10, r24 12556: a2 1a sub r10, r18 12558: b3 0a sbc r11, r19 1255a: 8f 2d mov r24, r15 1255c: ff 0c add r15, r15 1255e: 99 0b sbc r25, r25 12560: 28 0f add r18, r24 12562: 39 1f adc r19, r25 12564: 46 e0 ldi r20, 0x06 ; 6 12566: 42 9f mul r20, r18 12568: 60 01 movw r12, r0 1256a: 43 9f mul r20, r19 1256c: d0 0c add r13, r0 1256e: 11 24 eor r1, r1 12570: f1 2c mov r15, r1 12572: e1 2c mov r14, r1 12574: 00 2e mov r0, r16 12576: 00 0c add r0, r0 12578: 11 0b sbc r17, r17 1257a: 08 1b sub r16, r24 1257c: 19 0b sbc r17, r25 1257e: b7 01 movw r22, r14 12580: 6d 53 subi r22, 0x3D ; 61 12582: 7c 4e sbci r23, 0xEC ; 236 12584: 3b 01 movw r6, r22 12586: 46 01 movw r8, r12 12588: 77 e0 ldi r23, 0x07 ; 7 1258a: 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 * ( 1258c: d3 01 movw r26, r6 1258e: 2d 90 ld r2, X+ 12590: 3d 90 ld r3, X+ 12592: 4d 90 ld r4, X+ 12594: 5d 90 ld r5, X+ 12596: 3d 01 movw r6, r26 12598: fd 01 movw r30, r26 1259a: 34 97 sbiw r30, 0x04 ; 4 1259c: fb 87 std Y+11, r31 ; 0x0b 1259e: ea 87 std Y+10, r30 ; 0x0a 125a0: b4 01 movw r22, r8 125a2: 09 2c mov r0, r9 125a4: 00 0c add r0, r0 125a6: 88 0b sbc r24, r24 125a8: 99 0b sbc r25, r25 125aa: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 125ae: 2f e3 ldi r18, 0x3F ; 63 125b0: 33 ec ldi r19, 0xC3 ; 195 125b2: 4e e2 ldi r20, 0x2E ; 46 125b4: 59 e3 ldi r21, 0x39 ; 57 125b6: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 125ba: a2 01 movw r20, r4 125bc: 91 01 movw r18, r2 125be: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 125c2: aa 85 ldd r26, Y+10 ; 0x0a 125c4: bb 85 ldd r27, Y+11 ; 0x0b 125c6: 6d 93 st X+, r22 125c8: 7d 93 st X+, r23 125ca: 8d 93 st X+, r24 125cc: 9c 93 st X, r25 125ce: 13 97 sbiw r26, 0x03 ; 3 125d0: ba 81 ldd r27, Y+2 ; 0x02 125d2: b1 50 subi r27, 0x01 ; 1 125d4: ba 83 std Y+2, r27 ; 0x02 125d6: 80 0e add r8, r16 125d8: 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++) { 125da: b1 11 cpse r27, r1 125dc: d7 cf rjmp .-82 ; 0x1258c 125de: ca 0c add r12, r10 125e0: db 1c adc r13, r11 125e2: ec e1 ldi r30, 0x1C ; 28 125e4: ee 0e add r14, r30 125e6: 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++) { 125e8: f4 ec ldi r31, 0xC4 ; 196 125ea: ef 16 cp r14, r31 125ec: f1 04 cpc r15, r1 125ee: 39 f6 brne .-114 ; 0x1257e + 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) 125f0: 0f 94 f6 a2 call 0x345ec ; 0x345ec { // apply magnet compensation uint8_t useMagnetCompensation = code_seen('M') ? code_value_uint8() : eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION); 125f4: 8d e4 ldi r24, 0x4D ; 77 125f6: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 125fa: 88 23 and r24, r24 125fc: 09 f4 brne .+2 ; 0x12600 125fe: 84 c0 rjmp .+264 ; 0x12708 12600: 0e 94 68 5b call 0xb6d0 ; 0xb6d0 if (nMeasPoints == 7 && useMagnetCompensation) { 12604: 2e 81 ldd r18, Y+6 ; 0x06 12606: 27 30 cpi r18, 0x07 ; 7 12608: 09 f0 breq .+2 ; 0x1260c 1260a: 94 c0 rjmp .+296 ; 0x12734 1260c: 88 23 and r24, r24 1260e: 09 f4 brne .+2 ; 0x12612 12610: 91 c0 rjmp .+290 ; 0x12734 12612: bb 24 eor r11, r11 12614: b3 94 inc r11 12616: aa 24 eor r10, r10 12618: aa 94 dec r10 1261a: ab 0c add r10, r11 1261c: 09 a1 ldd r16, Y+33 ; 0x21 1261e: 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++) { 12620: 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++; } 12622: 8e ef ldi r24, 0xFE ; 254 12624: 88 2e mov r8, r24 12626: 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)) { 12628: 6a 2d mov r22, r10 1262a: 86 2d mov r24, r6 1262c: 0f 94 50 c9 call 0x392a0 ; 0x392a0 12630: 99 24 eor r9, r9 12632: 93 94 inc r9 12634: 96 0c add r9, r6 12636: 81 11 cpse r24, r1 12638: 6e c0 rjmp .+220 ; 0x12716 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++; } 1263a: 6b 2d mov r22, r11 1263c: 86 2d mov r24, r6 1263e: 0f 94 50 c9 call 0x392a0 ; 0x392a0 } 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; 12642: c1 2c mov r12, r1 12644: d1 2c mov r13, r1 12646: 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; 12648: 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++; } 1264a: 88 23 and r24, r24 1264c: 81 f0 breq .+32 ; 0x1266e 1264e: 20 e0 ldi r18, 0x00 ; 0 12650: 30 e0 ldi r19, 0x00 ; 0 12652: a9 01 movw r20, r18 12654: d8 01 movw r26, r16 12656: 5d 96 adiw r26, 0x1d ; 29 12658: 6d 91 ld r22, X+ 1265a: 7d 91 ld r23, X+ 1265c: 8d 91 ld r24, X+ 1265e: 9c 91 ld r25, X 12660: 90 97 sbiw r26, 0x20 ; 32 12662: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 12666: 6b 01 movw r12, r22 12668: 7c 01 movw r14, r24 1266a: 77 24 eor r7, r7 1266c: 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++; } 1266e: 68 2d mov r22, r8 12670: 86 2d mov r24, r6 12672: 0f 94 50 c9 call 0x392a0 ; 0x392a0 12676: 88 23 and r24, r24 12678: 69 f0 breq .+26 ; 0x12694 1267a: f8 01 movw r30, r16 1267c: 7b 97 sbiw r30, 0x1b ; 27 1267e: 20 81 ld r18, Z 12680: 31 81 ldd r19, Z+1 ; 0x01 12682: 42 81 ldd r20, Z+2 ; 0x02 12684: 53 81 ldd r21, Z+3 ; 0x03 12686: c7 01 movw r24, r14 12688: b6 01 movw r22, r12 1268a: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 1268e: 6b 01 movw r12, r22 12690: 7c 01 movw r14, r24 12692: 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++; } 12694: 6a 2d mov r22, r10 12696: 89 2d mov r24, r9 12698: 0f 94 50 c9 call 0x392a0 ; 0x392a0 1269c: 88 23 and r24, r24 1269e: 61 f0 breq .+24 ; 0x126b8 126a0: f8 01 movw r30, r16 126a2: 25 81 ldd r18, Z+5 ; 0x05 126a4: 36 81 ldd r19, Z+6 ; 0x06 126a6: 47 81 ldd r20, Z+7 ; 0x07 126a8: 50 85 ldd r21, Z+8 ; 0x08 126aa: c7 01 movw r24, r14 126ac: b6 01 movw r22, r12 126ae: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 126b2: 6b 01 movw r12, r22 126b4: 7c 01 movw r14, r24 126b6: 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++; } 126b8: 6a 2d mov r22, r10 126ba: 8f ef ldi r24, 0xFF ; 255 126bc: 86 0d add r24, r6 126be: 0f 94 50 c9 call 0x392a0 ; 0x392a0 126c2: 88 23 and r24, r24 126c4: 31 f1 breq .+76 ; 0x12712 126c6: f8 01 movw r30, r16 126c8: 33 97 sbiw r30, 0x03 ; 3 126ca: 20 81 ld r18, Z 126cc: 31 81 ldd r19, Z+1 ; 0x01 126ce: 42 81 ldd r20, Z+2 ; 0x02 126d0: 53 81 ldd r21, Z+3 ; 0x03 126d2: c7 01 movw r24, r14 126d4: b6 01 movw r22, r12 126d6: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 126da: 6b 01 movw r12, r22 126dc: 7c 01 movw r14, r24 126de: 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 126e0: 67 2d mov r22, r7 126e2: 70 e0 ldi r23, 0x00 ; 0 126e4: 90 e0 ldi r25, 0x00 ; 0 126e6: 80 e0 ldi r24, 0x00 ; 0 126e8: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 126ec: 9b 01 movw r18, r22 126ee: ac 01 movw r20, r24 126f0: c7 01 movw r24, r14 126f2: b6 01 movw r22, r12 126f4: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 126f8: d8 01 movw r26, r16 126fa: 11 96 adiw r26, 0x01 ; 1 126fc: 6d 93 st X+, r22 126fe: 7d 93 st X+, r23 12700: 8d 93 st X+, r24 12702: 9c 93 st X, r25 12704: 14 97 sbiw r26, 0x04 ; 4 12706: 07 c0 rjmp .+14 ; 0x12716 } 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); 12708: 8c ea ldi r24, 0xAC ; 172 1270a: 9d e0 ldi r25, 0x0D ; 13 1270c: 0f 94 1c dc call 0x3b838 ; 0x3b838 12710: 79 cf rjmp .-270 ; 0x12604 12712: 71 10 cpse r7, r1 12714: e5 cf rjmp .-54 ; 0x126e0 //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++) { 12716: 69 2c mov r6, r9 12718: 0c 5f subi r16, 0xFC ; 252 1271a: 1f 4f sbci r17, 0xFF ; 255 1271c: b7 e0 ldi r27, 0x07 ; 7 1271e: 9b 12 cpse r9, r27 12720: 83 cf rjmp .-250 ; 0x12628 12722: b3 94 inc r11 12724: e9 a1 ldd r30, Y+33 ; 0x21 12726: fa a1 ldd r31, Y+34 ; 0x22 12728: 7c 96 adiw r30, 0x1c ; 28 1272a: fa a3 std Y+34, r31 ; 0x22 1272c: 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++) { 1272e: f8 e0 ldi r31, 0x08 ; 8 12730: bf 12 cpse r11, r31 12732: 71 cf rjmp .-286 ; 0x12616 if (nMeasPoints == 7 && useMagnetCompensation) { mbl_magnet_elimination(); } } mbl.active = 1; //activate mesh bed leveling 12734: 81 e0 ldi r24, 0x01 ; 1 12736: 80 93 c2 13 sts 0x13C2, r24 ; 0x8013c2 if (code_seen('O') && !code_value_uint8()) { 1273a: 8f e4 ldi r24, 0x4F ; 79 1273c: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 12740: 81 11 cpse r24, r1 12742: 03 c0 rjmp .+6 ; 0x1274a // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); } else { go_home_with_z_lift(); 12744: 0f 94 f6 c9 call 0x393ec ; 0x393ec 12748: 9b cc rjmp .-1738 ; 0x12080 } } mbl.active = 1; //activate mesh bed leveling if (code_seen('O') && !code_value_uint8()) { 1274a: 0e 94 68 5b call 0xb6d0 ; 0xb6d0 1274e: 81 11 cpse r24, r1 12750: f9 cf rjmp .-14 ; 0x12744 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 12752: 0e 94 c3 66 call 0xcd86 ; 0xcd86 12756: 94 cc rjmp .-1752 ; 0x12080 00012758 : //! @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() { 12758: 4f 92 push r4 1275a: 5f 92 push r5 1275c: 6f 92 push r6 1275e: 7f 92 push r7 12760: 8f 92 push r8 12762: 9f 92 push r9 12764: af 92 push r10 12766: bf 92 push r11 12768: ef 92 push r14 1276a: ff 92 push r15 1276c: 0f 93 push r16 1276e: 1f 93 push r17 12770: cf 93 push r28 12772: df 93 push r29 12774: 1f 92 push r1 12776: cd b7 in r28, 0x3d ; 61 12778: de b7 in r29, 0x3e ; 62 eeprom_read_block(reinterpret_cast(cs.version), reinterpret_cast(EEPROM_M500_base->version), sizeof(cs.version)); 1277a: 44 e0 ldi r20, 0x04 ; 4 1277c: 50 e0 ldi r21, 0x00 ; 0 1277e: 64 e1 ldi r22, 0x14 ; 20 12780: 70 e0 ldi r23, 0x00 ; 0 12782: 8e eb ldi r24, 0xBE ; 190 12784: 9d e0 ldi r25, 0x0D ; 13 12786: 0f 94 0c dc call 0x3b818 ; 0x3b818 // SERIAL_ECHOLN("Version: [" << ver << "] Stored version: [" << cs.version << "]"); if (strncmp_P(cs.version, default_conf.version, sizeof(EEPROM_VERSION)) == 0) // version number match 1278a: 43 e0 ldi r20, 0x03 ; 3 1278c: 50 e0 ldi r21, 0x00 ; 0 1278e: 63 e2 ldi r22, 0x23 ; 35 12790: 78 e7 ldi r23, 0x78 ; 120 12792: 8e eb ldi r24, 0xBE ; 190 12794: 9d e0 ldi r25, 0x0D ; 13 12796: 0f 94 fb d9 call 0x3b3f6 ; 0x3b3f6 1279a: 89 2b or r24, r25 1279c: 09 f0 breq .+2 ; 0x127a0 1279e: a0 c1 rjmp .+832 ; 0x12ae0 { // 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)); 127a0: e7 ee ldi r30, 0xE7 ; 231 127a2: f8 e7 ldi r31, 0x78 ; 120 127a4: 45 91 lpm r20, Z+ 127a6: 55 91 lpm r21, Z+ 127a8: 65 91 lpm r22, Z+ 127aa: 74 91 lpm r23, Z 127ac: 88 ed ldi r24, 0xD8 ; 216 127ae: 90 e0 ldi r25, 0x00 ; 0 127b0: 0e 94 27 64 call 0xc84e ; 0xc84e eeprom_init_default_float(&EEPROM_M500_base->min_mm_per_arc_segment, pgm_read_float(&default_conf.min_mm_per_arc_segment)); 127b4: eb ee ldi r30, 0xEB ; 235 127b6: f8 e7 ldi r31, 0x78 ; 120 127b8: 45 91 lpm r20, Z+ 127ba: 55 91 lpm r21, Z+ 127bc: 65 91 lpm r22, Z+ 127be: 74 91 lpm r23, Z 127c0: 8c ed ldi r24, 0xDC ; 220 127c2: 90 e0 ldi r25, 0x00 ; 0 127c4: 0e 94 27 64 call 0xc84e ; 0xc84e eeprom_init_default_byte(&EEPROM_M500_base->n_arc_correction, pgm_read_byte(&default_conf.n_arc_correction)); 127c8: ef ee ldi r30, 0xEF ; 239 127ca: f8 e7 ldi r31, 0x78 ; 120 127cc: 64 91 lpm r22, Z 127ce: 80 ee ldi r24, 0xE0 ; 224 127d0: 90 e0 ldi r25, 0x00 ; 0 127d2: 0e 94 09 76 call 0xec12 ; 0xec12 eeprom_init_default_word(&EEPROM_M500_base->min_arc_segments, pgm_read_word(&default_conf.min_arc_segments)); 127d6: e0 ef ldi r30, 0xF0 ; 240 127d8: f8 e7 ldi r31, 0x78 ; 120 127da: 65 91 lpm r22, Z+ 127dc: 74 91 lpm r23, Z 127de: 81 ee ldi r24, 0xE1 ; 225 127e0: 90 e0 ldi r25, 0x00 ; 0 127e2: 0e 94 f1 75 call 0xebe2 ; 0xebe2 eeprom_init_default_word(&EEPROM_M500_base->arc_segments_per_sec, pgm_read_word(&default_conf.arc_segments_per_sec)); 127e6: e2 ef ldi r30, 0xF2 ; 242 127e8: f8 e7 ldi r31, 0x78 ; 120 127ea: 65 91 lpm r22, Z+ 127ec: 74 91 lpm r23, Z 127ee: 83 ee ldi r24, 0xE3 ; 227 127f0: 90 e0 ldi r25, 0x00 ; 0 127f2: 0e 94 f1 75 call 0xebe2 ; 0xebe2 // 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)); 127f6: e3 ee ldi r30, 0xE3 ; 227 127f8: f8 e7 ldi r31, 0x78 ; 120 127fa: 45 91 lpm r20, Z+ 127fc: 55 91 lpm r21, Z+ 127fe: 65 91 lpm r22, Z+ 12800: 74 91 lpm r23, Z 12802: 84 ed ldi r24, 0xD4 ; 212 12804: 90 e0 ldi r25, 0x00 ; 0 12806: 0e 94 27 64 call 0xc84e ; 0xc84e // 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); 1280a: 4f eb ldi r20, 0xBF ; 191 1280c: 58 e7 ldi r21, 0x78 ; 120 1280e: 60 e1 ldi r22, 0x10 ; 16 12810: 70 e0 ldi r23, 0x00 ; 0 12812: 80 eb ldi r24, 0xB0 ; 176 12814: 90 e0 ldi r25, 0x00 ; 0 12816: 0e 94 d2 75 call 0xeba4 ; 0xeba4 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); 1281a: 4f ec ldi r20, 0xCF ; 207 1281c: 58 e7 ldi r21, 0x78 ; 120 1281e: 60 e1 ldi r22, 0x10 ; 16 12820: 70 e0 ldi r23, 0x00 ; 0 12822: 80 ec ldi r24, 0xC0 ; 192 12824: 90 e0 ldi r25, 0x00 ; 0 12826: 0e 94 d2 75 call 0xeba4 ; 0xeba4 #ifdef TMC2130 eeprom_init_default_block(&EEPROM_M500_base->axis_ustep_resolution, sizeof(EEPROM_M500_base->axis_ustep_resolution), default_conf.axis_ustep_resolution); 1282a: 4f ed ldi r20, 0xDF ; 223 1282c: 58 e7 ldi r21, 0x78 ; 120 1282e: 64 e0 ldi r22, 0x04 ; 4 12830: 70 e0 ldi r23, 0x00 ; 0 12832: 80 ed ldi r24, 0xD0 ; 208 12834: 90 e0 ldi r25, 0x00 ; 0 12836: 0e 94 d2 75 call 0xeba4 ; 0xeba4 #endif // TMC2130 // load the CS to RAM eeprom_read_block(reinterpret_cast(&cs), reinterpret_cast(EEPROM_M500_base), sizeof(cs)); 1283a: 41 ed ldi r20, 0xD1 ; 209 1283c: 50 e0 ldi r21, 0x00 ; 0 1283e: 64 e1 ldi r22, 0x14 ; 20 12840: 70 e0 ldi r23, 0x00 ; 0 12842: 8e eb ldi r24, 0xBE ; 190 12844: 9d e0 ldi r25, 0x0D ; 13 12846: 0f 94 0c dc call 0x3b818 ; 0x3b818 calculate_extruder_multipliers(); 1284a: 0e 94 b9 65 call 0xcb72 ; 0xcb72 1284e: 0e eb ldi r16, 0xBE ; 190 12850: 1d e0 ldi r17, 0x0D ; 13 12852: 8a e5 ldi r24, 0x5A ; 90 12854: e8 2e mov r14, r24 12856: 8e e0 ldi r24, 0x0E ; 14 12858: 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; 1285a: 94 ec ldi r25, 0xC4 ; 196 1285c: 89 2e mov r8, r25 1285e: 99 e0 ldi r25, 0x09 ; 9 12860: 99 2e mov r9, r25 12862: a1 2c mov r10, r1 12864: 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; 12866: 20 ec ldi r18, 0xC0 ; 192 12868: 42 2e mov r4, r18 1286a: 23 e0 ldi r18, 0x03 ; 3 1286c: 52 2e mov r5, r18 1286e: 61 2c mov r6, r1 12870: 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) 12872: 20 e0 ldi r18, 0x00 ; 0 12874: 30 e0 ldi r19, 0x00 ; 0 12876: 48 e4 ldi r20, 0x48 ; 72 12878: 53 e4 ldi r21, 0x43 ; 67 1287a: f8 01 movw r30, r16 1287c: 64 89 ldd r22, Z+20 ; 0x14 1287e: 75 89 ldd r23, Z+21 ; 0x15 12880: 86 89 ldd r24, Z+22 ; 0x16 12882: 97 89 ldd r25, Z+23 ; 0x17 12884: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 12888: 18 16 cp r1, r24 1288a: 4c f4 brge .+18 ; 0x1289e cs.max_feedrate_normal[j] = NORMAL_MAX_FEEDRATE_XY; 1288c: 80 e0 ldi r24, 0x00 ; 0 1288e: 90 e0 ldi r25, 0x00 ; 0 12890: a8 e4 ldi r26, 0x48 ; 72 12892: b3 e4 ldi r27, 0x43 ; 67 12894: f8 01 movw r30, r16 12896: 84 8b std Z+20, r24 ; 0x14 12898: 95 8b std Z+21, r25 ; 0x15 1289a: a6 8b std Z+22, r26 ; 0x16 1289c: b7 8b std Z+23, r27 ; 0x17 if (cs.max_feedrate_silent[j] > SILENT_MAX_FEEDRATE_XY) 1289e: f7 01 movw r30, r14 128a0: 61 91 ld r22, Z+ 128a2: 71 91 ld r23, Z+ 128a4: 81 91 ld r24, Z+ 128a6: 91 91 ld r25, Z+ 128a8: 7f 01 movw r14, r30 128aa: 20 e0 ldi r18, 0x00 ; 0 128ac: 30 e0 ldi r19, 0x00 ; 0 128ae: 48 ec ldi r20, 0xC8 ; 200 128b0: 52 e4 ldi r21, 0x42 ; 66 128b2: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 128b6: 18 16 cp r1, r24 128b8: 54 f4 brge .+20 ; 0x128ce cs.max_feedrate_silent[j] = SILENT_MAX_FEEDRATE_XY; 128ba: 80 e0 ldi r24, 0x00 ; 0 128bc: 90 e0 ldi r25, 0x00 ; 0 128be: a8 ec ldi r26, 0xC8 ; 200 128c0: b2 e4 ldi r27, 0x42 ; 66 128c2: f7 01 movw r30, r14 128c4: 34 97 sbiw r30, 0x04 ; 4 128c6: 80 83 st Z, r24 128c8: 91 83 std Z+1, r25 ; 0x01 128ca: a2 83 std Z+2, r26 ; 0x02 128cc: b3 83 std Z+3, r27 ; 0x03 if (cs.max_acceleration_mm_per_s2_normal[j] > NORMAL_MAX_ACCEL_XY) 128ce: f8 01 movw r30, r16 128d0: 84 a1 ldd r24, Z+36 ; 0x24 128d2: 95 a1 ldd r25, Z+37 ; 0x25 128d4: a6 a1 ldd r26, Z+38 ; 0x26 128d6: b7 a1 ldd r27, Z+39 ; 0x27 128d8: 85 3c cpi r24, 0xC5 ; 197 128da: 99 40 sbci r25, 0x09 ; 9 128dc: a1 05 cpc r26, r1 128de: b1 05 cpc r27, r1 128e0: 28 f0 brcs .+10 ; 0x128ec cs.max_acceleration_mm_per_s2_normal[j] = NORMAL_MAX_ACCEL_XY; 128e2: f8 01 movw r30, r16 128e4: 84 a2 std Z+36, r8 ; 0x24 128e6: 95 a2 std Z+37, r9 ; 0x25 128e8: a6 a2 std Z+38, r10 ; 0x26 128ea: b7 a2 std Z+39, r11 ; 0x27 if (cs.max_acceleration_mm_per_s2_silent[j] > SILENT_MAX_ACCEL_XY) 128ec: f7 01 movw r30, r14 128ee: 84 85 ldd r24, Z+12 ; 0x0c 128f0: 95 85 ldd r25, Z+13 ; 0x0d 128f2: a6 85 ldd r26, Z+14 ; 0x0e 128f4: b7 85 ldd r27, Z+15 ; 0x0f 128f6: 81 3c cpi r24, 0xC1 ; 193 128f8: 93 40 sbci r25, 0x03 ; 3 128fa: a1 05 cpc r26, r1 128fc: b1 05 cpc r27, r1 128fe: 28 f0 brcs .+10 ; 0x1290a cs.max_acceleration_mm_per_s2_silent[j] = SILENT_MAX_ACCEL_XY; 12900: f7 01 movw r30, r14 12902: 44 86 std Z+12, r4 ; 0x0c 12904: 55 86 std Z+13, r5 ; 0x0d 12906: 66 86 std Z+14, r6 ; 0x0e 12908: 77 86 std Z+15, r7 ; 0x0f 1290a: 0c 5f subi r16, 0xFC ; 252 1290c: 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++) 1290e: fd e0 ldi r31, 0x0D ; 13 12910: 06 3c cpi r16, 0xC6 ; 198 12912: 1f 07 cpc r17, r31 12914: 09 f0 breq .+2 ; 0x12918 12916: ad cf rjmp .-166 ; 0x12872 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]); 12918: 60 91 7a 0e lds r22, 0x0E7A ; 0x800e7a 1291c: 70 e0 ldi r23, 0x00 ; 0 1291e: 80 e0 ldi r24, 0x00 ; 0 12920: 0f 94 fa 24 call 0x249f4 ; 0x249f4 tmc2130_set_res(Y_AXIS, cs.axis_ustep_resolution[Y_AXIS]); 12924: 60 91 7b 0e lds r22, 0x0E7B ; 0x800e7b 12928: 70 e0 ldi r23, 0x00 ; 0 1292a: 81 e0 ldi r24, 0x01 ; 1 1292c: 0f 94 fa 24 call 0x249f4 ; 0x249f4 tmc2130_set_res(Z_AXIS, cs.axis_ustep_resolution[Z_AXIS]); 12930: 60 91 7c 0e lds r22, 0x0E7C ; 0x800e7c 12934: 70 e0 ldi r23, 0x00 ; 0 12936: 82 e0 ldi r24, 0x02 ; 2 12938: 0f 94 fa 24 call 0x249f4 ; 0x249f4 tmc2130_set_res(E_AXIS, cs.axis_ustep_resolution[E_AXIS]); 1293c: 60 91 7d 0e lds r22, 0x0E7D ; 0x800e7d 12940: 70 e0 ldi r23, 0x00 ; 0 12942: 83 e0 ldi r24, 0x03 ; 3 12944: 0f 94 fa 24 call 0x249f4 ; 0x249f4 #endif //TMC2130 reset_acceleration_rates(); 12948: 0f 94 5f 63 call 0x2c6be ; 0x2c6be // Call updatePID (similar to when we have processed M301) updatePID(); 1294c: 0f 94 d3 3a call 0x275a6 ; 0x275a6 } 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; 12950: ce 01 movw r24, r28 12952: 01 96 adiw r24, 0x01 ; 1 12954: 0f 94 9a 31 call 0x26334 ; 0x26334 // 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)); 12958: 44 e3 ldi r20, 0x34 ; 52 1295a: 50 e8 ldi r21, 0x80 ; 128 1295c: 67 eb ldi r22, 0xB7 ; 183 1295e: 7a eb ldi r23, 0xBA ; 186 12960: 82 ea ldi r24, 0xA2 ; 162 12962: 9c e0 ldi r25, 0x0C ; 12 12964: 0e 94 27 64 call 0xc84e ; 0xc84e eeprom_init_default_float((float*)EEPROM_THERMAL_MODEL_V, THERMAL_MODEL_DEF(V)); 12968: 46 e6 ldi r20, 0x66 ; 102 1296a: 56 e6 ldi r21, 0x66 ; 102 1296c: 66 e8 ldi r22, 0x86 ; 134 1296e: 7f e3 ldi r23, 0x3F ; 63 12970: 8e e9 ldi r24, 0x9E ; 158 12972: 9c e0 ldi r25, 0x0C ; 12 12974: 0e 94 27 64 call 0xc84e ; 0xc84e eeprom_init_default_float((float*)EEPROM_THERMAL_MODEL_D, THERMAL_MODEL_DEF(fS)); 12978: 4a e9 ldi r20, 0x9A ; 154 1297a: 59 e9 ldi r21, 0x99 ; 153 1297c: 69 e1 ldi r22, 0x19 ; 25 1297e: 7e e3 ldi r23, 0x3E ; 62 12980: 8a e9 ldi r24, 0x9A ; 154 12982: 9c e0 ldi r25, 0x0C ; 12 12984: 0e 94 27 64 call 0xc84e ; 0xc84e eeprom_init_default_word((uint16_t*)EEPROM_THERMAL_MODEL_L, THERMAL_MODEL_DEF(LAG)); 12988: 6e e0 ldi r22, 0x0E ; 14 1298a: 71 e0 ldi r23, 0x01 ; 1 1298c: 88 e9 ldi r24, 0x98 ; 152 1298e: 9c e0 ldi r25, 0x0C ; 12 12990: 0e 94 f1 75 call 0xebe2 ; 0xebe2 eeprom_init_default_byte((uint8_t*)EEPROM_THERMAL_MODEL_VER, THERMAL_MODEL_DEF(VER)); 12994: 61 e0 ldi r22, 0x01 ; 1 12996: 87 e9 ldi r24, 0x97 ; 151 12998: 9c e0 ldi r25, 0x0C ; 12 1299a: 0e 94 09 76 call 0xec12 ; 0xec12 thermal_model::enabled = eeprom_read_byte((uint8_t*)EEPROM_THERMAL_MODEL_ENABLE); 1299e: 82 e0 ldi r24, 0x02 ; 2 129a0: 9d e0 ldi r25, 0x0D ; 13 129a2: 0f 94 1c dc call 0x3b838 ; 0x3b838 129a6: 91 e0 ldi r25, 0x01 ; 1 129a8: 81 11 cpse r24, r1 129aa: 01 c0 rjmp .+2 ; 0x129ae 129ac: 90 e0 ldi r25, 0x00 ; 0 129ae: 90 93 1d 05 sts 0x051D, r25 ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.456> thermal_model::data.P = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_P); 129b2: 8e ef ldi r24, 0xFE ; 254 129b4: 9c e0 ldi r25, 0x0C ; 12 129b6: 0f 94 24 dc call 0x3b848 ; 0x3b848 129ba: 60 93 da 12 sts 0x12DA, r22 ; 0x8012da <_ZN13thermal_modelL4dataE.lto_priv.400+0x2a> 129be: 70 93 db 12 sts 0x12DB, r23 ; 0x8012db <_ZN13thermal_modelL4dataE.lto_priv.400+0x2b> 129c2: 80 93 dc 12 sts 0x12DC, r24 ; 0x8012dc <_ZN13thermal_modelL4dataE.lto_priv.400+0x2c> 129c6: 90 93 dd 12 sts 0x12DD, r25 ; 0x8012dd <_ZN13thermal_modelL4dataE.lto_priv.400+0x2d> thermal_model::data.U = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_U); 129ca: 82 ea ldi r24, 0xA2 ; 162 129cc: 9c e0 ldi r25, 0x0C ; 12 129ce: 0f 94 24 dc call 0x3b848 ; 0x3b848 129d2: 60 93 de 12 sts 0x12DE, r22 ; 0x8012de <_ZN13thermal_modelL4dataE.lto_priv.400+0x2e> 129d6: 70 93 df 12 sts 0x12DF, r23 ; 0x8012df <_ZN13thermal_modelL4dataE.lto_priv.400+0x2f> 129da: 80 93 e0 12 sts 0x12E0, r24 ; 0x8012e0 <_ZN13thermal_modelL4dataE.lto_priv.400+0x30> 129de: 90 93 e1 12 sts 0x12E1, r25 ; 0x8012e1 <_ZN13thermal_modelL4dataE.lto_priv.400+0x31> thermal_model::data.V = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_V); 129e2: 8e e9 ldi r24, 0x9E ; 158 129e4: 9c e0 ldi r25, 0x0C ; 12 129e6: 0f 94 24 dc call 0x3b848 ; 0x3b848 129ea: 60 93 e2 12 sts 0x12E2, r22 ; 0x8012e2 <_ZN13thermal_modelL4dataE.lto_priv.400+0x32> 129ee: 70 93 e3 12 sts 0x12E3, r23 ; 0x8012e3 <_ZN13thermal_modelL4dataE.lto_priv.400+0x33> 129f2: 80 93 e4 12 sts 0x12E4, r24 ; 0x8012e4 <_ZN13thermal_modelL4dataE.lto_priv.400+0x34> 129f6: 90 93 e5 12 sts 0x12E5, r25 ; 0x8012e5 <_ZN13thermal_modelL4dataE.lto_priv.400+0x35> thermal_model::data.C = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_C); 129fa: 8a ef ldi r24, 0xFA ; 250 129fc: 9c e0 ldi r25, 0x0C ; 12 129fe: 0f 94 24 dc call 0x3b848 ; 0x3b848 12a02: 60 93 e6 12 sts 0x12E6, r22 ; 0x8012e6 <_ZN13thermal_modelL4dataE.lto_priv.400+0x36> 12a06: 70 93 e7 12 sts 0x12E7, r23 ; 0x8012e7 <_ZN13thermal_modelL4dataE.lto_priv.400+0x37> 12a0a: 80 93 e8 12 sts 0x12E8, r24 ; 0x8012e8 <_ZN13thermal_modelL4dataE.lto_priv.400+0x38> 12a0e: 90 93 e9 12 sts 0x12E9, r25 ; 0x8012e9 <_ZN13thermal_modelL4dataE.lto_priv.400+0x39> thermal_model::data.fS = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_D); 12a12: 8a e9 ldi r24, 0x9A ; 154 12a14: 9c e0 ldi r25, 0x0C ; 12 12a16: 0f 94 24 dc call 0x3b848 ; 0x3b848 12a1a: 60 93 ea 12 sts 0x12EA, r22 ; 0x8012ea <_ZN13thermal_modelL4dataE.lto_priv.400+0x3a> 12a1e: 70 93 eb 12 sts 0x12EB, r23 ; 0x8012eb <_ZN13thermal_modelL4dataE.lto_priv.400+0x3b> 12a22: 80 93 ec 12 sts 0x12EC, r24 ; 0x8012ec <_ZN13thermal_modelL4dataE.lto_priv.400+0x3c> 12a26: 90 93 ed 12 sts 0x12ED, r25 ; 0x8012ed <_ZN13thermal_modelL4dataE.lto_priv.400+0x3d> thermal_model_set_lag(eeprom_read_word((uint16_t*)EEPROM_THERMAL_MODEL_L)); 12a2a: 88 e9 ldi r24, 0x98 ; 152 12a2c: 9c e0 ldi r25, 0x0C ; 12 12a2e: 0f 94 2a dc call 0x3b854 ; 0x3b854 12a32: 0f 94 82 2e call 0x25d04 ; 0x25d04 eeprom_read_block(&thermal_model::data.R[0], (float*)EEPROM_THERMAL_MODEL_R, THERMAL_MODEL_R_SIZE * sizeof(float)); 12a36: 40 e4 ldi r20, 0x40 ; 64 12a38: 50 e0 ldi r21, 0x00 ; 0 12a3a: 6a eb ldi r22, 0xBA ; 186 12a3c: 7c e0 ldi r23, 0x0C ; 12 12a3e: 80 ef ldi r24, 0xF0 ; 240 12a40: 92 e1 ldi r25, 0x12 ; 18 12a42: 0f 94 0c dc call 0x3b818 ; 0x3b818 thermal_model::data.Ta_corr = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_Ta_corr); 12a46: 86 eb ldi r24, 0xB6 ; 182 12a48: 9c e0 ldi r25, 0x0C ; 12 12a4a: 0f 94 24 dc call 0x3b848 ; 0x3b848 12a4e: 60 93 30 13 sts 0x1330, r22 ; 0x801330 <_ZN13thermal_modelL4dataE.lto_priv.400+0x80> 12a52: 70 93 31 13 sts 0x1331, r23 ; 0x801331 <_ZN13thermal_modelL4dataE.lto_priv.400+0x81> 12a56: 80 93 32 13 sts 0x1332, r24 ; 0x801332 <_ZN13thermal_modelL4dataE.lto_priv.400+0x82> 12a5a: 90 93 33 13 sts 0x1333, r25 ; 0x801333 <_ZN13thermal_modelL4dataE.lto_priv.400+0x83> thermal_model::data.warn = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_W); 12a5e: 82 eb ldi r24, 0xB2 ; 178 12a60: 9c e0 ldi r25, 0x0C ; 12 12a62: 0f 94 24 dc call 0x3b848 ; 0x3b848 12a66: 60 93 34 13 sts 0x1334, r22 ; 0x801334 <_ZN13thermal_modelL4dataE.lto_priv.400+0x84> 12a6a: 70 93 35 13 sts 0x1335, r23 ; 0x801335 <_ZN13thermal_modelL4dataE.lto_priv.400+0x85> 12a6e: 80 93 36 13 sts 0x1336, r24 ; 0x801336 <_ZN13thermal_modelL4dataE.lto_priv.400+0x86> 12a72: 90 93 37 13 sts 0x1337, r25 ; 0x801337 <_ZN13thermal_modelL4dataE.lto_priv.400+0x87> thermal_model::data.err = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_E); 12a76: 8e ea ldi r24, 0xAE ; 174 12a78: 9c e0 ldi r25, 0x0C ; 12 12a7a: 0f 94 24 dc call 0x3b848 ; 0x3b848 12a7e: 60 93 38 13 sts 0x1338, r22 ; 0x801338 <_ZN13thermal_modelL4dataE.lto_priv.400+0x88> 12a82: 70 93 39 13 sts 0x1339, r23 ; 0x801339 <_ZN13thermal_modelL4dataE.lto_priv.400+0x89> 12a86: 80 93 3a 13 sts 0x133A, r24 ; 0x80133a <_ZN13thermal_modelL4dataE.lto_priv.400+0x8a> 12a8a: 90 93 3b 13 sts 0x133B, r25 ; 0x80133b <_ZN13thermal_modelL4dataE.lto_priv.400+0x8b> if(!thermal_model::calibrated()) { 12a8e: 0f 94 a1 2e call 0x25d42 ; 0x25d42 12a92: 81 11 cpse r24, r1 12a94: 06 c0 rjmp .+12 ; 0x12aa2 SERIAL_ECHOLNPGM("TM: stored calibration invalid, resetting"); 12a96: 8d eb ldi r24, 0xBD ; 189 12a98: 97 e7 ldi r25, 0x77 ; 119 12a9a: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 thermal_model_reset_settings(); 12a9e: 0f 94 a8 31 call 0x26350 ; 0x26350 } thermal_model::setup(); 12aa2: 0f 94 09 2f call 0x25e12 ; 0x25e12 } 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; 12aa6: ce 01 movw r24, r28 12aa8: 01 96 adiw r24, 0x01 ; 1 12aaa: 0f 94 8d 31 call 0x2631a ; 0x2631a #ifdef THERMAL_MODEL thermal_model_load_settings(); #endif SERIAL_ECHO_START; 12aae: 82 ec ldi r24, 0xC2 ; 194 12ab0: 9b ea ldi r25, 0xAB ; 171 12ab2: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHOLNPGM("Stored settings retrieved"); 12ab6: 87 ee ldi r24, 0xE7 ; 231 12ab8: 97 e7 ldi r25, 0x77 ; 119 12aba: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 12abe: 81 e0 ldi r24, 0x01 ; 1 if (eeprom_is_initialized_block(EEPROM_M500_base->version, sizeof(EEPROM_M500_base->version))) { return false; } } return true; } 12ac0: 0f 90 pop r0 12ac2: df 91 pop r29 12ac4: cf 91 pop r28 12ac6: 1f 91 pop r17 12ac8: 0f 91 pop r16 12aca: ff 90 pop r15 12acc: ef 90 pop r14 12ace: bf 90 pop r11 12ad0: af 90 pop r10 12ad2: 9f 90 pop r9 12ad4: 8f 90 pop r8 12ad6: 7f 90 pop r7 12ad8: 6f 90 pop r6 12ada: 5f 90 pop r5 12adc: 4f 90 pop r4 12ade: 08 95 ret SERIAL_ECHO_START; SERIAL_ECHOLNPGM("Stored settings retrieved"); } else { Config_ResetDefault(); 12ae0: 0e 94 8c 82 call 0x10518 ; 0x10518 //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))) { 12ae4: 64 e0 ldi r22, 0x04 ; 4 12ae6: 70 e0 ldi r23, 0x00 ; 0 12ae8: 84 e1 ldi r24, 0x14 ; 20 12aea: 90 e0 ldi r25, 0x00 ; 0 12aec: 0e 94 bb 5b call 0xb776 ; 0xb776 12af0: 91 e0 ldi r25, 0x01 ; 1 12af2: 89 27 eor r24, r25 12af4: e5 cf rjmp .-54 ; 0x12ac0 00012af6 : 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() 12af6: 2f 92 push r2 12af8: 3f 92 push r3 12afa: 4f 92 push r4 12afc: 5f 92 push r5 12afe: 6f 92 push r6 12b00: 7f 92 push r7 12b02: 8f 92 push r8 12b04: 9f 92 push r9 12b06: af 92 push r10 12b08: bf 92 push r11 12b0a: cf 92 push r12 12b0c: df 92 push r13 12b0e: ef 92 push r14 12b10: ff 92 push r15 12b12: 0f 93 push r16 12b14: 1f 93 push r17 12b16: cf 93 push r28 12b18: df 93 push r29 12b1a: cd b7 in r28, 0x3d ; 61 12b1c: de b7 in r29, 0x3e ; 62 12b1e: cf 58 subi r28, 0x8F ; 143 12b20: d1 09 sbc r29, r1 12b22: 0f b6 in r0, 0x3f ; 63 12b24: f8 94 cli 12b26: de bf out 0x3e, r29 ; 62 12b28: 0f be out 0x3f, r0 ; 63 12b2a: cd bf out 0x3d, r28 ; 61 #endif /* CMDBUFFER_DEBUG */ unsigned long codenum; //throw away variable // PRUSA GCODES KEEPALIVE_STATE(IN_HANDLER); 12b2c: 82 e0 ldi r24, 0x02 ; 2 12b2e: 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) 12b32: a0 90 92 12 lds r10, 0x1292 ; 0x801292 12b36: b0 90 93 12 lds r11, 0x1293 ; 0x801293 12b3a: 85 01 movw r16, r10 12b3c: 08 55 subi r16, 0x58 ; 88 12b3e: 1f 4e sbci r17, 0xEF ; 239 12b40: 46 e0 ldi r20, 0x06 ; 6 12b42: 50 e0 ldi r21, 0x00 ; 0 12b44: 6a e9 ldi r22, 0x9A ; 154 12b46: 78 e8 ldi r23, 0x88 ; 136 12b48: c8 01 movw r24, r16 12b4a: 0f 94 fb d9 call 0x3b3f6 ; 0x3b3f6 12b4e: 89 2b or r24, r25 12b50: 09 f0 breq .+2 ; 0x12b54 12b52: b8 c0 rjmp .+368 ; 0x12cc4 { // ### CRASH_DETECTED - TMC2130 // --------------------------------- if(code_seen_P(PSTR("CRASH_DETECTED"))) 12b54: 8b e8 ldi r24, 0x8B ; 139 12b56: 98 e8 ldi r25, 0x88 ; 136 12b58: 0e 94 26 68 call 0xd04c ; 0xd04c 12b5c: 88 23 and r24, r24 12b5e: 09 f4 brne .+2 ; 0x12b62 12b60: 91 c0 rjmp .+290 ; 0x12c84 { uint8_t mask = 0; if (code_seen('X')) mask |= X_AXIS_MASK; 12b62: 88 e5 ldi r24, 0x58 ; 88 12b64: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 12b68: 18 2f mov r17, r24 if (code_seen('Y')) mask |= Y_AXIS_MASK; 12b6a: 89 e5 ldi r24, 0x59 ; 89 12b6c: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 12b70: 81 11 cpse r24, r1 12b72: 12 60 ori r17, 0x02 ; 2 strcpy_P(buf, _T(MSG_CRASH_DETECTED)); } void crashdet_detected(uint8_t mask) { st_synchronize(); 12b74: 0f 94 e8 42 call 0x285d0 ; 0x285d0 static uint8_t crashDet_counter = 0; static uint8_t crashDet_axes = 0; bool automatic_recovery_after_crash = true; char msg[LCD_WIDTH+1] = ""; 12b78: 1a 82 std Y+2, r1 ; 0x02 12b7a: 19 82 std Y+1, r1 ; 0x01 12b7c: fe 01 movw r30, r28 12b7e: 33 96 adiw r30, 0x03 ; 3 12b80: 83 e1 ldi r24, 0x13 ; 19 12b82: df 01 movw r26, r30 12b84: 1d 92 st X+, r1 12b86: 8a 95 dec r24 12b88: e9 f7 brne .-6 ; 0x12b84 if (crashDetTimer.expired(CRASHDET_TIMER * 1000ul)) { 12b8a: 48 ec ldi r20, 0xC8 ; 200 12b8c: 5f ea ldi r21, 0xAF ; 175 12b8e: 60 e0 ldi r22, 0x00 ; 0 12b90: 70 e0 ldi r23, 0x00 ; 0 12b92: 85 e7 ldi r24, 0x75 ; 117 12b94: 93 e0 ldi r25, 0x03 ; 3 12b96: 0f 94 30 2a call 0x25460 ; 0x25460 ::expired(unsigned long)> 12b9a: 81 11 cpse r24, r1 crashDet_counter = 0; 12b9c: 10 92 74 03 sts 0x0374, r1 ; 0x800374 } if(++crashDet_counter >= CRASHDET_COUNTER_MAX) { 12ba0: 00 91 74 03 lds r16, 0x0374 ; 0x800374 12ba4: 0f 5f subi r16, 0xFF ; 255 12ba6: 00 93 74 03 sts 0x0374, r16 ; 0x800374 automatic_recovery_after_crash = false; } crashDetTimer.start(); 12baa: 85 e7 ldi r24, 0x75 ; 117 12bac: 93 e0 ldi r25, 0x03 ; 3 12bae: 0f 94 ef 2b call 0x257de ; 0x257de ::start()> crashDet_axes |= mask; 12bb2: 80 91 73 03 lds r24, 0x0373 ; 0x800373 12bb6: 81 2b or r24, r17 12bb8: 80 93 73 03 sts 0x0373, r24 ; 0x800373 if (mask & X_AXIS_MASK) { 12bbc: 10 ff sbrs r17, 0 12bbe: 08 c0 rjmp .+16 ; 0x12bd0 eeprom_increment_byte((uint8_t*)EEPROM_CRASH_COUNT_X); 12bc0: 86 e6 ldi r24, 0x66 ; 102 12bc2: 9f e0 ldi r25, 0x0F ; 15 12bc4: 0e 94 28 76 call 0xec50 ; 0xec50 eeprom_increment_word((uint16_t*)EEPROM_CRASH_COUNT_X_TOT); 12bc8: 85 e0 ldi r24, 0x05 ; 5 12bca: 9f e0 ldi r25, 0x0F ; 15 12bcc: 0e 94 1b 76 call 0xec36 ; 0xec36 } if (mask & Y_AXIS_MASK) { 12bd0: 11 ff sbrs r17, 1 12bd2: 08 c0 rjmp .+16 ; 0x12be4 eeprom_increment_byte((uint8_t*)EEPROM_CRASH_COUNT_Y); 12bd4: 88 e6 ldi r24, 0x68 ; 104 12bd6: 9f e0 ldi r25, 0x0F ; 15 12bd8: 0e 94 28 76 call 0xec50 ; 0xec50 eeprom_increment_word((uint16_t*)EEPROM_CRASH_COUNT_Y_TOT); 12bdc: 83 e0 ldi r24, 0x03 ; 3 12bde: 9f e0 ldi r25, 0x0F ; 15 12be0: 0e 94 1b 76 call 0xec36 ; 0xec36 } lcd_update_enable(true); 12be4: 81 e0 ldi r24, 0x01 ; 1 12be6: 0e 94 25 6f call 0xde4a ; 0xde4a lcd_update(2); 12bea: 82 e0 ldi r24, 0x02 ; 2 12bec: 0e 94 a7 6e call 0xdd4e ; 0xdd4e // prepare the status message with the _current_ axes status crashdet_fmt_error(msg, mask); 12bf0: 61 2f mov r22, r17 12bf2: ce 01 movw r24, r28 12bf4: 01 96 adiw r24, 0x01 ; 1 12bf6: 0e 94 09 74 call 0xe812 ; 0xe812 lcd_setstatus(msg); 12bfa: ce 01 movw r24, r28 12bfc: 01 96 adiw r24, 0x01 ; 1 12bfe: 0e 94 89 f4 call 0x1e912 ; 0x1e912 gcode_G28(true, true, false); //home X and Y 12c02: 40 e0 ldi r20, 0x00 ; 0 12c04: 61 e0 ldi r22, 0x01 ; 1 12c06: 81 e0 ldi r24, 0x01 ; 1 12c08: 0e 94 05 7f call 0xfe0a ; 0xfe0a if (automatic_recovery_after_crash) { enquecommand_P(PSTR("CRASH_RECOVER")); 12c0c: 61 e0 ldi r22, 0x01 ; 1 12c0e: 83 e2 ldi r24, 0x23 ; 35 12c10: 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) { 12c12: 03 30 cpi r16, 0x03 ; 3 12c14: 60 f1 brcs .+88 ; 0x12c6e 12c16: 10 92 b7 0d sts 0x0DB7, r1 ; 0x800db7 12c1a: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 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); 12c1e: 80 e0 ldi r24, 0x00 ; 0 12c20: 0e 94 25 6f call 0xde4a ; 0xde4a lcd_clear(); 12c24: 0e 94 13 6f call 0xde26 ; 0xde26 crashdet_fmt_error(msg, crashDet_axes); 12c28: 60 91 73 03 lds r22, 0x0373 ; 0x800373 12c2c: ce 01 movw r24, r28 12c2e: 01 96 adiw r24, 0x01 ; 1 12c30: 0e 94 09 74 call 0xe812 ; 0xe812 crashDet_axes = 0; 12c34: 10 92 73 03 sts 0x0373, r1 ; 0x800373 lcd_print(msg); 12c38: ce 01 movw r24, r28 12c3a: 01 96 adiw r24, 0x01 ; 1 12c3c: 0e 94 e7 70 call 0xe1ce ; 0xe1ce // ask whether to resume printing lcd_puts_at_P(0, 1, _T(MSG_RESUME_PRINT)); 12c40: 80 e0 ldi r24, 0x00 ; 0 12c42: 97 e4 ldi r25, 0x47 ; 71 12c44: 0e 94 ac 72 call 0xe558 ; 0xe558 12c48: ac 01 movw r20, r24 12c4a: 61 e0 ldi r22, 0x01 ; 1 12c4c: 80 e0 ldi r24, 0x00 ; 0 12c4e: 0e 94 f4 6e call 0xdde8 ; 0xdde8 lcd_putc('?'); 12c52: 8f e3 ldi r24, 0x3F ; 63 12c54: 0e 94 cf 6e call 0xdd9e ; 0xdd9e //! @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); 12c58: 40 e0 ldi r20, 0x00 ; 0 12c5a: 60 e0 ldi r22, 0x00 ; 0 12c5c: 90 e0 ldi r25, 0x00 ; 0 12c5e: 80 e0 ldi r24, 0x00 ; 0 12c60: 0f 94 40 4f call 0x29e80 ; 0x29e80 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")); 12c64: 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) 12c66: 81 11 cpse r24, r1 12c68: 0a c0 rjmp .+20 ; 0x12c7e { enquecommand_P(PSTR("CRASH_RECOVER")); 12c6a: 85 e1 ldi r24, 0x15 ; 21 12c6c: 95 e8 ldi r25, 0x85 ; 133 } else // LCD_MIDDLE_BUTTON_CHOICE { enquecommand_P(PSTR("CRASH_CANCEL")); 12c6e: 0e 94 20 88 call 0x11040 ; 0x11040 SERIAL_ECHO_START; SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); SERIAL_ECHOLNPGM("\"(2)"); } KEEPALIVE_STATE(NOT_BUSY); 12c72: 81 e0 ldi r24, 0x01 ; 1 12c74: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be ClearToSend(); 12c78: 0e 94 2a 7f call 0xfe54 ; 0xfe54 12c7c: 5e c3 rjmp .+1724 ; 0x1333a { enquecommand_P(PSTR("CRASH_RECOVER")); } else // LCD_MIDDLE_BUTTON_CHOICE { enquecommand_P(PSTR("CRASH_CANCEL")); 12c7e: 88 e0 ldi r24, 0x08 ; 8 12c80: 95 e8 ldi r25, 0x85 ; 133 12c82: f5 cf rjmp .-22 ; 0x12c6e crashdet_detected(mask); } // ### CRASH_RECOVER - TMC2130 // ---------------------------------- else if(code_seen_P(PSTR("CRASH_RECOVER"))) 12c84: 8d e7 ldi r24, 0x7D ; 125 12c86: 98 e8 ldi r25, 0x88 ; 136 12c88: 0e 94 26 68 call 0xd04c ; 0xd04c 12c8c: 88 23 and r24, r24 12c8e: 69 f0 breq .+26 ; 0x12caa } } void crashdet_recover() { if (!printingIsPaused()) crashdet_restore_print_and_continue(); 12c90: 0e 94 85 67 call 0xcf0a ; 0xcf0a 12c94: 81 11 cpse r24, r1 12c96: 06 c0 rjmp .+12 ; 0x12ca4 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 12c98: 60 e0 ldi r22, 0x00 ; 0 12c9a: 70 e0 ldi r23, 0x00 ; 0 12c9c: 80 e8 ldi r24, 0x80 ; 128 12c9e: 9f e3 ldi r25, 0x3F ; 63 12ca0: 0e 94 44 68 call 0xd088 ; 0xd088 } void crashdet_recover() { if (!printingIsPaused()) crashdet_restore_print_and_continue(); crashdet_use_eeprom_setting(); 12ca4: 0f 94 55 26 call 0x24caa ; 0x24caa 12ca8: e4 cf rjmp .-56 ; 0x12c72 else if(code_seen_P(PSTR("CRASH_RECOVER"))) crashdet_recover(); // ### CRASH_CANCEL - TMC2130 // ---------------------------------- else if(code_seen_P(PSTR("CRASH_CANCEL"))) 12caa: 80 e7 ldi r24, 0x70 ; 112 12cac: 98 e8 ldi r25, 0x88 ; 136 12cae: 0e 94 26 68 call 0xd04c ; 0xd04c 12cb2: 88 23 and r24, r24 12cb4: f1 f2 breq .-68 ; 0x12c72 } /// Crash detection cancels the print void crashdet_cancel() { // Restore crash detection crashdet_use_eeprom_setting(); 12cb6: 0f 94 55 26 call 0x24caa ; 0x24caa // Abort the print print_stop(); 12cba: 60 e0 ldi r22, 0x00 ; 0 12cbc: 80 e0 ldi r24, 0x00 ; 0 12cbe: 0e 94 9a f4 call 0x1e934 ; 0x1e934 12cc2: d7 cf rjmp .-82 ; 0x12c72 // ### CRASH_CANCEL - TMC2130 // ---------------------------------- else if(code_seen_P(PSTR("CRASH_CANCEL"))) crashdet_cancel(); } else if (strncmp_P(CMDBUFFER_CURRENT_STRING, PSTR("TMC_"), 4) == 0) 12cc4: 44 e0 ldi r20, 0x04 ; 4 12cc6: 50 e0 ldi r21, 0x00 ; 0 12cc8: 6b e6 ldi r22, 0x6B ; 107 12cca: 78 e8 ldi r23, 0x88 ; 136 12ccc: c8 01 movw r24, r16 12cce: 0f 94 fb d9 call 0x3b3f6 ; 0x3b3f6 12cd2: 89 2b or r24, r25 12cd4: 09 f0 breq .+2 ; 0x12cd8 12cd6: fc c0 rjmp .+504 ; 0x12ed0 { // ### TMC_SET_WAVE_ // -------------------- if (strncmp_P(CMDBUFFER_CURRENT_STRING + 4, PSTR("SET_WAVE_"), 9) == 0) 12cd8: 85 01 movw r16, r10 12cda: 04 55 subi r16, 0x54 ; 84 12cdc: 1f 4e sbci r17, 0xEF ; 239 12cde: 49 e0 ldi r20, 0x09 ; 9 12ce0: 50 e0 ldi r21, 0x00 ; 0 12ce2: 61 e6 ldi r22, 0x61 ; 97 12ce4: 78 e8 ldi r23, 0x88 ; 136 12ce6: c8 01 movw r24, r16 12ce8: 0f 94 fb d9 call 0x3b3f6 ; 0x3b3f6 12cec: 89 2b or r24, r25 12cee: c9 f4 brne .+50 ; 0x12d22 { uint8_t axis = *(CMDBUFFER_CURRENT_STRING + 13); 12cf0: f5 01 movw r30, r10 12cf2: eb 54 subi r30, 0x4B ; 75 12cf4: ff 4e sbci r31, 0xEF ; 239 12cf6: 10 81 ld r17, Z axis = (axis == 'E')?3:(axis - 'X'); 12cf8: 15 34 cpi r17, 0x45 ; 69 12cfa: 89 f0 breq .+34 ; 0x12d1e 12cfc: 18 55 subi r17, 0x58 ; 88 if (axis < 4) 12cfe: 14 30 cpi r17, 0x04 ; 4 12d00: 08 f0 brcs .+2 ; 0x12d04 12d02: b7 cf rjmp .-146 ; 0x12c72 { uint8_t fac = (uint8_t)strtol(CMDBUFFER_CURRENT_STRING + 14, NULL, 10); 12d04: 4a e0 ldi r20, 0x0A ; 10 12d06: 50 e0 ldi r21, 0x00 ; 0 12d08: 70 e0 ldi r23, 0x00 ; 0 12d0a: 60 e0 ldi r22, 0x00 ; 0 12d0c: c5 01 movw r24, r10 12d0e: 8a 54 subi r24, 0x4A ; 74 12d10: 9f 4e sbci r25, 0xEF ; 239 12d12: 0f 94 a7 d7 call 0x3af4e ; 0x3af4e tmc2130_set_wave(axis, 247, fac); 12d16: 81 2f mov r24, r17 12d18: 0f 94 8c 88 call 0x31118 ; 0x31118 12d1c: aa cf rjmp .-172 ; 0x12c72 // ### 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'); 12d1e: 13 e0 ldi r17, 0x03 ; 3 12d20: f1 cf rjmp .-30 ; 0x12d04 } } // ### TMC_SET_STEP_ // ------------------ else if (strncmp_P(CMDBUFFER_CURRENT_STRING + 4, PSTR("SET_STEP_"), 9) == 0) 12d22: 49 e0 ldi r20, 0x09 ; 9 12d24: 50 e0 ldi r21, 0x00 ; 0 12d26: 67 e5 ldi r22, 0x57 ; 87 12d28: 78 e8 ldi r23, 0x88 ; 136 12d2a: c8 01 movw r24, r16 12d2c: 0f 94 fb d9 call 0x3b3f6 ; 0x3b3f6 12d30: 89 2b or r24, r25 12d32: 51 f5 brne .+84 ; 0x12d88 { uint8_t axis = *(CMDBUFFER_CURRENT_STRING + 13); 12d34: f5 01 movw r30, r10 12d36: eb 54 subi r30, 0x4B ; 75 12d38: ff 4e sbci r31, 0xEF ; 239 12d3a: 10 81 ld r17, Z axis = (axis == 'E')?3:(axis - 'X'); 12d3c: 15 34 cpi r17, 0x45 ; 69 12d3e: 11 f1 breq .+68 ; 0x12d84 12d40: 18 55 subi r17, 0x58 ; 88 if (axis < 4) 12d42: 14 30 cpi r17, 0x04 ; 4 12d44: 08 f0 brcs .+2 ; 0x12d48 12d46: 95 cf rjmp .-214 ; 0x12c72 { uint8_t step = (uint8_t)strtol(CMDBUFFER_CURRENT_STRING + 14, NULL, 10); 12d48: 4a e0 ldi r20, 0x0A ; 10 12d4a: 50 e0 ldi r21, 0x00 ; 0 12d4c: 70 e0 ldi r23, 0x00 ; 0 12d4e: 60 e0 ldi r22, 0x00 ; 0 12d50: c5 01 movw r24, r10 12d52: 8a 54 subi r24, 0x4A ; 74 12d54: 9f 4e sbci r25, 0xEF ; 239 12d56: 0f 94 a7 d7 call 0x3af4e ; 0x3af4e 12d5a: e1 2f mov r30, r17 12d5c: f0 e0 ldi r31, 0x00 ; 0 12d5e: eb 50 subi r30, 0x0B ; 11 12d60: fb 4f sbci r31, 0xFB ; 251 12d62: 80 81 ld r24, Z 12d64: 40 e0 ldi r20, 0x00 ; 0 12d66: 51 e0 ldi r21, 0x01 ; 1 12d68: 02 c0 rjmp .+4 ; 0x12d6e 12d6a: 56 95 lsr r21 12d6c: 47 95 ror r20 12d6e: 8a 95 dec r24 12d70: e2 f7 brpl .-8 ; 0x12d6a uint16_t res = tmc2130_get_res(axis); tmc2130_goto_step(axis, step & (4*res - 1), 2, 1000, res); 12d72: 84 2f mov r24, r20 12d74: 88 0f add r24, r24 12d76: 88 0f add r24, r24 12d78: 81 50 subi r24, 0x01 ; 1 12d7a: 68 23 and r22, r24 12d7c: 81 2f mov r24, r17 12d7e: 0f 94 a3 8b call 0x31746 ; 0x31746 12d82: 77 cf rjmp .-274 ; 0x12c72 // ### 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'); 12d84: 13 e0 ldi r17, 0x03 ; 3 12d86: e0 cf rjmp .-64 ; 0x12d48 } } // ### TMC_SET_CHOP_ // ------------------- else if (strncmp_P(CMDBUFFER_CURRENT_STRING + 4, PSTR("SET_CHOP_"), 9) == 0) 12d88: 49 e0 ldi r20, 0x09 ; 9 12d8a: 50 e0 ldi r21, 0x00 ; 0 12d8c: 6d e4 ldi r22, 0x4D ; 77 12d8e: 78 e8 ldi r23, 0x88 ; 136 12d90: c8 01 movw r24, r16 12d92: 0f 94 fb d9 call 0x3b3f6 ; 0x3b3f6 12d96: 89 2b or r24, r25 12d98: 09 f0 breq .+2 ; 0x12d9c 12d9a: 6b cf rjmp .-298 ; 0x12c72 { uint8_t axis = *(CMDBUFFER_CURRENT_STRING + 13); 12d9c: f5 01 movw r30, r10 12d9e: eb 54 subi r30, 0x4B ; 75 12da0: ff 4e sbci r31, 0xEF ; 239 12da2: 80 81 ld r24, Z axis = (axis == 'E')?3:(axis - 'X'); 12da4: 85 34 cpi r24, 0x45 ; 69 12da6: 09 f4 brne .+2 ; 0x12daa 12da8: 90 c0 rjmp .+288 ; 0x12eca 12daa: 98 ea ldi r25, 0xA8 ; 168 12dac: c9 2e mov r12, r25 12dae: c8 0e add r12, r24 if (axis < 4) 12db0: b3 e0 ldi r27, 0x03 ; 3 12db2: bc 15 cp r27, r12 12db4: 08 f4 brcc .+2 ; 0x12db8 12db6: 5d cf rjmp .-326 ; 0x12c72 { uint8_t chop0 = tmc2130_chopper_config[axis].toff; 12db8: ec 2c mov r14, r12 12dba: f1 2c mov r15, r1 12dbc: 47 01 movw r8, r14 12dbe: 88 0c add r8, r8 12dc0: 99 1c adc r9, r9 12dc2: f4 01 movw r30, r8 12dc4: eb 55 subi r30, 0x5B ; 91 12dc6: fd 4f sbci r31, 0xFD ; 253 12dc8: 00 81 ld r16, Z 12dca: 20 2f mov r18, r16 12dcc: 2f 70 andi r18, 0x0F ; 15 uint8_t chop1 = tmc2130_chopper_config[axis].hstr; 12dce: 10 2f mov r17, r16 12dd0: 12 95 swap r17 12dd2: 17 70 andi r17, 0x07 ; 7 uint8_t chop2 = tmc2130_chopper_config[axis].hend; 12dd4: 00 1f adc r16, r16 12dd6: 00 27 eor r16, r16 12dd8: 00 1f adc r16, r16 12dda: 61 81 ldd r22, Z+1 ; 0x01 12ddc: 67 70 andi r22, 0x07 ; 7 12dde: 66 0f add r22, r22 12de0: 06 2b or r16, r22 uint8_t chop3 = tmc2130_chopper_config[axis].tbl; 12de2: f4 01 movw r30, r8 12de4: ea 55 subi r30, 0x5A ; 90 12de6: fd 4f sbci r31, 0xFD ; 253 12de8: d0 80 ld r13, Z 12dea: d6 94 lsr r13 12dec: d6 94 lsr r13 12dee: d6 94 lsr r13 12df0: ed 2d mov r30, r13 12df2: e3 70 andi r30, 0x03 ; 3 12df4: de 2e mov r13, r30 char* str_end = 0; 12df6: 1a 82 std Y+2, r1 ; 0x02 12df8: 19 82 std Y+1, r1 ; 0x01 if (CMDBUFFER_CURRENT_STRING[14]) 12dfa: c5 01 movw r24, r10 12dfc: 8a 54 subi r24, 0x4A ; 74 12dfe: 9f 4e sbci r25, 0xEF ; 239 12e00: dc 01 movw r26, r24 12e02: 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; 12e04: 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]) 12e06: 33 23 and r19, r19 12e08: e1 f1 breq .+120 ; 0x12e82 { chop0 = (uint8_t)strtol(CMDBUFFER_CURRENT_STRING + 14, &str_end, 10) & 15; 12e0a: 4a e0 ldi r20, 0x0A ; 10 12e0c: 50 e0 ldi r21, 0x00 ; 0 12e0e: be 01 movw r22, r28 12e10: 6f 5f subi r22, 0xFF ; 255 12e12: 7f 4f sbci r23, 0xFF ; 255 12e14: 0f 94 a7 d7 call 0x3af4e ; 0x3af4e 12e18: 6f 70 andi r22, 0x0F ; 15 12e1a: b6 2e mov r11, r22 if (str_end && *str_end) 12e1c: 89 81 ldd r24, Y+1 ; 0x01 12e1e: 9a 81 ldd r25, Y+2 ; 0x02 12e20: 00 97 sbiw r24, 0x00 ; 0 12e22: 79 f1 breq .+94 ; 0x12e82 12e24: fc 01 movw r30, r24 12e26: 20 81 ld r18, Z 12e28: 22 23 and r18, r18 12e2a: 59 f1 breq .+86 ; 0x12e82 { chop1 = (uint8_t)strtol(str_end, &str_end, 10) & 7; 12e2c: 4a e0 ldi r20, 0x0A ; 10 12e2e: 50 e0 ldi r21, 0x00 ; 0 12e30: be 01 movw r22, r28 12e32: 6f 5f subi r22, 0xFF ; 255 12e34: 7f 4f sbci r23, 0xFF ; 255 12e36: 0f 94 a7 d7 call 0x3af4e ; 0x3af4e 12e3a: 16 2f mov r17, r22 12e3c: 17 70 andi r17, 0x07 ; 7 if (str_end && *str_end) 12e3e: 89 81 ldd r24, Y+1 ; 0x01 12e40: 9a 81 ldd r25, Y+2 ; 0x02 12e42: 00 97 sbiw r24, 0x00 ; 0 12e44: f1 f0 breq .+60 ; 0x12e82 12e46: dc 01 movw r26, r24 12e48: 2c 91 ld r18, X 12e4a: 22 23 and r18, r18 12e4c: d1 f0 breq .+52 ; 0x12e82 { chop2 = (uint8_t)strtol(str_end, &str_end, 10) & 15; 12e4e: 4a e0 ldi r20, 0x0A ; 10 12e50: 50 e0 ldi r21, 0x00 ; 0 12e52: be 01 movw r22, r28 12e54: 6f 5f subi r22, 0xFF ; 255 12e56: 7f 4f sbci r23, 0xFF ; 255 12e58: 0f 94 a7 d7 call 0x3af4e ; 0x3af4e 12e5c: 06 2f mov r16, r22 12e5e: 0f 70 andi r16, 0x0F ; 15 if (str_end && *str_end) 12e60: 89 81 ldd r24, Y+1 ; 0x01 12e62: 9a 81 ldd r25, Y+2 ; 0x02 12e64: 00 97 sbiw r24, 0x00 ; 0 12e66: 69 f0 breq .+26 ; 0x12e82 12e68: fc 01 movw r30, r24 12e6a: 20 81 ld r18, Z 12e6c: 22 23 and r18, r18 12e6e: 49 f0 breq .+18 ; 0x12e82 chop3 = (uint8_t)strtol(str_end, &str_end, 10) & 3; 12e70: 4a e0 ldi r20, 0x0A ; 10 12e72: 50 e0 ldi r21, 0x00 ; 0 12e74: be 01 movw r22, r28 12e76: 6f 5f subi r22, 0xFF ; 255 12e78: 7f 4f sbci r23, 0xFF ; 255 12e7a: 0f 94 a7 d7 call 0x3af4e ; 0x3af4e 12e7e: 63 70 andi r22, 0x03 ; 3 12e80: d6 2e mov r13, r22 } } } tmc2130_chopper_config[axis].toff = chop0; 12e82: f4 01 movw r30, r8 12e84: eb 55 subi r30, 0x5B ; 91 12e86: fd 4f sbci r31, 0xFD ; 253 tmc2130_chopper_config[axis].hstr = chop1 & 7; 12e88: 17 70 andi r17, 0x07 ; 7 12e8a: 12 95 swap r17 12e8c: 10 7f andi r17, 0xF0 ; 240 tmc2130_chopper_config[axis].hend = chop2 & 15; 12e8e: 60 2f mov r22, r16 12e90: 67 95 ror r22 12e92: 66 27 eor r22, r22 12e94: 67 95 ror r22 12e96: 1b 29 or r17, r11 12e98: 16 2b or r17, r22 12e9a: 10 83 st Z, r17 12e9c: 60 2f mov r22, r16 12e9e: 66 95 lsr r22 12ea0: 01 81 ldd r16, Z+1 ; 0x01 12ea2: 00 7e andi r16, 0xE0 ; 224 tmc2130_chopper_config[axis].tbl = chop3 & 3; 12ea4: 2d 2d mov r18, r13 12ea6: 23 70 andi r18, 0x03 ; 3 12ea8: d2 2e mov r13, r18 12eaa: dd 0c add r13, r13 12eac: dd 0c add r13, r13 12eae: dd 0c add r13, r13 12eb0: 06 2b or r16, r22 12eb2: d0 2a or r13, r16 12eb4: d1 82 std Z+1, r13 ; 0x01 tmc2130_setup_chopper(axis, tmc2130_mres[axis]); 12eb6: f7 01 movw r30, r14 12eb8: eb 50 subi r30, 0x0B ; 11 12eba: fb 4f sbci r31, 0xFB ; 251 12ebc: 50 e0 ldi r21, 0x00 ; 0 12ebe: 40 e0 ldi r20, 0x00 ; 0 12ec0: 60 81 ld r22, Z 12ec2: 8c 2d mov r24, r12 12ec4: 0f 94 8f 24 call 0x2491e ; 0x2491e 12ec8: d4 ce rjmp .-600 ; 0x12c72 // ### 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'); 12eca: 03 e0 ldi r16, 0x03 ; 3 12ecc: c0 2e mov r12, r16 12ece: 74 cf rjmp .-280 ; 0x12db8 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) { 12ed0: 45 e0 ldi r20, 0x05 ; 5 12ed2: 50 e0 ldi r21, 0x00 ; 0 12ed4: 67 e4 ldi r22, 0x47 ; 71 12ed6: 78 e8 ldi r23, 0x88 ; 136 12ed8: c8 01 movw r24, r16 12eda: 0f 94 fb d9 call 0x3b3f6 ; 0x3b3f6 12ede: 89 2b or r24, r25 12ee0: 09 f0 breq .+2 ; 0x12ee4 12ee2: 64 c1 rjmp .+712 ; 0x131ac - `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"))) { 12ee4: 8d e3 ldi r24, 0x3D ; 61 12ee6: 98 e8 ldi r25, 0x88 ; 136 12ee8: 0e 94 26 68 call 0xd04c ; 0xd04c 12eec: 88 23 and r24, r24 12eee: 09 f4 brne .+2 ; 0x12ef2 12ef0: 3c c0 rjmp .+120 ; 0x12f6a //! 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 12ef2: 10 92 6f 06 sts 0x066F, r1 ; 0x80066f 12ef6: 14 e6 ldi r17, 0x64 ; 100 unsigned long tach1max = 0; 12ef8: c1 2c mov r12, r1 12efa: d1 2c mov r13, r1 12efc: 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); 12efe: 6f 9a sbi 0x0d, 7 ; 13 WRITE(TACH_1, LOW); 12f00: 77 98 cbi 0x0e, 7 ; 14 _delay(20); // the delay may be lower 12f02: 64 e1 ldi r22, 0x14 ; 20 12f04: 70 e0 ldi r23, 0x00 ; 0 12f06: 80 e0 ldi r24, 0x00 ; 0 12f08: 90 e0 ldi r25, 0x00 ; 0 12f0a: 0f 94 53 27 call 0x24ea6 ; 0x24ea6 unsigned long tachMeasure = _micros(); 12f0e: 0f 94 2d 27 call 0x24e5a ; 0x24e5a 12f12: 4b 01 movw r8, r22 12f14: 5c 01 movw r10, r24 cli(); 12f16: f8 94 cli SET_INPUT(TACH_1); 12f18: 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 ) ; 12f1a: 67 9b sbis 0x0c, 7 ; 12 12f1c: fe cf rjmp .-4 ; 0x12f1a sei(); 12f1e: 78 94 sei tachMeasure = _micros() - tachMeasure; 12f20: 0f 94 2d 27 call 0x24e5a ; 0x24e5a 12f24: dc 01 movw r26, r24 12f26: cb 01 movw r24, r22 12f28: 88 19 sub r24, r8 12f2a: 99 09 sbc r25, r9 12f2c: aa 09 sbc r26, r10 12f2e: bb 09 sbc r27, r11 12f30: c8 16 cp r12, r24 12f32: d9 06 cpc r13, r25 12f34: ea 06 cpc r14, r26 12f36: fb 06 cpc r15, r27 12f38: 10 f4 brcc .+4 ; 0x12f3e 12f3a: 6c 01 movw r12, r24 12f3c: 7d 01 movw r14, r26 12f3e: 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){ 12f40: f1 f6 brne .-68 ; 0x12efe 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 "); 12f42: 8d ef ldi r24, 0xFD ; 253 12f44: 94 e8 ldi r25, 0x84 ; 132 12f46: 0e 94 50 77 call 0xeea0 ; 0xeea0 if( tach1max > 500 ){ // bad RAMBo SERIAL_PROTOCOLLNPGM("BAD"); 12f4a: 89 ef ldi r24, 0xF9 ; 249 12f4c: 94 e8 ldi r25, 0x84 ; 132 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 ){ 12f4e: 35 ef ldi r19, 0xF5 ; 245 12f50: c3 16 cp r12, r19 12f52: 31 e0 ldi r19, 0x01 ; 1 12f54: d3 06 cpc r13, r19 12f56: e1 04 cpc r14, r1 12f58: f1 04 cpc r15, r1 12f5a: 10 f4 brcc .+4 ; 0x12f60 // bad RAMBo SERIAL_PROTOCOLLNPGM("BAD"); } else { SERIAL_PROTOCOLLNPGM("OK"); 12f5c: 86 ef ldi r24, 0xF6 ; 246 12f5e: 94 e8 ldi r25, 0x84 ; 132 12f60: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 } // cleanup after the test function SET_INPUT(TACH_1); 12f64: 6f 98 cbi 0x0d, 7 ; 13 WRITE(TACH_1, HIGH); 12f66: 77 9a sbi 0x0e, 7 ; 14 12f68: 84 ce rjmp .-760 ; 0x12c72 */ if (farm_prusa_code_seen()) {} else if(code_seen_P(PSTR("FANPINTST"))) { gcode_PRUSA_BadRAMBoFanTest(); } else if (code_seen_P(PSTR("FAN"))) { // PRUSA FAN 12f6a: 89 e3 ldi r24, 0x39 ; 57 12f6c: 98 e8 ldi r25, 0x88 ; 136 12f6e: 0e 94 26 68 call 0xd04c ; 0xd04c 12f72: 88 23 and r24, r24 12f74: 21 f1 breq .+72 ; 0x12fbe printf_P(_N("E0:%d RPM\nPRN0:%d RPM\n"), 60*fan_speed[0], 60*fan_speed[1]); 12f76: 40 91 cb 03 lds r20, 0x03CB ; 0x8003cb 12f7a: 50 91 cc 03 lds r21, 0x03CC ; 0x8003cc 12f7e: 2c e3 ldi r18, 0x3C ; 60 12f80: 24 9f mul r18, r20 12f82: c0 01 movw r24, r0 12f84: 25 9f mul r18, r21 12f86: 90 0d add r25, r0 12f88: 11 24 eor r1, r1 12f8a: 9f 93 push r25 12f8c: 8f 93 push r24 12f8e: 40 91 c9 03 lds r20, 0x03C9 ; 0x8003c9 12f92: 50 91 ca 03 lds r21, 0x03CA ; 0x8003ca 12f96: 24 9f mul r18, r20 12f98: c0 01 movw r24, r0 12f9a: 25 9f mul r18, r21 12f9c: 90 0d add r25, r0 12f9e: 11 24 eor r1, r1 12fa0: 9f 93 push r25 12fa2: 8f 93 push r24 12fa4: 80 e3 ldi r24, 0x30 ; 48 12fa6: 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); 12fa8: 9f 93 push r25 12faa: 8f 93 push r24 12fac: 0f 94 de da call 0x3b5bc ; 0x3b5bc 12fb0: 0f 90 pop r0 12fb2: 0f 90 pop r0 12fb4: 0f 90 pop r0 12fb6: 0f 90 pop r0 12fb8: 0f 90 pop r0 12fba: 0f 90 pop r0 12fbc: 5a ce rjmp .-844 ; 0x12c72 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 12fbe: 84 e3 ldi r24, 0x34 ; 52 12fc0: 98 e8 ldi r25, 0x88 ; 136 12fc2: 0e 94 26 68 call 0xd04c ; 0xd04c 12fc6: 88 23 and r24, r24 12fc8: 11 f1 breq .+68 ; 0x1300e if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE) == PowerPanic::PRINT_TYPE_SD) { 12fca: 8c e8 ldi r24, 0x8C ; 140 12fcc: 9f e0 ldi r25, 0x0F ; 15 12fce: 0f 94 1c dc call 0x3b838 ; 0x3b838 12fd2: 81 11 cpse r24, r1 12fd4: 10 c0 rjmp .+32 ; 0x12ff6 // M24 - Start SD print enquecommand_P(MSG_M24); 12fd6: 61 e0 ldi r22, 0x01 ; 1 12fd8: 80 ef ldi r24, 0xF0 ; 240 12fda: 90 e7 ldi r25, 0x70 ; 112 12fdc: 0e 94 20 88 call 0x11040 ; 0x11040 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 12fe0: 60 e0 ldi r22, 0x00 ; 0 12fe2: 85 ea ldi r24, 0xA5 ; 165 12fe4: 9f e0 ldi r25, 0x0F ; 15 12fe6: 0f 94 40 dc call 0x3b880 ; 0x3b880 12fea: 60 e0 ldi r22, 0x00 ; 0 12fec: 8f e7 ldi r24, 0x7F ; 127 12fee: 9c e0 ldi r25, 0x0C ; 12 12ff0: 0f 94 40 dc call 0x3b880 ; 0x3b880 12ff4: 3e ce rjmp .-900 ; 0x12c72 // 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) { 12ff6: 81 30 cpi r24, 0x01 ; 1 12ff8: 09 f0 breq .+2 ; 0x12ffc 12ffa: 3b ce rjmp .-906 ; 0x12c72 // 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(); 12ffc: 0f 94 8d 42 call 0x2851a ; 0x2851a usb_timer.start(); 13000: 8e e0 ldi r24, 0x0E ; 14 13002: 95 e0 ldi r25, 0x05 ; 5 13004: 0f 94 ad 29 call 0x2535a ; 0x2535a ::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(); 13008: 0f 94 58 29 call 0x252b0 ; 0x252b0 1300c: 32 ce rjmp .-924 ; 0x12c72 } } else if (code_seen_P(PSTR("MMURES"))) { // PRUSA MMURES 1300e: 8d e2 ldi r24, 0x2D ; 45 13010: 98 e8 ldi r25, 0x88 ; 136 13012: 0e 94 26 68 call 0xd04c ; 0xd04c 13016: 88 23 and r24, r24 13018: 21 f0 breq .+8 ; 0x13022 break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 1301a: 80 e0 ldi r24, 0x00 ; 0 1301c: 0f 94 7c 0f call 0x21ef8 ; 0x21ef8 13020: 28 ce rjmp .-944 ; 0x12c72 MMU2::mmu2.Reset(MMU2::MMU2::Software); } else if (code_seen_P(PSTR("RESET"))) { // PRUSA RESET 13022: 87 e2 ldi r24, 0x27 ; 39 13024: 98 e8 ldi r25, 0x88 ; 136 13026: 0e 94 26 68 call 0xd04c ; 0xd04c 1302a: 88 23 and r24, r24 1302c: 51 f0 breq .+20 ; 0x13042 #if defined(XFLASH) && defined(BOOTAPP) boot_app_magic = 0; 1302e: 10 92 fc 1f sts 0x1FFC, r1 ; 0x801ffc <__bss_end+0x7dc> 13032: 10 92 fd 1f sts 0x1FFD, r1 ; 0x801ffd <__bss_end+0x7dd> 13036: 10 92 fe 1f sts 0x1FFE, r1 ; 0x801ffe <__bss_end+0x7de> 1303a: 10 92 ff 1f sts 0x1FFF, r1 ; 0x801fff <__bss_end+0x7df> #endif //defined(XFLASH) && defined(BOOTAPP) softReset(); 1303e: 0e 94 4c 67 call 0xce98 ; 0xce98 } else if (code_seen_P(PSTR("SN"))) { // PRUSA SN 13042: 84 e2 ldi r24, 0x24 ; 36 13044: 98 e8 ldi r25, 0x88 ; 136 13046: 0e 94 26 68 call 0xd04c ; 0xd04c 1304a: 88 23 and r24, r24 1304c: a9 f0 breq .+42 ; 0x13078 char SN[20]; eeprom_read_block(SN, (uint8_t*)EEPROM_PRUSA_SN, 20); 1304e: 44 e1 ldi r20, 0x14 ; 20 13050: 50 e0 ldi r21, 0x00 ; 0 13052: 65 e1 ldi r22, 0x15 ; 21 13054: 7d e0 ldi r23, 0x0D ; 13 13056: ce 01 movw r24, r28 13058: 01 96 adiw r24, 0x01 ; 1 1305a: 0f 94 0c dc call 0x3b818 ; 0x3b818 if (SN[19]) 1305e: 8c 89 ldd r24, Y+20 ; 0x14 13060: 88 23 and r24, r24 13062: 29 f0 breq .+10 ; 0x1306e puts_P(PSTR("SN invalid")); 13064: 89 e1 ldi r24, 0x19 ; 25 13066: 98 e8 ldi r25, 0x88 ; 136 13068: 0f 94 05 db call 0x3b60a ; 0x3b60a 1306c: 02 ce rjmp .-1020 ; 0x12c72 else puts(SN); 1306e: ce 01 movw r24, r28 13070: 01 96 adiw r24, 0x01 ; 1 13072: 0f 94 ab e2 call 0x3c556 ; 0x3c556 13076: fd cd rjmp .-1030 ; 0x12c72 } else if(code_seen_P(PSTR("Fir"))){ // PRUSA Fir 13078: 85 e1 ldi r24, 0x15 ; 21 1307a: 98 e8 ldi r25, 0x88 ; 136 1307c: 0e 94 26 68 call 0xd04c ; 0xd04c 13080: 88 23 and r24, r24 13082: 29 f0 breq .+10 ; 0x1308e SERIAL_PROTOCOLLNPGM(FW_VERSION_FULL); 13084: 89 e0 ldi r24, 0x09 ; 9 13086: 98 e8 ldi r25, 0x88 ; 136 else { SERIAL_ECHO_START; SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); SERIAL_ECHOLNPGM("\"(2)"); 13088: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 1308c: f2 cd rjmp .-1052 ; 0x12c72 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 1308e: 85 e0 ldi r24, 0x05 ; 5 13090: 98 e8 ldi r25, 0x88 ; 136 13092: 0e 94 26 68 call 0xd04c ; 0xd04c 13096: 88 23 and r24, r24 13098: 19 f0 breq .+6 ; 0x130a0 SERIAL_PROTOCOLLNPGM(FILAMENT_SIZE "-" ELECTRONICS "-" NOZZLE_TYPE ); 1309a: 88 ee ldi r24, 0xE8 ; 232 1309c: 97 e8 ldi r25, 0x87 ; 135 1309e: f4 cf rjmp .-24 ; 0x13088 } else if(code_seen_P(PSTR("Lang"))) { // PRUSA Lang 130a0: 83 ee ldi r24, 0xE3 ; 227 130a2: 97 e8 ldi r25, 0x87 ; 135 130a4: 0e 94 26 68 call 0xd04c ; 0xd04c 130a8: 88 23 and r24, r24 130aa: 19 f0 breq .+6 ; 0x130b2 lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { case 0: // Level 0: Language reset lang_reset(); 130ac: 0e 94 2c 71 call 0xe258 ; 0xe258 130b0: e0 cd rjmp .-1088 ; 0x12c72 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 130b2: 80 ee ldi r24, 0xE0 ; 224 130b4: 97 e8 ldi r25, 0x87 ; 135 130b6: 0e 94 26 68 call 0xd04c ; 0xd04c 130ba: 88 23 and r24, r24 130bc: 79 f0 breq .+30 ; 0x130dc eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 130be: 81 ea ldi r24, 0xA1 ; 161 130c0: 9d e0 ldi r25, 0x0D ; 13 130c2: 0f 94 1c dc call 0x3b838 ; 0x3b838 130c6: 4b e0 ldi r20, 0x0B ; 11 130c8: 84 9f mul r24, r20 130ca: c0 01 movw r24, r0 130cc: 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); 130ce: 70 e0 ldi r23, 0x00 ; 0 130d0: 60 e0 ldi r22, 0x00 ; 0 130d2: 80 5b subi r24, 0xB0 ; 176 130d4: 92 4f sbci r25, 0xF2 ; 242 130d6: 0f 94 5e dc call 0x3b8bc ; 0x3b8bc 130da: cb cd rjmp .-1130 ; 0x12c72 } else if(code_seen_P(PSTR("FR"))) { // PRUSA FR 130dc: 8d ed ldi r24, 0xDD ; 221 130de: 97 e8 ldi r25, 0x87 ; 135 130e0: 0e 94 26 68 call 0xd04c ; 0xd04c 130e4: 88 23 and r24, r24 130e6: 51 f0 breq .+20 ; 0x130fc // 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(); 130e8: 0e 94 13 6f call 0xde26 ; 0xde26 Sound_MakeCustom(100,0,false); 130ec: 40 e0 ldi r20, 0x00 ; 0 130ee: 70 e0 ldi r23, 0x00 ; 0 130f0: 60 e0 ldi r22, 0x00 ; 0 130f2: 84 e6 ldi r24, 0x64 ; 100 130f4: 90 e0 ldi r25, 0x00 ; 0 130f6: 0f 94 46 51 call 0x2a28c ; 0x2a28c 130fa: d8 cf rjmp .-80 ; 0x130ac 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 130fc: 89 ed ldi r24, 0xD9 ; 217 130fe: 97 e8 ldi r25, 0x87 ; 135 13100: 0e 94 26 68 call 0xd04c ; 0xd04c 13104: 88 23 and r24, r24 13106: e1 f0 breq .+56 ; 0x13140 // Change the MBL status without changing the logical Z position. if(code_seen('V')) { 13108: 86 e5 ldi r24, 0x56 ; 86 1310a: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 1310e: 88 23 and r24, r24 13110: 09 f4 brne .+2 ; 0x13114 13112: af cd rjmp .-1186 ; 0x12c72 bool value = code_value_short(); 13114: 0e 94 75 5b call 0xb6ea ; 0xb6ea 13118: 11 e0 ldi r17, 0x01 ; 1 1311a: 89 2b or r24, r25 1311c: 09 f4 brne .+2 ; 0x13120 1311e: 10 e0 ldi r17, 0x00 ; 0 st_synchronize(); 13120: 0f 94 e8 42 call 0x285d0 ; 0x285d0 if(value != mbl.active) { 13124: 80 91 c2 13 lds r24, 0x13C2 ; 0x8013c2 13128: 90 e0 ldi r25, 0x00 ; 0 1312a: 18 17 cp r17, r24 1312c: 19 06 cpc r1, r25 1312e: 09 f4 brne .+2 ; 0x13132 13130: a0 cd rjmp .-1216 ; 0x12c72 mbl.active = value; 13132: 10 93 c2 13 sts 0x13C2, r17 ; 0x8013c2 // Use plan_set_z_position to reset the physical values plan_set_z_position(current_position[Z_AXIS]); 13136: 8a e9 ldi r24, 0x9A ; 154 13138: 96 e0 ldi r25, 0x06 ; 6 1313a: 0f 94 f1 63 call 0x2c7e2 ; 0x2c7e2 1313e: 99 cd rjmp .-1230 ; 0x12c72 } } } else if (code_seen_P(PSTR("nozzle"))) { // PRUSA nozzle 13140: 82 ed ldi r24, 0xD2 ; 210 13142: 97 e8 ldi r25, 0x87 ; 135 13144: 0e 94 26 68 call 0xd04c ; 0xd04c 13148: 88 23 and r24, r24 1314a: 09 f4 brne .+2 ; 0x1314e 1314c: 92 cd rjmp .-1244 ; 0x12c72 uint16_t nDiameter; if(code_seen('D')) { 1314e: 84 e4 ldi r24, 0x44 ; 68 13150: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 13154: 88 23 and r24, r24 13156: a1 f0 breq .+40 ; 0x13180 nDiameter=(uint16_t)(code_value()*1000.0+0.5); // [,um] 13158: 0e 94 9d 60 call 0xc13a ; 0xc13a 1315c: 20 e0 ldi r18, 0x00 ; 0 1315e: 30 e0 ldi r19, 0x00 ; 0 13160: 4a e7 ldi r20, 0x7A ; 122 13162: 54 e4 ldi r21, 0x44 ; 68 13164: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 13168: 20 e0 ldi r18, 0x00 ; 0 1316a: 30 e0 ldi r19, 0x00 ; 0 1316c: 40 e0 ldi r20, 0x00 ; 0 1316e: 5f e3 ldi r21, 0x3F ; 63 13170: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 13174: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> nozzle_diameter_check(nDiameter); 13178: cb 01 movw r24, r22 1317a: 0e 94 30 f5 call 0x1ea60 ; 0x1ea60 1317e: 79 cd rjmp .-1294 ; 0x12c72 } else if(code_seen_P(PSTR("set")) && farm_mode) { 13180: 8e ec ldi r24, 0xCE ; 206 13182: 97 e8 ldi r25, 0x87 ; 135 13184: 0e 94 26 68 call 0xd04c ; 0xd04c 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); 13188: 85 ea ldi r24, 0xA5 ; 165 1318a: 9d e0 ldi r25, 0x0D ; 13 1318c: 0f 94 2a dc call 0x3b854 ; 0x3b854 13190: bc 01 movw r22, r24 13192: 90 e0 ldi r25, 0x00 ; 0 13194: 80 e0 ldi r24, 0x00 ; 0 13196: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 1319a: 20 e0 ldi r18, 0x00 ; 0 1319c: 30 e0 ldi r19, 0x00 ; 0 1319e: 4a e7 ldi r20, 0x7A ; 122 131a0: 54 e4 ldi r21, 0x44 ; 68 131a2: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 131a6: 0f 94 b4 74 call 0x2e968 ; 0x2e968 131aa: 63 cd rjmp .-1338 ; 0x12c72 } } else if(*CMDBUFFER_CURRENT_STRING == 'G') 131ac: d8 01 movw r26, r16 131ae: 8c 91 ld r24, X 131b0: 87 34 cpi r24, 0x47 ; 71 131b2: 11 f0 breq .+4 ; 0x131b8 131b4: 0c 94 71 a4 jmp 0x148e2 ; 0x148e2 { strchr_pointer = CMDBUFFER_CURRENT_STRING; 131b8: 10 93 96 03 sts 0x0396, r17 ; 0x800396 131bc: 00 93 95 03 sts 0x0395, r16 ; 0x800395 gcode_in_progress = code_value_short(); 131c0: 0e 94 75 5b call 0xb6ea ; 0xb6ea 131c4: 90 93 94 03 sts 0x0394, r25 ; 0x800394 131c8: 80 93 93 03 sts 0x0393, r24 ; 0x800393 // printf_P(_N("BEGIN G-CODE=%u\n"), gcode_in_progress); switch (gcode_in_progress) 131cc: 8e 31 cpi r24, 0x1E ; 30 131ce: 91 05 cpc r25, r1 131d0: 09 f4 brne .+2 ; 0x131d4 131d2: da c6 rjmp .+3508 ; 0x13f88 131d4: 0c f0 brlt .+2 ; 0x131d8 131d6: 45 c1 rjmp .+650 ; 0x13462 131d8: 84 30 cpi r24, 0x04 ; 4 131da: 91 05 cpc r25, r1 131dc: 09 f4 brne .+2 ; 0x131e0 131de: 7e c6 rjmp .+3324 ; 0x13edc 131e0: 0c f0 brlt .+2 ; 0x131e4 131e2: c5 c0 rjmp .+394 ; 0x1336e 131e4: 97 fd sbrc r25, 7 131e6: cb c0 rjmp .+406 ; 0x1337e 131e8: 02 97 sbiw r24, 0x02 ; 2 131ea: 0c f0 brlt .+2 ; 0x131ee 131ec: fc c1 rjmp .+1016 ; 0x135e6 */ case 0: // G0 -> G1 case 1: // G1 { uint16_t start_segment_idx = restore_interrupted_gcode(); 131ee: 0e 94 73 5a call 0xb4e6 ; 0xb4e6 131f2: 8c 01 movw r16, r24 get_coordinates(); // For X Y Z E F 131f4: 0e 94 c4 61 call 0xc388 ; 0xc388 if (total_filament_used > ((current_position[E_AXIS] - destination[E_AXIS]) * 100)) { //protection against total_filament_used overflow 131f8: 60 91 65 06 lds r22, 0x0665 ; 0x800665 131fc: 70 91 66 06 lds r23, 0x0666 ; 0x800666 13200: 80 91 67 06 lds r24, 0x0667 ; 0x800667 13204: 90 91 68 06 lds r25, 0x0668 ; 0x800668 13208: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 1320c: 6b 01 movw r12, r22 1320e: 7c 01 movw r14, r24 13210: 40 90 9e 06 lds r4, 0x069E ; 0x80069e 13214: 50 90 9f 06 lds r5, 0x069F ; 0x80069f 13218: 60 90 a0 06 lds r6, 0x06A0 ; 0x8006a0 1321c: 70 90 a1 06 lds r7, 0x06A1 ; 0x8006a1 13220: 80 90 80 06 lds r8, 0x0680 ; 0x800680 13224: 90 90 81 06 lds r9, 0x0681 ; 0x800681 13228: a0 90 82 06 lds r10, 0x0682 ; 0x800682 1322c: b0 90 83 06 lds r11, 0x0683 ; 0x800683 13230: a5 01 movw r20, r10 13232: 94 01 movw r18, r8 13234: c3 01 movw r24, r6 13236: b2 01 movw r22, r4 13238: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 1323c: 20 e0 ldi r18, 0x00 ; 0 1323e: 30 e0 ldi r19, 0x00 ; 0 13240: 48 ec ldi r20, 0xC8 ; 200 13242: 52 e4 ldi r21, 0x42 ; 66 13244: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 13248: 9b 01 movw r18, r22 1324a: ac 01 movw r20, r24 1324c: c7 01 movw r24, r14 1324e: b6 01 movw r22, r12 13250: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 13254: 18 16 cp r1, r24 13256: d4 f4 brge .+52 ; 0x1328c total_filament_used = total_filament_used + ((destination[E_AXIS] - current_position[E_AXIS]) * 100); 13258: a3 01 movw r20, r6 1325a: 92 01 movw r18, r4 1325c: c5 01 movw r24, r10 1325e: b4 01 movw r22, r8 13260: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 13264: 20 e0 ldi r18, 0x00 ; 0 13266: 30 e0 ldi r19, 0x00 ; 0 13268: 48 ec ldi r20, 0xC8 ; 200 1326a: 52 e4 ldi r21, 0x42 ; 66 1326c: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 13270: a7 01 movw r20, r14 13272: 96 01 movw r18, r12 13274: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 13278: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 1327c: 60 93 65 06 sts 0x0665, r22 ; 0x800665 13280: 70 93 66 06 sts 0x0666, r23 ; 0x800666 13284: 80 93 67 06 sts 0x0667, r24 ; 0x800667 13288: 90 93 68 06 sts 0x0668, r25 ; 0x800668 } #ifdef FWRETRACT if(cs.autoretract_enabled) { 1328c: 80 91 40 0e lds r24, 0x0E40 ; 0x800e40 13290: 88 23 and r24, r24 13292: 09 f4 brne .+2 ; 0x13296 13294: a4 c1 rjmp .+840 ; 0x135de if( !(code_seen('X') || code_seen('Y') || code_seen('Z')) && code_seen('E')) { 13296: 88 e5 ldi r24, 0x58 ; 88 13298: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 1329c: 81 11 cpse r24, r1 1329e: 9f c1 rjmp .+830 ; 0x135de 132a0: 89 e5 ldi r24, 0x59 ; 89 132a2: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 132a6: 81 11 cpse r24, r1 132a8: 9a c1 rjmp .+820 ; 0x135de 132aa: 8a e5 ldi r24, 0x5A ; 90 132ac: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 132b0: 81 11 cpse r24, r1 132b2: 95 c1 rjmp .+810 ; 0x135de 132b4: 85 e4 ldi r24, 0x45 ; 69 132b6: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 132ba: 88 23 and r24, r24 132bc: 09 f4 brne .+2 ; 0x132c0 132be: 8f c1 rjmp .+798 ; 0x135de float echange=destination[E_AXIS]-current_position[E_AXIS]; 132c0: 20 91 9e 06 lds r18, 0x069E ; 0x80069e 132c4: 30 91 9f 06 lds r19, 0x069F ; 0x80069f 132c8: 40 91 a0 06 lds r20, 0x06A0 ; 0x8006a0 132cc: 50 91 a1 06 lds r21, 0x06A1 ; 0x8006a1 132d0: 60 91 80 06 lds r22, 0x0680 ; 0x800680 132d4: 70 91 81 06 lds r23, 0x0681 ; 0x800681 132d8: 80 91 82 06 lds r24, 0x0682 ; 0x800682 132dc: 90 91 83 06 lds r25, 0x0683 ; 0x800683 132e0: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 132e4: 6b 01 movw r12, r22 132e6: 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 132e8: 2d ec ldi r18, 0xCD ; 205 132ea: 3c ec ldi r19, 0xCC ; 204 132ec: 4c ec ldi r20, 0xCC ; 204 132ee: 5d eb ldi r21, 0xBD ; 189 132f0: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 132f4: 87 ff sbrs r24, 7 132f6: 65 c1 rjmp .+714 ; 0x135c2 132f8: 80 91 8e 06 lds r24, 0x068E ; 0x80068e 132fc: 81 11 cpse r24, r1 132fe: 0c 94 2e cc jmp 0x1985c ; 0x1985c st_synchronize(); 13302: 0f 94 e8 42 call 0x285d0 ; 0x285d0 current_position[E_AXIS] = destination[E_AXIS]; //hide the slicer-generated retract/recover from calculations 13306: 80 91 80 06 lds r24, 0x0680 ; 0x800680 1330a: 90 91 81 06 lds r25, 0x0681 ; 0x800681 1330e: a0 91 82 06 lds r26, 0x0682 ; 0x800682 13312: b0 91 83 06 lds r27, 0x0683 ; 0x800683 13316: 80 93 9e 06 sts 0x069E, r24 ; 0x80069e 1331a: 90 93 9f 06 sts 0x069F, r25 ; 0x80069f 1331e: a0 93 a0 06 sts 0x06A0, r26 ; 0x8006a0 13322: b0 93 a1 06 sts 0x06A1, r27 ; 0x8006a1 plan_set_e_position(current_position[E_AXIS]); //AND from the planner 13326: 8e e9 ldi r24, 0x9E ; 158 13328: 96 e0 ldi r25, 0x06 ; 6 1332a: 0f 94 be 63 call 0x2c77c ; 0x2c77c retract(!retracted[active_extruder]); 1332e: 90 91 8e 06 lds r25, 0x068E ; 0x80068e 13332: 81 e0 ldi r24, 0x01 ; 1 13334: 89 27 eor r24, r25 13336: 0f 94 28 8a call 0x31450 ; 0x31450 SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); SERIAL_ECHOLNPGM("\"(2)"); } KEEPALIVE_STATE(NOT_BUSY); ClearToSend(); } 1333a: c1 57 subi r28, 0x71 ; 113 1333c: df 4f sbci r29, 0xFF ; 255 1333e: 0f b6 in r0, 0x3f ; 63 13340: f8 94 cli 13342: de bf out 0x3e, r29 ; 62 13344: 0f be out 0x3f, r0 ; 63 13346: cd bf out 0x3d, r28 ; 61 13348: df 91 pop r29 1334a: cf 91 pop r28 1334c: 1f 91 pop r17 1334e: 0f 91 pop r16 13350: ff 90 pop r15 13352: ef 90 pop r14 13354: df 90 pop r13 13356: cf 90 pop r12 13358: bf 90 pop r11 1335a: af 90 pop r10 1335c: 9f 90 pop r9 1335e: 8f 90 pop r8 13360: 7f 90 pop r7 13362: 6f 90 pop r6 13364: 5f 90 pop r5 13366: 4f 90 pop r4 13368: 3f 90 pop r3 1336a: 2f 90 pop r2 1336c: 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) 1336e: 8b 30 cpi r24, 0x0B ; 11 13370: 91 05 cpc r25, r1 13372: 09 f4 brne .+2 ; 0x13376 13374: 00 c6 rjmp .+3072 ; 0x13f76 13376: dc f4 brge .+54 ; 0x133ae 13378: 0a 97 sbiw r24, 0x0a ; 10 1337a: 09 f4 brne .+2 ; 0x1337e 1337c: f8 c5 rjmp .+3056 ; 0x13f6e case 99: farm_gcode_g99(); break; #endif //PRUSA_FARM default: printf_P(MSG_UNKNOWN_CODE, 'G', cmdbuffer + bufindr + CMDHDRSIZE); 1337e: 80 91 92 12 lds r24, 0x1292 ; 0x801292 13382: 90 91 93 12 lds r25, 0x1293 ; 0x801293 13386: 88 55 subi r24, 0x58 ; 88 13388: 9f 4e sbci r25, 0xEF ; 239 1338a: 9f 93 push r25 1338c: 8f 93 push r24 1338e: 1f 92 push r1 13390: 87 e4 ldi r24, 0x47 ; 71 13392: 8f 93 push r24 13394: 82 e5 ldi r24, 0x52 ; 82 13396: 99 e6 ldi r25, 0x69 ; 105 13398: 9f 93 push r25 1339a: 8f 93 push r24 1339c: 0f 94 de da call 0x3b5bc ; 0x3b5bc 133a0: 0f 90 pop r0 133a2: 0f 90 pop r0 133a4: 0f 90 pop r0 133a6: 0f 90 pop r0 133a8: 0f 90 pop r0 133aa: 0f 90 pop r0 133ac: a5 c0 rjmp .+330 ; 0x134f8 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) 133ae: 85 31 cpi r24, 0x15 ; 21 133b0: 91 05 cpc r25, r1 133b2: 09 f4 brne .+2 ; 0x133b6 133b4: a1 c0 rjmp .+322 ; 0x134f8 133b6: 4c 97 sbiw r24, 0x1c ; 28 133b8: 11 f7 brne .-60 ; 0x1337e { 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]); 133ba: 88 e5 ldi r24, 0x58 ; 88 133bc: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 133c0: 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; 133c2: 41 2c mov r4, r1 133c4: 51 2c mov r5, r1 133c6: 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(); 133c8: 88 23 and r24, r24 133ca: 21 f0 breq .+8 ; 0x133d4 133cc: 0e 94 82 5b call 0xb704 ; 0xb704 133d0: 2b 01 movw r4, r22 133d2: 3c 01 movw r6, r24 bool home_y = code_seen(axis_codes[Y_AXIS]); 133d4: 89 e5 ldi r24, 0x59 ; 89 133d6: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 133da: 28 2e mov r2, r24 if (home_y) home_y_value = code_value_long(); 133dc: 88 23 and r24, r24 133de: 09 f4 brne .+2 ; 0x133e2 133e0: cc c5 rjmp .+2968 ; 0x13f7a 133e2: 0e 94 82 5b call 0xb704 ; 0xb704 133e6: 6e 96 adiw r28, 0x1e ; 30 133e8: 6c af std Y+60, r22 ; 0x3c 133ea: 7d af std Y+61, r23 ; 0x3d 133ec: 8e af std Y+62, r24 ; 0x3e 133ee: 9f af std Y+63, r25 ; 0x3f 133f0: 6e 97 sbiw r28, 0x1e ; 30 bool home_z = code_seen(axis_codes[Z_AXIS]); 133f2: 8a e5 ldi r24, 0x5A ; 90 133f4: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 133f8: d8 2e mov r13, r24 */ case 28: { long home_x_value = 0; long home_y_value = 0; long home_z_value = 0; 133fa: 81 2c mov r8, r1 133fc: 91 2c mov r9, r1 133fe: 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(); 13400: 88 23 and r24, r24 13402: 21 f0 breq .+8 ; 0x1340c 13404: 0e 94 82 5b call 0xb704 ; 0xb704 13408: 4b 01 movw r8, r22 1340a: 5c 01 movw r10, r24 bool without_mbl = code_seen('W'); 1340c: 87 e5 ldi r24, 0x57 ; 87 1340e: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 13412: 67 96 adiw r28, 0x17 ; 23 13414: 8f af std Y+63, r24 ; 0x3f 13416: 67 97 sbiw r28, 0x17 ; 23 // calibrate? #ifdef TMC2130 bool calib = code_seen('C'); 13418: 83 e4 ldi r24, 0x43 ; 67 1341a: 0e 94 d6 5b call 0xb7ac ; 0xb7ac gcode_G28(home_x, home_x_value, home_y, home_y_value, home_z, home_z_value, calib, without_mbl); 1341e: 67 96 adiw r28, 0x17 ; 23 13420: ff ad ldd r31, Y+63 ; 0x3f 13422: 67 97 sbiw r28, 0x17 ; 23 13424: ff 93 push r31 13426: 8f 93 push r24 13428: cd 2c mov r12, r13 1342a: 6e 96 adiw r28, 0x1e ; 30 1342c: ec ac ldd r14, Y+60 ; 0x3c 1342e: fd ac ldd r15, Y+61 ; 0x3d 13430: 0e ad ldd r16, Y+62 ; 0x3e 13432: 1f ad ldd r17, Y+63 ; 0x3f 13434: 6e 97 sbiw r28, 0x1e ; 30 13436: 22 2d mov r18, r2 13438: b3 01 movw r22, r6 1343a: a2 01 movw r20, r4 1343c: 83 2d mov r24, r3 1343e: 0e 94 27 7d call 0xfa4e ; 0xfa4e #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) { 13442: 0f 90 pop r0 13444: 0f 90 pop r0 13446: 31 10 cpse r3, r1 13448: 57 c0 rjmp .+174 ; 0x134f8 1344a: 21 10 cpse r2, r1 1344c: 55 c0 rjmp .+170 ; 0x134f8 1344e: 67 96 adiw r28, 0x17 ; 23 13450: 2f ad ldd r18, Y+63 ; 0x3f 13452: 67 97 sbiw r28, 0x17 ; 23 13454: 21 11 cpse r18, r1 13456: 50 c0 rjmp .+160 ; 0x134f8 13458: d1 10 cpse r13, r1 1345a: 4e c0 rjmp .+156 ; 0x134f8 - `W` - area width (on X axis) - `H` - area height (on Y axis) */ case 80: { gcode_G80(); 1345c: 0e 94 f4 8d call 0x11be8 ; 0x11be8 13460: 4b c0 rjmp .+150 ; 0x134f8 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) 13462: 86 35 cpi r24, 0x56 ; 86 13464: 91 05 cpc r25, r1 13466: 11 f4 brne .+4 ; 0x1346c 13468: 0c 94 20 a4 jmp 0x14840 ; 0x14840 1346c: b4 f5 brge .+108 ; 0x134da 1346e: 8c 34 cpi r24, 0x4C ; 76 13470: 91 05 cpc r25, r1 13472: 09 f4 brne .+2 ; 0x13476 13474: df c5 rjmp .+3006 ; 0x14034 13476: 3c f5 brge .+78 ; 0x134c6 13478: 08 e2 ldi r16, 0x28 ; 40 1347a: 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)); 1347c: f2 e0 ldi r31, 0x02 ; 2 1347e: ef 2e mov r14, r31 13480: fa e6 ldi r31, 0x6A ; 106 13482: 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) 13484: 8b 34 cpi r24, 0x4B ; 75 13486: 91 05 cpc r25, r1 13488: 09 f0 breq .+2 ; 0x1348c 1348a: 79 cf rjmp .-270 ; 0x1337e 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)); 1348c: 60 2f mov r22, r16 1348e: 70 e0 ldi r23, 0x00 ; 0 13490: 90 e0 ldi r25, 0x00 ; 0 13492: 80 e0 ldi r24, 0x00 ; 0 13494: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 13498: 0e 94 8a 5c call 0xb914 ; 0xb914 1349c: 9f 93 push r25 1349e: 8f 93 push r24 134a0: 7f 93 push r23 134a2: 6f 93 push r22 134a4: 1f 93 push r17 134a6: 0f 93 push r16 134a8: ff 92 push r15 134aa: ef 92 push r14 134ac: 0f 94 de da call 0x3b5bc ; 0x3b5bc 134b0: 0f 5f subi r16, 0xFF ; 255 134b2: 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++) 134b4: 0f b6 in r0, 0x3f ; 63 134b6: f8 94 cli 134b8: de bf out 0x3e, r29 ; 62 134ba: 0f be out 0x3f, r0 ; 63 134bc: cd bf out 0x3d, r28 ; 61 134be: 0f 36 cpi r16, 0x6F ; 111 134c0: 11 05 cpc r17, r1 134c2: 21 f7 brne .-56 ; 0x1348c 134c4: 19 c0 rjmp .+50 ; 0x134f8 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) 134c6: 80 35 cpi r24, 0x50 ; 80 134c8: 91 05 cpc r25, r1 134ca: 41 f2 breq .-112 ; 0x1345c 134cc: 81 35 cpi r24, 0x51 ; 81 134ce: 91 05 cpc r25, r1 134d0: 09 f0 breq .+2 ; 0x134d4 134d2: 55 cf rjmp .-342 ; 0x1337e /*! ### 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(); 134d4: 0e 94 5b 7f call 0xfeb6 ; 0xfeb6 134d8: 0f c0 rjmp .+30 ; 0x134f8 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) 134da: 8a 35 cpi r24, 0x5A ; 90 134dc: 91 05 cpc r25, r1 134de: 11 f4 brne .+4 ; 0x134e4 134e0: 0c 94 2a a4 jmp 0x14854 ; 0x14854 134e4: 74 f4 brge .+28 ; 0x13502 134e6: 87 35 cpi r24, 0x57 ; 87 134e8: 91 05 cpc r25, r1 134ea: 11 f4 brne .+4 ; 0x134f0 134ec: 0c 94 25 a4 jmp 0x1484a ; 0x1484a 134f0: 88 35 cpi r24, 0x58 ; 88 134f2: 91 05 cpc r25, r1 134f4: 09 f0 breq .+2 ; 0x134f8 134f6: 43 cf rjmp .-378 ; 0x1337e #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; 134f8: 10 92 94 03 sts 0x0394, r1 ; 0x800394 134fc: 10 92 93 03 sts 0x0393, r1 ; 0x800393 13500: b8 cb rjmp .-2192 ; 0x12c72 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) 13502: 8b 35 cpi r24, 0x5B ; 91 13504: 91 05 cpc r25, r1 13506: 11 f4 brne .+4 ; 0x1350c 13508: 0c 94 31 a4 jmp 0x14862 ; 0x14862 1350c: 8c 35 cpi r24, 0x5C ; 92 1350e: 91 05 cpc r25, r1 13510: 09 f0 breq .+2 ; 0x13514 13512: 35 cf rjmp .-406 ; 0x1337e 13514: 1d ed ldi r17, 0xDD ; 221 13516: c1 2e mov r12, r17 13518: 12 e0 ldi r17, 0x02 ; 2 1351a: d1 2e mov r13, r17 1351c: 8e 01 movw r16, r28 1351e: 0f 5b subi r16, 0xBF ; 191 13520: 1f 4f sbci r17, 0xFF ; 255 13522: 9e 01 movw r18, r28 13524: 2f 5f subi r18, 0xFF ; 255 13526: 3f 4f sbci r19, 0xFF ; 255 13528: 79 01 movw r14, r18 1352a: 81 ee ldi r24, 0xE1 ; 225 1352c: 88 2e mov r8, r24 1352e: 82 e0 ldi r24, 0x02 ; 2 13530: 98 2e mov r9, r24 13532: 58 01 movw r10, r16 13534: 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]); 13536: d6 01 movw r26, r12 13538: 8d 91 ld r24, X+ 1353a: 6d 01 movw r12, r26 1353c: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 13540: f5 01 movw r30, r10 13542: 81 93 st Z+, r24 13544: 5f 01 movw r10, r30 if(codes[i]) 13546: 88 23 and r24, r24 13548: 41 f0 breq .+16 ; 0x1355a values[i] = code_value(); 1354a: 0e 94 9d 60 call 0xc13a ; 0xc13a 1354e: d7 01 movw r26, r14 13550: 6d 93 st X+, r22 13552: 7d 93 st X+, r23 13554: 8d 93 st X+, r24 13556: 9c 93 st X, r25 13558: 13 97 sbiw r26, 0x03 ; 3 1355a: b4 e0 ldi r27, 0x04 ; 4 1355c: eb 0e add r14, r27 1355e: 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) 13560: 8c 14 cp r8, r12 13562: 9d 04 cpc r9, r13 13564: 41 f7 brne .-48 ; 0x13536 codes[i] = code_seen(axis_codes[i]); if(codes[i]) values[i] = code_value(); } if((codes[E_AXIS] && values[E_AXIS] == 0) && 13566: f8 01 movw r30, r16 13568: d3 80 ldd r13, Z+3 ; 0x03 1356a: dd 20 and r13, r13 1356c: 11 f4 brne .+4 ; 0x13572 1356e: 0c 94 35 a4 jmp 0x1486a ; 0x1486a 13572: 20 e0 ldi r18, 0x00 ; 0 13574: 30 e0 ldi r19, 0x00 ; 0 13576: a9 01 movw r20, r18 13578: 6d 85 ldd r22, Y+13 ; 0x0d 1357a: 7e 85 ldd r23, Y+14 ; 0x0e 1357c: 8f 85 ldd r24, Y+15 ; 0x0f 1357e: 98 89 ldd r25, Y+16 ; 0x10 13580: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 13584: 81 11 cpse r24, r1 13586: 0c 94 35 a4 jmp 0x1486a ; 0x1486a 1358a: d8 01 movw r26, r16 1358c: 8c 91 ld r24, X 1358e: 81 11 cpse r24, r1 13590: 0c 94 35 a4 jmp 0x1486a ; 0x1486a (!codes[X_AXIS] && !codes[Y_AXIS] && !codes[Z_AXIS])) 13594: 11 96 adiw r26, 0x01 ; 1 13596: 8c 91 ld r24, X 13598: 11 97 sbiw r26, 0x01 ; 1 1359a: 81 11 cpse r24, r1 1359c: 0c 94 35 a4 jmp 0x1486a ; 0x1486a 135a0: 12 96 adiw r26, 0x02 ; 2 135a2: 8c 91 ld r24, X 135a4: 81 11 cpse r24, r1 135a6: 0c 94 35 a4 jmp 0x1486a ; 0x1486a { // 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; 135aa: 10 92 9e 06 sts 0x069E, r1 ; 0x80069e 135ae: 10 92 9f 06 sts 0x069F, r1 ; 0x80069f 135b2: 10 92 a0 06 sts 0x06A0, r1 ; 0x8006a0 135b6: 10 92 a1 06 sts 0x06A1, r1 ; 0x8006a1 st_set_e_position(position[E_AXIS]); } void plan_reset_next_e() { plan_reset_next_e_queue = true; 135ba: 81 e0 ldi r24, 0x01 ; 1 135bc: 80 93 b8 04 sts 0x04B8, r24 ; 0x8004b8 <_ZL23plan_reset_next_e_queue.lto_priv.486> 135c0: 9b cf rjmp .-202 ; 0x134f8 #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 135c2: 2d ec ldi r18, 0xCD ; 205 135c4: 3c ec ldi r19, 0xCC ; 204 135c6: 4c ec ldi r20, 0xCC ; 204 135c8: 5d e3 ldi r21, 0x3D ; 61 135ca: c7 01 movw r24, r14 135cc: b6 01 movw r22, r12 135ce: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 135d2: 18 16 cp r1, r24 135d4: 24 f4 brge .+8 ; 0x135de 135d6: 80 91 8e 06 lds r24, 0x068E ; 0x80068e 135da: 81 11 cpse r24, r1 135dc: 92 ce rjmp .-732 ; 0x13302 } } } #endif //FWRETRACT prepare_move(start_segment_idx); 135de: c8 01 movw r24, r16 135e0: 0e 94 08 6c call 0xd810 ; 0xd810 135e4: 89 cf rjmp .-238 ; 0x134f8 */ case 2: case 3: { uint16_t start_segment_idx = restore_interrupted_gcode(); 135e6: 0e 94 73 5a call 0xb4e6 ; 0xb4e6 135ea: e0 96 adiw r28, 0x30 ; 48 135ec: 9f af std Y+63, r25 ; 0x3f 135ee: 8e af std Y+62, r24 ; 0x3e 135f0: 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 135f2: 0e 94 c4 61 call 0xc388 ; 0xc388 #ifdef SF_ARC_FIX relative_mode=relative_mode_backup; #endif offset[0] = code_seen('I') ? code_value() : 0.f; 135f6: 89 e4 ldi r24, 0x49 ; 73 135f8: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 135fc: 88 23 and r24, r24 135fe: 09 f4 brne .+2 ; 0x13602 13600: 00 c4 rjmp .+2048 ; 0x13e02 13602: 0e 94 9d 60 call 0xc13a ; 0xc13a 13606: 60 93 8b 03 sts 0x038B, r22 ; 0x80038b 1360a: 70 93 8c 03 sts 0x038C, r23 ; 0x80038c 1360e: 80 93 8d 03 sts 0x038D, r24 ; 0x80038d 13612: 90 93 8e 03 sts 0x038E, r25 ; 0x80038e offset[1] = code_seen('J') ? code_value() : 0.f; 13616: 8a e4 ldi r24, 0x4A ; 74 13618: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 1361c: c1 2c mov r12, r1 1361e: d1 2c mov r13, r1 13620: 76 01 movw r14, r12 13622: 88 23 and r24, r24 13624: 21 f0 breq .+8 ; 0x1362e 13626: 0e 94 9d 60 call 0xc13a ; 0xc13a 1362a: 6b 01 movw r12, r22 1362c: 7c 01 movw r14, r24 1362e: c0 92 8f 03 sts 0x038F, r12 ; 0x80038f 13632: d0 92 90 03 sts 0x0390, r13 ; 0x800390 13636: e0 92 91 03 sts 0x0391, r14 ; 0x800391 1363a: f0 92 92 03 sts 0x0392, r15 ; 0x800392 prepare_arc_move((gcode_in_progress == 2), start_segment_idx); 1363e: e0 91 93 03 lds r30, 0x0393 ; 0x800393 13642: f0 91 94 03 lds r31, 0x0394 ; 0x800394 13646: c2 57 subi r28, 0x72 ; 114 13648: df 4f sbci r29, 0xFF ; 255 1364a: f9 83 std Y+1, r31 ; 0x01 1364c: e8 83 st Y, r30 1364e: ce 58 subi r28, 0x8E ; 142 13650: 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 13652: 80 90 8b 03 lds r8, 0x038B ; 0x80038b 13656: 90 90 8c 03 lds r9, 0x038C ; 0x80038c 1365a: a0 90 8d 03 lds r10, 0x038D ; 0x80038d 1365e: b0 90 8e 03 lds r11, 0x038E ; 0x80038e 13662: a7 01 movw r20, r14 13664: 96 01 movw r18, r12 13666: c5 01 movw r24, r10 13668: b4 01 movw r22, r8 1366a: 0f 94 e0 df call 0x3bfc0 ; 0x3bfc0 1366e: ae 96 adiw r28, 0x2e ; 46 13670: 6c af std Y+60, r22 ; 0x3c 13672: 7d af std Y+61, r23 ; 0x3d 13674: 8e af std Y+62, r24 ; 0x3e 13676: 9f af std Y+63, r25 ; 0x3f 13678: 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); 1367a: 60 91 39 02 lds r22, 0x0239 ; 0x800239 1367e: 70 91 3a 02 lds r23, 0x023A ; 0x80023a 13682: 07 2e mov r0, r23 13684: 00 0c add r0, r0 13686: 88 0b sbc r24, r24 13688: 99 0b sbc r25, r25 1368a: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 1368e: 20 91 b8 02 lds r18, 0x02B8 ; 0x8002b8 13692: 30 91 b9 02 lds r19, 0x02B9 ; 0x8002b9 13696: 40 91 ba 02 lds r20, 0x02BA ; 0x8002ba 1369a: 50 91 bb 02 lds r21, 0x02BB ; 0x8002bb 1369e: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 136a2: 2e e3 ldi r18, 0x3E ; 62 136a4: 33 ec ldi r19, 0xC3 ; 195 136a6: 4e e2 ldi r20, 0x2E ; 46 136a8: 59 e3 ldi r21, 0x39 ; 57 136aa: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 136ae: aa 96 adiw r28, 0x2a ; 42 136b0: 6c af std Y+60, r22 ; 0x3c 136b2: 7d af std Y+61, r23 ; 0x3d 136b4: 8e af std Y+62, r24 ; 0x3e 136b6: 9f af std Y+63, r25 ; 0x3f 136b8: 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)); 136ba: 80 e1 ldi r24, 0x10 ; 16 136bc: e2 e9 ldi r30, 0x92 ; 146 136be: f6 e0 ldi r31, 0x06 ; 6 136c0: de 01 movw r26, r28 136c2: 11 96 adiw r26, 0x01 ; 1 136c4: 01 90 ld r0, Z+ 136c6: 0d 92 st X+, r0 136c8: 8a 95 dec r24 136ca: e1 f7 brne .-8 ; 0x136c4 float r_axis_x = -offset[X_AXIS]; // Radius vector from center to current location 136cc: a5 01 movw r20, r10 136ce: 94 01 movw r18, r8 136d0: 50 58 subi r21, 0x80 ; 128 136d2: 6e 96 adiw r28, 0x1e ; 30 136d4: 2c af std Y+60, r18 ; 0x3c 136d6: 3d af std Y+61, r19 ; 0x3d 136d8: 4e af std Y+62, r20 ; 0x3e 136da: 5f af std Y+63, r21 ; 0x3f 136dc: 6e 97 sbiw r28, 0x1e ; 30 float r_axis_y = -offset[Y_AXIS]; 136de: d7 01 movw r26, r14 136e0: c6 01 movw r24, r12 136e2: b0 58 subi r27, 0x80 ; 128 136e4: 6a 96 adiw r28, 0x1a ; 26 136e6: 8c af std Y+60, r24 ; 0x3c 136e8: 9d af std Y+61, r25 ; 0x3d 136ea: ae af std Y+62, r26 ; 0x3e 136ec: bf af std Y+63, r27 ; 0x3f 136ee: 6a 97 sbiw r28, 0x1a ; 26 float center_axis_x = start_position[X_AXIS] - r_axis_x; 136f0: 29 81 ldd r18, Y+1 ; 0x01 136f2: 3a 81 ldd r19, Y+2 ; 0x02 136f4: 4b 81 ldd r20, Y+3 ; 0x03 136f6: 5c 81 ldd r21, Y+4 ; 0x04 136f8: e6 96 adiw r28, 0x36 ; 54 136fa: 2c af std Y+60, r18 ; 0x3c 136fc: 3d af std Y+61, r19 ; 0x3d 136fe: 4e af std Y+62, r20 ; 0x3e 13700: 5f af std Y+63, r21 ; 0x3f 13702: e6 97 sbiw r28, 0x36 ; 54 13704: c5 01 movw r24, r10 13706: b4 01 movw r22, r8 13708: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 1370c: ea 96 adiw r28, 0x3a ; 58 1370e: 6c af std Y+60, r22 ; 0x3c 13710: 7d af std Y+61, r23 ; 0x3d 13712: 8e af std Y+62, r24 ; 0x3e 13714: 9f af std Y+63, r25 ; 0x3f 13716: ea 97 sbiw r28, 0x3a ; 58 float center_axis_y = start_position[Y_AXIS] - r_axis_y; 13718: 8d 81 ldd r24, Y+5 ; 0x05 1371a: 9e 81 ldd r25, Y+6 ; 0x06 1371c: af 81 ldd r26, Y+7 ; 0x07 1371e: b8 85 ldd r27, Y+8 ; 0x08 13720: ee 96 adiw r28, 0x3e ; 62 13722: 8c af std Y+60, r24 ; 0x3c 13724: 9d af std Y+61, r25 ; 0x3d 13726: ae af std Y+62, r26 ; 0x3e 13728: bf af std Y+63, r27 ; 0x3f 1372a: ee 97 sbiw r28, 0x3e ; 62 1372c: 9c 01 movw r18, r24 1372e: ad 01 movw r20, r26 13730: c7 01 movw r24, r14 13732: b6 01 movw r22, r12 13734: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 13738: ce 57 subi r28, 0x7E ; 126 1373a: df 4f sbci r29, 0xFF ; 255 1373c: 68 83 st Y, r22 1373e: 79 83 std Y+1, r23 ; 0x01 13740: 8a 83 std Y+2, r24 ; 0x02 13742: 9b 83 std Y+3, r25 ; 0x03 13744: c2 58 subi r28, 0x82 ; 130 13746: d0 40 sbci r29, 0x00 ; 0 float travel_z = target[Z_AXIS] - start_position[Z_AXIS]; 13748: 29 85 ldd r18, Y+9 ; 0x09 1374a: 3a 85 ldd r19, Y+10 ; 0x0a 1374c: 4b 85 ldd r20, Y+11 ; 0x0b 1374e: 5c 85 ldd r21, Y+12 ; 0x0c 13750: 60 91 7c 06 lds r22, 0x067C ; 0x80067c 13754: 70 91 7d 06 lds r23, 0x067D ; 0x80067d 13758: 80 91 7e 06 lds r24, 0x067E ; 0x80067e 1375c: 90 91 7f 06 lds r25, 0x067F ; 0x80067f 13760: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 13764: c2 58 subi r28, 0x82 ; 130 13766: df 4f sbci r29, 0xFF ; 255 13768: 68 83 st Y, r22 1376a: 79 83 std Y+1, r23 ; 0x01 1376c: 8a 83 std Y+2, r24 ; 0x02 1376e: 9b 83 std Y+3, r25 ; 0x03 13770: ce 57 subi r28, 0x7E ; 126 13772: d0 40 sbci r29, 0x00 ; 0 float rt_x = target[X_AXIS] - center_axis_x; 13774: 20 91 74 06 lds r18, 0x0674 ; 0x800674 13778: 30 91 75 06 lds r19, 0x0675 ; 0x800675 1377c: 40 91 76 06 lds r20, 0x0676 ; 0x800676 13780: 50 91 77 06 lds r21, 0x0677 ; 0x800677 13784: ca 57 subi r28, 0x7A ; 122 13786: df 4f sbci r29, 0xFF ; 255 13788: 28 83 st Y, r18 1378a: 39 83 std Y+1, r19 ; 0x01 1378c: 4a 83 std Y+2, r20 ; 0x02 1378e: 5b 83 std Y+3, r21 ; 0x03 13790: c6 58 subi r28, 0x86 ; 134 13792: d0 40 sbci r29, 0x00 ; 0 13794: ea 96 adiw r28, 0x3a ; 58 13796: 2c ad ldd r18, Y+60 ; 0x3c 13798: 3d ad ldd r19, Y+61 ; 0x3d 1379a: 4e ad ldd r20, Y+62 ; 0x3e 1379c: 5f ad ldd r21, Y+63 ; 0x3f 1379e: ea 97 sbiw r28, 0x3a ; 58 137a0: ca 57 subi r28, 0x7A ; 122 137a2: df 4f sbci r29, 0xFF ; 255 137a4: 68 81 ld r22, Y 137a6: 79 81 ldd r23, Y+1 ; 0x01 137a8: 8a 81 ldd r24, Y+2 ; 0x02 137aa: 9b 81 ldd r25, Y+3 ; 0x03 137ac: c6 58 subi r28, 0x86 ; 134 137ae: d0 40 sbci r29, 0x00 ; 0 137b0: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 137b4: 6b 01 movw r12, r22 137b6: 7c 01 movw r14, r24 float rt_y = target[Y_AXIS] - center_axis_y; 137b8: 80 91 78 06 lds r24, 0x0678 ; 0x800678 137bc: 90 91 79 06 lds r25, 0x0679 ; 0x800679 137c0: a0 91 7a 06 lds r26, 0x067A ; 0x80067a 137c4: b0 91 7b 06 lds r27, 0x067B ; 0x80067b 137c8: c6 57 subi r28, 0x76 ; 118 137ca: df 4f sbci r29, 0xFF ; 255 137cc: 88 83 st Y, r24 137ce: 99 83 std Y+1, r25 ; 0x01 137d0: aa 83 std Y+2, r26 ; 0x02 137d2: bb 83 std Y+3, r27 ; 0x03 137d4: ca 58 subi r28, 0x8A ; 138 137d6: d0 40 sbci r29, 0x00 ; 0 137d8: ce 57 subi r28, 0x7E ; 126 137da: df 4f sbci r29, 0xFF ; 255 137dc: 28 81 ld r18, Y 137de: 39 81 ldd r19, Y+1 ; 0x01 137e0: 4a 81 ldd r20, Y+2 ; 0x02 137e2: 5b 81 ldd r21, Y+3 ; 0x03 137e4: c2 58 subi r28, 0x82 ; 130 137e6: d0 40 sbci r29, 0x00 ; 0 137e8: bc 01 movw r22, r24 137ea: cd 01 movw r24, r26 137ec: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 137f0: 4b 01 movw r8, r22 137f2: 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; 137f4: 30 90 82 0e lds r3, 0x0E82 ; 0x800e82 137f8: 20 90 83 0e lds r2, 0x0E83 ; 0x800e83 137fc: 90 91 84 0e lds r25, 0x0E84 ; 0x800e84 13800: 6f 96 adiw r28, 0x1f ; 31 13802: 9f af std Y+63, r25 ; 0x3f 13804: 6f 97 sbiw r28, 0x1f ; 31 13806: a0 91 85 0e lds r26, 0x0E85 ; 0x800e85 1380a: a3 96 adiw r28, 0x23 ; 35 1380c: af af std Y+63, r26 ; 0x3f 1380e: 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); 13810: a7 01 movw r20, r14 13812: 96 01 movw r18, r12 13814: 6e 96 adiw r28, 0x1e ; 30 13816: 6c ad ldd r22, Y+60 ; 0x3c 13818: 7d ad ldd r23, Y+61 ; 0x3d 1381a: 8e ad ldd r24, Y+62 ; 0x3e 1381c: 9f ad ldd r25, Y+63 ; 0x3f 1381e: 6e 97 sbiw r28, 0x1e ; 30 13820: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 13824: 2b 01 movw r4, r22 13826: 3c 01 movw r6, r24 13828: a5 01 movw r20, r10 1382a: 94 01 movw r18, r8 1382c: 6a 96 adiw r28, 0x1a ; 26 1382e: 6c ad ldd r22, Y+60 ; 0x3c 13830: 7d ad ldd r23, Y+61 ; 0x3d 13832: 8e ad ldd r24, Y+62 ; 0x3e 13834: 9f ad ldd r25, Y+63 ; 0x3f 13836: 6a 97 sbiw r28, 0x1a ; 26 13838: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 1383c: 9b 01 movw r18, r22 1383e: ac 01 movw r20, r24 13840: c3 01 movw r24, r6 13842: b2 01 movw r22, r4 13844: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 13848: 2b 01 movw r4, r22 1384a: 3c 01 movw r6, r24 1384c: a5 01 movw r20, r10 1384e: 94 01 movw r18, r8 13850: 6e 96 adiw r28, 0x1e ; 30 13852: 6c ad ldd r22, Y+60 ; 0x3c 13854: 7d ad ldd r23, Y+61 ; 0x3d 13856: 8e ad ldd r24, Y+62 ; 0x3e 13858: 9f ad ldd r25, Y+63 ; 0x3f 1385a: 6e 97 sbiw r28, 0x1e ; 30 1385c: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 13860: 4b 01 movw r8, r22 13862: 5c 01 movw r10, r24 13864: a7 01 movw r20, r14 13866: 96 01 movw r18, r12 13868: 6a 96 adiw r28, 0x1a ; 26 1386a: 6c ad ldd r22, Y+60 ; 0x3c 1386c: 7d ad ldd r23, Y+61 ; 0x3d 1386e: 8e ad ldd r24, Y+62 ; 0x3e 13870: 9f ad ldd r25, Y+63 ; 0x3f 13872: 6a 97 sbiw r28, 0x1a ; 26 13874: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 13878: 9b 01 movw r18, r22 1387a: ac 01 movw r20, r24 1387c: c5 01 movw r24, r10 1387e: b4 01 movw r22, r8 13880: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 13884: a3 01 movw r20, r6 13886: 92 01 movw r18, r4 13888: 0f 94 c3 dd call 0x3bb86 ; 0x3bb86 1388c: 6b 01 movw r12, r22 1388e: 7c 01 movw r14, r24 if (angular_travel_total < 0) { angular_travel_total += 2 * M_PI; } 13890: 20 e0 ldi r18, 0x00 ; 0 13892: 30 e0 ldi r19, 0x00 ; 0 13894: a9 01 movw r20, r18 13896: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 1389a: 87 ff sbrs r24, 7 1389c: 0a c0 rjmp .+20 ; 0x138b2 1389e: 2b ed ldi r18, 0xDB ; 219 138a0: 3f e0 ldi r19, 0x0F ; 15 138a2: 49 ec ldi r20, 0xC9 ; 201 138a4: 50 e4 ldi r21, 0x40 ; 64 138a6: c7 01 movw r24, r14 138a8: b6 01 movw r22, r12 138aa: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 138ae: 6b 01 movw r12, r22 138b0: 7c 01 movw r14, r24 if (cs.min_arc_segments > 0) 138b2: 60 91 8b 0e lds r22, 0x0E8B ; 0x800e8b 138b6: 70 91 8c 0e lds r23, 0x0E8C ; 0x800e8c 138ba: 61 15 cp r22, r1 138bc: 71 05 cpc r23, r1 138be: 09 f4 brne .+2 ; 0x138c2 138c0: a4 c2 rjmp .+1352 ; 0x13e0a { // 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); 138c2: 90 e0 ldi r25, 0x00 ; 0 138c4: 80 e0 ldi r24, 0x00 ; 0 138c6: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 138ca: 9b 01 movw r18, r22 138cc: ac 01 movw r20, r24 138ce: 6b ed ldi r22, 0xDB ; 219 138d0: 7f e0 ldi r23, 0x0F ; 15 138d2: 89 ec ldi r24, 0xC9 ; 201 138d4: 90 e4 ldi r25, 0x40 ; 64 138d6: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 138da: ae 96 adiw r28, 0x2e ; 46 138dc: 2c ad ldd r18, Y+60 ; 0x3c 138de: 3d ad ldd r19, Y+61 ; 0x3d 138e0: 4e ad ldd r20, Y+62 ; 0x3e 138e2: 5f ad ldd r21, Y+63 ; 0x3f 138e4: ae 97 sbiw r28, 0x2e ; 46 138e6: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 138ea: 5b 01 movw r10, r22 138ec: 8c 01 movw r16, r24 } if (cs.arc_segments_per_sec > 0) 138ee: 60 91 8d 0e lds r22, 0x0E8D ; 0x800e8d 138f2: 70 91 8e 0e lds r23, 0x0E8E ; 0x800e8e 138f6: 61 15 cp r22, r1 138f8: 71 05 cpc r23, r1 138fa: f1 f0 breq .+60 ; 0x13938 { // 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)); 138fc: 90 e0 ldi r25, 0x00 ; 0 138fe: 80 e0 ldi r24, 0x00 ; 0 13900: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 13904: 20 e0 ldi r18, 0x00 ; 0 13906: 30 e0 ldi r19, 0x00 ; 0 13908: 40 e7 ldi r20, 0x70 ; 112 1390a: 52 e4 ldi r21, 0x42 ; 66 1390c: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 13910: 9b 01 movw r18, r22 13912: ac 01 movw r20, r24 13914: aa 96 adiw r28, 0x2a ; 42 13916: 6c ad ldd r22, Y+60 ; 0x3c 13918: 7d ad ldd r23, Y+61 ; 0x3d 1391a: 8e ad ldd r24, Y+62 ; 0x3e 1391c: 9f ad ldd r25, Y+63 ; 0x3f 1391e: aa 97 sbiw r28, 0x2a ; 42 13920: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 13924: 3b 01 movw r6, r22 13926: 4c 01 movw r8, r24 if (mm_per_arc_segment_sec < mm_per_arc_segment) 13928: 95 01 movw r18, r10 1392a: a8 01 movw r20, r16 1392c: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 13930: 87 ff sbrs r24, 7 13932: 02 c0 rjmp .+4 ; 0x13938 mm_per_arc_segment = mm_per_arc_segment_sec; 13934: 53 01 movw r10, r6 13936: 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) 13938: 40 90 86 0e lds r4, 0x0E86 ; 0x800e86 1393c: 50 90 87 0e lds r5, 0x0E87 ; 0x800e87 13940: 60 90 88 0e lds r6, 0x0E88 ; 0x800e88 13944: 70 90 89 0e lds r7, 0x0E89 ; 0x800e89 13948: 95 01 movw r18, r10 1394a: a8 01 movw r20, r16 1394c: b2 01 movw r22, r4 1394e: c3 01 movw r24, r6 13950: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 13954: 18 16 cp r1, r24 13956: c4 f0 brlt .+48 ; 0x13988 { // 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) { 13958: 95 01 movw r18, r10 1395a: a8 01 movw r20, r16 1395c: 63 2d mov r22, r3 1395e: 72 2d mov r23, r2 13960: 6f 96 adiw r28, 0x1f ; 31 13962: 8f ad ldd r24, Y+63 ; 0x3f 13964: 6f 97 sbiw r28, 0x1f ; 31 13966: a3 96 adiw r28, 0x23 ; 35 13968: 9f ad ldd r25, Y+63 ; 0x3f 1396a: a3 97 sbiw r28, 0x23 ; 35 1396c: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 13970: 25 01 movw r4, r10 13972: 38 01 movw r6, r16 13974: 87 ff sbrs r24, 7 13976: 08 c0 rjmp .+16 ; 0x13988 // 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; 13978: 43 2c mov r4, r3 1397a: 52 2c mov r5, r2 1397c: 6f 96 adiw r28, 0x1f ; 31 1397e: 6f ac ldd r6, Y+63 ; 0x3f 13980: 6f 97 sbiw r28, 0x1f ; 31 13982: a3 96 adiw r28, 0x23 ; 35 13984: 7f ac ldd r7, Y+63 ; 0x3f 13986: a3 97 sbiw r28, 0x23 ; 35 } // Adjust the angular travel if the direction is clockwise if (isclockwise) { angular_travel_total -= 2 * M_PI; } 13988: c2 57 subi r28, 0x72 ; 114 1398a: df 4f sbci r29, 0xFF ; 255 1398c: e8 81 ld r30, Y 1398e: f9 81 ldd r31, Y+1 ; 0x01 13990: ce 58 subi r28, 0x8E ; 142 13992: d0 40 sbci r29, 0x00 ; 0 13994: 32 97 sbiw r30, 0x02 ; 2 13996: 51 f4 brne .+20 ; 0x139ac 13998: 2b ed ldi r18, 0xDB ; 219 1399a: 3f e0 ldi r19, 0x0F ; 15 1399c: 49 ec ldi r20, 0xC9 ; 201 1399e: 50 e4 ldi r21, 0x40 ; 64 139a0: c7 01 movw r24, r14 139a2: b6 01 movw r22, r12 139a4: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 139a8: 6b 01 movw r12, r22 139aa: 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) 139ac: ca 57 subi r28, 0x7A ; 122 139ae: df 4f sbci r29, 0xFF ; 255 139b0: 28 81 ld r18, Y 139b2: 39 81 ldd r19, Y+1 ; 0x01 139b4: 4a 81 ldd r20, Y+2 ; 0x02 139b6: 5b 81 ldd r21, Y+3 ; 0x03 139b8: c6 58 subi r28, 0x86 ; 134 139ba: d0 40 sbci r29, 0x00 ; 0 139bc: e6 96 adiw r28, 0x36 ; 54 139be: 6c ad ldd r22, Y+60 ; 0x3c 139c0: 7d ad ldd r23, Y+61 ; 0x3d 139c2: 8e ad ldd r24, Y+62 ; 0x3e 139c4: 9f ad ldd r25, Y+63 ; 0x3f 139c6: e6 97 sbiw r28, 0x36 ; 54 139c8: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 139cc: 81 11 cpse r24, r1 139ce: 25 c0 rjmp .+74 ; 0x13a1a 139d0: c6 57 subi r28, 0x76 ; 118 139d2: df 4f sbci r29, 0xFF ; 255 139d4: 28 81 ld r18, Y 139d6: 39 81 ldd r19, Y+1 ; 0x01 139d8: 4a 81 ldd r20, Y+2 ; 0x02 139da: 5b 81 ldd r21, Y+3 ; 0x03 139dc: ca 58 subi r28, 0x8A ; 138 139de: d0 40 sbci r29, 0x00 ; 0 139e0: ee 96 adiw r28, 0x3e ; 62 139e2: 6c ad ldd r22, Y+60 ; 0x3c 139e4: 7d ad ldd r23, Y+61 ; 0x3d 139e6: 8e ad ldd r24, Y+62 ; 0x3e 139e8: 9f ad ldd r25, Y+63 ; 0x3f 139ea: ee 97 sbiw r28, 0x3e ; 62 139ec: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 139f0: 81 11 cpse r24, r1 139f2: 13 c0 rjmp .+38 ; 0x13a1a 139f4: 20 e0 ldi r18, 0x00 ; 0 139f6: 30 e0 ldi r19, 0x00 ; 0 139f8: a9 01 movw r20, r18 139fa: c7 01 movw r24, r14 139fc: b6 01 movw r22, r12 139fe: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 13a02: 81 11 cpse r24, r1 13a04: 0a c0 rjmp .+20 ; 0x13a1a { angular_travel_total += 2 * M_PI; 13a06: 2b ed ldi r18, 0xDB ; 219 13a08: 3f e0 ldi r19, 0x0F ; 15 13a0a: 49 ec ldi r20, 0xC9 ; 201 13a0c: 50 e4 ldi r21, 0x40 ; 64 13a0e: c7 01 movw r24, r14 13a10: b6 01 movw r22, r12 13a12: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 13a16: 6b 01 movw r12, r22 13a18: 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)); 13a1a: a7 01 movw r20, r14 13a1c: 96 01 movw r18, r12 13a1e: ae 96 adiw r28, 0x2e ; 46 13a20: 6c ad ldd r22, Y+60 ; 0x3c 13a22: 7d ad ldd r23, Y+61 ; 0x3d 13a24: 8e ad ldd r24, Y+62 ; 0x3e 13a26: 9f ad ldd r25, Y+63 ; 0x3f 13a28: ae 97 sbiw r28, 0x2e ; 46 13a2a: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 13a2e: c2 58 subi r28, 0x82 ; 130 13a30: df 4f sbci r29, 0xFF ; 255 13a32: 28 81 ld r18, Y 13a34: 39 81 ldd r19, Y+1 ; 0x01 13a36: 4a 81 ldd r20, Y+2 ; 0x02 13a38: 5b 81 ldd r21, Y+3 ; 0x03 13a3a: ce 57 subi r28, 0x7E ; 126 13a3c: d0 40 sbci r29, 0x00 ; 0 13a3e: 0f 94 e0 df call 0x3bfc0 ; 0x3bfc0 13a42: 4b 01 movw r8, r22 13a44: 5c 01 movw r10, r24 if (millimeters_of_travel_arc < 0.001) { return; } 13a46: 2f e6 ldi r18, 0x6F ; 111 13a48: 32 e1 ldi r19, 0x12 ; 18 13a4a: 43 e8 ldi r20, 0x83 ; 131 13a4c: 5a e3 ldi r21, 0x3A ; 58 13a4e: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 13a52: 87 fd sbrc r24, 7 13a54: cf c1 rjmp .+926 ; 0x13df4 // Calculate the number of arc segments unsigned short segments = static_cast(ceil(millimeters_of_travel_arc / mm_per_arc_segment)); 13a56: 92 01 movw r18, r4 13a58: a3 01 movw r20, r6 13a5a: c5 01 movw r24, r10 13a5c: b4 01 movw r22, r8 13a5e: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 13a62: 0f 94 22 de call 0x3bc44 ; 0x3bc44 13a66: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 13a6a: a4 96 adiw r28, 0x24 ; 36 13a6c: 7f af std Y+63, r23 ; 0x3f 13a6e: 6e af std Y+62, r22 ; 0x3e 13a70: 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) 13a72: 62 30 cpi r22, 0x02 ; 2 13a74: 71 05 cpc r23, r1 13a76: 08 f4 brcc .+2 ; 0x13a7a 13a78: 8b c1 rjmp .+790 ; 0x13d90 13a7a: e0 96 adiw r28, 0x30 ; 48 13a7c: 4e ad ldd r20, Y+62 ; 0x3e 13a7e: 5f ad ldd r21, Y+63 ; 0x3f 13a80: e0 97 sbiw r28, 0x30 ; 48 13a82: 45 2b or r20, r21 13a84: 09 f4 brne .+2 ; 0x13a88 13a86: 84 c1 rjmp .+776 ; 0x13d90 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; 13a88: 50 91 8a 0e lds r21, 0x0E8A ; 0x800e8a 13a8c: 6f 96 adiw r28, 0x1f ; 31 13a8e: 5f af std Y+63, r21 ; 0x3f 13a90: 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, 13a92: 90 e0 ldi r25, 0x00 ; 0 13a94: 80 e0 ldi r24, 0x00 ; 0 13a96: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 13a9a: 4b 01 movw r8, r22 13a9c: 5c 01 movw r10, r24 13a9e: ac 01 movw r20, r24 13aa0: 9b 01 movw r18, r22 13aa2: c7 01 movw r24, r14 13aa4: b6 01 movw r22, r12 13aa6: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 13aaa: 2b 01 movw r4, r22 13aac: 3c 01 movw r6, r24 linear_per_segment = travel_z / (segments), 13aae: a5 01 movw r20, r10 13ab0: 94 01 movw r18, r8 13ab2: c2 58 subi r28, 0x82 ; 130 13ab4: df 4f sbci r29, 0xFF ; 255 13ab6: 68 81 ld r22, Y 13ab8: 79 81 ldd r23, Y+1 ; 0x01 13aba: 8a 81 ldd r24, Y+2 ; 0x02 13abc: 9b 81 ldd r25, Y+3 ; 0x03 13abe: ce 57 subi r28, 0x7E ; 126 13ac0: d0 40 sbci r29, 0x00 ; 0 13ac2: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 13ac6: ee 96 adiw r28, 0x3e ; 62 13ac8: 6c af std Y+60, r22 ; 0x3c 13aca: 7d af std Y+61, r23 ; 0x3d 13acc: 8e af std Y+62, r24 ; 0x3e 13ace: 9f af std Y+63, r25 ; 0x3f 13ad0: ee 97 sbiw r28, 0x3e ; 62 segment_extruder_travel = (target[E_AXIS] - start_position[E_AXIS]) / (segments), 13ad2: 2d 85 ldd r18, Y+13 ; 0x0d 13ad4: 3e 85 ldd r19, Y+14 ; 0x0e 13ad6: 4f 85 ldd r20, Y+15 ; 0x0f 13ad8: 58 89 ldd r21, Y+16 ; 0x10 13ada: 60 91 80 06 lds r22, 0x0680 ; 0x800680 13ade: 70 91 81 06 lds r23, 0x0681 ; 0x800681 13ae2: 80 91 82 06 lds r24, 0x0682 ; 0x800682 13ae6: 90 91 83 06 lds r25, 0x0683 ; 0x800683 13aea: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 13aee: a5 01 movw r20, r10 13af0: 94 01 movw r18, r8 13af2: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 13af6: c2 58 subi r28, 0x82 ; 130 13af8: df 4f sbci r29, 0xFF ; 255 13afa: 68 83 st Y, r22 13afc: 79 83 std Y+1, r23 ; 0x01 13afe: 8a 83 std Y+2, r24 ; 0x02 13b00: 9b 83 std Y+3, r25 ; 0x03 13b02: ce 57 subi r28, 0x7E ; 126 13b04: d0 40 sbci r29, 0x00 ; 0 sq_theta_per_segment = theta_per_segment * theta_per_segment, 13b06: a3 01 movw r20, r6 13b08: 92 01 movw r18, r4 13b0a: c3 01 movw r24, r6 13b0c: b2 01 movw r22, r4 13b0e: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 13b12: 6b 01 movw r12, r22 13b14: 7c 01 movw r14, r24 sin_T = theta_per_segment - sq_theta_per_segment * theta_per_segment / 6, 13b16: ac 01 movw r20, r24 13b18: 9b 01 movw r18, r22 13b1a: c3 01 movw r24, r6 13b1c: b2 01 movw r22, r4 13b1e: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 13b22: 20 e0 ldi r18, 0x00 ; 0 13b24: 30 e0 ldi r19, 0x00 ; 0 13b26: 40 ec ldi r20, 0xC0 ; 192 13b28: 50 e4 ldi r21, 0x40 ; 64 13b2a: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 13b2e: 9b 01 movw r18, r22 13b30: ac 01 movw r20, r24 13b32: c3 01 movw r24, r6 13b34: b2 01 movw r22, r4 13b36: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 13b3a: ae 96 adiw r28, 0x2e ; 46 13b3c: 6c af std Y+60, r22 ; 0x3c 13b3e: 7d af std Y+61, r23 ; 0x3d 13b40: 8e af std Y+62, r24 ; 0x3e 13b42: 9f af std Y+63, r25 ; 0x3f 13b44: ae 97 sbiw r28, 0x2e ; 46 cos_T = 1 - 0.5f * sq_theta_per_segment; 13b46: 20 e0 ldi r18, 0x00 ; 0 13b48: 30 e0 ldi r19, 0x00 ; 0 13b4a: 40 e0 ldi r20, 0x00 ; 0 13b4c: 5f e3 ldi r21, 0x3F ; 63 13b4e: c7 01 movw r24, r14 13b50: b6 01 movw r22, r12 13b52: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 13b56: 9b 01 movw r18, r22 13b58: ac 01 movw r20, r24 13b5a: 60 e0 ldi r22, 0x00 ; 0 13b5c: 70 e0 ldi r23, 0x00 ; 0 13b5e: 80 e8 ldi r24, 0x80 ; 128 13b60: 9f e3 ldi r25, 0x3F ; 63 13b62: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 13b66: e6 96 adiw r28, 0x36 ; 54 13b68: 6c af std Y+60, r22 ; 0x3c 13b6a: 7d af std Y+61, r23 ; 0x3d 13b6c: 8e af std Y+62, r24 ; 0x3e 13b6e: 9f af std Y+63, r25 ; 0x3f 13b70: 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++) { 13b72: 22 24 eor r2, r2 13b74: 23 94 inc r2 13b76: 31 2c mov r3, r1 if (n_arc_correction-- == 0) { 13b78: 6f 96 adiw r28, 0x1f ; 31 13b7a: 8f ad ldd r24, Y+63 ; 0x3f 13b7c: 6f 97 sbiw r28, 0x1f ; 31 13b7e: 81 11 cpse r24, r1 13b80: 4d c1 rjmp .+666 ; 0x13e1c // 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); 13b82: b1 01 movw r22, r2 13b84: 90 e0 ldi r25, 0x00 ; 0 13b86: 80 e0 ldi r24, 0x00 ; 0 13b88: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 13b8c: a3 01 movw r20, r6 13b8e: 92 01 movw r18, r4 13b90: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 13b94: 6b 01 movw r12, r22 13b96: 7c 01 movw r14, r24 13b98: 0f 94 3e de call 0x3bc7c ; 0x3bc7c 13b9c: 6a 96 adiw r28, 0x1a ; 26 13b9e: 6c af std Y+60, r22 ; 0x3c 13ba0: 7d af std Y+61, r23 ; 0x3d 13ba2: 8e af std Y+62, r24 ; 0x3e 13ba4: 9f af std Y+63, r25 ; 0x3f 13ba6: 6a 97 sbiw r28, 0x1a ; 26 13ba8: c7 01 movw r24, r14 13baa: b6 01 movw r22, r12 13bac: 0f 94 04 e1 call 0x3c208 ; 0x3c208 13bb0: 4b 01 movw r8, r22 13bb2: 5c 01 movw r10, r24 r_axis_x = -offset[X_AXIS] * cos_Ti + offset[Y_AXIS] * sin_Ti; 13bb4: c0 90 8b 03 lds r12, 0x038B ; 0x80038b 13bb8: d0 90 8c 03 lds r13, 0x038C ; 0x80038c 13bbc: e0 90 8d 03 lds r14, 0x038D ; 0x80038d 13bc0: f0 90 8e 03 lds r15, 0x038E ; 0x80038e 13bc4: f7 fa bst r15, 7 13bc6: f0 94 com r15 13bc8: f7 f8 bld r15, 7 13bca: f0 94 com r15 13bcc: 20 91 8f 03 lds r18, 0x038F ; 0x80038f 13bd0: 30 91 90 03 lds r19, 0x0390 ; 0x800390 13bd4: 40 91 91 03 lds r20, 0x0391 ; 0x800391 13bd8: 50 91 92 03 lds r21, 0x0392 ; 0x800392 13bdc: a2 96 adiw r28, 0x22 ; 34 13bde: 2c af std Y+60, r18 ; 0x3c 13be0: 3d af std Y+61, r19 ; 0x3d 13be2: 4e af std Y+62, r20 ; 0x3e 13be4: 5f af std Y+63, r21 ; 0x3f 13be6: a2 97 sbiw r28, 0x22 ; 34 13be8: a7 01 movw r20, r14 13bea: 96 01 movw r18, r12 13bec: 6a 96 adiw r28, 0x1a ; 26 13bee: 6c ad ldd r22, Y+60 ; 0x3c 13bf0: 7d ad ldd r23, Y+61 ; 0x3d 13bf2: 8e ad ldd r24, Y+62 ; 0x3e 13bf4: 9f ad ldd r25, Y+63 ; 0x3f 13bf6: 6a 97 sbiw r28, 0x1a ; 26 13bf8: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 13bfc: 6e 96 adiw r28, 0x1e ; 30 13bfe: 6c af std Y+60, r22 ; 0x3c 13c00: 7d af std Y+61, r23 ; 0x3d 13c02: 8e af std Y+62, r24 ; 0x3e 13c04: 9f af std Y+63, r25 ; 0x3f 13c06: 6e 97 sbiw r28, 0x1e ; 30 13c08: a2 96 adiw r28, 0x22 ; 34 13c0a: 2c ad ldd r18, Y+60 ; 0x3c 13c0c: 3d ad ldd r19, Y+61 ; 0x3d 13c0e: 4e ad ldd r20, Y+62 ; 0x3e 13c10: 5f ad ldd r21, Y+63 ; 0x3f 13c12: a2 97 sbiw r28, 0x22 ; 34 13c14: c5 01 movw r24, r10 13c16: b4 01 movw r22, r8 13c18: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 13c1c: 9b 01 movw r18, r22 13c1e: ac 01 movw r20, r24 13c20: 6e 96 adiw r28, 0x1e ; 30 13c22: 6c ad ldd r22, Y+60 ; 0x3c 13c24: 7d ad ldd r23, Y+61 ; 0x3d 13c26: 8e ad ldd r24, Y+62 ; 0x3e 13c28: 9f ad ldd r25, Y+63 ; 0x3f 13c2a: 6e 97 sbiw r28, 0x1e ; 30 13c2c: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 13c30: 6e 96 adiw r28, 0x1e ; 30 13c32: 6c af std Y+60, r22 ; 0x3c 13c34: 7d af std Y+61, r23 ; 0x3d 13c36: 8e af std Y+62, r24 ; 0x3e 13c38: 9f af std Y+63, r25 ; 0x3f 13c3a: 6e 97 sbiw r28, 0x1e ; 30 r_axis_y = -offset[X_AXIS] * sin_Ti - offset[Y_AXIS] * cos_Ti; 13c3c: a7 01 movw r20, r14 13c3e: 96 01 movw r18, r12 13c40: c5 01 movw r24, r10 13c42: b4 01 movw r22, r8 13c44: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 13c48: 6b 01 movw r12, r22 13c4a: 7c 01 movw r14, r24 13c4c: a2 96 adiw r28, 0x22 ; 34 13c4e: 2c ad ldd r18, Y+60 ; 0x3c 13c50: 3d ad ldd r19, Y+61 ; 0x3d 13c52: 4e ad ldd r20, Y+62 ; 0x3e 13c54: 5f ad ldd r21, Y+63 ; 0x3f 13c56: a2 97 sbiw r28, 0x22 ; 34 13c58: 6a 96 adiw r28, 0x1a ; 26 13c5a: 6c ad ldd r22, Y+60 ; 0x3c 13c5c: 7d ad ldd r23, Y+61 ; 0x3d 13c5e: 8e ad ldd r24, Y+62 ; 0x3e 13c60: 9f ad ldd r25, Y+63 ; 0x3f 13c62: 6a 97 sbiw r28, 0x1a ; 26 13c64: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 13c68: 9b 01 movw r18, r22 13c6a: ac 01 movw r20, r24 13c6c: c7 01 movw r24, r14 13c6e: b6 01 movw r22, r12 13c70: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 13c74: 6a 96 adiw r28, 0x1a ; 26 13c76: 6c af std Y+60, r22 ; 0x3c 13c78: 7d af std Y+61, r23 ; 0x3d 13c7a: 8e af std Y+62, r24 ; 0x3e 13c7c: 9f af std Y+63, r25 ; 0x3f 13c7e: 6a 97 sbiw r28, 0x1a ; 26 // reset n_arc_correction n_arc_correction = cs.n_arc_correction; 13c80: 30 91 8a 0e lds r19, 0x0E8A ; 0x800e8a 13c84: 6f 96 adiw r28, 0x1f ; 31 13c86: 3f af std Y+63, r19 ; 0x3f 13c88: 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; 13c8a: 6e 96 adiw r28, 0x1e ; 30 13c8c: 2c ad ldd r18, Y+60 ; 0x3c 13c8e: 3d ad ldd r19, Y+61 ; 0x3d 13c90: 4e ad ldd r20, Y+62 ; 0x3e 13c92: 5f ad ldd r21, Y+63 ; 0x3f 13c94: 6e 97 sbiw r28, 0x1e ; 30 13c96: ea 96 adiw r28, 0x3a ; 58 13c98: 6c ad ldd r22, Y+60 ; 0x3c 13c9a: 7d ad ldd r23, Y+61 ; 0x3d 13c9c: 8e ad ldd r24, Y+62 ; 0x3e 13c9e: 9f ad ldd r25, Y+63 ; 0x3f 13ca0: ea 97 sbiw r28, 0x3a ; 58 13ca2: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 13ca6: 69 83 std Y+1, r22 ; 0x01 13ca8: 7a 83 std Y+2, r23 ; 0x02 13caa: 8b 83 std Y+3, r24 ; 0x03 13cac: 9c 83 std Y+4, r25 ; 0x04 start_position[Y_AXIS] = center_axis_y + r_axis_y; 13cae: 6a 96 adiw r28, 0x1a ; 26 13cb0: 2c ad ldd r18, Y+60 ; 0x3c 13cb2: 3d ad ldd r19, Y+61 ; 0x3d 13cb4: 4e ad ldd r20, Y+62 ; 0x3e 13cb6: 5f ad ldd r21, Y+63 ; 0x3f 13cb8: 6a 97 sbiw r28, 0x1a ; 26 13cba: ce 57 subi r28, 0x7E ; 126 13cbc: df 4f sbci r29, 0xFF ; 255 13cbe: 68 81 ld r22, Y 13cc0: 79 81 ldd r23, Y+1 ; 0x01 13cc2: 8a 81 ldd r24, Y+2 ; 0x02 13cc4: 9b 81 ldd r25, Y+3 ; 0x03 13cc6: c2 58 subi r28, 0x82 ; 130 13cc8: d0 40 sbci r29, 0x00 ; 0 13cca: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 13cce: 6d 83 std Y+5, r22 ; 0x05 13cd0: 7e 83 std Y+6, r23 ; 0x06 13cd2: 8f 83 std Y+7, r24 ; 0x07 13cd4: 98 87 std Y+8, r25 ; 0x08 start_position[Z_AXIS] += linear_per_segment; 13cd6: ee 96 adiw r28, 0x3e ; 62 13cd8: 2c ad ldd r18, Y+60 ; 0x3c 13cda: 3d ad ldd r19, Y+61 ; 0x3d 13cdc: 4e ad ldd r20, Y+62 ; 0x3e 13cde: 5f ad ldd r21, Y+63 ; 0x3f 13ce0: ee 97 sbiw r28, 0x3e ; 62 13ce2: 69 85 ldd r22, Y+9 ; 0x09 13ce4: 7a 85 ldd r23, Y+10 ; 0x0a 13ce6: 8b 85 ldd r24, Y+11 ; 0x0b 13ce8: 9c 85 ldd r25, Y+12 ; 0x0c 13cea: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 13cee: 69 87 std Y+9, r22 ; 0x09 13cf0: 7a 87 std Y+10, r23 ; 0x0a 13cf2: 8b 87 std Y+11, r24 ; 0x0b 13cf4: 9c 87 std Y+12, r25 ; 0x0c start_position[E_AXIS] += segment_extruder_travel; 13cf6: c2 58 subi r28, 0x82 ; 130 13cf8: df 4f sbci r29, 0xFF ; 255 13cfa: 28 81 ld r18, Y 13cfc: 39 81 ldd r19, Y+1 ; 0x01 13cfe: 4a 81 ldd r20, Y+2 ; 0x02 13d00: 5b 81 ldd r21, Y+3 ; 0x03 13d02: ce 57 subi r28, 0x7E ; 126 13d04: d0 40 sbci r29, 0x00 ; 0 13d06: 6d 85 ldd r22, Y+13 ; 0x0d 13d08: 7e 85 ldd r23, Y+14 ; 0x0e 13d0a: 8f 85 ldd r24, Y+15 ; 0x0f 13d0c: 98 89 ldd r25, Y+16 ; 0x10 13d0e: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 13d12: 6d 87 std Y+13, r22 ; 0x0d 13d14: 7e 87 std Y+14, r23 ; 0x0e 13d16: 8f 87 std Y+15, r24 ; 0x0f 13d18: 98 8b std Y+16, r25 ; 0x10 // Clamp to the calculated position. clamp_to_software_endstops(start_position); 13d1a: ce 01 movw r24, r28 13d1c: 01 96 adiw r24, 0x01 ; 1 13d1e: 0e 94 c9 6b call 0xd792 ; 0xd792 // Insert the segment into the buffer if (i >= start_segment_idx) 13d22: e0 96 adiw r28, 0x30 ; 48 13d24: 8e ad ldd r24, Y+62 ; 0x3e 13d26: 9f ad ldd r25, Y+63 ; 0x3f 13d28: e0 97 sbiw r28, 0x30 ; 48 13d2a: 28 16 cp r2, r24 13d2c: 39 06 cpc r3, r25 13d2e: 08 f1 brcs .+66 ; 0x13d72 plan_buffer_line(start_position[X_AXIS], start_position[Y_AXIS], start_position[Z_AXIS], start_position[E_AXIS], feed_rate, position, i); 13d30: e9 84 ldd r14, Y+9 ; 0x09 13d32: fa 84 ldd r15, Y+10 ; 0x0a 13d34: 0b 85 ldd r16, Y+11 ; 0x0b 13d36: 1c 85 ldd r17, Y+12 ; 0x0c 13d38: 2d 81 ldd r18, Y+5 ; 0x05 13d3a: 3e 81 ldd r19, Y+6 ; 0x06 13d3c: 4f 81 ldd r20, Y+7 ; 0x07 13d3e: 58 85 ldd r21, Y+8 ; 0x08 13d40: 69 81 ldd r22, Y+1 ; 0x01 13d42: 7a 81 ldd r23, Y+2 ; 0x02 13d44: 8b 81 ldd r24, Y+3 ; 0x03 13d46: 9c 81 ldd r25, Y+4 ; 0x04 13d48: 3f 92 push r3 13d4a: 2f 92 push r2 13d4c: a2 e9 ldi r26, 0x92 ; 146 13d4e: b6 e0 ldi r27, 0x06 ; 6 13d50: bf 93 push r27 13d52: af 93 push r26 13d54: aa 96 adiw r28, 0x2a ; 42 13d56: 8c ac ldd r8, Y+60 ; 0x3c 13d58: 9d ac ldd r9, Y+61 ; 0x3d 13d5a: ae ac ldd r10, Y+62 ; 0x3e 13d5c: bf ac ldd r11, Y+63 ; 0x3f 13d5e: aa 97 sbiw r28, 0x2a ; 42 13d60: de 01 movw r26, r28 13d62: 1d 96 adiw r26, 0x0d ; 13 13d64: 6d 01 movw r12, r26 13d66: 0f 94 f4 b0 call 0x361e8 ; 0x361e8 13d6a: 0f 90 pop r0 13d6c: 0f 90 pop r0 13d6e: 0f 90 pop r0 13d70: 0f 90 pop r0 // Handle the situation where the planner is aborted hard. if (planner_aborted) 13d72: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 13d76: 81 11 cpse r24, r1 13d78: 3d c0 rjmp .+122 ; 0x13df4 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++) { 13d7a: bf ef ldi r27, 0xFF ; 255 13d7c: 2b 1a sub r2, r27 13d7e: 3b 0a sbc r3, r27 13d80: a4 96 adiw r28, 0x24 ; 36 13d82: ee ad ldd r30, Y+62 ; 0x3e 13d84: ff ad ldd r31, Y+63 ; 0x3f 13d86: a4 97 sbiw r28, 0x24 ; 36 13d88: e2 15 cp r30, r2 13d8a: f3 05 cpc r31, r3 13d8c: 09 f0 breq .+2 ; 0x13d90 13d8e: f4 ce rjmp .-536 ; 0x13b78 if (planner_aborted) return; } } // Clamp to the target position. clamp_to_software_endstops(target); 13d90: 84 e7 ldi r24, 0x74 ; 116 13d92: 96 e0 ldi r25, 0x06 ; 6 13d94: 0e 94 c9 6b call 0xd792 ; 0xd792 // 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); 13d98: e0 90 7c 06 lds r14, 0x067C ; 0x80067c 13d9c: f0 90 7d 06 lds r15, 0x067D ; 0x80067d 13da0: 00 91 7e 06 lds r16, 0x067E ; 0x80067e 13da4: 10 91 7f 06 lds r17, 0x067F ; 0x80067f 13da8: 20 91 78 06 lds r18, 0x0678 ; 0x800678 13dac: 30 91 79 06 lds r19, 0x0679 ; 0x800679 13db0: 40 91 7a 06 lds r20, 0x067A ; 0x80067a 13db4: 50 91 7b 06 lds r21, 0x067B ; 0x80067b 13db8: 60 91 74 06 lds r22, 0x0674 ; 0x800674 13dbc: 70 91 75 06 lds r23, 0x0675 ; 0x800675 13dc0: 80 91 76 06 lds r24, 0x0676 ; 0x800676 13dc4: 90 91 77 06 lds r25, 0x0677 ; 0x800677 13dc8: 1f 92 push r1 13dca: 1f 92 push r1 13dcc: e2 e9 ldi r30, 0x92 ; 146 13dce: f6 e0 ldi r31, 0x06 ; 6 13dd0: ff 93 push r31 13dd2: ef 93 push r30 13dd4: aa 96 adiw r28, 0x2a ; 42 13dd6: 8c ac ldd r8, Y+60 ; 0x3c 13dd8: 9d ac ldd r9, Y+61 ; 0x3d 13dda: ae ac ldd r10, Y+62 ; 0x3e 13ddc: bf ac ldd r11, Y+63 ; 0x3f 13dde: aa 97 sbiw r28, 0x2a ; 42 13de0: a0 e8 ldi r26, 0x80 ; 128 13de2: ca 2e mov r12, r26 13de4: a6 e0 ldi r26, 0x06 ; 6 13de6: da 2e mov r13, r26 13de8: 0f 94 f4 b0 call 0x361e8 ; 0x361e8 13dec: 0f 90 pop r0 13dee: 0f 90 pop r0 13df0: 0f 90 pop r0 13df2: 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(); 13df4: 0e 94 ff 5a call 0xb5fe ; 0xb5fe previous_millis_cmd.start(); 13df8: 86 e8 ldi r24, 0x86 ; 134 13dfa: 93 e0 ldi r25, 0x03 ; 3 13dfc: 0f 94 ef 2b call 0x257de ; 0x257de ::start()> 13e00: 7b cb rjmp .-2314 ; 0x134f8 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; 13e02: 60 e0 ldi r22, 0x00 ; 0 13e04: 70 e0 ldi r23, 0x00 ; 0 13e06: cb 01 movw r24, r22 13e08: fe cb rjmp .-2052 ; 0x13606 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; 13e0a: a3 2c mov r10, r3 13e0c: b2 2c mov r11, r2 13e0e: 6f 96 adiw r28, 0x1f ; 31 13e10: 0f ad ldd r16, Y+63 ; 0x3f 13e12: 6f 97 sbiw r28, 0x1f ; 31 13e14: a3 96 adiw r28, 0x23 ; 35 13e16: 1f ad ldd r17, Y+63 ; 0x3f 13e18: a3 97 sbiw r28, 0x23 ; 35 13e1a: 69 cd rjmp .-1326 ; 0x138ee 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) { 13e1c: 6f 96 adiw r28, 0x1f ; 31 13e1e: 4f ad ldd r20, Y+63 ; 0x3f 13e20: 6f 97 sbiw r28, 0x1f ; 31 13e22: 41 50 subi r20, 0x01 ; 1 13e24: 6f 96 adiw r28, 0x1f ; 31 13e26: 4f af std Y+63, r20 ; 0x3f 13e28: 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; 13e2a: ae 96 adiw r28, 0x2e ; 46 13e2c: 2c ad ldd r18, Y+60 ; 0x3c 13e2e: 3d ad ldd r19, Y+61 ; 0x3d 13e30: 4e ad ldd r20, Y+62 ; 0x3e 13e32: 5f ad ldd r21, Y+63 ; 0x3f 13e34: ae 97 sbiw r28, 0x2e ; 46 13e36: 6e 96 adiw r28, 0x1e ; 30 13e38: 6c ad ldd r22, Y+60 ; 0x3c 13e3a: 7d ad ldd r23, Y+61 ; 0x3d 13e3c: 8e ad ldd r24, Y+62 ; 0x3e 13e3e: 9f ad ldd r25, Y+63 ; 0x3f 13e40: 6e 97 sbiw r28, 0x1e ; 30 13e42: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 13e46: 6b 01 movw r12, r22 13e48: 7c 01 movw r14, r24 13e4a: e6 96 adiw r28, 0x36 ; 54 13e4c: 2c ad ldd r18, Y+60 ; 0x3c 13e4e: 3d ad ldd r19, Y+61 ; 0x3d 13e50: 4e ad ldd r20, Y+62 ; 0x3e 13e52: 5f ad ldd r21, Y+63 ; 0x3f 13e54: e6 97 sbiw r28, 0x36 ; 54 13e56: 6a 96 adiw r28, 0x1a ; 26 13e58: 6c ad ldd r22, Y+60 ; 0x3c 13e5a: 7d ad ldd r23, Y+61 ; 0x3d 13e5c: 8e ad ldd r24, Y+62 ; 0x3e 13e5e: 9f ad ldd r25, Y+63 ; 0x3f 13e60: 6a 97 sbiw r28, 0x1a ; 26 13e62: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 13e66: 9b 01 movw r18, r22 13e68: ac 01 movw r20, r24 13e6a: c7 01 movw r24, r14 13e6c: b6 01 movw r22, r12 13e6e: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 13e72: 7b 01 movw r14, r22 13e74: 8c 01 movw r16, r24 r_axis_x = r_axis_x * cos_T - r_axis_y * sin_T; 13e76: e6 96 adiw r28, 0x36 ; 54 13e78: 2c ad ldd r18, Y+60 ; 0x3c 13e7a: 3d ad ldd r19, Y+61 ; 0x3d 13e7c: 4e ad ldd r20, Y+62 ; 0x3e 13e7e: 5f ad ldd r21, Y+63 ; 0x3f 13e80: e6 97 sbiw r28, 0x36 ; 54 13e82: 6e 96 adiw r28, 0x1e ; 30 13e84: 6c ad ldd r22, Y+60 ; 0x3c 13e86: 7d ad ldd r23, Y+61 ; 0x3d 13e88: 8e ad ldd r24, Y+62 ; 0x3e 13e8a: 9f ad ldd r25, Y+63 ; 0x3f 13e8c: 6e 97 sbiw r28, 0x1e ; 30 13e8e: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 13e92: 4b 01 movw r8, r22 13e94: 5c 01 movw r10, r24 13e96: ae 96 adiw r28, 0x2e ; 46 13e98: 2c ad ldd r18, Y+60 ; 0x3c 13e9a: 3d ad ldd r19, Y+61 ; 0x3d 13e9c: 4e ad ldd r20, Y+62 ; 0x3e 13e9e: 5f ad ldd r21, Y+63 ; 0x3f 13ea0: ae 97 sbiw r28, 0x2e ; 46 13ea2: 6a 96 adiw r28, 0x1a ; 26 13ea4: 6c ad ldd r22, Y+60 ; 0x3c 13ea6: 7d ad ldd r23, Y+61 ; 0x3d 13ea8: 8e ad ldd r24, Y+62 ; 0x3e 13eaa: 9f ad ldd r25, Y+63 ; 0x3f 13eac: 6a 97 sbiw r28, 0x1a ; 26 13eae: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 13eb2: 9b 01 movw r18, r22 13eb4: ac 01 movw r20, r24 13eb6: c5 01 movw r24, r10 13eb8: b4 01 movw r22, r8 13eba: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 13ebe: 6e 96 adiw r28, 0x1e ; 30 13ec0: 6c af std Y+60, r22 ; 0x3c 13ec2: 7d af std Y+61, r23 ; 0x3d 13ec4: 8e af std Y+62, r24 ; 0x3e 13ec6: 9f af std Y+63, r25 ; 0x3f 13ec8: 6e 97 sbiw r28, 0x1e ; 30 r_axis_y = r_axisi; 13eca: c7 01 movw r24, r14 13ecc: d8 01 movw r26, r16 13ece: 6a 96 adiw r28, 0x1a ; 26 13ed0: 8c af std Y+60, r24 ; 0x3c 13ed2: 9d af std Y+61, r25 ; 0x3d 13ed4: ae af std Y+62, r26 ; 0x3e 13ed6: bf af std Y+63, r27 ; 0x3f 13ed8: 6a 97 sbiw r28, 0x1a ; 26 13eda: d7 ce rjmp .-594 ; 0x13c8a - `S` - Time to wait, in seconds */ case 4: codenum = 0; if(code_seen('P')) codenum = code_value(); // milliseconds to wait 13edc: 80 e5 ldi r24, 0x50 ; 80 13ede: 0e 94 d6 5b call 0xb7ac ; 0xb7ac - `P` - Time to wait, in milliseconds - `S` - Time to wait, in seconds */ case 4: codenum = 0; 13ee2: c1 2c mov r12, r1 13ee4: d1 2c mov r13, r1 13ee6: 76 01 movw r14, r12 if(code_seen('P')) codenum = code_value(); // milliseconds to wait 13ee8: 88 23 and r24, r24 13eea: 31 f0 breq .+12 ; 0x13ef8 13eec: 0e 94 9d 60 call 0xc13a ; 0xc13a 13ef0: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 13ef4: 6b 01 movw r12, r22 13ef6: 7c 01 movw r14, r24 if(code_seen('S')) codenum = code_value() * 1000; // seconds to wait 13ef8: 83 e5 ldi r24, 0x53 ; 83 13efa: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 13efe: 88 23 and r24, r24 13f00: 61 f0 breq .+24 ; 0x13f1a 13f02: 0e 94 9d 60 call 0xc13a ; 0xc13a 13f06: 20 e0 ldi r18, 0x00 ; 0 13f08: 30 e0 ldi r19, 0x00 ; 0 13f0a: 4a e7 ldi r20, 0x7A ; 122 13f0c: 54 e4 ldi r21, 0x44 ; 68 13f0e: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 13f12: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 13f16: 6b 01 movw r12, r22 13f18: 7c 01 movw r14, r24 if(codenum != 0) 13f1a: c1 14 cp r12, r1 13f1c: d1 04 cpc r13, r1 13f1e: e1 04 cpc r14, r1 13f20: f1 04 cpc r15, r1 13f22: 41 f0 breq .+16 ; 0x13f34 { if(custom_message_type != CustomMsg::M117) 13f24: 80 91 c4 06 lds r24, 0x06C4 ; 0x8006c4 13f28: 87 30 cpi r24, 0x07 ; 7 13f2a: 21 f0 breq .+8 ; 0x13f34 { LCD_MESSAGERPGM(_n("Sleep..."));////MSG_DWELL 13f2c: 87 e2 ldi r24, 0x27 ; 39 13f2e: 9a e6 ldi r25, 0x6A ; 106 13f30: 0e 94 5d f1 call 0x1e2ba ; 0x1e2ba } } st_synchronize(); 13f34: 0f 94 e8 42 call 0x285d0 ; 0x285d0 codenum += _millis(); // keep track of when we started waiting 13f38: 0f 94 4c 29 call 0x25298 ; 0x25298 13f3c: c6 0e add r12, r22 13f3e: d7 1e adc r13, r23 13f40: e8 1e adc r14, r24 13f42: f9 1e adc r15, r25 previous_millis_cmd.start(); 13f44: 86 e8 ldi r24, 0x86 ; 134 13f46: 93 e0 ldi r25, 0x03 ; 3 13f48: 0f 94 ef 2b call 0x257de ; 0x257de ::start()> while(_millis() < codenum) { 13f4c: 0f 94 4c 29 call 0x25298 ; 0x25298 13f50: 6c 15 cp r22, r12 13f52: 7d 05 cpc r23, r13 13f54: 8e 05 cpc r24, r14 13f56: 9f 05 cpc r25, r15 13f58: 08 f0 brcs .+2 ; 0x13f5c 13f5a: ce ca rjmp .-2660 ; 0x134f8 manage_heater(); 13f5c: 0f 94 5c 38 call 0x270b8 ; 0x270b8 manage_inactivity(); 13f60: 80 e0 ldi r24, 0x00 ; 0 13f62: 0e 94 af 8a call 0x1155e ; 0x1155e lcd_update(0); 13f66: 80 e0 ldi r24, 0x00 ; 0 13f68: 0e 94 a7 6e call 0xdd4e ; 0xdd4e 13f6c: ef cf rjmp .-34 ; 0x13f4c 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); 13f6e: 81 e0 ldi r24, 0x01 ; 1 */ case 11: #if EXTRUDERS > 1 retract(false,retracted_swap[active_extruder]); #else retract(false); 13f70: 0f 94 28 8a call 0x31450 ; 0x31450 13f74: c1 ca rjmp .-2686 ; 0x134f8 13f76: 80 e0 ldi r24, 0x00 ; 0 13f78: fb cf rjmp .-10 ; 0x13f70 - `C` - Calibrate X and Y origin (home) - Only on MK3/s */ case 28: { long home_x_value = 0; long home_y_value = 0; 13f7a: 6e 96 adiw r28, 0x1e ; 30 13f7c: 1c ae std Y+60, r1 ; 0x3c 13f7e: 1d ae std Y+61, r1 ; 0x3d 13f80: 1e ae std Y+62, r1 ; 0x3e 13f82: 1f ae std Y+63, r1 ; 0x3f 13f84: 6e 97 sbiw r28, 0x1e ; 30 13f86: 35 ca rjmp .-2966 ; 0x133f2 Sensor must be over the bed. The maximum travel distance before an error is triggered is 10mm. */ case 30: { st_synchronize(); 13f88: 0f 94 e8 42 call 0x285d0 ; 0x285d0 homing_flag = true; 13f8c: 81 e0 ldi r24, 0x01 ; 1 13f8e: 80 93 a7 0d sts 0x0DA7, r24 ; 0x800da7 // TODO: make sure the bed_level_rotation_matrix is identity or the planner will get set incorectly int l_feedmultiply = setup_for_endstop_move(); 13f92: 0e 94 e8 66 call 0xcdd0 ; 0xcdd0 13f96: 8c 01 movw r16, r24 feedrate = homing_feedrate[Z_AXIS]; 13f98: 80 e0 ldi r24, 0x00 ; 0 13f9a: 90 e0 ldi r25, 0x00 ; 0 13f9c: a8 e4 ldi r26, 0x48 ; 72 13f9e: b4 e4 ldi r27, 0x44 ; 68 13fa0: 80 93 b8 02 sts 0x02B8, r24 ; 0x8002b8 13fa4: 90 93 b9 02 sts 0x02B9, r25 ; 0x8002b9 13fa8: a0 93 ba 02 sts 0x02BA, r26 ; 0x8002ba 13fac: b0 93 bb 02 sts 0x02BB, r27 ; 0x8002bb find_bed_induction_sensor_point_z(-10.f, 3); 13fb0: 43 e0 ldi r20, 0x03 ; 3 13fb2: 60 e0 ldi r22, 0x00 ; 0 13fb4: 70 e0 ldi r23, 0x00 ; 0 13fb6: 80 e2 ldi r24, 0x20 ; 32 13fb8: 91 ec ldi r25, 0xC1 ; 193 13fba: 0f 94 57 8c call 0x318ae ; 0x318ae printf_P(_N("%S X: %.5f Y: %.5f Z: %.5f\n"), _T(MSG_BED), _x, _y, _z); 13fbe: 70 90 9a 06 lds r7, 0x069A ; 0x80069a 13fc2: 60 90 9b 06 lds r6, 0x069B ; 0x80069b 13fc6: 50 90 9c 06 lds r5, 0x069C ; 0x80069c 13fca: 40 90 9d 06 lds r4, 0x069D ; 0x80069d 13fce: b0 90 96 06 lds r11, 0x0696 ; 0x800696 13fd2: a0 90 97 06 lds r10, 0x0697 ; 0x800697 13fd6: 90 90 98 06 lds r9, 0x0698 ; 0x800698 13fda: 80 90 99 06 lds r8, 0x0699 ; 0x800699 13fde: f0 90 92 06 lds r15, 0x0692 ; 0x800692 13fe2: e0 90 93 06 lds r14, 0x0693 ; 0x800693 13fe6: d0 90 94 06 lds r13, 0x0694 ; 0x800694 13fea: c0 90 95 06 lds r12, 0x0695 ; 0x800695 13fee: 85 ef ldi r24, 0xF5 ; 245 13ff0: 93 e4 ldi r25, 0x43 ; 67 13ff2: 0e 94 ac 72 call 0xe558 ; 0xe558 13ff6: 4f 92 push r4 13ff8: 5f 92 push r5 13ffa: 6f 92 push r6 13ffc: 7f 92 push r7 13ffe: 8f 92 push r8 14000: 9f 92 push r9 14002: af 92 push r10 14004: bf 92 push r11 14006: cf 92 push r12 14008: df 92 push r13 1400a: ef 92 push r14 1400c: ff 92 push r15 1400e: 9f 93 push r25 14010: 8f 93 push r24 14012: 8b e0 ldi r24, 0x0B ; 11 14014: 9a e6 ldi r25, 0x6A ; 106 14016: 9f 93 push r25 14018: 8f 93 push r24 1401a: 0f 94 de da call 0x3b5bc ; 0x3b5bc clean_up_after_endstop_move(l_feedmultiply); 1401e: c8 01 movw r24, r16 14020: 0e 94 ce 66 call 0xcd9c ; 0xcd9c homing_flag = false; 14024: 10 92 a7 0d sts 0x0DA7, r1 ; 0x800da7 14028: 0f b6 in r0, 0x3f ; 63 1402a: f8 94 cli 1402c: de bf out 0x3e, r29 ; 62 1402e: 0f be out 0x3f, r0 ; 63 14030: cd bf out 0x3d, r28 ; 61 14032: 62 ca rjmp .-2876 ; 0x134f8 ``` */ case 76: { #ifdef PINDA_THERMISTOR if (!has_temperature_compensation()) 14034: 20 e0 ldi r18, 0x00 ; 0 14036: 30 e0 ldi r19, 0x00 ; 0 14038: 40 e2 ldi r20, 0x20 ; 32 1403a: 51 e4 ldi r21, 0x41 ; 65 1403c: 60 91 99 03 lds r22, 0x0399 ; 0x800399 14040: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 14044: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 14048: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 1404c: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 14050: 87 ff sbrs r24, 7 14052: 05 c0 rjmp .+10 ; 0x1405e { SERIAL_ECHOLNPGM("No PINDA thermistor"); 14054: 8a eb ldi r24, 0xBA ; 186 14056: 97 e8 ldi r25, 0x87 ; 135 14058: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 1405c: 4d ca rjmp .-2918 ; 0x134f8 break; } if (!calibration_status_get(CALIBRATION_STATUS_XYZ)) { 1405e: 82 e0 ldi r24, 0x02 ; 2 14060: 0e 94 9f ee call 0x1dd3e ; 0x1dd3e 14064: 81 11 cpse r24, r1 14066: 07 c0 rjmp .+14 ; 0x14076 //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)); 14068: 8f e5 ldi r24, 0x5F ; 95 1406a: 9a e3 ldi r25, 0x3A ; 58 1406c: 0e 94 ac 72 call 0xe558 ; 0xe558 14070: 0f 94 f1 1f call 0x23fe2 ; 0x23fe2 14074: 41 ca rjmp .-2942 ; 0x134f8 break; } if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS])) 14076: 80 91 8f 06 lds r24, 0x068F ; 0x80068f 1407a: 88 23 and r24, r24 1407c: 41 f0 breq .+16 ; 0x1408e 1407e: 80 91 90 06 lds r24, 0x0690 ; 0x800690 14082: 88 23 and r24, r24 14084: 21 f0 breq .+8 ; 0x1408e 14086: 10 91 91 06 lds r17, 0x0691 ; 0x800691 1408a: 11 11 cpse r17, r1 1408c: 08 c0 rjmp .+16 ; 0x1409e 1408e: 81 e0 ldi r24, 0x01 ; 1 14090: 80 93 a2 10 sts 0x10A2, r24 ; 0x8010a2 { // 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); 14094: 84 ee ldi r24, 0xE4 ; 228 14096: 9b e6 ldi r25, 0x6B ; 107 14098: 0f 94 fd 74 call 0x2e9fa ; 0x2e9fa 1409c: 2d ca rjmp .-2982 ; 0x134f8 break; } lcd_show_fullscreen_message_and_wait_P(_T(MSG_TEMP_CAL_WARNING)); 1409e: 86 e1 ldi r24, 0x16 ; 22 140a0: 9a e3 ldi r25, 0x3A ; 58 140a2: 0e 94 ac 72 call 0xe558 ; 0xe558 140a6: 0f 94 f1 1f call 0x23fe2 ; 0x23fe2 uint8_t result = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_STEEL_SHEET_CHECK), false); 140aa: 8f eb ldi r24, 0xBF ; 191 140ac: 9e e3 ldi r25, 0x3E ; 62 140ae: 0e 94 ac 72 call 0xe558 ; 0xe558 140b2: 41 e0 ldi r20, 0x01 ; 1 140b4: 60 e0 ldi r22, 0x00 ; 0 140b6: 0f 94 40 4f call 0x29e80 ; 0x29e80 if (result == LCD_LEFT_BUTTON_CHOICE) 140ba: 81 11 cpse r24, r1 140bc: 61 c0 rjmp .+194 ; 0x14180 { current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 140be: 80 e0 ldi r24, 0x00 ; 0 140c0: 90 e0 ldi r25, 0x00 ; 0 140c2: a0 ea ldi r26, 0xA0 ; 160 140c4: b0 e4 ldi r27, 0x40 ; 64 140c6: 80 93 9a 06 sts 0x069A, r24 ; 0x80069a 140ca: 90 93 9b 06 sts 0x069B, r25 ; 0x80069b 140ce: a0 93 9c 06 sts 0x069C, r26 ; 0x80069c 140d2: b0 93 9d 06 sts 0x069D, r27 ; 0x80069d plan_buffer_line_curposXYZE(3000 / 60); 140d6: 60 e0 ldi r22, 0x00 ; 0 140d8: 70 e0 ldi r23, 0x00 ; 0 140da: 88 e4 ldi r24, 0x48 ; 72 140dc: 92 e4 ldi r25, 0x42 ; 66 140de: 0f 94 49 c0 call 0x38092 ; 0x38092 current_position[Z_AXIS] = 50; 140e2: 80 e0 ldi r24, 0x00 ; 0 140e4: 90 e0 ldi r25, 0x00 ; 0 140e6: a8 e4 ldi r26, 0x48 ; 72 140e8: b2 e4 ldi r27, 0x42 ; 66 140ea: 80 93 9a 06 sts 0x069A, r24 ; 0x80069a 140ee: 90 93 9b 06 sts 0x069B, r25 ; 0x80069b 140f2: a0 93 9c 06 sts 0x069C, r26 ; 0x80069c 140f6: b0 93 9d 06 sts 0x069D, r27 ; 0x80069d current_position[Y_AXIS] = 180; 140fa: 80 e0 ldi r24, 0x00 ; 0 140fc: 90 e0 ldi r25, 0x00 ; 0 140fe: a4 e3 ldi r26, 0x34 ; 52 14100: b3 e4 ldi r27, 0x43 ; 67 14102: 80 93 96 06 sts 0x0696, r24 ; 0x800696 14106: 90 93 97 06 sts 0x0697, r25 ; 0x800697 1410a: a0 93 98 06 sts 0x0698, r26 ; 0x800698 1410e: b0 93 99 06 sts 0x0699, r27 ; 0x800699 plan_buffer_line_curposXYZE(3000 / 60); 14112: 60 e0 ldi r22, 0x00 ; 0 14114: 70 e0 ldi r23, 0x00 ; 0 14116: 88 e4 ldi r24, 0x48 ; 72 14118: 92 e4 ldi r25, 0x42 ; 66 1411a: 0f 94 49 c0 call 0x38092 ; 0x38092 st_synchronize(); 1411e: 0f 94 e8 42 call 0x285d0 ; 0x285d0 lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_STEEL_SHEET)); 14122: 85 e9 ldi r24, 0x95 ; 149 14124: 9e e3 ldi r25, 0x3E ; 62 14126: 0e 94 ac 72 call 0xe558 ; 0xe558 1412a: 0f 94 f1 1f call 0x23fe2 ; 0x23fe2 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 1412e: ee ed ldi r30, 0xDE ; 222 14130: f5 ea ldi r31, 0xA5 ; 165 14132: 85 91 lpm r24, Z+ 14134: 95 91 lpm r25, Z+ 14136: a5 91 lpm r26, Z+ 14138: b4 91 lpm r27, Z 1413a: 80 93 96 06 sts 0x0696, r24 ; 0x800696 1413e: 90 93 97 06 sts 0x0697, r25 ; 0x800697 14142: a0 93 98 06 sts 0x0698, r26 ; 0x800698 14146: b0 93 99 06 sts 0x0699, r27 ; 0x800699 current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 1414a: ea ed ldi r30, 0xDA ; 218 1414c: f5 ea ldi r31, 0xA5 ; 165 1414e: 85 91 lpm r24, Z+ 14150: 95 91 lpm r25, Z+ 14152: a5 91 lpm r26, Z+ 14154: b4 91 lpm r27, Z 14156: 80 93 92 06 sts 0x0692, r24 ; 0x800692 1415a: 90 93 93 06 sts 0x0693, r25 ; 0x800693 1415e: a0 93 94 06 sts 0x0694, r26 ; 0x800694 14162: b0 93 95 06 sts 0x0695, r27 ; 0x800695 plan_buffer_line_curposXYZE(3000 / 60); 14166: 60 e0 ldi r22, 0x00 ; 0 14168: 70 e0 ldi r23, 0x00 ; 0 1416a: 88 e4 ldi r24, 0x48 ; 72 1416c: 92 e4 ldi r25, 0x42 ; 66 1416e: 0f 94 49 c0 call 0x38092 ; 0x38092 st_synchronize(); 14172: 0f 94 e8 42 call 0x285d0 ; 0x285d0 gcode_G28(false, false, true); 14176: 41 e0 ldi r20, 0x01 ; 1 14178: 60 e0 ldi r22, 0x00 ; 0 1417a: 80 e0 ldi r24, 0x00 ; 0 1417c: 0e 94 05 7f call 0xfe0a ; 0xfe0a } if ((current_temperature_pinda > 35) && (farm_mode == false)) { 14180: 20 e0 ldi r18, 0x00 ; 0 14182: 30 e0 ldi r19, 0x00 ; 0 14184: 4c e0 ldi r20, 0x0C ; 12 14186: 52 e4 ldi r21, 0x42 ; 66 14188: 60 91 99 03 lds r22, 0x0399 ; 0x800399 1418c: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 14190: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 14194: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 14198: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 1419c: 18 16 cp r1, r24 1419e: 0c f0 brlt .+2 ; 0x141a2 141a0: 73 c0 rjmp .+230 ; 0x14288 //waiting for PIDNA probe to cool down in case that we are not in farm mode current_position[Z_AXIS] = 100; 141a2: 80 e0 ldi r24, 0x00 ; 0 141a4: 90 e0 ldi r25, 0x00 ; 0 141a6: a8 ec ldi r26, 0xC8 ; 200 141a8: b2 e4 ldi r27, 0x42 ; 66 141aa: 80 93 9a 06 sts 0x069A, r24 ; 0x80069a 141ae: 90 93 9b 06 sts 0x069B, r25 ; 0x80069b 141b2: a0 93 9c 06 sts 0x069C, r26 ; 0x80069c 141b6: b0 93 9d 06 sts 0x069D, r27 ; 0x80069d plan_buffer_line_curposXYZE(3000 / 60); 141ba: 60 e0 ldi r22, 0x00 ; 0 141bc: 70 e0 ldi r23, 0x00 ; 0 141be: 88 e4 ldi r24, 0x48 ; 72 141c0: 92 e4 ldi r25, 0x42 ; 66 141c2: 0f 94 49 c0 call 0x38092 ; 0x38092 } #ifdef PINDA_THERMISTOR bool lcd_wait_for_pinda(float temp) { disable_heater(); 141c6: 0f 94 18 2f call 0x25e30 ; 0x25e30 LongTimer pinda_timeout; 141ca: 19 82 std Y+1, r1 ; 0x01 141cc: 1a 82 std Y+2, r1 ; 0x02 141ce: 1b 82 std Y+3, r1 ; 0x03 141d0: 1c 82 std Y+4, r1 ; 0x04 141d2: 1d 82 std Y+5, r1 ; 0x05 pinda_timeout.start(); 141d4: ce 01 movw r24, r28 141d6: 01 96 adiw r24, 0x01 ; 1 141d8: 0f 94 ef 2b call 0x257de ; 0x257de ::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); 141dc: 03 e2 ldi r16, 0x23 ; 35 141de: ee ee ldi r30, 0xEE ; 238 141e0: ee 2e mov r14, r30 141e2: e4 e8 ldi r30, 0x84 ; 132 141e4: fe 2e mov r15, r30 disable_heater(); LongTimer pinda_timeout; pinda_timeout.start(); bool target_temp_reached = true; while (current_temperature_pinda > temp){ 141e6: 20 e0 ldi r18, 0x00 ; 0 141e8: 30 e0 ldi r19, 0x00 ; 0 141ea: 4c e0 ldi r20, 0x0C ; 12 141ec: 52 e4 ldi r21, 0x42 ; 66 141ee: 60 91 99 03 lds r22, 0x0399 ; 0x800399 141f2: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 141f6: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 141fa: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 141fe: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 14202: 18 16 cp r1, r24 14204: c4 f5 brge .+112 ; 0x14276 lcd_display_message_fullscreen_P(_T(MSG_WAITING_TEMP_PINDA)); 14206: 88 ec ldi r24, 0xC8 ; 200 14208: 99 e3 ldi r25, 0x39 ; 57 1420a: 0e 94 ac 72 call 0xe558 ; 0xe558 1420e: 0f 94 e4 1f call 0x23fc8 ; 0x23fc8 lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 14212: 42 e8 ldi r20, 0x82 ; 130 14214: 64 e0 ldi r22, 0x04 ; 4 14216: 80 e0 ldi r24, 0x00 ; 0 14218: 0e 94 00 6f call 0xde00 ; 0xde00 lcd_printf_P(PSTR("%3d/%3d"), (int16_t)current_temperature_pinda, (int16_t) temp); 1421c: 1f 92 push r1 1421e: 0f 93 push r16 14220: 60 91 99 03 lds r22, 0x0399 ; 0x800399 14224: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 14228: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 1422c: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 14230: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> 14234: 7f 93 push r23 14236: 6f 93 push r22 14238: ff 92 push r15 1423a: ef 92 push r14 1423c: 0e 94 b9 6e call 0xdd72 ; 0xdd72 lcd_putc(LCD_STR_DEGREE[0]); 14240: 81 e8 ldi r24, 0x81 ; 129 14242: 0e 94 cf 6e call 0xdd9e ; 0xdd9e delay_keep_alive(1000); 14246: 88 ee ldi r24, 0xE8 ; 232 14248: 93 e0 ldi r25, 0x03 ; 3 1424a: 0e 94 e4 8c call 0x119c8 ; 0x119c8 serialecho_temperatures(); 1424e: 0e 94 5e 77 call 0xeebc ; 0xeebc if (pinda_timeout.expired(8 * 60 * 1000ul)) { //PINDA cooling from 60 C to 35 C takes about 7 minutes 14252: 40 e0 ldi r20, 0x00 ; 0 14254: 53 e5 ldi r21, 0x53 ; 83 14256: 67 e0 ldi r22, 0x07 ; 7 14258: 70 e0 ldi r23, 0x00 ; 0 1425a: ce 01 movw r24, r28 1425c: 01 96 adiw r24, 0x01 ; 1 1425e: 0f 94 30 2a call 0x25460 ; 0x25460 ::expired(unsigned long)> 14262: 0f 90 pop r0 14264: 0f 90 pop r0 14266: 0f 90 pop r0 14268: 0f 90 pop r0 1426a: 0f 90 pop r0 1426c: 0f 90 pop r0 1426e: 88 23 and r24, r24 14270: 09 f4 brne .+2 ; 0x14274 14272: b9 cf rjmp .-142 ; 0x141e6 target_temp_reached = false; 14274: 10 e0 ldi r17, 0x00 ; 0 break; } } lcd_update_enable(true); 14276: 81 e0 ldi r24, 0x01 ; 1 14278: 0e 94 25 6f call 0xde4a ; 0xde4a if (lcd_wait_for_pinda(35) == false) { //waiting for PINDA probe to cool, if this takes more then time expected, temp. cal. fails 1427c: 11 11 cpse r17, r1 1427e: 04 c0 rjmp .+8 ; 0x14288 lcd_temp_cal_show_result(false); 14280: 80 e0 ldi r24, 0x00 ; 0 14282: 0f 94 3c 20 call 0x24078 ; 0x24078 14286: 38 c9 rjmp .-3472 ; 0x134f8 break; } } st_synchronize(); 14288: 0f 94 e8 42 call 0x285d0 ; 0x285d0 homing_flag = true; // keep homing on to avoid babystepping while the LCD is enabled 1428c: 81 e0 ldi r24, 0x01 ; 1 1428e: 80 93 a7 0d sts 0x0DA7, r24 ; 0x800da7 lcd_update_enable(true); 14292: 0e 94 25 6f call 0xde4a ; 0xde4a SERIAL_ECHOLNPGM("PINDA probe calibration start"); 14296: 8c e9 ldi r24, 0x9C ; 156 14298: 97 e8 ldi r25, 0x87 ; 135 1429a: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 float zero_z; int z_shift = 0; //unit: steps float start_temp = 5 * (int)(current_temperature_pinda / 5); 1429e: 80 90 99 03 lds r8, 0x0399 ; 0x800399 142a2: 90 90 9a 03 lds r9, 0x039A ; 0x80039a 142a6: a0 90 9b 03 lds r10, 0x039B ; 0x80039b 142aa: b0 90 9c 03 lds r11, 0x039C ; 0x80039c 142ae: 20 e0 ldi r18, 0x00 ; 0 142b0: 30 e0 ldi r19, 0x00 ; 0 142b2: 40 ea ldi r20, 0xA0 ; 160 142b4: 50 e4 ldi r21, 0x40 ; 64 142b6: c5 01 movw r24, r10 142b8: b4 01 movw r22, r8 142ba: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 142be: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> 142c2: 25 e0 ldi r18, 0x05 ; 5 142c4: 26 9f mul r18, r22 142c6: a0 01 movw r20, r0 142c8: 27 9f mul r18, r23 142ca: 50 0d add r21, r0 142cc: 11 24 eor r1, r1 142ce: ba 01 movw r22, r20 142d0: 55 0f add r21, r21 142d2: 88 0b sbc r24, r24 142d4: 99 0b sbc r25, r25 142d6: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 142da: 1b 01 movw r2, r22 142dc: 7c 01 movw r14, r24 if (start_temp < 35) start_temp = 35; 142de: 20 e0 ldi r18, 0x00 ; 0 142e0: 30 e0 ldi r19, 0x00 ; 0 142e2: 4c e0 ldi r20, 0x0C ; 12 142e4: 52 e4 ldi r21, 0x42 ; 66 142e6: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 142ea: 87 ff sbrs r24, 7 142ec: 06 c0 rjmp .+12 ; 0x142fa 142ee: 21 2c mov r2, r1 142f0: 31 2c mov r3, r1 142f2: 6c e0 ldi r22, 0x0C ; 12 142f4: e6 2e mov r14, r22 142f6: 72 e4 ldi r23, 0x42 ; 66 142f8: f7 2e mov r15, r23 if (start_temp < current_temperature_pinda) start_temp += 5; 142fa: 22 2d mov r18, r2 142fc: 33 2d mov r19, r3 142fe: 4e 2d mov r20, r14 14300: 5f 2d mov r21, r15 14302: c5 01 movw r24, r10 14304: b4 01 movw r22, r8 14306: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 1430a: 18 16 cp r1, r24 1430c: 64 f4 brge .+24 ; 0x14326 1430e: 20 e0 ldi r18, 0x00 ; 0 14310: 30 e0 ldi r19, 0x00 ; 0 14312: 40 ea ldi r20, 0xA0 ; 160 14314: 50 e4 ldi r21, 0x40 ; 64 14316: 62 2d mov r22, r2 14318: 73 2d mov r23, r3 1431a: 8e 2d mov r24, r14 1431c: 9f 2d mov r25, r15 1431e: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 14322: 1b 01 movw r2, r22 14324: 7c 01 movw r14, r24 printf_P(_N("start temperature: %.1f\n"), start_temp); 14326: ff 92 push r15 14328: ef 92 push r14 1432a: 3f 92 push r3 1432c: 2f 92 push r2 1432e: 89 ee ldi r24, 0xE9 ; 233 14330: 99 e6 ldi r25, 0x69 ; 105 14332: 9f 93 push r25 14334: 8f 93 push r24 14336: 0f 94 de da call 0x3b5bc ; 0x3b5bc setTargetBed(70 + (start_temp - 30)); 1433a: 20 e0 ldi r18, 0x00 ; 0 1433c: 30 e0 ldi r19, 0x00 ; 0 1433e: 40 ef ldi r20, 0xF0 ; 240 14340: 51 e4 ldi r21, 0x41 ; 65 14342: 62 2d mov r22, r2 14344: 73 2d mov r23, r3 14346: 8e 2d mov r24, r14 14348: 9f 2d mov r25, r15 1434a: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 1434e: 20 e0 ldi r18, 0x00 ; 0 14350: 30 e0 ldi r19, 0x00 ; 0 14352: 4c e8 ldi r20, 0x8C ; 140 14354: 52 e4 ldi r21, 0x42 ; 66 14356: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 1435a: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> 1435e: 70 93 73 06 sts 0x0673, r23 ; 0x800673 14362: 60 93 72 06 sts 0x0672, r22 ; 0x800672 custom_message_type = CustomMsg::TempCal; 14366: 84 e0 ldi r24, 0x04 ; 4 14368: 80 93 c4 06 sts 0x06C4, r24 ; 0x8006c4 custom_message_state = 1; 1436c: 81 e0 ldi r24, 0x01 ; 1 1436e: 80 93 f7 03 sts 0x03F7, r24 ; 0x8003f7 lcd_setstatuspgm(_T(MSG_PINDA_CALIBRATION)); 14372: 81 e1 ldi r24, 0x11 ; 17 14374: 95 e4 ldi r25, 0x45 ; 69 14376: 0e 94 ac 72 call 0xe558 ; 0xe558 1437a: 0e 94 5d f1 call 0x1e2ba ; 0x1e2ba current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 1437e: 80 e0 ldi r24, 0x00 ; 0 14380: 90 e0 ldi r25, 0x00 ; 0 14382: a0 ea ldi r26, 0xA0 ; 160 14384: b0 e4 ldi r27, 0x40 ; 64 14386: 80 93 9a 06 sts 0x069A, r24 ; 0x80069a 1438a: 90 93 9b 06 sts 0x069B, r25 ; 0x80069b 1438e: a0 93 9c 06 sts 0x069C, r26 ; 0x80069c 14392: b0 93 9d 06 sts 0x069D, r27 ; 0x80069d plan_buffer_line_curposXYZE(3000 / 60); 14396: 60 e0 ldi r22, 0x00 ; 0 14398: 70 e0 ldi r23, 0x00 ; 0 1439a: 88 e4 ldi r24, 0x48 ; 72 1439c: 92 e4 ldi r25, 0x42 ; 66 1439e: 0f 94 49 c0 call 0x38092 ; 0x38092 current_position[X_AXIS] = PINDA_PREHEAT_X; 143a2: 80 e0 ldi r24, 0x00 ; 0 143a4: 90 e0 ldi r25, 0x00 ; 0 143a6: a0 ea ldi r26, 0xA0 ; 160 143a8: b1 e4 ldi r27, 0x41 ; 65 143aa: 80 93 92 06 sts 0x0692, r24 ; 0x800692 143ae: 90 93 93 06 sts 0x0693, r25 ; 0x800693 143b2: a0 93 94 06 sts 0x0694, r26 ; 0x800694 143b6: b0 93 95 06 sts 0x0695, r27 ; 0x800695 current_position[Y_AXIS] = PINDA_PREHEAT_Y; 143ba: 80 e0 ldi r24, 0x00 ; 0 143bc: 90 e0 ldi r25, 0x00 ; 0 143be: a0 e7 ldi r26, 0x70 ; 112 143c0: b2 e4 ldi r27, 0x42 ; 66 143c2: 80 93 96 06 sts 0x0696, r24 ; 0x800696 143c6: 90 93 97 06 sts 0x0697, r25 ; 0x800697 143ca: a0 93 98 06 sts 0x0698, r26 ; 0x800698 143ce: b0 93 99 06 sts 0x0699, r27 ; 0x800699 plan_buffer_line_curposXYZE(3000 / 60); 143d2: 60 e0 ldi r22, 0x00 ; 0 143d4: 70 e0 ldi r23, 0x00 ; 0 143d6: 88 e4 ldi r24, 0x48 ; 72 143d8: 92 e4 ldi r25, 0x42 ; 66 143da: 0f 94 49 c0 call 0x38092 ; 0x38092 current_position[Z_AXIS] = PINDA_PREHEAT_Z; 143de: 8a e9 ldi r24, 0x9A ; 154 143e0: 99 e9 ldi r25, 0x99 ; 153 143e2: a9 e1 ldi r26, 0x19 ; 25 143e4: be e3 ldi r27, 0x3E ; 62 143e6: 80 93 9a 06 sts 0x069A, r24 ; 0x80069a 143ea: 90 93 9b 06 sts 0x069B, r25 ; 0x80069b 143ee: a0 93 9c 06 sts 0x069C, r26 ; 0x80069c 143f2: b0 93 9d 06 sts 0x069D, r27 ; 0x80069d plan_buffer_line_curposXYZE(3000 / 60); 143f6: 60 e0 ldi r22, 0x00 ; 0 143f8: 70 e0 ldi r23, 0x00 ; 0 143fa: 88 e4 ldi r24, 0x48 ; 72 143fc: 92 e4 ldi r25, 0x42 ; 66 143fe: 0f 94 49 c0 call 0x38092 ; 0x38092 st_synchronize(); 14402: 0f 94 e8 42 call 0x285d0 ; 0x285d0 14406: 0f 90 pop r0 14408: 0f 90 pop r0 1440a: 0f 90 pop r0 1440c: 0f 90 pop r0 1440e: 0f 90 pop r0 14410: 0f 90 pop r0 while (current_temperature_pinda < start_temp) 14412: 20 91 99 03 lds r18, 0x0399 ; 0x800399 14416: 30 91 9a 03 lds r19, 0x039A ; 0x80039a 1441a: 40 91 9b 03 lds r20, 0x039B ; 0x80039b 1441e: 50 91 9c 03 lds r21, 0x039C ; 0x80039c 14422: 62 2d mov r22, r2 14424: 73 2d mov r23, r3 14426: 8e 2d mov r24, r14 14428: 9f 2d mov r25, r15 1442a: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 1442e: 18 16 cp r1, r24 14430: 3c f4 brge .+14 ; 0x14440 { delay_keep_alive(1000); 14432: 88 ee ldi r24, 0xE8 ; 232 14434: 93 e0 ldi r25, 0x03 ; 3 14436: 0e 94 e4 8c call 0x119c8 ; 0x119c8 serialecho_temperatures(); 1443a: 0e 94 5e 77 call 0xeebc ; 0xeebc 1443e: e9 cf rjmp .-46 ; 0x14412 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 14440: 60 e0 ldi r22, 0x00 ; 0 14442: 86 ea ldi r24, 0xA6 ; 166 14444: 9f e0 ldi r25, 0x0F ; 15 14446: 0f 94 40 dc call 0x3b880 ; 0x3b880 } 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; 1444a: 80 e0 ldi r24, 0x00 ; 0 1444c: 90 e0 ldi r25, 0x00 ; 0 1444e: a0 ea ldi r26, 0xA0 ; 160 14450: b0 e4 ldi r27, 0x40 ; 64 14452: 80 93 9a 06 sts 0x069A, r24 ; 0x80069a 14456: 90 93 9b 06 sts 0x069B, r25 ; 0x80069b 1445a: a0 93 9c 06 sts 0x069C, r26 ; 0x80069c 1445e: b0 93 9d 06 sts 0x069D, r27 ; 0x80069d plan_buffer_line_curposXYZE(3000 / 60); 14462: 60 e0 ldi r22, 0x00 ; 0 14464: 70 e0 ldi r23, 0x00 ; 0 14466: 88 e4 ldi r24, 0x48 ; 72 14468: 92 e4 ldi r25, 0x42 ; 66 1446a: 0f 94 49 c0 call 0x38092 ; 0x38092 current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 1446e: ea ed ldi r30, 0xDA ; 218 14470: f5 ea ldi r31, 0xA5 ; 165 14472: 85 91 lpm r24, Z+ 14474: 95 91 lpm r25, Z+ 14476: a5 91 lpm r26, Z+ 14478: b4 91 lpm r27, Z 1447a: 80 93 92 06 sts 0x0692, r24 ; 0x800692 1447e: 90 93 93 06 sts 0x0693, r25 ; 0x800693 14482: a0 93 94 06 sts 0x0694, r26 ; 0x800694 14486: b0 93 95 06 sts 0x0695, r27 ; 0x800695 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 1448a: ee ed ldi r30, 0xDE ; 222 1448c: f5 ea ldi r31, 0xA5 ; 165 1448e: 85 91 lpm r24, Z+ 14490: 95 91 lpm r25, Z+ 14492: a5 91 lpm r26, Z+ 14494: b4 91 lpm r27, Z 14496: 80 93 96 06 sts 0x0696, r24 ; 0x800696 1449a: 90 93 97 06 sts 0x0697, r25 ; 0x800697 1449e: a0 93 98 06 sts 0x0698, r26 ; 0x800698 144a2: b0 93 99 06 sts 0x0699, r27 ; 0x800699 plan_buffer_line_curposXYZE(3000 / 60); 144a6: 60 e0 ldi r22, 0x00 ; 0 144a8: 70 e0 ldi r23, 0x00 ; 0 144aa: 88 e4 ldi r24, 0x48 ; 72 144ac: 92 e4 ldi r25, 0x42 ; 66 144ae: 0f 94 49 c0 call 0x38092 ; 0x38092 st_synchronize(); 144b2: 0f 94 e8 42 call 0x285d0 ; 0x285d0 bool find_z_result = find_bed_induction_sensor_point_z(-1.f); 144b6: 43 e0 ldi r20, 0x03 ; 3 144b8: 60 e0 ldi r22, 0x00 ; 0 144ba: 70 e0 ldi r23, 0x00 ; 0 144bc: 80 e8 ldi r24, 0x80 ; 128 144be: 9f eb ldi r25, 0xBF ; 191 144c0: 0f 94 57 8c call 0x318ae ; 0x318ae if (find_z_result == false) { 144c4: 81 11 cpse r24, r1 144c6: 06 c0 rjmp .+12 ; 0x144d4 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); 144c8: 0f 94 3c 20 call 0x24078 ; 0x24078 homing_flag = false; 144cc: 10 92 a7 0d sts 0x0DA7, r1 ; 0x800da7 144d0: 0c 94 7c 9a jmp 0x134f8 ; 0x134f8 if (find_z_result == false) { lcd_temp_cal_show_result(find_z_result); homing_flag = false; break; } zero_z = current_position[Z_AXIS]; 144d4: 90 91 9a 06 lds r25, 0x069A ; 0x80069a 144d8: 67 96 adiw r28, 0x17 ; 23 144da: 9f af std Y+63, r25 ; 0x3f 144dc: 67 97 sbiw r28, 0x17 ; 23 144de: a0 91 9b 06 lds r26, 0x069B ; 0x80069b 144e2: 6b 96 adiw r28, 0x1b ; 27 144e4: af af std Y+63, r26 ; 0x3f 144e6: 6b 97 sbiw r28, 0x1b ; 27 144e8: b0 91 9c 06 lds r27, 0x069C ; 0x80069c 144ec: 6f 96 adiw r28, 0x1f ; 31 144ee: bf af std Y+63, r27 ; 0x3f 144f0: 6f 97 sbiw r28, 0x1f ; 31 144f2: e0 91 9d 06 lds r30, 0x069D ; 0x80069d 144f6: a7 96 adiw r28, 0x27 ; 39 144f8: ef af std Y+63, r30 ; 0x3f 144fa: a7 97 sbiw r28, 0x27 ; 39 printf_P(_N("\nZERO: %.3f\n"), current_position[Z_AXIS]); 144fc: ef 93 push r30 144fe: bf 93 push r27 14500: af 93 push r26 14502: 9f 93 push r25 14504: 8c ed ldi r24, 0xDC ; 220 14506: 99 e6 ldi r25, 0x69 ; 105 14508: 9f 93 push r25 1450a: 8f 93 push r24 1450c: 0f 94 de da call 0x3b5bc ; 0x3b5bc 14510: 0f 90 pop r0 14512: 0f 90 pop r0 14514: 0f 90 pop r0 14516: 0f 90 pop r0 14518: 0f 90 pop r0 1451a: 0f 90 pop r0 1451c: 4e ea ldi r20, 0xAE ; 174 1451e: 84 2e mov r8, r20 14520: 4f e0 ldi r20, 0x0F ; 15 14522: 94 2e mov r9, r20 14524: 53 e2 ldi r21, 0x23 ; 35 14526: c5 2e mov r12, r21 14528: d1 2c mov r13, r1 int i = -1; for (; i < 5; i++) 1452a: 0f ef ldi r16, 0xFF ; 255 1452c: 1f ef ldi r17, 0xFF ; 255 { float temp = (40 + i * 5); 1452e: b6 01 movw r22, r12 14530: 0d 2c mov r0, r13 14532: 00 0c add r0, r0 14534: 88 0b sbc r24, r24 14536: 99 0b sbc r25, r25 14538: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 1453c: 2b 01 movw r4, r22 1453e: 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)); 14540: df 92 push r13 14542: cf 92 push r12 14544: c8 01 movw r24, r16 14546: 02 96 adiw r24, 0x02 ; 2 14548: 9f 93 push r25 1454a: 8f 93 push r24 1454c: 20 ea ldi r18, 0xA0 ; 160 1454e: 39 e6 ldi r19, 0x69 ; 105 14550: 3f 93 push r19 14552: 2f 93 push r18 14554: 0f 94 de da call 0x3b5bc ; 0x3b5bc 14558: 58 01 movw r10, r16 1455a: 5f ef ldi r21, 0xFF ; 255 1455c: a5 1a sub r10, r21 1455e: b5 0a sbc r11, r21 if (i >= 0) { 14560: 0f 90 pop r0 14562: 0f 90 pop r0 14564: 0f 90 pop r0 14566: 0f 90 pop r0 14568: 0f 90 pop r0 1456a: 0f 90 pop r0 1456c: 11 f4 brne .+4 ; 0x14572 1456e: 0c 94 3c cc jmp 0x19878 ; 0x19878 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 14572: 70 e0 ldi r23, 0x00 ; 0 14574: 60 e0 ldi r22, 0x00 ; 0 14576: c4 01 movw r24, r8 14578: 0f 94 5e dc call 0x3b8bc ; 0x3b8bc eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i, z_shift); } if (start_temp <= temp) break; 1457c: a3 01 movw r20, r6 1457e: 92 01 movw r18, r4 14580: 62 2d mov r22, r2 14582: 73 2d mov r23, r3 14584: 8e 2d mov r24, r14 14586: 9f 2d mov r25, r15 14588: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 1458c: 18 16 cp r1, r24 1458e: 44 f4 brge .+16 ; 0x145a0 } zero_z = current_position[Z_AXIS]; printf_P(_N("\nZERO: %.3f\n"), current_position[Z_AXIS]); int i = -1; for (; i < 5; i++) 14590: 85 e0 ldi r24, 0x05 ; 5 14592: a8 16 cp r10, r24 14594: b1 04 cpc r11, r1 14596: 11 f0 breq .+4 ; 0x1459c 14598: 0c 94 48 cc jmp 0x19890 ; 0x19890 1459c: 05 e0 ldi r16, 0x05 ; 5 1459e: 10 e0 ldi r17, 0x00 ; 0 145a0: 58 01 movw r10, r16 145a2: 97 e2 ldi r25, 0x27 ; 39 145a4: a9 1a sub r10, r25 145a6: 98 ef ldi r25, 0xF8 ; 248 145a8: b9 0a sbc r11, r25 145aa: aa 0c add r10, r10 145ac: bb 1c adc r11, r11 145ae: 85 e0 ldi r24, 0x05 ; 5 145b0: 80 9f mul r24, r16 145b2: 10 01 movw r2, r0 145b4: 81 9f mul r24, r17 145b6: 30 0c add r3, r0 145b8: 11 24 eor r1, r1 145ba: 0d 5f subi r16, 0xFD ; 253 145bc: 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; 145be: 2a e9 ldi r18, 0x9A ; 154 145c0: 42 2e mov r4, r18 145c2: 29 e9 ldi r18, 0x99 ; 153 145c4: 52 2e mov r5, r18 145c6: 29 e1 ldi r18, 0x19 ; 25 145c8: 62 2e mov r6, r18 145ca: 2e e3 ldi r18, 0x3E ; 62 145cc: 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); 145ce: 37 e6 ldi r19, 0x67 ; 103 145d0: 83 2e mov r8, r19 145d2: 39 e6 ldi r19, 0x69 ; 105 145d4: 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++) 145d6: c8 01 movw r24, r16 145d8: 02 97 sbiw r24, 0x02 ; 2 145da: 05 97 sbiw r24, 0x05 ; 5 145dc: 0c f0 brlt .+2 ; 0x145e0 145de: d4 c0 rjmp .+424 ; 0x14788 { float temp = (40 + i * 5); 145e0: b1 01 movw r22, r2 145e2: 63 5d subi r22, 0xD3 ; 211 145e4: 7f 4f sbci r23, 0xFF ; 255 145e6: 07 2e mov r0, r23 145e8: 00 0c add r0, r0 145ea: 88 0b sbc r24, r24 145ec: 99 0b sbc r25, r25 145ee: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 145f2: 6b 01 movw r12, r22 145f4: 7c 01 movw r14, r24 printf_P(_N("\nStep: %d/6\n"), i + 2); 145f6: 1f 93 push r17 145f8: 0f 93 push r16 145fa: a3 e9 ldi r26, 0x93 ; 147 145fc: b9 e6 ldi r27, 0x69 ; 105 145fe: bf 93 push r27 14600: af 93 push r26 14602: 0f 94 de da call 0x3b5bc ; 0x3b5bc custom_message_state = i + 2; 14606: 00 93 f7 03 sts 0x03F7, r16 ; 0x8003f7 setTargetBed(50 + 10 * (temp - 30) / 5); 1460a: 20 e0 ldi r18, 0x00 ; 0 1460c: 30 e0 ldi r19, 0x00 ; 0 1460e: 40 ef ldi r20, 0xF0 ; 240 14610: 51 e4 ldi r21, 0x41 ; 65 14612: c7 01 movw r24, r14 14614: b6 01 movw r22, r12 14616: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 1461a: 20 e0 ldi r18, 0x00 ; 0 1461c: 30 e0 ldi r19, 0x00 ; 0 1461e: 40 e2 ldi r20, 0x20 ; 32 14620: 51 e4 ldi r21, 0x41 ; 65 14622: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 14626: 20 e0 ldi r18, 0x00 ; 0 14628: 30 e0 ldi r19, 0x00 ; 0 1462a: 40 ea ldi r20, 0xA0 ; 160 1462c: 50 e4 ldi r21, 0x40 ; 64 1462e: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 14632: 20 e0 ldi r18, 0x00 ; 0 14634: 30 e0 ldi r19, 0x00 ; 0 14636: 48 e4 ldi r20, 0x48 ; 72 14638: 52 e4 ldi r21, 0x42 ; 66 1463a: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 1463e: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> 14642: 70 93 73 06 sts 0x0673, r23 ; 0x800673 14646: 60 93 72 06 sts 0x0672, r22 ; 0x800672 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 1464a: 80 e0 ldi r24, 0x00 ; 0 1464c: 90 e0 ldi r25, 0x00 ; 0 1464e: a0 ea ldi r26, 0xA0 ; 160 14650: b0 e4 ldi r27, 0x40 ; 64 14652: 80 93 9a 06 sts 0x069A, r24 ; 0x80069a 14656: 90 93 9b 06 sts 0x069B, r25 ; 0x80069b 1465a: a0 93 9c 06 sts 0x069C, r26 ; 0x80069c 1465e: b0 93 9d 06 sts 0x069D, r27 ; 0x80069d plan_buffer_line_curposXYZE(3000 / 60); 14662: 60 e0 ldi r22, 0x00 ; 0 14664: 70 e0 ldi r23, 0x00 ; 0 14666: 88 e4 ldi r24, 0x48 ; 72 14668: 92 e4 ldi r25, 0x42 ; 66 1466a: 0f 94 49 c0 call 0x38092 ; 0x38092 current_position[X_AXIS] = PINDA_PREHEAT_X; 1466e: 20 e0 ldi r18, 0x00 ; 0 14670: 30 e0 ldi r19, 0x00 ; 0 14672: 40 ea ldi r20, 0xA0 ; 160 14674: 51 e4 ldi r21, 0x41 ; 65 14676: 20 93 92 06 sts 0x0692, r18 ; 0x800692 1467a: 30 93 93 06 sts 0x0693, r19 ; 0x800693 1467e: 40 93 94 06 sts 0x0694, r20 ; 0x800694 14682: 50 93 95 06 sts 0x0695, r21 ; 0x800695 current_position[Y_AXIS] = PINDA_PREHEAT_Y; 14686: 80 e0 ldi r24, 0x00 ; 0 14688: 90 e0 ldi r25, 0x00 ; 0 1468a: a0 e7 ldi r26, 0x70 ; 112 1468c: b2 e4 ldi r27, 0x42 ; 66 1468e: 80 93 96 06 sts 0x0696, r24 ; 0x800696 14692: 90 93 97 06 sts 0x0697, r25 ; 0x800697 14696: a0 93 98 06 sts 0x0698, r26 ; 0x800698 1469a: b0 93 99 06 sts 0x0699, r27 ; 0x800699 plan_buffer_line_curposXYZE(3000 / 60); 1469e: 60 e0 ldi r22, 0x00 ; 0 146a0: 70 e0 ldi r23, 0x00 ; 0 146a2: 88 e4 ldi r24, 0x48 ; 72 146a4: 92 e4 ldi r25, 0x42 ; 66 146a6: 0f 94 49 c0 call 0x38092 ; 0x38092 current_position[Z_AXIS] = PINDA_PREHEAT_Z; 146aa: 40 92 9a 06 sts 0x069A, r4 ; 0x80069a 146ae: 50 92 9b 06 sts 0x069B, r5 ; 0x80069b 146b2: 60 92 9c 06 sts 0x069C, r6 ; 0x80069c 146b6: 70 92 9d 06 sts 0x069D, r7 ; 0x80069d plan_buffer_line_curposXYZE(3000 / 60); 146ba: 60 e0 ldi r22, 0x00 ; 0 146bc: 70 e0 ldi r23, 0x00 ; 0 146be: 88 e4 ldi r24, 0x48 ; 72 146c0: 92 e4 ldi r25, 0x42 ; 66 146c2: 0f 94 49 c0 call 0x38092 ; 0x38092 st_synchronize(); 146c6: 0f 94 e8 42 call 0x285d0 ; 0x285d0 146ca: 0f 90 pop r0 146cc: 0f 90 pop r0 146ce: 0f 90 pop r0 146d0: 0f 90 pop r0 while (current_temperature_pinda < temp) 146d2: 20 91 99 03 lds r18, 0x0399 ; 0x800399 146d6: 30 91 9a 03 lds r19, 0x039A ; 0x80039a 146da: 40 91 9b 03 lds r20, 0x039B ; 0x80039b 146de: 50 91 9c 03 lds r21, 0x039C ; 0x80039c 146e2: c7 01 movw r24, r14 146e4: b6 01 movw r22, r12 146e6: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 146ea: 18 16 cp r1, r24 146ec: 3c f4 brge .+14 ; 0x146fc { delay_keep_alive(1000); 146ee: 88 ee ldi r24, 0xE8 ; 232 146f0: 93 e0 ldi r25, 0x03 ; 3 146f2: 0e 94 e4 8c call 0x119c8 ; 0x119c8 serialecho_temperatures(); 146f6: 0e 94 5e 77 call 0xeebc ; 0xeebc 146fa: eb cf rjmp .-42 ; 0x146d2 } current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 146fc: 80 e0 ldi r24, 0x00 ; 0 146fe: 90 e0 ldi r25, 0x00 ; 0 14700: a0 ea ldi r26, 0xA0 ; 160 14702: b0 e4 ldi r27, 0x40 ; 64 14704: 80 93 9a 06 sts 0x069A, r24 ; 0x80069a 14708: 90 93 9b 06 sts 0x069B, r25 ; 0x80069b 1470c: a0 93 9c 06 sts 0x069C, r26 ; 0x80069c 14710: b0 93 9d 06 sts 0x069D, r27 ; 0x80069d plan_buffer_line_curposXYZE(3000 / 60); 14714: 60 e0 ldi r22, 0x00 ; 0 14716: 70 e0 ldi r23, 0x00 ; 0 14718: 88 e4 ldi r24, 0x48 ; 72 1471a: 92 e4 ldi r25, 0x42 ; 66 1471c: 0f 94 49 c0 call 0x38092 ; 0x38092 current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 14720: ea ed ldi r30, 0xDA ; 218 14722: f5 ea ldi r31, 0xA5 ; 165 14724: 85 91 lpm r24, Z+ 14726: 95 91 lpm r25, Z+ 14728: a5 91 lpm r26, Z+ 1472a: b4 91 lpm r27, Z 1472c: 80 93 92 06 sts 0x0692, r24 ; 0x800692 14730: 90 93 93 06 sts 0x0693, r25 ; 0x800693 14734: a0 93 94 06 sts 0x0694, r26 ; 0x800694 14738: b0 93 95 06 sts 0x0695, r27 ; 0x800695 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 1473c: ee ed ldi r30, 0xDE ; 222 1473e: f5 ea ldi r31, 0xA5 ; 165 14740: 85 91 lpm r24, Z+ 14742: 95 91 lpm r25, Z+ 14744: a5 91 lpm r26, Z+ 14746: b4 91 lpm r27, Z 14748: 80 93 96 06 sts 0x0696, r24 ; 0x800696 1474c: 90 93 97 06 sts 0x0697, r25 ; 0x800697 14750: a0 93 98 06 sts 0x0698, r26 ; 0x800698 14754: b0 93 99 06 sts 0x0699, r27 ; 0x800699 plan_buffer_line_curposXYZE(3000 / 60); 14758: 60 e0 ldi r22, 0x00 ; 0 1475a: 70 e0 ldi r23, 0x00 ; 0 1475c: 88 e4 ldi r24, 0x48 ; 72 1475e: 92 e4 ldi r25, 0x42 ; 66 14760: 0f 94 49 c0 call 0x38092 ; 0x38092 st_synchronize(); 14764: 0f 94 e8 42 call 0x285d0 ; 0x285d0 find_z_result = find_bed_induction_sensor_point_z(-1.f); 14768: 43 e0 ldi r20, 0x03 ; 3 1476a: 60 e0 ldi r22, 0x00 ; 0 1476c: 70 e0 ldi r23, 0x00 ; 0 1476e: 80 e8 ldi r24, 0x80 ; 128 14770: 9f eb ldi r25, 0xBF ; 191 14772: 0f 94 57 8c call 0x318ae ; 0x318ae 14776: 95 e0 ldi r25, 0x05 ; 5 14778: 29 0e add r2, r25 1477a: 31 1c adc r3, r1 1477c: 0f 5f subi r16, 0xFF ; 255 1477e: 1f 4f sbci r17, 0xFF ; 255 if (find_z_result == false) { 14780: 81 11 cpse r24, r1 14782: 04 c0 rjmp .+8 ; 0x1478c lcd_temp_cal_show_result(find_z_result); 14784: 0f 94 3c 20 call 0x24078 ; 0x24078 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); 14788: 81 e0 ldi r24, 0x01 ; 1 1478a: 9e ce rjmp .-708 ; 0x144c8 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]); 1478c: 67 96 adiw r28, 0x17 ; 23 1478e: 7f ad ldd r23, Y+63 ; 0x3f 14790: 67 97 sbiw r28, 0x17 ; 23 14792: 6b 96 adiw r28, 0x1b ; 27 14794: 6f ad ldd r22, Y+63 ; 0x3f 14796: 6b 97 sbiw r28, 0x1b ; 27 14798: 6f 96 adiw r28, 0x1f ; 31 1479a: 9f ad ldd r25, Y+63 ; 0x3f 1479c: 6f 97 sbiw r28, 0x1f ; 31 1479e: a7 96 adiw r28, 0x27 ; 39 147a0: 8f ad ldd r24, Y+63 ; 0x3f 147a2: a7 97 sbiw r28, 0x27 ; 39 147a4: 27 2f mov r18, r23 147a6: 36 2f mov r19, r22 147a8: 49 2f mov r20, r25 147aa: 58 2f mov r21, r24 147ac: 60 91 9a 06 lds r22, 0x069A ; 0x80069a 147b0: 70 91 9b 06 lds r23, 0x069B ; 0x80069b 147b4: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 147b8: 90 91 9d 06 lds r25, 0x069D ; 0x80069d 147bc: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 147c0: f6 2e mov r15, r22 147c2: e7 2e mov r14, r23 147c4: d8 2e mov r13, r24 147c6: c9 2e mov r12, r25 147c8: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 147cc: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 147d0: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 147d4: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 147d8: d7 01 movw r26, r14 147da: f6 01 movw r30, r12 147dc: 6b 2f mov r22, r27 147de: 7a 2f mov r23, r26 147e0: 8f 2f mov r24, r31 147e2: 9e 2f mov r25, r30 147e4: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 147e8: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> 147ec: a6 96 adiw r28, 0x26 ; 38 147ee: 6c af std Y+60, r22 ; 0x3c 147f0: 7d af std Y+61, r23 ; 0x3d 147f2: 8e af std Y+62, r24 ; 0x3e 147f4: 9f af std Y+63, r25 ; 0x3f 147f6: 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); 147f8: cf 92 push r12 147fa: df 92 push r13 147fc: ef 92 push r14 147fe: ff 92 push r15 14800: 80 91 9c 03 lds r24, 0x039C ; 0x80039c 14804: 8f 93 push r24 14806: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 1480a: 8f 93 push r24 1480c: 80 91 9a 03 lds r24, 0x039A ; 0x80039a 14810: 8f 93 push r24 14812: 80 91 99 03 lds r24, 0x0399 ; 0x800399 14816: 8f 93 push r24 14818: 9f 92 push r9 1481a: 8f 92 push r8 1481c: 0f 94 de da call 0x3b5bc ; 0x3b5bc 14820: a4 96 adiw r28, 0x24 ; 36 14822: 6e ad ldd r22, Y+62 ; 0x3e 14824: 7f ad ldd r23, Y+63 ; 0x3f 14826: a4 97 sbiw r28, 0x24 ; 36 14828: c5 01 movw r24, r10 1482a: 0f 94 5e dc call 0x3b8bc ; 0x3b8bc 1482e: a2 e0 ldi r26, 0x02 ; 2 14830: aa 0e add r10, r26 14832: b1 1c adc r11, r1 14834: 0f b6 in r0, 0x3f ; 63 14836: f8 94 cli 14838: de bf out 0x3e, r29 ; 62 1483a: 0f be out 0x3f, r0 ; 63 1483c: cd bf out 0x3d, r28 ; 61 1483e: cb ce rjmp .-618 ; 0x145d6 This G-code will be performed at the start of a calibration script. (Prusa3D specific) */ case 86: calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 14840: 80 e1 ldi r24, 0x10 ; 16 14842: 0e 94 3d ee call 0x1dc7a ; 0x1dc7a 14846: 0c 94 7c 9a jmp 0x134f8 ; 0x134f8 This G-code will be performed at the end of a calibration script. (Prusa3D specific) */ case 87: calibration_status_set(CALIBRATION_STATUS_LIVE_ADJUST); 1484a: 80 e1 ldi r24, 0x10 ; 16 1484c: 0e 94 92 ee call 0x1dd24 ; 0x1dd24 14850: 0c 94 7c 9a jmp 0x134f8 ; 0x134f8 /*! ### 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); 14854: 80 91 e5 03 lds r24, 0x03E5 ; 0x8003e5 14858: 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; 1485a: 80 93 e5 03 sts 0x03E5, r24 ; 0x8003e5 1485e: 0c 94 7c 9a jmp 0x134f8 ; 0x134f8 14862: 80 91 e5 03 lds r24, 0x03E5 ; 0x8003e5 14866: 87 60 ori r24, 0x07 ; 7 14868: f8 cf rjmp .-16 ; 0x1485a plan_reset_next_e(); } else { // In any other case we're forced to synchronize st_synchronize(); 1486a: 0f 94 e8 42 call 0x285d0 ; 0x285d0 1486e: f1 2c mov r15, r1 14870: e1 2c mov r14, r1 for(uint8_t i = 0; i < 3; ++i) { if(codes[i]) 14872: f8 01 movw r30, r16 14874: 81 91 ld r24, Z+ 14876: 8f 01 movw r16, r30 14878: 88 23 and r24, r24 1487a: d1 f0 breq .+52 ; 0x148b0 current_position[i] = values[i] + cs.add_homing[i]; 1487c: 97 01 movw r18, r14 1487e: 2e 56 subi r18, 0x6E ; 110 14880: 39 4f sbci r19, 0xF9 ; 249 14882: 59 01 movw r10, r18 14884: f3 01 movw r30, r6 14886: ee 0d add r30, r14 14888: ff 1d adc r31, r15 1488a: 20 81 ld r18, Z 1488c: 31 81 ldd r19, Z+1 ; 0x01 1488e: 42 81 ldd r20, Z+2 ; 0x02 14890: 53 81 ldd r21, Z+3 ; 0x03 14892: f7 01 movw r30, r14 14894: ea 5e subi r30, 0xEA ; 234 14896: f1 4f sbci r31, 0xF1 ; 241 14898: 60 81 ld r22, Z 1489a: 71 81 ldd r23, Z+1 ; 0x01 1489c: 82 81 ldd r24, Z+2 ; 0x02 1489e: 93 81 ldd r25, Z+3 ; 0x03 148a0: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 148a4: d5 01 movw r26, r10 148a6: 6d 93 st X+, r22 148a8: 7d 93 st X+, r23 148aa: 8d 93 st X+, r24 148ac: 9c 93 st X, r25 148ae: 13 97 sbiw r26, 0x03 ; 3 148b0: b4 e0 ldi r27, 0x04 ; 4 148b2: eb 0e add r14, r27 148b4: 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) 148b6: ec e0 ldi r30, 0x0C ; 12 148b8: ee 16 cp r14, r30 148ba: f1 04 cpc r15, r1 148bc: d1 f6 brne .-76 ; 0x14872 { if(codes[i]) current_position[i] = values[i] + cs.add_homing[i]; } if(codes[E_AXIS]) 148be: dd 20 and r13, r13 148c0: 61 f0 breq .+24 ; 0x148da current_position[E_AXIS] = values[E_AXIS]; 148c2: 8d 85 ldd r24, Y+13 ; 0x0d 148c4: 9e 85 ldd r25, Y+14 ; 0x0e 148c6: af 85 ldd r26, Y+15 ; 0x0f 148c8: b8 89 ldd r27, Y+16 ; 0x10 148ca: 80 93 9e 06 sts 0x069E, r24 ; 0x80069e 148ce: 90 93 9f 06 sts 0x069F, r25 ; 0x80069f 148d2: a0 93 a0 06 sts 0x06A0, r26 ; 0x8006a0 148d6: b0 93 a1 06 sts 0x06A1, r27 ; 0x8006a1 // Set all at once plan_set_position_curposXYZE(); 148da: 0f 94 09 bf call 0x37e12 ; 0x37e12 148de: 0c 94 7c 9a jmp 0x134f8 ; 0x134f8 /*! --------------------------------------------------------------------------------- # M Commands */ else if(*CMDBUFFER_CURRENT_STRING == 'M') 148e2: 8d 34 cpi r24, 0x4D ; 77 148e4: 11 f0 breq .+4 ; 0x148ea 148e6: 0c 94 ad ca jmp 0x1955a ; 0x1955a { strchr_pointer = CMDBUFFER_CURRENT_STRING; 148ea: 10 93 96 03 sts 0x0396, r17 ; 0x800396 148ee: 00 93 95 03 sts 0x0395, r16 ; 0x800395 148f2: f8 01 movw r30, r16 148f4: 31 96 adiw r30, 0x01 ; 1 int index; for (index = 1; *(strchr_pointer + index) == ' ' || *(strchr_pointer + index) == '\t'; index++); 148f6: 81 91 ld r24, Z+ 148f8: 80 32 cpi r24, 0x20 ; 32 148fa: e9 f3 breq .-6 ; 0x148f6 148fc: 89 30 cpi r24, 0x09 ; 9 148fe: d9 f3 breq .-10 ; 0x148f6 /*for (++strchr_pointer; *strchr_pointer == ' ' || *strchr_pointer == '\t'; ++strchr_pointer);*/ if (*(strchr_pointer+index) < '0' || *(strchr_pointer+index) > '9') { 14900: 80 53 subi r24, 0x30 ; 48 14902: 8a 30 cpi r24, 0x0A ; 10 14904: 70 f0 brcs .+28 ; 0x14922 printf_P(PSTR("Invalid M code: %s\n"), cmdbuffer + bufindr + CMDHDRSIZE); 14906: 1f 93 push r17 14908: 0f 93 push r16 1490a: 88 e8 ldi r24, 0x88 ; 136 1490c: 97 e8 ldi r25, 0x87 ; 135 1490e: 9f 93 push r25 14910: 8f 93 push r24 14912: 0f 94 de da call 0x3b5bc ; 0x3b5bc 14916: 0f 90 pop r0 14918: 0f 90 pop r0 1491a: 0f 90 pop r0 1491c: 0f 90 pop r0 1491e: 0c 94 39 96 jmp 0x12c72 ; 0x12c72 } else { mcode_in_progress = code_value_short(); 14922: 0e 94 75 5b call 0xb6ea ; 0xb6ea 14926: 90 93 ab 0d sts 0x0DAB, r25 ; 0x800dab <_ZL17mcode_in_progress.lto_priv.530+0x1> 1492a: 80 93 aa 0d sts 0x0DAA, r24 ; 0x800daa <_ZL17mcode_in_progress.lto_priv.530> // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1492e: 89 3c cpi r24, 0xC9 ; 201 14930: 91 05 cpc r25, r1 14932: 11 f4 brne .+4 ; 0x14938 14934: 0c 94 6f b2 jmp 0x164de ; 0x164de 14938: 0c f0 brlt .+2 ; 0x1493c 1493a: 08 c3 rjmp .+1552 ; 0x14f4c 1493c: 8e 34 cpi r24, 0x4E ; 78 1493e: 91 05 cpc r25, r1 14940: 11 f4 brne .+4 ; 0x14946 14942: 0c 94 25 ae jmp 0x15c4a ; 0x15c4a 14946: 0c f0 brlt .+2 ; 0x1494a 14948: 0e c2 rjmp .+1052 ; 0x14d66 1494a: 8c 31 cpi r24, 0x1C ; 28 1494c: 91 05 cpc r25, r1 1494e: 09 f4 brne .+2 ; 0x14952 14950: de c7 rjmp .+4028 ; 0x1590e 14952: 0c f0 brlt .+2 ; 0x14956 14954: f1 c0 rjmp .+482 ; 0x14b38 14956: 85 31 cpi r24, 0x15 ; 21 14958: 91 05 cpc r25, r1 1495a: 09 f4 brne .+2 ; 0x1495e 1495c: f1 c6 rjmp .+3554 ; 0x15740 1495e: 0c f0 brlt .+2 ; 0x14962 14960: 5a c0 rjmp .+180 ; 0x14a16 14962: 81 31 cpi r24, 0x11 ; 17 14964: 91 05 cpc r25, r1 14966: 09 f4 brne .+2 ; 0x1496a 14968: e0 c6 rjmp .+3520 ; 0x1572a 1496a: dc f4 brge .+54 ; 0x149a2 1496c: 02 97 sbiw r24, 0x02 ; 2 1496e: 08 f4 brcc .+2 ; 0x14972 14970: 50 c6 rjmp .+3232 ; 0x15612 /*! #### End of M-Commands */ default: printf_P(MSG_UNKNOWN_CODE, 'M', cmdbuffer + bufindr + CMDHDRSIZE); 14972: 80 91 92 12 lds r24, 0x1292 ; 0x801292 14976: 90 91 93 12 lds r25, 0x1293 ; 0x801293 1497a: 88 55 subi r24, 0x58 ; 88 1497c: 9f 4e sbci r25, 0xEF ; 239 1497e: 9f 93 push r25 14980: 8f 93 push r24 14982: 1f 92 push r1 14984: 8d e4 ldi r24, 0x4D ; 77 14986: 8f 93 push r24 14988: 82 e5 ldi r24, 0x52 ; 82 1498a: 99 e6 ldi r25, 0x69 ; 105 1498c: 9f 93 push r25 1498e: 8f 93 push r24 14990: 0f 94 de da call 0x3b5bc ; 0x3b5bc 14994: 0f 90 pop r0 14996: 0f 90 pop r0 14998: 0f 90 pop r0 1499a: 0f 90 pop r0 1499c: 0f 90 pop r0 1499e: 0f 90 pop r0 149a0: 1d c6 rjmp .+3130 ; 0x155dc } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 149a2: 82 31 cpi r24, 0x12 ; 18 149a4: 91 05 cpc r25, r1 149a6: 11 f4 brne .+4 ; 0x149ac 149a8: 0c 94 88 af jmp 0x15f10 ; 0x15f10 149ac: 44 97 sbiw r24, 0x14 ; 20 149ae: 09 f7 brne .-62 ; 0x14972 #### 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() 149b0: 81 e0 ldi r24, 0x01 ; 1 149b2: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be SERIAL_PROTOCOLLNRPGM(_N("Begin file list"));////MSG_BEGIN_FILE_LIST 149b6: 82 e4 ldi r24, 0x42 ; 66 149b8: 99 e6 ldi r25, 0x69 ; 105 149ba: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 card.ls(CardReader::ls_param(code_seen('L'), code_seen('T'))); 149be: 84 e5 ldi r24, 0x54 ; 84 149c0: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 149c4: 18 2f mov r17, r24 149c6: 8c e4 ldi r24, 0x4C ; 76 149c8: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 149cc: 00 e0 ldi r16, 0x00 ; 0 149ce: 80 fb bst r24, 0 149d0: 00 f9 bld r16, 0 149d2: 10 fb bst r17, 0 149d4: 01 f9 bld r16, 1 } // while readDir } void CardReader::ls(ls_param params) { root.rewind(); 149d6: 86 e1 ldi r24, 0x16 ; 22 149d8: 95 e1 ldi r25, 0x15 ; 21 149da: 0e 94 2c 77 call 0xee58 ; 0xee58 lsDive("",root, NULL, LS_SerialPrint, params); 149de: 83 e2 ldi r24, 0x23 ; 35 149e0: e6 e1 ldi r30, 0x16 ; 22 149e2: f5 e1 ldi r31, 0x15 ; 21 149e4: de 01 movw r26, r28 149e6: 11 96 adiw r26, 0x01 ; 1 149e8: 01 90 ld r0, Z+ 149ea: 0d 92 st X+, r0 149ec: 8a 95 dec r24 149ee: e1 f7 brne .-8 ; 0x149e8 149f0: 20 e0 ldi r18, 0x00 ; 0 149f2: 50 e0 ldi r21, 0x00 ; 0 149f4: 40 e0 ldi r20, 0x00 ; 0 149f6: be 01 movw r22, r28 149f8: 6f 5f subi r22, 0xFF ; 255 149fa: 7f 4f sbci r23, 0xFF ; 255 149fc: 88 ef ldi r24, 0xF8 ; 248 149fe: 92 e0 ldi r25, 0x02 ; 2 14a00: 0f 94 0f 77 call 0x2ee1e ; 0x2ee1e 14a04: ce 01 movw r24, r28 14a06: 01 96 adiw r24, 0x01 ; 1 14a08: 0e 94 31 77 call 0xee62 ; 0xee62 SERIAL_PROTOCOLLNRPGM(_N("End file list"));////MSG_END_FILE_LIST 14a0c: 84 e3 ldi r24, 0x34 ; 52 14a0e: 99 e6 ldi r25, 0x69 ; 105 14a10: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 14a14: e3 c5 rjmp .+3014 ; 0x155dc } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14a16: 88 31 cpi r24, 0x18 ; 24 14a18: 91 05 cpc r25, r1 14a1a: 09 f4 brne .+2 ; 0x14a1e 14a1c: a2 c6 rjmp .+3396 ; 0x15762 14a1e: 84 f4 brge .+32 ; 0x14a40 14a20: 86 31 cpi r24, 0x16 ; 22 14a22: 91 05 cpc r25, r1 14a24: 09 f4 brne .+2 ; 0x14a28 14a26: 90 c6 rjmp .+3360 ; 0x15748 14a28: 47 97 sbiw r24, 0x17 ; 23 14a2a: 09 f0 breq .+2 ; 0x14a2e 14a2c: a2 cf rjmp .-188 ; 0x14972 M23 [filename] */ case 23: card.openFileReadFilteredGcode(strchr_pointer + 4, true); 14a2e: 80 91 95 03 lds r24, 0x0395 ; 0x800395 14a32: 90 91 96 03 lds r25, 0x0396 ; 0x800396 14a36: 61 e0 ldi r22, 0x01 ; 1 14a38: 04 96 adiw r24, 0x04 ; 4 14a3a: 0f 94 4b 7f call 0x2fe96 ; 0x2fe96 14a3e: ce c5 rjmp .+2972 ; 0x155dc } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14a40: 8a 31 cpi r24, 0x1A ; 26 14a42: 91 05 cpc r25, r1 14a44: 09 f4 brne .+2 ; 0x14a48 14a46: d3 c6 rjmp .+3494 ; 0x157ee 14a48: 0c f0 brlt .+2 ; 0x14a4c 14a4a: f3 c6 rjmp .+3558 ; 0x15832 14a4c: 0d ed ldi r16, 0xDD ; 221 14a4e: 12 e0 ldi r17, 0x02 ; 2 14a50: ff e3 ldi r31, 0x3F ; 63 14a52: af 2e mov r10, r31 14a54: f2 e0 ldi r31, 0x02 ; 2 14a56: bf 2e mov r11, r31 14a58: a1 e2 ldi r26, 0x21 ; 33 14a5a: ca 2e mov r12, r26 14a5c: a2 e0 ldi r26, 0x02 ; 2 14a5e: da 2e mov r13, r26 14a60: b5 e1 ldi r27, 0x15 ; 21 14a62: eb 2e mov r14, r27 14a64: b2 e0 ldi r27, 0x02 ; 2 14a66: 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])) { 14a68: f8 01 movw r30, r16 14a6a: 81 91 ld r24, Z+ 14a6c: 8f 01 movw r16, r30 14a6e: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 14a72: 88 23 and r24, r24 14a74: 21 f1 breq .+72 ; 0x14abe //Check that the positions are within hardware limits pause_position[axis] = constrain(code_value(), min_pos[axis], max_pos[axis]); 14a76: 0e 94 9d 60 call 0xc13a ; 0xc13a 14a7a: d6 01 movw r26, r12 14a7c: 4d 90 ld r4, X+ 14a7e: 5d 90 ld r5, X+ 14a80: 6d 90 ld r6, X+ 14a82: 7c 90 ld r7, X 14a84: a3 01 movw r20, r6 14a86: 92 01 movw r18, r4 14a88: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 14a8c: 87 fd sbrc r24, 7 14a8e: 11 c0 rjmp .+34 ; 0x14ab2 14a90: 0e 94 9d 60 call 0xc13a ; 0xc13a 14a94: f7 01 movw r30, r14 14a96: 40 80 ld r4, Z 14a98: 51 80 ldd r5, Z+1 ; 0x01 14a9a: 62 80 ldd r6, Z+2 ; 0x02 14a9c: 73 80 ldd r7, Z+3 ; 0x03 14a9e: a3 01 movw r20, r6 14aa0: 92 01 movw r18, r4 14aa2: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 14aa6: 18 16 cp r1, r24 14aa8: 24 f0 brlt .+8 ; 0x14ab2 14aaa: 0e 94 9d 60 call 0xc13a ; 0xc13a 14aae: 2b 01 movw r4, r22 14ab0: 3c 01 movw r6, r24 14ab2: d5 01 movw r26, r10 14ab4: 4d 92 st X+, r4 14ab6: 5d 92 st X+, r5 14ab8: 6d 92 st X+, r6 14aba: 7c 92 st X, r7 14abc: 13 97 sbiw r26, 0x03 ; 3 14abe: b4 e0 ldi r27, 0x04 ; 4 14ac0: ab 0e add r10, r27 14ac2: b1 1c adc r11, r1 14ac4: e4 e0 ldi r30, 0x04 ; 4 14ac6: ce 0e add r12, r30 14ac8: d1 1c adc r13, r1 14aca: f4 e0 ldi r31, 0x04 ; 4 14acc: ef 0e add r14, r31 14ace: 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++) { 14ad0: 22 e0 ldi r18, 0x02 ; 2 14ad2: 00 3e cpi r16, 0xE0 ; 224 14ad4: 12 07 cpc r17, r18 14ad6: 41 f6 brne .-112 ; 0x14a68 //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')) { 14ad8: 83 e5 ldi r24, 0x53 ; 83 14ada: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 14ade: 88 23 and r24, r24 14ae0: 11 f4 brne .+4 ; 0x14ae6 14ae2: 0c 94 2b c3 jmp 0x18656 ; 0x18656 if ( code_value_uint8() == 0 ) { 14ae6: 0e 94 68 5b call 0xb6d0 ; 0xb6d0 14aea: 81 11 cpse r24, r1 14aec: 77 c5 rjmp .+2798 ; 0x155dc pause_position[X_AXIS] = X_PAUSE_POS; 14aee: 80 e0 ldi r24, 0x00 ; 0 14af0: 90 e0 ldi r25, 0x00 ; 0 14af2: a8 e4 ldi r26, 0x48 ; 72 14af4: b2 e4 ldi r27, 0x42 ; 66 14af6: 80 93 3f 02 sts 0x023F, r24 ; 0x80023f <_ZL14pause_position.lto_priv.481> 14afa: 90 93 40 02 sts 0x0240, r25 ; 0x800240 <_ZL14pause_position.lto_priv.481+0x1> 14afe: a0 93 41 02 sts 0x0241, r26 ; 0x800241 <_ZL14pause_position.lto_priv.481+0x2> 14b02: b0 93 42 02 sts 0x0242, r27 ; 0x800242 <_ZL14pause_position.lto_priv.481+0x3> pause_position[Y_AXIS] = Y_PAUSE_POS; 14b06: 80 e0 ldi r24, 0x00 ; 0 14b08: 90 e0 ldi r25, 0x00 ; 0 14b0a: ae e3 ldi r26, 0x3E ; 62 14b0c: b3 e4 ldi r27, 0x43 ; 67 14b0e: 80 93 43 02 sts 0x0243, r24 ; 0x800243 <_ZL14pause_position.lto_priv.481+0x4> 14b12: 90 93 44 02 sts 0x0244, r25 ; 0x800244 <_ZL14pause_position.lto_priv.481+0x5> 14b16: a0 93 45 02 sts 0x0245, r26 ; 0x800245 <_ZL14pause_position.lto_priv.481+0x6> 14b1a: b0 93 46 02 sts 0x0246, r27 ; 0x800246 <_ZL14pause_position.lto_priv.481+0x7> pause_position[Z_AXIS] = Z_PAUSE_LIFT; 14b1e: 80 e0 ldi r24, 0x00 ; 0 14b20: 90 e0 ldi r25, 0x00 ; 0 14b22: a0 ea ldi r26, 0xA0 ; 160 14b24: b1 e4 ldi r27, 0x41 ; 65 14b26: 80 93 47 02 sts 0x0247, r24 ; 0x800247 <_ZL14pause_position.lto_priv.481+0x8> 14b2a: 90 93 48 02 sts 0x0248, r25 ; 0x800248 <_ZL14pause_position.lto_priv.481+0x9> 14b2e: a0 93 49 02 sts 0x0249, r26 ; 0x800249 <_ZL14pause_position.lto_priv.481+0xa> 14b32: b0 93 4a 02 sts 0x024A, r27 ; 0x80024a <_ZL14pause_position.lto_priv.481+0xb> 14b36: 52 c5 rjmp .+2724 ; 0x155dc } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14b38: 8d 32 cpi r24, 0x2D ; 45 14b3a: 91 05 cpc r25, r1 14b3c: 09 f4 brne .+2 ; 0x14b40 14b3e: 89 c7 rjmp .+3858 ; 0x15a52 14b40: 0c f0 brlt .+2 ; 0x14b44 14b42: e3 c0 rjmp .+454 ; 0x14d0a 14b44: 8f 31 cpi r24, 0x1F ; 31 14b46: 91 05 cpc r25, r1 14b48: 09 f4 brne .+2 ; 0x14b4c 14b4a: 10 c7 rjmp .+3616 ; 0x1596c 14b4c: 0c f0 brlt .+2 ; 0x14b50 14b4e: 63 c0 rjmp .+198 ; 0x14c16 14b50: 8d 31 cpi r24, 0x1D ; 29 14b52: 91 05 cpc r25, r1 14b54: 09 f4 brne .+2 ; 0x14b58 14b56: 42 c5 rjmp .+2692 ; 0x155dc 14b58: 4e 97 sbiw r24, 0x1e ; 30 14b5a: 09 f0 breq .+2 ; 0x14b5e 14b5c: 0a cf rjmp .-492 ; 0x14972 M30 [filename] */ case 30: if (card.mounted){ 14b5e: 80 91 91 14 lds r24, 0x1491 ; 0x801491 14b62: 88 23 and r24, r24 14b64: 09 f4 brne .+2 ; 0x14b68 14b66: 3a c5 rjmp .+2676 ; 0x155dc lastnr++; } void CardReader::closefile(bool store_location) { file.sync(); 14b68: 80 e2 ldi r24, 0x20 ; 32 14b6a: 97 e1 ldi r25, 0x17 ; 23 14b6c: 0f 94 3b 58 call 0x2b076 ; 0x2b076 file.close(); 14b70: 80 e2 ldi r24, 0x20 ; 32 14b72: 97 e1 ldi r25, 0x17 ; 23 14b74: 0f 94 70 58 call 0x2b0e0 ; 0x2b0e0 saving = false; 14b78: 10 92 8e 14 sts 0x148E, r1 ; 0x80148e logging = false; 14b7c: 10 92 8f 14 sts 0x148F, r1 ; 0x80148f card.closefile(); card.removeFile(strchr_pointer + 4); 14b80: 00 91 95 03 lds r16, 0x0395 ; 0x800395 14b84: 10 91 96 03 lds r17, 0x0396 ; 0x800396 14b88: 0c 5f subi r16, 0xFC ; 252 14b8a: 1f 4f sbci r17, 0xFF ; 255 } } void CardReader::removeFile(const char* name) { if(!mounted) return; 14b8c: 80 91 91 14 lds r24, 0x1491 ; 0x801491 14b90: 88 23 and r24, r24 14b92: 09 f4 brne .+2 ; 0x14b96 14b94: 23 c5 rjmp .+2630 ; 0x155dc file.close(); 14b96: 80 e2 ldi r24, 0x20 ; 32 14b98: 97 e1 ldi r25, 0x17 ; 23 14b9a: 0f 94 70 58 call 0x2b0e0 ; 0x2b0e0 sdprinting = false; 14b9e: 10 92 90 14 sts 0x1490, r1 ; 0x801490 const char *fname=name; 14ba2: 23 96 adiw r28, 0x03 ; 3 14ba4: 1f af std Y+63, r17 ; 0x3f 14ba6: 0e af std Y+62, r16 ; 0x3e 14ba8: 23 97 sbiw r28, 0x03 ; 3 if (!diveSubfolder(fname)) 14baa: ce 01 movw r24, r28 14bac: 8f 5b subi r24, 0xBF ; 191 14bae: 9f 4f sbci r25, 0xFF ; 255 14bb0: 0f 94 c6 7e call 0x2fd8c ; 0x2fd8c 14bb4: 88 23 and r24, r24 14bb6: 09 f4 brne .+2 ; 0x14bba 14bb8: 11 c5 rjmp .+2594 ; 0x155dc return; if (file.remove(curDir, fname)) 14bba: 23 96 adiw r28, 0x03 ; 3 14bbc: 4e ad ldd r20, Y+62 ; 0x3e 14bbe: 5f ad ldd r21, Y+63 ; 0x3f 14bc0: 23 97 sbiw r28, 0x03 ; 3 14bc2: 60 91 39 15 lds r22, 0x1539 ; 0x801539 14bc6: 70 91 3a 15 lds r23, 0x153A ; 0x80153a * \brief Base class for SdFile with Print and C++ streams. */ class SdBaseFile { public: /** Create an instance. */ SdBaseFile() : writeError(false), type_(FAT_FILE_TYPE_CLOSED) {} 14bca: 19 82 std Y+1, r1 ; 0x01 14bcc: 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; 14bce: 22 e0 ldi r18, 0x02 ; 2 14bd0: ce 01 movw r24, r28 14bd2: 01 96 adiw r24, 0x01 ; 1 14bd4: 0f 94 18 64 call 0x2c830 ; 0x2c830 14bd8: 81 11 cpse r24, r1 14bda: a1 c6 rjmp .+3394 ; 0x1591e return file.remove(); fail: // can't set iostate - static function return false; 14bdc: 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; 14bde: ce 01 movw r24, r28 14be0: 01 96 adiw r24, 0x01 ; 1 14be2: 0e 94 31 77 call 0xee62 ; 0xee62 14be6: 11 23 and r17, r17 14be8: 09 f4 brne .+2 ; 0x14bec 14bea: b0 c6 rjmp .+3424 ; 0x1594c { SERIAL_PROTOCOLPGM("File deleted:"); 14bec: 84 eb ldi r24, 0xB4 ; 180 14bee: 94 e8 ldi r25, 0x84 ; 132 14bf0: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_PROTOCOLLN(fname); 14bf4: 23 96 adiw r28, 0x03 ; 3 14bf6: 8e ad ldd r24, Y+62 ; 0x3e 14bf8: 9f ad ldd r25, Y+63 ; 0x3f 14bfa: 23 97 sbiw r28, 0x03 ; 3 14bfc: 0f 94 00 d6 call 0x3ac00 ; 0x3ac00 sdpos = 0; 14c00: 10 92 a4 17 sts 0x17A4, r1 ; 0x8017a4 14c04: 10 92 a5 17 sts 0x17A5, r1 ; 0x8017a5 14c08: 10 92 a6 17 sts 0x17A6, r1 ; 0x8017a6 14c0c: 10 92 a7 17 sts 0x17A7, r1 ; 0x8017a7 #ifdef SDCARD_SORT_ALPHA presort(); 14c10: 0f 94 92 7c call 0x2f924 ; 0x2f924 14c14: e3 c4 rjmp .+2502 ; 0x155dc } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14c16: 8a 32 cpi r24, 0x2A ; 42 14c18: 91 05 cpc r25, r1 14c1a: 09 f4 brne .+2 ; 0x14c1e 14c1c: ce c6 rjmp .+3484 ; 0x159ba 14c1e: 8c 32 cpi r24, 0x2C ; 44 14c20: 91 05 cpc r25, r1 14c22: 09 f4 brne .+2 ; 0x14c26 14c24: fd c6 rjmp .+3578 ; 0x15a20 14c26: 80 97 sbiw r24, 0x20 ; 32 14c28: 09 f0 breq .+2 ; 0x14c2c 14c2a: a3 ce rjmp .-698 ; 0x14972 - `S` - Starting file offset */ case 32: { if(card.sdprinting) { 14c2c: 80 91 90 14 lds r24, 0x1490 ; 0x801490 14c30: 81 11 cpse r24, r1 st_synchronize(); 14c32: 0f 94 e8 42 call 0x285d0 ; 0x285d0 } const char* namestartpos = (strchr(strchr_pointer + 4,'!')); //find ! to indicate filename string start. 14c36: 00 91 95 03 lds r16, 0x0395 ; 0x800395 14c3a: 10 91 96 03 lds r17, 0x0396 ; 0x800396 14c3e: 0c 5f subi r16, 0xFC ; 252 14c40: 1f 4f sbci r17, 0xFF ; 255 14c42: 61 e2 ldi r22, 0x21 ; 33 14c44: 70 e0 ldi r23, 0x00 ; 0 14c46: c8 01 movw r24, r16 14c48: 0f 94 73 e2 call 0x3c4e6 ; 0x3c4e6 if(namestartpos==NULL) 14c4c: 00 97 sbiw r24, 0x00 ; 0 14c4e: 19 f0 breq .+6 ; 0x14c56 { namestartpos=strchr_pointer + 4; //default name position, 4 letters after the M } else namestartpos++; //to skip the '!' 14c50: 8c 01 movw r16, r24 14c52: 0f 5f subi r16, 0xFF ; 255 14c54: 1f 4f sbci r17, 0xFF ; 255 bool call_procedure=(code_seen('P')); 14c56: 80 e5 ldi r24, 0x50 ; 80 14c58: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 14c5c: f8 2e mov r15, r24 if(strchr_pointer>namestartpos) 14c5e: 80 91 95 03 lds r24, 0x0395 ; 0x800395 14c62: 90 91 96 03 lds r25, 0x0396 ; 0x800396 14c66: 08 17 cp r16, r24 14c68: 19 07 cpc r17, r25 14c6a: 08 f4 brcc .+2 ; 0x14c6e call_procedure=false; //false alert, 'P' found within filename 14c6c: f1 2c mov r15, r1 if( card.mounted ) 14c6e: 80 91 91 14 lds r24, 0x1491 ; 0x801491 14c72: 88 23 and r24, r24 14c74: 09 f4 brne .+2 ; 0x14c78 14c76: b2 c4 rjmp .+2404 ; 0x155dc { card.openFileReadFilteredGcode(namestartpos,!call_procedure); 14c78: 61 e0 ldi r22, 0x01 ; 1 14c7a: 6f 25 eor r22, r15 14c7c: c8 01 movw r24, r16 14c7e: 0f 94 4b 7f call 0x2fe96 ; 0x2fe96 if(code_seen('S')) 14c82: 83 e5 ldi r24, 0x53 ; 83 14c84: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 14c88: 88 23 and r24, r24 14c8a: 99 f0 breq .+38 ; 0x14cb2 if(strchr_pointer 14c90: 90 91 96 03 lds r25, 0x0396 ; 0x800396 14c94: 80 17 cp r24, r16 14c96: 91 07 cpc r25, r17 14c98: 60 f4 brcc .+24 ; 0x14cb2 card.setIndex(code_value_long()); 14c9a: 0e 94 82 5b call 0xb704 ; 0xb704 { int16_t c = (int16_t)file.readFilteredGcode(); sdpos = file.curPosition(); return c; }; void setIndex(long index) {sdpos = index;file.seekSetFilteredGcode(index);}; 14c9e: 60 93 a4 17 sts 0x17A4, r22 ; 0x8017a4 14ca2: 70 93 a5 17 sts 0x17A5, r23 ; 0x8017a5 14ca6: 80 93 a6 17 sts 0x17A6, r24 ; 0x8017a6 14caa: 90 93 a7 17 sts 0x17A7, r25 ; 0x8017a7 14cae: 0f 94 9c 75 call 0x2eb38 ; 0x2eb38 SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED } void CardReader::startFileprint() { if(mounted) 14cb2: 80 91 91 14 lds r24, 0x1491 ; 0x801491 14cb6: 88 23 and r24, r24 14cb8: 31 f0 breq .+12 ; 0x14cc6 { sdprinting = true; 14cba: 81 e0 ldi r24, 0x01 ; 1 14cbc: 80 93 90 14 sts 0x1490, r24 ; 0x801490 14cc0: 85 e0 ldi r24, 0x05 ; 5 14cc2: 80 93 b8 0d sts 0x0DB8, r24 ; 0x800db8 <_ZL13printer_state.lto_priv.401> card.startFileprint(); if(!call_procedure) 14cc6: f1 10 cpse r15, r1 14cc8: 89 c4 rjmp .+2322 ; 0x155dc 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); }; 14cca: 80 91 23 17 lds r24, 0x1723 ; 0x801723 14cce: 88 23 and r24, r24 14cd0: 61 f0 breq .+24 ; 0x14cea { if(!card.get_sdpos()) 14cd2: 80 91 a4 17 lds r24, 0x17A4 ; 0x8017a4 14cd6: 90 91 a5 17 lds r25, 0x17A5 ; 0x8017a5 14cda: a0 91 a6 17 lds r26, 0x17A6 ; 0x8017a6 14cde: b0 91 a7 17 lds r27, 0x17A7 ; 0x8017a7 14ce2: 89 2b or r24, r25 14ce4: 8a 2b or r24, r26 14ce6: 8b 2b or r24, r27 14ce8: 69 f4 brne .+26 ; 0x14d04 { // A new print has started from scratch, reset stats failstats_reset_print(); 14cea: 0e 94 24 5c call 0xb848 ; 0xb848 sdpos_atomic = 0; 14cee: 10 92 82 03 sts 0x0382, r1 ; 0x800382 14cf2: 10 92 83 03 sts 0x0383, r1 ; 0x800383 14cf6: 10 92 84 03 sts 0x0384, r1 ; 0x800384 14cfa: 10 92 85 03 sts 0x0385, r1 ; 0x800385 14cfe: 80 e0 ldi r24, 0x00 ; 0 14d00: 0e 94 17 82 call 0x1042e ; 0x1042e #ifndef LA_NOCOMPAT la10c_reset(); #endif } print_job_timer.start(); // procedure calls count as normal print time. 14d04: 0f 94 8d 42 call 0x2851a ; 0x2851a 14d08: 69 c4 rjmp .+2258 ; 0x155dc } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14d0a: 89 34 cpi r24, 0x49 ; 73 14d0c: 91 05 cpc r25, r1 14d0e: 09 f4 brne .+2 ; 0x14d12 14d10: e4 c6 rjmp .+3528 ; 0x15ada 14d12: cc f4 brge .+50 ; 0x14d46 14d14: 8e 32 cpi r24, 0x2E ; 46 14d16: 91 05 cpc r25, r1 14d18: 09 f4 brne .+2 ; 0x14d1c 14d1a: a1 c6 rjmp .+3394 ; 0x15a5e 14d1c: 88 34 cpi r24, 0x48 ; 72 14d1e: 91 05 cpc r25, r1 14d20: 09 f0 breq .+2 ; 0x14d24 14d22: 27 ce rjmp .-946 ; 0x14972 #### Parameters - `Snnn` - Set printer state 0 = not_ready, 1 = ready */ case 72: { if(code_seen('S')){ 14d24: 83 e5 ldi r24, 0x53 ; 83 14d26: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 14d2a: 88 23 and r24, r24 14d2c: 09 f4 brne .+2 ; 0x14d30 14d2e: c6 c6 rjmp .+3468 ; 0x15abc switch (code_value_uint8()){ 14d30: 0e 94 68 5b call 0xb6d0 ; 0xb6d0 14d34: 88 23 and r24, r24 14d36: 09 f4 brne .+2 ; 0x14d3a 14d38: be c6 rjmp .+3452 ; 0x15ab6 14d3a: 81 30 cpi r24, 0x01 ; 1 14d3c: 09 f0 breq .+2 ; 0x14d40 14d3e: 4e c4 rjmp .+2204 ; 0x155dc 14d40: 80 93 b8 0d sts 0x0DB8, r24 ; 0x800db8 <_ZL13printer_state.lto_priv.401> 14d44: 4b c4 rjmp .+2198 ; 0x155dc } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14d46: 8c 34 cpi r24, 0x4C ; 76 14d48: 91 05 cpc r25, r1 14d4a: 09 f4 brne .+2 ; 0x14d4e 14d4c: 66 c7 rjmp .+3788 ; 0x15c1a 14d4e: 0c f0 brlt .+2 ; 0x14d52 14d50: 77 c7 rjmp .+3822 ; 0x15c40 14d52: 8b 34 cpi r24, 0x4B ; 75 14d54: 91 05 cpc r25, r1 14d56: 09 f0 breq .+2 ; 0x14d5a 14d58: 0c ce rjmp .-1000 ; 0x14972 /*! ### M75 - Start the print job timer M75: Start the print job timer */ case 75: { if (!filament_presence_check()) { 14d5a: 0e 94 02 f5 call 0x1ea04 ; 0x1ea04 14d5e: 88 23 and r24, r24 14d60: 09 f4 brne .+2 ; 0x14d64 14d62: 3c c4 rjmp .+2168 ; 0x155dc 14d64: cf cf rjmp .-98 ; 0x14d04 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14d66: 8e 36 cpi r24, 0x6E ; 110 14d68: 91 05 cpc r25, r1 14d6a: 11 f4 brne .+4 ; 0x14d70 14d6c: 0c 94 7f b0 jmp 0x160fe ; 0x160fe 14d70: 0c f0 brlt .+2 ; 0x14d74 14d72: 7d c0 rjmp .+250 ; 0x14e6e 14d74: 86 35 cpi r24, 0x56 ; 86 14d76: 91 05 cpc r25, r1 14d78: 11 f4 brne .+4 ; 0x14d7e 14d7a: 0c 94 d8 af jmp 0x15fb0 ; 0x15fb0 14d7e: b4 f5 brge .+108 ; 0x14dec 14d80: 83 35 cpi r24, 0x53 ; 83 14d82: 91 05 cpc r25, r1 14d84: 11 f4 brne .+4 ; 0x14d8a 14d86: 0c 94 82 af jmp 0x15f04 ; 0x15f04 14d8a: 74 f4 brge .+28 ; 0x14da8 14d8c: 8f 34 cpi r24, 0x4F ; 79 14d8e: 91 05 cpc r25, r1 14d90: 09 f4 brne .+2 ; 0x14d94 14d92: 76 c7 rjmp .+3820 ; 0x15c80 14d94: 82 35 cpi r24, 0x52 ; 82 14d96: 91 05 cpc r25, r1 14d98: 09 f0 breq .+2 ; 0x14d9c 14d9a: eb cd rjmp .-1066 ; 0x14972 /*! ### 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; 14d9c: 80 91 e5 03 lds r24, 0x03E5 ; 0x8003e5 14da0: 87 7f andi r24, 0xF7 ; 247 14da2: 80 93 e5 03 sts 0x03E5, r24 ; 0x8003e5 14da6: 1a c4 rjmp .+2100 ; 0x155dc } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14da8: 84 35 cpi r24, 0x54 ; 84 14daa: 91 05 cpc r25, r1 14dac: 11 f4 brne .+4 ; 0x14db2 14dae: 0c 94 88 af jmp 0x15f10 ; 0x15f10 14db2: 85 35 cpi r24, 0x55 ; 85 14db4: 91 05 cpc r25, r1 14db6: 09 f0 breq .+2 ; 0x14dba 14db8: dc cd rjmp .-1096 ; 0x14972 #### 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')) { 14dba: 83 e5 ldi r24, 0x53 ; 83 14dbc: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 14dc0: 88 23 and r24, r24 14dc2: 09 f4 brne .+2 ; 0x14dc6 14dc4: 0b c4 rjmp .+2070 ; 0x155dc max_inactive_time = code_value() * 1000; 14dc6: 0e 94 9d 60 call 0xc13a ; 0xc13a 14dca: 20 e0 ldi r18, 0x00 ; 0 14dcc: 30 e0 ldi r19, 0x00 ; 0 14dce: 4a e7 ldi r20, 0x7A ; 122 14dd0: 54 e4 ldi r21, 0x44 ; 68 14dd2: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 14dd6: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 14dda: 60 93 7e 03 sts 0x037E, r22 ; 0x80037e 14dde: 70 93 7f 03 sts 0x037F, r23 ; 0x80037f 14de2: 80 93 80 03 sts 0x0380, r24 ; 0x800380 14de6: 90 93 81 03 sts 0x0381, r25 ; 0x800381 14dea: f8 c3 rjmp .+2032 ; 0x155dc } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14dec: 89 36 cpi r24, 0x69 ; 105 14dee: 91 05 cpc r25, r1 14df0: 09 f4 brne .+2 ; 0x14df4 14df2: a2 c7 rjmp .+3908 ; 0x15d38 14df4: c4 f4 brge .+48 ; 0x14e26 14df6: 8c 35 cpi r24, 0x5C ; 92 14df8: 91 05 cpc r25, r1 14dfa: 11 f4 brne .+4 ; 0x14e00 14dfc: 0c 94 f5 af jmp 0x15fea ; 0x15fea 14e00: 88 36 cpi r24, 0x68 ; 104 14e02: 91 05 cpc r25, r1 14e04: 09 f0 breq .+2 ; 0x14e08 14e06: b5 cd rjmp .-1174 ; 0x14972 #### Parameters - `S` - Target temperature */ case 104: // M104 { if (code_seen('S')) 14e08: 83 e5 ldi r24, 0x53 ; 83 14e0a: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 14e0e: 88 23 and r24, r24 14e10: 09 f4 brne .+2 ; 0x14e14 14e12: e4 c3 rjmp .+1992 ; 0x155dc { setTargetHotend(code_value()); 14e14: 0e 94 9d 60 call 0xc13a ; 0xc13a return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 14e18: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> 14e1c: 70 93 b7 0d sts 0x0DB7, r23 ; 0x800db7 14e20: 60 93 b6 0d sts 0x0DB6, r22 ; 0x800db6 14e24: db c3 rjmp .+1974 ; 0x155dc } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14e26: 8b 36 cpi r24, 0x6B ; 107 14e28: 91 05 cpc r25, r1 14e2a: 11 f4 brne .+4 ; 0x14e30 14e2c: 0c 94 7f af jmp 0x15efe ; 0x15efe 14e30: 14 f4 brge .+4 ; 0x14e36 14e32: 0c 94 71 af jmp 0x15ee2 ; 0x15ee2 14e36: 8d 36 cpi r24, 0x6D ; 109 14e38: 91 05 cpc r25, r1 14e3a: 09 f0 breq .+2 ; 0x14e3e 14e3c: 9a cd rjmp .-1228 ; 0x14972 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)); 14e3e: 8d e2 ldi r24, 0x2D ; 45 14e40: 9e e4 ldi r25, 0x4E ; 78 14e42: 0e 94 ac 72 call 0xe558 ; 0xe558 14e46: 0e 94 5d f1 call 0x1e2ba ; 0x1e2ba heating_status = HeatingStatus::EXTRUDER_HEATING; 14e4a: 81 e0 ldi r24, 0x01 ; 1 14e4c: 80 93 e3 03 sts 0x03E3, r24 ; 0x8003e3 prusa_statistics(1); #ifdef AUTOTEMP autotemp_enabled=false; #endif if (code_seen('S')) { 14e50: 83 e5 ldi r24, 0x53 ; 83 14e52: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 14e56: 88 23 and r24, r24 14e58: 09 f4 brne .+2 ; 0x14e5c 14e5a: 81 c7 rjmp .+3842 ; 0x15d5e setTargetHotend(code_value()); } else if (code_seen('R')) { setTargetHotend(code_value()); 14e5c: 0e 94 9d 60 call 0xc13a ; 0xc13a 14e60: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> 14e64: 70 93 b7 0d sts 0x0DB7, r23 ; 0x800db7 14e68: 60 93 b6 0d sts 0x0DB6, r22 ; 0x800db6 14e6c: 7d c7 rjmp .+3834 ; 0x15d68 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14e6e: 87 37 cpi r24, 0x77 ; 119 14e70: 91 05 cpc r25, r1 14e72: 11 f4 brne .+4 ; 0x14e78 14e74: 0c 94 c4 b1 jmp 0x16388 ; 0x16388 14e78: 94 f5 brge .+100 ; 0x14ede 14e7a: 82 37 cpi r24, 0x72 ; 114 14e7c: 91 05 cpc r25, r1 14e7e: 11 f4 brne .+4 ; 0x14e84 14e80: 0c 94 79 b1 jmp 0x162f2 ; 0x162f2 14e84: a4 f4 brge .+40 ; 0x14eae 14e86: 80 37 cpi r24, 0x70 ; 112 14e88: 91 05 cpc r25, r1 14e8a: 09 f4 brne .+2 ; 0x14e8e 14e8c: 42 c7 rjmp .+3716 ; 0x15d12 14e8e: 81 37 cpi r24, 0x71 ; 113 14e90: 91 05 cpc r25, r1 14e92: 09 f0 breq .+2 ; 0x14e96 14e94: 6e cd rjmp .-1316 ; 0x14972 #### Parameters - `S` - Seconds. Default is 2 seconds between "busy" messages */ case 113: if (code_seen('S')) { 14e96: 83 e5 ldi r24, 0x53 ; 83 14e98: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 14e9c: 88 23 and r24, r24 14e9e: 11 f4 brne .+4 ; 0x14ea4 14ea0: 0c 94 90 b0 jmp 0x16120 ; 0x16120 host_keepalive_interval = code_value_uint8(); 14ea4: 0e 94 68 5b call 0xb6d0 ; 0xb6d0 14ea8: 80 93 2f 02 sts 0x022F, r24 ; 0x80022f 14eac: 97 c3 rjmp .+1838 ; 0x155dc } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14eae: 85 37 cpi r24, 0x75 ; 117 14eb0: 91 05 cpc r25, r1 14eb2: 11 f4 brne .+4 ; 0x14eb8 14eb4: 0c 94 7c b1 jmp 0x162f8 ; 0x162f8 14eb8: 14 f0 brlt .+4 ; 0x14ebe 14eba: 0c 94 8c b1 jmp 0x16318 ; 0x16318 14ebe: 83 37 cpi r24, 0x73 ; 115 14ec0: 91 05 cpc r25, r1 14ec2: 09 f0 breq .+2 ; 0x14ec6 14ec4: 56 cd rjmp .-1364 ; 0x14972 #### 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')) { 14ec6: 86 e5 ldi r24, 0x56 ; 86 14ec8: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 14ecc: 88 23 and r24, r24 14ece: 11 f4 brne .+4 ; 0x14ed4 14ed0: 0c 94 a5 b0 jmp 0x1614a ; 0x1614a // Report the Prusa version number. SERIAL_PROTOCOLLNRPGM(FW_VERSION_STR_P()); 14ed4: 85 e9 ldi r24, 0x95 ; 149 14ed6: 94 e8 ldi r25, 0x84 ; 132 14ed8: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 14edc: 7f c3 rjmp .+1790 ; 0x155dc } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14ede: 8c 38 cpi r24, 0x8C ; 140 14ee0: 91 05 cpc r25, r1 14ee2: 09 f4 brne .+2 ; 0x14ee6 14ee4: 1a c7 rjmp .+3636 ; 0x15d1a 14ee6: 54 f4 brge .+20 ; 0x14efc 14ee8: 8b 37 cpi r24, 0x7B ; 123 14eea: 91 05 cpc r25, r1 14eec: 11 f4 brne .+4 ; 0x14ef2 14eee: 0c 94 29 b2 jmp 0x16452 ; 0x16452 14ef2: 8d 37 cpi r24, 0x7D ; 125 14ef4: 91 05 cpc r25, r1 14ef6: 09 f4 brne .+2 ; 0x14efa 14ef8: a9 cd rjmp .-1198 ; 0x14a4c 14efa: 3b cd rjmp .-1418 ; 0x14972 14efc: 8e 3b cpi r24, 0xBE ; 190 14efe: 91 05 cpc r25, r1 14f00: 09 f4 brne .+2 ; 0x14f04 14f02: 62 c7 rjmp .+3780 ; 0x15dc8 14f04: 88 3c cpi r24, 0xC8 ; 200 14f06: 91 05 cpc r25, r1 14f08: 11 f4 brne .+4 ; 0x14f0e 14f0a: 0c 94 2c b2 jmp 0x16458 ; 0x16458 14f0e: 8b 39 cpi r24, 0x9B ; 155 14f10: 91 05 cpc r25, r1 14f12: 09 f0 breq .+2 ; 0x14f16 14f14: 2e cd rjmp .-1444 ; 0x14972 bit 6 = free bit 7 = free */ case 155: { if (code_seen('S')){ 14f16: 83 e5 ldi r24, 0x53 ; 83 14f18: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 14f1c: 88 23 and r24, r24 14f1e: 59 f0 breq .+22 ; 0x14f36 autoReportFeatures.SetPeriod( code_value_uint8() ); 14f20: 0e 94 68 5b call 0xb6d0 ; 0xb6d0 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; 14f24: 80 93 88 14 sts 0x1488, r24 ; 0x801488 if (auto_report_period != 0){ 14f28: 88 23 and r24, r24 14f2a: 09 f4 brne .+2 ; 0x14f2e 14f2c: 11 c7 rjmp .+3618 ; 0x15d50 auto_report_timer.start(); 14f2e: 89 e8 ldi r24, 0x89 ; 137 14f30: 94 e1 ldi r25, 0x14 ; 20 14f32: 0f 94 ef 2b call 0x257de ; 0x257de ::start()> case 155: { if (code_seen('S')){ autoReportFeatures.SetPeriod( code_value_uint8() ); } if (code_seen('C')){ 14f36: 83 e4 ldi r24, 0x43 ; 67 14f38: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 14f3c: 88 23 and r24, r24 14f3e: 09 f4 brne .+2 ; 0x14f42 14f40: 0a c7 rjmp .+3604 ; 0x15d56 autoReportFeatures.SetMask(code_value_uint8()); 14f42: 0e 94 68 5b call 0xb6d0 ; 0xb6d0 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; } 14f46: 80 93 87 14 sts 0x1487, r24 ; 0x801487 14f4a: 48 c3 rjmp .+1680 ; 0x155dc } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14f4c: 86 3f cpi r24, 0xF6 ; 246 14f4e: f1 e0 ldi r31, 0x01 ; 1 14f50: 9f 07 cpc r25, r31 14f52: 11 f4 brne .+4 ; 0x14f58 14f54: 0c 94 e3 bb jmp 0x177c6 ; 0x177c6 14f58: 0c f0 brlt .+2 ; 0x14f5c 14f5a: f7 c1 rjmp .+1006 ; 0x1534a 14f5c: 8c 32 cpi r24, 0x2C ; 44 14f5e: 31 e0 ldi r19, 0x01 ; 1 14f60: 93 07 cpc r25, r19 14f62: 11 f4 brne .+4 ; 0x14f68 14f64: 0c 94 ef b4 jmp 0x169de ; 0x169de 14f68: 0c f0 brlt .+2 ; 0x14f6c 14f6a: 1b c1 rjmp .+566 ; 0x151a2 14f6c: 80 3d cpi r24, 0xD0 ; 208 14f6e: 91 05 cpc r25, r1 14f70: 11 f4 brne .+4 ; 0x14f76 14f72: 0c 94 de b3 jmp 0x167bc ; 0x167bc 14f76: 0c f0 brlt .+2 ; 0x14f7a 14f78: 73 c0 rjmp .+230 ; 0x15060 14f7a: 8d 3c cpi r24, 0xCD ; 205 14f7c: 91 05 cpc r25, r1 14f7e: 11 f4 brne .+4 ; 0x14f84 14f80: 0c 94 45 b3 jmp 0x1668a ; 0x1668a 14f84: 9c f5 brge .+102 ; 0x14fec 14f86: 8b 3c cpi r24, 0xCB ; 203 14f88: 91 05 cpc r25, r1 14f8a: 11 f4 brne .+4 ; 0x14f90 14f8c: 0c 94 bc b2 jmp 0x16578 ; 0x16578 14f90: 8c 3c cpi r24, 0xCC ; 204 14f92: 91 05 cpc r25, r1 14f94: 09 f0 breq .+2 ; 0x14f98 14f96: ed cc rjmp .-1574 ; 0x14972 - `R` - filmanent only moves - `T` - travel moves (as of now T is ignored) */ case 204: { if(code_seen('S')) { 14f98: 83 e5 ldi r24, 0x53 ; 83 14f9a: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 14f9e: 88 23 and r24, r24 14fa0: 11 f4 brne .+4 ; 0x14fa6 14fa2: 0c 94 14 b3 jmp 0x16628 ; 0x16628 // 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(); 14fa6: 0e 94 9d 60 call 0xc13a ; 0xc13a 14faa: 60 93 7e 0e sts 0x0E7E, r22 ; 0x800e7e 14fae: 70 93 7f 0e sts 0x0E7F, r23 ; 0x800e7f 14fb2: 80 93 80 0e sts 0x0E80, r24 ; 0x800e80 14fb6: 90 93 81 0e sts 0x0E81, r25 ; 0x800e81 14fba: 60 93 f2 0d sts 0x0DF2, r22 ; 0x800df2 14fbe: 70 93 f3 0d sts 0x0DF3, r23 ; 0x800df3 14fc2: 80 93 f4 0d sts 0x0DF4, r24 ; 0x800df4 14fc6: 90 93 f5 0d sts 0x0DF5, r25 ; 0x800df5 // Interpret the T value as retract acceleration in the old Marlin format. if(code_seen('T')) 14fca: 84 e5 ldi r24, 0x54 ; 84 14fcc: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 14fd0: 88 23 and r24, r24 14fd2: 09 f4 brne .+2 ; 0x14fd6 14fd4: 03 c3 rjmp .+1542 ; 0x155dc cs.retract_acceleration = code_value(); 14fd6: 0e 94 9d 60 call 0xc13a ; 0xc13a 14fda: 60 93 f6 0d sts 0x0DF6, r22 ; 0x800df6 14fde: 70 93 f7 0d sts 0x0DF7, r23 ; 0x800df7 14fe2: 80 93 f8 0d sts 0x0DF8, r24 ; 0x800df8 14fe6: 90 93 f9 0d sts 0x0DF9, r25 ; 0x800df9 14fea: f8 c2 rjmp .+1520 ; 0x155dc } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14fec: 8e 3c cpi r24, 0xCE ; 206 14fee: 91 05 cpc r25, r1 14ff0: 11 f4 brne .+4 ; 0x14ff6 14ff2: 0c 94 be b3 jmp 0x1677c ; 0x1677c 14ff6: 8f 3c cpi r24, 0xCF ; 207 14ff8: 91 05 cpc r25, r1 14ffa: 09 f0 breq .+2 ; 0x14ffe 14ffc: ba cc rjmp .-1676 ; 0x14972 - `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')) 14ffe: 83 e5 ldi r24, 0x53 ; 83 15000: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 15004: 88 23 and r24, r24 15006: 51 f0 breq .+20 ; 0x1501c { cs.retract_length = code_value() ; 15008: 0e 94 9d 60 call 0xc13a ; 0xc13a 1500c: 60 93 41 0e sts 0x0E41, r22 ; 0x800e41 15010: 70 93 42 0e sts 0x0E42, r23 ; 0x800e42 15014: 80 93 43 0e sts 0x0E43, r24 ; 0x800e43 15018: 90 93 44 0e sts 0x0E44, r25 ; 0x800e44 } if(code_seen('F')) 1501c: 86 e4 ldi r24, 0x46 ; 70 1501e: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 15022: 88 23 and r24, r24 15024: 61 f0 breq .+24 ; 0x1503e { cs.retract_feedrate = get_feedrate_mm_s(code_value()); 15026: 0e 94 9d 60 call 0xc13a ; 0xc13a 1502a: 0e 94 c7 66 call 0xcd8e ; 0xcd8e 1502e: 60 93 45 0e sts 0x0E45, r22 ; 0x800e45 15032: 70 93 46 0e sts 0x0E46, r23 ; 0x800e46 15036: 80 93 47 0e sts 0x0E47, r24 ; 0x800e47 1503a: 90 93 48 0e sts 0x0E48, r25 ; 0x800e48 } if(code_seen('Z')) 1503e: 8a e5 ldi r24, 0x5A ; 90 15040: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 15044: 88 23 and r24, r24 15046: 09 f4 brne .+2 ; 0x1504a 15048: c9 c2 rjmp .+1426 ; 0x155dc { cs.retract_zlift = code_value() ; 1504a: 0e 94 9d 60 call 0xc13a ; 0xc13a 1504e: 60 93 49 0e sts 0x0E49, r22 ; 0x800e49 15052: 70 93 4a 0e sts 0x0E4A, r23 ; 0x800e4a 15056: 80 93 4b 0e sts 0x0E4B, r24 ; 0x800e4b 1505a: 90 93 4c 0e sts 0x0E4C, r25 ; 0x800e4c 1505e: be c2 rjmp .+1404 ; 0x155dc } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15060: 8c 3d cpi r24, 0xDC ; 220 15062: 91 05 cpc r25, r1 15064: 11 f4 brne .+4 ; 0x1506a 15066: 0c 94 45 b4 jmp 0x1688a ; 0x1688a 1506a: 0c f0 brlt .+2 ; 0x1506e 1506c: 7d c0 rjmp .+250 ; 0x15168 1506e: 81 3d cpi r24, 0xD1 ; 209 15070: 91 05 cpc r25, r1 15072: 11 f4 brne .+4 ; 0x15078 15074: 0c 94 02 b4 jmp 0x16804 ; 0x16804 15078: 86 3d cpi r24, 0xD6 ; 214 1507a: 91 05 cpc r25, r1 1507c: 09 f0 breq .+2 ; 0x15080 1507e: 79 cc rjmp .-1806 ; 0x14972 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; 15080: 80 e5 ldi r24, 0x50 ; 80 15082: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 15086: 88 23 and r24, r24 15088: 11 f4 brne .+4 ; 0x1508e 1508a: 0c 94 31 b4 jmp 0x16862 ; 0x16862 1508e: 0e 94 9d 60 call 0xc13a ; 0xc13a 15092: 2b 01 movw r4, r22 15094: 3c 01 movw r6, r24 float s = code_seen('S') ? code_value() : cs.min_mm_per_arc_segment; 15096: 83 e5 ldi r24, 0x53 ; 83 15098: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 1509c: 88 23 and r24, r24 1509e: 11 f4 brne .+4 ; 0x150a4 150a0: 0c 94 3b b4 jmp 0x16876 ; 0x16876 150a4: 0e 94 9d 60 call 0xc13a ; 0xc13a 150a8: 4b 01 movw r8, r22 150aa: 5c 01 movw r10, r24 unsigned char n = code_seen('N') ? code_value() : cs.n_arc_correction; 150ac: 8e e4 ldi r24, 0x4E ; 78 150ae: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 150b2: d0 90 8a 0e lds r13, 0x0E8A ; 0x800e8a 150b6: 88 23 and r24, r24 150b8: 29 f0 breq .+10 ; 0x150c4 150ba: 0e 94 9d 60 call 0xc13a ; 0xc13a 150be: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 150c2: d6 2e mov r13, r22 unsigned short r = code_seen('R') ? code_value() : cs.min_arc_segments; 150c4: 82 e5 ldi r24, 0x52 ; 82 150c6: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 150ca: e0 90 8b 0e lds r14, 0x0E8B ; 0x800e8b 150ce: f0 90 8c 0e lds r15, 0x0E8C ; 0x800e8c 150d2: 88 23 and r24, r24 150d4: 29 f0 breq .+10 ; 0x150e0 150d6: 0e 94 9d 60 call 0xc13a ; 0xc13a 150da: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 150de: 7b 01 movw r14, r22 unsigned short f = code_seen('F') ? code_value() : cs.arc_segments_per_sec; 150e0: 86 e4 ldi r24, 0x46 ; 70 150e2: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 150e6: 00 91 8d 0e lds r16, 0x0E8D ; 0x800e8d 150ea: 10 91 8e 0e lds r17, 0x0E8E ; 0x800e8e 150ee: 88 23 and r24, r24 150f0: 29 f0 breq .+10 ; 0x150fc 150f2: 0e 94 9d 60 call 0xc13a ; 0xc13a 150f6: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 150fa: 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) 150fc: 20 e0 ldi r18, 0x00 ; 0 150fe: 30 e0 ldi r19, 0x00 ; 0 15100: a9 01 movw r20, r18 15102: c3 01 movw r24, r6 15104: b2 01 movw r22, r4 15106: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 1510a: 18 16 cp r1, r24 1510c: 0c f0 brlt .+2 ; 0x15110 1510e: 66 c2 rjmp .+1228 ; 0x155dc 15110: 20 e0 ldi r18, 0x00 ; 0 15112: 30 e0 ldi r19, 0x00 ; 0 15114: a9 01 movw r20, r18 15116: c5 01 movw r24, r10 15118: b4 01 movw r22, r8 1511a: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 1511e: 87 fd sbrc r24, 7 15120: 5d c2 rjmp .+1210 ; 0x155dc 15122: a5 01 movw r20, r10 15124: 94 01 movw r18, r8 15126: c3 01 movw r24, r6 15128: b2 01 movw r22, r4 1512a: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 1512e: 87 fd sbrc r24, 7 15130: 55 c2 rjmp .+1194 ; 0x155dc { // Should we display some error here? break; } cs.mm_per_arc_segment = p; 15132: 40 92 82 0e sts 0x0E82, r4 ; 0x800e82 15136: 50 92 83 0e sts 0x0E83, r5 ; 0x800e83 1513a: 60 92 84 0e sts 0x0E84, r6 ; 0x800e84 1513e: 70 92 85 0e sts 0x0E85, r7 ; 0x800e85 cs.min_mm_per_arc_segment = s; 15142: 80 92 86 0e sts 0x0E86, r8 ; 0x800e86 15146: 90 92 87 0e sts 0x0E87, r9 ; 0x800e87 1514a: a0 92 88 0e sts 0x0E88, r10 ; 0x800e88 1514e: b0 92 89 0e sts 0x0E89, r11 ; 0x800e89 cs.n_arc_correction = n; 15152: d0 92 8a 0e sts 0x0E8A, r13 ; 0x800e8a cs.min_arc_segments = r; 15156: f0 92 8c 0e sts 0x0E8C, r15 ; 0x800e8c 1515a: e0 92 8b 0e sts 0x0E8B, r14 ; 0x800e8b cs.arc_segments_per_sec = f; 1515e: 10 93 8e 0e sts 0x0E8E, r17 ; 0x800e8e 15162: 00 93 8d 0e sts 0x0E8D, r16 ; 0x800e8d 15166: 3a c2 rjmp .+1140 ; 0x155dc } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15168: 82 3e cpi r24, 0xE2 ; 226 1516a: 91 05 cpc r25, r1 1516c: 11 f4 brne .+4 ; 0x15172 1516e: 0c 94 96 b4 jmp 0x1692c ; 0x1692c 15172: 80 3f cpi r24, 0xF0 ; 240 15174: 91 05 cpc r25, r1 15176: 09 f4 brne .+2 ; 0x1517a 15178: 31 c2 rjmp .+1122 ; 0x155dc 1517a: 8d 3d cpi r24, 0xDD ; 221 1517c: 91 05 cpc r25, r1 1517e: 09 f0 breq .+2 ; 0x15182 15180: f8 cb rjmp .-2064 ; 0x14972 #### Parameters - `S` - Extrude factor override percentage (0..100 or higher), default 100% */ case 221: { if (code_seen('S')) 15182: 83 e5 ldi r24, 0x53 ; 83 15184: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 15188: 88 23 and r24, r24 1518a: 11 f4 brne .+4 ; 0x15190 1518c: 0c 94 84 b4 jmp 0x16908 ; 0x16908 { extrudemultiply = code_value_short(); 15190: 0e 94 75 5b call 0xb6ea ; 0xb6ea 15194: 90 93 bd 02 sts 0x02BD, r25 ; 0x8002bd 15198: 80 93 bc 02 sts 0x02BC, r24 ; 0x8002bc calculate_extruder_multipliers(); 1519c: 0e 94 b9 65 call 0xcb72 ; 0xcb72 151a0: 1d c2 rjmp .+1082 ; 0x155dc } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 151a2: 80 39 cpi r24, 0x90 ; 144 151a4: 51 e0 ldi r21, 0x01 ; 1 151a6: 95 07 cpc r25, r21 151a8: 11 f4 brne .+4 ; 0x151ae 151aa: 0c 94 b4 bb jmp 0x17768 ; 0x17768 151ae: 0c f0 brlt .+2 ; 0x151b2 151b0: a7 c0 rjmp .+334 ; 0x15300 151b2: 8f 32 cpi r24, 0x2F ; 47 151b4: b1 e0 ldi r27, 0x01 ; 1 151b6: 9b 07 cpc r25, r27 151b8: 11 f4 brne .+4 ; 0x151be 151ba: 0c 94 93 b5 jmp 0x16b26 ; 0x16b26 151be: c4 f4 brge .+48 ; 0x151f0 151c0: 8d 32 cpi r24, 0x2D ; 45 151c2: f1 e0 ldi r31, 0x01 ; 1 151c4: 9f 07 cpc r25, r31 151c6: 11 f4 brne .+4 ; 0x151cc 151c8: 0c 94 16 b5 jmp 0x16a2c ; 0x16a2c 151cc: 8e 32 cpi r24, 0x2E ; 46 151ce: 91 40 sbci r25, 0x01 ; 1 151d0: 09 f0 breq .+2 ; 0x151d4 151d2: cf cb rjmp .-2146 ; 0x14972 - `S` - Cold extrude minimum temperature */ case 302: { int temp = 0; if (code_seen('S')) temp=code_value_short(); 151d4: 83 e5 ldi r24, 0x53 ; 83 151d6: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 151da: 88 23 and r24, r24 151dc: 11 f4 brne .+4 ; 0x151e2 151de: 0c 94 8f b5 jmp 0x16b1e ; 0x16b1e 151e2: 0e 94 75 5b call 0xb6ea ; 0xb6ea } #ifdef PREVENT_DANGEROUS_EXTRUDE void set_extrude_min_temp(int temp) { extrude_min_temp = temp; 151e6: 90 93 6c 02 sts 0x026C, r25 ; 0x80026c 151ea: 80 93 6b 02 sts 0x026B, r24 ; 0x80026b 151ee: f6 c1 rjmp .+1004 ; 0x155dc } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 151f0: 86 33 cpi r24, 0x36 ; 54 151f2: 31 e0 ldi r19, 0x01 ; 1 151f4: 93 07 cpc r25, r19 151f6: 11 f4 brne .+4 ; 0x151fc 151f8: 0c 94 c6 b5 jmp 0x16b8c ; 0x16b8c 151fc: 8e 35 cpi r24, 0x5E ; 94 151fe: 41 e0 ldi r20, 0x01 ; 1 15200: 94 07 cpc r25, r20 15202: 11 f4 brne .+4 ; 0x15208 15204: 0c 94 bf c8 jmp 0x1917e ; 0x1917e 15208: 80 33 cpi r24, 0x30 ; 48 1520a: 91 40 sbci r25, 0x01 ; 1 1520c: 09 f0 breq .+2 ; 0x15210 1520e: b1 cb rjmp .-2206 ; 0x14972 - `I` - integral (Ki) - `D` - derivative (Kd) */ case 304: { if(code_seen('P')) cs.bedKp = code_value(); 15210: 80 e5 ldi r24, 0x50 ; 80 15212: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 15216: 88 23 and r24, r24 15218: 51 f0 breq .+20 ; 0x1522e 1521a: 0e 94 9d 60 call 0xc13a ; 0xc13a 1521e: 60 93 32 0e sts 0x0E32, r22 ; 0x800e32 15222: 70 93 33 0e sts 0x0E33, r23 ; 0x800e33 15226: 80 93 34 0e sts 0x0E34, r24 ; 0x800e34 1522a: 90 93 35 0e sts 0x0E35, r25 ; 0x800e35 if(code_seen('I')) cs.bedKi = scalePID_i(code_value()); 1522e: 89 e4 ldi r24, 0x49 ; 73 15230: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 15234: 88 23 and r24, r24 15236: 81 f0 breq .+32 ; 0x15258 15238: 0e 94 9d 60 call 0xc13a ; 0xc13a #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 1523c: 2c ea ldi r18, 0xAC ; 172 1523e: 35 ec ldi r19, 0xC5 ; 197 15240: 47 e2 ldi r20, 0x27 ; 39 15242: 5e e3 ldi r21, 0x3E ; 62 15244: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 15248: 60 93 36 0e sts 0x0E36, r22 ; 0x800e36 1524c: 70 93 37 0e sts 0x0E37, r23 ; 0x800e37 15250: 80 93 38 0e sts 0x0E38, r24 ; 0x800e38 15254: 90 93 39 0e sts 0x0E39, r25 ; 0x800e39 if(code_seen('D')) cs.bedKd = scalePID_d(code_value()); 15258: 84 e4 ldi r24, 0x44 ; 68 1525a: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 1525e: 88 23 and r24, r24 15260: 81 f0 breq .+32 ; 0x15282 15262: 0e 94 9d 60 call 0xc13a ; 0xc13a } float unscalePID_i(float i) { return i/PID_dT; 15266: 2c ea ldi r18, 0xAC ; 172 15268: 35 ec ldi r19, 0xC5 ; 197 1526a: 47 e2 ldi r20, 0x27 ; 39 1526c: 5e e3 ldi r21, 0x3E ; 62 1526e: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 15272: 60 93 3a 0e sts 0x0E3A, r22 ; 0x800e3a 15276: 70 93 3b 0e sts 0x0E3B, r23 ; 0x800e3b 1527a: 80 93 3c 0e sts 0x0E3C, r24 ; 0x800e3c 1527e: 90 93 3d 0e sts 0x0E3D, r25 ; 0x800e3d updatePID(); 15282: 0f 94 d3 3a call 0x275a6 ; 0x275a6 SERIAL_PROTOCOLRPGM(MSG_OK); 15286: 8b eb ldi r24, 0xBB ; 187 15288: 9d e6 ldi r25, 0x6D ; 109 1528a: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_PROTOCOLPGM(" p:"); 1528e: 87 e4 ldi r24, 0x47 ; 71 15290: 96 e8 ldi r25, 0x86 ; 134 15292: 0e 94 50 77 call 0xeea0 ; 0xeea0 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 15296: 60 91 32 0e lds r22, 0x0E32 ; 0x800e32 1529a: 70 91 33 0e lds r23, 0x0E33 ; 0x800e33 1529e: 80 91 34 0e lds r24, 0x0E34 ; 0x800e34 152a2: 90 91 35 0e lds r25, 0x0E35 ; 0x800e35 152a6: 42 e0 ldi r20, 0x02 ; 2 152a8: 0f 94 87 d5 call 0x3ab0e ; 0x3ab0e SERIAL_PROTOCOL(cs.bedKp); SERIAL_PROTOCOLPGM(" i:"); 152ac: 83 e4 ldi r24, 0x43 ; 67 152ae: 96 e8 ldi r25, 0x86 ; 134 152b0: 0e 94 50 77 call 0xeea0 ; 0xeea0 152b4: 2c ea ldi r18, 0xAC ; 172 152b6: 35 ec ldi r19, 0xC5 ; 197 152b8: 47 e2 ldi r20, 0x27 ; 39 152ba: 5e e3 ldi r21, 0x3E ; 62 152bc: 60 91 36 0e lds r22, 0x0E36 ; 0x800e36 152c0: 70 91 37 0e lds r23, 0x0E37 ; 0x800e37 152c4: 80 91 38 0e lds r24, 0x0E38 ; 0x800e38 152c8: 90 91 39 0e lds r25, 0x0E39 ; 0x800e39 152cc: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 152d0: 42 e0 ldi r20, 0x02 ; 2 152d2: 0f 94 87 d5 call 0x3ab0e ; 0x3ab0e SERIAL_PROTOCOL(unscalePID_i(cs.bedKi)); SERIAL_PROTOCOLPGM(" d:"); 152d6: 8f e3 ldi r24, 0x3F ; 63 152d8: 96 e8 ldi r25, 0x86 ; 134 152da: 0e 94 50 77 call 0xeea0 ; 0xeea0 #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 152de: 2c ea ldi r18, 0xAC ; 172 152e0: 35 ec ldi r19, 0xC5 ; 197 152e2: 47 e2 ldi r20, 0x27 ; 39 152e4: 5e e3 ldi r21, 0x3E ; 62 152e6: 60 91 3a 0e lds r22, 0x0E3A ; 0x800e3a 152ea: 70 91 3b 0e lds r23, 0x0E3B ; 0x800e3b 152ee: 80 91 3c 0e lds r24, 0x0E3C ; 0x800e3c 152f2: 90 91 3d 0e lds r25, 0x0E3D ; 0x800e3d 152f6: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> SERIAL_PROTOCOLLN(unscalePID_d(cs.bedKd)); 152fa: 0f 94 b4 74 call 0x2e968 ; 0x2e968 152fe: 6e c1 rjmp .+732 ; 0x155dc } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15300: 86 39 cpi r24, 0x96 ; 150 15302: a1 e0 ldi r26, 0x01 ; 1 15304: 9a 07 cpc r25, r26 15306: 11 f4 brne .+4 ; 0x1530c 15308: 0c 94 d6 bb jmp 0x177ac ; 0x177ac 1530c: 74 f4 brge .+28 ; 0x1532a 1530e: 83 39 cpi r24, 0x93 ; 147 15310: e1 e0 ldi r30, 0x01 ; 1 15312: 9e 07 cpc r25, r30 15314: 11 f4 brne .+4 ; 0x1531a 15316: 0c 94 b8 bb jmp 0x17770 ; 0x17770 1531a: 85 39 cpi r24, 0x95 ; 149 1531c: 91 40 sbci r25, 0x01 ; 1 1531e: 09 f0 breq .+2 ; 0x15322 15320: 28 cb rjmp .-2480 ; 0x14972 */ case 405: // M405 Enable Filament Sensor { fsensor.setEnabled(1); 15322: 81 e0 ldi r24, 0x01 ; 1 15324: 0e 94 cf 74 call 0xe99e ; 0xe99e 15328: 59 c1 rjmp .+690 ; 0x155dc } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1532a: 84 3f cpi r24, 0xF4 ; 244 1532c: 21 e0 ldi r18, 0x01 ; 1 1532e: 92 07 cpc r25, r18 15330: 11 f4 brne .+4 ; 0x15336 15332: 0c 94 db bb jmp 0x177b6 ; 0x177b6 15336: 14 f0 brlt .+4 ; 0x1533c 15338: 0c 94 df bb jmp 0x177be ; 0x177be 1533c: 84 3a cpi r24, 0xA4 ; 164 1533e: 91 40 sbci r25, 0x01 ; 1 15340: 09 f0 breq .+2 ; 0x15344 15342: 17 cb rjmp .-2514 ; 0x14972 M420 */ case 420: // M420 Mesh bed leveling status { gcode_G81_M420(); 15344: 0e 94 5b 7f call 0xfeb6 ; 0xfeb6 15348: 49 c1 rjmp .+658 ; 0x155dc } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1534a: 83 3c cpi r24, 0xC3 ; 195 1534c: 52 e0 ldi r21, 0x02 ; 2 1534e: 95 07 cpc r25, r21 15350: 11 f4 brne .+4 ; 0x15356 15352: 0c 94 43 ca jmp 0x19486 ; 0x19486 15356: 0c f0 brlt .+2 ; 0x1535a 15358: 91 c0 rjmp .+290 ; 0x1547c 1535a: 8a 35 cpi r24, 0x5A ; 90 1535c: b2 e0 ldi r27, 0x02 ; 2 1535e: 9b 07 cpc r25, r27 15360: 11 f4 brne .+4 ; 0x15366 15362: 0c 94 3a c3 jmp 0x18674 ; 0x18674 15366: 3c f5 brge .+78 ; 0x153b6 15368: 88 32 cpi r24, 0x28 ; 40 1536a: f2 e0 ldi r31, 0x02 ; 2 1536c: 9f 07 cpc r25, r31 1536e: 11 f4 brne .+4 ; 0x15374 15370: 0c 94 fa be jmp 0x17df4 ; 0x17df4 15374: ac f4 brge .+42 ; 0x153a0 15376: 87 3f cpi r24, 0xF7 ; 247 15378: 31 e0 ldi r19, 0x01 ; 1 1537a: 93 07 cpc r25, r19 1537c: 11 f4 brne .+4 ; 0x15382 1537e: 0c 94 e7 bb jmp 0x177ce ; 0x177ce 15382: 8d 3f cpi r24, 0xFD ; 253 15384: 91 40 sbci r25, 0x01 ; 1 15386: 09 f0 breq .+2 ; 0x1538a 15388: f4 ca rjmp .-2584 ; 0x14972 M509 */ case 509: { lang_reset(); 1538a: 0e 94 2c 71 call 0xe258 ; 0xe258 SERIAL_ECHO_START; 1538e: 82 ec ldi r24, 0xC2 ; 194 15390: 9b ea ldi r25, 0xAB ; 171 15392: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_PROTOCOLPGM("LANG SEL FORCED"); 15396: 8f e2 ldi r24, 0x2F ; 47 15398: 96 e8 ldi r25, 0x86 ; 134 1539a: 0e 94 50 77 call 0xeea0 ; 0xeea0 1539e: 1e c1 rjmp .+572 ; 0x155dc } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 153a0: 88 35 cpi r24, 0x58 ; 88 153a2: 52 e0 ldi r21, 0x02 ; 2 153a4: 95 07 cpc r25, r21 153a6: 11 f4 brne .+4 ; 0x153ac 153a8: 0c 94 2f bf jmp 0x17e5e ; 0x17e5e 153ac: 89 35 cpi r24, 0x59 ; 89 153ae: 92 40 sbci r25, 0x02 ; 2 153b0: 09 f4 brne .+2 ; 0x153b4 153b2: 4c cb rjmp .-2408 ; 0x14a4c 153b4: de ca rjmp .-2628 ; 0x14972 153b6: 8e 3b cpi r24, 0xBE ; 190 153b8: b2 e0 ldi r27, 0x02 ; 2 153ba: 9b 07 cpc r25, r27 153bc: 11 f4 brne .+4 ; 0x153c2 153be: 0c 94 03 ca jmp 0x19406 ; 0x19406 153c2: 0c f0 brlt .+2 ; 0x153c6 153c4: 49 c0 rjmp .+146 ; 0x15458 153c6: 8b 35 cpi r24, 0x5B ; 91 153c8: f2 e0 ldi r31, 0x02 ; 2 153ca: 9f 07 cpc r25, r31 153cc: 11 f4 brne .+4 ; 0x153d2 153ce: 0c 94 42 c3 jmp 0x18684 ; 0x18684 153d2: 8d 3b cpi r24, 0xBD ; 189 153d4: 92 40 sbci r25, 0x02 ; 2 153d6: 09 f0 breq .+2 ; 0x153da 153d8: cc ca rjmp .-2664 ; 0x14972 case 701: { uint8_t mmuSlotIndex = 0xffU; float fastLoadLength = FILAMENTCHANGE_FIRSTFEED; // Only used without MMU float z_target = 0; if( MMU2::mmu2.Enabled() ) 153da: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 153de: 81 30 cpi r24, 0x01 ; 1 153e0: 11 f4 brne .+4 ; 0x153e6 153e2: 0c 94 a4 c9 jmp 0x19348 ; 0x19348 - `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; 153e6: 1f ef ldi r17, 0xFF ; 255 if( code_seen('P') || code_seen('T') ) { mmuSlotIndex = code_value_uint8(); } } if (code_seen('L')) fastLoadLength = code_value(); 153e8: 8c e4 ldi r24, 0x4C ; 76 153ea: 0e 94 d6 5b call 0xb7ac ; 0xb7ac - `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 153ee: c1 2c mov r12, r1 153f0: d1 2c mov r13, r1 153f2: 6c e8 ldi r22, 0x8C ; 140 153f4: e6 2e mov r14, r22 153f6: 62 e4 ldi r22, 0x42 ; 66 153f8: f6 2e mov r15, r22 if( code_seen('P') || code_seen('T') ) { mmuSlotIndex = code_value_uint8(); } } if (code_seen('L')) fastLoadLength = code_value(); 153fa: 88 23 and r24, r24 153fc: 21 f0 breq .+8 ; 0x15406 153fe: 0e 94 9d 60 call 0xc13a ; 0xc13a 15402: 6b 01 movw r12, r22 15404: 7c 01 movw r14, r24 // Z lift. For safety only allow positive values if (code_seen('Z')) z_target = fabs(code_value()); 15406: 8a e5 ldi r24, 0x5A ; 90 15408: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 1540c: 88 23 and r24, r24 1540e: 11 f4 brne .+4 ; 0x15414 15410: 0c 94 b5 c9 jmp 0x1936a ; 0x1936a 15414: 0e 94 9d 60 call 0xc13a ; 0xc13a 15418: 9f 77 andi r25, 0x7F ; 127 // Raise the Z axis float delta = raise_z(z_target); 1541a: 0e 94 e1 6d call 0xdbc2 ; 0xdbc2 1541e: 4b 01 movw r8, r22 15420: 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 15422: 8a e5 ldi r24, 0x5A ; 90 15424: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 15428: 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; 1542a: 0f 94 ae 86 call 0x30d5c ; 0x30d5c prusa_statistics(22); if (MMU2::mmu2.Enabled()) { 1542e: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 15432: 81 30 cpi r24, 0x01 ; 1 15434: 11 f0 breq .+4 ; 0x1543a 15436: 0c 94 ba c9 jmp 0x19374 ; 0x19374 if (mmuSlotIndex < MMU_FILAMENT_COUNT) { 1543a: 15 30 cpi r17, 0x05 ; 5 1543c: 18 f4 brcc .+6 ; 0x15444 MMU2::mmu2.load_filament_to_nozzle(mmuSlotIndex); 1543e: 81 2f mov r24, r17 15440: 0f 94 b0 0e call 0x21d60 ; 0x21d60 lcd_update(2); lcd_setstatuspgm(MSG_WELCOME); custom_message_type = CustomMsg::Status; } eFilamentAction = FilamentAction::None; 15444: 10 92 a7 03 sts 0x03A7, r1 ; 0x8003a7 #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) // SERIAL_ECHOLNPGM("FSBlockRunout"); } FSensorBlockRunout::~FSensorBlockRunout() { fsensor.settings_init(); // restore filament runout state. 15448: 0f 94 f2 7a call 0x2f5e4 ; 0x2f5e4 // 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); 1544c: c5 01 movw r24, r10 1544e: b4 01 movw r22, r8 15450: 90 58 subi r25, 0x80 ; 128 15452: 0e 94 e1 6d call 0xdbc2 ; 0xdbc2 15456: c2 c0 rjmp .+388 ; 0x155dc } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15458: 81 3c cpi r24, 0xC1 ; 193 1545a: 32 e0 ldi r19, 0x02 ; 2 1545c: 93 07 cpc r25, r19 1545e: 11 f4 brne .+4 ; 0x15464 15460: 0c 94 37 ca jmp 0x1946e ; 0x1946e 15464: 14 f0 brlt .+4 ; 0x1546a 15466: 0c 94 3d ca jmp 0x1947a ; 0x1947a 1546a: 80 3c cpi r24, 0xC0 ; 192 1546c: 92 40 sbci r25, 0x02 ; 2 1546e: 09 f0 breq .+2 ; 0x15472 15470: 80 ca rjmp .-2816 ; 0x14972 #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 704: { gcodes_M704_M705_M706(704); 15472: 80 ec ldi r24, 0xC0 ; 192 15474: 92 e0 ldi r25, 0x02 ; 2 15476: 0e 94 4f 60 call 0xc09e ; 0xc09e 1547a: b0 c0 rjmp .+352 ; 0x155dc } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1547c: 84 38 cpi r24, 0x84 ; 132 1547e: a3 e0 ldi r26, 0x03 ; 3 15480: 9a 07 cpc r25, r26 15482: 11 f4 brne .+4 ; 0x15488 15484: 0c 94 ec c6 jmp 0x18dd8 ; 0x18dd8 15488: 0c f0 brlt .+2 ; 0x1548c 1548a: 97 c0 rjmp .+302 ; 0x155ba 1548c: 82 35 cpi r24, 0x52 ; 82 1548e: e3 e0 ldi r30, 0x03 ; 3 15490: 9e 07 cpc r25, r30 15492: 11 f4 brne .+4 ; 0x15498 15494: 0c 94 48 c3 jmp 0x18690 ; 0x18690 15498: 94 f5 brge .+100 ; 0x154fe 1549a: 84 3c cpi r24, 0xC4 ; 196 1549c: 22 e0 ldi r18, 0x02 ; 2 1549e: 92 07 cpc r25, r18 154a0: 11 f4 brne .+4 ; 0x154a6 154a2: 0c 94 60 ca jmp 0x194c0 ; 0x194c0 154a6: 85 3c cpi r24, 0xC5 ; 197 154a8: 92 40 sbci r25, 0x02 ; 2 154aa: 09 f0 breq .+2 ; 0x154ae 154ac: 62 ca rjmp .-2876 ; 0x14972 M709 - Serial message if en- or disabled */ case 709: { if (code_seen('S')) 154ae: 83 e5 ldi r24, 0x53 ; 83 154b0: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 154b4: 88 23 and r24, r24 154b6: 51 f0 breq .+20 ; 0x154cc { switch (code_value_uint8()) 154b8: 0e 94 68 5b call 0xb6d0 ; 0xb6d0 154bc: 88 23 and r24, r24 154be: 11 f4 brne .+4 ; 0x154c4 154c0: 0c 94 8c ca jmp 0x19518 ; 0x19518 154c4: 81 30 cpi r24, 0x01 ; 1 154c6: 11 f4 brne .+4 ; 0x154cc 154c8: 0c 94 99 ca jmp 0x19532 ; 0x19532 break; default: break; } } if (MMU2::mmu2.Enabled() && code_seen('X')) 154cc: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 154d0: 81 30 cpi r24, 0x01 ; 1 154d2: 91 f4 brne .+36 ; 0x154f8 154d4: 88 e5 ldi r24, 0x58 ; 88 154d6: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 154da: 88 23 and r24, r24 154dc: 69 f0 breq .+26 ; 0x154f8 { switch (code_value_uint8()) 154de: 0e 94 68 5b call 0xb6d0 ; 0xb6d0 154e2: 81 30 cpi r24, 0x01 ; 1 154e4: 11 f4 brne .+4 ; 0x154ea 154e6: 0c 94 a7 ca jmp 0x1954e ; 0x1954e 154ea: 10 f4 brcc .+4 ; 0x154f0 154ec: 0c 94 a2 ca jmp 0x19544 ; 0x19544 154f0: 8a 32 cpi r24, 0x2A ; 42 154f2: 11 f4 brne .+4 ; 0x154f8 154f4: 0c 94 ab ca jmp 0x19556 ; 0x19556 break; default: break; } } MMU2::mmu2.Status(); 154f8: 0f 94 e3 74 call 0x2e9c6 ; 0x2e9c6 154fc: 6f c0 rjmp .+222 ; 0x155dc } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 154fe: 8d 35 cpi r24, 0x5D ; 93 15500: 43 e0 ldi r20, 0x03 ; 3 15502: 94 07 cpc r25, r20 15504: 11 f4 brne .+4 ; 0x1550a 15506: 0c 94 be c4 jmp 0x1897c ; 0x1897c 1550a: 8e 35 cpi r24, 0x5E ; 94 1550c: 53 e0 ldi r21, 0x03 ; 3 1550e: 95 07 cpc r25, r21 15510: 11 f4 brne .+4 ; 0x15516 15512: 0c 94 56 c5 jmp 0x18aac ; 0x18aac 15516: 8c 35 cpi r24, 0x5C ; 92 15518: 93 40 sbci r25, 0x03 ; 3 1551a: 09 f0 breq .+2 ; 0x1551e 1551c: 2a ca rjmp .-2988 ; 0x14972 */ case 860: { int set_target_pinda = 0; if (code_seen('S')) { 1551e: 83 e5 ldi r24, 0x53 ; 83 15520: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 15524: 88 23 and r24, r24 15526: 09 f4 brne .+2 ; 0x1552a 15528: 59 c0 rjmp .+178 ; 0x155dc set_target_pinda = code_value_short(); 1552a: 0e 94 75 5b call 0xb6ea ; 0xb6ea 1552e: 8c 01 movw r16, r24 } else { break; } LCD_MESSAGERPGM(_T(MSG_PLEASE_WAIT)); 15530: 8a ee ldi r24, 0xEA ; 234 15532: 99 e3 ldi r25, 0x39 ; 57 15534: 0e 94 ac 72 call 0xe558 ; 0xe558 15538: 0e 94 5d f1 call 0x1e2ba ; 0x1e2ba SERIAL_PROTOCOLPGM("Wait for PINDA target temperature:"); 1553c: 88 ea ldi r24, 0xA8 ; 168 1553e: 95 e8 ldi r25, 0x85 ; 133 15540: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_PROTOCOLLN(set_target_pinda); 15544: c8 01 movw r24, r16 15546: 0f 94 f5 74 call 0x2e9ea ; 0x2e9ea codenum = _millis(); 1554a: 0f 94 4c 29 call 0x25298 ; 0x25298 1554e: 4b 01 movw r8, r22 15550: 5c 01 movw r10, r24 cancel_heatup = false; 15552: 10 92 b5 0d sts 0x0DB5, r1 ; 0x800db5 <_ZL13cancel_heatup.lto_priv.408> bool is_pinda_cooling = false; if (!(CHECK_ALL_HEATERS)) is_pinda_cooling = true; 15556: 80 91 b6 0d lds r24, 0x0DB6 ; 0x800db6 1555a: 90 91 b7 0d lds r25, 0x0DB7 ; 0x800db7 1555e: 89 2b or r24, r25 15560: 41 f4 brne .+16 ; 0x15572 15562: ff 24 eor r15, r15 15564: f3 94 inc r15 15566: 80 91 72 06 lds r24, 0x0672 ; 0x800672 1556a: 90 91 73 06 lds r25, 0x0673 ; 0x800673 1556e: 89 2b or r24, r25 15570: 09 f0 breq .+2 ; 0x15574 SERIAL_PROTOCOLLN(set_target_pinda); codenum = _millis(); cancel_heatup = false; bool is_pinda_cooling = false; 15572: 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)) ) { 15574: 28 01 movw r4, r16 15576: 01 2e mov r0, r17 15578: 00 0c add r0, r0 1557a: 66 08 sbc r6, r6 1557c: 77 08 sbc r7, r7 1557e: f1 10 cpse r15, r1 15580: 0c 94 7e c4 jmp 0x188fc ; 0x188fc 15584: 80 91 b5 0d lds r24, 0x0DB5 ; 0x800db5 <_ZL13cancel_heatup.lto_priv.408> 15588: 81 11 cpse r24, r1 1558a: 12 c0 rjmp .+36 ; 0x155b0 1558c: c3 01 movw r24, r6 1558e: b2 01 movw r22, r4 15590: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 15594: 20 91 99 03 lds r18, 0x0399 ; 0x800399 15598: 30 91 9a 03 lds r19, 0x039A ; 0x80039a 1559c: 40 91 9b 03 lds r20, 0x039B ; 0x80039b 155a0: 50 91 9c 03 lds r21, 0x039C ; 0x80039c 155a4: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 155a8: 18 16 cp r1, r24 155aa: 14 f4 brge .+4 ; 0x155b0 155ac: 0c 94 90 c4 jmp 0x18920 ; 0x18920 } manage_heater(); manage_inactivity(); lcd_update(0); } LCD_MESSAGERPGM(MSG_OK); 155b0: 8b eb ldi r24, 0xBB ; 187 155b2: 9d e6 ldi r25, 0x6D ; 109 155b4: 0e 94 5d f1 call 0x1e2ba ; 0x1e2ba 155b8: 11 c0 rjmp .+34 ; 0x155dc } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 155ba: 81 39 cpi r24, 0x91 ; 145 155bc: b3 e0 ldi r27, 0x03 ; 3 155be: 9b 07 cpc r25, r27 155c0: 11 f4 brne .+4 ; 0x155c6 155c2: 0c 94 1f c8 jmp 0x1903e ; 0x1903e 155c6: 84 f4 brge .+32 ; 0x155e8 155c8: 8b 38 cpi r24, 0x8B ; 139 155ca: f3 e0 ldi r31, 0x03 ; 3 155cc: 9f 07 cpc r25, r31 155ce: 11 f4 brne .+4 ; 0x155d4 155d0: 0c 94 9b c7 jmp 0x18f36 ; 0x18f36 155d4: 8c 38 cpi r24, 0x8C ; 140 155d6: 93 40 sbci r25, 0x03 ; 3 155d8: 09 f0 breq .+2 ; 0x155dc 155da: cb c9 rjmp .-3178 ; 0x14972 */ 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; 155dc: 10 92 ab 0d sts 0x0DAB, r1 ; 0x800dab <_ZL17mcode_in_progress.lto_priv.530+0x1> 155e0: 10 92 aa 0d sts 0x0DAA, r1 ; 0x800daa <_ZL17mcode_in_progress.lto_priv.530> 155e4: 0c 94 39 96 jmp 0x12c72 ; 0x12c72 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 155e8: 84 39 cpi r24, 0x94 ; 148 155ea: 33 e0 ldi r19, 0x03 ; 3 155ec: 93 07 cpc r25, r19 155ee: 14 f4 brge .+4 ; 0x155f4 155f0: 0c 94 6e c8 jmp 0x190dc ; 0x190dc 155f4: 80 3a cpi r24, 0xA0 ; 160 155f6: 93 40 sbci r25, 0x03 ; 3 155f8: 09 f0 breq .+2 ; 0x155fc 155fa: bb c9 rjmp .-3210 ; 0x14972 M928 [filename] */ case 928: card.openLogFile(strchr_pointer+5); 155fc: 80 91 95 03 lds r24, 0x0395 ; 0x800395 15600: 90 91 96 03 lds r25, 0x0396 ; 0x800396 } } void CardReader::openLogFile(const char* name) { logging = true; 15604: 21 e0 ldi r18, 0x01 ; 1 15606: 20 93 8f 14 sts 0x148F, r18 ; 0x80148f openFileWrite(name); 1560a: 05 96 adiw r24, 0x05 ; 5 1560c: 0f 94 66 85 call 0x30acc ; 0x30acc 15610: e5 cf rjmp .-54 ; 0x155dc - `string` - Must for M1 and optional for M0 message to display on the LCD */ case 0: case 1: { const char *src = strchr_pointer + 2; 15612: 00 91 95 03 lds r16, 0x0395 ; 0x800395 15616: 10 91 96 03 lds r17, 0x0396 ; 0x800396 1561a: 0e 5f subi r16, 0xFE ; 254 1561c: 1f 4f sbci r17, 0xFF ; 255 codenum = 0; if (code_seen('P')) codenum = code_value_long(); // milliseconds to wait 1561e: 80 e5 ldi r24, 0x50 ; 80 15620: 0e 94 d6 5b call 0xb7ac ; 0xb7ac */ case 0: case 1: { const char *src = strchr_pointer + 2; codenum = 0; 15624: c1 2c mov r12, r1 15626: d1 2c mov r13, r1 15628: 76 01 movw r14, r12 if (code_seen('P')) codenum = code_value_long(); // milliseconds to wait 1562a: 88 23 and r24, r24 1562c: 21 f0 breq .+8 ; 0x15636 1562e: 0e 94 82 5b call 0xb704 ; 0xb704 15632: 6b 01 movw r12, r22 15634: 7c 01 movw r14, r24 if (code_seen('S')) codenum = code_value_long() * 1000; // seconds to wait 15636: 83 e5 ldi r24, 0x53 ; 83 15638: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 1563c: 88 23 and r24, r24 1563e: 51 f0 breq .+20 ; 0x15654 15640: 0e 94 82 5b call 0xb704 ; 0xb704 15644: 9b 01 movw r18, r22 15646: ac 01 movw r20, r24 15648: a8 ee ldi r26, 0xE8 ; 232 1564a: b3 e0 ldi r27, 0x03 ; 3 1564c: 0f 94 b1 dc call 0x3b962 ; 0x3b962 <__muluhisi3> 15650: 6b 01 movw r12, r22 15652: 7c 01 movw r14, r24 15654: c8 01 movw r24, r16 15656: 0f 5f subi r16, 0xFF ; 255 15658: 1f 4f sbci r17, 0xFF ; 255 bool expiration_time_set = bool(codenum); while (*src == ' ') ++src; 1565a: dc 01 movw r26, r24 1565c: 4c 91 ld r20, X 1565e: 40 32 cpi r20, 0x20 ; 32 15660: c9 f3 breq .-14 ; 0x15654 custom_message_type = CustomMsg::M0Wait; 15662: 26 e0 ldi r18, 0x06 ; 6 15664: 20 93 c4 06 sts 0x06C4, r18 ; 0x8006c4 if (!expiration_time_set && *src != '\0') { 15668: c1 14 cp r12, r1 1566a: d1 04 cpc r13, r1 1566c: e1 04 cpc r14, r1 1566e: f1 04 cpc r15, r1 15670: a1 f5 brne .+104 ; 0x156da 15672: 2c 91 ld r18, X 15674: 22 23 and r18, r18 15676: 89 f1 breq .+98 ; 0x156da lcd_setstatus(src); 15678: 0e 94 89 f4 call 0x1e912 ; 0x1e912 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(); 1567c: 0f 94 e8 42 call 0x285d0 ; 0x285d0 menu_set_block(MENU_BLOCK_STATUS_SCREEN_M0); 15680: 80 91 d6 03 lds r24, 0x03D6 ; 0x8003d6 15684: 84 60 ori r24, 0x04 ; 4 15686: 80 93 d6 03 sts 0x03D6, r24 ; 0x8003d6 previous_millis_cmd.start(); 1568a: 86 e8 ldi r24, 0x86 ; 134 1568c: 93 e0 ldi r25, 0x03 ; 3 1568e: 0f 94 ef 2b call 0x257de ; 0x257de ::start()> if (expiration_time_set) { 15692: c1 14 cp r12, r1 15694: d1 04 cpc r13, r1 15696: e1 04 cpc r14, r1 15698: f1 04 cpc r15, r1 1569a: 79 f1 breq .+94 ; 0x156fa codenum += _millis(); // keep track of when we started waiting 1569c: 0f 94 4c 29 call 0x25298 ; 0x25298 156a0: c6 0e add r12, r22 156a2: d7 1e adc r13, r23 156a4: e8 1e adc r14, r24 156a6: f9 1e adc r15, r25 KEEPALIVE_STATE(PAUSED_FOR_USER); 156a8: 84 e0 ldi r24, 0x04 ; 4 156aa: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be while(_millis() < codenum && !lcd_clicked()) { 156ae: 0f 94 4c 29 call 0x25298 ; 0x25298 156b2: 6c 15 cp r22, r12 156b4: 7d 05 cpc r23, r13 156b6: 8e 05 cpc r24, r14 156b8: 9f 05 cpc r25, r15 156ba: b0 f0 brcs .+44 ; 0x156e8 delay_keep_alive(0); } KEEPALIVE_STATE(IN_HANDLER); 156bc: 82 e0 ldi r24, 0x02 ; 2 156be: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be } else { marlin_wait_for_click(); } menu_unset_block(MENU_BLOCK_STATUS_SCREEN_M0); 156c2: 80 91 d6 03 lds r24, 0x03D6 ; 0x8003d6 156c6: 8b 7f andi r24, 0xFB ; 251 156c8: 80 93 d6 03 sts 0x03D6, r24 ; 0x8003d6 if (IS_SD_PRINTING) 156cc: 80 91 90 14 lds r24, 0x1490 ; 0x801490 156d0: 88 23 and r24, r24 156d2: 31 f1 breq .+76 ; 0x15720 custom_message_type = CustomMsg::Status; 156d4: 10 92 c4 06 sts 0x06C4, r1 ; 0x8006c4 156d8: 81 cf rjmp .-254 ; 0x155dc } 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)); 156da: 83 e0 ldi r24, 0x03 ; 3 156dc: 9a e3 ldi r25, 0x3A ; 58 156de: 0e 94 ac 72 call 0xe558 ; 0xe558 156e2: 0e 94 5d f1 call 0x1e2ba ; 0x1e2ba 156e6: ca cf rjmp .-108 ; 0x1567c 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()) { 156e8: 0e 94 fd 70 call 0xe1fa ; 0xe1fa 156ec: 81 11 cpse r24, r1 156ee: e6 cf rjmp .-52 ; 0x156bc delay_keep_alive(0); 156f0: 90 e0 ldi r25, 0x00 ; 0 156f2: 80 e0 ldi r24, 0x00 ; 0 156f4: 0e 94 e4 8c call 0x119c8 ; 0x119c8 156f8: da cf rjmp .-76 ; 0x156ae //! @brief Wait for click //! //! Set void marlin_wait_for_click() { int8_t busy_state_backup = busy_state; 156fa: 10 91 be 02 lds r17, 0x02BE ; 0x8002be KEEPALIVE_STATE(PAUSED_FOR_USER); 156fe: 84 e0 ldi r24, 0x04 ; 4 15700: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be lcd_consume_click(); 15704: 0e 94 f8 70 call 0xe1f0 ; 0xe1f0 while(!lcd_clicked()) 15708: 0e 94 fd 70 call 0xe1fa ; 0xe1fa 1570c: 81 11 cpse r24, r1 1570e: 05 c0 rjmp .+10 ; 0x1571a { delay_keep_alive(0); 15710: 90 e0 ldi r25, 0x00 ; 0 15712: 80 e0 ldi r24, 0x00 ; 0 15714: 0e 94 e4 8c call 0x119c8 ; 0x119c8 15718: f7 cf rjmp .-18 ; 0x15708 } KEEPALIVE_STATE(busy_state_backup); 1571a: 10 93 be 02 sts 0x02BE, r17 ; 0x8002be 1571e: d1 cf rjmp .-94 ; 0x156c2 } menu_unset_block(MENU_BLOCK_STATUS_SCREEN_M0); if (IS_SD_PRINTING) custom_message_type = CustomMsg::Status; else LCD_MESSAGERPGM(MSG_WELCOME); 15720: 83 e7 ldi r24, 0x73 ; 115 15722: 90 e7 ldi r25, 0x70 ; 112 15724: 0e 94 5d f1 call 0x1e2ba ; 0x1e2ba 15728: 59 cf rjmp .-334 ; 0x155dc /*! ### M17 - Enable all axes M17: Enable/Power all stepper motors */ case 17: LCD_MESSAGERPGM(_T(MSG_NO_MOVE)); 1572a: 88 ef ldi r24, 0xF8 ; 248 1572c: 99 e3 ldi r25, 0x39 ; 57 1572e: 0e 94 ac 72 call 0xe558 ; 0xe558 15732: 0e 94 5d f1 call 0x1e2ba ; 0x1e2ba enable_x(); 15736: 17 98 cbi 0x02, 7 ; 2 enable_y(); 15738: 16 98 cbi 0x02, 6 ; 2 enable_z(); 1573a: 15 98 cbi 0x02, 5 ; 2 enable_e0(); 1573c: 14 98 cbi 0x02, 4 ; 2 1573e: 4e cf rjmp .-356 ; 0x155dc /*! ### M21 - Init SD card M21: Initialize SD card */ case 21: card.mount(); 15740: 81 e0 ldi r24, 0x01 ; 1 15742: 0f 94 c2 80 call 0x30184 ; 0x30184 15746: 4a cf rjmp .-364 ; 0x155dc presort_flag = true; #endif } void CardReader::release() { sdprinting = false; 15748: 10 92 90 14 sts 0x1490, r1 ; 0x801490 mounted = false; 1574c: 10 92 91 14 sts 0x1491, r1 ; 0x801491 SERIAL_ECHO_START; 15750: 82 ec ldi r24, 0xC2 ; 194 15752: 9b ea ldi r25, 0xAB ; 171 15754: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED 15758: 88 e9 ldi r24, 0x98 ; 152 1575a: 9b e6 ldi r25, 0x6B ; 107 1575c: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 15760: 3d cf rjmp .-390 ; 0x155dc /*! ### M24 - Start SD print M24: Start/resume SD print */ case 24: if (printingIsPaused()) 15762: 0e 94 85 67 call 0xcf0a ; 0xcf0a 15766: 88 23 and r24, r24 15768: 19 f0 breq .+6 ; 0x15770 lcd_resume_print(); 1576a: 0e 94 17 f8 call 0x1f02e ; 0x1f02e 1576e: 36 cf rjmp .-404 ; 0x155dc else { if (!filament_presence_check()) { 15770: 0e 94 02 f5 call 0x1ea04 ; 0x1ea04 15774: 88 23 and r24, r24 15776: 09 f4 brne .+2 ; 0x1577a 15778: 31 cf rjmp .-414 ; 0x155dc 1577a: 80 91 23 17 lds r24, 0x1723 ; 0x801723 1577e: 88 23 and r24, r24 15780: 61 f0 breq .+24 ; 0x1579a // Print was aborted break; } if (!card.get_sdpos()) 15782: 80 91 a4 17 lds r24, 0x17A4 ; 0x8017a4 15786: 90 91 a5 17 lds r25, 0x17A5 ; 0x8017a5 1578a: a0 91 a6 17 lds r26, 0x17A6 ; 0x8017a6 1578e: b0 91 a7 17 lds r27, 0x17A7 ; 0x8017a7 15792: 89 2b or r24, r25 15794: 8a 2b or r24, r26 15796: 8b 2b or r24, r27 15798: 69 f4 brne .+26 ; 0x157b4 { // A new print has started from scratch, reset stats failstats_reset_print(); 1579a: 0e 94 24 5c call 0xb848 ; 0xb848 sdpos_atomic = 0; 1579e: 10 92 82 03 sts 0x0382, r1 ; 0x800382 157a2: 10 92 83 03 sts 0x0383, r1 ; 0x800383 157a6: 10 92 84 03 sts 0x0384, r1 ; 0x800384 157aa: 10 92 85 03 sts 0x0385, r1 ; 0x800385 157ae: 80 e0 ldi r24, 0x00 ; 0 157b0: 0e 94 17 82 call 0x1042e ; 0x1042e } void CardReader::startFileprint() { if(mounted) 157b4: 80 91 91 14 lds r24, 0x1491 ; 0x801491 157b8: 88 23 and r24, r24 157ba: 31 f0 breq .+12 ; 0x157c8 { sdprinting = true; 157bc: 81 e0 ldi r24, 0x01 ; 1 157be: 80 93 90 14 sts 0x1490, r24 ; 0x801490 157c2: 85 e0 ldi r24, 0x05 ; 5 157c4: 80 93 b8 0d sts 0x0DB8, r24 ; 0x800db8 <_ZL13printer_state.lto_priv.401> la10c_reset(); #endif } card.startFileprint(); print_job_timer.start(); 157c8: 0f 94 8d 42 call 0x2851a ; 0x2851a if (MMU2::mmu2.Enabled()) 157cc: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 157d0: 81 30 cpi r24, 0x01 ; 1 157d2: 09 f0 breq .+2 ; 0x157d6 157d4: 03 cf rjmp .-506 ; 0x155dc { if (MMU2::mmu2.FindaDetectsFilament() && !fsensor.getFilamentPresent()) 157d6: 80 91 90 13 lds r24, 0x1390 ; 0x801390 157da: 88 23 and r24, r24 157dc: 09 f4 brne .+2 ; 0x157e0 157de: fe ce rjmp .-516 ; 0x155dc 157e0: 80 91 b7 17 lds r24, 0x17B7 ; 0x8017b7 157e4: 81 11 cpse r24, r1 157e6: fa ce rjmp .-524 ; 0x155dc { // Filament only half way into the PTFE. Unload the filament. MMU2::mmu2.unload(); 157e8: 0f 94 3d ad call 0x35a7a ; 0x35a7a 157ec: f7 ce rjmp .-530 ; 0x155dc #### Parameters - `S` - Index in bytes */ case 26: if(card.mounted && code_seen('S')) { 157ee: 80 91 91 14 lds r24, 0x1491 ; 0x801491 157f2: 88 23 and r24, r24 157f4: 09 f4 brne .+2 ; 0x157f8 157f6: f2 ce rjmp .-540 ; 0x155dc 157f8: 83 e5 ldi r24, 0x53 ; 83 157fa: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 157fe: 88 23 and r24, r24 15800: 09 f4 brne .+2 ; 0x15804 15802: ec ce rjmp .-552 ; 0x155dc long index = code_value_long(); 15804: 0e 94 82 5b call 0xb704 ; 0xb704 15808: 6b 01 movw r12, r22 1580a: 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);}; 1580c: c0 92 a4 17 sts 0x17A4, r12 ; 0x8017a4 15810: d0 92 a5 17 sts 0x17A5, r13 ; 0x8017a5 15814: e0 92 a6 17 sts 0x17A6, r14 ; 0x8017a6 15818: f0 92 a7 17 sts 0x17A7, r15 ; 0x8017a7 1581c: 0f 94 9c 75 call 0x2eb38 ; 0x2eb38 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; 15820: c0 92 82 03 sts 0x0382, r12 ; 0x800382 15824: d0 92 83 03 sts 0x0383, r13 ; 0x800383 15828: e0 92 84 03 sts 0x0384, r14 ; 0x800384 1582c: f0 92 85 03 sts 0x0385, r15 ; 0x800385 15830: d5 ce rjmp .-598 ; 0x155dc #### Parameters - `P` - Show full SFN path instead of LFN only. */ case 27: card.getStatus(code_seen('P')); 15832: 80 e5 ldi r24, 0x50 ; 80 15834: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 15838: 18 2f mov r17, r24 return filesize; } void CardReader::getStatus(bool arg_P) { if (printingIsPaused()) 1583a: 0e 94 85 67 call 0xcf0a ; 0xcf0a 1583e: 88 23 and r24, r24 15840: 91 f0 breq .+36 ; 0x15866 { if (saved_printing && (saved_printing_type == PowerPanic::PRINT_TYPE_SD)) 15842: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 15846: 88 23 and r24, r24 15848: 49 f0 breq .+18 ; 0x1585c 1584a: 80 91 6a 02 lds r24, 0x026A ; 0x80026a 1584e: 81 11 cpse r24, r1 15850: 05 c0 rjmp .+10 ; 0x1585c SERIAL_PROTOCOLLNPGM("SD print paused"); 15852: 8e ed ldi r24, 0xDE ; 222 15854: 94 e8 ldi r25, 0x84 ; 132 15856: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 1585a: c0 ce rjmp .-640 ; 0x155dc else SERIAL_PROTOCOLLNPGM("Print saved"); 1585c: 82 ed ldi r24, 0xD2 ; 210 1585e: 94 e8 ldi r25, 0x84 ; 132 15860: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 15864: bb ce rjmp .-650 ; 0x155dc } else if (sdprinting) 15866: 80 91 90 14 lds r24, 0x1490 ; 0x801490 1586a: 88 23 and r24, r24 1586c: 09 f4 brne .+2 ; 0x15870 1586e: 4a c0 rjmp .+148 ; 0x15904 { if (arg_P) 15870: 11 23 and r17, r17 15872: e1 f1 breq .+120 ; 0x158ec { printAbsFilenameFast(); 15874: 0f 94 21 7a call 0x2f442 ; 0x2f442 SERIAL_PROTOCOLLN(); 15878: 0f 94 fd d5 call 0x3abfa ; 0x3abfa } else SERIAL_PROTOCOLLN(LONGEST_FILENAME); SERIAL_PROTOCOLRPGM(_N("SD printing byte "));////MSG_SD_PRINTING_BYTE 1587c: 81 ed ldi r24, 0xD1 ; 209 1587e: 97 e6 ldi r25, 0x67 ; 103 15880: 0e 94 50 77 call 0xeea0 ; 0xeea0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 15884: 60 91 a4 17 lds r22, 0x17A4 ; 0x8017a4 15888: 70 91 a5 17 lds r23, 0x17A5 ; 0x8017a5 1588c: 80 91 a6 17 lds r24, 0x17A6 ; 0x8017a6 15890: 90 91 a7 17 lds r25, 0x17A7 ; 0x8017a7 15894: 4a e0 ldi r20, 0x0A ; 10 15896: 0f 94 06 d5 call 0x3aa0c ; 0x3aa0c } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 1589a: 8f e2 ldi r24, 0x2F ; 47 1589c: 0e 94 37 77 call 0xee6e ; 0xee6e } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 158a0: 60 91 9d 17 lds r22, 0x179D ; 0x80179d 158a4: 70 91 9e 17 lds r23, 0x179E ; 0x80179e 158a8: 80 91 9f 17 lds r24, 0x179F ; 0x80179f 158ac: 90 91 a0 17 lds r25, 0x17A0 ; 0x8017a0 158b0: 4a e0 ldi r20, 0x0A ; 10 158b2: 0f 94 06 d5 call 0x3aa0c ; 0x3aa0c } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 158b6: 0f 94 fd d5 call 0x3abfa ; 0x3abfa SERIAL_PROTOCOL(sdpos); SERIAL_PROTOCOL('/'); SERIAL_PROTOCOLLN(filesize); uint16_t time = print_job_timer.duration() / 60; 158ba: 0f 94 a3 3e call 0x27d46 ; 0x27d46 158be: 2c e3 ldi r18, 0x3C ; 60 158c0: 30 e0 ldi r19, 0x00 ; 0 158c2: 40 e0 ldi r20, 0x00 ; 0 158c4: 50 e0 ldi r21, 0x00 ; 0 158c6: 0f 94 8f dc call 0x3b91e ; 0x3b91e <__udivmodsi4> SERIAL_PROTOCOL((int)(time / 60)); 158ca: c9 01 movw r24, r18 158cc: 6c e3 ldi r22, 0x3C ; 60 158ce: 70 e0 ldi r23, 0x00 ; 0 158d0: 0f 94 e5 dc call 0x3b9ca ; 0x3b9ca <__udivmodhi4> 158d4: 8c 01 movw r16, r24 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 158d6: 90 e0 ldi r25, 0x00 ; 0 158d8: 80 e0 ldi r24, 0x00 ; 0 158da: 0f 94 6b d5 call 0x3aad6 ; 0x3aad6 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 158de: 8a e3 ldi r24, 0x3A ; 58 158e0: 0e 94 37 77 call 0xee6e ; 0xee6e SERIAL_PROTOCOL(':'); SERIAL_PROTOCOLLN((int)(time % 60)); 158e4: c8 01 movw r24, r16 158e6: 0f 94 f5 74 call 0x2e9ea ; 0x2e9ea 158ea: 78 ce rjmp .-784 ; 0x155dc { printAbsFilenameFast(); SERIAL_PROTOCOLLN(); } else SERIAL_PROTOCOLLN(LONGEST_FILENAME); 158ec: 80 91 a7 14 lds r24, 0x14A7 ; 0x8014a7 158f0: 88 23 and r24, r24 158f2: 29 f0 breq .+10 ; 0x158fe 158f4: 87 ea ldi r24, 0xA7 ; 167 158f6: 94 e1 ldi r25, 0x14 ; 20 158f8: 0f 94 00 d6 call 0x3ac00 ; 0x3ac00 158fc: bf cf rjmp .-130 ; 0x1587c 158fe: 82 e9 ldi r24, 0x92 ; 146 15900: 94 e1 ldi r25, 0x14 ; 20 15902: fa cf rjmp .-12 ; 0x158f8 SERIAL_PROTOCOL((int)(time / 60)); SERIAL_PROTOCOL(':'); SERIAL_PROTOCOLLN((int)(time % 60)); } else SERIAL_PROTOCOLLNPGM("Not SD printing"); 15904: 82 ec ldi r24, 0xC2 ; 194 15906: 94 e8 ldi r25, 0x84 ; 132 15908: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 1590c: 67 ce rjmp .-818 ; 0x155dc /*! ### M28 - Start SD write M28: Begin write to SD card */ case 28: card.openFileWrite(strchr_pointer+4); 1590e: 80 91 95 03 lds r24, 0x0395 ; 0x800395 15912: 90 91 96 03 lds r25, 0x0396 ; 0x800396 15916: 04 96 adiw r24, 0x04 ; 4 15918: 0f 94 66 85 call 0x30acc ; 0x30acc 1591c: 5f ce rjmp .-834 ; 0x155dc * 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; 1591e: ce 01 movw r24, r28 15920: 01 96 adiw r24, 0x01 ; 1 15922: 0f 94 7d 76 call 0x2ecfa ; 0x2ecfa 15926: 88 23 and r24, r24 15928: 09 f4 brne .+2 ; 0x1592c 1592a: 58 c9 rjmp .-3408 ; 0x14bdc // cache directory entry d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 1592c: 61 e0 ldi r22, 0x01 ; 1 1592e: ce 01 movw r24, r28 15930: 01 96 adiw r24, 0x01 ; 1 15932: 0f 94 21 58 call 0x2b042 ; 0x2b042 if (!d) goto fail; 15936: 00 97 sbiw r24, 0x00 ; 0 15938: 09 f4 brne .+2 ; 0x1593c 1593a: 50 c9 rjmp .-3424 ; 0x14bdc // mark entry deleted d->name[0] = DIR_NAME_DELETED; 1593c: 25 ee ldi r18, 0xE5 ; 229 1593e: fc 01 movw r30, r24 15940: 20 83 st Z, r18 // set this file closed type_ = FAT_FILE_TYPE_CLOSED; 15942: 1c 82 std Y+4, r1 ; 0x04 // write entry to SD return vol_->cacheFlush(); 15944: 0f 94 15 53 call 0x2a62a ; 0x2a62a 15948: 18 2f mov r17, r24 1594a: 49 c9 rjmp .-3438 ; 0x14bde presort(); #endif } else { SERIAL_PROTOCOLPGM("Deletion failed, File: "); 1594c: 8c e9 ldi r24, 0x9C ; 156 1594e: 94 e8 ldi r25, 0x84 ; 132 15950: 0e 94 50 77 call 0xeea0 ; 0xeea0 15954: 23 96 adiw r28, 0x03 ; 3 15956: 8e ad ldd r24, Y+62 ; 0x3e 15958: 9f ad ldd r25, Y+63 ; 0x3f 1595a: 23 97 sbiw r28, 0x03 ; 3 1595c: 0e 94 14 88 call 0x11028 ; 0x11028 15960: 8e e2 ldi r24, 0x2E ; 46 15962: 0e 94 37 77 call 0xee6e ; 0xee6e } void MarlinSerial::println(char c, int base) { print(c, base); println(); 15966: 0f 94 fd d5 call 0x3abfa ; 0x3abfa 1596a: 38 ce rjmp .-912 ; 0x155dc ### 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(); 1596c: 0f 94 a3 3e call 0x27d46 ; 0x27d46 int16_t sec, min; min = t / 60; sec = t % 60; 15970: 2c e3 ldi r18, 0x3C ; 60 15972: 30 e0 ldi r19, 0x00 ; 0 15974: 40 e0 ldi r20, 0x00 ; 0 15976: 50 e0 ldi r21, 0x00 ; 0 15978: 0f 94 8f dc call 0x3b91e ; 0x3b91e <__udivmodsi4> sprintf_P(time, PSTR("%i min, %i sec"), min, sec); 1597c: 7f 93 push r23 1597e: 6f 93 push r22 15980: 3f 93 push r19 15982: 2f 93 push r18 15984: 89 e7 ldi r24, 0x79 ; 121 15986: 97 e8 ldi r25, 0x87 ; 135 15988: 9f 93 push r25 1598a: 8f 93 push r24 1598c: 8e 01 movw r16, r28 1598e: 0f 5f subi r16, 0xFF ; 255 15990: 1f 4f sbci r17, 0xFF ; 255 15992: 1f 93 push r17 15994: 0f 93 push r16 15996: 0f 94 33 db call 0x3b666 ; 0x3b666 SERIAL_ECHO_START; 1599a: 82 ec ldi r24, 0xC2 ; 194 1599c: 9b ea ldi r25, 0xAB ; 171 1599e: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHOLN(time); 159a2: c8 01 movw r24, r16 159a4: 0f 94 00 d6 call 0x3ac00 ; 0x3ac00 lcd_setstatus(time); 159a8: c8 01 movw r24, r16 159aa: 0e 94 89 f4 call 0x1e912 ; 0x1e912 autotempShutdown(); 159ae: 0f b6 in r0, 0x3f ; 63 159b0: f8 94 cli 159b2: de bf out 0x3e, r29 ; 62 159b4: 0f be out 0x3f, r0 ; 63 159b6: cd bf out 0x3d, r28 ; 61 159b8: 11 ce rjmp .-990 ; 0x155dc #### 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')) 159ba: 83 e5 ldi r24, 0x53 ; 83 159bc: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 159c0: 88 23 and r24, r24 159c2: 09 f4 brne .+2 ; 0x159c6 159c4: 0b ce rjmp .-1002 ; 0x155dc { uint8_t pin_status = code_value_uint8(); 159c6: 0e 94 68 5b call 0xb6d0 ; 0xb6d0 159ca: 08 2f mov r16, r24 int8_t pin_number = LED_PIN; if (code_seen('P')) 159cc: 80 e5 ldi r24, 0x50 ; 80 159ce: 0e 94 d6 5b call 0xb7ac ; 0xb7ac */ case 42: if (code_seen('S')) { uint8_t pin_status = code_value_uint8(); int8_t pin_number = LED_PIN; 159d2: 1d e0 ldi r17, 0x0D ; 13 if (code_seen('P')) 159d4: 88 23 and r24, r24 159d6: 19 f0 breq .+6 ; 0x159de pin_number = code_value_uint8(); 159d8: 0e 94 68 5b call 0xb6d0 ; 0xb6d0 159dc: 18 2f mov r17, r24 159de: ed e5 ldi r30, 0x5D ; 93 159e0: f7 e8 ldi r31, 0x87 ; 135 159e2: 89 e7 ldi r24, 0x79 ; 121 159e4: 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) 159e6: 24 91 lpm r18, Z 159e8: 21 17 cp r18, r17 159ea: 09 f4 brne .+2 ; 0x159ee 159ec: f7 cd rjmp .-1042 ; 0x155dc 159ee: 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++) 159f0: 8e 17 cp r24, r30 159f2: 9f 07 cpc r25, r31 159f4: c1 f7 brne .-16 ; 0x159e6 pin_number = -1; break; } } #if defined(FAN_PIN) && FAN_PIN > -1 if (pin_number == FAN_PIN) 159f6: 16 30 cpi r17, 0x06 ; 6 159f8: 81 f4 brne .+32 ; 0x15a1a fanSpeed = pin_status; 159fa: 00 93 e7 03 sts 0x03E7, r16 ; 0x8003e7 #endif if (pin_number > -1) { pinMode(pin_number, OUTPUT); 159fe: 61 e0 ldi r22, 0x01 ; 1 15a00: 81 2f mov r24, r17 15a02: 0e 94 e5 e8 call 0x1d1ca ; 0x1d1ca digitalWrite(pin_number, pin_status); 15a06: 60 2f mov r22, r16 15a08: 81 2f mov r24, r17 15a0a: 0e 94 b7 e8 call 0x1d16e ; 0x1d16e analogWrite(pin_number, pin_status); 15a0e: 60 2f mov r22, r16 15a10: 70 e0 ldi r23, 0x00 ; 0 15a12: 81 2f mov r24, r17 15a14: 0e 94 16 e9 call 0x1d22c ; 0x1d22c 15a18: e1 cd rjmp .-1086 ; 0x155dc } #if defined(FAN_PIN) && FAN_PIN > -1 if (pin_number == FAN_PIN) fanSpeed = pin_status; #endif if (pin_number > -1) 15a1a: 17 fd sbrc r17, 7 15a1c: df cd rjmp .-1090 ; 0x155dc 15a1e: ef cf rjmp .-34 ; 0x159fe ### 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); 15a20: 80 e1 ldi r24, 0x10 ; 16 15a22: 0e 94 3d ee call 0x1dc7a ; 0x1dc7a eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 15a26: 81 ea ldi r24, 0xA1 ; 161 15a28: 9d e0 ldi r25, 0x0D ; 13 15a2a: 0f 94 1c dc call 0x3b838 ; 0x3b838 15a2e: 3b e0 ldi r19, 0x0B ; 11 15a30: 83 9f mul r24, r19 15a32: c0 01 movw r24, r0 15a34: 11 24 eor r1, r1 15a36: 70 e0 ldi r23, 0x00 ; 0 15a38: 60 e0 ldi r22, 0x00 ; 0 15a3a: 80 5b subi r24, 0xB0 ; 176 15a3c: 92 4f sbci r25, 0xF2 ; 242 15a3e: 0f 94 5e dc call 0x3b8bc ; 0x3b8bc // Reset the skew and offset in both RAM and EEPROM. calibration_status_clear(CALIBRATION_STATUS_XYZ); 15a42: 82 e0 ldi r24, 0x02 ; 2 15a44: 0e 94 3d ee call 0x1dc7a ; 0x1dc7a reset_bed_offset_and_skew(); 15a48: 0f 94 55 ce call 0x39caa ; 0x39caa // 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(); 15a4c: 0f 94 36 ce call 0x39c6c ; 0x39c6c 15a50: c5 cd rjmp .-1142 ; 0x155dc */ case 45: // M45: Prusa3D: bed skew and offset with manual Z up { int8_t verbosity_level = 0; bool only_Z = code_seen('Z'); 15a52: 8a e5 ldi r24, 0x5A ; 90 15a54: 0e 94 d6 5b call 0xb7ac ; 0xb7ac // 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); 15a58: 0f 94 a5 8d call 0x31b4a ; 0x31b4a 15a5c: bf cd rjmp .-1154 ; 0x155dc ### 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()) { 15a5e: 80 91 01 17 lds r24, 0x1701 ; 0x801701 15a62: 88 23 and r24, r24 15a64: 19 f1 breq .+70 ; 0x15aac uint8_t ip[4]; if (card.ToshibaFlashAir_GetIP(ip)) { 15a66: ce 01 movw r24, r28 15a68: 01 96 adiw r24, 0x01 ; 1 15a6a: 0f 94 ce 85 call 0x30b9c ; 0x30b9c 15a6e: 88 23 and r24, r24 15a70: c1 f0 breq .+48 ; 0x15aa2 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 15a72: 89 81 ldd r24, Y+1 ; 0x01 15a74: 0e 94 37 77 call 0xee6e ; 0xee6e } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 15a78: 8e e2 ldi r24, 0x2E ; 46 15a7a: 0e 94 37 77 call 0xee6e ; 0xee6e } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 15a7e: 8a 81 ldd r24, Y+2 ; 0x02 15a80: 0e 94 37 77 call 0xee6e ; 0xee6e } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 15a84: 8e e2 ldi r24, 0x2E ; 46 15a86: 0e 94 37 77 call 0xee6e ; 0xee6e } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 15a8a: 8b 81 ldd r24, Y+3 ; 0x03 15a8c: 0e 94 37 77 call 0xee6e ; 0xee6e } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 15a90: 8e e2 ldi r24, 0x2E ; 46 15a92: 0e 94 37 77 call 0xee6e ; 0xee6e } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 15a96: 8c 81 ldd r24, Y+4 ; 0x04 15a98: 0e 94 37 77 call 0xee6e ; 0xee6e } void MarlinSerial::println(unsigned char b, int base) { print(b, base); println(); 15a9c: 0f 94 fd d5 call 0x3abfa ; 0x3abfa 15aa0: 9d cd rjmp .-1222 ; 0x155dc SERIAL_PROTOCOL('.'); SERIAL_PROTOCOL(uint8_t(ip[2])); SERIAL_PROTOCOL('.'); SERIAL_PROTOCOLLN(uint8_t(ip[3])); } else { SERIAL_PROTOCOLPGM("?Toshiba FlashAir GetIP failed\n"); 15aa2: 8d e3 ldi r24, 0x3D ; 61 15aa4: 97 e8 ldi r25, 0x87 ; 135 15aa6: 0e 94 50 77 call 0xeea0 ; 0xeea0 15aaa: 98 cd rjmp .-1232 ; 0x155dc } } else { SERIAL_PROTOCOLLNPGM("n/a"); 15aac: 89 e3 ldi r24, 0x39 ; 57 15aae: 97 e8 ldi r25, 0x87 ; 135 15ab0: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 15ab4: 93 cd rjmp .-1242 ; 0x155dc 15ab6: 10 92 b8 0d sts 0x0DB8, r1 ; 0x800db8 <_ZL13printer_state.lto_priv.401> 15aba: 90 cd rjmp .-1248 ; 0x155dc break; default: break; } } else { printf_P(_N("PrinterState: %d\n"),uint8_t(GetPrinterState())); 15abc: 80 91 b8 0d lds r24, 0x0DB8 ; 0x800db8 <_ZL13printer_state.lto_priv.401> 15ac0: 1f 92 push r1 15ac2: 8f 93 push r24 15ac4: 82 e2 ldi r24, 0x22 ; 34 15ac6: 99 e6 ldi r25, 0x69 ; 105 15ac8: 9f 93 push r25 15aca: 8f 93 push r24 15acc: 0f 94 de da call 0x3b5bc ; 0x3b5bc 15ad0: 0f 90 pop r0 15ad2: 0f 90 pop r0 15ad4: 0f 90 pop r0 15ad6: 0f 90 pop r0 15ad8: 81 cd rjmp .-1278 ; 0x155dc - `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(); 15ada: 80 e5 ldi r24, 0x50 ; 80 15adc: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 15ae0: 88 23 and r24, r24 15ae2: 21 f0 breq .+8 ; 0x15aec 15ae4: 0e 94 68 5b call 0xb6d0 ; 0xb6d0 15ae8: 80 93 ae 02 sts 0x02AE, r24 ; 0x8002ae if(code_seen('R')) print_time_remaining_normal = code_value(); 15aec: 82 e5 ldi r24, 0x52 ; 82 15aee: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 15af2: 88 23 and r24, r24 15af4: 41 f0 breq .+16 ; 0x15b06 15af6: 0e 94 9d 60 call 0xc13a ; 0xc13a 15afa: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 15afe: 70 93 b2 02 sts 0x02B2, r23 ; 0x8002b2 15b02: 60 93 b1 02 sts 0x02B1, r22 ; 0x8002b1 if(code_seen('Q')) print_percent_done_silent = code_value_uint8(); 15b06: 81 e5 ldi r24, 0x51 ; 81 15b08: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 15b0c: 88 23 and r24, r24 15b0e: 21 f0 breq .+8 ; 0x15b18 15b10: 0e 94 68 5b call 0xb6d0 ; 0xb6d0 15b14: 80 93 ad 02 sts 0x02AD, r24 ; 0x8002ad if(code_seen('S')) print_time_remaining_silent = code_value(); 15b18: 83 e5 ldi r24, 0x53 ; 83 15b1a: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 15b1e: 88 23 and r24, r24 15b20: 41 f0 breq .+16 ; 0x15b32 15b22: 0e 94 9d 60 call 0xc13a ; 0xc13a 15b26: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 15b2a: 70 93 b6 02 sts 0x02B6, r23 ; 0x8002b6 15b2e: 60 93 b5 02 sts 0x02B5, r22 ; 0x8002b5 if(code_seen('C')){ 15b32: 83 e4 ldi r24, 0x43 ; 67 15b34: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 15b38: 88 23 and r24, r24 15b3a: a9 f0 breq .+42 ; 0x15b66 float print_time_to_change_normal_f = code_value(); 15b3c: 0e 94 9d 60 call 0xc13a ; 0xc13a 15b40: 6b 01 movw r12, r22 15b42: 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; 15b44: 20 e0 ldi r18, 0x00 ; 0 15b46: 30 e0 ldi r19, 0x00 ; 0 15b48: a9 01 movw r20, r18 15b4a: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 15b4e: 6f ef ldi r22, 0xFF ; 255 15b50: 7f ef ldi r23, 0xFF ; 255 15b52: 18 16 cp r1, r24 15b54: 24 f4 brge .+8 ; 0x15b5e 15b56: c7 01 movw r24, r14 15b58: b6 01 movw r22, r12 15b5a: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 15b5e: 70 93 b0 02 sts 0x02B0, r23 ; 0x8002b0 15b62: 60 93 af 02 sts 0x02AF, r22 ; 0x8002af } if(code_seen('D')){ 15b66: 84 e4 ldi r24, 0x44 ; 68 15b68: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 15b6c: 88 23 and r24, r24 15b6e: a9 f0 breq .+42 ; 0x15b9a float print_time_to_change_silent_f = code_value(); 15b70: 0e 94 9d 60 call 0xc13a ; 0xc13a 15b74: 6b 01 movw r12, r22 15b76: 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; 15b78: 20 e0 ldi r18, 0x00 ; 0 15b7a: 30 e0 ldi r19, 0x00 ; 0 15b7c: a9 01 movw r20, r18 15b7e: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 15b82: 6f ef ldi r22, 0xFF ; 255 15b84: 7f ef ldi r23, 0xFF ; 255 15b86: 18 16 cp r1, r24 15b88: 24 f4 brge .+8 ; 0x15b92 15b8a: c7 01 movw r24, r14 15b8c: b6 01 movw r22, r12 15b8e: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 15b92: 70 93 b4 02 sts 0x02B4, r23 ; 0x8002b4 15b96: 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); 15b9a: 80 91 b0 02 lds r24, 0x02B0 ; 0x8002b0 15b9e: 8f 93 push r24 15ba0: 80 91 af 02 lds r24, 0x02AF ; 0x8002af 15ba4: 8f 93 push r24 15ba6: 80 91 b2 02 lds r24, 0x02B2 ; 0x8002b2 15baa: 8f 93 push r24 15bac: 80 91 b1 02 lds r24, 0x02B1 ; 0x8002b1 15bb0: 8f 93 push r24 15bb2: 80 91 ae 02 lds r24, 0x02AE ; 0x8002ae 15bb6: 28 2f mov r18, r24 15bb8: 08 2e mov r0, r24 15bba: 00 0c add r0, r0 15bbc: 33 0b sbc r19, r19 15bbe: 3f 93 push r19 15bc0: 8f 93 push r24 15bc2: 88 ec ldi r24, 0xC8 ; 200 15bc4: 98 e6 ldi r25, 0x68 ; 104 15bc6: 9f 93 push r25 15bc8: 8f 93 push r24 15bca: 0f ec ldi r16, 0xCF ; 207 15bcc: 18 e6 ldi r17, 0x68 ; 104 15bce: 1f 93 push r17 15bd0: 0f 93 push r16 15bd2: 0f 94 de da call 0x3b5bc ; 0x3b5bc printf_P(_msg_mode_done_remain, _N("SILENT"), int8_t(print_percent_done_silent), print_time_remaining_silent, print_time_to_change_silent); 15bd6: 80 91 b4 02 lds r24, 0x02B4 ; 0x8002b4 15bda: 8f 93 push r24 15bdc: 80 91 b3 02 lds r24, 0x02B3 ; 0x8002b3 15be0: 8f 93 push r24 15be2: 80 91 b6 02 lds r24, 0x02B6 ; 0x8002b6 15be6: 8f 93 push r24 15be8: 80 91 b5 02 lds r24, 0x02B5 ; 0x8002b5 15bec: 8f 93 push r24 15bee: 80 91 ad 02 lds r24, 0x02AD ; 0x8002ad 15bf2: 28 2f mov r18, r24 15bf4: 08 2e mov r0, r24 15bf6: 00 0c add r0, r0 15bf8: 33 0b sbc r19, r19 15bfa: 3f 93 push r19 15bfc: 8f 93 push r24 15bfe: 81 ec ldi r24, 0xC1 ; 193 15c00: 98 e6 ldi r25, 0x68 ; 104 15c02: 9f 93 push r25 15c04: 8f 93 push r24 15c06: 1f 93 push r17 15c08: 0f 93 push r16 15c0a: 0f 94 de da call 0x3b5bc ; 0x3b5bc 15c0e: 0f b6 in r0, 0x3f ; 63 15c10: f8 94 cli 15c12: de bf out 0x3e, r29 ; 62 15c14: 0f be out 0x3f, r0 ; 63 15c16: cd bf out 0x3d, r28 ; 61 15c18: e1 cc rjmp .-1598 ; 0x155dc } else return false; } bool Stopwatch::pause() { if (isRunning()) { 15c1a: 80 91 9d 03 lds r24, 0x039D ; 0x80039d 15c1e: 81 30 cpi r24, 0x01 ; 1 15c20: 09 f0 breq .+2 ; 0x15c24 15c22: dc cc rjmp .-1608 ; 0x155dc state = PAUSED; 15c24: 82 e0 ldi r24, 0x02 ; 2 15c26: 80 93 9d 03 sts 0x039D, r24 ; 0x80039d stopTimestamp = _millis(); 15c2a: 0f 94 4c 29 call 0x25298 ; 0x25298 15c2e: 60 93 52 06 sts 0x0652, r22 ; 0x800652 15c32: 70 93 53 06 sts 0x0653, r23 ; 0x800653 15c36: 80 93 54 06 sts 0x0654, r24 ; 0x800654 15c3a: 90 93 55 06 sts 0x0655, r25 ; 0x800655 15c3e: ce cc rjmp .-1636 ; 0x155dc /*! ### M77 - Stop the print job timer M77: Stop the print job timer */ case 77: { print_job_timer.stop(); 15c40: 0f 94 b1 42 call 0x28562 ; 0x28562 save_statistics(); 15c44: 0e 94 1f 66 call 0xcc3e ; 0xcc3e 15c48: c9 cc rjmp .-1646 ; 0x155dc ### 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 "); 15c4a: 82 e3 ldi r24, 0x32 ; 50 15c4c: 97 e8 ldi r25, 0x87 ; 135 15c4e: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHO(eeprom_read_dword((uint32_t *)EEPROM_TOTALTIME)); 15c52: 8d ee ldi r24, 0xED ; 237 15c54: 9f e0 ldi r25, 0x0F ; 15 15c56: 0f 94 24 dc call 0x3b848 ; 0x3b848 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 15c5a: 4a e0 ldi r20, 0x0A ; 10 15c5c: 0f 94 06 d5 call 0x3aa0c ; 0x3aa0c SERIAL_ECHOPGM(" min "); 15c60: 8c e2 ldi r24, 0x2C ; 44 15c62: 97 e8 ldi r25, 0x87 ; 135 15c64: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHO(eeprom_read_dword((uint32_t *)EEPROM_FILAMENTUSED)); 15c68: 81 ef ldi r24, 0xF1 ; 241 15c6a: 9f e0 ldi r25, 0x0F ; 15 15c6c: 0f 94 24 dc call 0x3b848 ; 0x3b848 15c70: 4a e0 ldi r20, 0x0A ; 10 15c72: 0f 94 06 d5 call 0x3aa0c ; 0x3aa0c SERIAL_ECHOLNPGM(" cm."); 15c76: 87 e2 ldi r24, 0x27 ; 39 15c78: 97 e8 ldi r25, 0x87 ; 135 15c7a: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 15c7e: ae cc rjmp .-1700 ; 0x155dc void ResetHostStatusScreenName() { memset(host_status_screen_name, 0, sizeof(host_status_screen_name)); } void M79_timer_restart() { M79_timer.start(); 15c80: 8e e9 ldi r24, 0x9E ; 158 15c82: 93 e0 ldi r25, 0x03 ; 3 15c84: 0f 94 ef 2b call 0x257de ; 0x257de ::start()> - `S` - Quoted string containing two characters e.g. "PL" */ case 79: M79_timer_restart(); if (code_seen('S')) 15c88: 83 e5 ldi r24, 0x53 ; 83 15c8a: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 15c8e: 88 23 and r24, r24 15c90: 09 f1 breq .+66 ; 0x15cd4 , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 15c92: 62 e2 ldi r22, 0x22 ; 34 15c94: 70 e0 ldi r23, 0x00 ; 0 15c96: 80 91 95 03 lds r24, 0x0395 ; 0x800395 15c9a: 90 91 96 03 lds r25, 0x0396 ; 0x800396 15c9e: 0f 94 73 e2 call 0x3c4e6 ; 0x3c4e6 15ca2: 8c 01 movw r16, r24 if (!this->ptr) { 15ca4: 89 2b or r24, r25 15ca6: b1 f0 breq .+44 ; 0x15cd4 // First quote not found return; } // Skip the leading quote this->ptr++; 15ca8: 0f 5f subi r16, 0xFF ; 255 15caa: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 15cac: 62 e2 ldi r22, 0x22 ; 34 15cae: 70 e0 ldi r23, 0x00 ; 0 15cb0: c8 01 movw r24, r16 15cb2: 0f 94 73 e2 call 0x3c4e6 ; 0x3c4e6 if(!pStrEnd) { 15cb6: 89 2b or r24, r25 15cb8: 69 f0 breq .+26 ; 0x15cd4 char * GetHostStatusScreenName() { return host_status_screen_name; } void ResetHostStatusScreenName() { memset(host_status_screen_name, 0, sizeof(host_status_screen_name)); 15cba: ec e4 ldi r30, 0x4C ; 76 15cbc: f6 e0 ldi r31, 0x06 ; 6 15cbe: 83 e0 ldi r24, 0x03 ; 3 15cc0: df 01 movw r26, r30 15cc2: 1d 92 st X+, r1 15cc4: 8a 95 dec r24 15cc6: e9 f7 brne .-6 ; 0x15cc2 static LongTimer M79_timer; static char host_status_screen_name[3]; void SetHostStatusScreenName(const char * name) { strncpy(host_status_screen_name, name, 2); 15cc8: 42 e0 ldi r20, 0x02 ; 2 15cca: 50 e0 ldi r21, 0x00 ; 0 15ccc: b8 01 movw r22, r16 15cce: cf 01 movw r24, r30 15cd0: 0f 94 9c e2 call 0x3c538 ; 0x3c538 } #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 15cd4: 8c e8 ldi r24, 0x8C ; 140 15cd6: 9f e0 ldi r25, 0x0F ; 15 15cd8: 0f 94 1c dc call 0x3b838 ; 0x3b838 && printer_recovering() && printingIsPaused()) { 15cdc: 81 30 cpi r24, 0x01 ; 1 15cde: 09 f0 breq .+2 ; 0x15ce2 15ce0: 7d cc rjmp .-1798 ; 0x155dc #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() 15ce2: 0e 94 7b 67 call 0xcef6 ; 0xcef6 15ce6: 88 23 and r24, r24 15ce8: 09 f4 brne .+2 ; 0x15cec 15cea: 78 cc rjmp .-1808 ; 0x155dc && printingIsPaused()) { 15cec: 0e 94 85 67 call 0xcf0a ; 0xcf0a 15cf0: 88 23 and r24, r24 15cf2: 09 f4 brne .+2 ; 0x15cf6 15cf4: 73 cc rjmp .-1818 ; 0x155dc // 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) { 15cf6: 80 91 ed 04 lds r24, 0x04ED ; 0x8004ed <_ZL24uvlo_auto_recovery_ready.lto_priv.531> 15cfa: 88 23 and r24, r24 15cfc: 29 f0 breq .+10 ; 0x15d08 SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_UVLO_AUTO_RECOVERY_READY); 15cfe: 8f e9 ldi r24, 0x9F ; 159 15d00: 98 e6 ldi r25, 0x68 ; 104 15d02: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 15d06: 6a cc rjmp .-1836 ; 0x155dc } else { SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_UVLO_RECOVERY_READY); 15d08: 82 e8 ldi r24, 0x82 ; 130 15d0a: 98 e6 ldi r25, 0x68 ; 104 15d0c: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 15d10: 65 cc rjmp .-1846 ; 0x155dc /*! ### M112 - Emergency stop M112: Full (Emergency) Stop It is processed much earlier as to bypass the cmdqueue. */ case 112: kill(MSG_M112_KILL); 15d12: 85 e6 ldi r24, 0x65 ; 101 15d14: 98 e6 ldi r25, 0x68 ; 104 15d16: 0e 94 0a 7a call 0xf414 ; 0xf414 #### Parameters - `S` - Target temperature */ case 140: if (code_seen('S')) setTargetBed(code_value()); 15d1a: 83 e5 ldi r24, 0x53 ; 83 15d1c: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 15d20: 88 23 and r24, r24 15d22: 09 f4 brne .+2 ; 0x15d26 15d24: 5b cc rjmp .-1866 ; 0x155dc 15d26: 0e 94 9d 60 call 0xc13a ; 0xc13a resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 15d2a: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> 15d2e: 70 93 73 06 sts 0x0673, r23 ; 0x800673 15d32: 60 93 72 06 sts 0x0672, r22 ; 0x800672 15d36: 52 cc rjmp .-1884 ; 0x155dc 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 "); 15d38: 83 e2 ldi r24, 0x23 ; 35 15d3a: 97 e8 ldi r25, 0x87 ; 135 15d3c: 0e 94 50 77 call 0xeea0 ; 0xeea0 gcode_M105(); 15d40: 0e 94 c2 78 call 0xf184 ; 0xf184 cmdqueue_pop_front(); //prevent an ok after the command since this command uses an ok at the beginning. 15d44: 0e 94 bc 76 call 0xed78 ; 0xed78 cmdbuffer_front_already_processed = true; 15d48: 81 e0 ldi r24, 0x01 ; 1 15d4a: 80 93 a2 10 sts 0x10A2, r24 ; 0x8010a2 15d4e: 46 cc rjmp .-1908 ; 0x155dc 15d50: 10 92 89 14 sts 0x1489, r1 ; 0x801489 15d54: f0 c8 rjmp .-3616 ; 0x14f36 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; } 15d56: 81 e0 ldi r24, 0x01 ; 1 15d58: 80 93 87 14 sts 0x1487, r24 ; 0x801487 15d5c: 3f cc rjmp .-1922 ; 0x155dc #ifdef AUTOTEMP autotemp_enabled=false; #endif if (code_seen('S')) { setTargetHotend(code_value()); } else if (code_seen('R')) { 15d5e: 82 e5 ldi r24, 0x52 ; 82 15d60: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 15d64: 81 11 cpse r24, r1 15d66: 7a c8 rjmp .-3852 ; 0x14e5c autotemp_factor=code_value(); autotemp_enabled=true; } #endif codenum = _millis(); 15d68: 0f 94 4c 29 call 0x25298 ; 0x25298 15d6c: 6b 01 movw r12, r22 15d6e: 7c 01 movw r14, r24 }; FORCE_INLINE bool isHeatingHotend(uint8_t extruder){ return target_temperature[extruder] > current_temperature[extruder]; 15d70: 60 91 b6 0d lds r22, 0x0DB6 ; 0x800db6 15d74: 70 91 b7 0d lds r23, 0x0DB7 ; 0x800db7 15d78: 07 2e mov r0, r23 15d7a: 00 0c add r0, r0 15d7c: 88 0b sbc r24, r24 15d7e: 99 0b sbc r25, r25 15d80: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 15d84: 11 e0 ldi r17, 0x01 ; 1 15d86: 20 91 b0 0d lds r18, 0x0DB0 ; 0x800db0 15d8a: 30 91 b1 0d lds r19, 0x0DB1 ; 0x800db1 15d8e: 40 91 b2 0d lds r20, 0x0DB2 ; 0x800db2 15d92: 50 91 b3 0d lds r21, 0x0DB3 ; 0x800db3 15d96: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 15d9a: 18 16 cp r1, r24 15d9c: 0c f0 brlt .+2 ; 0x15da0 15d9e: 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 15da0: 10 93 af 0d sts 0x0DAF, r17 ; 0x800daf <_ZL16target_direction.lto_priv.532> wait_for_heater(codenum, active_extruder); //loops until target temperature is reached 15da4: c7 01 movw r24, r14 15da6: b6 01 movw r22, r12 15da8: 0f 94 e1 81 call 0x303c2 ; 0x303c2 LCD_MESSAGERPGM(_T(MSG_HEATING_COMPLETE)); 15dac: 8d e1 ldi r24, 0x1D ; 29 15dae: 9e e4 ldi r25, 0x4E ; 78 15db0: 0e 94 ac 72 call 0xe558 ; 0xe558 15db4: 0e 94 5d f1 call 0x1e2ba ; 0x1e2ba heating_status = HeatingStatus::EXTRUDER_HEATING_COMPLETE; 15db8: 82 e0 ldi r24, 0x02 ; 2 15dba: 80 93 e3 03 sts 0x03E3, r24 ; 0x8003e3 prusa_statistics(2); previous_millis_cmd.start(); 15dbe: 86 e8 ldi r24, 0x86 ; 134 15dc0: 93 e0 ldi r25, 0x03 ; 3 15dc2: 0f 94 ef 2b call 0x257de ; 0x257de ::start()> 15dc6: 0a cc rjmp .-2028 ; 0x155dc */ case 190: #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1 { bool CooldownNoWait = false; LCD_MESSAGERPGM(_T(MSG_BED_HEATING)); 15dc8: 8f e0 ldi r24, 0x0F ; 15 15dca: 9e e4 ldi r25, 0x4E ; 78 15dcc: 0e 94 ac 72 call 0xe558 ; 0xe558 15dd0: 0e 94 5d f1 call 0x1e2ba ; 0x1e2ba heating_status = HeatingStatus::BED_HEATING; 15dd4: 83 e0 ldi r24, 0x03 ; 3 15dd6: 80 93 e3 03 sts 0x03E3, r24 ; 0x8003e3 prusa_statistics(1); if (code_seen('S')) 15dda: 83 e5 ldi r24, 0x53 ; 83 15ddc: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 15de0: 18 2f mov r17, r24 15de2: 88 23 and r24, r24 15de4: 49 f0 breq .+18 ; 0x15df8 setTargetBed(code_value()); CooldownNoWait = true; } else if (code_seen('R')) { setTargetBed(code_value()); 15de6: 0e 94 9d 60 call 0xc13a ; 0xc13a target_temperature[0] = celsius; resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 15dea: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> 15dee: 70 93 73 06 sts 0x0673, r23 ; 0x800673 15df2: 60 93 72 06 sts 0x0672, r22 ; 0x800672 15df6: 05 c0 rjmp .+10 ; 0x15e02 if (code_seen('S')) { setTargetBed(code_value()); CooldownNoWait = true; } else if (code_seen('R')) 15df8: 82 e5 ldi r24, 0x52 ; 82 15dfa: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 15dfe: 81 11 cpse r24, r1 15e00: f2 cf rjmp .-28 ; 0x15de6 { setTargetBed(code_value()); } codenum = _millis(); 15e02: 0f 94 4c 29 call 0x25298 ; 0x25298 15e06: 6b 01 movw r12, r22 15e08: 7c 01 movw r14, r24 cancel_heatup = false; 15e0a: 10 92 b5 0d sts 0x0DB5, r1 ; 0x800db5 <_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; 15e0e: 60 91 72 06 lds r22, 0x0672 ; 0x800672 15e12: 70 91 73 06 lds r23, 0x0673 ; 0x800673 15e16: 07 2e mov r0, r23 15e18: 00 0c add r0, r0 15e1a: 88 0b sbc r24, r24 15e1c: 99 0b sbc r25, r25 15e1e: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 15e22: 01 e0 ldi r16, 0x01 ; 1 15e24: 20 91 ee 04 lds r18, 0x04EE ; 0x8004ee 15e28: 30 91 ef 04 lds r19, 0x04EF ; 0x8004ef 15e2c: 40 91 f0 04 lds r20, 0x04F0 ; 0x8004f0 15e30: 50 91 f1 04 lds r21, 0x04F1 ; 0x8004f1 15e34: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 15e38: 18 16 cp r1, r24 15e3a: 0c f0 brlt .+2 ; 0x15e3e 15e3c: 00 e0 ldi r16, 0x00 ; 0 target_direction = isHeatingBed(); // true if heating, false if cooling 15e3e: 00 93 af 0d sts 0x0DAF, r16 ; 0x800daf <_ZL16target_direction.lto_priv.532> while ( (!cancel_heatup) && (target_direction ? (isHeatingBed()) : (isCoolingBed()&&(CooldownNoWait==false))) ) 15e42: 80 91 b5 0d lds r24, 0x0DB5 ; 0x800db5 <_ZL13cancel_heatup.lto_priv.408> 15e46: 81 11 cpse r24, r1 15e48: 1a c0 rjmp .+52 ; 0x15e7e 15e4a: 60 91 72 06 lds r22, 0x0672 ; 0x800672 15e4e: 70 91 73 06 lds r23, 0x0673 ; 0x800673 15e52: 07 2e mov r0, r23 15e54: 00 0c add r0, r0 15e56: 88 0b sbc r24, r24 15e58: 99 0b sbc r25, r25 15e5a: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 15e5e: 20 91 ee 04 lds r18, 0x04EE ; 0x8004ee 15e62: 30 91 ef 04 lds r19, 0x04EF ; 0x8004ef 15e66: 40 91 f0 04 lds r20, 0x04F0 ; 0x8004f0 15e6a: 50 91 f1 04 lds r21, 0x04F1 ; 0x8004f1 15e6e: e0 91 af 0d lds r30, 0x0DAF ; 0x800daf <_ZL16target_direction.lto_priv.532> 15e72: ee 23 and r30, r30 15e74: 91 f0 breq .+36 ; 0x15e9a 15e76: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 15e7a: 18 16 cp r1, r24 15e7c: a4 f0 brlt .+40 ; 0x15ea6 } manage_heater(); manage_inactivity(); lcd_update(0); } LCD_MESSAGERPGM(_T(MSG_BED_DONE)); 15e7e: 84 e0 ldi r24, 0x04 ; 4 15e80: 9e e4 ldi r25, 0x4E ; 78 15e82: 0e 94 ac 72 call 0xe558 ; 0xe558 15e86: 0e 94 5d f1 call 0x1e2ba ; 0x1e2ba heating_status = HeatingStatus::BED_HEATING_COMPLETE; 15e8a: 84 e0 ldi r24, 0x04 ; 4 15e8c: 80 93 e3 03 sts 0x03E3, r24 ; 0x8003e3 previous_millis_cmd.start(); 15e90: 86 e8 ldi r24, 0x86 ; 134 15e92: 93 e0 ldi r25, 0x03 ; 3 15e94: 0f 94 ef 2b call 0x257de ; 0x257de ::start()> 15e98: a1 cb rjmp .-2238 ; 0x155dc codenum = _millis(); cancel_heatup = false; target_direction = isHeatingBed(); // true if heating, false if cooling while ( (!cancel_heatup) && (target_direction ? (isHeatingBed()) : (isCoolingBed()&&(CooldownNoWait==false))) ) 15e9a: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 15e9e: 87 ff sbrs r24, 7 15ea0: ee cf rjmp .-36 ; 0x15e7e 15ea2: 11 11 cpse r17, r1 15ea4: ec cf rjmp .-40 ; 0x15e7e { if (lcd_commands_type == LcdCommands::LongPause) { 15ea6: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 15eaa: 82 30 cpi r24, 0x02 ; 2 15eac: 41 f3 breq .-48 ; 0x15e7e // 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. 15eae: 0f 94 4c 29 call 0x25298 ; 0x25298 15eb2: 6c 19 sub r22, r12 15eb4: 7d 09 sbc r23, r13 15eb6: 8e 09 sbc r24, r14 15eb8: 9f 09 sbc r25, r15 15eba: 69 3e cpi r22, 0xE9 ; 233 15ebc: 73 40 sbci r23, 0x03 ; 3 15ebe: 81 05 cpc r24, r1 15ec0: 91 05 cpc r25, r1 15ec2: 30 f0 brcs .+12 ; 0x15ed0 { if (!farm_mode) { serialecho_temperatures(); 15ec4: 0e 94 5e 77 call 0xeebc ; 0xeebc } codenum = _millis(); 15ec8: 0f 94 4c 29 call 0x25298 ; 0x25298 15ecc: 6b 01 movw r12, r22 15ece: 7c 01 movw r14, r24 } manage_heater(); 15ed0: 0f 94 5c 38 call 0x270b8 ; 0x270b8 manage_inactivity(); 15ed4: 80 e0 ldi r24, 0x00 ; 0 15ed6: 0e 94 af 8a call 0x1155e ; 0x1155e lcd_update(0); 15eda: 80 e0 ldi r24, 0x00 ; 0 15edc: 0e 94 a7 6e call 0xdd4e ; 0xdd4e 15ee0: b0 cf rjmp .-160 ; 0x15e42 #### 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')){ 15ee2: 83 e5 ldi r24, 0x53 ; 83 15ee4: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 15ee8: 88 23 and r24, r24 15eea: 29 f0 breq .+10 ; 0x15ef6 fanSpeed = code_value_uint8(); 15eec: 0e 94 68 5b call 0xb6d0 ; 0xb6d0 15ef0: 80 93 e7 03 sts 0x03E7, r24 ; 0x8003e7 15ef4: 73 cb rjmp .-2330 ; 0x155dc } else { fanSpeed = 255; 15ef6: 8f ef ldi r24, 0xFF ; 255 15ef8: 80 93 e7 03 sts 0x03E7, r24 ; 0x8003e7 15efc: 6f cb rjmp .-2338 ; 0x155dc /*! ### M107 - Fan off M107: Fan Off */ case 107: fanSpeed = 0; 15efe: 10 92 e7 03 sts 0x03E7, r1 ; 0x8003e7 15f02: 6c cb rjmp .-2344 ; 0x155dc /*! ### 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; 15f04: 80 91 e5 03 lds r24, 0x03E5 ; 0x8003e5 15f08: 88 60 ori r24, 0x08 ; 8 15f0a: 80 93 e5 03 sts 0x03E5, r24 ; 0x8003e5 15f0e: 66 cb rjmp .-2356 ; 0x155dc ### M18 - Disable steppers M18: Disable all stepper motors Equal to M84 (compatibility) */ case 18: //compatibility case 84: // M84 if(code_seen('S')){ 15f10: 83 e5 ldi r24, 0x53 ; 83 15f12: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 15f16: 88 23 and r24, r24 15f18: 99 f0 breq .+38 ; 0x15f40 stepper_inactive_time = code_value() * 1000; 15f1a: 0e 94 9d 60 call 0xc13a ; 0xc13a 15f1e: 20 e0 ldi r18, 0x00 ; 0 15f20: 30 e0 ldi r19, 0x00 ; 0 15f22: 4a e7 ldi r20, 0x7A ; 122 15f24: 54 e4 ldi r21, 0x44 ; 68 15f26: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 15f2a: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 15f2e: 60 93 34 02 sts 0x0234, r22 ; 0x800234 15f32: 70 93 35 02 sts 0x0235, r23 ; 0x800235 15f36: 80 93 36 02 sts 0x0236, r24 ; 0x800236 15f3a: 90 93 37 02 sts 0x0237, r25 ; 0x800237 15f3e: 4e cb rjmp .-2404 ; 0x155dc } 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]))); 15f40: 88 e5 ldi r24, 0x58 ; 88 15f42: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 15f46: 88 23 and r24, r24 15f48: d1 f0 breq .+52 ; 0x15f7e disable_e0(); finishAndDisableSteppers(); } else { st_synchronize(); 15f4a: 0f 94 e8 42 call 0x285d0 ; 0x285d0 if (code_seen('X')) disable_x(); 15f4e: 88 e5 ldi r24, 0x58 ; 88 15f50: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 15f54: 81 11 cpse r24, r1 15f56: 28 c0 rjmp .+80 ; 0x15fa8 if (code_seen('Y')) disable_y(); 15f58: 89 e5 ldi r24, 0x59 ; 89 15f5a: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 15f5e: 88 23 and r24, r24 15f60: 19 f0 breq .+6 ; 0x15f68 15f62: 16 9a sbi 0x02, 6 ; 2 15f64: 10 92 90 06 sts 0x0690, r1 ; 0x800690 if (code_seen('Z')) disable_z(); 15f68: 8a e5 ldi r24, 0x5A ; 90 15f6a: 0e 94 d6 5b call 0xb7ac ; 0xb7ac #if (E0_ENABLE_PIN != X_ENABLE_PIN) // Only enable on boards that have seperate ENABLE_PINS if (code_seen('E')) disable_e0(); 15f6e: 85 e4 ldi r24, 0x45 ; 69 15f70: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 15f74: 88 23 and r24, r24 15f76: 09 f4 brne .+2 ; 0x15f7a 15f78: 31 cb rjmp .-2462 ; 0x155dc 15f7a: 14 9a sbi 0x02, 4 ; 2 15f7c: 2f cb rjmp .-2466 ; 0x155dc 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]))); 15f7e: 89 e5 ldi r24, 0x59 ; 89 15f80: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 15f84: 81 11 cpse r24, r1 15f86: e1 cf rjmp .-62 ; 0x15f4a 15f88: 8a e5 ldi r24, 0x5A ; 90 15f8a: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 15f8e: 81 11 cpse r24, r1 15f90: dc cf rjmp .-72 ; 0x15f4a 15f92: 85 e4 ldi r24, 0x45 ; 69 15f94: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 15f98: 81 11 cpse r24, r1 15f9a: d7 cf rjmp .-82 ; 0x15f4a if(all_axis) { st_synchronize(); 15f9c: 0f 94 e8 42 call 0x285d0 ; 0x285d0 disable_e0(); 15fa0: 14 9a sbi 0x02, 4 ; 2 finishAndDisableSteppers(); 15fa2: 0e 94 68 82 call 0x104d0 ; 0x104d0 15fa6: 1a cb rjmp .-2508 ; 0x155dc } else { st_synchronize(); if (code_seen('X')) disable_x(); 15fa8: 17 9a sbi 0x02, 7 ; 2 15faa: 10 92 8f 06 sts 0x068F, r1 ; 0x80068f 15fae: d4 cf rjmp .-88 ; 0x15f58 #### Parameters - `S` - specifies the time in seconds. If a value of 0 is specified, the timer is disabled. */ case 86: if (code_seen('S')) { 15fb0: 83 e5 ldi r24, 0x53 ; 83 15fb2: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 15fb6: 88 23 and r24, r24 15fb8: 09 f4 brne .+2 ; 0x15fbc 15fba: 10 cb rjmp .-2528 ; 0x155dc safetytimer_inactive_time = code_value() * 1000; 15fbc: 0e 94 9d 60 call 0xc13a ; 0xc13a 15fc0: 20 e0 ldi r18, 0x00 ; 0 15fc2: 30 e0 ldi r19, 0x00 ; 0 15fc4: 4a e7 ldi r20, 0x7A ; 122 15fc6: 54 e4 ldi r21, 0x44 ; 68 15fc8: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 15fcc: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 15fd0: 60 93 30 02 sts 0x0230, r22 ; 0x800230 15fd4: 70 93 31 02 sts 0x0231, r23 ; 0x800231 15fd8: 80 93 32 02 sts 0x0232, r24 ; 0x800232 15fdc: 90 93 33 02 sts 0x0233, r25 ; 0x800233 safetyTimer.start(); 15fe0: 8a ed ldi r24, 0xDA ; 218 15fe2: 95 e0 ldi r25, 0x05 ; 5 15fe4: 0f 94 ef 2b call 0x257de ; 0x257de ::start()> 15fe8: f9 ca rjmp .-2574 ; 0x155dc 15fea: ad ed ldi r26, 0xDD ; 221 15fec: ca 2e mov r12, r26 15fee: a2 e0 ldi r26, 0x02 ; 2 15ff0: da 2e mov r13, r26 15ff2: be eb ldi r27, 0xBE ; 190 15ff4: eb 2e mov r14, r27 15ff6: bd e0 ldi r27, 0x0D ; 13 15ff8: 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++) 15ffa: 10 e0 ldi r17, 0x00 ; 0 { if(code_seen(axis_codes[i])) 15ffc: f6 01 movw r30, r12 15ffe: 81 91 ld r24, Z+ 16000: 6f 01 movw r12, r30 16002: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 16006: 88 23 and r24, r24 16008: 09 f4 brne .+2 ; 0x1600c 1600a: 67 c0 rjmp .+206 ; 0x160da { float value = code_value(); 1600c: 0e 94 9d 60 call 0xc13a ; 0xc13a 16010: 2b 01 movw r4, r22 16012: 3c 01 movw r6, r24 if(i == E_AXIS) { // E 16014: 13 30 cpi r17, 0x03 ; 3 16016: 09 f0 breq .+2 ; 0x1601a 16018: 6a c0 rjmp .+212 ; 0x160ee if(value < 20.0) { 1601a: 20 e0 ldi r18, 0x00 ; 0 1601c: 30 e0 ldi r19, 0x00 ; 0 1601e: 40 ea ldi r20, 0xA0 ; 160 16020: 51 e4 ldi r21, 0x41 ; 65 16022: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 16026: 87 ff sbrs r24, 7 16028: 4e c0 rjmp .+156 ; 0x160c6 const float factor = cs.axis_steps_per_mm[E_AXIS] / value; // increase e constants if M92 E14 is given for netfab. 1602a: a3 01 movw r20, r6 1602c: 92 01 movw r18, r4 1602e: 60 91 ce 0d lds r22, 0x0DCE ; 0x800dce 16032: 70 91 cf 0d lds r23, 0x0DCF ; 0x800dcf 16036: 80 91 d0 0d lds r24, 0x0DD0 ; 0x800dd0 1603a: 90 91 d1 0d lds r25, 0x0DD1 ; 0x800dd1 1603e: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 16042: 4b 01 movw r8, r22 16044: 5c 01 movw r10, r24 cs.max_jerk[E_AXIS] *= factor; 16046: ac 01 movw r20, r24 16048: 9b 01 movw r18, r22 1604a: 60 91 12 0e lds r22, 0x0E12 ; 0x800e12 1604e: 70 91 13 0e lds r23, 0x0E13 ; 0x800e13 16052: 80 91 14 0e lds r24, 0x0E14 ; 0x800e14 16056: 90 91 15 0e lds r25, 0x0E15 ; 0x800e15 1605a: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 1605e: 60 93 12 0e sts 0x0E12, r22 ; 0x800e12 16062: 70 93 13 0e sts 0x0E13, r23 ; 0x800e13 16066: 80 93 14 0e sts 0x0E14, r24 ; 0x800e14 1606a: 90 93 15 0e sts 0x0E15, r25 ; 0x800e15 max_feedrate[E_AXIS] *= factor; 1606e: 20 90 71 02 lds r2, 0x0271 ; 0x800271 16072: 30 90 72 02 lds r3, 0x0272 ; 0x800272 16076: a5 01 movw r20, r10 16078: 94 01 movw r18, r8 1607a: d1 01 movw r26, r2 1607c: 1c 96 adiw r26, 0x0c ; 12 1607e: 6d 91 ld r22, X+ 16080: 7d 91 ld r23, X+ 16082: 8d 91 ld r24, X+ 16084: 9c 91 ld r25, X 16086: 1f 97 sbiw r26, 0x0f ; 15 16088: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 1608c: f1 01 movw r30, r2 1608e: 64 87 std Z+12, r22 ; 0x0c 16090: 75 87 std Z+13, r23 ; 0x0d 16092: 86 87 std Z+14, r24 ; 0x0e 16094: 97 87 std Z+15, r25 ; 0x0f max_acceleration_steps_per_s2[E_AXIS] *= factor; 16096: 60 91 5a 05 lds r22, 0x055A ; 0x80055a 1609a: 70 91 5b 05 lds r23, 0x055B ; 0x80055b 1609e: 80 91 5c 05 lds r24, 0x055C ; 0x80055c 160a2: 90 91 5d 05 lds r25, 0x055D ; 0x80055d 160a6: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 160aa: a5 01 movw r20, r10 160ac: 94 01 movw r18, r8 160ae: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 160b2: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 160b6: 60 93 5a 05 sts 0x055A, r22 ; 0x80055a 160ba: 70 93 5b 05 sts 0x055B, r23 ; 0x80055b 160be: 80 93 5c 05 sts 0x055C, r24 ; 0x80055c 160c2: 90 93 5d 05 sts 0x055D, r25 ; 0x80055d } cs.axis_steps_per_mm[E_AXIS] = value; 160c6: 40 92 ce 0d sts 0x0DCE, r4 ; 0x800dce 160ca: 50 92 cf 0d sts 0x0DCF, r5 ; 0x800dcf 160ce: 60 92 d0 0d sts 0x0DD0, r6 ; 0x800dd0 160d2: 70 92 d1 0d sts 0x0DD1, r7 ; 0x800dd1 #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) fsensor.init(); 160d6: 0f 94 39 7b call 0x2f672 ; 0x2f672 160da: b4 e0 ldi r27, 0x04 ; 4 160dc: eb 0e add r14, r27 160de: f1 1c adc r15, r1 160e0: 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++) 160e2: 14 30 cpi r17, 0x04 ; 4 160e4: 09 f0 breq .+2 ; 0x160e8 160e6: 8a cf rjmp .-236 ; 0x15ffc } else { cs.axis_steps_per_mm[i] = value; } } } reset_acceleration_rates(); 160e8: 0f 94 5f 63 call 0x2c6be ; 0x2c6be 160ec: 77 ca rjmp .-2834 ; 0x155dc 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; 160ee: d7 01 movw r26, r14 160f0: 14 96 adiw r26, 0x04 ; 4 160f2: 4d 92 st X+, r4 160f4: 5d 92 st X+, r5 160f6: 6d 92 st X+, r6 160f8: 7c 92 st X, r7 160fa: 17 97 sbiw r26, 0x07 ; 7 160fc: ee cf rjmp .-36 ; 0x160da #### Parameters - `N` - Line number */ case 110: if (code_seen('N')) 160fe: 8e e4 ldi r24, 0x4E ; 78 16100: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 16104: 88 23 and r24, r24 16106: 09 f4 brne .+2 ; 0x1610a 16108: 69 ca rjmp .-2862 ; 0x155dc gcode_LastN = code_value_long(); 1610a: 0e 94 82 5b call 0xb704 ; 0xb704 1610e: 60 93 7a 03 sts 0x037A, r22 ; 0x80037a 16112: 70 93 7b 03 sts 0x037B, r23 ; 0x80037b 16116: 80 93 7c 03 sts 0x037C, r24 ; 0x80037c 1611a: 90 93 7d 03 sts 0x037D, r25 ; 0x80037d 1611e: 5e ca rjmp .-2884 ; 0x155dc case 113: if (code_seen('S')) { host_keepalive_interval = code_value_uint8(); } else { SERIAL_ECHO_START; 16120: 82 ec ldi r24, 0xC2 ; 194 16122: 9b ea ldi r25, 0xAB ; 171 16124: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHOPAIR("M113 S", (unsigned long)host_keepalive_interval); 16128: c0 90 2f 02 lds r12, 0x022F ; 0x80022f 1612c: d1 2c mov r13, r1 1612e: f1 2c mov r15, r1 16130: 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); } 16132: 8c e1 ldi r24, 0x1C ; 28 16134: 97 e8 ldi r25, 0x87 ; 135 16136: 0e 94 50 77 call 0xeea0 ; 0xeea0 1613a: 4a e0 ldi r20, 0x0A ; 10 1613c: c7 01 movw r24, r14 1613e: b6 01 movw r22, r12 16140: 0f 94 06 d5 call 0x3aa0c ; 0x3aa0c host_keepalive_interval = code_value_uint8(); } else { SERIAL_ECHO_START; SERIAL_ECHOPAIR("M113 S", (unsigned long)host_keepalive_interval); SERIAL_PROTOCOLLN(); 16144: 0f 94 fd d5 call 0x3abfa ; 0x3abfa 16148: 49 ca rjmp .-2926 ; 0x155dc */ case 115: // M115 if (code_seen('V')) { // Report the Prusa version number. SERIAL_PROTOCOLLNRPGM(FW_VERSION_STR_P()); } else if (code_seen('U')) { 1614a: 85 e5 ldi r24, 0x55 ; 85 1614c: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 16150: 88 23 and r24, r24 16152: 09 f4 brne .+2 ; 0x16156 16154: 5a c0 rjmp .+180 ; 0x1620a // 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); 16156: 00 91 95 03 lds r16, 0x0395 ; 0x800395 1615a: 10 91 96 03 lds r17, 0x0396 ; 0x800396 1615e: 0f 5f subi r16, 0xFF ; 255 16160: 1f 4f sbci r17, 0xFF ; 255 16162: 10 93 96 03 sts 0x0396, r17 ; 0x800396 16166: 00 93 95 03 sts 0x0395, r16 ; 0x800395 return false; } bool show_upgrade_dialog_if_version_newer(const char *version_string) { if(oCheckVersion == ClCheckMode::_None) 1616a: 80 91 e9 04 lds r24, 0x04E9 ; 0x8004e9 1616e: 88 23 and r24, r24 16170: 09 f4 brne .+2 ; 0x16174 16172: 34 ca rjmp .-2968 ; 0x155dc // 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)) 16174: be 01 movw r22, r28 16176: 6f 5f subi r22, 0xFF ; 255 16178: 7f 4f sbci r23, 0xFF ; 255 1617a: c8 01 movw r24, r16 1617c: 0e 94 71 ef call 0x1dee2 ; 0x1dee2 16180: 88 23 and r24, r24 16182: 09 f4 brne .+2 ; 0x16186 16184: 2b ca rjmp .-2986 ; 0x155dc 16186: 87 e1 ldi r24, 0x17 ; 23 16188: 9e e8 ldi r25, 0x8E ; 142 1618a: de 01 movw r26, r28 1618c: 11 96 adiw r26, 0x01 ; 1 1618e: be 01 movw r22, r28 16190: 67 5f subi r22, 0xF7 ; 247 16192: 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]); 16194: fc 01 movw r30, r24 16196: 45 91 lpm r20, Z+ 16198: 54 91 lpm r21, Z if (ver_gcode[i] > v) 1619a: 2d 91 ld r18, X+ 1619c: 3d 91 ld r19, X+ 1619e: 42 17 cp r20, r18 161a0: 53 07 cpc r21, r19 161a2: 10 f4 brcc .+4 ; 0x161a8 161a4: 0c 94 5e cc jmp 0x198bc ; 0x198bc return 1; else if (ver_gcode[i] < v) 161a8: 24 17 cp r18, r20 161aa: 35 07 cpc r19, r21 161ac: 08 f4 brcc .+2 ; 0x161b0 161ae: 16 ca rjmp .-3028 ; 0x155dc 161b0: 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) 161b2: a6 17 cp r26, r22 161b4: b7 07 cpc r27, r23 161b6: 71 f7 brne .-36 ; 0x16194 161b8: 11 ca rjmp .-3038 ; 0x155dc 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)); 161ba: 84 e9 ldi r24, 0x94 ; 148 161bc: 99 e3 ldi r25, 0x39 ; 57 161be: 0e 94 ac 72 call 0xe558 ; 0xe558 161c2: ac 01 movw r20, r24 161c4: 63 e0 ldi r22, 0x03 ; 3 161c6: 80 e0 ldi r24, 0x00 ; 0 161c8: 0e 94 f4 6e call 0xdde8 ; 0xdde8 Sound_MakeCustom(50,1000,false); 161cc: 40 e0 ldi r20, 0x00 ; 0 161ce: 68 ee ldi r22, 0xE8 ; 232 161d0: 73 e0 ldi r23, 0x03 ; 3 161d2: 82 e3 ldi r24, 0x32 ; 50 161d4: 90 e0 ldi r25, 0x00 ; 0 161d6: 0f 94 46 51 call 0x2a28c ; 0x2a28c delay_keep_alive(500); 161da: 84 ef ldi r24, 0xF4 ; 244 161dc: 91 e0 ldi r25, 0x01 ; 1 161de: 0e 94 e4 8c call 0x119c8 ; 0x119c8 Sound_MakeCustom(50,1000,false); 161e2: 40 e0 ldi r20, 0x00 ; 0 161e4: 68 ee ldi r22, 0xE8 ; 232 161e6: 73 e0 ldi r23, 0x03 ; 3 161e8: 82 e3 ldi r24, 0x32 ; 50 161ea: 90 e0 ldi r25, 0x00 ; 0 161ec: 0f 94 46 51 call 0x2a28c ; 0x2a28c lcd_wait_for_click_delay(30); 161f0: 8e e1 ldi r24, 0x1E ; 30 161f2: 90 e0 ldi r25, 0x00 ; 0 161f4: 0f 94 2f 3a call 0x2745e ; 0x2745e lcd_update_enable(true); 161f8: 81 e0 ldi r24, 0x01 ; 1 161fa: 0e 94 25 6f call 0xde4a ; 0xde4a lcd_clear(); 161fe: 0e 94 13 6f call 0xde26 ; 0xde26 lcd_update(0); 16202: 80 e0 ldi r24, 0x00 ; 0 16204: 0e 94 a7 6e call 0xdd4e ; 0xdd4e 16208: e9 c9 rjmp .-3118 ; 0x155dc } 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); 1620a: 41 e1 ldi r20, 0x11 ; 17 1620c: 50 e0 ldi r21, 0x00 ; 0 1620e: 60 e8 ldi r22, 0x80 ; 128 16210: 7c e0 ldi r23, 0x0C ; 12 16212: ce 01 movw r24, r28 16214: 01 96 adiw r24, 0x01 ; 1 16216: 0f 94 0c dc call 0x3b818 ; 0x3b818 SERIAL_ECHOPGM("FIRMWARE_NAME:Prusa-Firmware "); 1621a: 8e ef ldi r24, 0xFE ; 254 1621c: 96 e8 ldi r25, 0x86 ; 134 1621e: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHORPGM(FW_VERSION_STR_P()); 16222: 85 e9 ldi r24, 0x95 ; 149 16224: 94 e8 ldi r25, 0x84 ; 132 16226: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHOPGM("+"); 1622a: 8c ef ldi r24, 0xFC ; 252 1622c: 96 e8 ldi r25, 0x86 ; 134 1622e: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHOPGM(STR(FW_COMMITNR)); 16232: 87 ef ldi r24, 0xF7 ; 247 16234: 96 e8 ldi r25, 0x86 ; 134 16236: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHOPGM("_"); 1623a: 85 ef ldi r24, 0xF5 ; 245 1623c: 96 e8 ldi r25, 0x86 ; 134 1623e: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHOPGM(FW_COMMIT_HASH); 16242: 8b ee ldi r24, 0xEB ; 235 16244: 96 e8 ldi r25, 0x86 ; 134 16246: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHOPGM(" based on Marlin FIRMWARE_URL:https://github.com/prusa3d/Prusa-Firmware PROTOCOL_VERSION:"); 1624a: 81 e9 ldi r24, 0x91 ; 145 1624c: 96 e8 ldi r25, 0x86 ; 134 1624e: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHOPGM(PROTOCOL_VERSION); 16252: 8d e8 ldi r24, 0x8D ; 141 16254: 96 e8 ldi r25, 0x86 ; 134 16256: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHOPGM(" MACHINE_TYPE:"); 1625a: 8e e7 ldi r24, 0x7E ; 126 1625c: 96 e8 ldi r25, 0x86 ; 134 1625e: 0e 94 50 77 call 0xeea0 ; 0xeea0 16262: ce 01 movw r24, r28 16264: 01 96 adiw r24, 0x01 ; 1 16266: 0e 94 14 88 call 0x11028 ; 0x11028 SERIAL_PROTOCOL(custom_mendel_name); SERIAL_ECHOPGM(" EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS)); 1626a: 8c e6 ldi r24, 0x6C ; 108 1626c: 96 e8 ldi r25, 0x86 ; 134 1626e: 0e 94 50 77 call 0xeea0 ; 0xeea0 #ifdef MACHINE_UUID SERIAL_ECHOPGM(" UUID:"); SERIAL_ECHOPGM(MACHINE_UUID); #endif //MACHINE_UUID SERIAL_ECHOLNPGM(""); 16272: 8b e6 ldi r24, 0x6B ; 107 16274: 96 e8 ldi r25, 0x86 ; 134 16276: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 } #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'); 1627a: 1f 92 push r1 1627c: f1 e3 ldi r31, 0x31 ; 49 1627e: ff 2e mov r15, r31 16280: ff 92 push r15 16282: 84 e8 ldi r24, 0x84 ; 132 16284: 94 e8 ldi r25, 0x84 ; 132 16286: 9f 93 push r25 16288: 8f 93 push r24 1628a: 0d e3 ldi r16, 0x3D ; 61 1628c: 14 e8 ldi r17, 0x84 ; 132 1628e: 1f 93 push r17 16290: 0f 93 push r16 16292: 0f 94 de da call 0x3b5bc ; 0x3b5bc 16296: 1f 92 push r1 16298: ff 92 push r15 1629a: 84 e7 ldi r24, 0x74 ; 116 1629c: 94 e8 ldi r25, 0x84 ; 132 1629e: 9f 93 push r25 162a0: 8f 93 push r24 162a2: 1f 93 push r17 162a4: 0f 93 push r16 162a6: 0f 94 de da call 0x3b5bc ; 0x3b5bc 162aa: 1f 92 push r1 162ac: ff 92 push r15 162ae: 80 e6 ldi r24, 0x60 ; 96 162b0: 94 e8 ldi r25, 0x84 ; 132 162b2: 9f 93 push r25 162b4: 8f 93 push r24 162b6: 1f 93 push r17 162b8: 0f 93 push r16 162ba: 0f 94 de da call 0x3b5bc ; 0x3b5bc 162be: 1f 92 push r1 162c0: ff 92 push r15 162c2: 83 e5 ldi r24, 0x53 ; 83 162c4: 94 e8 ldi r25, 0x84 ; 132 162c6: 9f 93 push r25 162c8: 8f 93 push r24 162ca: 1f 93 push r17 162cc: 0f 93 push r16 162ce: 0f 94 de da call 0x3b5bc ; 0x3b5bc 162d2: 1f 92 push r1 162d4: ff 92 push r15 162d6: 88 e4 ldi r24, 0x48 ; 72 162d8: 94 e8 ldi r25, 0x84 ; 132 162da: 9f 93 push r25 162dc: 8f 93 push r24 162de: 1f 93 push r17 162e0: 0f 93 push r16 162e2: 0f 94 de da call 0x3b5bc ; 0x3b5bc 162e6: 0f b6 in r0, 0x3f ; 63 162e8: f8 94 cli 162ea: de bf out 0x3e, r29 ; 62 162ec: 0f be out 0x3f, r0 ; 63 162ee: cd bf out 0x3d, r28 ; 61 162f0: 75 c9 rjmp .-3350 ; 0x155dc /*! ### M114 - Get current position M114: Get Current Position */ case 114: gcode_M114(); 162f2: 0e 94 47 78 call 0xf08e ; 0xf08e 162f6: 72 c9 rjmp .-3356 ; 0x155dc /*! ### M117 - Display Message M117: Display Message */ case 117: { const char *src = strchr_pointer + 4; // "M117" 162f8: e0 91 95 03 lds r30, 0x0395 ; 0x800395 162fc: f0 91 96 03 lds r31, 0x0396 ; 0x800396 16300: cf 01 movw r24, r30 16302: 04 96 adiw r24, 0x04 ; 4 lcd_setstatus(*src == ' '? src + 1: src); 16304: 24 81 ldd r18, Z+4 ; 0x04 16306: 20 32 cpi r18, 0x20 ; 32 16308: 09 f4 brne .+2 ; 0x1630c 1630a: 01 96 adiw r24, 0x01 ; 1 1630c: 0e 94 89 f4 call 0x1e912 ; 0x1e912 custom_message_type = CustomMsg::M117; 16310: 87 e0 ldi r24, 0x07 ; 7 16312: 80 93 c4 06 sts 0x06C4, r24 ; 0x8006c4 16316: 62 c9 rjmp .-3388 ; 0x155dc - `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; 16318: 00 91 95 03 lds r16, 0x0395 ; 0x800395 1631c: 10 91 96 03 lds r17, 0x0396 ; 0x800396 16320: 0b 5f subi r16, 0xFB ; 251 16322: 1f 4f sbci r17, 0xFF ; 255 16324: 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; 16326: f1 2c mov r15, r1 16328: 40 e0 ldi r20, 0x00 ; 0 1632a: 81 50 subi r24, 0x01 ; 1 char *p = strchr_pointer + 5; for (uint8_t i = 2; i--;) { 1632c: e9 f0 breq .+58 ; 0x16368 // A1, E1, and Pn are always parsed out if (!((p[0] == 'A' || p[0] == 'E') && p[1] == '1')) break; 1632e: d8 01 movw r26, r16 16330: 9c 91 ld r25, X 16332: 29 2f mov r18, r25 16334: 2b 7f andi r18, 0xFB ; 251 16336: 21 34 cpi r18, 0x41 ; 65 16338: b9 f4 brne .+46 ; 0x16368 1633a: 11 96 adiw r26, 0x01 ; 1 1633c: 2c 91 ld r18, X 1633e: 21 33 cpi r18, 0x31 ; 49 16340: 99 f4 brne .+38 ; 0x16368 switch (p[0]) { 16342: 91 34 cpi r25, 0x41 ; 65 16344: 71 f0 breq .+28 ; 0x16362 16346: 95 34 cpi r25, 0x45 ; 69 16348: 09 f4 brne .+2 ; 0x1634c case 'A': hasA = true; break; case 'E': hasE = true; break; 1634a: 41 e0 ldi r20, 0x01 ; 1 } p += 2; 1634c: 98 01 movw r18, r16 1634e: 2e 5f subi r18, 0xFE ; 254 16350: 3f 4f sbci r19, 0xFF ; 255 16352: 89 01 movw r16, r18 16354: 2f 5f subi r18, 0xFF ; 255 16356: 3f 4f sbci r19, 0xFF ; 255 while (*p == ' ') ++p; 16358: f8 01 movw r30, r16 1635a: 90 81 ld r25, Z 1635c: 90 32 cpi r25, 0x20 ; 32 1635e: c9 f3 breq .-14 ; 0x16352 16360: e4 cf rjmp .-56 ; 0x1632a 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; 16362: ff 24 eor r15, r15 16364: f3 94 inc r15 16366: f2 cf rjmp .-28 ; 0x1634c } p += 2; while (*p == ' ') ++p; } if (hasE) SERIAL_ECHO_START; 16368: 44 23 and r20, r20 1636a: 21 f0 breq .+8 ; 0x16374 1636c: 82 ec ldi r24, 0xC2 ; 194 1636e: 9b ea ldi r25, 0xAB ; 171 16370: 0e 94 50 77 call 0xeea0 ; 0xeea0 if (hasA) SERIAL_ECHOPGM("//"); 16374: ff 20 and r15, r15 16376: 21 f0 breq .+8 ; 0x16380 16378: 88 e6 ldi r24, 0x68 ; 104 1637a: 96 e8 ldi r25, 0x86 ; 134 1637c: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHOLN(p); 16380: c8 01 movw r24, r16 16382: 0f 94 00 d6 call 0x3ac00 ; 0x3ac00 16386: 2a c9 rjmp .-3500 ; 0x155dc /*! ### 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 16388: 8c e4 ldi r24, 0x4C ; 76 1638a: 98 e6 ldi r25, 0x68 ; 104 1638c: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_PROTOCOLLN(); 16390: 0f 94 fd d5 call 0x3abfa ; 0x3abfa #if defined(X_MIN_PIN) && X_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(_n("x_min: "));////MSG_X_MIN 16394: 84 e4 ldi r24, 0x44 ; 68 16396: 98 e6 ldi r25, 0x68 ; 104 16398: 0e 94 50 77 call 0xeea0 ; 0xeea0 if(READ(X_MIN_PIN)^X_MIN_ENDSTOP_INVERTING){ 1639c: 1e 99 sbic 0x03, 6 ; 3 1639e: 47 c0 rjmp .+142 ; 0x1642e SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 163a0: 8f e3 ldi r24, 0x3F ; 63 163a2: 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); 163a4: 0e 94 50 77 call 0xeea0 ; 0xeea0 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 163a8: 0f 94 fd d5 call 0x3abfa ; 0x3abfa #endif #if defined(X_MAX_PIN) && X_MAX_PIN > -1 SERIAL_PROTOCOLRPGM(_n("x_max: "));////MSG_X_MAX 163ac: 8d e2 ldi r24, 0x2D ; 45 163ae: 98 e6 ldi r25, 0x68 ; 104 163b0: 0e 94 50 77 call 0xeea0 ; 0xeea0 if(READ(X_MAX_PIN)^X_MAX_ENDSTOP_INVERTING){ 163b4: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 163b8: 82 fd sbrc r24, 2 163ba: 3c c0 rjmp .+120 ; 0x16434 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 163bc: 8f e3 ldi r24, 0x3F ; 63 163be: 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); 163c0: 0e 94 50 77 call 0xeea0 ; 0xeea0 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 163c4: 0f 94 fd d5 call 0x3abfa ; 0x3abfa #endif #if defined(Y_MIN_PIN) && Y_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(_n("y_min: "));////MSG_Y_MIN 163c8: 85 e2 ldi r24, 0x25 ; 37 163ca: 98 e6 ldi r25, 0x68 ; 104 163cc: 0e 94 50 77 call 0xeea0 ; 0xeea0 if(READ(Y_MIN_PIN)^Y_MIN_ENDSTOP_INVERTING){ 163d0: 1d 99 sbic 0x03, 5 ; 3 163d2: 33 c0 rjmp .+102 ; 0x1643a SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 163d4: 8f e3 ldi r24, 0x3F ; 63 163d6: 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); 163d8: 0e 94 50 77 call 0xeea0 ; 0xeea0 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 163dc: 0f 94 fd d5 call 0x3abfa ; 0x3abfa #endif #if defined(Y_MAX_PIN) && Y_MAX_PIN > -1 SERIAL_PROTOCOLRPGM(_n("y_max: "));////MSG_Y_MAX 163e0: 8d e1 ldi r24, 0x1D ; 29 163e2: 98 e6 ldi r25, 0x68 ; 104 163e4: 0e 94 50 77 call 0xeea0 ; 0xeea0 if(READ(Y_MAX_PIN)^Y_MAX_ENDSTOP_INVERTING){ 163e8: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 163ec: 87 fd sbrc r24, 7 163ee: 28 c0 rjmp .+80 ; 0x16440 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 163f0: 8f e3 ldi r24, 0x3F ; 63 163f2: 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); 163f4: 0e 94 50 77 call 0xeea0 ; 0xeea0 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 163f8: 0f 94 fd d5 call 0x3abfa ; 0x3abfa #endif #if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(MSG_Z_MIN); 163fc: 85 e1 ldi r24, 0x15 ; 21 163fe: 98 e6 ldi r25, 0x68 ; 104 16400: 0e 94 50 77 call 0xeea0 ; 0xeea0 if(READ(Z_MIN_PIN)^Z_MIN_ENDSTOP_INVERTING){ 16404: 1c 99 sbic 0x03, 4 ; 3 16406: 1f c0 rjmp .+62 ; 0x16446 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 16408: 8f e3 ldi r24, 0x3F ; 63 1640a: 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); 1640c: 0e 94 50 77 call 0xeea0 ; 0xeea0 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 16410: 0f 94 fd d5 call 0x3abfa ; 0x3abfa #endif #if defined(Z_MAX_PIN) && Z_MAX_PIN > -1 SERIAL_PROTOCOLRPGM(MSG_Z_MAX); 16414: 8d e0 ldi r24, 0x0D ; 13 16416: 98 e6 ldi r25, 0x68 ; 104 16418: 0e 94 50 77 call 0xeea0 ; 0xeea0 if(READ(Z_MAX_PIN)^Z_MAX_ENDSTOP_INVERTING){ 1641c: 01 9b sbis 0x00, 1 ; 0 1641e: 16 c0 rjmp .+44 ; 0x1644c SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 16420: 8f e3 ldi r24, 0x3F ; 63 16422: 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); 16424: 0e 94 50 77 call 0xeea0 ; 0xeea0 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 16428: 0f 94 fd d5 call 0x3abfa ; 0x3abfa 1642c: d7 c8 rjmp .-3666 ; 0x155dc 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); 1642e: 85 e3 ldi r24, 0x35 ; 53 16430: 98 e6 ldi r25, 0x68 ; 104 16432: b8 cf rjmp .-144 ; 0x163a4 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); 16434: 85 e3 ldi r24, 0x35 ; 53 16436: 98 e6 ldi r25, 0x68 ; 104 16438: c3 cf rjmp .-122 ; 0x163c0 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); 1643a: 85 e3 ldi r24, 0x35 ; 53 1643c: 98 e6 ldi r25, 0x68 ; 104 1643e: cc cf rjmp .-104 ; 0x163d8 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); 16440: 85 e3 ldi r24, 0x35 ; 53 16442: 98 e6 ldi r25, 0x68 ; 104 16444: d7 cf rjmp .-82 ; 0x163f4 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); 16446: 85 e3 ldi r24, 0x35 ; 53 16448: 98 e6 ldi r25, 0x68 ; 104 1644a: e0 cf rjmp .-64 ; 0x1640c 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); 1644c: 85 e3 ldi r24, 0x35 ; 53 1644e: 98 e6 ldi r25, 0x68 ; 104 16450: e9 cf rjmp .-46 ; 0x16424 E0:3240 RPM PRN1:4560 RPM E0@:255 PRN1@:255 */ case 123: gcode_M123(); 16452: 0e 94 84 66 call 0xcd08 ; 0xcd08 16456: c2 c8 rjmp .-3708 ; 0x155dc */ 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')) { 16458: 84 e5 ldi r24, 0x54 ; 84 1645a: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 1645e: 88 23 and r24, r24 16460: 69 f0 breq .+26 ; 0x1647c extruder = code_value_uint8(); 16462: 0e 94 68 5b call 0xb6d0 ; 0xb6d0 if(extruder >= EXTRUDERS) { 16466: 88 23 and r24, r24 16468: 49 f0 breq .+18 ; 0x1647c SERIAL_ECHO_START; 1646a: 82 ec ldi r24, 0xC2 ; 194 1646c: 9b ea ldi r25, 0xAB ; 171 1646e: 0e 94 50 77 call 0xeea0 ; 0xeea0 16472: 86 ef ldi r24, 0xF6 ; 246 16474: 97 e6 ldi r25, 0x67 ; 103 16476: 0e 94 14 88 call 0x11028 ; 0x11028 1647a: b0 c8 rjmp .-3744 ; 0x155dc SERIAL_ECHO(_n("M200 Invalid extruder "));////MSG_M200_INVALID_EXTRUDER break; } } if(code_seen('D')) { 1647c: 84 e4 ldi r24, 0x44 ; 68 1647e: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 16482: 88 23 and r24, r24 16484: 09 f4 brne .+2 ; 0x16488 16486: aa c8 rjmp .-3756 ; 0x155dc float diameter = code_value(); 16488: 0e 94 9d 60 call 0xc13a ; 0xc13a if (diameter == 0.0) { 1648c: 20 e0 ldi r18, 0x00 ; 0 1648e: 30 e0 ldi r19, 0x00 ; 0 16490: a9 01 movw r20, r18 16492: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 16496: 81 11 cpse r24, r1 16498: 05 c0 rjmp .+10 ; 0x164a4 // 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; 1649a: 10 92 55 0e sts 0x0E55, r1 ; 0x800e55 } } else { //reserved for setting filament diameter via UFID or filament measuring device break; } calculate_extruder_multipliers(); 1649e: 0e 94 b9 65 call 0xcb72 ; 0xcb72 164a2: 9c c8 rjmp .-3784 ; 0x155dc // 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(); 164a4: 0e 94 9d 60 call 0xc13a ; 0xc13a 164a8: 6b 01 movw r12, r22 164aa: 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]); 164ac: 20 e0 ldi r18, 0x00 ; 0 164ae: 30 e0 ldi r19, 0x00 ; 0 164b0: a9 01 movw r20, r18 164b2: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 164b6: 81 11 cpse r24, r1 164b8: 06 c0 rjmp .+12 ; 0x164c6 164ba: c1 2c mov r12, r1 164bc: d1 2c mov r13, r1 164be: e0 ee ldi r30, 0xE0 ; 224 164c0: ee 2e mov r14, r30 164c2: ef e3 ldi r30, 0x3F ; 63 164c4: fe 2e mov r15, r30 164c6: c0 92 56 0e sts 0x0E56, r12 ; 0x800e56 164ca: d0 92 57 0e sts 0x0E57, r13 ; 0x800e57 164ce: e0 92 58 0e sts 0x0E58, r14 ; 0x800e58 164d2: f0 92 59 0e sts 0x0E59, r15 ; 0x800e59 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; 164d6: 81 e0 ldi r24, 0x01 ; 1 164d8: 80 93 55 0e sts 0x0E55, r24 ; 0x800e55 164dc: e0 cf rjmp .-64 ; 0x1649e 164de: 6d ed ldi r22, 0xDD ; 221 164e0: c6 2e mov r12, r22 164e2: 62 e0 ldi r22, 0x02 ; 2 164e4: d6 2e mov r13, r22 164e6: 7e eb ldi r23, 0xBE ; 190 164e8: e7 2e mov r14, r23 164ea: 7d e0 ldi r23, 0x0D ; 13 164ec: 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++) 164ee: 10 e0 ldi r17, 0x00 ; 0 { if (code_seen(axis_codes[i])) 164f0: d6 01 movw r26, r12 164f2: 8d 91 ld r24, X+ 164f4: 6d 01 movw r12, r26 164f6: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 164fa: 88 23 and r24, r24 164fc: 41 f1 breq .+80 ; 0x1654e { unsigned long val = code_value(); 164fe: 0e 94 9d 60 call 0xc13a ; 0xc13a 16502: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> #ifdef TMC2130 unsigned long val_silent = val; if ((i == X_AXIS) || (i == Y_AXIS)) 16506: 12 30 cpi r17, 0x02 ; 2 16508: 4c f5 brge .+82 ; 0x1655c { if (val > NORMAL_MAX_ACCEL_XY) 1650a: 65 3c cpi r22, 0xC5 ; 197 1650c: b9 e0 ldi r27, 0x09 ; 9 1650e: 7b 07 cpc r23, r27 16510: 81 05 cpc r24, r1 16512: 91 05 cpc r25, r1 16514: 40 f5 brcc .+80 ; 0x16566 16516: 56 2f mov r21, r22 16518: 47 2f mov r20, r23 1651a: 38 2f mov r19, r24 1651c: 29 2f mov r18, r25 1651e: 61 3c cpi r22, 0xC1 ; 193 16520: e3 e0 ldi r30, 0x03 ; 3 16522: 7e 07 cpc r23, r30 16524: 81 05 cpc r24, r1 16526: 91 05 cpc r25, r1 16528: 20 f0 brcs .+8 ; 0x16532 1652a: 50 ec ldi r21, 0xC0 ; 192 1652c: 43 e0 ldi r20, 0x03 ; 3 1652e: 30 e0 ldi r19, 0x00 ; 0 16530: 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; 16532: d7 01 movw r26, r14 16534: 94 96 adiw r26, 0x24 ; 36 16536: 6d 93 st X+, r22 16538: 7d 93 st X+, r23 1653a: 8d 93 st X+, r24 1653c: 9c 93 st X, r25 1653e: 97 97 sbiw r26, 0x27 ; 39 cs.max_acceleration_mm_per_s2_silent[i] = val_silent; 16540: f7 01 movw r30, r14 16542: e4 55 subi r30, 0x54 ; 84 16544: ff 4f sbci r31, 0xFF ; 255 16546: 50 83 st Z, r21 16548: 41 83 std Z+1, r20 ; 0x01 1654a: 32 83 std Z+2, r19 ; 0x02 1654c: 23 83 std Z+3, r18 ; 0x03 1654e: b4 e0 ldi r27, 0x04 ; 4 16550: eb 0e add r14, r27 16552: f1 1c adc r15, r1 16554: 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++) 16556: 14 30 cpi r17, 0x04 ; 4 16558: 59 f6 brne .-106 ; 0x164f0 1655a: c6 cd rjmp .-1140 ; 0x160e8 { if (code_seen(axis_codes[i])) { unsigned long val = code_value(); 1655c: 56 2f mov r21, r22 1655e: 47 2f mov r20, r23 16560: 38 2f mov r19, r24 16562: 29 2f mov r18, r25 16564: e6 cf rjmp .-52 ; 0x16532 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; 16566: 50 ec ldi r21, 0xC0 ; 192 16568: 43 e0 ldi r20, 0x03 ; 3 1656a: 30 e0 ldi r19, 0x00 ; 0 1656c: 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; 1656e: 64 ec ldi r22, 0xC4 ; 196 16570: 79 e0 ldi r23, 0x09 ; 9 16572: 80 e0 ldi r24, 0x00 ; 0 16574: 90 e0 ldi r25, 0x00 ; 0 16576: dd cf rjmp .-70 ; 0x16532 16578: 4d ed ldi r20, 0xDD ; 221 1657a: a4 2e mov r10, r20 1657c: 42 e0 ldi r20, 0x02 ; 2 1657e: b4 2e mov r11, r20 16580: 5e eb ldi r21, 0xBE ; 190 16582: c5 2e mov r12, r21 16584: 5d e0 ldi r21, 0x0D ; 13 16586: 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++) 16588: 91 2c mov r9, r1 { if (code_seen(axis_codes[i])) 1658a: f5 01 movw r30, r10 1658c: 81 91 ld r24, Z+ 1658e: 5f 01 movw r10, r30 16590: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 16594: 88 23 and r24, r24 16596: 71 f1 breq .+92 ; 0x165f4 { float val = code_value(); 16598: 0e 94 9d 60 call 0xc13a ; 0xc13a 1659c: 7b 01 movw r14, r22 1659e: 8c 01 movw r16, r24 #ifdef TMC2130 float val_silent = val; if ((i == X_AXIS) || (i == Y_AXIS)) 165a0: f1 e0 ldi r31, 0x01 ; 1 165a2: f9 15 cp r31, r9 165a4: b8 f1 brcs .+110 ; 0x16614 { if (val > NORMAL_MAX_FEEDRATE_XY) 165a6: 20 e0 ldi r18, 0x00 ; 0 165a8: 30 e0 ldi r19, 0x00 ; 0 165aa: 48 e4 ldi r20, 0x48 ; 72 165ac: 53 e4 ldi r21, 0x43 ; 67 165ae: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 165b2: 18 16 cp r1, r24 165b4: 44 f1 brlt .+80 ; 0x16606 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(); 165b6: 5e 2c mov r5, r14 165b8: 6f 2c mov r6, r15 165ba: 70 2e mov r7, r16 165bc: 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) 165be: 20 e0 ldi r18, 0x00 ; 0 165c0: 30 e0 ldi r19, 0x00 ; 0 165c2: 48 ec ldi r20, 0xC8 ; 200 165c4: 52 e4 ldi r21, 0x42 ; 66 165c6: b7 01 movw r22, r14 165c8: c8 01 movw r24, r16 165ca: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 165ce: 18 16 cp r1, r24 165d0: 34 f1 brlt .+76 ; 0x1661e val_silent = SILENT_MAX_FEEDRATE_XY; } cs.max_feedrate_normal[i] = val; 165d2: 85 2d mov r24, r5 165d4: 96 2d mov r25, r6 165d6: a7 2d mov r26, r7 165d8: b8 2d mov r27, r8 165da: f6 01 movw r30, r12 165dc: 84 8b std Z+20, r24 ; 0x14 165de: 95 8b std Z+21, r25 ; 0x15 165e0: a6 8b std Z+22, r26 ; 0x16 165e2: b7 8b std Z+23, r27 ; 0x17 cs.max_feedrate_silent[i] = val_silent; 165e4: c7 01 movw r24, r14 165e6: d8 01 movw r26, r16 165e8: e4 56 subi r30, 0x64 ; 100 165ea: ff 4f sbci r31, 0xFF ; 255 165ec: 80 83 st Z, r24 165ee: 91 83 std Z+1, r25 ; 0x01 165f0: a2 83 std Z+2, r26 ; 0x02 165f2: 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++) 165f4: 93 94 inc r9 165f6: f4 e0 ldi r31, 0x04 ; 4 165f8: cf 0e add r12, r31 165fa: d1 1c adc r13, r1 165fc: 24 e0 ldi r18, 0x04 ; 4 165fe: 92 12 cpse r9, r18 16600: c4 cf rjmp .-120 ; 0x1658a 16602: 0c 94 ee aa jmp 0x155dc ; 0x155dc #ifdef TMC2130 float val_silent = val; if ((i == X_AXIS) || (i == Y_AXIS)) { if (val > NORMAL_MAX_FEEDRATE_XY) val = NORMAL_MAX_FEEDRATE_XY; 16606: 51 2c mov r5, r1 16608: 61 2c mov r6, r1 1660a: 28 e4 ldi r18, 0x48 ; 72 1660c: 72 2e mov r7, r18 1660e: 33 e4 ldi r19, 0x43 ; 67 16610: 83 2e mov r8, r19 16612: d5 cf rjmp .-86 ; 0x165be 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(); 16614: 56 2e mov r5, r22 16616: 6f 2c mov r6, r15 16618: 78 2e mov r7, r24 1661a: 81 2e mov r8, r17 1661c: da cf rjmp .-76 ; 0x165d2 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; 1661e: e1 2c mov r14, r1 16620: f1 2c mov r15, r1 16622: 08 ec ldi r16, 0xC8 ; 200 16624: 12 e4 ldi r17, 0x42 ; 66 16626: d5 cf rjmp .-86 ; 0x165d2 // 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')) 16628: 80 e5 ldi r24, 0x50 ; 80 1662a: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 1662e: 88 23 and r24, r24 16630: 51 f0 breq .+20 ; 0x16646 cs.acceleration = code_value(); 16632: 0e 94 9d 60 call 0xc13a ; 0xc13a 16636: 60 93 f2 0d sts 0x0DF2, r22 ; 0x800df2 1663a: 70 93 f3 0d sts 0x0DF3, r23 ; 0x800df3 1663e: 80 93 f4 0d sts 0x0DF4, r24 ; 0x800df4 16642: 90 93 f5 0d sts 0x0DF5, r25 ; 0x800df5 if(code_seen('R')) 16646: 82 e5 ldi r24, 0x52 ; 82 16648: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 1664c: 88 23 and r24, r24 1664e: 51 f0 breq .+20 ; 0x16664 cs.retract_acceleration = code_value(); 16650: 0e 94 9d 60 call 0xc13a ; 0xc13a 16654: 60 93 f6 0d sts 0x0DF6, r22 ; 0x800df6 16658: 70 93 f7 0d sts 0x0DF7, r23 ; 0x800df7 1665c: 80 93 f8 0d sts 0x0DF8, r24 ; 0x800df8 16660: 90 93 f9 0d sts 0x0DF9, r25 ; 0x800df9 if(code_seen('T')) 16664: 84 e5 ldi r24, 0x54 ; 84 16666: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 1666a: 88 23 and r24, r24 1666c: 11 f4 brne .+4 ; 0x16672 1666e: 0c 94 ee aa jmp 0x155dc ; 0x155dc cs.travel_acceleration = code_value(); 16672: 0e 94 9d 60 call 0xc13a ; 0xc13a 16676: 60 93 7e 0e sts 0x0E7E, r22 ; 0x800e7e 1667a: 70 93 7f 0e sts 0x0E7F, r23 ; 0x800e7f 1667e: 80 93 80 0e sts 0x0E80, r24 ; 0x800e80 16682: 90 93 81 0e sts 0x0E81, r25 ; 0x800e81 16686: 0c 94 ee aa jmp 0x155dc ; 0x155dc - `Z` - Maximum Z jerk (units/s) - `E` - Maximum E jerk (units/s) */ case 205: { if(code_seen('S')) cs.minimumfeedrate = code_value(); 1668a: 83 e5 ldi r24, 0x53 ; 83 1668c: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 16690: 88 23 and r24, r24 16692: 51 f0 breq .+20 ; 0x166a8 16694: 0e 94 9d 60 call 0xc13a ; 0xc13a 16698: 60 93 fa 0d sts 0x0DFA, r22 ; 0x800dfa 1669c: 70 93 fb 0d sts 0x0DFB, r23 ; 0x800dfb 166a0: 80 93 fc 0d sts 0x0DFC, r24 ; 0x800dfc 166a4: 90 93 fd 0d sts 0x0DFD, r25 ; 0x800dfd if(code_seen('T')) cs.mintravelfeedrate = code_value(); 166a8: 84 e5 ldi r24, 0x54 ; 84 166aa: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 166ae: 88 23 and r24, r24 166b0: 51 f0 breq .+20 ; 0x166c6 166b2: 0e 94 9d 60 call 0xc13a ; 0xc13a 166b6: 60 93 fe 0d sts 0x0DFE, r22 ; 0x800dfe 166ba: 70 93 ff 0d sts 0x0DFF, r23 ; 0x800dff 166be: 80 93 00 0e sts 0x0E00, r24 ; 0x800e00 166c2: 90 93 01 0e sts 0x0E01, r25 ; 0x800e01 if(code_seen('B')) cs.min_segment_time_us = (uint32_t)code_value(); 166c6: 82 e4 ldi r24, 0x42 ; 66 166c8: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 166cc: 88 23 and r24, r24 166ce: 61 f0 breq .+24 ; 0x166e8 166d0: 0e 94 9d 60 call 0xc13a ; 0xc13a 166d4: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 166d8: 60 93 02 0e sts 0x0E02, r22 ; 0x800e02 166dc: 70 93 03 0e sts 0x0E03, r23 ; 0x800e03 166e0: 80 93 04 0e sts 0x0E04, r24 ; 0x800e04 166e4: 90 93 05 0e sts 0x0E05, r25 ; 0x800e05 if(code_seen('X')) cs.max_jerk[X_AXIS] = cs.max_jerk[Y_AXIS] = code_value(); 166e8: 88 e5 ldi r24, 0x58 ; 88 166ea: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 166ee: 88 23 and r24, r24 166f0: 91 f0 breq .+36 ; 0x16716 166f2: 0e 94 9d 60 call 0xc13a ; 0xc13a 166f6: 60 93 0a 0e sts 0x0E0A, r22 ; 0x800e0a 166fa: 70 93 0b 0e sts 0x0E0B, r23 ; 0x800e0b 166fe: 80 93 0c 0e sts 0x0E0C, r24 ; 0x800e0c 16702: 90 93 0d 0e sts 0x0E0D, r25 ; 0x800e0d 16706: 60 93 06 0e sts 0x0E06, r22 ; 0x800e06 1670a: 70 93 07 0e sts 0x0E07, r23 ; 0x800e07 1670e: 80 93 08 0e sts 0x0E08, r24 ; 0x800e08 16712: 90 93 09 0e sts 0x0E09, r25 ; 0x800e09 if(code_seen('Y')) cs.max_jerk[Y_AXIS] = code_value(); 16716: 89 e5 ldi r24, 0x59 ; 89 16718: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 1671c: 88 23 and r24, r24 1671e: 51 f0 breq .+20 ; 0x16734 16720: 0e 94 9d 60 call 0xc13a ; 0xc13a 16724: 60 93 0a 0e sts 0x0E0A, r22 ; 0x800e0a 16728: 70 93 0b 0e sts 0x0E0B, r23 ; 0x800e0b 1672c: 80 93 0c 0e sts 0x0E0C, r24 ; 0x800e0c 16730: 90 93 0d 0e sts 0x0E0D, r25 ; 0x800e0d if(code_seen('Z')) cs.max_jerk[Z_AXIS] = code_value(); 16734: 8a e5 ldi r24, 0x5A ; 90 16736: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 1673a: 88 23 and r24, r24 1673c: 51 f0 breq .+20 ; 0x16752 1673e: 0e 94 9d 60 call 0xc13a ; 0xc13a 16742: 60 93 0e 0e sts 0x0E0E, r22 ; 0x800e0e 16746: 70 93 0f 0e sts 0x0E0F, r23 ; 0x800e0f 1674a: 80 93 10 0e sts 0x0E10, r24 ; 0x800e10 1674e: 90 93 11 0e sts 0x0E11, r25 ; 0x800e11 if(code_seen('E')) 16752: 85 e4 ldi r24, 0x45 ; 69 16754: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 16758: 88 23 and r24, r24 1675a: 11 f4 brne .+4 ; 0x16760 1675c: 0c 94 ee aa jmp 0x155dc ; 0x155dc { float e = code_value(); 16760: 0e 94 9d 60 call 0xc13a ; 0xc13a #ifndef LA_NOCOMPAT e = la10c_jerk(e); 16764: 0e 94 b2 81 call 0x10364 ; 0x10364 #endif cs.max_jerk[E_AXIS] = e; 16768: 60 93 12 0e sts 0x0E12, r22 ; 0x800e12 1676c: 70 93 13 0e sts 0x0E13, r23 ; 0x800e13 16770: 80 93 14 0e sts 0x0E14, r24 ; 0x800e14 16774: 90 93 15 0e sts 0x0E15, r25 ; 0x800e15 16778: 0c 94 ee aa jmp 0x155dc ; 0x155dc 1677c: 0d ed ldi r16, 0xDD ; 221 1677e: 12 e0 ldi r17, 0x02 ; 2 16780: 86 e1 ldi r24, 0x16 ; 22 16782: e8 2e mov r14, r24 16784: 8e e0 ldi r24, 0x0E ; 14 16786: f8 2e mov r15, r24 16788: 90 ee ldi r25, 0xE0 ; 224 1678a: c9 2e mov r12, r25 1678c: 92 e0 ldi r25, 0x02 ; 2 1678e: 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(); 16790: d8 01 movw r26, r16 16792: 8d 91 ld r24, X+ 16794: 8d 01 movw r16, r26 16796: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 1679a: 88 23 and r24, r24 1679c: 39 f0 breq .+14 ; 0x167ac 1679e: 0e 94 9d 60 call 0xc13a ; 0xc13a 167a2: f7 01 movw r30, r14 167a4: 60 83 st Z, r22 167a6: 71 83 std Z+1, r23 ; 0x01 167a8: 82 83 std Z+2, r24 ; 0x02 167aa: 93 83 std Z+3, r25 ; 0x03 167ac: f4 e0 ldi r31, 0x04 ; 4 167ae: ef 0e add r14, r31 167b0: 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++) 167b2: c0 16 cp r12, r16 167b4: d1 06 cpc r13, r17 167b6: 61 f7 brne .-40 ; 0x16790 167b8: 0c 94 ee aa jmp 0x155dc ; 0x155dc - `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')) 167bc: 83 e5 ldi r24, 0x53 ; 83 167be: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 167c2: 88 23 and r24, r24 167c4: 51 f0 breq .+20 ; 0x167da { cs.retract_recover_length = code_value() ; 167c6: 0e 94 9d 60 call 0xc13a ; 0xc13a 167ca: 60 93 4d 0e sts 0x0E4D, r22 ; 0x800e4d 167ce: 70 93 4e 0e sts 0x0E4E, r23 ; 0x800e4e 167d2: 80 93 4f 0e sts 0x0E4F, r24 ; 0x800e4f 167d6: 90 93 50 0e sts 0x0E50, r25 ; 0x800e50 } if(code_seen('F')) 167da: 86 e4 ldi r24, 0x46 ; 70 167dc: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 167e0: 88 23 and r24, r24 167e2: 11 f4 brne .+4 ; 0x167e8 167e4: 0c 94 ee aa jmp 0x155dc ; 0x155dc { cs.retract_recover_feedrate = get_feedrate_mm_s(code_value()); 167e8: 0e 94 9d 60 call 0xc13a ; 0xc13a 167ec: 0e 94 c7 66 call 0xcd8e ; 0xcd8e 167f0: 60 93 51 0e sts 0x0E51, r22 ; 0x800e51 167f4: 70 93 52 0e sts 0x0E52, r23 ; 0x800e52 167f8: 80 93 53 0e sts 0x0E53, r24 ; 0x800e53 167fc: 90 93 54 0e sts 0x0E54, r25 ; 0x800e54 16800: 0c 94 ee aa jmp 0x155dc ; 0x155dc #### 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')) 16804: 83 e5 ldi r24, 0x53 ; 83 16806: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 1680a: 88 23 and r24, r24 1680c: 11 f4 brne .+4 ; 0x16812 1680e: 0c 94 ee aa jmp 0x155dc ; 0x155dc { switch(code_value_uint8()) 16812: 0e 94 68 5b call 0xb6d0 ; 0xb6d0 16816: 88 23 and r24, r24 16818: c1 f0 breq .+48 ; 0x1684a 1681a: 81 30 cpi r24, 0x01 ; 1 1681c: e1 f0 breq .+56 ; 0x16856 #if EXTRUDERS > 2 retracted[2]=false; #endif }break; default: SERIAL_ECHO_START; 1681e: 82 ec ldi r24, 0xC2 ; 194 16820: 9b ea ldi r25, 0xAB ; 171 16822: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); 16826: 83 ee ldi r24, 0xE3 ; 227 16828: 97 e6 ldi r25, 0x67 ; 103 1682a: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); 1682e: 80 91 92 12 lds r24, 0x1292 ; 0x801292 16832: 90 91 93 12 lds r25, 0x1293 ; 0x801293 16836: 88 55 subi r24, 0x58 ; 88 16838: 9f 4e sbci r25, 0xEF ; 239 1683a: 0e 94 14 88 call 0x11028 ; 0x11028 SERIAL_ECHOLNPGM("\"(1)"); 1683e: 83 e6 ldi r24, 0x63 ; 99 16840: 96 e8 ldi r25, 0x86 ; 134 16842: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 16846: 0c 94 ee aa jmp 0x155dc ; 0x155dc { switch(code_value_uint8()) { case 0: { cs.autoretract_enabled=false; 1684a: 10 92 40 0e sts 0x0E40, r1 ; 0x800e40 retracted[0]=false; 1684e: 10 92 8e 06 sts 0x068E, r1 ; 0x80068e 16852: 0c 94 ee aa jmp 0x155dc ; 0x155dc retracted[2]=false; #endif }break; case 1: { cs.autoretract_enabled=true; 16856: 80 93 40 0e sts 0x0E40, r24 ; 0x800e40 retracted[0]=false; 1685a: 10 92 8e 06 sts 0x068E, r1 ; 0x80068e 1685e: 0c 94 ee aa jmp 0x155dc ; 0x155dc 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; 16862: 40 90 82 0e lds r4, 0x0E82 ; 0x800e82 16866: 50 90 83 0e lds r5, 0x0E83 ; 0x800e83 1686a: 60 90 84 0e lds r6, 0x0E84 ; 0x800e84 1686e: 70 90 85 0e lds r7, 0x0E85 ; 0x800e85 16872: 0c 94 4b a8 jmp 0x15096 ; 0x15096 float s = code_seen('S') ? code_value() : cs.min_mm_per_arc_segment; 16876: 80 90 86 0e lds r8, 0x0E86 ; 0x800e86 1687a: 90 90 87 0e lds r9, 0x0E87 ; 0x800e87 1687e: a0 90 88 0e lds r10, 0x0E88 ; 0x800e88 16882: b0 90 89 0e lds r11, 0x0E89 ; 0x800e89 16886: 0c 94 56 a8 jmp 0x150ac ; 0x150ac - `R` - Restore previous speed factor */ case 220: { bool codesWereSeen = false; if (code_seen('B')) //backup current speed factor 1688a: 82 e4 ldi r24, 0x42 ; 66 1688c: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 16890: 18 2f mov r17, r24 16892: 88 23 and r24, r24 16894: 41 f0 breq .+16 ; 0x168a6 { saved_feedmultiply_mm = feedmultiply; 16896: 80 91 39 02 lds r24, 0x0239 ; 0x800239 1689a: 90 91 3a 02 lds r25, 0x023A ; 0x80023a 1689e: 90 93 2e 02 sts 0x022E, r25 ; 0x80022e 168a2: 80 93 2d 02 sts 0x022D, r24 ; 0x80022d codesWereSeen = true; } if (code_seen('S')) 168a6: 83 e5 ldi r24, 0x53 ; 83 168a8: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 168ac: 08 2f mov r16, r24 168ae: 88 23 and r24, r24 168b0: 39 f0 breq .+14 ; 0x168c0 { feedmultiply = code_value_short(); 168b2: 0e 94 75 5b call 0xb6ea ; 0xb6ea 168b6: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a 168ba: 80 93 39 02 sts 0x0239, r24 ; 0x800239 codesWereSeen = true; 168be: 10 2f mov r17, r16 } if (code_seen('R')) //restore previous feedmultiply 168c0: 82 e5 ldi r24, 0x52 ; 82 168c2: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 168c6: 88 23 and r24, r24 168c8: 51 f0 breq .+20 ; 0x168de { feedmultiply = saved_feedmultiply_mm; 168ca: 80 91 2d 02 lds r24, 0x022D ; 0x80022d 168ce: 90 91 2e 02 lds r25, 0x022E ; 0x80022e 168d2: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a 168d6: 80 93 39 02 sts 0x0239, r24 ; 0x800239 168da: 0c 94 ee aa jmp 0x155dc ; 0x155dc codesWereSeen = true; } if (!codesWereSeen) 168de: 11 11 cpse r17, r1 168e0: 0c 94 ee aa jmp 0x155dc ; 0x155dc { printf_P(PSTR("%i%%\n"), feedmultiply); 168e4: 80 91 3a 02 lds r24, 0x023A ; 0x80023a 168e8: 8f 93 push r24 168ea: 80 91 39 02 lds r24, 0x0239 ; 0x800239 168ee: 8f 93 push r24 168f0: 8d e5 ldi r24, 0x5D ; 93 168f2: 96 e8 ldi r25, 0x86 ; 134 168f4: 9f 93 push r25 168f6: 8f 93 push r24 168f8: 0f 94 de da call 0x3b5bc ; 0x3b5bc 168fc: 0f 90 pop r0 168fe: 0f 90 pop r0 16900: 0f 90 pop r0 16902: 0f 90 pop r0 16904: 0c 94 ee aa jmp 0x155dc ; 0x155dc extrudemultiply = code_value_short(); calculate_extruder_multipliers(); } else { printf_P(PSTR("%i%%\n"), extrudemultiply); 16908: 80 91 bd 02 lds r24, 0x02BD ; 0x8002bd 1690c: 8f 93 push r24 1690e: 80 91 bc 02 lds r24, 0x02BC ; 0x8002bc 16912: 8f 93 push r24 16914: 87 e5 ldi r24, 0x57 ; 87 16916: 96 e8 ldi r25, 0x86 ; 134 16918: 9f 93 push r25 1691a: 8f 93 push r24 1691c: 0f 94 de da call 0x3b5bc ; 0x3b5bc 16920: 0f 90 pop r0 16922: 0f 90 pop r0 16924: 0f 90 pop r0 16926: 0f 90 pop r0 16928: 0c 94 ee aa jmp 0x155dc ; 0x155dc - `P` - pin number - `S` - pin state */ case 226: { if(code_seen('P')){ 1692c: 80 e5 ldi r24, 0x50 ; 80 1692e: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 16932: 88 23 and r24, r24 16934: 11 f4 brne .+4 ; 0x1693a 16936: 0c 94 ee aa jmp 0x155dc ; 0x155dc int pin_number = code_value_short(); // pin number 1693a: 0e 94 75 5b call 0xb6ea ; 0xb6ea 1693e: 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 16940: 83 e5 ldi r24, 0x53 ; 83 16942: 0e 94 d6 5b call 0xb7ac ; 0xb7ac */ case 226: { if(code_seen('P')){ int pin_number = code_value_short(); // pin number int pin_state = -1; // required pin state - default is inverted 16946: 0f ef ldi r16, 0xFF ; 255 16948: 1f ef ldi r17, 0xFF ; 255 if(code_seen('S')) pin_state = code_value_short(); // required pin state 1694a: 88 23 and r24, r24 1694c: 19 f0 breq .+6 ; 0x16954 1694e: 0e 94 75 5b call 0xb6ea ; 0xb6ea 16952: 8c 01 movw r16, r24 if(pin_state >= -1 && pin_state <= 1){ 16954: c8 01 movw r24, r16 16956: 01 96 adiw r24, 0x01 ; 1 16958: 03 97 sbiw r24, 0x03 ; 3 1695a: 10 f0 brcs .+4 ; 0x16960 1695c: 0c 94 ee aa jmp 0x155dc ; 0x155dc 16960: ed e5 ldi r30, 0x5D ; 93 16962: 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)) 16964: 84 91 lpm r24, Z 16966: 08 2e mov r0, r24 16968: 00 0c add r0, r0 1696a: 99 0b sbc r25, r25 1696c: e8 16 cp r14, r24 1696e: f9 06 cpc r15, r25 16970: 11 f4 brne .+4 ; 0x16976 16972: 0c 94 ee aa jmp 0x155dc ; 0x155dc 16976: 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++) 16978: 27 e8 ldi r18, 0x87 ; 135 1697a: e9 37 cpi r30, 0x79 ; 121 1697c: f2 07 cpc r31, r18 1697e: 91 f7 brne .-28 ; 0x16964 pin_number = -1; break; } } if (pin_number > -1) 16980: f7 fe sbrs r15, 7 16982: 02 c0 rjmp .+4 ; 0x16988 16984: 0c 94 ee aa jmp 0x155dc ; 0x155dc { int target = LOW; st_synchronize(); 16988: 0f 94 e8 42 call 0x285d0 ; 0x285d0 pinMode(pin_number, INPUT); 1698c: de 2c mov r13, r14 1698e: 60 e0 ldi r22, 0x00 ; 0 16990: 8e 2d mov r24, r14 16992: 0e 94 e5 e8 call 0x1d1ca ; 0x1d1ca switch(pin_state){ 16996: 0f 3f cpi r16, 0xFF ; 255 16998: 10 07 cpc r17, r16 1699a: b1 f0 breq .+44 ; 0x169c8 1699c: 01 30 cpi r16, 0x01 ; 1 1699e: 11 05 cpc r17, r1 169a0: 11 f0 breq .+4 ; 0x169a6 } } if (pin_number > -1) { int target = LOW; 169a2: 10 e0 ldi r17, 0x00 ; 0 169a4: 00 e0 ldi r16, 0x00 ; 0 case -1: target = !digitalRead(pin_number); break; } while(digitalRead(pin_number) != target){ 169a6: 8d 2d mov r24, r13 169a8: 0e 94 8e e8 call 0x1d11c ; 0x1d11c 169ac: 80 17 cp r24, r16 169ae: 91 07 cpc r25, r17 169b0: 11 f4 brne .+4 ; 0x169b6 169b2: 0c 94 ee aa jmp 0x155dc ; 0x155dc manage_heater(); 169b6: 0f 94 5c 38 call 0x270b8 ; 0x270b8 manage_inactivity(); 169ba: 80 e0 ldi r24, 0x00 ; 0 169bc: 0e 94 af 8a call 0x1155e ; 0x1155e lcd_update(0); 169c0: 80 e0 ldi r24, 0x00 ; 0 169c2: 0e 94 a7 6e call 0xdd4e ; 0xdd4e 169c6: ef cf rjmp .-34 ; 0x169a6 case 0: target = LOW; break; case -1: target = !digitalRead(pin_number); 169c8: 8e 2d mov r24, r14 169ca: 0e 94 8e e8 call 0x1d11c ; 0x1d11c 169ce: 31 e0 ldi r19, 0x01 ; 1 169d0: 20 e0 ldi r18, 0x00 ; 0 169d2: 89 2b or r24, r25 169d4: 09 f0 breq .+2 ; 0x169d8 169d6: 30 e0 ldi r19, 0x00 ; 0 169d8: 03 2f mov r16, r19 169da: 12 2f mov r17, r18 169dc: e4 cf rjmp .-56 ; 0x169a6 - `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; 169de: 80 e5 ldi r24, 0x50 ; 80 169e0: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 169e4: 08 ee ldi r16, 0xE8 ; 232 169e6: 13 e0 ldi r17, 0x03 ; 3 169e8: 88 23 and r24, r24 169ea: 29 f0 breq .+10 ; 0x169f6 169ec: 0e 94 9d 60 call 0xc13a ; 0xc13a 169f0: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 169f4: 8b 01 movw r16, r22 uint16_t beepS; if (!code_seen('S')) 169f6: 83 e5 ldi r24, 0x53 ; 83 169f8: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 169fc: 88 23 and r24, r24 169fe: 71 f0 breq .+28 ; 0x16a1c beepS = 0; else { beepS = code_value(); 16a00: 0e 94 9d 60 call 0xc13a ; 0xc13a 16a04: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> if (!beepS) { 16a08: 61 15 cp r22, r1 16a0a: 71 05 cpc r23, r1 16a0c: 49 f4 brne .+18 ; 0x16a20 // handle S0 as a pause _delay(beepP); 16a0e: b8 01 movw r22, r16 16a10: 90 e0 ldi r25, 0x00 ; 0 16a12: 80 e0 ldi r24, 0x00 ; 0 16a14: 0f 94 53 27 call 0x24ea6 ; 0x24ea6 16a18: 0c 94 ee aa jmp 0x155dc ; 0x155dc case 300: // M300 { uint16_t beepP = code_seen('P') ? code_value() : 1000; uint16_t beepS; if (!code_seen('S')) beepS = 0; 16a1c: 70 e0 ldi r23, 0x00 ; 0 16a1e: 60 e0 ldi r22, 0x00 ; 0 // handle S0 as a pause _delay(beepP); break; } } Sound_MakeCustom(beepP, beepS, false); 16a20: 40 e0 ldi r20, 0x00 ; 0 16a22: c8 01 movw r24, r16 16a24: 0f 94 46 51 call 0x2a28c ; 0x2a28c 16a28: 0c 94 ee aa jmp 0x155dc ; 0x155dc - `I` - integral (Ki) - `D` - derivative (Kd) */ case 301: { if(code_seen('P')) cs.Kp = code_value(); 16a2c: 80 e5 ldi r24, 0x50 ; 80 16a2e: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 16a32: 88 23 and r24, r24 16a34: 51 f0 breq .+20 ; 0x16a4a 16a36: 0e 94 9d 60 call 0xc13a ; 0xc13a 16a3a: 60 93 26 0e sts 0x0E26, r22 ; 0x800e26 16a3e: 70 93 27 0e sts 0x0E27, r23 ; 0x800e27 16a42: 80 93 28 0e sts 0x0E28, r24 ; 0x800e28 16a46: 90 93 29 0e sts 0x0E29, r25 ; 0x800e29 if(code_seen('I')) cs.Ki = scalePID_i(code_value()); 16a4a: 89 e4 ldi r24, 0x49 ; 73 16a4c: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 16a50: 88 23 and r24, r24 16a52: 81 f0 breq .+32 ; 0x16a74 16a54: 0e 94 9d 60 call 0xc13a ; 0xc13a 16a58: 2c ea ldi r18, 0xAC ; 172 16a5a: 35 ec ldi r19, 0xC5 ; 197 16a5c: 47 e2 ldi r20, 0x27 ; 39 16a5e: 5e e3 ldi r21, 0x3E ; 62 16a60: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 16a64: 60 93 2a 0e sts 0x0E2A, r22 ; 0x800e2a 16a68: 70 93 2b 0e sts 0x0E2B, r23 ; 0x800e2b 16a6c: 80 93 2c 0e sts 0x0E2C, r24 ; 0x800e2c 16a70: 90 93 2d 0e sts 0x0E2D, r25 ; 0x800e2d if(code_seen('D')) cs.Kd = scalePID_d(code_value()); 16a74: 84 e4 ldi r24, 0x44 ; 68 16a76: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 16a7a: 88 23 and r24, r24 16a7c: 81 f0 breq .+32 ; 0x16a9e 16a7e: 0e 94 9d 60 call 0xc13a ; 0xc13a } float unscalePID_i(float i) { return i/PID_dT; 16a82: 2c ea ldi r18, 0xAC ; 172 16a84: 35 ec ldi r19, 0xC5 ; 197 16a86: 47 e2 ldi r20, 0x27 ; 39 16a88: 5e e3 ldi r21, 0x3E ; 62 16a8a: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 16a8e: 60 93 2e 0e sts 0x0E2E, r22 ; 0x800e2e 16a92: 70 93 2f 0e sts 0x0E2F, r23 ; 0x800e2f 16a96: 80 93 30 0e sts 0x0E30, r24 ; 0x800e30 16a9a: 90 93 31 0e sts 0x0E31, r25 ; 0x800e31 updatePID(); 16a9e: 0f 94 d3 3a call 0x275a6 ; 0x275a6 SERIAL_PROTOCOLRPGM(MSG_OK); 16aa2: 8b eb ldi r24, 0xBB ; 187 16aa4: 9d e6 ldi r25, 0x6D ; 109 16aa6: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_PROTOCOLPGM(" p:"); 16aaa: 83 e5 ldi r24, 0x53 ; 83 16aac: 96 e8 ldi r25, 0x86 ; 134 16aae: 0e 94 50 77 call 0xeea0 ; 0xeea0 } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 16ab2: 60 91 26 0e lds r22, 0x0E26 ; 0x800e26 16ab6: 70 91 27 0e lds r23, 0x0E27 ; 0x800e27 16aba: 80 91 28 0e lds r24, 0x0E28 ; 0x800e28 16abe: 90 91 29 0e lds r25, 0x0E29 ; 0x800e29 16ac2: 42 e0 ldi r20, 0x02 ; 2 16ac4: 0f 94 87 d5 call 0x3ab0e ; 0x3ab0e SERIAL_PROTOCOL(cs.Kp); SERIAL_PROTOCOLPGM(" i:"); 16ac8: 8f e4 ldi r24, 0x4F ; 79 16aca: 96 e8 ldi r25, 0x86 ; 134 16acc: 0e 94 50 77 call 0xeea0 ; 0xeea0 16ad0: 2c ea ldi r18, 0xAC ; 172 16ad2: 35 ec ldi r19, 0xC5 ; 197 16ad4: 47 e2 ldi r20, 0x27 ; 39 16ad6: 5e e3 ldi r21, 0x3E ; 62 16ad8: 60 91 2a 0e lds r22, 0x0E2A ; 0x800e2a 16adc: 70 91 2b 0e lds r23, 0x0E2B ; 0x800e2b 16ae0: 80 91 2c 0e lds r24, 0x0E2C ; 0x800e2c 16ae4: 90 91 2d 0e lds r25, 0x0E2D ; 0x800e2d 16ae8: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 16aec: 42 e0 ldi r20, 0x02 ; 2 16aee: 0f 94 87 d5 call 0x3ab0e ; 0x3ab0e SERIAL_PROTOCOL(unscalePID_i(cs.Ki)); SERIAL_PROTOCOLPGM(" d:"); 16af2: 8b e4 ldi r24, 0x4B ; 75 16af4: 96 e8 ldi r25, 0x86 ; 134 16af6: 0e 94 50 77 call 0xeea0 ; 0xeea0 #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 16afa: 2c ea ldi r18, 0xAC ; 172 16afc: 35 ec ldi r19, 0xC5 ; 197 16afe: 47 e2 ldi r20, 0x27 ; 39 16b00: 5e e3 ldi r21, 0x3E ; 62 16b02: 60 91 2e 0e lds r22, 0x0E2E ; 0x800e2e 16b06: 70 91 2f 0e lds r23, 0x0E2F ; 0x800e2f 16b0a: 80 91 30 0e lds r24, 0x0E30 ; 0x800e30 16b0e: 90 91 31 0e lds r25, 0x0E31 ; 0x800e31 16b12: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> SERIAL_PROTOCOLLN(unscalePID_d(cs.Kd)); 16b16: 0f 94 b4 74 call 0x2e968 ; 0x2e968 16b1a: 0c 94 ee aa jmp 0x155dc ; 0x155dc #### Parameters - `S` - Cold extrude minimum temperature */ case 302: { int temp = 0; 16b1e: 90 e0 ldi r25, 0x00 ; 0 16b20: 80 e0 ldi r24, 0x00 ; 0 16b22: 0c 94 f3 a8 jmp 0x151e6 ; 0x151e6 case 303: { float temp = 150.0; int e = 0; int c = 5; if (code_seen('E')) e = code_value_short(); 16b26: 85 e4 ldi r24, 0x45 ; 69 16b28: 0e 94 d6 5b call 0xb7ac ; 0xb7ac - `C` - Cycles, default `5` */ case 303: { float temp = 150.0; int e = 0; 16b2c: 10 e0 ldi r17, 0x00 ; 0 16b2e: 00 e0 ldi r16, 0x00 ; 0 int c = 5; if (code_seen('E')) e = code_value_short(); 16b30: 88 23 and r24, r24 16b32: 59 f0 breq .+22 ; 0x16b4a 16b34: 0e 94 75 5b call 0xb6ea ; 0xb6ea 16b38: 8c 01 movw r16, r24 if (e < 0) temp = 70; 16b3a: c1 2c mov r12, r1 16b3c: d1 2c mov r13, r1 16b3e: ac e8 ldi r26, 0x8C ; 140 16b40: ea 2e mov r14, r26 16b42: a2 e4 ldi r26, 0x42 ; 66 16b44: 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) 16b46: 97 fd sbrc r25, 7 16b48: 06 c0 rjmp .+12 ; 0x16b56 - `S` - Target temperature, default `210°C` for hotend, 70 for bed - `C` - Cycles, default `5` */ case 303: { float temp = 150.0; 16b4a: c1 2c mov r12, r1 16b4c: d1 2c mov r13, r1 16b4e: b6 e1 ldi r27, 0x16 ; 22 16b50: eb 2e mov r14, r27 16b52: b3 e4 ldi r27, 0x43 ; 67 16b54: 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(); 16b56: 83 e5 ldi r24, 0x53 ; 83 16b58: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 16b5c: 88 23 and r24, r24 16b5e: 21 f0 breq .+8 ; 0x16b68 16b60: 0e 94 9d 60 call 0xc13a ; 0xc13a 16b64: 6b 01 movw r12, r22 16b66: 7c 01 movw r14, r24 if (code_seen('C')) c = code_value_short(); 16b68: 83 e4 ldi r24, 0x43 ; 67 16b6a: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 16b6e: 88 23 and r24, r24 16b70: 51 f0 breq .+20 ; 0x16b86 16b72: 0e 94 75 5b call 0xb6ea ; 0xb6ea PID_autotune(temp, e, c); 16b76: 9c 01 movw r18, r24 16b78: a8 01 movw r20, r16 16b7a: c7 01 movw r24, r14 16b7c: b6 01 movw r22, r12 16b7e: 0f 94 00 3b call 0x27600 ; 0x27600 16b82: 0c 94 ee aa jmp 0x155dc ; 0x155dc */ case 303: { float temp = 150.0; int e = 0; int c = 5; 16b86: 85 e0 ldi r24, 0x05 ; 5 16b88: 90 e0 ldi r25, 0x00 ; 0 16b8a: f5 cf rjmp .-22 ; 0x16b76 { // 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(); 16b8c: 89 e4 ldi r24, 0x49 ; 73 16b8e: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 16b92: 88 23 and r24, r24 16b94: 09 f4 brne .+2 ; 0x16b98 16b96: 30 c2 rjmp .+1120 ; 0x16ff8 16b98: 0e 94 75 5b call 0xb6ea ; 0xb6ea 16b9c: ab 96 adiw r28, 0x2b ; 43 16b9e: 8f af std Y+63, r24 ; 0x3f 16ba0: ab 97 sbiw r28, 0x2b ; 43 if(code_seen('R')) R = code_value(); 16ba2: 82 e5 ldi r24, 0x52 ; 82 16ba4: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 16ba8: 88 23 and r24, r24 16baa: 09 f4 brne .+2 ; 0x16bae 16bac: 2a c2 rjmp .+1108 ; 0x17002 16bae: 0e 94 9d 60 call 0xc13a ; 0xc13a 16bb2: e2 96 adiw r28, 0x32 ; 50 16bb4: 6c af std Y+60, r22 ; 0x3c 16bb6: 7d af std Y+61, r23 ; 0x3d 16bb8: 8e af std Y+62, r24 ; 0x3e 16bba: 9f af std Y+63, r25 ; 0x3f 16bbc: e2 97 sbiw r28, 0x32 ; 50 if(code_seen('P')) P = code_value(); 16bbe: 80 e5 ldi r24, 0x50 ; 80 16bc0: 0e 94 d6 5b call 0xb7ac ; 0xb7ac - `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; 16bc4: c1 2c mov r12, r1 16bc6: d1 2c mov r13, r1 16bc8: f0 ec ldi r31, 0xC0 ; 192 16bca: ef 2e mov r14, r31 16bcc: ff e7 ldi r31, 0x7F ; 127 16bce: 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(); 16bd0: 88 23 and r24, r24 16bd2: 21 f0 breq .+8 ; 0x16bdc 16bd4: 0e 94 9d 60 call 0xc13a ; 0xc13a 16bd8: 6b 01 movw r12, r22 16bda: 7c 01 movw r14, r24 if(code_seen('U')) U = code_value(); 16bdc: 85 e5 ldi r24, 0x55 ; 85 16bde: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 16be2: 88 23 and r24, r24 16be4: 09 f4 brne .+2 ; 0x16be8 16be6: 18 c2 rjmp .+1072 ; 0x17018 16be8: 0e 94 9d 60 call 0xc13a ; 0xc13a 16bec: 6e 96 adiw r28, 0x1e ; 30 16bee: 6c af std Y+60, r22 ; 0x3c 16bf0: 7d af std Y+61, r23 ; 0x3d 16bf2: 8e af std Y+62, r24 ; 0x3e 16bf4: 9f af std Y+63, r25 ; 0x3f 16bf6: 6e 97 sbiw r28, 0x1e ; 30 if(code_seen('V')) V = code_value(); 16bf8: 86 e5 ldi r24, 0x56 ; 86 16bfa: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 16bfe: 88 23 and r24, r24 16c00: 09 f4 brne .+2 ; 0x16c04 16c02: 15 c2 rjmp .+1066 ; 0x1702e 16c04: 0e 94 9d 60 call 0xc13a ; 0xc13a 16c08: a2 96 adiw r28, 0x22 ; 34 16c0a: 6c af std Y+60, r22 ; 0x3c 16c0c: 7d af std Y+61, r23 ; 0x3d 16c0e: 8e af std Y+62, r24 ; 0x3e 16c10: 9f af std Y+63, r25 ; 0x3f 16c12: a2 97 sbiw r28, 0x22 ; 34 if(code_seen('C')) C = code_value(); 16c14: 83 e4 ldi r24, 0x43 ; 67 16c16: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 16c1a: 88 23 and r24, r24 16c1c: 09 f4 brne .+2 ; 0x16c20 16c1e: 12 c2 rjmp .+1060 ; 0x17044 16c20: 0e 94 9d 60 call 0xc13a ; 0xc13a 16c24: 6a 96 adiw r28, 0x1a ; 26 16c26: 6c af std Y+60, r22 ; 0x3c 16c28: 7d af std Y+61, r23 ; 0x3d 16c2a: 8e af std Y+62, r24 ; 0x3e 16c2c: 9f af std Y+63, r25 ; 0x3f 16c2e: 6a 97 sbiw r28, 0x1a ; 26 if(code_seen('D')) D = code_value(); 16c30: 84 e4 ldi r24, 0x44 ; 68 16c32: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 16c36: 88 23 and r24, r24 16c38: 09 f4 brne .+2 ; 0x16c3c 16c3a: 0f c2 rjmp .+1054 ; 0x1705a 16c3c: 0e 94 9d 60 call 0xc13a ; 0xc13a 16c40: aa 96 adiw r28, 0x2a ; 42 16c42: 6c af std Y+60, r22 ; 0x3c 16c44: 7d af std Y+61, r23 ; 0x3d 16c46: 8e af std Y+62, r24 ; 0x3e 16c48: 9f af std Y+63, r25 ; 0x3f 16c4a: aa 97 sbiw r28, 0x2a ; 42 if(code_seen('L')) L = code_value_short(); 16c4c: 8c e4 ldi r24, 0x4C ; 76 16c4e: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 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; 16c52: 0f ef ldi r16, 0xFF ; 255 16c54: 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(); 16c56: 88 23 and r24, r24 16c58: 19 f0 breq .+6 ; 0x16c60 16c5a: 0e 94 75 5b call 0xb6ea ; 0xb6ea 16c5e: 8c 01 movw r16, r24 if(code_seen('S')) S = code_value_short(); 16c60: 83 e5 ldi r24, 0x53 ; 83 16c62: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 16c66: 88 23 and r24, r24 16c68: 09 f4 brne .+2 ; 0x16c6c 16c6a: 02 c2 rjmp .+1028 ; 0x17070 16c6c: 0e 94 75 5b call 0xb6ea ; 0xb6ea 16c70: e3 96 adiw r28, 0x33 ; 51 16c72: 8f af std Y+63, r24 ; 0x3f 16c74: e3 97 sbiw r28, 0x33 ; 51 if(code_seen('B')) B = code_value_short(); 16c76: 82 e4 ldi r24, 0x42 ; 66 16c78: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 16c7c: 88 23 and r24, r24 16c7e: 09 f4 brne .+2 ; 0x16c82 16c80: fc c1 rjmp .+1016 ; 0x1707a 16c82: 0e 94 75 5b call 0xb6ea ; 0xb6ea 16c86: e7 96 adiw r28, 0x37 ; 55 16c88: 8f af std Y+63, r24 ; 0x3f 16c8a: e7 97 sbiw r28, 0x37 ; 55 if(code_seen('T')) T = code_value(); 16c8c: 84 e5 ldi r24, 0x54 ; 84 16c8e: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 16c92: 88 23 and r24, r24 16c94: 09 f4 brne .+2 ; 0x16c98 16c96: f6 c1 rjmp .+1004 ; 0x17084 16c98: 0e 94 9d 60 call 0xc13a ; 0xc13a 16c9c: a6 96 adiw r28, 0x26 ; 38 16c9e: 6c af std Y+60, r22 ; 0x3c 16ca0: 7d af std Y+61, r23 ; 0x3d 16ca2: 8e af std Y+62, r24 ; 0x3e 16ca4: 9f af std Y+63, r25 ; 0x3f 16ca6: a6 97 sbiw r28, 0x26 ; 38 if(code_seen('E')) E = code_value(); 16ca8: 85 e4 ldi r24, 0x45 ; 69 16caa: 0e 94 d6 5b call 0xb7ac ; 0xb7ac - `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; 16cae: 41 2c mov r4, r1 16cb0: 51 2c mov r5, r1 16cb2: e0 ec ldi r30, 0xC0 ; 192 16cb4: 6e 2e mov r6, r30 16cb6: ef e7 ldi r30, 0x7F ; 127 16cb8: 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(); 16cba: 88 23 and r24, r24 16cbc: 21 f0 breq .+8 ; 0x16cc6 16cbe: 0e 94 9d 60 call 0xc13a ; 0xc13a 16cc2: 2b 01 movw r4, r22 16cc4: 3c 01 movw r6, r24 if(code_seen('W')) W = code_value(); 16cc6: 87 e5 ldi r24, 0x57 ; 87 16cc8: 0e 94 d6 5b call 0xb7ac ; 0xb7ac - `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; 16ccc: 81 2c mov r8, r1 16cce: 91 2c mov r9, r1 16cd0: 70 ec ldi r23, 0xC0 ; 192 16cd2: a7 2e mov r10, r23 16cd4: 7f e7 ldi r23, 0x7F ; 127 16cd6: 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(); 16cd8: 88 23 and r24, r24 16cda: 21 f0 breq .+8 ; 0x16ce4 16cdc: 0e 94 9d 60 call 0xc13a ; 0xc13a 16ce0: 4b 01 movw r8, r22 16ce2: 5c 01 movw r10, r24 if(code_seen('A')) A = code_value_short(); 16ce4: 81 e4 ldi r24, 0x41 ; 65 16ce6: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 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; 16cea: 22 24 eor r2, r2 16cec: 2a 94 dec r2 16cee: 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(); 16cf0: 88 23 and r24, r24 16cf2: 19 f0 breq .+6 ; 0x16cfa 16cf4: 0e 94 75 5b call 0xb6ea ; 0xb6ea 16cf8: 1c 01 movw r2, r24 if(code_seen('F')) F = code_value_short(); 16cfa: 86 e4 ldi r24, 0x46 ; 70 16cfc: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 16d00: 88 23 and r24, r24 16d02: 09 f4 brne .+2 ; 0x16d06 16d04: ca c1 rjmp .+916 ; 0x1709a 16d06: 0e 94 75 5b call 0xb6ea ; 0xb6ea 16d0a: eb 96 adiw r28, 0x3b ; 59 16d0c: 8f af std Y+63, r24 ; 0x3f 16d0e: 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) 16d10: e2 96 adiw r28, 0x32 ; 50 16d12: 2c ad ldd r18, Y+60 ; 0x3c 16d14: 3d ad ldd r19, Y+61 ; 0x3d 16d16: 4e ad ldd r20, Y+62 ; 0x3e 16d18: 5f ad ldd r21, Y+63 ; 0x3f 16d1a: e2 97 sbiw r28, 0x32 ; 50 16d1c: ca 01 movw r24, r20 16d1e: b9 01 movw r22, r18 16d20: 0f 94 52 e1 call 0x3c2a4 ; 0x3c2a4 <__unordsf2> 16d24: 88 23 and r24, r24 16d26: 09 f4 brne .+2 ; 0x16d2a 16d28: c1 c1 rjmp .+898 ; 0x170ac 16d2a: a7 01 movw r20, r14 16d2c: 96 01 movw r18, r12 16d2e: c7 01 movw r24, r14 16d30: b6 01 movw r22, r12 16d32: 0f 94 52 e1 call 0x3c2a4 ; 0x3c2a4 <__unordsf2> 16d36: 88 23 and r24, r24 16d38: 09 f4 brne .+2 ; 0x16d3c 16d3a: b8 c1 rjmp .+880 ; 0x170ac 16d3c: 6e 96 adiw r28, 0x1e ; 30 16d3e: 2c ad ldd r18, Y+60 ; 0x3c 16d40: 3d ad ldd r19, Y+61 ; 0x3d 16d42: 4e ad ldd r20, Y+62 ; 0x3e 16d44: 5f ad ldd r21, Y+63 ; 0x3f 16d46: 6e 97 sbiw r28, 0x1e ; 30 16d48: ca 01 movw r24, r20 16d4a: b9 01 movw r22, r18 16d4c: 0f 94 52 e1 call 0x3c2a4 ; 0x3c2a4 <__unordsf2> 16d50: 88 23 and r24, r24 16d52: 09 f4 brne .+2 ; 0x16d56 16d54: ab c1 rjmp .+854 ; 0x170ac 16d56: a2 96 adiw r28, 0x22 ; 34 16d58: 2c ad ldd r18, Y+60 ; 0x3c 16d5a: 3d ad ldd r19, Y+61 ; 0x3d 16d5c: 4e ad ldd r20, Y+62 ; 0x3e 16d5e: 5f ad ldd r21, Y+63 ; 0x3f 16d60: a2 97 sbiw r28, 0x22 ; 34 16d62: ca 01 movw r24, r20 16d64: b9 01 movw r22, r18 16d66: 0f 94 52 e1 call 0x3c2a4 ; 0x3c2a4 <__unordsf2> 16d6a: 88 23 and r24, r24 16d6c: 09 f4 brne .+2 ; 0x16d70 16d6e: 9e c1 rjmp .+828 ; 0x170ac 16d70: 6a 96 adiw r28, 0x1a ; 26 16d72: 2c ad ldd r18, Y+60 ; 0x3c 16d74: 3d ad ldd r19, Y+61 ; 0x3d 16d76: 4e ad ldd r20, Y+62 ; 0x3e 16d78: 5f ad ldd r21, Y+63 ; 0x3f 16d7a: 6a 97 sbiw r28, 0x1a ; 26 16d7c: ca 01 movw r24, r20 16d7e: b9 01 movw r22, r18 16d80: 0f 94 52 e1 call 0x3c2a4 ; 0x3c2a4 <__unordsf2> 16d84: 88 23 and r24, r24 16d86: 09 f4 brne .+2 ; 0x16d8a 16d88: 91 c1 rjmp .+802 ; 0x170ac 16d8a: aa 96 adiw r28, 0x2a ; 42 16d8c: 2c ad ldd r18, Y+60 ; 0x3c 16d8e: 3d ad ldd r19, Y+61 ; 0x3d 16d90: 4e ad ldd r20, Y+62 ; 0x3e 16d92: 5f ad ldd r21, Y+63 ; 0x3f 16d94: aa 97 sbiw r28, 0x2a ; 42 16d96: ca 01 movw r24, r20 16d98: b9 01 movw r22, r18 16d9a: 0f 94 52 e1 call 0x3c2a4 ; 0x3c2a4 <__unordsf2> 16d9e: 88 23 and r24, r24 16da0: 09 f4 brne .+2 ; 0x16da4 16da2: 84 c1 rjmp .+776 ; 0x170ac 16da4: a6 96 adiw r28, 0x26 ; 38 16da6: 2c ad ldd r18, Y+60 ; 0x3c 16da8: 3d ad ldd r19, Y+61 ; 0x3d 16daa: 4e ad ldd r20, Y+62 ; 0x3e 16dac: 5f ad ldd r21, Y+63 ; 0x3f 16dae: a6 97 sbiw r28, 0x26 ; 38 16db0: ca 01 movw r24, r20 16db2: b9 01 movw r22, r18 16db4: 0f 94 52 e1 call 0x3c2a4 ; 0x3c2a4 <__unordsf2> 16db8: 88 23 and r24, r24 16dba: 09 f4 brne .+2 ; 0x16dbe 16dbc: 77 c1 rjmp .+750 ; 0x170ac 16dbe: a5 01 movw r20, r10 16dc0: 94 01 movw r18, r8 16dc2: c5 01 movw r24, r10 16dc4: b4 01 movw r22, r8 16dc6: 0f 94 52 e1 call 0x3c2a4 ; 0x3c2a4 <__unordsf2> 16dca: 88 23 and r24, r24 16dcc: 09 f4 brne .+2 ; 0x16dd0 16dce: 6e c1 rjmp .+732 ; 0x170ac 16dd0: a3 01 movw r20, r6 16dd2: 92 01 movw r18, r4 16dd4: c3 01 movw r24, r6 16dd6: b2 01 movw r22, r4 16dd8: 0f 94 52 e1 call 0x3c2a4 ; 0x3c2a4 <__unordsf2> 16ddc: 88 23 and r24, r24 16dde: 09 f4 brne .+2 ; 0x16de2 16de0: 65 c1 rjmp .+714 ; 0x170ac && I < 0 && S < 0 && B < 0 && A < 0 && L < 0) { 16de2: ab 96 adiw r28, 0x2b ; 43 16de4: 4f ad ldd r20, Y+63 ; 0x3f 16de6: ab 97 sbiw r28, 0x2b ; 43 16de8: 47 ff sbrs r20, 7 16dea: 60 c1 rjmp .+704 ; 0x170ac 16dec: e3 96 adiw r28, 0x33 ; 51 16dee: 5f ad ldd r21, Y+63 ; 0x3f 16df0: e3 97 sbiw r28, 0x33 ; 51 16df2: 57 ff sbrs r21, 7 16df4: 5b c1 rjmp .+694 ; 0x170ac 16df6: e7 96 adiw r28, 0x37 ; 55 16df8: 8f ad ldd r24, Y+63 ; 0x3f 16dfa: e7 97 sbiw r28, 0x37 ; 55 16dfc: 87 ff sbrs r24, 7 16dfe: 5b c1 rjmp .+694 ; 0x170b6 16e00: 37 fe sbrs r3, 7 16e02: 9f c1 rjmp .+830 ; 0x17142 16e04: 17 fd sbrc r17, 7 16e06: 4e c1 rjmp .+668 ; 0x170a4 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; 16e08: ce 01 movw r24, r28 16e0a: 01 96 adiw r24, 0x01 ; 1 16e0c: 0f 94 9a 31 call 0x26334 ; 0x26334 if(!isnan(P) && P > 0) thermal_model::data.P = P; 16e10: a7 01 movw r20, r14 16e12: 96 01 movw r18, r12 16e14: c7 01 movw r24, r14 16e16: b6 01 movw r22, r12 16e18: 0f 94 52 e1 call 0x3c2a4 ; 0x3c2a4 <__unordsf2> 16e1c: 88 23 and r24, r24 16e1e: 09 f4 brne .+2 ; 0x16e22 16e20: 31 c2 rjmp .+1122 ; 0x17284 if(!isnan(U)) thermal_model::data.U = U; 16e22: 6e 96 adiw r28, 0x1e ; 30 16e24: 2c ad ldd r18, Y+60 ; 0x3c 16e26: 3d ad ldd r19, Y+61 ; 0x3d 16e28: 4e ad ldd r20, Y+62 ; 0x3e 16e2a: 5f ad ldd r21, Y+63 ; 0x3f 16e2c: 6e 97 sbiw r28, 0x1e ; 30 16e2e: ca 01 movw r24, r20 16e30: b9 01 movw r22, r18 16e32: 0f 94 52 e1 call 0x3c2a4 ; 0x3c2a4 <__unordsf2> 16e36: 81 11 cpse r24, r1 16e38: 0e c0 rjmp .+28 ; 0x16e56 16e3a: 6e 96 adiw r28, 0x1e ; 30 16e3c: 2c ad ldd r18, Y+60 ; 0x3c 16e3e: 3d ad ldd r19, Y+61 ; 0x3d 16e40: 4e ad ldd r20, Y+62 ; 0x3e 16e42: 5f ad ldd r21, Y+63 ; 0x3f 16e44: 6e 97 sbiw r28, 0x1e ; 30 16e46: 20 93 de 12 sts 0x12DE, r18 ; 0x8012de <_ZN13thermal_modelL4dataE.lto_priv.400+0x2e> 16e4a: 30 93 df 12 sts 0x12DF, r19 ; 0x8012df <_ZN13thermal_modelL4dataE.lto_priv.400+0x2f> 16e4e: 40 93 e0 12 sts 0x12E0, r20 ; 0x8012e0 <_ZN13thermal_modelL4dataE.lto_priv.400+0x30> 16e52: 50 93 e1 12 sts 0x12E1, r21 ; 0x8012e1 <_ZN13thermal_modelL4dataE.lto_priv.400+0x31> if(!isnan(V)) thermal_model::data.V = V; 16e56: a2 96 adiw r28, 0x22 ; 34 16e58: 2c ad ldd r18, Y+60 ; 0x3c 16e5a: 3d ad ldd r19, Y+61 ; 0x3d 16e5c: 4e ad ldd r20, Y+62 ; 0x3e 16e5e: 5f ad ldd r21, Y+63 ; 0x3f 16e60: a2 97 sbiw r28, 0x22 ; 34 16e62: ca 01 movw r24, r20 16e64: b9 01 movw r22, r18 16e66: 0f 94 52 e1 call 0x3c2a4 ; 0x3c2a4 <__unordsf2> 16e6a: 81 11 cpse r24, r1 16e6c: 0e c0 rjmp .+28 ; 0x16e8a 16e6e: a2 96 adiw r28, 0x22 ; 34 16e70: 8c ad ldd r24, Y+60 ; 0x3c 16e72: 9d ad ldd r25, Y+61 ; 0x3d 16e74: ae ad ldd r26, Y+62 ; 0x3e 16e76: bf ad ldd r27, Y+63 ; 0x3f 16e78: a2 97 sbiw r28, 0x22 ; 34 16e7a: 80 93 e2 12 sts 0x12E2, r24 ; 0x8012e2 <_ZN13thermal_modelL4dataE.lto_priv.400+0x32> 16e7e: 90 93 e3 12 sts 0x12E3, r25 ; 0x8012e3 <_ZN13thermal_modelL4dataE.lto_priv.400+0x33> 16e82: a0 93 e4 12 sts 0x12E4, r26 ; 0x8012e4 <_ZN13thermal_modelL4dataE.lto_priv.400+0x34> 16e86: b0 93 e5 12 sts 0x12E5, r27 ; 0x8012e5 <_ZN13thermal_modelL4dataE.lto_priv.400+0x35> if(!isnan(C) && C > 0) thermal_model::data.C = C; 16e8a: 6a 96 adiw r28, 0x1a ; 26 16e8c: 2c ad ldd r18, Y+60 ; 0x3c 16e8e: 3d ad ldd r19, Y+61 ; 0x3d 16e90: 4e ad ldd r20, Y+62 ; 0x3e 16e92: 5f ad ldd r21, Y+63 ; 0x3f 16e94: 6a 97 sbiw r28, 0x1a ; 26 16e96: ca 01 movw r24, r20 16e98: b9 01 movw r22, r18 16e9a: 0f 94 52 e1 call 0x3c2a4 ; 0x3c2a4 <__unordsf2> 16e9e: 81 11 cpse r24, r1 16ea0: 1b c0 rjmp .+54 ; 0x16ed8 16ea2: 20 e0 ldi r18, 0x00 ; 0 16ea4: 30 e0 ldi r19, 0x00 ; 0 16ea6: a9 01 movw r20, r18 16ea8: 6a 96 adiw r28, 0x1a ; 26 16eaa: 6c ad ldd r22, Y+60 ; 0x3c 16eac: 7d ad ldd r23, Y+61 ; 0x3d 16eae: 8e ad ldd r24, Y+62 ; 0x3e 16eb0: 9f ad ldd r25, Y+63 ; 0x3f 16eb2: 6a 97 sbiw r28, 0x1a ; 26 16eb4: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 16eb8: 18 16 cp r1, r24 16eba: 74 f4 brge .+28 ; 0x16ed8 16ebc: 6a 96 adiw r28, 0x1a ; 26 16ebe: 2c ad ldd r18, Y+60 ; 0x3c 16ec0: 3d ad ldd r19, Y+61 ; 0x3d 16ec2: 4e ad ldd r20, Y+62 ; 0x3e 16ec4: 5f ad ldd r21, Y+63 ; 0x3f 16ec6: 6a 97 sbiw r28, 0x1a ; 26 16ec8: 20 93 e6 12 sts 0x12E6, r18 ; 0x8012e6 <_ZN13thermal_modelL4dataE.lto_priv.400+0x36> 16ecc: 30 93 e7 12 sts 0x12E7, r19 ; 0x8012e7 <_ZN13thermal_modelL4dataE.lto_priv.400+0x37> 16ed0: 40 93 e8 12 sts 0x12E8, r20 ; 0x8012e8 <_ZN13thermal_modelL4dataE.lto_priv.400+0x38> 16ed4: 50 93 e9 12 sts 0x12E9, r21 ; 0x8012e9 <_ZN13thermal_modelL4dataE.lto_priv.400+0x39> if(!isnan(D)) thermal_model::data.fS = D; 16ed8: aa 96 adiw r28, 0x2a ; 42 16eda: 2c ad ldd r18, Y+60 ; 0x3c 16edc: 3d ad ldd r19, Y+61 ; 0x3d 16ede: 4e ad ldd r20, Y+62 ; 0x3e 16ee0: 5f ad ldd r21, Y+63 ; 0x3f 16ee2: aa 97 sbiw r28, 0x2a ; 42 16ee4: ca 01 movw r24, r20 16ee6: b9 01 movw r22, r18 16ee8: 0f 94 52 e1 call 0x3c2a4 ; 0x3c2a4 <__unordsf2> 16eec: 81 11 cpse r24, r1 16eee: 0e c0 rjmp .+28 ; 0x16f0c 16ef0: aa 96 adiw r28, 0x2a ; 42 16ef2: 8c ad ldd r24, Y+60 ; 0x3c 16ef4: 9d ad ldd r25, Y+61 ; 0x3d 16ef6: ae ad ldd r26, Y+62 ; 0x3e 16ef8: bf ad ldd r27, Y+63 ; 0x3f 16efa: aa 97 sbiw r28, 0x2a ; 42 16efc: 80 93 ea 12 sts 0x12EA, r24 ; 0x8012ea <_ZN13thermal_modelL4dataE.lto_priv.400+0x3a> 16f00: 90 93 eb 12 sts 0x12EB, r25 ; 0x8012eb <_ZN13thermal_modelL4dataE.lto_priv.400+0x3b> 16f04: a0 93 ec 12 sts 0x12EC, r26 ; 0x8012ec <_ZN13thermal_modelL4dataE.lto_priv.400+0x3c> 16f08: b0 93 ed 12 sts 0x12ED, r27 ; 0x8012ed <_ZN13thermal_modelL4dataE.lto_priv.400+0x3d> if(L >= 0) thermal_model_set_lag(L); 16f0c: 17 fd sbrc r17, 7 16f0e: 03 c0 rjmp .+6 ; 0x16f16 16f10: c8 01 movw r24, r16 16f12: 0f 94 82 2e call 0x25d04 ; 0x25d04 if(!isnan(Ta_corr)) thermal_model::data.Ta_corr = Ta_corr; 16f16: a6 96 adiw r28, 0x26 ; 38 16f18: 2c ad ldd r18, Y+60 ; 0x3c 16f1a: 3d ad ldd r19, Y+61 ; 0x3d 16f1c: 4e ad ldd r20, Y+62 ; 0x3e 16f1e: 5f ad ldd r21, Y+63 ; 0x3f 16f20: a6 97 sbiw r28, 0x26 ; 38 16f22: ca 01 movw r24, r20 16f24: b9 01 movw r22, r18 16f26: 0f 94 52 e1 call 0x3c2a4 ; 0x3c2a4 <__unordsf2> 16f2a: 81 11 cpse r24, r1 16f2c: 0e c0 rjmp .+28 ; 0x16f4a 16f2e: a6 96 adiw r28, 0x26 ; 38 16f30: 2c ad ldd r18, Y+60 ; 0x3c 16f32: 3d ad ldd r19, Y+61 ; 0x3d 16f34: 4e ad ldd r20, Y+62 ; 0x3e 16f36: 5f ad ldd r21, Y+63 ; 0x3f 16f38: a6 97 sbiw r28, 0x26 ; 38 16f3a: 20 93 30 13 sts 0x1330, r18 ; 0x801330 <_ZN13thermal_modelL4dataE.lto_priv.400+0x80> 16f3e: 30 93 31 13 sts 0x1331, r19 ; 0x801331 <_ZN13thermal_modelL4dataE.lto_priv.400+0x81> 16f42: 40 93 32 13 sts 0x1332, r20 ; 0x801332 <_ZN13thermal_modelL4dataE.lto_priv.400+0x82> 16f46: 50 93 33 13 sts 0x1333, r21 ; 0x801333 <_ZN13thermal_modelL4dataE.lto_priv.400+0x83> if(!isnan(warn) && warn > 0) thermal_model::data.warn = warn; 16f4a: a5 01 movw r20, r10 16f4c: 94 01 movw r18, r8 16f4e: c5 01 movw r24, r10 16f50: b4 01 movw r22, r8 16f52: 0f 94 52 e1 call 0x3c2a4 ; 0x3c2a4 <__unordsf2> 16f56: 81 11 cpse r24, r1 16f58: 11 c0 rjmp .+34 ; 0x16f7c 16f5a: 20 e0 ldi r18, 0x00 ; 0 16f5c: 30 e0 ldi r19, 0x00 ; 0 16f5e: a9 01 movw r20, r18 16f60: c5 01 movw r24, r10 16f62: b4 01 movw r22, r8 16f64: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 16f68: 18 16 cp r1, r24 16f6a: 44 f4 brge .+16 ; 0x16f7c 16f6c: 80 92 34 13 sts 0x1334, r8 ; 0x801334 <_ZN13thermal_modelL4dataE.lto_priv.400+0x84> 16f70: 90 92 35 13 sts 0x1335, r9 ; 0x801335 <_ZN13thermal_modelL4dataE.lto_priv.400+0x85> 16f74: a0 92 36 13 sts 0x1336, r10 ; 0x801336 <_ZN13thermal_modelL4dataE.lto_priv.400+0x86> 16f78: b0 92 37 13 sts 0x1337, r11 ; 0x801337 <_ZN13thermal_modelL4dataE.lto_priv.400+0x87> if(!isnan(err) && err > 0) thermal_model::data.err = err; 16f7c: a3 01 movw r20, r6 16f7e: 92 01 movw r18, r4 16f80: c3 01 movw r24, r6 16f82: b2 01 movw r22, r4 16f84: 0f 94 52 e1 call 0x3c2a4 ; 0x3c2a4 <__unordsf2> 16f88: 81 11 cpse r24, r1 16f8a: 11 c0 rjmp .+34 ; 0x16fae 16f8c: 20 e0 ldi r18, 0x00 ; 0 16f8e: 30 e0 ldi r19, 0x00 ; 0 16f90: a9 01 movw r20, r18 16f92: c3 01 movw r24, r6 16f94: b2 01 movw r22, r4 16f96: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 16f9a: 18 16 cp r1, r24 16f9c: 44 f4 brge .+16 ; 0x16fae 16f9e: 40 92 38 13 sts 0x1338, r4 ; 0x801338 <_ZN13thermal_modelL4dataE.lto_priv.400+0x88> 16fa2: 50 92 39 13 sts 0x1339, r5 ; 0x801339 <_ZN13thermal_modelL4dataE.lto_priv.400+0x89> 16fa6: 60 92 3a 13 sts 0x133A, r6 ; 0x80133a <_ZN13thermal_modelL4dataE.lto_priv.400+0x8a> 16faa: 70 92 3b 13 sts 0x133B, r7 ; 0x80133b <_ZN13thermal_modelL4dataE.lto_priv.400+0x8b> // ensure warn <= err if (thermal_model::data.warn > thermal_model::data.err) 16fae: c0 90 38 13 lds r12, 0x1338 ; 0x801338 <_ZN13thermal_modelL4dataE.lto_priv.400+0x88> 16fb2: d0 90 39 13 lds r13, 0x1339 ; 0x801339 <_ZN13thermal_modelL4dataE.lto_priv.400+0x89> 16fb6: e0 90 3a 13 lds r14, 0x133A ; 0x80133a <_ZN13thermal_modelL4dataE.lto_priv.400+0x8a> 16fba: f0 90 3b 13 lds r15, 0x133B ; 0x80133b <_ZN13thermal_modelL4dataE.lto_priv.400+0x8b> 16fbe: a7 01 movw r20, r14 16fc0: 96 01 movw r18, r12 16fc2: 60 91 34 13 lds r22, 0x1334 ; 0x801334 <_ZN13thermal_modelL4dataE.lto_priv.400+0x84> 16fc6: 70 91 35 13 lds r23, 0x1335 ; 0x801335 <_ZN13thermal_modelL4dataE.lto_priv.400+0x85> 16fca: 80 91 36 13 lds r24, 0x1336 ; 0x801336 <_ZN13thermal_modelL4dataE.lto_priv.400+0x86> 16fce: 90 91 37 13 lds r25, 0x1337 ; 0x801337 <_ZN13thermal_modelL4dataE.lto_priv.400+0x87> 16fd2: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 16fd6: 18 16 cp r1, r24 16fd8: 44 f4 brge .+16 ; 0x16fea thermal_model::data.warn = thermal_model::data.err; 16fda: c0 92 34 13 sts 0x1334, r12 ; 0x801334 <_ZN13thermal_modelL4dataE.lto_priv.400+0x84> 16fde: d0 92 35 13 sts 0x1335, r13 ; 0x801335 <_ZN13thermal_modelL4dataE.lto_priv.400+0x85> 16fe2: e0 92 36 13 sts 0x1336, r14 ; 0x801336 <_ZN13thermal_modelL4dataE.lto_priv.400+0x86> 16fe6: f0 92 37 13 sts 0x1337, r15 ; 0x801337 <_ZN13thermal_modelL4dataE.lto_priv.400+0x87> thermal_model::setup(); 16fea: 0f 94 09 2f call 0x25e12 ; 0x25e12 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; 16fee: ce 01 movw r24, r28 16ff0: 01 96 adiw r24, 0x01 ; 1 16ff2: 0f 94 8d 31 call 0x2631a ; 0x2631a 16ff6: c8 c0 rjmp .+400 ; 0x17188 */ 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; 16ff8: 4f ef ldi r20, 0xFF ; 255 16ffa: ab 96 adiw r28, 0x2b ; 43 16ffc: 4f af std Y+63, r20 ; 0x3f 16ffe: ab 97 sbiw r28, 0x2b ; 43 17000: d0 cd rjmp .-1120 ; 0x16ba2 - `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; 17002: 80 e0 ldi r24, 0x00 ; 0 17004: 90 e0 ldi r25, 0x00 ; 0 17006: a0 ec ldi r26, 0xC0 ; 192 17008: bf e7 ldi r27, 0x7F ; 127 1700a: e2 96 adiw r28, 0x32 ; 50 1700c: 8c af std Y+60, r24 ; 0x3c 1700e: 9d af std Y+61, r25 ; 0x3d 17010: ae af std Y+62, r26 ; 0x3e 17012: bf af std Y+63, r27 ; 0x3f 17014: e2 97 sbiw r28, 0x32 ; 50 17016: d3 cd rjmp .-1114 ; 0x16bbe 17018: 20 e0 ldi r18, 0x00 ; 0 1701a: 30 e0 ldi r19, 0x00 ; 0 1701c: 40 ec ldi r20, 0xC0 ; 192 1701e: 5f e7 ldi r21, 0x7F ; 127 17020: 6e 96 adiw r28, 0x1e ; 30 17022: 2c af std Y+60, r18 ; 0x3c 17024: 3d af std Y+61, r19 ; 0x3d 17026: 4e af std Y+62, r20 ; 0x3e 17028: 5f af std Y+63, r21 ; 0x3f 1702a: 6e 97 sbiw r28, 0x1e ; 30 1702c: e5 cd rjmp .-1078 ; 0x16bf8 1702e: 80 e0 ldi r24, 0x00 ; 0 17030: 90 e0 ldi r25, 0x00 ; 0 17032: a0 ec ldi r26, 0xC0 ; 192 17034: bf e7 ldi r27, 0x7F ; 127 17036: a2 96 adiw r28, 0x22 ; 34 17038: 8c af std Y+60, r24 ; 0x3c 1703a: 9d af std Y+61, r25 ; 0x3d 1703c: ae af std Y+62, r26 ; 0x3e 1703e: bf af std Y+63, r27 ; 0x3f 17040: a2 97 sbiw r28, 0x22 ; 34 17042: e8 cd rjmp .-1072 ; 0x16c14 17044: 20 e0 ldi r18, 0x00 ; 0 17046: 30 e0 ldi r19, 0x00 ; 0 17048: 40 ec ldi r20, 0xC0 ; 192 1704a: 5f e7 ldi r21, 0x7F ; 127 1704c: 6a 96 adiw r28, 0x1a ; 26 1704e: 2c af std Y+60, r18 ; 0x3c 17050: 3d af std Y+61, r19 ; 0x3d 17052: 4e af std Y+62, r20 ; 0x3e 17054: 5f af std Y+63, r21 ; 0x3f 17056: 6a 97 sbiw r28, 0x1a ; 26 17058: eb cd rjmp .-1066 ; 0x16c30 1705a: 80 e0 ldi r24, 0x00 ; 0 1705c: 90 e0 ldi r25, 0x00 ; 0 1705e: a0 ec ldi r26, 0xC0 ; 192 17060: bf e7 ldi r27, 0x7F ; 127 17062: aa 96 adiw r28, 0x2a ; 42 17064: 8c af std Y+60, r24 ; 0x3c 17066: 9d af std Y+61, r25 ; 0x3d 17068: ae af std Y+62, r26 ; 0x3e 1706a: bf af std Y+63, r27 ; 0x3f 1706c: aa 97 sbiw r28, 0x2a ; 42 1706e: ee cd rjmp .-1060 ; 0x16c4c int8_t I = -1, S = -1, B = -1, F = -1; 17070: 9f ef ldi r25, 0xFF ; 255 17072: e3 96 adiw r28, 0x33 ; 51 17074: 9f af std Y+63, r25 ; 0x3f 17076: e3 97 sbiw r28, 0x33 ; 51 17078: fe cd rjmp .-1028 ; 0x16c76 1707a: af ef ldi r26, 0xFF ; 255 1707c: e7 96 adiw r28, 0x37 ; 55 1707e: af af std Y+63, r26 ; 0x3f 17080: e7 97 sbiw r28, 0x37 ; 55 17082: 04 ce rjmp .-1016 ; 0x16c8c - `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; 17084: 20 e0 ldi r18, 0x00 ; 0 17086: 30 e0 ldi r19, 0x00 ; 0 17088: 40 ec ldi r20, 0xC0 ; 192 1708a: 5f e7 ldi r21, 0x7F ; 127 1708c: a6 96 adiw r28, 0x26 ; 38 1708e: 2c af std Y+60, r18 ; 0x3c 17090: 3d af std Y+61, r19 ; 0x3d 17092: 4e af std Y+62, r20 ; 0x3e 17094: 5f af std Y+63, r21 ; 0x3f 17096: a6 97 sbiw r28, 0x26 ; 38 17098: 07 ce rjmp .-1010 ; 0x16ca8 int8_t I = -1, S = -1, B = -1, F = -1; 1709a: 3f ef ldi r19, 0xFF ; 255 1709c: eb 96 adiw r28, 0x3b ; 59 1709e: 3f af std Y+63, r19 ; 0x3f 170a0: eb 97 sbiw r28, 0x3b ; 59 170a2: 36 ce rjmp .-916 ; 0x16d10 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(); 170a4: 0f 94 c1 2d call 0x25b82 ; 0x25b82 170a8: 0c 94 ee aa jmp 0x155dc ; 0x155dc break; } // update all parameters if(B >= 0) 170ac: e7 96 adiw r28, 0x37 ; 55 170ae: 9f ad ldd r25, Y+63 ; 0x3f 170b0: e7 97 sbiw r28, 0x37 ; 55 170b2: 97 fd sbrc r25, 7 170b4: 09 c0 rjmp .+18 ; 0x170c8 thermal_model_set_warn_beep(B); 170b6: 81 e0 ldi r24, 0x01 ; 1 170b8: e7 96 adiw r28, 0x37 ; 55 170ba: af ad ldd r26, Y+63 ; 0x3f 170bc: e7 97 sbiw r28, 0x37 ; 55 170be: a1 11 cpse r26, r1 170c0: 01 c0 rjmp .+2 ; 0x170c4 170c2: 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; 170c4: 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)) 170c8: a7 01 movw r20, r14 170ca: 96 01 movw r18, r12 170cc: c7 01 movw r24, r14 170ce: b6 01 movw r22, r12 170d0: 0f 94 52 e1 call 0x3c2a4 ; 0x3c2a4 <__unordsf2> 170d4: 88 23 and r24, r24 170d6: 09 f4 brne .+2 ; 0x170da 170d8: 97 ce rjmp .-722 ; 0x16e08 170da: 6e 96 adiw r28, 0x1e ; 30 170dc: 2c ad ldd r18, Y+60 ; 0x3c 170de: 3d ad ldd r19, Y+61 ; 0x3d 170e0: 4e ad ldd r20, Y+62 ; 0x3e 170e2: 5f ad ldd r21, Y+63 ; 0x3f 170e4: 6e 97 sbiw r28, 0x1e ; 30 170e6: ca 01 movw r24, r20 170e8: b9 01 movw r22, r18 170ea: 0f 94 52 e1 call 0x3c2a4 ; 0x3c2a4 <__unordsf2> 170ee: 88 23 and r24, r24 170f0: 09 f4 brne .+2 ; 0x170f4 170f2: 8a ce rjmp .-748 ; 0x16e08 170f4: a2 96 adiw r28, 0x22 ; 34 170f6: 2c ad ldd r18, Y+60 ; 0x3c 170f8: 3d ad ldd r19, Y+61 ; 0x3d 170fa: 4e ad ldd r20, Y+62 ; 0x3e 170fc: 5f ad ldd r21, Y+63 ; 0x3f 170fe: a2 97 sbiw r28, 0x22 ; 34 17100: ca 01 movw r24, r20 17102: b9 01 movw r22, r18 17104: 0f 94 52 e1 call 0x3c2a4 ; 0x3c2a4 <__unordsf2> 17108: 88 23 and r24, r24 1710a: 09 f4 brne .+2 ; 0x1710e 1710c: 7d ce rjmp .-774 ; 0x16e08 1710e: 6a 96 adiw r28, 0x1a ; 26 17110: 2c ad ldd r18, Y+60 ; 0x3c 17112: 3d ad ldd r19, Y+61 ; 0x3d 17114: 4e ad ldd r20, Y+62 ; 0x3e 17116: 5f ad ldd r21, Y+63 ; 0x3f 17118: 6a 97 sbiw r28, 0x1a ; 26 1711a: ca 01 movw r24, r20 1711c: b9 01 movw r22, r18 1711e: 0f 94 52 e1 call 0x3c2a4 ; 0x3c2a4 <__unordsf2> 17122: 88 23 and r24, r24 17124: 09 f4 brne .+2 ; 0x17128 17126: 70 ce rjmp .-800 ; 0x16e08 17128: aa 96 adiw r28, 0x2a ; 42 1712a: 2c ad ldd r18, Y+60 ; 0x3c 1712c: 3d ad ldd r19, Y+61 ; 0x3d 1712e: 4e ad ldd r20, Y+62 ; 0x3e 17130: 5f ad ldd r21, Y+63 ; 0x3f 17132: aa 97 sbiw r28, 0x2a ; 42 17134: ca 01 movw r24, r20 17136: b9 01 movw r22, r18 17138: 0f 94 52 e1 call 0x3c2a4 ; 0x3c2a4 <__unordsf2> 1713c: 88 23 and r24, r24 1713e: 09 f4 brne .+2 ; 0x17142 17140: 63 ce rjmp .-826 ; 0x16e08 17142: 17 fd sbrc r17, 7 17144: 02 c0 rjmp .+4 ; 0x1714a 17146: 0c 94 7f cc jmp 0x198fe ; 0x198fe 1714a: a6 96 adiw r28, 0x26 ; 38 1714c: 2c ad ldd r18, Y+60 ; 0x3c 1714e: 3d ad ldd r19, Y+61 ; 0x3d 17150: 4e ad ldd r20, Y+62 ; 0x3e 17152: 5f ad ldd r21, Y+63 ; 0x3f 17154: a6 97 sbiw r28, 0x26 ; 38 17156: ca 01 movw r24, r20 17158: b9 01 movw r22, r18 1715a: 0f 94 52 e1 call 0x3c2a4 ; 0x3c2a4 <__unordsf2> 1715e: 88 23 and r24, r24 17160: 09 f4 brne .+2 ; 0x17164 17162: 52 ce rjmp .-860 ; 0x16e08 17164: a5 01 movw r20, r10 17166: 94 01 movw r18, r8 17168: c5 01 movw r24, r10 1716a: b4 01 movw r22, r8 1716c: 0f 94 52 e1 call 0x3c2a4 ; 0x3c2a4 <__unordsf2> 17170: 88 23 and r24, r24 17172: 09 f4 brne .+2 ; 0x17176 17174: 49 ce rjmp .-878 ; 0x16e08 17176: a3 01 movw r20, r6 17178: 92 01 movw r18, r4 1717a: c3 01 movw r24, r6 1717c: b2 01 movw r22, r4 1717e: 0f 94 52 e1 call 0x3c2a4 ; 0x3c2a4 <__unordsf2> 17182: 88 23 and r24, r24 17184: 09 f4 brne .+2 ; 0x17188 17186: 40 ce rjmp .-896 ; 0x16e08 thermal_model_set_params(P, U, V, C, D, L, T, W, E); if(I >= 0 && !isnan(R)) 17188: ab 96 adiw r28, 0x2b ; 43 1718a: 3f ad ldd r19, Y+63 ; 0x3f 1718c: ab 97 sbiw r28, 0x2b ; 43 1718e: 37 fd sbrc r19, 7 17190: 3b c0 rjmp .+118 ; 0x17208 17192: e2 96 adiw r28, 0x32 ; 50 17194: 2c ad ldd r18, Y+60 ; 0x3c 17196: 3d ad ldd r19, Y+61 ; 0x3d 17198: 4e ad ldd r20, Y+62 ; 0x3e 1719a: 5f ad ldd r21, Y+63 ; 0x3f 1719c: e2 97 sbiw r28, 0x32 ; 50 1719e: ca 01 movw r24, r20 171a0: b9 01 movw r22, r18 171a2: 0f 94 52 e1 call 0x3c2a4 ; 0x3c2a4 <__unordsf2> 171a6: 81 11 cpse r24, r1 171a8: 2f c0 rjmp .+94 ; 0x17208 thermal_model::setup(); } void thermal_model_set_resistance(uint8_t index, float R) { if(index >= THERMAL_MODEL_R_SIZE || R <= 0) 171aa: ab 96 adiw r28, 0x2b ; 43 171ac: 4f ad ldd r20, Y+63 ; 0x3f 171ae: ab 97 sbiw r28, 0x2b ; 43 171b0: 40 31 cpi r20, 0x10 ; 16 171b2: 54 f5 brge .+84 ; 0x17208 171b4: 20 e0 ldi r18, 0x00 ; 0 171b6: 30 e0 ldi r19, 0x00 ; 0 171b8: a9 01 movw r20, r18 171ba: e2 96 adiw r28, 0x32 ; 50 171bc: 6c ad ldd r22, Y+60 ; 0x3c 171be: 7d ad ldd r23, Y+61 ; 0x3d 171c0: 8e ad ldd r24, Y+62 ; 0x3e 171c2: 9f ad ldd r25, Y+63 ; 0x3f 171c4: e2 97 sbiw r28, 0x32 ; 50 171c6: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 171ca: 18 16 cp r1, r24 171cc: ec f4 brge .+58 ; 0x17208 return; TempMgrGuard temp_mgr_guard; 171ce: ce 01 movw r24, r28 171d0: 01 96 adiw r24, 0x01 ; 1 171d2: 0f 94 9a 31 call 0x26334 ; 0x26334 thermal_model::data.R[index] = R; 171d6: ab 96 adiw r28, 0x2b ; 43 171d8: 5f ad ldd r21, Y+63 ; 0x3f 171da: ab 97 sbiw r28, 0x2b ; 43 171dc: 84 e0 ldi r24, 0x04 ; 4 171de: 58 02 muls r21, r24 171e0: f0 01 movw r30, r0 171e2: 11 24 eor r1, r1 171e4: e0 51 subi r30, 0x10 ; 16 171e6: fd 4e sbci r31, 0xED ; 237 171e8: e2 96 adiw r28, 0x32 ; 50 171ea: 2c ad ldd r18, Y+60 ; 0x3c 171ec: 3d ad ldd r19, Y+61 ; 0x3d 171ee: 4e ad ldd r20, Y+62 ; 0x3e 171f0: 5f ad ldd r21, Y+63 ; 0x3f 171f2: e2 97 sbiw r28, 0x32 ; 50 171f4: 20 83 st Z, r18 171f6: 31 83 std Z+1, r19 ; 0x01 171f8: 42 83 std Z+2, r20 ; 0x02 171fa: 53 83 std Z+3, r21 ; 0x03 thermal_model::setup(); 171fc: 0f 94 09 2f call 0x25e12 ; 0x25e12 void thermal_model_set_resistance(uint8_t index, float R) { if(index >= THERMAL_MODEL_R_SIZE || R <= 0) return; TempMgrGuard temp_mgr_guard; 17200: ce 01 movw r24, r28 17202: 01 96 adiw r24, 0x01 ; 1 17204: 0f 94 8d 31 call 0x2631a ; 0x2631a thermal_model_set_resistance(I, R); // enable the model last, if requested if(S >= 0) thermal_model_set_enabled(S); 17208: e3 96 adiw r28, 0x33 ; 51 1720a: 3f ad ldd r19, Y+63 ; 0x3f 1720c: e3 97 sbiw r28, 0x33 ; 51 1720e: 37 fd sbrc r19, 7 17210: 06 c0 rjmp .+12 ; 0x1721e 17212: 81 e0 ldi r24, 0x01 ; 1 17214: 31 11 cpse r19, r1 17216: 01 c0 rjmp .+2 ; 0x1721a 17218: 80 e0 ldi r24, 0x00 ; 0 1721a: 0f 94 3d 32 call 0x2647a ; 0x2647a // run autotune if(A >= 0) thermal_model_autotune(A, F > 0); 1721e: 37 fe sbrs r3, 7 17220: 02 c0 rjmp .+4 ; 0x17226 17222: 0c 94 ee aa jmp 0x155dc ; 0x155dc 17226: 11 e0 ldi r17, 0x01 ; 1 17228: eb 96 adiw r28, 0x3b ; 59 1722a: 4f ad ldd r20, Y+63 ; 0x3f 1722c: eb 97 sbiw r28, 0x3b ; 59 1722e: 14 16 cp r1, r20 17230: 0c f0 brlt .+2 ; 0x17234 17232: 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; 17234: 81 e0 ldi r24, 0x01 ; 1 17236: 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); 1723a: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 1723e: 90 91 a6 0d lds r25, 0x0DA6 ; 0x800da6 17242: 89 1b sub r24, r25 17244: 8f 70 andi r24, 0x0F ; 15 char tm_message[LCD_WIDTH+1]; if(moves_planned() || (lcd_commands_type != LcdCommands::ThermalModel && printer_active())) { 17246: 41 f4 brne .+16 ; 0x17258 17248: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 1724c: 85 30 cpi r24, 0x05 ; 5 1724e: 69 f1 breq .+90 ; 0x172aa 17250: 0e 94 e1 67 call 0xcfc2 ; 0xcfc2 17254: 88 23 and r24, r24 17256: 49 f1 breq .+82 ; 0x172aa sprintf_P(tm_message, PSTR("TM: Cal. NOT IDLE")); 17258: 8b e2 ldi r24, 0x2B ; 43 1725a: 94 e8 ldi r25, 0x84 ; 132 1725c: 9f 93 push r25 1725e: 8f 93 push r24 17260: 81 e0 ldi r24, 0x01 ; 1 17262: 90 e0 ldi r25, 0x00 ; 0 17264: 8c 0f add r24, r28 17266: 9d 1f adc r25, r29 17268: 9f 93 push r25 1726a: 8f 93 push r24 1726c: 0f 94 33 db call 0x3b666 ; 0x3b666 lcd_setstatus_serial(tm_message); 17270: ce 01 movw r24, r28 17272: 01 96 adiw r24, 0x01 ; 1 17274: 0e 94 4c f1 call 0x1e298 ; 0x1e298 return; 17278: 0f 90 pop r0 1727a: 0f 90 pop r0 1727c: 0f 90 pop r0 1727e: 0f 90 pop r0 17280: 0c 94 ee aa jmp 0x155dc ; 0x155dc 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; 17284: 20 e0 ldi r18, 0x00 ; 0 17286: 30 e0 ldi r19, 0x00 ; 0 17288: a9 01 movw r20, r18 1728a: c7 01 movw r24, r14 1728c: b6 01 movw r22, r12 1728e: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 17292: 18 16 cp r1, r24 17294: 0c f0 brlt .+2 ; 0x17298 17296: c5 cd rjmp .-1142 ; 0x16e22 17298: c0 92 da 12 sts 0x12DA, r12 ; 0x8012da <_ZN13thermal_modelL4dataE.lto_priv.400+0x2a> 1729c: d0 92 db 12 sts 0x12DB, r13 ; 0x8012db <_ZN13thermal_modelL4dataE.lto_priv.400+0x2b> 172a0: e0 92 dc 12 sts 0x12DC, r14 ; 0x8012dc <_ZN13thermal_modelL4dataE.lto_priv.400+0x2c> 172a4: f0 92 dd 12 sts 0x12DD, r15 ; 0x8012dd <_ZN13thermal_modelL4dataE.lto_priv.400+0x2d> 172a8: bc cd rjmp .-1160 ; 0x16e22 lcd_setstatus_serial(tm_message); return; } // lockout the printer during calibration KEEPALIVE_STATE(IN_PROCESS); 172aa: 83 e0 ldi r24, 0x03 ; 3 172ac: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be menu_set_block(MENU_BLOCK_THERMAL_MODEL_AUTOTUNE); 172b0: 80 91 d6 03 lds r24, 0x03D6 ; 0x8003d6 172b4: 82 60 ori r24, 0x02 ; 2 172b6: 80 93 d6 03 sts 0x03D6, r24 ; 0x8003d6 lcd_return_to_status(); 172ba: 0f 94 a6 1e call 0x23d4c ; 0x23d4c // save the original model data and set the model checking state during self-calibration orig_C = thermal_model::data.C; 172be: 20 91 e6 12 lds r18, 0x12E6 ; 0x8012e6 <_ZN13thermal_modelL4dataE.lto_priv.400+0x36> 172c2: 30 91 e7 12 lds r19, 0x12E7 ; 0x8012e7 <_ZN13thermal_modelL4dataE.lto_priv.400+0x37> 172c6: 40 91 e8 12 lds r20, 0x12E8 ; 0x8012e8 <_ZN13thermal_modelL4dataE.lto_priv.400+0x38> 172ca: 50 91 e9 12 lds r21, 0x12E9 ; 0x8012e9 <_ZN13thermal_modelL4dataE.lto_priv.400+0x39> 172ce: 6e 96 adiw r28, 0x1e ; 30 172d0: 2c af std Y+60, r18 ; 0x3c 172d2: 3d af std Y+61, r19 ; 0x3d 172d4: 4e af std Y+62, r20 ; 0x3e 172d6: 5f af std Y+63, r21 ; 0x3f 172d8: 6e 97 sbiw r28, 0x1e ; 30 memcpy(orig_R, thermal_model::data.R, sizeof(thermal_model::data.R)); 172da: 80 e4 ldi r24, 0x40 ; 64 172dc: e0 ef ldi r30, 0xF0 ; 240 172de: f2 e1 ldi r31, 0x12 ; 18 172e0: de 01 movw r26, r28 172e2: 11 96 adiw r26, 0x01 ; 1 172e4: 01 90 ld r0, Z+ 172e6: 0d 92 st X+, r0 172e8: 8a 95 dec r24 172ea: e1 f7 brne .-8 ; 0x172e4 orig_enabled = thermal_model::enabled; 172ec: 30 91 1d 05 lds r19, 0x051D ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.456> 172f0: 67 96 adiw r28, 0x17 ; 23 172f2: 3f af std Y+63, r19 ; 0x3f 172f4: 67 97 sbiw r28, 0x17 ; 23 thermal_model_reset_enabled(selftest); 172f6: 81 2f mov r24, r17 172f8: 0f 94 5f 32 call 0x264be ; 0x264be // autotune SERIAL_ECHOLNPGM("TM: calibration start"); 172fc: 85 e1 ldi r24, 0x15 ; 21 172fe: 94 e8 ldi r25, 0x84 ; 132 17300: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 thermal_model_autotune_err = thermal_model_cal::autotune(temp > 0 ? temp : THERMAL_MODEL_CAL_T_high); 17304: 21 14 cp r2, r1 17306: 31 04 cpc r3, r1 17308: 19 f4 brne .+6 ; 0x17310 1730a: 56 ee ldi r21, 0xE6 ; 230 1730c: 25 2e mov r2, r21 1730e: 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); 17310: 80 e0 ldi r24, 0x00 ; 0 17312: 0f 94 b7 2d call 0x25b6e ; 0x25b6e 17316: 32 e0 ldi r19, 0x02 ; 2 17318: 43 2e mov r4, r19 1731a: 51 2c mov r5, r1 for(uint8_t i = 0; i != 2; ++i) { const char* PROGMEM verb = (i == 0? PSTR("initial"): PSTR("refine")); 1731c: 49 ef ldi r20, 0xF9 ; 249 1731e: 64 2e mov r6, r20 17320: 43 e8 ldi r20, 0x83 ; 131 17322: 74 2e mov r7, r20 17324: ae 01 movw r20, r28 17326: 4f 5b subi r20, 0xBF ; 191 17328: 5f 4f sbci r21, 0xFF ; 255 1732a: 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); 1732c: 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; 1732e: 10 92 b7 0d sts 0x0DB7, r1 ; 0x800db7 17332: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 if(current_temperature[0] >= THERMAL_MODEL_CAL_T_low) { 17336: 20 e0 ldi r18, 0x00 ; 0 17338: 30 e0 ldi r19, 0x00 ; 0 1733a: 48 e4 ldi r20, 0x48 ; 72 1733c: 52 e4 ldi r21, 0x42 ; 66 1733e: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 17342: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 17346: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 1734a: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 1734e: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 17352: 87 fd sbrc r24, 7 17354: 58 c0 rjmp .+176 ; 0x17406 sprintf_P(tm_message, PSTR("TM: cool down <%dC"), THERMAL_MODEL_CAL_T_low); 17356: 1f 92 push r1 17358: 1f 93 push r17 1735a: 8f ed ldi r24, 0xDF ; 223 1735c: 93 e8 ldi r25, 0x83 ; 131 1735e: 9f 93 push r25 17360: 8f 93 push r24 17362: 9f 92 push r9 17364: 8f 92 push r8 17366: 0f 94 33 db call 0x3b666 ; 0x3b666 lcd_setstatus_serial(tm_message); 1736a: c4 01 movw r24, r8 1736c: 0e 94 4c f1 call 0x1e298 ; 0x1e298 } } static void cooldown(float temp) { uint8_t old_speed = fanSpeed; 17370: 00 91 e7 03 lds r16, 0x03E7 ; 0x8003e7 set_fan_speed(255); 17374: 8f ef ldi r24, 0xFF ; 255 17376: 0f 94 b7 2d call 0x25b6e ; 0x25b6e 1737a: 0f 90 pop r0 1737c: 0f 90 pop r0 1737e: 0f 90 pop r0 17380: 0f 90 pop r0 17382: 0f 90 pop r0 17384: 0f 90 pop r0 while(current_temperature[0] >= temp) { 17386: c0 90 b0 0d lds r12, 0x0DB0 ; 0x800db0 1738a: d0 90 b1 0d lds r13, 0x0DB1 ; 0x800db1 1738e: e0 90 b2 0d lds r14, 0x0DB2 ; 0x800db2 17392: f0 90 b3 0d lds r15, 0x0DB3 ; 0x800db3 17396: 20 e0 ldi r18, 0x00 ; 0 17398: 30 e0 ldi r19, 0x00 ; 0 1739a: 48 e4 ldi r20, 0x48 ; 72 1739c: 52 e4 ldi r21, 0x42 ; 66 1739e: c7 01 movw r24, r14 173a0: b6 01 movw r22, r12 173a2: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 173a6: 87 fd sbrc r24, 7 173a8: 27 c0 rjmp .+78 ; 0x173f8 if(temp_error_state.v) break; 173aa: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 173ae: 81 11 cpse r24, r1 173b0: 23 c0 rjmp .+70 ; 0x173f8 float ambient = current_temperature_ambient + thermal_model::data.Ta_corr; 173b2: 20 91 56 06 lds r18, 0x0656 ; 0x800656 173b6: 30 91 57 06 lds r19, 0x0657 ; 0x800657 173ba: 40 91 58 06 lds r20, 0x0658 ; 0x800658 173be: 50 91 59 06 lds r21, 0x0659 ; 0x800659 173c2: 60 91 30 13 lds r22, 0x1330 ; 0x801330 <_ZN13thermal_modelL4dataE.lto_priv.400+0x80> 173c6: 70 91 31 13 lds r23, 0x1331 ; 0x801331 <_ZN13thermal_modelL4dataE.lto_priv.400+0x81> 173ca: 80 91 32 13 lds r24, 0x1332 ; 0x801332 <_ZN13thermal_modelL4dataE.lto_priv.400+0x82> 173ce: 90 91 33 13 lds r25, 0x1333 ; 0x801333 <_ZN13thermal_modelL4dataE.lto_priv.400+0x83> 173d2: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> if(current_temperature[0] < (ambient + TEMP_HYSTERESIS)) { 173d6: 20 e0 ldi r18, 0x00 ; 0 173d8: 30 e0 ldi r19, 0x00 ; 0 173da: 40 ea ldi r20, 0xA0 ; 160 173dc: 50 e4 ldi r21, 0x40 ; 64 173de: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 173e2: 9b 01 movw r18, r22 173e4: ac 01 movw r20, r24 173e6: c7 01 movw r24, r14 173e8: b6 01 movw r22, r12 173ea: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 173ee: 87 fd sbrc r24, 7 173f0: 03 c0 rjmp .+6 ; 0x173f8 // do not get stuck waiting very close to ambient temperature break; } waiting_handler(); 173f2: 0f 94 84 3a call 0x27508 ; 0x27508 173f6: c7 cf rjmp .-114 ; 0x17386 } set_fan_speed(old_speed); 173f8: 80 2f mov r24, r16 173fa: 0f 94 b7 2d call 0x25b6e ; 0x25b6e 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); 173fe: 80 e1 ldi r24, 0x10 ; 16 17400: 97 e2 ldi r25, 0x27 ; 39 17402: 0f 94 b1 3a call 0x27562 ; 0x27562 } sprintf_P(tm_message, PSTR("TM: %S C est."), verb); 17406: 7f 92 push r7 17408: 6f 92 push r6 1740a: e1 ed ldi r30, 0xD1 ; 209 1740c: f3 e8 ldi r31, 0x83 ; 131 1740e: ff 93 push r31 17410: ef 93 push r30 17412: 9f 92 push r9 17414: 8f 92 push r8 17416: 0f 94 33 db call 0x3b666 ; 0x3b666 lcd_setstatus_serial(tm_message); 1741a: c4 01 movw r24, r8 1741c: 0e 94 4c f1 call 0x1e298 ; 0x1e298 target_temperature[0] = cal_temp; 17420: 30 92 b7 0d sts 0x0DB7, r3 ; 0x800db7 17424: 20 92 b6 0d sts 0x0DB6, r2 ; 0x800db6 samples = record(); 17428: 0f 94 cc 0f call 0x21f98 ; 0x21f98 1742c: 5c 01 movw r10, r24 if(temp_error_state.v || !samples) 1742e: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 17432: 0f 90 pop r0 17434: 0f 90 pop r0 17436: 0f 90 pop r0 17438: 0f 90 pop r0 1743a: 0f 90 pop r0 1743c: 0f 90 pop r0 1743e: 81 11 cpse r24, r1 17440: 7a c0 rjmp .+244 ; 0x17536 17442: a1 14 cp r10, r1 17444: b1 04 cpc r11, r1 17446: 09 f4 brne .+2 ; 0x1744a 17448: 76 c0 rjmp .+236 ; 0x17536 return true; // we need a high R value for the initial C guess if(isnan(thermal_model::data.R[0])) 1744a: 60 91 f0 12 lds r22, 0x12F0 ; 0x8012f0 <_ZN13thermal_modelL4dataE.lto_priv.400+0x40> 1744e: 70 91 f1 12 lds r23, 0x12F1 ; 0x8012f1 <_ZN13thermal_modelL4dataE.lto_priv.400+0x41> 17452: 80 91 f2 12 lds r24, 0x12F2 ; 0x8012f2 <_ZN13thermal_modelL4dataE.lto_priv.400+0x42> 17456: 90 91 f3 12 lds r25, 0x12F3 ; 0x8012f3 <_ZN13thermal_modelL4dataE.lto_priv.400+0x43> 1745a: 9b 01 movw r18, r22 1745c: ac 01 movw r20, r24 1745e: 0f 94 52 e1 call 0x3c2a4 ; 0x3c2a4 <__unordsf2> 17462: 88 23 and r24, r24 17464: 61 f0 breq .+24 ; 0x1747e thermal_model::data.R[0] = THERMAL_MODEL_CAL_R_high; 17466: 80 e0 ldi r24, 0x00 ; 0 17468: 90 e0 ldi r25, 0x00 ; 0 1746a: a8 e4 ldi r26, 0x48 ; 72 1746c: b2 e4 ldi r27, 0x42 ; 66 1746e: 80 93 f0 12 sts 0x12F0, r24 ; 0x8012f0 <_ZN13thermal_modelL4dataE.lto_priv.400+0x40> 17472: 90 93 f1 12 sts 0x12F1, r25 ; 0x8012f1 <_ZN13thermal_modelL4dataE.lto_priv.400+0x41> 17476: a0 93 f2 12 sts 0x12F2, r26 ; 0x8012f2 <_ZN13thermal_modelL4dataE.lto_priv.400+0x42> 1747a: b0 93 f3 12 sts 0x12F3, r27 ; 0x8012f3 <_ZN13thermal_modelL4dataE.lto_priv.400+0x43> e = estimate(samples, &thermal_model::data.C, 1747e: c0 90 56 06 lds r12, 0x0656 ; 0x800656 17482: d0 90 57 06 lds r13, 0x0657 ; 0x800657 17486: e0 90 58 06 lds r14, 0x0658 ; 0x800658 1748a: f0 90 59 06 lds r15, 0x0659 ; 0x800659 1748e: 00 e0 ldi r16, 0x00 ; 0 17490: 20 e0 ldi r18, 0x00 ; 0 17492: 30 e0 ldi r19, 0x00 ; 0 17494: 40 ea ldi r20, 0xA0 ; 160 17496: 51 e4 ldi r21, 0x41 ; 65 17498: 66 ee ldi r22, 0xE6 ; 230 1749a: 72 e1 ldi r23, 0x12 ; 18 1749c: c5 01 movw r24, r10 1749e: 0e 94 b7 e6 call 0x1cd6e ; 0x1cd6e 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)) 174a2: 9b 01 movw r18, r22 174a4: ac 01 movw r20, r24 174a6: 0f 94 52 e1 call 0x3c2a4 ; 0x3c2a4 <__unordsf2> 174aa: 81 11 cpse r24, r1 174ac: 44 c0 rjmp .+136 ; 0x17536 return true; wait_temp(); 174ae: 0f 94 8f 3a call 0x2751e ; 0x2751e if(i) break; // we don't need to refine R 174b2: 4a 94 dec r4 174b4: 45 28 or r4, r5 174b6: 09 f4 brne .+2 ; 0x174ba 174b8: 85 c0 rjmp .+266 ; 0x175c4 wait(30000); // settle PID regulation 174ba: 80 e3 ldi r24, 0x30 ; 48 174bc: 95 e7 ldi r25, 0x75 ; 117 174be: 0f 94 b1 3a call 0x27562 ; 0x27562 sprintf_P(tm_message, PSTR("TM: %S R %dC"), verb, cal_temp); 174c2: 3f 92 push r3 174c4: 2f 92 push r2 174c6: 7f 92 push r7 174c8: 6f 92 push r6 174ca: 44 ec ldi r20, 0xC4 ; 196 174cc: 53 e8 ldi r21, 0x83 ; 131 174ce: 5f 93 push r21 174d0: 4f 93 push r20 174d2: 9f 92 push r9 174d4: 8f 92 push r8 174d6: 0f 94 33 db call 0x3b666 ; 0x3b666 lcd_setstatus_serial(tm_message); 174da: c4 01 movw r24, r8 174dc: 0e 94 4c f1 call 0x1e298 ; 0x1e298 samples = record(); 174e0: 0f 94 cc 0f call 0x21f98 ; 0x21f98 if(temp_error_state.v || !samples) 174e4: 20 91 1b 05 lds r18, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 174e8: 0f b6 in r0, 0x3f ; 63 174ea: f8 94 cli 174ec: de bf out 0x3e, r29 ; 62 174ee: 0f be out 0x3f, r0 ; 63 174f0: cd bf out 0x3d, r28 ; 61 174f2: 21 11 cpse r18, r1 174f4: 20 c0 rjmp .+64 ; 0x17536 174f6: 00 97 sbiw r24, 0x00 ; 0 174f8: f1 f0 breq .+60 ; 0x17536 return true; e = estimate(samples, &thermal_model::data.R[0], 174fa: c0 90 56 06 lds r12, 0x0656 ; 0x800656 174fe: d0 90 57 06 lds r13, 0x0657 ; 0x800657 17502: e0 90 58 06 lds r14, 0x0658 ; 0x800658 17506: f0 90 59 06 lds r15, 0x0659 ; 0x800659 1750a: 20 e0 ldi r18, 0x00 ; 0 1750c: 30 e0 ldi r19, 0x00 ; 0 1750e: 48 e4 ldi r20, 0x48 ; 72 17510: 52 e4 ldi r21, 0x42 ; 66 17512: 60 ef ldi r22, 0xF0 ; 240 17514: 72 e1 ldi r23, 0x12 ; 18 17516: 0e 94 b7 e6 call 0x1cd6e ; 0x1cd6e // 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")); 1751a: 02 ef ldi r16, 0xF2 ; 242 1751c: 60 2e mov r6, r16 1751e: 03 e8 ldi r16, 0x83 ; 131 17520: 70 2e mov r7, r16 17522: 44 24 eor r4, r4 17524: 43 94 inc r4 17526: 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)) 17528: 9b 01 movw r18, r22 1752a: ac 01 movw r20, r24 1752c: 0f 94 52 e1 call 0x3c2a4 ; 0x3c2a4 <__unordsf2> 17530: 88 23 and r24, r24 17532: 09 f4 brne .+2 ; 0x17536 17534: fc ce rjmp .-520 ; 0x1732e 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; 17536: 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); 17538: 80 93 3c 02 sts 0x023C, r24 ; 0x80023c <_ZL26thermal_model_autotune_err.lto_priv.536> // always reset temperature disable_heater(); 1753c: 0f 94 18 2f call 0x25e30 ; 0x25e30 if(thermal_model_autotune_err) { 17540: 80 91 3c 02 lds r24, 0x023C ; 0x80023c <_ZL26thermal_model_autotune_err.lto_priv.536> 17544: 88 23 and r24, r24 17546: 09 f4 brne .+2 ; 0x1754a 17548: fd c0 rjmp .+506 ; 0x17744 sprintf_P(tm_message, PSTR("TM: calibr. failed!")); 1754a: 81 e0 ldi r24, 0x01 ; 1 1754c: 94 e8 ldi r25, 0x84 ; 132 1754e: 9f 93 push r25 17550: 8f 93 push r24 17552: 9f 92 push r9 17554: 8f 92 push r8 17556: 0f 94 33 db call 0x3b666 ; 0x3b666 lcd_setstatus_serial(tm_message); 1755a: c4 01 movw r24, r8 1755c: 0e 94 4c f1 call 0x1e298 ; 0x1e298 if(temp_error_state.v) 17560: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 17564: 0f 90 pop r0 17566: 0f 90 pop r0 17568: 0f 90 pop r0 1756a: 0f 90 pop r0 1756c: 88 23 and r24, r24 1756e: 19 f0 breq .+6 ; 0x17576 thermal_model_cal::set_fan_speed(255); 17570: 8f ef ldi r24, 0xFF ; 255 17572: 0f 94 b7 2d call 0x25b6e ; 0x25b6e // show calibrated values before overwriting them thermal_model_report_settings(); 17576: 0f 94 c1 2d call 0x25b82 ; 0x25b82 // restore original state thermal_model::data.C = orig_C; 1757a: 6e 96 adiw r28, 0x1e ; 30 1757c: 2c ad ldd r18, Y+60 ; 0x3c 1757e: 3d ad ldd r19, Y+61 ; 0x3d 17580: 4e ad ldd r20, Y+62 ; 0x3e 17582: 5f ad ldd r21, Y+63 ; 0x3f 17584: 6e 97 sbiw r28, 0x1e ; 30 17586: 20 93 e6 12 sts 0x12E6, r18 ; 0x8012e6 <_ZN13thermal_modelL4dataE.lto_priv.400+0x36> 1758a: 30 93 e7 12 sts 0x12E7, r19 ; 0x8012e7 <_ZN13thermal_modelL4dataE.lto_priv.400+0x37> 1758e: 40 93 e8 12 sts 0x12E8, r20 ; 0x8012e8 <_ZN13thermal_modelL4dataE.lto_priv.400+0x38> 17592: 50 93 e9 12 sts 0x12E9, r21 ; 0x8012e9 <_ZN13thermal_modelL4dataE.lto_priv.400+0x39> memcpy(thermal_model::data.R, orig_R, sizeof(thermal_model::data.R)); 17596: 80 e4 ldi r24, 0x40 ; 64 17598: fe 01 movw r30, r28 1759a: 31 96 adiw r30, 0x01 ; 1 1759c: a0 ef ldi r26, 0xF0 ; 240 1759e: b2 e1 ldi r27, 0x12 ; 18 175a0: 01 90 ld r0, Z+ 175a2: 0d 92 st X+, r0 175a4: 8a 95 dec r24 175a6: e1 f7 brne .-8 ; 0x175a0 thermal_model_set_enabled(orig_enabled); 175a8: 67 96 adiw r28, 0x17 ; 23 175aa: 8f ad ldd r24, Y+63 ; 0x3f 175ac: 67 97 sbiw r28, 0x17 ; 23 175ae: 0f 94 3d 32 call 0x2647a ; 0x2647a thermal_model_cal::set_fan_speed(0); thermal_model_set_enabled(orig_enabled); thermal_model_report_settings(); } lcd_consume_click(); 175b2: 0e 94 f8 70 call 0xe1f0 ; 0xe1f0 menu_unset_block(MENU_BLOCK_THERMAL_MODEL_AUTOTUNE); 175b6: 80 91 d6 03 lds r24, 0x03D6 ; 0x8003d6 175ba: 8d 7f andi r24, 0xFD ; 253 175bc: 80 93 d6 03 sts 0x03D6, r24 ; 0x8003d6 175c0: 0c 94 ee aa jmp 0x155dc ; 0x155dc // 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); 175c4: 8f ef ldi r24, 0xFF ; 255 175c6: 0f 94 b7 2d call 0x25b6e ; 0x25b6e wait(30000); 175ca: 80 e3 ldi r24, 0x30 ; 48 175cc: 95 e7 ldi r25, 0x75 ; 117 175ce: 0f 94 b1 3a call 0x27562 ; 0x27562 175d2: fc e2 ldi r31, 0x2C ; 44 175d4: 6f 2e mov r6, r31 175d6: f3 e1 ldi r31, 0x13 ; 19 175d8: 7f 2e mov r7, r31 175da: 1f ef ldi r17, 0xFF ; 255 175dc: af e0 ldi r26, 0x0F ; 15 175de: aa 2e mov r10, r26 175e0: 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; 175e2: 21 2c mov r2, r1 175e4: 31 2c mov r3, r1 175e6: b0 ec ldi r27, 0xC0 ; 192 175e8: 4b 2e mov r4, r27 175ea: bf e7 ldi r27, 0x7F ; 127 175ec: 5b 2e mov r5, r27 175ee: f3 01 movw r30, r6 175f0: 20 82 st Z, r2 175f2: 31 82 std Z+1, r3 ; 0x01 175f4: 42 82 std Z+2, r4 ; 0x02 175f6: 53 82 std Z+3, r5 ; 0x03 uint8_t speed = 256 / THERMAL_MODEL_R_SIZE * (i + 1) - 1; set_fan_speed(speed); 175f8: 81 2f mov r24, r17 175fa: 0f 94 b7 2d call 0x25b6e ; 0x25b6e wait(10000); 175fe: 80 e1 ldi r24, 0x10 ; 16 17600: 97 e2 ldi r25, 0x27 ; 39 17602: 0f 94 b1 3a call 0x27562 ; 0x27562 sprintf_P(tm_message, PSTR("TM: R[%u] estimate."), (unsigned)i); 17606: bf 92 push r11 17608: af 92 push r10 1760a: 20 eb ldi r18, 0xB0 ; 176 1760c: 33 e8 ldi r19, 0x83 ; 131 1760e: 3f 93 push r19 17610: 2f 93 push r18 17612: 9f 92 push r9 17614: 8f 92 push r8 17616: 0f 94 33 db call 0x3b666 ; 0x3b666 lcd_setstatus_serial(tm_message); 1761a: c4 01 movw r24, r8 1761c: 0e 94 4c f1 call 0x1e298 ; 0x1e298 samples = record(); 17620: 0f 94 cc 0f call 0x21f98 ; 0x21f98 if(temp_error_state.v || !samples) 17624: 20 91 1b 05 lds r18, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 17628: 0f 90 pop r0 1762a: 0f 90 pop r0 1762c: 0f 90 pop r0 1762e: 0f 90 pop r0 17630: 0f 90 pop r0 17632: 0f 90 pop r0 17634: 21 11 cpse r18, r1 17636: 7f cf rjmp .-258 ; 0x17536 17638: 00 97 sbiw r24, 0x00 ; 0 1763a: 09 f4 brne .+2 ; 0x1763e 1763c: 7c cf rjmp .-264 ; 0x17536 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], 1763e: c0 90 56 06 lds r12, 0x0656 ; 0x800656 17642: d0 90 57 06 lds r13, 0x0657 ; 0x800657 17646: e0 90 58 06 lds r14, 0x0658 ; 0x800658 1764a: f0 90 59 06 lds r15, 0x0659 ; 0x800659 1764e: 20 91 f0 12 lds r18, 0x12F0 ; 0x8012f0 <_ZN13thermal_modelL4dataE.lto_priv.400+0x40> 17652: 30 91 f1 12 lds r19, 0x12F1 ; 0x8012f1 <_ZN13thermal_modelL4dataE.lto_priv.400+0x41> 17656: 40 91 f2 12 lds r20, 0x12F2 ; 0x8012f2 <_ZN13thermal_modelL4dataE.lto_priv.400+0x42> 1765a: 50 91 f3 12 lds r21, 0x12F3 ; 0x8012f3 <_ZN13thermal_modelL4dataE.lto_priv.400+0x43> 1765e: 0a 2d mov r16, r10 17660: b3 01 movw r22, r6 17662: 0e 94 b7 e6 call 0x1cd6e ; 0x1cd6e 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)) 17666: 9b 01 movw r18, r22 17668: ac 01 movw r20, r24 1766a: 0f 94 52 e1 call 0x3c2a4 ; 0x3c2a4 <__unordsf2> 1766e: 81 11 cpse r24, r1 17670: 62 cf rjmp .-316 ; 0x17536 17672: 54 e0 ldi r21, 0x04 ; 4 17674: a5 1a sub r10, r21 17676: b1 08 sbc r11, r1 17678: 80 e1 ldi r24, 0x10 ; 16 1767a: 68 1a sub r6, r24 1767c: 71 08 sbc r7, r1 1767e: 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) { 17680: 9f ef ldi r25, 0xFF ; 255 17682: a9 16 cp r10, r25 17684: b9 06 cpc r11, r25 17686: 09 f0 breq .+2 ; 0x1768a 17688: b2 cf rjmp .-156 ; 0x175ee 1768a: 78 e2 ldi r23, 0x28 ; 40 1768c: e7 2e mov r14, r23 1768e: 73 e1 ldi r23, 0x13 ; 19 17690: f7 2e mov r15, r23 17692: 0e e0 ldi r16, 0x0E ; 14 17694: 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; 17696: ef e0 ldi r30, 0x0F ; 15 17698: 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)) { 1769a: 8f e0 ldi r24, 0x0F ; 15 1769c: 90 e0 ldi r25, 0x00 ; 0 1769e: 80 1b sub r24, r16 176a0: 91 0b sbc r25, r17 176a2: 83 70 andi r24, 0x03 ; 3 176a4: 99 27 eor r25, r25 176a6: 89 2b or r24, r25 176a8: 59 f4 brne .+22 ; 0x176c0 next = i; 176aa: 30 2e mov r3, r16 176ac: 01 50 subi r16, 0x01 ; 1 176ae: 11 09 sbc r17, r1 176b0: f4 e0 ldi r31, 0x04 ; 4 176b2: ef 1a sub r14, r31 176b4: 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) { 176b6: 01 15 cp r16, r1 176b8: 11 05 cpc r17, r1 176ba: 79 f7 brne .-34 ; 0x1769a 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; 176bc: 80 e0 ldi r24, 0x00 ; 0 176be: 3c cf rjmp .-392 ; 0x17538 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; 176c0: 8c ef ldi r24, 0xFC ; 252 176c2: 83 0d add r24, r3 if(prev < 0) prev = 0; float f = (float)(i - prev) / THERMAL_MODEL_CAL_R_STEP; 176c4: 87 fd sbrc r24, 7 176c6: 80 e0 ldi r24, 0x00 ; 0 176c8: 08 2e mov r0, r24 176ca: 00 0c add r0, r0 176cc: 99 0b sbc r25, r25 float d = (thermal_model::data.R[next] - thermal_model::data.R[prev]); 176ce: fc 01 movw r30, r24 176d0: ee 0f add r30, r30 176d2: ff 1f adc r31, r31 176d4: ee 0f add r30, r30 176d6: ff 1f adc r31, r31 176d8: e0 51 subi r30, 0x10 ; 16 176da: fd 4e sbci r31, 0xED ; 237 176dc: 40 80 ld r4, Z 176de: 51 80 ldd r5, Z+1 ; 0x01 176e0: 62 80 ldd r6, Z+2 ; 0x02 176e2: 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; 176e4: b8 01 movw r22, r16 176e6: 68 1b sub r22, r24 176e8: 79 0b sbc r23, r25 176ea: 07 2e mov r0, r23 176ec: 00 0c add r0, r0 176ee: 88 0b sbc r24, r24 176f0: 99 0b sbc r25, r25 176f2: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 176f6: 20 e0 ldi r18, 0x00 ; 0 176f8: 30 e0 ldi r19, 0x00 ; 0 176fa: 40 e8 ldi r20, 0x80 ; 128 176fc: 5e e3 ldi r21, 0x3E ; 62 176fe: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 17702: 5b 01 movw r10, r22 17704: 6c 01 movw r12, r24 float d = (thermal_model::data.R[next] - thermal_model::data.R[prev]); 17706: a3 2d mov r26, r3 17708: b4 e0 ldi r27, 0x04 ; 4 1770a: ab 02 muls r26, r27 1770c: f0 01 movw r30, r0 1770e: 11 24 eor r1, r1 17710: e0 51 subi r30, 0x10 ; 16 17712: fd 4e sbci r31, 0xED ; 237 17714: a3 01 movw r20, r6 17716: 92 01 movw r18, r4 17718: 60 81 ld r22, Z 1771a: 71 81 ldd r23, Z+1 ; 0x01 1771c: 82 81 ldd r24, Z+2 ; 0x02 1771e: 93 81 ldd r25, Z+3 ; 0x03 17720: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 17724: 9b 01 movw r18, r22 17726: ac 01 movw r20, r24 thermal_model::data.R[i] = thermal_model::data.R[prev] + d * f; 17728: c6 01 movw r24, r12 1772a: b5 01 movw r22, r10 1772c: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 17730: a3 01 movw r20, r6 17732: 92 01 movw r18, r4 17734: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 17738: f7 01 movw r30, r14 1773a: 60 83 st Z, r22 1773c: 71 83 std Z+1, r23 ; 0x01 1773e: 82 83 std Z+2, r24 ; 0x02 17740: 93 83 std Z+3, r25 ; 0x03 17742: b4 cf rjmp .-152 ; 0x176ac // 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); 17744: 88 e0 ldi r24, 0x08 ; 8 17746: 0e 94 92 ee call 0x1dd24 ; 0x1dd24 lcd_setstatuspgm(MSG_WELCOME); 1774a: 83 e7 ldi r24, 0x73 ; 115 1774c: 90 e7 ldi r25, 0x70 ; 112 1774e: 0e 94 5d f1 call 0x1e2ba ; 0x1e2ba thermal_model_cal::set_fan_speed(0); 17752: 80 e0 ldi r24, 0x00 ; 0 17754: 0f 94 b7 2d call 0x25b6e ; 0x25b6e thermal_model_set_enabled(orig_enabled); 17758: 67 96 adiw r28, 0x17 ; 23 1775a: 8f ad ldd r24, Y+63 ; 0x3f 1775c: 67 97 sbiw r28, 0x17 ; 23 1775e: 0f 94 3d 32 call 0x2647a ; 0x2647a thermal_model_report_settings(); 17762: 0f 94 c1 2d call 0x25b82 ; 0x25b82 17766: 25 cf rjmp .-438 ; 0x175b2 M400 */ case 400: { st_synchronize(); 17768: 0f 94 e8 42 call 0x285d0 ; 0x285d0 1776c: 0c 94 ee aa jmp 0x155dc ; 0x155dc */ 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()) 17770: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 17774: 81 30 cpi r24, 0x01 ; 1 17776: 11 f0 breq .+4 ; 0x1777c 17778: 0c 94 ee aa jmp 0x155dc ; 0x155dc { uint8_t extruder = 255; uint8_t filament = FILAMENT_UNDEFINED; if(code_seen('E')) extruder = code_value_uint8(); 1777c: 85 e4 ldi r24, 0x45 ; 69 1777e: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 17782: 81 11 cpse r24, r1 17784: 0e 94 68 5b call 0xb6d0 ; 0xb6d0 if(code_seen('F')) filament = code_value_uint8(); 17788: 86 e4 ldi r24, 0x46 ; 70 1778a: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 1778e: 81 11 cpse r24, r1 17790: 0e 94 68 5b call 0xb6d0 ; 0xb6d0 MMU2_ECHO_MSGRPGM(PSTR("MMU2tool=")); SERIAL_ECHOLN((int)ex); } bool MMU2::set_filament_type(uint8_t /*slot*/, uint8_t /*type*/) { if (!WaitForMMUReady()) { 17794: 0f 94 84 88 call 0x31108 ; 0x31108 17798: 88 23 and r24, r24 1779a: 11 f4 brne .+4 ; 0x177a0 1779c: 0c 94 ee aa jmp 0x155dc ; 0x155dc // slot = slot; // @@TODO // type = type; // @@TODO // cmd_arg = filamentType; // command(MMU_CMD_F0 + index); if (!manage_response(false, false)) { 177a0: 60 e0 ldi r22, 0x00 ; 0 177a2: 80 e0 ldi r24, 0x00 ; 0 177a4: 0f 94 76 ac call 0x358ec ; 0x358ec 177a8: 0c 94 ee aa jmp 0x155dc ; 0x155dc */ case 406: // M406 Disable Filament Sensor { fsensor.setEnabled(0); 177ac: 80 e0 ldi r24, 0x00 ; 0 177ae: 0e 94 cf 74 call 0xe99e ; 0xe99e 177b2: 0c 94 ee aa jmp 0x155dc ; 0x155dc M500 */ case 500: { Config_StoreSettings(); 177b6: 0e 94 a4 82 call 0x10548 ; 0x10548 177ba: 0c 94 ee aa jmp 0x155dc ; 0x155dc M501 */ case 501: { Config_RetrieveSettings(); 177be: 0e 94 ac 93 call 0x12758 ; 0x12758 177c2: 0c 94 ee aa jmp 0x155dc ; 0x155dc M502 */ case 502: { Config_ResetDefault(); 177c6: 0e 94 8c 82 call 0x10518 ; 0x10518 177ca: 0c 94 ee aa jmp 0x155dc ; 0x155dc #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( 177ce: 80 91 21 0e lds r24, 0x0E21 ; 0x800e21 177d2: 8f 93 push r24 177d4: 80 91 20 0e lds r24, 0x0E20 ; 0x800e20 177d8: 8f 93 push r24 177da: 80 91 1f 0e lds r24, 0x0E1F ; 0x800e1f 177de: 8f 93 push r24 177e0: 80 91 1e 0e lds r24, 0x0E1E ; 0x800e1e 177e4: 8f 93 push r24 177e6: 80 91 1d 0e lds r24, 0x0E1D ; 0x800e1d 177ea: 8f 93 push r24 177ec: 80 91 1c 0e lds r24, 0x0E1C ; 0x800e1c 177f0: 8f 93 push r24 177f2: 80 91 1b 0e lds r24, 0x0E1B ; 0x800e1b 177f6: 8f 93 push r24 177f8: 80 91 1a 0e lds r24, 0x0E1A ; 0x800e1a 177fc: 8f 93 push r24 177fe: 80 91 19 0e lds r24, 0x0E19 ; 0x800e19 17802: 8f 93 push r24 17804: 80 91 18 0e lds r24, 0x0E18 ; 0x800e18 17808: 8f 93 push r24 1780a: 80 91 17 0e lds r24, 0x0E17 ; 0x800e17 1780e: 8f 93 push r24 17810: 80 91 16 0e lds r24, 0x0E16 ; 0x800e16 17814: 8f 93 push r24 17816: 02 ec ldi r16, 0xC2 ; 194 17818: 1b ea ldi r17, 0xAB ; 171 1781a: 1f 93 push r17 1781c: 0f 93 push r16 1781e: 1f 93 push r17 17820: 0f 93 push r16 17822: 80 91 15 0e lds r24, 0x0E15 ; 0x800e15 17826: 8f 93 push r24 17828: 80 91 14 0e lds r24, 0x0E14 ; 0x800e14 1782c: 8f 93 push r24 1782e: 80 91 13 0e lds r24, 0x0E13 ; 0x800e13 17832: 8f 93 push r24 17834: 80 91 12 0e lds r24, 0x0E12 ; 0x800e12 17838: 8f 93 push r24 1783a: 80 91 11 0e lds r24, 0x0E11 ; 0x800e11 1783e: 8f 93 push r24 17840: 80 91 10 0e lds r24, 0x0E10 ; 0x800e10 17844: 8f 93 push r24 17846: 80 91 0f 0e lds r24, 0x0E0F ; 0x800e0f 1784a: 8f 93 push r24 1784c: 80 91 0e 0e lds r24, 0x0E0E ; 0x800e0e 17850: 8f 93 push r24 17852: 80 91 0d 0e lds r24, 0x0E0D ; 0x800e0d 17856: 8f 93 push r24 17858: 80 91 0c 0e lds r24, 0x0E0C ; 0x800e0c 1785c: 8f 93 push r24 1785e: 80 91 0b 0e lds r24, 0x0E0B ; 0x800e0b 17862: 8f 93 push r24 17864: 80 91 0a 0e lds r24, 0x0E0A ; 0x800e0a 17868: 8f 93 push r24 1786a: 80 91 09 0e lds r24, 0x0E09 ; 0x800e09 1786e: 8f 93 push r24 17870: 80 91 08 0e lds r24, 0x0E08 ; 0x800e08 17874: 8f 93 push r24 17876: 80 91 07 0e lds r24, 0x0E07 ; 0x800e07 1787a: 8f 93 push r24 1787c: 80 91 06 0e lds r24, 0x0E06 ; 0x800e06 17880: 8f 93 push r24 17882: 80 91 05 0e lds r24, 0x0E05 ; 0x800e05 17886: 8f 93 push r24 17888: 80 91 04 0e lds r24, 0x0E04 ; 0x800e04 1788c: 8f 93 push r24 1788e: 80 91 03 0e lds r24, 0x0E03 ; 0x800e03 17892: 8f 93 push r24 17894: 80 91 02 0e lds r24, 0x0E02 ; 0x800e02 17898: 8f 93 push r24 1789a: 80 91 01 0e lds r24, 0x0E01 ; 0x800e01 1789e: 8f 93 push r24 178a0: 80 91 00 0e lds r24, 0x0E00 ; 0x800e00 178a4: 8f 93 push r24 178a6: 80 91 ff 0d lds r24, 0x0DFF ; 0x800dff 178aa: 8f 93 push r24 178ac: 80 91 fe 0d lds r24, 0x0DFE ; 0x800dfe 178b0: 8f 93 push r24 178b2: 80 91 fd 0d lds r24, 0x0DFD ; 0x800dfd 178b6: 8f 93 push r24 178b8: 80 91 fc 0d lds r24, 0x0DFC ; 0x800dfc 178bc: 8f 93 push r24 178be: 80 91 fb 0d lds r24, 0x0DFB ; 0x800dfb 178c2: 8f 93 push r24 178c4: 80 91 fa 0d lds r24, 0x0DFA ; 0x800dfa 178c8: 8f 93 push r24 178ca: 1f 93 push r17 178cc: 0f 93 push r16 178ce: 1f 93 push r17 178d0: 0f 93 push r16 178d2: 80 91 81 0e lds r24, 0x0E81 ; 0x800e81 178d6: 8f 93 push r24 178d8: 80 91 80 0e lds r24, 0x0E80 ; 0x800e80 178dc: 8f 93 push r24 178de: 80 91 7f 0e lds r24, 0x0E7F ; 0x800e7f 178e2: 8f 93 push r24 178e4: 80 91 7e 0e lds r24, 0x0E7E ; 0x800e7e 178e8: 8f 93 push r24 178ea: 80 91 f9 0d lds r24, 0x0DF9 ; 0x800df9 178ee: 8f 93 push r24 178f0: 80 91 f8 0d lds r24, 0x0DF8 ; 0x800df8 178f4: 8f 93 push r24 178f6: 80 91 f7 0d lds r24, 0x0DF7 ; 0x800df7 178fa: 8f 93 push r24 178fc: 80 91 f6 0d lds r24, 0x0DF6 ; 0x800df6 17900: 8f 93 push r24 17902: 80 91 f5 0d lds r24, 0x0DF5 ; 0x800df5 17906: 8f 93 push r24 17908: 80 91 f4 0d lds r24, 0x0DF4 ; 0x800df4 1790c: 8f 93 push r24 1790e: 80 91 f3 0d lds r24, 0x0DF3 ; 0x800df3 17912: 8f 93 push r24 17914: 80 91 f2 0d lds r24, 0x0DF2 ; 0x800df2 17918: 8f 93 push r24 1791a: 1f 93 push r17 1791c: 0f 93 push r16 1791e: 1f 93 push r17 17920: 0f 93 push r16 17922: 80 91 79 0e lds r24, 0x0E79 ; 0x800e79 17926: 8f 93 push r24 17928: 80 91 78 0e lds r24, 0x0E78 ; 0x800e78 1792c: 8f 93 push r24 1792e: 80 91 77 0e lds r24, 0x0E77 ; 0x800e77 17932: 8f 93 push r24 17934: 80 91 76 0e lds r24, 0x0E76 ; 0x800e76 17938: 8f 93 push r24 1793a: 80 91 75 0e lds r24, 0x0E75 ; 0x800e75 1793e: 8f 93 push r24 17940: 80 91 74 0e lds r24, 0x0E74 ; 0x800e74 17944: 8f 93 push r24 17946: 80 91 73 0e lds r24, 0x0E73 ; 0x800e73 1794a: 8f 93 push r24 1794c: 80 91 72 0e lds r24, 0x0E72 ; 0x800e72 17950: 8f 93 push r24 17952: 80 91 71 0e lds r24, 0x0E71 ; 0x800e71 17956: 8f 93 push r24 17958: 80 91 70 0e lds r24, 0x0E70 ; 0x800e70 1795c: 8f 93 push r24 1795e: 80 91 6f 0e lds r24, 0x0E6F ; 0x800e6f 17962: 8f 93 push r24 17964: 80 91 6e 0e lds r24, 0x0E6E ; 0x800e6e 17968: 8f 93 push r24 1796a: 80 91 6d 0e lds r24, 0x0E6D ; 0x800e6d 1796e: 8f 93 push r24 17970: 80 91 6c 0e lds r24, 0x0E6C ; 0x800e6c 17974: 8f 93 push r24 17976: 80 91 6b 0e lds r24, 0x0E6B ; 0x800e6b 1797a: 8f 93 push r24 1797c: 80 91 6a 0e lds r24, 0x0E6A ; 0x800e6a 17980: 8f 93 push r24 17982: 1f 93 push r17 17984: 0f 93 push r16 17986: 1f 93 push r17 17988: 0f 93 push r16 1798a: 80 91 f1 0d lds r24, 0x0DF1 ; 0x800df1 1798e: 8f 93 push r24 17990: 80 91 f0 0d lds r24, 0x0DF0 ; 0x800df0 17994: 8f 93 push r24 17996: 80 91 ef 0d lds r24, 0x0DEF ; 0x800def 1799a: 8f 93 push r24 1799c: 80 91 ee 0d lds r24, 0x0DEE ; 0x800dee 179a0: 8f 93 push r24 179a2: 80 91 ed 0d lds r24, 0x0DED ; 0x800ded 179a6: 8f 93 push r24 179a8: 80 91 ec 0d lds r24, 0x0DEC ; 0x800dec 179ac: 8f 93 push r24 179ae: 80 91 eb 0d lds r24, 0x0DEB ; 0x800deb 179b2: 8f 93 push r24 179b4: 80 91 ea 0d lds r24, 0x0DEA ; 0x800dea 179b8: 8f 93 push r24 179ba: 80 91 e9 0d lds r24, 0x0DE9 ; 0x800de9 179be: 8f 93 push r24 179c0: 80 91 e8 0d lds r24, 0x0DE8 ; 0x800de8 179c4: 8f 93 push r24 179c6: 80 91 e7 0d lds r24, 0x0DE7 ; 0x800de7 179ca: 8f 93 push r24 179cc: 80 91 e6 0d lds r24, 0x0DE6 ; 0x800de6 179d0: 8f 93 push r24 179d2: 80 91 e5 0d lds r24, 0x0DE5 ; 0x800de5 179d6: 8f 93 push r24 179d8: 80 91 e4 0d lds r24, 0x0DE4 ; 0x800de4 179dc: 8f 93 push r24 179de: 80 91 e3 0d lds r24, 0x0DE3 ; 0x800de3 179e2: 8f 93 push r24 179e4: 80 91 e2 0d lds r24, 0x0DE2 ; 0x800de2 179e8: 8f 93 push r24 179ea: 1f 93 push r17 179ec: 0f 93 push r16 179ee: 1f 93 push r17 179f0: 0f 93 push r16 179f2: 80 91 69 0e lds r24, 0x0E69 ; 0x800e69 179f6: 8f 93 push r24 179f8: 80 91 68 0e lds r24, 0x0E68 ; 0x800e68 179fc: 8f 93 push r24 179fe: 80 91 67 0e lds r24, 0x0E67 ; 0x800e67 17a02: 8f 93 push r24 17a04: 80 91 66 0e lds r24, 0x0E66 ; 0x800e66 17a08: 8f 93 push r24 17a0a: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 17a0e: 8f 93 push r24 17a10: 80 91 64 0e lds r24, 0x0E64 ; 0x800e64 17a14: 8f 93 push r24 17a16: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 17a1a: 8f 93 push r24 17a1c: 80 91 62 0e lds r24, 0x0E62 ; 0x800e62 17a20: 8f 93 push r24 17a22: 80 91 61 0e lds r24, 0x0E61 ; 0x800e61 17a26: 8f 93 push r24 17a28: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 17a2c: 8f 93 push r24 17a2e: 80 91 5f 0e lds r24, 0x0E5F ; 0x800e5f 17a32: 8f 93 push r24 17a34: 80 91 5e 0e lds r24, 0x0E5E ; 0x800e5e 17a38: 8f 93 push r24 17a3a: 80 91 5d 0e lds r24, 0x0E5D ; 0x800e5d 17a3e: 8f 93 push r24 17a40: 80 91 5c 0e lds r24, 0x0E5C ; 0x800e5c 17a44: 8f 93 push r24 17a46: 80 91 5b 0e lds r24, 0x0E5B ; 0x800e5b 17a4a: 8f 93 push r24 17a4c: 80 91 5a 0e lds r24, 0x0E5A ; 0x800e5a 17a50: 8f 93 push r24 17a52: 1f 93 push r17 17a54: 0f 93 push r16 17a56: 1f 93 push r17 17a58: 0f 93 push r16 17a5a: 80 91 e1 0d lds r24, 0x0DE1 ; 0x800de1 17a5e: 8f 93 push r24 17a60: 80 91 e0 0d lds r24, 0x0DE0 ; 0x800de0 17a64: 8f 93 push r24 17a66: 80 91 df 0d lds r24, 0x0DDF ; 0x800ddf 17a6a: 8f 93 push r24 17a6c: 80 91 de 0d lds r24, 0x0DDE ; 0x800dde 17a70: 8f 93 push r24 17a72: 80 91 dd 0d lds r24, 0x0DDD ; 0x800ddd 17a76: 8f 93 push r24 17a78: 80 91 dc 0d lds r24, 0x0DDC ; 0x800ddc 17a7c: 8f 93 push r24 17a7e: 80 91 db 0d lds r24, 0x0DDB ; 0x800ddb 17a82: 8f 93 push r24 17a84: 80 91 da 0d lds r24, 0x0DDA ; 0x800dda 17a88: 8f 93 push r24 17a8a: 80 91 d9 0d lds r24, 0x0DD9 ; 0x800dd9 17a8e: 8f 93 push r24 17a90: 80 91 d8 0d lds r24, 0x0DD8 ; 0x800dd8 17a94: 8f 93 push r24 17a96: 80 91 d7 0d lds r24, 0x0DD7 ; 0x800dd7 17a9a: 8f 93 push r24 17a9c: 80 91 d6 0d lds r24, 0x0DD6 ; 0x800dd6 17aa0: 8f 93 push r24 17aa2: 80 91 d5 0d lds r24, 0x0DD5 ; 0x800dd5 17aa6: 8f 93 push r24 17aa8: 80 91 d4 0d lds r24, 0x0DD4 ; 0x800dd4 17aac: 8f 93 push r24 17aae: 80 91 d3 0d lds r24, 0x0DD3 ; 0x800dd3 17ab2: 8f 93 push r24 17ab4: 80 91 d2 0d lds r24, 0x0DD2 ; 0x800dd2 17ab8: 8f 93 push r24 17aba: 1f 93 push r17 17abc: 0f 93 push r16 17abe: 1f 93 push r17 17ac0: 0f 93 push r16 17ac2: 80 91 7d 0e lds r24, 0x0E7D ; 0x800e7d 17ac6: 1f 92 push r1 17ac8: 8f 93 push r24 17aca: 80 91 7c 0e lds r24, 0x0E7C ; 0x800e7c 17ace: 1f 92 push r1 17ad0: 8f 93 push r24 17ad2: 80 91 7b 0e lds r24, 0x0E7B ; 0x800e7b 17ad6: 1f 92 push r1 17ad8: 8f 93 push r24 17ada: 80 91 7a 0e lds r24, 0x0E7A ; 0x800e7a 17ade: 1f 92 push r1 17ae0: 8f 93 push r24 17ae2: 1f 93 push r17 17ae4: 0f 93 push r16 17ae6: 1f 93 push r17 17ae8: 0f 93 push r16 17aea: 80 91 d1 0d lds r24, 0x0DD1 ; 0x800dd1 17aee: 8f 93 push r24 17af0: 80 91 d0 0d lds r24, 0x0DD0 ; 0x800dd0 17af4: 8f 93 push r24 17af6: 80 91 cf 0d lds r24, 0x0DCF ; 0x800dcf 17afa: 8f 93 push r24 17afc: 80 91 ce 0d lds r24, 0x0DCE ; 0x800dce 17b00: 8f 93 push r24 17b02: 80 91 cd 0d lds r24, 0x0DCD ; 0x800dcd 17b06: 8f 93 push r24 17b08: 80 91 cc 0d lds r24, 0x0DCC ; 0x800dcc 17b0c: 8f 93 push r24 17b0e: 80 91 cb 0d lds r24, 0x0DCB ; 0x800dcb 17b12: 8f 93 push r24 17b14: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 17b18: 8f 93 push r24 17b1a: 80 91 c9 0d lds r24, 0x0DC9 ; 0x800dc9 17b1e: 8f 93 push r24 17b20: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 17b24: 8f 93 push r24 17b26: 80 91 c7 0d lds r24, 0x0DC7 ; 0x800dc7 17b2a: 8f 93 push r24 17b2c: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 17b30: 8f 93 push r24 17b32: 80 91 c5 0d lds r24, 0x0DC5 ; 0x800dc5 17b36: 8f 93 push r24 17b38: 80 91 c4 0d lds r24, 0x0DC4 ; 0x800dc4 17b3c: 8f 93 push r24 17b3e: 80 91 c3 0d lds r24, 0x0DC3 ; 0x800dc3 17b42: 8f 93 push r24 17b44: 80 91 c2 0d lds r24, 0x0DC2 ; 0x800dc2 17b48: 8f 93 push r24 17b4a: 1f 93 push r17 17b4c: 0f 93 push r16 17b4e: 1f 93 push r17 17b50: 0f 93 push r16 17b52: 88 ed ldi r24, 0xD8 ; 216 17b54: 90 e8 ldi r25, 0x80 ; 128 17b56: 9f 93 push r25 17b58: 8f 93 push r24 17b5a: 0f 94 de da call 0x3b5bc ; 0x3b5bc 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"), 17b5e: 0f b6 in r0, 0x3f ; 63 17b60: f8 94 cli 17b62: de bf out 0x3e, r29 ; 62 17b64: 0f be out 0x3f, r0 ; 63 17b66: 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; 17b68: 2c ea ldi r18, 0xAC ; 172 17b6a: 35 ec ldi r19, 0xC5 ; 197 17b6c: 47 e2 ldi r20, 0x27 ; 39 17b6e: 5e e3 ldi r21, 0x3E ; 62 17b70: 60 91 2e 0e lds r22, 0x0E2E ; 0x800e2e 17b74: 70 91 2f 0e lds r23, 0x0E2F ; 0x800e2f 17b78: 80 91 30 0e lds r24, 0x0E30 ; 0x800e30 17b7c: 90 91 31 0e lds r25, 0x0E31 ; 0x800e31 17b80: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 17b84: 9f 93 push r25 17b86: 8f 93 push r24 17b88: 7f 93 push r23 17b8a: 6f 93 push r22 } float unscalePID_i(float i) { return i/PID_dT; 17b8c: 2c ea ldi r18, 0xAC ; 172 17b8e: 35 ec ldi r19, 0xC5 ; 197 17b90: 47 e2 ldi r20, 0x27 ; 39 17b92: 5e e3 ldi r21, 0x3E ; 62 17b94: 60 91 2a 0e lds r22, 0x0E2A ; 0x800e2a 17b98: 70 91 2b 0e lds r23, 0x0E2B ; 0x800e2b 17b9c: 80 91 2c 0e lds r24, 0x0E2C ; 0x800e2c 17ba0: 90 91 2d 0e lds r25, 0x0E2D ; 0x800e2d 17ba4: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 17ba8: 9f 93 push r25 17baa: 8f 93 push r24 17bac: 7f 93 push r23 17bae: 6f 93 push r22 17bb0: 80 91 29 0e lds r24, 0x0E29 ; 0x800e29 17bb4: 8f 93 push r24 17bb6: 80 91 28 0e lds r24, 0x0E28 ; 0x800e28 17bba: 8f 93 push r24 17bbc: 80 91 27 0e lds r24, 0x0E27 ; 0x800e27 17bc0: 8f 93 push r24 17bc2: 80 91 26 0e lds r24, 0x0E26 ; 0x800e26 17bc6: 8f 93 push r24 17bc8: 1f 93 push r17 17bca: 0f 93 push r16 17bcc: 1f 93 push r17 17bce: 0f 93 push r16 17bd0: 8b ea ldi r24, 0xAB ; 171 17bd2: 90 e8 ldi r25, 0x80 ; 128 17bd4: 9f 93 push r25 17bd6: 8f 93 push r24 17bd8: 0f 94 de da call 0x3b5bc ; 0x3b5bc #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 17bdc: 2c ea ldi r18, 0xAC ; 172 17bde: 35 ec ldi r19, 0xC5 ; 197 17be0: 47 e2 ldi r20, 0x27 ; 39 17be2: 5e e3 ldi r21, 0x3E ; 62 17be4: 60 91 3a 0e lds r22, 0x0E3A ; 0x800e3a 17be8: 70 91 3b 0e lds r23, 0x0E3B ; 0x800e3b 17bec: 80 91 3c 0e lds r24, 0x0E3C ; 0x800e3c 17bf0: 90 91 3d 0e lds r25, 0x0E3D ; 0x800e3d 17bf4: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__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"), 17bf8: 9f 93 push r25 17bfa: 8f 93 push r24 17bfc: 7f 93 push r23 17bfe: 6f 93 push r22 } float unscalePID_i(float i) { return i/PID_dT; 17c00: 2c ea ldi r18, 0xAC ; 172 17c02: 35 ec ldi r19, 0xC5 ; 197 17c04: 47 e2 ldi r20, 0x27 ; 39 17c06: 5e e3 ldi r21, 0x3E ; 62 17c08: 60 91 36 0e lds r22, 0x0E36 ; 0x800e36 17c0c: 70 91 37 0e lds r23, 0x0E37 ; 0x800e37 17c10: 80 91 38 0e lds r24, 0x0E38 ; 0x800e38 17c14: 90 91 39 0e lds r25, 0x0E39 ; 0x800e39 17c18: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 17c1c: 9f 93 push r25 17c1e: 8f 93 push r24 17c20: 7f 93 push r23 17c22: 6f 93 push r22 17c24: 80 91 35 0e lds r24, 0x0E35 ; 0x800e35 17c28: 8f 93 push r24 17c2a: 80 91 34 0e lds r24, 0x0E34 ; 0x800e34 17c2e: 8f 93 push r24 17c30: 80 91 33 0e lds r24, 0x0E33 ; 0x800e33 17c34: 8f 93 push r24 17c36: 80 91 32 0e lds r24, 0x0E32 ; 0x800e32 17c3a: 8f 93 push r24 17c3c: 1f 93 push r17 17c3e: 0f 93 push r16 17c40: 1f 93 push r17 17c42: 0f 93 push r16 17c44: 86 e7 ldi r24, 0x76 ; 118 17c46: 90 e8 ldi r25, 0x80 ; 128 17c48: 9f 93 push r25 17c4a: 8f 93 push r24 17c4c: 0f 94 de da call 0x3b5bc ; 0x3b5bc echomagic, echomagic, cs.bedKp, unscalePID_i(cs.bedKi), unscalePID_d(cs.bedKd)); #endif #ifdef FWRETRACT printf_P(PSTR( 17c50: 0f b6 in r0, 0x3f ; 63 17c52: f8 94 cli 17c54: de bf out 0x3e, r29 ; 62 17c56: 0f be out 0x3f, r0 ; 63 17c58: cd bf out 0x3d, r28 ; 61 17c5a: 80 91 40 0e lds r24, 0x0E40 ; 0x800e40 17c5e: 1f 92 push r1 17c60: 8f 93 push r24 17c62: 1f 93 push r17 17c64: 0f 93 push r16 17c66: 1f 93 push r17 17c68: 0f 93 push r16 17c6a: 20 e0 ldi r18, 0x00 ; 0 17c6c: 30 e0 ldi r19, 0x00 ; 0 17c6e: 40 e7 ldi r20, 0x70 ; 112 17c70: 52 e4 ldi r21, 0x42 ; 66 17c72: 60 91 51 0e lds r22, 0x0E51 ; 0x800e51 17c76: 70 91 52 0e lds r23, 0x0E52 ; 0x800e52 17c7a: 80 91 53 0e lds r24, 0x0E53 ; 0x800e53 17c7e: 90 91 54 0e lds r25, 0x0E54 ; 0x800e54 17c82: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 17c86: 9f 93 push r25 17c88: 8f 93 push r24 17c8a: 7f 93 push r23 17c8c: 6f 93 push r22 17c8e: 80 91 50 0e lds r24, 0x0E50 ; 0x800e50 17c92: 8f 93 push r24 17c94: 80 91 4f 0e lds r24, 0x0E4F ; 0x800e4f 17c98: 8f 93 push r24 17c9a: 80 91 4e 0e lds r24, 0x0E4E ; 0x800e4e 17c9e: 8f 93 push r24 17ca0: 80 91 4d 0e lds r24, 0x0E4D ; 0x800e4d 17ca4: 8f 93 push r24 17ca6: 1f 93 push r17 17ca8: 0f 93 push r16 17caa: 1f 93 push r17 17cac: 0f 93 push r16 17cae: 80 91 4c 0e lds r24, 0x0E4C ; 0x800e4c 17cb2: 8f 93 push r24 17cb4: 80 91 4b 0e lds r24, 0x0E4B ; 0x800e4b 17cb8: 8f 93 push r24 17cba: 80 91 4a 0e lds r24, 0x0E4A ; 0x800e4a 17cbe: 8f 93 push r24 17cc0: 80 91 49 0e lds r24, 0x0E49 ; 0x800e49 17cc4: 8f 93 push r24 17cc6: 20 e0 ldi r18, 0x00 ; 0 17cc8: 30 e0 ldi r19, 0x00 ; 0 17cca: 40 e7 ldi r20, 0x70 ; 112 17ccc: 52 e4 ldi r21, 0x42 ; 66 17cce: 60 91 45 0e lds r22, 0x0E45 ; 0x800e45 17cd2: 70 91 46 0e lds r23, 0x0E46 ; 0x800e46 17cd6: 80 91 47 0e lds r24, 0x0E47 ; 0x800e47 17cda: 90 91 48 0e lds r25, 0x0E48 ; 0x800e48 17cde: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 17ce2: 9f 93 push r25 17ce4: 8f 93 push r24 17ce6: 7f 93 push r23 17ce8: 6f 93 push r22 17cea: 80 91 44 0e lds r24, 0x0E44 ; 0x800e44 17cee: 8f 93 push r24 17cf0: 80 91 43 0e lds r24, 0x0E43 ; 0x800e43 17cf4: 8f 93 push r24 17cf6: 80 91 42 0e lds r24, 0x0E42 ; 0x800e42 17cfa: 8f 93 push r24 17cfc: 80 91 41 0e lds r24, 0x0E41 ; 0x800e41 17d00: 8f 93 push r24 17d02: 1f 93 push r17 17d04: 0f 93 push r16 17d06: 1f 93 push r17 17d08: 0f 93 push r16 17d0a: 85 e7 ldi r24, 0x75 ; 117 17d0c: 9f e7 ldi r25, 0x7F ; 127 17d0e: 9f 93 push r25 17d10: 8f 93 push r24 17d12: 0f 94 de da call 0x3b5bc ; 0x3b5bc ); #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) { 17d16: 0f b6 in r0, 0x3f ; 63 17d18: f8 94 cli 17d1a: de bf out 0x3e, r29 ; 62 17d1c: 0f be out 0x3f, r0 ; 63 17d1e: cd bf out 0x3d, r28 ; 61 17d20: 80 91 55 0e lds r24, 0x0E55 ; 0x800e55 17d24: 88 23 and r24, r24 17d26: 09 f4 brne .+2 ; 0x17d2a 17d28: 58 c0 rjmp .+176 ; 0x17dda printf_P(PSTR("%SFilament settings:\n%S M200 D%.2f\n"), 17d2a: 80 91 59 0e lds r24, 0x0E59 ; 0x800e59 17d2e: 8f 93 push r24 17d30: 80 91 58 0e lds r24, 0x0E58 ; 0x800e58 17d34: 8f 93 push r24 17d36: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 17d3a: 8f 93 push r24 17d3c: 80 91 56 0e lds r24, 0x0E56 ; 0x800e56 17d40: 8f 93 push r24 17d42: 1f 93 push r17 17d44: 0f 93 push r16 17d46: 1f 93 push r17 17d48: 0f 93 push r16 17d4a: 8f e4 ldi r24, 0x4F ; 79 17d4c: 9f e7 ldi r25, 0x7F ; 127 17d4e: 9f 93 push r25 17d50: 8f 93 push r24 17d52: 0f 94 de da call 0x3b5bc ; 0x3b5bc 17d56: 0f b6 in r0, 0x3f ; 63 17d58: f8 94 cli 17d5a: de bf out 0x3e, r29 ; 62 17d5c: 0f be out 0x3f, r0 ; 63 17d5e: 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( 17d60: 80 91 8e 0e lds r24, 0x0E8E ; 0x800e8e 17d64: 8f 93 push r24 17d66: 80 91 8d 0e lds r24, 0x0E8D ; 0x800e8d 17d6a: 8f 93 push r24 17d6c: 80 91 8c 0e lds r24, 0x0E8C ; 0x800e8c 17d70: 8f 93 push r24 17d72: 80 91 8b 0e lds r24, 0x0E8B ; 0x800e8b 17d76: 8f 93 push r24 17d78: 80 91 8a 0e lds r24, 0x0E8A ; 0x800e8a 17d7c: 1f 92 push r1 17d7e: 8f 93 push r24 17d80: 80 91 89 0e lds r24, 0x0E89 ; 0x800e89 17d84: 8f 93 push r24 17d86: 80 91 88 0e lds r24, 0x0E88 ; 0x800e88 17d8a: 8f 93 push r24 17d8c: 80 91 87 0e lds r24, 0x0E87 ; 0x800e87 17d90: 8f 93 push r24 17d92: 80 91 86 0e lds r24, 0x0E86 ; 0x800e86 17d96: 8f 93 push r24 17d98: 80 91 85 0e lds r24, 0x0E85 ; 0x800e85 17d9c: 8f 93 push r24 17d9e: 80 91 84 0e lds r24, 0x0E84 ; 0x800e84 17da2: 8f 93 push r24 17da4: 80 91 83 0e lds r24, 0x0E83 ; 0x800e83 17da8: 8f 93 push r24 17daa: 80 91 82 0e lds r24, 0x0E82 ; 0x800e82 17dae: 8f 93 push r24 17db0: 82 ec ldi r24, 0xC2 ; 194 17db2: 9b ea ldi r25, 0xAB ; 171 17db4: 9f 93 push r25 17db6: 8f 93 push r24 17db8: 9f 93 push r25 17dba: 8f 93 push r24 17dbc: 8e ea ldi r24, 0xAE ; 174 17dbe: 9e e7 ldi r25, 0x7E ; 126 17dc0: 9f 93 push r25 17dc2: 8f 93 push r24 17dc4: 0f 94 de da call 0x3b5bc ; 0x3b5bc "%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(); 17dc8: 0f 94 c1 2d call 0x25b82 ; 0x25b82 17dcc: 0f b6 in r0, 0x3f ; 63 17dce: f8 94 cli 17dd0: de bf out 0x3e, r29 ; 62 17dd2: 0f be out 0x3f, r0 ; 63 17dd4: cd bf out 0x3d, r28 ; 61 17dd6: 0c 94 ee aa jmp 0x155dc ; 0x155dc 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); 17dda: 1f 93 push r17 17ddc: 0f 93 push r16 17dde: 80 e3 ldi r24, 0x30 ; 48 17de0: 9f e7 ldi r25, 0x7F ; 127 17de2: 9f 93 push r25 17de4: 8f 93 push r24 17de6: 0f 94 de da call 0x3b5bc ; 0x3b5bc 17dea: 0f 90 pop r0 17dec: 0f 90 pop r0 17dee: 0f 90 pop r0 17df0: 0f 90 pop r0 17df2: b6 cf rjmp .-148 ; 0x17d60 #### Parameters - `P` - The IP address in xxx.xxx.xxx.xxx format. Eg: P192.168.1.14 */ case 552: { if (code_seen('P')) 17df4: 80 e5 ldi r24, 0x50 ; 80 17df6: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 17dfa: 88 23 and r24, r24 17dfc: 11 f4 brne .+4 ; 0x17e02 17dfe: 0c 94 ee aa jmp 0x155dc ; 0x155dc { uint8_t valCnt = 0; IP_address = 0; 17e02: 10 92 5e 06 sts 0x065E, r1 ; 0x80065e 17e06: 10 92 5f 06 sts 0x065F, r1 ; 0x80065f 17e0a: 10 92 60 06 sts 0x0660, r1 ; 0x800660 17e0e: 10 92 61 06 sts 0x0661, r1 ; 0x800661 17e12: 0e e5 ldi r16, 0x5E ; 94 17e14: 16 e0 ldi r17, 0x06 ; 6 17e16: 42 e6 ldi r20, 0x62 ; 98 17e18: e4 2e mov r14, r20 17e1a: 46 e0 ldi r20, 0x06 ; 6 17e1c: f4 2e mov r15, r20 do { *strchr_pointer = '*'; 17e1e: 5a e2 ldi r21, 0x2A ; 42 17e20: d5 2e mov r13, r21 17e22: e0 91 95 03 lds r30, 0x0395 ; 0x800395 17e26: f0 91 96 03 lds r31, 0x0396 ; 0x800396 17e2a: d0 82 st Z, r13 ((uint8_t*)&IP_address)[valCnt] = code_value_short(); 17e2c: 0e 94 75 5b call 0xb6ea ; 0xb6ea 17e30: d8 01 movw r26, r16 17e32: 8d 93 st X+, r24 17e34: 8d 01 movw r16, r26 valCnt++; } while ((valCnt < 4) && code_seen('.')); 17e36: ea 16 cp r14, r26 17e38: fb 06 cpc r15, r27 17e3a: 11 f4 brne .+4 ; 0x17e40 17e3c: 0c 94 ee aa jmp 0x155dc ; 0x155dc 17e40: 8e e2 ldi r24, 0x2E ; 46 17e42: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 17e46: 81 11 cpse r24, r1 17e48: ec cf rjmp .-40 ; 0x17e22 if (valCnt != 4) IP_address = 0; 17e4a: 10 92 5e 06 sts 0x065E, r1 ; 0x80065e 17e4e: 10 92 5f 06 sts 0x065F, r1 ; 0x80065f 17e52: 10 92 60 06 sts 0x0660, r1 ; 0x800660 17e56: 10 92 61 06 sts 0x0661, r1 ; 0x800661 17e5a: 0c 94 ee aa jmp 0x155dc ; 0x155dc - `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(); 17e5e: 0f 94 e8 42 call 0x285d0 ; 0x285d0 /// 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; 17e62: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 17e66: 81 11 cpse r24, r1 17e68: 02 c0 rjmp .+4 ; 0x17e6e 17e6a: 0e 94 49 64 call 0xc892 ; 0xc892 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(); 17e6e: 85 e4 ldi r24, 0x45 ; 69 17e70: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 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; 17e74: 81 2c mov r8, r1 17e76: 91 2c mov r9, r1 17e78: a1 2c mov r10, r1 17e7a: 30 ec ldi r19, 0xC0 ; 192 17e7c: 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(); 17e7e: 88 23 and r24, r24 17e80: 21 f0 breq .+8 ; 0x17e8a 17e82: 0e 94 9d 60 call 0xc13a ; 0xc13a 17e86: 4b 01 movw r8, r22 17e88: 5c 01 movw r10, r24 if (code_seen('L')) e_shift_late = code_value(); 17e8a: 8c e4 ldi r24, 0x4C ; 76 17e8c: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 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; 17e90: c1 2c mov r12, r1 17e92: d1 2c mov r13, r1 17e94: 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(); 17e96: 88 23 and r24, r24 17e98: 21 f0 breq .+8 ; 0x17ea2 17e9a: 0e 94 9d 60 call 0xc13a ; 0xc13a 17e9e: 6b 01 movw r12, r22 17ea0: 7c 01 movw r14, r24 // Z lift. For safety only allow positive values if (code_seen('Z')) z_shift = fabs(code_value()); 17ea2: 8a e5 ldi r24, 0x5A ; 90 17ea4: 0e 94 d6 5b call 0xb7ac ; 0xb7ac // 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; 17ea8: 41 2c mov r4, r1 17eaa: 51 2c mov r5, r1 17eac: 28 ed ldi r18, 0xD8 ; 216 17eae: 62 2e mov r6, r18 17eb0: 21 e4 ldi r18, 0x41 ; 65 17eb2: 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()); 17eb4: 88 23 and r24, r24 17eb6: 31 f0 breq .+12 ; 0x17ec4 17eb8: 0e 94 9d 60 call 0xc13a ; 0xc13a 17ebc: 2b 01 movw r4, r22 17ebe: 3c 01 movw r6, r24 17ec0: e8 94 clt 17ec2: 77 f8 bld r7, 7 //Move XY to side if (code_seen('X')) x_position = code_value(); 17ec4: 88 e5 ldi r24, 0x58 ; 88 17ec6: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 17eca: 88 23 and r24, r24 17ecc: 09 f4 brne .+2 ; 0x17ed0 17ece: 49 c1 rjmp .+658 ; 0x18162 17ed0: 0e 94 9d 60 call 0xc13a ; 0xc13a 17ed4: 6a 96 adiw r28, 0x1a ; 26 17ed6: 6c af std Y+60, r22 ; 0x3c 17ed8: 7d af std Y+61, r23 ; 0x3d 17eda: 8e af std Y+62, r24 ; 0x3e 17edc: 9f af std Y+63, r25 ; 0x3f 17ede: 6a 97 sbiw r28, 0x1a ; 26 if (code_seen('Y')) y_position = code_value(); 17ee0: 89 e5 ldi r24, 0x59 ; 89 17ee2: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 17ee6: 88 23 and r24, r24 17ee8: 09 f4 brne .+2 ; 0x17eec 17eea: 46 c1 rjmp .+652 ; 0x18178 17eec: 0e 94 9d 60 call 0xc13a ; 0xc13a 17ef0: 6e 96 adiw r28, 0x1e ; 30 17ef2: 6c af std Y+60, r22 ; 0x3c 17ef4: 7d af std Y+61, r23 ; 0x3d 17ef6: 8e af std Y+62, r24 ; 0x3e 17ef8: 9f af std Y+63, r25 ; 0x3f 17efa: 6e 97 sbiw r28, 0x1e ; 30 // Filament name to show during the loading char filament_name[LCD_WIDTH + 1] = ""; 17efc: 1a 82 std Y+2, r1 ; 0x02 17efe: 19 82 std Y+1, r1 ; 0x01 17f00: fe 01 movw r30, r28 17f02: 33 96 adiw r30, 0x03 ; 3 17f04: 83 e1 ldi r24, 0x13 ; 19 17f06: df 01 movw r26, r30 17f08: 1d 92 st X+, r1 17f0a: 8a 95 dec r24 17f0c: e9 f7 brne .-6 ; 0x17f08 if (code_seen('C')) { 17f0e: 83 e4 ldi r24, 0x43 ; 67 17f10: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 17f14: 88 23 and r24, r24 17f16: f9 f0 breq .+62 ; 0x17f56 , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 17f18: 62 e2 ldi r22, 0x22 ; 34 17f1a: 70 e0 ldi r23, 0x00 ; 0 17f1c: 80 91 95 03 lds r24, 0x0395 ; 0x800395 17f20: 90 91 96 03 lds r25, 0x0396 ; 0x800396 17f24: 0f 94 73 e2 call 0x3c4e6 ; 0x3c4e6 17f28: 8c 01 movw r16, r24 if (!this->ptr) { 17f2a: 89 2b or r24, r25 17f2c: a1 f0 breq .+40 ; 0x17f56 // First quote not found return; } // Skip the leading quote this->ptr++; 17f2e: 0f 5f subi r16, 0xFF ; 255 17f30: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 17f32: 62 e2 ldi r22, 0x22 ; 34 17f34: 70 e0 ldi r23, 0x00 ; 0 17f36: c8 01 movw r24, r16 17f38: 0f 94 73 e2 call 0x3c4e6 ; 0x3c4e6 if(!pStrEnd) { 17f3c: 00 97 sbiw r24, 0x00 ; 0 17f3e: 59 f0 breq .+22 ; 0x17f56 // Second quote not found return; } this->len = pStrEnd - this->ptr; 17f40: 80 1b sub r24, r16 unquoted_string str = unquoted_string(strchr_pointer); if (str.WasFound()) { const uint8_t len = min(str.GetLength(), LCD_WIDTH); 17f42: 84 31 cpi r24, 0x14 ; 20 17f44: 08 f0 brcs .+2 ; 0x17f48 17f46: 84 e1 ldi r24, 0x14 ; 20 memcpy(filament_name, str.GetUnquotedString(), len); 17f48: 48 2f mov r20, r24 17f4a: 50 e0 ldi r21, 0x00 ; 0 17f4c: b8 01 movw r22, r16 17f4e: ce 01 movw r24, r28 17f50: 01 96 adiw r24, 0x01 ; 1 17f52: 0f 94 45 e2 call 0x3c48a ; 0x3c48a } } if (MMU2::mmu2.Enabled() && code_seen_P(PSTR("AUTO"))) 17f56: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 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; 17f5a: 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"))) 17f5c: 81 30 cpi r24, 0x01 ; 1 17f5e: 29 f4 brne .+10 ; 0x17f6a 17f60: 8a e2 ldi r24, 0x2A ; 42 17f62: 96 e8 ldi r25, 0x86 ; 134 17f64: 0e 94 26 68 call 0xd04c ; 0xd04c 17f68: 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(); 17f6a: 0f 94 e8 42 call 0x285d0 ; 0x285d0 uint8_t eject_slot = 0; prusa_statistics(22); // Turn off the fan fanSpeed = 0; 17f6e: 10 92 e7 03 sts 0x03E7, r1 ; 0x8003e7 // Retract E if (!printingIsPaused()) 17f72: 0e 94 85 67 call 0xcf0a ; 0xcf0a 17f76: 81 11 cpse r24, r1 17f78: 06 c1 rjmp .+524 ; 0x18186 { current_position[E_AXIS] += e_shift; 17f7a: a5 01 movw r20, r10 17f7c: 94 01 movw r18, r8 17f7e: 60 91 9e 06 lds r22, 0x069E ; 0x80069e 17f82: 70 91 9f 06 lds r23, 0x069F ; 0x80069f 17f86: 80 91 a0 06 lds r24, 0x06A0 ; 0x8006a0 17f8a: 90 91 a1 06 lds r25, 0x06A1 ; 0x8006a1 17f8e: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 17f92: 60 93 9e 06 sts 0x069E, r22 ; 0x80069e 17f96: 70 93 9f 06 sts 0x069F, r23 ; 0x80069f 17f9a: 80 93 a0 06 sts 0x06A0, r24 ; 0x8006a0 17f9e: 90 93 a1 06 sts 0x06A1, r25 ; 0x8006a1 plan_buffer_line_curposXYZE(FILAMENTCHANGE_RFEED); 17fa2: 60 e0 ldi r22, 0x00 ; 0 17fa4: 70 e0 ldi r23, 0x00 ; 0 17fa6: 88 ee ldi r24, 0xE8 ; 232 17fa8: 92 e4 ldi r25, 0x42 ; 66 17faa: 0f 94 49 c0 call 0x38092 ; 0x38092 st_synchronize(); 17fae: 0f 94 e8 42 call 0x285d0 ; 0x285d0 SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_PAUSED); 17fb2: 89 ef ldi r24, 0xF9 ; 249 17fb4: 9e e6 ldi r25, 0x6E ; 110 17fb6: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 // Filament change can be issued via the Tune menu restore_extruder_temperature_from_ram(); } // Raise the Z axis raise_z(z_shift); 17fba: c3 01 movw r24, r6 17fbc: b2 01 movw r22, r4 17fbe: 0e 94 e1 6d call 0xdbc2 ; 0xdbc2 // Move XY to side current_position[X_AXIS] = x_position; 17fc2: 6a 96 adiw r28, 0x1a ; 26 17fc4: 2c ad ldd r18, Y+60 ; 0x3c 17fc6: 3d ad ldd r19, Y+61 ; 0x3d 17fc8: 4e ad ldd r20, Y+62 ; 0x3e 17fca: 5f ad ldd r21, Y+63 ; 0x3f 17fcc: 6a 97 sbiw r28, 0x1a ; 26 17fce: 20 93 92 06 sts 0x0692, r18 ; 0x800692 17fd2: 30 93 93 06 sts 0x0693, r19 ; 0x800693 17fd6: 40 93 94 06 sts 0x0694, r20 ; 0x800694 17fda: 50 93 95 06 sts 0x0695, r21 ; 0x800695 current_position[Y_AXIS] = y_position; 17fde: 6e 96 adiw r28, 0x1e ; 30 17fe0: 8c ad ldd r24, Y+60 ; 0x3c 17fe2: 9d ad ldd r25, Y+61 ; 0x3d 17fe4: ae ad ldd r26, Y+62 ; 0x3e 17fe6: bf ad ldd r27, Y+63 ; 0x3f 17fe8: 6e 97 sbiw r28, 0x1e ; 30 17fea: 80 93 96 06 sts 0x0696, r24 ; 0x800696 17fee: 90 93 97 06 sts 0x0697, r25 ; 0x800697 17ff2: a0 93 98 06 sts 0x0698, r26 ; 0x800698 17ff6: b0 93 99 06 sts 0x0699, r27 ; 0x800699 plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); 17ffa: 60 e0 ldi r22, 0x00 ; 0 17ffc: 70 e0 ldi r23, 0x00 ; 0 17ffe: 88 e4 ldi r24, 0x48 ; 72 18000: 92 e4 ldi r25, 0x42 ; 66 18002: 0f 94 49 c0 call 0x38092 ; 0x38092 st_synchronize(); 18006: 0f 94 e8 42 call 0x285d0 ; 0x285d0 bool repeat = false; 1800a: 67 96 adiw r28, 0x17 ; 23 1800c: 1f ae std Y+63, r1 ; 0x3f 1800e: 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; 18010: 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)); 18012: 0a e9 ldi r16, 0x9A ; 154 18014: 20 2e mov r2, r16 18016: 0e e7 ldi r16, 0x7E ; 126 18018: 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; 1801a: 82 e0 ldi r24, 0x02 ; 2 1801c: 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)); 1801e: 92 ea ldi r25, 0xA2 ; 162 18020: 89 2e mov r8, r25 18022: 9e e7 ldi r25, 0x7E ; 126 18024: 99 2e mov r9, r25 st_synchronize(); bool repeat = false; do { // Unload filament if (MMU2::mmu2.Enabled()) { 18026: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 1802a: 81 30 cpi r24, 0x01 ; 1 1802c: 09 f0 breq .+2 ; 0x18030 1802e: ae c0 rjmp .+348 ; 0x1818c eject_slot = MMU2::mmu2.get_current_tool(); 18030: 0f 94 b9 74 call 0x2e972 ; 0x2e972 18034: b8 2e mov r11, r24 mmu_M600_unload_filament(); 18036: 0e 94 17 73 call 0xe62e ; 0xe62e } 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 1803a: 0f 94 e8 42 call 0x285d0 ; 0x285d0 FSensorBlockRunout fsBlockRunout; 1803e: 0f 94 ae 86 call 0x30d5c ; 0x30d5c if (!MMU2::mmu2.Enabled()) 18042: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 18046: 81 30 cpi r24, 0x01 ; 1 18048: 09 f4 brne .+2 ; 0x1804c 1804a: 6e c1 rjmp .+732 ; 0x18328 { KEEPALIVE_STATE(PAUSED_FOR_USER); 1804c: 84 e0 ldi r24, 0x04 ; 4 1804e: 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); 18052: 82 e7 ldi r24, 0x72 ; 114 18054: 99 e3 ldi r25, 0x39 ; 57 18056: 0e 94 ac 72 call 0xe558 ; 0xe558 1805a: 40 e0 ldi r20, 0x00 ; 0 1805c: 60 e0 ldi r22, 0x00 ; 0 1805e: 0f 94 40 4f call 0x29e80 ; 0x29e80 18062: 08 2f mov r16, r24 lcd_update_enable(false); 18064: 80 e0 ldi r24, 0x00 ; 0 18066: 0e 94 25 6f call 0xde4a ; 0xde4a if (choice == LCD_MIDDLE_BUTTON_CHOICE) { 1806a: 01 30 cpi r16, 0x01 ; 1 1806c: 29 f5 brne .+74 ; 0x180b8 lcd_clear(); 1806e: 0e 94 13 6f call 0xde26 ; 0xde26 lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); 18072: 8a ee ldi r24, 0xEA ; 234 18074: 99 e3 ldi r25, 0x39 ; 57 18076: 0e 94 ac 72 call 0xe558 ; 0xe558 1807a: ac 01 movw r20, r24 1807c: 62 e0 ldi r22, 0x02 ; 2 1807e: 80 e0 ldi r24, 0x00 ; 0 18080: 0e 94 f4 6e call 0xdde8 ; 0xdde8 current_position[X_AXIS] = 100; 18084: 80 e0 ldi r24, 0x00 ; 0 18086: 90 e0 ldi r25, 0x00 ; 0 18088: a8 ec ldi r26, 0xC8 ; 200 1808a: b2 e4 ldi r27, 0x42 ; 66 1808c: 80 93 92 06 sts 0x0692, r24 ; 0x800692 18090: 90 93 93 06 sts 0x0693, r25 ; 0x800693 18094: a0 93 94 06 sts 0x0694, r26 ; 0x800694 18098: b0 93 95 06 sts 0x0695, r27 ; 0x800695 plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); 1809c: 60 e0 ldi r22, 0x00 ; 0 1809e: 70 e0 ldi r23, 0x00 ; 0 180a0: 88 e4 ldi r24, 0x48 ; 72 180a2: 92 e4 ldi r25, 0x42 ; 66 180a4: 0f 94 49 c0 call 0x38092 ; 0x38092 st_synchronize(); 180a8: 0f 94 e8 42 call 0x285d0 ; 0x285d0 lcd_show_fullscreen_message_and_wait_P(_T(MSG_CHECK_IDLER)); 180ac: 80 e4 ldi r24, 0x40 ; 64 180ae: 99 e3 ldi r25, 0x39 ; 57 180b0: 0e 94 ac 72 call 0xe558 ; 0xe558 180b4: 0f 94 f1 1f call 0x23fe2 ; 0x23fe2 preheat_or_continue(FilamentAction::UnLoad); } void lcd_wait_interact(const char* filament_name) { lcd_clear(); 180b8: 0e 94 13 6f call 0xde26 ; 0xde26 lcd_puts_at_P(0, 0, _T(MSG_INSERT_FILAMENT)); 180bc: 8e ec ldi r24, 0xCE ; 206 180be: 98 e3 ldi r25, 0x38 ; 56 180c0: 0e 94 ac 72 call 0xe558 ; 0xe558 180c4: ac 01 movw r20, r24 180c6: 60 e0 ldi r22, 0x00 ; 0 180c8: 80 e0 ldi r24, 0x00 ; 0 180ca: 0e 94 f4 6e call 0xdde8 ; 0xdde8 lcd_set_cursor(0, 1); 180ce: 61 e0 ldi r22, 0x01 ; 1 180d0: 80 e0 ldi r24, 0x00 ; 0 180d2: 0e 94 e0 6e call 0xddc0 ; 0xddc0 if (filament_name[0]) { 180d6: 89 81 ldd r24, Y+1 ; 0x01 180d8: 88 23 and r24, r24 180da: 41 f0 breq .+16 ; 0x180ec lcd_print(filament_name); 180dc: ce 01 movw r24, r28 180de: 01 96 adiw r24, 0x01 ; 1 180e0: 0e 94 e7 70 call 0xe1ce ; 0xe1ce lcd_set_cursor(0, 2); 180e4: 62 e0 ldi r22, 0x02 ; 2 180e6: 80 e0 ldi r24, 0x00 ; 0 180e8: 0e 94 e0 6e call 0xddc0 ; 0xddc0 } #ifdef FILAMENT_SENSOR if (!fsensor.getAutoLoadEnabled()) 180ec: 80 91 ab 17 lds r24, 0x17AB ; 0x8017ab 180f0: 81 11 cpse r24, r1 180f2: 06 c0 rjmp .+12 ; 0x18100 #endif //FILAMENT_SENSOR { lcd_puts_P(_T(MSG_PRESS)); 180f4: 89 eb ldi r24, 0xB9 ; 185 180f6: 98 e3 ldi r25, 0x38 ; 56 180f8: 0e 94 ac 72 call 0xe558 ; 0xe558 180fc: 0e 94 cb 6e call 0xdd96 ; 0xdd96 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); 18100: 84 e0 ldi r24, 0x04 ; 4 18102: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be while(!lcd_clicked()) 18106: 0e 94 fd 70 call 0xe1fa ; 0xe1fa 1810a: 81 11 cpse r24, r1 1810c: 10 c0 rjmp .+32 ; 0x1812e { manage_heater(); 1810e: 0f 94 5c 38 call 0x270b8 ; 0x270b8 manage_inactivity(true); 18112: 81 e0 ldi r24, 0x01 ; 1 18114: 0e 94 af 8a call 0x1155e ; 0x1155e #ifdef FILAMENT_SENSOR if (fsensor.getFilamentLoadEvent()) { 18118: 80 91 ae 17 lds r24, 0x17AE ; 0x8017ae 1811c: 88 23 and r24, r24 1811e: 99 f3 breq .-26 ; 0x18106 Sound_MakeCustom(50,1000,false); 18120: 40 e0 ldi r20, 0x00 ; 0 18122: 68 ee ldi r22, 0xE8 ; 232 18124: 73 e0 ldi r23, 0x03 ; 3 18126: 82 e3 ldi r24, 0x32 ; 50 18128: 90 e0 ldi r25, 0x00 ; 0 1812a: 0f 94 46 51 call 0x2a28c ; 0x2a28c break; } #endif //FILAMENT_SENSOR } KEEPALIVE_STATE(IN_HANDLER); 1812e: a0 92 be 02 sts 0x02BE, r10 ; 0x8002be M600_load_filament_movements(filament_name); 18132: ce 01 movw r24, r28 18134: 01 96 adiw r24, 0x01 ; 1 18136: 0e 94 d0 72 call 0xe5a0 ; 0xe5a0 Sound_MakeCustom(50,1000,false); 1813a: 40 e0 ldi r20, 0x00 ; 0 1813c: 68 ee ldi r22, 0xE8 ; 232 1813e: 73 e0 ldi r23, 0x03 ; 3 18140: 82 e3 ldi r24, 0x32 ; 50 18142: 90 e0 ldi r25, 0x00 ; 0 18144: 0f 94 46 51 call 0x2a28c ; 0x2a28c 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); 18148: b4 e0 ldi r27, 0x04 ; 4 1814a: 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) 1814c: 11 23 and r17, r17 1814e: 09 f4 brne .+2 ; 0x18152 18150: 00 c1 rjmp .+512 ; 0x18352 18152: 0f 94 f2 7a call 0x2f5e4 ; 0x2f5e4 current_position[Y_AXIS] = y_position; plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); st_synchronize(); bool repeat = false; do { 18156: 67 96 adiw r28, 0x17 ; 23 18158: 4f ad ldd r20, Y+63 ; 0x3f 1815a: 67 97 sbiw r28, 0x17 ; 23 1815c: 41 11 cpse r20, r1 1815e: 63 cf rjmp .-314 ; 0x18026 18160: a1 c1 rjmp .+834 ; 0x184a4 // 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; 18162: 20 e0 ldi r18, 0x00 ; 0 18164: 30 e0 ldi r19, 0x00 ; 0 18166: 43 e5 ldi r20, 0x53 ; 83 18168: 53 e4 ldi r21, 0x43 ; 67 1816a: 6a 96 adiw r28, 0x1a ; 26 1816c: 2c af std Y+60, r18 ; 0x3c 1816e: 3d af std Y+61, r19 ; 0x3d 18170: 4e af std Y+62, r20 ; 0x3e 18172: 5f af std Y+63, r21 ; 0x3f 18174: 6a 97 sbiw r28, 0x1a ; 26 18176: b4 ce rjmp .-664 ; 0x17ee0 float y_position = FILAMENTCHANGE_YPOS; 18178: 6e 96 adiw r28, 0x1e ; 30 1817a: 1c ae std Y+60, r1 ; 0x3c 1817c: 1d ae std Y+61, r1 ; 0x3d 1817e: 1e ae std Y+62, r1 ; 0x3e 18180: 1f ae std Y+63, r1 ; 0x3f 18182: 6e 97 sbiw r28, 0x1e ; 30 18184: bb ce rjmp .-650 ; 0x17efc 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(); 18186: 0e 94 c9 64 call 0xc992 ; 0xc992 1818a: 17 cf rjmp .-466 ; 0x17fba //! //! 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); 1818c: 84 e0 ldi r24, 0x04 ; 4 1818e: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be unsigned long waiting_start_time = _millis(); 18192: 0f 94 4c 29 call 0x25298 ; 0x25298 18196: 2b 01 movw r4, r22 18198: 3c 01 movw r6, r24 uint8_t wait_for_user_state = 0; lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_UNLOAD)); 1819a: 8e e8 ldi r24, 0x8E ; 142 1819c: 98 e3 ldi r25, 0x38 ; 56 1819e: 0e 94 ac 72 call 0xe558 ; 0xe558 181a2: 0f 94 e4 1f call 0x23fc8 ; 0x23fc8 while (!(wait_for_user_state == 0 && lcd_clicked())){ 181a6: 0e 94 fd 70 call 0xe1fa ; 0xe1fa 181aa: 08 2f mov r16, r24 181ac: 81 11 cpse r24, r1 181ae: 38 c0 rjmp .+112 ; 0x18220 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) { 181b0: a3 01 movw r20, r6 181b2: 92 01 movw r18, r4 181b4: 20 54 subi r18, 0x40 ; 64 181b6: 38 4d sbci r19, 0xD8 ; 216 181b8: 46 4f sbci r20, 0xF6 ; 246 181ba: 5f 4f sbci r21, 0xFF ; 255 181bc: 6e 96 adiw r28, 0x1e ; 30 181be: 2c af std Y+60, r18 ; 0x3c 181c0: 3d af std Y+61, r19 ; 0x3d 181c2: 4e af std Y+62, r20 ; 0x3e 181c4: 5f af std Y+63, r21 ; 0x3f 181c6: 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(); 181c8: 0f 94 5c 38 call 0x270b8 ; 0x270b8 manage_inactivity(true); 181cc: 81 e0 ldi r24, 0x01 ; 1 181ce: 0e 94 af 8a call 0x1155e ; 0x1155e if (wait_for_user_state != 2) sound_wait_for_user(); 181d2: 02 30 cpi r16, 0x02 ; 2 181d4: 09 f4 brne .+2 ; 0x181d8 181d6: 67 c0 rjmp .+206 ; 0x182a6 181d8: 0f 94 ea 51 call 0x2a3d4 ; 0x2a3d4 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); 181dc: 84 e0 ldi r24, 0x04 ; 4 181de: 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) { 181e0: 01 30 cpi r16, 0x01 ; 1 181e2: 39 f1 breq .+78 ; 0x18232 case 0: //nozzle is hot, waiting for user to press the knob to unload filament delay_keep_alive(4); 181e4: 0e 94 e4 8c call 0x119c8 ; 0x119c8 if (_millis() > waiting_start_time + (unsigned long)M600_TIMEOUT * 1000) { 181e8: 0f 94 4c 29 call 0x25298 ; 0x25298 181ec: 6e 96 adiw r28, 0x1e ; 30 181ee: 2c ad ldd r18, Y+60 ; 0x3c 181f0: 3d ad ldd r19, Y+61 ; 0x3d 181f2: 4e ad ldd r20, Y+62 ; 0x3e 181f4: 5f ad ldd r21, Y+63 ; 0x3f 181f6: 6e 97 sbiw r28, 0x1e ; 30 181f8: 26 17 cp r18, r22 181fa: 37 07 cpc r19, r23 181fc: 48 07 cpc r20, r24 181fe: 59 07 cpc r21, r25 18200: 90 f6 brcc .-92 ; 0x181a6 lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_PREHEAT)); 18202: 8d e5 ldi r24, 0x5D ; 93 18204: 98 e3 ldi r25, 0x38 ; 56 18206: 0e 94 ac 72 call 0xe558 ; 0xe558 1820a: 0f 94 e4 1f call 0x23fc8 ; 0x23fc8 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 1820e: 10 92 b7 0d sts 0x0DB7, r1 ; 0x800db7 18212: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 wait_for_user_state = 1; setTargetHotend(0); st_synchronize(); 18216: 0f 94 e8 42 call 0x285d0 ; 0x285d0 disable_e0(); 1821a: 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; 1821c: 01 e0 ldi r16, 0x01 ; 1 1821e: d4 cf rjmp .-88 ; 0x181c8 18220: 10 92 6b 05 sts 0x056B, r1 ; 0x80056b <_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; 18224: 10 92 6e 05 sts 0x056E, r1 ; 0x80056e <_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); 18228: c7 01 movw r24, r14 1822a: b6 01 movw r22, r12 1822c: 0e 94 4f f8 call 0x1f09e ; 0x1f09e 18230: 04 cf rjmp .-504 ; 0x1803a 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); 18232: 0e 94 e4 8c call 0x119c8 ; 0x119c8 if (lcd_clicked()) { 18236: 0e 94 fd 70 call 0xe1fa ; 0xe1fa 1823a: 88 23 and r24, r24 1823c: 29 f2 breq .-118 ; 0x181c8 1823e: 80 91 ac 05 lds r24, 0x05AC ; 0x8005ac 18242: 90 91 ad 05 lds r25, 0x05AD ; 0x8005ad 18246: 90 93 b7 0d sts 0x0DB7, r25 ; 0x800db7 1824a: 80 93 b6 0d sts 0x0DB6, r24 ; 0x800db6 return target_temp_reached; } #endif //PINDA_THERMISTOR void lcd_wait_for_heater() { lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING)); 1824e: 8b e2 ldi r24, 0x2B ; 43 18250: 9c e3 ldi r25, 0x3C ; 60 18252: 0e 94 ac 72 call 0xe558 ; 0xe558 18256: 0f 94 e4 1f call 0x23fc8 ; 0x23fc8 lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 1825a: 42 e8 ldi r20, 0x82 ; 130 1825c: 64 e0 ldi r22, 0x04 ; 4 1825e: 80 e0 ldi r24, 0x00 ; 0 18260: 0e 94 00 6f call 0xde00 ; 0xde00 lcd_printf_P(PSTR("%3d/%3d"), (int16_t)degHotend(active_extruder), (int16_t) degTargetHotend(active_extruder)); 18264: 80 91 b7 0d lds r24, 0x0DB7 ; 0x800db7 18268: 8f 93 push r24 1826a: 80 91 b6 0d lds r24, 0x0DB6 ; 0x800db6 1826e: 8f 93 push r24 18270: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 18274: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 18278: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 1827c: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 18280: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> 18284: 7f 93 push r23 18286: 6f 93 push r22 18288: 3f 92 push r3 1828a: 2f 92 push r2 1828c: 0e 94 b9 6e call 0xdd72 ; 0xdd72 lcd_putc(LCD_STR_DEGREE[0]); 18290: 81 e8 ldi r24, 0x81 ; 129 18292: 0e 94 cf 6e call 0xdd9e ; 0xdd9e 18296: 0f 90 pop r0 18298: 0f 90 pop r0 1829a: 0f 90 pop r0 1829c: 0f 90 pop r0 1829e: 0f 90 pop r0 182a0: 0f 90 pop r0 setTargetHotend(saved_extruder_temperature); lcd_wait_for_heater(); wait_for_user_state = 2; 182a2: 02 e0 ldi r16, 0x02 ; 2 182a4: 91 cf rjmp .-222 ; 0x181c8 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 182a6: 60 91 b6 0d lds r22, 0x0DB6 ; 0x800db6 182aa: 70 91 b7 0d lds r23, 0x0DB7 ; 0x800db7 182ae: 07 2e mov r0, r23 182b0: 00 0c add r0, r0 182b2: 88 0b sbc r24, r24 182b4: 99 0b sbc r25, r25 182b6: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> } break; case 2: //waiting for nozzle to reach target temperature if (fabs(degTargetHotend(active_extruder) - degHotend(active_extruder)) < TEMP_HYSTERESIS) { 182ba: 20 91 b0 0d lds r18, 0x0DB0 ; 0x800db0 182be: 30 91 b1 0d lds r19, 0x0DB1 ; 0x800db1 182c2: 40 91 b2 0d lds r20, 0x0DB2 ; 0x800db2 182c6: 50 91 b3 0d lds r21, 0x0DB3 ; 0x800db3 182ca: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 182ce: 9f 77 andi r25, 0x7F ; 127 182d0: 20 e0 ldi r18, 0x00 ; 0 182d2: 30 e0 ldi r19, 0x00 ; 0 182d4: 40 ea ldi r20, 0xA0 ; 160 182d6: 50 e4 ldi r21, 0x40 ; 64 182d8: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 182dc: 87 ff sbrs r24, 7 182de: 0b c0 rjmp .+22 ; 0x182f6 lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_UNLOAD)); 182e0: 8e e8 ldi r24, 0x8E ; 142 182e2: 98 e3 ldi r25, 0x38 ; 56 182e4: 0e 94 ac 72 call 0xe558 ; 0xe558 182e8: 0f 94 e4 1f call 0x23fc8 ; 0x23fc8 waiting_start_time = _millis(); 182ec: 0f 94 4c 29 call 0x25298 ; 0x25298 182f0: 2b 01 movw r4, r22 182f2: 3c 01 movw r6, r24 182f4: 58 cf rjmp .-336 ; 0x181a6 wait_for_user_state = 0; } else { lcd_set_cursor(1, 4); 182f6: 64 e0 ldi r22, 0x04 ; 4 182f8: 81 e0 ldi r24, 0x01 ; 1 182fa: 0e 94 e0 6e call 0xddc0 ; 0xddc0 lcd_printf_P(PSTR("%3d"), (int16_t)degHotend(active_extruder)); 182fe: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 18302: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 18306: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 1830a: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 1830e: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> 18312: 7f 93 push r23 18314: 6f 93 push r22 18316: 9f 92 push r9 18318: 8f 92 push r8 1831a: 0e 94 b9 6e call 0xdd72 ; 0xdd72 1831e: 0f 90 pop r0 18320: 0f 90 pop r0 18322: 0f 90 pop r0 18324: 0f 90 pop r0 18326: 50 cf rjmp .-352 ; 0x181c8 } M600_load_filament(filament_name); } else // MMU is enabled { if (!automatic) mmu_M600_filament_change_screen(eject_slot); 18328: 11 11 cpse r17, r1 1832a: 03 c0 rjmp .+6 ; 0x18332 1832c: 8b 2d mov r24, r11 1832e: 0e 94 07 8d call 0x11a0e ; 0x11a0e mmu_M600_load_filament(automatic); 18332: 81 2f mov r24, r17 18334: 0e 94 0e 78 call 0xf01c ; 0xf01c 18338: 07 cf rjmp .-498 ; 0x18148 cursor_pos--; else Sound_MakeSound(e_SOUND_TYPE_BlindAlert); } else if (lcd_encoder > 0) { // Rotating knob clockwise if (cursor_pos < 3) 1833a: 03 30 cpi r16, 0x03 ; 3 1833c: 10 f4 brcc .+4 ; 0x18342 cursor_pos++; 1833e: 0f 5f subi r16, 0xFF ; 255 18340: 49 c0 rjmp .+146 ; 0x183d4 else Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 18342: 87 e0 ldi r24, 0x07 ; 7 18344: 0f 94 07 4e call 0x29c0e ; 0x29c0e 18348: 45 c0 rjmp .+138 ; 0x183d4 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); 1834a: ce 01 movw r24, r28 1834c: 01 96 adiw r24, 0x01 ; 1 1834e: 0e 94 d0 72 call 0xe5a0 ; 0xe5a0 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); 18352: 70 92 be 02 sts 0x02BE, r7 ; 0x8002be uint8_t lcd_alright() { uint8_t cursor_pos = 0; lcd_clear(); 18356: 0e 94 13 6f call 0xde26 ; 0xde26 lcd_puts_at_P(1, 0, _T(MSG_CORRECTLY)); 1835a: 8a e0 ldi r24, 0x0A ; 10 1835c: 99 e3 ldi r25, 0x39 ; 57 1835e: 0e 94 ac 72 call 0xe558 ; 0xe558 18362: ac 01 movw r20, r24 18364: 60 e0 ldi r22, 0x00 ; 0 18366: 81 e0 ldi r24, 0x01 ; 1 18368: 0e 94 f4 6e call 0xdde8 ; 0xdde8 lcd_puts_at_P(1, 1, _T(MSG_NOT_LOADED)); 1836c: 84 ef ldi r24, 0xF4 ; 244 1836e: 98 e3 ldi r25, 0x38 ; 56 18370: 0e 94 ac 72 call 0xe558 ; 0xe558 18374: ac 01 movw r20, r24 18376: 61 e0 ldi r22, 0x01 ; 1 18378: 81 e0 ldi r24, 0x01 ; 1 1837a: 0e 94 f4 6e call 0xdde8 ; 0xdde8 lcd_puts_at_P(1, 2, _T(MSG_NOT_COLOR)); 1837e: 80 ee ldi r24, 0xE0 ; 224 18380: 98 e3 ldi r25, 0x38 ; 56 18382: 0e 94 ac 72 call 0xe558 ; 0xe558 18386: ac 01 movw r20, r24 18388: 62 e0 ldi r22, 0x02 ; 2 1838a: 81 e0 ldi r24, 0x01 ; 1 1838c: 0e 94 f4 6e call 0xdde8 ; 0xdde8 lcd_puts_at_P(1, 3, _T(MSG_UNLOAD_FILAMENT)); 18390: 82 e9 ldi r24, 0x92 ; 146 18392: 96 e4 ldi r25, 0x46 ; 70 18394: 0e 94 ac 72 call 0xe558 ; 0xe558 18398: ac 01 movw r20, r24 1839a: 63 e0 ldi r22, 0x03 ; 3 1839c: 81 e0 ldi r24, 0x01 ; 1 1839e: 0e 94 f4 6e call 0xdde8 ; 0xdde8 lcd_putc_at(0, cursor_pos, '>'); 183a2: 4e e3 ldi r20, 0x3E ; 62 183a4: 60 e0 ldi r22, 0x00 ; 0 183a6: 80 e0 ldi r24, 0x00 ; 0 183a8: 0e 94 00 6f call 0xde00 ; 0xde00 lcd_consume_click(); 183ac: 0e 94 f8 70 call 0xe1f0 ; 0xe1f0 uint8_t lcd_alright() { uint8_t cursor_pos = 0; 183b0: 00 e0 ldi r16, 0x00 ; 0 lcd_putc_at(0, cursor_pos, '>'); lcd_consume_click(); while (1) { manage_heater(); 183b2: 0f 94 5c 38 call 0x270b8 ; 0x270b8 manage_inactivity(true); 183b6: 81 e0 ldi r24, 0x01 ; 1 183b8: 0e 94 af 8a call 0x1155e ; 0x1155e if (lcd_encoder) 183bc: 80 91 70 06 lds r24, 0x0670 ; 0x800670 183c0: 90 91 71 06 lds r25, 0x0671 ; 0x800671 183c4: 00 97 sbiw r24, 0x00 ; 0 183c6: d9 f0 breq .+54 ; 0x183fe { if (lcd_encoder < 0 ) { 183c8: 97 ff sbrs r25, 7 183ca: b7 cf rjmp .-146 ; 0x1833a // Rotating knob counter clockwise if (cursor_pos > 0) 183cc: 00 23 and r16, r16 183ce: 09 f4 brne .+2 ; 0x183d2 183d0: b8 cf rjmp .-144 ; 0x18342 cursor_pos--; 183d2: 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 ")); 183d4: 46 ea ldi r20, 0xA6 ; 166 183d6: 5e e7 ldi r21, 0x7E ; 126 183d8: 60 e0 ldi r22, 0x00 ; 0 183da: 80 e0 ldi r24, 0x00 ; 0 183dc: 0e 94 f4 6e call 0xdde8 ; 0xdde8 lcd_putc_at(0, cursor_pos, '>'); 183e0: 4e e3 ldi r20, 0x3E ; 62 183e2: 60 2f mov r22, r16 183e4: 80 e0 ldi r24, 0x00 ; 0 183e6: 0e 94 00 6f call 0xde00 ; 0xde00 // Consume rotation event and make feedback sound lcd_encoder = 0; 183ea: 10 92 71 06 sts 0x0671, r1 ; 0x800671 183ee: 10 92 70 06 sts 0x0670, r1 ; 0x800670 _delay(100); 183f2: 64 e6 ldi r22, 0x64 ; 100 183f4: 70 e0 ldi r23, 0x00 ; 0 183f6: 80 e0 ldi r24, 0x00 ; 0 183f8: 90 e0 ldi r25, 0x00 ; 0 183fa: 0f 94 53 27 call 0x24ea6 ; 0x24ea6 } if (lcd_clicked()) 183fe: 0e 94 fd 70 call 0xe1fa ; 0xe1fa 18402: 88 23 and r24, r24 18404: b1 f2 breq .-84 ; 0x183b2 { lcd_clear(); 18406: 0e 94 13 6f call 0xde26 ; 0xde26 lcd_return_to_status(); 1840a: 0f 94 a6 1e call 0x23d4c ; 0x23d4c lcd_change_filament_state = lcd_alright(); KEEPALIVE_STATE(IN_HANDLER); 1840e: a0 92 be 02 sts 0x02BE, r10 ; 0x8002be switch(lcd_change_filament_state) 18412: 02 30 cpi r16, 0x02 ; 2 18414: b1 f0 breq .+44 ; 0x18442 18416: 03 30 cpi r16, 0x03 ; 3 18418: 09 f4 brne .+2 ; 0x1841c 1841a: f8 c0 rjmp .+496 ; 0x1860c 1841c: 01 30 cpi r16, 0x01 ; 1 1841e: 81 f5 brne .+96 ; 0x18480 { // Filament failed to load so load it again case 1: if (MMU2::mmu2.Enabled()) { 18420: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 18424: 81 30 cpi r24, 0x01 ; 1 18426: 09 f0 breq .+2 ; 0x1842a 18428: 90 cf rjmp .-224 ; 0x1834a uint8_t eject_slot = MMU2::mmu2.get_current_tool(); 1842a: 0f 94 b9 74 call 0x2e972 ; 0x2e972 1842e: 08 2f mov r16, r24 // Unload filament mmu_M600_unload_filament(); 18430: 0e 94 17 73 call 0xe62e ; 0xe62e // Ask to remove any old filament and load new mmu_M600_filament_change_screen(eject_slot); 18434: 80 2f mov r24, r16 18436: 0e 94 07 8d call 0x11a0e ; 0x11a0e // After user clicks knob, MMU will load the filament mmu_M600_load_filament(false); 1843a: 80 e0 ldi r24, 0x00 ; 0 1843c: 0e 94 0e 78 call 0xf01c ; 0xf01c 18440: 88 cf rjmp .-240 ; 0x18352 } break; // Filament loaded properly but color is not clear case 2: st_synchronize(); 18442: 0f 94 e8 42 call 0x285d0 ; 0x285d0 load_filament_final_feed(); 18446: 0e 94 93 64 call 0xc926 ; 0xc926 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(); 1844a: 0e 94 13 6f call 0xde26 ; 0xde26 lcd_puts_at_P(0, 0, _T(MSG_LOADING_COLOR)); 1844e: 8e e1 ldi r24, 0x1E ; 30 18450: 99 e3 ldi r25, 0x39 ; 57 18452: 0e 94 ac 72 call 0xe558 ; 0xe558 18456: ac 01 movw r20, r24 18458: 60 e0 ldi r22, 0x00 ; 0 1845a: 80 e0 ldi r24, 0x00 ; 0 1845c: 0e 94 f4 6e call 0xdde8 ; 0xdde8 lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); 18460: 8a ee ldi r24, 0xEA ; 234 18462: 99 e3 ldi r25, 0x39 ; 57 18464: 0e 94 ac 72 call 0xe558 ; 0xe558 18468: ac 01 movw r20, r24 1846a: 62 e0 ldi r22, 0x02 ; 2 1846c: 80 e0 ldi r24, 0x00 ; 0 1846e: 0e 94 f4 6e call 0xdde8 ; 0xdde8 lcd_loading_progress_bar((FILAMENTCHANGE_FINALFEED * 1000ul) / FILAMENTCHANGE_EFEED_FINAL); //show progress bar during filament loading slow sequence 18472: 87 e9 ldi r24, 0x97 ; 151 18474: 9d e1 ldi r25, 0x1D ; 29 18476: 0f 94 6f 20 call 0x240de ; 0x240de lcd_loading_color(); st_synchronize(); 1847a: 0f 94 e8 42 call 0x285d0 ; 0x285d0 1847e: 69 cf rjmp .-302 ; 0x18352 } void lcd_change_success() { lcd_clear(); 18480: 0e 94 13 6f call 0xde26 ; 0xde26 lcd_puts_at_P(0, 2, _T(MSG_CHANGE_SUCCESS)); 18484: 8e e2 ldi r24, 0x2E ; 46 18486: 99 e3 ldi r25, 0x39 ; 57 18488: 0e 94 ac 72 call 0xe558 ; 0xe558 1848c: ac 01 movw r20, r24 1848e: 62 e0 ldi r22, 0x02 ; 2 18490: 80 e0 ldi r24, 0x00 ; 0 18492: 0e 94 f4 6e call 0xdde8 ; 0xdde8 //! @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) 18496: 00 23 and r16, r16 18498: 19 f0 breq .+6 ; 0x184a0 1849a: 03 30 cpi r16, 0x03 ; 3 1849c: 09 f0 breq .+2 ; 0x184a0 1849e: 59 cf rjmp .-334 ; 0x18352 184a0: 0f 94 f2 7a call 0x2f5e4 ; 0x2f5e4 if (!automatic) repeat = M600_check_state_and_repeat(filament_name); } while (repeat); lcd_update_enable(true); 184a4: 81 e0 ldi r24, 0x01 ; 1 184a6: 0e 94 25 6f call 0xde4a ; 0xde4a // Not let's go back to print fanSpeed = saved_fan_speed; 184aa: 80 91 ab 05 lds r24, 0x05AB ; 0x8005ab 184ae: 80 93 e7 03 sts 0x03E7, r24 ; 0x8003e7 // Feed a little of filament to stabilize pressure if (!automatic) { 184b2: 11 11 cpse r17, r1 184b4: 27 c0 rjmp .+78 ; 0x18504 if (printingIsPaused()) 184b6: 0e 94 85 67 call 0xcf0a ; 0xcf0a 184ba: c0 90 9e 06 lds r12, 0x069E ; 0x80069e 184be: d0 90 9f 06 lds r13, 0x069F ; 0x80069f 184c2: e0 90 a0 06 lds r14, 0x06A0 ; 0x8006a0 184c6: f0 90 a1 06 lds r15, 0x06A1 ; 0x8006a1 184ca: 88 23 and r24, r24 184cc: 09 f4 brne .+2 ; 0x184d0 184ce: a3 c0 rjmp .+326 ; 0x18616 { // 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; 184d0: 20 e0 ldi r18, 0x00 ; 0 184d2: 30 e0 ldi r19, 0x00 ; 0 184d4: 40 e8 ldi r20, 0x80 ; 128 184d6: 5f e3 ldi r21, 0x3F ; 63 184d8: c7 01 movw r24, r14 184da: b6 01 movw r22, r12 184dc: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 184e0: 60 93 9e 06 sts 0x069E, r22 ; 0x80069e 184e4: 70 93 9f 06 sts 0x069F, r23 ; 0x80069f 184e8: 80 93 a0 06 sts 0x06A0, r24 ; 0x8006a0 184ec: 90 93 a1 06 sts 0x06A1, r25 ; 0x8006a1 plan_buffer_line_curposXYZE(FILAMENTCHANGE_RFEED); 184f0: 60 e0 ldi r22, 0x00 ; 0 184f2: 70 e0 ldi r23, 0x00 ; 0 184f4: 88 ee ldi r24, 0xE8 ; 232 184f6: 92 e4 ldi r25, 0x42 ; 66 184f8: 0f 94 49 c0 call 0x38092 ; 0x38092 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 184fc: 10 92 b7 0d sts 0x0DB7, r1 ; 0x800db7 18500: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 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); 18504: e0 90 9a 06 lds r14, 0x069A ; 0x80069a 18508: f0 90 9b 06 lds r15, 0x069B ; 0x80069b 1850c: 00 91 9c 06 lds r16, 0x069C ; 0x80069c 18510: 10 91 9d 06 lds r17, 0x069D ; 0x80069d 18514: 20 91 77 02 lds r18, 0x0277 ; 0x800277 18518: 30 91 78 02 lds r19, 0x0278 ; 0x800278 1851c: 40 91 79 02 lds r20, 0x0279 ; 0x800279 18520: 50 91 7a 02 lds r21, 0x027A ; 0x80027a 18524: 60 91 73 02 lds r22, 0x0273 ; 0x800273 18528: 70 91 74 02 lds r23, 0x0274 ; 0x800274 1852c: 80 91 75 02 lds r24, 0x0275 ; 0x800275 18530: 90 91 76 02 lds r25, 0x0276 ; 0x800276 18534: 1f 92 push r1 18536: 1f 92 push r1 18538: 1f 92 push r1 1853a: 1f 92 push r1 1853c: 81 2c mov r8, r1 1853e: 91 2c mov r9, r1 18540: e8 e4 ldi r30, 0x48 ; 72 18542: ae 2e mov r10, r30 18544: e2 e4 ldi r30, 0x42 ; 66 18546: be 2e mov r11, r30 18548: fe e9 ldi r31, 0x9E ; 158 1854a: cf 2e mov r12, r31 1854c: f6 e0 ldi r31, 0x06 ; 6 1854e: df 2e mov r13, r31 18550: 0f 94 f4 b0 call 0x361e8 ; 0x361e8 st_synchronize(); 18554: 0f 94 e8 42 call 0x285d0 ; 0x285d0 // Move Z back plan_buffer_line(saved_pos[X_AXIS], saved_pos[Y_AXIS], saved_pos[Z_AXIS], current_position[E_AXIS], FILAMENTCHANGE_ZFEED); 18558: e0 90 7b 02 lds r14, 0x027B ; 0x80027b 1855c: f0 90 7c 02 lds r15, 0x027C ; 0x80027c 18560: 00 91 7d 02 lds r16, 0x027D ; 0x80027d 18564: 10 91 7e 02 lds r17, 0x027E ; 0x80027e 18568: 20 91 77 02 lds r18, 0x0277 ; 0x800277 1856c: 30 91 78 02 lds r19, 0x0278 ; 0x800278 18570: 40 91 79 02 lds r20, 0x0279 ; 0x800279 18574: 50 91 7a 02 lds r21, 0x027A ; 0x80027a 18578: 60 91 73 02 lds r22, 0x0273 ; 0x800273 1857c: 70 91 74 02 lds r23, 0x0274 ; 0x800274 18580: 80 91 75 02 lds r24, 0x0275 ; 0x800275 18584: 90 91 76 02 lds r25, 0x0276 ; 0x800276 18588: 1f 92 push r1 1858a: 1f 92 push r1 1858c: 1f 92 push r1 1858e: 1f 92 push r1 18590: 81 2c mov r8, r1 18592: 91 2c mov r9, r1 18594: a0 e7 ldi r26, 0x70 ; 112 18596: aa 2e mov r10, r26 18598: a1 e4 ldi r26, 0x41 ; 65 1859a: ba 2e mov r11, r26 1859c: 0f 94 f4 b0 call 0x361e8 ; 0x361e8 st_synchronize(); 185a0: 0f 94 e8 42 call 0x285d0 ; 0x285d0 // Set E position to original plan_set_e_position(saved_pos[E_AXIS]); 185a4: 8f e7 ldi r24, 0x7F ; 127 185a6: 92 e0 ldi r25, 0x02 ; 2 185a8: 0f 94 be 63 call 0x2c77c ; 0x2c77c memcpy(current_position, saved_pos, sizeof(saved_pos)); 185ac: 80 e1 ldi r24, 0x10 ; 16 185ae: e3 e7 ldi r30, 0x73 ; 115 185b0: f2 e0 ldi r31, 0x02 ; 2 185b2: a2 e9 ldi r26, 0x92 ; 146 185b4: b6 e0 ldi r27, 0x06 ; 6 185b6: 01 90 ld r0, Z+ 185b8: 0d 92 st X+, r0 185ba: 8a 95 dec r24 185bc: e1 f7 brne .-8 ; 0x185b6 set_destination_to_current(); 185be: 0e 94 3a 68 call 0xd074 ; 0xd074 // Recover feed rate feedmultiply = saved_feedmultiply2; 185c2: 80 91 71 03 lds r24, 0x0371 ; 0x800371 185c6: 90 91 72 03 lds r25, 0x0372 ; 0x800372 185ca: 80 93 39 02 sts 0x0239, r24 ; 0x800239 185ce: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a enquecommandf_P(MSG_M220, saved_feedmultiply2); 185d2: 9f 93 push r25 185d4: 8f 93 push r24 185d6: 86 e2 ldi r24, 0x26 ; 38 185d8: 9e e6 ldi r25, 0x6E ; 110 185da: 9f 93 push r25 185dc: 8f 93 push r24 185de: 0e 94 b6 88 call 0x1116c ; 0x1116c if (printingIsPaused()) { 185e2: 0e 94 85 67 call 0xcf0a ; 0xcf0a 185e6: 0f b6 in r0, 0x3f ; 63 185e8: f8 94 cli 185ea: de bf out 0x3e, r29 ; 62 185ec: 0f be out 0x3f, r0 ; 63 185ee: cd bf out 0x3d, r28 ; 61 185f0: 88 23 and r24, r24 185f2: 41 f1 breq .+80 ; 0x18644 lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); 185f4: 8f e2 ldi r24, 0x2F ; 47 185f6: 9a e4 ldi r25, 0x4A ; 74 185f8: 0e 94 ac 72 call 0xe558 ; 0xe558 185fc: 0e 94 5d f1 call 0x1e2ba ; 0x1e2ba } else { lcd_setstatuspgm(MSG_WELCOME); SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_RESUMED); } custom_message_type = CustomMsg::Status; 18600: 10 92 c4 06 sts 0x06C4, r1 ; 0x8006c4 void clear_print_state_in_ram() { // Set flag to false in order to avoid using // the saved values during power panic isPartialBackupAvailable = false; 18604: 10 92 a2 06 sts 0x06A2, r1 ; 0x8006a2 18608: 0c 94 ee aa jmp 0x155dc ; 0x155dc st_synchronize(); break; // Unload filament case 3: return true; 1860c: 31 e0 ldi r19, 0x01 ; 1 1860e: 67 96 adiw r28, 0x17 ; 23 18610: 3f af std Y+63, r19 ; 0x3f 18612: 67 97 sbiw r28, 0x17 ; 23 18614: 9e cd rjmp .-1220 ; 0x18152 setTargetHotend(0); } else { // Feed a little of filament to stabilize pressure current_position[E_AXIS] += FILAMENTCHANGE_RECFEED; 18616: 20 e0 ldi r18, 0x00 ; 0 18618: 30 e0 ldi r19, 0x00 ; 0 1861a: 40 ea ldi r20, 0xA0 ; 160 1861c: 50 e4 ldi r21, 0x40 ; 64 1861e: c7 01 movw r24, r14 18620: b6 01 movw r22, r12 18622: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 18626: 60 93 9e 06 sts 0x069E, r22 ; 0x80069e 1862a: 70 93 9f 06 sts 0x069F, r23 ; 0x80069f 1862e: 80 93 a0 06 sts 0x06A0, r24 ; 0x8006a0 18632: 90 93 a1 06 sts 0x06A1, r25 ; 0x8006a1 plan_buffer_line_curposXYZE(FILAMENTCHANGE_EXFEED); 18636: 60 e0 ldi r22, 0x00 ; 0 18638: 70 e0 ldi r23, 0x00 ; 0 1863a: 80 e0 ldi r24, 0x00 ; 0 1863c: 90 e4 ldi r25, 0x40 ; 64 1863e: 0f 94 49 c0 call 0x38092 ; 0x38092 18642: 60 cf rjmp .-320 ; 0x18504 if (printingIsPaused()) { lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); } else { lcd_setstatuspgm(MSG_WELCOME); 18644: 83 e7 ldi r24, 0x73 ; 115 18646: 90 e7 ldi r25, 0x70 ; 112 18648: 0e 94 5d f1 call 0x1e2ba ; 0x1e2ba SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_RESUMED); 1864c: 87 ef ldi r24, 0xF7 ; 247 1864e: 9a e6 ldi r25, 0x6A ; 106 18650: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 18654: d5 cf rjmp .-86 ; 0x18600 SERIAL_ECHOPGM("Y:"); SERIAL_ECHOLN(pause_position[Y_AXIS]); SERIAL_ECHOPGM("Z:"); SERIAL_ECHOLN(pause_position[Z_AXIS]); */ if (!printingIsPaused()) { 18656: 0e 94 85 67 call 0xcf0a ; 0xcf0a 1865a: 81 11 cpse r24, r1 1865c: 0c 94 ee aa jmp 0x155dc ; 0x155dc st_synchronize(); 18660: 0f 94 e8 42 call 0x285d0 ; 0x285d0 ClearToSend(); //send OK even before the command finishes executing because we want to make sure it is not skipped because of cmdqueue_pop_front(); 18664: 0e 94 2a 7f call 0xfe54 ; 0xfe54 cmdqueue_pop_front(); //trick because we want skip this command (M601) after restore 18668: 0e 94 bc 76 call 0xed78 ; 0xed78 lcd_pause_print(); 1866c: 0f 94 58 29 call 0x252b0 ; 0x252b0 18670: 0c 94 ee aa jmp 0x155dc ; 0x155dc /*! ### M602 - Resume print M602: Resume print */ case 602: { if (printingIsPaused()) lcd_resume_print(); 18674: 0e 94 85 67 call 0xcf0a ; 0xcf0a 18678: 88 23 and r24, r24 1867a: 11 f4 brne .+4 ; 0x18680 1867c: 0c 94 ee aa jmp 0x155dc ; 0x155dc 18680: 0c 94 b5 ab jmp 0x1576a ; 0x1576a /*! ### M603 - Stop print M603: Stop print */ case 603: { print_stop(); 18684: 60 e0 ldi r22, 0x00 ; 0 18686: 80 e0 ldi r24, 0x00 ; 0 18688: 0e 94 9a f4 call 0x1e934 ; 0x1e934 1868c: 0c 94 ee aa jmp 0x155dc ; 0x155dc float z_val = 0; char strLabel[8]; uint8_t iBedC = 0; uint8_t iPindaC = 0; bool bIsActive=false; strLabel[7] = '\0'; // null terminate. 18690: 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')) { 18692: 83 e5 ldi r24, 0x53 ; 83 18694: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 18698: 88 23 and r24, r24 1869a: b1 f0 breq .+44 ; 0x186c8 iSel = code_value_uint8(); 1869c: 0e 94 68 5b call 0xb6d0 ; 0xb6d0 186a0: 18 2f mov r17, r24 if (iSel>=max_sheets) 186a2: 88 30 cpi r24, 0x08 ; 8 186a4: b0 f0 brcs .+44 ; 0x186d2 { SERIAL_PROTOCOLPGM("Invalid sheet ID. Allowed: 0.."); 186a6: 8b e0 ldi r24, 0x0B ; 11 186a8: 96 e8 ldi r25, 0x86 ; 134 186aa: 0e 94 50 77 call 0xeea0 ; 0xeea0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 186ae: 4a e0 ldi r20, 0x0A ; 10 186b0: 67 e0 ldi r22, 0x07 ; 7 186b2: 70 e0 ldi r23, 0x00 ; 0 186b4: 80 e0 ldi r24, 0x00 ; 0 186b6: 90 e0 ldi r25, 0x00 ; 0 186b8: 0f 94 06 d5 call 0x3aa0c ; 0x3aa0c SERIAL_PROTOCOL(max_sheets-1); SERIAL_PROTOCOLLN(""); 186bc: 88 ef ldi r24, 0xF8 ; 248 186be: 92 e0 ldi r25, 0x02 ; 2 186c0: 0f 94 00 d6 call 0x3ac00 ; 0x3ac00 186c4: 0c 94 ee aa jmp 0x155dc ; 0x155dc break; // invalid sheet ID } } else { iSel = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 186c8: 81 ea ldi r24, 0xA1 ; 161 186ca: 9d e0 ldi r25, 0x0D ; 13 186cc: 0f 94 1c dc call 0x3b838 ; 0x3b838 186d0: 18 2f mov r17, r24 } if (code_seen('Z')){ 186d2: 8a e5 ldi r24, 0x5A ; 90 186d4: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 186d8: 88 23 and r24, r24 186da: 09 f4 brne .+2 ; 0x186de 186dc: d7 c0 rjmp .+430 ; 0x1888c z_val = code_value(); 186de: 0e 94 9d 60 call 0xc13a ; 0xc13a 186e2: 2b 01 movw r4, r22 186e4: 3c 01 movw r6, r24 zraw = z_val*cs.axis_steps_per_mm[Z_AXIS]; 186e6: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 186ea: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 186ee: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 186f2: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 186f6: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 186fa: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> 186fe: 6b 01 movw r12, r22 if ((zraw < Z_BABYSTEP_MIN) || (zraw > Z_BABYSTEP_MAX)) 18700: 9b 01 movw r18, r22 18702: 21 56 subi r18, 0x61 ; 97 18704: 30 4f sbci r19, 0xF0 ; 240 18706: 20 3a cpi r18, 0xA0 ; 160 18708: 3f 40 sbci r19, 0x0F ; 15 1870a: 30 f0 brcs .+12 ; 0x18718 { SERIAL_PROTOCOLLNPGM(" Z VALUE OUT OF RANGE"); 1870c: 85 ef ldi r24, 0xF5 ; 245 1870e: 95 e8 ldi r25, 0x85 ; 133 18710: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 18714: 0c 94 ee aa jmp 0x155dc ; 0x155dc break; } eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[iSel].z_offset)),zraw); 18718: 5b e0 ldi r21, 0x0B ; 11 1871a: 15 9f mul r17, r21 1871c: 90 01 movw r18, r0 1871e: 11 24 eor r1, r1 18720: c9 01 movw r24, r18 18722: 80 5b subi r24, 0xB0 ; 176 18724: 92 4f sbci r25, 0xF2 ; 242 18726: 0f 94 5e dc call 0x3b8bc ; 0x3b8bc { 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')) 1872a: 8c e4 ldi r24, 0x4C ; 76 1872c: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 18730: bb e0 ldi r27, 0x0B ; 11 18732: 1b 9f mul r17, r27 18734: 70 01 movw r14, r0 18736: 11 24 eor r1, r1 18738: 57 01 movw r10, r14 1873a: e7 eb ldi r30, 0xB7 ; 183 1873c: ae 1a sub r10, r30 1873e: e2 ef ldi r30, 0xF2 ; 242 18740: be 0a sbc r11, r30 18742: 88 23 and r24, r24 18744: 09 f4 brne .+2 ; 0x18748 18746: be c0 rjmp .+380 ; 0x188c4 { char *src = strchr_pointer + 1; 18748: e0 91 95 03 lds r30, 0x0395 ; 0x800395 1874c: f0 91 96 03 lds r31, 0x0396 ; 0x800396 18750: 31 96 adiw r30, 0x01 ; 1 18752: bf 01 movw r22, r30 while (*src == ' ') ++src; 18754: 81 91 ld r24, Z+ 18756: 80 32 cpi r24, 0x20 ; 32 18758: e1 f3 breq .-8 ; 0x18752 if (*src != '\0') 1875a: 88 23 and r24, r24 1875c: 31 f0 breq .+12 ; 0x1876a { strncpy(strLabel,src,7); 1875e: 47 e0 ldi r20, 0x07 ; 7 18760: 50 e0 ldi r21, 0x00 ; 0 18762: ce 01 movw r24, r28 18764: 01 96 adiw r24, 0x01 ; 1 18766: 0f 94 9c e2 call 0x3c538 ; 0x3c538 #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); 1876a: 47 e0 ldi r20, 0x07 ; 7 1876c: 50 e0 ldi r21, 0x00 ; 0 1876e: b5 01 movw r22, r10 18770: ce 01 movw r24, r28 18772: 01 96 adiw r24, 0x01 ; 1 18774: 0f 94 30 dc call 0x3b860 ; 0x3b860 else { eeprom_read_block(strLabel, EEPROM_Sheets_base->s[iSel].name, sizeof(Sheet::name)); } if (code_seen('B')) 18778: 82 e4 ldi r24, 0x42 ; 66 1877a: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 1877e: 57 01 movw r10, r14 18780: fe ea ldi r31, 0xAE ; 174 18782: af 1a sub r10, r31 18784: f2 ef ldi r31, 0xF2 ; 242 18786: bf 0a sbc r11, r31 18788: 88 23 and r24, r24 1878a: 09 f4 brne .+2 ; 0x1878e 1878c: a3 c0 rjmp .+326 ; 0x188d4 { iBedC = code_value_uint8(); 1878e: 0e 94 68 5b call 0xb6d0 ; 0xb6d0 18792: 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); 18794: 68 2f mov r22, r24 18796: c5 01 movw r24, r10 18798: 0f 94 40 dc call 0x3b880 ; 0x3b880 else { iBedC = eeprom_read_byte(&EEPROM_Sheets_base->s[iSel].bed_temp); } if (code_seen('P')) 1879c: 80 e5 ldi r24, 0x50 ; 80 1879e: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 187a2: 2d ea ldi r18, 0xAD ; 173 187a4: e2 1a sub r14, r18 187a6: 22 ef ldi r18, 0xF2 ; 242 187a8: f2 0a sbc r15, r18 187aa: 88 23 and r24, r24 187ac: 09 f4 brne .+2 ; 0x187b0 187ae: 97 c0 rjmp .+302 ; 0x188de { iPindaC = code_value_uint8(); 187b0: 0e 94 68 5b call 0xb6d0 ; 0xb6d0 187b4: b8 2e mov r11, r24 187b6: 68 2f mov r22, r24 187b8: c7 01 movw r24, r14 187ba: 0f 94 40 dc call 0x3b880 ; 0x3b880 else { iPindaC = eeprom_read_byte(&EEPROM_Sheets_base->s[iSel].pinda_temp); } if (code_seen('A')) 187be: 81 e4 ldi r24, 0x41 ; 65 187c0: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 187c4: 88 23 and r24, r24 187c6: 09 f4 brne .+2 ; 0x187ca 187c8: 8f c0 rjmp .+286 ; 0x188e8 { bIsActive |= code_value_uint8() || (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); 187ca: 0e 94 68 5b call 0xb6d0 ; 0xb6d0 187ce: 81 11 cpse r24, r1 187d0: 06 c0 rjmp .+12 ; 0x187de 187d2: 81 ea ldi r24, 0xA1 ; 161 187d4: 9d e0 ldi r25, 0x0D ; 13 187d6: 0f 94 1c dc call 0x3b838 ; 0x3b838 187da: 18 13 cpse r17, r24 187dc: 8d c0 rjmp .+282 ; 0x188f8 if(bIsActive && eeprom_is_sheet_initialized(iSel)) { 187de: 81 2f mov r24, r17 187e0: 0e 94 41 76 call 0xec82 ; 0xec82 187e4: 08 2f mov r16, r24 187e6: 88 23 and r24, r24 187e8: 29 f0 breq .+10 ; 0x187f4 187ea: 61 2f mov r22, r17 187ec: 81 ea ldi r24, 0xA1 ; 161 187ee: 9d e0 ldi r25, 0x0D ; 13 187f0: 0f 94 40 dc call 0x3b880 ; 0x3b880 else { bIsActive = (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); } SERIAL_PROTOCOLPGM("Sheet "); 187f4: 8e ee ldi r24, 0xEE ; 238 187f6: 95 e8 ldi r25, 0x85 ; 133 187f8: 0e 94 50 77 call 0xeea0 ; 0xeea0 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 187fc: 61 2f mov r22, r17 187fe: 70 e0 ldi r23, 0x00 ; 0 18800: 90 e0 ldi r25, 0x00 ; 0 18802: 80 e0 ldi r24, 0x00 ; 0 18804: 0f 94 6b d5 call 0x3aad6 ; 0x3aad6 SERIAL_PROTOCOL((int)iSel); if (!eeprom_is_sheet_initialized(iSel)) 18808: 81 2f mov r24, r17 1880a: 0e 94 41 76 call 0xec82 ; 0xec82 1880e: 81 11 cpse r24, r1 18810: 04 c0 rjmp .+8 ; 0x1881a SERIAL_PROTOCOLLNPGM(" NOT INITIALIZED"); 18812: 8d ed ldi r24, 0xDD ; 221 18814: 95 e8 ldi r25, 0x85 ; 133 18816: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 SERIAL_PROTOCOLPGM(" Z"); 1881a: 8a ed ldi r24, 0xDA ; 218 1881c: 95 e8 ldi r25, 0x85 ; 133 1881e: 0e 94 50 77 call 0xeea0 ; 0xeea0 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 18822: 44 e0 ldi r20, 0x04 ; 4 18824: c3 01 movw r24, r6 18826: b2 01 movw r22, r4 18828: 0f 94 87 d5 call 0x3ab0e ; 0x3ab0e SERIAL_PROTOCOL_F(z_val,4); SERIAL_PROTOCOLPGM(" R"); 1882c: 87 ed ldi r24, 0xD7 ; 215 1882e: 95 e8 ldi r25, 0x85 ; 133 18830: 0e 94 50 77 call 0xeea0 ; 0xeea0 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 18834: b6 01 movw r22, r12 18836: dd 0c add r13, r13 18838: 88 0b sbc r24, r24 1883a: 99 0b sbc r25, r25 1883c: 0f 94 6b d5 call 0x3aad6 ; 0x3aad6 SERIAL_PROTOCOL((int)zraw); SERIAL_PROTOCOLPGM(" L"); 18840: 84 ed ldi r24, 0xD4 ; 212 18842: 95 e8 ldi r25, 0x85 ; 133 18844: 0e 94 50 77 call 0xeea0 ; 0xeea0 18848: ce 01 movw r24, r28 1884a: 01 96 adiw r24, 0x01 ; 1 1884c: 0e 94 14 88 call 0x11028 ; 0x11028 SERIAL_PROTOCOL(strLabel); SERIAL_PROTOCOLPGM(" B"); 18850: 81 ed ldi r24, 0xD1 ; 209 18852: 95 e8 ldi r25, 0x85 ; 133 18854: 0e 94 50 77 call 0xeea0 ; 0xeea0 18858: 69 2d mov r22, r9 1885a: 70 e0 ldi r23, 0x00 ; 0 1885c: 90 e0 ldi r25, 0x00 ; 0 1885e: 80 e0 ldi r24, 0x00 ; 0 18860: 0f 94 6b d5 call 0x3aad6 ; 0x3aad6 SERIAL_PROTOCOL((int)iBedC); SERIAL_PROTOCOLPGM(" P"); 18864: 8e ec ldi r24, 0xCE ; 206 18866: 95 e8 ldi r25, 0x85 ; 133 18868: 0e 94 50 77 call 0xeea0 ; 0xeea0 1886c: 6b 2d mov r22, r11 1886e: 70 e0 ldi r23, 0x00 ; 0 18870: 90 e0 ldi r25, 0x00 ; 0 18872: 80 e0 ldi r24, 0x00 ; 0 18874: 0f 94 6b d5 call 0x3aad6 ; 0x3aad6 SERIAL_PROTOCOL((int)iPindaC); SERIAL_PROTOCOLPGM(" A"); 18878: 8b ec ldi r24, 0xCB ; 203 1887a: 95 e8 ldi r25, 0x85 ; 133 1887c: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_PROTOCOLLN((int)bIsActive); 18880: 80 2f mov r24, r16 18882: 90 e0 ldi r25, 0x00 ; 0 18884: 0f 94 f5 74 call 0x2e9ea ; 0x2e9ea 18888: 0c 94 ee aa jmp 0x155dc ; 0x155dc } 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))); 1888c: ab e0 ldi r26, 0x0B ; 11 1888e: 1a 9f mul r17, r26 18890: c0 01 movw r24, r0 18892: 11 24 eor r1, r1 18894: 80 5b subi r24, 0xB0 ; 176 18896: 92 4f sbci r25, 0xF2 ; 242 18898: 0f 94 2a dc call 0x3b854 ; 0x3b854 1889c: 6c 01 movw r12, r24 z_val = ((float)zraw/cs.axis_steps_per_mm[Z_AXIS]); 1889e: bc 01 movw r22, r24 188a0: 99 0f add r25, r25 188a2: 88 0b sbc r24, r24 188a4: 99 0b sbc r25, r25 188a6: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 188aa: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 188ae: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 188b2: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 188b6: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 188ba: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 188be: 2b 01 movw r4, r22 188c0: 3c 01 movw r6, r24 188c2: 33 cf rjmp .-410 ; 0x1872a } 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)); 188c4: 47 e0 ldi r20, 0x07 ; 7 188c6: 50 e0 ldi r21, 0x00 ; 0 188c8: b5 01 movw r22, r10 188ca: ce 01 movw r24, r28 188cc: 01 96 adiw r24, 0x01 ; 1 188ce: 0f 94 0c dc call 0x3b818 ; 0x3b818 188d2: 52 cf rjmp .-348 ; 0x18778 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); 188d4: c5 01 movw r24, r10 188d6: 0f 94 1c dc call 0x3b838 ; 0x3b838 188da: 98 2e mov r9, r24 188dc: 5f cf rjmp .-322 ; 0x1879c 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); 188de: c7 01 movw r24, r14 188e0: 0f 94 1c dc call 0x3b838 ; 0x3b838 188e4: b8 2e mov r11, r24 188e6: 6b cf rjmp .-298 ; 0x187be bIsActive = 0; } } else { bIsActive = (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); 188e8: 81 ea ldi r24, 0xA1 ; 161 188ea: 9d e0 ldi r25, 0x0D ; 13 188ec: 0f 94 1c dc call 0x3b838 ; 0x3b838 188f0: 01 e0 ldi r16, 0x01 ; 1 188f2: 18 17 cp r17, r24 188f4: 09 f4 brne .+2 ; 0x188f8 188f6: 7e cf rjmp .-260 ; 0x187f4 { 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; 188f8: 00 e0 ldi r16, 0x00 ; 0 188fa: 7c cf rjmp .-264 ; 0x187f4 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)) ) { 188fc: c3 01 movw r24, r6 188fe: b2 01 movw r22, r4 18900: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 18904: 20 91 99 03 lds r18, 0x0399 ; 0x800399 18908: 30 91 9a 03 lds r19, 0x039A ; 0x80039a 1890c: 40 91 9b 03 lds r20, 0x039B ; 0x80039b 18910: 50 91 9c 03 lds r21, 0x039C ; 0x80039c 18914: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 18918: 87 fd sbrc r24, 7 1891a: 02 c0 rjmp .+4 ; 0x18920 1891c: 0c 94 d8 aa jmp 0x155b0 ; 0x155b0 if ((_millis() - codenum) > 1000) //Print Temp Reading every 1 second while waiting. 18920: 0f 94 4c 29 call 0x25298 ; 0x25298 18924: 68 19 sub r22, r8 18926: 79 09 sbc r23, r9 18928: 8a 09 sbc r24, r10 1892a: 9b 09 sbc r25, r11 1892c: 69 3e cpi r22, 0xE9 ; 233 1892e: 73 40 sbci r23, 0x03 ; 3 18930: 81 05 cpc r24, r1 18932: 91 05 cpc r25, r1 18934: c8 f0 brcs .+50 ; 0x18968 { SERIAL_PROTOCOLPGM("P:"); 18936: 85 ea ldi r24, 0xA5 ; 165 18938: 95 e8 ldi r25, 0x85 ; 133 1893a: 0e 94 50 77 call 0xeea0 ; 0xeea0 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 1893e: 60 91 99 03 lds r22, 0x0399 ; 0x800399 18942: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 18946: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 1894a: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 1894e: 41 e0 ldi r20, 0x01 ; 1 18950: 0f 94 87 d5 call 0x3ab0e ; 0x3ab0e } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 18954: 8f e2 ldi r24, 0x2F ; 47 18956: 0e 94 37 77 call 0xee6e ; 0xee6e SERIAL_PROTOCOL_F(current_temperature_pinda, 1); SERIAL_PROTOCOL('/'); SERIAL_PROTOCOLLN(set_target_pinda); 1895a: c8 01 movw r24, r16 1895c: 0f 94 f5 74 call 0x2e9ea ; 0x2e9ea codenum = _millis(); 18960: 0f 94 4c 29 call 0x25298 ; 0x25298 18964: 4b 01 movw r8, r22 18966: 5c 01 movw r10, r24 } manage_heater(); 18968: 0f 94 5c 38 call 0x270b8 ; 0x270b8 manage_inactivity(); 1896c: 80 e0 ldi r24, 0x00 ; 0 1896e: 0e 94 af 8a call 0x1155e ; 0x1155e lcd_update(0); 18972: 80 e0 ldi r24, 0x00 ; 0 18974: 0e 94 a7 6e call 0xdd4e ; 0xdd4e 18978: 0c 94 bf aa jmp 0x1557e ; 0x1557e - `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 1897c: 8f e3 ldi r24, 0x3F ; 63 1897e: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 18982: 88 23 and r24, r24 18984: c9 f0 breq .+50 ; 0x189b8 SERIAL_PROTOCOLPGM("PINDA cal status: "); 18986: 82 e9 ldi r24, 0x92 ; 146 18988: 95 e8 ldi r25, 0x85 ; 133 1898a: 0e 94 50 77 call 0xeea0 ; 0xeea0 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); } 1898e: 86 ea ldi r24, 0xA6 ; 166 18990: 9f e0 ldi r25, 0x0F ; 15 18992: 0f 94 1c dc call 0x3b838 ; 0x3b838 18996: 21 e0 ldi r18, 0x01 ; 1 18998: 30 e0 ldi r19, 0x00 ; 0 1899a: 81 11 cpse r24, r1 1899c: 02 c0 rjmp .+4 ; 0x189a2 1899e: 30 e0 ldi r19, 0x00 ; 0 189a0: 20 e0 ldi r18, 0x00 ; 0 SERIAL_PROTOCOLLN(calibration_status_pinda()); 189a2: c9 01 movw r24, r18 189a4: 0f 94 f5 74 call 0x2e9ea ; 0x2e9ea SERIAL_PROTOCOLLNRPGM(_header); 189a8: 8b e7 ldi r24, 0x7B ; 123 189aa: 95 e8 ldi r25, 0x85 ; 133 189ac: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 gcode_M861_print_pinda_cal_eeprom(); 189b0: 0e 94 88 77 call 0xef10 ; 0xef10 189b4: 0c 94 ee aa jmp 0x155dc ; 0x155dc } else if (code_seen('!')) { // ! - Set factory default values 189b8: 81 e2 ldi r24, 0x21 ; 33 189ba: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 189be: 88 23 and r24, r24 189c0: 49 f1 breq .+82 ; 0x18a14 189c2: 61 e0 ldi r22, 0x01 ; 1 189c4: 86 ea ldi r24, 0xA6 ; 166 189c6: 9f e0 ldi r25, 0x0F ; 15 189c8: 0f 94 40 dc call 0x3b880 ; 0x3b880 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 189cc: 68 e0 ldi r22, 0x08 ; 8 189ce: 70 e0 ldi r23, 0x00 ; 0 189d0: 80 eb ldi r24, 0xB0 ; 176 189d2: 9f e0 ldi r25, 0x0F ; 15 189d4: 0f 94 5e dc call 0x3b8bc ; 0x3b8bc 189d8: 68 e1 ldi r22, 0x18 ; 24 189da: 70 e0 ldi r23, 0x00 ; 0 189dc: 82 eb ldi r24, 0xB2 ; 178 189de: 9f e0 ldi r25, 0x0F ; 15 189e0: 0f 94 5e dc call 0x3b8bc ; 0x3b8bc 189e4: 60 e3 ldi r22, 0x30 ; 48 189e6: 70 e0 ldi r23, 0x00 ; 0 189e8: 84 eb ldi r24, 0xB4 ; 180 189ea: 9f e0 ldi r25, 0x0F ; 15 189ec: 0f 94 5e dc call 0x3b8bc ; 0x3b8bc 189f0: 60 e5 ldi r22, 0x50 ; 80 189f2: 70 e0 ldi r23, 0x00 ; 0 189f4: 86 eb ldi r24, 0xB6 ; 182 189f6: 9f e0 ldi r25, 0x0F ; 15 189f8: 0f 94 5e dc call 0x3b8bc ; 0x3b8bc 189fc: 68 e7 ldi r22, 0x78 ; 120 189fe: 70 e0 ldi r23, 0x00 ; 0 18a00: 88 eb ldi r24, 0xB8 ; 184 18a02: 9f e0 ldi r25, 0x0F ; 15 18a04: 0f 94 5e dc call 0x3b8bc ; 0x3b8bc 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"); 18a08: 8a e6 ldi r24, 0x6A ; 106 18a0a: 95 e8 ldi r25, 0x85 ; 133 18a0c: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 18a10: 0c 94 ee aa jmp 0x155dc ; 0x155dc } else if (code_seen('Z')) { // Z - Set all values to 0 (effectively disabling PINDA temperature compensation) 18a14: 8a e5 ldi r24, 0x5A ; 90 18a16: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 18a1a: 88 23 and r24, r24 18a1c: c1 f0 breq .+48 ; 0x18a4e if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 18a1e: 61 e0 ldi r22, 0x01 ; 1 18a20: 86 ea ldi r24, 0xA6 ; 166 18a22: 9f e0 ldi r25, 0x0F ; 15 18a24: 0f 94 40 dc call 0x3b880 ; 0x3b880 18a28: 00 eb ldi r16, 0xB0 ; 176 18a2a: 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); 18a2c: 70 e0 ldi r23, 0x00 ; 0 18a2e: 60 e0 ldi r22, 0x00 ; 0 18a30: c8 01 movw r24, r16 18a32: 0f 94 5e dc call 0x3b8bc ; 0x3b8bc 18a36: 0e 5f subi r16, 0xFE ; 254 18a38: 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++) { 18a3a: 0a 3b cpi r16, 0xBA ; 186 18a3c: 4f e0 ldi r20, 0x0F ; 15 18a3e: 14 07 cpc r17, r20 18a40: a9 f7 brne .-22 ; 0x18a2c eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i, z_shift); } SERIAL_PROTOCOLLNPGM("zerorized"); 18a42: 80 e6 ldi r24, 0x60 ; 96 18a44: 95 e8 ldi r25, 0x85 ; 133 18a46: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 18a4a: 0c 94 ee aa jmp 0x155dc ; 0x155dc } else if (code_seen('S')) { // Sxxx Iyyy - Set compensation ustep value S for compensation table index I 18a4e: 83 e5 ldi r24, 0x53 ; 83 18a50: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 18a54: 88 23 and r24, r24 18a56: 21 f1 breq .+72 ; 0x18aa0 int16_t usteps = code_value_short(); 18a58: 0e 94 75 5b call 0xb6ea ; 0xb6ea 18a5c: 8c 01 movw r16, r24 if (code_seen('I')) { 18a5e: 89 e4 ldi r24, 0x49 ; 73 18a60: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 18a64: 88 23 and r24, r24 18a66: 11 f4 brne .+4 ; 0x18a6c 18a68: 0c 94 ee aa jmp 0x155dc ; 0x155dc uint8_t index = code_value_uint8(); 18a6c: 0e 94 68 5b call 0xb6d0 ; 0xb6d0 if (index < 5) { 18a70: 85 30 cpi r24, 0x05 ; 5 18a72: 10 f0 brcs .+4 ; 0x18a78 18a74: 0c 94 ee aa jmp 0x155dc ; 0x155dc eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + index, usteps); 18a78: 90 e0 ldi r25, 0x00 ; 0 18a7a: 88 52 subi r24, 0x28 ; 40 18a7c: 98 4f sbci r25, 0xF8 ; 248 18a7e: b8 01 movw r22, r16 18a80: 88 0f add r24, r24 18a82: 99 1f adc r25, r25 18a84: 0f 94 5e dc call 0x3b8bc ; 0x3b8bc SERIAL_PROTOCOLLNRPGM(MSG_OK); 18a88: 8b eb ldi r24, 0xBB ; 187 18a8a: 9d e6 ldi r25, 0x6D ; 109 18a8c: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 SERIAL_PROTOCOLLNRPGM(_header); 18a90: 8b e7 ldi r24, 0x7B ; 123 18a92: 95 e8 ldi r25, 0x85 ; 133 18a94: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 gcode_M861_print_pinda_cal_eeprom(); 18a98: 0e 94 88 77 call 0xef10 ; 0xef10 18a9c: 0c 94 ee aa jmp 0x155dc ; 0x155dc } } } else { SERIAL_PROTOCOLLNPGM("no valid command"); 18aa0: 8f e4 ldi r24, 0x4F ; 79 18aa2: 95 e8 ldi r25, 0x85 ; 133 18aa4: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 18aa8: 0c 94 ee aa jmp 0x155dc ; 0x155dc */ 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); 18aac: 0e 94 9d 60 call 0xc13a ; 0xc13a 18ab0: 20 e0 ldi r18, 0x00 ; 0 18ab2: 30 e0 ldi r19, 0x00 ; 0 18ab4: 40 e2 ldi r20, 0x20 ; 32 18ab6: 51 e4 ldi r21, 0x41 ; 65 18ab8: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 18abc: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 18ac0: 6c 5a subi r22, 0xAC ; 172 switch(nCommand) 18ac2: 63 30 cpi r22, 0x03 ; 3 18ac4: 09 f4 brne .+2 ; 0x18ac8 18ac6: a2 c0 rjmp .+324 ; 0x18c0c 18ac8: 98 f5 brcc .+102 ; 0x18b30 18aca: 61 30 cpi r22, 0x01 ; 1 18acc: 09 f4 brne .+2 ; 0x18ad0 18ace: 59 c0 rjmp .+178 ; 0x18b82 18ad0: 62 30 cpi r22, 0x02 ; 2 18ad2: 11 f0 breq .+4 ; 0x18ad8 18ad4: 0c 94 ee aa jmp 0x155dc ; 0x155dc ,(uint8_t)oCheckModel ); } uint16_t nPrinterType(bool bMMu) { if (bMMu) { 18ad8: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba return pgm_read_word(&_nPrinterMmuType); 18adc: e6 e9 ldi r30, 0x96 ; 150 18ade: fe e7 ldi r31, 0x7E ; 126 ,(uint8_t)oCheckModel ); } uint16_t nPrinterType(bool bMMu) { if (bMMu) { 18ae0: 81 30 cpi r24, 0x01 ; 1 18ae2: 11 f0 breq .+4 ; 0x18ae8 return pgm_read_word(&_nPrinterMmuType); } else { return pgm_read_word(&_nPrinterType); 18ae4: e8 e9 ldi r30, 0x98 ; 152 18ae6: fe e7 ldi r31, 0x7E ; 126 18ae8: 05 91 lpm r16, Z+ 18aea: 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')) 18aec: 80 e5 ldi r24, 0x50 ; 80 18aee: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 18af2: 88 23 and r24, r24 18af4: 09 f4 brne .+2 ; 0x18af8 18af6: 79 c0 rjmp .+242 ; 0x18bea { uint16_t nPrinterModel; nPrinterModel=(uint16_t)code_value_long(); 18af8: 0e 94 82 5b call 0xb704 ; 0xb704 menu_submenu(lcd_hw_setup_menu); } } void printer_model_check(uint16_t nPrinterModel, uint16_t actualPrinterModel) { if (oCheckModel == ClCheckMode::_None) 18afc: f0 90 ea 04 lds r15, 0x04EA ; 0x8004ea 18b00: ff 20 and r15, r15 18b02: 11 f4 brne .+4 ; 0x18b08 18b04: 0c 94 ee aa jmp 0x155dc ; 0x155dc return; if (nPrinterModel == actualPrinterModel) 18b08: 60 17 cp r22, r16 18b0a: 71 07 cpc r23, r17 18b0c: 11 f4 brne .+4 ; 0x18b12 18b0e: 0c 94 ee aa jmp 0x155dc ; 0x155dc // SERIAL_ECHOLNPGM("Printer model differs from the G-code ..."); // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN(actualPrinterModel); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN(nPrinterModel); render_M862_warnings( 18b12: 8d ef ldi r24, 0xFD ; 253 18b14: 97 e3 ldi r25, 0x37 ; 55 18b16: 0e 94 ac 72 call 0xe558 ; 0xe558 18b1a: 8c 01 movw r16, r24 18b1c: 85 ec ldi r24, 0xC5 ; 197 18b1e: 97 e3 ldi r25, 0x37 ; 55 18b20: 0e 94 ac 72 call 0xe558 ; 0xe558 18b24: 4f 2d mov r20, r15 18b26: b8 01 movw r22, r16 18b28: 0e 94 f1 f4 call 0x1e9e2 ; 0x1e9e2 18b2c: 0c 94 ee aa jmp 0x155dc ; 0x155dc 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) 18b30: 64 30 cpi r22, 0x04 ; 4 18b32: 09 f4 brne .+2 ; 0x18b36 18b34: be c0 rjmp .+380 ; 0x18cb2 18b36: 65 30 cpi r22, 0x05 ; 5 18b38: 11 f0 breq .+4 ; 0x18b3e 18b3a: 0c 94 ee aa jmp 0x155dc ; 0x155dc 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')) 18b3e: 80 e5 ldi r24, 0x50 ; 80 18b40: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 18b44: 88 23 and r24, r24 18b46: 09 f4 brne .+2 ; 0x18b4a 18b48: 3a c1 rjmp .+628 ; 0x18dbe { uint16_t nGcodeLevel; nGcodeLevel=(uint16_t)code_value_long(); 18b4a: 0e 94 82 5b call 0xb704 ; 0xb704 done: return true; } void gcode_level_check(uint16_t nGcodeLevel) { if (oCheckGcode == ClCheckMode::_None) 18b4e: 10 91 e8 04 lds r17, 0x04E8 ; 0x8004e8 18b52: 11 23 and r17, r17 18b54: 11 f4 brne .+4 ; 0x18b5a 18b56: 0c 94 ee aa jmp 0x155dc ; 0x155dc return; if (nGcodeLevel <= (uint16_t)GCODE_LEVEL) 18b5a: 62 30 cpi r22, 0x02 ; 2 18b5c: 71 05 cpc r23, r1 18b5e: 10 f4 brcc .+4 ; 0x18b64 18b60: 0c 94 ee aa jmp 0x155dc ; 0x155dc // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN(GCODE_LEVEL); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN(nGcodeLevel); render_M862_warnings( 18b64: 89 ee ldi r24, 0xE9 ; 233 18b66: 96 e3 ldi r25, 0x36 ; 54 18b68: 0e 94 ac 72 call 0xe558 ; 0xe558 18b6c: 7c 01 movw r14, r24 18b6e: 88 eb ldi r24, 0xB8 ; 184 18b70: 96 e3 ldi r25, 0x36 ; 54 18b72: 0e 94 ac 72 call 0xe558 ; 0xe558 18b76: 41 2f mov r20, r17 18b78: b7 01 movw r22, r14 18b7a: 0e 94 f1 f4 call 0x1e9e2 ; 0x1e9e2 18b7e: 0c 94 ee aa jmp 0x155dc ; 0x155dc ClPrintChecking nCommand = static_cast((uint16_t)(code_value()*10) - 8620u); switch(nCommand) { case ClPrintChecking::_Nozzle: // ~ .1 uint16_t nDiameter; if(code_seen('P')) 18b82: 80 e5 ldi r24, 0x50 ; 80 18b84: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 18b88: 88 23 and r24, r24 18b8a: a9 f0 breq .+42 ; 0x18bb6 { nDiameter=(uint16_t)(code_value()*1000.0+0.5); // [,um] 18b8c: 0e 94 9d 60 call 0xc13a ; 0xc13a 18b90: 20 e0 ldi r18, 0x00 ; 0 18b92: 30 e0 ldi r19, 0x00 ; 0 18b94: 4a e7 ldi r20, 0x7A ; 122 18b96: 54 e4 ldi r21, 0x44 ; 68 18b98: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 18b9c: 20 e0 ldi r18, 0x00 ; 0 18b9e: 30 e0 ldi r19, 0x00 ; 0 18ba0: 40 e0 ldi r20, 0x00 ; 0 18ba2: 5f e3 ldi r21, 0x3F ; 63 18ba4: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 18ba8: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> nozzle_diameter_check(nDiameter); 18bac: cb 01 movw r24, r22 18bae: 0e 94 30 f5 call 0x1ea60 ; 0x1ea60 18bb2: 0c 94 ee aa jmp 0x155dc ; 0x155dc } else if(code_seen('Q')) 18bb6: 81 e5 ldi r24, 0x51 ; 81 18bb8: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 18bbc: 88 23 and r24, r24 18bbe: 11 f4 brne .+4 ; 0x18bc4 18bc0: 0c 94 ee aa jmp 0x155dc ; 0x155dc SERIAL_PROTOCOLLN((float)eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM)/1000.0); 18bc4: 85 ea ldi r24, 0xA5 ; 165 18bc6: 9d e0 ldi r25, 0x0D ; 13 18bc8: 0f 94 2a dc call 0x3b854 ; 0x3b854 18bcc: bc 01 movw r22, r24 18bce: 90 e0 ldi r25, 0x00 ; 0 18bd0: 80 e0 ldi r24, 0x00 ; 0 18bd2: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 18bd6: 20 e0 ldi r18, 0x00 ; 0 18bd8: 30 e0 ldi r19, 0x00 ; 0 18bda: 4a e7 ldi r20, 0x7A ; 122 18bdc: 54 e4 ldi r21, 0x44 ; 68 18bde: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 18be2: 0f 94 b4 74 call 0x2e968 ; 0x2e968 18be6: 0c 94 ee aa jmp 0x155dc ; 0x155dc 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')) 18bea: 81 e5 ldi r24, 0x51 ; 81 18bec: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 18bf0: 88 23 and r24, r24 18bf2: 11 f4 brne .+4 ; 0x18bf8 18bf4: 0c 94 ee aa jmp 0x155dc ; 0x155dc print((long) n, base); } void MarlinSerial::print(unsigned int n, int base) { print((unsigned long) n, base); 18bf8: b8 01 movw r22, r16 18bfa: 90 e0 ldi r25, 0x00 ; 0 18bfc: 80 e0 ldi r24, 0x00 ; 0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 18bfe: 4a e0 ldi r20, 0x0A ; 10 18c00: 0f 94 06 d5 call 0x3aa0c ; 0x3aa0c } void MarlinSerial::println(unsigned int n, int base) { print(n, base); println(); 18c04: 0f 94 fd d5 call 0x3abfa ; 0x3abfa 18c08: 0c 94 ee aa jmp 0x155dc ; 0x155dc return pgm_read_word(&_nPrinterType); } } const char *sPrinterType(bool bMMu) { if (bMMu) { 18c0c: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba return _sPrinterMmuName; 18c10: 6e e8 ldi r22, 0x8E ; 142 18c12: e6 2e mov r14, r22 18c14: 6e e7 ldi r22, 0x7E ; 126 18c16: f6 2e mov r15, r22 return pgm_read_word(&_nPrinterType); } } const char *sPrinterType(bool bMMu) { if (bMMu) { 18c18: 81 30 cpi r24, 0x01 ; 1 18c1a: 21 f0 breq .+8 ; 0x18c24 return _sPrinterMmuName; } else { return _sPrinterName; 18c1c: 5a e8 ldi r21, 0x8A ; 138 18c1e: e5 2e mov r14, r21 18c20: 5e e7 ldi r21, 0x7E ; 126 18c22: f5 2e mov r15, r21 SERIAL_PROTOCOLLN(type); } break; case ClPrintChecking::_Smodel: { // ~ .3 const char *type = sPrinterType(MMU2::mmu2.Enabled()); if(code_seen('P')) 18c24: 80 e5 ldi r24, 0x50 ; 80 18c26: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 18c2a: 88 23 and r24, r24 18c2c: b1 f1 breq .+108 ; 0x18c9a , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 18c2e: 62 e2 ldi r22, 0x22 ; 34 18c30: 70 e0 ldi r23, 0x00 ; 0 18c32: 80 91 95 03 lds r24, 0x0395 ; 0x800395 18c36: 90 91 96 03 lds r25, 0x0396 ; 0x800396 18c3a: 0f 94 73 e2 call 0x3c4e6 ; 0x3c4e6 18c3e: 8c 01 movw r16, r24 if (!this->ptr) { 18c40: 89 2b or r24, r25 18c42: d1 f0 breq .+52 ; 0x18c78 // First quote not found return; } // Skip the leading quote this->ptr++; 18c44: 0f 5f subi r16, 0xFF ; 255 18c46: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 18c48: 62 e2 ldi r22, 0x22 ; 34 18c4a: 70 e0 ldi r23, 0x00 ; 0 18c4c: c8 01 movw r24, r16 18c4e: 0f 94 73 e2 call 0x3c4e6 ; 0x3c4e6 if(!pStrEnd) { 18c52: 00 97 sbiw r24, 0x00 ; 0 18c54: 89 f0 breq .+34 ; 0x18c78 // Second quote not found return; } this->len = pStrEnd - this->ptr; 18c56: d8 2e mov r13, r24 18c58: d0 1a sub r13, r16 18c5a: c7 01 movw r24, r14 18c5c: 0f 94 da d9 call 0x3b3b4 ; 0x3b3b4 <__strlen_P> unquoted_string smodel = unquoted_string(pStrPos); if(smodel.WasFound()) { const uint8_t compareLength = strlen_P(actualPrinterSModel); if(compareLength == smodel.GetLength()) { 18c60: d8 12 cpse r13, r24 18c62: 0a c0 rjmp .+20 ; 0x18c78 if (strncmp_P(smodel.GetUnquotedString(), actualPrinterSModel, compareLength) == 0) return; 18c64: ac 01 movw r20, r24 18c66: 55 27 eor r21, r21 18c68: b7 01 movw r22, r14 18c6a: c8 01 movw r24, r16 18c6c: 0f 94 fb d9 call 0x3b3f6 ; 0x3b3f6 18c70: 89 2b or r24, r25 18c72: 11 f4 brne .+4 ; 0x18c78 18c74: 0c 94 ee aa jmp 0x155dc ; 0x155dc } } render_M862_warnings( 18c78: f0 90 ea 04 lds r15, 0x04EA ; 0x8004ea 18c7c: 8d ef ldi r24, 0xFD ; 253 18c7e: 97 e3 ldi r25, 0x37 ; 55 18c80: 0e 94 ac 72 call 0xe558 ; 0xe558 18c84: 8c 01 movw r16, r24 18c86: 85 ec ldi r24, 0xC5 ; 197 18c88: 97 e3 ldi r25, 0x37 ; 55 18c8a: 0e 94 ac 72 call 0xe558 ; 0xe558 18c8e: 4f 2d mov r20, r15 18c90: b8 01 movw r22, r16 18c92: 0e 94 f1 f4 call 0x1e9e2 ; 0x1e9e2 18c96: 0c 94 ee aa jmp 0x155dc ; 0x155dc { printer_smodel_check(strchr_pointer, type); } else if(code_seen('Q')) 18c9a: 81 e5 ldi r24, 0x51 ; 81 18c9c: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 18ca0: 88 23 and r24, r24 18ca2: 11 f4 brne .+4 ; 0x18ca8 18ca4: 0c 94 ee aa jmp 0x155dc ; 0x155dc SERIAL_PROTOCOLLNRPGM(type); 18ca8: c7 01 movw r24, r14 18caa: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 18cae: 0c 94 ee aa jmp 0x155dc ; 0x155dc } break; case ClPrintChecking::_Version: // ~ .4 if(code_seen('P')) 18cb2: 80 e5 ldi r24, 0x50 ; 80 18cb4: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 18cb8: 88 23 and r24, r24 18cba: 09 f4 brne .+2 ; 0x18cbe 18cbc: 77 c0 rjmp .+238 ; 0x18dac fw_version_check(++strchr_pointer); 18cbe: 80 91 95 03 lds r24, 0x0395 ; 0x800395 18cc2: 90 91 96 03 lds r25, 0x0396 ; 0x800396 18cc6: 01 96 adiw r24, 0x01 ; 1 18cc8: 90 93 96 03 sts 0x0396, r25 ; 0x800396 18ccc: 80 93 95 03 sts 0x0395, r24 ; 0x800395 return ((uint8_t)ClCompareValue::_Less); return ((uint8_t)ClCompareValue::_Equal); } void fw_version_check(const char *pVersion) { if (oCheckVersion == ClCheckMode::_None) 18cd0: 20 91 e9 04 lds r18, 0x04E9 ; 0x8004e9 18cd4: 22 23 and r18, r18 18cd6: 11 f4 brne .+4 ; 0x18cdc 18cd8: 0c 94 ee aa jmp 0x155dc ; 0x155dc return; uint16_t aVersion[4]; uint8_t nCompareValueResult; parse_version(pVersion, aVersion); 18cdc: be 01 movw r22, r28 18cde: 6f 5f subi r22, 0xFF ; 255 18ce0: 7f 4f sbci r23, 0xFF ; 255 18ce2: 0e 94 71 ef call 0x1dee2 ; 0x1dee2 nCompareValueResult = mCompareValue(aVersion[0], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_MAJOR)) << 6; 18ce6: 8a e0 ldi r24, 0x0A ; 10 18ce8: 90 e0 ldi r25, 0x00 ; 0 18cea: 0f 94 2a dc call 0x3b854 ; 0x3b854 18cee: 29 81 ldd r18, Y+1 ; 0x01 18cf0: 3a 81 ldd r19, Y+2 ; 0x02 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 18cf2: 12 e0 ldi r17, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 18cf4: 82 17 cp r24, r18 18cf6: 93 07 cpc r25, r19 18cf8: 28 f0 brcs .+10 ; 0x18d04 return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 18cfa: 11 e0 ldi r17, 0x01 ; 1 18cfc: 28 17 cp r18, r24 18cfe: 39 07 cpc r19, r25 18d00: 08 f4 brcc .+2 ; 0x18d04 18d02: 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; 18d04: 12 95 swap r17 18d06: 11 0f add r17, r17 18d08: 11 0f add r17, r17 18d0a: 10 7c andi r17, 0xC0 ; 192 nCompareValueResult += mCompareValue(aVersion[1], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_MINOR)) << 4; 18d0c: 8c e0 ldi r24, 0x0C ; 12 18d0e: 90 e0 ldi r25, 0x00 ; 0 18d10: 0f 94 2a dc call 0x3b854 ; 0x3b854 18d14: ac 01 movw r20, r24 18d16: 2b 81 ldd r18, Y+3 ; 0x03 18d18: 3c 81 ldd r19, Y+4 ; 0x04 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 18d1a: 82 e0 ldi r24, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 18d1c: 42 17 cp r20, r18 18d1e: 53 07 cpc r21, r19 18d20: 28 f0 brcs .+10 ; 0x18d2c return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 18d22: 81 e0 ldi r24, 0x01 ; 1 18d24: 24 17 cp r18, r20 18d26: 35 07 cpc r19, r21 18d28: 08 f4 brcc .+2 ; 0x18d2c 18d2a: 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; 18d2c: 50 e1 ldi r21, 0x10 ; 16 18d2e: 85 9f mul r24, r21 18d30: c0 01 movw r24, r0 18d32: 11 24 eor r1, r1 18d34: 18 0f add r17, r24 nCompareValueResult += mCompareValue(aVersion[2], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_REVISION)) << 2; 18d36: 8e e0 ldi r24, 0x0E ; 14 18d38: 90 e0 ldi r25, 0x00 ; 0 18d3a: 0f 94 2a dc call 0x3b854 ; 0x3b854 18d3e: ac 01 movw r20, r24 18d40: 2d 81 ldd r18, Y+5 ; 0x05 18d42: 3e 81 ldd r19, Y+6 ; 0x06 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 18d44: 82 e0 ldi r24, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 18d46: 42 17 cp r20, r18 18d48: 53 07 cpc r21, r19 18d4a: 28 f0 brcs .+10 ; 0x18d56 return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 18d4c: 81 e0 ldi r24, 0x01 ; 1 18d4e: 24 17 cp r18, r20 18d50: 35 07 cpc r19, r21 18d52: 08 f4 brcc .+2 ; 0x18d56 18d54: 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; 18d56: a4 e0 ldi r26, 0x04 ; 4 18d58: 8a 9f mul r24, r26 18d5a: c0 01 movw r24, r0 18d5c: 11 24 eor r1, r1 18d5e: 18 0f add r17, r24 nCompareValueResult += mCompareValue(aVersion[3], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_FLAVOR)); 18d60: 80 e1 ldi r24, 0x10 ; 16 18d62: 90 e0 ldi r25, 0x00 ; 0 18d64: 0f 94 2a dc call 0x3b854 ; 0x3b854 18d68: ac 01 movw r20, r24 18d6a: 2f 81 ldd r18, Y+7 ; 0x07 18d6c: 38 85 ldd r19, Y+8 ; 0x08 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 18d6e: 92 e0 ldi r25, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 18d70: 42 17 cp r20, r18 18d72: 53 07 cpc r21, r19 18d74: 28 f0 brcs .+10 ; 0x18d80 return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 18d76: 91 e0 ldi r25, 0x01 ; 1 18d78: 24 17 cp r18, r20 18d7a: 35 07 cpc r19, r21 18d7c: 08 f4 brcc .+2 ; 0x18d80 18d7e: 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)); 18d80: 19 0f add r17, r25 if (nCompareValueResult <= COMPARE_VALUE_EQUAL) 18d82: 16 35 cpi r17, 0x56 ; 86 18d84: 10 f4 brcc .+4 ; 0x18d8a 18d86: 0c 94 ee aa jmp 0x155dc ; 0x155dc SERIAL_ECHO(aVersion[2]); SERIAL_ECHO('.'); SERIAL_ECHOLN(aVersion[3]); */ render_M862_warnings( 18d8a: f0 90 e9 04 lds r15, 0x04E9 ; 0x8004e9 18d8e: 82 e7 ldi r24, 0x72 ; 114 18d90: 97 e3 ldi r25, 0x37 ; 55 18d92: 0e 94 ac 72 call 0xe558 ; 0xe558 18d96: 8c 01 movw r16, r24 18d98: 82 e4 ldi r24, 0x42 ; 66 18d9a: 97 e3 ldi r25, 0x37 ; 55 18d9c: 0e 94 ac 72 call 0xe558 ; 0xe558 18da0: 4f 2d mov r20, r15 18da2: b8 01 movw r22, r16 18da4: 0e 94 f1 f4 call 0x1e9e2 ; 0x1e9e2 18da8: 0c 94 ee aa jmp 0x155dc ; 0x155dc else if(code_seen('Q')) 18dac: 81 e5 ldi r24, 0x51 ; 81 18dae: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 18db2: 88 23 and r24, r24 18db4: 11 f4 brne .+4 ; 0x18dba 18db6: 0c 94 ee aa jmp 0x155dc ; 0x155dc 18dba: 0c 94 6a a7 jmp 0x14ed4 ; 0x14ed4 { uint16_t nGcodeLevel; nGcodeLevel=(uint16_t)code_value_long(); gcode_level_check(nGcodeLevel); } else if(code_seen('Q')) 18dbe: 81 e5 ldi r24, 0x51 ; 81 18dc0: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 18dc4: 88 23 and r24, r24 18dc6: 11 f4 brne .+4 ; 0x18dcc 18dc8: 0c 94 ee aa jmp 0x155dc ; 0x155dc SERIAL_PROTOCOLLN(GCODE_LEVEL); 18dcc: 81 e0 ldi r24, 0x01 ; 1 18dce: 90 e0 ldi r25, 0x00 ; 0 18dd0: 0f 94 f5 74 call 0x2e9ea ; 0x2e9ea 18dd4: 0c 94 ee aa jmp 0x155dc ; 0x155dc * 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; 18dd8: 8b e4 ldi r24, 0x4B ; 75 18dda: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 18dde: c1 2c mov r12, r1 18de0: d1 2c mov r13, r1 18de2: e1 2c mov r14, r1 18de4: 40 ec ldi r20, 0xC0 ; 192 18de6: f4 2e mov r15, r20 18de8: 88 23 and r24, r24 18dea: 49 f1 breq .+82 ; 0x18e3e 18dec: 0e 94 9d 60 call 0xc13a ; 0xc13a 18df0: 6b 01 movw r12, r22 18df2: 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) 18df4: 20 e0 ldi r18, 0x00 ; 0 18df6: 30 e0 ldi r19, 0x00 ; 0 18df8: a9 01 movw r20, r18 18dfa: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 18dfe: 81 11 cpse r24, r1 18e00: 1e c0 rjmp .+60 ; 0x18e3e { extruder_advance_K = 0; 18e02: 10 92 65 05 sts 0x0565, r1 ; 0x800565 18e06: 10 92 66 05 sts 0x0566, r1 ; 0x800566 18e0a: 10 92 67 05 sts 0x0567, r1 ; 0x800567 18e0e: 10 92 68 05 sts 0x0568, r1 ; 0x800568 18e12: 0e 94 17 82 call 0x1042e ; 0x1042e else extruder_advance_K = newK; } #endif SERIAL_ECHO_START; 18e16: 82 ec ldi r24, 0xC2 ; 194 18e18: 9b ea ldi r25, 0xAB ; 171 18e1a: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHOPGM("Advance K="); 18e1e: 87 e6 ldi r24, 0x67 ; 103 18e20: 9e e7 ldi r25, 0x7E ; 126 18e22: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHOLN(extruder_advance_K); 18e26: 60 91 65 05 lds r22, 0x0565 ; 0x800565 18e2a: 70 91 66 05 lds r23, 0x0566 ; 0x800566 18e2e: 80 91 67 05 lds r24, 0x0567 ; 0x800567 18e32: 90 91 68 05 lds r25, 0x0568 ; 0x800568 18e36: 0f 94 b4 74 call 0x2e968 ; 0x2e968 18e3a: 0c 94 ee aa jmp 0x155dc ; 0x155dc } float la10c_value(float k) { if(la10c_mode == LA10C_UNKNOWN) 18e3e: 80 91 70 03 lds r24, 0x0370 ; 0x800370 18e42: 81 11 cpse r24, r1 18e44: 1b c0 rjmp .+54 ; 0x18e7c { // do not autodetect until a valid value is seen if(k == 0) return 0; else if(k < 0) 18e46: 20 e0 ldi r18, 0x00 ; 0 18e48: 30 e0 ldi r19, 0x00 ; 0 18e4a: a9 01 movw r20, r18 18e4c: c7 01 movw r24, r14 18e4e: b6 01 movw r22, r12 18e50: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 18e54: 87 ff sbrs r24, 7 18e56: 05 c0 rjmp .+10 ; 0x18e62 } else { newK = la10c_value(newK); if (newK < 0) SERIAL_ECHOLNPGM("K out of allowed range!"); 18e58: 82 e7 ldi r24, 0x72 ; 114 18e5a: 9e e7 ldi r25, 0x7E ; 126 18e5c: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 18e60: da cf rjmp .-76 ; 0x18e16 return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); 18e62: 20 e0 ldi r18, 0x00 ; 0 18e64: 30 e0 ldi r19, 0x00 ; 0 18e66: 40 e2 ldi r20, 0x20 ; 32 18e68: 51 e4 ldi r21, 0x41 ; 65 18e6a: c7 01 movw r24, r14 18e6c: b6 01 movw r22, r12 18e6e: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 18e72: 87 ff sbrs r24, 7 18e74: 2c c0 rjmp .+88 ; 0x18ece 18e76: 81 e0 ldi r24, 0x01 ; 1 18e78: 0e 94 17 82 call 0x1042e ; 0x1042e } if(la10c_mode == LA10C_LA15) 18e7c: 80 91 70 03 lds r24, 0x0370 ; 0x800370 return (k >= 0 && k < LA_K_MAX? k: -1); 18e80: 20 e0 ldi r18, 0x00 ; 0 18e82: 30 e0 ldi r19, 0x00 ; 0 18e84: a9 01 movw r20, r18 return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); } if(la10c_mode == LA10C_LA15) 18e86: 81 30 cpi r24, 0x01 ; 1 18e88: 21 f5 brne .+72 ; 0x18ed2 return (k >= 0 && k < LA_K_MAX? k: -1); 18e8a: c7 01 movw r24, r14 18e8c: b6 01 movw r22, r12 18e8e: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 18e92: 87 fd sbrc r24, 7 18e94: e1 cf rjmp .-62 ; 0x18e58 18e96: 20 e0 ldi r18, 0x00 ; 0 18e98: 30 e0 ldi r19, 0x00 ; 0 18e9a: 40 e2 ldi r20, 0x20 ; 32 18e9c: 51 e4 ldi r21, 0x41 ; 65 18e9e: c7 01 movw r24, r14 18ea0: b6 01 movw r22, r12 18ea2: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 18ea6: 87 ff sbrs r24, 7 18ea8: d7 cf rjmp .-82 ; 0x18e58 la10c_reset(); } else { newK = la10c_value(newK); if (newK < 0) 18eaa: 20 e0 ldi r18, 0x00 ; 0 18eac: 30 e0 ldi r19, 0x00 ; 0 18eae: a9 01 movw r20, r18 18eb0: c7 01 movw r24, r14 18eb2: b6 01 movw r22, r12 18eb4: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 18eb8: 87 fd sbrc r24, 7 18eba: ce cf rjmp .-100 ; 0x18e58 SERIAL_ECHOLNPGM("K out of allowed range!"); else extruder_advance_K = newK; 18ebc: c0 92 65 05 sts 0x0565, r12 ; 0x800565 18ec0: d0 92 66 05 sts 0x0566, r13 ; 0x800566 18ec4: e0 92 67 05 sts 0x0567, r14 ; 0x800567 18ec8: f0 92 68 05 sts 0x0568, r15 ; 0x800568 18ecc: a4 cf rjmp .-184 ; 0x18e16 if(k == 0) return 0; else if(k < 0) return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); 18ece: 82 e0 ldi r24, 0x02 ; 2 18ed0: d3 cf rjmp .-90 ; 0x18e78 } if(la10c_mode == LA10C_LA15) return (k >= 0 && k < LA_K_MAX? k: -1); else return (k >= 0? la10c_convert(k): -1); 18ed2: c7 01 movw r24, r14 18ed4: b6 01 movw r22, r12 18ed6: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 18eda: 87 fd sbrc r24, 7 18edc: bd cf rjmp .-134 ; 0x18e58 // Approximate a LA10 value to a LA15 equivalent. static float la10c_convert(float k) { float new_K = k * 0.002 - 0.01; 18ede: 2f e6 ldi r18, 0x6F ; 111 18ee0: 32 e1 ldi r19, 0x12 ; 18 18ee2: 43 e0 ldi r20, 0x03 ; 3 18ee4: 5b e3 ldi r21, 0x3B ; 59 18ee6: c7 01 movw r24, r14 18ee8: b6 01 movw r22, r12 18eea: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 18eee: 2a e0 ldi r18, 0x0A ; 10 18ef0: 37 ed ldi r19, 0xD7 ; 215 18ef2: 43 e2 ldi r20, 0x23 ; 35 18ef4: 5c e3 ldi r21, 0x3C ; 60 18ef6: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 18efa: 6b 01 movw r12, r22 18efc: 7c 01 movw r14, r24 return new_K < 0? 0: 18efe: 20 e0 ldi r18, 0x00 ; 0 18f00: 30 e0 ldi r19, 0x00 ; 0 18f02: a9 01 movw r20, r18 18f04: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 18f08: 87 fd sbrc r24, 7 18f0a: 11 c0 rjmp .+34 ; 0x18f2e new_K > (LA_K_MAX - FLT_EPSILON)? (LA_K_MAX - FLT_EPSILON): 18f0c: 20 e0 ldi r18, 0x00 ; 0 18f0e: 30 e0 ldi r19, 0x00 ; 0 18f10: 40 e2 ldi r20, 0x20 ; 32 18f12: 51 e4 ldi r21, 0x41 ; 65 18f14: c7 01 movw r24, r14 18f16: b6 01 movw r22, r12 18f18: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 18f1c: 18 16 cp r1, r24 18f1e: 2c f6 brge .-118 ; 0x18eaa 18f20: c1 2c mov r12, r1 18f22: d1 2c mov r13, r1 18f24: 30 e2 ldi r19, 0x20 ; 32 18f26: e3 2e mov r14, r19 18f28: 31 e4 ldi r19, 0x41 ; 65 18f2a: f3 2e mov r15, r19 18f2c: c7 cf rjmp .-114 ; 0x18ebc // 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: 18f2e: c1 2c mov r12, r1 18f30: d1 2c mov r13, r1 18f32: 76 01 movw r14, r12 18f34: c3 cf rjmp .-122 ; 0x18ebc 18f36: 9d ed ldi r25, 0xDD ; 221 18f38: 89 2e mov r8, r25 18f3a: 92 e0 ldi r25, 0x02 ; 2 18f3c: 99 2e mov r9, r25 18f3e: 0d e5 ldi r16, 0x5D ; 93 18f40: 12 e0 ldi r17, 0x02 ; 2 18f42: 25 ef ldi r18, 0xF5 ; 245 18f44: a2 2e mov r10, r18 18f46: 24 e0 ldi r18, 0x04 ; 4 18f48: 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++){ 18f4a: 71 2c mov r7, r1 if(code_seen(axis_codes[i])){ 18f4c: f4 01 movw r30, r8 18f4e: 81 91 ld r24, Z+ 18f50: 4f 01 movw r8, r30 18f52: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 18f56: 88 23 and r24, r24 18f58: 09 f4 brne .+2 ; 0x18f5c 18f5a: 45 c0 rjmp .+138 ; 0x18fe6 if( i == E_AXIS && FarmOrUserECool() ){ 18f5c: f3 e0 ldi r31, 0x03 ; 3 18f5e: 7f 12 cpse r7, r31 18f60: 04 c0 rjmp .+8 ; 0x18f6a 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(); 18f62: 0e 94 d1 ef call 0x1dfa2 ; 0x1dfa2 18f66: 81 11 cpse r24, r1 18f68: 61 c0 rjmp .+194 ; 0x1902c SERIAL_ECHORPGM(eMotorCurrentScalingEnabled); SERIAL_ECHOLNPGM(", M907 E ignored"); continue; } float cur_mA = code_value(); 18f6a: 0e 94 9d 60 call 0xc13a ; 0xc13a 18f6e: 6b 01 movw r12, r22 18f70: 7c 01 movw r14, r24 //! | 1020 | 62 | | //! | 1029 | 63 | | uint8_t tmc2130_cur2val(float cur) { if (cur < 0) cur = 0; //limit min 18f72: 20 e0 ldi r18, 0x00 ; 0 18f74: 30 e0 ldi r19, 0x00 ; 0 18f76: a9 01 movw r20, r18 18f78: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 18f7c: 87 fd sbrc r24, 7 18f7e: 46 c0 rjmp .+140 ; 0x1900c if (cur > 1029) cur = 1029; //limit max 18f80: 20 e0 ldi r18, 0x00 ; 0 18f82: 30 ea ldi r19, 0xA0 ; 160 18f84: 40 e8 ldi r20, 0x80 ; 128 18f86: 54 e4 ldi r21, 0x44 ; 68 18f88: c7 01 movw r24, r14 18f8a: b6 01 movw r22, r12 18f8c: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 18f90: 18 16 cp r1, r24 18f92: a4 f1 brlt .+104 ; 0x18ffc //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; 18f94: 20 e0 ldi r18, 0x00 ; 0 18f96: 30 e0 ldi r19, 0x00 ; 0 18f98: 47 e0 ldi r20, 0x07 ; 7 18f9a: 54 e4 ldi r21, 0x44 ; 68 18f9c: c7 01 movw r24, r14 18f9e: b6 01 movw r22, r12 18fa0: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 18fa4: 87 fd sbrc r24, 7 18fa6: 35 c0 rjmp .+106 ; 0x19012 18fa8: 20 e0 ldi r18, 0x00 ; 0 18faa: 30 e0 ldi r19, 0x00 ; 0 18fac: 4c e7 ldi r20, 0x7C ; 124 18fae: 52 e4 ldi r21, 0x42 ; 66 18fb0: c7 01 movw r24, r14 18fb2: b6 01 movw r22, r12 18fb4: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 18fb8: 20 e0 ldi r18, 0x00 ; 0 18fba: 30 ea ldi r19, 0xA0 ; 160 18fbc: 40 e8 ldi r20, 0x80 ; 128 18fbe: 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); 18fc0: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 18fc4: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 18fc8: f6 2e mov r15, r22 uint8_t val = tmc2130_cur2val(cur_mA); currents[i].setiHold(val); 18fca: c8 01 movw r24, r16 18fcc: 0e 94 fe 67 call 0xcffc ; 0xcffc currents[i].setiRun(val); 18fd0: 6f 2d mov r22, r15 18fd2: c8 01 movw r24, r16 18fd4: 0e 94 06 68 call 0xd00c ; 0xd00c tmc2130_setup_chopper(i, tmc2130_mres[i]); 18fd8: 50 e0 ldi r21, 0x00 ; 0 18fda: 40 e0 ldi r20, 0x00 ; 0 18fdc: d5 01 movw r26, r10 18fde: 6c 91 ld r22, X 18fe0: 87 2d mov r24, r7 18fe2: 0f 94 8f 24 call 0x2491e ; 0x2491e */ case 907: { #ifdef TMC2130 // See tmc2130_cur2val() for translation to 0 .. 63 range for (uint_least8_t i = 0; i < NUM_AXIS; i++){ 18fe6: 73 94 inc r7 18fe8: 0d 5f subi r16, 0xFD ; 253 18fea: 1f 4f sbci r17, 0xFF ; 255 18fec: bf ef ldi r27, 0xFF ; 255 18fee: ab 1a sub r10, r27 18ff0: bb 0a sbc r11, r27 18ff2: e4 e0 ldi r30, 0x04 ; 4 18ff4: 7e 12 cpse r7, r30 18ff6: aa cf rjmp .-172 ; 0x18f4c 18ff8: 0c 94 ee aa jmp 0x155dc ; 0x155dc //! | 1029 | 63 | | uint8_t tmc2130_cur2val(float cur) { if (cur < 0) cur = 0; //limit min if (cur > 1029) cur = 1029; //limit max 18ffc: c1 2c mov r12, r1 18ffe: 80 ea ldi r24, 0xA0 ; 160 19000: d8 2e mov r13, r24 19002: 80 e8 ldi r24, 0x80 ; 128 19004: e8 2e mov r14, r24 19006: 84 e4 ldi r24, 0x44 ; 68 19008: f8 2e mov r15, r24 1900a: ce cf rjmp .-100 ; 0x18fa8 //! | 1020 | 62 | | //! | 1029 | 63 | | uint8_t tmc2130_cur2val(float cur) { if (cur < 0) cur = 0; //limit min 1900c: c1 2c mov r12, r1 1900e: d1 2c mov r13, r1 19010: 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); 19012: 20 e0 ldi r18, 0x00 ; 0 19014: 30 e0 ldi r19, 0x00 ; 0 19016: 4c e7 ldi r20, 0x7C ; 124 19018: 52 e4 ldi r21, 0x42 ; 66 1901a: c7 01 movw r24, r14 1901c: b6 01 movw r22, r12 1901e: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 19022: 20 e0 ldi r18, 0x00 ; 0 19024: 34 eb ldi r19, 0xB4 ; 180 19026: 40 e9 ldi r20, 0x90 ; 144 19028: 54 e4 ldi r21, 0x44 ; 68 1902a: ca cf rjmp .-108 ; 0x18fc0 if(code_seen(axis_codes[i])){ if( i == E_AXIS && FarmOrUserECool() ){ SERIAL_ECHORPGM(eMotorCurrentScalingEnabled); 1902c: 80 e7 ldi r24, 0x70 ; 112 1902e: 9f e9 ldi r25, 0x9F ; 159 19030: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHOLNPGM(", M907 E ignored"); 19034: 8e e3 ldi r24, 0x3E ; 62 19036: 95 e8 ldi r25, 0x85 ; 133 19038: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 1903c: d4 cf rjmp .-88 ; 0x18fe6 1903e: 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; } 19042: 80 91 66 02 lds r24, 0x0266 ; 0x800266 19046: 81 11 cpse r24, r1 19048: 01 c0 rjmp .+2 ; 0x1904c 1904a: 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"), 1904c: 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() 1904e: 86 e6 ldi r24, 0x66 ; 102 19050: 92 e0 ldi r25, 0x02 ; 2 19052: 0f 94 16 27 call 0x24e2c ; 0x24e2c 19056: 88 2e mov r8, r24 19058: c0 90 64 02 lds r12, 0x0264 ; 0x800264 1905c: 80 91 63 02 lds r24, 0x0263 ; 0x800263 19060: 81 11 cpse r24, r1 19062: 01 c0 rjmp .+2 ; 0x19066 19064: 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"), 19066: d1 2c mov r13, r1 currents[0].getOriginaliHold(), currents[0].getOriginaliRun(), currents[1].getOriginaliHold(), currents[1].getOriginaliRun(), currents[2].getOriginaliHold(), currents[2].getOriginaliRun(), 19068: 83 e6 ldi r24, 0x63 ; 99 1906a: 92 e0 ldi r25, 0x02 ; 2 1906c: 0f 94 16 27 call 0x24e2c ; 0x24e2c 19070: 98 2e mov r9, r24 19072: 00 91 61 02 lds r16, 0x0261 ; 0x800261 19076: 80 91 60 02 lds r24, 0x0260 ; 0x800260 1907a: 81 11 cpse r24, r1 1907c: 01 c0 rjmp .+2 ; 0x19080 1907e: 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"), 19080: 10 e0 ldi r17, 0x00 ; 0 currents[0].getOriginaliHold(), currents[0].getOriginaliRun(), currents[1].getOriginaliHold(), currents[1].getOriginaliRun(), 19082: 80 e6 ldi r24, 0x60 ; 96 19084: 92 e0 ldi r25, 0x02 ; 2 19086: 0f 94 16 27 call 0x24e2c ; 0x24e2c 1908a: e8 2e mov r14, r24 1908c: f0 90 5e 02 lds r15, 0x025E ; 0x80025e 19090: 80 91 5d 02 lds r24, 0x025D ; 0x80025d 19094: 81 11 cpse r24, r1 19096: 01 c0 rjmp .+2 ; 0x1909a 19098: 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(), 1909a: 8d e5 ldi r24, 0x5D ; 93 1909c: 92 e0 ldi r25, 0x02 ; 2 1909e: 0f 94 16 27 call 0x24e2c ; 0x24e2c 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"), 190a2: bf 92 push r11 190a4: af 92 push r10 190a6: 1f 92 push r1 190a8: 8f 92 push r8 190aa: df 92 push r13 190ac: cf 92 push r12 190ae: 1f 92 push r1 190b0: 9f 92 push r9 190b2: 1f 93 push r17 190b4: 0f 93 push r16 190b6: 1f 92 push r1 190b8: ef 92 push r14 190ba: 1f 92 push r1 190bc: ff 92 push r15 190be: 1f 92 push r1 190c0: 8f 93 push r24 190c2: 82 e9 ldi r24, 0x92 ; 146 190c4: 97 e6 ldi r25, 0x67 ; 103 190c6: 9f 93 push r25 190c8: 8f 93 push r24 190ca: 0f 94 de da call 0x3b5bc ; 0x3b5bc 190ce: 0f b6 in r0, 0x3f ; 63 190d0: f8 94 cli 190d2: de bf out 0x3e, r29 ; 62 190d4: 0f be out 0x3f, r0 ; 63 190d6: cd bf out 0x3d, r28 ; 61 190d8: 0c 94 ee aa jmp 0x155dc ; 0x155dc - `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; 190dc: 11 e0 ldi r17, 0x01 ; 1 190de: 82 39 cpi r24, 0x92 ; 146 190e0: 93 40 sbci r25, 0x03 ; 3 190e2: 09 f4 brne .+2 ; 0x190e6 190e4: 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')) 190e6: 82 e5 ldi r24, 0x52 ; 82 190e8: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 190ec: 88 23 and r24, r24 190ee: 81 f0 breq .+32 ; 0x19110 { newMode = eeprom_read_byte((uint8_t*)EEPROM_SILENT); 190f0: 8f ef ldi r24, 0xFF ; 255 190f2: 9f e0 ldi r25, 0x0F ; 15 190f4: 0f 94 1c dc call 0x3b838 ; 0x3b838 190f8: 18 2f mov r17, r24 tmc2130_mode == TMC2130_MODE_NORMAL ? _O(MSG_NORMAL) : _O(MSG_SILENT) ); } if (tmc2130_mode != newMode 190fa: 80 91 8c 06 lds r24, 0x068C ; 0x80068c 190fe: 81 17 cp r24, r17 19100: 11 f4 brne .+4 ; 0x19106 19102: 0c 94 ee aa jmp 0x155dc ; 0x155dc ) { #ifdef PSU_Delta enable_force_z(); #endif change_power_mode_live(newMode); 19106: 81 2f mov r24, r17 19108: 0e 94 89 60 call 0xc112 ; 0xc112 1910c: 0c 94 ee aa jmp 0x155dc ; 0x155dc //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')) 19110: 80 e5 ldi r24, 0x50 ; 80 19112: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 19116: 88 23 and r24, r24 19118: 89 f0 breq .+34 ; 0x1913c { uint8_t newMenuMode = (mcode_in_progress==914) ? SILENT_MODE_NORMAL : SILENT_MODE_STEALTH; 1911a: 01 e0 ldi r16, 0x01 ; 1 1911c: 80 91 aa 0d lds r24, 0x0DAA ; 0x800daa <_ZL17mcode_in_progress.lto_priv.530> 19120: 90 91 ab 0d lds r25, 0x0DAB ; 0x800dab <_ZL17mcode_in_progress.lto_priv.530+0x1> 19124: 82 39 cpi r24, 0x92 ; 146 19126: 93 40 sbci r25, 0x03 ; 3 19128: 09 f4 brne .+2 ; 0x1912c 1912a: 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); 1912c: 60 2f mov r22, r16 1912e: 8f ef ldi r24, 0xFF ; 255 19130: 9f e0 ldi r25, 0x0F ; 15 19132: 0f 94 40 dc call 0x3b880 ; 0x3b880 eeprom_update_byte_notify((unsigned char *)EEPROM_SILENT, newMenuMode); SilentModeMenu = newMenuMode; 19136: 00 93 a4 03 sts 0x03A4, r16 ; 0x8003a4 1913a: df cf rjmp .-66 ; 0x190fa //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')) 1913c: 81 e5 ldi r24, 0x51 ; 81 1913e: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 19142: 88 23 and r24, r24 19144: d1 f2 breq .-76 ; 0x190fa { printf_P(PSTR("%S: %S\n"), _O(MSG_MODE), 19146: 80 91 8c 06 lds r24, 0x068C ; 0x80068c 1914a: 81 11 cpse r24, r1 1914c: 15 c0 rjmp .+42 ; 0x19178 1914e: 8a e8 ldi r24, 0x8A ; 138 19150: 94 e4 ldi r25, 0x44 ; 68 19152: 9f 93 push r25 19154: 8f 93 push r24 19156: 8d e0 ldi r24, 0x0D ; 13 19158: 98 e4 ldi r25, 0x48 ; 72 1915a: 9f 93 push r25 1915c: 8f 93 push r24 1915e: 86 e3 ldi r24, 0x36 ; 54 19160: 95 e8 ldi r25, 0x85 ; 133 19162: 9f 93 push r25 19164: 8f 93 push r24 19166: 0f 94 de da call 0x3b5bc ; 0x3b5bc 1916a: 0f 90 pop r0 1916c: 0f 90 pop r0 1916e: 0f 90 pop r0 19170: 0f 90 pop r0 19172: 0f 90 pop r0 19174: 0f 90 pop r0 19176: c1 cf rjmp .-126 ; 0x190fa 19178: 8a e8 ldi r24, 0x8A ; 138 1917a: 97 e4 ldi r25, 0x47 ; 71 1917c: ea cf rjmp .-44 ; 0x19152 1917e: 8d ed ldi r24, 0xDD ; 221 19180: 92 e0 ldi r25, 0x02 ; 2 19182: 6c 96 adiw r28, 0x1c ; 28 19184: 9f af std Y+63, r25 ; 0x3f 19186: 8e af std Y+62, r24 ; 0x3e 19188: 6c 97 sbiw r28, 0x1c ; 28 1918a: ee eb ldi r30, 0xBE ; 190 1918c: ee 2e mov r14, r30 1918e: ed e0 ldi r30, 0x0D ; 13 19190: fe 2e mov r15, r30 19192: f3 ea ldi r31, 0xA3 ; 163 19194: cf 2e mov r12, r31 19196: f6 e0 ldi r31, 0x06 ; 6 19198: df 2e mov r13, r31 1919a: a5 ef ldi r26, 0xF5 ; 245 1919c: 2a 2e mov r2, r26 1919e: a4 e0 ldi r26, 0x04 ; 4 191a0: 3a 2e mov r3, r26 191a2: ba e7 ldi r27, 0x7A ; 122 191a4: 8b 2e mov r8, r27 191a6: be e0 ldi r27, 0x0E ; 14 191a8: 9b 2e mov r9, r27 - `S` - All axes new resolution */ case 350: { #ifdef TMC2130 for (uint_least8_t i=0; i 191c6: b8 2e mov r11, r24 191c8: 88 23 and r24, r24 191ca: 09 f4 brne .+2 ; 0x191ce 191cc: 7c c0 rjmp .+248 ; 0x192c6 { uint16_t res_new = code_value(); 191ce: 0e 94 9d 60 call 0xc13a ; 0xc13a 191d2: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 191d6: 2b 01 movw r4, r22 191d8: 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 191da: 68 30 cpi r22, 0x08 ; 8 191dc: 71 05 cpc r23, r1 191de: 09 f4 brne .+2 ; 0x191e2 191e0: 60 c3 rjmp .+1728 ; 0x198a2 191e2: 60 31 cpi r22, 0x10 ; 16 191e4: 71 05 cpc r23, r1 191e6: 09 f4 brne .+2 ; 0x191ea 191e8: 5c c3 rjmp .+1720 ; 0x198a2 191ea: 81 e0 ldi r24, 0x01 ; 1 191ec: 00 32 cpi r16, 0x20 ; 32 191ee: 11 05 cpc r17, r1 191f0: 09 f0 breq .+2 ; 0x191f4 191f2: 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 191f4: 67 96 adiw r28, 0x17 ; 23 191f6: bf ad ldd r27, Y+63 ; 0x3f 191f8: 67 97 sbiw r28, 0x17 ; 23 191fa: b3 30 cpi r27, 0x03 ; 3 191fc: 09 f4 brne .+2 ; 0x19200 191fe: 5c c3 rjmp .+1720 ; 0x198b8 19200: 92 01 movw r18, r4 19202: 21 50 subi r18, 0x01 ; 1 19204: 31 09 sbc r19, r1 19206: 22 30 cpi r18, 0x02 ; 2 19208: 31 05 cpc r19, r1 1920a: 08 f0 brcs .+2 ; 0x1920e 1920c: 50 c3 rjmp .+1696 ; 0x198ae 1920e: 9b 2d mov r25, r11 19210: 89 2b or r24, r25 res_valid |= (i == E_AXIS) && ((res_new == 64) || (res_new == 128)); // resolutions valid for E only 19212: 67 96 adiw r28, 0x17 ; 23 19214: ef ad ldd r30, Y+63 ; 0x3f 19216: 67 97 sbiw r28, 0x17 ; 23 19218: e3 30 cpi r30, 0x03 ; 3 1921a: 41 f4 brne .+16 ; 0x1922c 1921c: 00 34 cpi r16, 0x40 ; 64 1921e: 11 05 cpc r17, r1 19220: 31 f0 breq .+12 ; 0x1922e 19222: bb 24 eor r11, r11 19224: b3 94 inc r11 19226: 00 38 cpi r16, 0x80 ; 128 19228: 11 05 cpc r17, r1 1922a: 09 f0 breq .+2 ; 0x1922e 1922c: b1 2c mov r11, r1 #endif if (res_valid) 1922e: 81 11 cpse r24, r1 19230: 03 c0 rjmp .+6 ; 0x19238 19232: bb 20 and r11, r11 19234: 09 f4 brne .+2 ; 0x19238 19236: 47 c0 rjmp .+142 ; 0x192c6 { st_synchronize(); 19238: 0f 94 e8 42 call 0x285d0 ; 0x285d0 return stat; } uint16_t tmc2130_get_res(uint8_t axis) { return tmc2130_mres2usteps(tmc2130_mres[axis]); 1923c: d1 01 movw r26, r2 1923e: 8c 91 ld r24, X 19240: a1 2c mov r10, r1 19242: bb 24 eor r11, r11 19244: b3 94 inc r11 19246: 02 c0 rjmp .+4 ; 0x1924c 19248: b6 94 lsr r11 1924a: a7 94 ror r10 1924c: 8a 95 dec r24 1924e: e2 f7 brpl .-8 ; 0x19248 uint16_t res = tmc2130_get_res(i); tmc2130_set_res(i, res_new); 19250: b2 01 movw r22, r4 19252: 67 96 adiw r28, 0x17 ; 23 19254: 8f ad ldd r24, Y+63 ; 0x3f 19256: 67 97 sbiw r28, 0x17 ; 23 19258: 0f 94 fa 24 call 0x249f4 ; 0x249f4 cs.axis_ustep_resolution[i] = res_new; 1925c: f4 01 movw r30, r8 1925e: 40 82 st Z, r4 if (res_new > res) 19260: a0 16 cp r10, r16 19262: b1 06 cpc r11, r17 19264: 08 f0 brcs .+2 ; 0x19268 19266: 47 c0 rjmp .+142 ; 0x192f6 { uint16_t fac = (res_new / res); 19268: c8 01 movw r24, r16 1926a: b5 01 movw r22, r10 1926c: 0f 94 e5 dc call 0x3b9ca ; 0x3b9ca <__udivmodhi4> cs.axis_steps_per_mm[i] *= fac; 19270: 2b 01 movw r4, r22 19272: 71 2c mov r7, r1 19274: 61 2c mov r6, r1 19276: c3 01 movw r24, r6 19278: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 1927c: 9b 01 movw r18, r22 1927e: ac 01 movw r20, r24 19280: d7 01 movw r26, r14 19282: 14 96 adiw r26, 0x04 ; 4 19284: 6d 91 ld r22, X+ 19286: 7d 91 ld r23, X+ 19288: 8d 91 ld r24, X+ 1928a: 9c 91 ld r25, X 1928c: 17 97 sbiw r26, 0x07 ; 7 1928e: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 19292: f7 01 movw r30, r14 19294: 64 83 std Z+4, r22 ; 0x04 19296: 75 83 std Z+5, r23 ; 0x05 19298: 86 83 std Z+6, r24 ; 0x06 1929a: 97 83 std Z+7, r25 ; 0x07 position[i] *= fac; 1929c: d6 01 movw r26, r12 1929e: 2d 91 ld r18, X+ 192a0: 3d 91 ld r19, X+ 192a2: 4d 91 ld r20, X+ 192a4: 5c 91 ld r21, X 192a6: c3 01 movw r24, r6 192a8: b2 01 movw r22, r4 192aa: 0f 94 7f dc call 0x3b8fe ; 0x3b8fe <__mulsi3> 192ae: f6 01 movw r30, r12 192b0: 60 83 st Z, r22 192b2: 71 83 std Z+1, r23 ; 0x01 192b4: 82 83 std Z+2, r24 ; 0x02 192b6: 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) 192b8: 67 96 adiw r28, 0x17 ; 23 192ba: ff ad ldd r31, Y+63 ; 0x3f 192bc: 67 97 sbiw r28, 0x17 ; 23 192be: f3 30 cpi r31, 0x03 ; 3 192c0: 11 f4 brne .+4 ; 0x192c6 fsensor.init(); 192c2: 0f 94 39 7b call 0x2f672 ; 0x2f672 - `S` - All axes new resolution */ case 350: { #ifdef TMC2130 for (uint_least8_t i=0; i 192f0: 5f cf rjmp .-322 ; 0x191b0 192f2: 0c 94 74 b0 jmp 0x160e8 ; 0x160e8 cs.axis_steps_per_mm[i] *= fac; position[i] *= fac; } else { uint16_t fac = (res / res_new); 192f6: c5 01 movw r24, r10 192f8: b8 01 movw r22, r16 192fa: 0f 94 e5 dc call 0x3b9ca ; 0x3b9ca <__udivmodhi4> cs.axis_steps_per_mm[i] /= fac; 192fe: 2b 01 movw r4, r22 19300: 71 2c mov r7, r1 19302: 61 2c mov r6, r1 19304: c3 01 movw r24, r6 19306: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 1930a: 9b 01 movw r18, r22 1930c: ac 01 movw r20, r24 1930e: d7 01 movw r26, r14 19310: 14 96 adiw r26, 0x04 ; 4 19312: 6d 91 ld r22, X+ 19314: 7d 91 ld r23, X+ 19316: 8d 91 ld r24, X+ 19318: 9c 91 ld r25, X 1931a: 17 97 sbiw r26, 0x07 ; 7 1931c: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 19320: f7 01 movw r30, r14 19322: 64 83 std Z+4, r22 ; 0x04 19324: 75 83 std Z+5, r23 ; 0x05 19326: 86 83 std Z+6, r24 ; 0x06 19328: 97 83 std Z+7, r25 ; 0x07 position[i] /= fac; 1932a: d6 01 movw r26, r12 1932c: 6d 91 ld r22, X+ 1932e: 7d 91 ld r23, X+ 19330: 8d 91 ld r24, X+ 19332: 9c 91 ld r25, X 19334: a3 01 movw r20, r6 19336: 92 01 movw r18, r4 19338: 0f 94 0d dd call 0x3ba1a ; 0x3ba1a <__divmodsi4> 1933c: f6 01 movw r30, r12 1933e: 20 83 st Z, r18 19340: 31 83 std Z+1, r19 ; 0x01 19342: 42 83 std Z+2, r20 ; 0x02 19344: 53 83 std Z+3, r21 ; 0x03 19346: b8 cf rjmp .-144 ; 0x192b8 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') ) { 19348: 80 e5 ldi r24, 0x50 ; 80 1934a: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 1934e: 88 23 and r24, r24 19350: 29 f0 breq .+10 ; 0x1935c mmuSlotIndex = code_value_uint8(); 19352: 0e 94 68 5b call 0xb6d0 ; 0xb6d0 19356: 18 2f mov r17, r24 19358: 0c 94 f4 a9 jmp 0x153e8 ; 0x153e8 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') ) { 1935c: 84 e5 ldi r24, 0x54 ; 84 1935e: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 19362: 81 11 cpse r24, r1 19364: f6 cf rjmp .-20 ; 0x19352 19366: 0c 94 f3 a9 jmp 0x153e6 ; 0x153e6 */ case 701: { uint8_t mmuSlotIndex = 0xffU; float fastLoadLength = FILAMENTCHANGE_FIRSTFEED; // Only used without MMU float z_target = 0; 1936a: 60 e0 ldi r22, 0x00 ; 0 1936c: 70 e0 ldi r23, 0x00 ; 0 1936e: cb 01 movw r24, r22 19370: 0c 94 0d aa jmp 0x1541a ; 0x1541a 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; 19374: 82 e0 ldi r24, 0x02 ; 2 19376: 80 93 c4 06 sts 0x06C4, r24 ; 0x8006c4 lcd_setstatuspgm(_T(MSG_LOADING_FILAMENT)); 1937a: 87 e3 ldi r24, 0x37 ; 55 1937c: 9c e5 ldi r25, 0x5C ; 92 1937e: 0e 94 ac 72 call 0xe558 ; 0xe558 19382: 0e 94 5d f1 call 0x1e2ba ; 0x1e2ba current_position[E_AXIS] += fastLoadLength; 19386: a7 01 movw r20, r14 19388: 96 01 movw r18, r12 1938a: 60 91 9e 06 lds r22, 0x069E ; 0x80069e 1938e: 70 91 9f 06 lds r23, 0x069F ; 0x80069f 19392: 80 91 a0 06 lds r24, 0x06A0 ; 0x8006a0 19396: 90 91 a1 06 lds r25, 0x06A1 ; 0x8006a1 1939a: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 1939e: 60 93 9e 06 sts 0x069E, r22 ; 0x80069e 193a2: 70 93 9f 06 sts 0x069F, r23 ; 0x80069f 193a6: 80 93 a0 06 sts 0x06A0, r24 ; 0x8006a0 193aa: 90 93 a1 06 sts 0x06A1, r25 ; 0x8006a1 plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FIRST); //fast sequence 193ae: 60 e0 ldi r22, 0x00 ; 0 193b0: 70 e0 ldi r23, 0x00 ; 0 193b2: 80 ea ldi r24, 0xA0 ; 160 193b4: 91 e4 ldi r25, 0x41 ; 65 193b6: 0f 94 49 c0 call 0x38092 ; 0x38092 if (raise_z_axis) { // backwards compatibility for 3.12 and older FW 193ba: 01 11 cpse r16, r1 193bc: 06 c0 rjmp .+12 ; 0x193ca raise_z_above(MIN_Z_FOR_LOAD); 193be: 60 e0 ldi r22, 0x00 ; 0 193c0: 70 e0 ldi r23, 0x00 ; 0 193c2: 88 e4 ldi r24, 0x48 ; 72 193c4: 92 e4 ldi r25, 0x42 ; 66 193c6: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 } load_filament_final_feed(); // slow sequence 193ca: 0e 94 93 64 call 0xc926 ; 0xc926 st_synchronize(); 193ce: 0f 94 e8 42 call 0x285d0 ; 0x285d0 Sound_MakeCustom(50, 500, false); 193d2: 40 e0 ldi r20, 0x00 ; 0 193d4: 64 ef ldi r22, 0xF4 ; 244 193d6: 71 e0 ldi r23, 0x01 ; 1 193d8: 82 e3 ldi r24, 0x32 ; 50 193da: 90 e0 ldi r25, 0x00 ; 0 193dc: 0f 94 46 51 call 0x2a28c ; 0x2a28c if (!farm_mode && (eFilamentAction != FilamentAction::None)) { 193e0: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 193e4: 81 11 cpse r24, r1 lcd_load_filament_color_check(); 193e6: 0f 94 69 4f call 0x29ed2 ; 0x29ed2 #ifdef COMMUNITY_PREVENT_OOZE // Retract filament to prevent oozing retract_for_ooze_prevention(); #endif //COMMUNITY_PREVENT_OOZE lcd_update_enable(true); 193ea: 81 e0 ldi r24, 0x01 ; 1 193ec: 0e 94 25 6f call 0xde4a ; 0xde4a lcd_update(2); 193f0: 82 e0 ldi r24, 0x02 ; 2 193f2: 0e 94 a7 6e call 0xdd4e ; 0xdd4e lcd_setstatuspgm(MSG_WELCOME); 193f6: 83 e7 ldi r24, 0x73 ; 115 193f8: 90 e7 ldi r25, 0x70 ; 112 193fa: 0e 94 5d f1 call 0x1e2ba ; 0x1e2ba custom_message_type = CustomMsg::Status; 193fe: 10 92 c4 06 sts 0x06C4, r1 ; 0x8006c4 19402: 0c 94 22 aa jmp 0x15444 ; 0x15444 */ case 702: { float z_target = 0; float unloadLength = FILAMENTCHANGE_FINALRETRACT; if (code_seen('U')) unloadLength = code_value(); 19406: 85 e5 ldi r24, 0x55 ; 85 19408: 0e 94 d6 5b call 0xb7ac ; 0xb7ac - `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; 1940c: c1 2c mov r12, r1 1940e: d1 2c mov r13, r1 19410: 76 01 movw r14, r12 if (code_seen('U')) unloadLength = code_value(); 19412: 88 23 and r24, r24 19414: 21 f0 breq .+8 ; 0x1941e 19416: 0e 94 9d 60 call 0xc13a ; 0xc13a 1941a: 6b 01 movw r12, r22 1941c: 7c 01 movw r14, r24 // For safety only allow positive values if (code_seen('Z')) z_target = fabs(code_value()); 1941e: 8a e5 ldi r24, 0x5A ; 90 19420: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 19424: 88 23 and r24, r24 19426: a1 f0 breq .+40 ; 0x19450 19428: 0e 94 9d 60 call 0xc13a ; 0xc13a 1942c: 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); 1942e: 0e 94 e1 6d call 0xdbc2 ; 0xdbc2 19432: 4b 01 movw r8, r22 19434: 5c 01 movw r10, r24 // Unload filament if (MMU2::mmu2.Enabled()) MMU2::mmu2.unload(); 19436: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 1943a: 81 30 cpi r24, 0x01 ; 1 1943c: 99 f4 brne .+38 ; 0x19464 1943e: 0f 94 3d ad call 0x35a7a ; 0x35a7a else unload_filament(unloadLength); // Restore Z axis raise_z(-delta); 19442: c5 01 movw r24, r10 19444: b4 01 movw r22, r8 19446: 90 58 subi r25, 0x80 ; 128 19448: 0e 94 e1 6d call 0xdbc2 ; 0xdbc2 1944c: 0c 94 ee aa jmp 0x155dc ; 0x155dc 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 19450: 60 e0 ldi r22, 0x00 ; 0 19452: 70 e0 ldi r23, 0x00 ; 0 19454: 80 ea ldi r24, 0xA0 ; 160 19456: 91 e4 ldi r25, 0x41 ; 65 19458: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 - `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; 1945c: 60 e0 ldi r22, 0x00 ; 0 1945e: 70 e0 ldi r23, 0x00 ; 0 19460: cb 01 movw r24, r22 19462: e5 cf rjmp .-54 ; 0x1942e // Raise the Z axis float delta = raise_z(z_target); // Unload filament if (MMU2::mmu2.Enabled()) MMU2::mmu2.unload(); else unload_filament(unloadLength); 19464: c7 01 movw r24, r14 19466: b6 01 movw r22, r12 19468: 0e 94 4f f8 call 0x1f09e ; 0x1f09e 1946c: ea cf rjmp .-44 ; 0x19442 #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 705: { gcodes_M704_M705_M706(705); 1946e: 81 ec ldi r24, 0xC1 ; 193 19470: 92 e0 ldi r25, 0x02 ; 2 19472: 0e 94 4f 60 call 0xc09e ; 0xc09e 19476: 0c 94 ee aa jmp 0x155dc ; 0x155dc #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 706: { gcodes_M704_M705_M706(706); 1947a: 82 ec ldi r24, 0xC2 ; 194 1947c: 92 e0 ldi r25, 0x02 ; 2 1947e: 0e 94 4f 60 call 0xc09e ; 0xc09e 19482: 0c 94 ee aa jmp 0x155dc ; 0x155dc 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() ) { 19486: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 1948a: 81 30 cpi r24, 0x01 ; 1 1948c: 11 f0 breq .+4 ; 0x19492 1948e: 0c 94 ee aa jmp 0x155dc ; 0x155dc if( code_seen('A') ) { 19492: 81 e4 ldi r24, 0x41 ; 65 19494: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 19498: 88 23 and r24, r24 1949a: 11 f4 brne .+4 ; 0x194a0 1949c: 0c 94 ee aa jmp 0x155dc ; 0x155dc MMU2::mmu2.ReadRegister(uint8_t(strtol(strchr_pointer+1, NULL, 16))); 194a0: 80 91 95 03 lds r24, 0x0395 ; 0x800395 194a4: 90 91 96 03 lds r25, 0x0396 ; 0x800396 194a8: 40 e1 ldi r20, 0x10 ; 16 194aa: 50 e0 ldi r21, 0x00 ; 0 194ac: 70 e0 ldi r23, 0x00 ; 0 194ae: 60 e0 ldi r22, 0x00 ; 0 194b0: 01 96 adiw r24, 0x01 ; 1 194b2: 0f 94 a7 d7 call 0x3af4e ; 0x3af4e 194b6: 86 2f mov r24, r22 194b8: 0f 94 9b 0f call 0x21f36 ; 0x21f36 194bc: 0c 94 ee aa jmp 0x155dc ; 0x155dc 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() ){ 194c0: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 194c4: 81 30 cpi r24, 0x01 ; 1 194c6: 11 f0 breq .+4 ; 0x194cc 194c8: 0c 94 ee aa jmp 0x155dc ; 0x155dc uint8_t addr = 0; if( code_seen('A') ) { 194cc: 81 e4 ldi r24, 0x41 ; 65 194ce: 0e 94 d6 5b call 0xb7ac ; 0xb7ac Does nothing if A parameter is missing or if MMU is not enabled. */ case 708: { if ( MMU2::mmu2.Enabled() ){ uint8_t addr = 0; 194d2: 10 e0 ldi r17, 0x00 ; 0 if( code_seen('A') ) { 194d4: 88 23 and r24, r24 194d6: 61 f0 breq .+24 ; 0x194f0 addr = uint8_t(strtol(strchr_pointer+1, NULL, 16)); 194d8: 80 91 95 03 lds r24, 0x0395 ; 0x800395 194dc: 90 91 96 03 lds r25, 0x0396 ; 0x800396 194e0: 40 e1 ldi r20, 0x10 ; 16 194e2: 50 e0 ldi r21, 0x00 ; 0 194e4: 70 e0 ldi r23, 0x00 ; 0 194e6: 60 e0 ldi r22, 0x00 ; 0 194e8: 01 96 adiw r24, 0x01 ; 1 194ea: 0f 94 a7 d7 call 0x3af4e ; 0x3af4e 194ee: 16 2f mov r17, r22 } uint16_t data = 0; if( code_seen('X') ) { 194f0: 88 e5 ldi r24, 0x58 ; 88 194f2: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 194f6: 88 23 and r24, r24 194f8: 61 f0 breq .+24 ; 0x19512 data = code_value_short(); 194fa: 0e 94 75 5b call 0xb6ea ; 0xb6ea } if(addr){ 194fe: 11 23 and r17, r17 19500: 11 f4 brne .+4 ; 0x19506 19502: 0c 94 ee aa jmp 0x155dc ; 0x155dc MMU2::mmu2.WriteRegister(addr, data); 19506: bc 01 movw r22, r24 19508: 81 2f mov r24, r17 1950a: 0e 94 44 e8 call 0x1d088 ; 0x1d088 1950e: 0c 94 ee aa jmp 0x155dc ; 0x155dc 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; 19512: 90 e0 ldi r25, 0x00 ; 0 19514: 80 e0 ldi r24, 0x00 ; 0 19516: f3 cf rjmp .-26 ; 0x194fe 19518: 60 e0 ldi r22, 0x00 ; 0 1951a: 8c ea ldi r24, 0xAC ; 172 1951c: 9c e0 ldi r25, 0x0C ; 12 1951e: 0f 94 40 dc call 0x3b880 ; 0x3b880 StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 19522: 10 92 ba 13 sts 0x13BA, r1 ; 0x8013ba protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 19526: 10 92 68 13 sts 0x1368, r1 ; 0x801368 currentScope = Scope::Stopped; 1952a: 10 92 4d 13 sts 0x134D, r1 ; 0x80134d 1952e: 0c 94 66 aa jmp 0x154cc ; 0x154cc 19532: 61 e0 ldi r22, 0x01 ; 1 19534: 8c ea ldi r24, 0xAC ; 172 19536: 9c e0 ldi r25, 0x0C ; 12 19538: 0f 94 40 dc call 0x3b880 ; 0x3b880 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(); 1953c: 0e 94 8e e3 call 0x1c71c ; 0x1c71c 19540: 0c 94 66 aa jmp 0x154cc ; 0x154cc break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 19544: 80 e0 ldi r24, 0x00 ; 0 } void MMU2::ResetX42() { logic.ResetMMU(42); 19546: 0f 94 7c 0f call 0x21ef8 ; 0x21ef8 1954a: 0c 94 7c aa jmp 0x154f8 ; 0x154f8 } void MMU2::TriggerResetPin() { reset(); 1954e: 0f 94 9a c5 call 0x38b34 ; 0x38b34 19552: 0c 94 7c aa jmp 0x154f8 ; 0x154f8 void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset } void MMU2::ResetX42() { logic.ResetMMU(42); 19556: 8a e2 ldi r24, 0x2A ; 42 19558: f6 cf rjmp .-20 ; 0x19546 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') { 1955a: 84 35 cpi r24, 0x54 ; 84 1955c: 09 f0 breq .+2 ; 0x19560 1955e: 79 c0 rjmp .+242 ; 0x19652 strchr_pointer = CMDBUFFER_CURRENT_STRING; 19560: 10 93 96 03 sts 0x0396, r17 ; 0x800396 19564: 00 93 95 03 sts 0x0395, r16 ; 0x800395 processing_tcode = true; 19568: 81 e0 ldi r24, 0x01 ; 1 1956a: 80 93 a3 03 sts 0x03A3, r24 ; 0x8003a3 TCodes(strchr_pointer, code_value_uint8()); 1956e: 0e 94 68 5b call 0xb6d0 ; 0xb6d0 19572: 18 2f mov r17, r24 19574: 20 91 95 03 lds r18, 0x0395 ; 0x800395 19578: 30 91 96 03 lds r19, 0x0396 ; 0x800396 inline void TCodeInvalid() { SERIAL_ECHOLNPGM("Invalid T code."); } void TCodes(char *const strchr_pointer, const uint8_t codeValue) { uint8_t index = 1; 1957c: 91 e0 ldi r25, 0x01 ; 1 for ( /*nothing*/ ; strchr_pointer[index] == ' ' || strchr_pointer[index] == '\t'; index++) 1957e: 79 01 movw r14, r18 19580: e9 0e add r14, r25 19582: f1 1c adc r15, r1 19584: d7 01 movw r26, r14 19586: 8c 91 ld r24, X 19588: 80 32 cpi r24, 0x20 ; 32 1958a: 11 f0 breq .+4 ; 0x19590 1958c: 89 30 cpi r24, 0x09 ; 9 1958e: 11 f4 brne .+4 ; 0x19594 19590: 9f 5f subi r25, 0xFF ; 255 19592: f5 cf rjmp .-22 ; 0x1957e ; strchr_pointer[index] = tolower(strchr_pointer[index]); 19594: 08 2e mov r0, r24 19596: 00 0c add r0, r0 19598: 99 0b sbc r25, r25 1959a: 0f 94 30 e2 call 0x3c460 ; 0x3c460 1959e: f7 01 movw r30, r14 195a0: 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'); 195a2: 90 ed ldi r25, 0xD0 ; 208 195a4: 98 0f add r25, r24 195a6: 95 30 cpi r25, 0x05 ; 5 195a8: 58 f0 brcs .+22 ; 0x195c0 195aa: 8f 33 cpi r24, 0x3F ; 63 195ac: 59 f0 breq .+22 ; 0x195c4 195ae: 88 37 cpi r24, 0x78 ; 120 195b0: 49 f0 breq .+18 ; 0x195c4 195b2: 83 36 cpi r24, 0x63 ; 99 195b4: f1 f0 breq .+60 ; 0x195f2 } inline void TCodeInvalid() { SERIAL_ECHOLNPGM("Invalid T code."); 195b6: 8d e3 ldi r24, 0x3D ; 61 195b8: 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 195ba: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 195be: 13 c0 rjmp .+38 ; 0x195e6 strchr_pointer[index] = tolower(strchr_pointer[index]); if (IsInvalidTCode(strchr_pointer, index)){ TCodeInvalid(); } else if (strchr_pointer[index] == 'x' || strchr_pointer[index] == '?'){ 195c0: 8f 33 cpi r24, 0x3F ; 63 195c2: a9 f4 brne .+42 ; 0x195ee // load to extruder gears; if mmu is not present do nothing if (MMU2::mmu2.Enabled()) { 195c4: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 195c8: 81 30 cpi r24, 0x01 ; 1 195ca: 69 f4 brne .+26 ; 0x195e6 MMU2::mmu2.tool_change(strchr_pointer[index], choose_menu_P(_T(MSG_SELECT_FILAMENT), MSG_FILAMENT)); 195cc: 8d ea ldi r24, 0xAD ; 173 195ce: 9b e3 ldi r25, 0x3B ; 59 195d0: 0e 94 ac 72 call 0xe558 ; 0xe558 195d4: 70 e0 ldi r23, 0x00 ; 0 195d6: 60 e0 ldi r22, 0x00 ; 0 195d8: 0e 94 01 e4 call 0x1c802 ; 0x1c802 195dc: 68 2f mov r22, r24 195de: d7 01 movw r26, r14 195e0: 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()); 195e2: 0f 94 1a 0f call 0x21e34 ; 0x21e34 processing_tcode = false; 195e6: 10 92 a3 03 sts 0x03A3, r1 ; 0x8003a3 195ea: 0c 94 39 96 jmp 0x12c72 ; 0x12c72 } 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'){ 195ee: 83 36 cpi r24, 0x63 ; 99 195f0: 49 f4 brne .+18 ; 0x19604 // load from extruder gears to nozzle (nozzle should be preheated) if (MMU2::mmu2.Enabled()) { 195f2: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 195f6: 81 30 cpi r24, 0x01 ; 1 195f8: b1 f7 brne .-20 ; 0x195e6 MMU2::mmu2.tool_change(strchr_pointer[index], MMU2::mmu2.get_current_tool()); 195fa: 0f 94 b9 74 call 0x2e972 ; 0x2e972 195fe: 68 2f mov r22, r24 19600: 83 e6 ldi r24, 0x63 ; 99 19602: ef cf rjmp .-34 ; 0x195e2 } } else { // Process T0 ... T4 if (MMU2::mmu2.Enabled()) { 19604: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 19608: 81 30 cpi r24, 0x01 ; 1 1960a: 69 f4 brne .+26 ; 0x19626 if (codeValue == MMU2::mmu2.get_current_tool()){ 1960c: 0f 94 b9 74 call 0x2e972 ; 0x2e972 19610: 18 13 cpse r17, r24 19612: 05 c0 rjmp .+10 ; 0x1961e // don't execute the same T-code twice in a row puts_P(duplicate_Tcode_ignored); 19614: 8d e4 ldi r24, 0x4D ; 77 19616: 9e e7 ldi r25, 0x7E ; 126 19618: 0f 94 05 db call 0x3b60a ; 0x3b60a 1961c: e4 cf rjmp .-56 ; 0x195e6 #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); 1961e: 81 2f mov r24, r17 19620: 0f 94 f7 0e call 0x21dee ; 0x21dee 19624: e0 cf rjmp .-64 ; 0x195e6 } } else { SERIAL_ECHO_START; 19626: 82 ec ldi r24, 0xC2 ; 194 19628: 9b ea ldi r25, 0xAB ; 171 1962a: 0e 94 50 77 call 0xeea0 ; 0xeea0 if (codeValue >= EXTRUDERS) { 1962e: 11 23 and r17, r17 19630: 59 f0 breq .+22 ; 0x19648 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 19632: 84 e5 ldi r24, 0x54 ; 84 19634: 0e 94 37 77 call 0xee6e ; 0xee6e SERIAL_ECHO('T'); SERIAL_ECHOLN(codeValue + '0'); 19638: 81 2f mov r24, r17 1963a: 90 e0 ldi r25, 0x00 ; 0 1963c: c0 96 adiw r24, 0x30 ; 48 1963e: 0f 94 f5 74 call 0x2e9ea ; 0x2e9ea SERIAL_ECHOLNRPGM(_n("Invalid extruder")); ////MSG_INVALID_EXTRUDER 19642: 81 e8 ldi r24, 0x81 ; 129 19644: 97 e6 ldi r25, 0x67 ; 103 19646: b9 cf rjmp .-142 ; 0x195ba // next_feedrate = code_value(); // if (next_feedrate > 0.0) { // feedrate = next_feedrate; // } // } SERIAL_ECHORPGM(_n("Active Extruder: 0")); ////MSG_ACTIVE_EXTRUDER 19648: 8e e6 ldi r24, 0x6E ; 110 1964a: 97 e6 ldi r25, 0x67 ; 103 1964c: 0e 94 50 77 call 0xeea0 ; 0xeea0 19650: ca cf rjmp .-108 ; 0x195e6 /** *--------------------------------------------------------------------------------- *# D codes */ else if(*CMDBUFFER_CURRENT_STRING == 'D') // D codes (debug) 19652: 84 34 cpi r24, 0x44 ; 68 19654: 09 f0 breq .+2 ; 0x19658 19656: ee c0 rjmp .+476 ; 0x19834 { strchr_pointer = CMDBUFFER_CURRENT_STRING; 19658: 10 93 96 03 sts 0x0396, r17 ; 0x800396 1965c: 00 93 95 03 sts 0x0395, r16 ; 0x800395 switch(code_value_short()) 19660: 0e 94 75 5b call 0xb6ea ; 0xb6ea 19664: 86 30 cpi r24, 0x06 ; 6 19666: 91 05 cpc r25, r1 19668: 09 f4 brne .+2 ; 0x1966c 1966a: 79 c0 rjmp .+242 ; 0x1975e 1966c: 9c f4 brge .+38 ; 0x19694 1966e: 82 30 cpi r24, 0x02 ; 2 19670: 91 05 cpc r25, r1 19672: 09 f4 brne .+2 ; 0x19676 19674: 52 c0 rjmp .+164 ; 0x1971a 19676: 83 30 cpi r24, 0x03 ; 3 19678: 91 05 cpc r25, r1 1967a: 09 f4 brne .+2 ; 0x1967e 1967c: 61 c0 rjmp .+194 ; 0x19740 1967e: 01 96 adiw r24, 0x01 ; 1 19680: 89 f4 brne .+34 ; 0x196a4 * */ void dcode__1() { DBG(_N("D-1 - Endless loop\n")); 19682: 8a e5 ldi r24, 0x5A ; 90 19684: 97 e6 ldi r25, 0x67 ; 103 19686: 9f 93 push r25 19688: 8f 93 push r24 1968a: 0f 94 de da call 0x3b5bc ; 0x3b5bc 1968e: 0f 90 pop r0 19690: 0f 90 pop r0 19692: ff cf rjmp .-2 ; 0x19692 19694: 85 31 cpi r24, 0x15 ; 21 19696: 91 05 cpc r25, r1 19698: 09 f4 brne .+2 ; 0x1969c 1969a: 8d c0 rjmp .+282 ; 0x197b6 1969c: 94 f4 brge .+36 ; 0x196c2 1969e: 44 97 sbiw r24, 0x14 ; 20 196a0: 09 f4 brne .+2 ; 0x196a4 196a2: 69 c0 rjmp .+210 ; 0x19776 #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) #endif //DEBUG_DCODES default: printf_P(MSG_UNKNOWN_CODE, 'D', cmdbuffer + bufindr + CMDHDRSIZE); 196a4: 80 91 92 12 lds r24, 0x1292 ; 0x801292 196a8: 90 91 93 12 lds r25, 0x1293 ; 0x801293 196ac: 88 55 subi r24, 0x58 ; 88 196ae: 9f 4e sbci r25, 0xEF ; 239 196b0: 9f 93 push r25 196b2: 8f 93 push r24 196b4: 1f 92 push r1 196b6: 84 e4 ldi r24, 0x44 ; 68 196b8: 8f 93 push r24 196ba: 82 e5 ldi r24, 0x52 ; 82 196bc: 99 e6 ldi r25, 0x69 ; 105 196be: 0c 94 d4 97 jmp 0x12fa8 ; 0x12fa8 *# D codes */ else if(*CMDBUFFER_CURRENT_STRING == 'D') // D codes (debug) { strchr_pointer = CMDBUFFER_CURRENT_STRING; switch(code_value_short()) 196c2: 86 31 cpi r24, 0x16 ; 22 196c4: 91 05 cpc r25, r1 196c6: 09 f4 brne .+2 ; 0x196ca 196c8: 9b c0 rjmp .+310 ; 0x19800 196ca: 86 34 cpi r24, 0x46 ; 70 196cc: 91 05 cpc r25, r1 196ce: 51 f7 brne .-44 ; 0x196a4 #### Parameters - `S` - Enable 0-1 (default 0) */ case 70: { if(code_seen('S')) 196d0: 83 e5 ldi r24, 0x53 ; 83 196d2: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 196d6: 88 23 and r24, r24 196d8: 11 f4 brne .+4 ; 0x196de 196da: 0c 94 39 96 jmp 0x12c72 ; 0x12c72 thermal_model_log_enable(code_value_short()); 196de: 0e 94 75 5b call 0xb6ea ; 0xb6ea 196e2: 11 e0 ldi r17, 0x01 ; 1 196e4: 00 97 sbiw r24, 0x00 ; 0 196e6: 09 f4 brne .+2 ; 0x196ea 196e8: 10 e0 ldi r17, 0x00 ; 0 } #ifdef THERMAL_MODEL_DEBUG void thermal_model_log_enable(bool enable) { if(enable) { 196ea: 89 2b or r24, r25 196ec: 91 f0 breq .+36 ; 0x19712 TempMgrGuard temp_mgr_guard; 196ee: ce 01 movw r24, r28 196f0: 01 96 adiw r24, 0x01 ; 1 196f2: 0f 94 9a 31 call 0x26334 ; 0x26334 thermal_model::log_buf.entry.stamp = _millis(); 196f6: 0f 94 4c 29 call 0x25298 ; 0x25298 196fa: 60 93 24 06 sts 0x0624, r22 ; 0x800624 <_ZN13thermal_modelL7log_bufE.lto_priv.537> 196fe: 70 93 25 06 sts 0x0625, r23 ; 0x800625 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x1> 19702: 80 93 26 06 sts 0x0626, r24 ; 0x800626 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x2> 19706: 90 93 27 06 sts 0x0627, r25 ; 0x800627 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x3> #ifdef THERMAL_MODEL_DEBUG void thermal_model_log_enable(bool enable) { if(enable) { TempMgrGuard temp_mgr_guard; 1970a: ce 01 movw r24, r28 1970c: 01 96 adiw r24, 0x01 ; 1 1970e: 0f 94 8d 31 call 0x2631a ; 0x2631a thermal_model::log_buf.entry.stamp = _millis(); } thermal_model::log_buf.enabled = enable; 19712: 10 93 34 06 sts 0x0634, r17 ; 0x800634 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x10> 19716: 0c 94 39 96 jmp 0x12c72 ; 0x12c72 - The hex data needs to be lowercase */ void dcode_2() { dcode_core(RAMSTART, RAMEND+1, dcode_mem_t::sram, 2, _N("SRAM")); 1971a: 45 e5 ldi r20, 0x55 ; 85 1971c: c4 2e mov r12, r20 1971e: 47 e6 ldi r20, 0x67 ; 103 19720: d4 2e mov r13, r20 19722: 52 e0 ldi r21, 0x02 ; 2 19724: e5 2e mov r14, r21 19726: 00 e0 ldi r16, 0x00 ; 0 19728: 20 e0 ldi r18, 0x00 ; 0 1972a: 32 e2 ldi r19, 0x22 ; 34 1972c: 40 e0 ldi r20, 0x00 ; 0 1972e: 50 e0 ldi r21, 0x00 ; 0 19730: 60 e0 ldi r22, 0x00 ; 0 19732: 72 e0 ldi r23, 0x02 ; 2 19734: 80 e0 ldi r24, 0x00 ; 0 19736: 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")); 19738: 0e 94 a3 62 call 0xc546 ; 0xc546 1973c: 0c 94 39 96 jmp 0x12c72 ; 0x12c72 - The hex data needs to be lowercase */ void dcode_3() { dcode_core(0, EEPROM_SIZE, dcode_mem_t::eeprom, 3, _N("EEPROM")); 19740: 2e e4 ldi r18, 0x4E ; 78 19742: c2 2e mov r12, r18 19744: 27 e6 ldi r18, 0x67 ; 103 19746: d2 2e mov r13, r18 19748: 33 e0 ldi r19, 0x03 ; 3 1974a: e3 2e mov r14, r19 1974c: 01 e0 ldi r16, 0x01 ; 1 1974e: 20 e0 ldi r18, 0x00 ; 0 19750: 30 e1 ldi r19, 0x10 ; 16 19752: 40 e0 ldi r20, 0x00 ; 0 19754: 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")); 19756: 60 e0 ldi r22, 0x00 ; 0 19758: 70 e0 ldi r23, 0x00 ; 0 1975a: cb 01 movw r24, r22 1975c: ed cf rjmp .-38 ; 0x19738 1975e: 87 e4 ldi r24, 0x47 ; 71 19760: c8 2e mov r12, r24 19762: 87 e6 ldi r24, 0x67 ; 103 19764: d8 2e mov r13, r24 19766: 96 e0 ldi r25, 0x06 ; 6 19768: e9 2e mov r14, r25 1976a: 03 e0 ldi r16, 0x03 ; 3 1976c: 20 e0 ldi r18, 0x00 ; 0 1976e: 30 e0 ldi r19, 0x00 ; 0 19770: 44 e0 ldi r20, 0x04 ; 4 19772: 50 e0 ldi r21, 0x00 ; 0 19774: f0 cf rjmp .-32 ; 0x19756 #ifdef XFLASH_DUMP #include "xflash_dump.h" void dcode_20() { if(code_seen('E')) 19776: 85 e4 ldi r24, 0x45 ; 69 19778: 0e 94 d6 5b call 0xb7ac ; 0xb7ac 1977c: 88 23 and r24, r24 1977e: 29 f0 breq .+10 ; 0x1978a xfdump_full_dump_and_reset(); 19780: 80 e0 ldi r24, 0x00 ; 0 19782: 0e 94 bc ed call 0x1db78 ; 0x1db78 19786: 0c 94 39 96 jmp 0x12c72 ; 0x12c72 else { unsigned long ts = _millis(); 1978a: 0f 94 4c 29 call 0x25298 ; 0x25298 1978e: 6b 01 movw r12, r22 19790: 7c 01 movw r14, r24 xfdump_dump(); 19792: 0e 94 ea ed call 0x1dbd4 ; 0x1dbd4 ts = _millis() - ts; 19796: 0f 94 4c 29 call 0x25298 ; 0x25298 1979a: dc 01 movw r26, r24 1979c: cb 01 movw r24, r22 1979e: 8c 19 sub r24, r12 197a0: 9d 09 sbc r25, r13 197a2: ae 09 sbc r26, r14 197a4: bf 09 sbc r27, r15 DBG(_N("dump completed in %lums\n"), ts); 197a6: bf 93 push r27 197a8: af 93 push r26 197aa: 9f 93 push r25 197ac: 8f 93 push r24 197ae: 8e e2 ldi r24, 0x2E ; 46 197b0: 97 e6 ldi r25, 0x67 ; 103 197b2: 0c 94 d4 97 jmp 0x12fa8 ; 0x12fa8 } } void dcode_21() { if(!xfdump_check_state()) 197b6: 90 e0 ldi r25, 0x00 ; 0 197b8: 80 e0 ldi r24, 0x00 ; 0 197ba: 0e 94 08 ed call 0x1da10 ; 0x1da10 197be: 81 11 cpse r24, r1 197c0: 07 c0 rjmp .+14 ; 0x197d0 DBG(_N("no dump available\n")); 197c2: 8b e1 ldi r24, 0x1B ; 27 197c4: 97 e6 ldi r25, 0x67 ; 103 if(!xfdump_check_state()) DBG(_N("no dump available\n")); else { xfdump_reset(); DBG(_N("dump cleared\n")); 197c6: 9f 93 push r25 197c8: 8f 93 push r24 197ca: 0f 94 de da call 0x3b5bc ; 0x3b5bc 197ce: 14 c0 rjmp .+40 ; 0x197f8 { if(!xfdump_check_state()) DBG(_N("no dump available\n")); else { KEEPALIVE_STATE(NOT_BUSY); 197d0: 81 e0 ldi r24, 0x01 ; 1 197d2: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be DBG(_N("D21 - read crash dump\n")); 197d6: 84 e0 ldi r24, 0x04 ; 4 197d8: 97 e6 ldi r25, 0x67 ; 103 197da: 9f 93 push r25 197dc: 8f 93 push r24 197de: 0f 94 de da call 0x3b5bc ; 0x3b5bc print_mem(DUMP_OFFSET, sizeof(dump_t), dcode_mem_t::xflash); 197e2: 03 e0 ldi r16, 0x03 ; 3 197e4: 20 e0 ldi r18, 0x00 ; 0 197e6: 33 e2 ldi r19, 0x23 ; 35 197e8: 40 e0 ldi r20, 0x00 ; 0 197ea: 50 e0 ldi r21, 0x00 ; 0 197ec: 60 e0 ldi r22, 0x00 ; 0 197ee: 70 ed ldi r23, 0xD0 ; 208 197f0: 83 e0 ldi r24, 0x03 ; 3 197f2: 90 e0 ldi r25, 0x00 ; 0 197f4: 0f 94 29 86 call 0x30c52 ; 0x30c52 if(!xfdump_check_state()) DBG(_N("no dump available\n")); else { xfdump_reset(); DBG(_N("dump cleared\n")); 197f8: 0f 90 pop r0 197fa: 0f 90 pop r0 197fc: 0c 94 39 96 jmp 0x12c72 ; 0x12c72 } } void dcode_22() { if(!xfdump_check_state()) 19800: 90 e0 ldi r25, 0x00 ; 0 19802: 80 e0 ldi r24, 0x00 ; 0 19804: 0e 94 08 ed call 0x1da10 ; 0x1da10 19808: 81 11 cpse r24, r1 1980a: 03 c0 rjmp .+6 ; 0x19812 DBG(_N("no dump available\n")); 1980c: 81 ef ldi r24, 0xF1 ; 241 1980e: 96 e6 ldi r25, 0x66 ; 102 19810: da cf rjmp .-76 ; 0x197c6 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 19812: 8c e5 ldi r24, 0x5C ; 92 19814: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 19816: 1d bc out 0x2d, r1 ; 45 void xfdump_reset() { XFLASH_SPI_ENTER(); xflash_enable_wr(); 19818: 0e 94 40 ed call 0x1da80 ; 0x1da80 _CS_HIGH(); } void xflash_sector_erase(uint32_t addr) { return xflash_erase(_CMD_SECTOR_ERASE, addr); 1981c: 40 e0 ldi r20, 0x00 ; 0 1981e: 50 ed ldi r21, 0xD0 ; 208 19820: 63 e0 ldi r22, 0x03 ; 3 19822: 70 e0 ldi r23, 0x00 ; 0 19824: 80 e2 ldi r24, 0x20 ; 32 19826: 0e 94 c2 ec call 0x1d984 ; 0x1d984 xflash_sector_erase(DUMP_OFFSET + offsetof(dump_t, header.magic)); xflash_wait_busy(); 1982a: 0e 94 a4 ec call 0x1d948 ; 0x1d948 else { xfdump_reset(); DBG(_N("dump cleared\n")); 1982e: 83 ee ldi r24, 0xE3 ; 227 19830: 96 e6 ldi r25, 0x66 ; 102 19832: c9 cf rjmp .-110 ; 0x197c6 } } else { SERIAL_ECHO_START; 19834: 82 ec ldi r24, 0xC2 ; 194 19836: 9b ea ldi r25, 0xAB ; 171 19838: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); 1983c: 83 ee ldi r24, 0xE3 ; 227 1983e: 97 e6 ldi r25, 0x67 ; 103 19840: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); 19844: 80 91 92 12 lds r24, 0x1292 ; 0x801292 19848: 90 91 93 12 lds r25, 0x1293 ; 0x801293 1984c: 88 55 subi r24, 0x58 ; 88 1984e: 9f 4e sbci r25, 0xEF ; 239 19850: 0e 94 14 88 call 0x11028 ; 0x11028 SERIAL_ECHOLNPGM("\"(2)"); 19854: 81 e3 ldi r24, 0x31 ; 49 19856: 95 e8 ldi r25, 0x85 ; 133 19858: 0c 94 44 98 jmp 0x13088 ; 0x13088 #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 1985c: 2d ec ldi r18, 0xCD ; 205 1985e: 3c ec ldi r19, 0xCC ; 204 19860: 4c ec ldi r20, 0xCC ; 204 19862: 5d e3 ldi r21, 0x3D ; 61 19864: c7 01 movw r24, r14 19866: b6 01 movw r22, r12 19868: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 1986c: 18 16 cp r1, r24 1986e: 14 f4 brge .+4 ; 0x19874 19870: 0c 94 81 99 jmp 0x13302 ; 0x13302 19874: 0c 94 ef 9a jmp 0x135de ; 0x135de 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; 19878: a3 01 movw r20, r6 1987a: 92 01 movw r18, r4 1987c: 62 2d mov r22, r2 1987e: 73 2d mov r23, r3 19880: 8e 2d mov r24, r14 19882: 9f 2d mov r25, r15 19884: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 19888: 18 16 cp r1, r24 1988a: 14 f0 brlt .+4 ; 0x19890 1988c: 0c 94 d0 a2 jmp 0x145a0 ; 0x145a0 19890: e5 e0 ldi r30, 0x05 ; 5 19892: ce 0e add r12, r30 19894: d1 1c adc r13, r1 19896: f2 e0 ldi r31, 0x02 ; 2 19898: 8f 0e add r8, r31 1989a: 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; 1989c: 85 01 movw r16, r10 1989e: 0c 94 97 a2 jmp 0x1452e ; 0x1452e 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 198a2: 67 96 adiw r28, 0x17 ; 23 198a4: 2f ad ldd r18, Y+63 ; 0x3f 198a6: 67 97 sbiw r28, 0x17 ; 23 198a8: 8b 2d mov r24, r11 198aa: 23 30 cpi r18, 0x03 ; 3 198ac: 29 f0 breq .+10 ; 0x198b8 198ae: 91 e0 ldi r25, 0x01 ; 1 198b0: 04 30 cpi r16, 0x04 ; 4 198b2: 11 05 cpc r17, r1 198b4: 09 f4 brne .+2 ; 0x198b8 198b6: ac cc rjmp .-1704 ; 0x19210 198b8: 90 e0 ldi r25, 0x00 ; 0 198ba: aa cc rjmp .-1708 ; 0x19210 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)); 198bc: 86 ea ldi r24, 0xA6 ; 166 198be: 99 e3 ldi r25, 0x39 ; 57 198c0: 0e 94 ac 72 call 0xe558 ; 0xe558 198c4: 0f 94 e4 1f call 0x23fc8 ; 0x23fc8 lcd_puts_at_P(0, 2, PSTR("")); 198c8: 44 e9 ldi r20, 0x94 ; 148 198ca: 54 e8 ldi r21, 0x84 ; 132 198cc: 62 e0 ldi r22, 0x02 ; 2 198ce: 80 e0 ldi r24, 0x00 ; 0 198d0: 0e 94 f4 6e call 0xdde8 ; 0xdde8 for (const char *c = version_string; ! is_whitespace_or_nl_or_eol(*c); ++ c) 198d4: f8 01 movw r30, r16 198d6: 81 91 ld r24, Z+ 198d8: 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'; 198da: 98 2f mov r25, r24 198dc: 9f 7d andi r25, 0xDF ; 223 198de: 11 f4 brne .+4 ; 0x198e4 198e0: 0c 94 dd b0 jmp 0x161ba ; 0x161ba 198e4: 97 ef ldi r25, 0xF7 ; 247 198e6: 98 0f add r25, r24 198e8: 92 30 cpi r25, 0x02 ; 2 198ea: 10 f4 brcc .+4 ; 0x198f0 198ec: 0c 94 dd b0 jmp 0x161ba ; 0x161ba 198f0: 8d 30 cpi r24, 0x0D ; 13 198f2: 11 f4 brne .+4 ; 0x198f8 198f4: 0c 94 dd b0 jmp 0x161ba ; 0x161ba 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); 198f8: 0e 94 cf 6e call 0xdd9e ; 0xdd9e 198fc: eb cf rjmp .-42 ; 0x198d4 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; 198fe: ce 01 movw r24, r28 19900: 01 96 adiw r24, 0x01 ; 1 19902: 0f 94 9a 31 call 0x26334 ; 0x26334 19906: 0c 94 11 b7 jmp 0x16e22 ; 0x16e22 0001990a : uint8_t check_pinda_0() { return _PINDA?0:1; } 1990a: 22 e0 ldi r18, 0x02 ; 2 1990c: 20 93 c0 00 sts 0x00C0, r18 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> 19910: 10 92 c5 00 sts 0x00C5, r1 ; 0x8000c5 <__TEXT_REGION_LENGTH__+0x7c20c5> 19914: 90 e1 ldi r25, 0x10 ; 16 19916: 90 93 c4 00 sts 0x00C4, r25 ; 0x8000c4 <__TEXT_REGION_LENGTH__+0x7c20c4> 1991a: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 1991e: 80 61 ori r24, 0x10 ; 16 19920: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 19924: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 19928: 88 60 ori r24, 0x08 ; 8 1992a: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 1992e: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 19932: 80 68 ori r24, 0x80 ; 128 19934: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 19938: 80 91 39 05 lds r24, 0x0539 ; 0x800539 1993c: 81 30 cpi r24, 0x01 ; 1 1993e: a9 f4 brne .+42 ; 0x1996a 19940: 20 93 c8 00 sts 0x00C8, r18 ; 0x8000c8 <__TEXT_REGION_LENGTH__+0x7c20c8> 19944: 10 92 cd 00 sts 0x00CD, r1 ; 0x8000cd <__TEXT_REGION_LENGTH__+0x7c20cd> 19948: 90 93 cc 00 sts 0x00CC, r25 ; 0x8000cc <__TEXT_REGION_LENGTH__+0x7c20cc> 1994c: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 19950: 80 61 ori r24, 0x10 ; 16 19952: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 19956: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 1995a: 88 60 ori r24, 0x08 ; 8 1995c: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 19960: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 19964: 80 68 ori r24, 0x80 ; 128 19966: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 1996a: 08 95 ret 0001996c : 1996c: 81 50 subi r24, 0x01 ; 1 1996e: 82 31 cpi r24, 0x12 ; 18 19970: 08 f0 brcs .+2 ; 0x19974 19972: 5a c0 rjmp .+180 ; 0x19a28 19974: e8 2f mov r30, r24 19976: f0 e0 ldi r31, 0x00 ; 0 19978: 88 27 eor r24, r24 1997a: ee 53 subi r30, 0x3E ; 62 1997c: f3 43 sbci r31, 0x33 ; 51 1997e: 8f 4f sbci r24, 0xFF ; 255 19980: 0d 94 2c dd jmp 0x3ba58 ; 0x3ba58 <__tablejump2__> 19984: e2 cc rjmp .-1596 ; 0x1934a 19986: e6 cc rjmp .-1588 ; 0x19354 19988: d4 cc rjmp .-1624 ; 0x19332 1998a: da cc rjmp .-1612 ; 0x19340 1998c: de cc rjmp .-1604 ; 0x1934a 1998e: 14 cd rjmp .-1496 ; 0x193b8 19990: e9 cc rjmp .-1582 ; 0x19364 19992: ef cc rjmp .-1570 ; 0x19372 19994: f3 cc rjmp .-1562 ; 0x1937c 19996: f9 cc rjmp .-1550 ; 0x1938a 19998: fd cc rjmp .-1542 ; 0x19394 1999a: 01 cd rjmp .-1534 ; 0x1939e 1999c: 07 cd rjmp .-1522 ; 0x193ac 1999e: 0b cd rjmp .-1514 ; 0x193b6 199a0: 14 cd rjmp .-1496 ; 0x193ca 199a2: 0f cd rjmp .-1506 ; 0x193c2 199a4: 15 cd rjmp .-1494 ; 0x193d0 199a6: 19 cd rjmp .-1486 ; 0x193da 199a8: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 199ac: 8f 77 andi r24, 0x7F ; 127 199ae: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 199b2: 08 95 ret 199b4: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 199b8: 8f 7d andi r24, 0xDF ; 223 199ba: f9 cf rjmp .-14 ; 0x199ae 199bc: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 199c0: 87 7f andi r24, 0xF7 ; 247 199c2: f5 cf rjmp .-22 ; 0x199ae 199c4: 84 b5 in r24, 0x24 ; 36 199c6: 8f 77 andi r24, 0x7F ; 127 199c8: 84 bd out 0x24, r24 ; 36 199ca: 08 95 ret 199cc: 84 b5 in r24, 0x24 ; 36 199ce: 8f 7d andi r24, 0xDF ; 223 199d0: fb cf rjmp .-10 ; 0x199c8 199d2: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 199d6: 8f 77 andi r24, 0x7F ; 127 199d8: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 199dc: 08 95 ret 199de: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 199e2: 8f 7d andi r24, 0xDF ; 223 199e4: f9 cf rjmp .-14 ; 0x199d8 199e6: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 199ea: 8f 77 andi r24, 0x7F ; 127 199ec: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 199f0: 08 95 ret 199f2: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 199f6: 8f 7d andi r24, 0xDF ; 223 199f8: f9 cf rjmp .-14 ; 0x199ec 199fa: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 199fe: 87 7f andi r24, 0xF7 ; 247 19a00: f5 cf rjmp .-22 ; 0x199ec 19a02: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 19a06: 8f 77 andi r24, 0x7F ; 127 19a08: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 19a0c: 08 95 ret 19a0e: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 19a12: 8f 7d andi r24, 0xDF ; 223 19a14: f9 cf rjmp .-14 ; 0x19a08 19a16: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 19a1a: 87 7f andi r24, 0xF7 ; 247 19a1c: f5 cf rjmp .-22 ; 0x19a08 19a1e: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 19a22: 8f 77 andi r24, 0x7F ; 127 19a24: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 19a28: 08 95 ret 19a2a: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 19a2e: 8f 7d andi r24, 0xDF ; 223 19a30: f9 cf rjmp .-14 ; 0x19a24 19a32: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 19a36: 87 7f andi r24, 0xF7 ; 247 19a38: f5 cf rjmp .-22 ; 0x19a24 00019a3a : 19a3a: 83 b1 in r24, 0x03 ; 3 19a3c: 82 95 swap r24 19a3e: 81 70 andi r24, 0x01 ; 1 19a40: 08 95 ret 00019a42 : } #else //SM4_ACCEL_TEST uint16_t xyzcal_calc_delay(uint16_t, uint16_t) { return xyzcal_sm4_delay; } 19a42: 80 91 fd 03 lds r24, 0x03FD ; 0x8003fd 19a46: 90 91 fe 03 lds r25, 0x03FE ; 0x8003fe 19a4a: 08 95 ret 00019a4c : } uint8_t xyzcal_dm = 0; void xyzcal_update_pos(uint16_t dx, uint16_t dy, uint16_t dz, uint16_t) { 19a4c: cf 92 push r12 19a4e: df 92 push r13 19a50: ef 92 push r14 19a52: 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; 19a54: 20 91 ff 03 lds r18, 0x03FF ; 0x8003ff 19a58: b0 e0 ldi r27, 0x00 ; 0 19a5a: a0 e0 ldi r26, 0x00 ; 0 19a5c: c0 90 b3 06 lds r12, 0x06B3 ; 0x8006b3 19a60: d0 90 b4 06 lds r13, 0x06B4 ; 0x8006b4 19a64: e0 90 b5 06 lds r14, 0x06B5 ; 0x8006b5 19a68: f0 90 b6 06 lds r15, 0x06B6 ; 0x8006b6 19a6c: 20 ff sbrs r18, 0 19a6e: 42 c0 rjmp .+132 ; 0x19af4 19a70: c8 1a sub r12, r24 19a72: d9 0a sbc r13, r25 19a74: ea 0a sbc r14, r26 19a76: fb 0a sbc r15, r27 19a78: c0 92 b3 06 sts 0x06B3, r12 ; 0x8006b3 19a7c: d0 92 b4 06 sts 0x06B4, r13 ; 0x8006b4 19a80: e0 92 b5 06 sts 0x06B5, r14 ; 0x8006b5 19a84: f0 92 b6 06 sts 0x06B6, r15 ; 0x8006b6 19a88: cb 01 movw r24, r22 19a8a: b0 e0 ldi r27, 0x00 ; 0 19a8c: a0 e0 ldi r26, 0x00 ; 0 if (xyzcal_dm&2) count_position[1] -= dy; else count_position[1] += dy; 19a8e: c0 90 b7 06 lds r12, 0x06B7 ; 0x8006b7 19a92: d0 90 b8 06 lds r13, 0x06B8 ; 0x8006b8 19a96: e0 90 b9 06 lds r14, 0x06B9 ; 0x8006b9 19a9a: f0 90 ba 06 lds r15, 0x06BA ; 0x8006ba 19a9e: 21 ff sbrs r18, 1 19aa0: 36 c0 rjmp .+108 ; 0x19b0e 19aa2: c8 1a sub r12, r24 19aa4: d9 0a sbc r13, r25 19aa6: ea 0a sbc r14, r26 19aa8: fb 0a sbc r15, r27 19aaa: c0 92 b7 06 sts 0x06B7, r12 ; 0x8006b7 19aae: d0 92 b8 06 sts 0x06B8, r13 ; 0x8006b8 19ab2: e0 92 b9 06 sts 0x06B9, r14 ; 0x8006b9 19ab6: f0 92 ba 06 sts 0x06BA, r15 ; 0x8006ba 19aba: 70 e0 ldi r23, 0x00 ; 0 19abc: 60 e0 ldi r22, 0x00 ; 0 if (xyzcal_dm&4) count_position[2] -= dz; else count_position[2] += dz; 19abe: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 19ac2: 90 91 bc 06 lds r25, 0x06BC ; 0x8006bc 19ac6: a0 91 bd 06 lds r26, 0x06BD ; 0x8006bd 19aca: b0 91 be 06 lds r27, 0x06BE ; 0x8006be 19ace: 22 ff sbrs r18, 2 19ad0: 2b c0 rjmp .+86 ; 0x19b28 19ad2: 84 1b sub r24, r20 19ad4: 95 0b sbc r25, r21 19ad6: a6 0b sbc r26, r22 19ad8: b7 0b sbc r27, r23 19ada: 80 93 bb 06 sts 0x06BB, r24 ; 0x8006bb 19ade: 90 93 bc 06 sts 0x06BC, r25 ; 0x8006bc 19ae2: a0 93 bd 06 sts 0x06BD, r26 ; 0x8006bd 19ae6: b0 93 be 06 sts 0x06BE, r27 ; 0x8006be // DBG(_n(" after xyzcal_update_pos x=%ld y=%ld z=%ld\n"), count_position[0], count_position[1], count_position[2]); } 19aea: ff 90 pop r15 19aec: ef 90 pop r14 19aee: df 90 pop r13 19af0: cf 90 pop r12 19af2: 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; 19af4: 8c 0d add r24, r12 19af6: 9d 1d adc r25, r13 19af8: ae 1d adc r26, r14 19afa: bf 1d adc r27, r15 19afc: 80 93 b3 06 sts 0x06B3, r24 ; 0x8006b3 19b00: 90 93 b4 06 sts 0x06B4, r25 ; 0x8006b4 19b04: a0 93 b5 06 sts 0x06B5, r26 ; 0x8006b5 19b08: b0 93 b6 06 sts 0x06B6, r27 ; 0x8006b6 19b0c: bd cf rjmp .-134 ; 0x19a88 if (xyzcal_dm&2) count_position[1] -= dy; else count_position[1] += dy; 19b0e: 8c 0d add r24, r12 19b10: 9d 1d adc r25, r13 19b12: ae 1d adc r26, r14 19b14: bf 1d adc r27, r15 19b16: 80 93 b7 06 sts 0x06B7, r24 ; 0x8006b7 19b1a: 90 93 b8 06 sts 0x06B8, r25 ; 0x8006b8 19b1e: a0 93 b9 06 sts 0x06B9, r26 ; 0x8006b9 19b22: b0 93 ba 06 sts 0x06BA, r27 ; 0x8006ba 19b26: c9 cf rjmp .-110 ; 0x19aba if (xyzcal_dm&4) count_position[2] -= dz; else count_position[2] += dz; 19b28: 84 0f add r24, r20 19b2a: 95 1f adc r25, r21 19b2c: a6 1f adc r26, r22 19b2e: b7 1f adc r27, r23 19b30: d4 cf rjmp .-88 ; 0x19ada 00019b32 : inline bool is_digit(char c) { return c >= '0' && c <= '9'; } char const * __attribute__((noinline)) Number(char const *str, uint16_t *v){ 19b32: fb 01 movw r30, r22 *v = 0; 19b34: 11 82 std Z+1, r1 ; 0x01 19b36: 10 82 st Z, r1 while(is_digit(*str)){ *v *= 10; 19b38: 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'; 19b3a: dc 01 movw r26, r24 19b3c: 2c 91 ld r18, X 19b3e: 20 53 subi r18, 0x30 ; 48 } char const * __attribute__((noinline)) Number(char const *str, uint16_t *v){ *v = 0; while(is_digit(*str)){ 19b40: 2a 30 cpi r18, 0x0A ; 10 19b42: a0 f4 brcc .+40 ; 0x19b6c *v *= 10; 19b44: 40 81 ld r20, Z 19b46: 51 81 ldd r21, Z+1 ; 0x01 19b48: 64 9f mul r22, r20 19b4a: 90 01 movw r18, r0 19b4c: 65 9f mul r22, r21 19b4e: 30 0d add r19, r0 19b50: 11 24 eor r1, r1 19b52: 31 83 std Z+1, r19 ; 0x01 19b54: 20 83 st Z, r18 *v += *str - '0'; 19b56: 4d 91 ld r20, X+ 19b58: cd 01 movw r24, r26 19b5a: 20 53 subi r18, 0x30 ; 48 19b5c: 31 09 sbc r19, r1 19b5e: 24 0f add r18, r20 19b60: 31 1d adc r19, r1 19b62: 47 fd sbrc r20, 7 19b64: 3a 95 dec r19 19b66: 31 83 std Z+1, r19 ; 0x01 19b68: 20 83 st Z, r18 19b6a: e7 cf rjmp .-50 ; 0x19b3a ++str; } return str; } 19b6c: 08 95 ret 00019b6e : } #ifdef THERMAL_MODEL void lcd_thermal_model_cal() { lcd_commands_type = LcdCommands::ThermalModel; 19b6e: 85 e0 ldi r24, 0x05 ; 5 19b70: 80 93 b4 0d sts 0x0DB4, r24 ; 0x800db4 lcd_return_to_status(); 19b74: 0d 94 a6 1e jmp 0x23d4c ; 0x23d4c 00019b78 : 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) { 19b78: fc 01 movw r30, r24 switch(*oCheckSetting) { 19b7a: 80 81 ld r24, Z 19b7c: 88 23 and r24, r24 19b7e: 21 f0 breq .+8 ; 0x19b88 19b80: 81 30 cpi r24, 0x01 ; 1 19b82: 29 f4 brne .+10 ; 0x19b8e case ClCheckMode::_None: *oCheckSetting = ClCheckMode::_Warn; break; case ClCheckMode::_Warn: *oCheckSetting = ClCheckMode::_Strict; 19b84: 82 e0 ldi r24, 0x02 ; 2 19b86: 01 c0 rjmp .+2 ; 0x19b8a while (0) static void lcd_check_update_RAM(ClCheckMode * oCheckSetting) { switch(*oCheckSetting) { case ClCheckMode::_None: *oCheckSetting = ClCheckMode::_Warn; 19b88: 81 e0 ldi r24, 0x01 ; 1 break; case ClCheckMode::_Warn: *oCheckSetting = ClCheckMode::_Strict; 19b8a: 80 83 st Z, r24 19b8c: 08 95 ret break; case ClCheckMode::_Strict: *oCheckSetting = ClCheckMode::_None; 19b8e: 10 82 st Z, r1 break; default: *oCheckSetting = ClCheckMode::_None; } } 19b90: 08 95 ret 00019b92 : } //! @brief Send host action "start" void lcd_send_action_start() { SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_START); 19b92: 88 ec ldi r24, 0xC8 ; 200 19b94: 9b e6 ldi r25, 0x6B ; 107 19b96: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 lcd_return_to_status(); 19b9a: 0d 94 a6 1e jmp 0x23d4c ; 0x23d4c 00019b9e : //! 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) { 19b9e: 80 91 b8 0d lds r24, 0x0DB8 ; 0x800db8 <_ZL13printer_state.lto_priv.401> 19ba2: 81 30 cpi r24, 0x01 ; 1 19ba4: 21 f4 brne .+8 ; 0x19bae SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_NOT_READY); 19ba6: 87 e2 ldi r24, 0x27 ; 39 19ba8: 9b e6 ldi r25, 0x6B ; 107 } else { SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_READY); 19baa: 0c 94 7b 79 jmp 0xf2f6 ; 0xf2f6 19bae: 88 e1 ldi r24, 0x18 ; 24 19bb0: 9b e6 ldi r25, 0x6B ; 107 19bb2: fb cf rjmp .-10 ; 0x19baa 00019bb4 : planner_synchronize(); Disable_E0(); } void MMU2::execute_load_to_nozzle_sequence() { 19bb4: cf 93 push r28 19bb6: df 93 push r29 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 19bb8: 0f 94 e8 42 call 0x285d0 ; 0x285d0 float planner_get_current_position_E() { return current_position[E_AXIS]; } void planner_set_current_position_E(float e) { current_position[E_AXIS] = e; 19bbc: c2 e9 ldi r28, 0x92 ; 146 19bbe: 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)); 19bc0: 60 91 97 13 lds r22, 0x1397 ; 0x801397 19bc4: 70 e0 ldi r23, 0x00 ; 0 19bc6: 90 e0 ldi r25, 0x00 ; 0 19bc8: 80 e0 ldi r24, 0x00 ; 0 19bca: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 19bce: 20 e0 ldi r18, 0x00 ; 0 19bd0: 30 e0 ldi r19, 0x00 ; 0 19bd2: 40 e8 ldi r20, 0x80 ; 128 19bd4: 51 e4 ldi r21, 0x41 ; 65 19bd6: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 19bda: 9b 01 movw r18, r22 19bdc: ac 01 movw r20, r24 19bde: 6c 85 ldd r22, Y+12 ; 0x0c 19be0: 7d 85 ldd r23, Y+13 ; 0x0d 19be2: 8e 85 ldd r24, Y+14 ; 0x0e 19be4: 9f 85 ldd r25, Y+15 ; 0x0f 19be6: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 19bea: 6c 87 std Y+12, r22 ; 0x0c 19bec: 7d 87 std Y+13, r23 ; 0x0d 19bee: 8e 87 std Y+14, r24 ; 0x0e 19bf0: 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])); 19bf2: 62 e0 ldi r22, 0x02 ; 2 19bf4: 8d ef ldi r24, 0xFD ; 253 19bf6: 9e e8 ldi r25, 0x8E ; 142 } 19bf8: df 91 pop r29 19bfa: 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])); 19bfc: 0d 94 5b 88 jmp 0x310b6 ; 0x310b6 00019c00 : } } menu_item++; } void __attribute__((noinline)) menu_item_function_E(const Sheet &sheet, menu_func_t func) 19c00: df 92 push r13 19c02: ef 92 push r14 19c04: ff 92 push r15 19c06: 0f 93 push r16 19c08: 1f 93 push r17 19c0a: cf 93 push r28 19c0c: df 93 push r29 19c0e: cd b7 in r28, 0x3d ; 61 19c10: de b7 in r29, 0x3e ; 62 19c12: 63 97 sbiw r28, 0x13 ; 19 19c14: 0f b6 in r0, 0x3f ; 63 19c16: f8 94 cli 19c18: de bf out 0x3e, r29 ; 62 19c1a: 0f be out 0x3f, r0 ; 63 19c1c: cd bf out 0x3d, r28 ; 61 { if (menu_item == menu_line) 19c1e: 30 91 15 05 lds r19, 0x0515 ; 0x800515 19c22: 20 91 14 05 lds r18, 0x0514 ; 0x800514 19c26: 32 13 cpse r19, r18 19c28: 73 c0 rjmp .+230 ; 0x19d10 19c2a: 7c 01 movw r14, r24 { if (lcd_draw_update) menu_draw_item_select_sheet_E(' ', sheet); 19c2c: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 19c30: 88 23 and r24, r24 19c32: 09 f4 brne .+2 ; 0x19c36 19c34: 45 c0 rjmp .+138 ; 0x19cc0 //! //! @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)); 19c36: 83 e9 ldi r24, 0x93 ; 147 19c38: 9d e4 ldi r25, 0x4D ; 77 19c3a: 0e 94 ac 72 call 0xe558 ; 0xe558 19c3e: 9f 93 push r25 19c40: 8f 93 push r24 19c42: 86 eb ldi r24, 0xB6 ; 182 19c44: 9e e8 ldi r25, 0x8E ; 142 19c46: 9f 93 push r25 19c48: 8f 93 push r24 19c4a: 8e 01 movw r16, r28 19c4c: 0f 5f subi r16, 0xFF ; 255 19c4e: 1f 4f sbci r17, 0xFF ; 255 19c50: 1f 93 push r17 19c52: 0f 93 push r16 19c54: 0f 94 33 db call 0x3b666 ; 0x3b666 19c58: d8 2e mov r13, r24 eeprom_read_block(&(buffer.c[index]), sheet_E.name, sizeof(sheet_E.name)/sizeof(sheet_E.name[0])); 19c5a: 47 e0 ldi r20, 0x07 ; 7 19c5c: 50 e0 ldi r21, 0x00 ; 0 19c5e: b7 01 movw r22, r14 19c60: 80 0f add r24, r16 19c62: 91 2f mov r25, r17 19c64: 91 1d adc r25, r1 19c66: 0f 94 0c dc call 0x3b818 ; 0x3b818 19c6a: 0f 90 pop r0 19c6c: 0f 90 pop r0 19c6e: 0f 90 pop r0 19c70: 0f 90 pop r0 19c72: 0f 90 pop r0 19c74: 0f 90 pop r0 19c76: 20 e0 ldi r18, 0x00 ; 0 19c78: 82 2f mov r24, r18 19c7a: 8d 0d add r24, r13 19c7c: 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) 19c7e: 27 30 cpi r18, 0x07 ; 7 19c80: 39 f0 breq .+14 ; 0x19c90 19c82: 2f 5f subi r18, 0xFF ; 255 { if (buffer.c[index] == '\0') break; 19c84: f8 01 movw r30, r16 19c86: e8 0f add r30, r24 19c88: f9 1f adc r31, r25 19c8a: 30 81 ld r19, Z 19c8c: 31 11 cpse r19, r1 19c8e: f4 cf rjmp .-24 ; 0x19c78 } buffer.c[index] = ']'; 19c90: f8 01 movw r30, r16 19c92: e8 0f add r30, r24 19c94: f9 1f adc r31, r25 19c96: 2d e5 ldi r18, 0x5D ; 93 19c98: 20 83 st Z, r18 buffer.c[index + 1] = '\0'; 19c9a: 8c 0f add r24, r28 19c9c: 9d 1f adc r25, r29 19c9e: fc 01 movw r30, r24 19ca0: 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()); 19ca2: 0f 94 58 d0 call 0x3a0b0 ; 0x3a0b0 19ca6: 48 2f mov r20, r24 19ca8: 60 91 12 05 lds r22, 0x0512 ; 0x800512 19cac: 80 e0 ldi r24, 0x00 ; 0 19cae: 0e 94 00 6f call 0xde00 ; 0xde00 lcd_print_pad(buffer.c, LCD_WIDTH - 2); 19cb2: 62 e1 ldi r22, 0x12 ; 18 19cb4: c8 01 movw r24, r16 19cb6: 0e 94 cf 70 call 0xe19e ; 0xe19e lcd_putc(type_char); 19cba: 80 e2 ldi r24, 0x20 ; 32 19cbc: 0e 94 cf 6e call 0xdd9e ; 0xdd9e 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)) 19cc0: 80 91 13 05 lds r24, 0x0513 ; 0x800513 19cc4: 88 23 and r24, r24 19cc6: 21 f1 breq .+72 ; 0x19d10 19cc8: 20 91 15 05 lds r18, 0x0515 ; 0x800515 19ccc: 80 91 70 06 lds r24, 0x0670 ; 0x800670 19cd0: 90 91 71 06 lds r25, 0x0671 ; 0x800671 19cd4: 28 17 cp r18, r24 19cd6: 19 06 cpc r1, r25 19cd8: d9 f4 brne .+54 ; 0x19d10 { lcd_update_enabled = 0; 19cda: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e if (func) func(); 19cde: 83 e6 ldi r24, 0x63 ; 99 19ce0: 96 e7 ldi r25, 0x76 ; 118 19ce2: 89 2b or r24, r25 19ce4: 11 f0 breq .+4 ; 0x19cea 19ce6: 0e 94 63 76 call 0xecc6 ; 0xecc6 lcd_update_enabled = 1; 19cea: 81 e0 ldi r24, 0x01 ; 1 19cec: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e menu_item_ret(); 19cf0: 0f 94 7c d0 call 0x3a0f8 ; 0x3a0f8 return; } } menu_item++; } 19cf4: 63 96 adiw r28, 0x13 ; 19 19cf6: 0f b6 in r0, 0x3f ; 63 19cf8: f8 94 cli 19cfa: de bf out 0x3e, r29 ; 62 19cfc: 0f be out 0x3f, r0 ; 63 19cfe: cd bf out 0x3d, r28 ; 61 19d00: df 91 pop r29 19d02: cf 91 pop r28 19d04: 1f 91 pop r17 19d06: 0f 91 pop r16 19d08: ff 90 pop r15 19d0a: ef 90 pop r14 19d0c: df 90 pop r13 19d0e: 08 95 ret lcd_update_enabled = 1; menu_item_ret(); return; } } menu_item++; 19d10: 80 91 15 05 lds r24, 0x0515 ; 0x800515 19d14: 8f 5f subi r24, 0xFF ; 255 19d16: 80 93 15 05 sts 0x0515, r24 ; 0x800515 19d1a: ec cf rjmp .-40 ; 0x19cf4 00019d1c : lcd_return_to_status(); } void lcd_mesh_calibration() { enquecommand_P(PSTR("M45")); 19d1c: 61 e0 ldi r22, 0x01 ; 1 19d1e: 8a eb ldi r24, 0xBA ; 186 19d20: 99 e8 ldi r25, 0x89 ; 137 19d22: 0e 94 20 88 call 0x11040 ; 0x11040 lcd_return_to_status(); 19d26: 0d 94 a6 1e jmp 0x23d4c ; 0x23d4c 00019d2a : } void lcd_mesh_calibration_z() { enquecommand_P(PSTR("M45 Z")); 19d2a: 61 e0 ldi r22, 0x01 ; 1 19d2c: 8e eb ldi r24, 0xBE ; 190 19d2e: 99 e8 ldi r25, 0x89 ; 137 19d30: 0e 94 20 88 call 0x11040 ; 0x11040 lcd_return_to_status(); 19d34: 0d 94 a6 1e jmp 0x23d4c ; 0x23d4c 00019d38 : } #endif //(LANG_MODE != 0) void lcd_mesh_bedleveling() { enquecommand_P(PSTR("G80")); 19d38: 61 e0 ldi r22, 0x01 ; 1 19d3a: 86 eb ldi r24, 0xB6 ; 182 19d3c: 99 e8 ldi r25, 0x89 ; 137 19d3e: 0e 94 20 88 call 0x11040 ; 0x11040 lcd_return_to_status(); 19d42: 0d 94 a6 1e jmp 0x23d4c ; 0x23d4c 00019d46 : MYSERIAL.begin(BAUDRATE); } #endif //HAS_SECOND_SERIAL_PORT void lcd_calibrate_pinda() { enquecommand_P(PSTR("G76")); 19d46: 61 e0 ldi r22, 0x01 ; 1 19d48: 84 ec ldi r24, 0xC4 ; 196 19d4a: 99 e8 ldi r25, 0x89 ; 137 19d4c: 0e 94 20 88 call 0x11040 ; 0x11040 lcd_return_to_status(); 19d50: 0d 94 a6 1e jmp 0x23d4c ; 0x23d4c 00019d54 : } static void nozzle_change() { #ifdef FILAMENT_SENSOR if (fsensor.isEnabled() && fsensor.getFilamentPresent()) { 19d54: 80 91 aa 17 lds r24, 0x17AA ; 0x8017aa 19d58: 88 23 and r24, r24 19d5a: 61 f0 breq .+24 ; 0x19d74 19d5c: 80 91 b7 17 lds r24, 0x17B7 ; 0x8017b7 19d60: 88 23 and r24, r24 19d62: 41 f0 breq .+16 ; 0x19d74 lcd_show_fullscreen_message_and_wait_P(_T(MSG_UNLOAD_FILAMENT_REPEAT)); 19d64: 89 e1 ldi r24, 0x19 ; 25 19d66: 94 e4 ldi r25, 0x44 ; 68 19d68: 0e 94 ac 72 call 0xe558 ; 0xe558 19d6c: 0f 94 f1 1f call 0x23fe2 ; 0x23fe2 lcd_return_to_status(); return; } #endif //FILAMENT_SENSOR lcd_commands_type = LcdCommands::NozzleCNG; lcd_return_to_status(); 19d70: 0d 94 a6 1e jmp 0x23d4c ; 0x23d4c 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; 19d74: 86 e0 ldi r24, 0x06 ; 6 19d76: 80 93 b4 0d sts 0x0DB4, r24 ; 0x800db4 19d7a: fa cf rjmp .-12 ; 0x19d70 00019d7c : // When MMU is disabled P parameter is ignored enquecommand_P(PSTR("M701 P0")); } static void wizard_lay1cal_message(bool cold) { 19d7c: cf 93 push r28 19d7e: c8 2f mov r28, r24 lcd_show_fullscreen_message_and_wait_P( 19d80: 8d e1 ldi r24, 0x1D ; 29 19d82: 9e e3 ldi r25, 0x3E ; 62 19d84: 0e 94 ac 72 call 0xe558 ; 0xe558 19d88: 0f 94 f1 1f call 0x23fe2 ; 0x23fe2 _T(MSG_WIZARD_V2_CAL)); if (MMU2::mmu2.Enabled()) 19d8c: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 19d90: 81 30 cpi r24, 0x01 ; 1 19d92: 69 f4 brne .+26 ; 0x19dae { lcd_show_fullscreen_message_and_wait_P( 19d94: 84 ec ldi r24, 0xC4 ; 196 19d96: 9d e3 ldi r25, 0x3D ; 61 _T(MSG_SELECT_FIL_1ST_LAYERCAL)); } else if (cold) { lcd_show_fullscreen_message_and_wait_P( 19d98: 0e 94 ac 72 call 0xe558 ; 0xe558 19d9c: 0f 94 f1 1f call 0x23fe2 ; 0x23fe2 _T(MSG_SELECT_TEMP_MATCHES_MATERIAL)); } lcd_show_fullscreen_message_and_wait_P( 19da0: 82 ef ldi r24, 0xF2 ; 242 19da2: 9c e3 ldi r25, 0x3C ; 60 19da4: 0e 94 ac 72 call 0xe558 ; 0xe558 _T(MSG_WIZARD_V2_CAL_2)); } 19da8: 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( 19daa: 0d 94 f1 1f jmp 0x23fe2 ; 0x23fe2 if (MMU2::mmu2.Enabled()) { lcd_show_fullscreen_message_and_wait_P( _T(MSG_SELECT_FIL_1ST_LAYERCAL)); } else if (cold) 19dae: cc 23 and r28, r28 19db0: b9 f3 breq .-18 ; 0x19da0 { lcd_show_fullscreen_message_and_wait_P( 19db2: 82 e9 ldi r24, 0x92 ; 146 19db4: 9d e3 ldi r25, 0x3D ; 61 19db6: f0 cf rjmp .-32 ; 0x19d98 00019db8 : } } static void lcd_wizard_load() { if (MMU2::mmu2.Enabled()) { 19db8: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 19dbc: 81 30 cpi r24, 0x01 ; 1 19dbe: 71 f4 brne .+28 ; 0x19ddc lcd_show_fullscreen_message_and_wait_P( 19dc0: 89 e9 ldi r24, 0x99 ; 153 19dc2: 9c e3 ldi r25, 0x3C ; 60 19dc4: 0e 94 ac 72 call 0xe558 ; 0xe558 19dc8: 0f 94 f1 1f call 0x23fe2 ; 0x23fe2 _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; 19dcc: 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; 19dce: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 } // When MMU is disabled P parameter is ignored enquecommand_P(PSTR("M701 P0")); 19dd2: 61 e0 ldi r22, 0x01 ; 1 19dd4: 88 ec ldi r24, 0xC8 ; 200 19dd6: 99 e8 ldi r25, 0x89 ; 137 19dd8: 0c 94 20 88 jmp 0x11040 ; 0x11040 // 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( 19ddc: 8d e4 ldi r24, 0x4D ; 77 19dde: 9c e3 ldi r25, 0x3C ; 60 19de0: 0e 94 ac 72 call 0xe558 ; 0xe558 19de4: 0f 94 f1 1f call 0x23fe2 ; 0x23fe2 _T(MSG_WIZARD_LOAD_FILAMENT)); lcd_update_enable(false); 19de8: 80 e0 ldi r24, 0x00 ; 0 19dea: 0e 94 25 6f call 0xde4a ; 0xde4a lcd_clear(); 19dee: 0e 94 13 6f call 0xde26 ; 0xde26 lcd_puts_at_P(0, 2, _T(MSG_LOADING_FILAMENT)); 19df2: 87 e3 ldi r24, 0x37 ; 55 19df4: 9c e5 ldi r25, 0x5C ; 92 19df6: 0e 94 ac 72 call 0xe558 ; 0xe558 19dfa: ac 01 movw r20, r24 19dfc: 62 e0 ldi r22, 0x02 ; 2 19dfe: 80 e0 ldi r24, 0x00 ; 0 19e00: 0e 94 f4 6e call 0xdde8 ; 0xdde8 eFilamentAction = FilamentAction::Load; 19e04: 81 e0 ldi r24, 0x01 ; 1 19e06: e3 cf rjmp .-58 ; 0x19dce 00019e08 : #endif // TMC2130 #ifdef FILAMENT_SENSOR static void fsensor_reinit() { fsensor.init(); 19e08: 0d 94 39 7b jmp 0x2f672 ; 0x2f672 00019e0c : bool __attribute__((noinline)) Tag(const char *str, const char *tag_P, uint8_t tagSize, uint16_t tagMask, uint16_t *v){ 19e0c: cf 92 push r12 19e0e: df 92 push r13 19e10: ef 92 push r14 19e12: ff 92 push r15 19e14: 0f 93 push r16 19e16: 1f 93 push r17 19e18: cf 93 push r28 19e1a: df 93 push r29 19e1c: 6c 01 movw r12, r24 19e1e: 79 01 movw r14, r18 if( ! strncmp_P(str, tag_P, tagSize) ){ 19e20: c4 2f mov r28, r20 19e22: d0 e0 ldi r29, 0x00 ; 0 19e24: ae 01 movw r20, r28 19e26: 0f 94 fb d9 call 0x3b3f6 ; 0x3b3f6 19e2a: 89 2b or r24, r25 19e2c: b9 f4 brne .+46 ; 0x19e5c Number(str + tagSize, v); 19e2e: b8 01 movw r22, r16 19e30: c6 01 movw r24, r12 19e32: 8c 0f add r24, r28 19e34: 9d 1f adc r25, r29 19e36: 0e 94 99 cd call 0x19b32 ; 0x19b32 *v |= tagMask; 19e3a: f8 01 movw r30, r16 19e3c: 20 81 ld r18, Z 19e3e: 31 81 ldd r19, Z+1 ; 0x01 19e40: 2e 29 or r18, r14 19e42: 3f 29 or r19, r15 19e44: 31 83 std Z+1, r19 ; 0x01 19e46: 20 83 st Z, r18 return true; 19e48: 81 e0 ldi r24, 0x01 ; 1 } return false; } 19e4a: df 91 pop r29 19e4c: cf 91 pop r28 19e4e: 1f 91 pop r17 19e50: 0f 91 pop r16 19e52: ff 90 pop r15 19e54: ef 90 pop r14 19e56: df 90 pop r13 19e58: cf 90 pop r12 19e5a: 08 95 ret if( ! strncmp_P(str, tag_P, tagSize) ){ Number(str + tagSize, v); *v |= tagMask; return true; } return false; 19e5c: 80 e0 ldi r24, 0x00 ; 0 19e5e: f5 cf rjmp .-22 ; 0x19e4a 00019e60 : } #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); 19e60: 87 ea ldi r24, 0xA7 ; 167 19e62: 9c e0 ldi r25, 0x0C ; 12 19e64: 0f 94 1c dc call 0x3b838 ; 0x3b838 if (value > 1) value = 1; 19e68: 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) 19e6a: 82 30 cpi r24, 0x02 ; 2 19e6c: 08 f4 brcc .+2 ; 0x19e70 19e6e: 68 27 eor r22, r24 19e70: 87 ea ldi r24, 0xA7 ; 167 19e72: 9c e0 ldi r25, 0x0C ; 12 19e74: 0d 94 40 dc jmp 0x3b880 ; 0x3b880 00019e78 : bool FarmOrUserECool(){ return farm_mode || UserECoolEnabled(); } #ifdef PRUSA_SN_SUPPORT void WorkaroundPrusaSN() { 19e78: cf 93 push r28 19e7a: df 93 push r29 19e7c: c5 e1 ldi r28, 0x15 ; 21 19e7e: 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++)); 19e80: fe 01 movw r30, r28 19e82: e6 57 subi r30, 0x76 ; 118 19e84: f2 48 sbci r31, 0x82 ; 130 19e86: 64 91 lpm r22, Z 19e88: ce 01 movw r24, r28 19e8a: 0f 94 40 dc call 0x3b880 ; 0x3b880 19e8e: 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++) { 19e90: c9 32 cpi r28, 0x29 ; 41 19e92: 8d e0 ldi r24, 0x0D ; 13 19e94: d8 07 cpc r29, r24 19e96: a1 f7 brne .-24 ; 0x19e80 eeprom_update_byte_notify((uint8_t*)EEPROM_PRUSA_SN + i, pgm_read_byte(SN++)); } } 19e98: df 91 pop r29 19e9a: cf 91 pop r28 19e9c: 08 95 ret 00019e9e : 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); 19e9e: 8a ea ldi r24, 0xAA ; 170 19ea0: 9d e0 ldi r25, 0x0D ; 13 19ea2: 0f 94 1c dc call 0x3b838 ; 0x3b838 switch (mbl_z_probe_nr) { case 1: mbl_z_probe_nr = 3; break; case 3: mbl_z_probe_nr = 5; break; 19ea6: 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) { 19ea8: 83 30 cpi r24, 0x03 ; 3 19eaa: 21 f0 breq .+8 ; 0x19eb4 case 1: mbl_z_probe_nr = 3; break; case 3: mbl_z_probe_nr = 5; break; case 5: mbl_z_probe_nr = 1; break; 19eac: 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) { 19eae: 85 30 cpi r24, 0x05 ; 5 19eb0: 09 f0 breq .+2 ; 0x19eb4 case 1: mbl_z_probe_nr = 3; break; 19eb2: 63 e0 ldi r22, 0x03 ; 3 19eb4: 8a ea ldi r24, 0xAA ; 170 19eb6: 9d e0 ldi r25, 0x0D ; 13 19eb8: 0d 94 40 dc jmp 0x3b880 ; 0x3b880 00019ebc : 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); 19ebc: 8b ea ldi r24, 0xAB ; 171 19ebe: 9d e0 ldi r25, 0x0D ; 13 19ec0: 0f 94 1c dc call 0x3b838 ; 0x3b838 if(mesh_nr == 3) mesh_nr = 7; else mesh_nr = 3; 19ec4: 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; 19ec6: 83 30 cpi r24, 0x03 ; 3 19ec8: 09 f4 brne .+2 ; 0x19ecc 19eca: 67 e0 ldi r22, 0x07 ; 7 19ecc: 8b ea ldi r24, 0xAB ; 171 19ece: 9d e0 ldi r25, 0x0D ; 13 19ed0: 0d 94 40 dc jmp 0x3b880 ; 0x3b880 00019ed4 : #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); 19ed4: 8c ea ldi r24, 0xAC ; 172 19ed6: 9d e0 ldi r25, 0x0D ; 13 19ed8: 0f 94 1c dc call 0x3b838 ; 0x3b838 magnet_elimination = !magnet_elimination; 19edc: 61 e0 ldi r22, 0x01 ; 1 19ede: 81 11 cpse r24, r1 19ee0: 60 e0 ldi r22, 0x00 ; 0 19ee2: 8c ea ldi r24, 0xAC ; 172 19ee4: 9d e0 ldi r25, 0x0D ; 13 19ee6: 0d 94 40 dc jmp 0x3b880 ; 0x3b880 00019eea : 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); 19eea: 87 ee ldi r24, 0xE7 ; 231 19eec: 94 e0 ldi r25, 0x04 ; 4 19eee: 0e 94 bc cd call 0x19b78 ; 0x19b78 19ef2: 60 91 e7 04 lds r22, 0x04E7 ; 0x8004e7 19ef6: 80 e2 ldi r24, 0x20 ; 32 19ef8: 9c e0 ldi r25, 0x0C ; 12 19efa: 0d 94 40 dc jmp 0x3b880 ; 0x3b880 00019efe : 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); 19efe: 89 ee ldi r24, 0xE9 ; 233 19f00: 94 e0 ldi r25, 0x04 ; 4 19f02: 0e 94 bc cd call 0x19b78 ; 0x19b78 19f06: 60 91 e9 04 lds r22, 0x04E9 ; 0x8004e9 19f0a: 83 ea ldi r24, 0xA3 ; 163 19f0c: 9d e0 ldi r25, 0x0D ; 13 19f0e: 0d 94 40 dc jmp 0x3b880 ; 0x3b880 00019f12 : 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); 19f12: 8a ee ldi r24, 0xEA ; 234 19f14: 94 e0 ldi r25, 0x04 ; 4 19f16: 0e 94 bc cd call 0x19b78 ; 0x19b78 19f1a: 60 91 ea 04 lds r22, 0x04EA ; 0x8004ea 19f1e: 84 ea ldi r24, 0xA4 ; 164 19f20: 9d e0 ldi r25, 0x0D ; 13 19f22: 0d 94 40 dc jmp 0x3b880 ; 0x3b880 00019f26 : *oCheckSetting = ClCheckMode::_None; } } static void lcd_check_mode_set() { lcd_check_update_RAM(&oCheckMode); 19f26: 8c ee ldi r24, 0xEC ; 236 19f28: 94 e0 ldi r25, 0x04 ; 4 19f2a: 0e 94 bc cd call 0x19b78 ; 0x19b78 19f2e: 60 91 ec 04 lds r22, 0x04EC ; 0x8004ec 19f32: 88 ea ldi r24, 0xA8 ; 168 19f34: 9d e0 ldi r25, 0x0D ; 13 19f36: 0d 94 40 dc jmp 0x3b880 ; 0x3b880 00019f3a : #endif //FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125 static void lcd_fsensor_actionNA_set(void) { Filament_sensor::SensorActionOnError act = fsensor.getActionOnError(); switch(act) { 19f3a: 80 91 b2 17 lds r24, 0x17B2 ; 0x8017b2 case Filament_sensor::SensorActionOnError::_Continue: act = Filament_sensor::SensorActionOnError::_Pause; break; case Filament_sensor::SensorActionOnError::_Pause: act = Filament_sensor::SensorActionOnError::_Continue; 19f3e: 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) { 19f40: 81 11 cpse r24, r1 19f42: 01 c0 rjmp .+2 ; 0x19f46 case Filament_sensor::SensorActionOnError::_Continue: act = Filament_sensor::SensorActionOnError::_Pause; 19f44: 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; 19f46: 60 93 b2 17 sts 0x17B2, r22 ; 0x8017b2 19f4a: 87 e4 ldi r24, 0x47 ; 71 19f4c: 9d e0 ldi r25, 0x0D ; 13 19f4e: 0d 94 40 dc jmp 0x3b880 ; 0x3b880 00019f52 : static void lcd_fsensor_runout_set() { fsensor.setRunoutEnabled(!fsensor.getRunoutEnabled(), true); } static void lcd_fsensor_autoload_set() { fsensor.setAutoLoadEnabled(!fsensor.getAutoLoadEnabled(), true); 19f52: ea ea ldi r30, 0xAA ; 170 19f54: f7 e1 ldi r31, 0x17 ; 23 19f56: 61 81 ldd r22, Z+1 ; 0x01 19f58: 81 e0 ldi r24, 0x01 ; 1 19f5a: 68 27 eor r22, r24 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 19f5c: 61 83 std Z+1, r22 ; 0x01 19f5e: 87 e0 ldi r24, 0x07 ; 7 19f60: 9f e0 ldi r25, 0x0F ; 15 19f62: 0d 94 40 dc jmp 0x3b880 ; 0x3b880 00019f66 : static void lcd_fsensor_enabled_set(void) { fsensor.setEnabled(!fsensor.isEnabled()); } static void lcd_fsensor_runout_set() { fsensor.setRunoutEnabled(!fsensor.getRunoutEnabled(), true); 19f66: ea ea ldi r30, 0xAA ; 170 19f68: f7 e1 ldi r31, 0x17 ; 23 19f6a: 62 81 ldd r22, Z+2 ; 0x02 19f6c: 81 e0 ldi r24, 0x01 ; 1 19f6e: 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; 19f70: 62 83 std Z+2, r22 ; 0x02 19f72: 85 ed ldi r24, 0xD5 ; 213 19f74: 9e e0 ldi r25, 0x0E ; 14 19f76: 0d 94 40 dc jmp 0x3b880 ; 0x3b880 00019f7a : lcd_return_to_status(); } void lcd_toshiba_flash_air_compatibility_toggle() { card.ToshibaFlashAir_enable(! card.ToshibaFlashAir_isEnabled()); 19f7a: e1 e0 ldi r30, 0x01 ; 1 19f7c: f7 e1 ldi r31, 0x17 ; 23 19f7e: 60 81 ld r22, Z 19f80: 81 e0 ldi r24, 0x01 ; 1 19f82: 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; } 19f84: 60 83 st Z, r22 19f86: 8b eb ldi r24, 0xBB ; 187 19f88: 9f e0 ldi r25, 0x0F ; 15 19f8a: 0d 94 40 dc jmp 0x3b880 ; 0x3b880 00019f8e : 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; 19f8e: 80 91 39 05 lds r24, 0x0539 ; 0x800539 19f92: 81 30 cpi r24, 0x01 ; 1 19f94: 51 f4 brne .+20 ; 0x19faa 19f96: 10 92 39 05 sts 0x0539, r1 ; 0x800539 19f9a: 60 91 39 05 lds r22, 0x0539 ; 0x800539 19f9e: 88 e0 ldi r24, 0x08 ; 8 19fa0: 9f e0 ldi r25, 0x0F ; 15 19fa2: 0f 94 40 dc call 0x3b880 ; 0x3b880 else selectedSerialPort = 1; eeprom_update_byte_notify((unsigned char *)EEPROM_SECOND_SERIAL_ACTIVE, selectedSerialPort); MYSERIAL.begin(BAUDRATE); 19fa6: 0c 94 85 cc jmp 0x1990a ; 0x1990a } #ifdef HAS_SECOND_SERIAL_PORT void lcd_second_serial_set() { if(selectedSerialPort == 1) selectedSerialPort = 0; else selectedSerialPort = 1; 19faa: 81 e0 ldi r24, 0x01 ; 1 19fac: 80 93 39 05 sts 0x0539, r24 ; 0x800539 19fb0: f4 cf rjmp .-24 ; 0x19f9a 00019fb2 : 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); 19fb2: 8f ea ldi r24, 0xAF ; 175 19fb4: 9f e0 ldi r25, 0x0F ; 15 19fb6: 0f 94 1c dc call 0x3b838 ; 0x3b838 temp_cal_active = !temp_cal_active; 19fba: 61 e0 ldi r22, 0x01 ; 1 19fbc: 81 11 cpse r24, r1 19fbe: 60 e0 ldi r22, 0x00 ; 0 19fc0: 8f ea ldi r24, 0xAF ; 175 19fc2: 9f e0 ldi r25, 0x0F ; 15 19fc4: 0d 94 40 dc jmp 0x3b880 ; 0x3b880 00019fc8 : eeprom_update_byte_notify((uint8_t*)EEPROM_SOUND_MODE,(uint8_t)eSoundMode); } void Sound_CycleState(void) { switch(eSoundMode) 19fc8: 80 91 de 04 lds r24, 0x04DE ; 0x8004de 19fcc: 81 30 cpi r24, 0x01 ; 1 19fce: 71 f0 breq .+28 ; 0x19fec 19fd0: 20 f0 brcs .+8 ; 0x19fda 19fd2: 82 30 cpi r24, 0x02 ; 2 19fd4: 69 f4 brne .+26 ; 0x19ff0 break; case e_SOUND_MODE_ONCE: eSoundMode=e_SOUND_MODE_SILENT; break; case e_SOUND_MODE_SILENT: eSoundMode=e_SOUND_MODE_BLIND; 19fd6: 83 e0 ldi r24, 0x03 ; 3 19fd8: 01 c0 rjmp .+2 ; 0x19fdc void Sound_CycleState(void) { switch(eSoundMode) { case e_SOUND_MODE_LOUD: eSoundMode=e_SOUND_MODE_ONCE; 19fda: 81 e0 ldi r24, 0x01 ; 1 break; case e_SOUND_MODE_ONCE: eSoundMode=e_SOUND_MODE_SILENT; 19fdc: 80 93 de 04 sts 0x04DE, r24 ; 0x8004de 19fe0: 60 91 de 04 lds r22, 0x04DE ; 0x8004de 19fe4: 87 ed ldi r24, 0xD7 ; 215 19fe6: 9e e0 ldi r25, 0x0E ; 14 19fe8: 0d 94 40 dc jmp 0x3b880 ; 0x3b880 19fec: 82 e0 ldi r24, 0x02 ; 2 19fee: f6 cf rjmp .-20 ; 0x19fdc break; case e_SOUND_MODE_SILENT: eSoundMode=e_SOUND_MODE_BLIND; break; case e_SOUND_MODE_BLIND: eSoundMode=e_SOUND_MODE_LOUD; 19ff0: 10 92 de 04 sts 0x04DE, r1 ; 0x8004de 19ff4: f5 cf rjmp .-22 ; 0x19fe0 00019ff6 : } #ifdef SDCARD_SORT_ALPHA static void lcd_sort_type_set() { uint8_t sdSort; sdSort = eeprom_read_byte((uint8_t*) EEPROM_SD_SORT); 19ff6: 89 e0 ldi r24, 0x09 ; 9 19ff8: 9f e0 ldi r25, 0x0F ; 15 19ffa: 0f 94 1c dc call 0x3b838 ; 0x3b838 switch (sdSort) { case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; 19ffe: 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) { 1a000: 88 23 and r24, r24 1a002: 21 f0 breq .+8 ; 0x1a00c case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; case SD_SORT_ALPHA: sdSort = SD_SORT_NONE; break; 1a004: 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) { 1a006: 81 30 cpi r24, 0x01 ; 1 1a008: 09 f0 breq .+2 ; 0x1a00c case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; case SD_SORT_ALPHA: sdSort = SD_SORT_NONE; break; default: sdSort = SD_SORT_TIME; 1a00a: 60 e0 ldi r22, 0x00 ; 0 1a00c: 89 e0 ldi r24, 0x09 ; 9 1a00e: 9f e0 ldi r25, 0x0F ; 15 1a010: 0f 94 40 dc call 0x3b880 ; 0x3b880 } eeprom_update_byte_notify((uint8_t*)EEPROM_SD_SORT, sdSort); card.presort_flag = true; 1a014: 81 e0 ldi r24, 0x01 ; 1 1a016: 80 93 df 14 sts 0x14DF, r24 ; 0x8014df } 1a01a: 08 95 ret 0001a01c : MENU_ITEM_TOGGLE_P(_T(MSG_SOUND), _T(MSG_SOUND_LOUD), lcd_sound_state_set);\ }\ }\ while (0) static void lcd_nozzle_diameter_cycle(void) { 1a01c: cf 93 push r28 1a01e: df 93 push r29 uint16_t nDiameter; switch(oNozzleDiameter){ 1a020: 80 91 eb 04 lds r24, 0x04EB ; 0x8004eb 1a024: 8c 33 cpi r24, 0x3C ; 60 1a026: e1 f0 breq .+56 ; 0x1a060 1a028: 80 35 cpi r24, 0x50 ; 80 1a02a: 01 f1 breq .+64 ; 0x1a06c 1a02c: 88 32 cpi r24, 0x28 ; 40 1a02e: 91 f0 breq .+36 ; 0x1a054 case ClNozzleDiameter::_Diameter_250: oNozzleDiameter=ClNozzleDiameter::_Diameter_400; 1a030: 88 e2 ldi r24, 0x28 ; 40 1a032: 80 93 eb 04 sts 0x04EB, r24 ; 0x8004eb nDiameter=400; 1a036: c0 e9 ldi r28, 0x90 ; 144 1a038: d1 e0 ldi r29, 0x01 ; 1 1a03a: 60 91 eb 04 lds r22, 0x04EB ; 0x8004eb 1a03e: 87 ea ldi r24, 0xA7 ; 167 1a040: 9d e0 ldi r25, 0x0D ; 13 1a042: 0f 94 40 dc call 0x3b880 ; 0x3b880 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 1a046: be 01 movw r22, r28 1a048: 85 ea ldi r24, 0xA5 ; 165 1a04a: 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); } 1a04c: df 91 pop r29 1a04e: cf 91 pop r28 1a050: 0d 94 5e dc jmp 0x3b8bc ; 0x3b8bc case ClNozzleDiameter::_Diameter_250: oNozzleDiameter=ClNozzleDiameter::_Diameter_400; nDiameter=400; break; case ClNozzleDiameter::_Diameter_400: oNozzleDiameter=ClNozzleDiameter::_Diameter_600; 1a054: 8c e3 ldi r24, 0x3C ; 60 1a056: 80 93 eb 04 sts 0x04EB, r24 ; 0x8004eb nDiameter=600; 1a05a: c8 e5 ldi r28, 0x58 ; 88 1a05c: d2 e0 ldi r29, 0x02 ; 2 1a05e: ed cf rjmp .-38 ; 0x1a03a break; case ClNozzleDiameter::_Diameter_600: oNozzleDiameter=ClNozzleDiameter::_Diameter_800; 1a060: 80 e5 ldi r24, 0x50 ; 80 1a062: 80 93 eb 04 sts 0x04EB, r24 ; 0x8004eb nDiameter=800; 1a066: c0 e2 ldi r28, 0x20 ; 32 1a068: d3 e0 ldi r29, 0x03 ; 3 1a06a: e7 cf rjmp .-50 ; 0x1a03a break; case ClNozzleDiameter::_Diameter_800: oNozzleDiameter=ClNozzleDiameter::_Diameter_250; 1a06c: 89 e1 ldi r24, 0x19 ; 25 1a06e: 80 93 eb 04 sts 0x04EB, r24 ; 0x8004eb nDiameter=250; 1a072: ca ef ldi r28, 0xFA ; 250 1a074: d0 e0 ldi r29, 0x00 ; 0 1a076: e1 cf rjmp .-62 ; 0x1a03a 0001a078 : } return 0; } bool eeprom_fw_version_older_than_p(const uint16_t (&ver_req)[4]) { 1a078: 0f 93 push r16 1a07a: 1f 93 push r17 1a07c: cf 93 push r28 1a07e: df 93 push r29 1a080: 00 d0 rcall .+0 ; 0x1a082 1a082: 00 d0 rcall .+0 ; 0x1a084 1a084: 1f 92 push r1 1a086: 1f 92 push r1 1a088: cd b7 in r28, 0x3d ; 61 1a08a: de b7 in r29, 0x3e ; 62 1a08c: 8c 01 movw r16, r24 uint16_t ver_eeprom[4]; ver_eeprom[0] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MAJOR); 1a08e: 8a e0 ldi r24, 0x0A ; 10 1a090: 90 e0 ldi r25, 0x00 ; 0 1a092: 0f 94 2a dc call 0x3b854 ; 0x3b854 1a096: 9a 83 std Y+2, r25 ; 0x02 1a098: 89 83 std Y+1, r24 ; 0x01 ver_eeprom[1] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MINOR); 1a09a: 8c e0 ldi r24, 0x0C ; 12 1a09c: 90 e0 ldi r25, 0x00 ; 0 1a09e: 0f 94 2a dc call 0x3b854 ; 0x3b854 1a0a2: 9c 83 std Y+4, r25 ; 0x04 1a0a4: 8b 83 std Y+3, r24 ; 0x03 ver_eeprom[2] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_REVISION); 1a0a6: 8e e0 ldi r24, 0x0E ; 14 1a0a8: 90 e0 ldi r25, 0x00 ; 0 1a0aa: 0f 94 2a dc call 0x3b854 ; 0x3b854 1a0ae: 9e 83 std Y+6, r25 ; 0x06 1a0b0: 8d 83 std Y+5, r24 ; 0x05 ver_eeprom[3] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_FLAVOR); 1a0b2: 80 e1 ldi r24, 0x10 ; 16 1a0b4: 90 e0 ldi r25, 0x00 ; 0 1a0b6: 0f 94 2a dc call 0x3b854 ; 0x3b854 1a0ba: 98 87 std Y+8, r25 ; 0x08 1a0bc: 8f 83 std Y+7, r24 ; 0x07 1a0be: c8 01 movw r24, r16 1a0c0: de 01 movw r26, r28 1a0c2: 11 96 adiw r26, 0x01 ; 1 1a0c4: be 01 movw r22, r28 1a0c6: 67 5f subi r22, 0xF7 ; 247 1a0c8: 7f 4f sbci r23, 0xFF ; 255 for (uint8_t i = 0; i < 4; ++i) { uint16_t v = pgm_read_word(&ver_req[i]); 1a0ca: fc 01 movw r30, r24 1a0cc: 25 91 lpm r18, Z+ 1a0ce: 34 91 lpm r19, Z if (v > ver_eeprom[i]) 1a0d0: 4d 91 ld r20, X+ 1a0d2: 5d 91 ld r21, X+ 1a0d4: 42 17 cp r20, r18 1a0d6: 53 07 cpc r21, r19 1a0d8: 48 f0 brcs .+18 ; 0x1a0ec return true; else if (v < ver_eeprom[i]) 1a0da: 24 17 cp r18, r20 1a0dc: 35 07 cpc r19, r21 1a0de: 20 f0 brcs .+8 ; 0x1a0e8 1a0e0: 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) { 1a0e2: a6 17 cp r26, r22 1a0e4: b7 07 cpc r27, r23 1a0e6: 89 f7 brne .-30 ; 0x1a0ca return true; else if (v < ver_eeprom[i]) break; } return false; 1a0e8: 80 e0 ldi r24, 0x00 ; 0 1a0ea: 01 c0 rjmp .+2 ; 0x1a0ee 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; 1a0ec: 81 e0 ldi r24, 0x01 ; 1 else if (v < ver_eeprom[i]) break; } return false; } 1a0ee: 28 96 adiw r28, 0x08 ; 8 1a0f0: 0f b6 in r0, 0x3f ; 63 1a0f2: f8 94 cli 1a0f4: de bf out 0x3e, r29 ; 62 1a0f6: 0f be out 0x3f, r0 ; 63 1a0f8: cd bf out 0x3d, r28 ; 61 1a0fa: df 91 pop r29 1a0fc: cf 91 pop r28 1a0fe: 1f 91 pop r17 1a100: 0f 91 pop r16 1a102: 08 95 ret 0001a104 : 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) { 1a104: 0f 93 push r16 1a106: 1f 93 push r17 1a108: cf 93 push r28 1a10a: df 93 push r29 1a10c: 98 2f mov r25, r24 1a10e: 86 2f mov r24, r22 1a110: 14 2f mov r17, r20 1a112: e9 01 movw r28, r18 lcd_set_cursor(_col, _row); 1a114: 69 2f mov r22, r25 1a116: 0e 94 e0 6e call 0xddc0 ; 0xddc0 switch (_state) 1a11a: 11 30 cpi r17, 0x01 ; 1 1a11c: 21 f0 breq .+8 ; 0x1a126 1a11e: 12 30 cpi r17, 0x02 ; 2 1a120: 79 f0 breq .+30 ; 0x1a140 lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); 1a122: ce 01 movw r24, r28 1a124: 15 c0 rjmp .+42 ; 0x1a150 { lcd_set_cursor(_col, _row); switch (_state) { case 1: lcd_puts_P(_name_PROGMEM); 1a126: ce 01 movw r24, r28 1a128: 0e 94 cb 6e call 0xdd96 ; 0xdd96 lcd_putc(':'); 1a12c: 8a e3 ldi r24, 0x3A ; 58 1a12e: 0e 94 cf 6e call 0xdd9e ; 0xdd9e lcd_putc(_indicator); 1a132: 80 2f mov r24, r16 lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); } } 1a134: df 91 pop r29 1a136: cf 91 pop r28 1a138: 1f 91 pop r17 1a13a: 0f 91 pop r16 switch (_state) { case 1: lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_putc(_indicator); 1a13c: 0c 94 cf 6e jmp 0xdd9e ; 0xdd9e break; case 2: lcd_puts_P(_name_PROGMEM); 1a140: ce 01 movw r24, r28 1a142: 0e 94 cb 6e call 0xdd96 ; 0xdd96 lcd_putc(':'); 1a146: 8a e3 ldi r24, 0x3A ; 58 1a148: 0e 94 cf 6e call 0xdd9e ; 0xdd9e lcd_puts_P(MSG_OK_CAPS); 1a14c: 82 e8 ldi r24, 0x82 ; 130 1a14e: 9b e6 ldi r25, 0x6B ; 107 break; default: lcd_puts_P(_name_PROGMEM); } } 1a150: df 91 pop r29 1a152: cf 91 pop r28 1a154: 1f 91 pop r17 1a156: 0f 91 pop r16 lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); 1a158: 0c 94 cb 6e jmp 0xdd96 ; 0xdd96 0001a15c : static void fsensor_reinit() { fsensor.init(); } static void lcd_fsensor_enabled_set(void) { fsensor.setEnabled(!fsensor.isEnabled()); 1a15c: 81 e0 ldi r24, 0x01 ; 1 1a15e: 90 91 aa 17 lds r25, 0x17AA ; 0x8017aa 1a162: 91 11 cpse r25, r1 1a164: 80 e0 ldi r24, 0x00 ; 0 1a166: 0c 94 cf 74 jmp 0xe99e ; 0xe99e 0001a16a : static void lcd_fsensor_autoload_set() { fsensor.setAutoLoadEnabled(!fsensor.getAutoLoadEnabled(), true); } #if FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125 static void lcd_fsensor_jam_detection_set() { 1a16a: 0f 93 push r16 1a16c: 1f 93 push r17 1a16e: cf 93 push r28 fsensor.setJamDetectionEnabled(!fsensor.getJamDetectionEnabled(), true); 1a170: 0a ea ldi r16, 0xAA ; 170 1a172: 17 e1 ldi r17, 0x17 ; 23 1a174: f8 01 movw r30, r16 1a176: c6 85 ldd r28, Z+14 ; 0x0e 1a178: 81 e0 ldi r24, 0x01 ; 1 1a17a: c8 27 eor r28, r24 return fsensorDetected; } #endif void PAT9125_sensor::setJamDetectionEnabled(bool state, bool updateEEPROM) { jamDetection = state; 1a17c: c6 87 std Z+14, r28 ; 0x0e oldPos = pat9125_y; 1a17e: 80 91 8f 0e lds r24, 0x0E8F ; 0x800e8f 1a182: 90 91 90 0e lds r25, 0x0E90 ; 0x800e90 1a186: 90 8b std Z+16, r25 ; 0x10 1a188: 87 87 std Z+15, r24 ; 0x0f resetStepCount(); 1a18a: 0f 94 ea 7a call 0x2f5d4 ; 0x2f5d4 jamErrCnt = 0; 1a18e: f8 01 movw r30, r16 1a190: 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); 1a192: 6c 2f mov r22, r28 1a194: 8d ea ldi r24, 0xAD ; 173 1a196: 9c e0 ldi r25, 0x0C ; 12 } 1a198: cf 91 pop r28 1a19a: 1f 91 pop r17 1a19c: 0f 91 pop r16 1a19e: 0d 94 40 dc jmp 0x3b880 ; 0x3b880 0001a1a2 : Sound_CycleState(); } #ifndef MMU_FORCE_STEALTH_MODE static void lcd_mmu_mode_toggle() { eeprom_toggle((uint8_t*)EEPROM_MMU_STEALTH); 1a1a2: 89 ea ldi r24, 0xA9 ; 169 1a1a4: 9d e0 ldi r25, 0x0D ; 13 1a1a6: 0c 94 34 76 jmp 0xec68 ; 0xec68 0001a1aa : 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)) { 1a1aa: 0f 93 push r16 1a1ac: 1f 93 push r17 1a1ae: cf 93 push r28 1a1b0: df 93 push r29 1a1b2: eb 01 movw r28, r22 1a1b4: 8a 01 movw r16, r20 switch(*oCheckSetting) { 1a1b6: 81 30 cpi r24, 0x01 ; 1 1a1b8: 81 f0 breq .+32 ; 0x1a1da 1a1ba: 82 30 cpi r24, 0x02 ; 2 1a1bc: 89 f0 breq .+34 ; 0x1a1e0 case ClCheckMode::_None: MENU_ITEM_TOGGLE_P(msg, _T(MSG_NONE), func); 1a1be: 83 ed ldi r24, 0xD3 ; 211 1a1c0: 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); 1a1c2: 0e 94 ac 72 call 0xe558 ; 0xe558 1a1c6: 22 e0 ldi r18, 0x02 ; 2 1a1c8: a8 01 movw r20, r16 1a1ca: bc 01 movw r22, r24 1a1cc: ce 01 movw r24, r28 break; default: MENU_ITEM_TOGGLE_P(msg, _T(MSG_NONE), func); } } 1a1ce: df 91 pop r29 1a1d0: cf 91 pop r28 1a1d2: 1f 91 pop r17 1a1d4: 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); 1a1d6: 0d 94 25 d3 jmp 0x3a64a ; 0x3a64a 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); 1a1da: 8c ec ldi r24, 0xCC ; 204 1a1dc: 99 e4 ldi r25, 0x49 ; 73 1a1de: f1 cf rjmp .-30 ; 0x1a1c2 break; case ClCheckMode::_Strict: MENU_ITEM_TOGGLE_P(msg, _T(MSG_STRICT), func); 1a1e0: 83 ec ldi r24, 0xC3 ; 195 1a1e2: 99 e4 ldi r25, 0x49 ; 73 1a1e4: ee cf rjmp .-36 ; 0x1a1c2 0001a1e6 : 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() { 1a1e6: cf 93 push r28 1a1e8: 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); 1a1ea: 80 91 38 02 lds r24, 0x0238 ; 0x800238 1a1ee: 88 23 and r24, r24 1a1f0: 89 f0 breq .+34 ; 0x1a214 1a1f2: 89 ed ldi r24, 0xD9 ; 217 1a1f4: 9c e5 ldi r25, 0x5C ; 92 1a1f6: 0e 94 ac 72 call 0xe558 ; 0xe558 1a1fa: ec 01 movw r28, r24 1a1fc: 8b ef ldi r24, 0xFB ; 251 1a1fe: 93 e4 ldi r25, 0x43 ; 67 1a200: 0e 94 ac 72 call 0xe558 ; 0xe558 1a204: 22 e0 ldi r18, 0x02 ; 2 1a206: 46 ef ldi r20, 0xF6 ; 246 1a208: 59 e3 ldi r21, 0x39 ; 57 1a20a: be 01 movw r22, r28 } 1a20c: df 91 pop r29 1a20e: 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); 1a210: 0d 94 25 d3 jmp 0x3a64a ; 0x3a64a 1a214: 83 ed ldi r24, 0xD3 ; 211 1a216: 9c e5 ldi r25, 0x5C ; 92 1a218: ee cf rjmp .-36 ; 0x1a1f6 0001a21a : eeprom_toggle((uint8_t *)EEPROM_MMU_ENABLED); MMU2::mmu2.Status(); } static void SETTINGS_SILENT_MODE() { 1a21a: cf 93 push r28 1a21c: 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); 1a21e: 8f ef ldi r24, 0xFF ; 255 1a220: 9f e0 ldi r25, 0x0F ; 15 1a222: 0f 94 1c dc call 0x3b838 ; 0x3b838 bool bDesync = tmc2130_mode ^ eeprom_mode; 1a226: 90 91 8c 06 lds r25, 0x068C ; 0x80068c if (eeprom_mode == SILENT_MODE_NORMAL) 1a22a: 81 11 cpse r24, r1 1a22c: 35 c0 rjmp .+106 ; 0x1a298 { if (bDesync) 1a22e: 99 23 and r25, r25 1a230: 11 f1 breq .+68 ; 0x1a276 { MENU_ITEM_TOGGLE_P(_T(MSG_MODE), PSTR("M915"), lcd_silent_mode_set); 1a232: 8b e0 ldi r24, 0x0B ; 11 1a234: 98 e4 ldi r25, 0x48 ; 72 1a236: 0e 94 ac 72 call 0xe558 ; 0xe558 1a23a: 22 e0 ldi r18, 0x02 ; 2 1a23c: 4a e2 ldi r20, 0x2A ; 42 1a23e: 50 ef ldi r21, 0xF0 ; 240 1a240: 67 ee ldi r22, 0xE7 ; 231 1a242: 79 e8 ldi r23, 0x89 ; 137 } else { MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_NORMAL), lcd_silent_mode_set); 1a244: 0f 94 25 d3 call 0x3a64a ; 0x3a64a } MENU_ITEM_TOGGLE_P(_T(MSG_CRASHDETECT), eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET) ? _T(MSG_ON) : _T(MSG_OFF), crash_mode_switch); 1a248: 89 e6 ldi r24, 0x69 ; 105 1a24a: 9f e0 ldi r25, 0x0F ; 15 1a24c: 0f 94 1c dc call 0x3b838 ; 0x3b838 1a250: 88 23 and r24, r24 1a252: f9 f0 breq .+62 ; 0x1a292 1a254: 89 ed ldi r24, 0xD9 ; 217 1a256: 9c e5 ldi r25, 0x5C ; 92 1a258: 0e 94 ac 72 call 0xe558 ; 0xe558 1a25c: ec 01 movw r28, r24 1a25e: 8c ed ldi r24, 0xDC ; 220 1a260: 93 e4 ldi r25, 0x43 ; 67 1a262: 0e 94 ac 72 call 0xe558 ; 0xe558 1a266: 22 e0 ldi r18, 0x02 ; 2 1a268: 4e e2 ldi r20, 0x2E ; 46 1a26a: 5f ed ldi r21, 0xDF ; 223 1a26c: 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 } } 1a26e: df 91 pop r29 1a270: 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); 1a272: 0d 94 25 d3 jmp 0x3a64a ; 0x3a64a { 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); 1a276: 88 e8 ldi r24, 0x88 ; 136 1a278: 94 e4 ldi r25, 0x44 ; 68 1a27a: 0e 94 ac 72 call 0xe558 ; 0xe558 1a27e: ec 01 movw r28, r24 1a280: 8b e0 ldi r24, 0x0B ; 11 1a282: 98 e4 ldi r25, 0x48 ; 72 1a284: 0e 94 ac 72 call 0xe558 ; 0xe558 1a288: 22 e0 ldi r18, 0x02 ; 2 1a28a: 4a e2 ldi r20, 0x2A ; 42 1a28c: 50 ef ldi r21, 0xF0 ; 240 1a28e: be 01 movw r22, r28 1a290: d9 cf rjmp .-78 ; 0x1a244 } MENU_ITEM_TOGGLE_P(_T(MSG_CRASHDETECT), eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET) ? _T(MSG_ON) : _T(MSG_OFF), crash_mode_switch); 1a292: 83 ed ldi r24, 0xD3 ; 211 1a294: 9c e5 ldi r25, 0x5C ; 92 1a296: e0 cf rjmp .-64 ; 0x1a258 } else { if (bDesync) 1a298: 98 17 cp r25, r24 1a29a: a9 f0 breq .+42 ; 0x1a2c6 { MENU_ITEM_TOGGLE_P(_T(MSG_MODE), PSTR("M914") , lcd_silent_mode_set); 1a29c: 8b e0 ldi r24, 0x0B ; 11 1a29e: 98 e4 ldi r25, 0x48 ; 72 1a2a0: 0e 94 ac 72 call 0xe558 ; 0xe558 1a2a4: 22 e0 ldi r18, 0x02 ; 2 1a2a6: 4a e2 ldi r20, 0x2A ; 42 1a2a8: 50 ef ldi r21, 0xF0 ; 240 1a2aa: 62 ee ldi r22, 0xE2 ; 226 1a2ac: 79 e8 ldi r23, 0x89 ; 137 } else { MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_STEALTH), lcd_silent_mode_set); 1a2ae: 0f 94 25 d3 call 0x3a64a ; 0x3a64a } MENU_ITEM_TOGGLE_P(_T(MSG_CRASHDETECT), NULL, lcd_crash_mode_info); 1a2b2: 8c ed ldi r24, 0xDC ; 220 1a2b4: 93 e4 ldi r25, 0x43 ; 67 1a2b6: 0e 94 ac 72 call 0xe558 ; 0xe558 1a2ba: 22 e0 ldi r18, 0x02 ; 2 1a2bc: 44 e3 ldi r20, 0x34 ; 52 1a2be: 5f ed ldi r21, 0xDF ; 223 1a2c0: 70 e0 ldi r23, 0x00 ; 0 1a2c2: 60 e0 ldi r22, 0x00 ; 0 1a2c4: d4 cf rjmp .-88 ; 0x1a26e { 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); 1a2c6: 82 ed ldi r24, 0xD2 ; 210 1a2c8: 93 e4 ldi r25, 0x43 ; 67 1a2ca: 0e 94 ac 72 call 0xe558 ; 0xe558 1a2ce: ec 01 movw r28, r24 1a2d0: 8b e0 ldi r24, 0x0B ; 11 1a2d2: 98 e4 ldi r25, 0x48 ; 72 1a2d4: 0e 94 ac 72 call 0xe558 ; 0xe558 1a2d8: 22 e0 ldi r18, 0x02 ; 2 1a2da: 4a e2 ldi r20, 0x2A ; 42 1a2dc: 50 ef ldi r21, 0xF0 ; 240 1a2de: be 01 movw r22, r28 1a2e0: e6 cf rjmp .-52 ; 0x1a2ae 0001a2e2 : } #endif //FILAMENT_SENSOR static void menuitems_MMU_settings_common() { 1a2e2: cf 93 push r28 1a2e4: df 93 push r29 } } bool SpoolJoin::isSpoolJoinEnabled() { if(eeprom_read_byte((uint8_t*)EEPROM_SPOOL_JOIN) == (uint8_t)EEPROM::Enabled) { 1a2e6: 86 ed ldi r24, 0xD6 ; 214 1a2e8: 9e e0 ldi r25, 0x0E ; 14 1a2ea: 0f 94 1c dc call 0x3b838 ; 0x3b838 1a2ee: 81 30 cpi r24, 0x01 ; 1 1a2f0: c1 f5 brne .+112 ; 0x1a362 MENU_ITEM_TOGGLE_P(MSG_SPOOL_JOIN, SpoolJoin::spooljoin.isSpoolJoinEnabled() ? _T(MSG_ON) : _T(MSG_OFF), SpoolJoin::spooljoin.toggleSpoolJoin); 1a2f2: 89 ed ldi r24, 0xD9 ; 217 1a2f4: 9c e5 ldi r25, 0x5C ; 92 1a2f6: 0e 94 ac 72 call 0xe558 ; 0xe558 1a2fa: 22 e0 ldi r18, 0x02 ; 2 1a2fc: 4a ef ldi r20, 0xFA ; 250 1a2fe: 5a e3 ldi r21, 0x3A ; 58 1a300: bc 01 movw r22, r24 1a302: 82 e9 ldi r24, 0x92 ; 146 1a304: 9a e6 ldi r25, 0x6A ; 106 1a306: 0f 94 25 d3 call 0x3a64a ; 0x3a64a #ifdef MMU_HAS_CUTTER if (EEPROM_MMU_CUTTER_ENABLED_enabled == eeprom_read_byte((uint8_t *)EEPROM_MMU_CUTTER_ENABLED)) 1a30a: 8e ec ldi r24, 0xCE ; 206 1a30c: 9e e0 ldi r25, 0x0E ; 14 1a30e: 0f 94 1c dc call 0x3b838 ; 0x3b838 1a312: 81 30 cpi r24, 0x01 ; 1 1a314: 49 f5 brne .+82 ; 0x1a368 { MENU_ITEM_TOGGLE_P(_T(MSG_CUTTER), _T(MSG_ON), lcd_cutter_enabled); 1a316: 89 ed ldi r24, 0xD9 ; 217 1a318: 9c e5 ldi r25, 0x5C ; 92 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); 1a31a: 0e 94 ac 72 call 0xe558 ; 0xe558 1a31e: ec 01 movw r28, r24 1a320: 89 ec ldi r24, 0xC9 ; 201 1a322: 93 e4 ldi r25, 0x43 ; 67 1a324: 0e 94 ac 72 call 0xe558 ; 0xe558 1a328: 22 e0 ldi r18, 0x02 ; 2 1a32a: 48 e7 ldi r20, 0x78 ; 120 1a32c: 59 e3 ldi r21, 0x39 ; 57 1a32e: be 01 movw r22, r28 1a330: 0f 94 25 d3 call 0x3a64a ; 0x3a64a } #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); 1a334: 89 ea ldi r24, 0xA9 ; 169 1a336: 9d e0 ldi r25, 0x0D ; 13 1a338: 0f 94 1c dc call 0x3b838 ; 0x3b838 1a33c: 88 23 and r24, r24 1a33e: b9 f0 breq .+46 ; 0x1a36e 1a340: 82 ed ldi r24, 0xD2 ; 210 1a342: 93 e4 ldi r25, 0x43 ; 67 1a344: 0e 94 ac 72 call 0xe558 ; 0xe558 1a348: ec 01 movw r28, r24 1a34a: 8e eb ldi r24, 0xBE ; 190 1a34c: 93 e4 ldi r25, 0x43 ; 67 1a34e: 0e 94 ac 72 call 0xe558 ; 0xe558 1a352: 22 e0 ldi r18, 0x02 ; 2 1a354: 41 ed ldi r20, 0xD1 ; 209 1a356: 50 ed ldi r21, 0xD0 ; 208 1a358: be 01 movw r22, r28 #endif // MMU_FORCE_STEALTH_MODE } 1a35a: df 91 pop r29 1a35c: 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); 1a35e: 0d 94 25 d3 jmp 0x3a64a ; 0x3a64a #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); 1a362: 83 ed ldi r24, 0xD3 ; 211 1a364: 9c e5 ldi r25, 0x5C ; 92 1a366: c7 cf rjmp .-114 ; 0x1a2f6 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); 1a368: 83 ed ldi r24, 0xD3 ; 211 1a36a: 9c e5 ldi r25, 0x5C ; 92 1a36c: d6 cf rjmp .-84 ; 0x1a31a } #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); 1a36e: 88 e8 ldi r24, 0x88 ; 136 1a370: 94 e4 ldi r25, 0x44 ; 68 1a372: e8 cf rjmp .-48 ; 0x1a344 0001a374 : 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) 1a374: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 1a378: 88 23 and r24, r24 1a37a: 21 f0 breq .+8 ; 0x1a384 1a37c: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 1a380: 88 23 and r24, r24 1a382: 51 f0 breq .+20 ; 0x1a398 { _md->status = 1; 1a384: 81 e0 ldi r24, 0x01 ; 1 1a386: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 _md->experimental_menu_visibility = eeprom_init_default_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY, 0); 1a38a: 60 e0 ldi r22, 0x00 ; 0 1a38c: 8a e2 ldi r24, 0x2A ; 42 1a38e: 9d e0 ldi r25, 0x0D ; 13 1a390: 0e 94 09 76 call 0xec12 ; 0xec12 1a394: 80 93 aa 03 sts 0x03AA, r24 ; 0x8003aa } MENU_BEGIN(); 1a398: 0f 94 96 d1 call 0x3a32c ; 0x3a32c 1a39c: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1a3a0: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a3a4: 84 30 cpi r24, 0x04 ; 4 1a3a6: 08 f0 brcs .+2 ; 0x1a3aa 1a3a8: 76 c0 rjmp .+236 ; 0x1a496 1a3aa: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(bSettings?MSG_SETTINGS:MSG_BACK)); // i.e. default menu-item / menu-item after checking mismatch 1a3ae: 80 91 fc 03 lds r24, 0x03FC ; 0x8003fc 1a3b2: 81 11 cpse r24, r1 1a3b4: 3f c0 rjmp .+126 ; 0x1a434 1a3b6: 8c eb ldi r24, 0xBC ; 188 1a3b8: 99 e4 ldi r25, 0x49 ; 73 1a3ba: 0e 94 ac 72 call 0xe558 ; 0xe558 1a3be: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 MENU_ITEM_SUBMENU_P(_T(MSG_STEEL_SHEETS), sheets_menu); 1a3c2: 8c e1 ldi r24, 0x1C ; 28 1a3c4: 96 e4 ldi r25, 0x46 ; 70 1a3c6: 0e 94 ac 72 call 0xe558 ; 0xe558 1a3ca: 66 e0 ldi r22, 0x06 ; 6 1a3cc: 72 ee ldi r23, 0xE2 ; 226 1a3ce: 0f 94 14 d4 call 0x3a828 ; 0x3a828 SETTINGS_NOZZLE; 1a3d2: 80 91 eb 04 lds r24, 0x04EB ; 0x8004eb 1a3d6: 8c 33 cpi r24, 0x3C ; 60 1a3d8: 09 f4 brne .+2 ; 0x1a3dc 1a3da: 49 c0 rjmp .+146 ; 0x1a46e 1a3dc: 70 f5 brcc .+92 ; 0x1a43a 1a3de: 89 31 cpi r24, 0x19 ; 25 1a3e0: d1 f1 breq .+116 ; 0x1a456 1a3e2: 88 32 cpi r24, 0x28 ; 40 1a3e4: 71 f1 breq .+92 ; 0x1a442 MENU_ITEM_FUNCTION_P(_T(MSG_NOZZLE_CNG_MENU),nozzle_change); 1a3e6: 8f e5 ldi r24, 0x5F ; 95 1a3e8: 94 e4 ldi r25, 0x44 ; 68 1a3ea: 0e 94 ac 72 call 0xe558 ; 0xe558 1a3ee: 6a ea ldi r22, 0xAA ; 170 1a3f0: 7e ec ldi r23, 0xCE ; 206 1a3f2: 0f 94 13 d1 call 0x3a226 ; 0x3a226 MENU_ITEM_SUBMENU_P(_T(MSG_CHECKS), lcd_checking_menu); 1a3f6: 86 e5 ldi r24, 0x56 ; 86 1a3f8: 94 e4 ldi r25, 0x44 ; 68 1a3fa: 0e 94 ac 72 call 0xe558 ; 0xe558 1a3fe: 62 e0 ldi r22, 0x02 ; 2 1a400: 74 ed ldi r23, 0xD4 ; 212 1a402: 0f 94 14 d4 call 0x3a828 ; 0x3a828 //! 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) 1a406: 80 91 aa 03 lds r24, 0x03AA ; 0x8003aa 1a40a: 88 23 and r24, r24 1a40c: 31 f0 breq .+12 ; 0x1a41a { MENU_ITEM_SUBMENU_P(PSTR("Experimental"), lcd_experimental_menu);////MSG_MENU_EXPERIMENTAL c=18 1a40e: 61 ee ldi r22, 0xE1 ; 225 1a410: 7f ee ldi r23, 0xEF ; 239 1a412: 8c ee ldi r24, 0xEC ; 236 1a414: 99 e8 ldi r25, 0x89 ; 137 1a416: 0f 94 14 d4 call 0x3a828 ; 0x3a828 //! //! 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(); 1a41a: 0f 94 6a d1 call 0x3a2d4 ; 0x3a2d4 _md->status = 1; _md->experimental_menu_visibility = eeprom_init_default_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY, 0); } MENU_BEGIN(); 1a41e: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a422: 8f 5f subi r24, 0xFF ; 255 1a424: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1a428: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1a42c: 8f 5f subi r24, 0xFF ; 255 1a42e: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1a432: b6 cf rjmp .-148 ; 0x1a3a0 MENU_ITEM_BACK_P(_T(bSettings?MSG_SETTINGS:MSG_BACK)); // i.e. default menu-item / menu-item after checking mismatch 1a434: 86 e4 ldi r24, 0x46 ; 70 1a436: 98 e4 ldi r25, 0x48 ; 72 1a438: c0 cf rjmp .-128 ; 0x1a3ba MENU_ITEM_SUBMENU_P(_T(MSG_STEEL_SHEETS), sheets_menu); SETTINGS_NOZZLE; 1a43a: 80 35 cpi r24, 0x50 ; 80 1a43c: 11 f1 breq .+68 ; 0x1a482 1a43e: 8f 3f cpi r24, 0xFF ; 255 1a440: 91 f6 brne .-92 ; 0x1a3e6 1a442: 86 ec ldi r24, 0xC6 ; 198 1a444: 96 e4 ldi r25, 0x46 ; 70 1a446: 0e 94 ac 72 call 0xe558 ; 0xe558 1a44a: 22 e0 ldi r18, 0x02 ; 2 1a44c: 4e e0 ldi r20, 0x0E ; 14 1a44e: 50 ed ldi r21, 0xD0 ; 208 1a450: 63 e0 ldi r22, 0x03 ; 3 1a452: 7a e8 ldi r23, 0x8A ; 138 1a454: 09 c0 rjmp .+18 ; 0x1a468 1a456: 86 ec ldi r24, 0xC6 ; 198 1a458: 96 e4 ldi r25, 0x46 ; 70 1a45a: 0e 94 ac 72 call 0xe558 ; 0xe558 1a45e: 22 e0 ldi r18, 0x02 ; 2 1a460: 4e e0 ldi r20, 0x0E ; 14 1a462: 50 ed ldi r21, 0xD0 ; 208 1a464: 68 e0 ldi r22, 0x08 ; 8 1a466: 7a e8 ldi r23, 0x8A ; 138 1a468: 0f 94 25 d3 call 0x3a64a ; 0x3a64a 1a46c: bc cf rjmp .-136 ; 0x1a3e6 1a46e: 86 ec ldi r24, 0xC6 ; 198 1a470: 96 e4 ldi r25, 0x46 ; 70 1a472: 0e 94 ac 72 call 0xe558 ; 0xe558 1a476: 22 e0 ldi r18, 0x02 ; 2 1a478: 4e e0 ldi r20, 0x0E ; 14 1a47a: 50 ed ldi r21, 0xD0 ; 208 1a47c: 6e ef ldi r22, 0xFE ; 254 1a47e: 79 e8 ldi r23, 0x89 ; 137 1a480: f3 cf rjmp .-26 ; 0x1a468 1a482: 86 ec ldi r24, 0xC6 ; 198 1a484: 96 e4 ldi r25, 0x46 ; 70 1a486: 0e 94 ac 72 call 0xe558 ; 0xe558 1a48a: 22 e0 ldi r18, 0x02 ; 2 1a48c: 4e e0 ldi r20, 0x0E ; 14 1a48e: 50 ed ldi r21, 0xD0 ; 208 1a490: 69 ef ldi r22, 0xF9 ; 249 1a492: 79 e8 ldi r23, 0x89 ; 137 1a494: e9 cf rjmp .-46 ; 0x1a468 //! 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(); } 1a496: 08 95 ret 0001a498 : lcd_return_to_status(); } #endif //THERMAL_MODEL void lcd_sdcard_stop() { 1a498: cf 93 push r28 // Show static message lcd_puts_at_P(0, 0, _T(MSG_STOP_PRINT)); 1a49a: 8c e5 ldi r24, 0x5C ; 92 1a49c: 98 e4 ldi r25, 0x48 ; 72 1a49e: 0e 94 ac 72 call 0xe558 ; 0xe558 1a4a2: ac 01 movw r20, r24 1a4a4: 60 e0 ldi r22, 0x00 ; 0 1a4a6: 80 e0 ldi r24, 0x00 ; 0 1a4a8: 0e 94 f4 6e call 0xdde8 ; 0xdde8 lcd_putc_at(0, 1, '\n'); 1a4ac: 4a e0 ldi r20, 0x0A ; 10 1a4ae: 61 e0 ldi r22, 0x01 ; 1 1a4b0: 80 e0 ldi r24, 0x00 ; 0 1a4b2: 0e 94 00 6f call 0xde00 ; 0xde00 MENU_BEGIN(); 1a4b6: 0f 94 96 d1 call 0x3a32c ; 0x3a32c 1a4ba: 10 92 12 05 sts 0x0512, r1 ; 0x800512 // Skip first two LCD rows used by static message if(menu_row == 0) menu_row = 2; 1a4be: 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(); 1a4c0: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a4c4: 84 30 cpi r24, 0x04 ; 4 1a4c6: 18 f5 brcc .+70 ; 0x1a50e 1a4c8: 10 92 15 05 sts 0x0515, r1 ; 0x800515 // Skip first two LCD rows used by static message if(menu_row == 0) menu_row = 2; 1a4cc: 81 11 cpse r24, r1 1a4ce: 02 c0 rjmp .+4 ; 0x1a4d4 1a4d0: c0 93 12 05 sts 0x0512, r28 ; 0x800512 // Show No options first, the default selection MENU_ITEM_FUNCTION_P(_T(MSG_NO), lcd_return_to_status); 1a4d4: 87 e5 ldi r24, 0x57 ; 87 1a4d6: 98 e4 ldi r25, 0x48 ; 72 1a4d8: 0e 94 ac 72 call 0xe558 ; 0xe558 1a4dc: 6e e5 ldi r22, 0x5E ; 94 1a4de: 79 e3 ldi r23, 0x39 ; 57 1a4e0: 0f 94 13 d1 call 0x3a226 ; 0x3a226 MENU_ITEM_FUNCTION_P(_T(MSG_YES), lcd_print_stop); 1a4e4: 81 e5 ldi r24, 0x51 ; 81 1a4e6: 98 e4 ldi r25, 0x48 ; 72 1a4e8: 0e 94 ac 72 call 0xe558 ; 0xe558 1a4ec: 6d ee ldi r22, 0xED ; 237 1a4ee: 74 ef ldi r23, 0xF4 ; 244 1a4f0: 0f 94 13 d1 call 0x3a226 ; 0x3a226 MENU_END(); 1a4f4: 0f 94 6a d1 call 0x3a2d4 ; 0x3a2d4 { // Show static message lcd_puts_at_P(0, 0, _T(MSG_STOP_PRINT)); lcd_putc_at(0, 1, '\n'); MENU_BEGIN(); 1a4f8: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a4fc: 8f 5f subi r24, 0xFF ; 255 1a4fe: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1a502: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1a506: 8f 5f subi r24, 0xFF ; 255 1a508: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1a50c: d9 cf rjmp .-78 ; 0x1a4c0 // 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(); } 1a50e: cf 91 pop r28 1a510: 08 95 ret 0001a512 : act = Filament_sensor::SensorActionOnError::_Continue; } fsensor.setActionOnError(act, true); } static void lcd_fsensor_settings_menu() { 1a512: cf 93 push r28 1a514: df 93 push r29 MENU_BEGIN(); 1a516: 0f 94 96 d1 call 0x3a32c ; 0x3a32c 1a51a: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1a51e: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a522: 84 30 cpi r24, 0x04 ; 4 1a524: 08 f0 brcs .+2 ; 0x1a528 1a526: bd c0 rjmp .+378 ; 0x1a6a2 1a528: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_BACK)); 1a52c: 8c eb ldi r24, 0xBC ; 188 1a52e: 99 e4 ldi r25, 0x49 ; 73 1a530: 0e 94 ac 72 call 0xe558 ; 0xe558 1a534: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR), fsensor.isEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_enabled_set); 1a538: 80 91 aa 17 lds r24, 0x17AA ; 0x8017aa 1a53c: 88 23 and r24, r24 1a53e: 09 f4 brne .+2 ; 0x1a542 1a540: 4e c0 rjmp .+156 ; 0x1a5de 1a542: 89 ed ldi r24, 0xD9 ; 217 1a544: 9c e5 ldi r25, 0x5C ; 92 1a546: 0e 94 ac 72 call 0xe558 ; 0xe558 1a54a: ec 01 movw r28, r24 1a54c: 87 ea ldi r24, 0xA7 ; 167 1a54e: 97 e4 ldi r25, 0x47 ; 71 1a550: 0e 94 ac 72 call 0xe558 ; 0xe558 1a554: 22 e0 ldi r18, 0x02 ; 2 1a556: 4e ea ldi r20, 0xAE ; 174 1a558: 50 ed ldi r21, 0xD0 ; 208 1a55a: be 01 movw r22, r28 1a55c: 0f 94 25 d3 call 0x3a64a ; 0x3a64a 1a560: 80 91 aa 17 lds r24, 0x17AA ; 0x8017aa if (fsensor.isEnabled()) { 1a564: 88 23 and r24, r24 1a566: 09 f4 brne .+2 ; 0x1a56a 1a568: 8c c0 rjmp .+280 ; 0x1a682 if (fsensor.isError()) { 1a56a: 83 30 cpi r24, 0x03 ; 3 1a56c: d9 f5 brne .+118 ; 0x1a5e4 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_RUNOUT), _T(MSG_NA), fsensor_reinit); 1a56e: 86 ee ldi r24, 0xE6 ; 230 1a570: 97 e4 ldi r25, 0x47 ; 71 1a572: 0e 94 ac 72 call 0xe558 ; 0xe558 1a576: ec 01 movw r28, r24 1a578: 82 eb ldi r24, 0xB2 ; 178 1a57a: 93 e4 ldi r25, 0x43 ; 67 1a57c: 0e 94 ac 72 call 0xe558 ; 0xe558 1a580: 22 e0 ldi r18, 0x02 ; 2 1a582: 44 e0 ldi r20, 0x04 ; 4 1a584: 5f ec ldi r21, 0xCF ; 207 1a586: be 01 movw r22, r28 1a588: 0f 94 25 d3 call 0x3a64a ; 0x3a64a MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), _T(MSG_NA), fsensor_reinit); 1a58c: 86 ee ldi r24, 0xE6 ; 230 1a58e: 97 e4 ldi r25, 0x47 ; 71 1a590: 0e 94 ac 72 call 0xe558 ; 0xe558 1a594: ec 01 movw r28, r24 1a596: 84 ea ldi r24, 0xA4 ; 164 1a598: 93 e4 ldi r25, 0x43 ; 67 1a59a: 0e 94 ac 72 call 0xe558 ; 0xe558 1a59e: 22 e0 ldi r18, 0x02 ; 2 1a5a0: 44 e0 ldi r20, 0x04 ; 4 1a5a2: 5f ec ldi r21, 0xCF ; 207 1a5a4: be 01 movw r22, r28 1a5a6: 0f 94 25 d3 call 0x3a64a ; 0x3a64a #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_JAM_DETECTION), _T(MSG_NA), fsensor_reinit); 1a5aa: 86 ee ldi r24, 0xE6 ; 230 1a5ac: 97 e4 ldi r25, 0x47 ; 71 1a5ae: 0e 94 ac 72 call 0xe558 ; 0xe558 1a5b2: ec 01 movw r28, r24 1a5b4: 84 e9 ldi r24, 0x94 ; 148 1a5b6: 93 e4 ldi r25, 0x43 ; 67 1a5b8: 0e 94 ac 72 call 0xe558 ; 0xe558 1a5bc: 22 e0 ldi r18, 0x02 ; 2 1a5be: 44 e0 ldi r20, 0x04 ; 4 1a5c0: 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); 1a5c2: be 01 movw r22, r28 1a5c4: 0f 94 25 d3 call 0x3a64a ; 0x3a64a #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) } switch(fsensor.getActionOnError()) { 1a5c8: 80 91 b2 17 lds r24, 0x17B2 ; 0x8017b2 1a5cc: 88 23 and r24, r24 1a5ce: 09 f4 brne .+2 ; 0x1a5d2 1a5d0: 49 c0 rjmp .+146 ; 0x1a664 1a5d2: 81 30 cpi r24, 0x01 ; 1 1a5d4: 09 f4 brne .+2 ; 0x1a5d8 1a5d6: 62 c0 rjmp .+196 ; 0x1a69c 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(); 1a5d8: 0e 94 9d cf call 0x19f3a ; 0x19f3a 1a5dc: 52 c0 rjmp .+164 ; 0x1a682 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); 1a5de: 83 ed ldi r24, 0xD3 ; 211 1a5e0: 9c e5 ldi r25, 0x5C ; 92 1a5e2: b1 cf rjmp .-158 ; 0x1a546 #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); 1a5e4: 80 91 ac 17 lds r24, 0x17AC ; 0x8017ac 1a5e8: 88 23 and r24, r24 1a5ea: 99 f1 breq .+102 ; 0x1a652 1a5ec: 89 ed ldi r24, 0xD9 ; 217 1a5ee: 9c e5 ldi r25, 0x5C ; 92 1a5f0: 0e 94 ac 72 call 0xe558 ; 0xe558 1a5f4: ec 01 movw r28, r24 1a5f6: 82 eb ldi r24, 0xB2 ; 178 1a5f8: 93 e4 ldi r25, 0x43 ; 67 1a5fa: 0e 94 ac 72 call 0xe558 ; 0xe558 1a5fe: 22 e0 ldi r18, 0x02 ; 2 1a600: 43 eb ldi r20, 0xB3 ; 179 1a602: 5f ec ldi r21, 0xCF ; 207 1a604: be 01 movw r22, r28 1a606: 0f 94 25 d3 call 0x3a64a ; 0x3a64a MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), fsensor.getAutoLoadEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_autoload_set); 1a60a: 80 91 ab 17 lds r24, 0x17AB ; 0x8017ab 1a60e: 88 23 and r24, r24 1a610: 19 f1 breq .+70 ; 0x1a658 1a612: 89 ed ldi r24, 0xD9 ; 217 1a614: 9c e5 ldi r25, 0x5C ; 92 1a616: 0e 94 ac 72 call 0xe558 ; 0xe558 1a61a: ec 01 movw r28, r24 1a61c: 84 ea ldi r24, 0xA4 ; 164 1a61e: 93 e4 ldi r25, 0x43 ; 67 1a620: 0e 94 ac 72 call 0xe558 ; 0xe558 1a624: 22 e0 ldi r18, 0x02 ; 2 1a626: 49 ea ldi r20, 0xA9 ; 169 1a628: 5f ec ldi r21, 0xCF ; 207 1a62a: be 01 movw r22, r28 1a62c: 0f 94 25 d3 call 0x3a64a ; 0x3a64a #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); 1a630: 80 91 b8 17 lds r24, 0x17B8 ; 0x8017b8 1a634: 88 23 and r24, r24 1a636: 99 f0 breq .+38 ; 0x1a65e 1a638: 89 ed ldi r24, 0xD9 ; 217 1a63a: 9c e5 ldi r25, 0x5C ; 92 1a63c: 0e 94 ac 72 call 0xe558 ; 0xe558 1a640: ec 01 movw r28, r24 1a642: 84 e9 ldi r24, 0x94 ; 148 1a644: 93 e4 ldi r25, 0x43 ; 67 1a646: 0e 94 ac 72 call 0xe558 ; 0xe558 1a64a: 22 e0 ldi r18, 0x02 ; 2 1a64c: 45 eb ldi r20, 0xB5 ; 181 1a64e: 50 ed ldi r21, 0xD0 ; 208 1a650: b8 cf rjmp .-144 ; 0x1a5c2 #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); 1a652: 83 ed ldi r24, 0xD3 ; 211 1a654: 9c e5 ldi r25, 0x5C ; 92 1a656: cc cf rjmp .-104 ; 0x1a5f0 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), fsensor.getAutoLoadEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_autoload_set); 1a658: 83 ed ldi r24, 0xD3 ; 211 1a65a: 9c e5 ldi r25, 0x5C ; 92 1a65c: dc cf rjmp .-72 ; 0x1a616 #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: 83 ed ldi r24, 0xD3 ; 211 1a660: 9c e5 ldi r25, 0x5C ; 92 1a662: ec cf rjmp .-40 ; 0x1a63c #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); 1a664: 8c e8 ldi r24, 0x8C ; 140 1a666: 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); 1a668: 0e 94 ac 72 call 0xe558 ; 0xe558 1a66c: ec 01 movw r28, r24 1a66e: 80 e8 ldi r24, 0x80 ; 128 1a670: 93 e4 ldi r25, 0x43 ; 67 1a672: 0e 94 ac 72 call 0xe558 ; 0xe558 1a676: 22 e0 ldi r18, 0x02 ; 2 1a678: 4d e9 ldi r20, 0x9D ; 157 1a67a: 5f ec ldi r21, 0xCF ; 207 1a67c: be 01 movw r22, r28 1a67e: 0f 94 25 d3 call 0x3a64a ; 0x3a64a default: lcd_fsensor_actionNA_set(); } } MENU_END(); 1a682: 0f 94 6a d1 call 0x3a2d4 ; 0x3a2d4 } fsensor.setActionOnError(act, true); } static void lcd_fsensor_settings_menu() { MENU_BEGIN(); 1a686: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a68a: 8f 5f subi r24, 0xFF ; 255 1a68c: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1a690: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1a694: 8f 5f subi r24, 0xFF ; 255 1a696: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1a69a: 41 cf rjmp .-382 ; 0x1a51e 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); 1a69c: 88 e7 ldi r24, 0x78 ; 120 1a69e: 93 e4 ldi r25, 0x43 ; 67 1a6a0: e3 cf rjmp .-58 ; 0x1a668 lcd_fsensor_actionNA_set(); } } MENU_END(); } 1a6a2: df 91 pop r29 1a6a4: cf 91 pop r28 1a6a6: 08 95 ret 0001a6a8 : lcd_first_layer_calibration_reset(); } static void lcd_sheet_menu() { MENU_BEGIN(); 1a6a8: 0f 94 96 d1 call 0x3a32c ; 0x3a32c 1a6ac: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1a6b0: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a6b4: 84 30 cpi r24, 0x04 ; 4 1a6b6: 08 f0 brcs .+2 ; 0x1a6ba 1a6b8: 3f c0 rjmp .+126 ; 0x1a738 1a6ba: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_STEEL_SHEETS)); 1a6be: 8c e1 ldi r24, 0x1C ; 28 1a6c0: 96 e4 ldi r25, 0x46 ; 70 1a6c2: 0e 94 ac 72 call 0xe558 ; 0xe558 1a6c6: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 if(eeprom_is_sheet_initialized(selected_sheet)){ 1a6ca: 80 91 e2 03 lds r24, 0x03E2 ; 0x8003e2 1a6ce: 0e 94 41 76 call 0xec82 ; 0xec82 1a6d2: 88 23 and r24, r24 1a6d4: 41 f0 breq .+16 ; 0x1a6e6 MENU_ITEM_SUBMENU_P(_T(MSG_SELECT), change_sheet); 1a6d6: 83 e1 ldi r24, 0x13 ; 19 1a6d8: 96 e4 ldi r25, 0x46 ; 70 1a6da: 0e 94 ac 72 call 0xe558 ; 0xe558 1a6de: 60 ed ldi r22, 0xD0 ; 208 1a6e0: 70 ee ldi r23, 0xE0 ; 224 1a6e2: 0f 94 14 d4 call 0x3a828 ; 0x3a828 } if (lcd_commands_type == LcdCommands::Idle) 1a6e6: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 1a6ea: 81 11 cpse r24, r1 1a6ec: 08 c0 rjmp .+16 ; 0x1a6fe { MENU_ITEM_SUBMENU_P(_T(MSG_V2_CALIBRATION), activate_calibrate_sheet); 1a6ee: 80 e0 ldi r24, 0x00 ; 0 1a6f0: 96 e4 ldi r25, 0x46 ; 70 1a6f2: 0e 94 ac 72 call 0xe558 ; 0xe558 1a6f6: 69 e6 ldi r22, 0x69 ; 105 1a6f8: 7f ee ldi r23, 0xEF ; 239 1a6fa: 0f 94 14 d4 call 0x3a828 ; 0x3a828 } MENU_ITEM_SUBMENU_P(_T(MSG_RENAME), lcd_rename_sheet_menu); 1a6fe: 87 ef ldi r24, 0xF7 ; 247 1a700: 95 e4 ldi r25, 0x45 ; 69 1a702: 0e 94 ac 72 call 0xe558 ; 0xe558 1a706: 6d e8 ldi r22, 0x8D ; 141 1a708: 7b ed ldi r23, 0xDB ; 219 1a70a: 0f 94 14 d4 call 0x3a828 ; 0x3a828 MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_reset_sheet); 1a70e: 8f ee ldi r24, 0xEF ; 239 1a710: 95 e4 ldi r25, 0x45 ; 69 1a712: 0e 94 ac 72 call 0xe558 ; 0xe558 1a716: 6b e4 ldi r22, 0x4B ; 75 1a718: 7e ee ldi r23, 0xEE ; 238 1a71a: 0f 94 13 d1 call 0x3a226 ; 0x3a226 MENU_END(); 1a71e: 0f 94 6a d1 call 0x3a2d4 ; 0x3a2d4 lcd_first_layer_calibration_reset(); } static void lcd_sheet_menu() { MENU_BEGIN(); 1a722: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a726: 8f 5f subi r24, 0xFF ; 255 1a728: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1a72c: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1a730: 8f 5f subi r24, 0xFF ; 255 1a732: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1a736: bc cf rjmp .-136 ; 0x1a6b0 } MENU_ITEM_SUBMENU_P(_T(MSG_RENAME), lcd_rename_sheet_menu); MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_reset_sheet); MENU_END(); } 1a738: 08 95 ret 0001a73a ()>: } template static void select_sheet_menu() { selected_sheet = number; 1a73a: 87 e0 ldi r24, 0x07 ; 7 1a73c: 80 93 e2 03 sts 0x03E2, r24 ; 0x8003e2 lcd_sheet_menu(); 1a740: 0c 94 54 d3 jmp 0x1a6a8 ; 0x1a6a8 0001a744 ()>: } template static void select_sheet_menu() { selected_sheet = number; 1a744: 86 e0 ldi r24, 0x06 ; 6 1a746: 80 93 e2 03 sts 0x03E2, r24 ; 0x8003e2 lcd_sheet_menu(); 1a74a: 0c 94 54 d3 jmp 0x1a6a8 ; 0x1a6a8 0001a74e ()>: } template static void select_sheet_menu() { selected_sheet = number; 1a74e: 85 e0 ldi r24, 0x05 ; 5 1a750: 80 93 e2 03 sts 0x03E2, r24 ; 0x8003e2 lcd_sheet_menu(); 1a754: 0c 94 54 d3 jmp 0x1a6a8 ; 0x1a6a8 0001a758 ()>: } template static void select_sheet_menu() { selected_sheet = number; 1a758: 84 e0 ldi r24, 0x04 ; 4 1a75a: 80 93 e2 03 sts 0x03E2, r24 ; 0x8003e2 lcd_sheet_menu(); 1a75e: 0c 94 54 d3 jmp 0x1a6a8 ; 0x1a6a8 0001a762 ()>: } template static void select_sheet_menu() { selected_sheet = number; 1a762: 83 e0 ldi r24, 0x03 ; 3 1a764: 80 93 e2 03 sts 0x03E2, r24 ; 0x8003e2 lcd_sheet_menu(); 1a768: 0c 94 54 d3 jmp 0x1a6a8 ; 0x1a6a8 0001a76c ()>: } template static void select_sheet_menu() { selected_sheet = number; 1a76c: 82 e0 ldi r24, 0x02 ; 2 1a76e: 80 93 e2 03 sts 0x03E2, r24 ; 0x8003e2 lcd_sheet_menu(); 1a772: 0c 94 54 d3 jmp 0x1a6a8 ; 0x1a6a8 0001a776 ()>: } template static void select_sheet_menu() { selected_sheet = number; 1a776: 81 e0 ldi r24, 0x01 ; 1 1a778: 80 93 e2 03 sts 0x03E2, r24 ; 0x8003e2 lcd_sheet_menu(); 1a77c: 0c 94 54 d3 jmp 0x1a6a8 ; 0x1a6a8 0001a780 ()>: } template static void select_sheet_menu() { selected_sheet = number; 1a780: 10 92 e2 03 sts 0x03E2, r1 ; 0x8003e2 lcd_sheet_menu(); 1a784: 0c 94 54 d3 jmp 0x1a6a8 ; 0x1a6a8 0001a788 : menu_back_if_clicked(); } void lcd_move_menu_axis() { MENU_BEGIN(); 1a788: 0f 94 96 d1 call 0x3a32c ; 0x3a32c 1a78c: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1a790: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a794: 84 30 cpi r24, 0x04 ; 4 1a796: a8 f5 brcc .+106 ; 0x1a802 1a798: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); 1a79c: 86 e4 ldi r24, 0x46 ; 70 1a79e: 98 e4 ldi r25, 0x48 ; 72 1a7a0: 0e 94 ac 72 call 0xe558 ; 0xe558 1a7a4: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_X), lcd_move_x); 1a7a8: 80 ea ldi r24, 0xA0 ; 160 1a7aa: 9a e3 ldi r25, 0x3A ; 58 1a7ac: 0e 94 ac 72 call 0xe558 ; 0xe558 1a7b0: 62 e8 ldi r22, 0x82 ; 130 1a7b2: 7a e3 ldi r23, 0x3A ; 58 1a7b4: 0f 94 14 d4 call 0x3a828 ; 0x3a828 MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_Y), lcd_move_y); 1a7b8: 87 e9 ldi r24, 0x97 ; 151 1a7ba: 9a e3 ldi r25, 0x3A ; 58 1a7bc: 0e 94 ac 72 call 0xe558 ; 0xe558 1a7c0: 68 e3 ldi r22, 0x38 ; 56 1a7c2: 7a e3 ldi r23, 0x3A ; 58 1a7c4: 0f 94 14 d4 call 0x3a828 ; 0x3a828 MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_Z), lcd_move_z); 1a7c8: 8e e8 ldi r24, 0x8E ; 142 1a7ca: 9a e3 ldi r25, 0x3A ; 58 1a7cc: 0e 94 ac 72 call 0xe558 ; 0xe558 1a7d0: 62 ee ldi r22, 0xE2 ; 226 1a7d2: 7a e3 ldi r23, 0x3A ; 58 1a7d4: 0f 94 14 d4 call 0x3a828 ; 0x3a828 MENU_ITEM_SUBMENU_P(_T(MSG_EXTRUDER), lcd_move_e); 1a7d8: 83 e8 ldi r24, 0x83 ; 131 1a7da: 9a e3 ldi r25, 0x3A ; 58 1a7dc: 0e 94 ac 72 call 0xe558 ; 0xe558 1a7e0: 64 ea ldi r22, 0xA4 ; 164 1a7e2: 7a e3 ldi r23, 0x3A ; 58 1a7e4: 0f 94 14 d4 call 0x3a828 ; 0x3a828 MENU_END(); 1a7e8: 0f 94 6a d1 call 0x3a2d4 ; 0x3a2d4 menu_back_if_clicked(); } void lcd_move_menu_axis() { MENU_BEGIN(); 1a7ec: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a7f0: 8f 5f subi r24, 0xFF ; 255 1a7f2: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1a7f6: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1a7fa: 8f 5f subi r24, 0xFF ; 255 1a7fc: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1a800: c7 cf rjmp .-114 ; 0x1a790 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(); } 1a802: 08 95 ret 0001a804 : } } static void lcd_checking_menu(void) { MENU_BEGIN(); 1a804: 0f 94 96 d1 call 0x3a32c ; 0x3a32c 1a808: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1a80c: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a810: 84 30 cpi r24, 0x04 ; 4 1a812: d8 f5 brcc .+118 ; 0x1a88a 1a814: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_HW_SETUP)); 1a818: 8a ec ldi r24, 0xCA ; 202 1a81a: 94 e4 ldi r25, 0x44 ; 68 1a81c: 0e 94 ac 72 call 0xe558 ; 0xe558 1a820: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 settings_check_toggle(&oCheckMode, _T(MSG_NOZZLE), lcd_check_mode_set); 1a824: 80 e1 ldi r24, 0x10 ; 16 1a826: 94 e4 ldi r25, 0x44 ; 68 1a828: 0e 94 ac 72 call 0xe558 ; 0xe558 1a82c: 43 e9 ldi r20, 0x93 ; 147 1a82e: 5f ec ldi r21, 0xCF ; 207 1a830: bc 01 movw r22, r24 1a832: 80 91 ec 04 lds r24, 0x04EC ; 0x8004ec 1a836: 0e 94 d5 d0 call 0x1a1aa ; 0x1a1aa settings_check_toggle(&oCheckModel, _T(MSG_MODEL), lcd_check_model_set); 1a83a: 88 e0 ldi r24, 0x08 ; 8 1a83c: 94 e4 ldi r25, 0x44 ; 68 1a83e: 0e 94 ac 72 call 0xe558 ; 0xe558 1a842: 49 e8 ldi r20, 0x89 ; 137 1a844: 5f ec ldi r21, 0xCF ; 207 1a846: bc 01 movw r22, r24 1a848: 80 91 ea 04 lds r24, 0x04EA ; 0x8004ea 1a84c: 0e 94 d5 d0 call 0x1a1aa ; 0x1a1aa settings_check_toggle(&oCheckVersion, MSG_FIRMWARE, lcd_check_version_set); 1a850: 4f e7 ldi r20, 0x7F ; 127 1a852: 5f ec ldi r21, 0xCF ; 207 1a854: 6c e9 ldi r22, 0x9C ; 156 1a856: 7a e6 ldi r23, 0x6A ; 106 1a858: 80 91 e9 04 lds r24, 0x04E9 ; 0x8004e9 1a85c: 0e 94 d5 d0 call 0x1a1aa ; 0x1a1aa settings_check_toggle(&oCheckFilament, MSG_FILAMENT, lcd_check_filament_set); 1a860: 45 e7 ldi r20, 0x75 ; 117 1a862: 5f ec ldi r21, 0xCF ; 207 1a864: 6e eb ldi r22, 0xBE ; 190 1a866: 7d e6 ldi r23, 0x6D ; 109 1a868: 80 91 e7 04 lds r24, 0x04E7 ; 0x8004e7 1a86c: 0e 94 d5 d0 call 0x1a1aa ; 0x1a1aa MENU_END(); 1a870: 0f 94 6a d1 call 0x3a2d4 ; 0x3a2d4 } } static void lcd_checking_menu(void) { MENU_BEGIN(); 1a874: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a878: 8f 5f subi r24, 0xFF ; 255 1a87a: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1a87e: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1a882: 8f 5f subi r24, 0xFF ; 255 1a884: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1a888: c1 cf rjmp .-126 ; 0x1a80c 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(); } 1a88a: 08 95 ret 0001a88c : value = !value; eeprom_update_byte_notify((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT, value); } void lcd_reprint_from_eeprom() { restore_file_from_sd(); 1a88c: 0e 94 db 88 call 0x111b6 ; 0x111b6 // M24: Start/resume SD print enquecommand_P(MSG_M24); 1a890: 61 e0 ldi r22, 0x01 ; 1 1a892: 80 ef ldi r24, 0xF0 ; 240 1a894: 90 e7 ldi r25, 0x70 ; 112 1a896: 0e 94 20 88 call 0x11040 ; 0x11040 lcd_return_to_status(); 1a89a: 0d 94 a6 1e jmp 0x23d4c ; 0x23d4c 0001a89e : { return lcd_status_message_level; } void menu_lcd_longpress_func(void) { 1a89e: cf 93 push r28 1a8a0: df 93 push r29 // Wake up the LCD backlight and, // start LCD inactivity timer lcd_timeoutToStatus.start(); 1a8a2: 8c ed ldi r24, 0xDC ; 220 1a8a4: 93 e0 ldi r25, 0x03 ; 3 1a8a6: 0f 94 ef 2b call 0x257de ; 0x257de ::start()> if (homing_flag || mesh_bed_leveling_flag || menu_menu == lcd_babystep_z || menu_menu == lcd_move_z || menu_is_any_block() || Stopped) 1a8aa: 80 91 a7 0d lds r24, 0x0DA7 ; 0x800da7 1a8ae: 81 11 cpse r24, r1 1a8b0: 18 c0 rjmp .+48 ; 0x1a8e2 1a8b2: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 1a8b6: 81 11 cpse r24, r1 1a8b8: 14 c0 rjmp .+40 ; 0x1a8e2 1a8ba: c0 91 13 04 lds r28, 0x0413 ; 0x800413 1a8be: d0 91 14 04 lds r29, 0x0414 ; 0x800414 1a8c2: 89 e3 ldi r24, 0x39 ; 57 1a8c4: c6 3e cpi r28, 0xE6 ; 230 1a8c6: d8 07 cpc r29, r24 1a8c8: 61 f0 breq .+24 ; 0x1a8e2 1a8ca: 8a e3 ldi r24, 0x3A ; 58 1a8cc: c2 3e cpi r28, 0xE2 ; 226 1a8ce: d8 07 cpc r29, r24 1a8d0: 41 f0 breq .+16 ; 0x1a8e2 1a8d2: 80 91 d6 03 lds r24, 0x03D6 ; 0x8003d6 1a8d6: 81 11 cpse r24, r1 1a8d8: 04 c0 rjmp .+8 ; 0x1a8e2 1a8da: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1a8de: 88 23 and r24, r24 1a8e0: 31 f0 breq .+12 ; 0x1a8ee { // disable longpress during re-entry, while homing, calibration or if a serious error lcd_draw_update = 2; 1a8e2: 82 e0 ldi r24, 0x02 ; 2 1a8e4: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 1a8e8: df 91 pop r29 1a8ea: cf 91 pop r28 1a8ec: 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) 1a8ee: 81 ed ldi r24, 0xD1 ; 209 1a8f0: ca 3b cpi r28, 0xBA ; 186 1a8f2: d8 07 cpc r29, r24 1a8f4: 49 f4 brne .+18 ; 0x1a908 { // only toggle the experimental menu visibility flag lcd_draw_update = 2; 1a8f6: 82 e0 ldi r24, 0x02 ; 2 1a8f8: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d eeprom_toggle((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY); 1a8fc: 8a e2 ldi r24, 0x2A ; 42 1a8fe: 9d e0 ldi r25, 0x0D ; 13 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 1a900: df 91 pop r29 1a902: 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); 1a904: 0c 94 34 76 jmp 0xec68 ; 0xec68 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); 1a908: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 1a90c: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 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 1a910: 98 13 cpse r25, r24 1a912: 04 c0 rjmp .+8 ; 0x1a91c 1a914: 0e 94 90 67 call 0xcf20 ; 0xcf20 1a918: 88 23 and r24, r24 1a91a: 61 f0 breq .+24 ; 0x1a934 if ( babystep_allowed_strict() 1a91c: 0e 94 cb 67 call 0xcf96 ; 0xcf96 && (menu_menu == lcd_status_screen // and in listed menus... 1a920: 81 11 cpse r24, r1 1a922: 10 c0 rjmp .+32 ; 0x1a944 Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); } void lcd_quick_feedback(void) { lcd_draw_update = 2; 1a924: 82 e0 ldi r24, 0x02 ; 2 1a926: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 1a92a: 80 e0 ldi r24, 0x00 ; 0 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 1a92c: df 91 pop r29 1a92e: cf 91 pop r28 1a930: 0d 94 07 4e jmp 0x29c0e ; 0x29c0e menu_submenu(lcd_babystep_z); } else { lcd_quick_feedback(); } } else { // long press as move-z if (menu_menu == lcd_status_screen 1a934: 89 e3 ldi r24, 0x39 ; 57 1a936: c8 31 cpi r28, 0x18 ; 24 1a938: d8 07 cpc r29, r24 1a93a: e1 f4 brne .+56 ; 0x1a974 #if (LANG_MODE != 0) || menu_menu == lcd_language #endif || menu_menu == lcd_support_menu ){ menu_submenu(lcd_move_z); 1a93c: 60 e0 ldi r22, 0x00 ; 0 1a93e: 82 ee ldi r24, 0xE2 ; 226 1a940: 9a e3 ldi r25, 0x3A ; 58 1a942: 14 c0 rjmp .+40 ; 0x1a96c // 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... 1a944: 89 e3 ldi r24, 0x39 ; 57 1a946: c8 31 cpi r28, 0x18 ; 24 1a948: d8 07 cpc r29, r24 1a94a: 59 f0 breq .+22 ; 0x1a962 || menu_menu == lcd_main_menu 1a94c: 84 ed ldi r24, 0xD4 ; 212 1a94e: c7 3d cpi r28, 0xD7 ; 215 1a950: d8 07 cpc r29, r24 1a952: 39 f0 breq .+14 ; 0x1a962 || menu_menu == lcd_tune_menu 1a954: 89 ed ldi r24, 0xD9 ; 217 1a956: cb 38 cpi r28, 0x8B ; 139 1a958: d8 07 cpc r29, r24 1a95a: 19 f0 breq .+6 ; 0x1a962 || menu_menu == lcd_support_menu 1a95c: c4 5f subi r28, 0xF4 ; 244 1a95e: d9 43 sbci r29, 0x39 ; 57 1a960: 09 f7 brne .-62 ; 0x1a924 ) ){ lcd_clear(); 1a962: 0e 94 13 6f call 0xde26 ; 0xde26 menu_submenu(lcd_babystep_z); 1a966: 60 e0 ldi r22, 0x00 ; 0 1a968: 86 ee ldi r24, 0xE6 ; 230 1a96a: 99 e3 ldi r25, 0x39 ; 57 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 1a96c: df 91 pop r29 1a96e: cf 91 pop r28 #if (LANG_MODE != 0) || menu_menu == lcd_language #endif || menu_menu == lcd_support_menu ){ menu_submenu(lcd_move_z); 1a970: 0d 94 03 d3 jmp 0x3a606 ; 0x3a606 } else { lcd_quick_feedback(); } } else { // long press as move-z if (menu_menu == lcd_status_screen || menu_menu == lcd_main_menu 1a974: 84 ed ldi r24, 0xD4 ; 212 1a976: c7 3d cpi r28, 0xD7 ; 215 1a978: d8 07 cpc r29, r24 1a97a: 01 f3 breq .-64 ; 0x1a93c || menu_menu == lcd_preheat_menu 1a97c: 8a e3 ldi r24, 0x3A ; 58 1a97e: c2 3d cpi r28, 0xD2 ; 210 1a980: d8 07 cpc r29, r24 1a982: e1 f2 breq .-72 ; 0x1a93c || menu_menu == lcd_sdcard_menu 1a984: 81 ef ldi r24, 0xF1 ; 241 1a986: ce 36 cpi r28, 0x6E ; 110 1a988: d8 07 cpc r29, r24 1a98a: c1 f2 breq .-80 ; 0x1a93c || menu_menu == lcd_settings_menu 1a98c: 87 ed ldi r24, 0xD7 ; 215 1a98e: c6 32 cpi r28, 0x26 ; 38 1a990: d8 07 cpc r29, r24 1a992: a1 f2 breq .-88 ; 0x1a93c || menu_menu == lcd_control_temperature_menu 1a994: 89 ed ldi r24, 0xD9 ; 217 1a996: cb 36 cpi r28, 0x6B ; 107 1a998: d8 07 cpc r29, r24 1a99a: 81 f2 breq .-96 ; 0x1a93c #if (LANG_MODE != 0) || menu_menu == lcd_language 1a99c: 8a ed ldi r24, 0xDA ; 218 1a99e: cf 34 cpi r28, 0x4F ; 79 1a9a0: d8 07 cpc r29, r24 1a9a2: 61 f2 breq .-104 ; 0x1a93c #endif || menu_menu == lcd_support_menu 1a9a4: c4 5f subi r28, 0xF4 ; 244 1a9a6: d9 43 sbci r29, 0x39 ; 57 1a9a8: 09 f0 breq .+2 ; 0x1a9ac 1a9aa: bc cf rjmp .-136 ; 0x1a924 1a9ac: c7 cf rjmp .-114 ; 0x1a93c 0001a9ae : //! | Fail stats | allways //! | Fail stats MMU | mmu //! | Support | allways //! @endcode static void lcd_main_menu() { 1a9ae: 1f 93 push r17 1a9b0: cf 93 push r28 1a9b2: df 93 push r29 MENU_BEGIN(); 1a9b4: 0f 94 96 d1 call 0x3a32c ; 0x3a32c 1a9b8: 10 92 12 05 sts 0x0512, r1 ; 0x800512 #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); 1a9bc: 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 1a9be: d1 e0 ldi r29, 0x01 ; 1 //! | Support | allways //! @endcode static void lcd_main_menu() { MENU_BEGIN(); 1a9c0: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a9c4: 84 30 cpi r24, 0x04 ; 4 1a9c6: 08 f0 brcs .+2 ; 0x1a9ca 1a9c8: 3d c2 rjmp .+1146 ; 0x1ae44 1a9ca: 10 92 15 05 sts 0x0515, r1 ; 0x800515 // Majkl superawesome menu MENU_ITEM_BACK_P(_T(MSG_INFO_SCREEN)); 1a9ce: 84 e6 ldi r24, 0x64 ; 100 1a9d0: 97 e4 ldi r25, 0x47 ; 71 1a9d2: 0e 94 ac 72 call 0xe558 ; 0xe558 1a9d6: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 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)) { 1a9da: 0e 94 e1 67 call 0xcfc2 ; 0xcfc2 1a9de: 81 11 cpse r24, r1 1a9e0: 19 c0 rjmp .+50 ; 0x1aa14 1a9e2: 0e 94 7b 67 call 0xcef6 ; 0xcef6 1a9e6: 81 11 cpse r24, r1 1a9e8: 15 c0 rjmp .+42 ; 0x1aa14 1a9ea: 80 91 e3 03 lds r24, 0x03E3 ; 0x8003e3 1a9ee: 81 11 cpse r24, r1 1a9f0: 11 c0 rjmp .+34 ; 0x1aa14 #include "printer_state.h" static PrinterState printer_state; PrinterState GetPrinterState() { return printer_state; 1a9f2: 80 91 b8 0d lds r24, 0x0DB8 ; 0x800db8 <_ZL13printer_state.lto_priv.401> if ((GetPrinterState() == PrinterState::SDPrintingFinished) && card.mounted) { 1a9f6: 83 30 cpi r24, 0x03 ; 3 1a9f8: 09 f0 breq .+2 ; 0x1a9fc 1a9fa: 51 c0 rjmp .+162 ; 0x1aa9e 1a9fc: 80 91 91 14 lds r24, 0x1491 ; 0x801491 1aa00: 88 23 and r24, r24 1aa02: 41 f0 breq .+16 ; 0x1aa14 MENU_ITEM_FUNCTION_P(_T(MSG_REPRINT), lcd_reprint_from_eeprom); 1aa04: 8a e5 ldi r24, 0x5A ; 90 1aa06: 97 e4 ldi r25, 0x47 ; 71 1aa08: 0e 94 ac 72 call 0xe558 ; 0xe558 1aa0c: 66 e4 ldi r22, 0x46 ; 70 1aa0e: 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); 1aa10: 0f 94 13 d1 call 0x3a226 ; 0x3a226 } } // Menu is never shown when idle if (babystep_allowed_strict() && (printJobOngoing() || lcd_commands_type == LcdCommands::Layer1Cal)) 1aa14: 0e 94 cb 67 call 0xcf96 ; 0xcf96 1aa18: 88 23 and r24, r24 1aa1a: 81 f0 breq .+32 ; 0x1aa3c 1aa1c: 0e 94 90 67 call 0xcf20 ; 0xcf20 1aa20: 81 11 cpse r24, r1 1aa22: 04 c0 rjmp .+8 ; 0x1aa2c 1aa24: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 1aa28: 84 30 cpi r24, 0x04 ; 4 1aa2a: 41 f4 brne .+16 ; 0x1aa3c MENU_ITEM_SUBMENU_P(_T(MSG_BABYSTEP_Z), lcd_babystep_z);//8 1aa2c: 8a e4 ldi r24, 0x4A ; 74 1aa2e: 97 e4 ldi r25, 0x47 ; 71 1aa30: 0e 94 ac 72 call 0xe558 ; 0xe558 1aa34: 66 ee ldi r22, 0xE6 ; 230 1aa36: 79 e3 ldi r23, 0x39 ; 57 1aa38: 0f 94 14 d4 call 0x3a828 ; 0x3a828 if (farm_mode) MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);//8 if (!printer_recovering()) { 1aa3c: 0e 94 7b 67 call 0xcef6 ; 0xcef6 1aa40: 81 11 cpse r24, r1 1aa42: 61 c0 rjmp .+194 ; 0x1ab06 } //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); 1aa44: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 1aa48: 90 91 a6 0d lds r25, 0x0DA6 ; 0x800da6 1aa4c: 89 1b sub r24, r25 1aa4e: 8f 70 andi r24, 0x0F ; 15 if ( moves_planned() || printer_active() #ifdef FANCHECK || fan_check_error == EFCE_REPORTED 1aa50: a9 f5 brne .+106 ; 0x1aabc if (farm_mode) MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);//8 if (!printer_recovering()) { if ( moves_planned() || printer_active() 1aa52: 0e 94 e1 67 call 0xcfc2 ; 0xcfc2 1aa56: 81 11 cpse r24, r1 1aa58: 31 c0 rjmp .+98 ; 0x1aabc #ifdef FANCHECK || fan_check_error == EFCE_REPORTED 1aa5a: 80 91 e6 03 lds r24, 0x03E6 ; 0x8003e6 1aa5e: 82 30 cpi r24, 0x02 ; 2 1aa60: 69 f1 breq .+90 ; 0x1aabc #endif //End FANCHECK ) { MENU_ITEM_SUBMENU_P(_T(MSG_TUNE), lcd_tune_menu); } else if (!Stopped) { 1aa62: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1aa66: 81 11 cpse r24, r1 1aa68: 31 c0 rjmp .+98 ; 0x1aacc MENU_ITEM_SUBMENU_P(_T(MSG_PREHEAT), lcd_preheat_menu); 1aa6a: 89 e3 ldi r24, 0x39 ; 57 1aa6c: 97 e4 ldi r25, 0x47 ; 71 1aa6e: 0e 94 ac 72 call 0xe558 ; 0xe558 1aa72: 62 ed ldi r22, 0xD2 ; 210 1aa74: 7a e3 ldi r23, 0x3A ; 58 1aa76: 0f 94 14 d4 call 0x3a828 ; 0x3a828 if (M79_timer_get_status()) { 1aa7a: 80 91 9e 03 lds r24, 0x039E ; 0x80039e <_ZL9M79_timer.lto_priv.450> 1aa7e: 88 23 and r24, r24 1aa80: 29 f1 breq .+74 ; 0x1aacc #ifndef REPLACE_SETREADY if(GetPrinterState() == PrinterState::IsReady) { 1aa82: 80 91 b8 0d lds r24, 0x0DB8 ; 0x800db8 <_ZL13printer_state.lto_priv.401> 1aa86: 81 30 cpi r24, 0x01 ; 1 1aa88: 09 f0 breq .+2 ; 0x1aa8c 1aa8a: 7e c0 rjmp .+252 ; 0x1ab88 MENU_ITEM_FUNCTION_P(_T(MSG_SET_NOT_READY), lcd_printer_ready_state_toggle); 1aa8c: 89 e2 ldi r24, 0x29 ; 41 1aa8e: 97 e4 ldi r25, 0x47 ; 71 } else { MENU_ITEM_FUNCTION_P(_T(MSG_SET_READY), lcd_printer_ready_state_toggle); 1aa90: 0e 94 ac 72 call 0xe558 ; 0xe558 1aa94: 6f ec ldi r22, 0xCF ; 207 1aa96: 7d ec ldi r23, 0xCD ; 205 1aa98: 0f 94 13 d1 call 0x3a226 ; 0x3a226 1aa9c: 17 c0 rjmp .+46 ; 0x1aacc // 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()) { 1aa9e: 84 30 cpi r24, 0x04 ; 4 1aaa0: 09 f0 breq .+2 ; 0x1aaa4 1aaa2: b8 cf rjmp .-144 ; 0x1aa14 1aaa4: 80 91 9e 03 lds r24, 0x039E ; 0x80039e <_ZL9M79_timer.lto_priv.450> 1aaa8: 88 23 and r24, r24 1aaaa: 09 f4 brne .+2 ; 0x1aaae 1aaac: b3 cf rjmp .-154 ; 0x1aa14 MENU_ITEM_FUNCTION_P(_T(MSG_REPRINT), lcd_send_action_start); 1aaae: 8a e5 ldi r24, 0x5A ; 90 1aab0: 97 e4 ldi r25, 0x47 ; 71 1aab2: 0e 94 ac 72 call 0xe558 ; 0xe558 1aab6: 69 ec ldi r22, 0xC9 ; 201 1aab8: 7d ec ldi r23, 0xCD ; 205 1aaba: aa cf rjmp .-172 ; 0x1aa10 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); 1aabc: 83 e4 ldi r24, 0x43 ; 67 1aabe: 97 e4 ldi r25, 0x47 ; 71 1aac0: 0e 94 ac 72 call 0xe558 ; 0xe558 1aac4: 6b e8 ldi r22, 0x8B ; 139 1aac6: 79 ed ldi r23, 0xD9 ; 217 1aac8: 0f 94 14 d4 call 0x3a828 ; 0x3a828 #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) { 1aacc: c0 91 a8 0d lds r28, 0x0DA8 ; 0x800da8 1aad0: 0e 94 85 67 call 0xcf0a ; 0xcf0a 1aad4: c1 11 cpse r28, r1 1aad6: 17 c0 rjmp .+46 ; 0x1ab06 1aad8: 90 91 a7 0d lds r25, 0x0DA7 ; 0x800da7 1aadc: 91 11 cpse r25, r1 1aade: 13 c0 rjmp .+38 ; 0x1ab06 1aae0: 81 11 cpse r24, r1 1aae2: 15 c0 rjmp .+42 ; 0x1ab0e 1aae4: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 1aae8: 81 11 cpse r24, r1 1aaea: 0d c0 rjmp .+26 ; 0x1ab06 if (usb_timer.running()) { 1aaec: 80 91 0e 05 lds r24, 0x050E ; 0x80050e 1aaf0: 88 23 and r24, r24 1aaf2: 09 f4 brne .+2 ; 0x1aaf6 1aaf4: 4c c0 rjmp .+152 ; 0x1ab8e MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_usb_print); 1aaf6: 8f e0 ldi r24, 0x0F ; 15 1aaf8: 97 e4 ldi r25, 0x47 ; 71 1aafa: 0e 94 ac 72 call 0xe558 ; 0xe558 1aafe: 6a e4 ldi r22, 0x4A ; 74 1ab00: 79 e3 ldi r23, 0x39 ; 57 } else if (IS_SD_PRINTING) { MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_print); 1ab02: 0f 94 13 d1 call 0x3a226 ; 0x3a226 } } } if (printingIsPaused() 1ab06: 0e 94 85 67 call 0xcf0a ; 0xcf0a && !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) { 1ab0a: 88 23 and r24, r24 1ab0c: f1 f0 breq .+60 ; 0x1ab4a temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; 1ab0e: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> } } } if (printingIsPaused() // only allow resuming if hardware errors (temperature or fan) are cleared && !get_temp_error() 1ab12: 81 11 cpse r24, r1 1ab14: 1a c0 rjmp .+52 ; 0x1ab4a #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 1ab16: 80 91 e6 03 lds r24, 0x03E6 ; 0x8003e6 1ab1a: 82 30 cpi r24, 0x02 ; 2 1ab1c: b1 f0 breq .+44 ; 0x1ab4a #endif //FANCHECK && (saved_printing_type != PowerPanic::PRINT_TYPE_NONE || saved_printing) 1ab1e: 80 91 6a 02 lds r24, 0x026A ; 0x80026a 1ab22: 82 30 cpi r24, 0x02 ; 2 1ab24: 21 f4 brne .+8 ; 0x1ab2e 1ab26: 90 91 a9 0d lds r25, 0x0DA9 ; 0x800da9 1ab2a: 99 23 and r25, r25 1ab2c: 71 f0 breq .+28 ; 0x1ab4a && custom_message_type != CustomMsg::Resuming) { 1ab2e: 90 91 c4 06 lds r25, 0x06C4 ; 0x8006c4 1ab32: 98 30 cpi r25, 0x08 ; 8 1ab34: 51 f0 breq .+20 ; 0x1ab4a if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) { 1ab36: 81 11 cpse r24, r1 1ab38: 36 c0 rjmp .+108 ; 0x1aba6 MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_print); 1ab3a: 80 e0 ldi r24, 0x00 ; 0 1ab3c: 97 e4 ldi r25, 0x47 ; 71 1ab3e: 0e 94 ac 72 call 0xe558 ; 0xe558 1ab42: 67 e1 ldi r22, 0x17 ; 23 1ab44: 78 ef ldi r23, 0xF8 ; 248 } 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); 1ab46: 0f 94 14 d4 call 0x3a828 ; 0x3a828 } } if((printJobOngoing() || printingIsPaused() || (printer_recovering())) 1ab4a: 0e 94 90 67 call 0xcf20 ; 0xcf20 && (custom_message_type != CustomMsg::MeshBedLeveling) && !processing_tcode) { 1ab4e: 81 11 cpse r24, r1 1ab50: 08 c0 rjmp .+16 ; 0x1ab62 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())) 1ab52: 0e 94 85 67 call 0xcf0a ; 0xcf0a 1ab56: 81 11 cpse r24, r1 1ab58: 04 c0 rjmp .+8 ; 0x1ab62 1ab5a: 0e 94 7b 67 call 0xcef6 ; 0xcef6 1ab5e: 88 23 and r24, r24 1ab60: 41 f0 breq .+16 ; 0x1ab72 && (custom_message_type != CustomMsg::MeshBedLeveling) && !processing_tcode) { 1ab62: 80 91 c4 06 lds r24, 0x06C4 ; 0x8006c4 1ab66: 81 30 cpi r24, 0x01 ; 1 1ab68: 21 f0 breq .+8 ; 0x1ab72 1ab6a: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 1ab6e: 88 23 and r24, r24 1ab70: 39 f1 breq .+78 ; 0x1abc0 MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop); } #ifdef THERMAL_MODEL else if(Stopped) { 1ab72: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1ab76: 88 23 and r24, r24 1ab78: 59 f1 breq .+86 ; 0x1abd0 MENU_ITEM_SUBMENU_P(_T(MSG_TM_ACK_ERROR), lcd_print_stop); 1ab7a: 8f ee ldi r24, 0xEF ; 239 1ab7c: 96 e4 ldi r25, 0x46 ; 70 1ab7e: 0e 94 ac 72 call 0xe558 ; 0xe558 1ab82: 6d ee ldi r22, 0xED ; 237 1ab84: 74 ef ldi r23, 0xF4 ; 244 1ab86: 22 c0 rjmp .+68 ; 0x1abcc 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); 1ab88: 8d e1 ldi r24, 0x1D ; 29 1ab8a: 97 e4 ldi r25, 0x47 ; 71 1ab8c: 81 cf rjmp .-254 ; 0x1aa90 } } 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) { 1ab8e: 80 91 90 14 lds r24, 0x1490 ; 0x801490 1ab92: 88 23 and r24, r24 1ab94: 09 f4 brne .+2 ; 0x1ab98 1ab96: b7 cf rjmp .-146 ; 0x1ab06 MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_print); 1ab98: 8f e0 ldi r24, 0x0F ; 15 1ab9a: 97 e4 ldi r25, 0x47 ; 71 1ab9c: 0e 94 ac 72 call 0xe558 ; 0xe558 1aba0: 62 e9 ldi r22, 0x92 ; 146 1aba2: 79 e3 ldi r23, 0x39 ; 57 1aba4: ae cf rjmp .-164 ; 0x1ab02 #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())) { 1aba6: 81 30 cpi r24, 0x01 ; 1 1aba8: 81 f6 brne .-96 ; 0x1ab4a 1abaa: 80 91 9e 03 lds r24, 0x039E ; 0x80039e <_ZL9M79_timer.lto_priv.450> 1abae: 88 23 and r24, r24 1abb0: 61 f2 breq .-104 ; 0x1ab4a MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_usb_print); 1abb2: 80 e0 ldi r24, 0x00 ; 0 1abb4: 97 e4 ldi r25, 0x47 ; 71 1abb6: 0e 94 ac 72 call 0xe558 ; 0xe558 1abba: 66 e4 ldi r22, 0x46 ; 70 1abbc: 78 ef ldi r23, 0xF8 ; 248 1abbe: c3 cf rjmp .-122 ; 0x1ab46 } } if((printJobOngoing() || printingIsPaused() || (printer_recovering())) && (custom_message_type != CustomMsg::MeshBedLeveling) && !processing_tcode) { MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop); 1abc0: 8c e5 ldi r24, 0x5C ; 92 1abc2: 98 e4 ldi r25, 0x48 ; 72 1abc4: 0e 94 ac 72 call 0xe558 ; 0xe558 1abc8: 6c e4 ldi r22, 0x4C ; 76 1abca: 72 ed ldi r23, 0xD2 ; 210 } #ifdef THERMAL_MODEL else if(Stopped) { MENU_ITEM_SUBMENU_P(_T(MSG_TM_ACK_ERROR), lcd_print_stop); 1abcc: 0f 94 14 d4 call 0x3a828 ; 0x3a828 } #endif // only allow starting SD print if hardware errors (temperature or fan) are cleared if (!printer_recovering() && !printer_active() && !get_temp_error() 1abd0: 0e 94 7b 67 call 0xcef6 ; 0xcef6 #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 1abd4: 81 11 cpse r24, r1 1abd6: 9e c0 rjmp .+316 ; 0x1ad14 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() 1abd8: 0e 94 e1 67 call 0xcfc2 ; 0xcfc2 1abdc: 81 11 cpse r24, r1 1abde: 9a c0 rjmp .+308 ; 0x1ad14 1abe0: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 1abe4: 81 11 cpse r24, r1 1abe6: 96 c0 rjmp .+300 ; 0x1ad14 #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 1abe8: 80 91 e6 03 lds r24, 0x03E6 ; 0x8003e6 1abec: 82 30 cpi r24, 0x02 ; 2 1abee: 09 f4 brne .+2 ; 0x1abf2 1abf0: 91 c0 rjmp .+290 ; 0x1ad14 #endif //FANCHECK ) { #ifdef SDSUPPORT //!@todo SDSUPPORT undefined creates several issues in source code if (card.mounted 1abf2: 80 91 91 14 lds r24, 0x1491 ; 0x801491 1abf6: 81 11 cpse r24, r1 1abf8: 05 c0 rjmp .+10 ; 0x1ac04 || lcd_commands_type != LcdCommands::Idle) { 1abfa: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 1abfe: 88 23 and r24, r24 1ac00: 09 f4 brne .+2 ; 0x1ac04 1ac02: b9 c0 rjmp .+370 ; 0x1ad76 if (!card.isFileOpen()) { 1ac04: 80 91 23 17 lds r24, 0x1723 ; 0x801723 1ac08: 81 11 cpse r24, r1 1ac0a: 12 c0 rjmp .+36 ; 0x1ac30 if (!usb_timer.running() && (lcd_commands_type == LcdCommands::Idle)) { 1ac0c: 80 91 0e 05 lds r24, 0x050E ; 0x80050e 1ac10: 81 11 cpse r24, r1 1ac12: 0e c0 rjmp .+28 ; 0x1ac30 1ac14: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 1ac18: 81 11 cpse r24, r1 1ac1a: 0a c0 rjmp .+20 ; 0x1ac30 bMain=true; // flag ('fake parameter') for 'lcd_sdcard_menu()' function 1ac1c: d0 93 e1 03 sts 0x03E1, r29 ; 0x8003e1 MENU_ITEM_SUBMENU_P(_T(MSG_CARD_MENU), lcd_sdcard_menu); 1ac20: 8f ed ldi r24, 0xDF ; 223 1ac22: 96 e4 ldi r25, 0x46 ; 70 1ac24: 0e 94 ac 72 call 0xe558 ; 0xe558 1ac28: 6e e6 ldi r22, 0x6E ; 110 1ac2a: 71 ef ldi r23, 0xF1 ; 241 1ac2c: 0f 94 14 d4 call 0x3a828 ; 0x3a828 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)); 1ac30: 81 ea ldi r24, 0xA1 ; 161 1ac32: 9d e0 ldi r25, 0x0D ; 13 1ac34: 0f 94 1c dc call 0x3b838 ; 0x3b838 1ac38: c8 2f mov r28, r24 const int8_t nextSheet = eeprom_next_initialized_sheet(sheet); 1ac3a: 0e 94 4f 76 call 0xec9e ; 0xec9e if ((nextSheet >= 0) && (sheet != nextSheet)) { // show menu only if we have 2 or more sheets initialized 1ac3e: 87 fd sbrc r24, 7 1ac40: 09 c0 rjmp .+18 ; 0x1ac54 1ac42: c8 17 cp r28, r24 1ac44: 39 f0 breq .+14 ; 0x1ac54 MENU_ITEM_FUNCTION_E(EEPROM_Sheets_base->s[sheet], eeprom_switch_to_next_sheet); 1ac46: c1 02 muls r28, r17 1ac48: c0 01 movw r24, r0 1ac4a: 11 24 eor r1, r1 1ac4c: 87 5b subi r24, 0xB7 ; 183 1ac4e: 92 4f sbci r25, 0xF2 ; 242 1ac50: 0e 94 00 ce call 0x19c00 ; 0x19c00 } #ifdef QUICK_NOZZLE_CHANGE SETTINGS_NOZZLE; 1ac54: 80 91 eb 04 lds r24, 0x04EB ; 0x8004eb 1ac58: 8c 33 cpi r24, 0x3C ; 60 1ac5a: 09 f4 brne .+2 ; 0x1ac5e 1ac5c: b0 c0 rjmp .+352 ; 0x1adbe 1ac5e: 08 f0 brcs .+2 ; 0x1ac62 1ac60: 93 c0 rjmp .+294 ; 0x1ad88 1ac62: 89 31 cpi r24, 0x19 ; 25 1ac64: 09 f4 brne .+2 ; 0x1ac68 1ac66: 9f c0 rjmp .+318 ; 0x1ada6 1ac68: 88 32 cpi r24, 0x28 ; 40 1ac6a: 09 f4 brne .+2 ; 0x1ac6e 1ac6c: 92 c0 rjmp .+292 ; 0x1ad92 #endif //QUICK_NOZZLE_CHANGE } if (!((eFilamentAction != FilamentAction::None) || Stopped )) { 1ac6e: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 1ac72: 81 11 cpse r24, r1 1ac74: 4f c0 rjmp .+158 ; 0x1ad14 1ac76: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1ac7a: 81 11 cpse r24, r1 1ac7c: 4b c0 rjmp .+150 ; 0x1ad14 if (MMU2::mmu2.Enabled()) { 1ac7e: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 1ac82: 81 30 cpi r24, 0x01 ; 1 1ac84: 09 f0 breq .+2 ; 0x1ac88 1ac86: af c0 rjmp .+350 ; 0x1ade6 if(!MMU2::mmu2.FindaDetectsFilament() && !fsensor.getFilamentPresent()) { 1ac88: 80 91 90 13 lds r24, 0x1390 ; 0x801390 1ac8c: 81 11 cpse r24, r1 1ac8e: 0c c0 rjmp .+24 ; 0x1aca8 1ac90: 80 91 b7 17 lds r24, 0x17B7 ; 0x8017b7 1ac94: 81 11 cpse r24, r1 1ac96: 08 c0 rjmp .+16 ; 0x1aca8 // 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); 1ac98: 85 eb ldi r24, 0xB5 ; 181 1ac9a: 96 e4 ldi r25, 0x46 ; 70 1ac9c: 0e 94 ac 72 call 0xe558 ; 0xe558 1aca0: 6a e8 ldi r22, 0x8A ; 138 1aca2: 70 ee ldi r23, 0xE0 ; 224 1aca4: 0f 94 14 d4 call 0x3a828 ; 0x3a828 } MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_TO_NOZZLE), lcd_mmuLoadFilament); 1aca8: 84 ea ldi r24, 0xA4 ; 164 1acaa: 96 e4 ldi r25, 0x46 ; 70 1acac: 0e 94 ac 72 call 0xe558 ; 0xe558 1acb0: 61 ec ldi r22, 0xC1 ; 193 1acb2: 70 ee ldi r23, 0xE0 ; 224 1acb4: 0f 94 14 d4 call 0x3a828 ; 0x3a828 MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_mmuUnloadFilament); 1acb8: 82 e9 ldi r24, 0x92 ; 146 1acba: 96 e4 ldi r25, 0x46 ; 70 1acbc: 0e 94 ac 72 call 0xe558 ; 0xe558 1acc0: 64 ec ldi r22, 0xC4 ; 196 1acc2: 70 ee ldi r23, 0xE0 ; 224 1acc4: 0f 94 14 d4 call 0x3a828 ; 0x3a828 MENU_ITEM_SUBMENU_P(_T(MSG_EJECT_FROM_MMU), lcd_mmuEjectFilament); 1acc8: 86 e2 ldi r24, 0x26 ; 38 1acca: 9c e5 ldi r25, 0x5C ; 92 1accc: 0e 94 ac 72 call 0xe558 ; 0xe558 1acd0: 67 ec ldi r22, 0xC7 ; 199 1acd2: 70 ee ldi r23, 0xE0 ; 224 1acd4: 0f 94 14 d4 call 0x3a828 ; 0x3a828 #ifdef MMU_HAS_CUTTER if (eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED) != 0) { 1acd8: 8e ec ldi r24, 0xCE ; 206 1acda: 9e e0 ldi r25, 0x0E ; 14 1acdc: 0f 94 1c dc call 0x3b838 ; 0x3b838 1ace0: 88 23 and r24, r24 1ace2: 41 f0 breq .+16 ; 0x1acf4 MENU_ITEM_SUBMENU_P(_T(MSG_CUT_FILAMENT), lcd_mmuCutFilament); 1ace4: 87 e1 ldi r24, 0x17 ; 23 1ace6: 9c e5 ldi r25, 0x5C ; 92 1ace8: 0e 94 ac 72 call 0xe558 ; 0xe558 1acec: 6a ec ldi r22, 0xCA ; 202 1acee: 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); 1acf0: 0f 94 14 d4 call 0x3a828 ; 0x3a828 #ifdef FILAMENT_SENSOR } #endif //FILAMENT_SENSOR } MENU_ITEM_SUBMENU_P(_T(MSG_SETTINGS), lcd_settings_menu); 1acf4: 86 e4 ldi r24, 0x46 ; 70 1acf6: 98 e4 ldi r25, 0x48 ; 72 1acf8: 0e 94 ac 72 call 0xe558 ; 0xe558 1acfc: 66 e2 ldi r22, 0x26 ; 38 1acfe: 77 ed ldi r23, 0xD7 ; 215 1ad00: 0f 94 14 d4 call 0x3a828 ; 0x3a828 MENU_ITEM_SUBMENU_P(_T(MSG_CALIBRATION), lcd_calibration_menu); 1ad04: 80 e6 ldi r24, 0x60 ; 96 1ad06: 96 e4 ldi r25, 0x46 ; 70 1ad08: 0e 94 ac 72 call 0xe558 ; 0xe558 1ad0c: 69 e9 ldi r22, 0x99 ; 153 1ad0e: 78 ed ldi r23, 0xD8 ; 216 1ad10: 0f 94 14 d4 call 0x3a828 ; 0x3a828 } } MENU_ITEM_SUBMENU_P(_T(MSG_STATISTICS), lcd_menu_statistics); 1ad14: 83 e5 ldi r24, 0x53 ; 83 1ad16: 96 e4 ldi r25, 0x46 ; 70 1ad18: 0e 94 ac 72 call 0xe558 ; 0xe558 1ad1c: 6a e0 ldi r22, 0x0A ; 10 1ad1e: 7a e3 ldi r23, 0x3A ; 58 1ad20: 0f 94 14 d4 call 0x3a828 ; 0x3a828 #if defined(TMC2130) || defined(FILAMENT_SENSOR) MENU_ITEM_SUBMENU_P(_T(MSG_FAIL_STATS), lcd_menu_fails_stats); 1ad24: 86 e4 ldi r24, 0x46 ; 70 1ad26: 96 e4 ldi r25, 0x46 ; 70 1ad28: 0e 94 ac 72 call 0xe558 ; 0xe558 1ad2c: 6e e1 ldi r22, 0x1E ; 30 1ad2e: 7b e3 ldi r23, 0x3B ; 59 1ad30: 0f 94 14 d4 call 0x3a828 ; 0x3a828 #endif if (MMU2::mmu2.Enabled()) { 1ad34: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 1ad38: 81 30 cpi r24, 0x01 ; 1 1ad3a: 41 f4 brne .+16 ; 0x1ad4c MENU_ITEM_SUBMENU_P(_T(MSG_MMU_FAIL_STATS), lcd_menu_fails_stats_mmu); 1ad3c: 85 e3 ldi r24, 0x35 ; 53 1ad3e: 96 e4 ldi r25, 0x46 ; 70 1ad40: 0e 94 ac 72 call 0xe558 ; 0xe558 1ad44: 60 e1 ldi r22, 0x10 ; 16 1ad46: 7a e3 ldi r23, 0x3A ; 58 1ad48: 0f 94 14 d4 call 0x3a828 ; 0x3a828 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); 1ad4c: 8b e2 ldi r24, 0x2B ; 43 1ad4e: 96 e4 ldi r25, 0x46 ; 70 1ad50: 0e 94 ac 72 call 0xe558 ; 0xe558 1ad54: 64 ef ldi r22, 0xF4 ; 244 1ad56: 79 e3 ldi r23, 0x39 ; 57 1ad58: 0f 94 14 d4 call 0x3a828 ; 0x3a828 MENU_END(); 1ad5c: 0f 94 6a d1 call 0x3a2d4 ; 0x3a2d4 //! | Support | allways //! @endcode static void lcd_main_menu() { MENU_BEGIN(); 1ad60: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1ad64: 8f 5f subi r24, 0xFF ; 255 1ad66: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1ad6a: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1ad6e: 8f 5f subi r24, 0xFF ; 255 1ad70: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1ad74: 25 ce rjmp .-950 ; 0x1a9c0 #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 1ad76: d0 93 e1 03 sts 0x03E1, r29 ; 0x8003e1 MENU_ITEM_BACK_P(_T(MSG_NO_CARD)); 1ad7a: 82 ed ldi r24, 0xD2 ; 210 1ad7c: 96 e4 ldi r25, 0x46 ; 70 1ad7e: 0e 94 ac 72 call 0xe558 ; 0xe558 1ad82: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 1ad86: 54 cf rjmp .-344 ; 0x1ac30 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); } #ifdef QUICK_NOZZLE_CHANGE SETTINGS_NOZZLE; 1ad88: 80 35 cpi r24, 0x50 ; 80 1ad8a: 19 f1 breq .+70 ; 0x1add2 1ad8c: 8f 3f cpi r24, 0xFF ; 255 1ad8e: 09 f0 breq .+2 ; 0x1ad92 1ad90: 6e cf rjmp .-292 ; 0x1ac6e 1ad92: 86 ec ldi r24, 0xC6 ; 198 1ad94: 96 e4 ldi r25, 0x46 ; 70 1ad96: 0e 94 ac 72 call 0xe558 ; 0xe558 1ad9a: 22 e0 ldi r18, 0x02 ; 2 1ad9c: 4e e0 ldi r20, 0x0E ; 14 1ad9e: 50 ed ldi r21, 0xD0 ; 208 1ada0: 69 e2 ldi r22, 0x29 ; 41 1ada2: 7a e8 ldi r23, 0x8A ; 138 1ada4: 09 c0 rjmp .+18 ; 0x1adb8 1ada6: 86 ec ldi r24, 0xC6 ; 198 1ada8: 96 e4 ldi r25, 0x46 ; 70 1adaa: 0e 94 ac 72 call 0xe558 ; 0xe558 1adae: 22 e0 ldi r18, 0x02 ; 2 1adb0: 4e e0 ldi r20, 0x0E ; 14 1adb2: 50 ed ldi r21, 0xD0 ; 208 1adb4: 6e e2 ldi r22, 0x2E ; 46 1adb6: 7a e8 ldi r23, 0x8A ; 138 1adb8: 0f 94 25 d3 call 0x3a64a ; 0x3a64a 1adbc: 58 cf rjmp .-336 ; 0x1ac6e 1adbe: 86 ec ldi r24, 0xC6 ; 198 1adc0: 96 e4 ldi r25, 0x46 ; 70 1adc2: 0e 94 ac 72 call 0xe558 ; 0xe558 1adc6: 22 e0 ldi r18, 0x02 ; 2 1adc8: 4e e0 ldi r20, 0x0E ; 14 1adca: 50 ed ldi r21, 0xD0 ; 208 1adcc: 64 e2 ldi r22, 0x24 ; 36 1adce: 7a e8 ldi r23, 0x8A ; 138 1add0: f3 cf rjmp .-26 ; 0x1adb8 1add2: 86 ec ldi r24, 0xC6 ; 198 1add4: 96 e4 ldi r25, 0x46 ; 70 1add6: 0e 94 ac 72 call 0xe558 ; 0xe558 1adda: 22 e0 ldi r18, 0x02 ; 2 1addc: 4e e0 ldi r20, 0x0E ; 14 1adde: 50 ed ldi r21, 0xD0 ; 208 1ade0: 6f e1 ldi r22, 0x1F ; 31 1ade2: 7a e8 ldi r23, 0x8A ; 138 1ade4: e9 cf rjmp .-46 ; 0x1adb8 MENU_ITEM_SUBMENU_P(_T(MSG_CUT_FILAMENT), lcd_mmuCutFilament); } #endif //MMU_HAS_CUTTER } else { #ifdef FILAMENT_SENSOR if (fsensor.isEnabled()) { 1ade6: 80 91 aa 17 lds r24, 0x17AA ; 0x8017aa 1adea: 88 23 and r24, r24 1adec: e1 f0 breq .+56 ; 0x1ae26 if (!fsensor.getAutoLoadEnabled()) { 1adee: 80 91 ab 17 lds r24, 0x17AB ; 0x8017ab 1adf2: 81 11 cpse r24, r1 1adf4: 08 c0 rjmp .+16 ; 0x1ae06 MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_FILAMENT), lcd_LoadFilament); 1adf6: 82 e8 ldi r24, 0x82 ; 130 1adf8: 96 e4 ldi r25, 0x46 ; 70 1adfa: 0e 94 ac 72 call 0xe558 ; 0xe558 1adfe: 6c ed ldi r22, 0xDC ; 220 1ae00: 7a e3 ldi r23, 0x3A ; 58 1ae02: 0f 94 14 d4 call 0x3a828 ; 0x3a828 } if (!fsensor.getFilamentPresent()) { 1ae06: 80 91 b7 17 lds r24, 0x17B7 ; 0x8017b7 1ae0a: 81 11 cpse r24, r1 1ae0c: 14 c0 rjmp .+40 ; 0x1ae36 if (fsensor.getAutoLoadEnabled()) { 1ae0e: 80 91 ab 17 lds r24, 0x17AB ; 0x8017ab 1ae12: 88 23 and r24, r24 1ae14: 09 f4 brne .+2 ; 0x1ae18 1ae16: 6e cf rjmp .-292 ; 0x1acf4 MENU_ITEM_SUBMENU_P(_T(MSG_AUTOLOAD_FILAMENT), lcd_menu_AutoLoadFilament); 1ae18: 8e e6 ldi r24, 0x6E ; 110 1ae1a: 96 e4 ldi r25, 0x46 ; 70 1ae1c: 0e 94 ac 72 call 0xe558 ; 0xe558 1ae20: 6a e2 ldi r22, 0x2A ; 42 1ae22: 7a e3 ldi r23, 0x3A ; 58 1ae24: 65 cf rjmp .-310 ; 0x1acf0 } 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); 1ae26: 82 e8 ldi r24, 0x82 ; 130 1ae28: 96 e4 ldi r25, 0x46 ; 70 1ae2a: 0e 94 ac 72 call 0xe558 ; 0xe558 1ae2e: 6c ed ldi r22, 0xDC ; 220 1ae30: 7a e3 ldi r23, 0x3A ; 58 1ae32: 0f 94 14 d4 call 0x3a828 ; 0x3a828 MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_unLoadFilament); 1ae36: 82 e9 ldi r24, 0x92 ; 146 1ae38: 96 e4 ldi r25, 0x46 ; 70 1ae3a: 0e 94 ac 72 call 0xe558 ; 0xe558 1ae3e: 6a e8 ldi r22, 0x8A ; 138 1ae40: 7a e3 ldi r23, 0x3A ; 58 1ae42: 56 cf rjmp .-340 ; 0x1acf0 #endif //HOST_SHUTOWN MENU_ITEM_SUBMENU_P(_T(MSG_SUPPORT), lcd_support_menu); MENU_END(); } 1ae44: df 91 pop r29 1ae46: cf 91 pop r28 1ae48: 1f 91 pop r17 1ae4a: 08 95 ret 0001ae4c : MENU_END(); } static void lcd_settings_menu() { 1ae4c: 1f 93 push r17 1ae4e: cf 93 push r28 1ae50: df 93 push r29 SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); 1ae52: 8f ef ldi r24, 0xFF ; 255 1ae54: 9f e0 ldi r25, 0x0F ; 15 1ae56: 0f 94 1c dc call 0x3b838 ; 0x3b838 1ae5a: 80 93 a4 03 sts 0x03A4, r24 ; 0x8003a4 MENU_BEGIN(); 1ae5e: 0f 94 96 d1 call 0x3a32c ; 0x3a32c 1ae62: 10 92 12 05 sts 0x0512, r1 ; 0x800512 SETTINGS_FANS_CHECK(); SETTINGS_SILENT_MODE(); if(!farm_mode) { bSettings=true; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function 1ae66: 11 e0 ldi r17, 0x01 ; 1 } static void lcd_settings_menu() { SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 1ae68: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1ae6c: 84 30 cpi r24, 0x04 ; 4 1ae6e: 08 f0 brcs .+2 ; 0x1ae72 1ae70: 5c c1 rjmp .+696 ; 0x1b12a 1ae72: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1ae76: 88 ea ldi r24, 0xA8 ; 168 1ae78: 98 e4 ldi r25, 0x48 ; 72 1ae7a: 0e 94 ac 72 call 0xe558 ; 0xe558 1ae7e: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 MENU_ITEM_SUBMENU_P(_T(MSG_TEMPERATURE), lcd_control_temperature_menu); 1ae82: 83 e0 ldi r24, 0x03 ; 3 1ae84: 95 e4 ldi r25, 0x45 ; 69 1ae86: 0e 94 ac 72 call 0xe558 ; 0xe558 1ae8a: 6b e6 ldi r22, 0x6B ; 107 1ae8c: 79 ed ldi r23, 0xD9 ; 217 1ae8e: 0f 94 14 d4 call 0x3a828 ; 0x3a828 if (!printer_active() || printingIsPaused()) 1ae92: 0e 94 e1 67 call 0xcfc2 ; 0xcfc2 1ae96: 88 23 and r24, r24 1ae98: 21 f0 breq .+8 ; 0x1aea2 1ae9a: 0e 94 85 67 call 0xcf0a ; 0xcf0a 1ae9e: 88 23 and r24, r24 1aea0: 81 f0 breq .+32 ; 0x1aec2 { MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_AXIS), lcd_move_menu_axis); 1aea2: 87 ef ldi r24, 0xF7 ; 247 1aea4: 94 e4 ldi r25, 0x44 ; 68 1aea6: 0e 94 ac 72 call 0xe558 ; 0xe558 1aeaa: 64 ec ldi r22, 0xC4 ; 196 1aeac: 73 ed ldi r23, 0xD3 ; 211 1aeae: 0f 94 14 d4 call 0x3a828 ; 0x3a828 MENU_ITEM_GCODE_P(_T(MSG_DISABLE_STEPPERS), MSG_M84); 1aeb2: 84 ee ldi r24, 0xE4 ; 228 1aeb4: 94 e4 ldi r25, 0x44 ; 68 1aeb6: 0e 94 ac 72 call 0xe558 ; 0xe558 1aeba: 67 ed ldi r22, 0xD7 ; 215 1aebc: 7b e6 ldi r23, 0x6B ; 107 1aebe: 0f 94 8c d0 call 0x3a118 ; 0x3a118 } #ifdef FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_FSENSOR), lcd_fsensor_settings_menu); 1aec2: 87 ea ldi r24, 0xA7 ; 167 1aec4: 97 e4 ldi r25, 0x47 ; 71 1aec6: 0e 94 ac 72 call 0xe558 ; 0xe558 1aeca: 69 e8 ldi r22, 0x89 ; 137 1aecc: 72 ed ldi r23, 0xD2 ; 210 1aece: 0f 94 14 d4 call 0x3a828 ; 0x3a828 #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); 1aed2: 8c ea ldi r24, 0xAC ; 172 1aed4: 9c e0 ldi r25, 0x0C ; 12 1aed6: 0f 94 1c dc call 0x3b838 ; 0x3b838 1aeda: 88 23 and r24, r24 1aedc: 09 f4 brne .+2 ; 0x1aee0 1aede: ac c0 rjmp .+344 ; 0x1b038 1aee0: 89 ed ldi r24, 0xD9 ; 217 1aee2: 9c e5 ldi r25, 0x5C ; 92 1aee4: 0e 94 ac 72 call 0xe558 ; 0xe558 1aee8: 22 e0 ldi r18, 0x02 ; 2 1aeea: 4c ee ldi r20, 0xEC ; 236 1aeec: 53 ee ldi r21, 0xE3 ; 227 1aeee: bc 01 movw r22, r24 1aef0: 87 e1 ldi r24, 0x17 ; 23 1aef2: 9a e8 ldi r25, 0x8A ; 138 1aef4: 0f 94 25 d3 call 0x3a64a ; 0x3a64a if (eeprom_read_byte((uint8_t *)EEPROM_MMU_ENABLED)) 1aef8: 8c ea ldi r24, 0xAC ; 172 1aefa: 9c e0 ldi r25, 0x0C ; 12 1aefc: 0f 94 1c dc call 0x3b838 ; 0x3b838 1af00: 88 23 and r24, r24 1af02: 31 f0 breq .+12 ; 0x1af10 { // Communication with MMU not required to reset MMU MENU_ITEM_FUNCTION_P(PSTR("Reset MMU"), []() { MMU2::mmu2.Reset(MMU2::MMU2::ResetForm::Software); }); 1af04: 6a e6 ldi r22, 0x6A ; 106 1af06: 79 e3 ldi r23, 0x39 ; 57 1af08: 8d e0 ldi r24, 0x0D ; 13 1af0a: 9a e8 ldi r25, 0x8A ; 138 1af0c: 0f 94 13 d1 call 0x3a226 ; 0x3a226 } if (MMU2::mmu2.Enabled()) 1af10: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 1af14: 81 30 cpi r24, 0x01 ; 1 1af16: 51 f4 brne .+20 ; 0x1af2c { // Only show menus when communicating with MMU menuitems_MMU_settings_common(); 1af18: 0e 94 71 d1 call 0x1a2e2 ; 0x1a2e2 MENU_ITEM_SUBMENU_P(_T(MSG_LOADING_TEST), lcd_mmuLoadingTest); 1af1c: 85 ed ldi r24, 0xD5 ; 213 1af1e: 94 e4 ldi r25, 0x44 ; 68 1af20: 0e 94 ac 72 call 0xe558 ; 0xe558 1af24: 6d ec ldi r22, 0xCD ; 205 1af26: 70 ee ldi r23, 0xE0 ; 224 1af28: 0f 94 14 d4 call 0x3a828 ; 0x3a828 } SETTINGS_FANS_CHECK(); 1af2c: 0e 94 f3 d0 call 0x1a1e6 ; 0x1a1e6 SETTINGS_SILENT_MODE(); 1af30: 0e 94 0d d1 call 0x1a21a ; 0x1a21a if(!farm_mode) { bSettings=true; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function 1af34: 10 93 fc 03 sts 0x03FC, r17 ; 0x8003fc MENU_ITEM_SUBMENU_P(_T(MSG_HW_SETUP), lcd_hw_setup_menu); 1af38: 8a ec ldi r24, 0xCA ; 202 1af3a: 94 e4 ldi r25, 0x44 ; 68 1af3c: 0e 94 ac 72 call 0xe558 ; 0xe558 1af40: 6a eb ldi r22, 0xBA ; 186 1af42: 71 ed ldi r23, 0xD1 ; 209 1af44: 0f 94 14 d4 call 0x3a828 ; 0x3a828 } 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); 1af48: 88 e5 ldi r24, 0x58 ; 88 1af4a: 95 e4 ldi r25, 0x45 ; 69 1af4c: 0e 94 ac 72 call 0xe558 ; 0xe558 1af50: 6c e0 ldi r22, 0x0C ; 12 1af52: 7a e3 ldi r23, 0x3A ; 58 1af54: 0f 94 14 d4 call 0x3a828 ; 0x3a828 #if defined (TMC2130) && defined (LINEARITY_CORRECTION) MENU_ITEM_SUBMENU_P(_T(MSG_LIN_CORRECTION), lcd_settings_linearity_correction_menu); 1af58: 88 eb ldi r24, 0xB8 ; 184 1af5a: 94 e4 ldi r25, 0x44 ; 68 1af5c: 0e 94 ac 72 call 0xe558 ; 0xe558 1af60: 6e e6 ldi r22, 0x6E ; 110 1af62: 70 ef ldi r23, 0xF0 ; 240 1af64: 0f 94 14 d4 call 0x3a828 ; 0x3a828 #endif //LINEARITY_CORRECTION && TMC2130 #ifdef PINDA_THERMISTOR if(has_temperature_compensation()) 1af68: 20 e0 ldi r18, 0x00 ; 0 1af6a: 30 e0 ldi r19, 0x00 ; 0 1af6c: 40 e2 ldi r20, 0x20 ; 32 1af6e: 51 e4 ldi r21, 0x41 ; 65 1af70: 60 91 99 03 lds r22, 0x0399 ; 0x800399 1af74: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 1af78: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 1af7c: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 1af80: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 1af84: 87 fd sbrc r24, 7 1af86: 16 c0 rjmp .+44 ; 0x1afb4 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); 1af88: 8f ea ldi r24, 0xAF ; 175 1af8a: 9f e0 ldi r25, 0x0F ; 15 1af8c: 0f 94 1c dc call 0x3b838 ; 0x3b838 1af90: 88 23 and r24, r24 1af92: 09 f4 brne .+2 ; 0x1af96 1af94: 54 c0 rjmp .+168 ; 0x1b03e 1af96: 89 ed ldi r24, 0xD9 ; 217 1af98: 9c e5 ldi r25, 0x5C ; 92 1af9a: 0e 94 ac 72 call 0xe558 ; 0xe558 1af9e: ec 01 movw r28, r24 1afa0: 81 e1 ldi r24, 0x11 ; 17 1afa2: 95 e4 ldi r25, 0x45 ; 69 1afa4: 0e 94 ac 72 call 0xe558 ; 0xe558 1afa8: 22 e0 ldi r18, 0x02 ; 2 1afaa: 49 ed ldi r20, 0xD9 ; 217 1afac: 5f ec ldi r21, 0xCF ; 207 1afae: be 01 movw r22, r28 1afb0: 0f 94 25 d3 call 0x3a64a ; 0x3a64a #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); 1afb4: 80 91 39 05 lds r24, 0x0539 ; 0x800539 1afb8: 81 11 cpse r24, r1 1afba: 44 c0 rjmp .+136 ; 0x1b044 1afbc: 83 ed ldi r24, 0xD3 ; 211 1afbe: 9c e5 ldi r25, 0x5C ; 92 1afc0: 0e 94 ac 72 call 0xe558 ; 0xe558 1afc4: ec 01 movw r28, r24 1afc6: 8d ea ldi r24, 0xAD ; 173 1afc8: 94 e4 ldi r25, 0x44 ; 68 1afca: 0e 94 ac 72 call 0xe558 ; 0xe558 1afce: 22 e0 ldi r18, 0x02 ; 2 1afd0: 47 ec ldi r20, 0xC7 ; 199 1afd2: 5f ec ldi r21, 0xCF ; 207 1afd4: be 01 movw r22, r28 1afd6: 0f 94 25 d3 call 0x3a64a ; 0x3a64a #endif //HAS_SECOND_SERIAL if (!printingIsPaused()) MENU_ITEM_SUBMENU_P(_T(MSG_BABYSTEP_Z), lcd_babystep_z); 1afda: 0e 94 85 67 call 0xcf0a ; 0xcf0a 1afde: 81 11 cpse r24, r1 1afe0: 08 c0 rjmp .+16 ; 0x1aff2 1afe2: 8a e4 ldi r24, 0x4A ; 74 1afe4: 97 e4 ldi r25, 0x47 ; 71 1afe6: 0e 94 ac 72 call 0xe558 ; 0xe558 1afea: 66 ee ldi r22, 0xE6 ; 230 1afec: 79 e3 ldi r23, 0x39 ; 57 1afee: 0f 94 14 d4 call 0x3a828 ; 0x3a828 #if (LANG_MODE != 0) MENU_ITEM_SUBMENU_P(_T(MSG_SELECT_LANGUAGE), lcd_language_menu); 1aff2: 8b e9 ldi r24, 0x9B ; 155 1aff4: 94 e4 ldi r25, 0x44 ; 68 1aff6: 0e 94 ac 72 call 0xe558 ; 0xe558 1affa: 6f ec ldi r22, 0xCF ; 207 1affc: 72 ee ldi r23, 0xE2 ; 226 1affe: 0f 94 14 d4 call 0x3a828 ; 0x3a828 #endif //(LANG_MODE != 0) if (!farm_mode) { //SD related settings are not available in farm mode if (card.ToshibaFlashAir_isEnabled()) 1b002: 80 91 01 17 lds r24, 0x1701 ; 0x801701 1b006: 88 23 and r24, r24 1b008: 01 f1 breq .+64 ; 0x1b04a MENU_ITEM_TOGGLE_P(_T(MSG_SD_CARD), MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY, lcd_toshiba_flash_air_compatibility_toggle); 1b00a: 81 e9 ldi r24, 0x91 ; 145 1b00c: 94 e4 ldi r25, 0x44 ; 68 1b00e: 0e 94 ac 72 call 0xe558 ; 0xe558 1b012: 22 e0 ldi r18, 0x02 ; 2 1b014: 4d eb ldi r20, 0xBD ; 189 1b016: 5f ec ldi r21, 0xCF ; 207 1b018: 62 eb ldi r22, 0xB2 ; 178 1b01a: 7a e6 ldi r23, 0x6A ; 106 else MENU_ITEM_TOGGLE_P(_T(MSG_SD_CARD), _T(MSG_NORMAL), lcd_toshiba_flash_air_compatibility_toggle); 1b01c: 0f 94 25 d3 call 0x3a64a ; 0x3a64a #ifdef SDCARD_SORT_ALPHA switch (eeprom_read_byte((uint8_t*) EEPROM_SD_SORT)) { 1b020: 89 e0 ldi r24, 0x09 ; 9 1b022: 9f e0 ldi r25, 0x0F ; 15 1b024: 0f 94 1c dc call 0x3b838 ; 0x3b838 1b028: 88 23 and r24, r24 1b02a: e9 f0 breq .+58 ; 0x1b066 1b02c: 81 30 cpi r24, 0x01 ; 1 1b02e: 09 f4 brne .+2 ; 0x1b032 1b030: 6d c0 rjmp .+218 ; 0x1b10c 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); 1b032: 83 ed ldi r24, 0xD3 ; 211 1b034: 99 e4 ldi r25, 0x49 ; 73 1b036: 19 c0 rjmp .+50 ; 0x1b06a #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); 1b038: 83 ed ldi r24, 0xD3 ; 211 1b03a: 9c e5 ldi r25, 0x5C ; 92 1b03c: 53 cf rjmp .-346 ; 0x1aee4 #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); 1b03e: 83 ed ldi r24, 0xD3 ; 211 1b040: 9c e5 ldi r25, 0x5C ; 92 1b042: ab cf rjmp .-170 ; 0x1af9a #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); 1b044: 89 ed ldi r24, 0xD9 ; 217 1b046: 9c e5 ldi r25, 0x5C ; 92 1b048: bb cf rjmp .-138 ; 0x1afc0 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); 1b04a: 88 e8 ldi r24, 0x88 ; 136 1b04c: 94 e4 ldi r25, 0x44 ; 68 1b04e: 0e 94 ac 72 call 0xe558 ; 0xe558 1b052: ec 01 movw r28, r24 1b054: 81 e9 ldi r24, 0x91 ; 145 1b056: 94 e4 ldi r25, 0x44 ; 68 1b058: 0e 94 ac 72 call 0xe558 ; 0xe558 1b05c: 22 e0 ldi r18, 0x02 ; 2 1b05e: 4d eb ldi r20, 0xBD ; 189 1b060: 5f ec ldi r21, 0xCF ; 207 1b062: be 01 movw r22, r28 1b064: db cf rjmp .-74 ; 0x1b01c #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; 1b066: 81 e8 ldi r24, 0x81 ; 129 1b068: 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); 1b06a: 0e 94 ac 72 call 0xe558 ; 0xe558 1b06e: ec 01 movw r28, r24 1b070: 8a e7 ldi r24, 0x7A ; 122 1b072: 94 e4 ldi r25, 0x44 ; 68 1b074: 0e 94 ac 72 call 0xe558 ; 0xe558 1b078: 22 e0 ldi r18, 0x02 ; 2 1b07a: 4b ef ldi r20, 0xFB ; 251 1b07c: 5f ec ldi r21, 0xCF ; 207 1b07e: be 01 movw r22, r28 1b080: 0f 94 25 d3 call 0x3a64a ; 0x3a64a } } #endif //SDCARD_SORT_ALPHA SETTINGS_SOUND; 1b084: 80 91 de 04 lds r24, 0x04DE ; 0x8004de 1b088: 82 30 cpi r24, 0x02 ; 2 1b08a: 09 f4 brne .+2 ; 0x1b08e 1b08c: 45 c0 rjmp .+138 ; 0x1b118 1b08e: 83 30 cpi r24, 0x03 ; 3 1b090: 09 f4 brne .+2 ; 0x1b094 1b092: 45 c0 rjmp .+138 ; 0x1b11e 1b094: 81 30 cpi r24, 0x01 ; 1 1b096: e9 f1 breq .+122 ; 0x1b112 1b098: 80 ea ldi r24, 0xA0 ; 160 1b09a: 97 e4 ldi r25, 0x47 ; 71 1b09c: 0e 94 ac 72 call 0xe558 ; 0xe558 1b0a0: ec 01 movw r28, r24 1b0a2: 88 e9 ldi r24, 0x98 ; 152 1b0a4: 97 e4 ldi r25, 0x47 ; 71 1b0a6: 0e 94 ac 72 call 0xe558 ; 0xe558 1b0aa: 22 e0 ldi r18, 0x02 ; 2 1b0ac: 44 ee ldi r20, 0xE4 ; 228 1b0ae: 5f ec ldi r21, 0xCF ; 207 1b0b0: be 01 movw r22, r28 1b0b2: 0f 94 25 d3 call 0x3a64a ; 0x3a64a #ifdef LCD_BL_PIN if (backlightSupport) 1b0b6: 80 91 02 04 lds r24, 0x0402 ; 0x800402 1b0ba: 88 23 and r24, r24 1b0bc: 41 f0 breq .+16 ; 0x1b0ce { MENU_ITEM_SUBMENU_P(_T(MSG_BRIGHTNESS), lcd_backlight_menu); 1b0be: 82 e7 ldi r24, 0x72 ; 114 1b0c0: 97 e4 ldi r25, 0x47 ; 71 1b0c2: 0e 94 ac 72 call 0xe558 ; 0xe558 1b0c6: 61 e0 ldi r22, 0x01 ; 1 1b0c8: 70 ee ldi r23, 0xE0 ; 224 1b0ca: 0f 94 14 d4 call 0x3a828 ; 0x3a828 } #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 1b0ce: 87 ea ldi r24, 0xA7 ; 167 1b0d0: 9c e0 ldi r25, 0x0C ; 12 1b0d2: 0f 94 1c dc call 0x3b838 ; 0x3b838 1b0d6: 88 23 and r24, r24 1b0d8: 29 f1 breq .+74 ; 0x1b124 1b0da: 81 e5 ldi r24, 0x51 ; 81 1b0dc: 98 e4 ldi r25, 0x48 ; 72 1b0de: 0e 94 ac 72 call 0xe558 ; 0xe558 1b0e2: 22 e0 ldi r18, 0x02 ; 2 1b0e4: 40 e3 ldi r20, 0x30 ; 48 1b0e6: 5f ec ldi r21, 0xCF ; 207 1b0e8: bc 01 movw r22, r24 1b0ea: 85 ea ldi r24, 0xA5 ; 165 1b0ec: 9a e6 ldi r25, 0x6A ; 106 1b0ee: 0f 94 25 d3 call 0x3a64a ; 0x3a64a if (farm_mode) { MENU_ITEM_FUNCTION_P(PSTR("Disable farm mode"), lcd_disable_farm_mode); } MENU_END(); 1b0f2: 0f 94 6a d1 call 0x3a2d4 ; 0x3a2d4 } static void lcd_settings_menu() { SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 1b0f6: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1b0fa: 8f 5f subi r24, 0xFF ; 255 1b0fc: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1b100: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1b104: 8f 5f subi r24, 0xFF ; 255 1b106: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1b10a: ae ce rjmp .-676 ; 0x1ae68 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; 1b10c: 8f e6 ldi r24, 0x6F ; 111 1b10e: 94 e4 ldi r25, 0x44 ; 68 1b110: ac cf rjmp .-168 ; 0x1b06a default: MENU_ITEM_TOGGLE_P(_T(MSG_SORT), _T(MSG_NONE), lcd_sort_type_set); } } #endif //SDCARD_SORT_ALPHA SETTINGS_SOUND; 1b112: 81 e9 ldi r24, 0x91 ; 145 1b114: 97 e4 ldi r25, 0x47 ; 71 1b116: c2 cf rjmp .-124 ; 0x1b09c 1b118: 88 e8 ldi r24, 0x88 ; 136 1b11a: 97 e4 ldi r25, 0x47 ; 71 1b11c: bf cf rjmp .-130 ; 0x1b09c 1b11e: 8f e7 ldi r24, 0x7F ; 127 1b120: 97 e4 ldi r25, 0x47 ; 71 1b122: bc cf rjmp .-136 ; 0x1b09c 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 1b124: 87 e5 ldi r24, 0x57 ; 87 1b126: 98 e4 ldi r25, 0x48 ; 72 1b128: da cf rjmp .-76 ; 0x1b0de { MENU_ITEM_FUNCTION_P(PSTR("Disable farm mode"), lcd_disable_farm_mode); } MENU_END(); } 1b12a: df 91 pop r29 1b12c: cf 91 pop r28 1b12e: 1f 91 pop r17 1b130: 08 95 ret 0001b132 : } #endif //TMC2130 static void lcd_calibration_menu() { MENU_BEGIN(); 1b132: 0f 94 96 d1 call 0x3a32c ; 0x3a32c 1b136: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1b13a: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1b13e: 84 30 cpi r24, 0x04 ; 4 1b140: 08 f0 brcs .+2 ; 0x1b144 1b142: 8f c0 rjmp .+286 ; 0x1b262 1b144: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1b148: 88 ea ldi r24, 0xA8 ; 168 1b14a: 98 e4 ldi r25, 0x48 ; 72 1b14c: 0e 94 ac 72 call 0xe558 ; 0xe558 1b150: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 MENU_ITEM_FUNCTION_P(_T(MSG_WIZARD), lcd_wizard); 1b154: 81 ea ldi r24, 0xA1 ; 161 1b156: 95 e4 ldi r25, 0x45 ; 69 1b158: 0e 94 ac 72 call 0xe558 ; 0xe558 1b15c: 60 e6 ldi r22, 0x60 ; 96 1b15e: 7a e3 ldi r23, 0x3A ; 58 1b160: 0f 94 13 d1 call 0x3a226 ; 0x3a226 if (lcd_commands_type == LcdCommands::Idle) 1b164: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 1b168: 81 11 cpse r24, r1 1b16a: 08 c0 rjmp .+16 ; 0x1b17c { MENU_ITEM_SUBMENU_P(_T(MSG_V2_CALIBRATION), lcd_first_layer_calibration_reset); 1b16c: 80 e0 ldi r24, 0x00 ; 0 1b16e: 96 e4 ldi r25, 0x46 ; 70 1b170: 0e 94 ac 72 call 0xe558 ; 0xe558 1b174: 6c ea ldi r22, 0xAC ; 172 1b176: 7e ee ldi r23, 0xEE ; 238 1b178: 0f 94 14 d4 call 0x3a828 ; 0x3a828 } MENU_ITEM_GCODE_P(_T(MSG_AUTO_HOME), G28W); 1b17c: 8b e0 ldi r24, 0x0B ; 11 1b17e: 9c e5 ldi r25, 0x5C ; 92 1b180: 0e 94 ac 72 call 0xe558 ; 0xe558 1b184: 64 ee ldi r22, 0xE4 ; 228 1b186: 7b e6 ldi r23, 0x6B ; 107 1b188: 0f 94 8c d0 call 0x3a118 ; 0x3a118 #ifdef TMC2130 MENU_ITEM_FUNCTION_P(_T(MSG_BELTTEST), lcd_belttest_v); 1b18c: 85 e9 ldi r24, 0x95 ; 149 1b18e: 95 e4 ldi r25, 0x45 ; 69 1b190: 0e 94 ac 72 call 0xe558 ; 0xe558 1b194: 68 e4 ldi r22, 0x48 ; 72 1b196: 7f ed ldi r23, 0xDF ; 223 1b198: 0f 94 13 d1 call 0x3a226 ; 0x3a226 #endif //TMC2130 MENU_ITEM_FUNCTION_P(_T(MSG_SELFTEST), lcd_selftest_v); 1b19c: 8a e8 ldi r24, 0x8A ; 138 1b19e: 95 e4 ldi r25, 0x45 ; 69 1b1a0: 0e 94 ac 72 call 0xe558 ; 0xe558 1b1a4: 6f ec ldi r22, 0xCF ; 207 1b1a6: 77 ef ldi r23, 0xF7 ; 247 1b1a8: 0f 94 13 d1 call 0x3a226 ; 0x3a226 // MK2 MENU_ITEM_FUNCTION_P(_T(MSG_CALIBRATE_BED), lcd_mesh_calibration); 1b1ac: 8a e7 ldi r24, 0x7A ; 122 1b1ae: 95 e4 ldi r25, 0x45 ; 69 1b1b0: 0e 94 ac 72 call 0xe558 ; 0xe558 1b1b4: 6e e8 ldi r22, 0x8E ; 142 1b1b6: 7e ec ldi r23, 0xCE ; 206 1b1b8: 0f 94 13 d1 call 0x3a226 ; 0x3a226 // "Calibrate Z" with storing the reference values to EEPROM. MENU_ITEM_FUNCTION_P(_T(MSG_HOMEYZ), lcd_mesh_calibration_z); 1b1bc: 8c e6 ldi r24, 0x6C ; 108 1b1be: 95 e4 ldi r25, 0x45 ; 69 1b1c0: 0e 94 ac 72 call 0xe558 ; 0xe558 1b1c4: 65 e9 ldi r22, 0x95 ; 149 1b1c6: 7e ec ldi r23, 0xCE ; 206 1b1c8: 0f 94 13 d1 call 0x3a226 ; 0x3a226 MENU_ITEM_SUBMENU_P(_T(MSG_MESH_BED_LEVELING), lcd_mesh_bedleveling); ////MSG_MESH_BED_LEVELING c=18 1b1cc: 88 e5 ldi r24, 0x58 ; 88 1b1ce: 95 e4 ldi r25, 0x45 ; 69 1b1d0: 0e 94 ac 72 call 0xe558 ; 0xe558 1b1d4: 6c e9 ldi r22, 0x9C ; 156 1b1d6: 7e ec ldi r23, 0xCE ; 206 1b1d8: 0f 94 14 d4 call 0x3a828 ; 0x3a828 MENU_ITEM_SUBMENU_P(_T(MSG_BED_CORRECTION_MENU), lcd_adjust_bed); 1b1dc: 84 e4 ldi r24, 0x44 ; 68 1b1de: 95 e4 ldi r25, 0x45 ; 69 1b1e0: 0e 94 ac 72 call 0xe558 ; 0xe558 1b1e4: 66 ed ldi r22, 0xD6 ; 214 1b1e6: 7a e3 ldi r23, 0x3A ; 58 1b1e8: 0f 94 14 d4 call 0x3a828 ; 0x3a828 MENU_ITEM_SUBMENU_P(_T(MSG_PID_EXTRUDER), pid_extruder); 1b1ec: 82 e3 ldi r24, 0x32 ; 50 1b1ee: 95 e4 ldi r25, 0x45 ; 69 1b1f0: 0e 94 ac 72 call 0xe558 ; 0xe558 1b1f4: 62 e6 ldi r22, 0x62 ; 98 1b1f6: 79 e3 ldi r23, 0x39 ; 57 1b1f8: 0f 94 14 d4 call 0x3a828 ; 0x3a828 #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")); 1b1fc: 8e e1 ldi r24, 0x1E ; 30 1b1fe: 95 e4 ldi r25, 0x45 ; 69 1b200: 0e 94 ac 72 call 0xe558 ; 0xe558 1b204: 6b e1 ldi r22, 0x1B ; 27 1b206: 7a e8 ldi r23, 0x8A ; 138 1b208: 0f 94 8c d0 call 0x3a118 ; 0x3a118 #ifdef PINDA_THERMISTOR if(has_temperature_compensation()) 1b20c: 20 e0 ldi r18, 0x00 ; 0 1b20e: 30 e0 ldi r19, 0x00 ; 0 1b210: 40 e2 ldi r20, 0x20 ; 32 1b212: 51 e4 ldi r21, 0x41 ; 65 1b214: 60 91 99 03 lds r22, 0x0399 ; 0x800399 1b218: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 1b21c: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 1b220: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 1b224: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 1b228: 87 fd sbrc r24, 7 1b22a: 08 c0 rjmp .+16 ; 0x1b23c MENU_ITEM_FUNCTION_P(_T(MSG_PINDA_CALIBRATION), lcd_calibrate_pinda); 1b22c: 81 e1 ldi r24, 0x11 ; 17 1b22e: 95 e4 ldi r25, 0x45 ; 69 1b230: 0e 94 ac 72 call 0xe558 ; 0xe558 1b234: 63 ea ldi r22, 0xA3 ; 163 1b236: 7e ec ldi r23, 0xCE ; 206 1b238: 0f 94 13 d1 call 0x3a226 ; 0x3a226 #endif #ifdef THERMAL_MODEL MENU_ITEM_FUNCTION_P(_n("Thermal Model cal."), lcd_thermal_model_cal); 1b23c: 67 eb ldi r22, 0xB7 ; 183 1b23e: 7d ec ldi r23, 0xCD ; 205 1b240: 8b eb ldi r24, 0xBB ; 187 1b242: 9a e6 ldi r25, 0x6A ; 106 1b244: 0f 94 13 d1 call 0x3a226 ; 0x3a226 #endif //THERMAL_MODEL MENU_END(); 1b248: 0f 94 6a d1 call 0x3a2d4 ; 0x3a2d4 } #endif //TMC2130 static void lcd_calibration_menu() { MENU_BEGIN(); 1b24c: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1b250: 8f 5f subi r24, 0xFF ; 255 1b252: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1b256: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1b25a: 8f 5f subi r24, 0xFF ; 255 1b25c: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1b260: 6c cf rjmp .-296 ; 0x1b13a #ifdef THERMAL_MODEL MENU_ITEM_FUNCTION_P(_n("Thermal Model cal."), lcd_thermal_model_cal); #endif //THERMAL_MODEL MENU_END(); } 1b262: 08 95 ret 0001b264 : } #endif // TMC2130 } } static void menuitems_temperature_common() { 1b264: ef 92 push r14 1b266: ff 92 push r15 1b268: 0f 93 push r16 1b26a: 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); 1b26c: 80 e1 ldi r24, 0x10 ; 16 1b26e: 94 e4 ldi r25, 0x44 ; 68 1b270: 0e 94 ac 72 call 0xe558 ; 0xe558 1b274: 28 ec ldi r18, 0xC8 ; 200 1b276: e2 2e mov r14, r18 1b278: f1 2c mov r15, r1 1b27a: 07 e2 ldi r16, 0x27 ; 39 1b27c: 11 e0 ldi r17, 0x01 ; 1 1b27e: 30 e0 ldi r19, 0x00 ; 0 1b280: 20 e0 ldi r18, 0x00 ; 0 1b282: 40 e1 ldi r20, 0x10 ; 16 1b284: 66 eb ldi r22, 0xB6 ; 182 1b286: 7d e0 ldi r23, 0x0D ; 13 1b288: 0f 94 e6 d1 call 0x3a3cc ; 0x3a3cc #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); 1b28c: 85 ef ldi r24, 0xF5 ; 245 1b28e: 93 e4 ldi r25, 0x43 ; 67 1b290: 0e 94 ac 72 call 0xe558 ; 0xe558 1b294: 32 e3 ldi r19, 0x32 ; 50 1b296: e3 2e mov r14, r19 1b298: f1 2c mov r15, r1 1b29a: 08 e7 ldi r16, 0x78 ; 120 1b29c: 10 e0 ldi r17, 0x00 ; 0 1b29e: 30 e0 ldi r19, 0x00 ; 0 1b2a0: 20 e0 ldi r18, 0x00 ; 0 1b2a2: 40 e1 ldi r20, 0x10 ; 16 1b2a4: 62 e7 ldi r22, 0x72 ; 114 1b2a6: 76 e0 ldi r23, 0x06 ; 6 1b2a8: 0f 94 e6 d1 call 0x3a3cc ; 0x3a3cc #endif MENU_ITEM_EDIT_int3_jmp_P(_T(MSG_FAN_SPEED), &fanSpeed, 0, 255, LCD_JUMP_FAN_SPEED); 1b2ac: 89 ee ldi r24, 0xE9 ; 233 1b2ae: 93 e4 ldi r25, 0x43 ; 67 1b2b0: 0e 94 ac 72 call 0xe558 ; 0xe558 1b2b4: 4f e7 ldi r20, 0x7F ; 127 1b2b6: e4 2e mov r14, r20 1b2b8: f1 2c mov r15, r1 1b2ba: 0f ef ldi r16, 0xFF ; 255 1b2bc: 10 e0 ldi r17, 0x00 ; 0 1b2be: 30 e0 ldi r19, 0x00 ; 0 1b2c0: 20 e0 ldi r18, 0x00 ; 0 1b2c2: 48 e0 ldi r20, 0x08 ; 8 1b2c4: 67 ee ldi r22, 0xE7 ; 231 1b2c6: 73 e0 ldi r23, 0x03 ; 3 1b2c8: 0f 94 e6 d1 call 0x3a3cc ; 0x3a3cc } 1b2cc: 1f 91 pop r17 1b2ce: 0f 91 pop r16 1b2d0: ff 90 pop r15 1b2d2: ef 90 pop r14 1b2d4: 08 95 ret 0001b2d6 : } #endif //LCD_BL_PIN static void lcd_control_temperature_menu() { MENU_BEGIN(); 1b2d6: 0f 94 96 d1 call 0x3a32c ; 0x3a32c 1b2da: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1b2de: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1b2e2: 84 30 cpi r24, 0x04 ; 4 1b2e4: b8 f4 brcc .+46 ; 0x1b314 1b2e6: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); 1b2ea: 86 e4 ldi r24, 0x46 ; 70 1b2ec: 98 e4 ldi r25, 0x48 ; 72 1b2ee: 0e 94 ac 72 call 0xe558 ; 0xe558 1b2f2: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 menuitems_temperature_common(); 1b2f6: 0e 94 32 d9 call 0x1b264 ; 0x1b264 MENU_END(); 1b2fa: 0f 94 6a d1 call 0x3a2d4 ; 0x3a2d4 } #endif //LCD_BL_PIN static void lcd_control_temperature_menu() { MENU_BEGIN(); 1b2fe: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1b302: 8f 5f subi r24, 0xFF ; 255 1b304: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1b308: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1b30c: 8f 5f subi r24, 0xFF ; 255 1b30e: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1b312: e5 cf rjmp .-54 ; 0x1b2de MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); menuitems_temperature_common(); MENU_END(); } 1b314: 08 95 ret 0001b316 : #define MENU_ITEM_EDIT_advance_K() do { lcd_advance_K(); } while (0) #endif static void lcd_tune_menu() { 1b316: ef 92 push r14 1b318: ff 92 push r15 1b31a: 0f 93 push r16 1b31c: 1f 93 push r17 1b31e: cf 93 push r28 1b320: df 93 push r29 1b322: 80 91 bc 02 lds r24, 0x02BC ; 0x8002bc 1b326: 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) 1b32a: 20 91 b6 03 lds r18, 0x03B6 ; 0x8003b6 1b32e: 21 11 cpse r18, r1 1b330: 97 c0 rjmp .+302 ; 0x1b460 { // Menu was entered. Mark the menu as entered and save the current extrudemultiply value. _md->status = 1; 1b332: 21 e0 ldi r18, 0x01 ; 1 1b334: 20 93 b6 03 sts 0x03B6, r18 ; 0x8003b6 _md->extrudemultiply = extrudemultiply; 1b338: 90 93 b8 03 sts 0x03B8, r25 ; 0x8003b8 1b33c: 80 93 b7 03 sts 0x03B7, r24 ; 0x8003b7 // 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); 1b340: 8f ef ldi r24, 0xFF ; 255 1b342: 9f e0 ldi r25, 0x0F ; 15 1b344: 0f 94 1c dc call 0x3b838 ; 0x3b838 1b348: 80 93 a4 03 sts 0x03A4, r24 ; 0x8003a4 MENU_BEGIN(); 1b34c: 0f 94 96 d1 call 0x3a32c ; 0x3a32c 1b350: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1b354: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1b358: 84 30 cpi r24, 0x04 ; 4 1b35a: 08 f0 brcs .+2 ; 0x1b35e 1b35c: 99 c0 rjmp .+306 ; 0x1b490 1b35e: 10 92 15 05 sts 0x0515, r1 ; 0x800515 ON_MENU_LEAVE( 1b362: 0f 94 16 d0 call 0x3a02c ; 0x3a02c 1b366: 81 11 cpse r24, r1 1b368: 0e 94 e3 64 call 0xc9c6 ; 0xc9c6 refresh_saved_feedrate_multiplier_in_ram(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1b36c: 88 ea ldi r24, 0xA8 ; 168 1b36e: 98 e4 ldi r25, 0x48 ; 72 1b370: 0e 94 ac 72 call 0xe558 ; 0xe558 1b374: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 MENU_ITEM_EDIT_int3_P(_T(MSG_SPEED), &feedmultiply, 10, 999); 1b378: 8e ec ldi r24, 0xCE ; 206 1b37a: 97 e4 ldi r25, 0x47 ; 71 1b37c: 0e 94 ac 72 call 0xe558 ; 0xe558 1b380: f1 2c mov r15, r1 1b382: e1 2c mov r14, r1 1b384: 07 ee ldi r16, 0xE7 ; 231 1b386: 13 e0 ldi r17, 0x03 ; 3 1b388: 2a e0 ldi r18, 0x0A ; 10 1b38a: 30 e0 ldi r19, 0x00 ; 0 1b38c: 40 e1 ldi r20, 0x10 ; 16 1b38e: 69 e3 ldi r22, 0x39 ; 57 1b390: 72 e0 ldi r23, 0x02 ; 2 1b392: 0f 94 e6 d1 call 0x3a3cc ; 0x3a3cc menuitems_temperature_common(); 1b396: 0e 94 32 d9 call 0x1b264 ; 0x1b264 MENU_ITEM_EDIT_int3_P(_T(MSG_FLOW), &extrudemultiply, 10, 999); 1b39a: 87 ec ldi r24, 0xC7 ; 199 1b39c: 97 e4 ldi r25, 0x47 ; 71 1b39e: 0e 94 ac 72 call 0xe558 ; 0xe558 1b3a2: 2a e0 ldi r18, 0x0A ; 10 1b3a4: 30 e0 ldi r19, 0x00 ; 0 1b3a6: 40 e1 ldi r20, 0x10 ; 16 1b3a8: 6c eb ldi r22, 0xBC ; 188 1b3aa: 72 e0 ldi r23, 0x02 ; 2 1b3ac: 0f 94 e6 d1 call 0x3a3cc ; 0x3a3cc #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); 1b3b0: 85 eb ldi r24, 0xB5 ; 181 1b3b2: 97 e4 ldi r25, 0x47 ; 71 1b3b4: 0e 94 ac 72 call 0xe558 ; 0xe558 1b3b8: 65 e7 ldi r22, 0x75 ; 117 1b3ba: 74 ef ldi r23, 0xF4 ; 244 1b3bc: 0f 94 13 d1 call 0x3a226 ; 0x3a226 #endif if (printingIsPaused()) {// Don't allow rehome if actively printing. Maaaaybe it could work to insert on the fly, seems too risky. 1b3c0: 0e 94 85 67 call 0xcf0a ; 0xcf0a 1b3c4: 88 23 and r24, r24 1b3c6: 41 f0 breq .+16 ; 0x1b3d8 MENU_ITEM_GCODE_P(_T(MSG_AUTO_HOME),PSTR("G28 XY")); 1b3c8: 8b e0 ldi r24, 0x0B ; 11 1b3ca: 9c e5 ldi r25, 0x5C ; 92 1b3cc: 0e 94 ac 72 call 0xe558 ; 0xe558 1b3d0: 63 e3 ldi r22, 0x33 ; 51 1b3d2: 7a e8 ldi r23, 0x8A ; 138 1b3d4: 0f 94 8c d0 call 0x3a118 ; 0x3a118 } #ifdef FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_FSENSOR), lcd_fsensor_settings_menu); 1b3d8: 87 ea ldi r24, 0xA7 ; 167 1b3da: 97 e4 ldi r25, 0x47 ; 71 1b3dc: 0e 94 ac 72 call 0xe558 ; 0xe558 1b3e0: 69 e8 ldi r22, 0x89 ; 137 1b3e2: 72 ed ldi r23, 0xD2 ; 210 1b3e4: 0f 94 14 d4 call 0x3a828 ; 0x3a828 #endif //FILAMENT_SENSOR if (MMU2::mmu2.Enabled()) 1b3e8: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 1b3ec: 81 30 cpi r24, 0x01 ; 1 1b3ee: 11 f4 brne .+4 ; 0x1b3f4 { menuitems_MMU_settings_common(); 1b3f0: 0e 94 71 d1 call 0x1a2e2 ; 0x1a2e2 } SETTINGS_FANS_CHECK(); 1b3f4: 0e 94 f3 d0 call 0x1a1e6 ; 0x1a1e6 SETTINGS_SILENT_MODE(); 1b3f8: 0e 94 0d d1 call 0x1a21a ; 0x1a21a SETTINGS_SOUND; 1b3fc: 80 91 de 04 lds r24, 0x04DE ; 0x8004de 1b400: 82 30 cpi r24, 0x02 ; 2 1b402: 09 f4 brne .+2 ; 0x1b406 1b404: 3f c0 rjmp .+126 ; 0x1b484 1b406: 83 30 cpi r24, 0x03 ; 3 1b408: 09 f4 brne .+2 ; 0x1b40c 1b40a: 3f c0 rjmp .+126 ; 0x1b48a 1b40c: 81 30 cpi r24, 0x01 ; 1 1b40e: b9 f1 breq .+110 ; 0x1b47e 1b410: 80 ea ldi r24, 0xA0 ; 160 1b412: 97 e4 ldi r25, 0x47 ; 71 1b414: 0e 94 ac 72 call 0xe558 ; 0xe558 1b418: ec 01 movw r28, r24 1b41a: 88 e9 ldi r24, 0x98 ; 152 1b41c: 97 e4 ldi r25, 0x47 ; 71 1b41e: 0e 94 ac 72 call 0xe558 ; 0xe558 1b422: 22 e0 ldi r18, 0x02 ; 2 1b424: 44 ee ldi r20, 0xE4 ; 228 1b426: 5f ec ldi r21, 0xCF ; 207 1b428: be 01 movw r22, r28 1b42a: 0f 94 25 d3 call 0x3a64a ; 0x3a64a #ifdef LCD_BL_PIN if (backlightSupport) 1b42e: 80 91 02 04 lds r24, 0x0402 ; 0x800402 1b432: 88 23 and r24, r24 1b434: 41 f0 breq .+16 ; 0x1b446 { MENU_ITEM_SUBMENU_P(_T(MSG_BRIGHTNESS), lcd_backlight_menu); 1b436: 82 e7 ldi r24, 0x72 ; 114 1b438: 97 e4 ldi r25, 0x47 ; 71 1b43a: 0e 94 ac 72 call 0xe558 ; 0xe558 1b43e: 61 e0 ldi r22, 0x01 ; 1 1b440: 70 ee ldi r23, 0xE0 ; 224 1b442: 0f 94 14 d4 call 0x3a828 ; 0x3a828 } #endif //LCD_BL_PIN MENU_END(); 1b446: 0f 94 6a d1 call 0x3a2d4 ; 0x3a2d4 calculate_extruder_multipliers(); } SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 1b44a: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1b44e: 8f 5f subi r24, 0xFF ; 255 1b450: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1b454: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1b458: 8f 5f subi r24, 0xFF ; 255 1b45a: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1b45e: 7a cf rjmp .-268 ; 0x1b354 { // 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) 1b460: 20 91 b7 03 lds r18, 0x03B7 ; 0x8003b7 1b464: 30 91 b8 03 lds r19, 0x03B8 ; 0x8003b8 1b468: 28 17 cp r18, r24 1b46a: 39 07 cpc r19, r25 1b46c: 09 f4 brne .+2 ; 0x1b470 1b46e: 68 cf rjmp .-304 ; 0x1b340 { // extrudemultiply has been changed from the child menu. Apply the new value. _md->extrudemultiply = extrudemultiply; 1b470: 90 93 b8 03 sts 0x03B8, r25 ; 0x8003b8 1b474: 80 93 b7 03 sts 0x03B7, r24 ; 0x8003b7 calculate_extruder_multipliers(); 1b478: 0e 94 b9 65 call 0xcb72 ; 0xcb72 1b47c: 61 cf rjmp .-318 ; 0x1b340 menuitems_MMU_settings_common(); } SETTINGS_FANS_CHECK(); SETTINGS_SILENT_MODE(); SETTINGS_SOUND; 1b47e: 81 e9 ldi r24, 0x91 ; 145 1b480: 97 e4 ldi r25, 0x47 ; 71 1b482: c8 cf rjmp .-112 ; 0x1b414 1b484: 88 e8 ldi r24, 0x88 ; 136 1b486: 97 e4 ldi r25, 0x47 ; 71 1b488: c5 cf rjmp .-118 ; 0x1b414 1b48a: 8f e7 ldi r24, 0x7F ; 127 1b48c: 97 e4 ldi r25, 0x47 ; 71 1b48e: c2 cf rjmp .-124 ; 0x1b414 { MENU_ITEM_SUBMENU_P(_T(MSG_BRIGHTNESS), lcd_backlight_menu); } #endif //LCD_BL_PIN MENU_END(); } 1b490: df 91 pop r29 1b492: cf 91 pop r28 1b494: 1f 91 pop r17 1b496: 0f 91 pop r16 1b498: ff 90 pop r15 1b49a: ef 90 pop r14 1b49c: 08 95 ret 0001b49e : } } #if (LANG_MODE != 0) void lcd_language() { 1b49e: cf 93 push r28 1b4a0: df 93 push r29 lcd_update_enable(true); 1b4a2: 81 e0 ldi r24, 0x01 ; 1 1b4a4: 0e 94 25 6f call 0xde4a ; 0xde4a menu_goto(lcd_language_menu, 0, true, true); 1b4a8: 21 e0 ldi r18, 0x01 ; 1 1b4aa: 41 e0 ldi r20, 0x01 ; 1 1b4ac: 70 e0 ldi r23, 0x00 ; 0 1b4ae: 60 e0 ldi r22, 0x00 ; 0 1b4b0: 8f ec ldi r24, 0xCF ; 207 1b4b2: 92 ee ldi r25, 0xE2 ; 226 1b4b4: 0f 94 c0 d1 call 0x3a380 ; 0x3a380 1b4b8: 10 92 dc 03 sts 0x03DC, r1 ; 0x8003dc lcd_timeoutToStatus.stop(); //infinite timeout while ((menu_menu != lcd_status_screen) && (!lang_is_selected())) 1b4bc: c0 91 13 04 lds r28, 0x0413 ; 0x800413 1b4c0: d0 91 14 04 lds r29, 0x0414 ; 0x800414 1b4c4: 0e 94 1d 71 call 0xe23a ; 0xe23a 1b4c8: c8 51 subi r28, 0x18 ; 24 1b4ca: d9 43 sbci r29, 0x39 ; 57 1b4cc: 39 f0 breq .+14 ; 0x1b4dc 1b4ce: 81 11 cpse r24, r1 1b4d0: 07 c0 rjmp .+14 ; 0x1b4e0 { delay_keep_alive(50); 1b4d2: 82 e3 ldi r24, 0x32 ; 50 1b4d4: 90 e0 ldi r25, 0x00 ; 0 1b4d6: 0e 94 e4 8c call 0x119c8 ; 0x119c8 1b4da: f0 cf rjmp .-32 ; 0x1b4bc } if (lang_is_selected()) 1b4dc: 88 23 and r24, r24 1b4de: 21 f0 breq .+8 ; 0x1b4e8 lcd_return_to_status(); else lang_select(LANG_ID_PRI); } 1b4e0: df 91 pop r29 1b4e2: 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(); 1b4e4: 0d 94 a6 1e jmp 0x23d4c ; 0x23d4c else lang_select(LANG_ID_PRI); 1b4e8: 80 e0 ldi r24, 0x00 ; 0 } 1b4ea: df 91 pop r29 1b4ec: cf 91 pop r28 delay_keep_alive(50); } if (lang_is_selected()) lcd_return_to_status(); else lang_select(LANG_ID_PRI); 1b4ee: 0c 94 34 72 jmp 0xe468 ; 0xe468 0001b4f2 : } #endif //FANCHECK static uint8_t lcd_selftest_screen(TestScreen screen, uint8_t _progress, uint8_t _progress_scale, bool _clear, uint16_t _delay) { 1b4f2: bf 92 push r11 1b4f4: cf 92 push r12 1b4f6: df 92 push r13 1b4f8: ef 92 push r14 1b4fa: ff 92 push r15 1b4fc: 0f 93 push r16 1b4fe: 1f 93 push r17 1b500: cf 93 push r28 1b502: df 93 push r29 1b504: c8 2f mov r28, r24 1b506: f6 2e mov r15, r22 1b508: e4 2e mov r14, r20 1b50a: b2 2e mov r11, r18 1b50c: 68 01 movw r12, r16 lcd_update_enable(false); 1b50e: 80 e0 ldi r24, 0x00 ; 0 1b510: 0e 94 25 6f call 0xde4a ; 0xde4a const char _indicator = (_progress >= _progress_scale) ? '-' : '|'; 1b514: dc e7 ldi r29, 0x7C ; 124 1b516: fe 14 cp r15, r14 1b518: 08 f0 brcs .+2 ; 0x1b51c 1b51a: dd e2 ldi r29, 0x2D ; 45 if (_clear) 1b51c: bb 20 and r11, r11 1b51e: 09 f1 breq .+66 ; 0x1b562 lcd_clear(); 1b520: 0e 94 13 6f call 0xde26 ; 0xde26 else lcd_home(); if (screen == TestScreen::ExtruderFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 1b524: c1 11 cpse r28, r1 1b526: 20 c0 rjmp .+64 ; 0x1b568 if (screen == TestScreen::PrintFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); if (screen == TestScreen::FansOk) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 1b528: 8c e9 ldi r24, 0x9C ; 156 1b52a: 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)); 1b52c: 0e 94 ac 72 call 0xe558 ; 0xe558 1b530: 0e 94 cb 6e call 0xdd96 ; 0xdd96 if (screen == TestScreen::Hotend || screen == TestScreen::HotendOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_HOTEND)); 1b534: 88 ef ldi r24, 0xF8 ; 248 1b536: 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 1b538: 82 30 cpi r24, 0x02 ; 2 1b53a: 78 f5 brcc .+94 ; 0x1b59a || screen == TestScreen::HotendOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_HOTEND)); 1b53c: 82 e4 ldi r24, 0x42 ; 66 1b53e: 99 e4 ldi r25, 0x49 ; 73 1b540: 0e 94 ac 72 call 0xe558 ; 0xe558 1b544: 0e 94 cb 6e call 0xdd96 ; 0xdd96 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)); 1b548: 81 e2 ldi r24, 0x21 ; 33 1b54a: 99 e4 ldi r25, 0x49 ; 73 1b54c: cc 30 cpi r28, 0x0C ; 12 1b54e: 49 f1 breq .+82 ; 0x1b5a2 if (screen == TestScreen::Failed) lcd_puts_P(_T(MSG_SELFTEST_FAILED)); 1b550: 87 ea ldi r24, 0xA7 ; 167 1b552: 96 e5 ldi r25, 0x56 ; 86 1b554: cd 30 cpi r28, 0x0D ; 13 1b556: 29 f1 breq .+74 ; 0x1b5a2 if (screen == TestScreen::Home) lcd_puts_P(_T(MSG_CALIBRATING_HOME)); 1b558: ce 30 cpi r28, 0x0E ; 14 1b55a: 39 f5 brne .+78 ; 0x1b5aa 1b55c: 8e e0 ldi r24, 0x0E ; 14 1b55e: 99 e4 ldi r25, 0x49 ; 73 1b560: 20 c0 rjmp .+64 ; 0x1b5a2 lcd_update_enable(false); const char _indicator = (_progress >= _progress_scale) ? '-' : '|'; if (_clear) lcd_clear(); else lcd_home(); 1b562: 0e 94 0c 6f call 0xde18 ; 0xde18 1b566: de cf rjmp .-68 ; 0x1b524 if (screen == TestScreen::ExtruderFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); if (screen == TestScreen::PrintFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 1b568: c1 30 cpi r28, 0x01 ; 1 1b56a: f1 f2 breq .-68 ; 0x1b528 if (screen == TestScreen::FansOk) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 1b56c: c2 30 cpi r28, 0x02 ; 2 1b56e: e1 f2 breq .-72 ; 0x1b528 if (screen == TestScreen::EndStops) lcd_puts_P(_T(MSG_SELFTEST_CHECK_ENDSTOPS)); 1b570: 89 e9 ldi r24, 0x99 ; 153 1b572: 99 e4 ldi r25, 0x49 ; 73 1b574: c3 30 cpi r28, 0x03 ; 3 1b576: d1 f2 breq .-76 ; 0x1b52c if (screen == TestScreen::AxisX) lcd_puts_P(_T(MSG_CHECKING_X)); 1b578: 87 e8 ldi r24, 0x87 ; 135 1b57a: 99 e4 ldi r25, 0x49 ; 73 1b57c: c4 30 cpi r28, 0x04 ; 4 1b57e: b1 f2 breq .-84 ; 0x1b52c if (screen == TestScreen::AxisY) lcd_puts_P(_T(MSG_CHECKING_Y)); 1b580: 85 e7 ldi r24, 0x75 ; 117 1b582: 99 e4 ldi r25, 0x49 ; 73 1b584: c5 30 cpi r28, 0x05 ; 5 1b586: 91 f2 breq .-92 ; 0x1b52c if (screen == TestScreen::AxisZ) lcd_puts_P(_T(MSG_SELFTEST_CHECK_Z)); 1b588: 83 e6 ldi r24, 0x63 ; 99 1b58a: 99 e4 ldi r25, 0x49 ; 73 1b58c: c6 30 cpi r28, 0x06 ; 6 1b58e: 71 f2 breq .-100 ; 0x1b52c if (screen == TestScreen::Bed) lcd_puts_P(_T(MSG_SELFTEST_CHECK_BED)); 1b590: c7 30 cpi r28, 0x07 ; 7 1b592: 81 f6 brne .-96 ; 0x1b534 1b594: 84 e5 ldi r24, 0x54 ; 84 1b596: 99 e4 ldi r25, 0x49 ; 73 1b598: c9 cf rjmp .-110 ; 0x1b52c 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)); 1b59a: ca 30 cpi r28, 0x0A ; 10 1b59c: 99 f5 brne .+102 ; 0x1b604 if (screen == TestScreen::FsensorOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_FSENSOR)); 1b59e: 8f e2 ldi r24, 0x2F ; 47 1b5a0: 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)); 1b5a2: 0e 94 ac 72 call 0xe558 ; 0xe558 1b5a6: 0e 94 cb 6e call 0xdd96 ; 0xdd96 lcd_puts_at_P(0, 1, STR_SEPARATOR); 1b5aa: 4a e8 ldi r20, 0x8A ; 138 1b5ac: 5a e8 ldi r21, 0x8A ; 138 1b5ae: 61 e0 ldi r22, 0x01 ; 1 1b5b0: 80 e0 ldi r24, 0x00 ; 0 1b5b2: 0e 94 f4 6e call 0xdde8 ; 0xdde8 if ((screen >= TestScreen::ExtruderFan) && (screen <= TestScreen::FansOk)) 1b5b6: c3 30 cpi r28, 0x03 ; 3 1b5b8: 70 f5 brcc .+92 ; 0x1b616 { //SERIAL_ECHOLNPGM("Fan test"); lcd_puts_at_P(0, 2, _T(MSG_HOTEND_FAN_SPEED)); 1b5ba: 80 e0 ldi r24, 0x00 ; 0 1b5bc: 99 e4 ldi r25, 0x49 ; 73 1b5be: 0e 94 ac 72 call 0xe558 ; 0xe558 1b5c2: ac 01 movw r20, r24 1b5c4: 62 e0 ldi r22, 0x02 ; 2 1b5c6: 80 e0 ldi r24, 0x00 ; 0 1b5c8: 0e 94 f4 6e call 0xdde8 ; 0xdde8 lcd_set_cursor(18, 2); 1b5cc: 62 e0 ldi r22, 0x02 ; 2 1b5ce: 82 e1 ldi r24, 0x12 ; 18 1b5d0: 0e 94 e0 6e call 0xddc0 ; 0xddc0 (screen < TestScreen::PrintFan) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 1b5d4: c1 11 cpse r28, r1 1b5d6: 1a c0 rjmp .+52 ; 0x1b60c 1b5d8: 8d 2f mov r24, r29 1b5da: 0e 94 cf 6e call 0xdd9e ; 0xdd9e lcd_puts_at_P(0, 3, _T(MSG_PRINT_FAN_SPEED)); 1b5de: 83 ef ldi r24, 0xF3 ; 243 1b5e0: 98 e4 ldi r25, 0x48 ; 72 1b5e2: 0e 94 ac 72 call 0xe558 ; 0xe558 1b5e6: ac 01 movw r20, r24 1b5e8: 63 e0 ldi r22, 0x03 ; 3 1b5ea: 80 e0 ldi r24, 0x00 ; 0 1b5ec: 0e 94 f4 6e call 0xdde8 ; 0xdde8 lcd_set_cursor(18, 3); 1b5f0: 63 e0 ldi r22, 0x03 ; 3 1b5f2: 82 e1 ldi r24, 0x12 ; 18 1b5f4: 0e 94 e0 6e call 0xddc0 ; 0xddc0 (screen < TestScreen::FansOk) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 1b5f8: c2 30 cpi r28, 0x02 ; 2 1b5fa: 19 f1 breq .+70 ; 0x1b642 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); 1b5fc: 8d 2f mov r24, r29 1b5fe: 0e 94 cf 6e call 0xdd9e ; 0xdd9e 1b602: 23 c0 rjmp .+70 ; 0x1b64a 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)); 1b604: cb 30 cpi r28, 0x0B ; 11 1b606: 09 f0 breq .+2 ; 0x1b60a 1b608: 9f cf rjmp .-194 ; 0x1b548 1b60a: c9 cf rjmp .-110 ; 0x1b59e 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); 1b60c: 82 e8 ldi r24, 0x82 ; 130 1b60e: 9b e6 ldi r25, 0x6B ; 107 1b610: 0e 94 cb 6e call 0xdd96 ; 0xdd96 1b614: e4 cf rjmp .-56 ; 0x1b5de 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) 1b616: 86 ef ldi r24, 0xF6 ; 246 1b618: 8c 0f add r24, r28 1b61a: 82 30 cpi r24, 0x02 ; 2 1b61c: a8 f5 brcc .+106 ; 0x1b688 { lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR)); 1b61e: 89 eb ldi r24, 0xB9 ; 185 1b620: 96 e5 ldi r25, 0x56 ; 86 1b622: 0e 94 ac 72 call 0xe558 ; 0xe558 1b626: ac 01 movw r20, r24 1b628: 62 e0 ldi r22, 0x02 ; 2 1b62a: 80 e0 ldi r24, 0x00 ; 0 1b62c: 0e 94 f4 6e call 0xdde8 ; 0xdde8 lcd_putc(':'); 1b630: 8a e3 ldi r24, 0x3A ; 58 1b632: 0e 94 cf 6e call 0xdd9e ; 0xdd9e lcd_set_cursor(18, 2); 1b636: 62 e0 ldi r22, 0x02 ; 2 1b638: 82 e1 ldi r24, 0x12 ; 18 1b63a: 0e 94 e0 6e call 0xddc0 ; 0xddc0 (screen == TestScreen::Fsensor) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 1b63e: ca 30 cpi r28, 0x0A ; 10 1b640: e9 f2 breq .-70 ; 0x1b5fc 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); 1b642: 82 e8 ldi r24, 0x82 ; 130 1b644: 9b e6 ldi r25, 0x6B ; 107 1b646: 0e 94 cb 6e call 0xdd96 ; 0xdd96 _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); 1b64a: c1 14 cp r12, r1 1b64c: d1 04 cpc r13, r1 1b64e: 19 f0 breq .+6 ; 0x1b656 1b650: c6 01 movw r24, r12 1b652: 0e 94 e4 8c call 0x119c8 ; 0x119c8 _progress++; 1b656: 81 e0 ldi r24, 0x01 ; 1 1b658: 8f 0d add r24, r15 return (_progress >= _progress_scale * 2) ? 0 : _progress; 1b65a: 48 2f mov r20, r24 1b65c: 50 e0 ldi r21, 0x00 ; 0 1b65e: 92 e0 ldi r25, 0x02 ; 2 1b660: 24 e0 ldi r18, 0x04 ; 4 1b662: 30 e0 ldi r19, 0x00 ; 0 1b664: e9 16 cp r14, r25 1b666: 11 f0 breq .+4 ; 0x1b66c 1b668: 26 e0 ldi r18, 0x06 ; 6 1b66a: 30 e0 ldi r19, 0x00 ; 0 1b66c: 42 17 cp r20, r18 1b66e: 53 07 cpc r21, r19 1b670: 0c f0 brlt .+2 ; 0x1b674 1b672: 80 e0 ldi r24, 0x00 ; 0 } 1b674: df 91 pop r29 1b676: cf 91 pop r28 1b678: 1f 91 pop r17 1b67a: 0f 91 pop r16 1b67c: ff 90 pop r15 1b67e: ef 90 pop r14 1b680: df 90 pop r13 1b682: cf 90 pop r12 1b684: bf 90 pop r11 1b686: 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) 1b688: ca 30 cpi r28, 0x0A ; 10 1b68a: f8 f6 brcc .-66 ; 0x1b64a { //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); 1b68c: 41 e0 ldi r20, 0x01 ; 1 1b68e: c4 30 cpi r28, 0x04 ; 4 1b690: 21 f0 breq .+8 ; 0x1b69a 1b692: 42 e0 ldi r20, 0x02 ; 2 1b694: c3 30 cpi r28, 0x03 ; 3 1b696: 09 f4 brne .+2 ; 0x1b69a 1b698: 40 e0 ldi r20, 0x00 ; 0 1b69a: 0d 2f mov r16, r29 1b69c: 28 e8 ldi r18, 0x88 ; 136 1b69e: 3a e8 ldi r19, 0x8A ; 138 1b6a0: 62 e0 ldi r22, 0x02 ; 2 1b6a2: 82 e0 ldi r24, 0x02 ; 2 1b6a4: 0e 94 82 d0 call 0x1a104 ; 0x1a104 _step_block = TestScreen::AxisY; lcd_selftest_screen_step(2, 8, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Y"), _indicator); 1b6a8: 41 e0 ldi r20, 0x01 ; 1 1b6aa: c5 30 cpi r28, 0x05 ; 5 1b6ac: 21 f0 breq .+8 ; 0x1b6b6 1b6ae: 42 e0 ldi r20, 0x02 ; 2 1b6b0: c5 30 cpi r28, 0x05 ; 5 1b6b2: 08 f4 brcc .+2 ; 0x1b6b6 1b6b4: 40 e0 ldi r20, 0x00 ; 0 1b6b6: 0d 2f mov r16, r29 1b6b8: 26 e8 ldi r18, 0x86 ; 134 1b6ba: 3a e8 ldi r19, 0x8A ; 138 1b6bc: 68 e0 ldi r22, 0x08 ; 8 1b6be: 82 e0 ldi r24, 0x02 ; 2 1b6c0: 0e 94 82 d0 call 0x1a104 ; 0x1a104 _step_block = TestScreen::AxisZ; lcd_selftest_screen_step(2, 14, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Z"), _indicator); 1b6c4: 41 e0 ldi r20, 0x01 ; 1 1b6c6: c6 30 cpi r28, 0x06 ; 6 1b6c8: 21 f0 breq .+8 ; 0x1b6d2 1b6ca: 42 e0 ldi r20, 0x02 ; 2 1b6cc: c6 30 cpi r28, 0x06 ; 6 1b6ce: 08 f4 brcc .+2 ; 0x1b6d2 1b6d0: 40 e0 ldi r20, 0x00 ; 0 1b6d2: 0d 2f mov r16, r29 1b6d4: 24 e8 ldi r18, 0x84 ; 132 1b6d6: 3a e8 ldi r19, 0x8A ; 138 1b6d8: 6e e0 ldi r22, 0x0E ; 14 1b6da: 82 e0 ldi r24, 0x02 ; 2 1b6dc: 0e 94 82 d0 call 0x1a104 ; 0x1a104 _step_block = TestScreen::Bed; lcd_selftest_screen_step(3, 0, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Bed"), _indicator); 1b6e0: 41 e0 ldi r20, 0x01 ; 1 1b6e2: c7 30 cpi r28, 0x07 ; 7 1b6e4: 21 f0 breq .+8 ; 0x1b6ee 1b6e6: 42 e0 ldi r20, 0x02 ; 2 1b6e8: c7 30 cpi r28, 0x07 ; 7 1b6ea: 08 f4 brcc .+2 ; 0x1b6ee 1b6ec: 40 e0 ldi r20, 0x00 ; 0 1b6ee: 0d 2f mov r16, r29 1b6f0: 20 e8 ldi r18, 0x80 ; 128 1b6f2: 3a e8 ldi r19, 0x8A ; 138 1b6f4: 60 e0 ldi r22, 0x00 ; 0 1b6f6: 83 e0 ldi r24, 0x03 ; 3 1b6f8: 0e 94 82 d0 call 0x1a104 ; 0x1a104 _step_block = TestScreen::Hotend; lcd_selftest_screen_step(3, 9, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Hotend"), _indicator); 1b6fc: 41 e0 ldi r20, 0x01 ; 1 1b6fe: c8 30 cpi r28, 0x08 ; 8 1b700: 21 f0 breq .+8 ; 0x1b70a 1b702: 42 e0 ldi r20, 0x02 ; 2 1b704: c8 30 cpi r28, 0x08 ; 8 1b706: 08 f4 brcc .+2 ; 0x1b70a 1b708: 40 e0 ldi r20, 0x00 ; 0 1b70a: 0d 2f mov r16, r29 1b70c: 29 e7 ldi r18, 0x79 ; 121 1b70e: 3a e8 ldi r19, 0x8A ; 138 1b710: 69 e0 ldi r22, 0x09 ; 9 1b712: 83 e0 ldi r24, 0x03 ; 3 1b714: 0e 94 82 d0 call 0x1a104 ; 0x1a104 1b718: 98 cf rjmp .-208 ; 0x1b64a 0001b71a : { printf_P(MSG_HOST_ACTION_NOTIFICATION, message); } static void lcd_rename_sheet_menu() { 1b71a: cf 93 push r28 1b71c: 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) 1b71e: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 1b722: 81 11 cpse r24, r1 1b724: 18 c0 rjmp .+48 ; 0x1b756 { eeprom_read_block(menuData->name, EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); 1b726: 60 91 e2 03 lds r22, 0x03E2 ; 0x8003e2 1b72a: 8b e0 ldi r24, 0x0B ; 11 1b72c: 68 9f mul r22, r24 1b72e: b0 01 movw r22, r0 1b730: 11 24 eor r1, r1 1b732: 67 5b subi r22, 0xB7 ; 183 1b734: 72 4f sbci r23, 0xF2 ; 242 1b736: 47 e0 ldi r20, 0x07 ; 7 1b738: 50 e0 ldi r21, 0x00 ; 0 1b73a: 8b ea ldi r24, 0xAB ; 171 1b73c: 93 e0 ldi r25, 0x03 ; 3 1b73e: 0f 94 0c dc call 0x3b818 ; 0x3b818 lcd_encoder = menuData->name[0]; 1b742: 80 91 ab 03 lds r24, 0x03AB ; 0x8003ab 1b746: 90 e0 ldi r25, 0x00 ; 0 1b748: 90 93 71 06 sts 0x0671, r25 ; 0x800671 1b74c: 80 93 70 06 sts 0x0670, r24 ; 0x800670 menuData->initialized = true; 1b750: 81 e0 ldi r24, 0x01 ; 1 1b752: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 } if (lcd_encoder < 0x20) lcd_encoder = 0x20; 1b756: 80 91 70 06 lds r24, 0x0670 ; 0x800670 1b75a: 90 91 71 06 lds r25, 0x0671 ; 0x800671 1b75e: 80 97 sbiw r24, 0x20 ; 32 1b760: 34 f4 brge .+12 ; 0x1b76e 1b762: 80 e2 ldi r24, 0x20 ; 32 1b764: 90 e0 ldi r25, 0x00 ; 0 1b766: 90 93 71 06 sts 0x0671, r25 ; 0x800671 1b76a: 80 93 70 06 sts 0x0670, r24 ; 0x800670 if (lcd_encoder > 0xFF) lcd_encoder = 0xFF; 1b76e: 80 91 70 06 lds r24, 0x0670 ; 0x800670 1b772: 90 91 71 06 lds r25, 0x0671 ; 0x800671 1b776: 8f 3f cpi r24, 0xFF ; 255 1b778: 91 05 cpc r25, r1 1b77a: 39 f0 breq .+14 ; 0x1b78a 1b77c: 34 f0 brlt .+12 ; 0x1b78a 1b77e: 8f ef ldi r24, 0xFF ; 255 1b780: 90 e0 ldi r25, 0x00 ; 0 1b782: 90 93 71 06 sts 0x0671, r25 ; 0x800671 1b786: 80 93 70 06 sts 0x0670, r24 ; 0x800670 menuData->name[menuData->selected] = lcd_encoder; 1b78a: e0 91 aa 03 lds r30, 0x03AA ; 0x8003aa 1b78e: f0 e0 ldi r31, 0x00 ; 0 1b790: e7 55 subi r30, 0x57 ; 87 1b792: fc 4f sbci r31, 0xFC ; 252 1b794: 80 91 70 06 lds r24, 0x0670 ; 0x800670 1b798: 82 83 std Z+2, r24 ; 0x02 lcd_home(); 1b79a: 0e 94 0c 6f call 0xde18 ; 0xde18 1b79e: cb ea ldi r28, 0xAB ; 171 1b7a0: d3 e0 ldi r29, 0x03 ; 3 for (uint_least8_t i = 0; i < sizeof(Sheet::name); ++i) { lcd_putc(menuData->name[i]); 1b7a2: 89 91 ld r24, Y+ 1b7a4: 0e 94 cf 6e call 0xdd9e ; 0xdd9e 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) 1b7a8: 83 e0 ldi r24, 0x03 ; 3 1b7aa: c2 3b cpi r28, 0xB2 ; 178 1b7ac: d8 07 cpc r29, r24 1b7ae: c9 f7 brne .-14 ; 0x1b7a2 { lcd_putc(menuData->name[i]); } lcd_putc_at(menuData->selected, 1, '^'); 1b7b0: 4e e5 ldi r20, 0x5E ; 94 1b7b2: 61 e0 ldi r22, 0x01 ; 1 1b7b4: 80 91 aa 03 lds r24, 0x03AA ; 0x8003aa 1b7b8: 0e 94 00 6f call 0xde00 ; 0xde00 if (menuData->selected > 0) 1b7bc: 80 91 aa 03 lds r24, 0x03AA ; 0x8003aa 1b7c0: 88 23 and r24, r24 1b7c2: 29 f0 breq .+10 ; 0x1b7ce { lcd_putc_at(menuData->selected-1, 1, ' '); 1b7c4: 40 e2 ldi r20, 0x20 ; 32 1b7c6: 61 e0 ldi r22, 0x01 ; 1 1b7c8: 81 50 subi r24, 0x01 ; 1 1b7ca: 0e 94 00 6f call 0xde00 ; 0xde00 } if (lcd_clicked()) 1b7ce: 0e 94 fd 70 call 0xe1fa ; 0xe1fa 1b7d2: 88 23 and r24, r24 1b7d4: 99 f0 breq .+38 ; 0x1b7fc { if ((menuData->selected + 1u) < sizeof(Sheet::name)) 1b7d6: e0 91 aa 03 lds r30, 0x03AA ; 0x8003aa 1b7da: 8e 2f mov r24, r30 1b7dc: 90 e0 ldi r25, 0x00 ; 0 1b7de: 01 96 adiw r24, 0x01 ; 1 1b7e0: 07 97 sbiw r24, 0x07 ; 7 1b7e2: 78 f4 brcc .+30 ; 0x1b802 { lcd_encoder = menuData->name[++(menuData->selected)]; 1b7e4: ef 5f subi r30, 0xFF ; 255 1b7e6: e0 93 aa 03 sts 0x03AA, r30 ; 0x8003aa 1b7ea: f0 e0 ldi r31, 0x00 ; 0 1b7ec: e7 55 subi r30, 0x57 ; 87 1b7ee: fc 4f sbci r31, 0xFC ; 252 1b7f0: 82 81 ldd r24, Z+2 ; 0x02 1b7f2: 90 e0 ldi r25, 0x00 ; 0 1b7f4: 90 93 71 06 sts 0x0671, r25 ; 0x800671 1b7f8: 80 93 70 06 sts 0x0670, r24 ; 0x800670 EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); } } } 1b7fc: df 91 pop r29 1b7fe: cf 91 pop r28 1b800: 08 95 ret { lcd_encoder = menuData->name[++(menuData->selected)]; } else { eeprom_update_block_notify(menuData->name, 1b802: 60 91 e2 03 lds r22, 0x03E2 ; 0x8003e2 1b806: 8b e0 ldi r24, 0x0B ; 11 1b808: 68 9f mul r22, r24 1b80a: b0 01 movw r22, r0 1b80c: 11 24 eor r1, r1 1b80e: 67 5b subi r22, 0xB7 ; 183 1b810: 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); 1b812: 47 e0 ldi r20, 0x07 ; 7 1b814: 50 e0 ldi r21, 0x00 ; 0 1b816: 8b ea ldi r24, 0xAB ; 171 1b818: 93 e0 ldi r25, 0x03 ; 3 1b81a: 0f 94 30 dc call 0x3b860 ; 0x3b860 EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); } } } 1b81e: df 91 pop r29 1b820: cf 91 pop r28 else { eeprom_update_block_notify(menuData->name, EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); 1b822: 0d 94 5e d4 jmp 0x3a8bc ; 0x3a8bc 0001b826 : manage_inactivity(true); return _result; } static bool lcd_selfcheck_check_heater(bool _isbed) { 1b826: 8f 92 push r8 1b828: 9f 92 push r9 1b82a: af 92 push r10 1b82c: bf 92 push r11 1b82e: cf 92 push r12 1b830: df 92 push r13 1b832: ef 92 push r14 1b834: ff 92 push r15 1b836: 0f 93 push r16 1b838: 1f 93 push r17 1b83a: cf 93 push r28 1b83c: df 93 push r29 1b83e: f8 2e mov r15, r24 1b840: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 1b844: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 1b848: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 1b84c: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 1b850: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> 1b854: 4b 01 movw r8, r22 1b856: 6b 01 movw r12, r22 1b858: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee 1b85c: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef 1b860: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 1b864: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 1b868: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> 1b86c: eb 01 movw r28, r22 uint8_t _progress = 0; int _checked_snapshot = (_isbed) ? degBed() : degHotend(0); 1b86e: ff 20 and r15, r15 1b870: 09 f4 brne .+2 ; 0x1b874 1b872: a6 c0 rjmp .+332 ; 0x1b9c0 1b874: 6b 01 movw r12, r22 int _opposite_snapshot = (_isbed) ? degHotend(0) : degBed(); 1b876: e4 01 movw r28, r8 uint8_t _cycles = (_isbed) ? 180 : 60; //~ 90s / 30s 1b878: 24 eb ldi r18, 0xB4 ; 180 1b87a: 92 2e mov r9, r18 target_temperature[0] = (_isbed) ? 0 : 200; 1b87c: 90 e0 ldi r25, 0x00 ; 0 1b87e: 80 e0 ldi r24, 0x00 ; 0 1b880: 90 93 b7 0d sts 0x0DB7, r25 ; 0x800db7 1b884: 80 93 b6 0d sts 0x0DB6, r24 ; 0x800db6 target_temperature_bed = (_isbed) ? 100 : 0; 1b888: 84 e6 ldi r24, 0x64 ; 100 1b88a: 90 e0 ldi r25, 0x00 ; 0 1b88c: f1 10 cpse r15, r1 1b88e: 02 c0 rjmp .+4 ; 0x1b894 1b890: 90 e0 ldi r25, 0x00 ; 0 1b892: 80 e0 ldi r24, 0x00 ; 0 1b894: 90 93 73 06 sts 0x0673, r25 ; 0x800673 1b898: 80 93 72 06 sts 0x0672, r24 ; 0x800672 thermal_model::reinitialize(); } bool thermal_model_enabled() { return thermal_model::enabled; 1b89c: e0 90 1d 05 lds r14, 0x051D ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.456> #ifdef THERMAL_MODEL bool tm_was_enabled = thermal_model_enabled(); thermal_model_set_enabled(false); 1b8a0: 80 e0 ldi r24, 0x00 ; 0 1b8a2: 0f 94 3d 32 call 0x2647a ; 0x2647a #endif //THERMAL_MODEL manage_heater(); 1b8a6: 0f 94 5c 38 call 0x270b8 ; 0x270b8 manage_inactivity(true); 1b8aa: 81 e0 ldi r24, 0x01 ; 1 1b8ac: 0e 94 af 8a call 0x1155e ; 0x1155e for(uint8_t _counter = 0; _counter < _cycles && !Stopped; ++_counter) 1b8b0: b1 2c mov r11, r1 return _result; } static bool lcd_selfcheck_check_heater(bool _isbed) { uint8_t _progress = 0; 1b8b2: 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 1b8b4: 85 e0 ldi r24, 0x05 ; 5 1b8b6: 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) 1b8b8: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1b8bc: 81 11 cpse r24, r1 1b8be: 1c c0 rjmp .+56 ; 0x1b8f8 { manage_heater(); 1b8c0: 0f 94 5c 38 call 0x270b8 ; 0x270b8 manage_inactivity(true); 1b8c4: 81 e0 ldi r24, 0x01 ; 1 1b8c6: 0e 94 af 8a call 0x1155e ; 0x1155e _progress = (_isbed? 1b8ca: 00 e9 ldi r16, 0x90 ; 144 1b8cc: 11 e0 ldi r17, 0x01 ; 1 1b8ce: 20 e0 ldi r18, 0x00 ; 0 1b8d0: 42 e0 ldi r20, 0x02 ; 2 1b8d2: 6a 2d mov r22, r10 1b8d4: 87 e0 ldi r24, 0x07 ; 7 1b8d6: f1 10 cpse r15, r1 1b8d8: 01 c0 rjmp .+2 ; 0x1b8dc 1b8da: 88 e0 ldi r24, 0x08 ; 8 1b8dc: 0e 94 79 da call 0x1b4f2 ; 0x1b4f2 1b8e0: 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 1b8e2: 8b 2d mov r24, r11 1b8e4: 68 2d mov r22, r8 1b8e6: 0f 94 cb dc call 0x3b996 ; 0x3b996 <__udivmodqi4> 1b8ea: 91 11 cpse r25, r1 1b8ec: 02 c0 rjmp .+4 ; 0x1b8f2 1b8ee: 0e 94 5e 77 call 0xeebc ; 0xeebc thermal_model_set_enabled(false); #endif //THERMAL_MODEL manage_heater(); manage_inactivity(true); for(uint8_t _counter = 0; _counter < _cycles && !Stopped; ++_counter) 1b8f2: b3 94 inc r11 1b8f4: b9 10 cpse r11, r9 1b8f6: e0 cf rjmp .-64 ; 0x1b8b8 MYSERIAL.println(degHotend(0)); }*/ if(_counter%5 == 0) serialecho_temperatures(); //show temperatures once in two seconds } target_temperature[0] = 0; 1b8f8: 10 92 b7 0d sts 0x0DB7, r1 ; 0x800db7 1b8fc: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 target_temperature_bed = 0; 1b900: 10 92 73 06 sts 0x0673, r1 ; 0x800673 1b904: 10 92 72 06 sts 0x0672, r1 ; 0x800672 manage_heater(); 1b908: 0f 94 5c 38 call 0x270b8 ; 0x270b8 1b90c: b6 01 movw r22, r12 1b90e: dd 0c add r13, r13 1b910: 88 0b sbc r24, r24 1b912: 99 0b sbc r25, r25 1b914: 4e 01 movw r8, r28 1b916: dd 0f add r29, r29 1b918: aa 08 sbc r10, r10 1b91a: bb 08 sbc r11, r11 int _checked_result = (_isbed) ? degBed() - _checked_snapshot : degHotend(0) - _checked_snapshot; 1b91c: ff 20 and r15, r15 1b91e: 09 f4 brne .+2 ; 0x1b922 1b920: 54 c0 rjmp .+168 ; 0x1b9ca 1b922: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 1b926: 9b 01 movw r18, r22 1b928: ac 01 movw r20, r24 1b92a: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee 1b92e: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef 1b932: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 1b936: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 1b93a: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 1b93e: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> 1b942: eb 01 movw r28, r22 int _opposite_result = (_isbed) ? degHotend(0) - _opposite_snapshot : degBed() - _opposite_snapshot; 1b944: c5 01 movw r24, r10 1b946: b4 01 movw r22, r8 1b948: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 1b94c: 9b 01 movw r18, r22 1b94e: ac 01 movw r20, r24 1b950: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 1b954: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 1b958: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 1b95c: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 1b960: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 1b964: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) 1b968: 10 91 11 05 lds r17, 0x0511 ; 0x800511 1b96c: 11 11 cpse r17, r1 1b96e: 0c c0 rjmp .+24 ; 0x1b988 1b970: f1 10 cpse r15, r1 1b972: 4b c0 rjmp .+150 ; 0x1ba0a 1b974: 69 30 cpi r22, 0x09 ; 9 1b976: 71 05 cpc r23, r1 1b978: 0c f0 brlt .+2 ; 0x1b97c 1b97a: 4d c0 rjmp .+154 ; 0x1ba16 { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 1b97c: 8e e1 ldi r24, 0x1E ; 30 1b97e: 90 e0 ldi r25, 0x00 ; 0 _stepresult = true; 1b980: 11 e0 ldi r17, 0x01 ; 1 */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 1b982: c8 17 cp r28, r24 1b984: d9 07 cpc r29, r25 1b986: 34 f4 brge .+12 ; 0x1b994 _stepresult = true; else lcd_selftest_error(TestError::Heater, "", ""); 1b988: 68 ef ldi r22, 0xF8 ; 248 1b98a: 72 e0 ldi r23, 0x02 ; 2 1b98c: 80 e0 ldi r24, 0x00 ; 0 1b98e: 0f 94 6e 9f call 0x33edc ; 0x33edc MYSERIAL.println(_checked_result); MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; 1b992: 10 e0 ldi r17, 0x00 ; 0 { lcd_selftest_error(TestError::Bed, "", ""); } #ifdef THERMAL_MODEL thermal_model_set_enabled(tm_was_enabled); 1b994: 8e 2d mov r24, r14 1b996: 0f 94 3d 32 call 0x2647a ; 0x2647a #endif //THERMAL_MODEL manage_heater(); 1b99a: 0f 94 5c 38 call 0x270b8 ; 0x270b8 manage_inactivity(true); 1b99e: 81 e0 ldi r24, 0x01 ; 1 1b9a0: 0e 94 af 8a call 0x1155e ; 0x1155e return _stepresult; } 1b9a4: 81 2f mov r24, r17 1b9a6: df 91 pop r29 1b9a8: cf 91 pop r28 1b9aa: 1f 91 pop r17 1b9ac: 0f 91 pop r16 1b9ae: ff 90 pop r15 1b9b0: ef 90 pop r14 1b9b2: df 90 pop r13 1b9b4: cf 90 pop r12 1b9b6: bf 90 pop r11 1b9b8: af 90 pop r10 1b9ba: 9f 90 pop r9 1b9bc: 8f 90 pop r8 1b9be: 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 1b9c0: 9c e3 ldi r25, 0x3C ; 60 1b9c2: 99 2e mov r9, r25 target_temperature[0] = (_isbed) ? 0 : 200; 1b9c4: 88 ec ldi r24, 0xC8 ; 200 1b9c6: 90 e0 ldi r25, 0x00 ; 0 1b9c8: 5b cf rjmp .-330 ; 0x1b880 target_temperature[0] = 0; target_temperature_bed = 0; manage_heater(); int _checked_result = (_isbed) ? degBed() - _checked_snapshot : degHotend(0) - _checked_snapshot; 1b9ca: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 1b9ce: 9b 01 movw r18, r22 1b9d0: ac 01 movw r20, r24 1b9d2: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 1b9d6: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 1b9da: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 1b9de: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 1b9e2: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 1b9e6: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> 1b9ea: eb 01 movw r28, r22 int _opposite_result = (_isbed) ? degHotend(0) - _opposite_snapshot : degBed() - _opposite_snapshot; 1b9ec: c5 01 movw r24, r10 1b9ee: b4 01 movw r22, r8 1b9f0: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 1b9f4: 9b 01 movw r18, r22 1b9f6: ac 01 movw r20, r24 1b9f8: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee 1b9fc: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef 1ba00: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 1ba04: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 1ba08: ab cf rjmp .-170 ; 0x1b960 */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 1ba0a: 89 e0 ldi r24, 0x09 ; 9 1ba0c: 90 e0 ldi r25, 0x00 ; 0 MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) 1ba0e: 6e 31 cpi r22, 0x1E ; 30 1ba10: 71 05 cpc r23, r1 1ba12: 0c f4 brge .+2 ; 0x1ba16 1ba14: b5 cf rjmp .-150 ; 0x1b980 else lcd_selftest_error(TestError::Heater, "", ""); } else { lcd_selftest_error(TestError::Bed, "", ""); 1ba16: 68 ef ldi r22, 0xF8 ; 248 1ba18: 72 e0 ldi r23, 0x02 ; 2 1ba1a: 81 e0 ldi r24, 0x01 ; 1 1ba1c: 0f 94 6e 9f call 0x33edc ; 0x33edc 1ba20: b9 cf rjmp .-142 ; 0x1b994 0001ba22 : return(_result); } #ifdef TMC2130 static void reset_crash_det(uint8_t axis) { 1ba22: cf 93 push r28 1ba24: df 93 push r29 current_position[axis] += 10; 1ba26: 94 e0 ldi r25, 0x04 ; 4 1ba28: 89 9f mul r24, r25 1ba2a: e0 01 movw r28, r0 1ba2c: 11 24 eor r1, r1 1ba2e: ce 56 subi r28, 0x6E ; 110 1ba30: d9 4f sbci r29, 0xF9 ; 249 1ba32: 20 e0 ldi r18, 0x00 ; 0 1ba34: 30 e0 ldi r19, 0x00 ; 0 1ba36: 40 e2 ldi r20, 0x20 ; 32 1ba38: 51 e4 ldi r21, 0x41 ; 65 1ba3a: 68 81 ld r22, Y 1ba3c: 79 81 ldd r23, Y+1 ; 0x01 1ba3e: 8a 81 ldd r24, Y+2 ; 0x02 1ba40: 9b 81 ldd r25, Y+3 ; 0x03 1ba42: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 1ba46: 68 83 st Y, r22 1ba48: 79 83 std Y+1, r23 ; 0x01 1ba4a: 8a 83 std Y+2, r24 ; 0x02 1ba4c: 9b 83 std Y+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1ba4e: 60 e0 ldi r22, 0x00 ; 0 1ba50: 70 e0 ldi r23, 0x00 ; 0 1ba52: 84 e3 ldi r24, 0x34 ; 52 1ba54: 92 e4 ldi r25, 0x42 ; 66 1ba56: 0f 94 49 c0 call 0x38092 ; 0x38092 st_synchronize(); 1ba5a: 0f 94 e8 42 call 0x285d0 ; 0x285d0 crashdet_use_eeprom_setting(); } 1ba5e: df 91 pop r29 1ba60: 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(); 1ba62: 0d 94 55 26 jmp 0x24caa ; 0x24caa 0001ba66 : } static bool lcd_selfcheck_axis_sg(uint8_t axis) { 1ba66: 2f 92 push r2 1ba68: 3f 92 push r3 1ba6a: 4f 92 push r4 1ba6c: 5f 92 push r5 1ba6e: 6f 92 push r6 1ba70: 7f 92 push r7 1ba72: 8f 92 push r8 1ba74: 9f 92 push r9 1ba76: af 92 push r10 1ba78: bf 92 push r11 1ba7a: cf 92 push r12 1ba7c: df 92 push r13 1ba7e: ef 92 push r14 1ba80: ff 92 push r15 1ba82: 1f 93 push r17 1ba84: cf 93 push r28 1ba86: df 93 push r29 1ba88: 00 d0 rcall .+0 ; 0x1ba8a 1ba8a: 00 d0 rcall .+0 ; 0x1ba8c 1ba8c: 1f 92 push r1 1ba8e: cd b7 in r28, 0x3d ; 61 1ba90: de b7 in r29, 0x3e ; 62 1ba92: 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) { 1ba94: 68 2e mov r6, r24 1ba96: 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; 1ba98: 81 2c mov r8, r1 1ba9a: 20 e8 ldi r18, 0x80 ; 128 1ba9c: 92 2e mov r9, r18 1ba9e: 2c e5 ldi r18, 0x5C ; 92 1baa0: a2 2e mov r10, r18 1baa2: 23 e4 ldi r18, 0x43 ; 67 1baa4: 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) { 1baa6: 81 30 cpi r24, 0x01 ; 1 1baa8: 31 f0 breq .+12 ; 0x1bab6 case 0: axis_length = X_MAX_POS; break; 1baaa: 81 2c mov r8, r1 1baac: 91 2c mov r9, r1 1baae: 9f e7 ldi r25, 0x7F ; 127 1bab0: a9 2e mov r10, r25 1bab2: 93 e4 ldi r25, 0x43 ; 67 1bab4: 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; 1bab6: 10 92 5c 02 sts 0x025C, r1 ; 0x80025c tmc2130_home_exit(); 1baba: 0f 94 a9 25 call 0x24b52 ; 0x24b52 1babe: 81 e0 ldi r24, 0x01 ; 1 1bac0: 80 93 b7 02 sts 0x02B7, r24 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> enable_endstops(true); raise_z_above(MESH_HOME_Z_SEARCH); 1bac4: 60 e0 ldi r22, 0x00 ; 0 1bac6: 70 e0 ldi r23, 0x00 ; 0 1bac8: 80 ea ldi r24, 0xA0 ; 160 1baca: 90 e4 ldi r25, 0x40 ; 64 1bacc: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 tmc2130_home_enter(1 << axis); 1bad0: 81 e0 ldi r24, 0x01 ; 1 1bad2: 01 2e mov r0, r17 1bad4: 01 c0 rjmp .+2 ; 0x1bad8 1bad6: 88 0f add r24, r24 1bad8: 0a 94 dec r0 1bada: ea f7 brpl .-6 ; 0x1bad6 1badc: 0f 94 d8 25 call 0x24bb0 ; 0x24bb0 // first axis length measurement begin current_position[axis] -= (axis_length + margin); 1bae0: 20 e0 ldi r18, 0x00 ; 0 1bae2: 30 e0 ldi r19, 0x00 ; 0 1bae4: 40 e7 ldi r20, 0x70 ; 112 1bae6: 52 e4 ldi r21, 0x42 ; 66 1bae8: c5 01 movw r24, r10 1baea: b4 01 movw r22, r8 1baec: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 1baf0: 69 83 std Y+1, r22 ; 0x01 1baf2: 7a 83 std Y+2, r23 ; 0x02 1baf4: 8b 83 std Y+3, r24 ; 0x03 1baf6: 9c 83 std Y+4, r25 ; 0x04 1baf8: 13 01 movw r2, r6 1bafa: 22 0c add r2, r2 1bafc: 33 1c adc r3, r3 1bafe: 22 0c add r2, r2 1bb00: 33 1c adc r3, r3 1bb02: c1 01 movw r24, r2 1bb04: 8e 56 subi r24, 0x6E ; 110 1bb06: 99 4f sbci r25, 0xF9 ; 249 1bb08: 9e 83 std Y+6, r25 ; 0x06 1bb0a: 8d 83 std Y+5, r24 ; 0x05 1bb0c: 29 81 ldd r18, Y+1 ; 0x01 1bb0e: 3a 81 ldd r19, Y+2 ; 0x02 1bb10: 4b 81 ldd r20, Y+3 ; 0x03 1bb12: 5c 81 ldd r21, Y+4 ; 0x04 1bb14: fc 01 movw r30, r24 1bb16: 60 81 ld r22, Z 1bb18: 71 81 ldd r23, Z+1 ; 0x01 1bb1a: 82 81 ldd r24, Z+2 ; 0x02 1bb1c: 93 81 ldd r25, Z+3 ; 0x03 1bb1e: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 1bb22: ed 81 ldd r30, Y+5 ; 0x05 1bb24: fe 81 ldd r31, Y+6 ; 0x06 1bb26: 60 83 st Z, r22 1bb28: 71 83 std Z+1, r23 ; 0x01 1bb2a: 82 83 std Z+2, r24 ; 0x02 1bb2c: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1bb2e: 60 e0 ldi r22, 0x00 ; 0 1bb30: 70 e0 ldi r23, 0x00 ; 0 1bb32: 84 e3 ldi r24, 0x34 ; 52 1bb34: 92 e4 ldi r25, 0x42 ; 66 1bb36: 0f 94 49 c0 call 0x38092 ; 0x38092 st_synchronize(); 1bb3a: 0f 94 e8 42 call 0x285d0 ; 0x285d0 #endif } void tmc2130_sg_measure_start(uint8_t axis) { tmc2130_sg_measure = axis; 1bb3e: 10 93 3b 02 sts 0x023B, r17 ; 0x80023b <_ZL18tmc2130_sg_measure.lto_priv.473> tmc2130_sg_measure_cnt = 0; 1bb42: 10 92 cd 03 sts 0x03CD, r1 ; 0x8003cd <_ZL22tmc2130_sg_measure_cnt.lto_priv.475> 1bb46: 10 92 ce 03 sts 0x03CE, r1 ; 0x8003ce <_ZL22tmc2130_sg_measure_cnt.lto_priv.475+0x1> 1bb4a: 10 92 cf 03 sts 0x03CF, r1 ; 0x8003cf <_ZL22tmc2130_sg_measure_cnt.lto_priv.475+0x2> 1bb4e: 10 92 d0 03 sts 0x03D0, r1 ; 0x8003d0 <_ZL22tmc2130_sg_measure_cnt.lto_priv.475+0x3> tmc2130_sg_measure_val = 0; 1bb52: 10 92 d1 03 sts 0x03D1, r1 ; 0x8003d1 <_ZL22tmc2130_sg_measure_val.lto_priv.474> 1bb56: 10 92 d2 03 sts 0x03D2, r1 ; 0x8003d2 <_ZL22tmc2130_sg_measure_val.lto_priv.474+0x1> 1bb5a: 10 92 d3 03 sts 0x03D3, r1 ; 0x8003d3 <_ZL22tmc2130_sg_measure_val.lto_priv.474+0x2> 1bb5e: 10 92 d4 03 sts 0x03D4, r1 ; 0x8003d4 <_ZL22tmc2130_sg_measure_val.lto_priv.474+0x3> tmc2130_sg_measure_start(axis); current_position_init = st_get_position_mm(axis); 1bb62: 81 2f mov r24, r17 1bb64: 0f 94 d4 42 call 0x285a8 ; 0x285a8 1bb68: 6b 01 movw r12, r22 1bb6a: 7c 01 movw r14, r24 current_position[axis] += 2 * margin; 1bb6c: 20 e0 ldi r18, 0x00 ; 0 1bb6e: 30 e0 ldi r19, 0x00 ; 0 1bb70: 40 ef ldi r20, 0xF0 ; 240 1bb72: 52 e4 ldi r21, 0x42 ; 66 1bb74: ed 81 ldd r30, Y+5 ; 0x05 1bb76: fe 81 ldd r31, Y+6 ; 0x06 1bb78: 60 81 ld r22, Z 1bb7a: 71 81 ldd r23, Z+1 ; 0x01 1bb7c: 82 81 ldd r24, Z+2 ; 0x02 1bb7e: 93 81 ldd r25, Z+3 ; 0x03 1bb80: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 1bb84: ed 81 ldd r30, Y+5 ; 0x05 1bb86: fe 81 ldd r31, Y+6 ; 0x06 1bb88: 60 83 st Z, r22 1bb8a: 71 83 std Z+1, r23 ; 0x01 1bb8c: 82 83 std Z+2, r24 ; 0x02 1bb8e: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1bb90: 60 e0 ldi r22, 0x00 ; 0 1bb92: 70 e0 ldi r23, 0x00 ; 0 1bb94: 84 e3 ldi r24, 0x34 ; 52 1bb96: 92 e4 ldi r25, 0x42 ; 66 1bb98: 0f 94 49 c0 call 0x38092 ; 0x38092 st_synchronize(); 1bb9c: 0f 94 e8 42 call 0x285d0 ; 0x285d0 current_position[axis] += axis_length; 1bba0: a5 01 movw r20, r10 1bba2: 94 01 movw r18, r8 1bba4: ed 81 ldd r30, Y+5 ; 0x05 1bba6: fe 81 ldd r31, Y+6 ; 0x06 1bba8: 60 81 ld r22, Z 1bbaa: 71 81 ldd r23, Z+1 ; 0x01 1bbac: 82 81 ldd r24, Z+2 ; 0x02 1bbae: 93 81 ldd r25, Z+3 ; 0x03 1bbb0: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 1bbb4: ed 81 ldd r30, Y+5 ; 0x05 1bbb6: fe 81 ldd r31, Y+6 ; 0x06 1bbb8: 60 83 st Z, r22 1bbba: 71 83 std Z+1, r23 ; 0x01 1bbbc: 82 83 std Z+2, r24 ; 0x02 1bbbe: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1bbc0: 60 e0 ldi r22, 0x00 ; 0 1bbc2: 70 e0 ldi r23, 0x00 ; 0 1bbc4: 84 e3 ldi r24, 0x34 ; 52 1bbc6: 92 e4 ldi r25, 0x42 ; 66 1bbc8: 0f 94 49 c0 call 0x38092 ; 0x38092 st_synchronize(); 1bbcc: 0f 94 e8 42 call 0x285d0 ; 0x285d0 } uint16_t tmc2130_sg_measure_stop() { tmc2130_sg_measure = 0xff; 1bbd0: 8f ef ldi r24, 0xFF ; 255 1bbd2: 80 93 3b 02 sts 0x023B, r24 ; 0x80023b <_ZL18tmc2130_sg_measure.lto_priv.473> return tmc2130_sg_measure_val / tmc2130_sg_measure_cnt; 1bbd6: 60 91 d1 03 lds r22, 0x03D1 ; 0x8003d1 <_ZL22tmc2130_sg_measure_val.lto_priv.474> 1bbda: 70 91 d2 03 lds r23, 0x03D2 ; 0x8003d2 <_ZL22tmc2130_sg_measure_val.lto_priv.474+0x1> 1bbde: 80 91 d3 03 lds r24, 0x03D3 ; 0x8003d3 <_ZL22tmc2130_sg_measure_val.lto_priv.474+0x2> 1bbe2: 90 91 d4 03 lds r25, 0x03D4 ; 0x8003d4 <_ZL22tmc2130_sg_measure_val.lto_priv.474+0x3> 1bbe6: 20 91 cd 03 lds r18, 0x03CD ; 0x8003cd <_ZL22tmc2130_sg_measure_cnt.lto_priv.475> 1bbea: 30 91 ce 03 lds r19, 0x03CE ; 0x8003ce <_ZL22tmc2130_sg_measure_cnt.lto_priv.475+0x1> 1bbee: 40 91 cf 03 lds r20, 0x03CF ; 0x8003cf <_ZL22tmc2130_sg_measure_cnt.lto_priv.475+0x2> 1bbf2: 50 91 d0 03 lds r21, 0x03D0 ; 0x8003d0 <_ZL22tmc2130_sg_measure_cnt.lto_priv.475+0x3> 1bbf6: 0f 94 8f dc call 0x3b91e ; 0x3b91e <__udivmodsi4> 1bbfa: 2d 83 std Y+5, r18 ; 0x05 1bbfc: 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); 1bbfe: 3f 93 push r19 1bc00: 2f 93 push r18 1bc02: f8 e5 ldi r31, 0x58 ; 88 1bc04: 6f 0e add r6, r31 1bc06: 71 1c adc r7, r1 1bc08: 7f 92 push r7 1bc0a: 6f 92 push r6 1bc0c: 89 e6 ldi r24, 0x69 ; 105 1bc0e: 9a e8 ldi r25, 0x8A ; 138 1bc10: 9f 93 push r25 1bc12: 8f 93 push r24 1bc14: 0f 94 de da call 0x3b5bc ; 0x3b5bc eeprom_write_word_notify(((uint16_t*)((axis == X_AXIS)?EEPROM_BELTSTATUS_X:EEPROM_BELTSTATUS_Y)), sg1); 1bc18: 0f 90 pop r0 1bc1a: 0f 90 pop r0 1bc1c: 0f 90 pop r0 1bc1e: 0f 90 pop r0 1bc20: 0f 90 pop r0 1bc22: 0f 90 pop r0 1bc24: 8b e5 ldi r24, 0x5B ; 91 1bc26: 9f e0 ldi r25, 0x0F ; 15 1bc28: 11 11 cpse r17, r1 1bc2a: 02 c0 rjmp .+4 ; 0x1bc30 1bc2c: 8d e5 ldi r24, 0x5D ; 93 1bc2e: 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); 1bc30: 6d 81 ldd r22, Y+5 ; 0x05 1bc32: 7f 81 ldd r23, Y+7 ; 0x07 1bc34: 0f 94 7a dc call 0x3b8f4 ; 0x3b8f4 current_position_final = st_get_position_mm(axis); 1bc38: 81 2f mov r24, r17 1bc3a: 0f 94 d4 42 call 0x285a8 ; 0x285a8 1bc3e: 2b 01 movw r4, r22 1bc40: 3c 01 movw r6, r24 measured_axis_length[0] = fabs(current_position_final - current_position_init); 1bc42: a7 01 movw r20, r14 1bc44: 96 01 movw r18, r12 1bc46: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 1bc4a: 6b 01 movw r12, r22 1bc4c: 7c 01 movw r14, r24 1bc4e: e8 94 clt 1bc50: f7 f8 bld r15, 7 // first measurement end and second measurement begin current_position[axis] -= margin; 1bc52: c1 01 movw r24, r2 1bc54: 8e 56 subi r24, 0x6E ; 110 1bc56: 99 4f sbci r25, 0xF9 ; 249 1bc58: 9e 83 std Y+6, r25 ; 0x06 1bc5a: 8d 83 std Y+5, r24 ; 0x05 1bc5c: 20 e0 ldi r18, 0x00 ; 0 1bc5e: 30 e0 ldi r19, 0x00 ; 0 1bc60: 40 e7 ldi r20, 0x70 ; 112 1bc62: 52 e4 ldi r21, 0x42 ; 66 1bc64: fc 01 movw r30, r24 1bc66: 60 81 ld r22, Z 1bc68: 71 81 ldd r23, Z+1 ; 0x01 1bc6a: 82 81 ldd r24, Z+2 ; 0x02 1bc6c: 93 81 ldd r25, Z+3 ; 0x03 1bc6e: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 1bc72: ed 81 ldd r30, Y+5 ; 0x05 1bc74: fe 81 ldd r31, Y+6 ; 0x06 1bc76: 60 83 st Z, r22 1bc78: 71 83 std Z+1, r23 ; 0x01 1bc7a: 82 83 std Z+2, r24 ; 0x02 1bc7c: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1bc7e: 60 e0 ldi r22, 0x00 ; 0 1bc80: 70 e0 ldi r23, 0x00 ; 0 1bc82: 84 e3 ldi r24, 0x34 ; 52 1bc84: 92 e4 ldi r25, 0x42 ; 66 1bc86: 0f 94 49 c0 call 0x38092 ; 0x38092 st_synchronize(); 1bc8a: 0f 94 e8 42 call 0x285d0 ; 0x285d0 current_position[axis] -= (axis_length + margin); 1bc8e: 29 81 ldd r18, Y+1 ; 0x01 1bc90: 3a 81 ldd r19, Y+2 ; 0x02 1bc92: 4b 81 ldd r20, Y+3 ; 0x03 1bc94: 5c 81 ldd r21, Y+4 ; 0x04 1bc96: ed 81 ldd r30, Y+5 ; 0x05 1bc98: fe 81 ldd r31, Y+6 ; 0x06 1bc9a: 60 81 ld r22, Z 1bc9c: 71 81 ldd r23, Z+1 ; 0x01 1bc9e: 82 81 ldd r24, Z+2 ; 0x02 1bca0: 93 81 ldd r25, Z+3 ; 0x03 1bca2: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 1bca6: ed 81 ldd r30, Y+5 ; 0x05 1bca8: fe 81 ldd r31, Y+6 ; 0x06 1bcaa: 60 83 st Z, r22 1bcac: 71 83 std Z+1, r23 ; 0x01 1bcae: 82 83 std Z+2, r24 ; 0x02 1bcb0: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1bcb2: 60 e0 ldi r22, 0x00 ; 0 1bcb4: 70 e0 ldi r23, 0x00 ; 0 1bcb6: 84 e3 ldi r24, 0x34 ; 52 1bcb8: 92 e4 ldi r25, 0x42 ; 66 1bcba: 0f 94 49 c0 call 0x38092 ; 0x38092 st_synchronize(); 1bcbe: 0f 94 e8 42 call 0x285d0 ; 0x285d0 current_position_init = st_get_position_mm(axis); 1bcc2: 81 2f mov r24, r17 1bcc4: 0f 94 d4 42 call 0x285a8 ; 0x285a8 1bcc8: 9b 01 movw r18, r22 1bcca: ac 01 movw r20, r24 measured_axis_length[1] = fabs(current_position_final - current_position_init); 1bccc: c3 01 movw r24, r6 1bcce: b2 01 movw r22, r4 1bcd0: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 1bcd4: 2b 01 movw r4, r22 1bcd6: 3c 01 movw r6, r24 1bcd8: e8 94 clt 1bcda: 77 f8 bld r7, 7 tmc2130_home_exit(); 1bcdc: 0f 94 a9 25 call 0x24b52 ; 0x24b52 //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]); 1bce0: ff 92 push r15 1bce2: ef 92 push r14 1bce4: df 92 push r13 1bce6: cf 92 push r12 1bce8: 87 e6 ldi r24, 0x67 ; 103 1bcea: 9b e6 ldi r25, 0x6B ; 107 1bcec: 9f 93 push r25 1bcee: 8f 93 push r24 1bcf0: 0f 94 de da call 0x3b5bc ; 0x3b5bc if (fabs(measured_axis_length[i] - axis_length) > max_error_mm) { 1bcf4: a5 01 movw r20, r10 1bcf6: 94 01 movw r18, r8 1bcf8: c7 01 movw r24, r14 1bcfa: b6 01 movw r22, r12 1bcfc: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 1bd00: 9f 77 andi r25, 0x7F ; 127 1bd02: 0f 90 pop r0 1bd04: 0f 90 pop r0 1bd06: 0f 90 pop r0 1bd08: 0f 90 pop r0 1bd0a: 0f 90 pop r0 1bd0c: 0f 90 pop r0 1bd0e: 20 e0 ldi r18, 0x00 ; 0 1bd10: 30 e0 ldi r19, 0x00 ; 0 1bd12: 40 ea ldi r20, 0xA0 ; 160 1bd14: 50 e4 ldi r21, 0x40 ; 64 1bd16: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 1bd1a: 18 16 cp r1, r24 1bd1c: 0c f4 brge .+2 ; 0x1bd20 1bd1e: 53 c0 rjmp .+166 ; 0x1bdc6 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]); 1bd20: 7f 92 push r7 1bd22: 6f 92 push r6 1bd24: 5f 92 push r5 1bd26: 4f 92 push r4 1bd28: 87 e6 ldi r24, 0x67 ; 103 1bd2a: 9b e6 ldi r25, 0x6B ; 107 1bd2c: 9f 93 push r25 1bd2e: 8f 93 push r24 1bd30: 0f 94 de da call 0x3b5bc ; 0x3b5bc if (fabs(measured_axis_length[i] - axis_length) > max_error_mm) { 1bd34: a5 01 movw r20, r10 1bd36: 94 01 movw r18, r8 1bd38: c3 01 movw r24, r6 1bd3a: b2 01 movw r22, r4 1bd3c: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 1bd40: 9f 77 andi r25, 0x7F ; 127 1bd42: 0f 90 pop r0 1bd44: 0f 90 pop r0 1bd46: 0f 90 pop r0 1bd48: 0f 90 pop r0 1bd4a: 0f 90 pop r0 1bd4c: 0f 90 pop r0 1bd4e: 20 e0 ldi r18, 0x00 ; 0 1bd50: 30 e0 ldi r19, 0x00 ; 0 1bd52: 40 ea ldi r20, 0xA0 ; 160 1bd54: 50 e4 ldi r21, 0x40 ; 64 1bd56: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 1bd5a: 18 16 cp r1, r24 1bd5c: a4 f1 brlt .+104 ; 0x1bdc6 endstops_hit_on_purpose(); return false; } } printf_P(_N("Axis length difference:%.3f\n"), fabs(measured_axis_length[0] - measured_axis_length[1])); 1bd5e: a3 01 movw r20, r6 1bd60: 92 01 movw r18, r4 1bd62: c7 01 movw r24, r14 1bd64: b6 01 movw r22, r12 1bd66: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 1bd6a: 6b 01 movw r12, r22 1bd6c: 7c 01 movw r14, r24 1bd6e: e8 94 clt 1bd70: f7 f8 bld r15, 7 1bd72: ff 92 push r15 1bd74: ef 92 push r14 1bd76: df 92 push r13 1bd78: cf 92 push r12 1bd7a: 8a e4 ldi r24, 0x4A ; 74 1bd7c: 9b e6 ldi r25, 0x6B ; 107 1bd7e: 9f 93 push r25 1bd80: 8f 93 push r24 1bd82: 0f 94 de da call 0x3b5bc ; 0x3b5bc if (fabs(measured_axis_length[0] - measured_axis_length[1]) > 1) { //check if difference between first and second measurement is low 1bd86: 0f 90 pop r0 1bd88: 0f 90 pop r0 1bd8a: 0f 90 pop r0 1bd8c: 0f 90 pop r0 1bd8e: 0f 90 pop r0 1bd90: 0f 90 pop r0 1bd92: 20 e0 ldi r18, 0x00 ; 0 1bd94: 30 e0 ldi r19, 0x00 ; 0 1bd96: 40 e8 ldi r20, 0x80 ; 128 1bd98: 5f e3 ldi r21, 0x3F ; 63 1bd9a: c7 01 movw r24, r14 1bd9c: b6 01 movw r22, r12 1bd9e: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 1bda2: 18 16 cp r1, r24 1bda4: 0c f4 brge .+2 ; 0x1bda8 1bda6: 44 c0 rjmp .+136 ; 0x1be30 plan_set_position_curposXYZE(); reset_crash_det(axis); endstops_hit_on_purpose(); return false; } current_position[axis] = 0; 1bda8: ed 81 ldd r30, Y+5 ; 0x05 1bdaa: fe 81 ldd r31, Y+6 ; 0x06 1bdac: 10 82 st Z, r1 1bdae: 11 82 std Z+1, r1 ; 0x01 1bdb0: 12 82 std Z+2, r1 ; 0x02 1bdb2: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 1bdb4: 0f 94 09 bf call 0x37e12 ; 0x37e12 reset_crash_det(axis); 1bdb8: 81 2f mov r24, r17 1bdba: 0e 94 11 dd call 0x1ba22 ; 0x1ba22 endstops_hit_on_purpose(); 1bdbe: 0f 94 fe 4d call 0x29bfc ; 0x29bfc return true; 1bdc2: 81 e0 ldi r24, 0x01 ; 1 1bdc4: 1d c0 rjmp .+58 ; 0x1be00 1bdc6: 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"; 1bdca: 63 ee ldi r22, 0xE3 ; 227 1bdcc: 72 e0 ldi r23, 0x02 ; 2 1bdce: 11 30 cpi r17, 0x01 ; 1 1bdd0: 11 f0 breq .+4 ; 0x1bdd6 1bdd2: 61 ee ldi r22, 0xE1 ; 225 1bdd4: 72 e0 ldi r23, 0x02 ; 2 if (axis == Z_AXIS) _error_1 = "Z"; lcd_selftest_error(TestError::Axis, _error_1, ""); 1bdd6: 88 e0 ldi r24, 0x08 ; 8 1bdd8: 0f 94 6e 9f call 0x33edc ; 0x33edc current_position[axis] = 0; 1bddc: f1 01 movw r30, r2 1bdde: ee 56 subi r30, 0x6E ; 110 1bde0: f9 4f sbci r31, 0xF9 ; 249 1bde2: 10 82 st Z, r1 1bde4: 11 82 std Z+1, r1 ; 0x01 1bde6: 12 82 std Z+2, r1 ; 0x02 1bde8: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 1bdea: 0f 94 09 bf call 0x37e12 ; 0x37e12 reset_crash_det(axis); 1bdee: 81 2f mov r24, r17 1bdf0: 0e 94 11 dd call 0x1ba22 ; 0x1ba22 1bdf4: 81 e0 ldi r24, 0x01 ; 1 1bdf6: 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(); 1bdfa: 0f 94 fe 4d call 0x29bfc ; 0x29bfc return false; 1bdfe: 80 e0 ldi r24, 0x00 ; 0 current_position[axis] = 0; plan_set_position_curposXYZE(); reset_crash_det(axis); endstops_hit_on_purpose(); return true; } 1be00: 27 96 adiw r28, 0x07 ; 7 1be02: 0f b6 in r0, 0x3f ; 63 1be04: f8 94 cli 1be06: de bf out 0x3e, r29 ; 62 1be08: 0f be out 0x3f, r0 ; 63 1be0a: cd bf out 0x3d, r28 ; 61 1be0c: df 91 pop r29 1be0e: cf 91 pop r28 1be10: 1f 91 pop r17 1be12: ff 90 pop r15 1be14: ef 90 pop r14 1be16: df 90 pop r13 1be18: cf 90 pop r12 1be1a: bf 90 pop r11 1be1c: af 90 pop r10 1be1e: 9f 90 pop r9 1be20: 8f 90 pop r8 1be22: 7f 90 pop r7 1be24: 6f 90 pop r6 1be26: 5f 90 pop r5 1be28: 4f 90 pop r4 1be2a: 3f 90 pop r3 1be2c: 2f 90 pop r2 1be2e: 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"; 1be30: 63 ee ldi r22, 0xE3 ; 227 1be32: 72 e0 ldi r23, 0x02 ; 2 1be34: 11 30 cpi r17, 0x01 ; 1 1be36: 11 f0 breq .+4 ; 0x1be3c 1be38: 61 ee ldi r22, 0xE1 ; 225 1be3a: 72 e0 ldi r23, 0x02 ; 2 if (axis == Z_AXIS) _error_1 = "Z"; lcd_selftest_error(TestError::Pulley, _error_1, ""); 1be3c: 87 e0 ldi r24, 0x07 ; 7 1be3e: 0f 94 6e 9f call 0x33edc ; 0x33edc current_position[axis] = 0; 1be42: f1 01 movw r30, r2 1be44: ee 56 subi r30, 0x6E ; 110 1be46: f9 4f sbci r31, 0xF9 ; 249 1be48: 10 82 st Z, r1 1be4a: 11 82 std Z+1, r1 ; 0x01 1be4c: 12 82 std Z+2, r1 ; 0x02 1be4e: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 1be50: 0f 94 09 bf call 0x37e12 ; 0x37e12 reset_crash_det(axis); 1be54: 81 2f mov r24, r17 1be56: 0e 94 11 dd call 0x1ba22 ; 0x1ba22 1be5a: cf cf rjmp .-98 ; 0x1bdfa 0001be5c : } #ifdef TMC2130 static void crash_mode_switch() { eeprom_toggle((uint8_t*)EEPROM_CRASH_DET); 1be5c: 89 e6 ldi r24, 0x69 ; 105 1be5e: 9f e0 ldi r25, 0x0F ; 15 1be60: 0e 94 34 76 call 0xec68 ; 0xec68 crashdet_use_eeprom_setting(); 1be64: 0d 94 55 26 jmp 0x24caa ; 0x24caa 0001be68 : #endif //SDCARD_SORT_ALPHA #ifdef TMC2130 static void lcd_crash_mode_info() { lcd_home(); 1be68: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_puts_P(_T(MSG_CRASH_DET_ONLY_IN_NORMAL)); 1be6c: 89 ea ldi r24, 0xA9 ; 169 1be6e: 9a e3 ldi r25, 0x3A ; 58 1be70: 0e 94 ac 72 call 0xe558 ; 0xe558 1be74: 0e 94 cb 6e call 0xdd96 ; 0xdd96 menu_back_if_clicked(); 1be78: 0d 94 00 d5 jmp 0x3aa00 ; 0x3aa00 0001be7c : } static void lcd_crash_mode_info2() { lcd_home(); 1be7c: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_puts_P(_T(MSG_CRASH_DET_STEALTH_FORCE_OFF)); 1be80: 80 ee ldi r24, 0xE0 ; 224 1be82: 9a e3 ldi r25, 0x3A ; 58 1be84: 0e 94 ac 72 call 0xe558 ; 0xe558 1be88: 0e 94 cb 6e call 0xdd96 ; 0xdd96 menu_back_if_clicked(); 1be8c: 0d 94 00 d5 jmp 0x3aa00 ; 0x3aa00 0001be90 : default: _md->menuState = _uninitialized; //shouldn't ever happen. Anyways, initialize the menu. } } #ifdef TMC2130 static void lcd_belttest_v() { 1be90: 0f 93 push r16 1be92: 1f 93 push r17 1be94: cf 93 push r28 1be96: df 93 push r29 menu_back_if_clicked(); } void lcd_belttest() { lcd_clear(); 1be98: 0e 94 13 6f call 0xde26 ; 0xde26 // Belttest requires high power mode. Enable it. FORCE_HIGH_POWER_START; 1be9c: 81 e0 ldi r24, 0x01 ; 1 1be9e: 0e 94 b0 66 call 0xcd60 ; 0xcd60 uint16_t X = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_X)); 1bea2: 8d e5 ldi r24, 0x5D ; 93 1bea4: 9f e0 ldi r25, 0x0F ; 15 1bea6: 0f 94 2a dc call 0x3b854 ; 0x3b854 1beaa: ec 01 movw r28, r24 uint16_t Y = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_Y)); 1beac: 8b e5 ldi r24, 0x5B ; 91 1beae: 9f e0 ldi r25, 0x0F ; 15 1beb0: 0f 94 2a dc call 0x3b854 ; 0x3b854 1beb4: 18 2f mov r17, r24 1beb6: 09 2f mov r16, r25 lcd_puts_P(_T(MSG_CHECKING_X)); 1beb8: 87 e8 ldi r24, 0x87 ; 135 1beba: 99 e4 ldi r25, 0x49 ; 73 1bebc: 0e 94 ac 72 call 0xe558 ; 0xe558 1bec0: 0e 94 cb 6e call 0xdd96 ; 0xdd96 lcd_set_cursor(0,1), lcd_printf_P(PSTR("X: %u -> ..."),X); 1bec4: 61 e0 ldi r22, 0x01 ; 1 1bec6: 80 e0 ldi r24, 0x00 ; 0 1bec8: 0e 94 e0 6e call 0xddc0 ; 0xddc0 1becc: df 93 push r29 1bece: cf 93 push r28 1bed0: 80 e5 ldi r24, 0x50 ; 80 1bed2: 9a e8 ldi r25, 0x8A ; 138 1bed4: 9f 93 push r25 1bed6: 8f 93 push r24 1bed8: 0e 94 b9 6e call 0xdd72 ; 0xdd72 KEEPALIVE_STATE(IN_HANDLER); 1bedc: 82 e0 ldi r24, 0x02 ; 2 1bede: 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)){ 1bee2: 80 e0 ldi r24, 0x00 ; 0 1bee4: 0e 94 33 dd call 0x1ba66 ; 0x1ba66 1bee8: 0f 90 pop r0 1beea: 0f 90 pop r0 1beec: 0f 90 pop r0 1beee: 0f 90 pop r0 1bef0: 88 23 and r24, r24 1bef2: 09 f4 brne .+2 ; 0x1bef6 1bef4: 45 c0 rjmp .+138 ; 0x1bf80 X = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_X)); 1bef6: 8d e5 ldi r24, 0x5D ; 93 1bef8: 9f e0 ldi r25, 0x0F ; 15 1befa: 0f 94 2a dc call 0x3b854 ; 0x3b854 1befe: ec 01 movw r28, r24 lcd_set_cursor(10, 1); 1bf00: 61 e0 ldi r22, 0x01 ; 1 1bf02: 8a e0 ldi r24, 0x0A ; 10 1bf04: 0e 94 e0 6e call 0xddc0 ; 0xddc0 lcd_print((long) n, base); } void lcd_print(unsigned int n, int base) { lcd_print((unsigned long) n, base); 1bf08: be 01 movw r22, r28 1bf0a: 90 e0 ldi r25, 0x00 ; 0 1bf0c: 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); 1bf0e: 4a e0 ldi r20, 0x0A ; 10 1bf10: 0e 94 34 70 call 0xe068 ; 0xe068 lcd_print(X); // Show new X value next to old one. lcd_puts_at_P(0, 2, _T(MSG_CHECKING_Y)); 1bf14: 85 e7 ldi r24, 0x75 ; 117 1bf16: 99 e4 ldi r25, 0x49 ; 73 1bf18: 0e 94 ac 72 call 0xe558 ; 0xe558 1bf1c: ac 01 movw r20, r24 1bf1e: 62 e0 ldi r22, 0x02 ; 2 1bf20: 80 e0 ldi r24, 0x00 ; 0 1bf22: 0e 94 f4 6e call 0xdde8 ; 0xdde8 lcd_set_cursor(0, 3), lcd_printf_P(PSTR("Y: %u -> ..."),Y); 1bf26: 63 e0 ldi r22, 0x03 ; 3 1bf28: 80 e0 ldi r24, 0x00 ; 0 1bf2a: 0e 94 e0 6e call 0xddc0 ; 0xddc0 1bf2e: 0f 93 push r16 1bf30: 1f 93 push r17 1bf32: 83 e4 ldi r24, 0x43 ; 67 1bf34: 9a e8 ldi r25, 0x8A ; 138 1bf36: 9f 93 push r25 1bf38: 8f 93 push r24 1bf3a: 0e 94 b9 6e call 0xdd72 ; 0xdd72 if (lcd_selfcheck_axis_sg(Y_AXIS)) 1bf3e: 81 e0 ldi r24, 0x01 ; 1 1bf40: 0e 94 33 dd call 0x1ba66 ; 0x1ba66 1bf44: 0f 90 pop r0 1bf46: 0f 90 pop r0 1bf48: 0f 90 pop r0 1bf4a: 0f 90 pop r0 1bf4c: 88 23 and r24, r24 1bf4e: c1 f0 breq .+48 ; 0x1bf80 { Y = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_Y)); 1bf50: 8b e5 ldi r24, 0x5B ; 91 1bf52: 9f e0 ldi r25, 0x0F ; 15 1bf54: 0f 94 2a dc call 0x3b854 ; 0x3b854 1bf58: ec 01 movw r28, r24 lcd_set_cursor(10, 3); 1bf5a: 63 e0 ldi r22, 0x03 ; 3 1bf5c: 8a e0 ldi r24, 0x0A ; 10 1bf5e: 0e 94 e0 6e call 0xddc0 ; 0xddc0 lcd_print((long) n, base); } void lcd_print(unsigned int n, int base) { lcd_print((unsigned long) n, base); 1bf62: be 01 movw r22, r28 1bf64: 90 e0 ldi r25, 0x00 ; 0 1bf66: 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); 1bf68: 4a e0 ldi r20, 0x0A ; 10 1bf6a: 0e 94 34 70 call 0xe068 ; 0xe068 lcd_print(Y); lcd_putc_at(19, 3, LCD_STR_UPLEVEL[0]); 1bf6e: 43 e8 ldi r20, 0x83 ; 131 1bf70: 63 e0 ldi r22, 0x03 ; 3 1bf72: 83 e1 ldi r24, 0x13 ; 19 1bf74: 0e 94 00 6f call 0xde00 ; 0xde00 lcd_wait_for_click_delay(10); 1bf78: 8a e0 ldi r24, 0x0A ; 10 1bf7a: 90 e0 ldi r25, 0x00 ; 0 1bf7c: 0f 94 2f 3a call 0x2745e ; 0x2745e } } FORCE_HIGH_POWER_END; 1bf80: 80 e0 ldi r24, 0x00 ; 0 1bf82: 0e 94 b0 66 call 0xcd60 ; 0xcd60 KEEPALIVE_STATE(NOT_BUSY); 1bf86: 81 e0 ldi r24, 0x01 ; 1 1bf88: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be #ifdef TMC2130 static void lcd_belttest_v() { lcd_belttest(); menu_back_if_clicked(); } 1bf8c: df 91 pop r29 1bf8e: cf 91 pop r28 1bf90: 1f 91 pop r17 1bf92: 0f 91 pop r16 } #ifdef TMC2130 static void lcd_belttest_v() { lcd_belttest(); menu_back_if_clicked(); 1bf94: 0d 94 00 d5 jmp 0x3aa00 ; 0x3aa00 0001bf98 : static void lcd_sd_refresh() { #if SDCARDDETECT == -1 card.mount(); #else card.presort(); 1bf98: 0f 94 92 7c call 0x2f924 ; 0x2f924 #endif menu_top = 0; 1bf9c: 10 92 a5 03 sts 0x03A5, r1 ; 0x8003a5 lcd_encoder = 0; 1bfa0: 10 92 71 06 sts 0x0671, r1 ; 0x800671 1bfa4: 10 92 70 06 sts 0x0670, r1 ; 0x800670 menu_data_reset(); //Forces reloading of cached variables. 1bfa8: 0d 94 b8 d1 jmp 0x3a370 ; 0x3a370 0001bfac : } } void CardReader::updir() { if(workDirDepth > 0) 1bfac: 80 91 30 16 lds r24, 0x1630 ; 0x801630 1bfb0: 88 23 and r24, r24 1bfb2: f9 f0 breq .+62 ; 0x1bff2 { --workDirDepth; 1bfb4: 81 50 subi r24, 0x01 ; 1 1bfb6: 80 93 30 16 sts 0x1630, r24 ; 0x801630 workDir = workDirParents[0]; 1bfba: 93 e2 ldi r25, 0x23 ; 35 1bfbc: ee e5 ldi r30, 0x5E ; 94 1bfbe: f5 e1 ldi r31, 0x15 ; 21 1bfc0: ab e3 ldi r26, 0x3B ; 59 1bfc2: b5 e1 ldi r27, 0x15 ; 21 1bfc4: 01 90 ld r0, Z+ 1bfc6: 0d 92 st X+, r0 1bfc8: 9a 95 dec r25 1bfca: e1 f7 brne .-8 ; 0x1bfc4 1bfcc: 2e e5 ldi r18, 0x5E ; 94 1bfce: 35 e1 ldi r19, 0x15 ; 21 for (uint8_t d = 0; d < workDirDepth; d++) 1bfd0: 90 e0 ldi r25, 0x00 ; 0 1bfd2: 98 17 cp r25, r24 1bfd4: 60 f4 brcc .+24 ; 0x1bfee { workDirParents[d] = workDirParents[d+1]; 1bfd6: 43 e2 ldi r20, 0x23 ; 35 1bfd8: f9 01 movw r30, r18 1bfda: b3 96 adiw r30, 0x23 ; 35 1bfdc: d9 01 movw r26, r18 1bfde: 01 90 ld r0, Z+ 1bfe0: 0d 92 st X+, r0 1bfe2: 4a 95 dec r20 1bfe4: e1 f7 brne .-8 ; 0x1bfde { if(workDirDepth > 0) { --workDirDepth; workDir = workDirParents[0]; for (uint8_t d = 0; d < workDirDepth; d++) 1bfe6: 9f 5f subi r25, 0xFF ; 255 1bfe8: 2d 5d subi r18, 0xDD ; 221 1bfea: 3f 4f sbci r19, 0xFF ; 255 1bfec: f2 cf rjmp .-28 ; 0x1bfd2 { workDirParents[d] = workDirParents[d+1]; } #ifdef SDCARD_SORT_ALPHA presort(); 1bfee: 0f 94 92 7c call 0x2f924 ; 0x2f924 } static void lcd_sd_updir() { card.updir(); menu_top = 0; 1bff2: 10 92 a5 03 sts 0x03A5, r1 ; 0x8003a5 lcd_encoder = 0; 1bff6: 10 92 71 06 sts 0x0671, r1 ; 0x800671 1bffa: 10 92 70 06 sts 0x0670, r1 ; 0x800670 menu_data_reset(); //Forces reloading of cached variables. 1bffe: 0d 94 b8 d1 jmp 0x3a370 ; 0x3a370 0001c002 : } backlight_save(); } static void lcd_backlight_menu() { 1c002: ef 92 push r14 1c004: ff 92 push r15 1c006: 0f 93 push r16 1c008: 1f 93 push r17 1c00a: cf 93 push r28 1c00c: df 93 push r29 MENU_BEGIN(); 1c00e: 0f 94 96 d1 call 0x3a32c ; 0x3a32c 1c012: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1c016: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1c01a: 84 30 cpi r24, 0x04 ; 4 1c01c: 08 f0 brcs .+2 ; 0x1c020 1c01e: 63 c0 rjmp .+198 ; 0x1c0e6 1c020: 10 92 15 05 sts 0x0515, r1 ; 0x800515 ON_MENU_LEAVE( 1c024: 0f 94 16 d0 call 0x3a02c ; 0x3a02c 1c028: 81 11 cpse r24, r1 1c02a: 0e 94 2f 8a call 0x1145e ; 0x1145e backlight_save(); ); MENU_ITEM_BACK_P(_T(MSG_BACK)); 1c02e: 8c eb ldi r24, 0xBC ; 188 1c030: 99 e4 ldi r25, 0x49 ; 73 1c032: 0e 94 ac 72 call 0xe558 ; 0xe558 1c036: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 MENU_ITEM_EDIT_int3_P(_T(MSG_BL_HIGH), &backlightLevel_HIGH, backlightLevel_LOW, 255); 1c03a: c0 91 00 04 lds r28, 0x0400 ; 0x800400 1c03e: d0 e0 ldi r29, 0x00 ; 0 1c040: 87 e3 ldi r24, 0x37 ; 55 1c042: 98 e4 ldi r25, 0x48 ; 72 1c044: 0e 94 ac 72 call 0xe558 ; 0xe558 1c048: f1 2c mov r15, r1 1c04a: e1 2c mov r14, r1 1c04c: 0f ef ldi r16, 0xFF ; 255 1c04e: 10 e0 ldi r17, 0x00 ; 0 1c050: 9e 01 movw r18, r28 1c052: 48 e0 ldi r20, 0x08 ; 8 1c054: 61 e0 ldi r22, 0x01 ; 1 1c056: 74 e0 ldi r23, 0x04 ; 4 1c058: 0f 94 e6 d1 call 0x3a3cc ; 0x3a3cc MENU_ITEM_EDIT_int3_P(_T(MSG_BL_LOW), &backlightLevel_LOW, 0, backlightLevel_HIGH); 1c05c: 00 91 01 04 lds r16, 0x0401 ; 0x800401 1c060: 10 e0 ldi r17, 0x00 ; 0 1c062: 88 e2 ldi r24, 0x28 ; 40 1c064: 98 e4 ldi r25, 0x48 ; 72 1c066: 0e 94 ac 72 call 0xe558 ; 0xe558 1c06a: 30 e0 ldi r19, 0x00 ; 0 1c06c: 20 e0 ldi r18, 0x00 ; 0 1c06e: 48 e0 ldi r20, 0x08 ; 8 1c070: 60 e0 ldi r22, 0x00 ; 0 1c072: 74 e0 ldi r23, 0x04 ; 4 1c074: 0f 94 e6 d1 call 0x3a3cc ; 0x3a3cc 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); 1c078: 80 91 4f 02 lds r24, 0x024F ; 0x80024f 1c07c: 81 30 cpi r24, 0x01 ; 1 1c07e: 59 f5 brne .+86 ; 0x1c0d6 1c080: 8f e1 ldi r24, 0x1F ; 31 1c082: 98 e4 ldi r25, 0x48 ; 72 1c084: 0e 94 ac 72 call 0xe558 ; 0xe558 1c088: ec 01 movw r28, r24 1c08a: 8b e0 ldi r24, 0x0B ; 11 1c08c: 98 e4 ldi r25, 0x48 ; 72 1c08e: 0e 94 ac 72 call 0xe558 ; 0xe558 1c092: 22 e0 ldi r18, 0x02 ; 2 1c094: 4a e7 ldi r20, 0x7A ; 122 1c096: 50 ee ldi r21, 0xE0 ; 224 1c098: be 01 movw r22, r28 1c09a: 0f 94 25 d3 call 0x3a64a ; 0x3a64a MENU_ITEM_EDIT_int3_P(_T(MSG_TIMEOUT), &backlightTimer_period, 1, 999); 1c09e: 81 e0 ldi r24, 0x01 ; 1 1c0a0: 98 e4 ldi r25, 0x48 ; 72 1c0a2: 0e 94 ac 72 call 0xe558 ; 0xe558 1c0a6: f1 2c mov r15, r1 1c0a8: e1 2c mov r14, r1 1c0aa: 07 ee ldi r16, 0xE7 ; 231 1c0ac: 13 e0 ldi r17, 0x03 ; 3 1c0ae: 21 e0 ldi r18, 0x01 ; 1 1c0b0: 30 e0 ldi r19, 0x00 ; 0 1c0b2: 40 e1 ldi r20, 0x10 ; 16 1c0b4: 6d e4 ldi r22, 0x4D ; 77 1c0b6: 72 e0 ldi r23, 0x02 ; 2 1c0b8: 0f 94 e6 d1 call 0x3a3cc ; 0x3a3cc MENU_END(); 1c0bc: 0f 94 6a d1 call 0x3a2d4 ; 0x3a2d4 backlight_save(); } static void lcd_backlight_menu() { MENU_BEGIN(); 1c0c0: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1c0c4: 8f 5f subi r24, 0xFF ; 255 1c0c6: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1c0ca: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1c0ce: 8f 5f subi r24, 0xFF ; 255 1c0d0: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1c0d4: a0 cf rjmp .-192 ; 0x1c016 ); 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); 1c0d6: 81 11 cpse r24, r1 1c0d8: 03 c0 rjmp .+6 ; 0x1c0e0 1c0da: 89 e1 ldi r24, 0x19 ; 25 1c0dc: 98 e4 ldi r25, 0x48 ; 72 1c0de: d2 cf rjmp .-92 ; 0x1c084 1c0e0: 82 e1 ldi r24, 0x12 ; 18 1c0e2: 98 e4 ldi r25, 0x48 ; 72 1c0e4: cf cf rjmp .-98 ; 0x1c084 MENU_ITEM_EDIT_int3_P(_T(MSG_TIMEOUT), &backlightTimer_period, 1, 999); MENU_END(); } 1c0e6: df 91 pop r29 1c0e8: cf 91 pop r28 1c0ea: 1f 91 pop r17 1c0ec: 0f 91 pop r16 1c0ee: ff 90 pop r15 1c0f0: ef 90 pop r14 1c0f2: 08 95 ret 0001c0f4 : } #ifdef LCD_BL_PIN static void backlight_mode_toggle() { switch (backlightMode) 1c0f4: 80 91 4f 02 lds r24, 0x024F ; 0x80024f 1c0f8: 88 23 and r24, r24 1c0fa: 31 f0 breq .+12 ; 0x1c108 1c0fc: 81 30 cpi r24, 0x01 ; 1 1c0fe: 41 f4 brne .+16 ; 0x1c110 { case BACKLIGHT_MODE_BRIGHT: backlightMode = BACKLIGHT_MODE_DIM; break; 1c100: 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(); 1c104: 0c 94 2f 8a jmp 0x1145e ; 0x1145e 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; 1c108: 82 e0 ldi r24, 0x02 ; 2 case BACKLIGHT_MODE_AUTO: backlightMode = BACKLIGHT_MODE_BRIGHT; break; 1c10a: 80 93 4f 02 sts 0x024F, r24 ; 0x80024f 1c10e: fa cf rjmp .-12 ; 0x1c104 1c110: 81 e0 ldi r24, 0x01 ; 1 1c112: fb cf rjmp .-10 ; 0x1c10a 0001c114 : static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); } static void mmu_preload_filament_menu() { 1c114: cf 93 push r28 MENU_BEGIN(); 1c116: 0f 94 96 d1 call 0x3a32c ; 0x3a32c 1c11a: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1c11e: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1c122: 84 30 cpi r24, 0x04 ; 4 1c124: 60 f5 brcc .+88 ; 0x1c17e 1c126: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1c12a: 88 ea ldi r24, 0xA8 ; 168 1c12c: 98 e4 ldi r25, 0x48 ; 72 1c12e: 0e 94 ac 72 call 0xe558 ; 0xe558 1c132: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 MENU_ITEM_FUNCTION_P(_T(MSG_LOAD_ALL), load_all_wrapper); 1c136: 8d eb ldi r24, 0xBD ; 189 1c138: 95 e4 ldi r25, 0x45 ; 69 1c13a: 0e 94 ac 72 call 0xe558 ; 0xe558 1c13e: 6e e7 ldi r22, 0x7E ; 126 1c140: 71 ee ldi r23, 0xE1 ; 225 1c142: 0f 94 13 d1 call 0x3a226 ; 0x3a226 for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 1c146: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', load_filament_wrapper, i); 1c148: 82 e8 ldi r24, 0x82 ; 130 1c14a: 96 e4 ldi r25, 0x46 ; 70 1c14c: 0e 94 ac 72 call 0xe558 ; 0xe558 1c150: 61 e3 ldi r22, 0x31 ; 49 1c152: 6c 0f add r22, r28 1c154: 2c 2f mov r18, r28 1c156: 4d e8 ldi r20, 0x8D ; 141 1c158: 51 ee ldi r21, 0xE1 ; 225 1c15a: 0f 94 bc d0 call 0x3a178 ; 0x3a178 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++) 1c15e: cf 5f subi r28, 0xFF ; 255 1c160: c5 30 cpi r28, 0x05 ; 5 1c162: 91 f7 brne .-28 ; 0x1c148 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', load_filament_wrapper, i); MENU_END(); 1c164: 0f 94 6a d1 call 0x3a2d4 ; 0x3a2d4 static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); } static void mmu_preload_filament_menu() { MENU_BEGIN(); 1c168: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1c16c: 8f 5f subi r24, 0xFF ; 255 1c16e: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1c172: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1c176: 8f 5f subi r24, 0xFF ; 255 1c178: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1c17c: d0 cf rjmp .-96 ; 0x1c11e 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(); } 1c17e: cf 91 pop r28 1c180: 08 95 ret 0001c182 : static void lcd_mmuCutFilament() { preheat_or_continue(FilamentAction::MmuCut); } static void lcd_mmuLoadFilament() { preheat_or_continue(FilamentAction::MmuLoad); 1c182: 84 e0 ldi r24, 0x04 ; 4 1c184: 0d 94 bb 50 jmp 0x2a176 ; 0x2a176 0001c188 : } static void lcd_mmuUnloadFilament() { preheat_or_continue(FilamentAction::MmuUnLoad); 1c188: 85 e0 ldi r24, 0x05 ; 5 1c18a: 0d 94 bb 50 jmp 0x2a176 ; 0x2a176 0001c18e : } static void lcd_mmuEjectFilament() { preheat_or_continue(FilamentAction::MmuEject); 1c18e: 86 e0 ldi r24, 0x06 ; 6 1c190: 0d 94 bb 50 jmp 0x2a176 ; 0x2a176 0001c194 : static void lcd_mmuLoadingTest() { preheat_or_continue(FilamentAction::MmuLoadingTest); } static void lcd_mmuCutFilament() { preheat_or_continue(FilamentAction::MmuCut); 1c194: 87 e0 ldi r24, 0x07 ; 7 1c196: 0d 94 bb 50 jmp 0x2a176 ; 0x2a176 0001c19a : 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); 1c19a: 88 e0 ldi r24, 0x08 ; 8 1c19c: 0d 94 bb 50 jmp 0x2a176 ; 0x2a176 0001c1a0 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1c1a0: 60 91 e2 03 lds r22, 0x03E2 ; 0x8003e2 1c1a4: 81 ea ldi r24, 0xA1 ; 161 1c1a6: 9d e0 ldi r25, 0x0D ; 13 1c1a8: 0f 94 40 dc call 0x3b880 ; 0x3b880 } static void change_sheet() { eeprom_update_byte_notify(&(EEPROM_Sheets_base->active_sheet), selected_sheet); menu_back(3); 1c1ac: 83 e0 ldi r24, 0x03 ; 3 1c1ae: 0d 94 42 d4 jmp 0x3a884 ; 0x3a884 0001c1b2 : // Clear the filament action clearFilamentAction(); } static void mmu_loading_test_menu() { 1c1b2: cf 93 push r28 MENU_BEGIN(); 1c1b4: 0f 94 96 d1 call 0x3a32c ; 0x3a32c 1c1b8: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1c1bc: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1c1c0: 84 30 cpi r24, 0x04 ; 4 1c1c2: 88 f5 brcc .+98 ; 0x1c226 1c1c4: 10 92 15 05 sts 0x0515, r1 ; 0x800515 ON_MENU_LEAVE( 1c1c8: 0f 94 16 d0 call 0x3a02c ; 0x3a02c 1c1cc: 81 11 cpse r24, r1 1c1ce: 0f 94 93 20 call 0x24126 ; 0x24126 clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1c1d2: 88 ea ldi r24, 0xA8 ; 168 1c1d4: 98 e4 ldi r25, 0x48 ; 72 1c1d6: 0e 94 ac 72 call 0xe558 ; 0xe558 1c1da: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 MENU_ITEM_FUNCTION_P(_T(MSG_LOAD_ALL), loading_test_all_wrapper); 1c1de: 8d eb ldi r24, 0xBD ; 189 1c1e0: 95 e4 ldi r25, 0x45 ; 69 1c1e2: 0e 94 ac 72 call 0xe558 ; 0xe558 1c1e6: 6e e9 ldi r22, 0x9E ; 158 1c1e8: 7a e3 ldi r23, 0x3A ; 58 1c1ea: 0f 94 13 d1 call 0x3a226 ; 0x3a226 for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 1c1ee: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', loading_test_wrapper, i); 1c1f0: 82 e8 ldi r24, 0x82 ; 130 1c1f2: 96 e4 ldi r25, 0x46 ; 70 1c1f4: 0e 94 ac 72 call 0xe558 ; 0xe558 1c1f8: 61 e3 ldi r22, 0x31 ; 49 1c1fa: 6c 0f add r22, r28 1c1fc: 2c 2f mov r18, r28 1c1fe: 46 e0 ldi r20, 0x06 ; 6 1c200: 5b e3 ldi r21, 0x3B ; 59 1c202: 0f 94 bc d0 call 0x3a178 ; 0x3a178 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++) 1c206: cf 5f subi r28, 0xFF ; 255 1c208: c5 30 cpi r28, 0x05 ; 5 1c20a: 91 f7 brne .-28 ; 0x1c1f0 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', loading_test_wrapper, i); MENU_END(); 1c20c: 0f 94 6a d1 call 0x3a2d4 ; 0x3a2d4 // Clear the filament action clearFilamentAction(); } static void mmu_loading_test_menu() { MENU_BEGIN(); 1c210: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1c214: 8f 5f subi r24, 0xFF ; 255 1c216: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1c21a: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1c21e: 8f 5f subi r24, 0xFF ; 255 1c220: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1c224: cb cf rjmp .-106 ; 0x1c1bc 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(); } 1c226: cf 91 pop r28 1c228: 08 95 ret 0001c22a : } // 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)) { 1c22a: ef 92 push r14 1c22c: ff 92 push r15 1c22e: 0f 93 push r16 1c230: 1f 93 push r17 1c232: cf 93 push r28 1c234: 8c 01 movw r16, r24 1c236: 7b 01 movw r14, r22 MENU_BEGIN(); 1c238: 0f 94 96 d1 call 0x3a32c ; 0x3a32c 1c23c: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1c240: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1c244: 84 30 cpi r24, 0x04 ; 4 1c246: 28 f5 brcc .+74 ; 0x1c292 1c248: 10 92 15 05 sts 0x0515, r1 ; 0x800515 ON_MENU_LEAVE( 1c24c: 0f 94 16 d0 call 0x3a02c ; 0x3a02c 1c250: 81 11 cpse r24, r1 1c252: 0f 94 93 20 call 0x24126 ; 0x24126 clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1c256: 88 ea ldi r24, 0xA8 ; 168 1c258: 98 e4 ldi r25, 0x48 ; 72 1c25a: 0e 94 ac 72 call 0xe558 ; 0xe558 1c25e: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 1c262: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(label, i + '1', menuAction, i); 1c264: 61 e3 ldi r22, 0x31 ; 49 1c266: 6c 0f add r22, r28 1c268: 2c 2f mov r18, r28 1c26a: a7 01 movw r20, r14 1c26c: c8 01 movw r24, r16 1c26e: 0f 94 bc d0 call 0x3a178 ; 0x3a178 MENU_BEGIN(); ON_MENU_LEAVE( clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 1c272: cf 5f subi r28, 0xFF ; 255 1c274: c5 30 cpi r28, 0x05 ; 5 1c276: b1 f7 brne .-20 ; 0x1c264 MENU_ITEM_FUNCTION_NR_P(label, i + '1', menuAction, i); MENU_END(); 1c278: 0f 94 6a d1 call 0x3a2d4 ; 0x3a2d4 // 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(); 1c27c: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1c280: 8f 5f subi r24, 0xFF ; 255 1c282: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1c286: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1c28a: 8f 5f subi r24, 0xFF ; 255 1c28c: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1c290: d7 cf rjmp .-82 ; 0x1c240 ); 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(); } 1c292: cf 91 pop r28 1c294: 1f 91 pop r17 1c296: 0f 91 pop r16 1c298: ff 90 pop r15 1c29a: ef 90 pop r14 1c29c: 08 95 ret 0001c29e : 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); 1c29e: 87 e1 ldi r24, 0x17 ; 23 1c2a0: 9c e5 ldi r25, 0x5C ; 92 1c2a2: 0e 94 ac 72 call 0xe558 ; 0xe558 1c2a6: 67 e6 ldi r22, 0x67 ; 103 1c2a8: 71 ee ldi r23, 0xE1 ; 225 1c2aa: 0c 94 15 e1 jmp 0x1c22a ; 0x1c22a 0001c2ae : // Clear the filament action clearFilamentAction(); } static void mmu_fil_eject_menu() { mmu_common_choose_filament_menu(_T(MSG_EJECT_FROM_MMU), mmu_eject_filament); 1c2ae: 86 e2 ldi r24, 0x26 ; 38 1c2b0: 9c e5 ldi r25, 0x5C ; 92 1c2b2: 0e 94 ac 72 call 0xe558 ; 0xe558 1c2b6: 63 e7 ldi r22, 0x73 ; 115 1c2b8: 71 ee ldi r23, 0xE1 ; 225 1c2ba: 0c 94 15 e1 jmp 0x1c22a ; 0x1c22a 0001c2be : 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); 1c2be: 82 e8 ldi r24, 0x82 ; 130 1c2c0: 96 e4 ldi r25, 0x46 ; 70 1c2c2: 0e 94 ac 72 call 0xe558 ; 0xe558 1c2c6: 66 e0 ldi r22, 0x06 ; 6 1c2c8: 7a e3 ldi r23, 0x3A ; 58 1c2ca: 0c 94 15 e1 jmp 0x1c22a ; 0x1c22a 0001c2ce : 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){ 1c2ce: cf 93 push r28 1c2d0: c8 2f mov r28, r24 IncrementMMUFails(); } } bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) { if (!WaitForMMUReady()) { 1c2d2: 0f 94 84 88 call 0x31108 ; 0x31108 1c2d6: 88 23 and r24, r24 1c2d8: 21 f0 breq .+8 ; 0x1c2e2 1c2da: 8c 2f mov r24, r28 MMU2::mmu2.cut_filament(index); } 1c2dc: cf 91 pop r28 1c2de: 0d 94 15 ae jmp 0x35c2a ; 0x35c2a 1c2e2: cf 91 pop r28 1c2e4: 08 95 ret 0001c2e6 : 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) { 1c2e6: cf 93 push r28 1c2e8: c8 2f mov r28, r24 menu_back(); 1c2ea: 0f 94 5e d4 call 0x3a8bc ; 0x3a8bc MMU2::mmu2.eject_filament(filament, true); 1c2ee: 61 e0 ldi r22, 0x01 ; 1 1c2f0: 8c 2f mov r24, r28 1c2f2: 0f 94 98 ad call 0x35b30 ; 0x35b30 // Clear the filament action clearFilamentAction(); } 1c2f6: 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(); 1c2f8: 0d 94 93 20 jmp 0x24126 ; 0x24126 0001c2fc : } static inline void load_all_wrapper(){ for(uint8_t i = 0; i < 5; ++i){ MMU2::mmu2.load_filament(i); 1c2fc: 80 e0 ldi r24, 0x00 ; 0 1c2fe: 0f 94 55 ad call 0x35aaa ; 0x35aaa 1c302: 81 e0 ldi r24, 0x01 ; 1 1c304: 0f 94 55 ad call 0x35aaa ; 0x35aaa 1c308: 82 e0 ldi r24, 0x02 ; 2 1c30a: 0f 94 55 ad call 0x35aaa ; 0x35aaa 1c30e: 83 e0 ldi r24, 0x03 ; 3 1c310: 0f 94 55 ad call 0x35aaa ; 0x35aaa 1c314: 84 e0 ldi r24, 0x04 ; 4 1c316: 0d 94 55 ad jmp 0x35aaa ; 0x35aaa 0001c31a : } } static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); 1c31a: 0d 94 55 ad jmp 0x35aaa ; 0x35aaa 0001c31e : } #endif //TMC2130 #if (LANG_MODE != 0) static void menu_setlang(uint8_t lang) { 1c31e: cf 93 push r28 1c320: c8 2f mov r28, r24 if (!lang_select(lang)) 1c322: 0e 94 34 72 call 0xe468 ; 0xe468 1c326: 81 11 cpse r24, r1 1c328: 37 c0 rjmp .+110 ; 0x1c398 { if (lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_COPY_SEL_LANG), false, LCD_LEFT_BUTTON_CHOICE) == LCD_LEFT_BUTTON_CHOICE) 1c32a: 81 e3 ldi r24, 0x31 ; 49 1c32c: 9b e3 ldi r25, 0x3B ; 59 1c32e: 0e 94 ac 72 call 0xe558 ; 0xe558 1c332: 40 e0 ldi r20, 0x00 ; 0 1c334: 60 e0 ldi r22, 0x00 ; 0 1c336: 0f 94 40 4f call 0x29e80 ; 0x29e80 1c33a: 81 11 cpse r24, r1 1c33c: 20 c0 rjmp .+64 ; 0x1c37e #endif //(LANG_MODE == 0) void lang_boot_update_start(uint8_t lang) { uint8_t cnt = lang_get_count(); 1c33e: 0e 94 e9 71 call 0xe3d2 ; 0xe3d2 if ((lang < 2) || (lang > cnt)) return; //only languages from xflash can be selected 1c342: c2 30 cpi r28, 0x02 ; 2 1c344: e0 f0 brcs .+56 ; 0x1c37e 1c346: 8c 17 cp r24, r28 1c348: d0 f0 brcs .+52 ; 0x1c37e softReset(); } void bootapp_reboot_user0(uint8_t reserved) { cli(); 1c34a: f8 94 cli boot_app_magic = BOOT_APP_MAGIC; 1c34c: 8a ea ldi r24, 0xAA ; 170 1c34e: 95 e5 ldi r25, 0x55 ; 85 1c350: dc 01 movw r26, r24 1c352: 80 93 fc 1f sts 0x1FFC, r24 ; 0x801ffc <__bss_end+0x7dc> 1c356: 90 93 fd 1f sts 0x1FFD, r25 ; 0x801ffd <__bss_end+0x7dd> 1c35a: a0 93 fe 1f sts 0x1FFE, r26 ; 0x801ffe <__bss_end+0x7de> 1c35e: b0 93 ff 1f sts 0x1FFF, r27 ; 0x801fff <__bss_end+0x7df> boot_app_flags = BOOT_APP_FLG_USER0; 1c362: 80 e8 ldi r24, 0x80 ; 128 1c364: 80 93 fb 1f sts 0x1FFB, r24 ; 0x801ffb <__bss_end+0x7db> boot_copy_size = 0; 1c368: 10 92 f9 1f sts 0x1FF9, r1 ; 0x801ff9 <__bss_end+0x7d9> 1c36c: 10 92 f8 1f sts 0x1FF8, r1 ; 0x801ff8 <__bss_end+0x7d8> bootapp_reboot_user0(lang << 3); 1c370: cc 0f add r28, r28 1c372: cc 0f add r28, r28 1c374: cc 0f add r28, r28 boot_reserved = reserved; 1c376: c0 93 fa 1f sts 0x1FFA, r28 ; 0x801ffa <__bss_end+0x7da> // bootapp_print_vars(); softReset(); 1c37a: 0e 94 4c 67 call 0xce98 ; 0xce98 lang_boot_update_start(lang); lcd_update_enable(true); 1c37e: 81 e0 ldi r24, 0x01 ; 1 1c380: 0e 94 25 6f call 0xde4a ; 0xde4a menu_goto(lcd_language_menu, 0, true, true); 1c384: 21 e0 ldi r18, 0x01 ; 1 1c386: 41 e0 ldi r20, 0x01 ; 1 1c388: 70 e0 ldi r23, 0x00 ; 0 1c38a: 60 e0 ldi r22, 0x00 ; 0 1c38c: 8f ec ldi r24, 0xCF ; 207 1c38e: 92 ee ldi r25, 0xE2 ; 226 1c390: 0f 94 c0 d1 call 0x3a380 ; 0x3a380 1c394: 10 92 dc 03 sts 0x03DC, r1 ; 0x8003dc lcd_timeoutToStatus.stop(); //infinite timeout } } 1c398: cf 91 pop r28 1c39a: 08 95 ret 0001c39c : #ifdef COMMUNITY_LANGUAGE_SUPPORT #ifdef XFLASH static void lcd_community_language_menu() { 1c39c: cf 93 push r28 1c39e: df 93 push r29 MENU_BEGIN(); 1c3a0: 0f 94 96 d1 call 0x3a32c ; 0x3a32c 1c3a4: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1c3a8: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1c3ac: 84 30 cpi r24, 0x04 ; 4 1c3ae: 58 f5 brcc .+86 ; 0x1c406 1c3b0: 10 92 15 05 sts 0x0515, r1 ; 0x800515 uint8_t cnt = lang_get_count(); 1c3b4: 0e 94 e9 71 call 0xe3d2 ; 0xe3d2 1c3b8: d8 2f mov r29, r24 MENU_ITEM_BACK_P(_T(MSG_SELECT_LANGUAGE)); //Back to previous Menu 1c3ba: 8b e9 ldi r24, 0x9B ; 155 1c3bc: 94 e4 ldi r25, 0x44 ; 68 1c3be: 0e 94 ac 72 call 0xe558 ; 0xe558 1c3c2: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 for (uint8_t i = 8; i < cnt; i++) //all community languages 1c3c6: c8 e0 ldi r28, 0x08 ; 8 1c3c8: cd 17 cp r28, r29 1c3ca: 80 f4 brcc .+32 ; 0x1c3ec if (menu_item_text_P(lang_get_name_by_code(lang_get_code(i)))) 1c3cc: 8c 2f mov r24, r28 1c3ce: 0e 94 9a 71 call 0xe334 ; 0xe334 1c3d2: 0e 94 33 71 call 0xe266 ; 0xe266 1c3d6: 0f 94 44 d1 call 0x3a288 ; 0x3a288 1c3da: 88 23 and r24, r24 1c3dc: 29 f0 breq .+10 ; 0x1c3e8 { menu_setlang(i); 1c3de: 8c 2f mov r24, r28 return; } MENU_END(); } 1c3e0: df 91 pop r29 1c3e2: 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); 1c3e4: 0c 94 8f e1 jmp 0x1c31e ; 0x1c31e 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 1c3e8: cf 5f subi r28, 0xFF ; 255 1c3ea: ee cf rjmp .-36 ; 0x1c3c8 if (menu_item_text_P(lang_get_name_by_code(lang_get_code(i)))) { menu_setlang(i); return; } MENU_END(); 1c3ec: 0f 94 6a d1 call 0x3a2d4 ; 0x3a2d4 #ifdef COMMUNITY_LANGUAGE_SUPPORT #ifdef XFLASH static void lcd_community_language_menu() { MENU_BEGIN(); 1c3f0: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1c3f4: 8f 5f subi r24, 0xFF ; 255 1c3f6: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1c3fa: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1c3fe: 8f 5f subi r24, 0xFF ; 255 1c400: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1c404: d1 cf rjmp .-94 ; 0x1c3a8 { menu_setlang(i); return; } MENU_END(); } 1c406: df 91 pop r29 1c408: cf 91 pop r28 1c40a: 08 95 ret 0001c40c : lcd_sheet_menu(); } static void sheets_menu() { MENU_BEGIN(); 1c40c: 0f 94 96 d1 call 0x3a32c ; 0x3a32c 1c410: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1c414: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1c418: 84 30 cpi r24, 0x04 ; 4 1c41a: 08 f0 brcs .+2 ; 0x1c41e 1c41c: 45 c0 rjmp .+138 ; 0x1c4a8 1c41e: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_HW_SETUP)); 1c422: 8a ec ldi r24, 0xCA ; 202 1c424: 94 e4 ldi r25, 0x44 ; 68 1c426: 0e 94 ac 72 call 0xe558 ; 0xe558 1c42a: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[0], select_sheet_menu<0>); 1c42e: 60 ec ldi r22, 0xC0 ; 192 1c430: 73 ed ldi r23, 0xD3 ; 211 1c432: 89 e4 ldi r24, 0x49 ; 73 1c434: 9d e0 ldi r25, 0x0D ; 13 1c436: 0f 94 c4 d3 call 0x3a788 ; 0x3a788 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[1], select_sheet_menu<1>); 1c43a: 6b eb ldi r22, 0xBB ; 187 1c43c: 73 ed ldi r23, 0xD3 ; 211 1c43e: 84 e5 ldi r24, 0x54 ; 84 1c440: 9d e0 ldi r25, 0x0D ; 13 1c442: 0f 94 c4 d3 call 0x3a788 ; 0x3a788 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[2], select_sheet_menu<2>); 1c446: 66 eb ldi r22, 0xB6 ; 182 1c448: 73 ed ldi r23, 0xD3 ; 211 1c44a: 8f e5 ldi r24, 0x5F ; 95 1c44c: 9d e0 ldi r25, 0x0D ; 13 1c44e: 0f 94 c4 d3 call 0x3a788 ; 0x3a788 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[3], select_sheet_menu<3>); 1c452: 61 eb ldi r22, 0xB1 ; 177 1c454: 73 ed ldi r23, 0xD3 ; 211 1c456: 8a e6 ldi r24, 0x6A ; 106 1c458: 9d e0 ldi r25, 0x0D ; 13 1c45a: 0f 94 c4 d3 call 0x3a788 ; 0x3a788 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[4], select_sheet_menu<4>); 1c45e: 6c ea ldi r22, 0xAC ; 172 1c460: 73 ed ldi r23, 0xD3 ; 211 1c462: 85 e7 ldi r24, 0x75 ; 117 1c464: 9d e0 ldi r25, 0x0D ; 13 1c466: 0f 94 c4 d3 call 0x3a788 ; 0x3a788 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[5], select_sheet_menu<5>); 1c46a: 67 ea ldi r22, 0xA7 ; 167 1c46c: 73 ed ldi r23, 0xD3 ; 211 1c46e: 80 e8 ldi r24, 0x80 ; 128 1c470: 9d e0 ldi r25, 0x0D ; 13 1c472: 0f 94 c4 d3 call 0x3a788 ; 0x3a788 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[6], select_sheet_menu<6>); 1c476: 62 ea ldi r22, 0xA2 ; 162 1c478: 73 ed ldi r23, 0xD3 ; 211 1c47a: 8b e8 ldi r24, 0x8B ; 139 1c47c: 9d e0 ldi r25, 0x0D ; 13 1c47e: 0f 94 c4 d3 call 0x3a788 ; 0x3a788 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[7], select_sheet_menu<7>); 1c482: 6d e9 ldi r22, 0x9D ; 157 1c484: 73 ed ldi r23, 0xD3 ; 211 1c486: 86 e9 ldi r24, 0x96 ; 150 1c488: 9d e0 ldi r25, 0x0D ; 13 1c48a: 0f 94 c4 d3 call 0x3a788 ; 0x3a788 MENU_END(); 1c48e: 0f 94 6a d1 call 0x3a2d4 ; 0x3a2d4 lcd_sheet_menu(); } static void sheets_menu() { MENU_BEGIN(); 1c492: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1c496: 8f 5f subi r24, 0xFF ; 255 1c498: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1c49c: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1c4a0: 8f 5f subi r24, 0xFF ; 255 1c4a2: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1c4a6: b6 cf rjmp .-148 ; 0x1c414 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(); } 1c4a8: 08 95 ret 0001c4aa : lang_select(LANG_ID_PRI); } #endif static void wait_preheat() { 1c4aa: cf 92 push r12 1c4ac: df 92 push r13 1c4ae: ef 92 push r14 1c4b0: ff 92 push r15 current_position[Z_AXIS] = 100; //move in z axis to make space for loading filament 1c4b2: 80 e0 ldi r24, 0x00 ; 0 1c4b4: 90 e0 ldi r25, 0x00 ; 0 1c4b6: a8 ec ldi r26, 0xC8 ; 200 1c4b8: b2 e4 ldi r27, 0x42 ; 66 1c4ba: 80 93 9a 06 sts 0x069A, r24 ; 0x80069a 1c4be: 90 93 9b 06 sts 0x069B, r25 ; 0x80069b 1c4c2: a0 93 9c 06 sts 0x069C, r26 ; 0x80069c 1c4c6: b0 93 9d 06 sts 0x069D, r27 ; 0x80069d plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); 1c4ca: 65 e5 ldi r22, 0x55 ; 85 1c4cc: 75 e5 ldi r23, 0x55 ; 85 1c4ce: 85 e5 ldi r24, 0x55 ; 85 1c4d0: 91 e4 ldi r25, 0x41 ; 65 1c4d2: 0f 94 49 c0 call 0x38092 ; 0x38092 delay_keep_alive(2000); 1c4d6: 80 ed ldi r24, 0xD0 ; 208 1c4d8: 97 e0 ldi r25, 0x07 ; 7 1c4da: 0e 94 e4 8c call 0x119c8 ; 0x119c8 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 ac 72 call 0xe558 ; 0xe558 1c4e6: 0f 94 e4 1f call 0x23fc8 ; 0x23fc8 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 1c4ea: 60 91 b6 0d lds r22, 0x0DB6 ; 0x800db6 1c4ee: 70 91 b7 0d lds r23, 0x0DB7 ; 0x800db7 1c4f2: 07 2e mov r0, r23 1c4f4: 00 0c add r0, r0 1c4f6: 88 0b sbc r24, r24 1c4f8: 99 0b sbc r25, r25 1c4fa: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 1c4fe: 9b 01 movw r18, r22 1c500: ac 01 movw r20, r24 while (fabs(degHotend(0) - degTargetHotend(0)) > TEMP_HYSTERESIS) { 1c502: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 1c506: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 1c50a: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 1c50e: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 1c512: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 1c516: 9f 77 andi r25, 0x7F ; 127 1c518: 20 e0 ldi r18, 0x00 ; 0 1c51a: 30 e0 ldi r19, 0x00 ; 0 1c51c: 40 ea ldi r20, 0xA0 ; 160 1c51e: 50 e4 ldi r21, 0x40 ; 64 1c520: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 1c524: 18 16 cp r1, r24 1c526: b4 f5 brge .+108 ; 0x1c594 lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING)); 1c528: 8b e2 ldi r24, 0x2B ; 43 1c52a: 9c e3 ldi r25, 0x3C ; 60 1c52c: 0e 94 ac 72 call 0xe558 ; 0xe558 1c530: 0f 94 e4 1f call 0x23fc8 ; 0x23fc8 lcd_set_cursor(0, 4); 1c534: 64 e0 ldi r22, 0x04 ; 4 1c536: 80 e0 ldi r24, 0x00 ; 0 1c538: 0e 94 e0 6e call 0xddc0 ; 0xddc0 1c53c: 60 91 b6 0d lds r22, 0x0DB6 ; 0x800db6 1c540: 70 91 b7 0d lds r23, 0x0DB7 ; 0x800db7 1c544: 07 2e mov r0, r23 1c546: 00 0c add r0, r0 1c548: 88 0b sbc r24, r24 1c54a: 99 0b sbc r25, r25 1c54c: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__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)); 1c550: 20 e0 ldi r18, 0x00 ; 0 1c552: 30 e0 ldi r19, 0x00 ; 0 1c554: 40 e0 ldi r20, 0x00 ; 0 1c556: 5f e3 ldi r21, 0x3F ; 63 1c558: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 1c55c: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> 1c560: 6b 01 movw r12, r22 1c562: 20 e0 ldi r18, 0x00 ; 0 1c564: 30 e0 ldi r19, 0x00 ; 0 1c566: 40 e0 ldi r20, 0x00 ; 0 1c568: 5f e3 ldi r21, 0x3F ; 63 1c56a: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 1c56e: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 1c572: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 1c576: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 1c57a: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 1c57e: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> 1c582: a6 01 movw r20, r12 1c584: 82 e8 ldi r24, 0x82 ; 130 1c586: 0f 94 79 21 call 0x242f2 ; 0x242f2 delay_keep_alive(1000); 1c58a: 88 ee ldi r24, 0xE8 ; 232 1c58c: 93 e0 ldi r25, 0x03 ; 3 1c58e: 0e 94 e4 8c call 0x119c8 ; 0x119c8 1c592: ab cf rjmp .-170 ; 0x1c4ea } } 1c594: ff 90 pop r15 1c596: ef 90 pop r14 1c598: df 90 pop r13 1c59a: cf 90 pop r12 1c59c: 08 95 ret 0001c59e : } #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL static void lcd_language_menu() { 1c59e: cf 93 push r28 MENU_BEGIN(); 1c5a0: 0f 94 96 d1 call 0x3a32c ; 0x3a32c 1c5a4: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1c5a8: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1c5ac: 84 30 cpi r24, 0x04 ; 4 1c5ae: 08 f0 brcs .+2 ; 0x1c5b2 1c5b0: 4a c0 rjmp .+148 ; 0x1c646 1c5b2: 10 92 15 05 sts 0x0515, r1 ; 0x800515 if (lang_is_selected()) MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); // 1c5b6: 0e 94 1d 71 call 0xe23a ; 0xe23a 1c5ba: 88 23 and r24, r24 1c5bc: 31 f0 breq .+12 ; 0x1c5ca 1c5be: 86 e4 ldi r24, 0x46 ; 70 1c5c0: 98 e4 ldi r25, 0x48 ; 72 1c5c2: 0e 94 ac 72 call 0xe558 ; 0xe558 1c5c6: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 if (menu_item_text_P(lang_get_name_by_code(lang_get_code(0)))) //primary language 1c5ca: 8e e6 ldi r24, 0x6E ; 110 1c5cc: 95 e6 ldi r25, 0x65 ; 101 1c5ce: 0e 94 33 71 call 0xe266 ; 0xe266 1c5d2: 0f 94 44 d1 call 0x3a288 ; 0x3a288 1c5d6: 88 23 and r24, r24 1c5d8: 21 f0 breq .+8 ; 0x1c5e2 { menu_setlang(0); 1c5da: 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(); } 1c5dc: 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); 1c5de: 0c 94 8f e1 jmp 0x1c31e ; 0x1c31e 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(); 1c5e2: 0e 94 e9 71 call 0xe3d2 ; 0xe3d2 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 1c5e6: 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 1c5e8: 82 30 cpi r24, 0x02 ; 2 1c5ea: 51 f4 brne .+20 ; 0x1c600 1c5ec: 0e 94 0a 71 call 0xe214 ; 0xe214 { if (menu_item_text_P(lang_get_name_by_code(lang_get_code(1)))) 1c5f0: 0e 94 33 71 call 0xe266 ; 0xe266 1c5f4: 0f 94 44 d1 call 0x3a288 ; 0x3a288 1c5f8: 88 23 and r24, r24 1c5fa: 81 f0 breq .+32 ; 0x1c61c { menu_setlang(1); 1c5fc: 81 e0 ldi r24, 0x01 ; 1 1c5fe: ee cf rjmp .-36 ; 0x1c5dc 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)))) 1c600: 8c 2f mov r24, r28 1c602: 0e 94 9a 71 call 0xe334 ; 0xe334 1c606: 0e 94 33 71 call 0xe266 ; 0xe266 1c60a: 0f 94 44 d1 call 0x3a288 ; 0x3a288 1c60e: 88 23 and r24, r24 1c610: 11 f0 breq .+4 ; 0x1c616 { menu_setlang(i); 1c612: 8c 2f mov r24, r28 1c614: e3 cf rjmp .-58 ; 0x1c5dc 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 1c616: cf 5f subi r28, 0xFF ; 255 1c618: c8 30 cpi r28, 0x08 ; 8 1c61a: 91 f7 brne .-28 ; 0x1c600 return; } #ifdef COMMUNITY_LANGUAGE_SUPPORT #ifdef XFLASH MENU_ITEM_SUBMENU_P(_T(MSG_COMMUNITY_MADE), lcd_community_language_menu); 1c61c: 8b e4 ldi r24, 0x4B ; 75 1c61e: 9b e3 ldi r25, 0x3B ; 59 1c620: 0e 94 ac 72 call 0xe558 ; 0xe558 1c624: 6e ec ldi r22, 0xCE ; 206 1c626: 71 ee ldi r23, 0xE1 ; 225 1c628: 0f 94 14 d4 call 0x3a828 ; 0x3a828 #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL MENU_END(); 1c62c: 0f 94 6a d1 call 0x3a2d4 ; 0x3a2d4 #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL static void lcd_language_menu() { MENU_BEGIN(); 1c630: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1c634: 8f 5f subi r24, 0xFF ; 255 1c636: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1c63a: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1c63e: 8f 5f subi r24, 0xFF ; 255 1c640: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1c644: b1 cf rjmp .-158 ; 0x1c5a8 MENU_ITEM_SUBMENU_P(_T(MSG_COMMUNITY_MADE), lcd_community_language_menu); #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL MENU_END(); } 1c646: cf 91 pop r28 1c648: 08 95 ret 0001c64a : 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()") { 1c64a: cf 93 push r28 1c64c: 10 92 dc 03 sts 0x03DC, r1 ; 0x8003dc { //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); 1c650: c3 b1 in r28, 0x03 ; 3 lcd_puts_at_P(0, 0, MSG_PINDA); 1c652: 46 e7 ldi r20, 0x76 ; 118 1c654: 5a e6 ldi r21, 0x6A ; 106 1c656: 60 e0 ldi r22, 0x00 ; 0 1c658: 80 e0 ldi r24, 0x00 ; 0 1c65a: 0e 94 f4 6e call 0xdde8 ; 0xdde8 lcd_set_cursor(LCD_WIDTH - 14, 0); 1c65e: 60 e0 ldi r22, 0x00 ; 0 1c660: 86 e0 ldi r24, 0x06 ; 6 1c662: 0e 94 e0 6e call 0xddc0 ; 0xddc0 lcd_print_state(pinda_state); 1c666: c4 fb bst r28, 4 1c668: 88 27 eor r24, r24 1c66a: 80 f9 bld r24, 0 1c66c: 0f 94 8a 1f call 0x23f14 ; 0x23f14 if (MMU2::mmu2.Enabled()) { 1c670: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 1c674: 81 30 cpi r24, 0x01 ; 1 1c676: 99 f4 brne .+38 ; 0x1c69e inline bool Running() const { return state == State::Running; } inline bool FindaPressed() const { return regs8[0]; 1c678: c1 e0 ldi r28, 0x01 ; 1 1c67a: 80 91 90 13 lds r24, 0x1390 ; 0x801390 1c67e: 81 11 cpse r24, r1 1c680: 01 c0 rjmp .+2 ; 0x1c684 1c682: 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 1c684: 40 e7 ldi r20, 0x70 ; 112 1c686: 5a e6 ldi r21, 0x6A ; 106 1c688: 60 e0 ldi r22, 0x00 ; 0 1c68a: 8a e0 ldi r24, 0x0A ; 10 1c68c: 0e 94 f4 6e call 0xdde8 ; 0xdde8 lcd_set_cursor(LCD_WIDTH - 3, 0); 1c690: 60 e0 ldi r22, 0x00 ; 0 1c692: 81 e1 ldi r24, 0x11 ; 17 1c694: 0e 94 e0 6e call 0xddc0 ; 0xddc0 lcd_print_state(finda_state); 1c698: 8c 2f mov r24, r28 1c69a: 0f 94 8a 1f call 0x23f14 ; 0x23f14 1c69e: c1 e0 ldi r28, 0x01 ; 1 1c6a0: 80 91 b7 17 lds r24, 0x17B7 ; 0x8017b7 1c6a4: 81 11 cpse r24, r1 1c6a6: 01 c0 rjmp .+2 ; 0x1c6aa 1c6a8: c0 e0 ldi r28, 0x00 ; 0 } #ifdef FILAMENT_SENSOR idler_state = fsensor.getFilamentPresent(); lcd_puts_at_P(0, 1, _T(MSG_FSENSOR)); 1c6aa: 87 ea ldi r24, 0xA7 ; 167 1c6ac: 97 e4 ldi r25, 0x47 ; 71 1c6ae: 0e 94 ac 72 call 0xe558 ; 0xe558 1c6b2: ac 01 movw r20, r24 1c6b4: 61 e0 ldi r22, 0x01 ; 1 1c6b6: 80 e0 ldi r24, 0x00 ; 0 1c6b8: 0e 94 f4 6e call 0xdde8 ; 0xdde8 lcd_set_cursor(LCD_WIDTH - 3, 1); 1c6bc: 61 e0 ldi r22, 0x01 ; 1 1c6be: 81 e1 ldi r24, 0x11 ; 17 1c6c0: 0e 94 e0 6e call 0xddc0 ; 0xddc0 lcd_print_state(idler_state); 1c6c4: 8c 2f mov r24, r28 1c6c6: 0f 94 8a 1f call 0x23f14 ; 0x23f14 // 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); 1c6ca: 62 e0 ldi r22, 0x02 ; 2 1c6cc: 80 e0 ldi r24, 0x00 ; 0 1c6ce: 0e 94 e0 6e call 0xddc0 ; 0xddc0 lcd_printf_P(_N("B: %3d Xd:%6d\n" 1c6d2: 80 91 90 0e lds r24, 0x0E90 ; 0x800e90 1c6d6: 8f 93 push r24 1c6d8: 80 91 8f 0e lds r24, 0x0E8F ; 0x800e8f 1c6dc: 8f 93 push r24 1c6de: 80 91 bb 0d lds r24, 0x0DBB ; 0x800dbb 1c6e2: 1f 92 push r1 1c6e4: 8f 93 push r24 1c6e6: 80 91 98 03 lds r24, 0x0398 ; 0x800398 1c6ea: 8f 93 push r24 1c6ec: 80 91 97 03 lds r24, 0x0397 ; 0x800397 1c6f0: 8f 93 push r24 1c6f2: 80 91 ba 0d lds r24, 0x0DBA ; 0x800dba 1c6f6: 1f 92 push r1 1c6f8: 8f 93 push r24 1c6fa: 8c e4 ldi r24, 0x4C ; 76 1c6fc: 9a e6 ldi r25, 0x6A ; 106 1c6fe: 9f 93 push r25 1c700: 8f 93 push r24 1c702: 0e 94 b9 6e call 0xdd72 ; 0xdd72 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(); 1c706: 8d b7 in r24, 0x3d ; 61 1c708: 9e b7 in r25, 0x3e ; 62 1c70a: 0a 96 adiw r24, 0x0a ; 10 1c70c: 0f b6 in r0, 0x3f ; 63 1c70e: f8 94 cli 1c710: 9e bf out 0x3e, r25 ; 62 1c712: 0f be out 0x3f, r0 ; 63 1c714: 8d bf out 0x3d, r24 ; 61 } 1c716: 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(); 1c718: 0d 94 00 d5 jmp 0x3aa00 ; 0x3aa00 0001c71c : } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); } } void MMU2::Start() { 1c71c: 1f 93 push r17 1c71e: cf 93 push r28 1c720: df 93 push r29 } //uart init (io + FILE stream) void uart2_init(uint32_t baudRate) { DDRH &= ~0x01; 1c722: e1 e0 ldi r30, 0x01 ; 1 1c724: f1 e0 ldi r31, 0x01 ; 1 1c726: 80 81 ld r24, Z 1c728: 8e 7f andi r24, 0xFE ; 254 1c72a: 80 83 st Z, r24 PORTH |= 0x01; 1c72c: e2 e0 ldi r30, 0x02 ; 2 1c72e: f1 e0 ldi r31, 0x01 ; 1 1c730: 80 81 ld r24, Z 1c732: 81 60 ori r24, 0x01 ; 1 1c734: 80 83 st Z, r24 //#include void rbuf_ini(uint8_t* ptr, uint8_t l) { ptr[0] = l; 1c736: ea e3 ldi r30, 0x3A ; 58 1c738: f5 e0 ldi r31, 0x05 ; 5 1c73a: 90 e1 ldi r25, 0x10 ; 16 1c73c: 90 83 st Z, r25 ptr[1] = 0; 1c73e: 11 82 std Z+1, r1 ; 0x01 ptr[2] = 0; 1c740: 12 82 std Z+2, r1 ; 0x02 rbuf_ini(uart2_ibuf, sizeof(uart2_ibuf) - 4); UCSR2A |= (1 << U2X2); // baudrate multiplier 1c742: e0 ed ldi r30, 0xD0 ; 208 1c744: f0 e0 ldi r31, 0x00 ; 0 1c746: 80 81 ld r24, Z 1c748: 82 60 ori r24, 0x02 ; 2 1c74a: 80 83 st Z, r24 UBRR2L = UART_BAUD_SELECT(baudRate, F_CPU); // select baudrate 1c74c: 90 93 d4 00 sts 0x00D4, r25 ; 0x8000d4 <__TEXT_REGION_LENGTH__+0x7c20d4> UCSR2B = (1 << RXEN2) | (1 << TXEN2); // enable receiver and transmitter 1c750: e1 ed ldi r30, 0xD1 ; 209 1c752: f0 e0 ldi r31, 0x00 ; 0 1c754: 88 e1 ldi r24, 0x18 ; 24 1c756: 80 83 st Z, r24 UCSR2B |= (1 << RXCIE2); // enable rx interrupt 1c758: 80 81 ld r24, Z 1c75a: 80 68 ori r24, 0x80 ; 128 1c75c: 80 83 st Z, r24 fdev_setup_stream(uart2io, uart2_putchar, uart2_getchar, _FDEV_SETUP_WRITE | _FDEV_SETUP_READ); //setup uart2 i/o stream 1c75e: e4 e9 ldi r30, 0x94 ; 148 1c760: f2 e1 ldi r31, 0x12 ; 18 1c762: 8a eb ldi r24, 0xBA ; 186 1c764: 9a e3 ldi r25, 0x3A ; 58 1c766: 91 87 std Z+9, r25 ; 0x09 1c768: 80 87 std Z+8, r24 ; 0x08 1c76a: 8c ec ldi r24, 0xCC ; 204 1c76c: 9a e3 ldi r25, 0x3A ; 58 1c76e: 93 87 std Z+11, r25 ; 0x0b 1c770: 82 87 std Z+10, r24 ; 0x0a 1c772: 13 e0 ldi r17, 0x03 ; 3 1c774: 13 83 std Z+3, r17 ; 0x03 1c776: 15 86 std Z+13, r1 ; 0x0d 1c778: 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); 1c77a: 9f b7 in r25, 0x3f ; 63 1c77c: f8 94 cli 1c77e: e5 e0 ldi r30, 0x05 ; 5 1c780: f1 e0 ldi r31, 0x01 ; 1 1c782: 80 81 ld r24, Z 1c784: 80 62 ori r24, 0x20 ; 32 1c786: 80 83 st Z, r24 1c788: 9f bf out 0x3f, r25 ; 63 SET_OUTPUT(MMU_RST_PIN); // setup reset pin 1c78a: e4 e0 ldi r30, 0x04 ; 4 1c78c: f1 e0 ldi r31, 0x01 ; 1 1c78e: 80 81 ld r24, Z 1c790: 80 62 ori r24, 0x20 ; 32 1c792: 80 83 st Z, r24 #endif //MMU_HWRESET reset(); 1c794: 0f 94 9a c5 call 0x38b34 ; 0x38b34 mmu2Serial.begin(MMU_BAUD); PowerOn(); mmu2Serial.flush(); // make sure the UART buffer is clear before starting communication SetCurrentTool(MMU2_NO_TOOL); 1c798: 83 e6 ldi r24, 0x63 ; 99 1c79a: 0f 94 03 88 call 0x31006 ; 0x31006 retryAttempts--; } } void ProtocolLogic::ResetRetryAttempts() { SERIAL_ECHOLNPGM("ResetRetryAttempts"); 1c79e: 8b e8 ldi r24, 0x8B ; 139 1c7a0: 97 ea ldi r25, 0xA7 ; 167 1c7a2: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 retryAttempts = MAX_RETRIES; 1c7a6: cb e4 ldi r28, 0x4B ; 75 1c7a8: d3 e1 ldi r29, 0x13 ; 19 1c7aa: 10 93 9f 13 sts 0x139F, r17 ; 0x80139f } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 1c7ae: 85 e6 ldi r24, 0x65 ; 101 1c7b0: 9b ea ldi r25, 0xAB ; 171 1c7b2: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 /// @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; } 1c7b6: 8a e0 ldi r24, 0x0A ; 10 1c7b8: 8c 8b std Y+20, r24 ; 0x14 // start the communication logic.ResetRetryAttempts(); logic.ResetCommunicationTimeoutAttempts(); state = xState::Connecting; 1c7ba: 82 e0 ldi r24, 0x02 ; 2 1c7bc: 80 93 ba 13 sts 0x13BA, r24 ; 0x8013ba initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 1c7c0: 81 e0 ldi r24, 0x01 ; 1 1c7c2: 8d 8f std Y+29, r24 ; 0x1d currentScope = Scope::StartSeq; 1c7c4: 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; 1c7c6: 1c a2 std Y+36, r1 ; 0x24 LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 1c7c8: 86 e0 ldi r24, 0x06 ; 6 1c7ca: 8c 83 std Y+4, r24 ; 0x04 SendVersion(0); 1c7cc: 80 e0 ldi r24, 0x00 ; 0 logic.Start(); } 1c7ce: df 91 pop r29 1c7d0: cf 91 pop r28 1c7d2: 1f 91 pop r17 1c7d4: 0d 94 7c a5 jmp 0x34af8 ; 0x34af8 0001c7d8 : #endif // MMU_FORCE_STEALTH_MODE } static void mmu_enable_switch() { uint8_t current_state = eeprom_read_byte((uint8_t *)EEPROM_MMU_ENABLED); 1c7d8: 8c ea ldi r24, 0xAC ; 172 1c7da: 9c e0 ldi r25, 0x0C ; 12 1c7dc: 0f 94 1c dc call 0x3b838 ; 0x3b838 if (current_state) 1c7e0: 88 23 and r24, r24 1c7e2: 61 f0 breq .+24 ; 0x1c7fc StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 1c7e4: 10 92 ba 13 sts 0x13BA, r1 ; 0x8013ba protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 1c7e8: 10 92 68 13 sts 0x1368, r1 ; 0x801368 currentScope = Scope::Stopped; 1c7ec: 10 92 4d 13 sts 0x134D, r1 ; 0x80134d else { MMU2::mmu2.Start(); } eeprom_toggle((uint8_t *)EEPROM_MMU_ENABLED); 1c7f0: 8c ea ldi r24, 0xAC ; 172 1c7f2: 9c e0 ldi r25, 0x0C ; 12 1c7f4: 0e 94 34 76 call 0xec68 ; 0xec68 MMU2::mmu2.Status(); 1c7f8: 0d 94 e3 74 jmp 0x2e9c6 ; 0x2e9c6 { MMU2::mmu2.Stop(); } else { MMU2::mmu2.Start(); 1c7fc: 0e 94 8e e3 call 0x1c71c ; 0x1c71c 1c800: f7 cf rjmp .-18 ; 0x1c7f0 0001c802 : //! //! @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) 1c802: 4f 92 push r4 1c804: 5f 92 push r5 1c806: 6f 92 push r6 1c808: 7f 92 push r7 1c80a: 8f 92 push r8 1c80c: 9f 92 push r9 1c80e: af 92 push r10 1c810: bf 92 push r11 1c812: cf 92 push r12 1c814: df 92 push r13 1c816: ef 92 push r14 1c818: ff 92 push r15 1c81a: 0f 93 push r16 1c81c: 1f 93 push r17 1c81e: cf 93 push r28 1c820: df 93 push r29 1c822: 6c 01 movw r12, r24 1c824: 7b 01 movw r14, r22 1c826: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba { //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); 1c82a: 67 2b or r22, r23 1c82c: 29 f0 breq .+10 ; 0x1c838 1c82e: 06 e0 ldi r16, 0x06 ; 6 1c830: 81 30 cpi r24, 0x01 ; 1 1c832: 29 f0 breq .+10 ; 0x1c83e 1c834: 05 e0 ldi r16, 0x05 ; 5 1c836: 03 c0 rjmp .+6 ; 0x1c83e 1c838: 04 e0 ldi r16, 0x04 ; 4 1c83a: 81 30 cpi r24, 0x01 ; 1 1c83c: d9 f3 breq .-10 ; 0x1c834 const uint8_t item_len = item?strlen_P(item):0; int8_t first = 0; int8_t cursor_pos = 1; lcd_clear(); 1c83e: 0e 94 13 6f call 0xde26 ; 0xde26 KEEPALIVE_STATE(PAUSED_FOR_USER); 1c842: 84 e0 ldi r24, 0x04 ; 4 1c844: 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; 1c848: 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; 1c84a: 81 2c mov r8, r1 } if (cursor_pos > 3) { cursor_pos = 3; if (first < items_no - 3) 1c84c: 03 50 subi r16, 0x03 ; 3 1c84e: 11 0b sbc r17, r17 lcd_clear(); KEEPALIVE_STATE(PAUSED_FOR_USER); while (1) { manage_heater(); 1c850: 0f 94 5c 38 call 0x270b8 ; 0x270b8 manage_inactivity(true); 1c854: 81 e0 ldi r24, 0x01 ; 1 1c856: 0e 94 af 8a call 0x1155e ; 0x1155e if (lcd_encoder) 1c85a: 80 91 70 06 lds r24, 0x0670 ; 0x800670 1c85e: 90 91 71 06 lds r25, 0x0671 ; 0x800671 1c862: 00 97 sbiw r24, 0x00 ; 0 1c864: 09 f4 brne .+2 ; 0x1c868 1c866: 9d c0 rjmp .+314 ; 0x1c9a2 { if (lcd_encoder < 0) 1c868: 97 ff sbrs r25, 7 1c86a: 88 c0 rjmp .+272 ; 0x1c97c { cursor_pos--; 1c86c: c1 50 subi r28, 0x01 ; 1 if (lcd_encoder > 0) { cursor_pos++; } lcd_encoder = 0; 1c86e: 10 92 71 06 sts 0x0671, r1 ; 0x800671 1c872: 10 92 70 06 sts 0x0670, r1 ; 0x800670 } if (cursor_pos > 3) 1c876: c4 30 cpi r28, 0x04 ; 4 1c878: 0c f4 brge .+2 ; 0x1c87c 1c87a: 86 c0 rjmp .+268 ; 0x1c988 { cursor_pos = 3; if (first < items_no - 3) 1c87c: 88 2d mov r24, r8 1c87e: 08 2c mov r0, r8 1c880: 00 0c add r0, r0 1c882: 99 0b sbc r25, r25 1c884: 80 17 cp r24, r16 1c886: 91 07 cpc r25, r17 1c888: 0c f0 brlt .+2 ; 0x1c88c 1c88a: 7a c0 rjmp .+244 ; 0x1c980 { first++; 1c88c: 83 94 inc r8 lcd_clear(); 1c88e: 0e 94 13 6f call 0xde26 ; 0xde26 lcd_encoder = 0; } if (cursor_pos > 3) { cursor_pos = 3; 1c892: 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); 1c894: c1 14 cp r12, r1 1c896: d1 04 cpc r13, r1 1c898: 29 f0 breq .+10 ; 0x1c8a4 1c89a: a6 01 movw r20, r12 1c89c: 60 e0 ldi r22, 0x00 ; 0 1c89e: 80 e0 ldi r24, 0x00 ; 0 1c8a0: 0e 94 f4 6e call 0xdde8 ; 0xdde8 const bool last_visible = (first == items_no - 3); 1c8a4: a8 2c mov r10, r8 1c8a6: 08 2c mov r0, r8 1c8a8: 00 0c add r0, r0 1c8aa: bb 08 sbc r11, r11 const uint_least8_t ordinary_items = (last_item&&last_visible)?2:3; 1c8ac: e1 14 cp r14, r1 1c8ae: f1 04 cpc r15, r1 1c8b0: 29 f0 breq .+10 ; 0x1c8bc 1c8b2: 82 e0 ldi r24, 0x02 ; 2 1c8b4: 98 2e mov r9, r24 1c8b6: a0 16 cp r10, r16 1c8b8: b1 06 cpc r11, r17 1c8ba: 11 f0 breq .+4 ; 0x1c8c0 1c8bc: 93 e0 ldi r25, 0x03 ; 3 1c8be: 99 2e mov r9, r25 for (uint_least8_t i = 0; i < ordinary_items; i++) 1c8c0: d0 e0 ldi r29, 0x00 ; 0 { if (item) lcd_puts_at_P(1, i + 1, item); 1c8c2: df 5f subi r29, 0xFF ; 255 1c8c4: 4e eb ldi r20, 0xBE ; 190 1c8c6: 5d e6 ldi r21, 0x6D ; 109 1c8c8: 6d 2f mov r22, r29 1c8ca: 81 e0 ldi r24, 0x01 ; 1 1c8cc: 0e 94 f4 6e call 0xdde8 ; 0xdde8 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++) 1c8d0: 9d 12 cpse r9, r29 1c8d2: f7 cf rjmp .-18 ; 0x1c8c2 1c8d4: 48 2c mov r4, r8 1c8d6: 08 2c mov r0, r8 1c8d8: 00 0c add r0, r0 1c8da: 55 08 sbc r5, r5 1c8dc: 66 08 sbc r6, r6 1c8de: 77 08 sbc r7, r7 1c8e0: 8f ef ldi r24, 0xFF ; 255 1c8e2: 48 1a sub r4, r24 1c8e4: 58 0a sbc r5, r24 1c8e6: 68 0a sbc r6, r24 1c8e8: 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++) 1c8ea: 91 2c mov r9, r1 { lcd_set_cursor(2 + item_len, i+1); 1c8ec: 93 94 inc r9 1c8ee: 69 2d mov r22, r9 1c8f0: 8a e0 ldi r24, 0x0A ; 10 1c8f2: 0e 94 e0 6e call 0xddc0 ; 0xddc0 1c8f6: c3 01 movw r24, r6 1c8f8: b2 01 movw r22, r4 1c8fa: 0e 94 99 70 call 0xe132 ; 0xe132 1c8fe: 8f ef ldi r24, 0xFF ; 255 1c900: 48 1a sub r4, r24 1c902: 58 0a sbc r5, r24 1c904: 68 0a sbc r6, r24 1c906: 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++) 1c908: d9 11 cpse r29, r9 1c90a: f0 cf rjmp .-32 ; 0x1c8ec { 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); 1c90c: e1 14 cp r14, r1 1c90e: f1 04 cpc r15, r1 1c910: 41 f0 breq .+16 ; 0x1c922 1c912: a0 16 cp r10, r16 1c914: b1 06 cpc r11, r17 1c916: 29 f4 brne .+10 ; 0x1c922 1c918: a7 01 movw r20, r14 1c91a: 63 e0 ldi r22, 0x03 ; 3 1c91c: 81 e0 ldi r24, 0x01 ; 1 1c91e: 0e 94 f4 6e call 0xdde8 ; 0xdde8 lcd_puts_at_P(0, 1, PSTR(" \n \n ")); 1c922: 47 ef ldi r20, 0xF7 ; 247 1c924: 5e e8 ldi r21, 0x8E ; 142 1c926: 61 e0 ldi r22, 0x01 ; 1 1c928: 80 e0 ldi r24, 0x00 ; 0 1c92a: 0e 94 f4 6e call 0xdde8 ; 0xdde8 lcd_putc_at(0, cursor_pos, '>'); 1c92e: 4e e3 ldi r20, 0x3E ; 62 1c930: 6c 2f mov r22, r28 1c932: 80 e0 ldi r24, 0x00 ; 0 1c934: 0e 94 00 6f call 0xde00 ; 0xde00 _delay(100); 1c938: 64 e6 ldi r22, 0x64 ; 100 1c93a: 70 e0 ldi r23, 0x00 ; 0 1c93c: 80 e0 ldi r24, 0x00 ; 0 1c93e: 90 e0 ldi r25, 0x00 ; 0 1c940: 0f 94 53 27 call 0x24ea6 ; 0x24ea6 if (lcd_clicked()) 1c944: 0e 94 fd 70 call 0xe1fa ; 0xe1fa 1c948: 88 23 and r24, r24 1c94a: 09 f4 brne .+2 ; 0x1c94e 1c94c: 81 cf rjmp .-254 ; 0x1c850 { KEEPALIVE_STATE(IN_HANDLER); 1c94e: 82 e0 ldi r24, 0x02 ; 2 1c950: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be return(cursor_pos + first - 1); 1c954: 8f ef ldi r24, 0xFF ; 255 1c956: 8c 0f add r24, r28 1c958: 88 0d add r24, r8 } } } 1c95a: df 91 pop r29 1c95c: cf 91 pop r28 1c95e: 1f 91 pop r17 1c960: 0f 91 pop r16 1c962: ff 90 pop r15 1c964: ef 90 pop r14 1c966: df 90 pop r13 1c968: cf 90 pop r12 1c96a: bf 90 pop r11 1c96c: af 90 pop r10 1c96e: 9f 90 pop r9 1c970: 8f 90 pop r8 1c972: 7f 90 pop r7 1c974: 6f 90 pop r6 1c976: 5f 90 pop r5 1c978: 4f 90 pop r4 1c97a: 08 95 ret cursor_pos--; } if (lcd_encoder > 0) { cursor_pos++; 1c97c: cf 5f subi r28, 0xFF ; 255 1c97e: 77 cf rjmp .-274 ; 0x1c86e 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); 1c980: 87 e0 ldi r24, 0x07 ; 7 1c982: 0f 94 07 4e call 0x29c0e ; 0x29c0e 1c986: 85 cf rjmp .-246 ; 0x1c892 } } if (cursor_pos < 1) 1c988: c1 11 cpse r28, r1 1c98a: 84 cf rjmp .-248 ; 0x1c894 { cursor_pos = 1; if (first > 0) 1c98c: 18 14 cp r1, r8 1c98e: 2c f4 brge .+10 ; 0x1c99a { first--; 1c990: 8a 94 dec r8 lcd_clear(); 1c992: 0e 94 13 6f call 0xde26 ; 0xde26 } } if (cursor_pos < 1) { cursor_pos = 1; 1c996: c1 e0 ldi r28, 0x01 ; 1 1c998: 7d cf rjmp .-262 ; 0x1c894 if (first > 0) { first--; lcd_clear(); } else { // here we are at the very end of the list Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 1c99a: 87 e0 ldi r24, 0x07 ; 7 1c99c: 0f 94 07 4e call 0x29c0e ; 0x29c0e 1c9a0: fa cf rjmp .-12 ; 0x1c996 cursor_pos++; } lcd_encoder = 0; } if (cursor_pos > 3) 1c9a2: c4 30 cpi r28, 0x04 ; 4 1c9a4: 0c f0 brlt .+2 ; 0x1c9a8 1c9a6: 6a cf rjmp .-300 ; 0x1c87c 1c9a8: 75 cf rjmp .-278 ; 0x1c894 0001c9aa : 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() { 1c9aa: cf 93 push r28 1c9ac: df 93 push r29 if (MMU2::mmu2.Enabled()) { 1c9ae: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 1c9b2: 81 30 cpi r24, 0x01 ; 1 1c9b4: f9 f4 brne .+62 ; 0x1c9f4 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 1c9b6: 80 ec ldi r24, 0xC0 ; 192 1c9b8: 9b e3 ldi r25, 0x3B ; 59 1c9ba: 0e 94 ac 72 call 0xe558 ; 0xe558 1c9be: ec 01 movw r28, r24 } void lcd_v2_calibration() { if (MMU2::mmu2.Enabled()) { const uint8_t filament = choose_menu_P( 1c9c0: 8d ea ldi r24, 0xAD ; 173 1c9c2: 9b e3 ldi r25, 0x3B ; 59 1c9c4: 0e 94 ac 72 call 0xe558 ; 0xe558 1c9c8: be 01 movw r22, r28 1c9ca: 6f 5f subi r22, 0xFF ; 255 1c9cc: 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 1c9ce: 0e 94 01 e4 call 0x1c802 ; 0x1c802 if (filament < MMU_FILAMENT_COUNT) { 1c9d2: 85 30 cpi r24, 0x05 ; 5 1c9d4: 98 f5 brcc .+102 ; 0x1ca3c lay1cal_filament = filament; 1c9d6: 80 93 fa 03 sts 0x03FA, r24 ; 0x8003fa return; } } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; 1c9da: 8a e0 ldi r24, 0x0A ; 10 1c9dc: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 menu_goto(lcd_generic_preheat_menu, 0, true); 1c9e0: 20 e0 ldi r18, 0x00 ; 0 1c9e2: 41 e0 ldi r20, 0x01 ; 1 1c9e4: 70 e0 ldi r23, 0x00 ; 0 1c9e6: 60 e0 ldi r22, 0x00 ; 0 1c9e8: 8a e7 ldi r24, 0x7A ; 122 1c9ea: 99 e3 ldi r25, 0x39 ; 57 } 1c9ec: df 91 pop r29 1c9ee: cf 91 pop r28 } } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; menu_goto(lcd_generic_preheat_menu, 0, true); 1c9f0: 0d 94 c0 d1 jmp 0x3a380 ; 0x3a380 menu_back(); return; } } #ifdef FILAMENT_SENSOR else if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 1c9f4: 8f e5 ldi r24, 0x5F ; 95 1c9f6: 9f e0 ldi r25, 0x0F ; 15 1c9f8: 0f 94 1c dc call 0x3b838 ; 0x3b838 1c9fc: 81 11 cpse r24, r1 1c9fe: ed cf rjmp .-38 ; 0x1c9da { bool loaded = false; if (fsensor.isReady()) { 1ca00: 80 91 aa 17 lds r24, 0x17AA ; 0x8017aa 1ca04: 82 30 cpi r24, 0x02 ; 2 1ca06: f1 f4 brne .+60 ; 0x1ca44 1ca08: 80 91 b7 17 lds r24, 0x17B7 ; 0x8017b7 1ca0c: 81 11 cpse r24, r1 1ca0e: e5 cf rjmp .-54 ; 0x1c9da 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)); 1ca10: 8f e8 ldi r24, 0x8F ; 143 1ca12: 9b e3 ldi r25, 0x3B ; 59 1ca14: 0e 94 ac 72 call 0xe558 ; 0xe558 1ca18: 0f 94 e4 1f call 0x23fc8 ; 0x23fc8 lcd_consume_click(); 1ca1c: 0e 94 f8 70 call 0xe1f0 ; 0xe1f0 1ca20: c4 e1 ldi r28, 0x14 ; 20 for (uint_least8_t i = 0; i < 20; i++) { //wait max. 2s delay_keep_alive(100); 1ca22: 84 e6 ldi r24, 0x64 ; 100 1ca24: 90 e0 ldi r25, 0x00 ; 0 1ca26: 0e 94 e4 8c call 0x119c8 ; 0x119c8 if (lcd_clicked()) { 1ca2a: 0e 94 fd 70 call 0xe1fa ; 0xe1fa 1ca2e: 81 11 cpse r24, r1 1ca30: 02 c0 rjmp .+4 ; 0x1ca36 1ca32: 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 1ca34: b1 f7 brne .-20 ; 0x1ca22 delay_keep_alive(100); if (lcd_clicked()) { break; } } lcd_update_enabled = true; 1ca36: 81 e0 ldi r24, 0x01 ; 1 1ca38: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; menu_goto(lcd_generic_preheat_menu, 0, true); } 1ca3c: df 91 pop r29 1ca3e: cf 91 pop r28 if (lcd_clicked()) { break; } } lcd_update_enabled = true; menu_back(); 1ca40: 0d 94 5e d4 jmp 0x3a8bc ; 0x3a8bc { 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); 1ca44: 86 ec ldi r24, 0xC6 ; 198 1ca46: 90 e4 ldi r25, 0x40 ; 64 1ca48: 0e 94 ac 72 call 0xe558 ; 0xe558 1ca4c: 41 e0 ldi r20, 0x01 ; 1 1ca4e: 60 e0 ldi r22, 0x00 ; 0 1ca50: 0f 94 40 4f call 0x29e80 ; 0x29e80 1ca54: 91 e0 ldi r25, 0x01 ; 1 1ca56: 81 11 cpse r24, r1 1ca58: 90 e0 ldi r25, 0x00 ; 0 lcd_update_enabled = true; 1ca5a: 81 e0 ldi r24, 0x01 ; 1 1ca5c: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e } if (!loaded) { 1ca60: 91 11 cpse r25, r1 1ca62: bb cf rjmp .-138 ; 0x1c9da 1ca64: d5 cf rjmp .-86 ; 0x1ca10 0001ca66 : { 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) 1ca66: 2f 92 push r2 1ca68: 3f 92 push r3 1ca6a: 4f 92 push r4 1ca6c: 5f 92 push r5 1ca6e: 6f 92 push r6 1ca70: 7f 92 push r7 1ca72: 8f 92 push r8 1ca74: 9f 92 push r9 1ca76: af 92 push r10 1ca78: bf 92 push r11 1ca7a: cf 92 push r12 1ca7c: df 92 push r13 1ca7e: ef 92 push r14 1ca80: ff 92 push r15 1ca82: 0f 93 push r16 1ca84: 1f 93 push r17 1ca86: cf 93 push r28 1ca88: df 93 push r29 1ca8a: 00 d0 rcall .+0 ; 0x1ca8c 1ca8c: 00 d0 rcall .+0 ; 0x1ca8e 1ca8e: 1f 92 push r1 1ca90: cd b7 in r28, 0x3d ; 61 1ca92: de b7 in r29, 0x3e ; 62 1ca94: 69 83 std Y+1, r22 ; 0x01 1ca96: 49 01 movw r8, r18 1ca98: 5a 01 movw r10, r20 1ca9a: 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; 1ca9c: 68 2f mov r22, r24 1ca9e: 70 e0 ldi r23, 0x00 ; 0 1caa0: 90 e0 ldi r25, 0x00 ; 0 1caa2: 80 e0 ldi r24, 0x00 ; 0 1caa4: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 1caa8: 24 e0 ldi r18, 0x04 ; 4 1caaa: 32 e0 ldi r19, 0x02 ; 2 1caac: 41 e0 ldi r20, 0x01 ; 1 1caae: 5c e3 ldi r21, 0x3C ; 60 1cab0: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__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] 1cab4: 20 91 da 12 lds r18, 0x12DA ; 0x8012da <_ZN13thermal_modelL4dataE.lto_priv.400+0x2a> 1cab8: 30 91 db 12 lds r19, 0x12DB ; 0x8012db <_ZN13thermal_modelL4dataE.lto_priv.400+0x2b> 1cabc: 40 91 dc 12 lds r20, 0x12DC ; 0x8012dc <_ZN13thermal_modelL4dataE.lto_priv.400+0x2c> 1cac0: 50 91 dd 12 lds r21, 0x12DD ; 0x8012dd <_ZN13thermal_modelL4dataE.lto_priv.400+0x2d> 1cac4: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 1cac8: 6b 01 movw r12, r22 1caca: 7c 01 movw r14, r24 dP *= (cur_heater_temp * U) + V; // linear temp. correction 1cacc: 20 91 de 12 lds r18, 0x12DE ; 0x8012de <_ZN13thermal_modelL4dataE.lto_priv.400+0x2e> 1cad0: 30 91 df 12 lds r19, 0x12DF ; 0x8012df <_ZN13thermal_modelL4dataE.lto_priv.400+0x2f> 1cad4: 40 91 e0 12 lds r20, 0x12E0 ; 0x8012e0 <_ZN13thermal_modelL4dataE.lto_priv.400+0x30> 1cad8: 50 91 e1 12 lds r21, 0x12E1 ; 0x8012e1 <_ZN13thermal_modelL4dataE.lto_priv.400+0x31> 1cadc: c5 01 movw r24, r10 1cade: b4 01 movw r22, r8 1cae0: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 1cae4: 20 91 e2 12 lds r18, 0x12E2 ; 0x8012e2 <_ZN13thermal_modelL4dataE.lto_priv.400+0x32> 1cae8: 30 91 e3 12 lds r19, 0x12E3 ; 0x8012e3 <_ZN13thermal_modelL4dataE.lto_priv.400+0x33> 1caec: 40 91 e4 12 lds r20, 0x12E4 ; 0x8012e4 <_ZN13thermal_modelL4dataE.lto_priv.400+0x34> 1caf0: 50 91 e5 12 lds r21, 0x12E5 ; 0x8012e5 <_ZN13thermal_modelL4dataE.lto_priv.400+0x35> 1caf4: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 1caf8: a7 01 movw r20, r14 1cafa: 96 01 movw r18, r12 1cafc: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 1cb00: 6b 01 movw r12, r22 1cb02: 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; 1cb04: 20 91 30 13 lds r18, 0x1330 ; 0x801330 <_ZN13thermal_modelL4dataE.lto_priv.400+0x80> 1cb08: 30 91 31 13 lds r19, 0x1331 ; 0x801331 <_ZN13thermal_modelL4dataE.lto_priv.400+0x81> 1cb0c: 40 91 32 13 lds r20, 0x1332 ; 0x801332 <_ZN13thermal_modelL4dataE.lto_priv.400+0x82> 1cb10: 50 91 33 13 lds r21, 0x1333 ; 0x801333 <_ZN13thermal_modelL4dataE.lto_priv.400+0x83> 1cb14: c8 01 movw r24, r16 1cb16: b2 01 movw r22, r4 1cb18: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 1cb1c: 9b 01 movw r18, r22 1cb1e: 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 1cb20: c5 01 movw r24, r10 1cb22: b4 01 movw r22, r8 1cb24: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__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) 1cb28: 39 81 ldd r19, Y+1 ; 0x01 1cb2a: 24 e0 ldi r18, 0x04 ; 4 1cb2c: 32 9f mul r19, r18 1cb2e: f0 01 movw r30, r0 1cb30: 11 24 eor r1, r1 1cb32: e0 51 subi r30, 0x10 ; 16 1cb34: 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 1cb36: 20 81 ld r18, Z 1cb38: 31 81 ldd r19, Z+1 ; 0x01 1cb3a: 42 81 ldd r20, Z+2 ; 0x02 1cb3c: 53 81 ldd r21, Z+3 ; 0x03 1cb3e: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 1cb42: 9b 01 movw r18, r22 1cb44: ac 01 movw r20, r24 float dT = (dP - dPl) * C_i; // expected temperature difference (K) 1cb46: c7 01 movw r24, r14 1cb48: b6 01 movw r22, r12 1cb4a: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 1cb4e: 20 91 3d 13 lds r18, 0x133D ; 0x80133d <_ZN13thermal_modelL4dataE.lto_priv.400+0x8d> 1cb52: 30 91 3e 13 lds r19, 0x133E ; 0x80133e <_ZN13thermal_modelL4dataE.lto_priv.400+0x8e> 1cb56: 40 91 3f 13 lds r20, 0x133F ; 0x80133f <_ZN13thermal_modelL4dataE.lto_priv.400+0x8f> 1cb5a: 50 91 40 13 lds r21, 0x1340 ; 0x801340 <_ZN13thermal_modelL4dataE.lto_priv.400+0x90> 1cb5e: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 1cb62: 6f 83 std Y+7, r22 ; 0x07 1cb64: 79 83 std Y+1, r23 ; 0x01 1cb66: 18 2f mov r17, r24 1cb68: 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); 1cb6a: 20 91 d1 12 lds r18, 0x12D1 ; 0x8012d1 <_ZN13thermal_modelL4dataE.lto_priv.400+0x21> 1cb6e: e2 2f mov r30, r18 1cb70: f0 e0 ldi r31, 0x00 ; 0 1cb72: 80 91 d0 12 lds r24, 0x12D0 ; 0x8012d0 <_ZN13thermal_modelL4dataE.lto_priv.400+0x20> 1cb76: 81 50 subi r24, 0x01 ; 1 1cb78: 99 0b sbc r25, r25 1cb7a: e8 17 cp r30, r24 1cb7c: f9 07 cpc r31, r25 1cb7e: 09 f4 brne .+2 ; 0x1cb82 1cb80: f4 c0 rjmp .+488 ; 0x1cd6a 1cb82: 2f 5f subi r18, 0xFF ; 255 1cb84: 2e 83 std Y+6, r18 ; 0x06 float dT_lag = dT_lag_buf[dT_next_idx]; 1cb86: 5e 81 ldd r21, Y+6 ; 0x06 1cb88: 44 e0 ldi r20, 0x04 ; 4 1cb8a: 54 9f mul r21, r20 1cb8c: 10 01 movw r2, r0 1cb8e: 11 24 eor r1, r1 1cb90: d1 01 movw r26, r2 1cb92: a0 55 subi r26, 0x50 ; 80 1cb94: bd 4e sbci r27, 0xED ; 237 1cb96: 2d 91 ld r18, X+ 1cb98: 3d 91 ld r19, X+ 1cb9a: 4d 91 ld r20, X+ 1cb9c: 5c 91 ld r21, X 1cb9e: 2a 83 std Y+2, r18 ; 0x02 1cba0: 3b 83 std Y+3, r19 ; 0x03 1cba2: 4c 83 std Y+4, r20 ; 0x04 1cba4: 5d 83 std Y+5, r21 ; 0x05 float dT_lag_prev = dT_lag_buf[dT_lag_idx]; 1cba6: ee 0f add r30, r30 1cba8: ff 1f adc r31, r31 1cbaa: ee 0f add r30, r30 1cbac: ff 1f adc r31, r31 1cbae: e0 55 subi r30, 0x50 ; 80 1cbb0: fd 4e sbci r31, 0xED ; 237 1cbb2: 40 80 ld r4, Z 1cbb4: 51 80 ldd r5, Z+1 ; 0x01 1cbb6: 62 80 ldd r6, Z+2 ; 0x02 1cbb8: 73 80 ldd r7, Z+3 ; 0x03 float dT_f = iir_mul(dT_lag_prev, dT, fS, dT); 1cbba: c0 90 ea 12 lds r12, 0x12EA ; 0x8012ea <_ZN13thermal_modelL4dataE.lto_priv.400+0x3a> 1cbbe: d0 90 eb 12 lds r13, 0x12EB ; 0x8012eb <_ZN13thermal_modelL4dataE.lto_priv.400+0x3b> 1cbc2: e0 90 ec 12 lds r14, 0x12EC ; 0x8012ec <_ZN13thermal_modelL4dataE.lto_priv.400+0x3c> 1cbc6: f0 90 ed 12 lds r15, 0x12ED ; 0x8012ed <_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; 1cbca: 92 01 movw r18, r4 1cbcc: a3 01 movw r20, r6 1cbce: b2 01 movw r22, r4 1cbd0: c3 01 movw r24, r6 1cbd2: 0f 94 52 e1 call 0x3c2a4 ; 0x3c2a4 <__unordsf2> 1cbd6: 88 23 and r24, r24 1cbd8: 21 f0 breq .+8 ; 0x1cbe2 1cbda: 4f 80 ldd r4, Y+7 ; 0x07 1cbdc: 59 80 ldd r5, Y+1 ; 0x01 1cbde: 61 2e mov r6, r17 1cbe0: 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; 1cbe2: a1 01 movw r20, r2 1cbe4: 40 55 subi r20, 0x50 ; 80 1cbe6: 5d 4e sbci r21, 0xED ; 237 1cbe8: 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); 1cbea: a7 01 movw r20, r14 1cbec: 96 01 movw r18, r12 1cbee: 60 e0 ldi r22, 0x00 ; 0 1cbf0: 70 e0 ldi r23, 0x00 ; 0 1cbf2: 80 e8 ldi r24, 0x80 ; 128 1cbf4: 9f e3 ldi r25, 0x3F ; 63 1cbf6: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 1cbfa: 92 01 movw r18, r4 1cbfc: a3 01 movw r20, r6 1cbfe: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 1cc02: 2b 01 movw r4, r22 1cc04: 3c 01 movw r6, r24 1cc06: a7 01 movw r20, r14 1cc08: 96 01 movw r18, r12 1cc0a: 6f 81 ldd r22, Y+7 ; 0x07 1cc0c: 79 81 ldd r23, Y+1 ; 0x01 1cc0e: 81 2f mov r24, r17 1cc10: 90 2f mov r25, r16 1cc12: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 1cc16: 9b 01 movw r18, r22 1cc18: ac 01 movw r20, r24 1cc1a: c3 01 movw r24, r6 1cc1c: b2 01 movw r22, r4 1cc1e: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__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; 1cc22: f1 01 movw r30, r2 1cc24: 60 83 st Z, r22 1cc26: 71 83 std Z+1, r23 ; 0x01 1cc28: 82 83 std Z+2, r24 ; 0x02 1cc2a: 93 83 std Z+3, r25 ; 0x03 dT_lag_idx = dT_next_idx; 1cc2c: fe 81 ldd r31, Y+6 ; 0x06 1cc2e: f0 93 d1 12 sts 0x12D1, r31 ; 0x8012d1 <_ZN13thermal_modelL4dataE.lto_priv.400+0x21> // calculate and filter dT_err float dT_err = (cur_heater_temp - T_prev) - dT_lag; 1cc32: 20 91 d6 12 lds r18, 0x12D6 ; 0x8012d6 <_ZN13thermal_modelL4dataE.lto_priv.400+0x26> 1cc36: 30 91 d7 12 lds r19, 0x12D7 ; 0x8012d7 <_ZN13thermal_modelL4dataE.lto_priv.400+0x27> 1cc3a: 40 91 d8 12 lds r20, 0x12D8 ; 0x8012d8 <_ZN13thermal_modelL4dataE.lto_priv.400+0x28> 1cc3e: 50 91 d9 12 lds r21, 0x12D9 ; 0x8012d9 <_ZN13thermal_modelL4dataE.lto_priv.400+0x29> 1cc42: c5 01 movw r24, r10 1cc44: b4 01 movw r22, r8 1cc46: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 1cc4a: 2a 81 ldd r18, Y+2 ; 0x02 1cc4c: 3b 81 ldd r19, Y+3 ; 0x03 1cc4e: 4c 81 ldd r20, Y+4 ; 0x04 1cc50: 5d 81 ldd r21, Y+5 ; 0x05 1cc52: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 1cc56: 2b 01 movw r4, r22 1cc58: 3c 01 movw r6, r24 float dT_err_f = iir_mul(dT_err_prev, dT_err, THERMAL_MODEL_fE, 0.); 1cc5a: c0 90 d2 12 lds r12, 0x12D2 ; 0x8012d2 <_ZN13thermal_modelL4dataE.lto_priv.400+0x22> 1cc5e: d0 90 d3 12 lds r13, 0x12D3 ; 0x8012d3 <_ZN13thermal_modelL4dataE.lto_priv.400+0x23> 1cc62: e0 90 d4 12 lds r14, 0x12D4 ; 0x8012d4 <_ZN13thermal_modelL4dataE.lto_priv.400+0x24> 1cc66: f0 90 d5 12 lds r15, 0x12D5 ; 0x8012d5 <_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; 1cc6a: a7 01 movw r20, r14 1cc6c: 96 01 movw r18, r12 1cc6e: c7 01 movw r24, r14 1cc70: b6 01 movw r22, r12 1cc72: 0f 94 52 e1 call 0x3c2a4 ; 0x3c2a4 <__unordsf2> 1cc76: 88 23 and r24, r24 1cc78: 19 f0 breq .+6 ; 0x1cc80 1cc7a: c1 2c mov r12, r1 1cc7c: d1 2c mov r13, r1 1cc7e: 76 01 movw r14, r12 return (a_ * (1.f - f)) + (b * f); 1cc80: 23 e3 ldi r18, 0x33 ; 51 1cc82: 33 e3 ldi r19, 0x33 ; 51 1cc84: 43 e7 ldi r20, 0x73 ; 115 1cc86: 5f e3 ldi r21, 0x3F ; 63 1cc88: c7 01 movw r24, r14 1cc8a: b6 01 movw r22, r12 1cc8c: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 1cc90: 6b 01 movw r12, r22 1cc92: 7c 01 movw r14, r24 1cc94: 2d ec ldi r18, 0xCD ; 205 1cc96: 3c ec ldi r19, 0xCC ; 204 1cc98: 4c e4 ldi r20, 0x4C ; 76 1cc9a: 5d e3 ldi r21, 0x3D ; 61 1cc9c: c3 01 movw r24, r6 1cc9e: b2 01 movw r22, r4 1cca0: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 1cca4: 9b 01 movw r18, r22 1cca6: ac 01 movw r20, r24 1cca8: c7 01 movw r24, r14 1ccaa: b6 01 movw r22, r12 1ccac: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__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; 1ccb0: 80 92 d6 12 sts 0x12D6, r8 ; 0x8012d6 <_ZN13thermal_modelL4dataE.lto_priv.400+0x26> 1ccb4: 90 92 d7 12 sts 0x12D7, r9 ; 0x8012d7 <_ZN13thermal_modelL4dataE.lto_priv.400+0x27> 1ccb8: a0 92 d8 12 sts 0x12D8, r10 ; 0x8012d8 <_ZN13thermal_modelL4dataE.lto_priv.400+0x28> 1ccbc: b0 92 d9 12 sts 0x12D9, r11 ; 0x8012d9 <_ZN13thermal_modelL4dataE.lto_priv.400+0x29> dT_err_prev = dT_err_f; 1ccc0: 60 93 d2 12 sts 0x12D2, r22 ; 0x8012d2 <_ZN13thermal_modelL4dataE.lto_priv.400+0x22> 1ccc4: 70 93 d3 12 sts 0x12D3, r23 ; 0x8012d3 <_ZN13thermal_modelL4dataE.lto_priv.400+0x23> 1ccc8: 80 93 d4 12 sts 0x12D4, r24 ; 0x8012d4 <_ZN13thermal_modelL4dataE.lto_priv.400+0x24> 1cccc: 90 93 d5 12 sts 0x12D5, r25 ; 0x8012d5 <_ZN13thermal_modelL4dataE.lto_priv.400+0x25> // check and trigger errors flag_bits.error = (fabsf(dT_err_f) > err_s); 1ccd0: 6b 01 movw r12, r22 1ccd2: 7c 01 movw r14, r24 1ccd4: e8 94 clt 1ccd6: f7 f8 bld r15, 7 1ccd8: 21 e0 ldi r18, 0x01 ; 1 1ccda: 29 83 std Y+1, r18 ; 0x01 1ccdc: 20 91 45 13 lds r18, 0x1345 ; 0x801345 <_ZN13thermal_modelL4dataE.lto_priv.400+0x95> 1cce0: 30 91 46 13 lds r19, 0x1346 ; 0x801346 <_ZN13thermal_modelL4dataE.lto_priv.400+0x96> 1cce4: 40 91 47 13 lds r20, 0x1347 ; 0x801347 <_ZN13thermal_modelL4dataE.lto_priv.400+0x97> 1cce8: 50 91 48 13 lds r21, 0x1348 ; 0x801348 <_ZN13thermal_modelL4dataE.lto_priv.400+0x98> 1ccec: c7 01 movw r24, r14 1ccee: b6 01 movw r22, r12 1ccf0: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 1ccf4: 18 16 cp r1, r24 1ccf6: 0c f0 brlt .+2 ; 0x1ccfa 1ccf8: 19 82 std Y+1, r1 ; 0x01 1ccfa: 80 91 3c 13 lds r24, 0x133C ; 0x80133c <_ZN13thermal_modelL4dataE.lto_priv.400+0x8c> 1ccfe: 39 81 ldd r19, Y+1 ; 0x01 1cd00: 30 fb bst r19, 0 1cd02: 81 f9 bld r24, 1 1cd04: 80 93 3c 13 sts 0x133C, r24 ; 0x80133c <_ZN13thermal_modelL4dataE.lto_priv.400+0x8c> flag_bits.warning = (fabsf(dT_err_f) > warn_s); 1cd08: 41 e0 ldi r20, 0x01 ; 1 1cd0a: 49 83 std Y+1, r20 ; 0x01 1cd0c: 20 91 41 13 lds r18, 0x1341 ; 0x801341 <_ZN13thermal_modelL4dataE.lto_priv.400+0x91> 1cd10: 30 91 42 13 lds r19, 0x1342 ; 0x801342 <_ZN13thermal_modelL4dataE.lto_priv.400+0x92> 1cd14: 40 91 43 13 lds r20, 0x1343 ; 0x801343 <_ZN13thermal_modelL4dataE.lto_priv.400+0x93> 1cd18: 50 91 44 13 lds r21, 0x1344 ; 0x801344 <_ZN13thermal_modelL4dataE.lto_priv.400+0x94> 1cd1c: c7 01 movw r24, r14 1cd1e: b6 01 movw r22, r12 1cd20: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 1cd24: 18 16 cp r1, r24 1cd26: 0c f0 brlt .+2 ; 0x1cd2a 1cd28: 19 82 std Y+1, r1 ; 0x01 1cd2a: 80 91 3c 13 lds r24, 0x133C ; 0x80133c <_ZN13thermal_modelL4dataE.lto_priv.400+0x8c> 1cd2e: 59 81 ldd r21, Y+1 ; 0x01 1cd30: 50 fb bst r21, 0 1cd32: 82 f9 bld r24, 2 1cd34: 80 93 3c 13 sts 0x133C, r24 ; 0x80133c <_ZN13thermal_modelL4dataE.lto_priv.400+0x8c> } 1cd38: 27 96 adiw r28, 0x07 ; 7 1cd3a: 0f b6 in r0, 0x3f ; 63 1cd3c: f8 94 cli 1cd3e: de bf out 0x3e, r29 ; 62 1cd40: 0f be out 0x3f, r0 ; 63 1cd42: cd bf out 0x3d, r28 ; 61 1cd44: df 91 pop r29 1cd46: cf 91 pop r28 1cd48: 1f 91 pop r17 1cd4a: 0f 91 pop r16 1cd4c: ff 90 pop r15 1cd4e: ef 90 pop r14 1cd50: df 90 pop r13 1cd52: cf 90 pop r12 1cd54: bf 90 pop r11 1cd56: af 90 pop r10 1cd58: 9f 90 pop r9 1cd5a: 8f 90 pop r8 1cd5c: 7f 90 pop r7 1cd5e: 6f 90 pop r6 1cd60: 5f 90 pop r5 1cd62: 4f 90 pop r4 1cd64: 3f 90 pop r3 1cd66: 2f 90 pop r2 1cd68: 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); 1cd6a: 1e 82 std Y+6, r1 ; 0x06 1cd6c: 0c cf rjmp .-488 ; 0x1cb86 0001cd6e : float d = GOLDEN_RATIO * (bounds[1] - bounds[0]); points[0] = bounds[0] + d; points[1] = bounds[1] - d; } static float estimate(uint16_t samples, 1cd6e: 2f 92 push r2 1cd70: 3f 92 push r3 1cd72: 4f 92 push r4 1cd74: 5f 92 push r5 1cd76: 6f 92 push r6 1cd78: 7f 92 push r7 1cd7a: 8f 92 push r8 1cd7c: 9f 92 push r9 1cd7e: af 92 push r10 1cd80: bf 92 push r11 1cd82: cf 92 push r12 1cd84: df 92 push r13 1cd86: ef 92 push r14 1cd88: ff 92 push r15 1cd8a: 0f 93 push r16 1cd8c: 1f 93 push r17 1cd8e: cf 93 push r28 1cd90: df 93 push r29 1cd92: cd b7 in r28, 0x3d ; 61 1cd94: de b7 in r29, 0x3e ; 62 1cd96: a4 97 sbiw r28, 0x24 ; 36 1cd98: 0f b6 in r0, 0x3f ; 63 1cd9a: f8 94 cli 1cd9c: de bf out 0x3e, r29 ; 62 1cd9e: 0f be out 0x3f, r0 ; 63 1cda0: cd bf out 0x3d, r28 ; 61 1cda2: 9b 8f std Y+27, r25 ; 0x1b 1cda4: 8a 8f std Y+26, r24 ; 0x1a 1cda6: 7a 8b std Y+18, r23 ; 0x12 1cda8: 69 8b std Y+17, r22 ; 0x11 1cdaa: 2b 8b std Y+19, r18 ; 0x13 1cdac: 3c 8b std Y+20, r19 ; 0x14 1cdae: 4d 8b std Y+21, r20 ; 0x15 1cdb0: 5e 8b std Y+22, r21 ; 0x16 1cdb2: 0c 8f std Y+28, r16 ; 0x1c 1cdb4: cd 8e std Y+29, r12 ; 0x1d 1cdb6: de 8e std Y+30, r13 ; 0x1e 1cdb8: ef 8e std Y+31, r14 ; 0x1f 1cdba: 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; 1cdbc: 20 91 1d 05 lds r18, 0x051D ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.456> 1cdc0: 29 8f std Y+25, r18 ; 0x19 thermal_model_reset_enabled(false); 1cdc2: 80 e0 ldi r24, 0x00 ; 0 1cdc4: 0f 94 5f 32 call 0x264be ; 0x264be float orig = *var; 1cdc8: a9 89 ldd r26, Y+17 ; 0x11 1cdca: ba 89 ldd r27, Y+18 ; 0x12 1cdcc: 8d 91 ld r24, X+ 1cdce: 9d 91 ld r25, X+ 1cdd0: 0d 90 ld r0, X+ 1cdd2: bc 91 ld r27, X 1cdd4: a0 2d mov r26, r0 1cdd6: 89 a3 std Y+33, r24 ; 0x21 1cdd8: 9a a3 std Y+34, r25 ; 0x22 1cdda: ab a3 std Y+35, r26 ; 0x23 1cddc: bc a3 std Y+36, r27 ; 0x24 float e = NAN; float points[2]; float bounds[2] = {min, max}; 1cdde: 80 e0 ldi r24, 0x00 ; 0 1cde0: 90 e0 ldi r25, 0x00 ; 0 1cde2: a0 ea ldi r26, 0xA0 ; 160 1cde4: b0 e4 ldi r27, 0x40 ; 64 1cde6: 89 83 std Y+1, r24 ; 0x01 1cde8: 9a 83 std Y+2, r25 ; 0x02 1cdea: ab 83 std Y+3, r26 ; 0x03 1cdec: bc 83 std Y+4, r27 ; 0x04 1cdee: 8b 89 ldd r24, Y+19 ; 0x13 1cdf0: 9c 89 ldd r25, Y+20 ; 0x14 1cdf2: ad 89 ldd r26, Y+21 ; 0x15 1cdf4: be 89 ldd r27, Y+22 ; 0x16 1cdf6: 8d 83 std Y+5, r24 ; 0x05 1cdf8: 9e 83 std Y+6, r25 ; 0x06 1cdfa: af 83 std Y+7, r26 ; 0x07 1cdfc: 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]); 1cdfe: 20 e0 ldi r18, 0x00 ; 0 1ce00: 30 e0 ldi r19, 0x00 ; 0 1ce02: 40 ea ldi r20, 0xA0 ; 160 1ce04: 50 e4 ldi r21, 0x40 ; 64 1ce06: bc 01 movw r22, r24 1ce08: cd 01 movw r24, r26 1ce0a: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 1ce0e: 2a e7 ldi r18, 0x7A ; 122 1ce10: 37 e3 ldi r19, 0x37 ; 55 1ce12: 4e e1 ldi r20, 0x1E ; 30 1ce14: 5f e3 ldi r21, 0x3F ; 63 1ce16: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 1ce1a: 6b 01 movw r12, r22 1ce1c: 7c 01 movw r14, r24 points[0] = bounds[0] + d; 1ce1e: 20 e0 ldi r18, 0x00 ; 0 1ce20: 30 e0 ldi r19, 0x00 ; 0 1ce22: 40 ea ldi r20, 0xA0 ; 160 1ce24: 50 e4 ldi r21, 0x40 ; 64 1ce26: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 1ce2a: 69 87 std Y+9, r22 ; 0x09 1ce2c: 7a 87 std Y+10, r23 ; 0x0a 1ce2e: 8b 87 std Y+11, r24 ; 0x0b 1ce30: 9c 87 std Y+12, r25 ; 0x0c points[1] = bounds[1] - d; 1ce32: a7 01 movw r20, r14 1ce34: 96 01 movw r18, r12 1ce36: 6b 89 ldd r22, Y+19 ; 0x13 1ce38: 7c 89 ldd r23, Y+20 ; 0x14 1ce3a: 8d 89 ldd r24, Y+21 ; 0x15 1ce3c: 9e 89 ldd r25, Y+22 ; 0x16 1ce3e: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 1ce42: 6d 87 std Y+13, r22 ; 0x0d 1ce44: 7e 87 std Y+14, r23 ; 0x0e 1ce46: 8f 87 std Y+15, r24 ; 0x0f 1ce48: 98 8b std Y+16, r25 ; 0x10 1ce4a: 31 2c mov r3, r1 1ce4c: 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); 1ce4e: 29 85 ldd r18, Y+9 ; 0x09 1ce50: 3a 85 ldd r19, Y+10 ; 0x0a 1ce52: 4b 85 ldd r20, Y+11 ; 0x0b 1ce54: 5c 85 ldd r21, Y+12 ; 0x0c 1ce56: cd 8c ldd r12, Y+29 ; 0x1d 1ce58: de 8c ldd r13, Y+30 ; 0x1e 1ce5a: ef 8c ldd r14, Y+31 ; 0x1f 1ce5c: f8 a0 ldd r15, Y+32 ; 0x20 1ce5e: 0c 8d ldd r16, Y+28 ; 0x1c 1ce60: 69 89 ldd r22, Y+17 ; 0x11 1ce62: 7a 89 ldd r23, Y+18 ; 0x12 1ce64: 8a 8d ldd r24, Y+26 ; 0x1a 1ce66: 9b 8d ldd r25, Y+27 ; 0x1b 1ce68: 0f 94 ad 2c call 0x2595a ; 0x2595a 1ce6c: 4b 01 movw r8, r22 1ce6e: 5c 01 movw r10, r24 float c2 = cost_fn(samples, var, points[1], fan_pwm, ambient); 1ce70: 2d 85 ldd r18, Y+13 ; 0x0d 1ce72: 3e 85 ldd r19, Y+14 ; 0x0e 1ce74: 4f 85 ldd r20, Y+15 ; 0x0f 1ce76: 58 89 ldd r21, Y+16 ; 0x10 1ce78: cd 8c ldd r12, Y+29 ; 0x1d 1ce7a: de 8c ldd r13, Y+30 ; 0x1e 1ce7c: ef 8c ldd r14, Y+31 ; 0x1f 1ce7e: f8 a0 ldd r15, Y+32 ; 0x20 1ce80: 0c 8d ldd r16, Y+28 ; 0x1c 1ce82: 69 89 ldd r22, Y+17 ; 0x11 1ce84: 7a 89 ldd r23, Y+18 ; 0x12 1ce86: 8a 8d ldd r24, Y+26 ; 0x1a 1ce88: 9b 8d ldd r25, Y+27 ; 0x1b 1ce8a: 0f 94 ad 2c call 0x2595a ; 0x2595a 1ce8e: 9b 01 movw r18, r22 1ce90: ac 01 movw r20, r24 bool dir = (c2 < c1); 1ce92: 11 e0 ldi r17, 0x01 ; 1 1ce94: c5 01 movw r24, r10 1ce96: b4 01 movw r22, r8 1ce98: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 1ce9c: 18 16 cp r1, r24 1ce9e: 0c f0 brlt .+2 ; 0x1cea2 1cea0: 10 e0 ldi r17, 0x00 ; 0 bounds[dir] = points[!dir]; 1cea2: 01 e0 ldi r16, 0x01 ; 1 1cea4: 01 27 eor r16, r17 1cea6: 80 2f mov r24, r16 1cea8: 90 e0 ldi r25, 0x00 ; 0 1ceaa: e1 2f mov r30, r17 1ceac: f0 e0 ldi r31, 0x00 ; 0 1ceae: ee 0f add r30, r30 1ceb0: ff 1f adc r31, r31 1ceb2: ee 0f add r30, r30 1ceb4: ff 1f adc r31, r31 1ceb6: 41 e0 ldi r20, 0x01 ; 1 1ceb8: 50 e0 ldi r21, 0x00 ; 0 1ceba: 4c 0f add r20, r28 1cebc: 5d 1f adc r21, r29 1cebe: 4e 0f add r20, r30 1cec0: 5f 1f adc r21, r31 1cec2: 8c 01 movw r16, r24 1cec4: 00 0f add r16, r16 1cec6: 11 1f adc r17, r17 1cec8: 00 0f add r16, r16 1ceca: 11 1f adc r17, r17 1cecc: a1 e0 ldi r26, 0x01 ; 1 1cece: b0 e0 ldi r27, 0x00 ; 0 1ced0: ac 0f add r26, r28 1ced2: bd 1f adc r27, r29 1ced4: 0a 0f add r16, r26 1ced6: 1b 1f adc r17, r27 1ced8: f8 01 movw r30, r16 1ceda: 38 96 adiw r30, 0x08 ; 8 1cedc: f8 8f std Y+24, r31 ; 0x18 1cede: ef 8b std Y+23, r30 ; 0x17 1cee0: f8 01 movw r30, r16 1cee2: 80 85 ldd r24, Z+8 ; 0x08 1cee4: 91 85 ldd r25, Z+9 ; 0x09 1cee6: a2 85 ldd r26, Z+10 ; 0x0a 1cee8: b3 85 ldd r27, Z+11 ; 0x0b 1ceea: fa 01 movw r30, r20 1ceec: 80 83 st Z, r24 1ceee: 91 83 std Z+1, r25 ; 0x01 1cef0: a2 83 std Z+2, r26 ; 0x02 1cef2: 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]); 1cef4: 8d 80 ldd r8, Y+5 ; 0x05 1cef6: 9e 80 ldd r9, Y+6 ; 0x06 1cef8: af 80 ldd r10, Y+7 ; 0x07 1cefa: b8 84 ldd r11, Y+8 ; 0x08 1cefc: c9 80 ldd r12, Y+1 ; 0x01 1cefe: da 80 ldd r13, Y+2 ; 0x02 1cf00: eb 80 ldd r14, Y+3 ; 0x03 1cf02: fc 80 ldd r15, Y+4 ; 0x04 1cf04: a7 01 movw r20, r14 1cf06: 96 01 movw r18, r12 1cf08: c5 01 movw r24, r10 1cf0a: b4 01 movw r22, r8 1cf0c: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 1cf10: 2a e7 ldi r18, 0x7A ; 122 1cf12: 37 e3 ldi r19, 0x37 ; 55 1cf14: 4e e1 ldi r20, 0x1E ; 30 1cf16: 5f e3 ldi r21, 0x3F ; 63 1cf18: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 1cf1c: 2b 01 movw r4, r22 1cf1e: 3c 01 movw r6, r24 points[0] = bounds[0] + d; 1cf20: ac 01 movw r20, r24 1cf22: 9b 01 movw r18, r22 1cf24: c7 01 movw r24, r14 1cf26: b6 01 movw r22, r12 1cf28: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 1cf2c: 69 87 std Y+9, r22 ; 0x09 1cf2e: 7a 87 std Y+10, r23 ; 0x0a 1cf30: 8b 87 std Y+11, r24 ; 0x0b 1cf32: 9c 87 std Y+12, r25 ; 0x0c points[1] = bounds[1] - d; 1cf34: a3 01 movw r20, r6 1cf36: 92 01 movw r18, r4 1cf38: c5 01 movw r24, r10 1cf3a: b4 01 movw r22, r8 1cf3c: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 1cf40: 6d 87 std Y+13, r22 ; 0x0d 1cf42: 7e 87 std Y+14, r23 ; 0x0e 1cf44: 8f 87 std Y+15, r24 ; 0x0f 1cf46: 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]; 1cf48: d8 01 movw r26, r16 1cf4a: 18 96 adiw r26, 0x08 ; 8 1cf4c: 4c 90 ld r4, X 1cf4e: ef 89 ldd r30, Y+23 ; 0x17 1cf50: f8 8d ldd r31, Y+24 ; 0x18 1cf52: 51 80 ldd r5, Z+1 ; 0x01 1cf54: 62 80 ldd r6, Z+2 ; 0x02 1cf56: 73 80 ldd r7, Z+3 ; 0x03 e = (1-GOLDEN_RATIO) * fabsf((bounds[0]-bounds[1]) / x); 1cf58: a5 01 movw r20, r10 1cf5a: 94 01 movw r18, r8 1cf5c: c7 01 movw r24, r14 1cf5e: b6 01 movw r22, r12 1cf60: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 1cf64: 24 2d mov r18, r4 1cf66: 35 2d mov r19, r5 1cf68: 46 2d mov r20, r6 1cf6a: 57 2d mov r21, r7 1cf6c: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 1cf70: 9f 77 andi r25, 0x7F ; 127 1cf72: 2c e0 ldi r18, 0x0C ; 12 1cf74: 31 e9 ldi r19, 0x91 ; 145 1cf76: 43 ec ldi r20, 0xC3 ; 195 1cf78: 5e e3 ldi r21, 0x3E ; 62 1cf7a: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 1cf7e: 6b 01 movw r12, r22 1cf80: 7c 01 movw r14, r24 1cf82: 5b 01 movw r10, r22 1cf84: 8c 01 movw r16, r24 printf_P(PSTR("TM iter:%u v:%.2f e:%.3f\n"), it, x, e); 1cf86: ff 92 push r15 1cf88: 8f 93 push r24 1cf8a: df 92 push r13 1cf8c: 6f 93 push r22 1cf8e: 7f 92 push r7 1cf90: 6f 92 push r6 1cf92: 5f 92 push r5 1cf94: 4f 92 push r4 1cf96: 3f 92 push r3 1cf98: 2f 92 push r2 1cf9a: 2d ed ldi r18, 0xDD ; 221 1cf9c: 3e e8 ldi r19, 0x8E ; 142 1cf9e: 3f 93 push r19 1cfa0: 2f 93 push r18 1cfa2: 0f 94 de da call 0x3b5bc ; 0x3b5bc if(e < thr) { 1cfa6: 0f b6 in r0, 0x3f ; 63 1cfa8: f8 94 cli 1cfaa: de bf out 0x3e, r29 ; 62 1cfac: 0f be out 0x3f, r0 ; 63 1cfae: cd bf out 0x3d, r28 ; 61 1cfb0: 2a e0 ldi r18, 0x0A ; 10 1cfb2: 37 ed ldi r19, 0xD7 ; 215 1cfb4: 43 e2 ldi r20, 0x23 ; 35 1cfb6: 5c e3 ldi r21, 0x3C ; 60 1cfb8: 6c 2d mov r22, r12 1cfba: 7d 2d mov r23, r13 1cfbc: 8e 2d mov r24, r14 1cfbe: 9f 2d mov r25, r15 1cfc0: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 1cfc4: 87 ff sbrs r24, 7 1cfc6: 42 c0 rjmp .+132 ; 0x1d04c if(x == min || x == max) { 1cfc8: 20 e0 ldi r18, 0x00 ; 0 1cfca: 30 e0 ldi r19, 0x00 ; 0 1cfcc: 40 ea ldi r20, 0xA0 ; 160 1cfce: 50 e4 ldi r21, 0x40 ; 64 1cfd0: 64 2d mov r22, r4 1cfd2: 75 2d mov r23, r5 1cfd4: 86 2d mov r24, r6 1cfd6: 97 2d mov r25, r7 1cfd8: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 1cfdc: 88 23 and r24, r24 1cfde: f1 f1 breq .+124 ; 0x1d05c 1cfe0: 24 2d mov r18, r4 1cfe2: 35 2d mov r19, r5 1cfe4: 46 2d mov r20, r6 1cfe6: 57 2d mov r21, r7 1cfe8: 6b 89 ldd r22, Y+19 ; 0x13 1cfea: 7c 89 ldd r23, Y+20 ; 0x14 1cfec: 8d 89 ldd r24, Y+21 ; 0x15 1cfee: 9e 89 ldd r25, Y+22 ; 0x16 1cff0: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 1cff4: 88 23 and r24, r24 1cff6: 91 f1 breq .+100 ; 0x1d05c // real value likely outside of the search boundaries break; } *var = x; 1cff8: 84 2d mov r24, r4 1cffa: 95 2d mov r25, r5 1cffc: a6 2d mov r26, r6 1cffe: b7 2d mov r27, r7 1d000: e9 89 ldd r30, Y+17 ; 0x11 1d002: fa 89 ldd r31, Y+18 ; 0x12 1d004: 80 83 st Z, r24 1d006: 91 83 std Z+1, r25 ; 0x01 1d008: a2 83 std Z+2, r26 ; 0x02 1d00a: b3 83 std Z+3, r27 ; 0x03 thermal_model_reset_enabled(was_enabled); 1d00c: 89 8d ldd r24, Y+25 ; 0x19 1d00e: 0f 94 5f 32 call 0x264be ; 0x264be SERIAL_ECHOLNPGM("TM estimation did not converge"); *var = orig; thermal_model_reset_enabled(was_enabled); return NAN; } 1d012: 6a 2d mov r22, r10 1d014: 7b 2d mov r23, r11 1d016: 80 2f mov r24, r16 1d018: 91 2f mov r25, r17 1d01a: a4 96 adiw r28, 0x24 ; 36 1d01c: 0f b6 in r0, 0x3f ; 63 1d01e: f8 94 cli 1d020: de bf out 0x3e, r29 ; 62 1d022: 0f be out 0x3f, r0 ; 63 1d024: cd bf out 0x3d, r28 ; 61 1d026: df 91 pop r29 1d028: cf 91 pop r28 1d02a: 1f 91 pop r17 1d02c: 0f 91 pop r16 1d02e: ff 90 pop r15 1d030: ef 90 pop r14 1d032: df 90 pop r13 1d034: cf 90 pop r12 1d036: bf 90 pop r11 1d038: af 90 pop r10 1d03a: 9f 90 pop r9 1d03c: 8f 90 pop r8 1d03e: 7f 90 pop r7 1d040: 6f 90 pop r6 1d042: 5f 90 pop r5 1d044: 4f 90 pop r4 1d046: 3f 90 pop r3 1d048: 2f 90 pop r2 1d04a: 08 95 ret 1d04c: ff ef ldi r31, 0xFF ; 255 1d04e: 2f 1a sub r2, r31 1d050: 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) { 1d052: 2e e1 ldi r18, 0x1E ; 30 1d054: 22 16 cp r2, r18 1d056: 31 04 cpc r3, r1 1d058: 09 f0 breq .+2 ; 0x1d05c 1d05a: f9 ce rjmp .-526 ; 0x1ce4e thermal_model_reset_enabled(was_enabled); return e; } } SERIAL_ECHOLNPGM("TM estimation did not converge"); 1d05c: 8e eb ldi r24, 0xBE ; 190 1d05e: 9e e8 ldi r25, 0x8E ; 142 1d060: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 *var = orig; 1d064: 89 a1 ldd r24, Y+33 ; 0x21 1d066: 9a a1 ldd r25, Y+34 ; 0x22 1d068: ab a1 ldd r26, Y+35 ; 0x23 1d06a: bc a1 ldd r27, Y+36 ; 0x24 1d06c: e9 89 ldd r30, Y+17 ; 0x11 1d06e: fa 89 ldd r31, Y+18 ; 0x12 1d070: 80 83 st Z, r24 1d072: 91 83 std Z+1, r25 ; 0x01 1d074: a2 83 std Z+2, r26 ; 0x02 1d076: b3 83 std Z+3, r27 ; 0x03 thermal_model_reset_enabled(was_enabled); 1d078: 89 8d ldd r24, Y+25 ; 0x19 1d07a: 0f 94 5f 32 call 0x264be ; 0x264be return NAN; 1d07e: a1 2c mov r10, r1 1d080: b1 2c mov r11, r1 1d082: 00 ec ldi r16, 0xC0 ; 192 1d084: 1f e7 ldi r17, 0x7F ; 127 1d086: c5 cf rjmp .-118 ; 0x1d012 0001d088 : // Update cached value lastReadRegisterValue = logic.rsp.paramValue; return true; } bool __attribute__((noinline)) MMU2::WriteRegister(uint8_t address, uint16_t data) { 1d088: ef 92 push r14 1d08a: ff 92 push r15 1d08c: 0f 93 push r16 1d08e: 1f 93 push r17 1d090: cf 93 push r28 1d092: df 93 push r29 1d094: 00 d0 rcall .+0 ; 0x1d096 1d096: 1f 92 push r1 1d098: 1f 92 push r1 1d09a: cd b7 in r28, 0x3d ; 61 1d09c: de b7 in r29, 0x3e ; 62 1d09e: 08 2f mov r16, r24 1d0a0: 16 2f mov r17, r22 1d0a2: f7 2e mov r15, r23 if (!WaitForMMUReady()) { 1d0a4: 0f 94 84 88 call 0x31108 ; 0x31108 1d0a8: 88 23 and r24, r24 1d0aa: d9 f0 breq .+54 ; 0x1d0e2 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) { 1d0ac: 0b 30 cpi r16, 0x0B ; 11 1d0ae: 29 f1 breq .+74 ; 0x1d0fa 1d0b0: 04 31 cpi r16, 0x14 ; 20 1d0b2: 31 f1 breq .+76 ; 0x1d100 /// @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()) { 1d0b4: 87 e5 ldi r24, 0x57 ; 87 1d0b6: e8 2e mov r14, r24 1d0b8: e9 82 std Y+1, r14 ; 0x01 1d0ba: 0a 83 std Y+2, r16 ; 0x02 1d0bc: 1b 83 std Y+3, r17 ; 0x03 1d0be: fc 82 std Y+4, r15 ; 0x04 1d0c0: ce 01 movw r24, r28 1d0c2: 01 96 adiw r24, 0x01 ; 1 1d0c4: 0f 94 69 c5 call 0x38ad2 ; 0x38ad2 1d0c8: 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)); 1d0ca: 47 e5 ldi r20, 0x57 ; 87 1d0cc: 50 2f mov r21, r16 1d0ce: 61 2f mov r22, r17 1d0d0: 7f 2d mov r23, r15 1d0d2: 0f 94 52 a5 call 0x34aa4 ; 0x34aa4 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)); 1d0d6: 60 e0 ldi r22, 0x00 ; 0 1d0d8: 80 e0 ldi r24, 0x00 ; 0 1d0da: 0f 94 76 ac call 0x358ec ; 0x358ec 1d0de: 88 23 and r24, r24 1d0e0: 59 f3 breq .-42 ; 0x1d0b8 return true; } 1d0e2: 0f 90 pop r0 1d0e4: 0f 90 pop r0 1d0e6: 0f 90 pop r0 1d0e8: 0f 90 pop r0 1d0ea: 0f 90 pop r0 1d0ec: df 91 pop r29 1d0ee: cf 91 pop r28 1d0f0: 1f 91 pop r17 1d0f2: 0f 91 pop r16 1d0f4: ff 90 pop r15 1d0f6: ef 90 pop r14 1d0f8: 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); 1d0fa: 10 93 97 13 sts 0x1397, r17 ; 0x801397 1d0fe: da cf rjmp .-76 ; 0x1d0b4 break; case (uint8_t)Register::Pulley_Slow_Feedrate: logic.PlanPulleySlowFeedRate(data); 1d100: 10 93 98 13 sts 0x1398, r17 ; 0x801398 1d104: d7 cf rjmp .-82 ; 0x1d0b4 0001d106 : #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) 1d106: 82 30 cpi r24, 0x02 ; 2 1d108: 91 05 cpc r25, r1 1d10a: 38 f0 brcs .+14 ; 0x1d11a // 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 1d10c: 88 0f add r24, r24 1d10e: 99 1f adc r25, r25 1d110: 88 0f add r24, r24 1d112: 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, 1d114: 05 97 sbiw r24, 0x05 ; 5 #endif // busy wait __asm__ __volatile__ ( 1d116: 01 97 sbiw r24, 0x01 ; 1 1d118: f1 f7 brne .-4 ; 0x1d116 "1: sbiw %0,1" "\n\t" // 2 cycles "brne 1b" : "=w" (us) : "0" (us) // 2 cycles ); // return = 4 cycles } 1d11a: 08 95 ret 0001d11c : SREG = oldSREG; } int digitalRead(uint8_t pin) { 1d11c: cf 93 push r28 1d11e: df 93 push r29 uint8_t timer = digitalPinToTimer(pin); 1d120: 28 2f mov r18, r24 1d122: 30 e0 ldi r19, 0x00 ; 0 1d124: f9 01 movw r30, r18 1d126: e1 51 subi r30, 0x11 ; 17 1d128: f3 47 sbci r31, 0x73 ; 115 1d12a: 84 91 lpm r24, Z uint8_t bit = digitalPinToBitMask(pin); 1d12c: f9 01 movw r30, r18 1d12e: e7 56 subi r30, 0x67 ; 103 1d130: f3 47 sbci r31, 0x73 ; 115 1d132: d4 91 lpm r29, Z uint8_t port = digitalPinToPort(pin); 1d134: f9 01 movw r30, r18 1d136: ed 5b subi r30, 0xBD ; 189 1d138: f3 47 sbci r31, 0x73 ; 115 1d13a: c4 91 lpm r28, Z if (port == NOT_A_PIN) return LOW; 1d13c: cc 23 and r28, r28 1d13e: a1 f0 breq .+40 ; 0x1d168 // 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); 1d140: 81 11 cpse r24, r1 1d142: 0e 94 b6 cc call 0x1996c ; 0x1996c if (*portInputRegister(port) & bit) return HIGH; 1d146: ec 2f mov r30, r28 1d148: f0 e0 ldi r31, 0x00 ; 0 1d14a: ee 0f add r30, r30 1d14c: ff 1f adc r31, r31 1d14e: e7 5d subi r30, 0xD7 ; 215 1d150: f3 47 sbci r31, 0x73 ; 115 1d152: a5 91 lpm r26, Z+ 1d154: b4 91 lpm r27, Z 1d156: ec 91 ld r30, X 1d158: ed 23 and r30, r29 1d15a: 81 e0 ldi r24, 0x01 ; 1 1d15c: 90 e0 ldi r25, 0x00 ; 0 1d15e: 09 f4 brne .+2 ; 0x1d162 1d160: 80 e0 ldi r24, 0x00 ; 0 return LOW; } 1d162: df 91 pop r29 1d164: cf 91 pop r28 1d166: 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; 1d168: 80 e0 ldi r24, 0x00 ; 0 1d16a: 90 e0 ldi r25, 0x00 ; 0 1d16c: fa cf rjmp .-12 ; 0x1d162 0001d16e : #endif } } void digitalWrite(uint8_t pin, uint8_t val) { 1d16e: 1f 93 push r17 1d170: cf 93 push r28 1d172: df 93 push r29 uint8_t timer = digitalPinToTimer(pin); 1d174: 28 2f mov r18, r24 1d176: 30 e0 ldi r19, 0x00 ; 0 1d178: f9 01 movw r30, r18 1d17a: e1 51 subi r30, 0x11 ; 17 1d17c: f3 47 sbci r31, 0x73 ; 115 1d17e: 84 91 lpm r24, Z uint8_t bit = digitalPinToBitMask(pin); 1d180: f9 01 movw r30, r18 1d182: e7 56 subi r30, 0x67 ; 103 1d184: f3 47 sbci r31, 0x73 ; 115 1d186: d4 91 lpm r29, Z uint8_t port = digitalPinToPort(pin); 1d188: f9 01 movw r30, r18 1d18a: ed 5b subi r30, 0xBD ; 189 1d18c: f3 47 sbci r31, 0x73 ; 115 1d18e: c4 91 lpm r28, Z volatile uint8_t *out; if (port == NOT_A_PIN) return; 1d190: cc 23 and r28, r28 1d192: a9 f0 breq .+42 ; 0x1d1be 1d194: 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); 1d196: 81 11 cpse r24, r1 1d198: 0e 94 b6 cc call 0x1996c ; 0x1996c out = portOutputRegister(port); 1d19c: ec 2f mov r30, r28 1d19e: f0 e0 ldi r31, 0x00 ; 0 1d1a0: ee 0f add r30, r30 1d1a2: ff 1f adc r31, r31 1d1a4: e1 5f subi r30, 0xF1 ; 241 1d1a6: f3 47 sbci r31, 0x73 ; 115 1d1a8: a5 91 lpm r26, Z+ 1d1aa: b4 91 lpm r27, Z uint8_t oldSREG = SREG; 1d1ac: 8f b7 in r24, 0x3f ; 63 cli(); 1d1ae: f8 94 cli if (val == LOW) { *out &= ~bit; 1d1b0: ec 91 ld r30, X out = portOutputRegister(port); uint8_t oldSREG = SREG; cli(); if (val == LOW) { 1d1b2: 11 11 cpse r17, r1 1d1b4: 08 c0 rjmp .+16 ; 0x1d1c6 *out &= ~bit; 1d1b6: d0 95 com r29 1d1b8: de 23 and r29, r30 } else { *out |= bit; 1d1ba: dc 93 st X, r29 } SREG = oldSREG; 1d1bc: 8f bf out 0x3f, r24 ; 63 } 1d1be: df 91 pop r29 1d1c0: cf 91 pop r28 1d1c2: 1f 91 pop r17 1d1c4: 08 95 ret cli(); if (val == LOW) { *out &= ~bit; } else { *out |= bit; 1d1c6: de 2b or r29, r30 1d1c8: f8 cf rjmp .-16 ; 0x1d1ba 0001d1ca : #define ARDUINO_MAIN #include "wiring_private.h" #include "pins_arduino.h" void pinMode(uint8_t pin, uint8_t mode) { 1d1ca: cf 93 push r28 1d1cc: df 93 push r29 uint8_t bit = digitalPinToBitMask(pin); 1d1ce: 90 e0 ldi r25, 0x00 ; 0 1d1d0: fc 01 movw r30, r24 1d1d2: e7 56 subi r30, 0x67 ; 103 1d1d4: f3 47 sbci r31, 0x73 ; 115 1d1d6: 24 91 lpm r18, Z uint8_t port = digitalPinToPort(pin); 1d1d8: 8d 5b subi r24, 0xBD ; 189 1d1da: 93 47 sbci r25, 0x73 ; 115 1d1dc: fc 01 movw r30, r24 1d1de: 84 91 lpm r24, Z volatile uint8_t *reg, *out; if (port == NOT_A_PIN) return; 1d1e0: 88 23 and r24, r24 1d1e2: d1 f0 breq .+52 ; 0x1d218 // JWS: can I let the optimizer do this? reg = portModeRegister(port); 1d1e4: 90 e0 ldi r25, 0x00 ; 0 1d1e6: 88 0f add r24, r24 1d1e8: 99 1f adc r25, r25 1d1ea: fc 01 movw r30, r24 1d1ec: eb 50 subi r30, 0x0B ; 11 1d1ee: f4 47 sbci r31, 0x74 ; 116 1d1f0: a5 91 lpm r26, Z+ 1d1f2: b4 91 lpm r27, Z out = portOutputRegister(port); 1d1f4: fc 01 movw r30, r24 1d1f6: e1 5f subi r30, 0xF1 ; 241 1d1f8: f3 47 sbci r31, 0x73 ; 115 1d1fa: c5 91 lpm r28, Z+ 1d1fc: d4 91 lpm r29, Z if (mode == INPUT) { 1d1fe: 61 11 cpse r22, r1 1d200: 0e c0 rjmp .+28 ; 0x1d21e uint8_t oldSREG = SREG; 1d202: 9f b7 in r25, 0x3f ; 63 cli(); 1d204: f8 94 cli *reg &= ~bit; 1d206: 8c 91 ld r24, X 1d208: e2 2f mov r30, r18 1d20a: e0 95 com r30 1d20c: 8e 23 and r24, r30 1d20e: 8c 93 st X, r24 *out &= ~bit; 1d210: 28 81 ld r18, Y 1d212: e2 23 and r30, r18 1d214: e8 83 st Y, r30 SREG = oldSREG; 1d216: 9f bf out 0x3f, r25 ; 63 uint8_t oldSREG = SREG; cli(); *reg |= bit; SREG = oldSREG; } } 1d218: df 91 pop r29 1d21a: cf 91 pop r28 1d21c: 08 95 ret cli(); *reg &= ~bit; *out |= bit; SREG = oldSREG; } else { uint8_t oldSREG = SREG; 1d21e: 8f b7 in r24, 0x3f ; 63 cli(); 1d220: f8 94 cli *reg |= bit; 1d222: ec 91 ld r30, X 1d224: e2 2b or r30, r18 1d226: ec 93 st X, r30 SREG = oldSREG; 1d228: 8f bf out 0x3f, r24 ; 63 1d22a: f6 cf rjmp .-20 ; 0x1d218 0001d22c : // 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) { 1d22c: 1f 93 push r17 1d22e: cf 93 push r28 1d230: df 93 push r29 1d232: 18 2f mov r17, r24 1d234: 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); 1d236: 61 e0 ldi r22, 0x01 ; 1 1d238: 0e 94 e5 e8 call 0x1d1ca ; 0x1d1ca if (val == 0) 1d23c: 20 97 sbiw r28, 0x00 ; 0 1d23e: 39 f4 brne .+14 ; 0x1d24e { digitalWrite(pin, LOW); 1d240: 60 e0 ldi r22, 0x00 ; 0 } else if (val == 255) { digitalWrite(pin, HIGH); 1d242: 81 2f mov r24, r17 } else { digitalWrite(pin, HIGH); } } } } 1d244: df 91 pop r29 1d246: cf 91 pop r28 1d248: 1f 91 pop r17 { digitalWrite(pin, LOW); } else if (val == 255) { digitalWrite(pin, HIGH); 1d24a: 0c 94 b7 e8 jmp 0x1d16e ; 0x1d16e pinMode(pin, OUTPUT); if (val == 0) { digitalWrite(pin, LOW); } else if (val == 255) 1d24e: cf 3f cpi r28, 0xFF ; 255 1d250: d1 05 cpc r29, r1 1d252: 11 f4 brne .+4 ; 0x1d258 { digitalWrite(pin, HIGH); 1d254: 61 e0 ldi r22, 0x01 ; 1 1d256: f5 cf rjmp .-22 ; 0x1d242 } else { switch(digitalPinToTimer(pin)) 1d258: e1 2f mov r30, r17 1d25a: f0 e0 ldi r31, 0x00 ; 0 1d25c: e1 51 subi r30, 0x11 ; 17 1d25e: f3 47 sbci r31, 0x73 ; 115 1d260: e4 91 lpm r30, Z 1d262: e1 50 subi r30, 0x01 ; 1 1d264: e2 31 cpi r30, 0x12 ; 18 1d266: 08 f0 brcs .+2 ; 0x1d26a 1d268: b3 c0 rjmp .+358 ; 0x1d3d0 1d26a: f0 e0 ldi r31, 0x00 ; 0 1d26c: 88 27 eor r24, r24 1d26e: e4 5c subi r30, 0xC4 ; 196 1d270: f6 41 sbci r31, 0x16 ; 22 1d272: 8f 4f sbci r24, 0xFF ; 255 1d274: 0d 94 2c dd jmp 0x3ba58 ; 0x3ba58 <__tablejump2__> 1d278: 4e e9 ldi r20, 0x9E ; 158 1d27a: 56 e9 ldi r21, 0x96 ; 150 1d27c: 5b e9 ldi r21, 0x9B ; 155 1d27e: 65 e9 ldi r22, 0x95 ; 149 1d280: 6f e9 ldi r22, 0x9F ; 159 1d282: e8 e9 ldi r30, 0x98 ; 152 1d284: 79 e9 ldi r23, 0x99 ; 153 1d286: 81 e9 ldi r24, 0x91 ; 145 1d288: 89 e9 ldi r24, 0x99 ; 153 1d28a: 93 e9 ldi r25, 0x93 ; 147 1d28c: 9d e9 ldi r25, 0x9D ; 157 1d28e: a7 e9 ldi r26, 0x97 ; 151 1d290: b6 e9 ldi r27, 0x96 ; 150 1d292: c0 e9 ldi r28, 0x90 ; 144 1d294: e8 e9 ldi r30, 0x98 ; 152 1d296: ca e9 ldi r28, 0x9A ; 154 1d298: d4 e9 ldi r29, 0x94 ; 148 1d29a: de e9 ldi r29, 0x9E ; 158 #endif #if defined(TCCR0A) && defined(COM0A1) case TIMER0A: // connect pwm to pin on timer 0, channel A sbi(TCCR0A, COM0A1); 1d29c: 84 b5 in r24, 0x24 ; 36 1d29e: 80 68 ori r24, 0x80 ; 128 1d2a0: 84 bd out 0x24, r24 ; 36 OCR0A = val; // set pwm duty 1d2a2: c7 bd out 0x27, r28 ; 39 } else { digitalWrite(pin, HIGH); } } } } 1d2a4: df 91 pop r29 1d2a6: cf 91 pop r28 1d2a8: 1f 91 pop r17 1d2aa: 08 95 ret #endif #if defined(TCCR0A) && defined(COM0B1) case TIMER0B: // connect pwm to pin on timer 0, channel B sbi(TCCR0A, COM0B1); 1d2ac: 84 b5 in r24, 0x24 ; 36 1d2ae: 80 62 ori r24, 0x20 ; 32 1d2b0: 84 bd out 0x24, r24 ; 36 OCR0B = val; // set pwm duty 1d2b2: c8 bd out 0x28, r28 ; 40 1d2b4: f7 cf rjmp .-18 ; 0x1d2a4 #endif #if defined(TCCR1A) && defined(COM1A1) case TIMER1A: // connect pwm to pin on timer 1, channel A sbi(TCCR1A, COM1A1); 1d2b6: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1d2ba: 80 68 ori r24, 0x80 ; 128 1d2bc: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1A = val; // set pwm duty 1d2c0: d0 93 89 00 sts 0x0089, r29 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 1d2c4: c0 93 88 00 sts 0x0088, r28 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 1d2c8: ed cf rjmp .-38 ; 0x1d2a4 #endif #if defined(TCCR1A) && defined(COM1B1) case TIMER1B: // connect pwm to pin on timer 1, channel B sbi(TCCR1A, COM1B1); 1d2ca: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1d2ce: 80 62 ori r24, 0x20 ; 32 1d2d0: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1B = val; // set pwm duty 1d2d4: d0 93 8b 00 sts 0x008B, r29 ; 0x80008b <__TEXT_REGION_LENGTH__+0x7c208b> 1d2d8: c0 93 8a 00 sts 0x008A, r28 ; 0x80008a <__TEXT_REGION_LENGTH__+0x7c208a> 1d2dc: e3 cf rjmp .-58 ; 0x1d2a4 #endif #if defined(TCCR1A) && defined(COM1C1) case TIMER1C: // connect pwm to pin on timer 1, channel C sbi(TCCR1A, COM1C1); 1d2de: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1d2e2: 88 60 ori r24, 0x08 ; 8 1d2e4: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1C = val; // set pwm duty 1d2e8: d0 93 8d 00 sts 0x008D, r29 ; 0x80008d <__TEXT_REGION_LENGTH__+0x7c208d> 1d2ec: c0 93 8c 00 sts 0x008C, r28 ; 0x80008c <__TEXT_REGION_LENGTH__+0x7c208c> 1d2f0: d9 cf rjmp .-78 ; 0x1d2a4 #endif #if defined(TCCR2A) && defined(COM2A1) case TIMER2A: // connect pwm to pin on timer 2, channel A sbi(TCCR2A, COM2A1); 1d2f2: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1d2f6: 80 68 ori r24, 0x80 ; 128 1d2f8: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> OCR2A = val; // set pwm duty 1d2fc: c0 93 b3 00 sts 0x00B3, r28 ; 0x8000b3 <__TEXT_REGION_LENGTH__+0x7c20b3> 1d300: d1 cf rjmp .-94 ; 0x1d2a4 #endif #if defined(TCCR2A) && defined(COM2B1) case TIMER2B: // connect pwm to pin on timer 2, channel B sbi(TCCR2A, COM2B1); 1d302: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1d306: 80 62 ori r24, 0x20 ; 32 1d308: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> OCR2B = val; // set pwm duty 1d30c: c0 93 b4 00 sts 0x00B4, r28 ; 0x8000b4 <__TEXT_REGION_LENGTH__+0x7c20b4> 1d310: c9 cf rjmp .-110 ; 0x1d2a4 #endif #if defined(TCCR3A) && defined(COM3A1) case TIMER3A: // connect pwm to pin on timer 3, channel A sbi(TCCR3A, COM3A1); 1d312: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1d316: 80 68 ori r24, 0x80 ; 128 1d318: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3A = val; // set pwm duty 1d31c: d0 93 99 00 sts 0x0099, r29 ; 0x800099 <__TEXT_REGION_LENGTH__+0x7c2099> 1d320: c0 93 98 00 sts 0x0098, r28 ; 0x800098 <__TEXT_REGION_LENGTH__+0x7c2098> 1d324: bf cf rjmp .-130 ; 0x1d2a4 #endif #if defined(TCCR3A) && defined(COM3B1) case TIMER3B: // connect pwm to pin on timer 3, channel B sbi(TCCR3A, COM3B1); 1d326: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1d32a: 80 62 ori r24, 0x20 ; 32 1d32c: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3B = val; // set pwm duty 1d330: d0 93 9b 00 sts 0x009B, r29 ; 0x80009b <__TEXT_REGION_LENGTH__+0x7c209b> 1d334: c0 93 9a 00 sts 0x009A, r28 ; 0x80009a <__TEXT_REGION_LENGTH__+0x7c209a> 1d338: b5 cf rjmp .-150 ; 0x1d2a4 #endif #if defined(TCCR3A) && defined(COM3C1) case TIMER3C: // connect pwm to pin on timer 3, channel C sbi(TCCR3A, COM3C1); 1d33a: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1d33e: 88 60 ori r24, 0x08 ; 8 1d340: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3C = val; // set pwm duty 1d344: d0 93 9d 00 sts 0x009D, r29 ; 0x80009d <__TEXT_REGION_LENGTH__+0x7c209d> 1d348: c0 93 9c 00 sts 0x009C, r28 ; 0x80009c <__TEXT_REGION_LENGTH__+0x7c209c> 1d34c: ab cf rjmp .-170 ; 0x1d2a4 #endif #if defined(TCCR4A) case TIMER4A: //connect pwm to pin on timer 4, channel A sbi(TCCR4A, COM4A1); 1d34e: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1d352: 80 68 ori r24, 0x80 ; 128 1d354: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> #if defined(COM4A0) // only used on 32U4 cbi(TCCR4A, COM4A0); 1d358: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1d35c: 8f 7b andi r24, 0xBF ; 191 1d35e: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> #endif OCR4A = val; // set pwm duty 1d362: d0 93 a9 00 sts 0x00A9, r29 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 1d366: c0 93 a8 00 sts 0x00A8, r28 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 1d36a: 9c cf rjmp .-200 ; 0x1d2a4 #endif #if defined(TCCR4A) && defined(COM4B1) case TIMER4B: // connect pwm to pin on timer 4, channel B sbi(TCCR4A, COM4B1); 1d36c: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1d370: 80 62 ori r24, 0x20 ; 32 1d372: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4B = val; // set pwm duty 1d376: d0 93 ab 00 sts 0x00AB, r29 ; 0x8000ab <__TEXT_REGION_LENGTH__+0x7c20ab> 1d37a: c0 93 aa 00 sts 0x00AA, r28 ; 0x8000aa <__TEXT_REGION_LENGTH__+0x7c20aa> 1d37e: 92 cf rjmp .-220 ; 0x1d2a4 #endif #if defined(TCCR4A) && defined(COM4C1) case TIMER4C: // connect pwm to pin on timer 4, channel C sbi(TCCR4A, COM4C1); 1d380: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1d384: 88 60 ori r24, 0x08 ; 8 1d386: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = val; // set pwm duty 1d38a: d0 93 ad 00 sts 0x00AD, r29 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 1d38e: c0 93 ac 00 sts 0x00AC, r28 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 1d392: 88 cf rjmp .-240 ; 0x1d2a4 #if defined(TCCR5A) && defined(COM5A1) case TIMER5A: // connect pwm to pin on timer 5, channel A sbi(TCCR5A, COM5A1); 1d394: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1d398: 80 68 ori r24, 0x80 ; 128 1d39a: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5A = val; // set pwm duty 1d39e: d0 93 29 01 sts 0x0129, r29 ; 0x800129 <__TEXT_REGION_LENGTH__+0x7c2129> 1d3a2: c0 93 28 01 sts 0x0128, r28 ; 0x800128 <__TEXT_REGION_LENGTH__+0x7c2128> 1d3a6: 7e cf rjmp .-260 ; 0x1d2a4 #endif #if defined(TCCR5A) && defined(COM5B1) case TIMER5B: // connect pwm to pin on timer 5, channel B sbi(TCCR5A, COM5B1); 1d3a8: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1d3ac: 80 62 ori r24, 0x20 ; 32 1d3ae: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5B = val; // set pwm duty 1d3b2: d0 93 2b 01 sts 0x012B, r29 ; 0x80012b <__TEXT_REGION_LENGTH__+0x7c212b> 1d3b6: c0 93 2a 01 sts 0x012A, r28 ; 0x80012a <__TEXT_REGION_LENGTH__+0x7c212a> 1d3ba: 74 cf rjmp .-280 ; 0x1d2a4 #endif #if defined(TCCR5A) && defined(COM5C1) case TIMER5C: // connect pwm to pin on timer 5, channel C sbi(TCCR5A, COM5C1); 1d3bc: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1d3c0: 88 60 ori r24, 0x08 ; 8 1d3c2: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5C = val; // set pwm duty 1d3c6: d0 93 2d 01 sts 0x012D, r29 ; 0x80012d <__TEXT_REGION_LENGTH__+0x7c212d> 1d3ca: c0 93 2c 01 sts 0x012C, r28 ; 0x80012c <__TEXT_REGION_LENGTH__+0x7c212c> 1d3ce: 6a cf rjmp .-300 ; 0x1d2a4 break; #endif case NOT_ON_TIMER: default: if (val < 128) { 1d3d0: c0 38 cpi r28, 0x80 ; 128 1d3d2: d1 05 cpc r29, r1 1d3d4: 0c f0 brlt .+2 ; 0x1d3d8 1d3d6: 3e cf rjmp .-388 ; 0x1d254 1d3d8: 33 cf rjmp .-410 ; 0x1d240 0001d3da : } } /// 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){ 1d3da: 4f 92 push r4 1d3dc: 5f 92 push r5 1d3de: 6f 92 push r6 1d3e0: 7f 92 push r7 1d3e2: 8f 92 push r8 1d3e4: 9f 92 push r9 1d3e6: af 92 push r10 1d3e8: bf 92 push r11 1d3ea: cf 92 push r12 1d3ec: df 92 push r13 1d3ee: ef 92 push r14 1d3f0: ff 92 push r15 1d3f2: 0f 93 push r16 1d3f4: 1f 93 push r17 1d3f6: cf 93 push r28 1d3f8: 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 1d3fa: 86 b9 out 0x06, r24 ; 6 1d3fc: fa 01 movw r30, r20 1d3fe: e0 80 ld r14, Z 1d400: 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){ 1d402: 16 16 cp r1, r22 1d404: 17 06 cpc r1, r23 1d406: b4 f4 brge .+44 ; 0x1d434 1d408: e2 16 cp r14, r18 1d40a: f3 06 cpc r15, r19 1d40c: 99 f4 brne .+38 ; 0x1d434 delayMicroseconds(delay_us); 1d40e: c7 01 movw r24, r14 //DBG(_n("%d "), t1); delayMicroseconds(t1); delay_us = t1; } 1d410: df 91 pop r29 1d412: cf 91 pop r28 1d414: 1f 91 pop r17 1d416: 0f 91 pop r16 1d418: ff 90 pop r15 1d41a: ef 90 pop r14 1d41c: df 90 pop r13 1d41e: cf 90 pop r12 1d420: bf 90 pop r11 1d422: af 90 pop r10 1d424: 9f 90 pop r9 1d426: 8f 90 pop r8 1d428: 7f 90 pop r7 1d42a: 6f 90 pop r6 1d42c: 5f 90 pop r5 1d42e: 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); 1d430: 0c 94 83 e8 jmp 0x1d106 ; 0x1d106 1d434: 89 01 movw r16, r18 1d436: 6a 01 movw r12, r20 1d438: eb 01 movw r28, r22 return; } // v1 = v0 + a * t // 0.01 = length of a step const float t0 = delay_us * 0.000001f; 1d43a: b7 01 movw r22, r14 1d43c: 90 e0 ldi r25, 0x00 ; 0 1d43e: 80 e0 ldi r24, 0x00 ; 0 1d440: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 1d444: 2d eb ldi r18, 0xBD ; 189 1d446: 37 e3 ldi r19, 0x37 ; 55 1d448: 46 e8 ldi r20, 0x86 ; 134 1d44a: 55 e3 ldi r21, 0x35 ; 53 1d44c: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 1d450: 4b 01 movw r8, r22 1d452: 5c 01 movw r10, r24 const float v1 = (0.01f / t0 + acc * t0); 1d454: be 01 movw r22, r28 1d456: 0d 2e mov r0, r29 1d458: 00 0c add r0, r0 1d45a: 88 0b sbc r24, r24 1d45c: 99 0b sbc r25, r25 1d45e: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 1d462: a5 01 movw r20, r10 1d464: 94 01 movw r18, r8 1d466: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 1d46a: 2b 01 movw r4, r22 1d46c: 3c 01 movw r6, r24 1d46e: a5 01 movw r20, r10 1d470: 94 01 movw r18, r8 1d472: 6a e0 ldi r22, 0x0A ; 10 1d474: 77 ed ldi r23, 0xD7 ; 215 1d476: 83 e2 ldi r24, 0x23 ; 35 1d478: 9c e3 ldi r25, 0x3C ; 60 1d47a: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 1d47e: 9b 01 movw r18, r22 1d480: ac 01 movw r20, r24 1d482: c3 01 movw r24, r6 1d484: b2 01 movw r22, r4 1d486: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 1d48a: 4b 01 movw r8, r22 1d48c: 5c 01 movw r10, r24 uint16_t t1; if (v1 <= 0.16f){ ///< slowest speed convertible to uint16_t delay 1d48e: 2a e0 ldi r18, 0x0A ; 10 1d490: 37 ed ldi r19, 0xD7 ; 215 1d492: 43 e2 ldi r20, 0x23 ; 35 1d494: 5e e3 ldi r21, 0x3E ; 62 1d496: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 1d49a: 18 16 cp r1, r24 1d49c: dc f5 brge .+118 ; 0x1d514 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)); 1d49e: a5 01 movw r20, r10 1d4a0: 94 01 movw r18, r8 1d4a2: 6a e0 ldi r22, 0x0A ; 10 1d4a4: 77 ed ldi r23, 0xD7 ; 215 1d4a6: 83 e2 ldi r24, 0x23 ; 35 1d4a8: 9c e3 ldi r25, 0x3C ; 60 1d4aa: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 1d4ae: 20 e0 ldi r18, 0x00 ; 0 1d4b0: 34 e2 ldi r19, 0x24 ; 36 1d4b2: 44 e7 ldi r20, 0x74 ; 116 1d4b4: 59 e4 ldi r21, 0x49 ; 73 1d4b6: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__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); 1d4ba: 20 e0 ldi r18, 0x00 ; 0 1d4bc: 30 e0 ldi r19, 0x00 ; 0 1d4be: 40 e0 ldi r20, 0x00 ; 0 1d4c0: 5f e3 ldi r21, 0x3F ; 63 1d4c2: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 1d4c6: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 1d4ca: 5b 01 movw r10, r22 1d4cc: 60 17 cp r22, r16 1d4ce: 71 07 cpc r23, r17 1d4d0: 08 f4 brcc .+2 ; 0x1d4d4 1d4d2: 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){ 1d4d4: ea 14 cp r14, r10 1d4d6: fb 04 cpc r15, r11 1d4d8: 31 f4 brne .+12 ; 0x1d4e6 1d4da: 20 97 sbiw r28, 0x00 ; 0 1d4dc: 21 f0 breq .+8 ; 0x1d4e6 if (acc > 0) 1d4de: fc f0 brlt .+62 ; 0x1d51e t1--; 1d4e0: f1 e0 ldi r31, 0x01 ; 1 1d4e2: af 1a sub r10, r31 1d4e4: b1 08 sbc r11, r1 t1++; } //DBG(_n("%d "), t1); delayMicroseconds(t1); 1d4e6: c5 01 movw r24, r10 1d4e8: 0e 94 83 e8 call 0x1d106 ; 0x1d106 delay_us = t1; 1d4ec: f6 01 movw r30, r12 1d4ee: b1 82 std Z+1, r11 ; 0x01 1d4f0: a0 82 st Z, r10 } 1d4f2: df 91 pop r29 1d4f4: cf 91 pop r28 1d4f6: 1f 91 pop r17 1d4f8: 0f 91 pop r16 1d4fa: ff 90 pop r15 1d4fc: ef 90 pop r14 1d4fe: df 90 pop r13 1d500: cf 90 pop r12 1d502: bf 90 pop r11 1d504: af 90 pop r10 1d506: 9f 90 pop r9 1d508: 8f 90 pop r8 1d50a: 7f 90 pop r7 1d50c: 6f 90 pop r6 1d50e: 5f 90 pop r5 1d510: 4f 90 pop r4 1d512: 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 1d514: 80 e1 ldi r24, 0x10 ; 16 1d516: a8 2e mov r10, r24 1d518: 87 e2 ldi r24, 0x27 ; 39 1d51a: b8 2e mov r11, r24 1d51c: db cf rjmp .-74 ; 0x1d4d4 /// make sure delay has changed a bit at least if (t1 == delay_us && acc != 0){ if (acc > 0) t1--; else t1++; 1d51e: 8f ef ldi r24, 0xFF ; 255 1d520: a8 1a sub r10, r24 1d522: b8 0a sbc r11, r24 1d524: e0 cf rjmp .-64 ; 0x1d4e6 0001d526 : /// 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){ 1d526: 2f 92 push r2 1d528: 3f 92 push r3 1d52a: 4f 92 push r4 1d52c: 5f 92 push r5 1d52e: 6f 92 push r6 1d530: 7f 92 push r7 1d532: 8f 92 push r8 1d534: 9f 92 push r9 1d536: af 92 push r10 1d538: bf 92 push r11 1d53a: cf 92 push r12 1d53c: df 92 push r13 1d53e: ef 92 push r14 1d540: ff 92 push r15 1d542: 0f 93 push r16 1d544: 1f 93 push r17 1d546: cf 93 push r28 1d548: df 93 push r29 1d54a: 00 d0 rcall .+0 ; 0x1d54c 1d54c: cd b7 in r28, 0x3d ; 61 1d54e: de b7 in r29, 0x3e ; 62 if (steps <= 0 || dec <= 0) 1d550: f9 01 movw r30, r18 1d552: e0 80 ld r14, Z 1d554: f1 80 ldd r15, Z+1 ; 0x01 1d556: e1 14 cp r14, r1 1d558: f1 04 cpc r15, r1 1d55a: 09 f4 brne .+2 ; 0x1d55e 1d55c: 6b c0 rjmp .+214 ; 0x1d634 1d55e: 16 16 cp r1, r22 1d560: 17 06 cpc r1, r23 1d562: 0c f0 brlt .+2 ; 0x1d566 1d564: 67 c0 rjmp .+206 ; 0x1d634 1d566: 19 01 movw r2, r18 1d568: 5b 83 std Y+3, r21 ; 0x03 1d56a: 4a 83 std Y+2, r20 ; 0x02 1d56c: 6b 01 movw r12, r22 1d56e: 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)); 1d570: fa 01 movw r30, r20 1d572: 00 81 ld r16, Z 1d574: 11 81 ldd r17, Z+1 ; 0x01 1d576: b8 01 movw r22, r16 1d578: 90 e0 ldi r25, 0x00 ; 0 1d57a: 80 e0 ldi r24, 0x00 ; 0 1d57c: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 1d580: 4b 01 movw r8, r22 1d582: 5c 01 movw r10, r24 1d584: b6 01 movw r22, r12 1d586: 0d 2c mov r0, r13 1d588: 00 0c add r0, r0 1d58a: 88 0b sbc r24, r24 1d58c: 99 0b sbc r25, r25 1d58e: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 1d592: 2b 01 movw r4, r22 1d594: 3c 01 movw r6, r24 1d596: a5 01 movw r20, r10 1d598: 94 01 movw r18, r8 1d59a: c5 01 movw r24, r10 1d59c: b4 01 movw r22, r8 1d59e: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 1d5a2: 9b 01 movw r18, r22 1d5a4: ac 01 movw r20, r24 1d5a6: c3 01 movw r24, r6 1d5a8: b2 01 movw r22, r4 1d5aa: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 1d5ae: 9b 01 movw r18, r22 1d5b0: ac 01 movw r20, r24 1d5b2: 6a e0 ldi r22, 0x0A ; 10 1d5b4: 77 ed ldi r23, 0xD7 ; 215 1d5b6: 83 ea ldi r24, 0xA3 ; 163 1d5b8: 9b e3 ldi r25, 0x3B ; 59 1d5ba: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__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); 1d5be: 20 e0 ldi r18, 0x00 ; 0 1d5c0: 30 e0 ldi r19, 0x00 ; 0 1d5c2: 40 e0 ldi r20, 0x00 ; 0 1d5c4: 5f e3 ldi r21, 0x3F ; 63 1d5c6: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 1d5ca: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__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){ 1d5ce: 6e 15 cp r22, r14 1d5d0: 7f 05 cpc r23, r15 1d5d2: 28 f5 brcc .+74 ; 0x1d61e 1d5d4: f9 81 ldd r31, Y+1 ; 0x01 1d5d6: f6 b9 out 0x06, r31 ; 6 /// go steady sm4_do_step(axes); delayMicroseconds(delay_us); 1d5d8: ea 81 ldd r30, Y+2 ; 0x02 1d5da: fb 81 ldd r31, Y+3 ; 0x03 1d5dc: 80 81 ld r24, Z 1d5de: 91 81 ldd r25, Z+1 ; 0x01 1d5e0: 0e 94 83 e8 call 0x1d106 ; 0x1d106 } else { /// decelerate accelerate_1_step(axes, -dec, delay_us, delay_us); } --steps; 1d5e4: f1 01 movw r30, r2 1d5e6: 80 81 ld r24, Z 1d5e8: 91 81 ldd r25, Z+1 ; 0x01 1d5ea: 01 97 sbiw r24, 0x01 ; 1 1d5ec: 91 83 std Z+1, r25 ; 0x01 1d5ee: 80 83 st Z, r24 return true; 1d5f0: 81 e0 ldi r24, 0x01 ; 1 } 1d5f2: 0f 90 pop r0 1d5f4: 0f 90 pop r0 1d5f6: 0f 90 pop r0 1d5f8: df 91 pop r29 1d5fa: cf 91 pop r28 1d5fc: 1f 91 pop r17 1d5fe: 0f 91 pop r16 1d600: ff 90 pop r15 1d602: ef 90 pop r14 1d604: df 90 pop r13 1d606: cf 90 pop r12 1d608: bf 90 pop r11 1d60a: af 90 pop r10 1d60c: 9f 90 pop r9 1d60e: 8f 90 pop r8 1d610: 7f 90 pop r7 1d612: 6f 90 pop r6 1d614: 5f 90 pop r5 1d616: 4f 90 pop r4 1d618: 3f 90 pop r3 1d61a: 2f 90 pop r2 1d61c: 08 95 ret /// go steady sm4_do_step(axes); delayMicroseconds(delay_us); } else { /// decelerate accelerate_1_step(axes, -dec, delay_us, delay_us); 1d61e: 66 27 eor r22, r22 1d620: 77 27 eor r23, r23 1d622: 6c 19 sub r22, r12 1d624: 7d 09 sbc r23, r13 1d626: 98 01 movw r18, r16 1d628: 4a 81 ldd r20, Y+2 ; 0x02 1d62a: 5b 81 ldd r21, Y+3 ; 0x03 1d62c: 89 81 ldd r24, Y+1 ; 0x01 1d62e: 0e 94 ed e9 call 0x1d3da ; 0x1d3da 1d632: d8 cf rjmp .-80 ; 0x1d5e4 /// 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; 1d634: 80 e0 ldi r24, 0x00 ; 0 1d636: dd cf rjmp .-70 ; 0x1d5f2 0001d638 : count_position[i] += dir & mask ? -1L : 1L; } } } static void __attribute__((noinline)) set_axes_dir(const uint8_t axis, const uint8_t dir) { 1d638: 0f 93 push r16 1d63a: 1f 93 push r17 1d63c: cf 93 push r28 1d63e: df 93 push r29 1d640: 18 2f mov r17, r24 1d642: 06 2f mov r16, r22 for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i <= Z_AXIS; i++, mask <<= 1) { 1d644: d1 e0 ldi r29, 0x01 ; 1 1d646: c0 e0 ldi r28, 0x00 ; 0 if (axis & mask) { 1d648: 81 2f mov r24, r17 1d64a: 8d 23 and r24, r29 1d64c: 29 f0 breq .+10 ; 0x1d658 sm4_set_dir(i, dir & mask); 1d64e: 60 2f mov r22, r16 1d650: 6d 23 and r22, r29 1d652: 8c 2f mov r24, r28 1d654: 0f 94 1c 52 call 0x2a438 ; 0x2a438 } } } 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) { 1d658: cf 5f subi r28, 0xFF ; 255 1d65a: dd 0f add r29, r29 1d65c: c3 30 cpi r28, 0x03 ; 3 1d65e: a1 f7 brne .-24 ; 0x1d648 if (axis & mask) { sm4_set_dir(i, dir & mask); } } } 1d660: df 91 pop r29 1d662: cf 91 pop r28 1d664: 1f 91 pop r17 1d666: 0f 91 pop r16 1d668: 08 95 ret 0001d66a : //@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) { 1d66a: 8f 92 push r8 1d66c: 9f 92 push r9 1d66e: af 92 push r10 1d670: bf 92 push r11 1d672: cf 92 push r12 1d674: df 92 push r13 1d676: ef 92 push r14 1d678: ff 92 push r15 1d67a: 30 e0 ldi r19, 0x00 ; 0 1d67c: 20 e0 ldi r18, 0x00 ; 0 for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i <= Z_AXIS; i++, mask <<= 1) { 1d67e: 91 e0 ldi r25, 0x01 ; 1 if (axis & mask) { 1d680: 48 2f mov r20, r24 1d682: 49 23 and r20, r25 1d684: 19 f1 breq .+70 ; 0x1d6cc count_position[i] += dir & mask ? -1L : 1L; 1d686: a9 01 movw r20, r18 1d688: 44 0f add r20, r20 1d68a: 55 1f adc r21, r21 1d68c: 44 0f add r20, r20 1d68e: 55 1f adc r21, r21 1d690: fa 01 movw r30, r20 1d692: ed 54 subi r30, 0x4D ; 77 1d694: f9 4f sbci r31, 0xF9 ; 249 1d696: c0 80 ld r12, Z 1d698: d1 80 ldd r13, Z+1 ; 0x01 1d69a: e2 80 ldd r14, Z+2 ; 0x02 1d69c: f3 80 ldd r15, Z+3 ; 0x03 1d69e: 76 2f mov r23, r22 1d6a0: 79 23 and r23, r25 1d6a2: 81 2c mov r8, r1 1d6a4: 91 2c mov r9, r1 1d6a6: 54 01 movw r10, r8 1d6a8: 83 94 inc r8 1d6aa: 77 23 and r23, r23 1d6ac: 21 f0 breq .+8 ; 0x1d6b6 1d6ae: 88 24 eor r8, r8 1d6b0: 8a 94 dec r8 1d6b2: 98 2c mov r9, r8 1d6b4: 54 01 movw r10, r8 1d6b6: c8 0c add r12, r8 1d6b8: d9 1c adc r13, r9 1d6ba: ea 1c adc r14, r10 1d6bc: fb 1c adc r15, r11 1d6be: 4d 54 subi r20, 0x4D ; 77 1d6c0: 59 4f sbci r21, 0xF9 ; 249 1d6c2: fa 01 movw r30, r20 1d6c4: c0 82 st Z, r12 1d6c6: d1 82 std Z+1, r13 ; 0x01 1d6c8: e2 82 std Z+2, r14 ; 0x02 1d6ca: 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) { 1d6cc: 99 0f add r25, r25 1d6ce: 2f 5f subi r18, 0xFF ; 255 1d6d0: 3f 4f sbci r19, 0xFF ; 255 1d6d2: 23 30 cpi r18, 0x03 ; 3 1d6d4: 31 05 cpc r19, r1 1d6d6: a1 f6 brne .-88 ; 0x1d680 if (axis & mask) { count_position[i] += dir & mask ? -1L : 1L; } } } 1d6d8: ff 90 pop r15 1d6da: ef 90 pop r14 1d6dc: df 90 pop r13 1d6de: cf 90 pop r12 1d6e0: bf 90 pop r11 1d6e2: af 90 pop r10 1d6e4: 9f 90 pop r9 1d6e6: 8f 90 pop r8 1d6e8: 08 95 ret 0001d6ea : /// 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) { 1d6ea: 2f 92 push r2 1d6ec: 3f 92 push r3 1d6ee: 4f 92 push r4 1d6f0: 5f 92 push r5 1d6f2: 6f 92 push r6 1d6f4: 7f 92 push r7 1d6f6: 8f 92 push r8 1d6f8: 9f 92 push r9 1d6fa: af 92 push r10 1d6fc: bf 92 push r11 1d6fe: cf 92 push r12 1d700: df 92 push r13 1d702: ef 92 push r14 1d704: ff 92 push r15 1d706: 0f 93 push r16 1d708: 1f 93 push r17 1d70a: cf 93 push r28 1d70c: df 93 push r29 1d70e: 00 d0 rcall .+0 ; 0x1d710 1d710: 00 d0 rcall .+0 ; 0x1d712 1d712: cd b7 in r28, 0x3d ; 61 1d714: 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]; 1d716: c0 90 b3 06 lds r12, 0x06B3 ; 0x8006b3 1d71a: d0 90 b4 06 lds r13, 0x06B4 ; 0x8006b4 1d71e: e0 90 b5 06 lds r14, 0x06B5 ; 0x8006b5 1d722: f0 90 b6 06 lds r15, 0x06B6 ; 0x8006b6 1d726: 7c 01 movw r14, r24 1d728: ec 18 sub r14, r12 1d72a: fd 08 sbc r15, r13 y -= (int16_t)count_position[1]; 1d72c: 80 91 b7 06 lds r24, 0x06B7 ; 0x8006b7 1d730: 90 91 b8 06 lds r25, 0x06B8 ; 0x8006b8 1d734: a0 91 b9 06 lds r26, 0x06B9 ; 0x8006b9 1d738: b0 91 ba 06 lds r27, 0x06BA ; 0x8006ba 1d73c: 68 1b sub r22, r24 1d73e: 79 0b sbc r23, r25 z -= (int16_t)count_position[2]; 1d740: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 1d744: 90 91 bc 06 lds r25, 0x06BC ; 0x8006bc 1d748: a0 91 bd 06 lds r26, 0x06BD ; 0x8006bd 1d74c: b0 91 be 06 lds r27, 0x06BE ; 0x8006be 1d750: fa 01 movw r30, r20 1d752: e8 1b sub r30, r24 1d754: f9 0b sbc r31, r25 1d756: fa 83 std Y+2, r31 ; 0x02 1d758: e9 83 std Y+1, r30 ; 0x01 xyzcal_dm = ((x<0)?1:0) | ((y<0)?2:0) | ((z<0)?4:0); 1d75a: fb 01 movw r30, r22 1d75c: ff 0f add r31, r31 1d75e: ee 0b sbc r30, r30 1d760: ff 0f add r31, r31 1d762: fe 2f mov r31, r30 1d764: ee 1f adc r30, r30 1d766: e2 70 andi r30, 0x02 ; 2 1d768: 89 81 ldd r24, Y+1 ; 0x01 1d76a: 9a 81 ldd r25, Y+2 ; 0x02 1d76c: 88 e0 ldi r24, 0x08 ; 8 1d76e: 98 02 muls r25, r24 1d770: 81 2d mov r24, r1 1d772: 99 0b sbc r25, r25 1d774: 11 24 eor r1, r1 1d776: 84 70 andi r24, 0x04 ; 4 1d778: e8 2b or r30, r24 1d77a: 8f 2d mov r24, r15 1d77c: 88 1f adc r24, r24 1d77e: 88 27 eor r24, r24 1d780: 88 1f adc r24, r24 1d782: e8 2b or r30, r24 1d784: e0 93 ff 03 sts 0x03FF, r30 ; 0x8003ff asm("nop"); } void sm4_set_dir_bits(uint8_t dir_bits) { uint8_t portL = PORTL; 1d788: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> portL &= 0xb8; //set direction bits to zero 1d78c: 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; 1d78e: 8a e0 ldi r24, 0x0A ; 10 1d790: e8 27 eor r30, r24 if (dir_bits & 1) portL |= 1; //set X direction bit 1d792: e0 fd sbrc r30, 0 1d794: 91 60 ori r25, 0x01 ; 1 if (dir_bits & 2) portL |= 2; //set Y direction bit 1d796: e1 fd sbrc r30, 1 1d798: 92 60 ori r25, 0x02 ; 2 if (dir_bits & 4) portL |= 4; //set Z direction bit 1d79a: e2 fd sbrc r30, 2 1d79c: 94 60 ori r25, 0x04 ; 4 if (dir_bits & 8) portL |= 64; //set E direction bit 1d79e: 90 64 ori r25, 0x40 ; 64 #endif PORTL = portL; 1d7a0: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> asm("nop"); 1d7a4: 00 00 nop sm4_set_dir_bits(xyzcal_dm); sm4_stop_cb = check_pinda?((check_pinda<0)?check_pinda_0:check_pinda_1):0; 1d7a6: 8d e1 ldi r24, 0x1D ; 29 1d7a8: 9d ec ldi r25, 0xCD ; 205 1d7aa: 01 11 cpse r16, r1 1d7ac: 02 c0 rjmp .+4 ; 0x1d7b2 1d7ae: 90 e0 ldi r25, 0x00 ; 0 1d7b0: 80 e0 ldi r24, 0x00 ; 0 1d7b2: 90 93 89 06 sts 0x0689, r25 ; 0x800689 1d7b6: 80 93 88 06 sts 0x0688, r24 ; 0x800688 xyzcal_sm4_delay = delay_us; 1d7ba: 30 93 fe 03 sts 0x03FE, r19 ; 0x8003fe 1d7be: 20 93 fd 03 sts 0x03FD, r18 ; 0x8003fd // uint32_t u = _micros(); bool ret = sm4_line_xyz_ui(abs(x), abs(y), abs(z)) ? true : false; 1d7c2: 29 81 ldd r18, Y+1 ; 0x01 1d7c4: 3a 81 ldd r19, Y+2 ; 0x02 1d7c6: 3e 83 std Y+6, r19 ; 0x06 1d7c8: 2d 83 std Y+5, r18 ; 0x05 1d7ca: 37 ff sbrs r19, 7 1d7cc: 05 c0 rjmp .+10 ; 0x1d7d8 1d7ce: 31 95 neg r19 1d7d0: 21 95 neg r18 1d7d2: 31 09 sbc r19, r1 1d7d4: 3e 83 std Y+6, r19 ; 0x06 1d7d6: 2d 83 std Y+5, r18 ; 0x05 1d7d8: 8b 01 movw r16, r22 1d7da: 77 ff sbrs r23, 7 1d7dc: 03 c0 rjmp .+6 ; 0x1d7e4 1d7de: 11 95 neg r17 1d7e0: 01 95 neg r16 1d7e2: 11 09 sbc r17, r1 1d7e4: f7 fe sbrs r15, 7 1d7e6: 03 c0 rjmp .+6 ; 0x1d7ee 1d7e8: f1 94 neg r15 1d7ea: e1 94 neg r14 1d7ec: 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); 1d7ee: 98 01 movw r18, r16 1d7f0: d8 01 movw r26, r16 1d7f2: 0f 94 34 dd call 0x3ba68 ; 0x3ba68 <__mulhisi3> 1d7f6: 4b 01 movw r8, r22 1d7f8: 5c 01 movw r10, r24 1d7fa: 2d 81 ldd r18, Y+5 ; 0x05 1d7fc: 3e 81 ldd r19, Y+6 ; 0x06 1d7fe: d9 01 movw r26, r18 1d800: 0f 94 34 dd call 0x3ba68 ; 0x3ba68 <__mulhisi3> 1d804: 86 0e add r8, r22 1d806: 97 1e adc r9, r23 1d808: a8 1e adc r10, r24 1d80a: b9 1e adc r11, r25 1d80c: 97 01 movw r18, r14 1d80e: d7 01 movw r26, r14 1d810: 0f 94 34 dd call 0x3ba68 ; 0x3ba68 <__mulhisi3> 1d814: 68 0d add r22, r8 1d816: 79 1d adc r23, r9 1d818: 8a 1d adc r24, r10 1d81a: 9b 1d adc r25, r11 1d81c: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 1d820: 0f 94 12 e1 call 0x3c224 ; 0x3c224 1d824: 20 e0 ldi r18, 0x00 ; 0 1d826: 30 e0 ldi r19, 0x00 ; 0 1d828: 40 e0 ldi r20, 0x00 ; 0 1d82a: 5f e3 ldi r21, 0x3F ; 63 1d82c: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 1d830: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 1d834: 2b 01 movw r4, r22 uint16_t nd = dd; uint16_t cx = dd; uint16_t cy = dd; uint16_t cz = dd; 1d836: 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; 1d838: 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; 1d83a: 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; 1d83c: 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; 1d83e: 1c 82 std Y+4, r1 ; 0x04 1d840: 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; 1d842: 31 2c mov r3, r1 1d844: 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; 1d846: 1a 82 std Y+2, r1 ; 0x02 1d848: 19 82 std Y+1, r1 ; 0x01 uint16_t y = 0; uint16_t z = 0; while (nd){ 1d84a: 61 14 cp r6, r1 1d84c: 71 04 cpc r7, r1 1d84e: 09 f4 brne .+2 ; 0x1d852 1d850: 47 c0 rjmp .+142 ; 0x1d8e0 if (sm4_stop_cb && (*sm4_stop_cb)()) break; 1d852: e0 91 88 06 lds r30, 0x0688 ; 0x800688 1d856: f0 91 89 06 lds r31, 0x0689 ; 0x800689 1d85a: 30 97 sbiw r30, 0x00 ; 0 1d85c: e9 f5 brne .+122 ; 0x1d8d8 uint8_t sm = 0; //step mask 1d85e: 80 e0 ldi r24, 0x00 ; 0 if (cx <= dx){ 1d860: ec 14 cp r14, r12 1d862: fd 04 cpc r15, r13 1d864: 40 f0 brcs .+16 ; 0x1d876 sm |= 1; cx += dd; 1d866: c4 0c add r12, r4 1d868: d5 1c adc r13, r5 x++; 1d86a: 89 81 ldd r24, Y+1 ; 0x01 1d86c: 9a 81 ldd r25, Y+2 ; 0x02 1d86e: 01 96 adiw r24, 0x01 ; 1 1d870: 9a 83 std Y+2, r25 ; 0x02 1d872: 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; 1d874: 81 e0 ldi r24, 0x01 ; 1 cx += dd; x++; } if (cy <= dy){ 1d876: 0a 15 cp r16, r10 1d878: 1b 05 cpc r17, r11 1d87a: 30 f0 brcs .+12 ; 0x1d888 sm |= 2; 1d87c: 82 60 ori r24, 0x02 ; 2 cy += dd; 1d87e: a4 0c add r10, r4 1d880: b5 1c adc r11, r5 y++; 1d882: 9f ef ldi r25, 0xFF ; 255 1d884: 29 1a sub r2, r25 1d886: 39 0a sbc r3, r25 } if (cz <= dz){ 1d888: ed 81 ldd r30, Y+5 ; 0x05 1d88a: fe 81 ldd r31, Y+6 ; 0x06 1d88c: e8 15 cp r30, r8 1d88e: f9 05 cpc r31, r9 1d890: 48 f0 brcs .+18 ; 0x1d8a4 sm |= 4; 1d892: 84 60 ori r24, 0x04 ; 4 cz += dd; 1d894: 84 0c add r8, r4 1d896: 95 1c adc r9, r5 z++; 1d898: 2b 81 ldd r18, Y+3 ; 0x03 1d89a: 3c 81 ldd r19, Y+4 ; 0x04 1d89c: 2f 5f subi r18, 0xFF ; 255 1d89e: 3f 4f sbci r19, 0xFF ; 255 1d8a0: 3c 83 std Y+4, r19 ; 0x04 1d8a2: 2b 83 std Y+3, r18 ; 0x03 } cx -= dx; 1d8a4: ce 18 sub r12, r14 1d8a6: df 08 sbc r13, r15 cy -= dy; 1d8a8: a0 1a sub r10, r16 1d8aa: b1 0a sbc r11, r17 cz -= dz; 1d8ac: ed 81 ldd r30, Y+5 ; 0x05 1d8ae: fe 81 ldd r31, Y+6 ; 0x06 1d8b0: 8e 1a sub r8, r30 1d8b2: 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 1d8b4: 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); 1d8b6: e0 91 84 06 lds r30, 0x0684 ; 0x800684 1d8ba: f0 91 85 06 lds r31, 0x0685 ; 0x800685 1d8be: 30 97 sbiw r30, 0x00 ; 0 1d8c0: d1 f1 breq .+116 ; 0x1d936 1d8c2: b2 01 movw r22, r4 1d8c4: c3 01 movw r24, r6 1d8c6: 19 95 eicall if (delay) delayMicroseconds(delay); 1d8c8: 00 97 sbiw r24, 0x00 ; 0 1d8ca: 11 f0 breq .+4 ; 0x1d8d0 1d8cc: 0e 94 83 e8 call 0x1d106 ; 0x1d106 nd--; 1d8d0: f1 e0 ldi r31, 0x01 ; 1 1d8d2: 6f 1a sub r6, r31 1d8d4: 71 08 sbc r7, r1 1d8d6: b9 cf rjmp .-142 ; 0x1d84a 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; 1d8d8: 19 95 eicall 1d8da: 88 23 and r24, r24 1d8dc: 09 f4 brne .+2 ; 0x1d8e0 1d8de: bf cf rjmp .-130 ; 0x1d85e 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) 1d8e0: e0 91 86 06 lds r30, 0x0686 ; 0x800686 1d8e4: f0 91 87 06 lds r31, 0x0687 ; 0x800687 1d8e8: 30 97 sbiw r30, 0x00 ; 0 1d8ea: 41 f0 breq .+16 ; 0x1d8fc (*sm4_update_pos_cb)(x, y, z, 0); 1d8ec: 30 e0 ldi r19, 0x00 ; 0 1d8ee: 20 e0 ldi r18, 0x00 ; 0 1d8f0: 4b 81 ldd r20, Y+3 ; 0x03 1d8f2: 5c 81 ldd r21, Y+4 ; 0x04 1d8f4: b1 01 movw r22, r2 1d8f6: 89 81 ldd r24, Y+1 ; 0x01 1d8f8: 9a 81 ldd r25, Y+2 ; 0x02 1d8fa: 19 95 eicall 1d8fc: 81 e0 ldi r24, 0x01 ; 1 1d8fe: 67 28 or r6, r7 1d900: 09 f4 brne .+2 ; 0x1d904 1d902: 80 e0 ldi r24, 0x00 ; 0 // u = _micros() - u; return ret; } 1d904: 26 96 adiw r28, 0x06 ; 6 1d906: 0f b6 in r0, 0x3f ; 63 1d908: f8 94 cli 1d90a: de bf out 0x3e, r29 ; 62 1d90c: 0f be out 0x3f, r0 ; 63 1d90e: cd bf out 0x3d, r28 ; 61 1d910: df 91 pop r29 1d912: cf 91 pop r28 1d914: 1f 91 pop r17 1d916: 0f 91 pop r16 1d918: ff 90 pop r15 1d91a: ef 90 pop r14 1d91c: df 90 pop r13 1d91e: cf 90 pop r12 1d920: bf 90 pop r11 1d922: af 90 pop r10 1d924: 9f 90 pop r9 1d926: 8f 90 pop r8 1d928: 7f 90 pop r7 1d92a: 6f 90 pop r6 1d92c: 5f 90 pop r5 1d92e: 4f 90 pop r4 1d930: 3f 90 pop r3 1d932: 2f 90 pop r2 1d934: 08 95 ret } cx -= dx; cy -= dy; cz -= dz; sm4_do_step(sm); uint16_t delay = SM4_DEFDELAY; 1d936: 84 ef ldi r24, 0xF4 ; 244 1d938: 91 e0 ldi r25, 0x01 ; 1 1d93a: c8 cf rjmp .-112 ; 0x1d8cc 0001d93c : } static inline uint8_t spi_txrx(uint8_t tx) { SPDR = tx; 1d93c: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))); 1d93e: 0d b4 in r0, 0x2d ; 45 1d940: 07 fe sbrs r0, 7 1d942: fd cf rjmp .-6 ; 0x1d93e return SPDR; 1d944: 8e b5 in r24, 0x2e ; 46 } 1d946: 08 95 ret 0001d948 : _CS_HIGH(); } uint8_t xflash_rd_status_reg(void) { _CS_LOW(); 1d948: 45 98 cbi 0x08, 5 ; 8 _SPI_TX(_CMD_RD_STATUS_REG); // send command 0x90 1d94a: 85 e0 ldi r24, 0x05 ; 5 1d94c: 0e 94 9e ec call 0x1d93c ; 0x1d93c uint8_t val = _SPI_RX(); // receive value 1d950: 8f ef ldi r24, 0xFF ; 255 1d952: 0e 94 9e ec call 0x1d93c ; 0x1d93c _CS_HIGH(); 1d956: 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) ; 1d958: 80 fd sbrc r24, 0 1d95a: f6 cf rjmp .-20 ; 0x1d948 } 1d95c: 08 95 ret 0001d95e : _CS_HIGH(); return val; } static void xflash_send_cmdaddr(uint8_t cmd, uint32_t addr) { 1d95e: 1f 93 push r17 1d960: cf 93 push r28 1d962: df 93 push r29 1d964: ea 01 movw r28, r20 1d966: 16 2f mov r17, r22 _SPI_TX(cmd); // send command 0x03 1d968: 0e 94 9e ec call 0x1d93c ; 0x1d93c _SPI_TX(((uint8_t*)&addr)[2]); // send addr bits 16..23 1d96c: 81 2f mov r24, r17 1d96e: 0e 94 9e ec call 0x1d93c ; 0x1d93c _SPI_TX(((uint8_t*)&addr)[1]); // send addr bits 8..15 1d972: 8d 2f mov r24, r29 1d974: 0e 94 9e ec call 0x1d93c ; 0x1d93c _SPI_TX(((uint8_t*)&addr)[0]); // send addr bits 0..7 1d978: 8c 2f mov r24, r28 } 1d97a: df 91 pop r29 1d97c: cf 91 pop r28 1d97e: 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 1d980: 0c 94 9e ec jmp 0x1d93c ; 0x1d93c 0001d984 : _CS_HIGH(); } void xflash_erase(uint8_t cmd, uint32_t addr) { _CS_LOW(); 1d984: 45 98 cbi 0x08, 5 ; 8 xflash_send_cmdaddr(cmd, addr); 1d986: 0e 94 af ec call 0x1d95e ; 0x1d95e _CS_HIGH(); 1d98a: 45 9a sbi 0x08, 5 ; 8 } 1d98c: 08 95 ret 0001d98e : *(data++) = _SPI_RX(); _CS_HIGH(); } void xflash_page_program(uint32_t addr, uint8_t* data, uint16_t cnt) { 1d98e: ef 92 push r14 1d990: ff 92 push r15 1d992: 0f 93 push r16 1d994: 1f 93 push r17 1d996: cf 93 push r28 1d998: df 93 push r29 1d99a: 7a 01 movw r14, r20 1d99c: 89 01 movw r16, r18 _CS_LOW(); 1d99e: 45 98 cbi 0x08, 5 ; 8 xflash_send_cmdaddr(_CMD_PAGE_PROGRAM, addr); 1d9a0: ab 01 movw r20, r22 1d9a2: bc 01 movw r22, r24 1d9a4: 82 e0 ldi r24, 0x02 ; 2 1d9a6: 0e 94 af ec call 0x1d95e ; 0x1d95e 1d9aa: e7 01 movw r28, r14 1d9ac: 0e 0d add r16, r14 1d9ae: 1f 1d adc r17, r15 while (cnt--) // send data 1d9b0: c0 17 cp r28, r16 1d9b2: d1 07 cpc r29, r17 1d9b4: 41 f4 brne .+16 ; 0x1d9c6 _SPI_TX(*(data++)); _CS_HIGH(); 1d9b6: 45 9a sbi 0x08, 5 ; 8 } 1d9b8: df 91 pop r29 1d9ba: cf 91 pop r28 1d9bc: 1f 91 pop r17 1d9be: 0f 91 pop r16 1d9c0: ff 90 pop r15 1d9c2: ef 90 pop r14 1d9c4: 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++)); 1d9c6: 89 91 ld r24, Y+ 1d9c8: 0e 94 9e ec call 0x1d93c ; 0x1d93c 1d9cc: f1 cf rjmp .-30 ; 0x1d9b0 0001d9ce : _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) { 1d9ce: ef 92 push r14 1d9d0: ff 92 push r15 1d9d2: 0f 93 push r16 1d9d4: 1f 93 push r17 1d9d6: cf 93 push r28 1d9d8: df 93 push r29 1d9da: 7a 01 movw r14, r20 1d9dc: 89 01 movw r16, r18 _CS_LOW(); 1d9de: 45 98 cbi 0x08, 5 ; 8 xflash_send_cmdaddr(_CMD_RD_DATA, addr); 1d9e0: ab 01 movw r20, r22 1d9e2: bc 01 movw r22, r24 1d9e4: 83 e0 ldi r24, 0x03 ; 3 1d9e6: 0e 94 af ec call 0x1d95e ; 0x1d95e 1d9ea: e7 01 movw r28, r14 1d9ec: 0e 0d add r16, r14 1d9ee: 1f 1d adc r17, r15 while (cnt--) // receive data 1d9f0: c0 17 cp r28, r16 1d9f2: d1 07 cpc r29, r17 1d9f4: 41 f4 brne .+16 ; 0x1da06 *(data++) = _SPI_RX(); _CS_HIGH(); 1d9f6: 45 9a sbi 0x08, 5 ; 8 } 1d9f8: df 91 pop r29 1d9fa: cf 91 pop r28 1d9fc: 1f 91 pop r17 1d9fe: 0f 91 pop r16 1da00: ff 90 pop r15 1da02: ef 90 pop r14 1da04: 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(); 1da06: 8f ef ldi r24, 0xFF ; 255 1da08: 0e 94 9e ec call 0x1d93c ; 0x1d93c 1da0c: 89 93 st Y+, r24 1da0e: f0 cf rjmp .-32 ; 0x1d9f0 0001da10 : #include "asm.h" #include "xflash.h" #include "Marlin.h" // for softReset bool xfdump_check_state(dump_crash_reason* reason) { 1da10: 0f 93 push r16 1da12: 1f 93 push r17 1da14: cf 93 push r28 1da16: df 93 push r29 1da18: 00 d0 rcall .+0 ; 0x1da1a 1da1a: 1f 92 push r1 1da1c: cd b7 in r28, 0x3d ; 61 1da1e: de b7 in r29, 0x3e ; 62 1da20: 8c 01 movw r16, r24 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 1da22: 8c e5 ldi r24, 0x5C ; 92 1da24: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 1da26: 1d bc out 0x2d, r1 ; 45 uint32_t magic; XFLASH_SPI_ENTER(); xflash_rd_data(DUMP_OFFSET + offsetof(dump_t, header.magic), 1da28: 24 e0 ldi r18, 0x04 ; 4 1da2a: 30 e0 ldi r19, 0x00 ; 0 1da2c: ae 01 movw r20, r28 1da2e: 4f 5f subi r20, 0xFF ; 255 1da30: 5f 4f sbci r21, 0xFF ; 255 1da32: 60 e0 ldi r22, 0x00 ; 0 1da34: 70 ed ldi r23, 0xD0 ; 208 1da36: 83 e0 ldi r24, 0x03 ; 3 1da38: 90 e0 ldi r25, 0x00 ; 0 1da3a: 0e 94 e7 ec call 0x1d9ce ; 0x1d9ce (uint8_t*)&magic, sizeof(magic)); if (magic != DUMP_MAGIC) 1da3e: 89 81 ldd r24, Y+1 ; 0x01 1da40: 9a 81 ldd r25, Y+2 ; 0x02 1da42: ab 81 ldd r26, Y+3 ; 0x03 1da44: bc 81 ldd r27, Y+4 ; 0x04 1da46: 87 34 cpi r24, 0x47 ; 71 1da48: 95 45 sbci r25, 0x55 ; 85 1da4a: a2 45 sbci r26, 0x52 ; 82 1da4c: b5 45 sbci r27, 0x55 ; 85 1da4e: 71 f4 brne .+28 ; 0x1da6c return false; if (reason) 1da50: 01 15 cp r16, r1 1da52: 11 05 cpc r17, r1 1da54: 49 f0 breq .+18 ; 0x1da68 { xflash_rd_data(DUMP_OFFSET + offsetof(dump_t, header.crash_reason), 1da56: 21 e0 ldi r18, 0x01 ; 1 1da58: 30 e0 ldi r19, 0x00 ; 0 1da5a: a8 01 movw r20, r16 1da5c: 65 e0 ldi r22, 0x05 ; 5 1da5e: 70 ed ldi r23, 0xD0 ; 208 1da60: 83 e0 ldi r24, 0x03 ; 3 1da62: 90 e0 ldi r25, 0x00 ; 0 1da64: 0e 94 e7 ec call 0x1d9ce ; 0x1d9ce (uint8_t*)reason, sizeof(*reason)); } return true; 1da68: 81 e0 ldi r24, 0x01 ; 1 1da6a: 01 c0 rjmp .+2 ; 0x1da6e XFLASH_SPI_ENTER(); xflash_rd_data(DUMP_OFFSET + offsetof(dump_t, header.magic), (uint8_t*)&magic, sizeof(magic)); if (magic != DUMP_MAGIC) return false; 1da6c: 80 e0 ldi r24, 0x00 ; 0 { xflash_rd_data(DUMP_OFFSET + offsetof(dump_t, header.crash_reason), (uint8_t*)reason, sizeof(*reason)); } return true; } 1da6e: 0f 90 pop r0 1da70: 0f 90 pop r0 1da72: 0f 90 pop r0 1da74: 0f 90 pop r0 1da76: df 91 pop r29 1da78: cf 91 pop r28 1da7a: 1f 91 pop r17 1da7c: 0f 91 pop r16 1da7e: 08 95 ret 0001da80 : return 1; } void xflash_enable_wr(void) { _CS_LOW(); 1da80: 45 98 cbi 0x08, 5 ; 8 _SPI_TX(_CMD_ENABLE_WR); // send command 0x06 1da82: 86 e0 ldi r24, 0x06 ; 6 1da84: 0e 94 9e ec call 0x1d93c ; 0x1d93c _CS_HIGH(); 1da88: 45 9a sbi 0x08, 5 ; 8 } 1da8a: 08 95 ret 0001da8c : } } static void __attribute__((noinline)) xfdump_dump_core(dump_header_t& hdr, uint32_t addr, uint8_t* buf, uint16_t cnt) { 1da8c: 4f 92 push r4 1da8e: 5f 92 push r5 1da90: 6f 92 push r6 1da92: 7f 92 push r7 1da94: 8f 92 push r8 1da96: 9f 92 push r9 1da98: af 92 push r10 1da9a: bf 92 push r11 1da9c: ef 92 push r14 1da9e: ff 92 push r15 1daa0: 0f 93 push r16 1daa2: 1f 93 push r17 1daa4: cf 93 push r28 1daa6: df 93 push r29 1daa8: 7c 01 movw r14, r24 1daaa: 4a 01 movw r8, r20 1daac: 5b 01 movw r10, r22 1daae: e9 01 movw r28, r18 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 1dab0: 8c e5 ldi r24, 0x5C ; 92 1dab2: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 1dab4: 1d bc out 0x2d, r1 ; 45 } static void xfdump_erase() { for(uint32_t addr = DUMP_OFFSET; 1dab6: 41 2c mov r4, r1 1dab8: 80 ed ldi r24, 0xD0 ; 208 1daba: 58 2e mov r5, r24 1dabc: 83 e0 ldi r24, 0x03 ; 3 1dabe: 68 2e mov r6, r24 1dac0: 71 2c mov r7, r1 addr < DUMP_OFFSET + DUMP_SIZE; addr += 4096) { xflash_enable_wr(); 1dac2: 0e 94 40 ed call 0x1da80 ; 0x1da80 _CS_HIGH(); } void xflash_sector_erase(uint32_t addr) { return xflash_erase(_CMD_SECTOR_ERASE, addr); 1dac6: b3 01 movw r22, r6 1dac8: a2 01 movw r20, r4 1daca: 80 e2 ldi r24, 0x20 ; 32 1dacc: 0e 94 c2 ec call 0x1d984 ; 0x1d984 xflash_sector_erase(addr); xflash_wait_busy(); 1dad0: 0e 94 a4 ec call 0x1d948 ; 0x1d948 static void xfdump_erase() { for(uint32_t addr = DUMP_OFFSET; addr < DUMP_OFFSET + DUMP_SIZE; addr += 4096) 1dad4: 80 e1 ldi r24, 0x10 ; 16 1dad6: 58 0e add r5, r24 1dad8: 61 1c adc r6, r1 1dada: 71 1c adc r7, r1 static void xfdump_erase() { for(uint32_t addr = DUMP_OFFSET; addr < DUMP_OFFSET + DUMP_SIZE; 1dadc: 41 14 cp r4, r1 1dade: 51 04 cpc r5, r1 1dae0: e4 e0 ldi r30, 0x04 ; 4 1dae2: 6e 06 cpc r6, r30 1dae4: 71 04 cpc r7, r1 1dae6: 69 f7 brne .-38 ; 0x1dac2 // start by clearing all sectors (we need all of them in any case) xfdump_erase(); // sample SP/PC hdr.sp = SP; 1dae8: 8d b7 in r24, 0x3d ; 61 1daea: 9e b7 in r25, 0x3e ; 62 1daec: f7 01 movw r30, r14 1daee: 93 87 std Z+11, r25 ; 0x0b 1daf0: 82 87 std Z+10, r24 ; 0x0a "rcall .\n" "pop %A0\n" "pop %B0\n" "pop %C0\n" : "=&r" (ret) ); 1daf2: 00 d0 rcall .+0 ; 0x1daf4 1daf4: 8f 91 pop r24 1daf6: 9f 91 pop r25 1daf8: af 91 pop r26 hdr.pc = GETPC(); 1dafa: b0 e0 ldi r27, 0x00 ; 0 1dafc: 86 83 std Z+6, r24 ; 0x06 1dafe: 97 83 std Z+7, r25 ; 0x07 1db00: a0 87 std Z+8, r26 ; 0x08 1db02: 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(); 1db04: 0e 94 40 ed call 0x1da80 ; 0x1da80 xflash_page_program(DUMP_OFFSET, (uint8_t*)&hdr, sizeof(hdr)); 1db08: 2c e0 ldi r18, 0x0C ; 12 1db0a: 30 e0 ldi r19, 0x00 ; 0 1db0c: a7 01 movw r20, r14 1db0e: 60 e0 ldi r22, 0x00 ; 0 1db10: 70 ed ldi r23, 0xD0 ; 208 1db12: 83 e0 ldi r24, 0x03 ; 3 1db14: 90 e0 ldi r25, 0x00 ; 0 1db16: 0e 94 c7 ec call 0x1d98e ; 0x1d98e xflash_wait_busy(); 1db1a: 0e 94 a4 ec call 0x1d948 ; 0x1d948 void xflash_multipage_program(uint32_t addr, uint8_t* data, uint16_t cnt) { while(cnt) { xflash_enable_wr(); 1db1e: 0e 94 40 ed call 0x1da80 ; 0x1da80 _CS_LOW(); 1db22: 45 98 cbi 0x08, 5 ; 8 xflash_send_cmdaddr(_CMD_PAGE_PROGRAM, addr); 1db24: b5 01 movw r22, r10 1db26: a4 01 movw r20, r8 1db28: 82 e0 ldi r24, 0x02 ; 2 1db2a: 0e 94 af ec call 0x1d95e ; 0x1d95e 1db2e: fe 01 movw r30, r28 while(1) { // send data _SPI_TX(*(data++)); 1db30: 21 96 adiw r28, 0x01 ; 1 1db32: 80 81 ld r24, Z 1db34: 0e 94 9e ec call 0x1d93c ; 0x1d93c if(!--cnt || !(++addr & 0xFF)) 1db38: 01 50 subi r16, 0x01 ; 1 1db3a: 11 09 sbc r17, r1 1db3c: 41 f0 breq .+16 ; 0x1db4e 1db3e: ff ef ldi r31, 0xFF ; 255 1db40: 8f 1a sub r8, r31 1db42: 9f 0a sbc r9, r31 1db44: af 0a sbc r10, r31 1db46: bf 0a sbc r11, r31 _CS_LOW(); xflash_send_cmdaddr(_CMD_PAGE_PROGRAM, addr); while(1) { // send data _SPI_TX(*(data++)); 1db48: fe 01 movw r30, r28 if(!--cnt || !(++addr & 0xFF)) 1db4a: 81 10 cpse r8, r1 1db4c: f1 cf rjmp .-30 ; 0x1db30 { // on a page boundary or end of write _CS_HIGH(); 1db4e: 45 9a sbi 0x08, 5 ; 8 xflash_wait_busy(); 1db50: 0e 94 a4 ec call 0x1d948 ; 0x1d948 _CS_HIGH(); } void xflash_multipage_program(uint32_t addr, uint8_t* data, uint16_t cnt) { while(cnt) 1db54: 01 15 cp r16, r1 1db56: 11 05 cpc r17, r1 1db58: 11 f7 brne .-60 ; 0x1db1e // write data static_assert(sizeof(dump_t::data) <= RAMEND+1, "dump area size insufficient"); xflash_multipage_program(addr, buf, cnt); } 1db5a: df 91 pop r29 1db5c: cf 91 pop r28 1db5e: 1f 91 pop r17 1db60: 0f 91 pop r16 1db62: ff 90 pop r15 1db64: ef 90 pop r14 1db66: bf 90 pop r11 1db68: af 90 pop r10 1db6a: 9f 90 pop r9 1db6c: 8f 90 pop r8 1db6e: 7f 90 pop r7 1db70: 6f 90 pop r6 1db72: 5f 90 pop r5 1db74: 4f 90 pop r4 1db76: 08 95 ret 0001db78 : (uint8_t*)RAMSTART, RAMSIZE); } void xfdump_full_dump_and_reset(dump_crash_reason reason) { 1db78: cf 93 push r28 1db7a: df 93 push r29 1db7c: cd b7 in r28, 0x3d ; 61 1db7e: de b7 in r29, 0x3e ; 62 1db80: 2c 97 sbiw r28, 0x0c ; 12 1db82: 0f b6 in r0, 0x3f ; 63 1db84: f8 94 cli 1db86: de bf out 0x3e, r29 ; 62 1db88: 0f be out 0x3f, r0 ; 63 1db8a: cd bf out 0x3d, r28 ; 61 dump_header_t buf; buf.magic = DUMP_MAGIC; 1db8c: 47 e4 ldi r20, 0x47 ; 71 1db8e: 55 e5 ldi r21, 0x55 ; 85 1db90: 62 e5 ldi r22, 0x52 ; 82 1db92: 75 e5 ldi r23, 0x55 ; 85 1db94: 49 83 std Y+1, r20 ; 0x01 1db96: 5a 83 std Y+2, r21 ; 0x02 1db98: 6b 83 std Y+3, r22 ; 0x03 1db9a: 7c 83 std Y+4, r23 ; 0x04 buf.regs_present = true; 1db9c: 91 e0 ldi r25, 0x01 ; 1 1db9e: 9d 83 std Y+5, r25 ; 0x05 buf.crash_reason = (uint8_t)reason; 1dba0: 8e 83 std Y+6, r24 ; 0x06 // disable interrupts for a cleaner register dump cli(); 1dba2: f8 94 cli 1dba4: 88 e1 ldi r24, 0x18 ; 24 1dba6: 9d e0 ldi r25, 0x0D ; 13 1dba8: 0f b6 in r0, 0x3f ; 63 1dbaa: f8 94 cli 1dbac: a8 95 wdr 1dbae: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1dbb2: 0f be out 0x3f, r0 ; 63 1dbb4: 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); 1dbb8: 00 e0 ldi r16, 0x00 ; 0 1dbba: 12 e2 ldi r17, 0x22 ; 34 1dbbc: 30 e0 ldi r19, 0x00 ; 0 1dbbe: 20 e0 ldi r18, 0x00 ; 0 1dbc0: 40 e0 ldi r20, 0x00 ; 0 1dbc2: 51 ed ldi r21, 0xD1 ; 209 1dbc4: 63 e0 ldi r22, 0x03 ; 3 1dbc6: 70 e0 ldi r23, 0x00 ; 0 1dbc8: ce 01 movw r24, r28 1dbca: 01 96 adiw r24, 0x01 ; 1 1dbcc: 0e 94 46 ed call 0x1da8c ; 0x1da8c // force a reset even sooner softReset(); 1dbd0: 0e 94 4c 67 call 0xce98 ; 0xce98 0001dbd4 : xflash_multipage_program(addr, buf, cnt); } void xfdump_dump() { 1dbd4: 0f 93 push r16 1dbd6: 1f 93 push r17 1dbd8: cf 93 push r28 1dbda: df 93 push r29 1dbdc: cd b7 in r28, 0x3d ; 61 1dbde: de b7 in r29, 0x3e ; 62 1dbe0: 2c 97 sbiw r28, 0x0c ; 12 1dbe2: 0f b6 in r0, 0x3f ; 63 1dbe4: f8 94 cli 1dbe6: de bf out 0x3e, r29 ; 62 1dbe8: 0f be out 0x3f, r0 ; 63 1dbea: cd bf out 0x3d, r28 ; 61 dump_header_t buf; buf.magic = DUMP_MAGIC; 1dbec: 87 e4 ldi r24, 0x47 ; 71 1dbee: 95 e5 ldi r25, 0x55 ; 85 1dbf0: a2 e5 ldi r26, 0x52 ; 82 1dbf2: b5 e5 ldi r27, 0x55 ; 85 1dbf4: 89 83 std Y+1, r24 ; 0x01 1dbf6: 9a 83 std Y+2, r25 ; 0x02 1dbf8: ab 83 std Y+3, r26 ; 0x03 1dbfa: bc 83 std Y+4, r27 ; 0x04 buf.regs_present = false; 1dbfc: 1d 82 std Y+5, r1 ; 0x05 buf.crash_reason = (uint8_t)dump_crash_reason::manual; 1dbfe: 1e 82 std Y+6, r1 ; 0x06 // write sram only xfdump_dump_core(buf, DUMP_OFFSET + offsetof(dump_t, data.sram), 1dc00: 00 e0 ldi r16, 0x00 ; 0 1dc02: 10 e2 ldi r17, 0x20 ; 32 1dc04: 20 e0 ldi r18, 0x00 ; 0 1dc06: 32 e0 ldi r19, 0x02 ; 2 1dc08: 40 e0 ldi r20, 0x00 ; 0 1dc0a: 53 ed ldi r21, 0xD3 ; 211 1dc0c: 63 e0 ldi r22, 0x03 ; 3 1dc0e: 70 e0 ldi r23, 0x00 ; 0 1dc10: ce 01 movw r24, r28 1dc12: 01 96 adiw r24, 0x01 ; 1 1dc14: 0e 94 46 ed call 0x1da8c ; 0x1da8c (uint8_t*)RAMSTART, RAMSIZE); } 1dc18: 2c 96 adiw r28, 0x0c ; 12 1dc1a: 0f b6 in r0, 0x3f ; 63 1dc1c: f8 94 cli 1dc1e: de bf out 0x3e, r29 ; 62 1dc20: 0f be out 0x3f, r0 ; 63 1dc22: cd bf out 0x3d, r28 ; 61 1dc24: df 91 pop r29 1dc26: cf 91 pop r28 1dc28: 1f 91 pop r17 1dc2a: 0f 91 pop r16 1dc2c: 08 95 ret 0001dc2e : int xflash_mfrid_devid(void); int8_t xflash_init(void) { 1dc2e: cf 93 push r28 _CS_HIGH(); 1dc30: 45 9a sbi 0x08, 5 ; 8 SET_OUTPUT(XFLASH_PIN_CS); 1dc32: 3d 9a sbi 0x07, 5 ; 7 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 1dc34: 8c e5 ldi r24, 0x5C ; 92 1dc36: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 1dc38: 1d bc out 0x2d, r1 ; 45 _CS_HIGH(); } int xflash_mfrid_devid(void) { _CS_LOW(); 1dc3a: 45 98 cbi 0x08, 5 ; 8 _SPI_TX(_CMD_MFRID_DEVID); // send command 0x90 1dc3c: 80 e9 ldi r24, 0x90 ; 144 1dc3e: 0e 94 9e ec call 0x1d93c ; 0x1d93c uint8_t cnt = 3; // 3 address bytes while (cnt--) // send address bytes _SPI_TX(0x00); 1dc42: 80 e0 ldi r24, 0x00 ; 0 1dc44: 0e 94 9e ec call 0x1d93c ; 0x1d93c 1dc48: 80 e0 ldi r24, 0x00 ; 0 1dc4a: 0e 94 9e ec call 0x1d93c ; 0x1d93c 1dc4e: 80 e0 ldi r24, 0x00 ; 0 1dc50: 0e 94 9e ec call 0x1d93c ; 0x1d93c uint8_t xflash_mfrid = _SPI_RX(); // receive mfrid 1dc54: 8f ef ldi r24, 0xFF ; 255 1dc56: 0e 94 9e ec call 0x1d93c ; 0x1d93c 1dc5a: c8 2f mov r28, r24 uint8_t xflash_devid = _SPI_RX(); // receive devid 1dc5c: 8f ef ldi r24, 0xFF ; 255 1dc5e: 0e 94 9e ec call 0x1d93c ; 0x1d93c 1dc62: 98 2f mov r25, r24 _CS_HIGH(); 1dc64: 45 9a sbi 0x08, 5 ; 8 return ((xflash_mfrid == _MFRID_W25X20CL) && (xflash_devid == _DEVID_W25X20CL)) || 1dc66: cf 3e cpi r28, 0xEF ; 239 1dc68: 11 f0 breq .+4 ; 0x1dc6e 1dc6a: c8 3c cpi r28, 0xC8 ; 200 1dc6c: 19 f4 brne .+6 ; 0x1dc74 1dc6e: 81 e0 ldi r24, 0x01 ; 1 1dc70: 91 31 cpi r25, 0x11 ; 17 1dc72: 09 f0 breq .+2 ; 0x1dc76 int8_t xflash_init(void) { _CS_HIGH(); SET_OUTPUT(XFLASH_PIN_CS); XFLASH_SPI_ENTER(); if (!xflash_mfrid_devid()) return 0; 1dc74: 80 e0 ldi r24, 0x00 ; 0 return 1; } 1dc76: cf 91 pop r28 1dc78: 08 95 ret 0001dc7a : status |= components; eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } void calibration_status_clear(CalibrationStatus components) { 1dc7a: cf 93 push r28 1dc7c: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 1dc7e: 86 ea ldi r24, 0xA6 ; 166 1dc80: 9c e0 ldi r25, 0x0C ; 12 1dc82: 0f 94 1c dc call 0x3b838 ; 0x3b838 status &= ~components; 1dc86: c0 95 com r28 1dc88: 6c 2f mov r22, r28 1dc8a: 68 23 and r22, r24 1dc8c: 86 ea ldi r24, 0xA6 ; 166 1dc8e: 9c e0 ldi r25, 0x0C ; 12 eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } 1dc90: cf 91 pop r28 1dc92: 0d 94 40 dc jmp 0x3b880 ; 0x3b880 0001dc96 : } } } static void lcd_reset_sheet() { 1dc96: 1f 93 push r17 1dc98: cf 93 push r28 1dc9a: df 93 push r29 1dc9c: 00 d0 rcall .+0 ; 0x1dc9e 1dc9e: 00 d0 rcall .+0 ; 0x1dca0 1dca0: 1f 92 push r1 1dca2: 1f 92 push r1 1dca4: cd b7 in r28, 0x3d ; 61 1dca6: de b7 in r29, 0x3e ; 62 SheetName sheetName; eeprom_default_sheet_name(selected_sheet, sheetName); 1dca8: be 01 movw r22, r28 1dcaa: 6f 5f subi r22, 0xFF ; 255 1dcac: 7f 4f sbci r23, 0xFF ; 255 1dcae: 80 91 e2 03 lds r24, 0x03E2 ; 0x8003e2 1dcb2: 0e 94 71 76 call 0xece2 ; 0xece2 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[selected_sheet].z_offset)),EEPROM_EMPTY_VALUE16); 1dcb6: 80 91 e2 03 lds r24, 0x03E2 ; 0x8003e2 1dcba: 1b e0 ldi r17, 0x0B ; 11 1dcbc: 81 9f mul r24, r17 1dcbe: c0 01 movw r24, r0 1dcc0: 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); 1dcc2: 6f ef ldi r22, 0xFF ; 255 1dcc4: 7f ef ldi r23, 0xFF ; 255 1dcc6: 80 5b subi r24, 0xB0 ; 176 1dcc8: 92 4f sbci r25, 0xF2 ; 242 1dcca: 0f 94 5e dc call 0x3b8bc ; 0x3b8bc eeprom_update_block_notify(sheetName.c,EEPROM_Sheets_base->s[selected_sheet].name,sizeof(Sheet::name)); 1dcce: 60 91 e2 03 lds r22, 0x03E2 ; 0x8003e2 1dcd2: 61 9f mul r22, r17 1dcd4: b0 01 movw r22, r0 1dcd6: 11 24 eor r1, r1 1dcd8: 67 5b subi r22, 0xB7 ; 183 1dcda: 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); 1dcdc: 47 e0 ldi r20, 0x07 ; 7 1dcde: 50 e0 ldi r21, 0x00 ; 0 1dce0: ce 01 movw r24, r28 1dce2: 01 96 adiw r24, 0x01 ; 1 1dce4: 0f 94 30 dc call 0x3b860 ; 0x3b860 if (selected_sheet == eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet))) 1dce8: 81 ea ldi r24, 0xA1 ; 161 1dcea: 9d e0 ldi r25, 0x0D ; 13 1dcec: 0f 94 1c dc call 0x3b838 ; 0x3b838 1dcf0: 90 91 e2 03 lds r25, 0x03E2 ; 0x8003e2 1dcf4: 89 13 cpse r24, r25 1dcf6: 0a c0 rjmp .+20 ; 0x1dd0c { eeprom_switch_to_next_sheet(); 1dcf8: 0e 94 63 76 call 0xecc6 ; 0xecc6 if (-1 == eeprom_next_initialized_sheet(0)) 1dcfc: 80 e0 ldi r24, 0x00 ; 0 1dcfe: 0e 94 4f 76 call 0xec9e ; 0xec9e 1dd02: 8f 3f cpi r24, 0xFF ; 255 1dd04: 19 f4 brne .+6 ; 0x1dd0c calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 1dd06: 80 e1 ldi r24, 0x10 ; 16 1dd08: 0e 94 3d ee call 0x1dc7a ; 0x1dc7a } menu_back(); 1dd0c: 0f 94 5e d4 call 0x3a8bc ; 0x3a8bc } 1dd10: 28 96 adiw r28, 0x08 ; 8 1dd12: 0f b6 in r0, 0x3f ; 63 1dd14: f8 94 cli 1dd16: de bf out 0x3e, r29 ; 62 1dd18: 0f be out 0x3f, r0 ; 63 1dd1a: cd bf out 0x3d, r28 ; 61 1dd1c: df 91 pop r29 1dd1e: cf 91 pop r28 1dd20: 1f 91 pop r17 1dd22: 08 95 ret 0001dd24 : CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); return ((status & components) == components); } void calibration_status_set(CalibrationStatus components) { 1dd24: cf 93 push r28 1dd26: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 1dd28: 86 ea ldi r24, 0xA6 ; 166 1dd2a: 9c e0 ldi r25, 0x0C ; 12 1dd2c: 0f 94 1c dc call 0x3b838 ; 0x3b838 status |= components; 1dd30: 68 2f mov r22, r24 1dd32: 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); 1dd34: 86 ea ldi r24, 0xA6 ; 166 1dd36: 9c e0 ldi r25, 0x0C ; 12 eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } 1dd38: cf 91 pop r28 1dd3a: 0d 94 40 dc jmp 0x3b880 ; 0x3b880 0001dd3e : sprintf_P(dest, PSTR("%u.%u.%u.%u"), IP[0], IP[1], IP[2], IP[3]); } bool calibration_status_get(CalibrationStatus components) { 1dd3e: cf 93 push r28 1dd40: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 1dd42: 86 ea ldi r24, 0xA6 ; 166 1dd44: 9c e0 ldi r25, 0x0C ; 12 1dd46: 0f 94 1c dc call 0x3b838 ; 0x3b838 return ((status & components) == components); 1dd4a: 98 2f mov r25, r24 1dd4c: 9c 23 and r25, r28 1dd4e: 81 e0 ldi r24, 0x01 ; 1 1dd50: 9c 13 cpse r25, r28 1dd52: 80 e0 ldi r24, 0x00 ; 0 } 1dd54: cf 91 pop r28 1dd56: 08 95 ret 0001dd58 : //! |>Continue | MSG_CONTINUE //! | Reset | MSG_RESET //! ---------------------- //! @endcode void lcd_first_layer_calibration_reset() { 1dd58: af 92 push r10 1dd5a: bf 92 push r11 1dd5c: cf 92 push r12 1dd5e: df 92 push r13 1dd60: ef 92 push r14 1dd62: ff 92 push r15 1dd64: 0f 93 push r16 1dd66: 1f 93 push r17 1dd68: cf 93 push r28 1dd6a: df 93 push r29 1dd6c: 00 d0 rcall .+0 ; 0x1dd6e 1dd6e: 00 d0 rcall .+0 ; 0x1dd70 1dd70: 1f 92 push r1 1dd72: cd b7 in r28, 0x3d ; 61 1dd74: 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)) || 1dd76: 80 91 a8 03 lds r24, 0x03A8 ; 0x8003a8 1dd7a: 81 11 cpse r24, r1 1dd7c: 18 c0 rjmp .+48 ; 0x1ddae 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))) || 1dd7e: 81 ea ldi r24, 0xA1 ; 161 1dd80: 9d e0 ldi r25, 0x0D ; 13 1dd82: 0f 94 1c dc call 0x3b838 ; 0x3b838 1dd86: 18 2f mov r17, r24 1dd88: 0e 94 41 76 call 0xec82 ; 0xec82 1dd8c: 88 23 and r24, r24 1dd8e: 79 f0 breq .+30 ; 0x1ddae (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) || 1dd90: 80 e1 ldi r24, 0x10 ; 16 1dd92: 0e 94 9f ee call 0x1dd3e ; 0x1dd3e 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))) || 1dd96: 88 23 and r24, r24 1dd98: 51 f0 breq .+20 ; 0x1ddae (!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))))) 1dd9a: 2b e0 ldi r18, 0x0B ; 11 1dd9c: 12 9f mul r17, r18 1dd9e: c0 01 movw r24, r0 1dda0: 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 1dda2: 80 5b subi r24, 0xB0 ; 176 1dda4: 92 4f sbci r25, 0xF2 ; 242 1dda6: 0f 94 2a dc call 0x3b854 ; 0x3b854 } 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)) || 1ddaa: 89 2b or r24, r25 1ddac: f1 f4 brne .+60 ; 0x1ddea (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) 1ddae: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 1ddb2: 88 23 and r24, r24 1ddb4: 71 f0 breq .+28 ; 0x1ddd2 { eeprom_update_word_notify(reinterpret_cast(&EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset), 0xffff); 1ddb6: 81 ea ldi r24, 0xA1 ; 161 1ddb8: 9d e0 ldi r25, 0x0D ; 13 1ddba: 0f 94 1c dc call 0x3b838 ; 0x3b838 1ddbe: 2b e0 ldi r18, 0x0B ; 11 1ddc0: 82 9f mul r24, r18 1ddc2: c0 01 movw r24, r0 1ddc4: 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); 1ddc6: 6f ef ldi r22, 0xFF ; 255 1ddc8: 7f ef ldi r23, 0xFF ; 255 1ddca: 80 5b subi r24, 0xB0 ; 176 1ddcc: 92 4f sbci r25, 0xF2 ; 242 1ddce: 0f 94 5e dc call 0x3b8bc ; 0x3b8bc } // 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()); 1ddd2: 0e 94 fd 70 call 0xe1fa ; 0xe1fa 1ddd6: 21 e0 ldi r18, 0x01 ; 1 1ddd8: 81 11 cpse r24, r1 1ddda: 20 e0 ldi r18, 0x00 ; 0 1dddc: 41 e0 ldi r20, 0x01 ; 1 1ddde: 70 e0 ldi r23, 0x00 ; 0 1dde0: 60 e0 ldi r22, 0x00 ; 0 1dde2: 85 ed ldi r24, 0xD5 ; 213 1dde4: 94 ee ldi r25, 0xE4 ; 228 1dde6: 0f 94 c0 d1 call 0x3a380 ; 0x3a380 } if (lcd_encoder) { 1ddea: 20 91 70 06 lds r18, 0x0670 ; 0x800670 1ddee: 30 91 71 06 lds r19, 0x0671 ; 0x800671 1ddf2: 21 15 cp r18, r1 1ddf4: 31 05 cpc r19, r1 1ddf6: 59 f0 breq .+22 ; 0x1de0e menuData->reset = lcd_encoder > 0; 1ddf8: 81 e0 ldi r24, 0x01 ; 1 1ddfa: 12 16 cp r1, r18 1ddfc: 13 06 cpc r1, r19 1ddfe: 0c f0 brlt .+2 ; 0x1de02 1de00: 80 e0 ldi r24, 0x00 ; 0 1de02: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 lcd_encoder = 0; // Reset 1de06: 10 92 71 06 sts 0x0671, r1 ; 0x800671 1de0a: 10 92 70 06 sts 0x0670, r1 ; 0x800670 } 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)); 1de0e: 81 ea ldi r24, 0xA1 ; 161 1de10: 9d e0 ldi r25, 0x0D ; 13 1de12: 0f 94 1c dc call 0x3b838 ; 0x3b838 1de16: 1b e0 ldi r17, 0x0B ; 11 1de18: 81 9f mul r24, r17 1de1a: b0 01 movw r22, r0 1de1c: 11 24 eor r1, r1 1de1e: 67 5b subi r22, 0xB7 ; 183 1de20: 72 4f sbci r23, 0xF2 ; 242 1de22: 47 e0 ldi r20, 0x07 ; 7 1de24: 50 e0 ldi r21, 0x00 ; 0 1de26: ce 01 movw r24, r28 1de28: 01 96 adiw r24, 0x01 ; 1 1de2a: 7c 01 movw r14, r24 1de2c: 0f 94 0c dc call 0x3b818 ; 0x3b818 lcd_home(); 1de30: 0e 94 0c 6f call 0xde18 ; 0xde18 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]; 1de34: 81 ea ldi r24, 0xA1 ; 161 1de36: 9d e0 ldi r25, 0x0D ; 13 1de38: 0f 94 1c dc call 0x3b838 ; 0x3b838 1de3c: 81 9f mul r24, r17 1de3e: c0 01 movw r24, r0 1de40: 11 24 eor r1, r1 1de42: 80 5b subi r24, 0xB0 ; 176 1de44: 92 4f sbci r25, 0xF2 ; 242 1de46: 0f 94 2a dc call 0x3b854 ; 0x3b854 1de4a: bc 01 movw r22, r24 1de4c: 99 0f add r25, r25 1de4e: 88 0b sbc r24, r24 1de50: 99 0b sbc r25, r25 1de52: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 1de56: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 1de5a: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 1de5e: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 1de62: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 1de66: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 1de6a: d6 2e mov r13, r22 1de6c: c7 2e mov r12, r23 1de6e: b8 2e mov r11, r24 1de70: a9 2e mov r10, r25 lcd_printf_P(_T(MSG_SHEET_OFFSET), 1de72: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 1de76: 0e e3 ldi r16, 0x3E ; 62 1de78: 10 e2 ldi r17, 0x20 ; 32 1de7a: 81 11 cpse r24, r1 1de7c: 02 c0 rjmp .+4 ; 0x1de82 1de7e: 00 e2 ldi r16, 0x20 ; 32 1de80: 1e e3 ldi r17, 0x3E ; 62 1de82: 8c e5 ldi r24, 0x5C ; 92 1de84: 9b e3 ldi r25, 0x3B ; 59 1de86: 0e 94 ac 72 call 0xe558 ; 0xe558 1de8a: 1f 92 push r1 1de8c: 0f 93 push r16 1de8e: 1f 92 push r1 1de90: 1f 93 push r17 1de92: af 92 push r10 1de94: bf 92 push r11 1de96: cf 92 push r12 1de98: df 92 push r13 1de9a: ff 92 push r15 1de9c: ef 92 push r14 1de9e: 9f 93 push r25 1dea0: 8f 93 push r24 1dea2: 0e 94 b9 6e call 0xdd72 ; 0xdd72 1dea6: 0f b6 in r0, 0x3f ; 63 1dea8: f8 94 cli 1deaa: de bf out 0x3e, r29 ; 62 1deac: 0f be out 0x3f, r0 ; 63 1deae: 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. } 1deb0: 27 96 adiw r28, 0x07 ; 7 1deb2: 0f b6 in r0, 0x3f ; 63 1deb4: f8 94 cli 1deb6: de bf out 0x3e, r29 ; 62 1deb8: 0f be out 0x3f, r0 ; 63 1deba: cd bf out 0x3d, r28 ; 61 1debc: df 91 pop r29 1debe: cf 91 pop r28 1dec0: 1f 91 pop r17 1dec2: 0f 91 pop r16 1dec4: ff 90 pop r15 1dec6: ef 90 pop r14 1dec8: df 90 pop r13 1deca: cf 90 pop r12 1decc: bf 90 pop r11 1dece: af 90 pop r10 1ded0: 08 95 ret 0001ded2 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1ded2: 60 91 e2 03 lds r22, 0x03E2 ; 0x8003e2 1ded6: 81 ea ldi r24, 0xA1 ; 161 1ded8: 9d e0 ldi r25, 0x0D ; 13 1deda: 0f 94 40 dc call 0x3b880 ; 0x3b880 //! @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(); 1dede: 0c 94 ac ee jmp 0x1dd58 ; 0x1dd58 0001dee2 : return false; } // Parse a major.minor.revision version number. // Return true if valid. bool parse_version(const char *str, uint16_t version[4]) { 1dee2: 0f 93 push r16 1dee4: 1f 93 push r17 1dee6: 8b 01 movw r16, r22 for(uint8_t i = 0; i < 2; ++i){ str = Number(str, version + i); 1dee8: 0e 94 99 cd call 0x19b32 ; 0x19b32 if (*str != '.') 1deec: fc 01 movw r30, r24 1deee: 20 81 ld r18, Z 1def0: 2e 32 cpi r18, 0x2E ; 46 1def2: 11 f0 breq .+4 ; 0x1def8 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 1def4: 80 e0 ldi r24, 0x00 ; 0 1def6: 34 c0 rjmp .+104 ; 0x1df60 // 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); 1def8: b8 01 movw r22, r16 1defa: 6e 5f subi r22, 0xFE ; 254 1defc: 7f 4f sbci r23, 0xFF ; 255 1defe: 01 96 adiw r24, 0x01 ; 1 1df00: 0e 94 99 cd call 0x19b32 ; 0x19b32 if (*str != '.') 1df04: fc 01 movw r30, r24 1df06: 20 81 ld r18, Z 1df08: 2e 32 cpi r18, 0x2E ; 46 1df0a: a1 f7 brne .-24 ; 0x1def4 return false; ++str; } str = Number(str, version + 2); 1df0c: b8 01 movw r22, r16 1df0e: 6c 5f subi r22, 0xFC ; 252 1df10: 7f 4f sbci r23, 0xFF ; 255 1df12: 01 96 adiw r24, 0x01 ; 1 1df14: 0e 94 99 cd call 0x19b32 ; 0x19b32 version[3] = FIRMWARE_REVISION_RELEASED; 1df18: 20 e4 ldi r18, 0x40 ; 64 1df1a: 30 e0 ldi r19, 0x00 ; 0 1df1c: f8 01 movw r30, r16 1df1e: 37 83 std Z+7, r19 ; 0x07 1df20: 26 83 std Z+6, r18 ; 0x06 1df22: fc 01 movw r30, r24 1df24: df 01 movw r26, r30 // skip everything else until eol or '-' for(;;){ if(is_whitespace_or_nl_or_eol(*str)){ 1df26: 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'; 1df28: 89 2f mov r24, r25 1df2a: 8f 7d andi r24, 0xDF ; 223 1df2c: c1 f1 breq .+112 ; 0x1df9e 1df2e: 87 ef ldi r24, 0xF7 ; 247 1df30: 89 0f add r24, r25 1df32: 82 30 cpi r24, 0x02 ; 2 1df34: a0 f1 brcs .+104 ; 0x1df9e 1df36: 9d 30 cpi r25, 0x0D ; 13 1df38: 91 f1 breq .+100 ; 0x1df9e 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 == '-'){ 1df3a: 9d 32 cpi r25, 0x2D ; 45 1df3c: 99 f7 brne .-26 ; 0x1df24 // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); if (*str++ == '-') { switch(*str){ 1df3e: 11 96 adiw r26, 0x01 ; 1 1df40: 9c 91 ld r25, X 1df42: 92 34 cpi r25, 0x42 ; 66 1df44: e1 f0 breq .+56 ; 0x1df7e 1df46: 7c f4 brge .+30 ; 0x1df66 1df48: 91 34 cpi r25, 0x41 ; 65 1df4a: a1 f6 brne .-88 ; 0x1def4 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); 1df4c: 0a 5f subi r16, 0xFA ; 250 1df4e: 1f 4f sbci r17, 0xFF ; 255 1df50: 28 e0 ldi r18, 0x08 ; 8 1df52: 30 e0 ldi r19, 0x00 ; 0 1df54: 45 e0 ldi r20, 0x05 ; 5 1df56: 6f ee ldi r22, 0xEF ; 239 1df58: 7b e8 ldi r23, 0x8B ; 139 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); 1df5a: cf 01 movw r24, r30 1df5c: 0e 94 06 cf call 0x19e0c ; 0x19e0c // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); return false; } 1df60: 1f 91 pop r17 1df62: 0f 91 pop r16 1df64: 08 95 ret // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); if (*str++ == '-') { switch(*str){ 1df66: 94 34 cpi r25, 0x44 ; 68 1df68: 91 f0 breq .+36 ; 0x1df8e 1df6a: 92 35 cpi r25, 0x52 ; 82 1df6c: 19 f6 brne .-122 ; 0x1def4 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); 1df6e: 0a 5f subi r16, 0xFA ; 250 1df70: 1f 4f sbci r17, 0xFF ; 255 1df72: 20 e2 ldi r18, 0x20 ; 32 1df74: 30 e0 ldi r19, 0x00 ; 0 1df76: 42 e0 ldi r20, 0x02 ; 2 1df78: 63 ee ldi r22, 0xE3 ; 227 1df7a: 7b e8 ldi r23, 0x8B ; 139 1df7c: ee cf rjmp .-36 ; 0x1df5a 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); 1df7e: 0a 5f subi r16, 0xFA ; 250 1df80: 1f 4f sbci r17, 0xFF ; 255 1df82: 20 e1 ldi r18, 0x10 ; 16 1df84: 30 e0 ldi r19, 0x00 ; 0 1df86: 44 e0 ldi r20, 0x04 ; 4 1df88: 6a ee ldi r22, 0xEA ; 234 1df8a: 7b e8 ldi r23, 0x8B ; 139 1df8c: e6 cf rjmp .-52 ; 0x1df5a 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); 1df8e: 0a 5f subi r16, 0xFA ; 250 1df90: 1f 4f sbci r17, 0xFF ; 255 1df92: 30 e0 ldi r19, 0x00 ; 0 1df94: 20 e0 ldi r18, 0x00 ; 0 1df96: 43 e0 ldi r20, 0x03 ; 3 1df98: 66 ee ldi r22, 0xE6 ; 230 1df9a: 7b e8 ldi r23, 0x8B ; 139 1df9c: de cf rjmp .-68 ; 0x1df5a // 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; 1df9e: 81 e0 ldi r24, 0x01 ; 1 1dfa0: df cf rjmp .-66 ; 0x1df60 0001dfa2 : /// (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 ) 1dfa2: 84 e0 ldi r24, 0x04 ; 4 1dfa4: 9d e0 ldi r25, 0x0D ; 13 1dfa6: 0f 94 1c dc call 0x3b838 ; 0x3b838 && ( eeprom_read_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY) == 1 ); 1dfaa: 8a 32 cpi r24, 0x2A ; 42 1dfac: 39 f4 brne .+14 ; 0x1dfbc 1dfae: 8a e2 ldi r24, 0x2A ; 42 1dfb0: 9d e0 ldi r25, 0x0D ; 13 1dfb2: 0f 94 1c dc call 0x3b838 ; 0x3b838 1dfb6: 91 e0 ldi r25, 0x01 ; 1 1dfb8: 81 30 cpi r24, 0x01 ; 1 1dfba: 09 f0 breq .+2 ; 0x1dfbe 1dfbc: 90 e0 ldi r25, 0x00 ; 0 } 1dfbe: 89 2f mov r24, r25 1dfc0: 08 95 ret 0001dfc2 : } #endif //PRUSA_SN_SUPPORT void lcd_experimental_menu() { MENU_BEGIN(); 1dfc2: 0f 94 96 d1 call 0x3a32c ; 0x3a32c 1dfc6: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1dfca: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1dfce: 84 30 cpi r24, 0x04 ; 4 1dfd0: 70 f5 brcc .+92 ; 0x1e02e 1dfd2: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_BACK)); 1dfd6: 8c eb ldi r24, 0xBC ; 188 1dfd8: 99 e4 ldi r25, 0x49 ; 73 1dfda: 0e 94 ac 72 call 0xe558 ; 0xe558 1dfde: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 #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 1dfe2: 0e 94 d1 ef call 0x1dfa2 ; 0x1dfa2 1dfe6: 88 23 and r24, r24 1dfe8: f9 f0 breq .+62 ; 0x1e028 1dfea: 89 ed ldi r24, 0xD9 ; 217 1dfec: 9c e5 ldi r25, 0x5C ; 92 1dfee: 0e 94 ac 72 call 0xe558 ; 0xe558 1dff2: 22 e0 ldi r18, 0x02 ; 2 1dff4: 48 e1 ldi r20, 0x18 ; 24 1dff6: 50 ef ldi r21, 0xF0 ; 240 1dff8: bc 01 movw r22, r24 1dffa: 8c eb ldi r24, 0xBC ; 188 1dffc: 9b e6 ldi r25, 0x6B ; 107 1dffe: 0f 94 25 d3 call 0x3a64a ; 0x3a64a #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 1e002: 6c e3 ldi r22, 0x3C ; 60 1e004: 7f ec ldi r23, 0xCF ; 207 1e006: 89 ea ldi r24, 0xA9 ; 169 1e008: 9b e6 ldi r25, 0x6B ; 107 1e00a: 0f 94 13 d1 call 0x3a226 ; 0x3a226 #endif //PRUSA_SN_SUPPORT MENU_END(); 1e00e: 0f 94 6a d1 call 0x3a2d4 ; 0x3a2d4 } #endif //PRUSA_SN_SUPPORT void lcd_experimental_menu() { MENU_BEGIN(); 1e012: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1e016: 8f 5f subi r24, 0xFF ; 255 1e018: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1e01c: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1e020: 8f 5f subi r24, 0xFF ; 255 1e022: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1e026: d1 cf rjmp .-94 ; 0x1dfca #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 1e028: 83 ed ldi r24, 0xD3 ; 211 1e02a: 9c e5 ldi r25, 0x5C ; 92 1e02c: e0 cf rjmp .-64 ; 0x1dfee #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(); } 1e02e: 08 95 ret 0001e030 : prusa_statistics_update_from_lcd_update(); if (lcd_commands_type == LcdCommands::Layer1Cal) lcd_commands(); } #ifdef TMC2130 void UserECool_toggle(){ 1e030: 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(); 1e032: 0e 94 d1 ef call 0x1dfa2 ; 0x1dfa2 1e036: c1 e0 ldi r28, 0x01 ; 1 1e038: c8 27 eor r28, r24 eeprom_update_byte_notify((uint8_t *)EEPROM_ECOOL_ENABLE, enable ? EEPROM_ECOOL_MAGIC_NUMBER : EEPROM_EMPTY_VALUE); 1e03a: 6f ef ldi r22, 0xFF ; 255 1e03c: 09 f0 breq .+2 ; 0x1e040 1e03e: 6a e2 ldi r22, 0x2A ; 42 1e040: 84 e0 ldi r24, 0x04 ; 4 1e042: 9d e0 ldi r25, 0x0D ; 13 1e044: 0f 94 40 dc call 0x3b880 ; 0x3b880 1 #else 0 #endif ) , enableECool(enableECool) { } 1e048: 8c 2f mov r24, r28 1e04a: 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)); 1e04c: 82 70 andi r24, 0x02 ; 2 } 1e04e: 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)); 1e050: 0d 94 60 26 jmp 0x24cc0 ; 0x24cc0 0001e054 : eeprom_toggle((uint8_t*)EEPROM_MMU_STEALTH); } #endif //MMU_FORCE_STEALTH_MODE static void lcd_silent_mode_set() { switch (SilentModeMenu) { 1e054: 80 91 a4 03 lds r24, 0x03A4 ; 0x8003a4 1e058: 81 11 cpse r24, r1 1e05a: 3c c0 rjmp .+120 ; 0x1e0d4 #ifdef TMC2130 case SILENT_MODE_NORMAL: SilentModeMenu = SILENT_MODE_STEALTH; break; 1e05c: 81 e0 ldi r24, 0x01 ; 1 1e05e: 80 93 a4 03 sts 0x03A4, r24 ; 0x8003a4 1e062: 60 91 a4 03 lds r22, 0x03A4 ; 0x8003a4 1e066: 8f ef ldi r24, 0xFF ; 255 1e068: 9f e0 ldi r25, 0x0F ; 15 1e06a: 0f 94 40 dc call 0x3b880 ; 0x3b880 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); 1e06e: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 1e072: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 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()) 1e076: 98 17 cp r25, r24 1e078: 41 f0 breq .+16 ; 0x1e08a { lcd_display_message_fullscreen_P(_T(MSG_MODE_CHANGE_IN_PROGRESS)); 1e07a: 84 e1 ldi r24, 0x14 ; 20 1e07c: 9b e3 ldi r25, 0x3B ; 59 1e07e: 0e 94 ac 72 call 0xe558 ; 0xe558 1e082: 0f 94 e4 1f call 0x23fc8 ; 0x23fc8 // Wait until the planner queue is drained and the stepper routine achieves // an idle state. st_synchronize(); 1e086: 0f 94 e8 42 call 0x285d0 ; 0x285d0 } tmc2130_wait_standstill_xy(1000); 1e08a: 0f 94 18 88 call 0x31030 ; 0x31030 cli(); 1e08e: f8 94 cli tmc2130_mode = (SilentModeMenu != SILENT_MODE_NORMAL)?TMC2130_MODE_SILENT:TMC2130_MODE_NORMAL; 1e090: 81 e0 ldi r24, 0x01 ; 1 1e092: 90 91 a4 03 lds r25, 0x03A4 ; 0x8003a4 1e096: 91 11 cpse r25, r1 1e098: 01 c0 rjmp .+2 ; 0x1e09c 1e09a: 80 e0 ldi r24, 0x00 ; 0 1e09c: 80 93 8c 06 sts 0x068C, r24 ; 0x80068c update_mode_profile(); 1e0a0: 0f 94 a1 63 call 0x2c742 ; 0x2c742 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(); 1e0a4: 0e 94 d1 ef call 0x1dfa2 ; 0x1dfa2 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) { } 1e0a8: 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())); 1e0aa: 82 70 andi r24, 0x02 ; 2 1e0ac: 0f 94 60 26 call 0x24cc0 ; 0x24cc0 // 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(); 1e0b0: 0f 94 42 43 call 0x28684 ; 0x28684 sei(); 1e0b4: 78 94 sei #else st_current_init(); #endif //TMC2130 #ifdef TMC2130 if (eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET) && (SilentModeMenu != SILENT_MODE_NORMAL)) 1e0b6: 89 e6 ldi r24, 0x69 ; 105 1e0b8: 9f e0 ldi r25, 0x0F ; 15 1e0ba: 0f 94 1c dc call 0x3b838 ; 0x3b838 1e0be: 88 23 and r24, r24 1e0c0: 61 f0 breq .+24 ; 0x1e0da 1e0c2: 80 91 a4 03 lds r24, 0x03A4 ; 0x8003a4 1e0c6: 88 23 and r24, r24 1e0c8: 41 f0 breq .+16 ; 0x1e0da menu_submenu(lcd_crash_mode_info2); 1e0ca: 60 e0 ldi r22, 0x00 ; 0 1e0cc: 8e e3 ldi r24, 0x3E ; 62 1e0ce: 9f ed ldi r25, 0xDF ; 223 1e0d0: 0d 94 03 d3 jmp 0x3a606 ; 0x3a606 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; 1e0d4: 10 92 a4 03 sts 0x03A4, r1 ; 0x8003a4 1e0d8: c4 cf rjmp .-120 ; 0x1e062 #ifdef TMC2130 if (eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET) && (SilentModeMenu != SILENT_MODE_NORMAL)) menu_submenu(lcd_crash_mode_info2); #endif //TMC2130 } 1e0da: 08 95 ret 0001e0dc : lcd_update(2); } #ifdef TMC2130 void lcd_settings_linearity_correction_menu(void) { 1e0dc: df 92 push r13 1e0de: ef 92 push r14 1e0e0: ff 92 push r15 1e0e2: 0f 93 push r16 1e0e4: 1f 93 push r17 1e0e6: cf 93 push r28 1e0e8: df 93 push r29 MENU_BEGIN(); 1e0ea: 0f 94 96 d1 call 0x3a32c ; 0x3a32c 1e0ee: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1e0f2: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1e0f6: 84 30 cpi r24, 0x04 ; 4 1e0f8: 08 f0 brcs .+2 ; 0x1e0fc 1e0fa: 66 c0 rjmp .+204 ; 0x1e1c8 1e0fc: 10 92 15 05 sts 0x0515, r1 ; 0x800515 ON_MENU_LEAVE( 1e100: 0f 94 16 d0 call 0x3a02c ; 0x3a02c 1e104: 88 23 and r24, r24 1e106: e9 f0 breq .+58 ; 0x1e142 1e108: 09 ef ldi r16, 0xF9 ; 249 1e10a: 14 e0 ldi r17, 0x04 ; 4 1e10c: c7 ef ldi r28, 0xF7 ; 247 1e10e: 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) { 1e110: f8 01 movw r30, r16 1e112: 80 81 ld r24, Z 1e114: 8e 31 cpi r24, 0x1E ; 30 1e116: 08 f4 brcc .+2 ; 0x1e11a tmc2130_wave_fac[axis] = 0; 1e118: 10 82 st Z, r1 1e11a: f8 01 movw r30, r16 1e11c: 61 91 ld r22, Z+ 1e11e: 8f 01 movw r16, r30 1e120: ce 01 movw r24, r28 1e122: 0f 94 40 dc call 0x3b880 ; 0x3b880 1e126: 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++) { 1e128: c3 3f cpi r28, 0xF3 ; 243 1e12a: fe e0 ldi r31, 0x0E ; 14 1e12c: df 07 cpc r29, r31 1e12e: 81 f7 brne .-32 ; 0x1e110 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(); 1e130: 0e 94 d1 ef call 0x1dfa2 ; 0x1dfa2 1e134: e8 94 clt 1e136: d0 f8 bld r13, 0 1e138: 80 fb bst r24, 0 1e13a: 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())); 1e13c: 8d 2d mov r24, r13 1e13e: 0f 94 60 26 call 0x24cc0 ; 0x24cc0 { MENU_BEGIN(); ON_MENU_LEAVE( lcd_settings_linearity_correction_menu_save(); ); MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); 1e142: 86 e4 ldi r24, 0x46 ; 70 1e144: 98 e4 ldi r25, 0x48 ; 72 1e146: 0e 94 ac 72 call 0xe558 ; 0xe558 1e14a: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 #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); 1e14e: 8c e6 ldi r24, 0x6C ; 108 1e150: 93 e4 ldi r25, 0x43 ; 67 1e152: 0e 94 ac 72 call 0xe558 ; 0xe558 1e156: f1 2c mov r15, r1 1e158: e1 2c mov r14, r1 1e15a: 08 ec ldi r16, 0xC8 ; 200 1e15c: 10 e0 ldi r17, 0x00 ; 0 1e15e: 2d e1 ldi r18, 0x1D ; 29 1e160: 30 e0 ldi r19, 0x00 ; 0 1e162: 48 e0 ldi r20, 0x08 ; 8 1e164: 69 ef ldi r22, 0xF9 ; 249 1e166: 74 e0 ldi r23, 0x04 ; 4 1e168: 0f 94 e6 d1 call 0x3a3cc ; 0x3a3cc 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); 1e16c: 80 e6 ldi r24, 0x60 ; 96 1e16e: 93 e4 ldi r25, 0x43 ; 67 1e170: 0e 94 ac 72 call 0xe558 ; 0xe558 1e174: 2d e1 ldi r18, 0x1D ; 29 1e176: 30 e0 ldi r19, 0x00 ; 0 1e178: 48 e0 ldi r20, 0x08 ; 8 1e17a: 6a ef ldi r22, 0xFA ; 250 1e17c: 74 e0 ldi r23, 0x04 ; 4 1e17e: 0f 94 e6 d1 call 0x3a3cc ; 0x3a3cc 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); 1e182: 84 e5 ldi r24, 0x54 ; 84 1e184: 93 e4 ldi r25, 0x43 ; 67 1e186: 0e 94 ac 72 call 0xe558 ; 0xe558 1e18a: 2d e1 ldi r18, 0x1D ; 29 1e18c: 30 e0 ldi r19, 0x00 ; 0 1e18e: 48 e0 ldi r20, 0x08 ; 8 1e190: 6b ef ldi r22, 0xFB ; 251 1e192: 74 e0 ldi r23, 0x04 ; 4 1e194: 0f 94 e6 d1 call 0x3a3cc ; 0x3a3cc #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); 1e198: 88 e4 ldi r24, 0x48 ; 72 1e19a: 93 e4 ldi r25, 0x43 ; 67 1e19c: 0e 94 ac 72 call 0xe558 ; 0xe558 1e1a0: 2d e1 ldi r18, 0x1D ; 29 1e1a2: 30 e0 ldi r19, 0x00 ; 0 1e1a4: 48 e0 ldi r20, 0x08 ; 8 1e1a6: 6c ef ldi r22, 0xFC ; 252 1e1a8: 74 e0 ldi r23, 0x04 ; 4 1e1aa: 0f 94 e6 d1 call 0x3a3cc ; 0x3a3cc MENU_END(); 1e1ae: 0f 94 6a d1 call 0x3a2d4 ; 0x3a2d4 } #ifdef TMC2130 void lcd_settings_linearity_correction_menu(void) { MENU_BEGIN(); 1e1b2: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1e1b6: 8f 5f subi r24, 0xFF ; 255 1e1b8: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1e1bc: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1e1c0: 8f 5f subi r24, 0xFF ; 255 1e1c2: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1e1c6: 95 cf rjmp .-214 ; 0x1e0f2 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(); } 1e1c8: df 91 pop r29 1e1ca: cf 91 pop r28 1e1cc: 1f 91 pop r17 1e1ce: 0f 91 pop r16 1e1d0: ff 90 pop r15 1e1d2: ef 90 pop r14 1e1d4: df 90 pop r13 1e1d6: 08 95 ret 0001e1d8 : } static void lcd_updatestatus(const char *message, bool progmem = false) { if (progmem) strncpy_P(lcd_status_message, message, LCD_WIDTH); 1e1d8: 44 e1 ldi r20, 0x14 ; 20 1e1da: 50 e0 ldi r21, 0x00 ; 0 return false; } static void lcd_updatestatus(const char *message, bool progmem = false) { if (progmem) 1e1dc: 66 23 and r22, r22 1e1de: 89 f0 breq .+34 ; 0x1e202 strncpy_P(lcd_status_message, message, LCD_WIDTH); 1e1e0: bc 01 movw r22, r24 1e1e2: 8f e1 ldi r24, 0x1F ; 31 1e1e4: 95 e0 ldi r25, 0x05 ; 5 1e1e6: 0f 94 09 da call 0x3b412 ; 0x3b412 else strncpy(lcd_status_message, message, LCD_WIDTH); lcd_status_message[LCD_WIDTH] = 0; 1e1ea: 10 92 33 05 sts 0x0533, r1 ; 0x800533 <_ZL18lcd_status_message.lto_priv.453+0x14> lcd_status_message_idx = 0; // Print message from beginning 1e1ee: 10 92 1e 05 sts 0x051E, r1 ; 0x80051e <_ZL22lcd_status_message_idx.lto_priv.448> SERIAL_PROTOCOLLNRPGM(MSG_LCD_STATUS_CHANGED); 1e1f2: 85 e8 ldi r24, 0x85 ; 133 1e1f4: 9b e6 ldi r25, 0x6B ; 107 1e1f6: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 // hack lcd_draw_update to 1, i.e. without clear lcd_draw_update = 1; 1e1fa: 81 e0 ldi r24, 0x01 ; 1 1e1fc: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } 1e200: 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); 1e202: bc 01 movw r22, r24 1e204: 8f e1 ldi r24, 0x1F ; 31 1e206: 95 e0 ldi r25, 0x05 ; 5 1e208: 0f 94 9c e2 call 0x3c538 ; 0x3c538 1e20c: ee cf rjmp .-36 ; 0x1e1ea 0001e20e : } static bool lcd_message_check(uint8_t priority) { // regular priority check if (priority >= lcd_status_message_level) 1e20e: 90 91 d5 03 lds r25, 0x03D5 ; 0x8003d5 <_ZL24lcd_status_message_level.lto_priv.451> 1e212: 89 17 cp r24, r25 1e214: 80 f4 brcc .+32 ; 0x1e236 return true; // check if we can override an info message yet if (lcd_status_message_level == LCD_STATUS_INFO) { 1e216: 91 30 cpi r25, 0x01 ; 1 1e218: 61 f4 brne .+24 ; 0x1e232 } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 1e21a: 80 91 34 05 lds r24, 0x0534 ; 0x800534 <_ZL26lcd_status_message_timeout.lto_priv.452> 1e21e: 88 23 and r24, r24 1e220: 51 f0 breq .+20 ; 0x1e236 1e222: 40 e2 ldi r20, 0x20 ; 32 1e224: 5e e4 ldi r21, 0x4E ; 78 1e226: 60 e0 ldi r22, 0x00 ; 0 1e228: 70 e0 ldi r23, 0x00 ; 0 1e22a: 84 e3 ldi r24, 0x34 ; 52 1e22c: 95 e0 ldi r25, 0x05 ; 5 1e22e: 0d 94 30 2a jmp 0x25460 ; 0x25460 ::expired(unsigned long)> return lcd_status_message_timeout.expired_cont(LCD_STATUS_INFO_TIMEOUT); } return false; 1e232: 80 e0 ldi r24, 0x00 ; 0 1e234: 08 95 ret static bool lcd_message_check(uint8_t priority) { // regular priority check if (priority >= lcd_status_message_level) return true; 1e236: 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; } 1e238: 08 95 ret 0001e23a : { lcd_setalertstatus_(message, severity, false); } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { 1e23a: ef 92 push r14 1e23c: ff 92 push r15 1e23e: 1f 93 push r17 1e240: cf 93 push r28 1e242: df 93 push r29 1e244: ec 01 movw r28, r24 1e246: 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)) { 1e248: 86 2f mov r24, r22 1e24a: 0e 94 07 f1 call 0x1e20e ; 0x1e20e 1e24e: 88 23 and r24, r24 1e250: e9 f0 breq .+58 ; 0x1e28c bool same = !(progmem? strcmp_P(lcd_status_message, message): 1e252: be 01 movw r22, r28 1e254: 8f e1 ldi r24, 0x1F ; 31 1e256: 95 e0 ldi r25, 0x05 ; 5 1e258: 0f 94 ca d9 call 0x3b394 ; 0x3b394 1e25c: 7c 01 movw r14, r24 strcmp(lcd_status_message, message)); lcd_status_message_timeout.start(); 1e25e: 84 e3 ldi r24, 0x34 ; 52 1e260: 95 e0 ldi r25, 0x05 ; 5 1e262: 0f 94 ef 2b call 0x257de ; 0x257de ::start()> lcd_status_message_level = severity; 1e266: 10 93 d5 03 sts 0x03D5, r17 ; 0x8003d5 <_ZL24lcd_status_message_level.lto_priv.451> custom_message_type = CustomMsg::Status; 1e26a: 10 92 c4 06 sts 0x06C4, r1 ; 0x8006c4 custom_message_state = 0; 1e26e: 10 92 f7 03 sts 0x03F7, r1 ; 0x8003f7 if (!same) { 1e272: ef 28 or r14, r15 1e274: 59 f0 breq .+22 ; 0x1e28c // do not kick the user out of the menus if the message is unchanged lcd_updatestatus(message, progmem); 1e276: 61 e0 ldi r22, 0x01 ; 1 1e278: ce 01 movw r24, r28 1e27a: 0e 94 ec f0 call 0x1e1d8 ; 0x1e1d8 } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { lcd_setalertstatus_(message, severity, true); } 1e27e: df 91 pop r29 1e280: cf 91 pop r28 1e282: 1f 91 pop r17 1e284: ff 90 pop r15 1e286: 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(); 1e288: 0d 94 a6 1e jmp 0x23d4c ; 0x23d4c } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { lcd_setalertstatus_(message, severity, true); } 1e28c: df 91 pop r29 1e28e: cf 91 pop r28 1e290: 1f 91 pop r17 1e292: ff 90 pop r15 1e294: ef 90 pop r14 1e296: 08 95 ret 0001e298 : if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message, true); } void lcd_setstatus_serial(const char* message) { 1e298: cf 93 push r28 1e29a: df 93 push r29 1e29c: ec 01 movw r28, r24 if (lcd_message_check(LCD_STATUS_NONE)) 1e29e: 80 e0 ldi r24, 0x00 ; 0 1e2a0: 0e 94 07 f1 call 0x1e20e ; 0x1e20e 1e2a4: 88 23 and r24, r24 1e2a6: 21 f0 breq .+8 ; 0x1e2b0 lcd_updatestatus(message); 1e2a8: 60 e0 ldi r22, 0x00 ; 0 1e2aa: ce 01 movw r24, r28 1e2ac: 0e 94 ec f0 call 0x1e1d8 ; 0x1e1d8 SERIAL_ECHOLN(message); 1e2b0: ce 01 movw r24, r28 } 1e2b2: df 91 pop r29 1e2b4: cf 91 pop r28 void lcd_setstatus_serial(const char* message) { if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message); SERIAL_ECHOLN(message); 1e2b6: 0d 94 00 d6 jmp 0x3ac00 ; 0x3ac00 0001e2ba : void lcd_getstatus(char buf[LCD_WIDTH]) { strncpy(buf, lcd_status_message, LCD_WIDTH); } void lcd_setstatuspgm(const char* message) { 1e2ba: cf 93 push r28 1e2bc: df 93 push r29 1e2be: ec 01 movw r28, r24 if (lcd_message_check(LCD_STATUS_NONE)) 1e2c0: 80 e0 ldi r24, 0x00 ; 0 1e2c2: 0e 94 07 f1 call 0x1e20e ; 0x1e20e 1e2c6: 88 23 and r24, r24 1e2c8: 31 f0 breq .+12 ; 0x1e2d6 lcd_updatestatus(message, true); 1e2ca: 61 e0 ldi r22, 0x01 ; 1 1e2cc: ce 01 movw r24, r28 } 1e2ce: df 91 pop r29 1e2d0: cf 91 pop r28 } void lcd_setstatuspgm(const char* message) { if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message, true); 1e2d2: 0c 94 ec f0 jmp 0x1e1d8 ; 0x1e1d8 } 1e2d6: df 91 pop r29 1e2d8: cf 91 pop r28 1e2da: 08 95 ret 0001e2dc : MENU_ITEM_FUNCTION_P(_T(MSG_YES), lcd_print_stop); MENU_END(); } void lcd_sdcard_menu() { 1e2dc: 2f 92 push r2 1e2de: 3f 92 push r3 1e2e0: 4f 92 push r4 1e2e2: 5f 92 push r5 1e2e4: 6f 92 push r6 1e2e6: 7f 92 push r7 1e2e8: 8f 92 push r8 1e2ea: 9f 92 push r9 1e2ec: af 92 push r10 1e2ee: bf 92 push r11 1e2f0: cf 92 push r12 1e2f2: df 92 push r13 1e2f4: ef 92 push r14 1e2f6: ff 92 push r15 1e2f8: 0f 93 push r16 1e2fa: 1f 93 push r17 1e2fc: cf 93 push r28 1e2fe: df 93 push r29 1e300: cd b7 in r28, 0x3d ; 61 1e302: de b7 in r29, 0x3e ; 62 1e304: 2d 97 sbiw r28, 0x0d ; 13 1e306: 0f b6 in r0, 0x3f ; 63 1e308: f8 94 cli 1e30a: de bf out 0x3e, r29 ; 62 1e30c: 0f be out 0x3f, r0 ; 63 1e30e: 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) 1e310: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 1e314: 81 30 cpi r24, 0x01 ; 1 1e316: 31 f1 breq .+76 ; 0x1e364 1e318: 30 f0 brcs .+12 ; 0x1e326 1e31a: 82 30 cpi r24, 0x02 ; 2 1e31c: 09 f4 brne .+2 ; 0x1e320 1e31e: 7d c2 rjmp .+1274 ; 0x1e81a { _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. 1e320: 10 92 a9 03 sts 0x03A9, r1 ; 0x8003a9 1e324: fe c0 rjmp .+508 ; 0x1e522 switch(_md->menuState) { case _uninitialized: //Initialize menu data { if (card.presort_flag == true) //used to force resorting if sorting type is changed. 1e326: 80 91 df 14 lds r24, 0x14DF ; 0x8014df 1e32a: 88 23 and r24, r24 1e32c: 49 f0 breq .+18 ; 0x1e340 { card.presort_flag = false; 1e32e: 10 92 df 14 sts 0x14DF, r1 ; 0x8014df lcd_update_enabled = false; 1e332: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e card.presort(); 1e336: 0f 94 92 7c call 0x2f924 ; 0x2f924 lcd_update_enabled = true; 1e33a: 81 e0 ldi r24, 0x01 ; 1 1e33c: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e } _md->fileCnt = card.getnrfilenames(); 1e340: 0f 94 d4 79 call 0x2f3a8 ; 0x2f3a8 1e344: 90 93 b1 03 sts 0x03B1, r25 ; 0x8003b1 1e348: 80 93 b0 03 sts 0x03B0, r24 ; 0x8003b0 _md->sdSort = farm_mode ? SD_SORT_NONE : eeprom_read_byte((uint8_t*)EEPROM_SD_SORT); 1e34c: 89 e0 ldi r24, 0x09 ; 9 1e34e: 9f e0 ldi r25, 0x0F ; 15 1e350: 0f 94 1c dc call 0x3b838 ; 0x3b838 1e354: 80 93 b3 03 sts 0x03B3, r24 ; 0x8003b3 _md->menuState = _standard; 1e358: 81 e0 ldi r24, 0x01 ; 1 1e35a: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 _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. 1e35e: 8f ef ldi r24, 0xFF ; 255 1e360: 80 93 b2 03 sts 0x03B2, r24 ; 0x8003b2 } // 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. 1e364: 80 91 b4 03 lds r24, 0x03B4 ; 0x8003b4 1e368: 81 11 cpse r24, r1 1e36a: 07 c0 rjmp .+14 ; 0x1e37a { _md->lcd_scrollTimer.start(); 1e36c: 84 eb ldi r24, 0xB4 ; 180 1e36e: 93 e0 ldi r25, 0x03 ; 3 1e370: 0f 94 ad 29 call 0x2535a ; 0x2535a ::start()> lcd_draw_update = 1; 1e374: 81 e0 ldi r24, 0x01 ; 1 1e376: 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. 1e37a: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 1e37e: 81 11 cpse r24, r1 1e380: 21 c0 rjmp .+66 ; 0x1e3c4 1e382: 64 ef ldi r22, 0xF4 ; 244 1e384: 71 e0 ldi r23, 0x01 ; 1 1e386: 84 eb ldi r24, 0xB4 ; 180 1e388: 93 e0 ldi r25, 0x03 ; 3 1e38a: 0f 94 7e 29 call 0x252fc ; 0x252fc ::expired(unsigned short)> 1e38e: 88 23 and r24, r24 1e390: a1 f0 breq .+40 ; 0x1e3ba 1e392: 80 91 b2 03 lds r24, 0x03B2 ; 0x8003b2 1e396: 8f 3f cpi r24, 0xFF ; 255 1e398: 81 f0 breq .+32 ; 0x1e3ba { _md->menuState = _scrolling; 1e39a: 82 e0 ldi r24, 0x02 ; 2 1e39c: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 _md->offset = 0; 1e3a0: 10 92 aa 03 sts 0x03AA, r1 ; 0x8003aa _md->scrollPointer = NULL; 1e3a4: 10 92 ad 03 sts 0x03AD, r1 ; 0x8003ad 1e3a8: 10 92 ac 03 sts 0x03AC, r1 ; 0x8003ac _md->lcd_scrollTimer.start(); 1e3ac: 84 eb ldi r24, 0xB4 ; 180 1e3ae: 93 e0 ldi r25, 0x03 ; 3 1e3b0: 0f 94 ad 29 call 0x2535a ; 0x2535a ::start()> lcd_draw_update = 1; //forces last load before switching to scrolling. 1e3b4: 81 e0 ldi r24, 0x01 ; 1 1e3b6: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } if (lcd_draw_update == 0 && !lcd_clicked()) 1e3ba: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 1e3be: 88 23 and r24, r24 1e3c0: 09 f4 brne .+2 ; 0x1e3c4 1e3c2: ab c0 rjmp .+342 ; 0x1e51a 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. 1e3c4: 8f ef ldi r24, 0xFF ; 255 1e3c6: 80 93 b2 03 sts 0x03B2, r24 ; 0x8003b2 //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(); 1e3ca: 84 eb ldi r24, 0xB4 ; 180 1e3cc: 93 e0 ldi r25, 0x03 ; 3 1e3ce: 0f 94 ad 29 call 0x2535a ; 0x2535a ::start()> MENU_BEGIN(); 1e3d2: 0f 94 96 d1 call 0x3a32c ; 0x3a32c 1e3d6: 10 92 12 05 sts 0x0512, r1 ; 0x800512 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); 1e3da: ce 01 movw r24, r28 1e3dc: 01 96 adiw r24, 0x01 ; 1 1e3de: 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); 1e3e0: f4 ef ldi r31, 0xF4 ; 244 1e3e2: 2f 2e mov r2, r31 1e3e4: f0 e7 ldi r31, 0x70 ; 112 1e3e6: 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(); 1e3e8: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1e3ec: 84 30 cpi r24, 0x04 ; 4 1e3ee: 08 f0 brcs .+2 ; 0x1e3f2 1e3f0: 98 c0 rjmp .+304 ; 0x1e522 1e3f2: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(bMain?MSG_MAIN:MSG_BACK)); // i.e. default menu-item / menu-item after card insertion 1e3f6: 80 91 e1 03 lds r24, 0x03E1 ; 0x8003e1 1e3fa: 88 23 and r24, r24 1e3fc: 09 f4 brne .+2 ; 0x1e400 1e3fe: aa c0 rjmp .+340 ; 0x1e554 1e400: 88 ea ldi r24, 0xA8 ; 168 1e402: 98 e4 ldi r25, 0x48 ; 72 1e404: 0e 94 ac 72 call 0xe558 ; 0xe558 1e408: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 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;}; 1e40c: 62 e9 ldi r22, 0x92 ; 146 1e40e: 74 e1 ldi r23, 0x14 ; 20 1e410: 8b e3 ldi r24, 0x3B ; 59 1e412: 95 e1 ldi r25, 0x15 ; 21 1e414: 0f 94 79 58 call 0x2b0f2 ; 0x2b0f2 card.getWorkDirName(); if (card.filename[0] == '/') 1e418: 80 91 92 14 lds r24, 0x1492 ; 0x801492 1e41c: 8f 32 cpi r24, 0x2F ; 47 1e41e: 09 f0 breq .+2 ; 0x1e422 1e420: 9c c0 rjmp .+312 ; 0x1e55a { #if SDCARDDETECT == -1 MENU_ITEM_FUNCTION_P(_T(MSG_REFRESH), lcd_sd_refresh); #else if (card.ToshibaFlashAir_isEnabled()) 1e422: 80 91 01 17 lds r24, 0x1701 ; 0x801701 1e426: 88 23 and r24, r24 1e428: 41 f0 breq .+16 ; 0x1e43a MENU_ITEM_FUNCTION_P(_T(MSG_REFRESH), lcd_sd_refresh); //show the refresh option if in flashAir mode. 1e42a: 8d e9 ldi r24, 0x9D ; 157 1e42c: 98 e4 ldi r25, 0x48 ; 72 1e42e: 0e 94 ac 72 call 0xe558 ; 0xe558 1e432: 6c ec ldi r22, 0xCC ; 204 1e434: 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. 1e436: 0f 94 13 d1 call 0x3a226 ; 0x3a226 for (uint16_t i = _md->fileCnt; i-- > 0;) // Every file, from top to bottom. 1e43a: c0 90 b0 03 lds r12, 0x03B0 ; 0x8003b0 1e43e: d0 90 b1 03 lds r13, 0x03B1 ; 0x8003b1 } if (menu_clicked && (lcd_encoder == menu_item)) { lcd_update_enabled = false; menu_action_sdfile(str_fn); lcd_update_enabled = true; 1e442: 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. 1e444: 91 e0 ldi r25, 0x01 ; 1 1e446: c9 1a sub r12, r25 1e448: d1 08 sbc r13, r1 1e44a: 08 f4 brcc .+2 ; 0x1e44e 1e44c: d9 c1 rjmp .+946 ; 0x1e800 { if (menu_item == menu_line) //If the file is on the screen. 1e44e: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1e452: 90 91 14 05 lds r25, 0x0514 ; 0x800514 1e456: 89 13 cpse r24, r25 1e458: cf c1 rjmp .+926 ; 0x1e7f8 { //load filename to memory. #ifdef SDCARD_SORT_ALPHA card.getfilename_sorted(i, _md->sdSort); 1e45a: 60 91 b3 03 lds r22, 0x03B3 ; 0x8003b3 1e45e: c6 01 movw r24, r12 1e460: 0f 94 00 85 call 0x30a00 ; 0x30a00 #else card.getfilename(i); #endif if (lcd_encoder == menu_item) //If the file is selected. 1e464: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1e468: 90 e0 ldi r25, 0x00 ; 0 1e46a: 20 91 70 06 lds r18, 0x0670 ; 0x800670 1e46e: 30 91 71 06 lds r19, 0x0671 ; 0x800671 1e472: 10 91 dc 14 lds r17, 0x14DC ; 0x8014dc 1e476: 82 17 cp r24, r18 1e478: 93 07 cpc r25, r19 1e47a: 51 f4 brne .+20 ; 0x1e490 { _md->selectedFileID = i; 1e47c: d0 92 af 03 sts 0x03AF, r13 ; 0x8003af 1e480: c0 92 ae 03 sts 0x03AE, r12 ; 0x8003ae _md->isDir = card.filenameIsDir; 1e484: 10 93 ab 03 sts 0x03AB, r17 ; 0x8003ab _md->row = menu_row; 1e488: 40 91 12 05 lds r20, 0x0512 ; 0x800512 1e48c: 40 93 b2 03 sts 0x03B2, r20 ; 0x8003b2 1e490: 40 91 6d 02 lds r20, 0x026D ; 0x80026d } if (card.filenameIsDir) 1e494: 11 23 and r17, r17 1e496: 09 f4 brne .+2 ; 0x1e49a 1e498: 65 c0 rjmp .+202 ; 0x1e564 #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) 1e49a: 44 23 and r20, r20 1e49c: e9 f0 breq .+58 ; 0x1e4d8 { lcd_implementation_drawmenu_sddirectory(menu_row, (str_fnl[0] == '\0') ? str_fn : str_fnl); 1e49e: 40 91 a7 14 lds r20, 0x14A7 ; 0x8014a7 1e4a2: e2 e9 ldi r30, 0x92 ; 146 1e4a4: ae 2e mov r10, r30 1e4a6: e4 e1 ldi r30, 0x14 ; 20 1e4a8: be 2e mov r11, r30 1e4aa: 44 23 and r20, r20 1e4ac: 21 f0 breq .+8 ; 0x1e4b6 1e4ae: 77 ea ldi r23, 0xA7 ; 167 1e4b0: a7 2e mov r10, r23 1e4b2: 74 e1 ldi r23, 0x14 ; 20 1e4b4: b7 2e mov r11, r23 1e4b6: 60 91 12 05 lds r22, 0x0512 ; 0x800512 } 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)?'>':' '); 1e4ba: 4e e3 ldi r20, 0x3E ; 62 1e4bc: 82 17 cp r24, r18 1e4be: 93 07 cpc r25, r19 1e4c0: 09 f0 breq .+2 ; 0x1e4c4 1e4c2: 40 e2 ldi r20, 0x20 ; 32 1e4c4: 80 e0 ldi r24, 0x00 ; 0 1e4c6: 0e 94 00 6f call 0xde00 ; 0xde00 lcd_putc(LCD_STR_FOLDER[0]); 1e4ca: 85 e8 ldi r24, 0x85 ; 133 1e4cc: 0e 94 cf 6e call 0xdd9e ; 0xdd9e lcd_print_pad(longFilename, len); 1e4d0: 62 e1 ldi r22, 0x12 ; 18 1e4d2: c5 01 movw r24, r10 1e4d4: 0e 94 cf 70 call 0xe19e ; 0xe19e 1e4d8: 80 91 15 05 lds r24, 0x0515 ; 0x800515 { 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)) 1e4dc: 90 91 13 05 lds r25, 0x0513 ; 0x800513 1e4e0: 99 23 and r25, r25 1e4e2: 09 f4 brne .+2 ; 0x1e4e6 1e4e4: 89 c1 rjmp .+786 ; 0x1e7f8 1e4e6: 20 91 70 06 lds r18, 0x0670 ; 0x800670 1e4ea: 30 91 71 06 lds r19, 0x0671 ; 0x800671 1e4ee: 82 17 cp r24, r18 1e4f0: 13 06 cpc r1, r19 1e4f2: 09 f0 breq .+2 ; 0x1e4f6 1e4f4: 81 c1 rjmp .+770 ; 0x1e7f8 { lcd_update_enabled = false; 1e4f6: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e lcd_return_to_status(); } void menu_action_sddirectory(const char* filename) { card.chdir(filename, true); 1e4fa: 61 e0 ldi r22, 0x01 ; 1 1e4fc: 82 e9 ldi r24, 0x92 ; 146 1e4fe: 94 e1 ldi r25, 0x14 ; 20 1e500: 0f 94 14 7e call 0x2fc28 ; 0x2fc28 lcd_encoder = 0; 1e504: 10 92 71 06 sts 0x0671, r1 ; 0x800671 1e508: 10 92 70 06 sts 0x0670, r1 ; 0x800670 menu_data_reset(); //Forces reloading of cached variables. 1e50c: 0f 94 b8 d1 call 0x3a370 ; 0x3a370 } if (menu_clicked && (lcd_encoder == menu_item)) { lcd_update_enabled = false; menu_action_sdfile(str_fn); lcd_update_enabled = true; 1e510: 00 93 6e 02 sts 0x026E, r16 ; 0x80026e menu_item_ret(); 1e514: 0f 94 7c d0 call 0x3a0f8 ; 0x3a0f8 1e518: 95 cf rjmp .-214 ; 0x1e444 _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()) 1e51a: 0e 94 fd 70 call 0xe1fa ; 0xe1fa 1e51e: 81 11 cpse r24, r1 1e520: 51 cf rjmp .-350 ; 0x1e3c4 _md->menuState = _standard; } } break; default: _md->menuState = _uninitialized; //shouldn't ever happen. Anyways, initialize the menu. } } 1e522: 2d 96 adiw r28, 0x0d ; 13 1e524: 0f b6 in r0, 0x3f ; 63 1e526: f8 94 cli 1e528: de bf out 0x3e, r29 ; 62 1e52a: 0f be out 0x3f, r0 ; 63 1e52c: cd bf out 0x3d, r28 ; 61 1e52e: df 91 pop r29 1e530: cf 91 pop r28 1e532: 1f 91 pop r17 1e534: 0f 91 pop r16 1e536: ff 90 pop r15 1e538: ef 90 pop r14 1e53a: df 90 pop r13 1e53c: cf 90 pop r12 1e53e: bf 90 pop r11 1e540: af 90 pop r10 1e542: 9f 90 pop r9 1e544: 8f 90 pop r8 1e546: 7f 90 pop r7 1e548: 6f 90 pop r6 1e54a: 5f 90 pop r5 1e54c: 4f 90 pop r4 1e54e: 3f 90 pop r3 1e550: 2f 90 pop r2 1e552: 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 1e554: 8c eb ldi r24, 0xBC ; 188 1e556: 99 e4 ldi r25, 0x49 ; 73 1e558: 55 cf rjmp .-342 ; 0x1e404 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. 1e55a: 66 ed ldi r22, 0xD6 ; 214 1e55c: 7f ed ldi r23, 0xDF ; 223 1e55e: 8f e3 ldi r24, 0x3F ; 63 1e560: 9a e8 ldi r25, 0x8A ; 138 1e562: 69 cf rjmp .-302 ; 0x1e436 menu_item++; } static void menu_item_sdfile(const char* str_fn, char* str_fnl) { if (lcd_draw_update) 1e564: 44 23 and r20, r20 1e566: d1 f0 breq .+52 ; 0x1e59c { lcd_implementation_drawmenu_sdfile(menu_row, (str_fnl[0] == '\0') ? str_fn : str_fnl); 1e568: 40 91 a7 14 lds r20, 0x14A7 ; 0x8014a7 1e56c: 62 e9 ldi r22, 0x92 ; 146 1e56e: a6 2e mov r10, r22 1e570: 64 e1 ldi r22, 0x14 ; 20 1e572: b6 2e mov r11, r22 1e574: 44 23 and r20, r20 1e576: 21 f0 breq .+8 ; 0x1e580 1e578: 57 ea ldi r21, 0xA7 ; 167 1e57a: a5 2e mov r10, r21 1e57c: 54 e1 ldi r21, 0x14 ; 20 1e57e: b5 2e mov r11, r21 1e580: 60 91 12 05 lds r22, 0x0512 ; 0x800512 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)?'>':' '); 1e584: 4e e3 ldi r20, 0x3E ; 62 1e586: 82 17 cp r24, r18 1e588: 93 07 cpc r25, r19 1e58a: 09 f0 breq .+2 ; 0x1e58e 1e58c: 40 e2 ldi r20, 0x20 ; 32 1e58e: 80 e0 ldi r24, 0x00 ; 0 1e590: 0e 94 00 6f call 0xde00 ; 0xde00 lcd_print_pad(longFilename, len); 1e594: 63 e1 ldi r22, 0x13 ; 19 1e596: c5 01 movw r24, r10 1e598: 0e 94 cf 70 call 0xe19e ; 0xe19e 1e59c: 80 91 15 05 lds r24, 0x0515 ; 0x800515 { 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)) 1e5a0: 90 91 13 05 lds r25, 0x0513 ; 0x800513 1e5a4: 99 23 and r25, r25 1e5a6: 09 f4 brne .+2 ; 0x1e5aa 1e5a8: 27 c1 rjmp .+590 ; 0x1e7f8 1e5aa: 20 91 70 06 lds r18, 0x0670 ; 0x800670 1e5ae: 30 91 71 06 lds r19, 0x0671 ; 0x800671 1e5b2: 82 17 cp r24, r18 1e5b4: 13 06 cpc r1, r19 1e5b6: 09 f0 breq .+2 ; 0x1e5ba 1e5b8: 1f c1 rjmp .+574 ; 0x1e7f8 { lcd_update_enabled = false; 1e5ba: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e return result; } static void menu_action_sdfile(const char* filename) { if(eFilamentAction != FilamentAction::None) return; 1e5be: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 1e5c2: 81 11 cpse r24, r1 1e5c4: a5 cf rjmp .-182 ; 0x1e510 // 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); 1e5c6: 62 e9 ldi r22, 0x92 ; 146 1e5c8: 74 e1 ldi r23, 0x14 ; 20 1e5ca: c7 01 movw r24, r14 1e5cc: 0f 94 87 e2 call 0x3c50e ; 0x3c50e 1e5d0: 47 01 movw r8, r14 1e5d2: 45 e9 ldi r20, 0x95 ; 149 1e5d4: a4 2e mov r10, r20 1e5d6: 4f e0 ldi r20, 0x0F ; 15 1e5d8: 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] == '.') { 1e5da: f4 01 movw r30, r8 1e5dc: 61 91 ld r22, Z+ 1e5de: 4f 01 movw r8, r30 1e5e0: 66 23 and r22, r22 1e5e2: 19 f0 breq .+6 ; 0x1e5ea 1e5e4: 6e 32 cpi r22, 0x2E ; 46 1e5e6: 09 f0 breq .+2 ; 0x1e5ea 1e5e8: 4b c0 rjmp .+150 ; 0x1e680 1e5ea: 60 e0 ldi r22, 0x00 ; 0 1e5ec: c5 01 movw r24, r10 1e5ee: 0f 94 40 dc call 0x3b880 ; 0x3b880 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, '.'); 1e5f2: 6e e2 ldi r22, 0x2E ; 46 1e5f4: 70 e0 ldi r23, 0x00 ; 0 1e5f6: c7 01 movw r24, r14 1e5f8: 0f 94 73 e2 call 0x3c4e6 ; 0x3c4e6 1e5fc: 3c 01 movw r6, r24 if (extension_ptr) { 1e5fe: 89 2b or r24, r25 1e600: 19 f0 breq .+6 ; 0x1e608 extension_ptr++; // skip the '.' 1e602: 8f ef ldi r24, 0xFF ; 255 1e604: 68 1a sub r6, r24 1e606: 78 0a sbc r7, r24 1e608: 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); 1e60a: 31 e9 ldi r19, 0x91 ; 145 1e60c: a3 2e mov r10, r19 1e60e: 3c e0 ldi r19, 0x0C ; 12 1e610: 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') { 1e612: 61 14 cp r6, r1 1e614: 71 04 cpc r7, r1 1e616: 21 f0 breq .+8 ; 0x1e620 1e618: f4 01 movw r30, r8 1e61a: 60 81 ld r22, Z 1e61c: 61 11 cpse r22, r1 1e61e: 01 c0 rjmp .+2 ; 0x1e622 1e620: 60 e0 ldi r22, 0x00 ; 0 1e622: c5 01 movw r24, r10 1e624: 0f 94 40 dc call 0x3b880 ; 0x3b880 1e628: ff ef ldi r31, 0xFF ; 255 1e62a: af 1a sub r10, r31 1e62c: bf 0a sbc r11, r31 1e62e: 2f ef ldi r18, 0xFF ; 255 1e630: 82 1a sub r8, r18 1e632: 92 0a sbc r9, r18 if (extension_ptr) { extension_ptr++; // skip the '.' } for (uint_least8_t i = 0; i < 3; i++) 1e634: 84 e9 ldi r24, 0x94 ; 148 1e636: a8 16 cp r10, r24 1e638: 8c e0 ldi r24, 0x0C ; 12 1e63a: b8 06 cpc r11, r24 1e63c: 51 f7 brne .-44 ; 0x1e612 { workDirParents[level].getFilename(name); } uint8_t CardReader::getWorkDirDepth() { return workDirDepth; 1e63e: 60 90 30 16 lds r6, 0x1630 ; 0x801630 1e642: 66 2d mov r22, r6 1e644: 8a e5 ldi r24, 0x5A ; 90 1e646: 9f e0 ldi r25, 0x0F ; 15 1e648: 0f 94 40 dc call 0x3b880 ; 0x3b880 1e64c: 8e e8 ldi r24, 0x8E ; 142 1e64e: 94 e1 ldi r25, 0x14 ; 20 1e650: 2a e0 ldi r18, 0x0A ; 10 1e652: a2 2e mov r10, r18 1e654: 2f e0 ldi r18, 0x0F ; 15 1e656: 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++) { 1e658: 71 2c mov r7, r1 1e65a: 4c 01 movw r8, r24 1e65c: e9 e0 ldi r30, 0x09 ; 9 1e65e: 8e 0e add r8, r30 1e660: 91 1c adc r9, r1 1e662: 76 14 cp r7, r6 1e664: d1 f0 breq .+52 ; 0x1e69a #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); 1e666: 48 e0 ldi r20, 0x08 ; 8 1e668: 50 e0 ldi r21, 0x00 ; 0 1e66a: b5 01 movw r22, r10 1e66c: 8e 5a subi r24, 0xAE ; 174 1e66e: 9f 4f sbci r25, 0xFF ; 255 1e670: 0f 94 30 dc call 0x3b860 ; 0x3b860 1e674: 73 94 inc r7 1e676: f8 e0 ldi r31, 0x08 ; 8 1e678: af 0e add r10, r31 1e67a: b1 1c adc r11, r1 1e67c: c4 01 movw r24, r8 1e67e: ed cf rjmp .-38 ; 0x1e65a if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1e680: c5 01 movw r24, r10 1e682: 0f 94 40 dc call 0x3b880 ; 0x3b880 1e686: ff ef ldi r31, 0xFF ; 255 1e688: af 1a sub r10, r31 1e68a: 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++) { 1e68c: 2d e9 ldi r18, 0x9D ; 157 1e68e: a2 16 cp r10, r18 1e690: 2f e0 ldi r18, 0x0F ; 15 1e692: b2 06 cpc r11, r18 1e694: 09 f0 breq .+2 ; 0x1e698 1e696: a1 cf rjmp .-190 ; 0x1e5da 1e698: ac cf rjmp .-168 ; 0x1e5f2 /** Menu action functions **/ static bool check_file(const char* filename) { if (farm_mode) return true; card.openFileReadFilteredGcode(filename, true); 1e69a: 61 e0 ldi r22, 0x01 ; 1 1e69c: c7 01 movw r24, r14 1e69e: 0f 94 4b 7f call 0x2fe96 ; 0x2fe96 } uint32_t CardReader::getFileSize() { return filesize; 1e6a2: 40 90 9d 17 lds r4, 0x179D ; 0x80179d 1e6a6: 50 90 9e 17 lds r5, 0x179E ; 0x80179e 1e6aa: 60 90 9f 17 lds r6, 0x179F ; 0x80179f 1e6ae: 70 90 a0 17 lds r7, 0x17A0 ; 0x8017a0 bool result = false; const uint32_t filesize = card.getFileSize(); uint32_t startPos = 0; const uint16_t bytesToCheck = min(END_FILE_SECTION, filesize); 1e6b2: 94 2d mov r25, r4 1e6b4: 85 2d mov r24, r5 1e6b6: 21 e0 ldi r18, 0x01 ; 1 1e6b8: 42 16 cp r4, r18 1e6ba: 28 e7 ldi r18, 0x78 ; 120 1e6bc: 52 06 cpc r5, r18 1e6be: 61 04 cpc r6, r1 1e6c0: 71 04 cpc r7, r1 1e6c2: 10 f0 brcs .+4 ; 0x1e6c8 1e6c4: 90 e0 ldi r25, 0x00 ; 0 1e6c6: 88 e7 ldi r24, 0x78 ; 120 1e6c8: a9 2e mov r10, r25 1e6ca: b8 2e mov r11, r24 if (filesize > END_FILE_SECTION) { 1e6cc: 81 e0 ldi r24, 0x01 ; 1 1e6ce: 48 16 cp r4, r24 1e6d0: 88 e7 ldi r24, 0x78 ; 120 1e6d2: 58 06 cpc r5, r24 1e6d4: 61 04 cpc r6, r1 1e6d6: 71 04 cpc r7, r1 1e6d8: 08 f4 brcc .+2 ; 0x1e6dc 1e6da: 5d c0 rjmp .+186 ; 0x1e796 startPos = filesize - END_FILE_SECTION; 1e6dc: 98 e7 ldi r25, 0x78 ; 120 1e6de: 59 1a sub r5, r25 1e6e0: 61 08 sbc r6, r1 1e6e2: 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);}; 1e6e4: 40 92 a4 17 sts 0x17A4, r4 ; 0x8017a4 1e6e8: 50 92 a5 17 sts 0x17A5, r5 ; 0x8017a5 1e6ec: 60 92 a6 17 sts 0x17A6, r6 ; 0x8017a6 1e6f0: 70 92 a7 17 sts 0x17A7, r7 ; 0x8017a7 1e6f4: c3 01 movw r24, r6 1e6f6: b2 01 movw r22, r4 1e6f8: 0f 94 9c 75 call 0x2eb38 ; 0x2eb38 card.setIndex(startPos); } cmdqueue_reset(); 1e6fc: 0e 94 44 7f call 0xfe88 ; 0xfe88 cmdqueue_serial_disabled = true; 1e700: 00 93 a6 03 sts 0x03A6, r16 ; 0x8003a6 menu_progressbar_init(bytesToCheck, _T(MSG_CHECKING_FILE)); 1e704: 89 e6 ldi r24, 0x69 ; 105 1e706: 98 e4 ldi r25, 0x48 ; 72 1e708: 0e 94 ac 72 call 0xe558 ; 0xe558 1e70c: bc 01 movw r22, r24 1e70e: c5 01 movw r24, r10 1e710: 0f 94 f8 cf call 0x39ff0 ; 0x39ff0 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; } 1e714: 80 91 a4 17 lds r24, 0x17A4 ; 0x8017a4 1e718: 90 91 a5 17 lds r25, 0x17A5 ; 0x8017a5 1e71c: a0 91 a6 17 lds r26, 0x17A6 ; 0x8017a6 1e720: b0 91 a7 17 lds r27, 0x17A7 ; 0x8017a7 while (!card.eof() && !result) { 1e724: 40 91 9d 17 lds r20, 0x179D ; 0x80179d 1e728: 50 91 9e 17 lds r21, 0x179E ; 0x80179e 1e72c: 60 91 9f 17 lds r22, 0x179F ; 0x80179f 1e730: 70 91 a0 17 lds r23, 0x17A0 ; 0x8017a0 1e734: 84 17 cp r24, r20 1e736: 95 07 cpc r25, r21 1e738: a6 07 cpc r26, r22 1e73a: b7 07 cpc r27, r23 1e73c: 80 f5 brcc .+96 ; 0x1e79e 1e73e: 11 11 cpse r17, r1 1e740: 2e c0 rjmp .+92 ; 0x1e79e 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); }; 1e742: 20 91 23 17 lds r18, 0x1723 ; 0x801723 1e746: 21 11 cpse r18, r1 1e748: 03 c0 rjmp .+6 ; 0x1e750 1e74a: 80 e0 ldi r24, 0x00 ; 0 1e74c: 90 e0 ldi r25, 0x00 ; 0 1e74e: dc 01 movw r26, r24 menu_progressbar_update(card.get_sdpos() - startPos); 1e750: 84 19 sub r24, r4 1e752: 95 09 sbc r25, r5 1e754: 0f 94 c9 cf call 0x39f92 ; 0x39f92 card.sdprinting = true; 1e758: 00 93 90 14 sts 0x1490, r16 ; 0x801490 get_command(); 1e75c: 0e 94 20 83 call 0x10640 ; 0x10640 #endif // LIN_ADVANCE bool check_commands() { bool end_command_found = false; while (buflen) 1e760: 80 91 a3 10 lds r24, 0x10A3 ; 0x8010a3 1e764: 90 91 a4 10 lds r25, 0x10A4 ; 0x8010a4 1e768: 89 2b or r24, r25 1e76a: a1 f2 breq .-88 ; 0x1e714 { if ((code_seen_P(MSG_M84)) || (code_seen_P(PSTR("M 84")))) end_command_found = true; 1e76c: 87 ed ldi r24, 0xD7 ; 215 1e76e: 9b e6 ldi r25, 0x6B ; 107 1e770: 0e 94 26 68 call 0xd04c ; 0xd04c 1e774: 81 11 cpse r24, r1 1e776: 05 c0 rjmp .+10 ; 0x1e782 1e778: 8a e3 ldi r24, 0x3A ; 58 1e77a: 9a e8 ldi r25, 0x8A ; 138 1e77c: 0e 94 26 68 call 0xd04c ; 0xd04c 1e780: 81 11 cpse r24, r1 1e782: 11 e0 ldi r17, 0x01 ; 1 if (!cmdbuffer_front_already_processed) 1e784: 80 91 a2 10 lds r24, 0x10A2 ; 0x8010a2 1e788: 81 11 cpse r24, r1 1e78a: 02 c0 rjmp .+4 ; 0x1e790 cmdqueue_pop_front(); 1e78c: 0e 94 bc 76 call 0xed78 ; 0xed78 cmdbuffer_front_already_processed = false; 1e790: 10 92 a2 10 sts 0x10A2, r1 ; 0x8010a2 1e794: e5 cf rjmp .-54 ; 0x1e760 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; 1e796: 41 2c mov r4, r1 1e798: 51 2c mov r5, r1 1e79a: 32 01 movw r6, r4 1e79c: af cf rjmp .-162 ; 0x1e6fc // with the CMDBUFFER_DEBUG enabled manage_heater(); #endif // CMDBUFFER_DEBUG } menu_progressbar_finish(); 1e79e: 0f 94 ea cf call 0x39fd4 ; 0x39fd4 cmdqueue_serial_disabled = false; 1e7a2: 10 92 a6 03 sts 0x03A6, r1 ; 0x8003a6 card.printingHasFinished(); 1e7a6: 0f 94 83 80 call 0x30106 ; 0x30106 lcd_setstatuspgm(MSG_WELCOME); 1e7aa: 83 e7 ldi r24, 0x73 ; 115 1e7ac: 90 e7 ldi r25, 0x70 ; 112 1e7ae: 0e 94 5d f1 call 0x1e2ba ; 0x1e2ba 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)) { 1e7b2: 11 23 and r17, r17 1e7b4: 91 f0 breq .+36 ; 0x1e7da 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); 1e7b6: ff 92 push r15 1e7b8: ef 92 push r14 1e7ba: 3f 92 push r3 1e7bc: 2f 92 push r2 1e7be: 0e 94 b6 88 call 0x1116c ; 0x1116c enquecommand_P(MSG_M24); 1e7c2: 61 e0 ldi r22, 0x01 ; 1 1e7c4: 80 ef ldi r24, 0xF0 ; 240 1e7c6: 90 e7 ldi r25, 0x70 ; 112 1e7c8: 0e 94 20 88 call 0x11040 ; 0x11040 1e7cc: 0f 90 pop r0 1e7ce: 0f 90 pop r0 1e7d0: 0f 90 pop r0 1e7d2: 0f 90 pop r0 } lcd_return_to_status(); 1e7d4: 0f 94 a6 1e call 0x23d4c ; 0x23d4c 1e7d8: 9b ce rjmp .-714 ; 0x1e510 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); 1e7da: 89 e7 ldi r24, 0x79 ; 121 1e7dc: 98 e4 ldi r25, 0x48 ; 72 1e7de: 0e 94 ac 72 call 0xe558 ; 0xe558 1e7e2: 41 e0 ldi r20, 0x01 ; 1 1e7e4: 60 e0 ldi r22, 0x00 ; 0 1e7e6: 0f 94 40 4f call 0x29e80 ; 0x29e80 1e7ea: 18 2f mov r17, r24 lcd_update_enable(true); 1e7ec: 81 e0 ldi r24, 0x01 ; 1 1e7ee: 0e 94 25 6f call 0xde4a ; 0xde4a } if (result) { 1e7f2: 11 23 and r17, r17 1e7f4: 01 f3 breq .-64 ; 0x1e7b6 1e7f6: ee cf rjmp .-36 ; 0x1e7d4 lcd_putc_at(LCD_WIDTH - 1, menu_row, type_char); } void menu_item_dummy(void) { menu_item++; 1e7f8: 8f 5f subi r24, 0xFF ; 255 1e7fa: 80 93 15 05 sts 0x0515, r24 ; 0x800515 1e7fe: 22 ce rjmp .-956 ; 0x1e444 else MENU_ITEM_SDFILE(card.filename, card.longFilename); } else MENU_ITEM_DUMMY(); //dummy item that just increments the internal menu counters. } MENU_END(); 1e800: 0f 94 6a d1 call 0x3a2d4 ; 0x3a2d4 _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(); 1e804: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1e808: 8f 5f subi r24, 0xFF ; 255 1e80a: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1e80e: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1e812: 8f 5f subi r24, 0xFF ; 255 1e814: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1e818: e7 cd rjmp .-1074 ; 0x1e3e8 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. 1e81a: 80 91 a8 03 lds r24, 0x03A8 ; 0x8003a8 1e81e: 11 e0 ldi r17, 0x01 ; 1 1e820: 81 11 cpse r24, r1 1e822: 05 c0 rjmp .+10 ; 0x1e82e 1e824: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 1e828: 81 11 cpse r24, r1 1e82a: 01 c0 rjmp .+2 ; 0x1e82e 1e82c: 10 e0 ldi r17, 0x00 ; 0 if (_md->scrollPointer == NULL) 1e82e: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 1e832: 90 91 ad 03 lds r25, 0x03AD ; 0x8003ad 1e836: 89 2b or r24, r25 1e838: 91 f4 brne .+36 ; 0x1e85e { //load filename to memory. #ifdef SDCARD_SORT_ALPHA card.getfilename_sorted(_md->selectedFileID, _md->sdSort); 1e83a: 60 91 b3 03 lds r22, 0x03B3 ; 0x8003b3 1e83e: 80 91 ae 03 lds r24, 0x03AE ; 0x8003ae 1e842: 90 91 af 03 lds r25, 0x03AF ; 0x8003af 1e846: 0f 94 00 85 call 0x30a00 ; 0x30a00 #else card.getfilename(_md->selectedFileID); #endif _md->scrollPointer = (card.longFilename[0] == '\0') ? card.filename : card.longFilename; 1e84a: 80 91 a7 14 lds r24, 0x14A7 ; 0x8014a7 1e84e: 81 11 cpse r24, r1 1e850: 46 c0 rjmp .+140 ; 0x1e8de 1e852: 82 e9 ldi r24, 0x92 ; 146 1e854: 94 e1 ldi r25, 0x14 ; 20 1e856: 90 93 ad 03 sts 0x03AD, r25 ; 0x8003ad 1e85a: 80 93 ac 03 sts 0x03AC, r24 ; 0x8003ac } if (rewindFlag) 1e85e: 11 11 cpse r17, r1 _md->offset = 0; //redraw once again from the beginning. 1e860: 10 92 aa 03 sts 0x03AA, r1 ; 0x8003aa if (_md->lcd_scrollTimer.expired(300) || rewindFlag) 1e864: 6c e2 ldi r22, 0x2C ; 44 1e866: 71 e0 ldi r23, 0x01 ; 1 1e868: 84 eb ldi r24, 0xB4 ; 180 1e86a: 93 e0 ldi r25, 0x03 ; 3 1e86c: 0f 94 7e 29 call 0x252fc ; 0x252fc ::expired(unsigned short)> 1e870: 81 11 cpse r24, r1 1e872: 03 c0 rjmp .+6 ; 0x1e87a 1e874: 11 23 and r17, r17 1e876: 09 f4 brne .+2 ; 0x1e87a 1e878: 54 ce rjmp .-856 ; 0x1e522 { uint8_t len = LCD_WIDTH - ((_md->isDir)? 2 : 1); 1e87a: 80 91 ab 03 lds r24, 0x03AB ; 0x8003ab 1e87e: 02 e1 ldi r16, 0x12 ; 18 1e880: 81 11 cpse r24, r1 1e882: 01 c0 rjmp .+2 ; 0x1e886 1e884: 03 e1 ldi r16, 0x13 ; 19 lcd_putc_at(0, _md->row, '>'); 1e886: 4e e3 ldi r20, 0x3E ; 62 1e888: 60 91 b2 03 lds r22, 0x03B2 ; 0x8003b2 1e88c: 80 e0 ldi r24, 0x00 ; 0 1e88e: 0e 94 00 6f call 0xde00 ; 0xde00 if (_md->isDir) 1e892: 80 91 ab 03 lds r24, 0x03AB ; 0x8003ab 1e896: 88 23 and r24, r24 1e898: 19 f0 breq .+6 ; 0x1e8a0 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 1e89a: 85 e8 ldi r24, 0x85 ; 133 1e89c: 0e 94 8f 6f call 0xdf1e ; 0xdf1e lcd_print(LCD_STR_FOLDER[0]); if( lcd_print_pad(&_md->scrollPointer[_md->offset], len) == 0) 1e8a0: 20 91 aa 03 lds r18, 0x03AA ; 0x8003aa 1e8a4: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 1e8a8: 90 91 ad 03 lds r25, 0x03AD ; 0x8003ad 1e8ac: 60 2f mov r22, r16 1e8ae: 82 0f add r24, r18 1e8b0: 91 1d adc r25, r1 1e8b2: 0e 94 cf 70 call 0xe19e ; 0xe19e 1e8b6: 81 11 cpse r24, r1 1e8b8: 15 c0 rjmp .+42 ; 0x1e8e4 { _md->lcd_scrollTimer.start(); 1e8ba: 84 eb ldi r24, 0xB4 ; 180 1e8bc: 93 e0 ldi r25, 0x03 ; 3 1e8be: 0f 94 ad 29 call 0x2535a ; 0x2535a ::start()> _md->offset++; 1e8c2: 80 91 aa 03 lds r24, 0x03AA ; 0x8003aa 1e8c6: 8f 5f subi r24, 0xFF ; 255 1e8c8: 80 93 aa 03 sts 0x03AA, r24 ; 0x8003aa } else { // stop at the end of the string _md->lcd_scrollTimer.stop(); } } if (rewindFlag) //go back to sd_menu. 1e8cc: 11 23 and r17, r17 1e8ce: 09 f4 brne .+2 ; 0x1e8d2 1e8d0: 28 ce rjmp .-944 ; 0x1e522 1e8d2: 10 92 b4 03 sts 0x03B4, r1 ; 0x8003b4 { _md->lcd_scrollTimer.stop(); //forces redraw in _standard state _md->menuState = _standard; 1e8d6: 81 e0 ldi r24, 0x01 ; 1 1e8d8: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 1e8dc: 22 ce rjmp .-956 ; 0x1e522 #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; 1e8de: 87 ea ldi r24, 0xA7 ; 167 1e8e0: 94 e1 ldi r25, 0x14 ; 20 1e8e2: b9 cf rjmp .-142 ; 0x1e856 1e8e4: 10 92 b4 03 sts 0x03B4, r1 ; 0x8003b4 1e8e8: f1 cf rjmp .-30 ; 0x1e8cc 0001e8ea : } #endif /* DEBUG_STEPPER_TIMER_MISSED */ static void lcd_colorprint_change() { enquecommand_P(MSG_M600); 1e8ea: 61 e0 ldi r22, 0x01 ; 1 1e8ec: 8b ee ldi r24, 0xEB ; 235 1e8ee: 90 e7 ldi r25, 0x70 ; 112 1e8f0: 0e 94 20 88 call 0x11040 ; 0x11040 custom_message_type = CustomMsg::FilamentLoading; //just print status message 1e8f4: 82 e0 ldi r24, 0x02 ; 2 1e8f6: 80 93 c4 06 sts 0x06C4, r24 ; 0x8006c4 lcd_setstatuspgm(_T(MSG_FINISHING_MOVEMENTS)); 1e8fa: 8b e5 ldi r24, 0x5B ; 91 1e8fc: 93 e5 ldi r25, 0x53 ; 83 1e8fe: 0e 94 ac 72 call 0xe558 ; 0xe558 1e902: 0e 94 5d f1 call 0x1e2ba ; 0x1e2ba lcd_return_to_status(); 1e906: 0f 94 a6 1e call 0x23d4c ; 0x23d4c lcd_draw_update = 3; 1e90a: 83 e0 ldi r24, 0x03 ; 3 1e90c: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } 1e910: 08 95 ret 0001e912 : // hack lcd_draw_update to 1, i.e. without clear lcd_draw_update = 1; } void lcd_setstatus(const char* message) { 1e912: cf 93 push r28 1e914: df 93 push r29 1e916: ec 01 movw r28, r24 if (lcd_message_check(LCD_STATUS_NONE)) 1e918: 80 e0 ldi r24, 0x00 ; 0 1e91a: 0e 94 07 f1 call 0x1e20e ; 0x1e20e 1e91e: 88 23 and r24, r24 1e920: 31 f0 breq .+12 ; 0x1e92e lcd_updatestatus(message); 1e922: 60 e0 ldi r22, 0x00 ; 0 1e924: ce 01 movw r24, r28 } 1e926: df 91 pop r29 1e928: cf 91 pop r28 } void lcd_setstatus(const char* message) { if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message); 1e92a: 0c 94 ec f0 jmp 0x1e1d8 ; 0x1e1d8 } 1e92e: df 91 pop r29 1e930: cf 91 pop r28 1e932: 08 95 ret 0001e934 : 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) { 1e934: cf 93 push r28 1e936: df 93 push r29 1e938: c8 2f mov r28, r24 softReset(); } void UnconditionalStop() { CRITICAL_SECTION_START; 1e93a: 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) { 1e93c: 66 23 and r22, r22 1e93e: d9 f1 breq .+118 ; 0x1e9b6 1e940: f8 94 cli // Disable all heaters and unroll the temperature wait loop stack disable_heater(); 1e942: 0f 94 18 2f call 0x25e30 ; 0x25e30 cancel_heatup = true; 1e946: 81 e0 ldi r24, 0x01 ; 1 1e948: 80 93 b5 0d sts 0x0DB5, r24 ; 0x800db5 <_ZL13cancel_heatup.lto_priv.408> heating_status = HeatingStatus::NO_HEATING; 1e94c: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 // Clear any saved printing state cancel_saved_printing(); 1e950: 0e 94 ad 64 call 0xc95a ; 0xc95a // Abort the planner planner_abort_hard(); 1e954: 0f 94 c3 c1 call 0x38386 ; 0x38386 // Reset the queue cmdqueue_reset(); 1e958: 0e 94 44 7f call 0xfe88 ; 0xfe88 cmdqueue_serial_disabled = false; 1e95c: 10 92 a6 03 sts 0x03A6, r1 ; 0x8003a6 st_reset_timer(); 1e960: 0f 94 42 43 call 0x28684 ; 0x28684 CRITICAL_SECTION_END; 1e964: df bf out 0x3f, r29 ; 63 // clear paused state immediately did_pause_print = false; 1e966: 10 92 e4 03 sts 0x03E4, r1 ; 0x8003e4 print_job_timer.stop(); 1e96a: 0f 94 b1 42 call 0x28562 ; 0x28562 } else { // Allow lcd_print_stop_finish() to use the heaters when it is safe ConditionalStop(); } if (card.isFileOpen()) { 1e96e: 80 91 23 17 lds r24, 0x1723 ; 0x801723 1e972: 88 23 and r24, r24 1e974: 71 f0 breq .+28 ; 0x1e992 // Reset the sd status card.sdprinting = false; 1e976: 10 92 90 14 sts 0x1490, r1 ; 0x801490 lastnr++; } void CardReader::closefile(bool store_location) { file.sync(); 1e97a: 80 e2 ldi r24, 0x20 ; 32 1e97c: 97 e1 ldi r25, 0x17 ; 23 1e97e: 0f 94 3b 58 call 0x2b076 ; 0x2b076 file.close(); 1e982: 80 e2 ldi r24, 0x20 ; 32 1e984: 97 e1 ldi r25, 0x17 ; 23 1e986: 0f 94 70 58 call 0x2b0e0 ; 0x2b0e0 saving = false; 1e98a: 10 92 8e 14 sts 0x148E, r1 ; 0x80148e logging = false; 1e98e: 10 92 8f 14 sts 0x148F, r1 ; 0x80148f card.closefile(); } SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_CANCEL); 1e992: 8a e3 ldi r24, 0x3A ; 58 1e994: 9b e6 ldi r25, 0x6B ; 107 1e996: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 #ifdef MESH_BED_LEVELING mbl.active = false; 1e99a: 10 92 c2 13 sts 0x13C2, r1 ; 0x8013c2 #endif if (interactive) { 1e99e: c1 11 cpse r28, r1 // acknowledged by the user from the LCD: resume processing USB commands again Stopped = false; 1e9a0: 10 92 11 05 sts 0x0511, r1 ; 0x800511 } // return to status is required to continue processing in the main loop! lcd_commands_type = LcdCommands::StopPrint; 1e9a4: 81 e0 ldi r24, 0x01 ; 1 1e9a6: 80 93 b4 0d sts 0x0DB4, r24 ; 0x800db4 } PrinterState SetPrinterState(PrinterState status) { return printer_state = status; 1e9aa: 10 92 b8 0d sts 0x0DB8, r1 ; 0x800db8 <_ZL13printer_state.lto_priv.401> SetPrinterState(PrinterState::NotReady); //set printer state to show LCD menu after print has been stopped lcd_return_to_status(); } 1e9ae: df 91 pop r29 1e9b0: 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(); 1e9b2: 0d 94 a6 1e jmp 0x23d4c ; 0x23d4c } void ConditionalStop() { CRITICAL_SECTION_START; 1e9b6: 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; 1e9b8: 81 e0 ldi r24, 0x01 ; 1 1e9ba: 80 93 b5 0d sts 0x0DB5, r24 ; 0x800db5 <_ZL13cancel_heatup.lto_priv.408> heating_status = HeatingStatus::NO_HEATING; 1e9be: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 // Clear any saved printing state cancel_saved_printing(); 1e9c2: 0e 94 ad 64 call 0xc95a ; 0xc95a // Abort the planner planner_abort_hard(); 1e9c6: 0f 94 c3 c1 call 0x38386 ; 0x38386 // Reset the queue cmdqueue_reset(); 1e9ca: 0e 94 44 7f call 0xfe88 ; 0xfe88 cmdqueue_serial_disabled = false; 1e9ce: 10 92 a6 03 sts 0x03A6, r1 ; 0x8003a6 st_reset_timer(); 1e9d2: 0f 94 42 43 call 0x28684 ; 0x28684 CRITICAL_SECTION_END; 1e9d6: df bf out 0x3f, r29 ; 63 1e9d8: ca cf rjmp .-108 ; 0x1e96e 0001e9da : } void lcd_print_stop() { print_stop(true); 1e9da: 60 e0 ldi r22, 0x00 ; 0 1e9dc: 81 e0 ldi r24, 0x01 ; 1 1e9de: 0c 94 9a f4 jmp 0x1e934 ; 0x1e934 0001e9e2 : 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' 1e9e2: 41 30 cpi r20, 0x01 ; 1 1e9e4: 41 f4 brne .+16 ; 0x1e9f6 if (lcd_show_multiscreen_message_yes_no_and_wait_P(warning, true, LCD_LEFT_BUTTON_CHOICE) == LCD_MIDDLE_BUTTON_CHOICE) { 1e9e6: 40 e0 ldi r20, 0x00 ; 0 1e9e8: 61 e0 ldi r22, 0x01 ; 1 1e9ea: 0f 94 40 4f call 0x29e80 ; 0x29e80 1e9ee: 81 30 cpi r24, 0x01 ; 1 1e9f0: 41 f4 brne .+16 ; 0x1ea02 lcd_print_stop(); } } else if (check == 2) { // Strict, always stop print lcd_show_fullscreen_message_and_wait_P(strict); lcd_print_stop(); 1e9f2: 0c 94 ed f4 jmp 0x1e9da ; 0x1e9da { 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 1e9f6: 42 30 cpi r20, 0x02 ; 2 1e9f8: 21 f4 brne .+8 ; 0x1ea02 lcd_show_fullscreen_message_and_wait_P(strict); 1e9fa: cb 01 movw r24, r22 1e9fc: 0f 94 f1 1f call 0x23fe2 ; 0x23fe2 1ea00: f8 cf rjmp .-16 ; 0x1e9f2 lcd_print_stop(); } } 1ea02: 08 95 ret 0001ea04 : ,_T(MSG_GCODE_NEWER_FIRMWARE_CANCELLED) ,(uint8_t)oCheckVersion ); } bool filament_presence_check() { 1ea04: 0f 93 push r16 1ea06: 1f 93 push r17 1ea08: 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)) { 1ea0a: 8c ea ldi r24, 0xAC ; 172 1ea0c: 9c e0 ldi r25, 0x0C ; 12 1ea0e: 0f 94 1c dc call 0x3b838 ; 0x3b838 1ea12: 81 11 cpse r24, r1 1ea14: 23 c0 rjmp .+70 ; 0x1ea5c goto done; } if (fsensor.isEnabled() && !fsensor.getFilamentPresent()) { 1ea16: 80 91 aa 17 lds r24, 0x17AA ; 0x8017aa 1ea1a: 88 23 and r24, r24 1ea1c: f9 f0 breq .+62 ; 0x1ea5c 1ea1e: 80 91 b7 17 lds r24, 0x17B7 ; 0x8017b7 1ea22: 81 11 cpse r24, r1 1ea24: 1b c0 rjmp .+54 ; 0x1ea5c if (oCheckFilament == ClCheckMode::_None) { 1ea26: c0 91 e7 04 lds r28, 0x04E7 ; 0x8004e7 1ea2a: cc 23 and r28, r28 1ea2c: b9 f0 breq .+46 ; 0x1ea5c goto done; } render_M862_warnings( 1ea2e: 8c e0 ldi r24, 0x0C ; 12 1ea30: 9b e4 ldi r25, 0x4B ; 75 1ea32: 0e 94 ac 72 call 0xe558 ; 0xe558 1ea36: 8c 01 movw r16, r24 1ea38: 83 ee ldi r24, 0xE3 ; 227 1ea3a: 9a e4 ldi r25, 0x4A ; 74 1ea3c: 0e 94 ac 72 call 0xe558 ; 0xe558 1ea40: 4c 2f mov r20, r28 1ea42: b8 01 movw r22, r16 1ea44: 0e 94 f1 f4 call 0x1e9e2 ; 0x1e9e2 _T(MSG_MISSING_FILAMENT_CONTINUE) ,_T(MSG_MISSING_FILAMENT_CANCELLED) ,(uint8_t)oCheckFilament ); if (lcd_commands_type == LcdCommands::StopPrint) { 1ea48: 81 e0 ldi r24, 0x01 ; 1 1ea4a: 90 91 b4 0d lds r25, 0x0DB4 ; 0x800db4 1ea4e: 91 30 cpi r25, 0x01 ; 1 1ea50: 09 f4 brne .+2 ; 0x1ea54 1ea52: 80 e0 ldi r24, 0x00 ; 0 } } done: return true; } 1ea54: cf 91 pop r28 1ea56: 1f 91 pop r17 1ea58: 0f 91 pop r16 1ea5a: 08 95 ret return false; } } done: return true; 1ea5c: 81 e0 ldi r24, 0x01 ; 1 1ea5e: fa cf rjmp .-12 ; 0x1ea54 0001ea60 : lcd_show_fullscreen_message_and_wait_P(strict); lcd_print_stop(); } } void nozzle_diameter_check(uint16_t nDiameter) { 1ea60: 1f 93 push r17 1ea62: cf 93 push r28 1ea64: df 93 push r29 uint16_t nDiameter_um; if (oCheckMode == ClCheckMode::_None) 1ea66: 10 91 ec 04 lds r17, 0x04EC ; 0x8004ec 1ea6a: 11 23 and r17, r17 1ea6c: f9 f0 breq .+62 ; 0x1eaac 1ea6e: ec 01 movw r28, r24 return; nDiameter_um = eeprom_read_word((uint16_t *)EEPROM_NOZZLE_DIAMETER_uM); 1ea70: 85 ea ldi r24, 0xA5 ; 165 1ea72: 9d e0 ldi r25, 0x0D ; 13 1ea74: 0f 94 2a dc call 0x3b854 ; 0x3b854 if (nDiameter == nDiameter_um) 1ea78: 8c 17 cp r24, r28 1ea7a: 9d 07 cpc r25, r29 1ea7c: b9 f0 breq .+46 ; 0x1eaac // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN((float)(nDiameter_um/1000.0)); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN((float)(nDiameter/1000.0)); render_M862_warnings( 1ea7e: 83 e8 ldi r24, 0x83 ; 131 1ea80: 9a e4 ldi r25, 0x4A ; 74 1ea82: 0e 94 ac 72 call 0xe558 ; 0xe558 1ea86: ec 01 movw r28, r24 1ea88: 8e e4 ldi r24, 0x4E ; 78 1ea8a: 9a e4 ldi r25, 0x4A ; 74 1ea8c: 0e 94 ac 72 call 0xe558 ; 0xe558 1ea90: 41 2f mov r20, r17 1ea92: be 01 movw r22, r28 1ea94: 0e 94 f1 f4 call 0x1e9e2 ; 0x1e9e2 ,_T(MSG_NOZZLE_DIFFERS_CANCELLED) ,(uint8_t)oCheckMode ); if (!farm_mode) { bSettings = false; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function 1ea98: 10 92 fc 03 sts 0x03FC, r1 ; 0x8003fc menu_submenu(lcd_hw_setup_menu); 1ea9c: 60 e0 ldi r22, 0x00 ; 0 1ea9e: 8a eb ldi r24, 0xBA ; 186 1eaa0: 91 ed ldi r25, 0xD1 ; 209 } } 1eaa2: df 91 pop r29 1eaa4: cf 91 pop r28 1eaa6: 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); 1eaa8: 0d 94 03 d3 jmp 0x3a606 ; 0x3a606 } } 1eaac: df 91 pop r29 1eaae: cf 91 pop r28 1eab0: 1f 91 pop r17 1eab2: 08 95 ret 0001eab4 : } /// @brief Set print fan speed /// @param speed ranges from 0 to 255 static void lcd_selftest_setfan(const uint8_t speed) { fanSpeed = speed; 1eab4: 80 93 e7 03 sts 0x03E7, r24 ; 0x8003e7 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = speed; 1eab8: 80 93 a6 04 sts 0x04A6, r24 ; 0x8004a6 #endif manage_heater(); 1eabc: 0d 94 5c 38 jmp 0x270b8 ; 0x270b8 0001eac0 : { (void)lcd_selftest(); } bool lcd_selftest() { 1eac0: cf 92 push r12 1eac2: df 92 push r13 1eac4: ef 92 push r14 1eac6: ff 92 push r15 1eac8: 0f 93 push r16 1eaca: 1f 93 push r17 1eacc: cf 93 push r28 1eace: df 93 push r29 1ead0: 00 d0 rcall .+0 ; 0x1ead2 1ead2: 1f 92 push r1 1ead4: cd b7 in r28, 0x3d ; 61 1ead6: 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(); 1ead8: 0f 94 18 2f call 0x25e30 ; 0x25e30 uint8_t fanSpeedBckp = fanSpeed; 1eadc: d0 90 e7 03 lds r13, 0x03E7 ; 0x8003e7 fanSpeed = 255; 1eae0: 8f ef ldi r24, 0xFF ; 255 1eae2: 80 93 e7 03 sts 0x03E7, r24 ; 0x8003e7 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)); 1eae6: 83 e6 ldi r24, 0x63 ; 99 1eae8: e8 2e mov r14, r24 1eaea: 8a e8 ldi r24, 0x8A ; 138 1eaec: 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()); 1eaee: 0d e5 ldi r16, 0x5D ; 93 1eaf0: 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)) { 1eaf2: 20 e0 ldi r18, 0x00 ; 0 1eaf4: 30 e0 ldi r19, 0x00 ; 0 1eaf6: 48 e4 ldi r20, 0x48 ; 72 1eaf8: 52 e4 ldi r21, 0x42 ; 66 1eafa: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 1eafe: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 1eb02: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 1eb06: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 1eb0a: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 1eb0e: 18 16 cp r1, r24 1eb10: 8c f0 brlt .+34 ; 0x1eb34 1eb12: 20 e0 ldi r18, 0x00 ; 0 1eb14: 30 e0 ldi r19, 0x00 ; 0 1eb16: 48 e4 ldi r20, 0x48 ; 72 1eb18: 52 e4 ldi r21, 0x42 ; 66 1eb1a: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee 1eb1e: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef 1eb22: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 1eb26: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 1eb2a: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 1eb2e: 18 16 cp r1, r24 1eb30: 0c f0 brlt .+2 ; 0x1eb34 1eb32: 42 c0 rjmp .+132 ; 0x1ebb8 lcd_display_message_fullscreen_P(_T(MSG_WAITING_TEMP)); 1eb34: 8f ea ldi r24, 0xAF ; 175 1eb36: 98 e4 ldi r25, 0x48 ; 72 1eb38: 0e 94 ac 72 call 0xe558 ; 0xe558 1eb3c: 0f 94 e4 1f call 0x23fc8 ; 0x23fc8 lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 1eb40: 42 e8 ldi r20, 0x82 ; 130 1eb42: 64 e0 ldi r22, 0x04 ; 4 1eb44: 80 e0 ldi r24, 0x00 ; 0 1eb46: 0e 94 00 6f call 0xde00 ; 0xde00 lcd_printf_P(PSTR("%3d/0"), (int16_t)degHotend(0)); 1eb4a: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 1eb4e: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 1eb52: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 1eb56: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 1eb5a: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> 1eb5e: 7f 93 push r23 1eb60: 6f 93 push r22 1eb62: ff 92 push r15 1eb64: ef 92 push r14 1eb66: 0e 94 b9 6e call 0xdd72 ; 0xdd72 lcd_putc(LCD_STR_DEGREE[0]); 1eb6a: 81 e8 ldi r24, 0x81 ; 129 1eb6c: 0e 94 cf 6e call 0xdd9e ; 0xdd9e lcd_putc_at(9, 4, LCD_STR_BEDTEMP[0]); 1eb70: 40 e8 ldi r20, 0x80 ; 128 1eb72: 64 e0 ldi r22, 0x04 ; 4 1eb74: 89 e0 ldi r24, 0x09 ; 9 1eb76: 0e 94 00 6f call 0xde00 ; 0xde00 lcd_printf_P(PSTR("%3d/0"), (int16_t)degBed()); 1eb7a: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee 1eb7e: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef 1eb82: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 1eb86: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 1eb8a: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> 1eb8e: 7f 93 push r23 1eb90: 6f 93 push r22 1eb92: 1f 93 push r17 1eb94: 0f 93 push r16 1eb96: 0e 94 b9 6e call 0xdd72 ; 0xdd72 lcd_putc(LCD_STR_DEGREE[0]); 1eb9a: 81 e8 ldi r24, 0x81 ; 129 1eb9c: 0e 94 cf 6e call 0xdd9e ; 0xdd9e delay_keep_alive(1000); 1eba0: 88 ee ldi r24, 0xE8 ; 232 1eba2: 93 e0 ldi r25, 0x03 ; 3 1eba4: 0e 94 e4 8c call 0x119c8 ; 0x119c8 serialecho_temperatures(); 1eba8: 0e 94 5e 77 call 0xeebc ; 0xeebc 1ebac: 0f b6 in r0, 0x3f ; 63 1ebae: f8 94 cli 1ebb0: de bf out 0x3e, r29 ; 62 1ebb2: 0f be out 0x3f, r0 ; 63 1ebb4: cd bf out 0x3d, r28 ; 61 1ebb6: 9d cf rjmp .-198 ; 0x1eaf2 } fanSpeed = fanSpeedBckp; 1ebb8: d0 92 e7 03 sts 0x03E7, r13 ; 0x8003e7 lcd_update_enable(true); 1ebbc: 81 e0 ldi r24, 0x01 ; 1 1ebbe: 0e 94 25 6f call 0xde4a ; 0xde4a lcd_detect_IRsensor(); } } #endif lcd_wait_for_cool_down(); lcd_clear(); 1ebc2: 0e 94 13 6f call 0xde26 ; 0xde26 lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_START)); 1ebc6: 82 ee ldi r24, 0xE2 ; 226 1ebc8: 98 e4 ldi r25, 0x48 ; 72 1ebca: 0e 94 ac 72 call 0xe558 ; 0xe558 1ebce: ac 01 movw r20, r24 1ebd0: 60 e0 ldi r22, 0x00 ; 0 1ebd2: 80 e0 ldi r24, 0x00 ; 0 1ebd4: 0e 94 f4 6e call 0xdde8 ; 0xdde8 #ifdef TMC2130 FORCE_HIGH_POWER_START; 1ebd8: 81 e0 ldi r24, 0x01 ; 1 1ebda: 0e 94 b0 66 call 0xcd60 ; 0xcd60 #endif // TMC2130 FORCE_BL_ON_START; 1ebde: 81 e0 ldi r24, 0x01 ; 1 1ebe0: 0e 94 49 8a call 0x11492 ; 0x11492 _delay(2000); 1ebe4: 60 ed ldi r22, 0xD0 ; 208 1ebe6: 77 e0 ldi r23, 0x07 ; 7 1ebe8: 80 e0 ldi r24, 0x00 ; 0 1ebea: 90 e0 ldi r25, 0x00 ; 0 1ebec: 0f 94 53 27 call 0x24ea6 ; 0x24ea6 KEEPALIVE_STATE(IN_HANDLER); 1ebf0: 82 e0 ldi r24, 0x02 ; 2 1ebf2: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be _progress = lcd_selftest_screen(TestScreen::ExtruderFan, _progress, 3, true, 2000); 1ebf6: 00 ed ldi r16, 0xD0 ; 208 1ebf8: 17 e0 ldi r17, 0x07 ; 7 1ebfa: 21 e0 ldi r18, 0x01 ; 1 1ebfc: 43 e0 ldi r20, 0x03 ; 3 1ebfe: 60 e0 ldi r22, 0x00 ; 0 1ec00: 80 e0 ldi r24, 0x00 ; 0 1ec02: 0e 94 79 da call 0x1b4f2 ; 0x1b4f2 1ec06: 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 1ec08: 83 e0 ldi r24, 0x03 ; 3 1ec0a: 0e 94 5b 75 call 0xeab6 ; 0xeab6 lcd_selftest_setfan(0); // print fan off 1ec0e: 80 e0 ldi r24, 0x00 ; 0 1ec10: 0e 94 5a f5 call 0x1eab4 ; 0x1eab4 lcd_selftest_measure_fans(2, 18, 2); 1ec14: 62 e0 ldi r22, 0x02 ; 2 1ec16: 82 e0 ldi r24, 0x02 ; 2 1ec18: 0f 94 e9 a0 call 0x341d2 ; 0x341d2 setExtruderAutoFanState(0); // hotend fan off 1ec1c: 80 e0 ldi r24, 0x00 ; 0 1ec1e: 0e 94 5b 75 call 0xeab6 ; 0xeab6 if (fan_speed[0] < failThr) { 1ec22: c0 90 c9 03 lds r12, 0x03C9 ; 0x8003c9 1ec26: d0 90 ca 03 lds r13, 0x03CA ; 0x8003ca 1ec2a: 94 e1 ldi r25, 0x14 ; 20 1ec2c: c9 16 cp r12, r25 1ec2e: d1 04 cpc r13, r1 1ec30: 5c f1 brlt .+86 ; 0x1ec88 lcd_selftest_error(TestError::ExtruderFan, "", ""); } if (_result) { _progress = lcd_selftest_screen(TestScreen::PrintFan, _progress, 3, true, 2000); 1ec32: 21 e0 ldi r18, 0x01 ; 1 1ec34: 43 e0 ldi r20, 0x03 ; 3 1ec36: 6f 2d mov r22, r15 1ec38: 81 e0 ldi r24, 0x01 ; 1 1ec3a: 0e 94 79 da call 0x1b4f2 ; 0x1b4f2 1ec3e: f8 2e mov r15, r24 return FanCheck::SwappedFan; } break; case 1: lcd_selftest_setfan(255); 1ec40: 8f ef ldi r24, 0xFF ; 255 1ec42: 0e 94 5a f5 call 0x1eab4 ; 0x1eab4 lcd_selftest_measure_fans(5, 18, 3); 1ec46: 63 e0 ldi r22, 0x03 ; 3 1ec48: 85 e0 ldi r24, 0x05 ; 5 1ec4a: 0f 94 e9 a0 call 0x341d2 ; 0x341d2 lcd_selftest_setfan(0); 1ec4e: 80 e0 ldi r24, 0x00 ; 0 1ec50: 0e 94 5a f5 call 0x1eab4 ; 0x1eab4 if (fan_speed[1] < failThr) { 1ec54: 80 91 cb 03 lds r24, 0x03CB ; 0x8003cb 1ec58: 90 91 cc 03 lds r25, 0x03CC ; 0x8003cc 1ec5c: 84 31 cpi r24, 0x14 ; 20 1ec5e: 91 05 cpc r25, r1 1ec60: cc f4 brge .+50 ; 0x1ec94 #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 1ec62: 68 ef ldi r22, 0xF8 ; 248 1ec64: 72 e0 ldi r23, 0x02 ; 2 1ec66: 85 e0 ldi r24, 0x05 ; 5 1ec68: 0f 94 6e 9f call 0x33edc ; 0x33edc } } if (_swapped_fan) { 1ec6c: 96 e4 ldi r25, 0x46 ; 70 1ec6e: c9 16 cp r12, r25 1ec70: d1 04 cpc r13, r1 1ec72: 9c f4 brge .+38 ; 0x1ec9a { _progress = lcd_selftest_screen(TestScreen::AllCorrect, _progress, 3, true, 5000); //all correct } else { _progress = lcd_selftest_screen(TestScreen::Failed, _progress, 3, true, 5000); 1ec74: 08 e8 ldi r16, 0x88 ; 136 1ec76: 13 e1 ldi r17, 0x13 ; 19 1ec78: 21 e0 ldi r18, 0x01 ; 1 1ec7a: 43 e0 ldi r20, 0x03 ; 3 1ec7c: 6f 2d mov r22, r15 1ec7e: 8d e0 ldi r24, 0x0D ; 13 1ec80: 0e 94 79 da call 0x1b4f2 ; 0x1b4f2 1ec84: e1 2c mov r14, r1 1ec86: 49 c1 rjmp .+658 ; 0x1ef1a #else //defined(TACH_0) _result = lcd_selftest_manual_fan_check(0, false); #endif //defined(TACH_0) if (!_result) { lcd_selftest_error(TestError::ExtruderFan, "", ""); 1ec88: 68 ef ldi r22, 0xF8 ; 248 1ec8a: 72 e0 ldi r23, 0x02 ; 2 1ec8c: 86 e0 ldi r24, 0x06 ; 6 lcd_selftest_error(TestError::PrintFan, "", ""); } } else { // fans are swapped lcd_selftest_error(TestError::SwappedFan, "", ""); 1ec8e: 0f 94 6e 9f call 0x33edc ; 0x33edc 1ec92: f0 cf rjmp .-32 ; 0x1ec74 lcd_selftest_measure_fans(5, 18, 3); lcd_selftest_setfan(0); if (fan_speed[1] < failThr) { return FanCheck::PrintFan; } if (fan_speed[1] < printFanThr) { 1ec94: 86 34 cpi r24, 0x46 ; 70 1ec96: 91 05 cpc r25, r1 1ec98: 54 f4 brge .+20 ; 0x1ecae } } if (_swapped_fan) { //turn on print fan and check that left hotend fan is not spinning _result = lcd_selftest_manual_fan_check(1, true); 1ec9a: 60 e0 ldi r22, 0x00 ; 0 1ec9c: 81 e0 ldi r24, 0x01 ; 1 1ec9e: 0f 94 5b a0 call 0x340b6 ; 0x340b6 if (_result) { 1eca2: 81 11 cpse r24, r1 1eca4: 68 c1 rjmp .+720 ; 0x1ef76 lcd_selftest_error(TestError::PrintFan, "", ""); } } else { // fans are swapped lcd_selftest_error(TestError::SwappedFan, "", ""); 1eca6: 68 ef ldi r22, 0xF8 ; 248 1eca8: 72 e0 ldi r23, 0x02 ; 2 1ecaa: 89 e0 ldi r24, 0x09 ; 9 1ecac: f0 cf rjmp .-32 ; 0x1ec8e { lcd_selftest_error(TestError::PrintFan, "", ""); //print fan not spinning } } if (_swapped_fan) { 1ecae: 86 e4 ldi r24, 0x46 ; 70 1ecb0: c8 16 cp r12, r24 1ecb2: d1 04 cpc r13, r1 1ecb4: 94 f7 brge .-28 ; 0x1ec9a } } if (_result) { _progress = lcd_selftest_screen(TestScreen::FansOk, _progress, 3, true, 2000); 1ecb6: 00 ed ldi r16, 0xD0 ; 208 1ecb8: 17 e0 ldi r17, 0x07 ; 7 1ecba: 21 e0 ldi r18, 0x01 ; 1 1ecbc: 43 e0 ldi r20, 0x03 ; 3 1ecbe: 6f 2d mov r22, r15 1ecc0: 82 e0 ldi r24, 0x02 ; 2 1ecc2: 0e 94 79 da call 0x1b4f2 ; 0x1b4f2 1ecc6: f8 2e mov r15, r24 static bool lcd_selfcheck_endstops() { bool _result = true; if ( 1ecc8: 1c 9b sbis 0x03, 4 ; 3 1ecca: 18 c0 rjmp .+48 ; 0x1ecfc { #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; 1eccc: 1c 9b sbis 0x03, 4 ; 3 1ecce: 16 c0 rjmp .+44 ; 0x1ecfc 1ecd0: 20 e0 ldi r18, 0x00 ; 0 1ecd2: 30 e0 ldi r19, 0x00 ; 0 1ecd4: 40 e2 ldi r20, 0x20 ; 32 1ecd6: 51 e4 ldi r21, 0x41 ; 65 1ecd8: 60 91 9a 06 lds r22, 0x069A ; 0x80069a 1ecdc: 70 91 9b 06 lds r23, 0x069B ; 0x80069b 1ece0: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 1ece4: 90 91 9d 06 lds r25, 0x069D ; 0x80069d 1ece8: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 1ecec: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a 1ecf0: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b 1ecf4: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c 1ecf8: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d } plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1ecfc: 60 e0 ldi r22, 0x00 ; 0 1ecfe: 70 e0 ldi r23, 0x00 ; 0 1ed00: 84 e3 ldi r24, 0x34 ; 52 1ed02: 92 e4 ldi r25, 0x42 ; 66 1ed04: 0f 94 49 c0 call 0x38092 ; 0x38092 st_synchronize(); 1ed08: 0f 94 e8 42 call 0x285d0 ; 0x285d0 if ( 1ed0c: 1c 9b sbis 0x03, 4 ; 3 1ed0e: 3d c1 rjmp .+634 ; 0x1ef8a ((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] = ""; 1ed10: 1a 82 std Y+2, r1 ; 0x02 1ed12: 19 82 std Y+1, r1 ; 0x01 1ed14: 1c 82 std Y+4, r1 ; 0x04 1ed16: 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"); 1ed18: 1c 9b sbis 0x03, 4 ; 3 1ed1a: 06 c0 rjmp .+12 ; 0x1ed28 1ed1c: 65 ee ldi r22, 0xE5 ; 229 1ed1e: 72 e0 ldi r23, 0x02 ; 2 1ed20: ce 01 movw r24, r28 1ed22: 01 96 adiw r24, 0x01 ; 1 1ed24: 0f 94 68 e2 call 0x3c4d0 ; 0x3c4d0 lcd_selftest_error(TestError::Endstops, _error, ""); 1ed28: be 01 movw r22, r28 1ed2a: 6f 5f subi r22, 0xFF ; 255 1ed2c: 7f 4f sbci r23, 0xFF ; 255 1ed2e: 82 e0 ldi r24, 0x02 ; 2 1ed30: 0f 94 6e 9f call 0x33edc ; 0x33edc ((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; 1ed34: 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(); 1ed36: 0f 94 5c 38 call 0x270b8 ; 0x270b8 manage_inactivity(true); 1ed3a: 81 e0 ldi r24, 0x01 ; 1 1ed3c: 0e 94 af 8a call 0x1155e ; 0x1155e { _progress = lcd_selftest_screen(TestScreen::FansOk, _progress, 3, true, 2000); _result = lcd_selfcheck_endstops(); //With TMC2130, only the Z probe is tested. } if (_result) 1ed40: 11 23 and r17, r17 1ed42: 09 f4 brne .+2 ; 0x1ed46 1ed44: 97 cf rjmp .-210 ; 0x1ec74 { //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); 1ed46: 00 ed ldi r16, 0xD0 ; 208 1ed48: 17 e0 ldi r17, 0x07 ; 7 1ed4a: 21 e0 ldi r18, 0x01 ; 1 1ed4c: 43 e0 ldi r20, 0x03 ; 3 1ed4e: 6f 2d mov r22, r15 1ed50: 84 e0 ldi r24, 0x04 ; 4 1ed52: 0e 94 79 da call 0x1b4f2 ; 0x1b4f2 1ed56: f8 2e mov r15, r24 #ifdef TMC2130 _result = lcd_selfcheck_axis_sg(X_AXIS); 1ed58: 80 e0 ldi r24, 0x00 ; 0 1ed5a: 0e 94 33 dd call 0x1ba66 ; 0x1ba66 } if (_result) 1ed5e: 88 23 and r24, r24 1ed60: 09 f4 brne .+2 ; 0x1ed64 1ed62: 88 cf rjmp .-240 ; 0x1ec74 { _progress = lcd_selftest_screen(TestScreen::AxisX, _progress, 3, true, 0); 1ed64: 10 e0 ldi r17, 0x00 ; 0 1ed66: 00 e0 ldi r16, 0x00 ; 0 1ed68: 21 e0 ldi r18, 0x01 ; 1 1ed6a: 43 e0 ldi r20, 0x03 ; 3 1ed6c: 6f 2d mov r22, r15 1ed6e: 84 e0 ldi r24, 0x04 ; 4 1ed70: 0e 94 79 da call 0x1b4f2 ; 0x1b4f2 } if (_result) { _progress = lcd_selftest_screen(TestScreen::AxisY, _progress, 3, true, 1500); 1ed74: 0c ed ldi r16, 0xDC ; 220 1ed76: 15 e0 ldi r17, 0x05 ; 5 1ed78: 21 e0 ldi r18, 0x01 ; 1 1ed7a: 43 e0 ldi r20, 0x03 ; 3 1ed7c: 68 2f mov r22, r24 1ed7e: 85 e0 ldi r24, 0x05 ; 5 1ed80: 0e 94 79 da call 0x1b4f2 ; 0x1b4f2 1ed84: f8 2e mov r15, r24 #ifdef TMC2130 _result = lcd_selfcheck_axis_sg(Y_AXIS); 1ed86: 81 e0 ldi r24, 0x01 ; 1 1ed88: 0e 94 33 dd call 0x1ba66 ; 0x1ba66 #else _result = lcd_selfcheck_axis(Y_AXIS, Y_MAX_POS); #endif // TMC2130 } if (_result) 1ed8c: 88 23 and r24, r24 1ed8e: 09 f4 brne .+2 ; 0x1ed92 1ed90: 71 cf rjmp .-286 ; 0x1ec74 { _progress = lcd_selftest_screen(TestScreen::AxisZ, _progress, 3, true, 0); 1ed92: 10 e0 ldi r17, 0x00 ; 0 1ed94: 00 e0 ldi r16, 0x00 ; 0 1ed96: 21 e0 ldi r18, 0x01 ; 1 1ed98: 43 e0 ldi r20, 0x03 ; 3 1ed9a: 6f 2d mov r22, r15 1ed9c: 86 e0 ldi r24, 0x06 ; 6 1ed9e: 0e 94 79 da call 0x1b4f2 ; 0x1b4f2 1eda2: f8 2e mov r15, r24 if (_result) { #ifdef TMC2130 tmc2130_home_exit(); 1eda4: 0f 94 a9 25 call 0x24b52 ; 0x24b52 1eda8: 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); 1edac: ea ed ldi r30, 0xDA ; 218 1edae: f5 ea ldi r31, 0xA5 ; 165 1edb0: 85 91 lpm r24, Z+ 1edb2: 95 91 lpm r25, Z+ 1edb4: a5 91 lpm r26, Z+ 1edb6: b4 91 lpm r27, Z 1edb8: 80 93 92 06 sts 0x0692, r24 ; 0x800692 1edbc: 90 93 93 06 sts 0x0693, r25 ; 0x800693 1edc0: a0 93 94 06 sts 0x0694, r26 ; 0x800694 1edc4: b0 93 95 06 sts 0x0695, r27 ; 0x800695 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4+1); 1edc8: ee ed ldi r30, 0xDE ; 222 1edca: f5 ea ldi r31, 0xA5 ; 165 1edcc: 65 91 lpm r22, Z+ 1edce: 75 91 lpm r23, Z+ 1edd0: 85 91 lpm r24, Z+ 1edd2: 94 91 lpm r25, Z #ifdef TMC2130 //current_position[X_AXIS] += 0; current_position[Y_AXIS] += 4; 1edd4: 20 e0 ldi r18, 0x00 ; 0 1edd6: 30 e0 ldi r19, 0x00 ; 0 1edd8: 40 e8 ldi r20, 0x80 ; 128 1edda: 50 e4 ldi r21, 0x40 ; 64 1eddc: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 1ede0: 60 93 96 06 sts 0x0696, r22 ; 0x800696 1ede4: 70 93 97 06 sts 0x0697, r23 ; 0x800697 1ede8: 80 93 98 06 sts 0x0698, r24 ; 0x800698 1edec: 90 93 99 06 sts 0x0699, r25 ; 0x800699 #endif //TMC2130 raise_z(10); 1edf0: 60 e0 ldi r22, 0x00 ; 0 1edf2: 70 e0 ldi r23, 0x00 ; 0 1edf4: 80 e2 ldi r24, 0x20 ; 32 1edf6: 91 e4 ldi r25, 0x41 ; 65 1edf8: 0e 94 e1 6d call 0xdbc2 ; 0xdbc2 set_destination_to_current(); 1edfc: 0e 94 3a 68 call 0xd074 ; 0xd074 _progress = lcd_selftest_screen(TestScreen::AxisZ, _progress, 3, true, 1500); 1ee00: 0c ed ldi r16, 0xDC ; 220 1ee02: 15 e0 ldi r17, 0x05 ; 5 1ee04: 21 e0 ldi r18, 0x01 ; 1 1ee06: 43 e0 ldi r20, 0x03 ; 3 1ee08: 6f 2d mov r22, r15 1ee0a: 86 e0 ldi r24, 0x06 ; 6 1ee0c: 0e 94 79 da call 0x1b4f2 ; 0x1b4f2 #ifdef TMC2130 homeaxis(Z_AXIS); //In case of failure, the code gets stuck in this function. 1ee10: 50 e0 ldi r21, 0x00 ; 0 1ee12: 40 e0 ldi r20, 0x00 ; 0 1ee14: 61 e0 ldi r22, 0x01 ; 1 1ee16: 82 e0 ldi r24, 0x02 ; 2 1ee18: 0e 94 6b 7a call 0xf4d6 ; 0xf4d6 #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); 1ee1c: 60 e0 ldi r22, 0x00 ; 0 1ee1e: 70 e0 ldi r23, 0x00 ; 0 1ee20: 80 ea ldi r24, 0xA0 ; 160 1ee22: 91 e4 ldi r25, 0x41 ; 65 1ee24: 0e 94 e1 6d call 0xdbc2 ; 0xdbc2 } #ifdef TMC2130 if (_result) { raise_z(10); 1ee28: 60 e0 ldi r22, 0x00 ; 0 1ee2a: 70 e0 ldi r23, 0x00 ; 0 1ee2c: 80 e2 ldi r24, 0x20 ; 32 1ee2e: 91 e4 ldi r25, 0x41 ; 65 1ee30: 0e 94 e1 6d call 0xdbc2 ; 0xdbc2 _progress = lcd_selftest_screen(TestScreen::Home, 0, 2, true, 0); 1ee34: 10 e0 ldi r17, 0x00 ; 0 1ee36: 00 e0 ldi r16, 0x00 ; 0 1ee38: 21 e0 ldi r18, 0x01 ; 1 1ee3a: 42 e0 ldi r20, 0x02 ; 2 1ee3c: 60 e0 ldi r22, 0x00 ; 0 1ee3e: 8e e0 ldi r24, 0x0E ; 14 1ee40: 0e 94 79 da call 0x1b4f2 ; 0x1b4f2 bool bres = tmc2130_home_calibrate(X_AXIS); 1ee44: 80 e0 ldi r24, 0x00 ; 0 1ee46: 0f 94 9b 22 call 0x24536 ; 0x24536 1ee4a: e8 2e mov r14, r24 _progress = lcd_selftest_screen(TestScreen::Home, 1, 2, true, 0); 1ee4c: 21 e0 ldi r18, 0x01 ; 1 1ee4e: 42 e0 ldi r20, 0x02 ; 2 1ee50: 61 e0 ldi r22, 0x01 ; 1 1ee52: 8e e0 ldi r24, 0x0E ; 14 1ee54: 0e 94 79 da call 0x1b4f2 ; 0x1b4f2 bres &= tmc2130_home_calibrate(Y_AXIS); 1ee58: 81 e0 ldi r24, 0x01 ; 1 1ee5a: 0f 94 9b 22 call 0x24536 ; 0x24536 1ee5e: e8 22 and r14, r24 _progress = lcd_selftest_screen(TestScreen::Home, 2, 2, true, 0); 1ee60: 21 e0 ldi r18, 0x01 ; 1 1ee62: 42 e0 ldi r20, 0x02 ; 2 1ee64: 62 e0 ldi r22, 0x02 ; 2 1ee66: 8e e0 ldi r24, 0x0E ; 14 1ee68: 0e 94 79 da call 0x1b4f2 ; 0x1b4f2 1ee6c: f8 2e mov r15, r24 if (bres) 1ee6e: ee 20 and r14, r14 1ee70: 09 f4 brne .+2 ; 0x1ee74 1ee72: 00 cf rjmp .-512 ; 0x1ec74 1ee74: 61 e0 ldi r22, 0x01 ; 1 1ee76: 88 ef ldi r24, 0xF8 ; 248 1ee78: 9e e0 ldi r25, 0x0E ; 14 1ee7a: 0f 94 40 dc call 0x3b880 ; 0x3b880 } #endif //TMC2130 if (_result) { _progress = lcd_selftest_screen(TestScreen::Bed, _progress, 3, true, 2000); 1ee7e: 00 ed ldi r16, 0xD0 ; 208 1ee80: 17 e0 ldi r17, 0x07 ; 7 1ee82: 21 e0 ldi r18, 0x01 ; 1 1ee84: 43 e0 ldi r20, 0x03 ; 3 1ee86: 6f 2d mov r22, r15 1ee88: 87 e0 ldi r24, 0x07 ; 7 1ee8a: 0e 94 79 da call 0x1b4f2 ; 0x1b4f2 1ee8e: f8 2e mov r15, r24 _result = lcd_selfcheck_check_heater(true); 1ee90: 81 e0 ldi r24, 0x01 ; 1 1ee92: 0e 94 13 dc call 0x1b826 ; 0x1b826 } if (_result) 1ee96: 88 23 and r24, r24 1ee98: 09 f4 brne .+2 ; 0x1ee9c 1ee9a: ec ce rjmp .-552 ; 0x1ec74 { _progress = lcd_selftest_screen(TestScreen::Hotend, _progress, 3, true, 1000); 1ee9c: 08 ee ldi r16, 0xE8 ; 232 1ee9e: 13 e0 ldi r17, 0x03 ; 3 1eea0: 21 e0 ldi r18, 0x01 ; 1 1eea2: 43 e0 ldi r20, 0x03 ; 3 1eea4: 6f 2d mov r22, r15 1eea6: 88 e0 ldi r24, 0x08 ; 8 1eea8: 0e 94 79 da call 0x1b4f2 ; 0x1b4f2 1eeac: f8 2e mov r15, r24 _result = lcd_selfcheck_check_heater(false); 1eeae: 80 e0 ldi r24, 0x00 ; 0 1eeb0: 0e 94 13 dc call 0x1b826 ; 0x1b826 1eeb4: e8 2e mov r14, r24 } if (_result) 1eeb6: 88 23 and r24, r24 1eeb8: 09 f4 brne .+2 ; 0x1eebc 1eeba: dc ce rjmp .-584 ; 0x1ec74 { _progress = lcd_selftest_screen(TestScreen::HotendOk, _progress, 3, true, 2000); //nozzle ok 1eebc: 00 ed ldi r16, 0xD0 ; 208 1eebe: 17 e0 ldi r17, 0x07 ; 7 1eec0: 21 e0 ldi r18, 0x01 ; 1 1eec2: 43 e0 ldi r20, 0x03 ; 3 1eec4: 6f 2d mov r22, r15 1eec6: 89 e0 ldi r24, 0x09 ; 9 1eec8: 0e 94 79 da call 0x1b4f2 ; 0x1b4f2 } } 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 1eecc: 21 e0 ldi r18, 0x01 ; 1 1eece: 43 e0 ldi r20, 0x03 ; 3 1eed0: 68 2f mov r22, r24 1eed2: 8a e0 ldi r24, 0x0A ; 10 1eed4: 0e 94 79 da call 0x1b4f2 ; 0x1b4f2 1eed8: f8 2e mov r15, r24 #ifdef FILAMENT_SENSOR #if FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125 static bool lcd_selftest_fsensor(void) { fsensor.init(); 1eeda: 0f 94 39 7b call 0x2f672 ; 0x2f672 if (fsensor.isError()) 1eede: 80 91 aa 17 lds r24, 0x17AA ; 0x8017aa 1eee2: 83 30 cpi r24, 0x03 ; 3 1eee4: 29 f4 brne .+10 ; 0x1eef0 { lcd_selftest_error(TestError::WiringFsensor, "", ""); 1eee6: 68 ef ldi r22, 0xF8 ; 248 1eee8: 72 e0 ldi r23, 0x02 ; 2 1eeea: 8a e0 ldi r24, 0x0A ; 10 1eeec: 0f 94 6e 9f call 0x33edc ; 0x33edc #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) 1eef0: 80 91 aa 17 lds r24, 0x17AA ; 0x8017aa 1eef4: 83 30 cpi r24, 0x03 ; 3 1eef6: 09 f4 brne .+2 ; 0x1eefa 1eef8: bd ce rjmp .-646 ; 0x1ec74 { _progress = lcd_selftest_screen(TestScreen::FsensorOk, _progress, 3, true, 2000); //fil sensor OK 1eefa: 00 ed ldi r16, 0xD0 ; 208 1eefc: 17 e0 ldi r17, 0x07 ; 7 1eefe: 21 e0 ldi r18, 0x01 ; 1 1ef00: 43 e0 ldi r20, 0x03 ; 3 1ef02: 6f 2d mov r22, r15 1ef04: 8b e0 ldi r24, 0x0B ; 11 1ef06: 0e 94 79 da call 0x1b4f2 ; 0x1b4f2 } } #endif //FILAMENT_SENSOR if (_result) { _progress = lcd_selftest_screen(TestScreen::AllCorrect, _progress, 3, true, 5000); //all correct 1ef0a: 08 e8 ldi r16, 0x88 ; 136 1ef0c: 13 e1 ldi r17, 0x13 ; 19 1ef0e: 21 e0 ldi r18, 0x01 ; 1 1ef10: 43 e0 ldi r20, 0x03 ; 3 1ef12: 68 2f mov r22, r24 1ef14: 8c e0 ldi r24, 0x0C ; 12 1ef16: 0e 94 79 da call 0x1b4f2 ; 0x1b4f2 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 1ef1a: 10 92 d5 03 sts 0x03D5, r1 ; 0x8003d5 <_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); 1ef1e: 61 e0 ldi r22, 0x01 ; 1 1ef20: 87 ed ldi r24, 0xD7 ; 215 1ef22: 9b e6 ldi r25, 0x6B ; 107 1ef24: 0e 94 20 88 call 0x11040 ; 0x11040 lcd_update_enable(true); 1ef28: 81 e0 ldi r24, 0x01 ; 1 1ef2a: 0e 94 25 6f call 0xde4a ; 0xde4a if (_result) 1ef2e: ee 20 and r14, r14 1ef30: 71 f1 breq .+92 ; 0x1ef8e { calibration_status_set(CALIBRATION_STATUS_SELFTEST); 1ef32: 81 e0 ldi r24, 0x01 ; 1 1ef34: 0e 94 92 ee call 0x1dd24 ; 0x1dd24 lcd_setstatuspgm(_T(MSG_SELFTEST_OK)); 1ef38: 84 ed ldi r24, 0xD4 ; 212 1ef3a: 98 e4 ldi r25, 0x48 ; 72 1ef3c: 0e 94 ac 72 call 0xe558 ; 0xe558 1ef40: 0e 94 5d f1 call 0x1e2ba ; 0x1e2ba lcd_return_to_status(); 1ef44: 0f 94 a6 1e call 0x23d4c ; 0x23d4c else { LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); } #ifdef TMC2130 FORCE_HIGH_POWER_END; 1ef48: 80 e0 ldi r24, 0x00 ; 0 1ef4a: 0e 94 b0 66 call 0xcd60 ; 0xcd60 #endif // TMC2130 FORCE_BL_ON_END; 1ef4e: 80 e0 ldi r24, 0x00 ; 0 1ef50: 0e 94 49 8a call 0x11492 ; 0x11492 KEEPALIVE_STATE(NOT_BUSY); 1ef54: 81 e0 ldi r24, 0x01 ; 1 1ef56: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be return(_result); } 1ef5a: 8e 2d mov r24, r14 1ef5c: 0f 90 pop r0 1ef5e: 0f 90 pop r0 1ef60: 0f 90 pop r0 1ef62: 0f 90 pop r0 1ef64: df 91 pop r29 1ef66: cf 91 pop r28 1ef68: 1f 91 pop r17 1ef6a: 0f 91 pop r16 1ef6c: ff 90 pop r15 1ef6e: ef 90 pop r14 1ef70: df 90 pop r13 1ef72: cf 90 pop r12 1ef74: 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); 1ef76: 61 e0 ldi r22, 0x01 ; 1 1ef78: 80 e0 ldi r24, 0x00 ; 0 1ef7a: 0f 94 5b a0 call 0x340b6 ; 0x340b6 if (!_result){ 1ef7e: 81 11 cpse r24, r1 1ef80: 9a ce rjmp .-716 ; 0x1ecb6 lcd_selftest_error(TestError::PrintFan, "", ""); 1ef82: 68 ef ldi r22, 0xF8 ; 248 1ef84: 72 e0 ldi r23, 0x02 ; 2 1ef86: 85 e0 ldi r24, 0x05 ; 5 1ef88: 82 ce rjmp .-764 ; 0x1ec8e #endif //not defined TMC2130 static bool lcd_selfcheck_endstops() { bool _result = true; 1ef8a: 11 e0 ldi r17, 0x01 ; 1 1ef8c: d4 ce rjmp .-600 ; 0x1ed36 lcd_setstatuspgm(_T(MSG_SELFTEST_OK)); lcd_return_to_status(); } else { LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); 1ef8e: 87 ea ldi r24, 0xA7 ; 167 1ef90: 96 e5 ldi r25, 0x56 ; 86 1ef92: 0e 94 ac 72 call 0xe558 ; 0xe558 1ef96: 62 e0 ldi r22, 0x02 ; 2 1ef98: 0e 94 1d f1 call 0x1e23a ; 0x1e23a 1ef9c: d5 cf rjmp .-86 ; 0x1ef48 0001ef9e : } #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) static void lcd_selftest_v() { (void)lcd_selftest(); 1ef9e: 0c 94 60 f5 jmp 0x1eac0 ; 0x1eac0 0001efa2 : return 0; } bool resume_print_checks() { // reset the lcd status so that a newer error will be shown lcd_return_to_status(); 1efa2: 0f 94 a6 1e call 0x23d4c ; 0x23d4c lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 1efa6: 10 92 d5 03 sts 0x03D5, r1 ; 0x8003d5 <_ZL24lcd_status_message_level.lto_priv.451> temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; 1efaa: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_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() 1efae: 81 11 cpse r24, r1 1efb0: 32 c0 rjmp .+100 ; 0x1f016 } static bool fan_error_selftest() { #ifdef FANCHECK if (!fans_check_enabled) return 0; 1efb2: 80 91 38 02 lds r24, 0x0238 ; 0x800238 1efb6: 81 11 cpse r24, r1 1efb8: 02 c0 rjmp .+4 ; 0x1efbe #endif ) { return false; // abort if error persists } return true; 1efba: 81 e0 ldi r24, 0x01 ; 1 1efbc: 08 95 ret static bool fan_error_selftest() { #ifdef FANCHECK if (!fans_check_enabled) return 0; lcd_selftest_setfan(255); 1efbe: 8f ef ldi r24, 0xFF ; 255 1efc0: 0e 94 5a f5 call 0x1eab4 ; 0x1eab4 setExtruderAutoFanState(3); //force enables the hotend fan 1efc4: 83 e0 ldi r24, 0x03 ; 3 1efc6: 0e 94 5b 75 call 0xeab6 ; 0xeab6 #ifdef FAN_SOFT_PWM extruder_autofan_last_check = _millis(); 1efca: 0f 94 4c 29 call 0x25298 ; 0x25298 1efce: 60 93 c0 17 sts 0x17C0, r22 ; 0x8017c0 1efd2: 70 93 c1 17 sts 0x17C1, r23 ; 0x8017c1 1efd6: 80 93 c2 17 sts 0x17C2, r24 ; 0x8017c2 1efda: 90 93 c3 17 sts 0x17C3, r25 ; 0x8017c3 fan_measuring = true; 1efde: 81 e0 ldi r24, 0x01 ; 1 1efe0: 80 93 6f 06 sts 0x066F, r24 ; 0x80066f #endif //FAN_SOFT_PWM _delay(1000); //delay_keep_alive would turn off hotend fan, because temerature is too low (maybe) 1efe4: 68 ee ldi r22, 0xE8 ; 232 1efe6: 73 e0 ldi r23, 0x03 ; 3 1efe8: 80 e0 ldi r24, 0x00 ; 0 1efea: 90 e0 ldi r25, 0x00 ; 0 1efec: 0f 94 53 27 call 0x24ea6 ; 0x24ea6 manage_heater(); 1eff0: 0f 94 5c 38 call 0x270b8 ; 0x270b8 setExtruderAutoFanState(1); //releases lock on the hotend fan 1eff4: 81 e0 ldi r24, 0x01 ; 1 1eff6: 0e 94 5b 75 call 0xeab6 ; 0xeab6 lcd_selftest_setfan(0); 1effa: 80 e0 ldi r24, 0x00 ; 0 1effc: 0e 94 5a f5 call 0x1eab4 ; 0x1eab4 #ifdef TACH_0 if (fan_speed[0] <= 20) { //hotend fan error 1f000: 80 91 c9 03 lds r24, 0x03C9 ; 0x8003c9 1f004: 90 91 ca 03 lds r25, 0x03CA ; 0x8003ca 1f008: 45 97 sbiw r24, 0x15 ; 21 1f00a: 3c f4 brge .+14 ; 0x1f01a LCD_ALERTMESSAGERPGM(MSG_FANCHECK_HOTEND); 1f00c: 62 e0 ldi r22, 0x02 ; 2 1f00e: 82 ee ldi r24, 0xE2 ; 226 1f010: 9a e6 ldi r25, 0x6A ; 106 return 1; } #endif #ifdef TACH_1 if (fan_speed[1] <= 20) { //print fan error LCD_ALERTMESSAGERPGM(MSG_FANCHECK_PRINT); 1f012: 0e 94 1d f1 call 0x1e23a ; 0x1e23a if (get_temp_error() #ifdef FANCHECK || fan_error_selftest() #endif ) { return false; // abort if error persists 1f016: 80 e0 ldi r24, 0x00 ; 0 } return true; } 1f018: 08 95 ret LCD_ALERTMESSAGERPGM(MSG_FANCHECK_HOTEND); return 1; } #endif #ifdef TACH_1 if (fan_speed[1] <= 20) { //print fan error 1f01a: 80 91 cb 03 lds r24, 0x03CB ; 0x8003cb 1f01e: 90 91 cc 03 lds r25, 0x03CC ; 0x8003cc 1f022: 45 97 sbiw r24, 0x15 ; 21 1f024: 54 f6 brge .-108 ; 0x1efba LCD_ALERTMESSAGERPGM(MSG_FANCHECK_PRINT); 1f026: 62 e0 ldi r22, 0x02 ; 2 1f028: 8e ec ldi r24, 0xCE ; 206 1f02a: 9a e6 ldi r25, 0x6A ; 106 1f02c: f2 cf rjmp .-28 ; 0x1f012 0001f02e : //! @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; 1f02e: 0e 94 d1 f7 call 0x1efa2 ; 0x1efa2 1f032: 88 23 and r24, r24 1f034: 51 f1 breq .+84 ; 0x1f08a cmdqueue_serial_disabled = false; 1f036: 10 92 a6 03 sts 0x03A6, r1 ; 0x8003a6 lcd_setstatuspgm(_T(MSG_FINISHING_MOVEMENTS)); 1f03a: 8b e5 ldi r24, 0x5B ; 91 1f03c: 93 e5 ldi r25, 0x53 ; 83 1f03e: 0e 94 ac 72 call 0xe558 ; 0xe558 1f042: 0e 94 5d f1 call 0x1e2ba ; 0x1e2ba st_synchronize(); 1f046: 0f 94 e8 42 call 0x285d0 ; 0x285d0 custom_message_type = CustomMsg::Resuming; 1f04a: 88 e0 ldi r24, 0x08 ; 8 1f04c: 80 93 c4 06 sts 0x06C4, r24 ; 0x8006c4 { #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(); 1f050: 0e 94 e1 74 call 0xe9c2 ; 0xe9c2 setExtruderAutoFanState(1); 1f054: 81 e0 ldi r24, 0x01 ; 1 1f056: 0e 94 5b 75 call 0xeab6 ; 0xeab6 // resume processing USB commands again and restore hotend fan state (in case the print was // stopped due to a thermal error) hotendDefaultAutoFanState(); Stopped = false; 1f05a: 10 92 11 05 sts 0x0511, r1 ; 0x800511 restore_print_from_ram_and_continue(default_retraction); 1f05e: 60 e0 ldi r22, 0x00 ; 0 1f060: 70 e0 ldi r23, 0x00 ; 0 1f062: 80 e8 ldi r24, 0x80 ; 128 1f064: 9f e3 ldi r25, 0x3F ; 63 1f066: 0e 94 44 68 call 0xd088 ; 0xd088 did_pause_print = false; 1f06a: 10 92 e4 03 sts 0x03E4, r1 ; 0x8003e4 // Resume the print job timer if it was running if (print_job_timer.isPaused()) print_job_timer.start(); 1f06e: 80 91 9d 03 lds r24, 0x039D ; 0x80039d 1f072: 82 30 cpi r24, 0x02 ; 2 1f074: 11 f4 brne .+4 ; 0x1f07a 1f076: 0f 94 8d 42 call 0x2851a ; 0x2851a refresh_cmd_timeout(); 1f07a: 0e 94 c3 66 call 0xcd86 ; 0xcd86 SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_RESUMED); 1f07e: 87 ef ldi r24, 0xF7 ; 247 1f080: 9a e6 ldi r25, 0x6A ; 106 1f082: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 custom_message_type = CustomMsg::Status; 1f086: 10 92 c4 06 sts 0x06C4, r1 ; 0x8006c4 } 1f08a: 08 95 ret 0001f08c : //! @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; 1f08c: 0e 94 d1 f7 call 0x1efa2 ; 0x1efa2 1f090: 88 23 and r24, r24 1f092: 21 f0 breq .+8 ; 0x1f09c // resume the usb host SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_ASK_RESUME); 1f094: 88 e0 ldi r24, 0x08 ; 8 1f096: 9b e6 ldi r25, 0x6B ; 107 1f098: 0c 94 7b 79 jmp 0xf2f6 ; 0xf2f6 } 1f09c: 08 95 ret 0001f09e : } /// @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) { 1f09e: cf 92 push r12 1f0a0: df 92 push r13 1f0a2: ef 92 push r14 1f0a4: ff 92 push r15 1f0a6: cf 93 push r28 1f0a8: 6b 01 movw r12, r22 1f0aa: 7c 01 movw r14, r24 custom_message_type = CustomMsg::FilamentLoading; 1f0ac: 82 e0 ldi r24, 0x02 ; 2 1f0ae: 80 93 c4 06 sts 0x06C4, r24 ; 0x8006c4 lcd_setstatuspgm(_T(MSG_UNLOADING_FILAMENT)); 1f0b2: 8e ef ldi r24, 0xFE ; 254 1f0b4: 92 e5 ldi r25, 0x52 ; 82 1f0b6: 0e 94 ac 72 call 0xe558 ; 0xe558 1f0ba: 0e 94 5d f1 call 0x1e2ba ; 0x1e2ba FSensorBlockRunout fsBlockRunout; 1f0be: 0f 94 ae 86 call 0x30d5c ; 0x30d5c current_position[E_AXIS] -= FILAMENT_UNLOAD_FAST_RETRACT_LENGTH; 1f0c2: 20 e0 ldi r18, 0x00 ; 0 1f0c4: 30 e0 ldi r19, 0x00 ; 0 1f0c6: 44 e3 ldi r20, 0x34 ; 52 1f0c8: 52 e4 ldi r21, 0x42 ; 66 1f0ca: 60 91 9e 06 lds r22, 0x069E ; 0x80069e 1f0ce: 70 91 9f 06 lds r23, 0x069F ; 0x80069f 1f0d2: 80 91 a0 06 lds r24, 0x06A0 ; 0x8006a0 1f0d6: 90 91 a1 06 lds r25, 0x06A1 ; 0x8006a1 1f0da: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 1f0de: 60 93 9e 06 sts 0x069E, r22 ; 0x80069e 1f0e2: 70 93 9f 06 sts 0x069F, r23 ; 0x80069f 1f0e6: 80 93 a0 06 sts 0x06A0, r24 ; 0x8006a0 1f0ea: 90 93 a1 06 sts 0x06A1, r25 ; 0x8006a1 plan_buffer_line_curposXYZE(FILAMENT_UNLOAD_FAST_RETRACT_FEEDRATE); 1f0ee: 6a e0 ldi r22, 0x0A ; 10 1f0f0: 77 e5 ldi r23, 0x57 ; 87 1f0f2: 8d ea ldi r24, 0xAD ; 173 1f0f4: 92 e4 ldi r25, 0x42 ; 66 1f0f6: 0f 94 49 c0 call 0x38092 ; 0x38092 st_synchronize(); 1f0fa: 0f 94 e8 42 call 0x285d0 ; 0x285d0 current_position[E_AXIS] -= FILAMENT_UNLOAD_SLOW_RETRACT_LENGTH; 1f0fe: 20 e0 ldi r18, 0x00 ; 0 1f100: 30 e0 ldi r19, 0x00 ; 0 1f102: 4c e0 ldi r20, 0x0C ; 12 1f104: 52 e4 ldi r21, 0x42 ; 66 1f106: 60 91 9e 06 lds r22, 0x069E ; 0x80069e 1f10a: 70 91 9f 06 lds r23, 0x069F ; 0x80069f 1f10e: 80 91 a0 06 lds r24, 0x06A0 ; 0x8006a0 1f112: 90 91 a1 06 lds r25, 0x06A1 ; 0x8006a1 1f116: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 1f11a: 60 93 9e 06 sts 0x069E, r22 ; 0x80069e 1f11e: 70 93 9f 06 sts 0x069F, r23 ; 0x80069f 1f122: 80 93 a0 06 sts 0x06A0, r24 ; 0x8006a0 1f126: 90 93 a1 06 sts 0x06A1, r25 ; 0x8006a1 plan_buffer_line_curposXYZE(FILAMENT_UNLOAD_SLOW_RETRACT_FEEDRATE); 1f12a: 69 e2 ldi r22, 0x29 ; 41 1f12c: 7c e5 ldi r23, 0x5C ; 92 1f12e: 85 e8 ldi r24, 0x85 ; 133 1f130: 91 e4 ldi r25, 0x41 ; 65 1f132: 0f 94 49 c0 call 0x38092 ; 0x38092 st_synchronize(); 1f136: 0f 94 e8 42 call 0x285d0 ; 0x285d0 // Configurable length, by default it's 0. // only plan the move if the length is set to a non-zero value if (unloadLength) 1f13a: 20 e0 ldi r18, 0x00 ; 0 1f13c: 30 e0 ldi r19, 0x00 ; 0 1f13e: a9 01 movw r20, r18 1f140: c7 01 movw r24, r14 1f142: b6 01 movw r22, r12 1f144: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 1f148: 88 23 and r24, r24 1f14a: e1 f0 breq .+56 ; 0x1f184 { current_position[E_AXIS] += unloadLength; 1f14c: a7 01 movw r20, r14 1f14e: 96 01 movw r18, r12 1f150: 60 91 9e 06 lds r22, 0x069E ; 0x80069e 1f154: 70 91 9f 06 lds r23, 0x069F ; 0x80069f 1f158: 80 91 a0 06 lds r24, 0x06A0 ; 0x8006a0 1f15c: 90 91 a1 06 lds r25, 0x06A1 ; 0x8006a1 1f160: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 1f164: 60 93 9e 06 sts 0x069E, r22 ; 0x80069e 1f168: 70 93 9f 06 sts 0x069F, r23 ; 0x80069f 1f16c: 80 93 a0 06 sts 0x06A0, r24 ; 0x8006a0 1f170: 90 93 a1 06 sts 0x06A1, r25 ; 0x8006a1 plan_buffer_line_curposXYZE(FILAMENT_CHANGE_UNLOAD_FEEDRATE); 1f174: 60 e0 ldi r22, 0x00 ; 0 1f176: 70 e0 ldi r23, 0x00 ; 0 1f178: 80 e2 ldi r24, 0x20 ; 32 1f17a: 91 e4 ldi r25, 0x41 ; 65 1f17c: 0f 94 49 c0 call 0x38092 ; 0x38092 st_synchronize(); 1f180: 0f 94 e8 42 call 0x285d0 ; 0x285d0 } lcd_display_message_fullscreen_P(_T(MSG_PULL_OUT_FILAMENT)); 1f184: 88 ec ldi r24, 0xC8 ; 200 1f186: 95 e4 ldi r25, 0x45 ; 69 1f188: 0e 94 ac 72 call 0xe558 ; 0xe558 1f18c: 0f 94 e4 1f call 0x23fc8 ; 0x23fc8 //disable extruder steppers so filament can be removed disable_e0(); 1f190: 14 9a sbi 0x02, 4 ; 2 _delay(100); 1f192: 64 e6 ldi r22, 0x64 ; 100 1f194: 70 e0 ldi r23, 0x00 ; 0 1f196: 80 e0 ldi r24, 0x00 ; 0 1f198: 90 e0 ldi r25, 0x00 ; 0 1f19a: 0f 94 53 27 call 0x24ea6 ; 0x24ea6 Sound_MakeSound(e_SOUND_TYPE_StandardPrompt); 1f19e: 82 e0 ldi r24, 0x02 ; 2 1f1a0: 0f 94 07 4e call 0x29c0e ; 0x29c0e 1f1a4: c3 e3 ldi r28, 0x33 ; 51 uint8_t counterBeep = 0; while (!lcd_clicked() && (counterBeep < 50)) { 1f1a6: 0e 94 fd 70 call 0xe1fa ; 0xe1fa 1f1aa: 81 11 cpse r24, r1 1f1ac: 07 c0 rjmp .+14 ; 0x1f1bc 1f1ae: c1 50 subi r28, 0x01 ; 1 1f1b0: 29 f0 breq .+10 ; 0x1f1bc delay_keep_alive(100); 1f1b2: 84 e6 ldi r24, 0x64 ; 100 1f1b4: 90 e0 ldi r25, 0x00 ; 0 1f1b6: 0e 94 e4 8c call 0x119c8 ; 0x119c8 1f1ba: f5 cf rjmp .-22 ; 0x1f1a6 counterBeep++; } st_synchronize(); 1f1bc: 0f 94 e8 42 call 0x285d0 ; 0x285d0 while (lcd_clicked()) delay_keep_alive(100); 1f1c0: 0e 94 fd 70 call 0xe1fa ; 0xe1fa 1f1c4: 88 23 and r24, r24 1f1c6: 29 f0 breq .+10 ; 0x1f1d2 1f1c8: 84 e6 ldi r24, 0x64 ; 100 1f1ca: 90 e0 ldi r25, 0x00 ; 0 1f1cc: 0e 94 e4 8c call 0x119c8 ; 0x119c8 1f1d0: f7 cf rjmp .-18 ; 0x1f1c0 lcd_update_enable(true); 1f1d2: 81 e0 ldi r24, 0x01 ; 1 1f1d4: 0e 94 25 6f call 0xde4a ; 0xde4a lcd_setstatuspgm(MSG_WELCOME); 1f1d8: 83 e7 ldi r24, 0x73 ; 115 1f1da: 90 e7 ldi r25, 0x70 ; 112 1f1dc: 0e 94 5d f1 call 0x1e2ba ; 0x1e2ba custom_message_type = CustomMsg::Status; 1f1e0: 10 92 c4 06 sts 0x06C4, r1 ; 0x8006c4 clearFilamentAction(); 1f1e4: 0f 94 93 20 call 0x24126 ; 0x24126 } 1f1e8: cf 91 pop r28 1f1ea: ff 90 pop r15 1f1ec: ef 90 pop r14 1f1ee: df 90 pop r13 1f1f0: cf 90 pop r12 #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) // SERIAL_ECHOLNPGM("FSBlockRunout"); } FSensorBlockRunout::~FSensorBlockRunout() { fsensor.settings_init(); // restore filament runout state. 1f1f2: 0d 94 f2 7a jmp 0x2f5e4 ; 0x2f5e4 0001f1f6 : //! ---------------------- | ---------------- //! 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) { 1f1f6: af 92 push r10 1f1f8: bf 92 push r11 1f1fa: cf 92 push r12 1f1fc: df 92 push r13 1f1fe: ef 92 push r14 1f200: ff 92 push r15 1f202: 0f 93 push r16 1f204: 1f 93 push r17 1f206: cf 93 push r28 1f208: 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); 1f20a: 88 23 and r24, r24 1f20c: 29 f0 breq .+10 ; 0x1f218 1f20e: 61 e0 ldi r22, 0x01 ; 1 1f210: 8f e5 ldi r24, 0x5F ; 95 1f212: 9f e0 ldi r25, 0x0F ; 15 1f214: 0f 94 40 dc call 0x3b880 ; 0x3b880 FORCE_BL_ON_START; 1f218: 81 e0 ldi r24, 0x01 ; 1 1f21a: 0e 94 49 8a call 0x11492 ; 0x11492 while (!end) { printf_P(PSTR("Wizard state: %d\n"), (uint8_t)state); 1f21e: 80 ed ldi r24, 0xD0 ; 208 1f220: e8 2e mov r14, r24 1f222: 89 e8 ldi r24, 0x89 ; 137 1f224: 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; 1f226: 97 ed ldi r25, 0xD7 ; 215 1f228: c9 2e mov r12, r25 1f22a: d1 2c mov r13, r1 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 1f22c: 2c e3 ldi r18, 0x3C ; 60 1f22e: a2 2e mov r10, r18 1f230: b1 2c mov r11, r1 1f232: 0c 2f mov r16, r28 1f234: 10 e0 ldi r17, 0x00 ; 0 1f236: 1f 92 push r1 1f238: cf 93 push r28 1f23a: ff 92 push r15 1f23c: ef 92 push r14 1f23e: 0f 94 de da call 0x3b5bc ; 0x3b5bc switch (state) { 1f242: 0f 90 pop r0 1f244: 0f 90 pop r0 1f246: 0f 90 pop r0 1f248: 0f 90 pop r0 1f24a: cf 30 cpi r28, 0x0F ; 15 1f24c: a0 f7 brcc .-24 ; 0x1f236 1f24e: f8 01 movw r30, r16 1f250: 88 27 eor r24, r24 1f252: e2 5d subi r30, 0xD2 ; 210 1f254: f6 40 sbci r31, 0x06 ; 6 1f256: 8f 4f sbci r24, 0xFF ; 255 1f258: 0d 94 2c dd jmp 0x3ba58 ; 0x3ba58 <__tablejump2__> 1f25c: 3d f9 .word 0xf93d ; ???? 1f25e: 8d f9 .word 0xf98d ; ???? 1f260: b3 f9 bld r27, 3 1f262: bf f9 .word 0xf9bf ; ???? 1f264: c9 f9 .word 0xf9c9 ; ???? 1f266: 03 fa bst r0, 3 1f268: 0f fa .word 0xfa0f ; ???? 1f26a: 29 fa .word 0xfa29 ; ???? 1f26c: 40 fa bst r4, 0 1f26e: 3a fa .word 0xfa3a ; ???? 1f270: 44 fa bst r4, 4 1f272: 52 fa bst r5, 2 1f274: 5b fa .word 0xfa5b ; ???? 1f276: 6f fa .word 0xfa6f ; ???? 1f278: 6f fa .word 0xfa6f ; ???? // 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; 1f27a: 10 92 a9 0d sts 0x0DA9, r1 ; 0x800da9 if( eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)==2){ 1f27e: 8f e5 ldi r24, 0x5F ; 95 1f280: 9f e0 ldi r25, 0x0F ; 15 1f282: 0f 94 1c dc call 0x3b838 ; 0x3b838 1f286: 82 30 cpi r24, 0x02 ; 2 1f288: 39 f4 brne .+14 ; 0x1f298 // printer pre-assembled: finish remaining steps lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_WELCOME_SHIPPING)); 1f28a: 83 ea ldi r24, 0xA3 ; 163 1f28c: 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)); 1f28e: 0e 94 ac 72 call 0xe558 ; 0xe558 1f292: 0f 94 f1 1f call 0x23fe2 ; 0x23fe2 1f296: 0f c0 rjmp .+30 ; 0x1f2b6 // 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); 1f298: 8e e3 ldi r24, 0x3E ; 62 1f29a: 92 e4 ldi r25, 0x42 ; 66 1f29c: 0e 94 ac 72 call 0xe558 ; 0xe558 1f2a0: 40 e0 ldi r20, 0x00 ; 0 1f2a2: 60 e0 ldi r22, 0x00 ; 0 1f2a4: 0f 94 40 4f call 0x29e80 ; 0x29e80 if (wizard_event == LCD_LEFT_BUTTON_CHOICE) { 1f2a8: 81 11 cpse r24, r1 1f2aa: 07 c0 rjmp .+14 ; 0x1f2ba 1f2ac: 61 e0 ldi r22, 0x01 ; 1 1f2ae: 8f e5 ldi r24, 0x5F ; 95 1f2b0: 9f e0 ldi r25, 0x0F ; 15 1f2b2: 0f 94 40 dc call 0x3b880 ; 0x3b880 state = S::Lay1CalCold; } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_ADDITIONAL_SHEETS)); state = S::Restore; 1f2b6: c1 e0 ldi r28, 0x01 ; 1 1f2b8: bc cf rjmp .-136 ; 0x1f232 1f2ba: 60 e0 ldi r22, 0x00 ; 0 1f2bc: 8f e5 ldi r24, 0x5F ; 95 1f2be: 9f e0 ldi r25, 0x0F ; 15 1f2c0: 0f 94 40 dc call 0x3b880 ; 0x3b880 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); 1f2c4: 10 e0 ldi r17, 0x00 ; 0 1f2c6: 00 e0 ldi r16, 0x00 ; 0 end = true; break; } } FORCE_BL_ON_END; 1f2c8: 80 e0 ldi r24, 0x00 ; 0 1f2ca: 0e 94 49 8a call 0x11492 ; 0x11492 const char *msg = NULL; printf_P(_N("Wizard end state: %d\n"), (uint8_t)state); 1f2ce: 1f 93 push r17 1f2d0: 0f 93 push r16 1f2d2: 8c e7 ldi r24, 0x7C ; 124 1f2d4: 9a e6 ldi r25, 0x6A ; 106 1f2d6: 9f 93 push r25 1f2d8: 8f 93 push r24 1f2da: 0f 94 de da call 0x3b5bc ; 0x3b5bc switch (state) { 1f2de: 0f 90 pop r0 1f2e0: 0f 90 pop r0 1f2e2: 0f 90 pop r0 1f2e4: 0f 90 pop r0 1f2e6: cd 30 cpi r28, 0x0D ; 13 1f2e8: 09 f4 brne .+2 ; 0x1f2ec 1f2ea: ff c0 rjmp .+510 ; 0x1f4ea 1f2ec: ce 30 cpi r28, 0x0E ; 14 1f2ee: 09 f4 brne .+2 ; 0x1f2f2 1f2f0: 11 c1 rjmp .+546 ; 0x1f514 case S::Run: // user interrupted msg = _T(MSG_WIZARD_QUIT); 1f2f2: 8d e5 ldi r24, 0x5D ; 93 1f2f4: 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) { 1f2f6: cc 23 and r28, r28 1f2f8: 09 f4 brne .+2 ; 0x1f2fc 1f2fa: 0e c1 rjmp .+540 ; 0x1f518 break; } if (msg) { lcd_show_fullscreen_message_and_wait_P(msg); } lcd_update_enable(true); 1f2fc: 81 e0 ldi r24, 0x01 ; 1 1f2fe: 0e 94 25 6f call 0xde4a ; 0xde4a lcd_update(2); 1f302: 82 e0 ldi r24, 0x02 ; 2 } 1f304: cf 91 pop r28 1f306: 1f 91 pop r17 1f308: 0f 91 pop r16 1f30a: ff 90 pop r15 1f30c: ef 90 pop r14 1f30e: df 90 pop r13 1f310: cf 90 pop r12 1f312: bf 90 pop r11 1f314: af 90 pop r10 } if (msg) { lcd_show_fullscreen_message_and_wait_P(msg); } lcd_update_enable(true); lcd_update(2); 1f316: 0c 94 a7 6e jmp 0xdd4e ; 0xdd4e lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 1f31a: 10 92 d5 03 sts 0x03D5, r1 ; 0x8003d5 <_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)) { 1f31e: 81 e0 ldi r24, 0x01 ; 1 1f320: 0e 94 9f ee call 0x1dd3e ; 0x1dd3e state = S::Selftest; 1f324: 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)) { 1f326: 88 23 and r24, r24 1f328: 09 f4 brne .+2 ; 0x1f32c 1f32a: 83 cf rjmp .-250 ; 0x1f232 state = S::Selftest; } else if (!calibration_status_get(CALIBRATION_STATUS_XYZ)) { 1f32c: 82 e0 ldi r24, 0x02 ; 2 1f32e: 0e 94 9f ee call 0x1dd3e ; 0x1dd3e // S::Xyz *includes* S::Z so it needs to come before // to avoid repeating Z alignment state = S::Xyz; 1f332: 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)) { 1f334: 88 23 and r24, r24 1f336: 09 f4 brne .+2 ; 0x1f33a 1f338: 7c cf rjmp .-264 ; 0x1f232 // 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)) { 1f33a: 84 e0 ldi r24, 0x04 ; 4 1f33c: 0e 94 9f ee call 0x1dd3e ; 0x1dd3e state = S::Z; 1f340: 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)) { 1f342: 88 23 and r24, r24 1f344: 09 f4 brne .+2 ; 0x1f348 1f346: 75 cf rjmp .-278 ; 0x1f232 state = S::Z; #ifdef THERMAL_MODEL } else if (!calibration_status_get(CALIBRATION_STATUS_THERMAL_MODEL)) { 1f348: 88 e0 ldi r24, 0x08 ; 8 1f34a: 0e 94 9f ee call 0x1dd3e ; 0x1dd3e state = S::ThermalModel; 1f34e: 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)) { 1f350: 88 23 and r24, r24 1f352: 09 f4 brne .+2 ; 0x1f356 1f354: 6e cf rjmp .-292 ; 0x1f232 state = S::ThermalModel; #endif //THERMAL_MODEL } else if (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) { 1f356: 80 e1 ldi r24, 0x10 ; 16 1f358: 0e 94 9f ee call 0x1dd3e ; 0x1dd3e state = S::IsFil; } else { // all required steps completed, finish successfully state = S::Finish; 1f35c: 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)) { 1f35e: 81 11 cpse r24, r1 1f360: 68 cf rjmp .-304 ; 0x1f232 state = S::IsFil; 1f362: c6 e0 ldi r28, 0x06 ; 6 1f364: 66 cf rjmp .-308 ; 0x1f232 // all required steps completed, finish successfully state = S::Finish; } break; case S::Selftest: lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_SELFTEST)); 1f366: 85 ef ldi r24, 0xF5 ; 245 1f368: 91 e4 ldi r25, 0x41 ; 65 1f36a: 0e 94 ac 72 call 0xe558 ; 0xe558 1f36e: 0f 94 f1 1f call 0x23fe2 ; 0x23fe2 wizard_event = lcd_selftest(); 1f372: 0e 94 60 f5 call 0x1eac0 ; 0x1eac0 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); 1f376: 81 11 cpse r24, r1 1f378: 9e cf rjmp .-196 ; 0x1f2b6 } 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); 1f37a: ce e0 ldi r28, 0x0E ; 14 1f37c: 5a cf rjmp .-332 ; 0x1f232 break; case S::Xyz: lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_XYZ_CAL)); 1f37e: 87 eb ldi r24, 0xB7 ; 183 1f380: 91 e4 ldi r25, 0x41 ; 65 1f382: 0e 94 ac 72 call 0xe558 ; 0xe558 1f386: 0f 94 f1 1f call 0x23fe2 ; 0x23fe2 wizard_event = gcode_M45(false, 0); 1f38a: 80 e0 ldi r24, 0x00 ; 0 1f38c: 0f 94 a5 8d call 0x31b4a ; 0x31b4a 1f390: f2 cf rjmp .-28 ; 0x1f376 state = (wizard_event ? S::Restore : S::Failed); break; case S::Z: lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_SHIPPING_HELPERS)); 1f392: 8f e8 ldi r24, 0x8F ; 143 1f394: 91 e4 ldi r25, 0x41 ; 65 1f396: 0e 94 ac 72 call 0xe558 ; 0xe558 1f39a: 0f 94 f1 1f call 0x23fe2 ; 0x23fe2 lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_TEST_PRINT)); 1f39e: 81 e6 ldi r24, 0x61 ; 97 1f3a0: 91 e4 ldi r25, 0x41 ; 65 1f3a2: 0e 94 ac 72 call 0xe558 ; 0xe558 1f3a6: 0f 94 f1 1f call 0x23fe2 ; 0x23fe2 lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_Z_CAL)); 1f3aa: 81 e4 ldi r24, 0x41 ; 65 1f3ac: 91 e4 ldi r25, 0x41 ; 65 1f3ae: 0e 94 ac 72 call 0xe558 ; 0xe558 1f3b2: 0f 94 f1 1f call 0x23fe2 ; 0x23fe2 wizard_event = gcode_M45(true, 0); 1f3b6: 81 e0 ldi r24, 0x01 ; 1 1f3b8: 0f 94 a5 8d call 0x31b4a ; 0x31b4a if (!wizard_event) { 1f3bc: 88 23 and r24, r24 1f3be: e9 f2 breq .-70 ; 0x1f37a state = S::Failed; } else { raise_z_above(MIN_Z_FOR_SWAP); 1f3c0: 60 e0 ldi r22, 0x00 ; 0 1f3c2: 70 e0 ldi r23, 0x00 ; 0 1f3c4: 88 ed ldi r24, 0xD8 ; 216 1f3c6: 91 e4 ldi r25, 0x41 ; 65 1f3c8: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 if(!MMU2::mmu2.Enabled()) { 1f3cc: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 1f3d0: 81 30 cpi r24, 0x01 ; 1 1f3d2: 09 f4 brne .+2 ; 0x1f3d6 1f3d4: 70 cf rjmp .-288 ; 0x1f2b6 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 1f3d6: d0 92 b7 0d sts 0x0DB7, r13 ; 0x800db7 1f3da: c0 92 b6 0d sts 0x0DB6, r12 ; 0x800db6 //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)); 1f3de: 8c e1 ldi r24, 0x1C ; 28 1f3e0: 91 e4 ldi r25, 0x41 ; 65 1f3e2: 0e 94 ac 72 call 0xe558 ; 0xe558 1f3e6: 0f 94 e4 1f call 0x23fc8 ; 0x23fc8 wait_preheat(); 1f3ea: 0e 94 55 e2 call 0x1c4aa ; 0x1c4aa unload_filament(FILAMENTCHANGE_FINALRETRACT); // unload current filament 1f3ee: 60 e0 ldi r22, 0x00 ; 0 1f3f0: 70 e0 ldi r23, 0x00 ; 0 1f3f2: cb 01 movw r24, r22 1f3f4: 0e 94 4f f8 call 0x1f09e ; 0x1f09e lcd_wizard_load(); // load filament 1f3f8: 0e 94 dc ce call 0x19db8 ; 0x19db8 1f3fc: 10 92 b7 0d sts 0x0DB7, r1 ; 0x800db7 1f400: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 1f404: 58 cf rjmp .-336 ; 0x1f2b6 state = S::Restore; } break; #ifdef THERMAL_MODEL case S::ThermalModel: lcd_show_fullscreen_message_and_wait_P(_T(MSG_TM_CAL)); 1f406: 8c ed ldi r24, 0xDC ; 220 1f408: 90 e4 ldi r25, 0x40 ; 64 1f40a: 0e 94 ac 72 call 0xe558 ; 0xe558 1f40e: 0f 94 f1 1f call 0x23fe2 ; 0x23fe2 lcd_commands_type = LcdCommands::ThermalModel; 1f412: 85 e0 ldi r24, 0x05 ; 5 1f414: 80 93 b4 0d sts 0x0DB4, r24 ; 0x800db4 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); 1f418: 05 e0 ldi r16, 0x05 ; 5 1f41a: 10 e0 ldi r17, 0x00 ; 0 1f41c: 55 cf rjmp .-342 ; 0x1f2c8 1f41e: d0 92 b7 0d sts 0x0DB7, r13 ; 0x800db7 1f422: c0 92 b6 0d sts 0x0DB6, r12 ; 0x800db6 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 1f426: b0 92 73 06 sts 0x0673, r11 ; 0x800673 1f42a: a0 92 72 06 sts 0x0672, r10 ; 0x800672 #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); 1f42e: 86 ec ldi r24, 0xC6 ; 198 1f430: 90 e4 ldi r25, 0x40 ; 64 1f432: 0e 94 ac 72 call 0xe558 ; 0xe558 1f436: 41 e0 ldi r20, 0x01 ; 1 1f438: 60 e0 ldi r22, 0x00 ; 0 1f43a: 0f 94 40 4f call 0x29e80 ; 0x29e80 if (wizard_event == LCD_LEFT_BUTTON_CHOICE) { 1f43e: 88 23 and r24, r24 1f440: 09 f1 breq .+66 ; 0x1f484 state = S::Lay1CalCold; } else { // MIDDLE_BUTTON_CHOICE if(MMU2::mmu2.Enabled()) state = S::LoadFilCold; 1f442: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba else state = S::Preheat; 1f446: 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; 1f448: 81 30 cpi r24, 0x01 ; 1 1f44a: 09 f0 breq .+2 ; 0x1f44e 1f44c: f2 ce rjmp .-540 ; 0x1f232 1f44e: c8 e0 ldi r28, 0x08 ; 8 1f450: f0 ce rjmp .-544 ; 0x1f232 else state = S::Preheat; } break; case S::Preheat: menu_goto(lcd_preheat_menu, 0, true); 1f452: 20 e0 ldi r18, 0x00 ; 0 1f454: 41 e0 ldi r20, 0x01 ; 1 1f456: 70 e0 ldi r23, 0x00 ; 0 1f458: 60 e0 ldi r22, 0x00 ; 0 1f45a: 82 ed ldi r24, 0xD2 ; 210 1f45c: 9a e3 ldi r25, 0x3A ; 58 1f45e: 0f 94 c0 d1 call 0x3a380 ; 0x3a380 lcd_show_fullscreen_message_and_wait_P(_T(MSG_SEL_PREHEAT_TEMP)); 1f462: 85 e8 ldi r24, 0x85 ; 133 1f464: 90 e4 ldi r25, 0x40 ; 64 1f466: 0e 94 ac 72 call 0xe558 ; 0xe558 1f46a: 0f 94 f1 1f call 0x23fe2 ; 0x23fe2 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); 1f46e: 07 e0 ldi r16, 0x07 ; 7 1f470: 10 e0 ldi r17, 0x00 ; 0 1f472: 2a cf rjmp .-428 ; 0x1f2c8 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(); 1f474: 0e 94 55 e2 call 0x1c4aa ; 0x1c4aa lcd_wizard_load(); 1f478: 0e 94 dc ce call 0x19db8 ; 0x19db8 state = S::Lay1CalHot; 1f47c: cb e0 ldi r28, 0x0B ; 11 1f47e: d9 ce rjmp .-590 ; 0x1f232 break; case S::LoadFilCold: lcd_wizard_load(); 1f480: 0e 94 dc ce call 0x19db8 ; 0x19db8 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; 1f484: ca e0 ldi r28, 0x0A ; 10 1f486: d5 ce rjmp .-598 ; 0x1f232 case S::LoadFilCold: lcd_wizard_load(); state = S::Lay1CalCold; break; case S::Lay1CalCold: wizard_lay1cal_message(true); 1f488: 81 e0 ldi r24, 0x01 ; 1 1f48a: 0e 94 be ce call 0x19d7c ; 0x19d7c menu_goto(lcd_v2_calibration, 0, true); 1f48e: 20 e0 ldi r18, 0x00 ; 0 1f490: 41 e0 ldi r20, 0x01 ; 1 1f492: 70 e0 ldi r23, 0x00 ; 0 1f494: 60 e0 ldi r22, 0x00 ; 0 1f496: 85 ed ldi r24, 0xD5 ; 213 1f498: 94 ee ldi r25, 0xE4 ; 228 1f49a: 0f 94 c0 d1 call 0x3a380 ; 0x3a380 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); 1f49e: 0a e0 ldi r16, 0x0A ; 10 1f4a0: 10 e0 ldi r17, 0x00 ; 0 1f4a2: 12 cf rjmp .-476 ; 0x1f2c8 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); 1f4a4: 80 e0 ldi r24, 0x00 ; 0 1f4a6: 0e 94 be ce call 0x19d7c ; 0x19d7c lcd_commands_type = LcdCommands::Layer1Cal; 1f4aa: 84 e0 ldi r24, 0x04 ; 4 1f4ac: 80 93 b4 0d sts 0x0DB4, r24 ; 0x800db4 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); 1f4b0: 0b e0 ldi r16, 0x0B ; 11 1f4b2: 10 e0 ldi r17, 0x00 ; 0 1f4b4: 09 cf rjmp .-494 ; 0x1f2c8 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); 1f4b6: 82 e3 ldi r24, 0x32 ; 50 1f4b8: 90 e4 ldi r25, 0x40 ; 64 1f4ba: 0e 94 ac 72 call 0xe558 ; 0xe558 1f4be: 41 e0 ldi r20, 0x01 ; 1 1f4c0: 60 e0 ldi r22, 0x00 ; 0 1f4c2: 0f 94 40 4f call 0x29e80 ; 0x29e80 if (wizard_event == LCD_LEFT_BUTTON_CHOICE) 1f4c6: 81 11 cpse r24, r1 1f4c8: 07 c0 rjmp .+14 ; 0x1f4d8 { lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_CLEAN_HEATBED)); 1f4ca: 82 e0 ldi r24, 0x02 ; 2 1f4cc: 90 e4 ldi r25, 0x40 ; 64 1f4ce: 0e 94 ac 72 call 0xe558 ; 0xe558 1f4d2: 0f 94 f1 1f call 0x23fe2 ; 0x23fe2 1f4d6: d6 cf rjmp .-84 ; 0x1f484 state = S::Lay1CalCold; } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_ADDITIONAL_SHEETS)); 1f4d8: 8c e9 ldi r24, 0x9C ; 156 1f4da: 9f e3 ldi r25, 0x3F ; 63 1f4dc: d8 ce rjmp .-592 ; 0x1f28e 1f4de: 60 e0 ldi r22, 0x00 ; 0 1f4e0: 8f e5 ldi r24, 0x5F ; 95 1f4e2: 9f e0 ldi r25, 0x0F ; 15 1f4e4: 0f 94 40 dc call 0x3b880 ; 0x3b880 1f4e8: ef ce rjmp .-546 ; 0x1f2c8 msg = _T(MSG_WIZARD_QUIT); break; case S::Finish: // we are successfully finished msg = _T(MSG_WIZARD_DONE); 1f4ea: 8e e3 ldi r24, 0x3E ; 62 1f4ec: 9f e3 ldi r25, 0x3F ; 63 1f4ee: 0e 94 ac 72 call 0xe558 ; 0xe558 1f4f2: 8c 01 movw r16, r24 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 1f4f4: 10 92 d5 03 sts 0x03D5, r1 ; 0x8003d5 <_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); 1f4f8: 83 e7 ldi r24, 0x73 ; 115 1f4fa: 90 e7 ldi r25, 0x70 ; 112 1f4fc: 0e 94 5d f1 call 0x1e2ba ; 0x1e2ba lcd_return_to_status(); 1f500: 0f 94 a6 1e call 0x23d4c ; 0x23d4c default: // exiting for later re-entry break; } if (msg) { 1f504: 01 15 cp r16, r1 1f506: 11 05 cpc r17, r1 1f508: 09 f4 brne .+2 ; 0x1f50c 1f50a: f8 ce rjmp .-528 ; 0x1f2fc lcd_show_fullscreen_message_and_wait_P(msg); 1f50c: c8 01 movw r24, r16 1f50e: 0f 94 f1 1f call 0x23fe2 ; 0x23fe2 1f512: f4 ce rjmp .-536 ; 0x1f2fc lcd_return_to_status(); break; case S::Failed: // aborted due to failure msg = _T(MSG_WIZARD_CALIBRATION_FAILED); 1f514: 8c ed ldi r24, 0xDC ; 220 1f516: 9e e3 ldi r25, 0x3E ; 62 1f518: 0e 94 ac 72 call 0xe558 ; 0xe558 1f51c: 8c 01 movw r16, r24 1f51e: f2 cf rjmp .-28 ; 0x1f504 0001f520
: void setupUSB() __attribute__((weak)); void setupUSB() { } int main(void) { 1f520: cf 93 push r28 1f522: df 93 push r29 1f524: cd b7 in r28, 0x3d ; 61 1f526: de b7 in r29, 0x3e ; 62 1f528: 67 97 sbiw r28, 0x17 ; 23 1f52a: 0f b6 in r0, 0x3f ; 63 1f52c: f8 94 cli 1f52e: de bf out 0x3e, r29 ; 62 1f530: 0f be out 0x3f, r0 ; 63 1f532: cd bf out 0x3d, r28 ; 61 void init() { // this needs to be called before setup() or some functions won't // work there sei(); 1f534: 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); 1f536: 84 b5 in r24, 0x24 ; 36 1f538: 82 60 ori r24, 0x02 ; 2 1f53a: 84 bd out 0x24, r24 ; 36 sbi(TCCR0A, WGM00); 1f53c: 84 b5 in r24, 0x24 ; 36 1f53e: 81 60 ori r24, 0x01 ; 1 1f540: 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); 1f542: 85 b5 in r24, 0x25 ; 37 1f544: 82 60 ori r24, 0x02 ; 2 1f546: 85 bd out 0x25, r24 ; 37 sbi(TCCR0B, CS00); 1f548: 85 b5 in r24, 0x25 ; 37 1f54a: 81 60 ori r24, 0x01 ; 1 1f54c: 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); 1f54e: 80 91 6e 00 lds r24, 0x006E ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> 1f552: 81 60 ori r24, 0x01 ; 1 1f554: 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; 1f558: 10 92 81 00 sts 0x0081, r1 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> // set timer 1 prescale factor to 64 sbi(TCCR1B, CS11); 1f55c: 80 91 81 00 lds r24, 0x0081 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> 1f560: 82 60 ori r24, 0x02 ; 2 1f562: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> #if F_CPU >= 8000000L sbi(TCCR1B, CS10); 1f566: 80 91 81 00 lds r24, 0x0081 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> 1f56a: 81 60 ori r24, 0x01 ; 1 1f56c: 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); 1f570: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1f574: 81 60 ori r24, 0x01 ; 1 1f576: 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); 1f57a: 80 91 b1 00 lds r24, 0x00B1 ; 0x8000b1 <__TEXT_REGION_LENGTH__+0x7c20b1> 1f57e: 84 60 ori r24, 0x04 ; 4 1f580: 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); 1f584: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1f588: 81 60 ori r24, 0x01 ; 1 1f58a: 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 1f58e: 80 91 91 00 lds r24, 0x0091 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> 1f592: 82 60 ori r24, 0x02 ; 2 1f594: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> sbi(TCCR3B, CS30); 1f598: 80 91 91 00 lds r24, 0x0091 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> 1f59c: 81 60 ori r24, 0x01 ; 1 1f59e: 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 1f5a2: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1f5a6: 81 60 ori r24, 0x01 ; 1 1f5a8: 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 1f5ac: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 1f5b0: 82 60 ori r24, 0x02 ; 2 1f5b2: 80 93 a1 00 sts 0x00A1, r24 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> sbi(TCCR4B, CS40); 1f5b6: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 1f5ba: 81 60 ori r24, 0x01 ; 1 1f5bc: 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 1f5c0: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1f5c4: 81 60 ori r24, 0x01 ; 1 1f5c6: 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 1f5ca: 80 91 21 01 lds r24, 0x0121 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> 1f5ce: 82 60 ori r24, 0x02 ; 2 1f5d0: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> sbi(TCCR5B, CS50); 1f5d4: 80 91 21 01 lds r24, 0x0121 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> 1f5d8: 81 60 ori r24, 0x01 ; 1 1f5da: 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 1f5de: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1f5e2: 81 60 ori r24, 0x01 ; 1 1f5e4: 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); 1f5e8: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1f5ec: 84 60 ori r24, 0x04 ; 4 1f5ee: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> sbi(ADCSRA, ADPS1); 1f5f2: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1f5f6: 82 60 ori r24, 0x02 ; 2 1f5f8: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> sbi(ADCSRA, ADPS0); 1f5fc: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1f600: 81 60 ori r24, 0x01 ; 1 1f602: 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); 1f606: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1f60a: 80 68 ori r24, 0x80 ; 128 1f60c: 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; 1f610: 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) { 1f614: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 1f616: f8 94 cli wdt_reset(); 1f618: a8 95 wdr MCUSR &= ~_BV(WDRF); 1f61a: 84 b7 in r24, 0x34 ; 52 1f61c: 87 7f andi r24, 0xF7 ; 247 1f61e: 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" ); 1f620: 0f b6 in r0, 0x3f ; 63 1f622: f8 94 cli 1f624: a8 95 wdr 1f626: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1f62a: 88 61 ori r24, 0x18 ; 24 1f62c: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1f630: 10 92 60 00 sts 0x0060, r1 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1f634: 0f be out 0x3f, r0 ; 63 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 1f636: 9f bf out 0x3f, r25 ; 63 CRITICAL_SECTION_END; } void timer2_init(void) { CRITICAL_SECTION_START; 1f638: 9f b7 in r25, 0x3f ; 63 1f63a: 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 1f63c: 10 92 b0 00 sts 0x00B0, r1 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> TCCR2B = (4 << CS20); //WGM_2=0, CS_0-2=011 1f640: 84 e0 ldi r24, 0x04 ; 4 1f642: 80 93 b1 00 sts 0x00B1, r24 ; 0x8000b1 <__TEXT_REGION_LENGTH__+0x7c20b1> //mask timer2 interrupts - enable OVF, disable others TIMSK2 |= (1< 1f64a: 81 60 ori r24, 0x01 ; 1 1f64c: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> TIMSK2 &= ~(1< 1f654: 8d 7f andi r24, 0xFD ; 253 1f656: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> TIMSK2 &= ~(1< 1f65e: 8b 7f andi r24, 0xFB ; 251 1f660: 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; 1f664: 10 92 b3 00 sts 0x00B3, r1 ; 0x8000b3 <__TEXT_REGION_LENGTH__+0x7c20b3> CRITICAL_SECTION_END; 1f668: 9f bf out 0x3f, r25 ; 63 } void backlight_init() { //check for backlight support on lcd SET_INPUT(LCD_BL_PIN); 1f66a: 6b 98 cbi 0x0d, 3 ; 13 WRITE(LCD_BL_PIN,HIGH); 1f66c: 73 9a sbi 0x0e, 3 ; 14 _delay(10); 1f66e: 6a e0 ldi r22, 0x0A ; 10 1f670: 70 e0 ldi r23, 0x00 ; 0 1f672: 80 e0 ldi r24, 0x00 ; 0 1f674: 90 e0 ldi r25, 0x00 ; 0 1f676: 0f 94 53 27 call 0x24ea6 ; 0x24ea6 backlightSupport = !READ(LCD_BL_PIN); 1f67a: 9c b1 in r25, 0x0c ; 12 1f67c: 81 e0 ldi r24, 0x01 ; 1 1f67e: 29 2f mov r18, r25 1f680: 28 70 andi r18, 0x08 ; 8 1f682: 93 fd sbrc r25, 3 1f684: 80 e0 ldi r24, 0x00 ; 0 1f686: 80 93 02 04 sts 0x0402, r24 ; 0x800402 if (!backlightSupport) return; 1f68a: 21 11 cpse r18, r1 1f68c: 22 c0 rjmp .+68 ; 0x1f6d2 //initialize backlight backlightMode = eeprom_init_default_byte((uint8_t *)EEPROM_BACKLIGHT_MODE, BACKLIGHT_MODE_AUTO); 1f68e: 62 e0 ldi r22, 0x02 ; 2 1f690: 82 e3 ldi r24, 0x32 ; 50 1f692: 9d e0 ldi r25, 0x0D ; 13 1f694: 0e 94 09 76 call 0xec12 ; 0xec12 1f698: 80 93 4f 02 sts 0x024F, r24 ; 0x80024f backlightLevel_HIGH = eeprom_init_default_byte((uint8_t *)EEPROM_BACKLIGHT_LEVEL_HIGH, 130); 1f69c: 62 e8 ldi r22, 0x82 ; 130 1f69e: 84 e3 ldi r24, 0x34 ; 52 1f6a0: 9d e0 ldi r25, 0x0D ; 13 1f6a2: 0e 94 09 76 call 0xec12 ; 0xec12 1f6a6: 80 93 01 04 sts 0x0401, r24 ; 0x800401 backlightLevel_LOW = eeprom_init_default_byte((uint8_t *)EEPROM_BACKLIGHT_LEVEL_LOW, 50); 1f6aa: 62 e3 ldi r22, 0x32 ; 50 1f6ac: 83 e3 ldi r24, 0x33 ; 51 1f6ae: 9d e0 ldi r25, 0x0D ; 13 1f6b0: 0e 94 09 76 call 0xec12 ; 0xec12 1f6b4: 80 93 00 04 sts 0x0400, r24 ; 0x800400 backlightTimer_period = eeprom_init_default_word((uint16_t *)EEPROM_BACKLIGHT_TIMEOUT, 10); // in seconds 1f6b8: 6a e0 ldi r22, 0x0A ; 10 1f6ba: 70 e0 ldi r23, 0x00 ; 0 1f6bc: 80 e3 ldi r24, 0x30 ; 48 1f6be: 9d e0 ldi r25, 0x0D ; 13 1f6c0: 0e 94 f1 75 call 0xebe2 ; 0xebe2 1f6c4: 90 93 4e 02 sts 0x024E, r25 ; 0x80024e 1f6c8: 80 93 4d 02 sts 0x024D, r24 ; 0x80024d SET_OUTPUT(LCD_BL_PIN); 1f6cc: 6b 9a sbi 0x0d, 3 ; 13 backlightTimer_reset(); 1f6ce: 0e 94 62 8a call 0x114c4 ; 0x114c4 return 0; } void lcd_init(void) { WRITE(LCD_PINS_ENABLE,LOW); 1f6d2: 8f 98 cbi 0x11, 7 ; 17 SET_OUTPUT(LCD_PINS_RS); 1f6d4: 55 9a sbi 0x0a, 5 ; 10 SET_OUTPUT(LCD_PINS_ENABLE); 1f6d6: 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); 1f6d8: 85 9a sbi 0x10, 5 ; 16 SET_OUTPUT(LCD_PINS_D5); 1f6da: 9c 9a sbi 0x13, 4 ; 19 SET_OUTPUT(LCD_PINS_D6); 1f6dc: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1f6e0: 80 68 ori r24, 0x80 ; 128 1f6e2: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> SET_OUTPUT(LCD_PINS_D7); 1f6e6: 9b 9a sbi 0x13, 3 ; 19 #ifdef LCD_8BIT lcd_displayfunction |= LCD_8BITMODE; #endif lcd_displayfunction |= LCD_2LINE; 1f6e8: 80 91 11 04 lds r24, 0x0411 ; 0x800411 <_ZL19lcd_displayfunction.lto_priv.549> 1f6ec: 88 60 ori r24, 0x08 ; 8 1f6ee: 80 93 11 04 sts 0x0411, r24 ; 0x800411 <_ZL19lcd_displayfunction.lto_priv.549> 1f6f2: 2f ef ldi r18, 0xFF ; 255 1f6f4: 30 e7 ldi r19, 0x70 ; 112 1f6f6: 82 e0 ldi r24, 0x02 ; 2 1f6f8: 21 50 subi r18, 0x01 ; 1 1f6fa: 30 40 sbci r19, 0x00 ; 0 1f6fc: 80 40 sbci r24, 0x00 ; 0 1f6fe: e1 f7 brne .-8 ; 0x1f6f8 1f700: 00 c0 rjmp .+0 ; 0x1f702 1f702: 00 00 nop _delay_us(50000); lcd_begin(1); //first time init 1f704: 81 e0 ldi r24, 0x01 ; 1 1f706: 0e 94 4b 6f call 0xde96 ; 0xde96 fdev_setup_stream(lcdout, lcd_putchar, NULL, _FDEV_SETUP_WRITE); //setup lcdout stream 1f70a: 83 ef ldi r24, 0xF3 ; 243 1f70c: 90 e7 ldi r25, 0x70 ; 112 1f70e: 90 93 0c 04 sts 0x040C, r25 ; 0x80040c <_lcdout+0x9> 1f712: 80 93 0b 04 sts 0x040B, r24 ; 0x80040b <_lcdout+0x8> 1f716: 10 92 0e 04 sts 0x040E, r1 ; 0x80040e <_lcdout+0xb> 1f71a: 10 92 0d 04 sts 0x040D, r1 ; 0x80040d <_lcdout+0xa> 1f71e: 12 e0 ldi r17, 0x02 ; 2 1f720: 10 93 06 04 sts 0x0406, r17 ; 0x800406 <_lcdout+0x3> 1f724: 10 92 10 04 sts 0x0410, r1 ; 0x800410 <_lcdout+0xd> 1f728: 10 92 0f 04 sts 0x040F, r1 ; 0x80040f <_lcdout+0xc> void ultralcd_init() { backlight_init(); lcd_init(); lcd_refresh(); 1f72c: 0e 94 8c 6f call 0xdf18 ; 0xdf18 lcd_longpress_func = menu_lcd_longpress_func; 1f730: 8f e4 ldi r24, 0x4F ; 79 1f732: 94 ed ldi r25, 0xD4 ; 212 1f734: 90 93 18 04 sts 0x0418, r25 ; 0x800418 1f738: 80 93 17 04 sts 0x0417, r24 ; 0x800417 lcd_lcdupdate_func = menu_lcd_lcdupdate_func; 1f73c: 80 e8 ldi r24, 0x80 ; 128 1f73e: 9a e3 ldi r25, 0x3A ; 58 1f740: 90 93 16 04 sts 0x0416, r25 ; 0x800416 1f744: 80 93 15 04 sts 0x0415, r24 ; 0x800415 menu_menu = lcd_status_screen; 1f748: 88 e1 ldi r24, 0x18 ; 24 1f74a: 99 e3 ldi r25, 0x39 ; 57 1f74c: 90 93 14 04 sts 0x0414, r25 ; 0x800414 1f750: 80 93 13 04 sts 0x0413, r24 ; 0x800413 SET_INPUT(BTN_EN1); 1f754: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1f758: 8b 7f andi r24, 0xFB ; 251 1f75a: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> SET_INPUT(BTN_EN2); 1f75e: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1f762: 8d 7f andi r24, 0xFD ; 253 1f764: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> WRITE(BTN_EN1, HIGH); 1f768: 9f b7 in r25, 0x3f ; 63 1f76a: f8 94 cli 1f76c: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f770: 84 60 ori r24, 0x04 ; 4 1f772: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f776: 9f bf out 0x3f, r25 ; 63 WRITE(BTN_EN2, HIGH); 1f778: 9f b7 in r25, 0x3f ; 63 1f77a: f8 94 cli 1f77c: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f780: 82 60 ori r24, 0x02 ; 2 1f782: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f786: 9f bf out 0x3f, r25 ; 63 #if BTN_ENC > 0 SET_INPUT(BTN_ENC); 1f788: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1f78c: 8f 7b andi r24, 0xBF ; 191 1f78e: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> WRITE(BTN_ENC, HIGH); 1f792: 9f b7 in r25, 0x3f ; 63 1f794: f8 94 cli 1f796: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1f79a: 80 64 ori r24, 0x40 ; 64 1f79c: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1f7a0: 9f bf out 0x3f, r25 ; 63 #endif #if defined (SDSUPPORT) && defined(SDCARDDETECT) && (SDCARDDETECT > 0) SET_INPUT(SDCARDDETECT); 1f7a2: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1f7a6: 8e 7f andi r24, 0xFE ; 254 1f7a8: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> WRITE(SDCARDDETECT, HIGH); 1f7ac: 9f b7 in r25, 0x3f ; 63 1f7ae: f8 94 cli 1f7b0: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f7b4: 81 60 ori r24, 0x01 ; 1 1f7b6: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f7ba: 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); 1f7bc: af e9 ldi r26, 0x9F ; 159 1f7be: bf e0 ldi r27, 0x0F ; 15 1f7c0: 11 97 sbiw r26, 0x01 ; 1 1f7c2: f1 f7 brne .-4 ; 0x1f7c0 1f7c4: 00 c0 rjmp .+0 ; 0x1f7c6 1f7c6: 00 00 nop _delay_ms(1); //wait for the pullups to raise the line lcd_oldcardstatus = IS_SD_INSERTED; 1f7c8: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 1f7cc: 80 95 com r24 1f7ce: 81 70 andi r24, 0x01 ; 1 1f7d0: 80 93 12 04 sts 0x0412, r24 ; 0x800412 #endif//(SDCARDDETECT > 0) // Initialise status line strncpy_P(lcd_status_message, MSG_WELCOME, LCD_WIDTH); 1f7d4: 44 e1 ldi r20, 0x14 ; 20 1f7d6: 50 e0 ldi r21, 0x00 ; 0 1f7d8: 63 e7 ldi r22, 0x73 ; 115 1f7da: 70 e7 ldi r23, 0x70 ; 112 1f7dc: 8f e1 ldi r24, 0x1F ; 31 1f7de: 95 e0 ldi r25, 0x05 ; 5 1f7e0: 0f 94 09 da call 0x3b412 ; 0x3b412 timer2_init(); // enables functional millis ultralcd_init(); spi_init(); 1f7e4: 0f 94 ce c2 call 0x3859c ; 0x3859c } void lcd_splash() { lcd_clear(); // clears display and homes screen 1f7e8: 0e 94 13 6f call 0xde26 ; 0xde26 lcd_printf_P(PSTR("\n Original Prusa i3\n Prusa Research\n%20.20S"), PSTR(FW_VERSION)); 1f7ec: 85 e4 ldi r24, 0x45 ; 69 1f7ee: 9d e8 ldi r25, 0x8D ; 141 1f7f0: 9f 93 push r25 1f7f2: 8f 93 push r24 1f7f4: 8c e4 ldi r24, 0x4C ; 76 1f7f6: 9d e8 ldi r25, 0x8D ; 141 1f7f8: 9f 93 push r25 1f7fa: 8f 93 push r24 1f7fc: 0e 94 b9 6e call 0xdd72 ; 0xdd72 static void Sound_DoSound_Encoder_Move(void); static void Sound_DoSound_Blind_Alert(void); void Sound_Init(void) { SET_OUTPUT(BEEPER); 1f800: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1f804: 84 60 ori r24, 0x04 ; 4 1f806: 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)); 1f80a: 60 e0 ldi r22, 0x00 ; 0 1f80c: 87 ed ldi r24, 0xD7 ; 215 1f80e: 9e e0 ldi r25, 0x0E ; 14 1f810: 0e 94 09 76 call 0xec12 ; 0xec12 1f814: 80 93 de 04 sts 0x04DE, r24 ; 0x8004de spi_init(); lcd_splash(); Sound_Init(); // also guarantee "SET_OUTPUT(BEEPER)" selectedSerialPort = eeprom_init_default_byte((uint8_t *)EEPROM_SECOND_SERIAL_ACTIVE, 0); 1f818: 60 e0 ldi r22, 0x00 ; 0 1f81a: 88 e0 ldi r24, 0x08 ; 8 1f81c: 9f e0 ldi r25, 0x0F ; 15 1f81e: 0e 94 09 76 call 0xec12 ; 0xec12 1f822: 80 93 39 05 sts 0x0539, r24 ; 0x800539 MYSERIAL.begin(BAUDRATE); 1f826: 0e 94 85 cc call 0x1990a ; 0x1990a fdev_setup_stream(uartout, uart_putchar, NULL, _FDEV_SETUP_WRITE); //setup uart out stream 1f82a: 8b e4 ldi r24, 0x4B ; 75 1f82c: 97 e7 ldi r25, 0x77 ; 119 1f82e: 90 93 06 05 sts 0x0506, r25 ; 0x800506 <_uartout+0x9> 1f832: 80 93 05 05 sts 0x0505, r24 ; 0x800505 <_uartout+0x8> 1f836: 10 92 08 05 sts 0x0508, r1 ; 0x800508 <_uartout+0xb> 1f83a: 10 92 07 05 sts 0x0507, r1 ; 0x800507 <_uartout+0xa> 1f83e: 10 93 00 05 sts 0x0500, r17 ; 0x800500 <_uartout+0x3> 1f842: 10 92 0a 05 sts 0x050A, r1 ; 0x80050a <_uartout+0xd> 1f846: 10 92 09 05 sts 0x0509, r1 ; 0x800509 <_uartout+0xc> stdout = uartout; 1f84a: 8d ef ldi r24, 0xFD ; 253 1f84c: 94 e0 ldi r25, 0x04 ; 4 1f84e: 90 93 1d 18 sts 0x181D, r25 ; 0x80181d <__iob+0x3> 1f852: 80 93 1c 18 sts 0x181C, r24 ; 0x80181c <__iob+0x2> #ifdef XFLASH bool xflash_success = xflash_init(); 1f856: 0e 94 17 ee call 0x1dc2e ; 0x1dc2e 1f85a: b8 2e mov r11, r24 uint8_t optiboot_status = 1; if (xflash_success) 1f85c: 0f 90 pop r0 1f85e: 0f 90 pop r0 1f860: 0f 90 pop r0 1f862: 0f 90 pop r0 1f864: 8e 01 movw r16, r28 1f866: 0f 5f subi r16, 0xFF ; 255 1f868: 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; 1f86a: aa 24 eor r10, r10 1f86c: a3 94 inc r10 if (xflash_success) 1f86e: 88 23 and r24, r24 1f870: 09 f4 brne .+2 ; 0x1f874 1f872: d8 c0 rjmp .+432 ; 0x1fa24 { optiboot_status = optiboot_xflash_enter(); 1f874: 0f 94 dc c2 call 0x385b8 ; 0x385b8 1f878: 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)) 1f87a: 80 91 fc 1f lds r24, 0x1FFC ; 0x801ffc <__bss_end+0x7dc> 1f87e: 90 91 fd 1f lds r25, 0x1FFD ; 0x801ffd <__bss_end+0x7dd> 1f882: a0 91 fe 1f lds r26, 0x1FFE ; 0x801ffe <__bss_end+0x7de> 1f886: b0 91 ff 1f lds r27, 0x1FFF ; 0x801fff <__bss_end+0x7df> 1f88a: 8a 3a cpi r24, 0xAA ; 170 1f88c: 95 45 sbci r25, 0x55 ; 85 1f88e: aa 4a sbci r26, 0xAA ; 170 1f890: b5 45 sbci r27, 0x55 ; 85 1f892: 09 f0 breq .+2 ; 0x1f896 1f894: bf c0 rjmp .+382 ; 0x1fa14 1f896: 80 91 fb 1f lds r24, 0x1FFB ; 0x801ffb <__bss_end+0x7db> 1f89a: 87 ff sbrs r24, 7 1f89c: bb c0 rjmp .+374 ; 0x1fa14 { uint8_t lang = boot_reserved >> 3; 1f89e: 80 90 fa 1f lds r8, 0x1FFA ; 0x801ffa <__bss_end+0x7da> 1f8a2: 98 2c mov r9, r8 1f8a4: 96 94 lsr r9 1f8a6: 96 94 lsr r9 1f8a8: 96 94 lsr r9 uint8_t state = boot_reserved & 0x07; 1f8aa: f8 2d mov r31, r8 1f8ac: f7 70 andi r31, 0x07 ; 7 1f8ae: 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 1f8b0: 99 20 and r9, r9 1f8b2: 09 f4 brne .+2 ; 0x1f8b6 1f8b4: af c0 rjmp .+350 ; 0x1fa14 #ifdef XFLASH if (lang == LANG_ID_SEC) 1f8b6: 21 e0 ldi r18, 0x01 ; 1 1f8b8: 92 12 cpse r9, r18 1f8ba: 24 c0 rjmp .+72 ; 0x1f904 { 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 1f8bc: 40 e1 ldi r20, 0x10 ; 16 1f8be: 50 e0 ldi r21, 0x00 ; 0 1f8c0: 60 e0 ldi r22, 0x00 ; 0 1f8c2: 71 e0 ldi r23, 0x01 ; 1 1f8c4: c8 01 movw r24, r16 1f8c6: 0f 94 b6 d9 call 0x3b36c ; 0x3b36c if (offset) *offset = ui; 1f8ca: 60 e0 ldi r22, 0x00 ; 0 1f8cc: 71 e0 ldi r23, 0x01 ; 1 1f8ce: 6b 01 movw r12, r22 1f8d0: f1 2c mov r15, r1 1f8d2: e1 2c mov r14, r1 lang_table_header_t header; uint32_t src_addr; if (lang_get_header(lang, &header, &src_addr)) 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: 96 c0 rjmp .+300 ; 0x1fa14 { lcd_puts_at_P(1,0,PSTR("Language update")); 1f8e8: 4a e7 ldi r20, 0x7A ; 122 1f8ea: 5d e8 ldi r21, 0x8D ; 141 1f8ec: 60 e0 ldi r22, 0x00 ; 0 1f8ee: 81 e0 ldi r24, 0x01 ; 1 1f8f0: 0e 94 f4 6e call 0xdde8 ; 0xdde8 for (uint8_t i = 0; i < state; i++) 1f8f4: 91 2c mov r9, r1 1f8f6: 89 14 cp r8, r9 1f8f8: 39 f1 breq .+78 ; 0x1f948 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 1f8fa: 8e e2 ldi r24, 0x2E ; 46 1f8fc: 0e 94 8f 6f call 0xdf1e ; 0xdf1e 1f900: 93 94 inc r9 1f902: f9 cf rjmp .-14 ; 0x1f8f6 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 1f904: 8c e5 ldi r24, 0x5C ; 92 1f906: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 1f908: 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; 1f90a: c1 2c mov r12, r1 1f90c: d1 2c mov r13, r1 1f90e: 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 1f910: 20 e1 ldi r18, 0x10 ; 16 1f912: 30 e0 ldi r19, 0x00 ; 0 1f914: a8 01 movw r20, r16 1f916: c7 01 movw r24, r14 1f918: b6 01 movw r22, r12 1f91a: 0e 94 e7 ec call 0x1d9ce ; 0x1d9ce if (header->magic != LANG_MAGIC) break; //break if not valid 1f91e: 89 81 ldd r24, Y+1 ; 0x01 1f920: 9a 81 ldd r25, Y+2 ; 0x02 1f922: ab 81 ldd r26, Y+3 ; 0x03 1f924: bc 81 ldd r27, Y+4 ; 0x04 1f926: 85 3a cpi r24, 0xA5 ; 165 1f928: 9a 45 sbci r25, 0x5A ; 90 1f92a: a4 4b sbci r26, 0xB4 ; 180 1f92c: bb 44 sbci r27, 0x4B ; 75 1f92e: 09 f0 breq .+2 ; 0x1f932 1f930: 71 c0 rjmp .+226 ; 0x1fa14 if (offset) *offset = addr; if (--lang == 0) return 1; 1f932: f2 e0 ldi r31, 0x02 ; 2 1f934: 9f 16 cp r9, r31 1f936: c1 f2 breq .-80 ; 0x1f8e8 addr += header->size; //calc address of next table 1f938: 8d 81 ldd r24, Y+5 ; 0x05 1f93a: 9e 81 ldd r25, Y+6 ; 0x06 1f93c: c8 0e add r12, r24 1f93e: d9 1e adc r13, r25 1f940: e1 1c adc r14, r1 1f942: f1 1c adc r15, r1 1f944: 9a 94 dec r9 1f946: e4 cf rjmp .-56 ; 0x1f910 lcd_print('.'); _delay(100); 1f948: 64 e6 ldi r22, 0x64 ; 100 1f94a: 70 e0 ldi r23, 0x00 ; 0 1f94c: 80 e0 ldi r24, 0x00 ; 0 1f94e: 90 e0 ldi r25, 0x00 ; 0 1f950: 0f 94 53 27 call 0x24ea6 ; 0x24ea6 boot_reserved = (boot_reserved & 0xF8) | ((state + 1) & 0x07); 1f954: 80 91 fa 1f lds r24, 0x1FFA ; 0x801ffa <__bss_end+0x7da> 1f958: 88 7f andi r24, 0xF8 ; 248 1f95a: 91 e0 ldi r25, 0x01 ; 1 1f95c: 98 0d add r25, r8 1f95e: 97 70 andi r25, 0x07 ; 7 1f960: 89 2b or r24, r25 1f962: 80 93 fa 1f sts 0x1FFA, r24 ; 0x801ffa <__bss_end+0x7da> if ((state * LANGBOOT_BLOCKSIZE) < header.size) 1f966: 91 2c mov r9, r1 1f968: 98 2c mov r9, r8 1f96a: 88 24 eor r8, r8 1f96c: 92 94 swap r9 1f96e: 80 ef ldi r24, 0xF0 ; 240 1f970: 98 22 and r9, r24 1f972: 8d 81 ldd r24, Y+5 ; 0x05 1f974: 9e 81 ldd r25, Y+6 ; 0x06 1f976: 88 16 cp r8, r24 1f978: 99 06 cpc r9, r25 1f97a: 08 f0 brcs .+2 ; 0x1f97e 1f97c: 46 c0 rjmp .+140 ; 0x1fa0a { cli(); 1f97e: f8 94 cli uint16_t size = header.size - state * LANGBOOT_BLOCKSIZE; 1f980: 0d 81 ldd r16, Y+5 ; 0x05 1f982: 1e 81 ldd r17, Y+6 ; 0x06 1f984: 08 19 sub r16, r8 1f986: 19 09 sbc r17, r9 if (size > LANGBOOT_BLOCKSIZE) size = LANGBOOT_BLOCKSIZE; 1f988: 01 30 cpi r16, 0x01 ; 1 1f98a: 20 e1 ldi r18, 0x10 ; 16 1f98c: 12 07 cpc r17, r18 1f98e: 10 f0 brcs .+4 ; 0x1f994 1f990: 00 e0 ldi r16, 0x00 ; 0 1f992: 10 e1 ldi r17, 0x10 ; 16 xflash_rd_data(src_addr + state * LANGBOOT_BLOCKSIZE, (uint8_t*)LANGBOOT_RAMBUFFER, size); 1f994: c7 01 movw r24, r14 1f996: b6 01 movw r22, r12 1f998: 68 0d add r22, r8 1f99a: 79 1d adc r23, r9 1f99c: 81 1d adc r24, r1 1f99e: 91 1d adc r25, r1 1f9a0: 98 01 movw r18, r16 1f9a2: 40 e0 ldi r20, 0x00 ; 0 1f9a4: 58 e0 ldi r21, 0x08 ; 8 1f9a6: 0e 94 e7 ec call 0x1d9ce ; 0x1d9ce } void bootapp_ram2flash(uint16_t rptr, uint16_t fptr, uint16_t size) { cli(); 1f9aa: f8 94 cli boot_app_magic = BOOT_APP_MAGIC; 1f9ac: 8a ea ldi r24, 0xAA ; 170 1f9ae: 95 e5 ldi r25, 0x55 ; 85 1f9b0: dc 01 movw r26, r24 1f9b2: 80 93 fc 1f sts 0x1FFC, r24 ; 0x801ffc <__bss_end+0x7dc> 1f9b6: 90 93 fd 1f sts 0x1FFD, r25 ; 0x801ffd <__bss_end+0x7dd> 1f9ba: a0 93 fe 1f sts 0x1FFE, r26 ; 0x801ffe <__bss_end+0x7de> 1f9be: b0 93 ff 1f sts 0x1FFF, r27 ; 0x801fff <__bss_end+0x7df> boot_app_flags |= BOOT_APP_FLG_COPY | BOOT_APP_FLG_ERASE; 1f9c2: 80 91 fb 1f lds r24, 0x1FFB ; 0x801ffb <__bss_end+0x7db> 1f9c6: 83 60 ori r24, 0x03 ; 3 1f9c8: 80 93 fb 1f sts 0x1FFB, r24 ; 0x801ffb <__bss_end+0x7db> boot_copy_size = (uint16_t)size; 1f9cc: 10 93 f9 1f sts 0x1FF9, r17 ; 0x801ff9 <__bss_end+0x7d9> 1f9d0: 00 93 f8 1f sts 0x1FF8, r16 ; 0x801ff8 <__bss_end+0x7d8> boot_src_addr = (uint32_t)rptr; 1f9d4: 80 e0 ldi r24, 0x00 ; 0 1f9d6: 98 e0 ldi r25, 0x08 ; 8 1f9d8: a0 e0 ldi r26, 0x00 ; 0 1f9da: b0 e0 ldi r27, 0x00 ; 0 1f9dc: 80 93 f0 1f sts 0x1FF0, r24 ; 0x801ff0 <__bss_end+0x7d0> 1f9e0: 90 93 f1 1f sts 0x1FF1, r25 ; 0x801ff1 <__bss_end+0x7d1> 1f9e4: a0 93 f2 1f sts 0x1FF2, r26 ; 0x801ff2 <__bss_end+0x7d2> 1f9e8: b0 93 f3 1f sts 0x1FF3, r27 ; 0x801ff3 <__bss_end+0x7d3> if (state == 0) { //TODO - check header integrity } bootapp_ram2flash(LANGBOOT_RAMBUFFER, _SEC_LANG_TABLE + state * LANGBOOT_BLOCKSIZE, size); 1f9ec: c4 01 movw r24, r8 1f9ee: 80 50 subi r24, 0x00 ; 0 1f9f0: 9f 4f sbci r25, 0xFF ; 255 boot_dst_addr = (uint32_t)fptr; 1f9f2: b0 e0 ldi r27, 0x00 ; 0 1f9f4: a0 e0 ldi r26, 0x00 ; 0 1f9f6: 80 93 f4 1f sts 0x1FF4, r24 ; 0x801ff4 <__bss_end+0x7d4> 1f9fa: 90 93 f5 1f sts 0x1FF5, r25 ; 0x801ff5 <__bss_end+0x7d5> 1f9fe: a0 93 f6 1f sts 0x1FF6, r26 ; 0x801ff6 <__bss_end+0x7d6> 1fa02: b0 93 f7 1f sts 0x1FF7, r27 ; 0x801ff7 <__bss_end+0x7d7> 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(); 1fa06: 0e 94 4c 67 call 0xce98 ; 0xce98 1fa0a: 61 e0 ldi r22, 0x01 ; 1 1fa0c: 8e ef ldi r24, 0xFE ; 254 1fa0e: 9f e0 ldi r25, 0x0F ; 15 1fa10: 0f 94 40 dc call 0x3b880 ; 0x3b880 //TODO - check sec lang data integrity eeprom_update_byte_notify((unsigned char *)EEPROM_LANG, LANG_ID_SEC); } } } boot_app_magic = 0; 1fa14: 10 92 fc 1f sts 0x1FFC, r1 ; 0x801ffc <__bss_end+0x7dc> 1fa18: 10 92 fd 1f sts 0x1FFD, r1 ; 0x801ffd <__bss_end+0x7dd> 1fa1c: 10 92 fe 1f sts 0x1FFE, r1 ; 0x801ffe <__bss_end+0x7de> 1fa20: 10 92 ff 1f sts 0x1FFF, r1 ; 0x801fff <__bss_end+0x7df> 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(); 1fa24: 0e 94 d1 ef call 0x1dfa2 ; 0x1dfa2 setup_powerhold(); farm_mode_init(); #ifdef TMC2130 if(FarmOrUserECool()) { 1fa28: 88 23 and r24, r24 1fa2a: 51 f0 breq .+20 ; 0x1fa40 //increased extruder current (PFW363) currents[E_AXIS].setiRun(TMC2130_CURRENTS_FARM); 1fa2c: 64 e2 ldi r22, 0x24 ; 36 1fa2e: 86 e6 ldi r24, 0x66 ; 102 1fa30: 92 e0 ldi r25, 0x02 ; 2 1fa32: 0e 94 06 68 call 0xd00c ; 0xd00c currents[E_AXIS].setiHold(TMC2130_CURRENTS_FARM); 1fa36: 64 e2 ldi r22, 0x24 ; 36 1fa38: 86 e6 ldi r24, 0x66 ; 102 1fa3a: 92 e0 ldi r25, 0x02 ; 2 1fa3c: 0e 94 fe 67 call 0xcffc ; 0xcffc #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); 1fa40: 44 e1 ldi r20, 0x14 ; 20 1fa42: 50 e0 ldi r21, 0x00 ; 0 1fa44: 65 e1 ldi r22, 0x15 ; 21 1fa46: 7d e0 ldi r23, 0x0D ; 13 1fa48: c8 01 movw r24, r16 1fa4a: 0f 94 0c dc call 0x3b818 ; 0x3b818 if (SN[19] || strncmp_P(SN, PSTR("CZPX"), 4)) 1fa4e: 8c 89 ldd r24, Y+20 ; 0x14 1fa50: 81 11 cpse r24, r1 1fa52: 0a c0 rjmp .+20 ; 0x1fa68 1fa54: 44 e0 ldi r20, 0x04 ; 4 1fa56: 50 e0 ldi r21, 0x00 ; 0 1fa58: 6c e7 ldi r22, 0x7C ; 124 1fa5a: 7e e8 ldi r23, 0x8E ; 142 1fa5c: c8 01 movw r24, r16 1fa5e: 0f 94 fb d9 call 0x3b3f6 ; 0x3b3f6 1fa62: 89 2b or r24, r25 1fa64: 09 f4 brne .+2 ; 0x1fa68 1fa66: 51 c0 rjmp .+162 ; 0x1fb0a * @return 1 on general failure */ #ifdef PRUSA_SN_SUPPORT static uint8_t get_PRUSA_SN(char* SN) { uint8_t selectedSerialPort_bak = selectedSerialPort; 1fa68: e0 90 39 05 lds r14, 0x0539 ; 0x800539 uint8_t rxIndex; bool SN_valid = false; ShortTimer timeout; 1fa6c: 1d 8a std Y+21, r1 ; 0x15 1fa6e: 1f 8a std Y+23, r1 ; 0x17 1fa70: 1e 8a std Y+22, r1 ; 0x16 selectedSerialPort = 0; 1fa72: 10 92 39 05 sts 0x0539, r1 ; 0x800539 timeout.start(); 1fa76: ce 01 movw r24, r28 1fa78: 45 96 adiw r24, 0x15 ; 21 1fa7a: 0f 94 ad 29 call 0x2535a ; 0x2535a ::start()> while (!SN_valid) { rxIndex = 0; _delay(50); 1fa7e: 62 e3 ldi r22, 0x32 ; 50 1fa80: 70 e0 ldi r23, 0x00 ; 0 1fa82: 80 e0 ldi r24, 0x00 ; 0 1fa84: 90 e0 ldi r25, 0x00 ; 0 1fa86: 0f 94 53 27 call 0x24ea6 ; 0x24ea6 // 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; 1fa8a: 80 91 9b 04 lds r24, 0x049B ; 0x80049b 1fa8e: 90 91 9c 04 lds r25, 0x049C ; 0x80049c 1fa92: 90 93 9a 04 sts 0x049A, r25 ; 0x80049a 1fa96: 80 93 99 04 sts 0x0499, r24 ; 0x800499 MYSERIAL.flush(); //clear RX buffer SERIAL_ECHOLNRPGM(PSTR(";S")); 1fa9a: 8f e8 ldi r24, 0x8F ; 143 1fa9c: 9d e8 ldi r25, 0x8D ; 141 1fa9e: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 1faa2: 68 01 movw r12, r16 selectedSerialPort = 0; timeout.start(); while (!SN_valid) { rxIndex = 0; 1faa4: f1 2c mov r15, r1 _delay(50); MYSERIAL.flush(); //clear RX buffer SERIAL_ECHOLNRPGM(PSTR(";S")); while (rxIndex < 19) 1faa6: 33 e1 ldi r19, 0x13 ; 19 1faa8: f3 16 cp r15, r19 1faaa: a1 f0 breq .+40 ; 0x1fad4 { if (timeout.expired(250u)) 1faac: 6a ef ldi r22, 0xFA ; 250 1faae: 70 e0 ldi r23, 0x00 ; 0 1fab0: ce 01 movw r24, r28 1fab2: 45 96 adiw r24, 0x15 ; 21 1fab4: 0f 94 7e 29 call 0x252fc ; 0x252fc ::expired(unsigned short)> 1fab8: 81 11 cpse r24, r1 1faba: c1 c0 rjmp .+386 ; 0x1fc3e goto exit; if (MYSERIAL.available() > 0) 1fabc: 0e 94 09 77 call 0xee12 ; 0xee12 1fac0: 18 16 cp r1, r24 1fac2: 19 06 cpc r1, r25 1fac4: 84 f7 brge .-32 ; 0x1faa6 { SN[rxIndex] = MYSERIAL.read(); 1fac6: 0f 94 04 d6 call 0x3ac08 ; 0x3ac08 1faca: d6 01 movw r26, r12 1facc: 8d 93 st X+, r24 1face: 6d 01 movw r12, r26 rxIndex++; 1fad0: f3 94 inc r15 1fad2: e9 cf rjmp .-46 ; 0x1faa6 } } SN[rxIndex] = 0; 1fad4: 1c 8a std Y+20, r1 ; 0x14 // printf_P(PSTR("SN:%s\n"), SN); SN_valid = (strncmp_P(SN, PSTR("CZPX"), 4) == 0); 1fad6: 44 e0 ldi r20, 0x04 ; 4 1fad8: 50 e0 ldi r21, 0x00 ; 0 1fada: 6a e8 ldi r22, 0x8A ; 138 1fadc: 7d e8 ldi r23, 0x8D ; 141 1fade: c8 01 movw r24, r16 1fae0: 0f 94 fb d9 call 0x3b3f6 ; 0x3b3f6 ShortTimer timeout; selectedSerialPort = 0; timeout.start(); while (!SN_valid) 1fae4: 89 2b or r24, r25 1fae6: 59 f6 brne .-106 ; 0x1fa7e 1fae8: 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; 1faea: e0 92 39 05 sts 0x0539, r14 ; 0x800539 { 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)) 1faee: 88 23 and r24, r24 1faf0: 09 f4 brne .+2 ; 0x1faf4 1faf2: a7 c0 rjmp .+334 ; 0x1fc42 #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); 1faf4: 44 e1 ldi r20, 0x14 ; 20 1faf6: 50 e0 ldi r21, 0x00 ; 0 1faf8: 65 e1 ldi r22, 0x15 ; 21 1fafa: 7d e0 ldi r23, 0x0D ; 13 1fafc: c8 01 movw r24, r16 1fafe: 0f 94 30 dc call 0x3b860 ; 0x3b860 { eeprom_update_block_notify(SN, (uint8_t*)EEPROM_PRUSA_SN, 20); puts_P(PSTR("SN updated")); 1fb02: 81 e7 ldi r24, 0x71 ; 113 1fb04: 9e e8 ldi r25, 0x8E ; 142 } else puts_P(PSTR("SN update failed")); 1fb06: 0f 94 05 db call 0x3b60a ; 0x3b60a #ifndef XFLASH SERIAL_PROTOCOLLNPGM("start"); #else if ((optiboot_status != 0) || (selectedSerialPort != 0)) 1fb0a: a1 10 cpse r10, r1 1fb0c: 04 c0 rjmp .+8 ; 0x1fb16 1fb0e: 80 91 39 05 lds r24, 0x0539 ; 0x800539 1fb12: 88 23 and r24, r24 1fb14: 21 f0 breq .+8 ; 0x1fb1e SERIAL_PROTOCOLLNPGM("start"); 1fb16: 8a e5 ldi r24, 0x5A ; 90 1fb18: 9e e8 ldi r25, 0x8E ; 142 1fb1a: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 #endif SERIAL_ECHO_START; 1fb1e: 82 ec ldi r24, 0xC2 ; 194 1fb20: 9b ea ldi r25, 0xAB ; 171 1fb22: 0e 94 50 77 call 0xeea0 ; 0xeea0 puts_P(PSTR(" " FW_VERSION_FULL "_" FW_COMMIT_HASH)); 1fb26: 83 e4 ldi r24, 0x43 ; 67 1fb28: 9e e8 ldi r25, 0x8E ; 142 1fb2a: 0f 94 05 db call 0x3b60a ; 0x3b60a // by default the MMU shall remain disabled - PFW-1418 if (eeprom_init_default_byte((uint8_t *)EEPROM_MMU_ENABLED, 0)) { 1fb2e: 60 e0 ldi r22, 0x00 ; 0 1fb30: 8c ea ldi r24, 0xAC ; 172 1fb32: 9c e0 ldi r25, 0x0C ; 12 1fb34: 0e 94 09 76 call 0xec12 ; 0xec12 1fb38: 81 11 cpse r24, r1 MMU2::mmu2.Start(); 1fb3a: 0e 94 8e e3 call 0x1c71c ; 0x1c71c } MMU2::mmu2.Status(); 1fb3e: 0f 94 e3 74 call 0x2e9c6 ; 0x2e9c6 } void SpoolJoin::initSpoolJoinStatus() { // Useful information to see during bootup SERIAL_ECHOPGM("SpoolJoin is "); 1fb42: 82 e9 ldi r24, 0x92 ; 146 1fb44: 9d e8 ldi r25, 0x8D ; 141 1fb46: 0e 94 50 77 call 0xeea0 ; 0xeea0 uint8_t status = eeprom_init_default_byte((uint8_t*)EEPROM_SPOOL_JOIN, (uint8_t)EEPROM::Disabled); 1fb4a: 62 e0 ldi r22, 0x02 ; 2 1fb4c: 86 ed ldi r24, 0xD6 ; 214 1fb4e: 9e e0 ldi r25, 0x0E ; 14 1fb50: 0e 94 09 76 call 0xec12 ; 0xec12 if (status == (uint8_t)EEPROM::Enabled) 1fb54: 81 30 cpi r24, 0x01 ; 1 1fb56: 09 f0 breq .+2 ; 0x1fb5a 1fb58: 77 c0 rjmp .+238 ; 0x1fc48 { SERIAL_ECHOLNRPGM(_O(MSG_ON)); 1fb5a: 8b ed ldi r24, 0xDB ; 219 1fb5c: 9c e5 ldi r25, 0x5C ; 92 } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); 1fb5e: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 #endif #endif //DEBUG_SEC_LANG // Check startup - does nothing if bootloader sets MCUSR to 0 byte mcu = MCUSR; 1fb62: 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); 1fb64: f0 fe sbrs r15, 0 1fb66: 04 c0 rjmp .+8 ; 0x1fb70 1fb68: 8b e8 ldi r24, 0x8B ; 139 1fb6a: 9d e6 ldi r25, 0x6D ; 109 1fb6c: 0f 94 05 db call 0x3b60a ; 0x3b60a if (mcu & 2) puts_P(MSG_EXTERNAL_RESET); 1fb70: f1 fe sbrs r15, 1 1fb72: 04 c0 rjmp .+8 ; 0x1fb7c 1fb74: 8b e7 ldi r24, 0x7B ; 123 1fb76: 9d e6 ldi r25, 0x6D ; 109 1fb78: 0f 94 05 db call 0x3b60a ; 0x3b60a if (mcu & 4) puts_P(MSG_BROWNOUT_RESET); 1fb7c: f2 fe sbrs r15, 2 1fb7e: 04 c0 rjmp .+8 ; 0x1fb88 1fb80: 8a e6 ldi r24, 0x6A ; 106 1fb82: 9d e6 ldi r25, 0x6D ; 109 1fb84: 0f 94 05 db call 0x3b60a ; 0x3b60a if (mcu & 8) puts_P(MSG_WATCHDOG_RESET); 1fb88: f3 fe sbrs r15, 3 1fb8a: 04 c0 rjmp .+8 ; 0x1fb94 1fb8c: 8a e5 ldi r24, 0x5A ; 90 1fb8e: 9d e6 ldi r25, 0x6D ; 109 1fb90: 0f 94 05 db call 0x3b60a ; 0x3b60a if (mcu & 32) puts_P(MSG_SOFTWARE_RESET); 1fb94: f5 fe sbrs r15, 5 1fb96: 04 c0 rjmp .+8 ; 0x1fba0 1fb98: 8a e4 ldi r24, 0x4A ; 74 1fb9a: 9d e6 ldi r25, 0x6D ; 109 1fb9c: 0f 94 05 db call 0x3b60a ; 0x3b60a MCUSR = 0; 1fba0: 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; 1fba2: 82 ec ldi r24, 0xC2 ; 194 1fba4: 9b ea ldi r25, 0xAB ; 171 1fba6: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHORPGM(_n(" Last Updated: "));////MSG_CONFIGURATION_VER 1fbaa: 8a e3 ldi r24, 0x3A ; 58 1fbac: 9d e6 ldi r25, 0x6D ; 109 1fbae: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHOPGM(STRING_VERSION_CONFIG_H); 1fbb2: 8f e2 ldi r24, 0x2F ; 47 1fbb4: 9e e8 ldi r25, 0x8E ; 142 1fbb6: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHORPGM(_n(" | Author: "));////MSG_AUTHOR 1fbba: 8e e2 ldi r24, 0x2E ; 46 1fbbc: 9d e6 ldi r25, 0x6D ; 109 1fbbe: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHOLNPGM(STRING_CONFIG_H_AUTHOR); 1fbc2: 87 e2 ldi r24, 0x27 ; 39 1fbc4: 9e e8 ldi r25, 0x8E ; 142 1fbc6: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 #endif #endif SERIAL_ECHO_START; 1fbca: 82 ec ldi r24, 0xC2 ; 194 1fbcc: 9b ea ldi r25, 0xAB ; 171 1fbce: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHORPGM(_n(" Free Memory: "));////MSG_FREE_MEMORY 1fbd2: 8f e1 ldi r24, 0x1F ; 31 1fbd4: 9d e6 ldi r25, 0x6D ; 109 1fbd6: 0e 94 50 77 call 0xeea0 ; 0xeea0 /** Amount of free RAM * \return The number of free bytes. */ int SdFatUtil::FreeRam() { char top; return __brkval ? &top - __brkval : &top - &__bss_end; 1fbda: 80 91 16 18 lds r24, 0x1816 ; 0x801816 <__brkval> 1fbde: 90 91 17 18 lds r25, 0x1817 ; 0x801817 <__brkval+0x1> 1fbe2: 00 97 sbiw r24, 0x00 ; 0 1fbe4: a1 f1 breq .+104 ; 0x1fc4e 1fbe6: 08 1b sub r16, r24 1fbe8: 19 0b sbc r17, r25 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 1fbea: b8 01 movw r22, r16 1fbec: 11 0f add r17, r17 1fbee: 88 0b sbc r24, r24 1fbf0: 99 0b sbc r25, r25 1fbf2: 0f 94 6b d5 call 0x3aad6 ; 0x3aad6 SERIAL_ECHO(freeMemory()); SERIAL_ECHORPGM(_n(" PlannerBufferBytes: "));////MSG_PLANNER_BUFFER_BYTES 1fbf6: 88 e0 ldi r24, 0x08 ; 8 1fbf8: 9d e6 ldi r25, 0x6D ; 109 1fbfa: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHOLN((int)sizeof(block_t)*BLOCK_BUFFER_SIZE); 1fbfe: 80 ee ldi r24, 0xE0 ; 224 1fc00: 96 e0 ldi r25, 0x06 ; 6 1fc02: 0f 94 f5 74 call 0x2e9ea ; 0x2e9ea #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); 1fc06: 6c e2 ldi r22, 0x2C ; 44 1fc08: 71 e0 ldi r23, 0x01 ; 1 1fc0a: 8e ee ldi r24, 0xEE ; 238 1fc0c: 9e e0 ldi r25, 0x0E ; 14 1fc0e: 0e 94 f1 75 call 0xebe2 ; 0xebe2 1fc12: 8c 01 movw r16, r24 uint16_t motherboard = eeprom_init_default_word((uint16_t*)EEPROM_BOARD_TYPE, MOTHERBOARD); 1fc14: 66 e3 ldi r22, 0x36 ; 54 1fc16: 71 e0 ldi r23, 0x01 ; 1 1fc18: 8c ee ldi r24, 0xEC ; 236 1fc1a: 9e e0 ldi r25, 0x0E ; 14 1fc1c: 0e 94 f1 75 call 0xebe2 ; 0xebe2 if (printer_type != PRINTER_TYPE) version_changed |= 0b10; 1fc20: 0c 32 cpi r16, 0x2C ; 44 1fc22: 11 40 sbci r17, 0x01 ; 1 1fc24: 11 f0 breq .+4 ; 0x1fc2a 1fc26: 0d 94 0b 06 jmp 0x20c16 ; 0x20c16 if (motherboard != MOTHERBOARD) version_changed |= 0b01; 1fc2a: 01 e0 ldi r16, 0x01 ; 1 1fc2c: 86 33 cpi r24, 0x36 ; 54 1fc2e: 91 40 sbci r25, 0x01 ; 1 1fc30: 09 f4 brne .+2 ; 0x1fc34 1fc32: 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(); 1fc34: 0e 94 ac 93 call 0x12758 ; 0x12758 1fc38: f8 2e mov r15, r24 1fc3a: 0d 94 13 06 jmp 0x20c26 ; 0x20c26 _delay(50); MYSERIAL.flush(); //clear RX buffer SERIAL_ECHOLNRPGM(PSTR(";S")); while (rxIndex < 19) { if (timeout.expired(250u)) 1fc3e: 80 e0 ldi r24, 0x00 ; 0 1fc40: 54 cf rjmp .-344 ; 0x1faea { eeprom_update_block_notify(SN, (uint8_t*)EEPROM_PRUSA_SN, 20); puts_P(PSTR("SN updated")); } else puts_P(PSTR("SN update failed")); 1fc42: 80 e6 ldi r24, 0x60 ; 96 1fc44: 9e e8 ldi r25, 0x8E ; 142 1fc46: 5f cf rjmp .-322 ; 0x1fb06 1fc48: 85 ed ldi r24, 0xD5 ; 213 1fc4a: 9c e5 ldi r25, 0x5C ; 92 1fc4c: 88 cf rjmp .-240 ; 0x1fb5e 1fc4e: 00 52 subi r16, 0x20 ; 32 1fc50: 18 41 sbci r17, 0x18 ; 24 1fc52: cb cf rjmp .-106 ; 0x1fbea minttemp_raw[0] -= OVERSAMPLENR; #endif } #endif //MINTEMP #ifdef HEATER_0_MAXTEMP maxttemp[0] = HEATER_0_MAXTEMP; 1fc54: 81 e3 ldi r24, 0x31 ; 49 1fc56: 91 e0 ldi r25, 0x01 ; 1 1fc58: 90 93 57 02 sts 0x0257, r25 ; 0x800257 <_ZL8maxttemp.lto_priv.470+0x1> 1fc5c: 80 93 56 02 sts 0x0256, r24 ; 0x800256 <_ZL8maxttemp.lto_priv.470> while(analog2temp(maxttemp_raw[0], 0) > HEATER_0_MAXTEMP) { 1fc60: 80 91 a1 04 lds r24, 0x04A1 ; 0x8004a1 <_ZL12maxttemp_raw.lto_priv.463> 1fc64: 90 91 a2 04 lds r25, 0x04A2 ; 0x8004a2 <_ZL12maxttemp_raw.lto_priv.463+0x1> 1fc68: 0f 94 1c a1 call 0x34238 ; 0x34238 1fc6c: 20 e0 ldi r18, 0x00 ; 0 1fc6e: 30 e8 ldi r19, 0x80 ; 128 1fc70: 48 e9 ldi r20, 0x98 ; 152 1fc72: 53 e4 ldi r21, 0x43 ; 67 1fc74: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 1fc78: 18 16 cp r1, r24 1fc7a: 54 f4 brge .+20 ; 0x1fc90 #if HEATER_0_RAW_LO_TEMP < HEATER_0_RAW_HI_TEMP maxttemp_raw[0] -= OVERSAMPLENR; #else maxttemp_raw[0] += OVERSAMPLENR; 1fc7c: 80 91 a1 04 lds r24, 0x04A1 ; 0x8004a1 <_ZL12maxttemp_raw.lto_priv.463> 1fc80: 90 91 a2 04 lds r25, 0x04A2 ; 0x8004a2 <_ZL12maxttemp_raw.lto_priv.463+0x1> 1fc84: 40 96 adiw r24, 0x10 ; 16 1fc86: 90 93 a2 04 sts 0x04A2, r25 ; 0x8004a2 <_ZL12maxttemp_raw.lto_priv.463+0x1> 1fc8a: 80 93 a1 04 sts 0x04A1, r24 ; 0x8004a1 <_ZL12maxttemp_raw.lto_priv.463> 1fc8e: e8 cf rjmp .-48 ; 0x1fc60 #endif } #endif //MAXTEMP #ifdef BED_MINTEMP while(analog2tempBed(bed_minttemp_raw) < BED_MINTEMP) { 1fc90: 80 91 52 02 lds r24, 0x0252 ; 0x800252 <_ZL16bed_minttemp_raw.lto_priv.471> 1fc94: 90 91 53 02 lds r25, 0x0253 ; 0x800253 <_ZL16bed_minttemp_raw.lto_priv.471+0x1> 1fc98: 0f 94 b6 34 call 0x2696c ; 0x2696c 1fc9c: 20 e0 ldi r18, 0x00 ; 0 1fc9e: 30 e0 ldi r19, 0x00 ; 0 1fca0: 40 e2 ldi r20, 0x20 ; 32 1fca2: 51 e4 ldi r21, 0x41 ; 65 1fca4: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 1fca8: 87 ff sbrs r24, 7 1fcaa: 0a c0 rjmp .+20 ; 0x1fcc0 #if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP bed_minttemp_raw += OVERSAMPLENR; #else bed_minttemp_raw -= OVERSAMPLENR; 1fcac: 80 91 52 02 lds r24, 0x0252 ; 0x800252 <_ZL16bed_minttemp_raw.lto_priv.471> 1fcb0: 90 91 53 02 lds r25, 0x0253 ; 0x800253 <_ZL16bed_minttemp_raw.lto_priv.471+0x1> 1fcb4: 40 97 sbiw r24, 0x10 ; 16 1fcb6: 90 93 53 02 sts 0x0253, r25 ; 0x800253 <_ZL16bed_minttemp_raw.lto_priv.471+0x1> 1fcba: 80 93 52 02 sts 0x0252, r24 ; 0x800252 <_ZL16bed_minttemp_raw.lto_priv.471> 1fcbe: e8 cf rjmp .-48 ; 0x1fc90 #endif } #endif //BED_MINTEMP #ifdef BED_MAXTEMP while(analog2tempBed(bed_maxttemp_raw) > BED_MAXTEMP) { 1fcc0: 80 91 9f 04 lds r24, 0x049F ; 0x80049f <_ZL16bed_maxttemp_raw.lto_priv.464> 1fcc4: 90 91 a0 04 lds r25, 0x04A0 ; 0x8004a0 <_ZL16bed_maxttemp_raw.lto_priv.464+0x1> 1fcc8: 0f 94 b6 34 call 0x2696c ; 0x2696c 1fccc: 20 e0 ldi r18, 0x00 ; 0 1fcce: 30 e0 ldi r19, 0x00 ; 0 1fcd0: 4a ef ldi r20, 0xFA ; 250 1fcd2: 52 e4 ldi r21, 0x42 ; 66 1fcd4: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 1fcd8: 18 16 cp r1, r24 1fcda: 54 f4 brge .+20 ; 0x1fcf0 #if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP bed_maxttemp_raw -= OVERSAMPLENR; #else bed_maxttemp_raw += OVERSAMPLENR; 1fcdc: 80 91 9f 04 lds r24, 0x049F ; 0x80049f <_ZL16bed_maxttemp_raw.lto_priv.464> 1fce0: 90 91 a0 04 lds r25, 0x04A0 ; 0x8004a0 <_ZL16bed_maxttemp_raw.lto_priv.464+0x1> 1fce4: 40 96 adiw r24, 0x10 ; 16 1fce6: 90 93 a0 04 sts 0x04A0, r25 ; 0x8004a0 <_ZL16bed_maxttemp_raw.lto_priv.464+0x1> 1fcea: 80 93 9f 04 sts 0x049F, r24 ; 0x80049f <_ZL16bed_maxttemp_raw.lto_priv.464> 1fcee: e8 cf rjmp .-48 ; 0x1fcc0 #endif } #endif //BED_MAXTEMP #ifdef AMBIENT_MINTEMP while(analog2tempAmbient(ambient_minttemp_raw) < AMBIENT_MINTEMP) { 1fcf0: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL20ambient_minttemp_raw.lto_priv.462> 1fcf4: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL20ambient_minttemp_raw.lto_priv.462+0x1> 1fcf8: 0f 94 21 34 call 0x26842 ; 0x26842 1fcfc: 20 e0 ldi r18, 0x00 ; 0 1fcfe: 30 e0 ldi r19, 0x00 ; 0 1fd00: 40 ef ldi r20, 0xF0 ; 240 1fd02: 51 ec ldi r21, 0xC1 ; 193 1fd04: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 1fd08: 87 ff sbrs r24, 7 1fd0a: 0a c0 rjmp .+20 ; 0x1fd20 #if AMBIENT_RAW_LO_TEMP < AMBIENT_RAW_HI_TEMP ambient_minttemp_raw += OVERSAMPLENR; #else ambient_minttemp_raw -= OVERSAMPLENR; 1fd0c: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL20ambient_minttemp_raw.lto_priv.462> 1fd10: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL20ambient_minttemp_raw.lto_priv.462+0x1> 1fd14: 40 97 sbiw r24, 0x10 ; 16 1fd16: 90 93 51 02 sts 0x0251, r25 ; 0x800251 <_ZL20ambient_minttemp_raw.lto_priv.462+0x1> 1fd1a: 80 93 50 02 sts 0x0250, r24 ; 0x800250 <_ZL20ambient_minttemp_raw.lto_priv.462> 1fd1e: e8 cf rjmp .-48 ; 0x1fcf0 #endif } #endif //AMBIENT_MINTEMP #ifdef AMBIENT_MAXTEMP while(analog2tempAmbient(ambient_maxttemp_raw) > AMBIENT_MAXTEMP) { 1fd20: 80 91 9d 04 lds r24, 0x049D ; 0x80049d <_ZL20ambient_maxttemp_raw.lto_priv.465> 1fd24: 90 91 9e 04 lds r25, 0x049E ; 0x80049e <_ZL20ambient_maxttemp_raw.lto_priv.465+0x1> 1fd28: 0f 94 21 34 call 0x26842 ; 0x26842 1fd2c: 20 e0 ldi r18, 0x00 ; 0 1fd2e: 30 e0 ldi r19, 0x00 ; 0 1fd30: 40 ea ldi r20, 0xA0 ; 160 1fd32: 52 e4 ldi r21, 0x42 ; 66 1fd34: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 1fd38: 18 16 cp r1, r24 1fd3a: 54 f4 brge .+20 ; 0x1fd50 #if AMBIENT_RAW_LO_TEMP < AMBIENT_RAW_HI_TEMP ambient_maxttemp_raw -= OVERSAMPLENR; #else ambient_maxttemp_raw += OVERSAMPLENR; 1fd3c: 80 91 9d 04 lds r24, 0x049D ; 0x80049d <_ZL20ambient_maxttemp_raw.lto_priv.465> 1fd40: 90 91 9e 04 lds r25, 0x049E ; 0x80049e <_ZL20ambient_maxttemp_raw.lto_priv.465+0x1> 1fd44: 40 96 adiw r24, 0x10 ; 16 1fd46: 90 93 9e 04 sts 0x049E, r25 ; 0x80049e <_ZL20ambient_maxttemp_raw.lto_priv.465+0x1> 1fd4a: 80 93 9d 04 sts 0x049D, r24 ; 0x80049d <_ZL20ambient_maxttemp_raw.lto_priv.465> 1fd4e: e8 cf rjmp .-48 ; 0x1fd20 #include #include "macros.h" void timer0_init(void) { CRITICAL_SECTION_START; 1fd50: 9f b7 in r25, 0x3f ; 63 1fd52: f8 94 cli TCNT0 = 0; 1fd54: 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; 1fd56: 8f ef ldi r24, 0xFF ; 255 1fd58: 88 bd out 0x28, r24 ; 40 // Set fast PWM mode and inverting mode. TCCR0A = (1 << WGM01) | (1 << WGM00) | (1 << COM0B1) | (1 << COM0B0); 1fd5a: 83 e3 ldi r24, 0x33 ; 51 1fd5c: 84 bd out 0x24, r24 ; 36 TCCR0B = (1 << CS01); // CLK/8 prescaling 1fd5e: 12 e0 ldi r17, 0x02 ; 2 1fd60: 15 bd out 0x25, r17 ; 37 TIMSK0 |= (1 << TOIE0); // enable timer overflow interrupt 1fd62: 80 91 6e 00 lds r24, 0x006E ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> 1fd66: 81 60 ori r24, 0x01 ; 1 1fd68: 80 93 6e 00 sts 0x006E, r24 ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> CRITICAL_SECTION_END; 1fd6c: 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; 1fd6e: 80 e8 ldi r24, 0x80 ; 128 1fd70: 80 93 b4 00 sts 0x00B4, r24 ; 0x8000b4 <__TEXT_REGION_LENGTH__+0x7c20b4> ENABLE_SOFT_PWM_INTERRUPT(); 1fd74: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 1fd78: 84 60 ori r24, 0x04 ; 4 1fd7a: 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; 1fd7e: 2f b7 in r18, 0x3f ; 63 1fd80: f8 94 cli SET_OUTPUT(BEEPER); 1fd82: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1fd86: 84 60 ori r24, 0x04 ; 4 1fd88: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> WRITE(BEEPER, LOW); 1fd8c: 9f b7 in r25, 0x3f ; 63 1fd8e: f8 94 cli 1fd90: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1fd94: 8b 7f andi r24, 0xFB ; 251 1fd96: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1fd9a: 9f bf out 0x3f, r25 ; 63 SET_OUTPUT(EXTRUDER_0_AUTO_FAN_PIN); 1fd9c: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1fda0: 80 62 ori r24, 0x20 ; 32 1fda2: 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); 1fda6: 81 e0 ldi r24, 0x01 ; 1 1fda8: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> TCCR4B = _BV(WGM43) | _BV(CS42) | _BV(CS40); 1fdac: 85 e1 ldi r24, 0x15 ; 21 1fdae: 80 93 a1 00 sts 0x00A1, r24 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> OCR4A = 255U; 1fdb2: 8f ef ldi r24, 0xFF ; 255 1fdb4: 90 e0 ldi r25, 0x00 ; 0 1fdb6: 90 93 a9 00 sts 0x00A9, r25 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 1fdba: 80 93 a8 00 sts 0x00A8, r24 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> OCR4B = 255U; 1fdbe: 90 93 ab 00 sts 0x00AB, r25 ; 0x8000ab <__TEXT_REGION_LENGTH__+0x7c20ab> 1fdc2: 80 93 aa 00 sts 0x00AA, r24 ; 0x8000aa <__TEXT_REGION_LENGTH__+0x7c20aa> OCR4C = 255U; 1fdc6: 90 93 ad 00 sts 0x00AD, r25 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 1fdca: 80 93 ac 00 sts 0x00AC, r24 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> TIMSK4 = 0; 1fdce: 10 92 72 00 sts 0x0072, r1 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 1fdd2: 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")); 1fdd4: 80 ea ldi r24, 0xA0 ; 160 1fdd6: 9d e8 ldi r25, 0x8D ; 141 1fdd8: 0f 94 05 db call 0x3b60a ; 0x3b60a DIDR0 = ((ADC_CHAN_MSK & ADC_DIDR_MSK) & 0xff); //disable digital inputs PORTF 1fddc: 8f e5 ldi r24, 0x5F ; 95 1fdde: 80 93 7e 00 sts 0x007E, r24 ; 0x80007e <__TEXT_REGION_LENGTH__+0x7c207e> DIDR2 = ((ADC_CHAN_MSK & ADC_DIDR_MSK) >> 8); //disable digital inputs PORTK 1fde2: 10 93 7d 00 sts 0x007D, r17 ; 0x80007d <__TEXT_REGION_LENGTH__+0x7c207d> ADMUX |= (1 << REFS0); //use AVCC as reference 1fde6: 80 91 7c 00 lds r24, 0x007C ; 0x80007c <__TEXT_REGION_LENGTH__+0x7c207c> 1fdea: 80 64 ori r24, 0x40 ; 64 1fdec: 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); 1fdf0: 8f e9 ldi r24, 0x9F ; 159 1fdf2: 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(); 1fdf6: 0e 94 d7 8d call 0x11bae ; 0x11bae // initialize temperature timer ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 1fdfa: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 1fdfc: f8 94 cli // CTC TCCRxB &= ~(1< 1fe02: 8f 7e andi r24, 0xEF ; 239 1fe04: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> TCCRxB |= (1< 1fe0c: 88 60 ori r24, 0x08 ; 8 1fe0e: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> TCCRxA &= ~(1< 1fe16: 8d 7f andi r24, 0xFD ; 253 1fe18: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> TCCRxA &= ~(1< 1fe20: 8e 7f andi r24, 0xFE ; 254 1fe22: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> // output mode = 00 (disconnected) TCCRxA &= ~(3< 1fe2a: 8f 73 andi r24, 0x3F ; 63 1fe2c: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> TCCRxA &= ~(3< 1fe34: 8f 7c andi r24, 0xCF ; 207 1fe36: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> // x/256 prescaler TCCRxB |= (1< 1fe3e: 84 60 ori r24, 0x04 ; 4 1fe40: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> TCCRxB &= ~(1< 1fe48: 8d 7f andi r24, 0xFD ; 253 1fe4a: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> TCCRxB &= ~(1< 1fe52: 8e 7f andi r24, 0xFE ; 254 1fe54: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> // reset counter TCNTx = 0; 1fe58: 10 92 25 01 sts 0x0125, r1 ; 0x800125 <__TEXT_REGION_LENGTH__+0x7c2125> 1fe5c: 10 92 24 01 sts 0x0124, r1 ; 0x800124 <__TEXT_REGION_LENGTH__+0x7c2124> OCRxA = TEMP_TIM_OCRA_OVF; 1fe60: 2b ee ldi r18, 0xEB ; 235 1fe62: 31 e4 ldi r19, 0x41 ; 65 1fe64: 30 93 29 01 sts 0x0129, r19 ; 0x800129 <__TEXT_REGION_LENGTH__+0x7c2129> 1fe68: 20 93 28 01 sts 0x0128, r18 ; 0x800128 <__TEXT_REGION_LENGTH__+0x7c2128> // clear pending interrupts, enable COMPA TEMP_MGR_INT_FLAG_CLEAR(); 1fe6c: d1 9a sbi 0x1a, 1 ; 26 ENABLE_TEMP_MGR_INTERRUPT(); 1fe6e: 80 91 73 00 lds r24, 0x0073 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> 1fe72: 82 60 ori r24, 0x02 ; 2 1fe74: 80 93 73 00 sts 0x0073, r24 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 1fe78: 9f bf out 0x3f, r25 ; 63 // SERIAL_ECHOLNPGM("planner_recalculate - 4"); } void plan_init() { block_buffer_head = 0; 1fe7a: 10 92 a5 0d sts 0x0DA5, r1 ; 0x800da5 block_buffer_tail = 0; 1fe7e: 10 92 a6 0d sts 0x0DA6, r1 ; 0x800da6 memset(position, 0, sizeof(position)); // clear position 1fe82: 80 e1 ldi r24, 0x10 ; 16 1fe84: e3 ea ldi r30, 0xA3 ; 163 1fe86: f6 e0 ldi r31, 0x06 ; 6 1fe88: df 01 movw r26, r30 1fe8a: 28 2f mov r18, r24 1fe8c: 1d 92 st X+, r1 1fe8e: 2a 95 dec r18 1fe90: e9 f7 brne .-6 ; 0x1fe8c #ifdef LIN_ADVANCE memset(position_float, 0, sizeof(position_float)); // clear position 1fe92: ed ec ldi r30, 0xCD ; 205 1fe94: f4 e0 ldi r31, 0x04 ; 4 1fe96: df 01 movw r26, r30 1fe98: 28 2f mov r18, r24 1fe9a: 1d 92 st X+, r1 1fe9c: 2a 95 dec r18 1fe9e: e9 f7 brne .-6 ; 0x1fe9a #endif memset(previous_speed, 0, sizeof(previous_speed)); 1fea0: ed eb ldi r30, 0xBD ; 189 1fea2: f4 e0 ldi r31, 0x04 ; 4 1fea4: df 01 movw r26, r30 1fea6: 1d 92 st X+, r1 1fea8: 8a 95 dec r24 1feaa: e9 f7 brne .-6 ; 0x1fea6 previous_nominal_speed = 0.0; 1feac: 10 92 b9 04 sts 0x04B9, r1 ; 0x8004b9 <_ZL22previous_nominal_speed.lto_priv.488> 1feb0: 10 92 ba 04 sts 0x04BA, r1 ; 0x8004ba <_ZL22previous_nominal_speed.lto_priv.488+0x1> 1feb4: 10 92 bb 04 sts 0x04BB, r1 ; 0x8004bb <_ZL22previous_nominal_speed.lto_priv.488+0x2> 1feb8: 10 92 bc 04 sts 0x04BC, r1 ; 0x8004bc <_ZL22previous_nominal_speed.lto_priv.488+0x3> plan_reset_next_e_queue = false; 1febc: 10 92 b8 04 sts 0x04B8, r1 ; 0x8004b8 <_ZL23plan_reset_next_e_queue.lto_priv.486> plan_reset_next_e_sched = false; 1fec0: 10 92 b7 04 sts 0x04B7, r1 ; 0x8004b7 <_ZL23plan_reset_next_e_sched.lto_priv.487> } void factory_reset() { KEEPALIVE_STATE(PAUSED_FOR_USER); 1fec4: 84 e0 ldi r24, 0x04 ; 4 1fec6: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be if (!READ(BTN_ENC)) 1feca: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 1fece: 86 fd sbrc r24, 6 1fed0: ca c0 rjmp .+404 ; 0x20066 1fed2: bf ef ldi r27, 0xFF ; 255 1fed4: e3 ed ldi r30, 0xD3 ; 211 1fed6: f0 e3 ldi r31, 0x30 ; 48 1fed8: b1 50 subi r27, 0x01 ; 1 1feda: e0 40 sbci r30, 0x00 ; 0 1fedc: f0 40 sbci r31, 0x00 ; 0 1fede: e1 f7 brne .-8 ; 0x1fed8 1fee0: 00 c0 rjmp .+0 ; 0x1fee2 1fee2: 00 00 nop { _delay_ms(1000); if (!READ(BTN_ENC)) 1fee4: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 1fee8: 86 fd sbrc r24, 6 1feea: bd c0 rjmp .+378 ; 0x20066 { lcd_clear(); 1feec: 0e 94 13 6f call 0xde26 ; 0xde26 lcd_puts_P(PSTR("Factory RESET")); 1fef0: 8a ef ldi r24, 0xFA ; 250 1fef2: 9d e8 ldi r25, 0x8D ; 141 1fef4: 0e 94 cb 6e call 0xdd96 ; 0xdd96 SET_OUTPUT(BEEPER); 1fef8: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1fefc: 84 60 ori r24, 0x04 ; 4 1fefe: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> if(eSoundMode!=e_SOUND_MODE_SILENT) 1ff02: 80 91 de 04 lds r24, 0x04DE ; 0x8004de 1ff06: 82 30 cpi r24, 0x02 ; 2 1ff08: 41 f0 breq .+16 ; 0x1ff1a WRITE(BEEPER, HIGH); 1ff0a: 9f b7 in r25, 0x3f ; 63 1ff0c: f8 94 cli 1ff0e: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1ff12: 84 60 ori r24, 0x04 ; 4 1ff14: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1ff18: 9f bf out 0x3f, r25 ; 63 while (!READ(BTN_ENC)); 1ff1a: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 1ff1e: 86 ff sbrs r24, 6 1ff20: fc cf rjmp .-8 ; 0x1ff1a WRITE(BEEPER, LOW); 1ff22: 9f b7 in r25, 0x3f ; 63 1ff24: f8 94 cli 1ff26: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1ff2a: 8b 7f andi r24, 0xFB ; 251 1ff2c: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1ff30: 9f bf out 0x3f, r25 ; 63 1ff32: 2f ef ldi r18, 0xFF ; 255 1ff34: 37 ea ldi r19, 0xA7 ; 167 1ff36: 81 e6 ldi r24, 0x61 ; 97 1ff38: 21 50 subi r18, 0x01 ; 1 1ff3a: 30 40 sbci r19, 0x00 ; 0 1ff3c: 80 40 sbci r24, 0x00 ; 0 1ff3e: e1 f7 brne .-8 ; 0x1ff38 1ff40: 00 c0 rjmp .+0 ; 0x1ff42 1ff42: 00 00 nop PSTR("Language"), PSTR("Statistics"), PSTR("Shipping prep"), PSTR("Service prep"), PSTR("All Data"), }; 1ff44: 80 ee ldi r24, 0xE0 ; 224 1ff46: 9d e8 ldi r25, 0x8D ; 141 1ff48: 9a 83 std Y+2, r25 ; 0x02 1ff4a: 89 83 std Y+1, r24 ; 0x01 1ff4c: 85 ed ldi r24, 0xD5 ; 213 1ff4e: 9d e8 ldi r25, 0x8D ; 141 1ff50: 9c 83 std Y+4, r25 ; 0x04 1ff52: 8b 83 std Y+3, r24 ; 0x03 1ff54: 87 ec ldi r24, 0xC7 ; 199 1ff56: 9d e8 ldi r25, 0x8D ; 141 1ff58: 9e 83 std Y+6, r25 ; 0x06 1ff5a: 8d 83 std Y+5, r24 ; 0x05 1ff5c: 8a eb ldi r24, 0xBA ; 186 1ff5e: 9d e8 ldi r25, 0x8D ; 141 1ff60: 98 87 std Y+8, r25 ; 0x08 1ff62: 8f 83 std Y+7, r24 ; 0x07 1ff64: 81 eb ldi r24, 0xB1 ; 177 1ff66: 9d e8 ldi r25, 0x8D ; 141 1ff68: 9a 87 std Y+10, r25 ; 0x0a 1ff6a: 89 87 std Y+9, r24 ; 0x09 lcd_clear(); 1ff6c: 0e 94 13 6f call 0xde26 ; 0xde26 lcd_putc_at(0, 0, '>'); 1ff70: 4e e3 ldi r20, 0x3E ; 62 1ff72: 60 e0 ldi r22, 0x00 ; 0 1ff74: 80 e0 ldi r24, 0x00 ; 0 1ff76: 0e 94 00 6f call 0xde00 ; 0xde00 lcd_consume_click(); 1ff7a: 0e 94 f8 70 call 0xe1f0 ; 0xe1f0 } } char reset_menu() { static int8_t first = 0; char cursor_pos = 0; 1ff7e: 10 e0 ldi r17, 0x00 ; 0 1ff80: d1 2c mov r13, r1 1ff82: 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]); 1ff84: 80 91 dd 04 lds r24, 0x04DD ; 0x8004dd 1ff88: f6 01 movw r30, r12 1ff8a: e8 0f add r30, r24 1ff8c: f1 1d adc r31, r1 1ff8e: 87 fd sbrc r24, 7 1ff90: fa 95 dec r31 1ff92: ee 0f add r30, r30 1ff94: ff 1f adc r31, r31 1ff96: a1 e0 ldi r26, 0x01 ; 1 1ff98: b0 e0 ldi r27, 0x00 ; 0 1ff9a: ac 0f add r26, r28 1ff9c: bd 1f adc r27, r29 1ff9e: ea 0f add r30, r26 1ffa0: fb 1f adc r31, r27 1ffa2: 40 81 ld r20, Z 1ffa4: 51 81 ldd r21, Z+1 ; 0x01 1ffa6: 6c 2d mov r22, r12 1ffa8: 81 e0 ldi r24, 0x01 ; 1 1ffaa: 0e 94 f4 6e call 0xdde8 ; 0xdde8 1ffae: bf ef ldi r27, 0xFF ; 255 1ffb0: cb 1a sub r12, r27 1ffb2: 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++) { 1ffb4: e4 e0 ldi r30, 0x04 ; 4 1ffb6: ce 16 cp r12, r30 1ffb8: d1 04 cpc r13, r1 1ffba: 21 f7 brne .-56 ; 0x1ff84 lcd_puts_at_P(1, i, item[first + i]); } manage_heater(); 1ffbc: 0f 94 5c 38 call 0x270b8 ; 0x270b8 manage_inactivity(true); 1ffc0: 81 e0 ldi r24, 0x01 ; 1 1ffc2: 0e 94 af 8a call 0x1155e ; 0x1155e if (lcd_encoder) { 1ffc6: 80 91 70 06 lds r24, 0x0670 ; 0x800670 1ffca: 90 91 71 06 lds r25, 0x0671 ; 0x800671 1ffce: 00 97 sbiw r24, 0x00 ; 0 1ffd0: 71 f1 breq .+92 ; 0x2002e if (lcd_encoder < 0) { 1ffd2: 97 ff sbrs r25, 7 1ffd4: 12 c0 rjmp .+36 ; 0x1fffa cursor_pos--; 1ffd6: 11 50 subi r17, 0x01 ; 1 if (lcd_encoder > 0) { cursor_pos++; } if (cursor_pos > 3) { 1ffd8: 14 30 cpi r17, 0x04 ; 4 1ffda: 0c f4 brge .+2 ; 0x1ffde 1ffdc: a6 c0 rjmp .+332 ; 0x2012a cursor_pos = 3; Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 1ffde: 87 e0 ldi r24, 0x07 ; 7 1ffe0: 0f 94 07 4e call 0x29c0e ; 0x29c0e if (first < (uint8_t)(sizeof(item) / sizeof(item[0])) - 4) { 1ffe4: 80 91 dd 04 lds r24, 0x04DD ; 0x8004dd 1ffe8: 18 16 cp r1, r24 1ffea: 2c f0 brlt .+10 ; 0x1fff6 first++; 1ffec: 8f 5f subi r24, 0xFF ; 255 1ffee: 80 93 dd 04 sts 0x04DD, r24 ; 0x8004dd lcd_clear(); 1fff2: 0e 94 13 6f call 0xde26 ; 0xde26 if (lcd_encoder > 0) { cursor_pos++; } if (cursor_pos > 3) { cursor_pos = 3; 1fff6: 13 e0 ldi r17, 0x03 ; 3 1fff8: 03 c0 rjmp .+6 ; 0x20000 if (lcd_encoder < 0) { cursor_pos--; } if (lcd_encoder > 0) { cursor_pos++; 1fffa: 1f 5f subi r17, 0xFF ; 255 } if (cursor_pos > 3) { 1fffc: 14 30 cpi r17, 0x04 ; 4 1fffe: 78 f7 brcc .-34 ; 0x1ffde if (first > 0) { first--; lcd_clear(); } } lcd_puts_at_P(0, 0, PSTR(" \n \n \n ")); 20000: 49 ea ldi r20, 0xA9 ; 169 20002: 5d e8 ldi r21, 0x8D ; 141 20004: 60 e0 ldi r22, 0x00 ; 0 20006: 80 e0 ldi r24, 0x00 ; 0 20008: 0e 94 f4 6e call 0xdde8 ; 0xdde8 lcd_set_cursor(0, cursor_pos); 2000c: 61 2f mov r22, r17 2000e: 80 e0 ldi r24, 0x00 ; 0 20010: 0e 94 e0 6e call 0xddc0 ; 0xddc0 lcd_putc('>'); 20014: 8e e3 ldi r24, 0x3E ; 62 20016: 0e 94 cf 6e call 0xdd9e ; 0xdd9e lcd_encoder = 0; 2001a: 10 92 71 06 sts 0x0671, r1 ; 0x800671 2001e: 10 92 70 06 sts 0x0670, r1 ; 0x800670 _delay(100); 20022: 64 e6 ldi r22, 0x64 ; 100 20024: 70 e0 ldi r23, 0x00 ; 0 20026: 80 e0 ldi r24, 0x00 ; 0 20028: 90 e0 ldi r25, 0x00 ; 0 2002a: 0f 94 53 27 call 0x24ea6 ; 0x24ea6 } if (lcd_clicked()) { 2002e: 0e 94 fd 70 call 0xe1fa ; 0xe1fa 20032: 88 23 and r24, r24 20034: 09 f4 brne .+2 ; 0x20038 20036: a4 cf rjmp .-184 ; 0x1ff80 return(cursor_pos + first); 20038: 80 91 dd 04 lds r24, 0x04DD ; 0x8004dd 2003c: 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(); 2003e: 0e 94 13 6f call 0xde26 ; 0xde26 Sound_MakeCustom(100,0,false); 20042: 40 e0 ldi r20, 0x00 ; 0 20044: 70 e0 ldi r23, 0x00 ; 0 20046: 60 e0 ldi r22, 0x00 ; 0 20048: 84 e6 ldi r24, 0x64 ; 100 2004a: 90 e0 ldi r25, 0x00 ; 0 2004c: 0f 94 46 51 call 0x2a28c ; 0x2a28c switch (level) { 20050: 12 30 cpi r17, 0x02 ; 2 20052: 09 f4 brne .+2 ; 0x20056 20054: a0 c0 rjmp .+320 ; 0x20196 20056: 08 f0 brcs .+2 ; 0x2005a 20058: 79 c0 rjmp .+242 ; 0x2014c 2005a: 11 23 and r17, r17 2005c: 09 f4 brne .+2 ; 0x20060 2005e: 93 c0 rjmp .+294 ; 0x20186 20060: 11 30 cpi r17, 0x01 ; 1 20062: 09 f4 brne .+2 ; 0x20066 20064: 93 c0 rjmp .+294 ; 0x2018c case 4: _delay_ms(0); break; } } } KEEPALIVE_STATE(IN_HANDLER); 20066: 82 e0 ldi r24, 0x02 ; 2 20068: 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); 2006c: 60 e0 ldi r22, 0x00 ; 0 2006e: 8f ef ldi r24, 0xFF ; 255 20070: 9f e0 ldi r25, 0x0F ; 15 20072: 0e 94 09 76 call 0xec12 ; 0xec12 eeprom_init_default_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 1); //run wizard if uninitialized 20076: 61 e0 ldi r22, 0x01 ; 1 20078: 8f e5 ldi r24, 0x5F ; 95 2007a: 9f e0 ldi r25, 0x0F ; 15 2007c: 0e 94 09 76 call 0xec12 ; 0xec12 #ifdef TMC2130 uint8_t silentMode = eeprom_read_byte((uint8_t*)EEPROM_SILENT); 20080: 8f ef ldi r24, 0xFF ; 255 20082: 9f e0 ldi r25, 0x0F ; 15 20084: 0f 94 1c dc call 0x3b838 ; 0x3b838 20088: 18 2f mov r17, r24 if (silentMode == 0xff) silentMode = 0; 2008a: 8f 3f cpi r24, 0xFF ; 255 2008c: 09 f4 brne .+2 ; 0x20090 2008e: 10 e0 ldi r17, 0x00 ; 0 tmc2130_mode = TMC2130_MODE_NORMAL; 20090: 10 92 8c 06 sts 0x068C, r1 ; 0x80068c tmc2130_sg_stop_on_crash = eeprom_init_default_byte((uint8_t*)EEPROM_CRASH_DET, farm_mode ? false : true); 20094: 61 e0 ldi r22, 0x01 ; 1 20096: 89 e6 ldi r24, 0x69 ; 105 20098: 9f e0 ldi r25, 0x0F ; 15 2009a: 0e 94 09 76 call 0xec12 ; 0xec12 2009e: 91 e0 ldi r25, 0x01 ; 1 200a0: 81 11 cpse r24, r1 200a2: 01 c0 rjmp .+2 ; 0x200a6 200a4: 90 e0 ldi r25, 0x00 ; 0 200a6: 90 93 5c 02 sts 0x025C, r25 ; 0x80025c if (tmc2130_sg_stop_on_crash) { 200aa: 88 23 and r24, r24 200ac: 09 f4 brne .+2 ; 0x200b0 200ae: a5 c0 rjmp .+330 ; 0x201fa puts_P(_N("CrashDetect ENABLED!")); 200b0: 83 ef ldi r24, 0xF3 ; 243 200b2: 9c e6 ldi r25, 0x6C ; 108 } else { puts_P(_N("CrashDetect DISABLED")); 200b4: 0f 94 05 db call 0x3b60a ; 0x3b60a } #ifdef TMC2130_LINEARITY_CORRECTION #ifdef TMC2130_LINEARITY_CORRECTION_XYZ tmc2130_wave_fac[X_AXIS] = eeprom_read_byte((uint8_t*)EEPROM_TMC2130_WAVE_X_FAC); 200b8: 87 ef ldi r24, 0xF7 ; 247 200ba: 9e e0 ldi r25, 0x0E ; 14 200bc: 0f 94 1c dc call 0x3b838 ; 0x3b838 200c0: c8 2e mov r12, r24 200c2: 80 93 f9 04 sts 0x04F9, r24 ; 0x8004f9 tmc2130_wave_fac[Y_AXIS] = eeprom_read_byte((uint8_t*)EEPROM_TMC2130_WAVE_Y_FAC); 200c6: 86 ef ldi r24, 0xF6 ; 246 200c8: 9e e0 ldi r25, 0x0E ; 14 200ca: 0f 94 1c dc call 0x3b838 ; 0x3b838 200ce: d8 2e mov r13, r24 200d0: 80 93 fa 04 sts 0x04FA, r24 ; 0x8004fa tmc2130_wave_fac[Z_AXIS] = eeprom_read_byte((uint8_t*)EEPROM_TMC2130_WAVE_Z_FAC); 200d4: 85 ef ldi r24, 0xF5 ; 245 200d6: 9e e0 ldi r25, 0x0E ; 14 200d8: 0f 94 1c dc call 0x3b838 ; 0x3b838 200dc: e8 2e mov r14, r24 200de: 80 93 fb 04 sts 0x04FB, r24 ; 0x8004fb #endif //TMC2130_LINEARITY_CORRECTION_XYZ tmc2130_wave_fac[E_AXIS] = eeprom_read_byte((uint8_t*)EEPROM_TMC2130_WAVE_E_FAC); 200e2: 84 ef ldi r24, 0xF4 ; 244 200e4: 9e e0 ldi r25, 0x0E ; 14 200e6: 0f 94 1c dc call 0x3b838 ; 0x3b838 200ea: 80 93 fc 04 sts 0x04FC, r24 ; 0x8004fc if (tmc2130_wave_fac[X_AXIS] == 0xff) tmc2130_wave_fac[X_AXIS] = 0; 200ee: 2f ef ldi r18, 0xFF ; 255 200f0: c2 12 cpse r12, r18 200f2: 02 c0 rjmp .+4 ; 0x200f8 200f4: 10 92 f9 04 sts 0x04F9, r1 ; 0x8004f9 if (tmc2130_wave_fac[Y_AXIS] == 0xff) tmc2130_wave_fac[Y_AXIS] = 0; 200f8: 3f ef ldi r19, 0xFF ; 255 200fa: d3 12 cpse r13, r19 200fc: 02 c0 rjmp .+4 ; 0x20102 200fe: 10 92 fa 04 sts 0x04FA, r1 ; 0x8004fa if (tmc2130_wave_fac[Z_AXIS] == 0xff) tmc2130_wave_fac[Z_AXIS] = 0; 20102: 9f ef ldi r25, 0xFF ; 255 20104: e9 12 cpse r14, r25 20106: 02 c0 rjmp .+4 ; 0x2010c 20108: 10 92 fb 04 sts 0x04FB, r1 ; 0x8004fb if (tmc2130_wave_fac[E_AXIS] == 0xff) tmc2130_wave_fac[E_AXIS] = 0; 2010c: 8f 3f cpi r24, 0xFF ; 255 2010e: 11 f4 brne .+4 ; 0x20114 20110: 10 92 fc 04 sts 0x04FC, r1 ; 0x8004fc #endif //TMC2130_LINEARITY_CORRECTION #ifdef TMC2130_VARIABLE_RESOLUTION tmc2130_mres[X_AXIS] = tmc2130_usteps2mres(cs.axis_ustep_resolution[X_AXIS]); 20114: 80 91 7a 0e lds r24, 0x0E7A ; 0x800e7a 20118: 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--; 2011a: 28 e0 ldi r18, 0x08 ; 8 2011c: 96 95 lsr r25 2011e: 87 95 ror r24 20120: 00 97 sbiw r24, 0x00 ; 0 20122: 09 f4 brne .+2 ; 0x20126 20124: 6d c0 rjmp .+218 ; 0x20200 20126: 21 50 subi r18, 0x01 ; 1 20128: f9 cf rjmp .-14 ; 0x2011c first++; lcd_clear(); } } if (cursor_pos < 0) { 2012a: 1f 3f cpi r17, 0xFF ; 255 2012c: 09 f0 breq .+2 ; 0x20130 2012e: 68 cf rjmp .-304 ; 0x20000 cursor_pos = 0; Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 20130: 87 e0 ldi r24, 0x07 ; 7 20132: 0f 94 07 4e call 0x29c0e ; 0x29c0e if (first > 0) { 20136: 80 91 dd 04 lds r24, 0x04DD ; 0x8004dd 2013a: 18 16 cp r1, r24 2013c: 2c f4 brge .+10 ; 0x20148 first--; 2013e: 81 50 subi r24, 0x01 ; 1 20140: 80 93 dd 04 sts 0x04DD, r24 ; 0x8004dd lcd_clear(); 20144: 0e 94 13 6f call 0xde26 ; 0xde26 lcd_clear(); } } if (cursor_pos < 0) { cursor_pos = 0; 20148: 10 e0 ldi r17, 0x00 ; 0 2014a: 5a cf rjmp .-332 ; 0x20000 // Level input parameter sets depth of reset static void factory_reset(char level) { lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { 2014c: 13 30 cpi r17, 0x03 ; 3 2014e: 29 f1 breq .+74 ; 0x2019a 20150: 14 30 cpi r17, 0x04 ; 4 20152: 09 f0 breq .+2 ; 0x20156 20154: 88 cf rjmp .-240 ; 0x20066 #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) #endif //FILAMENT_SENSOR break; case 4: menu_progressbar_init(EEPROM_TOP, PSTR("ERASING all data")); 20156: 69 ee ldi r22, 0xE9 ; 233 20158: 7d e8 ldi r23, 0x8D ; 141 2015a: 80 e0 ldi r24, 0x00 ; 0 2015c: 90 e1 ldi r25, 0x10 ; 16 2015e: 0f 94 f8 cf call 0x39ff0 ; 0x39ff0 // Erase EEPROM for (uint16_t i = 0; i < EEPROM_TOP; i++) { 20162: 10 e0 ldi r17, 0x00 ; 0 20164: 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); 20166: 6f ef ldi r22, 0xFF ; 255 20168: c8 01 movw r24, r16 2016a: 0f 94 40 dc call 0x3b880 ; 0x3b880 eeprom_update_byte_notify((uint8_t*)i, 0xFF); menu_progressbar_update(i); 2016e: c8 01 movw r24, r16 20170: 0f 94 c9 cf call 0x39f92 ; 0x39f92 break; case 4: menu_progressbar_init(EEPROM_TOP, PSTR("ERASING all data")); // Erase EEPROM for (uint16_t i = 0; i < EEPROM_TOP; i++) { 20174: 0f 5f subi r16, 0xFF ; 255 20176: 1f 4f sbci r17, 0xFF ; 255 20178: 01 15 cp r16, r1 2017a: f0 e1 ldi r31, 0x10 ; 16 2017c: 1f 07 cpc r17, r31 2017e: 99 f7 brne .-26 ; 0x20166 eeprom_update_byte_notify((uint8_t*)i, 0xFF); menu_progressbar_update(i); } menu_progressbar_finish(); 20180: 0f 94 ea cf call 0x39fd4 ; 0x39fd4 20184: 40 cc rjmp .-1920 ; 0x1fa06 lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { case 0: // Level 0: Language reset lang_reset(); 20186: 0e 94 2c 71 call 0xe258 ; 0xe258 2018a: 6d cf rjmp .-294 ; 0x20066 break; case 1: //Level 1: Reset statistics factory_reset_stats(); 2018c: 0e 94 11 67 call 0xce22 ; 0xce22 lcd_menu_statistics(); 20190: 0f 94 d5 3e call 0x27daa ; 0x27daa 20194: 68 cf rjmp .-304 ; 0x20066 break; case 2: // Level 2: Prepare for shipping factory_reset_stats(); 20196: 0e 94 11 67 call 0xce22 ; 0xce22 // FALLTHRU case 3: // Level 3: Preparation after being serviced // Force language selection at the next boot up. lang_reset(); 2019a: 0e 94 2c 71 call 0xe258 ; 0xe258 // Force the wizard in "Follow calibration flow" mode at the next boot up calibration_status_clear(CALIBRATION_FORCE_PREP); 2019e: 84 e0 ldi r24, 0x04 ; 4 201a0: 0e 94 3d ee call 0x1dc7a ; 0x1dc7a 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); 201a4: 62 e0 ldi r22, 0x02 ; 2 201a6: 8f e5 ldi r24, 0x5F ; 95 201a8: 9f e0 ldi r25, 0x0F ; 15 201aa: 0f 94 64 dc call 0x3b8c8 ; 0x3b8c8 eeprom_write_byte_notify((uint8_t*)EEPROM_WIZARD_ACTIVE, 2); farm_disable(); #ifdef FILAMENT_SENSOR fsensor.setEnabled(true); 201ae: 81 e0 ldi r24, 0x01 ; 1 201b0: 0e 94 cf 74 call 0xe99e ; 0xe99e fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 201b4: 11 e0 ldi r17, 0x01 ; 1 201b6: 10 93 ab 17 sts 0x17AB, r17 ; 0x8017ab if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 201ba: 61 e0 ldi r22, 0x01 ; 1 201bc: 87 e0 ldi r24, 0x07 ; 7 201be: 9f e0 ldi r25, 0x0F ; 15 201c0: 0f 94 40 dc call 0x3b880 ; 0x3b880 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 201c4: 10 93 ac 17 sts 0x17AC, r17 ; 0x8017ac 201c8: 61 e0 ldi r22, 0x01 ; 1 201ca: 85 ed ldi r24, 0xD5 ; 213 201cc: 9e e0 ldi r25, 0x0E ; 14 201ce: 0f 94 40 dc call 0x3b880 ; 0x3b880 return fsensorDetected; } #endif void PAT9125_sensor::setJamDetectionEnabled(bool state, bool updateEEPROM) { jamDetection = state; 201d2: 10 93 b8 17 sts 0x17B8, r17 ; 0x8017b8 oldPos = pat9125_y; 201d6: 80 91 8f 0e lds r24, 0x0E8F ; 0x800e8f 201da: 90 91 90 0e lds r25, 0x0E90 ; 0x800e90 201de: 90 93 ba 17 sts 0x17BA, r25 ; 0x8017ba 201e2: 80 93 b9 17 sts 0x17B9, r24 ; 0x8017b9 resetStepCount(); 201e6: 0f 94 ea 7a call 0x2f5d4 ; 0x2f5d4 jamErrCnt = 0; 201ea: 10 92 bf 17 sts 0x17BF, r1 ; 0x8017bf 201ee: 61 e0 ldi r22, 0x01 ; 1 201f0: 8d ea ldi r24, 0xAD ; 173 201f2: 9c e0 ldi r25, 0x0C ; 12 201f4: 0f 94 40 dc call 0x3b880 ; 0x3b880 201f8: 36 cf rjmp .-404 ; 0x20066 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")); 201fa: 8e ed ldi r24, 0xDE ; 222 201fc: 9c e6 ldi r25, 0x6C ; 108 201fe: 5a cf rjmp .-332 ; 0x200b4 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]); 20200: 20 93 f5 04 sts 0x04F5, r18 ; 0x8004f5 tmc2130_mres[Y_AXIS] = tmc2130_usteps2mres(cs.axis_ustep_resolution[Y_AXIS]); 20204: 80 91 7b 0e lds r24, 0x0E7B ; 0x800e7b 20208: 90 e0 ldi r25, 0x00 ; 0 2020a: 28 e0 ldi r18, 0x08 ; 8 2020c: 96 95 lsr r25 2020e: 87 95 ror r24 20210: 00 97 sbiw r24, 0x00 ; 0 20212: 11 f0 breq .+4 ; 0x20218 20214: 21 50 subi r18, 0x01 ; 1 20216: fa cf rjmp .-12 ; 0x2020c 20218: 20 93 f6 04 sts 0x04F6, r18 ; 0x8004f6 tmc2130_mres[Z_AXIS] = tmc2130_usteps2mres(cs.axis_ustep_resolution[Z_AXIS]); 2021c: 80 91 7c 0e lds r24, 0x0E7C ; 0x800e7c 20220: 90 e0 ldi r25, 0x00 ; 0 20222: 28 e0 ldi r18, 0x08 ; 8 20224: 96 95 lsr r25 20226: 87 95 ror r24 20228: 00 97 sbiw r24, 0x00 ; 0 2022a: 11 f0 breq .+4 ; 0x20230 2022c: 21 50 subi r18, 0x01 ; 1 2022e: fa cf rjmp .-12 ; 0x20224 20230: 20 93 f7 04 sts 0x04F7, r18 ; 0x8004f7 tmc2130_mres[E_AXIS] = tmc2130_usteps2mres(cs.axis_ustep_resolution[E_AXIS]); 20234: 80 91 7d 0e lds r24, 0x0E7D ; 0x800e7d 20238: 90 e0 ldi r25, 0x00 ; 0 2023a: 28 e0 ldi r18, 0x08 ; 8 2023c: 96 95 lsr r25 2023e: 87 95 ror r24 20240: 00 97 sbiw r24, 0x00 ; 0 20242: 11 f0 breq .+4 ; 0x20248 20244: 21 50 subi r18, 0x01 ; 1 20246: fa cf rjmp .-12 ; 0x2023c 20248: 20 93 f8 04 sts 0x04F8, r18 ; 0x8004f8 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(); 2024c: 0e 94 d1 ef call 0x1dfa2 ; 0x1dfa2 20250: 88 0f add r24, r24 #endif // LIN_ADVANCE void st_init() { #ifdef TMC2130 tmc2130_init(TMCInitParams(false, FarmOrUserECool())); 20252: 82 70 andi r24, 0x02 ; 2 20254: 0f 94 60 26 call 0x24cc0 ; 0x24cc0 microstep_init(); //Initialize Microstepping Pins #endif //TMC2130 //Initialize Dir Pins #if defined(X_DIR_PIN) && X_DIR_PIN > -1 SET_OUTPUT(X_DIR_PIN); 20258: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 2025c: 81 60 ori r24, 0x01 ; 1 2025e: 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); 20262: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 20266: 82 60 ori r24, 0x02 ; 2 20268: 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); 2026c: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 20270: 84 60 ori r24, 0x04 ; 4 20272: 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); 20276: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 2027a: 80 64 ori r24, 0x40 ; 64 2027c: 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); 20280: 0f 9a sbi 0x01, 7 ; 1 if(!X_ENABLE_ON) WRITE(X_ENABLE_PIN,HIGH); 20282: 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); 20284: 0e 9a sbi 0x01, 6 ; 1 if(!Y_ENABLE_ON) WRITE(Y_ENABLE_PIN,HIGH); 20286: 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); 20288: 0d 9a sbi 0x01, 5 ; 1 if(!Z_ENABLE_ON) WRITE(Z_ENABLE_PIN,HIGH); 2028a: 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); 2028c: 0c 9a sbi 0x01, 4 ; 1 if(!E_ENABLE_ON) WRITE(E0_ENABLE_PIN,HIGH); 2028e: 14 9a sbi 0x02, 4 ; 2 #endif //endstops and pullups #if defined(X_MIN_PIN) && X_MIN_PIN > -1 SET_INPUT(X_MIN_PIN); 20290: 26 98 cbi 0x04, 6 ; 4 #ifdef ENDSTOPPULLUP_XMIN WRITE(X_MIN_PIN,HIGH); 20292: 2e 9a sbi 0x05, 6 ; 5 #endif #endif #if defined(Y_MIN_PIN) && Y_MIN_PIN > -1 SET_INPUT(Y_MIN_PIN); 20294: 25 98 cbi 0x04, 5 ; 4 #ifdef ENDSTOPPULLUP_YMIN WRITE(Y_MIN_PIN,HIGH); 20296: 2d 9a sbi 0x05, 5 ; 5 #endif #endif #if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 SET_INPUT(Z_MIN_PIN); 20298: 24 98 cbi 0x04, 4 ; 4 #ifdef ENDSTOPPULLUP_ZMIN WRITE(Z_MIN_PIN,HIGH); 2029a: 2c 9a sbi 0x05, 4 ; 5 #endif #endif #if defined(X_MAX_PIN) && X_MAX_PIN > -1 SET_INPUT(X_MAX_PIN); 2029c: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 202a0: 8b 7f andi r24, 0xFB ; 251 202a2: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> #ifdef ENDSTOPPULLUP_XMAX WRITE(X_MAX_PIN,HIGH); 202a6: 9f b7 in r25, 0x3f ; 63 202a8: f8 94 cli 202aa: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 202ae: 84 60 ori r24, 0x04 ; 4 202b0: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 202b4: 9f bf out 0x3f, r25 ; 63 #endif #endif #if defined(Y_MAX_PIN) && Y_MAX_PIN > -1 SET_INPUT(Y_MAX_PIN); 202b6: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 202ba: 8f 77 andi r24, 0x7F ; 127 202bc: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> #ifdef ENDSTOPPULLUP_YMAX WRITE(Y_MAX_PIN,HIGH); 202c0: 9f b7 in r25, 0x3f ; 63 202c2: f8 94 cli 202c4: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 202c8: 80 68 ori r24, 0x80 ; 128 202ca: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 202ce: 9f bf out 0x3f, r25 ; 63 #endif #endif #if defined(Z_MAX_PIN) && Z_MAX_PIN > -1 SET_INPUT(Z_MAX_PIN); 202d0: 09 98 cbi 0x01, 1 ; 1 #ifdef ENDSTOPPULLUP_ZMAX WRITE(Z_MAX_PIN,HIGH); 202d2: 11 9a sbi 0x02, 1 ; 2 #endif #endif #if (defined(FANCHECK) && defined(TACH_0) && (TACH_0 > -1)) SET_INPUT(TACH_0); 202d4: 6e 98 cbi 0x0d, 6 ; 13 #endif //Initialize Step Pins #if defined(X_STEP_PIN) && (X_STEP_PIN > -1) SET_OUTPUT(X_STEP_PIN); 202d6: 38 9a sbi 0x07, 0 ; 7 WRITE(X_STEP_PIN,INVERT_X_STEP_PIN); 202d8: 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(); 202da: 17 9a sbi 0x02, 7 ; 2 202dc: 10 92 8f 06 sts 0x068F, r1 ; 0x80068f 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); 202e0: 39 9a sbi 0x07, 1 ; 7 WRITE(Y_STEP_PIN,INVERT_Y_STEP_PIN); 202e2: 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(); 202e4: 16 9a sbi 0x02, 6 ; 2 202e6: 10 92 90 06 sts 0x0690, r1 ; 0x800690 #endif #if defined(Z_STEP_PIN) && (Z_STEP_PIN > -1) SET_OUTPUT(Z_STEP_PIN); 202ea: 3a 9a sbi 0x07, 2 ; 7 WRITE(Z_STEP_PIN,INVERT_Z_STEP_PIN); 202ec: 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); 202ee: 3b 9a sbi 0x07, 3 ; 7 WRITE(E0_STEP_PIN,INVERT_E_STEP_PIN); 202f0: 43 98 cbi 0x08, 3 ; 8 disable_e0(); 202f2: 14 9a sbi 0x02, 4 ; 2 #endif // waveform generation = 0100 = CTC TCCR1B &= ~(1< 202f8: 8f 7e andi r24, 0xEF ; 239 202fa: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> TCCR1B |= (1< 20302: 88 60 ori r24, 0x08 ; 8 20304: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> TCCR1A &= ~(1< 2030c: 8d 7f andi r24, 0xFD ; 253 2030e: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> TCCR1A &= ~(1< 20316: 8e 7f andi r24, 0xFE ; 254 20318: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> // output mode = 00 (disconnected) TCCR1A &= ~(3< 20320: 8f 73 andi r24, 0x3F ; 63 20322: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> TCCR1A &= ~(3< 2032a: 8f 7c andi r24, 0xCF ; 207 2032c: 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< 20334: 88 7f andi r24, 0xF8 ; 248 20336: 82 60 ori r24, 0x02 ; 2 20338: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> // Plan the first interrupt after 8ms from now. OCR1A = 0x4000; 2033c: 80 e0 ldi r24, 0x00 ; 0 2033e: 90 e4 ldi r25, 0x40 ; 64 20340: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 20344: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> TCNT1 = 0; 20348: 10 92 85 00 sts 0x0085, r1 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 2034c: 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; 20350: 10 92 e6 04 sts 0x04E6, r1 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.476+0x1> 20354: 10 92 e5 04 sts 0x04E5, r1 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.476> nextAdvanceISR = ADV_NEVER; 20358: 8f ef ldi r24, 0xFF ; 255 2035a: 9f ef ldi r25, 0xFF ; 255 2035c: 90 93 e4 04 sts 0x04E4, r25 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.477+0x1> 20360: 80 93 e3 04 sts 0x04E3, r24 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.477> main_Rate = ADV_NEVER; 20364: 90 93 e2 04 sts 0x04E2, r25 ; 0x8004e2 <_ZL9main_Rate.lto_priv.478+0x1> 20368: 80 93 e1 04 sts 0x04E1, r24 ; 0x8004e1 <_ZL9main_Rate.lto_priv.478> current_adv_steps = 0; 2036c: 10 92 e0 04 sts 0x04E0, r1 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.479+0x1> 20370: 10 92 df 04 sts 0x04DF, r1 ; 0x8004df <_ZL17current_adv_steps.lto_priv.479> } bool enable_endstops(bool check) { bool old = check_endstops; check_endstops = check; 20374: 81 e0 ldi r24, 0x01 ; 1 20376: 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(); 2037a: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 2037e: 82 60 ori r24, 0x02 ; 2 20380: 80 93 6f 00 sts 0x006F, r24 ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> sei(); 20384: 78 94 sei #endif //TMC2130 st_init(); // Initialize stepper, this enables interrupts! #ifdef TMC2130 tmc2130_mode = silentMode?TMC2130_MODE_SILENT:TMC2130_MODE_NORMAL; 20386: 81 e0 ldi r24, 0x01 ; 1 20388: 11 11 cpse r17, r1 2038a: 01 c0 rjmp .+2 ; 0x2038e 2038c: 80 e0 ldi r24, 0x00 ; 0 2038e: 80 93 8c 06 sts 0x068C, r24 ; 0x80068c update_mode_profile(); 20392: 0f 94 a1 63 call 0x2c742 ; 0x2c742 20396: 0e 94 d1 ef call 0x1dfa2 ; 0x1dfa2 2039a: 88 0f add r24, r24 tmc2130_init(TMCInitParams(false, FarmOrUserECool() )); 2039c: 82 70 andi r24, 0x02 ; 2 2039e: 0f 94 60 26 call 0x24cc0 ; 0x24cc0 setup_photpin(); // Reset the machine correction matrix. // It does not make sense to load the correction matrix until the machine is homed. world2machine_reset(); 203a2: 0f 94 fd cd call 0x39bfa ; 0x39bfa // Initialize current_position accounting for software endstops to // avoid unexpected initial shifts on the first move clamp_to_software_endstops(current_position); 203a6: 82 e9 ldi r24, 0x92 ; 146 203a8: 96 e0 ldi r25, 0x06 ; 6 203aa: 0e 94 c9 6b call 0xd792 ; 0xd792 plan_set_position_curposXYZE(); 203ae: 0f 94 09 bf call 0x37e12 ; 0x37e12 // Show the xflash error message now that serial, lcd and encoder are available if (!xflash_success) 203b2: b1 10 cpse r11, r1 203b4: 08 c0 rjmp .+16 ; 0x203c6 } static void xflash_err_msg() { puts_P(_n("XFLASH not responding.")); 203b6: 8b e3 ldi r24, 0x3B ; 59 203b8: 9c e6 ldi r25, 0x6C ; 108 203ba: 0f 94 05 db call 0x3b60a ; 0x3b60a lcd_show_fullscreen_message_and_wait_P(_n("External SPI flash\nXFLASH is not res-\nponding. Language\nswitch unavailable.")); 203be: 8f ee ldi r24, 0xEF ; 239 203c0: 9b e6 ldi r25, 0x6B ; 107 203c2: 0f 94 f1 1f call 0x23fe2 ; 0x23fe2 } #define KILL_PENDING_FLAG 0x42 static void fw_kill_init() { if (eeprom_read_byte((uint8_t*)EEPROM_KILL_PENDING_FLAG) == KILL_PENDING_FLAG) { 203c6: 84 e9 ldi r24, 0x94 ; 148 203c8: 9c e0 ldi r25, 0x0C ; 12 203ca: 0f 94 1c dc call 0x3b838 ; 0x3b838 203ce: 82 34 cpi r24, 0x42 ; 66 203d0: 59 f4 brne .+22 ; 0x203e8 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); 203d2: 6f ef ldi r22, 0xFF ; 255 203d4: 84 e9 ldi r24, 0x94 ; 148 203d6: 9c e0 ldi r25, 0x0C ; 12 203d8: 0f 94 64 dc call 0x3b8c8 ; 0x3b8c8 // 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); 203dc: 85 e9 ldi r24, 0x95 ; 149 203de: 9c e0 ldi r25, 0x0C ; 12 203e0: 0f 94 2a dc call 0x3b854 ; 0x3b854 lcd_show_fullscreen_message_and_wait_P(kill_msg); 203e4: 0f 94 f1 1f call 0x23fe2 ; 0x23fe2 // report kill() events fw_kill_init(); #ifdef FILAMENT_SENSOR fsensor.init(); 203e8: 0f 94 39 7b call 0x2f672 ; 0x2f672 #endif setup_homepin(); #if defined(Z_AXIS_ALWAYS_ON) enable_z(); 203ec: 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); 203ee: 8b eb ldi r24, 0xBB ; 187 203f0: 9f e0 ldi r25, 0x0F ; 15 203f2: 0f 94 1c dc call 0x3b838 ; 0x3b838 203f6: 91 e0 ldi r25, 0x01 ; 1 203f8: 81 30 cpi r24, 0x01 ; 1 203fa: 09 f0 breq .+2 ; 0x203fe 203fc: 90 e0 ldi r25, 0x00 ; 0 203fe: 90 93 01 17 sts 0x1701, r25 ; 0x801701 // 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(); 20402: 81 e0 ldi r24, 0x01 ; 1 20404: 0f 94 c2 80 call 0x30184 ; 0x30184 #include #include void eeprom_init() { eeprom_init_default_byte((uint8_t*)EEPROM_POWER_COUNT, 0); 20408: 60 e0 ldi r22, 0x00 ; 0 2040a: 84 e6 ldi r24, 0x64 ; 100 2040c: 9f e0 ldi r25, 0x0F ; 15 2040e: 0e 94 09 76 call 0xec12 ; 0xec12 eeprom_init_default_byte((uint8_t*)EEPROM_CRASH_COUNT_X, 0); 20412: 60 e0 ldi r22, 0x00 ; 0 20414: 86 e6 ldi r24, 0x66 ; 102 20416: 9f e0 ldi r25, 0x0F ; 15 20418: 0e 94 09 76 call 0xec12 ; 0xec12 eeprom_init_default_byte((uint8_t*)EEPROM_CRASH_COUNT_Y, 0); 2041c: 60 e0 ldi r22, 0x00 ; 0 2041e: 88 e6 ldi r24, 0x68 ; 104 20420: 9f e0 ldi r25, 0x0F ; 15 20422: 0e 94 09 76 call 0xec12 ; 0xec12 eeprom_init_default_byte((uint8_t*)EEPROM_FERROR_COUNT, 0); 20426: 60 e0 ldi r22, 0x00 ; 0 20428: 85 e6 ldi r24, 0x65 ; 101 2042a: 9f e0 ldi r25, 0x0F ; 15 2042c: 0e 94 09 76 call 0xec12 ; 0xec12 eeprom_init_default_word((uint16_t*)EEPROM_POWER_COUNT_TOT, 0); 20430: 70 e0 ldi r23, 0x00 ; 0 20432: 60 e0 ldi r22, 0x00 ; 0 20434: 8f ef ldi r24, 0xFF ; 255 20436: 9e e0 ldi r25, 0x0E ; 14 20438: 0e 94 f1 75 call 0xebe2 ; 0xebe2 eeprom_init_default_word((uint16_t*)EEPROM_CRASH_COUNT_X_TOT, 0); 2043c: 70 e0 ldi r23, 0x00 ; 0 2043e: 60 e0 ldi r22, 0x00 ; 0 20440: 85 e0 ldi r24, 0x05 ; 5 20442: 9f e0 ldi r25, 0x0F ; 15 20444: 0e 94 f1 75 call 0xebe2 ; 0xebe2 eeprom_init_default_word((uint16_t*)EEPROM_CRASH_COUNT_Y_TOT, 0); 20448: 70 e0 ldi r23, 0x00 ; 0 2044a: 60 e0 ldi r22, 0x00 ; 0 2044c: 83 e0 ldi r24, 0x03 ; 3 2044e: 9f e0 ldi r25, 0x0F ; 15 20450: 0e 94 f1 75 call 0xebe2 ; 0xebe2 eeprom_init_default_word((uint16_t*)EEPROM_FERROR_COUNT_TOT, 0); 20454: 70 e0 ldi r23, 0x00 ; 0 20456: 60 e0 ldi r22, 0x00 ; 0 20458: 81 e0 ldi r24, 0x01 ; 1 2045a: 9f e0 ldi r25, 0x0F ; 15 2045c: 0e 94 f1 75 call 0xebe2 ; 0xebe2 eeprom_init_default_word((uint16_t*)EEPROM_MMU_FAIL_TOT, 0); 20460: 70 e0 ldi r23, 0x00 ; 0 20462: 60 e0 ldi r22, 0x00 ; 0 20464: 83 ed ldi r24, 0xD3 ; 211 20466: 9e e0 ldi r25, 0x0E ; 14 20468: 0e 94 f1 75 call 0xebe2 ; 0xebe2 eeprom_init_default_word((uint16_t*)EEPROM_MMU_LOAD_FAIL_TOT, 0); 2046c: 70 e0 ldi r23, 0x00 ; 0 2046e: 60 e0 ldi r22, 0x00 ; 0 20470: 80 ed ldi r24, 0xD0 ; 208 20472: 9e e0 ldi r25, 0x0E ; 14 20474: 0e 94 f1 75 call 0xebe2 ; 0xebe2 eeprom_init_default_byte((uint8_t*)EEPROM_MMU_FAIL, 0); 20478: 60 e0 ldi r22, 0x00 ; 0 2047a: 82 ed ldi r24, 0xD2 ; 210 2047c: 9e e0 ldi r25, 0x0E ; 14 2047e: 0e 94 09 76 call 0xec12 ; 0xec12 eeprom_init_default_byte((uint8_t*)EEPROM_MMU_LOAD_FAIL, 0); 20482: 60 e0 ldi r22, 0x00 ; 0 20484: 8f ec ldi r24, 0xCF ; 207 20486: 9e e0 ldi r25, 0x0E ; 14 20488: 0e 94 09 76 call 0xec12 ; 0xec12 eeprom_init_default_dword((uint32_t*)EEPROM_MMU_MATERIAL_CHANGES, 0); 2048c: 88 ea ldi r24, 0xA8 ; 168 2048e: 9c e0 ldi r25, 0x0C ; 12 20490: 0f 94 5d 7a call 0x2f4ba ; 0x2f4ba if (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == EEPROM_EMPTY_VALUE) 20494: 81 ea ldi r24, 0xA1 ; 161 20496: 9d e0 ldi r25, 0x0D ; 13 20498: 0f 94 1c dc call 0x3b838 ; 0x3b838 2049c: 8f 3f cpi r24, 0xFF ; 255 2049e: 71 f4 brne .+28 ; 0x204bc if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 204a0: 60 e0 ldi r22, 0x00 ; 0 204a2: 81 ea ldi r24, 0xA1 ; 161 204a4: 9d e0 ldi r25, 0x0D ; 13 204a6: 0f 94 40 dc call 0x3b880 ; 0x3b880 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); 204aa: 88 ef ldi r24, 0xF8 ; 248 204ac: 9f e0 ldi r25, 0x0F ; 15 204ae: 0f 94 2a dc call 0x3b854 ; 0x3b854 eeprom_update_word(reinterpret_cast(&(EEPROM_Sheets_base->s[0].z_offset)), last_babystep); 204b2: bc 01 movw r22, r24 204b4: 80 e5 ldi r24, 0x50 ; 80 204b6: 9d e0 ldi r25, 0x0D ; 13 204b8: 0f 94 5e dc call 0x3b8bc ; 0x3b8bc 204bc: 39 e4 ldi r19, 0x49 ; 73 204be: c3 2e mov r12, r19 204c0: 3d e0 ldi r19, 0x0D ; 13 204c2: d3 2e mov r13, r19 204c4: 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); 204c6: be 01 movw r22, r28 204c8: 6f 5f subi r22, 0xFF ; 255 204ca: 7f 4f sbci r23, 0xFF ; 255 204cc: 81 2f mov r24, r17 204ce: 0e 94 71 76 call 0xece2 ; 0xece2 eeprom_init_default_block(EEPROM_Sheets_base->s[i].name, (sizeof(Sheet::name)/sizeof(Sheet::name[0])), sheetName.c); 204d2: ae 01 movw r20, r28 204d4: 4f 5f subi r20, 0xFF ; 255 204d6: 5f 4f sbci r21, 0xFF ; 255 204d8: 67 e0 ldi r22, 0x07 ; 7 204da: 70 e0 ldi r23, 0x00 ; 0 204dc: c6 01 movw r24, r12 204de: 0e 94 d2 75 call 0xeba4 ; 0xeba4 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++) { 204e2: 1f 5f subi r17, 0xFF ; 255 204e4: ab e0 ldi r26, 0x0B ; 11 204e6: ca 0e add r12, r26 204e8: d1 1c adc r13, r1 204ea: 18 30 cpi r17, 0x08 ; 8 204ec: 61 f7 brne .-40 ; 0x204c6 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)))) 204ee: 81 ea ldi r24, 0xA1 ; 161 204f0: 9d e0 ldi r25, 0x0D ; 13 204f2: 0f 94 1c dc call 0x3b838 ; 0x3b838 204f6: 0e 94 41 76 call 0xec82 ; 0xec82 204fa: 81 11 cpse r24, r1 204fc: 02 c0 rjmp .+4 ; 0x20502 { eeprom_switch_to_next_sheet(); 204fe: 0e 94 63 76 call 0xecc6 ; 0xecc6 } check_babystep(); 20502: 0e 94 7f 79 call 0xf2fe ; 0xf2fe // initialize custom mendel name in eeprom if (eeprom_read_byte((uint8_t*)EEPROM_CUSTOM_MENDEL_NAME) == EEPROM_EMPTY_VALUE) { 20506: 80 e8 ldi r24, 0x80 ; 128 20508: 9c e0 ldi r25, 0x0C ; 12 2050a: 0f 94 1c dc call 0x3b838 ; 0x3b838 2050e: 8f 3f cpi r24, 0xFF ; 255 20510: 41 f4 brne .+16 ; 0x20522 #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); 20512: 4f e0 ldi r20, 0x0F ; 15 20514: 50 e0 ldi r21, 0x00 ; 0 20516: 60 e8 ldi r22, 0x80 ; 128 20518: 7c e0 ldi r23, 0x0C ; 12 2051a: 87 ee ldi r24, 0xE7 ; 231 2051c: 92 e0 ldi r25, 0x02 ; 2 2051e: 0f 94 30 dc call 0x3b860 ; 0x3b860 #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); 20522: 85 e0 ldi r24, 0x05 ; 5 20524: 9d e0 ldi r25, 0x0D ; 13 20526: 0f 94 5d 7a call 0x2f4ba ; 0x2f4ba eeprom_init_default_dword((uint32_t*)EEPROM_TOTALTIME, 0); 2052a: 8d ee ldi r24, 0xED ; 237 2052c: 9f e0 ldi r25, 0x0F ; 15 2052e: 0f 94 5d 7a call 0x2f4ba ; 0x2f4ba eeprom_init_default_dword((uint32_t*)EEPROM_FILAMENTUSED, 0); 20532: 81 ef ldi r24, 0xF1 ; 241 20534: 9f e0 ldi r25, 0x0F ; 15 20536: 0f 94 5d 7a call 0x2f4ba ; 0x2f4ba eeprom_init_default_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED, 0); 2053a: 60 e0 ldi r22, 0x00 ; 0 2053c: 8e ec ldi r24, 0xCE ; 206 2053e: 9e e0 ldi r25, 0x0E ; 14 20540: 0e 94 09 76 call 0xec12 ; 0xec12 eeprom_init_default_byte((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT, 1); 20544: 61 e0 ldi r22, 0x01 ; 1 20546: 87 ea ldi r24, 0xA7 ; 167 20548: 9c e0 ldi r25, 0x0C ; 12 2054a: 0e 94 09 76 call 0xec12 ; 0xec12 putchar('\n'); list_sec_lang_from_external_flash(); #endif //DEBUG_XFLASH // lang_reset(); if (!lang_select(eeprom_read_byte((uint8_t*)EEPROM_LANG))) 2054e: 8e ef ldi r24, 0xFE ; 254 20550: 9f e0 ldi r25, 0x0F ; 15 20552: 0f 94 1c dc call 0x3b838 ; 0x3b838 20556: 0e 94 34 72 call 0xe468 ; 0xe468 2055a: 81 11 cpse r24, r1 2055c: 02 c0 rjmp .+4 ; 0x20562 lcd_language(); 2055e: 0e 94 4f da call 0x1b49e ; 0x1b49e lang_print_sec_lang(); #endif //DEBUG_SEC_LANG #endif //(LANG_MODE != 0) eeprom_init_default_byte((uint8_t*)EEPROM_TEMP_CAL_ACTIVE, 0); 20562: 60 e0 ldi r22, 0x00 ; 0 20564: 8f ea ldi r24, 0xAF ; 175 20566: 9f e0 ldi r25, 0x0F ; 15 20568: 0e 94 09 76 call 0xec12 ; 0xec12 if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA) == 255) { 2056c: 86 ea ldi r24, 0xA6 ; 166 2056e: 9f e0 ldi r25, 0x0F ; 15 20570: 0f 94 1c dc call 0x3b838 ; 0x3b838 20574: 8f 3f cpi r24, 0xFF ; 255 20576: d9 f4 brne .+54 ; 0x205ae if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 20578: 61 e0 ldi r22, 0x01 ; 1 2057a: 86 ea ldi r24, 0xA6 ; 166 2057c: 9f e0 ldi r25, 0x0F ; 15 2057e: 0f 94 40 dc call 0x3b880 ; 0x3b880 20582: 20 eb ldi r18, 0xB0 ; 176 20584: c2 2e mov r12, r18 20586: 2f e0 ldi r18, 0x0F ; 15 20588: 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); 2058a: 70 e0 ldi r23, 0x00 ; 0 2058c: 60 e0 ldi r22, 0x00 ; 0 2058e: c6 01 movw r24, r12 20590: 0f 94 5e dc call 0x3b8bc ; 0x3b8bc 20594: b2 e0 ldi r27, 0x02 ; 2 20596: cb 0e add r12, r27 20598: 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++) { 2059a: ea eb ldi r30, 0xBA ; 186 2059c: ce 16 cp r12, r30 2059e: ef e0 ldi r30, 0x0F ; 15 205a0: de 06 cpc r13, r30 205a2: 99 f7 brne .-26 ; 0x2058a if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 205a4: 60 e0 ldi r22, 0x00 ; 0 205a6: 8f ea ldi r24, 0xAF ; 175 205a8: 9f e0 ldi r25, 0x0F ; 15 205aa: 0f 94 40 dc call 0x3b880 ; 0x3b880 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); 205ae: 60 e0 ldi r22, 0x00 ; 0 205b0: 85 ea ldi r24, 0xA5 ; 165 205b2: 9f e0 ldi r25, 0x0F ; 15 205b4: 0e 94 09 76 call 0xec12 ; 0xec12 eeprom_init_default_byte((uint8_t*)EEPROM_UVLO_Z_LIFTED, 0); 205b8: 60 e0 ldi r22, 0x00 ; 0 205ba: 8f e7 ldi r24, 0x7F ; 127 205bc: 9c e0 ldi r25, 0x0C ; 12 205be: 0e 94 09 76 call 0xec12 ; 0xec12 eeprom_init_default_byte((uint8_t*)EEPROM_SD_SORT, 0); 205c2: 60 e0 ldi r22, 0x00 ; 0 205c4: 89 e0 ldi r24, 0x09 ; 9 205c6: 9f e0 ldi r25, 0x0F ; 15 205c8: 0e 94 09 76 call 0xec12 ; 0xec12 } 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); 205cc: 61 e0 ldi r22, 0x01 ; 1 205ce: 8c ea ldi r24, 0xAC ; 172 205d0: 9d e0 ldi r25, 0x0D ; 13 205d2: 0e 94 09 76 call 0xec12 ; 0xec12 eeprom_init_default_byte((uint8_t*)EEPROM_MBL_POINTS_NR, 3); 205d6: 63 e0 ldi r22, 0x03 ; 3 205d8: 8b ea ldi r24, 0xAB ; 171 205da: 9d e0 ldi r25, 0x0D ; 13 205dc: 0e 94 09 76 call 0xec12 ; 0xec12 eeprom_init_default_byte((uint8_t*)EEPROM_MBL_PROBE_NR, 3); 205e0: 63 e0 ldi r22, 0x03 ; 3 205e2: 8a ea ldi r24, 0xAA ; 170 205e4: 9d e0 ldi r25, 0x0D ; 13 205e6: 0e 94 09 76 call 0xec12 ; 0xec12 //mbl_mode_init(); mbl_settings_init(); eeprom_init_default_byte((uint8_t*)EEPROM_MMU_STEALTH, 1); 205ea: 61 e0 ldi r22, 0x01 ; 1 205ec: 89 ea ldi r24, 0xA9 ; 169 205ee: 9d e0 ldi r25, 0x0D ; 13 205f0: 0e 94 09 76 call 0xec12 ; 0xec12 #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 205f4: 6f 98 cbi 0x0d, 7 ; 13 PORTE &= ~(1 << 7); //no internal pull-up 205f6: 77 98 cbi 0x0e, 7 ; 14 //start with sensing rising edge EICRB &= ~(1 << 6); 205f8: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> 205fc: 8f 7b andi r24, 0xBF ; 191 205fe: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> EICRB |= (1 << 7); 20602: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> 20606: 80 68 ori r24, 0x80 ; 128 20608: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> //enable INT7 interrupt EIMSK |= (1 << 7); 2060c: 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); 2060e: 84 e0 ldi r24, 0x04 ; 4 20610: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be return false; } #ifdef FSENSOR_PROBING bool PAT9125_sensor::probeOtherType() { SET_INPUT(IR_SENSOR_PIN); // input mode 20614: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 20618: 8e 7f andi r24, 0xFE ; 254 2061a: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> WRITE(IR_SENSOR_PIN, 1); // pullup 2061e: 9f b7 in r25, 0x3f ; 63 20620: f8 94 cli 20622: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 20626: 81 60 ori r24, 0x01 ; 1 20628: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 2062c: 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); 2062e: 8f e8 ldi r24, 0x8F ; 143 20630: 91 e0 ldi r25, 0x01 ; 1 20632: 01 97 sbiw r24, 0x01 ; 1 20634: f1 f7 brne .-4 ; 0x20632 20636: 00 c0 rjmp .+0 ; 0x20638 20638: 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); 2063a: 90 91 06 01 lds r25, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> WRITE(IR_SENSOR_PIN, 0); // no pullup 2063e: 2f b7 in r18, 0x3f ; 63 20640: f8 94 cli 20642: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 20646: 8e 7f andi r24, 0xFE ; 254 20648: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 2064c: 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()) { 2064e: 90 fd sbrc r25, 0 20650: 06 c0 rjmp .+12 ; 0x2065e lcd_show_fullscreen_message_and_wait_P(_T(MSG_FW_MK3_DETECTED)); 20652: 8c e3 ldi r24, 0x3C ; 60 20654: 9b e4 ldi r25, 0x4B ; 75 20656: 0e 94 ac 72 call 0xe558 ; 0xe558 2065a: 0f 94 f1 1f call 0x23fe2 ; 0x23fe2 #if defined(FILAMENT_SENSOR) && defined(FSENSOR_PROBING) check_if_fw_is_on_right_printer(); #endif //defined(FILAMENT_SENSOR) && defined(FSENSOR_PROBING) } switch (hw_changed) { 2065e: 02 30 cpi r16, 0x02 ; 2 20660: 81 f0 breq .+32 ; 0x20682 20662: 03 30 cpi r16, 0x03 ; 3 20664: 09 f4 brne .+2 ; 0x20668 20666: 37 c1 rjmp .+622 ; 0x208d6 20668: 01 30 cpi r16, 0x01 ; 1 2066a: b9 f4 brne .+46 ; 0x2069a //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)); 2066c: 8e e6 ldi r24, 0x6E ; 110 2066e: 9d e4 ldi r25, 0x4D ; 77 20670: 0e 94 ac 72 call 0xe558 ; 0xe558 20674: 0f 94 f1 1f call 0x23fe2 ; 0x23fe2 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); 20678: 66 e3 ldi r22, 0x36 ; 54 2067a: 71 e0 ldi r23, 0x01 ; 1 2067c: 8c ee ldi r24, 0xEC ; 236 2067e: 9e e0 ldi r25, 0x0E ; 14 20680: 0a c0 rjmp .+20 ; 0x20696 eeprom_write_word_notify((uint16_t*)EEPROM_BOARD_TYPE, MOTHERBOARD); break; case(0b10): lcd_show_fullscreen_message_and_wait_P(_T(MSG_CHANGED_PRINTER)); 20682: 8d e4 ldi r24, 0x4D ; 77 20684: 9d e4 ldi r25, 0x4D ; 77 20686: 0e 94 ac 72 call 0xe558 ; 0xe558 2068a: 0f 94 f1 1f call 0x23fe2 ; 0x23fe2 2068e: 6c e2 ldi r22, 0x2C ; 44 20690: 71 e0 ldi r23, 0x01 ; 1 20692: 8e ee ldi r24, 0xEE ; 238 20694: 9e e0 ldi r25, 0x0E ; 14 20696: 0f 94 7a dc call 0x3b8f4 ; 0x3b8f4 eeprom_write_word_notify((uint16_t*)EEPROM_BOARD_TYPE, MOTHERBOARD); break; default: break; //no change, show no message } if (!previous_settings_retrieved) { 2069a: f1 10 cpse r15, r1 2069c: 08 c0 rjmp .+16 ; 0x206ae 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 2069e: 86 ed ldi r24, 0xD6 ; 214 206a0: 9c e4 ldi r25, 0x4C ; 76 206a2: 0e 94 ac 72 call 0xe558 ; 0xe558 206a6: 0f 94 f1 1f call 0x23fe2 ; 0x23fe2 Config_StoreSettings(); 206aa: 0e 94 a4 82 call 0x10548 ; 0x10548 } // handle FW and calibration status upgrade bool run_wizard = false; if (calibration_status_get(CALIBRATION_STATUS_UNKNOWN)) { 206ae: 80 e8 ldi r24, 0x80 ; 128 206b0: 0e 94 9f ee call 0x1dd3e ; 0x1dd3e 206b4: 88 23 and r24, r24 206b6: c9 f0 breq .+50 ; 0x206ea CalibrationStatus calibration_status = 0; if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V1) == 1) { 206b8: 87 ef ldi r24, 0xF7 ; 247 206ba: 9f e0 ldi r25, 0x0F ; 15 206bc: 0f 94 1c dc call 0x3b838 ; 0x3b838 } // handle FW and calibration status upgrade bool run_wizard = false; if (calibration_status_get(CALIBRATION_STATUS_UNKNOWN)) { CalibrationStatus calibration_status = 0; 206c0: 60 e0 ldi r22, 0x00 ; 0 if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V1) == 1) { 206c2: 81 30 cpi r24, 0x01 ; 1 206c4: 71 f4 brne .+28 ; 0x206e2 // 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)) { 206c6: 8f e1 ldi r24, 0x1F ; 31 206c8: 9e e8 ldi r25, 0x8E ; 142 206ca: 0e 94 3c d0 call 0x1a078 ; 0x1a078 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); 206ce: 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)) { 206d0: 88 23 and r24, r24 206d2: 39 f0 breq .+14 ; 0x206e2 // printer upgraded from FW<3.2.0.4 and requires re-running selftest lcd_show_fullscreen_message_and_wait_P(_T(MSG_FORCE_SELFTEST)); 206d4: 84 e9 ldi r24, 0x94 ; 148 206d6: 9c e4 ldi r25, 0x4C ; 76 206d8: 0e 94 ac 72 call 0xe558 ; 0xe558 206dc: 0f 94 f1 1f call 0x23fe2 ; 0x23fe2 calibration_status &= ~CALIBRATION_STATUS_SELFTEST; 206e0: 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); 206e2: 86 ea ldi r24, 0xA6 ; 166 206e4: 9c e0 ldi r25, 0x0C ; 12 206e6: 0f 94 40 dc call 0x3b880 ; 0x3b880 } } eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, calibration_status); } if (eeprom_fw_version_older_than_p(FW_VERSION_NR)) { 206ea: 87 e1 ldi r24, 0x17 ; 23 206ec: 9e e8 ldi r25, 0x8E ; 142 206ee: 0e 94 3c d0 call 0x1a078 ; 0x1a078 206f2: f8 2e mov r15, r24 206f4: 88 23 and r24, r24 206f6: 31 f0 breq .+12 ; 0x20704 if (!calibration_status_get(CALIBRATION_WIZARD_STEPS)) { 206f8: 8f e1 ldi r24, 0x1F ; 31 206fa: 0e 94 9f ee call 0x1dd3e ; 0x1dd3e 206fe: 91 e0 ldi r25, 0x01 ; 1 20700: f8 2e mov r15, r24 20702: 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; 20704: 10 e0 ldi r17, 0x00 ; 0 20706: 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)); 20708: f8 01 movw r30, r16 2070a: e8 5f subi r30, 0xF8 ; 248 2070c: f1 47 sbci r31, 0x71 ; 113 2070e: 64 91 lpm r22, Z 20710: c8 01 movw r24, r16 20712: 0f 94 40 dc call 0x3b880 ; 0x3b880 20716: 0f 5f subi r16, 0xFF ; 255 20718: 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){ 2071a: 0a 30 cpi r16, 0x0A ; 10 2071c: 11 05 cpc r17, r1 2071e: a1 f7 brne .-24 ; 0x20708 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])); 20720: e7 e1 ldi r30, 0x17 ; 23 20722: fe e8 ldi r31, 0x8E ; 142 20724: 65 91 lpm r22, Z+ 20726: 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); 20728: 8a e0 ldi r24, 0x0A ; 10 2072a: 90 e0 ldi r25, 0x00 ; 0 2072c: 0f 94 5e dc call 0x3b8bc ; 0x3b8bc eeprom_update_word_notify((uint16_t*)EEPROM_FIRMWARE_VERSION_MINOR, (uint16_t)pgm_read_word(&FW_VERSION_NR[1])); 20730: e9 e1 ldi r30, 0x19 ; 25 20732: fe e8 ldi r31, 0x8E ; 142 20734: 65 91 lpm r22, Z+ 20736: 74 91 lpm r23, Z 20738: 8c e0 ldi r24, 0x0C ; 12 2073a: 90 e0 ldi r25, 0x00 ; 0 2073c: 0f 94 5e dc call 0x3b8bc ; 0x3b8bc eeprom_update_word_notify((uint16_t*)EEPROM_FIRMWARE_VERSION_REVISION, (uint16_t)pgm_read_word(&FW_VERSION_NR[2])); 20740: eb e1 ldi r30, 0x1B ; 27 20742: fe e8 ldi r31, 0x8E ; 142 20744: 65 91 lpm r22, Z+ 20746: 74 91 lpm r23, Z 20748: 8e e0 ldi r24, 0x0E ; 14 2074a: 90 e0 ldi r25, 0x00 ; 0 2074c: 0f 94 5e dc call 0x3b8bc ; 0x3b8bc // 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])); 20750: ed e1 ldi r30, 0x1D ; 29 20752: fe e8 ldi r31, 0x8E ; 142 20754: 65 91 lpm r22, Z+ 20756: 74 91 lpm r23, Z 20758: 80 e1 ldi r24, 0x10 ; 16 2075a: 90 e0 ldi r25, 0x00 ; 0 2075c: 0f 94 5e dc call 0x3b8bc ; 0x3b8bc run_wizard = true; } } update_current_firmware_version_to_eeprom(); if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) { 20760: 8f e5 ldi r24, 0x5F ; 95 20762: 9f e0 ldi r25, 0x0F ; 15 20764: 0f 94 1c dc call 0x3b838 ; 0x3b838 20768: 88 23 and r24, r24 2076a: 09 f4 brne .+2 ; 0x2076e 2076c: c1 c0 rjmp .+386 ; 0x208f0 // first time run of wizard or service prep lcd_wizard(WizState::Run); 2076e: 80 e0 ldi r24, 0x00 ; 0 } else if (run_wizard) { // some wizard steps required by the upgrade checks lcd_wizard(WizState::Restore); 20770: 0e 94 fb f8 call 0x1f1f6 ; 0x1f1f6 lcd_show_fullscreen_message_and_wait_P(_T(MSG_TM_NOT_CAL)); #endif //THERMAL_MODEL } } KEEPALIVE_STATE(IN_PROCESS); 20774: 83 e0 ldi r24, 0x03 ; 3 20776: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be #endif //DEBUG_DISABLE_STARTMSGS lcd_update_enable(true); 2077a: 81 e0 ldi r24, 0x01 ; 1 2077c: 0e 94 25 6f call 0xde4a ; 0xde4a lcd_clear(); 20780: 0e 94 13 6f call 0xde26 ; 0xde26 lcd_update(2); 20784: 82 e0 ldi r24, 0x02 ; 2 20786: 0e 94 a7 6e call 0xdd4e ; 0xdd4e #ifdef TMC2130 tmc2130_home_origin[X_AXIS] = eeprom_init_default_byte((uint8_t*)EEPROM_TMC2130_HOME_X_ORIGIN, 0); 2078a: 60 e0 ldi r22, 0x00 ; 0 2078c: 8e ef ldi r24, 0xFE ; 254 2078e: 9e e0 ldi r25, 0x0E ; 14 20790: 0e 94 09 76 call 0xec12 ; 0xec12 20794: 80 93 f3 04 sts 0x04F3, r24 ; 0x8004f3 tmc2130_home_bsteps[X_AXIS] = eeprom_init_default_byte((uint8_t*)EEPROM_TMC2130_HOME_X_BSTEPS, 48); 20798: 60 e3 ldi r22, 0x30 ; 48 2079a: 8d ef ldi r24, 0xFD ; 253 2079c: 9e e0 ldi r25, 0x0E ; 14 2079e: 0e 94 09 76 call 0xec12 ; 0xec12 207a2: 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); 207a6: 60 e3 ldi r22, 0x30 ; 48 207a8: 8c ef ldi r24, 0xFC ; 252 207aa: 9e e0 ldi r25, 0x0E ; 14 207ac: 0e 94 09 76 call 0xec12 ; 0xec12 207b0: 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); 207b4: 60 e0 ldi r22, 0x00 ; 0 207b6: 8b ef ldi r24, 0xFB ; 251 207b8: 9e e0 ldi r25, 0x0E ; 14 207ba: 0e 94 09 76 call 0xec12 ; 0xec12 207be: 80 93 f4 04 sts 0x04F4, r24 ; 0x8004f4 tmc2130_home_bsteps[Y_AXIS] = eeprom_init_default_byte((uint8_t*)EEPROM_TMC2130_HOME_Y_BSTEPS, 48); 207c2: 60 e3 ldi r22, 0x30 ; 48 207c4: 8a ef ldi r24, 0xFA ; 250 207c6: 9e e0 ldi r25, 0x0E ; 14 207c8: 0e 94 09 76 call 0xec12 ; 0xec12 207cc: 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); 207d0: 60 e3 ldi r22, 0x30 ; 48 207d2: 89 ef ldi r24, 0xF9 ; 249 207d4: 9e e0 ldi r25, 0x0E ; 14 207d6: 0e 94 09 76 call 0xec12 ; 0xec12 207da: 80 93 59 02 sts 0x0259, r24 ; 0x800259 tmc2130_home_enabled = eeprom_init_default_byte((uint8_t*)EEPROM_TMC2130_HOME_ENABLED, 0); 207de: 60 e0 ldi r22, 0x00 ; 0 207e0: 88 ef ldi r24, 0xF8 ; 248 207e2: 9e e0 ldi r25, 0x0E ; 14 207e4: 0e 94 09 76 call 0xec12 ; 0xec12 207e8: 80 93 f2 04 sts 0x04F2, r24 ; 0x8004f2 static void fw_crash_init() { #ifdef XFLASH_DUMP dump_crash_reason crash_reason; if(xfdump_check_state(&crash_reason)) 207ec: ce 01 movw r24, r28 207ee: 01 96 adiw r24, 0x01 ; 1 207f0: 0e 94 08 ed call 0x1da10 ; 0x1da10 207f4: 88 23 and r24, r24 207f6: 89 f0 breq .+34 ; 0x2081a { // always signal to the host that a dump is available for retrieval puts_P(_N("//action:dump_available")); 207f8: 86 ec ldi r24, 0xC6 ; 198 207fa: 9c e6 ldi r25, 0x6C ; 108 207fc: 0f 94 05 db call 0x3b60a ; 0x3b60a #ifdef EMERGENCY_DUMP if(crash_reason != dump_crash_reason::manual && 20800: 89 81 ldd r24, Y+1 ; 0x01 20802: 88 23 and r24, r24 20804: 51 f0 breq .+20 ; 0x2081a eeprom_read_byte((uint8_t*)EEPROM_FW_CRASH_FLAG) != 0xFF) 20806: 83 e0 ldi r24, 0x03 ; 3 20808: 9d e0 ldi r25, 0x0D ; 13 2080a: 0f 94 1c dc call 0x3b838 ; 0x3b838 { // 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 && 2080e: 8f 3f cpi r24, 0xFF ; 255 20810: 21 f0 breq .+8 ; 0x2081a eeprom_read_byte((uint8_t*)EEPROM_FW_CRASH_FLAG) != 0xFF) { lcd_show_fullscreen_message_and_wait_P( 20812: 82 e5 ldi r24, 0x52 ; 82 20814: 9c e6 ldi r25, 0x6C ; 108 20816: 0f 94 f1 1f call 0x23fe2 ; 0x23fe2 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 2081a: 6f ef ldi r22, 0xFF ; 255 2081c: 83 e0 ldi r24, 0x03 ; 3 2081e: 9d e0 ldi r25, 0x0D ; 13 20820: 0f 94 40 dc call 0x3b880 ; 0x3b880 // report crash failures fw_crash_init(); #ifdef UVLO_SUPPORT if (printer_recovering()) { //previous print was terminated by UVLO 20824: 0e 94 7b 67 call 0xcef6 ; 0xcef6 20828: 88 23 and r24, r24 2082a: d9 f1 breq .+118 ; 0x208a2 manage_heater(); // Update temperatures 2082c: 0f 94 5c 38 call 0x270b8 ; 0x270b8 //Restore printing type saved_printing_type = eeprom_read_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE); 20830: 8c e8 ldi r24, 0x8C ; 140 20832: 9f e0 ldi r25, 0x0F ; 15 20834: 0f 94 1c dc call 0x3b838 ; 0x3b838 20838: 08 2f mov r16, r24 2083a: 80 93 6a 02 sts 0x026A, r24 ; 0x80026a return current_temperature_bed_raw; }; #endif FORCE_INLINE float degBed() { return current_temperature_bed; 2083e: 80 90 ee 04 lds r8, 0x04EE ; 0x8004ee 20842: 90 90 ef 04 lds r9, 0x04EF ; 0x8004ef 20846: a0 90 f0 04 lds r10, 0x04F0 ; 0x8004f0 2084a: b0 90 f1 04 lds r11, 0x04F1 ; 0x8004f1 #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)); 2084e: 8b e8 ldi r24, 0x8B ; 139 20850: 9f e0 ldi r25, 0x0F ; 15 20852: 0f 94 1c dc call 0x3b838 ; 0x3b838 20856: 68 2f mov r22, r24 20858: 70 e0 ldi r23, 0x00 ; 0 2085a: 90 e0 ldi r25, 0x00 ; 0 2085c: 80 e0 ldi r24, 0x00 ; 0 2085e: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 20862: 20 e0 ldi r18, 0x00 ; 0 20864: 30 e0 ldi r19, 0x00 ; 0 20866: 40 ea ldi r20, 0xA0 ; 160 20868: 50 e4 ldi r21, 0x40 ; 64 2086a: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 2086e: 6b 01 movw r12, r22 20870: 7c 01 movw r14, r24 20872: 11 e0 ldi r17, 0x01 ; 1 20874: ac 01 movw r20, r24 20876: 9b 01 movw r18, r22 20878: c5 01 movw r24, r10 2087a: b4 01 movw r22, r8 2087c: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 20880: 18 16 cp r1, r24 20882: 0c f0 brlt .+2 ; 0x20886 20884: 10 e0 ldi r17, 0x00 ; 0 20886: 10 93 ed 04 sts 0x04ED, r17 ; 0x8004ed <_ZL24uvlo_auto_recovery_ready.lto_priv.531> if (uvlo_auto_recovery_ready){ 2088a: a7 01 movw r20, r14 2088c: 96 01 movw r18, r12 2088e: c5 01 movw r24, r10 20890: b4 01 movw r22, r8 20892: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 20896: 18 16 cp r1, r24 20898: 0c f0 brlt .+2 ; 0x2089c 2089a: 58 c0 rjmp .+176 ; 0x2094c #ifdef DEBUG_UVLO_AUTOMATIC_RECOVER puts_P(_N("Automatic recovery!")); #endif //DEBUG_UVLO_AUTOMATIC_RECOVER recover_print(1); 2089c: 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); 2089e: 0f 94 00 5c call 0x2b800 ; 0x2b800 printf_P(_N("UVLO_TINY - end %d\n"), _millis() - time_start); uvlo_drain_reset(); } void setup_uvlo_interrupt() { DDRE &= ~(1 << 4); //input pin 208a2: 6c 98 cbi 0x0d, 4 ; 13 PORTE &= ~(1 << 4); //no internal pull-up 208a4: 74 98 cbi 0x0e, 4 ; 14 // sensing falling edge EICRB |= (1 << 0); 208a6: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> 208aa: 81 60 ori r24, 0x01 ; 1 208ac: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> EICRB &= ~(1 << 1); 208b0: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> 208b4: 8d 7f andi r24, 0xFD ; 253 208b6: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> // enable INT4 interrupt EIMSK |= (1 << 4); 208ba: ec 9a sbi 0x1d, 4 ; 29 // check if power was lost before we armed the interrupt if(!(PINE & (1 << 4)) && printer_recovering()) 208bc: 64 99 sbic 0x0c, 4 ; 12 208be: 57 c0 rjmp .+174 ; 0x2096e 208c0: 0e 94 7b 67 call 0xcef6 ; 0xcef6 208c4: 88 23 and r24, r24 208c6: 09 f4 brne .+2 ; 0x208ca 208c8: 52 c0 rjmp .+164 ; 0x2096e { SERIAL_ECHOLNRPGM(MSG_INT4); 208ca: 82 e1 ldi r24, 0x12 ; 18 208cc: 9e e8 ldi r25, 0x8E ; 142 208ce: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 uvlo_drain_reset(); 208d2: 0f 94 1c 5f call 0x2be38 ; 0x2be38 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)); 208d6: 82 e1 ldi r24, 0x12 ; 18 208d8: 9d e4 ldi r25, 0x4D ; 77 208da: 0e 94 ac 72 call 0xe558 ; 0xe558 208de: 0f 94 f1 1f call 0x23fe2 ; 0x23fe2 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); 208e2: 6c e2 ldi r22, 0x2C ; 44 208e4: 71 e0 ldi r23, 0x01 ; 1 208e6: 8e ee ldi r24, 0xEE ; 238 208e8: 9e e0 ldi r25, 0x0E ; 14 208ea: 0f 94 7a dc call 0x3b8f4 ; 0x3b8f4 208ee: c4 ce rjmp .-632 ; 0x20678 // 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); 208f0: 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) { 208f2: f1 10 cpse r15, r1 208f4: 3d cf rjmp .-390 ; 0x20770 // some wizard steps required by the upgrade checks lcd_wizard(WizState::Restore); } else { if (!calibration_status_get(CALIBRATION_STATUS_SELFTEST)) { 208f6: 0e 94 9f ee call 0x1dd3e ; 0x1dd3e 208fa: 81 11 cpse r24, r1 208fc: 07 c0 rjmp .+14 ; 0x2090c // aborted or missing wizard: show a single warning lcd_show_fullscreen_message_and_wait_P(_T(MSG_FOLLOW_CALIBRATION_FLOW)); 208fe: 84 e2 ldi r24, 0x24 ; 36 20900: 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)); 20902: 0e 94 ac 72 call 0xe558 ; 0xe558 20906: 0f 94 f1 1f call 0x23fe2 ; 0x23fe2 2090a: 34 cf rjmp .-408 ; 0x20774 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)) { 2090c: 84 e0 ldi r24, 0x04 ; 4 2090e: 0e 94 9f ee call 0x1dd3e ; 0x1dd3e 20912: 81 11 cpse r24, r1 20914: 03 c0 rjmp .+6 ; 0x2091c // wizard reset after service prep lcd_show_fullscreen_message_and_wait_P(_T(MSG_FOLLOW_Z_CALIBRATION_FLOW)); 20916: 8c ea ldi r24, 0xAC ; 172 20918: 9b e4 ldi r25, 0x4B ; 75 2091a: f3 cf rjmp .-26 ; 0x20902 } else { // warn about other important steps individually if (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) 2091c: 80 e1 ldi r24, 0x10 ; 16 2091e: 0e 94 9f ee call 0x1dd3e ; 0x1dd3e 20922: 81 11 cpse r24, r1 20924: 06 c0 rjmp .+12 ; 0x20932 lcd_show_fullscreen_message_and_wait_P(_T(MSG_BABYSTEP_Z_NOT_SET)); 20926: 84 e4 ldi r24, 0x44 ; 68 20928: 9a e5 ldi r25, 0x5A ; 90 2092a: 0e 94 ac 72 call 0xe558 ; 0xe558 2092e: 0f 94 f1 1f call 0x23fe2 ; 0x23fe2 #ifdef THERMAL_MODEL if (!calibration_status_get(CALIBRATION_STATUS_THERMAL_MODEL) && thermal_model_enabled()) 20932: 88 e0 ldi r24, 0x08 ; 8 20934: 0e 94 9f ee call 0x1dd3e ; 0x1dd3e 20938: 81 11 cpse r24, r1 2093a: 1c cf rjmp .-456 ; 0x20774 2093c: 80 91 1d 05 lds r24, 0x051D ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.456> 20940: 88 23 and r24, r24 20942: 09 f4 brne .+2 ; 0x20946 20944: 17 cf rjmp .-466 ; 0x20774 lcd_show_fullscreen_message_and_wait_P(_T(MSG_TM_NOT_CAL)); 20946: 88 e8 ldi r24, 0x88 ; 136 20948: 9b e4 ldi r25, 0x4B ; 75 2094a: db cf rjmp .-74 ; 0x20902 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) { 2094c: 01 30 cpi r16, 0x01 ; 1 2094e: 11 f4 brne .+4 ; 0x20954 recover_print(0); 20950: 80 e0 ldi r24, 0x00 ; 0 20952: a5 cf rjmp .-182 ; 0x2089e } else { const uint8_t btn = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_RECOVER_PRINT), false); 20954: 84 e6 ldi r24, 0x64 ; 100 20956: 9b e4 ldi r25, 0x4B ; 75 20958: 0e 94 ac 72 call 0xe558 ; 0xe558 2095c: 41 e0 ldi r20, 0x01 ; 1 2095e: 60 e0 ldi r22, 0x00 ; 0 20960: 0f 94 40 4f call 0x29e80 ; 0x29e80 if ( btn == LCD_LEFT_BUTTON_CHOICE) { 20964: 88 23 and r24, r24 20966: a1 f3 breq .-24 ; 0x20950 recover_print(0); } else { // LCD_MIDDLE_BUTTON_CHOICE cancel_saved_printing(); 20968: 0e 94 ad 64 call 0xc95a ; 0xc95a 2096c: 9a cf rjmp .-204 ; 0x208a2 ClCheckMode oCheckVersion; ClCheckMode oCheckGcode; ClCheckMode oCheckFilament; void fCheckModeInit() { oCheckMode = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_MODE, (uint8_t)ClCheckMode::_Warn); 2096e: 61 e0 ldi r22, 0x01 ; 1 20970: 88 ea ldi r24, 0xA8 ; 168 20972: 9d e0 ldi r25, 0x0D ; 13 20974: 0e 94 09 76 call 0xec12 ; 0xec12 20978: 80 93 ec 04 sts 0x04EC, r24 ; 0x8004ec 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); 2097c: 68 e2 ldi r22, 0x28 ; 40 2097e: 87 ea ldi r24, 0xA7 ; 167 20980: 9d e0 ldi r25, 0x0D ; 13 20982: 0e 94 09 76 call 0xec12 ; 0xec12 20986: 80 93 eb 04 sts 0x04EB, r24 ; 0x8004eb eeprom_init_default_word((uint16_t *)EEPROM_NOZZLE_DIAMETER_uM, EEPROM_NOZZLE_DIAMETER_uM_DEFAULT); 2098a: 60 e9 ldi r22, 0x90 ; 144 2098c: 71 e0 ldi r23, 0x01 ; 1 2098e: 85 ea ldi r24, 0xA5 ; 165 20990: 9d e0 ldi r25, 0x0D ; 13 20992: 0e 94 f1 75 call 0xebe2 ; 0xebe2 oCheckModel = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_MODEL, (uint8_t)ClCheckMode::_Warn); 20996: 61 e0 ldi r22, 0x01 ; 1 20998: 84 ea ldi r24, 0xA4 ; 164 2099a: 9d e0 ldi r25, 0x0D ; 13 2099c: 0e 94 09 76 call 0xec12 ; 0xec12 209a0: 80 93 ea 04 sts 0x04EA, r24 ; 0x8004ea oCheckVersion = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_VERSION, (uint8_t)ClCheckMode::_Warn); 209a4: 61 e0 ldi r22, 0x01 ; 1 209a6: 83 ea ldi r24, 0xA3 ; 163 209a8: 9d e0 ldi r25, 0x0D ; 13 209aa: 0e 94 09 76 call 0xec12 ; 0xec12 209ae: 80 93 e9 04 sts 0x04E9, r24 ; 0x8004e9 oCheckGcode = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_GCODE, (uint8_t)ClCheckMode::_Warn); 209b2: 61 e0 ldi r22, 0x01 ; 1 209b4: 82 ea ldi r24, 0xA2 ; 162 209b6: 9d e0 ldi r25, 0x0D ; 13 209b8: 0e 94 09 76 call 0xec12 ; 0xec12 209bc: 80 93 e8 04 sts 0x04E8, r24 ; 0x8004e8 oCheckFilament = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_FILAMENT, (uint8_t)ClCheckMode::_Warn); 209c0: 61 e0 ldi r22, 0x01 ; 1 209c2: 80 e2 ldi r24, 0x20 ; 32 209c4: 9c e0 ldi r25, 0x0C ; 12 209c6: 0e 94 09 76 call 0xec12 ; 0xec12 209ca: 80 93 e7 04 sts 0x04E7, r24 ; 0x8004e7 // the entire state machine initialized. setup_uvlo_interrupt(); #endif //UVLO_SUPPORT fCheckModeInit(); KEEPALIVE_STATE(NOT_BUSY); 209ce: 81 e0 ldi r24, 0x01 ; 1 209d0: 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" ); 209d4: 88 e1 ldi r24, 0x18 ; 24 209d6: 98 e2 ldi r25, 0x28 ; 40 209d8: 0f b6 in r0, 0x3f ; 63 209da: f8 94 cli 209dc: a8 95 wdr 209de: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 209e2: 0f be out 0x3f, r0 ; 63 209e4: 90 93 60 00 sts 0x0060, r25 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> #ifdef WATCHDOG wdt_enable(WDTO_4S); #ifdef EMERGENCY_HANDLERS WDTCSR |= (1 << WDIE); 209e8: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 209ec: 80 64 ori r24, 0x40 ; 64 209ee: 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; 209f2: 85 e0 ldi r24, 0x05 ; 5 209f4: d8 2e mov r13, r24 setup(); for (;;) { loop(); if (serialEventRun) serialEventRun(); 209f6: 00 e0 ldi r16, 0x00 ; 0 209f8: 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); 209fa: cc 24 eor r12, r12 209fc: 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); 209fe: 94 e0 ldi r25, 0x04 ; 4 20a00: 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; 20a02: 10 92 ac 0d sts 0x0DAC, r1 ; 0x800dac if(Stopped) { 20a06: 80 91 11 05 lds r24, 0x0511 ; 0x800511 20a0a: 88 23 and r24, r24 20a0c: 09 f4 brne .+2 ; 0x20a10 20a0e: c4 c0 rjmp .+392 ; 0x20b98 // 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); 20a10: 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. 20a14: 0e 94 85 67 call 0xcf0a ; 0xcf0a 20a18: 88 23 and r24, r24 20a1a: 09 f4 brne .+2 ; 0x20a1e 20a1c: c0 c0 rjmp .+384 ; 0x20b9e 20a1e: 80 91 6a 02 lds r24, 0x026A ; 0x80026a 20a22: 81 30 cpi r24, 0x01 ; 1 20a24: 09 f0 breq .+2 ; 0x20a28 20a26: bb c0 rjmp .+374 ; 0x20b9e usb_timer.start(); 20a28: 8e e0 ldi r24, 0x0E ; 14 20a2a: 95 e0 ldi r25, 0x05 ; 5 20a2c: 0f 94 ad 29 call 0x2535a ; 0x2535a ::start()> } else #endif { get_command(); 20a30: 0e 94 20 83 call 0x10640 ; 0x10640 // 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) 20a34: 80 91 69 02 lds r24, 0x0269 ; 0x800269 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.551> 20a38: 88 23 and r24, r24 20a3a: 89 f0 breq .+34 ; 0x20a5e return; if(autostart_atmillis.expired(5000)) 20a3c: 68 e8 ldi r22, 0x88 ; 136 20a3e: 73 e1 ldi r23, 0x13 ; 19 20a40: 81 ea ldi r24, 0xA1 ; 161 20a42: 97 e1 ldi r25, 0x17 ; 23 20a44: 0f 94 7e 29 call 0x252fc ; 0x252fc ::expired(unsigned short)> 20a48: 81 11 cpse r24, r1 20a4a: 09 c0 rjmp .+18 ; 0x20a5e return; } autostart_stilltocheck = false; 20a4c: 10 92 69 02 sts 0x0269, r1 ; 0x800269 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.551> if(!mounted) 20a50: 80 91 91 14 lds r24, 0x1491 ; 0x801491 20a54: 88 23 and r24, r24 20a56: 09 f4 brne .+2 ; 0x20a5a 20a58: ae c0 rjmp .+348 ; 0x20bb6 20a5a: 0f 94 b7 75 call 0x2eb6e ; 0x2eb6e #ifdef SDSUPPORT card.checkautostart(false); #endif if(buflen) 20a5e: 80 91 a3 10 lds r24, 0x10A3 ; 0x8010a3 20a62: 90 91 a4 10 lds r25, 0x10A4 ; 0x8010a4 20a66: 89 2b or r24, r25 20a68: 09 f4 brne .+2 ; 0x20a6c 20a6a: 61 c0 rjmp .+194 ; 0x20b2e { cmdbuffer_front_already_processed = false; 20a6c: 10 92 a2 10 sts 0x10A2, r1 ; 0x8010a2 #ifdef SDSUPPORT if(card.saving) 20a70: 80 91 8e 14 lds r24, 0x148E ; 0x80148e 20a74: 88 23 and r24, r24 20a76: d1 f1 breq .+116 ; 0x20aec { // 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) { 20a78: 80 91 92 12 lds r24, 0x1292 ; 0x801292 20a7c: 90 91 93 12 lds r25, 0x1293 ; 0x801293 20a80: dc 01 movw r26, r24 20a82: a8 55 subi r26, 0x58 ; 88 20a84: bf 4e sbci r27, 0xEF ; 239 20a86: 7d 01 movw r14, r26 20a88: 62 eb ldi r22, 0xB2 ; 178 20a8a: 7e e8 ldi r23, 0x8E ; 142 20a8c: cd 01 movw r24, r26 20a8e: 0f 94 23 da call 0x3b446 ; 0x3b446 20a92: 89 2b or r24, r25 20a94: 09 f0 breq .+2 ; 0x20a98 20a96: 9c c0 rjmp .+312 ; 0x20bd0 else SERIAL_PROTOCOLLNPGM("Not SD printing"); } void CardReader::write_command(char *buf) { file.writeError = false; 20a98: 10 92 20 17 sts 0x1720, r1 ; 0x801720 /** 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)); 20a9c: f7 01 movw r30, r14 20a9e: 01 90 ld r0, Z+ 20aa0: 00 20 and r0, r0 20aa2: e9 f7 brne .-6 ; 0x20a9e 20aa4: 31 97 sbiw r30, 0x01 ; 1 20aa6: bf 01 movw r22, r30 20aa8: 6e 19 sub r22, r14 20aaa: 7f 09 sbc r23, r15 20aac: c7 01 movw r24, r14 20aae: 0f 94 60 83 call 0x306c0 ; 0x306c0 20ab2: 62 e0 ldi r22, 0x02 ; 2 20ab4: 70 e0 ldi r23, 0x00 ; 0 20ab6: 86 ef ldi r24, 0xF6 ; 246 20ab8: 92 e0 ldi r25, 0x02 ; 2 20aba: 0f 94 60 83 call 0x306c0 ; 0x306c0 file.write(buf); //write command file.write("\r\n"); //write line termination if (file.writeError) 20abe: 80 91 20 17 lds r24, 0x1720 ; 0x801720 20ac2: 88 23 and r24, r24 20ac4: 41 f0 breq .+16 ; 0x20ad6 { SERIAL_ERROR_START; 20ac6: 8a e9 ldi r24, 0x9A ; 154 20ac8: 9b ea ldi r25, 0xAB ; 171 20aca: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ERRORLNRPGM(MSG_SD_ERR_WRITE_TO_FILE); 20ace: 83 e9 ldi r24, 0x93 ; 147 20ad0: 9d e6 ldi r25, 0x6D ; 109 20ad2: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 card.write_command(CMDBUFFER_CURRENT_STRING); if(card.logging) 20ad6: 80 91 8f 14 lds r24, 0x148F ; 0x80148f 20ada: 88 23 and r24, r24 20adc: 09 f4 brne .+2 ; 0x20ae0 20ade: 73 c0 rjmp .+230 ; 0x20bc6 */ void process_commands() { if (!buflen) return; //empty command 20ae0: 80 91 a3 10 lds r24, 0x10A3 ; 0x8010a3 20ae4: 90 91 a4 10 lds r25, 0x10A4 ; 0x8010a4 20ae8: 89 2b or r24, r25 20aea: 11 f0 breq .+4 ; 0x20af0 20aec: 0e 94 7b 95 call 0x12af6 ; 0x12af6 } #else process_commands(); #endif //SDSUPPORT if (! cmdbuffer_front_already_processed && buflen) 20af0: 80 91 a2 10 lds r24, 0x10A2 ; 0x8010a2 20af4: 81 11 cpse r24, r1 20af6: 19 c0 rjmp .+50 ; 0x20b2a 20af8: 80 91 a3 10 lds r24, 0x10A3 ; 0x8010a3 20afc: 90 91 a4 10 lds r25, 0x10A4 ; 0x8010a4 20b00: 89 2b or r24, r25 20b02: 99 f0 breq .+38 ; 0x20b2a { // 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; 20b04: e0 91 92 12 lds r30, 0x1292 ; 0x801292 20b08: f0 91 93 12 lds r31, 0x1293 ; 0x801293 20b0c: eb 55 subi r30, 0x5B ; 91 20b0e: ff 4e sbci r31, 0xEF ; 239 if (*ptr == CMDBUFFER_CURRENT_TYPE_SDCARD) { 20b10: 80 81 ld r24, Z 20b12: 82 30 cpi r24, 0x02 ; 2 20b14: 09 f0 breq .+2 ; 0x20b18 20b16: 6b c0 rjmp .+214 ; 0x20bee { // 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(); 20b18: 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; 20b1a: 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); 20b1c: 81 81 ldd r24, Z+1 ; 0x01 20b1e: 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); 20b20: 0f 94 46 63 call 0x2c68c ; 0x2c68c sei(); 20b24: 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(); 20b26: 0e 94 bc 76 call 0xed78 ; 0xed78 } host_keepalive(); 20b2a: 0e 94 a7 7f call 0xff4e ; 0xff4e } } //check heater every n milliseconds manage_heater(); 20b2e: 0f 94 5c 38 call 0x270b8 ; 0x270b8 manage_inactivity(printingIsPaused()); 20b32: 0e 94 85 67 call 0xcf0a ; 0xcf0a 20b36: 0e 94 af 8a call 0x1155e ; 0x1155e //=============================functions ============================ //=========================================================================== void checkHitEndstops() { if(endstop_hit) { 20b3a: 80 91 0b 05 lds r24, 0x050B ; 0x80050b <_ZL11endstop_hit.lto_priv.480> 20b3e: 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; 20b40: 10 92 0b 05 sts 0x050B, r1 ; 0x80050b <_ZL11endstop_hit.lto_priv.480> checkHitEndstops(); lcd_update(0); 20b44: 80 e0 ldi r24, 0x00 ; 0 20b46: 0e 94 a7 6e call 0xdd4e ; 0xdd4e #ifdef TMC2130 tmc2130_check_overtemp(); 20b4a: 0f 94 e7 29 call 0x253ce ; 0x253ce if (tmc2130_sg_crash) 20b4e: 80 91 0d 05 lds r24, 0x050D ; 0x80050d 20b52: 88 23 and r24, r24 20b54: 79 f0 breq .+30 ; 0x20b74 { uint8_t crash = tmc2130_sg_crash; tmc2130_sg_crash = 0; 20b56: 10 92 0d 05 sts 0x050D, r1 ; 0x80050d // crashdet_stop_and_save_print(); switch (crash) 20b5a: 82 30 cpi r24, 0x02 ; 2 20b5c: 09 f4 brne .+2 ; 0x20b60 20b5e: 53 c0 rjmp .+166 ; 0x20c06 20b60: 83 30 cpi r24, 0x03 ; 3 20b62: 09 f4 brne .+2 ; 0x20b66 20b64: 54 c0 rjmp .+168 ; 0x20c0e 20b66: 81 30 cpi r24, 0x01 ; 1 20b68: 29 f4 brne .+10 ; 0x20b74 { case 1: enquecommand_P((PSTR("CRASH_DETECTEDX"))); break; 20b6a: 61 e0 ldi r22, 0x01 ; 1 20b6c: 82 ea ldi r24, 0xA2 ; 162 20b6e: 9e e8 ldi r25, 0x8E ; 142 case 2: enquecommand_P((PSTR("CRASH_DETECTEDY"))); break; case 3: enquecommand_P((PSTR("CRASH_DETECTEDXY"))); break; 20b70: 0e 94 20 88 call 0x11040 ; 0x11040 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) { 20b74: 80 91 0c 05 lds r24, 0x050C ; 0x80050c <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.540> 20b78: 81 11 cpse r24, r1 20b7a: 07 c0 rjmp .+14 ; 0x20b8a return; } avoidRecursion = true; 20b7c: c0 92 0c 05 sts 0x050C, r12 ; 0x80050c <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.540> mmu_loop_inner(true); 20b80: 81 e0 ldi r24, 0x01 ; 1 20b82: 0f 94 02 a7 call 0x34e04 ; 0x34e04 avoidRecursion = false; 20b86: 10 92 0c 05 sts 0x050C, r1 ; 0x80050c <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.540> 20b8a: 01 15 cp r16, r1 20b8c: 11 05 cpc r17, r1 20b8e: 09 f4 brne .+2 ; 0x20b92 20b90: 38 cf rjmp .-400 ; 0x20a02 20b92: 0e 94 00 00 call 0 ; 0x0 <__vectors> 20b96: 35 cf rjmp .-406 ; 0x20a02 // 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); 20b98: c0 92 be 02 sts 0x02BE, r12 ; 0x8002be 20b9c: 3b cf rjmp .-394 ; 0x20a14 } 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. 20b9e: 60 e1 ldi r22, 0x10 ; 16 20ba0: 77 e2 ldi r23, 0x27 ; 39 20ba2: 8e e0 ldi r24, 0x0E ; 14 20ba4: 95 e0 ldi r25, 0x05 ; 5 20ba6: 0f 94 7e 29 call 0x252fc ; 0x252fc ::expired(unsigned short)> 20baa: 88 23 and r24, r24 20bac: 09 f4 brne .+2 ; 0x20bb0 20bae: 40 cf rjmp .-384 ; 0x20a30 20bb0: b0 92 b8 0d sts 0x0DB8, r11 ; 0x800db8 <_ZL13printer_state.lto_priv.401> 20bb4: 3d cf rjmp .-390 ; 0x20a30 return; } autostart_stilltocheck = false; if(!mounted) { mount(); 20bb6: 81 e0 ldi r24, 0x01 ; 1 20bb8: 0f 94 c2 80 call 0x30184 ; 0x30184 if(!mounted) //fail 20bbc: 80 91 91 14 lds r24, 0x1491 ; 0x801491 20bc0: 81 11 cpse r24, r1 20bc2: 4b cf rjmp .-362 ; 0x20a5a 20bc4: 4c cf rjmp .-360 ; 0x20a5e 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); 20bc6: 8b eb ldi r24, 0xBB ; 187 20bc8: 9d e6 ldi r25, 0x6D ; 109 } else { card.closefile(); SERIAL_PROTOCOLLNRPGM(MSG_FILE_SAVED); 20bca: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 20bce: 90 cf rjmp .-224 ; 0x20af0 lastnr++; } void CardReader::closefile(bool store_location) { file.sync(); 20bd0: 80 e2 ldi r24, 0x20 ; 32 20bd2: 97 e1 ldi r25, 0x17 ; 23 20bd4: 0f 94 3b 58 call 0x2b076 ; 0x2b076 file.close(); 20bd8: 80 e2 ldi r24, 0x20 ; 32 20bda: 97 e1 ldi r25, 0x17 ; 23 20bdc: 0f 94 70 58 call 0x2b0e0 ; 0x2b0e0 saving = false; 20be0: 10 92 8e 14 sts 0x148E, r1 ; 0x80148e logging = false; 20be4: 10 92 8f 14 sts 0x148F, r1 ; 0x80148f 20be8: 89 ea ldi r24, 0xA9 ; 169 20bea: 9d e6 ldi r25, 0x6D ; 109 20bec: ee cf rjmp .-36 ; 0x20bca // 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){ 20bee: 86 30 cpi r24, 0x06 ; 6 20bf0: 09 f0 breq .+2 ; 0x20bf4 20bf2: 99 cf rjmp .-206 ; 0x20b26 20bf4: 80 91 90 14 lds r24, 0x1490 ; 0x801490 20bf8: 81 11 cpse r24, r1 20bfa: 95 cf rjmp .-214 ; 0x20b26 cli(); 20bfc: f8 94 cli *ptr ++ = CMDBUFFER_CURRENT_TYPE_TO_BE_REMOVED; 20bfe: d0 82 st Z, r13 // and one for each command to previous block in the planner queue. planner_add_sd_length(1); 20c00: 81 e0 ldi r24, 0x01 ; 1 20c02: 90 e0 ldi r25, 0x00 ; 0 20c04: 8d cf rjmp .-230 ; 0x20b20 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; 20c06: 61 e0 ldi r22, 0x01 ; 1 20c08: 82 e9 ldi r24, 0x92 ; 146 20c0a: 9e e8 ldi r25, 0x8E ; 142 20c0c: b1 cf rjmp .-158 ; 0x20b70 case 3: enquecommand_P((PSTR("CRASH_DETECTEDXY"))); break; 20c0e: 61 e0 ldi r22, 0x01 ; 1 20c10: 81 e8 ldi r24, 0x81 ; 129 20c12: 9e e8 ldi r25, 0x8E ; 142 20c14: ad cf rjmp .-166 ; 0x20b70 { 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; 20c16: 02 e0 ldi r16, 0x02 ; 2 if (motherboard != MOTHERBOARD) version_changed |= 0b01; 20c18: 86 33 cpi r24, 0x36 ; 54 20c1a: 91 40 sbci r25, 0x01 ; 1 20c1c: 09 f0 breq .+2 ; 0x20c20 20c1e: 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(); 20c20: 0e 94 8c 82 call 0x10518 ; 0x10518 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; 20c24: 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; 20c26: 82 ea ldi r24, 0xA2 ; 162 20c28: 92 ea ldi r25, 0xA2 ; 162 20c2a: a0 e0 ldi r26, 0x00 ; 0 20c2c: b0 e0 ldi r27, 0x00 ; 0 20c2e: 80 93 40 18 sts 0x1840, r24 ; 0x801840 <__bss_end+0x20> 20c32: 90 93 41 18 sts 0x1841, r25 ; 0x801841 <__bss_end+0x21> 20c36: a0 93 42 18 sts 0x1842, r26 ; 0x801842 <__bss_end+0x22> 20c3a: b0 93 43 18 sts 0x1843, r27 ; 0x801843 <__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; 20c3e: 10 92 b3 04 sts 0x04B3, r1 ; 0x8004b3 <_ZL14iState_sum_min.lto_priv.468> 20c42: 10 92 b4 04 sts 0x04B4, r1 ; 0x8004b4 <_ZL14iState_sum_min.lto_priv.468+0x1> 20c46: 10 92 b5 04 sts 0x04B5, r1 ; 0x8004b5 <_ZL14iState_sum_min.lto_priv.468+0x2> 20c4a: 10 92 b6 04 sts 0x04B6, r1 ; 0x8004b6 <_ZL14iState_sum_min.lto_priv.468+0x3> iState_sum_max[e] = PID_INTEGRAL_DRIVE_MAX / cs.Ki; 20c4e: 20 91 2a 0e lds r18, 0x0E2A ; 0x800e2a 20c52: 30 91 2b 0e lds r19, 0x0E2B ; 0x800e2b 20c56: 40 91 2c 0e lds r20, 0x0E2C ; 0x800e2c 20c5a: 50 91 2d 0e lds r21, 0x0E2D ; 0x800e2d 20c5e: 60 e0 ldi r22, 0x00 ; 0 20c60: 70 e0 ldi r23, 0x00 ; 0 20c62: 8f e7 ldi r24, 0x7F ; 127 20c64: 93 e4 ldi r25, 0x43 ; 67 20c66: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 20c6a: 60 93 af 04 sts 0x04AF, r22 ; 0x8004af <_ZL14iState_sum_max.lto_priv.469> 20c6e: 70 93 b0 04 sts 0x04B0, r23 ; 0x8004b0 <_ZL14iState_sum_max.lto_priv.469+0x1> 20c72: 80 93 b1 04 sts 0x04B1, r24 ; 0x8004b1 <_ZL14iState_sum_max.lto_priv.469+0x2> 20c76: 90 93 b2 04 sts 0x04B2, r25 ; 0x8004b2 <_ZL14iState_sum_max.lto_priv.469+0x3> #endif //PIDTEMP #ifdef PIDTEMPBED temp_iState_min_bed = 0.0; 20c7a: 10 92 ab 04 sts 0x04AB, r1 ; 0x8004ab <_ZL19temp_iState_min_bed.lto_priv.466> 20c7e: 10 92 ac 04 sts 0x04AC, r1 ; 0x8004ac <_ZL19temp_iState_min_bed.lto_priv.466+0x1> 20c82: 10 92 ad 04 sts 0x04AD, r1 ; 0x8004ad <_ZL19temp_iState_min_bed.lto_priv.466+0x2> 20c86: 10 92 ae 04 sts 0x04AE, r1 ; 0x8004ae <_ZL19temp_iState_min_bed.lto_priv.466+0x3> temp_iState_max_bed = PID_INTEGRAL_DRIVE_MAX / cs.bedKi; 20c8a: 20 91 36 0e lds r18, 0x0E36 ; 0x800e36 20c8e: 30 91 37 0e lds r19, 0x0E37 ; 0x800e37 20c92: 40 91 38 0e lds r20, 0x0E38 ; 0x800e38 20c96: 50 91 39 0e lds r21, 0x0E39 ; 0x800e39 20c9a: 60 e0 ldi r22, 0x00 ; 0 20c9c: 70 e0 ldi r23, 0x00 ; 0 20c9e: 8f e7 ldi r24, 0x7F ; 127 20ca0: 93 e4 ldi r25, 0x43 ; 67 20ca2: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 20ca6: 60 93 a7 04 sts 0x04A7, r22 ; 0x8004a7 <_ZL19temp_iState_max_bed.lto_priv.467> 20caa: 70 93 a8 04 sts 0x04A8, r23 ; 0x8004a8 <_ZL19temp_iState_max_bed.lto_priv.467+0x1> 20cae: 80 93 a9 04 sts 0x04A9, r24 ; 0x8004a9 <_ZL19temp_iState_max_bed.lto_priv.467+0x2> 20cb2: 90 93 aa 04 sts 0x04AA, r25 ; 0x8004aa <_ZL19temp_iState_max_bed.lto_priv.467+0x3> #endif //PIDTEMPBED } #if defined(HEATER_0_PIN) && (HEATER_0_PIN > -1) SET_OUTPUT(HEATER_0_PIN); 20cb6: 6d 9a sbi 0x0d, 5 ; 13 #endif #if defined(HEATER_BED_PIN) && (HEATER_BED_PIN > -1) SET_OUTPUT(HEATER_BED_PIN); 20cb8: 9d 9a sbi 0x13, 5 ; 19 #endif #if defined(FAN_PIN) && (FAN_PIN > -1) SET_OUTPUT(FAN_PIN); 20cba: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 20cbe: 88 60 ori r24, 0x08 ; 8 20cc0: 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)); 20cc4: 80 91 a6 04 lds r24, 0x04A6 ; 0x8004a6 20cc8: 90 e0 ldi r25, 0x00 ; 0 20cca: b4 e0 ldi r27, 0x04 ; 4 20ccc: 95 95 asr r25 20cce: 87 95 ror r24 20cd0: ba 95 dec r27 20cd2: e1 f7 brne .-8 ; 0x20ccc 20cd4: 80 93 a5 04 sts 0x04A5, r24 ; 0x8004a5 <_ZL12soft_pwm_fan.lto_priv.460> pinMode(MAX6675_SS, OUTPUT); digitalWrite(MAX6675_SS,1); #endif #ifdef HEATER_0_MINTEMP minttemp[0] = HEATER_0_MINTEMP; 20cd8: 8a e0 ldi r24, 0x0A ; 10 20cda: 90 e0 ldi r25, 0x00 ; 0 20cdc: 90 93 a4 04 sts 0x04A4, r25 ; 0x8004a4 <_ZL8minttemp.lto_priv.461+0x1> 20ce0: 80 93 a3 04 sts 0x04A3, r24 ; 0x8004a3 <_ZL8minttemp.lto_priv.461> while(analog2temp(minttemp_raw[0], 0) < HEATER_0_MINTEMP) { 20ce4: 80 91 54 02 lds r24, 0x0254 ; 0x800254 <_ZL12minttemp_raw.lto_priv.472> 20ce8: 90 91 55 02 lds r25, 0x0255 ; 0x800255 <_ZL12minttemp_raw.lto_priv.472+0x1> 20cec: 0f 94 1c a1 call 0x34238 ; 0x34238 20cf0: 20 e0 ldi r18, 0x00 ; 0 20cf2: 30 e0 ldi r19, 0x00 ; 0 20cf4: 40 e2 ldi r20, 0x20 ; 32 20cf6: 51 e4 ldi r21, 0x41 ; 65 20cf8: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 20cfc: 87 fd sbrc r24, 7 20cfe: 02 c0 rjmp .+4 ; 0x20d04 20d00: 0c 94 2a fe jmp 0x1fc54 ; 0x1fc54 #if HEATER_0_RAW_LO_TEMP < HEATER_0_RAW_HI_TEMP minttemp_raw[0] += OVERSAMPLENR; #else minttemp_raw[0] -= OVERSAMPLENR; 20d04: 80 91 54 02 lds r24, 0x0254 ; 0x800254 <_ZL12minttemp_raw.lto_priv.472> 20d08: 90 91 55 02 lds r25, 0x0255 ; 0x800255 <_ZL12minttemp_raw.lto_priv.472+0x1> 20d0c: 40 97 sbiw r24, 0x10 ; 16 20d0e: 90 93 55 02 sts 0x0255, r25 ; 0x800255 <_ZL12minttemp_raw.lto_priv.472+0x1> 20d12: 80 93 54 02 sts 0x0254, r24 ; 0x800254 <_ZL12minttemp_raw.lto_priv.472> 20d16: e6 cf rjmp .-52 ; 0x20ce4 00020d18 : } } void lcd_print_stop_finish(); void lcd_commands() 20d18: 2f 92 push r2 20d1a: 3f 92 push r3 20d1c: 4f 92 push r4 20d1e: 5f 92 push r5 20d20: 6f 92 push r6 20d22: 7f 92 push r7 20d24: 8f 92 push r8 20d26: 9f 92 push r9 20d28: af 92 push r10 20d2a: bf 92 push r11 20d2c: cf 92 push r12 20d2e: df 92 push r13 20d30: ef 92 push r14 20d32: ff 92 push r15 20d34: 0f 93 push r16 20d36: 1f 93 push r17 20d38: cf 93 push r28 20d3a: df 93 push r29 20d3c: 00 d0 rcall .+0 ; 0x20d3e 20d3e: 1f 92 push r1 20d40: 1f 92 push r1 20d42: cd b7 in r28, 0x3d ; 61 20d44: 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) 20d46: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 20d4a: 81 30 cpi r24, 0x01 ; 1 20d4c: 09 f0 breq .+2 ; 0x20d50 20d4e: 61 c0 rjmp .+194 ; 0x20e12 20d50: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 20d54: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 { if (!blocks_queued() && !homing_flag) 20d58: 98 13 cpse r25, r24 20d5a: 5b c0 rjmp .+182 ; 0x20e12 20d5c: 80 91 a7 0d lds r24, 0x0DA7 ; 0x800da7 20d60: 81 11 cpse r24, r1 20d62: 57 c0 rjmp .+174 ; 0x20e12 { custom_message_type = CustomMsg::Status; 20d64: 10 92 c4 06 sts 0x06C4, r1 ; 0x8006c4 lcd_setstatuspgm(_T(MSG_PRINT_ABORTED)); 20d68: 8e e3 ldi r24, 0x3E ; 62 20d6a: 9a e4 ldi r25, 0x4A ; 74 20d6c: 0e 94 ac 72 call 0xe558 ; 0xe558 20d70: 0e 94 5d f1 call 0x1e2ba ; 0x1e2ba lcd_commands_type = LcdCommands::Idle; 20d74: 10 92 b4 0d sts 0x0DB4, r1 ; 0x800db4 20d78: 82 e0 ldi r24, 0x02 ; 2 20d7a: 80 93 b8 0d sts 0x0DB8, r24 ; 0x800db8 <_ZL13printer_state.lto_priv.401> SetPrinterState(PrinterState::Idle); lcd_commands_step = 0; 20d7e: 10 92 fb 03 sts 0x03FB, r1 ; 0x8003fb #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(); 20d82: 0f 94 b1 42 call 0x28562 ; 0x28562 save_statistics(); 20d86: 0e 94 1f 66 call 0xcc3e ; 0xcc3e // lift Z raise_z(10); 20d8a: 60 e0 ldi r22, 0x00 ; 0 20d8c: 70 e0 ldi r23, 0x00 ; 0 20d8e: 80 e2 ldi r24, 0x20 ; 32 20d90: 91 e4 ldi r25, 0x41 ; 65 20d92: 0e 94 e1 6d call 0xdbc2 ; 0xdbc2 // if axis are homed, move to parking position. if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) { 20d96: 80 91 8f 06 lds r24, 0x068F ; 0x80068f 20d9a: 88 23 and r24, r24 20d9c: 21 f1 breq .+72 ; 0x20de6 20d9e: 80 91 90 06 lds r24, 0x0690 ; 0x800690 20da2: 88 23 and r24, r24 20da4: 01 f1 breq .+64 ; 0x20de6 current_position[X_AXIS] = X_CANCEL_POS; 20da6: 80 e0 ldi r24, 0x00 ; 0 20da8: 90 e0 ldi r25, 0x00 ; 0 20daa: a8 e4 ldi r26, 0x48 ; 72 20dac: b2 e4 ldi r27, 0x42 ; 66 20dae: 80 93 92 06 sts 0x0692, r24 ; 0x800692 20db2: 90 93 93 06 sts 0x0693, r25 ; 0x800693 20db6: a0 93 94 06 sts 0x0694, r26 ; 0x800694 20dba: b0 93 95 06 sts 0x0695, r27 ; 0x800695 current_position[Y_AXIS] = Y_CANCEL_POS; 20dbe: 80 e0 ldi r24, 0x00 ; 0 20dc0: 90 e0 ldi r25, 0x00 ; 0 20dc2: ae e3 ldi r26, 0x3E ; 62 20dc4: b3 e4 ldi r27, 0x43 ; 67 20dc6: 80 93 96 06 sts 0x0696, r24 ; 0x800696 20dca: 90 93 97 06 sts 0x0697, r25 ; 0x800697 20dce: a0 93 98 06 sts 0x0698, r26 ; 0x800698 20dd2: b0 93 99 06 sts 0x0699, r27 ; 0x800699 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 20dd6: 60 e0 ldi r22, 0x00 ; 0 20dd8: 70 e0 ldi r23, 0x00 ; 0 20dda: 84 e3 ldi r24, 0x34 ; 52 20ddc: 92 e4 ldi r25, 0x42 ; 66 20dde: 0f 94 49 c0 call 0x38092 ; 0x38092 st_synchronize(); 20de2: 0f 94 e8 42 call 0x285d0 ; 0x285d0 temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; 20de6: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_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()) { 20dea: 88 23 and r24, r24 20dec: 09 f4 brne .+2 ; 0x20df0 20dee: c9 c0 rjmp .+402 ; 0x20f82 // time to stop the error beep WRITE(BEEPER, LOW); 20df0: 9f b7 in r25, 0x3f ; 63 20df2: f8 94 cli 20df4: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 20df8: 8b 7f andi r24, 0xFB ; 251 20dfa: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 20dfe: 9f bf out 0x3f, r25 ; 63 MMU2::mmu2.unload(); // M702 } } } lcd_cooldown(); //turns off heaters and fan; goes to status screen. 20e00: 0f 94 2d 2f call 0x25e5a ; 0x25e5a finishAndDisableSteppers(); //M84 20e04: 0e 94 68 82 call 0x104d0 ; 0x104d0 axis_relative_modes = E_AXIS_MASK; //XYZ absolute, E relative 20e08: 88 e0 ldi r24, 0x08 ; 8 20e0a: 80 93 e5 03 sts 0x03E5, r24 ; 0x8003e5 did_pause_print = false; // Clear pause state in case the print was aborted while paused 20e0e: 10 92 e4 03 sts 0x03E4, r1 ; 0x8003e4 lcd_commands_step = 0; lcd_print_stop_finish(); } } if (lcd_commands_type == LcdCommands::LongPause) 20e12: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 20e16: 82 30 cpi r24, 0x02 ; 2 20e18: 09 f0 breq .+2 ; 0x20e1c 20e1a: 6a c0 rjmp .+212 ; 0x20ef0 20e1c: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 20e20: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 { if (!blocks_queued() && !homing_flag) 20e24: 98 13 cpse r25, r24 20e26: 64 c0 rjmp .+200 ; 0x20ef0 20e28: 80 91 a7 0d lds r24, 0x0DA7 ; 0x800da7 20e2c: 81 11 cpse r24, r1 20e2e: 60 c0 rjmp .+192 ; 0x20ef0 { if (custom_message_type != CustomMsg::M117) 20e30: 80 91 c4 06 lds r24, 0x06C4 ; 0x8006c4 20e34: 87 30 cpi r24, 0x07 ; 7 20e36: 41 f0 breq .+16 ; 0x20e48 { custom_message_type = CustomMsg::Status; 20e38: 10 92 c4 06 sts 0x06C4, r1 ; 0x8006c4 lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); 20e3c: 8f e2 ldi r24, 0x2F ; 47 20e3e: 9a e4 ldi r25, 0x4A ; 74 20e40: 0e 94 ac 72 call 0xe558 ; 0xe558 20e44: 0e 94 5d f1 call 0x1e2ba ; 0x1e2ba } lcd_commands_type = LcdCommands::Idle; 20e48: 10 92 b4 0d sts 0x0DB4, r1 ; 0x800db4 20e4c: 82 e0 ldi r24, 0x02 ; 2 20e4e: 80 93 b8 0d sts 0x0DB8, r24 ; 0x800db8 <_ZL13printer_state.lto_priv.401> SetPrinterState(PrinterState::Idle); lcd_commands_step = 0; 20e52: 10 92 fb 03 sts 0x03FB, r1 ; 0x8003fb } #endif //PINDA_THERMISTOR void long_pause() //long pause print { st_synchronize(); 20e56: 0f 94 e8 42 call 0x285d0 ; 0x285d0 // Stop heaters heating_status = HeatingStatus::NO_HEATING; 20e5a: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 20e5e: 10 92 b7 0d sts 0x0DB7, r1 ; 0x800db7 20e62: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 setTargetHotend(0); // Lift z raise_z(pause_position[Z_AXIS]); 20e66: 60 91 47 02 lds r22, 0x0247 ; 0x800247 <_ZL14pause_position.lto_priv.481+0x8> 20e6a: 70 91 48 02 lds r23, 0x0248 ; 0x800248 <_ZL14pause_position.lto_priv.481+0x9> 20e6e: 80 91 49 02 lds r24, 0x0249 ; 0x800249 <_ZL14pause_position.lto_priv.481+0xa> 20e72: 90 91 4a 02 lds r25, 0x024A ; 0x80024a <_ZL14pause_position.lto_priv.481+0xb> 20e76: 0e 94 e1 6d call 0xdbc2 ; 0xdbc2 // Move XY to side if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) { 20e7a: 80 91 8f 06 lds r24, 0x068F ; 0x80068f 20e7e: 88 23 and r24, r24 20e80: 51 f1 breq .+84 ; 0x20ed6 20e82: 80 91 90 06 lds r24, 0x0690 ; 0x800690 20e86: 88 23 and r24, r24 20e88: 31 f1 breq .+76 ; 0x20ed6 current_position[X_AXIS] = pause_position[X_AXIS]; 20e8a: 80 91 3f 02 lds r24, 0x023F ; 0x80023f <_ZL14pause_position.lto_priv.481> 20e8e: 90 91 40 02 lds r25, 0x0240 ; 0x800240 <_ZL14pause_position.lto_priv.481+0x1> 20e92: a0 91 41 02 lds r26, 0x0241 ; 0x800241 <_ZL14pause_position.lto_priv.481+0x2> 20e96: b0 91 42 02 lds r27, 0x0242 ; 0x800242 <_ZL14pause_position.lto_priv.481+0x3> 20e9a: 80 93 92 06 sts 0x0692, r24 ; 0x800692 20e9e: 90 93 93 06 sts 0x0693, r25 ; 0x800693 20ea2: a0 93 94 06 sts 0x0694, r26 ; 0x800694 20ea6: b0 93 95 06 sts 0x0695, r27 ; 0x800695 current_position[Y_AXIS] = pause_position[Y_AXIS]; 20eaa: 80 91 43 02 lds r24, 0x0243 ; 0x800243 <_ZL14pause_position.lto_priv.481+0x4> 20eae: 90 91 44 02 lds r25, 0x0244 ; 0x800244 <_ZL14pause_position.lto_priv.481+0x5> 20eb2: a0 91 45 02 lds r26, 0x0245 ; 0x800245 <_ZL14pause_position.lto_priv.481+0x6> 20eb6: b0 91 46 02 lds r27, 0x0246 ; 0x800246 <_ZL14pause_position.lto_priv.481+0x7> 20eba: 80 93 96 06 sts 0x0696, r24 ; 0x800696 20ebe: 90 93 97 06 sts 0x0697, r25 ; 0x800697 20ec2: a0 93 98 06 sts 0x0698, r26 ; 0x800698 20ec6: b0 93 99 06 sts 0x0699, r27 ; 0x800699 plan_buffer_line_curposXYZE(50); 20eca: 60 e0 ldi r22, 0x00 ; 0 20ecc: 70 e0 ldi r23, 0x00 ; 0 20ece: 88 e4 ldi r24, 0x48 ; 72 20ed0: 92 e4 ldi r25, 0x42 ; 66 20ed2: 0f 94 49 c0 call 0x38092 ; 0x38092 20ed6: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> } // did we come here from a thermal error? if(get_temp_error()) { 20eda: 88 23 and r24, r24 20edc: 09 f4 brne .+2 ; 0x20ee0 20ede: 7b c0 rjmp .+246 ; 0x20fd6 // time to stop the error beep WRITE(BEEPER, LOW); 20ee0: 9f b7 in r25, 0x3f ; 63 20ee2: f8 94 cli 20ee4: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 20ee8: 8b 7f andi r24, 0xFB ; 251 20eea: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 20eee: 9f bf out 0x3f, r25 ; 63 long_pause(); } } if (lcd_commands_type == LcdCommands::Layer1Cal) 20ef0: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 20ef4: 84 30 cpi r24, 0x04 ; 4 20ef6: 09 f0 breq .+2 ; 0x20efa 20ef8: ad c0 rjmp .+346 ; 0x21054 { const uint16_t nozzle_dia = eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM); 20efa: 85 ea ldi r24, 0xA5 ; 165 20efc: 9d e0 ldi r25, 0x0D ; 13 20efe: 0f 94 2a dc call 0x3b854 ; 0x3b854 20f02: 30 91 a5 0d lds r19, 0x0DA5 ; 0x800da5 20f06: 20 91 a6 0d lds r18, 0x0DA6 ; 0x800da6 const float extrusion_width = (nozzle_dia + 20)/1000.0f; const float layer_height = 0.2f; if (!blocks_queued() && cmd_buffer_empty() && !saved_printing) 20f0a: 32 13 cpse r19, r18 20f0c: 7c c1 rjmp .+760 ; 0x21206 20f0e: 20 91 a3 10 lds r18, 0x10A3 ; 0x8010a3 20f12: 30 91 a4 10 lds r19, 0x10A4 ; 0x8010a4 20f16: 23 2b or r18, r19 20f18: 09 f0 breq .+2 ; 0x20f1c 20f1a: 75 c1 rjmp .+746 ; 0x21206 20f1c: 20 91 a9 0d lds r18, 0x0DA9 ; 0x800da9 20f20: 29 83 std Y+1, r18 ; 0x01 20f22: 21 11 cpse r18, r1 20f24: 70 c1 rjmp .+736 ; 0x21206 { if (lcd_commands_step == 0) 20f26: 20 91 fb 03 lds r18, 0x03FB ; 0x8003fb 20f2a: 21 11 cpse r18, r1 20f2c: 57 c0 rjmp .+174 ; 0x20fdc lcd_commands_step = 12; 20f2e: 2c e0 ldi r18, 0x0C ; 12 else lcd_commands_step--; 20f30: 20 93 fb 03 sts 0x03FB, r18 ; 0x8003fb } 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; 20f34: 44 96 adiw r24, 0x14 ; 20 20f36: bc 01 movw r22, r24 20f38: 90 e0 ldi r25, 0x00 ; 0 20f3a: 80 e0 ldi r24, 0x00 ; 0 20f3c: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 20f40: 20 e0 ldi r18, 0x00 ; 0 20f42: 30 e0 ldi r19, 0x00 ; 0 20f44: 4a e7 ldi r20, 0x7A ; 122 20f46: 54 e4 ldi r21, 0x44 ; 68 20f48: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 20f4c: 6b 01 movw r12, r22 20f4e: 7c 01 movw r14, r24 if (lcd_commands_step == 0) lcd_commands_step = 12; else lcd_commands_step--; switch(lcd_commands_step) 20f50: e0 91 fb 03 lds r30, 0x03FB ; 0x8003fb 20f54: e1 50 subi r30, 0x01 ; 1 20f56: ec 30 cpi r30, 0x0C ; 12 20f58: 08 f0 brcs .+2 ; 0x20f5c 20f5a: 7c c0 rjmp .+248 ; 0x21054 20f5c: f0 e0 ldi r31, 0x00 ; 0 20f5e: 88 27 eor r24, r24 20f60: eb 54 subi r30, 0x4B ; 75 20f62: f8 4f sbci r31, 0xF8 ; 248 20f64: 8e 4f sbci r24, 0xFE ; 254 20f66: 0d 94 2c dd jmp 0x3ba58 ; 0x3ba58 <__tablejump2__> 20f6a: 02 3a cpi r16, 0xA2 ; 162 20f6c: 2e 3a cpi r18, 0xAE ; 174 20f6e: 3e 39 cpi r19, 0x9E ; 158 20f70: ce 39 cpi r28, 0x9E ; 158 20f72: 3e 3a cpi r19, 0xAE ; 174 20f74: ce 3a cpi r28, 0xAE ; 174 20f76: 90 39 cpi r25, 0x90 ; 144 20f78: f8 3a cpi r31, 0xA8 ; 168 20f7a: 46 39 cpi r20, 0x96 ; 150 20f7c: 12 3b cpi r17, 0xB2 ; 178 20f7e: 26 3a cpi r18, 0xA6 ; 166 20f80: 1a 3b cpi r17, 0xBA ; 186 if(get_temp_error()) { // time to stop the error beep WRITE(BEEPER, LOW); } else { // Turn off the print fan fanSpeed = 0; 20f82: 10 92 e7 03 sts 0x03E7, r1 ; 0x8003e7 { #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(); 20f86: 0e 94 e1 74 call 0xe9c2 ; 0xe9c2 setExtruderAutoFanState(1); 20f8a: 81 e0 ldi r24, 0x01 ; 1 20f8c: 0e 94 5b 75 call 0xeab6 ; 0xeab6 // restore the auto hotend state hotendDefaultAutoFanState(); if (MMU2::mmu2.Enabled() && MMU2::mmu2.FindaDetectsFilament() #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 20f90: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 20f94: 81 30 cpi r24, 0x01 ; 1 20f96: 09 f0 breq .+2 ; 0x20f9a 20f98: 33 cf rjmp .-410 ; 0x20e00 fanSpeed = 0; // restore the auto hotend state hotendDefaultAutoFanState(); if (MMU2::mmu2.Enabled() && MMU2::mmu2.FindaDetectsFilament() 20f9a: 80 91 90 13 lds r24, 0x1390 ; 0x801390 20f9e: 88 23 and r24, r24 20fa0: 09 f4 brne .+2 ; 0x20fa4 20fa2: 2e cf rjmp .-420 ; 0x20e00 #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 20fa4: 80 91 e6 03 lds r24, 0x03E6 ; 0x8003e6 20fa8: 82 30 cpi r24, 0x02 ; 2 20faa: 09 f4 brne .+2 ; 0x20fae 20fac: 29 cf rjmp .-430 ; 0x20e00 #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()) 20fae: 0e 94 85 67 call 0xcf0a ; 0xcf0a 20fb2: 81 11 cpse r24, r1 { // Restore temperature saved in ram after pausing print restore_extruder_temperature_from_ram(); 20fb4: 0e 94 c9 64 call 0xc992 ; 0xc992 } // 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) { 20fb8: 20 91 b6 0d lds r18, 0x0DB6 ; 0x800db6 20fbc: 30 91 b7 0d lds r19, 0x0DB7 ; 0x800db7 20fc0: 80 91 6b 02 lds r24, 0x026B ; 0x80026b 20fc4: 90 91 6c 02 lds r25, 0x026C ; 0x80026c 20fc8: 28 17 cp r18, r24 20fca: 39 07 cpc r19, r25 20fcc: 0c f4 brge .+2 ; 0x20fd0 20fce: 18 cf rjmp .-464 ; 0x20e00 MMU2::mmu2.unload(); // M702 20fd0: 0f 94 3d ad call 0x35a7a ; 0x35a7a 20fd4: 15 cf rjmp .-470 ; 0x20e00 } else { // Turn off the print fan fanSpeed = 0; 20fd6: 10 92 e7 03 sts 0x03E7, r1 ; 0x8003e7 20fda: 8a cf rjmp .-236 ; 0x20ef0 if (!blocks_queued() && cmd_buffer_empty() && !saved_printing) { if (lcd_commands_step == 0) lcd_commands_step = 12; else lcd_commands_step--; 20fdc: 21 50 subi r18, 0x01 ; 1 20fde: a8 cf rjmp .-176 ; 0x20f30 preheat_cmd_3, preheat_cmd_4, zero_extrusion }; lay1cal_common_enqueue_loop(preheat_cmd, sizeof(preheat_cmd)/sizeof(preheat_cmd[0])); 20fe0: 65 e0 ldi r22, 0x05 ; 5 20fe2: 8b e4 ldi r24, 0x4B ; 75 20fe4: 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]))); 20fe6: 0e 94 9f 88 call 0x1113e ; 0x1113e 20fea: 34 c0 rjmp .+104 ; 0x21054 //! @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()) 20fec: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 20ff0: 81 30 cpi r24, 0x01 ; 1 20ff2: 69 f5 brne .+90 ; 0x2104e { case 12: lay1cal_wait_preheat(); break; case 11: extraPurgeNeeded = lay1cal_load_filament(lay1cal_filament); 20ff4: 30 91 fa 03 lds r19, 0x03FA ; 0x8003fa 20ff8: 3b 83 std Y+3, r19 ; 0x03 { enquecommand_P(MSG_M83); 20ffa: 61 e0 ldi r22, 0x01 ; 1 20ffc: 80 ee ldi r24, 0xE0 ; 224 20ffe: 9b e6 ldi r25, 0x6B ; 107 21000: 0e 94 20 88 call 0x11040 ; 0x11040 enquecommand_P(PSTR("G1 Y-3 F1000")); 21004: 61 e0 ldi r22, 0x01 ; 1 21006: 8e e3 ldi r24, 0x3E ; 62 21008: 9b e8 ldi r25, 0x8B ; 139 2100a: 0e 94 20 88 call 0x11040 ; 0x11040 enquecommand_P(PSTR("G1 Z0.4 F1000")); 2100e: 61 e0 ldi r22, 0x01 ; 1 21010: 80 e3 ldi r24, 0x30 ; 48 21012: 9b e8 ldi r25, 0x8B ; 139 21014: 0e 94 20 88 call 0x11040 ; 0x11040 uint8_t currentTool = MMU2::mmu2.get_current_tool(); 21018: 0f 94 b9 74 call 0x2e972 ; 0x2e972 if(currentTool == filament ){ 2101c: 9b 81 ldd r25, Y+3 ; 0x03 2101e: 98 17 cp r25, r24 21020: b1 f0 breq .+44 ; 0x2104e // already have the correct tool loaded - do nothing return false; } else if( currentTool != (uint8_t)MMU2::FILAMENT_UNKNOWN){ 21022: 8f 3f cpi r24, 0xFF ; 255 21024: 29 f0 breq .+10 ; 0x21030 // some other slot is loaded, perform an unload first enquecommand_P(MSG_M702); 21026: 61 e0 ldi r22, 0x01 ; 1 21028: 8b ed ldi r24, 0xDB ; 219 2102a: 9b e6 ldi r25, 0x6B ; 107 2102c: 0e 94 20 88 call 0x11040 ; 0x11040 } // perform a toolchange enquecommandf_P(PSTR("T%d"), filament); 21030: 1f 92 push r1 21032: 2b 81 ldd r18, Y+3 ; 0x03 21034: 2f 93 push r18 21036: 8c e2 ldi r24, 0x2C ; 44 21038: 9b e8 ldi r25, 0x8B ; 139 2103a: 9f 93 push r25 2103c: 8f 93 push r24 2103e: 0e 94 b6 88 call 0x1116c ; 0x1116c 21042: 0f 90 pop r0 21044: 0f 90 pop r0 21046: 0f 90 pop r0 21048: 0f 90 pop r0 return true; 2104a: 31 e0 ldi r19, 0x01 ; 1 2104c: 39 83 std Y+1, r19 ; 0x01 2104e: 89 81 ldd r24, Y+1 ; 0x01 21050: 80 93 f9 03 sts 0x03F9, r24 ; 0x8003f9 break; } } } if (lcd_commands_type == LcdCommands::PidExtruder) { 21054: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 21058: 83 30 cpi r24, 0x03 ; 3 2105a: 09 f0 breq .+2 ; 0x2105e 2105c: d4 c0 rjmp .+424 ; 0x21206 if (lcd_commands_step == 0) { 2105e: 90 91 fb 03 lds r25, 0x03FB ; 0x8003fb 21062: 91 11 cpse r25, r1 21064: 09 c0 rjmp .+18 ; 0x21078 custom_message_type = CustomMsg::PidCal; 21066: 80 93 c4 06 sts 0x06C4, r24 ; 0x8006c4 custom_message_state = 1; 2106a: 91 e0 ldi r25, 0x01 ; 1 2106c: 90 93 f7 03 sts 0x03F7, r25 ; 0x8003f7 lcd_draw_update = 3; 21070: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d lcd_commands_step = 3; 21074: 80 93 fb 03 sts 0x03FB, r24 ; 0x8003fb } if (lcd_commands_step == 3 && !blocks_queued()) { //PID calibration 21078: 80 91 fb 03 lds r24, 0x03FB ; 0x8003fb 2107c: 83 30 cpi r24, 0x03 ; 3 2107e: 19 f5 brne .+70 ; 0x210c6 21080: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 21084: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 21088: 98 13 cpse r25, r24 2108a: 1d c0 rjmp .+58 ; 0x210c6 return !pid_tuning_finished; } void preparePidTuning() { // ensure heaters are disabled before we switch off PID management! disable_heater(); 2108c: 0f 94 18 2f call 0x25e30 ; 0x25e30 pid_tuning_finished = false; 21090: 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); 21094: 80 91 4c 02 lds r24, 0x024C ; 0x80024c <_ZL8pid_temp.lto_priv.441+0x1> 21098: 8f 93 push r24 2109a: 80 91 4b 02 lds r24, 0x024B ; 0x80024b <_ZL8pid_temp.lto_priv.441> 2109e: 8f 93 push r24 210a0: 86 ed ldi r24, 0xD6 ; 214 210a2: 9b e8 ldi r25, 0x8B ; 139 210a4: 9f 93 push r25 210a6: 8f 93 push r24 210a8: 0e 94 b6 88 call 0x1116c ; 0x1116c lcd_setstatuspgm(_T(MSG_PID_RUNNING)); 210ac: 84 e2 ldi r24, 0x24 ; 36 210ae: 9a e4 ldi r25, 0x4A ; 74 210b0: 0e 94 ac 72 call 0xe558 ; 0xe558 210b4: 0e 94 5d f1 call 0x1e2ba ; 0x1e2ba lcd_commands_step = 2; 210b8: 82 e0 ldi r24, 0x02 ; 2 210ba: 80 93 fb 03 sts 0x03FB, r24 ; 0x8003fb 210be: 0f 90 pop r0 210c0: 0f 90 pop r0 210c2: 0f 90 pop r0 210c4: 0f 90 pop r0 } if (lcd_commands_step == 2 && !pidTuningRunning()) { //saving to eeprom 210c6: 80 91 fb 03 lds r24, 0x03FB ; 0x8003fb 210ca: 82 30 cpi r24, 0x02 ; 2 210cc: 09 f0 breq .+2 ; 0x210d0 210ce: 7c c0 rjmp .+248 ; 0x211c8 210d0: 80 91 3e 02 lds r24, 0x023E ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.458> 210d4: 88 23 and r24, r24 210d6: 09 f4 brne .+2 ; 0x210da 210d8: 77 c0 rjmp .+238 ; 0x211c8 custom_message_state = 0; 210da: 10 92 f7 03 sts 0x03F7, r1 ; 0x8003f7 lcd_setstatuspgm(_T(MSG_PID_FINISHED)); 210de: 80 e1 ldi r24, 0x10 ; 16 210e0: 9a e4 ldi r25, 0x4A ; 74 210e2: 0e 94 ac 72 call 0xe558 ; 0xe558 210e6: 0e 94 5d f1 call 0x1e2ba ; 0x1e2ba 210ea: 10 92 b7 0d sts 0x0DB7, r1 ; 0x800db7 210ee: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 setTargetHotend(0); if (_Kp != 0 || _Ki != 0 || _Kd != 0) { 210f2: 30 91 f3 03 lds r19, 0x03F3 ; 0x8003f3 <_Kp> 210f6: 39 83 std Y+1, r19 ; 0x01 210f8: 80 91 f4 03 lds r24, 0x03F4 ; 0x8003f4 <_Kp+0x1> 210fc: 8b 83 std Y+3, r24 ; 0x03 210fe: 10 91 f5 03 lds r17, 0x03F5 ; 0x8003f5 <_Kp+0x2> 21102: 00 91 f6 03 lds r16, 0x03F6 ; 0x8003f6 <_Kp+0x3> 21106: 20 e0 ldi r18, 0x00 ; 0 21108: 30 e0 ldi r19, 0x00 ; 0 2110a: a9 01 movw r20, r18 2110c: b9 81 ldd r27, Y+1 ; 0x01 2110e: f8 01 movw r30, r16 21110: 6b 2f mov r22, r27 21112: 78 2f mov r23, r24 21114: 8f 2f mov r24, r31 21116: 9e 2f mov r25, r30 21118: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 2111c: 81 11 cpse r24, r1 2111e: 1f c0 rjmp .+62 ; 0x2115e 21120: 20 e0 ldi r18, 0x00 ; 0 21122: 30 e0 ldi r19, 0x00 ; 0 21124: a9 01 movw r20, r18 21126: 60 91 ef 03 lds r22, 0x03EF ; 0x8003ef <_Ki> 2112a: 70 91 f0 03 lds r23, 0x03F0 ; 0x8003f0 <_Ki+0x1> 2112e: 80 91 f1 03 lds r24, 0x03F1 ; 0x8003f1 <_Ki+0x2> 21132: 90 91 f2 03 lds r25, 0x03F2 ; 0x8003f2 <_Ki+0x3> 21136: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 2113a: 81 11 cpse r24, r1 2113c: 10 c0 rjmp .+32 ; 0x2115e 2113e: 20 e0 ldi r18, 0x00 ; 0 21140: 30 e0 ldi r19, 0x00 ; 0 21142: a9 01 movw r20, r18 21144: 60 91 eb 03 lds r22, 0x03EB ; 0x8003eb <_Kd> 21148: 70 91 ec 03 lds r23, 0x03EC ; 0x8003ec <_Kd+0x1> 2114c: 80 91 ed 03 lds r24, 0x03ED ; 0x8003ed <_Kd+0x2> 21150: 90 91 ee 03 lds r25, 0x03EE ; 0x8003ee <_Kd+0x3> 21154: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 21158: 88 23 and r24, r24 2115a: 09 f4 brne .+2 ; 0x2115e 2115c: 5a c2 rjmp .+1204 ; 0x21612 enquecommandf_P(PSTR("M301 P%.2f I%.2f D%.2f"), _Kp, _Ki, _Kd); 2115e: 80 91 ee 03 lds r24, 0x03EE ; 0x8003ee <_Kd+0x3> 21162: 8f 93 push r24 21164: 80 91 ed 03 lds r24, 0x03ED ; 0x8003ed <_Kd+0x2> 21168: 8f 93 push r24 2116a: 80 91 ec 03 lds r24, 0x03EC ; 0x8003ec <_Kd+0x1> 2116e: 8f 93 push r24 21170: 80 91 eb 03 lds r24, 0x03EB ; 0x8003eb <_Kd> 21174: 8f 93 push r24 21176: 80 91 f2 03 lds r24, 0x03F2 ; 0x8003f2 <_Ki+0x3> 2117a: 8f 93 push r24 2117c: 80 91 f1 03 lds r24, 0x03F1 ; 0x8003f1 <_Ki+0x2> 21180: 8f 93 push r24 21182: 80 91 f0 03 lds r24, 0x03F0 ; 0x8003f0 <_Ki+0x1> 21186: 8f 93 push r24 21188: 80 91 ef 03 lds r24, 0x03EF ; 0x8003ef <_Ki> 2118c: 8f 93 push r24 2118e: 0f 93 push r16 21190: 1f 93 push r17 21192: 9b 81 ldd r25, Y+3 ; 0x03 21194: 9f 93 push r25 21196: 29 81 ldd r18, Y+1 ; 0x01 21198: 2f 93 push r18 2119a: 8f eb ldi r24, 0xBF ; 191 2119c: 9b e8 ldi r25, 0x8B ; 139 2119e: 9f 93 push r25 211a0: 8f 93 push r24 211a2: 0e 94 b6 88 call 0x1116c ; 0x1116c enquecommand_P(MSG_M500); 211a6: 61 e0 ldi r22, 0x01 ; 1 211a8: 8a ee ldi r24, 0xEA ; 234 211aa: 9b e6 ldi r25, 0x6B ; 107 211ac: 0e 94 20 88 call 0x11040 ; 0x11040 211b0: 0f b6 in r0, 0x3f ; 63 211b2: f8 94 cli 211b4: de bf out 0x3e, r29 ; 62 211b6: 0f be out 0x3f, r0 ; 63 211b8: cd bf out 0x3d, r28 ; 61 } else { SERIAL_ECHOPGM("Invalid PID cal. results. Not stored to EEPROM."); } display_time.start(); 211ba: 88 ee ldi r24, 0xE8 ; 232 211bc: 93 e0 ldi r25, 0x03 ; 3 211be: 0f 94 ad 29 call 0x2535a ; 0x2535a ::start()> lcd_commands_step = 1; 211c2: 81 e0 ldi r24, 0x01 ; 1 211c4: 80 93 fb 03 sts 0x03FB, r24 ; 0x8003fb } if ((lcd_commands_step == 1) && display_time.expired(2000)) { //calibration finished message 211c8: 80 91 fb 03 lds r24, 0x03FB ; 0x8003fb 211cc: 81 30 cpi r24, 0x01 ; 1 211ce: d9 f4 brne .+54 ; 0x21206 211d0: 60 ed ldi r22, 0xD0 ; 208 211d2: 77 e0 ldi r23, 0x07 ; 7 211d4: 88 ee ldi r24, 0xE8 ; 232 211d6: 93 e0 ldi r25, 0x03 ; 3 211d8: 0f 94 7e 29 call 0x252fc ; 0x252fc ::expired(unsigned short)> 211dc: 88 23 and r24, r24 211de: 99 f0 breq .+38 ; 0x21206 lcd_setstatuspgm(MSG_WELCOME); 211e0: 83 e7 ldi r24, 0x73 ; 115 211e2: 90 e7 ldi r25, 0x70 ; 112 211e4: 0e 94 5d f1 call 0x1e2ba ; 0x1e2ba custom_message_type = CustomMsg::Status; 211e8: 10 92 c4 06 sts 0x06C4, r1 ; 0x8006c4 pid_temp = DEFAULT_PID_TEMP; 211ec: 82 ed ldi r24, 0xD2 ; 210 211ee: 90 e0 ldi r25, 0x00 ; 0 211f0: 90 93 4c 02 sts 0x024C, r25 ; 0x80024c <_ZL8pid_temp.lto_priv.441+0x1> 211f4: 80 93 4b 02 sts 0x024B, r24 ; 0x80024b <_ZL8pid_temp.lto_priv.441> lcd_commands_step = 0; 211f8: 10 92 fb 03 sts 0x03FB, r1 ; 0x8003fb lcd_commands_type = LcdCommands::Idle; 211fc: 10 92 b4 0d sts 0x0DB4, r1 ; 0x800db4 21200: 82 e0 ldi r24, 0x02 ; 2 21202: 80 93 b8 0d sts 0x0DB8, r24 ; 0x800db8 <_ZL13printer_state.lto_priv.401> SetPrinterState(PrinterState::Idle); } } #ifdef THERMAL_MODEL if (lcd_commands_type == LcdCommands::ThermalModel && cmd_buffer_empty()) 21206: 90 91 b4 0d lds r25, 0x0DB4 ; 0x800db4 2120a: 95 30 cpi r25, 0x05 ; 5 2120c: a1 f4 brne .+40 ; 0x21236 2120e: 20 91 a3 10 lds r18, 0x10A3 ; 0x8010a3 21212: 30 91 a4 10 lds r19, 0x10A4 ; 0x8010a4 21216: 23 2b or r18, r19 21218: 09 f0 breq .+2 ; 0x2121c 2121a: 4b c2 rjmp .+1174 ; 0x216b2 { switch (lcd_commands_step) 2121c: 80 91 fb 03 lds r24, 0x03FB ; 0x8003fb 21220: 82 30 cpi r24, 0x02 ; 2 21222: 09 f4 brne .+2 ; 0x21226 21224: 1f c2 rjmp .+1086 ; 0x21664 21226: 08 f0 brcs .+2 ; 0x2122a 21228: f9 c1 rjmp .+1010 ; 0x2161c 2122a: 88 23 and r24, r24 2122c: 09 f4 brne .+2 ; 0x21230 2122e: 0a c2 rjmp .+1044 ; 0x21644 21230: 81 30 cpi r24, 0x01 ; 1 21232: 09 f4 brne .+2 ; 0x21236 21234: 22 c2 rjmp .+1092 ; 0x2167a break; } } #endif //THERMAL_MODEL if (lcd_commands_type == LcdCommands::NozzleCNG) 21236: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 2123a: 86 30 cpi r24, 0x06 ; 6 2123c: 09 f0 breq .+2 ; 0x21240 2123e: 39 c2 rjmp .+1138 ; 0x216b2 21240: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 21244: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 { if (!blocks_queued() && cmd_buffer_empty() && !saved_printing) 21248: 98 13 cpse r25, r24 2124a: 33 c2 rjmp .+1126 ; 0x216b2 2124c: 80 91 a3 10 lds r24, 0x10A3 ; 0x8010a3 21250: 90 91 a4 10 lds r25, 0x10A4 ; 0x8010a4 21254: 89 2b or r24, r25 21256: 09 f0 breq .+2 ; 0x2125a 21258: 2c c2 rjmp .+1112 ; 0x216b2 2125a: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 2125e: 81 11 cpse r24, r1 21260: 28 c2 rjmp .+1104 ; 0x216b2 #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) 21262: 80 91 fb 03 lds r24, 0x03FB ; 0x8003fb 21266: 81 30 cpi r24, 0x01 ; 1 21268: 09 f4 brne .+2 ; 0x2126c 2126a: 4e c2 rjmp .+1180 ; 0x21708 2126c: 08 f4 brcc .+2 ; 0x21270 2126e: 1e c2 rjmp .+1084 ; 0x216ac 21270: 82 30 cpi r24, 0x02 ; 2 21272: 09 f4 brne .+2 ; 0x21276 21274: 36 c2 rjmp .+1132 ; 0x216e2 21276: 83 30 cpi r24, 0x03 ; 3 21278: 09 f0 breq .+2 ; 0x2127c 2127a: 1b c2 rjmp .+1078 ; 0x216b2 #ifdef THERMAL_MODEL was_enabled = thermal_model_enabled(); thermal_model_set_enabled(false); #endif //THERMAL_MODEL #else //nozzle change without heating while((int)degHotend(active_extruder)>40) { //check temp 2127c: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 21280: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 21284: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 21288: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 2128c: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> 21290: 69 32 cpi r22, 0x29 ; 41 21292: 71 05 cpc r23, r1 21294: 7c f0 brlt .+30 ; 0x212b4 fanSpeed = 255; //turn on fan 21296: 9f ef ldi r25, 0xFF ; 255 21298: 90 93 e7 03 sts 0x03E7, r25 ; 0x8003e7 disable_heater(); 2129c: 0f 94 18 2f call 0x25e30 ; 0x25e30 uint8_t choice = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_NOZZLE_CNG_COOLDOWN), true, LCD_LEFT_BUTTON_CHOICE); 212a0: 8c ee ldi r24, 0xEC ; 236 212a2: 99 e4 ldi r25, 0x49 ; 73 212a4: 0e 94 ac 72 call 0xe558 ; 0xe558 212a8: 40 e0 ldi r20, 0x00 ; 0 212aa: 61 e0 ldi r22, 0x01 ; 1 212ac: 0f 94 40 4f call 0x29e80 ; 0x29e80 if (choice == LCD_MIDDLE_BUTTON_CHOICE) { 212b0: 81 30 cpi r24, 0x01 ; 1 212b2: 21 f7 brne .-56 ; 0x2127c break; } } enquecommand_P(G28W); //home 212b4: 61 e0 ldi r22, 0x01 ; 1 212b6: 84 ee ldi r24, 0xE4 ; 228 212b8: 9b e6 ldi r25, 0x6B ; 107 212ba: 0e 94 20 88 call 0x11040 ; 0x11040 enquecommand_P(PSTR("G1 X125 Z200 F1000")); //move to top center 212be: 61 e0 ldi r22, 0x01 ; 1 212c0: 8c e5 ldi r24, 0x5C ; 92 212c2: 9b e8 ldi r25, 0x8B ; 139 212c4: 0e 94 20 88 call 0x11040 ; 0x11040 #endif //QUICK_NOZZLE_CHANGE lcd_commands_step = 2; 212c8: 82 e0 ldi r24, 0x02 ; 2 212ca: f1 c1 rjmp .+994 ; 0x216ae break; case 11: extraPurgeNeeded = lay1cal_load_filament(lay1cal_filament); break; case 10: lcd_clear(); 212cc: 0e 94 13 6f call 0xde26 ; 0xde26 menu_depth = 0; 212d0: 10 92 f8 03 sts 0x03F8, r1 ; 0x8003f8 menu_submenu(lcd_babystep_z, true); 212d4: 61 e0 ldi r22, 0x01 ; 1 212d6: 86 ee ldi r24, 0xE6 ; 230 212d8: 99 e3 ldi r25, 0x39 ; 57 212da: 0f 94 03 d3 call 0x3a606 ; 0x3a606 cmd_intro_mmu_10, cmd_intro_mmu_11, cmd_intro_mmu_12, }; if (MMU2::mmu2.Enabled()) 212de: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 212e2: 81 30 cpi r24, 0x01 ; 1 212e4: f1 f4 brne .+60 ; 0x21322 { for (uint8_t i = (extraPurgeNeeded ? 0 : 2); i < (sizeof(intro_mmu_cmd)/sizeof(intro_mmu_cmd[0])); ++i) 212e6: 80 91 f9 03 lds r24, 0x03F9 ; 0x8003f9 212ea: 10 e0 ldi r17, 0x00 ; 0 212ec: 81 11 cpse r24, r1 212ee: 01 c0 rjmp .+2 ; 0x212f2 212f0: 12 e0 ldi r17, 0x02 ; 2 212f2: 21 2f mov r18, r17 212f4: 30 e0 ldi r19, 0x00 ; 0 212f6: 22 0f add r18, r18 212f8: 33 1f adc r19, r19 212fa: 28 5e subi r18, 0xE8 ; 232 212fc: 34 47 sbci r19, 0x74 ; 116 212fe: 3a 83 std Y+2, r19 ; 0x02 21300: 29 83 std Y+1, r18 ; 0x01 { enquecommand_P(static_cast(pgm_read_ptr(&intro_mmu_cmd[i]))); 21302: e9 81 ldd r30, Y+1 ; 0x01 21304: fa 81 ldd r31, Y+2 ; 0x02 21306: 85 91 lpm r24, Z+ 21308: 94 91 lpm r25, Z 2130a: 61 e0 ldi r22, 0x01 ; 1 2130c: 0e 94 20 88 call 0x11040 ; 0x11040 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) 21310: 1f 5f subi r17, 0xFF ; 255 21312: 89 81 ldd r24, Y+1 ; 0x01 21314: 9a 81 ldd r25, Y+2 ; 0x02 21316: 02 96 adiw r24, 0x02 ; 2 21318: 9a 83 std Y+2, r25 ; 0x02 2131a: 89 83 std Y+1, r24 ; 0x01 2131c: 1a 30 cpi r17, 0x0A ; 10 2131e: 89 f7 brne .-30 ; 0x21302 21320: 99 ce rjmp .-718 ; 0x21054 } } 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)); 21322: 20 e0 ldi r18, 0x00 ; 0 21324: 30 e0 ldi r19, 0x00 ; 0 21326: 40 e8 ldi r20, 0x80 ; 128 21328: 50 e4 ldi r21, 0x40 ; 64 2132a: c7 01 movw r24, r14 2132c: b6 01 movw r22, r12 2132e: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 21332: 20 e0 ldi r18, 0x00 ; 0 21334: 30 e0 ldi r19, 0x00 ; 0 21336: 40 e7 ldi r20, 0x70 ; 112 21338: 52 e4 ldi r21, 0x42 ; 66 2133a: 0f 94 c1 86 call 0x30d82 ; 0x30d82 2133e: 9f 93 push r25 21340: 8f 93 push r24 21342: 7f 93 push r23 21344: 6f 93 push r22 21346: 1f 92 push r1 21348: 8c e3 ldi r24, 0x3C ; 60 2134a: 8f 93 push r24 2134c: 24 e0 ldi r18, 0x04 ; 4 2134e: 3b e8 ldi r19, 0x8B ; 139 21350: 3f 93 push r19 21352: 2f 93 push r18 21354: 0e 94 b6 88 call 0x1116c ; 0x1116c enquecommandf_P(fmt1, 100, count_e(layer_height, extrusion_width * 8.f, 40)); 21358: 20 e0 ldi r18, 0x00 ; 0 2135a: 30 e0 ldi r19, 0x00 ; 0 2135c: 40 e0 ldi r20, 0x00 ; 0 2135e: 51 e4 ldi r21, 0x41 ; 65 21360: c7 01 movw r24, r14 21362: b6 01 movw r22, r12 21364: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 21368: 20 e0 ldi r18, 0x00 ; 0 2136a: 30 e0 ldi r19, 0x00 ; 0 2136c: 40 e2 ldi r20, 0x20 ; 32 2136e: 52 e4 ldi r21, 0x42 ; 66 21370: 0f 94 c1 86 call 0x30d82 ; 0x30d82 21374: 9f 93 push r25 21376: 8f 93 push r24 21378: 7f 93 push r23 2137a: 6f 93 push r22 2137c: 1f 92 push r1 2137e: 84 e6 ldi r24, 0x64 ; 100 21380: 8f 93 push r24 21382: 24 e0 ldi r18, 0x04 ; 4 21384: 3b e8 ldi r19, 0x8B ; 139 21386: 3f 93 push r19 21388: 2f 93 push r18 2138a: 0e 94 b6 88 call 0x1116c ; 0x1116c 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)); 2138e: 0f b6 in r0, 0x3f ; 63 21390: f8 94 cli 21392: de bf out 0x3e, r29 ; 62 21394: 0f be out 0x3f, r0 ; 63 21396: cd bf out 0x3d, r28 ; 61 21398: 5d ce rjmp .-838 ; 0x21054 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]))); 2139a: 67 e0 ldi r22, 0x07 ; 7 2139c: 86 ef ldi r24, 0xF6 ; 246 2139e: 9a e8 ldi r25, 0x8A ; 138 213a0: 22 ce rjmp .-956 ; 0x20fe6 } //! @brief Print meander start void lay1cal_meander_start(float layer_height, float extrusion_width) { enquecommand_P(PSTR("G1 X50 Y155")); 213a2: 61 e0 ldi r22, 0x01 ; 1 213a4: 8a ee ldi r24, 0xEA ; 234 213a6: 9a e8 ldi r25, 0x8A ; 138 213a8: 0e 94 20 88 call 0x11040 ; 0x11040 static const char fmt1[] PROGMEM = "G1 Z%-.3f F7200"; enquecommandf_P(fmt1, layer_height); 213ac: 8e e3 ldi r24, 0x3E ; 62 213ae: 8f 93 push r24 213b0: 8c e4 ldi r24, 0x4C ; 76 213b2: 8f 93 push r24 213b4: 8c ec ldi r24, 0xCC ; 204 213b6: 8f 93 push r24 213b8: 8d ec ldi r24, 0xCD ; 205 213ba: 8f 93 push r24 213bc: 8a ed ldi r24, 0xDA ; 218 213be: 9a e8 ldi r25, 0x8A ; 138 213c0: 9f 93 push r25 213c2: 8f 93 push r24 213c4: 0e 94 b6 88 call 0x1116c ; 0x1116c enquecommand_P(PSTR("G1 F1080")); 213c8: 61 e0 ldi r22, 0x01 ; 1 213ca: 81 ed ldi r24, 0xD1 ; 209 213cc: 9a e8 ldi r25, 0x8A ; 138 213ce: 0e 94 20 88 call 0x11040 ; 0x11040 enquecommandf_P(extrude_fmt, 75, 155, count_e(layer_height, extrusion_width * 4.f, 25)); 213d2: 20 e0 ldi r18, 0x00 ; 0 213d4: 30 e0 ldi r19, 0x00 ; 0 213d6: 40 e8 ldi r20, 0x80 ; 128 213d8: 50 e4 ldi r21, 0x40 ; 64 213da: c7 01 movw r24, r14 213dc: b6 01 movw r22, r12 213de: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 213e2: 20 e0 ldi r18, 0x00 ; 0 213e4: 30 e0 ldi r19, 0x00 ; 0 213e6: 48 ec ldi r20, 0xC8 ; 200 213e8: 51 e4 ldi r21, 0x41 ; 65 213ea: 0f 94 c1 86 call 0x30d82 ; 0x30d82 213ee: 9f 93 push r25 213f0: 8f 93 push r24 213f2: 7f 93 push r23 213f4: 6f 93 push r22 213f6: 1f 92 push r1 213f8: 1b e9 ldi r17, 0x9B ; 155 213fa: 1f 93 push r17 213fc: 1f 92 push r1 213fe: 8b e4 ldi r24, 0x4B ; 75 21400: 8f 93 push r24 21402: 8f eb ldi r24, 0xBF ; 191 21404: 9a e8 ldi r25, 0x8A ; 138 21406: 9f 93 push r25 21408: 8f 93 push r24 2140a: 0e 94 b6 88 call 0x1116c ; 0x1116c enquecommandf_P(extrude_fmt, 100, 155, count_e(layer_height, extrusion_width * 2.f, 25)); 2140e: a7 01 movw r20, r14 21410: 96 01 movw r18, r12 21412: c7 01 movw r24, r14 21414: b6 01 movw r22, r12 21416: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 2141a: 20 e0 ldi r18, 0x00 ; 0 2141c: 30 e0 ldi r19, 0x00 ; 0 2141e: 48 ec ldi r20, 0xC8 ; 200 21420: 51 e4 ldi r21, 0x41 ; 65 21422: 0f 94 c1 86 call 0x30d82 ; 0x30d82 21426: 9f 93 push r25 21428: 8f 93 push r24 2142a: 7f 93 push r23 2142c: 6f 93 push r22 2142e: 1f 92 push r1 21430: 1f 93 push r17 21432: 1f 92 push r1 21434: 84 e6 ldi r24, 0x64 ; 100 21436: 8f 93 push r24 21438: 8f eb ldi r24, 0xBF ; 191 2143a: 9a e8 ldi r25, 0x8A ; 138 2143c: 9f 93 push r25 2143e: 8f 93 push r24 21440: 0e 94 b6 88 call 0x1116c ; 0x1116c enquecommandf_P(extrude_fmt, 200, 155, count_e(layer_height, extrusion_width, 100)); 21444: 20 e0 ldi r18, 0x00 ; 0 21446: 30 e0 ldi r19, 0x00 ; 0 21448: 48 ec ldi r20, 0xC8 ; 200 2144a: 52 e4 ldi r21, 0x42 ; 66 2144c: c7 01 movw r24, r14 2144e: b6 01 movw r22, r12 21450: 0f 94 c1 86 call 0x30d82 ; 0x30d82 21454: 9f 93 push r25 21456: 8f 93 push r24 21458: 7f 93 push r23 2145a: 6f 93 push r22 2145c: 1f 92 push r1 2145e: 1f 93 push r17 21460: 1f 92 push r1 21462: 18 ec ldi r17, 0xC8 ; 200 21464: 1f 93 push r17 21466: 8f eb ldi r24, 0xBF ; 191 21468: 9a e8 ldi r25, 0x8A ; 138 2146a: 9f 93 push r25 2146c: 8f 93 push r24 2146e: 0e 94 b6 88 call 0x1116c ; 0x1116c enquecommandf_P(extrude_fmt, 200, 135, count_e(layer_height, extrusion_width, 20)); 21472: 0f b6 in r0, 0x3f ; 63 21474: f8 94 cli 21476: de bf out 0x3e, r29 ; 62 21478: 0f be out 0x3f, r0 ; 63 2147a: cd bf out 0x3d, r28 ; 61 2147c: 20 e0 ldi r18, 0x00 ; 0 2147e: 30 e0 ldi r19, 0x00 ; 0 21480: 40 ea ldi r20, 0xA0 ; 160 21482: 51 e4 ldi r21, 0x41 ; 65 21484: c7 01 movw r24, r14 21486: b6 01 movw r22, r12 21488: 0f 94 c1 86 call 0x30d82 ; 0x30d82 2148c: 9f 93 push r25 2148e: 8f 93 push r24 21490: 7f 93 push r23 21492: 6f 93 push r22 21494: 1f 92 push r1 21496: 87 e8 ldi r24, 0x87 ; 135 21498: 8f 93 push r24 2149a: 1f 92 push r1 2149c: 1f 93 push r17 2149e: 2f eb ldi r18, 0xBF ; 191 214a0: 3a e8 ldi r19, 0x8A ; 138 214a2: 3f 93 push r19 214a4: 2f 93 push r18 214a6: 0e 94 b6 88 call 0x1116c ; 0x1116c 214aa: 71 cf rjmp .-286 ; 0x2138e //! @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); 214ac: 20 e0 ldi r18, 0x00 ; 0 214ae: 30 e0 ldi r19, 0x00 ; 0 214b0: 46 e1 ldi r20, 0x16 ; 22 214b2: 53 e4 ldi r21, 0x43 ; 67 214b4: c7 01 movw r24, r14 214b6: b6 01 movw r22, r12 214b8: 0f 94 c1 86 call 0x30d82 ; 0x30d82 214bc: 56 2e mov r5, r22 214be: 47 2e mov r4, r23 214c0: 38 2e mov r3, r24 214c2: 29 2e mov r2, r25 const float short_extrusion = count_e(layer_height, extrusion_width, short_length); 214c4: 20 e0 ldi r18, 0x00 ; 0 214c6: 30 e0 ldi r19, 0x00 ; 0 214c8: 40 ea ldi r20, 0xA0 ; 160 214ca: 51 e4 ldi r21, 0x41 ; 65 214cc: c7 01 movw r24, r14 214ce: b6 01 movw r22, r12 214d0: 0f 94 c1 86 call 0x30d82 ; 0x30d82 214d4: 6b 83 std Y+3, r22 ; 0x03 214d6: c7 2e mov r12, r23 214d8: 78 2e mov r7, r24 214da: 69 2e mov r6, r25 214dc: 85 e0 ldi r24, 0x05 ; 5 214de: 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; 214e0: 81 2c mov r8, r1 214e2: 91 2c mov r9, r1 214e4: 96 e1 ldi r25, 0x16 ; 22 214e6: a9 2e mov r10, r25 214e8: 93 e4 ldi r25, 0x43 ; 67 214ea: 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; 214ec: 32 e3 ldi r19, 0x32 ; 50 214ee: 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; 214f0: 87 e8 ldi r24, 0x87 ; 135 214f2: 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); 214f4: 0f eb ldi r16, 0xBF ; 191 214f6: 1a e8 ldi r17, 0x8A ; 138 214f8: 9d 81 ldd r25, Y+5 ; 0x05 214fa: e9 2e mov r14, r25 214fc: f1 2c mov r15, r1 214fe: 3c 81 ldd r19, Y+4 ; 0x04 21500: 23 2f mov r18, r19 21502: 30 e0 ldi r19, 0x00 ; 0 21504: 3a 83 std Y+2, r19 ; 0x02 21506: 29 83 std Y+1, r18 ; 0x01 21508: 2f 92 push r2 2150a: 3f 92 push r3 2150c: 4f 92 push r4 2150e: 5f 92 push r5 21510: 1f 92 push r1 21512: 9f 93 push r25 21514: 1f 92 push r1 21516: 8c 81 ldd r24, Y+4 ; 0x04 21518: 8f 93 push r24 2151a: 1f 93 push r17 2151c: 0f 93 push r16 2151e: 0e 94 b6 88 call 0x1116c ; 0x1116c y_pos -= short_length; 21522: b7 01 movw r22, r14 21524: ff 0c add r15, r15 21526: 88 0b sbc r24, r24 21528: 99 0b sbc r25, r25 2152a: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 2152e: 20 e0 ldi r18, 0x00 ; 0 21530: 30 e0 ldi r19, 0x00 ; 0 21532: 40 ea ldi r20, 0xA0 ; 160 21534: 51 e4 ldi r21, 0x41 ; 65 21536: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 2153a: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 2153e: 6d 83 std Y+5, r22 ; 0x05 enquecommandf_P(extrude_fmt, x_pos, y_pos, short_extrusion); 21540: 6f 92 push r6 21542: 7f 92 push r7 21544: cf 92 push r12 21546: 9b 81 ldd r25, Y+3 ; 0x03 21548: 9f 93 push r25 2154a: 1f 92 push r1 2154c: 2d 81 ldd r18, Y+5 ; 0x05 2154e: 2f 93 push r18 21550: 1f 92 push r1 21552: 3c 81 ldd r19, Y+4 ; 0x04 21554: 3f 93 push r19 21556: 1f 93 push r17 21558: 0f 93 push r16 2155a: 0e 94 b6 88 call 0x1116c ; 0x1116c x_pos += long_length; 2155e: 29 81 ldd r18, Y+1 ; 0x01 21560: 3a 81 ldd r19, Y+2 ; 0x02 21562: b9 01 movw r22, r18 21564: 33 0f add r19, r19 21566: 88 0b sbc r24, r24 21568: 99 0b sbc r25, r25 2156a: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 2156e: a5 01 movw r20, r10 21570: 94 01 movw r18, r8 21572: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 21576: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 2157a: 6c 83 std Y+4, r22 ; 0x04 long_length = -long_length; 2157c: b7 fa bst r11, 7 2157e: b0 94 com r11 21580: b7 f8 bld r11, 7 21582: b0 94 com r11 21584: 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) 21586: 0f b6 in r0, 0x3f ; 63 21588: f8 94 cli 2158a: de bf out 0x3e, r29 ; 62 2158c: 0f be out 0x3f, r0 ; 63 2158e: cd bf out 0x3d, r28 ; 61 21590: d1 10 cpse r13, r1 21592: b2 cf rjmp .-156 ; 0x214f8 21594: 5f cd rjmp .-1346 ; 0x21054 break; case 7: lay1cal_meander(layer_height, extrusion_width); break; case 6: lay1cal_square(0, layer_height, extrusion_width); 21596: b7 01 movw r22, r14 21598: a6 01 movw r20, r12 2159a: 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); 2159c: 0f 94 e8 86 call 0x30dd0 ; 0x30dd0 215a0: 59 cd rjmp .-1358 ; 0x21054 break; case 6: lay1cal_square(0, layer_height, extrusion_width); break; case 5: lay1cal_square(4, layer_height, extrusion_width); 215a2: b7 01 movw r22, r14 215a4: a6 01 movw r20, r12 215a6: 84 e0 ldi r24, 0x04 ; 4 215a8: f9 cf rjmp .-14 ; 0x2159c break; case 4: lay1cal_square(8, layer_height, extrusion_width); 215aa: b7 01 movw r22, r14 215ac: a6 01 movw r20, r12 215ae: 88 e0 ldi r24, 0x08 ; 8 215b0: f5 cf rjmp .-22 ; 0x2159c break; case 3: lay1cal_square(12, layer_height, extrusion_width); 215b2: b7 01 movw r22, r14 215b4: a6 01 movw r20, r12 215b6: 8c e0 ldi r24, 0x0C ; 12 215b8: f1 cf rjmp .-30 ; 0x2159c 215ba: 90 91 ba 13 lds r25, 0x13BA ; 0x8013ba 215be: 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]))); 215c0: 66 e0 ldi r22, 0x06 ; 6 215c2: 83 eb ldi r24, 0xB3 ; 179 215c4: 9a e8 ldi r25, 0x8A ; 138 215c6: 0e 94 9f 88 call 0x1113e ; 0x1113e if (mmu_enabled) enquecommand_P(MSG_M702); //unload from nozzle 215ca: 29 81 ldd r18, Y+1 ; 0x01 215cc: 21 30 cpi r18, 0x01 ; 1 215ce: 29 f4 brne .+10 ; 0x215da 215d0: 61 e0 ldi r22, 0x01 ; 1 215d2: 8b ed ldi r24, 0xDB ; 219 215d4: 9b e6 ldi r25, 0x6B ; 107 215d6: 0e 94 20 88 call 0x11040 ; 0x11040 enquecommand_P(MSG_M84);// disable motors 215da: 61 e0 ldi r22, 0x01 ; 1 215dc: 87 ed ldi r24, 0xD7 ; 215 215de: 9b e6 ldi r25, 0x6B ; 107 215e0: 0e 94 20 88 call 0x11040 ; 0x11040 215e4: 37 cd rjmp .-1426 ; 0x21054 break; case 2: lay1cal_finish(MMU2::mmu2.Enabled()); break; case 1: lcd_setstatuspgm(MSG_WELCOME); 215e6: 83 e7 ldi r24, 0x73 ; 115 215e8: 90 e7 ldi r25, 0x70 ; 112 215ea: 0e 94 5d f1 call 0x1e2ba ; 0x1e2ba lcd_commands_step = 0; 215ee: 10 92 fb 03 sts 0x03FB, r1 ; 0x8003fb lcd_commands_type = LcdCommands::Idle; 215f2: 10 92 b4 0d sts 0x0DB4, r1 ; 0x800db4 215f6: 82 e0 ldi r24, 0x02 ; 2 215f8: 80 93 b8 0d sts 0x0DB8, r24 ; 0x800db8 <_ZL13printer_state.lto_priv.401> SetPrinterState(PrinterState::Idle); if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 215fc: 8f e5 ldi r24, 0x5F ; 95 215fe: 9f e0 ldi r25, 0x0F ; 15 21600: 0f 94 1c dc call 0x3b838 ; 0x3b838 21604: 88 23 and r24, r24 21606: 09 f4 brne .+2 ; 0x2160a 21608: fe cd rjmp .-1028 ; 0x21206 lcd_wizard(WizState::RepeatLay1Cal); 2160a: 8c e0 ldi r24, 0x0C ; 12 2160c: 0e 94 fb f8 call 0x1f1f6 ; 0x1f1f6 21610: 21 cd rjmp .-1470 ; 0x21054 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."); 21612: 8f e8 ldi r24, 0x8F ; 143 21614: 9b e8 ldi r25, 0x8B ; 139 21616: 0e 94 50 77 call 0xeea0 ; 0xeea0 2161a: cf cd rjmp .-1122 ; 0x211ba } #ifdef THERMAL_MODEL if (lcd_commands_type == LcdCommands::ThermalModel && cmd_buffer_empty()) { switch (lcd_commands_step) 2161c: 84 30 cpi r24, 0x04 ; 4 2161e: a9 f0 breq .+42 ; 0x2164a 21620: c0 f0 brcs .+48 ; 0x21652 21622: 85 30 cpi r24, 0x05 ; 5 21624: 09 f0 breq .+2 ; 0x21628 21626: 07 ce rjmp .-1010 ; 0x21236 case 0: lcd_commands_step = 5; [[fallthrough]]; case 5: enquecommand_P(G28W); 21628: 61 e0 ldi r22, 0x01 ; 1 2162a: 84 ee ldi r24, 0xE4 ; 228 2162c: 9b e6 ldi r25, 0x6B ; 107 2162e: 0e 94 20 88 call 0x11040 ; 0x11040 enquecommand_P(PSTR("G1 X125 Y105 Z1 F8000")); 21632: 61 e0 ldi r22, 0x01 ; 1 21634: 89 e7 ldi r24, 0x79 ; 121 21636: 9b e8 ldi r25, 0x8B ; 139 21638: 0e 94 20 88 call 0x11040 ; 0x11040 lcd_commands_step = 4; 2163c: 84 e0 ldi r24, 0x04 ; 4 break; case 4: st_synchronize(); lcd_commands_step = 3; 2163e: 80 93 fb 03 sts 0x03FB, r24 ; 0x8003fb 21642: f9 cd rjmp .-1038 ; 0x21236 if (lcd_commands_type == LcdCommands::ThermalModel && cmd_buffer_empty()) { switch (lcd_commands_step) { case 0: lcd_commands_step = 5; 21644: 90 93 fb 03 sts 0x03FB, r25 ; 0x8003fb 21648: ef cf rjmp .-34 ; 0x21628 enquecommand_P(PSTR("G1 X125 Y105 Z1 F8000")); lcd_commands_step = 4; break; case 4: st_synchronize(); 2164a: 0f 94 e8 42 call 0x285d0 ; 0x285d0 lcd_commands_step = 3; 2164e: 83 e0 ldi r24, 0x03 ; 3 21650: f6 cf rjmp .-20 ; 0x2163e SERIAL_ECHOLNPGM("TM: invalid parameters, cannot enable"); } void thermal_model_set_warn_beep(bool enabled) { thermal_model::warn_beep = enabled; 21652: 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")); 21656: 61 e0 ldi r22, 0x01 ; 1 21658: 8f e6 ldi r24, 0x6F ; 111 2165a: 9b e8 ldi r25, 0x8B ; 139 2165c: 0e 94 20 88 call 0x11040 ; 0x11040 lcd_commands_step = 2; 21660: 82 e0 ldi r24, 0x02 ; 2 21662: ed cf rjmp .-38 ; 0x2163e break; case 2: if (thermal_model_autotune_result()) 21664: 80 91 3c 02 lds r24, 0x023C ; 0x80023c <_ZL26thermal_model_autotune_err.lto_priv.536> 21668: 81 11 cpse r24, r1 2166a: 05 c0 rjmp .+10 ; 0x21676 enquecommand_P(MSG_M500); 2166c: 61 e0 ldi r22, 0x01 ; 1 2166e: 8a ee ldi r24, 0xEA ; 234 21670: 9b e6 ldi r25, 0x6B ; 107 21672: 0e 94 20 88 call 0x11040 ; 0x11040 lcd_commands_step = 1; 21676: 81 e0 ldi r24, 0x01 ; 1 21678: e2 cf rjmp .-60 ; 0x2163e break; case 1: lcd_commands_step = 0; 2167a: 10 92 fb 03 sts 0x03FB, r1 ; 0x8003fb lcd_commands_type = LcdCommands::Idle; 2167e: 10 92 b4 0d sts 0x0DB4, r1 ; 0x800db4 21682: 92 e0 ldi r25, 0x02 ; 2 21684: 90 93 b8 0d sts 0x0DB8, r25 ; 0x800db8 <_ZL13printer_state.lto_priv.401> 21688: 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)) { 2168c: 8f e5 ldi r24, 0x5F ; 95 2168e: 9f e0 ldi r25, 0x0F ; 15 21690: 0f 94 1c dc call 0x3b838 ; 0x3b838 21694: 88 23 and r24, r24 21696: 69 f0 breq .+26 ; 0x216b2 // resume the wizard lcd_wizard(res ? WizState::Restore : WizState::Failed); 21698: 80 91 3c 02 lds r24, 0x023C ; 0x80023c <_ZL26thermal_model_autotune_err.lto_priv.536> 2169c: 81 11 cpse r24, r1 2169e: 04 c0 rjmp .+8 ; 0x216a8 216a0: 81 e0 ldi r24, 0x01 ; 1 216a2: 0e 94 fb f8 call 0x1f1f6 ; 0x1f1f6 216a6: c7 cd rjmp .-1138 ; 0x21236 216a8: 8e e0 ldi r24, 0x0E ; 14 216aa: fb cf rjmp .-10 ; 0x216a2 #endif //THERMAL_MODEL #endif //QUICK_NOZZLE_CHANGE switch(lcd_commands_step) { case 0: lcd_commands_step = 3; 216ac: 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; 216ae: 80 93 fb 03 sts 0x03FB, r24 ; 0x8003fb menu_depth = 3; break; } } } } 216b2: 0f 90 pop r0 216b4: 0f 90 pop r0 216b6: 0f 90 pop r0 216b8: 0f 90 pop r0 216ba: 0f 90 pop r0 216bc: df 91 pop r29 216be: cf 91 pop r28 216c0: 1f 91 pop r17 216c2: 0f 91 pop r16 216c4: ff 90 pop r15 216c6: ef 90 pop r14 216c8: df 90 pop r13 216ca: cf 90 pop r12 216cc: bf 90 pop r11 216ce: af 90 pop r10 216d0: 9f 90 pop r9 216d2: 8f 90 pop r8 216d4: 7f 90 pop r7 216d6: 6f 90 pop r6 216d8: 5f 90 pop r5 216da: 4f 90 pop r4 216dc: 3f 90 pop r3 216de: 2f 90 pop r2 216e0: 08 95 ret enquecommand_P(PSTR("G1 X125 Z200 F1000")); //move to top center #endif //QUICK_NOZZLE_CHANGE lcd_commands_step = 2; break; case 2: enquecommand_P(PSTR("M84 XY")); 216e2: 61 e0 ldi r22, 0x01 ; 1 216e4: 85 e5 ldi r24, 0x55 ; 85 216e6: 9b e8 ldi r25, 0x8B ; 139 216e8: 0e 94 20 88 call 0x11040 ; 0x11040 if (lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_NOZZLE_CNG_CHANGED), false) == LCD_LEFT_BUTTON_CHOICE) { 216ec: 8a ed ldi r24, 0xDA ; 218 216ee: 99 e4 ldi r25, 0x49 ; 73 216f0: 0e 94 ac 72 call 0xe558 ; 0xe558 216f4: 41 e0 ldi r20, 0x01 ; 1 216f6: 60 e0 ldi r22, 0x00 ; 0 216f8: 0f 94 40 4f call 0x29e80 ; 0x29e80 216fc: 81 11 cpse r24, r1 216fe: d9 cf rjmp .-78 ; 0x216b2 setTargetHotend(0); #ifdef THERMAL_MODEL thermal_model_set_enabled(was_enabled); #endif //THERMAL_MODEL #else fanSpeed = 0; //turn off fan 21700: 10 92 e7 03 sts 0x03E7, r1 ; 0x8003e7 #endif //QUICK_NOZZLE_CHANGE lcd_commands_step = 1; 21704: 81 e0 ldi r24, 0x01 ; 1 21706: d3 cf rjmp .-90 ; 0x216ae } break; case 1: lcd_commands_step = 0; 21708: 10 92 fb 03 sts 0x03FB, r1 ; 0x8003fb lcd_commands_type = LcdCommands::Idle; 2170c: 10 92 b4 0d sts 0x0DB4, r1 ; 0x800db4 21710: 82 e0 ldi r24, 0x02 ; 2 21712: 80 93 b8 0d sts 0x0DB8, r24 ; 0x800db8 <_ZL13printer_state.lto_priv.401> SetPrinterState(PrinterState::Idle); menu_goto(lcd_hw_setup_menu, 2, true); 21716: 20 e0 ldi r18, 0x00 ; 0 21718: 41 e0 ldi r20, 0x01 ; 1 2171a: 62 e0 ldi r22, 0x02 ; 2 2171c: 70 e0 ldi r23, 0x00 ; 0 2171e: 8a eb ldi r24, 0xBA ; 186 21720: 91 ed ldi r25, 0xD1 ; 209 21722: 0f 94 c0 d1 call 0x3a380 ; 0x3a380 menu_depth = 3; 21726: 83 e0 ldi r24, 0x03 ; 3 21728: 80 93 f8 03 sts 0x03F8, r24 ; 0x8003f8 2172c: c2 cf rjmp .-124 ; 0x216b2 0002172e : && menu_menu != lcd_babystep_z && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); } void menu_lcd_lcdupdate_func(void) { 2172e: 0f 93 push r16 21730: 1f 93 push r17 #if (SDCARDDETECT > 0) if ((IS_SD_INSERTED != lcd_oldcardstatus)) 21732: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 21736: 80 95 com r24 21738: 81 70 andi r24, 0x01 ; 1 2173a: 90 91 12 04 lds r25, 0x0412 ; 0x800412 2173e: 89 17 cp r24, r25 21740: a1 f1 breq .+104 ; 0x217aa { if(menu_menu == lcd_sdcard_menu) { 21742: 80 91 13 04 lds r24, 0x0413 ; 0x800413 21746: 90 91 14 04 lds r25, 0x0414 ; 0x800414 2174a: 8e 56 subi r24, 0x6E ; 110 2174c: 91 4f sbci r25, 0xF1 ; 241 2174e: 11 f4 brne .+4 ; 0x21754 // 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(); 21750: 0f 94 5e d4 call 0x3a8bc ; 0x3a8bc } lcd_draw_update = 2; 21754: 82 e0 ldi r24, 0x02 ; 2 21756: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d lcd_oldcardstatus = IS_SD_INSERTED; 2175a: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2175e: 80 95 com r24 21760: 81 70 andi r24, 0x01 ; 1 21762: 80 93 12 04 sts 0x0412, r24 ; 0x800412 lcd_refresh(); // to maybe revive the LCD if static electricity killed it. 21766: 0e 94 8c 6f call 0xdf18 ; 0xdf18 backlight_wake(); 2176a: 80 e0 ldi r24, 0x00 ; 0 2176c: 0e 94 6d 8a call 0x114da ; 0x114da if (lcd_oldcardstatus) 21770: 80 91 12 04 lds r24, 0x0412 ; 0x800412 21774: 88 23 and r24, r24 21776: 09 f4 brne .+2 ; 0x2177a 21778: 71 c0 rjmp .+226 ; 0x2185c { if (!card.mounted) 2177a: 80 91 91 14 lds r24, 0x1491 ; 0x801491 2177e: 81 11 cpse r24, r1 21780: 05 c0 rjmp .+10 ; 0x2178c { card.mount(false); //delay the sorting to the sd menu. Otherwise, removing the SD card while sorting will not menu_back() 21782: 0f 94 c2 80 call 0x30184 ; 0x30184 card.presort_flag = true; //force sorting of the SD menu 21786: 81 e0 ldi r24, 0x01 ; 1 21788: 80 93 df 14 sts 0x14DF, r24 ; 0x8014df } LCD_MESSAGERPGM(MSG_WELCOME); 2178c: 83 e7 ldi r24, 0x73 ; 115 2178e: 90 e7 ldi r25, 0x70 ; 112 21790: 0e 94 5d f1 call 0x1e2ba ; 0x1e2ba bMain=false; // flag (i.e. 'fake parameter') for 'lcd_sdcard_menu()' function 21794: 10 92 e1 03 sts 0x03E1, r1 ; 0x8003e1 menu_submenu(lcd_sdcard_menu, true); 21798: 61 e0 ldi r22, 0x01 ; 1 2179a: 8e e6 ldi r24, 0x6E ; 110 2179c: 91 ef ldi r25, 0xF1 ; 241 2179e: 0f 94 03 d3 call 0x3a606 ; 0x3a606 lcd_timeoutToStatus.start(); 217a2: 8c ed ldi r24, 0xDC ; 220 217a4: 93 e0 ldi r25, 0x03 ; 3 217a6: 0f 94 ef 2b call 0x257de ; 0x257de ::start()> card.release(); LCD_MESSAGERPGM(_T(MSG_SD_REMOVED)); } } #endif//CARDINSERTED if (lcd_next_update_millis < _millis()) 217aa: 0f 94 4c 29 call 0x25298 ; 0x25298 217ae: 00 91 d8 03 lds r16, 0x03D8 ; 0x8003d8 217b2: 10 91 d9 03 lds r17, 0x03D9 ; 0x8003d9 217b6: 20 91 da 03 lds r18, 0x03DA ; 0x8003da 217ba: 30 91 db 03 lds r19, 0x03DB ; 0x8003db 217be: 06 17 cp r16, r22 217c0: 17 07 cpc r17, r23 217c2: 28 07 cpc r18, r24 217c4: 39 07 cpc r19, r25 217c6: e8 f5 brcc .+122 ; 0x21842 { if (lcd_draw_update) { 217c8: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 217cc: 88 23 and r24, r24 217ce: 31 f0 breq .+12 ; 0x217dc lcd_timeoutToStatus.start(); 217d0: 8c ed ldi r24, 0xDC ; 220 217d2: 93 e0 ldi r25, 0x03 ; 3 217d4: 0f 94 ef 2b call 0x257de ; 0x257de ::start()> lcd_frame_start(); 217d8: 0e 94 94 6e call 0xdd28 ; 0xdd28 } (*menu_menu)(); 217dc: e0 91 13 04 lds r30, 0x0413 ; 0x800413 217e0: f0 91 14 04 lds r31, 0x0414 ; 0x800414 217e4: 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)))); 217e6: 80 91 13 04 lds r24, 0x0413 ; 0x800413 217ea: 90 91 14 04 lds r25, 0x0414 ; 0x800414 217ee: 86 5e subi r24, 0xE6 ; 230 217f0: 99 43 sbci r25, 0x39 ; 57 217f2: 09 f4 brne .+2 ; 0x217f6 217f4: 46 c0 rjmp .+140 ; 0x21882 } static inline bool other_menu_expired() { return (menu_menu != lcd_status_screen 217f6: 80 91 13 04 lds r24, 0x0413 ; 0x800413 217fa: 90 91 14 04 lds r25, 0x0414 ; 0x800414 && menu_menu != lcd_babystep_z && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); 217fe: 29 e3 ldi r18, 0x39 ; 57 21800: 88 31 cpi r24, 0x18 ; 24 21802: 92 07 cpc r25, r18 21804: 09 f0 breq .+2 ; 0x21808 21806: 5e c0 rjmp .+188 ; 0x218c4 } lcd_clear(); lcd_return_to_status(); lcd_draw_update = 2; } if (lcd_draw_update == 2) lcdui_refresh(); 21808: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 2180c: 82 30 cpi r24, 0x02 ; 2 2180e: 21 f4 brne .+8 ; 0x21818 #endif //DEBUG_DISABLE_LCD_STATUS_LINE } static void lcdui_refresh(uint8_t clear = true) { clear ? lcd_refresh() : lcd_refresh_noclear(); 21810: 0e 94 8c 6f call 0xdf18 ; 0xdf18 lcd_status_message_idx = 0; // Re-draw message from beginning 21814: 10 92 1e 05 sts 0x051E, r1 ; 0x80051e <_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--; 21818: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 2181c: 88 23 and r24, r24 2181e: 19 f0 breq .+6 ; 0x21826 21820: 81 50 subi r24, 0x01 ; 1 21822: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d lcd_next_update_millis = _millis() + LCD_UPDATE_INTERVAL; 21826: 0f 94 4c 29 call 0x25298 ; 0x25298 2182a: 6c 59 subi r22, 0x9C ; 156 2182c: 7f 4f sbci r23, 0xFF ; 255 2182e: 8f 4f sbci r24, 0xFF ; 255 21830: 9f 4f sbci r25, 0xFF ; 255 21832: 60 93 d8 03 sts 0x03D8, r22 ; 0x8003d8 21836: 70 93 d9 03 sts 0x03D9, r23 ; 0x8003d9 2183a: 80 93 da 03 sts 0x03DA, r24 ; 0x8003da 2183e: 90 93 db 03 sts 0x03DB, r25 ; 0x8003db } prusa_statistics_update_from_lcd_update(); if (lcd_commands_type == LcdCommands::Layer1Cal) lcd_commands(); 21842: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 21846: 84 30 cpi r24, 0x04 ; 4 21848: 09 f0 breq .+2 ; 0x2184c 2184a: 53 c0 rjmp .+166 ; 0x218f2 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) { 2184c: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 21850: 81 11 cpse r24, r1 21852: 4f c0 rjmp .+158 ; 0x218f2 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(); } 21854: 1f 91 pop r17 21856: 0f 91 pop r16 21858: 0d 94 8c 06 jmp 0x20d18 ; 0x20d18 presort_flag = true; #endif } void CardReader::release() { sdprinting = false; 2185c: 10 92 90 14 sts 0x1490, r1 ; 0x801490 mounted = false; 21860: 10 92 91 14 sts 0x1491, r1 ; 0x801491 SERIAL_ECHO_START; 21864: 82 ec ldi r24, 0xC2 ; 194 21866: 9b ea ldi r25, 0xAB ; 171 21868: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED 2186c: 88 e9 ldi r24, 0x98 ; 152 2186e: 9b e6 ldi r25, 0x6B ; 107 21870: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 lcd_timeoutToStatus.start(); } else { card.release(); LCD_MESSAGERPGM(_T(MSG_SD_REMOVED)); 21874: 8d ea ldi r24, 0xAD ; 173 21876: 99 e4 ldi r25, 0x49 ; 73 21878: 0e 94 ac 72 call 0xe558 ; 0xe558 2187c: 0e 94 5d f1 call 0x1e2ba ; 0x1e2ba 21880: 94 cf rjmp .-216 ; 0x217aa // 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)))); 21882: 0e 94 9f 67 call 0xcf3e ; 0xcf3e 21886: 81 11 cpse r24, r1 21888: 0e c0 rjmp .+28 ; 0x218a6 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) 2188a: e0 91 13 04 lds r30, 0x0413 ; 0x800413 2188e: f0 91 14 04 lds r31, 0x0414 ; 0x800414 21892: 30 97 sbiw r30, 0x00 ; 0 21894: 39 f5 brne .+78 ; 0x218e4 { menu_leaving = 1; (*menu_menu)(); menu_leaving = 0; } lcd_clear(); 21896: 0e 94 13 6f call 0xde26 ; 0xde26 lcd_return_to_status(); 2189a: 0f 94 a6 1e call 0x23d4c ; 0x23d4c lcd_draw_update = 2; 2189e: 82 e0 ldi r24, 0x02 ; 2 218a0: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d 218a4: b1 cf rjmp .-158 ; 0x21808 // 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)))); 218a6: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 218aa: 81 11 cpse r24, r1 218ac: a4 cf rjmp .-184 ; 0x217f6 218ae: 40 e9 ldi r20, 0x90 ; 144 218b0: 5f e5 ldi r21, 0x5F ; 95 218b2: 61 e0 ldi r22, 0x01 ; 1 218b4: 70 e0 ldi r23, 0x00 ; 0 218b6: 8c ed ldi r24, 0xDC ; 220 218b8: 93 e0 ldi r25, 0x03 ; 3 218ba: 0f 94 30 2a call 0x25460 ; 0x25460 ::expired(unsigned long)> 218be: 81 11 cpse r24, r1 218c0: e4 cf rjmp .-56 ; 0x2188a 218c2: 99 cf rjmp .-206 ; 0x217f6 } static inline bool other_menu_expired() { return (menu_menu != lcd_status_screen && menu_menu != lcd_babystep_z 218c4: 86 5e subi r24, 0xE6 ; 230 218c6: 99 43 sbci r25, 0x39 ; 57 218c8: 09 f4 brne .+2 ; 0x218cc 218ca: 9e cf rjmp .-196 ; 0x21808 && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); 218cc: 40 e3 ldi r20, 0x30 ; 48 218ce: 55 e7 ldi r21, 0x75 ; 117 218d0: 60 e0 ldi r22, 0x00 ; 0 218d2: 70 e0 ldi r23, 0x00 ; 0 218d4: 8c ed ldi r24, 0xDC ; 220 218d6: 93 e0 ldi r25, 0x03 ; 3 218d8: 0f 94 30 2a call 0x25460 ; 0x25460 ::expired(unsigned long)> 218dc: 88 23 and r24, r24 218de: 09 f4 brne .+2 ; 0x218e2 218e0: 93 cf rjmp .-218 ; 0x21808 218e2: d3 cf rjmp .-90 ; 0x2188a // 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; 218e4: 81 e0 ldi r24, 0x01 ; 1 218e6: 80 93 d7 03 sts 0x03D7, r24 ; 0x8003d7 (*menu_menu)(); 218ea: 19 95 eicall menu_leaving = 0; 218ec: 10 92 d7 03 sts 0x03D7, r1 ; 0x8003d7 218f0: d2 cf rjmp .-92 ; 0x21896 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(); } 218f2: 1f 91 pop r17 218f4: 0f 91 pop r16 218f6: 08 95 ret 000218f8 : menu_goto(lcd_generic_preheat_menu, 0, true); } void lcd_wizard() { bool result = true; if (calibration_status_get(CALIBRATION_WIZARD_STEPS)) { 218f8: 8f e1 ldi r24, 0x1F ; 31 218fa: 0e 94 9f ee call 0x1dd3e ; 0x1dd3e 218fe: 81 11 cpse r24, r1 21900: 06 c0 rjmp .+12 ; 0x2190e // 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); 21902: 8f e1 ldi r24, 0x1F ; 31 21904: 0e 94 3d ee call 0x1dc7a ; 0x1dc7a lcd_wizard(WizState::Run); 21908: 80 e0 ldi r24, 0x00 ; 0 2190a: 0c 94 fb f8 jmp 0x1f1f6 ; 0x1f1f6 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); 2190e: 8a ec ldi r24, 0xCA ; 202 21910: 9b e3 ldi r25, 0x3B ; 59 21912: 0e 94 ac 72 call 0xe558 ; 0xe558 21916: 41 e0 ldi r20, 0x01 ; 1 21918: 60 e0 ldi r22, 0x00 ; 0 2191a: 0f 94 40 4f call 0x29e80 ; 0x29e80 } if (result) { 2191e: 88 23 and r24, r24 21920: 81 f3 breq .-32 ; 0x21902 calibration_status_clear(CALIBRATION_WIZARD_STEPS); lcd_wizard(WizState::Run); } else { lcd_return_to_status(); 21922: 0f 94 a6 1e call 0x23d4c ; 0x23d4c lcd_update_enable(true); 21926: 81 e0 ldi r24, 0x01 ; 1 21928: 0e 94 25 6f call 0xde4a ; 0xde4a lcd_update(2); 2192c: 82 e0 ldi r24, 0x02 ; 2 2192e: 0c 94 a7 6e jmp 0xdd4e ; 0xdd4e 00021932 : if (result == LCD_LEFT_BUTTON_CHOICE) { lcd_mesh_calibration_z(); } } void prompt_steel_sheet_on_bed(bool wantedState) { 21932: cf 93 push r28 21934: 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); 21936: 8f eb ldi r24, 0xBF ; 191 21938: 9e e3 ldi r25, 0x3E ; 62 2193a: 0e 94 ac 72 call 0xe558 ; 0xe558 2193e: 41 e0 ldi r20, 0x01 ; 1 21940: 4c 27 eor r20, r28 21942: 60 e0 ldi r22, 0x00 ; 0 21944: 0f 94 40 4f call 0x29e80 ; 0x29e80 21948: 91 e0 ldi r25, 0x01 ; 1 2194a: 81 11 cpse r24, r1 2194c: 90 e0 ldi r25, 0x00 ; 0 if (sheetIsOnBed != wantedState) { 2194e: c9 17 cp r28, r25 21950: 59 f0 breq .+22 ; 0x21968 lcd_show_fullscreen_message_and_wait_P(_T(wantedState ? MSG_PLACE_STEEL_SHEET : MSG_REMOVE_STEEL_SHEET)); 21952: 85 e9 ldi r24, 0x95 ; 149 21954: 9e e3 ldi r25, 0x3E ; 62 21956: cc 23 and r28, r28 21958: 11 f0 breq .+4 ; 0x2195e 2195a: 8d e1 ldi r24, 0x1D ; 29 2195c: 9a e5 ldi r25, 0x5A ; 90 2195e: 0e 94 ac 72 call 0xe558 ; 0xe558 } #endif //STEEL_SHEET } 21962: 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)); 21964: 0d 94 f1 1f jmp 0x23fe2 ; 0x23fe2 } #endif //STEEL_SHEET } 21968: cf 91 pop r28 2196a: 08 95 ret 0002196c : } lcd_show_fullscreen_message_and_wait_P( _T(MSG_WIZARD_V2_CAL_2)); } void lcd_z_calibration_prompt(bool allowTimeouting) { 2196c: cf 93 push r28 2196e: c8 2f mov r28, r24 uint8_t result = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_Z_CALIBRATION_PROMPT), allowTimeouting, 0); 21970: 8c e6 ldi r24, 0x6C ; 108 21972: 9e e3 ldi r25, 0x3E ; 62 21974: 0e 94 ac 72 call 0xe558 ; 0xe558 21978: 40 e0 ldi r20, 0x00 ; 0 2197a: 6c 2f mov r22, r28 2197c: 0f 94 40 4f call 0x29e80 ; 0x29e80 if (result == LCD_LEFT_BUTTON_CHOICE) { 21980: 81 11 cpse r24, r1 21982: 03 c0 rjmp .+6 ; 0x2198a lcd_mesh_calibration_z(); } } 21984: 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(); 21986: 0c 94 95 ce jmp 0x19d2a ; 0x19d2a } } 2198a: cf 91 pop r28 2198c: 08 95 ret 0002198e : } eeprom_update_byte_notify((uint8_t*)EEPROM_MBL_PROBE_NR, mbl_z_probe_nr); } static void lcd_mesh_bed_leveling_settings() { 2198e: bf 92 push r11 21990: cf 92 push r12 21992: df 92 push r13 21994: ef 92 push r14 21996: ff 92 push r15 21998: 0f 93 push r16 2199a: 1f 93 push r17 2199c: cf 93 push r28 2199e: df 93 push r29 219a0: 00 d0 rcall .+0 ; 0x219a2 219a2: 1f 92 push r1 219a4: cd b7 in r28, 0x3d ; 61 219a6: de b7 in r29, 0x3e ; 62 bool magnet_elimination = (eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION) > 0); 219a8: 8c ea ldi r24, 0xAC ; 172 219aa: 9d e0 ldi r25, 0x0D ; 13 219ac: 0f 94 1c dc call 0x3b838 ; 0x3b838 219b0: c8 2e mov r12, r24 uint8_t points_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR); 219b2: 8b ea ldi r24, 0xAB ; 171 219b4: 9d e0 ldi r25, 0x0D ; 13 219b6: 0f 94 1c dc call 0x3b838 ; 0x3b838 219ba: f8 2e mov r15, r24 uint8_t mbl_z_probe_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR); 219bc: 8a ea ldi r24, 0xAA ; 170 219be: 9d e0 ldi r25, 0x0D ; 13 219c0: 0f 94 1c dc call 0x3b838 ; 0x3b838 219c4: 18 2f mov r17, r24 char sToggle[4]; //enough for nxn format MENU_BEGIN(); 219c6: 0f 94 96 d1 call 0x3a32c ; 0x3a32c 219ca: 10 92 12 05 sts 0x0512, r1 ; 0x800512 if (points_nr == 7) { lcd_z_calibration_prompt(true); } ); MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); sToggle[0] = points_nr + '0'; 219ce: 80 e3 ldi r24, 0x30 ; 48 219d0: d8 2e mov r13, r24 219d2: df 0c add r13, r15 sToggle[1] = 'x'; 219d4: 98 e7 ldi r25, 0x78 ; 120 219d6: 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'; 219d8: 20 e3 ldi r18, 0x30 ; 48 219da: e2 2e mov r14, r18 219dc: 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(); 219de: 80 91 12 05 lds r24, 0x0512 ; 0x800512 219e2: 84 30 cpi r24, 0x04 ; 4 219e4: 08 f0 brcs .+2 ; 0x219e8 219e6: 56 c0 rjmp .+172 ; 0x21a94 219e8: 10 92 15 05 sts 0x0515, r1 ; 0x800515 ON_MENU_LEAVE( 219ec: 0f 94 16 d0 call 0x3a02c ; 0x3a02c 219f0: 88 23 and r24, r24 219f2: 31 f0 breq .+12 ; 0x21a00 219f4: 87 e0 ldi r24, 0x07 ; 7 219f6: f8 12 cpse r15, r24 219f8: 03 c0 rjmp .+6 ; 0x21a00 219fa: 81 e0 ldi r24, 0x01 ; 1 219fc: 0f 94 b6 0c call 0x2196c ; 0x2196c // 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)); 21a00: 86 e4 ldi r24, 0x46 ; 70 21a02: 98 e4 ldi r25, 0x48 ; 72 21a04: 0e 94 ac 72 call 0xe558 ; 0xe558 21a08: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 sToggle[0] = points_nr + '0'; 21a0c: d9 82 std Y+1, r13 ; 0x01 sToggle[1] = 'x'; 21a0e: ba 82 std Y+2, r11 ; 0x02 sToggle[2] = points_nr + '0'; 21a10: db 82 std Y+3, r13 ; 0x03 sToggle[3] = 0; 21a12: 1c 82 std Y+4, r1 ; 0x04 MENU_ITEM_TOGGLE(_T(MSG_MESH), sToggle, mbl_mesh_toggle); 21a14: 8a ef ldi r24, 0xFA ; 250 21a16: 97 e4 ldi r25, 0x47 ; 71 21a18: 0e 94 ac 72 call 0xe558 ; 0xe558 21a1c: 20 e0 ldi r18, 0x00 ; 0 21a1e: 4e e5 ldi r20, 0x5E ; 94 21a20: 5f ec ldi r21, 0xCF ; 207 21a22: be 01 movw r22, r28 21a24: 6f 5f subi r22, 0xFF ; 255 21a26: 7f 4f sbci r23, 0xFF ; 255 21a28: 0f 94 25 d3 call 0x3a64a ; 0x3a64a sToggle[0] = mbl_z_probe_nr + '0'; 21a2c: e9 82 std Y+1, r14 ; 0x01 sToggle[1] = 0; 21a2e: 1a 82 std Y+2, r1 ; 0x02 MENU_ITEM_TOGGLE(_T(MSG_Z_PROBE_NR), sToggle, mbl_probe_nr_toggle); 21a30: 8c ee ldi r24, 0xEC ; 236 21a32: 97 e4 ldi r25, 0x47 ; 71 21a34: 0e 94 ac 72 call 0xe558 ; 0xe558 21a38: 20 e0 ldi r18, 0x00 ; 0 21a3a: 4f e4 ldi r20, 0x4F ; 79 21a3c: 5f ec ldi r21, 0xCF ; 207 21a3e: be 01 movw r22, r28 21a40: 6f 5f subi r22, 0xFF ; 255 21a42: 7f 4f sbci r23, 0xFF ; 255 21a44: 0f 94 25 d3 call 0x3a64a ; 0x3a64a 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); 21a48: 87 e0 ldi r24, 0x07 ; 7 21a4a: f8 12 cpse r15, r24 21a4c: 20 c0 rjmp .+64 ; 0x21a8e 21a4e: 89 ed ldi r24, 0xD9 ; 217 21a50: 9c e5 ldi r25, 0x5C ; 92 21a52: c1 10 cpse r12, r1 21a54: 02 c0 rjmp .+4 ; 0x21a5a 21a56: 83 ed ldi r24, 0xD3 ; 211 21a58: 9c e5 ldi r25, 0x5C ; 92 21a5a: 0e 94 ac 72 call 0xe558 ; 0xe558 21a5e: 8c 01 movw r16, r24 21a60: 86 ed ldi r24, 0xD6 ; 214 21a62: 97 e4 ldi r25, 0x47 ; 71 21a64: 0e 94 ac 72 call 0xe558 ; 0xe558 21a68: 22 e0 ldi r18, 0x02 ; 2 21a6a: 4a e6 ldi r20, 0x6A ; 106 21a6c: 5f ec ldi r21, 0xCF ; 207 21a6e: b8 01 movw r22, r16 21a70: 0f 94 25 d3 call 0x3a64a ; 0x3a64a MENU_END(); 21a74: 0f 94 6a d1 call 0x3a2d4 ; 0x3a2d4 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(); 21a78: 90 91 12 05 lds r25, 0x0512 ; 0x800512 21a7c: 9f 5f subi r25, 0xFF ; 255 21a7e: 90 93 12 05 sts 0x0512, r25 ; 0x800512 21a82: 90 91 14 05 lds r25, 0x0514 ; 0x800514 21a86: 9f 5f subi r25, 0xFF ; 255 21a88: 90 93 14 05 sts 0x0514, r25 ; 0x800514 21a8c: a8 cf rjmp .-176 ; 0x219de 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); 21a8e: 86 ee ldi r24, 0xE6 ; 230 21a90: 97 e4 ldi r25, 0x47 ; 71 21a92: e3 cf rjmp .-58 ; 0x21a5a MENU_END(); } 21a94: 0f 90 pop r0 21a96: 0f 90 pop r0 21a98: 0f 90 pop r0 21a9a: 0f 90 pop r0 21a9c: df 91 pop r29 21a9e: cf 91 pop r28 21aa0: 1f 91 pop r17 21aa2: 0f 91 pop r16 21aa4: ff 90 pop r15 21aa6: ef 90 pop r14 21aa8: df 90 pop r13 21aaa: cf 90 pop r12 21aac: bf 90 pop r11 21aae: 08 95 ret 00021ab0 : } } return false; // couldn't accomplish the task } void MMU2::ToolChangeCommon(uint8_t slot) { 21ab0: 2f 92 push r2 21ab2: 3f 92 push r3 21ab4: 4f 92 push r4 21ab6: 5f 92 push r5 21ab8: 6f 92 push r6 21aba: 7f 92 push r7 21abc: 8f 92 push r8 21abe: 9f 92 push r9 21ac0: af 92 push r10 21ac2: bf 92 push r11 21ac4: cf 92 push r12 21ac6: df 92 push r13 21ac8: ef 92 push r14 21aca: ff 92 push r15 21acc: 0f 93 push r16 21ace: 1f 93 push r17 21ad0: cf 93 push r28 21ad2: df 93 push r29 21ad4: cd b7 in r28, 0x3d ; 61 21ad6: de b7 in r29, 0x3e ; 62 21ad8: 67 97 sbiw r28, 0x17 ; 23 21ada: 0f b6 in r0, 0x3f ; 63 21adc: f8 94 cli 21ade: de bf out 0x3e, r29 ; 62 21ae0: 0f be out 0x3f, r0 ; 63 21ae2: cd bf out 0x3d, r28 ; 61 21ae4: 08 2f mov r16, r24 21ae6: ce 01 movw r24, r28 21ae8: 46 96 adiw r24, 0x16 ; 22 21aea: 9f 8b std Y+23, r25 ; 0x17 21aec: 8e 8b std Y+22, r24 ; 0x16 21aee: 83 e0 ldi r24, 0x03 ; 3 21af0: f8 2e mov r15, r24 lcd_draw_update = 1; // force redraw } void lcd_clearstatus() { memset(lcd_status_message, 0, sizeof(lcd_status_message)); 21af2: 95 e1 ldi r25, 0x15 ; 21 21af4: 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 21af6: 0f 94 af c5 call 0x38b5e ; 0x38b5e tool_change_extruder = slot; 21afa: 00 93 a2 13 sts 0x13A2, r16 ; 0x8013a2 state = State::Stopped; currentScope = Scope::Stopped; } void ProtocolLogic::ToolChange(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Tool, slot)); 21afe: 40 2f mov r20, r16 21b00: 64 e5 ldi r22, 0x54 ; 84 21b02: ce 01 movw r24, r28 21b04: 01 96 adiw r24, 0x01 ; 1 21b06: 0f 94 8d c5 call 0x38b1a ; 0x38b1a 21b0a: 49 81 ldd r20, Y+1 ; 0x01 21b0c: 5a 81 ldd r21, Y+2 ; 0x02 21b0e: 6b 81 ldd r22, Y+3 ; 0x03 21b10: 7c 81 ldd r23, Y+4 ; 0x04 21b12: 8d 81 ldd r24, Y+5 ; 0x05 21b14: 0f 94 52 a5 call 0x34aa4 ; 0x34aa4 logic.ToolChange(slot); // let the MMU pull the filament out and push a new one in if (manage_response(true, true)) { 21b18: 61 e0 ldi r22, 0x01 ; 1 21b1a: 81 e0 ldi r24, 0x01 ; 1 21b1c: 0f 94 76 ac call 0x358ec ; 0x358ec 21b20: 18 2f mov r17, r24 21b22: 81 11 cpse r24, r1 21b24: 07 c0 rjmp .+14 ; 0x21b34 break; } // otherwise: failed to perform the command - unload first and then let it run again IncrementMMUFails(); 21b26: 0f 94 ee c4 call 0x389dc ; 0x389dc // just in case we stood in an error screen for too long and the hotend got cold ResumeHotendTemp(); 21b2a: 0f 94 14 ac call 0x35828 ; 0x35828 // if the extruder has been parked, it will get unparked once the ToolChange command finishes OK // - so no ResumeUnpark() at this spot UnloadInner(); 21b2e: 0f 94 04 ad call 0x35a08 ; 0x35a08 21b32: e1 cf rjmp .-62 ; 0x21af6 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 21b34: 0f 94 e8 42 call 0x285d0 ; 0x285d0 } bool MMU2::VerifyFilamentEnteredPTFE() { planner_synchronize(); if (WhereIsFilament() != FilamentState::AT_FSENSOR) 21b38: 0f 94 e5 c5 call 0x38bca ; 0x38bca 21b3c: 81 30 cpi r24, 0x01 ; 1 21b3e: 79 f1 breq .+94 ; 0x21b9e // 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(); 21b40: 0f 94 04 ad call 0x35a08 ; 0x35a08 if (retries == 2 && cutter_enabled()) { 21b44: 92 e0 ldi r25, 0x02 ; 2 21b46: f9 12 cpse r15, r25 21b48: 09 c0 rjmp .+18 ; 0x21b5c 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; 21b4a: 8e ec ldi r24, 0xCE ; 206 21b4c: 9e e0 ldi r25, 0x0E ; 14 21b4e: 0f 94 1c dc call 0x3b838 ; 0x3b838 21b52: 81 30 cpi r24, 0x01 ; 1 21b54: 19 f4 brne .+6 ; 0x21b5c CutFilamentInner(slot); // try cutting filament tip at the last attempt 21b56: 80 2f mov r24, r16 21b58: 0f 94 eb ad call 0x35bd6 ; 0x35bd6 21b5c: 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) { 21b5e: f1 10 cpse r15, r1 21b60: ca cf rjmp .-108 ; 0x21af6 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()) { 21b62: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 21b66: 88 23 and r24, r24 21b68: 09 f4 brne .+2 ; 0x21b6c 21b6a: ef c0 rjmp .+478 ; 0x21d4a SetCurrentTool(slot); // filament change is finished SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; } 21b6c: 67 96 adiw r28, 0x17 ; 23 21b6e: 0f b6 in r0, 0x3f ; 63 21b70: f8 94 cli 21b72: de bf out 0x3e, r29 ; 62 21b74: 0f be out 0x3f, r0 ; 63 21b76: cd bf out 0x3d, r28 ; 61 21b78: df 91 pop r29 21b7a: cf 91 pop r28 21b7c: 1f 91 pop r17 21b7e: 0f 91 pop r16 21b80: ff 90 pop r15 21b82: ef 90 pop r14 21b84: df 90 pop r13 21b86: cf 90 pop r12 21b88: bf 90 pop r11 21b8a: af 90 pop r10 21b8c: 9f 90 pop r9 21b8e: 8f 90 pop r8 21b90: 7f 90 pop r7 21b92: 6f 90 pop r6 21b94: 5f 90 pop r5 21b96: 4f 90 pop r4 21b98: 3f 90 pop r3 21b9a: 2f 90 pop r2 21b9c: 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(); 21b9e: 60 91 97 13 lds r22, 0x1397 ; 0x801397 21ba2: 70 e0 ldi r23, 0x00 ; 0 21ba4: 90 e0 ldi r25, 0x00 ; 0 21ba6: 80 e0 ldi r24, 0x00 ; 0 21ba8: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 21bac: 9b 01 movw r18, r22 21bae: ac 01 movw r20, r24 21bb0: 66 e6 ldi r22, 0x66 ; 102 21bb2: 76 e6 ldi r23, 0x66 ; 102 21bb4: 8d e9 ldi r24, 0x9D ; 157 21bb6: 92 e4 ldi r25, 0x42 ; 66 21bb8: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 21bbc: 36 2e mov r3, r22 21bbe: 87 2e mov r8, r23 21bc0: 98 2e mov r9, r24 21bc2: 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)) 21bc4: 26 2f mov r18, r22 21bc6: 37 2f mov r19, r23 21bc8: 48 2f mov r20, r24 21bca: 59 2f mov r21, r25 21bcc: 60 e0 ldi r22, 0x00 ; 0 21bce: 70 e0 ldi r23, 0x00 ; 0 21bd0: 80 e2 ldi r24, 0x20 ; 32 21bd2: 91 e4 ldi r25, 0x41 ; 65 21bd4: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 21bd8: 2b 01 movw r4, r22 21bda: 3c 01 movw r6, r24 21bdc: ef e1 ldi r30, 0x1F ; 31 21bde: f5 e0 ldi r31, 0x05 ; 5 21be0: 82 2d mov r24, r2 21be2: 11 92 st Z+, r1 21be4: 8a 95 dec r24 21be6: e9 f7 brne .-6 ; 0x21be2 lcd_status_message_idx = 0; 21be8: 10 92 1e 05 sts 0x051E, r1 ; 0x80051e <_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); 21bec: 83 2d mov r24, r3 21bee: 98 2d mov r25, r8 21bf0: a9 2d mov r26, r9 21bf2: be 2d mov r27, r14 21bf4: bc 01 movw r22, r24 21bf6: 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++) { 21bf8: 91 2c mov r9, r1 21bfa: 31 2c mov r3, r1 21bfc: e1 2c mov r14, r1 extruder_move(move == 0 ? tryload_length : -tryload_length, MMU2_VERIFY_LOAD_TO_NOZZLE_FEED_RATE); 21bfe: 5b 01 movw r10, r22 21c00: 6c 01 movw r12, r24 21c02: d7 fa bst r13, 7 21c04: d0 94 com r13 21c06: d7 f8 bld r13, 7 21c08: d0 94 com r13 21c0a: 20 e0 ldi r18, 0x00 ; 0 21c0c: 30 e0 ldi r19, 0x00 ; 0 21c0e: 48 e4 ldi r20, 0x48 ; 72 21c10: 52 e4 ldi r21, 0x42 ; 66 21c12: 0f 94 b1 c5 call 0x38b62 ; 0x38b62 21c16: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 21c1a: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 while (planner_any_moves()) { 21c1e: 98 17 cp r25, r24 21c20: 09 f4 brne .+2 ; 0x21c24 21c22: 49 c0 rjmp .+146 ; 0x21cb6 filament_inserted = filament_inserted && (WhereIsFilament() == FilamentState::AT_FSENSOR); 21c24: 11 23 and r17, r17 21c26: 31 f0 breq .+12 ; 0x21c34 21c28: 0f 94 e5 c5 call 0x38bca ; 0x38bca 21c2c: 11 e0 ldi r17, 0x01 ; 1 21c2e: 81 30 cpi r24, 0x01 ; 1 21c30: 09 f0 breq .+2 ; 0x21c34 21c32: 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); 21c34: 83 e0 ldi r24, 0x03 ; 3 21c36: 0f 94 d4 42 call 0x285a8 ; 0x285a8 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); 21c3a: 20 91 9e 06 lds r18, 0x069E ; 0x80069e 21c3e: 30 91 9f 06 lds r19, 0x069F ; 0x80069f 21c42: 40 91 a0 06 lds r20, 0x06A0 ; 0x8006a0 21c46: 50 91 a1 06 lds r21, 0x06A1 ; 0x8006a1 21c4a: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 21c4e: a3 01 movw r20, r6 21c50: 92 01 movw r18, r4 21c52: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 21c56: 0f 94 22 de call 0x3bc44 ; 0x3bc44 21c5a: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 21c5e: 86 2e mov r8, r22 if (dpixel1 - dpixel0) { 21c60: e6 16 cp r14, r22 21c62: c1 f0 breq .+48 ; 0x21c94 21c64: e3 2d mov r30, r3 21c66: e4 31 cpi r30, 0x14 ; 20 21c68: 08 f0 brcs .+2 ; 0x21c6c 21c6a: 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); 21c6c: 33 24 eor r3, r3 21c6e: 33 94 inc r3 21c70: 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] : '-'); 21c72: 8f ef ldi r24, 0xFF ; 255 21c74: 11 11 cpse r17, r1 21c76: 01 c0 rjmp .+2 ; 0x21c7a 21c78: 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; 21c7a: f0 e0 ldi r31, 0x00 ; 0 21c7c: e1 5e subi r30, 0xE1 ; 225 21c7e: fa 4f sbci r31, 0xFA ; 250 21c80: 80 83 st Z, r24 lcd_draw_update = 1; // force redraw 21c82: 91 e0 ldi r25, 0x01 ; 1 21c84: 90 93 6d 02 sts 0x026D, r25 ; 0x80026d if (!lcd_update_enabled) lcdui_print_status_line(); 21c88: 80 91 6e 02 lds r24, 0x026E ; 0x80026e 21c8c: 81 11 cpse r24, r1 21c8e: 02 c0 rjmp .+4 ; 0x21c94 21c90: 0f 94 73 2a call 0x254e6 ; 0x254e6 void thermal_setTargetHotend(int16_t t) { setTargetHotend(t); } void safe_delay_keep_alive(uint16_t t) { delay_keep_alive(t); 21c94: 90 e0 ldi r25, 0x00 ; 0 21c96: 80 e0 ldi r24, 0x00 ; 0 21c98: 0e 94 e4 8c call 0x119c8 ; 0x119c8 } 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); 21c9c: e8 2c mov r14, r8 tlur.Progress(filament_inserted); safe_delay_keep_alive(0); if (planner_draining()) { 21c9e: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 21ca2: 88 23 and r24, r24 21ca4: 09 f4 brne .+2 ; 0x21ca8 21ca6: b7 cf rjmp .-146 ; 0x21c16 return false; // power panic or a similar issue happened, bail out fast 21ca8: 10 e0 ldi r17, 0x00 ; 0 21caa: 37 c0 rjmp .+110 ; 0x21d1a 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); 21cac: c6 01 movw r24, r12 21cae: b5 01 movw r22, r10 21cb0: 99 24 eor r9, r9 21cb2: 93 94 inc r9 21cb4: aa cf rjmp .-172 ; 0x21c0a 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++) { 21cb6: 91 e0 ldi r25, 0x01 ; 1 21cb8: 99 12 cpse r9, r25 21cba: f8 cf rjmp .-16 ; 0x21cac return false; // power panic or a similar issue happened, bail out fast } } } Disable_E0(); 21cbc: 0f 94 af c5 call 0x38b5e ; 0x38b5e if (!filament_inserted) { 21cc0: 11 11 cpse r17, r1 21cc2: 08 c0 rjmp .+16 ; 0x21cd4 eeprom_update_byte_notify((uint8_t *)EEPROM_MMU_ENABLED, false); mmu2.Status(); } void IncrementLoadFails(){ eeprom_increment_byte((uint8_t *)EEPROM_MMU_LOAD_FAIL); 21cc4: 8f ec ldi r24, 0xCF ; 207 21cc6: 9e e0 ldi r25, 0x0E ; 14 21cc8: 0e 94 28 76 call 0xec50 ; 0xec50 eeprom_increment_word((uint16_t *)EEPROM_MMU_LOAD_FAIL_TOT); 21ccc: 80 ed ldi r24, 0xD0 ; 208 21cce: 9e e0 ldi r25, 0x0E ; 14 21cd0: 0e 94 1b 76 call 0xec36 ; 0xec36 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); 21cd4: 44 e1 ldi r20, 0x14 ; 20 21cd6: 50 e0 ldi r21, 0x00 ; 0 21cd8: 6f e1 ldi r22, 0x1F ; 31 21cda: 75 e0 ldi r23, 0x05 ; 5 21cdc: ce 01 movw r24, r28 21cde: 01 96 adiw r24, 0x01 ; 1 21ce0: 0f 94 9c e2 call 0x3c538 ; 0x3c538 21ce4: fe 01 movw r30, r28 21ce6: 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'; 21ce8: 81 91 ld r24, Z+ 21cea: 87 fd sbrc r24, 7 21cec: 2c c0 rjmp .+88 ; 0x21d46 21cee: 80 e3 ldi r24, 0x30 ; 48 21cf0: df 01 movw r26, r30 21cf2: 11 97 sbiw r26, 0x01 ; 1 21cf4: 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++) { 21cf6: 8e 89 ldd r24, Y+22 ; 0x16 21cf8: 9f 89 ldd r25, Y+23 ; 0x17 21cfa: 8e 17 cp r24, r30 21cfc: 9f 07 cpc r25, r31 21cfe: a1 f7 brne .-24 ; 0x21ce8 // 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; 21d00: 1d 8a std Y+21, r1 ; 0x15 MMU2_ECHO_MSGLN(buf); 21d02: 82 ec ldi r24, 0xC2 ; 194 21d04: 9b ea ldi r25, 0xAB ; 171 21d06: 0e 94 50 77 call 0xeea0 ; 0xeea0 21d0a: 8d e0 ldi r24, 0x0D ; 13 21d0c: 9f e8 ldi r25, 0x8F ; 143 21d0e: 0e 94 50 77 call 0xeea0 ; 0xeea0 21d12: ce 01 movw r24, r28 21d14: 01 96 adiw r24, 0x01 ; 1 21d16: 0f 94 00 d6 call 0x3ac00 ; 0x3ac00 SERIAL_ECHOLN(message); } void lcd_reset_status_message_timeout() { lcd_status_message_timeout.start(); 21d1a: 84 e3 ldi r24, 0x34 ; 52 21d1c: 95 e0 ldi r25, 0x05 ; 5 21d1e: 0f 94 ef 2b call 0x257de ; 0x257de ::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()) { 21d22: 11 23 and r17, r17 21d24: 09 f4 brne .+2 ; 0x21d28 21d26: 0c cf rjmp .-488 ; 0x21b40 // 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 21d28: 80 2f mov r24, r16 21d2a: 0f 94 03 88 call 0x31006 ; 0x31006 } } void SpoolJoin::setSlot(uint8_t slot) { currentMMUSlot = slot; 21d2e: 00 93 49 13 sts 0x1349, r16 ; 0x801349 SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; 21d32: 80 91 be 13 lds r24, 0x13BE ; 0x8013be 21d36: 90 91 bf 13 lds r25, 0x13BF ; 0x8013bf 21d3a: 01 96 adiw r24, 0x01 ; 1 21d3c: 90 93 bf 13 sts 0x13BF, r25 ; 0x8013bf 21d40: 80 93 be 13 sts 0x13BE, r24 ; 0x8013be 21d44: 13 cf rjmp .-474 ; 0x21b6c 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'; 21d46: 81 e3 ldi r24, 0x31 ; 49 21d48: d3 cf rjmp .-90 ; 0x21cf0 void SetInAutoRetry(bool iar) { inAutoRetry = iar; } inline void SetPrinterError(ErrorCode ec) { explicitPrinterError = ec; 21d4a: 8a e2 ldi r24, 0x2A ; 42 21d4c: 90 e8 ldi r25, 0x80 ; 128 21d4e: 90 93 4c 13 sts 0x134C, r25 ; 0x80134c 21d52: 80 93 4b 13 sts 0x134B, r24 ; 0x80134b 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 21d56: 61 e0 ldi r22, 0x01 ; 1 21d58: 81 e0 ldi r24, 0x01 ; 1 21d5a: 0f 94 76 ac call 0x358ec ; 0x358ec 21d5e: c7 ce rjmp .-626 ; 0x21aee 00021d60 : } ScreenUpdateEnable(); return true; } bool MMU2::load_filament_to_nozzle(uint8_t slot) { 21d60: cf 93 push r28 21d62: df 93 push r29 21d64: d8 2f mov r29, r24 if (!WaitForMMUReady()) { 21d66: 0f 94 84 88 call 0x31108 ; 0x31108 21d6a: c8 2f mov r28, r24 21d6c: 88 23 and r24, r24 21d6e: 49 f1 breq .+82 ; 0x21dc2 safe_delay_keep_alive(delay); } } void WaitForHotendTargetTempBeep() { waitForHotendTargetTemp(200, [] {}); 21d70: 88 ec ldi r24, 0xC8 ; 200 21d72: 90 e0 ldi r25, 0x00 ; 0 21d74: 0f 94 33 c9 call 0x39266 ; 0x39266 (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); 21d78: 82 e0 ldi r24, 0x02 ; 2 21d7a: 0f 94 07 4e call 0x29c0e ; 0x29c0e void FullScreenMsgTest(uint8_t slot){ FullScreenMsg(_T(MSG_TESTING_FILAMENT), slot); } void FullScreenMsgLoad(uint8_t slot){ FullScreenMsg(_T(MSG_LOADING_FILAMENT), slot); 21d7e: 87 e3 ldi r24, 0x37 ; 55 21d80: 9c e5 ldi r25, 0x5C ; 92 21d82: 0e 94 ac 72 call 0xe558 ; 0xe558 21d86: 6d 2f mov r22, r29 21d88: 0f 94 cf c4 call 0x3899e ; 0x3899e struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 21d8c: 0f 94 f8 87 call 0x30ff0 ; 0x30ff0 FullScreenMsgLoad(slot); { // used for MMU-menu operation "Load to Nozzle" ReportingRAII rep(CommandInProgress::ToolChange); FSensorBlockRunout blockRunout; 21d90: 0f 94 ae 86 call 0x30d5c ; 0x30d5c if (extruder != MMU2_NO_TOOL) { // we already have some filament loaded - free it + shape its tip properly 21d94: 80 91 a1 13 lds r24, 0x13A1 ; 0x8013a1 21d98: 83 36 cpi r24, 0x63 ; 99 21d9a: 29 f0 breq .+10 ; 0x21da6 return ss; } void MMU2::filament_ramming() { execute_extruder_sequence(ramming_sequence, sizeof(ramming_sequence) / sizeof(E_Step)); 21d9c: 62 e1 ldi r22, 0x12 ; 18 21d9e: 8b ef ldi r24, 0xFB ; 251 21da0: 96 ea ldi r25, 0xA6 ; 166 21da2: 0f 94 5b 88 call 0x310b6 ; 0x310b6 if (extruder != MMU2_NO_TOOL) { // we already have some filament loaded - free it + shape its tip properly filament_ramming(); } ToolChangeCommon(slot); 21da6: 8d 2f mov r24, r29 21da8: 0f 94 58 0d call 0x21ab0 ; 0x21ab0 // Finish loading to the nozzle with finely tuned steps. execute_load_to_nozzle_sequence(); 21dac: 0e 94 da cd call 0x19bb4 ; 0x19bb4 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); 21db0: 83 e0 ldi r24, 0x03 ; 3 21db2: 0f 94 07 4e call 0x29c0e ; 0x29c0e #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) // SERIAL_ECHOLNPGM("FSBlockRunout"); } FSensorBlockRunout::~FSensorBlockRunout() { fsensor.settings_init(); // restore filament runout state. 21db6: 0f 94 f2 7a call 0x2f5e4 ; 0x2f5e4 explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 21dba: 0f 94 79 88 call 0x310f2 ; 0x310f2 // Finish loading to the nozzle with finely tuned steps. execute_load_to_nozzle_sequence(); MakeSound(Confirm); } ScreenUpdateEnable(); 21dbe: 0f 94 cc c4 call 0x38998 ; 0x38998 return true; } 21dc2: 8c 2f mov r24, r28 21dc4: df 91 pop r29 21dc6: cf 91 pop r28 21dc8: 08 95 ret 00021dca : 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); 21dca: 0f 94 b0 0e call 0x21d60 ; 0x21d60 // Extrude a little bit of filament so the user // can see the color is correct load_filament_final_feed(); 21dce: 0e 94 93 64 call 0xc926 ; 0xc926 st_synchronize(); 21dd2: 0f 94 e8 42 call 0x285d0 ; 0x285d0 // Ask user if the extruded color is correct: lcd_return_to_status(); 21dd6: 0f 94 a6 1e call 0x23d4c ; 0x23d4c lcd_load_filament_color_check(); 21dda: 0f 94 69 4f call 0x29ed2 ; 0x29ed2 lcd_setstatuspgm(MSG_WELCOME); 21dde: 83 e7 ldi r24, 0x73 ; 115 21de0: 90 e7 ldi r25, 0x70 ; 112 21de2: 0e 94 5d f1 call 0x1e2ba ; 0x1e2ba custom_message_type = CustomMsg::Status; 21de6: 10 92 c4 06 sts 0x06C4, r1 ; 0x8006c4 // Clear the filament action clearFilamentAction(); 21dea: 0d 94 93 20 jmp 0x24126 ; 0x24126 00021dee : SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; } bool MMU2::tool_change(uint8_t slot) { 21dee: cf 93 push r28 21df0: df 93 push r29 21df2: d8 2f mov r29, r24 if (!WaitForMMUReady()) { 21df4: 0f 94 84 88 call 0x31108 ; 0x31108 21df8: c8 2f mov r28, r24 21dfa: 88 23 and r24, r24 21dfc: b9 f0 breq .+46 ; 0x21e2c return false; } if (slot != extruder) { 21dfe: 80 91 a1 13 lds r24, 0x13A1 ; 0x8013a1 21e02: 8d 17 cp r24, r29 21e04: 99 f0 breq .+38 ; 0x21e2c 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(); 21e06: 0e 94 e1 67 call 0xcfc2 ; 0xcfc2 if (/*FindaDetectsFilament()*/ 21e0a: 81 11 cpse r24, r1 21e0c: 02 c0 rjmp .+4 ; 0x21e12 /*!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(); 21e0e: 0f 94 3d ad call 0x35a7a ; 0x35a7a struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 21e12: 0f 94 f8 87 call 0x30ff0 ; 0x30ff0 // we need to unload manually as well -- but only if FINDA detects filament unload(); } ReportingRAII rep(CommandInProgress::ToolChange); FSensorBlockRunout blockRunout; 21e16: 0f 94 ae 86 call 0x30d5c ; 0x30d5c bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 21e1a: 0f 94 e8 42 call 0x285d0 ; 0x285d0 planner_synchronize(); ToolChangeCommon(slot); 21e1e: 8d 2f mov r24, r29 21e20: 0f 94 58 0d call 0x21ab0 ; 0x21ab0 21e24: 0f 94 f2 7a call 0x2f5e4 ; 0x2f5e4 explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 21e28: 0f 94 79 88 call 0x310f2 ; 0x310f2 FSensorBlockRunout blockRunout; planner_synchronize(); ToolChangeCommon(slot); } return true; } 21e2c: 8c 2f mov r24, r28 21e2e: df 91 pop r29 21e30: cf 91 pop r28 21e32: 08 95 ret 00021e34 : /// 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) { 21e34: 1f 93 push r17 21e36: cf 93 push r28 21e38: df 93 push r29 21e3a: c8 2f mov r28, r24 21e3c: 16 2f mov r17, r22 if (!WaitForMMUReady()) { 21e3e: 0f 94 84 88 call 0x31108 ; 0x31108 21e42: d8 2f mov r29, r24 21e44: 88 23 and r24, r24 21e46: 89 f0 breq .+34 ; 0x21e6a return false; } FSensorBlockRunout blockRunout; 21e48: 0f 94 ae 86 call 0x30d5c ; 0x30d5c switch (code) { 21e4c: c3 36 cpi r28, 0x63 ; 99 21e4e: 01 f1 breq .+64 ; 0x21e90 21e50: c8 37 cpi r28, 0x78 ; 120 21e52: 81 f0 breq .+32 ; 0x21e74 21e54: cf 33 cpi r28, 0x3F ; 63 21e56: 39 f4 brne .+14 ; 0x21e66 case '?': { waitForHotendTargetTemp(100, [] {}); 21e58: 84 e6 ldi r24, 0x64 ; 100 21e5a: 90 e0 ldi r25, 0x00 ; 0 21e5c: 0f 94 33 c9 call 0x39266 ; 0x39266 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.385]> load_filament_to_nozzle(slot); 21e60: 81 2f mov r24, r17 21e62: 0f 94 b0 0e call 0x21d60 ; 0x21d60 21e66: 0f 94 f2 7a call 0x2f5e4 ; 0x2f5e4 execute_load_to_nozzle_sequence(); } break; } return true; } 21e6a: 8d 2f mov r24, r29 21e6c: df 91 pop r29 21e6e: cf 91 pop r28 21e70: 1f 91 pop r17 21e72: 08 95 ret } #ifdef PREVENT_DANGEROUS_EXTRUDE void set_extrude_min_temp(int temp) { extrude_min_temp = temp; 21e74: 10 92 6c 02 sts 0x026C, r1 ; 0x80026c 21e78: 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); 21e7c: 81 2f mov r24, r17 21e7e: 0f 94 f7 0e call 0x21dee ; 0x21dee 21e82: 8f ea ldi r24, 0xAF ; 175 21e84: 90 e0 ldi r25, 0x00 ; 0 21e86: 90 93 6c 02 sts 0x026C, r25 ; 0x80026c 21e8a: 80 93 6b 02 sts 0x026B, r24 ; 0x80026b 21e8e: eb cf rjmp .-42 ; 0x21e66 thermal_setExtrudeMintemp(EXTRUDE_MINTEMP); } break; case 'c': { waitForHotendTargetTemp(100, [] {}); 21e90: 84 e6 ldi r24, 0x64 ; 100 21e92: 90 e0 ldi r25, 0x00 ; 0 21e94: 0f 94 33 c9 call 0x39266 ; 0x39266 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.385]> execute_load_to_nozzle_sequence(); 21e98: 0e 94 da cd call 0x19bb4 ; 0x19bb4 21e9c: e4 cf rjmp .-56 ; 0x21e66 00021e9e : // Clear the filament action clearFilamentAction(); } static inline void loading_test_wrapper(uint8_t i){ 21e9e: cf 93 push r28 21ea0: 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); 21ea2: 8a ea ldi r24, 0xAA ; 170 21ea4: 95 e4 ldi r25, 0x45 ; 69 21ea6: 0e 94 ac 72 call 0xe558 ; 0xe558 21eaa: 6c 2f mov r22, r28 21eac: 0f 94 cf c4 call 0x3899e ; 0x3899e return true; } bool MMU2::loading_test(uint8_t slot) { FullScreenMsgTest(slot); tool_change(slot); 21eb0: 8c 2f mov r24, r28 21eb2: 0f 94 f7 0e call 0x21dee ; 0x21dee 21eb6: 0f 94 e8 42 call 0x285d0 ; 0x285d0 planner_synchronize(); unload(); 21eba: 0f 94 3d ad call 0x35a7a ; 0x35a7a ScreenUpdateEnable(); 21ebe: 0f 94 cc c4 call 0x38998 ; 0x38998 MMU2::mmu2.loading_test(i); // Clear the filament action clearFilamentAction(); } 21ec2: cf 91 pop r28 static inline void loading_test_wrapper(uint8_t i){ MMU2::mmu2.loading_test(i); // Clear the filament action clearFilamentAction(); 21ec4: 0d 94 93 20 jmp 0x24126 ; 0x24126 00021ec8 : 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(){ 21ec8: cf 93 push r28 for(uint8_t i = 0; i < 5; ++i){ 21eca: c0 e0 ldi r28, 0x00 ; 0 21ecc: 8a ea ldi r24, 0xAA ; 170 21ece: 95 e4 ldi r25, 0x45 ; 69 21ed0: 0e 94 ac 72 call 0xe558 ; 0xe558 21ed4: 6c 2f mov r22, r28 21ed6: 0f 94 cf c4 call 0x3899e ; 0x3899e return true; } bool MMU2::loading_test(uint8_t slot) { FullScreenMsgTest(slot); tool_change(slot); 21eda: 8c 2f mov r24, r28 21edc: 0f 94 f7 0e call 0x21dee ; 0x21dee 21ee0: 0f 94 e8 42 call 0x285d0 ; 0x285d0 planner_synchronize(); unload(); 21ee4: 0f 94 3d ad call 0x35a7a ; 0x35a7a ScreenUpdateEnable(); 21ee8: 0f 94 cc c4 call 0x38998 ; 0x38998 21eec: cf 5f subi r28, 0xFF ; 255 21eee: c5 30 cpi r28, 0x05 ; 5 21ef0: 69 f7 brne .-38 ; 0x21ecc MMU2::mmu2.loading_test(i); } // Clear the filament action clearFilamentAction(); } 21ef2: cf 91 pop r28 for(uint8_t i = 0; i < 5; ++i){ MMU2::mmu2.loading_test(i); } // Clear the filament action clearFilamentAction(); 21ef4: 0d 94 93 20 jmp 0x24126 ; 0x24126 00021ef8 : void ProtocolLogic::CutFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Cut, slot)); } void ProtocolLogic::ResetMMU(uint8_t mode /* = 0 */) { 21ef8: cf 93 push r28 21efa: df 93 push r29 21efc: 00 d0 rcall .+0 ; 0x21efe 21efe: 1f 92 push r1 21f00: 1f 92 push r1 21f02: cd b7 in r28, 0x3d ; 61 21f04: de b7 in r29, 0x3e ; 62 PlanGenericRequest(RequestMsg(RequestMsgCodes::Reset, mode)); 21f06: 48 2f mov r20, r24 21f08: 68 e5 ldi r22, 0x58 ; 88 21f0a: ce 01 movw r24, r28 21f0c: 01 96 adiw r24, 0x01 ; 1 21f0e: 0f 94 8d c5 call 0x38b1a ; 0x38b1a 21f12: 49 81 ldd r20, Y+1 ; 0x01 21f14: 5a 81 ldd r21, Y+2 ; 0x02 21f16: 6b 81 ldd r22, Y+3 ; 0x03 21f18: 7c 81 ldd r23, Y+4 ; 0x04 21f1a: 8d 81 ldd r24, Y+5 ; 0x05 21f1c: 0f 94 52 a5 call 0x34aa4 ; 0x34aa4 } 21f20: 0f 90 pop r0 21f22: 0f 90 pop r0 21f24: 0f 90 pop r0 21f26: 0f 90 pop r0 21f28: 0f 90 pop r0 21f2a: df 91 pop r29 21f2c: cf 91 pop r28 21f2e: 08 95 ret 00021f30 : break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 21f30: 80 e0 ldi r24, 0x00 ; 0 21f32: 0d 94 7c 0f jmp 0x21ef8 ; 0x21ef8 00021f36 : void MMU2::PowerOn() { power_on(); } bool MMU2::ReadRegister(uint8_t address) { 21f36: 1f 93 push r17 21f38: cf 93 push r28 21f3a: df 93 push r29 21f3c: 00 d0 rcall .+0 ; 0x21f3e 21f3e: 1f 92 push r1 21f40: 1f 92 push r1 21f42: cd b7 in r28, 0x3d ; 61 21f44: de b7 in r29, 0x3e ; 62 21f46: 18 2f mov r17, r24 if (!WaitForMMUReady()) { 21f48: 0f 94 84 88 call 0x31108 ; 0x31108 21f4c: 88 23 and r24, r24 21f4e: d9 f0 breq .+54 ; 0x21f86 void ProtocolLogic::Home(uint8_t mode) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Home, mode)); } void ProtocolLogic::ReadRegister(uint8_t address) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Read, address)); 21f50: 41 2f mov r20, r17 21f52: 62 e5 ldi r22, 0x52 ; 82 21f54: ce 01 movw r24, r28 21f56: 01 96 adiw r24, 0x01 ; 1 21f58: 0f 94 8d c5 call 0x38b1a ; 0x38b1a 21f5c: 49 81 ldd r20, Y+1 ; 0x01 21f5e: 5a 81 ldd r21, Y+2 ; 0x02 21f60: 6b 81 ldd r22, Y+3 ; 0x03 21f62: 7c 81 ldd r23, Y+4 ; 0x04 21f64: 8d 81 ldd r24, Y+5 ; 0x05 21f66: 0f 94 52 a5 call 0x34aa4 ; 0x34aa4 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)); 21f6a: 60 e0 ldi r22, 0x00 ; 0 21f6c: 80 e0 ldi r24, 0x00 ; 0 21f6e: 0f 94 76 ac call 0x358ec ; 0x358ec 21f72: 88 23 and r24, r24 21f74: 69 f3 breq .-38 ; 0x21f50 // Update cached value lastReadRegisterValue = logic.rsp.paramValue; 21f76: 20 91 66 13 lds r18, 0x1366 ; 0x801366 21f7a: 30 91 67 13 lds r19, 0x1367 ; 0x801367 21f7e: 30 93 b7 13 sts 0x13B7, r19 ; 0x8013b7 21f82: 20 93 b6 13 sts 0x13B6, r18 ; 0x8013b6 return true; } 21f86: 0f 90 pop r0 21f88: 0f 90 pop r0 21f8a: 0f 90 pop r0 21f8c: 0f 90 pop r0 21f8e: 0f 90 pop r0 21f90: df 91 pop r29 21f92: cf 91 pop r28 21f94: 1f 91 pop r17 21f96: 08 95 ret 00021f98 : waiting_handler(); } set_fan_speed(old_speed); } static uint16_t record(uint16_t samples = REC_BUFFER_SIZE) { 21f98: ff 92 push r15 21f9a: 0f 93 push r16 21f9c: 1f 93 push r17 21f9e: cf 93 push r28 21fa0: df 93 push r29 21fa2: 1f 92 push r1 21fa4: cd b7 in r28, 0x3d ; 61 21fa6: de b7 in r29, 0x3e ; 62 TempMgrGuard temp_mgr_guard; 21fa8: ce 01 movw r24, r28 21faa: 01 96 adiw r24, 0x01 ; 1 21fac: 0f 94 9a 31 call 0x26334 ; 0x26334 uint16_t pos = 0; 21fb0: 10 e0 ldi r17, 0x00 ; 0 21fb2: 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]; 21fb4: 85 e0 ldi r24, 0x05 ; 5 21fb6: 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()) { 21fb8: d1 99 sbic 0x1a, 1 ; 26 21fba: 11 c0 rjmp .+34 ; 0x21fde // temperatures not ready yet, just manage heaters while waiting to reduce jitter manage_heater(); 21fbc: 0f 94 5c 38 call 0x270b8 ; 0x270b8 static uint16_t record(uint16_t samples = REC_BUFFER_SIZE) { TempMgrGuard temp_mgr_guard; uint16_t pos = 0; while(pos < samples) { 21fc0: 0e 3d cpi r16, 0xDE ; 222 21fc2: 11 05 cpc r17, r1 21fc4: c9 f7 brne .-14 ; 0x21fb8 } set_fan_speed(old_speed); } static uint16_t record(uint16_t samples = REC_BUFFER_SIZE) { TempMgrGuard temp_mgr_guard; 21fc6: ce 01 movw r24, r28 21fc8: 01 96 adiw r24, 0x01 ; 1 21fca: 0f 94 8d 31 call 0x2631a ; 0x2631a // it's now safer to give regular serial/lcd updates a shot waiting_handler(); } return pos; } 21fce: c8 01 movw r24, r16 21fd0: 0f 90 pop r0 21fd2: df 91 pop r29 21fd4: cf 91 pop r28 21fd6: 1f 91 pop r17 21fd8: 0f 91 pop r16 21fda: ff 90 pop r15 21fdc: 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(); 21fde: d1 9a sbi 0x1a, 1 ; 26 // manually repeat what the regular isr would do if(adc_values_ready != true) continue; 21fe0: 80 91 1c 05 lds r24, 0x051C ; 0x80051c <_ZL16adc_values_ready.lto_priv.457> 21fe4: 88 23 and r24, r24 21fe6: 61 f3 breq .-40 ; 0x21fc0 adc_values_ready = false; 21fe8: 10 92 1c 05 sts 0x051C, r1 ; 0x80051c <_ZL16adc_values_ready.lto_priv.457> adc_start_cycle(); 21fec: 0e 94 d7 8d call 0x11bae ; 0x11bae temp_mgr_isr(); 21ff0: 0f 94 b9 35 call 0x26b72 ; 0x26b72 // stop recording for an hard error condition if(temp_error_state.v) 21ff4: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 21ff8: 81 11 cpse r24, r1 21ffa: 1b c0 rjmp .+54 ; 0x22032 return 0; // record a new entry rec_entry& entry = rec_buffer[pos]; 21ffc: f0 9e mul r15, r16 21ffe: f0 01 movw r30, r0 22000: f1 9e mul r15, r17 22002: f0 0d add r31, r0 22004: 11 24 eor r1, r1 22006: eb 53 subi r30, 0x3B ; 59 22008: f9 4f sbci r31, 0xF9 ; 249 entry.temp = current_temperature_isr[0]; 2200a: 80 91 17 05 lds r24, 0x0517 ; 0x800517 2200e: 90 91 18 05 lds r25, 0x0518 ; 0x800518 22012: a0 91 19 05 lds r26, 0x0519 ; 0x800519 22016: b0 91 1a 05 lds r27, 0x051A ; 0x80051a 2201a: 80 83 st Z, r24 2201c: 91 83 std Z+1, r25 ; 0x01 2201e: a2 83 std Z+2, r26 ; 0x02 22020: b3 83 std Z+3, r27 ; 0x03 entry.pwm = soft_pwm[0]; 22022: 80 91 16 05 lds r24, 0x0516 ; 0x800516 <_ZL8soft_pwm.lto_priv.459> 22026: 84 83 std Z+4, r24 ; 0x04 ++pos; 22028: 0f 5f subi r16, 0xFF ; 255 2202a: 1f 4f sbci r17, 0xFF ; 255 // it's now safer to give regular serial/lcd updates a shot waiting_handler(); 2202c: 0f 94 84 3a call 0x27508 ; 0x27508 22030: c7 cf rjmp .-114 ; 0x21fc0 adc_start_cycle(); temp_mgr_isr(); // stop recording for an hard error condition if(temp_error_state.v) return 0; 22032: 10 e0 ldi r17, 0x00 ; 0 22034: 00 e0 ldi r16, 0x00 ; 0 22036: c7 cf rjmp .-114 ; 0x21fc6 00022038 : #endif // TMC2130 static inline bool pgm_is_whitespace(const char *c_addr) { const char c = pgm_read_byte(c_addr); 22038: fc 01 movw r30, r24 2203a: 94 91 lpm r25, Z return c == ' ' || c == '\t' || c == '\r' || c == '\n'; 2203c: 90 32 cpi r25, 0x20 ; 32 2203e: 49 f0 breq .+18 ; 0x22052 22040: 87 ef ldi r24, 0xF7 ; 247 22042: 89 0f add r24, r25 22044: 82 30 cpi r24, 0x02 ; 2 22046: 28 f0 brcs .+10 ; 0x22052 22048: 81 e0 ldi r24, 0x01 ; 1 2204a: 9d 30 cpi r25, 0x0D ; 13 2204c: 19 f0 breq .+6 ; 0x22054 2204e: 80 e0 ldi r24, 0x00 ; 0 22050: 08 95 ret 22052: 81 e0 ldi r24, 0x01 ; 1 } 22054: 08 95 ret 00022056 : 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; 22056: 88 3e cpi r24, 0xE8 ; 232 22058: 23 e0 ldi r18, 0x03 ; 3 2205a: 92 07 cpc r25, r18 2205c: 10 f0 brcs .+4 ; 0x22062 2205e: 87 ee ldi r24, 0xE7 ; 231 22060: 93 e0 ldi r25, 0x03 ; 3 } 22062: 08 95 ret 00022064 : return 0; } int uart2_getchar(_UNUSED FILE *stream) { if (rbuf_empty(uart2_ibuf)) return -1; 22064: 90 91 3c 05 lds r25, 0x053C ; 0x80053c 22068: 80 91 3b 05 lds r24, 0x053B ; 0x80053b 2206c: 2f ef ldi r18, 0xFF ; 255 2206e: 3f ef ldi r19, 0xFF ; 255 22070: 89 17 cp r24, r25 22072: 71 f0 breq .+28 ; 0x22090 _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 22074: e9 2f mov r30, r25 22076: f0 e0 ldi r31, 0x00 ; 0 22078: e2 5c subi r30, 0xC2 ; 194 2207a: fa 4f sbci r31, 0xFA ; 250 2207c: 20 81 ld r18, Z 2207e: 30 e0 ldi r19, 0x00 ; 0 buf_r++; //increment read index 22080: 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 22082: 80 91 3a 05 lds r24, 0x053A ; 0x80053a 22086: 98 17 cp r25, r24 22088: 08 f0 brcs .+2 ; 0x2208c 2208a: 90 e0 ldi r25, 0x00 ; 0 ptr[2] = buf_r; //store read index 2208c: 90 93 3c 05 sts 0x053C, r25 ; 0x80053c return rbuf_get(uart2_ibuf); } 22090: c9 01 movw r24, r18 22092: 08 95 ret 00022094 : FILE _uart2io = {0}; int uart2_putchar(char c, _UNUSED FILE *stream) { while (!uart2_txready); 22094: 90 91 d0 00 lds r25, 0x00D0 ; 0x8000d0 <__TEXT_REGION_LENGTH__+0x7c20d0> 22098: 95 ff sbrs r25, 5 2209a: fc cf rjmp .-8 ; 0x22094 UDR2 = c; // transmit byte 2209c: 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; } 220a0: 90 e0 ldi r25, 0x00 ; 0 220a2: 80 e0 ldi r24, 0x00 ; 0 220a4: 08 95 ret 000220a6 : } 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) { 220a6: cf 92 push r12 220a8: df 92 push r13 220aa: ef 92 push r14 220ac: ff 92 push r15 220ae: 0f 93 push r16 220b0: 1f 93 push r17 220b2: cf 93 push r28 220b4: df 93 push r29 220b6: 8c 01 movw r16, r24 220b8: ea 01 movw r28, r20 uint8_t changed = 1; while (changed) { changed = 0; for (uint8_t i = 0; i < (size - 1); i++) 220ba: 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; 220bc: 50 e0 ldi r21, 0x00 ; 0 for (uint8_t i = 0; i < (size - 1); i++) 220be: 61 50 subi r22, 0x01 ; 1 220c0: 77 0b sbc r23, r23 220c2: 29 2f mov r18, r25 220c4: 30 e0 ldi r19, 0x00 ; 0 220c6: 26 17 cp r18, r22 220c8: 37 07 cpc r19, r23 220ca: 2c f0 brlt .+10 ; 0x220d6 } void bubblesort_uint8(uint8_t* data, uint8_t size, uint8_t* data2) { uint8_t changed = 1; while (changed) 220cc: 55 23 and r21, r21 220ce: 19 f1 breq .+70 ; 0x22116 { changed = 0; for (uint8_t i = 0; i < (size - 1); i++) 220d0: 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; 220d2: 50 e0 ldi r21, 0x00 ; 0 220d4: f6 cf rjmp .-20 ; 0x220c2 for (uint8_t i = 0; i < (size - 1); i++) if (data[i] > data[i+1]) 220d6: 78 01 movw r14, r16 220d8: e2 0e add r14, r18 220da: f3 1e adc r15, r19 220dc: f7 01 movw r30, r14 220de: 80 81 ld r24, Z 220e0: d9 01 movw r26, r18 220e2: 11 96 adiw r26, 0x01 ; 1 220e4: 68 01 movw r12, r16 220e6: ca 0e add r12, r26 220e8: db 1e adc r13, r27 220ea: f6 01 movw r30, r12 220ec: 40 81 ld r20, Z 220ee: 48 17 cp r20, r24 220f0: 80 f4 brcc .+32 ; 0x22112 { uint8_t d = data[i]; data[i] = data[i+1]; 220f2: f7 01 movw r30, r14 220f4: 40 83 st Z, r20 data[i+1] = d; 220f6: f6 01 movw r30, r12 220f8: 80 83 st Z, r24 if (data2) 220fa: 20 97 sbiw r28, 0x00 ; 0 220fc: 49 f0 breq .+18 ; 0x22110 { d = data2[i]; 220fe: fe 01 movw r30, r28 22100: e2 0f add r30, r18 22102: f3 1f adc r31, r19 22104: 80 81 ld r24, Z data2[i] = data2[i+1]; 22106: ac 0f add r26, r28 22108: bd 1f adc r27, r29 2210a: 2c 91 ld r18, X 2210c: 20 83 st Z, r18 data2[i+1] = d; 2210e: 8c 93 st X, r24 } changed = 1; 22110: 51 e0 ldi r21, 0x01 ; 1 { uint8_t changed = 1; while (changed) { changed = 0; for (uint8_t i = 0; i < (size - 1); i++) 22112: 9f 5f subi r25, 0xFF ; 255 22114: d6 cf rjmp .-84 ; 0x220c2 data2[i+1] = d; } changed = 1; } } } 22116: df 91 pop r29 22118: cf 91 pop r28 2211a: 1f 91 pop r17 2211c: 0f 91 pop r16 2211e: ff 90 pop r15 22120: ef 90 pop r14 22122: df 90 pop r13 22124: cf 90 pop r12 22126: 08 95 ret 00022128 : } } inline void tmc2130_cs_high(uint8_t axis) { switch (axis) 22128: 81 30 cpi r24, 0x01 ; 1 2212a: 41 f0 breq .+16 ; 0x2213c 2212c: 28 f0 brcs .+10 ; 0x22138 2212e: 82 30 cpi r24, 0x02 ; 2 22130: 39 f0 breq .+14 ; 0x22140 22132: 83 30 cpi r24, 0x03 ; 3 22134: 71 f0 breq .+28 ; 0x22152 22136: 08 95 ret { case X_AXIS: WRITE(X_TMC2130_CS, HIGH); break; 22138: a0 9a sbi 0x14, 0 ; 20 2213a: 08 95 ret case Y_AXIS: WRITE(Y_TMC2130_CS, HIGH); break; 2213c: a2 9a sbi 0x14, 2 ; 20 2213e: 08 95 ret case Z_AXIS: WRITE(Z_TMC2130_CS, HIGH); break; 22140: 9f b7 in r25, 0x3f ; 63 22142: f8 94 cli 22144: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22148: 80 62 ori r24, 0x20 ; 32 case E_AXIS: WRITE(E0_TMC2130_CS, HIGH); break; 2214a: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 2214e: 9f bf out 0x3f, r25 ; 63 } } 22150: 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; 22152: 9f b7 in r25, 0x3f ; 63 22154: f8 94 cli 22156: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 2215a: 80 61 ori r24, 0x10 ; 16 2215c: f6 cf rjmp .-20 ; 0x2214a 0002215e : } inline void tmc2130_cs_low(uint8_t axis) { switch (axis) 2215e: 81 30 cpi r24, 0x01 ; 1 22160: 41 f0 breq .+16 ; 0x22172 22162: 28 f0 brcs .+10 ; 0x2216e 22164: 82 30 cpi r24, 0x02 ; 2 22166: 39 f0 breq .+14 ; 0x22176 22168: 83 30 cpi r24, 0x03 ; 3 2216a: 71 f0 breq .+28 ; 0x22188 2216c: 08 95 ret { case X_AXIS: WRITE(X_TMC2130_CS, LOW); break; 2216e: a0 98 cbi 0x14, 0 ; 20 22170: 08 95 ret case Y_AXIS: WRITE(Y_TMC2130_CS, LOW); break; 22172: a2 98 cbi 0x14, 2 ; 20 22174: 08 95 ret case Z_AXIS: WRITE(Z_TMC2130_CS, LOW); break; 22176: 9f b7 in r25, 0x3f ; 63 22178: f8 94 cli 2217a: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 2217e: 8f 7d andi r24, 0xDF ; 223 case E_AXIS: WRITE(E0_TMC2130_CS, LOW); break; 22180: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22184: 9f bf out 0x3f, r25 ; 63 } } 22186: 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; 22188: 9f b7 in r25, 0x3f ; 63 2218a: f8 94 cli 2218c: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22190: 8f 7e andi r24, 0xEF ; 239 22192: f6 cf rjmp .-20 ; 0x22180 00022194 : } static inline uint8_t spi_txrx(uint8_t tx) { SPDR = tx; 22194: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))); 22196: 0d b4 in r0, 0x2d ; 45 22198: 07 fe sbrs r0, 7 2219a: fd cf rjmp .-6 ; 0x22196 return SPDR; 2219c: 8e b5 in r24, 0x2e ; 46 } 2219e: 08 95 ret 000221a0 : #endif temp_meas_ready = true; } static void temp_mgr_pid() { 221a0: 2f 92 push r2 221a2: 3f 92 push r3 221a4: 4f 92 push r4 221a6: 5f 92 push r5 221a8: 6f 92 push r6 221aa: 7f 92 push r7 221ac: 8f 92 push r8 221ae: 9f 92 push r9 221b0: af 92 push r10 221b2: bf 92 push r11 221b4: cf 92 push r12 221b6: df 92 push r13 221b8: ef 92 push r14 221ba: ff 92 push r15 221bc: 0f 93 push r16 221be: 1f 93 push r17 221c0: cf 93 push r28 221c2: df 93 push r29 221c4: cd b7 in r28, 0x3d ; 61 221c6: de b7 in r29, 0x3e ; 62 221c8: 2e 97 sbiw r28, 0x0e ; 14 221ca: 0f b6 in r0, 0x3f ; 63 221cc: f8 94 cli 221ce: de bf out 0x3e, r29 ; 62 221d0: 0f be out 0x3f, r0 ; 63 221d2: 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]); 221d4: 20 90 1e 06 lds r2, 0x061E ; 0x80061e 221d8: 30 90 1f 06 lds r3, 0x061F ; 0x80061f 221dc: 40 90 17 05 lds r4, 0x0517 ; 0x800517 221e0: 50 90 18 05 lds r5, 0x0518 ; 0x800518 221e4: 60 90 19 05 lds r6, 0x0519 ; 0x800519 221e8: 70 90 1a 05 lds r7, 0x051A ; 0x80051a #ifdef PIDTEMP pid_input = current; #ifndef PID_OPENLOOP if(target == 0) { 221ec: 21 14 cp r2, r1 221ee: 31 04 cpc r3, r1 221f0: 39 f4 brne .+14 ; 0x22200 pid_output = 0; pid_reset[e] = true; 221f2: 81 e0 ldi r24, 0x01 ; 1 221f4: 80 93 f5 05 sts 0x05F5, r24 ; 0x8005f5 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; 221f8: 81 2c mov r8, r1 221fa: 91 2c mov r9, r1 221fc: 54 01 movw r10, r8 221fe: f9 c0 rjmp .+498 ; 0x223f2 #ifndef PID_OPENLOOP if(target == 0) { pid_output = 0; pid_reset[e] = true; } else { pid_error[e] = target - pid_input; 22200: b1 01 movw r22, r2 22202: 03 2c mov r0, r3 22204: 00 0c add r0, r0 22206: 88 0b sbc r24, r24 22208: 99 0b sbc r25, r25 2220a: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 2220e: a3 01 movw r20, r6 22210: 92 01 movw r18, r4 22212: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 22216: 6b 01 movw r12, r22 22218: 7c 01 movw r14, r24 if(pid_reset[e]) { 2221a: 80 91 f5 05 lds r24, 0x05F5 ; 0x8005f5 2221e: 88 23 and r24, r24 22220: 91 f0 breq .+36 ; 0x22246 iState_sum[e] = 0.0; 22222: 10 92 f1 05 sts 0x05F1, r1 ; 0x8005f1 22226: 10 92 f2 05 sts 0x05F2, r1 ; 0x8005f2 2222a: 10 92 f3 05 sts 0x05F3, r1 ; 0x8005f3 2222e: 10 92 f4 05 sts 0x05F4, r1 ; 0x8005f4 dTerm[e] = 0.0; // 'dState_last[e]' initial setting is not necessary (see end of if-statement) 22232: 10 92 ed 05 sts 0x05ED, r1 ; 0x8005ed 22236: 10 92 ee 05 sts 0x05EE, r1 ; 0x8005ee 2223a: 10 92 ef 05 sts 0x05EF, r1 ; 0x8005ef 2223e: 10 92 f0 05 sts 0x05F0, r1 ; 0x8005f0 pid_reset[e] = false; 22242: 10 92 f5 05 sts 0x05F5, r1 ; 0x8005f5 } #ifndef PonM pTerm[e] = cs.Kp * pid_error[e]; 22246: 20 91 26 0e lds r18, 0x0E26 ; 0x800e26 2224a: 30 91 27 0e lds r19, 0x0E27 ; 0x800e27 2224e: 40 91 28 0e lds r20, 0x0E28 ; 0x800e28 22252: 50 91 29 0e lds r21, 0x0E29 ; 0x800e29 22256: c7 01 movw r24, r14 22258: b6 01 movw r22, r12 2225a: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 2225e: 69 83 std Y+1, r22 ; 0x01 22260: 7a 83 std Y+2, r23 ; 0x02 22262: 8b 83 std Y+3, r24 ; 0x03 22264: 9c 83 std Y+4, r25 ; 0x04 iState_sum[e] += pid_error[e]; 22266: 20 91 f1 05 lds r18, 0x05F1 ; 0x8005f1 2226a: 30 91 f2 05 lds r19, 0x05F2 ; 0x8005f2 2226e: 40 91 f3 05 lds r20, 0x05F3 ; 0x8005f3 22272: 50 91 f4 05 lds r21, 0x05F4 ; 0x8005f4 22276: c7 01 movw r24, r14 22278: b6 01 movw r22, r12 2227a: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 2227e: 4b 01 movw r8, r22 22280: 5c 01 movw r10, r24 iState_sum[e] = constrain(iState_sum[e], iState_sum_min[e], iState_sum_max[e]); 22282: 20 91 b3 04 lds r18, 0x04B3 ; 0x8004b3 <_ZL14iState_sum_min.lto_priv.468> 22286: 2d 87 std Y+13, r18 ; 0x0d 22288: 30 91 b4 04 lds r19, 0x04B4 ; 0x8004b4 <_ZL14iState_sum_min.lto_priv.468+0x1> 2228c: 39 87 std Y+9, r19 ; 0x09 2228e: 10 91 b5 04 lds r17, 0x04B5 ; 0x8004b5 <_ZL14iState_sum_min.lto_priv.468+0x2> 22292: 00 91 b6 04 lds r16, 0x04B6 ; 0x8004b6 <_ZL14iState_sum_min.lto_priv.468+0x3> 22296: 41 2f mov r20, r17 22298: 50 2f mov r21, r16 2229a: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 2229e: 87 fd sbrc r24, 7 222a0: 17 c0 rjmp .+46 ; 0x222d0 222a2: 80 91 af 04 lds r24, 0x04AF ; 0x8004af <_ZL14iState_sum_max.lto_priv.469> 222a6: 8d 87 std Y+13, r24 ; 0x0d 222a8: 90 91 b0 04 lds r25, 0x04B0 ; 0x8004b0 <_ZL14iState_sum_max.lto_priv.469+0x1> 222ac: 99 87 std Y+9, r25 ; 0x09 222ae: 10 91 b1 04 lds r17, 0x04B1 ; 0x8004b1 <_ZL14iState_sum_max.lto_priv.469+0x2> 222b2: 00 91 b2 04 lds r16, 0x04B2 ; 0x8004b2 <_ZL14iState_sum_max.lto_priv.469+0x3> 222b6: 9c 01 movw r18, r24 222b8: 41 2f mov r20, r17 222ba: 50 2f mov r21, r16 222bc: b4 01 movw r22, r8 222be: c5 01 movw r24, r10 222c0: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 222c4: 18 16 cp r1, r24 222c6: 24 f0 brlt .+8 ; 0x222d0 222c8: 8d 86 std Y+13, r8 ; 0x0d 222ca: 99 86 std Y+9, r9 ; 0x09 222cc: 1a 2d mov r17, r10 222ce: 0b 2d mov r16, r11 222d0: 8d 85 ldd r24, Y+13 ; 0x0d 222d2: 99 85 ldd r25, Y+9 ; 0x09 222d4: a1 2f mov r26, r17 222d6: b0 2f mov r27, r16 222d8: 80 93 f1 05 sts 0x05F1, r24 ; 0x8005f1 222dc: 90 93 f2 05 sts 0x05F2, r25 ; 0x8005f2 222e0: a0 93 f3 05 sts 0x05F3, r26 ; 0x8005f3 222e4: b0 93 f4 05 sts 0x05F4, r27 ; 0x8005f4 iTerm[e] = cs.Ki * iState_sum[e]; 222e8: 20 91 2a 0e lds r18, 0x0E2A ; 0x800e2a 222ec: 30 91 2b 0e lds r19, 0x0E2B ; 0x800e2b 222f0: 40 91 2c 0e lds r20, 0x0E2C ; 0x800e2c 222f4: 50 91 2d 0e lds r21, 0x0E2D ; 0x800e2d 222f8: bc 01 movw r22, r24 222fa: 81 2f mov r24, r17 222fc: 90 2f mov r25, r16 222fe: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 22302: 6d 83 std Y+5, r22 ; 0x05 22304: 7e 83 std Y+6, r23 ; 0x06 22306: 8f 83 std Y+7, r24 ; 0x07 22308: 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 2230a: 20 91 e9 05 lds r18, 0x05E9 ; 0x8005e9 2230e: 30 91 ea 05 lds r19, 0x05EA ; 0x8005ea 22312: 40 91 eb 05 lds r20, 0x05EB ; 0x8005eb 22316: 50 91 ec 05 lds r21, 0x05EC ; 0x8005ec 2231a: c3 01 movw r24, r6 2231c: b2 01 movw r22, r4 2231e: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 22322: 20 91 2e 0e lds r18, 0x0E2E ; 0x800e2e 22326: 30 91 2f 0e lds r19, 0x0E2F ; 0x800e2f 2232a: 40 91 30 0e lds r20, 0x0E30 ; 0x800e30 2232e: 50 91 31 0e lds r21, 0x0E31 ; 0x800e31 22332: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 22336: 20 ed ldi r18, 0xD0 ; 208 22338: 3c ec ldi r19, 0xCC ; 204 2233a: 4c e4 ldi r20, 0x4C ; 76 2233c: 5d e3 ldi r21, 0x3D ; 61 2233e: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 22342: 4b 01 movw r8, r22 22344: 5c 01 movw r10, r24 22346: 23 e3 ldi r18, 0x33 ; 51 22348: 33 e3 ldi r19, 0x33 ; 51 2234a: 43 e7 ldi r20, 0x73 ; 115 2234c: 5f e3 ldi r21, 0x3F ; 63 2234e: 60 91 ed 05 lds r22, 0x05ED ; 0x8005ed 22352: 70 91 ee 05 lds r23, 0x05EE ; 0x8005ee 22356: 80 91 ef 05 lds r24, 0x05EF ; 0x8005ef 2235a: 90 91 f0 05 lds r25, 0x05F0 ; 0x8005f0 2235e: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 22362: 9b 01 movw r18, r22 22364: ac 01 movw r20, r24 22366: c5 01 movw r24, r10 22368: b4 01 movw r22, r8 2236a: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 2236e: 4b 01 movw r8, r22 22370: 5c 01 movw r10, r24 22372: 80 92 ed 05 sts 0x05ED, r8 ; 0x8005ed 22376: 90 92 ee 05 sts 0x05EE, r9 ; 0x8005ee 2237a: a0 92 ef 05 sts 0x05EF, r10 ; 0x8005ef 2237e: b0 92 f0 05 sts 0x05F0, r11 ; 0x8005f0 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) 22382: 2d 81 ldd r18, Y+5 ; 0x05 22384: 3e 81 ldd r19, Y+6 ; 0x06 22386: 4f 81 ldd r20, Y+7 ; 0x07 22388: 58 85 ldd r21, Y+8 ; 0x08 2238a: 69 81 ldd r22, Y+1 ; 0x01 2238c: 7a 81 ldd r23, Y+2 ; 0x02 2238e: 8b 81 ldd r24, Y+3 ; 0x03 22390: 9c 81 ldd r25, Y+4 ; 0x04 22392: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 22396: a5 01 movw r20, r10 22398: 94 01 movw r18, r8 2239a: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 2239e: 4b 01 movw r8, r22 223a0: 5c 01 movw r10, r24 if (pid_output > PID_MAX) { 223a2: 20 e0 ldi r18, 0x00 ; 0 223a4: 30 e0 ldi r19, 0x00 ; 0 223a6: 4f e7 ldi r20, 0x7F ; 127 223a8: 53 e4 ldi r21, 0x43 ; 67 223aa: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> if (pid_error[e] > 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 223ae: 20 e0 ldi r18, 0x00 ; 0 223b0: 30 e0 ldi r19, 0x00 ; 0 223b2: 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) { 223b4: 18 16 cp r1, r24 223b6: 0c f0 brlt .+2 ; 0x223ba 223b8: 6d c1 rjmp .+730 ; 0x22694 if (pid_error[e] > 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 223ba: c7 01 movw r24, r14 223bc: b6 01 movw r22, r12 223be: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 223c2: 18 16 cp r1, r24 223c4: 84 f4 brge .+32 ; 0x223e6 223c6: a7 01 movw r20, r14 223c8: 96 01 movw r18, r12 223ca: 6d 85 ldd r22, Y+13 ; 0x0d 223cc: 79 85 ldd r23, Y+9 ; 0x09 223ce: 81 2f mov r24, r17 223d0: 90 2f mov r25, r16 223d2: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 223d6: 60 93 f1 05 sts 0x05F1, r22 ; 0x8005f1 223da: 70 93 f2 05 sts 0x05F2, r23 ; 0x8005f2 223de: 80 93 f3 05 sts 0x05F3, r24 ; 0x8005f3 223e2: 90 93 f4 05 sts 0x05F4, r25 ; 0x8005f4 pid_output=PID_MAX; 223e6: 81 2c mov r8, r1 223e8: 91 2c mov r9, r1 223ea: 3f e7 ldi r19, 0x7F ; 127 223ec: a3 2e mov r10, r19 223ee: 33 e4 ldi r19, 0x43 ; 67 223f0: 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; 223f2: 40 92 e9 05 sts 0x05E9, r4 ; 0x8005e9 223f6: 50 92 ea 05 sts 0x05EA, r5 ; 0x8005ea 223fa: 60 92 eb 05 sts 0x05EB, r6 ; 0x8005eb 223fe: 70 92 ec 05 sts 0x05EC, r7 ; 0x8005ec pid_output = PID_MAX; } #endif // Check if temperature is within the correct range if((current < maxttemp[e]) && (target != 0)) 22402: 60 91 56 02 lds r22, 0x0256 ; 0x800256 <_ZL8maxttemp.lto_priv.470> 22406: 70 91 57 02 lds r23, 0x0257 ; 0x800257 <_ZL8maxttemp.lto_priv.470+0x1> 2240a: 07 2e mov r0, r23 2240c: 00 0c add r0, r0 2240e: 88 0b sbc r24, r24 22410: 99 0b sbc r25, r25 22412: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 22416: 9b 01 movw r18, r22 22418: ac 01 movw r20, r24 2241a: c3 01 movw r24, r6 2241c: b2 01 movw r22, r4 2241e: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 22422: 87 ff sbrs r24, 7 22424: 57 c1 rjmp .+686 ; 0x226d4 22426: 23 28 or r2, r3 22428: 09 f4 brne .+2 ; 0x2242c 2242a: 54 c1 rjmp .+680 ; 0x226d4 soft_pwm[e] = (int)pid_output >> 1; 2242c: c5 01 movw r24, r10 2242e: b4 01 movw r22, r8 22430: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> 22434: 75 95 asr r23 22436: 67 95 ror r22 22438: 60 93 16 05 sts 0x0516, r22 ; 0x800516 <_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); 2243c: 20 91 17 06 lds r18, 0x0617 ; 0x800617 22440: 30 91 18 06 lds r19, 0x0618 ; 0x800618 22444: 3a 83 std Y+2, r19 ; 0x02 22446: 29 83 std Y+1, r18 ; 0x01 22448: 40 90 19 06 lds r4, 0x0619 ; 0x800619 2244c: 50 90 1a 06 lds r5, 0x061A ; 0x80061a 22450: 60 90 1b 06 lds r6, 0x061B ; 0x80061b 22454: 70 90 1c 06 lds r7, 0x061C ; 0x80061c #ifdef PIDTEMPBED pid_input = current; #ifndef PID_OPENLOOP pid_error_bed = target - pid_input; 22458: b9 01 movw r22, r18 2245a: 33 0f add r19, r19 2245c: 88 0b sbc r24, r24 2245e: 99 0b sbc r25, r25 22460: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 22464: a3 01 movw r20, r6 22466: 92 01 movw r18, r4 22468: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 2246c: 6b 01 movw r12, r22 2246e: 7c 01 movw r14, r24 pTerm_bed = cs.bedKp * pid_error_bed; 22470: 20 91 32 0e lds r18, 0x0E32 ; 0x800e32 22474: 30 91 33 0e lds r19, 0x0E33 ; 0x800e33 22478: 40 91 34 0e lds r20, 0x0E34 ; 0x800e34 2247c: 50 91 35 0e lds r21, 0x0E35 ; 0x800e35 22480: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 22484: 6d 83 std Y+5, r22 ; 0x05 22486: 7e 83 std Y+6, r23 ; 0x06 22488: 8f 83 std Y+7, r24 ; 0x07 2248a: 98 87 std Y+8, r25 ; 0x08 temp_iState_bed += pid_error_bed; 2248c: 20 91 fe 05 lds r18, 0x05FE ; 0x8005fe 22490: 30 91 ff 05 lds r19, 0x05FF ; 0x8005ff 22494: 40 91 00 06 lds r20, 0x0600 ; 0x800600 22498: 50 91 01 06 lds r21, 0x0601 ; 0x800601 2249c: c7 01 movw r24, r14 2249e: b6 01 movw r22, r12 224a0: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 224a4: 5b 01 movw r10, r22 224a6: 8c 01 movw r16, r24 temp_iState_bed = constrain(temp_iState_bed, temp_iState_min_bed, temp_iState_max_bed); 224a8: 30 91 ab 04 lds r19, 0x04AB ; 0x8004ab <_ZL19temp_iState_min_bed.lto_priv.466> 224ac: 3e 87 std Y+14, r19 ; 0x0e 224ae: 80 91 ac 04 lds r24, 0x04AC ; 0x8004ac <_ZL19temp_iState_min_bed.lto_priv.466+0x1> 224b2: 8d 87 std Y+13, r24 ; 0x0d 224b4: 30 90 ad 04 lds r3, 0x04AD ; 0x8004ad <_ZL19temp_iState_min_bed.lto_priv.466+0x2> 224b8: 20 90 ae 04 lds r2, 0x04AE ; 0x8004ae <_ZL19temp_iState_min_bed.lto_priv.466+0x3> 224bc: 23 2f mov r18, r19 224be: 38 2f mov r19, r24 224c0: 43 2d mov r20, r3 224c2: 52 2d mov r21, r2 224c4: b5 01 movw r22, r10 224c6: c8 01 movw r24, r16 224c8: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 224cc: 87 fd sbrc r24, 7 224ce: 18 c0 rjmp .+48 ; 0x22500 224d0: 90 91 a7 04 lds r25, 0x04A7 ; 0x8004a7 <_ZL19temp_iState_max_bed.lto_priv.467> 224d4: 9e 87 std Y+14, r25 ; 0x0e 224d6: 20 91 a8 04 lds r18, 0x04A8 ; 0x8004a8 <_ZL19temp_iState_max_bed.lto_priv.467+0x1> 224da: 2d 87 std Y+13, r18 ; 0x0d 224dc: 30 90 a9 04 lds r3, 0x04A9 ; 0x8004a9 <_ZL19temp_iState_max_bed.lto_priv.467+0x2> 224e0: 20 90 aa 04 lds r2, 0x04AA ; 0x8004aa <_ZL19temp_iState_max_bed.lto_priv.467+0x3> 224e4: 29 2f mov r18, r25 224e6: 3d 85 ldd r19, Y+13 ; 0x0d 224e8: 43 2d mov r20, r3 224ea: 52 2d mov r21, r2 224ec: b5 01 movw r22, r10 224ee: c8 01 movw r24, r16 224f0: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 224f4: 18 16 cp r1, r24 224f6: 24 f0 brlt .+8 ; 0x22500 224f8: ae 86 std Y+14, r10 ; 0x0e 224fa: bd 86 std Y+13, r11 ; 0x0d 224fc: 30 2e mov r3, r16 224fe: 21 2e mov r2, r17 22500: 8e 85 ldd r24, Y+14 ; 0x0e 22502: 9d 85 ldd r25, Y+13 ; 0x0d 22504: a3 2d mov r26, r3 22506: b2 2d mov r27, r2 22508: 80 93 fe 05 sts 0x05FE, r24 ; 0x8005fe 2250c: 90 93 ff 05 sts 0x05FF, r25 ; 0x8005ff 22510: a0 93 00 06 sts 0x0600, r26 ; 0x800600 22514: b0 93 01 06 sts 0x0601, r27 ; 0x800601 iTerm_bed = cs.bedKi * temp_iState_bed; 22518: 20 91 36 0e lds r18, 0x0E36 ; 0x800e36 2251c: 30 91 37 0e lds r19, 0x0E37 ; 0x800e37 22520: 40 91 38 0e lds r20, 0x0E38 ; 0x800e38 22524: 50 91 39 0e lds r21, 0x0E39 ; 0x800e39 22528: bc 01 movw r22, r24 2252a: 83 2d mov r24, r3 2252c: 92 2d mov r25, r2 2252e: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 22532: 69 87 std Y+9, r22 ; 0x09 22534: 7a 87 std Y+10, r23 ; 0x0a 22536: 8b 87 std Y+11, r24 ; 0x0b 22538: 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); 2253a: 20 91 fa 05 lds r18, 0x05FA ; 0x8005fa 2253e: 30 91 fb 05 lds r19, 0x05FB ; 0x8005fb 22542: 40 91 fc 05 lds r20, 0x05FC ; 0x8005fc 22546: 50 91 fd 05 lds r21, 0x05FD ; 0x8005fd 2254a: c3 01 movw r24, r6 2254c: b2 01 movw r22, r4 2254e: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 22552: 20 91 3a 0e lds r18, 0x0E3A ; 0x800e3a 22556: 30 91 3b 0e lds r19, 0x0E3B ; 0x800e3b 2255a: 40 91 3c 0e lds r20, 0x0E3C ; 0x800e3c 2255e: 50 91 3d 0e lds r21, 0x0E3D ; 0x800e3d 22562: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 22566: 20 ed ldi r18, 0xD0 ; 208 22568: 3c ec ldi r19, 0xCC ; 204 2256a: 4c e4 ldi r20, 0x4C ; 76 2256c: 5d e3 ldi r21, 0x3D ; 61 2256e: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 22572: 4b 01 movw r8, r22 22574: 5c 01 movw r10, r24 22576: 23 e3 ldi r18, 0x33 ; 51 22578: 33 e3 ldi r19, 0x33 ; 51 2257a: 43 e7 ldi r20, 0x73 ; 115 2257c: 5f e3 ldi r21, 0x3F ; 63 2257e: 60 91 f6 05 lds r22, 0x05F6 ; 0x8005f6 22582: 70 91 f7 05 lds r23, 0x05F7 ; 0x8005f7 22586: 80 91 f8 05 lds r24, 0x05F8 ; 0x8005f8 2258a: 90 91 f9 05 lds r25, 0x05F9 ; 0x8005f9 2258e: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 22592: 9b 01 movw r18, r22 22594: ac 01 movw r20, r24 22596: c5 01 movw r24, r10 22598: b4 01 movw r22, r8 2259a: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 2259e: 4b 01 movw r8, r22 225a0: 5c 01 movw r10, r24 225a2: 80 92 f6 05 sts 0x05F6, r8 ; 0x8005f6 225a6: 90 92 f7 05 sts 0x05F7, r9 ; 0x8005f7 225aa: a0 92 f8 05 sts 0x05F8, r10 ; 0x8005f8 225ae: b0 92 f9 05 sts 0x05F9, r11 ; 0x8005f9 temp_dState_bed = pid_input; 225b2: 40 92 fa 05 sts 0x05FA, r4 ; 0x8005fa 225b6: 50 92 fb 05 sts 0x05FB, r5 ; 0x8005fb 225ba: 60 92 fc 05 sts 0x05FC, r6 ; 0x8005fc 225be: 70 92 fd 05 sts 0x05FD, r7 ; 0x8005fd pid_output = pTerm_bed + iTerm_bed - dTerm_bed; 225c2: 29 85 ldd r18, Y+9 ; 0x09 225c4: 3a 85 ldd r19, Y+10 ; 0x0a 225c6: 4b 85 ldd r20, Y+11 ; 0x0b 225c8: 5c 85 ldd r21, Y+12 ; 0x0c 225ca: 6d 81 ldd r22, Y+5 ; 0x05 225cc: 7e 81 ldd r23, Y+6 ; 0x06 225ce: 8f 81 ldd r24, Y+7 ; 0x07 225d0: 98 85 ldd r25, Y+8 ; 0x08 225d2: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 225d6: a5 01 movw r20, r10 225d8: 94 01 movw r18, r8 225da: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 225de: 4b 01 movw r8, r22 225e0: 5c 01 movw r10, r24 if (pid_output > MAX_BED_POWER) { 225e2: 20 e0 ldi r18, 0x00 ; 0 225e4: 30 e0 ldi r19, 0x00 ; 0 225e6: 4f e7 ldi r20, 0x7F ; 127 225e8: 53 e4 ldi r21, 0x43 ; 67 225ea: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> if (pid_error_bed > 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 225ee: 20 e0 ldi r18, 0x00 ; 0 225f0: 30 e0 ldi r19, 0x00 ; 0 225f2: 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) { 225f4: 18 16 cp r1, r24 225f6: 0c f0 brlt .+2 ; 0x225fa 225f8: 70 c0 rjmp .+224 ; 0x226da if (pid_error_bed > 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 225fa: c7 01 movw r24, r14 225fc: b6 01 movw r22, r12 225fe: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 22602: 18 16 cp r1, r24 22604: 84 f4 brge .+32 ; 0x22626 22606: a7 01 movw r20, r14 22608: 96 01 movw r18, r12 2260a: 6e 85 ldd r22, Y+14 ; 0x0e 2260c: 7d 85 ldd r23, Y+13 ; 0x0d 2260e: 83 2d mov r24, r3 22610: 92 2d mov r25, r2 22612: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 22616: 60 93 fe 05 sts 0x05FE, r22 ; 0x8005fe 2261a: 70 93 ff 05 sts 0x05FF, r23 ; 0x8005ff 2261e: 80 93 00 06 sts 0x0600, r24 ; 0x800600 22622: 90 93 01 06 sts 0x0601, r25 ; 0x800601 pid_output=MAX_BED_POWER; 22626: 81 2c mov r8, r1 22628: 91 2c mov r9, r1 2262a: 9f e7 ldi r25, 0x7F ; 127 2262c: a9 2e mov r10, r25 2262e: 93 e4 ldi r25, 0x43 ; 67 22630: b9 2e mov r11, r25 #else pid_output = constrain(target, 0, MAX_BED_POWER); #endif //PID_OPENLOOP if(current < BED_MAXTEMP) 22632: 20 e0 ldi r18, 0x00 ; 0 22634: 30 e0 ldi r19, 0x00 ; 0 22636: 4a ef ldi r20, 0xFA ; 250 22638: 52 e4 ldi r21, 0x42 ; 66 2263a: c3 01 movw r24, r6 2263c: b2 01 movw r22, r4 2263e: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 22642: 87 ff sbrs r24, 7 22644: 6d c0 rjmp .+218 ; 0x22720 { soft_pwm_bed = (int)pid_output >> 1; 22646: c5 01 movw r24, r10 22648: b4 01 movw r22, r8 2264a: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> 2264e: 75 95 asr r23 22650: 67 95 ror r22 22652: 60 93 1d 06 sts 0x061D, r22 ; 0x80061d soft_pwm_bed = 0; WRITE(HEATER_BED_PIN,LOW); } #endif //BED_LIMIT_SWITCHING if(target==0) 22656: 89 81 ldd r24, Y+1 ; 0x01 22658: 9a 81 ldd r25, Y+2 ; 0x02 2265a: 89 2b or r24, r25 2265c: 11 f4 brne .+4 ; 0x22662 { soft_pwm_bed = 0; 2265e: 10 92 1d 06 sts 0x061D, r1 ; 0x80061d 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); } 22662: 2e 96 adiw r28, 0x0e ; 14 22664: 0f b6 in r0, 0x3f ; 63 22666: f8 94 cli 22668: de bf out 0x3e, r29 ; 62 2266a: 0f be out 0x3f, r0 ; 63 2266c: cd bf out 0x3d, r28 ; 61 2266e: df 91 pop r29 22670: cf 91 pop r28 22672: 1f 91 pop r17 22674: 0f 91 pop r16 22676: ff 90 pop r15 22678: ef 90 pop r14 2267a: df 90 pop r13 2267c: cf 90 pop r12 2267e: bf 90 pop r11 22680: af 90 pop r10 22682: 9f 90 pop r9 22684: 8f 90 pop r8 22686: 7f 90 pop r7 22688: 6f 90 pop r6 2268a: 5f 90 pop r5 2268c: 4f 90 pop r4 2268e: 3f 90 pop r3 22690: 2f 90 pop r2 22692: 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) { 22694: c5 01 movw r24, r10 22696: b4 01 movw r22, r8 22698: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 2269c: 87 ff sbrs r24, 7 2269e: a9 ce rjmp .-686 ; 0x223f2 if (pid_error[e] < 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 226a0: 20 e0 ldi r18, 0x00 ; 0 226a2: 30 e0 ldi r19, 0x00 ; 0 226a4: a9 01 movw r20, r18 226a6: c7 01 movw r24, r14 226a8: b6 01 movw r22, r12 226aa: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 226ae: 87 ff sbrs r24, 7 226b0: a3 cd rjmp .-1210 ; 0x221f8 226b2: a7 01 movw r20, r14 226b4: 96 01 movw r18, r12 226b6: 6d 85 ldd r22, Y+13 ; 0x0d 226b8: 79 85 ldd r23, Y+9 ; 0x09 226ba: 81 2f mov r24, r17 226bc: 90 2f mov r25, r16 226be: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 226c2: 60 93 f1 05 sts 0x05F1, r22 ; 0x8005f1 226c6: 70 93 f2 05 sts 0x05F2, r23 ; 0x8005f2 226ca: 80 93 f3 05 sts 0x05F3, r24 ; 0x8005f3 226ce: 90 93 f4 05 sts 0x05F4, r25 ; 0x8005f4 226d2: 92 cd rjmp .-1244 ; 0x221f8 // 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; 226d4: 10 92 16 05 sts 0x0516, r1 ; 0x800516 <_ZL8soft_pwm.lto_priv.459> 226d8: b1 ce rjmp .-670 ; 0x2243c 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){ 226da: c5 01 movw r24, r10 226dc: b4 01 movw r22, r8 226de: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 226e2: 87 ff sbrs r24, 7 226e4: a6 cf rjmp .-180 ; 0x22632 if (pid_error_bed < 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 226e6: 20 e0 ldi r18, 0x00 ; 0 226e8: 30 e0 ldi r19, 0x00 ; 0 226ea: a9 01 movw r20, r18 226ec: c7 01 movw r24, r14 226ee: b6 01 movw r22, r12 226f0: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 226f4: 87 ff sbrs r24, 7 226f6: 10 c0 rjmp .+32 ; 0x22718 226f8: a7 01 movw r20, r14 226fa: 96 01 movw r18, r12 226fc: 6e 85 ldd r22, Y+14 ; 0x0e 226fe: 7d 85 ldd r23, Y+13 ; 0x0d 22700: 83 2d mov r24, r3 22702: 92 2d mov r25, r2 22704: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 22708: 60 93 fe 05 sts 0x05FE, r22 ; 0x8005fe 2270c: 70 93 ff 05 sts 0x05FF, r23 ; 0x8005ff 22710: 80 93 00 06 sts 0x0600, r24 ; 0x800600 22714: 90 93 01 06 sts 0x0601, r25 ; 0x800601 pid_output=0; 22718: 81 2c mov r8, r1 2271a: 91 2c mov r9, r1 2271c: 54 01 movw r10, r8 2271e: 89 cf rjmp .-238 ; 0x22632 { soft_pwm_bed = (int)pid_output >> 1; } else { soft_pwm_bed = 0; 22720: 10 92 1d 06 sts 0x061D, r1 ; 0x80061d 22724: 98 cf rjmp .-208 ; 0x22656 00022726 : } static void setIsrTargetTemperatures() { for(uint8_t e=0;e 2272a: 90 91 b7 0d lds r25, 0x0DB7 ; 0x800db7 2272e: 90 93 1f 06 sts 0x061F, r25 ; 0x80061f 22732: 80 93 1e 06 sts 0x061E, r24 ; 0x80061e target_temperature_bed_isr = target_temperature_bed; 22736: 80 91 72 06 lds r24, 0x0672 ; 0x800672 2273a: 90 91 73 06 lds r25, 0x0673 ; 0x800673 2273e: 90 93 18 06 sts 0x0618, r25 ; 0x800618 22742: 80 93 17 06 sts 0x0617, r24 ; 0x800617 } 22746: 08 95 ret 00022748 : { // 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) 22748: 81 30 cpi r24, 0x01 ; 1 2274a: 41 f1 breq .+80 ; 0x2279c 2274c: 20 f0 brcs .+8 ; 0x22756 2274e: 82 30 cpi r24, 0x02 ; 2 22750: 09 f4 brne .+2 ; 0x22754 22752: 45 c0 rjmp .+138 ; 0x227de 22754: 08 95 ret { case X_AXIS: { enable_x(); 22756: 17 98 cbi 0x02, 7 ; 2 uint8_t old_x_dir_pin = READ(X_DIR_PIN); //if dualzstepper, both point to same direction. 22758: 80 91 09 01 lds r24, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 2275c: 81 70 andi r24, 0x01 ; 1 uint8_t new_x_dir_pin = (INVERT_X_DIR)^direction; 2275e: 91 e0 ldi r25, 0x01 ; 1 22760: 69 27 eor r22, r25 //setup new step if (new_x_dir_pin != old_x_dir_pin) { 22762: 86 17 cp r24, r22 22764: 59 f0 breq .+22 ; 0x2277c WRITE_NC(X_DIR_PIN, new_x_dir_pin); 22766: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2276a: 66 23 and r22, r22 2276c: 89 f0 breq .+34 ; 0x22790 2276e: 91 60 ori r25, 0x01 ; 1 22770: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> #endif // busy wait __asm__ __volatile__ ( 22774: eb e4 ldi r30, 0x4B ; 75 22776: f0 e0 ldi r31, 0x00 ; 0 22778: 31 97 sbiw r30, 0x01 ; 1 2277a: f1 f7 brne .-4 ; 0x22778 delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(X_AXIS); 2277c: 91 e0 ldi r25, 0x01 ; 1 2277e: 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); 22780: 88 23 and r24, r24 22782: 41 f0 breq .+16 ; 0x22794 22784: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 22788: 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); 2278a: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> } break; default: break; } } 2278e: 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); 22790: 9e 7f andi r25, 0xFE ; 254 22792: ee cf rjmp .-36 ; 0x22770 #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); 22794: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 22798: 8e 7f andi r24, 0xFE ; 254 2279a: f7 cf rjmp .-18 ; 0x2278a } break; case Y_AXIS: { enable_y(); 2279c: 16 98 cbi 0x02, 6 ; 2 uint8_t old_y_dir_pin = READ(Y_DIR_PIN); //if dualzstepper, both point to same direction. 2279e: 90 91 09 01 lds r25, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 227a2: 81 e0 ldi r24, 0x01 ; 1 227a4: 29 2f mov r18, r25 227a6: 22 70 andi r18, 0x02 ; 2 227a8: 91 ff sbrs r25, 1 227aa: 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) { 227ac: 86 17 cp r24, r22 227ae: 59 f0 breq .+22 ; 0x227c6 WRITE_NC(Y_DIR_PIN, new_y_dir_pin); 227b0: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 227b4: 66 23 and r22, r22 227b6: 79 f0 breq .+30 ; 0x227d6 227b8: 82 60 ori r24, 0x02 ; 2 227ba: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 227be: 8b e4 ldi r24, 0x4B ; 75 227c0: 90 e0 ldi r25, 0x00 ; 0 227c2: 01 97 sbiw r24, 0x01 ; 1 227c4: f1 f7 brne .-4 ; 0x227c2 delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(Y_AXIS); 227c6: 82 e0 ldi r24, 0x02 ; 2 227c8: 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); 227ca: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 227ce: 22 23 and r18, r18 227d0: 21 f0 breq .+8 ; 0x227da 227d2: 82 60 ori r24, 0x02 ; 2 227d4: da cf rjmp .-76 ; 0x2278a 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); 227d6: 8d 7f andi r24, 0xFD ; 253 227d8: f0 cf rjmp .-32 ; 0x227ba #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); 227da: 8d 7f andi r24, 0xFD ; 253 227dc: d6 cf rjmp .-84 ; 0x2278a } break; case Z_AXIS: { enable_z(); 227de: 15 98 cbi 0x02, 5 ; 2 uint8_t old_z_dir_pin = READ(Z_DIR_PIN); //if dualzstepper, both point to same direction. 227e0: 90 91 09 01 lds r25, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 227e4: 81 e0 ldi r24, 0x01 ; 1 227e6: 29 2f mov r18, r25 227e8: 24 70 andi r18, 0x04 ; 4 227ea: 92 ff sbrs r25, 2 227ec: 80 e0 ldi r24, 0x00 ; 0 uint8_t new_z_dir_pin = (INVERT_Z_DIR)^direction^BABYSTEP_INVERT_Z; 227ee: 91 e0 ldi r25, 0x01 ; 1 227f0: 69 27 eor r22, r25 //setup new step if (new_z_dir_pin != old_z_dir_pin) { 227f2: 86 17 cp r24, r22 227f4: 59 f0 breq .+22 ; 0x2280c WRITE_NC(Z_DIR_PIN, new_z_dir_pin); 227f6: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 227fa: 66 23 and r22, r22 227fc: 91 f0 breq .+36 ; 0x22822 227fe: 94 60 ori r25, 0x04 ; 4 22800: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 22804: eb e4 ldi r30, 0x4B ; 75 22806: f0 e0 ldi r31, 0x00 ; 0 22808: 31 97 sbiw r30, 0x01 ; 1 2280a: f1 f7 brne .-4 ; 0x22808 #endif delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(Z_AXIS); 2280c: 94 e0 ldi r25, 0x04 ; 4 2280e: 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) { 22810: 86 17 cp r24, r22 22812: 09 f4 brne .+2 ; 0x22816 22814: bc cf rjmp .-136 ; 0x2278e WRITE_NC(Z_DIR_PIN, old_z_dir_pin); 22816: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2281a: 22 23 and r18, r18 2281c: 21 f0 breq .+8 ; 0x22826 2281e: 84 60 ori r24, 0x04 ; 4 22820: b4 cf rjmp .-152 ; 0x2278a 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); 22822: 9b 7f andi r25, 0xFB ; 251 22824: ed cf rjmp .-38 ; 0x22800 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); 22826: 8b 7f andi r24, 0xFB ; 251 22828: b0 cf rjmp .-160 ; 0x2278a 0002282a : } } static void checkRx(void) { if (selectedSerialPort == 0) { 2282a: 80 91 39 05 lds r24, 0x0539 ; 0x800539 2282e: 81 11 cpse r24, r1 22830: 25 c0 rjmp .+74 ; 0x2287c if((M_UCSRxA & (1< 22836: 87 ff sbrs r24, 7 22838: 3d c0 rjmp .+122 ; 0x228b4 // Test for a framing error. if (M_UCSRxA & (1< 2283e: 84 ff sbrs r24, 4 22840: 03 c0 rjmp .+6 ; 0x22848 // 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); 22842: 80 91 c6 00 lds r24, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> 22846: 08 95 ret } else { unsigned char c = M_UDRx; 22848: 40 91 c6 00 lds r20, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> int i = (unsigned int)(rx_buffer.head + 1) % RX_BUFFER_SIZE; 2284c: 20 91 99 04 lds r18, 0x0499 ; 0x800499 22850: 30 91 9a 04 lds r19, 0x049A ; 0x80049a 22854: c9 01 movw r24, r18 22856: 01 96 adiw r24, 0x01 ; 1 22858: 8f 77 andi r24, 0x7F ; 127 2285a: 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) { 2285c: 60 91 9b 04 lds r22, 0x049B ; 0x80049b 22860: 70 91 9c 04 lds r23, 0x049C ; 0x80049c 22864: 86 17 cp r24, r22 22866: 97 07 cpc r25, r23 22868: 29 f1 breq .+74 ; 0x228b4 // 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; 2286a: 27 5e subi r18, 0xE7 ; 231 2286c: 3b 4f sbci r19, 0xFB ; 251 2286e: f9 01 movw r30, r18 22870: 40 83 st Z, r20 rx_buffer.head = i; 22872: 90 93 9a 04 sts 0x049A, r25 ; 0x80049a 22876: 80 93 99 04 sts 0x0499, r24 ; 0x800499 2287a: 1c c0 rjmp .+56 ; 0x228b4 UDR1 = c; #endif //DEBUG_DUMP_TO_2ND_SERIAL } } } else { // if(selectedSerialPort == 1) { if((UCSR1A & (1< 22880: 87 ff sbrs r24, 7 22882: 18 c0 rjmp .+48 ; 0x228b4 // Test for a framing error. if (UCSR1A & (1< 22888: 84 ff sbrs r24, 4 2288a: 03 c0 rjmp .+6 ; 0x22892 // 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); 2288c: 80 91 ce 00 lds r24, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> 22890: 08 95 ret } else { unsigned char c = UDR1; 22892: 40 91 ce 00 lds r20, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> int i = (unsigned int)(rx_buffer.head + 1) % RX_BUFFER_SIZE; 22896: 20 91 99 04 lds r18, 0x0499 ; 0x800499 2289a: 30 91 9a 04 lds r19, 0x049A ; 0x80049a 2289e: c9 01 movw r24, r18 228a0: 01 96 adiw r24, 0x01 ; 1 228a2: 8f 77 andi r24, 0x7F ; 127 228a4: 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) { 228a6: 60 91 9b 04 lds r22, 0x049B ; 0x80049b 228aa: 70 91 9c 04 lds r23, 0x049C ; 0x80049c 228ae: 68 17 cp r22, r24 228b0: 79 07 cpc r23, r25 228b2: d9 f6 brne .-74 ; 0x2286a M_UDRx = c; #endif //DEBUG_DUMP_TO_2ND_SERIAL } } } } 228b4: 08 95 ret 000228b6 : static void Sound_DoSound_Alert(bool bOnce) { uint8_t nI,nMax; nMax=bOnce?1:3; 228b6: 23 e0 ldi r18, 0x03 ; 3 228b8: 81 11 cpse r24, r1 228ba: 21 e0 ldi r18, 0x01 ; 1 for(nI=0;nI 228ce: 94 60 ori r25, 0x04 ; 4 228d0: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 228d4: 3f bf out 0x3f, r19 ; 63 228d6: fb 01 movw r30, r22 228d8: 31 97 sbiw r30, 0x01 ; 1 228da: f1 f7 brne .-4 ; 0x228d8 delayMicroseconds(200); WRITE(BEEPER,LOW); 228dc: 3f b7 in r19, 0x3f ; 63 228de: f8 94 cli 228e0: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 228e4: 9b 7f andi r25, 0xFB ; 251 228e6: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 228ea: 3f bf out 0x3f, r19 ; 63 228ec: fa 01 movw r30, r20 228ee: 31 97 sbiw r30, 0x01 ; 1 228f0: f1 f7 brne .-4 ; 0x228ee 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); } } 228f8: 08 95 ret 000228fa : delayMicroseconds(75); } } static void Sound_DoSound_Echo(void) { 228fa: 8a e0 ldi r24, 0x0A ; 10 228fc: 2b e8 ldi r18, 0x8B ; 139 228fe: 31 e0 ldi r19, 0x01 ; 1 uint8_t nI; for(nI=0;nI<10;nI++) { WRITE(BEEPER,HIGH); 22900: 4f b7 in r20, 0x3f ; 63 22902: f8 94 cli 22904: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 22908: 94 60 ori r25, 0x04 ; 4 2290a: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2290e: 4f bf out 0x3f, r20 ; 63 22910: f9 01 movw r30, r18 22912: 31 97 sbiw r30, 0x01 ; 1 22914: f1 f7 brne .-4 ; 0x22912 delayMicroseconds(100); WRITE(BEEPER,LOW); 22916: 4f b7 in r20, 0x3f ; 63 22918: f8 94 cli 2291a: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2291e: 9b 7f andi r25, 0xFB ; 251 22920: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 22924: 4f bf out 0x3f, r20 ; 63 22926: f9 01 movw r30, r18 22928: 31 97 sbiw r30, 0x01 ; 1 2292a: f1 f7 brne .-4 ; 0x22928 2292c: 81 50 subi r24, 0x01 ; 1 static void Sound_DoSound_Echo(void) { uint8_t nI; for(nI=0;nI<10;nI++) 2292e: 41 f7 brne .-48 ; 0x22900 WRITE(BEEPER,HIGH); delayMicroseconds(100); WRITE(BEEPER,LOW); delayMicroseconds(100); } } 22930: 08 95 ret 00022932 : } //! @brief Send host action "pause" void lcd_pause_usb_print() { SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_ASK_PAUSE); 22932: 89 e0 ldi r24, 0x09 ; 9 22934: 9f e6 ldi r25, 0x6F ; 111 22936: 0c 94 7b 79 jmp 0xf2f6 ; 0xf2f6 0002293a : MENU_END(); } void lcd_set_fan_check() { fans_check_enabled = !fans_check_enabled; 2293a: 60 91 38 02 lds r22, 0x0238 ; 0x800238 2293e: 81 e0 ldi r24, 0x01 ; 1 22940: 68 27 eor r22, r24 22942: 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); 22946: 87 e8 ldi r24, 0x87 ; 135 22948: 9f e0 ldi r25, 0x0F ; 15 2294a: 0f 94 40 dc call 0x3b880 ; 0x3b880 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. 2294e: 80 91 38 02 lds r24, 0x0238 ; 0x800238 22952: 81 11 cpse r24, r1 22954: 02 c0 rjmp .+4 ; 0x2295a 22956: 10 92 e6 03 sts 0x03E6, r1 ; 0x8003e6 #endif //FANCHECK } 2295a: 08 95 ret 0002295c : * 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) { 2295c: af 92 push r10 2295e: bf 92 push r11 22960: cf 92 push r12 22962: df 92 push r13 22964: ef 92 push r14 22966: ff 92 push r15 22968: 0f 93 push r16 2296a: 1f 93 push r17 2296c: cf 93 push r28 2296e: df 93 push r29 22970: 6c 01 movw r12, r24 const char *msgend = msg; bool multi_screen = false; lcd_frame_start(); 22972: 0e 94 94 6e call 0xdd28 ; 0xdd28 * @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; 22976: e6 01 movw r28, r12 bool multi_screen = false; lcd_frame_start(); for (uint8_t row = 0; row < LCD_HEIGHT; ++ row) { 22978: 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; 2297a: e1 2c mov r14, r1 lcd_frame_start(); for (uint8_t row = 0; row < LCD_HEIGHT; ++ row) { lcd_set_cursor(0, row); 2297c: 6f 2d mov r22, r15 2297e: 80 e0 ldi r24, 0x00 ; 0 22980: 0e 94 e0 6e call 0xddc0 ; 0xddc0 // 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) 22984: c6 01 movw r24, r12 22986: 0f 94 1c 10 call 0x22038 ; 0x22038 2298a: 88 23 and r24, r24 2298c: 29 f0 breq .+10 ; 0x22998 2298e: 8f ef ldi r24, 0xFF ; 255 22990: c8 1a sub r12, r24 22992: d8 0a sbc r13, r24 22994: 09 f4 brne .+2 ; 0x22998 22996: 49 c0 rjmp .+146 ; 0x22a2a 22998: c6 01 movw r24, r12 2299a: 0f 94 da d9 call 0x3b3b4 ; 0x3b3b4 <__strlen_P> { // End of the message. break; } uint8_t linelen = min(strlen_P(msg), LCD_WIDTH); 2299e: 84 31 cpi r24, 0x14 ; 20 229a0: 91 05 cpc r25, r1 229a2: 10 f0 brcs .+4 ; 0x229a8 229a4: 84 e1 ldi r24, 0x14 ; 20 229a6: 90 e0 ldi r25, 0x00 ; 0 const char *msgend2 = msg + linelen; 229a8: e6 01 movw r28, r12 229aa: c8 0f add r28, r24 229ac: d9 1f adc r29, r25 msgend = msgend2; if (row == 3 && linelen == LCD_WIDTH) { 229ae: e3 e0 ldi r30, 0x03 ; 3 229b0: fe 12 cpse r15, r30 229b2: 0a c0 rjmp .+20 ; 0x229c8 229b4: 84 31 cpi r24, 0x14 ; 20 229b6: 41 f4 brne .+16 ; 0x229c8 // 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; 229b8: fe 01 movw r30, r28 229ba: 84 91 lpm r24, Z 229bc: e1 2c mov r14, r1 if (multi_screen) 229be: 88 23 and r24, r24 229c0: 19 f0 breq .+6 ; 0x229c8 msgend = (msgend2 -= 2); 229c2: 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; 229c4: ee 24 eor r14, r14 229c6: e3 94 inc r14 if (multi_screen) msgend = (msgend2 -= 2); } if (pgm_read_byte(msgend) != 0 && ! pgm_is_whitespace(msgend) && ! pgm_is_interpunction(msgend)) { 229c8: fe 01 movw r30, r28 229ca: 84 91 lpm r24, Z 229cc: 88 23 and r24, r24 229ce: 09 f4 brne .+2 ; 0x229d2 229d0: 40 c0 rjmp .+128 ; 0x22a52 229d2: ce 01 movw r24, r28 229d4: 0f 94 1c 10 call 0x22038 ; 0x22038 229d8: 81 11 cpse r24, r1 229da: 3b c0 rjmp .+118 ; 0x22a52 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); 229dc: fe 01 movw r30, r28 229de: 84 91 lpm r24, Z return c == '.' || c == ',' || c == ':'|| c == ';' || c == '?' || c == '!' || c == '/'; 229e0: 92 ed ldi r25, 0xD2 ; 210 229e2: 98 0f add r25, r24 229e4: 92 30 cpi r25, 0x02 ; 2 229e6: a8 f1 brcs .+106 ; 0x22a52 229e8: 8c 32 cpi r24, 0x2C ; 44 229ea: 99 f1 breq .+102 ; 0x22a52 229ec: 96 ec ldi r25, 0xC6 ; 198 229ee: 98 0f add r25, r24 229f0: 92 30 cpi r25, 0x02 ; 2 229f2: 78 f1 brcs .+94 ; 0x22a52 229f4: 8f 33 cpi r24, 0x3F ; 63 229f6: 69 f1 breq .+90 ; 0x22a52 229f8: 81 32 cpi r24, 0x21 ; 33 229fa: 59 f1 breq .+86 ; 0x22a52 229fc: 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)) 229fe: c0 16 cp r12, r16 22a00: d1 06 cpc r13, r17 22a02: 58 f4 brcc .+22 ; 0x22a1a 22a04: 58 01 movw r10, r16 22a06: f1 e0 ldi r31, 0x01 ; 1 22a08: af 1a sub r10, r31 22a0a: b1 08 sbc r11, r1 22a0c: c5 01 movw r24, r10 22a0e: 0f 94 1c 10 call 0x22038 ; 0x22038 22a12: 81 11 cpse r24, r1 22a14: 1d c0 rjmp .+58 ; 0x22a50 -- msgend; 22a16: 85 01 movw r16, r10 22a18: f2 cf rjmp .-28 ; 0x229fe if (msgend == msg) 22a1a: c0 16 cp r12, r16 22a1c: d1 06 cpc r13, r17 22a1e: c9 f0 breq .+50 ; 0x22a52 22a20: 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) { 22a22: f3 94 inc r15 22a24: 84 e0 ldi r24, 0x04 ; 4 22a26: f8 12 cpse r15, r24 22a28: a9 cf rjmp .-174 ; 0x2297c } lcd_print(c); } } if (multi_screen) { 22a2a: ee 20 and r14, r14 22a2c: f9 f0 breq .+62 ; 0x22a6c // Display the double down arrow. lcd_putc_at(19, 3, LCD_STR_ARROW_2_DOWN[0]); 22a2e: 48 e8 ldi r20, 0x88 ; 136 22a30: 63 e0 ldi r22, 0x03 ; 3 22a32: 83 e1 ldi r24, 0x13 ; 19 22a34: 0e 94 00 6f call 0xde00 ; 0xde00 } return multi_screen ? msgend : NULL; } 22a38: ce 01 movw r24, r28 22a3a: df 91 pop r29 22a3c: cf 91 pop r28 22a3e: 1f 91 pop r17 22a40: 0f 91 pop r16 22a42: ff 90 pop r15 22a44: ef 90 pop r14 22a46: df 90 pop r13 22a48: cf 90 pop r12 22a4a: bf 90 pop r11 22a4c: af 90 pop r10 22a4e: 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)) 22a50: 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) { 22a52: cc 16 cp r12, r28 22a54: dd 06 cpc r13, r29 22a56: 28 f7 brcc .-54 ; 0x22a22 char c = char(pgm_read_byte(msg)); 22a58: f6 01 movw r30, r12 22a5a: 84 91 lpm r24, Z if (c == '\n') { 22a5c: 8a 30 cpi r24, 0x0A ; 10 22a5e: 09 f3 breq .-62 ; 0x22a22 22a60: 0e 94 8f 6f call 0xdf1e ; 0xdf1e -- msgend; if (msgend == msg) // Found a single long word, which cannot be split. Just cut it. msgend = msgend2; } for (; msg < msgend; ++ msg) { 22a64: ff ef ldi r31, 0xFF ; 255 22a66: cf 1a sub r12, r31 22a68: df 0a sbc r13, r31 22a6a: f3 cf rjmp .-26 ; 0x22a52 if (multi_screen) { // Display the double down arrow. lcd_putc_at(19, 3, LCD_STR_ARROW_2_DOWN[0]); } return multi_screen ? msgend : NULL; 22a6c: d0 e0 ldi r29, 0x00 ; 0 22a6e: c0 e0 ldi r28, 0x00 ; 0 22a70: e3 cf rjmp .-58 ; 0x22a38 00022a72 : #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){ 22a72: cf 93 push r28 22a74: df 93 push r29 22a76: cd b7 in r28, 0x3d ; 61 22a78: de b7 in r29, 0x3e ; 62 22a7a: 2f 97 sbiw r28, 0x0f ; 15 22a7c: 0f b6 in r0, 0x3f ; 63 22a7e: f8 94 cli 22a80: de bf out 0x3e, r29 ; 62 22a82: 0f be out 0x3f, r0 ; 63 22a84: cd bf out 0x3d, r28 ; 61 22a86: fc 01 movw r30, r24 22a88: de 01 movw r26, r28 22a8a: 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; 22a8c: 90 e0 ldi r25, 0x00 ; 0 22a8e: 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); 22a90: 84 91 lpm r24, Z 22a92: 41 e0 ldi r20, 0x01 ; 1 22a94: 49 0f add r20, r25 if( ! b ) 22a96: 88 23 and r24, r24 22a98: 29 f0 breq .+10 ; 0x22aa4 break; dst[i] = b; 22a9a: 8d 93 st X+, r24 22a9c: 31 96 adiw r30, 0x01 ; 1 22a9e: 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 22aa0: 4d 30 cpi r20, 0x0D ; 13 22aa2: b1 f7 brne .-20 ; 0x22a90 uint8_t b = pgm_read_byte(ipgmLabel + i); if( ! b ) break; dst[i] = b; } dst[i] = ':'; // append the colon 22aa4: f9 01 movw r30, r18 22aa6: e9 0f add r30, r25 22aa8: f1 1d adc r31, r1 22aaa: 8a e3 ldi r24, 0x3A ; 58 22aac: 80 83 st Z, r24 ++i; 22aae: 9f 5f subi r25, 0xFF ; 255 22ab0: f9 01 movw r30, r18 22ab2: e9 0f add r30, r25 22ab4: f1 1d adc r31, r1 for(; i < dstSize - 1; ++i) // fill the rest with spaces dst[i] = ' '; 22ab6: 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 22ab8: 9e 30 cpi r25, 0x0E ; 14 22aba: 19 f0 breq .+6 ; 0x22ac2 dst[i] = ' '; 22abc: 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 22abe: 9f 5f subi r25, 0xFF ; 255 22ac0: fb cf rjmp .-10 ; 0x22ab8 dst[i] = ' '; dst[dstSize-1] = '\0'; // terminate the string properly 22ac2: 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 22ac4: 7f 93 push r23 22ac6: 6f 93 push r22 22ac8: 3f 93 push r19 22aca: 2f 93 push r18 22acc: 8c e2 ldi r24, 0x2C ; 44 22ace: 91 ea ldi r25, 0xA1 ; 161 22ad0: 9f 93 push r25 22ad2: 8f 93 push r24 22ad4: 0e 94 b9 6e call 0xdd72 ; 0xdd72 22ad8: 0f 90 pop r0 22ada: 0f 90 pop r0 22adc: 0f 90 pop r0 22ade: 0f 90 pop r0 22ae0: 0f 90 pop r0 22ae2: 0f 90 pop r0 } 22ae4: 2f 96 adiw r28, 0x0f ; 15 22ae6: 0f b6 in r0, 0x3f ; 63 22ae8: f8 94 cli 22aea: de bf out 0x3e, r29 ; 62 22aec: 0f be out 0x3f, r0 ; 63 22aee: cd bf out 0x3d, r28 ; 61 22af0: df 91 pop r29 22af2: cf 91 pop r28 22af4: 08 95 ret 00022af6 : //! |Rear side [µm]: | MSG_BED_CORRECTION_REAR //! |Reset | MSG_BED_CORRECTION_RESET //! ---------------------- //! @endcode void lcd_adjust_bed(void) { 22af6: ef 92 push r14 22af8: ff 92 push r15 22afa: 0f 93 push r16 22afc: 1f 93 push r17 _menu_data_adjust_bed_t* _md = (_menu_data_adjust_bed_t*)&(menu_data[0]); if (_md->status == 0) 22afe: 80 91 b6 03 lds r24, 0x03B6 ; 0x8003b6 22b02: 81 11 cpse r24, r1 22b04: 35 c0 rjmp .+106 ; 0x22b70 { // Menu was entered. if (eeprom_read_byte((unsigned char*)EEPROM_BED_CORRECTION_VALID) == 1) 22b06: 80 ec ldi r24, 0xC0 ; 192 22b08: 9f e0 ldi r25, 0x0F ; 15 22b0a: 0f 94 1c dc call 0x3b838 ; 0x3b838 22b0e: 81 30 cpi r24, 0x01 ; 1 22b10: 61 f5 brne .+88 ; 0x22b6a { _md->left = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_LEFT); 22b12: 8f eb ldi r24, 0xBF ; 191 22b14: 9f e0 ldi r25, 0x0F ; 15 22b16: 0f 94 1c dc call 0x3b838 ; 0x3b838 22b1a: 08 2e mov r0, r24 22b1c: 00 0c add r0, r0 22b1e: 99 0b sbc r25, r25 22b20: 90 93 b8 03 sts 0x03B8, r25 ; 0x8003b8 22b24: 80 93 b7 03 sts 0x03B7, r24 ; 0x8003b7 _md->right = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_RIGHT); 22b28: 8e eb ldi r24, 0xBE ; 190 22b2a: 9f e0 ldi r25, 0x0F ; 15 22b2c: 0f 94 1c dc call 0x3b838 ; 0x3b838 22b30: 08 2e mov r0, r24 22b32: 00 0c add r0, r0 22b34: 99 0b sbc r25, r25 22b36: 90 93 ba 03 sts 0x03BA, r25 ; 0x8003ba 22b3a: 80 93 b9 03 sts 0x03B9, r24 ; 0x8003b9 _md->front = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_FRONT); 22b3e: 8d eb ldi r24, 0xBD ; 189 22b40: 9f e0 ldi r25, 0x0F ; 15 22b42: 0f 94 1c dc call 0x3b838 ; 0x3b838 22b46: 08 2e mov r0, r24 22b48: 00 0c add r0, r0 22b4a: 99 0b sbc r25, r25 22b4c: 90 93 bc 03 sts 0x03BC, r25 ; 0x8003bc 22b50: 80 93 bb 03 sts 0x03BB, r24 ; 0x8003bb _md->rear = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_REAR); 22b54: 8c eb ldi r24, 0xBC ; 188 22b56: 9f e0 ldi r25, 0x0F ; 15 22b58: 0f 94 1c dc call 0x3b838 ; 0x3b838 22b5c: 08 2e mov r0, r24 22b5e: 00 0c add r0, r0 22b60: 99 0b sbc r25, r25 22b62: 90 93 be 03 sts 0x03BE, r25 ; 0x8003be 22b66: 80 93 bd 03 sts 0x03BD, r24 ; 0x8003bd } _md->status = 1; 22b6a: 81 e0 ldi r24, 0x01 ; 1 22b6c: 80 93 b6 03 sts 0x03B6, r24 ; 0x8003b6 } MENU_BEGIN(); 22b70: 0f 94 96 d1 call 0x3a32c ; 0x3a32c 22b74: 10 92 12 05 sts 0x0512, r1 ; 0x800512 22b78: 80 91 12 05 lds r24, 0x0512 ; 0x800512 22b7c: 84 30 cpi r24, 0x04 ; 4 22b7e: 08 f0 brcs .+2 ; 0x22b82 22b80: 6e c0 rjmp .+220 ; 0x22c5e 22b82: 10 92 15 05 sts 0x0515, r1 ; 0x800515 // leaving menu - this condition must be immediately before MENU_ITEM_BACK_P ON_MENU_LEAVE( 22b86: 0f 94 16 d0 call 0x3a02c ; 0x3a02c 22b8a: 88 23 and r24, r24 22b8c: e9 f0 breq .+58 ; 0x22bc8 22b8e: 60 91 b7 03 lds r22, 0x03B7 ; 0x8003b7 22b92: 8f eb ldi r24, 0xBF ; 191 22b94: 9f e0 ldi r25, 0x0F ; 15 22b96: 0f 94 40 dc call 0x3b880 ; 0x3b880 22b9a: 60 91 bb 03 lds r22, 0x03BB ; 0x8003bb 22b9e: 8d eb ldi r24, 0xBD ; 189 22ba0: 9f e0 ldi r25, 0x0F ; 15 22ba2: 0f 94 40 dc call 0x3b880 ; 0x3b880 22ba6: 60 91 bd 03 lds r22, 0x03BD ; 0x8003bd 22baa: 8c eb ldi r24, 0xBC ; 188 22bac: 9f e0 ldi r25, 0x0F ; 15 22bae: 0f 94 40 dc call 0x3b880 ; 0x3b880 22bb2: 60 91 b9 03 lds r22, 0x03B9 ; 0x8003b9 22bb6: 8e eb ldi r24, 0xBE ; 190 22bb8: 9f e0 ldi r25, 0x0F ; 15 22bba: 0f 94 40 dc call 0x3b880 ; 0x3b880 22bbe: 61 e0 ldi r22, 0x01 ; 1 22bc0: 80 ec ldi r24, 0xC0 ; 192 22bc2: 9f e0 ldi r25, 0x0F ; 15 22bc4: 0f 94 40 dc call 0x3b880 ; 0x3b880 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)); 22bc8: 8c eb ldi r24, 0xBC ; 188 22bca: 99 e4 ldi r25, 0x49 ; 73 22bcc: 0e 94 ac 72 call 0xe558 ; 0xe558 22bd0: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_LEFT), &_md->left, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 22bd4: 86 e9 ldi r24, 0x96 ; 150 22bd6: 91 e5 ldi r25, 0x51 ; 81 22bd8: 0e 94 ac 72 call 0xe558 ; 0xe558 22bdc: f1 2c mov r15, r1 22bde: e1 2c mov r14, r1 22be0: 04 e6 ldi r16, 0x64 ; 100 22be2: 10 e0 ldi r17, 0x00 ; 0 22be4: 2c e9 ldi r18, 0x9C ; 156 22be6: 3f ef ldi r19, 0xFF ; 255 22be8: 40 e1 ldi r20, 0x10 ; 16 22bea: 67 eb ldi r22, 0xB7 ; 183 22bec: 73 e0 ldi r23, 0x03 ; 3 22bee: 0f 94 e6 d1 call 0x3a3cc ; 0x3a3cc MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_RIGHT), &_md->right, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 22bf2: 85 e8 ldi r24, 0x85 ; 133 22bf4: 91 e5 ldi r25, 0x51 ; 81 22bf6: 0e 94 ac 72 call 0xe558 ; 0xe558 22bfa: 2c e9 ldi r18, 0x9C ; 156 22bfc: 3f ef ldi r19, 0xFF ; 255 22bfe: 40 e1 ldi r20, 0x10 ; 16 22c00: 69 eb ldi r22, 0xB9 ; 185 22c02: 73 e0 ldi r23, 0x03 ; 3 22c04: 0f 94 e6 d1 call 0x3a3cc ; 0x3a3cc MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_FRONT), &_md->front, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 22c08: 84 e7 ldi r24, 0x74 ; 116 22c0a: 91 e5 ldi r25, 0x51 ; 81 22c0c: 0e 94 ac 72 call 0xe558 ; 0xe558 22c10: 2c e9 ldi r18, 0x9C ; 156 22c12: 3f ef ldi r19, 0xFF ; 255 22c14: 40 e1 ldi r20, 0x10 ; 16 22c16: 6b eb ldi r22, 0xBB ; 187 22c18: 73 e0 ldi r23, 0x03 ; 3 22c1a: 0f 94 e6 d1 call 0x3a3cc ; 0x3a3cc MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_REAR), &_md->rear, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 22c1e: 83 e6 ldi r24, 0x63 ; 99 22c20: 91 e5 ldi r25, 0x51 ; 81 22c22: 0e 94 ac 72 call 0xe558 ; 0xe558 22c26: 2c e9 ldi r18, 0x9C ; 156 22c28: 3f ef ldi r19, 0xFF ; 255 22c2a: 40 e1 ldi r20, 0x10 ; 16 22c2c: 6d eb ldi r22, 0xBD ; 189 22c2e: 73 e0 ldi r23, 0x03 ; 3 22c30: 0f 94 e6 d1 call 0x3a3cc ; 0x3a3cc MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_adjust_bed_reset); 22c34: 8f ee ldi r24, 0xEF ; 239 22c36: 95 e4 ldi r25, 0x45 ; 69 22c38: 0e 94 ac 72 call 0xe558 ; 0xe558 22c3c: 6c ed ldi r22, 0xDC ; 220 22c3e: 79 e3 ldi r23, 0x39 ; 57 22c40: 0f 94 13 d1 call 0x3a226 ; 0x3a226 MENU_END(); 22c44: 0f 94 6a d1 call 0x3a2d4 ; 0x3a2d4 _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(); 22c48: 80 91 12 05 lds r24, 0x0512 ; 0x800512 22c4c: 8f 5f subi r24, 0xFF ; 255 22c4e: 80 93 12 05 sts 0x0512, r24 ; 0x800512 22c52: 80 91 14 05 lds r24, 0x0514 ; 0x800514 22c56: 8f 5f subi r24, 0xFF ; 255 22c58: 80 93 14 05 sts 0x0514, r24 ; 0x800514 22c5c: 8d cf rjmp .-230 ; 0x22b78 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(); } 22c5e: 1f 91 pop r17 22c60: 0f 91 pop r16 22c62: ff 90 pop r15 22c64: ef 90 pop r14 22c66: 08 95 ret 00022c68 : } } #endif //MMU_HAS_CUTTER bool shouldPreheatOnlyNozzle() { uint8_t eeprom_setting = eeprom_read_byte((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT); 22c68: 87 ea ldi r24, 0xA7 ; 167 22c6a: 9c e0 ldi r25, 0x0C ; 12 22c6c: 0f 94 1c dc call 0x3b838 ; 0x3b838 if (eeprom_setting != 0) 22c70: 81 11 cpse r24, r1 22c72: 05 c0 rjmp .+10 ; 0x22c7e return false; switch(eFilamentAction) { 22c74: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 22c78: 81 50 subi r24, 0x01 ; 1 22c7a: 88 30 cpi r24, 0x08 ; 8 22c7c: 10 f0 brcs .+4 ; 0x22c82 #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; 22c7e: 80 e0 ldi r24, 0x00 ; 0 22c80: 08 95 ret case FilamentAction::MmuLoad: case FilamentAction::MmuUnLoad: case FilamentAction::MmuLoadingTest: case FilamentAction::MmuEject: case FilamentAction::MmuCut: return true; 22c82: 81 e0 ldi r24, 0x01 ; 1 default: return false; } } 22c84: 08 95 ret 00022c86 : } #ifdef MMU_HAS_CUTTER void lcd_cutter_enabled() { if (EEPROM_MMU_CUTTER_ENABLED_enabled == eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED)) 22c86: 8e ec ldi r24, 0xCE ; 206 22c88: 9e e0 ldi r25, 0x0E ; 14 22c8a: 0f 94 1c dc call 0x3b838 ; 0x3b838 22c8e: 60 e0 ldi r22, 0x00 ; 0 22c90: 81 30 cpi r24, 0x01 ; 1 22c92: 09 f0 breq .+2 ; 0x22c96 22c94: 61 e0 ldi r22, 0x01 ; 1 22c96: 8e ec ldi r24, 0xCE ; 206 22c98: 9e e0 ldi r25, 0x0E ; 14 22c9a: 0d 94 40 dc jmp 0x3b880 ; 0x3b880 00022c9e : } } void SpoolJoin::toggleSpoolJoin() { if (eeprom_read_byte((uint8_t*)EEPROM_SPOOL_JOIN) == (uint8_t)EEPROM::Disabled) 22c9e: 86 ed ldi r24, 0xD6 ; 214 22ca0: 9e e0 ldi r25, 0x0E ; 14 22ca2: 0f 94 1c dc call 0x3b838 ; 0x3b838 22ca6: 61 e0 ldi r22, 0x01 ; 1 22ca8: 82 30 cpi r24, 0x02 ; 2 22caa: 09 f0 breq .+2 ; 0x22cae 22cac: 62 e0 ldi r22, 0x02 ; 2 22cae: 86 ed ldi r24, 0xD6 ; 214 22cb0: 9e e0 ldi r25, 0x0E ; 14 22cb2: 0d 94 40 dc jmp 0x3b880 ; 0x3b880 00022cb6 : } _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(); 22cb6: 0e 94 98 76 call 0xed30 ; 0xed30 _menu_data_adjust_bed_t* _md = (_menu_data_adjust_bed_t*)&(menu_data[0]); _md->status = 0; 22cba: 10 92 b6 03 sts 0x03B6, r1 ; 0x8003b6 } 22cbe: 08 95 ret 00022cc0 : } #ifdef FILAMENT_SENSOR static void lcd_menu_AutoLoadFilament() { lcd_display_message_fullscreen_nonBlocking_P(_T(MSG_AUTOLOADING_ENABLED)); 22cc0: 82 e4 ldi r24, 0x42 ; 66 22cc2: 90 e5 ldi r25, 0x50 ; 80 22cc4: 0e 94 ac 72 call 0xe558 ; 0xe558 22cc8: 0f 94 ae 14 call 0x2295c ; 0x2295c menu_back_if_clicked(); 22ccc: 0d 94 00 d5 jmp 0x3aa00 ; 0x3aa00 00022cd0 : //! | | //! | | //! ---------------------- //! @endcode void lcd_menu_extruder_info() // NOT static due to using inside "Marlin_main" module ("manage_inactivity()") { 22cd0: df 92 push r13 22cd2: ef 92 push r14 22cd4: ff 92 push r15 22cd6: 0f 93 push r16 22cd8: 1f 93 push r17 22cda: cf 93 push r28 22cdc: df 93 push r29 22cde: 10 92 dc 03 sts 0x03DC, r1 ; 0x8003dc lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 22ce2: 0e 94 0c 6f call 0xde18 ; 0xde18 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] ); 22ce6: c9 ec ldi r28, 0xC9 ; 201 22ce8: d3 e0 ldi r29, 0x03 ; 3 22cea: 8a 81 ldd r24, Y+2 ; 0x02 22cec: 9b 81 ldd r25, Y+3 ; 0x03 22cee: 2c e3 ldi r18, 0x3C ; 60 22cf0: f2 2e mov r15, r18 22cf2: f8 9e mul r15, r24 22cf4: 80 01 movw r16, r0 22cf6: f9 9e mul r15, r25 22cf8: 10 0d add r17, r0 22cfa: 11 24 eor r1, r1 22cfc: 83 ef ldi r24, 0xF3 ; 243 22cfe: 98 e4 ldi r25, 0x48 ; 72 22d00: 0e 94 ac 72 call 0xe558 ; 0xe558 22d04: e8 2e mov r14, r24 22d06: d9 2e mov r13, r25 22d08: 88 81 ld r24, Y 22d0a: 99 81 ldd r25, Y+1 ; 0x01 22d0c: f8 9e mul r15, r24 22d0e: e0 01 movw r28, r0 22d10: f9 9e mul r15, r25 22d12: d0 0d add r29, r0 22d14: 11 24 eor r1, r1 22d16: 80 e0 ldi r24, 0x00 ; 0 22d18: 99 e4 ldi r25, 0x49 ; 73 22d1a: 0e 94 ac 72 call 0xe558 ; 0xe558 22d1e: 1f 93 push r17 22d20: 0f 93 push r16 22d22: df 92 push r13 22d24: ef 92 push r14 22d26: df 93 push r29 22d28: cf 93 push r28 22d2a: 9f 93 push r25 22d2c: 8f 93 push r24 22d2e: 80 e9 ldi r24, 0x90 ; 144 22d30: 90 ea ldi r25, 0xA0 ; 160 22d32: 9f 93 push r25 22d34: 8f 93 push r24 22d36: 0e 94 b9 6e call 0xdd72 ; 0xdd72 menu_back_if_clicked(); 22d3a: 8d b7 in r24, 0x3d ; 61 22d3c: 9e b7 in r25, 0x3e ; 62 22d3e: 0a 96 adiw r24, 0x0a ; 10 22d40: 0f b6 in r0, 0x3f ; 63 22d42: f8 94 cli 22d44: 9e bf out 0x3e, r25 ; 62 22d46: 0f be out 0x3f, r0 ; 63 22d48: 8d bf out 0x3d, r24 ; 61 } 22d4a: df 91 pop r29 22d4c: cf 91 pop r28 22d4e: 1f 91 pop r17 22d50: 0f 91 pop r16 22d52: ff 90 pop r15 22d54: ef 90 pop r14 22d56: 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(); 22d58: 0d 94 00 d5 jmp 0x3aa00 ; 0x3aa00 00022d5c : //! | PINDA: 000D| MSG_PINDA c=14 //! ---------------------- //! D - Degree sysmbol LCD_STR_DEGREE //! @endcode static void lcd_menu_temperatures() { 22d5c: cf 92 push r12 22d5e: df 92 push r13 22d60: ef 92 push r14 22d62: ff 92 push r15 22d64: 10 92 dc 03 sts 0x03DC, r1 ; 0x8003dc lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 22d68: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_menu_temperatures_line( _T(MSG_NOZZLE), (int)current_temperature[0] ); 22d6c: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 22d70: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 22d74: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 22d78: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 22d7c: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> 22d80: 6b 01 movw r12, r22 22d82: 80 e1 ldi r24, 0x10 ; 16 22d84: 94 e4 ldi r25, 0x44 ; 68 22d86: 0e 94 ac 72 call 0xe558 ; 0xe558 22d8a: b6 01 movw r22, r12 22d8c: 0f 94 39 15 call 0x22a72 ; 0x22a72 lcd_menu_temperatures_line( _T(MSG_BED), (int)current_temperature_bed ); 22d90: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee 22d94: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef 22d98: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 22d9c: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 22da0: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> 22da4: 6b 01 movw r12, r22 22da6: 85 ef ldi r24, 0xF5 ; 245 22da8: 93 e4 ldi r25, 0x43 ; 67 22daa: 0e 94 ac 72 call 0xe558 ; 0xe558 22dae: b6 01 movw r22, r12 22db0: 0f 94 39 15 call 0x22a72 ; 0x22a72 #ifdef AMBIENT_THERMISTOR lcd_menu_temperatures_line( _T(MSG_AMBIENT), (int)current_temperature_ambient ); 22db4: 60 91 56 06 lds r22, 0x0656 ; 0x800656 22db8: 70 91 57 06 lds r23, 0x0657 ; 0x800657 22dbc: 80 91 58 06 lds r24, 0x0658 ; 0x800658 22dc0: 90 91 59 06 lds r25, 0x0659 ; 0x800659 22dc4: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> 22dc8: 6b 01 movw r12, r22 22dca: 8d ed ldi r24, 0xDD ; 221 22dcc: 9e e4 ldi r25, 0x4E ; 78 22dce: 0e 94 ac 72 call 0xe558 ; 0xe558 22dd2: b6 01 movw r22, r12 22dd4: 0f 94 39 15 call 0x22a72 ; 0x22a72 #endif //AMBIENT_THERMISTOR #ifdef PINDA_THERMISTOR lcd_menu_temperatures_line(MSG_PINDA, (int)current_temperature_pinda ); ////MSG_PINDA 22dd8: 60 91 99 03 lds r22, 0x0399 ; 0x800399 22ddc: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 22de0: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 22de4: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 22de8: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> 22dec: 86 e7 ldi r24, 0x76 ; 118 22dee: 9a e6 ldi r25, 0x6A ; 106 22df0: 0f 94 39 15 call 0x22a72 ; 0x22a72 #endif //PINDA_THERMISTOR menu_back_if_clicked(); } 22df4: ff 90 pop r15 22df6: ef 90 pop r14 22df8: df 90 pop r13 22dfa: 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(); 22dfc: 0d 94 00 d5 jmp 0x3aa00 ; 0x3aa00 00022e00 : //! | Bed: 00.0V | c=12 //! | IR : 00.0V | c=12 optional //! ---------------------- //! @endcode static void lcd_menu_voltages() { 22e00: cf 92 push r12 22e02: df 92 push r13 22e04: ef 92 push r14 22e06: ff 92 push r15 22e08: 0f 93 push r16 22e0a: 1f 93 push r17 22e0c: cf 93 push r28 22e0e: df 93 push r29 22e10: 10 92 dc 03 sts 0x03DC, r1 ; 0x8003dc lcd_timeoutToStatus.stop(); //infinite timeout float volt_pwr = VOLT_DIV_REF * ((float)current_voltage_raw_pwr / (1023 * OVERSAMPLENR)) / VOLT_DIV_FAC; 22e14: 60 91 5c 06 lds r22, 0x065C ; 0x80065c 22e18: 70 91 5d 06 lds r23, 0x065D ; 0x80065d 22e1c: 07 2e mov r0, r23 22e1e: 00 0c add r0, r0 22e20: 88 0b sbc r24, r24 22e22: 99 0b sbc r25, r25 22e24: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 22e28: 20 e0 ldi r18, 0x00 ; 0 22e2a: 30 ec ldi r19, 0xC0 ; 192 22e2c: 4f e7 ldi r20, 0x7F ; 127 22e2e: 56 e4 ldi r21, 0x46 ; 70 22e30: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 22e34: 20 e0 ldi r18, 0x00 ; 0 22e36: 30 e0 ldi r19, 0x00 ; 0 22e38: 40 ea ldi r20, 0xA0 ; 160 22e3a: 50 e4 ldi r21, 0x40 ; 64 22e3c: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 22e40: 27 ed ldi r18, 0xD7 ; 215 22e42: 30 e3 ldi r19, 0x30 ; 48 22e44: 44 e4 ldi r20, 0x44 ; 68 22e46: 5e e3 ldi r21, 0x3E ; 62 22e48: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 22e4c: eb 01 movw r28, r22 22e4e: 18 2f mov r17, r24 22e50: 09 2f mov r16, r25 float volt_bed = VOLT_DIV_REF * ((float)current_voltage_raw_bed / (1023 * OVERSAMPLENR)) / VOLT_DIV_FAC; 22e52: 60 91 5a 06 lds r22, 0x065A ; 0x80065a 22e56: 70 91 5b 06 lds r23, 0x065B ; 0x80065b 22e5a: 07 2e mov r0, r23 22e5c: 00 0c add r0, r0 22e5e: 88 0b sbc r24, r24 22e60: 99 0b sbc r25, r25 22e62: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 22e66: 20 e0 ldi r18, 0x00 ; 0 22e68: 30 ec ldi r19, 0xC0 ; 192 22e6a: 4f e7 ldi r20, 0x7F ; 127 22e6c: 56 e4 ldi r21, 0x46 ; 70 22e6e: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 22e72: 20 e0 ldi r18, 0x00 ; 0 22e74: 30 e0 ldi r19, 0x00 ; 0 22e76: 40 ea ldi r20, 0xA0 ; 160 22e78: 50 e4 ldi r21, 0x40 ; 64 22e7a: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 22e7e: 27 ed ldi r18, 0xD7 ; 215 22e80: 30 e3 ldi r19, 0x30 ; 48 22e82: 44 e4 ldi r20, 0x44 ; 68 22e84: 5e e3 ldi r21, 0x3E ; 62 22e86: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 22e8a: f6 2e mov r15, r22 22e8c: e7 2e mov r14, r23 22e8e: d8 2e mov r13, r24 22e90: c9 2e mov r12, r25 lcd_home(); 22e92: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_printf_P(PSTR(" PWR: %4.1fV\n" " BED: %4.1fV"), volt_pwr, volt_bed); 22e96: cf 92 push r12 22e98: df 92 push r13 22e9a: ef 92 push r14 22e9c: ff 92 push r15 22e9e: 0f 93 push r16 22ea0: 1f 93 push r17 22ea2: df 93 push r29 22ea4: cf 93 push r28 22ea6: 86 e3 ldi r24, 0x36 ; 54 22ea8: 91 ea ldi r25, 0xA1 ; 161 22eaa: 9f 93 push r25 22eac: 8f 93 push r24 22eae: 0e 94 b9 6e call 0xdd72 ; 0xdd72 #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(); 22eb2: 8d b7 in r24, 0x3d ; 61 22eb4: 9e b7 in r25, 0x3e ; 62 22eb6: 0a 96 adiw r24, 0x0a ; 10 22eb8: 0f b6 in r0, 0x3f ; 63 22eba: f8 94 cli 22ebc: 9e bf out 0x3e, r25 ; 62 22ebe: 0f be out 0x3f, r0 ; 63 22ec0: 8d bf out 0x3d, r24 ; 61 } 22ec2: df 91 pop r29 22ec4: cf 91 pop r28 22ec6: 1f 91 pop r17 22ec8: 0f 91 pop r16 22eca: ff 90 pop r15 22ecc: ef 90 pop r14 22ece: df 90 pop r13 22ed0: 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(); 22ed2: 0d 94 00 d5 jmp 0x3aa00 ; 0x3aa00 00022ed6 : //! | 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() { 22ed6: af 92 push r10 22ed8: bf 92 push r11 22eda: cf 92 push r12 22edc: df 92 push r13 22ede: ef 92 push r14 22ee0: ff 92 push r15 22ee2: 0f 93 push r16 22ee4: 1f 93 push r17 22ee6: cf 93 push r28 22ee8: df 93 push r29 22eea: 10 92 dc 03 sts 0x03DC, r1 ; 0x8003dc lcd_timeoutToStatus.stop(); //infinite timeout uint8_t power = eeprom_read_byte((uint8_t*)EEPROM_POWER_COUNT); 22eee: 84 e6 ldi r24, 0x64 ; 100 22ef0: 9f e0 ldi r25, 0x0F ; 15 22ef2: 0f 94 1c dc call 0x3b838 ; 0x3b838 22ef6: 18 2f mov r17, r24 uint8_t filam = eeprom_read_byte((uint8_t*)EEPROM_FERROR_COUNT); 22ef8: 85 e6 ldi r24, 0x65 ; 101 22efa: 9f e0 ldi r25, 0x0F ; 15 22efc: 0f 94 1c dc call 0x3b838 ; 0x3b838 22f00: e8 2e mov r14, r24 uint8_t crashX = eeprom_read_byte((uint8_t*)EEPROM_CRASH_COUNT_X); 22f02: 86 e6 ldi r24, 0x66 ; 102 22f04: 9f e0 ldi r25, 0x0F ; 15 22f06: 0f 94 1c dc call 0x3b838 ; 0x3b838 22f0a: b8 2e mov r11, r24 uint8_t crashY = eeprom_read_byte((uint8_t*)EEPROM_CRASH_COUNT_Y); 22f0c: 88 e6 ldi r24, 0x68 ; 104 22f0e: 9f e0 ldi r25, 0x0F ; 15 22f10: 0f 94 1c dc call 0x3b838 ; 0x3b838 22f14: a8 2e mov r10, r24 lcd_home(); 22f16: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_printf_P(failStatsFmt, 22f1a: 80 ec ldi r24, 0xC0 ; 192 22f1c: 9e e4 ldi r25, 0x4E ; 78 22f1e: 0e 94 ac 72 call 0xe558 ; 0xe558 22f22: d8 2e mov r13, r24 22f24: c9 2e mov r12, r25 22f26: 81 eb ldi r24, 0xB1 ; 177 22f28: 9e e4 ldi r25, 0x4E ; 78 22f2a: 0e 94 ac 72 call 0xe558 ; 0xe558 22f2e: 08 2f mov r16, r24 22f30: f9 2e mov r15, r25 22f32: 80 ea ldi r24, 0xA0 ; 160 22f34: 9e e4 ldi r25, 0x4E ; 78 22f36: 0e 94 ac 72 call 0xe558 ; 0xe558 22f3a: ec 01 movw r28, r24 22f3c: 8a e8 ldi r24, 0x8A ; 138 22f3e: 9e e4 ldi r25, 0x4E ; 78 22f40: 0e 94 ac 72 call 0xe558 ; 0xe558 22f44: 1f 92 push r1 22f46: af 92 push r10 22f48: 1f 92 push r1 22f4a: bf 92 push r11 22f4c: cf 92 push r12 22f4e: df 92 push r13 22f50: 1f 92 push r1 22f52: ef 92 push r14 22f54: ff 92 push r15 22f56: 0f 93 push r16 22f58: 1f 92 push r1 22f5a: 1f 93 push r17 22f5c: df 93 push r29 22f5e: cf 93 push r28 22f60: 9f 93 push r25 22f62: 8f 93 push r24 22f64: 87 ef ldi r24, 0xF7 ; 247 22f66: 90 ea ldi r25, 0xA0 ; 160 22f68: 9f 93 push r25 22f6a: 8f 93 push r24 22f6c: 0e 94 b9 6e call 0xdd72 ; 0xdd72 _T(MSG_LAST_PRINT_FAILURES), _T(MSG_POWER_FAILURES), power, _T(MSG_FIL_RUNOUTS), filam, _T(MSG_CRASH), crashX, crashY); menu_back_if_clicked(); 22f70: 8d b7 in r24, 0x3d ; 61 22f72: 9e b7 in r25, 0x3e ; 62 22f74: 42 96 adiw r24, 0x12 ; 18 22f76: 0f b6 in r0, 0x3f ; 63 22f78: f8 94 cli 22f7a: 9e bf out 0x3e, r25 ; 62 22f7c: 0f be out 0x3f, r0 ; 63 22f7e: 8d bf out 0x3d, r24 ; 61 } 22f80: df 91 pop r29 22f82: cf 91 pop r28 22f84: 1f 91 pop r17 22f86: 0f 91 pop r16 22f88: ff 90 pop r15 22f8a: ef 90 pop r14 22f8c: df 90 pop r13 22f8e: cf 90 pop r12 22f90: bf 90 pop r11 22f92: 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(); 22f94: 0d 94 00 d5 jmp 0x3aa00 ; 0x3aa00 00022f98 : //! | 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() { 22f98: cf 92 push r12 22f9a: df 92 push r13 22f9c: ef 92 push r14 22f9e: ff 92 push r15 22fa0: 0f 93 push r16 22fa2: 1f 93 push r17 22fa4: cf 93 push r28 22fa6: df 93 push r29 22fa8: 10 92 dc 03 sts 0x03DC, r1 ; 0x8003dc lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 22fac: 0e 94 0c 6f call 0xde18 ; 0xde18 " %-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) )); 22fb0: 8f ec ldi r24, 0xCF ; 207 22fb2: 9e e0 ldi r25, 0x0E ; 14 22fb4: 0f 94 1c dc call 0x3b838 ; 0x3b838 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu_print() { lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); lcd_printf_P( 22fb8: 90 e0 ldi r25, 0x00 ; 0 22fba: 0f 94 2b 10 call 0x22056 ; 0x22056 22fbe: d8 2e mov r13, r24 22fc0: c9 2e mov r12, r25 22fc2: 83 e4 ldi r24, 0x43 ; 67 22fc4: 9e e4 ldi r25, 0x4E ; 78 22fc6: 0e 94 ac 72 call 0xe558 ; 0xe558 22fca: f8 2e mov r15, r24 22fcc: 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) ), 22fce: 82 ed ldi r24, 0xD2 ; 210 22fd0: 9e e0 ldi r25, 0x0E ; 14 22fd2: 0f 94 1c dc call 0x3b838 ; 0x3b838 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu_print() { lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); lcd_printf_P( 22fd6: 90 e0 ldi r25, 0x00 ; 0 22fd8: 0f 94 2b 10 call 0x22056 ; 0x22056 22fdc: 18 2f mov r17, r24 22fde: 09 2f mov r16, r25 22fe0: 87 e3 ldi r24, 0x37 ; 55 22fe2: 9e e4 ldi r25, 0x4E ; 78 22fe4: 0e 94 ac 72 call 0xe558 ; 0xe558 22fe8: ec 01 movw r28, r24 22fea: 8a e8 ldi r24, 0x8A ; 138 22fec: 9e e4 ldi r25, 0x4E ; 78 22fee: 0e 94 ac 72 call 0xe558 ; 0xe558 22ff2: cf 92 push r12 22ff4: df 92 push r13 22ff6: ef 92 push r14 22ff8: ff 92 push r15 22ffa: 0f 93 push r16 22ffc: 1f 93 push r17 22ffe: df 93 push r29 23000: cf 93 push r28 23002: 9f 93 push r25 23004: 8f 93 push r24 23006: 8b ea ldi r24, 0xAB ; 171 23008: 90 ea ldi r25, 0xA0 ; 160 2300a: 9f 93 push r25 2300c: 8f 93 push r24 2300e: 0e 94 b9 6e call 0xdd72 ; 0xdd72 " %-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(); 23012: 8d b7 in r24, 0x3d ; 61 23014: 9e b7 in r25, 0x3e ; 62 23016: 0c 96 adiw r24, 0x0c ; 12 23018: 0f b6 in r0, 0x3f ; 63 2301a: f8 94 cli 2301c: 9e bf out 0x3e, r25 ; 62 2301e: 0f be out 0x3f, r0 ; 63 23020: 8d bf out 0x3d, r24 ; 61 } 23022: df 91 pop r29 23024: cf 91 pop r28 23026: 1f 91 pop r17 23028: 0f 91 pop r16 2302a: ff 90 pop r15 2302c: ef 90 pop r14 2302e: df 90 pop r13 23030: 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(); 23032: 0d 94 00 d5 jmp 0x3aa00 ; 0x3aa00 00023036 : //! | Y: 000 | //! | | //! ---------------------- //! @endcode static void lcd_menu_belt_status() { 23036: 0f 93 push r16 23038: 1f 93 push r17 2303a: cf 93 push r28 2303c: df 93 push r29 lcd_home(); 2303e: 0e 94 0c 6f call 0xde18 ; 0xde18 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))); 23042: 8b e5 ldi r24, 0x5B ; 91 23044: 9f e0 ldi r25, 0x0F ; 15 23046: 0f 94 2a dc call 0x3b854 ; 0x3b854 2304a: 18 2f mov r17, r24 2304c: 09 2f mov r16, r25 2304e: 8d e5 ldi r24, 0x5D ; 93 23050: 9f e0 ldi r25, 0x0F ; 15 23052: 0f 94 2a dc call 0x3b854 ; 0x3b854 23056: ec 01 movw r28, r24 23058: 81 e0 ldi r24, 0x01 ; 1 2305a: 9f e4 ldi r25, 0x4F ; 79 2305c: 0e 94 ac 72 call 0xe558 ; 0xe558 23060: 0f 93 push r16 23062: 1f 93 push r17 23064: df 93 push r29 23066: cf 93 push r28 23068: 9f 93 push r25 2306a: 8f 93 push r24 2306c: 8a e5 ldi r24, 0x5A ; 90 2306e: 91 ea ldi r25, 0xA1 ; 161 23070: 9f 93 push r25 23072: 8f 93 push r24 23074: 0e 94 b9 6e call 0xdd72 ; 0xdd72 menu_back_if_clicked(); 23078: 8d b7 in r24, 0x3d ; 61 2307a: 9e b7 in r25, 0x3e ; 62 2307c: 08 96 adiw r24, 0x08 ; 8 2307e: 0f b6 in r0, 0x3f ; 63 23080: f8 94 cli 23082: 9e bf out 0x3e, r25 ; 62 23084: 0f be out 0x3f, r0 ; 63 23086: 8d bf out 0x3d, r24 ; 61 } 23088: df 91 pop r29 2308a: cf 91 pop r28 2308c: 1f 91 pop r17 2308e: 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(); 23090: 0d 94 00 d5 jmp 0x3aa00 ; 0x3aa00 00023094 : //! | 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() { 23094: 6f 92 push r6 23096: 7f 92 push r7 23098: 8f 92 push r8 2309a: 9f 92 push r9 2309c: af 92 push r10 2309e: bf 92 push r11 230a0: cf 92 push r12 230a2: df 92 push r13 230a4: ef 92 push r14 230a6: ff 92 push r15 230a8: 0f 93 push r16 230aa: 1f 93 push r17 230ac: cf 93 push r28 230ae: df 93 push r29 230b0: 10 92 dc 03 sts 0x03DC, r1 ; 0x8003dc lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 230b4: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_printf_P(failStatsFmt, 230b8: 83 e0 ldi r24, 0x03 ; 3 230ba: 9f e0 ldi r25, 0x0F ; 15 230bc: 0f 94 2a dc call 0x3b854 ; 0x3b854 230c0: 0f 94 2b 10 call 0x22056 ; 0x22056 230c4: 78 2e mov r7, r24 230c6: 69 2e mov r6, r25 230c8: 85 e0 ldi r24, 0x05 ; 5 230ca: 9f e0 ldi r25, 0x0F ; 15 230cc: 0f 94 2a dc call 0x3b854 ; 0x3b854 230d0: 0f 94 2b 10 call 0x22056 ; 0x22056 230d4: 98 2e mov r9, r24 230d6: 89 2e mov r8, r25 230d8: 80 ec ldi r24, 0xC0 ; 192 230da: 9e e4 ldi r25, 0x4E ; 78 230dc: 0e 94 ac 72 call 0xe558 ; 0xe558 230e0: b8 2e mov r11, r24 230e2: a9 2e mov r10, r25 230e4: 81 e0 ldi r24, 0x01 ; 1 230e6: 9f e0 ldi r25, 0x0F ; 15 230e8: 0f 94 2a dc call 0x3b854 ; 0x3b854 230ec: 0f 94 2b 10 call 0x22056 ; 0x22056 230f0: d8 2e mov r13, r24 230f2: c9 2e mov r12, r25 230f4: 81 eb ldi r24, 0xB1 ; 177 230f6: 9e e4 ldi r25, 0x4E ; 78 230f8: 0e 94 ac 72 call 0xe558 ; 0xe558 230fc: f8 2e mov r15, r24 230fe: e9 2e mov r14, r25 23100: 8f ef ldi r24, 0xFF ; 255 23102: 9e e0 ldi r25, 0x0E ; 14 23104: 0f 94 2a dc call 0x3b854 ; 0x3b854 23108: 0f 94 2b 10 call 0x22056 ; 0x22056 2310c: 18 2f mov r17, r24 2310e: 09 2f mov r16, r25 23110: 80 ea ldi r24, 0xA0 ; 160 23112: 9e e4 ldi r25, 0x4E ; 78 23114: 0e 94 ac 72 call 0xe558 ; 0xe558 23118: ec 01 movw r28, r24 2311a: 89 e7 ldi r24, 0x79 ; 121 2311c: 9e e4 ldi r25, 0x4E ; 78 2311e: 0e 94 ac 72 call 0xe558 ; 0xe558 23122: 6f 92 push r6 23124: 7f 92 push r7 23126: 8f 92 push r8 23128: 9f 92 push r9 2312a: af 92 push r10 2312c: bf 92 push r11 2312e: cf 92 push r12 23130: df 92 push r13 23132: ef 92 push r14 23134: ff 92 push r15 23136: 0f 93 push r16 23138: 1f 93 push r17 2313a: df 93 push r29 2313c: cf 93 push r28 2313e: 9f 93 push r25 23140: 8f 93 push r24 23142: 87 ef ldi r24, 0xF7 ; 247 23144: 90 ea ldi r25, 0xA0 ; 160 23146: 9f 93 push r25 23148: 8f 93 push r24 2314a: 0e 94 b9 6e call 0xdd72 ; 0xdd72 _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(); 2314e: 8d b7 in r24, 0x3d ; 61 23150: 9e b7 in r25, 0x3e ; 62 23152: 42 96 adiw r24, 0x12 ; 18 23154: 0f b6 in r0, 0x3f ; 63 23156: f8 94 cli 23158: 9e bf out 0x3e, r25 ; 62 2315a: 0f be out 0x3f, r0 ; 63 2315c: 8d bf out 0x3d, r24 ; 61 } 2315e: df 91 pop r29 23160: cf 91 pop r28 23162: 1f 91 pop r17 23164: 0f 91 pop r16 23166: ff 90 pop r15 23168: ef 90 pop r14 2316a: df 90 pop r13 2316c: cf 90 pop r12 2316e: bf 90 pop r11 23170: af 90 pop r10 23172: 9f 90 pop r9 23174: 8f 90 pop r8 23176: 7f 90 pop r7 23178: 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(); 2317a: 0d 94 00 d5 jmp 0x3aa00 ; 0x3aa00 0002317e : //! | 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() { 2317e: 8f 92 push r8 23180: 9f 92 push r9 23182: af 92 push r10 23184: bf 92 push r11 23186: cf 92 push r12 23188: df 92 push r13 2318a: ef 92 push r14 2318c: ff 92 push r15 2318e: 0f 93 push r16 23190: 1f 93 push r17 23192: cf 93 push r28 23194: df 93 push r29 23196: 10 92 dc 03 sts 0x03DC, r1 ; 0x8003dc lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 2319a: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_printf_P( 2319e: 80 91 c0 13 lds r24, 0x13C0 ; 0x8013c0 231a2: 90 91 c1 13 lds r25, 0x13C1 ; 0x8013c1 231a6: 0f 94 2b 10 call 0x22056 ; 0x22056 231aa: 98 2e mov r9, r24 231ac: 89 2e mov r8, r25 231ae: 84 e5 ldi r24, 0x54 ; 84 231b0: 9e e4 ldi r25, 0x4E ; 78 231b2: 0e 94 ac 72 call 0xe558 ; 0xe558 231b6: b8 2e mov r11, r24 231b8: a9 2e mov r10, r25 231ba: 80 ed ldi r24, 0xD0 ; 208 231bc: 9e e0 ldi r25, 0x0E ; 14 231be: 0f 94 2a dc call 0x3b854 ; 0x3b854 231c2: 0f 94 2b 10 call 0x22056 ; 0x22056 231c6: d8 2e mov r13, r24 231c8: c9 2e mov r12, r25 231ca: 83 e4 ldi r24, 0x43 ; 67 231cc: 9e e4 ldi r25, 0x4E ; 78 231ce: 0e 94 ac 72 call 0xe558 ; 0xe558 231d2: f8 2e mov r15, r24 231d4: e9 2e mov r14, r25 231d6: 83 ed ldi r24, 0xD3 ; 211 231d8: 9e e0 ldi r25, 0x0E ; 14 231da: 0f 94 2a dc call 0x3b854 ; 0x3b854 231de: 0f 94 2b 10 call 0x22056 ; 0x22056 231e2: 18 2f mov r17, r24 231e4: 09 2f mov r16, r25 231e6: 87 e3 ldi r24, 0x37 ; 55 231e8: 9e e4 ldi r25, 0x4E ; 78 231ea: 0e 94 ac 72 call 0xe558 ; 0xe558 231ee: ec 01 movw r28, r24 231f0: 89 e7 ldi r24, 0x79 ; 121 231f2: 9e e4 ldi r25, 0x4E ; 78 231f4: 0e 94 ac 72 call 0xe558 ; 0xe558 231f8: 8f 92 push r8 231fa: 9f 92 push r9 231fc: af 92 push r10 231fe: bf 92 push r11 23200: cf 92 push r12 23202: df 92 push r13 23204: ef 92 push r14 23206: ff 92 push r15 23208: 0f 93 push r16 2320a: 1f 93 push r17 2320c: df 93 push r29 2320e: cf 93 push r28 23210: 9f 93 push r25 23212: 8f 93 push r24 23214: 8a ec ldi r24, 0xCA ; 202 23216: 90 ea ldi r25, 0xA0 ; 160 23218: 9f 93 push r25 2321a: 8f 93 push r24 2321c: 0e 94 b9 6e call 0xdd72 ; 0xdd72 ), _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(); 23220: 8d b7 in r24, 0x3d ; 61 23222: 9e b7 in r25, 0x3e ; 62 23224: 40 96 adiw r24, 0x10 ; 16 23226: 0f b6 in r0, 0x3f ; 63 23228: f8 94 cli 2322a: 9e bf out 0x3e, r25 ; 62 2322c: 0f be out 0x3f, r0 ; 63 2322e: 8d bf out 0x3d, r24 ; 61 } 23230: df 91 pop r29 23232: cf 91 pop r28 23234: 1f 91 pop r17 23236: 0f 91 pop r16 23238: ff 90 pop r15 2323a: ef 90 pop r14 2323c: df 90 pop r13 2323e: cf 90 pop r12 23240: bf 90 pop r11 23242: af 90 pop r10 23244: 9f 90 pop r9 23246: 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(); 23248: 0d 94 00 d5 jmp 0x3aa00 ; 0x3aa00 0002324c : //! |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() { 2324c: cf 93 push r28 2324e: df 93 push r29 lcd_puts_at_P(0, 0, _T(MSG_MEASURED_OFFSET)); 23250: 80 e4 ldi r24, 0x40 ; 64 23252: 91 e5 ldi r25, 0x51 ; 81 23254: 0e 94 ac 72 call 0xe558 ; 0xe558 23258: ac 01 movw r20, r24 2325a: 60 e0 ldi r22, 0x00 ; 0 2325c: 80 e0 ldi r24, 0x00 ; 0 2325e: 0e 94 f4 6e call 0xdde8 ; 0xdde8 lcd_puts_at_P(0, 1, STR_SEPARATOR); 23262: 4a e8 ldi r20, 0x8A ; 138 23264: 5a e8 ldi r21, 0x8A ; 138 23266: 61 e0 ldi r22, 0x01 ; 1 23268: 80 e0 ldi r24, 0x00 ; 0 2326a: 0e 94 f4 6e call 0xdde8 ; 0xdde8 for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(0, i + 2); 2326e: 62 e0 ldi r22, 0x02 ; 2 23270: 80 e0 ldi r24, 0x00 ; 0 23272: 0e 94 e0 6e call 0xddc0 ; 0xddc0 lcd_printf_P(PSTR("%c%17.2fmm"), 'X' + i, eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_CENTER+4*i))); 23276: 85 ee ldi r24, 0xE5 ; 229 23278: 9f e0 ldi r25, 0x0F ; 15 2327a: 0f 94 24 dc call 0x3b848 ; 0x3b848 2327e: 9f 93 push r25 23280: 8f 93 push r24 23282: 7f 93 push r23 23284: 6f 93 push r22 23286: 1f 92 push r1 23288: 88 e5 ldi r24, 0x58 ; 88 2328a: 8f 93 push r24 2328c: c1 e3 ldi r28, 0x31 ; 49 2328e: d3 ea ldi r29, 0xA3 ; 163 23290: df 93 push r29 23292: cf 93 push r28 23294: 0e 94 b9 6e call 0xdd72 ; 0xdd72 { 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); 23298: 63 e0 ldi r22, 0x03 ; 3 2329a: 80 e0 ldi r24, 0x00 ; 0 2329c: 0e 94 e0 6e call 0xddc0 ; 0xddc0 lcd_printf_P(PSTR("%c%17.2fmm"), 'X' + i, eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_CENTER+4*i))); 232a0: 89 ee ldi r24, 0xE9 ; 233 232a2: 9f e0 ldi r25, 0x0F ; 15 232a4: 0f 94 24 dc call 0x3b848 ; 0x3b848 232a8: 9f 93 push r25 232aa: 8f 93 push r24 232ac: 7f 93 push r23 232ae: 6f 93 push r22 232b0: 1f 92 push r1 232b2: 89 e5 ldi r24, 0x59 ; 89 232b4: 8f 93 push r24 232b6: df 93 push r29 232b8: cf 93 push r28 232ba: 0e 94 b9 6e call 0xdd72 ; 0xdd72 } menu_back_if_clicked(); 232be: 8d b7 in r24, 0x3d ; 61 232c0: 9e b7 in r25, 0x3e ; 62 232c2: 40 96 adiw r24, 0x10 ; 16 232c4: 0f b6 in r0, 0x3f ; 63 232c6: f8 94 cli 232c8: 9e bf out 0x3e, r25 ; 62 232ca: 0f be out 0x3f, r0 ; 63 232cc: 8d bf out 0x3d, r24 ; 61 } 232ce: df 91 pop r29 232d0: 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(); 232d2: 0d 94 00 d5 jmp 0x3aa00 ; 0x3aa00 000232d6 : //! ---------------------- //! 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() { 232d6: cf 92 push r12 232d8: df 92 push r13 232da: ef 92 push r14 232dc: ff 92 push r15 232de: 0f 93 push r16 232e0: 1f 93 push r17 232e2: cf 93 push r28 232e4: df 93 push r29 float angleDiff = eeprom_read_float((float*)(EEPROM_XYZ_CAL_SKEW)); 232e6: 80 e6 ldi r24, 0x60 ; 96 232e8: 9f e0 ldi r25, 0x0F ; 15 232ea: 0f 94 24 dc call 0x3b848 ; 0x3b848 232ee: 6b 01 movw r12, r22 232f0: 7c 01 movw r14, r24 lcd_home(); 232f2: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_printf_P(_N( 232f6: 82 e3 ldi r24, 0x32 ; 50 232f8: 91 e5 ldi r25, 0x51 ; 81 232fa: 0e 94 ac 72 call 0xe558 ; 0xe558 232fe: 18 2f mov r17, r24 23300: 09 2f mov r16, r25 23302: 84 e2 ldi r24, 0x24 ; 36 23304: 91 e5 ldi r25, 0x51 ; 81 23306: 0e 94 ac 72 call 0xe558 ; 0xe558 2330a: ec 01 movw r28, r24 2330c: 84 e1 ldi r24, 0x14 ; 20 2330e: 91 e5 ldi r25, 0x51 ; 81 23310: 0e 94 ac 72 call 0xe558 ; 0xe558 23314: 2e e3 ldi r18, 0x3E ; 62 23316: 2f 93 push r18 23318: 20 e8 ldi r18, 0x80 ; 128 2331a: 2f 93 push r18 2331c: 1f 92 push r1 2331e: 1f 92 push r1 23320: 0f 93 push r16 23322: 1f 93 push r17 23324: 2d e3 ldi r18, 0x3D ; 61 23326: 2f 93 push r18 23328: 25 ef ldi r18, 0xF5 ; 245 2332a: 2f 93 push r18 2332c: 22 ec ldi r18, 0xC2 ; 194 2332e: 2f 93 push r18 23330: 20 e9 ldi r18, 0x90 ; 144 23332: 2f 93 push r18 23334: df 93 push r29 23336: cf 93 push r28 23338: 2a e8 ldi r18, 0x8A ; 138 2333a: 3a e8 ldi r19, 0x8A ; 138 2333c: 3f 93 push r19 2333e: 2f 93 push r18 23340: 9f 93 push r25 23342: 8f 93 push r24 23344: 8d eb ldi r24, 0xBD ; 189 23346: 9f e6 ldi r25, 0x6F ; 111 23348: 9f 93 push r25 2334a: 8f 93 push r24 2334c: 0e 94 b9 6e call 0xdd72 ; 0xdd72 _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); 23350: 60 e0 ldi r22, 0x00 ; 0 23352: 8f e0 ldi r24, 0x0F ; 15 23354: 0e 94 e0 6e call 0xddc0 ; 0xddc0 if (angleDiff < 100){ 23358: 8d b7 in r24, 0x3d ; 61 2335a: 9e b7 in r25, 0x3e ; 62 2335c: 42 96 adiw r24, 0x12 ; 18 2335e: 0f b6 in r0, 0x3f ; 63 23360: f8 94 cli 23362: 9e bf out 0x3e, r25 ; 62 23364: 0f be out 0x3f, r0 ; 63 23366: 8d bf out 0x3d, r24 ; 61 23368: 20 e0 ldi r18, 0x00 ; 0 2336a: 30 e0 ldi r19, 0x00 ; 0 2336c: 48 ec ldi r20, 0xC8 ; 200 2336e: 52 e4 ldi r21, 0x42 ; 66 23370: c7 01 movw r24, r14 23372: b6 01 movw r22, r12 23374: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 23378: 87 ff sbrs r24, 7 2337a: 32 c0 rjmp .+100 ; 0x233e0 } //@brief Show measured axis skewness float _deg(float rad) { return rad * 180 / M_PI; 2337c: 20 e0 ldi r18, 0x00 ; 0 2337e: 30 e0 ldi r19, 0x00 ; 0 23380: 44 e3 ldi r20, 0x34 ; 52 23382: 53 e4 ldi r21, 0x43 ; 67 23384: c7 01 movw r24, r14 23386: b6 01 movw r22, r12 23388: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 2338c: 2b ed ldi r18, 0xDB ; 219 2338e: 3f e0 ldi r19, 0x0F ; 15 23390: 49 e4 ldi r20, 0x49 ; 73 23392: 50 e4 ldi r21, 0x40 ; 64 23394: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__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)); 23398: 9f 93 push r25 2339a: 8f 93 push r24 2339c: 7f 93 push r23 2339e: 6f 93 push r22 233a0: 86 eb ldi r24, 0xB6 ; 182 233a2: 9f e6 ldi r25, 0x6F ; 111 233a4: 9f 93 push r25 233a6: 8f 93 push r24 233a8: 0e 94 b9 6e call 0xdd72 ; 0xdd72 233ac: 0f 90 pop r0 233ae: 0f 90 pop r0 233b0: 0f 90 pop r0 233b2: 0f 90 pop r0 233b4: 0f 90 pop r0 233b6: 0f 90 pop r0 } else { lcd_puts_P(_T(MSG_NA)); } if (lcd_clicked()) 233b8: 0e 94 fd 70 call 0xe1fa ; 0xe1fa 233bc: 88 23 and r24, r24 233be: b9 f0 breq .+46 ; 0x233ee menu_goto(lcd_menu_xyz_offset, 0, true); 233c0: 20 e0 ldi r18, 0x00 ; 0 233c2: 41 e0 ldi r20, 0x01 ; 1 233c4: 70 e0 ldi r23, 0x00 ; 0 233c6: 60 e0 ldi r22, 0x00 ; 0 233c8: 86 e7 ldi r24, 0x76 ; 118 233ca: 99 e3 ldi r25, 0x39 ; 57 } 233cc: df 91 pop r29 233ce: cf 91 pop r28 233d0: 1f 91 pop r17 233d2: 0f 91 pop r16 233d4: ff 90 pop r15 233d6: ef 90 pop r14 233d8: df 90 pop r13 233da: 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); 233dc: 0d 94 c0 d1 jmp 0x3a380 ; 0x3a380 ); 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)); 233e0: 86 ee ldi r24, 0xE6 ; 230 233e2: 97 e4 ldi r25, 0x47 ; 71 233e4: 0e 94 ac 72 call 0xe558 ; 0xe558 233e8: 0e 94 cb 6e call 0xdd96 ; 0xdd96 233ec: e5 cf rjmp .-54 ; 0x233b8 } if (lcd_clicked()) menu_goto(lcd_menu_xyz_offset, 0, true); } 233ee: df 91 pop r29 233f0: cf 91 pop r28 233f2: 1f 91 pop r17 233f4: 0f 91 pop r16 233f6: ff 90 pop r15 233f8: ef 90 pop r14 233fa: df 90 pop r13 233fc: cf 90 pop r12 233fe: 08 95 ret 00023400 : //! |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() { 23400: 2f 92 push r2 23402: 3f 92 push r3 23404: 4f 92 push r4 23406: 5f 92 push r5 23408: 6f 92 push r6 2340a: 7f 92 push r7 2340c: 8f 92 push r8 2340e: 9f 92 push r9 23410: af 92 push r10 23412: bf 92 push r11 23414: cf 92 push r12 23416: df 92 push r13 23418: ef 92 push r14 2341a: ff 92 push r15 2341c: 0f 93 push r16 2341e: 1f 93 push r17 23420: cf 93 push r28 23422: df 93 push r29 23424: cd b7 in r28, 0x3d ; 61 23426: de b7 in r29, 0x3e ; 62 23428: a8 97 sbiw r28, 0x28 ; 40 2342a: 0f b6 in r0, 0x3f ; 63 2342c: f8 94 cli 2342e: de bf out 0x3e, r29 ; 62 23430: 0f be out 0x3f, r0 ; 63 23432: 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); 23434: 48 e0 ldi r20, 0x08 ; 8 23436: 50 e0 ldi r21, 0x00 ; 0 23438: 65 ee ldi r22, 0xE5 ; 229 2343a: 7f e0 ldi r23, 0x0F ; 15 2343c: ce 01 movw r24, r28 2343e: 41 96 adiw r24, 0x11 ; 17 23440: 0f 94 0c dc call 0x3b818 ; 0x3b818 eeprom_read_block(&vec_x[0], (float*)(EEPROM_BED_CALIBRATION_VEC_X), 8); 23444: 48 e0 ldi r20, 0x08 ; 8 23446: 50 e0 ldi r21, 0x00 ; 0 23448: 6d ed ldi r22, 0xDD ; 221 2344a: 7f e0 ldi r23, 0x0F ; 15 2344c: ce 01 movw r24, r28 2344e: 09 96 adiw r24, 0x09 ; 9 23450: 0f 94 0c dc call 0x3b818 ; 0x3b818 eeprom_read_block(&vec_y[0], (float*)(EEPROM_BED_CALIBRATION_VEC_Y), 8); 23454: 48 e0 ldi r20, 0x08 ; 8 23456: 50 e0 ldi r21, 0x00 ; 0 23458: 65 ed ldi r22, 0xD5 ; 213 2345a: 7f e0 ldi r23, 0x0F ; 15 2345c: ce 01 movw r24, r28 2345e: 01 96 adiw r24, 0x01 ; 1 23460: 0f 94 0c dc call 0x3b818 ; 0x3b818 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]; 23464: 8d 84 ldd r8, Y+13 ; 0x0d 23466: 9e 84 ldd r9, Y+14 ; 0x0e 23468: af 84 ldd r10, Y+15 ; 0x0f 2346a: b8 88 ldd r11, Y+16 ; 0x10 2346c: ea ed ldi r30, 0xDA ; 218 2346e: f5 ea ldi r31, 0xA5 ; 165 23470: 25 91 lpm r18, Z+ 23472: 35 91 lpm r19, Z+ 23474: 45 91 lpm r20, Z+ 23476: 54 91 lpm r21, Z 23478: cd 80 ldd r12, Y+5 ; 0x05 2347a: de 80 ldd r13, Y+6 ; 0x06 2347c: ef 80 ldd r14, Y+7 ; 0x07 2347e: f8 84 ldd r15, Y+8 ; 0x08 23480: ee ed ldi r30, 0xDE ; 222 23482: f5 ea ldi r31, 0xA5 ; 165 23484: 85 91 lpm r24, Z+ 23486: 95 91 lpm r25, Z+ 23488: a5 91 lpm r26, Z+ 2348a: b4 91 lpm r27, Z 2348c: 8d a3 std Y+37, r24 ; 0x25 2348e: 9e a3 std Y+38, r25 ; 0x26 23490: af a3 std Y+39, r26 ; 0x27 23492: b8 a7 std Y+40, r27 ; 0x28 23494: 8d 89 ldd r24, Y+21 ; 0x15 23496: 9e 89 ldd r25, Y+22 ; 0x16 23498: af 89 ldd r26, Y+23 ; 0x17 2349a: b8 8d ldd r27, Y+24 ; 0x18 2349c: 89 a3 std Y+33, r24 ; 0x21 2349e: 9a a3 std Y+34, r25 ; 0x22 234a0: ab a3 std Y+35, r26 ; 0x23 234a2: bc a3 std Y+36, r27 ; 0x24 234a4: c5 01 movw r24, r10 234a6: b4 01 movw r22, r8 234a8: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 234ac: 2b 01 movw r4, r22 234ae: 3c 01 movw r6, r24 234b0: 2d a1 ldd r18, Y+37 ; 0x25 234b2: 3e a1 ldd r19, Y+38 ; 0x26 234b4: 4f a1 ldd r20, Y+39 ; 0x27 234b6: 58 a5 ldd r21, Y+40 ; 0x28 234b8: c7 01 movw r24, r14 234ba: b6 01 movw r22, r12 234bc: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 234c0: 9b 01 movw r18, r22 234c2: ac 01 movw r20, r24 234c4: c3 01 movw r24, r6 234c6: b2 01 movw r22, r4 234c8: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 234cc: 29 a1 ldd r18, Y+33 ; 0x21 234ce: 3a a1 ldd r19, Y+34 ; 0x22 234d0: 4b a1 ldd r20, Y+35 ; 0x23 234d2: 5c a1 ldd r21, Y+36 ; 0x24 234d4: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> distanceMin[mesh_point] = (y - Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 234d8: 20 e0 ldi r18, 0x00 ; 0 234da: 30 e0 ldi r19, 0x00 ; 0 234dc: 40 e9 ldi r20, 0x90 ; 144 234de: 50 e4 ldi r21, 0x40 ; 64 234e0: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 234e4: 1b 01 movw r2, r22 234e6: 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]; 234e8: e2 ee ldi r30, 0xE2 ; 226 234ea: f5 ea ldi r31, 0xA5 ; 165 234ec: 25 91 lpm r18, Z+ 234ee: 35 91 lpm r19, Z+ 234f0: 45 91 lpm r20, Z+ 234f2: 54 91 lpm r21, Z 234f4: e6 ee ldi r30, 0xE6 ; 230 234f6: f5 ea ldi r31, 0xA5 ; 165 234f8: 45 90 lpm r4, Z+ 234fa: 55 90 lpm r5, Z+ 234fc: 65 90 lpm r6, Z+ 234fe: 74 90 lpm r7, Z 23500: c5 01 movw r24, r10 23502: b4 01 movw r22, r8 23504: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 23508: 4b 01 movw r8, r22 2350a: 5c 01 movw r10, r24 2350c: a3 01 movw r20, r6 2350e: 92 01 movw r18, r4 23510: c7 01 movw r24, r14 23512: b6 01 movw r22, r12 23514: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 23518: 9b 01 movw r18, r22 2351a: ac 01 movw r20, r24 2351c: c5 01 movw r24, r10 2351e: b4 01 movw r22, r8 23520: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 23524: 29 a1 ldd r18, Y+33 ; 0x21 23526: 3a a1 ldd r19, Y+34 ; 0x22 23528: 4b a1 ldd r20, Y+35 ; 0x23 2352a: 5c a1 ldd r21, Y+36 ; 0x24 2352c: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> distanceMin[mesh_point] = (y - Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 23530: 20 e0 ldi r18, 0x00 ; 0 23532: 30 e0 ldi r19, 0x00 ; 0 23534: 40 e9 ldi r20, 0x90 ; 144 23536: 50 e4 ldi r21, 0x40 ; 64 23538: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 2353c: 6d 8f std Y+29, r22 ; 0x1d 2353e: 7e 8f std Y+30, r23 ; 0x1e 23540: 8f 8f std Y+31, r24 ; 0x1f 23542: 98 a3 std Y+32, r25 ; 0x20 float distanceMin[2]; count_xyz_details(distanceMin); lcd_home(); 23544: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_printf_P(_N( 23548: 8c e0 ldi r24, 0x0C ; 12 2354a: 91 e5 ldi r25, 0x51 ; 81 2354c: 0e 94 ac 72 call 0xe558 ; 0xe558 23550: d8 2e mov r13, r24 23552: c9 2e mov r12, r25 23554: 85 e0 ldi r24, 0x05 ; 5 23556: 91 e5 ldi r25, 0x51 ; 81 23558: 0e 94 ac 72 call 0xe558 ; 0xe558 2355c: f8 2e mov r15, r24 2355e: e9 2e mov r14, r25 23560: 8f ee ldi r24, 0xEF ; 239 23562: 90 e5 ldi r25, 0x50 ; 80 23564: 0e 94 ac 72 call 0xe558 ; 0xe558 23568: cf 92 push r12 2356a: df 92 push r13 2356c: ef 92 push r14 2356e: ff 92 push r15 23570: 2a e8 ldi r18, 0x8A ; 138 23572: 3a e8 ldi r19, 0x8A ; 138 23574: 3f 93 push r19 23576: 2f 93 push r18 23578: 9f 93 push r25 2357a: 8f 93 push r24 2357c: 88 ea ldi r24, 0xA8 ; 168 2357e: 9f e6 ldi r25, 0x6F ; 111 23580: 9f 93 push r25 23582: 8f 93 push r24 23584: 0e 94 b9 6e call 0xdd72 ; 0xdd72 _T(MSG_LEFT), _T(MSG_RIGHT) ); for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(11,2+i); 23588: 62 e0 ldi r22, 0x02 ; 2 2358a: 8b e0 ldi r24, 0x0B ; 11 2358c: 0e 94 e0 6e call 0xddc0 ; 0xddc0 if (distanceMin[i] >= 200) lcd_puts_P(_T(MSG_NA)); 23590: 0f b6 in r0, 0x3f ; 63 23592: f8 94 cli 23594: de bf out 0x3e, r29 ; 62 23596: 0f be out 0x3f, r0 ; 63 23598: cd bf out 0x3d, r28 ; 61 2359a: 20 e0 ldi r18, 0x00 ; 0 2359c: 30 e0 ldi r19, 0x00 ; 0 2359e: 48 e4 ldi r20, 0x48 ; 72 235a0: 53 e4 ldi r21, 0x43 ; 67 235a2: 62 2d mov r22, r2 235a4: 73 2d mov r23, r3 235a6: 80 2f mov r24, r16 235a8: 91 2f mov r25, r17 235aa: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 235ae: 87 ff sbrs r24, 7 235b0: 51 c0 rjmp .+162 ; 0x23654 else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); 235b2: 1f 93 push r17 235b4: 0f 93 push r16 235b6: 3f 92 push r3 235b8: 2f 92 push r2 235ba: 80 ea ldi r24, 0xA0 ; 160 235bc: 9f e6 ldi r25, 0x6F ; 111 235be: 9f 93 push r25 235c0: 8f 93 push r24 235c2: 0e 94 b9 6e call 0xdd72 ; 0xdd72 235c6: 0f 90 pop r0 235c8: 0f 90 pop r0 235ca: 0f 90 pop r0 235cc: 0f 90 pop r0 235ce: 0f 90 pop r0 235d0: 0f 90 pop r0 _T(MSG_LEFT), _T(MSG_RIGHT) ); for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(11,2+i); 235d2: 63 e0 ldi r22, 0x03 ; 3 235d4: 8b e0 ldi r24, 0x0B ; 11 235d6: 0e 94 e0 6e call 0xddc0 ; 0xddc0 if (distanceMin[i] >= 200) lcd_puts_P(_T(MSG_NA)); 235da: 1d 8d ldd r17, Y+29 ; 0x1d 235dc: 0e 8d ldd r16, Y+30 ; 0x1e 235de: ff 8c ldd r15, Y+31 ; 0x1f 235e0: e8 a0 ldd r14, Y+32 ; 0x20 235e2: 20 e0 ldi r18, 0x00 ; 0 235e4: 30 e0 ldi r19, 0x00 ; 0 235e6: 48 e4 ldi r20, 0x48 ; 72 235e8: 53 e4 ldi r21, 0x43 ; 67 235ea: d8 01 movw r26, r16 235ec: f7 01 movw r30, r14 235ee: 6b 2f mov r22, r27 235f0: 7a 2f mov r23, r26 235f2: 8f 2f mov r24, r31 235f4: 9e 2f mov r25, r30 235f6: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 235fa: 87 fd sbrc r24, 7 235fc: 32 c0 rjmp .+100 ; 0x23662 235fe: 86 ee ldi r24, 0xE6 ; 230 23600: 97 e4 ldi r25, 0x47 ; 71 23602: 0e 94 ac 72 call 0xe558 ; 0xe558 23606: 0e 94 cb 6e call 0xdd96 ; 0xdd96 else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); } if (lcd_clicked()) 2360a: 0e 94 fd 70 call 0xe1fa ; 0xe1fa 2360e: 88 23 and r24, r24 23610: 41 f0 breq .+16 ; 0x23622 menu_goto(lcd_menu_xyz_skew, 0, true); 23612: 20 e0 ldi r18, 0x00 ; 0 23614: 41 e0 ldi r20, 0x01 ; 1 23616: 70 e0 ldi r23, 0x00 ; 0 23618: 60 e0 ldi r22, 0x00 ; 0 2361a: 86 e1 ldi r24, 0x16 ; 22 2361c: 99 e3 ldi r25, 0x39 ; 57 2361e: 0f 94 c0 d1 call 0x3a380 ; 0x3a380 } 23622: a8 96 adiw r28, 0x28 ; 40 23624: 0f b6 in r0, 0x3f ; 63 23626: f8 94 cli 23628: de bf out 0x3e, r29 ; 62 2362a: 0f be out 0x3f, r0 ; 63 2362c: cd bf out 0x3d, r28 ; 61 2362e: df 91 pop r29 23630: cf 91 pop r28 23632: 1f 91 pop r17 23634: 0f 91 pop r16 23636: ff 90 pop r15 23638: ef 90 pop r14 2363a: df 90 pop r13 2363c: cf 90 pop r12 2363e: bf 90 pop r11 23640: af 90 pop r10 23642: 9f 90 pop r9 23644: 8f 90 pop r8 23646: 7f 90 pop r7 23648: 6f 90 pop r6 2364a: 5f 90 pop r5 2364c: 4f 90 pop r4 2364e: 3f 90 pop r3 23650: 2f 90 pop r2 23652: 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)); 23654: 86 ee ldi r24, 0xE6 ; 230 23656: 97 e4 ldi r25, 0x47 ; 71 23658: 0e 94 ac 72 call 0xe558 ; 0xe558 2365c: 0e 94 cb 6e call 0xdd96 ; 0xdd96 23660: b8 cf rjmp .-144 ; 0x235d2 else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); 23662: ef 92 push r14 23664: ff 92 push r15 23666: 0f 93 push r16 23668: 1f 93 push r17 2366a: 80 ea ldi r24, 0xA0 ; 160 2366c: 9f e6 ldi r25, 0x6F ; 111 2366e: 9f 93 push r25 23670: 8f 93 push r24 23672: 0e 94 b9 6e call 0xdd72 ; 0xdd72 23676: 0f 90 pop r0 23678: 0f 90 pop r0 2367a: 0f 90 pop r0 2367c: 0f 90 pop r0 2367e: 0f 90 pop r0 23680: 0f 90 pop r0 23682: c3 cf rjmp .-122 ; 0x2360a 00023684 <_lcd_move(char const*, unsigned char, int, int)>: } } static void _lcd_move(const char *name, uint8_t axis, int min, int max) { 23684: 2f 92 push r2 23686: 3f 92 push r3 23688: 4f 92 push r4 2368a: 5f 92 push r5 2368c: 6f 92 push r6 2368e: 7f 92 push r7 23690: 9f 92 push r9 23692: af 92 push r10 23694: bf 92 push r11 23696: cf 92 push r12 23698: df 92 push r13 2369a: ef 92 push r14 2369c: ff 92 push r15 2369e: 0f 93 push r16 236a0: 1f 93 push r17 236a2: cf 93 push r28 236a4: df 93 push r29 if (homing_flag || mesh_bed_leveling_flag) 236a6: 70 91 a7 0d lds r23, 0x0DA7 ; 0x800da7 236aa: 71 11 cpse r23, r1 236ac: 04 c0 rjmp .+8 ; 0x236b6 <_lcd_move(char const*, unsigned char, int, int)+0x32> 236ae: 70 91 a8 0d lds r23, 0x0DA8 ; 0x800da8 236b2: 77 23 and r23, r23 236b4: 99 f0 breq .+38 ; 0x236dc <_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(); } 236b6: df 91 pop r29 236b8: cf 91 pop r28 236ba: 1f 91 pop r17 236bc: 0f 91 pop r16 236be: ff 90 pop r15 236c0: ef 90 pop r14 236c2: df 90 pop r13 236c4: cf 90 pop r12 236c6: bf 90 pop r11 236c8: af 90 pop r10 236ca: 9f 90 pop r9 236cc: 7f 90 pop r7 236ce: 6f 90 pop r6 236d0: 5f 90 pop r5 236d2: 4f 90 pop r4 236d4: 3f 90 pop r3 236d6: 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(); 236d8: 0d 94 5e d4 jmp 0x3a8bc ; 0x3a8bc 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) 236dc: 70 91 a9 03 lds r23, 0x03A9 ; 0x8003a9 236e0: 71 11 cpse r23, r1 236e2: 09 c0 rjmp .+18 ; 0x236f6 <_lcd_move(char const*, unsigned char, int, int)+0x72> return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 236e4: 70 91 b7 02 lds r23, 0x02B7 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> check_endstops = check; 236e8: 10 92 b7 02 sts 0x02B7, r1 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> { _md->endstopsEnabledPrevious = enable_endstops(false); 236ec: 70 93 aa 03 sts 0x03AA, r23 ; 0x8003aa _md->initialized = true; 236f0: 71 e0 ldi r23, 0x01 ; 1 236f2: 70 93 a9 03 sts 0x03A9, r23 ; 0x8003a9 236f6: 19 01 movw r2, r18 236f8: 6a 01 movw r12, r20 236fa: c6 2f mov r28, r22 236fc: d9 2f mov r29, r25 236fe: 98 2e mov r9, r24 } if (lcd_encoder != 0) 23700: 80 91 70 06 lds r24, 0x0670 ; 0x800670 23704: 90 91 71 06 lds r25, 0x0671 ; 0x800671 23708: 89 2b or r24, r25 2370a: 09 f4 brne .+2 ; 0x2370e <_lcd_move(char const*, unsigned char, int, int)+0x8a> 2370c: 71 c0 rjmp .+226 ; 0x237f0 <_lcd_move(char const*, unsigned char, int, int)+0x16c> { refresh_cmd_timeout(); 2370e: 0e 94 c3 66 call 0xcd86 ; 0xcd86 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; 23712: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 if (++ next_block_index == BLOCK_BUFFER_SIZE) 23716: 8f 5f subi r24, 0xFF ; 255 23718: 80 31 cpi r24, 0x10 ; 16 2371a: 09 f4 brne .+2 ; 0x2371e <_lcd_move(char const*, unsigned char, int, int)+0x9a> next_block_index = 0; 2371c: 80 e0 ldi r24, 0x00 ; 0 return block_buffer_tail == next_block_index; 2371e: 90 91 a6 0d lds r25, 0x0DA6 ; 0x800da6 if (! planner_queue_full()) 23722: 98 17 cp r25, r24 23724: 09 f4 brne .+2 ; 0x23728 <_lcd_move(char const*, unsigned char, int, int)+0xa4> 23726: 64 c0 rjmp .+200 ; 0x237f0 <_lcd_move(char const*, unsigned char, int, int)+0x16c> { current_position[axis] += lcd_encoder; 23728: 84 e0 ldi r24, 0x04 ; 4 2372a: c8 9f mul r28, r24 2372c: 80 01 movw r16, r0 2372e: 11 24 eor r1, r1 23730: f8 01 movw r30, r16 23732: ee 56 subi r30, 0x6E ; 110 23734: f9 4f sbci r31, 0xF9 ; 249 23736: 5f 01 movw r10, r30 23738: 60 91 70 06 lds r22, 0x0670 ; 0x800670 2373c: 70 91 71 06 lds r23, 0x0671 ; 0x800671 23740: 07 2e mov r0, r23 23742: 00 0c add r0, r0 23744: 88 0b sbc r24, r24 23746: 99 0b sbc r25, r25 23748: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 2374c: f5 01 movw r30, r10 2374e: 20 81 ld r18, Z 23750: 31 81 ldd r19, Z+1 ; 0x01 23752: 42 81 ldd r20, Z+2 ; 0x02 23754: 53 81 ldd r21, Z+3 ; 0x03 23756: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 2375a: 2b 01 movw r4, r22 2375c: 3c 01 movw r6, r24 if (min_software_endstops && current_position[axis] < min) current_position[axis] = min; 2375e: b6 01 movw r22, r12 23760: dd 0c add r13, r13 23762: 88 0b sbc r24, r24 23764: 99 0b sbc r25, r25 23766: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 2376a: 6b 01 movw r12, r22 2376c: 7c 01 movw r14, r24 2376e: ac 01 movw r20, r24 23770: 9b 01 movw r18, r22 23772: c3 01 movw r24, r6 23774: b2 01 movw r22, r4 23776: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 2377a: f5 01 movw r30, r10 2377c: 87 fd sbrc r24, 7 2377e: 7d c0 rjmp .+250 ; 0x2387a <_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; 23780: 40 82 st Z, r4 23782: 51 82 std Z+1, r5 ; 0x01 23784: 62 82 std Z+2, r6 ; 0x02 23786: 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; 23788: b1 01 movw r22, r2 2378a: 33 0c add r3, r3 2378c: 88 0b sbc r24, r24 2378e: 99 0b sbc r25, r25 23790: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 23794: 2b 01 movw r4, r22 23796: 3c 01 movw r6, r24 23798: c8 01 movw r24, r16 2379a: 8e 56 subi r24, 0x6E ; 110 2379c: 99 4f sbci r25, 0xF9 ; 249 2379e: 7c 01 movw r14, r24 237a0: a3 01 movw r20, r6 237a2: 92 01 movw r18, r4 237a4: fc 01 movw r30, r24 237a6: 60 81 ld r22, Z 237a8: 71 81 ldd r23, Z+1 ; 0x01 237aa: 82 81 ldd r24, Z+2 ; 0x02 237ac: 93 81 ldd r25, Z+3 ; 0x03 237ae: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 237b2: 18 16 cp r1, r24 237b4: 2c f4 brge .+10 ; 0x237c0 <_lcd_move(char const*, unsigned char, int, int)+0x13c> 237b6: f7 01 movw r30, r14 237b8: 40 82 st Z, r4 237ba: 51 82 std Z+1, r5 ; 0x01 237bc: 62 82 std Z+2, r6 ; 0x02 237be: 73 82 std Z+3, r7 ; 0x03 lcd_encoder = 0; 237c0: 10 92 71 06 sts 0x0671, r1 ; 0x800671 237c4: 10 92 70 06 sts 0x0670, r1 ; 0x800670 world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 237c8: 66 e9 ldi r22, 0x96 ; 150 237ca: 76 e0 ldi r23, 0x06 ; 6 237cc: 82 e9 ldi r24, 0x92 ; 146 237ce: 96 e0 ldi r25, 0x06 ; 6 237d0: 0e 94 aa 6a call 0xd554 ; 0xd554 plan_buffer_line_curposXYZE(get_feedrate_mm_s(manual_feedrate[axis])); 237d4: f8 01 movw r30, r16 237d6: e7 50 subi r30, 0x07 ; 7 237d8: fd 4f sbci r31, 0xFD ; 253 237da: 60 81 ld r22, Z 237dc: 71 81 ldd r23, Z+1 ; 0x01 237de: 82 81 ldd r24, Z+2 ; 0x02 237e0: 93 81 ldd r25, Z+3 ; 0x03 237e2: 0e 94 c7 66 call 0xcd8e ; 0xcd8e 237e6: 0f 94 49 c0 call 0x38092 ; 0x38092 lcd_draw_update = 1; 237ea: 81 e0 ldi r24, 0x01 ; 1 237ec: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } } if (lcd_draw_update) 237f0: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 237f4: 88 23 and r24, r24 237f6: 11 f1 breq .+68 ; 0x2383c <_lcd_move(char const*, unsigned char, int, int)+0x1b8> { lcd_set_cursor(0, 1); 237f8: 61 e0 ldi r22, 0x01 ; 1 237fa: 80 e0 ldi r24, 0x00 ; 0 237fc: 0e 94 e0 6e call 0xddc0 ; 0xddc0 menu_draw_float31(name, current_position[axis]); 23800: 84 e0 ldi r24, 0x04 ; 4 23802: c8 9f mul r28, r24 23804: f0 01 movw r30, r0 23806: 11 24 eor r1, r1 23808: ee 56 subi r30, 0x6E ; 110 2380a: 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); 2380c: 83 81 ldd r24, Z+3 ; 0x03 2380e: 8f 93 push r24 23810: 82 81 ldd r24, Z+2 ; 0x02 23812: 8f 93 push r24 23814: 81 81 ldd r24, Z+1 ; 0x01 23816: 8f 93 push r24 23818: 80 81 ld r24, Z 2381a: 8f 93 push r24 2381c: df 93 push r29 2381e: 9f 92 push r9 23820: 88 e1 ldi r24, 0x18 ; 24 23822: 93 ea ldi r25, 0xA3 ; 163 23824: 9f 93 push r25 23826: 8f 93 push r24 23828: 0e 94 b9 6e call 0xdd72 ; 0xdd72 2382c: ed b7 in r30, 0x3d ; 61 2382e: fe b7 in r31, 0x3e ; 62 23830: 38 96 adiw r30, 0x08 ; 8 23832: 0f b6 in r0, 0x3f ; 63 23834: f8 94 cli 23836: fe bf out 0x3e, r31 ; 62 23838: 0f be out 0x3f, r0 ; 63 2383a: ed bf out 0x3d, r30 ; 61 } if (menu_leaving || LCD_CLICKED) (void)enable_endstops(_md->endstopsEnabledPrevious); 2383c: 80 91 d7 03 lds r24, 0x03D7 ; 0x8003d7 23840: 81 11 cpse r24, r1 23842: 04 c0 rjmp .+8 ; 0x2384c <_lcd_move(char const*, unsigned char, int, int)+0x1c8> 23844: 80 91 a8 03 lds r24, 0x03A8 ; 0x8003a8 23848: 88 23 and r24, r24 2384a: 21 f0 breq .+8 ; 0x23854 <_lcd_move(char const*, unsigned char, int, int)+0x1d0> 2384c: 80 91 aa 03 lds r24, 0x03AA ; 0x8003aa 23850: 80 93 b7 02 sts 0x02B7, r24 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> menu_back_if_clicked(); } 23854: df 91 pop r29 23856: cf 91 pop r28 23858: 1f 91 pop r17 2385a: 0f 91 pop r16 2385c: ff 90 pop r15 2385e: ef 90 pop r14 23860: df 90 pop r13 23862: cf 90 pop r12 23864: bf 90 pop r11 23866: af 90 pop r10 23868: 9f 90 pop r9 2386a: 7f 90 pop r7 2386c: 6f 90 pop r6 2386e: 5f 90 pop r5 23870: 4f 90 pop r4 23872: 3f 90 pop r3 23874: 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(); 23876: 0d 94 00 d5 jmp 0x3aa00 ; 0x3aa00 { refresh_cmd_timeout(); if (! planner_queue_full()) { current_position[axis] += lcd_encoder; if (min_software_endstops && current_position[axis] < min) current_position[axis] = min; 2387a: c0 82 st Z, r12 2387c: d1 82 std Z+1, r13 ; 0x01 2387e: e2 82 std Z+2, r14 ; 0x02 23880: f3 82 std Z+3, r15 ; 0x03 23882: 82 cf rjmp .-252 ; 0x23788 <_lcd_move(char const*, unsigned char, int, int)+0x104> 00023884 : } 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); 23884: 22 ed ldi r18, 0xD2 ; 210 23886: 30 e0 ldi r19, 0x00 ; 0 23888: 50 e0 ldi r21, 0x00 ; 0 2388a: 40 e0 ldi r20, 0x00 ; 0 2388c: 62 e0 ldi r22, 0x02 ; 2 2388e: 82 e4 ldi r24, 0x42 ; 66 23890: 93 ea ldi r25, 0xA3 ; 163 23892: 0d 94 42 1b jmp 0x23684 ; 0x23684 <_lcd_move(char const*, unsigned char, int, int)> 00023896 : // 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); 23896: 24 ed ldi r18, 0xD4 ; 212 23898: 30 e0 ldi r19, 0x00 ; 0 2389a: 4c ef ldi r20, 0xFC ; 252 2389c: 5f ef ldi r21, 0xFF ; 255 2389e: 61 e0 ldi r22, 0x01 ; 1 238a0: 8f e3 ldi r24, 0x3F ; 63 238a2: 93 ea ldi r25, 0xA3 ; 163 238a4: 0d 94 42 1b jmp 0x23684 ; 0x23684 <_lcd_move(char const*, unsigned char, int, int)> 000238a8 : } // 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); 238a8: 2f ef ldi r18, 0xFF ; 255 238aa: 30 e0 ldi r19, 0x00 ; 0 238ac: 50 e0 ldi r21, 0x00 ; 0 238ae: 40 e0 ldi r20, 0x00 ; 0 238b0: 60 e0 ldi r22, 0x00 ; 0 238b2: 8c e3 ldi r24, 0x3C ; 60 238b4: 93 ea ldi r25, 0xA3 ; 163 238b6: 0d 94 42 1b jmp 0x23684 ; 0x23684 <_lcd_move(char const*, unsigned char, int, int)> 000238ba : //! ---------------------- //! @endcode static void lcd_menu_fails_stats() { MENU_BEGIN(); 238ba: 0f 94 96 d1 call 0x3a32c ; 0x3a32c 238be: 10 92 12 05 sts 0x0512, r1 ; 0x800512 238c2: 80 91 12 05 lds r24, 0x0512 ; 0x800512 238c6: 84 30 cpi r24, 0x04 ; 4 238c8: 28 f5 brcc .+74 ; 0x23914 238ca: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 238ce: 88 ea ldi r24, 0xA8 ; 168 238d0: 98 e4 ldi r25, 0x48 ; 72 238d2: 0e 94 ac 72 call 0xe558 ; 0xe558 238d6: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 MENU_ITEM_SUBMENU_P(_T(MSG_LAST_PRINT), lcd_menu_fails_stats_print); 238da: 80 ed ldi r24, 0xD0 ; 208 238dc: 9e e4 ldi r25, 0x4E ; 78 238de: 0e 94 ac 72 call 0xe558 ; 0xe558 238e2: 66 e8 ldi r22, 0x86 ; 134 238e4: 7a e3 ldi r23, 0x3A ; 58 238e6: 0f 94 14 d4 call 0x3a828 ; 0x3a828 MENU_ITEM_SUBMENU_P(_T(MSG_TOTAL), lcd_menu_fails_stats_total); 238ea: 88 ec ldi r24, 0xC8 ; 200 238ec: 9e e4 ldi r25, 0x4E ; 78 238ee: 0e 94 ac 72 call 0xe558 ; 0xe558 238f2: 60 e2 ldi r22, 0x20 ; 32 238f4: 7a e3 ldi r23, 0x3A ; 58 238f6: 0f 94 14 d4 call 0x3a828 ; 0x3a828 MENU_END(); 238fa: 0f 94 6a d1 call 0x3a2d4 ; 0x3a2d4 //! ---------------------- //! @endcode static void lcd_menu_fails_stats() { MENU_BEGIN(); 238fe: 80 91 12 05 lds r24, 0x0512 ; 0x800512 23902: 8f 5f subi r24, 0xFF ; 255 23904: 80 93 12 05 sts 0x0512, r24 ; 0x800512 23908: 80 91 14 05 lds r24, 0x0514 ; 0x800514 2390c: 8f 5f subi r24, 0xFF ; 255 2390e: 80 93 14 05 sts 0x0514, r24 ; 0x800514 23912: d7 cf rjmp .-82 ; 0x238c2 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(); } 23914: 08 95 ret 00023916 : //! | Material changes | MSG_MATERIAL_CHANGES c=18 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu() { MENU_BEGIN(); 23916: 0f 94 96 d1 call 0x3a32c ; 0x3a32c 2391a: 10 92 12 05 sts 0x0512, r1 ; 0x800512 2391e: 80 91 12 05 lds r24, 0x0512 ; 0x800512 23922: 84 30 cpi r24, 0x04 ; 4 23924: 68 f5 brcc .+90 ; 0x23980 23926: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 2392a: 88 ea ldi r24, 0xA8 ; 168 2392c: 98 e4 ldi r25, 0x48 ; 72 2392e: 0e 94 ac 72 call 0xe558 ; 0xe558 23932: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 MENU_ITEM_SUBMENU_P(_T(MSG_LAST_PRINT), lcd_menu_fails_stats_mmu_print); 23936: 80 ed ldi r24, 0xD0 ; 208 23938: 9e e4 ldi r25, 0x4E ; 78 2393a: 0e 94 ac 72 call 0xe558 ; 0xe558 2393e: 64 ec ldi r22, 0xC4 ; 196 23940: 79 e3 ldi r23, 0x39 ; 57 23942: 0f 94 14 d4 call 0x3a828 ; 0x3a828 MENU_ITEM_SUBMENU_P(_T(MSG_TOTAL), lcd_menu_fails_stats_mmu_total); 23946: 88 ec ldi r24, 0xC8 ; 200 23948: 9e e4 ldi r25, 0x4E ; 78 2394a: 0e 94 ac 72 call 0xe558 ; 0xe558 2394e: 66 ee ldi r22, 0xE6 ; 230 23950: 7a e3 ldi r23, 0x3A ; 58 23952: 0f 94 14 d4 call 0x3a828 ; 0x3a828 MENU_ITEM_SUBMENU_P(_T(MSG_MATERIAL_CHANGES), lcd_menu_toolchange_stats_mmu_total); 23956: 86 e6 ldi r24, 0x66 ; 102 23958: 9e e4 ldi r25, 0x4E ; 78 2395a: 0e 94 ac 72 call 0xe558 ; 0xe558 2395e: 60 e0 ldi r22, 0x00 ; 0 23960: 7b e3 ldi r23, 0x3B ; 59 23962: 0f 94 14 d4 call 0x3a828 ; 0x3a828 MENU_END(); 23966: 0f 94 6a d1 call 0x3a2d4 ; 0x3a2d4 //! | Material changes | MSG_MATERIAL_CHANGES c=18 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu() { MENU_BEGIN(); 2396a: 80 91 12 05 lds r24, 0x0512 ; 0x800512 2396e: 8f 5f subi r24, 0xFF ; 255 23970: 80 93 12 05 sts 0x0512, r24 ; 0x800512 23974: 80 91 14 05 lds r24, 0x0514 ; 0x800514 23978: 8f 5f subi r24, 0xFF ; 255 2397a: 80 93 14 05 sts 0x0514, r24 ; 0x800514 2397e: cf cf rjmp .-98 ; 0x2391e 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(); } 23980: 08 95 ret 00023982 : setFilamentAction(FilamentAction::None); } /// Reset the menu stack and clear the planned filament action flag static void __attribute__((noinline)) mFilamentResetMenuStack() { menu_back(bFilamentPreheatState ? 1 : 2); 23982: 80 91 63 06 lds r24, 0x0663 ; 0x800663 23986: 81 11 cpse r24, r1 23988: 03 c0 rjmp .+6 ; 0x23990 2398a: 82 e0 ldi r24, 0x02 ; 2 2398c: 0d 94 42 d4 jmp 0x3a884 ; 0x3a884 23990: 81 e0 ldi r24, 0x01 ; 1 23992: fc cf rjmp .-8 ; 0x2398c 00023994 : //! | Debug | c=18 //! @endcode //! ---------------------- //! @endcode static void lcd_support_menu() { 23994: ef 92 push r14 23996: ff 92 push r15 23998: 0f 93 push r16 2399a: 1f 93 push r17 2399c: cf 93 push r28 2399e: 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) 239a0: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 239a4: 88 23 and r24, r24 239a6: 29 f0 breq .+10 ; 0x239b2 239a8: 90 91 6d 02 lds r25, 0x026D ; 0x80026d 239ac: 92 30 cpi r25, 0x02 ; 2 239ae: 09 f0 breq .+2 ; 0x239b2 239b0: 80 c1 rjmp .+768 ; 0x23cb2 { // Menu was entered or SD card status has changed (plugged in or removed). // Initialize its status. _md->status = 1; 239b2: 81 e0 ldi r24, 0x01 ; 1 239b4: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 239b8: 80 91 01 17 lds r24, 0x1701 ; 0x801701 _md->is_flash_air = card.ToshibaFlashAir_isEnabled(); 239bc: 80 93 aa 03 sts 0x03AA, r24 ; 0x8003aa if (_md->is_flash_air) { 239c0: 88 23 and r24, r24 239c2: 21 f0 breq .+8 ; 0x239cc card.ToshibaFlashAir_GetIP((uint8_t*)(&_md->ip)); // ip == 0 if it failed 239c4: 8b ea ldi r24, 0xAB ; 171 239c6: 93 e0 ldi r25, 0x03 ; 3 239c8: 0f 94 ce 85 call 0x30b9c ; 0x30b9c { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; } MENU_BEGIN(); 239cc: 0f 94 96 d1 call 0x3a32c ; 0x3a32c 239d0: 10 92 12 05 sts 0x0512, r1 ; 0x800512 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); 239d4: 8a e9 ldi r24, 0x9A ; 154 239d6: e8 2e mov r14, r24 239d8: 81 ea ldi r24, 0xA1 ; 161 239da: 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]); 239dc: c9 e6 ldi r28, 0x69 ; 105 239de: d1 ea ldi r29, 0xA1 ; 161 239e0: 0f ea ldi r16, 0xAF ; 175 239e2: 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(); 239e4: 80 91 12 05 lds r24, 0x0512 ; 0x800512 239e8: 84 30 cpi r24, 0x04 ; 4 239ea: 08 f0 brcs .+2 ; 0x239ee 239ec: 89 c1 rjmp .+786 ; 0x23d00 239ee: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 239f2: 88 ea ldi r24, 0xA8 ; 168 239f4: 98 e4 ldi r25, 0x48 ; 72 239f6: 0e 94 ac 72 call 0xe558 ; 0xe558 239fa: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 MENU_ITEM_BACK_P(PSTR("Firmware:")); 239fe: 8b ef ldi r24, 0xFB ; 251 23a00: 91 ea ldi r25, 0xA1 ; 161 23a02: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 MENU_ITEM_BACK_P(PSTR(" " FW_VERSION_FULL)); 23a06: 8e ee ldi r24, 0xEE ; 238 23a08: 91 ea ldi r25, 0xA1 ; 161 23a0a: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 MENU_ITEM_BACK_P(PSTR(" Repo:" FW_REPOSITORY)); 23a0e: 80 ee ldi r24, 0xE0 ; 224 23a10: 91 ea ldi r25, 0xA1 ; 161 23a12: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 MENU_ITEM_BACK_P(PSTR(" Hash:" FW_COMMIT_HASH)); 23a16: 80 ed ldi r24, 0xD0 ; 208 23a18: 91 ea ldi r25, 0xA1 ; 161 23a1a: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 MENU_ITEM_BACK_P(_n("prusa3d.com"));////MSG_PRUSA3D c=18 23a1e: 87 e4 ldi r24, 0x47 ; 71 23a20: 9f e6 ldi r25, 0x6F ; 111 23a22: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 MENU_ITEM_BACK_P(_n("forum.prusa3d.com"));////MSG_PRUSA3D_FORUM c=18 23a26: 85 e3 ldi r24, 0x35 ; 53 23a28: 9f e6 ldi r25, 0x6F ; 111 23a2a: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 MENU_ITEM_BACK_P(_n("help.prusa3d.com"));////MSG_PRUSA3D_HELP c=18 23a2e: 84 e2 ldi r24, 0x24 ; 36 23a30: 9f e6 ldi r25, 0x6F ; 111 23a32: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 MENU_ITEM_BACK_P(STR_SEPARATOR); 23a36: 8a e8 ldi r24, 0x8A ; 138 23a38: 9a e8 ldi r25, 0x8A ; 138 23a3a: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 MENU_ITEM_BACK_P(PSTR(FILAMENT_SIZE)); 23a3e: 85 ec ldi r24, 0xC5 ; 197 23a40: 91 ea ldi r25, 0xA1 ; 161 23a42: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 MENU_ITEM_BACK_P(PSTR(ELECTRONICS)); 23a46: 8b eb ldi r24, 0xBB ; 187 23a48: 91 ea ldi r25, 0xA1 ; 161 23a4a: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 MENU_ITEM_BACK_P(PSTR(NOZZLE_TYPE)); 23a4e: 83 eb ldi r24, 0xB3 ; 179 23a50: 91 ea ldi r25, 0xA1 ; 161 23a52: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 MENU_ITEM_BACK_P(STR_SEPARATOR); 23a56: 8a e8 ldi r24, 0x8A ; 138 23a58: 9a e8 ldi r25, 0x8A ; 138 23a5a: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 MENU_ITEM_BACK_P(_T(MSG_DATE)); 23a5e: 8d e6 ldi r24, 0x6D ; 109 23a60: 9f e4 ldi r25, 0x4F ; 79 23a62: 0e 94 ac 72 call 0xe558 ; 0xe558 23a66: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 MENU_ITEM_BACK_P(PSTR(SOURCE_DATE_EPOCH)); 23a6a: 88 ea ldi r24, 0xA8 ; 168 23a6c: 91 ea ldi r25, 0xA1 ; 161 23a6e: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 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); 23a72: 8a e8 ldi r24, 0x8A ; 138 23a74: 9a e8 ldi r25, 0x8A ; 138 23a76: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 if (MMU2::mmu2.Enabled()) 23a7a: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 23a7e: 81 30 cpi r24, 0x01 ; 1 23a80: 09 f0 breq .+2 ; 0x23a84 23a82: 39 c1 rjmp .+626 ; 0x23cf6 { MENU_ITEM_BACK_P(_T(MSG_MMU_CONNECTED)); 23a84: 8d e5 ldi r24, 0x5D ; 93 23a86: 9f e4 ldi r25, 0x4F ; 79 23a88: 0e 94 ac 72 call 0xe558 ; 0xe558 23a8c: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 MENU_ITEM_BACK_P(PSTR(" FW:")); ////c=17 23a90: 83 ea ldi r24, 0xA3 ; 163 23a92: 91 ea ldi r25, 0xA1 ; 161 23a94: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 if (((menu_item - 1) == menu_line) && lcd_draw_update) 23a98: 80 91 15 05 lds r24, 0x0515 ; 0x800515 23a9c: 81 50 subi r24, 0x01 ; 1 23a9e: 99 0b sbc r25, r25 23aa0: 20 91 14 05 lds r18, 0x0514 ; 0x800514 23aa4: 28 17 cp r18, r24 23aa6: 19 06 cpc r1, r25 23aa8: 49 f5 brne .+82 ; 0x23afc 23aaa: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 23aae: 88 23 and r24, r24 23ab0: 29 f1 breq .+74 ; 0x23afc { lcd_set_cursor(6, menu_row); 23ab2: 60 91 12 05 lds r22, 0x0512 ; 0x800512 23ab6: 86 e0 ldi r24, 0x06 ; 6 23ab8: 0e 94 e0 6e call 0xddc0 ; 0xddc0 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) { 23abc: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 23ac0: 81 30 cpi r24, 0x01 ; 1 23ac2: 09 f0 breq .+2 ; 0x23ac6 23ac4: 11 c1 rjmp .+546 ; 0x23ce8 23ac6: 80 91 9a 13 lds r24, 0x139A ; 0x80139a 23aca: 90 91 9b 13 lds r25, 0x139B ; 0x80139b 23ace: 20 91 9c 13 lds r18, 0x139C ; 0x80139c MMU2::Version mmu_version = MMU2::mmu2.GetMMUFWVersion(); if (mmu_version.major > 0) 23ad2: 88 23 and r24, r24 23ad4: 09 f4 brne .+2 ; 0x23ad8 23ad6: 08 c1 rjmp .+528 ; 0x23ce8 lcd_printf_P(PSTR("%d.%d.%d"), mmu_version.major, mmu_version.minor, mmu_version.build); 23ad8: 1f 92 push r1 23ada: 2f 93 push r18 23adc: 1f 92 push r1 23ade: 9f 93 push r25 23ae0: 1f 92 push r1 23ae2: 8f 93 push r24 23ae4: ff 92 push r15 23ae6: ef 92 push r14 23ae8: 0e 94 b9 6e call 0xdd72 ; 0xdd72 23aec: 8d b7 in r24, 0x3d ; 61 23aee: 9e b7 in r25, 0x3e ; 62 23af0: 08 96 adiw r24, 0x08 ; 8 23af2: 0f b6 in r0, 0x3f ; 63 23af4: f8 94 cli 23af6: 9e bf out 0x3e, r25 ; 62 23af8: 0f be out 0x3f, r0 ; 63 23afa: 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) { 23afc: 80 91 aa 03 lds r24, 0x03AA ; 0x8003aa 23b00: 88 23 and r24, r24 23b02: 09 f4 brne .+2 ; 0x23b06 23b04: 40 c0 rjmp .+128 ; 0x23b86 MENU_ITEM_BACK_P(STR_SEPARATOR); 23b06: 8a e8 ldi r24, 0x8A ; 138 23b08: 9a e8 ldi r25, 0x8A ; 138 23b0a: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 MENU_ITEM_BACK_P(PSTR("FlashAir IP Addr:")); ////MSG_FLASHAIR c=18 23b0e: 89 e7 ldi r24, 0x79 ; 121 23b10: 91 ea ldi r25, 0xA1 ; 161 23b12: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 MENU_ITEM_BACK_P(PSTR(" ")); 23b16: 87 e7 ldi r24, 0x77 ; 119 23b18: 91 ea ldi r25, 0xA1 ; 161 23b1a: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 if (((menu_item - 1) == menu_line) && lcd_draw_update) { 23b1e: 80 91 15 05 lds r24, 0x0515 ; 0x800515 23b22: 81 50 subi r24, 0x01 ; 1 23b24: 99 0b sbc r25, r25 23b26: 20 91 14 05 lds r18, 0x0514 ; 0x800514 23b2a: 28 17 cp r18, r24 23b2c: 19 06 cpc r1, r25 23b2e: 59 f5 brne .+86 ; 0x23b86 23b30: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 23b34: 88 23 and r24, r24 23b36: 39 f1 breq .+78 ; 0x23b86 lcd_set_cursor(2, menu_row); 23b38: 60 91 12 05 lds r22, 0x0512 ; 0x800512 23b3c: 82 e0 ldi r24, 0x02 ; 2 23b3e: 0e 94 e0 6e call 0xddc0 ; 0xddc0 23b42: 80 91 ae 03 lds r24, 0x03AE ; 0x8003ae 23b46: 1f 92 push r1 23b48: 8f 93 push r24 23b4a: 80 91 ad 03 lds r24, 0x03AD ; 0x8003ad 23b4e: 1f 92 push r1 23b50: 8f 93 push r24 23b52: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 23b56: 1f 92 push r1 23b58: 8f 93 push r24 23b5a: 80 91 ab 03 lds r24, 0x03AB ; 0x8003ab 23b5e: 1f 92 push r1 23b60: 8f 93 push r24 23b62: df 93 push r29 23b64: cf 93 push r28 23b66: 1f 93 push r17 23b68: 0f 93 push r16 23b6a: 0f 94 33 db call 0x3b666 ; 0x3b666 ip4_to_str(_md->ip_str, (uint8_t*)(&_md->ip)); lcd_print(_md->ip_str); 23b6e: 8f ea ldi r24, 0xAF ; 175 23b70: 93 e0 ldi r25, 0x03 ; 3 23b72: 0e 94 e7 70 call 0xe1ce ; 0xe1ce 23b76: 8d b7 in r24, 0x3d ; 61 23b78: 9e b7 in r25, 0x3e ; 62 23b7a: 0c 96 adiw r24, 0x0c ; 12 23b7c: 0f b6 in r0, 0x3f ; 63 23b7e: f8 94 cli 23b80: 9e bf out 0x3e, r25 ; 62 23b82: 0f be out 0x3f, r0 ; 63 23b84: 8d bf out 0x3d, r24 ; 61 } } // Show the printer IP address, if it is available. if (IP_address) { 23b86: 80 91 5e 06 lds r24, 0x065E ; 0x80065e 23b8a: 90 91 5f 06 lds r25, 0x065F ; 0x80065f 23b8e: a0 91 60 06 lds r26, 0x0660 ; 0x800660 23b92: b0 91 61 06 lds r27, 0x0661 ; 0x800661 23b96: 89 2b or r24, r25 23b98: 8a 2b or r24, r26 23b9a: 8b 2b or r24, r27 23b9c: 09 f4 brne .+2 ; 0x23ba0 23b9e: 42 c0 rjmp .+132 ; 0x23c24 MENU_ITEM_BACK_P(STR_SEPARATOR); 23ba0: 8a e8 ldi r24, 0x8A ; 138 23ba2: 9a e8 ldi r25, 0x8A ; 138 23ba4: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 MENU_ITEM_BACK_P(_T(MSG_PRINTER_IP)); 23ba8: 80 e4 ldi r24, 0x40 ; 64 23baa: 9f e4 ldi r25, 0x4F ; 79 23bac: 0e 94 ac 72 call 0xe558 ; 0xe558 23bb0: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 MENU_ITEM_BACK_P(PSTR(" ")); 23bb4: 85 e7 ldi r24, 0x75 ; 117 23bb6: 91 ea ldi r25, 0xA1 ; 161 23bb8: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 if (((menu_item - 1) == menu_line) && lcd_draw_update) { 23bbc: 80 91 15 05 lds r24, 0x0515 ; 0x800515 23bc0: 81 50 subi r24, 0x01 ; 1 23bc2: 99 0b sbc r25, r25 23bc4: 20 91 14 05 lds r18, 0x0514 ; 0x800514 23bc8: 28 17 cp r18, r24 23bca: 19 06 cpc r1, r25 23bcc: 59 f5 brne .+86 ; 0x23c24 23bce: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 23bd2: 88 23 and r24, r24 23bd4: 39 f1 breq .+78 ; 0x23c24 lcd_set_cursor(2, menu_row); 23bd6: 60 91 12 05 lds r22, 0x0512 ; 0x800512 23bda: 82 e0 ldi r24, 0x02 ; 2 23bdc: 0e 94 e0 6e call 0xddc0 ; 0xddc0 23be0: 80 91 61 06 lds r24, 0x0661 ; 0x800661 23be4: 1f 92 push r1 23be6: 8f 93 push r24 23be8: 80 91 60 06 lds r24, 0x0660 ; 0x800660 23bec: 1f 92 push r1 23bee: 8f 93 push r24 23bf0: 80 91 5f 06 lds r24, 0x065F ; 0x80065f 23bf4: 1f 92 push r1 23bf6: 8f 93 push r24 23bf8: 80 91 5e 06 lds r24, 0x065E ; 0x80065e 23bfc: 1f 92 push r1 23bfe: 8f 93 push r24 23c00: df 93 push r29 23c02: cf 93 push r28 23c04: 1f 93 push r17 23c06: 0f 93 push r16 23c08: 0f 94 33 db call 0x3b666 ; 0x3b666 ip4_to_str(_md->ip_str, (uint8_t*)(&IP_address)); lcd_print(_md->ip_str); 23c0c: 8f ea ldi r24, 0xAF ; 175 23c0e: 93 e0 ldi r25, 0x03 ; 3 23c10: 0e 94 e7 70 call 0xe1ce ; 0xe1ce 23c14: 8d b7 in r24, 0x3d ; 61 23c16: 9e b7 in r25, 0x3e ; 62 23c18: 0c 96 adiw r24, 0x0c ; 12 23c1a: 0f b6 in r0, 0x3f ; 63 23c1c: f8 94 cli 23c1e: 9e bf out 0x3e, r25 ; 62 23c20: 0f be out 0x3f, r0 ; 63 23c22: 8d bf out 0x3d, r24 ; 61 } } MENU_ITEM_BACK_P(STR_SEPARATOR); 23c24: 8a e8 ldi r24, 0x8A ; 138 23c26: 9a e8 ldi r25, 0x8A ; 138 23c28: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 MENU_ITEM_SUBMENU_P(_T(MSG_XYZ_DETAILS), lcd_menu_xyz_y_min); 23c2c: 8d e2 ldi r24, 0x2D ; 45 23c2e: 9f e4 ldi r25, 0x4F ; 79 23c30: 0e 94 ac 72 call 0xe558 ; 0xe558 23c34: 68 e0 ldi r22, 0x08 ; 8 23c36: 7b e3 ldi r23, 0x3B ; 59 23c38: 0f 94 14 d4 call 0x3a828 ; 0x3a828 MENU_ITEM_SUBMENU_P(_T(MSG_INFO_EXTRUDER), lcd_menu_extruder_info); 23c3c: 8d e1 ldi r24, 0x1D ; 29 23c3e: 9f e4 ldi r25, 0x4F ; 79 23c40: 0e 94 ac 72 call 0xe558 ; 0xe558 23c44: 6c e4 ldi r22, 0x4C ; 76 23c46: 79 e3 ldi r23, 0x39 ; 57 23c48: 0f 94 14 d4 call 0x3a828 ; 0x3a828 MENU_ITEM_SUBMENU_P(_T(MSG_INFO_SENSORS), lcd_menu_show_sensors_state); 23c4c: 8f e0 ldi r24, 0x0F ; 15 23c4e: 9f e4 ldi r25, 0x4F ; 79 23c50: 0e 94 ac 72 call 0xe558 ; 0xe558 23c54: 65 e2 ldi r22, 0x25 ; 37 23c56: 73 ee ldi r23, 0xE3 ; 227 23c58: 0f 94 14 d4 call 0x3a828 ; 0x3a828 #ifdef TMC2130 MENU_ITEM_SUBMENU_P(_T(MSG_BELT_STATUS), lcd_menu_belt_status); 23c5c: 81 e0 ldi r24, 0x01 ; 1 23c5e: 9f e4 ldi r25, 0x4F ; 79 23c60: 0e 94 ac 72 call 0xe558 ; 0xe558 23c64: 6e e0 ldi r22, 0x0E ; 14 23c66: 7b e3 ldi r23, 0x3B ; 59 23c68: 0f 94 14 d4 call 0x3a828 ; 0x3a828 #endif //TMC2130 MENU_ITEM_SUBMENU_P(_T(MSG_MENU_TEMPERATURES), lcd_menu_temperatures); 23c6c: 82 ef ldi r24, 0xF2 ; 242 23c6e: 9e e4 ldi r25, 0x4E ; 78 23c70: 0e 94 ac 72 call 0xe558 ; 0xe558 23c74: 62 e3 ldi r22, 0x32 ; 50 23c76: 79 e3 ldi r23, 0x39 ; 57 23c78: 0f 94 14 d4 call 0x3a828 ; 0x3a828 #if defined (VOLT_BED_PIN) || defined (VOLT_PWR_PIN) MENU_ITEM_SUBMENU_P(_T(MSG_MENU_VOLTAGES), lcd_menu_voltages); 23c7c: 87 ee ldi r24, 0xE7 ; 231 23c7e: 9e e4 ldi r25, 0x4E ; 78 23c80: 0e 94 ac 72 call 0xe558 ; 0xe558 23c84: 64 ea ldi r22, 0xA4 ; 164 23c86: 79 e3 ldi r23, 0x39 ; 57 23c88: 0f 94 14 d4 call 0x3a828 ; 0x3a828 #endif //defined VOLT_BED_PIN || defined VOLT_PWR_PIN #ifdef MENU_DUMP MENU_ITEM_FUNCTION_P(_n("Dump memory"), lcd_dump_memory); 23c8c: 60 e5 ldi r22, 0x50 ; 80 23c8e: 7a e3 ldi r23, 0x3A ; 58 23c90: 88 e1 ldi r24, 0x18 ; 24 23c92: 9f e6 ldi r25, 0x6F ; 111 23c94: 0f 94 13 d1 call 0x3a226 ; 0x3a226 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(); 23c98: 0f 94 6a d1 call 0x3a2d4 ; 0x3a2d4 { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; } MENU_BEGIN(); 23c9c: 80 91 12 05 lds r24, 0x0512 ; 0x800512 23ca0: 8f 5f subi r24, 0xFF ; 255 23ca2: 80 93 12 05 sts 0x0512, r24 ; 0x800512 23ca6: 80 91 14 05 lds r24, 0x0514 ; 0x800514 23caa: 8f 5f subi r24, 0xFF ; 255 23cac: 80 93 14 05 sts 0x0514, r24 ; 0x800514 23cb0: 99 ce rjmp .-718 ; 0x239e4 _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) 23cb2: 90 91 aa 03 lds r25, 0x03AA ; 0x8003aa 23cb6: 99 23 and r25, r25 23cb8: 09 f4 brne .+2 ; 0x23cbc 23cba: 88 ce rjmp .-752 ; 0x239cc 23cbc: 40 91 ab 03 lds r20, 0x03AB ; 0x8003ab 23cc0: 50 91 ac 03 lds r21, 0x03AC ; 0x8003ac 23cc4: 60 91 ad 03 lds r22, 0x03AD ; 0x8003ad 23cc8: 70 91 ae 03 lds r23, 0x03AE ; 0x8003ae 23ccc: 45 2b or r20, r21 23cce: 46 2b or r20, r22 23cd0: 47 2b or r20, r23 23cd2: 09 f0 breq .+2 ; 0x23cd6 23cd4: 7b ce rjmp .-778 ; 0x239cc 23cd6: 8f 5f subi r24, 0xFF ; 255 23cd8: 80 31 cpi r24, 0x10 ; 16 23cda: 19 f0 breq .+6 ; 0x23ce2 23cdc: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 23ce0: 75 ce rjmp .-790 ; 0x239cc { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; 23ce2: 10 92 a9 03 sts 0x03A9, r1 ; 0x8003a9 23ce6: 72 ce rjmp .-796 ; 0x239cc 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)); 23ce8: 83 e5 ldi r24, 0x53 ; 83 23cea: 9f e4 ldi r25, 0x4F ; 79 23cec: 0e 94 ac 72 call 0xe558 ; 0xe558 23cf0: 0e 94 cb 6e call 0xdd96 ; 0xdd96 23cf4: 03 cf rjmp .-506 ; 0x23afc } } else MENU_ITEM_BACK_P(PSTR("MMU N/A")); 23cf6: 8b e8 ldi r24, 0x8B ; 139 23cf8: 91 ea ldi r25, 0xA1 ; 161 23cfa: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 23cfe: fe ce rjmp .-516 ; 0x23afc #endif //EMERGENCY_HANDLERS MENU_ITEM_SUBMENU_P(PSTR("Debug"), lcd_menu_debug);////MSG_DEBUG c=18 #endif /* DEBUG_BUILD */ MENU_END(); } 23d00: df 91 pop r29 23d02: cf 91 pop r28 23d04: 1f 91 pop r17 23d06: 0f 91 pop r16 23d08: ff 90 pop r15 23d0a: ef 90 pop r14 23d0c: 08 95 ret 00023d0e : { 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) { 23d0e: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 23d12: 81 11 cpse r24, r1 23d14: 19 c0 rjmp .+50 ; 0x23d48 lcd_clear(); 23d16: 0e 94 13 6f call 0xde26 ; 0xde26 lcd_puts_P(_T(MSG_MATERIAL_CHANGES)); /// MSG_MATERIAL_CHANGES c=18 23d1a: 86 e6 ldi r24, 0x66 ; 102 23d1c: 9e e4 ldi r25, 0x4E ; 78 23d1e: 0e 94 ac 72 call 0xe558 ; 0xe558 23d22: 0e 94 cb 6e call 0xdd96 ; 0xdd96 lcd_putc(':'); 23d26: 8a e3 ldi r24, 0x3A ; 58 23d28: 0e 94 cf 6e call 0xdd9e ; 0xdd9e lcd_set_cursor(10, 1); 23d2c: 61 e0 ldi r22, 0x01 ; 1 23d2e: 8a e0 ldi r24, 0x0A ; 10 23d30: 0e 94 e0 6e call 0xddc0 ; 0xddc0 lcd_print(eeprom_read_dword((uint32_t*)EEPROM_MMU_MATERIAL_CHANGES)); 23d34: 88 ea ldi r24, 0xA8 ; 168 23d36: 9c e0 ldi r25, 0x0C ; 12 23d38: 0f 94 24 dc call 0x3b848 ; 0x3b848 void lcd_print(unsigned long n, int base) { if (base == 0) lcd_write(n); else lcd_printNumber(n, base); 23d3c: 4a e0 ldi r20, 0x0A ; 10 23d3e: 0e 94 34 70 call 0xe068 ; 0xe068 _md->initialized = true; 23d42: 81 e0 ldi r24, 0x01 ; 1 23d44: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 } menu_back_if_clicked(); 23d48: 0d 94 00 d5 jmp 0x3aa00 ; 0x3aa00 00023d4c : #endif //DEBUG_DISABLE_LCD_STATUS_LINE } static void lcdui_refresh(uint8_t clear = true) { clear ? lcd_refresh() : lcd_refresh_noclear(); 23d4c: 0e 94 8c 6f call 0xdf18 ; 0xdf18 lcd_status_message_idx = 0; // Re-draw message from beginning 23d50: 10 92 1e 05 sts 0x051E, r1 ; 0x80051e <_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); 23d54: 20 e0 ldi r18, 0x00 ; 0 23d56: 41 e0 ldi r20, 0x01 ; 1 23d58: 70 e0 ldi r23, 0x00 ; 0 23d5a: 60 e0 ldi r22, 0x00 ; 0 23d5c: 88 e1 ldi r24, 0x18 ; 24 23d5e: 99 e3 ldi r25, 0x39 ; 57 23d60: 0f 94 c0 d1 call 0x3a380 ; 0x3a380 menu_depth = 0; 23d64: 10 92 f8 03 sts 0x03F8, r1 ; 0x8003f8 eFilamentAction = FilamentAction::None; // i.e. non-autoLoad 23d68: 10 92 a7 03 sts 0x03A7, r1 ; 0x8003a7 } 23d6c: 08 95 ret 00023d6e : //! | | //! ---------------------- //! @endcode void pid_extruder() { lcd_clear(); 23d6e: 0e 94 13 6f call 0xde26 ; 0xde26 lcd_puts_at_P(0, 0, _T(MSG_SET_TEMPERATURE)); 23d72: 87 ea ldi r24, 0xA7 ; 167 23d74: 91 e5 ldi r25, 0x51 ; 81 23d76: 0e 94 ac 72 call 0xe558 ; 0xe558 23d7a: ac 01 movw r20, r24 23d7c: 60 e0 ldi r22, 0x00 ; 0 23d7e: 80 e0 ldi r24, 0x00 ; 0 23d80: 0e 94 f4 6e call 0xdde8 ; 0xdde8 pid_temp += lcd_encoder; 23d84: 80 91 4b 02 lds r24, 0x024B ; 0x80024b <_ZL8pid_temp.lto_priv.441> 23d88: 90 91 4c 02 lds r25, 0x024C ; 0x80024c <_ZL8pid_temp.lto_priv.441+0x1> 23d8c: 20 91 70 06 lds r18, 0x0670 ; 0x800670 23d90: 30 91 71 06 lds r19, 0x0671 ; 0x800671 23d94: 82 0f add r24, r18 23d96: 93 1f adc r25, r19 if (pid_temp > HEATER_0_MAXTEMP) pid_temp = HEATER_0_MAXTEMP; 23d98: 82 33 cpi r24, 0x32 ; 50 23d9a: 21 e0 ldi r18, 0x01 ; 1 23d9c: 92 07 cpc r25, r18 23d9e: 50 f1 brcs .+84 ; 0x23df4 23da0: 81 e3 ldi r24, 0x31 ; 49 23da2: 91 e0 ldi r25, 0x01 ; 1 else if (pid_temp < HEATER_0_MINTEMP) pid_temp = HEATER_0_MINTEMP; 23da4: 90 93 4c 02 sts 0x024C, r25 ; 0x80024c <_ZL8pid_temp.lto_priv.441+0x1> 23da8: 80 93 4b 02 sts 0x024B, r24 ; 0x80024b <_ZL8pid_temp.lto_priv.441> lcd_encoder = 0; 23dac: 10 92 71 06 sts 0x0671, r1 ; 0x800671 23db0: 10 92 70 06 sts 0x0670, r1 ; 0x800670 lcd_set_cursor(1, 2); 23db4: 62 e0 ldi r22, 0x02 ; 2 23db6: 81 e0 ldi r24, 0x01 ; 1 23db8: 0e 94 e0 6e call 0xddc0 ; 0xddc0 lcd_printf_P(PSTR("%3u"), pid_temp); 23dbc: 80 91 4c 02 lds r24, 0x024C ; 0x80024c <_ZL8pid_temp.lto_priv.441+0x1> 23dc0: 8f 93 push r24 23dc2: 80 91 4b 02 lds r24, 0x024B ; 0x80024b <_ZL8pid_temp.lto_priv.441> 23dc6: 8f 93 push r24 23dc8: 86 e5 ldi r24, 0x56 ; 86 23dca: 93 ea ldi r25, 0xA3 ; 163 23dcc: 9f 93 push r25 23dce: 8f 93 push r24 23dd0: 0e 94 b9 6e call 0xdd72 ; 0xdd72 if (lcd_clicked()) { 23dd4: 0e 94 fd 70 call 0xe1fa ; 0xe1fa 23dd8: 0f 90 pop r0 23dda: 0f 90 pop r0 23ddc: 0f 90 pop r0 23dde: 0f 90 pop r0 23de0: 88 23 and r24, r24 23de2: 71 f0 breq .+28 ; 0x23e00 lcd_commands_type = LcdCommands::PidExtruder; 23de4: 83 e0 ldi r24, 0x03 ; 3 23de6: 80 93 b4 0d sts 0x0DB4, r24 ; 0x800db4 lcd_return_to_status(); 23dea: 0f 94 a6 1e call 0x23d4c ; 0x23d4c lcd_update(2); 23dee: 82 e0 ldi r24, 0x02 ; 2 23df0: 0c 94 a7 6e jmp 0xdd4e ; 0xdd4e { 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; 23df4: 8a 30 cpi r24, 0x0A ; 10 23df6: 91 05 cpc r25, r1 23df8: a8 f6 brcc .-86 ; 0x23da4 23dfa: 8a e0 ldi r24, 0x0A ; 10 23dfc: 90 e0 ldi r25, 0x00 ; 0 23dfe: d2 cf rjmp .-92 ; 0x23da4 lcd_commands_type = LcdCommands::PidExtruder; lcd_return_to_status(); lcd_update(2); } } 23e00: 08 95 ret 00023e02 : } 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){ 23e02: 0f 93 push r16 23e04: 1f 93 push r17 23e06: cf 93 push r28 23e08: df 93 push r29 23e0a: ec 01 movw r28, r24 23e0c: cb 01 movw r24, r22 23e0e: ba 01 movw r22, r20 static const char m1[] PROGMEM = "Please restart"; switch(state){ 23e10: 4a 81 ldd r20, Y+2 ; 0x02 23e12: 41 30 cpi r20, 0x01 ; 1 23e14: 29 f0 breq .+10 ; 0x23e20 23e16: 88 f0 brcs .+34 ; 0x23e3a 23e18: 42 30 cpi r20, 0x02 ; 2 23e1a: 09 f1 breq .+66 ; 0x23e5e 23e1c: 43 30 cpi r20, 0x03 ; 3 23e1e: d1 f4 brne .+52 ; 0x23e54 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 ){ 23e20: 8b 81 ldd r24, Y+3 ; 0x03 23e22: 81 11 cpse r24, r1 23e24: 25 c0 rjmp .+74 ; 0x23e70 state = next_state; // advance to the next state 23e26: 82 e0 ldi r24, 0x02 ; 2 23e28: 8a 83 std Y+2, r24 ; 0x02 lcd_setalertstatuspgm(next_msg, LCD_STATUS_CRITICAL); 23e2a: 63 e0 ldi r22, 0x03 ; 3 23e2c: 89 e8 ldi r24, 0x89 ; 137 23e2e: 9e e9 ldi r25, 0x9E ; 158 23e30: 0e 94 1d f1 call 0x1e23a ; 0x1e23a repeat = ALERT_AUTOMATON_SPEED_DIV; // and prepare repeating for it too 23e34: 85 e0 ldi r24, 0x05 ; 5 } else { --repeat; 23e36: 8b 83 std Y+3, r24 ; 0x03 23e38: 0d c0 rjmp .+26 ; 0x23e54 //! @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 ){ 23e3a: a9 01 movw r20, r18 23e3c: 98 01 movw r18, r16 23e3e: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 23e42: 18 16 cp r1, r24 23e44: 3c f4 brge .+14 ; 0x23e54 lcd_setalertstatuspgm(m2, LCD_STATUS_CRITICAL); 23e46: 63 e0 ldi r22, 0x03 ; 3 23e48: 88 81 ld r24, Y 23e4a: 99 81 ldd r25, Y+1 ; 0x01 23e4c: 0e 94 1d f1 call 0x1e23a ; 0x1e23a state = States::TempAboveMintemp; 23e50: 81 e0 ldi r24, 0x01 ; 1 23e52: 8a 83 std Y+2, r24 ; 0x02 break; case States::ShowPleaseRestart: // displaying "Please restart" substep(m2, States::ShowMintemp); break; } } 23e54: df 91 pop r29 23e56: cf 91 pop r28 23e58: 1f 91 pop r17 23e5a: 0f 91 pop r16 23e5c: 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 ){ 23e5e: 8b 81 ldd r24, Y+3 ; 0x03 23e60: 81 11 cpse r24, r1 23e62: 06 c0 rjmp .+12 ; 0x23e70 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); 23e64: 88 81 ld r24, Y 23e66: 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 23e68: 23 e0 ldi r18, 0x03 ; 3 23e6a: 2a 83 std Y+2, r18 ; 0x02 lcd_setalertstatuspgm(next_msg, LCD_STATUS_CRITICAL); 23e6c: 63 e0 ldi r22, 0x03 ; 3 23e6e: e0 cf rjmp .-64 ; 0x23e30 repeat = ALERT_AUTOMATON_SPEED_DIV; // and prepare repeating for it too } else { --repeat; 23e70: 81 50 subi r24, 0x01 ; 1 23e72: e1 cf rjmp .-62 ; 0x23e36 00023e74 : } } static void temp_runaway_stop(bool isPreheat, bool isBed) { 23e74: cf 93 push r28 if(IsStopped() == false) { 23e76: 90 91 11 05 lds r25, 0x0511 ; 0x800511 23e7a: 91 11 cpse r25, r1 23e7c: 18 c0 rjmp .+48 ; 0x23eae 23e7e: c6 2f mov r28, r22 if (isPreheat) { 23e80: 88 23 and r24, r24 23e82: c9 f0 breq .+50 ; 0x23eb6 lcd_setalertstatuspgm(isBed? PSTR("BED PREHEAT ERROR") : PSTR("PREHEAT ERROR"), LCD_STATUS_CRITICAL); 23e84: 8d e2 ldi r24, 0x2D ; 45 23e86: 9e e9 ldi r25, 0x9E ; 158 23e88: 66 23 and r22, r22 23e8a: 11 f0 breq .+4 ; 0x23e90 23e8c: 8b e3 ldi r24, 0x3B ; 59 23e8e: 9e e9 ldi r25, 0x9E ; 158 23e90: 63 e0 ldi r22, 0x03 ; 3 23e92: 0e 94 1d f1 call 0x1e23a ; 0x1e23a SERIAL_ERROR_START; 23e96: 8a e9 ldi r24, 0x9A ; 154 23e98: 9b ea ldi r25, 0xAB ; 171 23e9a: 0e 94 50 77 call 0xeea0 ; 0xeea0 if (isBed) { SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HEATBED)"); 23e9e: 8a e0 ldi r24, 0x0A ; 10 23ea0: 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) { 23ea2: c1 11 cpse r28, r1 23ea4: 02 c0 rjmp .+4 ; 0x23eaa SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HEATBED)"); } else { SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HOTEND)"); 23ea6: 88 ee ldi r24, 0xE8 ; 232 23ea8: 9d e9 ldi r25, 0x9D ; 157 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"); 23eaa: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 } } prusa_statistics(0); prusa_statistics(isPreheat? 91 : 90); } ThermalStop(); 23eae: 80 e0 ldi r24, 0x00 ; 0 } 23eb0: cf 91 pop r28 } } prusa_statistics(0); prusa_statistics(isPreheat? 91 : 90); } ThermalStop(); 23eb2: 0c 94 ac 79 jmp 0xf358 ; 0xf358 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); 23eb6: 84 ec ldi r24, 0xC4 ; 196 23eb8: 9d e9 ldi r25, 0x9D ; 157 23eba: 66 23 and r22, r22 23ebc: 11 f0 breq .+4 ; 0x23ec2 23ebe: 84 ed ldi r24, 0xD4 ; 212 23ec0: 9d e9 ldi r25, 0x9D ; 157 23ec2: 63 e0 ldi r22, 0x03 ; 3 23ec4: 0e 94 1d f1 call 0x1e23a ; 0x1e23a SERIAL_ERROR_START; 23ec8: 8a e9 ldi r24, 0x9A ; 154 23eca: 9b ea ldi r25, 0xAB ; 171 23ecc: 0e 94 50 77 call 0xeea0 ; 0xeea0 if (isBed) { SERIAL_ERRORLNPGM(" HEATBED THERMAL RUNAWAY"); 23ed0: 8b ea ldi r24, 0xAB ; 171 23ed2: 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) { 23ed4: c1 11 cpse r28, r1 23ed6: e9 cf rjmp .-46 ; 0x23eaa SERIAL_ERRORLNPGM(" HEATBED THERMAL RUNAWAY"); } else { SERIAL_ERRORLNPGM(" HOTEND THERMAL RUNAWAY"); 23ed8: 83 e9 ldi r24, 0x93 ; 147 23eda: 9d e9 ldi r25, 0x9D ; 157 23edc: e6 cf rjmp .-52 ; 0x23eaa 00023ede : static void Sound_DoSound_Prompt(void) { backlight_wake(2); 23ede: 82 e0 ldi r24, 0x02 ; 2 23ee0: 0e 94 6d 8a call 0x114da ; 0x114da WRITE(BEEPER,HIGH); 23ee4: 9f b7 in r25, 0x3f ; 63 23ee6: f8 94 cli 23ee8: e2 e0 ldi r30, 0x02 ; 2 23eea: f1 e0 ldi r31, 0x01 ; 1 23eec: 80 81 ld r24, Z 23eee: 84 60 ori r24, 0x04 ; 4 23ef0: 80 83 st Z, r24 23ef2: 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); 23ef4: 2f ef ldi r18, 0xFF ; 255 23ef6: 89 e6 ldi r24, 0x69 ; 105 23ef8: 98 e1 ldi r25, 0x18 ; 24 23efa: 21 50 subi r18, 0x01 ; 1 23efc: 80 40 sbci r24, 0x00 ; 0 23efe: 90 40 sbci r25, 0x00 ; 0 23f00: e1 f7 brne .-8 ; 0x23efa 23f02: 00 c0 rjmp .+0 ; 0x23f04 23f04: 00 00 nop _delay_ms(500); WRITE(BEEPER,LOW); 23f06: 9f b7 in r25, 0x3f ; 63 23f08: f8 94 cli 23f0a: 80 81 ld r24, Z 23f0c: 8b 7f andi r24, 0xFB ; 251 23f0e: 80 83 st Z, r24 23f10: 9f bf out 0x3f, r25 ; 63 } 23f12: 08 95 ret 00023f14 : } #endif // not defined TMC2130 static void lcd_print_state(uint8_t state) { switch (state) { 23f14: 81 30 cpi r24, 0x01 ; 1 23f16: 21 f4 brne .+8 ; 0x23f20 case STATE_ON: lcd_puts_P(_N(" 1")); 23f18: 8e ee ldi r24, 0xEE ; 238 23f1a: 9f e6 ldi r25, 0x6F ; 111 break; case STATE_OFF: lcd_puts_P(_N(" 0")); 23f1c: 0c 94 cb 6e jmp 0xdd96 ; 0xdd96 23f20: 8a ee ldi r24, 0xEA ; 234 23f22: 9f e6 ldi r25, 0x6F ; 111 23f24: fb cf rjmp .-10 ; 0x23f1c 00023f26 : //! @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) { 23f26: cf 92 push r12 23f28: df 92 push r13 23f2a: ef 92 push r14 23f2c: ff 92 push r15 23f2e: 0f 93 push r16 23f30: 1f 93 push r17 23f32: cf 93 push r28 23f34: df 93 push r29 23f36: d8 2f mov r29, r24 23f38: 6b 01 movw r12, r22 23f3a: 7a 01 movw r14, r20 23f3c: c2 2f mov r28, r18 lcd_putc_at(0, 3, selected == LCD_LEFT_BUTTON_CHOICE ? '>': ' '); 23f3e: 40 e2 ldi r20, 0x20 ; 32 23f40: 81 11 cpse r24, r1 23f42: 01 c0 rjmp .+2 ; 0x23f46 23f44: 4e e3 ldi r20, 0x3E ; 62 23f46: 63 e0 ldi r22, 0x03 ; 3 23f48: 80 e0 ldi r24, 0x00 ; 0 23f4a: 0e 94 00 6f call 0xde00 ; 0xde00 lcd_puts_P(first_choice); 23f4e: c6 01 movw r24, r12 23f50: 0e 94 cb 6e call 0xdd96 ; 0xdd96 lcd_putc_at(second_col, 3, selected == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 23f54: 40 e2 ldi r20, 0x20 ; 32 23f56: d1 30 cpi r29, 0x01 ; 1 23f58: 09 f4 brne .+2 ; 0x23f5c 23f5a: 4e e3 ldi r20, 0x3E ; 62 23f5c: 63 e0 ldi r22, 0x03 ; 3 23f5e: 8c 2f mov r24, r28 23f60: 0e 94 00 6f call 0xde00 ; 0xde00 lcd_puts_P(second_choice); 23f64: c7 01 movw r24, r14 23f66: 0e 94 cb 6e call 0xdd96 ; 0xdd96 if (third_choice) { 23f6a: 01 15 cp r16, r1 23f6c: 11 05 cpc r17, r1 23f6e: 19 f1 breq .+70 ; 0x23fb6 23f70: c8 01 movw r24, r16 23f72: 0f 94 da d9 call 0x3b3b4 ; 0x3b3b4 <__strlen_P> 23f76: d8 2e mov r13, r24 23f78: c7 01 movw r24, r14 23f7a: 0f 94 da d9 call 0x3b3b4 ; 0x3b3b4 <__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; 23f7e: 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;} 23f80: 93 e1 ldi r25, 0x13 ; 19 23f82: 9d 19 sub r25, r13 23f84: 8c 0f add r24, r28 23f86: 89 17 cp r24, r25 23f88: 08 f4 brcc .+2 ; 0x23f8c 23f8a: 89 2f mov r24, r25 23f8c: 83 31 cpi r24, 0x13 ; 19 23f8e: 08 f0 brcs .+2 ; 0x23f92 23f90: 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 ? '>': ' '); 23f92: 40 e2 ldi r20, 0x20 ; 32 23f94: d2 30 cpi r29, 0x02 ; 2 23f96: 09 f4 brne .+2 ; 0x23f9a 23f98: 4e e3 ldi r20, 0x3E ; 62 23f9a: 63 e0 ldi r22, 0x03 ; 3 23f9c: 0e 94 00 6f call 0xde00 ; 0xde00 lcd_puts_P(third_choice); 23fa0: c8 01 movw r24, r16 } } 23fa2: df 91 pop r29 23fa4: cf 91 pop r28 23fa6: 1f 91 pop r17 23fa8: 0f 91 pop r16 23faa: ff 90 pop r15 23fac: ef 90 pop r14 23fae: df 90 pop r13 23fb0: 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); 23fb2: 0c 94 cb 6e jmp 0xdd96 ; 0xdd96 } } 23fb6: df 91 pop r29 23fb8: cf 91 pop r28 23fba: 1f 91 pop r17 23fbc: 0f 91 pop r16 23fbe: ff 90 pop r15 23fc0: ef 90 pop r14 23fc2: df 90 pop r13 23fc4: cf 90 pop r12 23fc6: 08 95 ret 00023fc8 : return multi_screen ? msgend : NULL; } const char* lcd_display_message_fullscreen_P(const char *msg) { 23fc8: cf 93 push r28 23fca: df 93 push r29 23fcc: ec 01 movw r28, r24 // Disable update of the screen by the usual lcd_update(0) routine. lcd_update_enable(false); 23fce: 80 e0 ldi r24, 0x00 ; 0 23fd0: 0e 94 25 6f call 0xde4a ; 0xde4a lcd_clear(); 23fd4: 0e 94 13 6f call 0xde26 ; 0xde26 return lcd_display_message_fullscreen_nonBlocking_P(msg); 23fd8: ce 01 movw r24, r28 } 23fda: df 91 pop r29 23fdc: 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); 23fde: 0d 94 ae 14 jmp 0x2295c ; 0x2295c 00023fe2 : * * This function is blocking. * @param msg message to be displayed from PROGMEM */ void lcd_show_fullscreen_message_and_wait_P(const char *msg) { 23fe2: cf 92 push r12 23fe4: df 92 push r13 23fe6: ef 92 push r14 23fe8: ff 92 push r15 23fea: 0f 93 push r16 23fec: 1f 93 push r17 23fee: cf 93 push r28 23ff0: df 93 push r29 23ff2: d8 2e mov r13, r24 23ff4: 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) 23ff6: 01 e0 ldi r16, 0x01 ; 1 23ff8: 80 91 6e 02 lds r24, 0x026E ; 0x80026e 23ffc: 81 11 cpse r24, r1 23ffe: 01 c0 rjmp .+2 ; 0x24002 24000: 00 e0 ldi r16, 0x00 ; 0 { lcd_update_enabled = false; 24002: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e LcdUpdateDisabler lcdUpdateDisabler; const char *msg_next = lcd_display_message_fullscreen_P(msg); 24006: 8d 2d mov r24, r13 24008: 9c 2d mov r25, r12 2400a: 0f 94 e4 1f call 0x23fc8 ; 0x23fc8 2400e: 7c 01 movw r14, r24 bool multi_screen = msg_next != NULL; lcd_consume_click(); 24010: 0e 94 f8 70 call 0xe1f0 ; 0xe1f0 KEEPALIVE_STATE(PAUSED_FOR_USER); 24014: 84 e0 ldi r24, 0x04 ; 4 24016: 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); 2401a: 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) { 2401c: 20 97 sbiw r28, 0x00 ; 0 2401e: 29 f4 brne .+10 ; 0x2402a // Display the confirm char. lcd_putc_at(19, 3, LCD_STR_CONFIRM[0]); 24020: 49 e8 ldi r20, 0x89 ; 137 24022: 63 e0 ldi r22, 0x03 ; 3 24024: 83 e1 ldi r24, 0x13 ; 19 24026: 0e 94 00 6f call 0xde00 ; 0xde00 * @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); 2402a: 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); 2402c: 82 e3 ldi r24, 0x32 ; 50 2402e: 90 e0 ldi r25, 0x00 ; 0 24030: 0e 94 e4 8c call 0x119c8 ; 0x119c8 if (lcd_clicked()) { 24034: 0e 94 fd 70 call 0xe1fa ; 0xe1fa 24038: 88 23 and r24, r24 2403a: 81 f0 breq .+32 ; 0x2405c if (msg_next == NULL) { 2403c: 20 97 sbiw r28, 0x00 ; 0 2403e: 81 f4 brne .+32 ; 0x24060 KEEPALIVE_STATE(IN_HANDLER); 24040: 82 e0 ldi r24, 0x02 ; 2 24042: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be } ~LcdUpdateDisabler() { lcd_update_enabled = m_updateEnabled; 24046: 00 93 6e 02 sts 0x026E, r16 ; 0x80026e if (msg_next == NULL) msg_next = msg; msg_next = lcd_display_message_fullscreen_P(msg_next); } } } 2404a: df 91 pop r29 2404c: cf 91 pop r28 2404e: 1f 91 pop r17 24050: 0f 91 pop r16 24052: ff 90 pop r15 24054: ef 90 pop r14 24056: df 90 pop r13 24058: cf 90 pop r12 2405a: 08 95 ret 2405c: 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) { 2405e: 31 f7 brne .-52 ; 0x2402c else { break; } } } if (multi_screen) { 24060: e1 14 cp r14, r1 24062: f1 04 cpc r15, r1 24064: d9 f2 breq .-74 ; 0x2401c if (msg_next == NULL) 24066: 20 97 sbiw r28, 0x00 ; 0 24068: 11 f4 brne .+4 ; 0x2406e msg_next = msg; 2406a: cd 2d mov r28, r13 2406c: dc 2d mov r29, r12 msg_next = lcd_display_message_fullscreen_P(msg_next); 2406e: ce 01 movw r24, r28 24070: 0f 94 e4 1f call 0x23fc8 ; 0x23fc8 24074: ec 01 movw r28, r24 24076: d2 cf rjmp .-92 ; 0x2401c 00024078 : lcd_show_fullscreen_message_and_wait_P(msg); } } } void lcd_temp_cal_show_result(bool result) { 24078: cf 93 push r28 2407a: c8 2f mov r28, r24 custom_message_type = CustomMsg::Status; 2407c: 10 92 c4 06 sts 0x06C4, r1 ; 0x8006c4 disable_x(); 24080: 17 9a sbi 0x02, 7 ; 2 24082: 10 92 8f 06 sts 0x068F, r1 ; 0x80068f disable_y(); 24086: 16 9a sbi 0x02, 6 ; 2 24088: 10 92 90 06 sts 0x0690, r1 ; 0x800690 disable_z(); disable_e0(); 2408c: 14 9a sbi 0x02, 4 ; 2 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 2408e: 10 92 73 06 sts 0x0673, r1 ; 0x800673 24092: 10 92 72 06 sts 0x0672, r1 ; 0x800672 24096: 68 2f mov r22, r24 24098: 86 ea ldi r24, 0xA6 ; 166 2409a: 9f e0 ldi r25, 0x0F ; 15 2409c: 0f 94 40 dc call 0x3b880 ; 0x3b880 240a0: 6c 2f mov r22, r28 240a2: 8f ea ldi r24, 0xAF ; 175 240a4: 9f e0 ldi r25, 0x0F ; 15 240a6: 0f 94 40 dc call 0x3b880 ; 0x3b880 // 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) { 240aa: cc 23 and r28, r28 240ac: 89 f0 breq .+34 ; 0x240d0 SERIAL_ECHOLNPGM("PINDA calibration done. Continue with pressing the knob."); 240ae: 85 e9 ldi r24, 0x95 ; 149 240b0: 93 ea ldi r25, 0xA3 ; 163 240b2: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 lcd_show_fullscreen_message_and_wait_P(_T(MSG_PINDA_CALIBRATION_DONE)); 240b6: 85 ed ldi r24, 0xD5 ; 213 240b8: 91 e5 ldi r25, 0x51 ; 81 } else { SERIAL_ECHOLNPGM("PINDA calibration failed. Continue with pressing the knob."); lcd_show_fullscreen_message_and_wait_P(_T(MSG_PINDA_CAL_FAILED)); 240ba: 0e 94 ac 72 call 0xe558 ; 0xe558 240be: 0f 94 f1 1f call 0x23fe2 ; 0x23fe2 } lcd_update_enable(true); 240c2: 81 e0 ldi r24, 0x01 ; 1 240c4: 0e 94 25 6f call 0xde4a ; 0xde4a lcd_update(2); 240c8: 82 e0 ldi r24, 0x02 ; 2 } 240ca: 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); 240cc: 0c 94 a7 6e jmp 0xdd4e ; 0xdd4e 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."); 240d0: 8a e5 ldi r24, 0x5A ; 90 240d2: 93 ea ldi r25, 0xA3 ; 163 240d4: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 lcd_show_fullscreen_message_and_wait_P(_T(MSG_PINDA_CAL_FAILED)); 240d8: 8a eb ldi r24, 0xBA ; 186 240da: 91 e5 ldi r25, 0x51 ; 81 240dc: ee cf rjmp .-36 ; 0x240ba 000240de : lcd_puts_at_P(0, 2, _T(MSG_CHANGE_SUCCESS)); } static void lcd_loading_progress_bar(uint16_t loading_time_ms) { 240de: 1f 93 push r17 240e0: cf 93 push r28 240e2: 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); 240e4: 64 e6 ldi r22, 0x64 ; 100 240e6: 70 e0 ldi r23, 0x00 ; 0 240e8: 0f 94 e5 dc call 0x3b9ca ; 0x3b9ca <__udivmodhi4> 240ec: 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++) { 240ee: 10 e0 ldi r17, 0x00 ; 0 lcd_putc_at(i, 3, '.'); 240f0: 4e e2 ldi r20, 0x2E ; 46 240f2: 63 e0 ldi r22, 0x03 ; 3 240f4: 81 2f mov r24, r17 240f6: 0e 94 00 6f call 0xde00 ; 0xde00 //loading_time_ms/20 delay for (uint_least8_t j = 0; j < 5; j++) { delay_keep_alive(loading_time_ms / 100); 240fa: ce 01 movw r24, r28 240fc: 0e 94 e4 8c call 0x119c8 ; 0x119c8 24100: ce 01 movw r24, r28 24102: 0e 94 e4 8c call 0x119c8 ; 0x119c8 24106: ce 01 movw r24, r28 24108: 0e 94 e4 8c call 0x119c8 ; 0x119c8 2410c: ce 01 movw r24, r28 2410e: 0e 94 e4 8c call 0x119c8 ; 0x119c8 24112: ce 01 movw r24, r28 24114: 0e 94 e4 8c call 0x119c8 ; 0x119c8 } static void lcd_loading_progress_bar(uint16_t loading_time_ms) { for (uint_least8_t i = 0; i < LCD_WIDTH; i++) { 24118: 1f 5f subi r17, 0xFF ; 255 2411a: 14 31 cpi r17, 0x14 ; 20 2411c: 49 f7 brne .-46 ; 0x240f0 //loading_time_ms/20 delay for (uint_least8_t j = 0; j < 5; j++) { delay_keep_alive(loading_time_ms / 100); } } } 2411e: df 91 pop r29 24120: cf 91 pop r28 24122: 1f 91 pop r17 24124: 08 95 ret 00024126 : } } } static void setFilamentAction(FilamentAction action) { eFilamentAction = action; 24126: 10 92 a7 03 sts 0x03A7, r1 ; 0x8003a7 static void __attribute__((noinline)) clearFilamentAction() { // filament action has been cancelled or completed setFilamentAction(FilamentAction::None); } 2412a: 08 95 ret 0002412c : bFilamentPreheatState = false; mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); } void lcd_generic_preheat_menu() { 2412c: cf 93 push r28 MENU_BEGIN(); 2412e: 0f 94 96 d1 call 0x3a32c ; 0x3a32c 24132: 10 92 12 05 sts 0x0512, r1 ; 0x800512 24136: 80 91 12 05 lds r24, 0x0512 ; 0x800512 2413a: 84 30 cpi r24, 0x04 ; 4 2413c: 08 f0 brcs .+2 ; 0x24140 2413e: a1 c0 rjmp .+322 ; 0x24282 24140: 10 92 15 05 sts 0x0515, r1 ; 0x800515 if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 24144: 8f e5 ldi r24, 0x5F ; 95 24146: 9f e0 ldi r25, 0x0F ; 15 24148: 0f 94 1c dc call 0x3b838 ; 0x3b838 2414c: 81 11 cpse r24, r1 2414e: 10 c0 rjmp .+32 ; 0x24170 { ON_MENU_LEAVE( 24150: 0f 94 16 d0 call 0x3a02c ; 0x3a02c 24154: 81 11 cpse r24, r1 24156: 0f 94 93 20 call 0x24126 ; 0x24126 clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(eFilamentAction == FilamentAction::Lay1Cal ? MSG_BACK : MSG_MAIN)); 2415a: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 2415e: 8a 30 cpi r24, 0x0A ; 10 24160: 09 f4 brne .+2 ; 0x24164 24162: 8c c0 rjmp .+280 ; 0x2427c 24164: 88 ea ldi r24, 0xA8 ; 168 24166: 98 e4 ldi r25, 0x48 ; 72 24168: 0e 94 ac 72 call 0xe558 ; 0xe558 2416c: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 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(); 24170: 0f 94 34 16 call 0x22c68 ; 0x22c68 24174: 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); 24176: 8d ef ldi r24, 0xFD ; 253 24178: 92 ea ldi r25, 0xA2 ; 162 2417a: cc 23 and r28, r28 2417c: 11 f0 breq .+4 ; 0x24182 2417e: 8c e0 ldi r24, 0x0C ; 12 24180: 93 ea ldi r25, 0xA3 ; 163 24182: 64 e9 ldi r22, 0x94 ; 148 24184: 7a e3 ldi r23, 0x3A ; 58 24186: 0f 94 14 d4 call 0x3a828 ; 0x3a828 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); 2418a: 82 ee ldi r24, 0xE2 ; 226 2418c: 92 ea ldi r25, 0xA2 ; 162 2418e: cc 23 and r28, r28 24190: 11 f0 breq .+4 ; 0x24196 24192: 81 ef ldi r24, 0xF1 ; 241 24194: 92 ea ldi r25, 0xA2 ; 162 24196: 68 ef ldi r22, 0xF8 ; 248 24198: 79 e3 ldi r23, 0x39 ; 57 2419a: 0f 94 14 d4 call 0x3a828 ; 0x3a828 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); 2419e: 86 ec ldi r24, 0xC6 ; 198 241a0: 92 ea ldi r25, 0xA2 ; 162 241a2: cc 23 and r28, r28 241a4: 11 f0 breq .+4 ; 0x241aa 241a6: 86 ed ldi r24, 0xD6 ; 214 241a8: 92 ea ldi r25, 0xA2 ; 162 241aa: 62 ee ldi r22, 0xE2 ; 226 241ac: 79 e3 ldi r23, 0x39 ; 57 241ae: 0f 94 14 d4 call 0x3a828 ; 0x3a828 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); 241b2: 8a ea ldi r24, 0xAA ; 170 241b4: 92 ea ldi r25, 0xA2 ; 162 241b6: cc 23 and r28, r28 241b8: 11 f0 breq .+4 ; 0x241be 241ba: 8a eb ldi r24, 0xBA ; 186 241bc: 92 ea ldi r25, 0xA2 ; 162 241be: 64 ee ldi r22, 0xE4 ; 228 241c0: 79 e3 ldi r23, 0x39 ; 57 241c2: 0f 94 14 d4 call 0x3a828 ; 0x3a828 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); 241c6: 8f e8 ldi r24, 0x8F ; 143 241c8: 92 ea ldi r25, 0xA2 ; 162 241ca: cc 23 and r28, r28 241cc: 11 f0 breq .+4 ; 0x241d2 241ce: 8e e9 ldi r24, 0x9E ; 158 241d0: 92 ea ldi r25, 0xA2 ; 162 241d2: 66 e5 ldi r22, 0x56 ; 86 241d4: 79 e3 ldi r23, 0x39 ; 57 241d6: 0f 94 14 d4 call 0x3a828 ; 0x3a828 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); 241da: 84 e7 ldi r24, 0x74 ; 116 241dc: 92 ea ldi r25, 0xA2 ; 162 241de: cc 23 and r28, r28 241e0: 11 f0 breq .+4 ; 0x241e6 241e2: 83 e8 ldi r24, 0x83 ; 131 241e4: 92 ea ldi r25, 0xA2 ; 162 241e6: 60 ef ldi r22, 0xF0 ; 240 241e8: 79 e3 ldi r23, 0x39 ; 57 241ea: 0f 94 14 d4 call 0x3a828 ; 0x3a828 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); 241ee: 88 e5 ldi r24, 0x58 ; 88 241f0: 92 ea ldi r25, 0xA2 ; 162 241f2: cc 23 and r28, r28 241f4: 11 f0 breq .+4 ; 0x241fa 241f6: 88 e6 ldi r24, 0x68 ; 104 241f8: 92 ea ldi r25, 0xA2 ; 162 241fa: 6e e4 ldi r22, 0x4E ; 78 241fc: 7a e3 ldi r23, 0x3A ; 58 241fe: 0f 94 14 d4 call 0x3a828 ; 0x3a828 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); 24202: 8c e3 ldi r24, 0x3C ; 60 24204: 92 ea ldi r25, 0xA2 ; 162 24206: cc 23 and r28, r28 24208: 11 f0 breq .+4 ; 0x2420e 2420a: 8c e4 ldi r24, 0x4C ; 76 2420c: 92 ea ldi r25, 0xA2 ; 162 2420e: 6e e5 ldi r22, 0x5E ; 94 24210: 7a e3 ldi r23, 0x3A ; 58 24212: 0f 94 14 d4 call 0x3a828 ; 0x3a828 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); 24216: 80 e2 ldi r24, 0x20 ; 32 24218: 92 ea ldi r25, 0xA2 ; 162 2421a: cc 23 and r28, r28 2421c: 11 f0 breq .+4 ; 0x24222 2421e: 80 e3 ldi r24, 0x30 ; 48 24220: 92 ea ldi r25, 0xA2 ; 162 24222: 68 e9 ldi r22, 0x98 ; 152 24224: 7a e3 ldi r23, 0x3A ; 58 24226: 0f 94 14 d4 call 0x3a828 ; 0x3a828 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); 2422a: 85 e0 ldi r24, 0x05 ; 5 2422c: 92 ea ldi r25, 0xA2 ; 162 2422e: cc 23 and r28, r28 24230: 11 f0 breq .+4 ; 0x24236 24232: 84 e1 ldi r24, 0x14 ; 20 24234: 92 ea ldi r25, 0xA2 ; 162 24236: 6c eb ldi r22, 0xBC ; 188 24238: 7a e3 ldi r23, 0x3A ; 58 2423a: 0f 94 14 d4 call 0x3a828 ; 0x3a828 } if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE) && eFilamentAction == FilamentAction::Preheat) MENU_ITEM_FUNCTION_P(_T(MSG_COOLDOWN), lcd_cooldown); 2423e: 8f e5 ldi r24, 0x5F ; 95 24240: 9f e0 ldi r25, 0x0F ; 15 24242: 0f 94 1c dc call 0x3b838 ; 0x3b838 24246: 81 11 cpse r24, r1 24248: 0c c0 rjmp .+24 ; 0x24262 2424a: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 2424e: 89 30 cpi r24, 0x09 ; 9 24250: 41 f4 brne .+16 ; 0x24262 24252: 84 e0 ldi r24, 0x04 ; 4 24254: 90 e5 ldi r25, 0x50 ; 80 24256: 0e 94 ac 72 call 0xe558 ; 0xe558 2425a: 6c e1 ldi r22, 0x1C ; 28 2425c: 7b e3 ldi r23, 0x3B ; 59 2425e: 0f 94 13 d1 call 0x3a226 ; 0x3a226 MENU_END(); 24262: 0f 94 6a d1 call 0x3a2d4 ; 0x3a2d4 mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); } void lcd_generic_preheat_menu() { MENU_BEGIN(); 24266: 80 91 12 05 lds r24, 0x0512 ; 0x800512 2426a: 8f 5f subi r24, 0xFF ; 255 2426c: 80 93 12 05 sts 0x0512, r24 ; 0x800512 24270: 80 91 14 05 lds r24, 0x0514 ; 0x800514 24274: 8f 5f subi r24, 0xFF ; 255 24276: 80 93 14 05 sts 0x0514, r24 ; 0x800514 2427a: 5d cf rjmp .-326 ; 0x24136 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)); 2427c: 8c eb ldi r24, 0xBC ; 188 2427e: 99 e4 ldi r25, 0x49 ; 73 24280: 73 cf rjmp .-282 ; 0x24168 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(); } 24282: cf 91 pop r28 24284: 08 95 ret 00024286 : #endif //RESUME_DEBUG //! @brief Show Preheat Menu static void lcd_preheat_menu() { eFilamentAction = FilamentAction::Preheat; 24286: 89 e0 ldi r24, 0x09 ; 9 24288: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 lcd_generic_preheat_menu(); 2428c: 0d 94 96 20 jmp 0x2412c ; 0x2412c 00024290 : // 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); 24290: 81 e0 ldi r24, 0x01 ; 1 24292: 0e 94 d6 6e call 0xddac ; 0xddac if (MMU2::mmu2.get_current_tool() == MMU2::mmu2.get_tool_change_tool()) { 24296: 0f 94 b9 74 call 0x2e972 ; 0x2e972 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; 2429a: 90 91 a2 13 lds r25, 0x13A2 ; 0x8013a2 2429e: 93 36 cpi r25, 0x63 ; 99 242a0: 09 f4 brne .+2 ; 0x242a4 242a2: 9f ef ldi r25, 0xFF ; 255 242a4: 89 13 cpse r24, r25 242a6: 0e c0 rjmp .+28 ; 0x242c4 lcd_putc('F'); 242a8: 86 e4 ldi r24, 0x46 ; 70 242aa: 0e 94 cf 6e call 0xdd9e ; 0xdd9e lcd_putc(MMU2::mmu2.get_current_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_current_tool() + '1'); 242ae: 0f 94 b9 74 call 0x2e972 ; 0x2e972 242b2: 8f 3f cpi r24, 0xFF ; 255 242b4: 29 f0 breq .+10 ; 0x242c0 242b6: 8f 5c subi r24, 0xCF ; 207 242b8: 0e 94 cf 6e call 0xdd9e ; 0xdd9e 242bc: 83 e0 ldi r24, 0x03 ; 3 242be: 08 95 ret 242c0: 8f e3 ldi r24, 0x3F ; 63 242c2: fa cf rjmp .-12 ; 0x242b8 chars += 2; } else { lcd_putc(MMU2::mmu2.get_current_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_current_tool() + '1'); 242c4: 8f 3f cpi r24, 0xFF ; 255 242c6: 89 f0 breq .+34 ; 0x242ea 242c8: 8f 5c subi r24, 0xCF ; 207 242ca: 0e 94 cf 6e call 0xdd9e ; 0xdd9e lcd_putc('>'); 242ce: 8e e3 ldi r24, 0x3E ; 62 242d0: 0e 94 cf 6e call 0xdd9e ; 0xdd9e 242d4: 80 91 a2 13 lds r24, 0x13A2 ; 0x8013a2 242d8: 83 36 cpi r24, 0x63 ; 99 242da: 49 f0 breq .+18 ; 0x242ee lcd_putc(MMU2::mmu2.get_tool_change_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_tool_change_tool() + '1'); 242dc: 8f 3f cpi r24, 0xFF ; 255 242de: 39 f0 breq .+14 ; 0x242ee 242e0: 8f 5c subi r24, 0xCF ; 207 242e2: 0e 94 cf 6e call 0xdd9e ; 0xdd9e chars += 3; 242e6: 84 e0 ldi r24, 0x04 ; 4 } return chars; } 242e8: 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'); 242ea: 8f e3 ldi r24, 0x3F ; 63 242ec: ee cf rjmp .-36 ; 0x242ca lcd_putc('>'); lcd_putc(MMU2::mmu2.get_tool_change_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_tool_change_tool() + '1'); 242ee: 8f e3 ldi r24, 0x3F ; 63 242f0: f8 cf rjmp .-16 ; 0x242e2 000242f2 : } // 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); 242f2: 5f 93 push r21 242f4: 4f 93 push r20 242f6: 7f 93 push r23 242f8: 6f 93 push r22 242fa: 28 2f mov r18, r24 242fc: 08 2e mov r0, r24 242fe: 00 0c add r0, r0 24300: 33 0b sbc r19, r19 24302: 3f 93 push r19 24304: 8f 93 push r24 24306: 84 ea ldi r24, 0xA4 ; 164 24308: 9e e6 ldi r25, 0x6E ; 110 2430a: 9f 93 push r25 2430c: 8f 93 push r24 2430e: 0e 94 b9 6e call 0xdd72 ; 0xdd72 lcd_space(9 - chars); 24312: 2d b7 in r18, 0x3d ; 61 24314: 3e b7 in r19, 0x3e ; 62 24316: 28 5f subi r18, 0xF8 ; 248 24318: 3f 4f sbci r19, 0xFF ; 255 2431a: 0f b6 in r0, 0x3f ; 63 2431c: f8 94 cli 2431e: 3e bf out 0x3e, r19 ; 62 24320: 0f be out 0x3f, r0 ; 63 24322: 2d bf out 0x3d, r18 ; 61 24324: 99 e0 ldi r25, 0x09 ; 9 24326: 98 1b sub r25, r24 24328: 89 2f mov r24, r25 2432a: 0c 94 d6 6e jmp 0xddac ; 0xddac 0002432e : default: return false; } } void lcd_print_target_temps_first_line() { 2432e: cf 93 push r28 24330: df 93 push r29 lcd_home(); 24332: 0e 94 0c 6f call 0xde18 ; 0xde18 lcdui_print_temp(LCD_STR_THERMOMETER[0], (int) degHotend(0), (int) degTargetHotend(0)); 24336: c0 91 b6 0d lds r28, 0x0DB6 ; 0x800db6 2433a: d0 91 b7 0d lds r29, 0x0DB7 ; 0x800db7 2433e: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 24342: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 24346: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 2434a: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 2434e: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> 24352: ae 01 movw r20, r28 24354: 82 e8 ldi r24, 0x82 ; 130 24356: 0f 94 79 21 call 0x242f2 ; 0x242f2 lcd_set_cursor(10, 0); 2435a: 60 e0 ldi r22, 0x00 ; 0 2435c: 8a e0 ldi r24, 0x0A ; 10 2435e: 0e 94 e0 6e call 0xddc0 ; 0xddc0 FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; 24362: c0 91 72 06 lds r28, 0x0672 ; 0x800672 24366: d0 91 73 06 lds r29, 0x0673 ; 0x800673 int targetBedTemp = (int) degTargetBed(); if (targetBedTemp) { 2436a: 20 97 sbiw r28, 0x00 ; 0 2436c: 81 f0 breq .+32 ; 0x2438e lcdui_print_temp(LCD_STR_BEDTEMP[0], (int) degBed(), targetBedTemp); 2436e: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee 24372: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef 24376: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 2437a: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 2437e: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> 24382: ae 01 movw r20, r28 24384: 80 e8 ldi r24, 0x80 ; 128 } else { lcd_space(10); } } 24386: df 91 pop r29 24388: 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); 2438a: 0d 94 79 21 jmp 0x242f2 ; 0x242f2 } else { lcd_space(10); 2438e: 8a e0 ldi r24, 0x0A ; 10 } } 24390: df 91 pop r29 24392: 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); 24394: 0c 94 d6 6e jmp 0xddac ; 0xddac 00024398 : 24398: 10 92 dc 03 sts 0x03DC, r1 ; 0x8003dc } } static void mFilamentPrompt() { lcd_timeoutToStatus.stop(); lcd_print_target_temps_first_line(); 2439c: 0f 94 97 21 call 0x2432e ; 0x2432e lcd_puts_at_P(0,1, _T(MSG_PRESS_KNOB)); 243a0: 8d e9 ldi r24, 0x9D ; 157 243a2: 9f e4 ldi r25, 0x4F ; 79 243a4: 0e 94 ac 72 call 0xe558 ; 0xe558 243a8: ac 01 movw r20, r24 243aa: 61 e0 ldi r22, 0x01 ; 1 243ac: 80 e0 ldi r24, 0x00 ; 0 243ae: 0e 94 f4 6e call 0xdde8 ; 0xdde8 lcd_set_cursor(0,2); 243b2: 62 e0 ldi r22, 0x02 ; 2 243b4: 80 e0 ldi r24, 0x00 ; 0 243b6: 0e 94 e0 6e call 0xddc0 ; 0xddc0 switch(eFilamentAction) { 243ba: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 243be: 83 30 cpi r24, 0x03 ; 3 243c0: 81 f1 breq .+96 ; 0x24422 243c2: 48 f4 brcc .+18 ; 0x243d6 243c4: 81 30 cpi r24, 0x01 ; 1 243c6: 60 f0 brcs .+24 ; 0x243e0 case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::MmuLoad: case FilamentAction::MmuLoadingTest: lcd_puts_P(_T(MSG_TO_LOAD_FIL)); 243c8: 8a e8 ldi r24, 0x8A ; 138 243ca: 9f e4 ldi r25, 0x4F ; 79 break; case FilamentAction::UnLoad: case FilamentAction::MmuUnLoad: lcd_puts_P(_T(MSG_TO_UNLOAD_FIL)); 243cc: 0e 94 ac 72 call 0xe558 ; 0xe558 243d0: 0e 94 cb 6e call 0xdd96 ; 0xdd96 243d4: 05 c0 rjmp .+10 ; 0x243e0 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) { 243d6: 85 30 cpi r24, 0x05 ; 5 243d8: 21 f1 breq .+72 ; 0x24422 243da: b0 f3 brcs .-20 ; 0x243c8 243dc: 88 30 cpi r24, 0x08 ; 8 243de: a1 f3 breq .-24 ; 0x243c8 case FilamentAction::Preheat: case FilamentAction::Lay1Cal: break; } if(lcd_clicked() 243e0: 0e 94 fd 70 call 0xe1fa ; 0xe1fa #ifdef FILAMENT_SENSOR /// @todo leptun - add this as a specific retest item || (((eFilamentAction == FilamentAction::Load) || (eFilamentAction == FilamentAction::AutoLoad)) && fsensor.getFilamentLoadEvent()) 243e4: 81 11 cpse r24, r1 243e6: 09 c0 rjmp .+18 ; 0x243fa 243e8: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 243ec: 81 50 subi r24, 0x01 ; 1 243ee: 82 30 cpi r24, 0x02 ; 2 243f0: 28 f5 brcc .+74 ; 0x2443c 243f2: 80 91 ae 17 lds r24, 0x17AE ; 0x8017ae 243f6: 88 23 and r24, r24 243f8: 09 f1 breq .+66 ; 0x2443c #endif //FILAMENT_SENSOR ) { menu_back(bFilamentPreheatState ? 2 : 3); 243fa: 80 91 63 06 lds r24, 0x0663 ; 0x800663 243fe: 81 11 cpse r24, r1 24400: 13 c0 rjmp .+38 ; 0x24428 24402: 83 e0 ldi r24, 0x03 ; 3 24404: 0f 94 42 d4 call 0x3a884 ; 0x3a884 switch(eFilamentAction) { 24408: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 2440c: 82 30 cpi r24, 0x02 ; 2 2440e: 71 f0 breq .+28 ; 0x2442c 24410: 83 30 cpi r24, 0x03 ; 3 24412: 81 f0 breq .+32 ; 0x24434 24414: 81 30 cpi r24, 0x01 ; 1 24416: 91 f4 brne .+36 ; 0x2443c case FilamentAction::AutoLoad: // loading no longer cancellable eFilamentAction = FilamentAction::Load; [[fallthrough]]; case FilamentAction::Load: enquecommand_P(MSG_M701); // load filament 24418: 61 e0 ldi r22, 0x01 ; 1 2441a: 83 e5 ldi r24, 0x53 ; 83 2441c: 9f e6 ldi r25, 0x6F ; 111 break; case FilamentAction::UnLoad: enquecommand_P(MSG_M702); // unload filament 2441e: 0c 94 20 88 jmp 0x11040 ; 0x11040 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)); 24422: 85 e7 ldi r24, 0x75 ; 117 24424: 9f e4 ldi r25, 0x4F ; 79 24426: d2 cf rjmp .-92 ; 0x243cc #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); 24428: 82 e0 ldi r24, 0x02 ; 2 2442a: ec cf rjmp .-40 ; 0x24404 switch(eFilamentAction) { case FilamentAction::AutoLoad: // loading no longer cancellable eFilamentAction = FilamentAction::Load; 2442c: 81 e0 ldi r24, 0x01 ; 1 2442e: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 24432: f2 cf rjmp .-28 ; 0x24418 [[fallthrough]]; case FilamentAction::Load: enquecommand_P(MSG_M701); // load filament break; case FilamentAction::UnLoad: enquecommand_P(MSG_M702); // unload filament 24434: 61 e0 ldi r22, 0x01 ; 1 24436: 8b ed ldi r24, 0xDB ; 219 24438: 9b e6 ldi r25, 0x6B ; 107 2443a: f1 cf rjmp .-30 ; 0x2441e case FilamentAction::Preheat: case FilamentAction::Lay1Cal: break; } } } 2443c: 08 95 ret 0002443e <__vector_51>: } return 1; //all characters match - return 1 } ISR(USART2_RX_vect) { 2443e: 1f 92 push r1 24440: 0f 92 push r0 24442: 0f b6 in r0, 0x3f ; 63 24444: 0f 92 push r0 24446: 11 24 eor r1, r1 24448: 0b b6 in r0, 0x3b ; 59 2444a: 0f 92 push r0 2444c: 2f 93 push r18 2444e: 3f 93 push r19 24450: 4f 93 push r20 24452: 5f 93 push r21 24454: 6f 93 push r22 24456: 7f 93 push r23 24458: 8f 93 push r24 2445a: 9f 93 push r25 2445c: af 93 push r26 2445e: bf 93 push r27 24460: ef 93 push r30 24462: ff 93 push r31 //printf_P(PSTR("USART2_RX_vect \n") ); if (rbuf_put(uart2_ibuf, UDR2) < 0) // put received byte to buffer 24464: 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 24468: 80 91 3b 05 lds r24, 0x053B ; 0x80053b uint8_t buf_r = ptr[2]; //get read index 2446c: 90 91 3c 05 lds r25, 0x053C ; 0x80053c _unlock(); //unlock ptr[4 + buf_w] = b; //store byte to buffer 24470: e8 2f mov r30, r24 24472: f0 e0 ldi r31, 0x00 ; 0 24474: e2 5c subi r30, 0xC2 ; 194 24476: fa 4f sbci r31, 0xFA ; 250 24478: 20 83 st Z, r18 buf_w++; //incerment write index 2447a: 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 2447c: 20 91 3a 05 lds r18, 0x053A ; 0x80053a 24480: 82 17 cp r24, r18 24482: 08 f0 brcs .+2 ; 0x24486 <__vector_51+0x48> 24484: 80 e0 ldi r24, 0x00 ; 0 if (buf_w == buf_r) return -1; //return -1 to signal buffer full 24486: 98 13 cpse r25, r24 24488: 17 c0 rjmp .+46 ; 0x244b8 <__vector_51+0x7a> { //rx buffer full //uart2_rx_clr(); //for sure, clear input buffer puts_P(PSTR("USART2 rx Full!!!")); 2448a: 8d e4 ldi r24, 0x4D ; 77 2448c: 90 ea ldi r25, 0xA0 ; 160 2448e: 0f 94 05 db call 0x3b60a ; 0x3b60a } } 24492: ff 91 pop r31 24494: ef 91 pop r30 24496: bf 91 pop r27 24498: af 91 pop r26 2449a: 9f 91 pop r25 2449c: 8f 91 pop r24 2449e: 7f 91 pop r23 244a0: 6f 91 pop r22 244a2: 5f 91 pop r21 244a4: 4f 91 pop r20 244a6: 3f 91 pop r19 244a8: 2f 91 pop r18 244aa: 0f 90 pop r0 244ac: 0b be out 0x3b, r0 ; 59 244ae: 0f 90 pop r0 244b0: 0f be out 0x3f, r0 ; 63 244b2: 0f 90 pop r0 244b4: 1f 90 pop r1 244b6: 18 95 reti ptr[1] = buf_w; //store write index 244b8: 80 93 3b 05 sts 0x053B, r24 ; 0x80053b 244bc: ea cf rjmp .-44 ; 0x24492 <__vector_51+0x54> 000244be <__vector_45>: { WRITE(BEEPER, 1); } ISR(TIMER4_OVF_vect) { 244be: 1f 92 push r1 244c0: 0f 92 push r0 244c2: 0f b6 in r0, 0x3f ; 63 244c4: 0f 92 push r0 244c6: 11 24 eor r1, r1 244c8: 0b b6 in r0, 0x3b ; 59 244ca: 0f 92 push r0 244cc: 8f 93 push r24 244ce: 9f 93 push r25 244d0: ef 93 push r30 244d2: ff 93 push r31 WRITE(BEEPER, 0); 244d4: 9f b7 in r25, 0x3f ; 63 244d6: f8 94 cli 244d8: e2 e0 ldi r30, 0x02 ; 2 244da: f1 e0 ldi r31, 0x01 ; 1 244dc: 80 81 ld r24, Z 244de: 8b 7f andi r24, 0xFB ; 251 244e0: 80 83 st Z, r24 244e2: 9f bf out 0x3f, r25 ; 63 } 244e4: ff 91 pop r31 244e6: ef 91 pop r30 244e8: 9f 91 pop r25 244ea: 8f 91 pop r24 244ec: 0f 90 pop r0 244ee: 0b be out 0x3b, r0 ; 59 244f0: 0f 90 pop r0 244f2: 0f be out 0x3f, r0 ; 63 244f4: 0f 90 pop r0 244f6: 1f 90 pop r1 244f8: 18 95 reti 000244fa <__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) { 244fa: 1f 92 push r1 244fc: 0f 92 push r0 244fe: 0f b6 in r0, 0x3f ; 63 24500: 0f 92 push r0 24502: 11 24 eor r1, r1 24504: 0b b6 in r0, 0x3b ; 59 24506: 0f 92 push r0 24508: 8f 93 push r24 2450a: 9f 93 push r25 2450c: ef 93 push r30 2450e: ff 93 push r31 WRITE(BEEPER, 1); 24510: 9f b7 in r25, 0x3f ; 63 24512: f8 94 cli 24514: e2 e0 ldi r30, 0x02 ; 2 24516: f1 e0 ldi r31, 0x01 ; 1 24518: 80 81 ld r24, Z 2451a: 84 60 ori r24, 0x04 ; 4 2451c: 80 83 st Z, r24 2451e: 9f bf out 0x3f, r25 ; 63 } 24520: ff 91 pop r31 24522: ef 91 pop r30 24524: 9f 91 pop r25 24526: 8f 91 pop r24 24528: 0f 90 pop r0 2452a: 0b be out 0x3b, r0 ; 59 2452c: 0f 90 pop r0 2452e: 0f be out 0x3f, r0 ; 63 24530: 0f 90 pop r0 24532: 1f 90 pop r1 24534: 18 95 reti 00024536 : if (cval) cval[cl] = sum / cnt; return ++cl; } bool tmc2130_home_calibrate(uint8_t axis) { 24536: 6f 92 push r6 24538: 7f 92 push r7 2453a: 8f 92 push r8 2453c: 9f 92 push r9 2453e: af 92 push r10 24540: bf 92 push r11 24542: df 92 push r13 24544: ef 92 push r14 24546: ff 92 push r15 24548: 0f 93 push r16 2454a: 1f 93 push r17 2454c: cf 93 push r28 2454e: df 93 push r29 24550: cd b7 in r28, 0x3d ; 61 24552: de b7 in r29, 0x3e ; 62 24554: e0 97 sbiw r28, 0x30 ; 48 24556: 0f b6 in r0, 0x3f ; 63 24558: f8 94 cli 2455a: de bf out 0x3e, r29 ; 62 2455c: 0f be out 0x3f, r0 ; 63 2455e: cd bf out 0x3d, r28 ; 61 24560: d8 2e mov r13, r24 uint8_t step[16]; uint8_t cnt[16]; uint8_t val[16]; homeaxis(axis, 16, step); 24562: ae 01 movw r20, r28 24564: 4f 5f subi r20, 0xFF ; 255 24566: 5f 4f sbci r21, 0xFF ; 255 24568: 60 e1 ldi r22, 0x10 ; 16 2456a: 0e 94 6b 7a call 0xf4d6 ; 0xf4d6 bubblesort_uint8(step, 16, 0); 2456e: 50 e0 ldi r21, 0x00 ; 0 24570: 40 e0 ldi r20, 0x00 ; 0 24572: 60 e1 ldi r22, 0x10 ; 16 24574: ce 01 movw r24, r28 24576: 01 96 adiw r24, 0x01 ; 1 24578: 0f 94 53 10 call 0x220a6 ; 0x220a6 puts_P(PSTR("sorted samples:")); 2457c: 8d e3 ldi r24, 0x3D ; 61 2457e: 90 ea ldi r25, 0xA0 ; 160 24580: 0f 94 05 db call 0x3b60a ; 0x3b60a 24584: 9e 01 movw r18, r28 24586: 2f 5f subi r18, 0xFF ; 255 24588: 3f 4f sbci r19, 0xFF ; 255 2458a: 59 01 movw r10, r18 2458c: 10 e0 ldi r17, 0x00 ; 0 2458e: 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]); 24590: 2c e2 ldi r18, 0x2C ; 44 24592: e2 2e mov r14, r18 24594: 20 ea ldi r18, 0xA0 ; 160 24596: f2 2e mov r15, r18 24598: d5 01 movw r26, r10 2459a: 8d 91 ld r24, X+ 2459c: 5d 01 movw r10, r26 2459e: 1f 92 push r1 245a0: 8f 93 push r24 245a2: 1f 93 push r17 245a4: 0f 93 push r16 245a6: ff 92 push r15 245a8: ef 92 push r14 245aa: 0f 94 de da call 0x3b5bc ; 0x3b5bc 245ae: 0f 5f subi r16, 0xFF ; 255 245b0: 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++) 245b2: 0f 90 pop r0 245b4: 0f 90 pop r0 245b6: 0f 90 pop r0 245b8: 0f 90 pop r0 245ba: 0f 90 pop r0 245bc: 0f 90 pop r0 245be: 00 31 cpi r16, 0x10 ; 16 245c0: 11 05 cpc r17, r1 245c2: 51 f7 brne .-44 ; 0x24598 } 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]; 245c4: 09 81 ldd r16, Y+1 ; 0x01 245c6: 10 e0 ldi r17, 0x00 ; 0 245c8: 5e 01 movw r10, r28 245ca: b2 e0 ldi r27, 0x02 ; 2 245cc: ab 0e add r10, r27 245ce: b1 1c adc r11, r1 245d0: ee 24 eor r14, r14 245d2: e3 94 inc r14 245d4: f1 2c mov r15, r1 245d6: ec 0e add r14, r28 245d8: fd 1e adc r15, r29 245da: e0 e1 ldi r30, 0x10 ; 16 245dc: ee 0e add r14, r30 245de: f1 1c adc r15, r1 uint8_t cl = 0; 245e0: 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; 245e2: 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]; 245e4: d5 01 movw r26, r10 245e6: 3d 91 ld r19, X+ 245e8: 5d 01 movw r10, r26 uint8_t val = sum / cnt; 245ea: 62 2f mov r22, r18 245ec: 70 e0 ldi r23, 0x00 ; 0 245ee: c8 01 movw r24, r16 245f0: 0f 94 e5 dc call 0x3b9ca ; 0x3b9ca <__udivmodhi4> uint8_t dif = 0; if (val > d) dif = val - d; 245f4: 46 2f mov r20, r22 245f6: 43 1b sub r20, r19 245f8: 36 17 cp r19, r22 245fa: 10 f0 brcs .+4 ; 0x24600 else dif = d - val; 245fc: 43 2f mov r20, r19 245fe: 46 1b sub r20, r22 24600: 83 2f mov r24, r19 24602: 90 e0 ldi r25, 0x00 ; 0 if (dif <= tol) 24604: 42 30 cpi r20, 0x02 ; 2 24606: 08 f0 brcs .+2 ; 0x2460a 24608: 47 c0 rjmp .+142 ; 0x24698 { cnt += 1; 2460a: 2f 5f subi r18, 0xFF ; 255 sum += d; 2460c: 08 0f add r16, r24 2460e: 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++) 24610: ae 14 cp r10, r14 24612: bf 04 cpc r11, r15 24614: 39 f7 brne .-50 ; 0x245e4 cnt = 1; sum = d; cl += 1; } } if (ccnt) ccnt[cl] = cnt; 24616: ae 2e mov r10, r30 24618: b1 2c mov r11, r1 2461a: a1 e1 ldi r26, 0x11 ; 17 2461c: b0 e0 ldi r27, 0x00 ; 0 2461e: ac 0f add r26, r28 24620: bd 1f adc r27, r29 24622: aa 0d add r26, r10 24624: bb 1d adc r27, r11 24626: 2c 93 st X, r18 if (cval) cval[cl] = sum / cnt; 24628: 7e 01 movw r14, r28 2462a: b1 e2 ldi r27, 0x21 ; 33 2462c: eb 0e add r14, r27 2462e: f1 1c adc r15, r1 24630: ae 0c add r10, r14 24632: bf 1c adc r11, r15 24634: 62 2f mov r22, r18 24636: 70 e0 ldi r23, 0x00 ; 0 24638: c8 01 movw r24, r16 2463a: 0f 94 e5 dc call 0x3b9ca ; 0x3b9ca <__udivmodhi4> 2463e: d5 01 movw r26, r10 24640: 6c 93 st X, r22 return ++cl; 24642: 11 e0 ldi r17, 0x01 ; 1 24644: 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:")); 24646: 82 e2 ldi r24, 0x22 ; 34 24648: 90 ea ldi r25, 0xA0 ; 160 2464a: 0f 94 05 db call 0x3b60a ; 0x3b60a 2464e: fe 01 movw r30, r28 24650: 71 96 adiw r30, 0x11 ; 17 24652: 3f 01 movw r6, r30 24654: 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]); 24656: 8a e0 ldi r24, 0x0A ; 10 24658: 88 2e mov r8, r24 2465a: 80 ea ldi r24, 0xA0 ; 160 2465c: 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++) 2465e: 8a 2d mov r24, r10 24660: 8e 19 sub r24, r14 24662: 81 17 cp r24, r17 24664: 70 f5 brcc .+92 ; 0x246c2 24666: c5 01 movw r24, r10 24668: 8e 19 sub r24, r14 2466a: 9f 09 sbc r25, r15 printf_P(PSTR(" i=%2d cnt=%2d val=%2d\n"), i, cnt[i], val[i]); 2466c: d5 01 movw r26, r10 2466e: 3d 91 ld r19, X+ 24670: 5d 01 movw r10, r26 24672: f3 01 movw r30, r6 24674: 21 91 ld r18, Z+ 24676: 3f 01 movw r6, r30 24678: 1f 92 push r1 2467a: 3f 93 push r19 2467c: 1f 92 push r1 2467e: 2f 93 push r18 24680: 9f 93 push r25 24682: 8f 93 push r24 24684: 9f 92 push r9 24686: 8f 92 push r8 24688: 0f 94 de da call 0x3b5bc ; 0x3b5bc 2468c: 0f b6 in r0, 0x3f ; 63 2468e: f8 94 cli 24690: de bf out 0x3e, r29 ; 62 24692: 0f be out 0x3f, r0 ; 63 24694: cd bf out 0x3d, r28 ; 61 24696: e3 cf rjmp .-58 ; 0x2465e 24698: 4e 2f mov r20, r30 2469a: 50 e0 ldi r21, 0x00 ; 0 cnt += 1; sum += d; } else { if (ccnt) ccnt[cl] = cnt; 2469c: a1 e1 ldi r26, 0x11 ; 17 2469e: b0 e0 ldi r27, 0x00 ; 0 246a0: ac 0f add r26, r28 246a2: bd 1f adc r27, r29 246a4: a4 0f add r26, r20 246a6: b5 1f adc r27, r21 246a8: ef 5f subi r30, 0xFF ; 255 246aa: 2c 93 st X, r18 if (cval) cval[cl] = val; 246ac: 21 e2 ldi r18, 0x21 ; 33 246ae: 30 e0 ldi r19, 0x00 ; 0 246b0: 2c 0f add r18, r28 246b2: 3d 1f adc r19, r29 246b4: 42 0f add r20, r18 246b6: 53 1f adc r21, r19 246b8: da 01 movw r26, r20 246ba: 6c 93 st X, r22 cnt = 1; sum = d; 246bc: 8c 01 movw r16, r24 } else { if (ccnt) ccnt[cl] = cnt; if (cval) cval[cl] = val; cnt = 1; 246be: 21 e0 ldi r18, 0x01 ; 1 246c0: a7 cf rjmp .-178 ; 0x24610 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); 246c2: a7 01 movw r20, r14 246c4: 61 2f mov r22, r17 246c6: ce 01 movw r24, r28 246c8: 41 96 adiw r24, 0x11 ; 17 246ca: 0f 94 53 10 call 0x220a6 ; 0x220a6 tmc2130_home_origin[axis] = val[cl-1]; 246ce: fe 01 movw r30, r28 246d0: e1 0f add r30, r17 246d2: f1 1d adc r31, r1 246d4: 80 a1 ldd r24, Z+32 ; 0x20 246d6: ed 2d mov r30, r13 246d8: f0 e0 ldi r31, 0x00 ; 0 246da: ed 50 subi r30, 0x0D ; 13 246dc: fb 4f sbci r31, 0xFB ; 251 246de: 80 83 st Z, r24 printf_P(PSTR("result value: %d\n"), tmc2130_home_origin[axis]); 246e0: 1f 92 push r1 246e2: 8f 93 push r24 246e4: 88 ef ldi r24, 0xF8 ; 248 246e6: 9f e9 ldi r25, 0x9F ; 159 246e8: 9f 93 push r25 246ea: 8f 93 push r24 246ec: 0f 94 de da call 0x3b5bc ; 0x3b5bc if (axis == X_AXIS) eeprom_update_byte_notify((uint8_t*)EEPROM_TMC2130_HOME_X_ORIGIN, tmc2130_home_origin[X_AXIS]); 246f0: 0f 90 pop r0 246f2: 0f 90 pop r0 246f4: 0f 90 pop r0 246f6: 0f 90 pop r0 246f8: 60 91 f3 04 lds r22, 0x04F3 ; 0x8004f3 246fc: 8e ef ldi r24, 0xFE ; 254 246fe: 9e e0 ldi r25, 0x0E ; 14 24700: dd 20 and r13, r13 24702: 21 f0 breq .+8 ; 0x2470c 24704: 60 91 f4 04 lds r22, 0x04F4 ; 0x8004f4 24708: 8b ef ldi r24, 0xFB ; 251 2470a: 9e e0 ldi r25, 0x0E ; 14 2470c: 0f 94 40 dc call 0x3b880 ; 0x3b880 else if (axis == Y_AXIS) eeprom_update_byte_notify((uint8_t*)EEPROM_TMC2130_HOME_Y_ORIGIN, tmc2130_home_origin[Y_AXIS]); return true; } 24710: 81 e0 ldi r24, 0x01 ; 1 24712: e0 96 adiw r28, 0x30 ; 48 24714: 0f b6 in r0, 0x3f ; 63 24716: f8 94 cli 24718: de bf out 0x3e, r29 ; 62 2471a: 0f be out 0x3f, r0 ; 63 2471c: cd bf out 0x3d, r28 ; 61 2471e: df 91 pop r29 24720: cf 91 pop r28 24722: 1f 91 pop r17 24724: 0f 91 pop r16 24726: ff 90 pop r15 24728: ef 90 pop r14 2472a: df 90 pop r13 2472c: bf 90 pop r11 2472e: af 90 pop r10 24730: 9f 90 pop r9 24732: 8f 90 pop r8 24734: 7f 90 pop r7 24736: 6f 90 pop r6 24738: 08 95 ret 0002473a : delayMicroseconds(TMC2130_SET_DIR_DELAY); } void tmc2130_do_step(uint8_t axis) { switch (axis) 2473a: 81 30 cpi r24, 0x01 ; 1 2473c: 49 f0 breq .+18 ; 0x24750 2473e: 28 f0 brcs .+10 ; 0x2474a 24740: 82 30 cpi r24, 0x02 ; 2 24742: 41 f0 breq .+16 ; 0x24754 24744: 83 30 cpi r24, 0x03 ; 3 24746: 41 f0 breq .+16 ; 0x24758 24748: 08 95 ret { case X_AXIS: _DO_STEP_X; break; 2474a: 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; 2474c: 86 b9 out 0x06, r24 ; 6 } } 2474e: 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; 24750: 82 e0 ldi r24, 0x02 ; 2 24752: fc cf rjmp .-8 ; 0x2474c case Z_AXIS: _DO_STEP_Z; break; 24754: 84 e0 ldi r24, 0x04 ; 4 24756: fa cf rjmp .-12 ; 0x2474c case E_AXIS: _DO_STEP_E; break; 24758: 88 e0 ldi r24, 0x08 ; 8 2475a: f8 cf rjmp .-16 ; 0x2474c 0002475c : } void tmc2130_set_dir(uint8_t axis, uint8_t dir) { switch (axis) 2475c: 81 30 cpi r24, 0x01 ; 1 2475e: d1 f0 breq .+52 ; 0x24794 24760: 48 f0 brcs .+18 ; 0x24774 24762: 82 30 cpi r24, 0x02 ; 2 24764: 21 f1 breq .+72 ; 0x247ae 24766: 83 30 cpi r24, 0x03 ; 3 24768: 79 f1 breq .+94 ; 0x247c8 2476a: 8b e4 ldi r24, 0x4B ; 75 2476c: 90 e0 ldi r25, 0x00 ; 0 2476e: 01 97 sbiw r24, 0x01 ; 1 24770: f1 f7 brne .-4 ; 0x2476e 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); } 24772: 08 95 ret void tmc2130_set_dir(uint8_t axis, uint8_t dir) { switch (axis) { case X_AXIS: _SET_DIR_X(dir); break; 24774: 9f b7 in r25, 0x3f ; 63 24776: 66 23 and r22, r22 24778: 41 f0 breq .+16 ; 0x2478a 2477a: f8 94 cli 2477c: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24780: 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; 24782: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24786: 9f bf out 0x3f, r25 ; 63 24788: f0 cf rjmp .-32 ; 0x2476a void tmc2130_set_dir(uint8_t axis, uint8_t dir) { switch (axis) { case X_AXIS: _SET_DIR_X(dir); break; 2478a: f8 94 cli 2478c: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24790: 8e 7f andi r24, 0xFE ; 254 24792: f7 cf rjmp .-18 ; 0x24782 case Y_AXIS: _SET_DIR_Y(dir); break; 24794: 9f b7 in r25, 0x3f ; 63 24796: 61 11 cpse r22, r1 24798: 05 c0 rjmp .+10 ; 0x247a4 2479a: f8 94 cli 2479c: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 247a0: 82 60 ori r24, 0x02 ; 2 247a2: ef cf rjmp .-34 ; 0x24782 247a4: f8 94 cli 247a6: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 247aa: 8d 7f andi r24, 0xFD ; 253 247ac: ea cf rjmp .-44 ; 0x24782 case Z_AXIS: _SET_DIR_Z(dir); break; 247ae: 9f b7 in r25, 0x3f ; 63 247b0: 66 23 and r22, r22 247b2: 29 f0 breq .+10 ; 0x247be 247b4: f8 94 cli 247b6: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 247ba: 84 60 ori r24, 0x04 ; 4 247bc: e2 cf rjmp .-60 ; 0x24782 247be: f8 94 cli 247c0: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 247c4: 8b 7f andi r24, 0xFB ; 251 247c6: dd cf rjmp .-70 ; 0x24782 case E_AXIS: _SET_DIR_E(dir); break; 247c8: 9f b7 in r25, 0x3f ; 63 247ca: 61 11 cpse r22, r1 247cc: 05 c0 rjmp .+10 ; 0x247d8 247ce: f8 94 cli 247d0: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 247d4: 80 64 ori r24, 0x40 ; 64 247d6: d5 cf rjmp .-86 ; 0x24782 247d8: f8 94 cli 247da: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 247de: 8f 7b andi r24, 0xBF ; 191 247e0: d0 cf rjmp .-96 ; 0x24782 000247e2 : tmc2130_cs_high(axis); TMC2130_SPI_LEAVE(); } static uint8_t tmc2130_rx(uint8_t axis, uint8_t addr, uint32_t* rval) { 247e2: cf 92 push r12 247e4: df 92 push r13 247e6: ef 92 push r14 247e8: ff 92 push r15 247ea: 0f 93 push r16 247ec: 1f 93 push r17 247ee: cf 93 push r28 247f0: df 93 push r29 247f2: 18 2f mov r17, r24 247f4: f6 2e mov r15, r22 247f6: ea 01 movw r28, r20 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 247f8: 0c e5 ldi r16, 0x5C ; 92 247fa: 0c bd out 0x2c, r16 ; 44 SPSR = spsr; 247fc: 1d bc out 0x2d, r1 ; 45 //datagram1 - request TMC2130_SPI_ENTER(); tmc2130_cs_low(axis); 247fe: 0f 94 af 10 call 0x2215e ; 0x2215e TMC2130_SPI_TXRX(addr); // address 24802: 8f 2d mov r24, r15 24804: 0f 94 ca 10 call 0x22194 ; 0x22194 TMC2130_SPI_TXRX(0); // MSB 24808: 80 e0 ldi r24, 0x00 ; 0 2480a: 0f 94 ca 10 call 0x22194 ; 0x22194 TMC2130_SPI_TXRX(0); 2480e: 80 e0 ldi r24, 0x00 ; 0 24810: 0f 94 ca 10 call 0x22194 ; 0x22194 TMC2130_SPI_TXRX(0); 24814: 80 e0 ldi r24, 0x00 ; 0 24816: 0f 94 ca 10 call 0x22194 ; 0x22194 TMC2130_SPI_TXRX(0); // LSB 2481a: 80 e0 ldi r24, 0x00 ; 0 2481c: 0f 94 ca 10 call 0x22194 ; 0x22194 tmc2130_cs_high(axis); 24820: 81 2f mov r24, r17 24822: 0f 94 94 10 call 0x22128 ; 0x22128 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 24826: 0c bd out 0x2c, r16 ; 44 SPSR = spsr; 24828: 1d bc out 0x2d, r1 ; 45 TMC2130_SPI_LEAVE(); //datagram2 - response TMC2130_SPI_ENTER(); tmc2130_cs_low(axis); 2482a: 81 2f mov r24, r17 2482c: 0f 94 af 10 call 0x2215e ; 0x2215e uint8_t stat = TMC2130_SPI_TXRX(0); // status 24830: 80 e0 ldi r24, 0x00 ; 0 24832: 0f 94 ca 10 call 0x22194 ; 0x22194 24836: 08 2f mov r16, r24 uint32_t val32 = 0; val32 = TMC2130_SPI_TXRX(0); // MSB 24838: 80 e0 ldi r24, 0x00 ; 0 2483a: 0f 94 ca 10 call 0x22194 ; 0x22194 2483e: 90 e0 ldi r25, 0x00 ; 0 24840: b0 e0 ldi r27, 0x00 ; 0 24842: a0 e0 ldi r26, 0x00 ; 0 val32 = (val32 << 8) | TMC2130_SPI_TXRX(0); 24844: cc 24 eor r12, r12 24846: d8 2e mov r13, r24 24848: e9 2e mov r14, r25 2484a: fa 2e mov r15, r26 2484c: 80 e0 ldi r24, 0x00 ; 0 2484e: 0f 94 ca 10 call 0x22194 ; 0x22194 24852: c8 2a or r12, r24 val32 = (val32 << 8) | TMC2130_SPI_TXRX(0); 24854: fe 2c mov r15, r14 24856: ed 2c mov r14, r13 24858: dc 2c mov r13, r12 2485a: cc 24 eor r12, r12 2485c: 80 e0 ldi r24, 0x00 ; 0 2485e: 0f 94 ca 10 call 0x22194 ; 0x22194 24862: c8 2a or r12, r24 val32 = (val32 << 8) | TMC2130_SPI_TXRX(0); // LSB 24864: fe 2c mov r15, r14 24866: ed 2c mov r14, r13 24868: dc 2c mov r13, r12 2486a: cc 24 eor r12, r12 2486c: 80 e0 ldi r24, 0x00 ; 0 2486e: 0f 94 ca 10 call 0x22194 ; 0x22194 24872: c8 2a or r12, r24 tmc2130_cs_high(axis); 24874: 81 2f mov r24, r17 24876: 0f 94 94 10 call 0x22128 ; 0x22128 TMC2130_SPI_LEAVE(); if (rval != 0) *rval = val32; 2487a: c8 82 st Y, r12 2487c: d9 82 std Y+1, r13 ; 0x01 2487e: ea 82 std Y+2, r14 ; 0x02 24880: fb 82 std Y+3, r15 ; 0x03 return stat; } 24882: 80 2f mov r24, r16 24884: df 91 pop r29 24886: cf 91 pop r28 24888: 1f 91 pop r17 2488a: 0f 91 pop r16 2488c: ff 90 pop r15 2488e: ef 90 pop r14 24890: df 90 pop r13 24892: cf 90 pop r12 24894: 08 95 ret 00024896 : #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) { 24896: ef 92 push r14 24898: ff 92 push r15 2489a: 0f 93 push r16 2489c: 1f 93 push r17 2489e: cf 93 push r28 248a0: df 93 push r29 248a2: c8 2f mov r28, r24 248a4: e6 2e mov r14, r22 248a6: d2 2f mov r29, r18 248a8: 13 2f mov r17, r19 248aa: 04 2f mov r16, r20 248ac: f5 2e mov r15, r21 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 248ae: 8c e5 ldi r24, 0x5C ; 92 248b0: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 248b2: 1d bc out 0x2d, r1 ; 45 //datagram1 - request TMC2130_SPI_ENTER(); tmc2130_cs_low(axis); 248b4: 8c 2f mov r24, r28 248b6: 0f 94 af 10 call 0x2215e ; 0x2215e TMC2130_SPI_TXRX(addr); // address 248ba: 8e 2d mov r24, r14 248bc: 0f 94 ca 10 call 0x22194 ; 0x22194 TMC2130_SPI_TXRX((wval >> 24) & 0xff); // MSB 248c0: 8f 2d mov r24, r15 248c2: 0f 94 ca 10 call 0x22194 ; 0x22194 TMC2130_SPI_TXRX((wval >> 16) & 0xff); 248c6: 80 2f mov r24, r16 248c8: 0f 94 ca 10 call 0x22194 ; 0x22194 TMC2130_SPI_TXRX((wval >> 8) & 0xff); 248cc: 81 2f mov r24, r17 248ce: 0f 94 ca 10 call 0x22194 ; 0x22194 TMC2130_SPI_TXRX(wval & 0xff); // LSB 248d2: 8d 2f mov r24, r29 248d4: 0f 94 ca 10 call 0x22194 ; 0x22194 tmc2130_cs_high(axis); 248d8: 8c 2f mov r24, r28 TMC2130_SPI_LEAVE(); } 248da: df 91 pop r29 248dc: cf 91 pop r28 248de: 1f 91 pop r17 248e0: 0f 91 pop r16 248e2: ff 90 pop r15 248e4: 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); 248e6: 0d 94 94 10 jmp 0x22128 ; 0x22128 000248ea : if (val32 & 0x000f0000) return 0xffff; return val32 & 0xffff; } uint16_t tmc2130_rd_MSCNT(uint8_t axis) { 248ea: cf 93 push r28 248ec: df 93 push r29 248ee: 00 d0 rcall .+0 ; 0x248f0 248f0: 1f 92 push r1 248f2: cd b7 in r28, 0x3d ; 61 248f4: de b7 in r29, 0x3e ; 62 uint32_t val32 = 0; 248f6: 19 82 std Y+1, r1 ; 0x01 248f8: 1a 82 std Y+2, r1 ; 0x02 248fa: 1b 82 std Y+3, r1 ; 0x03 248fc: 1c 82 std Y+4, r1 ; 0x04 tmc2130_rd(axis, TMC2130_REG_MSCNT, &val32); 248fe: ae 01 movw r20, r28 24900: 4f 5f subi r20, 0xFF ; 255 24902: 5f 4f sbci r21, 0xFF ; 255 24904: 6a e6 ldi r22, 0x6A ; 106 24906: 0f 94 f1 23 call 0x247e2 ; 0x247e2 return val32 & 0x3ff; 2490a: 89 81 ldd r24, Y+1 ; 0x01 2490c: 9a 81 ldd r25, Y+2 ; 0x02 } 2490e: 93 70 andi r25, 0x03 ; 3 24910: 0f 90 pop r0 24912: 0f 90 pop r0 24914: 0f 90 pop r0 24916: 0f 90 pop r0 24918: df 91 pop r29 2491a: cf 91 pop r28 2491c: 08 95 ret 0002491e : #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 */) { 2491e: ff 92 push r15 24920: 0f 93 push r16 24922: 1f 93 push r17 24924: cf 93 push r28 24926: df 93 push r29 24928: f8 2e mov r15, r24 2492a: ea 01 movw r28, r20 // Initialise the chopper configuration ChopConfU chopconf = ChopConfU(currents[axis].getvSense(), mres); 2492c: e8 2f mov r30, r24 2492e: f0 e0 ldi r31, 0x00 ; 0 24930: 83 e0 ldi r24, 0x03 ; 3 24932: f8 9e mul r15, r24 24934: 80 01 movw r16, r0 24936: 11 24 eor r1, r1 24938: 03 5a subi r16, 0xA3 ; 163 2493a: 1d 4f sbci r17, 0xFD ; 253 2493c: d8 01 movw r26, r16 2493e: 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) {} 24940: 30 e0 ldi r19, 0x00 ; 0 24942: 37 7f andi r19, 0xF7 ; 247 24944: 3f 7e andi r19, 0xEF ; 239 24946: 3f 7d andi r19, 0xDF ; 223 24948: 3f 7b andi r19, 0xBF ; 191 2494a: 40 e0 ldi r20, 0x00 ; 0 2494c: 80 fb bst r24, 0 2494e: 41 f9 bld r20, 1 24950: 43 70 andi r20, 0x03 ; 3 24952: 56 2f mov r21, r22 24954: 5f 70 andi r21, 0x0F ; 15 24956: 50 62 ori r21, 0x20 ; 32 24958: 5f 7b andi r21, 0xBF ; 191 2495a: 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 2495c: 81 e0 ldi r24, 0x01 ; 1 2495e: 61 11 cpse r22, r1 24960: 01 c0 rjmp .+2 ; 0x24964 24962: 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); 24964: 80 fb bst r24, 0 24966: 54 f9 bld r21, 4 chopconf.s.toff = tmc2130_chopper_config[axis].toff; // toff = 3 (fchop = 27.778kHz) 24968: bf 01 movw r22, r30 2496a: 66 0f add r22, r22 2496c: 77 1f adc r23, r23 2496e: fb 01 movw r30, r22 24970: eb 55 subi r30, 0x5B ; 91 24972: fd 4f sbci r31, 0xFD ; 253 24974: 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 24976: 92 2f mov r25, r18 24978: 99 1f adc r25, r25 2497a: 99 27 eor r25, r25 2497c: 99 1f adc r25, r25 2497e: 81 81 ldd r24, Z+1 ; 0x01 24980: 87 70 andi r24, 0x07 ; 7 24982: 88 0f add r24, r24 24984: 89 2b or r24, r25 24986: 80 fb bst r24, 0 24988: 27 f9 bld r18, 7 2498a: 86 95 lsr r24 2498c: 87 70 andi r24, 0x07 ; 7 2498e: 38 7f andi r19, 0xF8 ; 248 24990: 38 2b or r19, r24 chopconf.s.tbl = tmc2130_chopper_config[axis].tbl; //blanking time, original value = 2 24992: 6a 55 subi r22, 0x5A ; 90 24994: 7d 4f sbci r23, 0xFD ; 253 24996: fb 01 movw r30, r22 24998: 80 81 ld r24, Z 2499a: 86 95 lsr r24 2499c: 86 95 lsr r24 2499e: 86 95 lsr r24 249a0: 80 fb bst r24, 0 249a2: 37 f9 bld r19, 7 249a4: 81 fb bst r24, 1 249a6: 40 f9 bld r20, 0 tmc2130_wr(axis, TMC2130_REG_CHOPCONF, chopconf.dw); 249a8: 6c ee ldi r22, 0xEC ; 236 249aa: 8f 2d mov r24, r15 249ac: 0f 94 4b 24 call 0x24896 ; 0x24896 if (curr == nullptr) { 249b0: 20 97 sbiw r28, 0x00 ; 0 249b2: 09 f4 brne .+2 ; 0x249b6 curr = ¤ts[axis]; 249b4: e8 01 movw r28, r16 249b6: 19 81 ldd r17, Y+1 ; 0x01 249b8: 8a 81 ldd r24, Y+2 ; 0x02 249ba: c1 2f mov r28, r17 249bc: 81 17 cp r24, r17 249be: 08 f4 brcc .+2 ; 0x249c2 249c0: 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()) { 249c2: 18 17 cp r17, r24 249c4: 40 f4 brcc .+16 ; 0x249d6 // Let user know firmware modified the value SERIAL_ECHO_START; 249c6: 82 ec ldi r24, 0xC2 ; 194 249c8: 9b ea ldi r25, 0xAB ; 171 249ca: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHOLNRPGM(_n("Hold current truncated to Run current")); 249ce: 8e e7 ldi r24, 0x7E ; 126 249d0: 9e e6 ldi r25, 0x6E ; 110 249d2: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 struct S { uint8_t iHold; uint8_t iRun; uint16_t iHoldDelay; constexpr S(uint8_t ih, uint8_t ir) : iHold(ih & 0x1F) 249d6: 2c 2f mov r18, r28 249d8: 2f 71 andi r18, 0x1F ; 31 , iRun(ir & 0x1F) 249da: 31 2f mov r19, r17 249dc: 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); 249de: 4f e0 ldi r20, 0x0F ; 15 249e0: 50 e0 ldi r21, 0x00 ; 0 249e2: 60 e9 ldi r22, 0x90 ; 144 249e4: 8f 2d mov r24, r15 tmc2130_wr(axis, TMC2130_REG_CHOPCONF, chopconf.dw); if (curr == nullptr) { curr = ¤ts[axis]; } SetCurrents(axis, *curr); } 249e6: df 91 pop r29 249e8: cf 91 pop r28 249ea: 1f 91 pop r17 249ec: 0f 91 pop r16 249ee: 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); 249f0: 0d 94 4b 24 jmp 0x24896 ; 0x24896 000249f4 : return tmc2130_mres2usteps(tmc2130_mres[axis]); } void tmc2130_set_res(uint8_t axis, uint16_t res) { tmc2130_mres[axis] = tmc2130_usteps2mres(res); 249f4: e8 2f mov r30, r24 249f6: 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--; 249f8: 98 e0 ldi r25, 0x08 ; 8 249fa: 76 95 lsr r23 249fc: 67 95 ror r22 249fe: 61 15 cp r22, r1 24a00: 71 05 cpc r23, r1 24a02: 11 f0 breq .+4 ; 0x24a08 24a04: 91 50 subi r25, 0x01 ; 1 24a06: f9 cf rjmp .-14 ; 0x249fa return tmc2130_mres2usteps(tmc2130_mres[axis]); } void tmc2130_set_res(uint8_t axis, uint16_t res) { tmc2130_mres[axis] = tmc2130_usteps2mres(res); 24a08: eb 50 subi r30, 0x0B ; 11 24a0a: fb 4f sbci r31, 0xFB ; 251 24a0c: 90 83 st Z, r25 // uint32_t u = _micros(); tmc2130_setup_chopper(axis, tmc2130_mres[axis]); 24a0e: 50 e0 ldi r21, 0x00 ; 0 24a10: 40 e0 ldi r20, 0x00 ; 0 24a12: 69 2f mov r22, r25 24a14: 0d 94 8f 24 jmp 0x2491e ; 0x2491e 00024a18 : } return 0; } static void tmc2130_XYZ_reg_init(uint8_t axis) { 24a18: 0f 93 push r16 24a1a: 1f 93 push r17 24a1c: cf 93 push r28 24a1e: df 93 push r29 24a20: c8 2f mov r28, r24 tmc2130_setup_chopper(axis, tmc2130_mres[axis]); 24a22: 08 2f mov r16, r24 24a24: 10 e0 ldi r17, 0x00 ; 0 24a26: f8 01 movw r30, r16 24a28: eb 50 subi r30, 0x0B ; 11 24a2a: fb 4f sbci r31, 0xFB ; 251 24a2c: 50 e0 ldi r21, 0x00 ; 0 24a2e: 40 e0 ldi r20, 0x00 ; 0 24a30: 60 81 ld r22, Z 24a32: 0f 94 8f 24 call 0x2491e ; 0x2491e tmc2130_wr(axis, TMC2130_REG_TPOWERDOWN, 0x00000000); 24a36: 20 e0 ldi r18, 0x00 ; 0 24a38: 30 e0 ldi r19, 0x00 ; 0 24a3a: a9 01 movw r20, r18 24a3c: 61 e9 ldi r22, 0x91 ; 145 24a3e: 8c 2f mov r24, r28 24a40: 0f 94 4b 24 call 0x24896 ; 0x24896 const bool isStealth = (tmc2130_mode == TMC2130_MODE_SILENT); 24a44: d0 91 8c 06 lds r29, 0x068C ; 0x80068c if (axis == Z_AXIS) { 24a48: c2 30 cpi r28, 0x02 ; 2 24a4a: e1 f5 brne .+120 ; 0x24ac4 #ifdef TMC2130_STEALTH_Z tmc2130_wr(axis, TMC2130_REG_COOLCONF, (((uint32_t)tmc2130_sg_thr[axis]) << 16) | ((uint32_t)1 << 24)); 24a4c: 20 e0 ldi r18, 0x00 ; 0 24a4e: 30 e0 ldi r19, 0x00 ; 0 24a50: 44 e0 ldi r20, 0x04 ; 4 24a52: 51 e0 ldi r21, 0x01 ; 1 24a54: 6d ee ldi r22, 0xED ; 237 24a56: 82 e0 ldi r24, 0x02 ; 2 24a58: 0f 94 4b 24 call 0x24896 ; 0x24896 tmc2130_wr(axis, TMC2130_REG_TCOOLTHRS, isStealth ? 0 : __tcoolthrs(axis)); 24a5c: 24 ef ldi r18, 0xF4 ; 244 24a5e: 31 e0 ldi r19, 0x01 ; 1 24a60: 40 e0 ldi r20, 0x00 ; 0 24a62: 50 e0 ldi r21, 0x00 ; 0 24a64: d1 30 cpi r29, 0x01 ; 1 24a66: 19 f4 brne .+6 ; 0x24a6e 24a68: 20 e0 ldi r18, 0x00 ; 0 24a6a: 30 e0 ldi r19, 0x00 ; 0 24a6c: a9 01 movw r20, r18 24a6e: 64 e9 ldi r22, 0x94 ; 148 24a70: 82 e0 ldi r24, 0x02 ; 2 24a72: 0f 94 4b 24 call 0x24896 ; 0x24896 tmc2130_wr(axis, TMC2130_REG_GCONF, isStealth ? TMC2130_GCONF_SILENT : TMC2130_GCONF_DYNAMIC_SGSENS); 24a76: 24 e8 ldi r18, 0x84 ; 132 24a78: 31 e0 ldi r19, 0x01 ; 1 24a7a: 40 e0 ldi r20, 0x00 ; 0 24a7c: 50 e0 ldi r21, 0x00 ; 0 24a7e: d1 30 cpi r29, 0x01 ; 1 24a80: 21 f4 brne .+8 ; 0x24a8a 24a82: 24 e0 ldi r18, 0x04 ; 4 24a84: 30 e0 ldi r19, 0x00 ; 0 24a86: 40 e0 ldi r20, 0x00 ; 0 24a88: 50 e0 ldi r21, 0x00 ; 0 24a8a: 60 e8 ldi r22, 0x80 ; 128 24a8c: 82 e0 ldi r24, 0x02 ; 2 24a8e: 0f 94 4b 24 call 0x24896 ; 0x24896 tmc2130_wr(axis, TMC2130_REG_PWMCONF, pwmconf[axis].dw); 24a92: 28 ec ldi r18, 0xC8 ; 200 24a94: 34 e0 ldi r19, 0x04 ; 4 24a96: 46 e0 ldi r20, 0x06 ; 6 24a98: 50 e0 ldi r21, 0x00 ; 0 24a9a: 60 ef ldi r22, 0xF0 ; 240 24a9c: 82 e0 ldi r24, 0x02 ; 2 24a9e: 0f 94 4b 24 call 0x24896 ; 0x24896 tmc2130_wr(axis, TMC2130_REG_TPWMTHRS, isStealth ? 0 : 0xFFFF0); 24aa2: 20 ef ldi r18, 0xF0 ; 240 24aa4: 3f ef ldi r19, 0xFF ; 255 24aa6: 4f e0 ldi r20, 0x0F ; 15 24aa8: 50 e0 ldi r21, 0x00 ; 0 24aaa: d1 30 cpi r29, 0x01 ; 1 24aac: 19 f4 brne .+6 ; 0x24ab4 24aae: 20 e0 ldi r18, 0x00 ; 0 24ab0: 30 e0 ldi r19, 0x00 ; 0 24ab2: a9 01 movw r20, r18 24ab4: 63 e9 ldi r22, 0x93 ; 147 24ab6: 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); } } 24ab8: df 91 pop r29 24aba: cf 91 pop r28 24abc: 1f 91 pop r17 24abe: 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); 24ac0: 0d 94 4b 24 jmp 0x24896 ; 0x24896 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)); 24ac4: f8 01 movw r30, r16 24ac6: e7 5e subi r30, 0xE7 ; 231 24ac8: fc 4f sbci r31, 0xFC ; 252 24aca: 20 81 ld r18, Z 24acc: 30 e0 ldi r19, 0x00 ; 0 24ace: 50 e0 ldi r21, 0x00 ; 0 24ad0: 40 e0 ldi r20, 0x00 ; 0 24ad2: a9 01 movw r20, r18 24ad4: 33 27 eor r19, r19 24ad6: 22 27 eor r18, r18 24ad8: 51 60 ori r21, 0x01 ; 1 24ada: 6d ee ldi r22, 0xED ; 237 24adc: 8c 2f mov r24, r28 24ade: 0f 94 4b 24 call 0x24896 ; 0x24896 tmc2130_wr(axis, TMC2130_REG_TCOOLTHRS, isStealth ? 0 : __tcoolthrs(axis)); 24ae2: 20 e0 ldi r18, 0x00 ; 0 24ae4: 30 e0 ldi r19, 0x00 ; 0 24ae6: a9 01 movw r20, r18 24ae8: d1 30 cpi r29, 0x01 ; 1 24aea: 61 f0 breq .+24 ; 0x24b04 uint16_t __tcoolthrs(uint8_t axis) { switch (axis) { case X_AXIS: return TMC2130_TCOOLTHRS_X; 24aec: 2e ea ldi r18, 0xAE ; 174 24aee: 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) 24af0: c2 30 cpi r28, 0x02 ; 2 24af2: 30 f0 brcs .+12 ; 0x24b00 { case X_AXIS: return TMC2130_TCOOLTHRS_X; case Y_AXIS: return TMC2130_TCOOLTHRS_Y; case Z_AXIS: return TMC2130_TCOOLTHRS_Z; 24af4: 24 ef ldi r18, 0xF4 ; 244 24af6: 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) 24af8: c2 30 cpi r28, 0x02 ; 2 24afa: 11 f0 breq .+4 ; 0x24b00 { case X_AXIS: return TMC2130_TCOOLTHRS_X; case Y_AXIS: return TMC2130_TCOOLTHRS_Y; case Z_AXIS: return TMC2130_TCOOLTHRS_Z; } return 0; 24afc: 30 e0 ldi r19, 0x00 ; 0 24afe: 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)); 24b00: 50 e0 ldi r21, 0x00 ; 0 24b02: 40 e0 ldi r20, 0x00 ; 0 24b04: 64 e9 ldi r22, 0x94 ; 148 24b06: 8c 2f mov r24, r28 24b08: 0f 94 4b 24 call 0x24896 ; 0x24896 tmc2130_wr(axis, TMC2130_REG_GCONF, isStealth ? TMC2130_GCONF_SILENT : TMC2130_GCONF_SGSENS); 24b0c: 20 e8 ldi r18, 0x80 ; 128 24b0e: 31 e0 ldi r19, 0x01 ; 1 24b10: 40 e0 ldi r20, 0x00 ; 0 24b12: 50 e0 ldi r21, 0x00 ; 0 24b14: d1 30 cpi r29, 0x01 ; 1 24b16: 21 f4 brne .+8 ; 0x24b20 24b18: 24 e0 ldi r18, 0x04 ; 4 24b1a: 30 e0 ldi r19, 0x00 ; 0 24b1c: 40 e0 ldi r20, 0x00 ; 0 24b1e: 50 e0 ldi r21, 0x00 ; 0 24b20: 60 e8 ldi r22, 0x80 ; 128 24b22: 8c 2f mov r24, r28 24b24: 0f 94 4b 24 call 0x24896 ; 0x24896 tmc2130_wr(axis, TMC2130_REG_PWMCONF, pwmconf[axis].dw); 24b28: 00 0f add r16, r16 24b2a: 11 1f adc r17, r17 24b2c: 00 0f add r16, r16 24b2e: 11 1f adc r17, r17 24b30: f8 01 movw r30, r16 24b32: e7 5f subi r30, 0xF7 ; 247 24b34: fc 4f sbci r31, 0xFC ; 252 24b36: 20 81 ld r18, Z 24b38: 31 81 ldd r19, Z+1 ; 0x01 24b3a: 42 81 ldd r20, Z+2 ; 0x02 24b3c: 53 81 ldd r21, Z+3 ; 0x03 24b3e: 60 ef ldi r22, 0xF0 ; 240 24b40: 8c 2f mov r24, r28 24b42: 0f 94 4b 24 call 0x24896 ; 0x24896 tmc2130_wr(axis, TMC2130_REG_TPWMTHRS, TMC2130_TPWMTHRS); 24b46: 20 e0 ldi r18, 0x00 ; 0 24b48: 30 e0 ldi r19, 0x00 ; 0 24b4a: a9 01 movw r20, r18 24b4c: 63 e9 ldi r22, 0x93 ; 147 24b4e: 8c 2f mov r24, r28 24b50: b3 cf rjmp .-154 ; 0x24ab8 00024b52 : } #endif //TMC2130_SG_HOMING } void tmc2130_home_exit() { 24b52: 1f 93 push r17 24b54: cf 93 push r28 24b56: df 93 push r29 printf_P(PSTR("tmc2130_home_exit tmc2130_sg_homing_axes_mask=0x%02x\n"), tmc2130_sg_homing_axes_mask); 24b58: 80 91 43 06 lds r24, 0x0643 ; 0x800643 24b5c: 1f 92 push r1 24b5e: 8f 93 push r24 24b60: 82 ec ldi r24, 0xC2 ; 194 24b62: 9f e9 ldi r25, 0x9F ; 159 24b64: 9f 93 push r25 24b66: 8f 93 push r24 24b68: 0f 94 de da call 0x3b5bc ; 0x3b5bc #ifdef TMC2130_SG_HOMING if (tmc2130_sg_homing_axes_mask & (X_AXIS_MASK | Y_AXIS_MASK)) 24b6c: 80 91 43 06 lds r24, 0x0643 ; 0x800643 24b70: 83 70 andi r24, 0x03 ; 3 24b72: 0f 90 pop r0 24b74: 0f 90 pop r0 24b76: 0f 90 pop r0 24b78: 0f 90 pop r0 24b7a: 11 f0 breq .+4 ; 0x24b80 tmc2130_wait_standstill_xy(1000); 24b7c: 0f 94 18 88 call 0x31030 ; 0x31030 if (tmc2130_sg_homing_axes_mask) 24b80: 10 91 43 06 lds r17, 0x0643 ; 0x800643 24b84: 11 23 and r17, r17 24b86: 71 f0 breq .+28 ; 0x24ba4 { for (uint8_t axis = X_AXIS, mask = X_AXIS_MASK; axis <= Z_AXIS; axis++, mask <<= 1) //X Y and Z axes 24b88: d1 e0 ldi r29, 0x01 ; 1 24b8a: c0 e0 ldi r28, 0x00 ; 0 { if (tmc2130_sg_homing_axes_mask & mask) { 24b8c: 81 2f mov r24, r17 24b8e: 8d 23 and r24, r29 24b90: 19 f0 breq .+6 ; 0x24b98 tmc2130_XYZ_reg_init(axis); 24b92: 8c 2f mov r24, r28 24b94: 0f 94 0c 25 call 0x24a18 ; 0x24a18 #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 24b98: cf 5f subi r28, 0xFF ; 255 24b9a: dd 0f add r29, r29 24b9c: c3 30 cpi r28, 0x03 ; 3 24b9e: b1 f7 brne .-20 ; 0x24b8c { if (tmc2130_sg_homing_axes_mask & mask) { tmc2130_XYZ_reg_init(axis); } } tmc2130_sg_homing_axes_mask = 0x00; 24ba0: 10 92 43 06 sts 0x0643, r1 ; 0x800643 } tmc2130_sg_crash = false; 24ba4: 10 92 0d 05 sts 0x050D, r1 ; 0x80050d #endif } 24ba8: df 91 pop r29 24baa: cf 91 pop r28 24bac: 1f 91 pop r17 24bae: 08 95 ret 00024bb0 : } return false; } void tmc2130_home_enter(uint8_t axes_mask) { 24bb0: df 92 push r13 24bb2: ef 92 push r14 24bb4: ff 92 push r15 24bb6: 0f 93 push r16 24bb8: 1f 93 push r17 24bba: cf 93 push r28 24bbc: df 93 push r29 24bbe: 00 d0 rcall .+0 ; 0x24bc0 24bc0: cd b7 in r28, 0x3d ; 61 24bc2: de b7 in r29, 0x3e ; 62 24bc4: d8 2e mov r13, r24 printf_P(PSTR("tmc2130_home_enter(axes_mask=0x%02x)\n"), axes_mask); 24bc6: 1f 92 push r1 24bc8: 8f 93 push r24 24bca: 8c e9 ldi r24, 0x9C ; 156 24bcc: 9f e9 ldi r25, 0x9F ; 159 24bce: 9f 93 push r25 24bd0: 8f 93 push r24 24bd2: 0f 94 de da call 0x3b5bc ; 0x3b5bc #ifdef TMC2130_SG_HOMING if (axes_mask & (X_AXIS_MASK | Y_AXIS_MASK)) //X or Y 24bd6: 8d 2d mov r24, r13 24bd8: 83 70 andi r24, 0x03 ; 3 24bda: 0f 90 pop r0 24bdc: 0f 90 pop r0 24bde: 0f 90 pop r0 24be0: 0f 90 pop r0 24be2: 11 f0 breq .+4 ; 0x24be8 tmc2130_wait_standstill_xy(1000); 24be4: 0f 94 18 88 call 0x31030 ; 0x31030 } return false; } void tmc2130_home_enter(uint8_t axes_mask) { 24be8: 10 e0 ldi r17, 0x00 ; 0 24bea: 00 e0 ldi r16, 0x00 ; 0 24bec: ff 24 eor r15, r15 24bee: f3 94 inc r15 24bf0: 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) 24bf2: 8d 2d mov r24, r13 24bf4: 8f 21 and r24, r15 24bf6: 09 f4 brne .+2 ; 0x24bfa 24bf8: 46 c0 rjmp .+140 ; 0x24c86 { tmc2130_sg_homing_axes_mask |= mask; 24bfa: 80 91 43 06 lds r24, 0x0643 ; 0x800643 24bfe: 8f 29 or r24, r15 24c00: 80 93 43 06 sts 0x0643, r24 ; 0x800643 //Configuration to spreadCycle tmc2130_wr(axis, TMC2130_REG_GCONF, TMC2130_GCONF_NORMAL); 24c04: 20 e0 ldi r18, 0x00 ; 0 24c06: 30 e0 ldi r19, 0x00 ; 0 24c08: a9 01 movw r20, r18 24c0a: 60 e8 ldi r22, 0x80 ; 128 24c0c: 80 2f mov r24, r16 24c0e: 0f 94 4b 24 call 0x24896 ; 0x24896 tmc2130_wr(axis, TMC2130_REG_COOLCONF, (((uint32_t)tmc2130_sg_thr_home[axis]) << 16)); 24c12: f8 01 movw r30, r16 24c14: e7 5e subi r30, 0xE7 ; 231 24c16: fc 4f sbci r31, 0xFC ; 252 24c18: 20 81 ld r18, Z 24c1a: 30 e0 ldi r19, 0x00 ; 0 24c1c: 50 e0 ldi r21, 0x00 ; 0 24c1e: 40 e0 ldi r20, 0x00 ; 0 24c20: a9 01 movw r20, r18 24c22: 33 27 eor r19, r19 24c24: 22 27 eor r18, r18 24c26: 6d ee ldi r22, 0xED ; 237 24c28: 80 2f mov r24, r16 24c2a: 0f 94 4b 24 call 0x24896 ; 0x24896 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) 24c2e: 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; 24c30: 24 ef ldi r18, 0xF4 ; 244 24c32: 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) 24c34: 08 17 cp r16, r24 24c36: 11 f0 breq .+4 ; 0x24c3c { case X_AXIS: return TMC2130_TCOOLTHRS_X; 24c38: 2e ea ldi r18, 0xAE ; 174 24c3a: 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)); 24c3c: 50 e0 ldi r21, 0x00 ; 0 24c3e: 40 e0 ldi r20, 0x00 ; 0 24c40: 64 e9 ldi r22, 0x94 ; 148 24c42: 8e 2d mov r24, r14 24c44: 0f 94 4b 24 call 0x24896 ; 0x24896 iRun >>= 1; } } // PROGMEM initializer inline __attribute__((always_inline)) MotorCurrents(const MotorCurrents &curr_P) { memcpy_P(this, &curr_P, sizeof(*this)); } 24c48: b8 01 movw r22, r16 24c4a: 66 0f add r22, r22 24c4c: 77 1f adc r23, r23 24c4e: 60 0f add r22, r16 24c50: 71 1f adc r23, r17 24c52: 60 57 subi r22, 0x70 ; 112 24c54: 70 46 sbci r23, 0x60 ; 96 24c56: 43 e0 ldi r20, 0x03 ; 3 24c58: 50 e0 ldi r21, 0x00 ; 0 24c5a: ce 01 movw r24, r28 24c5c: 01 96 adiw r24, 0x01 ; 1 24c5e: 0f 94 b6 d9 call 0x3b36c ; 0x3b36c MotorCurrents curr(homing_currents_P[axis]); tmc2130_setup_chopper(axis, tmc2130_mres[axis], &curr); 24c62: ae 01 movw r20, r28 24c64: 4f 5f subi r20, 0xFF ; 255 24c66: 5f 4f sbci r21, 0xFF ; 255 24c68: f8 01 movw r30, r16 24c6a: eb 50 subi r30, 0x0B ; 11 24c6c: fb 4f sbci r31, 0xFB ; 251 24c6e: 60 81 ld r22, Z 24c70: 8e 2d mov r24, r14 24c72: 0f 94 8f 24 call 0x2491e ; 0x2491e tmc2130_wr(axis, TMC2130_REG_GCONF, TMC2130_GCONF_SGSENS); //stallguard output DIAG1, DIAG1 = pushpull 24c76: 20 e8 ldi r18, 0x80 ; 128 24c78: 31 e0 ldi r19, 0x01 ; 1 24c7a: 40 e0 ldi r20, 0x00 ; 0 24c7c: 50 e0 ldi r21, 0x00 ; 0 24c7e: 60 e8 ldi r22, 0x80 ; 128 24c80: 8e 2d mov r24, r14 24c82: 0f 94 4b 24 call 0x24896 ; 0x24896 { 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 24c86: ff 0c add r15, r15 24c88: 0f 5f subi r16, 0xFF ; 255 24c8a: 1f 4f sbci r17, 0xFF ; 255 24c8c: 03 30 cpi r16, 0x03 ; 3 24c8e: 11 05 cpc r17, r1 24c90: 09 f0 breq .+2 ; 0x24c94 24c92: ae cf rjmp .-164 ; 0x24bf0 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 } 24c94: 0f 90 pop r0 24c96: 0f 90 pop r0 24c98: 0f 90 pop r0 24c9a: df 91 pop r29 24c9c: cf 91 pop r28 24c9e: 1f 91 pop r17 24ca0: 0f 91 pop r16 24ca2: ff 90 pop r15 24ca4: ef 90 pop r14 24ca6: df 90 pop r13 24ca8: 08 95 ret 00024caa : crashdet_stop_and_save_print(); } } void crashdet_use_eeprom_setting() { tmc2130_sg_stop_on_crash = eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET); 24caa: 89 e6 ldi r24, 0x69 ; 105 24cac: 9f e0 ldi r25, 0x0F ; 15 24cae: 0f 94 1c dc call 0x3b838 ; 0x3b838 24cb2: 91 e0 ldi r25, 0x01 ; 1 24cb4: 81 11 cpse r24, r1 24cb6: 01 c0 rjmp .+2 ; 0x24cba 24cb8: 90 e0 ldi r25, 0x00 ; 0 24cba: 90 93 5c 02 sts 0x025C, r25 ; 0x80025c } 24cbe: 08 95 ret 00024cc0 : tmc2130_wr(axis, TMC2130_REG_TPWMTHRS, TMC2130_TPWMTHRS); } } void tmc2130_init(TMCInitParams params) { 24cc0: cf 93 push r28 24cc2: c8 2f mov r28, r24 // DBG(_n("tmc2130_init(), mode=%S\n"), tmc2130_mode?_n("STEALTH"):_n("NORMAL")); WRITE(X_TMC2130_CS, HIGH); 24cc4: a0 9a sbi 0x14, 0 ; 20 WRITE(Y_TMC2130_CS, HIGH); 24cc6: a2 9a sbi 0x14, 2 ; 20 WRITE(Z_TMC2130_CS, HIGH); 24cc8: 9f b7 in r25, 0x3f ; 63 24cca: f8 94 cli 24ccc: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24cd0: 80 62 ori r24, 0x20 ; 32 24cd2: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24cd6: 9f bf out 0x3f, r25 ; 63 WRITE(E0_TMC2130_CS, HIGH); 24cd8: 9f b7 in r25, 0x3f ; 63 24cda: f8 94 cli 24cdc: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24ce0: 80 61 ori r24, 0x10 ; 16 24ce2: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24ce6: 9f bf out 0x3f, r25 ; 63 SET_OUTPUT(X_TMC2130_CS); 24ce8: 98 9a sbi 0x13, 0 ; 19 SET_OUTPUT(Y_TMC2130_CS); 24cea: 9a 9a sbi 0x13, 2 ; 19 SET_OUTPUT(Z_TMC2130_CS); 24cec: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 24cf0: 80 62 ori r24, 0x20 ; 32 24cf2: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_OUTPUT(E0_TMC2130_CS); 24cf6: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 24cfa: 80 61 ori r24, 0x10 ; 16 24cfc: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_INPUT(X_TMC2130_DIAG); 24d00: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 24d04: 8b 7f andi r24, 0xFB ; 251 24d06: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_INPUT(Y_TMC2130_DIAG); 24d0a: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 24d0e: 8f 77 andi r24, 0x7F ; 127 24d10: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_INPUT(Z_TMC2130_DIAG); 24d14: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 24d18: 8f 7b andi r24, 0xBF ; 191 24d1a: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_INPUT(E0_TMC2130_DIAG); 24d1e: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 24d22: 87 7f andi r24, 0xF7 ; 247 24d24: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> WRITE(X_TMC2130_DIAG,HIGH); 24d28: 9f b7 in r25, 0x3f ; 63 24d2a: f8 94 cli 24d2c: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24d30: 84 60 ori r24, 0x04 ; 4 24d32: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24d36: 9f bf out 0x3f, r25 ; 63 WRITE(Y_TMC2130_DIAG,HIGH); 24d38: 9f b7 in r25, 0x3f ; 63 24d3a: f8 94 cli 24d3c: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24d40: 80 68 ori r24, 0x80 ; 128 24d42: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24d46: 9f bf out 0x3f, r25 ; 63 WRITE(Z_TMC2130_DIAG,HIGH); 24d48: 9f b7 in r25, 0x3f ; 63 24d4a: f8 94 cli 24d4c: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24d50: 80 64 ori r24, 0x40 ; 64 24d52: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24d56: 9f bf out 0x3f, r25 ; 63 WRITE(E0_TMC2130_DIAG,HIGH); 24d58: 9f b7 in r25, 0x3f ; 63 24d5a: f8 94 cli 24d5c: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24d60: 88 60 ori r24, 0x08 ; 8 24d62: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24d66: 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); 24d68: 80 e0 ldi r24, 0x00 ; 0 24d6a: 0f 94 0c 25 call 0x24a18 ; 0x24a18 24d6e: 81 e0 ldi r24, 0x01 ; 1 24d70: 0f 94 0c 25 call 0x24a18 ; 0x24a18 24d74: 82 e0 ldi r24, 0x02 ; 2 24d76: 0f 94 0c 25 call 0x24a18 ; 0x24a18 } // E axis tmc2130_setup_chopper(E_AXIS, tmc2130_mres[E_AXIS]); 24d7a: 50 e0 ldi r21, 0x00 ; 0 24d7c: 40 e0 ldi r20, 0x00 ; 0 24d7e: 60 91 f8 04 lds r22, 0x04F8 ; 0x8004f8 24d82: 83 e0 ldi r24, 0x03 ; 3 24d84: 0f 94 8f 24 call 0x2491e ; 0x2491e tmc2130_wr(E_AXIS, TMC2130_REG_TPOWERDOWN, 0x00000000); 24d88: 20 e0 ldi r18, 0x00 ; 0 24d8a: 30 e0 ldi r19, 0x00 ; 0 24d8c: a9 01 movw r20, r18 24d8e: 61 e9 ldi r22, 0x91 ; 145 24d90: 83 e0 ldi r24, 0x03 ; 3 24d92: 0f 94 4b 24 call 0x24896 ; 0x24896 #ifndef TMC2130_STEALTH_E if( ! params.enableECool ){ 24d96: c1 fd sbrc r28, 1 24d98: 1d c0 rjmp .+58 ; 0x24dd4 tmc2130_wr(E_AXIS, TMC2130_REG_GCONF, TMC2130_GCONF_SGSENS); 24d9a: 20 e8 ldi r18, 0x80 ; 128 24d9c: 31 e0 ldi r19, 0x01 ; 1 24d9e: 40 e0 ldi r20, 0x00 ; 0 24da0: 50 e0 ldi r21, 0x00 ; 0 24da2: 60 e8 ldi r22, 0x80 ; 128 24da4: 83 e0 ldi r24, 0x03 ; 3 24da6: 0f 94 4b 24 call 0x24896 ; 0x24896 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]); 24daa: 60 91 f9 04 lds r22, 0x04F9 ; 0x8004f9 24dae: 80 e0 ldi r24, 0x00 ; 0 24db0: 0f 94 8c 88 call 0x31118 ; 0x31118 tmc2130_set_wave(Y_AXIS, 247, tmc2130_wave_fac[Y_AXIS]); 24db4: 60 91 fa 04 lds r22, 0x04FA ; 0x8004fa 24db8: 81 e0 ldi r24, 0x01 ; 1 24dba: 0f 94 8c 88 call 0x31118 ; 0x31118 tmc2130_set_wave(Z_AXIS, 247, tmc2130_wave_fac[Z_AXIS]); 24dbe: 60 91 fb 04 lds r22, 0x04FB ; 0x8004fb 24dc2: 82 e0 ldi r24, 0x02 ; 2 24dc4: 0f 94 8c 88 call 0x31118 ; 0x31118 #endif //TMC2130_LINEARITY_CORRECTION_XYZ tmc2130_set_wave(E_AXIS, 247, tmc2130_wave_fac[E_AXIS]); 24dc8: 60 91 fc 04 lds r22, 0x04FC ; 0x8004fc 24dcc: 83 e0 ldi r24, 0x03 ; 3 #ifdef PSU_Delta if(!params.bSuppressFlag) check_force_z(); #endif // PSU_Delta } 24dce: 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]); 24dd0: 0d 94 8c 88 jmp 0x31118 ; 0x31118 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)); 24dd4: 20 e0 ldi r18, 0x00 ; 0 24dd6: 30 e0 ldi r19, 0x00 ; 0 24dd8: 43 e0 ldi r20, 0x03 ; 3 24dda: 50 e0 ldi r21, 0x00 ; 0 24ddc: 6d ee ldi r22, 0xED ; 237 24dde: 83 e0 ldi r24, 0x03 ; 3 24de0: 0f 94 4b 24 call 0x24896 ; 0x24896 tmc2130_wr(E_AXIS, TMC2130_REG_TCOOLTHRS, 0); 24de4: 20 e0 ldi r18, 0x00 ; 0 24de6: 30 e0 ldi r19, 0x00 ; 0 24de8: a9 01 movw r20, r18 24dea: 64 e9 ldi r22, 0x94 ; 148 24dec: 83 e0 ldi r24, 0x03 ; 3 24dee: 0f 94 4b 24 call 0x24896 ; 0x24896 tmc2130_wr(E_AXIS, TMC2130_REG_GCONF, TMC2130_GCONF_SILENT); 24df2: 24 e0 ldi r18, 0x04 ; 4 24df4: 30 e0 ldi r19, 0x00 ; 0 24df6: 40 e0 ldi r20, 0x00 ; 0 24df8: 50 e0 ldi r21, 0x00 ; 0 24dfa: 60 e8 ldi r22, 0x80 ; 128 24dfc: 83 e0 ldi r24, 0x03 ; 3 24dfe: 0f 94 4b 24 call 0x24896 ; 0x24896 tmc2130_wr(E_AXIS, TMC2130_REG_PWMCONF, pwmconf_Ecool.dw); 24e02: 2b e2 ldi r18, 0x2B ; 43 24e04: 34 e5 ldi r19, 0x54 ; 84 24e06: 42 e0 ldi r20, 0x02 ; 2 24e08: 50 e0 ldi r21, 0x00 ; 0 24e0a: 60 ef ldi r22, 0xF0 ; 240 24e0c: 83 e0 ldi r24, 0x03 ; 3 24e0e: 0f 94 4b 24 call 0x24896 ; 0x24896 tmc2130_wr(E_AXIS, TMC2130_REG_TPWMTHRS, TMC2130_TPWMTHRS_E); 24e12: 23 e9 ldi r18, 0x93 ; 147 24e14: 31 e0 ldi r19, 0x01 ; 1 24e16: 40 e0 ldi r20, 0x00 ; 0 24e18: 50 e0 ldi r21, 0x00 ; 0 24e1a: 63 e9 ldi r22, 0x93 ; 147 24e1c: 83 e0 ldi r24, 0x03 ; 3 24e1e: 0f 94 4b 24 call 0x24896 ; 0x24896 SERIAL_ECHOLNRPGM(eMotorCurrentScalingEnabled); 24e22: 80 e7 ldi r24, 0x70 ; 112 24e24: 9f e9 ldi r25, 0x9F ; 159 24e26: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 24e2a: bf cf rjmp .-130 ; 0x24daa 00024e2c : , 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()); } 24e2c: fc 01 movw r30, r24 24e2e: 20 81 ld r18, Z 24e30: 92 81 ldd r25, Z+2 ; 0x02 24e32: 49 2f mov r20, r25 24e34: 50 e0 ldi r21, 0x00 ; 0 24e36: 21 11 cpse r18, r1 24e38: 02 c0 rjmp .+4 ; 0x24e3e 24e3a: 44 0f add r20, r20 24e3c: 55 1f adc r21, r21 24e3e: 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; } 24e40: 21 11 cpse r18, r1 24e42: 01 c0 rjmp .+2 ; 0x24e46 24e44: 88 0f add r24, r24 inline uint8_t getOriginaliHold() const { return min(vSense ? iHold : iHold << 1, getOriginaliRun()); } 24e46: 84 17 cp r24, r20 24e48: 15 06 cpc r1, r21 24e4a: 31 f0 breq .+12 ; 0x24e58 24e4c: 2c f0 brlt .+10 ; 0x24e58 24e4e: 89 2f mov r24, r25 24e50: 21 11 cpse r18, r1 24e52: 02 c0 rjmp .+4 ; 0x24e58 24e54: 88 0f add r24, r24 24e56: 08 95 ret 24e58: 08 95 ret 00024e5a : } unsigned long micros2(void) { unsigned long m; uint8_t oldSREG = SREG, t; 24e5a: 3f b7 in r19, 0x3f ; 63 cli(); 24e5c: f8 94 cli m = timer2_overflow_count; 24e5e: 80 91 3f 06 lds r24, 0x063F ; 0x80063f 24e62: 90 91 40 06 lds r25, 0x0640 ; 0x800640 24e66: a0 91 41 06 lds r26, 0x0641 ; 0x800641 24e6a: b0 91 42 06 lds r27, 0x0642 ; 0x800642 #if defined(TCNT2) t = TCNT2; 24e6e: 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)) 24e72: b8 9b sbis 0x17, 0 ; 23 24e74: 05 c0 rjmp .+10 ; 0x24e80 24e76: 2f 3f cpi r18, 0xFF ; 255 24e78: 19 f0 breq .+6 ; 0x24e80 m++; 24e7a: 01 96 adiw r24, 0x01 ; 1 24e7c: a1 1d adc r26, r1 24e7e: b1 1d adc r27, r1 #else if ((TIFR & _BV(TOV2)) && (t < 255)) m++; #endif SREG = oldSREG; 24e80: 3f bf out 0x3f, r19 ; 63 return ((m << 8) + t) * (64 / clockCyclesPerMicrosecond()); 24e82: ba 2f mov r27, r26 24e84: a9 2f mov r26, r25 24e86: 98 2f mov r25, r24 24e88: 88 27 eor r24, r24 24e8a: bc 01 movw r22, r24 24e8c: cd 01 movw r24, r26 24e8e: 62 0f add r22, r18 24e90: 71 1d adc r23, r1 24e92: 81 1d adc r24, r1 24e94: 91 1d adc r25, r1 24e96: 42 e0 ldi r20, 0x02 ; 2 24e98: 66 0f add r22, r22 24e9a: 77 1f adc r23, r23 24e9c: 88 1f adc r24, r24 24e9e: 99 1f adc r25, r25 24ea0: 4a 95 dec r20 24ea2: d1 f7 brne .-12 ; 0x24e98 } 24ea4: 08 95 ret 00024ea6 : void delay2(unsigned long ms) { 24ea6: 8f 92 push r8 24ea8: 9f 92 push r9 24eaa: af 92 push r10 24eac: bf 92 push r11 24eae: cf 92 push r12 24eb0: df 92 push r13 24eb2: ef 92 push r14 24eb4: ff 92 push r15 24eb6: 6b 01 movw r12, r22 24eb8: 7c 01 movw r14, r24 uint32_t start = micros2(); 24eba: 0f 94 2d 27 call 0x24e5a ; 0x24e5a 24ebe: 4b 01 movw r8, r22 24ec0: 5c 01 movw r10, r24 while (ms > 0) { yield(); while ( ms > 0 && (micros2() - start) >= 1000) 24ec2: c1 14 cp r12, r1 24ec4: d1 04 cpc r13, r1 24ec6: e1 04 cpc r14, r1 24ec8: f1 04 cpc r15, r1 24eca: b9 f0 breq .+46 ; 0x24efa 24ecc: 0f 94 2d 27 call 0x24e5a ; 0x24e5a 24ed0: 68 19 sub r22, r8 24ed2: 79 09 sbc r23, r9 24ed4: 8a 09 sbc r24, r10 24ed6: 9b 09 sbc r25, r11 24ed8: 68 3e cpi r22, 0xE8 ; 232 24eda: 73 40 sbci r23, 0x03 ; 3 24edc: 81 05 cpc r24, r1 24ede: 91 05 cpc r25, r1 24ee0: 80 f3 brcs .-32 ; 0x24ec2 { ms--; 24ee2: 21 e0 ldi r18, 0x01 ; 1 24ee4: c2 1a sub r12, r18 24ee6: d1 08 sbc r13, r1 24ee8: e1 08 sbc r14, r1 24eea: f1 08 sbc r15, r1 start += 1000; 24eec: 88 ee ldi r24, 0xE8 ; 232 24eee: 88 0e add r8, r24 24ef0: 83 e0 ldi r24, 0x03 ; 3 24ef2: 98 1e adc r9, r24 24ef4: a1 1c adc r10, r1 24ef6: b1 1c adc r11, r1 24ef8: e4 cf rjmp .-56 ; 0x24ec2 } } } 24efa: ff 90 pop r15 24efc: ef 90 pop r14 24efe: df 90 pop r13 24f00: cf 90 pop r12 24f02: bf 90 pop r11 24f04: af 90 pop r10 24f06: 9f 90 pop r9 24f08: 8f 90 pop r8 24f0a: 08 95 ret 00024f0c : * @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() { 24f0c: ef 92 push r14 24f0e: ff 92 push r15 24f10: 0f 93 push r16 24f12: 1f 93 push r17 24f14: cf 93 push r28 24f16: df 93 push r29 24f18: cd b7 in r28, 0x3d ; 61 24f1a: de b7 in r29, 0x3e ; 62 24f1c: 63 97 sbiw r28, 0x13 ; 19 24f1e: 0f b6 in r0, 0x3f ; 63 24f20: f8 94 cli 24f22: de bf out 0x3e, r29 ; 62 24f24: 0f be out 0x3f, r0 ; 63 24f26: 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) 24f28: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 24f2c: 81 11 cpse r24, r1 24f2e: 3a c0 rjmp .+116 ; 0x24fa4 { // Menu was entered. // Initialize its status. _md->status = 1; 24f30: 81 e0 ldi r24, 0x01 ; 1 24f32: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 check_babystep(); 24f36: 0e 94 7f 79 call 0xf2fe ; 0xf2fe if(!eeprom_is_sheet_initialized(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))){ 24f3a: 81 ea ldi r24, 0xA1 ; 161 24f3c: 9d e0 ldi r25, 0x0D ; 13 24f3e: 0f 94 1c dc call 0x3b838 ; 0x3b838 24f42: 18 2f mov r17, r24 24f44: 0e 94 41 76 call 0xec82 ; 0xec82 24f48: 81 11 cpse r24, r1 24f4a: ee c0 rjmp .+476 ; 0x25128 _md->babystepMemZ = 0; 24f4c: 10 92 ab 03 sts 0x03AB, r1 ; 0x8003ab 24f50: 10 92 aa 03 sts 0x03AA, r1 ; 0x8003aa _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)) 24f54: 80 e1 ldi r24, 0x10 ; 16 24f56: 0e 94 9f ee call 0x1dd3e ; 0x1dd3e 24f5a: 81 11 cpse r24, r1 24f5c: 04 c0 rjmp .+8 ; 0x24f66 _md->babystepMemZ = 0; 24f5e: 10 92 ab 03 sts 0x03AB, r1 ; 0x8003ab 24f62: 10 92 aa 03 sts 0x03AA, r1 ; 0x8003aa _md->babystepMemMMZ = _md->babystepMemZ/cs.axis_steps_per_mm[Z_AXIS]; 24f66: 60 91 aa 03 lds r22, 0x03AA ; 0x8003aa 24f6a: 70 91 ab 03 lds r23, 0x03AB ; 0x8003ab 24f6e: 07 2e mov r0, r23 24f70: 00 0c add r0, r0 24f72: 88 0b sbc r24, r24 24f74: 99 0b sbc r25, r25 24f76: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 24f7a: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 24f7e: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 24f82: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 24f86: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 24f8a: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 24f8e: 60 93 ac 03 sts 0x03AC, r22 ; 0x8003ac 24f92: 70 93 ad 03 sts 0x03AD, r23 ; 0x8003ad 24f96: 80 93 ae 03 sts 0x03AE, r24 ; 0x8003ae 24f9a: 90 93 af 03 sts 0x03AF, r25 ; 0x8003af lcd_draw_update = 1; 24f9e: 81 e0 ldi r24, 0x01 ; 1 24fa0: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d //SERIAL_ECHO("Z baby step: "); //SERIAL_ECHO(_md->babystepMem[2]); } if (lcd_encoder != 0) 24fa4: 80 91 70 06 lds r24, 0x0670 ; 0x800670 24fa8: 90 91 71 06 lds r25, 0x0671 ; 0x800671 24fac: 00 97 sbiw r24, 0x00 ; 0 24fae: f1 f1 breq .+124 ; 0x2502c { _md->babystepMemZ += lcd_encoder; 24fb0: 20 91 aa 03 lds r18, 0x03AA ; 0x8003aa 24fb4: 30 91 ab 03 lds r19, 0x03AB ; 0x8003ab 24fb8: 28 0f add r18, r24 24fba: 39 1f adc r19, r25 24fbc: 30 93 ab 03 sts 0x03AB, r19 ; 0x8003ab 24fc0: 20 93 aa 03 sts 0x03AA, r18 ; 0x8003aa if (_md->babystepMemZ < Z_BABYSTEP_MIN) _md->babystepMemZ = Z_BABYSTEP_MIN; //-3999 -> -9.99 mm 24fc4: 21 36 cpi r18, 0x61 ; 97 24fc6: 40 ef ldi r20, 0xF0 ; 240 24fc8: 34 07 cpc r19, r20 24fca: 0c f0 brlt .+2 ; 0x24fce 24fcc: ba c0 rjmp .+372 ; 0x25142 24fce: 81 e6 ldi r24, 0x61 ; 97 24fd0: 90 ef ldi r25, 0xF0 ; 240 24fd2: 90 93 ab 03 sts 0x03AB, r25 ; 0x8003ab 24fd6: 80 93 aa 03 sts 0x03AA, r24 ; 0x8003aa 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]; 24fda: 60 91 aa 03 lds r22, 0x03AA ; 0x8003aa 24fde: 70 91 ab 03 lds r23, 0x03AB ; 0x8003ab 24fe2: 07 2e mov r0, r23 24fe4: 00 0c add r0, r0 24fe6: 88 0b sbc r24, r24 24fe8: 99 0b sbc r25, r25 24fea: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 24fee: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 24ff2: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 24ff6: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 24ffa: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 24ffe: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 25002: 60 93 ac 03 sts 0x03AC, r22 ; 0x8003ac 25006: 70 93 ad 03 sts 0x03AD, r23 ; 0x8003ad 2500a: 80 93 ae 03 sts 0x03AE, r24 ; 0x8003ae 2500e: 90 93 af 03 sts 0x03AF, r25 ; 0x8003af _delay(50); 25012: 62 e3 ldi r22, 0x32 ; 50 25014: 70 e0 ldi r23, 0x00 ; 0 25016: 80 e0 ldi r24, 0x00 ; 0 25018: 90 e0 ldi r25, 0x00 ; 0 2501a: 0f 94 53 27 call 0x24ea6 ; 0x24ea6 lcd_encoder = 0; 2501e: 10 92 71 06 sts 0x0671, r1 ; 0x800671 25022: 10 92 70 06 sts 0x0670, r1 ; 0x800670 lcd_draw_update = 1; 25026: 81 e0 ldi r24, 0x01 ; 1 25028: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } if (lcd_draw_update) 2502c: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 25030: 88 23 and r24, r24 25032: c9 f1 breq .+114 ; 0x250a6 { SheetFormatBuffer buffer; menu_format_sheet_E(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))], buffer); 25034: 81 ea ldi r24, 0xA1 ; 161 25036: 9d e0 ldi r25, 0x0D ; 13 25038: 0f 94 1c dc call 0x3b838 ; 0x3b838 2503c: 2b e0 ldi r18, 0x0B ; 11 2503e: 82 9f mul r24, r18 25040: c0 01 movw r24, r0 25042: 11 24 eor r1, r1 25044: be 01 movw r22, r28 25046: 6f 5f subi r22, 0xFF ; 255 25048: 7f 4f sbci r23, 0xFF ; 255 2504a: 87 5b subi r24, 0xB7 ; 183 2504c: 92 4f sbci r25, 0xF2 ; 242 2504e: 0f 94 30 d0 call 0x3a060 ; 0x3a060 lcd_home(); 25052: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_print(buffer.c); 25056: ce 01 movw r24, r28 25058: 01 96 adiw r24, 0x01 ; 1 2505a: 0e 94 e7 70 call 0xe1ce ; 0xe1ce lcd_set_cursor(0, 1); 2505e: 61 e0 ldi r22, 0x01 ; 1 25060: 80 e0 ldi r24, 0x00 ; 0 25062: 0e 94 e0 6e call 0xddc0 ; 0xddc0 menu_draw_float13(_T(MSG_BABYSTEPPING_Z), _md->babystepMemMMZ); 25066: 10 91 ac 03 lds r17, 0x03AC ; 0x8003ac 2506a: 00 91 ad 03 lds r16, 0x03AD ; 0x8003ad 2506e: f0 90 ae 03 lds r15, 0x03AE ; 0x8003ae 25072: e0 90 af 03 lds r14, 0x03AF ; 0x8003af 25076: 85 e5 ldi r24, 0x55 ; 85 25078: 91 e5 ldi r25, 0x51 ; 81 2507a: 0e 94 ac 72 call 0xe558 ; 0xe558 //! (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); 2507e: ef 92 push r14 25080: ff 92 push r15 25082: 0f 93 push r16 25084: 1f 93 push r17 25086: 9f 93 push r25 25088: 8f 93 push r24 2508a: 1f 92 push r1 2508c: 80 e2 ldi r24, 0x20 ; 32 2508e: 8f 93 push r24 25090: 85 e4 ldi r24, 0x45 ; 69 25092: 93 ea ldi r25, 0xA3 ; 163 25094: 9f 93 push r25 25096: 8f 93 push r24 25098: 0e 94 b9 6e call 0xdd72 ; 0xdd72 2509c: 0f b6 in r0, 0x3f ; 63 2509e: f8 94 cli 250a0: de bf out 0x3e, r29 ; 62 250a2: 0f be out 0x3f, r0 ; 63 250a4: cd bf out 0x3d, r28 ; 61 } if (LCD_CLICKED || menu_leaving) 250a6: 80 91 a8 03 lds r24, 0x03A8 ; 0x8003a8 250aa: 81 11 cpse r24, r1 250ac: 04 c0 rjmp .+8 ; 0x250b6 250ae: 80 91 d7 03 lds r24, 0x03D7 ; 0x8003d7 250b2: 88 23 and r24, r24 250b4: 51 f1 breq .+84 ; 0x2510a { // Only update the EEPROM when leaving the menu. uint8_t active_sheet=eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 250b6: 81 ea ldi r24, 0xA1 ; 161 250b8: 9d e0 ldi r25, 0x0D ; 13 250ba: 0f 94 1c dc call 0x3b838 ; 0x3b838 250be: 9b e0 ldi r25, 0x0B ; 11 250c0: 89 9f mul r24, r25 250c2: 80 01 movw r16, r0 250c4: 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); 250c6: 60 91 aa 03 lds r22, 0x03AA ; 0x8003aa 250ca: 70 91 ab 03 lds r23, 0x03AB ; 0x8003ab 250ce: c8 01 movw r24, r16 250d0: 80 5b subi r24, 0xB0 ; 176 250d2: 92 4f sbci r25, 0xF2 ; 242 250d4: 0f 94 5e dc call 0x3b8bc ; 0x3b8bc if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 250d8: 60 91 72 06 lds r22, 0x0672 ; 0x800672 250dc: c8 01 movw r24, r16 250de: 8e 5a subi r24, 0xAE ; 174 250e0: 92 4f sbci r25, 0xF2 ; 242 250e2: 0f 94 40 dc call 0x3b880 ; 0x3b880 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); 250e6: 60 91 99 03 lds r22, 0x0399 ; 0x800399 250ea: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 250ee: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 250f2: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 250f6: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 250fa: c8 01 movw r24, r16 250fc: 8d 5a subi r24, 0xAD ; 173 250fe: 92 4f sbci r25, 0xF2 ; 242 25100: 0f 94 40 dc call 0x3b880 ; 0x3b880 #endif //PINDA_THERMISTOR calibration_status_set(CALIBRATION_STATUS_LIVE_ADJUST); 25104: 80 e1 ldi r24, 0x10 ; 16 25106: 0e 94 92 ee call 0x1dd24 ; 0x1dd24 } menu_back_if_clicked(); 2510a: 0f 94 00 d5 call 0x3aa00 ; 0x3aa00 } 2510e: 63 96 adiw r28, 0x13 ; 19 25110: 0f b6 in r0, 0x3f ; 63 25112: f8 94 cli 25114: de bf out 0x3e, r29 ; 62 25116: 0f be out 0x3f, r0 ; 63 25118: cd bf out 0x3d, r28 ; 61 2511a: df 91 pop r29 2511c: cf 91 pop r28 2511e: 1f 91 pop r17 25120: 0f 91 pop r16 25122: ff 90 pop r15 25124: ef 90 pop r14 25126: 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-> 25128: 2b e0 ldi r18, 0x0B ; 11 2512a: 12 9f mul r17, r18 2512c: c0 01 movw r24, r0 2512e: 11 24 eor r1, r1 25130: 80 5b subi r24, 0xB0 ; 176 25132: 92 4f sbci r25, 0xF2 ; 242 25134: 0f 94 2a dc call 0x3b854 ; 0x3b854 25138: 90 93 ab 03 sts 0x03AB, r25 ; 0x8003ab 2513c: 80 93 aa 03 sts 0x03AA, r24 ; 0x8003aa 25140: 09 cf rjmp .-494 ; 0x24f54 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 25142: 12 16 cp r1, r18 25144: 13 06 cpc r1, r19 25146: 2c f4 brge .+10 ; 0x25152 25148: 10 92 ab 03 sts 0x03AB, r1 ; 0x8003ab 2514c: 10 92 aa 03 sts 0x03AA, r1 ; 0x8003aa 25150: 44 cf rjmp .-376 ; 0x24fda extern volatile int babystepsTodo[3]; inline void babystepsTodoZadd(int n) { if (n != 0) { CRITICAL_SECTION_START 25152: 2f b7 in r18, 0x3f ; 63 25154: f8 94 cli babystepsTodo[Z_AXIS] += n; 25156: 40 91 6d 06 lds r20, 0x066D ; 0x80066d 2515a: 50 91 6e 06 lds r21, 0x066E ; 0x80066e 2515e: 84 0f add r24, r20 25160: 95 1f adc r25, r21 25162: 90 93 6e 06 sts 0x066E, r25 ; 0x80066e 25166: 80 93 6d 06 sts 0x066D, r24 ; 0x80066d CRITICAL_SECTION_END 2516a: 2f bf out 0x3f, r18 ; 63 2516c: 36 cf rjmp .-404 ; 0x24fda 0002516e : } void lcd_move_e() { if ((int)degHotend0() > extrude_min_temp) 2516e: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 25172: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 25176: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 2517a: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 2517e: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> 25182: 20 91 6b 02 lds r18, 0x026B ; 0x80026b 25186: 30 91 6c 02 lds r19, 0x026C ; 0x80026c 2518a: 26 17 cp r18, r22 2518c: 37 07 cpc r19, r23 2518e: 0c f0 brlt .+2 ; 0x25192 25190: 65 c0 rjmp .+202 ; 0x2525c { if (lcd_encoder != 0) 25192: 80 91 70 06 lds r24, 0x0670 ; 0x800670 25196: 90 91 71 06 lds r25, 0x0671 ; 0x800671 2519a: 89 2b or r24, r25 2519c: b9 f1 breq .+110 ; 0x2520c { refresh_cmd_timeout(); 2519e: 0e 94 c3 66 call 0xcd86 ; 0xcd86 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; 251a2: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 if (++ next_block_index == BLOCK_BUFFER_SIZE) 251a6: 8f 5f subi r24, 0xFF ; 255 251a8: 80 31 cpi r24, 0x10 ; 16 251aa: 09 f4 brne .+2 ; 0x251ae next_block_index = 0; 251ac: 80 e0 ldi r24, 0x00 ; 0 return block_buffer_tail == next_block_index; 251ae: 90 91 a6 0d lds r25, 0x0DA6 ; 0x800da6 if (! planner_queue_full()) 251b2: 98 17 cp r25, r24 251b4: 59 f1 breq .+86 ; 0x2520c { current_position[E_AXIS] += lcd_encoder; 251b6: 60 91 70 06 lds r22, 0x0670 ; 0x800670 251ba: 70 91 71 06 lds r23, 0x0671 ; 0x800671 251be: 07 2e mov r0, r23 251c0: 00 0c add r0, r0 251c2: 88 0b sbc r24, r24 251c4: 99 0b sbc r25, r25 251c6: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 251ca: 9b 01 movw r18, r22 251cc: ac 01 movw r20, r24 251ce: 60 91 9e 06 lds r22, 0x069E ; 0x80069e 251d2: 70 91 9f 06 lds r23, 0x069F ; 0x80069f 251d6: 80 91 a0 06 lds r24, 0x06A0 ; 0x8006a0 251da: 90 91 a1 06 lds r25, 0x06A1 ; 0x8006a1 251de: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 251e2: 60 93 9e 06 sts 0x069E, r22 ; 0x80069e 251e6: 70 93 9f 06 sts 0x069F, r23 ; 0x80069f 251ea: 80 93 a0 06 sts 0x06A0, r24 ; 0x8006a0 251ee: 90 93 a1 06 sts 0x06A1, r25 ; 0x8006a1 lcd_encoder = 0; 251f2: 10 92 71 06 sts 0x0671, r1 ; 0x800671 251f6: 10 92 70 06 sts 0x0670, r1 ; 0x800670 plan_buffer_line_curposXYZE(manual_feedrate[E_AXIS] / 60); 251fa: 65 e5 ldi r22, 0x55 ; 85 251fc: 75 e5 ldi r23, 0x55 ; 85 251fe: 85 ed ldi r24, 0xD5 ; 213 25200: 9f e3 ldi r25, 0x3F ; 63 25202: 0f 94 49 c0 call 0x38092 ; 0x38092 lcd_draw_update = 1; 25206: 81 e0 ldi r24, 0x01 ; 1 25208: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } } if (lcd_draw_update) 2520c: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 25210: 88 23 and r24, r24 25212: 11 f1 breq .+68 ; 0x25258 { lcd_set_cursor(0, 1); 25214: 61 e0 ldi r22, 0x01 ; 1 25216: 80 e0 ldi r24, 0x00 ; 0 25218: 0e 94 e0 6e call 0xddc0 ; 0xddc0 //! 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); 2521c: 80 91 a1 06 lds r24, 0x06A1 ; 0x8006a1 25220: 8f 93 push r24 25222: 80 91 a0 06 lds r24, 0x06A0 ; 0x8006a0 25226: 8f 93 push r24 25228: 80 91 9f 06 lds r24, 0x069F ; 0x80069f 2522c: 8f 93 push r24 2522e: 80 91 9e 06 lds r24, 0x069E ; 0x80069e 25232: 8f 93 push r24 25234: 87 e2 ldi r24, 0x27 ; 39 25236: 93 ea ldi r25, 0xA3 ; 163 25238: 9f 93 push r25 2523a: 8f 93 push r24 2523c: 88 e1 ldi r24, 0x18 ; 24 2523e: 93 ea ldi r25, 0xA3 ; 163 25240: 9f 93 push r25 25242: 8f 93 push r24 25244: 0e 94 b9 6e call 0xdd72 ; 0xdd72 25248: 8d b7 in r24, 0x3d ; 61 2524a: 9e b7 in r25, 0x3e ; 62 2524c: 08 96 adiw r24, 0x08 ; 8 2524e: 0f b6 in r0, 0x3f ; 63 25250: f8 94 cli 25252: 9e bf out 0x3e, r25 ; 62 25254: 0f be out 0x3f, r0 ; 63 25256: 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(); 25258: 0d 94 00 d5 jmp 0x3aa00 ; 0x3aa00 }; } void show_preheat_nozzle_warning() { lcd_clear(); 2525c: 0e 94 13 6f call 0xde26 ; 0xde26 lcd_puts_at_P(0, 0, _T(MSG_ERROR)); 25260: 86 ee ldi r24, 0xE6 ; 230 25262: 90 e5 ldi r25, 0x50 ; 80 25264: 0e 94 ac 72 call 0xe558 ; 0xe558 25268: ac 01 movw r20, r24 2526a: 60 e0 ldi r22, 0x00 ; 0 2526c: 80 e0 ldi r24, 0x00 ; 0 2526e: 0e 94 f4 6e call 0xdde8 ; 0xdde8 lcd_puts_at_P(0, 2, _T(MSG_PREHEAT_NOZZLE)); 25272: 80 ed ldi r24, 0xD0 ; 208 25274: 90 e5 ldi r25, 0x50 ; 80 25276: 0e 94 ac 72 call 0xe558 ; 0xe558 2527a: ac 01 movw r20, r24 2527c: 62 e0 ldi r22, 0x02 ; 2 2527e: 80 e0 ldi r24, 0x00 ; 0 25280: 0e 94 f4 6e call 0xdde8 ; 0xdde8 _delay(2000); 25284: 60 ed ldi r22, 0xD0 ; 208 25286: 77 e0 ldi r23, 0x07 ; 7 25288: 80 e0 ldi r24, 0x00 ; 0 2528a: 90 e0 ldi r25, 0x00 ; 0 2528c: 0f 94 53 27 call 0x24ea6 ; 0x24ea6 lcd_clear(); 25290: 0e 94 13 6f call 0xde26 ; 0xde26 menu_back_if_clicked(); } else { show_preheat_nozzle_warning(); lcd_return_to_status(); 25294: 0d 94 a6 1e jmp 0x23d4c ; 0x23d4c 00025298 : } unsigned long millis2(void) { unsigned long m; uint8_t oldSREG = SREG; 25298: 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(); 2529a: f8 94 cli m = timer2_millis; 2529c: 60 91 3b 06 lds r22, 0x063B ; 0x80063b 252a0: 70 91 3c 06 lds r23, 0x063C ; 0x80063c 252a4: 80 91 3d 06 lds r24, 0x063D ; 0x80063d 252a8: 90 91 3e 06 lds r25, 0x063E ; 0x80063e SREG = oldSREG; 252ac: 2f bf out 0x3f, r18 ; 63 return m; } 252ae: 08 95 ret 000252b0 : } //! @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); 252b0: 20 e0 ldi r18, 0x00 ; 0 252b2: 30 e0 ldi r19, 0x00 ; 0 252b4: 40 e8 ldi r20, 0x80 ; 128 252b6: 5f eb ldi r21, 0xBF ; 191 252b8: 60 e0 ldi r22, 0x00 ; 0 252ba: 70 e0 ldi r23, 0x00 ; 0 252bc: cb 01 movw r24, r22 252be: 0e 94 37 89 call 0x1126e ; 0x1126e SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_PAUSED); 252c2: 89 ef ldi r24, 0xF9 ; 249 252c4: 9e e6 ldi r25, 0x6E ; 110 252c6: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 // Indicate that the printer is paused did_pause_print = true; 252ca: 81 e0 ldi r24, 0x01 ; 1 252cc: 80 93 e4 03 sts 0x03E4, r24 ; 0x8003e4 } else return false; } bool Stopwatch::pause() { if (isRunning()) { 252d0: 80 91 9d 03 lds r24, 0x039D ; 0x80039d 252d4: 81 30 cpi r24, 0x01 ; 1 252d6: 69 f4 brne .+26 ; 0x252f2 state = PAUSED; 252d8: 82 e0 ldi r24, 0x02 ; 2 252da: 80 93 9d 03 sts 0x039D, r24 ; 0x80039d stopTimestamp = _millis(); 252de: 0f 94 4c 29 call 0x25298 ; 0x25298 252e2: 60 93 52 06 sts 0x0652, r22 ; 0x800652 252e6: 70 93 53 06 sts 0x0653, r23 ; 0x800653 252ea: 80 93 54 06 sts 0x0654, r24 ; 0x800654 252ee: 90 93 55 06 sts 0x0655, r25 ; 0x800655 print_job_timer.pause(); // return to status is required to continue processing in the main loop! lcd_commands_type = LcdCommands::LongPause; 252f2: 82 e0 ldi r24, 0x02 ; 2 252f4: 80 93 b4 0d sts 0x0DB4, r24 ; 0x800db4 lcd_return_to_status(); 252f8: 0d 94 a6 1e jmp 0x23d4c ; 0x23d4c 000252fc ::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) 252fc: ff 92 push r15 252fe: 0f 93 push r16 25300: 1f 93 push r17 25302: cf 93 push r28 25304: df 93 push r29 { if (!m_isRunning) return false; 25306: fc 01 movw r30, r24 25308: f0 80 ld r15, Z 2530a: f1 10 cpse r15, r1 2530c: 08 c0 rjmp .+16 ; 0x2531e ::expired(unsigned short)+0x22> 2530e: f1 2c mov r15, r1 expired = true; } } if (expired) m_isRunning = false; return expired; } 25310: 8f 2d mov r24, r15 25312: df 91 pop r29 25314: cf 91 pop r28 25316: 1f 91 pop r17 25318: 0f 91 pop r16 2531a: ff 90 pop r15 2531c: 08 95 ret 2531e: 8b 01 movw r16, r22 25320: ec 01 movw r28, r24 template bool Timer::expired(T msPeriod) { if (!m_isRunning) return false; bool expired = false; const T now = _millis(); 25322: 0f 94 4c 29 call 0x25298 ; 0x25298 if (m_started <= m_started + msPeriod) 25326: 89 81 ldd r24, Y+1 ; 0x01 25328: 9a 81 ldd r25, Y+2 ; 0x02 2532a: 08 0f add r16, r24 2532c: 19 1f adc r17, r25 2532e: 08 17 cp r16, r24 25330: 19 07 cpc r17, r25 25332: 40 f0 brcs .+16 ; 0x25344 ::expired(unsigned short)+0x48> { if ((now >= m_started + msPeriod) || (now < m_started)) 25334: 60 17 cp r22, r16 25336: 71 07 cpc r23, r17 25338: 18 f4 brcc .+6 ; 0x25340 ::expired(unsigned short)+0x44> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 2533a: 68 17 cp r22, r24 2533c: 79 07 cpc r23, r25 2533e: 38 f7 brcc .-50 ; 0x2530e ::expired(unsigned short)+0x12> { expired = true; } } if (expired) m_isRunning = false; 25340: 18 82 st Y, r1 25342: e6 cf rjmp .-52 ; 0x25310 ::expired(unsigned short)+0x14> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 25344: 60 17 cp r22, r16 25346: 71 07 cpc r23, r17 25348: c0 f7 brcc .-16 ; 0x2533a ::expired(unsigned short)+0x3e> 2534a: e1 cf rjmp .-62 ; 0x2530e ::expired(unsigned short)+0x12> 0002534c ::expired_cont(unsigned short)>: } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 2534c: fc 01 movw r30, r24 2534e: 20 81 ld r18, Z 25350: 21 11 cpse r18, r1 25352: 0d 94 7e 29 jmp 0x252fc ; 0x252fc ::expired(unsigned short)> } 25356: 81 e0 ldi r24, 0x01 ; 1 25358: 08 95 ret 0002535a ::start()>: /** * @brief Start timer */ template void Timer::start() 2535a: cf 93 push r28 2535c: df 93 push r29 2535e: ec 01 movw r28, r24 { m_started = _millis(); 25360: 0f 94 4c 29 call 0x25298 ; 0x25298 25364: 7a 83 std Y+2, r23 ; 0x02 25366: 69 83 std Y+1, r22 ; 0x01 m_isRunning = true; 25368: 81 e0 ldi r24, 0x01 ; 1 2536a: 88 83 st Y, r24 } 2536c: df 91 pop r29 2536e: cf 91 pop r28 25370: 08 95 ret 00025372 : TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTO); } static uint8_t twi_wait(uint8_t status) { 25372: 1f 93 push r17 25374: cf 93 push r28 25376: df 93 push r29 25378: 00 d0 rcall .+0 ; 0x2537a 2537a: cd b7 in r28, 0x3d ; 61 2537c: de b7 in r29, 0x3e ; 62 2537e: 18 2f mov r17, r24 ShortTimer timmy; 25380: 19 82 std Y+1, r1 ; 0x01 25382: 1b 82 std Y+3, r1 ; 0x03 25384: 1a 82 std Y+2, r1 ; 0x02 timmy.start(); 25386: ce 01 movw r24, r28 25388: 01 96 adiw r24, 0x01 ; 1 2538a: 0f 94 ad 29 call 0x2535a ; 0x2535a ::start()> while(!(TWCR & _BV(TWINT))) { 2538e: 80 91 bc 00 lds r24, 0x00BC ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> 25392: 87 fd sbrc r24, 7 25394: 0a c0 rjmp .+20 ; 0x253aa if (timmy.expired(TWI_TIMEOUT_MS)) { 25396: 6a e0 ldi r22, 0x0A ; 10 25398: 70 e0 ldi r23, 0x00 ; 0 2539a: ce 01 movw r24, r28 2539c: 01 96 adiw r24, 0x01 ; 1 2539e: 0f 94 7e 29 call 0x252fc ; 0x252fc ::expired(unsigned short)> 253a2: 88 23 and r24, r24 253a4: a1 f3 breq .-24 ; 0x2538e return 2; 253a6: 82 e0 ldi r24, 0x02 ; 2 253a8: 09 c0 rjmp .+18 ; 0x253bc } } if(TW_STATUS != status) 253aa: 80 91 b9 00 lds r24, 0x00B9 ; 0x8000b9 <__TEXT_REGION_LENGTH__+0x7c20b9> 253ae: 88 7f andi r24, 0xF8 ; 248 253b0: 18 17 cp r17, r24 253b2: 59 f0 breq .+22 ; 0x253ca } static void twi_stop() { TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTO); 253b4: 84 e9 ldi r24, 0x94 ; 148 253b6: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> } } if(TW_STATUS != status) { twi_stop(); return 1; 253ba: 81 e0 ldi r24, 0x01 ; 1 } return 0; } 253bc: 0f 90 pop r0 253be: 0f 90 pop r0 253c0: 0f 90 pop r0 253c2: df 91 pop r29 253c4: cf 91 pop r28 253c6: 1f 91 pop r17 253c8: 08 95 ret if(TW_STATUS != status) { twi_stop(); return 1; } return 0; 253ca: 80 e0 ldi r24, 0x00 ; 0 253cc: f7 cf rjmp .-18 ; 0x253bc 000253ce : } return standstill; } void tmc2130_check_overtemp() { 253ce: 1f 93 push r17 253d0: cf 93 push r28 253d2: df 93 push r29 253d4: 00 d0 rcall .+0 ; 0x253d6 253d6: 1f 92 push r1 253d8: cd b7 in r28, 0x3d ; 61 253da: de b7 in r29, 0x3e ; 62 if (tmc2130_overtemp_timer.expired_cont(1000)) 253dc: 68 ee ldi r22, 0xE8 ; 232 253de: 73 e0 ldi r23, 0x03 ; 3 253e0: 84 e4 ldi r24, 0x44 ; 68 253e2: 96 e0 ldi r25, 0x06 ; 6 253e4: 0f 94 a6 29 call 0x2534c ; 0x2534c ::expired_cont(unsigned short)> 253e8: 88 23 and r24, r24 253ea: 91 f1 breq .+100 ; 0x25450 { for (uint_least8_t i = 0; i < 4; i++) 253ec: 10 e0 ldi r17, 0x00 ; 0 { uint32_t drv_status = 0; 253ee: 19 82 std Y+1, r1 ; 0x01 253f0: 1a 82 std Y+2, r1 ; 0x02 253f2: 1b 82 std Y+3, r1 ; 0x03 253f4: 1c 82 std Y+4, r1 ; 0x04 tmc2130_rd(i, TMC2130_REG_DRV_STATUS, &drv_status); 253f6: ae 01 movw r20, r28 253f8: 4f 5f subi r20, 0xFF ; 255 253fa: 5f 4f sbci r21, 0xFF ; 255 253fc: 6f e6 ldi r22, 0x6F ; 111 253fe: 81 2f mov r24, r17 25400: 0f 94 f1 23 call 0x247e2 ; 0x247e2 if (drv_status & ((uint32_t)1 << 26)) 25404: 89 81 ldd r24, Y+1 ; 0x01 25406: 9a 81 ldd r25, Y+2 ; 0x02 25408: ab 81 ldd r26, Y+3 ; 0x03 2540a: bc 81 ldd r27, Y+4 ; 0x04 2540c: b2 ff sbrs r27, 2 2540e: 19 c0 rjmp .+50 ; 0x25442 { // BIT 26 - over temp prewarning ~120C (+-20C) SERIAL_ERRORRPGM(MSG_TMC_OVERTEMP); 25410: 8a e6 ldi r24, 0x6A ; 106 25412: 9e e6 ldi r25, 0x6E ; 110 25414: 0e 94 50 77 call 0xeea0 ; 0xeea0 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 25418: 81 2f mov r24, r17 2541a: 0e 94 37 77 call 0xee6e ; 0xee6e } void MarlinSerial::println(unsigned char b, int base) { print(b, base); println(); 2541e: 0f 94 fd d5 call 0x3abfa ; 0x3abfa SERIAL_ECHOLN(i); for (uint_least8_t j = 0; j < 4; j++) 25422: 10 e0 ldi r17, 0x00 ; 0 tmc2130_wr(j, TMC2130_REG_CHOPCONF, 0x00010000); 25424: 20 e0 ldi r18, 0x00 ; 0 25426: 30 e0 ldi r19, 0x00 ; 0 25428: 41 e0 ldi r20, 0x01 ; 1 2542a: 50 e0 ldi r21, 0x00 ; 0 2542c: 6c ee ldi r22, 0xEC ; 236 2542e: 81 2f mov r24, r17 25430: 0f 94 4b 24 call 0x24896 ; 0x24896 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++) 25434: 1f 5f subi r17, 0xFF ; 255 25436: 14 30 cpi r17, 0x04 ; 4 25438: a9 f7 brne .-22 ; 0x25424 tmc2130_wr(j, TMC2130_REG_CHOPCONF, 0x00010000); kill(MSG_TMC_OVERTEMP); 2543a: 8a e6 ldi r24, 0x6A ; 106 2543c: 9e e6 ldi r25, 0x6E ; 110 2543e: 0e 94 0a 7a call 0xf414 ; 0xf414 void tmc2130_check_overtemp() { if (tmc2130_overtemp_timer.expired_cont(1000)) { for (uint_least8_t i = 0; i < 4; i++) 25442: 1f 5f subi r17, 0xFF ; 255 25444: 14 30 cpi r17, 0x04 ; 4 25446: 99 f6 brne .-90 ; 0x253ee tmc2130_wr(j, TMC2130_REG_CHOPCONF, 0x00010000); kill(MSG_TMC_OVERTEMP); } } tmc2130_overtemp_timer.start(); 25448: 84 e4 ldi r24, 0x44 ; 68 2544a: 96 e0 ldi r25, 0x06 ; 6 2544c: 0f 94 ad 29 call 0x2535a ; 0x2535a ::start()> } } 25450: 0f 90 pop r0 25452: 0f 90 pop r0 25454: 0f 90 pop r0 25456: 0f 90 pop r0 25458: df 91 pop r29 2545a: cf 91 pop r28 2545c: 1f 91 pop r17 2545e: 08 95 ret 00025460 ::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) 25460: 8f 92 push r8 25462: 9f 92 push r9 25464: af 92 push r10 25466: bf 92 push r11 25468: cf 92 push r12 2546a: df 92 push r13 2546c: ef 92 push r14 2546e: ff 92 push r15 25470: 1f 93 push r17 25472: cf 93 push r28 25474: df 93 push r29 { if (!m_isRunning) return false; 25476: fc 01 movw r30, r24 25478: 10 81 ld r17, Z 2547a: 11 11 cpse r17, r1 2547c: 0e c0 rjmp .+28 ; 0x2549a ::expired(unsigned long)+0x3a> 2547e: 10 e0 ldi r17, 0x00 ; 0 expired = true; } } if (expired) m_isRunning = false; return expired; } 25480: 81 2f mov r24, r17 25482: df 91 pop r29 25484: cf 91 pop r28 25486: 1f 91 pop r17 25488: ff 90 pop r15 2548a: ef 90 pop r14 2548c: df 90 pop r13 2548e: cf 90 pop r12 25490: bf 90 pop r11 25492: af 90 pop r10 25494: 9f 90 pop r9 25496: 8f 90 pop r8 25498: 08 95 ret 2549a: 6a 01 movw r12, r20 2549c: 7b 01 movw r14, r22 2549e: ec 01 movw r28, r24 template bool Timer::expired(T msPeriod) { if (!m_isRunning) return false; bool expired = false; const T now = _millis(); 254a0: 0f 94 4c 29 call 0x25298 ; 0x25298 254a4: 4b 01 movw r8, r22 254a6: 5c 01 movw r10, r24 if (m_started <= m_started + msPeriod) 254a8: 89 81 ldd r24, Y+1 ; 0x01 254aa: 9a 81 ldd r25, Y+2 ; 0x02 254ac: ab 81 ldd r26, Y+3 ; 0x03 254ae: bc 81 ldd r27, Y+4 ; 0x04 254b0: c8 0e add r12, r24 254b2: d9 1e adc r13, r25 254b4: ea 1e adc r14, r26 254b6: fb 1e adc r15, r27 254b8: c8 16 cp r12, r24 254ba: d9 06 cpc r13, r25 254bc: ea 06 cpc r14, r26 254be: fb 06 cpc r15, r27 254c0: 60 f0 brcs .+24 ; 0x254da ::expired(unsigned long)+0x7a> { if ((now >= m_started + msPeriod) || (now < m_started)) 254c2: 8c 14 cp r8, r12 254c4: 9d 04 cpc r9, r13 254c6: ae 04 cpc r10, r14 254c8: bf 04 cpc r11, r15 254ca: 28 f4 brcc .+10 ; 0x254d6 ::expired(unsigned long)+0x76> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 254cc: 88 16 cp r8, r24 254ce: 99 06 cpc r9, r25 254d0: aa 06 cpc r10, r26 254d2: bb 06 cpc r11, r27 254d4: a0 f6 brcc .-88 ; 0x2547e ::expired(unsigned long)+0x1e> { expired = true; } } if (expired) m_isRunning = false; 254d6: 18 82 st Y, r1 254d8: d3 cf rjmp .-90 ; 0x25480 ::expired(unsigned long)+0x20> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 254da: 8c 14 cp r8, r12 254dc: 9d 04 cpc r9, r13 254de: ae 04 cpc r10, r14 254e0: bf 04 cpc r11, r15 254e2: a0 f7 brcc .-24 ; 0x254cc ::expired(unsigned long)+0x6c> 254e4: cc cf rjmp .-104 ; 0x2547e ::expired(unsigned long)+0x1e> 000254e6 : } lcd_space(8 - chars); } //! @Brief Print status line on status screen void lcdui_print_status_line(void) { 254e6: 0f 93 push r16 254e8: 1f 93 push r17 254ea: cf 93 push r28 static uint8_t heating_status_counter; if (heating_status != HeatingStatus::NO_HEATING) { // If heating flag, show progress of heating 254ec: 80 91 e3 03 lds r24, 0x03E3 ; 0x8003e3 254f0: 88 23 and r24, r24 254f2: 09 f4 brne .+2 ; 0x254f6 254f4: 4d c0 rjmp .+154 ; 0x25590 heating_status_counter++; 254f6: 80 91 4b 06 lds r24, 0x064B ; 0x80064b 254fa: 8f 5f subi r24, 0xFF ; 255 if (heating_status_counter > 13) { 254fc: 8e 30 cpi r24, 0x0E ; 14 254fe: b0 f4 brcc .+44 ; 0x2552c //! @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++; 25500: 80 93 4b 06 sts 0x064B, r24 ; 0x80064b if (heating_status_counter > 13) { heating_status_counter = 0; } lcd_set_cursor(7, 3); 25504: 63 e0 ldi r22, 0x03 ; 3 25506: 87 e0 ldi r24, 0x07 ; 7 25508: 0e 94 e0 6e call 0xddc0 ; 0xddc0 lcd_space(13); 2550c: 8d e0 ldi r24, 0x0D ; 13 2550e: 0e 94 d6 6e call 0xddac ; 0xddac for (uint8_t dots = 0; dots < heating_status_counter; dots++) { 25512: c0 e0 ldi r28, 0x00 ; 0 25514: 80 91 4b 06 lds r24, 0x064B ; 0x80064b 25518: c8 17 cp r28, r24 2551a: 58 f4 brcc .+22 ; 0x25532 lcd_putc_at(7 + dots, 3, '.'); 2551c: 4e e2 ldi r20, 0x2E ; 46 2551e: 63 e0 ldi r22, 0x03 ; 3 25520: 87 e0 ldi r24, 0x07 ; 7 25522: 8c 0f add r24, r28 25524: 0e 94 00 6f call 0xde00 ; 0xde00 heating_status_counter = 0; } lcd_set_cursor(7, 3); lcd_space(13); for (uint8_t dots = 0; dots < heating_status_counter; dots++) { 25528: cf 5f subi r28, 0xFF ; 255 2552a: f4 cf rjmp .-24 ; 0x25514 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; 2552c: 10 92 4b 06 sts 0x064B, r1 ; 0x80064b 25530: e9 cf rjmp .-46 ; 0x25504 lcd_space(13); for (uint8_t dots = 0; dots < heating_status_counter; dots++) { lcd_putc_at(7 + dots, 3, '.'); } switch (heating_status) { 25532: 80 91 e3 03 lds r24, 0x03E3 ; 0x8003e3 25536: 82 30 cpi r24, 0x02 ; 2 25538: d1 f0 breq .+52 ; 0x2556e 2553a: 30 f4 brcc .+12 ; 0x25548 2553c: 81 30 cpi r24, 0x01 ; 1 2553e: 59 f0 breq .+22 ; 0x25556 case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 25540: cf 91 pop r28 25542: 1f 91 pop r17 25544: 0f 91 pop r16 25546: 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) { 25548: 83 30 cpi r24, 0x03 ; 3 2554a: f9 f0 breq .+62 ; 0x2558a 2554c: 84 30 cpi r24, 0x04 ; 4 2554e: c1 f7 brne .-16 ; 0x25540 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)); 25550: 84 e0 ldi r24, 0x04 ; 4 25552: 9e e4 ldi r25, 0x4E ; 78 25554: 0e c0 rjmp .+28 ; 0x25572 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)); 25556: 8d e2 ldi r24, 0x2D ; 45 25558: 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)); 2555a: 0e 94 ac 72 call 0xe558 ; 0xe558 2555e: ac 01 movw r20, r24 25560: 63 e0 ldi r22, 0x03 ; 3 25562: 80 e0 ldi r24, 0x00 ; 0 break; } } } 25564: cf 91 pop r28 25566: 1f 91 pop r17 25568: 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)); 2556a: 0c 94 f4 6e jmp 0xdde8 ; 0xdde8 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)); 2556e: 8d e1 ldi r24, 0x1D ; 29 25570: 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)); 25572: 0e 94 ac 72 call 0xe558 ; 0xe558 25576: ac 01 movw r20, r24 25578: 63 e0 ldi r22, 0x03 ; 3 2557a: 80 e0 ldi r24, 0x00 ; 0 2557c: 0e 94 f4 6e call 0xdde8 ; 0xdde8 heating_status = HeatingStatus::NO_HEATING; 25580: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 heating_status_counter = 0; 25584: 10 92 4b 06 sts 0x064B, r1 ; 0x80064b 25588: db cf rjmp .-74 ; 0x25540 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)); 2558a: 8f e0 ldi r24, 0x0F ; 15 2558c: 9e e4 ldi r25, 0x4E ; 78 2558e: e5 cf rjmp .-54 ; 0x2555a break; } } else if ((IS_SD_PRINTING) && (custom_message_type == CustomMsg::Status) && (lcd_status_message_level <= LCD_STATUS_INFO) && 25590: 80 91 90 14 lds r24, 0x1490 ; 0x801490 25594: 88 23 and r24, r24 25596: 61 f1 breq .+88 ; 0x255f0 break; default: break; } } else if ((IS_SD_PRINTING) && 25598: 80 91 c4 06 lds r24, 0x06C4 ; 0x8006c4 2559c: 81 11 cpse r24, r1 2559e: 28 c0 rjmp .+80 ; 0x255f0 (custom_message_type == CustomMsg::Status) && 255a0: 80 91 d5 03 lds r24, 0x03D5 ; 0x8003d5 <_ZL24lcd_status_message_level.lto_priv.451> 255a4: 82 30 cpi r24, 0x02 ; 2 255a6: 20 f5 brcc .+72 ; 0x255f0 } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 255a8: 80 91 34 05 lds r24, 0x0534 ; 0x800534 <_ZL26lcd_status_message_timeout.lto_priv.452> 255ac: 81 11 cpse r24, r1 255ae: 16 c0 rjmp .+44 ; 0x255dc (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); 255b0: 80 91 a7 14 lds r24, 0x14A7 ; 0x8014a7 255b4: 88 23 and r24, r24 255b6: 09 f4 brne .+2 ; 0x255ba 255b8: 35 c0 rjmp .+106 ; 0x25624 255ba: 87 ea ldi r24, 0xA7 ; 167 255bc: 94 e1 ldi r25, 0x14 ; 20 if( lcd_print_pad(&longFilenameOLD[scrollstuff], LCD_WIDTH) == 0) 255be: 20 91 b9 0d lds r18, 0x0DB9 ; 0x800db9 255c2: 64 e1 ldi r22, 0x14 ; 20 255c4: 82 0f add r24, r18 255c6: 91 1d adc r25, r1 255c8: 0e 94 cf 70 call 0xe19e ; 0xe19e 255cc: 81 11 cpse r24, r1 255ce: 2d c0 rjmp .+90 ; 0x2562a { scrollstuff++; 255d0: 80 91 b9 0d lds r24, 0x0DB9 ; 0x800db9 255d4: 8f 5f subi r24, 0xFF ; 255 255d6: 80 93 b9 0d sts 0x0DB9, r24 ; 0x800db9 255da: b2 cf rjmp .-156 ; 0x25540 255dc: 40 e2 ldi r20, 0x20 ; 32 255de: 5e e4 ldi r21, 0x4E ; 78 255e0: 60 e0 ldi r22, 0x00 ; 0 255e2: 70 e0 ldi r23, 0x00 ; 0 255e4: 84 e3 ldi r24, 0x34 ; 52 255e6: 95 e0 ldi r25, 0x05 ; 5 255e8: 0f 94 30 2a call 0x25460 ; 0x25460 ::expired(unsigned long)> 255ec: 81 11 cpse r24, r1 255ee: e0 cf rjmp .-64 ; 0x255b0 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) 255f0: 80 91 c4 06 lds r24, 0x06C4 ; 0x8006c4 255f4: 81 11 cpse r24, r1 255f6: 1c c0 rjmp .+56 ; 0x25630 { return; // Nothing to do, waiting for delay to expire } switch (custom_message_type) { 255f8: e0 91 c4 06 lds r30, 0x06C4 ; 0x8006c4 255fc: ea 30 cpi r30, 0x0A ; 10 255fe: 08 f0 brcs .+2 ; 0x25602 25600: 9f cf rjmp .-194 ; 0x25540 25602: f0 e0 ldi r31, 0x00 ; 0 25604: 88 27 eor r24, r24 25606: e8 5f subi r30, 0xF8 ; 248 25608: f4 4d sbci r31, 0xD4 ; 212 2560a: 8e 4f sbci r24, 0xFE ; 254 2560c: 0d 94 2c dd jmp 0x3ba58 ; 0x3ba58 <__tablejump2__> 25610: be 39 cpi r27, 0x9E ; 158 25612: b6 3a cpi r27, 0xA6 ; 166 25614: be 39 cpi r27, 0x9E ; 158 25616: fc 39 cpi r31, 0x9C ; 156 25618: 56 3a cpi r21, 0xA6 ; 166 2561a: c0 3a cpi r28, 0xA0 ; 160 2561c: be 39 cpi r27, 0x9E ; 158 2561e: be 39 cpi r27, 0x9E ; 158 25620: 72 3a cpi r23, 0xA2 ; 162 25622: be 39 cpi r27, 0x9E ; 158 (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); 25624: 82 e9 ldi r24, 0x92 ; 146 25626: 94 e1 ldi r25, 0x14 ; 20 25628: ca cf rjmp .-108 ; 0x255be if( lcd_print_pad(&longFilenameOLD[scrollstuff], LCD_WIDTH) == 0) { scrollstuff++; } else { scrollstuff = 0; 2562a: 10 92 b9 0d sts 0x0DB9, r1 ; 0x800db9 2562e: 88 cf rjmp .-240 ; 0x25540 } } else { // Otherwise check for other special events if ( custom_message_type != CustomMsg::Status && lcd_status_message_timeout.running() 25630: 80 91 34 05 lds r24, 0x0534 ; 0x800534 <_ZL26lcd_status_message_timeout.lto_priv.452> 25634: 88 23 and r24, r24 25636: 01 f3 breq .-64 ; 0x255f8 * 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; 25638: 0f 94 4c 29 call 0x25298 ; 0x25298 2563c: 00 91 35 05 lds r16, 0x0535 ; 0x800535 <_ZL26lcd_status_message_timeout.lto_priv.452+0x1> 25640: 10 91 36 05 lds r17, 0x0536 ; 0x800536 <_ZL26lcd_status_message_timeout.lto_priv.452+0x2> 25644: 20 91 37 05 lds r18, 0x0537 ; 0x800537 <_ZL26lcd_status_message_timeout.lto_priv.452+0x3> 25648: 30 91 38 05 lds r19, 0x0538 ; 0x800538 <_ZL26lcd_status_message_timeout.lto_priv.452+0x4> 2564c: 60 1b sub r22, r16 2564e: 71 0b sbc r23, r17 25650: 82 0b sbc r24, r18 25652: 93 0b sbc r25, r19 && lcd_status_message_timeout.elapsed() < LCD_STATUS_DELAYED_TIMEOUT) 25654: 60 3a cpi r22, 0xA0 ; 160 25656: 7f 40 sbci r23, 0x0F ; 15 25658: 81 05 cpc r24, r1 2565a: 91 05 cpc r25, r1 2565c: 68 f6 brcc .-102 ; 0x255f8 2565e: 70 cf rjmp .-288 ; 0x25540 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); 25660: 63 e0 ldi r22, 0x03 ; 3 25662: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL22lcd_status_message_idx.lto_priv.448> 25666: 0e 94 e0 6e call 0xddc0 ; 0xddc0 const uint8_t padding = lcd_print_pad(&lcd_status_message[lcd_status_message_idx], LCD_WIDTH - lcd_status_message_idx); 2566a: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL22lcd_status_message_idx.lto_priv.448> 2566e: c4 e1 ldi r28, 0x14 ; 20 25670: 6c 2f mov r22, r28 25672: 68 1b sub r22, r24 25674: 90 e0 ldi r25, 0x00 ; 0 25676: 81 5e subi r24, 0xE1 ; 225 25678: 9a 4f sbci r25, 0xFA ; 250 2567a: 0e 94 cf 70 call 0xe19e ; 0xe19e lcd_status_message_idx = LCD_WIDTH - padding; 2567e: c8 1b sub r28, r24 25680: c0 93 1e 05 sts 0x051E, r28 ; 0x80051e <_ZL22lcd_status_message_idx.lto_priv.448> 25684: 5d cf rjmp .-326 ; 0x25540 } break; case CustomMsg::MeshBedLeveling: // If mesh bed leveling in progress, show the status if (custom_message_state > 10) { 25686: 80 91 f7 03 lds r24, 0x03F7 ; 0x8003f7 2568a: 8b 30 cpi r24, 0x0B ; 11 2568c: 08 f1 brcs .+66 ; 0x256d0 lcd_set_cursor(0, 3); 2568e: 63 e0 ldi r22, 0x03 ; 3 25690: 80 e0 ldi r24, 0x00 ; 0 25692: 0e 94 e0 6e call 0xddc0 ; 0xddc0 lcd_space(LCD_WIDTH); 25696: 84 e1 ldi r24, 0x14 ; 20 25698: 0e 94 d6 6e call 0xddac ; 0xddac lcd_puts_at_P(0, 3, _T(MSG_CALIBRATE_Z_AUTO)); 2569c: 84 ef ldi r24, 0xF4 ; 244 2569e: 9d e4 ldi r25, 0x4D ; 77 256a0: 0e 94 ac 72 call 0xe558 ; 0xe558 256a4: ac 01 movw r20, r24 256a6: 63 e0 ldi r22, 0x03 ; 3 256a8: 80 e0 ldi r24, 0x00 ; 0 256aa: 0e 94 f4 6e call 0xdde8 ; 0xdde8 lcd_puts_P(PSTR(" : ")); 256ae: 89 e7 ldi r24, 0x79 ; 121 256b0: 90 ea ldi r25, 0xA0 ; 160 256b2: 0e 94 cb 6e call 0xdd96 ; 0xdd96 lcd_print(custom_message_state - 10); 256b6: 60 91 f7 03 lds r22, 0x03F7 ; 0x8003f7 256ba: 6a 50 subi r22, 0x0A ; 10 256bc: 77 0b sbc r23, r23 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); 256be: 07 2e mov r0, r23 256c0: 00 0c add r0, r0 256c2: 88 0b sbc r24, r24 256c4: 99 0b sbc r25, r25 case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 256c6: cf 91 pop r28 256c8: 1f 91 pop r17 256ca: 0f 91 pop r16 256cc: 0c 94 99 70 jmp 0xe132 ; 0xe132 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) { 256d0: 83 30 cpi r24, 0x03 ; 3 256d2: 31 f4 brne .+12 ; 0x256e0 lcd_setstatuspgm(MSG_WELCOME); 256d4: 83 e7 ldi r24, 0x73 ; 115 256d6: 90 e7 ldi r25, 0x70 ; 112 256d8: 0e 94 5d f1 call 0x1e2ba ; 0x1e2ba custom_message_type = CustomMsg::Status; 256dc: 10 92 c4 06 sts 0x06C4, r1 ; 0x8006c4 } if (custom_message_state > 3 && custom_message_state <= 10) { 256e0: 80 91 f7 03 lds r24, 0x03F7 ; 0x8003f7 256e4: 84 50 subi r24, 0x04 ; 4 256e6: 87 30 cpi r24, 0x07 ; 7 256e8: 08 f0 brcs .+2 ; 0x256ec 256ea: 2a cf rjmp .-428 ; 0x25540 lcd_set_cursor(0, 3); 256ec: 63 e0 ldi r22, 0x03 ; 3 256ee: 80 e0 ldi r24, 0x00 ; 0 256f0: 0e 94 e0 6e call 0xddc0 ; 0xddc0 lcd_space(19); 256f4: 83 e1 ldi r24, 0x13 ; 19 256f6: 0e 94 d6 6e call 0xddac ; 0xddac lcd_puts_at_P(0, 3, _T(MSG_HOMEYZ_DONE)); 256fa: 81 ee ldi r24, 0xE1 ; 225 256fc: 9d e4 ldi r25, 0x4D ; 77 256fe: 0e 94 ac 72 call 0xe558 ; 0xe558 25702: ac 01 movw r20, r24 25704: 63 e0 ldi r22, 0x03 ; 3 25706: 80 e0 ldi r24, 0x00 ; 0 25708: 0e 94 f4 6e call 0xdde8 ; 0xdde8 custom_message_state--; 2570c: 80 91 f7 03 lds r24, 0x03F7 ; 0x8003f7 25710: 81 50 subi r24, 0x01 ; 1 25712: 80 93 f7 03 sts 0x03F7, r24 ; 0x8003f7 25716: 14 cf rjmp .-472 ; 0x25540 } } break; case CustomMsg::PidCal: // PID tuning in progress lcd_print_pad(lcd_status_message, LCD_WIDTH); 25718: 64 e1 ldi r22, 0x14 ; 20 2571a: 8f e1 ldi r24, 0x1F ; 31 2571c: 95 e0 ldi r25, 0x05 ; 5 2571e: 0e 94 cf 70 call 0xe19e ; 0xe19e if (pid_cycle <= pid_number_of_cycles && custom_message_state > 0) { 25722: 20 91 49 06 lds r18, 0x0649 ; 0x800649 25726: 30 91 4a 06 lds r19, 0x064A ; 0x80064a 2572a: 80 91 47 06 lds r24, 0x0647 ; 0x800647 2572e: 90 91 48 06 lds r25, 0x0648 ; 0x800648 25732: 82 17 cp r24, r18 25734: 93 07 cpc r25, r19 25736: 0c f4 brge .+2 ; 0x2573a 25738: 03 cf rjmp .-506 ; 0x25540 2573a: 80 91 f7 03 lds r24, 0x03F7 ; 0x8003f7 2573e: 88 23 and r24, r24 25740: 09 f4 brne .+2 ; 0x25744 25742: fe ce rjmp .-516 ; 0x25540 lcd_set_cursor(10, 3); 25744: 63 e0 ldi r22, 0x03 ; 3 25746: 8a e0 ldi r24, 0x0A ; 10 25748: 0e 94 e0 6e call 0xddc0 ; 0xddc0 lcd_printf_P(PSTR("%3d/%-3d"), pid_cycle, pid_number_of_cycles); 2574c: 80 91 48 06 lds r24, 0x0648 ; 0x800648 25750: 8f 93 push r24 25752: 80 91 47 06 lds r24, 0x0647 ; 0x800647 25756: 8f 93 push r24 25758: 80 91 4a 06 lds r24, 0x064A ; 0x80064a 2575c: 8f 93 push r24 2575e: 80 91 49 06 lds r24, 0x0649 ; 0x800649 25762: 8f 93 push r24 25764: 80 e7 ldi r24, 0x70 ; 112 25766: 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); 25768: 9f 93 push r25 2576a: 8f 93 push r24 2576c: 0e 94 b9 6e call 0xdd72 ; 0xdd72 25770: 0f 90 pop r0 25772: 0f 90 pop r0 25774: 0f 90 pop r0 25776: 0f 90 pop r0 25778: 0f 90 pop r0 2577a: 0f 90 pop r0 2577c: e1 ce rjmp .-574 ; 0x25540 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); 2577e: 63 e0 ldi r22, 0x03 ; 3 25780: 80 e0 ldi r24, 0x00 ; 0 25782: 0e 94 e0 6e call 0xddc0 ; 0xddc0 lcd_printf_P(PSTR("%-12.12S%-d/6"), _T(MSG_PINDA_CALIBRATION), custom_message_state); 25786: c0 91 f7 03 lds r28, 0x03F7 ; 0x8003f7 2578a: 81 e1 ldi r24, 0x11 ; 17 2578c: 95 e4 ldi r25, 0x45 ; 69 2578e: 0e 94 ac 72 call 0xe558 ; 0xe558 25792: 1f 92 push r1 25794: cf 93 push r28 25796: 9f 93 push r25 25798: 8f 93 push r24 2579a: 82 e6 ldi r24, 0x62 ; 98 2579c: 90 ea ldi r25, 0xA0 ; 160 2579e: e4 cf rjmp .-56 ; 0x25768 break; case CustomMsg::TempCompPreheat: // temp compensation preheat lcd_puts_at_P(0, 3, _T(MSG_PINDA_PREHEAT)); 257a0: 81 ed ldi r24, 0xD1 ; 209 257a2: 9d e4 ldi r25, 0x4D ; 77 257a4: 0e 94 ac 72 call 0xe558 ; 0xe558 257a8: ac 01 movw r20, r24 257aa: 63 e0 ldi r22, 0x03 ; 3 257ac: 80 e0 ldi r24, 0x00 ; 0 257ae: 0e 94 f4 6e call 0xdde8 ; 0xdde8 if (custom_message_state <= PINDA_HEAT_T) { 257b2: 80 91 f7 03 lds r24, 0x03F7 ; 0x8003f7 257b6: 89 37 cpi r24, 0x79 ; 121 257b8: 08 f0 brcs .+2 ; 0x257bc 257ba: c2 ce rjmp .-636 ; 0x25540 lcd_puts_P(PSTR(": ")); 257bc: 8f e5 ldi r24, 0x5F ; 95 257be: 90 ea ldi r25, 0xA0 ; 160 257c0: 0e 94 cb 6e call 0xdd96 ; 0xdd96 } void lcd_print(unsigned long n, int base) { if (base == 0) lcd_write(n); 257c4: 80 91 f7 03 lds r24, 0x03F7 ; 0x8003f7 257c8: 0e 94 8f 6f call 0xdf1e ; 0xdf1e } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 257cc: 80 e2 ldi r24, 0x20 ; 32 case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 257ce: cf 91 pop r28 257d0: 1f 91 pop r17 257d2: 0f 91 pop r16 257d4: 0c 94 8f 6f jmp 0xdf1e ; 0xdf1e lcd_print(custom_message_state); // seconds lcd_print(' '); } break; case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); 257d8: 80 ec ldi r24, 0xC0 ; 192 257da: 9d e4 ldi r25, 0x4D ; 77 257dc: be ce rjmp .-644 ; 0x2555a 000257de ::start()>: /** * @brief Start timer */ template void Timer::start() 257de: cf 93 push r28 257e0: df 93 push r29 257e2: ec 01 movw r28, r24 { m_started = _millis(); 257e4: 0f 94 4c 29 call 0x25298 ; 0x25298 257e8: 69 83 std Y+1, r22 ; 0x01 257ea: 7a 83 std Y+2, r23 ; 0x02 257ec: 8b 83 std Y+3, r24 ; 0x03 257ee: 9c 83 std Y+4, r25 ; 0x04 m_isRunning = true; 257f0: 81 e0 ldi r24, 0x01 ; 1 257f2: 88 83 st Y, r24 } 257f4: df 91 pop r29 257f6: cf 91 pop r28 257f8: 08 95 ret 000257fa : //! 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) { 257fa: cf 92 push r12 257fc: df 92 push r13 257fe: ff 92 push r15 25800: 0f 93 push r16 25802: 1f 93 push r17 25804: cf 93 push r28 25806: df 93 push r29 25808: cd b7 in r28, 0x3d ; 61 2580a: de b7 in r29, 0x3e ; 62 2580c: 64 97 sbiw r28, 0x14 ; 20 2580e: 0f b6 in r0, 0x3f ; 63 25810: f8 94 cli 25812: de bf out 0x3e, r29 ; 62 25814: 0f be out 0x3f, r0 ; 63 25816: cd bf out 0x3d, r28 ; 61 25818: 8c 01 movw r16, r24 2581a: f6 2e mov r15, r22 char msg[LCD_WIDTH]; strcpy_P(msg, PSTR("Err: ")); 2581c: 63 e7 ldi r22, 0x73 ; 115 2581e: 7e e9 ldi r23, 0x9E ; 158 25820: ce 01 movw r24, r28 25822: 01 96 adiw r24, 0x01 ; 1 25824: 0f 94 d3 d9 call 0x3b3a6 ; 0x3b3a6 strcat_P(msg, type); 25828: b8 01 movw r22, r16 2582a: ce 01 movw r24, r28 2582c: 01 96 adiw r24, 0x01 ; 1 2582e: 0f 94 bf d9 call 0x3b37e ; 0x3b37e lcd_status_message_timeout.start(); } void lcd_setalertstatus_(const char* message, uint8_t severity, bool progmem) { if (lcd_message_check(severity)) { 25832: 83 e0 ldi r24, 0x03 ; 3 25834: 0e 94 07 f1 call 0x1e20e ; 0x1e20e 25838: 88 23 and r24, r24 2583a: e1 f0 breq .+56 ; 0x25874 bool same = !(progmem? strcmp_P(lcd_status_message, message): strcmp(lcd_status_message, message)); 2583c: be 01 movw r22, r28 2583e: 6f 5f subi r22, 0xFF ; 255 25840: 7f 4f sbci r23, 0xFF ; 255 25842: 8f e1 ldi r24, 0x1F ; 31 25844: 95 e0 ldi r25, 0x05 ; 5 25846: 0f 94 7e e2 call 0x3c4fc ; 0x3c4fc 2584a: 6c 01 movw r12, r24 lcd_status_message_timeout.start(); 2584c: 84 e3 ldi r24, 0x34 ; 52 2584e: 95 e0 ldi r25, 0x05 ; 5 25850: 0f 94 ef 2b call 0x257de ; 0x257de ::start()> lcd_status_message_level = severity; 25854: 83 e0 ldi r24, 0x03 ; 3 25856: 80 93 d5 03 sts 0x03D5, r24 ; 0x8003d5 <_ZL24lcd_status_message_level.lto_priv.451> custom_message_type = CustomMsg::Status; 2585a: 10 92 c4 06 sts 0x06C4, r1 ; 0x8006c4 custom_message_state = 0; 2585e: 10 92 f7 03 sts 0x03F7, r1 ; 0x8003f7 if (!same) { 25862: cd 28 or r12, r13 25864: 39 f0 breq .+14 ; 0x25874 // do not kick the user out of the menus if the message is unchanged lcd_updatestatus(message, progmem); 25866: 60 e0 ldi r22, 0x00 ; 0 25868: ce 01 movw r24, r28 2586a: 01 96 adiw r24, 0x01 ; 1 2586c: 0e 94 ec f0 call 0x1e1d8 ; 0x1e1d8 lcd_return_to_status(); 25870: 0f 94 a6 1e call 0x23d4c ; 0x23d4c lcd_setalertstatus(msg, LCD_STATUS_CRITICAL); SERIAL_ERROR_START; 25874: 8a e9 ldi r24, 0x9A ; 154 25876: 9b ea ldi r25, 0xAB ; 171 25878: 0e 94 50 77 call 0xeea0 ; 0xeea0 if(e != EXTRUDERS) { 2587c: 81 e0 ldi r24, 0x01 ; 1 2587e: f8 16 cp r15, r24 25880: 49 f0 breq .+18 ; 0x25894 25882: 60 e0 ldi r22, 0x00 ; 0 25884: 70 e0 ldi r23, 0x00 ; 0 25886: cb 01 movw r24, r22 25888: 0f 94 6b d5 call 0x3aad6 ; 0x3aad6 SERIAL_ERROR((int)e); SERIAL_ERRORPGM(": "); 2588c: 80 e7 ldi r24, 0x70 ; 112 2588e: 9e e9 ldi r25, 0x9E ; 158 25890: 0e 94 50 77 call 0xeea0 ; 0xeea0 } SERIAL_ERRORPGM("Heaters switched off. "); 25894: 89 e5 ldi r24, 0x59 ; 89 25896: 9e e9 ldi r25, 0x9E ; 158 25898: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ERRORRPGM(type); 2589c: c8 01 movw r24, r16 2589e: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ERRORLNPGM(" triggered!"); 258a2: 8d e4 ldi r24, 0x4D ; 77 258a4: 9e e9 ldi r25, 0x9E ; 158 258a6: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 } 258aa: 64 96 adiw r28, 0x14 ; 20 258ac: 0f b6 in r0, 0x3f ; 63 258ae: f8 94 cli 258b0: de bf out 0x3e, r29 ; 62 258b2: 0f be out 0x3f, r0 ; 63 258b4: cd bf out 0x3d, r28 ; 61 258b6: df 91 pop r29 258b8: cf 91 pop r28 258ba: 1f 91 pop r17 258bc: 0f 91 pop r16 258be: ff 90 pop r15 258c0: df 90 pop r13 258c2: cf 90 pop r12 258c4: 08 95 ret 000258c6 <__vector_15>: volatile unsigned long timer2_overflow_count; volatile unsigned long timer2_millis; unsigned char timer2_fract = 0; ISR(TIMER2_OVF_vect) { 258c6: 1f 92 push r1 258c8: 0f 92 push r0 258ca: 0f b6 in r0, 0x3f ; 63 258cc: 0f 92 push r0 258ce: 11 24 eor r1, r1 258d0: 2f 93 push r18 258d2: 3f 93 push r19 258d4: 8f 93 push r24 258d6: 9f 93 push r25 258d8: af 93 push r26 258da: 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; 258dc: 80 91 3b 06 lds r24, 0x063B ; 0x80063b 258e0: 90 91 3c 06 lds r25, 0x063C ; 0x80063c 258e4: a0 91 3d 06 lds r26, 0x063D ; 0x80063d 258e8: b0 91 3e 06 lds r27, 0x063E ; 0x80063e unsigned char f = timer2_fract; 258ec: 30 91 3a 06 lds r19, 0x063A ; 0x80063a m += MILLIS_INC; f += FRACT_INC; 258f0: 23 e0 ldi r18, 0x03 ; 3 258f2: 23 0f add r18, r19 if (f >= FRACT_MAX) 258f4: 2d 37 cpi r18, 0x7D ; 125 258f6: 58 f5 brcc .+86 ; 0x2594e <__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; 258f8: 01 96 adiw r24, 0x01 ; 1 258fa: a1 1d adc r26, r1 258fc: b1 1d adc r27, r1 if (f >= FRACT_MAX) { f -= FRACT_MAX; m += 1; } timer2_fract = f; 258fe: 20 93 3a 06 sts 0x063A, r18 ; 0x80063a timer2_millis = m; 25902: 80 93 3b 06 sts 0x063B, r24 ; 0x80063b 25906: 90 93 3c 06 sts 0x063C, r25 ; 0x80063c 2590a: a0 93 3d 06 sts 0x063D, r26 ; 0x80063d 2590e: b0 93 3e 06 sts 0x063E, r27 ; 0x80063e timer2_overflow_count++; 25912: 80 91 3f 06 lds r24, 0x063F ; 0x80063f 25916: 90 91 40 06 lds r25, 0x0640 ; 0x800640 2591a: a0 91 41 06 lds r26, 0x0641 ; 0x800641 2591e: b0 91 42 06 lds r27, 0x0642 ; 0x800642 25922: 01 96 adiw r24, 0x01 ; 1 25924: a1 1d adc r26, r1 25926: b1 1d adc r27, r1 25928: 80 93 3f 06 sts 0x063F, r24 ; 0x80063f 2592c: 90 93 40 06 sts 0x0640, r25 ; 0x800640 25930: a0 93 41 06 sts 0x0641, r26 ; 0x800641 25934: b0 93 42 06 sts 0x0642, r27 ; 0x800642 } 25938: bf 91 pop r27 2593a: af 91 pop r26 2593c: 9f 91 pop r25 2593e: 8f 91 pop r24 25940: 3f 91 pop r19 25942: 2f 91 pop r18 25944: 0f 90 pop r0 25946: 0f be out 0x3f, r0 ; 63 25948: 0f 90 pop r0 2594a: 1f 90 pop r1 2594c: 18 95 reti unsigned char f = timer2_fract; m += MILLIS_INC; f += FRACT_INC; if (f >= FRACT_MAX) { f -= FRACT_MAX; 2594e: 26 e8 ldi r18, 0x86 ; 134 25950: 23 0f add r18, r19 m += 1; 25952: 02 96 adiw r24, 0x02 ; 2 25954: a1 1d adc r26, r1 25956: b1 1d adc r27, r1 25958: d2 cf rjmp .-92 ; 0x258fe <__vector_15+0x38> 0002595a : return pos; } static float cost_fn(uint16_t samples, float* const var, float v, uint8_t fan_pwm, float ambient) { 2595a: 2f 92 push r2 2595c: 3f 92 push r3 2595e: 4f 92 push r4 25960: 5f 92 push r5 25962: 6f 92 push r6 25964: 7f 92 push r7 25966: 8f 92 push r8 25968: 9f 92 push r9 2596a: af 92 push r10 2596c: bf 92 push r11 2596e: cf 92 push r12 25970: df 92 push r13 25972: ef 92 push r14 25974: ff 92 push r15 25976: 0f 93 push r16 25978: 1f 93 push r17 2597a: cf 93 push r28 2597c: df 93 push r29 2597e: 00 d0 rcall .+0 ; 0x25980 25980: 00 d0 rcall .+0 ; 0x25982 25982: 1f 92 push r1 25984: cd b7 in r28, 0x3d ; 61 25986: de b7 in r29, 0x3e ; 62 25988: 9c 83 std Y+4, r25 ; 0x04 2598a: 8b 83 std Y+3, r24 ; 0x03 2598c: 0d 83 std Y+5, r16 ; 0x05 2598e: 26 01 movw r4, r12 25990: 37 01 movw r6, r14 *var = v; 25992: fb 01 movw r30, r22 25994: 20 83 st Z, r18 25996: 31 83 std Z+1, r19 ; 0x01 25998: 42 83 std Z+2, r20 ; 0x02 2599a: 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); 2599c: 20 91 e6 12 lds r18, 0x12E6 ; 0x8012e6 <_ZN13thermal_modelL4dataE.lto_priv.400+0x36> 259a0: 30 91 e7 12 lds r19, 0x12E7 ; 0x8012e7 <_ZN13thermal_modelL4dataE.lto_priv.400+0x37> 259a4: 40 91 e8 12 lds r20, 0x12E8 ; 0x8012e8 <_ZN13thermal_modelL4dataE.lto_priv.400+0x38> 259a8: 50 91 e9 12 lds r21, 0x12E9 ; 0x8012e9 <_ZN13thermal_modelL4dataE.lto_priv.400+0x39> 259ac: 61 e7 ldi r22, 0x71 ; 113 259ae: 7d e3 ldi r23, 0x3D ; 61 259b0: 8a e8 ldi r24, 0x8A ; 138 259b2: 9e e3 ldi r25, 0x3E ; 62 259b4: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 259b8: 60 93 3d 13 sts 0x133D, r22 ; 0x80133d <_ZN13thermal_modelL4dataE.lto_priv.400+0x8d> 259bc: 70 93 3e 13 sts 0x133E, r23 ; 0x80133e <_ZN13thermal_modelL4dataE.lto_priv.400+0x8e> 259c0: 80 93 3f 13 sts 0x133F, r24 ; 0x80133f <_ZN13thermal_modelL4dataE.lto_priv.400+0x8f> 259c4: 90 93 40 13 sts 0x1340, r25 ; 0x801340 <_ZN13thermal_modelL4dataE.lto_priv.400+0x90> warn_s = warn * TEMP_MGR_INTV; 259c8: 21 e7 ldi r18, 0x71 ; 113 259ca: 3d e3 ldi r19, 0x3D ; 61 259cc: 4a e8 ldi r20, 0x8A ; 138 259ce: 5e e3 ldi r21, 0x3E ; 62 259d0: 60 91 34 13 lds r22, 0x1334 ; 0x801334 <_ZN13thermal_modelL4dataE.lto_priv.400+0x84> 259d4: 70 91 35 13 lds r23, 0x1335 ; 0x801335 <_ZN13thermal_modelL4dataE.lto_priv.400+0x85> 259d8: 80 91 36 13 lds r24, 0x1336 ; 0x801336 <_ZN13thermal_modelL4dataE.lto_priv.400+0x86> 259dc: 90 91 37 13 lds r25, 0x1337 ; 0x801337 <_ZN13thermal_modelL4dataE.lto_priv.400+0x87> 259e0: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 259e4: 60 93 41 13 sts 0x1341, r22 ; 0x801341 <_ZN13thermal_modelL4dataE.lto_priv.400+0x91> 259e8: 70 93 42 13 sts 0x1342, r23 ; 0x801342 <_ZN13thermal_modelL4dataE.lto_priv.400+0x92> 259ec: 80 93 43 13 sts 0x1343, r24 ; 0x801343 <_ZN13thermal_modelL4dataE.lto_priv.400+0x93> 259f0: 90 93 44 13 sts 0x1344, r25 ; 0x801344 <_ZN13thermal_modelL4dataE.lto_priv.400+0x94> err_s = err * TEMP_MGR_INTV; 259f4: 21 e7 ldi r18, 0x71 ; 113 259f6: 3d e3 ldi r19, 0x3D ; 61 259f8: 4a e8 ldi r20, 0x8A ; 138 259fa: 5e e3 ldi r21, 0x3E ; 62 259fc: 60 91 38 13 lds r22, 0x1338 ; 0x801338 <_ZN13thermal_modelL4dataE.lto_priv.400+0x88> 25a00: 70 91 39 13 lds r23, 0x1339 ; 0x801339 <_ZN13thermal_modelL4dataE.lto_priv.400+0x89> 25a04: 80 91 3a 13 lds r24, 0x133A ; 0x80133a <_ZN13thermal_modelL4dataE.lto_priv.400+0x8a> 25a08: 90 91 3b 13 lds r25, 0x133B ; 0x80133b <_ZN13thermal_modelL4dataE.lto_priv.400+0x8b> 25a0c: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 25a10: 60 93 45 13 sts 0x1345, r22 ; 0x801345 <_ZN13thermal_modelL4dataE.lto_priv.400+0x95> 25a14: 70 93 46 13 sts 0x1346, r23 ; 0x801346 <_ZN13thermal_modelL4dataE.lto_priv.400+0x96> 25a18: 80 93 47 13 sts 0x1347, r24 ; 0x801347 <_ZN13thermal_modelL4dataE.lto_priv.400+0x97> 25a1c: 90 93 48 13 sts 0x1348, r25 ; 0x801348 <_ZN13thermal_modelL4dataE.lto_priv.400+0x98> dT_lag_size = L / (uint16_t)(TEMP_MGR_INTV * 1000); 25a20: 80 91 ee 12 lds r24, 0x12EE ; 0x8012ee <_ZN13thermal_modelL4dataE.lto_priv.400+0x3e> 25a24: 90 91 ef 12 lds r25, 0x12EF ; 0x8012ef <_ZN13thermal_modelL4dataE.lto_priv.400+0x3f> 25a28: 6e e0 ldi r22, 0x0E ; 14 25a2a: 71 e0 ldi r23, 0x01 ; 1 25a2c: 0f 94 e5 dc call 0x3b9ca ; 0x3b9ca <__udivmodhi4> 25a30: 60 93 d0 12 sts 0x12D0, r22 ; 0x8012d0 <_ZN13thermal_modelL4dataE.lto_priv.400+0x20> 25a34: e0 eb ldi r30, 0xB0 ; 176 25a36: 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; 25a38: 80 e0 ldi r24, 0x00 ; 0 25a3a: 90 e0 ldi r25, 0x00 ; 0 25a3c: a0 ec ldi r26, 0xC0 ; 192 25a3e: bf e7 ldi r27, 0x7F ; 127 25a40: 81 93 st Z+, r24 25a42: 91 93 st Z+, r25 25a44: a1 93 st Z+, r26 25a46: 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) 25a48: 22 e1 ldi r18, 0x12 ; 18 25a4a: e0 3d cpi r30, 0xD0 ; 208 25a4c: f2 07 cpc r31, r18 25a4e: c1 f7 brne .-16 ; 0x25a40 dT_lag_buf[i] = NAN; dT_lag_idx = 0; 25a50: 10 92 d1 12 sts 0x12D1, r1 ; 0x8012d1 <_ZN13thermal_modelL4dataE.lto_priv.400+0x21> dT_err_prev = 0; 25a54: 10 92 d2 12 sts 0x12D2, r1 ; 0x8012d2 <_ZN13thermal_modelL4dataE.lto_priv.400+0x22> 25a58: 10 92 d3 12 sts 0x12D3, r1 ; 0x8012d3 <_ZN13thermal_modelL4dataE.lto_priv.400+0x23> 25a5c: 10 92 d4 12 sts 0x12D4, r1 ; 0x8012d4 <_ZN13thermal_modelL4dataE.lto_priv.400+0x24> 25a60: 10 92 d5 12 sts 0x12D5, r1 ; 0x8012d5 <_ZN13thermal_modelL4dataE.lto_priv.400+0x25> T_prev = NAN; 25a64: 80 93 d6 12 sts 0x12D6, r24 ; 0x8012d6 <_ZN13thermal_modelL4dataE.lto_priv.400+0x26> 25a68: 90 93 d7 12 sts 0x12D7, r25 ; 0x8012d7 <_ZN13thermal_modelL4dataE.lto_priv.400+0x27> 25a6c: a0 93 d8 12 sts 0x12D8, r26 ; 0x8012d8 <_ZN13thermal_modelL4dataE.lto_priv.400+0x28> 25a70: b0 93 d9 12 sts 0x12D9, r27 ; 0x8012d9 <_ZN13thermal_modelL4dataE.lto_priv.400+0x29> // clear the initialization flag flag_bits.uninitialized = false; 25a74: 80 91 3c 13 lds r24, 0x133C ; 0x80133c <_ZN13thermal_modelL4dataE.lto_priv.400+0x8c> 25a78: 8e 7f andi r24, 0xFE ; 254 25a7a: 80 93 3c 13 sts 0x133C, r24 ; 0x80133c <_ZN13thermal_modelL4dataE.lto_priv.400+0x8c> 25a7e: 85 ec ldi r24, 0xC5 ; 197 25a80: 96 e0 ldi r25, 0x06 ; 6 25a82: 9f 83 std Y+7, r25 ; 0x07 25a84: 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) { 25a86: e1 e0 ldi r30, 0x01 ; 1 25a88: f0 e0 ldi r31, 0x00 ; 0 25a8a: fa 83 std Y+2, r31 ; 0x02 25a8c: 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; 25a8e: 31 2c mov r3, r1 25a90: 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; 25a92: 81 2c mov r8, r1 25a94: 91 2c mov r9, r1 25a96: 54 01 movw r10, r8 uint16_t cnt = 0; for(uint16_t i = 1; i < samples; ++i) { 25a98: 29 81 ldd r18, Y+1 ; 0x01 25a9a: 3a 81 ldd r19, Y+2 ; 0x02 25a9c: 8b 81 ldd r24, Y+3 ; 0x03 25a9e: 9c 81 ldd r25, Y+4 ; 0x04 25aa0: 28 17 cp r18, r24 25aa2: 39 07 cpc r19, r25 25aa4: c8 f5 brcc .+114 ; 0x25b18 thermal_model::data.step(rec_buffer[i].pwm, fan_pwm, rec_buffer[i].temp, ambient); 25aa6: ee 81 ldd r30, Y+6 ; 0x06 25aa8: ff 81 ldd r31, Y+7 ; 0x07 25aaa: 25 81 ldd r18, Z+5 ; 0x05 25aac: 36 81 ldd r19, Z+6 ; 0x06 25aae: 47 81 ldd r20, Z+7 ; 0x07 25ab0: 50 85 ldd r21, Z+8 ; 0x08 25ab2: 83 01 movw r16, r6 25ab4: 72 01 movw r14, r4 25ab6: 6d 81 ldd r22, Y+5 ; 0x05 25ab8: 81 85 ldd r24, Z+9 ; 0x09 25aba: 0e 94 33 e5 call 0x1ca66 ; 0x1ca66 float err_v = thermal_model::data.dT_err_prev; 25abe: c0 90 d2 12 lds r12, 0x12D2 ; 0x8012d2 <_ZN13thermal_modelL4dataE.lto_priv.400+0x22> 25ac2: d0 90 d3 12 lds r13, 0x12D3 ; 0x8012d3 <_ZN13thermal_modelL4dataE.lto_priv.400+0x23> 25ac6: e0 90 d4 12 lds r14, 0x12D4 ; 0x8012d4 <_ZN13thermal_modelL4dataE.lto_priv.400+0x24> 25aca: f0 90 d5 12 lds r15, 0x12D5 ; 0x8012d5 <_ZN13thermal_modelL4dataE.lto_priv.400+0x25> if(!isnan(err_v)) { 25ace: a7 01 movw r20, r14 25ad0: 96 01 movw r18, r12 25ad2: c7 01 movw r24, r14 25ad4: b6 01 movw r22, r12 25ad6: 0f 94 52 e1 call 0x3c2a4 ; 0x3c2a4 <__unordsf2> 25ada: 81 11 cpse r24, r1 25adc: 11 c0 rjmp .+34 ; 0x25b00 err += err_v * err_v; 25ade: a7 01 movw r20, r14 25ae0: 96 01 movw r18, r12 25ae2: c7 01 movw r24, r14 25ae4: b6 01 movw r22, r12 25ae6: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 25aea: 9b 01 movw r18, r22 25aec: ac 01 movw r20, r24 25aee: c5 01 movw r24, r10 25af0: b4 01 movw r22, r8 25af2: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 25af6: 4b 01 movw r8, r22 25af8: 5c 01 movw r10, r24 ++cnt; 25afa: ff ef ldi r31, 0xFF ; 255 25afc: 2f 1a sub r2, r31 25afe: 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) { 25b00: 29 81 ldd r18, Y+1 ; 0x01 25b02: 3a 81 ldd r19, Y+2 ; 0x02 25b04: 2f 5f subi r18, 0xFF ; 255 25b06: 3f 4f sbci r19, 0xFF ; 255 25b08: 3a 83 std Y+2, r19 ; 0x02 25b0a: 29 83 std Y+1, r18 ; 0x01 25b0c: 8e 81 ldd r24, Y+6 ; 0x06 25b0e: 9f 81 ldd r25, Y+7 ; 0x07 25b10: 05 96 adiw r24, 0x05 ; 5 25b12: 9f 83 std Y+7, r25 ; 0x07 25b14: 8e 83 std Y+6, r24 ; 0x06 25b16: c0 cf rjmp .-128 ; 0x25a98 if(!isnan(err_v)) { err += err_v * err_v; ++cnt; } } return cnt ? (err / cnt) : NAN; 25b18: 60 e0 ldi r22, 0x00 ; 0 25b1a: 70 e0 ldi r23, 0x00 ; 0 25b1c: 80 ec ldi r24, 0xC0 ; 192 25b1e: 9f e7 ldi r25, 0x7F ; 127 25b20: 21 14 cp r2, r1 25b22: 31 04 cpc r3, r1 25b24: 59 f0 breq .+22 ; 0x25b3c 25b26: b1 01 movw r22, r2 25b28: 90 e0 ldi r25, 0x00 ; 0 25b2a: 80 e0 ldi r24, 0x00 ; 0 25b2c: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 25b30: 9b 01 movw r18, r22 25b32: ac 01 movw r20, r24 25b34: c5 01 movw r24, r10 25b36: b4 01 movw r22, r8 25b38: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> } 25b3c: 27 96 adiw r28, 0x07 ; 7 25b3e: 0f b6 in r0, 0x3f ; 63 25b40: f8 94 cli 25b42: de bf out 0x3e, r29 ; 62 25b44: 0f be out 0x3f, r0 ; 63 25b46: cd bf out 0x3d, r28 ; 61 25b48: df 91 pop r29 25b4a: cf 91 pop r28 25b4c: 1f 91 pop r17 25b4e: 0f 91 pop r16 25b50: ff 90 pop r15 25b52: ef 90 pop r14 25b54: df 90 pop r13 25b56: cf 90 pop r12 25b58: bf 90 pop r11 25b5a: af 90 pop r10 25b5c: 9f 90 pop r9 25b5e: 8f 90 pop r8 25b60: 7f 90 pop r7 25b62: 6f 90 pop r6 25b64: 5f 90 pop r5 25b66: 4f 90 pop r4 25b68: 3f 90 pop r3 25b6a: 2f 90 pop r2 25b6c: 08 95 ret 00025b6e : namespace thermal_model_cal { // set current fan speed for both front/backend static __attribute__((noinline)) void set_fan_speed(uint8_t fan_speed) { 25b6e: cf 93 push r28 25b70: c8 2f mov r28, r24 // reset the fan measuring state due to missing hysteresis handling on the checking side resetFanCheck(); 25b72: 0e 94 e1 74 call 0xe9c2 ; 0xe9c2 fanSpeed = fan_speed; 25b76: c0 93 e7 03 sts 0x03E7, r28 ; 0x8003e7 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = fan_speed; 25b7a: c0 93 a6 04 sts 0x04A6, r28 ; 0x8004a6 #endif } 25b7e: cf 91 pop r28 25b80: 08 95 ret 00025b82 : thermal_model::data.R[index] = R; thermal_model::setup(); } void thermal_model_report_settings() { 25b82: cf 92 push r12 25b84: df 92 push r13 25b86: ef 92 push r14 25b88: ff 92 push r15 25b8a: 0f 93 push r16 25b8c: 1f 93 push r17 25b8e: cf 93 push r28 25b90: df 93 push r29 SERIAL_ECHO_START; 25b92: 82 ec ldi r24, 0xC2 ; 194 25b94: 9b ea ldi r25, 0xAB ; 171 25b96: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHOLNPGM("Thermal Model settings:"); 25b9a: 88 e1 ldi r24, 0x18 ; 24 25b9c: 9f e9 ldi r25, 0x9F ; 159 25b9e: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 25ba2: c0 ef ldi r28, 0xF0 ; 240 25ba4: d2 e1 ldi r29, 0x12 ; 18 25ba6: 10 e0 ldi r17, 0x00 ; 0 25ba8: 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]); 25baa: 82 ec ldi r24, 0xC2 ; 194 25bac: e8 2e mov r14, r24 25bae: 8b ea ldi r24, 0xAB ; 171 25bb0: f8 2e mov r15, r24 25bb2: 94 e0 ldi r25, 0x04 ; 4 25bb4: c9 2e mov r12, r25 25bb6: 9f e9 ldi r25, 0x9F ; 159 25bb8: d9 2e mov r13, r25 25bba: 88 81 ld r24, Y 25bbc: 99 81 ldd r25, Y+1 ; 0x01 25bbe: 2a 81 ldd r18, Y+2 ; 0x02 25bc0: 3b 81 ldd r19, Y+3 ; 0x03 25bc2: 24 96 adiw r28, 0x04 ; 4 25bc4: 3f 93 push r19 25bc6: 2f 93 push r18 25bc8: 9f 93 push r25 25bca: 8f 93 push r24 25bcc: 1f 93 push r17 25bce: 0f 93 push r16 25bd0: ff 92 push r15 25bd2: ef 92 push r14 25bd4: df 92 push r13 25bd6: cf 92 push r12 25bd8: 0f 94 de da call 0x3b5bc ; 0x3b5bc 25bdc: 0f 5f subi r16, 0xFF ; 255 25bde: 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) 25be0: 8d b7 in r24, 0x3d ; 61 25be2: 9e b7 in r25, 0x3e ; 62 25be4: 0a 96 adiw r24, 0x0a ; 10 25be6: 0f b6 in r0, 0x3f ; 63 25be8: f8 94 cli 25bea: 9e bf out 0x3e, r25 ; 62 25bec: 0f be out 0x3f, r0 ; 63 25bee: 8d bf out 0x3d, r24 ; 61 25bf0: 00 31 cpi r16, 0x10 ; 16 25bf2: 11 05 cpc r17, r1 25bf4: 11 f7 brne .-60 ; 0x25bba 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"), 25bf6: 80 91 33 13 lds r24, 0x1333 ; 0x801333 <_ZN13thermal_modelL4dataE.lto_priv.400+0x83> 25bfa: 8f 93 push r24 25bfc: 80 91 32 13 lds r24, 0x1332 ; 0x801332 <_ZN13thermal_modelL4dataE.lto_priv.400+0x82> 25c00: 8f 93 push r24 25c02: 80 91 31 13 lds r24, 0x1331 ; 0x801331 <_ZN13thermal_modelL4dataE.lto_priv.400+0x81> 25c06: 8f 93 push r24 25c08: 80 91 30 13 lds r24, 0x1330 ; 0x801330 <_ZN13thermal_modelL4dataE.lto_priv.400+0x80> 25c0c: 8f 93 push r24 25c0e: 80 91 37 13 lds r24, 0x1337 ; 0x801337 <_ZN13thermal_modelL4dataE.lto_priv.400+0x87> 25c12: 8f 93 push r24 25c14: 80 91 36 13 lds r24, 0x1336 ; 0x801336 <_ZN13thermal_modelL4dataE.lto_priv.400+0x86> 25c18: 8f 93 push r24 25c1a: 80 91 35 13 lds r24, 0x1335 ; 0x801335 <_ZN13thermal_modelL4dataE.lto_priv.400+0x85> 25c1e: 8f 93 push r24 25c20: 80 91 34 13 lds r24, 0x1334 ; 0x801334 <_ZN13thermal_modelL4dataE.lto_priv.400+0x84> 25c24: 8f 93 push r24 25c26: 80 91 3b 13 lds r24, 0x133B ; 0x80133b <_ZN13thermal_modelL4dataE.lto_priv.400+0x8b> 25c2a: 8f 93 push r24 25c2c: 80 91 3a 13 lds r24, 0x133A ; 0x80133a <_ZN13thermal_modelL4dataE.lto_priv.400+0x8a> 25c30: 8f 93 push r24 25c32: 80 91 39 13 lds r24, 0x1339 ; 0x801339 <_ZN13thermal_modelL4dataE.lto_priv.400+0x89> 25c36: 8f 93 push r24 25c38: 80 91 38 13 lds r24, 0x1338 ; 0x801338 <_ZN13thermal_modelL4dataE.lto_priv.400+0x88> 25c3c: 8f 93 push r24 25c3e: 80 91 3d 02 lds r24, 0x023D ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.455> 25c42: 1f 92 push r1 25c44: 8f 93 push r24 25c46: 80 91 1d 05 lds r24, 0x051D ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.456> 25c4a: 1f 92 push r1 25c4c: 8f 93 push r24 25c4e: 80 91 ef 12 lds r24, 0x12EF ; 0x8012ef <_ZN13thermal_modelL4dataE.lto_priv.400+0x3f> 25c52: 8f 93 push r24 25c54: 80 91 ee 12 lds r24, 0x12EE ; 0x8012ee <_ZN13thermal_modelL4dataE.lto_priv.400+0x3e> 25c58: 8f 93 push r24 25c5a: 80 91 ed 12 lds r24, 0x12ED ; 0x8012ed <_ZN13thermal_modelL4dataE.lto_priv.400+0x3d> 25c5e: 8f 93 push r24 25c60: 80 91 ec 12 lds r24, 0x12EC ; 0x8012ec <_ZN13thermal_modelL4dataE.lto_priv.400+0x3c> 25c64: 8f 93 push r24 25c66: 80 91 eb 12 lds r24, 0x12EB ; 0x8012eb <_ZN13thermal_modelL4dataE.lto_priv.400+0x3b> 25c6a: 8f 93 push r24 25c6c: 80 91 ea 12 lds r24, 0x12EA ; 0x8012ea <_ZN13thermal_modelL4dataE.lto_priv.400+0x3a> 25c70: 8f 93 push r24 25c72: 80 91 e9 12 lds r24, 0x12E9 ; 0x8012e9 <_ZN13thermal_modelL4dataE.lto_priv.400+0x39> 25c76: 8f 93 push r24 25c78: 80 91 e8 12 lds r24, 0x12E8 ; 0x8012e8 <_ZN13thermal_modelL4dataE.lto_priv.400+0x38> 25c7c: 8f 93 push r24 25c7e: 80 91 e7 12 lds r24, 0x12E7 ; 0x8012e7 <_ZN13thermal_modelL4dataE.lto_priv.400+0x37> 25c82: 8f 93 push r24 25c84: 80 91 e6 12 lds r24, 0x12E6 ; 0x8012e6 <_ZN13thermal_modelL4dataE.lto_priv.400+0x36> 25c88: 8f 93 push r24 25c8a: 80 91 e5 12 lds r24, 0x12E5 ; 0x8012e5 <_ZN13thermal_modelL4dataE.lto_priv.400+0x35> 25c8e: 8f 93 push r24 25c90: 80 91 e4 12 lds r24, 0x12E4 ; 0x8012e4 <_ZN13thermal_modelL4dataE.lto_priv.400+0x34> 25c94: 8f 93 push r24 25c96: 80 91 e3 12 lds r24, 0x12E3 ; 0x8012e3 <_ZN13thermal_modelL4dataE.lto_priv.400+0x33> 25c9a: 8f 93 push r24 25c9c: 80 91 e2 12 lds r24, 0x12E2 ; 0x8012e2 <_ZN13thermal_modelL4dataE.lto_priv.400+0x32> 25ca0: 8f 93 push r24 25ca2: 80 91 e1 12 lds r24, 0x12E1 ; 0x8012e1 <_ZN13thermal_modelL4dataE.lto_priv.400+0x31> 25ca6: 8f 93 push r24 25ca8: 80 91 e0 12 lds r24, 0x12E0 ; 0x8012e0 <_ZN13thermal_modelL4dataE.lto_priv.400+0x30> 25cac: 8f 93 push r24 25cae: 80 91 df 12 lds r24, 0x12DF ; 0x8012df <_ZN13thermal_modelL4dataE.lto_priv.400+0x2f> 25cb2: 8f 93 push r24 25cb4: 80 91 de 12 lds r24, 0x12DE ; 0x8012de <_ZN13thermal_modelL4dataE.lto_priv.400+0x2e> 25cb8: 8f 93 push r24 25cba: 80 91 dd 12 lds r24, 0x12DD ; 0x8012dd <_ZN13thermal_modelL4dataE.lto_priv.400+0x2d> 25cbe: 8f 93 push r24 25cc0: 80 91 dc 12 lds r24, 0x12DC ; 0x8012dc <_ZN13thermal_modelL4dataE.lto_priv.400+0x2c> 25cc4: 8f 93 push r24 25cc6: 80 91 db 12 lds r24, 0x12DB ; 0x8012db <_ZN13thermal_modelL4dataE.lto_priv.400+0x2b> 25cca: 8f 93 push r24 25ccc: 80 91 da 12 lds r24, 0x12DA ; 0x8012da <_ZN13thermal_modelL4dataE.lto_priv.400+0x2a> 25cd0: 8f 93 push r24 25cd2: ff 92 push r15 25cd4: ef 92 push r14 25cd6: 8e eb ldi r24, 0xBE ; 190 25cd8: 9e e9 ldi r25, 0x9E ; 158 25cda: 9f 93 push r25 25cdc: 8f 93 push r24 25cde: 0f 94 de da call 0x3b5bc ; 0x3b5bc 25ce2: 8d b7 in r24, 0x3d ; 61 25ce4: 9e b7 in r25, 0x3e ; 62 25ce6: 8a 96 adiw r24, 0x2a ; 42 25ce8: 0f b6 in r0, 0x3f ; 63 25cea: f8 94 cli 25cec: 9e bf out 0x3e, r25 ; 62 25cee: 0f be out 0x3f, r0 ; 63 25cf0: 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); } 25cf2: df 91 pop r29 25cf4: cf 91 pop r28 25cf6: 1f 91 pop r17 25cf8: 0f 91 pop r16 25cfa: ff 90 pop r15 25cfc: ef 90 pop r14 25cfe: df 90 pop r13 25d00: cf 90 pop r12 25d02: 08 95 ret 00025d04 : // 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); 25d04: 89 57 subi r24, 0x79 ; 121 25d06: 9f 4f sbci r25, 0xFF ; 255 25d08: 6e e0 ldi r22, 0x0E ; 14 25d0a: 71 e0 ldi r23, 0x01 ; 1 25d0c: 0f 94 e5 dc call 0x3b9ca ; 0x3b9ca <__udivmodhi4> // ensure we do not exceed the maximum lag buffer and have at least one lag sample for filtering if(samples < 1) 25d10: 61 15 cp r22, r1 25d12: 71 05 cpc r23, r1 25d14: 99 f0 breq .+38 ; 0x25d3c 25d16: 69 30 cpi r22, 0x09 ; 9 25d18: 71 05 cpc r23, r1 25d1a: 10 f0 brcs .+4 ; 0x25d20 25d1c: 68 e0 ldi r22, 0x08 ; 8 25d1e: 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; 25d20: 2e e0 ldi r18, 0x0E ; 14 25d22: 31 e0 ldi r19, 0x01 ; 1 25d24: 62 9f mul r22, r18 25d26: c0 01 movw r24, r0 25d28: 63 9f mul r22, r19 25d2a: 90 0d add r25, r0 25d2c: 72 9f mul r23, r18 25d2e: 90 0d add r25, r0 25d30: 11 24 eor r1, r1 25d32: 90 93 ef 12 sts 0x12EF, r25 ; 0x8012ef <_ZN13thermal_modelL4dataE.lto_priv.400+0x3f> 25d36: 80 93 ee 12 sts 0x12EE, r24 ; 0x8012ee <_ZN13thermal_modelL4dataE.lto_priv.400+0x3e> } 25d3a: 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; 25d3c: 61 e0 ldi r22, 0x01 ; 1 25d3e: 70 e0 ldi r23, 0x00 ; 0 25d40: ef cf rjmp .-34 ; 0x25d20 00025d42 : if(!calibrated()) enabled = false; reinitialize(); } static bool calibrated() { 25d42: cf 93 push r28 25d44: df 93 push r29 if(!(data.P > 0)) return false; 25d46: 20 e0 ldi r18, 0x00 ; 0 25d48: 30 e0 ldi r19, 0x00 ; 0 25d4a: a9 01 movw r20, r18 25d4c: 60 91 da 12 lds r22, 0x12DA ; 0x8012da <_ZN13thermal_modelL4dataE.lto_priv.400+0x2a> 25d50: 70 91 db 12 lds r23, 0x12DB ; 0x8012db <_ZN13thermal_modelL4dataE.lto_priv.400+0x2b> 25d54: 80 91 dc 12 lds r24, 0x12DC ; 0x8012dc <_ZN13thermal_modelL4dataE.lto_priv.400+0x2c> 25d58: 90 91 dd 12 lds r25, 0x12DD ; 0x8012dd <_ZN13thermal_modelL4dataE.lto_priv.400+0x2d> 25d5c: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 25d60: 18 16 cp r1, r24 25d62: 0c f0 brlt .+2 ; 0x25d66 25d64: 54 c0 rjmp .+168 ; 0x25e0e if(isnan(data.U)) return false; 25d66: 60 91 de 12 lds r22, 0x12DE ; 0x8012de <_ZN13thermal_modelL4dataE.lto_priv.400+0x2e> 25d6a: 70 91 df 12 lds r23, 0x12DF ; 0x8012df <_ZN13thermal_modelL4dataE.lto_priv.400+0x2f> 25d6e: 80 91 e0 12 lds r24, 0x12E0 ; 0x8012e0 <_ZN13thermal_modelL4dataE.lto_priv.400+0x30> 25d72: 90 91 e1 12 lds r25, 0x12E1 ; 0x8012e1 <_ZN13thermal_modelL4dataE.lto_priv.400+0x31> 25d76: 9b 01 movw r18, r22 25d78: ac 01 movw r20, r24 25d7a: 0f 94 52 e1 call 0x3c2a4 ; 0x3c2a4 <__unordsf2> 25d7e: 81 11 cpse r24, r1 25d80: 46 c0 rjmp .+140 ; 0x25e0e if(isnan(data.V)) return false; 25d82: 60 91 e2 12 lds r22, 0x12E2 ; 0x8012e2 <_ZN13thermal_modelL4dataE.lto_priv.400+0x32> 25d86: 70 91 e3 12 lds r23, 0x12E3 ; 0x8012e3 <_ZN13thermal_modelL4dataE.lto_priv.400+0x33> 25d8a: 80 91 e4 12 lds r24, 0x12E4 ; 0x8012e4 <_ZN13thermal_modelL4dataE.lto_priv.400+0x34> 25d8e: 90 91 e5 12 lds r25, 0x12E5 ; 0x8012e5 <_ZN13thermal_modelL4dataE.lto_priv.400+0x35> 25d92: 9b 01 movw r18, r22 25d94: ac 01 movw r20, r24 25d96: 0f 94 52 e1 call 0x3c2a4 ; 0x3c2a4 <__unordsf2> 25d9a: 81 11 cpse r24, r1 25d9c: 38 c0 rjmp .+112 ; 0x25e0e if(!(data.C > 0)) return false; 25d9e: 20 e0 ldi r18, 0x00 ; 0 25da0: 30 e0 ldi r19, 0x00 ; 0 25da2: a9 01 movw r20, r18 25da4: 60 91 e6 12 lds r22, 0x12E6 ; 0x8012e6 <_ZN13thermal_modelL4dataE.lto_priv.400+0x36> 25da8: 70 91 e7 12 lds r23, 0x12E7 ; 0x8012e7 <_ZN13thermal_modelL4dataE.lto_priv.400+0x37> 25dac: 80 91 e8 12 lds r24, 0x12E8 ; 0x8012e8 <_ZN13thermal_modelL4dataE.lto_priv.400+0x38> 25db0: 90 91 e9 12 lds r25, 0x12E9 ; 0x8012e9 <_ZN13thermal_modelL4dataE.lto_priv.400+0x39> 25db4: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 25db8: 18 16 cp r1, r24 25dba: 4c f5 brge .+82 ; 0x25e0e if(isnan(data.fS)) return false; 25dbc: 60 91 ea 12 lds r22, 0x12EA ; 0x8012ea <_ZN13thermal_modelL4dataE.lto_priv.400+0x3a> 25dc0: 70 91 eb 12 lds r23, 0x12EB ; 0x8012eb <_ZN13thermal_modelL4dataE.lto_priv.400+0x3b> 25dc4: 80 91 ec 12 lds r24, 0x12EC ; 0x8012ec <_ZN13thermal_modelL4dataE.lto_priv.400+0x3c> 25dc8: 90 91 ed 12 lds r25, 0x12ED ; 0x8012ed <_ZN13thermal_modelL4dataE.lto_priv.400+0x3d> 25dcc: 9b 01 movw r18, r22 25dce: ac 01 movw r20, r24 25dd0: 0f 94 52 e1 call 0x3c2a4 ; 0x3c2a4 <__unordsf2> 25dd4: 81 11 cpse r24, r1 25dd6: 1b c0 rjmp .+54 ; 0x25e0e if(!(data.L > 0)) return false; 25dd8: 80 91 ee 12 lds r24, 0x12EE ; 0x8012ee <_ZN13thermal_modelL4dataE.lto_priv.400+0x3e> 25ddc: 90 91 ef 12 lds r25, 0x12EF ; 0x8012ef <_ZN13thermal_modelL4dataE.lto_priv.400+0x3f> 25de0: 89 2b or r24, r25 25de2: a9 f0 breq .+42 ; 0x25e0e 25de4: c0 ef ldi r28, 0xF0 ; 240 25de6: 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)) 25de8: 69 91 ld r22, Y+ 25dea: 79 91 ld r23, Y+ 25dec: 89 91 ld r24, Y+ 25dee: 99 91 ld r25, Y+ 25df0: 20 e0 ldi r18, 0x00 ; 0 25df2: 30 e0 ldi r19, 0x00 ; 0 25df4: a9 01 movw r20, r18 25df6: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 25dfa: 87 fd sbrc r24, 7 25dfc: 08 c0 rjmp .+16 ; 0x25e0e 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) { 25dfe: 83 e1 ldi r24, 0x13 ; 19 25e00: c0 33 cpi r28, 0x30 ; 48 25e02: d8 07 cpc r29, r24 25e04: 89 f7 brne .-30 ; 0x25de8 if(!(thermal_model::data.R[i] >= 0)) return false; } if(!(data.warn != NAN)) return false; if(!(data.err != NAN)) return false; return true; 25e06: 81 e0 ldi r24, 0x01 ; 1 } 25e08: df 91 pop r29 25e0a: cf 91 pop r28 25e0c: 08 95 ret reinitialize(); } static bool calibrated() { if(!(data.P > 0)) return false; 25e0e: 80 e0 ldi r24, 0x00 ; 0 25e10: fb cf rjmp .-10 ; 0x25e08 00025e12 : } // verify calibration status and trigger a model reset if valid static void setup() { if(!calibrated()) enabled = false; 25e12: 0f 94 a1 2e call 0x25d42 ; 0x25d42 25e16: 81 11 cpse r24, r1 25e18: 02 c0 rjmp .+4 ; 0x25e1e 25e1a: 10 92 1d 05 sts 0x051D, r1 ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.456> } // clear error flags and mark as uninitialized static void reinitialize() { data.flags = 1; // shorcut to reset all error flags 25e1e: 81 e0 ldi r24, 0x01 ; 1 25e20: 80 93 3c 13 sts 0x133C, r24 ; 0x80133c <_ZN13thermal_modelL4dataE.lto_priv.400+0x8c> warning_state.assert = false; // explicitly clear assertions 25e24: 80 91 39 06 lds r24, 0x0639 ; 0x800639 25e28: 8d 7f andi r24, 0xFD ; 253 25e2a: 80 93 39 06 sts 0x0639, r24 ; 0x800639 // verify calibration status and trigger a model reset if valid static void setup() { if(!calibrated()) enabled = false; reinitialize(); } 25e2e: 08 95 ret 00025e30 : } ENABLE_TEMP_MGR_INTERRUPT(); } void disable_heater() { 25e30: 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; 25e32: 10 92 b7 0d sts 0x0DB7, r1 ; 0x800db7 25e36: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 25e3a: 10 92 73 06 sts 0x0673, r1 ; 0x800673 25e3e: 10 92 72 06 sts 0x0672, r1 ; 0x800672 setTargetHotend(0); setTargetBed(0); ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 25e42: cf b7 in r28, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 25e44: f8 94 cli // propagate all values down the chain setIsrTargetTemperatures(); 25e46: 0f 94 93 13 call 0x22726 ; 0x22726 temp_mgr_pid(); 25e4a: 0f 94 d0 10 call 0x221a0 ; 0x221a0 // 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); 25e4e: 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; 25e50: 10 92 8d 06 sts 0x068D, r1 ; 0x80068d (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 25e54: cf bf out 0x3f, r28 ; 63 #endif } } 25e56: cf 91 pop r28 25e58: 08 95 ret 00025e5a : /* Menu implementation */ static void lcd_cooldown() { disable_heater(); 25e5a: 0f 94 18 2f call 0x25e30 ; 0x25e30 fanSpeed = 0; 25e5e: 10 92 e7 03 sts 0x03E7, r1 ; 0x8003e7 lcd_return_to_status(); 25e62: 0d 94 a6 1e jmp 0x23d4c ; 0x23d4c 00025e66 : // 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) { 25e66: 1f 93 push r17 25e68: cf 93 push r28 25e6a: df 93 push r29 25e6c: c8 2f mov r28, r24 25e6e: 16 2f mov r17, r22 25e70: d4 2f mov r29, r20 // save the original target temperatures for recovery before disabling heaters if(!temp_error_state.error && !saved_printing) { 25e72: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 25e76: 80 fd sbrc r24, 0 25e78: 18 c0 rjmp .+48 ; 0x25eaa 25e7a: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 25e7e: 81 11 cpse r24, r1 25e80: 14 c0 rjmp .+40 ; 0x25eaa saved_bed_temperature = target_temperature_bed; 25e82: 80 91 72 06 lds r24, 0x0672 ; 0x800672 25e86: 80 93 ae 05 sts 0x05AE, r24 ; 0x8005ae saved_extruder_temperature = target_temperature[index]; 25e8a: e6 2f mov r30, r22 25e8c: f0 e0 ldi r31, 0x00 ; 0 25e8e: ee 0f add r30, r30 25e90: ff 1f adc r31, r31 25e92: ea 54 subi r30, 0x4A ; 74 25e94: f2 4f sbci r31, 0xF2 ; 242 25e96: 80 81 ld r24, Z 25e98: 91 81 ldd r25, Z+1 ; 0x01 25e9a: 90 93 ad 05 sts 0x05AD, r25 ; 0x8005ad 25e9e: 80 93 ac 05 sts 0x05AC, r24 ; 0x8005ac saved_fan_speed = fanSpeed; 25ea2: 80 91 e7 03 lds r24, 0x03E7 ; 0x8003e7 25ea6: 80 93 ab 05 sts 0x05AB, r24 ; 0x8005ab } // keep disabling heaters and keep fans on as long as the condition is asserted disable_heater(); 25eaa: 0f 94 18 2f call 0x25e30 ; 0x25e30 void hotendFanSetFullSpeed() { #ifdef EXTRUDER_ALTFAN_DETECT altfanStatus.altfanOverride = 1; //full speed #endif //EXTRUDER_ALTFAN_DETECT resetFanCheck(); 25eae: 0e 94 e1 74 call 0xe9c2 ; 0xe9c2 setExtruderAutoFanState(3); 25eb2: 83 e0 ldi r24, 0x03 ; 3 25eb4: 0e 94 5b 75 call 0xeab6 ; 0xeab6 SET_OUTPUT(FAN_PIN); 25eb8: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 25ebc: 88 60 ori r24, 0x08 ; 8 25ebe: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = 255; 25ec2: 8f ef ldi r24, 0xFF ; 255 25ec4: 80 93 a6 04 sts 0x04A6, r24 ; 0x8004a6 #else //FAN_SOFT_PWM analogWrite(FAN_PIN, 255); #endif //FAN_SOFT_PWM fanSpeed = 255; 25ec8: 80 93 e7 03 sts 0x03E7, r24 ; 0x8003e7 hotendFanSetFullSpeed(); // set the initial error source to the highest priority error if(!temp_error_state.error || (uint8_t)type < temp_error_state.type) { 25ecc: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 25ed0: 80 ff sbrs r24, 0 25ed2: 07 c0 rjmp .+14 ; 0x25ee2 25ed4: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 25ed8: 82 95 swap r24 25eda: 86 95 lsr r24 25edc: 87 70 andi r24, 0x07 ; 7 25ede: d8 17 cp r29, r24 25ee0: c0 f4 brcc .+48 ; 0x25f12 temp_error_state.source = (uint8_t)source; 25ee2: c3 70 andi r28, 0x03 ; 3 25ee4: cc 0f add r28, r28 25ee6: cc 0f add r28, r28 25ee8: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 25eec: 83 7f andi r24, 0xF3 ; 243 25eee: 8c 2b or r24, r28 25ef0: 80 93 1b 05 sts 0x051B, r24 ; 0x80051b <_ZL16temp_error_state.lto_priv.454> temp_error_state.index = index; 25ef4: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 25ef8: 10 fb bst r17, 0 25efa: 84 f9 bld r24, 4 25efc: 80 93 1b 05 sts 0x051B, r24 ; 0x80051b <_ZL16temp_error_state.lto_priv.454> temp_error_state.type = (uint8_t)type; 25f00: d2 95 swap r29 25f02: dd 0f add r29, r29 25f04: d0 7e andi r29, 0xE0 ; 224 25f06: 40 91 1b 05 lds r20, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 25f0a: 4f 71 andi r20, 0x1F ; 31 25f0c: 4d 2b or r20, r29 25f0e: 40 93 1b 05 sts 0x051B, r20 ; 0x80051b <_ZL16temp_error_state.lto_priv.454> } // always set the error state temp_error_state.error = true; 25f12: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 25f16: 81 60 ori r24, 0x01 ; 1 25f18: 80 93 1b 05 sts 0x051B, r24 ; 0x80051b <_ZL16temp_error_state.lto_priv.454> temp_error_state.assert = true; 25f1c: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 25f20: 82 60 ori r24, 0x02 ; 2 25f22: 80 93 1b 05 sts 0x051B, r24 ; 0x80051b <_ZL16temp_error_state.lto_priv.454> } 25f26: df 91 pop r29 25f28: cf 91 pop r28 25f2a: 1f 91 pop r17 25f2c: 08 95 ret 00025f2e : } void check_min_temp_bed() { #if HEATER_BED_RAW_LO_TEMP > HEATER_BED_RAW_HI_TEMP if (current_temperature_bed_raw >= bed_minttemp_raw) { 25f2e: 20 91 09 06 lds r18, 0x0609 ; 0x800609 25f32: 30 91 0a 06 lds r19, 0x060A ; 0x80060a 25f36: 80 91 52 02 lds r24, 0x0252 ; 0x800252 <_ZL16bed_minttemp_raw.lto_priv.471> 25f3a: 90 91 53 02 lds r25, 0x0253 ; 0x800253 <_ZL16bed_minttemp_raw.lto_priv.471+0x1> 25f3e: 28 17 cp r18, r24 25f40: 39 07 cpc r19, r25 25f42: 2c f0 brlt .+10 ; 0x25f4e #else if (current_temperature_bed_raw <= bed_minttemp_raw) { #endif set_temp_error(TempErrorSource::bed, 0, TempErrorType::min); 25f44: 41 e0 ldi r20, 0x01 ; 1 25f46: 60 e0 ldi r22, 0x00 ; 0 25f48: 81 e0 ldi r24, 0x01 ; 1 25f4a: 0d 94 33 2f jmp 0x25e66 ; 0x25e66 } } 25f4e: 08 95 ret 00025f50 : 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]) { 25f50: 20 91 0b 06 lds r18, 0x060B ; 0x80060b 25f54: 30 91 0c 06 lds r19, 0x060C ; 0x80060c 25f58: 80 91 54 02 lds r24, 0x0254 ; 0x800254 <_ZL12minttemp_raw.lto_priv.472> 25f5c: 90 91 55 02 lds r25, 0x0255 ; 0x800255 <_ZL12minttemp_raw.lto_priv.472+0x1> 25f60: 28 17 cp r18, r24 25f62: 39 07 cpc r19, r25 25f64: 2c f0 brlt .+10 ; 0x25f70 #else if (current_temperature_raw[0] <= minttemp_raw[0]) { #endif set_temp_error(TempErrorSource::hotend, 0, TempErrorType::min); 25f66: 41 e0 ldi r20, 0x01 ; 1 25f68: 60 e0 ldi r22, 0x00 ; 0 25f6a: 80 e0 ldi r24, 0x00 ; 0 25f6c: 0d 94 33 2f jmp 0x25e66 ; 0x25e66 } } 25f70: 08 95 ret 00025f72 : 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) { 25f72: 2f 92 push r2 25f74: 3f 92 push r3 25f76: 4f 92 push r4 25f78: 5f 92 push r5 25f7a: 6f 92 push r6 25f7c: 7f 92 push r7 25f7e: 8f 92 push r8 25f80: 9f 92 push r9 25f82: af 92 push r10 25f84: bf 92 push r11 25f86: cf 92 push r12 25f88: df 92 push r13 25f8a: ef 92 push r14 25f8c: ff 92 push r15 25f8e: 0f 93 push r16 25f90: 1f 93 push r17 25f92: cf 93 push r28 25f94: df 93 push r29 25f96: cd b7 in r28, 0x3d ; 61 25f98: de b7 in r29, 0x3e ; 62 25f9a: 2c 97 sbiw r28, 0x0c ; 12 25f9c: 0f b6 in r0, 0x3f ; 63 25f9e: f8 94 cli 25fa0: de bf out 0x3e, r29 ; 62 25fa2: 0f be out 0x3f, r0 ; 63 25fa4: cd bf out 0x3d, r28 ; 61 25fa6: 28 2e mov r2, r24 25fa8: 49 83 std Y+1, r20 ; 0x01 25faa: 5a 83 std Y+2, r21 ; 0x02 25fac: 6b 83 std Y+3, r22 ; 0x03 25fae: 7c 83 std Y+4, r23 ; 0x04 25fb0: 28 01 movw r4, r16 25fb2: 39 01 movw r6, r18 25fb4: 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) 25fb6: 0f 94 4c 29 call 0x25298 ; 0x25298 25fba: 02 2d mov r16, r2 25fbc: 10 e0 ldi r17, 0x00 ; 0 25fbe: 98 01 movw r18, r16 25fc0: 22 0f add r18, r18 25fc2: 33 1f adc r19, r19 25fc4: 22 0f add r18, r18 25fc6: 33 1f adc r19, r19 25fc8: 3c 87 std Y+12, r19 ; 0x0c 25fca: 2b 87 std Y+11, r18 ; 0x0b 25fcc: f9 01 movw r30, r18 25fce: e7 53 subi r30, 0x37 ; 55 25fd0: fa 4f sbci r31, 0xFA ; 250 25fd2: 80 80 ld r8, Z 25fd4: 91 80 ldd r9, Z+1 ; 0x01 25fd6: a2 80 ldd r10, Z+2 ; 0x02 25fd8: b3 80 ldd r11, Z+3 ; 0x03 25fda: 68 19 sub r22, r8 25fdc: 79 09 sbc r23, r9 25fde: 8a 09 sbc r24, r10 25fe0: 9b 09 sbc r25, r11 25fe2: 61 3d cpi r22, 0xD1 ; 209 25fe4: 77 40 sbci r23, 0x07 ; 7 25fe6: 81 05 cpc r24, r1 25fe8: 91 05 cpc r25, r1 25fea: 08 f4 brcc .+2 ; 0x25fee 25fec: ea c0 rjmp .+468 ; 0x261c2 { #ifdef TEMP_RUNAWAY_BED_TIMEOUT if (_isbed) 25fee: 33 20 and r3, r3 25ff0: 09 f4 brne .+2 ; 0x25ff4 25ff2: 75 c0 rjmp .+234 ; 0x260de { __hysteresis = TEMP_RUNAWAY_BED_HYSTERESIS; __timeout = TEMP_RUNAWAY_BED_TIMEOUT; 25ff4: 88 e6 ldi r24, 0x68 ; 104 25ff6: 91 e0 ldi r25, 0x01 ; 1 25ff8: 9a 87 std Y+10, r25 ; 0x0a 25ffa: 89 87 std Y+9, r24 ; 0x09 { #ifdef TEMP_RUNAWAY_BED_TIMEOUT if (_isbed) { __hysteresis = TEMP_RUNAWAY_BED_HYSTERESIS; 25ffc: 80 e0 ldi r24, 0x00 ; 0 25ffe: 90 e0 ldi r25, 0x00 ; 0 26000: a0 ea ldi r26, 0xA0 ; 160 26002: b0 e4 ldi r27, 0x40 ; 64 } #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; 26004: 8d 83 std Y+5, r24 ; 0x05 26006: 9e 83 std Y+6, r25 ; 0x06 26008: af 83 std Y+7, r26 ; 0x07 2600a: b8 87 std Y+8, r27 ; 0x08 __timeout = TEMP_RUNAWAY_EXTRUDER_TIMEOUT; } #endif temp_runaway_timer[_heater_id] = _millis(); 2600c: 0f 94 4c 29 call 0x25298 ; 0x25298 26010: eb 85 ldd r30, Y+11 ; 0x0b 26012: fc 85 ldd r31, Y+12 ; 0x0c 26014: e7 53 subi r30, 0x37 ; 55 26016: fa 4f sbci r31, 0xFA ; 250 26018: 60 83 st Z, r22 2601a: 71 83 std Z+1, r23 ; 0x01 2601c: 82 83 std Z+2, r24 ; 0x02 2601e: 93 83 std Z+3, r25 ; 0x03 if (_output == 0) 26020: 20 e0 ldi r18, 0x00 ; 0 26022: 30 e0 ldi r19, 0x00 ; 0 26024: a9 01 movw r20, r18 26026: c7 01 movw r24, r14 26028: b6 01 movw r22, r12 2602a: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 2602e: 81 11 cpse r24, r1 26030: 07 c0 rjmp .+14 ; 0x26040 { temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 26032: f8 01 movw r30, r16 26034: ee 0f add r30, r30 26036: ff 1f adc r31, r31 26038: eb 53 subi r30, 0x3B ; 59 2603a: fa 4f sbci r31, 0xFA ; 250 2603c: 11 82 std Z+1, r1 ; 0x01 2603e: 10 82 st Z, r1 } if (temp_runaway_target[_heater_id] != _target_temperature) 26040: ab 85 ldd r26, Y+11 ; 0x0b 26042: bc 85 ldd r27, Y+12 ; 0x0c 26044: a3 54 subi r26, 0x43 ; 67 26046: ba 4f sbci r27, 0xFA ; 250 26048: 5d 01 movw r10, r26 2604a: 29 81 ldd r18, Y+1 ; 0x01 2604c: 3a 81 ldd r19, Y+2 ; 0x02 2604e: 4b 81 ldd r20, Y+3 ; 0x03 26050: 5c 81 ldd r21, Y+4 ; 0x04 26052: 6d 91 ld r22, X+ 26054: 7d 91 ld r23, X+ 26056: 8d 91 ld r24, X+ 26058: 9c 91 ld r25, X 2605a: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 2605e: 88 23 and r24, r24 26060: 09 f4 brne .+2 ; 0x26064 26062: 91 c0 rjmp .+290 ; 0x26186 { if (_target_temperature > 0) 26064: 20 e0 ldi r18, 0x00 ; 0 26066: 30 e0 ldi r19, 0x00 ; 0 26068: a9 01 movw r20, r18 2606a: 69 81 ldd r22, Y+1 ; 0x01 2606c: 7a 81 ldd r23, Y+2 ; 0x02 2606e: 8b 81 ldd r24, Y+3 ; 0x03 26070: 9c 81 ldd r25, Y+4 ; 0x04 26072: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 26076: f8 01 movw r30, r16 26078: e5 54 subi r30, 0x45 ; 69 2607a: fa 4f sbci r31, 0xFA ; 250 2607c: 18 16 cp r1, r24 2607e: c4 f5 brge .+112 ; 0x260f0 { temp_runaway_status[_heater_id] = TempRunaway_PREHEAT; 26080: 81 e0 ldi r24, 0x01 ; 1 26082: 80 83 st Z, r24 temp_runaway_target[_heater_id] = _target_temperature; 26084: 89 81 ldd r24, Y+1 ; 0x01 26086: 9a 81 ldd r25, Y+2 ; 0x02 26088: ab 81 ldd r26, Y+3 ; 0x03 2608a: bc 81 ldd r27, Y+4 ; 0x04 2608c: f5 01 movw r30, r10 2608e: 80 83 st Z, r24 26090: 91 83 std Z+1, r25 ; 0x01 26092: a2 83 std Z+2, r26 ; 0x02 26094: b3 83 std Z+3, r27 ; 0x03 __preheat_start[_heater_id] = _current_temperature; 26096: eb 85 ldd r30, Y+11 ; 0x0b 26098: fc 85 ldd r31, Y+12 ; 0x0c 2609a: ed 54 subi r30, 0x4D ; 77 2609c: fa 4f sbci r31, 0xFA ; 250 2609e: 40 82 st Z, r4 260a0: 51 82 std Z+1, r5 ; 0x01 260a2: 62 82 std Z+2, r6 ; 0x02 260a4: 73 82 std Z+3, r7 ; 0x03 __preheat_counter[_heater_id] = 0; 260a6: f8 01 movw r30, r16 260a8: ef 54 subi r30, 0x4F ; 79 260aa: fa 4f sbci r31, 0xFA ; 250 260ac: 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)) 260ae: a3 01 movw r20, r6 260b0: 92 01 movw r18, r4 260b2: bc 01 movw r22, r24 260b4: cd 01 movw r24, r26 260b6: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 260ba: 18 16 cp r1, r24 260bc: 1c f5 brge .+70 ; 0x26104 { __preheat_counter[_heater_id]++; 260be: f8 01 movw r30, r16 260c0: ef 54 subi r30, 0x4F ; 79 260c2: fa 4f sbci r31, 0xFA ; 250 260c4: 80 81 ld r24, Z 260c6: 8f 5f subi r24, 0xFF ; 255 260c8: 80 83 st Z, r24 if (__preheat_counter[_heater_id] > ((_isbed) ? 16 : 8)) // periodicaly check if current temperature changes 260ca: 31 10 cpse r3, r1 260cc: c7 c0 rjmp .+398 ; 0x2625c 260ce: 89 30 cpi r24, 0x09 ; 9 260d0: c8 f0 brcs .+50 ; 0x26104 { __delta=2.0; 260d2: 81 2c mov r8, r1 260d4: 91 2c mov r9, r1 260d6: a1 2c mov r10, r1 260d8: 50 e4 ldi r21, 0x40 ; 64 260da: b5 2e mov r11, r21 260dc: e8 c0 rjmp .+464 ; 0x262ae #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; __timeout = TEMP_RUNAWAY_EXTRUDER_TIMEOUT; 260de: ad e2 ldi r26, 0x2D ; 45 260e0: b0 e0 ldi r27, 0x00 ; 0 260e2: ba 87 std Y+10, r27 ; 0x0a 260e4: a9 87 std Y+9, r26 ; 0x09 } #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; 260e6: 80 e0 ldi r24, 0x00 ; 0 260e8: 90 e0 ldi r25, 0x00 ; 0 260ea: a0 e7 ldi r26, 0x70 ; 112 260ec: b1 e4 ldi r27, 0x41 ; 65 260ee: 8a cf rjmp .-236 ; 0x26004 __preheat_start[_heater_id] = _current_temperature; __preheat_counter[_heater_id] = 0; } else { temp_runaway_status[_heater_id] = TempRunaway_INACTIVE; 260f0: 10 82 st Z, r1 temp_runaway_target[_heater_id] = _target_temperature; 260f2: 89 81 ldd r24, Y+1 ; 0x01 260f4: 9a 81 ldd r25, Y+2 ; 0x02 260f6: ab 81 ldd r26, Y+3 ; 0x03 260f8: bc 81 ldd r27, Y+4 ; 0x04 260fa: f5 01 movw r30, r10 260fc: 80 83 st Z, r24 260fe: 91 83 std Z+1, r25 ; 0x01 26100: a2 83 std Z+2, r26 ; 0x02 26102: 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) 26104: 2d 81 ldd r18, Y+5 ; 0x05 26106: 3e 81 ldd r19, Y+6 ; 0x06 26108: 4f 81 ldd r20, Y+7 ; 0x07 2610a: 58 85 ldd r21, Y+8 ; 0x08 2610c: 69 81 ldd r22, Y+1 ; 0x01 2610e: 7a 81 ldd r23, Y+2 ; 0x02 26110: 8b 81 ldd r24, Y+3 ; 0x03 26112: 9c 81 ldd r25, Y+4 ; 0x04 26114: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 26118: a3 01 movw r20, r6 2611a: 92 01 movw r18, r4 2611c: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 26120: 87 ff sbrs r24, 7 26122: 46 c0 rjmp .+140 ; 0x261b0 26124: f8 01 movw r30, r16 26126: e5 54 subi r30, 0x45 ; 69 26128: fa 4f sbci r31, 0xFA ; 250 2612a: 80 81 ld r24, Z 2612c: 81 30 cpi r24, 0x01 ; 1 2612e: 49 f4 brne .+18 ; 0x26142 { temp_runaway_status[_heater_id] = TempRunaway_ACTIVE; 26130: 82 e0 ldi r24, 0x02 ; 2 26132: 80 83 st Z, r24 temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 26134: f8 01 movw r30, r16 26136: ee 0f add r30, r30 26138: ff 1f adc r31, r31 2613a: eb 53 subi r30, 0x3B ; 59 2613c: fa 4f sbci r31, 0xFA ; 250 2613e: 11 82 std Z+1, r1 ; 0x01 26140: 10 82 st Z, r1 } if (_output > 0) 26142: 20 e0 ldi r18, 0x00 ; 0 26144: 30 e0 ldi r19, 0x00 ; 0 26146: a9 01 movw r20, r18 26148: c7 01 movw r24, r14 2614a: b6 01 movw r22, r12 2614c: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 26150: 18 16 cp r1, r24 26152: bc f5 brge .+110 ; 0x261c2 if (temp_runaway_check_active) { // we are in range if ((_current_temperature > (_target_temperature - __hysteresis)) && (_current_temperature < (_target_temperature + __hysteresis))) 26154: 29 81 ldd r18, Y+1 ; 0x01 26156: 3a 81 ldd r19, Y+2 ; 0x02 26158: 4b 81 ldd r20, Y+3 ; 0x03 2615a: 5c 81 ldd r21, Y+4 ; 0x04 2615c: 6d 81 ldd r22, Y+5 ; 0x05 2615e: 7e 81 ldd r23, Y+6 ; 0x06 26160: 8f 81 ldd r24, Y+7 ; 0x07 26162: 98 85 ldd r25, Y+8 ; 0x08 26164: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 26168: a3 01 movw r20, r6 2616a: 92 01 movw r18, r4 2616c: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 26170: 18 16 cp r1, r24 26172: 0c f0 brlt .+2 ; 0x26176 26174: 3f c0 rjmp .+126 ; 0x261f4 { temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 26176: 00 0f add r16, r16 26178: 11 1f adc r17, r17 2617a: f8 01 movw r30, r16 2617c: eb 53 subi r30, 0x3B ; 59 2617e: fa 4f sbci r31, 0xFA ; 250 26180: 11 82 std Z+1, r1 ; 0x01 26182: 10 82 st Z, r1 26184: 1e c0 rjmp .+60 ; 0x261c2 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)) 26186: a3 01 movw r20, r6 26188: 92 01 movw r18, r4 2618a: 69 81 ldd r22, Y+1 ; 0x01 2618c: 7a 81 ldd r23, Y+2 ; 0x02 2618e: 8b 81 ldd r24, Y+3 ; 0x03 26190: 9c 81 ldd r25, Y+4 ; 0x04 26192: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 26196: 18 16 cp r1, r24 26198: 0c f0 brlt .+2 ; 0x2619c 2619a: b4 cf rjmp .-152 ; 0x26104 2619c: f8 01 movw r30, r16 2619e: e5 54 subi r30, 0x45 ; 69 261a0: fa 4f sbci r31, 0xFA ; 250 261a2: 80 81 ld r24, Z 261a4: 81 30 cpi r24, 0x01 ; 1 261a6: 09 f0 breq .+2 ; 0x261aa 261a8: ad cf rjmp .-166 ; 0x26104 261aa: 89 cf rjmp .-238 ; 0x260be 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; 261ac: 10 82 st Z, r1 261ae: 97 c0 rjmp .+302 ; 0x262de temp_runaway_status[_heater_id] = TempRunaway_ACTIVE; temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; } if (_output > 0) 261b0: 20 e0 ldi r18, 0x00 ; 0 261b2: 30 e0 ldi r19, 0x00 ; 0 261b4: a9 01 movw r20, r18 261b6: c7 01 movw r24, r14 261b8: b6 01 movw r22, r12 261ba: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 261be: 18 16 cp r1, r24 261c0: cc f0 brlt .+50 ; 0x261f4 } } } } } 261c2: 2c 96 adiw r28, 0x0c ; 12 261c4: 0f b6 in r0, 0x3f ; 63 261c6: f8 94 cli 261c8: de bf out 0x3e, r29 ; 62 261ca: 0f be out 0x3f, r0 ; 63 261cc: cd bf out 0x3d, r28 ; 61 261ce: df 91 pop r29 261d0: cf 91 pop r28 261d2: 1f 91 pop r17 261d4: 0f 91 pop r16 261d6: ff 90 pop r15 261d8: ef 90 pop r14 261da: df 90 pop r13 261dc: cf 90 pop r12 261de: bf 90 pop r11 261e0: af 90 pop r10 261e2: 9f 90 pop r9 261e4: 8f 90 pop r8 261e6: 7f 90 pop r7 261e8: 6f 90 pop r6 261ea: 5f 90 pop r5 261ec: 4f 90 pop r4 261ee: 3f 90 pop r3 261f0: 2f 90 pop r2 261f2: 08 95 ret temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; } else { if (temp_runaway_status[_heater_id] > TempRunaway_PREHEAT) 261f4: f8 01 movw r30, r16 261f6: e5 54 subi r30, 0x45 ; 69 261f8: fa 4f sbci r31, 0xFA ; 250 261fa: 80 81 ld r24, Z 261fc: 82 30 cpi r24, 0x02 ; 2 261fe: 08 f3 brcs .-62 ; 0x261c2 { temp_runaway_error_counter[_heater_id]++; 26200: 00 0f add r16, r16 26202: 11 1f adc r17, r17 26204: f8 01 movw r30, r16 26206: eb 53 subi r30, 0x3B ; 59 26208: fa 4f sbci r31, 0xFA ; 250 2620a: 80 81 ld r24, Z 2620c: 91 81 ldd r25, Z+1 ; 0x01 2620e: 01 96 adiw r24, 0x01 ; 1 26210: 91 83 std Z+1, r25 ; 0x01 26212: 80 83 st Z, r24 if (temp_runaway_error_counter[_heater_id] * 2 > __timeout) 26214: 88 0f add r24, r24 26216: 99 1f adc r25, r25 26218: e9 85 ldd r30, Y+9 ; 0x09 2621a: fa 85 ldd r31, Y+10 ; 0x0a 2621c: e8 17 cp r30, r24 2621e: f9 07 cpc r31, r25 26220: 80 f6 brcc .-96 ; 0x261c2 set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::runaway); 26222: 43 e0 ldi r20, 0x03 ; 3 26224: 62 2d mov r22, r2 26226: 83 2d mov r24, r3 } } } } } 26228: 2c 96 adiw r28, 0x0c ; 12 2622a: 0f b6 in r0, 0x3f ; 63 2622c: f8 94 cli 2622e: de bf out 0x3e, r29 ; 62 26230: 0f be out 0x3f, r0 ; 63 26232: cd bf out 0x3d, r28 ; 61 26234: df 91 pop r29 26236: cf 91 pop r28 26238: 1f 91 pop r17 2623a: 0f 91 pop r16 2623c: ff 90 pop r15 2623e: ef 90 pop r14 26240: df 90 pop r13 26242: cf 90 pop r12 26244: bf 90 pop r11 26246: af 90 pop r10 26248: 9f 90 pop r9 2624a: 8f 90 pop r8 2624c: 7f 90 pop r7 2624e: 6f 90 pop r6 26250: 5f 90 pop r5 26252: 4f 90 pop r4 26254: 3f 90 pop r3 26256: 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); 26258: 0d 94 33 2f jmp 0x25e66 ; 0x25e66 } 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 2625c: 81 31 cpi r24, 0x11 ; 17 2625e: 08 f4 brcc .+2 ; 0x26262 26260: 51 cf rjmp .-350 ; 0x26104 { __delta=2.0; if(_isbed) { __delta=3.0; if(_current_temperature>90.0) __delta=2.0; 26262: 20 e0 ldi r18, 0x00 ; 0 26264: 30 e0 ldi r19, 0x00 ; 0 26266: 44 eb ldi r20, 0xB4 ; 180 26268: 52 e4 ldi r21, 0x42 ; 66 2626a: c3 01 movw r24, r6 2626c: b2 01 movw r22, r4 2626e: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> if (__preheat_counter[_heater_id] > ((_isbed) ? 16 : 8)) // periodicaly check if current temperature changes { __delta=2.0; if(_isbed) { __delta=3.0; 26272: 81 2c mov r8, r1 26274: 91 2c mov r9, r1 26276: e0 e4 ldi r30, 0x40 ; 64 26278: ae 2e mov r10, r30 2627a: ba 2c mov r11, r10 if(_current_temperature>90.0) __delta=2.0; 2627c: 18 16 cp r1, r24 2627e: 2c f4 brge .+10 ; 0x2628a 26280: 81 2c mov r8, r1 26282: 91 2c mov r9, r1 26284: a1 2c mov r10, r1 26286: 70 e4 ldi r23, 0x40 ; 64 26288: b7 2e mov r11, r23 if(_current_temperature>105.0) __delta=0.6; 2628a: 20 e0 ldi r18, 0x00 ; 0 2628c: 30 e0 ldi r19, 0x00 ; 0 2628e: 42 ed ldi r20, 0xD2 ; 210 26290: 52 e4 ldi r21, 0x42 ; 66 26292: c3 01 movw r24, r6 26294: b2 01 movw r22, r4 26296: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 2629a: 18 16 cp r1, r24 2629c: 44 f4 brge .+16 ; 0x262ae 2629e: 6a e9 ldi r22, 0x9A ; 154 262a0: 86 2e mov r8, r22 262a2: 69 e9 ldi r22, 0x99 ; 153 262a4: 96 2e mov r9, r22 262a6: 69 e1 ldi r22, 0x19 ; 25 262a8: a6 2e mov r10, r22 262aa: 6f e3 ldi r22, 0x3F ; 63 262ac: b6 2e mov r11, r22 } if (_current_temperature - __preheat_start[_heater_id] < __delta) { 262ae: eb 85 ldd r30, Y+11 ; 0x0b 262b0: fc 85 ldd r31, Y+12 ; 0x0c 262b2: ed 54 subi r30, 0x4D ; 77 262b4: fa 4f sbci r31, 0xFA ; 250 262b6: 20 81 ld r18, Z 262b8: 31 81 ldd r19, Z+1 ; 0x01 262ba: 42 81 ldd r20, Z+2 ; 0x02 262bc: 53 81 ldd r21, Z+3 ; 0x03 262be: c3 01 movw r24, r6 262c0: b2 01 movw r22, r4 262c2: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 262c6: a5 01 movw r20, r10 262c8: 94 01 movw r18, r8 262ca: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 262ce: f8 01 movw r30, r16 262d0: e1 55 subi r30, 0x51 ; 81 262d2: fa 4f sbci r31, 0xFA ; 250 262d4: 87 ff sbrs r24, 7 262d6: 6a cf rjmp .-300 ; 0x261ac __preheat_errors[_heater_id]++; 262d8: 80 81 ld r24, Z 262da: 8f 5f subi r24, 0xFF ; 255 262dc: 80 83 st Z, r24 } else { __preheat_errors[_heater_id] = 0; } if (__preheat_errors[_heater_id] > ((_isbed) ? 3 : 5)) 262de: 80 81 ld r24, Z 262e0: 90 e0 ldi r25, 0x00 ; 0 262e2: 31 10 cpse r3, r1 262e4: 04 c0 rjmp .+8 ; 0x262ee 262e6: 06 97 sbiw r24, 0x06 ; 6 262e8: 4c f0 brlt .+18 ; 0x262fc set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::preheat); 262ea: 80 e0 ldi r24, 0x00 ; 0 262ec: 03 c0 rjmp .+6 ; 0x262f4 __preheat_errors[_heater_id]++; } else { __preheat_errors[_heater_id] = 0; } if (__preheat_errors[_heater_id] > ((_isbed) ? 3 : 5)) 262ee: 04 97 sbiw r24, 0x04 ; 4 262f0: 2c f0 brlt .+10 ; 0x262fc set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::preheat); 262f2: 81 e0 ldi r24, 0x01 ; 1 262f4: 42 e0 ldi r20, 0x02 ; 2 262f6: 62 2d mov r22, r2 262f8: 0f 94 33 2f call 0x25e66 ; 0x25e66 __preheat_start[_heater_id] = _current_temperature; 262fc: 2b 85 ldd r18, Y+11 ; 0x0b 262fe: 3c 85 ldd r19, Y+12 ; 0x0c 26300: 2d 54 subi r18, 0x4D ; 77 26302: 3a 4f sbci r19, 0xFA ; 250 26304: d9 01 movw r26, r18 26306: 4d 92 st X+, r4 26308: 5d 92 st X+, r5 2630a: 6d 92 st X+, r6 2630c: 7c 92 st X, r7 2630e: 13 97 sbiw r26, 0x03 ; 3 __preheat_counter[_heater_id] = 0; 26310: f8 01 movw r30, r16 26312: ef 54 subi r30, 0x4F ; 79 26314: fa 4f sbci r31, 0xFA ; 250 26316: 10 82 st Z, r1 26318: f5 ce rjmp .-534 ; 0x26104 0002631a : temp_mgr_state = TEMP_MGR_INTERRUPT_STATE(); DISABLE_TEMP_MGR_INTERRUPT(); } } ~TempMgrGuard() throw() { 2631a: fc 01 movw r30, r24 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 2631c: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 2631e: f8 94 cli if(temp_mgr_state) ENABLE_TEMP_MGR_INTERRUPT(); 26320: 80 81 ld r24, Z 26322: 88 23 and r24, r24 26324: 29 f0 breq .+10 ; 0x26330 26326: 80 91 73 00 lds r24, 0x0073 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> 2632a: 82 60 ori r24, 0x02 ; 2 2632c: 80 93 73 00 sts 0x0073, r24 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 26330: 9f bf out 0x3f, r25 ; 63 } } 26332: 08 95 ret 00026334 : class TempMgrGuard { bool temp_mgr_state; public: TempMgrGuard() { 26334: dc 01 movw r26, r24 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 26336: 2f b7 in r18, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 26338: f8 94 cli temp_mgr_state = TEMP_MGR_INTERRUPT_STATE(); 2633a: e3 e7 ldi r30, 0x73 ; 115 2633c: f0 e0 ldi r31, 0x00 ; 0 2633e: 90 81 ld r25, Z 26340: 96 95 lsr r25 26342: 91 70 andi r25, 0x01 ; 1 26344: 9c 93 st X, r25 DISABLE_TEMP_MGR_INTERRUPT(); 26346: 80 81 ld r24, Z 26348: 8d 7f andi r24, 0xFD ; 253 2634a: 80 83 st Z, r24 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 2634c: 2f bf out 0x3f, r18 ; 63 } } 2634e: 08 95 ret 00026350 : (double)thermal_model::data.err, (double)thermal_model::data.warn, (double)thermal_model::data.Ta_corr); } void thermal_model_reset_settings() { 26350: cf 93 push r28 26352: df 93 push r29 26354: 1f 92 push r1 26356: cd b7 in r28, 0x3d ; 61 26358: de b7 in r29, 0x3e ; 62 TempMgrGuard temp_mgr_guard; 2635a: ce 01 movw r24, r28 2635c: 01 96 adiw r24, 0x01 ; 1 2635e: 0f 94 9a 31 call 0x26334 ; 0x26334 thermal_model::data.P = THERMAL_MODEL_DEF(P); 26362: 80 e0 ldi r24, 0x00 ; 0 26364: 90 e0 ldi r25, 0x00 ; 0 26366: a0 e2 ldi r26, 0x20 ; 32 26368: b2 e4 ldi r27, 0x42 ; 66 2636a: 80 93 da 12 sts 0x12DA, r24 ; 0x8012da <_ZN13thermal_modelL4dataE.lto_priv.400+0x2a> 2636e: 90 93 db 12 sts 0x12DB, r25 ; 0x8012db <_ZN13thermal_modelL4dataE.lto_priv.400+0x2b> 26372: a0 93 dc 12 sts 0x12DC, r26 ; 0x8012dc <_ZN13thermal_modelL4dataE.lto_priv.400+0x2c> 26376: b0 93 dd 12 sts 0x12DD, r27 ; 0x8012dd <_ZN13thermal_modelL4dataE.lto_priv.400+0x2d> thermal_model::data.U = THERMAL_MODEL_DEF(U); 2637a: 84 e3 ldi r24, 0x34 ; 52 2637c: 90 e8 ldi r25, 0x80 ; 128 2637e: a7 eb ldi r26, 0xB7 ; 183 26380: ba eb ldi r27, 0xBA ; 186 26382: 80 93 de 12 sts 0x12DE, r24 ; 0x8012de <_ZN13thermal_modelL4dataE.lto_priv.400+0x2e> 26386: 90 93 df 12 sts 0x12DF, r25 ; 0x8012df <_ZN13thermal_modelL4dataE.lto_priv.400+0x2f> 2638a: a0 93 e0 12 sts 0x12E0, r26 ; 0x8012e0 <_ZN13thermal_modelL4dataE.lto_priv.400+0x30> 2638e: b0 93 e1 12 sts 0x12E1, r27 ; 0x8012e1 <_ZN13thermal_modelL4dataE.lto_priv.400+0x31> thermal_model::data.V = THERMAL_MODEL_DEF(V); 26392: 86 e6 ldi r24, 0x66 ; 102 26394: 96 e6 ldi r25, 0x66 ; 102 26396: a6 e8 ldi r26, 0x86 ; 134 26398: bf e3 ldi r27, 0x3F ; 63 2639a: 80 93 e2 12 sts 0x12E2, r24 ; 0x8012e2 <_ZN13thermal_modelL4dataE.lto_priv.400+0x32> 2639e: 90 93 e3 12 sts 0x12E3, r25 ; 0x8012e3 <_ZN13thermal_modelL4dataE.lto_priv.400+0x33> 263a2: a0 93 e4 12 sts 0x12E4, r26 ; 0x8012e4 <_ZN13thermal_modelL4dataE.lto_priv.400+0x34> 263a6: b0 93 e5 12 sts 0x12E5, r27 ; 0x8012e5 <_ZN13thermal_modelL4dataE.lto_priv.400+0x35> thermal_model::data.C = THERMAL_MODEL_DEF(C); 263aa: 8c ee ldi r24, 0xEC ; 236 263ac: 91 e5 ldi r25, 0x51 ; 81 263ae: ac e0 ldi r26, 0x0C ; 12 263b0: b1 e4 ldi r27, 0x41 ; 65 263b2: 80 93 e6 12 sts 0x12E6, r24 ; 0x8012e6 <_ZN13thermal_modelL4dataE.lto_priv.400+0x36> 263b6: 90 93 e7 12 sts 0x12E7, r25 ; 0x8012e7 <_ZN13thermal_modelL4dataE.lto_priv.400+0x37> 263ba: a0 93 e8 12 sts 0x12E8, r26 ; 0x8012e8 <_ZN13thermal_modelL4dataE.lto_priv.400+0x38> 263be: b0 93 e9 12 sts 0x12E9, r27 ; 0x8012e9 <_ZN13thermal_modelL4dataE.lto_priv.400+0x39> thermal_model::data.fS = THERMAL_MODEL_DEF(fS); 263c2: 8a e9 ldi r24, 0x9A ; 154 263c4: 99 e9 ldi r25, 0x99 ; 153 263c6: a9 e1 ldi r26, 0x19 ; 25 263c8: be e3 ldi r27, 0x3E ; 62 263ca: 80 93 ea 12 sts 0x12EA, r24 ; 0x8012ea <_ZN13thermal_modelL4dataE.lto_priv.400+0x3a> 263ce: 90 93 eb 12 sts 0x12EB, r25 ; 0x8012eb <_ZN13thermal_modelL4dataE.lto_priv.400+0x3b> 263d2: a0 93 ec 12 sts 0x12EC, r26 ; 0x8012ec <_ZN13thermal_modelL4dataE.lto_priv.400+0x3c> 263d6: b0 93 ed 12 sts 0x12ED, r27 ; 0x8012ed <_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); 263da: 8e e0 ldi r24, 0x0E ; 14 263dc: 91 e0 ldi r25, 0x01 ; 1 263de: 90 93 ef 12 sts 0x12EF, r25 ; 0x8012ef <_ZN13thermal_modelL4dataE.lto_priv.400+0x3f> 263e2: 80 93 ee 12 sts 0x12EE, r24 ; 0x8012ee <_ZN13thermal_modelL4dataE.lto_priv.400+0x3e> 263e6: 80 e3 ldi r24, 0x30 ; 48 263e8: 9f e9 ldi r25, 0x9F ; 159 263ea: a0 ef ldi r26, 0xF0 ; 240 263ec: 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); 263ee: fc 01 movw r30, r24 263f0: 45 91 lpm r20, Z+ 263f2: 55 91 lpm r21, Z+ 263f4: 65 91 lpm r22, Z+ 263f6: 74 91 lpm r23, Z 263f8: 4d 93 st X+, r20 263fa: 5d 93 st X+, r21 263fc: 6d 93 st X+, r22 263fe: 7d 93 st X+, r23 26400: 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) 26402: 23 e1 ldi r18, 0x13 ; 19 26404: a0 33 cpi r26, 0x30 ; 48 26406: b2 07 cpc r27, r18 26408: 91 f7 brne .-28 ; 0x263ee thermal_model::data.R[i] = pgm_read_float(THERMAL_MODEL_R_DEFAULT + i); thermal_model::data.Ta_corr = THERMAL_MODEL_Ta_corr; 2640a: 80 e0 ldi r24, 0x00 ; 0 2640c: 90 e0 ldi r25, 0x00 ; 0 2640e: a0 ee ldi r26, 0xE0 ; 224 26410: b0 ec ldi r27, 0xC0 ; 192 26412: 80 93 30 13 sts 0x1330, r24 ; 0x801330 <_ZN13thermal_modelL4dataE.lto_priv.400+0x80> 26416: 90 93 31 13 sts 0x1331, r25 ; 0x801331 <_ZN13thermal_modelL4dataE.lto_priv.400+0x81> 2641a: a0 93 32 13 sts 0x1332, r26 ; 0x801332 <_ZN13thermal_modelL4dataE.lto_priv.400+0x82> 2641e: b0 93 33 13 sts 0x1333, r27 ; 0x801333 <_ZN13thermal_modelL4dataE.lto_priv.400+0x83> thermal_model::data.warn = THERMAL_MODEL_DEF(W); 26422: 8a e9 ldi r24, 0x9A ; 154 26424: 99 e9 ldi r25, 0x99 ; 153 26426: a9 e5 ldi r26, 0x59 ; 89 26428: bf e3 ldi r27, 0x3F ; 63 2642a: 80 93 34 13 sts 0x1334, r24 ; 0x801334 <_ZN13thermal_modelL4dataE.lto_priv.400+0x84> 2642e: 90 93 35 13 sts 0x1335, r25 ; 0x801335 <_ZN13thermal_modelL4dataE.lto_priv.400+0x85> 26432: a0 93 36 13 sts 0x1336, r26 ; 0x801336 <_ZN13thermal_modelL4dataE.lto_priv.400+0x86> 26436: b0 93 37 13 sts 0x1337, r27 ; 0x801337 <_ZN13thermal_modelL4dataE.lto_priv.400+0x87> thermal_model::data.err = THERMAL_MODEL_DEF(E); 2643a: 84 ea ldi r24, 0xA4 ; 164 2643c: 90 e7 ldi r25, 0x70 ; 112 2643e: ad e9 ldi r26, 0x9D ; 157 26440: bf e3 ldi r27, 0x3F ; 63 26442: 80 93 38 13 sts 0x1338, r24 ; 0x801338 <_ZN13thermal_modelL4dataE.lto_priv.400+0x88> 26446: 90 93 39 13 sts 0x1339, r25 ; 0x801339 <_ZN13thermal_modelL4dataE.lto_priv.400+0x89> 2644a: a0 93 3a 13 sts 0x133A, r26 ; 0x80133a <_ZN13thermal_modelL4dataE.lto_priv.400+0x8a> 2644e: b0 93 3b 13 sts 0x133B, r27 ; 0x80133b <_ZN13thermal_modelL4dataE.lto_priv.400+0x8b> thermal_model::warn_beep = true; 26452: 81 e0 ldi r24, 0x01 ; 1 26454: 80 93 3d 02 sts 0x023D, r24 ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.455> thermal_model::enabled = true; 26458: 80 93 1d 05 sts 0x051D, r24 ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.456> } // clear error flags and mark as uninitialized static void reinitialize() { data.flags = 1; // shorcut to reset all error flags 2645c: 80 93 3c 13 sts 0x133C, r24 ; 0x80133c <_ZN13thermal_modelL4dataE.lto_priv.400+0x8c> warning_state.assert = false; // explicitly clear assertions 26460: 80 91 39 06 lds r24, 0x0639 ; 0x800639 26464: 8d 7f andi r24, 0xFD ; 253 26466: 80 93 39 06 sts 0x0639, r24 ; 0x800639 (double)thermal_model::data.Ta_corr); } void thermal_model_reset_settings() { TempMgrGuard temp_mgr_guard; 2646a: ce 01 movw r24, r28 2646c: 01 96 adiw r24, 0x01 ; 1 2646e: 0f 94 8d 31 call 0x2631a ; 0x2631a 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(); } 26472: 0f 90 pop r0 26474: df 91 pop r29 26476: cf 91 pop r28 26478: 08 95 ret 0002647a : { return thermal_model::enabled; } void thermal_model_set_enabled(bool enabled) { 2647a: 1f 93 push r17 2647c: cf 93 push r28 2647e: df 93 push r29 26480: 1f 92 push r1 26482: cd b7 in r28, 0x3d ; 61 26484: de b7 in r29, 0x3e ; 62 26486: 18 2f mov r17, r24 // set the enabled flag { TempMgrGuard temp_mgr_guard; 26488: ce 01 movw r24, r28 2648a: 01 96 adiw r24, 0x01 ; 1 2648c: 0f 94 9a 31 call 0x26334 ; 0x26334 thermal_model::enabled = enabled; 26490: 10 93 1d 05 sts 0x051D, r17 ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.456> thermal_model::setup(); 26494: 0f 94 09 2f call 0x25e12 ; 0x25e12 void thermal_model_set_enabled(bool enabled) { // set the enabled flag { TempMgrGuard temp_mgr_guard; 26498: ce 01 movw r24, r28 2649a: 01 96 adiw r24, 0x01 ; 1 2649c: 0f 94 8d 31 call 0x2631a ; 0x2631a thermal_model::enabled = enabled; thermal_model::setup(); } // verify that the model has been enabled if(enabled && !thermal_model::enabled) 264a0: 11 23 and r17, r17 264a2: 41 f0 breq .+16 ; 0x264b4 264a4: 80 91 1d 05 lds r24, 0x051D ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.456> 264a8: 81 11 cpse r24, r1 264aa: 04 c0 rjmp .+8 ; 0x264b4 SERIAL_ECHOLNPGM("TM: invalid parameters, cannot enable"); 264ac: 88 e9 ldi r24, 0x98 ; 152 264ae: 9e e9 ldi r25, 0x9E ; 158 264b0: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 } 264b4: 0f 90 pop r0 264b6: df 91 pop r29 264b8: cf 91 pop r28 264ba: 1f 91 pop r17 264bc: 08 95 ret 000264be : #endif } // namespace thermal_model static void thermal_model_reset_enabled(bool enabled) { 264be: 1f 93 push r17 264c0: cf 93 push r28 264c2: df 93 push r29 264c4: 1f 92 push r1 264c6: cd b7 in r28, 0x3d ; 61 264c8: de b7 in r29, 0x3e ; 62 264ca: 18 2f mov r17, r24 TempMgrGuard temp_mgr_guard; 264cc: ce 01 movw r24, r28 264ce: 01 96 adiw r24, 0x01 ; 1 264d0: 0f 94 9a 31 call 0x26334 ; 0x26334 thermal_model::enabled = enabled; 264d4: 10 93 1d 05 sts 0x051D, r17 ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.456> } // clear error flags and mark as uninitialized static void reinitialize() { data.flags = 1; // shorcut to reset all error flags 264d8: 81 e0 ldi r24, 0x01 ; 1 264da: 80 93 3c 13 sts 0x133C, r24 ; 0x80133c <_ZN13thermal_modelL4dataE.lto_priv.400+0x8c> warning_state.assert = false; // explicitly clear assertions 264de: e9 e3 ldi r30, 0x39 ; 57 264e0: f6 e0 ldi r31, 0x06 ; 6 264e2: 80 81 ld r24, Z 264e4: 8d 7f andi r24, 0xFD ; 253 264e6: 80 83 st Z, r24 } // namespace thermal_model static void thermal_model_reset_enabled(bool enabled) { TempMgrGuard temp_mgr_guard; 264e8: ce 01 movw r24, r28 264ea: 01 96 adiw r24, 0x01 ; 1 264ec: 0f 94 8d 31 call 0x2631a ; 0x2631a thermal_model::enabled = enabled; thermal_model::reinitialize(); } 264f0: 0f 90 pop r0 264f2: df 91 pop r29 264f4: cf 91 pop r28 264f6: 1f 91 pop r17 264f8: 08 95 ret 000264fa : /* 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() { 264fa: cf 93 push r28 264fc: df 93 push r29 264fe: 1f 92 push r1 26500: cd b7 in r28, 0x3d ; 61 26502: de b7 in r29, 0x3e ; 62 TempMgrGuard temp_mgr_guard; 26504: ce 01 movw r24, r28 26506: 01 96 adiw r24, 0x01 ; 1 26508: 0f 94 9a 31 call 0x26334 ; 0x26334 } static void setCurrentTemperaturesFromIsr() { for(uint8_t e=0;e 26510: 90 91 18 05 lds r25, 0x0518 ; 0x800518 26514: a0 91 19 05 lds r26, 0x0519 ; 0x800519 26518: b0 91 1a 05 lds r27, 0x051A ; 0x80051a 2651c: 80 93 b0 0d sts 0x0DB0, r24 ; 0x800db0 26520: 90 93 b1 0d sts 0x0DB1, r25 ; 0x800db1 26524: a0 93 b2 0d sts 0x0DB2, r26 ; 0x800db2 26528: b0 93 b3 0d sts 0x0DB3, r27 ; 0x800db3 current_temperature_bed = current_temperature_bed_isr; 2652c: 80 91 19 06 lds r24, 0x0619 ; 0x800619 26530: 90 91 1a 06 lds r25, 0x061A ; 0x80061a 26534: a0 91 1b 06 lds r26, 0x061B ; 0x80061b 26538: b0 91 1c 06 lds r27, 0x061C ; 0x80061c 2653c: 80 93 ee 04 sts 0x04EE, r24 ; 0x8004ee 26540: 90 93 ef 04 sts 0x04EF, r25 ; 0x8004ef 26544: a0 93 f0 04 sts 0x04F0, r26 ; 0x8004f0 26548: b0 93 f1 04 sts 0x04F1, r27 ; 0x8004f1 #ifdef PINDA_THERMISTOR current_temperature_pinda = current_temperature_pinda_isr; 2654c: 80 91 03 06 lds r24, 0x0603 ; 0x800603 26550: 90 91 04 06 lds r25, 0x0604 ; 0x800604 26554: a0 91 05 06 lds r26, 0x0605 ; 0x800605 26558: b0 91 06 06 lds r27, 0x0606 ; 0x800606 2655c: 80 93 99 03 sts 0x0399, r24 ; 0x800399 26560: 90 93 9a 03 sts 0x039A, r25 ; 0x80039a 26564: a0 93 9b 03 sts 0x039B, r26 ; 0x80039b 26568: b0 93 9c 03 sts 0x039C, r27 ; 0x80039c #endif #ifdef AMBIENT_THERMISTOR current_temperature_ambient = current_temperature_ambient_isr; 2656c: 80 91 20 06 lds r24, 0x0620 ; 0x800620 26570: 90 91 21 06 lds r25, 0x0621 ; 0x800621 26574: a0 91 22 06 lds r26, 0x0622 ; 0x800622 26578: b0 91 23 06 lds r27, 0x0623 ; 0x800623 2657c: 80 93 56 06 sts 0x0656, r24 ; 0x800656 26580: 90 93 57 06 sts 0x0657, r25 ; 0x800657 26584: a0 93 58 06 sts 0x0658, r26 ; 0x800658 26588: b0 93 59 06 sts 0x0659, r27 ; 0x800659 This function is blocking: check temp_meas_ready before calling! */ static void updateTemperatures() { TempMgrGuard temp_mgr_guard; setCurrentTemperaturesFromIsr(); if(!temp_error_state.v) { 2658c: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 26590: 81 11 cpse r24, r1 26592: 02 c0 rjmp .+4 ; 0x26598 // refuse to update target temperatures in any error condition! setIsrTargetTemperatures(); 26594: 0f 94 93 13 call 0x22726 ; 0x22726 } temp_meas_ready = false; 26598: 10 92 02 06 sts 0x0602, r1 ; 0x800602 - 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; 2659c: ce 01 movw r24, r28 2659e: 01 96 adiw r24, 0x01 ; 1 265a0: 0f 94 8d 31 call 0x2631a ; 0x2631a if(!temp_error_state.v) { // refuse to update target temperatures in any error condition! setIsrTargetTemperatures(); } temp_meas_ready = false; } 265a4: 0f 90 pop r0 265a6: df 91 pop r29 265a8: cf 91 pop r28 265aa: 08 95 ret 000265ac <__vector_14>: #ifdef SYSTEM_TIMER_2 ISR(TIMER2_COMPB_vect) #else //SYSTEM_TIMER_2 ISR(TIMER0_COMPB_vect) #endif //SYSTEM_TIMER_2 { 265ac: 1f 92 push r1 265ae: 0f 92 push r0 265b0: 0f b6 in r0, 0x3f ; 63 265b2: 0f 92 push r0 265b4: 11 24 eor r1, r1 265b6: 0b b6 in r0, 0x3b ; 59 265b8: 0f 92 push r0 265ba: ff 92 push r15 265bc: 0f 93 push r16 265be: 1f 93 push r17 265c0: 2f 93 push r18 265c2: 3f 93 push r19 265c4: 4f 93 push r20 265c6: 5f 93 push r21 265c8: 6f 93 push r22 265ca: 7f 93 push r23 265cc: 8f 93 push r24 265ce: 9f 93 push r25 265d0: af 93 push r26 265d2: bf 93 push r27 265d4: cf 93 push r28 265d6: df 93 push r29 265d8: ef 93 push r30 265da: ff 93 push r31 DISABLE_SOFT_PWM_INTERRUPT(); 265dc: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 265e0: 8b 7f andi r24, 0xFB ; 251 265e2: 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(); 265e6: 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) 265e8: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 265ec: 86 fd sbrc r24, 6 265ee: c8 c0 rjmp .+400 ; 0x26780 <__vector_14+0x1d4> { //button is pressed if (buttonBlanking.expired_cont(BUTTON_BLANKING_TIME)) { 265f0: 68 ec ldi r22, 0xC8 ; 200 265f2: 70 e0 ldi r23, 0x00 ; 0 265f4: 8f ed ldi r24, 0xDF ; 223 265f6: 95 e0 ldi r25, 0x05 ; 5 265f8: 0f 94 a6 29 call 0x2534c ; 0x2534c ::expired_cont(unsigned short)> 265fc: 88 23 and r24, r24 265fe: b9 f0 breq .+46 ; 0x2662e <__vector_14+0x82> buttonBlanking.start(); 26600: 8f ed ldi r24, 0xDF ; 223 26602: 95 e0 ldi r25, 0x05 ; 5 26604: 0f 94 ad 29 call 0x2535a ; 0x2535a ::start()> safetyTimer.start(); 26608: 8a ed ldi r24, 0xDA ; 218 2660a: 95 e0 ldi r25, 0x05 ; 5 2660c: 0f 94 ef 2b call 0x257de ; 0x257de ::start()> if ((lcd_button_pressed == 0) && (lcd_long_press_active == 0)) 26610: 80 91 d9 05 lds r24, 0x05D9 ; 0x8005d9 26614: 81 11 cpse r24, r1 26616: a5 c0 rjmp .+330 ; 0x26762 <__vector_14+0x1b6> 26618: 80 91 d8 05 lds r24, 0x05D8 ; 0x8005d8 2661c: 81 11 cpse r24, r1 2661e: a1 c0 rjmp .+322 ; 0x26762 <__vector_14+0x1b6> { longPressTimer.start(); 26620: 85 ed ldi r24, 0xD5 ; 213 26622: 95 e0 ldi r25, 0x05 ; 5 26624: 0f 94 ad 29 call 0x2535a ; 0x2535a ::start()> lcd_button_pressed = 1; 26628: 81 e0 ldi r24, 0x01 ; 1 2662a: 80 93 d9 05 sts 0x05D9, r24 ; 0x8005d9 -2, 1, -1, 0, }; static uint8_t enc_bits_old = 0; uint8_t enc_bits = 0; if (!READ(BTN_EN1)) enc_bits |= _BV(0); 2662e: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 26632: 82 fb bst r24, 2 26634: 88 27 eor r24, r24 26636: 80 f9 bld r24, 0 26638: 91 e0 ldi r25, 0x01 ; 1 2663a: 89 27 eor r24, r25 if (!READ(BTN_EN2)) enc_bits |= _BV(1); 2663c: 90 91 03 01 lds r25, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 26640: 91 ff sbrs r25, 1 26642: 82 60 ori r24, 0x02 ; 2 if (enc_bits != enc_bits_old) 26644: e0 91 d2 05 lds r30, 0x05D2 ; 0x8005d2 26648: e8 17 cp r30, r24 2664a: e1 f0 breq .+56 ; 0x26684 <__vector_14+0xd8> { int8_t newDiff = pgm_read_byte(&encrot_table[(enc_bits_old << 2) | enc_bits]); 2664c: 24 e0 ldi r18, 0x04 ; 4 2664e: e2 9f mul r30, r18 26650: f0 01 movw r30, r0 26652: 11 24 eor r1, r1 26654: e8 2b or r30, r24 26656: e7 58 subi r30, 0x87 ; 135 26658: f1 46 sbci r31, 0x61 ; 97 2665a: e4 91 lpm r30, Z lcd_encoder_diff += newDiff; 2665c: 90 91 d1 05 lds r25, 0x05D1 ; 0x8005d1 <_ZL16lcd_encoder_diff.lto_priv.539> 26660: e9 0f add r30, r25 26662: e0 93 d1 05 sts 0x05D1, r30 ; 0x8005d1 <_ZL16lcd_encoder_diff.lto_priv.539> if (abs(lcd_encoder_diff) >= ENCODER_PULSES_PER_STEP) { 26666: 0e 2e mov r0, r30 26668: 00 0c add r0, r0 2666a: ff 0b sbc r31, r31 2666c: f7 ff sbrs r31, 7 2666e: 03 c0 rjmp .+6 ; 0x26676 <__vector_14+0xca> 26670: f1 95 neg r31 26672: e1 95 neg r30 26674: f1 09 sbc r31, r1 26676: 34 97 sbiw r30, 0x04 ; 4 26678: 1c f0 brlt .+6 ; 0x26680 <__vector_14+0xd4> lcd_backlight_wake_trigger = true; // flag event, knob rotated 2667a: 91 e0 ldi r25, 0x01 ; 1 2667c: 90 93 d3 05 sts 0x05D3, r25 ; 0x8005d3 <_ZL26lcd_backlight_wake_trigger.lto_priv.538> } enc_bits_old = enc_bits; 26680: 80 93 d2 05 sts 0x05D2, r24 ; 0x8005d2 #ifndef SLOW_PWM_HEATERS /* * standard PWM modulation */ if (pwm_count == 0) 26684: 80 91 a4 02 lds r24, 0x02A4 ; 0x8002a4 26688: 81 11 cpse r24, r1 2668a: 08 c0 rjmp .+16 ; 0x2669c <__vector_14+0xf0> { soft_pwm_0 = soft_pwm[0]; 2668c: 80 91 16 05 lds r24, 0x0516 ; 0x800516 <_ZL8soft_pwm.lto_priv.459> 26690: 80 93 e8 05 sts 0x05E8, r24 ; 0x8005e8 if(soft_pwm_0 > 0) 26694: 88 23 and r24, r24 26696: 09 f4 brne .+2 ; 0x2669a <__vector_14+0xee> 26698: 87 c0 rjmp .+270 ; 0x267a8 <__vector_14+0x1fc> { WRITE(HEATER_0_PIN,1); 2669a: 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) 2669c: 80 91 a4 02 lds r24, 0x02A4 ; 0x8002a4 266a0: 8f 70 andi r24, 0x0F ; 15 266a2: a9 f4 brne .+42 ; 0x266ce <__vector_14+0x122> { soft_pwm_fan = fanSpeedSoftPwm / (1 << (8 - FAN_SOFT_PWM_BITS)); 266a4: 80 91 a6 04 lds r24, 0x04A6 ; 0x8004a6 266a8: 90 e0 ldi r25, 0x00 ; 0 266aa: 24 e0 ldi r18, 0x04 ; 4 266ac: 95 95 asr r25 266ae: 87 95 ror r24 266b0: 2a 95 dec r18 266b2: e1 f7 brne .-8 ; 0x266ac <__vector_14+0x100> 266b4: 80 93 a5 04 sts 0x04A5, r24 ; 0x8004a5 <_ZL12soft_pwm_fan.lto_priv.460> if(soft_pwm_fan > 0) WRITE(FAN_PIN,1); else WRITE(FAN_PIN,0); 266b8: 89 2b or r24, r25 266ba: 09 f4 brne .+2 ; 0x266be <__vector_14+0x112> 266bc: 77 c0 rjmp .+238 ; 0x267ac <__vector_14+0x200> 266be: 9f b7 in r25, 0x3f ; 63 266c0: f8 94 cli 266c2: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 266c6: 88 60 ori r24, 0x08 ; 8 266c8: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 266cc: 9f bf out 0x3f, r25 ; 63 } #endif if(soft_pwm_0 < pwm_count) 266ce: 90 91 e8 05 lds r25, 0x05E8 ; 0x8005e8 266d2: 80 91 a4 02 lds r24, 0x02A4 ; 0x8002a4 266d6: 98 17 cp r25, r24 266d8: 08 f4 brcc .+2 ; 0x266dc <__vector_14+0x130> { WRITE(HEATER_0_PIN,0); 266da: 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); 266dc: 80 91 a4 02 lds r24, 0x02A4 ; 0x8002a4 266e0: 8f 70 andi r24, 0x0F ; 15 266e2: 90 91 a5 04 lds r25, 0x04A5 ; 0x8004a5 <_ZL12soft_pwm_fan.lto_priv.460> 266e6: 98 17 cp r25, r24 266e8: 40 f4 brcc .+16 ; 0x266fa <__vector_14+0x14e> 266ea: 9f b7 in r25, 0x3f ; 63 266ec: f8 94 cli 266ee: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 266f2: 87 7f andi r24, 0xF7 ; 247 266f4: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 266f8: 9f bf out 0x3f, r25 ; 63 #endif pwm_count += (1 << SOFT_PWM_SCALE); 266fa: 80 91 a4 02 lds r24, 0x02A4 ; 0x8002a4 266fe: 8f 5f subi r24, 0xFF ; 255 pwm_count &= 0x7f; 26700: 8f 77 andi r24, 0x7F ; 127 26702: 80 93 a4 02 sts 0x02A4, r24 ; 0x8002a4 26706: 10 e0 ldi r17, 0x00 ; 0 26708: 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 2670a: e8 01 movw r28, r16 2670c: cc 0f add r28, r28 2670e: dd 1f adc r29, r29 26710: c7 59 subi r28, 0x97 ; 151 26712: d9 4f sbci r29, 0xF9 ; 249 26714: 88 81 ld r24, Y 26716: 99 81 ldd r25, Y+1 ; 0x01 if(curTodo>0) 26718: 18 16 cp r1, r24 2671a: 19 06 cpc r1, r25 2671c: 0c f0 brlt .+2 ; 0x26720 <__vector_14+0x174> 2671e: 4c c0 rjmp .+152 ; 0x267b8 <__vector_14+0x20c> { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 26720: ff b6 in r15, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 26722: f8 94 cli babystep(axis,/*fwd*/true); 26724: 61 e0 ldi r22, 0x01 ; 1 26726: 80 2f mov r24, r16 26728: 0f 94 a4 13 call 0x22748 ; 0x22748 babystepsTodo[axis]--; //less to do next time 2672c: 88 81 ld r24, Y 2672e: 99 81 ldd r25, Y+1 ; 0x01 26730: 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 26732: 99 83 std Y+1, r25 ; 0x01 26734: 88 83 st Y, r24 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 26736: ff be out 0x3f, r15 ; 63 __asm__ volatile ("" ::: "memory"); 26738: 0f 5f subi r16, 0xFF ; 255 2673a: 1f 4f sbci r17, 0xFF ; 255 } #endif #ifdef BABYSTEPPING FORCE_INLINE static void applyBabysteps() { for(uint8_t axis=0;axis<3;axis++) 2673c: 03 30 cpi r16, 0x03 ; 3 2673e: 11 05 cpc r17, r1 26740: 21 f7 brne .-56 ; 0x2670a <__vector_14+0x15e> #ifdef BABYSTEPPING applyBabysteps(); #endif //BABYSTEPPING // Check if a stack overflow happened if (!SdFatUtil::test_stack_integrity()) stack_error(); 26742: 80 91 40 18 lds r24, 0x1840 ; 0x801840 <__bss_end+0x20> 26746: 90 91 41 18 lds r25, 0x1841 ; 0x801841 <__bss_end+0x21> 2674a: a0 91 42 18 lds r26, 0x1842 ; 0x801842 <__bss_end+0x22> 2674e: b0 91 43 18 lds r27, 0x1843 ; 0x801843 <__bss_end+0x23> 26752: 82 3a cpi r24, 0xA2 ; 162 26754: 92 4a sbci r25, 0xA2 ; 162 26756: a1 05 cpc r26, r1 26758: b1 05 cpc r27, r1 2675a: d9 f1 breq .+118 ; 0x267d2 <__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); 2675c: 81 e0 ldi r24, 0x01 ; 1 2675e: 0e 94 58 67 call 0xceb0 ; 0xceb0 if ((lcd_button_pressed == 0) && (lcd_long_press_active == 0)) { longPressTimer.start(); lcd_button_pressed = 1; } else if (longPressTimer.expired(LONG_PRESS_TIME)) 26762: 68 ee ldi r22, 0xE8 ; 232 26764: 73 e0 ldi r23, 0x03 ; 3 26766: 85 ed ldi r24, 0xD5 ; 213 26768: 95 e0 ldi r25, 0x05 ; 5 2676a: 0f 94 7e 29 call 0x252fc ; 0x252fc ::expired(unsigned short)> 2676e: 88 23 and r24, r24 26770: 09 f4 brne .+2 ; 0x26774 <__vector_14+0x1c8> 26772: 5d cf rjmp .-326 ; 0x2662e <__vector_14+0x82> { lcd_long_press_active = 1; 26774: 81 e0 ldi r24, 0x01 ; 1 26776: 80 93 d8 05 sts 0x05D8, r24 ; 0x8005d8 lcd_longpress_trigger = 1; 2677a: 80 93 d4 05 sts 0x05D4, r24 ; 0x8005d4 2677e: 57 cf rjmp .-338 ; 0x2662e <__vector_14+0x82> } } } else { //button not pressed if (lcd_button_pressed) 26780: 80 91 d9 05 lds r24, 0x05D9 ; 0x8005d9 26784: 88 23 and r24, r24 26786: 09 f4 brne .+2 ; 0x2678a <__vector_14+0x1de> 26788: 52 cf rjmp .-348 ; 0x2662e <__vector_14+0x82> { //button was released lcd_button_pressed = 0; // Reset to prevent double triggering 2678a: 10 92 d9 05 sts 0x05D9, r1 ; 0x8005d9 if (!lcd_long_press_active) 2678e: 80 91 d8 05 lds r24, 0x05D8 ; 0x8005d8 26792: 81 11 cpse r24, r1 26794: 03 c0 rjmp .+6 ; 0x2679c <__vector_14+0x1f0> { //button released before long press gets activated lcd_click_trigger = 1; // This flag is reset when the event is consumed 26796: 81 e0 ldi r24, 0x01 ; 1 26798: 80 93 a8 03 sts 0x03A8, r24 ; 0x8003a8 } lcd_backlight_wake_trigger = true; // flag event, knob pressed 2679c: 81 e0 ldi r24, 0x01 ; 1 2679e: 80 93 d3 05 sts 0x05D3, r24 ; 0x8005d3 <_ZL26lcd_backlight_wake_trigger.lto_priv.538> lcd_long_press_active = 0; 267a2: 10 92 d8 05 sts 0x05D8, r1 ; 0x8005d8 267a6: 43 cf rjmp .-378 ; 0x2662e <__vector_14+0x82> { WRITE(HEATER_0_PIN,1); #ifdef HEATERS_PARALLEL WRITE(HEATER_1_PIN,1); #endif } else WRITE(HEATER_0_PIN,0); 267a8: 75 98 cbi 0x0e, 5 ; 14 267aa: 78 cf rjmp .-272 ; 0x2669c <__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); 267ac: 9f b7 in r25, 0x3f ; 63 267ae: f8 94 cli 267b0: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 267b4: 87 7f andi r24, 0xF7 ; 247 267b6: 88 cf rjmp .-240 ; 0x266c8 <__vector_14+0x11c> babystep(axis,/*fwd*/true); babystepsTodo[axis]--; //less to do next time } } else if(curTodo<0) 267b8: 89 2b or r24, r25 267ba: 09 f4 brne .+2 ; 0x267be <__vector_14+0x212> 267bc: bd cf rjmp .-134 ; 0x26738 <__vector_14+0x18c> { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 267be: ff b6 in r15, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 267c0: f8 94 cli babystep(axis,/*fwd*/false); 267c2: 60 e0 ldi r22, 0x00 ; 0 267c4: 80 2f mov r24, r16 267c6: 0f 94 a4 13 call 0x22748 ; 0x22748 babystepsTodo[axis]++; //less to do next time 267ca: 88 81 ld r24, Y 267cc: 99 81 ldd r25, Y+1 ; 0x01 267ce: 01 96 adiw r24, 0x01 ; 1 267d0: b0 cf rjmp .-160 ; 0x26732 <__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]) { 267d2: 9c b1 in r25, 0x0c ; 12 267d4: 80 91 e6 05 lds r24, 0x05E6 ; 0x8005e6 267d8: 96 fb bst r25, 6 267da: 99 27 eor r25, r25 267dc: 90 f9 bld r25, 0 267de: 98 17 cp r25, r24 267e0: 91 f0 breq .+36 ; 0x26806 <__vector_14+0x25a> if(fan_measuring) fan_edge_counter[0] ++; 267e2: 90 91 6f 06 lds r25, 0x066F ; 0x80066f 267e6: 99 23 and r25, r25 267e8: 51 f0 breq .+20 ; 0x267fe <__vector_14+0x252> 267ea: 20 91 e2 05 lds r18, 0x05E2 ; 0x8005e2 267ee: 30 91 e3 05 lds r19, 0x05E3 ; 0x8005e3 267f2: 2f 5f subi r18, 0xFF ; 255 267f4: 3f 4f sbci r19, 0xFF ; 255 267f6: 30 93 e3 05 sts 0x05E3, r19 ; 0x8005e3 267fa: 20 93 e2 05 sts 0x05E2, r18 ; 0x8005e2 fan_state[0] = !fan_state[0]; 267fe: 91 e0 ldi r25, 0x01 ; 1 26800: 89 27 eor r24, r25 26802: 80 93 e6 05 sts 0x05E6, r24 ; 0x8005e6 (void)__s; } static __inline__ void __iCliParam(const uint8_t *__s) { cli(); 26806: f8 94 cli { DISABLE_SOFT_PWM_INTERRUPT(); NONATOMIC_BLOCK(NONATOMIC_FORCEOFF) { soft_pwm_isr(); } ENABLE_SOFT_PWM_INTERRUPT(); 26808: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 2680c: 84 60 ori r24, 0x04 ; 4 2680e: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> } 26812: ff 91 pop r31 26814: ef 91 pop r30 26816: df 91 pop r29 26818: cf 91 pop r28 2681a: bf 91 pop r27 2681c: af 91 pop r26 2681e: 9f 91 pop r25 26820: 8f 91 pop r24 26822: 7f 91 pop r23 26824: 6f 91 pop r22 26826: 5f 91 pop r21 26828: 4f 91 pop r20 2682a: 3f 91 pop r19 2682c: 2f 91 pop r18 2682e: 1f 91 pop r17 26830: 0f 91 pop r16 26832: ff 90 pop r15 26834: 0f 90 pop r0 26836: 0b be out 0x3b, r0 ; 59 26838: 0f 90 pop r0 2683a: 0f be out 0x3f, r0 ; 63 2683c: 0f 90 pop r0 2683e: 1f 90 pop r1 26840: 18 95 reti 00026842 : #endif } #ifdef AMBIENT_THERMISTOR static float analog2tempAmbient(int raw) { 26842: 4f 92 push r4 26844: 5f 92 push r5 26846: 6f 92 push r6 26848: 7f 92 push r7 2684a: af 92 push r10 2684c: bf 92 push r11 2684e: cf 92 push r12 26850: df 92 push r13 26852: ef 92 push r14 26854: ff 92 push r15 26856: 0f 93 push r16 26858: 1f 93 push r17 2685a: cf 93 push r28 2685c: df 93 push r29 2685e: 24 e0 ldi r18, 0x04 ; 4 26860: 30 e0 ldi r19, 0x00 ; 0 26862: 41 e0 ldi r20, 0x01 ; 1 26864: 50 e0 ldi r21, 0x00 ; 0 26866: d9 01 movw r26, r18 26868: a5 5f subi r26, 0xF5 ; 245 2686a: b2 46 sbci r27, 0x62 ; 98 float celsius = 0; byte i; for (i=1; i raw) 2686c: fd 01 movw r30, r26 2686e: 65 91 lpm r22, Z+ 26870: 74 91 lpm r23, Z 26872: 86 17 cp r24, r22 26874: 97 07 cpc r25, r23 26876: 0c f0 brlt .+2 ; 0x2687a 26878: 66 c0 rjmp .+204 ; 0x26946 { celsius = PGM_RD_W(AMBIENTTEMPTABLE[i-1][1]) + 2687a: 41 50 subi r20, 0x01 ; 1 2687c: 51 09 sbc r21, r1 2687e: 44 0f add r20, r20 26880: 55 1f adc r21, r21 26882: 44 0f add r20, r20 26884: 55 1f adc r21, r21 26886: ea 01 movw r28, r20 26888: c3 5f subi r28, 0xF3 ; 243 2688a: d2 46 sbci r29, 0x62 ; 98 2688c: fe 01 movw r30, r28 2688e: 05 91 lpm r16, Z+ 26890: 14 91 lpm r17, Z (raw - PGM_RD_W(AMBIENTTEMPTABLE[i-1][0])) * 26892: 45 5f subi r20, 0xF5 ; 245 26894: 52 46 sbci r21, 0x62 ; 98 26896: fa 01 movw r30, r20 26898: 65 91 lpm r22, Z+ 2689a: 74 91 lpm r23, Z (float)(PGM_RD_W(AMBIENTTEMPTABLE[i][1]) - PGM_RD_W(AMBIENTTEMPTABLE[i-1][1])) / 2689c: f9 01 movw r30, r18 2689e: e3 5f subi r30, 0xF3 ; 243 268a0: f2 46 sbci r31, 0x62 ; 98 268a2: e5 90 lpm r14, Z+ 268a4: f4 90 lpm r15, Z 268a6: fe 01 movw r30, r28 268a8: c5 90 lpm r12, Z+ 268aa: d4 90 lpm r13, Z (float)(PGM_RD_W(AMBIENTTEMPTABLE[i][0]) - PGM_RD_W(AMBIENTTEMPTABLE[i-1][0])); 268ac: fd 01 movw r30, r26 268ae: c5 91 lpm r28, Z+ 268b0: d4 91 lpm r29, Z 268b2: fa 01 movw r30, r20 268b4: a5 90 lpm r10, Z+ 268b6: 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])) * 268b8: 86 1b sub r24, r22 268ba: 97 0b sbc r25, r23 268bc: bc 01 movw r22, r24 268be: 99 0f add r25, r25 268c0: 88 0b sbc r24, r24 268c2: 99 0b sbc r25, r25 268c4: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 268c8: 2b 01 movw r4, r22 268ca: 3c 01 movw r6, r24 (float)(PGM_RD_W(AMBIENTTEMPTABLE[i][1]) - PGM_RD_W(AMBIENTTEMPTABLE[i-1][1])) / 268cc: b7 01 movw r22, r14 268ce: 6c 19 sub r22, r12 268d0: 7d 09 sbc r23, r13 268d2: 07 2e mov r0, r23 268d4: 00 0c add r0, r0 268d6: 88 0b sbc r24, r24 268d8: 99 0b sbc r25, r25 268da: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 268de: 9b 01 movw r18, r22 268e0: 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])) * 268e2: c3 01 movw r24, r6 268e4: b2 01 movw r22, r4 268e6: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 268ea: 6b 01 movw r12, r22 268ec: 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])); 268ee: be 01 movw r22, r28 268f0: 6a 19 sub r22, r10 268f2: 7b 09 sbc r23, r11 268f4: 07 2e mov r0, r23 268f6: 00 0c add r0, r0 268f8: 88 0b sbc r24, r24 268fa: 99 0b sbc r25, r25 268fc: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 26900: 9b 01 movw r18, r22 26902: 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])) / 26904: c7 01 movw r24, r14 26906: b6 01 movw r22, r12 26908: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 2690c: 6b 01 movw r12, r22 2690e: 7c 01 movw r14, r24 for (i=1; i raw) { celsius = PGM_RD_W(AMBIENTTEMPTABLE[i-1][1]) + 26910: b8 01 movw r22, r16 26912: 11 0f add r17, r17 26914: 88 0b sbc r24, r24 26916: 99 0b sbc r25, r25 26918: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 2691c: 9b 01 movw r18, r22 2691e: ac 01 movw r20, r24 26920: c7 01 movw r24, r14 26922: b6 01 movw r22, r12 26924: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> } } // Overflow: Set to last value in the table if (i == AMBIENTTEMPTABLE_LEN) celsius = PGM_RD_W(AMBIENTTEMPTABLE[i-1][1]); return celsius; } 26928: df 91 pop r29 2692a: cf 91 pop r28 2692c: 1f 91 pop r17 2692e: 0f 91 pop r16 26930: ff 90 pop r15 26932: ef 90 pop r14 26934: df 90 pop r13 26936: cf 90 pop r12 26938: bf 90 pop r11 2693a: af 90 pop r10 2693c: 7f 90 pop r7 2693e: 6f 90 pop r6 26940: 5f 90 pop r5 26942: 4f 90 pop r4 26944: 08 95 ret 26946: 4f 5f subi r20, 0xFF ; 255 26948: 5f 4f sbci r21, 0xFF ; 255 2694a: 2c 5f subi r18, 0xFC ; 252 2694c: 3f 4f sbci r19, 0xFF ; 255 static float analog2tempAmbient(int raw) { float celsius = 0; byte i; for (i=1; i 26954: 88 cf rjmp .-240 ; 0x26866 (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]); 26956: e1 e9 ldi r30, 0x91 ; 145 26958: fd e9 ldi r31, 0x9D ; 157 2695a: 65 91 lpm r22, Z+ 2695c: 74 91 lpm r23, Z 2695e: 07 2e mov r0, r23 26960: 00 0c add r0, r0 26962: 88 0b sbc r24, r24 26964: 99 0b sbc r25, r25 26966: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 2696a: de cf rjmp .-68 ; 0x26928 0002696c : 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) { 2696c: 4f 92 push r4 2696e: 5f 92 push r5 26970: 6f 92 push r6 26972: 7f 92 push r7 26974: af 92 push r10 26976: bf 92 push r11 26978: cf 92 push r12 2697a: df 92 push r13 2697c: ef 92 push r14 2697e: ff 92 push r15 26980: 0f 93 push r16 26982: 1f 93 push r17 26984: cf 93 push r28 26986: df 93 push r29 26988: 24 e0 ldi r18, 0x04 ; 4 2698a: 30 e0 ldi r19, 0x00 ; 0 2698c: 41 e0 ldi r20, 0x01 ; 1 2698e: 50 e0 ldi r21, 0x00 ; 0 26990: d9 01 movw r26, r18 26992: a9 5e subi r26, 0xE9 ; 233 26994: b3 46 sbci r27, 0x63 ; 99 float celsius = 0; byte i; for (i=1; i raw) 26996: fd 01 movw r30, r26 26998: 65 91 lpm r22, Z+ 2699a: 74 91 lpm r23, Z 2699c: 86 17 cp r24, r22 2699e: 97 07 cpc r25, r23 269a0: 0c f0 brlt .+2 ; 0x269a4 269a2: 80 c0 rjmp .+256 ; 0x26aa4 { celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]) + 269a4: 41 50 subi r20, 0x01 ; 1 269a6: 51 09 sbc r21, r1 269a8: 44 0f add r20, r20 269aa: 55 1f adc r21, r21 269ac: 44 0f add r20, r20 269ae: 55 1f adc r21, r21 269b0: 8a 01 movw r16, r20 269b2: 07 5e subi r16, 0xE7 ; 231 269b4: 13 46 sbci r17, 0x63 ; 99 269b6: f8 01 movw r30, r16 269b8: c5 90 lpm r12, Z+ 269ba: d4 90 lpm r13, Z (raw - PGM_RD_W(BEDTEMPTABLE[i-1][0])) * 269bc: 49 5e subi r20, 0xE9 ; 233 269be: 53 46 sbci r21, 0x63 ; 99 269c0: fa 01 movw r30, r20 269c2: 65 91 lpm r22, Z+ 269c4: 74 91 lpm r23, Z (float)(PGM_RD_W(BEDTEMPTABLE[i][1]) - PGM_RD_W(BEDTEMPTABLE[i-1][1])) / 269c6: f9 01 movw r30, r18 269c8: e7 5e subi r30, 0xE7 ; 231 269ca: f3 46 sbci r31, 0x63 ; 99 269cc: c5 91 lpm r28, Z+ 269ce: d4 91 lpm r29, Z 269d0: f8 01 movw r30, r16 269d2: 05 91 lpm r16, Z+ 269d4: 14 91 lpm r17, Z (float)(PGM_RD_W(BEDTEMPTABLE[i][0]) - PGM_RD_W(BEDTEMPTABLE[i-1][0])); 269d6: fd 01 movw r30, r26 269d8: e5 90 lpm r14, Z+ 269da: f4 90 lpm r15, Z 269dc: fa 01 movw r30, r20 269de: a5 90 lpm r10, Z+ 269e0: 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])) * 269e2: 86 1b sub r24, r22 269e4: 97 0b sbc r25, r23 269e6: bc 01 movw r22, r24 269e8: 99 0f add r25, r25 269ea: 88 0b sbc r24, r24 269ec: 99 0b sbc r25, r25 269ee: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 269f2: 2b 01 movw r4, r22 269f4: 3c 01 movw r6, r24 (float)(PGM_RD_W(BEDTEMPTABLE[i][1]) - PGM_RD_W(BEDTEMPTABLE[i-1][1])) / 269f6: be 01 movw r22, r28 269f8: 60 1b sub r22, r16 269fa: 71 0b sbc r23, r17 269fc: 07 2e mov r0, r23 269fe: 00 0c add r0, r0 26a00: 88 0b sbc r24, r24 26a02: 99 0b sbc r25, r25 26a04: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 26a08: 9b 01 movw r18, r22 26a0a: 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])) * 26a0c: c3 01 movw r24, r6 26a0e: b2 01 movw r22, r4 26a10: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 26a14: 2b 01 movw r4, r22 26a16: 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])); 26a18: b7 01 movw r22, r14 26a1a: 6a 19 sub r22, r10 26a1c: 7b 09 sbc r23, r11 26a1e: 07 2e mov r0, r23 26a20: 00 0c add r0, r0 26a22: 88 0b sbc r24, r24 26a24: 99 0b sbc r25, r25 26a26: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 26a2a: 9b 01 movw r18, r22 26a2c: 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])) / 26a2e: c3 01 movw r24, r6 26a30: b2 01 movw r22, r4 26a32: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 26a36: 2b 01 movw r4, r22 26a38: 3c 01 movw r6, r24 for (i=1; i raw) { celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]) + 26a3a: b6 01 movw r22, r12 26a3c: dd 0c add r13, r13 26a3e: 88 0b sbc r24, r24 26a40: 99 0b sbc r25, r25 26a42: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 26a46: 9b 01 movw r18, r22 26a48: ac 01 movw r20, r24 26a4a: c3 01 movw r24, r6 26a4c: b2 01 movw r22, r4 26a4e: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> break; } } // Overflow: Set to last value in the table if (i == BEDTEMPTABLE_LEN) celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]); 26a52: 6b 01 movw r12, r22 26a54: 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) 26a56: 20 e0 ldi r18, 0x00 ; 0 26a58: 30 e0 ldi r19, 0x00 ; 0 26a5a: 40 e2 ldi r20, 0x20 ; 32 26a5c: 52 e4 ldi r21, 0x42 ; 66 26a5e: c7 01 movw r24, r14 26a60: b6 01 movw r22, r12 26a62: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 26a66: 87 fd sbrc r24, 7 26a68: 30 c0 rjmp .+96 ; 0x26aca 26a6a: 20 e0 ldi r18, 0x00 ; 0 26a6c: 30 e0 ldi r19, 0x00 ; 0 26a6e: 48 e4 ldi r20, 0x48 ; 72 26a70: 52 e4 ldi r21, 0x42 ; 66 26a72: c7 01 movw r24, r14 26a74: b6 01 movw r22, r12 26a76: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 26a7a: 18 16 cp r1, r24 26a7c: 34 f1 brlt .+76 ; 0x26aca { celsius = celsius + (_first_koef * (celsius - _offset_start)); 26a7e: 20 e0 ldi r18, 0x00 ; 0 26a80: 30 e0 ldi r19, 0x00 ; 0 26a82: 40 e2 ldi r20, 0x20 ; 32 26a84: 52 e4 ldi r21, 0x42 ; 66 26a86: c7 01 movw r24, r14 26a88: b6 01 movw r22, r12 26a8a: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 26a8e: 20 e0 ldi r18, 0x00 ; 0 26a90: 30 e0 ldi r19, 0x00 ; 0 26a92: 40 e0 ldi r20, 0x00 ; 0 26a94: 5f e3 ldi r21, 0x3F ; 63 26a96: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 26a9a: 9b 01 movw r18, r22 26a9c: 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; 26a9e: c7 01 movw r24, r14 26aa0: b6 01 movw r22, r12 26aa2: 43 c0 rjmp .+134 ; 0x26b2a 26aa4: 4f 5f subi r20, 0xFF ; 255 26aa6: 5f 4f sbci r21, 0xFF ; 255 26aa8: 2c 5f subi r18, 0xFC ; 252 26aaa: 3f 4f sbci r19, 0xFF ; 255 static float analog2tempBed(int raw) { #ifdef BED_USES_THERMISTOR float celsius = 0; byte i; for (i=1; i 26ab2: 6e cf rjmp .-292 ; 0x26990 break; } } // Overflow: Set to last value in the table if (i == BEDTEMPTABLE_LEN) celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]); 26ab4: e9 e0 ldi r30, 0x09 ; 9 26ab6: fd e9 ldi r31, 0x9D ; 157 26ab8: 65 91 lpm r22, Z+ 26aba: 74 91 lpm r23, Z 26abc: 07 2e mov r0, r23 26abe: 00 0c add r0, r0 26ac0: 88 0b sbc r24, r24 26ac2: 99 0b sbc r25, r25 26ac4: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 26ac8: c4 cf rjmp .-120 ; 0x26a52 if (celsius >= _offset_start && celsius <= _offset_center) { celsius = celsius + (_first_koef * (celsius - _offset_start)); } else if (celsius > _offset_center && celsius <= 100) 26aca: 20 e0 ldi r18, 0x00 ; 0 26acc: 30 e0 ldi r19, 0x00 ; 0 26ace: 48 e4 ldi r20, 0x48 ; 72 26ad0: 52 e4 ldi r21, 0x42 ; 66 26ad2: c7 01 movw r24, r14 26ad4: b6 01 movw r22, r12 26ad6: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 26ada: 18 16 cp r1, r24 26adc: dc f5 brge .+118 ; 0x26b54 26ade: 20 e0 ldi r18, 0x00 ; 0 26ae0: 30 e0 ldi r19, 0x00 ; 0 26ae2: 48 ec ldi r20, 0xC8 ; 200 26ae4: 52 e4 ldi r21, 0x42 ; 66 26ae6: c7 01 movw r24, r14 26ae8: b6 01 movw r22, r12 26aea: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 26aee: 18 16 cp r1, r24 26af0: 8c f1 brlt .+98 ; 0x26b54 { celsius = celsius + (_first_koef * (_offset_center - _offset_start)) + ( _second_koef * ( celsius - ( 100 - _offset_center ) )) ; 26af2: 20 e0 ldi r18, 0x00 ; 0 26af4: 30 e0 ldi r19, 0x00 ; 0 26af6: 40 ea ldi r20, 0xA0 ; 160 26af8: 50 e4 ldi r21, 0x40 ; 64 26afa: c7 01 movw r24, r14 26afc: b6 01 movw r22, r12 26afe: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 26b02: 2b 01 movw r4, r22 26b04: 3c 01 movw r6, r24 26b06: 20 e0 ldi r18, 0x00 ; 0 26b08: 30 e0 ldi r19, 0x00 ; 0 26b0a: 48 e4 ldi r20, 0x48 ; 72 26b0c: 52 e4 ldi r21, 0x42 ; 66 26b0e: c7 01 movw r24, r14 26b10: b6 01 movw r22, r12 26b12: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 26b16: 2d ec ldi r18, 0xCD ; 205 26b18: 3c ec ldi r19, 0xCC ; 204 26b1a: 4c ec ldi r20, 0xCC ; 204 26b1c: 5d e3 ldi r21, 0x3D ; 61 26b1e: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 26b22: 9b 01 movw r18, r22 26b24: ac 01 movw r20, r24 26b26: c3 01 movw r24, r6 26b28: b2 01 movw r22, r4 } else if (celsius > 100) { celsius = celsius + _offset; 26b2a: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 26b2e: 6b 01 movw r12, r22 26b30: 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 } 26b32: c7 01 movw r24, r14 26b34: b6 01 movw r22, r12 26b36: df 91 pop r29 26b38: cf 91 pop r28 26b3a: 1f 91 pop r17 26b3c: 0f 91 pop r16 26b3e: ff 90 pop r15 26b40: ef 90 pop r14 26b42: df 90 pop r13 26b44: cf 90 pop r12 26b46: bf 90 pop r11 26b48: af 90 pop r10 26b4a: 7f 90 pop r7 26b4c: 6f 90 pop r6 26b4e: 5f 90 pop r5 26b50: 4f 90 pop r4 26b52: 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) 26b54: 20 e0 ldi r18, 0x00 ; 0 26b56: 30 e0 ldi r19, 0x00 ; 0 26b58: 48 ec ldi r20, 0xC8 ; 200 26b5a: 52 e4 ldi r21, 0x42 ; 66 26b5c: c7 01 movw r24, r14 26b5e: b6 01 movw r22, r12 26b60: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 26b64: 18 16 cp r1, r24 26b66: 2c f7 brge .-54 ; 0x26b32 { celsius = celsius + _offset; 26b68: 20 e0 ldi r18, 0x00 ; 0 26b6a: 30 e0 ldi r19, 0x00 ; 0 26b6c: 40 e2 ldi r20, 0x20 ; 32 26b6e: 51 e4 ldi r21, 0x41 ; 65 26b70: 96 cf rjmp .-212 ; 0x26a9e 00026b72 : } static void check_temp_raw(); static void temp_mgr_isr() { 26b72: 4f 92 push r4 26b74: 5f 92 push r5 26b76: 6f 92 push r6 26b78: 7f 92 push r7 26b7a: af 92 push r10 26b7c: cf 92 push r12 26b7e: df 92 push r13 26b80: ef 92 push r14 26b82: ff 92 push r15 26b84: 0f 93 push r16 26b86: 1f 93 push r17 26b88: cf 93 push r28 26b8a: 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 26b90: 90 91 0c 06 lds r25, 0x060C ; 0x80060c 26b94: 0f 94 1c a1 call 0x34238 ; 0x34238 26b98: 60 93 17 05 sts 0x0517, r22 ; 0x800517 26b9c: 70 93 18 05 sts 0x0518, r23 ; 0x800518 26ba0: 80 93 19 05 sts 0x0519, r24 ; 0x800519 26ba4: 90 93 1a 05 sts 0x051A, r25 ; 0x80051a current_temperature_bed_isr = analog2tempBed(current_temperature_bed_raw); 26ba8: 60 90 09 06 lds r6, 0x0609 ; 0x800609 26bac: 70 90 0a 06 lds r7, 0x060A ; 0x80060a 26bb0: c3 01 movw r24, r6 26bb2: 0f 94 b6 34 call 0x2696c ; 0x2696c 26bb6: 6b 01 movw r12, r22 26bb8: 7c 01 movw r14, r24 26bba: c0 92 19 06 sts 0x0619, r12 ; 0x800619 26bbe: d0 92 1a 06 sts 0x061A, r13 ; 0x80061a 26bc2: e0 92 1b 06 sts 0x061B, r14 ; 0x80061b 26bc6: f0 92 1c 06 sts 0x061C, r15 ; 0x80061c #ifdef PINDA_THERMISTOR current_temperature_pinda_isr = analog2tempBed(current_temperature_raw_pinda); 26bca: 80 91 07 06 lds r24, 0x0607 ; 0x800607 26bce: 90 91 08 06 lds r25, 0x0608 ; 0x800608 26bd2: 0f 94 b6 34 call 0x2696c ; 0x2696c 26bd6: 60 93 03 06 sts 0x0603, r22 ; 0x800603 26bda: 70 93 04 06 sts 0x0604, r23 ; 0x800604 26bde: 80 93 05 06 sts 0x0605, r24 ; 0x800605 26be2: 90 93 06 06 sts 0x0606, r25 ; 0x800606 #endif #ifdef AMBIENT_THERMISTOR current_temperature_ambient_isr = analog2tempAmbient(current_temperature_raw_ambient); //thermistor for ambient is NTCG104LH104JT1 (2000) 26be6: c0 91 15 06 lds r28, 0x0615 ; 0x800615 26bea: d0 91 16 06 lds r29, 0x0616 ; 0x800616 26bee: ce 01 movw r24, r28 26bf0: 0f 94 21 34 call 0x26842 ; 0x26842 26bf4: 60 93 20 06 sts 0x0620, r22 ; 0x800620 26bf8: 70 93 21 06 sts 0x0621, r23 ; 0x800621 26bfc: 80 93 22 06 sts 0x0622, r24 ; 0x800622 26c00: 90 93 23 06 sts 0x0623, r25 ; 0x800623 #endif temp_meas_ready = true; 26c04: 81 e0 ldi r24, 0x01 ; 1 26c06: 80 93 02 06 sts 0x0602, r24 ; 0x800602 { // update *_isr temperatures from raw values for PID regulation setIsrTemperaturesFromRawValues(); // clear the error assertion flag before checking again temp_error_state.assert = false; 26c0a: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 26c0e: 8d 7f andi r24, 0xFD ; 253 26c10: 80 93 1b 05 sts 0x051B, r24 ; 0x80051b <_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]) { 26c14: 20 91 0b 06 lds r18, 0x060B ; 0x80060b 26c18: 30 91 0c 06 lds r19, 0x060C ; 0x80060c 26c1c: 80 91 a1 04 lds r24, 0x04A1 ; 0x8004a1 <_ZL12maxttemp_raw.lto_priv.463> 26c20: 90 91 a2 04 lds r25, 0x04A2 ; 0x8004a2 <_ZL12maxttemp_raw.lto_priv.463+0x1> 26c24: 82 17 cp r24, r18 26c26: 93 07 cpc r25, r19 26c28: 2c f0 brlt .+10 ; 0x26c34 #else if (current_temperature_raw[0] >= maxttemp_raw[0]) { #endif set_temp_error(TempErrorSource::hotend, 0, TempErrorType::max); 26c2a: 40 e0 ldi r20, 0x00 ; 0 26c2c: 60 e0 ldi r22, 0x00 ; 0 26c2e: 80 e0 ldi r24, 0x00 ; 0 26c30: 0f 94 33 2f call 0x25e66 ; 0x25e66 } //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) { 26c34: 80 91 9f 04 lds r24, 0x049F ; 0x80049f <_ZL16bed_maxttemp_raw.lto_priv.464> 26c38: 90 91 a0 04 lds r25, 0x04A0 ; 0x8004a0 <_ZL16bed_maxttemp_raw.lto_priv.464+0x1> 26c3c: 86 15 cp r24, r6 26c3e: 97 05 cpc r25, r7 26c40: 2c f0 brlt .+10 ; 0x26c4c #else if (current_temperature_bed_raw >= bed_maxttemp_raw) { #endif set_temp_error(TempErrorSource::bed, 0, TempErrorType::max); 26c42: 40 e0 ldi r20, 0x00 ; 0 26c44: 60 e0 ldi r22, 0x00 ; 0 26c46: 81 e0 ldi r24, 0x01 ; 1 26c48: 0f 94 33 2f call 0x25e66 ; 0x25e66 } #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) { 26c4c: 80 91 9d 04 lds r24, 0x049D ; 0x80049d <_ZL20ambient_maxttemp_raw.lto_priv.465> 26c50: 90 91 9e 04 lds r25, 0x049E ; 0x80049e <_ZL20ambient_maxttemp_raw.lto_priv.465+0x1> 26c54: 8c 17 cp r24, r28 26c56: 9d 07 cpc r25, r29 26c58: 2c f0 brlt .+10 ; 0x26c64 #else if (current_temperature_raw_ambient >= ambient_maxttemp_raw) { #endif set_temp_error(TempErrorSource::ambient, 0, TempErrorType::max); 26c5a: 40 e0 ldi r20, 0x00 ; 0 26c5c: 60 e0 ldi r22, 0x00 ; 0 26c5e: 82 e0 ldi r24, 0x02 ; 2 26c60: 0f 94 33 2f call 0x25e66 ; 0x25e66 #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) { 26c64: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL20ambient_minttemp_raw.lto_priv.462> 26c68: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL20ambient_minttemp_raw.lto_priv.462+0x1> 26c6c: c8 17 cp r28, r24 26c6e: d9 07 cpc r29, r25 26c70: 2c f0 brlt .+10 ; 0x26c7c #else if (current_temperature_raw_ambient <= ambient_minttemp_raw) { #endif set_temp_error(TempErrorSource::ambient, 0, TempErrorType::min); 26c72: 41 e0 ldi r20, 0x01 ; 1 26c74: 60 e0 ldi r22, 0x00 ; 0 26c76: 82 e0 ldi r24, 0x02 ; 2 26c78: 0f 94 33 2f call 0x25e66 ; 0x25e66 #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 26c7c: c1 3a cpi r28, 0xA1 ; 161 26c7e: de 43 sbci r29, 0x3E ; 62 26c80: 0c f4 brge .+2 ; 0x26c84 26c82: cd c1 rjmp .+922 ; 0x2701e { // 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]) { 26c84: 60 91 a3 04 lds r22, 0x04A3 ; 0x8004a3 <_ZL8minttemp.lto_priv.461> 26c88: 70 91 a4 04 lds r23, 0x04A4 ; 0x8004a4 <_ZL8minttemp.lto_priv.461+0x1> 26c8c: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 26c90: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 26c94: 68 17 cp r22, r24 26c96: 79 07 cpc r23, r25 26c98: 0c f0 brlt .+2 ; 0x26c9c 26c9a: 55 c0 rjmp .+170 ; 0x26d46 // ~ nozzle heating is on bCheckingOnHeater=bCheckingOnHeater||(current_temperature_isr[active_extruder]>(minttemp[active_extruder]+TEMP_HYSTERESIS)); // for eventually delay cutting 26c9c: c0 91 14 06 lds r28, 0x0614 ; 0x800614 26ca0: c1 11 cpse r28, r1 26ca2: 18 c0 rjmp .+48 ; 0x26cd4 26ca4: 6b 5f subi r22, 0xFB ; 251 26ca6: 7f 4f sbci r23, 0xFF ; 255 26ca8: 07 2e mov r0, r23 26caa: 00 0c add r0, r0 26cac: 88 0b sbc r24, r24 26cae: 99 0b sbc r25, r25 26cb0: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 26cb4: 9b 01 movw r18, r22 26cb6: ac 01 movw r20, r24 26cb8: c1 e0 ldi r28, 0x01 ; 1 26cba: 60 91 17 05 lds r22, 0x0517 ; 0x800517 26cbe: 70 91 18 05 lds r23, 0x0518 ; 0x800518 26cc2: 80 91 19 05 lds r24, 0x0519 ; 0x800519 26cc6: 90 91 1a 05 lds r25, 0x051A ; 0x80051a 26cca: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 26cce: 18 16 cp r1, r24 26cd0: 0c f0 brlt .+2 ; 0x26cd4 26cd2: c0 e0 ldi r28, 0x00 ; 0 26cd4: c0 93 14 06 sts 0x0614, r28 ; 0x800614 if(oTimer4minTempHeater.expired_cont(HEATER_MINTEMP_DELAY) || bCheckingOnHeater) { 26cd8: 68 e9 ldi r22, 0x98 ; 152 26cda: 7a e3 ldi r23, 0x3A ; 58 26cdc: 81 e1 ldi r24, 0x11 ; 17 26cde: 96 e0 ldi r25, 0x06 ; 6 26ce0: 0f 94 a6 29 call 0x2534c ; 0x2534c ::expired_cont(unsigned short)> 26ce4: 81 11 cpse r24, r1 26ce6: 02 c0 rjmp .+4 ; 0x26cec 26ce8: cc 23 and r28, r28 26cea: 29 f0 breq .+10 ; 0x26cf6 bCheckingOnHeater=true; // not necessary 26cec: 81 e0 ldi r24, 0x01 ; 1 26cee: 80 93 14 06 sts 0x0614, r24 ; 0x800614 check_min_temp_heater0(); // delay is elapsed or temperature is/was over minTemp => periodical checking is active 26cf2: 0f 94 a8 2f call 0x25f50 ; 0x25f50 // ~ nozzle heating is off oTimer4minTempHeater.start(); bCheckingOnHeater=false; } // * bed checking if(target_temperature_bed_isr>BED_MINTEMP) { 26cf6: 80 91 17 06 lds r24, 0x0617 ; 0x800617 26cfa: 90 91 18 06 lds r25, 0x0618 ; 0x800618 26cfe: 0b 97 sbiw r24, 0x0b ; 11 26d00: 4c f1 brlt .+82 ; 0x26d54 // ~ bed heating is on bCheckingOnBed=bCheckingOnBed||(current_temperature_bed_isr>(BED_MINTEMP+TEMP_HYSTERESIS)); // for eventually delay cutting 26d02: c0 91 10 06 lds r28, 0x0610 ; 0x800610 26d06: c1 11 cpse r28, r1 26d08: 0c c0 rjmp .+24 ; 0x26d22 26d0a: c1 e0 ldi r28, 0x01 ; 1 26d0c: 20 e0 ldi r18, 0x00 ; 0 26d0e: 30 e0 ldi r19, 0x00 ; 0 26d10: 40 e7 ldi r20, 0x70 ; 112 26d12: 51 e4 ldi r21, 0x41 ; 65 26d14: c7 01 movw r24, r14 26d16: b6 01 movw r22, r12 26d18: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 26d1c: 18 16 cp r1, r24 26d1e: 0c f0 brlt .+2 ; 0x26d22 26d20: c0 e0 ldi r28, 0x00 ; 0 26d22: c0 93 10 06 sts 0x0610, r28 ; 0x800610 if(oTimer4minTempBed.expired_cont(BED_MINTEMP_DELAY) || bCheckingOnBed) { 26d26: 60 e5 ldi r22, 0x50 ; 80 26d28: 73 ec ldi r23, 0xC3 ; 195 26d2a: 8d e0 ldi r24, 0x0D ; 13 26d2c: 96 e0 ldi r25, 0x06 ; 6 26d2e: 0f 94 a6 29 call 0x2534c ; 0x2534c ::expired_cont(unsigned short)> 26d32: 81 11 cpse r24, r1 26d34: 02 c0 rjmp .+4 ; 0x26d3a 26d36: cc 23 and r28, r28 26d38: 99 f0 breq .+38 ; 0x26d60 bCheckingOnBed=true; // not necessary 26d3a: 81 e0 ldi r24, 0x01 ; 1 26d3c: 80 93 10 06 sts 0x0610, r24 ; 0x800610 #ifdef AMBIENT_THERMISTOR } else { // ambient temperature is standard check_min_temp_heater0(); check_min_temp_bed(); 26d40: 0f 94 97 2f call 0x25f2e ; 0x25f2e 26d44: 0d c0 rjmp .+26 ; 0x26d60 check_min_temp_heater0(); // delay is elapsed or temperature is/was over minTemp => periodical checking is active } } else { // ~ nozzle heating is off oTimer4minTempHeater.start(); 26d46: 81 e1 ldi r24, 0x11 ; 17 26d48: 96 e0 ldi r25, 0x06 ; 6 26d4a: 0f 94 ad 29 call 0x2535a ; 0x2535a ::start()> bCheckingOnHeater=false; 26d4e: 10 92 14 06 sts 0x0614, r1 ; 0x800614 26d52: d1 cf rjmp .-94 ; 0x26cf6 check_min_temp_bed(); // delay is elapsed or temperature is/was over minTemp => periodical checking is active } } else { // ~ bed heating is off oTimer4minTempBed.start(); 26d54: 8d e0 ldi r24, 0x0D ; 13 26d56: 96 e0 ldi r25, 0x06 ; 6 26d58: 0f 94 ad 29 call 0x2535a ; 0x2535a ::start()> bCheckingOnBed=false; 26d5c: 10 92 10 06 sts 0x0610, r1 ; 0x800610 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); 26d60: 60 91 16 05 lds r22, 0x0516 ; 0x800516 <_ZL8soft_pwm.lto_priv.459> 26d64: 70 e0 ldi r23, 0x00 ; 0 26d66: 90 e0 ldi r25, 0x00 ; 0 26d68: 80 e0 ldi r24, 0x00 ; 0 26d6a: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 26d6e: 6b 01 movw r12, r22 26d70: 7c 01 movw r14, r24 26d72: 40 90 17 05 lds r4, 0x0517 ; 0x800517 26d76: 50 90 18 05 lds r5, 0x0518 ; 0x800518 26d7a: 60 90 19 05 lds r6, 0x0519 ; 0x800519 26d7e: 70 90 1a 05 lds r7, 0x051A ; 0x80051a 26d82: 60 91 1e 06 lds r22, 0x061E ; 0x80061e 26d86: 70 91 1f 06 lds r23, 0x061F ; 0x80061f 26d8a: 07 2e mov r0, r23 26d8c: 00 0c add r0, r0 26d8e: 88 0b sbc r24, r24 26d90: 99 0b sbc r25, r25 26d92: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 26d96: ab 01 movw r20, r22 26d98: bc 01 movw r22, r24 26d9a: a1 2c mov r10, r1 26d9c: 93 01 movw r18, r6 26d9e: 82 01 movw r16, r4 26da0: 81 e0 ldi r24, 0x01 ; 1 26da2: 0f 94 b9 2f call 0x25f72 ; 0x25f72 #endif #ifdef TEMP_RUNAWAY_BED_HYSTERESIS temp_runaway_check(0, target_temperature_bed_isr, current_temperature_bed_isr, soft_pwm_bed, true); 26da6: 60 91 1d 06 lds r22, 0x061D ; 0x80061d 26daa: 70 e0 ldi r23, 0x00 ; 0 26dac: 90 e0 ldi r25, 0x00 ; 0 26dae: 80 e0 ldi r24, 0x00 ; 0 26db0: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 26db4: 6b 01 movw r12, r22 26db6: 7c 01 movw r14, r24 26db8: 40 90 19 06 lds r4, 0x0619 ; 0x800619 26dbc: 50 90 1a 06 lds r5, 0x061A ; 0x80061a 26dc0: 60 90 1b 06 lds r6, 0x061B ; 0x80061b 26dc4: 70 90 1c 06 lds r7, 0x061C ; 0x80061c 26dc8: 60 91 17 06 lds r22, 0x0617 ; 0x800617 26dcc: 70 91 18 06 lds r23, 0x0618 ; 0x800618 26dd0: 07 2e mov r0, r23 26dd2: 00 0c add r0, r0 26dd4: 88 0b sbc r24, r24 26dd6: 99 0b sbc r25, r25 26dd8: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 26ddc: ab 01 movw r20, r22 26dde: bc 01 movw r22, r24 26de0: aa 24 eor r10, r10 26de2: a3 94 inc r10 26de4: 93 01 movw r18, r6 26de6: 82 01 movw r16, r4 26de8: 80 e0 ldi r24, 0x00 ; 0 26dea: 0f 94 b9 2f call 0x25f72 ; 0x25f72 return true; } static void check() { if(!enabled) return; 26dee: 80 91 1d 05 lds r24, 0x051D ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.456> 26df2: 88 23 and r24, r24 26df4: 09 f4 brne .+2 ; 0x26df8 26df6: bc c0 rjmp .+376 ; 0x26f70 uint8_t heater_pwm = soft_pwm[0]; 26df8: c0 91 16 05 lds r28, 0x0516 ; 0x800516 <_ZL8soft_pwm.lto_priv.459> uint8_t fan_pwm = soft_pwm_fan; 26dfc: d0 91 a5 04 lds r29, 0x04A5 ; 0x8004a5 <_ZL12soft_pwm_fan.lto_priv.460> float heater_temp = current_temperature_isr[0]; 26e00: 40 90 17 05 lds r4, 0x0517 ; 0x800517 26e04: 50 90 18 05 lds r5, 0x0518 ; 0x800518 26e08: 60 90 19 05 lds r6, 0x0519 ; 0x800519 26e0c: 70 90 1a 05 lds r7, 0x051A ; 0x80051a float ambient_temp = current_temperature_ambient_isr; 26e10: c0 90 20 06 lds r12, 0x0620 ; 0x800620 26e14: d0 90 21 06 lds r13, 0x0621 ; 0x800621 26e18: e0 90 22 06 lds r14, 0x0622 ; 0x800622 26e1c: f0 90 23 06 lds r15, 0x0623 ; 0x800623 // 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) 26e20: 80 91 3c 13 lds r24, 0x133C ; 0x80133c <_ZN13thermal_modelL4dataE.lto_priv.400+0x8c> 26e24: 80 ff sbrs r24, 0 26e26: 72 c0 rjmp .+228 ; 0x26f0c 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); 26e28: 20 91 e6 12 lds r18, 0x12E6 ; 0x8012e6 <_ZN13thermal_modelL4dataE.lto_priv.400+0x36> 26e2c: 30 91 e7 12 lds r19, 0x12E7 ; 0x8012e7 <_ZN13thermal_modelL4dataE.lto_priv.400+0x37> 26e30: 40 91 e8 12 lds r20, 0x12E8 ; 0x8012e8 <_ZN13thermal_modelL4dataE.lto_priv.400+0x38> 26e34: 50 91 e9 12 lds r21, 0x12E9 ; 0x8012e9 <_ZN13thermal_modelL4dataE.lto_priv.400+0x39> 26e38: 61 e7 ldi r22, 0x71 ; 113 26e3a: 7d e3 ldi r23, 0x3D ; 61 26e3c: 8a e8 ldi r24, 0x8A ; 138 26e3e: 9e e3 ldi r25, 0x3E ; 62 26e40: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 26e44: 60 93 3d 13 sts 0x133D, r22 ; 0x80133d <_ZN13thermal_modelL4dataE.lto_priv.400+0x8d> 26e48: 70 93 3e 13 sts 0x133E, r23 ; 0x80133e <_ZN13thermal_modelL4dataE.lto_priv.400+0x8e> 26e4c: 80 93 3f 13 sts 0x133F, r24 ; 0x80133f <_ZN13thermal_modelL4dataE.lto_priv.400+0x8f> 26e50: 90 93 40 13 sts 0x1340, r25 ; 0x801340 <_ZN13thermal_modelL4dataE.lto_priv.400+0x90> warn_s = warn * TEMP_MGR_INTV; 26e54: 21 e7 ldi r18, 0x71 ; 113 26e56: 3d e3 ldi r19, 0x3D ; 61 26e58: 4a e8 ldi r20, 0x8A ; 138 26e5a: 5e e3 ldi r21, 0x3E ; 62 26e5c: 60 91 34 13 lds r22, 0x1334 ; 0x801334 <_ZN13thermal_modelL4dataE.lto_priv.400+0x84> 26e60: 70 91 35 13 lds r23, 0x1335 ; 0x801335 <_ZN13thermal_modelL4dataE.lto_priv.400+0x85> 26e64: 80 91 36 13 lds r24, 0x1336 ; 0x801336 <_ZN13thermal_modelL4dataE.lto_priv.400+0x86> 26e68: 90 91 37 13 lds r25, 0x1337 ; 0x801337 <_ZN13thermal_modelL4dataE.lto_priv.400+0x87> 26e6c: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 26e70: 60 93 41 13 sts 0x1341, r22 ; 0x801341 <_ZN13thermal_modelL4dataE.lto_priv.400+0x91> 26e74: 70 93 42 13 sts 0x1342, r23 ; 0x801342 <_ZN13thermal_modelL4dataE.lto_priv.400+0x92> 26e78: 80 93 43 13 sts 0x1343, r24 ; 0x801343 <_ZN13thermal_modelL4dataE.lto_priv.400+0x93> 26e7c: 90 93 44 13 sts 0x1344, r25 ; 0x801344 <_ZN13thermal_modelL4dataE.lto_priv.400+0x94> err_s = err * TEMP_MGR_INTV; 26e80: 21 e7 ldi r18, 0x71 ; 113 26e82: 3d e3 ldi r19, 0x3D ; 61 26e84: 4a e8 ldi r20, 0x8A ; 138 26e86: 5e e3 ldi r21, 0x3E ; 62 26e88: 60 91 38 13 lds r22, 0x1338 ; 0x801338 <_ZN13thermal_modelL4dataE.lto_priv.400+0x88> 26e8c: 70 91 39 13 lds r23, 0x1339 ; 0x801339 <_ZN13thermal_modelL4dataE.lto_priv.400+0x89> 26e90: 80 91 3a 13 lds r24, 0x133A ; 0x80133a <_ZN13thermal_modelL4dataE.lto_priv.400+0x8a> 26e94: 90 91 3b 13 lds r25, 0x133B ; 0x80133b <_ZN13thermal_modelL4dataE.lto_priv.400+0x8b> 26e98: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 26e9c: 60 93 45 13 sts 0x1345, r22 ; 0x801345 <_ZN13thermal_modelL4dataE.lto_priv.400+0x95> 26ea0: 70 93 46 13 sts 0x1346, r23 ; 0x801346 <_ZN13thermal_modelL4dataE.lto_priv.400+0x96> 26ea4: 80 93 47 13 sts 0x1347, r24 ; 0x801347 <_ZN13thermal_modelL4dataE.lto_priv.400+0x97> 26ea8: 90 93 48 13 sts 0x1348, r25 ; 0x801348 <_ZN13thermal_modelL4dataE.lto_priv.400+0x98> dT_lag_size = L / (uint16_t)(TEMP_MGR_INTV * 1000); 26eac: 80 91 ee 12 lds r24, 0x12EE ; 0x8012ee <_ZN13thermal_modelL4dataE.lto_priv.400+0x3e> 26eb0: 90 91 ef 12 lds r25, 0x12EF ; 0x8012ef <_ZN13thermal_modelL4dataE.lto_priv.400+0x3f> 26eb4: 6e e0 ldi r22, 0x0E ; 14 26eb6: 71 e0 ldi r23, 0x01 ; 1 26eb8: 0f 94 e5 dc call 0x3b9ca ; 0x3b9ca <__udivmodhi4> 26ebc: 60 93 d0 12 sts 0x12D0, r22 ; 0x8012d0 <_ZN13thermal_modelL4dataE.lto_priv.400+0x20> 26ec0: e0 eb ldi r30, 0xB0 ; 176 26ec2: f2 e1 ldi r31, 0x12 ; 18 26ec4: 80 ed ldi r24, 0xD0 ; 208 26ec6: 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; 26ec8: 40 e0 ldi r20, 0x00 ; 0 26eca: 50 e0 ldi r21, 0x00 ; 0 26ecc: 60 ec ldi r22, 0xC0 ; 192 26ece: 7f e7 ldi r23, 0x7F ; 127 26ed0: 41 93 st Z+, r20 26ed2: 51 93 st Z+, r21 26ed4: 61 93 st Z+, r22 26ed6: 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) 26ed8: 8e 17 cp r24, r30 26eda: 9f 07 cpc r25, r31 26edc: c9 f7 brne .-14 ; 0x26ed0 dT_lag_buf[i] = NAN; dT_lag_idx = 0; 26ede: 10 92 d1 12 sts 0x12D1, r1 ; 0x8012d1 <_ZN13thermal_modelL4dataE.lto_priv.400+0x21> dT_err_prev = 0; 26ee2: 10 92 d2 12 sts 0x12D2, r1 ; 0x8012d2 <_ZN13thermal_modelL4dataE.lto_priv.400+0x22> 26ee6: 10 92 d3 12 sts 0x12D3, r1 ; 0x8012d3 <_ZN13thermal_modelL4dataE.lto_priv.400+0x23> 26eea: 10 92 d4 12 sts 0x12D4, r1 ; 0x8012d4 <_ZN13thermal_modelL4dataE.lto_priv.400+0x24> 26eee: 10 92 d5 12 sts 0x12D5, r1 ; 0x8012d5 <_ZN13thermal_modelL4dataE.lto_priv.400+0x25> T_prev = NAN; 26ef2: 40 93 d6 12 sts 0x12D6, r20 ; 0x8012d6 <_ZN13thermal_modelL4dataE.lto_priv.400+0x26> 26ef6: 50 93 d7 12 sts 0x12D7, r21 ; 0x8012d7 <_ZN13thermal_modelL4dataE.lto_priv.400+0x27> 26efa: 60 93 d8 12 sts 0x12D8, r22 ; 0x8012d8 <_ZN13thermal_modelL4dataE.lto_priv.400+0x28> 26efe: 70 93 d9 12 sts 0x12D9, r23 ; 0x8012d9 <_ZN13thermal_modelL4dataE.lto_priv.400+0x29> // clear the initialization flag flag_bits.uninitialized = false; 26f02: 80 91 3c 13 lds r24, 0x133C ; 0x80133c <_ZN13thermal_modelL4dataE.lto_priv.400+0x8c> 26f06: 8e 7f andi r24, 0xFE ; 254 26f08: 80 93 3c 13 sts 0x133C, r24 ; 0x80133c <_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); 26f0c: 87 01 movw r16, r14 26f0e: 76 01 movw r14, r12 26f10: a3 01 movw r20, r6 26f12: 92 01 movw r18, r4 26f14: 6d 2f mov r22, r29 26f16: 8c 2f mov r24, r28 26f18: 0e 94 33 e5 call 0x1ca66 ; 0x1ca66 // handle errors if(data.flag_bits.error) 26f1c: 80 91 3c 13 lds r24, 0x133C ; 0x80133c <_ZN13thermal_modelL4dataE.lto_priv.400+0x8c> 26f20: 81 ff sbrs r24, 1 26f22: 05 c0 rjmp .+10 ; 0x26f2e set_temp_error(TempErrorSource::hotend, 0, TempErrorType::model); 26f24: 44 e0 ldi r20, 0x04 ; 4 26f26: 60 e0 ldi r22, 0x00 ; 0 26f28: 80 e0 ldi r24, 0x00 ; 0 26f2a: 0f 94 33 2f call 0x25e66 ; 0x25e66 // handle warning conditions as lower-priority but with greater feedback warning_state.assert = data.flag_bits.warning; 26f2e: 90 91 3c 13 lds r25, 0x133C ; 0x80133c <_ZN13thermal_modelL4dataE.lto_priv.400+0x8c> 26f32: 80 91 39 06 lds r24, 0x0639 ; 0x800639 26f36: 92 fb bst r25, 2 26f38: 81 f9 bld r24, 1 26f3a: 80 93 39 06 sts 0x0639, r24 ; 0x800639 if(warning_state.assert) { 26f3e: 80 91 39 06 lds r24, 0x0639 ; 0x800639 26f42: 81 ff sbrs r24, 1 26f44: 15 c0 rjmp .+42 ; 0x26f70 warning_state.warning = true; 26f46: 80 91 39 06 lds r24, 0x0639 ; 0x800639 26f4a: 81 60 ori r24, 0x01 ; 1 26f4c: 80 93 39 06 sts 0x0639, r24 ; 0x800639 warning_state.dT_err = thermal_model::data.dT_err_prev; 26f50: 80 91 d2 12 lds r24, 0x12D2 ; 0x8012d2 <_ZN13thermal_modelL4dataE.lto_priv.400+0x22> 26f54: 90 91 d3 12 lds r25, 0x12D3 ; 0x8012d3 <_ZN13thermal_modelL4dataE.lto_priv.400+0x23> 26f58: a0 91 d4 12 lds r26, 0x12D4 ; 0x8012d4 <_ZN13thermal_modelL4dataE.lto_priv.400+0x24> 26f5c: b0 91 d5 12 lds r27, 0x12D5 ; 0x8012d5 <_ZN13thermal_modelL4dataE.lto_priv.400+0x25> 26f60: 80 93 35 06 sts 0x0635, r24 ; 0x800635 26f64: 90 93 36 06 sts 0x0636, r25 ; 0x800636 26f68: a0 93 37 06 sts 0x0637, r26 ; 0x800637 26f6c: b0 93 38 06 sts 0x0638, r27 ; 0x800638 (int)cur_pwm, (unsigned long)cur_temp_b, (unsigned long)cur_amb_b); } static void log_isr() { if(!log_buf.enabled) return; 26f70: 80 91 34 06 lds r24, 0x0634 ; 0x800634 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x10> 26f74: 88 23 and r24, r24 26f76: 09 f4 brne .+2 ; 0x26f7a 26f78: 3f c0 rjmp .+126 ; 0x26ff8 uint32_t stamp = _millis(); 26f7a: 0f 94 4c 29 call 0x25298 ; 0x25298 uint8_t delta_ms = stamp - log_buf.entry.stamp - (uint32_t)(TEMP_MGR_INTV * 1000); 26f7e: c0 90 24 06 lds r12, 0x0624 ; 0x800624 <_ZN13thermal_modelL7log_bufE.lto_priv.537> 26f82: d0 90 25 06 lds r13, 0x0625 ; 0x800625 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x1> 26f86: e0 90 26 06 lds r14, 0x0626 ; 0x800626 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x2> 26f8a: f0 90 27 06 lds r15, 0x0627 ; 0x800627 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x3> log_buf.entry.stamp = stamp; 26f8e: 60 93 24 06 sts 0x0624, r22 ; 0x800624 <_ZN13thermal_modelL7log_bufE.lto_priv.537> 26f92: 70 93 25 06 sts 0x0625, r23 ; 0x800625 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x1> 26f96: 80 93 26 06 sts 0x0626, r24 ; 0x800626 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x2> 26f9a: 90 93 27 06 sts 0x0627, r25 ; 0x800627 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x3> ++log_buf.entry.counter; 26f9e: 20 91 29 06 lds r18, 0x0629 ; 0x800629 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x5> 26fa2: 2f 5f subi r18, 0xFF ; 255 26fa4: 20 93 29 06 sts 0x0629, r18 ; 0x800629 <_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); 26fa8: 6c 19 sub r22, r12 26faa: 6e 50 subi r22, 0x0E ; 14 log_buf.entry.stamp = stamp; ++log_buf.entry.counter; log_buf.entry.delta_ms = delta_ms; 26fac: 60 93 28 06 sts 0x0628, r22 ; 0x800628 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x4> log_buf.entry.cur_pwm = soft_pwm[0]; 26fb0: 80 91 16 05 lds r24, 0x0516 ; 0x800516 <_ZL8soft_pwm.lto_priv.459> 26fb4: 80 93 2a 06 sts 0x062A, r24 ; 0x80062a <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x6> log_buf.entry.cur_temp = current_temperature_isr[0]; 26fb8: 80 91 17 05 lds r24, 0x0517 ; 0x800517 26fbc: 90 91 18 05 lds r25, 0x0518 ; 0x800518 26fc0: a0 91 19 05 lds r26, 0x0519 ; 0x800519 26fc4: b0 91 1a 05 lds r27, 0x051A ; 0x80051a 26fc8: 80 93 2b 06 sts 0x062B, r24 ; 0x80062b <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x7> 26fcc: 90 93 2c 06 sts 0x062C, r25 ; 0x80062c <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x8> 26fd0: a0 93 2d 06 sts 0x062D, r26 ; 0x80062d <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x9> 26fd4: b0 93 2e 06 sts 0x062E, r27 ; 0x80062e <_ZN13thermal_modelL7log_bufE.lto_priv.537+0xa> log_buf.entry.cur_amb = current_temperature_ambient_isr; 26fd8: 80 91 20 06 lds r24, 0x0620 ; 0x800620 26fdc: 90 91 21 06 lds r25, 0x0621 ; 0x800621 26fe0: a0 91 22 06 lds r26, 0x0622 ; 0x800622 26fe4: b0 91 23 06 lds r27, 0x0623 ; 0x800623 26fe8: 80 93 2f 06 sts 0x062F, r24 ; 0x80062f <_ZN13thermal_modelL7log_bufE.lto_priv.537+0xb> 26fec: 90 93 30 06 sts 0x0630, r25 ; 0x800630 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0xc> 26ff0: a0 93 31 06 sts 0x0631, r26 ; 0x800631 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0xd> 26ff4: b0 93 32 06 sts 0x0632, r27 ; 0x800632 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0xe> thermal_model::log_isr(); #endif #endif // PID regulation if (pid_tuning_finished) 26ff8: 80 91 3e 02 lds r24, 0x023E ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.458> 26ffc: 88 23 and r24, r24 26ffe: 91 f0 breq .+36 ; 0x27024 temp_mgr_pid(); } 27000: df 91 pop r29 27002: cf 91 pop r28 27004: 1f 91 pop r17 27006: 0f 91 pop r16 27008: ff 90 pop r15 2700a: ef 90 pop r14 2700c: df 90 pop r13 2700e: cf 90 pop r12 27010: af 90 pop r10 27012: 7f 90 pop r7 27014: 6f 90 pop r6 27016: 5f 90 pop r5 27018: 4f 90 pop r4 #endif #endif // PID regulation if (pid_tuning_finished) temp_mgr_pid(); 2701a: 0d 94 d0 10 jmp 0x221a0 ; 0x221a0 // *** end of 'common' part #ifdef AMBIENT_THERMISTOR } else { // ambient temperature is standard check_min_temp_heater0(); 2701e: 0f 94 a8 2f call 0x25f50 ; 0x25f50 27022: 8e ce rjmp .-740 ; 0x26d40 #endif // PID regulation if (pid_tuning_finished) temp_mgr_pid(); } 27024: df 91 pop r29 27026: cf 91 pop r28 27028: 1f 91 pop r17 2702a: 0f 91 pop r16 2702c: ff 90 pop r15 2702e: ef 90 pop r14 27030: df 90 pop r13 27032: cf 90 pop r12 27034: af 90 pop r10 27036: 7f 90 pop r7 27038: 6f 90 pop r6 2703a: 5f 90 pop r5 2703c: 4f 90 pop r4 2703e: 08 95 ret 00027040 <__vector_47>: ISR(TIMERx_COMPA_vect) { 27040: 1f 92 push r1 27042: 0f 92 push r0 27044: 0f b6 in r0, 0x3f ; 63 27046: 0f 92 push r0 27048: 11 24 eor r1, r1 2704a: 0b b6 in r0, 0x3b ; 59 2704c: 0f 92 push r0 2704e: 2f 93 push r18 27050: 3f 93 push r19 27052: 4f 93 push r20 27054: 5f 93 push r21 27056: 6f 93 push r22 27058: 7f 93 push r23 2705a: 8f 93 push r24 2705c: 9f 93 push r25 2705e: af 93 push r26 27060: bf 93 push r27 27062: ef 93 push r30 27064: ff 93 push r31 // immediately schedule a new conversion if(adc_values_ready != true) return; 27066: 80 91 1c 05 lds r24, 0x051C ; 0x80051c <_ZL16adc_values_ready.lto_priv.457> 2706a: 88 23 and r24, r24 2706c: 91 f0 breq .+36 ; 0x27092 <__vector_47+0x52> adc_values_ready = false; 2706e: 10 92 1c 05 sts 0x051C, r1 ; 0x80051c <_ZL16adc_values_ready.lto_priv.457> adc_start_cycle(); 27072: 0e 94 d7 8d call 0x11bae ; 0x11bae // run temperature management with interrupts enabled to reduce latency DISABLE_TEMP_MGR_INTERRUPT(); 27076: 80 91 73 00 lds r24, 0x0073 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> 2707a: 8d 7f andi r24, 0xFD ; 253 2707c: 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(); 27080: 78 94 sei NONATOMIC_BLOCK(NONATOMIC_FORCEOFF) { temp_mgr_isr(); 27082: 0f 94 b9 35 call 0x26b72 ; 0x26b72 (void)__s; } static __inline__ void __iCliParam(const uint8_t *__s) { cli(); 27086: f8 94 cli } ENABLE_TEMP_MGR_INTERRUPT(); 27088: 80 91 73 00 lds r24, 0x0073 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> 2708c: 82 60 ori r24, 0x02 ; 2 2708e: 80 93 73 00 sts 0x0073, r24 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> } 27092: ff 91 pop r31 27094: ef 91 pop r30 27096: bf 91 pop r27 27098: af 91 pop r26 2709a: 9f 91 pop r25 2709c: 8f 91 pop r24 2709e: 7f 91 pop r23 270a0: 6f 91 pop r22 270a2: 5f 91 pop r21 270a4: 4f 91 pop r20 270a6: 3f 91 pop r19 270a8: 2f 91 pop r18 270aa: 0f 90 pop r0 270ac: 0b be out 0x3b, r0 ; 59 270ae: 0f 90 pop r0 270b0: 0f be out 0x3f, r0 ; 63 270b2: 0f 90 pop r0 270b4: 1f 90 pop r1 270b6: 18 95 reti 000270b8 : } void handle_temp_error(); void manage_heater() { 270b8: 6f 92 push r6 270ba: 7f 92 push r7 270bc: 8f 92 push r8 270be: 9f 92 push r9 270c0: af 92 push r10 270c2: bf 92 push r11 270c4: cf 92 push r12 270c6: df 92 push r13 270c8: ef 92 push r14 270ca: ff 92 push r15 270cc: 0f 93 push r16 270ce: 1f 93 push r17 270d0: cf 93 push r28 270d2: df 93 push r29 270d4: 1f 92 push r1 270d6: cd b7 in r28, 0x3d ; 61 270d8: de b7 in r29, 0x3e ; 62 #ifdef WATCHDOG wdt_reset(); 270da: 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) 270dc: 80 91 02 06 lds r24, 0x0602 ; 0x800602 270e0: 88 23 and r24, r24 270e2: 09 f4 brne .+2 ; 0x270e6 270e4: bb c0 rjmp .+374 ; 0x2725c return; // syncronize temperatures with isr updateTemperatures(); 270e6: 0f 94 7d 32 call 0x264fa ; 0x264fa #ifdef THERMAL_MODEL // handle model warnings first, so not to override the error handler if(thermal_model::warning_state.warning) 270ea: 80 91 39 06 lds r24, 0x0639 ; 0x800639 270ee: 80 ff sbrs r24, 0 270f0: 51 c0 rjmp .+162 ; 0x27194 } static void handle_warning() { // update values float warn = data.warn; 270f2: 10 91 34 13 lds r17, 0x1334 ; 0x801334 <_ZN13thermal_modelL4dataE.lto_priv.400+0x84> 270f6: 00 91 35 13 lds r16, 0x1335 ; 0x801335 <_ZN13thermal_modelL4dataE.lto_priv.400+0x85> 270fa: b0 90 36 13 lds r11, 0x1336 ; 0x801336 <_ZN13thermal_modelL4dataE.lto_priv.400+0x86> 270fe: a0 90 37 13 lds r10, 0x1337 ; 0x801337 <_ZN13thermal_modelL4dataE.lto_priv.400+0x87> float dT_err; { TempMgrGuard temp_mgr_guard; 27102: ce 01 movw r24, r28 27104: 01 96 adiw r24, 0x01 ; 1 27106: 0f 94 9a 31 call 0x26334 ; 0x26334 dT_err = warning_state.dT_err; 2710a: c0 90 35 06 lds r12, 0x0635 ; 0x800635 2710e: d0 90 36 06 lds r13, 0x0636 ; 0x800636 27112: e0 90 37 06 lds r14, 0x0637 ; 0x800637 27116: f0 90 38 06 lds r15, 0x0638 ; 0x800638 { // update values float warn = data.warn; float dT_err; { TempMgrGuard temp_mgr_guard; 2711a: ce 01 movw r24, r28 2711c: 01 96 adiw r24, 0x01 ; 1 2711e: 0f 94 8d 31 call 0x2631a ; 0x2631a 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); 27122: af 92 push r10 27124: bf 92 push r11 27126: 0f 93 push r16 27128: 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 2712a: 21 e7 ldi r18, 0x71 ; 113 2712c: 3d e3 ldi r19, 0x3D ; 61 2712e: 4a e8 ldi r20, 0x8A ; 138 27130: 5e e3 ldi r21, 0x3E ; 62 27132: c7 01 movw r24, r14 27134: b6 01 movw r22, r12 27136: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> printf_P(PSTR("TM: error |%f|>%f\n"), (double)dT_err, (double)warn); 2713a: 9f 93 push r25 2713c: 8f 93 push r24 2713e: 7f 93 push r23 27140: 6f 93 push r22 27142: 84 e0 ldi r24, 0x04 ; 4 27144: 9c e9 ldi r25, 0x9C ; 156 27146: 9f 93 push r25 27148: 8f 93 push r24 2714a: 0f 94 de da call 0x3b5bc ; 0x3b5bc static bool first = true; if(warning_state.assert) { 2714e: 90 91 39 06 lds r25, 0x0639 ; 0x800639 27152: 0f b6 in r0, 0x3f ; 63 27154: f8 94 cli 27156: de bf out 0x3e, r29 ; 62 27158: 0f be out 0x3f, r0 ; 63 2715a: cd bf out 0x3d, r28 ; 61 2715c: 80 91 3d 02 lds r24, 0x023D ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.455> 27160: 91 ff sbrs r25, 1 27162: 93 c0 rjmp .+294 ; 0x2728a if (first) { 27164: 90 91 a3 02 lds r25, 0x02A3 ; 0x8002a3 27168: 99 23 and r25, r25 2716a: 09 f4 brne .+2 ; 0x2716e 2716c: 87 c0 rjmp .+270 ; 0x2727c if(warn_beep) { 2716e: 88 23 and r24, r24 27170: 79 f0 breq .+30 ; 0x27190 lcd_setalertstatuspgm(_T(MSG_THERMAL_ANOMALY), LCD_STATUS_INFO); 27172: 8e ea ldi r24, 0xAE ; 174 27174: 9d e4 ldi r25, 0x4D ; 77 27176: 0e 94 ac 72 call 0xe558 ; 0xe558 2717a: 61 e0 ldi r22, 0x01 ; 1 2717c: 0e 94 1d f1 call 0x1e23a ; 0x1e23a WRITE(BEEPER, HIGH); 27180: 9f b7 in r25, 0x3f ; 63 27182: f8 94 cli 27184: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 27188: 84 60 ori r24, 0x04 ; 4 2718a: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2718e: 9f bf out 0x3f, r25 ; 63 } first = false; 27190: 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) 27194: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 27198: 88 23 and r24, r24 2719a: 89 f0 breq .+34 ; 0x271be #endif void handle_temp_error() { // relay to the original handler switch((TempErrorType)temp_error_state.type) { 2719c: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 271a0: 82 95 swap r24 271a2: 86 95 lsr r24 271a4: 87 70 andi r24, 0x07 ; 7 271a6: 84 30 cpi r24, 0x04 ; 4 271a8: 08 f0 brcs .+2 ; 0x271ac 271aa: 82 c0 rjmp .+260 ; 0x272b0 271ac: 82 30 cpi r24, 0x02 ; 2 271ae: 08 f0 brcs .+2 ; 0x271b2 271b0: 1d c1 rjmp .+570 ; 0x273ec 271b2: 88 23 and r24, r24 271b4: 09 f4 brne .+2 ; 0x271b8 271b6: f4 c0 rjmp .+488 ; 0x273a0 271b8: 81 30 cpi r24, 0x01 ; 1 271ba: 09 f4 brne .+2 ; 0x271be 271bc: 94 c0 rjmp .+296 ; 0x272e6 // handle temperature errors if(temp_error_state.v) handle_temp_error(); // periodically check fans checkFans(); 271be: 0e 94 02 80 call 0x10004 ; 0x10004 } #ifdef THERMAL_MODEL_DEBUG static void log_usr() { if(!log_buf.enabled) return; 271c2: 80 91 34 06 lds r24, 0x0634 ; 0x800634 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x10> 271c6: 88 23 and r24, r24 271c8: 09 f4 brne .+2 ; 0x271cc 271ca: 48 c0 rjmp .+144 ; 0x2725c uint8_t counter = log_buf.entry.counter; 271cc: 80 91 29 06 lds r24, 0x0629 ; 0x800629 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x5> if (counter == log_buf.serial) return; 271d0: 70 90 33 06 lds r7, 0x0633 ; 0x800633 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0xf> 271d4: 87 15 cp r24, r7 271d6: 09 f4 brne .+2 ; 0x271da 271d8: 41 c0 rjmp .+130 ; 0x2725c // 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; 271da: ce 01 movw r24, r28 271dc: 01 96 adiw r24, 0x01 ; 1 271de: 0f 94 9a 31 call 0x26334 ; 0x26334 delta_ms = log_buf.entry.delta_ms; 271e2: 00 91 28 06 lds r16, 0x0628 ; 0x800628 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x4> counter = log_buf.entry.counter; 271e6: 10 91 29 06 lds r17, 0x0629 ; 0x800629 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x5> cur_pwm = log_buf.entry.cur_pwm; 271ea: 60 90 2a 06 lds r6, 0x062A ; 0x80062a <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x6> cur_temp = log_buf.entry.cur_temp; 271ee: c0 90 2b 06 lds r12, 0x062B ; 0x80062b <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x7> 271f2: d0 90 2c 06 lds r13, 0x062C ; 0x80062c <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x8> 271f6: e0 90 2d 06 lds r14, 0x062D ; 0x80062d <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x9> 271fa: f0 90 2e 06 lds r15, 0x062E ; 0x80062e <_ZN13thermal_modelL7log_bufE.lto_priv.537+0xa> cur_amb = log_buf.entry.cur_amb; 271fe: 80 90 2f 06 lds r8, 0x062F ; 0x80062f <_ZN13thermal_modelL7log_bufE.lto_priv.537+0xb> 27202: 90 90 30 06 lds r9, 0x0630 ; 0x800630 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0xc> 27206: a0 90 31 06 lds r10, 0x0631 ; 0x800631 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0xd> 2720a: b0 90 32 06 lds r11, 0x0632 ; 0x800632 <_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; 2720e: ce 01 movw r24, r28 27210: 01 96 adiw r24, 0x01 ; 1 27212: 0f 94 8d 31 call 0x2631a ; 0x2631a 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; 27216: 10 93 33 06 sts 0x0633, r17 ; 0x800633 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0xf> printf_P(PSTR("TML %d %d %x %lx %lx\n"), (unsigned)d - 1, (int)delta_ms + 1, 2721a: bf 92 push r11 2721c: af 92 push r10 2721e: 9f 92 push r9 27220: 8f 92 push r8 27222: ff 92 push r15 27224: ef 92 push r14 27226: df 92 push r13 27228: cf 92 push r12 2722a: 1f 92 push r1 2722c: 6f 92 push r6 2722e: 80 2f mov r24, r16 27230: 00 0f add r16, r16 27232: 99 0b sbc r25, r25 27234: 01 96 adiw r24, 0x01 ; 1 27236: 9f 93 push r25 27238: 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; 2723a: 81 2f mov r24, r17 2723c: 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, 2723e: 81 50 subi r24, 0x01 ; 1 27240: 99 0b sbc r25, r25 27242: 9f 93 push r25 27244: 8f 93 push r24 27246: 87 e8 ldi r24, 0x87 ; 135 27248: 9b e9 ldi r25, 0x9B ; 155 2724a: 9f 93 push r25 2724c: 8f 93 push r24 2724e: 0f 94 de da call 0x3b5bc ; 0x3b5bc 27252: 0f b6 in r0, 0x3f ; 63 27254: f8 94 cli 27256: de bf out 0x3e, r29 ; 62 27258: 0f be out 0x3f, r0 ; 63 2725a: cd bf out 0x3d, r28 ; 61 checkFans(); #ifdef THERMAL_MODEL_DEBUG thermal_model::log_usr(); #endif } 2725c: 0f 90 pop r0 2725e: df 91 pop r29 27260: cf 91 pop r28 27262: 1f 91 pop r17 27264: 0f 91 pop r16 27266: ff 90 pop r15 27268: ef 90 pop r14 2726a: df 90 pop r13 2726c: cf 90 pop r12 2726e: bf 90 pop r11 27270: af 90 pop r10 27272: 9f 90 pop r9 27274: 8f 90 pop r8 27276: 7f 90 pop r7 27278: 6f 90 pop r6 2727a: 08 95 ret lcd_setalertstatuspgm(_T(MSG_THERMAL_ANOMALY), LCD_STATUS_INFO); WRITE(BEEPER, HIGH); } first = false; } else { if(warn_beep) TOGGLE(BEEPER); 2727c: 88 23 and r24, r24 2727e: 09 f4 brne .+2 ; 0x27282 27280: 89 cf rjmp .-238 ; 0x27194 27282: 84 e0 ldi r24, 0x04 ; 4 27284: 80 93 00 01 sts 0x0100, r24 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 27288: 85 cf rjmp .-246 ; 0x27194 } } else { // warning cleared, reset state warning_state.warning = false; 2728a: 90 91 39 06 lds r25, 0x0639 ; 0x800639 2728e: 9e 7f andi r25, 0xFE ; 254 27290: 90 93 39 06 sts 0x0639, r25 ; 0x800639 if(warn_beep) WRITE(BEEPER, LOW); 27294: 88 23 and r24, r24 27296: 41 f0 breq .+16 ; 0x272a8 27298: 9f b7 in r25, 0x3f ; 63 2729a: f8 94 cli 2729c: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 272a0: 8b 7f andi r24, 0xFB ; 251 272a2: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 272a6: 9f bf out 0x3f, r25 ; 63 first = true; 272a8: 81 e0 ldi r24, 0x01 ; 1 272aa: 80 93 a3 02 sts 0x02A3, r24 ; 0x8002a3 272ae: 72 cf rjmp .-284 ; 0x27194 #endif void handle_temp_error() { // relay to the original handler switch((TempErrorType)temp_error_state.type) { 272b0: 84 30 cpi r24, 0x04 ; 4 272b2: 09 f0 breq .+2 ; 0x272b6 272b4: 84 cf rjmp .-248 ; 0x271be #endif } break; #ifdef THERMAL_MODEL case TempErrorType::model: if(temp_error_state.assert) { 272b6: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 272ba: 81 ff sbrs r24, 1 272bc: b4 c0 rjmp .+360 ; 0x27426 if(IsStopped() == false) { 272be: 80 91 11 05 lds r24, 0x0511 ; 0x800511 272c2: 81 11 cpse r24, r1 272c4: 04 c0 rjmp .+8 ; 0x272ce SERIAL_ECHOLNPGM("TM: error triggered!"); 272c6: 8f ee ldi r24, 0xEF ; 239 272c8: 9b e9 ldi r25, 0x9B ; 155 272ca: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 } ThermalStop(true); 272ce: 81 e0 ldi r24, 0x01 ; 1 272d0: 0e 94 ac 79 call 0xf358 ; 0xf358 WRITE(BEEPER, HIGH); 272d4: 9f b7 in r25, 0x3f ; 63 272d6: f8 94 cli 272d8: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 272dc: 84 60 ori r24, 0x04 ; 4 272de: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 272e2: 9f bf out 0x3f, r25 ; 63 272e4: 6c cf rjmp .-296 ; 0x271be void handle_temp_error() { // relay to the original handler switch((TempErrorType)temp_error_state.type) { case TempErrorType::min: switch((TempErrorSource)temp_error_state.source) { 272e6: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 272ea: 86 95 lsr r24 272ec: 86 95 lsr r24 272ee: 83 70 andi r24, 0x03 ; 3 272f0: 81 30 cpi r24, 0x01 ; 1 272f2: d9 f1 breq .+118 ; 0x2736a 272f4: 58 f0 brcs .+22 ; 0x2730c 272f6: 82 30 cpi r24, 0x02 ; 2 272f8: 09 f0 breq .+2 ; 0x272fc 272fa: 61 cf rjmp .-318 ; 0x271be } ThermalStop(); } static void ambient_min_temp_error(void) { if(IsStopped() == false) { 272fc: 80 91 11 05 lds r24, 0x0511 ; 0x800511 27300: 81 11 cpse r24, r1 27302: 14 c0 rjmp .+40 ; 0x2732c temp_error_messagepgm(PSTR("MINTEMP AMB")); 27304: 61 e0 ldi r22, 0x01 ; 1 27306: 81 eb ldi r24, 0xB1 ; 177 27308: 9b e9 ldi r25, 0x9B ; 155 2730a: 0e c0 rjmp .+28 ; 0x27328 // 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) { 2730c: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 27310: 81 ff sbrs r24, 1 27312: 10 c0 rjmp .+32 ; 0x27334 min_temp_error(temp_error_state.index); 27314: 60 91 1b 05 lds r22, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 27318: 62 95 swap r22 2731a: 61 70 andi r22, 0x01 ; 1 #endif } static void min_temp_error(uint8_t e) { static const char err[] PROGMEM = "MINTEMP"; if(IsStopped() == false) { 2731c: 80 91 11 05 lds r24, 0x0511 ; 0x800511 27320: 81 11 cpse r24, r1 27322: 04 c0 rjmp .+8 ; 0x2732c temp_error_messagepgm(err, e); 27324: 8d e9 ldi r24, 0x9D ; 157 27326: 9b e9 ldi r25, 0x9B ; 155 27328: 0f 94 fd 2b call 0x257fa ; 0x257fa prusa_statistics(92); } ThermalStop(); 2732c: 80 e0 ldi r24, 0x00 ; 0 2732e: 0e 94 ac 79 call 0xf358 ; 0xf358 27332: 45 cf rjmp .-374 ; 0x271be // 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); 27334: 60 91 a3 04 lds r22, 0x04A3 ; 0x8004a3 <_ZL8minttemp.lto_priv.461> 27338: 70 91 a4 04 lds r23, 0x04A4 ; 0x8004a4 <_ZL8minttemp.lto_priv.461+0x1> 2733c: 6b 5f subi r22, 0xFB ; 251 2733e: 7f 4f sbci r23, 0xFF ; 255 27340: 07 2e mov r0, r23 27342: 00 0c add r0, r0 27344: 88 0b sbc r24, r24 27346: 99 0b sbc r25, r25 27348: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 2734c: 8b 01 movw r16, r22 2734e: 9c 01 movw r18, r24 27350: 40 91 b0 0d lds r20, 0x0DB0 ; 0x800db0 27354: 50 91 b1 0d lds r21, 0x0DB1 ; 0x800db1 27358: 60 91 b2 0d lds r22, 0x0DB2 ; 0x800db2 2735c: 70 91 b3 0d lds r23, 0x0DB3 ; 0x800db3 27360: 8f e9 ldi r24, 0x9F ; 159 27362: 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); 27364: 0f 94 01 1f call 0x23e02 ; 0x23e02 27368: 2a cf rjmp .-428 ; 0x271be // 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) { 2736a: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 2736e: 81 ff sbrs r24, 1 27370: 08 c0 rjmp .+16 ; 0x27382 ThermalStop(); } static void bed_min_temp_error(void) { static const char err[] PROGMEM = "MINTEMP BED"; if(IsStopped() == false) { 27372: 80 91 11 05 lds r24, 0x0511 ; 0x800511 27376: 81 11 cpse r24, r1 27378: d9 cf rjmp .-78 ; 0x2732c temp_error_messagepgm(err); 2737a: 61 e0 ldi r22, 0x01 ; 1 2737c: 85 ea ldi r24, 0xA5 ; 165 2737e: 9b e9 ldi r25, 0x9B ; 155 27380: d3 cf rjmp .-90 ; 0x27328 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); 27382: 40 91 ee 04 lds r20, 0x04EE ; 0x8004ee 27386: 50 91 ef 04 lds r21, 0x04EF ; 0x8004ef 2738a: 60 91 f0 04 lds r22, 0x04F0 ; 0x8004f0 2738e: 70 91 f1 04 lds r23, 0x04F1 ; 0x8004f1 27392: 00 e0 ldi r16, 0x00 ; 0 27394: 10 e0 ldi r17, 0x00 ; 0 27396: 20 e7 ldi r18, 0x70 ; 112 27398: 31 e4 ldi r19, 0x41 ; 65 2739a: 8b e9 ldi r24, 0x9B ; 155 2739c: 92 e0 ldi r25, 0x02 ; 2 2739e: e2 cf rjmp .-60 ; 0x27364 break; #endif } break; case TempErrorType::max: switch((TempErrorSource)temp_error_state.source) { 273a0: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 273a4: 86 95 lsr r24 273a6: 86 95 lsr r24 273a8: 83 70 andi r24, 0x03 ; 3 273aa: 81 30 cpi r24, 0x01 ; 1 273ac: b9 f0 breq .+46 ; 0x273dc 273ae: 58 f0 brcs .+22 ; 0x273c6 273b0: 82 30 cpi r24, 0x02 ; 2 273b2: 09 f0 breq .+2 ; 0x273b6 273b4: 04 cf rjmp .-504 ; 0x271be } #ifdef AMBIENT_THERMISTOR static void ambient_max_temp_error(void) { if(IsStopped() == false) { 273b6: 80 91 11 05 lds r24, 0x0511 ; 0x800511 273ba: 81 11 cpse r24, r1 273bc: b7 cf rjmp .-146 ; 0x2732c temp_error_messagepgm(PSTR("MAXTEMP AMB")); 273be: 61 e0 ldi r22, 0x01 ; 1 273c0: 81 ed ldi r24, 0xD1 ; 209 273c2: 9b e9 ldi r25, 0x9B ; 155 273c4: b1 cf rjmp .-158 ; 0x27328 } break; case TempErrorType::max: switch((TempErrorSource)temp_error_state.source) { case TempErrorSource::hotend: max_temp_error(temp_error_state.index); 273c6: 60 91 1b 05 lds r22, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 273ca: 62 95 swap r22 273cc: 61 70 andi r22, 0x01 ; 1 SERIAL_ERRORLNPGM(" triggered!"); } static void max_temp_error(uint8_t e) { if(IsStopped() == false) { 273ce: 80 91 11 05 lds r24, 0x0511 ; 0x800511 273d2: 81 11 cpse r24, r1 273d4: ab cf rjmp .-170 ; 0x2732c temp_error_messagepgm(PSTR("MAXTEMP"), e); 273d6: 8d eb ldi r24, 0xBD ; 189 273d8: 9b e9 ldi r25, 0x9B ; 155 273da: a6 cf rjmp .-180 ; 0x27328 } ThermalStop(); } static void bed_max_temp_error(void) { if(IsStopped() == false) { 273dc: 80 91 11 05 lds r24, 0x0511 ; 0x800511 273e0: 81 11 cpse r24, r1 273e2: a4 cf rjmp .-184 ; 0x2732c temp_error_messagepgm(PSTR("MAXTEMP BED")); 273e4: 61 e0 ldi r22, 0x01 ; 1 273e6: 85 ec ldi r24, 0xC5 ; 197 273e8: 9b e9 ldi r25, 0x9B ; 155 273ea: 9e cf rjmp .-196 ; 0x27328 #endif } break; case TempErrorType::preheat: case TempErrorType::runaway: switch((TempErrorSource)temp_error_state.source) { 273ec: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 273f0: 86 95 lsr r24 273f2: 86 95 lsr r24 273f4: 83 70 andi r24, 0x03 ; 3 273f6: 82 30 cpi r24, 0x02 ; 2 273f8: 08 f0 brcs .+2 ; 0x273fc 273fa: e1 ce rjmp .-574 ; 0x271be case TempErrorSource::hotend: case TempErrorSource::bed: temp_runaway_stop( ((TempErrorType)temp_error_state.type == TempErrorType::preheat), ((TempErrorSource)temp_error_state.source == TempErrorSource::bed)); 273fc: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 27400: 86 95 lsr r24 27402: 86 95 lsr r24 27404: 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), 27406: 90 91 1b 05 lds r25, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 2740a: 92 95 swap r25 2740c: 96 95 lsr r25 2740e: 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( 27410: 61 e0 ldi r22, 0x01 ; 1 27412: 81 30 cpi r24, 0x01 ; 1 27414: 09 f0 breq .+2 ; 0x27418 27416: 60 e0 ldi r22, 0x00 ; 0 27418: 81 e0 ldi r24, 0x01 ; 1 2741a: 92 30 cpi r25, 0x02 ; 2 2741c: 09 f0 breq .+2 ; 0x27420 2741e: 80 e0 ldi r24, 0x00 ; 0 27420: 0f 94 3a 1f call 0x23e74 ; 0x23e74 27424: cc ce rjmp .-616 ; 0x271be SERIAL_ECHOLNPGM("TM: error triggered!"); } ThermalStop(true); WRITE(BEEPER, HIGH); } else { temp_error_state.v = 0; 27426: 10 92 1b 05 sts 0x051B, r1 ; 0x80051b <_ZL16temp_error_state.lto_priv.454> WRITE(BEEPER, LOW); 2742a: 9f b7 in r25, 0x3f ; 63 2742c: f8 94 cli 2742e: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 27432: 8b 7f andi r24, 0xFB ; 251 27434: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 27438: 9f bf out 0x3f, r25 ; 63 // hotend error was transitory and disappeared, re-enable bed if (!target_temperature_bed) 2743a: 80 91 72 06 lds r24, 0x0672 ; 0x800672 2743e: 90 91 73 06 lds r25, 0x0673 ; 0x800673 27442: 89 2b or r24, r25 27444: 39 f4 brne .+14 ; 0x27454 target_temperature_bed = saved_bed_temperature; 27446: 80 91 ae 05 lds r24, 0x05AE ; 0x8005ae 2744a: 90 e0 ldi r25, 0x00 ; 0 2744c: 90 93 73 06 sts 0x0673, r25 ; 0x800673 27450: 80 93 72 06 sts 0x0672, r24 ; 0x800672 SERIAL_ECHOLNPGM("TM: error cleared"); 27454: 8d ed ldi r24, 0xDD ; 221 27456: 9b e9 ldi r25, 0x9B ; 155 27458: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 2745c: b0 ce rjmp .-672 ; 0x271be 0002745e : } bool lcd_wait_for_click_delay(uint16_t nDelay) // nDelay :: timeout [s] (0 ~ no timeout) // true ~ clicked, false ~ delayed { 2745e: 4f 92 push r4 27460: 5f 92 push r5 27462: 6f 92 push r6 27464: 7f 92 push r7 27466: 8f 92 push r8 27468: 9f 92 push r9 2746a: af 92 push r10 2746c: bf 92 push r11 2746e: cf 92 push r12 27470: df 92 push r13 27472: ef 92 push r14 27474: ff 92 push r15 27476: 6c 01 movw r12, r24 bool bDelayed; long nTime0 = _millis()/1000; 27478: 0f 94 4c 29 call 0x25298 ; 0x25298 2747c: 28 ee ldi r18, 0xE8 ; 232 2747e: 33 e0 ldi r19, 0x03 ; 3 27480: 40 e0 ldi r20, 0x00 ; 0 27482: 50 e0 ldi r21, 0x00 ; 0 27484: 0f 94 8f dc call 0x3b91e ; 0x3b91e <__udivmodsi4> 27488: 29 01 movw r4, r18 2748a: 3a 01 movw r6, r20 lcd_consume_click(); 2748c: 0e 94 f8 70 call 0xe1f0 ; 0xe1f0 KEEPALIVE_STATE(PAUSED_FOR_USER); 27490: 84 e0 ldi r24, 0x04 ; 4 27492: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be for (;;) { manage_heater(); manage_inactivity(true); bDelayed = ((_millis()/1000-nTime0) > nDelay); 27496: f1 2c mov r15, r1 27498: e1 2c mov r14, r1 bool bDelayed; long nTime0 = _millis()/1000; lcd_consume_click(); KEEPALIVE_STATE(PAUSED_FOR_USER); for (;;) { manage_heater(); 2749a: 0f 94 5c 38 call 0x270b8 ; 0x270b8 manage_inactivity(true); 2749e: 81 e0 ldi r24, 0x01 ; 1 274a0: 0e 94 af 8a call 0x1155e ; 0x1155e bDelayed = ((_millis()/1000-nTime0) > nDelay); 274a4: 0f 94 4c 29 call 0x25298 ; 0x25298 274a8: 28 ee ldi r18, 0xE8 ; 232 274aa: 33 e0 ldi r19, 0x03 ; 3 274ac: 40 e0 ldi r20, 0x00 ; 0 274ae: 50 e0 ldi r21, 0x00 ; 0 274b0: 0f 94 8f dc call 0x3b91e ; 0x3b91e <__udivmodsi4> 274b4: 49 01 movw r8, r18 274b6: 5a 01 movw r10, r20 274b8: 84 18 sub r8, r4 274ba: 95 08 sbc r9, r5 274bc: a6 08 sbc r10, r6 274be: b7 08 sbc r11, r7 bDelayed = (bDelayed && (nDelay != 0)); // 0 ~ no timeout, always waiting for click if (lcd_clicked() || bDelayed) { 274c0: 0e 94 fd 70 call 0xe1fa ; 0xe1fa 274c4: 81 11 cpse r24, r1 274c6: 07 c0 rjmp .+14 ; 0x274d6 274c8: c8 14 cp r12, r8 274ca: d9 04 cpc r13, r9 274cc: ea 04 cpc r14, r10 274ce: fb 04 cpc r15, r11 274d0: 20 f7 brcc .-56 ; 0x2749a 274d2: 81 e0 ldi r24, 0x01 ; 1 274d4: 07 c0 rjmp .+14 ; 0x274e4 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 274d6: 81 e0 ldi r24, 0x01 ; 1 274d8: c8 14 cp r12, r8 274da: d9 04 cpc r13, r9 274dc: ea 04 cpc r14, r10 274de: fb 04 cpc r15, r11 274e0: 08 f0 brcs .+2 ; 0x274e4 274e2: 80 e0 ldi r24, 0x00 ; 0 if (lcd_clicked() || bDelayed) { KEEPALIVE_STATE(IN_HANDLER); 274e4: 92 e0 ldi r25, 0x02 ; 2 274e6: 90 93 be 02 sts 0x02BE, r25 ; 0x8002be return(!bDelayed); } } } 274ea: 91 e0 ldi r25, 0x01 ; 1 274ec: 89 27 eor r24, r25 274ee: ff 90 pop r15 274f0: ef 90 pop r14 274f2: df 90 pop r13 274f4: cf 90 pop r12 274f6: bf 90 pop r11 274f8: af 90 pop r10 274fa: 9f 90 pop r9 274fc: 8f 90 pop r8 274fe: 7f 90 pop r7 27500: 6f 90 pop r6 27502: 5f 90 pop r5 27504: 4f 90 pop r4 27506: 08 95 ret 00027508 : #endif } static void waiting_handler() { manage_heater(); 27508: 0f 94 5c 38 call 0x270b8 ; 0x270b8 host_keepalive(); 2750c: 0e 94 a7 7f call 0xff4e ; 0xff4e host_autoreport(); 27510: 0e 94 58 79 call 0xf2b0 ; 0xf2b0 checkFans(); 27514: 0e 94 02 80 call 0x10004 ; 0x10004 lcd_update(0); 27518: 80 e0 ldi r24, 0x00 ; 0 2751a: 0c 94 a7 6e jmp 0xdd4e ; 0xdd4e 0002751e : } } static void __attribute__((noinline)) wait_temp() { while(current_temperature[0] < (target_temperature[0] - TEMP_HYSTERESIS)) { 2751e: 60 91 b6 0d lds r22, 0x0DB6 ; 0x800db6 27522: 70 91 b7 0d lds r23, 0x0DB7 ; 0x800db7 27526: 65 50 subi r22, 0x05 ; 5 27528: 71 09 sbc r23, r1 2752a: 07 2e mov r0, r23 2752c: 00 0c add r0, r0 2752e: 88 0b sbc r24, r24 27530: 99 0b sbc r25, r25 27532: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 27536: 9b 01 movw r18, r22 27538: ac 01 movw r20, r24 2753a: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 2753e: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 27542: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 27546: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 2754a: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 2754e: 87 ff sbrs r24, 7 27550: 07 c0 rjmp .+14 ; 0x27560 if(temp_error_state.v) break; 27552: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 27556: 81 11 cpse r24, r1 27558: 03 c0 rjmp .+6 ; 0x27560 waiting_handler(); 2755a: 0f 94 84 3a call 0x27508 ; 0x27508 2755e: df cf rjmp .-66 ; 0x2751e } } 27560: 08 95 ret 00027562 : checkFans(); lcd_update(0); } static void wait(unsigned ms) { 27562: cf 92 push r12 27564: df 92 push r13 27566: ef 92 push r14 27568: ff 92 push r15 2756a: 7c 01 movw r14, r24 unsigned long mark = _millis() + ms; 2756c: 0f 94 4c 29 call 0x25298 ; 0x25298 27570: 9b 01 movw r18, r22 27572: ac 01 movw r20, r24 27574: 2e 0d add r18, r14 27576: 3f 1d adc r19, r15 27578: 41 1d adc r20, r1 2757a: 51 1d adc r21, r1 2757c: 69 01 movw r12, r18 2757e: 7a 01 movw r14, r20 while(_millis() < mark) { 27580: 0f 94 4c 29 call 0x25298 ; 0x25298 27584: 6c 15 cp r22, r12 27586: 7d 05 cpc r23, r13 27588: 8e 05 cpc r24, r14 2758a: 9f 05 cpc r25, r15 2758c: 38 f4 brcc .+14 ; 0x2759c if(temp_error_state.v) break; 2758e: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 27592: 81 11 cpse r24, r1 27594: 03 c0 rjmp .+6 ; 0x2759c waiting_handler(); 27596: 0f 94 84 3a call 0x27508 ; 0x27508 2759a: f2 cf rjmp .-28 ; 0x27580 } } 2759c: ff 90 pop r15 2759e: ef 90 pop r14 275a0: df 90 pop r13 275a2: cf 90 pop r12 275a4: 08 95 ret 000275a6 : 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; 275a6: 20 91 2a 0e lds r18, 0x0E2A ; 0x800e2a 275aa: 30 91 2b 0e lds r19, 0x0E2B ; 0x800e2b 275ae: 40 91 2c 0e lds r20, 0x0E2C ; 0x800e2c 275b2: 50 91 2d 0e lds r21, 0x0E2D ; 0x800e2d 275b6: 60 e0 ldi r22, 0x00 ; 0 275b8: 70 e0 ldi r23, 0x00 ; 0 275ba: 8f e7 ldi r24, 0x7F ; 127 275bc: 93 e4 ldi r25, 0x43 ; 67 275be: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 275c2: 60 93 af 04 sts 0x04AF, r22 ; 0x8004af <_ZL14iState_sum_max.lto_priv.469> 275c6: 70 93 b0 04 sts 0x04B0, r23 ; 0x8004b0 <_ZL14iState_sum_max.lto_priv.469+0x1> 275ca: 80 93 b1 04 sts 0x04B1, r24 ; 0x8004b1 <_ZL14iState_sum_max.lto_priv.469+0x2> 275ce: 90 93 b2 04 sts 0x04B2, r25 ; 0x8004b2 <_ZL14iState_sum_max.lto_priv.469+0x3> } #endif #ifdef PIDTEMPBED temp_iState_max_bed = PID_INTEGRAL_DRIVE_MAX / cs.bedKi; 275d2: 20 91 36 0e lds r18, 0x0E36 ; 0x800e36 275d6: 30 91 37 0e lds r19, 0x0E37 ; 0x800e37 275da: 40 91 38 0e lds r20, 0x0E38 ; 0x800e38 275de: 50 91 39 0e lds r21, 0x0E39 ; 0x800e39 275e2: 60 e0 ldi r22, 0x00 ; 0 275e4: 70 e0 ldi r23, 0x00 ; 0 275e6: 8f e7 ldi r24, 0x7F ; 127 275e8: 93 e4 ldi r25, 0x43 ; 67 275ea: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 275ee: 60 93 a7 04 sts 0x04A7, r22 ; 0x8004a7 <_ZL19temp_iState_max_bed.lto_priv.467> 275f2: 70 93 a8 04 sts 0x04A8, r23 ; 0x8004a8 <_ZL19temp_iState_max_bed.lto_priv.467+0x1> 275f6: 80 93 a9 04 sts 0x04A9, r24 ; 0x8004a9 <_ZL19temp_iState_max_bed.lto_priv.467+0x2> 275fa: 90 93 aa 04 sts 0x04AA, r25 ; 0x8004aa <_ZL19temp_iState_max_bed.lto_priv.467+0x3> #endif } 275fe: 08 95 ret 00027600 : #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) { 27600: 2f 92 push r2 27602: 3f 92 push r3 27604: 4f 92 push r4 27606: 5f 92 push r5 27608: 6f 92 push r6 2760a: 7f 92 push r7 2760c: 8f 92 push r8 2760e: 9f 92 push r9 27610: af 92 push r10 27612: bf 92 push r11 27614: cf 92 push r12 27616: df 92 push r13 27618: ef 92 push r14 2761a: ff 92 push r15 2761c: 0f 93 push r16 2761e: 1f 93 push r17 27620: cf 93 push r28 27622: df 93 push r29 27624: cd b7 in r28, 0x3d ; 61 27626: de b7 in r29, 0x3e ; 62 27628: e0 97 sbiw r28, 0x30 ; 48 2762a: 0f b6 in r0, 0x3f ; 63 2762c: f8 94 cli 2762e: de bf out 0x3e, r29 ; 62 27630: 0f be out 0x3f, r0 ; 63 27632: cd bf out 0x3d, r28 ; 61 27634: 6a 87 std Y+10, r22 ; 0x0a 27636: 7b 87 std Y+11, r23 ; 0x0b 27638: 8c 87 std Y+12, r24 ; 0x0c 2763a: 9d 87 std Y+13, r25 ; 0x0d 2763c: 1a 01 movw r2, r20 2763e: 3a a7 std Y+42, r19 ; 0x2a 27640: 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(); 27642: 0f 94 18 2f call 0x25e30 ; 0x25e30 pid_tuning_finished = false; 27646: 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; 2764a: 29 a5 ldd r18, Y+41 ; 0x29 2764c: 3a a5 ldd r19, Y+42 ; 0x2a 2764e: 30 93 48 06 sts 0x0648, r19 ; 0x800648 27652: 20 93 47 06 sts 0x0647, r18 ; 0x800647 float input = 0.0; pid_cycle=0; 27656: 10 92 4a 06 sts 0x064A, r1 ; 0x80064a 2765a: 10 92 49 06 sts 0x0649, r1 ; 0x800649 bool heating = true; unsigned long temp_millis = _millis(); 2765e: 0f 94 4c 29 call 0x25298 ; 0x25298 27662: 6e 83 std Y+6, r22 ; 0x06 27664: 7f 83 std Y+7, r23 ; 0x07 27666: 88 87 std Y+8, r24 ; 0x08 27668: 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 2766a: 37 fe sbrs r3, 7 2766c: ff c0 rjmp .+510 ; 0x2786c 2766e: 3d e2 ldi r19, 0x2D ; 45 27670: 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(); 27672: 0f 94 4c 29 call 0x25298 ; 0x25298 27676: 6c a3 std Y+36, r22 ; 0x24 27678: 7d a3 std Y+37, r23 ; 0x25 2767a: 8e a3 std Y+38, r24 ; 0x26 2767c: 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."); 2767e: 8d e5 ldi r24, 0x5D ; 93 27680: 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) 27682: 12 14 cp r1, r2 27684: 13 04 cpc r1, r3 27686: 0c f4 brge .+2 ; 0x2768a 27688: 8a c2 rjmp .+1300 ; 0x27b9e pid_tuning_finished = true; pid_cycle = 0; return; } SERIAL_ECHOLNPGM("PID Autotune start"); 2768a: 8a e4 ldi r24, 0x4A ; 74 2768c: 9b e9 ldi r25, 0x9B ; 155 2768e: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 27692: 6a 85 ldd r22, Y+10 ; 0x0a 27694: 7b 85 ldd r23, Y+11 ; 0x0b 27696: 8c 85 ldd r24, Y+12 ; 0x0c 27698: 9d 85 ldd r25, Y+13 ; 0x0d 2769a: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> if (extruder<0) { soft_pwm_bed = (MAX_BED_POWER)/2; 2769e: 2f e7 ldi r18, 0x7F ; 127 return; } SERIAL_ECHOLNPGM("PID Autotune start"); if (extruder<0) 276a0: 21 14 cp r2, r1 276a2: 31 04 cpc r3, r1 276a4: 09 f4 brne .+2 ; 0x276a8 276a6: e5 c0 rjmp .+458 ; 0x27872 { soft_pwm_bed = (MAX_BED_POWER)/2; 276a8: 20 93 1d 06 sts 0x061D, r18 ; 0x80061d bias = d = (MAX_BED_POWER)/2; target_temperature_bed = (int)temp; // to display the requested target bed temperature properly on the main screen 276ac: 70 93 73 06 sts 0x0673, r23 ; 0x800673 276b0: 60 93 72 06 sts 0x0672, r22 ; 0x800672 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 276b4: 8e 81 ldd r24, Y+6 ; 0x06 276b6: 9f 81 ldd r25, Y+7 ; 0x07 276b8: a8 85 ldd r26, Y+8 ; 0x08 276ba: b9 85 ldd r27, Y+9 ; 0x09 276bc: 8e 87 std Y+14, r24 ; 0x0e 276be: 9f 87 std Y+15, r25 ; 0x0f 276c0: a8 8b std Y+16, r26 ; 0x10 276c2: b9 8b std Y+17, r27 ; 0x11 276c4: 88 a3 std Y+32, r24 ; 0x20 276c6: 99 a3 std Y+33, r25 ; 0x21 276c8: aa a3 std Y+34, r26 ; 0x22 276ca: bb a3 std Y+35, r27 ; 0x23 276cc: 1a 8a std Y+18, r1 ; 0x12 276ce: 90 e4 ldi r25, 0x40 ; 64 276d0: 9b 8b std Y+19, r25 ; 0x13 276d2: ac e1 ldi r26, 0x1C ; 28 276d4: ac 8b std Y+20, r26 ; 0x14 276d6: b6 e4 ldi r27, 0x46 ; 70 276d8: bd 8b std Y+21, r27 ; 0x15 276da: 1e 8a std Y+22, r1 ; 0x16 276dc: 1f 8a std Y+23, r1 ; 0x17 276de: 18 8e std Y+24, r1 ; 0x18 276e0: 19 8e std Y+25, r1 ; 0x19 276e2: 6f e7 ldi r22, 0x7F ; 127 276e4: c6 2e mov r12, r22 276e6: d1 2c mov r13, r1 276e8: e1 2c mov r14, r1 276ea: f1 2c mov r15, r1 276ec: 00 e0 ldi r16, 0x00 ; 0 276ee: 10 e0 ldi r17, 0x00 ; 0 276f0: 18 aa std Y+48, r1 ; 0x30 276f2: 1f a6 std Y+47, r1 ; 0x2f 276f4: 1d 82 std Y+5, r1 ; 0x05 276f6: 2f e7 ldi r18, 0x7F ; 127 276f8: 30 e0 ldi r19, 0x00 ; 0 276fa: 40 e0 ldi r20, 0x00 ; 0 276fc: 50 e0 ldi r21, 0x00 ; 0 276fe: 29 83 std Y+1, r18 ; 0x01 27700: 3a 83 std Y+2, r19 ; 0x02 27702: 4b 83 std Y+3, r20 ; 0x03 27704: 5c 83 std Y+4, r21 ; 0x04 27706: 1b 8e std Y+27, r1 ; 0x1b 27708: 1c 8e std Y+28, r1 ; 0x1c 2770a: 1d 8e std Y+29, r1 ; 0x1d 2770c: 1e 8e std Y+30, r1 ; 0x1e 2770e: 31 e0 ldi r19, 0x01 ; 1 27710: 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(); 27712: a8 95 wdr #endif //WATCHDOG if(temp_meas_ready == true) { // temp sample ready 27714: 40 91 02 06 lds r20, 0x0602 ; 0x800602 27718: 48 a7 std Y+40, r20 ; 0x28 2771a: 44 23 and r20, r20 2771c: 09 f4 brne .+2 ; 0x27720 2771e: 2c c2 rjmp .+1112 ; 0x27b78 updateTemperatures(); 27720: 0f 94 7d 32 call 0x264fa ; 0x264fa input = (extruder<0)?current_temperature_bed:current_temperature[extruder]; 27724: 21 14 cp r2, r1 27726: 31 04 cpc r3, r1 27728: 09 f0 breq .+2 ; 0x2772c 2772a: aa c0 rjmp .+340 ; 0x27880 2772c: 00 91 b0 0d lds r16, 0x0DB0 ; 0x800db0 27730: 10 91 b1 0d lds r17, 0x0DB1 ; 0x800db1 27734: 50 91 b2 0d lds r21, 0x0DB2 ; 0x800db2 27738: 58 ab std Y+48, r21 ; 0x30 2773a: 80 91 b3 0d lds r24, 0x0DB3 ; 0x800db3 2773e: 8f a7 std Y+47, r24 ; 0x2f max=max(max,input); 27740: 2e 89 ldd r18, Y+22 ; 0x16 27742: 3f 89 ldd r19, Y+23 ; 0x17 27744: 48 8d ldd r20, Y+24 ; 0x18 27746: 59 8d ldd r21, Y+25 ; 0x19 27748: b8 01 movw r22, r16 2774a: 88 a9 ldd r24, Y+48 ; 0x30 2774c: 9f a5 ldd r25, Y+47 ; 0x2f 2774e: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 27752: 87 fd sbrc r24, 7 27754: 06 c0 rjmp .+12 ; 0x27762 27756: 0e 8b std Y+22, r16 ; 0x16 27758: 1f 8b std Y+23, r17 ; 0x17 2775a: b8 a9 ldd r27, Y+48 ; 0x30 2775c: b8 8f std Y+24, r27 ; 0x18 2775e: 2f a5 ldd r18, Y+47 ; 0x2f 27760: 29 8f std Y+25, r18 ; 0x19 min=min(min,input); 27762: 2a 89 ldd r18, Y+18 ; 0x12 27764: 3b 89 ldd r19, Y+19 ; 0x13 27766: 4c 89 ldd r20, Y+20 ; 0x14 27768: 5d 89 ldd r21, Y+21 ; 0x15 2776a: b8 01 movw r22, r16 2776c: 88 a9 ldd r24, Y+48 ; 0x30 2776e: 9f a5 ldd r25, Y+47 ; 0x2f 27770: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 27774: 18 16 cp r1, r24 27776: 34 f0 brlt .+12 ; 0x27784 27778: 0a 8b std Y+18, r16 ; 0x12 2777a: 1b 8b std Y+19, r17 ; 0x13 2777c: 38 a9 ldd r19, Y+48 ; 0x30 2777e: 3c 8b std Y+20, r19 ; 0x14 27780: 4f a5 ldd r20, Y+47 ; 0x2f 27782: 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) { 27784: 0f 94 4c 29 call 0x25298 ; 0x25298 27788: 2c a1 ldd r18, Y+36 ; 0x24 2778a: 3d a1 ldd r19, Y+37 ; 0x25 2778c: 4e a1 ldd r20, Y+38 ; 0x26 2778e: 5f a1 ldd r21, Y+39 ; 0x27 27790: 62 1b sub r22, r18 27792: 73 0b sbc r23, r19 27794: 84 0b sbc r24, r20 27796: 95 0b sbc r25, r21 27798: 65 3c cpi r22, 0xC5 ; 197 2779a: 79 40 sbci r23, 0x09 ; 9 2779c: 81 05 cpc r24, r1 2779e: 91 05 cpc r25, r1 277a0: 40 f0 brcs .+16 ; 0x277b2 checkExtruderAutoFans(); 277a2: 0e 94 a7 75 call 0xeb4e ; 0xeb4e extruder_autofan_last_check = _millis(); 277a6: 0f 94 4c 29 call 0x25298 ; 0x25298 277aa: 6c a3 std Y+36, r22 ; 0x24 277ac: 7d a3 std Y+37, r23 ; 0x25 277ae: 8e a3 std Y+38, r24 ; 0x26 277b0: 9f a3 std Y+39, r25 ; 0x27 } #endif if(heating == true && input > temp) { 277b2: 4a 8d ldd r20, Y+26 ; 0x1a 277b4: 44 23 and r20, r20 277b6: 09 f4 brne .+2 ; 0x277ba 277b8: 4c c0 rjmp .+152 ; 0x27852 277ba: 2a 85 ldd r18, Y+10 ; 0x0a 277bc: 3b 85 ldd r19, Y+11 ; 0x0b 277be: 4c 85 ldd r20, Y+12 ; 0x0c 277c0: 5d 85 ldd r21, Y+13 ; 0x0d 277c2: b8 01 movw r22, r16 277c4: 88 a9 ldd r24, Y+48 ; 0x30 277c6: 9f a5 ldd r25, Y+47 ; 0x2f 277c8: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 277cc: 18 16 cp r1, r24 277ce: 0c f0 brlt .+2 ; 0x277d2 277d0: d3 c1 rjmp .+934 ; 0x27b78 if(_millis() - t2 > 5000) { 277d2: 0f 94 4c 29 call 0x25298 ; 0x25298 277d6: 2e 85 ldd r18, Y+14 ; 0x0e 277d8: 3f 85 ldd r19, Y+15 ; 0x0f 277da: 48 89 ldd r20, Y+16 ; 0x10 277dc: 59 89 ldd r21, Y+17 ; 0x11 277de: 62 1b sub r22, r18 277e0: 73 0b sbc r23, r19 277e2: 84 0b sbc r24, r20 277e4: 95 0b sbc r25, r21 277e6: 69 38 cpi r22, 0x89 ; 137 277e8: 73 41 sbci r23, 0x13 ; 19 277ea: 81 05 cpc r24, r1 277ec: 91 05 cpc r25, r1 277ee: 08 f4 brcc .+2 ; 0x277f2 277f0: c3 c1 rjmp .+902 ; 0x27b78 277f2: d7 01 movw r26, r14 277f4: c6 01 movw r24, r12 277f6: 29 81 ldd r18, Y+1 ; 0x01 277f8: 3a 81 ldd r19, Y+2 ; 0x02 277fa: 4b 81 ldd r20, Y+3 ; 0x03 277fc: 5c 81 ldd r21, Y+4 ; 0x04 277fe: 82 1b sub r24, r18 27800: 93 0b sbc r25, r19 27802: a4 0b sbc r26, r20 27804: b5 0b sbc r27, r21 27806: b5 95 asr r27 27808: a7 95 ror r26 2780a: 97 95 ror r25 2780c: 87 95 ror r24 heating=false; if (extruder<0) { 2780e: 21 14 cp r2, r1 27810: 31 04 cpc r3, r1 27812: 09 f4 brne .+2 ; 0x27816 27814: 40 c0 rjmp .+128 ; 0x27896 soft_pwm_bed = (bias - d) >> 1; 27816: 80 93 1d 06 sts 0x061D, r24 ; 0x80061d } else soft_pwm[extruder] = (bias - d) >> 1; t1=_millis(); 2781a: 0f 94 4c 29 call 0x25298 ; 0x25298 2781e: 6e 83 std Y+6, r22 ; 0x06 27820: 7f 83 std Y+7, r23 ; 0x07 27822: 88 87 std Y+8, r24 ; 0x08 27824: 99 87 std Y+9, r25 ; 0x09 t_high=t1 - t2; 27826: dc 01 movw r26, r24 27828: cb 01 movw r24, r22 2782a: 2e 85 ldd r18, Y+14 ; 0x0e 2782c: 3f 85 ldd r19, Y+15 ; 0x0f 2782e: 48 89 ldd r20, Y+16 ; 0x10 27830: 59 89 ldd r21, Y+17 ; 0x11 27832: 82 1b sub r24, r18 27834: 93 0b sbc r25, r19 27836: a4 0b sbc r26, r20 27838: b5 0b sbc r27, r21 2783a: 8b 8f std Y+27, r24 ; 0x1b 2783c: 9c 8f std Y+28, r25 ; 0x1c 2783e: ad 8f std Y+29, r26 ; 0x1d 27840: be 8f std Y+30, r27 ; 0x1e max=temp; 27842: 3a 85 ldd r19, Y+10 ; 0x0a 27844: 3e 8b std Y+22, r19 ; 0x16 27846: 4b 85 ldd r20, Y+11 ; 0x0b 27848: 4f 8b std Y+23, r20 ; 0x17 2784a: 5c 85 ldd r21, Y+12 ; 0x0c 2784c: 58 8f std Y+24, r21 ; 0x18 2784e: 8d 85 ldd r24, Y+13 ; 0x0d 27850: 89 8f std Y+25, r24 ; 0x19 } } if(heating == false && input < temp) { 27852: 2a 85 ldd r18, Y+10 ; 0x0a 27854: 3b 85 ldd r19, Y+11 ; 0x0b 27856: 4c 85 ldd r20, Y+12 ; 0x0c 27858: 5d 85 ldd r21, Y+13 ; 0x0d 2785a: b8 01 movw r22, r16 2785c: 88 a9 ldd r24, Y+48 ; 0x30 2785e: 9f a5 ldd r25, Y+47 ; 0x2f 27860: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 27864: 87 fd sbrc r24, 7 27866: 1a c0 rjmp .+52 ; 0x2789c if(_millis() - t1 > 5000) { 27868: 1a 8e std Y+26, r1 ; 0x1a 2786a: 86 c1 rjmp .+780 ; 0x27b78 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 2786c: 4a e0 ldi r20, 0x0A ; 10 2786e: 4f 8f std Y+31, r20 ; 0x1f 27870: 00 cf rjmp .-512 ; 0x27672 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; 27872: 20 93 16 05 sts 0x0516, r18 ; 0x800516 <_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 27876: 70 93 b7 0d sts 0x0DB7, r23 ; 0x800db7 2787a: 60 93 b6 0d sts 0x0DB6, r22 ; 0x800db6 2787e: 1a cf rjmp .-460 ; 0x276b4 wdt_reset(); #endif //WATCHDOG if(temp_meas_ready == true) { // temp sample ready updateTemperatures(); input = (extruder<0)?current_temperature_bed:current_temperature[extruder]; 27880: 00 91 ee 04 lds r16, 0x04EE ; 0x8004ee 27884: 10 91 ef 04 lds r17, 0x04EF ; 0x8004ef 27888: 90 91 f0 04 lds r25, 0x04F0 ; 0x8004f0 2788c: 98 ab std Y+48, r25 ; 0x30 2788e: a0 91 f1 04 lds r26, 0x04F1 ; 0x8004f1 27892: af a7 std Y+47, r26 ; 0x2f 27894: 55 cf rjmp .-342 ; 0x27740 heating=false; if (extruder<0) { soft_pwm_bed = (bias - d) >> 1; } else soft_pwm[extruder] = (bias - d) >> 1; 27896: 80 93 16 05 sts 0x0516, r24 ; 0x800516 <_ZL8soft_pwm.lto_priv.459> 2789a: bf cf rjmp .-130 ; 0x2781a t_high=t1 - t2; max=temp; } } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { 2789c: 0f 94 4c 29 call 0x25298 ; 0x25298 278a0: 2e 81 ldd r18, Y+6 ; 0x06 278a2: 3f 81 ldd r19, Y+7 ; 0x07 278a4: 48 85 ldd r20, Y+8 ; 0x08 278a6: 59 85 ldd r21, Y+9 ; 0x09 278a8: 62 1b sub r22, r18 278aa: 73 0b sbc r23, r19 278ac: 84 0b sbc r24, r20 278ae: 95 0b sbc r25, r21 278b0: 69 38 cpi r22, 0x89 ; 137 278b2: 73 41 sbci r23, 0x13 ; 19 278b4: 81 05 cpc r24, r1 278b6: 91 05 cpc r25, r1 278b8: b8 f2 brcs .-82 ; 0x27868 heating=true; t2=_millis(); 278ba: 0f 94 4c 29 call 0x25298 ; 0x25298 278be: 6e 87 std Y+14, r22 ; 0x0e 278c0: 7f 87 std Y+15, r23 ; 0x0f 278c2: 88 8b std Y+16, r24 ; 0x10 278c4: 99 8b std Y+17, r25 ; 0x11 t_low=t2 - t1; if(pid_cycle > 0) { 278c6: 80 91 49 06 lds r24, 0x0649 ; 0x800649 278ca: 90 91 4a 06 lds r25, 0x064A ; 0x80064a 278ce: 18 16 cp r1, r24 278d0: 19 06 cpc r1, r25 278d2: 0c f0 brlt .+2 ; 0x278d6 278d4: 2c c1 rjmp .+600 ; 0x27b2e } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { heating=true; t2=_millis(); t_low=t2 - t1; 278d6: 8e 85 ldd r24, Y+14 ; 0x0e 278d8: 9f 85 ldd r25, Y+15 ; 0x0f 278da: a8 89 ldd r26, Y+16 ; 0x10 278dc: b9 89 ldd r27, Y+17 ; 0x11 278de: 2e 81 ldd r18, Y+6 ; 0x06 278e0: 3f 81 ldd r19, Y+7 ; 0x07 278e2: 48 85 ldd r20, Y+8 ; 0x08 278e4: 59 85 ldd r21, Y+9 ; 0x09 278e6: 82 1b sub r24, r18 278e8: 93 0b sbc r25, r19 278ea: a4 0b sbc r26, r20 278ec: b5 0b sbc r27, r21 if(pid_cycle > 0) { bias += (d*(t_high - t_low))/(t_low + t_high); 278ee: 4b 8c ldd r4, Y+27 ; 0x1b 278f0: 5c 8c ldd r5, Y+28 ; 0x1c 278f2: 6d 8c ldd r6, Y+29 ; 0x1d 278f4: 7e 8c ldd r7, Y+30 ; 0x1e 278f6: 48 0e add r4, r24 278f8: 59 1e adc r5, r25 278fa: 6a 1e adc r6, r26 278fc: 7b 1e adc r7, r27 278fe: 2b 8d ldd r18, Y+27 ; 0x1b 27900: 3c 8d ldd r19, Y+28 ; 0x1c 27902: 4d 8d ldd r20, Y+29 ; 0x1d 27904: 5e 8d ldd r21, Y+30 ; 0x1e 27906: 28 1b sub r18, r24 27908: 39 0b sbc r19, r25 2790a: 4a 0b sbc r20, r26 2790c: 5b 0b sbc r21, r27 2790e: 69 81 ldd r22, Y+1 ; 0x01 27910: 7a 81 ldd r23, Y+2 ; 0x02 27912: 8b 81 ldd r24, Y+3 ; 0x03 27914: 9c 81 ldd r25, Y+4 ; 0x04 27916: 0f 94 7f dc call 0x3b8fe ; 0x3b8fe <__mulsi3> 2791a: a3 01 movw r20, r6 2791c: 92 01 movw r18, r4 2791e: 0f 94 0d dd call 0x3ba1a ; 0x3ba1a <__divmodsi4> 27922: da 01 movw r26, r20 27924: c9 01 movw r24, r18 27926: 8c 0d add r24, r12 27928: 9d 1d adc r25, r13 2792a: ae 1d adc r26, r14 2792c: bf 1d adc r27, r15 bias = constrain(bias, 20 ,(extruder<0?(MAX_BED_POWER):(PID_MAX))-20); 2792e: 84 31 cpi r24, 0x14 ; 20 27930: 91 05 cpc r25, r1 27932: a1 05 cpc r26, r1 27934: b1 05 cpc r27, r1 27936: 0c f4 brge .+2 ; 0x2793a 27938: 3c c1 rjmp .+632 ; 0x27bb2 2793a: 6c 01 movw r12, r24 2793c: 7d 01 movw r14, r26 2793e: 3c ee ldi r19, 0xEC ; 236 27940: c3 16 cp r12, r19 27942: d1 04 cpc r13, r1 27944: e1 04 cpc r14, r1 27946: f1 04 cpc r15, r1 27948: 2c f0 brlt .+10 ; 0x27954 2794a: 4b ee ldi r20, 0xEB ; 235 2794c: c4 2e mov r12, r20 2794e: d1 2c mov r13, r1 27950: e1 2c mov r14, r1 27952: 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; 27954: 80 38 cpi r24, 0x80 ; 128 27956: 91 05 cpc r25, r1 27958: a1 05 cpc r26, r1 2795a: b1 05 cpc r27, r1 2795c: 0c f4 brge .+2 ; 0x27960 2795e: 37 c1 rjmp .+622 ; 0x27bce 27960: 8e ef ldi r24, 0xFE ; 254 27962: 90 e0 ldi r25, 0x00 ; 0 27964: a0 e0 ldi r26, 0x00 ; 0 27966: b0 e0 ldi r27, 0x00 ; 0 27968: 8c 19 sub r24, r12 2796a: 9d 09 sbc r25, r13 2796c: ae 09 sbc r26, r14 2796e: bf 09 sbc r27, r15 27970: 89 83 std Y+1, r24 ; 0x01 27972: 9a 83 std Y+2, r25 ; 0x02 27974: ab 83 std Y+3, r26 ; 0x03 27976: bc 83 std Y+4, r27 ; 0x04 else d = bias; SERIAL_PROTOCOLPGM(" bias: "); SERIAL_PROTOCOL(bias); 27978: 82 e4 ldi r24, 0x42 ; 66 2797a: 9b e9 ldi r25, 0x9B ; 155 2797c: 0e 94 50 77 call 0xeea0 ; 0xeea0 27980: c7 01 movw r24, r14 27982: b6 01 movw r22, r12 27984: 0f 94 6b d5 call 0x3aad6 ; 0x3aad6 SERIAL_PROTOCOLPGM(" d: "); SERIAL_PROTOCOL(d); 27988: 8d e3 ldi r24, 0x3D ; 61 2798a: 9b e9 ldi r25, 0x9B ; 155 2798c: 0e 94 50 77 call 0xeea0 ; 0xeea0 27990: 69 81 ldd r22, Y+1 ; 0x01 27992: 7a 81 ldd r23, Y+2 ; 0x02 27994: 8b 81 ldd r24, Y+3 ; 0x03 27996: 9c 81 ldd r25, Y+4 ; 0x04 27998: 0f 94 6b d5 call 0x3aad6 ; 0x3aad6 SERIAL_PROTOCOLPGM(" min: "); SERIAL_PROTOCOL(min); 2799c: 86 e3 ldi r24, 0x36 ; 54 2799e: 9b e9 ldi r25, 0x9B ; 155 279a0: 0e 94 50 77 call 0xeea0 ; 0xeea0 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 279a4: 42 e0 ldi r20, 0x02 ; 2 279a6: 6a 89 ldd r22, Y+18 ; 0x12 279a8: 7b 89 ldd r23, Y+19 ; 0x13 279aa: 8c 89 ldd r24, Y+20 ; 0x14 279ac: 9d 89 ldd r25, Y+21 ; 0x15 279ae: 0f 94 87 d5 call 0x3ab0e ; 0x3ab0e SERIAL_PROTOCOLPGM(" max: "); SERIAL_PROTOCOLLN(max); 279b2: 8f e2 ldi r24, 0x2F ; 47 279b4: 9b e9 ldi r25, 0x9B ; 155 279b6: 0e 94 50 77 call 0xeea0 ; 0xeea0 279ba: 6e 89 ldd r22, Y+22 ; 0x16 279bc: 7f 89 ldd r23, Y+23 ; 0x17 279be: 88 8d ldd r24, Y+24 ; 0x18 279c0: 99 8d ldd r25, Y+25 ; 0x19 279c2: 0f 94 b4 74 call 0x2e968 ; 0x2e968 if(pid_cycle > 2) { 279c6: 80 91 49 06 lds r24, 0x0649 ; 0x800649 279ca: 90 91 4a 06 lds r25, 0x064A ; 0x80064a 279ce: 03 97 sbiw r24, 0x03 ; 3 279d0: 0c f4 brge .+2 ; 0x279d4 279d2: ad c0 rjmp .+346 ; 0x27b2e Ku = (4.0*d)/(3.14159*(max-min)/2.0); 279d4: 69 81 ldd r22, Y+1 ; 0x01 279d6: 7a 81 ldd r23, Y+2 ; 0x02 279d8: 8b 81 ldd r24, Y+3 ; 0x03 279da: 9c 81 ldd r25, Y+4 ; 0x04 279dc: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 279e0: 20 e0 ldi r18, 0x00 ; 0 279e2: 30 e0 ldi r19, 0x00 ; 0 279e4: 40 e8 ldi r20, 0x80 ; 128 279e6: 50 e4 ldi r21, 0x40 ; 64 279e8: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 279ec: 4b 01 movw r8, r22 279ee: 5c 01 movw r10, r24 279f0: 2a 89 ldd r18, Y+18 ; 0x12 279f2: 3b 89 ldd r19, Y+19 ; 0x13 279f4: 4c 89 ldd r20, Y+20 ; 0x14 279f6: 5d 89 ldd r21, Y+21 ; 0x15 279f8: 6e 89 ldd r22, Y+22 ; 0x16 279fa: 7f 89 ldd r23, Y+23 ; 0x17 279fc: 88 8d ldd r24, Y+24 ; 0x18 279fe: 99 8d ldd r25, Y+25 ; 0x19 27a00: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 27a04: 20 ed ldi r18, 0xD0 ; 208 27a06: 3f e0 ldi r19, 0x0F ; 15 27a08: 49 e4 ldi r20, 0x49 ; 73 27a0a: 50 e4 ldi r21, 0x40 ; 64 27a0c: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 27a10: 20 e0 ldi r18, 0x00 ; 0 27a12: 30 e0 ldi r19, 0x00 ; 0 27a14: 40 e0 ldi r20, 0x00 ; 0 27a16: 5f e3 ldi r21, 0x3F ; 63 27a18: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 27a1c: 9b 01 movw r18, r22 27a1e: ac 01 movw r20, r24 27a20: c5 01 movw r24, r10 27a22: b4 01 movw r22, r8 27a24: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 27a28: 4b 01 movw r8, r22 27a2a: 5c 01 movw r10, r24 Tu = ((float)(t_low + t_high)/1000.0); 27a2c: c3 01 movw r24, r6 27a2e: b2 01 movw r22, r4 27a30: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 27a34: 20 e0 ldi r18, 0x00 ; 0 27a36: 30 e0 ldi r19, 0x00 ; 0 27a38: 4a e7 ldi r20, 0x7A ; 122 27a3a: 54 e4 ldi r21, 0x44 ; 68 27a3c: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 27a40: 2b 01 movw r4, r22 27a42: 3c 01 movw r6, r24 SERIAL_PROTOCOLPGM(" Ku: "); SERIAL_PROTOCOL(Ku); 27a44: 89 e2 ldi r24, 0x29 ; 41 27a46: 9b e9 ldi r25, 0x9B ; 155 27a48: 0e 94 50 77 call 0xeea0 ; 0xeea0 27a4c: 42 e0 ldi r20, 0x02 ; 2 27a4e: c5 01 movw r24, r10 27a50: b4 01 movw r22, r8 27a52: 0f 94 87 d5 call 0x3ab0e ; 0x3ab0e SERIAL_PROTOCOLPGM(" Tu: "); SERIAL_PROTOCOLLN(Tu); 27a56: 83 e2 ldi r24, 0x23 ; 35 27a58: 9b e9 ldi r25, 0x9B ; 155 27a5a: 0e 94 50 77 call 0xeea0 ; 0xeea0 27a5e: c3 01 movw r24, r6 27a60: b2 01 movw r22, r4 27a62: 0f 94 b4 74 call 0x2e968 ; 0x2e968 _Kp = 0.6*Ku; 27a66: 2a e9 ldi r18, 0x9A ; 154 27a68: 39 e9 ldi r19, 0x99 ; 153 27a6a: 49 e1 ldi r20, 0x19 ; 25 27a6c: 5f e3 ldi r21, 0x3F ; 63 27a6e: c5 01 movw r24, r10 27a70: b4 01 movw r22, r8 27a72: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 27a76: 4b 01 movw r8, r22 27a78: 5c 01 movw r10, r24 27a7a: 80 92 f3 03 sts 0x03F3, r8 ; 0x8003f3 <_Kp> 27a7e: 90 92 f4 03 sts 0x03F4, r9 ; 0x8003f4 <_Kp+0x1> 27a82: a0 92 f5 03 sts 0x03F5, r10 ; 0x8003f5 <_Kp+0x2> 27a86: b0 92 f6 03 sts 0x03F6, r11 ; 0x8003f6 <_Kp+0x3> _Ki = 2*_Kp/Tu; 27a8a: ac 01 movw r20, r24 27a8c: 9b 01 movw r18, r22 27a8e: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 27a92: a3 01 movw r20, r6 27a94: 92 01 movw r18, r4 27a96: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 27a9a: 60 93 ef 03 sts 0x03EF, r22 ; 0x8003ef <_Ki> 27a9e: 70 93 f0 03 sts 0x03F0, r23 ; 0x8003f0 <_Ki+0x1> 27aa2: 80 93 f1 03 sts 0x03F1, r24 ; 0x8003f1 <_Ki+0x2> 27aa6: 90 93 f2 03 sts 0x03F2, r25 ; 0x8003f2 <_Ki+0x3> _Kd = _Kp*Tu/8; 27aaa: a3 01 movw r20, r6 27aac: 92 01 movw r18, r4 27aae: c5 01 movw r24, r10 27ab0: b4 01 movw r22, r8 27ab2: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 27ab6: 20 e0 ldi r18, 0x00 ; 0 27ab8: 30 e0 ldi r19, 0x00 ; 0 27aba: 40 e0 ldi r20, 0x00 ; 0 27abc: 5e e3 ldi r21, 0x3E ; 62 27abe: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 27ac2: 60 93 eb 03 sts 0x03EB, r22 ; 0x8003eb <_Kd> 27ac6: 70 93 ec 03 sts 0x03EC, r23 ; 0x8003ec <_Kd+0x1> 27aca: 80 93 ed 03 sts 0x03ED, r24 ; 0x8003ed <_Kd+0x2> 27ace: 90 93 ee 03 sts 0x03EE, r25 ; 0x8003ee <_Kd+0x3> SERIAL_PROTOCOLLNPGM(" Classic PID "); 27ad2: 85 e1 ldi r24, 0x15 ; 21 27ad4: 9b e9 ldi r25, 0x9B ; 155 27ad6: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 SERIAL_PROTOCOLPGM(" Kp: "); SERIAL_PROTOCOLLN(_Kp); 27ada: 8f e0 ldi r24, 0x0F ; 15 27adc: 9b e9 ldi r25, 0x9B ; 155 27ade: 0e 94 50 77 call 0xeea0 ; 0xeea0 27ae2: 60 91 f3 03 lds r22, 0x03F3 ; 0x8003f3 <_Kp> 27ae6: 70 91 f4 03 lds r23, 0x03F4 ; 0x8003f4 <_Kp+0x1> 27aea: 80 91 f5 03 lds r24, 0x03F5 ; 0x8003f5 <_Kp+0x2> 27aee: 90 91 f6 03 lds r25, 0x03F6 ; 0x8003f6 <_Kp+0x3> 27af2: 0f 94 b4 74 call 0x2e968 ; 0x2e968 SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(_Ki); 27af6: 89 e0 ldi r24, 0x09 ; 9 27af8: 9b e9 ldi r25, 0x9B ; 155 27afa: 0e 94 50 77 call 0xeea0 ; 0xeea0 27afe: 60 91 ef 03 lds r22, 0x03EF ; 0x8003ef <_Ki> 27b02: 70 91 f0 03 lds r23, 0x03F0 ; 0x8003f0 <_Ki+0x1> 27b06: 80 91 f1 03 lds r24, 0x03F1 ; 0x8003f1 <_Ki+0x2> 27b0a: 90 91 f2 03 lds r25, 0x03F2 ; 0x8003f2 <_Ki+0x3> 27b0e: 0f 94 b4 74 call 0x2e968 ; 0x2e968 SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(_Kd); 27b12: 83 e0 ldi r24, 0x03 ; 3 27b14: 9b e9 ldi r25, 0x9B ; 155 27b16: 0e 94 50 77 call 0xeea0 ; 0xeea0 27b1a: 60 91 eb 03 lds r22, 0x03EB ; 0x8003eb <_Kd> 27b1e: 70 91 ec 03 lds r23, 0x03EC ; 0x8003ec <_Kd+0x1> 27b22: 80 91 ed 03 lds r24, 0x03ED ; 0x8003ed <_Kd+0x2> 27b26: 90 91 ee 03 lds r25, 0x03EE ; 0x8003ee <_Kd+0x3> 27b2a: 0f 94 b4 74 call 0x2e968 ; 0x2e968 27b2e: 89 81 ldd r24, Y+1 ; 0x01 27b30: 9a 81 ldd r25, Y+2 ; 0x02 27b32: ab 81 ldd r26, Y+3 ; 0x03 27b34: bc 81 ldd r27, Y+4 ; 0x04 27b36: 8c 0d add r24, r12 27b38: 9d 1d adc r25, r13 27b3a: ae 1d adc r26, r14 27b3c: bf 1d adc r27, r15 27b3e: b5 95 asr r27 27b40: a7 95 ror r26 27b42: 97 95 ror r25 27b44: 87 95 ror r24 SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(_Ki); SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(_Kd); */ } } if (extruder<0) 27b46: 21 14 cp r2, r1 27b48: 31 04 cpc r3, r1 27b4a: 09 f4 brne .+2 ; 0x27b4e 27b4c: 45 c0 rjmp .+138 ; 0x27bd8 { soft_pwm_bed = (bias + d) >> 1; 27b4e: 80 93 1d 06 sts 0x061D, r24 ; 0x80061d } else soft_pwm[extruder] = (bias + d) >> 1; pid_cycle++; 27b52: 80 91 49 06 lds r24, 0x0649 ; 0x800649 27b56: 90 91 4a 06 lds r25, 0x064A ; 0x80064a 27b5a: 01 96 adiw r24, 0x01 ; 1 27b5c: 90 93 4a 06 sts 0x064A, r25 ; 0x80064a 27b60: 80 93 49 06 sts 0x0649, r24 ; 0x800649 min=temp; 27b64: 3a 85 ldd r19, Y+10 ; 0x0a 27b66: 3a 8b std Y+18, r19 ; 0x12 27b68: 4b 85 ldd r20, Y+11 ; 0x0b 27b6a: 4b 8b std Y+19, r20 ; 0x13 27b6c: 5c 85 ldd r21, Y+12 ; 0x0c 27b6e: 5c 8b std Y+20, r21 ; 0x14 27b70: 8d 85 ldd r24, Y+13 ; 0x0d 27b72: 8d 8b std Y+21, r24 ; 0x15 max=temp; } } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { heating=true; 27b74: 98 a5 ldd r25, Y+40 ; 0x28 27b76: 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)) { 27b78: 20 e0 ldi r18, 0x00 ; 0 27b7a: 30 e0 ldi r19, 0x00 ; 0 27b7c: 40 ea ldi r20, 0xA0 ; 160 27b7e: 51 e4 ldi r21, 0x41 ; 65 27b80: 6a 85 ldd r22, Y+10 ; 0x0a 27b82: 7b 85 ldd r23, Y+11 ; 0x0b 27b84: 8c 85 ldd r24, Y+12 ; 0x0c 27b86: 9d 85 ldd r25, Y+13 ; 0x0d 27b88: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 27b8c: 98 01 movw r18, r16 27b8e: 48 a9 ldd r20, Y+48 ; 0x30 27b90: 5f a5 ldd r21, Y+47 ; 0x2f 27b92: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 27b96: 87 ff sbrs r24, 7 27b98: 22 c0 rjmp .+68 ; 0x27bde SERIAL_PROTOCOLLNPGM("PID Autotune failed! Temperature too high"); 27b9a: 89 ed ldi r24, 0xD9 ; 217 27b9c: 9a e9 ldi r25, 0x9A ; 154 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"); 27b9e: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 pid_tuning_finished = true; 27ba2: 81 e0 ldi r24, 0x01 ; 1 27ba4: 80 93 3e 02 sts 0x023E, r24 ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.458> pid_cycle = 0; 27ba8: 10 92 4a 06 sts 0x064A, r1 ; 0x80064a 27bac: 10 92 49 06 sts 0x0649, r1 ; 0x800649 27bb0: 98 c0 rjmp .+304 ; 0x27ce2 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); 27bb2: 34 e1 ldi r19, 0x14 ; 20 27bb4: c3 2e mov r12, r19 27bb6: d1 2c mov r13, r1 27bb8: e1 2c mov r14, r1 27bba: f1 2c mov r15, r1 27bbc: 24 e1 ldi r18, 0x14 ; 20 27bbe: 30 e0 ldi r19, 0x00 ; 0 27bc0: 40 e0 ldi r20, 0x00 ; 0 27bc2: 50 e0 ldi r21, 0x00 ; 0 27bc4: 29 83 std Y+1, r18 ; 0x01 27bc6: 3a 83 std Y+2, r19 ; 0x02 27bc8: 4b 83 std Y+3, r20 ; 0x03 27bca: 5c 83 std Y+4, r21 ; 0x04 27bcc: d5 ce rjmp .-598 ; 0x27978 27bce: c9 82 std Y+1, r12 ; 0x01 27bd0: da 82 std Y+2, r13 ; 0x02 27bd2: eb 82 std Y+3, r14 ; 0x03 27bd4: fc 82 std Y+4, r15 ; 0x04 27bd6: d0 ce rjmp .-608 ; 0x27978 if (extruder<0) { soft_pwm_bed = (bias + d) >> 1; } else soft_pwm[extruder] = (bias + d) >> 1; 27bd8: 80 93 16 05 sts 0x0516, r24 ; 0x800516 <_ZL8soft_pwm.lto_priv.459> 27bdc: ba cf rjmp .-140 ; 0x27b52 SERIAL_PROTOCOLLNPGM("PID Autotune failed! Temperature too high"); pid_tuning_finished = true; pid_cycle = 0; return; } if(_millis() - temp_millis > 2000) { 27bde: 0f 94 4c 29 call 0x25298 ; 0x25298 27be2: 28 a1 ldd r18, Y+32 ; 0x20 27be4: 39 a1 ldd r19, Y+33 ; 0x21 27be6: 4a a1 ldd r20, Y+34 ; 0x22 27be8: 5b a1 ldd r21, Y+35 ; 0x23 27bea: 62 1b sub r22, r18 27bec: 73 0b sbc r23, r19 27bee: 84 0b sbc r24, r20 27bf0: 95 0b sbc r25, r21 27bf2: 61 3d cpi r22, 0xD1 ; 209 27bf4: 77 40 sbci r23, 0x07 ; 7 27bf6: 81 05 cpc r24, r1 27bf8: 91 05 cpc r25, r1 27bfa: 58 f1 brcs .+86 ; 0x27c52 int p; if (extruder<0){ p=soft_pwm_bed; 27bfc: a0 90 1d 06 lds r10, 0x061D ; 0x80061d 27c00: b1 2c mov r11, r1 SERIAL_PROTOCOLPGM("B:"); 27c02: 86 ed ldi r24, 0xD6 ; 214 27c04: 9a e9 ldi r25, 0x9A ; 154 pid_cycle = 0; return; } if(_millis() - temp_millis > 2000) { int p; if (extruder<0){ 27c06: 21 14 cp r2, r1 27c08: 31 04 cpc r3, r1 27c0a: 29 f4 brne .+10 ; 0x27c16 p=soft_pwm_bed; SERIAL_PROTOCOLPGM("B:"); }else{ p=soft_pwm[extruder]; 27c0c: a0 90 16 05 lds r10, 0x0516 ; 0x800516 <_ZL8soft_pwm.lto_priv.459> 27c10: b1 2c mov r11, r1 SERIAL_PROTOCOLPGM("T:"); 27c12: 83 ed ldi r24, 0xD3 ; 211 27c14: 9a e9 ldi r25, 0x9A ; 154 27c16: 0e 94 50 77 call 0xeea0 ; 0xeea0 27c1a: 42 e0 ldi r20, 0x02 ; 2 27c1c: b8 01 movw r22, r16 27c1e: 88 a9 ldd r24, Y+48 ; 0x30 27c20: 9f a5 ldd r25, Y+47 ; 0x2f 27c22: 0f 94 87 d5 call 0x3ab0e ; 0x3ab0e } SERIAL_PROTOCOL(input); SERIAL_PROTOCOLPGM(" @:"); 27c26: 8f ec ldi r24, 0xCF ; 207 27c28: 9a e9 ldi r25, 0x9A ; 154 27c2a: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_PROTOCOLLN(p); 27c2e: c5 01 movw r24, r10 27c30: 0f 94 f5 74 call 0x2e9ea ; 0x2e9ea if (safety_check_cycles == 0) { //save ambient temp 27c34: 4d 81 ldd r20, Y+5 ; 0x05 27c36: 44 23 and r20, r20 27c38: 09 f4 brne .+2 ; 0x27c3c 27c3a: 6c c0 rjmp .+216 ; 0x27d14 temp_ambient = input; //SERIAL_ECHOPGM("Ambient T: "); //MYSERIAL.println(temp_ambient); safety_check_cycles++; } else if (safety_check_cycles < safety_check_cycles_count) { //delay 27c3c: 5f 8d ldd r21, Y+31 ; 0x1f 27c3e: 45 17 cp r20, r21 27c40: 70 f5 brcc .+92 ; 0x27c9e safety_check_cycles++; 27c42: 4f 5f subi r20, 0xFF ; 255 27c44: 4d 83 std Y+5, r20 ; 0x05 temp_runaway_stop(false, (extruder<0)); pid_tuning_finished = true; return; } } temp_millis = _millis(); 27c46: 0f 94 4c 29 call 0x25298 ; 0x25298 27c4a: 68 a3 std Y+32, r22 ; 0x20 27c4c: 79 a3 std Y+33, r23 ; 0x21 27c4e: 8a a3 std Y+34, r24 ; 0x22 27c50: 9b a3 std Y+35, r25 ; 0x23 } if(((_millis() - t1) + (_millis() - t2)) > (10L*60L*1000L*2L)) { 27c52: 0f 94 4c 29 call 0x25298 ; 0x25298 27c56: 4b 01 movw r8, r22 27c58: 5c 01 movw r10, r24 27c5a: 0f 94 4c 29 call 0x25298 ; 0x25298 27c5e: 4e 80 ldd r4, Y+6 ; 0x06 27c60: 5f 80 ldd r5, Y+7 ; 0x07 27c62: 68 84 ldd r6, Y+8 ; 0x08 27c64: 79 84 ldd r7, Y+9 ; 0x09 27c66: 2e 85 ldd r18, Y+14 ; 0x0e 27c68: 3f 85 ldd r19, Y+15 ; 0x0f 27c6a: 48 89 ldd r20, Y+16 ; 0x10 27c6c: 59 89 ldd r21, Y+17 ; 0x11 27c6e: 42 0e add r4, r18 27c70: 53 1e adc r5, r19 27c72: 64 1e adc r6, r20 27c74: 75 1e adc r7, r21 27c76: 84 18 sub r8, r4 27c78: 95 08 sbc r9, r5 27c7a: a6 08 sbc r10, r6 27c7c: b7 08 sbc r11, r7 27c7e: 86 0e add r8, r22 27c80: 97 1e adc r9, r23 27c82: a8 1e adc r10, r24 27c84: b9 1e adc r11, r25 27c86: 31 e8 ldi r19, 0x81 ; 129 27c88: 83 16 cp r8, r19 27c8a: 3f e4 ldi r19, 0x4F ; 79 27c8c: 93 06 cpc r9, r19 27c8e: 32 e1 ldi r19, 0x12 ; 18 27c90: a3 06 cpc r10, r19 27c92: b1 04 cpc r11, r1 27c94: 08 f4 brcc .+2 ; 0x27c98 27c96: 47 c0 rjmp .+142 ; 0x27d26 SERIAL_PROTOCOLLNPGM("PID Autotune failed! timeout"); 27c98: 82 eb ldi r24, 0xB2 ; 178 27c9a: 9a e9 ldi r25, 0x9A ; 154 27c9c: 80 cf rjmp .-256 ; 0x27b9e 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 27c9e: 8d 81 ldd r24, Y+5 ; 0x05 27ca0: 9f 8d ldd r25, Y+31 ; 0x1f 27ca2: 89 13 cpse r24, r25 27ca4: d0 cf rjmp .-96 ; 0x27c46 safety_check_cycles++; 27ca6: 8f 5f subi r24, 0xFF ; 255 27ca8: 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) { 27caa: 2b a5 ldd r18, Y+43 ; 0x2b 27cac: 3c a5 ldd r19, Y+44 ; 0x2c 27cae: 4d a5 ldd r20, Y+45 ; 0x2d 27cb0: 5e a5 ldd r21, Y+46 ; 0x2e 27cb2: b8 01 movw r22, r16 27cb4: 88 a9 ldd r24, Y+48 ; 0x30 27cb6: 9f a5 ldd r25, Y+47 ; 0x2f 27cb8: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 27cbc: 9f 77 andi r25, 0x7F ; 127 27cbe: 20 e0 ldi r18, 0x00 ; 0 27cc0: 30 e0 ldi r19, 0x00 ; 0 27cc2: 40 ea ldi r20, 0xA0 ; 160 27cc4: 50 e4 ldi r21, 0x40 ; 64 27cc6: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 27cca: 87 ff sbrs r24, 7 27ccc: bc cf rjmp .-136 ; 0x27c46 temp_runaway_stop(false, (extruder<0)); 27cce: 63 2d mov r22, r3 27cd0: 66 1f adc r22, r22 27cd2: 66 27 eor r22, r22 27cd4: 66 1f adc r22, r22 27cd6: 80 e0 ldi r24, 0x00 ; 0 27cd8: 0f 94 3a 1f call 0x23e74 ; 0x23e74 pid_tuning_finished = true; 27cdc: 81 e0 ldi r24, 0x01 ; 1 27cde: 80 93 3e 02 sts 0x023E, r24 ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.458> pid_cycle = 0; return; } lcd_update(0); } } 27ce2: e0 96 adiw r28, 0x30 ; 48 27ce4: 0f b6 in r0, 0x3f ; 63 27ce6: f8 94 cli 27ce8: de bf out 0x3e, r29 ; 62 27cea: 0f be out 0x3f, r0 ; 63 27cec: cd bf out 0x3d, r28 ; 61 27cee: df 91 pop r29 27cf0: cf 91 pop r28 27cf2: 1f 91 pop r17 27cf4: 0f 91 pop r16 27cf6: ff 90 pop r15 27cf8: ef 90 pop r14 27cfa: df 90 pop r13 27cfc: cf 90 pop r12 27cfe: bf 90 pop r11 27d00: af 90 pop r10 27d02: 9f 90 pop r9 27d04: 8f 90 pop r8 27d06: 7f 90 pop r7 27d08: 6f 90 pop r6 27d0a: 5f 90 pop r5 27d0c: 4f 90 pop r4 27d0e: 3f 90 pop r3 27d10: 2f 90 pop r2 27d12: 08 95 ret SERIAL_PROTOCOL(input); SERIAL_PROTOCOLPGM(" @:"); SERIAL_PROTOCOLLN(p); if (safety_check_cycles == 0) { //save ambient temp temp_ambient = input; 27d14: 0b a7 std Y+43, r16 ; 0x2b 27d16: 1c a7 std Y+44, r17 ; 0x2c 27d18: a8 a9 ldd r26, Y+48 ; 0x30 27d1a: ad a7 std Y+45, r26 ; 0x2d 27d1c: bf a5 ldd r27, Y+47 ; 0x2f 27d1e: be a7 std Y+46, r27 ; 0x2e //SERIAL_ECHOPGM("Ambient T: "); //MYSERIAL.println(temp_ambient); safety_check_cycles++; 27d20: 21 e0 ldi r18, 0x01 ; 1 27d22: 2d 83 std Y+5, r18 ; 0x05 27d24: 90 cf rjmp .-224 ; 0x27c46 SERIAL_PROTOCOLLNPGM("PID Autotune failed! timeout"); pid_tuning_finished = true; pid_cycle = 0; return; } if(pid_cycle > ncycles) { 27d26: 80 91 49 06 lds r24, 0x0649 ; 0x800649 27d2a: 90 91 4a 06 lds r25, 0x064A ; 0x80064a 27d2e: 49 a5 ldd r20, Y+41 ; 0x29 27d30: 5a a5 ldd r21, Y+42 ; 0x2a 27d32: 48 17 cp r20, r24 27d34: 59 07 cpc r21, r25 27d36: 1c f4 brge .+6 ; 0x27d3e SERIAL_PROTOCOLLNPGM("PID Autotune finished! Put the last Kp, Ki and Kd constants from above into Configuration.h"); 27d38: 86 e5 ldi r24, 0x56 ; 86 27d3a: 9a e9 ldi r25, 0x9A ; 154 27d3c: 30 cf rjmp .-416 ; 0x27b9e pid_tuning_finished = true; pid_cycle = 0; return; } lcd_update(0); 27d3e: 80 e0 ldi r24, 0x00 ; 0 27d40: 0e 94 a7 6e call 0xdd4e ; 0xdd4e 27d44: e6 cc rjmp .-1588 ; 0x27712 00027d46 : startTimestamp = 0; stopTimestamp = 0; accumulator = 0; } uint32_t Stopwatch::duration() { 27d46: 0f 93 push r16 27d48: 1f 93 push r17 return accumulator + MS_TO_SEC((isRunning() ? _millis() : stopTimestamp) - startTimestamp); 27d4a: 80 91 9d 03 lds r24, 0x039D ; 0x80039d 27d4e: 81 30 cpi r24, 0x01 ; 1 27d50: 19 f5 brne .+70 ; 0x27d98 27d52: 0f 94 4c 29 call 0x25298 ; 0x25298 27d56: 00 91 a7 05 lds r16, 0x05A7 ; 0x8005a7 27d5a: 10 91 a8 05 lds r17, 0x05A8 ; 0x8005a8 27d5e: 20 91 a9 05 lds r18, 0x05A9 ; 0x8005a9 27d62: 30 91 aa 05 lds r19, 0x05AA ; 0x8005aa 27d66: 60 1b sub r22, r16 27d68: 71 0b sbc r23, r17 27d6a: 82 0b sbc r24, r18 27d6c: 93 0b sbc r25, r19 27d6e: 28 ee ldi r18, 0xE8 ; 232 27d70: 33 e0 ldi r19, 0x03 ; 3 27d72: 40 e0 ldi r20, 0x00 ; 0 27d74: 50 e0 ldi r21, 0x00 ; 0 27d76: 0f 94 8f dc call 0x3b91e ; 0x3b91e <__udivmodsi4> 27d7a: 60 91 a3 05 lds r22, 0x05A3 ; 0x8005a3 27d7e: 70 91 a4 05 lds r23, 0x05A4 ; 0x8005a4 27d82: 80 91 a5 05 lds r24, 0x05A5 ; 0x8005a5 27d86: 90 91 a6 05 lds r25, 0x05A6 ; 0x8005a6 27d8a: 62 0f add r22, r18 27d8c: 73 1f adc r23, r19 27d8e: 84 1f adc r24, r20 27d90: 95 1f adc r25, r21 } 27d92: 1f 91 pop r17 27d94: 0f 91 pop r16 27d96: 08 95 ret stopTimestamp = 0; accumulator = 0; } uint32_t Stopwatch::duration() { return accumulator + MS_TO_SEC((isRunning() ? _millis() : stopTimestamp) - startTimestamp); 27d98: 60 91 52 06 lds r22, 0x0652 ; 0x800652 27d9c: 70 91 53 06 lds r23, 0x0653 ; 0x800653 27da0: 80 91 54 06 lds r24, 0x0654 ; 0x800654 27da4: 90 91 55 06 lds r25, 0x0655 ; 0x800655 27da8: d6 cf rjmp .-84 ; 0x27d56 00027daa : //! |Total print time: | MSG_TOTAL_PRINT_TIME c=19 //! | 00d 00h 00m | //! ---------------------- //! @endcode void lcd_menu_statistics() { 27daa: 4f 92 push r4 27dac: 5f 92 push r5 27dae: 6f 92 push r6 27db0: 7f 92 push r7 27db2: 8f 92 push r8 27db4: 9f 92 push r9 27db6: af 92 push r10 27db8: bf 92 push r11 27dba: cf 92 push r12 27dbc: df 92 push r13 27dbe: ef 92 push r14 27dc0: ff 92 push r15 27dc2: 0f 93 push r16 27dc4: 1f 93 push r17 27dc6: cf 93 push r28 27dc8: df 93 push r29 27dca: 10 92 dc 03 sts 0x03DC, r1 ; 0x8003dc lcd_timeoutToStatus.stop(); //infinite timeout if (printJobOngoing()) 27dce: 0e 94 90 67 call 0xcf20 ; 0xcf20 27dd2: 88 23 and r24, r24 27dd4: 09 f4 brne .+2 ; 0x27dd8 27dd6: 6e c0 rjmp .+220 ; 0x27eb4 { const float _met = ((float)total_filament_used) / (100000.f); 27dd8: 60 91 65 06 lds r22, 0x0665 ; 0x800665 27ddc: 70 91 66 06 lds r23, 0x0666 ; 0x800666 27de0: 80 91 67 06 lds r24, 0x0667 ; 0x800667 27de4: 90 91 68 06 lds r25, 0x0668 ; 0x800668 27de8: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 27dec: 20 e0 ldi r18, 0x00 ; 0 27dee: 30 e5 ldi r19, 0x50 ; 80 27df0: 43 ec ldi r20, 0xC3 ; 195 27df2: 57 e4 ldi r21, 0x47 ; 71 27df4: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 27df8: 56 2e mov r5, r22 27dfa: 47 2e mov r4, r23 27dfc: ec 01 movw r28, r24 const uint32_t _t = print_job_timer.duration(); 27dfe: 0f 94 a3 3e call 0x27d46 ; 0x27d46 27e02: 6b 01 movw r12, r22 27e04: 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(); 27e06: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_printf_P(_N( 27e0a: 83 ec ldi r24, 0xC3 ; 195 27e0c: 90 e5 ldi r25, 0x50 ; 80 27e0e: 0e 94 ac 72 call 0xe558 ; 0xe558 27e12: 18 2f mov r17, r24 27e14: 09 2f mov r16, r25 27e16: 83 eb ldi r24, 0xB3 ; 179 27e18: 90 e5 ldi r25, 0x50 ; 80 27e1a: 0e 94 ac 72 call 0xe558 ; 0xe558 27e1e: 78 2e mov r7, r24 27e20: 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; 27e22: 8c e3 ldi r24, 0x3C ; 60 27e24: 88 2e mov r8, r24 27e26: 91 2c mov r9, r1 27e28: a1 2c mov r10, r1 27e2a: b1 2c mov r11, r1 27e2c: c7 01 movw r24, r14 27e2e: b6 01 movw r22, r12 27e30: a5 01 movw r20, r10 27e32: 94 01 movw r18, r8 27e34: 0f 94 8f dc call 0x3b91e ; 0x3b91e <__udivmodsi4> lcd_home(); lcd_printf_P(_N( 27e38: 7f 93 push r23 27e3a: 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; 27e3c: ca 01 movw r24, r20 27e3e: b9 01 movw r22, r18 27e40: a5 01 movw r20, r10 27e42: 94 01 movw r18, r8 27e44: 0f 94 8f dc call 0x3b91e ; 0x3b91e <__udivmodsi4> const uint8_t _s = _t % 60; lcd_home(); lcd_printf_P(_N( 27e48: 7f 93 push r23 27e4a: 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; 27e4c: c7 01 movw r24, r14 27e4e: b6 01 movw r22, r12 27e50: 20 e1 ldi r18, 0x10 ; 16 27e52: 3e e0 ldi r19, 0x0E ; 14 27e54: 40 e0 ldi r20, 0x00 ; 0 27e56: 50 e0 ldi r21, 0x00 ; 0 27e58: 0f 94 8f dc call 0x3b91e ; 0x3b91e <__udivmodsi4> const uint8_t _m = (_t / 60) % 60; const uint8_t _s = _t % 60; lcd_home(); lcd_printf_P(_N( 27e5c: 5f 93 push r21 27e5e: 4f 93 push r20 27e60: 3f 93 push r19 27e62: 2f 93 push r18 27e64: 0f 93 push r16 27e66: 1f 93 push r17 27e68: df 93 push r29 27e6a: cf 93 push r28 27e6c: 4f 92 push r4 27e6e: 5f 92 push r5 27e70: 6f 92 push r6 27e72: 7f 92 push r7 27e74: 8c e7 ldi r24, 0x7C ; 124 27e76: 9f e6 ldi r25, 0x6F ; 111 27e78: 9f 93 push r25 27e7a: 8f 93 push r24 27e7c: 0e 94 b9 6e call 0xdd72 ; 0xdd72 "%S:\n" "%10ldh %02dm %02ds" ), _T(MSG_FILAMENT_USED), _met, _T(MSG_PRINT_TIME), _h, _m, _s); menu_back_if_clicked(); 27e80: 8d b7 in r24, 0x3d ; 61 27e82: 9e b7 in r25, 0x3e ; 62 27e84: 42 96 adiw r24, 0x12 ; 18 27e86: 0f b6 in r0, 0x3f ; 63 27e88: f8 94 cli 27e8a: 9e bf out 0x3e, r25 ; 62 27e8c: 0f be out 0x3f, r0 ; 63 27e8e: 8d bf out 0x3d, r24 ; 61 ), _T(MSG_TOTAL_FILAMENT), _filament_m, _T(MSG_TOTAL_PRINT_TIME), _days, _hours, _minutes); menu_back_if_clicked(); } } 27e90: df 91 pop r29 27e92: cf 91 pop r28 27e94: 1f 91 pop r17 27e96: 0f 91 pop r16 27e98: ff 90 pop r15 27e9a: ef 90 pop r14 27e9c: df 90 pop r13 27e9e: cf 90 pop r12 27ea0: bf 90 pop r11 27ea2: af 90 pop r10 27ea4: 9f 90 pop r9 27ea6: 8f 90 pop r8 27ea8: 7f 90 pop r7 27eaa: 6f 90 pop r6 27eac: 5f 90 pop r5 27eae: 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(); 27eb0: 0d 94 00 d5 jmp 0x3aa00 ; 0x3aa00 _T(MSG_PRINT_TIME), _h, _m, _s); menu_back_if_clicked(); } else { uint32_t _filament = eeprom_read_dword((uint32_t *)EEPROM_FILAMENTUSED); // in meters 27eb4: 81 ef ldi r24, 0xF1 ; 241 27eb6: 9f e0 ldi r25, 0x0F ; 15 27eb8: 0f 94 24 dc call 0x3b848 ; 0x3b848 27ebc: 2b 01 movw r4, r22 27ebe: 3c 01 movw r6, r24 uint32_t _time = eeprom_read_dword((uint32_t *)EEPROM_TOTALTIME); // in minutes 27ec0: 8d ee ldi r24, 0xED ; 237 27ec2: 9f e0 ldi r25, 0x0F ; 15 27ec4: 0f 94 24 dc call 0x3b848 ; 0x3b848 27ec8: 6b 01 movw r12, r22 27eca: 7c 01 movw r14, r24 float _filament_m = (float)_filament/100; _days = (_time / 60) / 24; _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); 27ecc: 0e 94 0c 6f call 0xde18 ; 0xde18 lcd_printf_P(_N( 27ed0: 80 ea ldi r24, 0xA0 ; 160 27ed2: 90 e5 ldi r25, 0x50 ; 80 27ed4: 0e 94 ac 72 call 0xe558 ; 0xe558 27ed8: 98 2e mov r9, r24 27eda: 89 2e mov r8, r25 27edc: 8f e8 ldi r24, 0x8F ; 143 27ede: 90 e5 ldi r25, 0x50 ; 80 27ee0: 0e 94 ac 72 call 0xe558 ; 0xe558 27ee4: b8 2e mov r11, r24 27ee6: 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; 27ee8: c7 01 movw r24, r14 27eea: b6 01 movw r22, r12 27eec: 2c e3 ldi r18, 0x3C ; 60 27eee: 30 e0 ldi r19, 0x00 ; 0 27ef0: 40 e0 ldi r20, 0x00 ; 0 27ef2: 50 e0 ldi r21, 0x00 ; 0 27ef4: 0f 94 8f dc call 0x3b91e ; 0x3b91e <__udivmodsi4> lcd_home(); lcd_printf_P(_N( 27ef8: 7f 93 push r23 27efa: 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; 27efc: ca 01 movw r24, r20 27efe: b9 01 movw r22, r18 27f00: 28 e1 ldi r18, 0x18 ; 24 27f02: 30 e0 ldi r19, 0x00 ; 0 27f04: 40 e0 ldi r20, 0x00 ; 0 27f06: 50 e0 ldi r21, 0x00 ; 0 27f08: 0f 94 8f dc call 0x3b91e ; 0x3b91e <__udivmodsi4> _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 27f0c: 7f 93 push r23 27f0e: 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; 27f10: c7 01 movw r24, r14 27f12: b6 01 movw r22, r12 27f14: 20 ea ldi r18, 0xA0 ; 160 27f16: 35 e0 ldi r19, 0x05 ; 5 27f18: 40 e0 ldi r20, 0x00 ; 0 27f1a: 50 e0 ldi r21, 0x00 ; 0 27f1c: 0f 94 8f dc call 0x3b91e ; 0x3b91e <__udivmodsi4> _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 27f20: 5f 93 push r21 27f22: 4f 93 push r20 27f24: 3f 93 push r19 27f26: 2f 93 push r18 27f28: 8f 92 push r8 27f2a: 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; 27f2c: c3 01 movw r24, r6 27f2e: b2 01 movw r22, r4 27f30: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 27f34: 20 e0 ldi r18, 0x00 ; 0 27f36: 30 e0 ldi r19, 0x00 ; 0 27f38: 48 ec ldi r20, 0xC8 ; 200 27f3a: 52 e4 ldi r21, 0x42 ; 66 27f3c: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> _days = (_time / 60) / 24; _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 27f40: 9f 93 push r25 27f42: 8f 93 push r24 27f44: 7f 93 push r23 27f46: 6f 93 push r22 27f48: af 92 push r10 27f4a: bf 92 push r11 27f4c: 88 e5 ldi r24, 0x58 ; 88 27f4e: 9f e6 ldi r25, 0x6F ; 111 27f50: 9f 93 push r25 27f52: 8f 93 push r24 27f54: 0e 94 b9 6e call 0xdd72 ; 0xdd72 "%S:\n" "%10ldd %02dh %02dm" ), _T(MSG_TOTAL_FILAMENT), _filament_m, _T(MSG_TOTAL_PRINT_TIME), _days, _hours, _minutes); menu_back_if_clicked(); 27f58: 8d b7 in r24, 0x3d ; 61 27f5a: 9e b7 in r25, 0x3e ; 62 27f5c: 42 96 adiw r24, 0x12 ; 18 27f5e: 0f b6 in r0, 0x3f ; 63 27f60: f8 94 cli 27f62: 9e bf out 0x3e, r25 ; 62 27f64: 0f be out 0x3f, r0 ; 63 27f66: 8d bf out 0x3d, r24 ; 61 27f68: 93 cf rjmp .-218 ; 0x27e90 00027f6a : 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()") { 27f6a: cf 92 push r12 27f6c: df 92 push r13 27f6e: ef 92 push r14 27f70: ff 92 push r15 27f72: 0f 93 push r16 27f74: 1f 93 push r17 27f76: cf 93 push r28 27f78: df 93 push r29 27f7a: 00 d0 rcall .+0 ; 0x27f7c 27f7c: 00 d0 rcall .+0 ; 0x27f7e 27f7e: 1f 92 push r1 27f80: 1f 92 push r1 27f82: cd b7 in r28, 0x3d ; 61 27f84: de b7 in r29, 0x3e ; 62 static uint8_t lcd_status_update_delay = 0; #ifdef ULTIPANEL_FEEDMULTIPLY if (lcd_encoder) 27f86: 80 91 70 06 lds r24, 0x0670 ; 0x800670 27f8a: 90 91 71 06 lds r25, 0x0671 ; 0x800671 27f8e: 00 97 sbiw r24, 0x00 ; 0 27f90: e1 f1 breq .+120 ; 0x2800a { const int16_t initial_feedmultiply = feedmultiply; 27f92: 20 91 39 02 lds r18, 0x0239 ; 0x800239 27f96: 30 91 3a 02 lds r19, 0x023A ; 0x80023a // Dead zone at 100% feedrate if ((feedmultiply < 100 && (feedmultiply + lcd_encoder) > 100) || 27f9a: 24 36 cpi r18, 0x64 ; 100 27f9c: 31 05 cpc r19, r1 27f9e: 4c f4 brge .+18 ; 0x27fb2 27fa0: ac 01 movw r20, r24 27fa2: 42 0f add r20, r18 27fa4: 53 1f adc r21, r19 27fa6: 45 36 cpi r20, 0x65 ; 101 27fa8: 51 05 cpc r21, r1 27faa: 6c f4 brge .+26 ; 0x27fc6 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; 27fac: 82 0f add r24, r18 27fae: 93 1f adc r25, r19 27fb0: 0c c0 rjmp .+24 ; 0x27fca #ifdef ULTIPANEL_FEEDMULTIPLY if (lcd_encoder) { const int16_t initial_feedmultiply = feedmultiply; // Dead zone at 100% feedrate if ((feedmultiply < 100 && (feedmultiply + lcd_encoder) > 100) || 27fb2: 24 36 cpi r18, 0x64 ; 100 27fb4: 31 05 cpc r19, r1 27fb6: 09 f4 brne .+2 ; 0x27fba 27fb8: 55 c0 rjmp .+170 ; 0x28064 (feedmultiply > 100 && (feedmultiply + lcd_encoder) < 100)) 27fba: ac 01 movw r20, r24 27fbc: 42 0f add r20, r18 27fbe: 53 1f adc r21, r19 27fc0: 44 36 cpi r20, 0x64 ; 100 27fc2: 51 05 cpc r21, r1 27fc4: 9c f7 brge .-26 ; 0x27fac { feedmultiply = 100; 27fc6: 84 e6 ldi r24, 0x64 ; 100 27fc8: 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; 27fca: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a 27fce: 80 93 39 02 sts 0x0239, r24 ; 0x800239 if (initial_feedmultiply != feedmultiply) { 27fd2: 80 91 39 02 lds r24, 0x0239 ; 0x800239 27fd6: 90 91 3a 02 lds r25, 0x023A ; 0x80023a 27fda: 82 17 cp r24, r18 27fdc: 93 07 cpc r25, r19 27fde: a9 f0 breq .+42 ; 0x2800a feedmultiply = constrain(feedmultiply, 10, 999); 27fe0: 88 3e cpi r24, 0xE8 ; 232 27fe2: 53 e0 ldi r21, 0x03 ; 3 27fe4: 95 07 cpc r25, r21 27fe6: 14 f0 brlt .+4 ; 0x27fec 27fe8: 87 ee ldi r24, 0xE7 ; 231 27fea: 93 e0 ldi r25, 0x03 ; 3 27fec: 8a 30 cpi r24, 0x0A ; 10 27fee: 91 05 cpc r25, r1 27ff0: 14 f4 brge .+4 ; 0x27ff6 27ff2: 8a e0 ldi r24, 0x0A ; 10 27ff4: 90 e0 ldi r25, 0x00 ; 0 27ff6: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a 27ffa: 80 93 39 02 sts 0x0239, r24 ; 0x800239 lcd_encoder = 0; // Consume rotation event 27ffe: 10 92 71 06 sts 0x0671, r1 ; 0x800671 28002: 10 92 70 06 sts 0x0670, r1 ; 0x800670 refresh_saved_feedrate_multiplier_in_ram(); 28006: 0e 94 e3 64 call 0xc9c6 ; 0xc9c6 } } #endif //ULTIPANEL_FEEDMULTIPLY if (lcd_draw_update) { 2800a: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 2800e: 81 11 cpse r24, r1 // Update the status screen immediately lcd_status_update_delay = 0; 28010: 10 92 51 06 sts 0x0651, r1 ; 0x800651 } if (lcd_status_update_delay) 28014: 10 91 51 06 lds r17, 0x0651 ; 0x800651 28018: 11 23 and r17, r17 2801a: 91 f1 breq .+100 ; 0x28080 lcd_status_update_delay--; 2801c: 2f ef ldi r18, 0xFF ; 255 2801e: 21 0f add r18, r17 28020: 20 93 51 06 sts 0x0651, r18 ; 0x800651 if (lcd_commands_type != LcdCommands::Idle) lcd_commands(); } if (!menu_is_any_block() && lcd_clicked()) { 28024: 80 91 d6 03 lds r24, 0x03D6 ; 0x8003d6 28028: 81 11 cpse r24, r1 2802a: 0d c0 rjmp .+26 ; 0x28046 2802c: 0e 94 fd 70 call 0xe1fa ; 0xe1fa 28030: 88 23 and r24, r24 28032: 49 f0 breq .+18 ; 0x28046 menu_depth = 0; //redundant, as already done in lcd_return_to_status(), just to be sure 28034: 10 92 f8 03 sts 0x03F8, r1 ; 0x8003f8 menu_submenu(lcd_main_menu); 28038: 60 e0 ldi r22, 0x00 ; 0 2803a: 87 ed ldi r24, 0xD7 ; 215 2803c: 94 ed ldi r25, 0xD4 ; 212 2803e: 0f 94 03 d3 call 0x3a606 ; 0x3a606 lcd_refresh(); // to maybe revive the LCD if static electricity killed it. 28042: 0e 94 8c 6f call 0xdf18 ; 0xdf18 } } 28046: 28 96 adiw r28, 0x08 ; 8 28048: 0f b6 in r0, 0x3f ; 63 2804a: f8 94 cli 2804c: de bf out 0x3e, r29 ; 62 2804e: 0f be out 0x3f, r0 ; 63 28050: cd bf out 0x3d, r28 ; 61 28052: df 91 pop r29 28054: cf 91 pop r28 28056: 1f 91 pop r17 28058: 0f 91 pop r16 2805a: ff 90 pop r15 2805c: ef 90 pop r14 2805e: df 90 pop r13 28060: cf 90 pop r12 28062: 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) { 28064: 8b 30 cpi r24, 0x0B ; 11 28066: 91 05 cpc r25, r1 28068: 1c f0 brlt .+6 ; 0x28070 feedmultiply += lcd_encoder - ENCODER_FEEDRATE_DEADZONE; 2806a: 86 5a subi r24, 0xA6 ; 166 2806c: 9f 4f sbci r25, 0xFF ; 255 2806e: ad cf rjmp .-166 ; 0x27fca } else if (feedmultiply == 100 && lcd_encoder < -ENCODER_FEEDRATE_DEADZONE) { 28070: 86 3f cpi r24, 0xF6 ; 246 28072: 4f ef ldi r20, 0xFF ; 255 28074: 94 07 cpc r25, r20 28076: 0c f0 brlt .+2 ; 0x2807a 28078: ac cf rjmp .-168 ; 0x27fd2 feedmultiply += lcd_encoder + ENCODER_FEEDRATE_DEADZONE; 2807a: 82 59 subi r24, 0x92 ; 146 2807c: 9f 4f sbci r25, 0xFF ; 255 2807e: a5 cf rjmp .-182 ; 0x27fca 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; 28080: 6a e0 ldi r22, 0x0A ; 10 28082: 60 93 51 06 sts 0x0651, r22 ; 0x800651 ReInitLCD++; 28086: 80 91 50 06 lds r24, 0x0650 ; 0x800650 2808a: 8f 5f subi r24, 0xFF ; 255 2808c: 80 93 50 06 sts 0x0650, r24 ; 0x800650 if (ReInitLCD == 30) 28090: 8e 31 cpi r24, 0x1E ; 30 28092: 09 f0 breq .+2 ; 0x28096 28094: 9f c0 rjmp .+318 ; 0x281d4 { ReInitLCD = 0 ; 28096: 10 92 50 06 sts 0x0650, r1 ; 0x800650 #endif //DEBUG_DISABLE_LCD_STATUS_LINE } static void lcdui_refresh(uint8_t clear = true) { clear ? lcd_refresh() : lcd_refresh_noclear(); 2809a: 0e 94 8c 6f call 0xdf18 ; 0xdf18 lcd_status_message_idx = 0; // Re-draw message from beginning 2809e: 10 92 1e 05 sts 0x051E, r1 ; 0x80051e <_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(); 280a2: 0e 94 94 6e call 0xdd28 ; 0xdd28 lcd_home(); //line 0 280a6: 0e 94 0c 6f call 0xde18 ; 0xde18 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 280aa: 60 91 b6 0d lds r22, 0x0DB6 ; 0x800db6 280ae: 70 91 b7 0d lds r23, 0x0DB7 ; 0x800db7 280b2: 07 2e mov r0, r23 280b4: 00 0c add r0, r0 280b6: 88 0b sbc r24, r24 280b8: 99 0b sbc r25, r25 280ba: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__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)); 280be: 20 e0 ldi r18, 0x00 ; 0 280c0: 30 e0 ldi r19, 0x00 ; 0 280c2: 40 e0 ldi r20, 0x00 ; 0 280c4: 5f e3 ldi r21, 0x3F ; 63 280c6: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 280ca: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> 280ce: 6b 01 movw r12, r22 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: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 280dc: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 280e0: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 280e4: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 280e8: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 280ec: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> 280f0: a6 01 movw r20, r12 280f2: 82 e8 ldi r24, 0x82 ; 130 280f4: 0f 94 79 21 call 0x242f2 ; 0x242f2 lcd_space(3); //3 spaces 280f8: 83 e0 ldi r24, 0x03 ; 3 280fa: 0e 94 d6 6e call 0xddac ; 0xddac } // Print Z-coordinate (8 chars total) void lcdui_print_Z_coord(void) { if (custom_message_type == CustomMsg::MeshBedLeveling) 280fe: 80 91 c4 06 lds r24, 0x06C4 ; 0x8006c4 28102: 81 30 cpi r24, 0x01 ; 1 28104: 09 f0 breq .+2 ; 0x28108 28106: 6e c0 rjmp .+220 ; 0x281e4 lcd_puts_P(_N("Z --- ")); 28108: 87 eb ldi r24, 0xB7 ; 183 2810a: 9e e6 ldi r25, 0x6E ; 110 2810c: 0e 94 cb 6e call 0xdd96 ; 0xdd96 lcd_space(3); //3 spaces //Print Z-coordinate (8 chars total) lcdui_print_Z_coord(); lcd_set_cursor(0, 1); //line 1 28110: 61 e0 ldi r22, 0x01 ; 1 28112: 80 e0 ldi r24, 0x00 ; 0 28114: 0e 94 e0 6e call 0xddc0 ; 0xddc0 }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; 28118: 60 91 72 06 lds r22, 0x0672 ; 0x800672 2811c: 70 91 73 06 lds r23, 0x0673 ; 0x800673 28120: 07 2e mov r0, r23 28122: 00 0c add r0, r0 28124: 88 0b sbc r24, r24 28126: 99 0b sbc r25, r25 28128: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> //Print the Bed temperature (9 chars total) lcdui_print_temp(LCD_STR_BEDTEMP[0], (int)(degBed() + 0.5), (int)(degTargetBed() + 0.5)); 2812c: 20 e0 ldi r18, 0x00 ; 0 2812e: 30 e0 ldi r19, 0x00 ; 0 28130: 40 e0 ldi r20, 0x00 ; 0 28132: 5f e3 ldi r21, 0x3F ; 63 28134: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 28138: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> 2813c: 6b 01 movw r12, r22 2813e: 20 e0 ldi r18, 0x00 ; 0 28140: 30 e0 ldi r19, 0x00 ; 0 28142: 40 e0 ldi r20, 0x00 ; 0 28144: 5f e3 ldi r21, 0x3F ; 63 28146: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee 2814a: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef 2814e: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 28152: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 28156: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 2815a: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> 2815e: a6 01 movw r20, r12 28160: 80 e8 ldi r24, 0x80 ; 128 28162: 0f 94 79 21 call 0x242f2 ; 0x242f2 lcd_space(3); //3 spaces 28166: 83 e0 ldi r24, 0x03 ; 3 28168: 0e 94 d6 6e call 0xddac ; 0xddac #endif // PLANNER_DIAGNOSTICS // Print feedrate (8 chars total) void lcdui_print_feedrate(void) { int chars = lcd_printf_P(_N(LCD_STR_FEEDRATE "%3d%%"), feedmultiply); 2816c: 80 91 3a 02 lds r24, 0x023A ; 0x80023a 28170: 8f 93 push r24 28172: 80 91 39 02 lds r24, 0x0239 ; 0x800239 28176: 8f 93 push r24 28178: 80 ec ldi r24, 0xC0 ; 192 2817a: 9e e6 ldi r25, 0x6E ; 110 2817c: 9f 93 push r25 2817e: 8f 93 push r24 28180: 0e 94 b9 6e call 0xdd72 ; 0xdd72 lcd_space(8 - chars); 28184: 98 e0 ldi r25, 0x08 ; 8 28186: 98 1b sub r25, r24 28188: 89 2f mov r24, r25 2818a: 0e 94 d6 6e call 0xddac ; 0xddac #else // PLANNER_DIAGNOSTICS //Print Feedrate (8 chars) lcdui_print_feedrate(); #endif // PLANNER_DIAGNOSTICS lcd_set_cursor(0, 2); //line 2 2818e: 62 e0 ldi r22, 0x02 ; 2 28190: 80 e0 ldi r24, 0x00 ; 0 28192: 0e 94 e0 6e call 0xddc0 ; 0xddc0 } // 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(" ")); 28196: 0f 90 pop r0 28198: 0f 90 pop r0 2819a: 0f 90 pop r0 2819c: 0f 90 pop r0 2819e: 80 91 0e 05 lds r24, 0x050E ; 0x80050e 281a2: e0 90 90 14 lds r14, 0x1490 ; 0x801490 281a6: 81 11 cpse r24, r1 281a8: 3e c0 rjmp .+124 ; 0x28226 281aa: 23 ed ldi r18, 0xD3 ; 211 281ac: c2 2e mov r12, r18 281ae: 2e e6 ldi r18, 0x6E ; 110 281b0: d2 2e mov r13, r18 281b2: e1 10 cpse r14, r1 281b4: 3c c0 rjmp .+120 ; 0x2822e 281b6: 87 ed ldi r24, 0xD7 ; 215 281b8: c8 2e mov r12, r24 281ba: 8e e6 ldi r24, 0x6E ; 110 281bc: d8 2e mov r13, r24 bool num = IS_SD_PRINTING || (printer_active() && (print_percent_done_normal != PRINT_PERCENT_DONE_INIT)); 281be: 0e 94 e1 67 call 0xcfc2 ; 0xcfc2 281c2: f8 2e mov r15, r24 281c4: 88 23 and r24, r24 281c6: e1 f1 breq .+120 ; 0x28240 281c8: 80 91 ae 02 lds r24, 0x02AE ; 0x8002ae 281cc: 8f 3f cpi r24, 0xFF ; 255 281ce: 89 f5 brne .+98 ; 0x28232 281d0: f1 2c mov r15, r1 281d2: 36 c0 rjmp .+108 ; 0x28240 ReInitLCD = 0 ; lcdui_refresh(); } else { if ((ReInitLCD % 10) == 0) 281d4: 0f 94 d7 dc call 0x3b9ae ; 0x3b9ae <__divmodqi4> 281d8: 91 11 cpse r25, r1 281da: 63 cf rjmp .-314 ; 0x280a2 lcd_begin(1); } void lcd_refresh_noclear(void) { lcd_begin(0); 281dc: 80 e0 ldi r24, 0x00 ; 0 281de: 0e 94 4b 6f call 0xde96 ; 0xde96 281e2: 5d cf rjmp .-326 ; 0x2809e 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]?' ':'?'); 281e4: 80 91 91 06 lds r24, 0x0691 ; 0x800691 281e8: 88 23 and r24, r24 281ea: d9 f0 breq .+54 ; 0x28222 281ec: 80 e2 ldi r24, 0x20 ; 32 281ee: 1f 92 push r1 281f0: 8f 93 push r24 281f2: 80 91 9d 06 lds r24, 0x069D ; 0x80069d 281f6: 8f 93 push r24 281f8: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 281fc: 8f 93 push r24 281fe: 80 91 9b 06 lds r24, 0x069B ; 0x80069b 28202: 8f 93 push r24 28204: 80 91 9a 06 lds r24, 0x069A ; 0x80069a 28208: 8f 93 push r24 2820a: 8e ea ldi r24, 0xAE ; 174 2820c: 9e e6 ldi r25, 0x6E ; 110 2820e: 9f 93 push r25 28210: 8f 93 push r24 28212: 0e 94 b9 6e call 0xdd72 ; 0xdd72 28216: 0f b6 in r0, 0x3f ; 63 28218: f8 94 cli 2821a: de bf out 0x3e, r29 ; 62 2821c: 0f be out 0x3f, r0 ; 63 2821e: cd bf out 0x3d, r28 ; 61 28220: 77 cf rjmp .-274 ; 0x28110 28222: 8f e3 ldi r24, 0x3F ; 63 28224: e4 cf rjmp .-56 ; 0x281ee } // 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(" ")); 28226: 9b ed ldi r25, 0xDB ; 219 28228: c9 2e mov r12, r25 2822a: 9e e6 ldi r25, 0x6E ; 110 2822c: d9 2e mov r13, r25 bool num = IS_SD_PRINTING || (printer_active() && (print_percent_done_normal != PRINT_PERCENT_DONE_INIT)); 2822e: ee 20 and r14, r14 28230: 31 f2 breq .-116 ; 0x281be if (!num || heating_status != HeatingStatus::NO_HEATING) // either not printing or heating 28232: 80 91 e3 03 lds r24, 0x03E3 ; 0x8003e3 // 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)); 28236: ff 24 eor r15, r15 28238: f3 94 inc r15 if (!num || heating_status != HeatingStatus::NO_HEATING) // either not printing or heating 2823a: 88 23 and r24, r24 2823c: 09 f4 brne .+2 ; 0x28240 2823e: bb c0 rjmp .+374 ; 0x283b6 { const int8_t sheetNR = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 28240: 81 ea ldi r24, 0xA1 ; 161 28242: 9d e0 ldi r25, 0x0D ; 13 28244: 0f 94 1c dc call 0x3b838 ; 0x3b838 28248: 08 2f mov r16, r24 const int8_t nextSheet = eeprom_next_initialized_sheet(sheetNR); 2824a: 0e 94 4f 76 call 0xec9e ; 0xec9e if ((nextSheet >= 0) && (sheetNR != nextSheet)) 2824e: 87 fd sbrc r24, 7 28250: b2 c0 rjmp .+356 ; 0x283b6 28252: 08 17 cp r16, r24 28254: 09 f4 brne .+2 ; 0x28258 28256: af c0 rjmp .+350 ; 0x283b6 { char sheet[8]; eeprom_read_block(sheet, EEPROM_Sheets_base->s[sheetNR].name, 7); 28258: 9b e0 ldi r25, 0x0B ; 11 2825a: 09 02 muls r16, r25 2825c: b0 01 movw r22, r0 2825e: 11 24 eor r1, r1 28260: 67 5b subi r22, 0xB7 ; 183 28262: 72 4f sbci r23, 0xF2 ; 242 28264: 47 e0 ldi r20, 0x07 ; 7 28266: 50 e0 ldi r21, 0x00 ; 0 28268: 8e 01 movw r16, r28 2826a: 0f 5f subi r16, 0xFF ; 255 2826c: 1f 4f sbci r17, 0xFF ; 255 2826e: c8 01 movw r24, r16 28270: 0f 94 0c dc call 0x3b818 ; 0x3b818 sheet[7] = '\0'; 28274: 18 86 std Y+8, r1 ; 0x08 lcd_printf_P(PSTR("%-7s"),sheet); 28276: 1f 93 push r17 28278: 0f 93 push r16 2827a: 81 e8 ldi r24, 0x81 ; 129 2827c: 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()); 2827e: 9f 93 push r25 28280: 8f 93 push r24 28282: 0e 94 b9 6e call 0xdd72 ; 0xdd72 28286: 0f 90 pop r0 28288: 0f 90 pop r0 2828a: 0f 90 pop r0 2828c: 0f 90 pop r0 lcd_set_cursor(0, 2); //line 2 //Print SD status (7 chars) lcdui_print_percent_done(); if (MMU2::mmu2.Enabled()) { 2828e: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 28292: 81 30 cpi r24, 0x01 ; 1 28294: 09 f0 breq .+2 ; 0x28298 28296: e9 c0 rjmp .+466 ; 0x2846a // Print extruder status (5 chars) lcd_space(5 - lcdui_print_extruder()); 28298: 0f 94 48 21 call 0x24290 ; 0x24290 2829c: 95 e0 ldi r25, 0x05 ; 5 2829e: 98 1b sub r25, r24 282a0: 89 2f mov r24, r25 } else if (farm_mode) { // Print farm number (5 chars) lcdui_print_farm(); } else { lcd_space(5); // 5 spaces 282a2: 0e 94 d6 6e call 0xddac ; 0xddac 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()) { 282a6: 0e 94 e1 67 call 0xcfc2 ; 0xcfc2 282aa: 88 23 and r24, r24 282ac: 09 f4 brne .+2 ; 0x282b0 282ae: fa c0 rjmp .+500 ; 0x284a4 uint16_t print_tc = PRINT_TIME_REMAINING_INIT; // unit: minutes char suff = ' '; char suff_doubt = ' '; #ifdef TMC2130 if (SilentModeMenu != SILENT_MODE_OFF) { 282b0: 80 91 a4 03 lds r24, 0x03A4 ; 0x8003a4 282b4: 88 23 and r24, r24 282b6: 09 f4 brne .+2 ; 0x282ba 282b8: da c0 rjmp .+436 ; 0x2846e if (print_time_remaining_silent != PRINT_TIME_REMAINING_INIT) 282ba: c0 90 b5 02 lds r12, 0x02B5 ; 0x8002b5 282be: 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) 282c2: e0 90 b3 02 lds r14, 0x02B3 ; 0x8002b3 282c6: f0 90 b4 02 lds r15, 0x02B4 ; 0x8002b4 #ifdef TMC2130 } #endif //TMC2130 //#ifdef CLOCK_INTERVAL_TIME if (clock_interval == CLOCK_INTERVAL_TIME*2) 282ca: 80 91 4f 06 lds r24, 0x064F ; 0x80064f 282ce: 8a 30 cpi r24, 0x0A ; 10 282d0: 11 f4 brne .+4 ; 0x282d6 clock_interval = 0; 282d2: 10 92 4f 06 sts 0x064F, r1 ; 0x80064f clock_interval++; 282d6: 80 91 4f 06 lds r24, 0x064F ; 0x80064f 282da: 8f 5f subi r24, 0xFF ; 255 282dc: 80 93 4f 06 sts 0x064F, r24 ; 0x80064f if (print_tc != PRINT_TIME_REMAINING_INIT && clock_interval > CLOCK_INTERVAL_TIME) { 282e0: 2f ef ldi r18, 0xFF ; 255 282e2: e2 16 cp r14, r18 282e4: f2 06 cpc r15, r18 282e6: 21 f0 breq .+8 ; 0x282f0 282e8: 97 01 movw r18, r14 print_t = print_tc; suff = 'C'; 282ea: 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) { 282ec: 86 30 cpi r24, 0x06 ; 6 282ee: 70 f4 brcc .+28 ; 0x2830c print_t = print_tc; suff = 'C'; } else //#endif //CLOCK_INTERVAL_TIME if (print_tr != PRINT_TIME_REMAINING_INIT) { 282f0: 3f ef ldi r19, 0xFF ; 255 282f2: c3 16 cp r12, r19 282f4: d3 06 cpc r13, r19 282f6: 09 f0 breq .+2 ; 0x282fa 282f8: c3 c0 rjmp .+390 ; 0x28480 print_t = print_tr; suff = 'R'; } else print_t = print_job_timer.duration() / 60; 282fa: 0f 94 a3 3e call 0x27d46 ; 0x27d46 282fe: 2c e3 ldi r18, 0x3C ; 60 28300: 30 e0 ldi r19, 0x00 ; 0 28302: 40 e0 ldi r20, 0x00 ; 0 28304: 50 e0 ldi r21, 0x00 ; 0 28306: 0f 94 8f dc call 0x3b91e ; 0x3b91e <__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 = ' '; 2830a: 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)) { 2830c: 40 91 39 02 lds r20, 0x0239 ; 0x800239 28310: 50 91 3a 02 lds r21, 0x023A ; 0x80023a 28314: 44 36 cpi r20, 0x64 ; 100 28316: 51 05 cpc r21, r1 28318: 09 f4 brne .+2 ; 0x2831c 2831a: b5 c0 rjmp .+362 ; 0x28486 2831c: c2 16 cp r12, r18 2831e: d3 06 cpc r13, r19 28320: 21 f0 breq .+8 ; 0x2832a 28322: e2 16 cp r14, r18 28324: f3 06 cpc r15, r19 28326: 09 f0 breq .+2 ; 0x2832a 28328: ae c0 rjmp .+348 ; 0x28486 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); 2832a: a4 e6 ldi r26, 0x64 ; 100 2832c: b0 e0 ldi r27, 0x00 ; 0 2832e: 0f 94 bc dc call 0x3b978 ; 0x3b978 <__umulhisi3> 28332: 9a 01 movw r18, r20 28334: 55 0f add r21, r21 28336: 44 0b sbc r20, r20 28338: 55 0b sbc r21, r21 2833a: 0f 94 8f dc call 0x3b91e ; 0x3b91e <__udivmodsi4> suff = 'R'; } else print_t = print_job_timer.duration() / 60; if (feedmultiply != 100 && (print_t == print_tr || print_t == print_tc)) { suff_doubt = '?'; 2833e: 4f e3 ldi r20, 0x3F ; 63 28340: e4 2e mov r14, r20 28342: 04 2e mov r0, r20 28344: 00 0c add r0, r0 28346: ff 08 sbc r15, r15 28348: e1 2f mov r30, r17 2834a: 01 2e mov r0, r17 2834c: 00 0c add r0, r0 2834e: ff 0b sbc r31, r31 28350: c9 01 movw r24, r18 28352: 6c e3 ldi r22, 0x3C ; 60 28354: 70 e0 ldi r23, 0x00 ; 0 28356: 0f 94 e5 dc call 0x3b9ca ; 0x3b9ca <__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 2835a: 20 37 cpi r18, 0x70 ; 112 2835c: 37 41 sbci r19, 0x17 ; 23 2835e: 08 f0 brcs .+2 ; 0x28362 28360: 94 c0 rjmp .+296 ; 0x2848a chars = lcd_printf_P(_N(LCD_STR_CLOCK "%02u:%02u%c%c"), print_t / 60, print_t % 60, suff, suff_doubt); 28362: ff 92 push r15 28364: 4f 93 push r20 28366: ff 93 push r31 28368: 1f 93 push r17 2836a: 9f 93 push r25 2836c: 8f 93 push r24 2836e: 7f 93 push r23 28370: 6f 93 push r22 28372: 8a ee ldi r24, 0xEA ; 234 28374: 9e e6 ldi r25, 0x6E ; 110 28376: 9f 93 push r25 28378: 8f 93 push r24 2837a: 0e 94 b9 6e call 0xdd72 ; 0xdd72 else //time>=100h chars = lcd_printf_P(_N(LCD_STR_CLOCK "%3uh %c%c"), print_t / 60, suff, suff_doubt); 2837e: 0f b6 in r0, 0x3f ; 63 28380: f8 94 cli 28382: de bf out 0x3e, r29 ; 62 28384: 0f be out 0x3f, r0 ; 63 28386: 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); 28388: 98 e0 ldi r25, 0x08 ; 8 2838a: 98 1b sub r25, r24 2838c: 89 2f mov r24, r25 2838e: 0e 94 d6 6e call 0xddac ; 0xddac #else //Print time (8chars) lcdui_print_time(); #endif //CMD_DIAGNOSTICS lcd_set_cursor(0, 3); //line 3 28392: 63 e0 ldi r22, 0x03 ; 3 28394: 80 e0 ldi r24, 0x00 ; 0 28396: 0e 94 e0 6e call 0xddc0 ; 0xddc0 #ifndef DEBUG_DISABLE_LCD_STATUS_LINE lcdui_print_status_line(); 2839a: 0f 94 73 2a call 0x254e6 ; 0x254e6 lcdui_print_status_screen(); prusa_statistics_update_from_status_screen(); if (lcd_commands_type != LcdCommands::Idle) 2839e: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 283a2: 88 23 and r24, r24 283a4: 09 f4 brne .+2 ; 0x283a8 283a6: 3e ce rjmp .-900 ; 0x28024 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) { 283a8: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 283ac: 81 11 cpse r24, r1 283ae: 3a ce rjmp .-908 ; 0x28024 283b0: 0f 94 8c 06 call 0x20d18 ; 0x20d18 283b4: 37 ce rjmp .-914 ; 0x28024 lcd_printf_P(PSTR("%-7s"),sheet); return; //do not also print the percentage } } if (!IS_SD_PRINTING && M79_timer_get_status() && GetHostStatusScreenName()) 283b6: e1 10 cpse r14, r1 283b8: 04 c0 rjmp .+8 ; 0x283c2 283ba: 80 91 9e 03 lds r24, 0x039E ; 0x80039e <_ZL9M79_timer.lto_priv.450> 283be: 81 11 cpse r24, r1 283c0: 4a c0 rjmp .+148 ; 0x28456 // Overwrite the name char * hostName = GetHostStatusScreenName(); lcd_space(1); // Blank space lcd_print(hostName); // Two characters } else { lcd_printf_P(PSTR("%3S"), src); 283c2: df 92 push r13 283c4: cf 92 push r12 283c6: 8d e7 ldi r24, 0x7D ; 125 283c8: 90 ea ldi r25, 0xA0 ; 160 283ca: 9f 93 push r25 283cc: 8f 93 push r24 283ce: 0e 94 b9 6e call 0xdd72 ; 0xdd72 283d2: 0f 90 pop r0 283d4: 0f 90 pop r0 283d6: 0f 90 pop r0 283d8: 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) 283da: 80 91 a4 03 lds r24, 0x03A4 ; 0x8003a4 283de: 81 11 cpse r24, r1 283e0: 04 c0 rjmp .+8 ; 0x283ea 283e2: 80 91 ae 02 lds r24, 0x02AE ; 0x8002ae 283e6: 85 36 cpi r24, 0x65 ; 101 283e8: f0 f1 brcs .+124 ; 0x28466 { percent_done = print_percent_done_normal; } else if (print_percent_done_silent <= 100) 283ea: 80 91 ad 02 lds r24, 0x02AD ; 0x8002ad 283ee: 85 36 cpi r24, 0x65 ; 101 283f0: d0 f1 brcs .+116 ; 0x28466 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;}; 283f2: 80 91 23 17 lds r24, 0x1723 ; 0x801723 283f6: 88 23 and r24, r24 283f8: 19 f1 breq .+70 ; 0x28440 283fa: 80 91 9d 17 lds r24, 0x179D ; 0x80179d 283fe: 90 91 9e 17 lds r25, 0x179E ; 0x80179e 28402: a0 91 9f 17 lds r26, 0x179F ; 0x80179f 28406: b0 91 a0 17 lds r27, 0x17A0 ; 0x8017a0 2840a: 00 97 sbiw r24, 0x00 ; 0 2840c: a1 05 cpc r26, r1 2840e: b1 05 cpc r27, r1 28410: b9 f0 breq .+46 ; 0x28440 28412: bc 01 movw r22, r24 28414: cd 01 movw r24, r26 28416: 6d 59 subi r22, 0x9D ; 157 28418: 7f 4f sbci r23, 0xFF ; 255 2841a: 8f 4f sbci r24, 0xFF ; 255 2841c: 9f 4f sbci r25, 0xFF ; 255 2841e: 24 e6 ldi r18, 0x64 ; 100 28420: 30 e0 ldi r19, 0x00 ; 0 28422: 40 e0 ldi r20, 0x00 ; 0 28424: 50 e0 ldi r21, 0x00 ; 0 28426: 0f 94 8f dc call 0x3b91e ; 0x3b91e <__udivmodsi4> 2842a: 60 91 a4 17 lds r22, 0x17A4 ; 0x8017a4 2842e: 70 91 a5 17 lds r23, 0x17A5 ; 0x8017a5 28432: 80 91 a6 17 lds r24, 0x17A6 ; 0x8017a6 28436: 90 91 a7 17 lds r25, 0x17A7 ; 0x8017a7 2843a: 0f 94 8f dc call 0x3b91e ; 0x3b91e <__udivmodsi4> 2843e: 12 2f mov r17, r18 } lcd_printf_P(num ? _N("%3d%%"):_N("---%%"), calc_percent_done()); 28440: 21 2f mov r18, r17 28442: 30 e0 ldi r19, 0x00 ; 0 28444: 8d ec ldi r24, 0xCD ; 205 28446: 9e e6 ldi r25, 0x6E ; 110 28448: f1 10 cpse r15, r1 2844a: 02 c0 rjmp .+4 ; 0x28450 2844c: 87 ec ldi r24, 0xC7 ; 199 2844e: 9e e6 ldi r25, 0x6E ; 110 28450: 3f 93 push r19 28452: 2f 93 push r18 28454: 14 cf rjmp .-472 ; 0x2827e if (!IS_SD_PRINTING && M79_timer_get_status() && GetHostStatusScreenName()) { // Overwrite the name char * hostName = GetHostStatusScreenName(); lcd_space(1); // Blank space 28456: 81 e0 ldi r24, 0x01 ; 1 28458: 0e 94 d6 6e call 0xddac ; 0xddac lcd_print(hostName); // Two characters 2845c: 8c e4 ldi r24, 0x4C ; 76 2845e: 96 e0 ldi r25, 0x06 ; 6 28460: 0e 94 e7 70 call 0xe1ce ; 0xe1ce 28464: ba cf rjmp .-140 ; 0x283da 28466: 18 2f mov r17, r24 28468: eb cf rjmp .-42 ; 0x28440 lcd_space(5 - lcdui_print_extruder()); } else if (farm_mode) { // Print farm number (5 chars) lcdui_print_farm(); } else { lcd_space(5); // 5 spaces 2846a: 85 e0 ldi r24, 0x05 ; 5 2846c: 1a cf rjmp .-460 ; 0x282a2 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) 2846e: c0 90 b1 02 lds r12, 0x02B1 ; 0x8002b1 28472: 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) 28476: e0 90 af 02 lds r14, 0x02AF ; 0x8002af 2847a: f0 90 b0 02 lds r15, 0x02B0 ; 0x8002b0 2847e: 25 cf rjmp .-438 ; 0x282ca 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) { 28480: 96 01 movw r18, r12 print_t = print_tr; suff = 'R'; 28482: 12 e5 ldi r17, 0x52 ; 82 28484: 43 cf rjmp .-378 ; 0x2830c 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 = ' '; 28486: 40 e2 ldi r20, 0x20 ; 32 28488: 5b cf rjmp .-330 ; 0x28340 } 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); 2848a: ff 92 push r15 2848c: 4f 93 push r20 2848e: ff 93 push r31 28490: 1f 93 push r17 28492: 7f 93 push r23 28494: 6f 93 push r22 28496: 8f ed ldi r24, 0xDF ; 223 28498: 9e e6 ldi r25, 0x6E ; 110 2849a: 9f 93 push r25 2849c: 8f 93 push r24 2849e: 0e 94 b9 6e call 0xdd72 ; 0xdd72 284a2: 6d cf rjmp .-294 ; 0x2837e } 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); 284a4: 85 ea ldi r24, 0xA5 ; 165 284a6: 9d e0 ldi r25, 0x0D ; 13 284a8: 0f 94 2a dc call 0x3b854 ; 0x3b854 284ac: bc 01 movw r22, r24 284ae: 90 e0 ldi r25, 0x00 ; 0 284b0: 80 e0 ldi r24, 0x00 ; 0 284b2: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 284b6: 20 e0 ldi r18, 0x00 ; 0 284b8: 30 e0 ldi r19, 0x00 ; 0 284ba: 4a e7 ldi r20, 0x7A ; 122 284bc: 54 e4 ldi r21, 0x44 ; 68 284be: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 284c2: 9f 93 push r25 284c4: 8f 93 push r24 284c6: 7f 93 push r23 284c8: 6f 93 push r22 284ca: 86 e8 ldi r24, 0x86 ; 134 284cc: 90 ea ldi r25, 0xA0 ; 160 284ce: 9f 93 push r25 284d0: 8f 93 push r24 284d2: 0e 94 b9 6e call 0xdd72 ; 0xdd72 284d6: 0f 90 pop r0 284d8: 0f 90 pop r0 284da: 0f 90 pop r0 284dc: 0f 90 pop r0 284de: 0f 90 pop r0 284e0: 0f 90 pop r0 284e2: 52 cf rjmp .-348 ; 0x28388 000284e4 : reset(); if ((accumulator = with_time)) state = RUNNING; } void Stopwatch::reset() { state = STOPPED; 284e4: 10 92 9d 03 sts 0x039D, r1 ; 0x80039d startTimestamp = 0; 284e8: 10 92 a7 05 sts 0x05A7, r1 ; 0x8005a7 284ec: 10 92 a8 05 sts 0x05A8, r1 ; 0x8005a8 284f0: 10 92 a9 05 sts 0x05A9, r1 ; 0x8005a9 284f4: 10 92 aa 05 sts 0x05AA, r1 ; 0x8005aa stopTimestamp = 0; 284f8: 10 92 52 06 sts 0x0652, r1 ; 0x800652 284fc: 10 92 53 06 sts 0x0653, r1 ; 0x800653 28500: 10 92 54 06 sts 0x0654, r1 ; 0x800654 28504: 10 92 55 06 sts 0x0655, r1 ; 0x800655 accumulator = 0; 28508: 10 92 a3 05 sts 0x05A3, r1 ; 0x8005a3 2850c: 10 92 a4 05 sts 0x05A4, r1 ; 0x8005a4 28510: 10 92 a5 05 sts 0x05A5, r1 ; 0x8005a5 28514: 10 92 a6 05 sts 0x05A6, r1 ; 0x8005a6 } 28518: 08 95 ret 0002851a : /** * @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; } 2851a: 80 91 9d 03 lds r24, 0x039D ; 0x80039d } else return false; } bool Stopwatch::start() { if (!isRunning()) { 2851e: 81 30 cpi r24, 0x01 ; 1 28520: f1 f0 breq .+60 ; 0x2855e if (isPaused()) accumulator = duration(); 28522: 82 30 cpi r24, 0x02 ; 2 28524: c9 f4 brne .+50 ; 0x28558 28526: 0f 94 a3 3e call 0x27d46 ; 0x27d46 2852a: 60 93 a3 05 sts 0x05A3, r22 ; 0x8005a3 2852e: 70 93 a4 05 sts 0x05A4, r23 ; 0x8005a4 28532: 80 93 a5 05 sts 0x05A5, r24 ; 0x8005a5 28536: 90 93 a6 05 sts 0x05A6, r25 ; 0x8005a6 else reset(); state = RUNNING; 2853a: 81 e0 ldi r24, 0x01 ; 1 2853c: 80 93 9d 03 sts 0x039D, r24 ; 0x80039d startTimestamp = _millis(); 28540: 0f 94 4c 29 call 0x25298 ; 0x25298 28544: 60 93 a7 05 sts 0x05A7, r22 ; 0x8005a7 28548: 70 93 a8 05 sts 0x05A8, r23 ; 0x8005a8 2854c: 80 93 a9 05 sts 0x05A9, r24 ; 0x8005a9 28550: 90 93 aa 05 sts 0x05AA, r25 ; 0x8005aa 28554: 81 e0 ldi r24, 0x01 ; 1 28556: 08 95 ret } bool Stopwatch::start() { if (!isRunning()) { if (isPaused()) accumulator = duration(); else reset(); 28558: 0f 94 72 42 call 0x284e4 ; 0x284e4 2855c: ee cf rjmp .-36 ; 0x2853a state = RUNNING; startTimestamp = _millis(); return true; } else return false; 2855e: 80 e0 ldi r24, 0x00 ; 0 } 28560: 08 95 ret 00028562 : uint32_t Stopwatch::accumulator; uint32_t Stopwatch::startTimestamp; uint32_t Stopwatch::stopTimestamp; bool Stopwatch::stop() { if (isRunning() || isPaused()) { 28562: 80 91 9d 03 lds r24, 0x039D ; 0x80039d 28566: 81 50 subi r24, 0x01 ; 1 28568: 82 30 cpi r24, 0x02 ; 2 2856a: 70 f4 brcc .+28 ; 0x28588 state = STOPPED; 2856c: 10 92 9d 03 sts 0x039D, r1 ; 0x80039d stopTimestamp = _millis(); 28570: 0f 94 4c 29 call 0x25298 ; 0x25298 28574: 60 93 52 06 sts 0x0652, r22 ; 0x800652 28578: 70 93 53 06 sts 0x0653, r23 ; 0x800653 2857c: 80 93 54 06 sts 0x0654, r24 ; 0x800654 28580: 90 93 55 06 sts 0x0655, r25 ; 0x800655 28584: 81 e0 ldi r24, 0x01 ; 1 28586: 08 95 ret return true; } else return false; 28588: 80 e0 ldi r24, 0x00 ; 0 } 2858a: 08 95 ret 0002858c : } long st_get_position(uint8_t axis) { long count_pos; CRITICAL_SECTION_START; 2858c: 2f b7 in r18, 0x3f ; 63 2858e: f8 94 cli count_pos = count_position[axis]; 28590: 94 e0 ldi r25, 0x04 ; 4 28592: 89 9f mul r24, r25 28594: f0 01 movw r30, r0 28596: 11 24 eor r1, r1 28598: ed 54 subi r30, 0x4D ; 77 2859a: f9 4f sbci r31, 0xF9 ; 249 2859c: 60 81 ld r22, Z 2859e: 71 81 ldd r23, Z+1 ; 0x01 285a0: 82 81 ldd r24, Z+2 ; 0x02 285a2: 93 81 ldd r25, Z+3 ; 0x03 CRITICAL_SECTION_END; 285a4: 2f bf out 0x3f, r18 ; 63 return count_pos; } 285a6: 08 95 ret 000285a8 : y = count_position[Y_AXIS]; CRITICAL_SECTION_END; } float st_get_position_mm(uint8_t axis) { 285a8: cf 93 push r28 285aa: c8 2f mov r28, r24 float steper_position_in_steps = st_get_position(axis); 285ac: 0f 94 c6 42 call 0x2858c ; 0x2858c 285b0: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> return steper_position_in_steps / cs.axis_steps_per_mm[axis]; 285b4: 24 e0 ldi r18, 0x04 ; 4 285b6: c2 9f mul r28, r18 285b8: f0 01 movw r30, r0 285ba: 11 24 eor r1, r1 285bc: ee 53 subi r30, 0x3E ; 62 285be: f2 4f sbci r31, 0xF2 ; 242 285c0: 20 81 ld r18, Z 285c2: 31 81 ldd r19, Z+1 ; 0x01 285c4: 42 81 ldd r20, Z+2 ; 0x02 285c6: 53 81 ldd r21, Z+3 ; 0x03 285c8: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> } 285cc: cf 91 pop r28 285ce: 08 95 ret 000285d0 : } // Block until all buffered steps are executed void st_synchronize() { 285d0: cf 93 push r28 285d2: df 93 push r29 285d4: 00 d0 rcall .+0 ; 0x285d6 285d6: 1f 92 push r1 285d8: cd b7 in r28, 0x3d ; 61 285da: 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); 285dc: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 285e0: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 while(blocks_queued()) 285e4: 98 17 cp r25, r24 285e6: 09 f4 brne .+2 ; 0x285ea 285e8: 46 c0 rjmp .+140 ; 0x28676 { #ifdef TMC2130 manage_heater(); 285ea: 0f 94 5c 38 call 0x270b8 ; 0x270b8 tmc2130_sg_stop_on_crash = eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET); } bool tmc2130_update_sg() { if (tmc2130_sg_measure <= E_AXIS) 285ee: 80 91 3b 02 lds r24, 0x023B ; 0x80023b <_ZL18tmc2130_sg_measure.lto_priv.473> 285f2: 84 30 cpi r24, 0x04 ; 4 285f4: 38 f0 brcs .+14 ; 0x28604 // Vojtech: Don't disable motors inside the planner! if (!tmc2130_update_sg()) { manage_inactivity(true); 285f6: 81 e0 ldi r24, 0x01 ; 1 285f8: 0e 94 af 8a call 0x1155e ; 0x1155e lcd_update(0); 285fc: 80 e0 ldi r24, 0x00 ; 0 285fe: 0e 94 a7 6e call 0xdd4e ; 0xdd4e 28602: ec cf rjmp .-40 ; 0x285dc { uint32_t val32 = 0; 28604: 19 82 std Y+1, r1 ; 0x01 28606: 1a 82 std Y+2, r1 ; 0x02 28608: 1b 82 std Y+3, r1 ; 0x03 2860a: 1c 82 std Y+4, r1 ; 0x04 tmc2130_rd(tmc2130_sg_measure, TMC2130_REG_DRV_STATUS, &val32); 2860c: ae 01 movw r20, r28 2860e: 4f 5f subi r20, 0xFF ; 255 28610: 5f 4f sbci r21, 0xFF ; 255 28612: 6f e6 ldi r22, 0x6F ; 111 28614: 0f 94 f1 23 call 0x247e2 ; 0x247e2 tmc2130_sg_measure_val += (val32 & 0x3ff); 28618: 89 81 ldd r24, Y+1 ; 0x01 2861a: 9a 81 ldd r25, Y+2 ; 0x02 2861c: ab 81 ldd r26, Y+3 ; 0x03 2861e: bc 81 ldd r27, Y+4 ; 0x04 28620: 93 70 andi r25, 0x03 ; 3 28622: aa 27 eor r26, r26 28624: bb 27 eor r27, r27 28626: 40 91 d1 03 lds r20, 0x03D1 ; 0x8003d1 <_ZL22tmc2130_sg_measure_val.lto_priv.474> 2862a: 50 91 d2 03 lds r21, 0x03D2 ; 0x8003d2 <_ZL22tmc2130_sg_measure_val.lto_priv.474+0x1> 2862e: 60 91 d3 03 lds r22, 0x03D3 ; 0x8003d3 <_ZL22tmc2130_sg_measure_val.lto_priv.474+0x2> 28632: 70 91 d4 03 lds r23, 0x03D4 ; 0x8003d4 <_ZL22tmc2130_sg_measure_val.lto_priv.474+0x3> 28636: 84 0f add r24, r20 28638: 95 1f adc r25, r21 2863a: a6 1f adc r26, r22 2863c: b7 1f adc r27, r23 2863e: 80 93 d1 03 sts 0x03D1, r24 ; 0x8003d1 <_ZL22tmc2130_sg_measure_val.lto_priv.474> 28642: 90 93 d2 03 sts 0x03D2, r25 ; 0x8003d2 <_ZL22tmc2130_sg_measure_val.lto_priv.474+0x1> 28646: a0 93 d3 03 sts 0x03D3, r26 ; 0x8003d3 <_ZL22tmc2130_sg_measure_val.lto_priv.474+0x2> 2864a: b0 93 d4 03 sts 0x03D4, r27 ; 0x8003d4 <_ZL22tmc2130_sg_measure_val.lto_priv.474+0x3> tmc2130_sg_measure_cnt++; 2864e: 80 91 cd 03 lds r24, 0x03CD ; 0x8003cd <_ZL22tmc2130_sg_measure_cnt.lto_priv.475> 28652: 90 91 ce 03 lds r25, 0x03CE ; 0x8003ce <_ZL22tmc2130_sg_measure_cnt.lto_priv.475+0x1> 28656: a0 91 cf 03 lds r26, 0x03CF ; 0x8003cf <_ZL22tmc2130_sg_measure_cnt.lto_priv.475+0x2> 2865a: b0 91 d0 03 lds r27, 0x03D0 ; 0x8003d0 <_ZL22tmc2130_sg_measure_cnt.lto_priv.475+0x3> 2865e: 01 96 adiw r24, 0x01 ; 1 28660: a1 1d adc r26, r1 28662: b1 1d adc r27, r1 28664: 80 93 cd 03 sts 0x03CD, r24 ; 0x8003cd <_ZL22tmc2130_sg_measure_cnt.lto_priv.475> 28668: 90 93 ce 03 sts 0x03CE, r25 ; 0x8003ce <_ZL22tmc2130_sg_measure_cnt.lto_priv.475+0x1> 2866c: a0 93 cf 03 sts 0x03CF, r26 ; 0x8003cf <_ZL22tmc2130_sg_measure_cnt.lto_priv.475+0x2> 28670: b0 93 d0 03 sts 0x03D0, r27 ; 0x8003d0 <_ZL22tmc2130_sg_measure_cnt.lto_priv.475+0x3> 28674: b3 cf rjmp .-154 ; 0x285dc #else //TMC2130 // Vojtech: Don't disable motors inside the planner! delay_keep_alive(0); #endif //TMC2130 } } 28676: 0f 90 pop r0 28678: 0f 90 pop r0 2867a: 0f 90 pop r0 2867c: 0f 90 pop r0 2867e: df 91 pop r29 28680: cf 91 pop r28 28682: 08 95 ret 00028684 : void st_reset_timer() { // Clear a possible pending interrupt on OCR1A overflow. TIFR1 |= 1 << OCF1A; 28684: b1 9a sbi 0x16, 1 ; 22 // Reset the counter. TCNT1 = 0; 28686: 10 92 85 00 sts 0x0085, r1 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 2868a: 10 92 84 00 sts 0x0084, r1 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> // Wake up after 1ms from now. OCR1A = 2000; 2868e: 80 ed ldi r24, 0xD0 ; 208 28690: 97 e0 ldi r25, 0x07 ; 7 28692: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 28696: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> #ifdef LIN_ADVANCE nextMainISR = 0; 2869a: 10 92 e6 04 sts 0x04E6, r1 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.476+0x1> 2869e: 10 92 e5 04 sts 0x04E5, r1 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.476> if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) 286a2: 80 91 e3 04 lds r24, 0x04E3 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.477> 286a6: 90 91 e4 04 lds r25, 0x04E4 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.477+0x1> 286aa: 01 97 sbiw r24, 0x01 ; 1 286ac: 8e 3f cpi r24, 0xFE ; 254 286ae: 9f 4f sbci r25, 0xFF ; 255 286b0: 20 f4 brcc .+8 ; 0x286ba nextAdvanceISR = 0; 286b2: 10 92 e4 04 sts 0x04E4, r1 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.477+0x1> 286b6: 10 92 e3 04 sts 0x04E3, r1 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.477> #endif } 286ba: 08 95 ret 000286bc <__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) { 286bc: 1f 92 push r1 286be: 0f 92 push r0 286c0: 0f b6 in r0, 0x3f ; 63 286c2: 0f 92 push r0 286c4: 11 24 eor r1, r1 286c6: 0b b6 in r0, 0x3b ; 59 286c8: 0f 92 push r0 286ca: 6f 92 push r6 286cc: 7f 92 push r7 286ce: 8f 92 push r8 286d0: cf 92 push r12 286d2: df 92 push r13 286d4: ef 92 push r14 286d6: ff 92 push r15 286d8: 0f 93 push r16 286da: 1f 93 push r17 286dc: 2f 93 push r18 286de: 3f 93 push r19 286e0: 4f 93 push r20 286e2: 5f 93 push r21 286e4: 6f 93 push r22 286e6: 7f 93 push r23 286e8: 8f 93 push r24 286ea: 9f 93 push r25 286ec: af 93 push r26 286ee: bf 93 push r27 286f0: cf 93 push r28 286f2: df 93 push r29 286f4: ef 93 push r30 286f6: ff 93 push r31 } } FORCE_INLINE void advance_isr_scheduler() { // Integrate the final timer value, accounting for scheduling adjustments if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) 286f8: 80 91 e3 04 lds r24, 0x04E3 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.477> 286fc: 90 91 e4 04 lds r25, 0x04E4 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.477+0x1> 28700: 9c 01 movw r18, r24 28702: 21 50 subi r18, 0x01 ; 1 28704: 31 09 sbc r19, r1 28706: 2e 3f cpi r18, 0xFE ; 254 28708: 3f 4f sbci r19, 0xFF ; 255 2870a: 90 f4 brcc .+36 ; 0x28730 <__vector_17+0x74> { if(nextAdvanceISR > OCR1A) 2870c: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 28710: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 28714: 28 17 cp r18, r24 28716: 39 07 cpc r19, r25 28718: 08 f0 brcs .+2 ; 0x2871c <__vector_17+0x60> 2871a: f9 c0 rjmp .+498 ; 0x2890e <__vector_17+0x252> nextAdvanceISR -= OCR1A; 2871c: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 28720: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 28724: 82 1b sub r24, r18 28726: 93 0b sbc r25, r19 28728: 90 93 e4 04 sts 0x04E4, r25 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.477+0x1> 2872c: 80 93 e3 04 sts 0x04E3, r24 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.477> else nextAdvanceISR = 0; } if(nextMainISR > OCR1A) 28730: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 28734: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 28738: 80 91 e5 04 lds r24, 0x04E5 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.476> 2873c: 90 91 e6 04 lds r25, 0x04E6 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.476+0x1> 28740: 28 17 cp r18, r24 28742: 39 07 cpc r19, r25 28744: 08 f0 brcs .+2 ; 0x28748 <__vector_17+0x8c> 28746: e8 c0 rjmp .+464 ; 0x28918 <__vector_17+0x25c> nextMainISR -= OCR1A; 28748: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2874c: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 28750: 82 1b sub r24, r18 28752: 93 0b sbc r25, r19 28754: 90 93 e6 04 sts 0x04E6, r25 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.476+0x1> 28758: 80 93 e5 04 sts 0x04E5, r24 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.476> else nextMainISR = 0; // Run main stepping ISR if flagged if (!nextMainISR) 2875c: 80 91 e5 04 lds r24, 0x04E5 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.476> 28760: 90 91 e6 04 lds r25, 0x04E6 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.476+0x1> 28764: 89 2b or r24, r25 28766: 11 f0 breq .+4 ; 0x2876c <__vector_17+0xb0> 28768: 0d 94 ae 4c jmp 0x2995c ; 0x2995c <__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) 2876c: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 28770: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 28774: 30 97 sbiw r30, 0x00 ; 0 28776: 09 f0 breq .+2 ; 0x2877a <__vector_17+0xbe> 28778: 87 c1 rjmp .+782 ; 0x28a88 <__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) { 2877a: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 2877e: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 28782: 98 17 cp r25, r24 28784: 09 f4 brne .+2 ; 0x28788 <__vector_17+0xcc> 28786: f9 c1 rjmp .+1010 ; 0x28b7a <__vector_17+0x4be> return(NULL); } block_t *block = &block_buffer[block_buffer_tail]; 28788: c0 91 a6 0d lds r28, 0x0DA6 ; 0x800da6 2878c: 2c 2f mov r18, r28 2878e: 30 e0 ldi r19, 0x00 ; 0 28790: 5e e6 ldi r21, 0x6E ; 110 28792: c5 9f mul r28, r21 28794: e0 01 movw r28, r0 28796: 11 24 eor r1, r1 28798: cb 53 subi r28, 0x3B ; 59 2879a: d9 4f sbci r29, 0xF9 ; 249 block->busy = true; 2879c: fe 01 movw r30, r28 2879e: e9 5b subi r30, 0xB9 ; 185 287a0: ff 4f sbci r31, 0xFF ; 255 287a2: 41 e0 ldi r20, 0x01 ; 1 287a4: 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(); 287a6: d0 93 a2 05 sts 0x05A2, r29 ; 0x8005a2 287aa: c0 93 a1 05 sts 0x05A1, r28 ; 0x8005a1 if (current_block != NULL) { 287ae: 20 97 sbiw r28, 0x00 ; 0 287b0: 09 f4 brne .+2 ; 0x287b4 <__vector_17+0xf8> 287b2: e3 c1 rjmp .+966 ; 0x28b7a <__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; 287b4: 10 92 9d 05 sts 0x059D, r1 ; 0x80059d 287b8: 10 92 9e 05 sts 0x059E, r1 ; 0x80059e 287bc: 10 92 9f 05 sts 0x059F, r1 ; 0x80059f 287c0: 10 92 a0 05 sts 0x05A0, r1 ; 0x8005a0 // 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; 287c4: 10 92 9c 05 sts 0x059C, r1 ; 0x80059c acc_step_rate = uint16_t(current_block->initial_rate); 287c8: 8a ad ldd r24, Y+58 ; 0x3a 287ca: 9b ad ldd r25, Y+59 ; 0x3b 287cc: 90 93 9b 05 sts 0x059B, r25 ; 0x80059b 287d0: 80 93 9a 05 sts 0x059A, r24 ; 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; 287d4: 81 34 cpi r24, 0x41 ; 65 287d6: ec e9 ldi r30, 0x9C ; 156 287d8: 9e 07 cpc r25, r30 287da: 08 f0 brcs .+2 ; 0x287de <__vector_17+0x122> 287dc: a2 c0 rjmp .+324 ; 0x28922 <__vector_17+0x266> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 287de: 81 32 cpi r24, 0x21 ; 33 287e0: fe e4 ldi r31, 0x4E ; 78 287e2: 9f 07 cpc r25, r31 287e4: 08 f4 brcc .+2 ; 0x287e8 <__vector_17+0x12c> 287e6: a0 c0 rjmp .+320 ; 0x28928 <__vector_17+0x26c> step_rate = (step_rate >> 2)&0x3fff; 287e8: 96 95 lsr r25 287ea: 87 95 ror r24 287ec: 96 95 lsr r25 287ee: 87 95 ror r24 step_loops = 4; 287f0: 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; 287f2: 40 93 99 05 sts 0x0599, r20 ; 0x800599 else { step_loops = 1; } if(step_rate < (F_CPU/500000)) step_rate = (F_CPU/500000); step_rate -= (F_CPU/500000); // Correct for minimal speed 287f6: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 287f8: 81 15 cp r24, r1 287fa: e8 e0 ldi r30, 0x08 ; 8 287fc: 9e 07 cpc r25, r30 287fe: 08 f4 brcc .+2 ; 0x28802 <__vector_17+0x146> 28800: a4 c0 rjmp .+328 ; 0x2894a <__vector_17+0x28e> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 28802: e9 2f mov r30, r25 28804: ff 27 eor r31, r31 28806: ee 0f add r30, r30 28808: ff 1f adc r31, r31 2880a: ee 0f add r30, r30 2880c: ff 1f adc r31, r31 2880e: af 01 movw r20, r30 28810: 4a 5a subi r20, 0xAA ; 170 28812: 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); 28814: fa 01 movw r30, r20 28816: 32 96 adiw r30, 0x02 ; 2 28818: a5 91 lpm r26, Z+ 2881a: b4 91 lpm r27, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 2881c: fa 01 movw r30, r20 2881e: 45 91 lpm r20, Z+ 28820: 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. ); 28822: b8 9f mul r27, r24 28824: b0 01 movw r22, r0 28826: a8 9f mul r26, r24 28828: 00 0c add r0, r0 2882a: 61 1d adc r22, r1 2882c: 11 24 eor r1, r1 2882e: 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); 28830: ca 01 movw r24, r20 28832: 86 1b sub r24, r22 28834: 97 0b sbc r25, r23 acceleration_time = calc_timer(acc_step_rate, step_loops); 28836: 84 36 cpi r24, 0x64 ; 100 28838: 91 05 cpc r25, r1 2883a: 10 f4 brcc .+4 ; 0x28840 <__vector_17+0x184> 2883c: 84 e6 ldi r24, 0x64 ; 100 2883e: 90 e0 ldi r25, 0x00 ; 0 28840: b0 e0 ldi r27, 0x00 ; 0 28842: a0 e0 ldi r26, 0x00 ; 0 28844: 80 93 95 05 sts 0x0595, r24 ; 0x800595 28848: 90 93 96 05 sts 0x0596, r25 ; 0x800596 2884c: a0 93 97 05 sts 0x0597, r26 ; 0x800597 28850: b0 93 98 05 sts 0x0598, r27 ; 0x800598 #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 28854: 4e e6 ldi r20, 0x6E ; 110 28856: 42 9f mul r20, r18 28858: c0 01 movw r24, r0 2885a: 43 9f mul r20, r19 2885c: 90 0d add r25, r0 2885e: 11 24 eor r1, r1 28860: 8b 53 subi r24, 0x3B ; 59 28862: 99 4f sbci r25, 0xF9 ; 249 28864: fc 01 movw r30, r24 28866: e4 5b subi r30, 0xB4 ; 180 28868: ff 4f sbci r31, 0xFF ; 255 2886a: 40 81 ld r20, Z 2886c: 44 23 and r20, r20 2886e: 49 f0 breq .+18 ; 0x28882 <__vector_17+0x1c6> target_adv_steps = current_block->max_adv_steps; 28870: 81 5b subi r24, 0xB1 ; 177 28872: 9f 4f sbci r25, 0xFF ; 255 28874: fc 01 movw r30, r24 28876: 80 81 ld r24, Z 28878: 91 81 ldd r25, Z+1 ; 0x01 2887a: 90 93 94 05 sts 0x0594, r25 ; 0x800594 2887e: 80 93 93 05 sts 0x0593, r24 ; 0x800593 } e_steps = 0; 28882: 10 92 92 05 sts 0x0592, r1 ; 0x800592 nextAdvanceISR = ADV_NEVER; 28886: 8f ef ldi r24, 0xFF ; 255 28888: 9f ef ldi r25, 0xFF ; 255 2888a: 90 93 e4 04 sts 0x04E4, r25 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.477+0x1> 2888e: 80 93 e3 04 sts 0x04E3, r24 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.477> LA_phase = -1; 28892: 80 93 91 05 sts 0x0591, r24 ; 0x800591 #endif if (current_block->flag & BLOCK_FLAG_E_RESET) { 28896: 8e e6 ldi r24, 0x6E ; 110 28898: 82 9f mul r24, r18 2889a: f0 01 movw r30, r0 2889c: 83 9f mul r24, r19 2889e: f0 0d add r31, r0 288a0: 11 24 eor r1, r1 288a2: eb 53 subi r30, 0x3B ; 59 288a4: f9 4f sbci r31, 0xF9 ; 249 288a6: 85 a9 ldd r24, Z+53 ; 0x35 288a8: 84 ff sbrs r24, 4 288aa: 08 c0 rjmp .+16 ; 0x288bc <__vector_17+0x200> count_position[E_AXIS] = 0; 288ac: 10 92 bf 06 sts 0x06BF, r1 ; 0x8006bf 288b0: 10 92 c0 06 sts 0x06C0, r1 ; 0x8006c0 288b4: 10 92 c1 06 sts 0x06C1, r1 ; 0x8006c1 288b8: 10 92 c2 06 sts 0x06C2, r1 ; 0x8006c2 } if (current_block->flag & BLOCK_FLAG_DDA_LOWRES) { 288bc: 83 ff sbrs r24, 3 288be: 66 c0 rjmp .+204 ; 0x2898c <__vector_17+0x2d0> const int16_t value = -(current_block->step_event_count.lo >> 1); 288c0: 8e e6 ldi r24, 0x6E ; 110 288c2: 82 9f mul r24, r18 288c4: f0 01 movw r30, r0 288c6: 83 9f mul r24, r19 288c8: f0 0d add r31, r0 288ca: 11 24 eor r1, r1 288cc: eb 53 subi r30, 0x3B ; 59 288ce: f9 4f sbci r31, 0xF9 ; 249 288d0: 80 89 ldd r24, Z+16 ; 0x10 288d2: 91 89 ldd r25, Z+17 ; 0x11 288d4: 96 95 lsr r25 288d6: 87 95 ror r24 288d8: 91 95 neg r25 288da: 81 95 neg r24 288dc: 91 09 sbc r25, r1 for (uint8_t axis = 0; axis < NUM_AXIS; axis++) { counter[axis].lo = value; 288de: 90 93 82 05 sts 0x0582, r25 ; 0x800582 288e2: 80 93 81 05 sts 0x0581, r24 ; 0x800581 288e6: 90 93 86 05 sts 0x0586, r25 ; 0x800586 288ea: 80 93 85 05 sts 0x0585, r24 ; 0x800585 288ee: 90 93 8a 05 sts 0x058A, r25 ; 0x80058a 288f2: 80 93 89 05 sts 0x0589, r24 ; 0x800589 288f6: 90 93 8e 05 sts 0x058E, r25 ; 0x80058e 288fa: 80 93 8d 05 sts 0x058D, r24 ; 0x80058d } #ifdef LIN_ADVANCE e_extruding = current_block->steps[E_AXIS].lo != 0; 288fe: 81 e0 ldi r24, 0x01 ; 1 28900: 24 85 ldd r18, Z+12 ; 0x0c 28902: 35 85 ldd r19, Z+13 ; 0x0d 28904: 23 2b or r18, r19 28906: 09 f0 breq .+2 ; 0x2890a <__vector_17+0x24e> 28908: 82 c0 rjmp .+260 ; 0x28a0e <__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; 2890a: 80 e0 ldi r24, 0x00 ; 0 2890c: 80 c0 rjmp .+256 ; 0x28a0e <__vector_17+0x352> if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) { if(nextAdvanceISR > OCR1A) nextAdvanceISR -= OCR1A; else nextAdvanceISR = 0; 2890e: 10 92 e4 04 sts 0x04E4, r1 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.477+0x1> 28912: 10 92 e3 04 sts 0x04E3, r1 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.477> 28916: 0c cf rjmp .-488 ; 0x28730 <__vector_17+0x74> } if(nextMainISR > OCR1A) nextMainISR -= OCR1A; else nextMainISR = 0; 28918: 10 92 e6 04 sts 0x04E6, r1 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.476+0x1> 2891c: 10 92 e5 04 sts 0x04E5, r1 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.476> 28920: 1d cf rjmp .-454 ; 0x2875c <__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; 28922: 80 e4 ldi r24, 0x40 ; 64 28924: 9c e9 ldi r25, 0x9C ; 156 28926: 60 cf rjmp .-320 ; 0x287e8 <__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 28928: 81 31 cpi r24, 0x11 ; 17 2892a: 57 e2 ldi r21, 0x27 ; 39 2892c: 95 07 cpc r25, r21 2892e: 20 f0 brcs .+8 ; 0x28938 <__vector_17+0x27c> step_rate = (step_rate >> 1)&0x7fff; 28930: 96 95 lsr r25 28932: 87 95 ror r24 step_loops = 2; 28934: 42 e0 ldi r20, 0x02 ; 2 28936: 5d cf rjmp .-326 ; 0x287f2 <__vector_17+0x136> } else { step_loops = 1; 28938: 40 93 99 05 sts 0x0599, r20 ; 0x800599 2893c: 80 32 cpi r24, 0x20 ; 32 2893e: 91 05 cpc r25, r1 28940: 08 f0 brcs .+2 ; 0x28944 <__vector_17+0x288> 28942: 59 cf rjmp .-334 ; 0x287f6 <__vector_17+0x13a> 28944: 80 e2 ldi r24, 0x20 ; 32 28946: 90 e0 ldi r25, 0x00 ; 0 28948: 56 cf rjmp .-340 ; 0x287f6 <__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; 2894a: ac 01 movw r20, r24 2894c: 56 95 lsr r21 2894e: 47 95 ror r20 28950: 4c 7f andi r20, 0xFC ; 252 28952: 4a 5a subi r20, 0xAA ; 170 28954: 5d 46 sbci r21, 0x6D ; 109 timer = (unsigned short)pgm_read_word_near(table_address); 28956: fa 01 movw r30, r20 28958: 65 91 lpm r22, Z+ 2895a: 74 91 lpm r23, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 2895c: fa 01 movw r30, r20 2895e: 32 96 adiw r30, 0x02 ; 2 28960: a5 91 lpm r26, Z+ 28962: b4 91 lpm r27, Z 28964: ac 01 movw r20, r24 28966: 47 70 andi r20, 0x07 ; 7 28968: 55 27 eor r21, r21 2896a: 4a 9f mul r20, r26 2896c: c0 01 movw r24, r0 2896e: 4b 9f mul r20, r27 28970: 90 0d add r25, r0 28972: 5a 9f mul r21, r26 28974: 90 0d add r25, r0 28976: 11 24 eor r1, r1 28978: e3 e0 ldi r30, 0x03 ; 3 2897a: 96 95 lsr r25 2897c: 87 95 ror r24 2897e: ea 95 dec r30 28980: e1 f7 brne .-8 ; 0x2897a <__vector_17+0x2be> 28982: ab 01 movw r20, r22 28984: 48 1b sub r20, r24 28986: 59 0b sbc r21, r25 28988: ca 01 movw r24, r20 2898a: 55 cf rjmp .-342 ; 0x28836 <__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); 2898c: 8e e6 ldi r24, 0x6E ; 110 2898e: 82 9f mul r24, r18 28990: f0 01 movw r30, r0 28992: 83 9f mul r24, r19 28994: f0 0d add r31, r0 28996: 11 24 eor r1, r1 28998: eb 53 subi r30, 0x3B ; 59 2899a: f9 4f sbci r31, 0xF9 ; 249 2899c: 80 89 ldd r24, Z+16 ; 0x10 2899e: 91 89 ldd r25, Z+17 ; 0x11 289a0: a2 89 ldd r26, Z+18 ; 0x12 289a2: b3 89 ldd r27, Z+19 ; 0x13 289a4: b6 95 lsr r27 289a6: a7 95 ror r26 289a8: 97 95 ror r25 289aa: 87 95 ror r24 289ac: b0 95 com r27 289ae: a0 95 com r26 289b0: 90 95 com r25 289b2: 81 95 neg r24 289b4: 9f 4f sbci r25, 0xFF ; 255 289b6: af 4f sbci r26, 0xFF ; 255 289b8: bf 4f sbci r27, 0xFF ; 255 for (uint8_t axis = 0; axis < NUM_AXIS; axis++) { counter[axis].wide = value; 289ba: 80 93 81 05 sts 0x0581, r24 ; 0x800581 289be: 90 93 82 05 sts 0x0582, r25 ; 0x800582 289c2: a0 93 83 05 sts 0x0583, r26 ; 0x800583 289c6: b0 93 84 05 sts 0x0584, r27 ; 0x800584 289ca: 80 93 85 05 sts 0x0585, r24 ; 0x800585 289ce: 90 93 86 05 sts 0x0586, r25 ; 0x800586 289d2: a0 93 87 05 sts 0x0587, r26 ; 0x800587 289d6: b0 93 88 05 sts 0x0588, r27 ; 0x800588 289da: 80 93 89 05 sts 0x0589, r24 ; 0x800589 289de: 90 93 8a 05 sts 0x058A, r25 ; 0x80058a 289e2: a0 93 8b 05 sts 0x058B, r26 ; 0x80058b 289e6: b0 93 8c 05 sts 0x058C, r27 ; 0x80058c 289ea: 80 93 8d 05 sts 0x058D, r24 ; 0x80058d 289ee: 90 93 8e 05 sts 0x058E, r25 ; 0x80058e 289f2: a0 93 8f 05 sts 0x058F, r26 ; 0x80058f 289f6: b0 93 90 05 sts 0x0590, r27 ; 0x800590 } #ifdef LIN_ADVANCE e_extruding = current_block->steps[E_AXIS].wide != 0; 289fa: 81 e0 ldi r24, 0x01 ; 1 289fc: 44 85 ldd r20, Z+12 ; 0x0c 289fe: 55 85 ldd r21, Z+13 ; 0x0d 28a00: 66 85 ldd r22, Z+14 ; 0x0e 28a02: 77 85 ldd r23, Z+15 ; 0x0f 28a04: 45 2b or r20, r21 28a06: 46 2b or r20, r22 28a08: 47 2b or r20, r23 28a0a: 09 f4 brne .+2 ; 0x28a0e <__vector_17+0x352> 28a0c: 7e cf rjmp .-260 ; 0x2890a <__vector_17+0x24e> 28a0e: 80 93 80 05 sts 0x0580, r24 ; 0x800580 #endif } step_events_completed.wide = 0; 28a12: 10 92 7c 05 sts 0x057C, r1 ; 0x80057c 28a16: 10 92 7d 05 sts 0x057D, r1 ; 0x80057d 28a1a: 10 92 7e 05 sts 0x057E, r1 ; 0x80057e 28a1e: 10 92 7f 05 sts 0x057F, r1 ; 0x80057f // Set directions. out_bits = current_block->direction_bits; 28a22: 88 8d ldd r24, Y+24 ; 0x18 28a24: 80 93 7b 05 sts 0x057B, r24 ; 0x80057b // 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); 28a2c: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 28a30: 81 60 ori r24, 0x01 ; 1 28a32: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[X_AXIS]=-1; 28a36: 8f ef ldi r24, 0xFF ; 255 } else { WRITE_NC(X_DIR_PIN, !INVERT_X_DIR); count_direction[X_AXIS]=1; 28a38: 80 93 97 02 sts 0x0297, r24 ; 0x800297 } if((out_bits & (1< 28a40: 81 ff sbrs r24, 1 28a42: 8b c0 rjmp .+278 ; 0x28b5a <__vector_17+0x49e> WRITE_NC(Y_DIR_PIN, INVERT_Y_DIR); 28a44: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 28a48: 8d 7f andi r24, 0xFD ; 253 28a4a: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Y_AXIS]=-1; 28a4e: 8f ef ldi r24, 0xFF ; 255 } else { WRITE_NC(Y_DIR_PIN, !INVERT_Y_DIR); count_direction[Y_AXIS]=1; 28a50: 80 93 98 02 sts 0x0298, r24 ; 0x800298 } if ((out_bits & (1< 28a58: 82 ff sbrs r24, 2 28a5a: 86 c0 rjmp .+268 ; 0x28b68 <__vector_17+0x4ac> WRITE_NC(Z_DIR_PIN,INVERT_Z_DIR); 28a5c: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 28a60: 84 60 ori r24, 0x04 ; 4 28a62: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Z_AXIS]=-1; 28a66: 8f ef ldi r24, 0xFF ; 255 } else { // +direction WRITE_NC(Z_DIR_PIN,!INVERT_Z_DIR); count_direction[Z_AXIS]=1; 28a68: 80 93 99 02 sts 0x0299, r24 ; 0x800299 } if ((out_bits & (1 << E_AXIS)) != 0) { // -direction 28a6c: 80 91 7b 05 lds r24, 0x057B ; 0x80057b 28a70: 83 ff sbrs r24, 3 28a72: 81 c0 rjmp .+258 ; 0x28b76 <__vector_17+0x4ba> #ifndef LIN_ADVANCE WRITE(E0_DIR_PIN, INVERT_E0_DIR); #endif /* LIN_ADVANCE */ count_direction[E_AXIS] = -1; 28a74: 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; 28a76: 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) 28a7a: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 28a7e: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 28a82: 30 97 sbiw r30, 0x00 ; 0 28a84: 09 f4 brne .+2 ; 0x28a88 <__vector_17+0x3cc> 28a86: 3d c7 rjmp .+3706 ; 0x29902 <__vector_17+0x1246> } // Check limit switches. FORCE_INLINE void stepper_check_endstops() { if(check_endstops) 28a88: 80 91 b7 02 lds r24, 0x02B7 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> 28a8c: 50 91 78 05 lds r21, 0x0578 ; 0x800578 28a90: 88 23 and r24, r24 28a92: 09 f4 brne .+2 ; 0x28a96 <__vector_17+0x3da> 28a94: cb c0 rjmp .+406 ; 0x28c2c <__vector_17+0x570> { uint8_t _endstop_hit = endstop_hit; 28a96: 20 91 0b 05 lds r18, 0x050B ; 0x80050b <_ZL11endstop_hit.lto_priv.480> uint8_t _endstop = endstop; 28a9a: 80 91 7a 05 lds r24, 0x057A ; 0x80057a uint8_t _old_endstop = old_endstop; 28a9e: 90 91 79 05 lds r25, 0x0579 ; 0x800579 #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))); 28aa6: 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))); 28aae: 42 fd sbrc r20, 2 28ab0: 83 c0 rjmp .+262 ; 0x28bb8 <__vector_17+0x4fc> 28ab2: 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)) { 28ab4: 49 2f mov r20, r25 28ab6: 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)){ 28ab8: 48 23 and r20, r24 28aba: b1 f0 breq .+44 ; 0x28ae8 <__vector_17+0x42c> 28abc: c0 80 ld r12, Z 28abe: d1 80 ldd r13, Z+1 ; 0x01 28ac0: e2 80 ldd r14, Z+2 ; 0x02 28ac2: f3 80 ldd r15, Z+3 ; 0x03 28ac4: 1c 14 cp r1, r12 28ac6: 1d 04 cpc r1, r13 28ac8: 1e 04 cpc r1, r14 28aca: 1f 04 cpc r1, r15 28acc: 6c f4 brge .+26 ; 0x28ae8 <__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); 28ace: 21 60 ori r18, 0x01 ; 1 step_events_completed.wide = current_block->step_event_count.wide; 28ad0: c0 88 ldd r12, Z+16 ; 0x10 28ad2: d1 88 ldd r13, Z+17 ; 0x11 28ad4: e2 88 ldd r14, Z+18 ; 0x12 28ad6: f3 88 ldd r15, Z+19 ; 0x13 28ad8: c0 92 7c 05 sts 0x057C, r12 ; 0x80057c 28adc: d0 92 7d 05 sts 0x057D, r13 ; 0x80057d 28ae0: e0 92 7e 05 sts 0x057E, r14 ; 0x80057e 28ae4: f0 92 7f 05 sts 0x057F, r15 ; 0x80057f #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))); 28ae8: 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))); 28af0: 47 fd sbrc r20, 7 28af2: 6c c0 rjmp .+216 ; 0x28bcc <__vector_17+0x510> 28af4: 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)) { 28af6: 49 2f mov r20, r25 28af8: 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)){ 28afa: 48 23 and r20, r24 28afc: b1 f0 breq .+44 ; 0x28b2a <__vector_17+0x46e> 28afe: c4 80 ldd r12, Z+4 ; 0x04 28b00: d5 80 ldd r13, Z+5 ; 0x05 28b02: e6 80 ldd r14, Z+6 ; 0x06 28b04: f7 80 ldd r15, Z+7 ; 0x07 28b06: 1c 14 cp r1, r12 28b08: 1d 04 cpc r1, r13 28b0a: 1e 04 cpc r1, r14 28b0c: 1f 04 cpc r1, r15 28b0e: 6c f4 brge .+26 ; 0x28b2a <__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); 28b10: 22 60 ori r18, 0x02 ; 2 step_events_completed.wide = current_block->step_event_count.wide; 28b12: c0 88 ldd r12, Z+16 ; 0x10 28b14: d1 88 ldd r13, Z+17 ; 0x11 28b16: e2 88 ldd r14, Z+18 ; 0x12 28b18: f3 88 ldd r15, Z+19 ; 0x13 28b1a: c0 92 7c 05 sts 0x057C, r12 ; 0x80057c 28b1e: d0 92 7d 05 sts 0x057D, r13 ; 0x80057d 28b22: e0 92 7e 05 sts 0x057E, r14 ; 0x80057e 28b26: f0 92 7f 05 sts 0x057F, r15 ; 0x80057f } #endif } if ((out_bits & (1< { #if defined(Z_MIN_PIN) && (Z_MIN_PIN > -1) && !defined(DEBUG_DISABLE_ZMINLIMIT) if (! check_z_endstop) { 28b2e: 51 11 cpse r21, r1 28b30: 77 c0 rjmp .+238 ; 0x28c20 <__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)) 28b32: 30 91 8c 06 lds r19, 0x068C ; 0x80068c 28b36: 31 30 cpi r19, 0x01 ; 1 28b38: 09 f0 breq .+2 ; 0x28b3c <__vector_17+0x480> 28b3a: 52 c0 rjmp .+164 ; 0x28be0 <__vector_17+0x524> 28b3c: 30 91 43 06 lds r19, 0x0643 ; 0x800643 28b40: 32 fd sbrc r19, 2 28b42: 4e c0 rjmp .+156 ; 0x28be0 <__vector_17+0x524> SET_BIT_TO(_endstop, Z_AXIS, (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING)); 28b44: 1c 9b sbis 0x03, 4 ; 3 28b46: 52 c0 rjmp .+164 ; 0x28bec <__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))); 28b48: 84 60 ori r24, 0x04 ; 4 28b4a: 51 c0 rjmp .+162 ; 0x28bee <__vector_17+0x532> // Set the direction bits (X_AXIS=A_AXIS and Y_AXIS=B_AXIS for COREXY) if((out_bits & (1< 28b50: 8e 7f andi r24, 0xFE ; 254 28b52: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[X_AXIS]=1; 28b56: 81 e0 ldi r24, 0x01 ; 1 28b58: 6f cf rjmp .-290 ; 0x28a38 <__vector_17+0x37c> } if((out_bits & (1< 28b5e: 82 60 ori r24, 0x02 ; 2 28b60: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Y_AXIS]=1; 28b64: 81 e0 ldi r24, 0x01 ; 1 28b66: 74 cf rjmp .-280 ; 0x28a50 <__vector_17+0x394> } if ((out_bits & (1< 28b6c: 8b 7f andi r24, 0xFB ; 251 28b6e: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Z_AXIS]=1; 28b72: 81 e0 ldi r24, 0x01 ; 1 28b74: 79 cf rjmp .-270 ; 0x28a68 <__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; 28b76: 81 e0 ldi r24, 0x01 ; 1 28b78: 7e cf rjmp .-260 ; 0x28a76 <__vector_17+0x3ba> } } else { _NEXT_ISR(2000); // 1kHz. 28b7a: 80 ed ldi r24, 0xD0 ; 208 28b7c: 97 e0 ldi r25, 0x07 ; 7 28b7e: 90 93 e6 04 sts 0x04E6, r25 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.476+0x1> 28b82: 80 93 e5 04 sts 0x04E5, r24 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.476> 28b86: 90 93 e2 04 sts 0x04E2, r25 ; 0x8004e2 <_ZL9main_Rate.lto_priv.478+0x1> 28b8a: 80 93 e1 04 sts 0x04E1, r24 ; 0x8004e1 <_ZL9main_Rate.lto_priv.478> #ifdef LIN_ADVANCE // reset LA state when there's no block nextAdvanceISR = ADV_NEVER; 28b8e: 8f ef ldi r24, 0xFF ; 255 28b90: 9f ef ldi r25, 0xFF ; 255 28b92: 90 93 e4 04 sts 0x04E4, r25 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.477+0x1> 28b96: 80 93 e3 04 sts 0x04E3, r24 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.477> e_steps = 0; 28b9a: 10 92 92 05 sts 0x0592, r1 ; 0x800592 // incrementally lose pressure to give a chance for // a new LA block to be scheduled and recover if(current_adv_steps) 28b9e: 80 91 df 04 lds r24, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.479> 28ba2: 90 91 e0 04 lds r25, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.479+0x1> 28ba6: 00 97 sbiw r24, 0x00 ; 0 28ba8: 09 f4 brne .+2 ; 0x28bac <__vector_17+0x4f0> 28baa: 67 cf rjmp .-306 ; 0x28a7a <__vector_17+0x3be> --current_adv_steps; 28bac: 01 97 sbiw r24, 0x01 ; 1 28bae: 90 93 e0 04 sts 0x04E0, r25 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.479+0x1> 28bb2: 80 93 df 04 sts 0x04DF, r24 ; 0x8004df <_ZL17current_adv_steps.lto_priv.479> 28bb6: 61 cf rjmp .-318 ; 0x28a7a <__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))); 28bb8: 8e 7f andi r24, 0xFE ; 254 28bba: 7c cf rjmp .-264 ; 0x28ab4 <__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))); 28bbc: 42 fd sbrc r20, 2 28bbe: 04 c0 rjmp .+8 ; 0x28bc8 <__vector_17+0x50c> 28bc0: 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)){ 28bc2: 49 2f mov r20, r25 28bc4: 40 71 andi r20, 0x10 ; 16 28bc6: 78 cf rjmp .-272 ; 0x28ab8 <__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))); 28bc8: 8f 7e andi r24, 0xEF ; 239 28bca: fb cf rjmp .-10 ; 0x28bc2 <__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))); 28bcc: 8d 7f andi r24, 0xFD ; 253 28bce: 93 cf rjmp .-218 ; 0x28af6 <__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))); 28bd0: 47 fd sbrc r20, 7 28bd2: 04 c0 rjmp .+8 ; 0x28bdc <__vector_17+0x520> 28bd4: 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)){ 28bd6: 49 2f mov r20, r25 28bd8: 40 72 andi r20, 0x20 ; 32 28bda: 8f cf rjmp .-226 ; 0x28afa <__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))); 28bdc: 8f 7d andi r24, 0xDF ; 223 28bde: fb cf rjmp .-10 ; 0x28bd6 <__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))); 28be0: 1c 99 sbic 0x03, 4 ; 3 28be2: b2 cf rjmp .-156 ; 0x28b48 <__vector_17+0x48c> 28be4: 30 91 06 01 lds r19, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 28be8: 36 ff sbrs r19, 6 28bea: ae cf rjmp .-164 ; 0x28b48 <__vector_17+0x48c> 28bec: 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)) { 28bee: 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)) { 28bf0: 98 23 and r25, r24 28bf2: b1 f0 breq .+44 ; 0x28c20 <__vector_17+0x564> 28bf4: c0 84 ldd r12, Z+8 ; 0x08 28bf6: d1 84 ldd r13, Z+9 ; 0x09 28bf8: e2 84 ldd r14, Z+10 ; 0x0a 28bfa: f3 84 ldd r15, Z+11 ; 0x0b 28bfc: 1c 14 cp r1, r12 28bfe: 1d 04 cpc r1, r13 28c00: 1e 04 cpc r1, r14 28c02: 1f 04 cpc r1, r15 28c04: 6c f4 brge .+26 ; 0x28c20 <__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); 28c06: 24 60 ori r18, 0x04 ; 4 step_events_completed.wide = current_block->step_event_count.wide; 28c08: c0 88 ldd r12, Z+16 ; 0x10 28c0a: d1 88 ldd r13, Z+17 ; 0x11 28c0c: e2 88 ldd r14, Z+18 ; 0x12 28c0e: f3 88 ldd r15, Z+19 ; 0x13 28c10: c0 92 7c 05 sts 0x057C, r12 ; 0x80057c 28c14: d0 92 7d 05 sts 0x057D, r13 ; 0x80057d 28c18: e0 92 7e 05 sts 0x057E, r14 ; 0x80057e 28c1c: f0 92 7f 05 sts 0x057F, r15 ; 0x80057f } #endif } endstop = _endstop; 28c20: 80 93 7a 05 sts 0x057A, r24 ; 0x80057a old_endstop = _endstop; //apply current endstop state to the old endstop 28c24: 80 93 79 05 sts 0x0579, r24 ; 0x800579 endstop_hit = _endstop_hit; 28c28: 20 93 0b 05 sts 0x050B, r18 ; 0x80050b <_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) { 28c2c: 55 23 and r21, r21 28c2e: 09 f4 brne .+2 ; 0x28c32 <__vector_17+0x576> 28c30: 40 c0 rjmp .+128 ; 0x28cb2 <__vector_17+0x5f6> uint8_t _endstop_hit = endstop_hit; 28c32: 20 91 0b 05 lds r18, 0x050B ; 0x80050b <_ZL11endstop_hit.lto_priv.480> uint8_t _endstop = endstop; 28c36: 80 91 7a 05 lds r24, 0x057A ; 0x80057a uint8_t _old_endstop = old_endstop; 28c3a: 90 91 79 05 lds r25, 0x0579 ; 0x800579 // 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)) 28c3e: 30 91 8c 06 lds r19, 0x068C ; 0x80068c 28c42: 31 30 cpi r19, 0x01 ; 1 28c44: c9 f4 brne .+50 ; 0x28c78 <__vector_17+0x5bc> 28c46: 30 91 43 06 lds r19, 0x0643 ; 0x800643 28c4a: 32 fd sbrc r19, 2 28c4c: 15 c0 rjmp .+42 ; 0x28c78 <__vector_17+0x5bc> SET_BIT_TO(_endstop, Z_AXIS, (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING)); 28c4e: 1c 9b sbis 0x03, 4 ; 3 28c50: 19 c0 rjmp .+50 ; 0x28c84 <__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))); 28c52: 84 60 ori r24, 0x04 ; 4 28c54: 18 c0 rjmp .+48 ; 0x28c86 <__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)) 28c56: 30 91 8c 06 lds r19, 0x068C ; 0x80068c 28c5a: 31 30 cpi r19, 0x01 ; 1 28c5c: 31 f4 brne .+12 ; 0x28c6a <__vector_17+0x5ae> 28c5e: 30 91 43 06 lds r19, 0x0643 ; 0x800643 28c62: 32 fd sbrc r19, 2 28c64: 02 c0 rjmp .+4 ; 0x28c6a <__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))); 28c66: 8f 7b andi r24, 0xBF ; 191 28c68: 05 c0 rjmp .+10 ; 0x28c74 <__vector_17+0x5b8> 28c6a: 30 91 06 01 lds r19, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 28c6e: 36 fd sbrc r19, 6 28c70: fa cf rjmp .-12 ; 0x28c66 <__vector_17+0x5aa> 28c72: 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)) { 28c74: 90 74 andi r25, 0x40 ; 64 28c76: bc cf rjmp .-136 ; 0x28bf0 <__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))); 28c78: 1c 99 sbic 0x03, 4 ; 3 28c7a: eb cf rjmp .-42 ; 0x28c52 <__vector_17+0x596> 28c7c: 30 91 06 01 lds r19, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 28c80: 36 ff sbrs r19, 6 28c82: e7 cf rjmp .-50 ; 0x28c52 <__vector_17+0x596> 28c84: 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)) { 28c86: 94 70 andi r25, 0x04 ; 4 28c88: 98 23 and r25, r24 28c8a: 69 f0 breq .+26 ; 0x28ca6 <__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); 28c8c: 24 60 ori r18, 0x04 ; 4 step_events_completed.wide = current_block->step_event_count.wide; 28c8e: 40 89 ldd r20, Z+16 ; 0x10 28c90: 51 89 ldd r21, Z+17 ; 0x11 28c92: 62 89 ldd r22, Z+18 ; 0x12 28c94: 73 89 ldd r23, Z+19 ; 0x13 28c96: 40 93 7c 05 sts 0x057C, r20 ; 0x80057c 28c9a: 50 93 7d 05 sts 0x057D, r21 ; 0x80057d 28c9e: 60 93 7e 05 sts 0x057E, r22 ; 0x80057e 28ca2: 70 93 7f 05 sts 0x057F, r23 ; 0x80057f } endstop = _endstop; 28ca6: 80 93 7a 05 sts 0x057A, r24 ; 0x80057a old_endstop = _endstop; //apply current endstop state to the old endstop 28caa: 80 93 79 05 sts 0x0579, r24 ; 0x800579 endstop_hit = _endstop_hit; 28cae: 20 93 0b 05 sts 0x050B, r18 ; 0x80050b <_ZL11endstop_hit.lto_priv.480> stepper_next_block(); if (current_block != NULL) { stepper_check_endstops(); if (current_block->flag & BLOCK_FLAG_DDA_LOWRES) 28cb2: 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) 28cb4: 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); 28cb6: 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); 28cb8: 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); 28cba: 04 e0 ldi r16, 0x04 ; 4 stepper_next_block(); if (current_block != NULL) { stepper_check_endstops(); if (current_block->flag & BLOCK_FLAG_DDA_LOWRES) 28cbc: 83 ff sbrs r24, 3 28cbe: 08 c1 rjmp .+528 ; 0x28ed0 <__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) 28cc0: 80 91 99 05 lds r24, 0x0599 ; 0x800599 28cc4: c8 17 cp r28, r24 28cc6: 08 f0 brcs .+2 ; 0x28cca <__vector_17+0x60e> 28cc8: 72 c2 rjmp .+1252 ; 0x291ae <__vector_17+0xaf2> MSerial.checkRx(); // Check for serial chars. 28cca: 0f 94 15 14 call 0x2282a ; 0x2282a // Step in X axis counter[X_AXIS].lo += current_block->steps[X_AXIS].lo; 28cce: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 28cd2: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 28cd6: 80 81 ld r24, Z 28cd8: 91 81 ldd r25, Z+1 ; 0x01 28cda: 20 91 81 05 lds r18, 0x0581 ; 0x800581 28cde: 30 91 82 05 lds r19, 0x0582 ; 0x800582 28ce2: 82 0f add r24, r18 28ce4: 93 1f adc r25, r19 28ce6: 90 93 82 05 sts 0x0582, r25 ; 0x800582 28cea: 80 93 81 05 sts 0x0581, r24 ; 0x800581 if (counter[X_AXIS].lo > 0) { 28cee: 18 16 cp r1, r24 28cf0: 19 06 cpc r1, r25 28cf2: 64 f5 brge .+88 ; 0x28d4c <__vector_17+0x690> STEP_NC_HI(X_AXIS); 28cf4: 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; 28cf6: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 28cfa: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 28cfe: 80 91 81 05 lds r24, 0x0581 ; 0x800581 28d02: 90 91 82 05 lds r25, 0x0582 ; 0x800582 28d06: 20 89 ldd r18, Z+16 ; 0x10 28d08: 31 89 ldd r19, Z+17 ; 0x11 28d0a: 82 1b sub r24, r18 28d0c: 93 0b sbc r25, r19 28d0e: 90 93 82 05 sts 0x0582, r25 ; 0x800582 28d12: 80 93 81 05 sts 0x0581, r24 ; 0x800581 count_position[X_AXIS]+=count_direction[X_AXIS]; 28d16: 90 91 97 02 lds r25, 0x0297 ; 0x800297 28d1a: 40 91 b3 06 lds r20, 0x06B3 ; 0x8006b3 28d1e: 50 91 b4 06 lds r21, 0x06B4 ; 0x8006b4 28d22: 60 91 b5 06 lds r22, 0x06B5 ; 0x8006b5 28d26: 70 91 b6 06 lds r23, 0x06B6 ; 0x8006b6 28d2a: 89 2f mov r24, r25 28d2c: 99 0f add r25, r25 28d2e: 99 0b sbc r25, r25 28d30: aa 0b sbc r26, r26 28d32: bb 0b sbc r27, r27 28d34: 84 0f add r24, r20 28d36: 95 1f adc r25, r21 28d38: a6 1f adc r26, r22 28d3a: b7 1f adc r27, r23 28d3c: 80 93 b3 06 sts 0x06B3, r24 ; 0x8006b3 28d40: 90 93 b4 06 sts 0x06B4, r25 ; 0x8006b4 28d44: a0 93 b5 06 sts 0x06B5, r26 ; 0x8006b5 28d48: b0 93 b6 06 sts 0x06B6, r27 ; 0x8006b6 #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; 28d4c: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 28d50: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 28d54: 84 81 ldd r24, Z+4 ; 0x04 28d56: 95 81 ldd r25, Z+5 ; 0x05 28d58: 20 91 85 05 lds r18, 0x0585 ; 0x800585 28d5c: 30 91 86 05 lds r19, 0x0586 ; 0x800586 28d60: 82 0f add r24, r18 28d62: 93 1f adc r25, r19 28d64: 90 93 86 05 sts 0x0586, r25 ; 0x800586 28d68: 80 93 85 05 sts 0x0585, r24 ; 0x800585 if (counter[Y_AXIS].lo > 0) { 28d6c: 18 16 cp r1, r24 28d6e: 19 06 cpc r1, r25 28d70: 44 f5 brge .+80 ; 0x28dc2 <__vector_17+0x706> STEP_NC_HI(Y_AXIS); 28d72: 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; 28d74: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 28d78: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 28d7c: 20 89 ldd r18, Z+16 ; 0x10 28d7e: 31 89 ldd r19, Z+17 ; 0x11 28d80: 82 1b sub r24, r18 28d82: 93 0b sbc r25, r19 28d84: 90 93 86 05 sts 0x0586, r25 ; 0x800586 28d88: 80 93 85 05 sts 0x0585, r24 ; 0x800585 count_position[Y_AXIS]+=count_direction[Y_AXIS]; 28d8c: 90 91 98 02 lds r25, 0x0298 ; 0x800298 28d90: 40 91 b7 06 lds r20, 0x06B7 ; 0x8006b7 28d94: 50 91 b8 06 lds r21, 0x06B8 ; 0x8006b8 28d98: 60 91 b9 06 lds r22, 0x06B9 ; 0x8006b9 28d9c: 70 91 ba 06 lds r23, 0x06BA ; 0x8006ba 28da0: 89 2f mov r24, r25 28da2: 99 0f add r25, r25 28da4: 99 0b sbc r25, r25 28da6: aa 0b sbc r26, r26 28da8: bb 0b sbc r27, r27 28daa: 84 0f add r24, r20 28dac: 95 1f adc r25, r21 28dae: a6 1f adc r26, r22 28db0: b7 1f adc r27, r23 28db2: 80 93 b7 06 sts 0x06B7, r24 ; 0x8006b7 28db6: 90 93 b8 06 sts 0x06B8, r25 ; 0x8006b8 28dba: a0 93 b9 06 sts 0x06B9, r26 ; 0x8006b9 28dbe: b0 93 ba 06 sts 0x06BA, r27 ; 0x8006ba #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; 28dc2: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 28dc6: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 28dca: 80 85 ldd r24, Z+8 ; 0x08 28dcc: 91 85 ldd r25, Z+9 ; 0x09 28dce: 20 91 89 05 lds r18, 0x0589 ; 0x800589 28dd2: 30 91 8a 05 lds r19, 0x058A ; 0x80058a 28dd6: 82 0f add r24, r18 28dd8: 93 1f adc r25, r19 28dda: 90 93 8a 05 sts 0x058A, r25 ; 0x80058a 28dde: 80 93 89 05 sts 0x0589, r24 ; 0x800589 if (counter[Z_AXIS].lo > 0) { 28de2: 18 16 cp r1, r24 28de4: 19 06 cpc r1, r25 28de6: 44 f5 brge .+80 ; 0x28e38 <__vector_17+0x77c> STEP_NC_HI(Z_AXIS); 28de8: 06 b9 out 0x06, r16 ; 6 counter[Z_AXIS].lo -= current_block->step_event_count.lo; 28dea: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 28dee: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 28df2: 20 89 ldd r18, Z+16 ; 0x10 28df4: 31 89 ldd r19, Z+17 ; 0x11 28df6: 82 1b sub r24, r18 28df8: 93 0b sbc r25, r19 28dfa: 90 93 8a 05 sts 0x058A, r25 ; 0x80058a 28dfe: 80 93 89 05 sts 0x0589, r24 ; 0x800589 count_position[Z_AXIS]+=count_direction[Z_AXIS]; 28e02: 90 91 99 02 lds r25, 0x0299 ; 0x800299 28e06: 40 91 bb 06 lds r20, 0x06BB ; 0x8006bb 28e0a: 50 91 bc 06 lds r21, 0x06BC ; 0x8006bc 28e0e: 60 91 bd 06 lds r22, 0x06BD ; 0x8006bd 28e12: 70 91 be 06 lds r23, 0x06BE ; 0x8006be 28e16: 89 2f mov r24, r25 28e18: 99 0f add r25, r25 28e1a: 99 0b sbc r25, r25 28e1c: aa 0b sbc r26, r26 28e1e: bb 0b sbc r27, r27 28e20: 84 0f add r24, r20 28e22: 95 1f adc r25, r21 28e24: a6 1f adc r26, r22 28e26: b7 1f adc r27, r23 28e28: 80 93 bb 06 sts 0x06BB, r24 ; 0x8006bb 28e2c: 90 93 bc 06 sts 0x06BC, r25 ; 0x8006bc 28e30: a0 93 bd 06 sts 0x06BD, r26 ; 0x8006bd 28e34: b0 93 be 06 sts 0x06BE, r27 ; 0x8006be STEP_NC_LO(Z_AXIS); } // Step in E axis counter[E_AXIS].lo += current_block->steps[E_AXIS].lo; 28e38: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 28e3c: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 28e40: 80 91 8d 05 lds r24, 0x058D ; 0x80058d 28e44: 90 91 8e 05 lds r25, 0x058E ; 0x80058e 28e48: 24 85 ldd r18, Z+12 ; 0x0c 28e4a: 35 85 ldd r19, Z+13 ; 0x0d 28e4c: 82 0f add r24, r18 28e4e: 93 1f adc r25, r19 28e50: 90 93 8e 05 sts 0x058E, r25 ; 0x80058e 28e54: 80 93 8d 05 sts 0x058D, r24 ; 0x80058d 28e58: 20 89 ldd r18, Z+16 ; 0x10 28e5a: 31 89 ldd r19, Z+17 ; 0x11 if (counter[E_AXIS].lo > 0) { 28e5c: 18 16 cp r1, r24 28e5e: 19 06 cpc r1, r25 28e60: 44 f5 brge .+80 ; 0x28eb2 <__vector_17+0x7f6> #ifndef LIN_ADVANCE STEP_NC_HI(E_AXIS); #endif /* LIN_ADVANCE */ counter[E_AXIS].lo -= current_block->step_event_count.lo; 28e62: 82 1b sub r24, r18 28e64: 93 0b sbc r25, r19 28e66: 90 93 8e 05 sts 0x058E, r25 ; 0x80058e 28e6a: 80 93 8d 05 sts 0x058D, r24 ; 0x80058d count_position[E_AXIS] += count_direction[E_AXIS]; 28e6e: 90 91 9a 02 lds r25, 0x029A ; 0x80029a 28e72: 40 91 bf 06 lds r20, 0x06BF ; 0x8006bf 28e76: 50 91 c0 06 lds r21, 0x06C0 ; 0x8006c0 28e7a: 60 91 c1 06 lds r22, 0x06C1 ; 0x8006c1 28e7e: 70 91 c2 06 lds r23, 0x06C2 ; 0x8006c2 28e82: 89 2f mov r24, r25 28e84: 99 0f add r25, r25 28e86: 99 0b sbc r25, r25 28e88: aa 0b sbc r26, r26 28e8a: bb 0b sbc r27, r27 28e8c: 84 0f add r24, r20 28e8e: 95 1f adc r25, r21 28e90: a6 1f adc r26, r22 28e92: b7 1f adc r27, r23 28e94: 80 93 bf 06 sts 0x06BF, r24 ; 0x8006bf 28e98: 90 93 c0 06 sts 0x06C0, r25 ; 0x8006c0 28e9c: a0 93 c1 06 sts 0x06C1, r26 ; 0x8006c1 28ea0: b0 93 c2 06 sts 0x06C2, r27 ; 0x8006c2 #ifdef LIN_ADVANCE e_steps += count_direction[E_AXIS]; 28ea4: 90 91 9a 02 lds r25, 0x029A ; 0x80029a 28ea8: 80 91 92 05 lds r24, 0x0592 ; 0x800592 28eac: 89 0f add r24, r25 28eae: 80 93 92 05 sts 0x0592, r24 ; 0x800592 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) 28eb2: 80 91 7c 05 lds r24, 0x057C ; 0x80057c 28eb6: 90 91 7d 05 lds r25, 0x057D ; 0x80057d 28eba: 01 96 adiw r24, 0x01 ; 1 28ebc: 90 93 7d 05 sts 0x057D, r25 ; 0x80057d 28ec0: 80 93 7c 05 sts 0x057C, r24 ; 0x80057c 28ec4: 82 17 cp r24, r18 28ec6: 93 07 cpc r25, r19 28ec8: 08 f0 brcs .+2 ; 0x28ecc <__vector_17+0x810> 28eca: 71 c1 rjmp .+738 ; 0x291ae <__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) 28ecc: cf 5f subi r28, 0xFF ; 255 28ece: f8 ce rjmp .-528 ; 0x28cc0 <__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) 28ed0: 80 91 99 05 lds r24, 0x0599 ; 0x800599 28ed4: c8 17 cp r28, r24 28ed6: 08 f0 brcs .+2 ; 0x28eda <__vector_17+0x81e> 28ed8: 6a c1 rjmp .+724 ; 0x291ae <__vector_17+0xaf2> MSerial.checkRx(); // Check for serial chars. 28eda: 0f 94 15 14 call 0x2282a ; 0x2282a // Step in X axis counter[X_AXIS].wide += current_block->steps[X_AXIS].wide; 28ede: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 28ee2: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 28ee6: 80 81 ld r24, Z 28ee8: 91 81 ldd r25, Z+1 ; 0x01 28eea: a2 81 ldd r26, Z+2 ; 0x02 28eec: b3 81 ldd r27, Z+3 ; 0x03 28eee: 40 91 81 05 lds r20, 0x0581 ; 0x800581 28ef2: 50 91 82 05 lds r21, 0x0582 ; 0x800582 28ef6: 60 91 83 05 lds r22, 0x0583 ; 0x800583 28efa: 70 91 84 05 lds r23, 0x0584 ; 0x800584 28efe: 84 0f add r24, r20 28f00: 95 1f adc r25, r21 28f02: a6 1f adc r26, r22 28f04: b7 1f adc r27, r23 28f06: 80 93 81 05 sts 0x0581, r24 ; 0x800581 28f0a: 90 93 82 05 sts 0x0582, r25 ; 0x800582 28f0e: a0 93 83 05 sts 0x0583, r26 ; 0x800583 28f12: b0 93 84 05 sts 0x0584, r27 ; 0x800584 if (counter[X_AXIS].wide > 0) { 28f16: 18 16 cp r1, r24 28f18: 19 06 cpc r1, r25 28f1a: 1a 06 cpc r1, r26 28f1c: 1b 06 cpc r1, r27 28f1e: c4 f5 brge .+112 ; 0x28f90 <__vector_17+0x8d4> STEP_NC_HI(X_AXIS); 28f20: 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; 28f22: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 28f26: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 28f2a: 80 91 81 05 lds r24, 0x0581 ; 0x800581 28f2e: 90 91 82 05 lds r25, 0x0582 ; 0x800582 28f32: a0 91 83 05 lds r26, 0x0583 ; 0x800583 28f36: b0 91 84 05 lds r27, 0x0584 ; 0x800584 28f3a: 40 89 ldd r20, Z+16 ; 0x10 28f3c: 51 89 ldd r21, Z+17 ; 0x11 28f3e: 62 89 ldd r22, Z+18 ; 0x12 28f40: 73 89 ldd r23, Z+19 ; 0x13 28f42: 84 1b sub r24, r20 28f44: 95 0b sbc r25, r21 28f46: a6 0b sbc r26, r22 28f48: b7 0b sbc r27, r23 28f4a: 80 93 81 05 sts 0x0581, r24 ; 0x800581 28f4e: 90 93 82 05 sts 0x0582, r25 ; 0x800582 28f52: a0 93 83 05 sts 0x0583, r26 ; 0x800583 28f56: b0 93 84 05 sts 0x0584, r27 ; 0x800584 count_position[X_AXIS]+=count_direction[X_AXIS]; 28f5a: 90 91 97 02 lds r25, 0x0297 ; 0x800297 28f5e: 40 91 b3 06 lds r20, 0x06B3 ; 0x8006b3 28f62: 50 91 b4 06 lds r21, 0x06B4 ; 0x8006b4 28f66: 60 91 b5 06 lds r22, 0x06B5 ; 0x8006b5 28f6a: 70 91 b6 06 lds r23, 0x06B6 ; 0x8006b6 28f6e: 89 2f mov r24, r25 28f70: 99 0f add r25, r25 28f72: 99 0b sbc r25, r25 28f74: aa 0b sbc r26, r26 28f76: bb 0b sbc r27, r27 28f78: 84 0f add r24, r20 28f7a: 95 1f adc r25, r21 28f7c: a6 1f adc r26, r22 28f7e: b7 1f adc r27, r23 28f80: 80 93 b3 06 sts 0x06B3, r24 ; 0x8006b3 28f84: 90 93 b4 06 sts 0x06B4, r25 ; 0x8006b4 28f88: a0 93 b5 06 sts 0x06B5, r26 ; 0x8006b5 28f8c: b0 93 b6 06 sts 0x06B6, r27 ; 0x8006b6 #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; 28f90: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 28f94: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 28f98: 84 81 ldd r24, Z+4 ; 0x04 28f9a: 95 81 ldd r25, Z+5 ; 0x05 28f9c: a6 81 ldd r26, Z+6 ; 0x06 28f9e: b7 81 ldd r27, Z+7 ; 0x07 28fa0: 40 91 85 05 lds r20, 0x0585 ; 0x800585 28fa4: 50 91 86 05 lds r21, 0x0586 ; 0x800586 28fa8: 60 91 87 05 lds r22, 0x0587 ; 0x800587 28fac: 70 91 88 05 lds r23, 0x0588 ; 0x800588 28fb0: 84 0f add r24, r20 28fb2: 95 1f adc r25, r21 28fb4: a6 1f adc r26, r22 28fb6: b7 1f adc r27, r23 28fb8: 80 93 85 05 sts 0x0585, r24 ; 0x800585 28fbc: 90 93 86 05 sts 0x0586, r25 ; 0x800586 28fc0: a0 93 87 05 sts 0x0587, r26 ; 0x800587 28fc4: b0 93 88 05 sts 0x0588, r27 ; 0x800588 if (counter[Y_AXIS].wide > 0) { 28fc8: 18 16 cp r1, r24 28fca: 19 06 cpc r1, r25 28fcc: 1a 06 cpc r1, r26 28fce: 1b 06 cpc r1, r27 28fd0: 84 f5 brge .+96 ; 0x29032 <__vector_17+0x976> STEP_NC_HI(Y_AXIS); 28fd2: 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; 28fd4: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 28fd8: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 28fdc: 40 89 ldd r20, Z+16 ; 0x10 28fde: 51 89 ldd r21, Z+17 ; 0x11 28fe0: 62 89 ldd r22, Z+18 ; 0x12 28fe2: 73 89 ldd r23, Z+19 ; 0x13 28fe4: 84 1b sub r24, r20 28fe6: 95 0b sbc r25, r21 28fe8: a6 0b sbc r26, r22 28fea: b7 0b sbc r27, r23 28fec: 80 93 85 05 sts 0x0585, r24 ; 0x800585 28ff0: 90 93 86 05 sts 0x0586, r25 ; 0x800586 28ff4: a0 93 87 05 sts 0x0587, r26 ; 0x800587 28ff8: b0 93 88 05 sts 0x0588, r27 ; 0x800588 count_position[Y_AXIS]+=count_direction[Y_AXIS]; 28ffc: 90 91 98 02 lds r25, 0x0298 ; 0x800298 29000: 40 91 b7 06 lds r20, 0x06B7 ; 0x8006b7 29004: 50 91 b8 06 lds r21, 0x06B8 ; 0x8006b8 29008: 60 91 b9 06 lds r22, 0x06B9 ; 0x8006b9 2900c: 70 91 ba 06 lds r23, 0x06BA ; 0x8006ba 29010: 89 2f mov r24, r25 29012: 99 0f add r25, r25 29014: 99 0b sbc r25, r25 29016: aa 0b sbc r26, r26 29018: bb 0b sbc r27, r27 2901a: 84 0f add r24, r20 2901c: 95 1f adc r25, r21 2901e: a6 1f adc r26, r22 29020: b7 1f adc r27, r23 29022: 80 93 b7 06 sts 0x06B7, r24 ; 0x8006b7 29026: 90 93 b8 06 sts 0x06B8, r25 ; 0x8006b8 2902a: a0 93 b9 06 sts 0x06B9, r26 ; 0x8006b9 2902e: b0 93 ba 06 sts 0x06BA, r27 ; 0x8006ba #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; 29032: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 29036: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 2903a: 80 85 ldd r24, Z+8 ; 0x08 2903c: 91 85 ldd r25, Z+9 ; 0x09 2903e: a2 85 ldd r26, Z+10 ; 0x0a 29040: b3 85 ldd r27, Z+11 ; 0x0b 29042: 40 91 89 05 lds r20, 0x0589 ; 0x800589 29046: 50 91 8a 05 lds r21, 0x058A ; 0x80058a 2904a: 60 91 8b 05 lds r22, 0x058B ; 0x80058b 2904e: 70 91 8c 05 lds r23, 0x058C ; 0x80058c 29052: 84 0f add r24, r20 29054: 95 1f adc r25, r21 29056: a6 1f adc r26, r22 29058: b7 1f adc r27, r23 2905a: 80 93 89 05 sts 0x0589, r24 ; 0x800589 2905e: 90 93 8a 05 sts 0x058A, r25 ; 0x80058a 29062: a0 93 8b 05 sts 0x058B, r26 ; 0x80058b 29066: b0 93 8c 05 sts 0x058C, r27 ; 0x80058c if (counter[Z_AXIS].wide > 0) { 2906a: 18 16 cp r1, r24 2906c: 19 06 cpc r1, r25 2906e: 1a 06 cpc r1, r26 29070: 1b 06 cpc r1, r27 29072: 84 f5 brge .+96 ; 0x290d4 <__vector_17+0xa18> STEP_NC_HI(Z_AXIS); 29074: 06 b9 out 0x06, r16 ; 6 counter[Z_AXIS].wide -= current_block->step_event_count.wide; 29076: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 2907a: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 2907e: 40 89 ldd r20, Z+16 ; 0x10 29080: 51 89 ldd r21, Z+17 ; 0x11 29082: 62 89 ldd r22, Z+18 ; 0x12 29084: 73 89 ldd r23, Z+19 ; 0x13 29086: 84 1b sub r24, r20 29088: 95 0b sbc r25, r21 2908a: a6 0b sbc r26, r22 2908c: b7 0b sbc r27, r23 2908e: 80 93 89 05 sts 0x0589, r24 ; 0x800589 29092: 90 93 8a 05 sts 0x058A, r25 ; 0x80058a 29096: a0 93 8b 05 sts 0x058B, r26 ; 0x80058b 2909a: b0 93 8c 05 sts 0x058C, r27 ; 0x80058c count_position[Z_AXIS]+=count_direction[Z_AXIS]; 2909e: 90 91 99 02 lds r25, 0x0299 ; 0x800299 290a2: 40 91 bb 06 lds r20, 0x06BB ; 0x8006bb 290a6: 50 91 bc 06 lds r21, 0x06BC ; 0x8006bc 290aa: 60 91 bd 06 lds r22, 0x06BD ; 0x8006bd 290ae: 70 91 be 06 lds r23, 0x06BE ; 0x8006be 290b2: 89 2f mov r24, r25 290b4: 99 0f add r25, r25 290b6: 99 0b sbc r25, r25 290b8: aa 0b sbc r26, r26 290ba: bb 0b sbc r27, r27 290bc: 84 0f add r24, r20 290be: 95 1f adc r25, r21 290c0: a6 1f adc r26, r22 290c2: b7 1f adc r27, r23 290c4: 80 93 bb 06 sts 0x06BB, r24 ; 0x8006bb 290c8: 90 93 bc 06 sts 0x06BC, r25 ; 0x8006bc 290cc: a0 93 bd 06 sts 0x06BD, r26 ; 0x8006bd 290d0: b0 93 be 06 sts 0x06BE, r27 ; 0x8006be STEP_NC_LO(Z_AXIS); } // Step in E axis counter[E_AXIS].wide += current_block->steps[E_AXIS].wide; 290d4: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 290d8: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 290dc: 80 91 8d 05 lds r24, 0x058D ; 0x80058d 290e0: 90 91 8e 05 lds r25, 0x058E ; 0x80058e 290e4: a0 91 8f 05 lds r26, 0x058F ; 0x80058f 290e8: b0 91 90 05 lds r27, 0x0590 ; 0x800590 290ec: 44 85 ldd r20, Z+12 ; 0x0c 290ee: 55 85 ldd r21, Z+13 ; 0x0d 290f0: 66 85 ldd r22, Z+14 ; 0x0e 290f2: 77 85 ldd r23, Z+15 ; 0x0f 290f4: 84 0f add r24, r20 290f6: 95 1f adc r25, r21 290f8: a6 1f adc r26, r22 290fa: b7 1f adc r27, r23 290fc: 80 93 8d 05 sts 0x058D, r24 ; 0x80058d 29100: 90 93 8e 05 sts 0x058E, r25 ; 0x80058e 29104: a0 93 8f 05 sts 0x058F, r26 ; 0x80058f 29108: b0 93 90 05 sts 0x0590, r27 ; 0x800590 2910c: 40 89 ldd r20, Z+16 ; 0x10 2910e: 51 89 ldd r21, Z+17 ; 0x11 29110: 62 89 ldd r22, Z+18 ; 0x12 29112: 73 89 ldd r23, Z+19 ; 0x13 if (counter[E_AXIS].wide > 0) { 29114: 18 16 cp r1, r24 29116: 19 06 cpc r1, r25 29118: 1a 06 cpc r1, r26 2911a: 1b 06 cpc r1, r27 2911c: 74 f5 brge .+92 ; 0x2917a <__vector_17+0xabe> #ifndef LIN_ADVANCE STEP_NC_HI(E_AXIS); #endif /* LIN_ADVANCE */ counter[E_AXIS].wide -= current_block->step_event_count.wide; 2911e: 84 1b sub r24, r20 29120: 95 0b sbc r25, r21 29122: a6 0b sbc r26, r22 29124: b7 0b sbc r27, r23 29126: 80 93 8d 05 sts 0x058D, r24 ; 0x80058d 2912a: 90 93 8e 05 sts 0x058E, r25 ; 0x80058e 2912e: a0 93 8f 05 sts 0x058F, r26 ; 0x80058f 29132: b0 93 90 05 sts 0x0590, r27 ; 0x800590 count_position[E_AXIS] += count_direction[E_AXIS]; 29136: 90 91 9a 02 lds r25, 0x029A ; 0x80029a 2913a: c0 90 bf 06 lds r12, 0x06BF ; 0x8006bf 2913e: d0 90 c0 06 lds r13, 0x06C0 ; 0x8006c0 29142: e0 90 c1 06 lds r14, 0x06C1 ; 0x8006c1 29146: f0 90 c2 06 lds r15, 0x06C2 ; 0x8006c2 2914a: 89 2f mov r24, r25 2914c: 99 0f add r25, r25 2914e: 99 0b sbc r25, r25 29150: aa 0b sbc r26, r26 29152: bb 0b sbc r27, r27 29154: 8c 0d add r24, r12 29156: 9d 1d adc r25, r13 29158: ae 1d adc r26, r14 2915a: bf 1d adc r27, r15 2915c: 80 93 bf 06 sts 0x06BF, r24 ; 0x8006bf 29160: 90 93 c0 06 sts 0x06C0, r25 ; 0x8006c0 29164: a0 93 c1 06 sts 0x06C1, r26 ; 0x8006c1 29168: b0 93 c2 06 sts 0x06C2, r27 ; 0x8006c2 #ifdef LIN_ADVANCE e_steps += count_direction[E_AXIS]; 2916c: 90 91 9a 02 lds r25, 0x029A ; 0x80029a 29170: 80 91 92 05 lds r24, 0x0592 ; 0x800592 29174: 89 0f add r24, r25 29176: 80 93 92 05 sts 0x0592, r24 ; 0x800592 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) 2917a: 80 91 7c 05 lds r24, 0x057C ; 0x80057c 2917e: 90 91 7d 05 lds r25, 0x057D ; 0x80057d 29182: a0 91 7e 05 lds r26, 0x057E ; 0x80057e 29186: b0 91 7f 05 lds r27, 0x057F ; 0x80057f 2918a: 01 96 adiw r24, 0x01 ; 1 2918c: a1 1d adc r26, r1 2918e: b1 1d adc r27, r1 29190: 80 93 7c 05 sts 0x057C, r24 ; 0x80057c 29194: 90 93 7d 05 sts 0x057D, r25 ; 0x80057d 29198: a0 93 7e 05 sts 0x057E, r26 ; 0x80057e 2919c: b0 93 7f 05 sts 0x057F, r27 ; 0x80057f 291a0: 84 17 cp r24, r20 291a2: 95 07 cpc r25, r21 291a4: a6 07 cpc r26, r22 291a6: b7 07 cpc r27, r23 291a8: 10 f4 brcc .+4 ; 0x291ae <__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) 291aa: cf 5f subi r28, 0xFF ; 255 291ac: 91 ce rjmp .-734 ; 0x28ed0 <__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); 291ae: 80 91 92 05 lds r24, 0x0592 ; 0x800592 291b2: 88 23 and r24, r24 291b4: 39 f0 breq .+14 ; 0x291c4 <__vector_17+0xb08> 291b6: 87 fd sbrc r24, 7 291b8: ee c0 rjmp .+476 ; 0x29396 <__vector_17+0xcda> 291ba: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 291be: 80 64 ori r24, 0x40 ; 64 291c0: 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) { 291c4: 40 91 7c 05 lds r20, 0x057C ; 0x80057c 291c8: 50 91 7d 05 lds r21, 0x057D ; 0x80057d 291cc: 60 91 7e 05 lds r22, 0x057E ; 0x80057e 291d0: 70 91 7f 05 lds r23, 0x057F ; 0x80057f 291d4: c0 91 a1 05 lds r28, 0x05A1 ; 0x8005a1 291d8: d0 91 a2 05 lds r29, 0x05A2 ; 0x8005a2 291dc: 89 8d ldd r24, Y+25 ; 0x19 291de: 9a 8d ldd r25, Y+26 ; 0x1a 291e0: ab 8d ldd r26, Y+27 ; 0x1b 291e2: bc 8d ldd r27, Y+28 ; 0x1c 291e4: 84 17 cp r24, r20 291e6: 95 07 cpc r25, r21 291e8: a6 07 cpc r26, r22 291ea: b7 07 cpc r27, r23 291ec: 08 f4 brcc .+2 ; 0x291f0 <__vector_17+0xb34> 291ee: 34 c1 rjmp .+616 ; 0x29458 <__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); 291f0: 40 91 95 05 lds r20, 0x0595 ; 0x800595 291f4: 50 91 96 05 lds r21, 0x0596 ; 0x800596 291f8: 60 91 97 05 lds r22, 0x0597 ; 0x800597 291fc: 70 91 98 05 lds r23, 0x0598 ; 0x800598 "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. ); 29200: cc 88 ldd r12, Y+20 ; 0x14 29202: dd 88 ldd r13, Y+21 ; 0x15 29204: ee 88 ldd r14, Y+22 ; 0x16 29206: aa 27 eor r26, r26 29208: 4d 9d mul r20, r13 2920a: b1 2d mov r27, r1 2920c: 5e 9d mul r21, r14 2920e: c0 01 movw r24, r0 29210: 6e 9d mul r22, r14 29212: 90 0d add r25, r0 29214: 6d 9d mul r22, r13 29216: 80 0d add r24, r0 29218: 91 1d adc r25, r1 2921a: 4e 9d mul r20, r14 2921c: b0 0d add r27, r0 2921e: 81 1d adc r24, r1 29220: 9a 1f adc r25, r26 29222: 5d 9d mul r21, r13 29224: b0 0d add r27, r0 29226: 81 1d adc r24, r1 29228: 9a 1f adc r25, r26 2922a: 6c 9d mul r22, r12 2922c: b0 0d add r27, r0 2922e: 81 1d adc r24, r1 29230: 9a 1f adc r25, r26 29232: 5c 9d mul r21, r12 29234: b1 0d add r27, r1 29236: 8a 1f adc r24, r26 29238: 9a 1f adc r25, r26 2923a: bb 0f add r27, r27 2923c: 8a 1f adc r24, r26 2923e: 9a 1f adc r25, r26 29240: 11 24 eor r1, r1 acc_step_rate += uint16_t(current_block->initial_rate); 29242: 2a ad ldd r18, Y+58 ; 0x3a 29244: 3b ad ldd r19, Y+59 ; 0x3b 29246: 82 0f add r24, r18 29248: 93 1f adc r25, r19 2924a: 90 93 9b 05 sts 0x059B, r25 ; 0x80059b 2924e: 80 93 9a 05 sts 0x059A, r24 ; 0x80059a // upper limit if(acc_step_rate > uint16_t(current_block->nominal_rate)) 29252: 2e a9 ldd r18, Y+54 ; 0x36 29254: 3f a9 ldd r19, Y+55 ; 0x37 29256: 28 17 cp r18, r24 29258: 39 07 cpc r19, r25 2925a: 20 f4 brcc .+8 ; 0x29264 <__vector_17+0xba8> acc_step_rate = current_block->nominal_rate; 2925c: 30 93 9b 05 sts 0x059B, r19 ; 0x80059b 29260: 20 93 9a 05 sts 0x059A, r18 ; 0x80059a // step_rate to timer interval uint16_t timer = calc_timer(acc_step_rate, step_loops); 29264: 80 91 9a 05 lds r24, 0x059A ; 0x80059a 29268: 90 91 9b 05 lds r25, 0x059B ; 0x80059b #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; 2926c: 81 34 cpi r24, 0x41 ; 65 2926e: fc e9 ldi r31, 0x9C ; 156 29270: 9f 07 cpc r25, r31 29272: 08 f0 brcs .+2 ; 0x29276 <__vector_17+0xbba> 29274: 94 c0 rjmp .+296 ; 0x2939e <__vector_17+0xce2> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 29276: 81 32 cpi r24, 0x21 ; 33 29278: 2e e4 ldi r18, 0x4E ; 78 2927a: 92 07 cpc r25, r18 2927c: 08 f4 brcc .+2 ; 0x29280 <__vector_17+0xbc4> 2927e: 92 c0 rjmp .+292 ; 0x293a4 <__vector_17+0xce8> step_rate = (step_rate >> 2)&0x3fff; 29280: 96 95 lsr r25 29282: 87 95 ror r24 29284: 96 95 lsr r25 29286: 87 95 ror r24 step_loops = 4; 29288: 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; 2928a: 20 93 99 05 sts 0x0599, r18 ; 0x800599 else { step_loops = 1; } if(step_rate < (F_CPU/500000)) step_rate = (F_CPU/500000); step_rate -= (F_CPU/500000); // Correct for minimal speed 2928e: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 29290: 81 15 cp r24, r1 29292: f8 e0 ldi r31, 0x08 ; 8 29294: 9f 07 cpc r25, r31 29296: 08 f4 brcc .+2 ; 0x2929a <__vector_17+0xbde> 29298: 97 c0 rjmp .+302 ; 0x293c8 <__vector_17+0xd0c> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 2929a: e9 2f mov r30, r25 2929c: ff 27 eor r31, r31 2929e: ee 0f add r30, r30 292a0: ff 1f adc r31, r31 292a2: ee 0f add r30, r30 292a4: ff 1f adc r31, r31 292a6: 9f 01 movw r18, r30 292a8: 2a 5a subi r18, 0xAA ; 170 292aa: 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); 292ac: f9 01 movw r30, r18 292ae: 32 96 adiw r30, 0x02 ; 2 292b0: a5 91 lpm r26, Z+ 292b2: b4 91 lpm r27, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 292b4: f9 01 movw r30, r18 292b6: 25 91 lpm r18, Z+ 292b8: 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. ); 292ba: b8 9f mul r27, r24 292bc: f0 01 movw r30, r0 292be: a8 9f mul r26, r24 292c0: 00 0c add r0, r0 292c2: e1 1d adc r30, r1 292c4: 11 24 eor r1, r1 292c6: 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); 292c8: c9 01 movw r24, r18 292ca: 8e 1b sub r24, r30 292cc: 9f 0b sbc r25, r31 292ce: 84 36 cpi r24, 0x64 ; 100 292d0: 91 05 cpc r25, r1 292d2: 10 f4 brcc .+4 ; 0x292d8 <__vector_17+0xc1c> 292d4: 84 e6 ldi r24, 0x64 ; 100 292d6: 90 e0 ldi r25, 0x00 ; 0 _NEXT_ISR(timer); 292d8: 90 93 e6 04 sts 0x04E6, r25 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.476+0x1> 292dc: 80 93 e5 04 sts 0x04E5, r24 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.476> 292e0: 90 93 e2 04 sts 0x04E2, r25 ; 0x8004e2 <_ZL9main_Rate.lto_priv.478+0x1> 292e4: 80 93 e1 04 sts 0x04E1, r24 ; 0x8004e1 <_ZL9main_Rate.lto_priv.478> acceleration_time += timer; 292e8: 48 0f add r20, r24 292ea: 59 1f adc r21, r25 292ec: 61 1d adc r22, r1 292ee: 71 1d adc r23, r1 292f0: 40 93 95 05 sts 0x0595, r20 ; 0x800595 292f4: 50 93 96 05 sts 0x0596, r21 ; 0x800596 292f8: 60 93 97 05 sts 0x0597, r22 ; 0x800597 292fc: 70 93 98 05 sts 0x0598, r23 ; 0x800598 #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 29300: fe 01 movw r30, r28 29302: e4 5b subi r30, 0xB4 ; 180 29304: ff 4f sbci r31, 0xFF ; 255 29306: 80 81 ld r24, Z 29308: 81 11 cpse r24, r1 2930a: 7d c0 rjmp .+250 ; 0x29406 <__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; 2930c: 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) { 2930e: 80 ff sbrs r24, 0 29310: 16 c0 rjmp .+44 ; 0x2933e <__vector_17+0xc82> LA_phase = -1; 29312: 9f ef ldi r25, 0xFF ; 255 29314: 90 93 91 05 sts 0x0591, r25 ; 0x800591 if (current_adv_steps == target_adv_steps) { 29318: e0 91 df 04 lds r30, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.479> 2931c: f0 91 e0 04 lds r31, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.479+0x1> 29320: 20 91 93 05 lds r18, 0x0593 ; 0x800593 29324: 30 91 94 05 lds r19, 0x0594 ; 0x800594 29328: e2 17 cp r30, r18 2932a: f3 07 cpc r31, r19 2932c: 09 f0 breq .+2 ; 0x29330 <__vector_17+0xc74> 2932e: 24 c2 rjmp .+1096 ; 0x29778 <__vector_17+0x10bc> // nothing to be done in this phase, cancel any pending eisr la_state = 0; nextAdvanceISR = ADV_NEVER; 29330: 8f ef ldi r24, 0xFF ; 255 29332: 9f ef ldi r25, 0xFF ; 255 29334: 90 93 e4 04 sts 0x04E4, r25 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.477+0x1> 29338: 80 93 e3 04 sts 0x04E3, r24 ; 0x8004e3 <_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; 2933c: 80 e0 ldi r24, 0x00 ; 0 eISR_Err += current_block->advance_rate; LA_phase = 0; } } } if (la_state & ADV_INIT || nextAdvanceISR != ADV_NEVER) { 2933e: 80 fd sbrc r24, 0 29340: 07 c0 rjmp .+14 ; 0x29350 <__vector_17+0xc94> 29342: 80 91 e3 04 lds r24, 0x04E3 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.477> 29346: 90 91 e4 04 lds r25, 0x04E4 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.477+0x1> 2934a: 01 96 adiw r24, 0x01 ; 1 2934c: 09 f4 brne .+2 ; 0x29350 <__vector_17+0xc94> 2934e: b2 c2 rjmp .+1380 ; 0x298b4 <__vector_17+0x11f8> // update timers & phase for the next iteration advance_spread(main_Rate); 29350: e0 91 e1 04 lds r30, 0x04E1 ; 0x8004e1 <_ZL9main_Rate.lto_priv.478> 29354: f0 91 e2 04 lds r31, 0x04E2 ; 0x8004e2 <_ZL9main_Rate.lto_priv.478+0x1> else return ((uint32_t)0xAAAB * q) >> 17; } FORCE_INLINE void advance_spread(uint16_t timer) { eISR_Err += timer; 29358: 80 91 72 05 lds r24, 0x0572 ; 0x800572 2935c: 90 91 73 05 lds r25, 0x0573 ; 0x800573 29360: a0 91 74 05 lds r26, 0x0574 ; 0x800574 29364: b0 91 75 05 lds r27, 0x0575 ; 0x800575 29368: 8e 0f add r24, r30 2936a: 9f 1f adc r25, r31 2936c: a1 1d adc r26, r1 2936e: b1 1d adc r27, r1 uint8_t ticks = 0; while(eISR_Err >= current_block->advance_rate) 29370: c3 5b subi r28, 0xB3 ; 179 29372: df 4f sbci r29, 0xFF ; 255 29374: 08 81 ld r16, Y 29376: 19 81 ldd r17, Y+1 ; 0x01 29378: 30 e0 ldi r19, 0x00 ; 0 2937a: 20 e0 ldi r18, 0x00 ; 0 FORCE_INLINE void advance_spread(uint16_t timer) { eISR_Err += timer; uint8_t ticks = 0; 2937c: 60 e0 ldi r22, 0x00 ; 0 while(eISR_Err >= current_block->advance_rate) 2937e: 80 17 cp r24, r16 29380: 91 07 cpc r25, r17 29382: a2 07 cpc r26, r18 29384: b3 07 cpc r27, r19 29386: 08 f4 brcc .+2 ; 0x2938a <__vector_17+0xcce> 29388: 27 c2 rjmp .+1102 ; 0x297d8 <__vector_17+0x111c> { ++ticks; 2938a: 6f 5f subi r22, 0xFF ; 255 eISR_Err -= current_block->advance_rate; 2938c: 80 1b sub r24, r16 2938e: 91 0b sbc r25, r17 29390: a2 0b sbc r26, r18 29392: b3 0b sbc r27, r19 29394: f4 cf rjmp .-24 ; 0x2937e <__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); 29396: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2939a: 8f 7b andi r24, 0xBF ; 191 2939c: 11 cf rjmp .-478 ; 0x291c0 <__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; 2939e: 80 e4 ldi r24, 0x40 ; 64 293a0: 9c e9 ldi r25, 0x9C ; 156 293a2: 6e cf rjmp .-292 ; 0x29280 <__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 293a4: 81 31 cpi r24, 0x11 ; 17 293a6: e7 e2 ldi r30, 0x27 ; 39 293a8: 9e 07 cpc r25, r30 293aa: 20 f0 brcs .+8 ; 0x293b4 <__vector_17+0xcf8> step_rate = (step_rate >> 1)&0x7fff; 293ac: 96 95 lsr r25 293ae: 87 95 ror r24 step_loops = 2; 293b0: 22 e0 ldi r18, 0x02 ; 2 293b2: 6b cf rjmp .-298 ; 0x2928a <__vector_17+0xbce> } else { step_loops = 1; 293b4: 21 e0 ldi r18, 0x01 ; 1 293b6: 20 93 99 05 sts 0x0599, r18 ; 0x800599 293ba: 80 32 cpi r24, 0x20 ; 32 293bc: 91 05 cpc r25, r1 293be: 08 f0 brcs .+2 ; 0x293c2 <__vector_17+0xd06> 293c0: 66 cf rjmp .-308 ; 0x2928e <__vector_17+0xbd2> 293c2: 80 e2 ldi r24, 0x20 ; 32 293c4: 90 e0 ldi r25, 0x00 ; 0 293c6: 63 cf rjmp .-314 ; 0x2928e <__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; 293c8: 9c 01 movw r18, r24 293ca: 36 95 lsr r19 293cc: 27 95 ror r18 293ce: 2c 7f andi r18, 0xFC ; 252 293d0: 2a 5a subi r18, 0xAA ; 170 293d2: 3d 46 sbci r19, 0x6D ; 109 timer = (unsigned short)pgm_read_word_near(table_address); 293d4: f9 01 movw r30, r18 293d6: a5 91 lpm r26, Z+ 293d8: b4 91 lpm r27, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 293da: f9 01 movw r30, r18 293dc: 32 96 adiw r30, 0x02 ; 2 293de: 05 91 lpm r16, Z+ 293e0: 14 91 lpm r17, Z 293e2: 87 70 andi r24, 0x07 ; 7 293e4: 99 27 eor r25, r25 293e6: 80 9f mul r24, r16 293e8: 90 01 movw r18, r0 293ea: 81 9f mul r24, r17 293ec: 30 0d add r19, r0 293ee: 90 9f mul r25, r16 293f0: 30 0d add r19, r0 293f2: 11 24 eor r1, r1 293f4: f3 e0 ldi r31, 0x03 ; 3 293f6: 36 95 lsr r19 293f8: 27 95 ror r18 293fa: fa 95 dec r31 293fc: e1 f7 brne .-8 ; 0x293f6 <__vector_17+0xd3a> 293fe: cd 01 movw r24, r26 29400: 82 1b sub r24, r18 29402: 93 0b sbc r25, r19 29404: 64 cf rjmp .-312 ; 0x292ce <__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) { 29406: 40 91 7c 05 lds r20, 0x057C ; 0x80057c 2940a: 50 91 7d 05 lds r21, 0x057D ; 0x80057d 2940e: 60 91 7e 05 lds r22, 0x057E ; 0x80057e 29412: 70 91 7f 05 lds r23, 0x057F ; 0x80057f 29416: 80 91 99 05 lds r24, 0x0599 ; 0x800599 2941a: 90 e0 ldi r25, 0x00 ; 0 2941c: b0 e0 ldi r27, 0x00 ; 0 2941e: a0 e0 ldi r26, 0x00 ; 0 29420: 84 17 cp r24, r20 29422: 95 07 cpc r25, r21 29424: a6 07 cpc r26, r22 29426: b7 07 cpc r27, r23 29428: 08 f4 brcc .+2 ; 0x2942c <__vector_17+0xd70> 2942a: 70 cf rjmp .-288 ; 0x2930c <__vector_17+0xc50> la_state = ADV_INIT | ADV_ACC_VARY; if (e_extruding && current_adv_steps > target_adv_steps) 2942c: 80 91 80 05 lds r24, 0x0580 ; 0x800580 29430: 81 11 cpse r24, r1 29432: 02 c0 rjmp .+4 ; 0x29438 <__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; 29434: 83 e0 ldi r24, 0x03 ; 3 29436: 6b cf rjmp .-298 ; 0x2930e <__vector_17+0xc52> if (e_extruding && current_adv_steps > target_adv_steps) 29438: 80 91 df 04 lds r24, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.479> 2943c: 90 91 e0 04 lds r25, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.479+0x1> 29440: 20 91 93 05 lds r18, 0x0593 ; 0x800593 29444: 30 91 94 05 lds r19, 0x0594 ; 0x800594 29448: 28 17 cp r18, r24 2944a: 39 07 cpc r19, r25 2944c: 98 f7 brcc .-26 ; 0x29434 <__vector_17+0xd78> target_adv_steps = current_adv_steps; 2944e: 90 93 94 05 sts 0x0594, r25 ; 0x800594 29452: 80 93 93 05 sts 0x0593, r24 ; 0x800593 29456: ee cf rjmp .-36 ; 0x29434 <__vector_17+0xd78> } } #endif } else if (step_events_completed.wide > current_block->decelerate_after) { 29458: 80 91 7c 05 lds r24, 0x057C ; 0x80057c 2945c: 90 91 7d 05 lds r25, 0x057D ; 0x80057d 29460: a0 91 7e 05 lds r26, 0x057E ; 0x80057e 29464: b0 91 7f 05 lds r27, 0x057F ; 0x80057f 29468: 4d 8d ldd r20, Y+29 ; 0x1d 2946a: 5e 8d ldd r21, Y+30 ; 0x1e 2946c: 6f 8d ldd r22, Y+31 ; 0x1f 2946e: 78 a1 ldd r23, Y+32 ; 0x20 29470: 48 17 cp r20, r24 29472: 59 07 cpc r21, r25 29474: 6a 07 cpc r22, r26 29476: 7b 07 cpc r23, r27 29478: 08 f0 brcs .+2 ; 0x2947c <__vector_17+0xdc0> 2947a: e3 c0 rjmp .+454 ; 0x29642 <__vector_17+0xf86> uint16_t step_rate = MUL24x24R24(deceleration_time, current_block->acceleration_rate); 2947c: c0 90 9d 05 lds r12, 0x059D ; 0x80059d 29480: d0 90 9e 05 lds r13, 0x059E ; 0x80059e 29484: e0 90 9f 05 lds r14, 0x059F ; 0x80059f 29488: f0 90 a0 05 lds r15, 0x05A0 ; 0x8005a0 "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. ); 2948c: 6c 88 ldd r6, Y+20 ; 0x14 2948e: 7d 88 ldd r7, Y+21 ; 0x15 29490: 8e 88 ldd r8, Y+22 ; 0x16 29492: aa 27 eor r26, r26 29494: c7 9c mul r12, r7 29496: b1 2d mov r27, r1 29498: d8 9c mul r13, r8 2949a: f0 01 movw r30, r0 2949c: e8 9c mul r14, r8 2949e: f0 0d add r31, r0 294a0: e7 9c mul r14, r7 294a2: e0 0d add r30, r0 294a4: f1 1d adc r31, r1 294a6: c8 9c mul r12, r8 294a8: b0 0d add r27, r0 294aa: e1 1d adc r30, r1 294ac: fa 1f adc r31, r26 294ae: d7 9c mul r13, r7 294b0: b0 0d add r27, r0 294b2: e1 1d adc r30, r1 294b4: fa 1f adc r31, r26 294b6: e6 9c mul r14, r6 294b8: b0 0d add r27, r0 294ba: e1 1d adc r30, r1 294bc: fa 1f adc r31, r26 294be: d6 9c mul r13, r6 294c0: b1 0d add r27, r1 294c2: ea 1f adc r30, r26 294c4: fa 1f adc r31, r26 294c6: bb 0f add r27, r27 294c8: ea 1f adc r30, r26 294ca: fa 1f adc r31, r26 294cc: 11 24 eor r1, r1 if (step_rate > acc_step_rate) { // Check step_rate stays positive 294ce: 20 91 9a 05 lds r18, 0x059A ; 0x80059a 294d2: 30 91 9b 05 lds r19, 0x059B ; 0x80059b 294d6: 8e ad ldd r24, Y+62 ; 0x3e 294d8: 9f ad ldd r25, Y+63 ; 0x3f 294da: 2e 17 cp r18, r30 294dc: 3f 07 cpc r19, r31 294de: 30 f0 brcs .+12 ; 0x294ec <__vector_17+0xe30> step_rate = uint16_t(current_block->final_rate); } else { step_rate = acc_step_rate - step_rate; // Decelerate from acceleration end point. 294e0: 2e 1b sub r18, r30 294e2: 3f 0b sbc r19, r31 294e4: 82 17 cp r24, r18 294e6: 93 07 cpc r25, r19 294e8: 08 f4 brcc .+2 ; 0x294ec <__vector_17+0xe30> 294ea: 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; 294ec: 81 34 cpi r24, 0x41 ; 65 294ee: 2c e9 ldi r18, 0x9C ; 156 294f0: 92 07 cpc r25, r18 294f2: 08 f0 brcs .+2 ; 0x294f6 <__vector_17+0xe3a> 294f4: 75 c0 rjmp .+234 ; 0x295e0 <__vector_17+0xf24> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 294f6: 81 32 cpi r24, 0x21 ; 33 294f8: ee e4 ldi r30, 0x4E ; 78 294fa: 9e 07 cpc r25, r30 294fc: 08 f4 brcc .+2 ; 0x29500 <__vector_17+0xe44> 294fe: 73 c0 rjmp .+230 ; 0x295e6 <__vector_17+0xf2a> step_rate = (step_rate >> 2)&0x3fff; 29500: 96 95 lsr r25 29502: 87 95 ror r24 29504: 96 95 lsr r25 29506: 87 95 ror r24 step_loops = 4; 29508: 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; 2950a: 20 93 99 05 sts 0x0599, r18 ; 0x800599 else { step_loops = 1; } if(step_rate < (F_CPU/500000)) step_rate = (F_CPU/500000); step_rate -= (F_CPU/500000); // Correct for minimal speed 2950e: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 29510: 81 15 cp r24, r1 29512: 28 e0 ldi r18, 0x08 ; 8 29514: 92 07 cpc r25, r18 29516: 08 f4 brcc .+2 ; 0x2951a <__vector_17+0xe5e> 29518: 78 c0 rjmp .+240 ; 0x2960a <__vector_17+0xf4e> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 2951a: e9 2f mov r30, r25 2951c: ff 27 eor r31, r31 2951e: ee 0f add r30, r30 29520: ff 1f adc r31, r31 29522: ee 0f add r30, r30 29524: ff 1f adc r31, r31 29526: 9f 01 movw r18, r30 29528: 2a 5a subi r18, 0xAA ; 170 2952a: 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); 2952c: f9 01 movw r30, r18 2952e: 32 96 adiw r30, 0x02 ; 2 29530: a5 91 lpm r26, Z+ 29532: b4 91 lpm r27, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 29534: f9 01 movw r30, r18 29536: 25 91 lpm r18, Z+ 29538: 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. ); 2953a: b8 9f mul r27, r24 2953c: f0 01 movw r30, r0 2953e: a8 9f mul r26, r24 29540: 00 0c add r0, r0 29542: e1 1d adc r30, r1 29544: 11 24 eor r1, r1 29546: 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); 29548: 2e 1b sub r18, r30 2954a: 3f 0b sbc r19, r31 2954c: c9 01 movw r24, r18 2954e: 24 36 cpi r18, 0x64 ; 100 29550: 31 05 cpc r19, r1 29552: 10 f4 brcc .+4 ; 0x29558 <__vector_17+0xe9c> 29554: 84 e6 ldi r24, 0x64 ; 100 29556: 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); 29558: 90 93 e6 04 sts 0x04E6, r25 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.476+0x1> 2955c: 80 93 e5 04 sts 0x04E5, r24 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.476> 29560: 90 93 e2 04 sts 0x04E2, r25 ; 0x8004e2 <_ZL9main_Rate.lto_priv.478+0x1> 29564: 80 93 e1 04 sts 0x04E1, r24 ; 0x8004e1 <_ZL9main_Rate.lto_priv.478> deceleration_time += timer; 29568: c8 0e add r12, r24 2956a: d9 1e adc r13, r25 2956c: e1 1c adc r14, r1 2956e: f1 1c adc r15, r1 29570: c0 92 9d 05 sts 0x059D, r12 ; 0x80059d 29574: d0 92 9e 05 sts 0x059E, r13 ; 0x80059e 29578: e0 92 9f 05 sts 0x059F, r14 ; 0x80059f 2957c: f0 92 a0 05 sts 0x05A0, r15 ; 0x8005a0 #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 29580: fe 01 movw r30, r28 29582: e4 5b subi r30, 0xB4 ; 180 29584: ff 4f sbci r31, 0xFF ; 255 29586: 80 81 ld r24, Z 29588: 88 23 and r24, r24 2958a: 09 f4 brne .+2 ; 0x2958e <__vector_17+0xed2> 2958c: bf ce rjmp .-642 ; 0x2930c <__vector_17+0xc50> if (step_events_completed.wide <= current_block->decelerate_after + step_loops) { 2958e: 80 91 7c 05 lds r24, 0x057C ; 0x80057c 29592: 90 91 7d 05 lds r25, 0x057D ; 0x80057d 29596: a0 91 7e 05 lds r26, 0x057E ; 0x80057e 2959a: b0 91 7f 05 lds r27, 0x057F ; 0x80057f 2959e: 20 91 99 05 lds r18, 0x0599 ; 0x800599 295a2: 42 0f add r20, r18 295a4: 51 1d adc r21, r1 295a6: 61 1d adc r22, r1 295a8: 71 1d adc r23, r1 295aa: 48 17 cp r20, r24 295ac: 59 07 cpc r21, r25 295ae: 6a 07 cpc r22, r26 295b0: 7b 07 cpc r23, r27 295b2: 08 f4 brcc .+2 ; 0x295b6 <__vector_17+0xefa> 295b4: ab ce rjmp .-682 ; 0x2930c <__vector_17+0xc50> target_adv_steps = current_block->final_adv_steps; 295b6: 35 96 adiw r30, 0x05 ; 5 295b8: 20 81 ld r18, Z 295ba: 31 81 ldd r19, Z+1 ; 0x01 295bc: 30 93 94 05 sts 0x0594, r19 ; 0x800594 295c0: 20 93 93 05 sts 0x0593, r18 ; 0x800593 la_state = ADV_INIT | ADV_ACC_VARY; if (e_extruding && current_adv_steps < target_adv_steps) 295c4: 80 91 80 05 lds r24, 0x0580 ; 0x800580 295c8: 88 23 and r24, r24 295ca: 09 f4 brne .+2 ; 0x295ce <__vector_17+0xf12> 295cc: 33 cf rjmp .-410 ; 0x29434 <__vector_17+0xd78> 295ce: 80 91 df 04 lds r24, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.479> 295d2: 90 91 e0 04 lds r25, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.479+0x1> 295d6: 82 17 cp r24, r18 295d8: 93 07 cpc r25, r19 295da: 08 f0 brcs .+2 ; 0x295de <__vector_17+0xf22> 295dc: 2b cf rjmp .-426 ; 0x29434 <__vector_17+0xd78> 295de: 37 cf rjmp .-402 ; 0x2944e <__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; 295e0: 80 e4 ldi r24, 0x40 ; 64 295e2: 9c e9 ldi r25, 0x9C ; 156 295e4: 8d cf rjmp .-230 ; 0x29500 <__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 295e6: 81 31 cpi r24, 0x11 ; 17 295e8: f7 e2 ldi r31, 0x27 ; 39 295ea: 9f 07 cpc r25, r31 295ec: 20 f0 brcs .+8 ; 0x295f6 <__vector_17+0xf3a> step_rate = (step_rate >> 1)&0x7fff; 295ee: 96 95 lsr r25 295f0: 87 95 ror r24 step_loops = 2; 295f2: 22 e0 ldi r18, 0x02 ; 2 295f4: 8a cf rjmp .-236 ; 0x2950a <__vector_17+0xe4e> } else { step_loops = 1; 295f6: 21 e0 ldi r18, 0x01 ; 1 295f8: 20 93 99 05 sts 0x0599, r18 ; 0x800599 295fc: 80 32 cpi r24, 0x20 ; 32 295fe: 91 05 cpc r25, r1 29600: 08 f0 brcs .+2 ; 0x29604 <__vector_17+0xf48> 29602: 85 cf rjmp .-246 ; 0x2950e <__vector_17+0xe52> 29604: 80 e2 ldi r24, 0x20 ; 32 29606: 90 e0 ldi r25, 0x00 ; 0 29608: 82 cf rjmp .-252 ; 0x2950e <__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; 2960a: dc 01 movw r26, r24 2960c: b6 95 lsr r27 2960e: a7 95 ror r26 29610: ac 7f andi r26, 0xFC ; 252 29612: aa 5a subi r26, 0xAA ; 170 29614: bd 46 sbci r27, 0x6D ; 109 timer = (unsigned short)pgm_read_word_near(table_address); 29616: fd 01 movw r30, r26 29618: 25 91 lpm r18, Z+ 2961a: 34 91 lpm r19, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 2961c: fd 01 movw r30, r26 2961e: 32 96 adiw r30, 0x02 ; 2 29620: a5 91 lpm r26, Z+ 29622: b4 91 lpm r27, Z 29624: 87 70 andi r24, 0x07 ; 7 29626: 99 27 eor r25, r25 29628: 8a 9f mul r24, r26 2962a: f0 01 movw r30, r0 2962c: 8b 9f mul r24, r27 2962e: f0 0d add r31, r0 29630: 9a 9f mul r25, r26 29632: f0 0d add r31, r0 29634: 11 24 eor r1, r1 29636: a3 e0 ldi r26, 0x03 ; 3 29638: f6 95 lsr r31 2963a: e7 95 ror r30 2963c: aa 95 dec r26 2963e: e1 f7 brne .-8 ; 0x29638 <__vector_17+0xf7c> 29640: 83 cf rjmp .-250 ; 0x29548 <__vector_17+0xe8c> } } #endif } else { if (! step_loops_nominal) { 29642: 80 91 9c 05 lds r24, 0x059C ; 0x80059c 29646: 88 23 and r24, r24 29648: 71 f0 breq .+28 ; 0x29666 <__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; 2964a: 80 e0 ldi r24, 0x00 ; 0 if (e_extruding) target_adv_steps = current_adv_steps; } #endif } _NEXT_ISR(OCR1A_nominal); 2964c: 20 91 76 05 lds r18, 0x0576 ; 0x800576 29650: 30 91 77 05 lds r19, 0x0577 ; 0x800577 29654: 30 93 e6 04 sts 0x04E6, r19 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.476+0x1> 29658: 20 93 e5 04 sts 0x04E5, r18 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.476> 2965c: 30 93 e2 04 sts 0x04E2, r19 ; 0x8004e2 <_ZL9main_Rate.lto_priv.478+0x1> 29660: 20 93 e1 04 sts 0x04E1, r18 ; 0x8004e1 <_ZL9main_Rate.lto_priv.478> 29664: 54 ce rjmp .-856 ; 0x2930e <__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); 29666: 8e a9 ldd r24, Y+54 ; 0x36 29668: 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; 2966a: 81 34 cpi r24, 0x41 ; 65 2966c: 4c e9 ldi r20, 0x9C ; 156 2966e: 94 07 cpc r25, r20 29670: 08 f0 brcs .+2 ; 0x29674 <__vector_17+0xfb8> 29672: 4e c0 rjmp .+156 ; 0x29710 <__vector_17+0x1054> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 29674: 81 32 cpi r24, 0x21 ; 33 29676: 5e e4 ldi r21, 0x4E ; 78 29678: 95 07 cpc r25, r21 2967a: 08 f4 brcc .+2 ; 0x2967e <__vector_17+0xfc2> 2967c: 4c c0 rjmp .+152 ; 0x29716 <__vector_17+0x105a> step_rate = (step_rate >> 2)&0x3fff; 2967e: 96 95 lsr r25 29680: 87 95 ror r24 29682: 96 95 lsr r25 29684: 87 95 ror r24 step_loops = 4; 29686: 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; 29688: 20 93 99 05 sts 0x0599, r18 ; 0x800599 else { step_loops = 1; } if(step_rate < (F_CPU/500000)) step_rate = (F_CPU/500000); step_rate -= (F_CPU/500000); // Correct for minimal speed 2968c: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 2968e: 81 15 cp r24, r1 29690: f8 e0 ldi r31, 0x08 ; 8 29692: 9f 07 cpc r25, r31 29694: 08 f4 brcc .+2 ; 0x29698 <__vector_17+0xfdc> 29696: 51 c0 rjmp .+162 ; 0x2973a <__vector_17+0x107e> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 29698: e9 2f mov r30, r25 2969a: ff 27 eor r31, r31 2969c: ee 0f add r30, r30 2969e: ff 1f adc r31, r31 296a0: ee 0f add r30, r30 296a2: ff 1f adc r31, r31 296a4: 9f 01 movw r18, r30 296a6: 2a 5a subi r18, 0xAA ; 170 296a8: 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); 296aa: f9 01 movw r30, r18 296ac: 32 96 adiw r30, 0x02 ; 2 296ae: 65 91 lpm r22, Z+ 296b0: 74 91 lpm r23, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 296b2: f9 01 movw r30, r18 296b4: 25 91 lpm r18, Z+ 296b6: 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. ); 296b8: 78 9f mul r23, r24 296ba: a0 01 movw r20, r0 296bc: 68 9f mul r22, r24 296be: 00 0c add r0, r0 296c0: 41 1d adc r20, r1 296c2: 11 24 eor r1, r1 296c4: 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); 296c6: c9 01 movw r24, r18 296c8: 84 1b sub r24, r20 296ca: 95 0b sbc r25, r21 296cc: 84 36 cpi r24, 0x64 ; 100 296ce: 91 05 cpc r25, r1 296d0: 10 f4 brcc .+4 ; 0x296d6 <__vector_17+0x101a> 296d2: 84 e6 ldi r24, 0x64 ; 100 296d4: 90 e0 ldi r25, 0x00 ; 0 296d6: 90 93 77 05 sts 0x0577, r25 ; 0x800577 296da: 80 93 76 05 sts 0x0576, r24 ; 0x800576 step_loops_nominal = step_loops; 296de: 80 91 99 05 lds r24, 0x0599 ; 0x800599 296e2: 80 93 9c 05 sts 0x059C, r24 ; 0x80059c #ifdef LIN_ADVANCE if(current_block->use_advance_lead) { 296e6: fe 01 movw r30, r28 296e8: e4 5b subi r30, 0xB4 ; 180 296ea: ff 4f sbci r31, 0xFF ; 255 296ec: 80 81 ld r24, Z 296ee: 88 23 and r24, r24 296f0: 09 f4 brne .+2 ; 0x296f4 <__vector_17+0x1038> 296f2: ab cf rjmp .-170 ; 0x2964a <__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) 296f4: 80 91 80 05 lds r24, 0x0580 ; 0x800580 296f8: 88 23 and r24, r24 296fa: 41 f0 breq .+16 ; 0x2970c <__vector_17+0x1050> target_adv_steps = current_adv_steps; 296fc: 80 91 df 04 lds r24, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.479> 29700: 90 91 e0 04 lds r25, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.479+0x1> 29704: 90 93 94 05 sts 0x0594, r25 ; 0x800594 29708: 80 93 93 05 sts 0x0593, r24 ; 0x800593 #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; 2970c: 81 e0 ldi r24, 0x01 ; 1 2970e: 9e cf rjmp .-196 ; 0x2964c <__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; 29710: 80 e4 ldi r24, 0x40 ; 64 29712: 9c e9 ldi r25, 0x9C ; 156 29714: b4 cf rjmp .-152 ; 0x2967e <__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 29716: 81 31 cpi r24, 0x11 ; 17 29718: e7 e2 ldi r30, 0x27 ; 39 2971a: 9e 07 cpc r25, r30 2971c: 20 f0 brcs .+8 ; 0x29726 <__vector_17+0x106a> step_rate = (step_rate >> 1)&0x7fff; 2971e: 96 95 lsr r25 29720: 87 95 ror r24 step_loops = 2; 29722: 22 e0 ldi r18, 0x02 ; 2 29724: b1 cf rjmp .-158 ; 0x29688 <__vector_17+0xfcc> } else { step_loops = 1; 29726: 21 e0 ldi r18, 0x01 ; 1 29728: 20 93 99 05 sts 0x0599, r18 ; 0x800599 2972c: 80 32 cpi r24, 0x20 ; 32 2972e: 91 05 cpc r25, r1 29730: 08 f0 brcs .+2 ; 0x29734 <__vector_17+0x1078> 29732: ac cf rjmp .-168 ; 0x2968c <__vector_17+0xfd0> 29734: 80 e2 ldi r24, 0x20 ; 32 29736: 90 e0 ldi r25, 0x00 ; 0 29738: a9 cf rjmp .-174 ; 0x2968c <__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; 2973a: 9c 01 movw r18, r24 2973c: 36 95 lsr r19 2973e: 27 95 ror r18 29740: 2c 7f andi r18, 0xFC ; 252 29742: 2a 5a subi r18, 0xAA ; 170 29744: 3d 46 sbci r19, 0x6D ; 109 timer = (unsigned short)pgm_read_word_near(table_address); 29746: f9 01 movw r30, r18 29748: 45 91 lpm r20, Z+ 2974a: 54 91 lpm r21, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 2974c: f9 01 movw r30, r18 2974e: 32 96 adiw r30, 0x02 ; 2 29750: 65 91 lpm r22, Z+ 29752: 74 91 lpm r23, Z 29754: 87 70 andi r24, 0x07 ; 7 29756: 99 27 eor r25, r25 29758: 86 9f mul r24, r22 2975a: 90 01 movw r18, r0 2975c: 87 9f mul r24, r23 2975e: 30 0d add r19, r0 29760: 96 9f mul r25, r22 29762: 30 0d add r19, r0 29764: 11 24 eor r1, r1 29766: a3 e0 ldi r26, 0x03 ; 3 29768: 36 95 lsr r19 2976a: 27 95 ror r18 2976c: aa 95 dec r26 2976e: e1 f7 brne .-8 ; 0x29768 <__vector_17+0x10ac> 29770: ca 01 movw r24, r20 29772: 82 1b sub r24, r18 29774: 93 0b sbc r25, r19 29776: aa cf rjmp .-172 ; 0x296cc <__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; 29778: de 01 movw r26, r28 2977a: a3 5b subi r26, 0xB3 ; 179 2977c: bf 4f sbci r27, 0xFF ; 255 2977e: 4d 91 ld r20, X+ 29780: 5c 91 ld r21, X 29782: 11 97 sbiw r26, 0x01 ; 1 29784: 70 e0 ldi r23, 0x00 ; 0 29786: 60 e0 ldi r22, 0x00 ; 0 29788: 40 93 72 05 sts 0x0572, r20 ; 0x800572 2978c: 50 93 73 05 sts 0x0573, r21 ; 0x800573 29790: 60 93 74 05 sts 0x0574, r22 ; 0x800574 29794: 70 93 75 05 sts 0x0575, r23 ; 0x800575 e_step_loops = current_block->advance_step_loops; 29798: 16 96 adiw r26, 0x06 ; 6 2979a: 9c 91 ld r25, X 2979c: 90 93 71 05 sts 0x0571, r25 ; 0x800571 if ((la_state & ADV_ACC_VARY) && e_extruding && (current_adv_steps > target_adv_steps)) { 297a0: 98 2f mov r25, r24 297a2: 92 70 andi r25, 0x02 ; 2 297a4: 09 f4 brne .+2 ; 0x297a8 <__vector_17+0x10ec> 297a6: cb cd rjmp .-1130 ; 0x2933e <__vector_17+0xc82> 297a8: 90 91 80 05 lds r25, 0x0580 ; 0x800580 297ac: 99 23 and r25, r25 297ae: 09 f4 brne .+2 ; 0x297b2 <__vector_17+0x10f6> 297b0: c6 cd rjmp .-1140 ; 0x2933e <__vector_17+0xc82> 297b2: 2e 17 cp r18, r30 297b4: 3f 07 cpc r19, r31 297b6: 08 f0 brcs .+2 ; 0x297ba <__vector_17+0x10fe> 297b8: c2 cd rjmp .-1148 ; 0x2933e <__vector_17+0xc82> // LA could reverse the direction of extrusion in this phase eISR_Err += current_block->advance_rate; 297ba: 44 0f add r20, r20 297bc: 55 1f adc r21, r21 297be: 66 1f adc r22, r22 297c0: 77 1f adc r23, r23 297c2: 40 93 72 05 sts 0x0572, r20 ; 0x800572 297c6: 50 93 73 05 sts 0x0573, r21 ; 0x800573 297ca: 60 93 74 05 sts 0x0574, r22 ; 0x800574 297ce: 70 93 75 05 sts 0x0575, r23 ; 0x800575 LA_phase = 0; 297d2: 10 92 91 05 sts 0x0591, r1 ; 0x800591 297d6: b3 cd rjmp .-1178 ; 0x2933e <__vector_17+0xc82> 297d8: 80 93 72 05 sts 0x0572, r24 ; 0x800572 297dc: 90 93 73 05 sts 0x0573, r25 ; 0x800573 297e0: a0 93 74 05 sts 0x0574, r26 ; 0x800574 297e4: b0 93 75 05 sts 0x0575, r27 ; 0x800575 while(eISR_Err >= current_block->advance_rate) { ++ticks; eISR_Err -= current_block->advance_rate; } if(!ticks) 297e8: 61 11 cpse r22, r1 297ea: 1b c0 rjmp .+54 ; 0x29822 <__vector_17+0x1166> { eISR_Rate = timer; 297ec: f0 93 70 05 sts 0x0570, r31 ; 0x800570 297f0: e0 93 6f 05 sts 0x056F, r30 ; 0x80056f nextAdvanceISR = timer; 297f4: f0 93 e4 04 sts 0x04E4, r31 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.477+0x1> 297f8: e0 93 e3 04 sts 0x04E3, r30 ; 0x8004e3 <_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) { 297fc: 80 91 91 05 lds r24, 0x0591 ; 0x800591 29800: 87 fd sbrc r24, 7 29802: 58 c0 rjmp .+176 ; 0x298b4 <__vector_17+0x11f8> if (step_loops == e_step_loops) 29804: 80 91 99 05 lds r24, 0x0599 ; 0x800599 29808: 10 91 71 05 lds r17, 0x0571 ; 0x800571 2980c: 28 81 ld r18, Y 2980e: 39 81 ldd r19, Y+1 ; 0x01 29810: 81 13 cpse r24, r17 29812: 35 c0 rjmp .+106 ; 0x2987e <__vector_17+0x11c2> LA_phase = (current_block->advance_rate < main_Rate); 29814: 81 e0 ldi r24, 0x01 ; 1 29816: 2e 17 cp r18, r30 29818: 3f 07 cpc r19, r31 2981a: 08 f4 brcc .+2 ; 0x2981e <__vector_17+0x1162> 2981c: 49 c0 rjmp .+146 ; 0x298b0 <__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); 2981e: 80 e0 ldi r24, 0x00 ; 0 29820: 47 c0 rjmp .+142 ; 0x298b0 <__vector_17+0x11f4> eISR_Rate = timer; nextAdvanceISR = timer; return; } if (ticks <= 3) 29822: 64 30 cpi r22, 0x04 ; 4 29824: 28 f5 brcc .+74 ; 0x29870 <__vector_17+0x11b4> eISR_Rate = fastdiv(timer, ticks + 1); 29826: 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); 29828: 63 30 cpi r22, 0x03 ; 3 2982a: a9 f0 breq .+42 ; 0x29856 <__vector_17+0x119a> 2982c: 66 95 lsr r22 2982e: af 01 movw r20, r30 29830: 02 c0 rjmp .+4 ; 0x29836 <__vector_17+0x117a> 29832: 56 95 lsr r21 29834: 47 95 ror r20 29836: 6a 95 dec r22 29838: e2 f7 brpl .-8 ; 0x29832 <__vector_17+0x1176> 2983a: 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); 2983c: 70 93 70 05 sts 0x0570, r23 ; 0x800570 29840: 60 93 6f 05 sts 0x056F, r22 ; 0x80056f } nextAdvanceISR = eISR_Rate; 29844: 80 91 6f 05 lds r24, 0x056F ; 0x80056f 29848: 90 91 70 05 lds r25, 0x0570 ; 0x800570 2984c: 90 93 e4 04 sts 0x04E4, r25 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.477+0x1> 29850: 80 93 e3 04 sts 0x04E3, r24 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.477> 29854: d3 cf rjmp .-90 ; 0x297fc <__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; 29856: 9f 01 movw r18, r30 29858: ab ea ldi r26, 0xAB ; 171 2985a: ba ea ldi r27, 0xAA ; 170 2985c: 0f 94 bc dc call 0x3b978 ; 0x3b978 <__umulhisi3> 29860: 41 e1 ldi r20, 0x11 ; 17 29862: 96 95 lsr r25 29864: 87 95 ror r24 29866: 77 95 ror r23 29868: 67 95 ror r22 2986a: 4a 95 dec r20 2986c: d1 f7 brne .-12 ; 0x29862 <__vector_17+0x11a6> 2986e: e6 cf rjmp .-52 ; 0x2983c <__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); 29870: 70 e0 ldi r23, 0x00 ; 0 29872: 6f 5f subi r22, 0xFF ; 255 29874: 7f 4f sbci r23, 0xFF ; 255 29876: cf 01 movw r24, r30 29878: 0f 94 e5 dc call 0x3b9ca ; 0x3b9ca <__udivmodhi4> 2987c: df cf rjmp .-66 ; 0x2983c <__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); 2987e: 83 30 cpi r24, 0x03 ; 3 29880: 09 f4 brne .+2 ; 0x29884 <__vector_17+0x11c8> 29882: cf c0 rjmp .+414 ; 0x29a22 <__vector_17+0x1366> 29884: 86 95 lsr r24 29886: a9 01 movw r20, r18 29888: 02 c0 rjmp .+4 ; 0x2988e <__vector_17+0x11d2> 2988a: 56 95 lsr r21 2988c: 47 95 ror r20 2988e: 8a 95 dec r24 29890: e2 f7 brpl .-8 ; 0x2988a <__vector_17+0x11ce> 29892: 13 30 cpi r17, 0x03 ; 3 29894: 09 f4 brne .+2 ; 0x29898 <__vector_17+0x11dc> 29896: d3 c0 rjmp .+422 ; 0x29a3e <__vector_17+0x1382> 29898: 16 95 lsr r17 2989a: bf 01 movw r22, r30 2989c: 02 c0 rjmp .+4 ; 0x298a2 <__vector_17+0x11e6> 2989e: 76 95 lsr r23 298a0: 67 95 ror r22 298a2: 1a 95 dec r17 298a4: e2 f7 brpl .-8 ; 0x2989e <__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); 298a6: 81 e0 ldi r24, 0x01 ; 1 298a8: 46 17 cp r20, r22 298aa: 57 07 cpc r21, r23 298ac: 08 f0 brcs .+2 ; 0x298b0 <__vector_17+0x11f4> 298ae: b7 cf rjmp .-146 ; 0x2981e <__vector_17+0x1162> 298b0: 80 93 91 05 sts 0x0591, r24 ; 0x800591 } } // 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(); 298b4: 0f 94 15 14 call 0x2282a ; 0x2282a #endif // If current block is finished, reset pointer if (step_events_completed.wide >= current_block->step_event_count.wide) { 298b8: 40 91 7c 05 lds r20, 0x057C ; 0x80057c 298bc: 50 91 7d 05 lds r21, 0x057D ; 0x80057d 298c0: 60 91 7e 05 lds r22, 0x057E ; 0x80057e 298c4: 70 91 7f 05 lds r23, 0x057F ; 0x80057f 298c8: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 298cc: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 298d0: 80 89 ldd r24, Z+16 ; 0x10 298d2: 91 89 ldd r25, Z+17 ; 0x11 298d4: a2 89 ldd r26, Z+18 ; 0x12 298d6: b3 89 ldd r27, Z+19 ; 0x13 298d8: 48 17 cp r20, r24 298da: 59 07 cpc r21, r25 298dc: 6a 07 cpc r22, r26 298de: 7b 07 cpc r23, r27 298e0: 80 f0 brcs .+32 ; 0x29902 <__vector_17+0x1246> current_block = NULL; 298e2: 10 92 a2 05 sts 0x05A2, r1 ; 0x8005a2 298e6: 10 92 a1 05 sts 0x05A1, r1 ; 0x8005a1 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) { 298ea: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 298ee: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 298f2: 98 17 cp r25, r24 298f4: 31 f0 breq .+12 ; 0x29902 <__vector_17+0x1246> block_buffer_tail = (block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 298f6: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 298fa: 8f 5f subi r24, 0xFF ; 255 298fc: 8f 70 andi r24, 0x0F ; 15 298fe: 80 93 a6 0d sts 0x0DA6, r24 ; 0x800da6 return mask; } void tmc2130_st_isr() { if (tmc2130_mode == TMC2130_MODE_SILENT || tmc2130_sg_stop_on_crash == false || tmc2130_sg_homing_axes_mask != 0) 29902: 80 91 8c 06 lds r24, 0x068C ; 0x80068c 29906: 81 30 cpi r24, 0x01 ; 1 29908: 49 f1 breq .+82 ; 0x2995c <__vector_17+0x12a0> 2990a: 80 91 5c 02 lds r24, 0x025C ; 0x80025c 2990e: 88 23 and r24, r24 29910: 29 f1 breq .+74 ; 0x2995c <__vector_17+0x12a0> 29912: 80 91 43 06 lds r24, 0x0643 ; 0x800643 29916: 81 11 cpse r24, r1 29918: 21 c0 rjmp .+66 ; 0x2995c <__vector_17+0x12a0> } uint8_t tmc2130_sample_diag() { uint8_t mask = 0; if (!READ(X_TMC2130_DIAG)) mask |= X_AXIS_MASK; 2991a: 90 91 06 01 lds r25, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 2991e: 81 e0 ldi r24, 0x01 ; 1 29920: 29 2f mov r18, r25 29922: 24 70 andi r18, 0x04 ; 4 29924: 92 fd sbrc r25, 2 29926: 80 e0 ldi r24, 0x00 ; 0 if (!READ(Y_TMC2130_DIAG)) mask |= Y_AXIS_MASK; 29928: 90 91 06 01 lds r25, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 2992c: 82 60 ori r24, 0x02 ; 2 2992e: 97 ff sbrs r25, 7 29930: 03 c0 rjmp .+6 ; 0x29938 <__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) { 29932: 21 11 cpse r18, r1 29934: 13 c0 rjmp .+38 ; 0x2995c <__vector_17+0x12a0> 29936: 81 e0 ldi r24, 0x01 ; 1 tmc2130_sg_crash = mask; 29938: 80 93 0d 05 sts 0x050D, r24 ; 0x80050d tmc2130_sg_stop_on_crash = false; 2993c: 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 29940: 60 91 47 02 lds r22, 0x0247 ; 0x800247 <_ZL14pause_position.lto_priv.481+0x8> 29944: 70 91 48 02 lds r23, 0x0248 ; 0x800248 <_ZL14pause_position.lto_priv.481+0x9> 29948: 80 91 49 02 lds r24, 0x0249 ; 0x800249 <_ZL14pause_position.lto_priv.481+0xa> 2994c: 90 91 4a 02 lds r25, 0x024A ; 0x80024a <_ZL14pause_position.lto_priv.481+0xb> 29950: 20 e0 ldi r18, 0x00 ; 0 29952: 30 e0 ldi r19, 0x00 ; 0 29954: 40 e8 ldi r20, 0x80 ; 128 29956: 5f eb ldi r21, 0xBF ; 191 29958: 0e 94 37 89 call 0x1126e ; 0x1126e WRITE_NC(LOGIC_ANALYZER_CH0, false); #endif } // Run the next advance isr if triggered bool eisr = !nextAdvanceISR; 2995c: 60 91 e3 04 lds r22, 0x04E3 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.477> 29960: 70 91 e4 04 lds r23, 0x04E4 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.477+0x1> if (eisr) 29964: 61 15 cp r22, r1 29966: 71 05 cpc r23, r1 29968: 09 f0 breq .+2 ; 0x2996c <__vector_17+0x12b0> 2996a: 46 c0 rjmp .+140 ; 0x299f8 <__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) { 2996c: 40 91 df 04 lds r20, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.479> 29970: 50 91 e0 04 lds r21, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.479+0x1> 29974: 20 91 93 05 lds r18, 0x0593 ; 0x800593 29978: 30 91 94 05 lds r19, 0x0594 ; 0x800594 2997c: 80 91 92 05 lds r24, 0x0592 ; 0x800592 29980: 24 17 cp r18, r20 29982: 35 07 cpc r19, r21 29984: 08 f0 brcs .+2 ; 0x29988 <__vector_17+0x12cc> 29986: 6c c0 rjmp .+216 ; 0x29a60 <__vector_17+0x13a4> // decompression if (e_step_loops != 1) { 29988: 90 91 71 05 lds r25, 0x0571 ; 0x800571 2998c: 91 30 cpi r25, 0x01 ; 1 2998e: 41 f0 breq .+16 ; 0x299a0 <__vector_17+0x12e4> uint16_t d_steps = current_adv_steps - target_adv_steps; 29990: 42 1b sub r20, r18 29992: 53 0b sbc r21, r19 if (d_steps < e_step_loops) 29994: 94 17 cp r25, r20 29996: 15 06 cpc r1, r21 29998: 19 f0 breq .+6 ; 0x299a0 <__vector_17+0x12e4> 2999a: 10 f0 brcs .+4 ; 0x299a0 <__vector_17+0x12e4> e_step_loops = d_steps; 2999c: 40 93 71 05 sts 0x0571, r20 ; 0x800571 } e_steps -= e_step_loops; 299a0: 90 91 71 05 lds r25, 0x0571 ; 0x800571 299a4: 89 1b sub r24, r25 299a6: 80 93 92 05 sts 0x0592, r24 ; 0x800592 if (e_steps) WRITE_NC(E0_DIR_PIN, e_steps < 0? INVERT_E0_DIR: !INVERT_E0_DIR); 299aa: 88 23 and r24, r24 299ac: 39 f0 breq .+14 ; 0x299bc <__vector_17+0x1300> 299ae: 87 fd sbrc r24, 7 299b0: 53 c0 rjmp .+166 ; 0x29a58 <__vector_17+0x139c> 299b2: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 299b6: 80 64 ori r24, 0x40 ; 64 299b8: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> current_adv_steps -= e_step_loops; 299bc: 20 91 71 05 lds r18, 0x0571 ; 0x800571 299c0: 80 91 df 04 lds r24, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.479> 299c4: 90 91 e0 04 lds r25, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.479+0x1> 299c8: 82 1b sub r24, r18 299ca: 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; 299cc: 90 93 e0 04 sts 0x04E0, r25 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.479+0x1> 299d0: 80 93 df 04 sts 0x04DF, r24 ; 0x8004df <_ZL17current_adv_steps.lto_priv.479> } if (current_adv_steps == target_adv_steps) { 299d4: 20 91 df 04 lds r18, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.479> 299d8: 30 91 e0 04 lds r19, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.479+0x1> 299dc: 80 91 93 05 lds r24, 0x0593 ; 0x800593 299e0: 90 91 94 05 lds r25, 0x0594 ; 0x800594 299e4: 28 17 cp r18, r24 299e6: 39 07 cpc r19, r25 299e8: 09 f0 breq .+2 ; 0x299ec <__vector_17+0x1330> 299ea: 66 c0 rjmp .+204 ; 0x29ab8 <__vector_17+0x13fc> // advance steps completed nextAdvanceISR = ADV_NEVER; 299ec: 8f ef ldi r24, 0xFF ; 255 299ee: 9f ef ldi r25, 0xFF ; 255 } else { // schedule another tick nextAdvanceISR = eISR_Rate; 299f0: 90 93 e4 04 sts 0x04E4, r25 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.477+0x1> 299f4: 80 93 e3 04 sts 0x04E3, r24 ; 0x8004e3 <_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)) { 299f8: 40 91 92 05 lds r20, 0x0592 ; 0x800592 299fc: 41 11 cpse r20, r1 299fe: 61 c0 rjmp .+194 ; 0x29ac2 <__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) 29a00: 80 91 e3 04 lds r24, 0x04E3 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.477> 29a04: 90 91 e4 04 lds r25, 0x04E4 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.477+0x1> 29a08: 20 91 e5 04 lds r18, 0x04E5 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.476> 29a0c: 30 91 e6 04 lds r19, 0x04E6 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.476+0x1> 29a10: 8f 3f cpi r24, 0xFF ; 255 29a12: 98 07 cpc r25, r24 29a14: 09 f0 breq .+2 ; 0x29a18 <__vector_17+0x135c> 29a16: 98 c0 rjmp .+304 ; 0x29b48 <__vector_17+0x148c> OCR1A = nextAdvanceISR; else OCR1A = nextMainISR; 29a18: 30 93 89 00 sts 0x0089, r19 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 29a1c: 20 93 88 00 sts 0x0088, r18 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 29a20: 9e c0 rjmp .+316 ; 0x29b5e <__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; 29a22: ab ea ldi r26, 0xAB ; 171 29a24: ba ea ldi r27, 0xAA ; 170 29a26: 0f 94 bc dc call 0x3b978 ; 0x3b978 <__umulhisi3> 29a2a: ab 01 movw r20, r22 29a2c: bc 01 movw r22, r24 29a2e: 31 e1 ldi r19, 0x11 ; 17 29a30: 76 95 lsr r23 29a32: 67 95 ror r22 29a34: 57 95 ror r21 29a36: 47 95 ror r20 29a38: 3a 95 dec r19 29a3a: d1 f7 brne .-12 ; 0x29a30 <__vector_17+0x1374> 29a3c: 2a cf rjmp .-428 ; 0x29892 <__vector_17+0x11d6> 29a3e: 9f 01 movw r18, r30 29a40: ab ea ldi r26, 0xAB ; 171 29a42: ba ea ldi r27, 0xAA ; 170 29a44: 0f 94 bc dc call 0x3b978 ; 0x3b978 <__umulhisi3> 29a48: 21 e1 ldi r18, 0x11 ; 17 29a4a: 96 95 lsr r25 29a4c: 87 95 ror r24 29a4e: 77 95 ror r23 29a50: 67 95 ror r22 29a52: 2a 95 dec r18 29a54: d1 f7 brne .-12 ; 0x29a4a <__vector_17+0x138e> 29a56: 27 cf rjmp .-434 ; 0x298a6 <__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); 29a58: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 29a5c: 8f 7b andi r24, 0xBF ; 191 29a5e: ac cf rjmp .-168 ; 0x299b8 <__vector_17+0x12fc> current_adv_steps -= e_step_loops; } else if (current_adv_steps < target_adv_steps) { 29a60: 42 17 cp r20, r18 29a62: 53 07 cpc r21, r19 29a64: 08 f0 brcs .+2 ; 0x29a68 <__vector_17+0x13ac> 29a66: b6 cf rjmp .-148 ; 0x299d4 <__vector_17+0x1318> // compression if (e_step_loops != 1) { 29a68: 90 91 71 05 lds r25, 0x0571 ; 0x800571 29a6c: 91 30 cpi r25, 0x01 ; 1 29a6e: 41 f0 breq .+16 ; 0x29a80 <__vector_17+0x13c4> uint16_t d_steps = target_adv_steps - current_adv_steps; 29a70: 24 1b sub r18, r20 29a72: 35 0b sbc r19, r21 if (d_steps < e_step_loops) 29a74: 92 17 cp r25, r18 29a76: 13 06 cpc r1, r19 29a78: 19 f0 breq .+6 ; 0x29a80 <__vector_17+0x13c4> 29a7a: 10 f0 brcs .+4 ; 0x29a80 <__vector_17+0x13c4> e_step_loops = d_steps; 29a7c: 20 93 71 05 sts 0x0571, r18 ; 0x800571 } e_steps += e_step_loops; 29a80: 90 91 71 05 lds r25, 0x0571 ; 0x800571 29a84: 89 0f add r24, r25 29a86: 80 93 92 05 sts 0x0592, r24 ; 0x800592 if (e_steps) WRITE_NC(E0_DIR_PIN, e_steps < 0? INVERT_E0_DIR: !INVERT_E0_DIR); 29a8a: 88 23 and r24, r24 29a8c: 39 f0 breq .+14 ; 0x29a9c <__vector_17+0x13e0> 29a8e: 87 fd sbrc r24, 7 29a90: 0f c0 rjmp .+30 ; 0x29ab0 <__vector_17+0x13f4> 29a92: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 29a96: 80 64 ori r24, 0x40 ; 64 29a98: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> current_adv_steps += e_step_loops; 29a9c: 80 91 71 05 lds r24, 0x0571 ; 0x800571 29aa0: 20 91 df 04 lds r18, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.479> 29aa4: 30 91 e0 04 lds r19, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.479+0x1> 29aa8: 82 0f add r24, r18 29aaa: 93 2f mov r25, r19 29aac: 91 1d adc r25, r1 29aae: 8e cf rjmp .-228 ; 0x299cc <__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); 29ab0: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 29ab4: 8f 7b andi r24, 0xBF ; 191 29ab6: f0 cf rjmp .-32 ; 0x29a98 <__vector_17+0x13dc> // advance steps completed nextAdvanceISR = ADV_NEVER; } else { // schedule another tick nextAdvanceISR = eISR_Rate; 29ab8: 80 91 6f 05 lds r24, 0x056F ; 0x80056f 29abc: 90 91 70 05 lds r25, 0x0570 ; 0x800570 29ac0: 97 cf rjmp .-210 ; 0x299f0 <__vector_17+0x1334> WRITE_NC(LOGIC_ANALYZER_CH1, false); #endif } // Tick E steps if any if (e_steps && (LA_phase < 0 || LA_phase == eisr)) { 29ac2: 80 91 91 05 lds r24, 0x0591 ; 0x800591 29ac6: 87 fd sbrc r24, 7 29ac8: 0e c0 rjmp .+28 ; 0x29ae6 <__vector_17+0x142a> 29aca: 08 2e mov r0, r24 29acc: 00 0c add r0, r0 29ace: 99 0b sbc r25, r25 WRITE_NC(LOGIC_ANALYZER_CH0, false); #endif } // Run the next advance isr if triggered bool eisr = !nextAdvanceISR; 29ad0: 21 e0 ldi r18, 0x01 ; 1 29ad2: 30 e0 ldi r19, 0x00 ; 0 29ad4: 61 15 cp r22, r1 29ad6: 71 05 cpc r23, r1 29ad8: 11 f0 breq .+4 ; 0x29ade <__vector_17+0x1422> 29ada: 30 e0 ldi r19, 0x00 ; 0 29adc: 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)) { 29ade: 82 17 cp r24, r18 29ae0: 93 07 cpc r25, r19 29ae2: 09 f0 breq .+2 ; 0x29ae6 <__vector_17+0x142a> 29ae4: 8d cf rjmp .-230 ; 0x29a00 <__vector_17+0x1344> uint8_t max_ticks = (eisr? e_step_loops: step_loops); 29ae6: 20 91 71 05 lds r18, 0x0571 ; 0x800571 29aea: 67 2b or r22, r23 29aec: 11 f0 breq .+4 ; 0x29af2 <__vector_17+0x1436> 29aee: 20 91 99 05 lds r18, 0x0599 ; 0x800599 max_ticks = min(abs(e_steps), max_ticks); 29af2: 84 2f mov r24, r20 29af4: 04 2e mov r0, r20 29af6: 00 0c add r0, r0 29af8: 99 0b sbc r25, r25 29afa: 97 ff sbrs r25, 7 29afc: 03 c0 rjmp .+6 ; 0x29b04 <__vector_17+0x1448> 29afe: 91 95 neg r25 29b00: 81 95 neg r24 29b02: 91 09 sbc r25, r1 29b04: 30 e0 ldi r19, 0x00 ; 0 29b06: 28 17 cp r18, r24 29b08: 39 07 cpc r19, r25 29b0a: 0c f4 brge .+2 ; 0x29b0e <__vector_17+0x1452> 29b0c: c9 01 movw r24, r18 29b0e: 47 ff sbrs r20, 7 29b10: 17 c0 rjmp .+46 ; 0x29b40 <__vector_17+0x1484> 29b12: 61 e0 ldi r22, 0x01 ; 1 29b14: 4f ef ldi r20, 0xFF ; 255 29b16: 5f ef ldi r21, 0xFF ; 255 bool rev = (e_steps < 0); do { STEP_NC_HI(E_AXIS); 29b18: 78 e0 ldi r23, 0x08 ; 8 29b1a: 76 b9 out 0x06, r23 ; 6 e_steps += (rev? 1: -1); 29b1c: 90 91 92 05 lds r25, 0x0592 ; 0x800592 29b20: 96 0f add r25, r22 29b22: 90 93 92 05 sts 0x0592, r25 ; 0x800592 void setJamDetectionEnabled(bool state, bool updateEEPROM = false); bool getJamDetectionEnabled() const { return jamDetection; } void stStep(bool rev) { //from stepper isr stepCount += rev ? -1 : 1; 29b26: 20 91 bb 17 lds r18, 0x17BB ; 0x8017bb 29b2a: 30 91 bc 17 lds r19, 0x17BC ; 0x8017bc 29b2e: 24 0f add r18, r20 29b30: 35 1f adc r19, r21 29b32: 30 93 bc 17 sts 0x17BC, r19 ; 0x8017bc 29b36: 20 93 bb 17 sts 0x17BB, r18 ; 0x8017bb 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); 29b3a: 81 50 subi r24, 0x01 ; 1 29b3c: 71 f7 brne .-36 ; 0x29b1a <__vector_17+0x145e> 29b3e: 60 cf rjmp .-320 ; 0x29a00 <__vector_17+0x1344> 29b40: 6f ef ldi r22, 0xFF ; 255 29b42: 41 e0 ldi r20, 0x01 ; 1 29b44: 50 e0 ldi r21, 0x00 ; 0 29b46: e8 cf rjmp .-48 ; 0x29b18 <__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) 29b48: ac 01 movw r20, r24 29b4a: 48 5d subi r20, 0xD8 ; 216 29b4c: 5f 4f sbci r21, 0xFF ; 255 29b4e: 42 17 cp r20, r18 29b50: 53 07 cpc r21, r19 29b52: 08 f0 brcs .+2 ; 0x29b56 <__vector_17+0x149a> 29b54: 61 cf rjmp .-318 ; 0x29a18 <__vector_17+0x135c> OCR1A = nextAdvanceISR; 29b56: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 29b5a: 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) { 29b5e: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 29b62: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 29b66: 80 91 84 00 lds r24, 0x0084 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> 29b6a: 90 91 85 00 lds r25, 0x0085 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 29b6e: 40 96 adiw r24, 0x10 ; 16 29b70: 28 17 cp r18, r24 29b72: 39 07 cpc r19, r25 29b74: 48 f4 brcc .+18 ; 0x29b88 <__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; 29b76: 80 91 84 00 lds r24, 0x0084 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> 29b7a: 90 91 85 00 lds r25, 0x0085 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 29b7e: 40 96 adiw r24, 0x10 ; 16 29b80: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 29b84: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> } } 29b88: ff 91 pop r31 29b8a: ef 91 pop r30 29b8c: df 91 pop r29 29b8e: cf 91 pop r28 29b90: bf 91 pop r27 29b92: af 91 pop r26 29b94: 9f 91 pop r25 29b96: 8f 91 pop r24 29b98: 7f 91 pop r23 29b9a: 6f 91 pop r22 29b9c: 5f 91 pop r21 29b9e: 4f 91 pop r20 29ba0: 3f 91 pop r19 29ba2: 2f 91 pop r18 29ba4: 1f 91 pop r17 29ba6: 0f 91 pop r16 29ba8: ff 90 pop r15 29baa: ef 90 pop r14 29bac: df 90 pop r13 29bae: cf 90 pop r12 29bb0: 8f 90 pop r8 29bb2: 7f 90 pop r7 29bb4: 6f 90 pop r6 29bb6: 0f 90 pop r0 29bb8: 0b be out 0x3b, r0 ; 59 29bba: 0f 90 pop r0 29bbc: 0f be out 0x3f, r0 ; 63 29bbe: 0f 90 pop r0 29bc0: 1f 90 pop r1 29bc2: 18 95 reti 00029bc4 : return old; } bool enable_z_endstop(bool check) { bool old = check_z_endstop; 29bc4: 90 91 78 05 lds r25, 0x0578 ; 0x800578 check_z_endstop = check; 29bc8: 80 93 78 05 sts 0x0578, r24 ; 0x800578 CRITICAL_SECTION_START; 29bcc: 2f b7 in r18, 0x3f ; 63 29bce: f8 94 cli endstop_hit &= ~_BV(Z_AXIS); 29bd0: 80 91 0b 05 lds r24, 0x050B ; 0x80050b <_ZL11endstop_hit.lto_priv.480> 29bd4: 8b 7f andi r24, 0xFB ; 251 29bd6: 80 93 0b 05 sts 0x050B, r24 ; 0x80050b <_ZL11endstop_hit.lto_priv.480> CRITICAL_SECTION_END; 29bda: 2f bf out 0x3f, r18 ; 63 return old; } 29bdc: 89 2f mov r24, r25 29bde: 08 95 ret 00029be0 : return old; } bool endstop_z_hit_on_purpose() { bool hit = endstop_hit & _BV(Z_AXIS); 29be0: 80 91 0b 05 lds r24, 0x050B ; 0x80050b <_ZL11endstop_hit.lto_priv.480> CRITICAL_SECTION_START; 29be4: 2f b7 in r18, 0x3f ; 63 29be6: f8 94 cli endstop_hit &= ~_BV(Z_AXIS); 29be8: 90 91 0b 05 lds r25, 0x050B ; 0x80050b <_ZL11endstop_hit.lto_priv.480> 29bec: 9b 7f andi r25, 0xFB ; 251 29bee: 90 93 0b 05 sts 0x050B, r25 ; 0x80050b <_ZL11endstop_hit.lto_priv.480> CRITICAL_SECTION_END; 29bf2: 2f bf out 0x3f, r18 ; 63 return hit; } 29bf4: 82 fb bst r24, 2 29bf6: 88 27 eor r24, r24 29bf8: 80 f9 bld r24, 0 29bfa: 08 95 ret 00029bfc : } } bool endstops_hit_on_purpose() { uint8_t old = endstop_hit; 29bfc: 90 91 0b 05 lds r25, 0x050B ; 0x80050b <_ZL11endstop_hit.lto_priv.480> endstop_hit = 0; 29c00: 10 92 0b 05 sts 0x050B, r1 ; 0x80050b <_ZL11endstop_hit.lto_priv.480> return old; 29c04: 81 e0 ldi r24, 0x01 ; 1 29c06: 91 11 cpse r25, r1 29c08: 01 c0 rjmp .+2 ; 0x29c0c 29c0a: 80 e0 ldi r24, 0x00 ; 0 } 29c0c: 08 95 ret 00029c0e : } } void Sound_MakeSound(eSOUND_TYPE eSoundType) { switch(eSoundMode) 29c0e: 90 91 de 04 lds r25, 0x04DE ; 0x8004de 29c12: 91 30 cpi r25, 0x01 ; 1 29c14: a1 f0 breq .+40 ; 0x29c3e 29c16: 28 f0 brcs .+10 ; 0x29c22 29c18: 92 30 cpi r25, 0x02 ; 2 29c1a: a9 f0 breq .+42 ; 0x29c46 29c1c: 93 30 cpi r25, 0x03 ; 3 29c1e: c1 f0 breq .+48 ; 0x29c50 29c20: 08 95 ret { case e_SOUND_MODE_LOUD: if(eSoundType==e_SOUND_TYPE_ButtonEcho) 29c22: 81 11 cpse r24, r1 29c24: 02 c0 rjmp .+4 ; 0x29c2a 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(); 29c26: 0d 94 7d 14 jmp 0x228fa ; 0x228fa switch(eSoundMode) { case e_SOUND_MODE_LOUD: if(eSoundType==e_SOUND_TYPE_ButtonEcho) Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 29c2a: 82 30 cpi r24, 0x02 ; 2 29c2c: 11 f4 brne .+4 ; 0x29c32 break; case e_SOUND_MODE_BLIND: if(eSoundType==e_SOUND_TYPE_ButtonEcho) Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) Sound_DoSound_Prompt(); 29c2e: 0d 94 6f 1f jmp 0x23ede ; 0x23ede 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) 29c32: 85 30 cpi r24, 0x05 ; 5 29c34: 09 f0 breq .+2 ; 0x29c38 29c36: 50 c0 rjmp .+160 ; 0x29cd8 Sound_DoSound_Alert(false); 29c38: 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); 29c3a: 0d 94 5b 14 jmp 0x228b6 ; 0x228b6 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) 29c3e: 88 23 and r24, r24 29c40: 91 f3 breq .-28 ; 0x29c26 Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 29c42: 82 30 cpi r24, 0x02 ; 2 29c44: a1 f3 breq .-24 ; 0x29c2e Sound_DoSound_Prompt(); if(eSoundType==e_SOUND_TYPE_StandardAlert) 29c46: 85 30 cpi r24, 0x05 ; 5 29c48: 09 f0 breq .+2 ; 0x29c4c 29c4a: 46 c0 rjmp .+140 ; 0x29cd8 Sound_DoSound_Alert(true); 29c4c: 81 e0 ldi r24, 0x01 ; 1 29c4e: f5 cf rjmp .-22 ; 0x29c3a 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) 29c50: 88 23 and r24, r24 29c52: 49 f3 breq .-46 ; 0x29c26 Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 29c54: 82 30 cpi r24, 0x02 ; 2 29c56: 59 f3 breq .-42 ; 0x29c2e Sound_DoSound_Prompt(); if(eSoundType==e_SOUND_TYPE_StandardAlert) 29c58: 85 30 cpi r24, 0x05 ; 5 29c5a: 71 f3 breq .-36 ; 0x29c38 Sound_DoSound_Alert(false); if(eSoundType==e_SOUND_TYPE_EncoderMove) 29c5c: 86 30 cpi r24, 0x06 ; 6 29c5e: e1 f4 brne .+56 ; 0x29c98 29c60: 85 e0 ldi r24, 0x05 ; 5 29c62: 27 e2 ldi r18, 0x27 ; 39 29c64: 31 e0 ldi r19, 0x01 ; 1 { uint8_t nI; for(nI=0;nI<5;nI++) { WRITE(BEEPER,HIGH); 29c66: 4f b7 in r20, 0x3f ; 63 29c68: f8 94 cli 29c6a: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29c6e: 94 60 ori r25, 0x04 ; 4 29c70: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29c74: 4f bf out 0x3f, r20 ; 63 29c76: f9 01 movw r30, r18 29c78: 31 97 sbiw r30, 0x01 ; 1 29c7a: f1 f7 brne .-4 ; 0x29c78 delayMicroseconds(75); WRITE(BEEPER,LOW); 29c7c: 4f b7 in r20, 0x3f ; 63 29c7e: f8 94 cli 29c80: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29c84: 9b 7f andi r25, 0xFB ; 251 29c86: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29c8a: 4f bf out 0x3f, r20 ; 63 29c8c: f9 01 movw r30, r18 29c8e: 31 97 sbiw r30, 0x01 ; 1 29c90: f1 f7 brne .-4 ; 0x29c8e 29c92: 81 50 subi r24, 0x01 ; 1 static void Sound_DoSound_Encoder_Move(void) { uint8_t nI; for(nI=0;nI<5;nI++) 29c94: 41 f7 brne .-48 ; 0x29c66 29c96: 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) 29c98: 87 30 cpi r24, 0x07 ; 7 29c9a: f1 f4 brne .+60 ; 0x29cd8 } } static void Sound_DoSound_Blind_Alert(void) { backlight_wake(1); 29c9c: 81 e0 ldi r24, 0x01 ; 1 29c9e: 0e 94 6d 8a call 0x114da ; 0x114da 29ca2: 84 e1 ldi r24, 0x14 ; 20 29ca4: 23 e7 ldi r18, 0x73 ; 115 29ca6: 31 e0 ldi r19, 0x01 ; 1 uint8_t nI; for(nI=0; nI<20; nI++) { WRITE(BEEPER,HIGH); 29ca8: 4f b7 in r20, 0x3f ; 63 29caa: f8 94 cli 29cac: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29cb0: 94 60 ori r25, 0x04 ; 4 29cb2: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29cb6: 4f bf out 0x3f, r20 ; 63 29cb8: f9 01 movw r30, r18 29cba: 31 97 sbiw r30, 0x01 ; 1 29cbc: f1 f7 brne .-4 ; 0x29cba delayMicroseconds(94); WRITE(BEEPER,LOW); 29cbe: 4f b7 in r20, 0x3f ; 63 29cc0: f8 94 cli 29cc2: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29cc6: 9b 7f andi r25, 0xFB ; 251 29cc8: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29ccc: 4f bf out 0x3f, r20 ; 63 29cce: f9 01 movw r30, r18 29cd0: 31 97 sbiw r30, 0x01 ; 1 29cd2: f1 f7 brne .-4 ; 0x29cd0 29cd4: 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++) 29cd6: 41 f7 brne .-48 ; 0x29ca8 Sound_DoSound_Blind_Alert(); break; default: break; } } 29cd8: 08 95 ret 00029cda : //! @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 ) { 29cda: 2f 92 push r2 29cdc: 3f 92 push r3 29cde: 4f 92 push r4 29ce0: 5f 92 push r5 29ce2: 6f 92 push r6 29ce4: 7f 92 push r7 29ce6: 8f 92 push r8 29ce8: 9f 92 push r9 29cea: af 92 push r10 29cec: bf 92 push r11 29cee: cf 92 push r12 29cf0: df 92 push r13 29cf2: ef 92 push r14 29cf4: ff 92 push r15 29cf6: 0f 93 push r16 29cf8: 1f 93 push r17 29cfa: cf 93 push r28 29cfc: df 93 push r29 29cfe: 00 d0 rcall .+0 ; 0x29d00 29d00: 00 d0 rcall .+0 ; 0x29d02 29d02: cd b7 in r28, 0x3d ; 61 29d04: de b7 in r29, 0x3e ; 62 29d06: 5c 01 movw r10, r24 29d08: 6c 83 std Y+4, r22 ; 0x04 29d0a: 34 2e mov r3, r20 29d0c: 3b 83 std Y+3, r19 ; 0x03 29d0e: 2a 83 std Y+2, r18 ; 0x02 29d10: 48 01 movw r8, r16 29d12: 2c 2c mov r2, r12 const char *msg_next = msg ? lcd_display_message_fullscreen_P(msg) : NULL; 29d14: 00 97 sbiw r24, 0x00 ; 0 29d16: 09 f0 breq .+2 ; 0x29d1a 29d18: 51 c0 rjmp .+162 ; 0x29dbc 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); 29d1a: 87 01 movw r16, r14 29d1c: 22 2d mov r18, r2 29d1e: a4 01 movw r20, r8 29d20: 6a 81 ldd r22, Y+2 ; 0x02 29d22: 7b 81 ldd r23, Y+3 ; 0x03 29d24: 83 2d mov r24, r3 29d26: 0f 94 93 1f call 0x23f26 ; 0x23f26 29d2a: d1 2c mov r13, r1 29d2c: c1 2c mov r12, r1 } // Wait for user confirmation or a timeout. unsigned long previous_millis_cmd = _millis(); 29d2e: 0f 94 4c 29 call 0x25298 ; 0x25298 29d32: 2b 01 movw r4, r22 29d34: 3c 01 movw r6, r24 lcd_consume_click(); 29d36: 0e 94 f8 70 call 0xe1f0 ; 0xe1f0 KEEPALIVE_STATE(PAUSED_FOR_USER); 29d3a: 84 e0 ldi r24, 0x04 ; 4 29d3c: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be 29d40: de 82 std Y+6, r13 ; 0x06 29d42: cd 82 std Y+5, r12 ; 0x05 29d44: 24 e6 ldi r18, 0x64 ; 100 29d46: 29 83 std Y+1, r18 ; 0x01 for (;;) { for (uint8_t i = 0; i < 100; ++i) { delay_keep_alive(50); 29d48: 82 e3 ldi r24, 0x32 ; 50 29d4a: 90 e0 ldi r25, 0x00 ; 0 29d4c: 0e 94 e4 8c call 0x119c8 ; 0x119c8 if (allow_timeouting && _millis() - previous_millis_cmd > LCD_TIMEOUT_TO_STATUS) { 29d50: 3c 81 ldd r19, Y+4 ; 0x04 29d52: 31 11 cpse r19, r1 29d54: 3a c0 rjmp .+116 ; 0x29dca current_selection = LCD_BUTTON_TIMEOUT; goto exit; } if (lcd_encoder) { 29d56: 80 91 70 06 lds r24, 0x0670 ; 0x800670 29d5a: 90 91 71 06 lds r25, 0x0671 ; 0x800671 29d5e: 00 97 sbiw r24, 0x00 ; 0 29d60: 09 f0 breq .+2 ; 0x29d64 29d62: 42 c0 rjmp .+132 ; 0x29de8 } else { Sound_MakeSound(e_SOUND_TYPE_BlindAlert); break; // turning knob skips waiting loop } } if (lcd_clicked()) { 29d64: 0e 94 fd 70 call 0xe1fa ; 0xe1fa 29d68: 88 23 and r24, r24 29d6a: 09 f4 brne .+2 ; 0x29d6e 29d6c: 67 c0 rjmp .+206 ; 0x29e3c if (msg_next == NULL) { 29d6e: 8d 81 ldd r24, Y+5 ; 0x05 29d70: 9e 81 ldd r25, Y+6 ; 0x06 29d72: 89 2b or r24, r25 29d74: 09 f0 breq .+2 ; 0x29d78 29d76: 5e c0 rjmp .+188 ; 0x29e34 if (msg_next == NULL) { lcd_show_choices_prompt_P(current_selection, first_choice, second_choice, second_col, third_choice); } } exit: KEEPALIVE_STATE(IN_HANDLER); 29d78: 82 e0 ldi r24, 0x02 ; 2 29d7a: 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; 29d7e: 91 e0 ldi r25, 0x01 ; 1 29d80: 90 93 6e 02 sts 0x026E, r25 ; 0x80026e lcd_draw_update = 2; 29d84: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d return current_selection; } 29d88: 83 2d mov r24, r3 29d8a: 26 96 adiw r28, 0x06 ; 6 29d8c: 0f b6 in r0, 0x3f ; 63 29d8e: f8 94 cli 29d90: de bf out 0x3e, r29 ; 62 29d92: 0f be out 0x3f, r0 ; 63 29d94: cd bf out 0x3d, r28 ; 61 29d96: df 91 pop r29 29d98: cf 91 pop r28 29d9a: 1f 91 pop r17 29d9c: 0f 91 pop r16 29d9e: ff 90 pop r15 29da0: ef 90 pop r14 29da2: df 90 pop r13 29da4: cf 90 pop r12 29da6: bf 90 pop r11 29da8: af 90 pop r10 29daa: 9f 90 pop r9 29dac: 8f 90 pop r8 29dae: 7f 90 pop r7 29db0: 6f 90 pop r6 29db2: 5f 90 pop r5 29db4: 4f 90 pop r4 29db6: 3f 90 pop r3 29db8: 2f 90 pop r2 29dba: 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; 29dbc: 0f 94 e4 1f call 0x23fc8 ; 0x23fc8 29dc0: 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) { 29dc2: 89 2b or r24, r25 29dc4: 09 f0 breq .+2 ; 0x29dc8 29dc6: b3 cf rjmp .-154 ; 0x29d2e 29dc8: a8 cf rjmp .-176 ; 0x29d1a 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) { 29dca: 0f 94 4c 29 call 0x25298 ; 0x25298 29dce: 64 19 sub r22, r4 29dd0: 75 09 sbc r23, r5 29dd2: 86 09 sbc r24, r6 29dd4: 97 09 sbc r25, r7 29dd6: 61 33 cpi r22, 0x31 ; 49 29dd8: 75 47 sbci r23, 0x75 ; 117 29dda: 81 05 cpc r24, r1 29ddc: 91 05 cpc r25, r1 29dde: 08 f4 brcc .+2 ; 0x29de2 29de0: ba cf rjmp .-140 ; 0x29d56 current_selection = LCD_BUTTON_TIMEOUT; 29de2: 33 24 eor r3, r3 29de4: 3a 94 dec r3 29de6: c8 cf rjmp .-112 ; 0x29d78 goto exit; } if (lcd_encoder) { if (msg_next == NULL) { 29de8: 2d 81 ldd r18, Y+5 ; 0x05 29dea: 3e 81 ldd r19, Y+6 ; 0x06 29dec: 23 2b or r18, r19 29dee: f9 f4 brne .+62 ; 0x29e2e if (third_choice) { // third_choice is not nullptr, safe to dereference 29df0: e1 14 cp r14, r1 29df2: f1 04 cpc r15, r1 29df4: b1 f0 breq .+44 ; 0x29e22 if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 29df6: 97 ff sbrs r25, 7 29df8: 0f c0 rjmp .+30 ; 0x29e18 29dfa: 31 10 cpse r3, r1 // Rotating knob counter clockwise current_selection--; 29dfc: 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); 29dfe: 87 01 movw r16, r14 29e00: 22 2d mov r18, r2 29e02: a4 01 movw r20, r8 29e04: 6a 81 ldd r22, Y+2 ; 0x02 29e06: 7b 81 ldd r23, Y+3 ; 0x03 29e08: 83 2d mov r24, r3 29e0a: 0f 94 93 1f call 0x23f26 ; 0x23f26 lcd_encoder = 0; 29e0e: 10 92 71 06 sts 0x0671, r1 ; 0x800671 29e12: 10 92 70 06 sts 0x0670, r1 ; 0x800670 29e16: a6 cf rjmp .-180 ; 0x29d64 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) { 29e18: 32 e0 ldi r19, 0x02 ; 2 29e1a: 33 16 cp r3, r19 29e1c: 81 f3 breq .-32 ; 0x29dfe // Rotating knob clockwise current_selection++; 29e1e: 33 94 inc r3 29e20: ee cf rjmp .-36 ; 0x29dfe } } else { if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 29e22: 39 2e mov r3, r25 29e24: 30 94 com r3 29e26: 33 1c adc r3, r3 29e28: 33 24 eor r3, r3 29e2a: 33 1c adc r3, r3 29e2c: e8 cf rjmp .-48 ; 0x29dfe } } 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); 29e2e: 87 e0 ldi r24, 0x07 ; 7 29e30: 0f 94 07 4e call 0x29c0e ; 0x29c0e goto exit; } else break; } } if (multi_screen) { 29e34: c1 14 cp r12, r1 29e36: d1 04 cpc r13, r1 29e38: 79 f4 brne .+30 ; 0x29e58 29e3a: 84 cf rjmp .-248 ; 0x29d44 29e3c: 99 81 ldd r25, Y+1 ; 0x01 29e3e: 91 50 subi r25, 0x01 ; 1 29e40: 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) { 29e42: 91 11 cpse r25, r1 29e44: 81 cf rjmp .-254 ; 0x29d48 goto exit; } else break; } } if (multi_screen) { 29e46: c1 14 cp r12, r1 29e48: d1 04 cpc r13, r1 29e4a: 61 f0 breq .+24 ; 0x29e64 if (msg_next == NULL) { 29e4c: 2d 81 ldd r18, Y+5 ; 0x05 29e4e: 3e 81 ldd r19, Y+6 ; 0x06 29e50: 23 2b or r18, r19 29e52: 11 f4 brne .+4 ; 0x29e58 29e54: be 82 std Y+6, r11 ; 0x06 29e56: ad 82 std Y+5, r10 ; 0x05 msg_next = msg; } msg_next = lcd_display_message_fullscreen_P(msg_next); 29e58: 8d 81 ldd r24, Y+5 ; 0x05 29e5a: 9e 81 ldd r25, Y+6 ; 0x06 29e5c: 0f 94 e4 1f call 0x23fc8 ; 0x23fc8 29e60: 9e 83 std Y+6, r25 ; 0x06 29e62: 8d 83 std Y+5, r24 ; 0x05 } if (msg_next == NULL) { 29e64: 8d 81 ldd r24, Y+5 ; 0x05 29e66: 9e 81 ldd r25, Y+6 ; 0x06 29e68: 89 2b or r24, r25 29e6a: 09 f0 breq .+2 ; 0x29e6e 29e6c: 6b cf rjmp .-298 ; 0x29d44 lcd_show_choices_prompt_P(current_selection, first_choice, second_choice, second_col, third_choice); 29e6e: 87 01 movw r16, r14 29e70: 22 2d mov r18, r2 29e72: a4 01 movw r20, r8 29e74: 6a 81 ldd r22, Y+2 ; 0x02 29e76: 7b 81 ldd r23, Y+3 ; 0x03 29e78: 83 2d mov r24, r3 29e7a: 0f 94 93 1f call 0x23f26 ; 0x23f26 29e7e: 62 cf rjmp .-316 ; 0x29d44 00029e80 : //! @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) { 29e80: bf 92 push r11 29e82: cf 92 push r12 29e84: df 92 push r13 29e86: ef 92 push r14 29e88: ff 92 push r15 29e8a: 0f 93 push r16 29e8c: 1f 93 push r17 29e8e: cf 93 push r28 29e90: df 93 push r29 29e92: ec 01 movw r28, r24 29e94: d6 2e mov r13, r22 29e96: 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); 29e98: 87 e5 ldi r24, 0x57 ; 87 29e9a: 98 e4 ldi r25, 0x48 ; 72 29e9c: 0e 94 ac 72 call 0xe558 ; 0xe558 29ea0: 8c 01 movw r16, r24 29ea2: 81 e5 ldi r24, 0x51 ; 81 29ea4: 98 e4 ldi r25, 0x48 ; 72 29ea6: 0e 94 ac 72 call 0xe558 ; 0xe558 29eaa: 2a e0 ldi r18, 0x0A ; 10 29eac: c2 2e mov r12, r18 29eae: f1 2c mov r15, r1 29eb0: e1 2c mov r14, r1 29eb2: 9c 01 movw r18, r24 29eb4: 4b 2d mov r20, r11 29eb6: 6d 2d mov r22, r13 29eb8: ce 01 movw r24, r28 29eba: 0f 94 6d 4e call 0x29cda ; 0x29cda } 29ebe: df 91 pop r29 29ec0: cf 91 pop r28 29ec2: 1f 91 pop r17 29ec4: 0f 91 pop r16 29ec6: ff 90 pop r15 29ec8: ef 90 pop r14 29eca: df 90 pop r13 29ecc: cf 90 pop r12 29ece: bf 90 pop r11 29ed0: 08 95 ret 00029ed2 : _delay(2000); lcd_clear(); } void lcd_load_filament_color_check() { 29ed2: cf 92 push r12 29ed4: ef 92 push r14 29ed6: ff 92 push r15 29ed8: 0f 93 push r16 29eda: 1f 93 push r17 29edc: cf 93 push r28 29ede: 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); 29ee0: 8a e3 ldi r24, 0x3A ; 58 29ee2: 90 e5 ldi r25, 0x50 ; 80 29ee4: 0e 94 ac 72 call 0xe558 ; 0xe558 29ee8: 7c 01 movw r14, r24 29eea: 87 e5 ldi r24, 0x57 ; 87 29eec: 98 e4 ldi r25, 0x48 ; 72 29eee: 0e 94 ac 72 call 0xe558 ; 0xe558 29ef2: 8c 01 movw r16, r24 29ef4: 81 e5 ldi r24, 0x51 ; 81 29ef6: 98 e4 ldi r25, 0x48 ; 72 29ef8: 0e 94 ac 72 call 0xe558 ; 0xe558 29efc: ec 01 movw r28, r24 29efe: 8f e0 ldi r24, 0x0F ; 15 29f00: 90 e5 ldi r25, 0x50 ; 80 29f02: 0e 94 ac 72 call 0xe558 ; 0xe558 29f06: 28 e0 ldi r18, 0x08 ; 8 29f08: c2 2e mov r12, r18 29f0a: 9e 01 movw r18, r28 29f0c: 40 e0 ldi r20, 0x00 ; 0 29f0e: 60 e0 ldi r22, 0x00 ; 0 29f10: 0f 94 6d 4e call 0x29cda ; 0x29cda while (clean == LCD_MIDDLE_BUTTON_CHOICE) { 29f14: 81 30 cpi r24, 0x01 ; 1 29f16: 29 f4 brne .+10 ; 0x29f22 load_filament_final_feed(); 29f18: 0e 94 93 64 call 0xc926 ; 0xc926 st_synchronize(); 29f1c: 0f 94 e8 42 call 0x285d0 ; 0x285d0 29f20: df cf rjmp .-66 ; 0x29ee0 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) { 29f22: 82 30 cpi r24, 0x02 ; 2 29f24: 61 f4 brne .+24 ; 0x29f3e unload_filament(FILAMENTCHANGE_FINALRETRACT); 29f26: 60 e0 ldi r22, 0x00 ; 0 29f28: 70 e0 ldi r23, 0x00 ; 0 29f2a: cb 01 movw r24, r22 } } 29f2c: df 91 pop r29 29f2e: cf 91 pop r28 29f30: 1f 91 pop r17 29f32: 0f 91 pop r16 29f34: ff 90 pop r15 29f36: ef 90 pop r14 29f38: 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); 29f3a: 0c 94 4f f8 jmp 0x1f09e ; 0x1f09e } } 29f3e: df 91 pop r29 29f40: cf 91 pop r28 29f42: 1f 91 pop r17 29f44: 0f 91 pop r16 29f46: ff 90 pop r15 29f48: ef 90 pop r14 29f4a: cf 90 pop r12 29f4c: 08 95 ret 00029f4e : static void __attribute__((noinline)) mFilamentResetMenuStack() { menu_back(bFilamentPreheatState ? 1 : 2); } void mFilamentItem(uint16_t nTemp, uint16_t nTempBed) { 29f4e: 0f 93 push r16 29f50: 1f 93 push r17 29f52: cf 93 push r28 29f54: df 93 push r29 29f56: 8c 01 movw r16, r24 29f58: eb 01 movw r28, r22 }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 29f5a: 90 93 b7 0d sts 0x0DB7, r25 ; 0x800db7 29f5e: 80 93 b6 0d sts 0x0DB6, r24 ; 0x800db6 setTargetHotend((float)nTemp); if (!shouldPreheatOnlyNozzle()) setTargetBed((float)nTempBed); 29f62: 0f 94 34 16 call 0x22c68 ; 0x22c68 29f66: 81 11 cpse r24, r1 29f68: 04 c0 rjmp .+8 ; 0x29f72 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 29f6a: d0 93 73 06 sts 0x0673, r29 ; 0x800673 29f6e: c0 93 72 06 sts 0x0672, r28 ; 0x800672 { const FilamentAction action = eFilamentAction; 29f72: c0 91 a7 03 lds r28, 0x03A7 ; 0x8003a7 if (action == FilamentAction::Preheat || action == FilamentAction::Lay1Cal) 29f76: 87 ef ldi r24, 0xF7 ; 247 29f78: 8c 0f add r24, r28 29f7a: 82 30 cpi r24, 0x02 ; 2 29f7c: f8 f4 brcc .+62 ; 0x29fbc { lcd_return_to_status(); 29f7e: 0f 94 a6 1e call 0x23d4c ; 0x23d4c if (action == FilamentAction::Lay1Cal) 29f82: ca 30 cpi r28, 0x0A ; 10 29f84: 41 f4 brne .+16 ; 0x29f96 { lcd_commands_type = LcdCommands::Layer1Cal; 29f86: 84 e0 ldi r24, 0x04 ; 4 29f88: 80 93 b4 0d sts 0x0DB4, r24 ; 0x800db4 } menu_back(); clearFilamentAction(); } } } 29f8c: df 91 pop r29 29f8e: cf 91 pop r28 29f90: 1f 91 pop r17 29f92: 0f 91 pop r16 29f94: 08 95 ret { lcd_commands_type = LcdCommands::Layer1Cal; } else { raise_z_above(MIN_Z_FOR_PREHEAT); 29f96: 60 e0 ldi r22, 0x00 ; 0 29f98: 70 e0 ldi r23, 0x00 ; 0 29f9a: 80 e2 ldi r24, 0x20 ; 32 29f9c: 91 e4 ldi r25, 0x41 ; 65 29f9e: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 29fa2: 8f e5 ldi r24, 0x5F ; 95 29fa4: 9f e0 ldi r25, 0x0F ; 15 29fa6: 0f 94 1c dc call 0x3b838 ; 0x3b838 29faa: 88 23 and r24, r24 29fac: 79 f3 breq .-34 ; 0x29f8c lcd_wizard(WizState::LoadFilHot); 29fae: 89 e0 ldi r24, 0x09 ; 9 } menu_back(); clearFilamentAction(); } } } 29fb0: df 91 pop r29 29fb2: cf 91 pop r28 29fb4: 1f 91 pop r17 29fb6: 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); 29fb8: 0c 94 fb f8 jmp 0x1f1f6 ; 0x1f1f6 29fbc: 10 92 dc 03 sts 0x03DC, r1 ; 0x8003dc 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) 29fc0: 80 91 64 06 lds r24, 0x0664 ; 0x800664 29fc4: 81 11 cpse r24, r1 29fc6: 12 c0 rjmp .+36 ; 0x29fec 29fc8: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 29fcc: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 29fd0: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 29fd4: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 29fd8: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> 29fdc: 60 1b sub r22, r16 29fde: 71 0b sbc r23, r17 29fe0: 6c 5f subi r22, 0xFC ; 252 29fe2: 7f 4f sbci r23, 0xFF ; 255 29fe4: 69 30 cpi r22, 0x09 ; 9 29fe6: 71 05 cpc r23, r1 29fe8: 08 f0 brcs .+2 ; 0x29fec 29fea: 60 c0 rjmp .+192 ; 0x2a0ac { menu_func_t filamentActionMenu = nullptr; switch (eFilamentAction) 29fec: c1 50 subi r28, 0x01 ; 1 29fee: c8 30 cpi r28, 0x08 ; 8 29ff0: 88 f5 brcc .+98 ; 0x2a054 29ff2: ec 2f mov r30, r28 29ff4: f0 e0 ldi r31, 0x00 ; 0 29ff6: 88 27 eor r24, r24 29ff8: ef 5f subi r30, 0xFF ; 255 29ffa: ff 4a sbci r31, 0xAF ; 175 29ffc: 8e 4f sbci r24, 0xFE ; 254 29ffe: 0d 94 2c dd jmp 0x3ba58 ; 0x3ba58 <__tablejump2__> 2a002: c2 3a cpi r28, 0xA2 ; 162 2a004: c2 3a cpi r28, 0xA2 ; 162 2a006: c2 3a cpi r28, 0xA2 ; 162 2a008: d6 39 cpi r29, 0x96 ; 150 2a00a: 8a 39 cpi r24, 0x9A ; 154 2a00c: 9a 39 cpi r25, 0x9A ; 154 2a00e: e8 3a cpi r30, 0xA8 ; 168 2a010: 92 3a cpi r25, 0xA2 ; 162 else if (eFilamentAction == FilamentAction::UnLoad) enquecommand_P(MSG_M702); // unload filament } break; case FilamentAction::MmuLoad: filamentActionMenu = mmu_load_to_nozzle_menu; 2a012: cf e5 ldi r28, 0x5F ; 95 2a014: d1 ee ldi r29, 0xE1 ; 225 case FilamentAction::Preheat: case FilamentAction::Lay1Cal: // handled earlier break; } if (bFilamentWaitingFlag) { 2a016: 80 91 62 06 lds r24, 0x0662 ; 0x800662 2a01a: 88 23 and r24, r24 2a01c: 29 f0 breq .+10 ; 0x2a028 Sound_MakeSound(e_SOUND_TYPE_StandardPrompt); 2a01e: 82 e0 ldi r24, 0x02 ; 2 2a020: 0f 94 07 4e call 0x29c0e ; 0x29c0e bFilamentWaitingFlag = false; 2a024: 10 92 62 06 sts 0x0662, r1 ; 0x800662 } if (filamentActionMenu) { 2a028: 20 97 sbiw r28, 0x00 ; 0 2a02a: 09 f4 brne .+2 ; 0x2a02e 2a02c: af cf rjmp .-162 ; 0x29f8c // Reset the menu stack and filament action before entering action menu mFilamentResetMenuStack(); 2a02e: 0f 94 c1 1c call 0x23982 ; 0x23982 // The menu should clear eFilamentAction when the // 'action' is done menu_submenu(filamentActionMenu, true); 2a032: 61 e0 ldi r22, 0x01 ; 1 2a034: ce 01 movw r24, r28 } menu_back(); clearFilamentAction(); } } } 2a036: df 91 pop r29 2a038: cf 91 pop r28 2a03a: 1f 91 pop r17 2a03c: 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); 2a03e: 0d 94 03 d3 jmp 0x3a606 ; 0x3a606 switch (eFilamentAction) { case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::UnLoad: if (bFilamentWaitingFlag) menu_submenu(mFilamentPrompt, true); 2a042: 80 91 62 06 lds r24, 0x0662 ; 0x800662 2a046: 88 23 and r24, r24 2a048: 41 f0 breq .+16 ; 0x2a05a 2a04a: 61 e0 ldi r22, 0x01 ; 1 2a04c: 8a e7 ldi r24, 0x7A ; 122 2a04e: 9a e3 ldi r25, 0x3A ; 58 2a050: 0f 94 03 d3 call 0x3a606 ; 0x3a606 // 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; 2a054: d0 e0 ldi r29, 0x00 ; 0 2a056: c0 e0 ldi r28, 0x00 ; 0 2a058: de cf rjmp .-68 ; 0x2a016 case FilamentAction::AutoLoad: case FilamentAction::UnLoad: if (bFilamentWaitingFlag) menu_submenu(mFilamentPrompt, true); else { mFilamentResetMenuStack(); 2a05a: 0f 94 c1 1c call 0x23982 ; 0x23982 if (eFilamentAction == FilamentAction::AutoLoad) { 2a05e: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 2a062: 82 30 cpi r24, 0x02 ; 2 2a064: 19 f4 brne .+6 ; 0x2a06c // loading no longer cancellable eFilamentAction = FilamentAction::Load; 2a066: 81 e0 ldi r24, 0x01 ; 1 2a068: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 } if (eFilamentAction == FilamentAction::Load) 2a06c: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 2a070: 81 30 cpi r24, 0x01 ; 1 2a072: 31 f4 brne .+12 ; 0x2a080 enquecommand_P(MSG_M701); // load filament 2a074: 61 e0 ldi r22, 0x01 ; 1 2a076: 83 e5 ldi r24, 0x53 ; 83 2a078: 9f e6 ldi r25, 0x6F ; 111 else if (eFilamentAction == FilamentAction::UnLoad) enquecommand_P(MSG_M702); // unload filament 2a07a: 0e 94 20 88 call 0x11040 ; 0x11040 2a07e: ea cf rjmp .-44 ; 0x2a054 eFilamentAction = FilamentAction::Load; } if (eFilamentAction == FilamentAction::Load) enquecommand_P(MSG_M701); // load filament else if (eFilamentAction == FilamentAction::UnLoad) 2a080: 83 30 cpi r24, 0x03 ; 3 2a082: 41 f7 brne .-48 ; 0x2a054 enquecommand_P(MSG_M702); // unload filament 2a084: 61 e0 ldi r22, 0x01 ; 1 2a086: 8b ed ldi r24, 0xDB ; 219 2a088: 9b e6 ldi r25, 0x6B ; 107 2a08a: f7 cf rjmp .-18 ; 0x2a07a break; case FilamentAction::MmuLoad: filamentActionMenu = mmu_load_to_nozzle_menu; break; case FilamentAction::MmuLoadingTest: filamentActionMenu = mmu_loading_test_menu; 2a08c: c9 ed ldi r28, 0xD9 ; 217 2a08e: d0 ee ldi r29, 0xE0 ; 224 2a090: c2 cf rjmp .-124 ; 0x2a016 break; case FilamentAction::MmuUnLoad: mFilamentResetMenuStack(); 2a092: 0f 94 c1 1c call 0x23982 ; 0x23982 MMU2::mmu2.unload(); 2a096: 0f 94 3d ad call 0x35a7a ; 0x35a7a // 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(); 2a09a: 0f 94 93 20 call 0x24126 ; 0x24126 2a09e: da cf rjmp .-76 ; 0x2a054 break; case FilamentAction::MmuEject: filamentActionMenu = mmu_fil_eject_menu; 2a0a0: c7 e5 ldi r28, 0x57 ; 87 2a0a2: d1 ee ldi r29, 0xE1 ; 225 2a0a4: b8 cf rjmp .-144 ; 0x2a016 break; case FilamentAction::MmuCut: #ifdef MMU_HAS_CUTTER filamentActionMenu = mmu_cut_filament_menu; 2a0a6: cf e4 ldi r28, 0x4F ; 79 2a0a8: d1 ee ldi r29, 0xE1 ; 225 2a0aa: b5 cf rjmp .-150 ; 0x2a016 menu_submenu(filamentActionMenu, true); } } else // still preheating, continue updating LCD UI { if (!bFilamentWaitingFlag || lcd_draw_update) 2a0ac: 80 91 62 06 lds r24, 0x0662 ; 0x800662 2a0b0: 88 23 and r24, r24 2a0b2: 21 f0 breq .+8 ; 0x2a0bc 2a0b4: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 2a0b8: 88 23 and r24, r24 2a0ba: 71 f1 breq .+92 ; 0x2a118 // 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; 2a0bc: 81 e0 ldi r24, 0x01 ; 1 2a0be: 80 93 62 06 sts 0x0662, r24 ; 0x800662 // also force-enable lcd_draw_update (might be 0 when called from outside a menu) lcd_draw_update = 1; 2a0c2: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d lcd_clear(); 2a0c6: 0e 94 13 6f call 0xde26 ; 0xde26 lcd_puts_at_P(0, 3, _T(MSG_CANCEL)); 2a0ca: 80 ec ldi r24, 0xC0 ; 192 2a0cc: 9b e3 ldi r25, 0x3B ; 59 2a0ce: 0e 94 ac 72 call 0xe558 ; 0xe558 2a0d2: ac 01 movw r20, r24 2a0d4: 63 e0 ldi r22, 0x03 ; 3 2a0d6: 80 e0 ldi r24, 0x00 ; 0 2a0d8: 0e 94 f4 6e call 0xdde8 ; 0xdde8 lcd_set_cursor(0, 1); 2a0dc: 61 e0 ldi r22, 0x01 ; 1 2a0de: 80 e0 ldi r24, 0x00 ; 0 2a0e0: 0e 94 e0 6e call 0xddc0 ; 0xddc0 switch (eFilamentAction) 2a0e4: e0 91 a7 03 lds r30, 0x03A7 ; 0x8003a7 2a0e8: e1 50 subi r30, 0x01 ; 1 2a0ea: e8 30 cpi r30, 0x08 ; 8 2a0ec: a8 f4 brcc .+42 ; 0x2a118 2a0ee: f0 e0 ldi r31, 0x00 ; 0 2a0f0: 88 27 eor r24, r24 2a0f2: e2 58 subi r30, 0x82 ; 130 2a0f4: ff 4a sbci r31, 0xAF ; 175 2a0f6: 8e 4f sbci r24, 0xFE ; 254 2a0f8: 0d 94 2c dd jmp 0x3ba58 ; 0x3ba58 <__tablejump2__> 2a0fc: 88 3a cpi r24, 0xA8 ; 168 2a0fe: 88 3a cpi r24, 0xA8 ; 168 2a100: 50 39 cpi r21, 0x90 ; 144 2a102: 88 3a cpi r24, 0xA8 ; 168 2a104: 50 39 cpi r21, 0x90 ; 144 2a106: 10 3b cpi r17, 0xB0 ; 176 2a108: ec 39 cpi r30, 0x9C ; 156 2a10a: 88 3a cpi r24, 0xA8 ; 168 { case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::MmuLoad: case FilamentAction::MmuLoadingTest: lcd_puts_P(_T(MSG_PREHEATING_TO_LOAD)); 2a10c: 8f ee ldi r24, 0xEF ; 239 2a10e: 9f e4 ldi r25, 0x4F ; 79 break; case FilamentAction::MmuEject: lcd_puts_P(_T(MSG_PREHEATING_TO_EJECT)); break; case FilamentAction::MmuCut: lcd_puts_P(_T(MSG_PREHEATING_TO_CUT)); 2a110: 0e 94 ac 72 call 0xe558 ; 0xe558 2a114: 0e 94 cb 6e call 0xdd96 ; 0xdd96 // handled earlier break; } } if (bFilamentWaitingFlag) { 2a118: 80 91 62 06 lds r24, 0x0662 ; 0x800662 2a11c: 81 11 cpse r24, r1 lcd_print_target_temps_first_line(); 2a11e: 0f 94 97 21 call 0x2432e ; 0x2432e } if (lcd_clicked()) 2a122: 0e 94 fd 70 call 0xe1fa ; 0xe1fa 2a126: 88 23 and r24, r24 2a128: 09 f4 brne .+2 ; 0x2a12c 2a12a: 30 cf rjmp .-416 ; 0x29f8c { // Filament action canceled while preheating bFilamentWaitingFlag = false; 2a12c: 10 92 62 06 sts 0x0662, r1 ; 0x800662 if (!bFilamentPreheatState) 2a130: 80 91 63 06 lds r24, 0x0663 ; 0x800663 2a134: 81 11 cpse r24, r1 2a136: 0e c0 rjmp .+28 ; 0x2a154 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 2a138: 10 92 b7 0d sts 0x0DB7, r1 ; 0x800db7 2a13c: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 { setTargetHotend(0); if (!printingIsPaused()) setTargetBed(0); 2a140: 0e 94 85 67 call 0xcf0a ; 0xcf0a 2a144: 81 11 cpse r24, r1 2a146: 04 c0 rjmp .+8 ; 0x2a150 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 2a148: 10 92 73 06 sts 0x0673, r1 ; 0x800673 2a14c: 10 92 72 06 sts 0x0672, r1 ; 0x800672 menu_back(); 2a150: 0f 94 5e d4 call 0x3a8bc ; 0x3a8bc } menu_back(); 2a154: 0f 94 5e d4 call 0x3a8bc ; 0x3a8bc clearFilamentAction(); } } } 2a158: df 91 pop r29 2a15a: cf 91 pop r28 2a15c: 1f 91 pop r17 2a15e: 0f 91 pop r16 setTargetHotend(0); if (!printingIsPaused()) setTargetBed(0); menu_back(); } menu_back(); clearFilamentAction(); 2a160: 0d 94 93 20 jmp 0x24126 ; 0x24126 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)); 2a164: 88 ed ldi r24, 0xD8 ; 216 2a166: 9f e4 ldi r25, 0x4F ; 79 2a168: d3 cf rjmp .-90 ; 0x2a110 break; case FilamentAction::MmuEject: lcd_puts_P(_T(MSG_PREHEATING_TO_EJECT)); 2a16a: 82 ec ldi r24, 0xC2 ; 194 2a16c: 9f e4 ldi r25, 0x4F ; 79 2a16e: d0 cf rjmp .-96 ; 0x2a110 break; case FilamentAction::MmuCut: lcd_puts_P(_T(MSG_PREHEATING_TO_CUT)); 2a170: 8e ea ldi r24, 0xAE ; 174 2a172: 9f e4 ldi r25, 0x4F ; 79 2a174: cd cf rjmp .-102 ; 0x2a110 0002a176 : } } } static void setFilamentAction(FilamentAction action) { eFilamentAction = action; 2a176: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 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) ); 2a17a: 40 91 ba 13 lds r20, 0x13BA ; 0x8013ba 2a17e: 20 91 b6 0d lds r18, 0x0DB6 ; 0x800db6 2a182: 30 91 b7 0d lds r19, 0x0DB7 ; 0x800db7 2a186: 41 30 cpi r20, 0x01 ; 1 2a188: 59 f0 breq .+22 ; 0x2a1a0 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() 2a18a: 10 92 64 06 sts 0x0664, r1 ; 0x800664 && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); if (bFilamentSkipPreheat || target_temperature[0] >= extrude_min_temp) { 2a18e: 80 91 6b 02 lds r24, 0x026B ; 0x80026b 2a192: 90 91 6c 02 lds r25, 0x026C ; 0x80026c 2a196: 28 17 cp r18, r24 2a198: 39 07 cpc r19, r25 2a19a: 5c f4 brge .+22 ; 0x2a1b2 bFilamentPreheatState = true; mFilamentItem(target_temperature[0], target_temperature_bed); bFilamentSkipPreheat = false; // Reset flag } else { lcd_generic_preheat_menu(); 2a19c: 0d 94 96 20 jmp 0x2412c ; 0x2412c 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() 2a1a0: 90 91 90 13 lds r25, 0x1390 ; 0x801390 2a1a4: 91 11 cpse r25, r1 2a1a6: f1 cf rjmp .-30 ; 0x2a18a && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); 2a1a8: 86 50 subi r24, 0x06 ; 6 2a1aa: 82 30 cpi r24, 0x02 ; 2 2a1ac: 70 f7 brcc .-36 ; 0x2a18a 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() 2a1ae: 40 93 64 06 sts 0x0664, r20 ; 0x800664 && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); if (bFilamentSkipPreheat || target_temperature[0] >= extrude_min_temp) { bFilamentPreheatState = true; 2a1b2: 81 e0 ldi r24, 0x01 ; 1 2a1b4: 80 93 63 06 sts 0x0663, r24 ; 0x800663 mFilamentItem(target_temperature[0], target_temperature_bed); 2a1b8: 60 91 72 06 lds r22, 0x0672 ; 0x800672 2a1bc: 70 91 73 06 lds r23, 0x0673 ; 0x800673 2a1c0: c9 01 movw r24, r18 2a1c2: 0f 94 a7 4f call 0x29f4e ; 0x29f4e bFilamentSkipPreheat = false; // Reset flag 2a1c6: 10 92 64 06 sts 0x0664, r1 ; 0x800664 } else { lcd_generic_preheat_menu(); } } 2a1ca: 08 95 ret 0002a1cc : { preheat_or_continue(FilamentAction::Load); } void lcd_AutoLoadFilament() { preheat_or_continue(FilamentAction::AutoLoad); 2a1cc: 82 e0 ldi r24, 0x02 ; 2 2a1ce: 0d 94 bb 50 jmp 0x2a176 ; 0x2a176 0002a1d2 : } } static void lcd_LoadFilament() { preheat_or_continue(FilamentAction::Load); 2a1d2: 81 e0 ldi r24, 0x01 ; 1 2a1d4: 0d 94 bb 50 jmp 0x2a176 ; 0x2a176 0002a1d8 : MENU_END(); } static void lcd_unLoadFilament() { preheat_or_continue(FilamentAction::UnLoad); 2a1d8: 83 e0 ldi r24, 0x03 ; 3 2a1da: 0d 94 bb 50 jmp 0x2a176 ; 0x2a176 0002a1de : mFilamentItem(FARM_PREHEAT_HOTEND_TEMP, 0); } static void mFilamentItem_PLA() { bFilamentPreheatState = false; 2a1de: 10 92 63 06 sts 0x0663, r1 ; 0x800663 mFilamentItem(PLA_PREHEAT_HOTEND_TEMP, PLA_PREHEAT_HPB_TEMP); 2a1e2: 6c e3 ldi r22, 0x3C ; 60 2a1e4: 70 e0 ldi r23, 0x00 ; 0 2a1e6: 87 ed ldi r24, 0xD7 ; 215 2a1e8: 90 e0 ldi r25, 0x00 ; 0 2a1ea: 0d 94 a7 4f jmp 0x29f4e ; 0x29f4e 0002a1ee : } static void mFilamentItem_PET() { bFilamentPreheatState = false; 2a1ee: 10 92 63 06 sts 0x0663, r1 ; 0x800663 mFilamentItem(PET_PREHEAT_HOTEND_TEMP, PET_PREHEAT_HPB_TEMP); 2a1f2: 65 e5 ldi r22, 0x55 ; 85 2a1f4: 70 e0 ldi r23, 0x00 ; 0 2a1f6: 86 ee ldi r24, 0xE6 ; 230 2a1f8: 90 e0 ldi r25, 0x00 ; 0 2a1fa: 0d 94 a7 4f jmp 0x29f4e ; 0x29f4e 0002a1fe : } static void mFilamentItem_ASA() { bFilamentPreheatState = false; 2a1fe: 10 92 63 06 sts 0x0663, r1 ; 0x800663 mFilamentItem(ASA_PREHEAT_HOTEND_TEMP, ASA_PREHEAT_HPB_TEMP); 2a202: 69 e6 ldi r22, 0x69 ; 105 2a204: 70 e0 ldi r23, 0x00 ; 0 2a206: 84 e0 ldi r24, 0x04 ; 4 2a208: 91 e0 ldi r25, 0x01 ; 1 2a20a: 0d 94 a7 4f jmp 0x29f4e ; 0x29f4e 0002a20e : } static void mFilamentItem_PC() { bFilamentPreheatState = false; 2a20e: 10 92 63 06 sts 0x0663, r1 ; 0x800663 mFilamentItem(PC_PREHEAT_HOTEND_TEMP, PC_PREHEAT_HPB_TEMP); 2a212: 6e e6 ldi r22, 0x6E ; 110 2a214: 70 e0 ldi r23, 0x00 ; 0 2a216: 83 e1 ldi r24, 0x13 ; 19 2a218: 91 e0 ldi r25, 0x01 ; 1 2a21a: 0d 94 a7 4f jmp 0x29f4e ; 0x29f4e 0002a21e : mFilamentItem(FLEX_PREHEAT_HOTEND_TEMP, FLEX_PREHEAT_HPB_TEMP); } static void mFilamentItem_PVB() { bFilamentPreheatState = false; 2a21e: 10 92 63 06 sts 0x0663, r1 ; 0x800663 mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); 2a222: 6b e4 ldi r22, 0x4B ; 75 2a224: 70 e0 ldi r23, 0x00 ; 0 2a226: 87 ed ldi r24, 0xD7 ; 215 2a228: 90 e0 ldi r25, 0x00 ; 0 2a22a: 0d 94 a7 4f jmp 0x29f4e ; 0x29f4e 0002a22e : mFilamentItem(ABS_PREHEAT_HOTEND_TEMP, ABS_PREHEAT_HPB_TEMP); } static void mFilamentItem_PA() { bFilamentPreheatState = false; 2a22e: 10 92 63 06 sts 0x0663, r1 ; 0x800663 mFilamentItem(PA_PREHEAT_HOTEND_TEMP, PA_PREHEAT_HPB_TEMP); 2a232: 6a e5 ldi r22, 0x5A ; 90 2a234: 70 e0 ldi r23, 0x00 ; 0 2a236: 83 e1 ldi r24, 0x13 ; 19 2a238: 91 e0 ldi r25, 0x01 ; 1 2a23a: 0d 94 a7 4f jmp 0x29f4e ; 0x29f4e 0002a23e : mFilamentItem(PC_PREHEAT_HOTEND_TEMP, PC_PREHEAT_HPB_TEMP); } static void mFilamentItem_ABS() { bFilamentPreheatState = false; 2a23e: 10 92 63 06 sts 0x0663, r1 ; 0x800663 mFilamentItem(ABS_PREHEAT_HOTEND_TEMP, ABS_PREHEAT_HPB_TEMP); 2a242: 64 e6 ldi r22, 0x64 ; 100 2a244: 70 e0 ldi r23, 0x00 ; 0 2a246: 8f ef ldi r24, 0xFF ; 255 2a248: 90 e0 ldi r25, 0x00 ; 0 2a24a: 0d 94 a7 4f jmp 0x29f4e ; 0x29f4e 0002a24e : mFilamentItem(PA_PREHEAT_HOTEND_TEMP, PA_PREHEAT_HPB_TEMP); } static void mFilamentItem_HIPS() { bFilamentPreheatState = false; 2a24e: 10 92 63 06 sts 0x0663, r1 ; 0x800663 mFilamentItem(HIPS_PREHEAT_HOTEND_TEMP, HIPS_PREHEAT_HPB_TEMP); 2a252: 64 e6 ldi r22, 0x64 ; 100 2a254: 70 e0 ldi r23, 0x00 ; 0 2a256: 8c ed ldi r24, 0xDC ; 220 2a258: 90 e0 ldi r25, 0x00 ; 0 2a25a: 0d 94 a7 4f jmp 0x29f4e ; 0x29f4e 0002a25e : } static void mFilamentItem_PP() { bFilamentPreheatState = false; 2a25e: 10 92 63 06 sts 0x0663, r1 ; 0x800663 mFilamentItem(PP_PREHEAT_HOTEND_TEMP, PP_PREHEAT_HPB_TEMP); 2a262: 64 e6 ldi r22, 0x64 ; 100 2a264: 70 e0 ldi r23, 0x00 ; 0 2a266: 8e ef ldi r24, 0xFE ; 254 2a268: 90 e0 ldi r25, 0x00 ; 0 2a26a: 0d 94 a7 4f jmp 0x29f4e ; 0x29f4e 0002a26e : } static void mFilamentItem_FLEX() { bFilamentPreheatState = false; 2a26e: 10 92 63 06 sts 0x0663, r1 ; 0x800663 mFilamentItem(FLEX_PREHEAT_HOTEND_TEMP, FLEX_PREHEAT_HPB_TEMP); 2a272: 62 e3 ldi r22, 0x32 ; 50 2a274: 70 e0 ldi r23, 0x00 ; 0 2a276: 80 ef ldi r24, 0xF0 ; 240 2a278: 90 e0 ldi r25, 0x00 ; 0 2a27a: 0d 94 a7 4f jmp 0x29f4e ; 0x29f4e 0002a27e : } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 2a27e: 80 e0 ldi r24, 0x00 ; 0 2a280: 0f 94 07 4e call 0x29c0e ; 0x29c0e #include "xflash_dump.h" static void lcd_dump_memory() { lcd_beeper_quick_feedback(); xfdump_dump(); 2a284: 0e 94 ea ed call 0x1dbd4 ; 0x1dbd4 lcd_return_to_status(); 2a288: 0d 94 a6 1e jmp 0x23d4c ; 0x23d4c 0002a28c : } 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){ 2a28c: cf 92 push r12 2a28e: df 92 push r13 2a290: ef 92 push r14 2a292: ff 92 push r15 if (critical || eSoundMode != e_SOUND_MODE_SILENT) { 2a294: 41 11 cpse r20, r1 2a296: 04 c0 rjmp .+8 ; 0x2a2a0 2a298: 20 91 de 04 lds r18, 0x04DE ; 0x8004de 2a29c: 22 30 cpi r18, 0x02 ; 2 2a29e: d1 f0 breq .+52 ; 0x2a2d4 2a2a0: 9b 01 movw r18, r22 2a2a2: 6c 01 movw r12, r24 2a2a4: f1 2c mov r15, r1 2a2a6: e1 2c mov r14, r1 if(!tone_) { 2a2a8: 67 2b or r22, r23 2a2aa: c9 f4 brne .+50 ; 0x2a2de WRITE(BEEPER, HIGH); 2a2ac: 9f b7 in r25, 0x3f ; 63 2a2ae: f8 94 cli 2a2b0: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2a2b4: 84 60 ori r24, 0x04 ; 4 2a2b6: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2a2ba: 9f bf out 0x3f, r25 ; 63 _delay(ms); 2a2bc: c7 01 movw r24, r14 2a2be: b6 01 movw r22, r12 2a2c0: 0f 94 53 27 call 0x24ea6 ; 0x24ea6 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); 2a2c4: 9f b7 in r25, 0x3f ; 63 2a2c6: f8 94 cli 2a2c8: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2a2cc: 8b 7f andi r24, 0xFB ; 251 2a2ce: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2a2d2: 9f bf out 0x3f, r25 ; 63 _tone(BEEPER, tone_); _delay(ms); _noTone(BEEPER); } } } 2a2d4: ff 90 pop r15 2a2d6: ef 90 pop r14 2a2d8: df 90 pop r13 2a2da: cf 90 pop r12 2a2dc: 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); 2a2de: 22 0f add r18, r18 2a2e0: 33 1f adc r19, r19 2a2e2: 50 e0 ldi r21, 0x00 ; 0 2a2e4: 40 e0 ldi r20, 0x00 ; 0 2a2e6: 60 e0 ldi r22, 0x00 ; 0 2a2e8: 74 e2 ldi r23, 0x24 ; 36 2a2ea: 84 ef ldi r24, 0xF4 ; 244 2a2ec: 90 e0 ldi r25, 0x00 ; 0 2a2ee: 0f 94 0d dd call 0x3ba1a ; 0x3ba1a <__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; 2a2f2: 91 e0 ldi r25, 0x01 ; 1 uint32_t pwm_freq = F_CPU / (2 * frequency); if (pwm_freq > UINT16_MAX) { 2a2f4: 21 15 cp r18, r1 2a2f6: 31 05 cpc r19, r1 2a2f8: 81 e0 ldi r24, 0x01 ; 1 2a2fa: 48 07 cpc r20, r24 2a2fc: 51 05 cpc r21, r1 2a2fe: 44 f0 brlt .+16 ; 0x2a310 pwm_freq /= 64; // Increase prescaler to 64 2a300: 86 e0 ldi r24, 0x06 ; 6 2a302: 56 95 lsr r21 2a304: 47 95 ror r20 2a306: 37 95 ror r19 2a308: 27 95 ror r18 2a30a: 8a 95 dec r24 2a30c: d1 f7 brne .-12 ; 0x2a302 prescalarbits = 0b011; 2a30e: 93 e0 ldi r25, 0x03 ; 3 } uint16_t ocr = pwm_freq - 1; 2a310: 21 50 subi r18, 0x01 ; 1 2a312: 31 09 sbc r19, r1 CRITICAL_SECTION_START; 2a314: 4f b7 in r20, 0x3f ; 63 2a316: f8 94 cli // Set calcualted prescaler TCCR4B = (TCCR4B & 0b11111000) | prescalarbits; 2a318: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 2a31c: 88 7f andi r24, 0xF8 ; 248 2a31e: 89 2b or r24, r25 2a320: 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); 2a324: 60 91 ac 00 lds r22, 0x00AC ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 2a328: 70 91 ad 00 lds r23, 0x00AD ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 2a32c: 26 9f mul r18, r22 2a32e: c0 01 movw r24, r0 2a330: 27 9f mul r18, r23 2a332: 90 0d add r25, r0 2a334: 36 9f mul r19, r22 2a336: 90 0d add r25, r0 2a338: 11 24 eor r1, r1 2a33a: 50 91 72 00 lds r21, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 2a33e: 6f ef ldi r22, 0xFF ; 255 2a340: 70 e0 ldi r23, 0x00 ; 0 2a342: 51 ff sbrs r21, 1 2a344: 04 c0 rjmp .+8 ; 0x2a34e 2a346: 60 91 a8 00 lds r22, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 2a34a: 70 91 a9 00 lds r23, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 2a34e: 0f 94 e5 dc call 0x3b9ca ; 0x3b9ca <__udivmodhi4> 2a352: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 2a356: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> #endif //EXTRUDER_0_AUTO_FAN_PIN // Set calcualted ocr OCR4A = ocr; 2a35a: 30 93 a9 00 sts 0x00A9, r19 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 2a35e: 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); 2a362: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 2a366: 83 60 ori r24, 0x03 ; 3 2a368: 80 93 72 00 sts 0x0072, r24 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 2a36c: 4f bf out 0x3f, r20 ; 63 WRITE(BEEPER, HIGH); _delay(ms); WRITE(BEEPER, LOW); } else { _tone(BEEPER, tone_); _delay(ms); 2a36e: c7 01 movw r24, r14 2a370: b6 01 movw r22, r12 2a372: 0f 94 53 27 call 0x24ea6 ; 0x24ea6 } void noTone4(_UNUSED uint8_t _pin) { CRITICAL_SECTION_START; 2a376: 2f b7 in r18, 0x3f ; 63 2a378: f8 94 cli // Revert prescaler to CLK/1024 TCCR4B = (TCCR4B & 0b11111000) | _BV(CS42) | _BV(CS40); 2a37a: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 2a37e: 88 7f andi r24, 0xF8 ; 248 2a380: 85 60 ori r24, 0x05 ; 5 2a382: 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); 2a386: 40 91 ac 00 lds r20, 0x00AC ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 2a38a: 50 91 ad 00 lds r21, 0x00AD ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 2a38e: 3f ef ldi r19, 0xFF ; 255 2a390: 34 9f mul r19, r20 2a392: c0 01 movw r24, r0 2a394: 35 9f mul r19, r21 2a396: 90 0d add r25, r0 2a398: 11 24 eor r1, r1 2a39a: 30 91 72 00 lds r19, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 2a39e: 6f ef ldi r22, 0xFF ; 255 2a3a0: 70 e0 ldi r23, 0x00 ; 0 2a3a2: 31 ff sbrs r19, 1 2a3a4: 04 c0 rjmp .+8 ; 0x2a3ae 2a3a6: 60 91 a8 00 lds r22, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 2a3aa: 70 91 a9 00 lds r23, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 2a3ae: 0f 94 e5 dc call 0x3b9ca ; 0x3b9ca <__udivmodhi4> 2a3b2: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 2a3b6: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> #endif //EXTRUDER_0_AUTO_FAN_PIN OCR4A = 255U; 2a3ba: 8f ef ldi r24, 0xFF ; 255 2a3bc: 90 e0 ldi r25, 0x00 ; 0 2a3be: 90 93 a9 00 sts 0x00A9, r25 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 2a3c2: 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)); 2a3c6: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 2a3ca: 8c 7f andi r24, 0xFC ; 252 2a3cc: 80 93 72 00 sts 0x0072, r24 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 2a3d0: 2f bf out 0x3f, r18 ; 63 2a3d2: 78 cf rjmp .-272 ; 0x2a2c4 0002a3d4 : /// 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() { 2a3d4: cf 93 push r28 #if BEEPER > 0 if (eSoundMode == e_SOUND_MODE_SILENT) return; 2a3d6: c0 91 de 04 lds r28, 0x04DE ; 0x8004de 2a3da: c2 30 cpi r28, 0x02 ; 2 2a3dc: 59 f1 breq .+86 ; 0x2a434 // Handle case where only one beep is needed if (eSoundMode == e_SOUND_MODE_ONCE) { 2a3de: c1 30 cpi r28, 0x01 ; 1 2a3e0: 69 f4 brne .+26 ; 0x2a3fc if (bFirst) return; 2a3e2: 80 91 6e 05 lds r24, 0x056E ; 0x80056e <_ZL6bFirst.lto_priv.495> 2a3e6: 81 11 cpse r24, r1 2a3e8: 25 c0 rjmp .+74 ; 0x2a434 Sound_MakeCustom(80, 0, false); 2a3ea: 40 e0 ldi r20, 0x00 ; 0 2a3ec: 70 e0 ldi r23, 0x00 ; 0 2a3ee: 60 e0 ldi r22, 0x00 ; 0 2a3f0: 80 e5 ldi r24, 0x50 ; 80 2a3f2: 90 e0 ldi r25, 0x00 ; 0 2a3f4: 0f 94 46 51 call 0x2a28c ; 0x2a28c bFirst = true; 2a3f8: c0 93 6e 05 sts 0x056E, r28 ; 0x80056e <_ZL6bFirst.lto_priv.495> } // Handle case where there should be continous beeps if (beep_timer.expired_cont(CONTINOUS_BEEP_PERIOD)) { 2a3fc: 60 ed ldi r22, 0xD0 ; 208 2a3fe: 77 e0 ldi r23, 0x07 ; 7 2a400: 8b e6 ldi r24, 0x6B ; 107 2a402: 95 e0 ldi r25, 0x05 ; 5 2a404: 0f 94 a6 29 call 0x2534c ; 0x2534c ::expired_cont(unsigned short)> 2a408: 88 23 and r24, r24 2a40a: a1 f0 breq .+40 ; 0x2a434 beep_timer.start(); 2a40c: 8b e6 ldi r24, 0x6B ; 107 2a40e: 95 e0 ldi r25, 0x05 ; 5 2a410: 0f 94 ad 29 call 0x2535a ; 0x2535a ::start()> if (eSoundMode == e_SOUND_MODE_LOUD) { 2a414: 80 91 de 04 lds r24, 0x04DE ; 0x8004de 2a418: 81 11 cpse r24, r1 2a41a: 08 c0 rjmp .+16 ; 0x2a42c Sound_MakeCustom(80, 0, false); 2a41c: 40 e0 ldi r20, 0x00 ; 0 2a41e: 70 e0 ldi r23, 0x00 ; 0 2a420: 60 e0 ldi r22, 0x00 ; 0 2a422: 80 e5 ldi r24, 0x50 ; 80 2a424: 90 e0 ldi r25, 0x00 ; 0 // Assist (lower volume sound) Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); } } #endif // BEEPER > 0 } 2a426: 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); 2a428: 0d 94 46 51 jmp 0x2a28c ; 0x2a28c } else { // Assist (lower volume sound) Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 2a42c: 80 e0 ldi r24, 0x00 ; 0 } } #endif // BEEPER > 0 } 2a42e: 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); 2a430: 0d 94 07 4e jmp 0x29c0e ; 0x29c0e } } #endif // BEEPER > 0 } 2a434: cf 91 pop r28 2a436: 08 95 ret 0002a438 : sm4_calc_delay_cb_t sm4_calc_delay_cb = 0; void sm4_set_dir(uint8_t axis, uint8_t dir) { switch (axis) 2a438: 82 30 cpi r24, 0x02 ; 2 2a43a: b9 f0 breq .+46 ; 0x2a46a 2a43c: 83 30 cpi r24, 0x03 ; 3 2a43e: e9 f0 breq .+58 ; 0x2a47a 2a440: 81 30 cpi r24, 0x01 ; 1 2a442: 59 f0 breq .+22 ; 0x2a45a 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; 2a444: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2a448: 61 30 cpi r22, 0x01 ; 1 2a44a: 29 f4 brne .+10 ; 0x2a456 2a44c: 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; 2a44e: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> #endif } asm("nop"); 2a452: 00 00 nop } 2a454: 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; 2a456: 8e 7f andi r24, 0xFE ; 254 2a458: fa cf rjmp .-12 ; 0x2a44e case 1: if (dir == INVERT_Y_DIR) PORTL |= 2; else PORTL &= ~2; break; 2a45a: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2a45e: 61 11 cpse r22, r1 2a460: 02 c0 rjmp .+4 ; 0x2a466 2a462: 82 60 ori r24, 0x02 ; 2 2a464: f4 cf rjmp .-24 ; 0x2a44e 2a466: 8d 7f andi r24, 0xFD ; 253 2a468: f2 cf rjmp .-28 ; 0x2a44e case 2: if (dir == INVERT_Z_DIR) PORTL |= 4; else PORTL &= ~4; break; 2a46a: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2a46e: 61 30 cpi r22, 0x01 ; 1 2a470: 11 f4 brne .+4 ; 0x2a476 2a472: 84 60 ori r24, 0x04 ; 4 2a474: ec cf rjmp .-40 ; 0x2a44e 2a476: 8b 7f andi r24, 0xFB ; 251 2a478: ea cf rjmp .-44 ; 0x2a44e case 3: if (dir == INVERT_E0_DIR) PORTL |= 64; else PORTL &= ~64; break; 2a47a: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2a47e: 61 11 cpse r22, r1 2a480: 02 c0 rjmp .+4 ; 0x2a486 2a482: 80 64 ori r24, 0x40 ; 64 2a484: e4 cf rjmp .-56 ; 0x2a44e 2a486: 8f 7b andi r24, 0xBF ; 191 2a488: e2 cf rjmp .-60 ; 0x2a44e 0002a48a : buf[nbyte] = SPDR; } //------------------------------------------------------------------------------ /** SPI send a byte */ static void spiSend(uint8_t b) { SPDR = b; 2a48a: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2a48c: 0d b4 in r0, 0x2d ; 45 2a48e: 07 fe sbrs r0, 7 2a490: fd cf rjmp .-6 ; 0x2a48c } 2a492: 08 95 ret 0002a494 : SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; } //------------------------------------------------------------------------------ /** SPI receive a byte */ static uint8_t spiRec() { SPDR = 0XFF; 2a494: 8f ef ldi r24, 0xFF ; 255 2a496: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2a498: 0d b4 in r0, 0x2d ; 45 2a49a: 07 fe sbrs r0, 7 2a49c: fd cf rjmp .-6 ; 0x2a498 return SPDR; 2a49e: 8e b5 in r24, 0x2e ; 46 } 2a4a0: 08 95 ret 0002a4a2 : } } #endif // SOFTWARE_SPI //------------------------------------------------------------------------------ // send command and return error code. Return zero for OK uint8_t Sd2Card::cardCommand(uint8_t cmd, uint32_t arg) { 2a4a2: 8f 92 push r8 2a4a4: 9f 92 push r9 2a4a6: af 92 push r10 2a4a8: bf 92 push r11 2a4aa: ef 92 push r14 2a4ac: ff 92 push r15 2a4ae: 0f 93 push r16 2a4b0: 1f 93 push r17 2a4b2: cf 93 push r28 2a4b4: 7c 01 movw r14, r24 2a4b6: c6 2f mov r28, r22 2a4b8: 49 01 movw r8, r18 2a4ba: 5a 01 movw r10, r20 WRITE(SDSS, 1); } //------------------------------------------------------------------------------ void Sd2Card::chipSelectLow() { #ifndef SOFTWARE_SPI spiInit(spiRate_); 2a4bc: fc 01 movw r30, r24 2a4be: 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); 2a4c0: 89 2f mov r24, r25 2a4c2: 80 6a ori r24, 0xA0 ; 160 2a4c4: 86 95 lsr r24 2a4c6: 8c bd out 0x2c, r24 ; 44 SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; 2a4c8: 90 fd sbrc r25, 0 2a4ca: 03 c0 rjmp .+6 ; 0x2a4d2 2a4cc: 81 e0 ldi r24, 0x01 ; 1 2a4ce: 96 30 cpi r25, 0x06 ; 6 2a4d0: 09 f4 brne .+2 ; 0x2a4d4 2a4d2: 80 e0 ldi r24, 0x00 ; 0 2a4d4: 8d bd out 0x2d, r24 ; 45 //------------------------------------------------------------------------------ void Sd2Card::chipSelectLow() { #ifndef SOFTWARE_SPI spiInit(spiRate_); #endif // SOFTWARE_SPI WRITE(SDSS, 0); 2a4d6: 9f b7 in r25, 0x3f ; 63 2a4d8: f8 94 cli 2a4da: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 2a4de: 8f 7b andi r24, 0xBF ; 191 2a4e0: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 2a4e4: 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); 2a4e6: 8c e2 ldi r24, 0x2C ; 44 2a4e8: 91 e0 ldi r25, 0x01 ; 1 2a4ea: 0f 94 c8 74 call 0x2e990 ; 0x2e990 // send command spiSend(cmd | 0x40); 2a4ee: 8c 2f mov r24, r28 2a4f0: 80 64 ori r24, 0x40 ; 64 2a4f2: 0f 94 45 52 call 0x2a48a ; 0x2a48a 2a4f6: 08 e1 ldi r16, 0x18 ; 24 2a4f8: 10 e0 ldi r17, 0x00 ; 0 // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); 2a4fa: d5 01 movw r26, r10 2a4fc: c4 01 movw r24, r8 2a4fe: 00 2e mov r0, r16 2a500: 04 c0 rjmp .+8 ; 0x2a50a 2a502: b6 95 lsr r27 2a504: a7 95 ror r26 2a506: 97 95 ror r25 2a508: 87 95 ror r24 2a50a: 0a 94 dec r0 2a50c: d2 f7 brpl .-12 ; 0x2a502 2a50e: 0f 94 45 52 call 0x2a48a ; 0x2a48a 2a512: 08 50 subi r16, 0x08 ; 8 2a514: 11 09 sbc r17, r1 2a516: 08 3f cpi r16, 0xF8 ; 248 2a518: ff ef ldi r31, 0xFF ; 255 2a51a: 1f 07 cpc r17, r31 2a51c: 71 f7 brne .-36 ; 0x2a4fa // send CRC uint8_t crc = 0XFF; if (cmd == CMD0) crc = 0X95; // correct crc for CMD0 with arg 0 2a51e: 85 e9 ldi r24, 0x95 ; 149 2a520: cc 23 and r28, r28 2a522: 21 f0 breq .+8 ; 0x2a52c if (cmd == CMD8) crc = 0X87; // correct crc for CMD8 with arg 0X1AA 2a524: 87 e8 ldi r24, 0x87 ; 135 2a526: c8 30 cpi r28, 0x08 ; 8 2a528: 09 f0 breq .+2 ; 0x2a52c // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); // send CRC uint8_t crc = 0XFF; 2a52a: 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); 2a52c: 0f 94 45 52 call 0x2a48a ; 0x2a48a // skip stuff byte for stop read if (cmd == CMD12) spiRec(); 2a530: cc 30 cpi r28, 0x0C ; 12 2a532: 11 f4 brne .+4 ; 0x2a538 2a534: 0f 94 4a 52 call 0x2a494 ; 0x2a494 // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); // send CRC uint8_t crc = 0XFF; 2a538: 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 */ } 2a53a: 0f 94 4a 52 call 0x2a494 ; 0x2a494 2a53e: f7 01 movw r30, r14 2a540: 82 83 std Z+2, r24 ; 0x02 2a542: 87 ff sbrs r24, 7 2a544: 04 c0 rjmp .+8 ; 0x2a54e 2a546: cf 3f cpi r28, 0xFF ; 255 2a548: 11 f0 breq .+4 ; 0x2a54e 2a54a: cf 5f subi r28, 0xFF ; 255 2a54c: f6 cf rjmp .-20 ; 0x2a53a return status_; } 2a54e: cf 91 pop r28 2a550: 1f 91 pop r17 2a552: 0f 91 pop r16 2a554: ff 90 pop r15 2a556: ef 90 pop r14 2a558: bf 90 pop r11 2a55a: af 90 pop r10 2a55c: 9f 90 pop r9 2a55e: 8f 90 pop r8 2a560: 08 95 ret 0002a562 : * \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) { 2a562: 0f 93 push r16 2a564: 1f 93 push r17 2a566: cf 93 push r28 2a568: df 93 push r29 2a56a: ec 01 movw r28, r24 2a56c: 89 01 movw r16, r18 // use address if not SDHC card if (type() != SD_CARD_TYPE_SDHC) blockNumber <<= 9; 2a56e: 8b 81 ldd r24, Y+3 ; 0x03 2a570: 83 30 cpi r24, 0x03 ; 3 2a572: 39 f0 breq .+14 ; 0x2a582 2a574: 89 e0 ldi r24, 0x09 ; 9 2a576: 44 0f add r20, r20 2a578: 55 1f adc r21, r21 2a57a: 66 1f adc r22, r22 2a57c: 77 1f adc r23, r23 2a57e: 8a 95 dec r24 2a580: d1 f7 brne .-12 ; 0x2a576 if (cardCommand(CMD24, blockNumber)) { 2a582: 9a 01 movw r18, r20 2a584: ab 01 movw r20, r22 2a586: 68 e1 ldi r22, 0x18 ; 24 2a588: ce 01 movw r24, r28 2a58a: 0f 94 51 52 call 0x2a4a2 ; 0x2a4a2 2a58e: 88 23 and r24, r24 2a590: 19 f0 breq .+6 ; 0x2a598 bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 2a592: 86 e0 ldi r24, 0x06 ; 6 2a594: 88 83 st Y, r24 2a596: 39 c0 rjmp .+114 ; 0x2a60a } //------------------------------------------------------------------------------ /** 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; 2a598: 8e ef ldi r24, 0xFE ; 254 2a59a: 8e bd out 0x2e, r24 ; 46 2a59c: f8 01 movw r30, r16 2a59e: c8 01 movw r24, r16 2a5a0: 9e 5f subi r25, 0xFE ; 254 for (uint16_t i = 0; i < 512; i += 2) { while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2a5a2: 0d b4 in r0, 0x2d ; 45 2a5a4: 07 fe sbrs r0, 7 2a5a6: fd cf rjmp .-6 ; 0x2a5a2 SPDR = buf[i]; 2a5a8: 20 81 ld r18, Z 2a5aa: 2e bd out 0x2e, r18 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2a5ac: 0d b4 in r0, 0x2d ; 45 2a5ae: 07 fe sbrs r0, 7 2a5b0: fd cf rjmp .-6 ; 0x2a5ac SPDR = buf[i + 1]; 2a5b2: 21 81 ldd r18, Z+1 ; 0x01 2a5b4: 2e bd out 0x2e, r18 ; 46 2a5b6: 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) { 2a5b8: e8 17 cp r30, r24 2a5ba: f9 07 cpc r31, r25 2a5bc: 91 f7 brne .-28 ; 0x2a5a2 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 */ } 2a5be: 0d b4 in r0, 0x2d ; 45 2a5c0: 07 fe sbrs r0, 7 2a5c2: fd cf rjmp .-6 ; 0x2a5be //------------------------------------------------------------------------------ // 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 2a5c4: 8f ef ldi r24, 0xFF ; 255 2a5c6: 0f 94 45 52 call 0x2a48a ; 0x2a48a spiSend(0xff); // dummy crc 2a5ca: 8f ef ldi r24, 0xFF ; 255 2a5cc: 0f 94 45 52 call 0x2a48a ; 0x2a48a status_ = spiRec(); 2a5d0: 0f 94 4a 52 call 0x2a494 ; 0x2a494 2a5d4: 8a 83 std Y+2, r24 ; 0x02 if ((status_ & DATA_RES_MASK) != DATA_RES_ACCEPTED) { 2a5d6: 8f 71 andi r24, 0x1F ; 31 2a5d8: 85 30 cpi r24, 0x05 ; 5 2a5da: 99 f4 brne .+38 ; 0x2a602 goto fail; } if (!writeData(DATA_START_BLOCK, src)) goto fail; // wait for flash programming to complete if (!waitNotBusy(SD_WRITE_TIMEOUT)) { 2a5dc: 88 e5 ldi r24, 0x58 ; 88 2a5de: 92 e0 ldi r25, 0x02 ; 2 2a5e0: 0f 94 c8 74 call 0x2e990 ; 0x2e990 2a5e4: 18 2f mov r17, r24 2a5e6: 87 e1 ldi r24, 0x17 ; 23 2a5e8: 11 23 and r17, r17 2a5ea: a1 f2 breq .-88 ; 0x2a594 error(SD_CARD_ERROR_WRITE_TIMEOUT); goto fail; } // response is r2 so get and check two bytes for nonzero if (cardCommand(CMD13, 0) || spiRec()) { 2a5ec: 20 e0 ldi r18, 0x00 ; 0 2a5ee: 30 e0 ldi r19, 0x00 ; 0 2a5f0: a9 01 movw r20, r18 2a5f2: 6d e0 ldi r22, 0x0D ; 13 2a5f4: ce 01 movw r24, r28 2a5f6: 0f 94 51 52 call 0x2a4a2 ; 0x2a4a2 2a5fa: 88 23 and r24, r24 2a5fc: 51 f0 breq .+20 ; 0x2a612 2a5fe: 86 e1 ldi r24, 0x16 ; 22 2a600: c9 cf rjmp .-110 ; 0x2a594 2a602: 83 e1 ldi r24, 0x13 ; 19 2a604: 88 83 st Y, r24 goto fail; } return true; fail: chipSelectHigh(); 2a606: 0f 94 bf 74 call 0x2e97e ; 0x2e97e } chipSelectHigh(); return true; fail: chipSelectHigh(); 2a60a: 0f 94 bf 74 call 0x2e97e ; 0x2e97e return false; 2a60e: 10 e0 ldi r17, 0x00 ; 0 2a610: 06 c0 rjmp .+12 ; 0x2a61e 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()) { 2a612: 0f 94 4a 52 call 0x2a494 ; 0x2a494 2a616: 81 11 cpse r24, r1 2a618: f2 cf rjmp .-28 ; 0x2a5fe error(SD_CARD_ERROR_WRITE_PROGRAMMING); goto fail; } chipSelectHigh(); 2a61a: 0f 94 bf 74 call 0x2e97e ; 0x2e97e return true; fail: chipSelectHigh(); return false; } 2a61e: 81 2f mov r24, r17 2a620: df 91 pop r29 2a622: cf 91 pop r28 2a624: 1f 91 pop r17 2a626: 0f 91 pop r16 2a628: 08 95 ret 0002a62a : fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheFlush() { 2a62a: cf 93 push r28 if (cacheDirty_) { 2a62c: 80 91 99 0e lds r24, 0x0E99 ; 0x800e99 } cacheMirrorBlock_ = 0; } cacheDirty_ = 0; } return true; 2a630: c1 e0 ldi r28, 0x01 ; 1 fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheFlush() { if (cacheDirty_) { 2a632: 88 23 and r24, r24 2a634: a1 f0 breq .+40 ; 0x2a65e if (!sdCard_->writeBlock(cacheBlockNumber_, cacheBuffer_.data)) { 2a636: 40 91 91 0e lds r20, 0x0E91 ; 0x800e91 2a63a: 50 91 92 0e lds r21, 0x0E92 ; 0x800e92 2a63e: 60 91 93 0e lds r22, 0x0E93 ; 0x800e93 2a642: 70 91 94 0e lds r23, 0x0E94 ; 0x800e94 2a646: 2d e9 ldi r18, 0x9D ; 157 2a648: 3e e0 ldi r19, 0x0E ; 14 2a64a: 80 91 9a 0e lds r24, 0x0E9A ; 0x800e9a 2a64e: 90 91 9b 0e lds r25, 0x0E9B ; 0x800e9b 2a652: 0f 94 b1 52 call 0x2a562 ; 0x2a562 2a656: c8 2f mov r28, r24 2a658: 81 11 cpse r24, r1 2a65a: 04 c0 rjmp .+8 ; 0x2a664 cacheDirty_ = 0; } return true; fail: return false; 2a65c: c0 e0 ldi r28, 0x00 ; 0 } 2a65e: 8c 2f mov r24, r28 2a660: cf 91 pop r28 2a662: 08 95 ret if (cacheDirty_) { if (!sdCard_->writeBlock(cacheBlockNumber_, cacheBuffer_.data)) { goto fail; } // mirror FAT tables if (cacheMirrorBlock_) { 2a664: 40 91 95 0e lds r20, 0x0E95 ; 0x800e95 2a668: 50 91 96 0e lds r21, 0x0E96 ; 0x800e96 2a66c: 60 91 97 0e lds r22, 0x0E97 ; 0x800e97 2a670: 70 91 98 0e lds r23, 0x0E98 ; 0x800e98 2a674: 41 15 cp r20, r1 2a676: 51 05 cpc r21, r1 2a678: 61 05 cpc r22, r1 2a67a: 71 05 cpc r23, r1 2a67c: 91 f0 breq .+36 ; 0x2a6a2 if (!sdCard_->writeBlock(cacheMirrorBlock_, cacheBuffer_.data)) { 2a67e: 2d e9 ldi r18, 0x9D ; 157 2a680: 3e e0 ldi r19, 0x0E ; 14 2a682: 80 91 9a 0e lds r24, 0x0E9A ; 0x800e9a 2a686: 90 91 9b 0e lds r25, 0x0E9B ; 0x800e9b 2a68a: 0f 94 b1 52 call 0x2a562 ; 0x2a562 2a68e: 88 23 and r24, r24 2a690: 29 f3 breq .-54 ; 0x2a65c goto fail; } cacheMirrorBlock_ = 0; 2a692: 10 92 95 0e sts 0x0E95, r1 ; 0x800e95 2a696: 10 92 96 0e sts 0x0E96, r1 ; 0x800e96 2a69a: 10 92 97 0e sts 0x0E97, r1 ; 0x800e97 2a69e: 10 92 98 0e sts 0x0E98, r1 ; 0x800e98 } cacheDirty_ = 0; 2a6a2: 10 92 99 0e sts 0x0E99, r1 ; 0x800e99 2a6a6: db cf rjmp .-74 ; 0x2a65e 0002a6a8 : * \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) { 2a6a8: 2f 92 push r2 2a6aa: 3f 92 push r3 2a6ac: 4f 92 push r4 2a6ae: 5f 92 push r5 2a6b0: 6f 92 push r6 2a6b2: 7f 92 push r7 2a6b4: 8f 92 push r8 2a6b6: 9f 92 push r9 2a6b8: af 92 push r10 2a6ba: bf 92 push r11 2a6bc: cf 92 push r12 2a6be: df 92 push r13 2a6c0: ef 92 push r14 2a6c2: ff 92 push r15 2a6c4: 0f 93 push r16 2a6c6: 1f 93 push r17 2a6c8: cf 93 push r28 2a6ca: df 93 push r29 2a6cc: ec 01 movw r28, r24 2a6ce: 2a 01 movw r4, r20 2a6d0: 3b 01 movw r6, r22 2a6d2: 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; 2a6d4: 8b 81 ldd r24, Y+3 ; 0x03 2a6d6: 83 30 cpi r24, 0x03 ; 3 2a6d8: 39 f0 breq .+14 ; 0x2a6e8 2a6da: 69 e0 ldi r22, 0x09 ; 9 2a6dc: 44 0c add r4, r4 2a6de: 55 1c adc r5, r5 2a6e0: 66 1c adc r6, r6 2a6e2: 77 1c adc r7, r7 2a6e4: 6a 95 dec r22 2a6e6: d1 f7 brne .-12 ; 0x2a6dc retry2: 2a6e8: 43 e0 ldi r20, 0x03 ; 3 2a6ea: 94 2e mov r9, r20 2a6ec: 56 01 movw r10, r12 2a6ee: 81 e0 ldi r24, 0x01 ; 1 2a6f0: a8 1a sub r10, r24 2a6f2: 8e ef ldi r24, 0xFE ; 254 2a6f4: b8 0a sbc r11, r24 2a6f6: 16 01 movw r2, r12 2a6f8: ee ef ldi r30, 0xFE ; 254 2a6fa: 3e 1a sub r3, r30 2a6fc: 54 e0 ldi r21, 0x04 ; 4 2a6fe: 85 2e mov r8, r21 retryCnt --; 2a700: 9a 94 dec r9 if (cardCommand(CMD17, blockNumber)) { 2a702: a3 01 movw r20, r6 2a704: 92 01 movw r18, r4 2a706: 61 e1 ldi r22, 0x11 ; 17 2a708: ce 01 movw r24, r28 2a70a: 0f 94 51 52 call 0x2a4a2 ; 0x2a4a2 2a70e: 88 23 and r24, r24 2a710: 79 f0 breq .+30 ; 0x2a730 2a712: 88 82 st Y, r8 error(SD_CARD_ERROR_CMD17); if (retryCnt > 0) goto retry; 2a714: 99 20 and r9, r9 2a716: 09 f4 brne .+2 ; 0x2a71a 2a718: 7a c0 rjmp .+244 ; 0x2a80e if (retryCnt > 0) goto retry; goto fail; } return true; retry: chipSelectHigh(); 2a71a: 0f 94 bf 74 call 0x2e97e ; 0x2e97e cardCommand(CMD12, 0);//Try sending a stop command, but ignore the result. 2a71e: 20 e0 ldi r18, 0x00 ; 0 2a720: 30 e0 ldi r19, 0x00 ; 0 2a722: a9 01 movw r20, r18 2a724: 6c e0 ldi r22, 0x0C ; 12 2a726: ce 01 movw r24, r28 2a728: 0f 94 51 52 call 0x2a4a2 ; 0x2a4a2 errorCode_ = 0; 2a72c: 18 82 st Y, r1 2a72e: e8 cf rjmp .-48 ; 0x2a700 #endif //------------------------------------------------------------------------------ bool Sd2Card::readData(uint8_t* dst, uint16_t count) { // wait for start block token uint16_t t0 = _millis(); 2a730: 0f 94 4c 29 call 0x25298 ; 0x25298 2a734: 8b 01 movw r16, r22 while ((status_ = spiRec()) == 0XFF) { 2a736: 0f 94 4a 52 call 0x2a494 ; 0x2a494 2a73a: 8a 83 std Y+2, r24 ; 0x02 2a73c: 8f 3f cpi r24, 0xFF ; 255 2a73e: 91 f4 brne .+36 ; 0x2a764 if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { 2a740: 0f 94 4c 29 call 0x25298 ; 0x25298 2a744: 60 1b sub r22, r16 2a746: 71 0b sbc r23, r17 2a748: 6d 32 cpi r22, 0x2D ; 45 2a74a: 71 40 sbci r23, 0x01 ; 1 2a74c: a0 f3 brcs .-24 ; 0x2a736 2a74e: 81 e1 ldi r24, 0x11 ; 17 2a750: 88 83 st Y, r24 if (flash_air_compatible_) spiSend(0XFF); return true; fail: chipSelectHigh(); 2a752: 0f 94 bf 74 call 0x2e97e ; 0x2e97e // Toshiba FlashAir Patch. Purge pending status byte. if (flash_air_compatible_) 2a756: 8c 81 ldd r24, Y+4 ; 0x04 2a758: 88 23 and r24, r24 2a75a: e1 f2 breq .-72 ; 0x2a714 spiSend(0XFF); 2a75c: 8f ef ldi r24, 0xFF ; 255 2a75e: 0f 94 45 52 call 0x2a48a ; 0x2a48a 2a762: d8 cf rjmp .-80 ; 0x2a714 if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { error(SD_CARD_ERROR_READ_TIMEOUT); goto fail; } } if (status_ != DATA_START_BLOCK) { 2a764: 8e 3f cpi r24, 0xFE ; 254 2a766: 11 f0 breq .+4 ; 0x2a76c 2a768: 8f e0 ldi r24, 0x0F ; 15 2a76a: f2 cf rjmp .-28 ; 0x2a750 //------------------------------------------------------------------------------ /** 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; 2a76c: 8f ef ldi r24, 0xFF ; 255 2a76e: 8e bd out 0x2e, r24 ; 46 2a770: d6 01 movw r26, r12 2a772: f6 01 movw r30, r12 for (uint16_t i = 0; i < nbyte; i++) { while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2a774: 0d b4 in r0, 0x2d ; 45 2a776: 07 fe sbrs r0, 7 2a778: fd cf rjmp .-6 ; 0x2a774 buf[i] = SPDR; 2a77a: 9e b5 in r25, 0x2e ; 46 2a77c: 91 93 st Z+, r25 SPDR = 0XFF; 2a77e: 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++) { 2a780: ea 15 cp r30, r10 2a782: fb 05 cpc r31, r11 2a784: b9 f7 brne .-18 ; 0x2a774 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } buf[i] = SPDR; SPDR = 0XFF; } while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2a786: 0d b4 in r0, 0x2d ; 45 2a788: 07 fe sbrs r0, 7 2a78a: fd cf rjmp .-6 ; 0x2a786 buf[nbyte] = SPDR; 2a78c: 8e b5 in r24, 0x2e ; 46 2a78e: f5 01 movw r30, r10 2a790: 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; 2a792: f1 2c mov r15, r1 2a794: 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); 2a796: 8d 91 ld r24, X+ 2a798: ef 2d mov r30, r15 2a79a: ff 27 eor r31, r31 2a79c: e8 27 eor r30, r24 2a79e: ee 0f add r30, r30 2a7a0: ff 1f adc r31, r31 2a7a2: e3 5b subi r30, 0xB3 ; 179 2a7a4: ff 46 sbci r31, 0x6F ; 111 2a7a6: 85 91 lpm r24, Z+ 2a7a8: 94 91 lpm r25, Z 2a7aa: fe 2c mov r15, r14 2a7ac: ee 24 eor r14, r14 2a7ae: e8 26 eor r14, r24 2a7b0: 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++) { 2a7b2: 2a 16 cp r2, r26 2a7b4: 3b 06 cpc r3, r27 2a7b6: 79 f7 brne .-34 ; 0x2a796 spiRead(dst, count); #ifdef SD_CHECK_AND_RETRY { uint16_t calcCrc = CRC_CCITT(dst, count); uint16_t recvCrc = spiRec() << 8; 2a7b8: 0f 94 4a 52 call 0x2a494 ; 0x2a494 2a7bc: 08 2f mov r16, r24 2a7be: 10 e0 ldi r17, 0x00 ; 0 2a7c0: 10 2f mov r17, r16 2a7c2: 00 27 eor r16, r16 recvCrc |= spiRec(); 2a7c4: 0f 94 4a 52 call 0x2a494 ; 0x2a494 2a7c8: 08 2b or r16, r24 if (calcCrc != recvCrc) 2a7ca: 0e 15 cp r16, r14 2a7cc: 1f 05 cpc r17, r15 2a7ce: 19 f0 breq .+6 ; 0x2a7d6 2a7d0: f0 e2 ldi r31, 0x20 ; 32 2a7d2: f8 83 st Y, r31 2a7d4: be cf rjmp .-132 ; 0x2a752 #else // discard CRC spiRec(); spiRec(); #endif chipSelectHigh(); 2a7d6: 0f 94 bf 74 call 0x2e97e ; 0x2e97e // Toshiba FlashAir Patch. Purge pending status byte. if (flash_air_compatible_) 2a7da: cc 81 ldd r28, Y+4 ; 0x04 2a7dc: cc 23 and r28, r28 2a7de: d9 f0 breq .+54 ; 0x2a816 spiSend(0XFF); 2a7e0: 8f ef ldi r24, 0xFF ; 255 2a7e2: 0f 94 45 52 call 0x2a48a ; 0x2a48a #endif fail: chipSelectHigh(); return false; } 2a7e6: 8c 2f mov r24, r28 2a7e8: df 91 pop r29 2a7ea: cf 91 pop r28 2a7ec: 1f 91 pop r17 2a7ee: 0f 91 pop r16 2a7f0: ff 90 pop r15 2a7f2: ef 90 pop r14 2a7f4: df 90 pop r13 2a7f6: cf 90 pop r12 2a7f8: bf 90 pop r11 2a7fa: af 90 pop r10 2a7fc: 9f 90 pop r9 2a7fe: 8f 90 pop r8 2a800: 7f 90 pop r7 2a802: 6f 90 pop r6 2a804: 5f 90 pop r5 2a806: 4f 90 pop r4 2a808: 3f 90 pop r3 2a80a: 2f 90 pop r2 2a80c: 08 95 ret } return readData(dst, 512); #endif fail: chipSelectHigh(); 2a80e: 0f 94 bf 74 call 0x2e97e ; 0x2e97e return false; 2a812: c0 e0 ldi r28, 0x00 ; 0 2a814: e8 cf rjmp .-48 ; 0x2a7e6 if (!readData(dst, 512)) { if (retryCnt > 0) goto retry; goto fail; } return true; 2a816: c1 e0 ldi r28, 0x01 ; 1 2a818: e6 cf rjmp .-52 ; 0x2a7e6 0002a81a : fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheRawBlock(uint32_t blockNumber, bool dirty) { 2a81a: cf 92 push r12 2a81c: df 92 push r13 2a81e: ef 92 push r14 2a820: ff 92 push r15 2a822: cf 93 push r28 2a824: 6b 01 movw r12, r22 2a826: 7c 01 movw r14, r24 2a828: c4 2f mov r28, r20 if (cacheBlockNumber_ != blockNumber) { 2a82a: 80 91 91 0e lds r24, 0x0E91 ; 0x800e91 2a82e: 90 91 92 0e lds r25, 0x0E92 ; 0x800e92 2a832: a0 91 93 0e lds r26, 0x0E93 ; 0x800e93 2a836: b0 91 94 0e lds r27, 0x0E94 ; 0x800e94 2a83a: 8c 15 cp r24, r12 2a83c: 9d 05 cpc r25, r13 2a83e: ae 05 cpc r26, r14 2a840: bf 05 cpc r27, r15 2a842: 01 f1 breq .+64 ; 0x2a884 if (!cacheFlush()) goto fail; 2a844: 0f 94 15 53 call 0x2a62a ; 0x2a62a 2a848: 81 11 cpse r24, r1 2a84a: 08 c0 rjmp .+16 ; 0x2a85c } if (dirty) cacheDirty_ = true; return true; fail: return false; 2a84c: c0 e0 ldi r28, 0x00 ; 0 } 2a84e: 8c 2f mov r24, r28 2a850: cf 91 pop r28 2a852: ff 90 pop r15 2a854: ef 90 pop r14 2a856: df 90 pop r13 2a858: cf 90 pop r12 2a85a: 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; 2a85c: 2d e9 ldi r18, 0x9D ; 157 2a85e: 3e e0 ldi r19, 0x0E ; 14 2a860: b7 01 movw r22, r14 2a862: a6 01 movw r20, r12 2a864: 80 91 9a 0e lds r24, 0x0E9A ; 0x800e9a 2a868: 90 91 9b 0e lds r25, 0x0E9B ; 0x800e9b 2a86c: 0f 94 54 53 call 0x2a6a8 ; 0x2a6a8 2a870: 88 23 and r24, r24 2a872: 61 f3 breq .-40 ; 0x2a84c cacheBlockNumber_ = blockNumber; 2a874: c0 92 91 0e sts 0x0E91, r12 ; 0x800e91 2a878: d0 92 92 0e sts 0x0E92, r13 ; 0x800e92 2a87c: e0 92 93 0e sts 0x0E93, r14 ; 0x800e93 2a880: f0 92 94 0e sts 0x0E94, r15 ; 0x800e94 } if (dirty) cacheDirty_ = true; 2a884: cc 23 and r28, r28 2a886: 21 f0 breq .+8 ; 0x2a890 2a888: 81 e0 ldi r24, 0x01 ; 1 2a88a: 80 93 99 0e sts 0x0E99, r24 ; 0x800e99 2a88e: df cf rjmp .-66 ; 0x2a84e return true; 2a890: c1 e0 ldi r28, 0x01 ; 1 2a892: dd cf rjmp .-70 ; 0x2a84e 0002a894 : fail: return false; } //------------------------------------------------------------------------------ // Store a FAT entry bool SdVolume::fatPut(uint32_t cluster, uint32_t value) { 2a894: 4f 92 push r4 2a896: 5f 92 push r5 2a898: 6f 92 push r6 2a89a: 7f 92 push r7 2a89c: 8f 92 push r8 2a89e: 9f 92 push r9 2a8a0: af 92 push r10 2a8a2: bf 92 push r11 2a8a4: cf 92 push r12 2a8a6: df 92 push r13 2a8a8: ef 92 push r14 2a8aa: ff 92 push r15 2a8ac: 0f 93 push r16 2a8ae: 1f 93 push r17 2a8b0: cf 93 push r28 2a8b2: df 93 push r29 2a8b4: ec 01 movw r28, r24 uint32_t lba; // error if reserved cluster if (cluster < 2) goto fail; 2a8b6: 42 30 cpi r20, 0x02 ; 2 2a8b8: 51 05 cpc r21, r1 2a8ba: 61 05 cpc r22, r1 2a8bc: 71 05 cpc r23, r1 2a8be: 90 f4 brcc .+36 ; 0x2a8e4 // mirror second FAT if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_; return true; fail: return false; 2a8c0: 80 e0 ldi r24, 0x00 ; 0 } 2a8c2: df 91 pop r29 2a8c4: cf 91 pop r28 2a8c6: 1f 91 pop r17 2a8c8: 0f 91 pop r16 2a8ca: ff 90 pop r15 2a8cc: ef 90 pop r14 2a8ce: df 90 pop r13 2a8d0: cf 90 pop r12 2a8d2: bf 90 pop r11 2a8d4: af 90 pop r10 2a8d6: 9f 90 pop r9 2a8d8: 8f 90 pop r8 2a8da: 7f 90 pop r7 2a8dc: 6f 90 pop r6 2a8de: 5f 90 pop r5 2a8e0: 4f 90 pop r4 2a8e2: 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; 2a8e4: 89 85 ldd r24, Y+9 ; 0x09 2a8e6: 9a 85 ldd r25, Y+10 ; 0x0a 2a8e8: ab 85 ldd r26, Y+11 ; 0x0b 2a8ea: bc 85 ldd r27, Y+12 ; 0x0c 2a8ec: 01 96 adiw r24, 0x01 ; 1 2a8ee: a1 1d adc r26, r1 2a8f0: b1 1d adc r27, r1 2a8f2: 84 17 cp r24, r20 2a8f4: 95 07 cpc r25, r21 2a8f6: a6 07 cpc r26, r22 2a8f8: b7 07 cpc r27, r23 2a8fa: 10 f3 brcs .-60 ; 0x2a8c0 tmp = ((cacheBuffer_.data[index] & 0XF0)) | tmp >> 4; } cacheBuffer_.data[index] = tmp; return true; } if (fatType_ == 16) { 2a8fc: 8f 89 ldd r24, Y+23 ; 0x17 2a8fe: 80 31 cpi r24, 0x10 ; 16 2a900: c9 f5 brne .+114 ; 0x2a974 lba = fatStartBlock_ + (cluster >> 8); 2a902: 85 2e mov r8, r21 2a904: 96 2e mov r9, r22 2a906: a7 2e mov r10, r23 2a908: bb 24 eor r11, r11 2a90a: 8b 89 ldd r24, Y+19 ; 0x13 2a90c: 9c 89 ldd r25, Y+20 ; 0x14 2a90e: ad 89 ldd r26, Y+21 ; 0x15 2a910: be 89 ldd r27, Y+22 ; 0x16 } else if (fatType_ == 32) { lba = fatStartBlock_ + (cluster >> 7); 2a912: 88 0e add r8, r24 2a914: 99 1e adc r9, r25 2a916: aa 1e adc r10, r26 2a918: bb 1e adc r11, r27 2a91a: 28 01 movw r4, r16 2a91c: 39 01 movw r6, r18 2a91e: 6a 01 movw r12, r20 2a920: 7b 01 movw r14, r22 } else { goto fail; } if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) goto fail; 2a922: 41 e0 ldi r20, 0x01 ; 1 2a924: c5 01 movw r24, r10 2a926: b4 01 movw r22, r8 2a928: 0f 94 0d 54 call 0x2a81a ; 0x2a81a 2a92c: 88 23 and r24, r24 2a92e: 41 f2 breq .-112 ; 0x2a8c0 // store entry if (fatType_ == 16) { 2a930: 9f 89 ldd r25, Y+23 ; 0x17 2a932: 90 31 cpi r25, 0x10 ; 16 2a934: 81 f5 brne .+96 ; 0x2a996 cacheBuffer_.fat16[cluster & 0XFF] = value; 2a936: dd 24 eor r13, r13 2a938: ee 24 eor r14, r14 2a93a: ff 24 eor r15, r15 2a93c: f6 01 movw r30, r12 2a93e: ee 0f add r30, r30 2a940: ff 1f adc r31, r31 2a942: e3 56 subi r30, 0x63 ; 99 2a944: f1 4f sbci r31, 0xF1 ; 241 2a946: 11 83 std Z+1, r17 ; 0x01 2a948: 00 83 st Z, r16 } else { cacheBuffer_.fat32[cluster & 0X7F] = value; } // mirror second FAT if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_; 2a94a: 9a 89 ldd r25, Y+18 ; 0x12 2a94c: 92 30 cpi r25, 0x02 ; 2 2a94e: 08 f4 brcc .+2 ; 0x2a952 2a950: b8 cf rjmp .-144 ; 0x2a8c2 2a952: 4d 81 ldd r20, Y+5 ; 0x05 2a954: 5e 81 ldd r21, Y+6 ; 0x06 2a956: 6f 81 ldd r22, Y+7 ; 0x07 2a958: 78 85 ldd r23, Y+8 ; 0x08 2a95a: 84 0e add r8, r20 2a95c: 95 1e adc r9, r21 2a95e: a6 1e adc r10, r22 2a960: b7 1e adc r11, r23 2a962: 80 92 95 0e sts 0x0E95, r8 ; 0x800e95 2a966: 90 92 96 0e sts 0x0E96, r9 ; 0x800e96 2a96a: a0 92 97 0e sts 0x0E97, r10 ; 0x800e97 2a96e: b0 92 98 0e sts 0x0E98, r11 ; 0x800e98 2a972: a7 cf rjmp .-178 ; 0x2a8c2 cacheBuffer_.data[index] = tmp; return true; } if (fatType_ == 16) { lba = fatStartBlock_ + (cluster >> 8); } else if (fatType_ == 32) { 2a974: 80 32 cpi r24, 0x20 ; 32 2a976: 09 f0 breq .+2 ; 0x2a97a 2a978: a3 cf rjmp .-186 ; 0x2a8c0 lba = fatStartBlock_ + (cluster >> 7); 2a97a: 8b 89 ldd r24, Y+19 ; 0x13 2a97c: 9c 89 ldd r25, Y+20 ; 0x14 2a97e: ad 89 ldd r26, Y+21 ; 0x15 2a980: be 89 ldd r27, Y+22 ; 0x16 2a982: 4a 01 movw r8, r20 2a984: 5b 01 movw r10, r22 2a986: e7 e0 ldi r30, 0x07 ; 7 2a988: b6 94 lsr r11 2a98a: a7 94 ror r10 2a98c: 97 94 ror r9 2a98e: 87 94 ror r8 2a990: ea 95 dec r30 2a992: d1 f7 brne .-12 ; 0x2a988 2a994: be cf rjmp .-132 ; 0x2a912 if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) goto fail; // store entry if (fatType_ == 16) { cacheBuffer_.fat16[cluster & 0XFF] = value; } else { cacheBuffer_.fat32[cluster & 0X7F] = value; 2a996: e8 94 clt 2a998: c7 f8 bld r12, 7 2a99a: dd 24 eor r13, r13 2a99c: ee 24 eor r14, r14 2a99e: ff 24 eor r15, r15 2a9a0: f6 01 movw r30, r12 2a9a2: ee 0f add r30, r30 2a9a4: ff 1f adc r31, r31 2a9a6: ee 0f add r30, r30 2a9a8: ff 1f adc r31, r31 2a9aa: e3 56 subi r30, 0x63 ; 99 2a9ac: f1 4f sbci r31, 0xF1 ; 241 2a9ae: 40 82 st Z, r4 2a9b0: 51 82 std Z+1, r5 ; 0x01 2a9b2: 62 82 std Z+2, r6 ; 0x02 2a9b4: 73 82 std Z+3, r7 ; 0x03 2a9b6: c9 cf rjmp .-110 ; 0x2a94a 0002a9b8 : fail: return false; } //------------------------------------------------------------------------------ // Fetch a FAT entry bool SdVolume::fatGet(uint32_t cluster, uint32_t* value) { 2a9b8: cf 92 push r12 2a9ba: df 92 push r13 2a9bc: ef 92 push r14 2a9be: ff 92 push r15 2a9c0: 0f 93 push r16 2a9c2: 1f 93 push r17 2a9c4: cf 93 push r28 2a9c6: df 93 push r29 2a9c8: fc 01 movw r30, r24 uint32_t lba; if (cluster > (clusterCount_ + 1)) goto fail; 2a9ca: 81 85 ldd r24, Z+9 ; 0x09 2a9cc: 92 85 ldd r25, Z+10 ; 0x0a 2a9ce: a3 85 ldd r26, Z+11 ; 0x0b 2a9d0: b4 85 ldd r27, Z+12 ; 0x0c 2a9d2: 01 96 adiw r24, 0x01 ; 1 2a9d4: a1 1d adc r26, r1 2a9d6: b1 1d adc r27, r1 2a9d8: 84 17 cp r24, r20 2a9da: 95 07 cpc r25, r21 2a9dc: a6 07 cpc r26, r22 2a9de: b7 07 cpc r27, r23 2a9e0: 50 f4 brcc .+20 ; 0x2a9f6 *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; } return true; fail: return false; 2a9e2: 80 e0 ldi r24, 0x00 ; 0 } 2a9e4: df 91 pop r29 2a9e6: cf 91 pop r28 2a9e8: 1f 91 pop r17 2a9ea: 0f 91 pop r16 2a9ec: ff 90 pop r15 2a9ee: ef 90 pop r14 2a9f0: df 90 pop r13 2a9f2: cf 90 pop r12 2a9f4: 08 95 ret } tmp |= cacheBuffer_.data[index] << 8; *value = cluster & 1 ? tmp >> 4 : tmp & 0XFFF; return true; } if (fatType_ == 16) { 2a9f6: 87 89 ldd r24, Z+23 ; 0x17 2a9f8: 80 31 cpi r24, 0x10 ; 16 2a9fa: a9 f5 brne .+106 ; 0x2aa66 lba = fatStartBlock_ + (cluster >> 8); 2a9fc: bb 27 eor r27, r27 2a9fe: a7 2f mov r26, r23 2aa00: 96 2f mov r25, r22 2aa02: 85 2f mov r24, r21 2aa04: c3 88 ldd r12, Z+19 ; 0x13 2aa06: d4 88 ldd r13, Z+20 ; 0x14 2aa08: e5 88 ldd r14, Z+21 ; 0x15 2aa0a: f6 88 ldd r15, Z+22 ; 0x16 } else if (fatType_ == 32) { lba = fatStartBlock_ + (cluster >> 7); 2aa0c: 8c 0d add r24, r12 2aa0e: 9d 1d adc r25, r13 2aa10: ae 1d adc r26, r14 2aa12: bf 1d adc r27, r15 2aa14: e9 01 movw r28, r18 2aa16: 6a 01 movw r12, r20 2aa18: 7b 01 movw r14, r22 2aa1a: 8f 01 movw r16, r30 } else { goto fail; } if (lba != cacheBlockNumber_) { 2aa1c: 40 91 91 0e lds r20, 0x0E91 ; 0x800e91 2aa20: 50 91 92 0e lds r21, 0x0E92 ; 0x800e92 2aa24: 60 91 93 0e lds r22, 0x0E93 ; 0x800e93 2aa28: 70 91 94 0e lds r23, 0x0E94 ; 0x800e94 2aa2c: 84 17 cp r24, r20 2aa2e: 95 07 cpc r25, r21 2aa30: a6 07 cpc r26, r22 2aa32: b7 07 cpc r27, r23 2aa34: 49 f5 brne .+82 ; 0x2aa88 if (!cacheRawBlock(lba, CACHE_FOR_READ)) goto fail; } if (fatType_ == 16) { 2aa36: f8 01 movw r30, r16 2aa38: 87 89 ldd r24, Z+23 ; 0x17 2aa3a: 80 31 cpi r24, 0x10 ; 16 2aa3c: 69 f5 brne .+90 ; 0x2aa98 *value = cacheBuffer_.fat16[cluster & 0XFF]; 2aa3e: b7 01 movw r22, r14 2aa40: a6 01 movw r20, r12 2aa42: 55 27 eor r21, r21 2aa44: 66 27 eor r22, r22 2aa46: 77 27 eor r23, r23 2aa48: 44 0f add r20, r20 2aa4a: 55 1f adc r21, r21 2aa4c: 43 56 subi r20, 0x63 ; 99 2aa4e: 51 4f sbci r21, 0xF1 ; 241 2aa50: fa 01 movw r30, r20 2aa52: 80 81 ld r24, Z 2aa54: 91 81 ldd r25, Z+1 ; 0x01 2aa56: b0 e0 ldi r27, 0x00 ; 0 2aa58: a0 e0 ldi r26, 0x00 ; 0 } else { *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; 2aa5a: 88 83 st Y, r24 2aa5c: 99 83 std Y+1, r25 ; 0x01 2aa5e: aa 83 std Y+2, r26 ; 0x02 2aa60: bb 83 std Y+3, r27 ; 0x03 2aa62: 81 e0 ldi r24, 0x01 ; 1 2aa64: bf cf rjmp .-130 ; 0x2a9e4 *value = cluster & 1 ? tmp >> 4 : tmp & 0XFFF; return true; } if (fatType_ == 16) { lba = fatStartBlock_ + (cluster >> 8); } else if (fatType_ == 32) { 2aa66: 80 32 cpi r24, 0x20 ; 32 2aa68: 09 f0 breq .+2 ; 0x2aa6c 2aa6a: bb cf rjmp .-138 ; 0x2a9e2 lba = fatStartBlock_ + (cluster >> 7); 2aa6c: c3 88 ldd r12, Z+19 ; 0x13 2aa6e: d4 88 ldd r13, Z+20 ; 0x14 2aa70: e5 88 ldd r14, Z+21 ; 0x15 2aa72: f6 88 ldd r15, Z+22 ; 0x16 2aa74: db 01 movw r26, r22 2aa76: ca 01 movw r24, r20 2aa78: c7 e0 ldi r28, 0x07 ; 7 2aa7a: b6 95 lsr r27 2aa7c: a7 95 ror r26 2aa7e: 97 95 ror r25 2aa80: 87 95 ror r24 2aa82: ca 95 dec r28 2aa84: d1 f7 brne .-12 ; 0x2aa7a 2aa86: c2 cf rjmp .-124 ; 0x2aa0c } else { goto fail; } if (lba != cacheBlockNumber_) { if (!cacheRawBlock(lba, CACHE_FOR_READ)) goto fail; 2aa88: 40 e0 ldi r20, 0x00 ; 0 2aa8a: bc 01 movw r22, r24 2aa8c: cd 01 movw r24, r26 2aa8e: 0f 94 0d 54 call 0x2a81a ; 0x2a81a 2aa92: 81 11 cpse r24, r1 2aa94: d0 cf rjmp .-96 ; 0x2aa36 2aa96: a5 cf rjmp .-182 ; 0x2a9e2 } if (fatType_ == 16) { *value = cacheBuffer_.fat16[cluster & 0XFF]; } else { *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; 2aa98: b7 01 movw r22, r14 2aa9a: a6 01 movw r20, r12 2aa9c: 4f 77 andi r20, 0x7F ; 127 2aa9e: 55 27 eor r21, r21 2aaa0: 66 27 eor r22, r22 2aaa2: 77 27 eor r23, r23 2aaa4: 44 0f add r20, r20 2aaa6: 55 1f adc r21, r21 2aaa8: 44 0f add r20, r20 2aaaa: 55 1f adc r21, r21 2aaac: 43 56 subi r20, 0x63 ; 99 2aaae: 51 4f sbci r21, 0xF1 ; 241 2aab0: fa 01 movw r30, r20 2aab2: 80 81 ld r24, Z 2aab4: 91 81 ldd r25, Z+1 ; 0x01 2aab6: a2 81 ldd r26, Z+2 ; 0x02 2aab8: b3 81 ldd r27, Z+3 ; 0x03 2aaba: bf 70 andi r27, 0x0F ; 15 2aabc: ce cf rjmp .-100 ; 0x2aa5a 0002aabe : fail: return false; } //------------------------------------------------------------------------------ // return the size in bytes of a cluster chain bool SdVolume::chainSize(uint32_t cluster, uint32_t* size) { 2aabe: 4f 92 push r4 2aac0: 5f 92 push r5 2aac2: 6f 92 push r6 2aac4: 7f 92 push r7 2aac6: af 92 push r10 2aac8: bf 92 push r11 2aaca: cf 92 push r12 2aacc: df 92 push r13 2aace: ef 92 push r14 2aad0: ff 92 push r15 2aad2: 0f 93 push r16 2aad4: 1f 93 push r17 2aad6: cf 93 push r28 2aad8: df 93 push r29 2aada: 00 d0 rcall .+0 ; 0x2aadc 2aadc: 1f 92 push r1 2aade: cd b7 in r28, 0x3d ; 61 2aae0: de b7 in r29, 0x3e ; 62 2aae2: 8c 01 movw r16, r24 2aae4: 49 83 std Y+1, r20 ; 0x01 2aae6: 5a 83 std Y+2, r21 ; 0x02 2aae8: 6b 83 std Y+3, r22 ; 0x03 2aaea: 7c 83 std Y+4, r23 ; 0x04 2aaec: 59 01 movw r10, r18 uint32_t s = 0; 2aaee: c1 2c mov r12, r1 2aaf0: d1 2c mov r13, r1 2aaf2: 76 01 movw r14, r12 do { if (!fatGet(cluster, &cluster)) goto fail; s += 512UL << clusterSizeShift_; 2aaf4: 41 2c mov r4, r1 2aaf6: 82 e0 ldi r24, 0x02 ; 2 2aaf8: 58 2e mov r5, r24 2aafa: 61 2c mov r6, r1 2aafc: 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; 2aafe: 49 81 ldd r20, Y+1 ; 0x01 2ab00: 5a 81 ldd r21, Y+2 ; 0x02 2ab02: 6b 81 ldd r22, Y+3 ; 0x03 2ab04: 7c 81 ldd r23, Y+4 ; 0x04 2ab06: 9e 01 movw r18, r28 2ab08: 2f 5f subi r18, 0xFF ; 255 2ab0a: 3f 4f sbci r19, 0xFF ; 255 2ab0c: c8 01 movw r24, r16 2ab0e: 0f 94 dc 54 call 0x2a9b8 ; 0x2a9b8 2ab12: 88 23 and r24, r24 2ab14: 19 f1 breq .+70 ; 0x2ab5c s += 512UL << clusterSizeShift_; 2ab16: f8 01 movw r30, r16 2ab18: 85 85 ldd r24, Z+13 ; 0x0d 2ab1a: a3 01 movw r20, r6 2ab1c: 92 01 movw r18, r4 2ab1e: 04 c0 rjmp .+8 ; 0x2ab28 2ab20: 22 0f add r18, r18 2ab22: 33 1f adc r19, r19 2ab24: 44 1f adc r20, r20 2ab26: 55 1f adc r21, r21 2ab28: 8a 95 dec r24 2ab2a: d2 f7 brpl .-12 ; 0x2ab20 2ab2c: da 01 movw r26, r20 2ab2e: c9 01 movw r24, r18 2ab30: c8 0e add r12, r24 2ab32: d9 1e adc r13, r25 2ab34: ea 1e adc r14, r26 2ab36: fb 1e adc r15, r27 } while (!isEOC(cluster)); 2ab38: 49 81 ldd r20, Y+1 ; 0x01 2ab3a: 5a 81 ldd r21, Y+2 ; 0x02 2ab3c: 6b 81 ldd r22, Y+3 ; 0x03 2ab3e: 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; 2ab40: 87 89 ldd r24, Z+23 ; 0x17 2ab42: 80 31 cpi r24, 0x10 ; 16 2ab44: f1 f4 brne .+60 ; 0x2ab82 2ab46: 81 e0 ldi r24, 0x01 ; 1 2ab48: 48 3f cpi r20, 0xF8 ; 248 2ab4a: 5f 4f sbci r21, 0xFF ; 255 2ab4c: 61 05 cpc r22, r1 2ab4e: 71 05 cpc r23, r1 2ab50: b0 f2 brcs .-84 ; 0x2aafe *size = s; 2ab52: f5 01 movw r30, r10 2ab54: c0 82 st Z, r12 2ab56: d1 82 std Z+1, r13 ; 0x01 2ab58: e2 82 std Z+2, r14 ; 0x02 2ab5a: f3 82 std Z+3, r15 ; 0x03 return true; fail: return false; } 2ab5c: 0f 90 pop r0 2ab5e: 0f 90 pop r0 2ab60: 0f 90 pop r0 2ab62: 0f 90 pop r0 2ab64: df 91 pop r29 2ab66: cf 91 pop r28 2ab68: 1f 91 pop r17 2ab6a: 0f 91 pop r16 2ab6c: ff 90 pop r15 2ab6e: ef 90 pop r14 2ab70: df 90 pop r13 2ab72: cf 90 pop r12 2ab74: bf 90 pop r11 2ab76: af 90 pop r10 2ab78: 7f 90 pop r7 2ab7a: 6f 90 pop r6 2ab7c: 5f 90 pop r5 2ab7e: 4f 90 pop r4 2ab80: 08 95 ret return cluster >= FAT32EOC_MIN; 2ab82: 81 e0 ldi r24, 0x01 ; 1 2ab84: 48 3f cpi r20, 0xF8 ; 248 2ab86: 5f 4f sbci r21, 0xFF ; 255 2ab88: 6f 4f sbci r22, 0xFF ; 255 2ab8a: 7f 40 sbci r23, 0x0F ; 15 2ab8c: 08 f4 brcc .+2 ; 0x2ab90 2ab8e: b7 cf rjmp .-146 ; 0x2aafe 2ab90: e0 cf rjmp .-64 ; 0x2ab52 0002ab92 : * \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) { 2ab92: 0f 93 push r16 2ab94: 1f 93 push r17 2ab96: cf 93 push r28 2ab98: df 93 push r29 // error if file is already open if (isOpen()) goto fail; 2ab9a: fc 01 movw r30, r24 2ab9c: 23 81 ldd r18, Z+3 ; 0x03 2ab9e: 22 23 and r18, r18 2aba0: 31 f0 breq .+12 ; 0x2abae dirBlock_ = 0; dirIndex_ = 0; return true; fail: return false; 2aba2: 80 e0 ldi r24, 0x00 ; 0 } 2aba4: df 91 pop r29 2aba6: cf 91 pop r28 2aba8: 1f 91 pop r17 2abaa: 0f 91 pop r16 2abac: 08 95 ret 2abae: 8b 01 movw r16, r22 2abb0: ec 01 movw r28, r24 2abb2: fb 01 movw r30, r22 2abb4: 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)) { 2abb6: 80 31 cpi r24, 0x10 ; 16 2abb8: 39 f5 brne .+78 ; 0x2ac08 type_ = FAT_FILE_TYPE_ROOT_FIXED; 2abba: 82 e0 ldi r24, 0x02 ; 2 2abbc: 8b 83 std Y+3, r24 ; 0x03 firstCluster_ = 0; 2abbe: 1d 8a std Y+21, r1 ; 0x15 2abc0: 1e 8a std Y+22, r1 ; 0x16 2abc2: 1f 8a std Y+23, r1 ; 0x17 2abc4: 18 8e std Y+24, r1 ; 0x18 fileSize_ = 32 * vol->rootDirEntryCount(); 2abc6: 80 8d ldd r24, Z+24 ; 0x18 2abc8: 91 8d ldd r25, Z+25 ; 0x19 2abca: b0 e0 ldi r27, 0x00 ; 0 2abcc: a0 e0 ldi r26, 0x00 ; 0 2abce: 25 e0 ldi r18, 0x05 ; 5 2abd0: 88 0f add r24, r24 2abd2: 99 1f adc r25, r25 2abd4: aa 1f adc r26, r26 2abd6: bb 1f adc r27, r27 2abd8: 2a 95 dec r18 2abda: d1 f7 brne .-12 ; 0x2abd0 2abdc: 89 8b std Y+17, r24 ; 0x11 2abde: 9a 8b std Y+18, r25 ; 0x12 2abe0: ab 8b std Y+19, r26 ; 0x13 2abe2: 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; 2abe4: 1a 8f std Y+26, r17 ; 0x1a 2abe6: 09 8f std Y+25, r16 ; 0x19 // read only flags_ = O_READ; 2abe8: 81 e0 ldi r24, 0x01 ; 1 2abea: 89 83 std Y+1, r24 ; 0x01 // set to start of file curCluster_ = 0; 2abec: 1c 82 std Y+4, r1 ; 0x04 2abee: 1d 82 std Y+5, r1 ; 0x05 2abf0: 1e 82 std Y+6, r1 ; 0x06 2abf2: 1f 82 std Y+7, r1 ; 0x07 curPosition_ = 0; 2abf4: 18 86 std Y+8, r1 ; 0x08 2abf6: 19 86 std Y+9, r1 ; 0x09 2abf8: 1a 86 std Y+10, r1 ; 0x0a 2abfa: 1b 86 std Y+11, r1 ; 0x0b // root has no directory entry dirBlock_ = 0; 2abfc: 1c 86 std Y+12, r1 ; 0x0c 2abfe: 1d 86 std Y+13, r1 ; 0x0d 2ac00: 1e 86 std Y+14, r1 ; 0x0e 2ac02: 1f 86 std Y+15, r1 ; 0x0f dirIndex_ = 0; 2ac04: 18 8a std Y+16, r1 ; 0x10 2ac06: ce cf rjmp .-100 ; 0x2aba4 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) { 2ac08: 80 32 cpi r24, 0x20 ; 32 2ac0a: 59 f6 brne .-106 ; 0x2aba2 type_ = FAT_FILE_TYPE_ROOT32; 2ac0c: 83 e0 ldi r24, 0x03 ; 3 2ac0e: 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_;} 2ac10: 42 8d ldd r20, Z+26 ; 0x1a 2ac12: 53 8d ldd r21, Z+27 ; 0x1b 2ac14: 64 8d ldd r22, Z+28 ; 0x1c 2ac16: 75 8d ldd r23, Z+29 ; 0x1d firstCluster_ = vol->rootDirStart(); 2ac18: 4d 8b std Y+21, r20 ; 0x15 2ac1a: 5e 8b std Y+22, r21 ; 0x16 2ac1c: 6f 8b std Y+23, r22 ; 0x17 2ac1e: 78 8f std Y+24, r23 ; 0x18 if (!vol->chainSize(firstCluster_, &fileSize_)) goto fail; 2ac20: 9e 01 movw r18, r28 2ac22: 2f 5e subi r18, 0xEF ; 239 2ac24: 3f 4f sbci r19, 0xFF ; 255 2ac26: c8 01 movw r24, r16 2ac28: 0f 94 5f 55 call 0x2aabe ; 0x2aabe 2ac2c: 81 11 cpse r24, r1 2ac2e: da cf rjmp .-76 ; 0x2abe4 2ac30: b8 cf rjmp .-144 ; 0x2aba2 0002ac32 : vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; } return true; } bool SdFile::gfComputeNextFileBlock() { 2ac32: cf 92 push r12 2ac34: df 92 push r13 2ac36: ef 92 push r14 2ac38: ff 92 push r15 2ac3a: 1f 93 push r17 2ac3c: cf 93 push r28 2ac3e: df 93 push r29 2ac40: ec 01 movw r28, r24 2ac42: eb 81 ldd r30, Y+3 ; 0x03 // error if not open or write only if (!isOpen() || !(flags_ & O_READ)) return false; 2ac44: e1 11 cpse r30, r1 2ac46: 09 c0 rjmp .+18 ; 0x2ac5a 2ac48: 80 e0 ldi r24, 0x00 ; 0 } } gfBlock = vol_->clusterStartBlock(curCluster_) + blockOfCluster; } return true; } 2ac4a: df 91 pop r29 2ac4c: cf 91 pop r28 2ac4e: 1f 91 pop r17 2ac50: ff 90 pop r15 2ac52: ef 90 pop r14 2ac54: df 90 pop r13 2ac56: cf 90 pop r12 2ac58: 08 95 ret return true; } bool SdFile::gfComputeNextFileBlock() { // error if not open or write only if (!isOpen() || !(flags_ & O_READ)) return false; 2ac5a: 89 81 ldd r24, Y+1 ; 0x01 2ac5c: 80 ff sbrs r24, 0 2ac5e: f4 cf rjmp .-24 ; 0x2ac48 gfOffset = curPosition_ & 0X1FF; // offset in block 2ac60: 48 85 ldd r20, Y+8 ; 0x08 2ac62: 59 85 ldd r21, Y+9 ; 0x09 2ac64: 6a 85 ldd r22, Y+10 ; 0x0a 2ac66: 7b 85 ldd r23, Y+11 ; 0x0b 2ac68: 9a 01 movw r18, r20 2ac6a: 31 70 andi r19, 0x01 ; 1 2ac6c: 3a a3 std Y+34, r19 ; 0x22 2ac6e: 29 a3 std Y+33, r18 ; 0x21 2ac70: 89 8d ldd r24, Y+25 ; 0x19 2ac72: 9a 8d ldd r25, Y+26 ; 0x1a 2ac74: 6a 01 movw r12, r20 2ac76: 7b 01 movw r14, r22 2ac78: f9 e0 ldi r31, 0x09 ; 9 2ac7a: f6 94 lsr r15 2ac7c: e7 94 ror r14 2ac7e: d7 94 ror r13 2ac80: c7 94 ror r12 2ac82: fa 95 dec r31 2ac84: d1 f7 brne .-12 ; 0x2ac7a if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 2ac86: e2 30 cpi r30, 0x02 ; 2 2ac88: 79 f4 brne .+30 ; 0x2aca8 // 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); 2ac8a: fc 01 movw r30, r24 2ac8c: 82 8d ldd r24, Z+26 ; 0x1a 2ac8e: 93 8d ldd r25, Z+27 ; 0x1b 2ac90: a4 8d ldd r26, Z+28 ; 0x1c 2ac92: b5 8d ldd r27, Z+29 ; 0x1d 2ac94: 8c 0d add r24, r12 2ac96: 9d 1d adc r25, r13 2ac98: ae 1d adc r26, r14 2ac9a: bf 1d adc r27, r15 } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) return false; } } gfBlock = vol_->clusterStartBlock(curCluster_) + blockOfCluster; 2ac9c: 8d 8f std Y+29, r24 ; 0x1d 2ac9e: 9e 8f std Y+30, r25 ; 0x1e 2aca0: af 8f std Y+31, r26 ; 0x1f 2aca2: b8 a3 std Y+32, r27 ; 0x20 } return true; 2aca4: 81 e0 ldi r24, 0x01 ; 1 2aca6: d1 cf rjmp .-94 ; 0x2ac4a 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);} 2aca8: fc 01 movw r30, r24 2acaa: 14 81 ldd r17, Z+4 ; 0x04 2acac: 11 50 subi r17, 0x01 ; 1 2acae: 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) { 2acb0: 23 2b or r18, r19 2acb2: 71 f4 brne .+28 ; 0x2acd0 2acb4: 11 11 cpse r17, r1 2acb6: 0c c0 rjmp .+24 ; 0x2acd0 // start of new cluster if (curPosition_ == 0) { 2acb8: 45 2b or r20, r21 2acba: 46 2b or r20, r22 2acbc: 47 2b or r20, r23 2acbe: 31 f5 brne .+76 ; 0x2ad0c // use first cluster in file curCluster_ = firstCluster_; 2acc0: 8d 89 ldd r24, Y+21 ; 0x15 2acc2: 9e 89 ldd r25, Y+22 ; 0x16 2acc4: af 89 ldd r26, Y+23 ; 0x17 2acc6: b8 8d ldd r27, Y+24 ; 0x18 2acc8: 8c 83 std Y+4, r24 ; 0x04 2acca: 9d 83 std Y+5, r25 ; 0x05 2accc: ae 83 std Y+6, r26 ; 0x06 2acce: 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; 2acd0: e9 8d ldd r30, Y+25 ; 0x19 2acd2: fa 8d ldd r31, Y+26 ; 0x1a uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 2acd4: 8c 81 ldd r24, Y+4 ; 0x04 2acd6: 9d 81 ldd r25, Y+5 ; 0x05 2acd8: ae 81 ldd r26, Y+6 ; 0x06 2acda: bf 81 ldd r27, Y+7 ; 0x07 2acdc: 02 97 sbiw r24, 0x02 ; 2 2acde: a1 09 sbc r26, r1 2ace0: b1 09 sbc r27, r1 2ace2: 25 85 ldd r18, Z+13 ; 0x0d 2ace4: 04 c0 rjmp .+8 ; 0x2acee 2ace6: 88 0f add r24, r24 2ace8: 99 1f adc r25, r25 2acea: aa 1f adc r26, r26 2acec: bb 1f adc r27, r27 2acee: 2a 95 dec r18 2acf0: d2 f7 brpl .-12 ; 0x2ace6 2acf2: 46 85 ldd r20, Z+14 ; 0x0e 2acf4: 57 85 ldd r21, Z+15 ; 0x0f 2acf6: 60 89 ldd r22, Z+16 ; 0x10 2acf8: 71 89 ldd r23, Z+17 ; 0x11 2acfa: 84 0f add r24, r20 2acfc: 95 1f adc r25, r21 2acfe: a6 1f adc r26, r22 2ad00: b7 1f adc r27, r23 2ad02: 81 0f add r24, r17 2ad04: 91 1d adc r25, r1 2ad06: a1 1d adc r26, r1 2ad08: b1 1d adc r27, r1 2ad0a: c8 cf rjmp .-112 ; 0x2ac9c if (curPosition_ == 0) { // use first cluster in file curCluster_ = firstCluster_; } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) return false; 2ad0c: 4c 81 ldd r20, Y+4 ; 0x04 2ad0e: 5d 81 ldd r21, Y+5 ; 0x05 2ad10: 6e 81 ldd r22, Y+6 ; 0x06 2ad12: 7f 81 ldd r23, Y+7 ; 0x07 2ad14: 9e 01 movw r18, r28 2ad16: 2c 5f subi r18, 0xFC ; 252 2ad18: 3f 4f sbci r19, 0xFF ; 255 2ad1a: 0f 94 dc 54 call 0x2a9b8 ; 0x2a9b8 2ad1e: 81 11 cpse r24, r1 2ad20: d7 cf rjmp .-82 ; 0x2acd0 2ad22: 92 cf rjmp .-220 ; 0x2ac48 0002ad24 : * \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) { 2ad24: 8f 92 push r8 2ad26: 9f 92 push r9 2ad28: af 92 push r10 2ad2a: bf 92 push r11 2ad2c: cf 92 push r12 2ad2e: df 92 push r13 2ad30: ef 92 push r14 2ad32: ff 92 push r15 2ad34: 0f 93 push r16 2ad36: 1f 93 push r17 2ad38: cf 93 push r28 2ad3a: df 93 push r29 2ad3c: ec 01 movw r28, r24 2ad3e: 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; 2ad40: 81 11 cpse r24, r1 2ad42: 0e c0 rjmp .+28 ; 0x2ad60 done: return true; fail: return false; 2ad44: 80 e0 ldi r24, 0x00 ; 0 } 2ad46: df 91 pop r29 2ad48: cf 91 pop r28 2ad4a: 1f 91 pop r17 2ad4c: 0f 91 pop r16 2ad4e: ff 90 pop r15 2ad50: ef 90 pop r14 2ad52: df 90 pop r13 2ad54: cf 90 pop r12 2ad56: bf 90 pop r11 2ad58: af 90 pop r10 2ad5a: 9f 90 pop r9 2ad5c: 8f 90 pop r8 2ad5e: 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; 2ad60: 09 89 ldd r16, Y+17 ; 0x11 2ad62: 1a 89 ldd r17, Y+18 ; 0x12 2ad64: 2b 89 ldd r18, Y+19 ; 0x13 2ad66: 3c 89 ldd r19, Y+20 ; 0x14 2ad68: 04 17 cp r16, r20 2ad6a: 15 07 cpc r17, r21 2ad6c: 26 07 cpc r18, r22 2ad6e: 37 07 cpc r19, r23 2ad70: 48 f3 brcs .-46 ; 0x2ad44 2ad72: 4a 01 movw r8, r20 2ad74: 5b 01 movw r10, r22 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 2ad76: 82 30 cpi r24, 0x02 ; 2 2ad78: 31 f4 brne .+12 ; 0x2ad86 curPosition_ = pos; 2ad7a: 88 86 std Y+8, r8 ; 0x08 2ad7c: 99 86 std Y+9, r9 ; 0x09 2ad7e: aa 86 std Y+10, r10 ; 0x0a 2ad80: bb 86 std Y+11, r11 ; 0x0b if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; } curPosition_ = pos; done: return true; 2ad82: 81 e0 ldi r24, 0x01 ; 1 2ad84: e0 cf rjmp .-64 ; 0x2ad46 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { curPosition_ = pos; goto done; } if (pos == 0) { 2ad86: 81 14 cp r8, r1 2ad88: 91 04 cpc r9, r1 2ad8a: a1 04 cpc r10, r1 2ad8c: b1 04 cpc r11, r1 2ad8e: 49 f4 brne .+18 ; 0x2ada2 // set position to start of file curCluster_ = 0; 2ad90: 1c 82 std Y+4, r1 ; 0x04 2ad92: 1d 82 std Y+5, r1 ; 0x05 2ad94: 1e 82 std Y+6, r1 ; 0x06 2ad96: 1f 82 std Y+7, r1 ; 0x07 curPosition_ = 0; 2ad98: 18 86 std Y+8, r1 ; 0x08 2ad9a: 19 86 std Y+9, r1 ; 0x09 2ad9c: 1a 86 std Y+10, r1 ; 0x0a 2ad9e: 1b 86 std Y+11, r1 ; 0x0b 2ada0: f0 cf rjmp .-32 ; 0x2ad82 goto done; } // calculate cluster index for cur and new position nCur = (curPosition_ - 1) >> (vol_->clusterSizeShift_ + 9); 2ada2: 08 85 ldd r16, Y+8 ; 0x08 2ada4: 19 85 ldd r17, Y+9 ; 0x09 2ada6: 2a 85 ldd r18, Y+10 ; 0x0a 2ada8: 3b 85 ldd r19, Y+11 ; 0x0b 2adaa: e9 8d ldd r30, Y+25 ; 0x19 2adac: fa 8d ldd r31, Y+26 ; 0x1a 2adae: 85 85 ldd r24, Z+13 ; 0x0d 2adb0: 90 e0 ldi r25, 0x00 ; 0 2adb2: 09 96 adiw r24, 0x09 ; 9 2adb4: b9 01 movw r22, r18 2adb6: a8 01 movw r20, r16 2adb8: 41 50 subi r20, 0x01 ; 1 2adba: 51 09 sbc r21, r1 2adbc: 61 09 sbc r22, r1 2adbe: 71 09 sbc r23, r1 2adc0: 08 2e mov r0, r24 2adc2: 04 c0 rjmp .+8 ; 0x2adcc 2adc4: 76 95 lsr r23 2adc6: 67 95 ror r22 2adc8: 57 95 ror r21 2adca: 47 95 ror r20 2adcc: 0a 94 dec r0 2adce: d2 f7 brpl .-12 ; 0x2adc4 nNew = (pos - 1) >> (vol_->clusterSizeShift_ + 9); 2add0: 75 01 movw r14, r10 2add2: 64 01 movw r12, r8 2add4: e1 e0 ldi r30, 0x01 ; 1 2add6: ce 1a sub r12, r30 2add8: d1 08 sbc r13, r1 2adda: e1 08 sbc r14, r1 2addc: f1 08 sbc r15, r1 2adde: 04 c0 rjmp .+8 ; 0x2ade8 2ade0: f6 94 lsr r15 2ade2: e7 94 ror r14 2ade4: d7 94 ror r13 2ade6: c7 94 ror r12 2ade8: 8a 95 dec r24 2adea: d2 f7 brpl .-12 ; 0x2ade0 if (nNew < nCur || curPosition_ == 0) { 2adec: c4 16 cp r12, r20 2adee: d5 06 cpc r13, r21 2adf0: e6 06 cpc r14, r22 2adf2: f7 06 cpc r15, r23 2adf4: 20 f0 brcs .+8 ; 0x2adfe 2adf6: 01 2b or r16, r17 2adf8: 02 2b or r16, r18 2adfa: 03 2b or r16, r19 2adfc: 11 f5 brne .+68 ; 0x2ae42 // must follow chain from first cluster curCluster_ = firstCluster_; 2adfe: 8d 89 ldd r24, Y+21 ; 0x15 2ae00: 9e 89 ldd r25, Y+22 ; 0x16 2ae02: af 89 ldd r26, Y+23 ; 0x17 2ae04: b8 8d ldd r27, Y+24 ; 0x18 2ae06: 8c 83 std Y+4, r24 ; 0x04 2ae08: 9d 83 std Y+5, r25 ; 0x05 2ae0a: ae 83 std Y+6, r26 ; 0x06 2ae0c: bf 83 std Y+7, r27 ; 0x07 } else { // advance from curPosition nNew -= nCur; } while (nNew--) { if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 2ae0e: 8e 01 movw r16, r28 2ae10: 0c 5f subi r16, 0xFC ; 252 2ae12: 1f 4f sbci r17, 0xFF ; 255 curCluster_ = firstCluster_; } else { // advance from curPosition nNew -= nCur; } while (nNew--) { 2ae14: c1 14 cp r12, r1 2ae16: d1 04 cpc r13, r1 2ae18: e1 04 cpc r14, r1 2ae1a: f1 04 cpc r15, r1 2ae1c: 09 f4 brne .+2 ; 0x2ae20 2ae1e: ad cf rjmp .-166 ; 0x2ad7a if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 2ae20: 4c 81 ldd r20, Y+4 ; 0x04 2ae22: 5d 81 ldd r21, Y+5 ; 0x05 2ae24: 6e 81 ldd r22, Y+6 ; 0x06 2ae26: 7f 81 ldd r23, Y+7 ; 0x07 2ae28: 98 01 movw r18, r16 2ae2a: 89 8d ldd r24, Y+25 ; 0x19 2ae2c: 9a 8d ldd r25, Y+26 ; 0x1a 2ae2e: 0f 94 dc 54 call 0x2a9b8 ; 0x2a9b8 2ae32: 91 e0 ldi r25, 0x01 ; 1 2ae34: c9 1a sub r12, r25 2ae36: d1 08 sbc r13, r1 2ae38: e1 08 sbc r14, r1 2ae3a: f1 08 sbc r15, r1 2ae3c: 81 11 cpse r24, r1 2ae3e: ea cf rjmp .-44 ; 0x2ae14 2ae40: 81 cf rjmp .-254 ; 0x2ad44 if (nNew < nCur || curPosition_ == 0) { // must follow chain from first cluster curCluster_ = firstCluster_; } else { // advance from curPosition nNew -= nCur; 2ae42: c4 1a sub r12, r20 2ae44: d5 0a sbc r13, r21 2ae46: e6 0a sbc r14, r22 2ae48: f7 0a sbc r15, r23 2ae4a: e1 cf rjmp .-62 ; 0x2ae0e 0002ae4c : 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() { 2ae4c: 3f 92 push r3 2ae4e: 4f 92 push r4 2ae50: 5f 92 push r5 2ae52: 6f 92 push r6 2ae54: 7f 92 push r7 2ae56: 8f 92 push r8 2ae58: 9f 92 push r9 2ae5a: af 92 push r10 2ae5c: bf 92 push r11 2ae5e: cf 92 push r12 2ae60: df 92 push r13 2ae62: ef 92 push r14 2ae64: ff 92 push r15 2ae66: 0f 93 push r16 2ae68: 1f 93 push r17 2ae6a: cf 93 push r28 2ae6c: df 93 push r29 2ae6e: cd b7 in r28, 0x3d ; 61 2ae70: de b7 in r29, 0x3e ; 62 2ae72: 2c 97 sbiw r28, 0x0c ; 12 2ae74: 0f b6 in r0, 0x3f ; 63 2ae76: f8 94 cli 2ae78: de bf out 0x3e, r29 ; 62 2ae7a: 0f be out 0x3f, r0 ; 63 2ae7c: cd bf out 0x3d, r28 ; 61 2ae7e: 5c 01 movw r10, r24 if (!vol_->allocContiguous(1, &curCluster_)) goto fail; 2ae80: dc 01 movw r26, r24 2ae82: 59 96 adiw r26, 0x19 ; 25 2ae84: 8d 90 ld r8, X+ 2ae86: 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; 2ae88: f4 01 movw r30, r8 2ae8a: 81 85 ldd r24, Z+9 ; 0x09 2ae8c: 92 85 ldd r25, Z+10 ; 0x0a 2ae8e: a3 85 ldd r26, Z+11 ; 0x0b 2ae90: b4 85 ldd r27, Z+12 ; 0x0c 2ae92: 9c 01 movw r18, r24 2ae94: ad 01 movw r20, r26 2ae96: 2f 5f subi r18, 0xFF ; 255 2ae98: 3f 4f sbci r19, 0xFF ; 255 2ae9a: 4f 4f sbci r20, 0xFF ; 255 2ae9c: 5f 4f sbci r21, 0xFF ; 255 2ae9e: 29 87 std Y+9, r18 ; 0x09 2aea0: 3a 87 std Y+10, r19 ; 0x0a 2aea2: 4b 87 std Y+11, r20 ; 0x0b 2aea4: 5c 87 std Y+12, r21 ; 0x0c // flag to save place to start next search bool setStart; // set search start cluster if (*curCluster) { 2aea6: d5 01 movw r26, r10 2aea8: 14 96 adiw r26, 0x04 ; 4 2aeaa: 4d 90 ld r4, X+ 2aeac: 5d 90 ld r5, X+ 2aeae: 6d 90 ld r6, X+ 2aeb0: 7c 90 ld r7, X 2aeb2: 17 97 sbiw r26, 0x07 ; 7 2aeb4: 41 14 cp r4, r1 2aeb6: 51 04 cpc r5, r1 2aeb8: 61 04 cpc r6, r1 2aeba: 71 04 cpc r7, r1 2aebc: 09 f4 brne .+2 ; 0x2aec0 2aebe: 59 c0 rjmp .+178 ; 0x2af72 // try to make file contiguous bgnCluster = *curCluster + 1; 2aec0: bf ef ldi r27, 0xFF ; 255 2aec2: 4b 1a sub r4, r27 2aec4: 5b 0a sbc r5, r27 2aec6: 6b 0a sbc r6, r27 2aec8: 7b 0a sbc r7, r27 // don't save new start location setStart = false; 2aeca: 31 2c mov r3, r1 // save next search start if one cluster setStart = count == 1; } // end of group endCluster = bgnCluster; 2aecc: 73 01 movw r14, r6 2aece: 62 01 movw r12, r4 // search the FAT for free clusters for (uint32_t n = 0;; n++, endCluster++) { 2aed0: 1d 82 std Y+5, r1 ; 0x05 2aed2: 1e 82 std Y+6, r1 ; 0x06 2aed4: 1f 82 std Y+7, r1 ; 0x07 2aed6: 18 86 std Y+8, r1 ; 0x08 // can't find space checked all clusters if (n >= clusterCount_) goto fail; 2aed8: f4 01 movw r30, r8 2aeda: 81 85 ldd r24, Z+9 ; 0x09 2aedc: 92 85 ldd r25, Z+10 ; 0x0a 2aede: a3 85 ldd r26, Z+11 ; 0x0b 2aee0: b4 85 ldd r27, Z+12 ; 0x0c 2aee2: 2d 81 ldd r18, Y+5 ; 0x05 2aee4: 3e 81 ldd r19, Y+6 ; 0x06 2aee6: 4f 81 ldd r20, Y+7 ; 0x07 2aee8: 58 85 ldd r21, Y+8 ; 0x08 2aeea: 28 17 cp r18, r24 2aeec: 39 07 cpc r19, r25 2aeee: 4a 07 cpc r20, r26 2aef0: 5b 07 cpc r21, r27 2aef2: 08 f0 brcs .+2 ; 0x2aef6 2aef4: 56 c0 rjmp .+172 ; 0x2afa2 // past end - start from beginning of FAT if (endCluster > fatEnd) { 2aef6: 89 85 ldd r24, Y+9 ; 0x09 2aef8: 9a 85 ldd r25, Y+10 ; 0x0a 2aefa: ab 85 ldd r26, Y+11 ; 0x0b 2aefc: bc 85 ldd r27, Y+12 ; 0x0c 2aefe: 8c 15 cp r24, r12 2af00: 9d 05 cpc r25, r13 2af02: ae 05 cpc r26, r14 2af04: bf 05 cpc r27, r15 2af06: 50 f4 brcc .+20 ; 0x2af1c bgnCluster = endCluster = 2; 2af08: 82 e0 ldi r24, 0x02 ; 2 2af0a: c8 2e mov r12, r24 2af0c: d1 2c mov r13, r1 2af0e: e1 2c mov r14, r1 2af10: f1 2c mov r15, r1 2af12: 92 e0 ldi r25, 0x02 ; 2 2af14: 49 2e mov r4, r25 2af16: 51 2c mov r5, r1 2af18: 61 2c mov r6, r1 2af1a: 71 2c mov r7, r1 } uint32_t f; if (!fatGet(endCluster, &f)) goto fail; 2af1c: 9e 01 movw r18, r28 2af1e: 2f 5f subi r18, 0xFF ; 255 2af20: 3f 4f sbci r19, 0xFF ; 255 2af22: b7 01 movw r22, r14 2af24: a6 01 movw r20, r12 2af26: c4 01 movw r24, r8 2af28: 0f 94 dc 54 call 0x2a9b8 ; 0x2a9b8 2af2c: 88 23 and r24, r24 2af2e: c9 f1 breq .+114 ; 0x2afa2 if (f != 0) { 2af30: 89 81 ldd r24, Y+1 ; 0x01 2af32: 9a 81 ldd r25, Y+2 ; 0x02 2af34: ab 81 ldd r26, Y+3 ; 0x03 2af36: bc 81 ldd r27, Y+4 ; 0x04 2af38: 89 2b or r24, r25 2af3a: 8a 2b or r24, r26 2af3c: 8b 2b or r24, r27 2af3e: 01 f1 breq .+64 ; 0x2af80 // cluster in use try next cluster as bgnCluster bgnCluster = endCluster + 1; 2af40: 26 01 movw r4, r12 2af42: 37 01 movw r6, r14 2af44: 9f ef ldi r25, 0xFF ; 255 2af46: 49 1a sub r4, r25 2af48: 59 0a sbc r5, r25 2af4a: 69 0a sbc r6, r25 2af4c: 79 0a sbc r7, r25 } // end of group endCluster = bgnCluster; // search the FAT for free clusters for (uint32_t n = 0;; n++, endCluster++) { 2af4e: 2d 81 ldd r18, Y+5 ; 0x05 2af50: 3e 81 ldd r19, Y+6 ; 0x06 2af52: 4f 81 ldd r20, Y+7 ; 0x07 2af54: 58 85 ldd r21, Y+8 ; 0x08 2af56: 2f 5f subi r18, 0xFF ; 255 2af58: 3f 4f sbci r19, 0xFF ; 255 2af5a: 4f 4f sbci r20, 0xFF ; 255 2af5c: 5f 4f sbci r21, 0xFF ; 255 2af5e: 2d 83 std Y+5, r18 ; 0x05 2af60: 3e 83 std Y+6, r19 ; 0x06 2af62: 4f 83 std Y+7, r20 ; 0x07 2af64: 58 87 std Y+8, r21 ; 0x08 2af66: 3f ef ldi r19, 0xFF ; 255 2af68: c3 1a sub r12, r19 2af6a: d3 0a sbc r13, r19 2af6c: e3 0a sbc r14, r19 2af6e: f3 0a sbc r15, r19 2af70: b3 cf rjmp .-154 ; 0x2aed8 // don't save new start location setStart = false; } else { // start at likely place for free cluster bgnCluster = allocSearchStart_; 2af72: 40 80 ld r4, Z 2af74: 51 80 ldd r5, Z+1 ; 0x01 2af76: 62 80 ldd r6, Z+2 ; 0x02 2af78: 73 80 ldd r7, Z+3 ; 0x03 // save next search start if one cluster setStart = count == 1; 2af7a: 33 24 eor r3, r3 2af7c: 33 94 inc r3 2af7e: a6 cf rjmp .-180 ; 0x2aecc 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) { 2af80: c4 14 cp r12, r4 2af82: d5 04 cpc r13, r5 2af84: e6 04 cpc r14, r6 2af86: f7 04 cpc r15, r7 2af88: 11 f7 brne .-60 ; 0x2af4e 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); 2af8a: 0f ef ldi r16, 0xFF ; 255 2af8c: 1f ef ldi r17, 0xFF ; 255 2af8e: 2f ef ldi r18, 0xFF ; 255 2af90: 3f e0 ldi r19, 0x0F ; 15 2af92: b7 01 movw r22, r14 2af94: a6 01 movw r20, r12 2af96: c4 01 movw r24, r8 2af98: 0f 94 4a 54 call 0x2a894 ; 0x2a894 2af9c: 78 2e mov r7, r24 // done - found space break; } } // mark end of chain if (!fatPutEOC(endCluster)) goto fail; 2af9e: 81 11 cpse r24, r1 2afa0: 1a c0 rjmp .+52 ; 0x2afd6 flags_ |= F_FILE_DIR_DIRTY; } return true; fail: return false; 2afa2: 71 2c mov r7, r1 } 2afa4: 87 2d mov r24, r7 2afa6: 2c 96 adiw r28, 0x0c ; 12 2afa8: 0f b6 in r0, 0x3f ; 63 2afaa: f8 94 cli 2afac: de bf out 0x3e, r29 ; 62 2afae: 0f be out 0x3f, r0 ; 63 2afb0: cd bf out 0x3d, r28 ; 61 2afb2: df 91 pop r29 2afb4: cf 91 pop r28 2afb6: 1f 91 pop r17 2afb8: 0f 91 pop r16 2afba: ff 90 pop r15 2afbc: ef 90 pop r14 2afbe: df 90 pop r13 2afc0: cf 90 pop r12 2afc2: bf 90 pop r11 2afc4: af 90 pop r10 2afc6: 9f 90 pop r9 2afc8: 8f 90 pop r8 2afca: 7f 90 pop r7 2afcc: 6f 90 pop r6 2afce: 5f 90 pop r5 2afd0: 4f 90 pop r4 2afd2: 3f 90 pop r3 2afd4: 08 95 ret // link clusters while (endCluster > bgnCluster) { if (!fatPut(endCluster - 1, endCluster)) goto fail; endCluster--; } if (*curCluster != 0) { 2afd6: f5 01 movw r30, r10 2afd8: 44 81 ldd r20, Z+4 ; 0x04 2afda: 55 81 ldd r21, Z+5 ; 0x05 2afdc: 66 81 ldd r22, Z+6 ; 0x06 2afde: 77 81 ldd r23, Z+7 ; 0x07 2afe0: 41 15 cp r20, r1 2afe2: 51 05 cpc r21, r1 2afe4: 61 05 cpc r22, r1 2afe6: 71 05 cpc r23, r1 2afe8: 39 f0 breq .+14 ; 0x2aff8 // connect chains if (!fatPut(*curCluster, bgnCluster)) goto fail; 2afea: 97 01 movw r18, r14 2afec: 86 01 movw r16, r12 2afee: c4 01 movw r24, r8 2aff0: 0f 94 4a 54 call 0x2a894 ; 0x2a894 2aff4: 88 23 and r24, r24 2aff6: a9 f2 breq .-86 ; 0x2afa2 } // return first cluster number to caller *curCluster = bgnCluster; 2aff8: d5 01 movw r26, r10 2affa: 14 96 adiw r26, 0x04 ; 4 2affc: cd 92 st X+, r12 2affe: dd 92 st X+, r13 2b000: ed 92 st X+, r14 2b002: fc 92 st X, r15 2b004: 17 97 sbiw r26, 0x07 ; 7 // remember possible next free cluster if (setStart) allocSearchStart_ = bgnCluster + 1; 2b006: 33 20 and r3, r3 2b008: 51 f0 breq .+20 ; 0x2b01e 2b00a: d7 01 movw r26, r14 2b00c: c6 01 movw r24, r12 2b00e: 01 96 adiw r24, 0x01 ; 1 2b010: a1 1d adc r26, r1 2b012: b1 1d adc r27, r1 2b014: f4 01 movw r30, r8 2b016: 80 83 st Z, r24 2b018: 91 83 std Z+1, r25 ; 0x01 2b01a: a2 83 std Z+2, r26 ; 0x02 2b01c: 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) { 2b01e: f5 01 movw r30, r10 2b020: 85 89 ldd r24, Z+21 ; 0x15 2b022: 96 89 ldd r25, Z+22 ; 0x16 2b024: a7 89 ldd r26, Z+23 ; 0x17 2b026: b0 8d ldd r27, Z+24 ; 0x18 2b028: 89 2b or r24, r25 2b02a: 8a 2b or r24, r26 2b02c: 8b 2b or r24, r27 2b02e: 09 f0 breq .+2 ; 0x2b032 2b030: b9 cf rjmp .-142 ; 0x2afa4 firstCluster_ = curCluster_; 2b032: c5 8a std Z+21, r12 ; 0x15 2b034: d6 8a std Z+22, r13 ; 0x16 2b036: e7 8a std Z+23, r14 ; 0x17 2b038: f0 8e std Z+24, r15 ; 0x18 flags_ |= F_FILE_DIR_DIRTY; 2b03a: 81 81 ldd r24, Z+1 ; 0x01 2b03c: 80 68 ori r24, 0x80 ; 128 2b03e: 81 83 std Z+1, r24 ; 0x01 2b040: b1 cf rjmp .-158 ; 0x2afa4 0002b042 : return false; } //------------------------------------------------------------------------------ // cache a file's directory entry // return pointer to cached entry or null for failure dir_t* SdBaseFile::cacheDirEntry(uint8_t action) { 2b042: cf 93 push r28 2b044: df 93 push r29 2b046: ec 01 movw r28, r24 if (!vol_->cacheRawBlock(dirBlock_, action)) goto fail; 2b048: 46 2f mov r20, r22 2b04a: 41 70 andi r20, 0x01 ; 1 2b04c: 6c 85 ldd r22, Y+12 ; 0x0c 2b04e: 7d 85 ldd r23, Y+13 ; 0x0d 2b050: 8e 85 ldd r24, Y+14 ; 0x0e 2b052: 9f 85 ldd r25, Y+15 ; 0x0f 2b054: 0f 94 0d 54 call 0x2a81a ; 0x2a81a 2b058: 88 23 and r24, r24 2b05a: 51 f0 breq .+20 ; 0x2b070 return vol_->cache()->dir + dirIndex_; 2b05c: 88 89 ldd r24, Y+16 ; 0x10 2b05e: 20 e2 ldi r18, 0x20 ; 32 2b060: 82 9f mul r24, r18 2b062: c0 01 movw r24, r0 2b064: 11 24 eor r1, r1 2b066: 83 56 subi r24, 0x63 ; 99 2b068: 91 4f sbci r25, 0xF1 ; 241 fail: return 0; } 2b06a: df 91 pop r29 2b06c: cf 91 pop r28 2b06e: 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; 2b070: 90 e0 ldi r25, 0x00 ; 0 2b072: 80 e0 ldi r24, 0x00 ; 0 2b074: fa cf rjmp .-12 ; 0x2b06a 0002b076 : * \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() { 2b076: cf 93 push r28 2b078: df 93 push r29 2b07a: ec 01 movw r28, r24 // only allow open files and directories if (!isOpen()) goto fail; 2b07c: 8b 81 ldd r24, Y+3 ; 0x03 2b07e: 88 23 and r24, r24 2b080: 49 f1 breq .+82 ; 0x2b0d4 if (flags_ & F_FILE_DIR_DIRTY) { 2b082: 89 81 ldd r24, Y+1 ; 0x01 2b084: 87 ff sbrs r24, 7 2b086: 22 c0 rjmp .+68 ; 0x2b0cc dir_t* d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 2b088: 61 e0 ldi r22, 0x01 ; 1 2b08a: ce 01 movw r24, r28 2b08c: 0f 94 21 58 call 0x2b042 ; 0x2b042 2b090: fc 01 movw r30, r24 // check for deleted by another open file object if (!d || d->name[0] == DIR_NAME_DELETED) goto fail; 2b092: 89 2b or r24, r25 2b094: f9 f0 breq .+62 ; 0x2b0d4 2b096: 80 81 ld r24, Z 2b098: 85 3e cpi r24, 0xE5 ; 229 2b09a: e1 f0 breq .+56 ; 0x2b0d4 // do not set filesize for dir files if (!isDir()) d->fileSize = fileSize_; 2b09c: 8b 81 ldd r24, Y+3 ; 0x03 2b09e: 82 30 cpi r24, 0x02 ; 2 2b0a0: 40 f4 brcc .+16 ; 0x2b0b2 2b0a2: 89 89 ldd r24, Y+17 ; 0x11 2b0a4: 9a 89 ldd r25, Y+18 ; 0x12 2b0a6: ab 89 ldd r26, Y+19 ; 0x13 2b0a8: bc 89 ldd r27, Y+20 ; 0x14 2b0aa: 84 8f std Z+28, r24 ; 0x1c 2b0ac: 95 8f std Z+29, r25 ; 0x1d 2b0ae: a6 8f std Z+30, r26 ; 0x1e 2b0b0: b7 8f std Z+31, r27 ; 0x1f // update first cluster fields d->firstClusterLow = firstCluster_ & 0XFFFF; 2b0b2: 8d 89 ldd r24, Y+21 ; 0x15 2b0b4: 9e 89 ldd r25, Y+22 ; 0x16 2b0b6: 93 8f std Z+27, r25 ; 0x1b 2b0b8: 82 8f std Z+26, r24 ; 0x1a d->firstClusterHigh = firstCluster_ >> 16; 2b0ba: 8d 89 ldd r24, Y+21 ; 0x15 2b0bc: 9e 89 ldd r25, Y+22 ; 0x16 2b0be: af 89 ldd r26, Y+23 ; 0x17 2b0c0: b8 8d ldd r27, Y+24 ; 0x18 2b0c2: b5 8b std Z+21, r27 ; 0x15 2b0c4: 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; 2b0c6: 89 81 ldd r24, Y+1 ; 0x01 2b0c8: 8f 77 andi r24, 0x7F ; 127 2b0ca: 89 83 std Y+1, r24 ; 0x01 return vol_->cacheFlush(); fail: writeError = true; return false; } 2b0cc: df 91 pop r29 2b0ce: cf 91 pop r28 d->lastAccessDate = d->lastWriteDate; } // clear directory dirty flags_ &= ~F_FILE_DIR_DIRTY; } return vol_->cacheFlush(); 2b0d0: 0d 94 15 53 jmp 0x2a62a ; 0x2a62a fail: writeError = true; 2b0d4: 81 e0 ldi r24, 0x01 ; 1 2b0d6: 88 83 st Y, r24 return false; } 2b0d8: 80 e0 ldi r24, 0x00 ; 0 2b0da: df 91 pop r29 2b0dc: cf 91 pop r28 2b0de: 08 95 ret 0002b0e0 : * * \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() { 2b0e0: cf 93 push r28 2b0e2: df 93 push r29 2b0e4: ec 01 movw r28, r24 bool rtn = sync(); 2b0e6: 0f 94 3b 58 call 0x2b076 ; 0x2b076 type_ = FAT_FILE_TYPE_CLOSED; 2b0ea: 1b 82 std Y+3, r1 ; 0x03 return rtn; } 2b0ec: df 91 pop r29 2b0ee: cf 91 pop r28 2b0f0: 08 95 ret 0002b0f2 : * \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) { 2b0f2: cf 93 push r28 2b0f4: df 93 push r29 2b0f6: eb 01 movw r28, r22 2b0f8: fc 01 movw r30, r24 2b0fa: 23 81 ldd r18, Z+3 ; 0x03 if (!isOpen()) return false; 2b0fc: 21 11 cpse r18, r1 2b0fe: 04 c0 rjmp .+8 ; 0x2b108 2b100: 80 e0 ldi r24, 0x00 ; 0 if (!p) return false; // format name dirName(*p, name); return true; } 2b102: df 91 pop r29 2b104: cf 91 pop r28 2b106: 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; 2b108: 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()) { 2b10a: 22 30 cpi r18, 0x02 ; 2 2b10c: 28 f4 brcc .+10 ; 0x2b118 name[0] = '/'; 2b10e: 8f e2 ldi r24, 0x2F ; 47 2b110: 88 83 st Y, r24 name[1] = '\0'; 2b112: 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; 2b114: 81 e0 ldi r24, 0x01 ; 1 2b116: f5 cf rjmp .-22 ; 0x2b102 name[0] = '/'; name[1] = '\0'; return true; } // cache entry dir_t* p = cacheDirEntry(SdVolume::CACHE_FOR_READ); 2b118: 60 e0 ldi r22, 0x00 ; 0 2b11a: 0f 94 21 58 call 0x2b042 ; 0x2b042 if (!p) return false; 2b11e: 00 97 sbiw r24, 0x00 ; 0 2b120: 79 f3 breq .-34 ; 0x2b100 2b122: 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; 2b124: 60 e0 ldi r22, 0x00 ; 0 for (uint8_t i = 0; i < 11; i++) { 2b126: 80 e0 ldi r24, 0x00 ; 0 if (dir.name[i] == ' ')continue; if (i == 8) name[j++] = '.'; 2b128: 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; 2b12a: 2d 91 ld r18, X+ 2b12c: 20 32 cpi r18, 0x20 ; 32 2b12e: 99 f0 breq .+38 ; 0x2b156 if (i == 8) name[j++] = '.'; 2b130: 88 30 cpi r24, 0x08 ; 8 2b132: 31 f4 brne .+12 ; 0x2b140 2b134: 9e 01 movw r18, r28 2b136: 26 0f add r18, r22 2b138: 31 1d adc r19, r1 2b13a: f9 01 movw r30, r18 2b13c: 90 83 st Z, r25 2b13e: 6f 5f subi r22, 0xFF ; 255 name[j++] = dir.name[i]; 2b140: 9e 01 movw r18, r28 2b142: 26 0f add r18, r22 2b144: 31 1d adc r19, r1 2b146: ad 01 movw r20, r26 2b148: 41 50 subi r20, 0x01 ; 1 2b14a: 51 09 sbc r21, r1 2b14c: fa 01 movw r30, r20 2b14e: 40 81 ld r20, Z 2b150: f9 01 movw r30, r18 2b152: 40 83 st Z, r20 2b154: 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++) { 2b156: 8f 5f subi r24, 0xFF ; 255 2b158: 8b 30 cpi r24, 0x0B ; 11 2b15a: 39 f7 brne .-50 ; 0x2b12a if (dir.name[i] == ' ')continue; if (i == 8) name[j++] = '.'; name[j++] = dir.name[i]; } name[j] = 0; 2b15c: fe 01 movw r30, r28 2b15e: e6 0f add r30, r22 2b160: f1 1d adc r31, r1 2b162: 10 82 st Z, r1 2b164: d7 cf rjmp .-82 ; 0x2b114 0002b166 : * 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) { 2b166: 2f 92 push r2 2b168: 3f 92 push r3 2b16a: 4f 92 push r4 2b16c: 5f 92 push r5 2b16e: 6f 92 push r6 2b170: 7f 92 push r7 2b172: 8f 92 push r8 2b174: 9f 92 push r9 2b176: af 92 push r10 2b178: bf 92 push r11 2b17a: cf 92 push r12 2b17c: df 92 push r13 2b17e: ef 92 push r14 2b180: ff 92 push r15 2b182: 0f 93 push r16 2b184: 1f 93 push r17 2b186: cf 93 push r28 2b188: df 93 push r29 2b18a: 00 d0 rcall .+0 ; 0x2b18c 2b18c: 1f 92 push r1 2b18e: cd b7 in r28, 0x3d ; 61 2b190: de b7 in r29, 0x3e ; 62 2b192: 9c 83 std Y+4, r25 ; 0x04 2b194: 8b 83 std Y+3, r24 ; 0x03 2b196: 4b 01 movw r8, r22 2b198: 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; 2b19a: dc 01 movw r26, r24 2b19c: 13 96 adiw r26, 0x03 ; 3 2b19e: 8c 91 ld r24, X 2b1a0: 81 11 cpse r24, r1 2b1a2: 19 c0 rjmp .+50 ; 0x2b1d6 toRead -= n; } return nbyte; fail: return -1; 2b1a4: 8f ef ldi r24, 0xFF ; 255 2b1a6: 9f ef ldi r25, 0xFF ; 255 } 2b1a8: 0f 90 pop r0 2b1aa: 0f 90 pop r0 2b1ac: 0f 90 pop r0 2b1ae: 0f 90 pop r0 2b1b0: df 91 pop r29 2b1b2: cf 91 pop r28 2b1b4: 1f 91 pop r17 2b1b6: 0f 91 pop r16 2b1b8: ff 90 pop r15 2b1ba: ef 90 pop r14 2b1bc: df 90 pop r13 2b1be: cf 90 pop r12 2b1c0: bf 90 pop r11 2b1c2: af 90 pop r10 2b1c4: 9f 90 pop r9 2b1c6: 8f 90 pop r8 2b1c8: 7f 90 pop r7 2b1ca: 6f 90 pop r6 2b1cc: 5f 90 pop r5 2b1ce: 4f 90 pop r4 2b1d0: 3f 90 pop r3 2b1d2: 2f 90 pop r2 2b1d4: 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; 2b1d6: eb 81 ldd r30, Y+3 ; 0x03 2b1d8: fc 81 ldd r31, Y+4 ; 0x04 2b1da: 81 81 ldd r24, Z+1 ; 0x01 2b1dc: 80 ff sbrs r24, 0 2b1de: e2 cf rjmp .-60 ; 0x2b1a4 // max bytes left in file if (nbyte >= (fileSize_ - curPosition_)) { 2b1e0: 01 89 ldd r16, Z+17 ; 0x11 2b1e2: 12 89 ldd r17, Z+18 ; 0x12 2b1e4: 23 89 ldd r18, Z+19 ; 0x13 2b1e6: 34 89 ldd r19, Z+20 ; 0x14 2b1e8: 40 85 ldd r20, Z+8 ; 0x08 2b1ea: 51 85 ldd r21, Z+9 ; 0x09 2b1ec: 62 85 ldd r22, Z+10 ; 0x0a 2b1ee: 73 85 ldd r23, Z+11 ; 0x0b 2b1f0: c7 01 movw r24, r14 2b1f2: b0 e0 ldi r27, 0x00 ; 0 2b1f4: a0 e0 ldi r26, 0x00 ; 0 2b1f6: 28 01 movw r4, r16 2b1f8: 39 01 movw r6, r18 2b1fa: 44 1a sub r4, r20 2b1fc: 55 0a sbc r5, r21 2b1fe: 66 0a sbc r6, r22 2b200: 77 0a sbc r7, r23 2b202: 84 15 cp r24, r4 2b204: 95 05 cpc r25, r5 2b206: a6 05 cpc r26, r6 2b208: b7 05 cpc r27, r7 2b20a: 18 f0 brcs .+6 ; 0x2b212 nbyte = fileSize_ - curPosition_; 2b20c: 78 01 movw r14, r16 2b20e: e4 1a sub r14, r20 2b210: f5 0a sbc r15, r21 } // amount left to read toRead = nbyte; 2b212: 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; 2b214: 8b 81 ldd r24, Y+3 ; 0x03 2b216: 9c 81 ldd r25, Y+4 ; 0x04 2b218: 04 96 adiw r24, 0x04 ; 4 2b21a: 9a 83 std Y+2, r25 ; 0x02 2b21c: 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; 2b21e: 61 2c mov r6, r1 2b220: 32 e0 ldi r19, 0x02 ; 2 2b222: 73 2e mov r7, r19 if (nbyte >= (fileSize_ - curPosition_)) { nbyte = fileSize_ - curPosition_; } // amount left to read toRead = nbyte; while (toRead > 0) { 2b224: c1 14 cp r12, r1 2b226: d1 04 cpc r13, r1 2b228: 09 f4 brne .+2 ; 0x2b22c 2b22a: b7 c0 rjmp .+366 ; 0x2b39a offset = curPosition_ & 0X1FF; // offset in block 2b22c: ab 81 ldd r26, Y+3 ; 0x03 2b22e: bc 81 ldd r27, Y+4 ; 0x04 2b230: 18 96 adiw r26, 0x08 ; 8 2b232: 4d 91 ld r20, X+ 2b234: 5d 91 ld r21, X+ 2b236: 6d 91 ld r22, X+ 2b238: 7c 91 ld r23, X 2b23a: 1b 97 sbiw r26, 0x0b ; 11 2b23c: 5a 01 movw r10, r20 2b23e: b1 e0 ldi r27, 0x01 ; 1 2b240: bb 22 and r11, r27 2b242: eb 81 ldd r30, Y+3 ; 0x03 2b244: fc 81 ldd r31, Y+4 ; 0x04 2b246: 81 8d ldd r24, Z+25 ; 0x19 2b248: 92 8d ldd r25, Z+26 ; 0x1a 2b24a: 1a 01 movw r2, r20 2b24c: 2b 01 movw r4, r22 2b24e: 29 e0 ldi r18, 0x09 ; 9 2b250: 56 94 lsr r5 2b252: 47 94 ror r4 2b254: 37 94 ror r3 2b256: 27 94 ror r2 2b258: 2a 95 dec r18 2b25a: d1 f7 brne .-12 ; 0x2b250 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 2b25c: 23 81 ldd r18, Z+3 ; 0x03 2b25e: 22 30 cpi r18, 0x02 ; 2 2b260: 91 f5 brne .+100 ; 0x2b2c6 block = vol_->rootDirStart() + (curPosition_ >> 9); 2b262: dc 01 movw r26, r24 2b264: 5a 96 adiw r26, 0x1a ; 26 2b266: 6d 91 ld r22, X+ 2b268: 7d 91 ld r23, X+ 2b26a: 8d 91 ld r24, X+ 2b26c: 9c 91 ld r25, X 2b26e: 5d 97 sbiw r26, 0x1d ; 29 2b270: 62 0d add r22, r2 2b272: 73 1d adc r23, r3 2b274: 84 1d adc r24, r4 2b276: 95 1d adc r25, r5 2b278: 83 01 movw r16, r6 2b27a: 0a 19 sub r16, r10 2b27c: 1b 09 sbc r17, r11 2b27e: c0 16 cp r12, r16 2b280: d1 06 cpc r13, r17 2b282: 08 f4 brcc .+2 ; 0x2b286 2b284: 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()) { 2b286: 01 15 cp r16, r1 2b288: b2 e0 ldi r27, 0x02 ; 2 2b28a: 1b 07 cpc r17, r27 2b28c: 71 f4 brne .+28 ; 0x2b2aa 2b28e: 20 91 91 0e lds r18, 0x0E91 ; 0x800e91 2b292: 30 91 92 0e lds r19, 0x0E92 ; 0x800e92 2b296: 40 91 93 0e lds r20, 0x0E93 ; 0x800e93 2b29a: 50 91 94 0e lds r21, 0x0E94 ; 0x800e94 2b29e: 62 17 cp r22, r18 2b2a0: 73 07 cpc r23, r19 2b2a2: 84 07 cpc r24, r20 2b2a4: 95 07 cpc r25, r21 2b2a6: 09 f0 breq .+2 ; 0x2b2aa 2b2a8: 59 c0 rjmp .+178 ; 0x2b35c 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; 2b2aa: 40 e0 ldi r20, 0x00 ; 0 2b2ac: 0f 94 0d 54 call 0x2a81a ; 0x2a81a 2b2b0: 88 23 and r24, r24 2b2b2: 09 f4 brne .+2 ; 0x2b2b6 2b2b4: 77 cf rjmp .-274 ; 0x2b1a4 uint8_t* src = vol_->cache()->data + offset; 2b2b6: b5 01 movw r22, r10 2b2b8: 63 56 subi r22, 0x63 ; 99 2b2ba: 71 4f sbci r23, 0xF1 ; 241 memcpy(dst, src, n); 2b2bc: a8 01 movw r20, r16 2b2be: c4 01 movw r24, r8 2b2c0: 0f 94 45 e2 call 0x3c48a ; 0x3c48a 2b2c4: 57 c0 rjmp .+174 ; 0x2b374 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);} 2b2c6: fc 01 movw r30, r24 2b2c8: 14 81 ldd r17, Z+4 ; 0x04 2b2ca: 11 50 subi r17, 0x01 ; 1 2b2cc: 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) { 2b2ce: a1 14 cp r10, r1 2b2d0: b1 04 cpc r11, r1 2b2d2: 81 f4 brne .+32 ; 0x2b2f4 2b2d4: 11 11 cpse r17, r1 2b2d6: 0e c0 rjmp .+28 ; 0x2b2f4 // start of new cluster if (curPosition_ == 0) { 2b2d8: 45 2b or r20, r21 2b2da: 46 2b or r20, r22 2b2dc: 47 2b or r20, r23 2b2de: 79 f5 brne .+94 ; 0x2b33e // use first cluster in file curCluster_ = firstCluster_; 2b2e0: eb 81 ldd r30, Y+3 ; 0x03 2b2e2: fc 81 ldd r31, Y+4 ; 0x04 2b2e4: 85 89 ldd r24, Z+21 ; 0x15 2b2e6: 96 89 ldd r25, Z+22 ; 0x16 2b2e8: a7 89 ldd r26, Z+23 ; 0x17 2b2ea: b0 8d ldd r27, Z+24 ; 0x18 2b2ec: 84 83 std Z+4, r24 ; 0x04 2b2ee: 95 83 std Z+5, r25 ; 0x05 2b2f0: a6 83 std Z+6, r26 ; 0x06 2b2f2: 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; 2b2f4: ab 81 ldd r26, Y+3 ; 0x03 2b2f6: bc 81 ldd r27, Y+4 ; 0x04 2b2f8: 59 96 adiw r26, 0x19 ; 25 2b2fa: ed 91 ld r30, X+ 2b2fc: fc 91 ld r31, X 2b2fe: 5a 97 sbiw r26, 0x1a ; 26 uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 2b300: 14 96 adiw r26, 0x04 ; 4 2b302: 6d 91 ld r22, X+ 2b304: 7d 91 ld r23, X+ 2b306: 8d 91 ld r24, X+ 2b308: 9c 91 ld r25, X 2b30a: 17 97 sbiw r26, 0x07 ; 7 2b30c: 62 50 subi r22, 0x02 ; 2 2b30e: 71 09 sbc r23, r1 2b310: 81 09 sbc r24, r1 2b312: 91 09 sbc r25, r1 2b314: 25 85 ldd r18, Z+13 ; 0x0d 2b316: 04 c0 rjmp .+8 ; 0x2b320 2b318: 66 0f add r22, r22 2b31a: 77 1f adc r23, r23 2b31c: 88 1f adc r24, r24 2b31e: 99 1f adc r25, r25 2b320: 2a 95 dec r18 2b322: d2 f7 brpl .-12 ; 0x2b318 2b324: 26 85 ldd r18, Z+14 ; 0x0e 2b326: 37 85 ldd r19, Z+15 ; 0x0f 2b328: 40 89 ldd r20, Z+16 ; 0x10 2b32a: 51 89 ldd r21, Z+17 ; 0x11 2b32c: 62 0f add r22, r18 2b32e: 73 1f adc r23, r19 2b330: 84 1f adc r24, r20 2b332: 95 1f adc r25, r21 2b334: 61 0f add r22, r17 2b336: 71 1d adc r23, r1 2b338: 81 1d adc r24, r1 2b33a: 91 1d adc r25, r1 2b33c: 9d cf rjmp .-198 ; 0x2b278 if (curPosition_ == 0) { // use first cluster in file curCluster_ = firstCluster_; } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 2b33e: ab 81 ldd r26, Y+3 ; 0x03 2b340: bc 81 ldd r27, Y+4 ; 0x04 2b342: 14 96 adiw r26, 0x04 ; 4 2b344: 4d 91 ld r20, X+ 2b346: 5d 91 ld r21, X+ 2b348: 6d 91 ld r22, X+ 2b34a: 7c 91 ld r23, X 2b34c: 17 97 sbiw r26, 0x07 ; 7 2b34e: 29 81 ldd r18, Y+1 ; 0x01 2b350: 3a 81 ldd r19, Y+2 ; 0x02 2b352: 0f 94 dc 54 call 0x2a9b8 ; 0x2a9b8 2b356: 81 11 cpse r24, r1 2b358: cd cf rjmp .-102 ; 0x2b2f4 2b35a: 24 cf rjmp .-440 ; 0x2b1a4 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);} 2b35c: 94 01 movw r18, r8 2b35e: ab 01 movw r20, r22 2b360: bc 01 movw r22, r24 2b362: 80 91 9a 0e lds r24, 0x0E9A ; 0x800e9a 2b366: 90 91 9b 0e lds r25, 0x0E9B ; 0x800e9b 2b36a: 0f 94 54 53 call 0x2a6a8 ; 0x2a6a8 // 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; 2b36e: 88 23 and r24, r24 2b370: 09 f4 brne .+2 ; 0x2b374 2b372: 18 cf rjmp .-464 ; 0x2b1a4 // 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; 2b374: 80 0e add r8, r16 2b376: 91 1e adc r9, r17 curPosition_ += n; 2b378: eb 81 ldd r30, Y+3 ; 0x03 2b37a: fc 81 ldd r31, Y+4 ; 0x04 2b37c: 80 85 ldd r24, Z+8 ; 0x08 2b37e: 91 85 ldd r25, Z+9 ; 0x09 2b380: a2 85 ldd r26, Z+10 ; 0x0a 2b382: b3 85 ldd r27, Z+11 ; 0x0b 2b384: 80 0f add r24, r16 2b386: 91 1f adc r25, r17 2b388: a1 1d adc r26, r1 2b38a: b1 1d adc r27, r1 2b38c: 80 87 std Z+8, r24 ; 0x08 2b38e: 91 87 std Z+9, r25 ; 0x09 2b390: a2 87 std Z+10, r26 ; 0x0a 2b392: b3 87 std Z+11, r27 ; 0x0b toRead -= n; 2b394: c0 1a sub r12, r16 2b396: d1 0a sbc r13, r17 2b398: 45 cf rjmp .-374 ; 0x2b224 } return nbyte; 2b39a: c7 01 movw r24, r14 2b39c: 05 cf rjmp .-502 ; 0x2b1a8 0002b39e : * 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) { 2b39e: df 92 push r13 2b3a0: ef 92 push r14 2b3a2: ff 92 push r15 2b3a4: 0f 93 push r16 2b3a6: 1f 93 push r17 2b3a8: cf 93 push r28 2b3aa: df 93 push r29 2b3ac: 8c 01 movw r16, r24 2b3ae: eb 01 movw r28, r22 2b3b0: 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; 2b3b2: 8d e0 ldi r24, 0x0D ; 13 2b3b4: d8 2e mov r13, r24 { longFilename[0] = '\0'; } while (1) { n = read(dir, sizeof(dir_t)); 2b3b6: 40 e2 ldi r20, 0x20 ; 32 2b3b8: 50 e0 ldi r21, 0x00 ; 0 2b3ba: be 01 movw r22, r28 2b3bc: c8 01 movw r24, r16 2b3be: 0f 94 b3 58 call 0x2b166 ; 0x2b166 if (n != sizeof(dir_t)) return n == 0 ? 0 : -1; 2b3c2: 80 32 cpi r24, 0x20 ; 32 2b3c4: 91 05 cpc r25, r1 2b3c6: 71 f0 breq .+28 ; 0x2b3e4 2b3c8: 21 e0 ldi r18, 0x01 ; 1 2b3ca: 89 2b or r24, r25 2b3cc: 09 f4 brne .+2 ; 0x2b3d0 2b3ce: 20 e0 ldi r18, 0x00 ; 0 2b3d0: 82 2f mov r24, r18 2b3d2: 81 95 neg r24 } } // return if normal file or subdirectory if (DIR_IS_FILE_OR_SUBDIR(dir)) return n; } } 2b3d4: df 91 pop r29 2b3d6: cf 91 pop r28 2b3d8: 1f 91 pop r17 2b3da: 0f 91 pop r16 2b3dc: ff 90 pop r15 2b3de: ef 90 pop r14 2b3e0: df 90 pop r13 2b3e2: 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; 2b3e4: 28 81 ld r18, Y 2b3e6: 22 23 and r18, r18 2b3e8: 09 f4 brne .+2 ; 0x2b3ec 2b3ea: 3f c0 rjmp .+126 ; 0x2b46a // skip empty entries and entry for . and .. if (dir->name[0] == DIR_NAME_DELETED || dir->name[0] == '.') continue; 2b3ec: 25 3e cpi r18, 0xE5 ; 229 2b3ee: 19 f3 breq .-58 ; 0x2b3b6 2b3f0: 2e 32 cpi r18, 0x2E ; 46 2b3f2: 09 f3 breq .-62 ; 0x2b3b6 //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) 2b3f4: 3b 85 ldd r19, Y+11 ; 0x0b 2b3f6: 3f 73 andi r19, 0x3F ; 63 2b3f8: 3f 30 cpi r19, 0x0F ; 15 2b3fa: 99 f5 brne .+102 ; 0x2b462 2b3fc: e1 14 cp r14, r1 2b3fe: f1 04 cpc r15, r1 2b400: 81 f1 breq .+96 ; 0x2b462 { 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) 2b402: 4a 8d ldd r20, Y+26 ; 0x1a 2b404: 5b 8d ldd r21, Y+27 ; 0x1b 2b406: 45 2b or r20, r21 2b408: 61 f5 brne .+88 ; 0x2b462 2b40a: 2f 71 andi r18, 0x1F ; 31 2b40c: 3f ef ldi r19, 0xFF ; 255 2b40e: 32 0f add r19, r18 2b410: 34 30 cpi r19, 0x04 ; 4 2b412: 38 f5 brcc .+78 ; 0x2b462 { //TODO: Store the filename checksum to verify if a none-long filename aware system modified the file table. n = ((VFAT->sequenceNumber & 0x1F) - 1) * 13; 2b414: 21 50 subi r18, 0x01 ; 1 2b416: 33 0b sbc r19, r19 2b418: d2 9e mul r13, r18 2b41a: c0 01 movw r24, r0 2b41c: d3 9e mul r13, r19 2b41e: 90 0d add r25, r0 2b420: 11 24 eor r1, r1 longFilename[n+0] = VFAT->name1[0]; 2b422: f7 01 movw r30, r14 2b424: e8 0f add r30, r24 2b426: f9 1f adc r31, r25 2b428: 29 81 ldd r18, Y+1 ; 0x01 2b42a: 20 83 st Z, r18 longFilename[n+1] = VFAT->name1[1]; 2b42c: 2b 81 ldd r18, Y+3 ; 0x03 2b42e: 21 83 std Z+1, r18 ; 0x01 longFilename[n+2] = VFAT->name1[2]; 2b430: 2d 81 ldd r18, Y+5 ; 0x05 2b432: 22 83 std Z+2, r18 ; 0x02 longFilename[n+3] = VFAT->name1[3]; 2b434: 2f 81 ldd r18, Y+7 ; 0x07 2b436: 23 83 std Z+3, r18 ; 0x03 longFilename[n+4] = VFAT->name1[4]; 2b438: 29 85 ldd r18, Y+9 ; 0x09 2b43a: 24 83 std Z+4, r18 ; 0x04 longFilename[n+5] = VFAT->name2[0]; 2b43c: 2e 85 ldd r18, Y+14 ; 0x0e 2b43e: 25 83 std Z+5, r18 ; 0x05 longFilename[n+6] = VFAT->name2[1]; 2b440: 28 89 ldd r18, Y+16 ; 0x10 2b442: 26 83 std Z+6, r18 ; 0x06 longFilename[n+7] = VFAT->name2[2]; 2b444: 2a 89 ldd r18, Y+18 ; 0x12 2b446: 27 83 std Z+7, r18 ; 0x07 longFilename[n+8] = VFAT->name2[3]; 2b448: 2c 89 ldd r18, Y+20 ; 0x14 2b44a: 20 87 std Z+8, r18 ; 0x08 longFilename[n+9] = VFAT->name2[4]; 2b44c: 2e 89 ldd r18, Y+22 ; 0x16 2b44e: 21 87 std Z+9, r18 ; 0x09 longFilename[n+10] = VFAT->name2[5]; 2b450: 28 8d ldd r18, Y+24 ; 0x18 2b452: 22 87 std Z+10, r18 ; 0x0a longFilename[n+11] = VFAT->name3[0]; 2b454: 2c 8d ldd r18, Y+28 ; 0x1c 2b456: 23 87 std Z+11, r18 ; 0x0b longFilename[n+12] = VFAT->name3[1]; 2b458: 2e 8d ldd r18, Y+30 ; 0x1e 2b45a: 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) 2b45c: 28 81 ld r18, Y 2b45e: 26 fd sbrc r18, 6 longFilename[n+13] = '\0'; 2b460: 15 86 std Z+13, r1 ; 0x0d } } // return if normal file or subdirectory if (DIR_IS_FILE_OR_SUBDIR(dir)) return n; 2b462: 2b 85 ldd r18, Y+11 ; 0x0b 2b464: 23 fd sbrc r18, 3 2b466: a7 cf rjmp .-178 ; 0x2b3b6 2b468: b5 cf rjmp .-150 ; 0x2b3d4 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; 2b46a: 80 e0 ldi r24, 0x00 ; 0 2b46c: b3 cf rjmp .-154 ; 0x2b3d4 0002b46e : return false; } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { 2b46e: 4f 92 push r4 2b470: 5f 92 push r5 2b472: 6f 92 push r6 2b474: 7f 92 push r7 2b476: af 92 push r10 2b478: bf 92 push r11 2b47a: cf 92 push r12 2b47c: df 92 push r13 2b47e: ef 92 push r14 2b480: ff 92 push r15 2b482: 0f 93 push r16 2b484: 1f 93 push r17 2b486: cf 93 push r28 2b488: df 93 push r29 2b48a: 1f 92 push r1 2b48c: cd b7 in r28, 0x3d ; 61 2b48e: de b7 in r29, 0x3e ; 62 2b490: 8c 01 movw r16, r24 2b492: 7b 01 movw r14, r22 2b494: 5a 01 movw r10, r20 2b496: c2 2e mov r12, r18 bool emptyFound = false; bool fileFound = false; uint8_t index; dir_t* p; vol_ = dirFile->vol_; 2b498: db 01 movw r26, r22 2b49a: 59 96 adiw r26, 0x19 ; 25 2b49c: 8d 91 ld r24, X+ 2b49e: 9c 91 ld r25, X 2b4a0: f8 01 movw r30, r16 2b4a2: 92 8f std Z+26, r25 ; 0x1a 2b4a4: 81 8f std Z+25, r24 ; 0x19 dirFile->rewind(); 2b4a6: cb 01 movw r24, r22 2b4a8: 0e 94 2c 77 call 0xee58 ; 0xee58 } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { bool emptyFound = false; 2b4ac: 71 2c mov r7, r1 vol_ = dirFile->vol_; dirFile->rewind(); // search for file while (dirFile->curPosition_ < dirFile->fileSize_) { 2b4ae: f7 01 movw r30, r14 2b4b0: 80 85 ldd r24, Z+8 ; 0x08 2b4b2: 91 85 ldd r25, Z+9 ; 0x09 2b4b4: a2 85 ldd r26, Z+10 ; 0x0a 2b4b6: b3 85 ldd r27, Z+11 ; 0x0b 2b4b8: 41 89 ldd r20, Z+17 ; 0x11 2b4ba: 52 89 ldd r21, Z+18 ; 0x12 2b4bc: 63 89 ldd r22, Z+19 ; 0x13 2b4be: 74 89 ldd r23, Z+20 ; 0x14 2b4c0: 84 17 cp r24, r20 2b4c2: 95 07 cpc r25, r21 2b4c4: a6 07 cpc r26, r22 2b4c6: b7 07 cpc r27, r23 2b4c8: 08 f0 brcs .+2 ; 0x2b4cc 2b4ca: 52 c0 rjmp .+164 ; 0x2b570 index = 0XF & (dirFile->curPosition_ >> 5); 2b4cc: 55 e0 ldi r21, 0x05 ; 5 2b4ce: b6 95 lsr r27 2b4d0: a7 95 ror r26 2b4d2: 97 95 ror r25 2b4d4: 87 95 ror r24 2b4d6: 5a 95 dec r21 2b4d8: d1 f7 brne .-12 ; 0x2b4ce 2b4da: f8 2f mov r31, r24 2b4dc: ff 70 andi r31, 0x0F ; 15 2b4de: 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; 2b4e0: d7 01 movw r26, r14 2b4e2: 13 96 adiw r26, 0x03 ; 3 2b4e4: 8c 91 ld r24, X 2b4e6: 82 30 cpi r24, 0x02 ; 2 2b4e8: 10 f4 brcc .+4 ; 0x2b4ee if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; fail: type_ = FAT_FILE_TYPE_CLOSED; return false; 2b4ea: 80 e0 ldi r24, 0x00 ; 0 2b4ec: db c0 rjmp .+438 ; 0x2b6a4 * \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; 2b4ee: 41 e0 ldi r20, 0x01 ; 1 2b4f0: 50 e0 ldi r21, 0x00 ; 0 2b4f2: be 01 movw r22, r28 2b4f4: 6f 5f subi r22, 0xFF ; 255 2b4f6: 7f 4f sbci r23, 0xFF ; 255 2b4f8: c7 01 movw r24, r14 2b4fa: 0f 94 b3 58 call 0x2b166 ; 0x2b166 2b4fe: 01 97 sbiw r24, 0x01 ; 1 2b500: a1 f7 brne .-24 ; 0x2b4ea // use read to locate and cache block if (read() < 0) goto fail; // advance to next entry curPosition_ += 31; 2b502: f7 01 movw r30, r14 2b504: 80 85 ldd r24, Z+8 ; 0x08 2b506: 91 85 ldd r25, Z+9 ; 0x09 2b508: a2 85 ldd r26, Z+10 ; 0x0a 2b50a: b3 85 ldd r27, Z+11 ; 0x0b 2b50c: 4f 96 adiw r24, 0x1f ; 31 2b50e: a1 1d adc r26, r1 2b510: b1 1d adc r27, r1 2b512: 80 87 std Z+8, r24 ; 0x08 2b514: 91 87 std Z+9, r25 ; 0x09 2b516: a2 87 std Z+10, r26 ; 0x0a 2b518: b3 87 std Z+11, r27 ; 0x0b // return pointer to entry return vol_->cache()->dir + i; 2b51a: f0 e2 ldi r31, 0x20 ; 32 2b51c: df 9e mul r13, r31 2b51e: b0 01 movw r22, r0 2b520: 11 24 eor r1, r1 2b522: 63 56 subi r22, 0x63 ; 99 2b524: 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; 2b526: 61 15 cp r22, r1 2b528: 71 05 cpc r23, r1 2b52a: f9 f2 breq .-66 ; 0x2b4ea if (p->name[0] == DIR_NAME_FREE || p->name[0] == DIR_NAME_DELETED) { 2b52c: db 01 movw r26, r22 2b52e: 8c 91 ld r24, X 2b530: 88 23 and r24, r24 2b532: 41 f0 breq .+16 ; 0x2b544 2b534: 85 3e cpi r24, 0xE5 ; 229 2b536: 09 f0 breq .+2 ; 0x2b53a 2b538: 4c c0 rjmp .+152 ; 0x2b5d2 // remember first empty slot if (!emptyFound) { 2b53a: 77 20 and r7, r7 2b53c: 29 f0 breq .+10 ; 0x2b548 return false; } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { 2b53e: 77 24 eor r7, r7 2b540: 73 94 inc r7 2b542: b5 cf rjmp .-150 ; 0x2b4ae 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) { 2b544: 71 10 cpse r7, r1 2b546: 0e c0 rjmp .+28 ; 0x2b564 dirBlock_ = dirFile->vol_->cacheBlockNumber(); 2b548: 80 91 91 0e lds r24, 0x0E91 ; 0x800e91 2b54c: 90 91 92 0e lds r25, 0x0E92 ; 0x800e92 2b550: a0 91 93 0e lds r26, 0x0E93 ; 0x800e93 2b554: b0 91 94 0e lds r27, 0x0E94 ; 0x800e94 2b558: f8 01 movw r30, r16 2b55a: 84 87 std Z+12, r24 ; 0x0c 2b55c: 95 87 std Z+13, r25 ; 0x0d 2b55e: a6 87 std Z+14, r26 ; 0x0e 2b560: b7 87 std Z+15, r27 ; 0x0f dirIndex_ = index; 2b562: d0 8a std Z+16, r13 ; 0x10 emptyFound = true; } // done if no entries follow if (p->name[0] == DIR_NAME_FREE) break; 2b564: db 01 movw r26, r22 2b566: 8c 91 ld r24, X 2b568: 81 11 cpse r24, r1 2b56a: e9 cf rjmp .-46 ; 0x2b53e 2b56c: 77 24 eor r7, r7 2b56e: 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; 2b570: 8c 2d mov r24, r12 2b572: 82 74 andi r24, 0x42 ; 66 2b574: 82 34 cpi r24, 0x42 ; 66 2b576: 09 f0 breq .+2 ; 0x2b57a 2b578: b8 cf rjmp .-144 ; 0x2b4ea if (emptyFound) { 2b57a: 77 20 and r7, r7 2b57c: 09 f4 brne .+2 ; 0x2b580 2b57e: a2 c0 rjmp .+324 ; 0x2b6c4 index = dirIndex_; 2b580: f8 01 movw r30, r16 2b582: d0 88 ldd r13, Z+16 ; 0x10 p = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 2b584: 61 e0 ldi r22, 0x01 ; 1 2b586: c8 01 movw r24, r16 2b588: 0f 94 21 58 call 0x2b042 ; 0x2b042 if (!p) goto fail; 2b58c: 00 97 sbiw r24, 0x00 ; 0 2b58e: 09 f4 brne .+2 ; 0x2b592 2b590: ac cf rjmp .-168 ; 0x2b4ea // use first entry in cluster p = dirFile->vol_->cache()->dir; index = 0; } // initialize as empty file memset(p, 0, sizeof(dir_t)); 2b592: 20 e2 ldi r18, 0x20 ; 32 2b594: dc 01 movw r26, r24 2b596: 1d 92 st X+, r1 2b598: 2a 95 dec r18 2b59a: e9 f7 brne .-6 ; 0x2b596 memcpy(p->name, dname, 11); 2b59c: 2b e0 ldi r18, 0x0B ; 11 2b59e: f5 01 movw r30, r10 2b5a0: dc 01 movw r26, r24 2b5a2: 01 90 ld r0, Z+ 2b5a4: 0d 92 st X+, r0 2b5a6: 2a 95 dec r18 2b5a8: e1 f7 brne .-8 ; 0x2b5a2 if (dateTime_) { // call user date/time function dateTime_(&p->creationDate, &p->creationTime); } else { // use default date/time p->creationDate = FAT_DEFAULT_DATE; 2b5aa: 21 e2 ldi r18, 0x21 ; 33 2b5ac: 38 e2 ldi r19, 0x28 ; 40 2b5ae: fc 01 movw r30, r24 2b5b0: 31 8b std Z+17, r19 ; 0x11 2b5b2: 20 8b std Z+16, r18 ; 0x10 p->creationTime = FAT_DEFAULT_TIME; 2b5b4: 40 e0 ldi r20, 0x00 ; 0 2b5b6: 58 e0 ldi r21, 0x08 ; 8 2b5b8: 57 87 std Z+15, r21 ; 0x0f 2b5ba: 46 87 std Z+14, r20 ; 0x0e } p->lastAccessDate = p->creationDate; 2b5bc: 33 8b std Z+19, r19 ; 0x13 2b5be: 22 8b std Z+18, r18 ; 0x12 p->lastWriteDate = p->creationDate; 2b5c0: 31 8f std Z+25, r19 ; 0x19 2b5c2: 20 8f std Z+24, r18 ; 0x18 p->lastWriteTime = p->creationTime; 2b5c4: 57 8b std Z+23, r21 ; 0x17 2b5c6: 46 8b std Z+22, r20 ; 0x16 // write entry to SD if (!dirFile->vol_->cacheFlush()) goto fail; 2b5c8: 0f 94 15 53 call 0x2a62a ; 0x2a62a 2b5cc: 81 11 cpse r24, r1 2b5ce: 09 c0 rjmp .+18 ; 0x2b5e2 2b5d0: 8c cf rjmp .-232 ; 0x2b4ea dirIndex_ = index; emptyFound = true; } // done if no entries follow if (p->name[0] == DIR_NAME_FREE) break; } else if (!memcmp(dname, p->name, 11)) { 2b5d2: 4b e0 ldi r20, 0x0B ; 11 2b5d4: 50 e0 ldi r21, 0x00 ; 0 2b5d6: c5 01 movw r24, r10 2b5d8: 0f 94 38 e2 call 0x3c470 ; 0x3c470 2b5dc: 89 2b or r24, r25 2b5de: 09 f0 breq .+2 ; 0x2b5e2 2b5e0: 66 cf rjmp .-308 ; 0x2b4ae } //------------------------------------------------------------------------------ // 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]; 2b5e2: f0 e2 ldi r31, 0x20 ; 32 2b5e4: df 9e mul r13, r31 2b5e6: d0 01 movw r26, r0 2b5e8: 11 24 eor r1, r1 2b5ea: 9d 01 movw r18, r26 2b5ec: 23 56 subi r18, 0x63 ; 99 2b5ee: 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)) { 2b5f0: f9 01 movw r30, r18 2b5f2: 83 85 ldd r24, Z+11 ; 0x0b 2b5f4: 81 71 andi r24, 0x11 ; 17 2b5f6: 21 f0 breq .+8 ; 0x2b600 if (oflag & (O_WRITE | O_TRUNC)) goto fail; 2b5f8: 8c 2d mov r24, r12 2b5fa: 82 71 andi r24, 0x12 ; 18 2b5fc: 09 f0 breq .+2 ; 0x2b600 2b5fe: fc c0 rjmp .+504 ; 0x2b7f8 } //------------------------------------------------------------------------------ // 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]; 2b600: f8 01 movw r30, r16 2b602: 81 8d ldd r24, Z+25 ; 0x19 2b604: 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(); 2b606: 40 91 91 0e lds r20, 0x0E91 ; 0x800e91 2b60a: 50 91 92 0e lds r21, 0x0E92 ; 0x800e92 2b60e: 60 91 93 0e lds r22, 0x0E93 ; 0x800e93 2b612: 70 91 94 0e lds r23, 0x0E94 ; 0x800e94 2b616: 44 87 std Z+12, r20 ; 0x0c 2b618: 55 87 std Z+13, r21 ; 0x0d 2b61a: 66 87 std Z+14, r22 ; 0x0e 2b61c: 77 87 std Z+15, r23 ; 0x0f dirIndex_ = dirIndex; 2b61e: d0 8a std Z+16, r13 ; 0x10 // copy first cluster number for directory fields firstCluster_ = (uint32_t)p->firstClusterHigh << 16; 2b620: fd 01 movw r30, r26 2b622: e3 56 subi r30, 0x63 ; 99 2b624: f1 4f sbci r31, 0xF1 ; 241 2b626: 44 88 ldd r4, Z+20 ; 0x14 2b628: 55 88 ldd r5, Z+21 ; 0x15 2b62a: 71 2c mov r7, r1 2b62c: 61 2c mov r6, r1 2b62e: 32 01 movw r6, r4 2b630: 55 24 eor r5, r5 2b632: 44 24 eor r4, r4 2b634: d8 01 movw r26, r16 2b636: 55 96 adiw r26, 0x15 ; 21 2b638: 4d 92 st X+, r4 2b63a: 5d 92 st X+, r5 2b63c: 6d 92 st X+, r6 2b63e: 7c 92 st X, r7 2b640: 58 97 sbiw r26, 0x18 ; 24 firstCluster_ |= p->firstClusterLow; 2b642: 42 8d ldd r20, Z+26 ; 0x1a 2b644: 53 8d ldd r21, Z+27 ; 0x1b 2b646: 70 e0 ldi r23, 0x00 ; 0 2b648: 60 e0 ldi r22, 0x00 ; 0 2b64a: 44 29 or r20, r4 2b64c: 55 29 or r21, r5 2b64e: 66 29 or r22, r6 2b650: 77 29 or r23, r7 2b652: 55 96 adiw r26, 0x15 ; 21 2b654: 4d 93 st X+, r20 2b656: 5d 93 st X+, r21 2b658: 6d 93 st X+, r22 2b65a: 7c 93 st X, r23 2b65c: 58 97 sbiw r26, 0x18 ; 24 2b65e: d9 01 movw r26, r18 2b660: 1b 96 adiw r26, 0x0b ; 11 2b662: 2c 91 ld r18, X 2b664: 28 71 andi r18, 0x18 ; 24 // make sure it is a normal file or subdirectory if (DIR_IS_FILE(p)) { 2b666: 09 f0 breq .+2 ; 0x2b66a 2b668: b9 c0 rjmp .+370 ; 0x2b7dc fileSize_ = p->fileSize; 2b66a: 84 8d ldd r24, Z+28 ; 0x1c 2b66c: 95 8d ldd r25, Z+29 ; 0x1d 2b66e: a6 8d ldd r26, Z+30 ; 0x1e 2b670: b7 8d ldd r27, Z+31 ; 0x1f 2b672: f8 01 movw r30, r16 2b674: 81 8b std Z+17, r24 ; 0x11 2b676: 92 8b std Z+18, r25 ; 0x12 2b678: a3 8b std Z+19, r26 ; 0x13 2b67a: b4 8b std Z+20, r27 ; 0x14 type_ = FAT_FILE_TYPE_NORMAL; 2b67c: 81 e0 ldi r24, 0x01 ; 1 2b67e: 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; 2b680: 8c 2d mov r24, r12 2b682: 8f 70 andi r24, 0x0F ; 15 2b684: f8 01 movw r30, r16 2b686: 81 83 std Z+1, r24 ; 0x01 // set to start of file curCluster_ = 0; 2b688: 14 82 std Z+4, r1 ; 0x04 2b68a: 15 82 std Z+5, r1 ; 0x05 2b68c: 16 82 std Z+6, r1 ; 0x06 2b68e: 17 82 std Z+7, r1 ; 0x07 curPosition_ = 0; 2b690: 10 86 std Z+8, r1 ; 0x08 2b692: 11 86 std Z+9, r1 ; 0x09 2b694: 12 86 std Z+10, r1 ; 0x0a 2b696: 13 86 std Z+11, r1 ; 0x0b if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; 2b698: 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; 2b69a: c4 fe sbrs r12, 4 2b69c: 03 c0 rjmp .+6 ; 0x2b6a4 2b69e: c8 01 movw r24, r16 2b6a0: 0f 94 7d 76 call 0x2ecfa ; 0x2ecfa // open entry in cache return openCachedEntry(index, oflag); fail: return false; } 2b6a4: 0f 90 pop r0 2b6a6: df 91 pop r29 2b6a8: cf 91 pop r28 2b6aa: 1f 91 pop r17 2b6ac: 0f 91 pop r16 2b6ae: ff 90 pop r15 2b6b0: ef 90 pop r14 2b6b2: df 90 pop r13 2b6b4: cf 90 pop r12 2b6b6: bf 90 pop r11 2b6b8: af 90 pop r10 2b6ba: 7f 90 pop r7 2b6bc: 6f 90 pop r6 2b6be: 5f 90 pop r5 2b6c0: 4f 90 pop r4 2b6c2: 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; 2b6c4: d7 01 movw r26, r14 2b6c6: 13 96 adiw r26, 0x03 ; 3 2b6c8: 8c 91 ld r24, X 2b6ca: 13 97 sbiw r26, 0x03 ; 3 2b6cc: 82 30 cpi r24, 0x02 ; 2 2b6ce: 09 f4 brne .+2 ; 0x2b6d2 2b6d0: 0c cf rjmp .-488 ; 0x2b4ea // 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; 2b6d2: 51 96 adiw r26, 0x11 ; 17 2b6d4: 8d 91 ld r24, X+ 2b6d6: 9d 91 ld r25, X+ 2b6d8: 0d 90 ld r0, X+ 2b6da: bc 91 ld r27, X 2b6dc: a0 2d mov r26, r0 2b6de: 80 3e cpi r24, 0xE0 ; 224 2b6e0: 9f 4f sbci r25, 0xFF ; 255 2b6e2: af 41 sbci r26, 0x1F ; 31 2b6e4: b1 05 cpc r27, r1 2b6e6: 08 f0 brcs .+2 ; 0x2b6ea 2b6e8: 00 cf rjmp .-512 ; 0x2b4ea if (!addCluster()) goto fail; 2b6ea: c7 01 movw r24, r14 2b6ec: 0f 94 26 57 call 0x2ae4c ; 0x2ae4c 2b6f0: 88 23 and r24, r24 2b6f2: 09 f4 brne .+2 ; 0x2b6f6 2b6f4: fa ce rjmp .-524 ; 0x2b4ea if (!vol_->cacheFlush()) goto fail; 2b6f6: 0f 94 15 53 call 0x2a62a ; 0x2a62a 2b6fa: 88 23 and r24, r24 2b6fc: 09 f4 brne .+2 ; 0x2b700 2b6fe: f5 ce rjmp .-534 ; 0x2b4ea block = vol_->clusterStartBlock(curCluster_); 2b700: d7 01 movw r26, r14 2b702: 59 96 adiw r26, 0x19 ; 25 2b704: ed 91 ld r30, X+ 2b706: fc 91 ld r31, X 2b708: 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_);} 2b70a: 14 96 adiw r26, 0x04 ; 4 2b70c: 4d 90 ld r4, X+ 2b70e: 5d 90 ld r5, X+ 2b710: 6d 90 ld r6, X+ 2b712: 7c 90 ld r7, X 2b714: 17 97 sbiw r26, 0x07 ; 7 2b716: b2 e0 ldi r27, 0x02 ; 2 2b718: 4b 1a sub r4, r27 2b71a: 51 08 sbc r5, r1 2b71c: 61 08 sbc r6, r1 2b71e: 71 08 sbc r7, r1 2b720: 85 85 ldd r24, Z+13 ; 0x0d 2b722: 04 c0 rjmp .+8 ; 0x2b72c 2b724: 44 0c add r4, r4 2b726: 55 1c adc r5, r5 2b728: 66 1c adc r6, r6 2b72a: 77 1c adc r7, r7 2b72c: 8a 95 dec r24 2b72e: d2 f7 brpl .-12 ; 0x2b724 2b730: 86 85 ldd r24, Z+14 ; 0x0e 2b732: 97 85 ldd r25, Z+15 ; 0x0f 2b734: a0 89 ldd r26, Z+16 ; 0x10 2b736: b1 89 ldd r27, Z+17 ; 0x11 2b738: 48 0e add r4, r24 2b73a: 59 1e adc r5, r25 2b73c: 6a 1e adc r6, r26 2b73e: 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; 2b740: 81 e0 ldi r24, 0x01 ; 1 2b742: 80 93 99 0e sts 0x0E99, r24 ; 0x800e99 cacheBlockNumber_ = blockNumber; 2b746: 40 92 91 0e sts 0x0E91, r4 ; 0x800e91 2b74a: 50 92 92 0e sts 0x0E92, r5 ; 0x800e92 2b74e: 60 92 93 0e sts 0x0E93, r6 ; 0x800e93 2b752: 70 92 94 0e sts 0x0E94, r7 ; 0x800e94 // set cache to first block of cluster vol_->cacheSetBlockNumber(block, true); // zero first block of cluster memset(vol_->cacheBuffer_.data, 0, 512); 2b756: ed e9 ldi r30, 0x9D ; 157 2b758: fe e0 ldi r31, 0x0E ; 14 2b75a: 80 e0 ldi r24, 0x00 ; 0 2b75c: 92 e0 ldi r25, 0x02 ; 2 2b75e: df 01 movw r26, r30 2b760: 9c 01 movw r18, r24 2b762: 1d 92 st X+, r1 2b764: 21 50 subi r18, 0x01 ; 1 2b766: 30 40 sbci r19, 0x00 ; 0 2b768: e1 f7 brne .-8 ; 0x2b762 // zero rest of cluster for (uint8_t i = 1; i < vol_->blocksPerCluster_; i++) { 2b76a: dd 24 eor r13, r13 2b76c: d3 94 inc r13 2b76e: d7 01 movw r26, r14 2b770: 59 96 adiw r26, 0x19 ; 25 2b772: ed 91 ld r30, X+ 2b774: fc 91 ld r31, X 2b776: 84 81 ldd r24, Z+4 ; 0x04 2b778: d8 16 cp r13, r24 2b77a: 98 f4 brcc .+38 ; 0x2b7a2 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); 2b77c: 2d e9 ldi r18, 0x9D ; 157 2b77e: 3e e0 ldi r19, 0x0E ; 14 2b780: b3 01 movw r22, r6 2b782: a2 01 movw r20, r4 2b784: 4d 0d add r20, r13 2b786: 51 1d adc r21, r1 2b788: 61 1d adc r22, r1 2b78a: 71 1d adc r23, r1 2b78c: 80 91 9a 0e lds r24, 0x0E9A ; 0x800e9a 2b790: 90 91 9b 0e lds r25, 0x0E9B ; 0x800e9b 2b794: 0f 94 b1 52 call 0x2a562 ; 0x2a562 if (!vol_->writeBlock(block + i, vol_->cacheBuffer_.data)) goto fail; 2b798: 88 23 and r24, r24 2b79a: 09 f4 brne .+2 ; 0x2b79e 2b79c: a6 ce rjmp .-692 ; 0x2b4ea // zero first block of cluster memset(vol_->cacheBuffer_.data, 0, 512); // zero rest of cluster for (uint8_t i = 1; i < vol_->blocksPerCluster_; i++) { 2b79e: d3 94 inc r13 2b7a0: e6 cf rjmp .-52 ; 0x2b76e if (!vol_->writeBlock(block + i, vol_->cacheBuffer_.data)) goto fail; } // Increase directory file size by cluster size fileSize_ += 512UL << vol_->clusterSizeShift_; 2b7a2: 25 85 ldd r18, Z+13 ; 0x0d 2b7a4: 80 e0 ldi r24, 0x00 ; 0 2b7a6: 92 e0 ldi r25, 0x02 ; 2 2b7a8: a0 e0 ldi r26, 0x00 ; 0 2b7aa: b0 e0 ldi r27, 0x00 ; 0 2b7ac: 04 c0 rjmp .+8 ; 0x2b7b6 2b7ae: 88 0f add r24, r24 2b7b0: 99 1f adc r25, r25 2b7b2: aa 1f adc r26, r26 2b7b4: bb 1f adc r27, r27 2b7b6: 2a 95 dec r18 2b7b8: d2 f7 brpl .-12 ; 0x2b7ae 2b7ba: f7 01 movw r30, r14 2b7bc: 41 89 ldd r20, Z+17 ; 0x11 2b7be: 52 89 ldd r21, Z+18 ; 0x12 2b7c0: 63 89 ldd r22, Z+19 ; 0x13 2b7c2: 74 89 ldd r23, Z+20 ; 0x14 2b7c4: 84 0f add r24, r20 2b7c6: 95 1f adc r25, r21 2b7c8: a6 1f adc r26, r22 2b7ca: b7 1f adc r27, r23 2b7cc: 81 8b std Z+17, r24 ; 0x11 2b7ce: 92 8b std Z+18, r25 ; 0x12 2b7d0: a3 8b std Z+19, r26 ; 0x13 2b7d2: 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; 2b7d4: 8d e9 ldi r24, 0x9D ; 157 2b7d6: 9e e0 ldi r25, 0x0E ; 14 index = 0; 2b7d8: d1 2c mov r13, r1 2b7da: db ce rjmp .-586 ; 0x2b592 // 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)) { 2b7dc: 20 31 cpi r18, 0x10 ; 16 2b7de: 61 f4 brne .+24 ; 0x2b7f8 if (!vol_->chainSize(firstCluster_, &fileSize_)) goto fail; 2b7e0: 98 01 movw r18, r16 2b7e2: 2f 5e subi r18, 0xEF ; 239 2b7e4: 3f 4f sbci r19, 0xFF ; 255 2b7e6: 0f 94 5f 55 call 0x2aabe ; 0x2aabe 2b7ea: 88 23 and r24, r24 2b7ec: 29 f0 breq .+10 ; 0x2b7f8 type_ = FAT_FILE_TYPE_SUBDIR; 2b7ee: 84 e0 ldi r24, 0x04 ; 4 2b7f0: d8 01 movw r26, r16 2b7f2: 13 96 adiw r26, 0x03 ; 3 2b7f4: 8c 93 st X, r24 2b7f6: 44 cf rjmp .-376 ; 0x2b680 curPosition_ = 0; if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; fail: type_ = FAT_FILE_TYPE_CLOSED; 2b7f8: d8 01 movw r26, r16 2b7fa: 13 96 adiw r26, 0x03 ; 3 2b7fc: 1c 92 st X, r1 2b7fe: 75 ce rjmp .-790 ; 0x2b4ea 0002b800 : // version of uvlo_() which doesn't overwrite the print state already waiting in EEPROM uvlo_tiny(); } } void recover_print(uint8_t automatic) { 2b800: 4f 92 push r4 2b802: 5f 92 push r5 2b804: 6f 92 push r6 2b806: 7f 92 push r7 2b808: 8f 92 push r8 2b80a: 9f 92 push r9 2b80c: af 92 push r10 2b80e: bf 92 push r11 2b810: cf 92 push r12 2b812: df 92 push r13 2b814: ef 92 push r14 2b816: ff 92 push r15 2b818: 0f 93 push r16 2b81a: 1f 93 push r17 2b81c: cf 93 push r28 2b81e: df 93 push r29 2b820: 1f 92 push r1 2b822: 1f 92 push r1 2b824: cd b7 in r28, 0x3d ; 61 2b826: de b7 in r29, 0x3e ; 62 2b828: a8 2e mov r10, r24 lcd_setstatuspgm(_T(MSG_RECOVERING_PRINT)); 2b82a: 8b e9 ldi r24, 0x9B ; 155 2b82c: 9d e4 ldi r25, 0x4D ; 77 2b82e: 0e 94 ac 72 call 0xe558 ; 0xe558 2b832: 0e 94 5d f1 call 0x1e2ba ; 0x1e2ba gcode_M114(); } bool recover_machine_state_after_power_panic() { // 1) Preset some dummy values for the XY axes current_position[X_AXIS] = 0; 2b836: 10 92 92 06 sts 0x0692, r1 ; 0x800692 2b83a: 10 92 93 06 sts 0x0693, r1 ; 0x800693 2b83e: 10 92 94 06 sts 0x0694, r1 ; 0x800694 2b842: 10 92 95 06 sts 0x0695, r1 ; 0x800695 current_position[Y_AXIS] = 0; 2b846: 10 92 96 06 sts 0x0696, r1 ; 0x800696 2b84a: 10 92 97 06 sts 0x0697, r1 ; 0x800697 2b84e: 10 92 98 06 sts 0x0698, r1 ; 0x800698 2b852: 10 92 99 06 sts 0x0699, r1 ; 0x800699 2b856: 9e ea ldi r25, 0xAE ; 174 2b858: e9 2e mov r14, r25 2b85a: 9d e0 ldi r25, 0x0D ; 13 2b85c: 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; 2b85e: d1 2c mov r13, r1 for (int8_t mesh_point = 0; mesh_point < MESH_NUM_X_POINTS * MESH_NUM_Y_POINTS; ++ mesh_point) { 2b860: c1 2c mov r12, r1 uint8_t ix = mesh_point % MESH_NUM_X_POINTS; // from 0 to MESH_NUM_X_POINTS - 1 2b862: 27 e0 ldi r18, 0x07 ; 7 2b864: b2 2e mov r11, r18 2b866: 8c 2d mov r24, r12 2b868: 6b 2d mov r22, r11 2b86a: 0f 94 d7 dc call 0x3b9ae ; 0x3b9ae <__divmodqi4> 2b86e: 08 2f mov r16, r24 2b870: 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); 2b872: 42 e0 ldi r20, 0x02 ; 2 2b874: 50 e0 ldi r21, 0x00 ; 0 2b876: b7 01 movw r22, r14 2b878: ce 01 movw r24, r28 2b87a: 01 96 adiw r24, 0x01 ; 1 2b87c: 0f 94 0c dc call 0x3b818 ; 0x3b818 if (v != 0) 2b880: 69 81 ldd r22, Y+1 ; 0x01 2b882: 7a 81 ldd r23, Y+2 ; 0x02 2b884: 61 15 cp r22, r1 2b886: 71 05 cpc r23, r1 2b888: 11 f0 breq .+4 ; 0x2b88e mbl_was_active = true; 2b88a: dd 24 eor r13, r13 2b88c: d3 94 inc r13 mbl.z_values[iy][ix] = float(v) * 0.001f; 2b88e: 2b 2d mov r18, r11 2b890: 02 03 mulsu r16, r18 2b892: 80 01 movw r16, r0 2b894: 11 24 eor r1, r1 2b896: 09 0d add r16, r9 2b898: 11 1d adc r17, r1 2b89a: 97 fc sbrc r9, 7 2b89c: 1a 95 dec r17 2b89e: 00 0f add r16, r16 2b8a0: 11 1f adc r17, r17 2b8a2: 00 0f add r16, r16 2b8a4: 11 1f adc r17, r17 2b8a6: 0e 53 subi r16, 0x3E ; 62 2b8a8: 1c 4e sbci r17, 0xEC ; 236 2b8aa: 07 2e mov r0, r23 2b8ac: 00 0c add r0, r0 2b8ae: 88 0b sbc r24, r24 2b8b0: 99 0b sbc r25, r25 2b8b2: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 2b8b6: 2f e6 ldi r18, 0x6F ; 111 2b8b8: 32 e1 ldi r19, 0x12 ; 18 2b8ba: 43 e8 ldi r20, 0x83 ; 131 2b8bc: 5a e3 ldi r21, 0x3A ; 58 2b8be: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 2b8c2: f8 01 movw r30, r16 2b8c4: 61 83 std Z+1, r22 ; 0x01 2b8c6: 72 83 std Z+2, r23 ; 0x02 2b8c8: 83 83 std Z+3, r24 ; 0x03 2b8ca: 94 83 std Z+4, r25 ; 0x04 2b8cc: f2 e0 ldi r31, 0x02 ; 2 2b8ce: ef 0e add r14, r31 2b8d0: f1 1c adc r15, r1 2b8d2: 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) { 2b8d4: 21 e3 ldi r18, 0x31 ; 49 2b8d6: c2 12 cpse r12, r18 2b8d8: c6 cf rjmp .-116 ; 0x2b866 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)); 2b8da: 8a ed ldi r24, 0xDA ; 218 2b8dc: 9e e0 ldi r25, 0x0E ; 14 2b8de: 0f 94 24 dc call 0x3b848 ; 0x3b848 2b8e2: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a 2b8e6: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b 2b8ea: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c 2b8ee: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d // Recover last E axis position current_position[E_AXIS] = eeprom_read_float((float*)(EEPROM_UVLO_CURRENT_POSITION_E)); 2b8f2: 8e e6 ldi r24, 0x6E ; 110 2b8f4: 9f e0 ldi r25, 0x0F ; 15 2b8f6: 0f 94 24 dc call 0x3b848 ; 0x3b848 2b8fa: 60 93 9e 06 sts 0x069E, r22 ; 0x80069e 2b8fe: 70 93 9f 06 sts 0x069F, r23 ; 0x80069f 2b902: 80 93 a0 06 sts 0x06A0, r24 ; 0x8006a0 2b906: 90 93 a1 06 sts 0x06A1, r25 ; 0x8006a1 // 3) Initialize the logical to physical coordinate system transformation. world2machine_initialize(); 2b90a: 0f 94 9b ce call 0x39d36 ; 0x39d36 // 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(); 2b90e: 0f 94 85 c9 call 0x3930a ; 0x3930a // 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); 2b912: 82 e9 ldi r24, 0x92 ; 146 2b914: 96 e0 ldi r25, 0x06 ; 6 2b916: 0e 94 c9 6b call 0xd792 ; 0xd792 set_destination_to_current(); 2b91a: 0e 94 3a 68 call 0xd074 ; 0xd074 plan_set_position_curposXYZE(); 2b91e: 0f 94 09 bf call 0x37e12 ; 0x37e12 SERIAL_ECHOPGM("recover_machine_state_after_power_panic, initial "); 2b922: 8a e3 ldi r24, 0x3A ; 58 2b924: 9f e8 ldi r25, 0x8F ; 143 2b926: 0e 94 50 77 call 0xeea0 ; 0xeea0 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]); 2b92a: 80 91 9d 06 lds r24, 0x069D ; 0x80069d 2b92e: 8f 93 push r24 2b930: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 2b934: 8f 93 push r24 2b936: 80 91 9b 06 lds r24, 0x069B ; 0x80069b 2b93a: 8f 93 push r24 2b93c: 80 91 9a 06 lds r24, 0x069A ; 0x80069a 2b940: 8f 93 push r24 2b942: 80 91 99 06 lds r24, 0x0699 ; 0x800699 2b946: 8f 93 push r24 2b948: 80 91 98 06 lds r24, 0x0698 ; 0x800698 2b94c: 8f 93 push r24 2b94e: 80 91 97 06 lds r24, 0x0697 ; 0x800697 2b952: 8f 93 push r24 2b954: 80 91 96 06 lds r24, 0x0696 ; 0x800696 2b958: 8f 93 push r24 2b95a: 80 91 95 06 lds r24, 0x0695 ; 0x800695 2b95e: 8f 93 push r24 2b960: 80 91 94 06 lds r24, 0x0694 ; 0x800694 2b964: 8f 93 push r24 2b966: 80 91 93 06 lds r24, 0x0693 ; 0x800693 2b96a: 8f 93 push r24 2b96c: 80 91 92 06 lds r24, 0x0692 ; 0x800692 2b970: 8f 93 push r24 2b972: 8f ef ldi r24, 0xFF ; 255 2b974: 9d e6 ldi r25, 0x6D ; 109 2b976: 9f 93 push r25 2b978: 8f 93 push r24 2b97a: 0f 94 de da call 0x3b5bc ; 0x3b5bc print_world_coordinates(); // 6) Power up the Z motors, mark their positions as known. axis_known_position[Z_AXIS] = true; 2b97e: 81 e0 ldi r24, 0x01 ; 1 2b980: 80 93 91 06 sts 0x0691, r24 ; 0x800691 enable_z(); 2b984: 15 98 cbi 0x02, 5 ; 2 // 7) Recover the target temperatures. target_temperature[active_extruder] = eeprom_read_word((uint16_t*)EEPROM_UVLO_TARGET_HOTEND); 2b986: 88 ed ldi r24, 0xD8 ; 216 2b988: 9e e0 ldi r25, 0x0E ; 14 2b98a: 0f 94 2a dc call 0x3b854 ; 0x3b854 2b98e: 90 93 b7 0d sts 0x0DB7, r25 ; 0x800db7 2b992: 80 93 b6 0d sts 0x0DB6, r24 ; 0x800db6 target_temperature_bed = eeprom_read_byte((uint8_t*)EEPROM_UVLO_TARGET_BED); 2b996: 8b e8 ldi r24, 0x8B ; 139 2b998: 9f e0 ldi r25, 0x0F ; 15 2b99a: 0f 94 1c dc call 0x3b838 ; 0x3b838 2b99e: 90 e0 ldi r25, 0x00 ; 0 2b9a0: 90 93 73 06 sts 0x0673, r25 ; 0x800673 2b9a4: 80 93 72 06 sts 0x0672, r24 ; 0x800672 // 8) Recover extruder multipilers extruder_multiplier[0] = eeprom_read_float((float*)(EEPROM_EXTRUDER_MULTIPLIER_0)); 2b9a8: 88 ee ldi r24, 0xE8 ; 232 2b9aa: 9e e0 ldi r25, 0x0E ; 14 2b9ac: 0f 94 24 dc call 0x3b848 ; 0x3b848 2b9b0: 60 93 93 02 sts 0x0293, r22 ; 0x800293 2b9b4: 70 93 94 02 sts 0x0294, r23 ; 0x800294 2b9b8: 80 93 95 02 sts 0x0295, r24 ; 0x800295 2b9bc: 90 93 96 02 sts 0x0296, r25 ; 0x800296 extrudemultiply = (int)eeprom_read_word((uint16_t*)(EEPROM_EXTRUDEMULTIPLY)); 2b9c0: 8e ed ldi r24, 0xDE ; 222 2b9c2: 9e e0 ldi r25, 0x0E ; 14 2b9c4: 0f 94 2a dc call 0x3b854 ; 0x3b854 2b9c8: 90 93 bd 02 sts 0x02BD, r25 ; 0x8002bd 2b9cc: 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)); 2b9d0: 40 e1 ldi r20, 0x10 ; 16 2b9d2: 50 e0 ldi r21, 0x00 ; 0 2b9d4: 67 e3 ldi r22, 0x37 ; 55 2b9d6: 7d e0 ldi r23, 0x0D ; 13 2b9d8: 83 e8 ldi r24, 0x83 ; 131 2b9da: 92 e0 ldi r25, 0x02 ; 2 2b9dc: 0f 94 0c dc call 0x3b818 ; 0x3b818 saved_segment_idx = eeprom_read_word((uint16_t*)EEPROM_UVLO_SAVED_SEGMENT_IDX); 2b9e0: 8c e6 ldi r24, 0x6C ; 108 2b9e2: 9f e0 ldi r25, 0x0F ; 15 2b9e4: 0f 94 2a dc call 0x3b854 ; 0x3b854 2b9e8: 90 93 6a 05 sts 0x056A, r25 ; 0x80056a 2b9ec: 80 93 69 05 sts 0x0569, r24 ; 0x800569 #ifdef LIN_ADVANCE extruder_advance_K = eeprom_read_float((float*)EEPROM_UVLO_LA_K); 2b9f0: 8c e2 ldi r24, 0x2C ; 44 2b9f2: 9d e0 ldi r25, 0x0D ; 13 2b9f4: 0f 94 24 dc call 0x3b848 ; 0x3b848 2b9f8: 60 93 65 05 sts 0x0565, r22 ; 0x800565 2b9fc: 70 93 66 05 sts 0x0566, r23 ; 0x800566 2ba00: 80 93 67 05 sts 0x0567, r24 ; 0x800567 2ba04: 90 93 68 05 sts 0x0568, r25 ; 0x800568 #endif #ifdef PREVENT_DANGEROUS_EXTRUDE extrude_min_temp = eeprom_read_word((uint16_t*)EEPROM_UVLO_EXTRUDE_MINTEMP); 2ba08: 8d e7 ldi r24, 0x7D ; 125 2ba0a: 9c e0 ldi r25, 0x0C ; 12 2ba0c: 0f 94 2a dc call 0x3b854 ; 0x3b854 2ba10: 90 93 6c 02 sts 0x026C, r25 ; 0x80026c 2ba14: 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)); 2ba18: 40 e1 ldi r20, 0x10 ; 16 2ba1a: 50 e0 ldi r21, 0x00 ; 0 2ba1c: 6d e6 ldi r22, 0x6D ; 109 2ba1e: 7c e0 ldi r23, 0x0C ; 12 2ba20: 82 ee ldi r24, 0xE2 ; 226 2ba22: 9d e0 ldi r25, 0x0D ; 13 2ba24: 0f 94 0c dc call 0x3b818 ; 0x3b818 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)); 2ba28: 40 e1 ldi r20, 0x10 ; 16 2ba2a: 50 e0 ldi r21, 0x00 ; 0 2ba2c: 6d e5 ldi r22, 0x5D ; 93 2ba2e: 7c e0 ldi r23, 0x0C ; 12 2ba30: 8a e6 ldi r24, 0x6A ; 106 2ba32: 9e e0 ldi r25, 0x0E ; 14 2ba34: 0f 94 0c dc call 0x3b818 ; 0x3b818 eeprom_read_block(cs.max_feedrate_normal, (float *)EEPROM_UVLO_MAX_FEEDRATE_NORMAL, sizeof(cs.max_feedrate_normal)); 2ba38: 40 e1 ldi r20, 0x10 ; 16 2ba3a: 50 e0 ldi r21, 0x00 ; 0 2ba3c: 6d e4 ldi r22, 0x4D ; 77 2ba3e: 7c e0 ldi r23, 0x0C ; 12 2ba40: 82 ed ldi r24, 0xD2 ; 210 2ba42: 9d e0 ldi r25, 0x0D ; 13 2ba44: 0f 94 0c dc call 0x3b818 ; 0x3b818 eeprom_read_block(cs.max_feedrate_silent, (float *)EEPROM_UVLO_MAX_FEEDRATE_SILENT, sizeof(cs.max_feedrate_silent)); 2ba48: 40 e1 ldi r20, 0x10 ; 16 2ba4a: 50 e0 ldi r21, 0x00 ; 0 2ba4c: 6d e3 ldi r22, 0x3D ; 61 2ba4e: 7c e0 ldi r23, 0x0C ; 12 2ba50: 8a e5 ldi r24, 0x5A ; 90 2ba52: 9e e0 ldi r25, 0x0E ; 14 2ba54: 0f 94 0c dc call 0x3b818 ; 0x3b818 cs.minimumfeedrate = eeprom_read_float((float *)EEPROM_UVLO_MIN_FEEDRATE); 2ba58: 89 e3 ldi r24, 0x39 ; 57 2ba5a: 9c e0 ldi r25, 0x0C ; 12 2ba5c: 0f 94 24 dc call 0x3b848 ; 0x3b848 2ba60: 60 93 fa 0d sts 0x0DFA, r22 ; 0x800dfa 2ba64: 70 93 fb 0d sts 0x0DFB, r23 ; 0x800dfb 2ba68: 80 93 fc 0d sts 0x0DFC, r24 ; 0x800dfc 2ba6c: 90 93 fd 0d sts 0x0DFD, r25 ; 0x800dfd cs.mintravelfeedrate = eeprom_read_float((float *)EEPROM_UVLO_MIN_TRAVEL_FEEDRATE); 2ba70: 85 e3 ldi r24, 0x35 ; 53 2ba72: 9c e0 ldi r25, 0x0C ; 12 2ba74: 0f 94 24 dc call 0x3b848 ; 0x3b848 2ba78: 60 93 fe 0d sts 0x0DFE, r22 ; 0x800dfe 2ba7c: 70 93 ff 0d sts 0x0DFF, r23 ; 0x800dff 2ba80: 80 93 00 0e sts 0x0E00, r24 ; 0x800e00 2ba84: 90 93 01 0e sts 0x0E01, r25 ; 0x800e01 cs.min_segment_time_us = eeprom_read_dword((uint32_t *)EEPROM_UVLO_MIN_SEGMENT_TIME_US); 2ba88: 81 e3 ldi r24, 0x31 ; 49 2ba8a: 9c e0 ldi r25, 0x0C ; 12 2ba8c: 0f 94 24 dc call 0x3b848 ; 0x3b848 2ba90: 60 93 02 0e sts 0x0E02, r22 ; 0x800e02 2ba94: 70 93 03 0e sts 0x0E03, r23 ; 0x800e03 2ba98: 80 93 04 0e sts 0x0E04, r24 ; 0x800e04 2ba9c: 90 93 05 0e sts 0x0E05, r25 ; 0x800e05 eeprom_read_block(cs.max_jerk, (float *)EEPROM_UVLO_MAX_JERK, sizeof(cs.max_jerk)); 2baa0: 40 e1 ldi r20, 0x10 ; 16 2baa2: 50 e0 ldi r21, 0x00 ; 0 2baa4: 61 e2 ldi r22, 0x21 ; 33 2baa6: 7c e0 ldi r23, 0x0C ; 12 2baa8: 86 e0 ldi r24, 0x06 ; 6 2baaa: 9e e0 ldi r25, 0x0E ; 14 2baac: 0f 94 0c dc call 0x3b818 ; 0x3b818 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 ) { 2bab0: 8f e7 ldi r24, 0x7F ; 127 2bab2: 9c e0 ldi r25, 0x0C ; 12 2bab4: 0f 94 1c dc call 0x3b838 ; 0x3b838 2bab8: 0f b6 in r0, 0x3f ; 63 2baba: f8 94 cli 2babc: de bf out 0x3e, r29 ; 62 2babe: 0f be out 0x3f, r0 ; 63 2bac0: cd bf out 0x3d, r28 ; 61 2bac2: 81 30 cpi r24, 0x01 ; 1 2bac4: b1 f4 brne .+44 ; 0x2baf2 current_position[Z_AXIS] += Z_PAUSE_LIFT; 2bac6: 20 e0 ldi r18, 0x00 ; 0 2bac8: 30 e0 ldi r19, 0x00 ; 0 2baca: 40 ea ldi r20, 0xA0 ; 160 2bacc: 51 e4 ldi r21, 0x41 ; 65 2bace: 60 91 9a 06 lds r22, 0x069A ; 0x80069a 2bad2: 70 91 9b 06 lds r23, 0x069B ; 0x80069b 2bad6: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 2bada: 90 91 9d 06 lds r25, 0x069D ; 0x80069d 2bade: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 2bae2: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a 2bae6: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b 2baea: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c 2baee: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d } // 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) { 2baf2: 8f e7 ldi r24, 0x7F ; 127 2baf4: 9c e0 ldi r25, 0x0C ; 12 2baf6: 0f 94 1c dc call 0x3b838 ; 0x3b838 2bafa: 81 11 cpse r24, r1 2bafc: 23 c0 rjmp .+70 ; 0x2bb44 enquecommandf_P(PSTR("G1 Z%.3f F800"), current_position[Z_AXIS] + Z_PAUSE_LIFT); 2bafe: 20 e0 ldi r18, 0x00 ; 0 2bb00: 30 e0 ldi r19, 0x00 ; 0 2bb02: 40 ea ldi r20, 0xA0 ; 160 2bb04: 51 e4 ldi r21, 0x41 ; 65 2bb06: 60 91 9a 06 lds r22, 0x069A ; 0x80069a 2bb0a: 70 91 9b 06 lds r23, 0x069B ; 0x80069b 2bb0e: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 2bb12: 90 91 9d 06 lds r25, 0x069D ; 0x80069d 2bb16: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 2bb1a: 9f 93 push r25 2bb1c: 8f 93 push r24 2bb1e: 7f 93 push r23 2bb20: 6f 93 push r22 2bb22: 8f e3 ldi r24, 0x3F ; 63 2bb24: 90 e9 ldi r25, 0x90 ; 144 2bb26: 9f 93 push r25 2bb28: 8f 93 push r24 2bb2a: 0e 94 b6 88 call 0x1116c ; 0x1116c 2bb2e: 61 e0 ldi r22, 0x01 ; 1 2bb30: 8f e7 ldi r24, 0x7F ; 127 2bb32: 9c e0 ldi r25, 0x0C ; 12 2bb34: 0f 94 40 dc call 0x3b880 ; 0x3b880 2bb38: 0f 90 pop r0 2bb3a: 0f 90 pop r0 2bb3c: 0f 90 pop r0 2bb3e: 0f 90 pop r0 2bb40: 0f 90 pop r0 2bb42: 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")); 2bb44: 61 e0 ldi r22, 0x01 ; 1 2bb46: 87 e3 ldi r24, 0x37 ; 55 2bb48: 90 e9 ldi r25, 0x90 ; 144 2bb4a: 0e 94 20 88 call 0x11040 ; 0x11040 // Set the target bed and nozzle temperatures and wait. enquecommandf_P(PSTR("M104 S%d"), target_temperature[active_extruder]); 2bb4e: 80 91 b7 0d lds r24, 0x0DB7 ; 0x800db7 2bb52: 8f 93 push r24 2bb54: 80 91 b6 0d lds r24, 0x0DB6 ; 0x800db6 2bb58: 8f 93 push r24 2bb5a: 8e e2 ldi r24, 0x2E ; 46 2bb5c: 90 e9 ldi r25, 0x90 ; 144 2bb5e: 9f 93 push r25 2bb60: 8f 93 push r24 2bb62: 0e 94 b6 88 call 0x1116c ; 0x1116c enquecommandf_P(PSTR("M140 S%d"), target_temperature_bed); 2bb66: 80 91 73 06 lds r24, 0x0673 ; 0x800673 2bb6a: 8f 93 push r24 2bb6c: 80 91 72 06 lds r24, 0x0672 ; 0x800672 2bb70: 8f 93 push r24 2bb72: 85 e2 ldi r24, 0x25 ; 37 2bb74: 90 e9 ldi r25, 0x90 ; 144 2bb76: 9f 93 push r25 2bb78: 8f 93 push r24 2bb7a: 0e 94 b6 88 call 0x1116c ; 0x1116c //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) { 2bb7e: 8c e8 ldi r24, 0x8C ; 140 2bb80: 9f e0 ldi r25, 0x0F ; 15 2bb82: 0f 94 1c dc call 0x3b838 ; 0x3b838 2bb86: 0f b6 in r0, 0x3f ; 63 2bb88: f8 94 cli 2bb8a: de bf out 0x3e, r29 ; 62 2bb8c: 0f be out 0x3f, r0 ; 63 2bb8e: cd bf out 0x3d, r28 ; 61 2bb90: 81 11 cpse r24, r1 2bb92: 10 c0 rjmp .+32 ; 0x2bbb4 enquecommandf_P(PSTR("M109 S%d"), target_temperature[active_extruder]); 2bb94: 80 91 b7 0d lds r24, 0x0DB7 ; 0x800db7 2bb98: 8f 93 push r24 2bb9a: 80 91 b6 0d lds r24, 0x0DB6 ; 0x800db6 2bb9e: 8f 93 push r24 2bba0: 8c e1 ldi r24, 0x1C ; 28 2bba2: 90 e9 ldi r25, 0x90 ; 144 2bba4: 9f 93 push r25 2bba6: 8f 93 push r24 2bba8: 0e 94 b6 88 call 0x1116c ; 0x1116c 2bbac: 0f 90 pop r0 2bbae: 0f 90 pop r0 2bbb0: 0f 90 pop r0 2bbb2: 0f 90 pop r0 } enquecommand_P(MSG_M83); //E axis relative mode 2bbb4: 61 e0 ldi r22, 0x01 ; 1 2bbb6: 80 ee ldi r24, 0xE0 ; 224 2bbb8: 9b e6 ldi r25, 0x6B ; 107 2bbba: 0e 94 20 88 call 0x11040 ; 0x11040 // If not automatically recoreverd (long power loss) if(automatic == 0){ 2bbbe: a1 10 cpse r10, r1 2bbc0: 17 c0 rjmp .+46 ; 0x2bbf0 //Extrude some filament to stabilize the pressure enquecommand_P(PSTR("G1 E5 F120")); 2bbc2: 61 e0 ldi r22, 0x01 ; 1 2bbc4: 81 e1 ldi r24, 0x11 ; 17 2bbc6: 90 e9 ldi r25, 0x90 ; 144 2bbc8: 0e 94 20 88 call 0x11040 ; 0x11040 // Retract to be consistent with a short pause enquecommandf_P(G1_E_F2700, default_retraction); 2bbcc: 8f e3 ldi r24, 0x3F ; 63 2bbce: 8f 93 push r24 2bbd0: 80 e8 ldi r24, 0x80 ; 128 2bbd2: 8f 93 push r24 2bbd4: 1f 92 push r1 2bbd6: 1f 92 push r1 2bbd8: 8a e5 ldi r24, 0x5A ; 90 2bbda: 9e e6 ldi r25, 0x6E ; 110 2bbdc: 9f 93 push r25 2bbde: 8f 93 push r24 2bbe0: 0e 94 b6 88 call 0x1116c ; 0x1116c 2bbe4: 0f 90 pop r0 2bbe6: 0f 90 pop r0 2bbe8: 0f 90 pop r0 2bbea: 0f 90 pop r0 2bbec: 0f 90 pop r0 2bbee: 0f 90 pop r0 } puts_P(_N("Temperature Restored\n")); 2bbf0: 84 e4 ldi r24, 0x44 ; 68 2bbf2: 9e e6 ldi r25, 0x6E ; 110 2bbf4: 0f 94 05 db call 0x3b60a ; 0x3b60a gcode_M114(); 2bbf8: 0e 94 47 78 call 0xf08e ; 0xf08e 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); 2bbfc: 88 e8 ldi r24, 0x88 ; 136 2bbfe: 9f e0 ldi r25, 0x0F ; 15 2bc00: 0f 94 1c dc call 0x3b838 ; 0x3b838 2bc04: 88 2e mov r8, r24 feedrate_rec = eeprom_read_word((uint16_t*)EEPROM_UVLO_FEEDRATE); 2bc06: 89 e8 ldi r24, 0x89 ; 137 2bc08: 9f e0 ldi r25, 0x0F ; 15 2bc0a: 0f 94 2a dc call 0x3b854 ; 0x3b854 2bc0e: 8c 01 movw r16, r24 feedmultiply_rec = eeprom_read_word((uint16_t*)EEPROM_UVLO_FEEDMULTIPLY); 2bc10: 85 e3 ldi r24, 0x35 ; 53 2bc12: 9d e0 ldi r25, 0x0D ; 13 2bc14: 0f 94 2a dc call 0x3b854 ; 0x3b854 2bc18: f8 2e mov r15, r24 2bc1a: e9 2e mov r14, r25 SERIAL_ECHOPGM("Feedrate:"); 2bc1c: 87 e0 ldi r24, 0x07 ; 7 2bc1e: 90 e9 ldi r25, 0x90 ; 144 2bc20: 0e 94 50 77 call 0xeea0 ; 0xeea0 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 2bc24: b8 01 movw r22, r16 2bc26: 01 2e mov r0, r17 2bc28: 00 0c add r0, r0 2bc2a: 88 0b sbc r24, r24 2bc2c: 99 0b sbc r25, r25 2bc2e: 0f 94 6b d5 call 0x3aad6 ; 0x3aad6 MYSERIAL.print(feedrate_rec); SERIAL_ECHOPGM(", feedmultiply:"); 2bc32: 87 ef ldi r24, 0xF7 ; 247 2bc34: 9f e8 ldi r25, 0x8F ; 143 2bc36: 0e 94 50 77 call 0xeea0 ; 0xeea0 MYSERIAL.println(feedmultiply_rec); 2bc3a: 8f 2d mov r24, r15 2bc3c: 9e 2d mov r25, r14 2bc3e: 0f 94 f5 74 call 0x2e9ea ; 0x2e9ea if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) 2bc42: 80 91 6a 02 lds r24, 0x026A ; 0x80026a 2bc46: 81 11 cpse r24, r1 2bc48: 02 c0 rjmp .+4 ; 0x2bc4e { // M23 restore_file_from_sd(); 2bc4a: 0e 94 db 88 call 0x111b6 ; 0x111b6 } // 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)); 2bc4e: 8d e9 ldi r24, 0x9D ; 157 2bc50: 9f e0 ldi r25, 0x0F ; 15 2bc52: 0f 94 24 dc call 0x3b848 ; 0x3b848 2bc56: c6 2e mov r12, r22 2bc58: b7 2e mov r11, r23 2bc5a: a8 2e mov r10, r24 2bc5c: 99 2e mov r9, r25 float pos_y = eeprom_read_float((float*)(EEPROM_UVLO_CURRENT_POSITION + 4)); 2bc5e: 81 ea ldi r24, 0xA1 ; 161 2bc60: 9f e0 ldi r25, 0x0F ; 15 2bc62: 0f 94 24 dc call 0x3b848 ; 0x3b848 2bc66: 76 2e mov r7, r22 2bc68: 67 2e mov r6, r23 2bc6a: 58 2e mov r5, r24 2bc6c: 49 2e mov r4, r25 if (pos_x != X_COORD_INVALID) { 2bc6e: 20 e0 ldi r18, 0x00 ; 0 2bc70: 30 e0 ldi r19, 0x00 ; 0 2bc72: 40 e8 ldi r20, 0x80 ; 128 2bc74: 5f eb ldi r21, 0xBF ; 191 2bc76: 6c 2d mov r22, r12 2bc78: 7b 2d mov r23, r11 2bc7a: 8a 2d mov r24, r10 2bc7c: 99 2d mov r25, r9 2bc7e: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 2bc82: 88 23 and r24, r24 2bc84: 99 f0 breq .+38 ; 0x2bcac enquecommandf_P(PSTR("G1 X%-.3f Y%-.3f F3000"), pos_x, pos_y); 2bc86: 4f 92 push r4 2bc88: 5f 92 push r5 2bc8a: 6f 92 push r6 2bc8c: 7f 92 push r7 2bc8e: 9f 92 push r9 2bc90: af 92 push r10 2bc92: bf 92 push r11 2bc94: cf 92 push r12 2bc96: 80 ee ldi r24, 0xE0 ; 224 2bc98: 9f e8 ldi r25, 0x8F ; 143 2bc9a: 9f 93 push r25 2bc9c: 8f 93 push r24 2bc9e: 0e 94 b6 88 call 0x1116c ; 0x1116c 2bca2: 0f b6 in r0, 0x3f ; 63 2bca4: f8 94 cli 2bca6: de bf out 0x3e, r29 ; 62 2bca8: 0f be out 0x3f, r0 ; 63 2bcaa: cd bf out 0x3d, r28 ; 61 } // Enable MBL and switch to logical positioning if (mbl_was_active) 2bcac: dd 20 and r13, r13 2bcae: 29 f0 breq .+10 ; 0x2bcba enquecommand_P(PSTR("PRUSA MBL V1")); 2bcb0: 61 e0 ldi r22, 0x01 ; 1 2bcb2: 83 ed ldi r24, 0xD3 ; 211 2bcb4: 9f e8 ldi r25, 0x8F ; 143 2bcb6: 0e 94 20 88 call 0x11040 ; 0x11040 // 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))); 2bcba: 8d e8 ldi r24, 0x8D ; 141 2bcbc: 9f e0 ldi r25, 0x0F ; 15 2bcbe: 0f 94 24 dc call 0x3b848 ; 0x3b848 2bcc2: 9f 93 push r25 2bcc4: 8f 93 push r24 2bcc6: 7f 93 push r23 2bcc8: 6f 93 push r22 2bcca: 89 ec ldi r24, 0xC9 ; 201 2bccc: 9f e8 ldi r25, 0x8F ; 143 2bcce: 9f 93 push r25 2bcd0: 8f 93 push r24 2bcd2: 0e 94 b6 88 call 0x1116c ; 0x1116c // Restore acceleration settings float acceleration = eeprom_read_float((float*)(EEPROM_UVLO_ACCELL)); 2bcd6: 81 e1 ldi r24, 0x11 ; 17 2bcd8: 9d e0 ldi r25, 0x0D ; 13 2bcda: 0f 94 24 dc call 0x3b848 ; 0x3b848 2bcde: d6 2e mov r13, r22 2bce0: c7 2e mov r12, r23 2bce2: b8 2e mov r11, r24 2bce4: a9 2e mov r10, r25 float retract_acceleration = eeprom_read_float((float*)(EEPROM_UVLO_RETRACT_ACCELL)); 2bce6: 8d e0 ldi r24, 0x0D ; 13 2bce8: 9d e0 ldi r25, 0x0D ; 13 2bcea: 0f 94 24 dc call 0x3b848 ; 0x3b848 2bcee: 96 2e mov r9, r22 2bcf0: 77 2e mov r7, r23 2bcf2: 68 2e mov r6, r24 2bcf4: 59 2e mov r5, r25 float travel_acceleration = eeprom_read_float((float*)(EEPROM_UVLO_TRAVEL_ACCELL)); 2bcf6: 89 e0 ldi r24, 0x09 ; 9 2bcf8: 9d e0 ldi r25, 0x0D ; 13 2bcfa: 0f 94 24 dc call 0x3b848 ; 0x3b848 // 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); 2bcfe: 9f 93 push r25 2bd00: 8f 93 push r24 2bd02: 7f 93 push r23 2bd04: 6f 93 push r22 2bd06: 5f 92 push r5 2bd08: 6f 92 push r6 2bd0a: 7f 92 push r7 2bd0c: 9f 92 push r9 2bd0e: af 92 push r10 2bd10: bf 92 push r11 2bd12: cf 92 push r12 2bd14: df 92 push r13 2bd16: 8f ea ldi r24, 0xAF ; 175 2bd18: 9f e8 ldi r25, 0x8F ; 143 2bd1a: 9f 93 push r25 2bd1c: 8f 93 push r24 2bd1e: 0e 94 b6 88 call 0x1116c ; 0x1116c // Unretract. enquecommandf_P(G1_E_F2700, default_retraction); 2bd22: 8f e3 ldi r24, 0x3F ; 63 2bd24: 8f 93 push r24 2bd26: 80 e8 ldi r24, 0x80 ; 128 2bd28: 8f 93 push r24 2bd2a: 1f 92 push r1 2bd2c: 1f 92 push r1 2bd2e: 8a e5 ldi r24, 0x5A ; 90 2bd30: 9e e6 ldi r25, 0x6E ; 110 2bd32: 9f 93 push r25 2bd34: 8f 93 push r24 2bd36: 0e 94 b6 88 call 0x1116c ; 0x1116c // Recover final E axis position and mode float pos_e = eeprom_read_float((float*)(EEPROM_UVLO_CURRENT_POSITION_E)); 2bd3a: 8e e6 ldi r24, 0x6E ; 110 2bd3c: 9f e0 ldi r25, 0x0F ; 15 2bd3e: 0f 94 24 dc call 0x3b848 ; 0x3b848 enquecommandf_P(PSTR("G92 E%-.3f"), pos_e); 2bd42: 9f 93 push r25 2bd44: 8f 93 push r24 2bd46: 7f 93 push r23 2bd48: 6f 93 push r22 2bd4a: 84 ea ldi r24, 0xA4 ; 164 2bd4c: 9f e8 ldi r25, 0x8F ; 143 2bd4e: 9f 93 push r25 2bd50: 8f 93 push r24 2bd52: 0e 94 b6 88 call 0x1116c ; 0x1116c if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_E_ABS)) 2bd56: 0f b6 in r0, 0x3f ; 63 2bd58: f8 94 cli 2bd5a: de bf out 0x3e, r29 ; 62 2bd5c: 0f be out 0x3f, r0 ; 63 2bd5e: cd bf out 0x3d, r28 ; 61 2bd60: 82 e7 ldi r24, 0x72 ; 114 2bd62: 9f e0 ldi r25, 0x0F ; 15 2bd64: 0f 94 1c dc call 0x3b838 ; 0x3b838 2bd68: 88 23 and r24, r24 2bd6a: 29 f0 breq .+10 ; 0x2bd76 enquecommand_P(PSTR("M82")); //E axis abslute mode 2bd6c: 61 e0 ldi r22, 0x01 ; 1 2bd6e: 80 ea ldi r24, 0xA0 ; 160 2bd70: 9f e8 ldi r25, 0x8F ; 143 2bd72: 0e 94 20 88 call 0x11040 ; 0x11040 // Set the feedrates saved at the power panic. enquecommandf_P(PSTR("G1 F%d"), feedrate_rec); 2bd76: 1f 93 push r17 2bd78: 0f 93 push r16 2bd7a: 89 e9 ldi r24, 0x99 ; 153 2bd7c: 9f e8 ldi r25, 0x8F ; 143 2bd7e: 9f 93 push r25 2bd80: 8f 93 push r24 2bd82: 0e 94 b6 88 call 0x1116c ; 0x1116c enquecommandf_P(MSG_M220, feedmultiply_rec); 2bd86: ef 92 push r14 2bd88: ff 92 push r15 2bd8a: 86 e2 ldi r24, 0x26 ; 38 2bd8c: 9e e6 ldi r25, 0x6E ; 110 2bd8e: 9f 93 push r25 2bd90: 8f 93 push r24 2bd92: 0e 94 b6 88 call 0x1116c ; 0x1116c // Set the fan speed saved at the power panic. enquecommandf_P(PSTR("M106 S%u"), fan_speed_rec); 2bd96: 1f 92 push r1 2bd98: 8f 92 push r8 2bd9a: 80 e9 ldi r24, 0x90 ; 144 2bd9c: 9f e8 ldi r25, 0x8F ; 143 2bd9e: 9f 93 push r25 2bda0: 8f 93 push r24 2bda2: 0e 94 b6 88 call 0x1116c ; 0x1116c // SD: Position in file, USB: g-code line number uint32_t position = eeprom_read_dword((uint32_t*)(EEPROM_FILE_POSITION)); 2bda6: 81 e9 ldi r24, 0x91 ; 145 2bda8: 9f e0 ldi r25, 0x0F ; 15 2bdaa: 0f 94 24 dc call 0x3b848 ; 0x3b848 if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) 2bdae: 20 91 6a 02 lds r18, 0x026A ; 0x80026a 2bdb2: 0f b6 in r0, 0x3f ; 63 2bdb4: f8 94 cli 2bdb6: de bf out 0x3e, r29 ; 62 2bdb8: 0f be out 0x3f, r0 ; 63 2bdba: cd bf out 0x3d, r28 ; 61 2bdbc: 21 11 cpse r18, r1 2bdbe: 33 c0 rjmp .+102 ; 0x2be26 { // Set a position in the file. enquecommandf_P(PSTR("M26 S%lu"), position); 2bdc0: 9f 93 push r25 2bdc2: 8f 93 push r24 2bdc4: 7f 93 push r23 2bdc6: 6f 93 push r22 2bdc8: 87 e8 ldi r24, 0x87 ; 135 2bdca: 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); 2bdcc: 9f 93 push r25 2bdce: 8f 93 push r24 2bdd0: 0e 94 b6 88 call 0x1116c ; 0x1116c 2bdd4: 0f 90 pop r0 2bdd6: 0f 90 pop r0 2bdd8: 0f 90 pop r0 2bdda: 0f 90 pop r0 2bddc: 0f 90 pop r0 2bdde: 0f 90 pop r0 } enquecommand_P(PSTR("G4 S0")); 2bde0: 61 e0 ldi r22, 0x01 ; 1 2bde2: 87 e7 ldi r24, 0x77 ; 119 2bde4: 9f e8 ldi r25, 0x8F ; 143 2bde6: 0e 94 20 88 call 0x11040 ; 0x11040 enquecommand_P(PSTR("PRUSA uvlo")); 2bdea: 61 e0 ldi r22, 0x01 ; 1 2bdec: 8c e6 ldi r24, 0x6C ; 108 2bdee: 9f e8 ldi r25, 0x8F ; 143 2bdf0: 0e 94 20 88 call 0x11040 ; 0x11040 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")); 2bdf4: 8f e2 ldi r24, 0x2F ; 47 2bdf6: 9e e6 ldi r25, 0x6E ; 110 2bdf8: 0f 94 05 db call 0x3b60a ; 0x3b60a gcode_M114(); 2bdfc: 0e 94 47 78 call 0xf08e ; 0xf08e } 2be00: 0f 90 pop r0 2be02: 0f 90 pop r0 2be04: df 91 pop r29 2be06: cf 91 pop r28 2be08: 1f 91 pop r17 2be0a: 0f 91 pop r16 2be0c: ff 90 pop r15 2be0e: ef 90 pop r14 2be10: df 90 pop r13 2be12: cf 90 pop r12 2be14: bf 90 pop r11 2be16: af 90 pop r10 2be18: 9f 90 pop r9 2be1a: 8f 90 pop r8 2be1c: 7f 90 pop r7 2be1e: 6f 90 pop r6 2be20: 5f 90 pop r5 2be22: 4f 90 pop r4 2be24: 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) 2be26: 21 30 cpi r18, 0x01 ; 1 2be28: d9 f6 brne .-74 ; 0x2bde0 { // Set line number enquecommandf_P(PSTR("M110 N%lu"), position); 2be2a: 9f 93 push r25 2be2c: 8f 93 push r24 2be2e: 7f 93 push r23 2be30: 6f 93 push r22 2be32: 8d e7 ldi r24, 0x7D ; 125 2be34: 9f e8 ldi r25, 0x8F ; 143 2be36: ca cf rjmp .-108 ; 0x2bdcc 0002be38 : 2be38: 88 e1 ldi r24, 0x18 ; 24 2be3a: 9e e0 ldi r25, 0x0E ; 14 2be3c: 0f b6 in r0, 0x3f ; 63 2be3e: f8 94 cli 2be40: a8 95 wdr 2be42: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 2be46: 0f be out 0x3f, r0 ; 63 2be48: 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); 2be4c: 9f b7 in r25, 0x3f ; 63 2be4e: f8 94 cli 2be50: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2be54: 84 60 ori r24, 0x04 ; 4 2be56: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2be5a: 9f bf out 0x3f, r25 ; 63 lcd_clear(); 2be5c: 0e 94 13 6f call 0xde26 ; 0xde26 lcd_puts_at_P(0, 1, MSG_POWERPANIC_DETECTED); 2be60: 47 ec ldi r20, 0xC7 ; 199 2be62: 5d e6 ldi r21, 0x6D ; 109 2be64: 61 e0 ldi r22, 0x01 ; 1 2be66: 80 e0 ldi r24, 0x00 ; 0 2be68: 0e 94 f4 6e call 0xdde8 ; 0xdde8 2be6c: ff cf rjmp .-2 ; 0x2be6c 0002be6e <__vector_5>: SERIAL_ECHOLNRPGM(MSG_INT4); uvlo_drain_reset(); } } ISR(INT4_vect) { 2be6e: 1f 92 push r1 2be70: 0f 92 push r0 2be72: 0f b6 in r0, 0x3f ; 63 2be74: 0f 92 push r0 2be76: 11 24 eor r1, r1 2be78: 0b b6 in r0, 0x3b ; 59 2be7a: 0f 92 push r0 2be7c: 8f 92 push r8 2be7e: 9f 92 push r9 2be80: af 92 push r10 2be82: bf 92 push r11 2be84: cf 92 push r12 2be86: df 92 push r13 2be88: ef 92 push r14 2be8a: ff 92 push r15 2be8c: 0f 93 push r16 2be8e: 1f 93 push r17 2be90: 2f 93 push r18 2be92: 3f 93 push r19 2be94: 4f 93 push r20 2be96: 5f 93 push r21 2be98: 6f 93 push r22 2be9a: 7f 93 push r23 2be9c: 8f 93 push r24 2be9e: 9f 93 push r25 2bea0: af 93 push r26 2bea2: bf 93 push r27 2bea4: cf 93 push r28 2bea6: df 93 push r29 2bea8: ef 93 push r30 2beaa: ff 93 push r31 EIMSK &= ~(1 << 4); //disable INT4 interrupt to make sure that this code will be executed just once 2beac: ec 98 cbi 0x1d, 4 ; 29 SERIAL_ECHOLNRPGM(MSG_INT4); 2beae: 82 e1 ldi r24, 0x12 ; 18 2beb0: 9e e8 ldi r25, 0x8E ; 142 2beb2: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 if (eeprom_read_byte((uint8_t*)EEPROM_UVLO) == PowerPanic::NO_PENDING_RECOVERY) 2beb6: 85 ea ldi r24, 0xA5 ; 165 2beb8: 9f e0 ldi r25, 0x0F ; 15 2beba: 0f 94 1c dc call 0x3b838 ; 0x3b838 2bebe: 18 2f mov r17, r24 2bec0: 81 11 cpse r24, r1 2bec2: de c2 rjmp .+1468 ; 0x2c480 <__vector_5+0x612> { if(printer_active()) { 2bec4: 0e 94 e1 67 call 0xcfc2 ; 0xcfc2 2bec8: 88 23 and r24, r24 2beca: 09 f4 brne .+2 ; 0x2bece <__vector_5+0x60> 2becc: a9 c3 rjmp .+1874 ; 0x2c620 <__vector_5+0x7b2> while(1); } void uvlo_() { unsigned long time_start = _millis(); 2bece: 0f 94 4c 29 call 0x25298 ; 0x25298 2bed2: 6b 01 movw r12, r22 2bed4: 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); 2bed6: c0 91 a9 0d lds r28, 0x0DA9 ; 0x800da9 2beda: cc 23 and r28, r28 2bedc: 31 f0 breq .+12 ; 0x2beea <__vector_5+0x7c> 2bede: c1 e0 ldi r28, 0x01 ; 1 2bee0: 80 91 6a 02 lds r24, 0x026A ; 0x80026a 2bee4: 82 30 cpi r24, 0x02 ; 2 2bee6: 09 f4 brne .+2 ; 0x2beea <__vector_5+0x7c> 2bee8: c0 e0 ldi r28, 0x00 ; 0 const bool pos_invalid = mesh_bed_leveling_flag || homing_flag; 2beea: d0 91 a8 0d lds r29, 0x0DA8 ; 0x800da8 2beee: d1 11 cpse r29, r1 2bef0: 02 c0 rjmp .+4 ; 0x2bef6 <__vector_5+0x88> 2bef2: d0 91 a7 0d lds r29, 0x0DA7 ; 0x800da7 // Conserve as much power as soon as possible // Turn off the LCD backlight #ifdef LCD_BL_PIN backlightMode = BACKLIGHT_MODE_DIM; 2bef6: 10 92 4f 02 sts 0x024F, r1 ; 0x80024f backlightLevel_LOW = 0; 2befa: 10 92 00 04 sts 0x0400, r1 ; 0x800400 backlight_update(); 2befe: 0e 94 06 8a call 0x1140c ; 0x1140c #endif //LCD_BL_PIN // Disable X and Y motors to conserve power disable_x(); 2bf02: 17 9a sbi 0x02, 7 ; 2 2bf04: 10 92 8f 06 sts 0x068F, r1 ; 0x80068f disable_y(); 2bf08: 16 9a sbi 0x02, 6 ; 2 2bf0a: 10 92 90 06 sts 0x0690, r1 ; 0x800690 // Minimise Z and E motor currents (Hold and Run) #ifdef TMC2130 currents[Z_AXIS].setiHold(20); 2bf0e: 64 e1 ldi r22, 0x14 ; 20 2bf10: 83 e6 ldi r24, 0x63 ; 99 2bf12: 92 e0 ldi r25, 0x02 ; 2 2bf14: 0e 94 fe 67 call 0xcffc ; 0xcffc currents[Z_AXIS].setiRun(20); 2bf18: 64 e1 ldi r22, 0x14 ; 20 2bf1a: 83 e6 ldi r24, 0x63 ; 99 2bf1c: 92 e0 ldi r25, 0x02 ; 2 2bf1e: 0e 94 06 68 call 0xd00c ; 0xd00c tmc2130_setup_chopper(Z_AXIS, tmc2130_mres[Z_AXIS]); 2bf22: 50 e0 ldi r21, 0x00 ; 0 2bf24: 40 e0 ldi r20, 0x00 ; 0 2bf26: 60 91 f7 04 lds r22, 0x04F7 ; 0x8004f7 2bf2a: 82 e0 ldi r24, 0x02 ; 2 2bf2c: 0f 94 8f 24 call 0x2491e ; 0x2491e currents[E_AXIS].setiHold(20); 2bf30: 64 e1 ldi r22, 0x14 ; 20 2bf32: 86 e6 ldi r24, 0x66 ; 102 2bf34: 92 e0 ldi r25, 0x02 ; 2 2bf36: 0e 94 fe 67 call 0xcffc ; 0xcffc currents[E_AXIS].setiRun(20); 2bf3a: 64 e1 ldi r22, 0x14 ; 20 2bf3c: 86 e6 ldi r24, 0x66 ; 102 2bf3e: 92 e0 ldi r25, 0x02 ; 2 2bf40: 0e 94 06 68 call 0xd00c ; 0xd00c tmc2130_setup_chopper(E_AXIS, tmc2130_mres[E_AXIS]); 2bf44: 50 e0 ldi r21, 0x00 ; 0 2bf46: 40 e0 ldi r20, 0x00 ; 0 2bf48: 60 91 f8 04 lds r22, 0x04F8 ; 0x8004f8 2bf4c: 83 e0 ldi r24, 0x03 ; 3 2bf4e: 0f 94 8f 24 call 0x2491e ; 0x2491e #endif //TMC2130 if (!print_saved_in_ram && !isPartialBackupAvailable) 2bf52: c1 11 cpse r28, r1 2bf54: 1b c0 rjmp .+54 ; 0x2bf8c <__vector_5+0x11e> 2bf56: 80 91 a2 06 lds r24, 0x06A2 ; 0x8006a2 2bf5a: 81 11 cpse r24, r1 2bf5c: 17 c0 rjmp .+46 ; 0x2bf8c <__vector_5+0x11e> { saved_bed_temperature = target_temperature_bed; 2bf5e: 80 91 72 06 lds r24, 0x0672 ; 0x800672 2bf62: 80 93 ae 05 sts 0x05AE, r24 ; 0x8005ae saved_extruder_temperature = target_temperature[active_extruder]; 2bf66: 80 91 b6 0d lds r24, 0x0DB6 ; 0x800db6 2bf6a: 90 91 b7 0d lds r25, 0x0DB7 ; 0x800db7 2bf6e: 90 93 ad 05 sts 0x05AD, r25 ; 0x8005ad 2bf72: 80 93 ac 05 sts 0x05AC, r24 ; 0x8005ac saved_extruder_relative_mode = axis_relative_modes & E_AXIS_MASK; 2bf76: 80 91 e5 03 lds r24, 0x03E5 ; 0x8003e5 2bf7a: 83 fb bst r24, 3 2bf7c: 88 27 eor r24, r24 2bf7e: 80 f9 bld r24, 0 2bf80: 80 93 64 05 sts 0x0564, r24 ; 0x800564 saved_fan_speed = fanSpeed; 2bf84: 80 91 e7 03 lds r24, 0x03E7 ; 0x8003e7 2bf88: 80 93 ab 05 sts 0x05AB, r24 ; 0x8005ab } // Stop all heaters before continuing disable_heater(); 2bf8c: 0f 94 18 2f call 0x25e30 ; 0x25e30 // Fetch data not included in a partial back-up if (!print_saved_in_ram) { 2bf90: c1 11 cpse r28, r1 2bf92: 04 c0 rjmp .+8 ; 0x2bf9c <__vector_5+0x12e> // Calculate the file position, from which to resume this print. save_print_file_state(); 2bf94: 0e 94 3a 65 call 0xca74 ; 0xca74 // save the global state at planning time save_planner_global_state(); 2bf98: 0e 94 f0 64 call 0xc9e0 ; 0xc9e0 } // 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; 2bf9c: 00 91 c2 13 lds r16, 0x13C2 ; 0x8013c2 mbl.active = false; 2bfa0: 10 92 c2 13 sts 0x13C2, r1 ; 0x8013c2 // 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(); 2bfa4: 0f 94 c3 c1 call 0x38386 ; 0x38386 // 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) 2bfa8: c1 11 cpse r28, r1 2bfaa: 1b c0 rjmp .+54 ; 0x2bfe2 <__vector_5+0x174> 2bfac: 80 91 a2 06 lds r24, 0x06A2 ; 0x8006a2 2bfb0: 81 11 cpse r24, r1 2bfb2: 17 c0 rjmp .+46 ; 0x2bfe2 <__vector_5+0x174> { memcpy(saved_pos, current_position, sizeof(saved_pos)); 2bfb4: 80 e1 ldi r24, 0x10 ; 16 2bfb6: e2 e9 ldi r30, 0x92 ; 146 2bfb8: f6 e0 ldi r31, 0x06 ; 6 2bfba: a3 e7 ldi r26, 0x73 ; 115 2bfbc: b2 e0 ldi r27, 0x02 ; 2 2bfbe: 01 90 ld r0, Z+ 2bfc0: 0d 92 st X+, r0 2bfc2: 8a 95 dec r24 2bfc4: e1 f7 brne .-8 ; 0x2bfbe <__vector_5+0x150> if (pos_invalid) saved_pos[X_AXIS] = X_COORD_INVALID; 2bfc6: dd 23 and r29, r29 2bfc8: 61 f0 breq .+24 ; 0x2bfe2 <__vector_5+0x174> 2bfca: 80 e0 ldi r24, 0x00 ; 0 2bfcc: 90 e0 ldi r25, 0x00 ; 0 2bfce: a0 e8 ldi r26, 0x80 ; 128 2bfd0: bf eb ldi r27, 0xBF ; 191 2bfd2: 80 93 73 02 sts 0x0273, r24 ; 0x800273 2bfd6: 90 93 74 02 sts 0x0274, r25 ; 0x800274 2bfda: a0 93 75 02 sts 0x0275, r26 ; 0x800275 2bfde: 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]; 2bfe2: 80 90 7b 02 lds r8, 0x027B ; 0x80027b 2bfe6: 90 90 7c 02 lds r9, 0x027C ; 0x80027c 2bfea: a0 90 7d 02 lds r10, 0x027D ; 0x80027d 2bfee: b0 90 7e 02 lds r11, 0x027E ; 0x80027e if(mbl_was_active) { 2bff2: 00 23 and r16, r16 2bff4: d1 f0 breq .+52 ; 0x2c02a <__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]); 2bff6: 20 91 77 02 lds r18, 0x0277 ; 0x800277 2bffa: 30 91 78 02 lds r19, 0x0278 ; 0x800278 2bffe: 40 91 79 02 lds r20, 0x0279 ; 0x800279 2c002: 50 91 7a 02 lds r21, 0x027A ; 0x80027a 2c006: 60 91 73 02 lds r22, 0x0273 ; 0x800273 2c00a: 70 91 74 02 lds r23, 0x0274 ; 0x800274 2c00e: 80 91 75 02 lds r24, 0x0275 ; 0x800275 2c012: 90 91 76 02 lds r25, 0x0276 ; 0x800276 2c016: 0f 94 b1 a1 call 0x34362 ; 0x34362 2c01a: 9b 01 movw r18, r22 2c01c: ac 01 movw r20, r24 2c01e: c5 01 movw r24, r10 2c020: b4 01 movw r22, r8 2c022: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 2c026: 4b 01 movw r8, r22 2c028: 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); 2c02a: b5 01 movw r22, r10 2c02c: a4 01 movw r20, r8 2c02e: 8d e8 ldi r24, 0x8D ; 141 2c030: 9f e0 ldi r25, 0x0F ; 15 2c032: 0f 94 52 dc call 0x3b8a4 ; 0x3b8a4 2c036: 40 91 7f 02 lds r20, 0x027F ; 0x80027f 2c03a: 50 91 80 02 lds r21, 0x0280 ; 0x800280 2c03e: 60 91 81 02 lds r22, 0x0281 ; 0x800281 2c042: 70 91 82 02 lds r23, 0x0282 ; 0x800282 2c046: 8e e6 ldi r24, 0x6E ; 110 2c048: 9f e0 ldi r25, 0x0F ; 15 2c04a: 0f 94 52 dc call 0x3b8a4 ; 0x3b8a4 } 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); 2c04e: 60 91 64 05 lds r22, 0x0564 ; 0x800564 2c052: c1 e0 ldi r28, 0x01 ; 1 2c054: 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); 2c056: 82 e7 ldi r24, 0x72 ; 114 2c058: 9f e0 ldi r25, 0x0F ; 15 2c05a: 0f 94 40 dc call 0x3b880 ; 0x3b880 // Clean the input command queue, inhibit serial processing using saved_printing cmdqueue_reset(); 2c05e: 0e 94 44 7f call 0xfe88 ; 0xfe88 card.sdprinting = false; 2c062: 10 92 90 14 sts 0x1490, r1 ; 0x801490 saved_printing = true; 2c066: c0 93 a9 0d sts 0x0DA9, r28 ; 0x800da9 // 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; 2c06a: 10 92 ac 0d sts 0x0DAC, r1 ; 0x800dac sei(); 2c06e: 78 94 sei // Retract current_position[E_AXIS] -= default_retraction; 2c070: 20 e0 ldi r18, 0x00 ; 0 2c072: 30 e0 ldi r19, 0x00 ; 0 2c074: 40 e8 ldi r20, 0x80 ; 128 2c076: 5f e3 ldi r21, 0x3F ; 63 2c078: 60 91 9e 06 lds r22, 0x069E ; 0x80069e 2c07c: 70 91 9f 06 lds r23, 0x069F ; 0x80069f 2c080: 80 91 a0 06 lds r24, 0x06A0 ; 0x8006a0 2c084: 90 91 a1 06 lds r25, 0x06A1 ; 0x8006a1 2c088: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 2c08c: 60 93 9e 06 sts 0x069E, r22 ; 0x80069e 2c090: 70 93 9f 06 sts 0x069F, r23 ; 0x80069f 2c094: 80 93 a0 06 sts 0x06A0, r24 ; 0x8006a0 2c098: 90 93 a1 06 sts 0x06A1, r25 ; 0x8006a1 plan_buffer_line_curposXYZE(95); 2c09c: 60 e0 ldi r22, 0x00 ; 0 2c09e: 70 e0 ldi r23, 0x00 ; 0 2c0a0: 8e eb ldi r24, 0xBE ; 190 2c0a2: 92 e4 ldi r25, 0x42 ; 66 2c0a4: 0f 94 49 c0 call 0x38092 ; 0x38092 st_synchronize(); 2c0a8: 0f 94 e8 42 call 0x285d0 ; 0x285d0 disable_e0(); 2c0ac: 14 9a sbi 0x02, 4 ; 2 return stat; } uint16_t tmc2130_get_res(uint8_t axis) { return tmc2130_mres2usteps(tmc2130_mres[axis]); 2c0ae: 80 91 f7 04 lds r24, 0x04F7 ; 0x8004f7 2c0b2: c0 e0 ldi r28, 0x00 ; 0 2c0b4: d1 e0 ldi r29, 0x01 ; 1 2c0b6: 02 c0 rjmp .+4 ; 0x2c0bc <__vector_5+0x24e> 2c0b8: d6 95 lsr r29 2c0ba: c7 95 ror r28 2c0bc: 8a 95 dec r24 2c0be: e2 f7 brpl .-8 ; 0x2c0b8 <__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); 2c0c0: 82 e0 ldi r24, 0x02 ; 2 2c0c2: 0f 94 75 24 call 0x248ea ; 0x248ea current_position[Z_AXIS] += float(1024 - z_microsteps) 2c0c6: 60 e0 ldi r22, 0x00 ; 0 2c0c8: 74 e0 ldi r23, 0x04 ; 4 2c0ca: 68 1b sub r22, r24 2c0cc: 79 0b sbc r23, r25 2c0ce: 90 e0 ldi r25, 0x00 ; 0 2c0d0: 80 e0 ldi r24, 0x00 ; 0 2c0d2: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 2c0d6: 4b 01 movw r8, r22 2c0d8: 5c 01 movw r10, r24 / (z_res * cs.axis_steps_per_mm[Z_AXIS]) 2c0da: be 01 movw r22, r28 2c0dc: 90 e0 ldi r25, 0x00 ; 0 2c0de: 80 e0 ldi r24, 0x00 ; 0 2c0e0: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 2c0e4: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 2c0e8: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 2c0ec: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 2c0f0: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 2c0f4: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 2c0f8: 9b 01 movw r18, r22 2c0fa: ac 01 movw r20, r24 2c0fc: c5 01 movw r24, r10 2c0fe: b4 01 movw r22, r8 2c100: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> + UVLO_Z_AXIS_SHIFT; 2c104: 2a e0 ldi r18, 0x0A ; 10 2c106: 37 ed ldi r19, 0xD7 ; 215 2c108: 43 e2 ldi r20, 0x23 ; 35 2c10a: 5f e3 ldi r21, 0x3F ; 63 2c10c: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__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) 2c110: 20 91 9a 06 lds r18, 0x069A ; 0x80069a 2c114: 30 91 9b 06 lds r19, 0x069B ; 0x80069b 2c118: 40 91 9c 06 lds r20, 0x069C ; 0x80069c 2c11c: 50 91 9d 06 lds r21, 0x069D ; 0x80069d 2c120: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 2c124: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a 2c128: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b 2c12c: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c 2c130: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d / (z_res * cs.axis_steps_per_mm[Z_AXIS]) + UVLO_Z_AXIS_SHIFT; plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS]/60); 2c134: 65 e5 ldi r22, 0x55 ; 85 2c136: 75 e5 ldi r23, 0x55 ; 85 2c138: 85 e5 ldi r24, 0x55 ; 85 2c13a: 91 e4 ldi r25, 0x41 ; 65 2c13c: 0f 94 49 c0 call 0x38092 ; 0x38092 st_synchronize(); 2c140: 0f 94 e8 42 call 0x285d0 ; 0x285d0 if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); 2c144: 40 91 60 05 lds r20, 0x0560 ; 0x800560 2c148: 50 91 61 05 lds r21, 0x0561 ; 0x800561 2c14c: 60 91 62 05 lds r22, 0x0562 ; 0x800562 2c150: 70 91 63 05 lds r23, 0x0563 ; 0x800563 2c154: 81 e9 ldi r24, 0x91 ; 145 2c156: 9f e0 ldi r25, 0x0F ; 15 2c158: 0f 94 52 dc call 0x3b8a4 ; 0x3b8a4 2c15c: ce ea ldi r28, 0xAE ; 174 2c15e: 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; 2c160: 97 e0 ldi r25, 0x07 ; 7 2c162: 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; 2c164: 70 e0 ldi r23, 0x00 ; 0 2c166: 60 e0 ldi r22, 0x00 ; 0 2c168: 00 23 and r16, r16 2c16a: 19 f1 breq .+70 ; 0x2c1b2 <__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; 2c16c: 81 2f mov r24, r17 2c16e: 6b 2d mov r22, r11 2c170: 0f 94 cb dc call 0x3b996 ; 0x3b996 <__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; 2c174: b8 9e mul r11, r24 2c176: f0 01 movw r30, r0 2c178: 11 24 eor r1, r1 2c17a: e9 0f add r30, r25 2c17c: f1 1d adc r31, r1 2c17e: ee 0f add r30, r30 2c180: ff 1f adc r31, r31 2c182: ee 0f add r30, r30 2c184: ff 1f adc r31, r31 2c186: ee 53 subi r30, 0x3E ; 62 2c188: fc 4e sbci r31, 0xEC ; 236 2c18a: 20 e0 ldi r18, 0x00 ; 0 2c18c: 30 e0 ldi r19, 0x00 ; 0 2c18e: 4a e7 ldi r20, 0x7A ; 122 2c190: 54 e4 ldi r21, 0x44 ; 68 2c192: 61 81 ldd r22, Z+1 ; 0x01 2c194: 72 81 ldd r23, Z+2 ; 0x02 2c196: 83 81 ldd r24, Z+3 ; 0x03 2c198: 94 81 ldd r25, Z+4 ; 0x04 2c19a: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 2c19e: 20 e0 ldi r18, 0x00 ; 0 2c1a0: 30 e0 ldi r19, 0x00 ; 0 2c1a2: 40 e0 ldi r20, 0x00 ; 0 2c1a4: 5f e3 ldi r21, 0x3F ; 63 2c1a6: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 2c1aa: 0f 94 eb de call 0x3bdd6 ; 0x3bdd6 2c1ae: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 2c1b2: ce 01 movw r24, r28 2c1b4: 0f 94 5e dc call 0x3b8bc ; 0x3b8bc // 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) 2c1b8: 1f 5f subi r17, 0xFF ; 255 2c1ba: 22 96 adiw r28, 0x02 ; 2 2c1bc: 11 33 cpi r17, 0x31 ; 49 2c1be: 91 f6 brne .-92 ; 0x2c164 <__vector_5+0x2f6> if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 2c1c0: 40 91 9a 06 lds r20, 0x069A ; 0x80069a 2c1c4: 50 91 9b 06 lds r21, 0x069B ; 0x80069b 2c1c8: 60 91 9c 06 lds r22, 0x069C ; 0x80069c 2c1cc: 70 91 9d 06 lds r23, 0x069D ; 0x80069d 2c1d0: 8a ed ldi r24, 0xDA ; 218 2c1d2: 9e e0 ldi r25, 0x0E ; 14 2c1d4: 0f 94 52 dc call 0x3b8a4 ; 0x3b8a4 2c1d8: 40 91 73 02 lds r20, 0x0273 ; 0x800273 2c1dc: 50 91 74 02 lds r21, 0x0274 ; 0x800274 2c1e0: 60 91 75 02 lds r22, 0x0275 ; 0x800275 2c1e4: 70 91 76 02 lds r23, 0x0276 ; 0x800276 2c1e8: 8d e9 ldi r24, 0x9D ; 157 2c1ea: 9f e0 ldi r25, 0x0F ; 15 2c1ec: 0f 94 52 dc call 0x3b8a4 ; 0x3b8a4 2c1f0: 40 91 77 02 lds r20, 0x0277 ; 0x800277 2c1f4: 50 91 78 02 lds r21, 0x0278 ; 0x800278 2c1f8: 60 91 79 02 lds r22, 0x0279 ; 0x800279 2c1fc: 70 91 7a 02 lds r23, 0x027A ; 0x80027a 2c200: 81 ea ldi r24, 0xA1 ; 161 2c202: 9f e0 ldi r25, 0x0F ; 15 2c204: 0f 94 52 dc call 0x3b8a4 ; 0x3b8a4 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 2c208: 60 91 5e 05 lds r22, 0x055E ; 0x80055e 2c20c: 70 91 5f 05 lds r23, 0x055F ; 0x80055f 2c210: 89 e8 ldi r24, 0x89 ; 137 2c212: 9f e0 ldi r25, 0x0F ; 15 2c214: 0f 94 5e dc call 0x3b8bc ; 0x3b8bc 2c218: 60 91 39 02 lds r22, 0x0239 ; 0x800239 2c21c: 70 91 3a 02 lds r23, 0x023A ; 0x80023a 2c220: 85 e3 ldi r24, 0x35 ; 53 2c222: 9d e0 ldi r25, 0x0D ; 13 2c224: 0f 94 5e dc call 0x3b8bc ; 0x3b8bc 2c228: 60 91 ac 05 lds r22, 0x05AC ; 0x8005ac 2c22c: 70 91 ad 05 lds r23, 0x05AD ; 0x8005ad 2c230: 88 ed ldi r24, 0xD8 ; 216 2c232: 9e e0 ldi r25, 0x0E ; 14 2c234: 0f 94 5e dc call 0x3b8bc ; 0x3b8bc if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 2c238: 60 91 ae 05 lds r22, 0x05AE ; 0x8005ae 2c23c: 8b e8 ldi r24, 0x8B ; 139 2c23e: 9f e0 ldi r25, 0x0F ; 15 2c240: 0f 94 40 dc call 0x3b880 ; 0x3b880 2c244: 60 91 ab 05 lds r22, 0x05AB ; 0x8005ab 2c248: 88 e8 ldi r24, 0x88 ; 136 2c24a: 9f e0 ldi r25, 0x0F ; 15 2c24c: 0f 94 40 dc call 0x3b880 ; 0x3b880 if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 2c250: 40 91 93 02 lds r20, 0x0293 ; 0x800293 2c254: 50 91 94 02 lds r21, 0x0294 ; 0x800294 2c258: 60 91 95 02 lds r22, 0x0295 ; 0x800295 2c25c: 70 91 96 02 lds r23, 0x0296 ; 0x800296 2c260: 88 ee ldi r24, 0xE8 ; 232 2c262: 9e e0 ldi r25, 0x0E ; 14 2c264: 0f 94 52 dc call 0x3b8a4 ; 0x3b8a4 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 2c268: 60 91 bc 02 lds r22, 0x02BC ; 0x8002bc 2c26c: 70 91 bd 02 lds r23, 0x02BD ; 0x8002bd 2c270: 8e ed ldi r24, 0xDE ; 222 2c272: 9e e0 ldi r25, 0x0E ; 14 2c274: 0f 94 5e dc call 0x3b8bc ; 0x3b8bc if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 2c278: 40 91 f2 0d lds r20, 0x0DF2 ; 0x800df2 2c27c: 50 91 f3 0d lds r21, 0x0DF3 ; 0x800df3 2c280: 60 91 f4 0d lds r22, 0x0DF4 ; 0x800df4 2c284: 70 91 f5 0d lds r23, 0x0DF5 ; 0x800df5 2c288: 81 e1 ldi r24, 0x11 ; 17 2c28a: 9d e0 ldi r25, 0x0D ; 13 2c28c: 0f 94 52 dc call 0x3b8a4 ; 0x3b8a4 2c290: 40 91 f6 0d lds r20, 0x0DF6 ; 0x800df6 2c294: 50 91 f7 0d lds r21, 0x0DF7 ; 0x800df7 2c298: 60 91 f8 0d lds r22, 0x0DF8 ; 0x800df8 2c29c: 70 91 f9 0d lds r23, 0x0DF9 ; 0x800df9 2c2a0: 8d e0 ldi r24, 0x0D ; 13 2c2a2: 9d e0 ldi r25, 0x0D ; 13 2c2a4: 0f 94 52 dc call 0x3b8a4 ; 0x3b8a4 2c2a8: 40 91 7e 0e lds r20, 0x0E7E ; 0x800e7e 2c2ac: 50 91 7f 0e lds r21, 0x0E7F ; 0x800e7f 2c2b0: 60 91 80 0e lds r22, 0x0E80 ; 0x800e80 2c2b4: 70 91 81 0e lds r23, 0x0E81 ; 0x800e81 2c2b8: 89 e0 ldi r24, 0x09 ; 9 2c2ba: 9d e0 ldi r25, 0x0D ; 13 2c2bc: 0f 94 52 dc call 0x3b8a4 ; 0x3b8a4 #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); 2c2c0: 40 e1 ldi r20, 0x10 ; 16 2c2c2: 50 e0 ldi r21, 0x00 ; 0 2c2c4: 67 e3 ldi r22, 0x37 ; 55 2c2c6: 7d e0 ldi r23, 0x0D ; 13 2c2c8: 83 e8 ldi r24, 0x83 ; 131 2c2ca: 92 e0 ldi r25, 0x02 ; 2 2c2cc: 0f 94 30 dc call 0x3b860 ; 0x3b860 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 2c2d0: 60 91 69 05 lds r22, 0x0569 ; 0x800569 2c2d4: 70 91 6a 05 lds r23, 0x056A ; 0x80056a 2c2d8: 8c e6 ldi r24, 0x6C ; 108 2c2da: 9f e0 ldi r25, 0x0F ; 15 2c2dc: 0f 94 5e dc call 0x3b8bc ; 0x3b8bc if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 2c2e0: 60 91 6a 02 lds r22, 0x026A ; 0x80026a 2c2e4: 8c e8 ldi r24, 0x8C ; 140 2c2e6: 9f e0 ldi r25, 0x0F ; 15 2c2e8: 0f 94 40 dc call 0x3b880 ; 0x3b880 if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 2c2ec: 40 91 65 05 lds r20, 0x0565 ; 0x800565 2c2f0: 50 91 66 05 lds r21, 0x0566 ; 0x800566 2c2f4: 60 91 67 05 lds r22, 0x0567 ; 0x800567 2c2f8: 70 91 68 05 lds r23, 0x0568 ; 0x800568 2c2fc: 8c e2 ldi r24, 0x2C ; 44 2c2fe: 9d e0 ldi r25, 0x0D ; 13 2c300: 0f 94 52 dc call 0x3b8a4 ; 0x3b8a4 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 2c304: 60 91 6b 02 lds r22, 0x026B ; 0x80026b 2c308: 70 91 6c 02 lds r23, 0x026C ; 0x80026c 2c30c: 8d e7 ldi r24, 0x7D ; 125 2c30e: 9c e0 ldi r25, 0x0C ; 12 2c310: 0f 94 5e dc call 0x3b8bc ; 0x3b8bc #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); 2c314: 40 e1 ldi r20, 0x10 ; 16 2c316: 50 e0 ldi r21, 0x00 ; 0 2c318: 6d e6 ldi r22, 0x6D ; 109 2c31a: 7c e0 ldi r23, 0x0C ; 12 2c31c: 82 ee ldi r24, 0xE2 ; 226 2c31e: 9d e0 ldi r25, 0x0D ; 13 2c320: 0f 94 30 dc call 0x3b860 ; 0x3b860 2c324: 40 e1 ldi r20, 0x10 ; 16 2c326: 50 e0 ldi r21, 0x00 ; 0 2c328: 6d e5 ldi r22, 0x5D ; 93 2c32a: 7c e0 ldi r23, 0x0C ; 12 2c32c: 8a e6 ldi r24, 0x6A ; 106 2c32e: 9e e0 ldi r25, 0x0E ; 14 2c330: 0f 94 30 dc call 0x3b860 ; 0x3b860 2c334: 40 e1 ldi r20, 0x10 ; 16 2c336: 50 e0 ldi r21, 0x00 ; 0 2c338: 6d e4 ldi r22, 0x4D ; 77 2c33a: 7c e0 ldi r23, 0x0C ; 12 2c33c: 82 ed ldi r24, 0xD2 ; 210 2c33e: 9d e0 ldi r25, 0x0D ; 13 2c340: 0f 94 30 dc call 0x3b860 ; 0x3b860 2c344: 40 e1 ldi r20, 0x10 ; 16 2c346: 50 e0 ldi r21, 0x00 ; 0 2c348: 6d e3 ldi r22, 0x3D ; 61 2c34a: 7c e0 ldi r23, 0x0C ; 12 2c34c: 8a e5 ldi r24, 0x5A ; 90 2c34e: 9e e0 ldi r25, 0x0E ; 14 2c350: 0f 94 30 dc call 0x3b860 ; 0x3b860 if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 2c354: 40 91 fa 0d lds r20, 0x0DFA ; 0x800dfa 2c358: 50 91 fb 0d lds r21, 0x0DFB ; 0x800dfb 2c35c: 60 91 fc 0d lds r22, 0x0DFC ; 0x800dfc 2c360: 70 91 fd 0d lds r23, 0x0DFD ; 0x800dfd 2c364: 89 e3 ldi r24, 0x39 ; 57 2c366: 9c e0 ldi r25, 0x0C ; 12 2c368: 0f 94 52 dc call 0x3b8a4 ; 0x3b8a4 2c36c: 40 91 fe 0d lds r20, 0x0DFE ; 0x800dfe 2c370: 50 91 ff 0d lds r21, 0x0DFF ; 0x800dff 2c374: 60 91 00 0e lds r22, 0x0E00 ; 0x800e00 2c378: 70 91 01 0e lds r23, 0x0E01 ; 0x800e01 2c37c: 85 e3 ldi r24, 0x35 ; 53 2c37e: 9c e0 ldi r25, 0x0C ; 12 2c380: 0f 94 52 dc call 0x3b8a4 ; 0x3b8a4 if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); 2c384: 40 91 02 0e lds r20, 0x0E02 ; 0x800e02 2c388: 50 91 03 0e lds r21, 0x0E03 ; 0x800e03 2c38c: 60 91 04 0e lds r22, 0x0E04 ; 0x800e04 2c390: 70 91 05 0e lds r23, 0x0E05 ; 0x800e05 2c394: 81 e3 ldi r24, 0x31 ; 49 2c396: 9c e0 ldi r25, 0x0C ; 12 2c398: 0f 94 52 dc call 0x3b8a4 ; 0x3b8a4 #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); 2c39c: 40 e1 ldi r20, 0x10 ; 16 2c39e: 50 e0 ldi r21, 0x00 ; 0 2c3a0: 61 e2 ldi r22, 0x21 ; 33 2c3a2: 7c e0 ldi r23, 0x0C ; 12 2c3a4: 86 e0 ldi r24, 0x06 ; 6 2c3a6: 9e e0 ldi r25, 0x0E ; 14 2c3a8: 0f 94 30 dc call 0x3b860 ; 0x3b860 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) { 2c3ac: 80 91 e4 03 lds r24, 0x03E4 ; 0x8003e4 2c3b0: 88 23 and r24, r24 2c3b2: 29 f0 breq .+10 ; 0x2c3be <__vector_5+0x550> if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 2c3b4: 61 e0 ldi r22, 0x01 ; 1 2c3b6: 8f e7 ldi r24, 0x7F ; 127 2c3b8: 9c e0 ldi r25, 0x0C ; 12 2c3ba: 0f 94 40 dc call 0x3b880 ; 0x3b880 2c3be: 61 e0 ldi r22, 0x01 ; 1 2c3c0: 85 ea ldi r24, 0xA5 ; 165 2c3c2: 9f e0 ldi r25, 0x0F ; 15 2c3c4: 0f 94 40 dc call 0x3b880 ; 0x3b880 } eeprom_update_byte_notify((uint8_t*)EEPROM_UVLO, PowerPanic::PENDING_RECOVERY); // Increment power failure counter eeprom_increment_byte((uint8_t*)EEPROM_POWER_COUNT); 2c3c8: 84 e6 ldi r24, 0x64 ; 100 2c3ca: 9f e0 ldi r25, 0x0F ; 15 2c3cc: 0e 94 28 76 call 0xec50 ; 0xec50 eeprom_increment_word((uint16_t*)EEPROM_POWER_COUNT_TOT); 2c3d0: 8f ef ldi r24, 0xFF ; 255 2c3d2: 9e e0 ldi r25, 0x0E ; 14 2c3d4: 0e 94 1b 76 call 0xec36 ; 0xec36 printf_P(_N("UVLO - end %d\n"), _millis() - time_start); 2c3d8: 0f 94 4c 29 call 0x25298 ; 0x25298 2c3dc: dc 01 movw r26, r24 2c3de: cb 01 movw r24, r22 2c3e0: 8c 19 sub r24, r12 2c3e2: 9d 09 sbc r25, r13 2c3e4: ae 09 sbc r26, r14 2c3e6: bf 09 sbc r27, r15 2c3e8: bf 93 push r27 2c3ea: af 93 push r26 2c3ec: 9f 93 push r25 2c3ee: 8f 93 push r24 2c3f0: 8c ed ldi r24, 0xDC ; 220 2c3f2: 9d e6 ldi r25, 0x6D ; 109 2c3f4: 9f 93 push r25 2c3f6: 8f 93 push r24 2c3f8: 0f 94 de da call 0x3b5bc ; 0x3b5bc WRITE(BEEPER,HIGH); 2c3fc: 9f b7 in r25, 0x3f ; 63 2c3fe: f8 94 cli 2c400: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c404: 84 60 ori r24, 0x04 ; 4 2c406: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c40a: 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(); 2c40c: 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; 2c40e: 0f 90 pop r0 2c410: 0f 90 pop r0 2c412: 0f 90 pop r0 2c414: 0f 90 pop r0 2c416: 0f 90 pop r0 2c418: 0f 90 pop r0 2c41a: 20 e0 ldi r18, 0x00 ; 0 2c41c: 30 e0 ldi r19, 0x00 ; 0 2c41e: 4f ef ldi r20, 0xFF ; 255 2c420: 52 e4 ldi r21, 0x42 ; 66 2c422: 60 91 92 06 lds r22, 0x0692 ; 0x800692 2c426: 70 91 93 06 lds r23, 0x0693 ; 0x800693 2c42a: 80 91 94 06 lds r24, 0x0694 ; 0x800694 2c42e: 90 91 95 06 lds r25, 0x0695 ; 0x800695 2c432: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 2c436: 87 fd sbrc r24, 7 2c438: 1f c0 rjmp .+62 ; 0x2c478 <__vector_5+0x60a> 2c43a: 80 e0 ldi r24, 0x00 ; 0 2c43c: 90 e0 ldi r25, 0x00 ; 0 2c43e: af e7 ldi r26, 0x7F ; 127 2c440: b3 e4 ldi r27, 0x43 ; 67 2c442: 80 93 92 06 sts 0x0692, r24 ; 0x800692 2c446: 90 93 93 06 sts 0x0693, r25 ; 0x800693 2c44a: a0 93 94 06 sts 0x0694, r26 ; 0x800694 2c44e: b0 93 95 06 sts 0x0695, r27 ; 0x800695 plan_buffer_line_curposXYZE(500); 2c452: 60 e0 ldi r22, 0x00 ; 0 2c454: 70 e0 ldi r23, 0x00 ; 0 2c456: 8a ef ldi r24, 0xFA ; 250 2c458: 93 e4 ldi r25, 0x43 ; 67 2c45a: 0f 94 49 c0 call 0x38092 ; 0x38092 st_synchronize(); 2c45e: 0f 94 e8 42 call 0x285d0 ; 0x285d0 2c462: 88 e1 ldi r24, 0x18 ; 24 2c464: 9e e0 ldi r25, 0x0E ; 14 2c466: 0f b6 in r0, 0x3f ; 63 2c468: f8 94 cli 2c46a: a8 95 wdr 2c46c: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 2c470: 0f be out 0x3f, r0 ; 63 2c472: 90 93 60 00 sts 0x0060, r25 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 2c476: ff cf rjmp .-2 ; 0x2c476 <__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; 2c478: 80 e0 ldi r24, 0x00 ; 0 2c47a: 90 e0 ldi r25, 0x00 ; 0 2c47c: dc 01 movw r26, r24 2c47e: e1 cf rjmp .-62 ; 0x2c442 <__vector_5+0x5d4> while(1); } static void uvlo_tiny() { unsigned long time_start = _millis(); 2c480: 0f 94 4c 29 call 0x25298 ; 0x25298 2c484: 6b 01 movw r12, r22 2c486: 7c 01 movw r14, r24 // Conserve power as soon as possible. disable_x(); 2c488: 17 9a sbi 0x02, 7 ; 2 2c48a: 10 92 8f 06 sts 0x068F, r1 ; 0x80068f disable_y(); 2c48e: 16 9a sbi 0x02, 6 ; 2 2c490: 10 92 90 06 sts 0x0690, r1 ; 0x800690 disable_e0(); 2c494: 14 9a sbi 0x02, 4 ; 2 #ifdef TMC2130 currents[Z_AXIS].setiHold(20); 2c496: 64 e1 ldi r22, 0x14 ; 20 2c498: 83 e6 ldi r24, 0x63 ; 99 2c49a: 92 e0 ldi r25, 0x02 ; 2 2c49c: 0e 94 fe 67 call 0xcffc ; 0xcffc currents[Z_AXIS].setiRun(20); 2c4a0: 64 e1 ldi r22, 0x14 ; 20 2c4a2: 83 e6 ldi r24, 0x63 ; 99 2c4a4: 92 e0 ldi r25, 0x02 ; 2 2c4a6: 0e 94 06 68 call 0xd00c ; 0xd00c tmc2130_setup_chopper(Z_AXIS, tmc2130_mres[Z_AXIS]); 2c4aa: 50 e0 ldi r21, 0x00 ; 0 2c4ac: 40 e0 ldi r20, 0x00 ; 0 2c4ae: 60 91 f7 04 lds r22, 0x04F7 ; 0x8004f7 2c4b2: 82 e0 ldi r24, 0x02 ; 2 2c4b4: 0f 94 8f 24 call 0x2491e ; 0x2491e #endif //TMC2130 // Stop all heaters disable_heater(); 2c4b8: 0f 94 18 2f call 0x25e30 ; 0x25e30 // 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; 2c4bc: 10 92 c2 13 sts 0x13C2, r1 ; 0x8013c2 planner_abort_hard(); 2c4c0: 0f 94 c3 c1 call 0x38386 ; 0x38386 // 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]) 2c4c4: 80 90 9a 06 lds r8, 0x069A ; 0x80069a 2c4c8: 90 90 9b 06 lds r9, 0x069B ; 0x80069b 2c4cc: a0 90 9c 06 lds r10, 0x069C ; 0x80069c 2c4d0: b0 90 9d 06 lds r11, 0x069D ; 0x80069d 2c4d4: 8a ed ldi r24, 0xDA ; 218 2c4d6: 9e e0 ldi r25, 0x0E ; 14 2c4d8: 0f 94 24 dc call 0x3b848 ; 0x3b848 2c4dc: 9b 01 movw r18, r22 2c4de: ac 01 movw r20, r24 2c4e0: c5 01 movw r24, r10 2c4e2: b4 01 movw r22, r8 2c4e4: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 2c4e8: 4b 01 movw r8, r22 2c4ea: 5c 01 movw r10, r24 2c4ec: e8 94 clt 2c4ee: b7 f8 bld r11, 7 2c4f0: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 2c4f4: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 2c4f8: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 2c4fc: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 2c500: 60 e0 ldi r22, 0x00 ; 0 2c502: 70 e0 ldi r23, 0x00 ; 0 2c504: 80 e8 ldi r24, 0x80 ; 128 2c506: 9f e3 ldi r25, 0x3F ; 63 2c508: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 2c50c: 9b 01 movw r18, r22 2c50e: ac 01 movw r20, r24 2c510: c5 01 movw r24, r10 2c512: b4 01 movw r22, r8 2c514: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 2c518: 87 fd sbrc r24, 7 2c51a: 61 c0 rjmp .+194 ; 0x2c5de <__vector_5+0x770> { // Clean the input command queue, inhibit serial processing using saved_printing cmdqueue_reset(); 2c51c: 0e 94 44 7f call 0xfe88 ; 0xfe88 card.sdprinting = false; 2c520: 10 92 90 14 sts 0x1490, r1 ; 0x801490 saved_printing = true; 2c524: 81 e0 ldi r24, 0x01 ; 1 2c526: 80 93 a9 0d sts 0x0DA9, r24 ; 0x800da9 // 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; 2c52a: 10 92 ac 0d sts 0x0DAC, r1 ; 0x800dac sei(); 2c52e: 78 94 sei 2c530: 80 91 f7 04 lds r24, 0x04F7 ; 0x8004f7 2c534: c0 e0 ldi r28, 0x00 ; 0 2c536: d1 e0 ldi r29, 0x01 ; 1 2c538: 02 c0 rjmp .+4 ; 0x2c53e <__vector_5+0x6d0> 2c53a: d6 95 lsr r29 2c53c: c7 95 ror r28 2c53e: 8a 95 dec r24 2c540: e2 f7 brpl .-8 ; 0x2c53a <__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); 2c542: 82 e0 ldi r24, 0x02 ; 2 2c544: 0f 94 75 24 call 0x248ea ; 0x248ea current_position[Z_AXIS] += float(1024 - z_microsteps) 2c548: 60 e0 ldi r22, 0x00 ; 0 2c54a: 74 e0 ldi r23, 0x04 ; 4 2c54c: 68 1b sub r22, r24 2c54e: 79 0b sbc r23, r25 2c550: 90 e0 ldi r25, 0x00 ; 0 2c552: 80 e0 ldi r24, 0x00 ; 0 2c554: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 2c558: 4b 01 movw r8, r22 2c55a: 5c 01 movw r10, r24 / (z_res * cs.axis_steps_per_mm[Z_AXIS]) 2c55c: be 01 movw r22, r28 2c55e: 90 e0 ldi r25, 0x00 ; 0 2c560: 80 e0 ldi r24, 0x00 ; 0 2c562: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 2c566: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 2c56a: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 2c56e: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 2c572: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 2c576: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 2c57a: 9b 01 movw r18, r22 2c57c: ac 01 movw r20, r24 2c57e: c5 01 movw r24, r10 2c580: b4 01 movw r22, r8 2c582: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> + UVLO_TINY_Z_AXIS_SHIFT; 2c586: 2a e0 ldi r18, 0x0A ; 10 2c588: 37 ed ldi r19, 0xD7 ; 215 2c58a: 43 e2 ldi r20, 0x23 ; 35 2c58c: 5e e3 ldi r21, 0x3E ; 62 2c58e: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__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) 2c592: 20 91 9a 06 lds r18, 0x069A ; 0x80069a 2c596: 30 91 9b 06 lds r19, 0x069B ; 0x80069b 2c59a: 40 91 9c 06 lds r20, 0x069C ; 0x80069c 2c59e: 50 91 9d 06 lds r21, 0x069D ; 0x80069d 2c5a2: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 2c5a6: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a 2c5aa: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b 2c5ae: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c 2c5b2: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d / (z_res * cs.axis_steps_per_mm[Z_AXIS]) + UVLO_TINY_Z_AXIS_SHIFT; plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS]/60); 2c5b6: 65 e5 ldi r22, 0x55 ; 85 2c5b8: 75 e5 ldi r23, 0x55 ; 85 2c5ba: 85 e5 ldi r24, 0x55 ; 85 2c5bc: 91 e4 ldi r25, 0x41 ; 65 2c5be: 0f 94 49 c0 call 0x38092 ; 0x38092 st_synchronize(); 2c5c2: 0f 94 e8 42 call 0x285d0 ; 0x285d0 if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 2c5c6: 40 91 9a 06 lds r20, 0x069A ; 0x80069a 2c5ca: 50 91 9b 06 lds r21, 0x069B ; 0x80069b 2c5ce: 60 91 9c 06 lds r22, 0x069C ; 0x80069c 2c5d2: 70 91 9d 06 lds r23, 0x069D ; 0x80069d 2c5d6: 8a ed ldi r24, 0xDA ; 218 2c5d8: 9e e0 ldi r25, 0x0E ; 14 2c5da: 0f 94 52 dc call 0x3b8a4 ; 0x3b8a4 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 2c5de: 62 e0 ldi r22, 0x02 ; 2 2c5e0: 85 ea ldi r24, 0xA5 ; 165 2c5e2: 9f e0 ldi r25, 0x0F ; 15 2c5e4: 0f 94 40 dc call 0x3b880 ; 0x3b880 // 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); 2c5e8: 84 e6 ldi r24, 0x64 ; 100 2c5ea: 9f e0 ldi r25, 0x0F ; 15 2c5ec: 0e 94 28 76 call 0xec50 ; 0xec50 eeprom_increment_word((uint16_t*)EEPROM_POWER_COUNT_TOT); 2c5f0: 8f ef ldi r24, 0xFF ; 255 2c5f2: 9e e0 ldi r25, 0x0E ; 14 2c5f4: 0e 94 1b 76 call 0xec36 ; 0xec36 printf_P(_N("UVLO_TINY - end %d\n"), _millis() - time_start); 2c5f8: 0f 94 4c 29 call 0x25298 ; 0x25298 2c5fc: dc 01 movw r26, r24 2c5fe: cb 01 movw r24, r22 2c600: 8c 19 sub r24, r12 2c602: 9d 09 sbc r25, r13 2c604: ae 09 sbc r26, r14 2c606: bf 09 sbc r27, r15 2c608: bf 93 push r27 2c60a: af 93 push r26 2c60c: 9f 93 push r25 2c60e: 8f 93 push r24 2c610: 8b ee ldi r24, 0xEB ; 235 2c612: 9d e6 ldi r25, 0x6D ; 109 2c614: 9f 93 push r25 2c616: 8f 93 push r24 2c618: 0f 94 de da call 0x3b5bc ; 0x3b5bc uvlo_drain_reset(); 2c61c: 0f 94 1c 5f call 0x2be38 ; 0x2be38 // 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(); } } 2c620: ff 91 pop r31 2c622: ef 91 pop r30 2c624: df 91 pop r29 2c626: cf 91 pop r28 2c628: bf 91 pop r27 2c62a: af 91 pop r26 2c62c: 9f 91 pop r25 2c62e: 8f 91 pop r24 2c630: 7f 91 pop r23 2c632: 6f 91 pop r22 2c634: 5f 91 pop r21 2c636: 4f 91 pop r20 2c638: 3f 91 pop r19 2c63a: 2f 91 pop r18 2c63c: 1f 91 pop r17 2c63e: 0f 91 pop r16 2c640: ff 90 pop r15 2c642: ef 90 pop r14 2c644: df 90 pop r13 2c646: cf 90 pop r12 2c648: bf 90 pop r11 2c64a: af 90 pop r10 2c64c: 9f 90 pop r9 2c64e: 8f 90 pop r8 2c650: 0f 90 pop r0 2c652: 0b be out 0x3b, r0 ; 59 2c654: 0f 90 pop r0 2c656: 0f be out 0x3f, r0 ; 63 2c658: 0f 90 pop r0 2c65a: 1f 90 pop r1 2c65c: 18 95 reti 0002c65e : } } uint16_t planner_calc_sd_length() { uint8_t _block_buffer_head = block_buffer_head; 2c65e: 60 91 a5 0d lds r22, 0x0DA5 ; 0x800da5 uint8_t _block_buffer_tail = block_buffer_tail; 2c662: 90 91 a6 0d lds r25, 0x0DA6 ; 0x800da6 uint16_t sdlen = 0; 2c666: 30 e0 ldi r19, 0x00 ; 0 2c668: 20 e0 ldi r18, 0x00 ; 0 while (_block_buffer_head != _block_buffer_tail) { sdlen += block_buffer[_block_buffer_tail].sdlen; 2c66a: 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) 2c66c: 96 17 cp r25, r22 2c66e: 61 f0 breq .+24 ; 0x2c688 { sdlen += block_buffer[_block_buffer_tail].sdlen; 2c670: 89 9f mul r24, r25 2c672: f0 01 movw r30, r0 2c674: 11 24 eor r1, r1 2c676: ef 5c subi r30, 0xCF ; 207 2c678: f8 4f sbci r31, 0xF8 ; 248 2c67a: 40 81 ld r20, Z 2c67c: 51 81 ldd r21, Z+1 ; 0x01 2c67e: 24 0f add r18, r20 2c680: 35 1f adc r19, r21 _block_buffer_tail = (_block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 2c682: 9f 5f subi r25, 0xFF ; 255 2c684: 9f 70 andi r25, 0x0F ; 15 2c686: f2 cf rjmp .-28 ; 0x2c66c } return sdlen; } 2c688: c9 01 movw r24, r18 2c68a: 08 95 ret 0002c68c : } #endif /* PLANNER_DIAGNOSTICS */ void planner_add_sd_length(uint16_t sdlen) { if (block_buffer_head != block_buffer_tail) { 2c68c: 30 91 a5 0d lds r19, 0x0DA5 ; 0x800da5 2c690: 20 91 a6 0d lds r18, 0x0DA6 ; 0x800da6 2c694: 32 17 cp r19, r18 2c696: 91 f0 breq .+36 ; 0x2c6bc // 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; 2c698: e0 91 a5 0d lds r30, 0x0DA5 ; 0x800da5 } // 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) 2c69c: e1 11 cpse r30, r1 2c69e: 01 c0 rjmp .+2 ; 0x2c6a2 block_index = BLOCK_BUFFER_SIZE; 2c6a0: e0 e1 ldi r30, 0x10 ; 16 -- block_index; 2c6a2: 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; 2c6a4: 2e e6 ldi r18, 0x6E ; 110 2c6a6: e2 9f mul r30, r18 2c6a8: f0 01 movw r30, r0 2c6aa: 11 24 eor r1, r1 2c6ac: ef 5c subi r30, 0xCF ; 207 2c6ae: f8 4f sbci r31, 0xF8 ; 248 2c6b0: 20 81 ld r18, Z 2c6b2: 31 81 ldd r19, Z+1 ; 0x01 2c6b4: 82 0f add r24, r18 2c6b6: 93 1f adc r25, r19 2c6b8: 91 83 std Z+1, r25 ; 0x01 2c6ba: 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. } } 2c6bc: 08 95 ret 0002c6be : } #endif //PREVENT_DANGEROUS_EXTRUDE // Calculate the steps/s^2 acceleration rates, based on the mm/s^s void reset_acceleration_rates() { 2c6be: 8f 92 push r8 2c6c0: 9f 92 push r9 2c6c2: af 92 push r10 2c6c4: bf 92 push r11 2c6c6: cf 92 push r12 2c6c8: df 92 push r13 2c6ca: ef 92 push r14 2c6cc: ff 92 push r15 2c6ce: 0f 93 push r16 2c6d0: 1f 93 push r17 2c6d2: cf 93 push r28 2c6d4: df 93 push r29 2c6d6: c0 91 6f 02 lds r28, 0x026F ; 0x80026f 2c6da: d0 91 70 02 lds r29, 0x0270 ; 0x800270 2c6de: 82 ec ldi r24, 0xC2 ; 194 2c6e0: e8 2e mov r14, r24 2c6e2: 8d e0 ldi r24, 0x0D ; 13 2c6e4: f8 2e mov r15, r24 2c6e6: 0e e4 ldi r16, 0x4E ; 78 2c6e8: 15 e0 ldi r17, 0x05 ; 5 2c6ea: 6e 01 movw r12, r28 2c6ec: 80 e1 ldi r24, 0x10 ; 16 2c6ee: c8 0e add r12, r24 2c6f0: 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]; 2c6f2: 69 91 ld r22, Y+ 2c6f4: 79 91 ld r23, Y+ 2c6f6: 89 91 ld r24, Y+ 2c6f8: 99 91 ld r25, Y+ 2c6fa: f7 01 movw r30, r14 2c6fc: 81 90 ld r8, Z+ 2c6fe: 91 90 ld r9, Z+ 2c700: a1 90 ld r10, Z+ 2c702: b1 90 ld r11, Z+ 2c704: 7f 01 movw r14, r30 2c706: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 2c70a: a5 01 movw r20, r10 2c70c: 94 01 movw r18, r8 2c70e: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 2c712: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 2c716: f8 01 movw r30, r16 2c718: 61 93 st Z+, r22 2c71a: 71 93 st Z+, r23 2c71c: 81 93 st Z+, r24 2c71e: 91 93 st Z+, r25 2c720: 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++) 2c722: cc 15 cp r28, r12 2c724: dd 05 cpc r29, r13 2c726: 29 f7 brne .-54 ; 0x2c6f2 max_acceleration_steps_per_s2[i] = max_acceleration_mm_per_s2[i] * cs.axis_steps_per_mm[i]; } 2c728: df 91 pop r29 2c72a: cf 91 pop r28 2c72c: 1f 91 pop r17 2c72e: 0f 91 pop r16 2c730: ff 90 pop r15 2c732: ef 90 pop r14 2c734: df 90 pop r13 2c736: cf 90 pop r12 2c738: bf 90 pop r11 2c73a: af 90 pop r10 2c73c: 9f 90 pop r9 2c73e: 8f 90 pop r8 2c740: 08 95 ret 0002c742 : #ifdef TMC2130 void update_mode_profile() { if (tmc2130_mode == TMC2130_MODE_NORMAL) 2c742: 80 91 8c 06 lds r24, 0x068C ; 0x80068c 2c746: 81 11 cpse r24, r1 2c748: 0e c0 rjmp .+28 ; 0x2c766 { max_feedrate = cs.max_feedrate_normal; 2c74a: 82 ed ldi r24, 0xD2 ; 210 2c74c: 9d e0 ldi r25, 0x0D ; 13 2c74e: 90 93 72 02 sts 0x0272, r25 ; 0x800272 2c752: 80 93 71 02 sts 0x0271, r24 ; 0x800271 max_acceleration_mm_per_s2 = cs.max_acceleration_mm_per_s2_normal; 2c756: 82 ee ldi r24, 0xE2 ; 226 2c758: 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; 2c75a: 90 93 70 02 sts 0x0270, r25 ; 0x800270 2c75e: 80 93 6f 02 sts 0x026F, r24 ; 0x80026f } reset_acceleration_rates(); 2c762: 0d 94 5f 63 jmp 0x2c6be ; 0x2c6be 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) 2c766: 81 30 cpi r24, 0x01 ; 1 2c768: e1 f7 brne .-8 ; 0x2c762 { max_feedrate = cs.max_feedrate_silent; 2c76a: 8a e5 ldi r24, 0x5A ; 90 2c76c: 9e e0 ldi r25, 0x0E ; 14 2c76e: 90 93 72 02 sts 0x0272, r25 ; 0x800272 2c772: 80 93 71 02 sts 0x0271, r24 ; 0x800271 max_acceleration_mm_per_s2 = cs.max_acceleration_mm_per_s2_silent; 2c776: 8a e6 ldi r24, 0x6A ; 106 2c778: 9e e0 ldi r25, 0x0E ; 14 2c77a: ef cf rjmp .-34 ; 0x2c75a 0002c77c : } void plan_set_e_position(const float &e) { #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 2c77c: fc 01 movw r30, r24 2c77e: 40 81 ld r20, Z 2c780: 51 81 ldd r21, Z+1 ; 0x01 2c782: 62 81 ldd r22, Z+2 ; 0x02 2c784: 73 81 ldd r23, Z+3 ; 0x03 2c786: 40 93 d9 04 sts 0x04D9, r20 ; 0x8004d9 2c78a: 50 93 da 04 sts 0x04DA, r21 ; 0x8004da 2c78e: 60 93 db 04 sts 0x04DB, r22 ; 0x8004db 2c792: 70 93 dc 04 sts 0x04DC, r23 ; 0x8004dc #endif position[E_AXIS] = lround(e*cs.axis_steps_per_mm[E_AXIS]); 2c796: 20 91 ce 0d lds r18, 0x0DCE ; 0x800dce 2c79a: 30 91 cf 0d lds r19, 0x0DCF ; 0x800dcf 2c79e: 40 91 d0 0d lds r20, 0x0DD0 ; 0x800dd0 2c7a2: 50 91 d1 0d lds r21, 0x0DD1 ; 0x800dd1 2c7a6: 60 81 ld r22, Z 2c7a8: 71 81 ldd r23, Z+1 ; 0x01 2c7aa: 82 81 ldd r24, Z+2 ; 0x02 2c7ac: 93 81 ldd r25, Z+3 ; 0x03 2c7ae: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 2c7b2: 0f 94 81 e0 call 0x3c102 ; 0x3c102 2c7b6: e3 ea ldi r30, 0xA3 ; 163 2c7b8: f6 e0 ldi r31, 0x06 ; 6 2c7ba: 64 87 std Z+12, r22 ; 0x0c 2c7bc: 75 87 std Z+13, r23 ; 0x0d 2c7be: 86 87 std Z+14, r24 ; 0x0e 2c7c0: 97 87 std Z+15, r25 ; 0x0f CRITICAL_SECTION_END; } void st_set_e_position(const long &e) { CRITICAL_SECTION_START; 2c7c2: 8f b7 in r24, 0x3f ; 63 2c7c4: f8 94 cli count_position[E_AXIS] = e; 2c7c6: 44 85 ldd r20, Z+12 ; 0x0c 2c7c8: 55 85 ldd r21, Z+13 ; 0x0d 2c7ca: 66 85 ldd r22, Z+14 ; 0x0e 2c7cc: 77 85 ldd r23, Z+15 ; 0x0f 2c7ce: 40 93 bf 06 sts 0x06BF, r20 ; 0x8006bf 2c7d2: 50 93 c0 06 sts 0x06C0, r21 ; 0x8006c0 2c7d6: 60 93 c1 06 sts 0x06C1, r22 ; 0x8006c1 2c7da: 70 93 c2 06 sts 0x06C2, r23 ; 0x8006c2 CRITICAL_SECTION_END; 2c7de: 8f bf out 0x3f, r24 ; 63 st_set_e_position(position[E_AXIS]); } 2c7e0: 08 95 ret 0002c7e2 : // 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; 2c7e2: fc 01 movw r30, r24 2c7e4: 40 81 ld r20, Z 2c7e6: 51 81 ldd r21, Z+1 ; 0x01 2c7e8: 62 81 ldd r22, Z+2 ; 0x02 2c7ea: 73 81 ldd r23, Z+3 ; 0x03 2c7ec: 40 93 d5 04 sts 0x04D5, r20 ; 0x8004d5 2c7f0: 50 93 d6 04 sts 0x04D6, r21 ; 0x8004d6 2c7f4: 60 93 d7 04 sts 0x04D7, r22 ; 0x8004d7 2c7f8: 70 93 d8 04 sts 0x04D8, r23 ; 0x8004d8 #endif position[Z_AXIS] = lround(z*cs.axis_steps_per_mm[Z_AXIS]); 2c7fc: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 2c800: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 2c804: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 2c808: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 2c80c: 60 81 ld r22, Z 2c80e: 71 81 ldd r23, Z+1 ; 0x01 2c810: 82 81 ldd r24, Z+2 ; 0x02 2c812: 93 81 ldd r25, Z+3 ; 0x03 2c814: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 2c818: 0f 94 81 e0 call 0x3c102 ; 0x3c102 2c81c: 60 93 ab 06 sts 0x06AB, r22 ; 0x8006ab 2c820: 70 93 ac 06 sts 0x06AC, r23 ; 0x8006ac 2c824: 80 93 ad 06 sts 0x06AD, r24 ; 0x8006ad 2c828: 90 93 ae 06 sts 0x06AE, r25 ; 0x8006ae st_set_position(position); 2c82c: 0d 94 eb 87 jmp 0x30fd6 ; 0x30fd6 0002c830 : * 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) { 2c830: 2f 92 push r2 2c832: 3f 92 push r3 2c834: 4f 92 push r4 2c836: 5f 92 push r5 2c838: 6f 92 push r6 2c83a: 7f 92 push r7 2c83c: 8f 92 push r8 2c83e: 9f 92 push r9 2c840: af 92 push r10 2c842: bf 92 push r11 2c844: cf 92 push r12 2c846: df 92 push r13 2c848: ef 92 push r14 2c84a: ff 92 push r15 2c84c: 0f 93 push r16 2c84e: 1f 93 push r17 2c850: cf 93 push r28 2c852: df 93 push r29 2c854: cd b7 in r28, 0x3d ; 61 2c856: de b7 in r29, 0x3e ; 62 2c858: c2 54 subi r28, 0x42 ; 66 2c85a: d1 09 sbc r29, r1 2c85c: 0f b6 in r0, 0x3f ; 63 2c85e: f8 94 cli 2c860: de bf out 0x3e, r29 ; 62 2c862: 0f be out 0x3f, r0 ; 63 2c864: cd bf out 0x3d, r28 ; 61 2c866: 4c 01 movw r8, r24 2c868: 5b 01 movw r10, r22 2c86a: 6a 01 movw r12, r20 2c86c: 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) {} 2c86e: 19 82 std Y+1, r1 ; 0x01 2c870: 1c 82 std Y+4, r1 ; 0x04 2c872: 1c 8e std Y+28, r1 ; 0x1c 2c874: 1f 8e std Y+31, r1 ; 0x1f uint8_t dname[11]; SdBaseFile dir1, dir2; SdBaseFile *parent = dirFile; SdBaseFile *sub = &dir1; if (!dirFile) goto fail; 2c876: 67 2b or r22, r23 2c878: 21 f5 brne .+72 ; 0x2c8c2 sub = parent != &dir1 ? &dir1 : &dir2; } return open(parent, dname, oflag); fail: return false; 2c87a: 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; 2c87c: ce 01 movw r24, r28 2c87e: 4c 96 adiw r24, 0x1c ; 28 2c880: 0e 94 31 77 call 0xee62 ; 0xee62 2c884: ce 01 movw r24, r28 2c886: 01 96 adiw r24, 0x01 ; 1 2c888: 0e 94 31 77 call 0xee62 ; 0xee62 } return open(parent, dname, oflag); fail: return false; } 2c88c: 81 2f mov r24, r17 2c88e: ce 5b subi r28, 0xBE ; 190 2c890: df 4f sbci r29, 0xFF ; 255 2c892: 0f b6 in r0, 0x3f ; 63 2c894: f8 94 cli 2c896: de bf out 0x3e, r29 ; 62 2c898: 0f be out 0x3f, r0 ; 63 2c89a: cd bf out 0x3d, r28 ; 61 2c89c: df 91 pop r29 2c89e: cf 91 pop r28 2c8a0: 1f 91 pop r17 2c8a2: 0f 91 pop r16 2c8a4: ff 90 pop r15 2c8a6: ef 90 pop r14 2c8a8: df 90 pop r13 2c8aa: cf 90 pop r12 2c8ac: bf 90 pop r11 2c8ae: af 90 pop r10 2c8b0: 9f 90 pop r9 2c8b2: 8f 90 pop r8 2c8b4: 7f 90 pop r7 2c8b6: 6f 90 pop r6 2c8b8: 5f 90 pop r5 2c8ba: 4f 90 pop r4 2c8bc: 3f 90 pop r3 2c8be: 2f 90 pop r2 2c8c0: 08 95 ret SdBaseFile *sub = &dir1; if (!dirFile) goto fail; // error if already open if (isOpen()) goto fail; 2c8c2: fc 01 movw r30, r24 2c8c4: 83 81 ldd r24, Z+3 ; 0x03 2c8c6: 81 11 cpse r24, r1 2c8c8: d8 cf rjmp .-80 ; 0x2c87a if (*path == '/') { 2c8ca: fa 01 movw r30, r20 2c8cc: 80 81 ld r24, Z 2c8ce: 8f 32 cpi r24, 0x2F ; 47 2c8d0: c1 f4 brne .+48 ; 0x2c902 2c8d2: ca 01 movw r24, r20 2c8d4: 6c 01 movw r12, r24 2c8d6: 01 96 adiw r24, 0x01 ; 1 while (*path == '/') path++; 2c8d8: f6 01 movw r30, r12 2c8da: 20 81 ld r18, Z 2c8dc: 2f 32 cpi r18, 0x2F ; 47 2c8de: d1 f3 breq .-12 ; 0x2c8d4 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; 2c8e0: f5 01 movw r30, r10 2c8e2: 83 81 ldd r24, Z+3 ; 0x03 2c8e4: 82 50 subi r24, 0x02 ; 2 if (!dirFile->isRoot()) { 2c8e6: 82 30 cpi r24, 0x02 ; 2 2c8e8: 60 f0 brcs .+24 ; 0x2c902 if (!dir2.openRoot(dirFile->vol_)) goto fail; 2c8ea: 61 8d ldd r22, Z+25 ; 0x19 2c8ec: 72 8d ldd r23, Z+26 ; 0x1a 2c8ee: ce 01 movw r24, r28 2c8f0: 4c 96 adiw r24, 0x1c ; 28 2c8f2: 0f 94 c9 55 call 0x2ab92 ; 0x2ab92 parent = &dir2; 2c8f6: 8e 01 movw r16, r28 2c8f8: 04 5e subi r16, 0xE4 ; 228 2c8fa: 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; 2c8fc: 81 11 cpse r24, r1 2c8fe: 02 c0 rjmp .+4 ; 0x2c904 2c900: bc cf rjmp .-136 ; 0x2c87a // error if already open if (isOpen()) goto fail; if (*path == '/') { while (*path == '/') path++; if (!dirFile->isRoot()) { 2c902: 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; 2c904: ce 01 movw r24, r28 2c906: 01 96 adiw r24, 0x01 ; 1 2c908: 7c 01 movw r14, r24 2c90a: 3c 01 movw r6, r24 2c90c: 2e 01 movw r4, r28 2c90e: 9c e1 ldi r25, 0x1C ; 28 2c910: 49 0e add r4, r25 2c912: 51 1c adc r5, r1 2c914: 23 96 adiw r28, 0x03 ; 3 2c916: ef ae std Y+63, r14 ; 0x3f 2c918: 23 97 sbiw r28, 0x03 ; 3 2c91a: 2f 2c mov r2, r15 2c91c: fe 01 movw r30, r28 2c91e: f7 96 adiw r30, 0x37 ; 55 2c920: cf 01 movw r24, r30 2c922: 0b 96 adiw r24, 0x0b ; 11 2c924: 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++] = ' '; 2c926: 20 e2 ldi r18, 0x20 ; 32 2c928: 21 93 st Z+, r18 2c92a: e8 17 cp r30, r24 2c92c: f9 07 cpc r31, r25 2c92e: d9 f7 brne .-10 ; 0x2c926 2c930: 96 01 movw r18, r12 i = 0; 2c932: 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 2c934: 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 != '/') { 2c936: d9 01 movw r26, r18 2c938: 8d 91 ld r24, X+ 2c93a: 88 23 and r24, r24 2c93c: 49 f1 breq .+82 ; 0x2c990 2c93e: 8f 32 cpi r24, 0x2F ; 47 2c940: 39 f1 breq .+78 ; 0x2c990 c = *str++; 2c942: 28 2f mov r18, r24 if (c == '.') { 2c944: 8e 32 cpi r24, 0x2E ; 46 2c946: 39 f4 brne .+14 ; 0x2c956 if (n == 10) goto fail; // only one dot allowed 2c948: 6a 30 cpi r22, 0x0A ; 10 2c94a: 09 f4 brne .+2 ; 0x2c94e 2c94c: 96 cf rjmp .-212 ; 0x2c87a n = 10; // max index for full 8.3 name i = 8; // place for extension 2c94e: 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 2c950: 6a e0 ldi r22, 0x0A ; 10 2c952: 9d 01 movw r18, r26 2c954: f0 cf rjmp .-32 ; 0x2c936 2c956: ed e4 ldi r30, 0x4D ; 77 2c958: 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; 2c95a: 34 91 lpm r19, Z 2c95c: 33 23 and r19, r19 2c95e: 21 f0 breq .+8 ; 0x2c968 2c960: 31 96 adiw r30, 0x01 ; 1 2c962: 83 13 cpse r24, r19 2c964: fa cf rjmp .-12 ; 0x2c95a 2c966: 89 cf rjmp .-238 ; 0x2c87a // check size and only allow ASCII printable characters if (i > n || c < 0X21 || c > 0X7E)goto fail; 2c968: 69 17 cp r22, r25 2c96a: 08 f4 brcc .+2 ; 0x2c96e 2c96c: 86 cf rjmp .-244 ; 0x2c87a 2c96e: 3f ed ldi r19, 0xDF ; 223 2c970: 38 0f add r19, r24 2c972: 3e 35 cpi r19, 0x5E ; 94 2c974: 08 f0 brcs .+2 ; 0x2c978 2c976: 81 cf rjmp .-254 ; 0x2c87a // only upper case allowed in 8.3 names - convert lower to upper name[i++] = (c < 'a' || c > 'z') ? (c) : (c + ('A' - 'a')); 2c978: 3f e9 ldi r19, 0x9F ; 159 2c97a: 38 0f add r19, r24 2c97c: 3a 31 cpi r19, 0x1A ; 26 2c97e: 10 f4 brcc .+4 ; 0x2c984 2c980: 20 ee ldi r18, 0xE0 ; 224 2c982: 28 0f add r18, r24 2c984: fa 01 movw r30, r20 2c986: e9 0f add r30, r25 2c988: f1 1d adc r31, r1 2c98a: 20 83 st Z, r18 2c98c: 9f 5f subi r25, 0xFF ; 255 2c98e: e1 cf rjmp .-62 ; 0x2c952 if (!dir2.openRoot(dirFile->vol_)) goto fail; parent = &dir2; } } while (1) { if (!make83Name(path, dname, &path)) goto fail; 2c990: 8f a9 ldd r24, Y+55 ; 0x37 2c992: 80 32 cpi r24, 0x20 ; 32 2c994: 09 f4 brne .+2 ; 0x2c998 2c996: 71 cf rjmp .-286 ; 0x2c87a 2c998: 69 01 movw r12, r18 while (*path == '/') path++; 2c99a: f9 01 movw r30, r18 2c99c: 80 81 ld r24, Z 2c99e: 2f 5f subi r18, 0xFF ; 255 2c9a0: 3f 4f sbci r19, 0xFF ; 255 2c9a2: 8f 32 cpi r24, 0x2F ; 47 2c9a4: c9 f3 breq .-14 ; 0x2c998 if (!*path) break; 2c9a6: 88 23 and r24, r24 2c9a8: d9 f0 breq .+54 ; 0x2c9e0 if (!sub->open(parent, dname, O_READ)) goto fail; 2c9aa: 21 e0 ldi r18, 0x01 ; 1 2c9ac: b8 01 movw r22, r16 2c9ae: c7 01 movw r24, r14 2c9b0: 0f 94 37 5a call 0x2b46e ; 0x2b46e 2c9b4: 88 23 and r24, r24 2c9b6: 09 f4 brne .+2 ; 0x2c9ba 2c9b8: 60 cf rjmp .-320 ; 0x2c87a if (parent != dirFile) parent->close(); 2c9ba: 0a 15 cp r16, r10 2c9bc: 1b 05 cpc r17, r11 2c9be: 19 f0 breq .+6 ; 0x2c9c6 2c9c0: c8 01 movw r24, r16 2c9c2: 0f 94 70 58 call 0x2b0e0 ; 0x2b0e0 parent = sub; sub = parent != &dir1 ? &dir1 : &dir2; 2c9c6: 94 2d mov r25, r4 2c9c8: 85 2d mov r24, r5 2c9ca: 6e 14 cp r6, r14 2c9cc: 7f 04 cpc r7, r15 2c9ce: 21 f0 breq .+8 ; 0x2c9d8 2c9d0: 23 96 adiw r28, 0x03 ; 3 2c9d2: 9f ad ldd r25, Y+63 ; 0x3f 2c9d4: 23 97 sbiw r28, 0x03 ; 3 2c9d6: 82 2d mov r24, r2 2c9d8: 87 01 movw r16, r14 2c9da: e9 2e mov r14, r25 2c9dc: f8 2e mov r15, r24 2c9de: 9e cf rjmp .-196 ; 0x2c91c } return open(parent, dname, oflag); 2c9e0: 23 2d mov r18, r3 2c9e2: b8 01 movw r22, r16 2c9e4: c4 01 movw r24, r8 2c9e6: 0f 94 37 5a call 0x2b46e ; 0x2b46e 2c9ea: 18 2f mov r17, r24 2c9ec: 47 cf rjmp .-370 ; 0x2c87c 0002c9ee : 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){ 2c9ee: 2f 92 push r2 2c9f0: 3f 92 push r3 2c9f2: 4f 92 push r4 2c9f4: 5f 92 push r5 2c9f6: 6f 92 push r6 2c9f8: 7f 92 push r7 2c9fa: 8f 92 push r8 2c9fc: 9f 92 push r9 2c9fe: af 92 push r10 2ca00: bf 92 push r11 2ca02: cf 92 push r12 2ca04: df 92 push r13 2ca06: ef 92 push r14 2ca08: ff 92 push r15 2ca0a: 0f 93 push r16 2ca0c: 1f 93 push r17 2ca0e: cf 93 push r28 2ca10: df 93 push r29 2ca12: 00 d0 rcall .+0 ; 0x2ca14 2ca14: 1f 92 push r1 2ca16: 1f 92 push r1 2ca18: cd b7 in r28, 0x3d ; 61 2ca1a: de b7 in r29, 0x3e ; 62 2ca1c: 1c 01 movw r2, r24 2ca1e: 2a 01 movw r4, r20 2ca20: 3b 01 movw r6, r22 2ca22: 00 e2 ldi r16, 0x20 ; 32 2ca24: 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){ 2ca26: 19 82 std Y+1, r1 ; 0x01 2ca28: 99 81 ldd r25, Y+1 ; 0x01 2ca2a: 89 2f mov r24, r25 2ca2c: 90 e0 ldi r25, 0x00 ; 0 2ca2e: 9b 83 std Y+3, r25 ; 0x03 2ca30: 8a 83 std Y+2, r24 ; 0x02 2ca32: 80 17 cp r24, r16 2ca34: 91 07 cpc r25, r17 2ca36: 9c f5 brge .+102 ; 0x2ca9e if (points[j] > points[j + 1]) 2ca38: 88 0f add r24, r24 2ca3a: 99 1f adc r25, r25 2ca3c: 88 0f add r24, r24 2ca3e: 99 1f adc r25, r25 2ca40: 9d 83 std Y+5, r25 ; 0x05 2ca42: 8c 83 std Y+4, r24 ; 0x04 2ca44: 82 0d add r24, r2 2ca46: 93 1d adc r25, r3 2ca48: 9b 83 std Y+3, r25 ; 0x03 2ca4a: 8a 83 std Y+2, r24 ; 0x02 2ca4c: fc 01 movw r30, r24 2ca4e: c0 80 ld r12, Z 2ca50: d1 80 ldd r13, Z+1 ; 0x01 2ca52: e2 80 ldd r14, Z+2 ; 0x02 2ca54: f3 80 ldd r15, Z+3 ; 0x03 2ca56: 8c 81 ldd r24, Y+4 ; 0x04 2ca58: 9d 81 ldd r25, Y+5 ; 0x05 2ca5a: 04 96 adiw r24, 0x04 ; 4 2ca5c: 82 0d add r24, r2 2ca5e: 93 1d adc r25, r3 2ca60: 9d 83 std Y+5, r25 ; 0x05 2ca62: 8c 83 std Y+4, r24 ; 0x04 2ca64: fc 01 movw r30, r24 2ca66: 80 80 ld r8, Z 2ca68: 91 80 ldd r9, Z+1 ; 0x01 2ca6a: a2 80 ldd r10, Z+2 ; 0x02 2ca6c: b3 80 ldd r11, Z+3 ; 0x03 2ca6e: a5 01 movw r20, r10 2ca70: 94 01 movw r18, r8 2ca72: c7 01 movw r24, r14 2ca74: b6 01 movw r22, r12 2ca76: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 2ca7a: 18 16 cp r1, r24 2ca7c: 64 f4 brge .+24 ; 0x2ca96 SWAP(points[j], points[j + 1]); 2ca7e: ea 81 ldd r30, Y+2 ; 0x02 2ca80: fb 81 ldd r31, Y+3 ; 0x03 2ca82: 80 82 st Z, r8 2ca84: 91 82 std Z+1, r9 ; 0x01 2ca86: a2 82 std Z+2, r10 ; 0x02 2ca88: b3 82 std Z+3, r11 ; 0x03 2ca8a: ec 81 ldd r30, Y+4 ; 0x04 2ca8c: fd 81 ldd r31, Y+5 ; 0x05 2ca8e: c0 82 st Z, r12 2ca90: d1 82 std Z+1, r13 ; 0x01 2ca92: e2 82 std Z+2, r14 ; 0x02 2ca94: 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){ 2ca96: f9 81 ldd r31, Y+1 ; 0x01 2ca98: ff 5f subi r31, 0xFF ; 255 2ca9a: f9 83 std Y+1, r31 ; 0x01 2ca9c: c5 cf rjmp .-118 ; 0x2ca28 2ca9e: 01 50 subi r16, 0x01 ; 1 2caa0: 11 09 sbc r17, r1 2caa2: 08 f6 brcc .-126 ; 0x2ca26 /// 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]; 2caa4: f1 01 movw r30, r2 2caa6: e0 5c subi r30, 0xC0 ; 192 2caa8: 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); 2caaa: 20 81 ld r18, Z 2caac: 31 81 ldd r19, Z+1 ; 0x01 2caae: 42 81 ldd r20, Z+2 ; 0x02 2cab0: 53 81 ldd r21, Z+3 ; 0x03 2cab2: c3 01 movw r24, r6 2cab4: b2 01 movw r22, r4 2cab6: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 2caba: 6b 01 movw r12, r22 2cabc: 7c 01 movw r14, r24 2cabe: 20 e0 ldi r18, 0x00 ; 0 2cac0: 30 e0 ldi r19, 0x00 ; 0 2cac2: 40 e0 ldi r20, 0x00 ; 0 2cac4: 5f eb ldi r21, 0xBF ; 191 2cac6: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 2caca: 87 fd sbrc r24, 7 2cacc: 10 c0 rjmp .+32 ; 0x2caee 2cace: 20 e0 ldi r18, 0x00 ; 0 2cad0: 30 e0 ldi r19, 0x00 ; 0 2cad2: 40 e0 ldi r20, 0x00 ; 0 2cad4: 5f e3 ldi r21, 0x3F ; 63 2cad6: c7 01 movw r24, r14 2cad8: b6 01 movw r22, r12 2cada: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 2cade: 18 16 cp r1, r24 2cae0: 5c f4 brge .+22 ; 0x2caf8 2cae2: c1 2c mov r12, r1 2cae4: d1 2c mov r13, r1 2cae6: e1 2c mov r14, r1 2cae8: 8f e3 ldi r24, 0x3F ; 63 2caea: f8 2e mov r15, r24 2caec: 05 c0 rjmp .+10 ; 0x2caf8 2caee: c1 2c mov r12, r1 2caf0: d1 2c mov r13, r1 2caf2: e1 2c mov r14, r1 2caf4: 9f eb ldi r25, 0xBF ; 191 2caf6: f9 2e mov r15, r25 } 2caf8: c7 01 movw r24, r14 2cafa: b6 01 movw r22, r12 2cafc: 0f 90 pop r0 2cafe: 0f 90 pop r0 2cb00: 0f 90 pop r0 2cb02: 0f 90 pop r0 2cb04: 0f 90 pop r0 2cb06: df 91 pop r29 2cb08: cf 91 pop r28 2cb0a: 1f 91 pop r17 2cb0c: 0f 91 pop r16 2cb0e: ff 90 pop r15 2cb10: ef 90 pop r14 2cb12: df 90 pop r13 2cb14: cf 90 pop r12 2cb16: bf 90 pop r11 2cb18: af 90 pop r10 2cb1a: 9f 90 pop r9 2cb1c: 8f 90 pop r8 2cb1e: 7f 90 pop r7 2cb20: 6f 90 pop r6 2cb22: 5f 90 pop r5 2cb24: 4f 90 pop r4 2cb26: 3f 90 pop r3 2cb28: 2f 90 pop r2 2cb2a: 08 95 ret 0002cb2c : bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); } void ProtocolLogic::RecordUARTActivity() { lastUARTActivityMs = _millis(); 2cb2c: 0f 94 4c 29 call 0x25298 ; 0x25298 2cb30: 60 93 5a 13 sts 0x135A, r22 ; 0x80135a 2cb34: 70 93 5b 13 sts 0x135B, r23 ; 0x80135b 2cb38: 80 93 5c 13 sts 0x135C, r24 ; 0x80135c 2cb3c: 90 93 5d 13 sts 0x135D, r25 ; 0x80135d } 2cb40: 08 95 ret 0002cb42 : } return (uint8_t)ReqMsg().code; } void ProtocolLogic::DecrementRetryAttempts() { if (inAutoRetry && retryAttempts) { 2cb42: 80 91 a0 13 lds r24, 0x13A0 ; 0x8013a0 2cb46: 88 23 and r24, r24 2cb48: 69 f0 breq .+26 ; 0x2cb64 2cb4a: 80 91 9f 13 lds r24, 0x139F ; 0x80139f 2cb4e: 88 23 and r24, r24 2cb50: 49 f0 breq .+18 ; 0x2cb64 SERIAL_ECHOLNPGM("DecrementRetryAttempts"); 2cb52: 89 e4 ldi r24, 0x49 ; 73 2cb54: 9b ea ldi r25, 0xAB ; 171 2cb56: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 retryAttempts--; 2cb5a: 80 91 9f 13 lds r24, 0x139F ; 0x80139f 2cb5e: 81 50 subi r24, 0x01 ; 1 2cb60: 80 93 9f 13 sts 0x139F, r24 ; 0x80139f } } 2cb64: 08 95 ret 0002cb66 : MMU2_ECHO_MSGLN(tmp); } strncpy(lastMsg, tmp, rqs); } void ProtocolLogic::LogError(const char *reason_P) { 2cb66: 9f 92 push r9 2cb68: af 92 push r10 2cb6a: bf 92 push r11 2cb6c: cf 92 push r12 2cb6e: df 92 push r13 2cb70: ef 92 push r14 2cb72: ff 92 push r15 2cb74: 0f 93 push r16 2cb76: 1f 93 push r17 2cb78: cf 93 push r28 2cb7a: df 93 push r29 2cb7c: cd b7 in r28, 0x3d ; 61 2cb7e: de b7 in r29, 0x3e ; 62 2cb80: e0 97 sbiw r28, 0x30 ; 48 2cb82: 0f b6 in r0, 0x3f ; 63 2cb84: f8 94 cli 2cb86: de bf out 0x3e, r29 ; 62 2cb88: 0f be out 0x3f, r0 ; 63 2cb8a: cd bf out 0x3d, r28 ; 61 2cb8c: 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()]; 2cb8e: e0 90 88 13 lds r14, 0x1388 ; 0x801388 2cb92: fe 01 movw r30, r28 2cb94: 31 96 adiw r30, 0x01 ; 1 2cb96: 21 e0 ldi r18, 0x01 ; 1 2cb98: 30 e0 ldi r19, 0x00 ; 0 2cb9a: 5f 01 movw r10, r30 2cb9c: f1 2c mov r15, r1 2cb9e: 40 e1 ldi r20, 0x10 ; 16 2cba0: c4 2e mov r12, r20 2cba2: d1 2c mov r13, r1 dst[i * 3] = NibbleToChar(b >> 4); dst[i * 3 + 1] = NibbleToChar(b & 0xf); dst[i * 3 + 2] = ' '; 2cba4: 50 e2 ldi r21, 0x20 ; 32 2cba6: 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()]; 2cba8: c7 01 movw r24, r14 2cbaa: 82 1b sub r24, r18 2cbac: 93 0b sbc r25, r19 2cbae: b6 01 movw r22, r12 2cbb0: 0f 94 f9 dc call 0x3b9f2 ; 0x3b9f2 <__divmodhi4> 2cbb4: dc 01 movw r26, r24 2cbb6: bb 27 eor r27, r27 2cbb8: a5 5b subi r26, 0xB5 ; 181 2cbba: bc 4e sbci r27, 0xEC ; 236 2cbbc: 9d 96 adiw r26, 0x2d ; 45 2cbbe: 8c 91 ld r24, X dst[i * 3] = NibbleToChar(b >> 4); 2cbc0: 48 2f mov r20, r24 2cbc2: 50 e0 ldi r21, 0x00 ; 0 2cbc4: 94 e0 ldi r25, 0x04 ; 4 2cbc6: 55 95 asr r21 2cbc8: 47 95 ror r20 2cbca: 9a 95 dec r25 2cbcc: e1 f7 brne .-8 ; 0x2cbc6 lastReceivedBytes[lrb] = c; lrb = (lrb + 1) % lastReceivedBytes.size(); } constexpr char NibbleToChar(uint8_t c) { switch (c) { 2cbce: 96 ef ldi r25, 0xF6 ; 246 2cbd0: 94 0f add r25, r20 2cbd2: 96 30 cpi r25, 0x06 ; 6 2cbd4: a8 f1 brcs .+106 ; 0x2cc40 case 5: case 6: case 7: case 8: case 9: return c + '0'; 2cbd6: 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); 2cbd8: 40 83 st Z, r20 dst[i * 3 + 1] = NibbleToChar(b & 0xf); 2cbda: 8f 70 andi r24, 0x0F ; 15 lastReceivedBytes[lrb] = c; lrb = (lrb + 1) % lastReceivedBytes.size(); } constexpr char NibbleToChar(uint8_t c) { switch (c) { 2cbdc: 96 ef ldi r25, 0xF6 ; 246 2cbde: 98 0f add r25, r24 2cbe0: 96 30 cpi r25, 0x06 ; 6 2cbe2: 80 f1 brcs .+96 ; 0x2cc44 case 5: case 6: case 7: case 8: case 9: return c + '0'; 2cbe4: 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); 2cbe6: 81 83 std Z+1, r24 ; 0x01 dst[i * 3 + 2] = ' '; 2cbe8: 92 82 std Z+2, r9 ; 0x02 2cbea: 2f 5f subi r18, 0xFF ; 255 2cbec: 3f 4f sbci r19, 0xFF ; 255 2cbee: 33 96 adiw r30, 0x03 ; 3 return 0; } } void ProtocolLogic::FormatLastReceivedBytes(char *dst) { for (uint8_t i = 0; i < lastReceivedBytes.size(); ++i) { 2cbf0: 21 31 cpi r18, 0x11 ; 17 2cbf2: 31 05 cpc r19, r1 2cbf4: c9 f6 brne .-78 ; 0x2cba8 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 2cbf6: 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); 2cbf8: 82 ec ldi r24, 0xC2 ; 194 2cbfa: 9b ea ldi r25, 0xAB ; 171 2cbfc: 0e 94 50 77 call 0xeea0 ; 0xeea0 2cc00: 8c eb ldi r24, 0xBC ; 188 2cc02: 9b ea ldi r25, 0xAB ; 171 2cc04: 0e 94 50 77 call 0xeea0 ; 0xeea0 2cc08: c8 01 movw r24, r16 2cc0a: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHOPGM(", last bytes: "); 2cc0e: 84 e7 ldi r24, 0x74 ; 116 2cc10: 9b ea ldi r25, 0xAB ; 171 2cc12: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHOLN(lrb); 2cc16: c5 01 movw r24, r10 2cc18: 0f 94 00 d6 call 0x3ac00 ; 0x3ac00 } 2cc1c: e0 96 adiw r28, 0x30 ; 48 2cc1e: 0f b6 in r0, 0x3f ; 63 2cc20: f8 94 cli 2cc22: de bf out 0x3e, r29 ; 62 2cc24: 0f be out 0x3f, r0 ; 63 2cc26: cd bf out 0x3d, r28 ; 61 2cc28: df 91 pop r29 2cc2a: cf 91 pop r28 2cc2c: 1f 91 pop r17 2cc2e: 0f 91 pop r16 2cc30: ff 90 pop r15 2cc32: ef 90 pop r14 2cc34: df 90 pop r13 2cc36: cf 90 pop r12 2cc38: bf 90 pop r11 2cc3a: af 90 pop r10 2cc3c: 9f 90 pop r9 2cc3e: 08 95 ret case 11: case 12: case 13: case 14: case 15: return (c - 10) + 'a'; 2cc40: 49 5a subi r20, 0xA9 ; 169 2cc42: ca cf rjmp .-108 ; 0x2cbd8 2cc44: 89 5a subi r24, 0xA9 ; 169 2cc46: cf cf rjmp .-98 ; 0x2cbe6 0002cc48 : char lrb[lastReceivedBytes.size()]; FormatLastResponseMsgAndClearLRB(lrb); MMU2_ECHO_MSGLN(lrb); } StepStatus ProtocolLogic::SuppressShortDropOuts(const char *msg_P, StepStatus ss) { 2cc48: 9c 01 movw r18, r24 SERIAL_ECHOLNPGM("RSTCommTimeout"); dataTO.Reset(); } bool DropOutFilter::Record(StepStatus ss) { if (occurrences == maxOccurrences) { 2cc4a: 90 91 5f 13 lds r25, 0x135F ; 0x80135f 2cc4e: 9a 30 cpi r25, 0x0A ; 10 2cc50: 11 f4 brne .+4 ; 0x2cc56 cause = ss; 2cc52: 60 93 5e 13 sts 0x135E, r22 ; 0x80135e } --occurrences; 2cc56: 91 50 subi r25, 0x01 ; 1 2cc58: 90 93 5f 13 sts 0x135F, r25 ; 0x80135f FormatLastResponseMsgAndClearLRB(lrb); MMU2_ECHO_MSGLN(lrb); } StepStatus ProtocolLogic::SuppressShortDropOuts(const char *msg_P, StepStatus ss) { if (dataTO.Record(ss)) { 2cc5c: 91 11 cpse r25, r1 2cc5e: 0d c0 rjmp .+26 ; 0x2cc7a 2cc60: c9 01 movw r24, r18 LogError(msg_P); 2cc62: 0f 94 b3 65 call 0x2cb66 ; 0x2cb66 SERIAL_ECHOLNPGM("ResetRetryAttempts"); retryAttempts = MAX_RETRIES; } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 2cc66: 85 e6 ldi r24, 0x65 ; 101 2cc68: 9b ea ldi r25, 0xAB ; 171 2cc6a: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 /// @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; } 2cc6e: 8a e0 ldi r24, 0x0A ; 10 2cc70: 80 93 5f 13 sts 0x135F, r24 ; 0x80135f 2cc74: 80 91 5e 13 lds r24, 0x135E ; 0x80135e 2cc78: 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 2cc7a: 80 e0 ldi r24, 0x00 ; 0 } } 2cc7c: 08 95 ret 0002cc7e : } *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) { 2cc7e: cf 93 push r28 2cc80: df 93 push r29 2cc82: cd b7 in r28, 0x3d ; 61 2cc84: de b7 in r29, 0x3e ; 62 2cc86: 2e 97 sbiw r28, 0x0e ; 14 2cc88: 0f b6 in r0, 0x3f ; 63 2cc8a: f8 94 cli 2cc8c: de bf out 0x3e, r29 ; 62 2cc8e: 0f be out 0x3f, r0 ; 63 2cc90: cd bf out 0x3d, r28 ; 61 constexpr uint_fast8_t rqs = modules::protocol::Protocol::MaxRequestSize() + 1; char tmp[rqs] = ">"; 2cc92: 2e e3 ldi r18, 0x3E ; 62 2cc94: 30 e0 ldi r19, 0x00 ; 0 2cc96: 3a 83 std Y+2, r19 ; 0x02 2cc98: 29 83 std Y+1, r18 ; 0x01 2cc9a: fe 01 movw r30, r28 2cc9c: 33 96 adiw r30, 0x03 ; 3 2cc9e: 2c e0 ldi r18, 0x0C ; 12 2cca0: df 01 movw r26, r30 2cca2: 1d 92 st X+, r1 2cca4: 2a 95 dec r18 2cca6: e9 f7 brne .-6 ; 0x2cca2 2cca8: de 01 movw r26, r28 2ccaa: 12 96 adiw r26, 0x02 ; 2 2ccac: 48 2f mov r20, r24 2ccae: fc 01 movw r30, r24 2ccb0: 9d 01 movw r18, r26 static char lastMsg[rqs] = ""; for (uint8_t i = 0; i < size; ++i) { 2ccb2: 8e 2f mov r24, r30 2ccb4: 84 1b sub r24, r20 2ccb6: 86 17 cp r24, r22 2ccb8: 40 f4 brcc .+16 ; 0x2ccca uint8_t b = txbuff[i]; 2ccba: 81 91 ld r24, Z+ // Check for printable character, including space if (b < 32 || b > 127) { 2ccbc: 90 ee ldi r25, 0xE0 ; 224 2ccbe: 98 0f add r25, r24 2ccc0: 90 36 cpi r25, 0x60 ; 96 2ccc2: 08 f0 brcs .+2 ; 0x2ccc6 b = '.'; 2ccc4: 8e e2 ldi r24, 0x2E ; 46 } tmp[i + 1] = b; 2ccc6: 8d 93 st X+, r24 2ccc8: f4 cf rjmp .-24 ; 0x2ccb2 } tmp[size + 1] = 0; 2ccca: f9 01 movw r30, r18 2cccc: e6 0f add r30, r22 2ccce: f1 1d adc r31, r1 2ccd0: 10 82 st Z, r1 if (!strncmp_P(tmp, PSTR(">S0*c6."), rqs) && !strncmp(lastMsg, tmp, rqs)) { 2ccd2: 4e e0 ldi r20, 0x0E ; 14 2ccd4: 50 e0 ldi r21, 0x00 ; 0 2ccd6: 68 ec ldi r22, 0xC8 ; 200 2ccd8: 7b ea ldi r23, 0xAB ; 171 2ccda: ce 01 movw r24, r28 2ccdc: 01 96 adiw r24, 0x01 ; 1 2ccde: 0f 94 fb d9 call 0x3b3f6 ; 0x3b3f6 2cce2: 89 2b or r24, r25 2cce4: 59 f4 brne .+22 ; 0x2ccfc 2cce6: 4e e0 ldi r20, 0x0E ; 14 2cce8: 50 e0 ldi r21, 0x00 ; 0 2ccea: be 01 movw r22, r28 2ccec: 6f 5f subi r22, 0xFF ; 255 2ccee: 7f 4f sbci r23, 0xFF ; 255 2ccf0: 82 ea ldi r24, 0xA2 ; 162 2ccf2: 92 e1 ldi r25, 0x12 ; 18 2ccf4: 0f 94 8e e2 call 0x3c51c ; 0x3c51c 2ccf8: 89 2b or r24, r25 2ccfa: 61 f0 breq .+24 ; 0x2cd14 // 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); 2ccfc: 82 ec ldi r24, 0xC2 ; 194 2ccfe: 9b ea ldi r25, 0xAB ; 171 2cd00: 0e 94 50 77 call 0xeea0 ; 0xeea0 2cd04: 8c eb ldi r24, 0xBC ; 188 2cd06: 9b ea ldi r25, 0xAB ; 171 2cd08: 0e 94 50 77 call 0xeea0 ; 0xeea0 2cd0c: ce 01 movw r24, r28 2cd0e: 01 96 adiw r24, 0x01 ; 1 2cd10: 0f 94 00 d6 call 0x3ac00 ; 0x3ac00 } strncpy(lastMsg, tmp, rqs); 2cd14: 4e e0 ldi r20, 0x0E ; 14 2cd16: 50 e0 ldi r21, 0x00 ; 0 2cd18: be 01 movw r22, r28 2cd1a: 6f 5f subi r22, 0xFF ; 255 2cd1c: 7f 4f sbci r23, 0xFF ; 255 2cd1e: 82 ea ldi r24, 0xA2 ; 162 2cd20: 92 e1 ldi r25, 0x12 ; 18 2cd22: 0f 94 9c e2 call 0x3c538 ; 0x3c538 } 2cd26: 2e 96 adiw r28, 0x0e ; 14 2cd28: 0f b6 in r0, 0x3f ; 63 2cd2a: f8 94 cli 2cd2c: de bf out 0x3e, r29 ; 62 2cd2e: 0f be out 0x3f, r0 ; 63 2cd30: cd bf out 0x3d, r28 ; 61 2cd32: df 91 pop r29 2cd34: cf 91 pop r28 2cd36: 08 95 ret 0002cd38 : return CommunicationTimeout; } return Processing; } void ProtocolLogic::SendMsg(RequestMsg rq) { 2cd38: cf 92 push r12 2cd3a: df 92 push r13 2cd3c: ef 92 push r14 2cd3e: ff 92 push r15 2cd40: 1f 93 push r17 2cd42: cf 93 push r28 2cd44: df 93 push r29 2cd46: cd b7 in r28, 0x3d ; 61 2cd48: de b7 in r29, 0x3e ; 62 2cd4a: 62 97 sbiw r28, 0x12 ; 18 2cd4c: 0f b6 in r0, 0x3f ; 63 2cd4e: f8 94 cli 2cd50: de bf out 0x3e, r29 ; 62 2cd52: 0f be out 0x3f, r0 ; 63 2cd54: cd bf out 0x3d, r28 ; 61 2cd56: 4e 87 std Y+14, r20 ; 0x0e 2cd58: 5f 87 std Y+15, r21 ; 0x0f 2cd5a: 68 8b std Y+16, r22 ; 0x10 2cd5c: 79 8b std Y+17, r23 ; 0x11 2cd5e: 8a 8b std Y+18, r24 ; 0x12 } } } uint8_t Protocol::EncodeRequest(const RequestMsg &msg, uint8_t *txbuff) { txbuff[0] = (uint8_t)msg.code; 2cd60: 49 83 std Y+1, r20 ; 0x01 uint8_t i = 1 + UInt8ToHex(msg.value, txbuff + 1); 2cd62: 85 2f mov r24, r21 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 2cd64: 51 11 cpse r21, r1 2cd66: 31 c0 rjmp .+98 ; 0x2cdca *dst = '0'; 2cd68: 80 e3 ldi r24, 0x30 ; 48 2cd6a: 8a 83 std Y+2, r24 ; 0x02 return 1; 2cd6c: 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); 2cd6e: e1 e0 ldi r30, 0x01 ; 1 2cd70: e1 0f add r30, r17 2cd72: 81 e0 ldi r24, 0x01 ; 1 2cd74: 90 e0 ldi r25, 0x00 ; 0 2cd76: 8c 0f add r24, r28 2cd78: 9d 1f adc r25, r29 2cd7a: 8e 0f add r24, r30 2cd7c: 91 1d adc r25, r1 2cd7e: fc 01 movw r30, r24 2cd80: 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 2cd82: 9a e2 ldi r25, 0x2A ; 42 2cd84: 90 83 st Z, r25 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 2cd86: 81 11 cpse r24, r1 2cd88: 27 c0 rjmp .+78 ; 0x2cdd8 *dst = '0'; 2cd8a: 80 e3 ldi r24, 0x30 ; 48 2cd8c: 81 83 std Z+1, r24 ; 0x01 return 1; 2cd8e: 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); 2cd90: 1e 5f subi r17, 0xFE ; 254 2cd92: 18 0f add r17, r24 txbuff[i] = '\n'; 2cd94: e1 e0 ldi r30, 0x01 ; 1 2cd96: f0 e0 ldi r31, 0x00 ; 0 2cd98: ec 0f add r30, r28 2cd9a: fd 1f adc r31, r29 2cd9c: e1 0f add r30, r17 2cd9e: f1 1d adc r31, r1 2cda0: 8a e0 ldi r24, 0x0A ; 10 2cda2: 80 83 st Z, r24 ++i; 2cda4: 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); 2cda6: fe 01 movw r30, r28 2cda8: 31 96 adiw r30, 0x01 ; 1 2cdaa: 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--){ 2cdac: 6f 01 movw r12, r30 2cdae: c1 0e add r12, r17 2cdb0: d1 1c adc r13, r1 2cdb2: ec 14 cp r14, r12 2cdb4: fd 04 cpc r15, r13 2cdb6: b1 f0 breq .+44 ; 0x2cde4 fputc(*buffer, uart2io); 2cdb8: f7 01 movw r30, r14 2cdba: 81 91 ld r24, Z+ 2cdbc: 7f 01 movw r14, r30 2cdbe: 64 e9 ldi r22, 0x94 ; 148 2cdc0: 72 e1 ldi r23, 0x12 ; 18 2cdc2: 90 e0 ldi r25, 0x00 ; 0 2cdc4: 0f 94 84 da call 0x3b508 ; 0x3b508 2cdc8: f4 cf rjmp .-24 ; 0x2cdb2 2cdca: be 01 movw r22, r28 2cdcc: 6e 5f subi r22, 0xFE ; 254 2cdce: 7f 4f sbci r23, 0xFF ; 255 2cdd0: 0f 94 3d c5 call 0x38a7a ; 0x38a7a 2cdd4: 18 2f mov r17, r24 2cdd6: cb cf rjmp .-106 ; 0x2cd6e 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); 2cdd8: bf 01 movw r22, r30 2cdda: 6f 5f subi r22, 0xFF ; 255 2cddc: 7f 4f sbci r23, 0xFF ; 255 2cdde: 0f 94 3d c5 call 0x38a7a ; 0x38a7a 2cde2: d6 cf rjmp .-84 ; 0x2cd90 LogRequestMsg(txbuff, len); 2cde4: 61 2f mov r22, r17 2cde6: ce 01 movw r24, r28 2cde8: 01 96 adiw r24, 0x01 ; 1 2cdea: 0f 94 3f 66 call 0x2cc7e ; 0x2cc7e RecordUARTActivity(); 2cdee: 0f 94 96 65 call 0x2cb2c ; 0x2cb2c } 2cdf2: 62 96 adiw r28, 0x12 ; 18 2cdf4: 0f b6 in r0, 0x3f ; 63 2cdf6: f8 94 cli 2cdf8: de bf out 0x3e, r29 ; 62 2cdfa: 0f be out 0x3f, r0 ; 63 2cdfc: cd bf out 0x3d, r28 ; 61 2cdfe: df 91 pop r29 2ce00: cf 91 pop r28 2ce02: 1f 91 pop r17 2ce04: ff 90 pop r15 2ce06: ef 90 pop r14 2ce08: df 90 pop r13 2ce0a: cf 90 pop r12 2ce0c: 08 95 ret 0002ce0e : 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) { 2ce0e: 8f 92 push r8 2ce10: 9f 92 push r9 2ce12: af 92 push r10 2ce14: bf 92 push r11 2ce16: df 92 push r13 2ce18: ef 92 push r14 2ce1a: ff 92 push r15 2ce1c: 0f 93 push r16 2ce1e: 1f 93 push r17 2ce20: cf 93 push r28 2ce22: df 93 push r29 2ce24: cd b7 in r28, 0x3d ; 61 2ce26: de b7 in r29, 0x3e ; 62 2ce28: 67 97 sbiw r28, 0x17 ; 23 2ce2a: 0f b6 in r0, 0x3f ; 63 2ce2c: f8 94 cli 2ce2e: de bf out 0x3e, r29 ; 62 2ce30: 0f be out 0x3f, r0 ; 63 2ce32: cd bf out 0x3d, r28 ; 61 2ce34: 18 2f mov r17, r24 2ce36: 7b 01 movw r14, r22 2ce38: d4 2e mov r13, r20 2ce3a: 07 e5 ldi r16, 0x57 ; 87 2ce3c: 0b 8b std Y+19, r16 ; 0x13 2ce3e: 8c 8b std Y+20, r24 ; 0x14 2ce40: 7e 8b std Y+22, r23 ; 0x16 2ce42: 6d 8b std Y+21, r22 ; 0x15 2ce44: ce 01 movw r24, r28 2ce46: 43 96 adiw r24, 0x13 ; 19 2ce48: 0f 94 69 c5 call 0x38ad2 ; 0x38ad2 2ce4c: 8f 8b std Y+23, r24 ; 0x17 2ce4e: 0e 87 std Y+14, r16 ; 0x0e 2ce50: 1f 87 std Y+15, r17 ; 0x0f 2ce52: f9 8a std Y+17, r15 ; 0x11 2ce54: e8 8a std Y+16, r14 ; 0x10 2ce56: ce 01 movw r24, r28 2ce58: 0e 96 adiw r24, 0x0e ; 14 2ce5a: 0f 94 69 c5 call 0x38ad2 ; 0x38ad2 2ce5e: 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; 2ce60: 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) { 2ce62: 11 11 cpse r17, r1 2ce64: 27 c0 rjmp .+78 ; 0x2ceb4 *dst = '0'; 2ce66: 80 e3 ldi r24, 0x30 ; 48 2ce68: 8a 83 std Y+2, r24 ; 0x02 return 1; 2ce6a: 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); 2ce6c: e1 e0 ldi r30, 0x01 ; 1 2ce6e: e8 0f add r30, r24 dst[i] = ' '; 2ce70: 21 e0 ldi r18, 0x01 ; 1 2ce72: 30 e0 ldi r19, 0x00 ; 0 2ce74: 2c 0f add r18, r28 2ce76: 3d 1f adc r19, r29 2ce78: 2e 0f add r18, r30 2ce7a: 31 1d adc r19, r1 2ce7c: f9 01 movw r30, r18 2ce7e: 90 e2 ldi r25, 0x20 ; 32 2ce80: 90 83 st Z, r25 return i + 1; 2ce82: 02 e0 ldi r16, 0x02 ; 2 2ce84: 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); 2ce86: aa 24 eor r10, r10 2ce88: a3 94 inc r10 2ce8a: b1 2c mov r11, r1 2ce8c: ac 0e add r10, r28 2ce8e: bd 1e adc r11, r29 2ce90: a0 0e add r10, r16 2ce92: 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) { 2ce94: e1 14 cp r14, r1 2ce96: f1 04 cpc r15, r1 2ce98: 39 f1 breq .+78 ; 0x2cee8 *dst = '0'; return 1; } // skip initial zeros uint8_t charsOut = 4; 2ce9a: 14 e0 ldi r17, 0x04 ; 4 while ((value & topNibbleMask) == 0) { 2ce9c: c7 01 movw r24, r14 2ce9e: 88 27 eor r24, r24 2cea0: 90 7f andi r25, 0xF0 ; 240 2cea2: 89 2b or r24, r25 2cea4: 71 f4 brne .+28 ; 0x2cec2 value <<= 4U; 2cea6: 24 e0 ldi r18, 0x04 ; 4 2cea8: ee 0c add r14, r14 2ceaa: ff 1c adc r15, r15 2ceac: 2a 95 dec r18 2ceae: e1 f7 brne .-8 ; 0x2cea8 --charsOut; 2ceb0: 11 50 subi r17, 0x01 ; 1 2ceb2: f4 cf rjmp .-24 ; 0x2ce9c 2ceb4: be 01 movw r22, r28 2ceb6: 6e 5f subi r22, 0xFE ; 254 2ceb8: 7f 4f sbci r23, 0xFF ; 255 2ceba: 81 2f mov r24, r17 2cebc: 0f 94 3d c5 call 0x38a7a ; 0x38a7a 2cec0: d5 cf rjmp .-86 ; 0x2ce6c *dst = '0'; return 1; } // skip initial zeros uint8_t charsOut = 4; while ((value & topNibbleMask) == 0) { 2cec2: 45 01 movw r8, r10 value <<= 4U; --charsOut; } for (uint8_t i = 0; i < charsOut; ++i) { 2cec4: 88 2d mov r24, r8 2cec6: 8a 19 sub r24, r10 2cec8: 81 17 cp r24, r17 2ceca: 90 f4 brcc .+36 ; 0x2cef0 uint8_t n = (value & topNibbleMask) >> (8U + 4U); value <<= 4U; *dst = Nibble2Char(n); 2cecc: 8f 2d mov r24, r15 2cece: 82 95 swap r24 2ced0: 8f 70 andi r24, 0x0F ; 15 2ced2: 94 e0 ldi r25, 0x04 ; 4 2ced4: ee 0c add r14, r14 2ced6: ff 1c adc r15, r15 2ced8: 9a 95 dec r25 2ceda: e1 f7 brne .-8 ; 0x2ced4 2cedc: 0f 94 33 c5 call 0x38a66 ; 0x38a66 2cee0: f4 01 movw r30, r8 2cee2: 81 93 st Z+, r24 2cee4: 4f 01 movw r8, r30 2cee6: ee cf rjmp .-36 ; 0x2cec4 } uint8_t Protocol::UInt16ToHex(uint16_t value, uint8_t *dst) { constexpr uint16_t topNibbleMask = 0xf000; if (value == 0) { *dst = '0'; 2cee8: 80 e3 ldi r24, 0x30 ; 48 2ceea: f5 01 movw r30, r10 2ceec: 80 83 st Z, r24 return 1; 2ceee: 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); 2cef0: 10 0f add r17, r16 i += AppendCRC(msg.CRC(), txbuff + i); 2cef2: e1 e0 ldi r30, 0x01 ; 1 2cef4: f0 e0 ldi r31, 0x00 ; 0 2cef6: ec 0f add r30, r28 2cef8: fd 1f adc r31, r29 2cefa: e1 0f add r30, r17 2cefc: f1 1d adc r31, r1 2cefe: 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 2cf00: 9a e2 ldi r25, 0x2A ; 42 2cf02: 90 83 st Z, r25 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 2cf04: 81 11 cpse r24, r1 2cf06: 21 c0 rjmp .+66 ; 0x2cf4a *dst = '0'; 2cf08: 80 e3 ldi r24, 0x30 ; 48 2cf0a: 81 83 std Z+1, r24 ; 0x01 return 1; 2cf0c: 81 e0 ldi r24, 0x01 ; 1 2cf0e: 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); 2cf10: 18 0f add r17, r24 txbuff[i] = '\n'; 2cf12: e1 e0 ldi r30, 0x01 ; 1 2cf14: f0 e0 ldi r31, 0x00 ; 0 2cf16: ec 0f add r30, r28 2cf18: fd 1f adc r31, r29 2cf1a: e1 0f add r30, r17 2cf1c: f1 1d adc r31, r1 2cf1e: 8a e0 ldi r24, 0x0A ; 10 2cf20: 80 83 st Z, r24 ++i; 2cf22: 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); 2cf24: 9e 01 movw r18, r28 2cf26: 2f 5f subi r18, 0xFF ; 255 2cf28: 3f 4f sbci r19, 0xFF ; 255 2cf2a: 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--){ 2cf2c: 59 01 movw r10, r18 2cf2e: a1 0e add r10, r17 2cf30: b1 1c adc r11, r1 2cf32: ea 14 cp r14, r10 2cf34: fb 04 cpc r15, r11 2cf36: 79 f0 breq .+30 ; 0x2cf56 fputc(*buffer, uart2io); 2cf38: f7 01 movw r30, r14 2cf3a: 81 91 ld r24, Z+ 2cf3c: 7f 01 movw r14, r30 2cf3e: 64 e9 ldi r22, 0x94 ; 148 2cf40: 72 e1 ldi r23, 0x12 ; 18 2cf42: 90 e0 ldi r25, 0x00 ; 0 2cf44: 0f 94 84 da call 0x3b508 ; 0x3b508 2cf48: f4 cf rjmp .-24 ; 0x2cf32 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); 2cf4a: bf 01 movw r22, r30 2cf4c: 6f 5f subi r22, 0xFF ; 255 2cf4e: 7f 4f sbci r23, 0xFF ; 255 2cf50: 0f 94 3d c5 call 0x38a7a ; 0x38a7a 2cf54: dc cf rjmp .-72 ; 0x2cf0e LogRequestMsg(txbuff, len); 2cf56: 61 2f mov r22, r17 2cf58: ce 01 movw r24, r28 2cf5a: 01 96 adiw r24, 0x01 ; 1 2cf5c: 0f 94 3f 66 call 0x2cc7e ; 0x2cc7e RecordUARTActivity(); 2cf60: 0f 94 96 65 call 0x2cb2c ; 0x2cb2c scopeState = nextState; } void ProtocolLogic::SendWriteRegister(uint8_t index, uint16_t value, ScopeState nextState) { SendWriteMsg(RequestMsg(RequestMsgCodes::Write, index, value)); scopeState = nextState; 2cf64: d0 92 4e 13 sts 0x134E, r13 ; 0x80134e } 2cf68: 67 96 adiw r28, 0x17 ; 23 2cf6a: 0f b6 in r0, 0x3f ; 63 2cf6c: f8 94 cli 2cf6e: de bf out 0x3e, r29 ; 62 2cf70: 0f be out 0x3f, r0 ; 63 2cf72: cd bf out 0x3d, r28 ; 61 2cf74: df 91 pop r29 2cf76: cf 91 pop r28 2cf78: 1f 91 pop r17 2cf7a: 0f 91 pop r16 2cf7c: ff 90 pop r15 2cf7e: ef 90 pop r14 2cf80: df 90 pop r13 2cf82: bf 90 pop r11 2cf84: af 90 pop r10 2cf86: 9f 90 pop r9 2cf88: 8f 90 pop r8 2cf8a: 08 95 ret 0002cf8c : regIndex = 0; SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } bool __attribute__((noinline)) ProtocolLogic::ProcessWritingInitRegister() { ++regIndex; 2cf8c: 20 91 99 13 lds r18, 0x1399 ; 0x801399 2cf90: 2f 5f subi r18, 0xFF ; 255 2cf92: 20 93 99 13 sts 0x1399, r18 ; 0x801399 if (regIndex >= initRegs8Count) { 2cf96: 22 30 cpi r18, 0x02 ; 2 2cf98: 78 f4 brcc .+30 ; 0x2cfb8 return true; } else { SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); 2cf9a: 30 e0 ldi r19, 0x00 ; 0 2cf9c: f9 01 movw r30, r18 2cf9e: ed 59 subi r30, 0x9D ; 157 2cfa0: f4 45 sbci r31, 0x54 ; 84 2cfa2: 84 91 lpm r24, Z 2cfa4: 29 56 subi r18, 0x69 ; 105 2cfa6: 3c 4e sbci r19, 0xEC ; 236 2cfa8: f9 01 movw r30, r18 2cfaa: 60 81 ld r22, Z 2cfac: 70 e0 ldi r23, 0x00 ; 0 2cfae: 49 e0 ldi r20, 0x09 ; 9 2cfb0: 0f 94 07 67 call 0x2ce0e ; 0x2ce0e } return false; 2cfb4: 80 e0 ldi r24, 0x00 ; 0 2cfb6: 08 95 ret } bool __attribute__((noinline)) ProtocolLogic::ProcessWritingInitRegister() { ++regIndex; if (regIndex >= initRegs8Count) { return true; 2cfb8: 81 e0 ldi r24, 0x01 ; 1 } else { SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } return false; } 2cfba: 08 95 ret 0002cfbc : } /// 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){ 2cfbc: 2f 92 push r2 2cfbe: 3f 92 push r3 2cfc0: 4f 92 push r4 2cfc2: 5f 92 push r5 2cfc4: 6f 92 push r6 2cfc6: 7f 92 push r7 2cfc8: 8f 92 push r8 2cfca: 9f 92 push r9 2cfcc: af 92 push r10 2cfce: bf 92 push r11 2cfd0: cf 92 push r12 2cfd2: df 92 push r13 2cfd4: ef 92 push r14 2cfd6: ff 92 push r15 2cfd8: 0f 93 push r16 2cfda: 1f 93 push r17 2cfdc: cf 93 push r28 2cfde: df 93 push r29 2cfe0: 00 d0 rcall .+0 ; 0x2cfe2 2cfe2: 1f 92 push r1 2cfe4: 1f 92 push r1 2cfe6: cd b7 in r28, 0x3d ; 61 2cfe8: de b7 in r29, 0x3e ; 62 2cfea: 2b 01 movw r4, r22 2cfec: 1a 01 movw r2, r20 2cfee: f1 2c mov r15, r1 2cff0: 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; 2cff2: 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; 2cff4: 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; 2cff6: 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){ 2cff8: 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); 2cffa: 66 24 eor r6, r6 2cffc: 63 94 inc r6 2cffe: 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){ 2d000: 70 e0 ldi r23, 0x00 ; 0 2d002: 60 e0 ldi r22, 0x00 ; 0 2d004: 97 01 movw r18, r14 2d006: 2b 53 subi r18, 0x3B ; 59 2d008: 39 4f sbci r19, 0xF9 ; 249 2d00a: 3a 83 std Y+2, r19 ; 0x02 2d00c: 29 83 std Y+1, r18 ; 0x01 2d00e: 86 2e mov r8, r22 2d010: c9 80 ldd r12, Y+1 ; 0x01 2d012: da 80 ldd r13, Y+2 ; 0x02 2d014: c6 0e add r12, r22 2d016: d7 1e adc r13, r23 2d018: 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; 2d01a: 00 e0 ldi r16, 0x00 ; 0 for (uint8_t i = 0; i < 12; ++i){ 2d01c: 40 e0 ldi r20, 0x00 ; 0 2d01e: 30 e0 ldi r19, 0x00 ; 0 2d020: 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; 2d022: ae ef ldi r26, 0xFE ; 254 2d024: a4 0f add r26, r20 2d026: 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; 2d028: 44 23 and r20, r20 2d02a: 19 f0 breq .+6 ; 0x2d032 2d02c: 4b 30 cpi r20, 0x0B ; 11 2d02e: 09 f0 breq .+2 ; 0x2d032 2d030: 7d c0 rjmp .+250 ; 0x2d12c 2d032: ae ef ldi r26, 0xFE ; 254 2d034: a2 0f add r26, r18 2d036: a8 30 cpi r26, 0x08 ; 8 2d038: 08 f4 brcc .+2 ; 0x2d03c 2d03a: 7a c0 rjmp .+244 ; 0x2d130 2d03c: 2f 5f subi r18, 0xFF ; 255 2d03e: 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){ 2d040: 2c 30 cpi r18, 0x0C ; 12 2d042: 31 05 cpc r19, r1 2d044: 89 f7 brne .-30 ; 0x2d028 /// 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){ 2d046: 4f 5f subi r20, 0xFF ; 255 2d048: 20 e2 ldi r18, 0x20 ; 32 2d04a: c2 0e add r12, r18 2d04c: d1 1c adc r13, r1 2d04e: 32 96 adiw r30, 0x02 ; 2 2d050: 4c 30 cpi r20, 0x0C ; 12 2d052: 29 f7 brne .-54 ; 0x2d01e // 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){ 2d054: 3c 81 ldd r19, Y+4 ; 0x04 2d056: 30 17 cp r19, r16 2d058: 18 f4 brcc .+6 ; 0x2d060 2d05a: 0c 83 std Y+4, r16 ; 0x04 2d05c: 5d 83 std Y+5, r21 ; 0x05 2d05e: 18 2d mov r17, r8 2d060: 6f 5f subi r22, 0xFF ; 255 2d062: 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){ 2d064: 64 31 cpi r22, 0x14 ; 20 2d066: 71 05 cpc r23, r1 2d068: 91 f6 brne .-92 ; 0x2d00e 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){ 2d06a: 5f 5f subi r21, 0xFF ; 255 2d06c: a0 e2 ldi r26, 0x20 ; 32 2d06e: ea 0e add r14, r26 2d070: f1 1c adc r15, r1 2d072: 54 31 cpi r21, 0x14 ; 20 2d074: 29 f6 brne .-118 ; 0x2d000 // 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); 2d076: ec 81 ldd r30, Y+4 ; 0x04 2d078: 6e 2f mov r22, r30 2d07a: 70 e0 ldi r23, 0x00 ; 0 2d07c: 90 e0 ldi r25, 0x00 ; 0 2d07e: 80 e0 ldi r24, 0x00 ; 0 2d080: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 2d084: 23 ec ldi r18, 0xC3 ; 195 2d086: 35 ef ldi r19, 0xF5 ; 245 2d088: 48 ea ldi r20, 0xA8 ; 168 2d08a: 5f e3 ldi r21, 0x3F ; 63 2d08c: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 2d090: 9f 93 push r25 2d092: 8f 93 push r24 2d094: 7f 93 push r23 2d096: 6f 93 push r22 2d098: fd 81 ldd r31, Y+5 ; 0x05 2d09a: 6f 2f mov r22, r31 2d09c: 70 e0 ldi r23, 0x00 ; 0 2d09e: 90 e0 ldi r25, 0x00 ; 0 2d0a0: 80 e0 ldi r24, 0x00 ; 0 2d0a2: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 2d0a6: 20 e0 ldi r18, 0x00 ; 0 2d0a8: 30 e0 ldi r19, 0x00 ; 0 2d0aa: 40 eb ldi r20, 0xB0 ; 176 2d0ac: 50 e4 ldi r21, 0x40 ; 64 2d0ae: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 2d0b2: 9f 93 push r25 2d0b4: 8f 93 push r24 2d0b6: 7f 93 push r23 2d0b8: 6f 93 push r22 2d0ba: 61 2f mov r22, r17 2d0bc: 70 e0 ldi r23, 0x00 ; 0 2d0be: 90 e0 ldi r25, 0x00 ; 0 2d0c0: 80 e0 ldi r24, 0x00 ; 0 2d0c2: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 2d0c6: 20 e0 ldi r18, 0x00 ; 0 2d0c8: 30 e0 ldi r19, 0x00 ; 0 2d0ca: 40 eb ldi r20, 0xB0 ; 176 2d0cc: 50 e4 ldi r21, 0x40 ; 64 2d0ce: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 2d0d2: 9f 93 push r25 2d0d4: 8f 93 push r24 2d0d6: 7f 93 push r23 2d0d8: 6f 93 push r22 2d0da: 8b e9 ldi r24, 0x9B ; 155 2d0dc: 96 ea ldi r25, 0xA6 ; 166 2d0de: 9f 93 push r25 2d0e0: 8f 93 push r24 2d0e2: 0f 94 de da call 0x3b5bc ; 0x3b5bc *pc = max_c; 2d0e6: f2 01 movw r30, r4 2d0e8: 10 83 st Z, r17 *pr = max_r; 2d0ea: 2d 81 ldd r18, Y+5 ; 0x05 2d0ec: f1 01 movw r30, r2 2d0ee: 20 83 st Z, r18 2d0f0: 0f b6 in r0, 0x3f ; 63 2d0f2: f8 94 cli 2d0f4: de bf out 0x3e, r29 ; 62 2d0f6: 0f be out 0x3f, r0 ; 63 2d0f8: cd bf out 0x3d, r28 ; 61 return max_match; } 2d0fa: 8c 81 ldd r24, Y+4 ; 0x04 2d0fc: 0f 90 pop r0 2d0fe: 0f 90 pop r0 2d100: 0f 90 pop r0 2d102: 0f 90 pop r0 2d104: 0f 90 pop r0 2d106: df 91 pop r29 2d108: cf 91 pop r28 2d10a: 1f 91 pop r17 2d10c: 0f 91 pop r16 2d10e: ff 90 pop r15 2d110: ef 90 pop r14 2d112: df 90 pop r13 2d114: cf 90 pop r12 2d116: bf 90 pop r11 2d118: af 90 pop r10 2d11a: 9f 90 pop r9 2d11c: 8f 90 pop r8 2d11e: 7f 90 pop r7 2d120: 6f 90 pop r6 2d122: 5f 90 pop r5 2d124: 4f 90 pop r4 2d126: 3f 90 pop r3 2d128: 2f 90 pop r2 2d12a: 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; 2d12c: 22 23 and r18, r18 2d12e: 11 f0 breq .+4 ; 0x2d134 2d130: 2b 30 cpi r18, 0x0B ; 11 2d132: 21 f4 brne .+8 ; 0x2d13c 2d134: ab 81 ldd r26, Y+3 ; 0x03 2d136: a8 30 cpi r26, 0x08 ; 8 2d138: 08 f0 brcs .+2 ; 0x2d13c 2d13a: 80 cf rjmp .-256 ; 0x2d03c const uint16_t idx = (c + j) + 32 * ((uint16_t)r + i); const bool high_pix = pixels[idx] > thr; 2d13c: 99 24 eor r9, r9 2d13e: 93 94 inc r9 2d140: d6 01 movw r26, r12 2d142: a2 0f add r26, r18 2d144: b3 1f adc r27, r19 2d146: ac 91 ld r26, X 2d148: a1 31 cpi r26, 0x11 ; 17 2d14a: 08 f4 brcc .+2 ; 0x2d14e 2d14c: 91 2c mov r9, r1 const bool high_pat = pattern[i] & (1 << j); 2d14e: a0 80 ld r10, Z 2d150: b1 80 ldd r11, Z+1 ; 0x01 2d152: d3 01 movw r26, r6 2d154: 02 2e mov r0, r18 2d156: 02 c0 rjmp .+4 ; 0x2d15c 2d158: aa 0f add r26, r26 2d15a: bb 1f adc r27, r27 2d15c: 0a 94 dec r0 2d15e: e2 f7 brpl .-8 ; 0x2d158 2d160: aa 21 and r26, r10 2d162: bb 21 and r27, r11 2d164: bb 24 eor r11, r11 2d166: b3 94 inc r11 2d168: ab 2b or r26, r27 2d16a: 09 f4 brne .+2 ; 0x2d16e 2d16c: b1 2c mov r11, r1 if (high_pix == high_pat) 2d16e: 9b 10 cpse r9, r11 2d170: 65 cf rjmp .-310 ; 0x2d03c match++; 2d172: 0f 5f subi r16, 0xFF ; 255 2d174: 63 cf rjmp .-314 ; 0x2d03c 0002d176 : * \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) { 2d176: 8f 92 push r8 2d178: 9f 92 push r9 2d17a: af 92 push r10 2d17c: bf 92 push r11 2d17e: cf 92 push r12 2d180: df 92 push r13 2d182: ef 92 push r14 2d184: ff 92 push r15 2d186: cf 93 push r28 2d188: df 93 push r29 uint32_t totalBlocks; uint32_t volumeStartBlock = 0; fat32_boot_t* fbs; sdCard_ = dev; 2d18a: 2d ef ldi r18, 0xFD ; 253 2d18c: 36 e1 ldi r19, 0x16 ; 22 2d18e: 30 93 9b 0e sts 0x0E9B, r19 ; 0x800e9b 2d192: 20 93 9a 0e sts 0x0E9A, r18 ; 0x800e9a fatType_ = 0; 2d196: 10 92 19 17 sts 0x1719, r1 ; 0x801719 allocSearchStart_ = 2; 2d19a: 42 e0 ldi r20, 0x02 ; 2 2d19c: 50 e0 ldi r21, 0x00 ; 0 2d19e: 60 e0 ldi r22, 0x00 ; 0 2d1a0: 70 e0 ldi r23, 0x00 ; 0 2d1a2: 40 93 02 17 sts 0x1702, r20 ; 0x801702 2d1a6: 50 93 03 17 sts 0x1703, r21 ; 0x801703 2d1aa: 60 93 04 17 sts 0x1704, r22 ; 0x801704 2d1ae: 70 93 05 17 sts 0x1705, r23 ; 0x801705 cacheDirty_ = 0; // cacheFlush() will write block if true 2d1b2: 10 92 99 0e sts 0x0E99, r1 ; 0x800e99 cacheMirrorBlock_ = 0; 2d1b6: 10 92 95 0e sts 0x0E95, r1 ; 0x800e95 2d1ba: 10 92 96 0e sts 0x0E96, r1 ; 0x800e96 2d1be: 10 92 97 0e sts 0x0E97, r1 ; 0x800e97 2d1c2: 10 92 98 0e sts 0x0E98, r1 ; 0x800e98 cacheBlockNumber_ = 0XFFFFFFFF; 2d1c6: 4f ef ldi r20, 0xFF ; 255 2d1c8: 5f ef ldi r21, 0xFF ; 255 2d1ca: ba 01 movw r22, r20 2d1cc: 40 93 91 0e sts 0x0E91, r20 ; 0x800e91 2d1d0: 50 93 92 0e sts 0x0E92, r21 ; 0x800e92 2d1d4: 60 93 93 0e sts 0x0E93, r22 ; 0x800e93 2d1d8: 70 93 94 0e sts 0x0E94, r23 ; 0x800e94 // if part == 0 assume super floppy with FAT boot sector in block zero // if part > 0 assume mbr volume with partition table if (part) { 2d1dc: 88 23 and r24, r24 2d1de: 09 f4 brne .+2 ; 0x2d1e2 2d1e0: 70 c0 rjmp .+224 ; 0x2d2c2 if (part > 4)goto fail; if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; 2d1e2: 40 e0 ldi r20, 0x00 ; 0 2d1e4: 60 e0 ldi r22, 0x00 ; 0 2d1e6: 70 e0 ldi r23, 0x00 ; 0 2d1e8: cb 01 movw r24, r22 2d1ea: 0f 94 0d 54 call 0x2a81a ; 0x2a81a 2d1ee: 81 11 cpse r24, r1 2d1f0: 0d c0 rjmp .+26 ; 0x2d20c fatType_ = 32; } return true; fail: return false; 2d1f2: c0 e0 ldi r28, 0x00 ; 0 } 2d1f4: 8c 2f mov r24, r28 2d1f6: df 91 pop r29 2d1f8: cf 91 pop r28 2d1fa: ff 90 pop r15 2d1fc: ef 90 pop r14 2d1fe: df 90 pop r13 2d200: cf 90 pop r12 2d202: bf 90 pop r11 2d204: af 90 pop r10 2d206: 9f 90 pop r9 2d208: 8f 90 pop r8 2d20a: 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 || 2d20c: 80 91 5b 10 lds r24, 0x105B ; 0x80105b 2d210: 8f 77 andi r24, 0x7F ; 127 2d212: 79 f7 brne .-34 ; 0x2d1f2 2d214: 80 91 67 10 lds r24, 0x1067 ; 0x801067 2d218: 90 91 68 10 lds r25, 0x1068 ; 0x801068 2d21c: a0 91 69 10 lds r26, 0x1069 ; 0x801069 2d220: b0 91 6a 10 lds r27, 0x106A ; 0x80106a 2d224: 84 36 cpi r24, 0x64 ; 100 2d226: 91 05 cpc r25, r1 2d228: a1 05 cpc r26, r1 2d22a: b1 05 cpc r27, r1 2d22c: 10 f3 brcs .-60 ; 0x2d1f2 p->totalSectors < 100 || p->firstSector == 0) { 2d22e: c0 90 63 10 lds r12, 0x1063 ; 0x801063 2d232: d0 90 64 10 lds r13, 0x1064 ; 0x801064 2d236: e0 90 65 10 lds r14, 0x1065 ; 0x801065 2d23a: f0 90 66 10 lds r15, 0x1066 ; 0x801066 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 || 2d23e: c1 14 cp r12, r1 2d240: d1 04 cpc r13, r1 2d242: e1 04 cpc r14, r1 2d244: f1 04 cpc r15, r1 2d246: a9 f2 breq .-86 ; 0x2d1f2 // not a valid partition goto fail; } volumeStartBlock = p->firstSector; } if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; 2d248: 40 e0 ldi r20, 0x00 ; 0 2d24a: c7 01 movw r24, r14 2d24c: b6 01 movw r22, r12 2d24e: 0f 94 0d 54 call 0x2a81a ; 0x2a81a 2d252: c8 2f mov r28, r24 2d254: 88 23 and r24, r24 2d256: 69 f2 breq .-102 ; 0x2d1f2 fbs = &cacheBuffer_.fbs32; if (fbs->bytesPerSector != 512 || 2d258: 80 91 a8 0e lds r24, 0x0EA8 ; 0x800ea8 2d25c: 90 91 a9 0e lds r25, 0x0EA9 ; 0x800ea9 2d260: 81 15 cp r24, r1 2d262: 92 40 sbci r25, 0x02 ; 2 2d264: 31 f6 brne .-116 ; 0x2d1f2 fbs->fatCount == 0 || 2d266: a0 91 ad 0e lds r26, 0x0EAD ; 0x800ead } volumeStartBlock = p->firstSector; } if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; fbs = &cacheBuffer_.fbs32; if (fbs->bytesPerSector != 512 || 2d26a: aa 23 and r26, r26 2d26c: 11 f2 breq .-124 ; 0x2d1f2 fbs->fatCount == 0 || fbs->reservedSectorCount == 0 || 2d26e: 60 91 ab 0e lds r22, 0x0EAB ; 0x800eab 2d272: 70 91 ac 0e lds r23, 0x0EAC ; 0x800eac volumeStartBlock = p->firstSector; } if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; fbs = &cacheBuffer_.fbs32; if (fbs->bytesPerSector != 512 || fbs->fatCount == 0 || 2d276: 61 15 cp r22, r1 2d278: 71 05 cpc r23, r1 2d27a: 09 f4 brne .+2 ; 0x2d27e 2d27c: ba cf rjmp .-140 ; 0x2d1f2 fbs->reservedSectorCount == 0 || fbs->sectorsPerCluster == 0) { 2d27e: 20 91 aa 0e lds r18, 0x0EAA ; 0x800eaa } if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; fbs = &cacheBuffer_.fbs32; if (fbs->bytesPerSector != 512 || fbs->fatCount == 0 || fbs->reservedSectorCount == 0 || 2d282: 22 23 and r18, r18 2d284: 09 f4 brne .+2 ; 0x2d288 2d286: b5 cf rjmp .-150 ; 0x2d1f2 fbs->sectorsPerCluster == 0) { // not valid FAT volume goto fail; } fatCount_ = fbs->fatCount; 2d288: a0 93 14 17 sts 0x1714, r26 ; 0x801714 blocksPerCluster_ = fbs->sectorsPerCluster; 2d28c: 20 93 06 17 sts 0x1706, r18 ; 0x801706 // determine shift that is same as multiply by blocksPerCluster_ clusterSizeShift_ = 0; 2d290: 90 e0 ldi r25, 0x00 ; 0 2d292: 80 e0 ldi r24, 0x00 ; 0 while (blocksPerCluster_ != (1 << clusterSizeShift_)) { 2d294: 30 e0 ldi r19, 0x00 ; 0 2d296: e1 e0 ldi r30, 0x01 ; 1 2d298: f0 e0 ldi r31, 0x00 ; 0 2d29a: d8 2f mov r29, r24 2d29c: af 01 movw r20, r30 2d29e: 08 2e mov r0, r24 2d2a0: 02 c0 rjmp .+4 ; 0x2d2a6 2d2a2: 44 0f add r20, r20 2d2a4: 55 1f adc r21, r21 2d2a6: 0a 94 dec r0 2d2a8: e2 f7 brpl .-8 ; 0x2d2a2 2d2aa: 24 17 cp r18, r20 2d2ac: 35 07 cpc r19, r21 2d2ae: 69 f0 breq .+26 ; 0x2d2ca 2d2b0: 41 e0 ldi r20, 0x01 ; 1 2d2b2: 48 0f add r20, r24 2d2b4: 01 96 adiw r24, 0x01 ; 1 // error if not power of 2 if (clusterSizeShift_++ > 7) goto fail; 2d2b6: 89 30 cpi r24, 0x09 ; 9 2d2b8: 91 05 cpc r25, r1 2d2ba: 79 f7 brne .-34 ; 0x2d29a 2d2bc: 40 93 0f 17 sts 0x170F, r20 ; 0x80170f 2d2c0: 98 cf rjmp .-208 ; 0x2d1f2 * 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; 2d2c2: c1 2c mov r12, r1 2d2c4: d1 2c mov r13, r1 2d2c6: 76 01 movw r14, r12 2d2c8: bf cf rjmp .-130 ; 0x2d248 2d2ca: 80 93 0f 17 sts 0x170F, r24 ; 0x80170f clusterSizeShift_ = 0; while (blocksPerCluster_ != (1 << clusterSizeShift_)) { // error if not power of 2 if (clusterSizeShift_++ > 7) goto fail; } blocksPerFat_ = fbs->sectorsPerFat16 ? 2d2ce: 20 91 b3 0e lds r18, 0x0EB3 ; 0x800eb3 2d2d2: 30 91 b4 0e lds r19, 0x0EB4 ; 0x800eb4 2d2d6: 50 e0 ldi r21, 0x00 ; 0 2d2d8: 40 e0 ldi r20, 0x00 ; 0 2d2da: 21 15 cp r18, r1 2d2dc: 31 05 cpc r19, r1 2d2de: 41 f4 brne .+16 ; 0x2d2f0 2d2e0: 20 91 c1 0e lds r18, 0x0EC1 ; 0x800ec1 2d2e4: 30 91 c2 0e lds r19, 0x0EC2 ; 0x800ec2 2d2e8: 40 91 c3 0e lds r20, 0x0EC3 ; 0x800ec3 2d2ec: 50 91 c4 0e lds r21, 0x0EC4 ; 0x800ec4 2d2f0: 20 93 07 17 sts 0x1707, r18 ; 0x801707 2d2f4: 30 93 08 17 sts 0x1708, r19 ; 0x801708 2d2f8: 40 93 09 17 sts 0x1709, r20 ; 0x801709 2d2fc: 50 93 0a 17 sts 0x170A, r21 ; 0x80170a fbs->sectorsPerFat16 : fbs->sectorsPerFat32; fatStartBlock_ = volumeStartBlock + fbs->reservedSectorCount; 2d300: 46 01 movw r8, r12 2d302: 57 01 movw r10, r14 2d304: 86 0e add r8, r22 2d306: 97 1e adc r9, r23 2d308: a1 1c adc r10, r1 2d30a: b1 1c adc r11, r1 2d30c: 80 92 15 17 sts 0x1715, r8 ; 0x801715 2d310: 90 92 16 17 sts 0x1716, r9 ; 0x801716 2d314: a0 92 17 17 sts 0x1717, r10 ; 0x801717 2d318: b0 92 18 17 sts 0x1718, r11 ; 0x801718 // count for FAT16 zero for FAT32 rootDirEntryCount_ = fbs->rootDirEntryCount; 2d31c: e0 91 ae 0e lds r30, 0x0EAE ; 0x800eae 2d320: f0 91 af 0e lds r31, 0x0EAF ; 0x800eaf 2d324: f0 93 1b 17 sts 0x171B, r31 ; 0x80171b 2d328: e0 93 1a 17 sts 0x171A, r30 ; 0x80171a // directory start for FAT16 dataStart for FAT32 rootDirStart_ = fatStartBlock_ + fbs->fatCount * blocksPerFat_; 2d32c: b0 e0 ldi r27, 0x00 ; 0 2d32e: 0f 94 b1 dc call 0x3b962 ; 0x3b962 <__muluhisi3> 2d332: dc 01 movw r26, r24 2d334: cb 01 movw r24, r22 2d336: 88 0d add r24, r8 2d338: 99 1d adc r25, r9 2d33a: aa 1d adc r26, r10 2d33c: bb 1d adc r27, r11 2d33e: 80 93 1c 17 sts 0x171C, r24 ; 0x80171c 2d342: 90 93 1d 17 sts 0x171D, r25 ; 0x80171d 2d346: a0 93 1e 17 sts 0x171E, r26 ; 0x80171e 2d34a: b0 93 1f 17 sts 0x171F, r27 ; 0x80171f // data start for FAT16 and FAT32 dataStartBlock_ = rootDirStart_ + ((32 * fbs->rootDirEntryCount + 511)/512); 2d34e: 25 e0 ldi r18, 0x05 ; 5 2d350: ee 0f add r30, r30 2d352: ff 1f adc r31, r31 2d354: 2a 95 dec r18 2d356: e1 f7 brne .-8 ; 0x2d350 2d358: e1 50 subi r30, 0x01 ; 1 2d35a: fe 4f sbci r31, 0xFE ; 254 2d35c: ef 2f mov r30, r31 2d35e: ff 27 eor r31, r31 2d360: e6 95 lsr r30 2d362: 8e 0f add r24, r30 2d364: 9f 1f adc r25, r31 2d366: a1 1d adc r26, r1 2d368: b1 1d adc r27, r1 2d36a: 80 93 10 17 sts 0x1710, r24 ; 0x801710 2d36e: 90 93 11 17 sts 0x1711, r25 ; 0x801711 2d372: a0 93 12 17 sts 0x1712, r26 ; 0x801712 2d376: b0 93 13 17 sts 0x1713, r27 ; 0x801713 // total blocks for FAT16 or FAT32 totalBlocks = fbs->totalSectors16 ? 2d37a: 80 90 b0 0e lds r8, 0x0EB0 ; 0x800eb0 2d37e: 90 90 b1 0e lds r9, 0x0EB1 ; 0x800eb1 2d382: b1 2c mov r11, r1 2d384: a1 2c mov r10, r1 2d386: 81 14 cp r8, r1 2d388: 91 04 cpc r9, r1 2d38a: 41 f4 brne .+16 ; 0x2d39c 2d38c: 80 90 bd 0e lds r8, 0x0EBD ; 0x800ebd 2d390: 90 90 be 0e lds r9, 0x0EBE ; 0x800ebe 2d394: a0 90 bf 0e lds r10, 0x0EBF ; 0x800ebf 2d398: b0 90 c0 0e lds r11, 0x0EC0 ; 0x800ec0 fbs->totalSectors16 : fbs->totalSectors32; // total data blocks clusterCount_ = totalBlocks - (dataStartBlock_ - volumeStartBlock); 2d39c: c8 1a sub r12, r24 2d39e: d9 0a sbc r13, r25 2d3a0: ea 0a sbc r14, r26 2d3a2: fb 0a sbc r15, r27 2d3a4: c8 0c add r12, r8 2d3a6: d9 1c adc r13, r9 2d3a8: ea 1c adc r14, r10 2d3aa: fb 1c adc r15, r11 // divide by cluster size to get cluster count clusterCount_ >>= clusterSizeShift_; 2d3ac: 04 c0 rjmp .+8 ; 0x2d3b6 2d3ae: f6 94 lsr r15 2d3b0: e7 94 ror r14 2d3b2: d7 94 ror r13 2d3b4: c7 94 ror r12 2d3b6: da 95 dec r29 2d3b8: d2 f7 brpl .-12 ; 0x2d3ae 2d3ba: c0 92 0b 17 sts 0x170B, r12 ; 0x80170b 2d3be: d0 92 0c 17 sts 0x170C, r13 ; 0x80170c 2d3c2: e0 92 0d 17 sts 0x170D, r14 ; 0x80170d 2d3c6: f0 92 0e 17 sts 0x170E, r15 ; 0x80170e // FAT type is determined by cluster count if (clusterCount_ < 4085) { 2d3ca: 85 ef ldi r24, 0xF5 ; 245 2d3cc: c8 16 cp r12, r24 2d3ce: 8f e0 ldi r24, 0x0F ; 15 2d3d0: d8 06 cpc r13, r24 2d3d2: e1 04 cpc r14, r1 2d3d4: f1 04 cpc r15, r1 2d3d6: 20 f4 brcc .+8 ; 0x2d3e0 fatType_ = 12; 2d3d8: 8c e0 ldi r24, 0x0C ; 12 2d3da: 80 93 19 17 sts 0x1719, r24 ; 0x801719 2d3de: 09 cf rjmp .-494 ; 0x2d1f2 if (!FAT12_SUPPORT) goto fail; } else if (clusterCount_ < 65525) { fatType_ = 16; 2d3e0: 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) { 2d3e2: 25 ef ldi r18, 0xF5 ; 245 2d3e4: c2 16 cp r12, r18 2d3e6: 2f ef ldi r18, 0xFF ; 255 2d3e8: d2 06 cpc r13, r18 2d3ea: e1 04 cpc r14, r1 2d3ec: f1 04 cpc r15, r1 2d3ee: 88 f0 brcs .+34 ; 0x2d412 fatType_ = 16; } else { rootDirStart_ = fbs->fat32RootCluster; 2d3f0: 80 91 c9 0e lds r24, 0x0EC9 ; 0x800ec9 2d3f4: 90 91 ca 0e lds r25, 0x0ECA ; 0x800eca 2d3f8: a0 91 cb 0e lds r26, 0x0ECB ; 0x800ecb 2d3fc: b0 91 cc 0e lds r27, 0x0ECC ; 0x800ecc 2d400: 80 93 1c 17 sts 0x171C, r24 ; 0x80171c 2d404: 90 93 1d 17 sts 0x171D, r25 ; 0x80171d 2d408: a0 93 1e 17 sts 0x171E, r26 ; 0x80171e 2d40c: b0 93 1f 17 sts 0x171F, r27 ; 0x80171f fatType_ = 32; 2d410: 80 e2 ldi r24, 0x20 ; 32 2d412: 80 93 19 17 sts 0x1719, r24 ; 0x801719 2d416: ee ce rjmp .-548 ; 0x2d1f4 0002d418 : break; } } void __attribute__((noinline)) MMU2::HelpUnloadToFinda() { extruder_move(-MMU2_RETRY_UNLOAD_TO_FINDA_LENGTH, MMU2_RETRY_UNLOAD_TO_FINDA_FEED_RATE); 2d418: 20 e0 ldi r18, 0x00 ; 0 2d41a: 30 e0 ldi r19, 0x00 ; 0 2d41c: 40 ea ldi r20, 0xA0 ; 160 2d41e: 52 e4 ldi r21, 0x42 ; 66 2d420: 60 e0 ldi r22, 0x00 ; 0 2d422: 70 e0 ldi r23, 0x00 ; 0 2d424: 80 ea ldi r24, 0xA0 ; 160 2d426: 92 ec ldi r25, 0xC2 ; 194 2d428: 0d 94 b1 c5 jmp 0x38b62 ; 0x38b62 0002d42c : void MMU2::Home(uint8_t mode) { logic.Home(mode); } void MMU2::SaveHotendTemp(bool turn_off_nozzle) { if (mmu_print_saved & SavedState::Cooldown) { 2d42c: 90 91 bb 13 lds r25, 0x13BB ; 0x8013bb 2d430: 91 fd sbrc r25, 1 2d432: 17 c0 rjmp .+46 ; 0x2d462 return; } if (turn_off_nozzle && !(mmu_print_saved & SavedState::CooldownPending)) { 2d434: 88 23 and r24, r24 2d436: a9 f0 breq .+42 ; 0x2d462 2d438: 92 fd sbrc r25, 2 2d43a: 13 c0 rjmp .+38 ; 0x2d462 Disable_E0(); 2d43c: 0f 94 af c5 call 0x38b5e ; 0x38b5e resume_hotend_temp = thermal_degTargetHotend(); 2d440: 80 91 b6 0d lds r24, 0x0DB6 ; 0x800db6 2d444: 90 91 b7 0d lds r25, 0x0DB7 ; 0x800db7 2d448: 90 93 b0 13 sts 0x13B0, r25 ; 0x8013b0 2d44c: 80 93 af 13 sts 0x13AF, r24 ; 0x8013af mmu_print_saved |= SavedState::CooldownPending; 2d450: 80 91 bb 13 lds r24, 0x13BB ; 0x8013bb 2d454: 84 60 ori r24, 0x04 ; 4 2d456: 80 93 bb 13 sts 0x13BB, r24 ; 0x8013bb LogEchoEvent_P(PSTR("Heater cooldown pending")); 2d45a: 8f ee ldi r24, 0xEF ; 239 2d45c: 97 ea ldi r25, 0xA7 ; 167 2d45e: 0d 94 d5 c5 jmp 0x38baa ; 0x38baa } } 2d462: 08 95 ret 0002d464 : ScreenClear(); } } void MMU2::ResumeUnpark() { if (mmu_print_saved & SavedState::ParkExtruder) { 2d464: 80 91 bb 13 lds r24, 0x13BB ; 0x8013bb 2d468: 80 ff sbrs r24, 0 2d46a: 47 c0 rjmp .+142 ; 0x2d4fa LogEchoEvent_P(PSTR("Resuming XYZ")); 2d46c: 87 e0 ldi r24, 0x07 ; 7 2d46e: 98 ea ldi r25, 0xA8 ; 168 2d470: 0f 94 d5 c5 call 0x38baa ; 0x38baa // 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)); 2d474: 80 91 a7 13 lds r24, 0x13A7 ; 0x8013a7 2d478: 90 91 a8 13 lds r25, 0x13A8 ; 0x8013a8 2d47c: a0 91 a9 13 lds r26, 0x13A9 ; 0x8013a9 2d480: b0 91 aa 13 lds r27, 0x13AA ; 0x8013aa 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; 2d484: 40 91 a3 13 lds r20, 0x13A3 ; 0x8013a3 2d488: 50 91 a4 13 lds r21, 0x13A4 ; 0x8013a4 2d48c: 60 91 a5 13 lds r22, 0x13A5 ; 0x8013a5 2d490: 70 91 a6 13 lds r23, 0x13A6 ; 0x8013a6 2d494: 40 93 92 06 sts 0x0692, r20 ; 0x800692 2d498: 50 93 93 06 sts 0x0693, r21 ; 0x800693 2d49c: 60 93 94 06 sts 0x0694, r22 ; 0x800694 2d4a0: 70 93 95 06 sts 0x0695, r23 ; 0x800695 current_position[Y_AXIS] = ry; 2d4a4: 80 93 96 06 sts 0x0696, r24 ; 0x800696 2d4a8: 90 93 97 06 sts 0x0697, r25 ; 0x800697 2d4ac: a0 93 98 06 sts 0x0698, r26 ; 0x800698 2d4b0: b0 93 99 06 sts 0x0699, r27 ; 0x800699 planner_line_to_current_position_sync(feedRate_mm_s); 2d4b4: 60 e0 ldi r22, 0x00 ; 0 2d4b6: 70 e0 ldi r23, 0x00 ; 0 2d4b8: 88 e4 ldi r24, 0x48 ; 72 2d4ba: 92 e4 ldi r25, 0x42 ; 66 2d4bc: 0f 94 d1 c5 call 0x38ba2 ; 0x38ba2 } void motion_do_blocking_move_to_z(float z, float feedRate_mm_s) { current_position[Z_AXIS] = z; 2d4c0: 80 91 ab 13 lds r24, 0x13AB ; 0x8013ab 2d4c4: 90 91 ac 13 lds r25, 0x13AC ; 0x8013ac 2d4c8: a0 91 ad 13 lds r26, 0x13AD ; 0x8013ad 2d4cc: b0 91 ae 13 lds r27, 0x13AE ; 0x8013ae 2d4d0: 80 93 9a 06 sts 0x069A, r24 ; 0x80069a 2d4d4: 90 93 9b 06 sts 0x069B, r25 ; 0x80069b 2d4d8: a0 93 9c 06 sts 0x069C, r26 ; 0x80069c 2d4dc: b0 93 9d 06 sts 0x069D, r27 ; 0x80069d planner_line_to_current_position_sync(feedRate_mm_s); 2d4e0: 60 e0 ldi r22, 0x00 ; 0 2d4e2: 70 e0 ldi r23, 0x00 ; 0 2d4e4: 80 e7 ldi r24, 0x70 ; 112 2d4e6: 91 e4 ldi r25, 0x41 ; 65 2d4e8: 0f 94 d1 c5 call 0x38ba2 ; 0x38ba2 void clear_print_state_in_ram() { // Set flag to false in order to avoid using // the saved values during power panic isPartialBackupAvailable = false; 2d4ec: 10 92 a2 06 sts 0x06A2, r1 ; 0x8006a2 // 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); 2d4f0: 80 91 bb 13 lds r24, 0x13BB ; 0x8013bb 2d4f4: 8e 7f andi r24, 0xFE ; 254 2d4f6: 80 93 bb 13 sts 0x13BB, r24 ; 0x8013bb } } 2d4fa: 08 95 ret 0002d4fc : mmu_print_saved |= SavedState::CooldownPending; LogEchoEvent_P(PSTR("Heater cooldown pending")); } } void MMU2::SaveAndPark(bool move_axes) { 2d4fc: 0f 93 push r16 2d4fe: 1f 93 push r17 2d500: cf 93 push r28 if (mmu_print_saved == SavedState::None) { // First occurrence. Save current position, park print head, disable nozzle heater. 2d502: 90 91 bb 13 lds r25, 0x13BB ; 0x8013bb 2d506: 91 11 cpse r25, r1 2d508: 72 c0 rjmp .+228 ; 0x2d5ee 2d50a: c8 2f mov r28, r24 LogEchoEvent_P(PSTR("Saving and parking")); 2d50c: 8c ed ldi r24, 0xDC ; 220 2d50e: 97 ea ldi r25, 0xA7 ; 167 2d510: 0f 94 d5 c5 call 0x38baa ; 0x38baa Disable_E0(); 2d514: 0f 94 af c5 call 0x38b5e ; 0x38b5e bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 2d518: 0f 94 e8 42 call 0x285d0 ; 0x285d0 /// 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; 2d51c: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 2d520: 81 11 cpse r24, r1 2d522: 02 c0 rjmp .+4 ; 0x2d528 2d524: 0e 94 49 64 call 0xc892 ; 0xc892 // 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) { 2d528: cc 23 and r28, r28 2d52a: 09 f4 brne .+2 ; 0x2d52e 2d52c: 60 c0 rjmp .+192 ; 0x2d5ee mmu_print_saved |= SavedState::ParkExtruder; 2d52e: 80 91 bb 13 lds r24, 0x13BB ; 0x8013bb 2d532: 81 60 ori r24, 0x01 ; 1 2d534: 80 93 bb 13 sts 0x13BB, r24 ; 0x8013bb 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]); 2d538: 80 91 9a 06 lds r24, 0x069A ; 0x80069a 2d53c: 90 91 9b 06 lds r25, 0x069B ; 0x80069b 2d540: a0 91 9c 06 lds r26, 0x069C ; 0x80069c 2d544: b0 91 9d 06 lds r27, 0x069D ; 0x80069d 2d548: 40 91 96 06 lds r20, 0x0696 ; 0x800696 2d54c: 50 91 97 06 lds r21, 0x0697 ; 0x800697 2d550: 60 91 98 06 lds r22, 0x0698 ; 0x800698 2d554: 70 91 99 06 lds r23, 0x0699 ; 0x800699 resume_position = planner_current_position(); // save current pos 2d558: 00 91 92 06 lds r16, 0x0692 ; 0x800692 2d55c: 10 91 93 06 lds r17, 0x0693 ; 0x800693 2d560: 20 91 94 06 lds r18, 0x0694 ; 0x800694 2d564: 30 91 95 06 lds r19, 0x0695 ; 0x800695 2d568: 00 93 a3 13 sts 0x13A3, r16 ; 0x8013a3 2d56c: 10 93 a4 13 sts 0x13A4, r17 ; 0x8013a4 2d570: 20 93 a5 13 sts 0x13A5, r18 ; 0x8013a5 2d574: 30 93 a6 13 sts 0x13A6, r19 ; 0x8013a6 2d578: 40 93 a7 13 sts 0x13A7, r20 ; 0x8013a7 2d57c: 50 93 a8 13 sts 0x13A8, r21 ; 0x8013a8 2d580: 60 93 a9 13 sts 0x13A9, r22 ; 0x8013a9 2d584: 70 93 aa 13 sts 0x13AA, r23 ; 0x8013aa 2d588: 80 93 ab 13 sts 0x13AB, r24 ; 0x8013ab 2d58c: 90 93 ac 13 sts 0x13AC, r25 ; 0x8013ac 2d590: a0 93 ad 13 sts 0x13AD, r26 ; 0x8013ad 2d594: b0 93 ae 13 sts 0x13AE, r27 ; 0x8013ae current_position[E_AXIS] += delta; planner_line_to_current_position(feedRate); } float move_raise_z(float delta) { return raise_z(delta); 2d598: 60 e0 ldi r22, 0x00 ; 0 2d59a: 70 e0 ldi r23, 0x00 ; 0 2d59c: 80 ea ldi r24, 0xA0 ; 160 2d59e: 91 e4 ldi r25, 0x41 ; 65 2d5a0: 0e 94 e1 6d call 0xdbc2 ; 0xdbc2 void Disable_E0() { disable_e0(); } bool all_axes_homed() { return axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]; 2d5a4: 80 91 8f 06 lds r24, 0x068F ; 0x80068f 2d5a8: 88 23 and r24, r24 2d5aa: 09 f1 breq .+66 ; 0x2d5ee 2d5ac: 80 91 90 06 lds r24, 0x0690 ; 0x800690 2d5b0: 88 23 and r24, r24 2d5b2: e9 f0 breq .+58 ; 0x2d5ee 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; 2d5b4: 80 e0 ldi r24, 0x00 ; 0 2d5b6: 90 e0 ldi r25, 0x00 ; 0 2d5b8: aa ef ldi r26, 0xFA ; 250 2d5ba: b2 e4 ldi r27, 0x42 ; 66 2d5bc: 80 93 92 06 sts 0x0692, r24 ; 0x800692 2d5c0: 90 93 93 06 sts 0x0693, r25 ; 0x800693 2d5c4: a0 93 94 06 sts 0x0694, r26 ; 0x800694 2d5c8: b0 93 95 06 sts 0x0695, r27 ; 0x800695 current_position[Y_AXIS] = MMU_ERR_Y_PAUSE_POS; 2d5cc: 10 92 96 06 sts 0x0696, r1 ; 0x800696 2d5d0: 10 92 97 06 sts 0x0697, r1 ; 0x800697 2d5d4: 10 92 98 06 sts 0x0698, r1 ; 0x800698 2d5d8: 10 92 99 06 sts 0x0699, r1 ; 0x800699 planner_line_to_current_position_sync(NOZZLE_PARK_XY_FEEDRATE); 2d5dc: 60 e0 ldi r22, 0x00 ; 0 2d5de: 70 e0 ldi r23, 0x00 ; 0 2d5e0: 88 e4 ldi r24, 0x48 ; 72 2d5e2: 92 e4 ldi r25, 0x42 ; 66 if (all_axes_homed()) { nozzle_park(); } } } } 2d5e4: cf 91 pop r28 2d5e6: 1f 91 pop r17 2d5e8: 0f 91 pop r16 2d5ea: 0d 94 d1 c5 jmp 0x38ba2 ; 0x38ba2 2d5ee: cf 91 pop r28 2d5f0: 1f 91 pop r17 2d5f2: 0f 91 pop r16 2d5f4: 08 95 ret 0002d5f6 : /// 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){ 2d5f6: 2f 92 push r2 2d5f8: 3f 92 push r3 2d5fa: 4f 92 push r4 2d5fc: 5f 92 push r5 2d5fe: 6f 92 push r6 2d600: 7f 92 push r7 2d602: 8f 92 push r8 2d604: 9f 92 push r9 2d606: af 92 push r10 2d608: bf 92 push r11 2d60a: cf 92 push r12 2d60c: df 92 push r13 2d60e: ef 92 push r14 2d610: ff 92 push r15 2d612: 0f 93 push r16 2d614: 1f 93 push r17 2d616: cf 93 push r28 2d618: df 93 push r29 2d61a: cd b7 in r28, 0x3d ; 61 2d61c: de b7 in r29, 0x3e ; 62 2d61e: cd 5b subi r28, 0xBD ; 189 2d620: d1 40 sbci r29, 0x01 ; 1 2d622: 0f b6 in r0, 0x3f ; 63 2d624: f8 94 cli 2d626: de bf out 0x3e, r29 ; 62 2d628: 0f be out 0x3f, r0 ; 63 2d62a: cd bf out 0x3d, r28 ; 61 2d62c: c3 57 subi r28, 0x73 ; 115 2d62e: de 4f sbci r29, 0xFE ; 254 2d630: 99 83 std Y+1, r25 ; 0x01 2d632: 88 83 st Y, r24 2d634: cd 58 subi r28, 0x8D ; 141 2d636: d1 40 sbci r29, 0x01 ; 1 2d638: c1 57 subi r28, 0x71 ; 113 2d63a: de 4f sbci r29, 0xFE ; 254 2d63c: 79 83 std Y+1, r23 ; 0x01 2d63e: 68 83 st Y, r22 2d640: cf 58 subi r28, 0x8F ; 143 2d642: d1 40 sbci r29, 0x01 ; 1 2d644: ce 56 subi r28, 0x6E ; 110 2d646: de 4f sbci r29, 0xFE ; 254 2d648: 59 83 std Y+1, r21 ; 0x01 2d64a: 48 83 st Y, r20 2d64c: c2 59 subi r28, 0x92 ; 146 2d64e: d1 40 sbci r29, 0x01 ; 1 2d650: 84 e1 ldi r24, 0x14 ; 20 2d652: cf 56 subi r28, 0x6F ; 111 2d654: de 4f sbci r29, 0xFE ; 254 2d656: 88 83 st Y, r24 2d658: c1 59 subi r28, 0x91 ; 145 2d65a: 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; 2d65c: ce 56 subi r28, 0x6E ; 110 2d65e: de 4f sbci r29, 0xFE ; 254 2d660: a8 81 ld r26, Y 2d662: b9 81 ldd r27, Y+1 ; 0x01 2d664: c2 59 subi r28, 0x92 ; 146 2d666: d1 40 sbci r29, 0x01 ; 1 2d668: 8d 91 ld r24, X+ 2d66a: 9d 91 ld r25, X+ 2d66c: 0d 90 ld r0, X+ 2d66e: bc 91 ld r27, X 2d670: a0 2d mov r26, r0 2d672: c6 56 subi r28, 0x66 ; 102 2d674: de 4f sbci r29, 0xFE ; 254 2d676: 88 83 st Y, r24 2d678: 99 83 std Y+1, r25 ; 0x01 2d67a: aa 83 std Y+2, r26 ; 0x02 2d67c: bb 83 std Y+3, r27 ; 0x03 2d67e: ca 59 subi r28, 0x9A ; 154 2d680: d1 40 sbci r29, 0x01 ; 1 2d682: c1 57 subi r28, 0x71 ; 113 2d684: de 4f sbci r29, 0xFE ; 254 2d686: a8 81 ld r26, Y 2d688: b9 81 ldd r27, Y+1 ; 0x01 2d68a: cf 58 subi r28, 0x8F ; 143 2d68c: d1 40 sbci r29, 0x01 ; 1 2d68e: 8d 91 ld r24, X+ 2d690: 9d 91 ld r25, X+ 2d692: 0d 90 ld r0, X+ 2d694: bc 91 ld r27, X 2d696: a0 2d mov r26, r0 2d698: ca 54 subi r28, 0x4A ; 74 2d69a: de 4f sbci r29, 0xFE ; 254 2d69c: 88 83 st Y, r24 2d69e: 99 83 std Y+1, r25 ; 0x01 2d6a0: aa 83 std Y+2, r26 ; 0x02 2d6a2: bb 83 std Y+3, r27 ; 0x03 2d6a4: c6 5b subi r28, 0xB6 ; 182 2d6a6: d1 40 sbci r29, 0x01 ; 1 2d6a8: c3 57 subi r28, 0x73 ; 115 2d6aa: de 4f sbci r29, 0xFE ; 254 2d6ac: a8 81 ld r26, Y 2d6ae: b9 81 ldd r27, Y+1 ; 0x01 2d6b0: cd 58 subi r28, 0x8D ; 141 2d6b2: d1 40 sbci r29, 0x01 ; 1 2d6b4: 8d 91 ld r24, X+ 2d6b6: 9d 91 ld r25, X+ 2d6b8: 0d 90 ld r0, X+ 2d6ba: bc 91 ld r27, X 2d6bc: a0 2d mov r26, r0 2d6be: c6 54 subi r28, 0x46 ; 70 2d6c0: de 4f sbci r29, 0xFE ; 254 2d6c2: 88 83 st Y, r24 2d6c4: 99 83 std Y+1, r25 ; 0x01 2d6c6: aa 83 std Y+2, r26 ; 0x02 2d6c8: bb 83 std Y+3, r27 ; 0x03 2d6ca: ca 5b subi r28, 0xBA ; 186 2d6cc: d1 40 sbci r29, 0x01 ; 1 2d6ce: fe 01 movw r30, r28 2d6d0: e7 5f subi r30, 0xF7 ; 247 2d6d2: fe 4f sbci r31, 0xFE ; 254 2d6d4: c8 55 subi r28, 0x58 ; 88 2d6d6: de 4f sbci r29, 0xFE ; 254 2d6d8: f9 83 std Y+1, r31 ; 0x01 2d6da: e8 83 st Y, r30 2d6dc: c8 5a subi r28, 0xA8 ; 168 2d6de: d1 40 sbci r29, 0x01 ; 1 2d6e0: ce 01 movw r24, r28 2d6e2: 8b 57 subi r24, 0x7B ; 123 2d6e4: 9f 4f sbci r25, 0xFF ; 255 2d6e6: ca 55 subi r28, 0x5A ; 90 2d6e8: de 4f sbci r29, 0xFE ; 254 2d6ea: 99 83 std Y+1, r25 ; 0x01 2d6ec: 88 83 st Y, r24 2d6ee: c6 5a subi r28, 0xA6 ; 166 2d6f0: d1 40 sbci r29, 0x01 ; 1 2d6f2: de 01 movw r26, r28 2d6f4: 11 96 adiw r26, 0x01 ; 1 2d6f6: c8 56 subi r28, 0x68 ; 104 2d6f8: de 4f sbci r29, 0xFE ; 254 2d6fa: b9 83 std Y+1, r27 ; 0x01 2d6fc: a8 83 st Y, r26 2d6fe: c8 59 subi r28, 0x98 ; 152 2d700: d1 40 sbci r29, 0x01 ; 1 2d702: 31 2c mov r3, r1 2d704: 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; 2d706: b1 01 movw r22, r2 2d708: 03 2c mov r0, r3 2d70a: 00 0c add r0, r0 2d70c: 88 0b sbc r24, r24 2d70e: 99 0b sbc r25, r25 2d710: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 2d714: 2a e1 ldi r18, 0x1A ; 26 2d716: 38 ef ldi r19, 0xF8 ; 248 2d718: 42 e4 ldi r20, 0x42 ; 66 2d71a: 5e e3 ldi r21, 0x3E ; 62 2d71c: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 2d720: 6b 01 movw r12, r22 2d722: 7c 01 movw r14, r24 const float height = get_value(matrix_32x32, r * cos(angle) + x, r * sin(angle) + y) - target_z; 2d724: 0f 94 04 e1 call 0x3c208 ; 0x3c208 2d728: c2 56 subi r28, 0x62 ; 98 2d72a: de 4f sbci r29, 0xFE ; 254 2d72c: 68 83 st Y, r22 2d72e: 79 83 std Y+1, r23 ; 0x01 2d730: 8a 83 std Y+2, r24 ; 0x02 2d732: 9b 83 std Y+3, r25 ; 0x03 2d734: ce 59 subi r28, 0x9E ; 158 2d736: d1 40 sbci r29, 0x01 ; 1 2d738: c7 01 movw r24, r14 2d73a: b6 01 movw r22, r12 2d73c: 0f 94 3e de call 0x3bc7c ; 0x3bc7c 2d740: ce 55 subi r28, 0x5E ; 94 2d742: de 4f sbci r29, 0xFE ; 254 2d744: 68 83 st Y, r22 2d746: 79 83 std Y+1, r23 ; 0x01 2d748: 8a 83 std Y+2, r24 ; 0x02 2d74a: 9b 83 std Y+3, r25 ; 0x03 2d74c: c2 5a subi r28, 0xA2 ; 162 2d74e: d1 40 sbci r29, 0x01 ; 1 2d750: 9b 01 movw r18, r22 2d752: ac 01 movw r20, r24 2d754: c6 56 subi r28, 0x66 ; 102 2d756: de 4f sbci r29, 0xFE ; 254 2d758: 68 81 ld r22, Y 2d75a: 79 81 ldd r23, Y+1 ; 0x01 2d75c: 8a 81 ldd r24, Y+2 ; 0x02 2d75e: 9b 81 ldd r25, Y+3 ; 0x03 2d760: ca 59 subi r28, 0x9A ; 154 2d762: d1 40 sbci r29, 0x01 ; 1 2d764: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 2d768: c6 54 subi r28, 0x46 ; 70 2d76a: de 4f sbci r29, 0xFE ; 254 2d76c: 28 81 ld r18, Y 2d76e: 39 81 ldd r19, Y+1 ; 0x01 2d770: 4a 81 ldd r20, Y+2 ; 0x02 2d772: 5b 81 ldd r21, Y+3 ; 0x03 2d774: ca 5b subi r28, 0xBA ; 186 2d776: d1 40 sbci r29, 0x01 ; 1 2d778: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 2d77c: 6b 01 movw r12, r22 2d77e: 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) 2d780: 20 e0 ldi r18, 0x00 ; 0 2d782: 30 e0 ldi r19, 0x00 ; 0 2d784: a9 01 movw r20, r18 2d786: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 2d78a: 18 16 cp r1, r24 2d78c: 0c f0 brlt .+2 ; 0x2d790 2d78e: 7a c2 rjmp .+1268 ; 0x2dc84 // 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; 2d790: c2 56 subi r28, 0x62 ; 98 2d792: de 4f sbci r29, 0xFE ; 254 2d794: 28 81 ld r18, Y 2d796: 39 81 ldd r19, Y+1 ; 0x01 2d798: 4a 81 ldd r20, Y+2 ; 0x02 2d79a: 5b 81 ldd r21, Y+3 ; 0x03 2d79c: ce 59 subi r28, 0x9E ; 158 2d79e: d1 40 sbci r29, 0x01 ; 1 2d7a0: c6 56 subi r28, 0x66 ; 102 2d7a2: de 4f sbci r29, 0xFE ; 254 2d7a4: 68 81 ld r22, Y 2d7a6: 79 81 ldd r23, Y+1 ; 0x01 2d7a8: 8a 81 ldd r24, Y+2 ; 0x02 2d7aa: 9b 81 ldd r25, Y+3 ; 0x03 2d7ac: ca 59 subi r28, 0x9A ; 154 2d7ae: d1 40 sbci r29, 0x01 ; 1 2d7b0: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 2d7b4: ca 54 subi r28, 0x4A ; 74 2d7b6: de 4f sbci r29, 0xFE ; 254 2d7b8: 28 81 ld r18, Y 2d7ba: 39 81 ldd r19, Y+1 ; 0x01 2d7bc: 4a 81 ldd r20, Y+2 ; 0x02 2d7be: 5b 81 ldd r21, Y+3 ; 0x03 2d7c0: c6 5b subi r28, 0xB6 ; 182 2d7c2: d1 40 sbci r29, 0x01 ; 1 2d7c4: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 2d7c8: 4b 01 movw r8, r22 2d7ca: 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) 2d7cc: 20 e0 ldi r18, 0x00 ; 0 2d7ce: 30 e0 ldi r19, 0x00 ; 0 2d7d0: a9 01 movw r20, r18 2d7d2: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 2d7d6: 18 16 cp r1, r24 2d7d8: 0c f0 brlt .+2 ; 0x2d7dc 2d7da: 54 c2 rjmp .+1192 ; 0x2dc84 2d7dc: 20 e0 ldi r18, 0x00 ; 0 2d7de: 30 e0 ldi r19, 0x00 ; 0 2d7e0: 48 ef ldi r20, 0xF8 ; 248 2d7e2: 51 e4 ldi r21, 0x41 ; 65 2d7e4: c7 01 movw r24, r14 2d7e6: b6 01 movw r22, r12 2d7e8: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 2d7ec: 87 ff sbrs r24, 7 2d7ee: 4a c2 rjmp .+1172 ; 0x2dc84 2d7f0: 20 e0 ldi r18, 0x00 ; 0 2d7f2: 30 e0 ldi r19, 0x00 ; 0 2d7f4: 48 ef ldi r20, 0xF8 ; 248 2d7f6: 51 e4 ldi r21, 0x41 ; 65 2d7f8: c5 01 movw r24, r10 2d7fa: b4 01 movw r22, r8 2d7fc: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 2d800: 87 ff sbrs r24, 7 2d802: 40 c2 rjmp .+1152 ; 0x2dc84 return 0; /// calculate weights of nearby points const float wc1 = c - floor(c); 2d804: c7 01 movw r24, r14 2d806: b6 01 movw r22, r12 2d808: 0f 94 eb de call 0x3bdd6 ; 0x3bdd6 2d80c: 9b 01 movw r18, r22 2d80e: ac 01 movw r20, r24 2d810: c7 01 movw r24, r14 2d812: b6 01 movw r22, r12 2d814: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 2d818: 2b 01 movw r4, r22 2d81a: 3c 01 movw r6, r24 const float wr1 = r - floor(r); 2d81c: c5 01 movw r24, r10 2d81e: b4 01 movw r22, r8 2d820: 0f 94 eb de call 0x3bdd6 ; 0x3bdd6 2d824: 9b 01 movw r18, r22 2d826: ac 01 movw r20, r24 2d828: c5 01 movw r24, r10 2d82a: b4 01 movw r22, r8 2d82c: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 2d830: cc 56 subi r28, 0x6C ; 108 2d832: de 4f sbci r29, 0xFE ; 254 2d834: 68 83 st Y, r22 2d836: 79 83 std Y+1, r23 ; 0x01 2d838: 8a 83 std Y+2, r24 ; 0x02 2d83a: 9b 83 std Y+3, r25 ; 0x03 2d83c: c4 59 subi r28, 0x94 ; 148 2d83e: d1 40 sbci r29, 0x01 ; 1 const float wc0 = 1 - wc1; 2d840: a3 01 movw r20, r6 2d842: 92 01 movw r18, r4 2d844: 60 e0 ldi r22, 0x00 ; 0 2d846: 70 e0 ldi r23, 0x00 ; 0 2d848: 80 e8 ldi r24, 0x80 ; 128 2d84a: 9f e3 ldi r25, 0x3F ; 63 2d84c: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 2d850: c2 55 subi r28, 0x52 ; 82 2d852: de 4f sbci r29, 0xFE ; 254 2d854: 68 83 st Y, r22 2d856: 79 83 std Y+1, r23 ; 0x01 2d858: 8a 83 std Y+2, r24 ; 0x02 2d85a: 9b 83 std Y+3, r25 ; 0x03 2d85c: ce 5a subi r28, 0xAE ; 174 2d85e: d1 40 sbci r29, 0x01 ; 1 const float wr0 = 1 - wr1; 2d860: cc 56 subi r28, 0x6C ; 108 2d862: de 4f sbci r29, 0xFE ; 254 2d864: 28 81 ld r18, Y 2d866: 39 81 ldd r19, Y+1 ; 0x01 2d868: 4a 81 ldd r20, Y+2 ; 0x02 2d86a: 5b 81 ldd r21, Y+3 ; 0x03 2d86c: c4 59 subi r28, 0x94 ; 148 2d86e: d1 40 sbci r29, 0x01 ; 1 2d870: 60 e0 ldi r22, 0x00 ; 0 2d872: 70 e0 ldi r23, 0x00 ; 0 2d874: 80 e8 ldi r24, 0x80 ; 128 2d876: 9f e3 ldi r25, 0x3F ; 63 2d878: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 2d87c: ce 54 subi r28, 0x4E ; 78 2d87e: de 4f sbci r29, 0xFE ; 254 2d880: 68 83 st Y, r22 2d882: 79 83 std Y+1, r23 ; 0x01 2d884: 8a 83 std Y+2, r24 ; 0x02 2d886: 9b 83 std Y+3, r25 ; 0x03 2d888: c2 5b subi r28, 0xB2 ; 178 2d88a: 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; 2d88c: c7 01 movw r24, r14 2d88e: b6 01 movw r22, r12 2d890: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 2d894: 6b 01 movw r12, r22 const uint16_t c1 = c0 + 1; 2d896: fb 01 movw r30, r22 2d898: 31 96 adiw r30, 0x01 ; 1 2d89a: c6 55 subi r28, 0x56 ; 86 2d89c: de 4f sbci r29, 0xFE ; 254 2d89e: f9 83 std Y+1, r31 ; 0x01 2d8a0: e8 83 st Y, r30 2d8a2: ca 5a subi r28, 0xAA ; 170 2d8a4: d1 40 sbci r29, 0x01 ; 1 const uint16_t r0 = r; 2d8a6: c5 01 movw r24, r10 2d8a8: b4 01 movw r22, r8 2d8aa: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> const uint16_t r1 = r0 + 1; const uint16_t idx00 = c0 + 32 * r0; 2d8ae: 8b 01 movw r16, r22 2d8b0: 95 e0 ldi r25, 0x05 ; 5 2d8b2: 00 0f add r16, r16 2d8b4: 11 1f adc r17, r17 2d8b6: 9a 95 dec r25 2d8b8: e1 f7 brne .-8 ; 0x2d8b2 const uint16_t idx01 = c0 + 32 * r1; 2d8ba: c8 01 movw r24, r16 2d8bc: 80 96 adiw r24, 0x20 ; 32 2d8be: c4 55 subi r28, 0x54 ; 84 2d8c0: de 4f sbci r29, 0xFE ; 254 2d8c2: 99 83 std Y+1, r25 ; 0x01 2d8c4: 88 83 st Y, r24 2d8c6: cc 5a subi r28, 0xAC ; 172 2d8c8: 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]; 2d8ca: f8 01 movw r30, r16 2d8cc: ec 0d add r30, r12 2d8ce: fd 1d adc r31, r13 2d8d0: eb 53 subi r30, 0x3B ; 59 2d8d2: f9 4f sbci r31, 0xF9 ; 249 2d8d4: 60 81 ld r22, Z 2d8d6: 70 e0 ldi r23, 0x00 ; 0 2d8d8: 90 e0 ldi r25, 0x00 ; 0 2d8da: 80 e0 ldi r24, 0x00 ; 0 2d8dc: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 2d8e0: 4b 01 movw r8, r22 2d8e2: 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; 2d8e4: ce 54 subi r28, 0x4E ; 78 2d8e6: de 4f sbci r29, 0xFE ; 254 2d8e8: 28 81 ld r18, Y 2d8ea: 39 81 ldd r19, Y+1 ; 0x01 2d8ec: 4a 81 ldd r20, Y+2 ; 0x02 2d8ee: 5b 81 ldd r21, Y+3 ; 0x03 2d8f0: c2 5b subi r28, 0xB2 ; 178 2d8f2: d1 40 sbci r29, 0x01 ; 1 2d8f4: c2 55 subi r28, 0x52 ; 82 2d8f6: de 4f sbci r29, 0xFE ; 254 2d8f8: 68 81 ld r22, Y 2d8fa: 79 81 ldd r23, Y+1 ; 0x01 2d8fc: 8a 81 ldd r24, Y+2 ; 0x02 2d8fe: 9b 81 ldd r25, Y+3 ; 0x03 2d900: ce 5a subi r28, 0xAE ; 174 2d902: d1 40 sbci r29, 0x01 ; 1 2d904: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 2d908: 9b 01 movw r18, r22 2d90a: 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]; 2d90c: c5 01 movw r24, r10 2d90e: b4 01 movw r22, r8 2d910: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 2d914: 4b 01 movw r8, r22 2d916: 5c 01 movw r10, r24 2d918: c4 55 subi r28, 0x54 ; 84 2d91a: de 4f sbci r29, 0xFE ; 254 2d91c: e8 81 ld r30, Y 2d91e: f9 81 ldd r31, Y+1 ; 0x01 2d920: cc 5a subi r28, 0xAC ; 172 2d922: d1 40 sbci r29, 0x01 ; 1 2d924: ec 0d add r30, r12 2d926: fd 1d adc r31, r13 2d928: eb 53 subi r30, 0x3B ; 59 2d92a: f9 4f sbci r31, 0xF9 ; 249 2d92c: 60 81 ld r22, Z 2d92e: 70 e0 ldi r23, 0x00 ; 0 2d930: 90 e0 ldi r25, 0x00 ; 0 2d932: 80 e0 ldi r24, 0x00 ; 0 2d934: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 2d938: 6b 01 movw r12, r22 2d93a: 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; 2d93c: c2 55 subi r28, 0x52 ; 82 2d93e: de 4f sbci r29, 0xFE ; 254 2d940: 28 81 ld r18, Y 2d942: 39 81 ldd r19, Y+1 ; 0x01 2d944: 4a 81 ldd r20, Y+2 ; 0x02 2d946: 5b 81 ldd r21, Y+3 ; 0x03 2d948: ce 5a subi r28, 0xAE ; 174 2d94a: d1 40 sbci r29, 0x01 ; 1 2d94c: cc 56 subi r28, 0x6C ; 108 2d94e: de 4f sbci r29, 0xFE ; 254 2d950: 68 81 ld r22, Y 2d952: 79 81 ldd r23, Y+1 ; 0x01 2d954: 8a 81 ldd r24, Y+2 ; 0x02 2d956: 9b 81 ldd r25, Y+3 ; 0x03 2d958: c4 59 subi r28, 0x94 ; 148 2d95a: d1 40 sbci r29, 0x01 ; 1 2d95c: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 2d960: 9b 01 movw r18, r22 2d962: 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]; 2d964: c7 01 movw r24, r14 2d966: b6 01 movw r22, r12 2d968: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 2d96c: 9b 01 movw r18, r22 2d96e: ac 01 movw r20, r24 2d970: c5 01 movw r24, r10 2d972: b4 01 movw r22, r8 2d974: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 2d978: 6b 01 movw r12, r22 2d97a: 7c 01 movw r14, r24 2d97c: c6 55 subi r28, 0x56 ; 86 2d97e: de 4f sbci r29, 0xFE ; 254 2d980: a8 81 ld r26, Y 2d982: b9 81 ldd r27, Y+1 ; 0x01 2d984: ca 5a subi r28, 0xAA ; 170 2d986: d1 40 sbci r29, 0x01 ; 1 2d988: 0a 0f add r16, r26 2d98a: 1b 1f adc r17, r27 2d98c: f8 01 movw r30, r16 2d98e: eb 53 subi r30, 0x3B ; 59 2d990: f9 4f sbci r31, 0xF9 ; 249 2d992: 60 81 ld r22, Z 2d994: 70 e0 ldi r23, 0x00 ; 0 2d996: 90 e0 ldi r25, 0x00 ; 0 2d998: 80 e0 ldi r24, 0x00 ; 0 2d99a: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 2d99e: 4b 01 movw r8, r22 2d9a0: 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; 2d9a2: ce 54 subi r28, 0x4E ; 78 2d9a4: de 4f sbci r29, 0xFE ; 254 2d9a6: 28 81 ld r18, Y 2d9a8: 39 81 ldd r19, Y+1 ; 0x01 2d9aa: 4a 81 ldd r20, Y+2 ; 0x02 2d9ac: 5b 81 ldd r21, Y+3 ; 0x03 2d9ae: c2 5b subi r28, 0xB2 ; 178 2d9b0: d1 40 sbci r29, 0x01 ; 1 2d9b2: c3 01 movw r24, r6 2d9b4: b2 01 movw r22, r4 2d9b6: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 2d9ba: 9b 01 movw r18, r22 2d9bc: 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]; 2d9be: c5 01 movw r24, r10 2d9c0: b4 01 movw r22, r8 2d9c2: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 2d9c6: 9b 01 movw r18, r22 2d9c8: ac 01 movw r20, r24 2d9ca: c7 01 movw r24, r14 2d9cc: b6 01 movw r22, r12 2d9ce: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 2d9d2: 6b 01 movw r12, r22 2d9d4: 7c 01 movw r14, r24 2d9d6: c6 55 subi r28, 0x56 ; 86 2d9d8: de 4f sbci r29, 0xFE ; 254 2d9da: e8 81 ld r30, Y 2d9dc: f9 81 ldd r31, Y+1 ; 0x01 2d9de: ca 5a subi r28, 0xAA ; 170 2d9e0: d1 40 sbci r29, 0x01 ; 1 2d9e2: c4 55 subi r28, 0x54 ; 84 2d9e4: de 4f sbci r29, 0xFE ; 254 2d9e6: 88 81 ld r24, Y 2d9e8: 99 81 ldd r25, Y+1 ; 0x01 2d9ea: cc 5a subi r28, 0xAC ; 172 2d9ec: d1 40 sbci r29, 0x01 ; 1 2d9ee: e8 0f add r30, r24 2d9f0: f9 1f adc r31, r25 2d9f2: eb 53 subi r30, 0x3B ; 59 2d9f4: f9 4f sbci r31, 0xF9 ; 249 2d9f6: 60 81 ld r22, Z 2d9f8: 70 e0 ldi r23, 0x00 ; 0 2d9fa: 90 e0 ldi r25, 0x00 ; 0 2d9fc: 80 e0 ldi r24, 0x00 ; 0 2d9fe: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 2da02: 4b 01 movw r8, r22 2da04: 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; 2da06: cc 56 subi r28, 0x6C ; 108 2da08: de 4f sbci r29, 0xFE ; 254 2da0a: 28 81 ld r18, Y 2da0c: 39 81 ldd r19, Y+1 ; 0x01 2da0e: 4a 81 ldd r20, Y+2 ; 0x02 2da10: 5b 81 ldd r21, Y+3 ; 0x03 2da12: c4 59 subi r28, 0x94 ; 148 2da14: d1 40 sbci r29, 0x01 ; 1 2da16: c3 01 movw r24, r6 2da18: b2 01 movw r22, r4 2da1a: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 2da1e: 9b 01 movw r18, r22 2da20: 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]; 2da22: c5 01 movw r24, r10 2da24: b4 01 movw r22, r8 2da26: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 2da2a: 9b 01 movw r18, r22 2da2c: ac 01 movw r20, r24 2da2e: c7 01 movw r24, r14 2da30: b6 01 movw r22, r12 2da32: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__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; 2da36: 20 e0 ldi r18, 0x00 ; 0 2da38: 30 e0 ldi r19, 0x00 ; 0 2da3a: 40 e0 ldi r20, 0x00 ; 0 2da3c: 52 e4 ldi r21, 0x42 ; 66 2da3e: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 2da42: 6b 01 movw r12, r22 2da44: 7c 01 movw r14, r24 // DBG(_n("%f "), point); shifts_x[p] = cos(angle) * height; 2da46: ac 01 movw r20, r24 2da48: 9b 01 movw r18, r22 2da4a: ce 55 subi r28, 0x5E ; 94 2da4c: de 4f sbci r29, 0xFE ; 254 2da4e: 68 81 ld r22, Y 2da50: 79 81 ldd r23, Y+1 ; 0x01 2da52: 8a 81 ldd r24, Y+2 ; 0x02 2da54: 9b 81 ldd r25, Y+3 ; 0x03 2da56: c2 5a subi r28, 0xA2 ; 162 2da58: d1 40 sbci r29, 0x01 ; 1 2da5a: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 2da5e: c8 55 subi r28, 0x58 ; 88 2da60: de 4f sbci r29, 0xFE ; 254 2da62: a8 81 ld r26, Y 2da64: b9 81 ldd r27, Y+1 ; 0x01 2da66: c8 5a subi r28, 0xA8 ; 168 2da68: d1 40 sbci r29, 0x01 ; 1 2da6a: 6d 93 st X+, r22 2da6c: 7d 93 st X+, r23 2da6e: 8d 93 st X+, r24 2da70: 9d 93 st X+, r25 2da72: c8 55 subi r28, 0x58 ; 88 2da74: de 4f sbci r29, 0xFE ; 254 2da76: b9 83 std Y+1, r27 ; 0x01 2da78: a8 83 st Y, r26 2da7a: c8 5a subi r28, 0xA8 ; 168 2da7c: d1 40 sbci r29, 0x01 ; 1 shifts_y[p] = sin(angle) * height; 2da7e: a7 01 movw r20, r14 2da80: 96 01 movw r18, r12 2da82: c2 56 subi r28, 0x62 ; 98 2da84: de 4f sbci r29, 0xFE ; 254 2da86: 68 81 ld r22, Y 2da88: 79 81 ldd r23, Y+1 ; 0x01 2da8a: 8a 81 ldd r24, Y+2 ; 0x02 2da8c: 9b 81 ldd r25, Y+3 ; 0x03 2da8e: ce 59 subi r28, 0x9E ; 158 2da90: d1 40 sbci r29, 0x01 ; 1 2da92: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 2da96: ca 55 subi r28, 0x5A ; 90 2da98: de 4f sbci r29, 0xFE ; 254 2da9a: e8 81 ld r30, Y 2da9c: f9 81 ldd r31, Y+1 ; 0x01 2da9e: c6 5a subi r28, 0xA6 ; 166 2daa0: d1 40 sbci r29, 0x01 ; 1 2daa2: 61 93 st Z+, r22 2daa4: 71 93 st Z+, r23 2daa6: 81 93 st Z+, r24 2daa8: 91 93 st Z+, r25 2daaa: ca 55 subi r28, 0x5A ; 90 2daac: de 4f sbci r29, 0xFE ; 254 2daae: f9 83 std Y+1, r31 ; 0x01 2dab0: e8 83 st Y, r30 2dab2: c6 5a subi r28, 0xA6 ; 166 2dab4: d1 40 sbci r29, 0x01 ; 1 shifts_r[p] = height; 2dab6: c8 56 subi r28, 0x68 ; 104 2dab8: de 4f sbci r29, 0xFE ; 254 2daba: a8 81 ld r26, Y 2dabc: b9 81 ldd r27, Y+1 ; 0x01 2dabe: c8 59 subi r28, 0x98 ; 152 2dac0: d1 40 sbci r29, 0x01 ; 1 2dac2: cd 92 st X+, r12 2dac4: dd 92 st X+, r13 2dac6: ed 92 st X+, r14 2dac8: fd 92 st X+, r15 2daca: c8 56 subi r28, 0x68 ; 104 2dacc: de 4f sbci r29, 0xFE ; 254 2dace: b9 83 std Y+1, r27 ; 0x01 2dad0: a8 83 st Y, r26 2dad2: c8 59 subi r28, 0x98 ; 152 2dad4: d1 40 sbci r29, 0x01 ; 1 2dad6: bf ef ldi r27, 0xFF ; 255 2dad8: 2b 1a sub r2, r27 2dada: 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){ 2dadc: e1 e2 ldi r30, 0x21 ; 33 2dade: 2e 16 cp r2, r30 2dae0: 31 04 cpc r3, r1 2dae2: 09 f0 breq .+2 ; 0x2dae6 2dae4: 10 ce rjmp .-992 ; 0x2d706 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); 2dae6: 40 e0 ldi r20, 0x00 ; 0 2dae8: 50 e0 ldi r21, 0x00 ; 0 2daea: 60 e0 ldi r22, 0x00 ; 0 2daec: 7d e3 ldi r23, 0x3D ; 61 2daee: ce 01 movw r24, r28 2daf0: 87 5f subi r24, 0xF7 ; 247 2daf2: 9e 4f sbci r25, 0xFE ; 254 2daf4: 0f 94 f7 64 call 0x2c9ee ; 0x2c9ee 2daf8: 9b 01 movw r18, r22 2dafa: ac 01 movw r20, r24 2dafc: c3 57 subi r28, 0x73 ; 115 2dafe: de 4f sbci r29, 0xFE ; 254 2db00: a8 81 ld r26, Y 2db02: b9 81 ldd r27, Y+1 ; 0x01 2db04: cd 58 subi r28, 0x8D ; 141 2db06: d1 40 sbci r29, 0x01 ; 1 2db08: 6d 91 ld r22, X+ 2db0a: 7d 91 ld r23, X+ 2db0c: 8d 91 ld r24, X+ 2db0e: 9c 91 ld r25, X 2db10: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 2db14: c3 57 subi r28, 0x73 ; 115 2db16: de 4f sbci r29, 0xFE ; 254 2db18: e8 81 ld r30, Y 2db1a: f9 81 ldd r31, Y+1 ; 0x01 2db1c: cd 58 subi r28, 0x8D ; 141 2db1e: d1 40 sbci r29, 0x01 ; 1 2db20: 60 83 st Z, r22 2db22: 71 83 std Z+1, r23 ; 0x01 2db24: 82 83 std Z+2, r24 ; 0x02 2db26: 93 83 std Z+3, r25 ; 0x03 y += CLAMP_median(shifts_y, blocks, norm); 2db28: 40 e0 ldi r20, 0x00 ; 0 2db2a: 50 e0 ldi r21, 0x00 ; 0 2db2c: 60 e0 ldi r22, 0x00 ; 0 2db2e: 7d e3 ldi r23, 0x3D ; 61 2db30: ce 01 movw r24, r28 2db32: 8b 57 subi r24, 0x7B ; 123 2db34: 9f 4f sbci r25, 0xFF ; 255 2db36: 0f 94 f7 64 call 0x2c9ee ; 0x2c9ee 2db3a: 9b 01 movw r18, r22 2db3c: ac 01 movw r20, r24 2db3e: c1 57 subi r28, 0x71 ; 113 2db40: de 4f sbci r29, 0xFE ; 254 2db42: a8 81 ld r26, Y 2db44: b9 81 ldd r27, Y+1 ; 0x01 2db46: cf 58 subi r28, 0x8F ; 143 2db48: d1 40 sbci r29, 0x01 ; 1 2db4a: 6d 91 ld r22, X+ 2db4c: 7d 91 ld r23, X+ 2db4e: 8d 91 ld r24, X+ 2db50: 9c 91 ld r25, X 2db52: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 2db56: c1 57 subi r28, 0x71 ; 113 2db58: de 4f sbci r29, 0xFE ; 254 2db5a: e8 81 ld r30, Y 2db5c: f9 81 ldd r31, Y+1 ; 0x01 2db5e: cf 58 subi r28, 0x8F ; 143 2db60: d1 40 sbci r29, 0x01 ; 1 2db62: 60 83 st Z, r22 2db64: 71 83 std Z+1, r23 ; 0x01 2db66: 82 83 std Z+2, r24 ; 0x02 2db68: 93 83 std Z+3, r25 ; 0x03 r += CLAMP_median(shifts_r, blocks, norm * .5f); 2db6a: 40 e0 ldi r20, 0x00 ; 0 2db6c: 50 e0 ldi r21, 0x00 ; 0 2db6e: 60 e8 ldi r22, 0x80 ; 128 2db70: 7c e3 ldi r23, 0x3C ; 60 2db72: ce 01 movw r24, r28 2db74: 01 96 adiw r24, 0x01 ; 1 2db76: 0f 94 f7 64 call 0x2c9ee ; 0x2c9ee 2db7a: ce 56 subi r28, 0x6E ; 110 2db7c: de 4f sbci r29, 0xFE ; 254 2db7e: a8 81 ld r26, Y 2db80: b9 81 ldd r27, Y+1 ; 0x01 2db82: c2 59 subi r28, 0x92 ; 146 2db84: d1 40 sbci r29, 0x01 ; 1 2db86: 2d 91 ld r18, X+ 2db88: 3d 91 ld r19, X+ 2db8a: 4d 91 ld r20, X+ 2db8c: 5c 91 ld r21, X 2db8e: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 2db92: 16 2f mov r17, r22 2db94: 07 2f mov r16, r23 2db96: f8 2e mov r15, r24 2db98: e9 2e mov r14, r25 r = MAX(2, r); 2db9a: 20 e0 ldi r18, 0x00 ; 0 2db9c: 30 e0 ldi r19, 0x00 ; 0 2db9e: 40 e0 ldi r20, 0x00 ; 0 2dba0: 50 e4 ldi r21, 0x40 ; 64 2dba2: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 2dba6: 18 16 cp r1, r24 2dba8: 2c f0 brlt .+10 ; 0x2dbb4 2dbaa: 10 e0 ldi r17, 0x00 ; 0 2dbac: 00 e0 ldi r16, 0x00 ; 0 2dbae: f1 2c mov r15, r1 2dbb0: 80 e4 ldi r24, 0x40 ; 64 2dbb2: e8 2e mov r14, r24 2dbb4: a8 01 movw r20, r16 2dbb6: 97 01 movw r18, r14 2dbb8: 85 2f mov r24, r21 2dbba: 90 2f mov r25, r16 2dbbc: a3 2f mov r26, r19 2dbbe: be 2d mov r27, r14 2dbc0: ce 56 subi r28, 0x6E ; 110 2dbc2: de 4f sbci r29, 0xFE ; 254 2dbc4: e8 81 ld r30, Y 2dbc6: f9 81 ldd r31, Y+1 ; 0x01 2dbc8: c2 59 subi r28, 0x92 ; 146 2dbca: d1 40 sbci r29, 0x01 ; 1 2dbcc: 80 83 st Z, r24 2dbce: 91 83 std Z+1, r25 ; 0x01 2dbd0: a2 83 std Z+2, r26 ; 0x02 2dbd2: b3 83 std Z+3, r27 ; 0x03 2dbd4: cf 56 subi r28, 0x6F ; 111 2dbd6: de 4f sbci r29, 0xFE ; 254 2dbd8: f8 81 ld r31, Y 2dbda: c1 59 subi r28, 0x91 ; 145 2dbdc: d1 40 sbci r29, 0x01 ; 1 2dbde: f1 50 subi r31, 0x01 ; 1 2dbe0: cf 56 subi r28, 0x6F ; 111 2dbe2: de 4f sbci r29, 0xFE ; 254 2dbe4: f8 83 st Y, r31 2dbe6: c1 59 subi r28, 0x91 ; 145 2dbe8: 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){ 2dbea: f1 11 cpse r31, r1 2dbec: 37 cd rjmp .-1426 ; 0x2d65c r = MAX(2, r); } //@size=118 DBG(_n(" [%f, %f][%f] final circle\n"), x, y, r); 2dbee: ef 92 push r14 2dbf0: ff 92 push r15 2dbf2: 0f 93 push r16 2dbf4: 1f 93 push r17 2dbf6: c1 57 subi r28, 0x71 ; 113 2dbf8: de 4f sbci r29, 0xFE ; 254 2dbfa: a8 81 ld r26, Y 2dbfc: b9 81 ldd r27, Y+1 ; 0x01 2dbfe: cf 58 subi r28, 0x8F ; 143 2dc00: d1 40 sbci r29, 0x01 ; 1 2dc02: 13 96 adiw r26, 0x03 ; 3 2dc04: 8c 91 ld r24, X 2dc06: 13 97 sbiw r26, 0x03 ; 3 2dc08: 8f 93 push r24 2dc0a: 12 96 adiw r26, 0x02 ; 2 2dc0c: 8c 91 ld r24, X 2dc0e: 12 97 sbiw r26, 0x02 ; 2 2dc10: 8f 93 push r24 2dc12: 11 96 adiw r26, 0x01 ; 1 2dc14: 8c 91 ld r24, X 2dc16: 11 97 sbiw r26, 0x01 ; 1 2dc18: 8f 93 push r24 2dc1a: 8c 91 ld r24, X 2dc1c: 8f 93 push r24 2dc1e: c3 57 subi r28, 0x73 ; 115 2dc20: de 4f sbci r29, 0xFE ; 254 2dc22: e8 81 ld r30, Y 2dc24: f9 81 ldd r31, Y+1 ; 0x01 2dc26: cd 58 subi r28, 0x8D ; 141 2dc28: d1 40 sbci r29, 0x01 ; 1 2dc2a: 83 81 ldd r24, Z+3 ; 0x03 2dc2c: 8f 93 push r24 2dc2e: 82 81 ldd r24, Z+2 ; 0x02 2dc30: 8f 93 push r24 2dc32: 81 81 ldd r24, Z+1 ; 0x01 2dc34: 8f 93 push r24 2dc36: 80 81 ld r24, Z 2dc38: 8f 93 push r24 2dc3a: 8f eb ldi r24, 0xBF ; 191 2dc3c: 96 ea ldi r25, 0xA6 ; 166 2dc3e: 9f 93 push r25 2dc40: 8f 93 push r24 2dc42: 0f 94 de da call 0x3b5bc ; 0x3b5bc 2dc46: 0f b6 in r0, 0x3f ; 63 2dc48: f8 94 cli 2dc4a: de bf out 0x3e, r29 ; 62 2dc4c: 0f be out 0x3f, r0 ; 63 2dc4e: cd bf out 0x3d, r28 ; 61 } 2dc50: c3 54 subi r28, 0x43 ; 67 2dc52: de 4f sbci r29, 0xFE ; 254 2dc54: 0f b6 in r0, 0x3f ; 63 2dc56: f8 94 cli 2dc58: de bf out 0x3e, r29 ; 62 2dc5a: 0f be out 0x3f, r0 ; 63 2dc5c: cd bf out 0x3d, r28 ; 61 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: df 90 pop r13 2dc6c: cf 90 pop r12 2dc6e: bf 90 pop r11 2dc70: af 90 pop r10 2dc72: 9f 90 pop r9 2dc74: 8f 90 pop r8 2dc76: 7f 90 pop r7 2dc78: 6f 90 pop r6 2dc7a: 5f 90 pop r5 2dc7c: 4f 90 pop r4 2dc7e: 3f 90 pop r3 2dc80: 2f 90 pop r2 2dc82: 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; 2dc84: 60 e0 ldi r22, 0x00 ; 0 2dc86: 70 e0 ldi r23, 0x00 ; 0 2dc88: cb 01 movw r24, r22 2dc8a: d5 ce rjmp .-598 ; 0x2da36 0002dc8c : 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){ 2dc8c: ef 92 push r14 2dc8e: ff 92 push r15 2dc90: 0f 93 push r16 2dc92: 1f 93 push r17 2dc94: cf 93 push r28 2dc96: df 93 push r29 2dc98: 1f 92 push r1 2dc9a: 1f 92 push r1 2dc9c: cd b7 in r28, 0x3d ; 61 2dc9e: de b7 in r29, 0x3e ; 62 2dca0: f8 2e mov r15, r24 2dca2: e6 2e mov r14, r22 if (steps == 0) return; uint16_t current_delay_us = MAX_DELAY; 2dca4: 80 e1 ldi r24, 0x10 ; 16 2dca6: 97 e2 ldi r25, 0x27 ; 39 2dca8: 9a 83 std Y+2, r25 ; 0x02 2dcaa: 89 83 std Y+1, r24 ; 0x01 const uint16_t half = steps / 2; 2dcac: 8a 01 movw r16, r20 2dcae: 16 95 lsr r17 2dcb0: 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); 2dcb2: 8f 2d mov r24, r15 2dcb4: 0e 94 1c eb call 0x1d638 ; 0x1d638 while (steps--){ 2dcb8: 01 50 subi r16, 0x01 ; 1 2dcba: 11 09 sbc r17, r1 2dcbc: 78 f0 brcs .+30 ; 0x2dcdc accelerate_1_step(axes, acc, delay_us, min_delay_us); 2dcbe: 28 ec ldi r18, 0xC8 ; 200 2dcc0: 30 e0 ldi r19, 0x00 ; 0 2dcc2: ae 01 movw r20, r28 2dcc4: 4f 5f subi r20, 0xFF ; 255 2dcc6: 5f 4f sbci r21, 0xFF ; 255 2dcc8: 68 ee ldi r22, 0xE8 ; 232 2dcca: 73 e0 ldi r23, 0x03 ; 3 2dccc: 8f 2d mov r24, r15 2dcce: 0e 94 ed e9 call 0x1d3da ; 0x1d3da update_position_1_step(axes, dir); 2dcd2: 6e 2d mov r22, r14 2dcd4: 8f 2d mov r24, r15 2dcd6: 0e 94 35 eb call 0x1d66a ; 0x1d66a 2dcda: ee cf rjmp .-36 ; 0x2dcb8 } /// \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); 2dcdc: 6e 2d mov r22, r14 2dcde: 8f 2d mov r24, r15 2dce0: 0e 94 1c eb call 0x1d638 ; 0x1d638 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); } 2dce4: 0f 90 pop r0 2dce6: 0f 90 pop r0 2dce8: df 91 pop r29 2dcea: cf 91 pop r28 2dcec: 1f 91 pop r17 2dcee: 0f 91 pop r16 2dcf0: ff 90 pop r15 2dcf2: ef 90 pop r14 2dcf4: 08 95 ret 0002dcf6 : /// 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) 2dcf6: 2f 92 push r2 2dcf8: 3f 92 push r3 2dcfa: 4f 92 push r4 2dcfc: 5f 92 push r5 2dcfe: 6f 92 push r6 2dd00: 7f 92 push r7 2dd02: 8f 92 push r8 2dd04: 9f 92 push r9 2dd06: af 92 push r10 2dd08: bf 92 push r11 2dd0a: cf 92 push r12 2dd0c: df 92 push r13 2dd0e: ef 92 push r14 2dd10: ff 92 push r15 2dd12: 0f 93 push r16 2dd14: 1f 93 push r17 2dd16: cf 93 push r28 2dd18: df 93 push r29 2dd1a: cd b7 in r28, 0x3d ; 61 2dd1c: de b7 in r29, 0x3e ; 62 2dd1e: 6c 97 sbiw r28, 0x1c ; 28 2dd20: 0f b6 in r0, 0x3f ; 63 2dd22: f8 94 cli 2dd24: de bf out 0x3e, r29 ; 62 2dd26: 0f be out 0x3f, r0 ; 63 2dd28: cd bf out 0x3d, r28 ; 61 2dd2a: 6c 01 movw r12, r24 2dd2c: 5b 01 movw r10, r22 2dd2e: 4a 01 movw r8, r20 2dd30: 19 01 movw r2, r18 2dd32: 18 87 std Y+8, r17 ; 0x08 2dd34: 0f 83 std Y+7, r16 ; 0x07 2dd36: fa 82 std Y+2, r15 ; 0x02 2dd38: 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; 2dd3a: d7 01 movw r26, r14 2dd3c: 8d 91 ld r24, X+ 2dd3e: 9c 91 ld r25, X 2dd40: 60 ed ldi r22, 0xD0 ; 208 2dd42: 72 e0 ldi r23, 0x02 ; 2 2dd44: 0f 94 e5 dc call 0x3b9ca ; 0x3b9ca <__udivmodhi4> 2dd48: 9c 8f std Y+28, r25 ; 0x1c 2dd4a: 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); 2dd4c: 9f 93 push r25 2dd4e: 8f 93 push r24 2dd50: 3f 92 push r3 2dd52: 2f 93 push r18 2dd54: 1f 92 push r1 2dd56: 84 e6 ldi r24, 0x64 ; 100 2dd58: 8f 93 push r24 2dd5a: 9f 92 push r9 2dd5c: 8f 92 push r8 2dd5e: bf 92 push r11 2dd60: af 92 push r10 2dd62: df 92 push r13 2dd64: cf 92 push r12 2dd66: 8d e3 ldi r24, 0x3D ; 61 2dd68: 96 ea ldi r25, 0xA6 ; 166 2dd6a: 9f 93 push r25 2dd6c: 8f 93 push r24 2dd6e: 0f 94 de da call 0x3b5bc ; 0x3b5bc 2dd72: 0f b6 in r0, 0x3f ; 63 2dd74: f8 94 cli 2dd76: de bf out 0x3e, r29 ; 62 2dd78: 0f be out 0x3f, r0 ; 63 2dd7a: 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; 2dd7c: 22 27 eor r18, r18 2dd7e: 33 27 eor r19, r19 2dd80: 22 19 sub r18, r2 2dd82: 33 09 sbc r19, r3 2dd84: 3a 8f std Y+26, r19 ; 0x1a 2dd86: 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)); 2dd88: c4 01 movw r24, r8 2dd8a: 99 0c add r9, r9 2dd8c: aa 0b sbc r26, r26 2dd8e: bb 0b sbc r27, r27 2dd90: 89 87 std Y+9, r24 ; 0x09 2dd92: 9a 87 std Y+10, r25 ; 0x0a 2dd94: ab 87 std Y+11, r26 ; 0x0b 2dd96: 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)); 2dd98: 95 01 movw r18, r10 2dd9a: bb 0c add r11, r11 2dd9c: 44 0b sbc r20, r20 2dd9e: 55 0b sbc r21, r21 2dda0: 29 8b std Y+17, r18 ; 0x11 2dda2: 3a 8b std Y+18, r19 ; 0x12 2dda4: 4b 8b std Y+19, r20 ; 0x13 2dda6: 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)); 2dda8: c6 01 movw r24, r12 2ddaa: dd 0c add r13, r13 2ddac: aa 0b sbc r26, r26 2ddae: bb 0b sbc r27, r27 2ddb0: 8d 8b std Y+21, r24 ; 0x15 2ddb2: 9e 8b std Y+22, r25 ; 0x16 2ddb4: af 8b std Y+23, r26 ; 0x17 2ddb6: b8 8f std Y+24, r27 ; 0x18 // snprintf(text, 10, "%4d", z0); // lcd_print(text); for (; ad < 720; ad++) { if (radius > 0) 2ddb8: 12 14 cp r1, r2 2ddba: 13 04 cpc r1, r3 2ddbc: 0c f0 brlt .+2 ; 0x2ddc0 2ddbe: ba c0 rjmp .+372 ; 0x2df34 { dad = dad_max - (ad / k); 2ddc0: 8b 8d ldd r24, Y+27 ; 0x1b 2ddc2: 9c 8d ldd r25, Y+28 ; 0x1c 2ddc4: 6c e3 ldi r22, 0x3C ; 60 2ddc6: 70 e0 ldi r23, 0x00 ; 0 2ddc8: 0f 94 e5 dc call 0x3b9ca ; 0x3b9ca <__udivmodhi4> 2ddcc: 10 e1 ldi r17, 0x10 ; 16 2ddce: 16 1b sub r17, r22 r = (float)(((uint32_t)ad) * radius) / 720; 2ddd0: 2b 8d ldd r18, Y+27 ; 0x1b 2ddd2: 3c 8d ldd r19, Y+28 ; 0x1c 2ddd4: d1 01 movw r26, r2 } else { dad = dad_max - ((719 - ad) / k); r = (float)(((uint32_t)(719 - ad)) * (-radius)) / 720; 2ddd6: 0f 94 3c dd call 0x3ba78 ; 0x3ba78 <__usmulhisi3> 2ddda: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 2ddde: 20 e0 ldi r18, 0x00 ; 0 2dde0: 30 e0 ldi r19, 0x00 ; 0 2dde2: 44 e3 ldi r20, 0x34 ; 52 2dde4: 54 e4 ldi r21, 0x44 ; 68 2dde6: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 2ddea: 6b 01 movw r12, r22 2ddec: 7c 01 movw r14, r24 } ar = radians(ad + rotation); 2ddee: 6f 81 ldd r22, Y+7 ; 0x07 2ddf0: 78 85 ldd r23, Y+8 ; 0x08 2ddf2: eb 8d ldd r30, Y+27 ; 0x1b 2ddf4: fc 8d ldd r31, Y+28 ; 0x1c 2ddf6: 6e 0f add r22, r30 2ddf8: 7f 1f adc r23, r31 2ddfa: 90 e0 ldi r25, 0x00 ; 0 2ddfc: 80 e0 ldi r24, 0x00 ; 0 2ddfe: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 2de02: 25 e3 ldi r18, 0x35 ; 53 2de04: 3a ef ldi r19, 0xFA ; 250 2de06: 4e e8 ldi r20, 0x8E ; 142 2de08: 5c e3 ldi r21, 0x3C ; 60 2de0a: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 2de0e: 4b 01 movw r8, r22 2de10: 5c 01 movw r10, r24 int x = (int)(cx + (cos(ar) * r)); 2de12: 0f 94 3e de call 0x3bc7c ; 0x3bc7c 2de16: 6b 83 std Y+3, r22 ; 0x03 2de18: 7c 83 std Y+4, r23 ; 0x04 2de1a: 8d 83 std Y+5, r24 ; 0x05 2de1c: 9e 83 std Y+6, r25 ; 0x06 int y = (int)(cy + (sin(ar) * r)); 2de1e: c5 01 movw r24, r10 2de20: b4 01 movw r22, r8 2de22: 0f 94 04 e1 call 0x3c208 ; 0x3c208 2de26: 2b 01 movw r4, r22 2de28: 3c 01 movw r6, r24 int z = (int)(z0 - ((float)((int32_t)dz * ad) / 720)); 2de2a: 69 85 ldd r22, Y+9 ; 0x09 2de2c: 7a 85 ldd r23, Y+10 ; 0x0a 2de2e: 8b 85 ldd r24, Y+11 ; 0x0b 2de30: 9c 85 ldd r25, Y+12 ; 0x0c 2de32: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 2de36: 4b 01 movw r8, r22 2de38: 5c 01 movw r10, r24 2de3a: 2b 8d ldd r18, Y+27 ; 0x1b 2de3c: 3c 8d ldd r19, Y+28 ; 0x1c 2de3e: a4 e6 ldi r26, 0x64 ; 100 2de40: b0 e0 ldi r27, 0x00 ; 0 2de42: 0f 94 bc dc call 0x3b978 ; 0x3b978 <__umulhisi3> 2de46: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 2de4a: 20 e0 ldi r18, 0x00 ; 0 2de4c: 30 e0 ldi r19, 0x00 ; 0 2de4e: 44 e3 ldi r20, 0x34 ; 52 2de50: 54 e4 ldi r21, 0x44 ; 68 2de52: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 2de56: 9b 01 movw r18, r22 2de58: ac 01 movw r20, r24 2de5a: c5 01 movw r24, r10 2de5c: b4 01 movw r22, r8 2de5e: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 2de62: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> 2de66: 6d 87 std Y+13, r22 ; 0x0d 2de68: 7e 87 std Y+14, r23 ; 0x0e 2de6a: 8f 87 std Y+15, r24 ; 0x0f 2de6c: 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)); 2de6e: 69 89 ldd r22, Y+17 ; 0x11 2de70: 7a 89 ldd r23, Y+18 ; 0x12 2de72: 8b 89 ldd r24, Y+19 ; 0x13 2de74: 9c 89 ldd r25, Y+20 ; 0x14 2de76: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 2de7a: 4b 01 movw r8, r22 2de7c: 5c 01 movw r10, r24 2de7e: a3 01 movw r20, r6 2de80: 92 01 movw r18, r4 2de82: c7 01 movw r24, r14 2de84: b6 01 movw r22, r12 2de86: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 2de8a: 9b 01 movw r18, r22 2de8c: ac 01 movw r20, r24 2de8e: c5 01 movw r24, r10 2de90: b4 01 movw r22, r8 2de92: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 2de96: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> 2de9a: 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)); 2de9c: 6d 89 ldd r22, Y+21 ; 0x15 2de9e: 7e 89 ldd r23, Y+22 ; 0x16 2dea0: 8f 89 ldd r24, Y+23 ; 0x17 2dea2: 98 8d ldd r25, Y+24 ; 0x18 2dea4: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 2dea8: 2b 01 movw r4, r22 2deaa: 3c 01 movw r6, r24 2deac: a7 01 movw r20, r14 2deae: 96 01 movw r18, r12 2deb0: 6b 81 ldd r22, Y+3 ; 0x03 2deb2: 7c 81 ldd r23, Y+4 ; 0x04 2deb4: 8d 81 ldd r24, Y+5 ; 0x05 2deb6: 9e 81 ldd r25, Y+6 ; 0x06 2deb8: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 2debc: 9b 01 movw r18, r22 2debe: ac 01 movw r20, r24 2dec0: c3 01 movw r24, r6 2dec2: b2 01 movw r22, r4 2dec4: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 2dec8: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> 2decc: 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)) 2dece: 01 e0 ldi r16, 0x01 ; 1 2ded0: 20 e4 ldi r18, 0x40 ; 64 2ded2: 31 e0 ldi r19, 0x01 ; 1 2ded4: 4d 85 ldd r20, Y+13 ; 0x0d 2ded6: 5e 85 ldd r21, Y+14 ; 0x0e 2ded8: b4 01 movw r22, r8 2deda: 0e 94 75 eb call 0x1d6ea ; 0x1d6ea 2dede: 21 2f mov r18, r17 2dee0: 30 e0 ldi r19, 0x00 ; 0 2dee2: 88 23 and r24, r24 2dee4: b9 f1 breq .+110 ; 0x2df54 2dee6: 4b 8d ldd r20, Y+27 ; 0x1b 2dee8: 5c 8d ldd r21, Y+28 ; 0x1c 2deea: 42 0f add r20, r18 2deec: 53 1f adc r21, r19 { ad += dad + 1; 2deee: 4f 5f subi r20, 0xFF ; 255 2def0: 5f 4f sbci r21, 0xFF ; 255 2def2: 5c 8f std Y+28, r21 ; 0x1c 2def4: 4b 8f std Y+27, r20 ; 0x1b ret = true; break; } ad += dad; } if (pad) *pad = ad; 2def6: eb 8d ldd r30, Y+27 ; 0x1b 2def8: fc 8d ldd r31, Y+28 ; 0x1c 2defa: a9 81 ldd r26, Y+1 ; 0x01 2defc: ba 81 ldd r27, Y+2 ; 0x02 2defe: ed 93 st X+, r30 2df00: fc 93 st X, r31 // if(ret){ // lcd_set_cursor(0, 4); // lcd_print(" "); // } return ret; } 2df02: 6c 96 adiw r28, 0x1c ; 28 2df04: 0f b6 in r0, 0x3f ; 63 2df06: f8 94 cli 2df08: de bf out 0x3e, r29 ; 62 2df0a: 0f be out 0x3f, r0 ; 63 2df0c: cd bf out 0x3d, r28 ; 61 2df0e: df 91 pop r29 2df10: cf 91 pop r28 2df12: 1f 91 pop r17 2df14: 0f 91 pop r16 2df16: ff 90 pop r15 2df18: ef 90 pop r14 2df1a: df 90 pop r13 2df1c: cf 90 pop r12 2df1e: bf 90 pop r11 2df20: af 90 pop r10 2df22: 9f 90 pop r9 2df24: 8f 90 pop r8 2df26: 7f 90 pop r7 2df28: 6f 90 pop r6 2df2a: 5f 90 pop r5 2df2c: 4f 90 pop r4 2df2e: 3f 90 pop r3 2df30: 2f 90 pop r2 2df32: 08 95 ret dad = dad_max - (ad / k); r = (float)(((uint32_t)ad) * radius) / 720; } else { dad = dad_max - ((719 - ad) / k); 2df34: 2f ec ldi r18, 0xCF ; 207 2df36: 32 e0 ldi r19, 0x02 ; 2 2df38: ab 8d ldd r26, Y+27 ; 0x1b 2df3a: bc 8d ldd r27, Y+28 ; 0x1c 2df3c: 2a 1b sub r18, r26 2df3e: 3b 0b sbc r19, r27 2df40: c9 01 movw r24, r18 2df42: 6c e3 ldi r22, 0x3C ; 60 2df44: 70 e0 ldi r23, 0x00 ; 0 2df46: 0f 94 e5 dc call 0x3b9ca ; 0x3b9ca <__udivmodhi4> 2df4a: 10 e1 ldi r17, 0x10 ; 16 2df4c: 16 1b sub r17, r22 r = (float)(((uint32_t)(719 - ad)) * (-radius)) / 720; 2df4e: a9 8d ldd r26, Y+25 ; 0x19 2df50: ba 8d ldd r27, Y+26 ; 0x1a 2df52: 41 cf rjmp .-382 ; 0x2ddd6 // lcd_set_cursor(0, 4); // char text[10]; // snprintf(text, 10, "%4d", z0); // lcd_print(text); for (; ad < 720; ad++) 2df54: 2f 5f subi r18, 0xFF ; 255 2df56: 3f 4f sbci r19, 0xFF ; 255 2df58: ab 8d ldd r26, Y+27 ; 0x1b 2df5a: bc 8d ldd r27, Y+28 ; 0x1c 2df5c: a2 0f add r26, r18 2df5e: b3 1f adc r27, r19 2df60: bc 8f std Y+28, r27 ; 0x1c 2df62: ab 8f std Y+27, r26 ; 0x1b 2df64: a0 3d cpi r26, 0xD0 ; 208 2df66: b2 40 sbci r27, 0x02 ; 2 2df68: 08 f4 brcc .+2 ; 0x2df6c 2df6a: 26 cf rjmp .-436 ; 0x2ddb8 2df6c: c4 cf rjmp .-120 ; 0x2def6 0002df6e : 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){ 2df6e: 2f 92 push r2 2df70: 3f 92 push r3 2df72: 4f 92 push r4 2df74: 5f 92 push r5 2df76: 6f 92 push r6 2df78: 7f 92 push r7 2df7a: 8f 92 push r8 2df7c: 9f 92 push r9 2df7e: af 92 push r10 2df80: bf 92 push r11 2df82: cf 92 push r12 2df84: df 92 push r13 2df86: ef 92 push r14 2df88: ff 92 push r15 2df8a: 0f 93 push r16 2df8c: 1f 93 push r17 2df8e: cf 93 push r28 2df90: df 93 push r29 2df92: cd b7 in r28, 0x3d ; 61 2df94: de b7 in r29, 0x3e ; 62 2df96: ca 55 subi r28, 0x5A ; 90 2df98: d1 09 sbc r29, r1 2df9a: 0f b6 in r0, 0x3f ; 63 2df9c: f8 94 cli 2df9e: de bf out 0x3e, r29 ; 62 2dfa0: 0f be out 0x3f, r0 ; 63 2dfa2: cd bf out 0x3d, r28 ; 61 2dfa4: 63 96 adiw r28, 0x13 ; 19 2dfa6: 9f af std Y+63, r25 ; 0x3f 2dfa8: 8e af std Y+62, r24 ; 0x3e 2dfaa: 63 97 sbiw r28, 0x13 ; 19 2dfac: 8b 01 movw r16, r22 2dfae: 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 2dfb0: 7e 01 movw r14, r28 2dfb2: 25 e4 ldi r18, 0x45 ; 69 2dfb4: e2 0e add r14, r18 2dfb6: f1 1c adc r15, r1 2dfb8: 80 e1 ldi r24, 0x10 ; 16 2dfba: 97 e2 ldi r25, 0x27 ; 39 2dfbc: f7 01 movw r30, r14 2dfbe: 91 83 std Z+1, r25 ; 0x01 2dfc0: 80 83 st Z, r24 int16_t start_z; uint16_t steps_to_go; DBG(_n("Scan countdown: ")); 2dfc2: 8a e8 ldi r24, 0x8A ; 138 2dfc4: 96 ea ldi r25, 0xA6 ; 166 2dfc6: 9f 93 push r25 2dfc8: 8f 93 push r24 2dfca: 0f 94 de da call 0x3b5bc ; 0x3b5bc 2dfce: 25 ec ldi r18, 0xC5 ; 197 2dfd0: 36 e0 ldi r19, 0x06 ; 6 2dfd2: 61 96 adiw r28, 0x11 ; 17 2dfd4: 3f af std Y+63, r19 ; 0x3f 2dfd6: 2e af std Y+62, r18 ; 0x3e 2dfd8: 61 97 sbiw r28, 0x11 ; 17 2dfda: c8 01 movw r24, r16 2dfdc: 80 5e subi r24, 0xE0 ; 224 2dfde: 93 40 sbci r25, 0x03 ; 3 2dfe0: 2b 96 adiw r28, 0x0b ; 11 2dfe2: 9f af std Y+63, r25 ; 0x3f 2dfe4: 8e af std Y+62, r24 ; 0x3e 2dfe6: 2b 97 sbiw r28, 0x0b ; 11 2dfe8: 0f 90 pop r0 2dfea: 0f 90 pop r0 2dfec: e0 e4 ldi r30, 0x40 ; 64 2dfee: f0 e0 ldi r31, 0x00 ; 0 2dff0: 29 96 adiw r28, 0x09 ; 9 2dff2: ff af std Y+63, r31 ; 0x3f 2dff4: ee af std Y+62, r30 ; 0x3e 2dff6: 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); 2dff8: 63 96 adiw r28, 0x13 ; 19 2dffa: 2e ad ldd r18, Y+62 ; 0x3e 2dffc: 3f ad ldd r19, Y+63 ; 0x3f 2dffe: 63 97 sbiw r28, 0x13 ; 19 2e000: 20 5e subi r18, 0xE0 ; 224 2e002: 33 40 sbci r19, 0x03 ; 3 2e004: 69 96 adiw r28, 0x19 ; 25 2e006: 3f af std Y+63, r19 ; 0x3f 2e008: 2e af std Y+62, r18 ; 0x3e 2e00a: 69 97 sbiw r28, 0x19 ; 25 2e00c: 29 96 adiw r28, 0x09 ; 9 2e00e: 4e ac ldd r4, Y+62 ; 0x3e 2e010: 5f ac ldd r5, Y+63 ; 0x3f 2e012: 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){ 2e014: 31 2c mov r3, r1 go_manhattan((d & 1) ? (cx + 992) : (cx - 992), cy - 992 + r * 64, _Z, Z_ACCEL, Z_MIN_DELAY); 2e016: 63 96 adiw r28, 0x13 ; 19 2e018: 8e ad ldd r24, Y+62 ; 0x3e 2e01a: 9f ad ldd r25, Y+63 ; 0x3f 2e01c: 63 97 sbiw r28, 0x13 ; 19 2e01e: 80 52 subi r24, 0x20 ; 32 2e020: 9c 4f sbci r25, 0xFC ; 252 2e022: 6b 96 adiw r28, 0x1b ; 27 2e024: 9f af std Y+63, r25 ; 0x3f 2e026: 8e af std Y+62, r24 ; 0x3e 2e028: 6b 97 sbiw r28, 0x1b ; 27 2e02a: 60 90 bb 06 lds r6, 0x06BB ; 0x8006bb 2e02e: 70 90 bc 06 lds r7, 0x06BC ; 0x8006bc 2e032: 80 90 bd 06 lds r8, 0x06BD ; 0x8006bd 2e036: 90 90 be 06 lds r9, 0x06BE ; 0x8006be 2e03a: 6b 96 adiw r28, 0x1b ; 27 2e03c: ae ac ldd r10, Y+62 ; 0x3e 2e03e: bf ac ldd r11, Y+63 ; 0x3f 2e040: 6b 97 sbiw r28, 0x1b ; 27 2e042: 31 10 cpse r3, r1 2e044: 04 c0 rjmp .+8 ; 0x2e04e 2e046: 69 96 adiw r28, 0x19 ; 25 2e048: ae ac ldd r10, Y+62 ; 0x3e 2e04a: bf ac ldd r11, Y+63 ; 0x3f 2e04c: 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; 2e04e: 80 91 b3 06 lds r24, 0x06B3 ; 0x8006b3 2e052: 90 91 b4 06 lds r25, 0x06B4 ; 0x8006b4 2e056: a0 91 b5 06 lds r26, 0x06B5 ; 0x8006b5 2e05a: b0 91 b6 06 lds r27, 0x06B6 ; 0x8006b6 2e05e: f5 01 movw r30, r10 2e060: e8 1b sub r30, r24 2e062: f9 0b sbc r31, r25 2e064: 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) 2e066: 71 f0 breq .+28 ; 0x2e084 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)); 2e068: af 01 movw r20, r30 2e06a: f7 ff sbrs r31, 7 2e06c: 04 c0 rjmp .+8 ; 0x2e076 2e06e: 44 27 eor r20, r20 2e070: 55 27 eor r21, r21 2e072: 4e 1b sub r20, r30 2e074: 5f 0b sbc r21, r31 2e076: 69 2f mov r22, r25 2e078: 66 1f adc r22, r22 2e07a: 66 27 eor r22, r22 2e07c: 66 1f adc r22, r22 2e07e: 81 e0 ldi r24, 0x01 ; 1 2e080: 0f 94 46 6e call 0x2dc8c ; 0x2dc8c // DBG(_n("y %d -> %d, "), y, _Y); length = y - _Y; 2e084: 80 91 b7 06 lds r24, 0x06B7 ; 0x8006b7 2e088: 90 91 b8 06 lds r25, 0x06B8 ; 0x8006b8 2e08c: a0 91 b9 06 lds r26, 0x06B9 ; 0x8006b9 2e090: b0 91 ba 06 lds r27, 0x06BA ; 0x8006ba 2e094: 2b 96 adiw r28, 0x0b ; 11 2e096: 4e ad ldd r20, Y+62 ; 0x3e 2e098: 5f ad ldd r21, Y+63 ; 0x3f 2e09a: 2b 97 sbiw r28, 0x0b ; 11 2e09c: 48 1b sub r20, r24 2e09e: 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)); 2e0a0: 57 fd sbrc r21, 7 2e0a2: b2 c0 rjmp .+356 ; 0x2e208 2e0a4: 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) 2e0a6: 41 15 cp r20, r1 2e0a8: 51 05 cpc r21, r1 2e0aa: 09 f0 breq .+2 ; 0x2e0ae 2e0ac: ae c0 rjmp .+348 ; 0x2e20a // 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; 2e0ae: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 2e0b2: 90 91 bc 06 lds r25, 0x06BC ; 0x8006bc 2e0b6: a0 91 bd 06 lds r26, 0x06BD ; 0x8006bd 2e0ba: b0 91 be 06 lds r27, 0x06BE ; 0x8006be 2e0be: 68 1a sub r6, r24 2e0c0: 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)); 2e0c2: 77 fc sbrc r7, 7 2e0c4: ab c0 rjmp .+342 ; 0x2e21c 2e0c6: 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) 2e0c8: 61 14 cp r6, r1 2e0ca: 71 04 cpc r7, r1 2e0cc: 09 f0 breq .+2 ; 0x2e0d0 2e0ce: a7 c0 rjmp .+334 ; 0x2e21e 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); 2e0d0: 40 91 bb 06 lds r20, 0x06BB ; 0x8006bb 2e0d4: 50 91 bc 06 lds r21, 0x06BC ; 0x8006bc 2e0d8: 60 91 bd 06 lds r22, 0x06BD ; 0x8006bd 2e0dc: 70 91 be 06 lds r23, 0x06BE ; 0x8006be 2e0e0: 00 e0 ldi r16, 0x00 ; 0 2e0e2: 28 ec ldi r18, 0xC8 ; 200 2e0e4: 30 e0 ldi r19, 0x00 ; 0 2e0e6: 2b 96 adiw r28, 0x0b ; 11 2e0e8: 6e ad ldd r22, Y+62 ; 0x3e 2e0ea: 7f ad ldd r23, Y+63 ; 0x3f 2e0ec: 2b 97 sbiw r28, 0x0b ; 11 2e0ee: c5 01 movw r24, r10 2e0f0: 0e 94 75 eb call 0x1d6ea ; 0x1d6ea sm4_set_dir(X_AXIS, d); 2e0f4: 63 2d mov r22, r3 2e0f6: 80 e0 ldi r24, 0x00 ; 0 2e0f8: 0f 94 1c 52 call 0x2a438 ; 0x2a438 //@size=242 DBG(_n("%d\n"), 64 - (r * 2 + d)); ///< to keep host connection alive 2e0fc: 5f 92 push r5 2e0fe: 4f 92 push r4 2e100: 86 e8 ldi r24, 0x86 ; 134 2e102: 96 ea ldi r25, 0xA6 ; 166 2e104: 9f 93 push r25 2e106: 8f 93 push r24 2e108: 0f 94 de da call 0x3b5bc ; 0x3b5bc lcd_set_cursor(4,3); 2e10c: 63 e0 ldi r22, 0x03 ; 3 2e10e: 84 e0 ldi r24, 0x04 ; 4 2e110: 0e 94 e0 6e call 0xddc0 ; 0xddc0 lcd_printf_P(PSTR("Countdown: %d "),64 - (r * 2 + d)); ////MSG_COUNTDOWN c=12 2e114: 5f 92 push r5 2e116: 4f 92 push r4 2e118: 87 e7 ldi r24, 0x77 ; 119 2e11a: 96 ea ldi r25, 0xA6 ; 166 2e11c: 9f 93 push r25 2e11e: 8f 93 push r24 2e120: 0e 94 b9 6e call 0xdd72 ; 0xdd72 2e124: 0f b6 in r0, 0x3f ; 63 2e126: f8 94 cli 2e128: de bf out 0x3e, r29 ; 62 2e12a: 0f be out 0x3f, r0 ; 63 2e12c: cd bf out 0x3d, r28 ; 61 2e12e: 21 e0 ldi r18, 0x01 ; 1 2e130: 30 e0 ldi r19, 0x00 ; 0 2e132: 31 10 cpse r3, r1 2e134: 02 c0 rjmp .+4 ; 0x2e13a 2e136: 2f ef ldi r18, 0xFF ; 255 2e138: 3f ef ldi r19, 0xFF ; 255 2e13a: 40 ec ldi r20, 0xC0 ; 192 2e13c: 42 03 mulsu r20, r18 2e13e: c0 01 movw r24, r0 2e140: 43 9f mul r20, r19 2e142: 90 0d add r25, r0 2e144: 11 24 eor r1, r1 2e146: 67 96 adiw r28, 0x17 ; 23 2e148: 9f af std Y+63, r25 ; 0x3f 2e14a: 8e af std Y+62, r24 ; 0x3e 2e14c: 67 97 sbiw r28, 0x17 ; 23 2e14e: 40 ee ldi r20, 0xE0 ; 224 2e150: 53 e0 ldi r21, 0x03 ; 3 2e152: 24 9f mul r18, r20 2e154: 40 01 movw r8, r0 2e156: 25 9f mul r18, r21 2e158: 90 0c add r9, r0 2e15a: 34 9f mul r19, r20 2e15c: 90 0c add r9, r0 2e15e: 11 24 eor r1, r1 2e160: 63 96 adiw r28, 0x13 ; 19 2e162: ee ad ldd r30, Y+62 ; 0x3e 2e164: ff ad ldd r31, Y+63 ; 0x3f 2e166: 63 97 sbiw r28, 0x13 ; 19 2e168: 8e 0e add r8, r30 2e16a: 9f 1e adc r9, r31 2e16c: 9e 01 movw r18, r28 2e16e: 2f 5f subi r18, 0xFF ; 255 2e170: 3f 4f sbci r19, 0xFF ; 255 2e172: 2d 96 adiw r28, 0x0d ; 13 2e174: 3f af std Y+63, r19 ; 0x3f 2e176: 2e af std Y+62, r18 ; 0x3e 2e178: 2d 97 sbiw r28, 0x0d ; 13 2e17a: 61 96 adiw r28, 0x11 ; 17 2e17c: 8e ad ldd r24, Y+62 ; 0x3e 2e17e: 9f ad ldd r25, Y+63 ; 0x3f 2e180: 61 97 sbiw r28, 0x11 ; 17 2e182: 2f 96 adiw r28, 0x0f ; 15 2e184: 9f af std Y+63, r25 ; 0x3f 2e186: 8e af std Y+62, r24 ; 0x3e 2e188: 2f 97 sbiw r28, 0x0f ; 15 2e18a: 71 2c mov r7, r1 2e18c: 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; 2e18e: e0 e1 ldi r30, 0x10 ; 16 2e190: f7 e2 ldi r31, 0x27 ; 39 2e192: 27 96 adiw r28, 0x07 ; 7 2e194: ff af std Y+63, r31 ; 0x3f 2e196: ee af std Y+62, r30 ; 0x3e 2e198: 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); 2e19a: 80 91 b3 06 lds r24, 0x06B3 ; 0x8006b3 2e19e: 90 91 b4 06 lds r25, 0x06B4 ; 0x8006b4 2e1a2: a0 91 b5 06 lds r26, 0x06B5 ; 0x8006b5 2e1a6: b0 91 b6 06 lds r27, 0x06B6 ; 0x8006b6 2e1aa: 84 01 movw r16, r8 2e1ac: 08 1b sub r16, r24 2e1ae: 19 0b sbc r17, r25 2e1b0: 17 ff sbrs r17, 7 2e1b2: 03 c0 rjmp .+6 ; 0x2e1ba 2e1b4: 11 95 neg r17 2e1b6: 01 95 neg r16 2e1b8: 11 09 sbc r17, r1 const int16_t half_x = length_x / 2; 2e1ba: 98 01 movw r18, r16 2e1bc: 35 95 asr r19 2e1be: 27 95 ror r18 2e1c0: 65 96 adiw r28, 0x15 ; 21 2e1c2: 3f af std Y+63, r19 ; 0x3f 2e1c4: 2e af std Y+62, r18 ; 0x3e 2e1c6: 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; 2e1c8: 1c 9b sbis 0x03, 4 ; 3 2e1ca: 33 c0 rjmp .+102 ; 0x2e232 2e1cc: 45 e0 ldi r20, 0x05 ; 5 2e1ce: 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); 2e1d0: 65 96 adiw r28, 0x15 ; 21 2e1d2: ae ac ldd r10, Y+62 ; 0x3e 2e1d4: bf ac ldd r11, Y+63 ; 0x3f 2e1d6: 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); 2e1d8: 63 2d mov r22, r3 2e1da: 82 2d mov r24, r2 2e1dc: 0e 94 1c eb call 0x1d638 ; 0x1d638 while (steps--){ 2e1e0: 31 e0 ldi r19, 0x01 ; 1 2e1e2: a3 1a sub r10, r19 2e1e4: b1 08 sbc r11, r1 2e1e6: 40 f1 brcs .+80 ; 0x2e238 accelerate_1_step(axes, acc, delay_us, min_delay_us); 2e1e8: 28 ec ldi r18, 0xC8 ; 200 2e1ea: 30 e0 ldi r19, 0x00 ; 0 2e1ec: a7 01 movw r20, r14 2e1ee: 68 ee ldi r22, 0xE8 ; 232 2e1f0: 73 e0 ldi r23, 0x03 ; 3 2e1f2: 82 2d mov r24, r2 2e1f4: 0e 94 ed e9 call 0x1d3da ; 0x1d3da update_position_1_step(axes, dir); 2e1f8: 63 2d mov r22, r3 2e1fa: 82 2d mov r24, r2 2e1fc: 0e 94 35 eb call 0x1d66a ; 0x1d66a 2e200: ef cf rjmp .-34 ; 0x2e1e0 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){ 2e202: 33 24 eor r3, r3 2e204: 33 94 inc r3 2e206: 11 cf rjmp .-478 ; 0x2e02a 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)); 2e208: 62 e0 ldi r22, 0x02 ; 2 2e20a: 57 ff sbrs r21, 7 2e20c: 03 c0 rjmp .+6 ; 0x2e214 2e20e: 51 95 neg r21 2e210: 41 95 neg r20 2e212: 51 09 sbc r21, r1 2e214: 82 e0 ldi r24, 0x02 ; 2 2e216: 0f 94 46 6e call 0x2dc8c ; 0x2dc8c 2e21a: 49 cf rjmp .-366 ; 0x2e0ae // 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)); 2e21c: 64 e0 ldi r22, 0x04 ; 4 2e21e: a3 01 movw r20, r6 2e220: 77 fe sbrs r7, 7 2e222: 03 c0 rjmp .+6 ; 0x2e22a 2e224: 51 95 neg r21 2e226: 41 95 neg r20 2e228: 51 09 sbc r21, r1 2e22a: 84 e0 ldi r24, 0x04 ; 4 2e22c: 0f 94 46 6e call 0x2dc8c ; 0x2dc8c 2e230: 4f cf rjmp .-354 ; 0x2e0d0 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; 2e232: 22 24 eor r2, r2 2e234: 23 94 inc r2 2e236: cc cf rjmp .-104 ; 0x2e1d0 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); 2e238: 65 96 adiw r28, 0x15 ; 21 2e23a: ee ad ldd r30, Y+62 ; 0x3e 2e23c: ff ad ldd r31, Y+63 ; 0x3f 2e23e: 65 97 sbiw r28, 0x15 ; 21 2e240: 0e 1b sub r16, r30 2e242: 1f 0b sbc r17, r31 2e244: 23 96 adiw r28, 0x03 ; 3 2e246: 1f af std Y+63, r17 ; 0x3f 2e248: 0e af std Y+62, r16 ; 0x3e 2e24a: 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); 2e24c: 63 2d mov r22, r3 2e24e: 82 2d mov r24, r2 2e250: 0e 94 1c eb call 0x1d638 ; 0x1d638 while (go_and_stop_1_step(axes, dec, delay_us, steps)){ 2e254: 9e 01 movw r18, r28 2e256: 2f 5b subi r18, 0xBF ; 191 2e258: 3f 4f sbci r19, 0xFF ; 255 2e25a: a7 01 movw r20, r14 2e25c: 68 ee ldi r22, 0xE8 ; 232 2e25e: 73 e0 ldi r23, 0x03 ; 3 2e260: 82 2d mov r24, r2 2e262: 0e 94 93 ea call 0x1d526 ; 0x1d526 2e266: 88 23 and r24, r24 2e268: 29 f0 breq .+10 ; 0x2e274 update_position_1_step(axes, dir); 2e26a: 63 2d mov r22, r3 2e26c: 82 2d mov r24, r2 2e26e: 0e 94 35 eb call 0x1d66a ; 0x1d66a 2e272: f0 cf rjmp .-32 ; 0x2e254 z_trig = min_z; /// move up to un-trigger (surpress hysteresis) sm4_set_dir(Z_AXIS, Z_PLUS); 2e274: 60 e0 ldi r22, 0x00 ; 0 2e276: 82 e0 ldi r24, 0x02 ; 2 2e278: 0f 94 1c 52 call 0x2a438 ; 0x2a438 /// speed up from stop, go half the way current_delay_us = MAX_DELAY; 2e27c: 20 e1 ldi r18, 0x10 ; 16 2e27e: 37 e2 ldi r19, 0x27 ; 39 2e280: 27 96 adiw r28, 0x07 ; 7 2e282: 3f af std Y+63, r19 ; 0x3f 2e284: 2e af std Y+62, r18 ; 0x3e 2e286: 27 97 sbiw r28, 0x07 ; 7 for (start_z = _Z; _Z < (max_z + start_z) / 2; ++_Z_){ 2e288: 00 91 bb 06 lds r16, 0x06BB ; 0x8006bb 2e28c: 10 91 bc 06 lds r17, 0x06BC ; 0x8006bc 2e290: 20 91 bd 06 lds r18, 0x06BD ; 0x8006bd 2e294: 30 91 be 06 lds r19, 0x06BE ; 0x8006be 2e298: 00 5a subi r16, 0xA0 ; 160 2e29a: 16 4f sbci r17, 0xF6 ; 246 2e29c: 17 ff sbrs r17, 7 2e29e: 02 c0 rjmp .+4 ; 0x2e2a4 2e2a0: 0f 5f subi r16, 0xFF ; 255 2e2a2: 1f 4f sbci r17, 0xFF ; 255 2e2a4: 15 95 asr r17 2e2a6: 07 95 ror r16 2e2a8: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 2e2ac: 90 91 bc 06 lds r25, 0x06BC ; 0x8006bc 2e2b0: a0 91 bd 06 lds r26, 0x06BD ; 0x8006bd 2e2b4: b0 91 be 06 lds r27, 0x06BE ; 0x8006be 2e2b8: 80 17 cp r24, r16 2e2ba: 91 07 cpc r25, r17 2e2bc: f4 f4 brge .+60 ; 0x2e2fa if (!_PINDA){ 2e2be: 1c 9b sbis 0x03, 4 ; 3 2e2c0: 1c c0 rjmp .+56 ; 0x2e2fa break; } accelerate_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, Z_MIN_DELAY); 2e2c2: 28 ec ldi r18, 0xC8 ; 200 2e2c4: 30 e0 ldi r19, 0x00 ; 0 2e2c6: a7 01 movw r20, r14 2e2c8: 68 ee ldi r22, 0xE8 ; 232 2e2ca: 73 e0 ldi r23, 0x03 ; 3 2e2cc: 84 e0 ldi r24, 0x04 ; 4 2e2ce: 0e 94 ed e9 call 0x1d3da ; 0x1d3da /// 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_){ 2e2d2: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 2e2d6: 90 91 bc 06 lds r25, 0x06BC ; 0x8006bc 2e2da: a0 91 bd 06 lds r26, 0x06BD ; 0x8006bd 2e2de: b0 91 be 06 lds r27, 0x06BE ; 0x8006be 2e2e2: 01 96 adiw r24, 0x01 ; 1 2e2e4: a1 1d adc r26, r1 2e2e6: b1 1d adc r27, r1 2e2e8: 80 93 bb 06 sts 0x06BB, r24 ; 0x8006bb 2e2ec: 90 93 bc 06 sts 0x06BC, r25 ; 0x8006bc 2e2f0: a0 93 bd 06 sts 0x06BD, r26 ; 0x8006bd 2e2f4: b0 93 be 06 sts 0x06BE, r27 ; 0x8006be 2e2f8: d7 cf rjmp .-82 ; 0x2e2a8 break; } accelerate_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, Z_MIN_DELAY); } if (_PINDA){ 2e2fa: 1c 9b sbis 0x03, 4 ; 3 2e2fc: 3f c0 rjmp .+126 ; 0x2e37c steps_to_go = MAX(0, max_z - _Z); 2e2fe: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 2e302: 90 91 bc 06 lds r25, 0x06BC ; 0x8006bc 2e306: a0 91 bd 06 lds r26, 0x06BD ; 0x8006bd 2e30a: b0 91 be 06 lds r27, 0x06BE ; 0x8006be 2e30e: e0 e6 ldi r30, 0x60 ; 96 2e310: f9 e0 ldi r31, 0x09 ; 9 2e312: e8 1b sub r30, r24 2e314: f9 0b sbc r31, r25 2e316: cf 01 movw r24, r30 2e318: f7 ff sbrs r31, 7 2e31a: 02 c0 rjmp .+4 ; 0x2e320 2e31c: 90 e0 ldi r25, 0x00 ; 0 2e31e: 80 e0 ldi r24, 0x00 ; 0 2e320: 25 96 adiw r28, 0x05 ; 5 2e322: 9f af std Y+63, r25 ; 0x3f 2e324: 8e af std Y+62, r24 ; 0x3e 2e326: 25 97 sbiw r28, 0x05 ; 5 while (_PINDA && _Z < max_z){ 2e328: 1c 9b sbis 0x03, 4 ; 3 2e32a: 28 c0 rjmp .+80 ; 0x2e37c 2e32c: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 2e330: 90 91 bc 06 lds r25, 0x06BC ; 0x8006bc 2e334: a0 91 bd 06 lds r26, 0x06BD ; 0x8006bd 2e338: b0 91 be 06 lds r27, 0x06BE ; 0x8006be 2e33c: 80 36 cpi r24, 0x60 ; 96 2e33e: 99 40 sbci r25, 0x09 ; 9 2e340: ec f4 brge .+58 ; 0x2e37c go_and_stop_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, steps_to_go); 2e342: 9e 01 movw r18, r28 2e344: 2d 5b subi r18, 0xBD ; 189 2e346: 3f 4f sbci r19, 0xFF ; 255 2e348: a7 01 movw r20, r14 2e34a: 68 ee ldi r22, 0xE8 ; 232 2e34c: 73 e0 ldi r23, 0x03 ; 3 2e34e: 84 e0 ldi r24, 0x04 ; 4 2e350: 0e 94 93 ea call 0x1d526 ; 0x1d526 ++_Z_; 2e354: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 2e358: 90 91 bc 06 lds r25, 0x06BC ; 0x8006bc 2e35c: a0 91 bd 06 lds r26, 0x06BD ; 0x8006bd 2e360: b0 91 be 06 lds r27, 0x06BE ; 0x8006be 2e364: 01 96 adiw r24, 0x01 ; 1 2e366: a1 1d adc r26, r1 2e368: b1 1d adc r27, r1 2e36a: 80 93 bb 06 sts 0x06BB, r24 ; 0x8006bb 2e36e: 90 93 bc 06 sts 0x06BC, r25 ; 0x8006bc 2e372: a0 93 bd 06 sts 0x06BD, r26 ; 0x8006bd 2e376: b0 93 be 06 sts 0x06BE, r27 ; 0x8006be 2e37a: d6 cf rjmp .-84 ; 0x2e328 /// \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); 2e37c: 60 e0 ldi r22, 0x00 ; 0 2e37e: 84 e0 ldi r24, 0x04 ; 4 2e380: 0e 94 1c eb call 0x1d638 ; 0x1d638 while (delay_us < MAX_DELAY){ 2e384: f7 01 movw r30, r14 2e386: 20 81 ld r18, Z 2e388: 31 81 ldd r19, Z+1 ; 0x01 2e38a: 20 31 cpi r18, 0x10 ; 16 2e38c: f7 e2 ldi r31, 0x27 ; 39 2e38e: 3f 07 cpc r19, r31 2e390: 58 f4 brcc .+22 ; 0x2e3a8 accelerate_1_step(axes, -dec, delay_us, delay_us); 2e392: a7 01 movw r20, r14 2e394: 68 e1 ldi r22, 0x18 ; 24 2e396: 7c ef ldi r23, 0xFC ; 252 2e398: 84 e0 ldi r24, 0x04 ; 4 2e39a: 0e 94 ed e9 call 0x1d3da ; 0x1d3da update_position_1_step(axes, dir); 2e39e: 60 e0 ldi r22, 0x00 ; 0 2e3a0: 84 e0 ldi r24, 0x04 ; 4 2e3a2: 0e 94 35 eb call 0x1d66a ; 0x1d66a 2e3a6: ee cf rjmp .-36 ; 0x2e384 } } stop_smoothly(Z_AXIS_MASK, Z_PLUS_MASK, Z_ACCEL, current_delay_us); /// move down to trigger sm4_set_dir(Z_AXIS, Z_MINUS); 2e3a8: 61 e0 ldi r22, 0x01 ; 1 2e3aa: 82 e0 ldi r24, 0x02 ; 2 2e3ac: 0f 94 1c 52 call 0x2a438 ; 0x2a438 /// speed up current_delay_us = MAX_DELAY; 2e3b0: 20 e1 ldi r18, 0x10 ; 16 2e3b2: 37 e2 ldi r19, 0x27 ; 39 2e3b4: f7 01 movw r30, r14 2e3b6: 31 83 std Z+1, r19 ; 0x01 2e3b8: 20 83 st Z, r18 for (start_z = _Z; _Z > (min_z + start_z) / 2; --_Z_){ 2e3ba: 00 91 bb 06 lds r16, 0x06BB ; 0x8006bb 2e3be: 10 91 bc 06 lds r17, 0x06BC ; 0x8006bc 2e3c2: 20 91 bd 06 lds r18, 0x06BD ; 0x8006bd 2e3c6: 30 91 be 06 lds r19, 0x06BE ; 0x8006be 2e3ca: 0c 0d add r16, r12 2e3cc: 1d 1d adc r17, r13 2e3ce: 17 ff sbrs r17, 7 2e3d0: 02 c0 rjmp .+4 ; 0x2e3d6 2e3d2: 0f 5f subi r16, 0xFF ; 255 2e3d4: 1f 4f sbci r17, 0xFF ; 255 2e3d6: 15 95 asr r17 2e3d8: 07 95 ror r16 2e3da: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 2e3de: 90 91 bc 06 lds r25, 0x06BC ; 0x8006bc 2e3e2: a0 91 bd 06 lds r26, 0x06BD ; 0x8006bd 2e3e6: b0 91 be 06 lds r27, 0x06BE ; 0x8006be 2e3ea: 08 17 cp r16, r24 2e3ec: 19 07 cpc r17, r25 2e3ee: 0c f0 brlt .+2 ; 0x2e3f2 2e3f0: d9 c0 rjmp .+434 ; 0x2e5a4 if (_PINDA){ 2e3f2: 1c 9b sbis 0x03, 4 ; 3 2e3f4: bb c0 rjmp .+374 ; 0x2e56c z_trig = _Z; 2e3f6: 00 91 bb 06 lds r16, 0x06BB ; 0x8006bb 2e3fa: 10 91 bc 06 lds r17, 0x06BC ; 0x8006bc 2e3fe: 20 91 bd 06 lds r18, 0x06BD ; 0x8006bd 2e402: 30 91 be 06 lds r19, 0x06BE ; 0x8006be break; } accelerate_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, Z_MIN_DELAY); } /// slow down if (!_PINDA){ 2e406: 1c 99 sbic 0x03, 4 ; 3 2e408: 28 c0 rjmp .+80 ; 0x2e45a steps_to_go = MAX(0, _Z - min_z); 2e40a: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 2e40e: 90 91 bc 06 lds r25, 0x06BC ; 0x8006bc 2e412: a0 91 bd 06 lds r26, 0x06BD ; 0x8006bd 2e416: b0 91 be 06 lds r27, 0x06BE ; 0x8006be 2e41a: 8c 19 sub r24, r12 2e41c: 9d 09 sbc r25, r13 2e41e: 97 ff sbrs r25, 7 2e420: 02 c0 rjmp .+4 ; 0x2e426 2e422: 90 e0 ldi r25, 0x00 ; 0 2e424: 80 e0 ldi r24, 0x00 ; 0 2e426: 25 96 adiw r28, 0x05 ; 5 2e428: 9f af std Y+63, r25 ; 0x3f 2e42a: 8e af std Y+62, r24 ; 0x3e 2e42c: 25 97 sbiw r28, 0x05 ; 5 while (!_PINDA && _Z > min_z){ 2e42e: 1c 99 sbic 0x03, 4 ; 3 2e430: 0c c0 rjmp .+24 ; 0x2e44a 2e432: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 2e436: 90 91 bc 06 lds r25, 0x06BC ; 0x8006bc 2e43a: a0 91 bd 06 lds r26, 0x06BD ; 0x8006bd 2e43e: b0 91 be 06 lds r27, 0x06BE ; 0x8006be 2e442: c8 16 cp r12, r24 2e444: d9 06 cpc r13, r25 2e446: 0c f4 brge .+2 ; 0x2e44a 2e448: af c0 rjmp .+350 ; 0x2e5a8 go_and_stop_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, steps_to_go); --_Z_; } z_trig = _Z; 2e44a: 00 91 bb 06 lds r16, 0x06BB ; 0x8006bb 2e44e: 10 91 bc 06 lds r17, 0x06BC ; 0x8006bc 2e452: 20 91 bd 06 lds r18, 0x06BD ; 0x8006bd 2e456: 30 91 be 06 lds r19, 0x06BE ; 0x8006be } /// slow down to stop but not lower than min_z while (_Z > min_z && current_delay_us < MAX_DELAY){ 2e45a: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 2e45e: 90 91 bc 06 lds r25, 0x06BC ; 0x8006bc 2e462: a0 91 bd 06 lds r26, 0x06BD ; 0x8006bd 2e466: b0 91 be 06 lds r27, 0x06BE ; 0x8006be 2e46a: c8 16 cp r12, r24 2e46c: d9 06 cpc r13, r25 2e46e: 3c f4 brge .+14 ; 0x2e47e 2e470: f7 01 movw r30, r14 2e472: 80 81 ld r24, Z 2e474: 91 81 ldd r25, Z+1 ; 0x01 2e476: 80 31 cpi r24, 0x10 ; 16 2e478: 97 42 sbci r25, 0x27 ; 39 2e47a: 08 f4 brcc .+2 ; 0x2e47e 2e47c: b2 c0 rjmp .+356 ; 0x2e5e2 2e47e: 0c 19 sub r16, r12 2e480: 1d 09 sbc r17, r13 accelerate_1_step(Z_AXIS_MASK, -Z_ACCEL, current_delay_us, Z_MIN_DELAY); --_Z_; } if (d == 0){ 2e482: 31 10 cpse r3, r1 2e484: ca c0 rjmp .+404 ; 0x2e61a line_buffer[c] = (uint16_t)(z_trig - min_z); 2e486: f3 01 movw r30, r6 2e488: ee 0f add r30, r30 2e48a: ff 1f adc r31, r31 2e48c: 21 e0 ldi r18, 0x01 ; 1 2e48e: 30 e0 ldi r19, 0x00 ; 0 2e490: 2c 0f add r18, r28 2e492: 3d 1f adc r19, r29 2e494: e2 0f add r30, r18 2e496: f3 1f adc r31, r19 2e498: 11 83 std Z+1, r17 ; 0x01 2e49a: 00 83 st Z, r16 2e49c: ff ef ldi r31, 0xFF ; 255 2e49e: 6f 1a sub r6, r31 2e4a0: 7f 0a sbc r7, r31 2e4a2: 67 96 adiw r28, 0x17 ; 23 2e4a4: 2e ad ldd r18, Y+62 ; 0x3e 2e4a6: 3f ad ldd r19, Y+63 ; 0x3f 2e4a8: 67 97 sbiw r28, 0x17 ; 23 2e4aa: 82 0e add r8, r18 2e4ac: 93 1e adc r9, r19 2e4ae: 2d 96 adiw r28, 0x0d ; 13 2e4b0: 8e ad ldd r24, Y+62 ; 0x3e 2e4b2: 9f ad ldd r25, Y+63 ; 0x3f 2e4b4: 2d 97 sbiw r28, 0x0d ; 13 2e4b6: 02 97 sbiw r24, 0x02 ; 2 2e4b8: 2d 96 adiw r28, 0x0d ; 13 2e4ba: 9f af std Y+63, r25 ; 0x3f 2e4bc: 8e af std Y+62, r24 ; 0x3e 2e4be: 2d 97 sbiw r28, 0x0d ; 13 2e4c0: 2f 96 adiw r28, 0x0f ; 15 2e4c2: ee ad ldd r30, Y+62 ; 0x3e 2e4c4: ff ad ldd r31, Y+63 ; 0x3f 2e4c6: 2f 97 sbiw r28, 0x0f ; 15 2e4c8: 31 97 sbiw r30, 0x01 ; 1 2e4ca: 2f 96 adiw r28, 0x0f ; 15 2e4cc: ff af std Y+63, r31 ; 0x3f 2e4ce: ee af std Y+62, r30 ; 0x3e 2e4d0: 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 2e4d2: f0 e2 ldi r31, 0x20 ; 32 2e4d4: 6f 16 cp r6, r31 2e4d6: 71 04 cpc r7, r1 2e4d8: 09 f0 breq .+2 ; 0x2e4dc 2e4da: 59 ce rjmp .-846 ; 0x2e18e 2e4dc: 21 e0 ldi r18, 0x01 ; 1 2e4de: 42 1a sub r4, r18 2e4e0: 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){ 2e4e2: 31 e0 ldi r19, 0x01 ; 1 2e4e4: 33 12 cpse r3, r19 2e4e6: 8d ce rjmp .-742 ; 0x2e202 2e4e8: 61 96 adiw r28, 0x11 ; 17 2e4ea: 8e ad ldd r24, Y+62 ; 0x3e 2e4ec: 9f ad ldd r25, Y+63 ; 0x3f 2e4ee: 61 97 sbiw r28, 0x11 ; 17 2e4f0: 80 96 adiw r24, 0x20 ; 32 2e4f2: 61 96 adiw r28, 0x11 ; 17 2e4f4: 9f af std Y+63, r25 ; 0x3f 2e4f6: 8e af std Y+62, r24 ; 0x3e 2e4f8: 61 97 sbiw r28, 0x11 ; 17 2e4fa: 2b 96 adiw r28, 0x0b ; 11 2e4fc: ee ad ldd r30, Y+62 ; 0x3e 2e4fe: ff ad ldd r31, Y+63 ; 0x3f 2e500: 2b 97 sbiw r28, 0x0b ; 11 2e502: e0 5c subi r30, 0xC0 ; 192 2e504: ff 4f sbci r31, 0xFF ; 255 2e506: 2b 96 adiw r28, 0x0b ; 11 2e508: ff af std Y+63, r31 ; 0x3f 2e50a: ee af std Y+62, r30 ; 0x3e 2e50c: 2b 97 sbiw r28, 0x0b ; 11 2e50e: 29 96 adiw r28, 0x09 ; 9 2e510: 2e ad ldd r18, Y+62 ; 0x3e 2e512: 3f ad ldd r19, Y+63 ; 0x3f 2e514: 29 97 sbiw r28, 0x09 ; 9 2e516: 22 50 subi r18, 0x02 ; 2 2e518: 31 09 sbc r19, r1 2e51a: 29 96 adiw r28, 0x09 ; 9 2e51c: 3f af std Y+63, r19 ; 0x3f 2e51e: 2e af std Y+62, r18 ; 0x3e 2e520: 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 2e522: 23 2b or r18, r19 2e524: 09 f0 breq .+2 ; 0x2e528 2e526: 72 cd rjmp .-1308 ; 0x2e00c 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); 2e528: 85 e7 ldi r24, 0x75 ; 117 2e52a: 96 ea ldi r25, 0xA6 ; 166 2e52c: 9f 93 push r25 2e52e: 8f 93 push r24 2e530: 0f 94 de da call 0x3b5bc ; 0x3b5bc 2e534: 0f 90 pop r0 2e536: 0f 90 pop r0 } 2e538: c6 5a subi r28, 0xA6 ; 166 2e53a: df 4f sbci r29, 0xFF ; 255 2e53c: 0f b6 in r0, 0x3f ; 63 2e53e: f8 94 cli 2e540: de bf out 0x3e, r29 ; 62 2e542: 0f be out 0x3f, r0 ; 63 2e544: cd bf out 0x3d, r28 ; 61 2e546: df 91 pop r29 2e548: cf 91 pop r28 2e54a: 1f 91 pop r17 2e54c: 0f 91 pop r16 2e54e: ff 90 pop r15 2e550: ef 90 pop r14 2e552: df 90 pop r13 2e554: cf 90 pop r12 2e556: bf 90 pop r11 2e558: af 90 pop r10 2e55a: 9f 90 pop r9 2e55c: 8f 90 pop r8 2e55e: 7f 90 pop r7 2e560: 6f 90 pop r6 2e562: 5f 90 pop r5 2e564: 4f 90 pop r4 2e566: 3f 90 pop r3 2e568: 2f 90 pop r2 2e56a: 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); 2e56c: 28 ec ldi r18, 0xC8 ; 200 2e56e: 30 e0 ldi r19, 0x00 ; 0 2e570: a7 01 movw r20, r14 2e572: 68 ee ldi r22, 0xE8 ; 232 2e574: 73 e0 ldi r23, 0x03 ; 3 2e576: 84 e0 ldi r24, 0x04 ; 4 2e578: 0e 94 ed e9 call 0x1d3da ; 0x1d3da /// 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_){ 2e57c: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 2e580: 90 91 bc 06 lds r25, 0x06BC ; 0x8006bc 2e584: a0 91 bd 06 lds r26, 0x06BD ; 0x8006bd 2e588: b0 91 be 06 lds r27, 0x06BE ; 0x8006be 2e58c: 01 97 sbiw r24, 0x01 ; 1 2e58e: a1 09 sbc r26, r1 2e590: b1 09 sbc r27, r1 2e592: 80 93 bb 06 sts 0x06BB, r24 ; 0x8006bb 2e596: 90 93 bc 06 sts 0x06BC, r25 ; 0x8006bc 2e59a: a0 93 bd 06 sts 0x06BD, r26 ; 0x8006bd 2e59e: b0 93 be 06 sts 0x06BE, r27 ; 0x8006be 2e5a2: 1b cf rjmp .-458 ; 0x2e3da 2e5a4: 86 01 movw r16, r12 2e5a6: 2f cf rjmp .-418 ; 0x2e406 } /// 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); 2e5a8: 9e 01 movw r18, r28 2e5aa: 2d 5b subi r18, 0xBD ; 189 2e5ac: 3f 4f sbci r19, 0xFF ; 255 2e5ae: a7 01 movw r20, r14 2e5b0: 68 ee ldi r22, 0xE8 ; 232 2e5b2: 73 e0 ldi r23, 0x03 ; 3 2e5b4: 84 e0 ldi r24, 0x04 ; 4 2e5b6: 0e 94 93 ea call 0x1d526 ; 0x1d526 --_Z_; 2e5ba: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 2e5be: 90 91 bc 06 lds r25, 0x06BC ; 0x8006bc 2e5c2: a0 91 bd 06 lds r26, 0x06BD ; 0x8006bd 2e5c6: b0 91 be 06 lds r27, 0x06BE ; 0x8006be 2e5ca: 01 97 sbiw r24, 0x01 ; 1 2e5cc: a1 09 sbc r26, r1 2e5ce: b1 09 sbc r27, r1 2e5d0: 80 93 bb 06 sts 0x06BB, r24 ; 0x8006bb 2e5d4: 90 93 bc 06 sts 0x06BC, r25 ; 0x8006bc 2e5d8: a0 93 bd 06 sts 0x06BD, r26 ; 0x8006bd 2e5dc: b0 93 be 06 sts 0x06BE, r27 ; 0x8006be 2e5e0: 26 cf rjmp .-436 ; 0x2e42e } 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); 2e5e2: 28 ec ldi r18, 0xC8 ; 200 2e5e4: 30 e0 ldi r19, 0x00 ; 0 2e5e6: a7 01 movw r20, r14 2e5e8: 68 e1 ldi r22, 0x18 ; 24 2e5ea: 7c ef ldi r23, 0xFC ; 252 2e5ec: 84 e0 ldi r24, 0x04 ; 4 2e5ee: 0e 94 ed e9 call 0x1d3da ; 0x1d3da --_Z_; 2e5f2: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 2e5f6: 90 91 bc 06 lds r25, 0x06BC ; 0x8006bc 2e5fa: a0 91 bd 06 lds r26, 0x06BD ; 0x8006bd 2e5fe: b0 91 be 06 lds r27, 0x06BE ; 0x8006be 2e602: 01 97 sbiw r24, 0x01 ; 1 2e604: a1 09 sbc r26, r1 2e606: b1 09 sbc r27, r1 2e608: 80 93 bb 06 sts 0x06BB, r24 ; 0x8006bb 2e60c: 90 93 bc 06 sts 0x06BC, r25 ; 0x8006bc 2e610: a0 93 bd 06 sts 0x06BD, r26 ; 0x8006bd 2e614: b0 93 be 06 sts 0x06BE, r27 ; 0x8006be 2e618: 20 cf rjmp .-448 ; 0x2e45a 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); 2e61a: 2d 96 adiw r28, 0x0d ; 13 2e61c: ee ad ldd r30, Y+62 ; 0x3e 2e61e: ff ad ldd r31, Y+63 ; 0x3f 2e620: 2d 97 sbiw r28, 0x0d ; 13 2e622: 86 ad ldd r24, Z+62 ; 0x3e 2e624: 97 ad ldd r25, Z+63 ; 0x3f 2e626: 01 2e mov r0, r17 2e628: 00 0c add r0, r0 2e62a: 22 0b sbc r18, r18 2e62c: 33 0b sbc r19, r19 2e62e: 08 0f add r16, r24 2e630: 19 1f adc r17, r25 2e632: 21 1d adc r18, r1 2e634: 31 1d adc r19, r1 2e636: 36 95 lsr r19 2e638: 27 95 ror r18 2e63a: 17 95 ror r17 2e63c: 07 95 ror r16 2e63e: 0f 3f cpi r16, 0xFF ; 255 2e640: 11 05 cpc r17, r1 2e642: 21 05 cpc r18, r1 2e644: 31 05 cpc r19, r1 2e646: 29 f0 breq .+10 ; 0x2e652 2e648: 20 f0 brcs .+8 ; 0x2e652 2e64a: 0f ef ldi r16, 0xFF ; 255 2e64c: 10 e0 ldi r17, 0x00 ; 0 2e64e: 20 e0 ldi r18, 0x00 ; 0 2e650: 30 e0 ldi r19, 0x00 ; 0 2e652: 2f 96 adiw r28, 0x0f ; 15 2e654: ee ad ldd r30, Y+62 ; 0x3e 2e656: ff ad ldd r31, Y+63 ; 0x3f 2e658: 2f 97 sbiw r28, 0x0f ; 15 2e65a: 07 8f std Z+31, r16 ; 0x1f 2e65c: 1f cf rjmp .-450 ; 0x2e49c 0002e65e : 2e65e: ef 92 push r14 2e660: ff 92 push r15 2e662: 0f 93 push r16 2e664: 1f 93 push r17 2e666: cf 93 push r28 2e668: df 93 push r29 2e66a: cd b7 in r28, 0x3d ; 61 2e66c: de b7 in r29, 0x3e ; 62 2e66e: 2f 97 sbiw r28, 0x0f ; 15 2e670: 0f b6 in r0, 0x3f ; 63 2e672: f8 94 cli 2e674: de bf out 0x3e, r29 ; 62 2e676: 0f be out 0x3f, r0 ; 63 2e678: cd bf out 0x3d, r28 ; 61 2e67a: e0 eb ldi r30, 0xB0 ; 176 2e67c: f2 e1 ldi r31, 0x12 ; 18 2e67e: 10 a2 std Z+32, r1 ; 0x20 2e680: 11 a2 std Z+33, r1 ; 0x21 2e682: 12 a2 std Z+34, r1 ; 0x22 2e684: 13 a2 std Z+35, r1 ; 0x23 2e686: 14 a2 std Z+36, r1 ; 0x24 2e688: 15 a2 std Z+37, r1 ; 0x25 2e68a: 16 a2 std Z+38, r1 ; 0x26 2e68c: 17 a2 std Z+39, r1 ; 0x27 2e68e: 10 a6 std Z+40, r1 ; 0x28 2e690: 11 a6 std Z+41, r1 ; 0x29 2e692: 10 92 49 13 sts 0x1349, r1 ; 0x801349 2e696: 0b e4 ldi r16, 0x4B ; 75 2e698: 13 e1 ldi r17, 0x13 ; 19 2e69a: ee 24 eor r14, r14 2e69c: e3 94 inc r14 2e69e: f1 2c mov r15, r1 2e6a0: d8 01 movw r26, r16 2e6a2: 11 96 adiw r26, 0x01 ; 1 2e6a4: fc 92 st X, r15 2e6a6: ee 92 st -X, r14 2e6a8: 12 96 adiw r26, 0x02 ; 2 2e6aa: 1c 92 st X, r1 2e6ac: 12 97 sbiw r26, 0x02 ; 2 2e6ae: 82 e8 ldi r24, 0x82 ; 130 2e6b0: 13 96 adiw r26, 0x03 ; 3 2e6b2: 8c 93 st X, r24 2e6b4: 40 e0 ldi r20, 0x00 ; 0 2e6b6: 60 e0 ldi r22, 0x00 ; 0 2e6b8: 80 e5 ldi r24, 0x50 ; 80 2e6ba: 93 e1 ldi r25, 0x13 ; 19 2e6bc: 0f 94 8d c5 call 0x38b1a ; 0x38b1a 2e6c0: 40 e0 ldi r20, 0x00 ; 0 2e6c2: 60 e0 ldi r22, 0x00 ; 0 2e6c4: 85 e5 ldi r24, 0x55 ; 85 2e6c6: 93 e1 ldi r25, 0x13 ; 19 2e6c8: 0f 94 8d c5 call 0x38b1a ; 0x38b1a 2e6cc: f8 01 movw r30, r16 2e6ce: 17 86 std Z+15, r1 ; 0x0f 2e6d0: 10 8a std Z+16, r1 ; 0x10 2e6d2: 11 8a std Z+17, r1 ; 0x11 2e6d4: 12 8a std Z+18, r1 ; 0x12 2e6d6: 13 8a std Z+19, r1 ; 0x13 2e6d8: 8a e0 ldi r24, 0x0A ; 10 2e6da: 84 8b std Z+20, r24 ; 0x14 2e6dc: 40 e0 ldi r20, 0x00 ; 0 2e6de: 60 e0 ldi r22, 0x00 ; 0 2e6e0: ce 01 movw r24, r28 2e6e2: 01 96 adiw r24, 0x01 ; 1 2e6e4: 0f 94 8d c5 call 0x38b1a ; 0x38b1a 2e6e8: 85 e0 ldi r24, 0x05 ; 5 2e6ea: fe 01 movw r30, r28 2e6ec: 31 96 adiw r30, 0x01 ; 1 2e6ee: de 01 movw r26, r28 2e6f0: 16 96 adiw r26, 0x06 ; 6 2e6f2: 01 90 ld r0, Z+ 2e6f4: 0d 92 st X+, r0 2e6f6: 8a 95 dec r24 2e6f8: e1 f7 brne .-8 ; 0x2e6f2 2e6fa: 85 e0 ldi r24, 0x05 ; 5 2e6fc: fe 01 movw r30, r28 2e6fe: 36 96 adiw r30, 0x06 ; 6 2e700: a0 e6 ldi r26, 0x60 ; 96 2e702: b3 e1 ldi r27, 0x13 ; 19 2e704: 01 90 ld r0, Z+ 2e706: 0d 92 st X+, r0 2e708: 8a 95 dec r24 2e70a: e1 f7 brne .-8 ; 0x2e704 2e70c: d8 01 movw r26, r16 2e70e: 5a 96 adiw r26, 0x1a ; 26 2e710: 1c 92 st X, r1 2e712: 5a 97 sbiw r26, 0x1a ; 26 2e714: 5c 96 adiw r26, 0x1c ; 28 2e716: 1c 92 st X, r1 2e718: 1e 92 st -X, r1 2e71a: 5b 97 sbiw r26, 0x1b ; 27 2e71c: 80 e6 ldi r24, 0x60 ; 96 2e71e: 93 e1 ldi r25, 0x13 ; 19 2e720: 0f 94 7c c5 call 0x38af8 ; 0x38af8 2e724: f8 01 movw r30, r16 2e726: 81 8f std Z+25, r24 ; 0x19 2e728: 15 8e std Z+29, r1 ; 0x1d 2e72a: 16 8e std Z+30, r1 ; 0x1e 2e72c: 40 e0 ldi r20, 0x00 ; 0 2e72e: 60 e0 ldi r22, 0x00 ; 0 2e730: 8a e6 ldi r24, 0x6A ; 106 2e732: 93 e1 ldi r25, 0x13 ; 19 2e734: 0f 94 8d c5 call 0x38b1a ; 0x38b1a 2e738: d8 01 movw r26, r16 2e73a: 94 96 adiw r26, 0x24 ; 36 2e73c: 1c 92 st X, r1 2e73e: 40 e0 ldi r20, 0x00 ; 0 2e740: 60 e0 ldi r22, 0x00 ; 0 2e742: ce 01 movw r24, r28 2e744: 0b 96 adiw r24, 0x0b ; 11 2e746: 0f 94 8d c5 call 0x38b1a ; 0x38b1a 2e74a: 85 e0 ldi r24, 0x05 ; 5 2e74c: fe 01 movw r30, r28 2e74e: 3b 96 adiw r30, 0x0b ; 11 2e750: de 01 movw r26, r28 2e752: 11 96 adiw r26, 0x01 ; 1 2e754: 01 90 ld r0, Z+ 2e756: 0d 92 st X+, r0 2e758: 8a 95 dec r24 2e75a: e1 f7 brne .-8 ; 0x2e754 2e75c: 85 e0 ldi r24, 0x05 ; 5 2e75e: fe 01 movw r30, r28 2e760: 31 96 adiw r30, 0x01 ; 1 2e762: a0 e7 ldi r26, 0x70 ; 112 2e764: b3 e1 ldi r27, 0x13 ; 19 2e766: 01 90 ld r0, Z+ 2e768: 0d 92 st X+, r0 2e76a: 8a 95 dec r24 2e76c: e1 f7 brne .-8 ; 0x2e766 2e76e: f8 01 movw r30, r16 2e770: 12 a6 std Z+42, r1 ; 0x2a 2e772: 14 a6 std Z+44, r1 ; 0x2c 2e774: 13 a6 std Z+43, r1 ; 0x2b 2e776: 80 e7 ldi r24, 0x70 ; 112 2e778: 93 e1 ldi r25, 0x13 ; 19 2e77a: 0f 94 7c c5 call 0x38af8 ; 0x38af8 2e77e: d8 01 movw r26, r16 2e780: 99 96 adiw r26, 0x29 ; 41 2e782: 8c 93 st X, r24 2e784: 99 97 sbiw r26, 0x29 ; 41 2e786: dd 96 adiw r26, 0x3d ; 61 2e788: 1c 92 st X, r1 2e78a: dd 97 sbiw r26, 0x3d ; 61 2e78c: 8a e4 ldi r24, 0x4A ; 74 2e78e: 93 e1 ldi r25, 0x13 ; 19 2e790: df 96 adiw r26, 0x3f ; 63 2e792: 9c 93 st X, r25 2e794: 8e 93 st -X, r24 2e796: de 97 sbiw r26, 0x3e ; 62 2e798: f0 92 8c 13 sts 0x138C, r15 ; 0x80138c 2e79c: e0 92 8b 13 sts 0x138B, r14 ; 0x80138b 2e7a0: 10 92 8d 13 sts 0x138D, r1 ; 0x80138d 2e7a4: 1f ef ldi r17, 0xFF ; 255 2e7a6: 10 93 8e 13 sts 0x138E, r17 ; 0x80138e 2e7aa: 0f 94 e5 c5 call 0x38bca ; 0x38bca 2e7ae: 80 93 8f 13 sts 0x138F, r24 ; 0x80138f 2e7b2: 10 92 90 13 sts 0x1390, r1 ; 0x801390 2e7b6: 10 92 91 13 sts 0x1391, r1 ; 0x801391 2e7ba: 10 92 92 13 sts 0x1392, r1 ; 0x801392 2e7be: 10 92 94 13 sts 0x1394, r1 ; 0x801394 2e7c2: 10 92 93 13 sts 0x1393, r1 ; 0x801393 2e7c6: 10 92 96 13 sts 0x1396, r1 ; 0x801396 2e7ca: 10 92 95 13 sts 0x1395, r1 ; 0x801395 2e7ce: 10 92 99 13 sts 0x1399, r1 ; 0x801399 2e7d2: 10 92 9a 13 sts 0x139A, r1 ; 0x80139a 2e7d6: 10 92 9b 13 sts 0x139B, r1 ; 0x80139b 2e7da: 10 92 9c 13 sts 0x139C, r1 ; 0x80139c 2e7de: 83 e0 ldi r24, 0x03 ; 3 2e7e0: 80 93 9f 13 sts 0x139F, r24 ; 0x80139f 2e7e4: 10 92 a0 13 sts 0x13A0, r1 ; 0x8013a0 2e7e8: 85 e1 ldi r24, 0x15 ; 21 2e7ea: 80 93 97 13 sts 0x1397, r24 ; 0x801397 2e7ee: 84 e1 ldi r24, 0x14 ; 20 2e7f0: 80 93 98 13 sts 0x1398, r24 ; 0x801398 2e7f4: 83 e6 ldi r24, 0x63 ; 99 2e7f6: 80 93 a1 13 sts 0x13A1, r24 ; 0x8013a1 2e7fa: 80 93 a2 13 sts 0x13A2, r24 ; 0x8013a2 2e7fe: 10 92 a3 13 sts 0x13A3, r1 ; 0x8013a3 2e802: 10 92 a4 13 sts 0x13A4, r1 ; 0x8013a4 2e806: 10 92 a5 13 sts 0x13A5, r1 ; 0x8013a5 2e80a: 10 92 a6 13 sts 0x13A6, r1 ; 0x8013a6 2e80e: 10 92 a7 13 sts 0x13A7, r1 ; 0x8013a7 2e812: 10 92 a8 13 sts 0x13A8, r1 ; 0x8013a8 2e816: 10 92 a9 13 sts 0x13A9, r1 ; 0x8013a9 2e81a: 10 92 aa 13 sts 0x13AA, r1 ; 0x8013aa 2e81e: 10 92 ab 13 sts 0x13AB, r1 ; 0x8013ab 2e822: 10 92 ac 13 sts 0x13AC, r1 ; 0x8013ac 2e826: 10 92 ad 13 sts 0x13AD, r1 ; 0x8013ad 2e82a: 10 92 ae 13 sts 0x13AE, r1 ; 0x8013ae 2e82e: 10 92 b0 13 sts 0x13B0, r1 ; 0x8013b0 2e832: 10 92 af 13 sts 0x13AF, r1 ; 0x8013af 2e836: 10 92 b1 13 sts 0x13B1, r1 ; 0x8013b1 2e83a: 8e e2 ldi r24, 0x2E ; 46 2e83c: 90 e8 ldi r25, 0x80 ; 128 2e83e: 90 93 b3 13 sts 0x13B3, r25 ; 0x8013b3 2e842: 80 93 b2 13 sts 0x13B2, r24 ; 0x8013b2 2e846: 10 93 b4 13 sts 0x13B4, r17 ; 0x8013b4 2e84a: 10 93 b5 13 sts 0x13B5, r17 ; 0x8013b5 2e84e: 10 92 b7 13 sts 0x13B7, r1 ; 0x8013b7 2e852: 10 92 b6 13 sts 0x13B6, r1 ; 0x8013b6 2e856: 10 93 b8 13 sts 0x13B8, r17 ; 0x8013b8 2e85a: 82 e0 ldi r24, 0x02 ; 2 2e85c: 80 93 b9 13 sts 0x13B9, r24 ; 0x8013b9 2e860: 10 92 ba 13 sts 0x13BA, r1 ; 0x8013ba 2e864: 10 92 bb 13 sts 0x13BB, r1 ; 0x8013bb 2e868: 10 92 bc 13 sts 0x13BC, r1 ; 0x8013bc 2e86c: 10 92 bd 13 sts 0x13BD, r1 ; 0x8013bd 2e870: 10 92 bf 13 sts 0x13BF, r1 ; 0x8013bf 2e874: 10 92 be 13 sts 0x13BE, r1 ; 0x8013be 2e878: 10 92 c1 13 sts 0x13C1, r1 ; 0x8013c1 2e87c: 10 92 c0 13 sts 0x13C0, r1 ; 0x8013c0 2e880: 0f 94 4d 8c call 0x3189a ; 0x3189a 2e884: ee e8 ldi r30, 0x8E ; 142 2e886: f4 e1 ldi r31, 0x14 ; 20 2e888: 10 92 16 15 sts 0x1516, r1 ; 0x801516 2e88c: 10 92 19 15 sts 0x1519, r1 ; 0x801519 2e890: 10 92 3b 15 sts 0x153B, r1 ; 0x80153b 2e894: 10 92 3e 15 sts 0x153E, r1 ; 0x80153e 2e898: 89 e1 ldi r24, 0x19 ; 25 2e89a: 80 93 fd 16 sts 0x16FD, r24 ; 0x8016fd 2e89e: 10 92 00 17 sts 0x1700, r1 ; 0x801700 2e8a2: 10 92 01 17 sts 0x1701, r1 ; 0x801701 2e8a6: 10 92 19 17 sts 0x1719, r1 ; 0x801719 2e8aa: 10 92 20 17 sts 0x1720, r1 ; 0x801720 2e8ae: 10 92 23 17 sts 0x1723, r1 ; 0x801723 2e8b2: 10 92 a1 17 sts 0x17A1, r1 ; 0x8017a1 2e8b6: 10 92 a3 17 sts 0x17A3, r1 ; 0x8017a3 2e8ba: 10 92 a2 17 sts 0x17A2, r1 ; 0x8017a2 2e8be: 10 92 32 16 sts 0x1632, r1 ; 0x801632 2e8c2: 10 92 31 16 sts 0x1631, r1 ; 0x801631 2e8c6: 10 92 9d 17 sts 0x179D, r1 ; 0x80179d 2e8ca: 10 92 9e 17 sts 0x179E, r1 ; 0x80179e 2e8ce: 10 92 9f 17 sts 0x179F, r1 ; 0x80179f 2e8d2: 10 92 a0 17 sts 0x17A0, r1 ; 0x8017a0 2e8d6: 10 92 a4 17 sts 0x17A4, r1 ; 0x8017a4 2e8da: 10 92 a5 17 sts 0x17A5, r1 ; 0x8017a5 2e8de: 10 92 a6 17 sts 0x17A6, r1 ; 0x8017a6 2e8e2: 10 92 a7 17 sts 0x17A7, r1 ; 0x8017a7 2e8e6: 12 82 std Z+2, r1 ; 0x02 2e8e8: 13 82 std Z+3, r1 ; 0x03 2e8ea: 10 82 st Z, r1 2e8ec: 11 82 std Z+1, r1 ; 0x01 2e8ee: 10 92 30 16 sts 0x1630, r1 ; 0x801630 2e8f2: 10 92 43 17 sts 0x1743, r1 ; 0x801743 2e8f6: ee e5 ldi r30, 0x5E ; 94 2e8f8: f5 e1 ldi r31, 0x15 ; 21 2e8fa: 82 ed ldi r24, 0xD2 ; 210 2e8fc: df 01 movw r26, r30 2e8fe: 1d 92 st X+, r1 2e900: 8a 95 dec r24 2e902: e9 f7 brne .-6 ; 0x2e8fe 2e904: 10 92 df 14 sts 0x14DF, r1 ; 0x8014df 2e908: 10 92 de 14 sts 0x14DE, r1 ; 0x8014de 2e90c: 10 92 dd 14 sts 0x14DD, r1 ; 0x8014dd 2e910: 81 ea ldi r24, 0xA1 ; 161 2e912: 97 e1 ldi r25, 0x17 ; 23 2e914: 0f 94 ad 29 call 0x2535a ; 0x2535a ::start()> 2e918: e7 e8 ldi r30, 0x87 ; 135 2e91a: f4 e1 ldi r31, 0x14 ; 20 2e91c: 11 82 std Z+1, r1 ; 0x01 2e91e: 12 82 std Z+2, r1 ; 0x02 2e920: 13 82 std Z+3, r1 ; 0x03 2e922: 14 82 std Z+4, r1 ; 0x04 2e924: 15 82 std Z+5, r1 ; 0x05 2e926: 16 82 std Z+6, r1 ; 0x06 2e928: 10 83 st Z, r17 2e92a: ea ea ldi r30, 0xAA ; 170 2e92c: f7 e1 ldi r31, 0x17 ; 23 2e92e: 15 82 std Z+5, r1 ; 0x05 2e930: 17 82 std Z+7, r1 ; 0x07 2e932: 16 82 std Z+6, r1 ; 0x06 2e934: 11 86 std Z+9, r1 ; 0x09 2e936: 13 86 std Z+11, r1 ; 0x0b 2e938: 12 86 std Z+10, r1 ; 0x0a 2e93a: 0f 94 4c 29 call 0x25298 ; 0x25298 2e93e: 60 93 c0 17 sts 0x17C0, r22 ; 0x8017c0 2e942: 70 93 c1 17 sts 0x17C1, r23 ; 0x8017c1 2e946: 80 93 c2 17 sts 0x17C2, r24 ; 0x8017c2 2e94a: 90 93 c3 17 sts 0x17C3, r25 ; 0x8017c3 2e94e: 2f 96 adiw r28, 0x0f ; 15 2e950: 0f b6 in r0, 0x3f ; 63 2e952: f8 94 cli 2e954: de bf out 0x3e, r29 ; 62 2e956: 0f be out 0x3f, r0 ; 63 2e958: cd bf out 0x3d, r28 ; 61 2e95a: df 91 pop r29 2e95c: cf 91 pop r28 2e95e: 1f 91 pop r17 2e960: 0f 91 pop r16 2e962: ff 90 pop r15 2e964: ef 90 pop r14 2e966: 08 95 ret 0002e968 : else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 2e968: 42 e0 ldi r20, 0x02 ; 2 2e96a: 0f 94 87 d5 call 0x3ab0e ; 0x3ab0e } void MarlinSerial::println(double n, int digits) { print(n, digits); println(); 2e96e: 0d 94 fd d5 jmp 0x3abfa ; 0x3abfa 0002e972 : 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; 2e972: 80 91 a1 13 lds r24, 0x13A1 ; 0x8013a1 2e976: 83 36 cpi r24, 0x63 ; 99 2e978: 09 f4 brne .+2 ; 0x2e97c 2e97a: 8f ef ldi r24, 0xFF ; 255 } 2e97c: 08 95 ret 0002e97e : return 0; } } //------------------------------------------------------------------------------ void Sd2Card::chipSelectHigh() { WRITE(SDSS, 1); 2e97e: 9f b7 in r25, 0x3f ; 63 2e980: f8 94 cli 2e982: e5 e0 ldi r30, 0x05 ; 5 2e984: f1 e0 ldi r31, 0x01 ; 1 2e986: 80 81 ld r24, Z 2e988: 80 64 ori r24, 0x40 ; 64 2e98a: 80 83 st Z, r24 2e98c: 9f bf out 0x3f, r25 ; 63 } 2e98e: 08 95 ret 0002e990 : spiRate_ = sckRateID; return true; } //------------------------------------------------------------------------------ // wait for card to go not busy bool Sd2Card::waitNotBusy(uint16_t timeoutMillis) { 2e990: 0f 93 push r16 2e992: 1f 93 push r17 2e994: cf 93 push r28 2e996: df 93 push r29 2e998: ec 01 movw r28, r24 uint16_t t0 = _millis(); 2e99a: 0f 94 4c 29 call 0x25298 ; 0x25298 2e99e: 8b 01 movw r16, r22 while (spiRec() != 0XFF) { 2e9a0: 0f 94 4a 52 call 0x2a494 ; 0x2a494 2e9a4: 8f 3f cpi r24, 0xFF ; 255 2e9a6: 69 f0 breq .+26 ; 0x2e9c2 if (((uint16_t)_millis() - t0) >= timeoutMillis) goto fail; 2e9a8: 0f 94 4c 29 call 0x25298 ; 0x25298 2e9ac: 60 1b sub r22, r16 2e9ae: 71 0b sbc r23, r17 2e9b0: 6c 17 cp r22, r28 2e9b2: 7d 07 cpc r23, r29 2e9b4: a8 f3 brcs .-22 ; 0x2e9a0 } return true; fail: return false; 2e9b6: 80 e0 ldi r24, 0x00 ; 0 } 2e9b8: df 91 pop r29 2e9ba: cf 91 pop r28 2e9bc: 1f 91 pop r17 2e9be: 0f 91 pop r16 2e9c0: 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; 2e9c2: 81 e0 ldi r24, 0x01 ; 1 2e9c4: f9 cf rjmp .-14 ; 0x2e9b8 0002e9c6 : , tmcFailures(0) { } void MMU2::Status() { // Useful information to see during bootup and change state SERIAL_ECHOPGM("MMU is "); 2e9c6: 80 ed ldi r24, 0xD0 ; 208 2e9c8: 9b ea ldi r25, 0xAB ; 171 2e9ca: 0e 94 50 77 call 0xeea0 ; 0xeea0 uint8_t status = eeprom_init_default_byte((uint8_t*)EEPROM_MMU_ENABLED, 0); 2e9ce: 60 e0 ldi r22, 0x00 ; 0 2e9d0: 8c ea ldi r24, 0xAC ; 172 2e9d2: 9c e0 ldi r25, 0x0C ; 12 2e9d4: 0e 94 09 76 call 0xec12 ; 0xec12 if (status == 1) { 2e9d8: 81 30 cpi r24, 0x01 ; 1 2e9da: 21 f4 brne .+8 ; 0x2e9e4 SERIAL_ECHOLNRPGM(_O(MSG_ON)); 2e9dc: 8b ed ldi r24, 0xDB ; 219 2e9de: 9c e5 ldi r25, 0x5C ; 92 } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); 2e9e0: 0c 94 7b 79 jmp 0xf2f6 ; 0xf2f6 2e9e4: 85 ed ldi r24, 0xD5 ; 213 2e9e6: 9c e5 ldi r25, 0x5C ; 92 2e9e8: fb cf rjmp .-10 ; 0x2e9e0 0002e9ea : print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 2e9ea: bc 01 movw r22, r24 2e9ec: 99 0f add r25, r25 2e9ee: 88 0b sbc r24, r24 2e9f0: 99 0b sbc r25, r25 2e9f2: 0f 94 6b d5 call 0x3aad6 ; 0x3aad6 } void MarlinSerial::println(int n, int base) { print(n, base); println(); 2e9f6: 0d 94 fd d5 jmp 0x3abfa ; 0x3abfa 0002e9fa : bool cmd_buffer_empty() { return (buflen == 0); } void enquecommand_front(const char *cmd, bool from_progmem) 2e9fa: 0f 93 push r16 2e9fc: 1f 93 push r17 2e9fe: cf 93 push r28 2ea00: df 93 push r29 2ea02: ec 01 movw r28, r24 2ea04: 0f 94 da d9 call 0x3b3b4 ; 0x3b3b4 <__strlen_P> 2ea08: 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) 2ea0a: 80 36 cpi r24, 0x60 ; 96 2ea0c: 91 05 cpc r25, r1 2ea0e: 08 f0 brcs .+2 ; 0x2ea12 2ea10: 85 c0 rjmp .+266 ; 0x2eb1c return false; // Remove the currently processed command from the queue. if (! cmdbuffer_front_already_processed) { 2ea12: 80 91 a2 10 lds r24, 0x10A2 ; 0x8010a2 2ea16: 81 11 cpse r24, r1 2ea18: 05 c0 rjmp .+10 ; 0x2ea24 cmdqueue_pop_front(); 2ea1a: 0e 94 bc 76 call 0xed78 ; 0xed78 cmdbuffer_front_already_processed = true; 2ea1e: 81 e0 ldi r24, 0x01 ; 1 2ea20: 80 93 a2 10 sts 0x10A2, r24 ; 0x8010a2 } if (bufindr == bufindw && buflen > 0) 2ea24: 40 91 92 12 lds r20, 0x1292 ; 0x801292 2ea28: 50 91 93 12 lds r21, 0x1293 ; 0x801293 2ea2c: 80 91 a0 10 lds r24, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.550> 2ea30: 90 91 a1 10 lds r25, 0x10A1 ; 0x8010a1 <_ZL7bufindw.lto_priv.550+0x1> 2ea34: 48 17 cp r20, r24 2ea36: 59 07 cpc r21, r25 2ea38: 41 f4 brne .+16 ; 0x2ea4a 2ea3a: 20 91 a3 10 lds r18, 0x10A3 ; 0x8010a3 2ea3e: 30 91 a4 10 lds r19, 0x10A4 ; 0x8010a4 2ea42: 12 16 cp r1, r18 2ea44: 13 06 cpc r1, r19 2ea46: 0c f4 brge .+2 ; 0x2ea4a 2ea48: 69 c0 rjmp .+210 ; 0x2eb1c // 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; 2ea4a: 20 91 9e 10 lds r18, 0x109E ; 0x80109e 2ea4e: 30 91 9f 10 lds r19, 0x109F ; 0x80109f 2ea52: 12 16 cp r1, r18 2ea54: 13 06 cpc r1, r19 2ea56: 0c f0 brlt .+2 ; 0x2ea5a 2ea58: 41 c0 rjmp .+130 ; 0x2eadc 2ea5a: 9c 01 movw r18, r24 2ea5c: 2f 59 subi r18, 0x9F ; 159 2ea5e: 3f 4f sbci r19, 0xFF ; 255 if (bufindw < bufindr) { 2ea60: 84 17 cp r24, r20 2ea62: 95 07 cpc r25, r21 2ea64: e8 f5 brcc .+122 ; 0x2eae0 int bufindr_new = bufindr - len_asked - (1 + CMDHDRSIZE); 2ea66: 44 50 subi r20, 0x04 ; 4 2ea68: 51 09 sbc r21, r1 2ea6a: 40 1b sub r20, r16 2ea6c: 51 0b sbc r21, r17 // Simple case. There is a contiguous space between the write buffer and the read buffer. if (endw <= bufindr_new) { 2ea6e: 42 17 cp r20, r18 2ea70: 53 07 cpc r21, r19 2ea72: 0c f4 brge .+2 ; 0x2ea76 2ea74: 53 c0 rjmp .+166 ; 0x2eb1c } } 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); 2ea76: 50 93 93 12 sts 0x1293, r21 ; 0x801293 2ea7a: 40 93 92 12 sts 0x1292, r20 ; 0x801292 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; 2ea7e: 80 91 92 12 lds r24, 0x1292 ; 0x801292 2ea82: 90 91 93 12 lds r25, 0x1293 ; 0x801293 2ea86: fc 01 movw r30, r24 2ea88: eb 55 subi r30, 0x5B ; 91 2ea8a: ff 4e sbci r31, 0xEF ; 239 2ea8c: 23 e0 ldi r18, 0x03 ; 3 2ea8e: 20 83 st Z, r18 if (from_progmem) strcpy_P(cmdbuffer + bufindr + CMDHDRSIZE, cmd); 2ea90: be 01 movw r22, r28 2ea92: 88 55 subi r24, 0x58 ; 88 2ea94: 9f 4e sbci r25, 0xEF ; 239 2ea96: 0f 94 d3 d9 call 0x3b3a6 ; 0x3b3a6 else strcpy(cmdbuffer + bufindr + CMDHDRSIZE, cmd); ++ buflen; 2ea9a: 80 91 a3 10 lds r24, 0x10A3 ; 0x8010a3 2ea9e: 90 91 a4 10 lds r25, 0x10A4 ; 0x8010a4 2eaa2: 01 96 adiw r24, 0x01 ; 1 2eaa4: 90 93 a4 10 sts 0x10A4, r25 ; 0x8010a4 2eaa8: 80 93 a3 10 sts 0x10A3, r24 ; 0x8010a3 SERIAL_ECHO_START; 2eaac: 82 ec ldi r24, 0xC2 ; 194 2eaae: 9b ea ldi r25, 0xAB ; 171 2eab0: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHORPGM(enqueingFront); 2eab4: 83 ea ldi r24, 0xA3 ; 163 2eab6: 9b ea ldi r25, 0xAB ; 171 2eab8: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHO(cmdbuffer + bufindr + CMDHDRSIZE); 2eabc: 80 91 92 12 lds r24, 0x1292 ; 0x801292 2eac0: 90 91 93 12 lds r25, 0x1293 ; 0x801293 } }*/ static FORCE_INLINE void print(const char *str) { write(str); 2eac4: 88 55 subi r24, 0x58 ; 88 2eac6: 9f 4e sbci r25, 0xEF ; 239 2eac8: 0e 94 14 88 call 0x11028 ; 0x11028 SERIAL_ECHOLNPGM("\""); 2eacc: 81 ea ldi r24, 0xA1 ; 161 2eace: 9b ea ldi r25, 0xAB ; 171 SERIAL_ECHOLNRPGM(bufferFull); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } 2ead0: df 91 pop r29 2ead2: cf 91 pop r28 2ead4: 1f 91 pop r17 2ead6: 0f 91 pop r16 SERIAL_ECHORPGM(enqueingFront); if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 2ead8: 0c 94 7b 79 jmp 0xf2f6 ; 0xf2f6 // 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) 2eadc: 9c 01 movw r18, r24 2eade: c0 cf rjmp .-128 ; 0x2ea60 bufindr = bufindr_new; return true; } } else { // Otherwise the free space is split between the start and end. if (len_asked + (1 + CMDHDRSIZE) <= bufindr) { 2eae0: c8 01 movw r24, r16 2eae2: 04 96 adiw r24, 0x04 ; 4 2eae4: 48 17 cp r20, r24 2eae6: 59 07 cpc r21, r25 2eae8: 28 f0 brcs .+10 ; 0x2eaf4 // Could fit at the start. bufindr -= len_asked + (1 + CMDHDRSIZE); 2eaea: 44 50 subi r20, 0x04 ; 4 2eaec: 51 09 sbc r21, r1 2eaee: 40 1b sub r20, r16 2eaf0: 51 0b sbc r21, r17 2eaf2: c1 cf rjmp .-126 ; 0x2ea76 return true; } int bufindr_new = sizeof(cmdbuffer) - len_asked - (1 + CMDHDRSIZE); 2eaf4: 89 ee ldi r24, 0xE9 ; 233 2eaf6: 91 e0 ldi r25, 0x01 ; 1 2eaf8: bc 01 movw r22, r24 2eafa: 60 1b sub r22, r16 2eafc: 71 0b sbc r23, r17 2eafe: 8b 01 movw r16, r22 if (endw <= bufindr_new) { 2eb00: 62 17 cp r22, r18 2eb02: 73 07 cpc r23, r19 2eb04: 5c f0 brlt .+22 ; 0x2eb1c memset(cmdbuffer, 0, bufindr); 2eb06: 70 e0 ldi r23, 0x00 ; 0 2eb08: 60 e0 ldi r22, 0x00 ; 0 2eb0a: 85 ea ldi r24, 0xA5 ; 165 2eb0c: 90 e1 ldi r25, 0x10 ; 16 2eb0e: 0f 94 4e e2 call 0x3c49c ; 0x3c49c bufindr = bufindr_new; 2eb12: 10 93 93 12 sts 0x1293, r17 ; 0x801293 2eb16: 00 93 92 12 sts 0x1292, r16 ; 0x801292 2eb1a: b1 cf rjmp .-158 ; 0x2ea7e SERIAL_ECHOLNPGM("\""); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; 2eb1c: 8a e9 ldi r24, 0x9A ; 154 2eb1e: 9b ea ldi r25, 0xAB ; 171 2eb20: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHORPGM(enqueingFront); 2eb24: 83 ea ldi r24, 0xA3 ; 163 2eb26: 9b ea ldi r25, 0xAB ; 171 2eb28: 0e 94 50 77 call 0xeea0 ; 0xeea0 if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); 2eb2c: ce 01 movw r24, r28 2eb2e: 0e 94 50 77 call 0xeea0 ; 0xeea0 else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 2eb32: 83 e8 ldi r24, 0x83 ; 131 2eb34: 9b ea ldi r25, 0xAB ; 171 2eb36: cc cf rjmp .-104 ; 0x2ead0 0002eb38 : } else { return false; } } bool SdFile::seekSetFilteredGcode(uint32_t pos){ 2eb38: ab 01 movw r20, r22 2eb3a: bc 01 movw r22, r24 if(! seekSet(pos) )return false; 2eb3c: 80 e2 ldi r24, 0x20 ; 32 2eb3e: 97 e1 ldi r25, 0x17 ; 23 2eb40: 0f 94 92 56 call 0x2ad24 ; 0x2ad24 2eb44: 81 11 cpse r24, r1 2eb46: 02 c0 rjmp .+4 ; 0x2eb4c 2eb48: 80 e0 ldi r24, 0x00 ; 0 2eb4a: 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() ) 2eb4c: 80 e2 ldi r24, 0x20 ; 32 2eb4e: 97 e1 ldi r25, 0x17 ; 23 2eb50: 0f 94 19 56 call 0x2ac32 ; 0x2ac32 2eb54: 88 23 and r24, r24 2eb56: c1 f3 breq .-16 ; 0x2eb48 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; 2eb58: 20 91 41 17 lds r18, 0x1741 ; 0x801741 2eb5c: 30 91 42 17 lds r19, 0x1742 ; 0x801742 2eb60: 23 56 subi r18, 0x63 ; 99 2eb62: 31 4f sbci r19, 0xF1 ; 241 2eb64: 30 93 3c 17 sts 0x173C, r19 ; 0x80173c 2eb68: 20 93 3b 17 sts 0x173B, r18 ; 0x80173b bool SdFile::seekSetFilteredGcode(uint32_t pos){ if(! seekSet(pos) )return false; if(! gfComputeNextFileBlock() )return false; gfReset(); return true; } 2eb6c: 08 95 ret 0002eb6e : SERIAL_PROTOCOLLNPGM("An error while writing to the SD Card."); } } void CardReader::checkautostart(bool force) 2eb6e: 8f 92 push r8 2eb70: 9f 92 push r9 2eb72: af 92 push r10 2eb74: bf 92 push r11 2eb76: cf 92 push r12 2eb78: df 92 push r13 2eb7a: ef 92 push r14 2eb7c: ff 92 push r15 2eb7e: 0f 93 push r16 2eb80: 1f 93 push r17 2eb82: cf 93 push r28 2eb84: df 93 push r29 2eb86: cd b7 in r28, 0x3d ; 61 2eb88: de b7 in r29, 0x3e ; 62 2eb8a: ee 97 sbiw r28, 0x3e ; 62 2eb8c: 0f b6 in r0, 0x3f ; 63 2eb8e: f8 94 cli 2eb90: de bf out 0x3e, r29 ; 62 2eb92: 0f be out 0x3f, r0 ; 63 2eb94: cd bf out 0x3d, r28 ; 61 if(!mounted) //fail return; } char autoname[30]; sprintf_P(autoname, PSTR("auto%i.g"), lastnr); 2eb96: 80 91 de 14 lds r24, 0x14DE ; 0x8014de 2eb9a: 8f 93 push r24 2eb9c: 80 91 dd 14 lds r24, 0x14DD ; 0x8014dd 2eba0: 8f 93 push r24 2eba2: 8e e3 ldi r24, 0x3E ; 62 2eba4: 9b ea ldi r25, 0xAB ; 171 2eba6: 9f 93 push r25 2eba8: 8f 93 push r24 2ebaa: 8e 01 movw r16, r28 2ebac: 0f 5d subi r16, 0xDF ; 223 2ebae: 1f 4f sbci r17, 0xFF ; 255 2ebb0: 1f 93 push r17 2ebb2: 0f 93 push r16 2ebb4: 0f 94 33 db call 0x3b666 ; 0x3b666 2ebb8: 0f 90 pop r0 2ebba: 0f 90 pop r0 2ebbc: 0f 90 pop r0 2ebbe: 0f 90 pop r0 2ebc0: 0f 90 pop r0 2ebc2: 0f 90 pop r0 for(int8_t i=0;i<(int8_t)strlen(autoname);i++) 2ebc4: f1 2c mov r15, r1 2ebc6: f8 01 movw r30, r16 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: e0 1b sub r30, r16 2ebd2: f1 0b sbc r31, r17 2ebd4: fe 16 cp r15, r30 2ebd6: 84 f4 brge .+32 ; 0x2ebf8 autoname[i]=tolower(autoname[i]); 2ebd8: 68 01 movw r12, r16 2ebda: cf 0c add r12, r15 2ebdc: d1 1c adc r13, r1 2ebde: f7 fc sbrc r15, 7 2ebe0: da 94 dec r13 2ebe2: f6 01 movw r30, r12 2ebe4: 80 81 ld r24, Z 2ebe6: 08 2e mov r0, r24 2ebe8: 00 0c add r0, r0 2ebea: 99 0b sbc r25, r25 2ebec: 0f 94 30 e2 call 0x3c460 ; 0x3c460 2ebf0: f6 01 movw r30, r12 2ebf2: 80 83 st Z, r24 2ebf4: f3 94 inc r15 2ebf6: e7 cf rjmp .-50 ; 0x2ebc6 dir_t p; root.rewind(); 2ebf8: 86 e1 ldi r24, 0x16 ; 22 2ebfa: 95 e1 ldi r25, 0x15 ; 21 2ebfc: 0e 94 2c 77 call 0xee58 ; 0xee58 bool found=false; 2ec00: a1 2c mov r10, r1 2ec02: ce 01 movw r24, r28 2ec04: 01 96 adiw r24, 0x01 ; 1 2ec06: 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); 2ec08: 84 ef ldi r24, 0xF4 ; 244 2ec0a: c8 2e mov r12, r24 2ec0c: 80 e7 ldi r24, 0x70 ; 112 2ec0e: 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; 2ec10: 80 91 19 15 lds r24, 0x1519 ; 0x801519 2ec14: 82 30 cpi r24, 0x02 ; 2 2ec16: 08 f4 brcc .+2 ; 0x2ec1a 2ec18: 50 c0 rjmp .+160 ; 0x2ecba 2ec1a: 80 91 1e 15 lds r24, 0x151E ; 0x80151e 2ec1e: 90 91 1f 15 lds r25, 0x151F ; 0x80151f 2ec22: a0 91 20 15 lds r26, 0x1520 ; 0x801520 2ec26: b0 91 21 15 lds r27, 0x1521 ; 0x801521 2ec2a: 8f 71 andi r24, 0x1F ; 31 2ec2c: 99 27 eor r25, r25 2ec2e: aa 27 eor r26, r26 2ec30: bb 27 eor r27, r27 2ec32: 89 2b or r24, r25 2ec34: 8a 2b or r24, r26 2ec36: 8b 2b or r24, r27 2ec38: 09 f0 breq .+2 ; 0x2ec3c 2ec3a: 3f c0 rjmp .+126 ; 0x2ecba 2ec3c: 50 e0 ldi r21, 0x00 ; 0 2ec3e: 40 e0 ldi r20, 0x00 ; 0 2ec40: b7 01 movw r22, r14 2ec42: 86 e1 ldi r24, 0x16 ; 22 2ec44: 95 e1 ldi r25, 0x15 ; 21 2ec46: 0f 94 cf 59 call 0x2b39e ; 0x2b39e dir_t p; root.rewind(); bool found=false; while (root.readDir(p, NULL) > 0) 2ec4a: 18 16 cp r1, r24 2ec4c: b4 f5 brge .+108 ; 0x2ecba { for(int8_t i=0;i<(int8_t)strlen((char*)p.name);i++) 2ec4e: b1 2c mov r11, r1 2ec50: f7 01 movw r30, r14 2ec52: 01 90 ld r0, Z+ 2ec54: 00 20 and r0, r0 2ec56: e9 f7 brne .-6 ; 0x2ec52 2ec58: 31 97 sbiw r30, 0x01 ; 1 2ec5a: ee 19 sub r30, r14 2ec5c: ff 09 sbc r31, r15 2ec5e: be 16 cp r11, r30 2ec60: 74 f4 brge .+28 ; 0x2ec7e p.name[i]=tolower(p.name[i]); 2ec62: 47 01 movw r8, r14 2ec64: 8b 0c add r8, r11 2ec66: 91 1c adc r9, r1 2ec68: b7 fc sbrc r11, 7 2ec6a: 9a 94 dec r9 2ec6c: f4 01 movw r30, r8 2ec6e: 80 81 ld r24, Z 2ec70: 90 e0 ldi r25, 0x00 ; 0 2ec72: 0f 94 30 e2 call 0x3c460 ; 0x3c460 2ec76: f4 01 movw r30, r8 2ec78: 80 83 st Z, r24 2ec7a: b3 94 inc r11 2ec7c: e9 cf rjmp .-46 ; 0x2ec50 //Serial.print((char*)p.name); //Serial.print(" "); //Serial.println(autoname); if(p.name[9]!='~') //skip safety copies 2ec7e: 8a 85 ldd r24, Y+10 ; 0x0a 2ec80: 8e 37 cpi r24, 0x7E ; 126 2ec82: 31 f2 breq .-116 ; 0x2ec10 if(strncmp((char*)p.name,autoname,5)==0) 2ec84: 45 e0 ldi r20, 0x05 ; 5 2ec86: 50 e0 ldi r21, 0x00 ; 0 2ec88: b8 01 movw r22, r16 2ec8a: c7 01 movw r24, r14 2ec8c: 0f 94 8e e2 call 0x3c51c ; 0x3c51c 2ec90: 89 2b or r24, r25 2ec92: 09 f0 breq .+2 ; 0x2ec96 2ec94: bd cf rjmp .-134 ; 0x2ec10 { // M23: Select SD file enquecommandf_P(MSG_M23, autoname); 2ec96: 1f 93 push r17 2ec98: 0f 93 push r16 2ec9a: df 92 push r13 2ec9c: cf 92 push r12 2ec9e: 0e 94 b6 88 call 0x1116c ; 0x1116c // M24: Start/resume SD print enquecommand_P(MSG_M24); 2eca2: 61 e0 ldi r22, 0x01 ; 1 2eca4: 80 ef ldi r24, 0xF0 ; 240 2eca6: 90 e7 ldi r25, 0x70 ; 112 2eca8: 0e 94 20 88 call 0x11040 ; 0x11040 2ecac: 0f 90 pop r0 2ecae: 0f 90 pop r0 2ecb0: 0f 90 pop r0 2ecb2: 0f 90 pop r0 found=true; 2ecb4: aa 24 eor r10, r10 2ecb6: a3 94 inc r10 2ecb8: ab cf rjmp .-170 ; 0x2ec10 } } if(!found) lastnr=-1; 2ecba: 8f ef ldi r24, 0xFF ; 255 2ecbc: 9f ef ldi r25, 0xFF ; 255 // M24: Start/resume SD print enquecommand_P(MSG_M24); found=true; } } if(!found) 2ecbe: aa 20 and r10, r10 2ecc0: 29 f0 breq .+10 ; 0x2eccc lastnr=-1; else lastnr++; 2ecc2: 80 91 dd 14 lds r24, 0x14DD ; 0x8014dd 2ecc6: 90 91 de 14 lds r25, 0x14DE ; 0x8014de 2ecca: 01 96 adiw r24, 0x01 ; 1 2eccc: 90 93 de 14 sts 0x14DE, r25 ; 0x8014de 2ecd0: 80 93 dd 14 sts 0x14DD, r24 ; 0x8014dd } 2ecd4: ee 96 adiw r28, 0x3e ; 62 2ecd6: 0f b6 in r0, 0x3f ; 63 2ecd8: f8 94 cli 2ecda: de bf out 0x3e, r29 ; 62 2ecdc: 0f be out 0x3f, r0 ; 63 2ecde: cd bf out 0x3d, r28 ; 61 2ece0: df 91 pop r29 2ece2: cf 91 pop r28 2ece4: 1f 91 pop r17 2ece6: 0f 91 pop r16 2ece8: ff 90 pop r15 2ecea: ef 90 pop r14 2ecec: df 90 pop r13 2ecee: cf 90 pop r12 2ecf0: bf 90 pop r11 2ecf2: af 90 pop r10 2ecf4: 9f 90 pop r9 2ecf6: 8f 90 pop r8 2ecf8: 08 95 ret 0002ecfa : * \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) { 2ecfa: 8f 92 push r8 2ecfc: 9f 92 push r9 2ecfe: af 92 push r10 2ed00: bf 92 push r11 2ed02: cf 92 push r12 2ed04: df 92 push r13 2ed06: ef 92 push r14 2ed08: ff 92 push r15 2ed0a: 0f 93 push r16 2ed0c: 1f 93 push r17 2ed0e: cf 93 push r28 2ed10: df 93 push r29 2ed12: 00 d0 rcall .+0 ; 0x2ed14 2ed14: 1f 92 push r1 2ed16: cd b7 in r28, 0x3d ; 61 2ed18: de b7 in r29, 0x3e ; 62 2ed1a: fc 01 movw r30, r24 uint32_t newPos; // error if not a normal file or read-only if (!isFile() || !(flags_ & O_WRITE)) goto fail; 2ed1c: 83 81 ldd r24, Z+3 ; 0x03 2ed1e: 81 30 cpi r24, 0x01 ; 1 2ed20: 11 f0 breq .+4 ; 0x2ed26 // set file to correct position return seekSet(newPos); fail: return false; 2ed22: 80 e0 ldi r24, 0x00 ; 0 2ed24: 60 c0 rjmp .+192 ; 0x2ede6 * \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; 2ed26: 81 81 ldd r24, Z+1 ; 0x01 2ed28: 81 ff sbrs r24, 1 2ed2a: fb cf rjmp .-10 ; 0x2ed22 // 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; 2ed2c: 81 89 ldd r24, Z+17 ; 0x11 2ed2e: 92 89 ldd r25, Z+18 ; 0x12 2ed30: a3 89 ldd r26, Z+19 ; 0x13 2ed32: b4 89 ldd r27, Z+20 ; 0x14 2ed34: 89 2b or r24, r25 2ed36: 8a 2b or r24, r26 2ed38: 8b 2b or r24, r27 2ed3a: 09 f4 brne .+2 ; 0x2ed3e 2ed3c: 6e c0 rjmp .+220 ; 0x2ee1a 2ed3e: 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; 2ed40: 40 e0 ldi r20, 0x00 ; 0 2ed42: 50 e0 ldi r21, 0x00 ; 0 2ed44: ba 01 movw r22, r20 2ed46: cf 01 movw r24, r30 2ed48: 0f 94 92 56 call 0x2ad24 ; 0x2ad24 2ed4c: 88 23 and r24, r24 2ed4e: 49 f3 breq .-46 ; 0x2ed22 if (length == 0) { // free all clusters if (!vol_->freeChain(firstCluster_)) goto fail; 2ed50: f7 01 movw r30, r14 2ed52: c1 8c ldd r12, Z+25 ; 0x19 2ed54: d2 8c ldd r13, Z+26 ; 0x1a 2ed56: 85 88 ldd r8, Z+21 ; 0x15 2ed58: 96 88 ldd r9, Z+22 ; 0x16 2ed5a: a7 88 ldd r10, Z+23 ; 0x17 2ed5c: 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; 2ed5e: 82 e0 ldi r24, 0x02 ; 2 2ed60: 90 e0 ldi r25, 0x00 ; 0 2ed62: a0 e0 ldi r26, 0x00 ; 0 2ed64: b0 e0 ldi r27, 0x00 ; 0 2ed66: f6 01 movw r30, r12 2ed68: 80 83 st Z, r24 2ed6a: 91 83 std Z+1, r25 ; 0x01 2ed6c: a2 83 std Z+2, r26 ; 0x02 2ed6e: b3 83 std Z+3, r27 ; 0x03 do { if (!fatGet(cluster, &next)) goto fail; 2ed70: 9e 01 movw r18, r28 2ed72: 2f 5f subi r18, 0xFF ; 255 2ed74: 3f 4f sbci r19, 0xFF ; 255 2ed76: b5 01 movw r22, r10 2ed78: a4 01 movw r20, r8 2ed7a: c6 01 movw r24, r12 2ed7c: 0f 94 dc 54 call 0x2a9b8 ; 0x2a9b8 2ed80: 88 23 and r24, r24 2ed82: 79 f2 breq .-98 ; 0x2ed22 // free cluster if (!fatPut(cluster, 0)) goto fail; 2ed84: 00 e0 ldi r16, 0x00 ; 0 2ed86: 10 e0 ldi r17, 0x00 ; 0 2ed88: 98 01 movw r18, r16 2ed8a: b5 01 movw r22, r10 2ed8c: a4 01 movw r20, r8 2ed8e: c6 01 movw r24, r12 2ed90: 0f 94 4a 54 call 0x2a894 ; 0x2a894 2ed94: 88 23 and r24, r24 2ed96: 29 f2 breq .-118 ; 0x2ed22 cluster = next; 2ed98: 89 80 ldd r8, Y+1 ; 0x01 2ed9a: 9a 80 ldd r9, Y+2 ; 0x02 2ed9c: ab 80 ldd r10, Y+3 ; 0x03 2ed9e: 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; 2eda0: f6 01 movw r30, r12 2eda2: 87 89 ldd r24, Z+23 ; 0x17 2eda4: 80 31 cpi r24, 0x10 ; 16 2eda6: 81 f5 brne .+96 ; 0x2ee08 2eda8: f8 ef ldi r31, 0xF8 ; 248 2edaa: 8f 16 cp r8, r31 2edac: ff ef ldi r31, 0xFF ; 255 2edae: 9f 06 cpc r9, r31 2edb0: a1 04 cpc r10, r1 2edb2: b1 04 cpc r11, r1 2edb4: e8 f2 brcs .-70 ; 0x2ed70 firstCluster_ = 0; 2edb6: f7 01 movw r30, r14 2edb8: 15 8a std Z+21, r1 ; 0x15 2edba: 16 8a std Z+22, r1 ; 0x16 2edbc: 17 8a std Z+23, r1 ; 0x17 2edbe: 10 8e std Z+24, r1 ; 0x18 // current cluster is end of chain if (!vol_->fatPutEOC(curCluster_)) goto fail; } } fileSize_ = length; 2edc0: 11 8a std Z+17, r1 ; 0x11 2edc2: 12 8a std Z+18, r1 ; 0x12 2edc4: 13 8a std Z+19, r1 ; 0x13 2edc6: 14 8a std Z+20, r1 ; 0x14 // need to update directory entry flags_ |= F_FILE_DIR_DIRTY; 2edc8: 81 81 ldd r24, Z+1 ; 0x01 2edca: 80 68 ori r24, 0x80 ; 128 2edcc: 81 83 std Z+1, r24 ; 0x01 if (!sync()) goto fail; 2edce: c7 01 movw r24, r14 2edd0: 0f 94 3b 58 call 0x2b076 ; 0x2b076 2edd4: 88 23 and r24, r24 2edd6: 09 f4 brne .+2 ; 0x2edda 2edd8: a4 cf rjmp .-184 ; 0x2ed22 // set file to correct position return seekSet(newPos); 2edda: 40 e0 ldi r20, 0x00 ; 0 2eddc: 50 e0 ldi r21, 0x00 ; 0 2edde: ba 01 movw r22, r20 2ede0: c7 01 movw r24, r14 2ede2: 0f 94 92 56 call 0x2ad24 ; 0x2ad24 fail: return false; } 2ede6: 0f 90 pop r0 2ede8: 0f 90 pop r0 2edea: 0f 90 pop r0 2edec: 0f 90 pop r0 2edee: df 91 pop r29 2edf0: cf 91 pop r28 2edf2: 1f 91 pop r17 2edf4: 0f 91 pop r16 2edf6: ff 90 pop r15 2edf8: ef 90 pop r14 2edfa: df 90 pop r13 2edfc: cf 90 pop r12 2edfe: bf 90 pop r11 2ee00: af 90 pop r10 2ee02: 9f 90 pop r9 2ee04: 8f 90 pop r8 2ee06: 08 95 ret return cluster >= FAT32EOC_MIN; 2ee08: 88 ef ldi r24, 0xF8 ; 248 2ee0a: 88 16 cp r8, r24 2ee0c: 8f ef ldi r24, 0xFF ; 255 2ee0e: 98 06 cpc r9, r24 2ee10: a8 06 cpc r10, r24 2ee12: 8f e0 ldi r24, 0x0F ; 15 2ee14: b8 06 cpc r11, r24 2ee16: 78 f6 brcc .-98 ; 0x2edb6 2ee18: ab cf rjmp .-170 ; 0x2ed70 // 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; 2ee1a: 81 e0 ldi r24, 0x01 ; 1 2ee1c: e4 cf rjmp .-56 ; 0x2ede6 0002ee1e : +* 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) { 2ee1e: 2f 92 push r2 2ee20: 3f 92 push r3 2ee22: 4f 92 push r4 2ee24: 5f 92 push r5 2ee26: 6f 92 push r6 2ee28: 7f 92 push r7 2ee2a: 8f 92 push r8 2ee2c: 9f 92 push r9 2ee2e: af 92 push r10 2ee30: bf 92 push r11 2ee32: cf 92 push r12 2ee34: df 92 push r13 2ee36: ef 92 push r14 2ee38: ff 92 push r15 2ee3a: 0f 93 push r16 2ee3c: 1f 93 push r17 2ee3e: cf 93 push r28 2ee40: df 93 push r29 2ee42: cd b7 in r28, 0x3d ; 61 2ee44: de b7 in r29, 0x3e ; 62 2ee46: c6 57 subi r28, 0x76 ; 118 2ee48: d1 09 sbc r29, r1 2ee4a: 0f b6 in r0, 0x3f ; 63 2ee4c: f8 94 cli 2ee4e: de bf out 0x3e, r29 ; 62 2ee50: 0f be out 0x3f, r0 ; 63 2ee52: cd bf out 0x3d, r28 ; 61 2ee54: 4c 01 movw r8, r24 2ee56: 6b 01 movw r12, r22 2ee58: 3a 01 movw r6, r20 2ee5a: e5 96 adiw r28, 0x35 ; 53 2ee5c: 2f af std Y+63, r18 ; 0x3f 2ee5e: e5 97 sbiw r28, 0x35 ; 53 2ee60: 50 2e mov r5, r16 cnt++; break; } } } // while readDir } 2ee62: 2d b6 in r2, 0x3d ; 61 2ee64: 3e b6 in r3, 0x3e ; 62 2ee66: 10 2f mov r17, r16 2ee68: 11 70 andi r17, 0x01 ; 1 static uint8_t recursionCnt = 0; // RAII incrementer for the recursionCnt class _incrementer { public: _incrementer() {recursionCnt++;} 2ee6a: 80 91 9c 0e lds r24, 0x0E9C ; 0x800e9c 2ee6e: 8f 5f subi r24, 0xFF ; 255 2ee70: 80 93 9c 0e sts 0x0E9C, r24 ; 0x800e9c } 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()) { 2ee74: fb 01 movw r30, r22 2ee76: 80 85 ldd r24, Z+8 ; 0x08 2ee78: 91 85 ldd r25, Z+9 ; 0x09 2ee7a: a2 85 ldd r26, Z+10 ; 0x0a 2ee7c: b3 85 ldd r27, Z+11 ; 0x0b 2ee7e: 80 93 a3 14 sts 0x14A3, r24 ; 0x8014a3 2ee82: 90 93 a4 14 sts 0x14A4, r25 ; 0x8014a4 2ee86: a0 93 a5 14 sts 0x14A5, r26 ; 0x8014a5 2ee8a: b0 93 a6 14 sts 0x14A6, r27 ; 0x8014a6 _incrementer() {recursionCnt++;} ~_incrementer() {recursionCnt--;} } recursionCntIncrementer; dir_t p; uint8_t cnt = 0; 2ee8e: 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); 2ee90: 5e 01 movw r10, r28 2ee92: f7 e6 ldi r31, 0x67 ; 103 2ee94: af 0e add r10, r31 2ee96: 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; 2ee98: f6 01 movw r30, r12 2ee9a: 83 81 ldd r24, Z+3 ; 0x03 2ee9c: 82 30 cpi r24, 0x02 ; 2 2ee9e: 08 f4 brcc .+2 ; 0x2eea2 2eea0: c0 c1 rjmp .+896 ; 0x2f222 2eea2: 80 85 ldd r24, Z+8 ; 0x08 2eea4: 91 85 ldd r25, Z+9 ; 0x09 2eea6: a2 85 ldd r26, Z+10 ; 0x0a 2eea8: b3 85 ldd r27, Z+11 ; 0x0b 2eeaa: 8f 71 andi r24, 0x1F ; 31 2eeac: 99 27 eor r25, r25 2eeae: aa 27 eor r26, r26 2eeb0: bb 27 eor r27, r27 2eeb2: 89 2b or r24, r25 2eeb4: 8a 2b or r24, r26 2eeb6: 8b 2b or r24, r27 2eeb8: 09 f0 breq .+2 ; 0x2eebc 2eeba: b3 c1 rjmp .+870 ; 0x2f222 //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'; 2eebc: 10 92 a7 14 sts 0x14A7, r1 ; 0x8014a7 2eec0: 47 ea ldi r20, 0xA7 ; 167 2eec2: 54 e1 ldi r21, 0x14 ; 20 2eec4: be 01 movw r22, r28 2eec6: 69 5b subi r22, 0xB9 ; 185 2eec8: 7f 4f sbci r23, 0xFF ; 255 2eeca: c6 01 movw r24, r12 2eecc: 0f 94 cf 59 call 0x2b39e ; 0x2b39e } 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()) { 2eed0: 18 16 cp r1, r24 2eed2: 0c f0 brlt .+2 ; 0x2eed6 2eed4: a6 c1 rjmp .+844 ; 0x2f222 if (recursionCnt > MAX_DIR_DEPTH) 2eed6: 80 91 9c 0e lds r24, 0x0E9C ; 0x800e9c 2eeda: 87 30 cpi r24, 0x07 ; 7 2eedc: 08 f0 brcs .+2 ; 0x2eee0 2eede: a1 c1 rjmp .+834 ; 0x2f222 return; uint8_t pn0 = p.name[0]; 2eee0: 28 96 adiw r28, 0x08 ; 8 2eee2: 8f ad ldd r24, Y+63 ; 0x3f 2eee4: 28 97 sbiw r28, 0x08 ; 8 if (pn0 == DIR_NAME_FREE) break; 2eee6: 88 23 and r24, r24 2eee8: 09 f4 brne .+2 ; 0x2eeec 2eeea: 9b c1 rjmp .+822 ; 0x2f222 if (pn0 == DIR_NAME_DELETED || pn0 == '.') continue; 2eeec: 85 3e cpi r24, 0xE5 ; 229 2eeee: 09 f4 brne .+2 ; 0x2eef2 2eef0: 39 c1 rjmp .+626 ; 0x2f164 2eef2: 8e 32 cpi r24, 0x2E ; 46 2eef4: 09 f4 brne .+2 ; 0x2eef8 2eef6: 36 c1 rjmp .+620 ; 0x2f164 if (longFilename[0] == '.') continue; 2eef8: 80 91 a7 14 lds r24, 0x14A7 ; 0x8014a7 2eefc: 8e 32 cpi r24, 0x2E ; 46 2eefe: 09 f4 brne .+2 ; 0x2ef02 2ef00: 31 c1 rjmp .+610 ; 0x2f164 2ef02: 63 96 adiw r28, 0x13 ; 19 2ef04: 8f ad ldd r24, Y+63 ; 0x3f 2ef06: 63 97 sbiw r28, 0x13 ; 19 if (!DIR_IS_FILE_OR_SUBDIR(&p) || (p.attributes & DIR_ATT_HIDDEN)) continue; 2ef08: 98 2f mov r25, r24 2ef0a: 9a 70 andi r25, 0x0A ; 10 2ef0c: 09 f0 breq .+2 ; 0x2ef10 2ef0e: 2a c1 rjmp .+596 ; 0x2f164 2ef10: 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; 2ef12: 91 e0 ldi r25, 0x01 ; 1 2ef14: 80 31 cpi r24, 0x10 ; 16 2ef16: 19 f0 breq .+6 ; 0x2ef1e 2ef18: 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 2ef1a: 80 31 cpi r24, 0x10 ; 16 2ef1c: 31 f4 brne .+12 ; 0x2ef2a 2ef1e: e5 96 adiw r28, 0x35 ; 53 2ef20: ff ad ldd r31, Y+63 ; 0x3f 2ef22: e5 97 sbiw r28, 0x35 ; 53 2ef24: ff 23 and r31, r31 2ef26: 09 f4 brne .+2 ; 0x2ef2a 2ef28: 94 c0 rjmp .+296 ; 0x2f052 if (lsParams.LFN) puts_P(PSTR("DIR_EXIT")); } else { filenameIsDir = DIR_IS_SUBDIR(&p); 2ef2a: 90 93 dc 14 sts 0x14DC, r25 ; 0x8014dc if (!filenameIsDir && (p.name[8] != 'G' || p.name[9] == '~')) continue; 2ef2e: 80 31 cpi r24, 0x10 ; 16 2ef30: 61 f0 breq .+24 ; 0x2ef4a 2ef32: 60 96 adiw r28, 0x10 ; 16 2ef34: 8f ad ldd r24, Y+63 ; 0x3f 2ef36: 60 97 sbiw r28, 0x10 ; 16 2ef38: 87 34 cpi r24, 0x47 ; 71 2ef3a: 09 f0 breq .+2 ; 0x2ef3e 2ef3c: 13 c1 rjmp .+550 ; 0x2f164 2ef3e: 61 96 adiw r28, 0x11 ; 17 2ef40: 8f ad ldd r24, Y+63 ; 0x3f 2ef42: 61 97 sbiw r28, 0x11 ; 17 2ef44: 8e 37 cpi r24, 0x7E ; 126 2ef46: 09 f4 brne .+2 ; 0x2ef4a 2ef48: 0d c1 rjmp .+538 ; 0x2f164 switch (lsAction) { 2ef4a: e5 96 adiw r28, 0x35 ; 53 2ef4c: ff ad ldd r31, Y+63 ; 0x3f 2ef4e: e5 97 sbiw r28, 0x35 ; 53 2ef50: f1 30 cpi r31, 0x01 ; 1 2ef52: 09 f4 brne .+2 ; 0x2ef56 2ef54: 1b c1 rjmp .+566 ; 0x2f18c 2ef56: f2 30 cpi r31, 0x02 ; 2 2ef58: 09 f4 brne .+2 ; 0x2ef5c 2ef5a: 25 c1 rjmp .+586 ; 0x2f1a6 case LS_Count: nrFiles++; break; case LS_SerialPrint: createFilename(filename, p); 2ef5c: be 01 movw r22, r28 2ef5e: 69 5b subi r22, 0xB9 ; 185 2ef60: 7f 4f sbci r23, 0xFF ; 255 2ef62: 82 e9 ldi r24, 0x92 ; 146 2ef64: 94 e1 ldi r25, 0x14 ; 20 2ef66: 0e 94 16 77 call 0xee2c ; 0xee2c 2ef6a: c4 01 movw r24, r8 2ef6c: 0e 94 14 88 call 0x11028 ; 0x11028 2ef70: 82 e9 ldi r24, 0x92 ; 146 2ef72: 94 e1 ldi r25, 0x14 ; 20 2ef74: 0e 94 14 88 call 0x11028 ; 0x11028 SERIAL_PROTOCOL(prepend); SERIAL_PROTOCOL(filename); MYSERIAL.write(' '); 2ef78: 80 e2 ldi r24, 0x20 ; 32 2ef7a: 0e 94 37 77 call 0xee6e ; 0xee6e } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 2ef7e: a7 96 adiw r28, 0x27 ; 39 2ef80: 6c ad ldd r22, Y+60 ; 0x3c 2ef82: 7d ad ldd r23, Y+61 ; 0x3d 2ef84: 8e ad ldd r24, Y+62 ; 0x3e 2ef86: 9f ad ldd r25, Y+63 ; 0x3f 2ef88: a7 97 sbiw r28, 0x27 ; 39 2ef8a: 4a e0 ldi r20, 0x0A ; 10 2ef8c: 0f 94 06 d5 call 0x3aa0c ; 0x3aa0c SERIAL_PROTOCOL(p.fileSize); if (lsParams.timestamp) 2ef90: 51 fe sbrs r5, 1 2ef92: 45 c0 rjmp .+138 ; 0x2f01e { crmodDate = p.lastWriteDate; 2ef94: a1 96 adiw r28, 0x21 ; 33 2ef96: 2e ad ldd r18, Y+62 ; 0x3e 2ef98: 3f ad ldd r19, Y+63 ; 0x3f 2ef9a: a1 97 sbiw r28, 0x21 ; 33 2ef9c: 30 93 a2 14 sts 0x14A2, r19 ; 0x8014a2 2efa0: 20 93 a1 14 sts 0x14A1, r18 ; 0x8014a1 crmodTime = p.lastWriteTime; 2efa4: 6f 96 adiw r28, 0x1f ; 31 2efa6: 4e ad ldd r20, Y+62 ; 0x3e 2efa8: 5f ad ldd r21, Y+63 ; 0x3f 2efaa: 6f 97 sbiw r28, 0x1f ; 31 2efac: 50 93 a0 14 sts 0x14A0, r21 ; 0x8014a0 2efb0: 40 93 9f 14 sts 0x149F, r20 ; 0x80149f if( crmodDate < p.creationDate || ( crmodDate == p.creationDate && crmodTime < p.creationTime ) ){ 2efb4: 69 96 adiw r28, 0x19 ; 25 2efb6: 8e ad ldd r24, Y+62 ; 0x3e 2efb8: 9f ad ldd r25, Y+63 ; 0x3f 2efba: 69 97 sbiw r28, 0x19 ; 25 2efbc: 28 17 cp r18, r24 2efbe: 39 07 cpc r19, r25 2efc0: 50 f0 brcs .+20 ; 0x2efd6 2efc2: 28 17 cp r18, r24 2efc4: 39 07 cpc r19, r25 2efc6: 99 f4 brne .+38 ; 0x2efee 2efc8: 67 96 adiw r28, 0x17 ; 23 2efca: 2e ad ldd r18, Y+62 ; 0x3e 2efcc: 3f ad ldd r19, Y+63 ; 0x3f 2efce: 67 97 sbiw r28, 0x17 ; 23 2efd0: 42 17 cp r20, r18 2efd2: 53 07 cpc r21, r19 2efd4: 60 f4 brcc .+24 ; 0x2efee crmodDate = p.creationDate; 2efd6: 90 93 a2 14 sts 0x14A2, r25 ; 0x8014a2 2efda: 80 93 a1 14 sts 0x14A1, r24 ; 0x8014a1 crmodTime = p.creationTime; 2efde: 67 96 adiw r28, 0x17 ; 23 2efe0: 8e ad ldd r24, Y+62 ; 0x3e 2efe2: 9f ad ldd r25, Y+63 ; 0x3f 2efe4: 67 97 sbiw r28, 0x17 ; 23 2efe6: 90 93 a0 14 sts 0x14A0, r25 ; 0x8014a0 2efea: 80 93 9f 14 sts 0x149F, r24 ; 0x80149f } printf_P(PSTR(" %#lx"), ((uint32_t)crmodDate << 16) | crmodTime); 2efee: 80 91 a2 14 lds r24, 0x14A2 ; 0x8014a2 2eff2: 8f 93 push r24 2eff4: 80 91 a1 14 lds r24, 0x14A1 ; 0x8014a1 2eff8: 8f 93 push r24 2effa: 80 91 a0 14 lds r24, 0x14A0 ; 0x8014a0 2effe: 8f 93 push r24 2f000: 80 91 9f 14 lds r24, 0x149F ; 0x80149f 2f004: 8f 93 push r24 2f006: 2b e1 ldi r18, 0x1B ; 27 2f008: 3b ea ldi r19, 0xAB ; 171 2f00a: 3f 93 push r19 2f00c: 2f 93 push r18 2f00e: 0f 94 de da call 0x3b5bc ; 0x3b5bc 2f012: 0f 90 pop r0 2f014: 0f 90 pop r0 2f016: 0f 90 pop r0 2f018: 0f 90 pop r0 2f01a: 0f 90 pop r0 2f01c: 0f 90 pop r0 } if (lsParams.LFN) 2f01e: 11 23 and r17, r17 2f020: 99 f0 breq .+38 ; 0x2f048 printf_P(PSTR(" \"%s\""), LONGEST_FILENAME); 2f022: 80 91 a7 14 lds r24, 0x14A7 ; 0x8014a7 2f026: 88 23 and r24, r24 2f028: 09 f4 brne .+2 ; 0x2f02c 2f02a: ba c0 rjmp .+372 ; 0x2f1a0 2f02c: 87 ea ldi r24, 0xA7 ; 167 2f02e: 94 e1 ldi r25, 0x14 ; 20 2f030: 9f 93 push r25 2f032: 8f 93 push r24 2f034: e5 e1 ldi r30, 0x15 ; 21 2f036: fb ea ldi r31, 0xAB ; 171 2f038: ff 93 push r31 2f03a: ef 93 push r30 2f03c: 0f 94 de da call 0x3b5bc ; 0x3b5bc 2f040: 0f 90 pop r0 2f042: 0f 90 pop r0 2f044: 0f 90 pop r0 2f046: 0f 90 pop r0 SERIAL_PROTOCOLLN(); 2f048: 0f 94 fd d5 call 0x3abfa ; 0x3abfa manage_heater(); 2f04c: 0f 94 5c 38 call 0x270b8 ; 0x270b8 2f050: 89 c0 rjmp .+274 ; 0x2f164 } lsDive(path, dir, NULL, lsAction, lsParams); // close() is done automatically by destructor of SdFile if (lsParams.LFN) puts_P(PSTR("DIR_EXIT")); 2f052: 2d b7 in r18, 0x3d ; 61 2f054: 3e b7 in r19, 0x3e ; 62 2f056: e7 96 adiw r28, 0x37 ; 55 2f058: 3f af std Y+63, r19 ; 0x3f 2f05a: 2e af std Y+62, r18 ; 0x3e 2f05c: 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); 2f05e: be 01 movw r22, r28 2f060: 69 5b subi r22, 0xB9 ; 185 2f062: 7f 4f sbci r23, 0xFF ; 255 2f064: c5 01 movw r24, r10 2f066: 0e 94 16 77 call 0xee2c ; 0xee2c // Allocate enough stack space for the full path to a folder, trailing slash, and nul bool prepend_is_empty = (prepend[0] == '\0'); 2f06a: f4 01 movw r30, r8 2f06c: 80 81 ld r24, Z int len = (prepend_is_empty ? 1 : strlen(prepend)) + strlen(lfilename) + 1 + 1; 2f06e: 88 23 and r24, r24 2f070: 09 f4 brne .+2 ; 0x2f074 2f072: 86 c0 rjmp .+268 ; 0x2f180 2f074: 01 90 ld r0, Z+ 2f076: 00 20 and r0, r0 2f078: e9 f7 brne .-6 ; 0x2f074 2f07a: 31 97 sbiw r30, 0x01 ; 1 2f07c: e8 19 sub r30, r8 2f07e: f9 09 sbc r31, r9 2f080: d5 01 movw r26, r10 2f082: 0d 90 ld r0, X+ 2f084: 00 20 and r0, r0 2f086: e9 f7 brne .-6 ; 0x2f082 2f088: ea 19 sub r30, r10 2f08a: fb 09 sbc r31, r11 char path[len]; 2f08c: ea 0f add r30, r26 2f08e: fb 1f adc r31, r27 2f090: 31 96 adiw r30, 0x01 ; 1 2f092: 2d b7 in r18, 0x3d ; 61 2f094: 3e b7 in r19, 0x3e ; 62 2f096: 2e 1b sub r18, r30 2f098: 3f 0b sbc r19, r31 2f09a: 0f b6 in r0, 0x3f ; 63 2f09c: f8 94 cli 2f09e: 3e bf out 0x3e, r19 ; 62 2f0a0: 0f be out 0x3f, r0 ; 63 2f0a2: 2d bf out 0x3d, r18 ; 61 2f0a4: ed b7 in r30, 0x3d ; 61 2f0a6: fe b7 in r31, 0x3e ; 62 2f0a8: 31 96 adiw r30, 0x01 ; 1 2f0aa: 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 2f0ac: 6d e1 ldi r22, 0x1D ; 29 2f0ae: 73 e0 ldi r23, 0x03 ; 3 2f0b0: 81 11 cpse r24, r1 2f0b2: b4 01 movw r22, r8 2f0b4: c7 01 movw r24, r14 2f0b6: 0f 94 87 e2 call 0x3c50e ; 0x3c50e strcat(path, lfilename); // FILENAME_LENGTH-1 characters maximum 2f0ba: b5 01 movw r22, r10 2f0bc: c7 01 movw r24, r14 2f0be: 0f 94 68 e2 call 0x3c4d0 ; 0x3c4d0 strcat(path, "/"); // 1 character 2f0c2: 6d e1 ldi r22, 0x1D ; 29 2f0c4: 73 e0 ldi r23, 0x03 ; 3 2f0c6: c7 01 movw r24, r14 2f0c8: 0f 94 68 e2 call 0x3c4d0 ; 0x3c4d0 // Serial.print(path); // Get a new directory object using the full path // and dive recursively into it. if (lsParams.LFN) 2f0cc: 11 23 and r17, r17 2f0ce: a9 f0 breq .+42 ; 0x2f0fa printf_P(PSTR("DIR_ENTER: %s \"%s\"\n"), path, longFilename[0] ? longFilename : lfilename); 2f0d0: 80 91 a7 14 lds r24, 0x14A7 ; 0x8014a7 2f0d4: 81 11 cpse r24, r1 2f0d6: 57 c0 rjmp .+174 ; 0x2f186 2f0d8: c5 01 movw r24, r10 2f0da: 9f 93 push r25 2f0dc: 8f 93 push r24 2f0de: ff 92 push r15 2f0e0: ef 92 push r14 2f0e2: 2a e2 ldi r18, 0x2A ; 42 2f0e4: 3b ea ldi r19, 0xAB ; 171 2f0e6: 3f 93 push r19 2f0e8: 2f 93 push r18 2f0ea: 0f 94 de da call 0x3b5bc ; 0x3b5bc 2f0ee: 0f 90 pop r0 2f0f0: 0f 90 pop r0 2f0f2: 0f 90 pop r0 2f0f4: 0f 90 pop r0 2f0f6: 0f 90 pop r0 2f0f8: 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) {} 2f0fa: 1c a2 std Y+36, r1 ; 0x24 2f0fc: 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); 2f0fe: 21 e0 ldi r18, 0x01 ; 1 2f100: a5 01 movw r20, r10 2f102: b6 01 movw r22, r12 2f104: ce 01 movw r24, r28 2f106: 84 96 adiw r24, 0x24 ; 36 2f108: 0f 94 18 64 call 0x2c830 ; 0x2c830 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); 2f10c: 83 e2 ldi r24, 0x23 ; 35 2f10e: fe 01 movw r30, r28 2f110: b4 96 adiw r30, 0x24 ; 36 2f112: de 01 movw r26, r28 2f114: 11 96 adiw r26, 0x01 ; 1 2f116: 01 90 ld r0, Z+ 2f118: 0d 92 st X+, r0 2f11a: 8a 95 dec r24 2f11c: e1 f7 brne .-8 ; 0x2f116 2f11e: 10 fb bst r17, 0 2f120: 50 f8 bld r5, 0 2f122: 05 2d mov r16, r5 2f124: 20 e0 ldi r18, 0x00 ; 0 2f126: 50 e0 ldi r21, 0x00 ; 0 2f128: 40 e0 ldi r20, 0x00 ; 0 2f12a: be 01 movw r22, r28 2f12c: 6f 5f subi r22, 0xFF ; 255 2f12e: 7f 4f sbci r23, 0xFF ; 255 2f130: c7 01 movw r24, r14 2f132: 0f 94 0f 77 call 0x2ee1e ; 0x2ee1e 2f136: ce 01 movw r24, r28 2f138: 01 96 adiw r24, 0x01 ; 1 2f13a: 0e 94 31 77 call 0xee62 ; 0xee62 // close() is done automatically by destructor of SdFile if (lsParams.LFN) 2f13e: 11 23 and r17, r17 2f140: 21 f0 breq .+8 ; 0x2f14a puts_P(PSTR("DIR_EXIT")); 2f142: 81 e2 ldi r24, 0x21 ; 33 2f144: 9b ea ldi r25, 0xAB ; 171 2f146: 0f 94 05 db call 0x3b60a ; 0x3b60a 2f14a: ce 01 movw r24, r28 2f14c: 84 96 adiw r24, 0x24 ; 36 2f14e: 0e 94 31 77 call 0xee62 ; 0xee62 2f152: e7 96 adiw r28, 0x37 ; 55 2f154: ee ad ldd r30, Y+62 ; 0x3e 2f156: ff ad ldd r31, Y+63 ; 0x3f 2f158: e7 97 sbiw r28, 0x37 ; 55 2f15a: 0f b6 in r0, 0x3f ; 63 2f15c: f8 94 cli 2f15e: fe bf out 0x3e, r31 ; 62 2f160: 0f be out 0x3f, r0 ; 63 2f162: 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()) { 2f164: f6 01 movw r30, r12 2f166: 80 85 ldd r24, Z+8 ; 0x08 2f168: 91 85 ldd r25, Z+9 ; 0x09 2f16a: a2 85 ldd r26, Z+10 ; 0x0a 2f16c: b3 85 ldd r27, Z+11 ; 0x0b 2f16e: 80 93 a3 14 sts 0x14A3, r24 ; 0x8014a3 2f172: 90 93 a4 14 sts 0x14A4, r25 ; 0x8014a4 2f176: a0 93 a5 14 sts 0x14A5, r26 ; 0x8014a5 2f17a: b0 93 a6 14 sts 0x14A6, r27 ; 0x8014a6 2f17e: 8c ce rjmp .-744 ; 0x2ee98 // 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; 2f180: e1 e0 ldi r30, 0x01 ; 1 2f182: f0 e0 ldi r31, 0x00 ; 0 2f184: 7d cf rjmp .-262 ; 0x2f080 // 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); 2f186: 87 ea ldi r24, 0xA7 ; 167 2f188: 94 e1 ldi r25, 0x14 ; 20 2f18a: a7 cf rjmp .-178 ; 0x2f0da else { filenameIsDir = DIR_IS_SUBDIR(&p); if (!filenameIsDir && (p.name[8] != 'G' || p.name[9] == '~')) continue; switch (lsAction) { case LS_Count: nrFiles++; 2f18c: 80 91 a8 17 lds r24, 0x17A8 ; 0x8017a8 2f190: 90 91 a9 17 lds r25, 0x17A9 ; 0x8017a9 2f194: 01 96 adiw r24, 0x01 ; 1 2f196: 90 93 a9 17 sts 0x17A9, r25 ; 0x8017a9 2f19a: 80 93 a8 17 sts 0x17A8, r24 ; 0x8017a8 2f19e: e2 cf rjmp .-60 ; 0x2f164 } printf_P(PSTR(" %#lx"), ((uint32_t)crmodDate << 16) | crmodTime); } if (lsParams.LFN) printf_P(PSTR(" \"%s\""), LONGEST_FILENAME); 2f1a0: 82 e9 ldi r24, 0x92 ; 146 2f1a2: 94 e1 ldi r25, 0x14 ; 20 2f1a4: 45 cf rjmp .-374 ; 0x2f030 manage_heater(); break; case LS_GetFilename: //SERIAL_ECHOPGM("File: "); createFilename(filename, p); 2f1a6: be 01 movw r22, r28 2f1a8: 69 5b subi r22, 0xB9 ; 185 2f1aa: 7f 4f sbci r23, 0xFF ; 255 2f1ac: 82 e9 ldi r24, 0x92 ; 146 2f1ae: 94 e1 ldi r25, 0x14 ; 20 2f1b0: 0e 94 16 77 call 0xee2c ; 0xee2c SERIAL_ECHOPGM("Creation date: "); MYSERIAL.println(p.creationDate); SERIAL_ECHOPGM("Access date: "); MYSERIAL.println(p.lastAccessDate); SERIAL_ECHOLNPGM("");*/ crmodDate = p.lastWriteDate; 2f1b4: a1 96 adiw r28, 0x21 ; 33 2f1b6: 2e ad ldd r18, Y+62 ; 0x3e 2f1b8: 3f ad ldd r19, Y+63 ; 0x3f 2f1ba: a1 97 sbiw r28, 0x21 ; 33 2f1bc: 30 93 a2 14 sts 0x14A2, r19 ; 0x8014a2 2f1c0: 20 93 a1 14 sts 0x14A1, r18 ; 0x8014a1 crmodTime = p.lastWriteTime; 2f1c4: 6f 96 adiw r28, 0x1f ; 31 2f1c6: 4e ad ldd r20, Y+62 ; 0x3e 2f1c8: 5f ad ldd r21, Y+63 ; 0x3f 2f1ca: 6f 97 sbiw r28, 0x1f ; 31 2f1cc: 50 93 a0 14 sts 0x14A0, r21 ; 0x8014a0 2f1d0: 40 93 9f 14 sts 0x149F, r20 ; 0x80149f // 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 ) ){ 2f1d4: 69 96 adiw r28, 0x19 ; 25 2f1d6: 8e ad ldd r24, Y+62 ; 0x3e 2f1d8: 9f ad ldd r25, Y+63 ; 0x3f 2f1da: 69 97 sbiw r28, 0x19 ; 25 2f1dc: 28 17 cp r18, r24 2f1de: 39 07 cpc r19, r25 2f1e0: 50 f0 brcs .+20 ; 0x2f1f6 2f1e2: 28 17 cp r18, r24 2f1e4: 39 07 cpc r19, r25 2f1e6: 99 f4 brne .+38 ; 0x2f20e 2f1e8: 67 96 adiw r28, 0x17 ; 23 2f1ea: 2e ad ldd r18, Y+62 ; 0x3e 2f1ec: 3f ad ldd r19, Y+63 ; 0x3f 2f1ee: 67 97 sbiw r28, 0x17 ; 23 2f1f0: 42 17 cp r20, r18 2f1f2: 53 07 cpc r21, r19 2f1f4: 60 f4 brcc .+24 ; 0x2f20e crmodDate = p.creationDate; 2f1f6: 90 93 a2 14 sts 0x14A2, r25 ; 0x8014a2 2f1fa: 80 93 a1 14 sts 0x14A1, r24 ; 0x8014a1 crmodTime = p.creationTime; 2f1fe: 67 96 adiw r28, 0x17 ; 23 2f200: 8e ad ldd r24, Y+62 ; 0x3e 2f202: 9f ad ldd r25, Y+63 ; 0x3f 2f204: 67 97 sbiw r28, 0x17 ; 23 2f206: 90 93 a0 14 sts 0x14A0, r25 ; 0x8014a0 2f20a: 80 93 9f 14 sts 0x149F, r24 ; 0x80149f } //writeDate = p.lastAccessDate; if (match != NULL) { 2f20e: 61 14 cp r6, r1 2f210: 71 04 cpc r7, r1 2f212: 59 f1 breq .+86 ; 0x2f26a if (strcasecmp(match, filename) == 0) return; 2f214: 62 e9 ldi r22, 0x92 ; 146 2f216: 74 e1 ldi r23, 0x14 ; 20 2f218: c3 01 movw r24, r6 2f21a: 0f 94 55 e2 call 0x3c4aa ; 0x3c4aa 2f21e: 89 2b or r24, r25 2f220: 59 f5 brne .+86 ; 0x2f278 // RAII incrementer for the recursionCnt class _incrementer { public: _incrementer() {recursionCnt++;} ~_incrementer() {recursionCnt--;} 2f222: 80 91 9c 0e lds r24, 0x0E9C ; 0x800e9c 2f226: 81 50 subi r24, 0x01 ; 1 2f228: 80 93 9c 0e sts 0x0E9C, r24 ; 0x800e9c cnt++; break; } } } // while readDir } 2f22c: 0f b6 in r0, 0x3f ; 63 2f22e: f8 94 cli 2f230: 3e be out 0x3e, r3 ; 62 2f232: 0f be out 0x3f, r0 ; 63 2f234: 2d be out 0x3d, r2 ; 61 2f236: ca 58 subi r28, 0x8A ; 138 2f238: df 4f sbci r29, 0xFF ; 255 2f23a: 0f b6 in r0, 0x3f ; 63 2f23c: f8 94 cli 2f23e: de bf out 0x3e, r29 ; 62 2f240: 0f be out 0x3f, r0 ; 63 2f242: cd bf out 0x3d, r28 ; 61 2f244: df 91 pop r29 2f246: cf 91 pop r28 2f248: 1f 91 pop r17 2f24a: 0f 91 pop r16 2f24c: ff 90 pop r15 2f24e: ef 90 pop r14 2f250: df 90 pop r13 2f252: cf 90 pop r12 2f254: bf 90 pop r11 2f256: af 90 pop r10 2f258: 9f 90 pop r9 2f25a: 8f 90 pop r8 2f25c: 7f 90 pop r7 2f25e: 6f 90 pop r6 2f260: 5f 90 pop r5 2f262: 4f 90 pop r4 2f264: 3f 90 pop r3 2f266: 2f 90 pop r2 2f268: 08 95 ret } //writeDate = p.lastAccessDate; if (match != NULL) { if (strcasecmp(match, filename) == 0) return; } else if (cnt == nrFiles) return; 2f26a: 80 91 a8 17 lds r24, 0x17A8 ; 0x8017a8 2f26e: 90 91 a9 17 lds r25, 0x17A9 ; 0x8017a9 2f272: 48 16 cp r4, r24 2f274: 19 06 cpc r1, r25 2f276: a9 f2 breq .-86 ; 0x2f222 cnt++; 2f278: 43 94 inc r4 2f27a: 74 cf rjmp .-280 ; 0x2f164 0002f27c : } } void CardReader::getfilename(uint16_t nr, const char * const match/*=NULL*/) 2f27c: cf 92 push r12 2f27e: df 92 push r13 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 2f29a: 6c 01 movw r12, r24 { curDir=&workDir; 2f29c: 89 e3 ldi r24, 0x39 ; 57 2f29e: e8 2e mov r14, r24 2f2a0: 85 e1 ldi r24, 0x15 ; 21 2f2a2: f8 2e mov r15, r24 2f2a4: 8b e3 ldi r24, 0x3B ; 59 2f2a6: 95 e1 ldi r25, 0x15 ; 21 2f2a8: d7 01 movw r26, r14 2f2aa: 8d 93 st X+, r24 2f2ac: 9c 93 st X, r25 nrFiles=nr; 2f2ae: 10 92 a9 17 sts 0x17A9, r1 ; 0x8017a9 2f2b2: 10 92 a8 17 sts 0x17A8, r1 ; 0x8017a8 curDir->rewind(); 2f2b6: 0e 94 2c 77 call 0xee58 ; 0xee58 }; struct ls_param { bool LFN : 1; bool timestamp : 1; inline ls_param():LFN(0), timestamp(0) { } 2f2ba: 00 e0 ldi r16, 0x00 ; 0 2f2bc: 0e 7f andi r16, 0xFE ; 254 2f2be: 0d 7f andi r16, 0xFD ; 253 lsDive("",*curDir,match, LS_GetFilename); 2f2c0: d7 01 movw r26, r14 2f2c2: ed 91 ld r30, X+ 2f2c4: fc 91 ld r31, X 2f2c6: 83 e2 ldi r24, 0x23 ; 35 2f2c8: de 01 movw r26, r28 2f2ca: 11 96 adiw r26, 0x01 ; 1 2f2cc: 01 90 ld r0, Z+ 2f2ce: 0d 92 st X+, r0 2f2d0: 8a 95 dec r24 2f2d2: e1 f7 brne .-8 ; 0x2f2cc 2f2d4: 22 e0 ldi r18, 0x02 ; 2 2f2d6: a6 01 movw r20, r12 2f2d8: be 01 movw r22, r28 2f2da: 6f 5f subi r22, 0xFF ; 255 2f2dc: 7f 4f sbci r23, 0xFF ; 255 2f2de: 88 ef ldi r24, 0xF8 ; 248 2f2e0: 92 e0 ldi r25, 0x02 ; 2 2f2e2: 0f 94 0f 77 call 0x2ee1e ; 0x2ee1e 2f2e6: ce 01 movw r24, r28 2f2e8: 01 96 adiw r24, 0x01 ; 1 2f2ea: 0e 94 31 77 call 0xee62 ; 0xee62 } 2f2ee: a3 96 adiw r28, 0x23 ; 35 2f2f0: 0f b6 in r0, 0x3f ; 63 2f2f2: f8 94 cli 2f2f4: de bf out 0x3e, r29 ; 62 2f2f6: 0f be out 0x3f, r0 ; 63 2f2f8: cd bf out 0x3d, r28 ; 61 2f2fa: df 91 pop r29 2f2fc: cf 91 pop r28 2f2fe: 0f 91 pop r16 2f300: ff 90 pop r15 2f302: ef 90 pop r14 2f304: df 90 pop r13 2f306: cf 90 pop r12 2f308: 08 95 ret 0002f30a : void CardReader::getfilename_simple(uint16_t entry, const char * const match/*=NULL*/) 2f30a: ef 92 push r14 2f30c: ff 92 push r15 2f30e: 0f 93 push r16 2f310: cf 93 push r28 2f312: df 93 push r29 2f314: cd b7 in r28, 0x3d ; 61 2f316: de b7 in r29, 0x3e ; 62 2f318: a3 97 sbiw r28, 0x23 ; 35 2f31a: 0f b6 in r0, 0x3f ; 63 2f31c: f8 94 cli 2f31e: de bf out 0x3e, r29 ; 62 2f320: 0f be out 0x3f, r0 ; 63 2f322: cd bf out 0x3d, r28 ; 61 { curDir = &workDir; 2f324: 29 e3 ldi r18, 0x39 ; 57 2f326: e2 2e mov r14, r18 2f328: 25 e1 ldi r18, 0x15 ; 21 2f32a: f2 2e mov r15, r18 2f32c: 2b e3 ldi r18, 0x3B ; 59 2f32e: 35 e1 ldi r19, 0x15 ; 21 2f330: d7 01 movw r26, r14 2f332: 2d 93 st X+, r18 2f334: 3c 93 st X, r19 nrFiles = 0; 2f336: 10 92 a9 17 sts 0x17A9, r1 ; 0x8017a9 2f33a: 10 92 a8 17 sts 0x17A8, r1 ; 0x8017a8 curDir->seekSet((uint32_t)entry << 5); 2f33e: b0 e0 ldi r27, 0x00 ; 0 2f340: a0 e0 ldi r26, 0x00 ; 0 2f342: ac 01 movw r20, r24 2f344: bd 01 movw r22, r26 2f346: e5 e0 ldi r30, 0x05 ; 5 2f348: 44 0f add r20, r20 2f34a: 55 1f adc r21, r21 2f34c: 66 1f adc r22, r22 2f34e: 77 1f adc r23, r23 2f350: ea 95 dec r30 2f352: d1 f7 brne .-12 ; 0x2f348 2f354: c9 01 movw r24, r18 2f356: 0f 94 92 56 call 0x2ad24 ; 0x2ad24 2f35a: 00 e0 ldi r16, 0x00 ; 0 2f35c: 0e 7f andi r16, 0xFE ; 254 2f35e: 0d 7f andi r16, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 2f360: d7 01 movw r26, r14 2f362: ed 91 ld r30, X+ 2f364: fc 91 ld r31, X 2f366: 83 e2 ldi r24, 0x23 ; 35 2f368: de 01 movw r26, r28 2f36a: 11 96 adiw r26, 0x01 ; 1 2f36c: 01 90 ld r0, Z+ 2f36e: 0d 92 st X+, r0 2f370: 8a 95 dec r24 2f372: e1 f7 brne .-8 ; 0x2f36c 2f374: 22 e0 ldi r18, 0x02 ; 2 2f376: 50 e0 ldi r21, 0x00 ; 0 2f378: 40 e0 ldi r20, 0x00 ; 0 2f37a: be 01 movw r22, r28 2f37c: 6f 5f subi r22, 0xFF ; 255 2f37e: 7f 4f sbci r23, 0xFF ; 255 2f380: 88 ef ldi r24, 0xF8 ; 248 2f382: 92 e0 ldi r25, 0x02 ; 2 2f384: 0f 94 0f 77 call 0x2ee1e ; 0x2ee1e 2f388: ce 01 movw r24, r28 2f38a: 01 96 adiw r24, 0x01 ; 1 2f38c: 0e 94 31 77 call 0xee62 ; 0xee62 } 2f390: a3 96 adiw r28, 0x23 ; 35 2f392: 0f b6 in r0, 0x3f ; 63 2f394: f8 94 cli 2f396: de bf out 0x3e, r29 ; 62 2f398: 0f be out 0x3f, r0 ; 63 2f39a: cd bf out 0x3d, r28 ; 61 2f39c: df 91 pop r29 2f39e: cf 91 pop r28 2f3a0: 0f 91 pop r16 2f3a2: ff 90 pop r15 2f3a4: ef 90 pop r14 2f3a6: 08 95 ret 0002f3a8 : nrFiles = 1; curDir->seekSet(position); lsDive("", *curDir, match, LS_GetFilename); } uint16_t CardReader::getnrfilenames() 2f3a8: cf 92 push r12 2f3aa: df 92 push r13 2f3ac: ef 92 push r14 2f3ae: ff 92 push r15 2f3b0: 0f 93 push r16 2f3b2: cf 93 push r28 2f3b4: df 93 push r29 2f3b6: cd b7 in r28, 0x3d ; 61 2f3b8: de b7 in r29, 0x3e ; 62 2f3ba: a3 97 sbiw r28, 0x23 ; 35 2f3bc: 0f b6 in r0, 0x3f ; 63 2f3be: f8 94 cli 2f3c0: de bf out 0x3e, r29 ; 62 2f3c2: 0f be out 0x3f, r0 ; 63 2f3c4: cd bf out 0x3d, r28 ; 61 { curDir=&workDir; 2f3c6: 89 e3 ldi r24, 0x39 ; 57 2f3c8: c8 2e mov r12, r24 2f3ca: 85 e1 ldi r24, 0x15 ; 21 2f3cc: d8 2e mov r13, r24 2f3ce: 8b e3 ldi r24, 0x3B ; 59 2f3d0: 95 e1 ldi r25, 0x15 ; 21 2f3d2: d6 01 movw r26, r12 2f3d4: 8d 93 st X+, r24 2f3d6: 9c 93 st X, r25 nrFiles=0; 2f3d8: 28 ea ldi r18, 0xA8 ; 168 2f3da: e2 2e mov r14, r18 2f3dc: 27 e1 ldi r18, 0x17 ; 23 2f3de: f2 2e mov r15, r18 2f3e0: f7 01 movw r30, r14 2f3e2: 11 82 std Z+1, r1 ; 0x01 2f3e4: 10 82 st Z, r1 curDir->rewind(); 2f3e6: 0e 94 2c 77 call 0xee58 ; 0xee58 2f3ea: 00 e0 ldi r16, 0x00 ; 0 2f3ec: 0e 7f andi r16, 0xFE ; 254 2f3ee: 0d 7f andi r16, 0xFD ; 253 lsDive("",*curDir, NULL, LS_Count); 2f3f0: d6 01 movw r26, r12 2f3f2: ed 91 ld r30, X+ 2f3f4: fc 91 ld r31, X 2f3f6: 83 e2 ldi r24, 0x23 ; 35 2f3f8: de 01 movw r26, r28 2f3fa: 11 96 adiw r26, 0x01 ; 1 2f3fc: 01 90 ld r0, Z+ 2f3fe: 0d 92 st X+, r0 2f400: 8a 95 dec r24 2f402: e1 f7 brne .-8 ; 0x2f3fc 2f404: 21 e0 ldi r18, 0x01 ; 1 2f406: 50 e0 ldi r21, 0x00 ; 0 2f408: 40 e0 ldi r20, 0x00 ; 0 2f40a: be 01 movw r22, r28 2f40c: 6f 5f subi r22, 0xFF ; 255 2f40e: 7f 4f sbci r23, 0xFF ; 255 2f410: 88 ef ldi r24, 0xF8 ; 248 2f412: 92 e0 ldi r25, 0x02 ; 2 2f414: 0f 94 0f 77 call 0x2ee1e ; 0x2ee1e 2f418: ce 01 movw r24, r28 2f41a: 01 96 adiw r24, 0x01 ; 1 2f41c: 0e 94 31 77 call 0xee62 ; 0xee62 //SERIAL_ECHOLN(nrFiles); return nrFiles; } 2f420: f7 01 movw r30, r14 2f422: 80 81 ld r24, Z 2f424: 91 81 ldd r25, Z+1 ; 0x01 2f426: a3 96 adiw r28, 0x23 ; 35 2f428: 0f b6 in r0, 0x3f ; 63 2f42a: f8 94 cli 2f42c: de bf out 0x3e, r29 ; 62 2f42e: 0f be out 0x3f, r0 ; 63 2f430: cd bf out 0x3d, r28 ; 61 2f432: df 91 pop r29 2f434: cf 91 pop r28 2f436: 0f 91 pop r16 2f438: ff 90 pop r15 2f43a: ef 90 pop r14 2f43c: df 90 pop r13 2f43e: cf 90 pop r12 2f440: 08 95 ret 0002f442 : file.getFilename(t); else t[0]=0; } void CardReader::printAbsFilenameFast() 2f442: cf 93 push r28 2f444: df 93 push r29 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 2f446: 8f e2 ldi r24, 0x2F ; 47 2f448: 0e 94 37 77 call 0xee6e ; 0xee6e { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 2f44c: c0 e0 ldi r28, 0x00 ; 0 { SERIAL_PROTOCOL(dir_names[i]); 2f44e: d9 e0 ldi r29, 0x09 ; 9 } void CardReader::printAbsFilenameFast() { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 2f450: 80 91 30 16 lds r24, 0x1630 ; 0x801630 2f454: c8 17 cp r28, r24 2f456: 60 f4 brcc .+24 ; 0x2f470 { SERIAL_PROTOCOL(dir_names[i]); 2f458: cd 9f mul r28, r29 2f45a: c0 01 movw r24, r0 2f45c: 11 24 eor r1, r1 2f45e: 80 52 subi r24, 0x20 ; 32 2f460: 9b 4e sbci r25, 0xEB ; 235 2f462: 0e 94 14 88 call 0x11028 ; 0x11028 2f466: 8f e2 ldi r24, 0x2F ; 47 2f468: 0e 94 37 77 call 0xee6e ; 0xee6e } void CardReader::printAbsFilenameFast() { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 2f46c: cf 5f subi r28, 0xFF ; 255 2f46e: f0 cf rjmp .-32 ; 0x2f450 { SERIAL_PROTOCOL(dir_names[i]); SERIAL_PROTOCOL('/'); } SERIAL_PROTOCOL(LONGEST_FILENAME); 2f470: 80 91 a7 14 lds r24, 0x14A7 ; 0x8014a7 2f474: 81 11 cpse r24, r1 2f476: 06 c0 rjmp .+12 ; 0x2f484 2f478: 82 e9 ldi r24, 0x92 ; 146 2f47a: 94 e1 ldi r25, 0x14 ; 20 } 2f47c: df 91 pop r29 2f47e: cf 91 pop r28 2f480: 0c 94 14 88 jmp 0x11028 ; 0x11028 for (uint8_t i = 0; i < getWorkDirDepth(); i++) { SERIAL_PROTOCOL(dir_names[i]); SERIAL_PROTOCOL('/'); } SERIAL_PROTOCOL(LONGEST_FILENAME); 2f484: 87 ea ldi r24, 0xA7 ; 167 2f486: 94 e1 ldi r25, 0x14 ; 20 2f488: f9 cf rjmp .-14 ; 0x2f47c 0002f48a : 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) { 2f48a: cf 92 push r12 2f48c: df 92 push r13 2f48e: ef 92 push r14 2f490: ff 92 push r15 2f492: 6b 01 movw r12, r22 2f494: 7c 01 movw r14, r24 eeprom_write_dword_notify(__p, eeprom_read_dword(__p) + add); 2f496: 88 ea ldi r24, 0xA8 ; 168 2f498: 9c e0 ldi r25, 0x0C ; 12 2f49a: 0f 94 24 dc call 0x3b848 ; 0x3b848 2f49e: ab 01 movw r20, r22 2f4a0: bc 01 movw r22, r24 2f4a2: 4c 0d add r20, r12 2f4a4: 5d 1d adc r21, r13 2f4a6: 6e 1d adc r22, r14 2f4a8: 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); 2f4aa: 88 ea ldi r24, 0xA8 ; 168 2f4ac: 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); } 2f4ae: ff 90 pop r15 2f4b0: ef 90 pop r14 2f4b2: df 90 pop r13 2f4b4: 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); 2f4b6: 0d 94 72 dc jmp 0x3b8e4 ; 0x3b8e4 0002f4ba : return def; } return val; } uint32_t __attribute__((noinline)) eeprom_init_default_dword(uint32_t *__p, uint32_t def) { 2f4ba: cf 93 push r28 2f4bc: df 93 push r29 2f4be: ec 01 movw r28, r24 uint32_t val = eeprom_read_dword(__p); 2f4c0: 0f 94 24 dc call 0x3b848 ; 0x3b848 if (val == EEPROM_EMPTY_VALUE32) { 2f4c4: 6f 3f cpi r22, 0xFF ; 255 2f4c6: 2f ef ldi r18, 0xFF ; 255 2f4c8: 72 07 cpc r23, r18 2f4ca: 82 07 cpc r24, r18 2f4cc: 92 07 cpc r25, r18 2f4ce: 49 f4 brne .+18 ; 0x2f4e2 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); 2f4d0: 40 e0 ldi r20, 0x00 ; 0 2f4d2: 50 e0 ldi r21, 0x00 ; 0 2f4d4: ba 01 movw r22, r20 2f4d6: ce 01 movw r24, r28 2f4d8: 0f 94 72 dc call 0x3b8e4 ; 0x3b8e4 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; 2f4dc: 60 e0 ldi r22, 0x00 ; 0 2f4de: 70 e0 ldi r23, 0x00 ; 0 2f4e0: cb 01 movw r24, r22 } return val; } 2f4e2: df 91 pop r29 2f4e4: cf 91 pop r28 2f4e6: 08 95 ret 0002f4e8 : } // 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; 2f4e8: e8 e2 ldi r30, 0x28 ; 40 2f4ea: f7 e1 ldi r31, 0x17 ; 23 2f4ec: 40 81 ld r20, Z 2f4ee: 51 81 ldd r21, Z+1 ; 0x01 2f4f0: 62 81 ldd r22, Z+2 ; 0x02 2f4f2: 73 81 ldd r23, Z+3 ; 0x03 2f4f4: 48 0f add r20, r24 2f4f6: 59 1f adc r21, r25 2f4f8: 61 1d adc r22, r1 2f4fa: 71 1d adc r23, r1 2f4fc: 40 83 st Z, r20 2f4fe: 51 83 std Z+1, r21 ; 0x01 2f500: 62 83 std Z+2, r22 ; 0x02 2f502: 73 83 std Z+3, r23 ; 0x03 } 2f504: 08 95 ret 0002f506 : // make the rdptr point to a safe location - end of file gfReadPtr = gfBlockBuffBegin() + 512; return -1; } bool SdFile::gfEnsureBlock(){ 2f506: 0f 93 push r16 2f508: 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_ ){ 2f50a: 60 91 3d 17 lds r22, 0x173D ; 0x80173d 2f50e: 70 91 3e 17 lds r23, 0x173E ; 0x80173e 2f512: 80 91 3f 17 lds r24, 0x173F ; 0x80173f 2f516: 90 91 40 17 lds r25, 0x1740 ; 0x801740 2f51a: 00 91 91 0e lds r16, 0x0E91 ; 0x800e91 2f51e: 10 91 92 0e lds r17, 0x0E92 ; 0x800e92 2f522: 20 91 93 0e lds r18, 0x0E93 ; 0x800e93 2f526: 30 91 94 0e lds r19, 0x0E94 ; 0x800e94 2f52a: 60 17 cp r22, r16 2f52c: 71 07 cpc r23, r17 2f52e: 82 07 cpc r24, r18 2f530: 93 07 cpc r25, r19 2f532: 39 f1 breq .+78 ; 0x2f582 if ( ! vol_->cacheRawBlock(gfBlock, SdVolume::CACHE_FOR_READ)){ 2f534: 40 e0 ldi r20, 0x00 ; 0 2f536: 0f 94 0d 54 call 0x2a81a ; 0x2a81a 2f53a: 88 23 and r24, r24 2f53c: f9 f0 breq .+62 ; 0x2f57c return false; } // terminate with a '\n' const uint32_t terminateOfs = fileSize_ - gfOffset; 2f53e: 20 91 41 17 lds r18, 0x1741 ; 0x801741 2f542: 30 91 42 17 lds r19, 0x1742 ; 0x801742 2f546: 40 91 31 17 lds r20, 0x1731 ; 0x801731 2f54a: 50 91 32 17 lds r21, 0x1732 ; 0x801732 2f54e: 60 91 33 17 lds r22, 0x1733 ; 0x801733 2f552: 70 91 34 17 lds r23, 0x1734 ; 0x801734 2f556: 42 1b sub r20, r18 2f558: 53 0b sbc r21, r19 2f55a: 61 09 sbc r22, r1 2f55c: 71 09 sbc r23, r1 vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; 2f55e: 41 30 cpi r20, 0x01 ; 1 2f560: 92 e0 ldi r25, 0x02 ; 2 2f562: 59 07 cpc r21, r25 2f564: 61 05 cpc r22, r1 2f566: 71 05 cpc r23, r1 2f568: 20 f0 brcs .+8 ; 0x2f572 2f56a: 40 e0 ldi r20, 0x00 ; 0 2f56c: 52 e0 ldi r21, 0x02 ; 2 2f56e: 60 e0 ldi r22, 0x00 ; 0 2f570: 70 e0 ldi r23, 0x00 ; 0 2f572: 43 56 subi r20, 0x63 ; 99 2f574: 51 4f sbci r21, 0xF1 ; 241 2f576: 9a e0 ldi r25, 0x0A ; 10 2f578: fa 01 movw r30, r20 2f57a: 90 83 st Z, r25 } return true; } 2f57c: 1f 91 pop r17 2f57e: 0f 91 pop r16 2f580: 08 95 ret } // terminate with a '\n' const uint32_t terminateOfs = fileSize_ - gfOffset; vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; } return true; 2f582: 81 e0 ldi r24, 0x01 ; 1 2f584: fb cf rjmp .-10 ; 0x2f57c 0002f586 : } static uint8_t twi_start(uint8_t address, uint8_t reg) 2f586: cf 93 push r28 2f588: df 93 push r29 2f58a: d8 2f mov r29, r24 { // send start condition TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTA); 2f58c: 84 ea ldi r24, 0xA4 ; 164 2f58e: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_START)) 2f592: 88 e0 ldi r24, 0x08 ; 8 2f594: 0f 94 b9 29 call 0x25372 ; 0x25372 2f598: 81 11 cpse r24, r1 2f59a: 16 c0 rjmp .+44 ; 0x2f5c8 return 1; // send address TWDR = TW_WRITE | (address << 1); 2f59c: 8a ee ldi r24, 0xEA ; 234 2f59e: 80 93 bb 00 sts 0x00BB, r24 ; 0x8000bb <__TEXT_REGION_LENGTH__+0x7c20bb> TWCR = _BV(TWEN) | _BV(TWINT); 2f5a2: c4 e8 ldi r28, 0x84 ; 132 2f5a4: c0 93 bc 00 sts 0x00BC, r28 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_MT_SLA_ACK)) 2f5a8: 88 e1 ldi r24, 0x18 ; 24 2f5aa: 0f 94 b9 29 call 0x25372 ; 0x25372 2f5ae: 81 11 cpse r24, r1 2f5b0: 0f c0 rjmp .+30 ; 0x2f5d0 return 2; // send register TWDR = reg; 2f5b2: d0 93 bb 00 sts 0x00BB, r29 ; 0x8000bb <__TEXT_REGION_LENGTH__+0x7c20bb> TWCR = _BV(TWEN) | _BV(TWINT); 2f5b6: c0 93 bc 00 sts 0x00BC, r28 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_MT_DATA_ACK)) 2f5ba: 88 e2 ldi r24, 0x28 ; 40 2f5bc: 0f 94 b9 29 call 0x25372 ; 0x25372 2f5c0: 88 23 and r24, r24 2f5c2: 19 f0 breq .+6 ; 0x2f5ca return 3; 2f5c4: 83 e0 ldi r24, 0x03 ; 3 2f5c6: 01 c0 rjmp .+2 ; 0x2f5ca 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; 2f5c8: 81 e0 ldi r24, 0x01 ; 1 TWCR = _BV(TWEN) | _BV(TWINT); if(twi_wait(TW_MT_DATA_ACK)) return 3; return 0; } 2f5ca: df 91 pop r29 2f5cc: cf 91 pop r28 2f5ce: 08 95 ret // send address TWDR = TW_WRITE | (address << 1); TWCR = _BV(TWEN) | _BV(TWINT); if(twi_wait(TW_MT_SLA_ACK)) return 2; 2f5d0: 82 e0 ldi r24, 0x02 ; 2 2f5d2: fb cf rjmp .-10 ; 0x2f5ca 0002f5d4 : ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { ret = stepCount; } return ret; } void PAT9125_sensor::resetStepCount() { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { stepCount = 0; } 2f5d4: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 2f5d6: f8 94 cli 2f5d8: 10 92 bc 17 sts 0x17BC, r1 ; 0x8017bc 2f5dc: 10 92 bb 17 sts 0x17BB, r1 ; 0x8017bb (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 2f5e0: 8f bf out 0x3f, r24 ; 63 } 2f5e2: 08 95 ret 0002f5e4 : 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); 2f5e4: 87 e6 ldi r24, 0x67 ; 103 2f5e6: 9f e0 ldi r25, 0x0F ; 15 2f5e8: 0f 94 1c dc call 0x3b838 ; 0x3b838 2f5ec: 91 e0 ldi r25, 0x01 ; 1 2f5ee: 81 11 cpse r24, r1 2f5f0: 01 c0 rjmp .+2 ; 0x2f5f4 2f5f2: 90 e0 ldi r25, 0x00 ; 0 if ((state != State::disabled) != enabled) { 2f5f4: 81 e0 ldi r24, 0x01 ; 1 2f5f6: 20 91 aa 17 lds r18, 0x17AA ; 0x8017aa 2f5fa: 21 11 cpse r18, r1 2f5fc: 01 c0 rjmp .+2 ; 0x2f600 2f5fe: 80 e0 ldi r24, 0x00 ; 0 2f600: 98 13 cpse r25, r24 state = enabled ? State::initializing : State::disabled; 2f602: 90 93 aa 17 sts 0x17AA, r25 ; 0x8017aa } autoLoadEnabled = eeprom_read_byte((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED); 2f606: 87 e0 ldi r24, 0x07 ; 7 2f608: 9f e0 ldi r25, 0x0F ; 15 2f60a: 0f 94 1c dc call 0x3b838 ; 0x3b838 2f60e: 91 e0 ldi r25, 0x01 ; 1 2f610: 81 11 cpse r24, r1 2f612: 01 c0 rjmp .+2 ; 0x2f616 2f614: 90 e0 ldi r25, 0x00 ; 0 2f616: 90 93 ab 17 sts 0x17AB, r25 ; 0x8017ab runoutEnabled = eeprom_read_byte((uint8_t *)EEPROM_FSENS_RUNOUT_ENABLED); 2f61a: 85 ed ldi r24, 0xD5 ; 213 2f61c: 9e e0 ldi r25, 0x0E ; 14 2f61e: 0f 94 1c dc call 0x3b838 ; 0x3b838 2f622: 91 e0 ldi r25, 0x01 ; 1 2f624: 81 11 cpse r24, r1 2f626: 01 c0 rjmp .+2 ; 0x2f62a 2f628: 90 e0 ldi r25, 0x00 ; 0 2f62a: 90 93 ac 17 sts 0x17AC, r25 ; 0x8017ac sensorActionOnError = (SensorActionOnError)eeprom_read_byte((uint8_t *)EEPROM_FSENSOR_ACTION_NA); 2f62e: 87 e4 ldi r24, 0x47 ; 71 2f630: 9d e0 ldi r25, 0x0D ; 13 2f632: 0f 94 1c dc call 0x3b838 ; 0x3b838 if (sensorActionOnError == SensorActionOnError::_Undef) { 2f636: 8f 3f cpi r24, 0xFF ; 255 2f638: c9 f0 breq .+50 ; 0x2f66c 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); 2f63a: 80 93 b2 17 sts 0x17B2, r24 ; 0x8017b2 } 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)); 2f63e: 8d ea ldi r24, 0xAD ; 173 2f640: 9c e0 ldi r25, 0x0C ; 12 2f642: 0f 94 1c dc call 0x3b838 ; 0x3b838 2f646: 91 e0 ldi r25, 0x01 ; 1 2f648: 81 11 cpse r24, r1 2f64a: 01 c0 rjmp .+2 ; 0x2f64e 2f64c: 90 e0 ldi r25, 0x00 ; 0 return fsensorDetected; } #endif void PAT9125_sensor::setJamDetectionEnabled(bool state, bool updateEEPROM) { jamDetection = state; 2f64e: 90 93 b8 17 sts 0x17B8, r25 ; 0x8017b8 oldPos = pat9125_y; 2f652: 80 91 8f 0e lds r24, 0x0E8F ; 0x800e8f 2f656: 90 91 90 0e lds r25, 0x0E90 ; 0x800e90 2f65a: 90 93 ba 17 sts 0x17BA, r25 ; 0x8017ba 2f65e: 80 93 b9 17 sts 0x17B9, r24 ; 0x8017b9 resetStepCount(); 2f662: 0f 94 ea 7a call 0x2f5d4 ; 0x2f5d4 jamErrCnt = 0; 2f666: 10 92 bf 17 sts 0x17BF, r1 ; 0x8017bf 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)); } 2f66a: 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; 2f66c: 10 92 b2 17 sts 0x17B2, r1 ; 0x8017b2 2f670: e6 cf rjmp .-52 ; 0x2f63e 0002f672 : #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) { 2f672: 80 91 aa 17 lds r24, 0x17AA ; 0x8017aa 2f676: 83 30 cpi r24, 0x03 ; 3 2f678: 21 f4 brne .+8 ; 0x2f682 } void PAT9125_sensor::deinit() { // puts_P(PSTR("fsensor::deinit()")); ; // state = State::disabled; 2f67a: 10 92 aa 17 sts 0x17AA, r1 ; 0x8017aa filter = 0; 2f67e: 10 92 b6 17 sts 0x17B6, r1 ; 0x8017b6 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 2f682: 0f 94 f2 7a call 0x2f5e4 ; 0x2f5e4 int16_t stepCount; int16_t chunkSteps; uint8_t jamErrCnt; constexpr void calcChunkSteps(float u) { chunkSteps = (int16_t)(1.25 * u); //[mm] 2f686: 20 e0 ldi r18, 0x00 ; 0 2f688: 30 e0 ldi r19, 0x00 ; 0 2f68a: 40 ea ldi r20, 0xA0 ; 160 2f68c: 5f e3 ldi r21, 0x3F ; 63 2f68e: 60 91 ce 0d lds r22, 0x0DCE ; 0x800dce 2f692: 70 91 cf 0d lds r23, 0x0DCF ; 0x800dcf 2f696: 80 91 d0 0d lds r24, 0x0DD0 ; 0x800dd0 2f69a: 90 91 d1 0d lds r25, 0x0DD1 ; 0x800dd1 2f69e: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 2f6a2: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> 2f6a6: 70 93 be 17 sts 0x17BE, r23 ; 0x8017be 2f6aa: 60 93 bd 17 sts 0x17BD, r22 ; 0x8017bd void twi_init(void) { // activate internal pullups for SDA SET_INPUT(SDA_PIN); 2f6ae: 51 98 cbi 0x0a, 1 ; 10 WRITE(SDA_PIN, 1); 2f6b0: 59 9a sbi 0x0b, 1 ; 11 // start with the SDA pulled low WRITE(SCL_PIN, 0); 2f6b2: 58 98 cbi 0x0b, 0 ; 11 SET_OUTPUT(SCL_PIN); 2f6b4: 50 9a sbi 0x0a, 0 ; 10 2f6b6: 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); 2f6b8: 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); 2f6ba: 95 e0 ldi r25, 0x05 ; 5 2f6bc: 9a 95 dec r25 2f6be: f1 f7 brne .-4 ; 0x2f6bc 2f6c0: 00 00 nop _delay_us((1000000 / TWI_FREQ) / 2); WRITE(SCL_PIN, 0); 2f6c2: 58 98 cbi 0x0b, 0 ; 11 2f6c4: 95 e0 ldi r25, 0x05 ; 5 2f6c6: 9a 95 dec r25 2f6c8: f1 f7 brne .-4 ; 0x2f6c6 2f6ca: 00 00 nop 2f6cc: 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++) { 2f6ce: a1 f7 brne .-24 ; 0x2f6b8 WRITE(SCL_PIN, 0); _delay_us((1000000 / TWI_FREQ) / 2); } // activate internal pullups for SCL SET_INPUT(SCL_PIN); 2f6d0: 50 98 cbi 0x0a, 0 ; 10 WRITE(SCL_PIN, 1); 2f6d2: 58 9a sbi 0x0b, 0 ; 11 // initialize twi prescaler and bit rate TWSR &= ~(_BV(TWPS0) | _BV(TWPS1)); 2f6d4: 80 91 b9 00 lds r24, 0x00B9 ; 0x8000b9 <__TEXT_REGION_LENGTH__+0x7c20b9> 2f6d8: 8c 7f andi r24, 0xFC ; 252 2f6da: 80 93 b9 00 sts 0x00B9, r24 ; 0x8000b9 <__TEXT_REGION_LENGTH__+0x7c20b9> TWBR = ((F_CPU / TWI_FREQ) - 16) / 2; 2f6de: 8c e0 ldi r24, 0x0C ; 12 2f6e0: 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); 2f6e4: 84 ea ldi r24, 0xA4 ; 164 2f6e6: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_START)) 2f6ea: 88 e0 ldi r24, 0x08 ; 8 2f6ec: 0f 94 b9 29 call 0x25372 ; 0x25372 2f6f0: 81 11 cpse r24, r1 2f6f2: 68 c0 rjmp .+208 ; 0x2f7c4 return 1; // send address TWDR = TW_WRITE | (address << 1); 2f6f4: 8a ee ldi r24, 0xEA ; 234 2f6f6: 80 93 bb 00 sts 0x00BB, r24 ; 0x8000bb <__TEXT_REGION_LENGTH__+0x7c20bb> TWCR = _BV(TWEN) | _BV(TWINT); 2f6fa: 84 e8 ldi r24, 0x84 ; 132 2f6fc: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_MT_SLA_ACK)) 2f700: 88 e1 ldi r24, 0x18 ; 24 2f702: 0f 94 b9 29 call 0x25372 ; 0x25372 2f706: 81 11 cpse r24, r1 2f708: 5d c0 rjmp .+186 ; 0x2f7c4 } static void twi_stop() { TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTO); 2f70a: 84 e9 ldi r24, 0x94 ; 148 2f70c: 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); 2f710: 60 e0 ldi r22, 0x00 ; 0 2f712: 8f e7 ldi r24, 0x7F ; 127 2f714: 0f 94 0e c2 call 0x3841c ; 0x3841c // Verify that the sensor responds with its correct product ID. pat9125_PID1 = pat9125_rd_reg(PAT9125_PID1); 2f718: 80 e0 ldi r24, 0x00 ; 0 2f71a: 0f 94 29 c2 call 0x38452 ; 0x38452 2f71e: 80 93 bd 0d sts 0x0DBD, r24 ; 0x800dbd pat9125_PID2 = pat9125_rd_reg(PAT9125_PID2); 2f722: 81 e0 ldi r24, 0x01 ; 1 2f724: 0f 94 29 c2 call 0x38452 ; 0x38452 2f728: 80 93 bc 0d sts 0x0DBC, r24 ; 0x800dbc if ((pat9125_PID1 != 0x31) || (pat9125_PID2 != 0x91)) 2f72c: 90 91 bd 0d lds r25, 0x0DBD ; 0x800dbd 2f730: 91 33 cpi r25, 0x31 ; 49 2f732: b9 f5 brne .+110 ; 0x2f7a2 2f734: 81 39 cpi r24, 0x91 ; 145 2f736: a9 f5 brne .+106 ; 0x2f7a2 } #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); 2f738: 67 e9 ldi r22, 0x97 ; 151 2f73a: 86 e0 ldi r24, 0x06 ; 6 2f73c: 0f 94 0e c2 call 0x3841c ; 0x3841c #else //round up by default __ticks_dc = (uint32_t)(ceil(fabs(__tmp))); #endif __builtin_avr_delay_cycles(__ticks_dc); 2f740: 8f e9 ldi r24, 0x9F ; 159 2f742: 9f e0 ldi r25, 0x0F ; 15 2f744: 01 97 sbiw r24, 0x01 ; 1 2f746: f1 f7 brne .-4 ; 0x2f744 2f748: 00 c0 rjmp .+0 ; 0x2f74a 2f74a: 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)) 2f74c: 84 e0 ldi r24, 0x04 ; 4 2f74e: 9b ea ldi r25, 0xAB ; 171 2f750: 0f 94 56 c2 call 0x384ac ; 0x384ac 2f754: 88 23 and r24, r24 2f756: b1 f1 breq .+108 ; 0x2f7c4 2f758: 8f e3 ldi r24, 0x3F ; 63 2f75a: 9c e9 ldi r25, 0x9C ; 156 2f75c: 01 97 sbiw r24, 0x01 ; 1 2f75e: f1 f7 brne .-4 ; 0x2f75c 2f760: 00 c0 rjmp .+0 ; 0x2f762 2f762: 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); 2f764: 61 e0 ldi r22, 0x01 ; 1 2f766: 8f e7 ldi r24, 0x7F ; 127 2f768: 0f 94 0e c2 call 0x3841c ; 0x3841c //Write init sequence in bank1. MUST ALREADY BE IN bank1. if (!pat9125_wr_seq(pat9125_init_bank1)) 2f76c: 81 ed ldi r24, 0xD1 ; 209 2f76e: 9a ea ldi r25, 0xAA ; 170 2f770: 0f 94 56 c2 call 0x384ac ; 0x384ac 2f774: 88 23 and r24, r24 2f776: 31 f1 breq .+76 ; 0x2f7c4 return 0; // Switch to bank0, not allowed to perform pat9125_wr_reg_verify on this register. pat9125_wr_reg(PAT9125_BANK_SELECTION, 0x00); 2f778: 60 e0 ldi r22, 0x00 ; 0 2f77a: 8f e7 ldi r24, 0x7F ; 127 2f77c: 0f 94 0e c2 call 0x3841c ; 0x3841c // Enable write protect. pat9125_wr_reg(PAT9125_WP, 0x00); //prevents writing to registers over 0x09 2f780: 60 e0 ldi r22, 0x00 ; 0 2f782: 89 e0 ldi r24, 0x09 ; 9 2f784: 0f 94 0e c2 call 0x3841c ; 0x3841c pat9125_PID1 = pat9125_rd_reg(PAT9125_PID1); 2f788: 80 e0 ldi r24, 0x00 ; 0 2f78a: 0f 94 29 c2 call 0x38452 ; 0x38452 2f78e: 80 93 bd 0d sts 0x0DBD, r24 ; 0x800dbd pat9125_PID2 = pat9125_rd_reg(PAT9125_PID2); 2f792: 81 e0 ldi r24, 0x01 ; 1 2f794: 0f 94 29 c2 call 0x38452 ; 0x38452 2f798: 80 93 bc 0d sts 0x0DBC, r24 ; 0x800dbc deinit(); triggerError(); ; // } #ifdef IR_SENSOR_PIN else if (!READ(IR_SENSOR_PIN)) { 2f79c: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 2f7a0: 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); 2f7a2: 80 e0 ldi r24, 0x00 ; 0 2f7a4: 0f 94 29 c2 call 0x38452 ; 0x38452 2f7a8: 80 93 bd 0d sts 0x0DBD, r24 ; 0x800dbd pat9125_PID2 = pat9125_rd_reg(PAT9125_PID2); 2f7ac: 81 e0 ldi r24, 0x01 ; 1 2f7ae: 0f 94 29 c2 call 0x38452 ; 0x38452 2f7b2: 80 93 bc 0d sts 0x0DBC, r24 ; 0x800dbc if ((pat9125_PID1 != 0x31) || (pat9125_PID2 != 0x91)) 2f7b6: 90 91 bd 0d lds r25, 0x0DBD ; 0x800dbd 2f7ba: 91 33 cpi r25, 0x31 ; 49 2f7bc: 19 f4 brne .+6 ; 0x2f7c4 2f7be: 81 39 cpi r24, 0x91 ; 145 2f7c0: 09 f4 brne .+2 ; 0x2f7c4 2f7c2: ba cf rjmp .-140 ; 0x2f738 void PAT9125_sensor::deinit() { // puts_P(PSTR("fsensor::deinit()")); ; // state = State::disabled; filter = 0; 2f7c4: 10 92 b6 17 sts 0x17B6, r1 ; 0x8017b6 eeprom_increment_word((uint16_t *)EEPROM_FERROR_COUNT_TOT); enquecommand_front_P(MSG_M600); } void Filament_sensor::triggerError() { state = State::error; 2f7c8: 83 e0 ldi r24, 0x03 ; 3 2f7ca: 80 93 aa 17 sts 0x17AA, r24 ; 0x8017aa #ifdef IR_SENSOR_PIN else if (!READ(IR_SENSOR_PIN)) { ; // MK3 fw on MK3S printer } #endif // IR_SENSOR_PIN } 2f7ce: 08 95 ret 0002f7d0 : 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() { 2f7d0: cf 93 push r28 2f7d2: df 93 push r29 if (jamDetection) { 2f7d4: 80 91 b8 17 lds r24, 0x17B8 ; 0x8017b8 2f7d8: 88 23 and r24, r24 2f7da: 09 f4 brne .+2 ; 0x2f7de 2f7dc: 62 c0 rjmp .+196 ; 0x2f8a2 setJamDetectionEnabled(eeprom_read_byte((uint8_t *)EEPROM_FSENSOR_JAM_DETECTION)); } int16_t PAT9125_sensor::getStepCount() { int16_t ret; ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { ret = stepCount; } 2f7de: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 2f7e0: f8 94 cli 2f7e2: c0 91 bb 17 lds r28, 0x17BB ; 0x8017bb 2f7e6: d0 91 bc 17 lds r29, 0x17BC ; 0x8017bc (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 2f7ea: 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 2f7ec: ce 01 movw r24, r28 2f7ee: d7 ff sbrs r29, 7 2f7f0: 04 c0 rjmp .+8 ; 0x2f7fa 2f7f2: 88 27 eor r24, r24 2f7f4: 99 27 eor r25, r25 2f7f6: 8c 1b sub r24, r28 2f7f8: 9d 0b sbc r25, r29 2f7fa: 20 91 bd 17 lds r18, 0x17BD ; 0x8017bd 2f7fe: 30 91 be 17 lds r19, 0x17BE ; 0x8017be 2f802: 82 17 cp r24, r18 2f804: 93 07 cpc r25, r19 2f806: 4c f1 brlt .+82 ; 0x2f85a resetStepCount(); 2f808: 0f 94 ea 7a call 0x2f5d4 ; 0x2f5d4 if (!pat9125_update()) { // get up to date data. reinit on error. 2f80c: 0f 94 74 c2 call 0x384e8 ; 0x384e8 2f810: 81 11 cpse r24, r1 2f812: 02 c0 rjmp .+4 ; 0x2f818 init(); // try to reinit. 2f814: 0f 94 39 7b call 0x2f672 ; 0x2f672 } bool fsDir = (pat9125_y - oldPos) > 0; 2f818: 20 91 8f 0e lds r18, 0x0E8F ; 0x800e8f 2f81c: 30 91 90 0e lds r19, 0x0E90 ; 0x800e90 2f820: 80 91 bf 17 lds r24, 0x17BF ; 0x8017bf 2f824: 40 91 b9 17 lds r20, 0x17B9 ; 0x8017b9 2f828: 50 91 ba 17 lds r21, 0x17BA ; 0x8017ba 2f82c: b9 01 movw r22, r18 2f82e: 64 1b sub r22, r20 2f830: 75 0b sbc r23, r21 2f832: 41 e0 ldi r20, 0x01 ; 1 2f834: 16 16 cp r1, r22 2f836: 17 06 cpc r1, r23 2f838: 0c f0 brlt .+2 ; 0x2f83c 2f83a: 40 e0 ldi r20, 0x00 ; 0 bool stDir = _stepCount > 0; 2f83c: 91 e0 ldi r25, 0x01 ; 1 2f83e: 1c 16 cp r1, r28 2f840: 1d 06 cpc r1, r29 2f842: 0c f0 brlt .+2 ; 0x2f846 2f844: 90 e0 ldi r25, 0x00 ; 0 if (fsDir != stDir) { 2f846: 49 17 cp r20, r25 2f848: 09 f4 brne .+2 ; 0x2f84c 2f84a: 63 c0 rjmp .+198 ; 0x2f912 jamErrCnt++; 2f84c: 8f 5f subi r24, 0xFF ; 255 } else if (jamErrCnt) { jamErrCnt--; 2f84e: 80 93 bf 17 sts 0x17BF, r24 ; 0x8017bf } oldPos = pat9125_y; 2f852: 30 93 ba 17 sts 0x17BA, r19 ; 0x8017ba 2f856: 20 93 b9 17 sts 0x17B9, r18 ; 0x8017b9 } if (jamErrCnt > 10) { 2f85a: 80 91 bf 17 lds r24, 0x17BF ; 0x8017bf 2f85e: 8b 30 cpi r24, 0x0B ; 11 2f860: 00 f1 brcs .+64 ; 0x2f8a2 jamErrCnt = 0; 2f862: 10 92 bf 17 sts 0x17BF, r1 ; 0x8017bf void PAT9125_sensor::resetStepCount() { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { stepCount = 0; } } void PAT9125_sensor::filJam() { runoutEnabled = false; 2f866: 10 92 ac 17 sts 0x17AC, r1 ; 0x8017ac autoLoadEnabled = false; 2f86a: 10 92 ab 17 sts 0x17AB, r1 ; 0x8017ab jamDetection = false; 2f86e: 10 92 b8 17 sts 0x17B8, r1 ; 0x8017b8 stop_and_save_print_to_ram(0, 0); 2f872: 20 e0 ldi r18, 0x00 ; 0 2f874: 30 e0 ldi r19, 0x00 ; 0 2f876: a9 01 movw r20, r18 2f878: ca 01 movw r24, r20 2f87a: b9 01 movw r22, r18 2f87c: 0e 94 37 89 call 0x1126e ; 0x1126e restore_print_from_ram_and_continue(0); 2f880: 60 e0 ldi r22, 0x00 ; 0 2f882: 70 e0 ldi r23, 0x00 ; 0 2f884: cb 01 movw r24, r22 2f886: 0e 94 44 68 call 0xd088 ; 0xd088 eeprom_increment_byte((uint8_t *)EEPROM_FERROR_COUNT); 2f88a: 85 e6 ldi r24, 0x65 ; 101 2f88c: 9f e0 ldi r25, 0x0F ; 15 2f88e: 0e 94 28 76 call 0xec50 ; 0xec50 eeprom_increment_word((uint16_t *)EEPROM_FERROR_COUNT_TOT); 2f892: 81 e0 ldi r24, 0x01 ; 1 2f894: 9f e0 ldi r25, 0x0F ; 15 2f896: 0e 94 1b 76 call 0xec36 ; 0xec36 enquecommand_front_P(MSG_M600); 2f89a: 8b ee ldi r24, 0xEB ; 235 2f89c: 90 e7 ldi r25, 0x70 ; 112 2f89e: 0f 94 fd 74 call 0x2e9fa ; 0x2e9fa jamErrCnt = 0; filJam(); } } if (pollingTimer.expired_cont(pollingPeriod)) { 2f8a2: 6a e0 ldi r22, 0x0A ; 10 2f8a4: 70 e0 ldi r23, 0x00 ; 0 2f8a6: 83 eb ldi r24, 0xB3 ; 179 2f8a8: 97 e1 ldi r25, 0x17 ; 23 2f8aa: 0f 94 a6 29 call 0x2534c ; 0x2534c ::expired_cont(unsigned short)> 2f8ae: c8 2f mov r28, r24 2f8b0: 88 23 and r24, r24 2f8b2: 39 f1 breq .+78 ; 0x2f902 pollingTimer.start(); 2f8b4: 83 eb ldi r24, 0xB3 ; 179 2f8b6: 97 e1 ldi r25, 0x17 ; 23 2f8b8: 0f 94 ad 29 call 0x2535a ; 0x2535a ::start()> if (!pat9125_update()) { 2f8bc: 0f 94 74 c2 call 0x384e8 ; 0x384e8 2f8c0: 81 11 cpse r24, r1 2f8c2: 02 c0 rjmp .+4 ; 0x2f8c8 init(); // try to reinit. 2f8c4: 0f 94 39 7b call 0x2f672 ; 0x2f672 } bool present = (pat9125_s < 17) || (pat9125_s >= 17 && pat9125_b >= 50); 2f8c8: 80 91 bb 0d lds r24, 0x0DBB ; 0x800dbb 2f8cc: 81 31 cpi r24, 0x11 ; 17 2f8ce: 30 f0 brcs .+12 ; 0x2f8dc 2f8d0: c1 e0 ldi r28, 0x01 ; 1 2f8d2: 80 91 ba 0d lds r24, 0x0DBA ; 0x800dba 2f8d6: 82 33 cpi r24, 0x32 ; 50 2f8d8: 08 f4 brcc .+2 ; 0x2f8dc 2f8da: c0 e0 ldi r28, 0x00 ; 0 2f8dc: 80 91 b6 17 lds r24, 0x17B6 ; 0x8017b6 if (present != filterFilPresent) { 2f8e0: 20 91 b7 17 lds r18, 0x17B7 ; 0x8017b7 2f8e4: 30 e0 ldi r19, 0x00 ; 0 2f8e6: c2 17 cp r28, r18 2f8e8: 13 06 cpc r1, r19 2f8ea: c1 f0 breq .+48 ; 0x2f91c filter++; 2f8ec: 8f 5f subi r24, 0xFF ; 255 } else if (filter) { filter--; 2f8ee: 80 93 b6 17 sts 0x17B6, r24 ; 0x8017b6 } if (filter >= filterCnt) { 2f8f2: 80 91 b6 17 lds r24, 0x17B6 ; 0x8017b6 2f8f6: 85 30 cpi r24, 0x05 ; 5 2f8f8: 20 f0 brcs .+8 ; 0x2f902 filter = 0; 2f8fa: 10 92 b6 17 sts 0x17B6, r1 ; 0x8017b6 filterFilPresent = present; 2f8fe: c0 93 b7 17 sts 0x17B7, r28 ; 0x8017b7 } } return (filter == 0); // return stability 2f902: 81 e0 ldi r24, 0x01 ; 1 2f904: 90 91 b6 17 lds r25, 0x17B6 ; 0x8017b6 2f908: 91 11 cpse r25, r1 2f90a: 80 e0 ldi r24, 0x00 ; 0 } 2f90c: df 91 pop r29 2f90e: cf 91 pop r28 2f910: 08 95 ret } bool fsDir = (pat9125_y - oldPos) > 0; bool stDir = _stepCount > 0; if (fsDir != stDir) { jamErrCnt++; } else if (jamErrCnt) { 2f912: 88 23 and r24, r24 2f914: 09 f4 brne .+2 ; 0x2f918 2f916: 9d cf rjmp .-198 ; 0x2f852 jamErrCnt--; 2f918: 81 50 subi r24, 0x01 ; 1 2f91a: 99 cf rjmp .-206 ; 0x2f84e } bool present = (pat9125_s < 17) || (pat9125_s >= 17 && pat9125_b >= 50); if (present != filterFilPresent) { filter++; } else if (filter) { 2f91c: 88 23 and r24, r24 2f91e: 49 f3 breq .-46 ; 0x2f8f2 filter--; 2f920: 81 50 subi r24, 0x01 ; 1 2f922: e5 cf rjmp .-54 ; 0x2f8ee 0002f924 : * 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() { 2f924: 2f 92 push r2 2f926: 3f 92 push r3 2f928: 4f 92 push r4 2f92a: 5f 92 push r5 2f92c: 6f 92 push r6 2f92e: 7f 92 push r7 2f930: 8f 92 push r8 2f932: 9f 92 push r9 2f934: af 92 push r10 2f936: bf 92 push r11 2f938: cf 92 push r12 2f93a: df 92 push r13 2f93c: ef 92 push r14 2f93e: ff 92 push r15 2f940: 0f 93 push r16 2f942: 1f 93 push r17 2f944: cf 93 push r28 2f946: df 93 push r29 2f948: cd b7 in r28, 0x3d ; 61 2f94a: de b7 in r29, 0x3e ; 62 2f94c: ed 97 sbiw r28, 0x3d ; 61 2f94e: 0f b6 in r0, 0x3f ; 63 2f950: f8 94 cli 2f952: de bf out 0x3e, r29 ; 62 2f954: 0f be out 0x3f, r0 ; 63 2f956: cd bf out 0x3d, r28 ; 61 KEEPALIVE_STATE(NOT_BUSY); } void CardReader::flush_presort() { sort_count = 0; 2f958: 10 92 32 16 sts 0x1632, r1 ; 0x801632 2f95c: 10 92 31 16 sts 0x1631, r1 ; 0x801631 lastSortedFilePosition = 0; 2f960: 10 92 fc 16 sts 0x16FC, r1 ; 0x8016fc 2f964: 10 92 fb 16 sts 0x16FB, r1 ; 0x8016fb */ void CardReader::presort() { // Throw away old sort index flush_presort(); if (IS_SD_INSERTED == false) return; //sorting is not used in farm mode 2f968: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2f96c: 80 fd sbrc r24, 0 2f96e: ef c0 rjmp .+478 ; 0x2fb4e uint8_t sdSort = eeprom_read_byte((uint8_t*)EEPROM_SD_SORT); 2f970: 89 e0 ldi r24, 0x09 ; 9 2f972: 9f e0 ldi r25, 0x0F ; 15 2f974: 0f 94 1c dc call 0x3b838 ; 0x3b838 2f978: 38 2e mov r3, r24 KEEPALIVE_STATE(IN_HANDLER); 2f97a: 82 e0 ldi r24, 0x02 ; 2 2f97c: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be // If there are files, sort up to the limit uint16_t fileCnt = getnrfilenames(); 2f980: 0f 94 d4 79 call 0x2f3a8 ; 0x2f3a8 2f984: 6c 01 movw r12, r24 if (fileCnt > 0) { 2f986: 00 97 sbiw r24, 0x00 ; 0 2f988: 09 f4 brne .+2 ; 0x2f98c 2f98a: de c0 rjmp .+444 ; 0x2fb48 // Never sort more than the max allowed // If you use folders to organize, 20 may be enough if (fileCnt > SDSORT_LIMIT) { 2f98c: 85 36 cpi r24, 0x65 ; 101 2f98e: 91 05 cpc r25, r1 2f990: 60 f0 brcs .+24 ; 0x2f9aa if ((sdSort != SD_SORT_NONE) && !farm_mode) { 2f992: 32 e0 ldi r19, 0x02 ; 2 2f994: 33 16 cp r3, r19 2f996: 31 f0 breq .+12 ; 0x2f9a4 lcd_show_fullscreen_message_and_wait_P(_T(MSG_FILE_CNT)); 2f998: 80 e8 ldi r24, 0x80 ; 128 2f99a: 9c e5 ldi r25, 0x5C ; 92 2f99c: 0e 94 ac 72 call 0xe558 ; 0xe558 2f9a0: 0f 94 f1 1f call 0x23fe2 ; 0x23fe2 } fileCnt = SDSORT_LIMIT; 2f9a4: f4 e6 ldi r31, 0x64 ; 100 2f9a6: cf 2e mov r12, r31 2f9a8: d1 2c mov r13, r1 } sort_count = fileCnt; 2f9aa: d0 92 32 16 sts 0x1632, r13 ; 0x801632 2f9ae: c0 92 31 16 sts 0x1631, r12 ; 0x801631 2f9b2: 63 e3 ldi r22, 0x33 ; 51 2f9b4: 66 2e mov r6, r22 2f9b6: 66 e1 ldi r22, 0x16 ; 22 2f9b8: 76 2e mov r7, r22 // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { 2f9ba: f1 2c mov r15, r1 2f9bc: e1 2c mov r14, r1 lsDive("", *curDir, match, LS_GetFilename); } void CardReader::getfilename_next(uint32_t position, const char * const match/*=NULL*/) { curDir = &workDir; 2f9be: 7b e3 ldi r23, 0x3B ; 59 2f9c0: a7 2e mov r10, r23 2f9c2: 75 e1 ldi r23, 0x15 ; 21 2f9c4: b7 2e mov r11, r23 nrFiles = 1; 2f9c6: 88 24 eor r8, r8 2f9c8: 83 94 inc r8 2f9ca: 91 2c mov r9, r1 sort_count = fileCnt; // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { if (!IS_SD_INSERTED) return; 2f9cc: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2f9d0: 80 fd sbrc r24, 0 2f9d2: bd c0 rjmp .+378 ; 0x2fb4e manage_heater(); 2f9d4: 0f 94 5c 38 call 0x270b8 ; 0x270b8 if (i == 0) 2f9d8: e1 14 cp r14, r1 2f9da: f1 04 cpc r15, r1 2f9dc: 09 f0 breq .+2 ; 0x2f9e0 2f9de: d0 c0 rjmp .+416 ; 0x2fb80 getfilename(0); 2f9e0: 90 e0 ldi r25, 0x00 ; 0 2f9e2: 80 e0 ldi r24, 0x00 ; 0 2f9e4: 0f 94 3e 79 call 0x2f27c ; 0x2f27c else getfilename_next(position); sort_entries[i] = position >> 5; 2f9e8: 80 91 a3 14 lds r24, 0x14A3 ; 0x8014a3 2f9ec: 90 91 a4 14 lds r25, 0x14A4 ; 0x8014a4 2f9f0: a0 91 a5 14 lds r26, 0x14A5 ; 0x8014a5 2f9f4: b0 91 a6 14 lds r27, 0x14A6 ; 0x8014a6 2f9f8: 55 e0 ldi r21, 0x05 ; 5 2f9fa: b6 95 lsr r27 2f9fc: a7 95 ror r26 2f9fe: 97 95 ror r25 2fa00: 87 95 ror r24 2fa02: 5a 95 dec r21 2fa04: d1 f7 brne .-12 ; 0x2f9fa 2fa06: f3 01 movw r30, r6 2fa08: 81 93 st Z+, r24 2fa0a: 91 93 st Z+, r25 2fa0c: 3f 01 movw r6, r30 } sort_count = fileCnt; // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { 2fa0e: ff ef ldi r31, 0xFF ; 255 2fa10: ef 1a sub r14, r31 2fa12: ff 0a sbc r15, r31 2fa14: ce 14 cp r12, r14 2fa16: df 04 cpc r13, r15 2fa18: c9 f6 brne .-78 ; 0x2f9cc else getfilename_next(position); sort_entries[i] = position >> 5; } if ((fileCnt > 1) && (sdSort != SD_SORT_NONE) && !farm_mode) { 2fa1a: 21 e0 ldi r18, 0x01 ; 1 2fa1c: e2 16 cp r14, r18 2fa1e: f1 04 cpc r15, r1 2fa20: 09 f4 brne .+2 ; 0x2fa24 2fa22: 92 c0 rjmp .+292 ; 0x2fb48 2fa24: 32 e0 ldi r19, 0x02 ; 2 2fa26: 33 16 cp r3, r19 2fa28: 09 f4 brne .+2 ; 0x2fa2c 2fa2a: 8e c0 rjmp .+284 ; 0x2fb48 #ifdef SORTING_SPEEDTEST LongTimer sortingSpeedtestTimer; sortingSpeedtestTimer.start(); #endif //SORTING_SPEEDTEST lastSortedFilePosition = position >> 5; 2fa2c: 90 93 fc 16 sts 0x16FC, r25 ; 0x8016fc 2fa30: 80 93 fb 16 sts 0x16FB, r24 ; 0x8016fb #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)); 2fa34: 80 e7 ldi r24, 0x70 ; 112 2fa36: 9c e5 ldi r25, 0x5C ; 92 2fa38: 0e 94 ac 72 call 0xe558 ; 0xe558 2fa3c: ee 9c mul r14, r14 2fa3e: 90 01 movw r18, r0 2fa40: ef 9c mul r14, r15 2fa42: 30 0d add r19, r0 2fa44: 30 0d add r19, r0 2fa46: 11 24 eor r1, r1 2fa48: bc 01 movw r22, r24 2fa4a: c9 01 movw r24, r18 2fa4c: 96 95 lsr r25 2fa4e: 87 95 ror r24 2fa50: 0f 94 f8 cf call 0x39ff0 ; 0x39ff0 2fa54: 35 e3 ldi r19, 0x35 ; 53 2fa56: a3 2e mov r10, r19 2fa58: 36 e1 ldi r19, 0x16 ; 22 2fa5a: 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; 2fa5c: 91 2c mov r9, r1 2fa5e: 81 2c mov r8, r1 menu_progressbar_init(fileCnt * fileCnt / 2, _T(MSG_SORTING_FILES)); for (uint16_t i = 1; i < fileCnt; ++i){ 2fa60: cc 24 eor r12, r12 2fa62: c3 94 inc r12 2fa64: d1 2c mov r13, r1 // if (!IS_SD_INSERTED) return; menu_progressbar_update(counter); 2fa66: c4 01 movw r24, r8 2fa68: 0f 94 c9 cf call 0x39f92 ; 0x39f92 counter += i; 2fa6c: 8c 0c add r8, r12 2fa6e: 9d 1c adc r9, r13 /// pop the position const uint16_t o1 = sort_entries[i]; 2fa70: f5 01 movw r30, r10 2fa72: 01 90 ld r0, Z+ 2fa74: f0 81 ld r31, Z 2fa76: e0 2d mov r30, r0 2fa78: f9 af std Y+57, r31 ; 0x39 2fa7a: e8 af std Y+56, r30 ; 0x38 getfilename_simple(o1); 2fa7c: cf 01 movw r24, r30 2fa7e: 0f 94 85 79 call 0x2f30a ; 0x2f30a strcpy(name1, LONGEST_FILENAME); // save (or getfilename below will trounce it) 2fa82: 80 91 a7 14 lds r24, 0x14A7 ; 0x8014a7 2fa86: 62 e9 ldi r22, 0x92 ; 146 2fa88: 74 e1 ldi r23, 0x14 ; 20 2fa8a: 88 23 and r24, r24 2fa8c: 11 f0 breq .+4 ; 0x2fa92 2fa8e: 67 ea ldi r22, 0xA7 ; 167 2fa90: 74 e1 ldi r23, 0x14 ; 20 2fa92: ce 01 movw r24, r28 2fa94: 01 96 adiw r24, 0x01 ; 1 2fa96: 0f 94 87 e2 call 0x3c50e ; 0x3c50e crmod_date_bckp = crmodDate; 2fa9a: 60 90 a1 14 lds r6, 0x14A1 ; 0x8014a1 2fa9e: 70 90 a2 14 lds r7, 0x14A2 ; 0x8014a2 crmod_time_bckp = crmodTime; 2faa2: 20 91 9f 14 lds r18, 0x149F ; 0x80149f 2faa6: 30 91 a0 14 lds r19, 0x14A0 ; 0x8014a0 2faaa: 3b af std Y+59, r19 ; 0x3b 2faac: 2a af std Y+58, r18 ; 0x3a #if HAS_FOLDER_SORTING bool dir1 = filenameIsDir; 2faae: 20 90 dc 14 lds r2, 0x14DC ; 0x8014dc 2fab2: bf aa std Y+55, r11 ; 0x37 2fab4: ae aa std Y+54, r10 ; 0x36 2fab6: 86 01 movw r16, r12 #endif /// find proper place uint16_t j = i; for (; j > 0; --j){ if (!IS_SD_INSERTED) return; 2fab8: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2fabc: 80 fd sbrc r24, 0 2fabe: 47 c0 rjmp .+142 ; 0x2fb4e printf_P(PSTR("%2u "), sort_entries[z]); } MYSERIAL.println(); #endif manage_heater(); 2fac0: 0f 94 5c 38 call 0x270b8 ; 0x270b8 const uint16_t o2 = sort_entries[j - 1]; 2fac4: c8 01 movw r24, r16 2fac6: 01 97 sbiw r24, 0x01 ; 1 2fac8: 9d af std Y+61, r25 ; 0x3d 2faca: 8c af std Y+60, r24 ; 0x3c 2facc: ee a9 ldd r30, Y+54 ; 0x36 2face: ff a9 ldd r31, Y+55 ; 0x37 2fad0: 52 90 ld r5, -Z 2fad2: 42 90 ld r4, -Z 2fad4: ff ab std Y+55, r31 ; 0x37 2fad6: ee ab std Y+54, r30 ; 0x36 getfilename_simple(o2); 2fad8: c2 01 movw r24, r4 2fada: 0f 94 85 79 call 0x2f30a ; 0x2f30a char *name2 = LONGEST_FILENAME; // use the string in-place 2fade: 80 91 a7 14 lds r24, 0x14A7 ; 0x8014a7 2fae2: 62 e9 ldi r22, 0x92 ; 146 2fae4: 74 e1 ldi r23, 0x14 ; 20 2fae6: 88 23 and r24, r24 2fae8: 11 f0 breq .+4 ; 0x2faee 2faea: 67 ea ldi r22, 0xA7 ; 167 2faec: 74 e1 ldi r23, 0x14 ; 20 // Sort the current pair according to settings. if ( 2faee: 31 10 cpse r3, r1 2faf0: 8a c0 rjmp .+276 ; 0x2fc06 2faf2: 80 91 dc 14 lds r24, 0x14DC ; 0x8014dc 2faf6: 28 12 cpse r2, r24 2faf8: 83 c0 rjmp .+262 ; 0x2fc00 #if HAS_FOLDER_SORTING (sdSort == SD_SORT_TIME && _SORT_CMP_TIME_DIR(FOLDER_SORTING)) || (sdSort == SD_SORT_ALPHA && !_SORT_CMP_DIR(FOLDER_SORTING)) 2fafa: 80 91 a1 14 lds r24, 0x14A1 ; 0x8014a1 2fafe: 90 91 a2 14 lds r25, 0x14A2 ; 0x8014a2 2fb02: 68 16 cp r6, r24 2fb04: 79 06 cpc r7, r25 2fb06: 09 f0 breq .+2 ; 0x2fb0a 2fb08: 6c c0 rjmp .+216 ; 0x2fbe2 2fb0a: 80 91 9f 14 lds r24, 0x149F ; 0x80149f 2fb0e: 90 91 a0 14 lds r25, 0x14A0 ; 0x8014a0 2fb12: 2a ad ldd r18, Y+58 ; 0x3a 2fb14: 3b ad ldd r19, Y+59 ; 0x3b 2fb16: 82 17 cp r24, r18 2fb18: 93 07 cpc r25, r19 2fb1a: 08 f0 brcs .+2 ; 0x2fb1e 2fb1c: 66 c0 rjmp .+204 ; 0x2fbea #endif sort_entries[j] = o2; } } /// place the position sort_entries[j] = o1; 2fb1e: 00 0f add r16, r16 2fb20: 11 1f adc r17, r17 2fb22: f8 01 movw r30, r16 2fb24: ed 5c subi r30, 0xCD ; 205 2fb26: f9 4e sbci r31, 0xE9 ; 233 2fb28: 28 ad ldd r18, Y+56 ; 0x38 2fb2a: 39 ad ldd r19, Y+57 ; 0x39 2fb2c: 31 83 std Z+1, r19 ; 0x01 2fb2e: 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){ 2fb30: 3f ef ldi r19, 0xFF ; 255 2fb32: c3 1a sub r12, r19 2fb34: d3 0a sbc r13, r19 2fb36: 82 e0 ldi r24, 0x02 ; 2 2fb38: a8 0e add r10, r24 2fb3a: b1 1c adc r11, r1 2fb3c: ec 14 cp r14, r12 2fb3e: fd 04 cpc r15, r13 2fb40: 09 f0 breq .+2 ; 0x2fb44 2fb42: 91 cf rjmp .-222 ; 0x2fa66 for (uint16_t z = 0; z < fileCnt; z++) printf_P(PSTR("%2u "), sort_entries[z]); SERIAL_PROTOCOLLN(); #endif menu_progressbar_finish(); 2fb44: 0f 94 ea cf call 0x39fd4 ; 0x39fd4 } } KEEPALIVE_STATE(NOT_BUSY); 2fb48: 81 e0 ldi r24, 0x01 ; 1 2fb4a: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be } 2fb4e: ed 96 adiw r28, 0x3d ; 61 2fb50: 0f b6 in r0, 0x3f ; 63 2fb52: f8 94 cli 2fb54: de bf out 0x3e, r29 ; 62 2fb56: 0f be out 0x3f, r0 ; 63 2fb58: cd bf out 0x3d, r28 ; 61 2fb5a: df 91 pop r29 2fb5c: cf 91 pop r28 2fb5e: 1f 91 pop r17 2fb60: 0f 91 pop r16 2fb62: ff 90 pop r15 2fb64: ef 90 pop r14 2fb66: df 90 pop r13 2fb68: cf 90 pop r12 2fb6a: bf 90 pop r11 2fb6c: af 90 pop r10 2fb6e: 9f 90 pop r9 2fb70: 8f 90 pop r8 2fb72: 7f 90 pop r7 2fb74: 6f 90 pop r6 2fb76: 5f 90 pop r5 2fb78: 4f 90 pop r4 2fb7a: 3f 90 pop r3 2fb7c: 2f 90 pop r2 2fb7e: 08 95 ret if (!IS_SD_INSERTED) return; manage_heater(); if (i == 0) getfilename(0); else getfilename_next(position); 2fb80: 40 91 a3 14 lds r20, 0x14A3 ; 0x8014a3 2fb84: 50 91 a4 14 lds r21, 0x14A4 ; 0x8014a4 2fb88: 60 91 a5 14 lds r22, 0x14A5 ; 0x8014a5 2fb8c: 70 91 a6 14 lds r23, 0x14A6 ; 0x8014a6 lsDive("", *curDir, match, LS_GetFilename); } void CardReader::getfilename_next(uint32_t position, const char * const match/*=NULL*/) { curDir = &workDir; 2fb90: b0 92 3a 15 sts 0x153A, r11 ; 0x80153a 2fb94: a0 92 39 15 sts 0x1539, r10 ; 0x801539 nrFiles = 1; 2fb98: 90 92 a9 17 sts 0x17A9, r9 ; 0x8017a9 2fb9c: 80 92 a8 17 sts 0x17A8, r8 ; 0x8017a8 curDir->seekSet(position); 2fba0: 8b e3 ldi r24, 0x3B ; 59 2fba2: 95 e1 ldi r25, 0x15 ; 21 2fba4: 0f 94 92 56 call 0x2ad24 ; 0x2ad24 2fba8: 1e 7f andi r17, 0xFE ; 254 2fbaa: 1d 7f andi r17, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 2fbac: e0 91 39 15 lds r30, 0x1539 ; 0x801539 2fbb0: f0 91 3a 15 lds r31, 0x153A ; 0x80153a 2fbb4: 83 e2 ldi r24, 0x23 ; 35 2fbb6: de 01 movw r26, r28 2fbb8: 11 96 adiw r26, 0x01 ; 1 2fbba: 01 90 ld r0, Z+ 2fbbc: 0d 92 st X+, r0 2fbbe: 8a 95 dec r24 2fbc0: e1 f7 brne .-8 ; 0x2fbba 2fbc2: 01 2f mov r16, r17 2fbc4: 22 e0 ldi r18, 0x02 ; 2 2fbc6: 50 e0 ldi r21, 0x00 ; 0 2fbc8: 40 e0 ldi r20, 0x00 ; 0 2fbca: be 01 movw r22, r28 2fbcc: 6f 5f subi r22, 0xFF ; 255 2fbce: 7f 4f sbci r23, 0xFF ; 255 2fbd0: 88 ef ldi r24, 0xF8 ; 248 2fbd2: 92 e0 ldi r25, 0x02 ; 2 2fbd4: 0f 94 0f 77 call 0x2ee1e ; 0x2ee1e 2fbd8: ce 01 movw r24, r28 2fbda: 01 96 adiw r24, 0x01 ; 1 2fbdc: 0e 94 31 77 call 0xee62 ; 0xee62 2fbe0: 03 cf rjmp .-506 ; 0x2f9e8 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)) 2fbe2: 86 15 cp r24, r6 2fbe4: 97 05 cpc r25, r7 2fbe6: 08 f4 brcc .+2 ; 0x2fbea 2fbe8: 9a cf rjmp .-204 ; 0x2fb1e break; } else { #ifdef SORTING_DUMP puts_P(PSTR("shift")); #endif sort_entries[j] = o2; 2fbea: ee a9 ldd r30, Y+54 ; 0x36 2fbec: ff a9 ldd r31, Y+55 ; 0x37 2fbee: 53 82 std Z+3, r5 ; 0x03 2fbf0: 42 82 std Z+2, r4 ; 0x02 2fbf2: 0c ad ldd r16, Y+60 ; 0x3c 2fbf4: 1d ad ldd r17, Y+61 ; 0x3d bool dir1 = filenameIsDir; #endif /// find proper place uint16_t j = i; for (; j > 0; --j){ 2fbf6: 01 15 cp r16, r1 2fbf8: 11 05 cpc r17, r1 2fbfa: 09 f0 breq .+2 ; 0x2fbfe 2fbfc: 5d cf rjmp .-326 ; 0x2fab8 2fbfe: 8f cf rjmp .-226 ; 0x2fb1e 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)) 2fc00: 22 20 and r2, r2 2fc02: 99 f3 breq .-26 ; 0x2fbea 2fc04: 8c cf rjmp .-232 ; 0x2fb1e 2fc06: 31 e0 ldi r19, 0x01 ; 1 2fc08: 33 12 cpse r3, r19 2fc0a: ef cf rjmp .-34 ; 0x2fbea getfilename_simple(o2); char *name2 = LONGEST_FILENAME; // use the string in-place // Sort the current pair according to settings. if ( 2fc0c: 80 91 dc 14 lds r24, 0x14DC ; 0x8014dc 2fc10: 28 12 cpse r2, r24 2fc12: 07 c0 rjmp .+14 ; 0x2fc22 #if HAS_FOLDER_SORTING (sdSort == SD_SORT_TIME && _SORT_CMP_TIME_DIR(FOLDER_SORTING)) || (sdSort == SD_SORT_ALPHA && !_SORT_CMP_DIR(FOLDER_SORTING)) 2fc14: ce 01 movw r24, r28 2fc16: 01 96 adiw r24, 0x01 ; 1 2fc18: 0f 94 55 e2 call 0x3c4aa ; 0x3c4aa 2fc1c: 97 fd sbrc r25, 7 2fc1e: e5 cf rjmp .-54 ; 0x2fbea 2fc20: 7e cf rjmp .-260 ; 0x2fb1e 2fc22: 21 10 cpse r2, r1 2fc24: e2 cf rjmp .-60 ; 0x2fbea 2fc26: 7b cf rjmp .-266 ; 0x2fb1e 0002fc28 : lsDive("",*curDir, NULL, LS_Count); //SERIAL_ECHOLN(nrFiles); return nrFiles; } bool CardReader::chdir(const char * relpath, bool doPresort) 2fc28: cf 92 push r12 2fc2a: df 92 push r13 2fc2c: ef 92 push r14 2fc2e: ff 92 push r15 2fc30: 0f 93 push r16 2fc32: 1f 93 push r17 2fc34: cf 93 push r28 2fc36: df 93 push r29 2fc38: cd b7 in r28, 0x3d ; 61 2fc3a: de b7 in r29, 0x3e ; 62 2fc3c: a3 97 sbiw r28, 0x23 ; 35 2fc3e: 0f b6 in r0, 0x3f ; 63 2fc40: f8 94 cli 2fc42: de bf out 0x3e, r29 ; 62 2fc44: 0f be out 0x3f, r0 ; 63 2fc46: cd bf out 0x3d, r28 ; 61 2fc48: 7c 01 movw r14, r24 2fc4a: 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) {} 2fc4c: 19 82 std Y+1, r1 ; 0x01 2fc4e: 1c 82 std Y+4, r1 ; 0x04 { SdFile newfile; SdFile *parent=&root; if(workDir.isOpen()) 2fc50: 80 91 3e 15 lds r24, 0x153E ; 0x80153e parent=&workDir; 2fc54: 9b e3 ldi r25, 0x3B ; 59 2fc56: c9 2e mov r12, r25 2fc58: 95 e1 ldi r25, 0x15 ; 21 2fc5a: d9 2e mov r13, r25 bool CardReader::chdir(const char * relpath, bool doPresort) { SdFile newfile; SdFile *parent=&root; if(workDir.isOpen()) 2fc5c: 81 11 cpse r24, r1 2fc5e: 04 c0 rjmp .+8 ; 0x2fc68 } bool CardReader::chdir(const char * relpath, bool doPresort) { SdFile newfile; SdFile *parent=&root; 2fc60: 86 e1 ldi r24, 0x16 ; 22 2fc62: c8 2e mov r12, r24 2fc64: 85 e1 ldi r24, 0x15 ; 21 2fc66: 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); 2fc68: 21 e0 ldi r18, 0x01 ; 1 2fc6a: a7 01 movw r20, r14 2fc6c: b6 01 movw r22, r12 2fc6e: ce 01 movw r24, r28 2fc70: 01 96 adiw r24, 0x01 ; 1 2fc72: 0f 94 18 64 call 0x2c830 ; 0x2c830 2fc76: 18 2f mov r17, r24 if(workDir.isOpen()) parent=&workDir; if(!newfile.open(*parent,relpath, O_READ) || ((workDirDepth + 1) >= MAX_DIR_DEPTH)) 2fc78: 88 23 and r24, r24 2fc7a: 21 f1 breq .+72 ; 0x2fcc4 2fc7c: 80 91 30 16 lds r24, 0x1630 ; 0x801630 2fc80: 85 30 cpi r24, 0x05 ; 5 2fc82: 00 f5 brcc .+64 ; 0x2fcc4 SERIAL_ECHOLN(relpath); return 0; } else { strcpy(dir_names[workDirDepth], relpath); 2fc84: 29 e0 ldi r18, 0x09 ; 9 2fc86: 82 9f mul r24, r18 2fc88: c0 01 movw r24, r0 2fc8a: 11 24 eor r1, r1 2fc8c: b7 01 movw r22, r14 2fc8e: 80 52 subi r24, 0x20 ; 32 2fc90: 9b 4e sbci r25, 0xEB ; 235 2fc92: 0f 94 87 e2 call 0x3c50e ; 0x3c50e puts(relpath); 2fc96: c7 01 movw r24, r14 2fc98: 0f 94 ab e2 call 0x3c556 ; 0x3c556 if (workDirDepth < MAX_DIR_DEPTH) { 2fc9c: 80 91 30 16 lds r24, 0x1630 ; 0x801630 2fca0: 86 30 cpi r24, 0x06 ; 6 2fca2: 80 f1 brcs .+96 ; 0x2fd04 for (uint8_t d = ++workDirDepth; d--;) workDirParents[d+1] = workDirParents[d]; workDirParents[0]=*parent; } workDir=newfile; 2fca4: 83 e2 ldi r24, 0x23 ; 35 2fca6: fe 01 movw r30, r28 2fca8: 31 96 adiw r30, 0x01 ; 1 2fcaa: ab e3 ldi r26, 0x3B ; 59 2fcac: b5 e1 ldi r27, 0x15 ; 21 2fcae: 01 90 ld r0, Z+ 2fcb0: 0d 92 st X+, r0 2fcb2: 8a 95 dec r24 2fcb4: e1 f7 brne .-8 ; 0x2fcae #ifdef SDCARD_SORT_ALPHA if (doPresort) 2fcb6: 00 23 and r16, r16 2fcb8: 09 f4 brne .+2 ; 0x2fcbc 2fcba: 4c c0 rjmp .+152 ; 0x2fd54 presort(); 2fcbc: 0f 94 92 7c call 0x2f924 ; 0x2f924 else presort_flag = true; #endif return 1; 2fcc0: 10 2f mov r17, r16 2fcc2: 0c c0 rjmp .+24 ; 0x2fcdc if(workDir.isOpen()) parent=&workDir; if(!newfile.open(*parent,relpath, O_READ) || ((workDirDepth + 1) >= MAX_DIR_DEPTH)) { SERIAL_ECHO_START; 2fcc4: 82 ec ldi r24, 0xC2 ; 194 2fcc6: 9b ea ldi r25, 0xAB ; 171 2fcc8: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHORPGM(_n("Cannot enter subdir: "));////MSG_SD_CANT_ENTER_SUBDIR 2fccc: 85 ed ldi r24, 0xD5 ; 213 2fcce: 90 e7 ldi r25, 0x70 ; 112 2fcd0: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHOLN(relpath); 2fcd4: c7 01 movw r24, r14 2fcd6: 0f 94 00 d6 call 0x3ac00 ; 0x3ac00 return 0; 2fcda: 10 e0 ldi r17, 0x00 ; 0 2fcdc: ce 01 movw r24, r28 2fcde: 01 96 adiw r24, 0x01 ; 1 2fce0: 0e 94 31 77 call 0xee62 ; 0xee62 else presort_flag = true; #endif return 1; } } 2fce4: 81 2f mov r24, r17 2fce6: a3 96 adiw r28, 0x23 ; 35 2fce8: 0f b6 in r0, 0x3f ; 63 2fcea: f8 94 cli 2fcec: de bf out 0x3e, r29 ; 62 2fcee: 0f be out 0x3f, r0 ; 63 2fcf0: cd bf out 0x3d, r28 ; 61 2fcf2: df 91 pop r29 2fcf4: cf 91 pop r28 2fcf6: 1f 91 pop r17 2fcf8: 0f 91 pop r16 2fcfa: ff 90 pop r15 2fcfc: ef 90 pop r14 2fcfe: df 90 pop r13 2fd00: cf 90 pop r12 2fd02: 08 95 ret { strcpy(dir_names[workDirDepth], relpath); puts(relpath); if (workDirDepth < MAX_DIR_DEPTH) { for (uint8_t d = ++workDirDepth; d--;) 2fd04: 8f 5f subi r24, 0xFF ; 255 2fd06: 80 93 30 16 sts 0x1630, r24 ; 0x801630 workDirParents[d+1] = workDirParents[d]; 2fd0a: 93 e2 ldi r25, 0x23 ; 35 { strcpy(dir_names[workDirDepth], relpath); puts(relpath); if (workDirDepth < MAX_DIR_DEPTH) { for (uint8_t d = ++workDirDepth; d--;) 2fd0c: 81 50 subi r24, 0x01 ; 1 2fd0e: c8 f0 brcs .+50 ; 0x2fd42 workDirParents[d+1] = workDirParents[d]; 2fd10: 28 2f mov r18, r24 2fd12: 30 e0 ldi r19, 0x00 ; 0 2fd14: a9 01 movw r20, r18 2fd16: 4f 5f subi r20, 0xFF ; 255 2fd18: 5f 4f sbci r21, 0xFF ; 255 2fd1a: 94 9f mul r25, r20 2fd1c: d0 01 movw r26, r0 2fd1e: 95 9f mul r25, r21 2fd20: b0 0d add r27, r0 2fd22: 11 24 eor r1, r1 2fd24: a2 5a subi r26, 0xA2 ; 162 2fd26: ba 4e sbci r27, 0xEA ; 234 2fd28: 92 9f mul r25, r18 2fd2a: f0 01 movw r30, r0 2fd2c: 93 9f mul r25, r19 2fd2e: f0 0d add r31, r0 2fd30: 11 24 eor r1, r1 2fd32: e2 5a subi r30, 0xA2 ; 162 2fd34: fa 4e sbci r31, 0xEA ; 234 2fd36: 29 2f mov r18, r25 2fd38: 01 90 ld r0, Z+ 2fd3a: 0d 92 st X+, r0 2fd3c: 2a 95 dec r18 2fd3e: e1 f7 brne .-8 ; 0x2fd38 2fd40: e5 cf rjmp .-54 ; 0x2fd0c workDirParents[0]=*parent; 2fd42: 83 e2 ldi r24, 0x23 ; 35 2fd44: f6 01 movw r30, r12 2fd46: ae e5 ldi r26, 0x5E ; 94 2fd48: b5 e1 ldi r27, 0x15 ; 21 2fd4a: 01 90 ld r0, Z+ 2fd4c: 0d 92 st X+, r0 2fd4e: 8a 95 dec r24 2fd50: e1 f7 brne .-8 ; 0x2fd4a 2fd52: a8 cf rjmp .-176 ; 0x2fca4 #ifdef SDCARD_SORT_ALPHA if (doPresort) presort(); else presort_flag = true; 2fd54: 81 e0 ldi r24, 0x01 ; 1 2fd56: 80 93 df 14 sts 0x14DF, r24 ; 0x8014df 2fd5a: c0 cf rjmp .-128 ; 0x2fcdc 0002fd5c : } } void __attribute__((noinline)) CardReader::cdroot(bool doPresort) { workDir=root; 2fd5c: 93 e2 ldi r25, 0x23 ; 35 2fd5e: e6 e1 ldi r30, 0x16 ; 22 2fd60: f5 e1 ldi r31, 0x15 ; 21 2fd62: ab e3 ldi r26, 0x3B ; 59 2fd64: b5 e1 ldi r27, 0x15 ; 21 2fd66: 01 90 ld r0, Z+ 2fd68: 0d 92 st X+, r0 2fd6a: 9a 95 dec r25 2fd6c: e1 f7 brne .-8 ; 0x2fd66 workDirDepth = 0; 2fd6e: 10 92 30 16 sts 0x1630, r1 ; 0x801630 curDir=&workDir; 2fd72: 2b e3 ldi r18, 0x3B ; 59 2fd74: 35 e1 ldi r19, 0x15 ; 21 2fd76: 30 93 3a 15 sts 0x153A, r19 ; 0x80153a 2fd7a: 20 93 39 15 sts 0x1539, r18 ; 0x801539 #ifdef SDCARD_SORT_ALPHA if (doPresort) 2fd7e: 81 11 cpse r24, r1 presort(); 2fd80: 0d 94 92 7c jmp 0x2f924 ; 0x2f924 else presort_flag = true; 2fd84: 81 e0 ldi r24, 0x01 ; 1 2fd86: 80 93 df 14 sts 0x14DF, r24 ; 0x8014df #endif } 2fd8a: 08 95 ret 0002fd8c : * * @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) 2fd8c: 8f 92 push r8 2fd8e: 9f 92 push r9 2fd90: af 92 push r10 2fd92: bf 92 push r11 2fd94: cf 92 push r12 2fd96: df 92 push r13 2fd98: ef 92 push r14 2fd9a: ff 92 push r15 2fd9c: 0f 93 push r16 2fd9e: 1f 93 push r17 2fda0: cf 93 push r28 2fda2: df 93 push r29 2fda4: cd b7 in r28, 0x3d ; 61 2fda6: de b7 in r29, 0x3e ; 62 2fda8: 2d 97 sbiw r28, 0x0d ; 13 2fdaa: 0f b6 in r0, 0x3f ; 63 2fdac: f8 94 cli 2fdae: de bf out 0x3e, r29 ; 62 2fdb0: 0f be out 0x3f, r0 ; 63 2fdb2: cd bf out 0x3d, r28 ; 61 { curDir=&root; 2fdb4: 26 e1 ldi r18, 0x16 ; 22 2fdb6: 35 e1 ldi r19, 0x15 ; 21 2fdb8: 30 93 3a 15 sts 0x153A, r19 ; 0x80153a 2fdbc: 20 93 39 15 sts 0x1539, r18 ; 0x801539 if (!fileName) 2fdc0: dc 01 movw r26, r24 2fdc2: ed 91 ld r30, X+ 2fdc4: fc 91 ld r31, X 2fdc6: 30 97 sbiw r30, 0x00 ; 0 2fdc8: a1 f4 brne .+40 ; 0x2fdf2 } else //relative path { curDir = &workDir; } return 1; 2fdca: 81 e0 ldi r24, 0x01 ; 1 } 2fdcc: 2d 96 adiw r28, 0x0d ; 13 2fdce: 0f b6 in r0, 0x3f ; 63 2fdd0: f8 94 cli 2fdd2: de bf out 0x3e, r29 ; 62 2fdd4: 0f be out 0x3f, r0 ; 63 2fdd6: cd bf out 0x3d, r28 ; 61 2fdd8: df 91 pop r29 2fdda: cf 91 pop r28 2fddc: 1f 91 pop r17 2fdde: 0f 91 pop r16 2fde0: ff 90 pop r15 2fde2: ef 90 pop r14 2fde4: df 90 pop r13 2fde6: cf 90 pop r12 2fde8: bf 90 pop r11 2fdea: af 90 pop r10 2fdec: 9f 90 pop r9 2fdee: 8f 90 pop r8 2fdf0: 08 95 ret curDir=&root; if (!fileName) return 1; const char *dirname_start, *dirname_end; if (fileName[0] == '/') // absolute path 2fdf2: 20 81 ld r18, Z 2fdf4: 2f 32 cpi r18, 0x2F ; 47 2fdf6: 09 f0 breq .+2 ; 0x2fdfa 2fdf8: 47 c0 rjmp .+142 ; 0x2fe88 2fdfa: 6c 01 movw r12, r24 { cdroot(false); 2fdfc: 80 e0 ldi r24, 0x00 ; 0 2fdfe: 0f 94 ae 7e call 0x2fd5c ; 0x2fd5c dirname_start = fileName + 1; 2fe02: f6 01 movw r30, r12 2fe04: 00 81 ld r16, Z 2fe06: 11 81 ldd r17, Z+1 ; 0x01 2fe08: 0f 5f subi r16, 0xFF ; 255 2fe0a: 1f 4f sbci r17, 0xFF ; 255 strncpy(subdirname, dirname_start, len); subdirname[len] = 0; if (!chdir(subdirname, false)) return 0; curDir = &workDir; 2fe0c: 9b e3 ldi r25, 0x3B ; 59 2fe0e: 89 2e mov r8, r25 2fe10: 95 e1 ldi r25, 0x15 ; 21 2fe12: 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) 2fe14: d8 01 movw r26, r16 2fe16: 8c 91 ld r24, X 2fe18: 88 23 and r24, r24 2fe1a: b9 f2 breq .-82 ; 0x2fdca { dirname_end = strchr(dirname_start, '/'); 2fe1c: 6f e2 ldi r22, 0x2F ; 47 2fe1e: 70 e0 ldi r23, 0x00 ; 0 2fe20: c8 01 movw r24, r16 2fe22: 0f 94 73 e2 call 0x3c4e6 ; 0x3c4e6 2fe26: 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) 2fe28: 00 97 sbiw r24, 0x00 ; 0 2fe2a: 51 f1 breq .+84 ; 0x2fe80 2fe2c: 08 17 cp r16, r24 2fe2e: 19 07 cpc r17, r25 2fe30: 38 f5 brcc .+78 ; 0x2fe80 { 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); 2fe32: 7c 01 movw r14, r24 2fe34: e0 1a sub r14, r16 2fe36: f1 0a sbc r15, r17 2fe38: bd e0 ldi r27, 0x0D ; 13 2fe3a: eb 16 cp r14, r27 2fe3c: f1 04 cpc r15, r1 2fe3e: 18 f0 brcs .+6 ; 0x2fe46 2fe40: 8c e0 ldi r24, 0x0C ; 12 2fe42: e8 2e mov r14, r24 2fe44: f1 2c mov r15, r1 strncpy(subdirname, dirname_start, len); 2fe46: a7 01 movw r20, r14 2fe48: b8 01 movw r22, r16 2fe4a: ce 01 movw r24, r28 2fe4c: 01 96 adiw r24, 0x01 ; 1 2fe4e: 0f 94 9c e2 call 0x3c538 ; 0x3c538 subdirname[len] = 0; 2fe52: e1 e0 ldi r30, 0x01 ; 1 2fe54: f0 e0 ldi r31, 0x00 ; 0 2fe56: ec 0f add r30, r28 2fe58: fd 1f adc r31, r29 2fe5a: ee 0d add r30, r14 2fe5c: ff 1d adc r31, r15 2fe5e: 10 82 st Z, r1 if (!chdir(subdirname, false)) 2fe60: 60 e0 ldi r22, 0x00 ; 0 2fe62: ce 01 movw r24, r28 2fe64: 01 96 adiw r24, 0x01 ; 1 2fe66: 0f 94 14 7e call 0x2fc28 ; 0x2fc28 2fe6a: 88 23 and r24, r24 2fe6c: 09 f4 brne .+2 ; 0x2fe70 2fe6e: ae cf rjmp .-164 ; 0x2fdcc return 0; curDir = &workDir; 2fe70: 90 92 3a 15 sts 0x153A, r9 ; 0x80153a 2fe74: 80 92 39 15 sts 0x1539, r8 ; 0x801539 dirname_start = dirname_end + 1; 2fe78: 85 01 movw r16, r10 2fe7a: 0f 5f subi r16, 0xFF ; 255 2fe7c: 1f 4f sbci r17, 0xFF ; 255 2fe7e: ca cf rjmp .-108 ; 0x2fe14 } else // the reminder after all /fsa/fdsa/ is the filename { fileName = dirname_start; 2fe80: f6 01 movw r30, r12 2fe82: 11 83 std Z+1, r17 ; 0x01 2fe84: 00 83 st Z, r16 2fe86: a1 cf rjmp .-190 ; 0x2fdca } } else //relative path { curDir = &workDir; 2fe88: 8b e3 ldi r24, 0x3B ; 59 2fe8a: 95 e1 ldi r25, 0x15 ; 21 2fe8c: 90 93 3a 15 sts 0x153A, r25 ; 0x80153a 2fe90: 80 93 39 15 sts 0x1539, r24 ; 0x801539 2fe94: 9a cf rjmp .-204 ; 0x2fdca 0002fe96 : 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*/){ 2fe96: bf 92 push r11 2fe98: cf 92 push r12 2fe9a: df 92 push r13 2fe9c: ef 92 push r14 2fe9e: ff 92 push r15 2fea0: 0f 93 push r16 2fea2: 1f 93 push r17 2fea4: cf 93 push r28 2fea6: df 93 push r29 2fea8: 1f 92 push r1 2feaa: 1f 92 push r1 2feac: cd b7 in r28, 0x3d ; 61 2feae: de b7 in r29, 0x3e ; 62 if(!mounted) 2feb0: 20 91 91 14 lds r18, 0x1491 ; 0x801491 2feb4: 22 23 and r18, r18 2feb6: 09 f4 brne .+2 ; 0x2feba 2feb8: ef c0 rjmp .+478 ; 0x30098 2feba: 7c 01 movw r14, r24 return; if(file.isOpen()){ //replacing current file by new file, or subfile call 2febc: 80 91 23 17 lds r24, 0x1723 ; 0x801723 2fec0: 88 23 and r24, r24 2fec2: 09 f4 brne .+2 ; 0x2fec6 2fec4: 04 c1 rjmp .+520 ; 0x300ce if(!replace_current){ 2fec6: 61 11 cpse r22, r1 2fec8: f6 c0 rjmp .+492 ; 0x300b6 if((int)file_subcall_ctr>(int)SD_PROCEDURE_DEPTH-1){ 2feca: d0 90 43 17 lds r13, 0x1743 ; 0x801743 2fece: dd 20 and r13, r13 2fed0: 21 f0 breq .+8 ; 0x2feda // 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); 2fed2: 8c e9 ldi r24, 0x9C ; 156 2fed4: 9a ea ldi r25, 0xAA ; 170 2fed6: 0e 94 0a 7a call 0xf414 ; 0xf414 return; } SERIAL_ECHO_START; 2feda: 82 ec ldi r24, 0xC2 ; 194 2fedc: 9b ea ldi r25, 0xAB ; 171 2fede: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHORPGM(ofSubroutineCallTgt); 2fee2: 83 e8 ldi r24, 0x83 ; 131 2fee4: 9a ea ldi r25, 0xAA ; 170 2fee6: 0e 94 50 77 call 0xeea0 ; 0xeea0 2feea: c7 01 movw r24, r14 2feec: 0e 94 14 88 call 0x11028 ; 0x11028 SERIAL_ECHO(name); SERIAL_ECHORPGM(ofParent); 2fef0: 88 e7 ldi r24, 0x78 ; 120 2fef2: 9a ea ldi r25, 0xAA ; 170 2fef4: 0e 94 50 77 call 0xeea0 ; 0xeea0 //store current filename and position getAbsFilename(filenames[file_subcall_ctr]); 2fef8: 00 91 43 17 lds r16, 0x1743 ; 0x801743 2fefc: 25 e5 ldi r18, 0x55 ; 85 2fefe: 02 9f mul r16, r18 2ff00: 80 01 movw r16, r0 2ff02: 11 24 eor r1, r1 } void CardReader::getAbsFilename(char *t) { uint8_t cnt=0; *t='/';t++;cnt++; 2ff04: 08 5b subi r16, 0xB8 ; 184 2ff06: 18 4e sbci r17, 0xE8 ; 232 2ff08: 8f e2 ldi r24, 0x2F ; 47 2ff0a: f8 01 movw r30, r16 2ff0c: 81 93 st Z+, r24 2ff0e: 8f 01 movw r16, r30 2ff10: cc 24 eor r12, r12 2ff12: c3 94 inc r12 for(uint8_t i=0;i 2ff1c: d8 16 cp r13, r24 2ff1e: b0 f4 brcc .+44 ; 0x2ff4c { workDirParents[i].getFilename(t); //SDBaseFile.getfilename! 2ff20: db 9c mul r13, r11 2ff22: c0 01 movw r24, r0 2ff24: 11 24 eor r1, r1 2ff26: b8 01 movw r22, r16 2ff28: 82 5a subi r24, 0xA2 ; 162 2ff2a: 9a 4e sbci r25, 0xEA ; 234 2ff2c: 0f 94 79 58 call 0x2b0f2 ; 0x2b0f2 2ff30: c8 01 movw r24, r16 2ff32: 8c 01 movw r16, r24 2ff34: 01 96 adiw r24, 0x01 ; 1 while(*t!=0 && cnt< MAXPATHNAMELENGTH) 2ff36: f8 01 movw r30, r16 2ff38: 20 81 ld r18, Z 2ff3a: 22 23 and r18, r18 2ff3c: 29 f0 breq .+10 ; 0x2ff48 2ff3e: f4 e5 ldi r31, 0x54 ; 84 2ff40: fc 15 cp r31, r12 2ff42: 10 f0 brcs .+4 ; 0x2ff48 {t++;cnt++;} //crawl counter forward. 2ff44: c3 94 inc r12 2ff46: f5 cf rjmp .-22 ; 0x2ff32 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) 2ff4c: 27 e4 ldi r18, 0x47 ; 71 2ff4e: 2c 15 cp r18, r12 2ff50: 08 f4 brcc .+2 ; 0x2ff54 2ff52: ae c0 rjmp .+348 ; 0x300b0 file.getFilename(t); 2ff54: b8 01 movw r22, r16 2ff56: 80 e2 ldi r24, 0x20 ; 32 2ff58: 97 e1 ldi r25, 0x17 ; 23 2ff5a: 0f 94 79 58 call 0x2b0f2 ; 0x2b0f2 SERIAL_ECHORPGM(ofParent); //store current filename and position getAbsFilename(filenames[file_subcall_ctr]); SERIAL_ECHO(filenames[file_subcall_ctr]); 2ff5e: 80 91 43 17 lds r24, 0x1743 ; 0x801743 2ff62: f5 e5 ldi r31, 0x55 ; 85 2ff64: 8f 9f mul r24, r31 2ff66: c0 01 movw r24, r0 2ff68: 11 24 eor r1, r1 2ff6a: 88 5b subi r24, 0xB8 ; 184 2ff6c: 98 4e sbci r25, 0xE8 ; 232 2ff6e: 0e 94 14 88 call 0x11028 ; 0x11028 SERIAL_ECHORPGM(ofPos); 2ff72: 82 e7 ldi r24, 0x72 ; 114 2ff74: 9a ea ldi r25, 0xAA ; 170 2ff76: 0e 94 50 77 call 0xeea0 ; 0xeea0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 2ff7a: 60 91 a4 17 lds r22, 0x17A4 ; 0x8017a4 2ff7e: 70 91 a5 17 lds r23, 0x17A5 ; 0x8017a5 2ff82: 80 91 a6 17 lds r24, 0x17A6 ; 0x8017a6 2ff86: 90 91 a7 17 lds r25, 0x17A7 ; 0x8017a7 2ff8a: 4a e0 ldi r20, 0x0A ; 10 2ff8c: 0f 94 06 d5 call 0x3aa0c ; 0x3aa0c } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 2ff90: 0f 94 fd d5 call 0x3abfa ; 0x3abfa SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; 2ff94: 80 91 43 17 lds r24, 0x1743 ; 0x801743 2ff98: 24 e0 ldi r18, 0x04 ; 4 2ff9a: 82 9f mul r24, r18 2ff9c: f0 01 movw r30, r0 2ff9e: 11 24 eor r1, r1 2ffa0: ec 5b subi r30, 0xBC ; 188 2ffa2: f8 4e sbci r31, 0xE8 ; 232 2ffa4: 40 91 a4 17 lds r20, 0x17A4 ; 0x8017a4 2ffa8: 50 91 a5 17 lds r21, 0x17A5 ; 0x8017a5 2ffac: 60 91 a6 17 lds r22, 0x17A6 ; 0x8017a6 2ffb0: 70 91 a7 17 lds r23, 0x17A7 ; 0x8017a7 2ffb4: 40 83 st Z, r20 2ffb6: 51 83 std Z+1, r21 ; 0x01 2ffb8: 62 83 std Z+2, r22 ; 0x02 2ffba: 73 83 std Z+3, r23 ; 0x03 file_subcall_ctr++; 2ffbc: 8f 5f subi r24, 0xFF ; 255 2ffbe: 80 93 43 17 sts 0x1743, r24 ; 0x801743 } else { SERIAL_ECHO_START; SERIAL_ECHORPGM(ofNowDoingFile); SERIAL_ECHOLN(name); } file.close(); 2ffc2: 80 e2 ldi r24, 0x20 ; 32 2ffc4: 97 e1 ldi r25, 0x17 ; 23 2ffc6: 0f 94 70 58 call 0x2b0e0 ; 0x2b0e0 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; 2ffca: 10 92 90 14 sts 0x1490, r1 ; 0x801490 const char *fname=name; 2ffce: fa 82 std Y+2, r15 ; 0x02 2ffd0: e9 82 std Y+1, r14 ; 0x01 if (!diveSubfolder(fname)) 2ffd2: ce 01 movw r24, r28 2ffd4: 01 96 adiw r24, 0x01 ; 1 2ffd6: 0f 94 c6 7e call 0x2fd8c ; 0x2fd8c 2ffda: 88 23 and r24, r24 2ffdc: 09 f4 brne .+2 ; 0x2ffe0 2ffde: 5c c0 rjmp .+184 ; 0x30098 */ 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) ){ 2ffe0: 49 81 ldd r20, Y+1 ; 0x01 2ffe2: 5a 81 ldd r21, Y+2 ; 0x02 2ffe4: 60 91 39 15 lds r22, 0x1539 ; 0x801539 2ffe8: 70 91 3a 15 lds r23, 0x153A ; 0x80153a 2ffec: 21 e0 ldi r18, 0x01 ; 1 2ffee: 80 e2 ldi r24, 0x20 ; 32 2fff0: 97 e1 ldi r25, 0x17 ; 23 2fff2: 0f 94 18 64 call 0x2c830 ; 0x2c830 2fff6: 88 23 and r24, r24 2fff8: 09 f4 brne .+2 ; 0x2fffc 2fffa: 77 c0 rjmp .+238 ; 0x300ea // compute the block to start with if( ! gfComputeNextFileBlock() ) 2fffc: 80 e2 ldi r24, 0x20 ; 32 2fffe: 97 e1 ldi r25, 0x17 ; 23 30000: 0f 94 19 56 call 0x2ac32 ; 0x2ac32 30004: 88 23 and r24, r24 30006: 09 f4 brne .+2 ; 0x3000a 30008: 70 c0 rjmp .+224 ; 0x300ea 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; 3000a: 80 91 41 17 lds r24, 0x1741 ; 0x801741 3000e: 90 91 42 17 lds r25, 0x1742 ; 0x801742 30012: 83 56 subi r24, 0x63 ; 99 30014: 91 4f sbci r25, 0xF1 ; 241 30016: 90 93 3c 17 sts 0x173C, r25 ; 0x80173c 3001a: 80 93 3b 17 sts 0x173B, r24 ; 0x80173b return; if (file.openFilteredGcode(curDir, fname)) { getfilename(0, fname); 3001e: 89 81 ldd r24, Y+1 ; 0x01 30020: 9a 81 ldd r25, Y+2 ; 0x02 30022: 0f 94 3e 79 call 0x2f27c ; 0x2f27c filesize = file.fileSize(); 30026: 80 91 31 17 lds r24, 0x1731 ; 0x801731 3002a: 90 91 32 17 lds r25, 0x1732 ; 0x801732 3002e: a0 91 33 17 lds r26, 0x1733 ; 0x801733 30032: b0 91 34 17 lds r27, 0x1734 ; 0x801734 30036: 80 93 9d 17 sts 0x179D, r24 ; 0x80179d 3003a: 90 93 9e 17 sts 0x179E, r25 ; 0x80179e 3003e: a0 93 9f 17 sts 0x179F, r26 ; 0x80179f 30042: b0 93 a0 17 sts 0x17A0, r27 ; 0x8017a0 SERIAL_PROTOCOLRPGM(ofFileOpened);////MSG_SD_FILE_OPENED 30046: 82 e4 ldi r24, 0x42 ; 66 30048: 9a ea ldi r25, 0xAA ; 170 3004a: 0e 94 50 77 call 0xeea0 ; 0xeea0 printAbsFilenameFast(); 3004e: 0f 94 21 7a call 0x2f442 ; 0x2f442 SERIAL_PROTOCOLRPGM(ofSize);////MSG_SD_SIZE 30052: 8a e3 ldi r24, 0x3A ; 58 30054: 9a ea ldi r25, 0xAA ; 170 30056: 0e 94 50 77 call 0xeea0 ; 0xeea0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 3005a: 60 91 9d 17 lds r22, 0x179D ; 0x80179d 3005e: 70 91 9e 17 lds r23, 0x179E ; 0x80179e 30062: 80 91 9f 17 lds r24, 0x179F ; 0x80179f 30066: 90 91 a0 17 lds r25, 0x17A0 ; 0x8017a0 3006a: 4a e0 ldi r20, 0x0A ; 10 3006c: 0f 94 06 d5 call 0x3aa0c ; 0x3aa0c } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 30070: 0f 94 fd d5 call 0x3abfa ; 0x3abfa SERIAL_PROTOCOLLN(filesize); sdpos = 0; 30074: 10 92 a4 17 sts 0x17A4, r1 ; 0x8017a4 30078: 10 92 a5 17 sts 0x17A5, r1 ; 0x8017a5 3007c: 10 92 a6 17 sts 0x17A6, r1 ; 0x8017a6 30080: 10 92 a7 17 sts 0x17A7, r1 ; 0x8017a7 SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED 30084: 8c e2 ldi r24, 0x2C ; 44 30086: 9a ea ldi r25, 0xAA ; 170 30088: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 lcd_setstatuspgm(ofFileSelected); 3008c: 8c e2 ldi r24, 0x2C ; 44 3008e: 9a ea ldi r25, 0xAA ; 170 30090: 0e 94 5d f1 call 0x1e2ba ; 0x1e2ba scrollstuff = 0; 30094: 10 92 b9 0d sts 0x0DB9, r1 ; 0x800db9 } else { SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); SERIAL_PROTOCOL(fname); SERIAL_PROTOCOLLN('.'); } } 30098: 0f 90 pop r0 3009a: 0f 90 pop r0 3009c: df 91 pop r29 3009e: cf 91 pop r28 300a0: 1f 91 pop r17 300a2: 0f 91 pop r16 300a4: ff 90 pop r15 300a6: ef 90 pop r14 300a8: df 90 pop r13 300aa: cf 90 pop r12 300ac: bf 90 pop r11 300ae: 08 95 ret {t++;cnt++;} //crawl counter forward. } if(cnt < MAXPATHNAMELENGTH - FILENAME_LENGTH) file.getFilename(t); else t[0]=0; 300b0: f8 01 movw r30, r16 300b2: 10 82 st Z, r1 300b4: 54 cf rjmp .-344 ; 0x2ff5e SERIAL_ECHORPGM(ofPos); SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; file_subcall_ctr++; } else { SERIAL_ECHO_START; 300b6: 82 ec ldi r24, 0xC2 ; 194 300b8: 9b ea ldi r25, 0xAB ; 171 300ba: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHORPGM(ofNowDoingFile); 300be: 81 e6 ldi r24, 0x61 ; 97 300c0: 9a ea ldi r25, 0xAA ; 170 300c2: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHOLN(name); 300c6: c7 01 movw r24, r14 300c8: 0f 94 00 d6 call 0x3ac00 ; 0x3ac00 300cc: 7a cf rjmp .-268 ; 0x2ffc2 } file.close(); } else { //opening fresh file file_subcall_ctr=0; //resetting procedure depth in case user cancels print while in procedure 300ce: 10 92 43 17 sts 0x1743, r1 ; 0x801743 SERIAL_ECHO_START; 300d2: 82 ec ldi r24, 0xC2 ; 194 300d4: 9b ea ldi r25, 0xAB ; 171 300d6: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHORPGM(ofNowFreshFile); 300da: 80 e5 ldi r24, 0x50 ; 80 300dc: 9a ea ldi r25, 0xAA ; 170 300de: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHOLN(name); 300e2: c7 01 movw r24, r14 300e4: 0f 94 00 d6 call 0x3ac00 ; 0x3ac00 300e8: 70 cf rjmp .-288 ; 0x2ffca SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED lcd_setstatuspgm(ofFileSelected); scrollstuff = 0; } else { SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); 300ea: 81 ec ldi r24, 0xC1 ; 193 300ec: 90 e7 ldi r25, 0x70 ; 112 300ee: 0e 94 50 77 call 0xeea0 ; 0xeea0 300f2: 89 81 ldd r24, Y+1 ; 0x01 300f4: 9a 81 ldd r25, Y+2 ; 0x02 300f6: 0e 94 14 88 call 0x11028 ; 0x11028 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 300fa: 8e e2 ldi r24, 0x2E ; 46 300fc: 0e 94 37 77 call 0xee6e ; 0xee6e } void MarlinSerial::println(char c, int base) { print(c, base); println(); 30100: 0f 94 fd d5 call 0x3abfa ; 0x3abfa 30104: c9 cf rjmp .-110 ; 0x30098 00030106 : void CardReader::printingHasFinished() { st_synchronize(); 30106: 0f 94 e8 42 call 0x285d0 ; 0x285d0 file.close(); 3010a: 80 e2 ldi r24, 0x20 ; 32 3010c: 97 e1 ldi r25, 0x17 ; 23 3010e: 0f 94 70 58 call 0x2b0e0 ; 0x2b0e0 if(file_subcall_ctr>0) //heading up to a parent file that called current as a procedure. 30112: 80 91 43 17 lds r24, 0x1743 ; 0x801743 30116: 88 23 and r24, r24 30118: 69 f1 breq .+90 ; 0x30174 { file_subcall_ctr--; 3011a: 81 50 subi r24, 0x01 ; 1 3011c: 80 93 43 17 sts 0x1743, r24 ; 0x801743 openFileReadFilteredGcode(filenames[file_subcall_ctr],true); 30120: 25 e5 ldi r18, 0x55 ; 85 30122: 82 9f mul r24, r18 30124: c0 01 movw r24, r0 30126: 11 24 eor r1, r1 30128: 61 e0 ldi r22, 0x01 ; 1 3012a: 88 5b subi r24, 0xB8 ; 184 3012c: 98 4e sbci r25, 0xE8 ; 232 3012e: 0f 94 4b 7f call 0x2fe96 ; 0x2fe96 setIndex(filespos[file_subcall_ctr]); 30132: e0 91 43 17 lds r30, 0x1743 ; 0x801743 30136: 84 e0 ldi r24, 0x04 ; 4 30138: e8 9f mul r30, r24 3013a: f0 01 movw r30, r0 3013c: 11 24 eor r1, r1 3013e: ec 5b subi r30, 0xBC ; 188 30140: f8 4e sbci r31, 0xE8 ; 232 30142: 60 81 ld r22, Z 30144: 71 81 ldd r23, Z+1 ; 0x01 30146: 82 81 ldd r24, Z+2 ; 0x02 30148: 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);}; 3014a: 60 93 a4 17 sts 0x17A4, r22 ; 0x8017a4 3014e: 70 93 a5 17 sts 0x17A5, r23 ; 0x8017a5 30152: 80 93 a6 17 sts 0x17A6, r24 ; 0x8017a6 30156: 90 93 a7 17 sts 0x17A7, r25 ; 0x8017a7 3015a: 0f 94 9c 75 call 0x2eb38 ; 0x2eb38 SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED } void CardReader::startFileprint() { if(mounted) 3015e: 80 91 91 14 lds r24, 0x1491 ; 0x801491 30162: 88 23 and r24, r24 30164: 71 f0 breq .+28 ; 0x30182 { sdprinting = true; 30166: 81 e0 ldi r24, 0x01 ; 1 30168: 80 93 90 14 sts 0x1490, r24 ; 0x801490 3016c: 85 e0 ldi r24, 0x05 ; 5 3016e: 80 93 b8 0d sts 0x0DB8, r24 ; 0x800db8 <_ZL13printer_state.lto_priv.401> 30172: 08 95 ret setIndex(filespos[file_subcall_ctr]); startFileprint(); } else { sdprinting = false; 30174: 10 92 90 14 sts 0x1490, r1 ; 0x801490 30178: 83 e0 ldi r24, 0x03 ; 3 3017a: 80 93 b8 0d sts 0x0DB8, r24 ; 0x800db8 <_ZL13printer_state.lto_priv.401> SetPrinterState(PrinterState::SDPrintingFinished); //set printer state to show LCD menu after finished SD print if(SD_FINISHED_STEPPERRELEASE) { finishAndDisableSteppers(); 3017e: 0c 94 68 82 jmp 0x104d0 ; 0x104d0 autotempShutdown(); #ifdef SDCARD_SORT_ALPHA //presort(); #endif } } 30182: 08 95 ret 00030184 : root.rewind(); lsDive("",root, NULL, LS_SerialPrint, params); } void CardReader::mount(bool doPresort/* = true*/) 30184: cf 92 push r12 30186: df 92 push r13 30188: ef 92 push r14 3018a: ff 92 push r15 3018c: 0f 93 push r16 3018e: 1f 93 push r17 30190: cf 93 push r28 30192: df 93 push r29 30194: 08 2f mov r16, r24 { mounted = false; 30196: 10 92 91 14 sts 0x1491, r1 ; 0x801491 if(root.isOpen()) 3019a: 80 91 19 15 lds r24, 0x1519 ; 0x801519 3019e: 88 23 and r24, r24 301a0: 21 f0 breq .+8 ; 0x301aa root.close(); 301a2: 86 e1 ldi r24, 0x16 ; 22 301a4: 95 e1 ldi r25, 0x15 ; 21 301a6: 0f 94 70 58 call 0x2b0e0 ; 0x2b0e0 * \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; 301aa: 10 92 00 17 sts 0x1700, r1 ; 0x801700 301ae: 10 92 fd 16 sts 0x16FD, r1 ; 0x8016fd // 16-bit init start time allows over a minute uint16_t t0 = (uint16_t)_millis(); 301b2: 0f 94 4c 29 call 0x25298 ; 0x25298 301b6: eb 01 movw r28, r22 uint32_t arg; // set pin modes chipSelectHigh(); 301b8: 0f 94 bf 74 call 0x2e97e ; 0x2e97e SET_OUTPUT(SDSS); 301bc: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 301c0: 80 64 ori r24, 0x40 ; 64 301c2: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> SET_INPUT(MISO); 301c6: 23 98 cbi 0x04, 3 ; 4 SET_OUTPUT(MOSI); 301c8: 22 9a sbi 0x04, 2 ; 4 SET_OUTPUT(SCK); 301ca: 21 9a sbi 0x04, 1 ; 4 #ifndef SOFTWARE_SPI // SS must be in output mode even it is not chip select SET_OUTPUT(SS); 301cc: 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); 301ce: 28 9a sbi 0x05, 0 ; 5 #endif // SET_SPI_SS_HIGH // set SCK rate for initialization commands spiRate_ = SPI_SD_INIT_RATE; 301d0: 85 e0 ldi r24, 0x05 ; 5 301d2: 80 93 fe 16 sts 0x16FE, r24 ; 0x8016fe * 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); 301d6: 82 e5 ldi r24, 0x52 ; 82 301d8: 8c bd out 0x2c, r24 ; 44 SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; 301da: 1d bc out 0x2d, r1 ; 45 301dc: 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); 301de: 8f ef ldi r24, 0xFF ; 255 301e0: 0f 94 45 52 call 0x2a48a ; 0x2a48a 301e4: 11 50 subi r17, 0x01 ; 1 301e6: d9 f7 brne .-10 ; 0x301de WRITE(MISO, 1); // temporarily enable the MISO line pullup 301e8: 2b 9a sbi 0x05, 3 ; 5 // command to go idle in SPI mode while ((status_ = cardCommand(CMD0, 0)) != R1_IDLE_STATE) { 301ea: 20 e0 ldi r18, 0x00 ; 0 301ec: 30 e0 ldi r19, 0x00 ; 0 301ee: a9 01 movw r20, r18 301f0: 60 e0 ldi r22, 0x00 ; 0 301f2: 8d ef ldi r24, 0xFD ; 253 301f4: 96 e1 ldi r25, 0x16 ; 22 301f6: 0f 94 51 52 call 0x2a4a2 ; 0x2a4a2 301fa: 80 93 ff 16 sts 0x16FF, r24 ; 0x8016ff 301fe: 81 30 cpi r24, 0x01 ; 1 30200: 61 f0 breq .+24 ; 0x3021a if (((uint16_t)_millis() - t0) > SD_INIT_TIMEOUT) { 30202: 0f 94 4c 29 call 0x25298 ; 0x25298 30206: 6c 1b sub r22, r28 30208: 7d 0b sbc r23, r29 3020a: 61 3d cpi r22, 0xD1 ; 209 3020c: 77 40 sbci r23, 0x07 ; 7 3020e: 68 f3 brcs .-38 ; 0x301ea WRITE(MISO, 0); // disable the MISO line pullup 30210: 2b 98 cbi 0x05, 3 ; 5 30212: 81 e0 ldi r24, 0x01 ; 1 30214: 80 93 fd 16 sts 0x16FD, r24 ; 0x8016fd 30218: 22 c0 rjmp .+68 ; 0x3025e error(SD_CARD_ERROR_CMD0); goto fail; } } WRITE(MISO, 0); // disable the MISO line pullup 3021a: 2b 98 cbi 0x05, 3 ; 5 // send 0xFF until 0xFF received to give card some clock cycles t0 = (uint16_t)_millis(); 3021c: 0f 94 4c 29 call 0x25298 ; 0x25298 30220: eb 01 movw r28, r22 SERIAL_ECHOLNRPGM(PSTR("Sending 0xFF")); 30222: 8f e1 ldi r24, 0x1F ; 31 30224: 9a ea ldi r25, 0xAA ; 170 30226: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 spiSend(0XFF); 3022a: 8f ef ldi r24, 0xFF ; 255 3022c: 0f 94 45 52 call 0x2a48a ; 0x2a48a while ((status_ = spiRec()) != 0xFF) 30230: 0f 94 4a 52 call 0x2a494 ; 0x2a494 30234: 80 93 ff 16 sts 0x16FF, r24 ; 0x8016ff 30238: 8f 3f cpi r24, 0xFF ; 255 3023a: 59 f1 breq .+86 ; 0x30292 { spiSend(0XFF); 3023c: 8f ef ldi r24, 0xFF ; 255 3023e: 0f 94 45 52 call 0x2a48a ; 0x2a48a if (((uint16_t)_millis() - t0) > SD_CARD_ERROR_FF_TIMEOUT) 30242: 0f 94 4c 29 call 0x25298 ; 0x25298 30246: 6c 1b sub r22, r28 30248: 7d 0b sbc r23, r29 3024a: 62 32 cpi r22, 0x22 ; 34 3024c: 71 05 cpc r23, r1 3024e: 80 f3 brcs .-32 ; 0x30230 30250: 82 e0 ldi r24, 0x02 ; 2 30252: 80 93 fd 16 sts 0x16FD, r24 ; 0x8016fd { error(SD_CARD_ERROR_CMD8); SERIAL_ECHOLNRPGM(PSTR("No 0xFF received")); 30256: 8e e0 ldi r24, 0x0E ; 14 30258: 9a ea ldi r25, 0xAA ; 170 3025a: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 #else // SOFTWARE_SPI return true; #endif // SOFTWARE_SPI fail: chipSelectHigh(); 3025e: 0f 94 bf 74 call 0x2e97e ; 0x2e97e #else if (!card.init(SPI_FULL_SPEED) ) #endif { SERIAL_ECHO_START; 30262: 82 ec ldi r24, 0xC2 ; 194 30264: 9b ea ldi r25, 0xAB ; 171 30266: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHOLNRPGM(_n("SD init fail"));////MSG_SD_INIT_FAIL 3026a: 84 eb ldi r24, 0xB4 ; 180 3026c: 90 e7 ldi r25, 0x70 ; 112 } else { mounted = true; SERIAL_ECHO_START; SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK 3026e: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 } if (mounted) 30272: 80 91 91 14 lds r24, 0x1491 ; 0x801491 30276: 88 23 and r24, r24 30278: 09 f4 brne .+2 ; 0x3027c 3027a: 9a c0 rjmp .+308 ; 0x303b0 { cdroot(doPresort); 3027c: 80 2f mov r24, r16 } } 3027e: df 91 pop r29 30280: cf 91 pop r28 30282: 1f 91 pop r17 30284: 0f 91 pop r16 30286: ff 90 pop r15 30288: ef 90 pop r14 3028a: df 90 pop r13 3028c: cf 90 pop r12 SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK } if (mounted) { cdroot(doPresort); 3028e: 0d 94 ae 7e jmp 0x2fd5c ; 0x2fd5c goto fail; } } // check SD version if ((cardCommand(CMD8, 0x1AA) & R1_ILLEGAL_COMMAND)) { 30292: 2a ea ldi r18, 0xAA ; 170 30294: 31 e0 ldi r19, 0x01 ; 1 30296: 40 e0 ldi r20, 0x00 ; 0 30298: 50 e0 ldi r21, 0x00 ; 0 3029a: 68 e0 ldi r22, 0x08 ; 8 3029c: 8d ef ldi r24, 0xFD ; 253 3029e: 96 e1 ldi r25, 0x16 ; 22 302a0: 0f 94 51 52 call 0x2a4a2 ; 0x2a4a2 302a4: 82 ff sbrs r24, 2 302a6: 2b c0 rjmp .+86 ; 0x302fe 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;} 302a8: 81 e0 ldi r24, 0x01 ; 1 302aa: 80 93 00 17 sts 0x1700, r24 ; 0x801700 goto fail; } type(SD_CARD_TYPE_SD2); } // initialize card and send host supports SDHC if SD2 arg = type() == SD_CARD_TYPE_SD2 ? 0X40000000 : 0; 302ae: 80 91 00 17 lds r24, 0x1700 ; 0x801700 302b2: c1 2c mov r12, r1 302b4: d1 2c mov r13, r1 302b6: 76 01 movw r14, r12 302b8: 82 30 cpi r24, 0x02 ; 2 302ba: 29 f4 brne .+10 ; 0x302c6 302bc: c1 2c mov r12, r1 302be: d1 2c mov r13, r1 302c0: e1 2c mov r14, r1 302c2: 80 e4 ldi r24, 0x40 ; 64 302c4: 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); 302c6: 20 e0 ldi r18, 0x00 ; 0 302c8: 30 e0 ldi r19, 0x00 ; 0 302ca: a9 01 movw r20, r18 302cc: 67 e3 ldi r22, 0x37 ; 55 302ce: 8d ef ldi r24, 0xFD ; 253 302d0: 96 e1 ldi r25, 0x16 ; 22 302d2: 0f 94 51 52 call 0x2a4a2 ; 0x2a4a2 return cardCommand(cmd, arg); 302d6: a7 01 movw r20, r14 302d8: 96 01 movw r18, r12 302da: 69 e2 ldi r22, 0x29 ; 41 302dc: 8d ef ldi r24, 0xFD ; 253 302de: 96 e1 ldi r25, 0x16 ; 22 302e0: 0f 94 51 52 call 0x2a4a2 ; 0x2a4a2 while ((status_ = cardAcmd(ACMD41, arg)) != R1_READY_STATE) { 302e4: 80 93 ff 16 sts 0x16FF, r24 ; 0x8016ff 302e8: 88 23 and r24, r24 302ea: b1 f0 breq .+44 ; 0x30318 // check for timeout if (((uint16_t)_millis() - t0) > SD_INIT_TIMEOUT) { 302ec: 0f 94 4c 29 call 0x25298 ; 0x25298 302f0: 6c 1b sub r22, r28 302f2: 7d 0b sbc r23, r29 302f4: 61 3d cpi r22, 0xD1 ; 209 302f6: 77 40 sbci r23, 0x07 ; 7 302f8: 30 f3 brcs .-52 ; 0x302c6 bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 302fa: 8a e0 ldi r24, 0x0A ; 10 302fc: 8b cf rjmp .-234 ; 0x30214 goto fail; } } // check SD version if ((cardCommand(CMD8, 0x1AA) & R1_ILLEGAL_COMMAND)) { 302fe: 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(); 30300: 0f 94 4a 52 call 0x2a494 ; 0x2a494 30304: 80 93 ff 16 sts 0x16FF, r24 ; 0x8016ff 30308: 11 50 subi r17, 0x01 ; 1 3030a: d1 f7 brne .-12 ; 0x30300 if (status_ != 0XAA) { 3030c: 8a 3a cpi r24, 0xAA ; 170 3030e: 11 f0 breq .+4 ; 0x30314 30310: 82 e0 ldi r24, 0x02 ; 2 30312: 80 cf rjmp .-256 ; 0x30214 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;} 30314: 82 e0 ldi r24, 0x02 ; 2 30316: c9 cf rjmp .-110 ; 0x302aa error(SD_CARD_ERROR_ACMD41); goto fail; } } // if SD2 read OCR register to check for SDHC card if (type() == SD_CARD_TYPE_SD2) { 30318: 80 91 00 17 lds r24, 0x1700 ; 0x801700 3031c: 82 30 cpi r24, 0x02 ; 2 3031e: d1 f4 brne .+52 ; 0x30354 if (cardCommand(CMD58, 0)) { 30320: 20 e0 ldi r18, 0x00 ; 0 30322: 30 e0 ldi r19, 0x00 ; 0 30324: a9 01 movw r20, r18 30326: 6a e3 ldi r22, 0x3A ; 58 30328: 8d ef ldi r24, 0xFD ; 253 3032a: 96 e1 ldi r25, 0x16 ; 22 3032c: 0f 94 51 52 call 0x2a4a2 ; 0x2a4a2 30330: 88 23 and r24, r24 30332: 11 f0 breq .+4 ; 0x30338 bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 30334: 88 e0 ldi r24, 0x08 ; 8 30336: 6e cf rjmp .-292 ; 0x30214 error(SD_CARD_ERROR_CMD58); goto fail; } if ((spiRec() & 0XC0) == 0XC0) type(SD_CARD_TYPE_SDHC); 30338: 0f 94 4a 52 call 0x2a494 ; 0x2a494 3033c: 80 7c andi r24, 0xC0 ; 192 3033e: 80 3c cpi r24, 0xC0 ; 192 30340: 19 f4 brne .+6 ; 0x30348 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;} 30342: 83 e0 ldi r24, 0x03 ; 3 30344: 80 93 00 17 sts 0x1700, r24 ; 0x801700 // discard rest of ocr - contains allowed voltage range for (uint8_t i = 0; i < 3; i++) spiRec(); 30348: 0f 94 4a 52 call 0x2a494 ; 0x2a494 3034c: 0f 94 4a 52 call 0x2a494 ; 0x2a494 30350: 0f 94 4a 52 call 0x2a494 ; 0x2a494 } chipSelectHigh(); 30354: 0f 94 bf 74 call 0x2e97e ; 0x2e97e bool Sd2Card::setSckRate(uint8_t sckRateID) { if (sckRateID > 6) { error(SD_CARD_ERROR_SCK_RATE); return false; } spiRate_ = sckRateID; 30358: 10 92 fe 16 sts 0x16FE, r1 ; 0x8016fe * \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);} 3035c: 81 e0 ldi r24, 0x01 ; 1 3035e: 0f 94 bb 68 call 0x2d176 ; 0x2d176 30362: 81 11 cpse r24, r1 30364: 0c c0 rjmp .+24 ; 0x3037e 30366: 80 e0 ldi r24, 0x00 ; 0 30368: 0f 94 bb 68 call 0x2d176 ; 0x2d176 #endif { SERIAL_ECHO_START; SERIAL_ECHOLNRPGM(_n("SD init fail"));////MSG_SD_INIT_FAIL } else if (!volume.init(&card)) 3036c: 81 11 cpse r24, r1 3036e: 07 c0 rjmp .+14 ; 0x3037e { SERIAL_ERROR_START; 30370: 8a e9 ldi r24, 0x9A ; 154 30372: 9b ea ldi r25, 0xAB ; 171 30374: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ERRORLNRPGM(_n("volume.init failed"));////MSG_SD_VOL_INIT_FAIL 30378: 81 ea ldi r24, 0xA1 ; 161 3037a: 90 e7 ldi r25, 0x70 ; 112 3037c: 78 cf rjmp .-272 ; 0x3026e } else if (!root.openRoot(&volume)) 3037e: 62 e0 ldi r22, 0x02 ; 2 30380: 77 e1 ldi r23, 0x17 ; 23 30382: 86 e1 ldi r24, 0x16 ; 22 30384: 95 e1 ldi r25, 0x15 ; 21 30386: 0f 94 c9 55 call 0x2ab92 ; 0x2ab92 3038a: 81 11 cpse r24, r1 3038c: 07 c0 rjmp .+14 ; 0x3039c { SERIAL_ERROR_START; 3038e: 8a e9 ldi r24, 0x9A ; 154 30390: 9b ea ldi r25, 0xAB ; 171 30392: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ERRORLNRPGM(_n("openRoot failed"));////MSG_SD_OPENROOT_FAIL 30396: 81 e9 ldi r24, 0x91 ; 145 30398: 90 e7 ldi r25, 0x70 ; 112 3039a: 69 cf rjmp .-302 ; 0x3026e } else { mounted = true; 3039c: 81 e0 ldi r24, 0x01 ; 1 3039e: 80 93 91 14 sts 0x1491, r24 ; 0x801491 SERIAL_ECHO_START; 303a2: 82 ec ldi r24, 0xC2 ; 194 303a4: 9b ea ldi r25, 0xAB ; 171 303a6: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK 303aa: 86 e8 ldi r24, 0x86 ; 134 303ac: 90 e7 ldi r25, 0x70 ; 112 303ae: 5f cf rjmp .-322 ; 0x3026e if (mounted) { cdroot(doPresort); } } 303b0: df 91 pop r29 303b2: cf 91 pop r28 303b4: 1f 91 pop r17 303b6: 0f 91 pop r16 303b8: ff 90 pop r15 303ba: ef 90 pop r14 303bc: df 90 pop r13 303be: cf 90 pop r12 303c0: 08 95 ret 000303c2 : ms = 0; } } } static void wait_for_heater(long codenum, uint8_t extruder) { 303c2: 4f 92 push r4 303c4: 5f 92 push r5 303c6: 6f 92 push r6 303c8: 7f 92 push r7 303ca: 8f 92 push r8 303cc: 9f 92 push r9 303ce: af 92 push r10 303d0: bf 92 push r11 303d2: cf 92 push r12 303d4: df 92 push r13 303d6: ef 92 push r14 303d8: ff 92 push r15 303da: 4b 01 movw r8, r22 303dc: 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]; 303de: 60 91 b6 0d lds r22, 0x0DB6 ; 0x800db6 303e2: 70 91 b7 0d lds r23, 0x0DB7 ; 0x800db7 303e6: 07 2e mov r0, r23 303e8: 00 0c add r0, r0 303ea: 88 0b sbc r24, r24 303ec: 99 0b sbc r25, r25 303ee: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> if (!degTargetHotend(extruder)) 303f2: 20 e0 ldi r18, 0x00 ; 0 303f4: 30 e0 ldi r19, 0x00 ; 0 303f6: a9 01 movw r20, r18 303f8: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 303fc: 88 23 and r24, r24 303fe: d1 f0 breq .+52 ; 0x30434 #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; 30400: 10 92 b5 0d sts 0x0DB5, r1 ; 0x800db5 <_ZL13cancel_heatup.lto_priv.408> if (!degTargetHotend(extruder)) return; #ifdef TEMP_RESIDENCY_TIME long residencyStart; residencyStart = -1; 30404: cc 24 eor r12, r12 30406: ca 94 dec r12 30408: dc 2c mov r13, r12 3040a: 76 01 movw r14, r12 #ifdef TEMP_RESIDENCY_TIME SERIAL_PROTOCOLPGM(" W:"); if (residencyStart > -1) { codenum = ((TEMP_RESIDENCY_TIME * 1000UL) - (_millis() - residencyStart)) / 1000UL; 3040c: 98 ee ldi r25, 0xE8 ; 232 3040e: 49 2e mov r4, r25 30410: 93 e0 ldi r25, 0x03 ; 3 30412: 59 2e mov r5, r25 30414: 61 2c mov r6, r1 30416: 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) || 30418: 80 91 b5 0d lds r24, 0x0DB5 ; 0x800db5 <_ZL13cancel_heatup.lto_priv.408> 3041c: 81 11 cpse r24, r1 3041e: 0a c0 rjmp .+20 ; 0x30434 30420: 2f ef ldi r18, 0xFF ; 255 30422: c2 16 cp r12, r18 30424: d2 06 cpc r13, r18 30426: e2 06 cpc r14, r18 30428: f2 06 cpc r15, r18 3042a: 89 f4 brne .+34 ; 0x3044e (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) { 3042c: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 30430: 82 30 cpi r24, 0x02 ; 2 30432: b9 f4 brne .+46 ; 0x30462 { residencyStart = _millis(); } #endif //TEMP_RESIDENCY_TIME } } 30434: ff 90 pop r15 30436: ef 90 pop r14 30438: df 90 pop r13 3043a: cf 90 pop r12 3043c: bf 90 pop r11 3043e: af 90 pop r10 30440: 9f 90 pop r9 30442: 8f 90 pop r8 30444: 7f 90 pop r7 30446: 6f 90 pop r6 30448: 5f 90 pop r5 3044a: 4f 90 pop r4 3044c: 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) || 3044e: f7 fc sbrc r15, 7 30450: f1 cf rjmp .-30 ; 0x30434 (residencyStart >= 0 && (((unsigned int)(_millis() - residencyStart)) < (TEMP_RESIDENCY_TIME * 1000UL))))) { 30452: 0f 94 4c 29 call 0x25298 ; 0x25298 30456: 6c 19 sub r22, r12 30458: 7d 09 sbc r23, r13 3045a: 68 3b cpi r22, 0xB8 ; 184 3045c: 7b 40 sbci r23, 0x0B ; 11 3045e: 30 f3 brcs .-52 ; 0x3042c 30460: e9 cf rjmp .-46 ; 0x30434 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) 30462: 0f 94 4c 29 call 0x25298 ; 0x25298 30466: 68 19 sub r22, r8 30468: 79 09 sbc r23, r9 3046a: 8a 09 sbc r24, r10 3046c: 9b 09 sbc r25, r11 3046e: 69 3e cpi r22, 0xE9 ; 233 30470: 73 40 sbci r23, 0x03 ; 3 30472: 81 05 cpc r24, r1 30474: 91 05 cpc r25, r1 30476: f0 f1 brcs .+124 ; 0x304f4 { //Print Temp Reading and remaining time every 1 second while heating up/cooling down if (!farm_mode) { SERIAL_PROTOCOLPGM("T:"); 30478: 8b e0 ldi r24, 0x0B ; 11 3047a: 9a ea ldi r25, 0xAA ; 170 3047c: 0e 94 50 77 call 0xeea0 ; 0xeea0 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 30480: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 30484: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 30488: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 3048c: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 30490: 41 e0 ldi r20, 0x01 ; 1 30492: 0f 94 87 d5 call 0x3ab0e ; 0x3ab0e SERIAL_PROTOCOL_F(degHotend(extruder), 1); SERIAL_PROTOCOLPGM(" E:"); 30496: 87 e0 ldi r24, 0x07 ; 7 30498: 9a ea ldi r25, 0xAA ; 170 3049a: 0e 94 50 77 call 0xeea0 ; 0xeea0 3049e: 60 e0 ldi r22, 0x00 ; 0 304a0: 70 e0 ldi r23, 0x00 ; 0 304a2: cb 01 movw r24, r22 304a4: 0f 94 6b d5 call 0x3aad6 ; 0x3aad6 SERIAL_PROTOCOL((int)extruder); #ifdef TEMP_RESIDENCY_TIME SERIAL_PROTOCOLPGM(" W:"); 304a8: 83 e0 ldi r24, 0x03 ; 3 304aa: 9a ea ldi r25, 0xAA ; 170 304ac: 0e 94 50 77 call 0xeea0 ; 0xeea0 if (residencyStart > -1) 304b0: f7 fc sbrc r15, 7 304b2: 52 c0 rjmp .+164 ; 0x30558 { codenum = ((TEMP_RESIDENCY_TIME * 1000UL) - (_millis() - residencyStart)) / 1000UL; 304b4: 0f 94 4c 29 call 0x25298 ; 0x25298 304b8: 46 01 movw r8, r12 304ba: 57 01 movw r10, r14 304bc: 58 eb ldi r21, 0xB8 ; 184 304be: 85 0e add r8, r21 304c0: 5b e0 ldi r21, 0x0B ; 11 304c2: 95 1e adc r9, r21 304c4: a1 1c adc r10, r1 304c6: b1 1c adc r11, r1 304c8: a5 01 movw r20, r10 304ca: 94 01 movw r18, r8 304cc: 26 1b sub r18, r22 304ce: 37 0b sbc r19, r23 304d0: 48 0b sbc r20, r24 304d2: 59 0b sbc r21, r25 304d4: ca 01 movw r24, r20 304d6: b9 01 movw r22, r18 304d8: a3 01 movw r20, r6 304da: 92 01 movw r18, r4 304dc: 0f 94 8f dc call 0x3b91e ; 0x3b91e <__udivmodsi4> 304e0: ca 01 movw r24, r20 304e2: b9 01 movw r22, r18 304e4: 0f 94 6b d5 call 0x3aad6 ; 0x3aad6 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 304e8: 0f 94 fd d5 call 0x3abfa ; 0x3abfa } } #else SERIAL_PROTOCOLLN(); #endif codenum = _millis(); 304ec: 0f 94 4c 29 call 0x25298 ; 0x25298 304f0: 4b 01 movw r8, r22 304f2: 5c 01 movw r10, r24 } delay_keep_alive(0); //do not disable steppers 304f4: 90 e0 ldi r25, 0x00 ; 0 304f6: 80 e0 ldi r24, 0x00 ; 0 304f8: 0e 94 e4 8c call 0x119c8 ; 0x119c8 #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))) || 304fc: 3f ef ldi r19, 0xFF ; 255 304fe: c3 16 cp r12, r19 30500: d3 06 cpc r13, r19 30502: e3 06 cpc r14, r19 30504: f3 06 cpc r15, r19 30506: 09 f0 breq .+2 ; 0x3050a 30508: 46 c0 rjmp .+140 ; 0x30596 } 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))) || 3050a: 80 91 af 0d lds r24, 0x0DAF ; 0x800daf <_ZL16target_direction.lto_priv.532> 3050e: 60 91 b6 0d lds r22, 0x0DB6 ; 0x800db6 30512: 70 91 b7 0d lds r23, 0x0DB7 ; 0x800db7 30516: 88 23 and r24, r24 30518: 19 f1 breq .+70 ; 0x30560 3051a: 07 2e mov r0, r23 3051c: 00 0c add r0, r0 3051e: 88 0b sbc r24, r24 30520: 99 0b sbc r25, r25 30522: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 30526: 20 e0 ldi r18, 0x00 ; 0 30528: 30 e0 ldi r19, 0x00 ; 0 3052a: 40 e8 ldi r20, 0x80 ; 128 3052c: 5f e3 ldi r21, 0x3F ; 63 3052e: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 30532: 9b 01 movw r18, r22 30534: ac 01 movw r20, r24 30536: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 3053a: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 3053e: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 30542: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 30546: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 3054a: 87 fd sbrc r24, 7 3054c: 65 cf rjmp .-310 ; 0x30418 (residencyStart == -1 && !target_direction && (degHotend(extruder) <= (degTargetHotend(extruder) + TEMP_WINDOW))) || (residencyStart > -1 && fabs(degHotend(extruder) - degTargetHotend(extruder)) > TEMP_HYSTERESIS)) { residencyStart = _millis(); 3054e: 0f 94 4c 29 call 0x25298 ; 0x25298 30552: 6b 01 movw r12, r22 30554: 7c 01 movw r14, r24 30556: 60 cf rjmp .-320 ; 0x30418 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 30558: 8f e3 ldi r24, 0x3F ; 63 3055a: 0e 94 37 77 call 0xee6e ; 0xee6e 3055e: c4 cf rjmp .-120 ; 0x304e8 30560: 07 2e mov r0, r23 30562: 00 0c add r0, r0 30564: 88 0b sbc r24, r24 30566: 99 0b sbc r25, r25 30568: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__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))) || 3056c: 20 e0 ldi r18, 0x00 ; 0 3056e: 30 e0 ldi r19, 0x00 ; 0 30570: 40 e8 ldi r20, 0x80 ; 128 30572: 5f e3 ldi r21, 0x3F ; 63 30574: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 30578: 9b 01 movw r18, r22 3057a: ac 01 movw r20, r24 3057c: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 30580: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 30584: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 30588: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 3058c: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 30590: 18 16 cp r1, r24 30592: ec f6 brge .-70 ; 0x3054e 30594: 41 cf rjmp .-382 ; 0x30418 30596: f7 fc sbrc r15, 7 30598: 3f cf rjmp .-386 ; 0x30418 3059a: 60 91 b6 0d lds r22, 0x0DB6 ; 0x800db6 3059e: 70 91 b7 0d lds r23, 0x0DB7 ; 0x800db7 305a2: 07 2e mov r0, r23 305a4: 00 0c add r0, r0 305a6: 88 0b sbc r24, r24 305a8: 99 0b sbc r25, r25 305aa: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 305ae: 9b 01 movw r18, r22 305b0: ac 01 movw r20, r24 (residencyStart > -1 && fabs(degHotend(extruder) - degTargetHotend(extruder)) > TEMP_HYSTERESIS)) 305b2: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 305b6: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 305ba: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 305be: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 305c2: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 305c6: 9f 77 andi r25, 0x7F ; 127 305c8: 20 e0 ldi r18, 0x00 ; 0 305ca: 30 e0 ldi r19, 0x00 ; 0 305cc: 40 ea ldi r20, 0xA0 ; 160 305ce: 50 e4 ldi r21, 0x40 ; 64 305d0: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 305d4: 18 16 cp r1, r24 305d6: 0c f0 brlt .+2 ; 0x305da 305d8: 1f cf rjmp .-450 ; 0x30418 305da: b9 cf rjmp .-142 ; 0x3054e 000305dc : // 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) { 305dc: 1f 93 push r17 305de: cf 93 push r28 305e0: df 93 push r29 305e2: ec 01 movw r28, r24 305e4: 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()) { 305e6: 80 91 8d 13 lds r24, 0x138D ; 0x80138d 305ea: 83 30 cpi r24, 0x03 ; 3 305ec: 09 f4 brne .+2 ; 0x305f0 305ee: 4e c0 rjmp .+156 ; 0x3068c 305f0: 8c 31 cpi r24, 0x1C ; 28 305f2: 09 f4 brne .+2 ; 0x305f6 305f4: 52 c0 rjmp .+164 ; 0x3069a break; default: break; } if (ec != lastErrorCode) { // deduplicate: only report changes in error codes into the log 305f6: 80 91 b2 13 lds r24, 0x13B2 ; 0x8013b2 305fa: 90 91 b3 13 lds r25, 0x13B3 ; 0x8013b3 305fe: 8c 17 cp r24, r28 30600: 9d 07 cpc r25, r29 30602: 79 f1 breq .+94 ; 0x30662 lastErrorCode = ec; 30604: d0 93 b3 13 sts 0x13B3, r29 ; 0x8013b3 30608: c0 93 b2 13 sts 0x13B2, r28 ; 0x8013b2 lastErrorSource = res; 3060c: 10 93 b4 13 sts 0x13B4, r17 ; 0x8013b4 LogErrorEvent_P(_O(PrusaErrorTitle(PrusaErrorCodeIndex(ec)))); 30610: ce 01 movw r24, r28 30612: 0f 94 ec c5 call 0x38bd8 ; 0x38bd8 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); 30616: e8 2f mov r30, r24 30618: f0 e0 ldi r31, 0x00 ; 0 3061a: ee 0f add r30, r30 3061c: ff 1f adc r31, r31 3061e: e9 5c subi r30, 0xC9 ; 201 30620: f6 45 sbci r31, 0x56 ; 86 30622: 85 91 lpm r24, Z+ 30624: 94 91 lpm r25, Z 30626: 02 96 adiw r24, 0x02 ; 2 30628: 0f 94 d5 c5 call 0x38baa ; 0x38baa if (ec != ErrorCode::OK && ec != ErrorCode::FILAMENT_EJECTED && ec != ErrorCode::FILAMENT_CHANGE) { 3062c: c1 30 cpi r28, 0x01 ; 1 3062e: d1 05 cpc r29, r1 30630: c1 f0 breq .+48 ; 0x30662 30632: cc 30 cpi r28, 0x0C ; 12 30634: 80 e8 ldi r24, 0x80 ; 128 30636: d8 07 cpc r29, r24 30638: a1 f0 breq .+40 ; 0x30662 3063a: c9 32 cpi r28, 0x29 ; 41 3063c: 80 e8 ldi r24, 0x80 ; 128 3063e: d8 07 cpc r29, r24 30640: 81 f0 breq .+32 ; 0x30662 IncrementMMUFails(); 30642: 0f 94 ee c4 call 0x389dc ; 0x389dc | (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 30646: ce 01 movw r24, r28 30648: 88 27 eor r24, r24 3064a: 9e 77 andi r25, 0x7E ; 126 3064c: 89 2b or r24, r25 3064e: 49 f0 breq .+18 ; 0x30662 /// Set toolchange counter to zero inline void ClearToolChangeCounter() { toolchange_counter = 0; }; inline uint16_t TMCFailures() const { return tmcFailures; } inline void IncrementTMCFailures() { ++tmcFailures; } 30650: 80 91 c0 13 lds r24, 0x13C0 ; 0x8013c0 30654: 90 91 c1 13 lds r25, 0x13C1 ; 0x8013c1 30658: 01 96 adiw r24, 0x01 ; 1 3065a: 90 93 c1 13 sts 0x13C1, r25 ; 0x8013c1 3065e: 80 93 c0 13 sts 0x13C0, r24 ; 0x8013c0 return true; } } bool MMU2::RetryIfPossible(ErrorCode ec) { if (logic.RetryAttempts()) { 30662: 80 91 9f 13 lds r24, 0x139F ; 0x80139f 30666: 88 23 and r24, r24 30668: d9 f0 breq .+54 ; 0x306a0 return Buttons::NoButton; } void SetButtonResponse(ButtonOperations rsp) { buttonSelectedOperation = rsp; 3066a: 11 e0 ldi r17, 0x01 ; 1 3066c: 10 93 ae 0d sts 0x0DAE, r17 ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.493> SetButtonResponse(ButtonOperations::Retry); // check, that Retry is actually allowed on that operation if (ButtonAvailable(ec) != Buttons::NoButton) { 30670: ce 01 movw r24, r28 30672: 0f 94 77 c8 call 0x390ee ; 0x390ee 30676: 8f 3f cpi r24, 0xFF ; 255 30678: 99 f0 breq .+38 ; 0x306a0 void ResetCommunicationTimeoutAttempts(); constexpr bool InAutoRetry() const { return inAutoRetry; } void SetInAutoRetry(bool iar) { inAutoRetry = iar; 3067a: 10 93 a0 13 sts 0x13A0, r17 ; 0x8013a0 logic.SetInAutoRetry(true); SERIAL_ECHOLNPGM("RetryButtonPressed"); 3067e: 84 e2 ldi r24, 0x24 ; 36 30680: 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"); } 30682: df 91 pop r29 30684: cf 91 pop r28 30686: 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"); 30688: 0c 94 7b 79 jmp 0xf2f6 ; 0xf2f6 // 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; 3068c: 10 92 bd 13 sts 0x13BD, r1 ; 0x8013bd float move_raise_z(float delta) { return raise_z(delta); } void planner_abort_queued_moves() { planner_abort_hard(); 30690: 0f 94 c3 c1 call 0x38386 ; 0x38386 // 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; 30694: 10 92 ac 0d sts 0x0DAC, r1 ; 0x800dac 30698: ae cf rjmp .-164 ; 0x305f6 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; 3069a: 10 92 bc 13 sts 0x13BC, r1 ; 0x8013bc 3069e: f8 cf rjmp .-16 ; 0x30690 306a0: 10 92 a0 13 sts 0x13A0, r1 ; 0x8013a0 bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { if (putErrorScreenToSleep) return; 306a4: 80 91 ad 0d lds r24, 0x0DAD ; 0x800dad <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.496> 306a8: 81 11 cpse r24, r1 306aa: 06 c0 rjmp .+12 ; 0x306b8 306ac: 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"); } 306ae: df 91 pop r29 306b0: cf 91 pop r28 306b2: 1f 91 pop r17 306b4: 0d 94 3d c7 jmp 0x38e7a ; 0x38e7a 306b8: df 91 pop r29 306ba: cf 91 pop r28 306bc: 1f 91 pop r17 306be: 08 95 ret 000306c0 : * \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) { 306c0: 2f 92 push r2 306c2: 3f 92 push r3 306c4: 4f 92 push r4 306c6: 5f 92 push r5 306c8: 6f 92 push r6 306ca: 7f 92 push r7 306cc: 8f 92 push r8 306ce: 9f 92 push r9 306d0: af 92 push r10 306d2: bf 92 push r11 306d4: cf 92 push r12 306d6: df 92 push r13 306d8: ef 92 push r14 306da: ff 92 push r15 306dc: 0f 93 push r16 306de: 1f 93 push r17 306e0: cf 93 push r28 306e2: df 93 push r29 306e4: 00 d0 rcall .+0 ; 0x306e6 306e6: 1f 92 push r1 306e8: cd b7 in r28, 0x3d ; 61 306ea: de b7 in r29, 0x3e ; 62 306ec: 5c 01 movw r10, r24 306ee: 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; 306f0: 80 91 23 17 lds r24, 0x1723 ; 0x801723 306f4: 81 30 cpi r24, 0x01 ; 1 306f6: 09 f0 breq .+2 ; 0x306fa 306f8: de c0 rjmp .+444 ; 0x308b6 306fa: 80 91 21 17 lds r24, 0x1721 ; 0x801721 306fe: 81 ff sbrs r24, 1 30700: da c0 rjmp .+436 ; 0x308b6 // seek to end of file if append flag if ((flags_ & O_APPEND) && curPosition_ != fileSize_) { 30702: 82 fd sbrc r24, 2 30704: bc c0 rjmp .+376 ; 0x3087e * \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) { 30706: 74 01 movw r14, r8 curCluster_ = next; } } } // max space in block uint16_t n = 512 - blockOffset; 30708: 21 2c mov r2, r1 3070a: 32 e0 ldi r19, 0x02 ; 2 3070c: 33 2e mov r3, r19 3070e: 00 91 28 17 lds r16, 0x1728 ; 0x801728 30712: 10 91 29 17 lds r17, 0x1729 ; 0x801729 30716: 20 91 2a 17 lds r18, 0x172A ; 0x80172a 3071a: 30 91 2b 17 lds r19, 0x172B ; 0x80172b // seek to end of file if append flag if ((flags_ & O_APPEND) && curPosition_ != fileSize_) { if (!seekEnd()) goto fail; } while (nToWrite > 0) { 3071e: e1 14 cp r14, r1 30720: f1 04 cpc r15, r1 30722: 09 f4 brne .+2 ; 0x30726 30724: 30 c1 rjmp .+608 ; 0x30986 uint8_t blockOfCluster = vol_->blockOfCluster(curPosition_); 30726: 80 91 39 17 lds r24, 0x1739 ; 0x801739 3072a: 90 91 3a 17 lds r25, 0x173A ; 0x80173a 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);} 3072e: dc 01 movw r26, r24 30730: 14 96 adiw r26, 0x04 ; 4 30732: 7c 90 ld r7, X 30734: 7a 94 dec r7 30736: b9 01 movw r22, r18 30738: a8 01 movw r20, r16 3073a: 29 e0 ldi r18, 0x09 ; 9 3073c: 76 95 lsr r23 3073e: 67 95 ror r22 30740: 57 95 ror r21 30742: 47 95 ror r20 30744: 2a 95 dec r18 30746: d1 f7 brne .-12 ; 0x3073c 30748: 74 22 and r7, r20 uint16_t blockOffset = curPosition_ & 0X1FF; 3074a: 11 70 andi r17, 0x01 ; 1 if (blockOfCluster == 0 && blockOffset == 0) { 3074c: 71 10 cpse r7, r1 3074e: 25 c0 rjmp .+74 ; 0x3079a 30750: 01 15 cp r16, r1 30752: 11 05 cpc r17, r1 30754: 11 f5 brne .+68 ; 0x3079a 30756: 40 91 24 17 lds r20, 0x1724 ; 0x801724 3075a: 50 91 25 17 lds r21, 0x1725 ; 0x801725 3075e: 60 91 26 17 lds r22, 0x1726 ; 0x801726 30762: 70 91 27 17 lds r23, 0x1727 ; 0x801727 // start of new cluster if (curCluster_ == 0) { 30766: 41 15 cp r20, r1 30768: 51 05 cpc r21, r1 3076a: 61 05 cpc r22, r1 3076c: 71 05 cpc r23, r1 3076e: 09 f0 breq .+2 ; 0x30772 30770: a8 c0 rjmp .+336 ; 0x308c2 if (firstCluster_ == 0) { 30772: 80 91 35 17 lds r24, 0x1735 ; 0x801735 30776: 90 91 36 17 lds r25, 0x1736 ; 0x801736 3077a: a0 91 37 17 lds r26, 0x1737 ; 0x801737 3077e: b0 91 38 17 lds r27, 0x1738 ; 0x801738 30782: 00 97 sbiw r24, 0x00 ; 0 30784: a1 05 cpc r26, r1 30786: b1 05 cpc r27, r1 30788: 09 f0 breq .+2 ; 0x3078c 3078a: b4 c0 rjmp .+360 ; 0x308f4 } 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; 3078c: 80 e2 ldi r24, 0x20 ; 32 3078e: 97 e1 ldi r25, 0x17 ; 23 30790: 0f 94 26 57 call 0x2ae4c ; 0x2ae4c 30794: 88 23 and r24, r24 30796: 09 f4 brne .+2 ; 0x3079a 30798: 8e c0 rjmp .+284 ; 0x308b6 curCluster_ = next; } } } // max space in block uint16_t n = 512 - blockOffset; 3079a: c1 01 movw r24, r2 3079c: 80 1b sub r24, r16 3079e: 91 0b sbc r25, r17 307a0: 67 01 movw r12, r14 307a2: 8e 15 cp r24, r14 307a4: 9f 05 cpc r25, r15 307a6: 08 f4 brcc .+2 ; 0x307aa 307a8: 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; 307aa: e0 91 39 17 lds r30, 0x1739 ; 0x801739 307ae: f0 91 3a 17 lds r31, 0x173A ; 0x80173a uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 307b2: 80 91 24 17 lds r24, 0x1724 ; 0x801724 307b6: 90 91 25 17 lds r25, 0x1725 ; 0x801725 307ba: a0 91 26 17 lds r26, 0x1726 ; 0x801726 307be: b0 91 27 17 lds r27, 0x1727 ; 0x801727 307c2: 02 97 sbiw r24, 0x02 ; 2 307c4: a1 09 sbc r26, r1 307c6: b1 09 sbc r27, r1 307c8: 25 85 ldd r18, Z+13 ; 0x0d 307ca: 04 c0 rjmp .+8 ; 0x307d4 307cc: 88 0f add r24, r24 307ce: 99 1f adc r25, r25 307d0: aa 1f adc r26, r26 307d2: bb 1f adc r27, r27 307d4: 2a 95 dec r18 307d6: d2 f7 brpl .-12 ; 0x307cc 307d8: 46 85 ldd r20, Z+14 ; 0x0e 307da: 57 85 ldd r21, Z+15 ; 0x0f 307dc: 60 89 ldd r22, Z+16 ; 0x10 307de: 71 89 ldd r23, Z+17 ; 0x11 307e0: 84 0f add r24, r20 307e2: 95 1f adc r25, r21 307e4: a6 1f adc r26, r22 307e6: b7 1f adc r27, r23 307e8: 9c 01 movw r18, r24 307ea: ad 01 movw r20, r26 307ec: 27 0d add r18, r7 307ee: 31 1d adc r19, r1 307f0: 41 1d adc r20, r1 307f2: 51 1d adc r21, r1 307f4: 29 01 movw r4, r18 307f6: 3a 01 movw r6, r20 if (n == 512) { 307f8: c1 14 cp r12, r1 307fa: 32 e0 ldi r19, 0x02 ; 2 307fc: d3 06 cpc r13, r19 307fe: 09 f0 breq .+2 ; 0x30802 30800: 8a c0 rjmp .+276 ; 0x30916 // full block - don't need to use cache if (vol_->cacheBlockNumber() == block) { 30802: 80 91 91 0e lds r24, 0x0E91 ; 0x800e91 30806: 90 91 92 0e lds r25, 0x0E92 ; 0x800e92 3080a: a0 91 93 0e lds r26, 0x0E93 ; 0x800e93 3080e: b0 91 94 0e lds r27, 0x0E94 ; 0x800e94 30812: 48 16 cp r4, r24 30814: 59 06 cpc r5, r25 30816: 6a 06 cpc r6, r26 30818: 7b 06 cpc r7, r27 3081a: 69 f4 brne .+26 ; 0x30836 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; 3081c: 10 92 99 0e sts 0x0E99, r1 ; 0x800e99 cacheBlockNumber_ = blockNumber; 30820: 8f ef ldi r24, 0xFF ; 255 30822: 9f ef ldi r25, 0xFF ; 255 30824: dc 01 movw r26, r24 30826: 80 93 91 0e sts 0x0E91, r24 ; 0x800e91 3082a: 90 93 92 0e sts 0x0E92, r25 ; 0x800e92 3082e: a0 93 93 0e sts 0x0E93, r26 ; 0x800e93 30832: b0 93 94 0e sts 0x0E94, r27 ; 0x800e94 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); 30836: 95 01 movw r18, r10 30838: b3 01 movw r22, r6 3083a: a2 01 movw r20, r4 3083c: 80 91 9a 0e lds r24, 0x0E9A ; 0x800e9a 30840: 90 91 9b 0e lds r25, 0x0E9B ; 0x800e9b 30844: 0f 94 b1 52 call 0x2a562 ; 0x2a562 // invalidate cache if block is in cache vol_->cacheSetBlockNumber(0XFFFFFFFF, false); } if (!vol_->writeBlock(block, src)) goto fail; 30848: 88 23 and r24, r24 3084a: a9 f1 breq .+106 ; 0x308b6 if (!vol_->cacheRawBlock(block, SdVolume::CACHE_FOR_WRITE)) goto fail; } uint8_t* dst = vol_->cache()->data + blockOffset; memcpy(dst, src, n); } curPosition_ += n; 3084c: 80 91 28 17 lds r24, 0x1728 ; 0x801728 30850: 90 91 29 17 lds r25, 0x1729 ; 0x801729 30854: a0 91 2a 17 lds r26, 0x172A ; 0x80172a 30858: b0 91 2b 17 lds r27, 0x172B ; 0x80172b 3085c: 8c 0d add r24, r12 3085e: 9d 1d adc r25, r13 30860: a1 1d adc r26, r1 30862: b1 1d adc r27, r1 30864: 80 93 28 17 sts 0x1728, r24 ; 0x801728 30868: 90 93 29 17 sts 0x1729, r25 ; 0x801729 3086c: a0 93 2a 17 sts 0x172A, r26 ; 0x80172a 30870: b0 93 2b 17 sts 0x172B, r27 ; 0x80172b src += n; 30874: ac 0c add r10, r12 30876: bd 1c adc r11, r13 nToWrite -= n; 30878: ec 18 sub r14, r12 3087a: fd 08 sbc r15, r13 3087c: 48 cf rjmp .-368 ; 0x3070e // 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_) { 3087e: 40 91 31 17 lds r20, 0x1731 ; 0x801731 30882: 50 91 32 17 lds r21, 0x1732 ; 0x801732 30886: 60 91 33 17 lds r22, 0x1733 ; 0x801733 3088a: 70 91 34 17 lds r23, 0x1734 ; 0x801734 3088e: 80 91 28 17 lds r24, 0x1728 ; 0x801728 30892: 90 91 29 17 lds r25, 0x1729 ; 0x801729 30896: a0 91 2a 17 lds r26, 0x172A ; 0x80172a 3089a: b0 91 2b 17 lds r27, 0x172B ; 0x80172b 3089e: 48 17 cp r20, r24 308a0: 59 07 cpc r21, r25 308a2: 6a 07 cpc r22, r26 308a4: 7b 07 cpc r23, r27 308a6: 09 f4 brne .+2 ; 0x308aa 308a8: 2e cf rjmp .-420 ; 0x30706 } /** 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);} 308aa: 80 e2 ldi r24, 0x20 ; 32 308ac: 97 e1 ldi r25, 0x17 ; 23 308ae: 0f 94 92 56 call 0x2ad24 ; 0x2ad24 if (!seekEnd()) goto fail; 308b2: 81 11 cpse r24, r1 308b4: 28 cf rjmp .-432 ; 0x30706 } return nbyte; fail: // return for write error writeError = true; 308b6: 81 e0 ldi r24, 0x01 ; 1 308b8: 80 93 20 17 sts 0x1720, r24 ; 0x801720 return -1; 308bc: 8f ef ldi r24, 0xFF ; 255 308be: 9f ef ldi r25, 0xFF ; 255 308c0: 81 c0 rjmp .+258 ; 0x309c4 } else { curCluster_ = firstCluster_; } } else { uint32_t next; if (!vol_->fatGet(curCluster_, &next)) goto fail; 308c2: 9e 01 movw r18, r28 308c4: 2f 5f subi r18, 0xFF ; 255 308c6: 3f 4f sbci r19, 0xFF ; 255 308c8: 0f 94 dc 54 call 0x2a9b8 ; 0x2a9b8 308cc: 88 23 and r24, r24 308ce: 99 f3 breq .-26 ; 0x308b6 if (vol_->isEOC(next)) { 308d0: 89 81 ldd r24, Y+1 ; 0x01 308d2: 9a 81 ldd r25, Y+2 ; 0x02 308d4: ab 81 ldd r26, Y+3 ; 0x03 308d6: 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; 308d8: e0 91 39 17 lds r30, 0x1739 ; 0x801739 308dc: f0 91 3a 17 lds r31, 0x173A ; 0x80173a 308e0: 27 89 ldd r18, Z+23 ; 0x17 308e2: 20 31 cpi r18, 0x10 ; 16 308e4: 81 f4 brne .+32 ; 0x30906 308e6: 88 3f cpi r24, 0xF8 ; 248 308e8: ef ef ldi r30, 0xFF ; 255 308ea: 9e 07 cpc r25, r30 308ec: a1 05 cpc r26, r1 308ee: b1 05 cpc r27, r1 308f0: 08 f0 brcs .+2 ; 0x308f4 308f2: 4c cf rjmp .-360 ; 0x3078c // add cluster if at end of chain if (!addCluster()) goto fail; } else { curCluster_ = next; 308f4: 80 93 24 17 sts 0x1724, r24 ; 0x801724 308f8: 90 93 25 17 sts 0x1725, r25 ; 0x801725 308fc: a0 93 26 17 sts 0x1726, r26 ; 0x801726 30900: b0 93 27 17 sts 0x1727, r27 ; 0x801727 30904: 4a cf rjmp .-364 ; 0x3079a return cluster >= FAT32EOC_MIN; 30906: 88 3f cpi r24, 0xF8 ; 248 30908: ff ef ldi r31, 0xFF ; 255 3090a: 9f 07 cpc r25, r31 3090c: af 07 cpc r26, r31 3090e: ff e0 ldi r31, 0x0F ; 15 30910: bf 07 cpc r27, r31 30912: 80 f3 brcs .-32 ; 0x308f4 30914: 3b cf rjmp .-394 ; 0x3078c // invalidate cache if block is in cache vol_->cacheSetBlockNumber(0XFFFFFFFF, false); } if (!vol_->writeBlock(block, src)) goto fail; } else { if (blockOffset == 0 && curPosition_ >= fileSize_) { 30916: 01 15 cp r16, r1 30918: 11 05 cpc r17, r1 3091a: 69 f5 brne .+90 ; 0x30976 3091c: 40 91 28 17 lds r20, 0x1728 ; 0x801728 30920: 50 91 29 17 lds r21, 0x1729 ; 0x801729 30924: 60 91 2a 17 lds r22, 0x172A ; 0x80172a 30928: 70 91 2b 17 lds r23, 0x172B ; 0x80172b 3092c: 80 91 31 17 lds r24, 0x1731 ; 0x801731 30930: 90 91 32 17 lds r25, 0x1732 ; 0x801732 30934: a0 91 33 17 lds r26, 0x1733 ; 0x801733 30938: b0 91 34 17 lds r27, 0x1734 ; 0x801734 3093c: 48 17 cp r20, r24 3093e: 59 07 cpc r21, r25 30940: 6a 07 cpc r22, r26 30942: 7b 07 cpc r23, r27 30944: c0 f0 brcs .+48 ; 0x30976 // start of new block don't need to read into cache if (!vol_->cacheFlush()) goto fail; 30946: 0f 94 15 53 call 0x2a62a ; 0x2a62a 3094a: 88 23 and r24, r24 3094c: 09 f4 brne .+2 ; 0x30950 3094e: b3 cf rjmp .-154 ; 0x308b6 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; 30950: 81 e0 ldi r24, 0x01 ; 1 30952: 80 93 99 0e sts 0x0E99, r24 ; 0x800e99 cacheBlockNumber_ = blockNumber; 30956: 40 92 91 0e sts 0x0E91, r4 ; 0x800e91 3095a: 50 92 92 0e sts 0x0E92, r5 ; 0x800e92 3095e: 60 92 93 0e sts 0x0E93, r6 ; 0x800e93 30962: 70 92 94 0e sts 0x0E94, r7 ; 0x800e94 } 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); 30966: a6 01 movw r20, r12 30968: b5 01 movw r22, r10 3096a: c8 01 movw r24, r16 3096c: 83 56 subi r24, 0x63 ; 99 3096e: 91 4f sbci r25, 0xF1 ; 241 30970: 0f 94 45 e2 call 0x3c48a ; 0x3c48a 30974: 6b cf rjmp .-298 ; 0x3084c 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; 30976: 41 e0 ldi r20, 0x01 ; 1 30978: c3 01 movw r24, r6 3097a: b2 01 movw r22, r4 3097c: 0f 94 0d 54 call 0x2a81a ; 0x2a81a 30980: 81 11 cpse r24, r1 30982: f1 cf rjmp .-30 ; 0x30966 30984: 98 cf rjmp .-208 ; 0x308b6 } curPosition_ += n; src += n; nToWrite -= n; } if (curPosition_ > fileSize_) { 30986: 80 91 31 17 lds r24, 0x1731 ; 0x801731 3098a: 90 91 32 17 lds r25, 0x1732 ; 0x801732 3098e: a0 91 33 17 lds r26, 0x1733 ; 0x801733 30992: b0 91 34 17 lds r27, 0x1734 ; 0x801734 30996: 80 17 cp r24, r16 30998: 91 07 cpc r25, r17 3099a: a2 07 cpc r26, r18 3099c: b3 07 cpc r27, r19 3099e: 68 f4 brcc .+26 ; 0x309ba 309a0: 80 91 21 17 lds r24, 0x1721 ; 0x801721 // update fileSize and insure sync will update dir entry fileSize_ = curPosition_; 309a4: 00 93 31 17 sts 0x1731, r16 ; 0x801731 309a8: 10 93 32 17 sts 0x1732, r17 ; 0x801732 309ac: 20 93 33 17 sts 0x1733, r18 ; 0x801733 309b0: 30 93 34 17 sts 0x1734, r19 ; 0x801734 flags_ |= F_FILE_DIR_DIRTY; 309b4: 80 68 ori r24, 0x80 ; 128 309b6: 80 93 21 17 sts 0x1721, r24 ; 0x801721 } else if (dateTime_ && nbyte) { // insure sync will update modified date and time flags_ |= F_FILE_DIR_DIRTY; } if (flags_ & O_SYNC) { 309ba: 80 91 21 17 lds r24, 0x1721 ; 0x801721 309be: 83 fd sbrc r24, 3 309c0: 18 c0 rjmp .+48 ; 0x309f2 if (!sync()) goto fail; } return nbyte; 309c2: c4 01 movw r24, r8 fail: // return for write error writeError = true; return -1; } 309c4: 0f 90 pop r0 309c6: 0f 90 pop r0 309c8: 0f 90 pop r0 309ca: 0f 90 pop r0 309cc: df 91 pop r29 309ce: cf 91 pop r28 309d0: 1f 91 pop r17 309d2: 0f 91 pop r16 309d4: ff 90 pop r15 309d6: ef 90 pop r14 309d8: df 90 pop r13 309da: cf 90 pop r12 309dc: bf 90 pop r11 309de: af 90 pop r10 309e0: 9f 90 pop r9 309e2: 8f 90 pop r8 309e4: 7f 90 pop r7 309e6: 6f 90 pop r6 309e8: 5f 90 pop r5 309ea: 4f 90 pop r4 309ec: 3f 90 pop r3 309ee: 2f 90 pop r2 309f0: 08 95 ret // insure sync will update modified date and time flags_ |= F_FILE_DIR_DIRTY; } if (flags_ & O_SYNC) { if (!sync()) goto fail; 309f2: 80 e2 ldi r24, 0x20 ; 32 309f4: 97 e1 ldi r25, 0x17 ; 23 309f6: 0f 94 3b 58 call 0x2b076 ; 0x2b076 309fa: 81 11 cpse r24, r1 309fc: e2 cf rjmp .-60 ; 0x309c2 309fe: 5b cf rjmp .-330 ; 0x308b6 00030a00 : #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) { 30a00: 0f 93 push r16 30a02: cf 93 push r28 30a04: df 93 push r29 30a06: cd b7 in r28, 0x3d ; 61 30a08: de b7 in r29, 0x3e ; 62 30a0a: a3 97 sbiw r28, 0x23 ; 35 30a0c: 0f b6 in r0, 0x3f ; 63 30a0e: f8 94 cli 30a10: de bf out 0x3e, r29 ; 62 30a12: 0f be out 0x3f, r0 ; 63 30a14: cd bf out 0x3d, r28 ; 61 if (nr < sort_count) 30a16: 20 91 31 16 lds r18, 0x1631 ; 0x801631 30a1a: 30 91 32 16 lds r19, 0x1632 ; 0x801632 30a1e: 82 17 cp r24, r18 30a20: 93 07 cpc r25, r19 30a22: d8 f4 brcc .+54 ; 0x30a5a getfilename_simple(sort_entries[(sdSort == SD_SORT_ALPHA) ? (sort_count - nr - 1) : nr]); 30a24: 61 30 cpi r22, 0x01 ; 1 30a26: 31 f4 brne .+12 ; 0x30a34 30a28: 21 50 subi r18, 0x01 ; 1 30a2a: 31 09 sbc r19, r1 30a2c: a9 01 movw r20, r18 30a2e: 48 1b sub r20, r24 30a30: 59 0b sbc r21, r25 30a32: ca 01 movw r24, r20 30a34: 88 0f add r24, r24 30a36: 99 1f adc r25, r25 30a38: fc 01 movw r30, r24 30a3a: ed 5c subi r30, 0xCD ; 205 30a3c: f9 4e sbci r31, 0xE9 ; 233 30a3e: 80 81 ld r24, Z 30a40: 91 81 ldd r25, Z+1 ; 0x01 30a42: 0f 94 85 79 call 0x2f30a ; 0x2f30a else getfilename_afterMaxSorting(nr); } 30a46: a3 96 adiw r28, 0x23 ; 35 30a48: 0f b6 in r0, 0x3f ; 63 30a4a: f8 94 cli 30a4c: de bf out 0x3e, r29 ; 62 30a4e: 0f be out 0x3f, r0 ; 63 30a50: cd bf out 0x3d, r28 ; 61 30a52: df 91 pop r29 30a54: cf 91 pop r28 30a56: 0f 91 pop r16 30a58: 08 95 ret void CardReader::getfilename_afterMaxSorting(uint16_t entry, const char * const match/*=NULL*/) { curDir = &workDir; 30a5a: 4b e3 ldi r20, 0x3B ; 59 30a5c: 55 e1 ldi r21, 0x15 ; 21 30a5e: 50 93 3a 15 sts 0x153A, r21 ; 0x80153a 30a62: 40 93 39 15 sts 0x1539, r20 ; 0x801539 nrFiles = entry - sort_count + 1; 30a66: 82 1b sub r24, r18 30a68: 93 0b sbc r25, r19 30a6a: 01 96 adiw r24, 0x01 ; 1 30a6c: 90 93 a9 17 sts 0x17A9, r25 ; 0x8017a9 30a70: 80 93 a8 17 sts 0x17A8, r24 ; 0x8017a8 curDir->seekSet(lastSortedFilePosition << 5); 30a74: 40 91 fb 16 lds r20, 0x16FB ; 0x8016fb 30a78: 50 91 fc 16 lds r21, 0x16FC ; 0x8016fc 30a7c: 85 e0 ldi r24, 0x05 ; 5 30a7e: 44 0f add r20, r20 30a80: 55 1f adc r21, r21 30a82: 8a 95 dec r24 30a84: e1 f7 brne .-8 ; 0x30a7e 30a86: 70 e0 ldi r23, 0x00 ; 0 30a88: 60 e0 ldi r22, 0x00 ; 0 30a8a: 8b e3 ldi r24, 0x3B ; 59 30a8c: 95 e1 ldi r25, 0x15 ; 21 30a8e: 0f 94 92 56 call 0x2ad24 ; 0x2ad24 }; struct ls_param { bool LFN : 1; bool timestamp : 1; inline ls_param():LFN(0), timestamp(0) { } 30a92: 00 e0 ldi r16, 0x00 ; 0 30a94: 0e 7f andi r16, 0xFE ; 254 30a96: 0d 7f andi r16, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 30a98: e0 91 39 15 lds r30, 0x1539 ; 0x801539 30a9c: f0 91 3a 15 lds r31, 0x153A ; 0x80153a 30aa0: 83 e2 ldi r24, 0x23 ; 35 30aa2: de 01 movw r26, r28 30aa4: 11 96 adiw r26, 0x01 ; 1 30aa6: 01 90 ld r0, Z+ 30aa8: 0d 92 st X+, r0 30aaa: 8a 95 dec r24 30aac: e1 f7 brne .-8 ; 0x30aa6 30aae: 22 e0 ldi r18, 0x02 ; 2 30ab0: 50 e0 ldi r21, 0x00 ; 0 30ab2: 40 e0 ldi r20, 0x00 ; 0 30ab4: be 01 movw r22, r28 30ab6: 6f 5f subi r22, 0xFF ; 255 30ab8: 7f 4f sbci r23, 0xFF ; 255 30aba: 88 ef ldi r24, 0xF8 ; 248 30abc: 92 e0 ldi r25, 0x02 ; 2 30abe: 0f 94 0f 77 call 0x2ee1e ; 0x2ee1e 30ac2: ce 01 movw r24, r28 30ac4: 01 96 adiw r24, 0x01 ; 1 30ac6: 0e 94 31 77 call 0xee62 ; 0xee62 30aca: bd cf rjmp .-134 ; 0x30a46 00030acc : SERIAL_PROTOCOL(fname); SERIAL_PROTOCOLLN('.'); } } void CardReader::openFileWrite(const char* name) 30acc: 0f 93 push r16 30ace: 1f 93 push r17 30ad0: cf 93 push r28 30ad2: df 93 push r29 30ad4: 1f 92 push r1 30ad6: 1f 92 push r1 30ad8: cd b7 in r28, 0x3d ; 61 30ada: de b7 in r29, 0x3e ; 62 { if(!mounted) 30adc: 20 91 91 14 lds r18, 0x1491 ; 0x801491 30ae0: 22 23 and r18, r18 30ae2: 69 f1 breq .+90 ; 0x30b3e 30ae4: 8c 01 movw r16, r24 return; if(file.isOpen()){ //replacing current file by new file, or subfile call 30ae6: 80 91 23 17 lds r24, 0x1723 ; 0x801723 30aea: 88 23 and r24, r24 30aec: 79 f1 breq .+94 ; 0x30b4c SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; file_subcall_ctr++; file.close(); #else SERIAL_ECHOLNPGM("File already opened"); 30aee: 8b e4 ldi r24, 0x4B ; 75 30af0: 98 ea ldi r25, 0xA8 ; 168 30af2: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 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; 30af6: 10 92 90 14 sts 0x1490, r1 ; 0x801490 const char *fname=name; 30afa: 1a 83 std Y+2, r17 ; 0x02 30afc: 09 83 std Y+1, r16 ; 0x01 if (!diveSubfolder(fname)) 30afe: ce 01 movw r24, r28 30b00: 01 96 adiw r24, 0x01 ; 1 30b02: 0f 94 c6 7e call 0x2fd8c ; 0x2fd8c 30b06: 88 23 and r24, r24 30b08: d1 f0 breq .+52 ; 0x30b3e return; //write if (!file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)){ 30b0a: 49 81 ldd r20, Y+1 ; 0x01 30b0c: 5a 81 ldd r21, Y+2 ; 0x02 30b0e: 60 91 39 15 lds r22, 0x1539 ; 0x801539 30b12: 70 91 3a 15 lds r23, 0x153A ; 0x80153a 30b16: 26 e5 ldi r18, 0x56 ; 86 30b18: 80 e2 ldi r24, 0x20 ; 32 30b1a: 97 e1 ldi r25, 0x17 ; 23 30b1c: 0f 94 18 64 call 0x2c830 ; 0x2c830 30b20: 81 11 cpse r24, r1 30b22: 22 c0 rjmp .+68 ; 0x30b68 SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); 30b24: 81 ec ldi r24, 0xC1 ; 193 30b26: 90 e7 ldi r25, 0x70 ; 112 30b28: 0e 94 50 77 call 0xeea0 ; 0xeea0 30b2c: 89 81 ldd r24, Y+1 ; 0x01 30b2e: 9a 81 ldd r25, Y+2 ; 0x02 30b30: 0e 94 14 88 call 0x11028 ; 0x11028 30b34: 8e e2 ldi r24, 0x2E ; 46 30b36: 0e 94 37 77 call 0xee6e ; 0xee6e } void MarlinSerial::println(char c, int base) { print(c, base); println(); 30b3a: 0f 94 fd d5 call 0x3abfa ; 0x3abfa SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED lcd_setstatuspgm(ofFileSelected); scrollstuff = 0; } } 30b3e: 0f 90 pop r0 30b40: 0f 90 pop r0 30b42: df 91 pop r29 30b44: cf 91 pop r28 30b46: 1f 91 pop r17 30b48: 0f 91 pop r16 30b4a: 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 30b4c: 10 92 43 17 sts 0x1743, r1 ; 0x801743 SERIAL_ECHO_START; 30b50: 82 ec ldi r24, 0xC2 ; 194 30b52: 9b ea ldi r25, 0xAB ; 171 30b54: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHORPGM(ofNowFreshFile); 30b58: 80 e5 ldi r24, 0x50 ; 80 30b5a: 9a ea ldi r25, 0xAA ; 170 30b5c: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHOLN(name); 30b60: c8 01 movw r24, r16 30b62: 0f 94 00 d6 call 0x3ac00 ; 0x3ac00 30b66: c7 cf rjmp .-114 ; 0x30af6 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; 30b68: 81 e0 ldi r24, 0x01 ; 1 30b6a: 80 93 8e 14 sts 0x148E, r24 ; 0x80148e getfilename(0, fname); 30b6e: 89 81 ldd r24, Y+1 ; 0x01 30b70: 9a 81 ldd r25, Y+2 ; 0x02 30b72: 0f 94 3e 79 call 0x2f27c ; 0x2f27c SERIAL_PROTOCOLRPGM(ofWritingToFile);////MSG_SD_WRITE_TO_FILE 30b76: 89 e3 ldi r24, 0x39 ; 57 30b78: 98 ea ldi r25, 0xA8 ; 168 30b7a: 0e 94 50 77 call 0xeea0 ; 0xeea0 printAbsFilenameFast(); 30b7e: 0f 94 21 7a call 0x2f442 ; 0x2f442 SERIAL_PROTOCOLLN(); 30b82: 0f 94 fd d5 call 0x3abfa ; 0x3abfa SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED 30b86: 8c e2 ldi r24, 0x2C ; 44 30b88: 9a ea ldi r25, 0xAA ; 170 30b8a: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 lcd_setstatuspgm(ofFileSelected); 30b8e: 8c e2 ldi r24, 0x2C ; 44 30b90: 9a ea ldi r25, 0xAA ; 170 30b92: 0e 94 5d f1 call 0x1e2ba ; 0x1e2ba scrollstuff = 0; 30b96: 10 92 b9 0d sts 0x0DB9, r1 ; 0x800db9 30b9a: d1 cf rjmp .-94 ; 0x30b3e 00030b9c : //presort(); #endif } } bool CardReader::ToshibaFlashAir_GetIP(uint8_t *ip) 30b9c: 0f 93 push r16 30b9e: 1f 93 push r17 30ba0: cf 93 push r28 30ba2: df 93 push r29 30ba4: ec 01 movw r28, r24 { memset(ip, 0, 4); 30ba6: 84 e0 ldi r24, 0x04 ; 4 30ba8: fe 01 movw r30, r28 30baa: 11 92 st Z+, r1 30bac: 8a 95 dec r24 30bae: e9 f7 brne .-6 ; 0x30baa /** 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 30bb0: 23 e0 ldi r18, 0x03 ; 3 30bb2: 30 ea ldi r19, 0xA0 ; 160 30bb4: 4a e0 ldi r20, 0x0A ; 10 30bb6: 50 e9 ldi r21, 0x90 ; 144 30bb8: 60 e3 ldi r22, 0x30 ; 48 30bba: 8d ef ldi r24, 0xFD ; 253 30bbc: 96 e1 ldi r25, 0x16 ; 22 30bbe: 0f 94 51 52 call 0x2a4a2 ; 0x2a4a2 30bc2: 88 23 and r24, r24 30bc4: 91 f0 breq .+36 ; 0x30bea 30bc6: 23 e0 ldi r18, 0x03 ; 3 30bc8: 30 ea ldi r19, 0xA0 ; 160 30bca: 4a e0 ldi r20, 0x0A ; 10 30bcc: 50 e9 ldi r21, 0x90 ; 144 30bce: 61 e1 ldi r22, 0x11 ; 17 30bd0: 8d ef ldi r24, 0xFD ; 253 30bd2: 96 e1 ldi r25, 0x16 ; 22 30bd4: 0f 94 51 52 call 0x2a4a2 ; 0x2a4a2 30bd8: 88 23 and r24, r24 30bda: 39 f0 breq .+14 ; 0x30bea bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 30bdc: 80 e8 ldi r24, 0x80 ; 128 30bde: 80 93 fd 16 sts 0x16FD, r24 ; 0x8016fd chipSelectHigh(); spiSend(0xFF); // dummy clock to force FlashAir finish the command. return true; fail: chipSelectHigh(); 30be2: 0f 94 bf 74 call 0x2e97e ; 0x2e97e return false; 30be6: 80 e0 ldi r24, 0x00 ; 0 30be8: 2f c0 rjmp .+94 ; 0x30c48 //------------------------------------------------------------------------------ /** 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(); 30bea: 0f 94 4c 29 call 0x25298 ; 0x25298 30bee: 8b 01 movw r16, r22 while ((status_ = spiRec()) == 0XFF) { 30bf0: 0f 94 4a 52 call 0x2a494 ; 0x2a494 30bf4: 80 93 ff 16 sts 0x16FF, r24 ; 0x8016ff 30bf8: 8f 3f cpi r24, 0xFF ; 255 30bfa: 69 f4 brne .+26 ; 0x30c16 if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { 30bfc: 0f 94 4c 29 call 0x25298 ; 0x25298 30c00: 60 1b sub r22, r16 30c02: 71 0b sbc r23, r17 30c04: 6d 32 cpi r22, 0x2D ; 45 30c06: 71 40 sbci r23, 0x01 ; 1 30c08: 98 f3 brcs .-26 ; 0x30bf0 30c0a: 81 e1 ldi r24, 0x11 ; 17 30c0c: 80 93 fd 16 sts 0x16FD, r24 ; 0x8016fd goto fail; } return true; fail: chipSelectHigh(); 30c10: 0f 94 bf 74 call 0x2e97e ; 0x2e97e 30c14: e6 cf rjmp .-52 ; 0x30be2 if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { error(SD_CARD_ERROR_READ_TIMEOUT); goto fail; } } if (status_ != DATA_START_BLOCK) { 30c16: 8e 3f cpi r24, 0xFE ; 254 30c18: 11 f0 breq .+4 ; 0x30c1e 30c1a: 8f e0 ldi r24, 0x0F ; 15 30c1c: f7 cf rjmp .-18 ; 0x30c0c 30c1e: 8e 01 movw r16, r28 30c20: 0c 5f subi r16, 0xFC ; 252 30c22: 1f 4f sbci r17, 0xFF ; 255 goto fail; } // receive data for (i = 0; i < count; ++i) { dst[i] = spiRec(); 30c24: 0f 94 4a 52 call 0x2a494 ; 0x2a494 30c28: 89 93 st Y+, r24 if (!waitStartBlock()) { goto fail; } // receive data for (i = 0; i < count; ++i) { 30c2a: c0 17 cp r28, r16 30c2c: d1 07 cpc r29, r17 30c2e: d1 f7 brne .-12 ; 0x30c24 30c30: ce ef ldi r28, 0xFE ; 254 30c32: d1 e0 ldi r29, 0x01 ; 1 dst[i] = spiRec(); } // skip dummy bytes and 16-bit crc. for (; i < 514; ++i) { spiRec(); 30c34: 0f 94 4a 52 call 0x2a494 ; 0x2a494 30c38: 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) { 30c3a: e1 f7 brne .-8 ; 0x30c34 spiRec(); } chipSelectHigh(); 30c3c: 0f 94 bf 74 call 0x2e97e ; 0x2e97e spiSend(0xFF); // dummy clock to force FlashAir finish the command. 30c40: 8f ef ldi r24, 0xFF ; 255 30c42: 0f 94 45 52 call 0x2a48a ; 0x2a48a 30c46: 81 e0 ldi r24, 0x01 ; 1 return card.readExtMemory(1, 1, 0x400+0x150, 4, ip); } 30c48: df 91 pop r29 30c4a: cf 91 pop r28 30c4c: 1f 91 pop r17 30c4e: 0f 91 pop r16 30c50: 08 95 ret 00030c52 : } 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) 30c52: 8f 92 push r8 30c54: 9f 92 push r9 30c56: af 92 push r10 30c58: bf 92 push r11 30c5a: cf 92 push r12 30c5c: df 92 push r13 30c5e: ef 92 push r14 30c60: ff 92 push r15 30c62: 0f 93 push r16 30c64: 1f 93 push r17 30c66: cf 93 push r28 30c68: df 93 push r29 30c6a: 1f 92 push r1 30c6c: cd b7 in r28, 0x3d ; 61 30c6e: de b7 in r29, 0x3e ; 62 30c70: 6b 01 movw r12, r22 30c72: 7c 01 movw r14, r24 30c74: 49 01 movw r8, r18 30c76: 5a 01 movw r10, r20 { #if defined(DEBUG_DCODE6) || defined(DEBUG_DCODES) || defined(XFLASH_DUMP) if(type == dcode_mem_t::xflash) 30c78: 03 30 cpi r16, 0x03 ; 3 30c7a: 19 f4 brne .+6 ; 0x30c82 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 30c7c: 8c e5 ldi r24, 0x5C ; 92 30c7e: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 30c80: 1d bc out 0x2d, r1 ; 45 XFLASH_SPI_ENTER(); #endif while (count) 30c82: 81 14 cp r8, r1 30c84: 91 04 cpc r9, r1 30c86: a1 04 cpc r10, r1 30c88: b1 04 cpc r11, r1 30c8a: 09 f4 brne .+2 ; 0x30c8e 30c8c: 59 c0 rjmp .+178 ; 0x30d40 #endif void print_hex_word(daddr_t val) { #if DADDR_SIZE > 16 print_hex_byte((val >> 16) & 0xFF); 30c8e: 8e 2d mov r24, r14 30c90: 0e 94 b1 76 call 0xed62 ; 0xed62 #endif print_hex_byte((val >> 8) & 0xFF); 30c94: 8d 2d mov r24, r13 30c96: 0e 94 b1 76 call 0xed62 ; 0xed62 print_hex_byte(val & 0xFF); 30c9a: 8c 2d mov r24, r12 30c9c: 0e 94 b1 76 call 0xed62 ; 0xed62 XFLASH_SPI_ENTER(); #endif while (count) { print_hex_word(address); putchar(' '); 30ca0: 60 91 1c 18 lds r22, 0x181C ; 0x80181c <__iob+0x2> 30ca4: 70 91 1d 18 lds r23, 0x181D ; 0x80181d <__iob+0x3> 30ca8: 80 e2 ldi r24, 0x20 ; 32 30caa: 90 e0 ldi r25, 0x00 ; 0 30cac: 0f 94 84 da call 0x3b508 ; 0x3b508 uint8_t count_line = countperline; 30cb0: 10 e1 ldi r17, 0x10 ; 16 while (count && count_line) { uint8_t data = 0; 30cb2: 19 82 std Y+1, r1 ; 0x01 switch (type) 30cb4: 01 30 cpi r16, 0x01 ; 1 30cb6: b1 f1 breq .+108 ; 0x30d24 30cb8: 88 f1 brcs .+98 ; 0x30d1c 30cba: 03 30 cpi r16, 0x03 ; 3 30cbc: b9 f1 breq .+110 ; 0x30d2c case dcode_mem_t::xflash: xflash_rd_data(address, &data, 1); break; #else case dcode_mem_t::xflash: break; #endif } ++address; 30cbe: 8f ef ldi r24, 0xFF ; 255 30cc0: c8 1a sub r12, r24 30cc2: d8 0a sbc r13, r24 30cc4: e8 0a sbc r14, r24 30cc6: f8 0a sbc r15, r24 putchar(' '); 30cc8: 60 91 1c 18 lds r22, 0x181C ; 0x80181c <__iob+0x2> 30ccc: 70 91 1d 18 lds r23, 0x181D ; 0x80181d <__iob+0x3> 30cd0: 80 e2 ldi r24, 0x20 ; 32 30cd2: 90 e0 ldi r25, 0x00 ; 0 30cd4: 0f 94 84 da call 0x3b508 ; 0x3b508 print_hex_byte(data); 30cd8: 89 81 ldd r24, Y+1 ; 0x01 30cda: 0e 94 b1 76 call 0xed62 ; 0xed62 count_line--; 30cde: 11 50 subi r17, 0x01 ; 1 count--; 30ce0: 81 e0 ldi r24, 0x01 ; 1 30ce2: 88 1a sub r8, r24 30ce4: 91 08 sbc r9, r1 30ce6: a1 08 sbc r10, r1 30ce8: 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)) 30cea: 0f b6 in r0, 0x3f ; 63 30cec: 07 fe sbrs r0, 7 30cee: 06 c0 rjmp .+12 ; 0x30cfc 30cf0: c4 01 movw r24, r8 30cf2: 9f 71 andi r25, 0x1F ; 31 30cf4: 89 2b or r24, r25 30cf6: 11 f4 brne .+4 ; 0x30cfc manage_heater(); 30cf8: 0f 94 5c 38 call 0x270b8 ; 0x270b8 while (count) { print_hex_word(address); putchar(' '); uint8_t count_line = countperline; while (count && count_line) 30cfc: 81 14 cp r8, r1 30cfe: 91 04 cpc r9, r1 30d00: a1 04 cpc r10, r1 30d02: b1 04 cpc r11, r1 30d04: 11 f0 breq .+4 ; 0x30d0a 30d06: 11 11 cpse r17, r1 30d08: d4 cf rjmp .-88 ; 0x30cb2 // 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'); 30d0a: 60 91 1c 18 lds r22, 0x181C ; 0x80181c <__iob+0x2> 30d0e: 70 91 1d 18 lds r23, 0x181D ; 0x80181d <__iob+0x3> 30d12: 8a e0 ldi r24, 0x0A ; 10 30d14: 90 e0 ldi r25, 0x00 ; 0 30d16: 0f 94 84 da call 0x3b508 ; 0x3b508 30d1a: b3 cf rjmp .-154 ; 0x30c82 while (count && count_line) { uint8_t data = 0; switch (type) { case dcode_mem_t::sram: data = *((uint8_t*)address); break; 30d1c: f6 01 movw r30, r12 30d1e: 80 81 ld r24, Z case dcode_mem_t::eeprom: data = eeprom_read_byte((uint8_t*)address); break; 30d20: 89 83 std Y+1, r24 ; 0x01 30d22: cd cf rjmp .-102 ; 0x30cbe 30d24: c6 01 movw r24, r12 30d26: 0f 94 1c dc call 0x3b838 ; 0x3b838 30d2a: fa cf rjmp .-12 ; 0x30d20 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; 30d2c: 21 e0 ldi r18, 0x01 ; 1 30d2e: 30 e0 ldi r19, 0x00 ; 0 30d30: ae 01 movw r20, r28 30d32: 4f 5f subi r20, 0xFF ; 255 30d34: 5f 4f sbci r21, 0xFF ; 255 30d36: c7 01 movw r24, r14 30d38: b6 01 movw r22, r12 30d3a: 0e 94 e7 ec call 0x1d9ce ; 0x1d9ce 30d3e: bf cf rjmp .-130 ; 0x30cbe if((SREG & (1 << SREG_I)) && !((uint16_t)count % 8192)) manage_heater(); } putchar('\n'); } } 30d40: 0f 90 pop r0 30d42: df 91 pop r29 30d44: cf 91 pop r28 30d46: 1f 91 pop r17 30d48: 0f 91 pop r16 30d4a: ff 90 pop r15 30d4c: ef 90 pop r14 30d4e: df 90 pop r13 30d50: cf 90 pop r12 30d52: bf 90 pop r11 30d54: af 90 pop r10 30d56: 9f 90 pop r9 30d58: 8f 90 pop r8 30d5a: 08 95 ret 00030d5c : #include "planner.h" #include "temperature.h" #include "ultralcd.h" #ifdef FILAMENT_SENSOR FSensorBlockRunout::FSensorBlockRunout() { 30d5c: cf 93 push r28 30d5e: 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; 30d60: ca ea ldi r28, 0xAA ; 170 30d62: d7 e1 ldi r29, 0x17 ; 23 30d64: 1a 82 std Y+2, r1 ; 0x02 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 30d66: 19 82 std Y+1, r1 ; 0x01 return fsensorDetected; } #endif void PAT9125_sensor::setJamDetectionEnabled(bool state, bool updateEEPROM) { jamDetection = state; 30d68: 1e 86 std Y+14, r1 ; 0x0e oldPos = pat9125_y; 30d6a: 80 91 8f 0e lds r24, 0x0E8F ; 0x800e8f 30d6e: 90 91 90 0e lds r25, 0x0E90 ; 0x800e90 30d72: 98 8b std Y+16, r25 ; 0x10 30d74: 8f 87 std Y+15, r24 ; 0x0f resetStepCount(); 30d76: 0f 94 ea 7a call 0x2f5d4 ; 0x2f5d4 jamErrCnt = 0; 30d7a: 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"); } 30d7c: df 91 pop r29 30d7e: cf 91 pop r28 30d80: 08 95 ret 00030d82 : //! //! @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) 30d82: cf 92 push r12 30d84: df 92 push r13 30d86: ef 92 push r14 30d88: ff 92 push r15 30d8a: 69 01 movw r12, r18 30d8c: 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); 30d8e: 2d ec ldi r18, 0xCD ; 205 30d90: 3c ec ldi r19, 0xCC ; 204 30d92: 4c e4 ldi r20, 0x4C ; 76 30d94: 5e e3 ldi r21, 0x3E ; 62 30d96: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 30d9a: 2d ec ldi r18, 0xCD ; 205 30d9c: 3c ec ldi r19, 0xCC ; 204 30d9e: 4c e4 ldi r20, 0x4C ; 76 30da0: 5e e3 ldi r21, 0x3E ; 62 30da2: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 30da6: 2d ef ldi r18, 0xFD ; 253 30da8: 3d ea ldi r19, 0xAD ; 173 30daa: 40 e0 ldi r20, 0x00 ; 0 30dac: 5d e3 ldi r21, 0x3D ; 61 30dae: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 30db2: a7 01 movw r20, r14 30db4: 96 01 movw r18, r12 30db6: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 30dba: 24 e2 ldi r18, 0x24 ; 36 30dbc: 30 ef ldi r19, 0xF0 ; 240 30dbe: 49 e1 ldi r20, 0x19 ; 25 30dc0: 50 e4 ldi r21, 0x40 ; 64 30dc2: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> } 30dc6: ff 90 pop r15 30dc8: ef 90 pop r14 30dca: df 90 pop r13 30dcc: cf 90 pop r12 30dce: 08 95 ret 00030dd0 : //! //! 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) 30dd0: 2f 92 push r2 30dd2: 3f 92 push r3 30dd4: 4f 92 push r4 30dd6: 5f 92 push r5 30dd8: 6f 92 push r6 30dda: 7f 92 push r7 30ddc: 8f 92 push r8 30dde: 9f 92 push r9 30de0: af 92 push r10 30de2: bf 92 push r11 30de4: cf 92 push r12 30de6: df 92 push r13 30de8: ef 92 push r14 30dea: ff 92 push r15 30dec: 0f 93 push r16 30dee: 1f 93 push r17 30df0: cf 93 push r28 30df2: df 93 push r29 30df4: 00 d0 rcall .+0 ; 0x30df6 30df6: 1f 92 push r1 30df8: 1f 92 push r1 30dfa: cd b7 in r28, 0x3d ; 61 30dfc: de b7 in r29, 0x3e ; 62 30dfe: 8c 83 std Y+4, r24 ; 0x04 30e00: 4a 01 movw r8, r20 30e02: 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); 30e04: 23 e4 ldi r18, 0x43 ; 67 30e06: 3d ec ldi r19, 0xCD ; 205 30e08: 4f e2 ldi r20, 0x2F ; 47 30e0a: 5d e3 ldi r21, 0x3D ; 61 30e0c: cb 01 movw r24, r22 30e0e: b4 01 movw r22, r8 30e10: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 30e14: 6b 01 movw r12, r22 30e16: 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); 30e18: 20 e0 ldi r18, 0x00 ; 0 30e1a: 30 e0 ldi r19, 0x00 ; 0 30e1c: 40 ea ldi r20, 0xA0 ; 160 30e1e: 51 e4 ldi r21, 0x41 ; 65 30e20: c5 01 movw r24, r10 30e22: b4 01 movw r22, r8 30e24: 0f 94 c1 86 call 0x30d82 ; 0x30d82 30e28: 56 2e mov r5, r22 30e2a: 47 2e mov r4, r23 30e2c: 38 2e mov r3, r24 30e2e: 29 2e mov r2, r25 const float short_extrusion = count_e(layer_height, extrusion_width, short_length); 30e30: a7 01 movw r20, r14 30e32: 96 01 movw r18, r12 30e34: c5 01 movw r24, r10 30e36: b4 01 movw r22, r8 30e38: 0f 94 c1 86 call 0x30d82 ; 0x30d82 30e3c: 69 83 std Y+1, r22 ; 0x01 30e3e: 7a 83 std Y+2, r23 ; 0x02 30e40: 8b 83 std Y+3, r24 ; 0x03 30e42: 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) 30e44: bc 80 ldd r11, Y+4 ; 0x04 30e46: 8b 2d mov r24, r11 30e48: 90 e0 ldi r25, 0x00 ; 0 30e4a: 9c 01 movw r18, r24 30e4c: 2d 5f subi r18, 0xFD ; 253 30e4e: 3f 4f sbci r19, 0xFF ; 255 30e50: 3d 83 std Y+5, r19 ; 0x05 30e52: 2c 83 std Y+4, r18 ; 0x04 30e54: 0b 2d mov r16, r11 30e56: 10 e0 ldi r17, 0x00 ; 0 30e58: 8c 81 ldd r24, Y+4 ; 0x04 30e5a: 9d 81 ldd r25, Y+5 ; 0x05 30e5c: 80 17 cp r24, r16 30e5e: 91 07 cpc r25, r17 30e60: 0c f4 brge .+2 ; 0x30e64 30e62: a1 c0 rjmp .+322 ; 0x30fa6 { enquecommandf_P(fmt1, 70, (35 - i*short_length * 2), long_extrusion); 30e64: 2f 92 push r2 30e66: 3f 92 push r3 30e68: 4f 92 push r4 30e6a: 5f 92 push r5 30e6c: b8 01 movw r22, r16 30e6e: 01 2e mov r0, r17 30e70: 00 0c add r0, r0 30e72: 88 0b sbc r24, r24 30e74: 99 0b sbc r25, r25 30e76: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 30e7a: a7 01 movw r20, r14 30e7c: 96 01 movw r18, r12 30e7e: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 30e82: 9b 01 movw r18, r22 30e84: ac 01 movw r20, r24 30e86: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 30e8a: 9b 01 movw r18, r22 30e8c: ac 01 movw r20, r24 30e8e: 60 e0 ldi r22, 0x00 ; 0 30e90: 70 e0 ldi r23, 0x00 ; 0 30e92: 8c e0 ldi r24, 0x0C ; 12 30e94: 92 e4 ldi r25, 0x42 ; 66 30e96: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 30e9a: 9f 93 push r25 30e9c: 8f 93 push r24 30e9e: 7f 93 push r23 30ea0: 6f 93 push r22 30ea2: 1f 92 push r1 30ea4: 96 e4 ldi r25, 0x46 ; 70 30ea6: 9f 93 push r25 30ea8: 24 e2 ldi r18, 0x24 ; 36 30eaa: 38 ea ldi r19, 0xA8 ; 168 30eac: 3f 93 push r19 30eae: 2f 93 push r18 30eb0: 0e 94 b6 88 call 0x1116c ; 0x1116c enquecommandf_P(fmt1, 70, (35 - (2 * i + 1)*short_length), short_extrusion); 30eb4: b8 01 movw r22, r16 30eb6: 66 0f add r22, r22 30eb8: 77 1f adc r23, r23 30eba: 6f 5f subi r22, 0xFF ; 255 30ebc: 7f 4f sbci r23, 0xFF ; 255 30ebe: 07 2e mov r0, r23 30ec0: 00 0c add r0, r0 30ec2: 88 0b sbc r24, r24 30ec4: 99 0b sbc r25, r25 30ec6: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 30eca: a7 01 movw r20, r14 30ecc: 96 01 movw r18, r12 30ece: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 30ed2: 9b 01 movw r18, r22 30ed4: ac 01 movw r20, r24 30ed6: 60 e0 ldi r22, 0x00 ; 0 30ed8: 70 e0 ldi r23, 0x00 ; 0 30eda: 8c e0 ldi r24, 0x0C ; 12 30edc: 92 e4 ldi r25, 0x42 ; 66 30ede: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 30ee2: 96 2e mov r9, r22 30ee4: 87 2e mov r8, r23 30ee6: 78 2e mov r7, r24 30ee8: 69 2e mov r6, r25 30eea: af 92 push r10 30eec: 9b 81 ldd r25, Y+3 ; 0x03 30eee: 9f 93 push r25 30ef0: 2a 81 ldd r18, Y+2 ; 0x02 30ef2: 2f 93 push r18 30ef4: 39 81 ldd r19, Y+1 ; 0x01 30ef6: 3f 93 push r19 30ef8: 6f 92 push r6 30efa: 7f 92 push r7 30efc: 8f 92 push r8 30efe: 9f 92 push r9 30f00: 1f 92 push r1 30f02: 86 e4 ldi r24, 0x46 ; 70 30f04: 8f 93 push r24 30f06: 24 e2 ldi r18, 0x24 ; 36 30f08: 38 ea ldi r19, 0xA8 ; 168 30f0a: 3f 93 push r19 30f0c: 2f 93 push r18 30f0e: 0e 94 b6 88 call 0x1116c ; 0x1116c enquecommandf_P(fmt1, 50, (35 - (2 * i + 1)*short_length), long_extrusion); 30f12: 2f 92 push r2 30f14: 3f 92 push r3 30f16: 4f 92 push r4 30f18: 5f 92 push r5 30f1a: 6f 92 push r6 30f1c: 7f 92 push r7 30f1e: 8f 92 push r8 30f20: 9f 92 push r9 30f22: 1f 92 push r1 30f24: 92 e3 ldi r25, 0x32 ; 50 30f26: 9f 93 push r25 30f28: 24 e2 ldi r18, 0x24 ; 36 30f2a: 38 ea ldi r19, 0xA8 ; 168 30f2c: 3f 93 push r19 30f2e: 2f 93 push r18 30f30: 0e 94 b6 88 call 0x1116c ; 0x1116c enquecommandf_P(fmt1, 50, (35 - (i + 1)*short_length * 2), short_extrusion); 30f34: 0f b6 in r0, 0x3f ; 63 30f36: f8 94 cli 30f38: de bf out 0x3e, r29 ; 62 30f3a: 0f be out 0x3f, r0 ; 63 30f3c: cd bf out 0x3d, r28 ; 61 30f3e: af 92 push r10 30f40: 3b 81 ldd r19, Y+3 ; 0x03 30f42: 3f 93 push r19 30f44: 8a 81 ldd r24, Y+2 ; 0x02 30f46: 8f 93 push r24 30f48: 99 81 ldd r25, Y+1 ; 0x01 30f4a: 9f 93 push r25 30f4c: b8 01 movw r22, r16 30f4e: 6f 5f subi r22, 0xFF ; 255 30f50: 7f 4f sbci r23, 0xFF ; 255 30f52: 07 2e mov r0, r23 30f54: 00 0c add r0, r0 30f56: 88 0b sbc r24, r24 30f58: 99 0b sbc r25, r25 30f5a: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 30f5e: a7 01 movw r20, r14 30f60: 96 01 movw r18, r12 30f62: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 30f66: 9b 01 movw r18, r22 30f68: ac 01 movw r20, r24 30f6a: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 30f6e: 9b 01 movw r18, r22 30f70: ac 01 movw r20, r24 30f72: 60 e0 ldi r22, 0x00 ; 0 30f74: 70 e0 ldi r23, 0x00 ; 0 30f76: 8c e0 ldi r24, 0x0C ; 12 30f78: 92 e4 ldi r25, 0x42 ; 66 30f7a: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 30f7e: 9f 93 push r25 30f80: 8f 93 push r24 30f82: 7f 93 push r23 30f84: 6f 93 push r22 30f86: 1f 92 push r1 30f88: 22 e3 ldi r18, 0x32 ; 50 30f8a: 2f 93 push r18 30f8c: 84 e2 ldi r24, 0x24 ; 36 30f8e: 98 ea ldi r25, 0xA8 ; 168 30f90: 9f 93 push r25 30f92: 8f 93 push r24 30f94: 0e 94 b6 88 call 0x1116c ; 0x1116c 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) 30f98: b3 94 inc r11 30f9a: 0f b6 in r0, 0x3f ; 63 30f9c: f8 94 cli 30f9e: de bf out 0x3e, r29 ; 62 30fa0: 0f be out 0x3f, r0 ; 63 30fa2: cd bf out 0x3d, r28 ; 61 30fa4: 57 cf rjmp .-338 ; 0x30e54 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); } } 30fa6: 0f 90 pop r0 30fa8: 0f 90 pop r0 30faa: 0f 90 pop r0 30fac: 0f 90 pop r0 30fae: 0f 90 pop r0 30fb0: df 91 pop r29 30fb2: cf 91 pop r28 30fb4: 1f 91 pop r17 30fb6: 0f 91 pop r16 30fb8: ff 90 pop r15 30fba: ef 90 pop r14 30fbc: df 90 pop r13 30fbe: cf 90 pop r12 30fc0: bf 90 pop r11 30fc2: af 90 pop r10 30fc4: 9f 90 pop r9 30fc6: 8f 90 pop r8 30fc8: 7f 90 pop r7 30fca: 6f 90 pop r6 30fcc: 5f 90 pop r5 30fce: 4f 90 pop r4 30fd0: 3f 90 pop r3 30fd2: 2f 90 pop r2 30fd4: 08 95 ret 00030fd6 : } } void st_set_position(const long *pos) { CRITICAL_SECTION_START; 30fd6: 9f b7 in r25, 0x3f ; 63 30fd8: 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)); 30fda: 80 e1 ldi r24, 0x10 ; 16 30fdc: e3 ea ldi r30, 0xA3 ; 163 30fde: f6 e0 ldi r31, 0x06 ; 6 30fe0: a3 eb ldi r26, 0xB3 ; 179 30fe2: b6 e0 ldi r27, 0x06 ; 6 30fe4: 01 90 ld r0, Z+ 30fe6: 0d 92 st X+, r0 30fe8: 8a 95 dec r24 30fea: e1 f7 brne .-8 ; 0x30fe4 CRITICAL_SECTION_END; 30fec: 9f bf out 0x3f, r25 ; 63 } 30fee: 08 95 ret 00030ff0 : #include "sound.h" namespace MMU2 { void BeginReport(CommandInProgress /*cip*/, ProgressCode ec) { custom_message_type = CustomMsg::MMUProgress; 30ff0: 89 e0 ldi r24, 0x09 ; 9 30ff2: 80 93 c4 06 sts 0x06C4, r24 ; 0x8006c4 }; 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])) 30ff6: e1 e6 ldi r30, 0x61 ; 97 30ff8: f8 ea ldi r31, 0xA8 ; 168 30ffa: 85 91 lpm r24, Z+ 30ffc: 94 91 lpm r25, Z lcd_setstatuspgm( _T(ProgressCodeToText(ec)) ); 30ffe: 0e 94 ac 72 call 0xe558 ; 0xe558 31002: 0c 94 5d f1 jmp 0x1e2ba ; 0x1e2ba 00031006 : 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){ 31006: cf 93 push r28 31008: c8 2f mov r28, r24 extruder = ex; 3100a: 80 93 a1 13 sts 0x13A1, r24 ; 0x8013a1 MMU2_ECHO_MSGRPGM(PSTR("MMU2tool=")); 3100e: 82 ec ldi r24, 0xC2 ; 194 31010: 9b ea ldi r25, 0xAB ; 171 31012: 0e 94 50 77 call 0xeea0 ; 0xeea0 31016: 8e e1 ldi r24, 0x1E ; 30 31018: 98 ea ldi r25, 0xA8 ; 168 3101a: 0e 94 50 77 call 0xeea0 ; 0xeea0 3101e: 84 e1 ldi r24, 0x14 ; 20 31020: 98 ea ldi r25, 0xA8 ; 168 31022: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHOLN((int)ex); 31026: 8c 2f mov r24, r28 31028: 90 e0 ldi r25, 0x00 ; 0 } 3102a: cf 91 pop r28 } void MMU2::SetCurrentTool(uint8_t ex){ extruder = ex; MMU2_ECHO_MSGRPGM(PSTR("MMU2tool=")); SERIAL_ECHOLN((int)ex); 3102c: 0d 94 f5 74 jmp 0x2e9ea ; 0x2e9ea 00031030 : tmc2130_sg_measure = 0xff; return tmc2130_sg_measure_val / tmc2130_sg_measure_cnt; } bool tmc2130_wait_standstill_xy(int timeout) 31030: 0f 93 push r16 31032: 1f 93 push r17 31034: cf 93 push r28 31036: df 93 push r29 31038: 00 d0 rcall .+0 ; 0x3103a 3103a: 00 d0 rcall .+0 ; 0x3103c 3103c: 1f 92 push r1 3103e: 1f 92 push r1 31040: cd b7 in r28, 0x3d ; 61 31042: de b7 in r29, 0x3e ; 62 31044: 08 ee ldi r16, 0xE8 ; 232 31046: 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; 31048: 1d 82 std Y+5, r1 ; 0x05 3104a: 1e 82 std Y+6, r1 ; 0x06 3104c: 1f 82 std Y+7, r1 ; 0x07 3104e: 18 86 std Y+8, r1 ; 0x08 uint32_t drv_status_y = 0; 31050: 19 82 std Y+1, r1 ; 0x01 31052: 1a 82 std Y+2, r1 ; 0x02 31054: 1b 82 std Y+3, r1 ; 0x03 31056: 1c 82 std Y+4, r1 ; 0x04 tmc2130_rd(X_AXIS, TMC2130_REG_DRV_STATUS, &drv_status_x); 31058: ae 01 movw r20, r28 3105a: 4b 5f subi r20, 0xFB ; 251 3105c: 5f 4f sbci r21, 0xFF ; 255 3105e: 6f e6 ldi r22, 0x6F ; 111 31060: 80 e0 ldi r24, 0x00 ; 0 31062: 0f 94 f1 23 call 0x247e2 ; 0x247e2 tmc2130_rd(Y_AXIS, TMC2130_REG_DRV_STATUS, &drv_status_y); 31066: ae 01 movw r20, r28 31068: 4f 5f subi r20, 0xFF ; 255 3106a: 5f 4f sbci r21, 0xFF ; 255 3106c: 6f e6 ldi r22, 0x6F ; 111 3106e: 81 e0 ldi r24, 0x01 ; 1 31070: 0f 94 f1 23 call 0x247e2 ; 0x247e2 // 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); 31074: 8d 81 ldd r24, Y+5 ; 0x05 31076: 9e 81 ldd r25, Y+6 ; 0x06 31078: af 81 ldd r26, Y+7 ; 0x07 3107a: b8 85 ldd r27, Y+8 ; 0x08 3107c: b7 fd sbrc r27, 7 3107e: 07 c0 rjmp .+14 ; 0x3108e tmc2130_check_overtemp(); 31080: 0f 94 e7 29 call 0x253ce ; 0x253ce 31084: 01 50 subi r16, 0x01 ; 1 31086: 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)) 31088: f9 f6 brne .-66 ; 0x31048 3108a: 80 e0 ldi r24, 0x00 ; 0 3108c: 09 c0 rjmp .+18 ; 0x310a0 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); 3108e: 89 81 ldd r24, Y+1 ; 0x01 31090: 9a 81 ldd r25, Y+2 ; 0x02 31092: ab 81 ldd r26, Y+3 ; 0x03 31094: bc 81 ldd r27, Y+4 ; 0x04 31096: b7 ff sbrs r27, 7 31098: f3 cf rjmp .-26 ; 0x31080 tmc2130_check_overtemp(); 3109a: 0f 94 e7 29 call 0x253ce ; 0x253ce 3109e: 81 e0 ldi r24, 0x01 ; 1 timeout--; } return standstill; } 310a0: 28 96 adiw r28, 0x08 ; 8 310a2: 0f b6 in r0, 0x3f ; 63 310a4: f8 94 cli 310a6: de bf out 0x3e, r29 ; 62 310a8: 0f be out 0x3f, r0 ; 63 310aa: cd bf out 0x3d, r28 ; 61 310ac: df 91 pop r29 310ae: cf 91 pop r28 310b0: 1f 91 pop r17 310b2: 0f 91 pop r16 310b4: 08 95 ret 000310b6 : 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) { 310b6: 1f 93 push r17 310b8: cf 93 push r28 310ba: df 93 push r29 310bc: ec 01 movw r28, r24 310be: 16 2f mov r17, r22 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 310c0: 0f 94 e8 42 call 0x285d0 ; 0x285d0 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))); 310c4: fe 01 movw r30, r28 310c6: 34 96 adiw r30, 0x04 ; 4 310c8: 25 91 lpm r18, Z+ 310ca: 35 91 lpm r19, Z+ 310cc: 45 91 lpm r20, Z+ 310ce: 54 91 lpm r21, Z 310d0: fe 01 movw r30, r28 310d2: 65 91 lpm r22, Z+ 310d4: 75 91 lpm r23, Z+ 310d6: 85 91 lpm r24, Z+ 310d8: 94 91 lpm r25, Z 310da: 0f 94 b1 c5 call 0x38b62 ; 0x38b62 step++; 310de: 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) { 310e0: 11 50 subi r17, 0x01 ; 1 310e2: 81 f7 brne .-32 ; 0x310c4 310e4: 0f 94 e8 42 call 0x285d0 ; 0x285d0 // 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(); } 310e8: df 91 pop r29 310ea: cf 91 pop r28 310ec: 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(); 310ee: 0d 94 af c5 jmp 0x38b5e ; 0x38b5e 000310f2 : } void EndReport(CommandInProgress /*cip*/, ProgressCode /*ec*/) { // clear the status msg line - let the printed filename get visible again if (!printJobOngoing()) { 310f2: 0e 94 90 67 call 0xcf20 ; 0xcf20 310f6: 81 11 cpse r24, r1 310f8: 04 c0 rjmp .+8 ; 0x31102 lcd_setstatuspgm(MSG_WELCOME); 310fa: 83 e7 ldi r24, 0x73 ; 115 310fc: 90 e7 ldi r25, 0x70 ; 112 310fe: 0e 94 5d f1 call 0x1e2ba ; 0x1e2ba } custom_message_type = CustomMsg::Status; 31102: 10 92 c4 06 sts 0x06C4, r1 ; 0x8006c4 } 31106: 08 95 ret 00031108 : EndReport(cip, ProgressCode::OK); } }; bool MMU2::WaitForMMUReady() { switch (State()) { 31108: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 3110c: 88 23 and r24, r24 3110e: 11 f0 breq .+4 ; 0x31114 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; 31110: 81 e0 ldi r24, 0x01 ; 1 31112: 08 95 ret }; bool MMU2::WaitForMMUReady() { switch (State()) { case xState::Stopped: return false; 31114: 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; } } 31116: 08 95 ret 00031118 : } 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) 31118: 2f 92 push r2 3111a: 3f 92 push r3 3111c: 4f 92 push r4 3111e: 5f 92 push r5 31120: 6f 92 push r6 31122: 7f 92 push r7 31124: 8f 92 push r8 31126: 9f 92 push r9 31128: af 92 push r10 3112a: bf 92 push r11 3112c: cf 92 push r12 3112e: df 92 push r13 31130: ef 92 push r14 31132: ff 92 push r15 31134: 0f 93 push r16 31136: 1f 93 push r17 31138: cf 93 push r28 3113a: df 93 push r29 3113c: cd b7 in r28, 0x3d ; 61 3113e: de b7 in r29, 0x3e ; 62 31140: 2d 97 sbiw r28, 0x0d ; 13 31142: 0f b6 in r0, 0x3f ; 63 31144: f8 94 cli 31146: de bf out 0x3e, r29 ; 62 31148: 0f be out 0x3f, r0 ; 63 3114a: cd bf out 0x3d, r28 ; 61 3114c: 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; 3114e: 41 2c mov r4, r1 31150: 51 2c mov r5, r1 31152: 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; 31154: 6e 31 cpi r22, 0x1E ; 30 31156: 90 f0 brcs .+36 ; 0x3117c 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 31158: 69 3c cpi r22, 0xC9 ; 201 3115a: 08 f0 brcs .+2 ; 0x3115e 3115c: 68 ec ldi r22, 0xC8 ; 200 3115e: 70 e0 ldi r23, 0x00 ; 0 31160: 68 51 subi r22, 0x18 ; 24 31162: 7c 4f sbci r23, 0xFC ; 252 31164: 90 e0 ldi r25, 0x00 ; 0 31166: 80 e0 ldi r24, 0x00 ; 0 31168: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 3116c: 20 e0 ldi r18, 0x00 ; 0 3116e: 30 e0 ldi r19, 0x00 ; 0 31170: 4a e7 ldi r20, 0x7A ; 122 31172: 54 e4 ldi r21, 0x44 ; 68 31174: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 31178: 2b 01 movw r4, r22 3117a: 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) 3117c: 80 91 bf 02 lds r24, 0x02BF ; 0x8002bf 31180: 90 91 c0 02 lds r25, 0x02C0 ; 0x8002c0 31184: a0 91 c1 02 lds r26, 0x02C1 ; 0x8002c1 31188: b0 91 c2 02 lds r27, 0x02C2 ; 0x8002c2 3118c: 89 83 std Y+1, r24 ; 0x01 3118e: 9a 83 std Y+2, r25 ; 0x02 31190: ab 83 std Y+3, r26 ; 0x03 31192: bc 83 std Y+4, r27 ; 0x04 uint8_t x[3] = {255,255,255}; //X segment bounds (MSLUTSEL) 31194: 80 91 c3 02 lds r24, 0x02C3 ; 0x8002c3 31198: 90 91 c4 02 lds r25, 0x02C4 ; 0x8002c4 3119c: a0 91 c5 02 lds r26, 0x02C5 ; 0x8002c5 311a0: 8d 83 std Y+5, r24 ; 0x05 311a2: 9e 83 std Y+6, r25 ; 0x06 311a4: 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); 311a6: 20 e0 ldi r18, 0x00 ; 0 311a8: 30 e0 ldi r19, 0x00 ; 0 311aa: 47 ef ldi r20, 0xF7 ; 247 311ac: 50 e0 ldi r21, 0x00 ; 0 311ae: 69 ee ldi r22, 0xE9 ; 233 311b0: 8e 2d mov r24, r14 311b2: 0f 94 4b 24 call 0x24896 ; 0x24896 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 311b6: 81 2c mov r8, r1 311b8: 91 2c mov r9, r1 311ba: 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 311bc: 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 311be: 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 311c0: 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 311c2: 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 311c4: 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) 311c6: 2f 2c mov r2, r15 311c8: 31 2c mov r3, r1 311ca: 8f 2d mov r24, r15 311cc: 8f 71 andi r24, 0x1F ; 31 311ce: 88 87 std Y+8, r24 ; 0x08 311d0: 81 11 cpse r24, r1 311d2: 03 c0 rjmp .+6 ; 0x311da reg = 0; 311d4: 81 2c mov r8, r1 311d6: 91 2c mov r9, r1 311d8: 54 01 movw r10, r8 311da: b1 01 movw r22, r2 311dc: 03 2c mov r0, r3 311de: 00 0c add r0, r0 311e0: 88 0b sbc r24, r24 311e2: 99 0b sbc r25, r25 311e4: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 311e8: 2b ed ldi r18, 0xDB ; 219 311ea: 3f e0 ldi r19, 0x0F ; 15 311ec: 49 ec ldi r20, 0xC9 ; 201 311ee: 50 e4 ldi r21, 0x40 ; 64 311f0: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 311f4: 6a 87 std Y+10, r22 ; 0x0a 311f6: 7b 87 std Y+11, r23 ; 0x0b 311f8: 8c 87 std Y+12, r24 ; 0x0c 311fa: 9d 87 std Y+13, r25 ; 0x0d // calculate value if (fac == 0) // default TMC wave 311fc: 20 e0 ldi r18, 0x00 ; 0 311fe: 30 e0 ldi r19, 0x00 ; 0 31200: a9 01 movw r20, r18 31202: c3 01 movw r24, r6 31204: b2 01 movw r22, r4 31206: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 3120a: 81 11 cpse r24, r1 3120c: 4d c0 rjmp .+154 ; 0x312a8 vA = (uint8_t)((amp+1) * sin((2*PI*i + PI)/1024) + 0.5) - 1; 3120e: 2b ed ldi r18, 0xDB ; 219 31210: 3f e0 ldi r19, 0x0F ; 15 31212: 49 e4 ldi r20, 0x49 ; 73 31214: 50 e4 ldi r21, 0x40 ; 64 31216: 6a 85 ldd r22, Y+10 ; 0x0a 31218: 7b 85 ldd r23, Y+11 ; 0x0b 3121a: 8c 85 ldd r24, Y+12 ; 0x0c 3121c: 9d 85 ldd r25, Y+13 ; 0x0d 3121e: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 31222: 20 e0 ldi r18, 0x00 ; 0 31224: 30 e0 ldi r19, 0x00 ; 0 31226: 40 e8 ldi r20, 0x80 ; 128 31228: 5a e3 ldi r21, 0x3A ; 58 3122a: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 3122e: 0f 94 04 e1 call 0x3c208 ; 0x3c208 31232: 20 e0 ldi r18, 0x00 ; 0 31234: 30 e0 ldi r19, 0x00 ; 0 31236: 48 e7 ldi r20, 0x78 ; 120 31238: 53 e4 ldi r21, 0x43 ; 67 3123a: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 3123e: 20 e0 ldi r18, 0x00 ; 0 31240: 30 e0 ldi r19, 0x00 ; 0 31242: 40 e0 ldi r20, 0x00 ; 0 31244: 5f e3 ldi r21, 0x3F ; 63 31246: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 3124a: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 3124e: cc 24 eor r12, r12 31250: ca 94 dec r12 31252: 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 31254: 8c 2d mov r24, r12 31256: 99 85 ldd r25, Y+9 ; 0x09 31258: 89 1b sub r24, r25 va = vA; b = -1; if (dA == d0) b = 0; //delta == delta0 => bit=0 3125a: 8d 15 cp r24, r13 3125c: f9 f0 breq .+62 ; 0x3129c else if (dA == d1) b = 1; //delta == delta1 => bit=1 3125e: 80 17 cp r24, r16 31260: 09 f4 brne .+2 ; 0x31264 31262: 71 c0 rjmp .+226 ; 0x31346 else { if (dA < d0) // delta < delta0 => switch wbit down 31264: 8d 15 cp r24, r13 31266: 0c f0 brlt .+2 ; 0x3126a 31268: 53 c0 rjmp .+166 ; 0x31310 { //printf("dn\n"); b = 0; switch (dA) 3126a: 88 23 and r24, r24 3126c: e9 f1 breq .+122 ; 0x312e8 3126e: 81 30 cpi r24, 0x01 ; 1 31270: 09 f4 brne .+2 ; 0x31274 31272: 44 c0 rjmp .+136 ; 0x312fc 31274: 8f 3f cpi r24, 0xFF ; 255 31276: 09 f0 breq .+2 ; 0x3127a 31278: 81 c0 rjmp .+258 ; 0x3137c { case -1: d0 = -1; d1 = 0; w[s+1] = 0; break; 3127a: e2 e0 ldi r30, 0x02 ; 2 3127c: f0 e0 ldi r31, 0x00 ; 0 3127e: ec 0f add r30, r28 31280: fd 1f adc r31, r29 31282: e1 0f add r30, r17 31284: f1 1d adc r31, r1 31286: 10 82 st Z, r1 31288: 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++; } 3128a: e5 e0 ldi r30, 0x05 ; 5 3128c: f0 e0 ldi r31, 0x00 ; 0 3128e: ec 0f add r30, r28 31290: fd 1f adc r31, r29 31292: e1 0f add r30, r17 31294: f1 1d adc r31, r1 31296: f0 82 st Z, r15 31298: 1f 5f subi r17, 0xFF ; 255 3129a: 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) 3129c: 14 30 cpi r17, 0x04 ; 4 3129e: 08 f4 brcc .+2 ; 0x312a2 312a0: 56 c0 rjmp .+172 ; 0x3134e 312a2: 6c c0 rjmp .+216 ; 0x3137c 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); 312a4: f8 2e mov r15, r24 312a6: 8f cf rjmp .-226 ; 0x311c6 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); 312a8: 20 e0 ldi r18, 0x00 ; 0 312aa: 30 e0 ldi r19, 0x00 ; 0 312ac: 40 e8 ldi r20, 0x80 ; 128 312ae: 5a e3 ldi r21, 0x3A ; 58 312b0: 6a 85 ldd r22, Y+10 ; 0x0a 312b2: 7b 85 ldd r23, Y+11 ; 0x0b 312b4: 8c 85 ldd r24, Y+12 ; 0x0c 312b6: 9d 85 ldd r25, Y+13 ; 0x0d 312b8: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 312bc: 0f 94 04 e1 call 0x3c208 ; 0x3c208 312c0: a3 01 movw r20, r6 312c2: 92 01 movw r18, r4 312c4: 0f 94 b4 e0 call 0x3c168 ; 0x3c168 312c8: 20 e0 ldi r18, 0x00 ; 0 312ca: 30 e0 ldi r19, 0x00 ; 0 312cc: 47 e7 ldi r20, 0x77 ; 119 312ce: 53 e4 ldi r21, 0x43 ; 67 312d0: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 312d4: 20 e0 ldi r18, 0x00 ; 0 312d6: 30 e0 ldi r19, 0x00 ; 0 312d8: 40 e0 ldi r20, 0x00 ; 0 312da: 5f e3 ldi r21, 0x3F ; 63 312dc: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 312e0: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 312e4: c6 2e mov r12, r22 312e6: b6 cf rjmp .-148 ; 0x31254 //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; 312e8: e2 e0 ldi r30, 0x02 ; 2 312ea: f0 e0 ldi r31, 0x00 ; 0 312ec: ec 0f add r30, r28 312ee: fd 1f adc r31, r29 312f0: e1 0f add r30, r17 312f2: f1 1d adc r31, r1 312f4: 91 e0 ldi r25, 0x01 ; 1 312f6: 90 83 st Z, r25 312f8: 01 e0 ldi r16, 0x01 ; 1 312fa: c7 cf rjmp .-114 ; 0x3128a case 1: d0 = 1; d1 = 2; w[s+1] = 2; break; 312fc: e2 e0 ldi r30, 0x02 ; 2 312fe: f0 e0 ldi r31, 0x00 ; 0 31300: ec 0f add r30, r28 31302: fd 1f adc r31, r29 31304: e1 0f add r30, r17 31306: f1 1d adc r31, r1 31308: 92 e0 ldi r25, 0x02 ; 2 3130a: 90 83 st Z, r25 3130c: 02 e0 ldi r16, 0x02 ; 2 3130e: bd cf rjmp .-134 ; 0x3128a default: b = -1; break; } if (b >= 0) { x[s] = i; s++; } } else if (dA > d1) // delta > delta0 => switch wbit up 31310: 08 17 cp r16, r24 31312: a4 f5 brge .+104 ; 0x3137c { //printf("up\n"); b = 1; switch (dA) 31314: 82 30 cpi r24, 0x02 ; 2 31316: 09 f4 brne .+2 ; 0x3131a 31318: 80 c0 rjmp .+256 ; 0x3141a 3131a: 83 30 cpi r24, 0x03 ; 3 3131c: 09 f4 brne .+2 ; 0x31320 3131e: 88 c0 rjmp .+272 ; 0x31430 31320: 81 30 cpi r24, 0x01 ; 1 31322: 61 f5 brne .+88 ; 0x3137c { case 1: d0 = 0; d1 = 1; w[s+1] = 1; break; 31324: e2 e0 ldi r30, 0x02 ; 2 31326: f0 e0 ldi r31, 0x00 ; 0 31328: ec 0f add r30, r28 3132a: fd 1f adc r31, r29 3132c: e1 0f add r30, r17 3132e: f1 1d adc r31, r1 31330: 80 83 st Z, r24 31332: 01 e0 ldi r16, 0x01 ; 1 31334: 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++; } 31336: e5 e0 ldi r30, 0x05 ; 5 31338: f0 e0 ldi r31, 0x00 ; 0 3133a: ec 0f add r30, r28 3133c: fd 1f adc r31, r29 3133e: e1 0f add r30, r17 31340: f1 1d adc r31, r1 31342: f0 82 st Z, r15 31344: 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) 31346: 14 30 cpi r17, 0x04 ; 4 31348: c8 f4 brcc .+50 ; 0x3137c //printf("%d\n", vA); if (b == 1) reg |= 0x80000000; 3134a: 68 94 set 3134c: b7 f8 bld r11, 7 if ((i & 31) == 31) 3134e: 88 85 ldd r24, Y+8 ; 0x08 31350: 8f 31 cpi r24, 0x1F ; 31 31352: 09 f0 breq .+2 ; 0x31356 31354: 78 c0 rjmp .+240 ; 0x31446 tmc2130_wr_MSLUT(axis, (uint8_t)(i >> 5), reg); 31356: b1 01 movw r22, r2 31358: e5 e0 ldi r30, 0x05 ; 5 3135a: 75 95 asr r23 3135c: 67 95 ror r22 3135e: ea 95 dec r30 31360: e1 f7 brne .-8 ; 0x3135a //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); 31362: 60 5a subi r22, 0xA0 ; 160 31364: 60 68 ori r22, 0x80 ; 128 31366: a5 01 movw r20, r10 31368: 94 01 movw r18, r8 3136a: 8e 2d mov r24, r14 3136c: 0f 94 4b 24 call 0x24896 ; 0x24896 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); 31370: 81 e0 ldi r24, 0x01 ; 1 31372: 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; 31374: 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); 31376: 9f ef ldi r25, 0xFF ; 255 31378: f9 12 cpse r15, r25 3137a: 94 cf rjmp .-216 ; 0x312a4 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; 3137c: 2a 81 ldd r18, Y+2 ; 0x02 3137e: 30 e0 ldi r19, 0x00 ; 0 31380: 50 e0 ldi r21, 0x00 ; 0 31382: 40 e0 ldi r20, 0x00 ; 0 31384: 82 e0 ldi r24, 0x02 ; 2 31386: 22 0f add r18, r18 31388: 33 1f adc r19, r19 3138a: 44 1f adc r20, r20 3138c: 55 1f adc r21, r21 3138e: 8a 95 dec r24 31390: d1 f7 brne .-12 ; 0x31386 val |= ((uint32_t)w2) << 4; 31392: 8b 80 ldd r8, Y+3 ; 0x03 31394: 91 2c mov r9, r1 31396: b1 2c mov r11, r1 31398: a1 2c mov r10, r1 3139a: 94 e0 ldi r25, 0x04 ; 4 3139c: 88 0c add r8, r8 3139e: 99 1c adc r9, r9 313a0: aa 1c adc r10, r10 313a2: bb 1c adc r11, r11 313a4: 9a 95 dec r25 313a6: d1 f7 brne .-12 ; 0x3139c 313a8: 82 2a or r8, r18 313aa: 93 2a or r9, r19 313ac: a4 2a or r10, r20 313ae: 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); 313b0: 89 81 ldd r24, Y+1 ; 0x01 val |= ((uint32_t)w1) << 2; val |= ((uint32_t)w2) << 4; 313b2: 88 2a or r8, r24 val |= ((uint32_t)w3) << 6; 313b4: 8c 81 ldd r24, Y+4 ; 0x04 313b6: 90 e0 ldi r25, 0x00 ; 0 313b8: b0 e0 ldi r27, 0x00 ; 0 313ba: a0 e0 ldi r26, 0x00 ; 0 313bc: 9c 01 movw r18, r24 313be: ad 01 movw r20, r26 313c0: 66 e0 ldi r22, 0x06 ; 6 313c2: 22 0f add r18, r18 313c4: 33 1f adc r19, r19 313c6: 44 1f adc r20, r20 313c8: 55 1f adc r21, r21 313ca: 6a 95 dec r22 313cc: d1 f7 brne .-12 ; 0x313c2 313ce: 28 29 or r18, r8 313d0: 39 29 or r19, r9 313d2: 4a 29 or r20, r10 313d4: 5b 29 or r21, r11 val |= ((uint32_t)x1) << 8; 313d6: 8d 81 ldd r24, Y+5 ; 0x05 313d8: 38 2b or r19, r24 val |= ((uint32_t)x2) << 16; 313da: 8e 81 ldd r24, Y+6 ; 0x06 313dc: 48 2b or r20, r24 val |= ((uint32_t)x3) << 24; 313de: 8f 81 ldd r24, Y+7 ; 0x07 313e0: 58 2b or r21, r24 tmc2130_wr(axis, TMC2130_REG_MSLUTSEL, val); 313e2: 68 ee ldi r22, 0xE8 ; 232 313e4: 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]); } 313e6: 2d 96 adiw r28, 0x0d ; 13 313e8: 0f b6 in r0, 0x3f ; 63 313ea: f8 94 cli 313ec: de bf out 0x3e, r29 ; 62 313ee: 0f be out 0x3f, r0 ; 63 313f0: cd bf out 0x3d, r28 ; 61 313f2: df 91 pop r29 313f4: cf 91 pop r28 313f6: 1f 91 pop r17 313f8: 0f 91 pop r16 313fa: ff 90 pop r15 313fc: ef 90 pop r14 313fe: df 90 pop r13 31400: cf 90 pop r12 31402: bf 90 pop r11 31404: af 90 pop r10 31406: 9f 90 pop r9 31408: 8f 90 pop r8 3140a: 7f 90 pop r7 3140c: 6f 90 pop r6 3140e: 5f 90 pop r5 31410: 4f 90 pop r4 31412: 3f 90 pop r3 31414: 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); 31416: 0d 94 4b 24 jmp 0x24896 ; 0x24896 //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; 3141a: e2 e0 ldi r30, 0x02 ; 2 3141c: f0 e0 ldi r31, 0x00 ; 0 3141e: ec 0f add r30, r28 31420: fd 1f adc r31, r29 31422: e1 0f add r30, r17 31424: f1 1d adc r31, r1 31426: 80 83 st Z, r24 31428: 02 e0 ldi r16, 0x02 ; 2 3142a: dd 24 eor r13, r13 3142c: d3 94 inc r13 3142e: 83 cf rjmp .-250 ; 0x31336 case 3: d0 = 2; d1 = 3; w[s+1] = 3; break; 31430: e2 e0 ldi r30, 0x02 ; 2 31432: f0 e0 ldi r31, 0x00 ; 0 31434: ec 0f add r30, r28 31436: fd 1f adc r31, r29 31438: e1 0f add r30, r17 3143a: f1 1d adc r31, r1 3143c: 80 83 st Z, r24 3143e: 03 e0 ldi r16, 0x03 ; 3 31440: f2 e0 ldi r31, 0x02 ; 2 31442: df 2e mov r13, r31 31444: 78 cf rjmp .-272 ; 0x31336 //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; 31446: b6 94 lsr r11 31448: a7 94 ror r10 3144a: 97 94 ror r9 3144c: 87 94 ror r8 3144e: 90 cf rjmp .-224 ; 0x31370 00031450 : { previous_millis_cmd.start(); } #ifdef FWRETRACT void retract(bool retracting, bool swapretract = false) { 31450: 8f 92 push r8 31452: 9f 92 push r9 31454: af 92 push r10 31456: bf 92 push r11 31458: cf 92 push r12 3145a: df 92 push r13 3145c: ef 92 push r14 3145e: ff 92 push r15 31460: 90 91 8e 06 lds r25, 0x068E ; 0x80068e // 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]) { 31464: 88 23 and r24, r24 31466: 09 f4 brne .+2 ; 0x3146a 31468: 9d c0 rjmp .+314 ; 0x315a4 3146a: 91 11 cpse r25, r1 3146c: 92 c0 rjmp .+292 ; 0x31592 st_synchronize(); 3146e: 0f 94 e8 42 call 0x285d0 ; 0x285d0 set_destination_to_current(); 31472: 0e 94 3a 68 call 0xd074 ; 0xd074 current_position[E_AXIS]+=(swapretract?retract_length_swap:cs.retract_length)*float(extrudemultiply)*0.01f; 31476: 60 91 bc 02 lds r22, 0x02BC ; 0x8002bc 3147a: 70 91 bd 02 lds r23, 0x02BD ; 0x8002bd 3147e: 07 2e mov r0, r23 31480: 00 0c add r0, r0 31482: 88 0b sbc r24, r24 31484: 99 0b sbc r25, r25 31486: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 3148a: 20 91 41 0e lds r18, 0x0E41 ; 0x800e41 3148e: 30 91 42 0e lds r19, 0x0E42 ; 0x800e42 31492: 40 91 43 0e lds r20, 0x0E43 ; 0x800e43 31496: 50 91 44 0e lds r21, 0x0E44 ; 0x800e44 3149a: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 3149e: 2a e0 ldi r18, 0x0A ; 10 314a0: 37 ed ldi r19, 0xD7 ; 215 314a2: 43 e2 ldi r20, 0x23 ; 35 314a4: 5c e3 ldi r21, 0x3C ; 60 314a6: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 314aa: 20 91 9e 06 lds r18, 0x069E ; 0x80069e 314ae: 30 91 9f 06 lds r19, 0x069F ; 0x80069f 314b2: 40 91 a0 06 lds r20, 0x06A0 ; 0x8006a0 314b6: 50 91 a1 06 lds r21, 0x06A1 ; 0x8006a1 314ba: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 314be: 60 93 9e 06 sts 0x069E, r22 ; 0x80069e 314c2: 70 93 9f 06 sts 0x069F, r23 ; 0x80069f 314c6: 80 93 a0 06 sts 0x06A0, r24 ; 0x8006a0 314ca: 90 93 a1 06 sts 0x06A1, r25 ; 0x8006a1 plan_set_e_position(current_position[E_AXIS]); 314ce: 8e e9 ldi r24, 0x9E ; 158 314d0: 96 e0 ldi r25, 0x06 ; 6 314d2: 0f 94 be 63 call 0x2c77c ; 0x2c77c float oldFeedrate = feedrate; 314d6: c0 90 b8 02 lds r12, 0x02B8 ; 0x8002b8 314da: d0 90 b9 02 lds r13, 0x02B9 ; 0x8002b9 314de: e0 90 ba 02 lds r14, 0x02BA ; 0x8002ba 314e2: f0 90 bb 02 lds r15, 0x02BB ; 0x8002bb feedrate=cs.retract_feedrate*60; 314e6: 20 e0 ldi r18, 0x00 ; 0 314e8: 30 e0 ldi r19, 0x00 ; 0 314ea: 40 e7 ldi r20, 0x70 ; 112 314ec: 52 e4 ldi r21, 0x42 ; 66 314ee: 60 91 45 0e lds r22, 0x0E45 ; 0x800e45 314f2: 70 91 46 0e lds r23, 0x0E46 ; 0x800e46 314f6: 80 91 47 0e lds r24, 0x0E47 ; 0x800e47 314fa: 90 91 48 0e lds r25, 0x0E48 ; 0x800e48 314fe: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 31502: 60 93 b8 02 sts 0x02B8, r22 ; 0x8002b8 31506: 70 93 b9 02 sts 0x02B9, r23 ; 0x8002b9 3150a: 80 93 ba 02 sts 0x02BA, r24 ; 0x8002ba 3150e: 90 93 bb 02 sts 0x02BB, r25 ; 0x8002bb retracted[active_extruder]=true; 31512: 81 e0 ldi r24, 0x01 ; 1 31514: 80 93 8e 06 sts 0x068E, r24 ; 0x80068e prepare_move(); 31518: 90 e0 ldi r25, 0x00 ; 0 3151a: 80 e0 ldi r24, 0x00 ; 0 3151c: 0e 94 08 6c call 0xd810 ; 0xd810 if(cs.retract_zlift) { 31520: 20 e0 ldi r18, 0x00 ; 0 31522: 30 e0 ldi r19, 0x00 ; 0 31524: a9 01 movw r20, r18 31526: 60 91 49 0e lds r22, 0x0E49 ; 0x800e49 3152a: 70 91 4a 0e lds r23, 0x0E4A ; 0x800e4a 3152e: 80 91 4b 0e lds r24, 0x0E4B ; 0x800e4b 31532: 90 91 4c 0e lds r25, 0x0E4C ; 0x800e4c 31536: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 3153a: 88 23 and r24, r24 3153c: 11 f1 breq .+68 ; 0x31582 st_synchronize(); 3153e: 0f 94 e8 42 call 0x285d0 ; 0x285d0 current_position[Z_AXIS]-=cs.retract_zlift; 31542: 20 91 49 0e lds r18, 0x0E49 ; 0x800e49 31546: 30 91 4a 0e lds r19, 0x0E4A ; 0x800e4a 3154a: 40 91 4b 0e lds r20, 0x0E4B ; 0x800e4b 3154e: 50 91 4c 0e lds r21, 0x0E4C ; 0x800e4c 31552: 60 91 9a 06 lds r22, 0x069A ; 0x80069a 31556: 70 91 9b 06 lds r23, 0x069B ; 0x80069b 3155a: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 3155e: 90 91 9d 06 lds r25, 0x069D ; 0x80069d 31562: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 31566: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a 3156a: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b 3156e: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c 31572: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d plan_set_position_curposXYZE(); 31576: 0f 94 09 bf call 0x37e12 ; 0x37e12 prepare_move(); 3157a: 90 e0 ldi r25, 0x00 ; 0 3157c: 80 e0 ldi r24, 0x00 ; 0 3157e: 0e 94 08 6c call 0xd810 ; 0xd810 } feedrate = oldFeedrate; 31582: c0 92 b8 02 sts 0x02B8, r12 ; 0x8002b8 31586: d0 92 b9 02 sts 0x02B9, r13 ; 0x8002b9 3158a: e0 92 ba 02 sts 0x02BA, r14 ; 0x8002ba 3158e: 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 31592: ff 90 pop r15 31594: ef 90 pop r14 31596: df 90 pop r13 31598: cf 90 pop r12 3159a: bf 90 pop r11 3159c: af 90 pop r10 3159e: 9f 90 pop r9 315a0: 8f 90 pop r8 315a2: 08 95 ret current_position[Z_AXIS]-=cs.retract_zlift; plan_set_position_curposXYZE(); prepare_move(); } feedrate = oldFeedrate; } else if(!retracting && retracted[active_extruder]) { 315a4: 99 23 and r25, r25 315a6: a9 f3 breq .-22 ; 0x31592 st_synchronize(); 315a8: 0f 94 e8 42 call 0x285d0 ; 0x285d0 set_destination_to_current(); 315ac: 0e 94 3a 68 call 0xd074 ; 0xd074 float oldFeedrate = feedrate; 315b0: 80 90 b8 02 lds r8, 0x02B8 ; 0x8002b8 315b4: 90 90 b9 02 lds r9, 0x02B9 ; 0x8002b9 315b8: a0 90 ba 02 lds r10, 0x02BA ; 0x8002ba 315bc: b0 90 bb 02 lds r11, 0x02BB ; 0x8002bb feedrate=cs.retract_recover_feedrate*60; 315c0: 20 e0 ldi r18, 0x00 ; 0 315c2: 30 e0 ldi r19, 0x00 ; 0 315c4: 40 e7 ldi r20, 0x70 ; 112 315c6: 52 e4 ldi r21, 0x42 ; 66 315c8: 60 91 51 0e lds r22, 0x0E51 ; 0x800e51 315cc: 70 91 52 0e lds r23, 0x0E52 ; 0x800e52 315d0: 80 91 53 0e lds r24, 0x0E53 ; 0x800e53 315d4: 90 91 54 0e lds r25, 0x0E54 ; 0x800e54 315d8: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 315dc: 60 93 b8 02 sts 0x02B8, r22 ; 0x8002b8 315e0: 70 93 b9 02 sts 0x02B9, r23 ; 0x8002b9 315e4: 80 93 ba 02 sts 0x02BA, r24 ; 0x8002ba 315e8: 90 93 bb 02 sts 0x02BB, r25 ; 0x8002bb if(cs.retract_zlift) { 315ec: c0 90 49 0e lds r12, 0x0E49 ; 0x800e49 315f0: d0 90 4a 0e lds r13, 0x0E4A ; 0x800e4a 315f4: e0 90 4b 0e lds r14, 0x0E4B ; 0x800e4b 315f8: f0 90 4c 0e lds r15, 0x0E4C ; 0x800e4c 315fc: 20 e0 ldi r18, 0x00 ; 0 315fe: 30 e0 ldi r19, 0x00 ; 0 31600: a9 01 movw r20, r18 31602: c7 01 movw r24, r14 31604: b6 01 movw r22, r12 31606: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 3160a: 88 23 and r24, r24 3160c: e1 f0 breq .+56 ; 0x31646 current_position[Z_AXIS]+=cs.retract_zlift; 3160e: a7 01 movw r20, r14 31610: 96 01 movw r18, r12 31612: 60 91 9a 06 lds r22, 0x069A ; 0x80069a 31616: 70 91 9b 06 lds r23, 0x069B ; 0x80069b 3161a: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 3161e: 90 91 9d 06 lds r25, 0x069D ; 0x80069d 31622: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 31626: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a 3162a: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b 3162e: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c 31632: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d plan_set_position_curposXYZE(); 31636: 0f 94 09 bf call 0x37e12 ; 0x37e12 prepare_move(); 3163a: 90 e0 ldi r25, 0x00 ; 0 3163c: 80 e0 ldi r24, 0x00 ; 0 3163e: 0e 94 08 6c call 0xd810 ; 0xd810 st_synchronize(); 31642: 0f 94 e8 42 call 0x285d0 ; 0x285d0 } current_position[E_AXIS]-=(swapretract?(retract_length_swap+retract_recover_length_swap):(cs.retract_length+cs.retract_recover_length))*float(extrudemultiply)*0.01f; 31646: 20 91 4d 0e lds r18, 0x0E4D ; 0x800e4d 3164a: 30 91 4e 0e lds r19, 0x0E4E ; 0x800e4e 3164e: 40 91 4f 0e lds r20, 0x0E4F ; 0x800e4f 31652: 50 91 50 0e lds r21, 0x0E50 ; 0x800e50 31656: 60 91 41 0e lds r22, 0x0E41 ; 0x800e41 3165a: 70 91 42 0e lds r23, 0x0E42 ; 0x800e42 3165e: 80 91 43 0e lds r24, 0x0E43 ; 0x800e43 31662: 90 91 44 0e lds r25, 0x0E44 ; 0x800e44 31666: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 3166a: 6b 01 movw r12, r22 3166c: 7c 01 movw r14, r24 3166e: 60 91 bc 02 lds r22, 0x02BC ; 0x8002bc 31672: 70 91 bd 02 lds r23, 0x02BD ; 0x8002bd 31676: 07 2e mov r0, r23 31678: 00 0c add r0, r0 3167a: 88 0b sbc r24, r24 3167c: 99 0b sbc r25, r25 3167e: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 31682: 9b 01 movw r18, r22 31684: ac 01 movw r20, r24 31686: c7 01 movw r24, r14 31688: b6 01 movw r22, r12 3168a: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 3168e: 2a e0 ldi r18, 0x0A ; 10 31690: 37 ed ldi r19, 0xD7 ; 215 31692: 43 e2 ldi r20, 0x23 ; 35 31694: 5c e3 ldi r21, 0x3C ; 60 31696: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 3169a: 9b 01 movw r18, r22 3169c: ac 01 movw r20, r24 3169e: 60 91 9e 06 lds r22, 0x069E ; 0x80069e 316a2: 70 91 9f 06 lds r23, 0x069F ; 0x80069f 316a6: 80 91 a0 06 lds r24, 0x06A0 ; 0x8006a0 316aa: 90 91 a1 06 lds r25, 0x06A1 ; 0x8006a1 316ae: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 316b2: 60 93 9e 06 sts 0x069E, r22 ; 0x80069e 316b6: 70 93 9f 06 sts 0x069F, r23 ; 0x80069f 316ba: 80 93 a0 06 sts 0x06A0, r24 ; 0x8006a0 316be: 90 93 a1 06 sts 0x06A1, r25 ; 0x8006a1 plan_set_e_position(current_position[E_AXIS]); 316c2: 8e e9 ldi r24, 0x9E ; 158 316c4: 96 e0 ldi r25, 0x06 ; 6 316c6: 0f 94 be 63 call 0x2c77c ; 0x2c77c retracted[active_extruder]=false; 316ca: 10 92 8e 06 sts 0x068E, r1 ; 0x80068e prepare_move(); 316ce: 90 e0 ldi r25, 0x00 ; 0 316d0: 80 e0 ldi r24, 0x00 ; 0 316d2: 0e 94 08 6c call 0xd810 ; 0xd810 feedrate = oldFeedrate; 316d6: 80 92 b8 02 sts 0x02B8, r8 ; 0x8002b8 316da: 90 92 b9 02 sts 0x02B9, r9 ; 0x8002b9 316de: a0 92 ba 02 sts 0x02BA, r10 ; 0x8002ba 316e2: b0 92 bb 02 sts 0x02BB, r11 ; 0x8002bb 316e6: 55 cf rjmp .-342 ; 0x31592 000316e8 : 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) 316e8: ef 92 push r14 316ea: ff 92 push r15 316ec: 0f 93 push r16 316ee: 1f 93 push r17 316f0: cf 93 push r28 316f2: c8 2f mov r28, r24 316f4: 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; 316f6: 80 91 09 01 lds r24, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> return 0; } uint8_t tmc2130_get_dir(uint8_t axis) { switch (axis) 316fa: c1 30 cpi r28, 0x01 ; 1 316fc: b9 f0 breq .+46 ; 0x3172c 316fe: c2 30 cpi r28, 0x02 ; 2 31700: c1 f0 breq .+48 ; 0x31732 { case X_AXIS: return _GET_DIR_X; case Y_AXIS: return _GET_DIR_Y; 31702: 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) 31704: 48 17 cp r20, r24 31706: 21 f0 breq .+8 ; 0x31710 tmc2130_set_dir(axis, dir); 31708: 64 2f mov r22, r20 3170a: 8c 2f mov r24, r28 3170c: 0f 94 ae 23 call 0x2475c ; 0x2475c 31710: 8b e9 ldi r24, 0x9B ; 155 31712: e8 2e mov r14, r24 31714: 8f e0 ldi r24, 0x0F ; 15 31716: f8 2e mov r15, r24 while (steps--) 31718: 01 50 subi r16, 0x01 ; 1 3171a: 11 09 sbc r17, r1 3171c: 70 f0 brcs .+28 ; 0x3173a { tmc2130_do_step(axis); 3171e: 8c 2f mov r24, r28 31720: 0f 94 9d 23 call 0x2473a ; 0x2473a 31724: c7 01 movw r24, r14 31726: 01 97 sbiw r24, 0x01 ; 1 31728: f1 f7 brne .-4 ; 0x31726 3172a: f6 cf rjmp .-20 ; 0x31718 uint8_t tmc2130_get_dir(uint8_t axis) { switch (axis) { case X_AXIS: return _GET_DIR_X; case Y_AXIS: return _GET_DIR_Y; 3172c: 86 95 lsr r24 3172e: 8c 27 eor r24, r28 31730: e8 cf rjmp .-48 ; 0x31702 case Z_AXIS: return _GET_DIR_Z; 31732: 82 fb bst r24, 2 31734: 88 27 eor r24, r24 31736: 80 f9 bld r24, 0 31738: e5 cf rjmp .-54 ; 0x31704 while (steps--) { tmc2130_do_step(axis); delayMicroseconds(delay_us); } } 3173a: cf 91 pop r28 3173c: 1f 91 pop r17 3173e: 0f 91 pop r16 31740: ff 90 pop r15 31742: ef 90 pop r14 31744: 08 95 ret 00031746 : void tmc2130_goto_step(uint8_t axis, uint8_t step, uint8_t dir, uint16_t delay_us, uint16_t microstep_resolution) 31746: 8f 92 push r8 31748: 9f 92 push r9 3174a: af 92 push r10 3174c: bf 92 push r11 3174e: cf 92 push r12 31750: df 92 push r13 31752: ef 92 push r14 31754: ff 92 push r15 31756: 0f 93 push r16 31758: 1f 93 push r17 3175a: cf 93 push r28 3175c: c8 2f mov r28, r24 3175e: 8a 01 movw r16, r20 { printf_P(PSTR("tmc2130_goto_step %d %d %d %d \n"), axis, step, dir, delay_us, microstep_resolution); 31760: c6 2e mov r12, r22 31762: d1 2c mov r13, r1 31764: 1f 93 push r17 31766: 4f 93 push r20 31768: 83 e0 ldi r24, 0x03 ; 3 3176a: 8f 93 push r24 3176c: 88 ee ldi r24, 0xE8 ; 232 3176e: 8f 93 push r24 31770: 1f 92 push r1 31772: 82 e0 ldi r24, 0x02 ; 2 31774: 8f 93 push r24 31776: 1f 92 push r1 31778: 6f 93 push r22 3177a: 1f 92 push r1 3177c: cf 93 push r28 3177e: 8b ed ldi r24, 0xDB ; 219 31780: 96 ea ldi r25, 0xA6 ; 166 31782: 9f 93 push r25 31784: 8f 93 push r24 31786: 0f 94 de da call 0x3b5bc ; 0x3b5bc 3178a: 8d b7 in r24, 0x3d ; 61 3178c: 9e b7 in r25, 0x3e ; 62 3178e: 0c 96 adiw r24, 0x0c ; 12 31790: 0f b6 in r0, 0x3f ; 63 31792: f8 94 cli 31794: 9e bf out 0x3e, r25 ; 62 31796: 0f be out 0x3f, r0 ; 63 31798: 8d bf out 0x3d, r24 ; 61 3179a: 90 e0 ldi r25, 0x00 ; 0 3179c: 80 e0 ldi r24, 0x00 ; 0 uint8_t shift; for (shift = 0; shift < 8; shift++) if (microstep_resolution == (256u >> shift)) break; 3179e: 40 e0 ldi r20, 0x00 ; 0 317a0: 51 e0 ldi r21, 0x01 ; 1 317a2: 28 2f mov r18, r24 317a4: ba 01 movw r22, r20 317a6: 08 2e mov r0, r24 317a8: 02 c0 rjmp .+4 ; 0x317ae 317aa: 76 95 lsr r23 317ac: 67 95 ror r22 317ae: 0a 94 dec r0 317b0: e2 f7 brpl .-8 ; 0x317aa 317b2: 06 17 cp r16, r22 317b4: 17 07 cpc r17, r23 317b6: 29 f0 breq .+10 ; 0x317c2 317b8: 01 96 adiw r24, 0x01 ; 1 317ba: 88 30 cpi r24, 0x08 ; 8 317bc: 91 05 cpc r25, r1 317be: 89 f7 brne .-30 ; 0x317a2 317c0: 28 e0 ldi r18, 0x08 ; 8 uint16_t cnt = 4 * (1 << (8 - shift)); 317c2: e2 2e mov r14, r18 317c4: f1 2c mov r15, r1 317c6: 88 e0 ldi r24, 0x08 ; 8 317c8: 90 e0 ldi r25, 0x00 ; 0 317ca: 8e 19 sub r24, r14 317cc: 9f 09 sbc r25, r15 317ce: 24 e0 ldi r18, 0x04 ; 4 317d0: 30 e0 ldi r19, 0x00 ; 0 317d2: 59 01 movw r10, r18 317d4: 02 c0 rjmp .+4 ; 0x317da 317d6: aa 0c add r10, r10 317d8: bb 1c adc r11, r11 317da: 8a 95 dec r24 317dc: e2 f7 brpl .-8 ; 0x317d6 uint16_t mscnt = tmc2130_rd_MSCNT(axis); 317de: 8c 2f mov r24, r28 317e0: 0f 94 75 24 call 0x248ea ; 0x248ea 317e4: 9c 01 movw r18, r24 317e6: 90 e0 ldi r25, 0x00 ; 0 317e8: c4 30 cpi r28, 0x04 ; 4 317ea: 28 f4 brcc .+10 ; 0x317f6 317ec: ec 2f mov r30, r28 317ee: f0 e0 ldi r31, 0x00 ; 0 317f0: e1 5e subi r30, 0xE1 ; 225 317f2: fc 4f sbci r31, 0xFC ; 252 317f4: 90 81 ld r25, Z if (dir == 2) { dir = tmc2130_get_inv(axis)?0:1; int steps = (int)step - (int)(mscnt >> shift); 317f6: 0e 2c mov r0, r14 317f8: 02 c0 rjmp .+4 ; 0x317fe 317fa: 36 95 lsr r19 317fc: 27 95 ror r18 317fe: 0a 94 dec r0 31800: e2 f7 brpl .-8 ; 0x317fa 31802: 86 01 movw r16, r12 31804: 02 1b sub r16, r18 31806: 13 0b sbc r17, r19 if (steps > static_cast(cnt / 2)) 31808: 95 01 movw r18, r10 3180a: 36 95 lsr r19 3180c: 27 95 ror r18 { dir ^= 1; 3180e: 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)) 31810: 20 17 cp r18, r16 31812: 31 07 cpc r19, r17 31814: 74 f1 brlt .+92 ; 0x31872 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; 31816: 91 11 cpse r25, r1 31818: 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) 3181a: 17 ff sbrs r17, 7 3181c: 05 c0 rjmp .+10 ; 0x31828 { dir ^= 1; 3181e: 81 e0 ldi r24, 0x01 ; 1 31820: 68 27 eor r22, r24 steps = -steps; 31822: 11 95 neg r17 31824: 01 95 neg r16 31826: 11 09 sbc r17, r1 } cnt = steps; } tmc2130_set_dir(axis, dir); 31828: 8c 2f mov r24, r28 3182a: 0f 94 ae 23 call 0x2475c ; 0x2475c mscnt = tmc2130_rd_MSCNT(axis); 3182e: 8c 2f mov r24, r28 31830: 0f 94 75 24 call 0x248ea ; 0x248ea 31834: b1 2c mov r11, r1 31836: a1 2c mov r10, r1 31838: 2b e9 ldi r18, 0x9B ; 155 3183a: 82 2e mov r8, r18 3183c: 2f e0 ldi r18, 0x0F ; 15 3183e: 92 2e mov r9, r18 while ((cnt--) && ((mscnt >> shift) != step)) 31840: 0a 15 cp r16, r10 31842: 1b 05 cpc r17, r11 31844: f1 f0 breq .+60 ; 0x31882 31846: 2f ef ldi r18, 0xFF ; 255 31848: a2 1a sub r10, r18 3184a: b2 0a sbc r11, r18 3184c: 0e 2c mov r0, r14 3184e: 02 c0 rjmp .+4 ; 0x31854 31850: 96 95 lsr r25 31852: 87 95 ror r24 31854: 0a 94 dec r0 31856: e2 f7 brpl .-8 ; 0x31850 31858: 8c 15 cp r24, r12 3185a: 9d 05 cpc r25, r13 3185c: 91 f0 breq .+36 ; 0x31882 { tmc2130_do_step(axis); 3185e: 8c 2f mov r24, r28 31860: 0f 94 9d 23 call 0x2473a ; 0x2473a 31864: c4 01 movw r24, r8 31866: 01 97 sbiw r24, 0x01 ; 1 31868: f1 f7 brne .-4 ; 0x31866 delayMicroseconds(delay_us); mscnt = tmc2130_rd_MSCNT(axis); 3186a: 8c 2f mov r24, r28 3186c: 0f 94 75 24 call 0x248ea ; 0x248ea 31870: e7 cf rjmp .-50 ; 0x31840 { dir = tmc2130_get_inv(axis)?0:1; int steps = (int)step - (int)(mscnt >> shift); if (steps > static_cast(cnt / 2)) { dir ^= 1; 31872: 91 11 cpse r25, r1 31874: 01 c0 rjmp .+2 ; 0x31878 31876: 60 e0 ldi r22, 0x00 ; 0 steps = cnt - steps; // This can create a negative step value 31878: c5 01 movw r24, r10 3187a: 80 1b sub r24, r16 3187c: 91 0b sbc r25, r17 3187e: 8c 01 movw r16, r24 31880: cc cf rjmp .-104 ; 0x3181a { tmc2130_do_step(axis); delayMicroseconds(delay_us); mscnt = tmc2130_rd_MSCNT(axis); } } 31882: cf 91 pop r28 31884: 1f 91 pop r17 31886: 0f 91 pop r16 31888: ff 90 pop r15 3188a: ef 90 pop r14 3188c: df 90 pop r13 3188e: cf 90 pop r12 31890: bf 90 pop r11 31892: af 90 pop r10 31894: 9f 90 pop r9 31896: 8f 90 pop r8 31898: 08 95 ret 0003189a : #ifdef MESH_BED_LEVELING mesh_bed_leveling mbl; void mesh_bed_leveling::reset() { active = 0; 3189a: 10 92 c2 13 sts 0x13C2, r1 ; 0x8013c2 memset(z_values, 0, sizeof(z_values)); 3189e: e3 ec ldi r30, 0xC3 ; 195 318a0: f3 e1 ldi r31, 0x13 ; 19 318a2: 84 ec ldi r24, 0xC4 ; 196 318a4: df 01 movw r26, r30 318a6: 1d 92 st X+, r1 318a8: 8a 95 dec r24 318aa: e9 f7 brne .-6 ; 0x318a6 } 318ac: 08 95 ret 000318ae : 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 318ae: 2f 92 push r2 318b0: 3f 92 push r3 318b2: 4f 92 push r4 318b4: 5f 92 push r5 318b6: 6f 92 push r6 318b8: 7f 92 push r7 318ba: 8f 92 push r8 318bc: 9f 92 push r9 318be: af 92 push r10 318c0: bf 92 push r11 318c2: cf 92 push r12 318c4: df 92 push r13 318c6: ef 92 push r14 318c8: ff 92 push r15 318ca: 0f 93 push r16 318cc: 1f 93 push r17 318ce: cf 93 push r28 318d0: df 93 push r29 318d2: 00 d0 rcall .+0 ; 0x318d4 318d4: 1f 92 push r1 318d6: cd b7 in r28, 0x3d ; 61 318d8: de b7 in r29, 0x3e ; 62 318da: 4b 01 movw r8, r22 318dc: 5c 01 movw r10, r24 318de: 04 2f mov r16, r20 verbosity_level #endif //SUPPORT_VERBOSITY ) { bool high_deviation_occured = false; bedPWMDisabled = 1; 318e0: 81 e0 ldi r24, 0x01 ; 1 318e2: 80 93 8d 06 sts 0x068D, r24 ; 0x80068d #ifdef TMC2130 bool bHighPowerForced = false; if (tmc2130_mode == TMC2130_MODE_SILENT) 318e6: 80 91 8c 06 lds r24, 0x068C ; 0x80068c ) { bool high_deviation_occured = false; bedPWMDisabled = 1; #ifdef TMC2130 bool bHighPowerForced = false; 318ea: 10 e0 ldi r17, 0x00 ; 0 if (tmc2130_mode == TMC2130_MODE_SILENT) 318ec: 81 30 cpi r24, 0x01 ; 1 318ee: 19 f4 brne .+6 ; 0x318f6 { FORCE_HIGH_POWER_START; 318f0: 0e 94 b0 66 call 0xcd60 ; 0xcd60 bHighPowerForced = true; 318f4: 11 e0 ldi r17, 0x01 ; 1 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 318f6: 20 91 b7 02 lds r18, 0x02B7 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> 318fa: 2a 83 std Y+2, r18 ; 0x02 check_endstops = check; 318fc: 81 e0 ldi r24, 0x01 ; 1 318fe: 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); 31902: 80 e0 ldi r24, 0x00 ; 0 31904: 0f 94 e2 4d call 0x29bc4 ; 0x29bc4 31908: 89 83 std Y+1, r24 ; 0x01 float z = 0.f; endstop_z_hit_on_purpose(); 3190a: 0f 94 f0 4d call 0x29be0 ; 0x29be0 // move down until you find the bed current_position[Z_AXIS] = minimum_z; 3190e: 80 92 9a 06 sts 0x069A, r8 ; 0x80069a 31912: 90 92 9b 06 sts 0x069B, r9 ; 0x80069b 31916: a0 92 9c 06 sts 0x069C, r10 ; 0x80069c 3191a: b0 92 9d 06 sts 0x069D, r11 ; 0x80069d go_to_current(homing_feedrate[Z_AXIS]/60); 3191e: 65 e5 ldi r22, 0x55 ; 85 31920: 75 e5 ldi r23, 0x55 ; 85 31922: 85 e5 ldi r24, 0x55 ; 85 31924: 91 e4 ldi r25, 0x41 ; 65 31926: 0f 94 d1 c5 call 0x38ba2 ; 0x38ba2 // 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(); 3192a: 0f 94 2a cc call 0x39854 ; 0x39854 if (! endstop_z_hit_on_purpose()) 3192e: 0f 94 f0 4d call 0x29be0 ; 0x29be0 31932: 8c 83 std Y+4, r24 ; 0x04 31934: 88 23 and r24, r24 31936: 09 f4 brne .+2 ; 0x3193a 31938: f9 c0 rjmp .+498 ; 0x31b2c { //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)) 3193a: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 3193e: 86 ff sbrs r24, 6 31940: f5 c0 rjmp .+490 ; 0x31b2c { //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) 31942: 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; 31944: c1 2c mov r12, r1 31946: d1 2c mov r13, r1 31948: 76 01 movw r14, r12 #ifdef SUPPORT_VERBOSITY verbosity_level #endif //SUPPORT_VERBOSITY ) { bool high_deviation_occured = false; 3194a: 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) 3194c: 8b 81 ldd r24, Y+3 ; 0x03 3194e: 80 17 cp r24, r16 31950: 08 f0 brcs .+2 ; 0x31954 31952: a8 c0 rjmp .+336 ; 0x31aa4 { current_position[Z_AXIS] += high_deviation_occured ? 0.5 : 0.2; 31954: 60 91 9a 06 lds r22, 0x069A ; 0x80069a 31958: 70 91 9b 06 lds r23, 0x069B ; 0x80069b 3195c: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 31960: 90 91 9d 06 lds r25, 0x069D ; 0x80069d 31964: 20 e0 ldi r18, 0x00 ; 0 31966: 30 e0 ldi r19, 0x00 ; 0 31968: 40 e0 ldi r20, 0x00 ; 0 3196a: 5f e3 ldi r21, 0x3F ; 63 3196c: 31 10 cpse r3, r1 3196e: 04 c0 rjmp .+8 ; 0x31978 31970: 2d ec ldi r18, 0xCD ; 205 31972: 3c ec ldi r19, 0xCC ; 204 31974: 4c e4 ldi r20, 0x4C ; 76 31976: 5e e3 ldi r21, 0x3E ; 62 31978: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 3197c: 2b 01 movw r4, r22 3197e: 3c 01 movw r6, r24 31980: 40 92 9a 06 sts 0x069A, r4 ; 0x80069a 31984: 50 92 9b 06 sts 0x069B, r5 ; 0x80069b 31988: 60 92 9c 06 sts 0x069C, r6 ; 0x80069c 3198c: 70 92 9d 06 sts 0x069D, r7 ; 0x80069d float z_bckp = current_position[Z_AXIS]; go_to_current(homing_feedrate[Z_AXIS]/60); 31990: 65 e5 ldi r22, 0x55 ; 85 31992: 75 e5 ldi r23, 0x55 ; 85 31994: 85 e5 ldi r24, 0x55 ; 85 31996: 91 e4 ldi r25, 0x41 ; 65 31998: 0f 94 d1 c5 call 0x38ba2 ; 0x38ba2 // Move back down slowly to find bed. current_position[Z_AXIS] = minimum_z; 3199c: 80 92 9a 06 sts 0x069A, r8 ; 0x80069a 319a0: 90 92 9b 06 sts 0x069B, r9 ; 0x80069b 319a4: a0 92 9c 06 sts 0x069C, r10 ; 0x80069c 319a8: b0 92 9d 06 sts 0x069D, r11 ; 0x80069d //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)); 319ac: 65 e5 ldi r22, 0x55 ; 85 319ae: 75 e5 ldi r23, 0x55 ; 85 319b0: 85 e5 ldi r24, 0x55 ; 85 319b2: 90 e4 ldi r25, 0x40 ; 64 319b4: 0f 94 d1 c5 call 0x38ba2 ; 0x38ba2 // 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(); 319b8: 0f 94 2a cc call 0x39854 ; 0x39854 //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) { 319bc: a3 01 movw r20, r6 319be: 92 01 movw r18, r4 319c0: 60 91 9a 06 lds r22, 0x069A ; 0x80069a 319c4: 70 91 9b 06 lds r23, 0x069B ; 0x80069b 319c8: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 319cc: 90 91 9d 06 lds r25, 0x069D ; 0x80069d 319d0: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 319d4: 9f 77 andi r25, 0x7F ; 127 319d6: 2d ec ldi r18, 0xCD ; 205 319d8: 3c ec ldi r19, 0xCC ; 204 319da: 4c ec ldi r20, 0xCC ; 204 319dc: 5c e3 ldi r21, 0x3C ; 60 319de: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 319e2: 87 ff sbrs r24, 7 319e4: 16 c0 rjmp .+44 ; 0x31a12 //printf_P(PSTR("PINDA triggered immediately, move Z higher and repeat measurement\n")); raise_z(0.5); 319e6: 60 e0 ldi r22, 0x00 ; 0 319e8: 70 e0 ldi r23, 0x00 ; 0 319ea: 80 e0 ldi r24, 0x00 ; 0 319ec: 9f e3 ldi r25, 0x3F ; 63 319ee: 0e 94 e1 6d call 0xdbc2 ; 0xdbc2 current_position[Z_AXIS] = minimum_z; 319f2: 80 92 9a 06 sts 0x069A, r8 ; 0x80069a 319f6: 90 92 9b 06 sts 0x069B, r9 ; 0x80069b 319fa: a0 92 9c 06 sts 0x069C, r10 ; 0x80069c 319fe: b0 92 9d 06 sts 0x069D, r11 ; 0x80069d go_to_current(homing_feedrate[Z_AXIS]/(4*60)); 31a02: 65 e5 ldi r22, 0x55 ; 85 31a04: 75 e5 ldi r23, 0x55 ; 85 31a06: 85 e5 ldi r24, 0x55 ; 85 31a08: 90 e4 ldi r25, 0x40 ; 64 31a0a: 0f 94 d1 c5 call 0x38ba2 ; 0x38ba2 // 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(); 31a0e: 0f 94 2a cc call 0x39854 ; 0x39854 } if (!endstop_z_hit_on_purpose()) 31a12: 0f 94 f0 4d call 0x29be0 ; 0x29be0 31a16: 28 2e mov r2, r24 31a18: 88 23 and r24, r24 31a1a: 09 f4 brne .+2 ; 0x31a1e 31a1c: 87 c0 rjmp .+270 ; 0x31b2c { //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)) { 31a1e: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 31a22: 86 ff sbrs r24, 6 31a24: 83 c0 rjmp .+262 ; 0x31b2c 31a26: 40 90 9a 06 lds r4, 0x069A ; 0x80069a 31a2a: 50 90 9b 06 lds r5, 0x069B ; 0x80069b 31a2e: 60 90 9c 06 lds r6, 0x069C ; 0x80069c 31a32: 70 90 9d 06 lds r7, 0x069D ; 0x80069d } #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; 31a36: 2b 81 ldd r18, Y+3 ; 0x03 31a38: 22 23 and r18, r18 31a3a: d9 f0 breq .+54 ; 0x31a72 31a3c: 62 2f mov r22, r18 31a3e: 70 e0 ldi r23, 0x00 ; 0 31a40: 90 e0 ldi r25, 0x00 ; 0 31a42: 80 e0 ldi r24, 0x00 ; 0 31a44: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 31a48: 9b 01 movw r18, r22 31a4a: ac 01 movw r20, r24 31a4c: c7 01 movw r24, r14 31a4e: b6 01 movw r22, r12 31a50: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 31a54: 9b 01 movw r18, r22 31a56: ac 01 movw r20, r24 31a58: c3 01 movw r24, r6 31a5a: b2 01 movw r22, r4 31a5c: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 31a60: 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 31a62: 2d ec ldi r18, 0xCD ; 205 31a64: 3c ec ldi r19, 0xCC ; 204 31a66: 4c e4 ldi r20, 0x4C ; 76 31a68: 5d e3 ldi r21, 0x3D ; 61 31a6a: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 31a6e: 18 16 cp r1, r24 31a70: 64 f0 brlt .+24 ; 0x31a8a #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]; 31a72: a3 01 movw r20, r6 31a74: 92 01 movw r18, r4 31a76: c7 01 movw r24, r14 31a78: b6 01 movw r22, r12 31a7a: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 31a7e: 6b 01 movw r12, r22 31a80: 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) 31a82: 2b 81 ldd r18, Y+3 ; 0x03 31a84: 2f 5f subi r18, 0xFF ; 255 31a86: 2b 83 std Y+3, r18 ; 0x03 31a88: 61 cf rjmp .-318 ; 0x3194c 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 31a8a: 31 10 cpse r3, r1 31a8c: 4f c0 rjmp .+158 ; 0x31b2c //printf_P(PSTR("high dev. first occurence\n")); delay_keep_alive(500); //damping 31a8e: 84 ef ldi r24, 0xF4 ; 244 31a90: 91 e0 ldi r25, 0x01 ; 1 31a92: 0e 94 e4 8c call 0x119c8 ; 0x119c8 //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; 31a96: 32 2c mov r3, r2 i = -1; 31a98: 8f ef ldi r24, 0xFF ; 255 31a9a: 8b 83 std Y+3, r24 ; 0x03 z = 0; 31a9c: c1 2c mov r12, r1 31a9e: d1 2c mov r13, r1 31aa0: 76 01 movw r14, r12 31aa2: ef cf rjmp .-34 ; 0x31a82 } } //printf_P(PSTR("PINDA triggered at %f\n"), current_position[Z_AXIS]); } current_position[Z_AXIS] = z; if (n_iter > 1) 31aa4: 02 30 cpi r16, 0x02 ; 2 31aa6: 68 f5 brcc .+90 ; 0x31b02 goto error; } } //printf_P(PSTR("PINDA triggered at %f\n"), current_position[Z_AXIS]); } current_position[Z_AXIS] = z; 31aa8: c0 92 9a 06 sts 0x069A, r12 ; 0x80069a 31aac: d0 92 9b 06 sts 0x069B, r13 ; 0x80069b 31ab0: e0 92 9c 06 sts 0x069C, r14 ; 0x80069c 31ab4: f0 92 9d 06 sts 0x069D, r15 ; 0x80069d 31ab8: 8a 81 ldd r24, Y+2 ; 0x02 31aba: 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); 31abe: 89 81 ldd r24, Y+1 ; 0x01 31ac0: 0f 94 e2 4d call 0x29bc4 ; 0x29bc4 // SERIAL_ECHOLNPGM("find_bed_induction_sensor_point_z 3"); #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; 31ac4: 11 23 and r17, r17 31ac6: 19 f0 breq .+6 ; 0x31ace 31ac8: 80 e0 ldi r24, 0x00 ; 0 31aca: 0e 94 b0 66 call 0xcd60 ; 0xcd60 #endif bedPWMDisabled = 0; 31ace: 10 92 8d 06 sts 0x068D, r1 ; 0x80068d #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; #endif bedPWMDisabled = 0; return false; } 31ad2: 8c 81 ldd r24, Y+4 ; 0x04 31ad4: 0f 90 pop r0 31ad6: 0f 90 pop r0 31ad8: 0f 90 pop r0 31ada: 0f 90 pop r0 31adc: df 91 pop r29 31ade: cf 91 pop r28 31ae0: 1f 91 pop r17 31ae2: 0f 91 pop r16 31ae4: ff 90 pop r15 31ae6: ef 90 pop r14 31ae8: df 90 pop r13 31aea: cf 90 pop r12 31aec: bf 90 pop r11 31aee: af 90 pop r10 31af0: 9f 90 pop r9 31af2: 8f 90 pop r8 31af4: 7f 90 pop r7 31af6: 6f 90 pop r6 31af8: 5f 90 pop r5 31afa: 4f 90 pop r4 31afc: 3f 90 pop r3 31afe: 2f 90 pop r2 31b00: 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); 31b02: 60 2f mov r22, r16 31b04: 70 e0 ldi r23, 0x00 ; 0 31b06: 90 e0 ldi r25, 0x00 ; 0 31b08: 80 e0 ldi r24, 0x00 ; 0 31b0a: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 31b0e: 9b 01 movw r18, r22 31b10: ac 01 movw r20, r24 31b12: c7 01 movw r24, r14 31b14: b6 01 movw r22, r12 31b16: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 31b1a: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a 31b1e: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b 31b22: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c 31b26: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d 31b2a: c6 cf rjmp .-116 ; 0x31ab8 31b2c: 2a 81 ldd r18, Y+2 ; 0x02 31b2e: 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); 31b32: 89 81 ldd r24, Y+1 ; 0x01 31b34: 0f 94 e2 4d call 0x29bc4 ; 0x29bc4 #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; 31b38: 11 23 and r17, r17 31b3a: 19 f0 breq .+6 ; 0x31b42 31b3c: 80 e0 ldi r24, 0x00 ; 0 31b3e: 0e 94 b0 66 call 0xcd60 ; 0xcd60 #endif bedPWMDisabled = 0; 31b42: 10 92 8d 06 sts 0x068D, r1 ; 0x80068d return false; 31b46: 1c 82 std Y+4, r1 ; 0x04 31b48: c4 cf rjmp .-120 ; 0x31ad2 00031b4a : //! @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) 31b4a: 2f 92 push r2 31b4c: 3f 92 push r3 31b4e: 4f 92 push r4 31b50: 5f 92 push r5 31b52: 6f 92 push r6 31b54: 7f 92 push r7 31b56: 8f 92 push r8 31b58: 9f 92 push r9 31b5a: af 92 push r10 31b5c: bf 92 push r11 31b5e: cf 92 push r12 31b60: df 92 push r13 31b62: ef 92 push r14 31b64: ff 92 push r15 31b66: 0f 93 push r16 31b68: 1f 93 push r17 31b6a: cf 93 push r28 31b6c: df 93 push r29 31b6e: cd b7 in r28, 0x3d ; 61 31b70: de b7 in r29, 0x3e ; 62 31b72: ce 5c subi r28, 0xCE ; 206 31b74: d1 09 sbc r29, r1 31b76: 0f b6 in r0, 0x3f ; 63 31b78: f8 94 cli 31b7a: de bf out 0x3e, r29 ; 62 31b7c: 0f be out 0x3f, r0 ; 63 31b7e: cd bf out 0x3d, r28 ; 61 31b80: 18 2f mov r17, r24 { bool final_result = false; #ifdef TMC2130 FORCE_HIGH_POWER_START; 31b82: 81 e0 ldi r24, 0x01 ; 1 31b84: 0e 94 b0 66 call 0xcd60 ; 0xcd60 #endif // TMC2130 FORCE_BL_ON_START; 31b88: 81 e0 ldi r24, 0x01 ; 1 31b8a: 0e 94 49 8a call 0x11492 ; 0x11492 // Only Z calibration? if (!onlyZ) 31b8e: 11 11 cpse r17, r1 31b90: 04 c0 rjmp .+8 ; 0x31b9a { disable_heater(); 31b92: 0f 94 18 2f call 0x25e30 ; 0x25e30 eeprom_adjust_bed_reset(); //reset bed level correction 31b96: 0e 94 98 76 call 0xed30 ; 0xed30 } // Disable the default update procedure of the display. We will do a modal dialog. lcd_update_enable(false); 31b9a: 80 e0 ldi r24, 0x00 ; 0 31b9c: 0e 94 25 6f call 0xde4a ; 0xde4a // Let the planner use the uncorrected coordinates. mbl.reset(); 31ba0: 0f 94 4d 8c call 0x3189a ; 0x3189a // 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(); 31ba4: 0f 94 36 ce call 0x39c6c ; 0x39c6c babystepLoadZ = 0; } void babystep_reset() { babystepLoadZ = 0; 31ba8: 10 92 8b 06 sts 0x068B, r1 ; 0x80068b <_ZL13babystepLoadZ.lto_priv.497+0x1> 31bac: 10 92 8a 06 sts 0x068A, r1 ; 0x80068a <_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)); 31bb0: ef e8 ldi r30, 0x8F ; 143 31bb2: f6 e0 ldi r31, 0x06 ; 6 31bb4: 83 e0 ldi r24, 0x03 ; 3 31bb6: df 01 movw r26, r30 31bb8: 1d 92 st X+, r1 31bba: 8a 95 dec r24 31bbc: e9 f7 brne .-6 ; 0x31bb8 // Home in the XY plane. //set_destination_to_current(); int l_feedmultiply = setup_for_endstop_move(); 31bbe: 81 e0 ldi r24, 0x01 ; 1 31bc0: 0e 94 e8 66 call 0xcdd0 ; 0xcdd0 31bc4: c7 55 subi r28, 0x57 ; 87 31bc6: df 4f sbci r29, 0xFF ; 255 31bc8: 99 83 std Y+1, r25 ; 0x01 31bca: 88 83 st Y, r24 31bcc: c9 5a subi r28, 0xA9 ; 169 31bce: d0 40 sbci r29, 0x00 ; 0 lcd_display_message_fullscreen_P(_T(MSG_AUTO_HOME)); 31bd0: 8b e0 ldi r24, 0x0B ; 11 31bd2: 9c e5 ldi r25, 0x5C ; 92 31bd4: 0e 94 ac 72 call 0xe558 ; 0xe558 31bd8: 0f 94 e4 1f call 0x23fc8 ; 0x23fc8 raise_z_above(MESH_HOME_Z_SEARCH); 31bdc: 60 e0 ldi r22, 0x00 ; 0 31bde: 70 e0 ldi r23, 0x00 ; 0 31be0: 80 ea ldi r24, 0xA0 ; 160 31be2: 90 e4 ldi r25, 0x40 ; 64 31be4: 0e 94 60 6e call 0xdcc0 ; 0xdcc0 } /**/ void home_xy() { set_destination_to_current(); 31be8: 0e 94 3a 68 call 0xd074 ; 0xd074 homeaxis(X_AXIS); 31bec: 50 e0 ldi r21, 0x00 ; 0 31bee: 40 e0 ldi r20, 0x00 ; 0 31bf0: 61 e0 ldi r22, 0x01 ; 1 31bf2: 80 e0 ldi r24, 0x00 ; 0 31bf4: 0e 94 6b 7a call 0xf4d6 ; 0xf4d6 homeaxis(Y_AXIS); 31bf8: 50 e0 ldi r21, 0x00 ; 0 31bfa: 40 e0 ldi r20, 0x00 ; 0 31bfc: 61 e0 ldi r22, 0x01 ; 1 31bfe: 81 e0 ldi r24, 0x01 ; 1 31c00: 0e 94 6b 7a call 0xf4d6 ; 0xf4d6 plan_set_position_curposXYZE(); 31c04: 0f 94 09 bf call 0x37e12 ; 0x37e12 endstops_hit_on_purpose(); 31c08: 0f 94 fe 4d call 0x29bfc ; 0x29bfc 31c0c: 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; 31c10: 20 e0 ldi r18, 0x00 ; 0 31c12: 30 e0 ldi r19, 0x00 ; 0 31c14: 40 ea ldi r20, 0xA0 ; 160 31c16: 50 e4 ldi r21, 0x40 ; 64 31c18: 60 91 92 06 lds r22, 0x0692 ; 0x800692 31c1c: 70 91 93 06 lds r23, 0x0693 ; 0x800693 31c20: 80 91 94 06 lds r24, 0x0694 ; 0x800694 31c24: 90 91 95 06 lds r25, 0x0695 ; 0x800695 31c28: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 31c2c: 60 93 92 06 sts 0x0692, r22 ; 0x800692 31c30: 70 93 93 06 sts 0x0693, r23 ; 0x800693 31c34: 80 93 94 06 sts 0x0694, r24 ; 0x800694 31c38: 90 93 95 06 sts 0x0695, r25 ; 0x800695 current_position[Y_AXIS] += 5; 31c3c: 20 e0 ldi r18, 0x00 ; 0 31c3e: 30 e0 ldi r19, 0x00 ; 0 31c40: 40 ea ldi r20, 0xA0 ; 160 31c42: 50 e4 ldi r21, 0x40 ; 64 31c44: 60 91 96 06 lds r22, 0x0696 ; 0x800696 31c48: 70 91 97 06 lds r23, 0x0697 ; 0x800697 31c4c: 80 91 98 06 lds r24, 0x0698 ; 0x800698 31c50: 90 91 99 06 lds r25, 0x0699 ; 0x800699 31c54: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 31c58: 60 93 96 06 sts 0x0696, r22 ; 0x800696 31c5c: 70 93 97 06 sts 0x0697, r23 ; 0x800697 31c60: 80 93 98 06 sts 0x0698, r24 ; 0x800698 31c64: 90 93 99 06 sts 0x0699, r25 ; 0x800699 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40); 31c68: 60 e0 ldi r22, 0x00 ; 0 31c6a: 70 e0 ldi r23, 0x00 ; 0 31c6c: 80 ea ldi r24, 0xA0 ; 160 31c6e: 91 e4 ldi r25, 0x41 ; 65 31c70: 0f 94 49 c0 call 0x38092 ; 0x38092 st_synchronize(); 31c74: 0f 94 e8 42 call 0x285d0 ; 0x285d0 // Let the user move the Z axes up to the end stoppers. #ifdef TMC2130 if (calibrate_z_auto()) 31c78: 0e 94 3e 73 call 0xe67c ; 0xe67c 31c7c: e5 96 adiw r28, 0x35 ; 53 31c7e: 8f af std Y+63, r24 ; 0x3f 31c80: e5 97 sbiw r28, 0x35 ; 53 31c82: 81 11 cpse r24, r1 31c84: 04 c0 rjmp .+8 ; 0x31c8e //! @param verbosity_level //! @retval true Succeeded //! @retval false Failed bool gcode_M45(bool onlyZ, int8_t verbosity_level) { bool final_result = false; 31c86: e5 96 adiw r28, 0x35 ; 53 31c88: 1f ae std Y+63, r1 ; 0x3f 31c8a: e5 97 sbiw r28, 0x35 ; 53 31c8c: 74 c4 rjmp .+2280 ; 0x32576 { #else //TMC2130 if (lcd_calibrate_z_end_stop_manual(onlyZ)) { #endif //TMC2130 lcd_show_fullscreen_message_and_wait_P(_T(MSG_CONFIRM_NOZZLE_CLEAN)); 31c8e: 8f ec ldi r24, 0xCF ; 207 31c90: 9b e5 ldi r25, 0x5B ; 91 31c92: 0e 94 ac 72 call 0xe558 ; 0xe558 31c96: 0f 94 f1 1f call 0x23fe2 ; 0x23fe2 if(onlyZ){ 31c9a: 11 23 and r17, r17 31c9c: 09 f4 brne .+2 ; 0x31ca0 31c9e: 46 c4 rjmp .+2188 ; 0x3252c prompt_steel_sheet_on_bed(true); 31ca0: 81 e0 ldi r24, 0x01 ; 1 31ca2: 0f 94 99 0c call 0x21932 ; 0x21932 lcd_display_message_fullscreen_P(_T(MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1)); 31ca6: 8d e9 ldi r24, 0x9D ; 157 31ca8: 9b e5 ldi r25, 0x5B ; 91 31caa: 0e 94 ac 72 call 0xe558 ; 0xe558 31cae: 0f 94 e4 1f call 0x23fc8 ; 0x23fc8 lcd_puts_at_P(0,3,_n("1/9")); 31cb2: 4f e6 ldi r20, 0x6F ; 111 31cb4: 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")); 31cb6: 63 e0 ldi r22, 0x03 ; 3 31cb8: 80 e0 ldi r24, 0x00 ; 0 31cba: 0e 94 f4 6e call 0xdde8 ; 0xdde8 } refresh_cmd_timeout(); 31cbe: 0e 94 c3 66 call 0xcd86 ; 0xcd86 if (((degHotend(0) > MAX_HOTEND_TEMP_CALIBRATION) || (degBed() > MAX_BED_TEMP_CALIBRATION)) && (!onlyZ)) { lcd_wait_for_cool_down(); } #endif //STEEL_SHEET if(!onlyZ) 31cc2: 11 11 cpse r17, r1 31cc4: 1b c0 rjmp .+54 ; 0x31cfc { KEEPALIVE_STATE(PAUSED_FOR_USER); 31cc6: 84 e0 ldi r24, 0x04 ; 4 31cc8: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be prompt_steel_sheet_on_bed(false); 31ccc: 80 e0 ldi r24, 0x00 ; 0 31cce: 0f 94 99 0c call 0x21932 ; 0x21932 lcd_show_fullscreen_message_and_wait_P(_T(MSG_PAPER)); 31cd2: 83 ee ldi r24, 0xE3 ; 227 31cd4: 9a e5 ldi r25, 0x5A ; 90 31cd6: 0e 94 ac 72 call 0xe558 ; 0xe558 31cda: 0f 94 f1 1f call 0x23fe2 ; 0x23fe2 KEEPALIVE_STATE(IN_HANDLER); 31cde: 82 e0 ldi r24, 0x02 ; 2 31ce0: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be lcd_display_message_fullscreen_P(_T(MSG_FIND_BED_OFFSET_AND_SKEW_LINE1)); 31ce4: 8b e7 ldi r24, 0x7B ; 123 31ce6: 9b e5 ldi r25, 0x5B ; 91 31ce8: 0e 94 ac 72 call 0xe558 ; 0xe558 31cec: 0f 94 e4 1f call 0x23fc8 ; 0x23fc8 lcd_puts_at_P(0,3,_n("1/4")); 31cf0: 47 e6 ldi r20, 0x67 ; 103 31cf2: 50 e7 ldi r21, 0x70 ; 112 31cf4: 63 e0 ldi r22, 0x03 ; 3 31cf6: 80 e0 ldi r24, 0x00 ; 0 31cf8: 0e 94 f4 6e call 0xdde8 ; 0xdde8 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 31cfc: 00 91 b7 02 lds r16, 0x02B7 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> check_endstops = check; 31d00: 10 92 b7 02 sts 0x02B7, r1 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> } bool endstops_enabled = enable_endstops(false); raise_z(-1); 31d04: 60 e0 ldi r22, 0x00 ; 0 31d06: 70 e0 ldi r23, 0x00 ; 0 31d08: 80 e8 ldi r24, 0x80 ; 128 31d0a: 9f eb ldi r25, 0xBF ; 191 31d0c: 0e 94 e1 6d call 0xdbc2 ; 0xdbc2 // Move the print head close to the bed. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 31d10: c1 2c mov r12, r1 31d12: d1 2c mov r13, r1 31d14: b0 ea ldi r27, 0xA0 ; 160 31d16: eb 2e mov r14, r27 31d18: b0 e4 ldi r27, 0x40 ; 64 31d1a: fb 2e mov r15, r27 31d1c: c0 92 9a 06 sts 0x069A, r12 ; 0x80069a 31d20: d0 92 9b 06 sts 0x069B, r13 ; 0x80069b 31d24: e0 92 9c 06 sts 0x069C, r14 ; 0x80069c 31d28: f0 92 9d 06 sts 0x069D, r15 ; 0x80069d 31d2c: 81 e0 ldi r24, 0x01 ; 1 31d2e: 80 93 b7 02 sts 0x02B7, r24 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> enable_endstops(true); #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); 31d32: 84 e0 ldi r24, 0x04 ; 4 31d34: 0f 94 d8 25 call 0x24bb0 ; 0x24bb0 #endif //TMC2130 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40); 31d38: 60 e0 ldi r22, 0x00 ; 0 31d3a: 70 e0 ldi r23, 0x00 ; 0 31d3c: 80 ea ldi r24, 0xA0 ; 160 31d3e: 91 e4 ldi r25, 0x41 ; 65 31d40: 0f 94 49 c0 call 0x38092 ; 0x38092 st_synchronize(); 31d44: 0f 94 e8 42 call 0x285d0 ; 0x285d0 #ifdef TMC2130 tmc2130_home_exit(); 31d48: 0f 94 a9 25 call 0x24b52 ; 0x24b52 31d4c: 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)) && 31d50: 82 e0 ldi r24, 0x02 ; 2 31d52: 0f 94 d4 42 call 0x285a8 ; 0x285a8 31d56: 2d ec ldi r18, 0xCD ; 205 31d58: 3c ec ldi r19, 0xCC ; 204 31d5a: 44 ea ldi r20, 0xA4 ; 164 31d5c: 50 e4 ldi r21, 0x40 ; 64 31d5e: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 31d62: 18 16 cp r1, r24 31d64: 0c f4 brge .+2 ; 0x31d68 31d66: eb c3 rjmp .+2006 ; 0x3253e (st_get_position_mm(Z_AXIS) >= (MESH_HOME_Z_SEARCH - HOME_Z_SEARCH_THRESHOLD))) 31d68: 82 e0 ldi r24, 0x02 ; 2 31d6a: 0f 94 d4 42 call 0x285a8 ; 0x285a8 #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)) && 31d6e: 23 e3 ldi r18, 0x33 ; 51 31d70: 33 e3 ldi r19, 0x33 ; 51 31d72: 4b e9 ldi r20, 0x9B ; 155 31d74: 50 e4 ldi r21, 0x40 ; 64 31d76: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 31d7a: 87 fd sbrc r24, 7 31d7c: e0 c3 rjmp .+1984 ; 0x3253e (st_get_position_mm(Z_AXIS) >= (MESH_HOME_Z_SEARCH - HOME_Z_SEARCH_THRESHOLD))) { if (onlyZ) 31d7e: 11 11 cpse r17, r1 31d80: e3 c3 rjmp .+1990 ; 0x32548 } } else { // Reset the baby step value and the baby step applied flag. calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 31d82: 80 e1 ldi r24, 0x10 ; 16 31d84: 0e 94 3d ee call 0x1dc7a ; 0x1dc7a eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 31d88: 81 ea ldi r24, 0xA1 ; 161 31d8a: 9d e0 ldi r25, 0x0D ; 13 31d8c: 0f 94 1c dc call 0x3b838 ; 0x3b838 31d90: bb e0 ldi r27, 0x0B ; 11 31d92: 8b 9f mul r24, r27 31d94: c0 01 movw r24, r0 31d96: 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); 31d98: 70 e0 ldi r23, 0x00 ; 0 31d9a: 60 e0 ldi r22, 0x00 ; 0 31d9c: 80 5b subi r24, 0xB0 ; 176 31d9e: 92 4f sbci r25, 0xF2 ; 242 31da0: 0f 94 5e dc call 0x3b8bc ; 0x3b8bc } 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(); 31da4: 0e 94 c3 66 call 0xcd86 ; 0xcd86 // 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); 31da8: e3 ec ldi r30, 0xC3 ; 195 31daa: f3 e1 ldi r31, 0x13 ; 19 31dac: 84 ec ldi r24, 0xC4 ; 196 31dae: df 01 movw r26, r30 31db0: 1d 92 st X+, r1 31db2: 8a 95 dec r24 31db4: e9 f7 brne .-6 ; 0x31db0 { #else //NEW_XYZCAL while (iteration < 3) { #endif //NEW_XYZCAL SERIAL_ECHOPGM("Iteration: "); 31db6: 8f ef ldi r24, 0xFF ; 255 31db8: 95 ea ldi r25, 0xA5 ; 165 31dba: 0e 94 50 77 call 0xeea0 ; 0xeea0 MYSERIAL.println(int(iteration + 1)); 31dbe: 81 e0 ldi r24, 0x01 ; 1 31dc0: 90 e0 ldi r25, 0x00 ; 0 31dc2: 0f 94 f5 74 call 0x2e9ea ; 0x2e9ea 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)); 31dc6: 8b e7 ldi r24, 0x7B ; 123 31dc8: 9b e5 ldi r25, 0x5B ; 91 31dca: 0e 94 ac 72 call 0xe558 ; 0xe558 31dce: 0f 94 e4 1f call 0x23fc8 ; 0x23fc8 #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; 31dd2: c0 92 9a 06 sts 0x069A, r12 ; 0x80069a 31dd6: d0 92 9b 06 sts 0x069B, r13 ; 0x80069b 31dda: e0 92 9c 06 sts 0x069C, r14 ; 0x80069c 31dde: f0 92 9d 06 sts 0x069D, r15 ; 0x80069d 31de2: b2 e0 ldi r27, 0x02 ; 2 31de4: e1 96 adiw r28, 0x31 ; 49 31de6: bf af std Y+63, r27 ; 0x3f 31de8: e1 97 sbiw r28, 0x31 ; 49 31dea: 2a ed ldi r18, 0xDA ; 218 31dec: 35 ea ldi r19, 0xA5 ; 165 31dee: cd 56 subi r28, 0x6D ; 109 31df0: df 4f sbci r29, 0xFF ; 255 31df2: 39 83 std Y+1, r19 ; 0x01 31df4: 28 83 st Y, r18 31df6: c3 59 subi r28, 0x93 ; 147 31df8: d0 40 sbci r29, 0x00 ; 0 31dfa: 42 ec ldi r20, 0xC2 ; 194 31dfc: 53 e1 ldi r21, 0x13 ; 19 31dfe: cf 56 subi r28, 0x6F ; 111 31e00: df 4f sbci r29, 0xFF ; 255 31e02: 59 83 std Y+1, r21 ; 0x01 31e04: 48 83 st Y, r20 31e06: c1 59 subi r28, 0x91 ; 145 31e08: d0 40 sbci r29, 0x00 ; 0 31e0a: a0 96 adiw r28, 0x20 ; 32 31e0c: 5f af std Y+63, r21 ; 0x3f 31e0e: 4e af std Y+62, r20 ; 0x3e 31e10: a0 97 sbiw r28, 0x20 ; 32 31e12: e0 96 adiw r28, 0x30 ; 48 31e14: 3f af std Y+63, r19 ; 0x3f 31e16: 2e af std Y+62, r18 ; 0x3e 31e18: 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; 31e1a: a7 96 adiw r28, 0x27 ; 39 31e1c: 1f ae std Y+63, r1 ; 0x3f 31e1e: a7 97 sbiw r28, 0x27 ; 39 for (int k = 0; k < 4; ++k) { 31e20: 31 2c mov r3, r1 31e22: 21 2c mov r2, r1 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 31e24: 0e 94 c3 66 call 0xcd86 ; 0xcd86 #ifdef MESH_BED_CALIBRATION_SHOW_LCD lcd_set_cursor(0, 3); 31e28: 63 e0 ldi r22, 0x03 ; 3 31e2a: 80 e0 ldi r24, 0x00 ; 0 31e2c: 0e 94 e0 6e call 0xddc0 ; 0xddc0 lcd_printf_P(PSTR("%d/4"),(k+1)); 31e30: bf ef ldi r27, 0xFF ; 255 31e32: 2b 1a sub r2, r27 31e34: 3b 0a sbc r3, r27 31e36: 3f 92 push r3 31e38: 2f 92 push r2 31e3a: ea ef ldi r30, 0xFA ; 250 31e3c: f5 ea ldi r31, 0xA5 ; 165 31e3e: ff 93 push r31 31e40: ef 93 push r30 31e42: 0e 94 b9 6e call 0xdd72 ; 0xdd72 } #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); 31e46: 65 e5 ldi r22, 0x55 ; 85 31e48: 75 e5 ldi r23, 0x55 ; 85 31e4a: 85 e5 ldi r24, 0x55 ; 85 31e4c: 91 e4 ldi r25, 0x41 ; 65 31e4e: 0f 94 d1 c5 call 0x38ba2 ; 0x38ba2 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); 31e52: e0 96 adiw r28, 0x30 ; 48 31e54: ee ad ldd r30, Y+62 ; 0x3e 31e56: ff ad ldd r31, Y+63 ; 0x3f 31e58: e0 97 sbiw r28, 0x30 ; 48 31e5a: 85 91 lpm r24, Z+ 31e5c: 95 91 lpm r25, Z+ 31e5e: a5 91 lpm r26, Z+ 31e60: b4 91 lpm r27, Z 31e62: 80 93 92 06 sts 0x0692, r24 ; 0x800692 31e66: 90 93 93 06 sts 0x0693, r25 ; 0x800693 31e6a: a0 93 94 06 sts 0x0694, r26 ; 0x800694 31e6e: b0 93 95 06 sts 0x0695, r27 ; 0x800695 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + k * 2 + 1); 31e72: e0 96 adiw r28, 0x30 ; 48 31e74: ee ad ldd r30, Y+62 ; 0x3e 31e76: ff ad ldd r31, Y+63 ; 0x3f 31e78: e0 97 sbiw r28, 0x30 ; 48 31e7a: 34 96 adiw r30, 0x04 ; 4 31e7c: 85 91 lpm r24, Z+ 31e7e: 95 91 lpm r25, Z+ 31e80: a5 91 lpm r26, Z+ 31e82: b4 91 lpm r27, Z 31e84: 80 93 96 06 sts 0x0696, r24 ; 0x800696 31e88: 90 93 97 06 sts 0x0697, r25 ; 0x800697 31e8c: a0 93 98 06 sts 0x0698, r26 ; 0x800698 31e90: b0 93 99 06 sts 0x0699, r27 ; 0x800699 MYSERIAL.print(current_position[Z_AXIS], 5); SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY go_to_current(homing_feedrate[X_AXIS] / 60.f); 31e94: 60 e0 ldi r22, 0x00 ; 0 31e96: 70 e0 ldi r23, 0x00 ; 0 31e98: 88 e4 ldi r24, 0x48 ; 72 31e9a: 92 e4 ldi r25, 0x42 ; 66 31e9c: 0f 94 d1 c5 call 0x38ba2 ; 0x38ba2 return pos * 0.01f; } void xyzcal_measure_enter(void) { DBG(_n("xyzcal_measure_enter\n")); 31ea0: 4f e5 ldi r20, 0x5F ; 95 31ea2: 54 ea ldi r21, 0xA4 ; 164 31ea4: 5f 93 push r21 31ea6: 4f 93 push r20 31ea8: 0f 94 de da call 0x3b5bc ; 0x3b5bc lcd_puts_at_P(4,3,PSTR("Measure center ")); ////MSG_MEASURE_CENTER c=16 31eac: 4e e4 ldi r20, 0x4E ; 78 31eae: 54 ea ldi r21, 0xA4 ; 164 31eb0: 63 e0 ldi r22, 0x03 ; 3 31eb2: 84 e0 ldi r24, 0x04 ; 4 31eb4: 0e 94 f4 6e call 0xdde8 ; 0xdde8 // disable heaters and stop motion before we initialize sm4 disable_heater(); 31eb8: 0f 94 18 2f call 0x25e30 ; 0x25e30 st_synchronize(); 31ebc: 0f 94 e8 42 call 0x285d0 ; 0x285d0 // disable incompatible interrupts DISABLE_STEPPER_DRIVER_INTERRUPT(); 31ec0: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 31ec4: 8d 7f andi r24, 0xFD ; 253 31ec6: 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" ); 31eca: 0f b6 in r0, 0x3f ; 63 31ecc: f8 94 cli 31ece: a8 95 wdr 31ed0: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 31ed4: 88 61 ori r24, 0x18 ; 24 31ed6: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 31eda: 10 92 60 00 sts 0x0060, r1 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 31ede: 0f be out 0x3f, r0 ; 63 #ifdef WATCHDOG wdt_disable(); #endif //WATCHDOG // setup internal callbacks sm4_stop_cb = 0; 31ee0: 10 92 89 06 sts 0x0689, r1 ; 0x800689 31ee4: 10 92 88 06 sts 0x0688, r1 ; 0x800688 sm4_update_pos_cb = xyzcal_update_pos; 31ee8: 86 e2 ldi r24, 0x26 ; 38 31eea: 9d ec ldi r25, 0xCD ; 205 31eec: 90 93 87 06 sts 0x0687, r25 ; 0x800687 31ef0: 80 93 86 06 sts 0x0686, r24 ; 0x800686 sm4_calc_delay_cb = xyzcal_calc_delay; 31ef4: a1 e2 ldi r26, 0x21 ; 33 31ef6: bd ec ldi r27, 0xCD ; 205 31ef8: b0 93 85 06 sts 0x0685, r27 ; 0x800685 31efc: a0 93 84 06 sts 0x0684, r26 ; 0x800684 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]); 31f00: 00 91 bb 06 lds r16, 0x06BB ; 0x8006bb 31f04: 10 91 bc 06 lds r17, 0x06BC ; 0x8006bc 31f08: 20 91 bd 06 lds r18, 0x06BD ; 0x8006bd 31f0c: 30 91 be 06 lds r19, 0x06BE ; 0x8006be 31f10: 40 91 b7 06 lds r20, 0x06B7 ; 0x8006b7 31f14: 50 91 b8 06 lds r21, 0x06B8 ; 0x8006b8 31f18: 60 91 b9 06 lds r22, 0x06B9 ; 0x8006b9 31f1c: 70 91 ba 06 lds r23, 0x06BA ; 0x8006ba 31f20: 80 91 b3 06 lds r24, 0x06B3 ; 0x8006b3 31f24: 90 91 b4 06 lds r25, 0x06B4 ; 0x8006b4 31f28: a0 91 b5 06 lds r26, 0x06B5 ; 0x8006b5 31f2c: b0 91 b6 06 lds r27, 0x06B6 ; 0x8006b6 31f30: 3f 93 push r19 31f32: 2f 93 push r18 31f34: 1f 93 push r17 31f36: 0f 93 push r16 31f38: 7f 93 push r23 31f3a: 6f 93 push r22 31f3c: 5f 93 push r21 31f3e: 4f 93 push r20 31f40: bf 93 push r27 31f42: af 93 push r26 31f44: 9f 93 push r25 31f46: 8f 93 push r24 31f48: ee ef ldi r30, 0xFE ; 254 31f4a: f4 ea ldi r31, 0xA4 ; 164 31f4c: ff 93 push r31 31f4e: ef 93 push r30 31f50: 0f 94 de da call 0x3b5bc ; 0x3b5bc int16_t x0 = _X; 31f54: 40 90 b3 06 lds r4, 0x06B3 ; 0x8006b3 31f58: 50 90 b4 06 lds r5, 0x06B4 ; 0x8006b4 31f5c: 60 90 b5 06 lds r6, 0x06B5 ; 0x8006b5 31f60: 70 90 b6 06 lds r7, 0x06B6 ; 0x8006b6 31f64: b4 2c mov r11, r4 31f66: a5 2c mov r10, r5 int16_t y0 = _Y; 31f68: 80 91 b7 06 lds r24, 0x06B7 ; 0x8006b7 31f6c: 90 91 b8 06 lds r25, 0x06B8 ; 0x8006b8 31f70: a0 91 b9 06 lds r26, 0x06B9 ; 0x8006b9 31f74: b0 91 ba 06 lds r27, 0x06BA ; 0x8006ba 31f78: a6 96 adiw r28, 0x26 ; 38 31f7a: 8c af std Y+60, r24 ; 0x3c 31f7c: 9d af std Y+61, r25 ; 0x3d 31f7e: ae af std Y+62, r26 ; 0x3e 31f80: bf af std Y+63, r27 ; 0x3f 31f82: a6 97 sbiw r28, 0x26 ; 38 31f84: a3 96 adiw r28, 0x23 ; 35 31f86: 9f ac ldd r9, Y+63 ; 0x3f 31f88: a3 97 sbiw r28, 0x23 ; 35 31f8a: a4 96 adiw r28, 0x24 ; 36 31f8c: 8f ac ldd r8, Y+63 ; 0x3f 31f8e: a4 97 sbiw r28, 0x24 ; 36 int16_t z = _Z; 31f90: c0 90 bb 06 lds r12, 0x06BB ; 0x8006bb 31f94: d0 90 bc 06 lds r13, 0x06BC ; 0x8006bc 31f98: e0 90 bd 06 lds r14, 0x06BD ; 0x8006bd 31f9c: f0 90 be 06 lds r15, 0x06BE ; 0x8006be 31fa0: 0f b6 in r0, 0x3f ; 63 31fa2: f8 94 cli 31fa4: de bf out 0x3e, r29 ; 62 31fa6: 0f be out 0x3f, r0 ; 63 31fa8: cd bf out 0x3d, r28 ; 61 // int16_t min_z = -6000; // int16_t dz = 100; while (z > -2300) { //-6mm + 0.25mm 31faa: b5 e0 ldi r27, 0x05 ; 5 31fac: cb 16 cp r12, r27 31fae: b7 ef ldi r27, 0xF7 ; 247 31fb0: db 06 cpc r13, r27 31fb2: 0c f4 brge .+2 ; 0x31fb6 31fb4: 40 c3 rjmp .+1664 ; 0x32636 } 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; 31fb6: 1a 82 std Y+2, r1 ; 0x02 31fb8: 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); 31fba: 1f 92 push r1 31fbc: 1f 92 push r1 31fbe: e3 e0 ldi r30, 0x03 ; 3 31fc0: ef 93 push r30 31fc2: f4 e8 ldi r31, 0x84 ; 132 31fc4: ff 93 push r31 31fc6: 1f 92 push r1 31fc8: 24 e6 ldi r18, 0x64 ; 100 31fca: 2f 93 push r18 31fcc: df 92 push r13 31fce: cf 92 push r12 31fd0: 8f 92 push r8 31fd2: 9f 92 push r9 31fd4: af 92 push r10 31fd6: bf 92 push r11 31fd8: 45 e7 ldi r20, 0x75 ; 117 31fda: 54 ea ldi r21, 0xA4 ; 164 31fdc: 5f 93 push r21 31fde: 4f 93 push r20 31fe0: 0f 94 de da call 0x3b5bc ; 0x3b5bc if (!ret && (ad < 720)) 31fe4: 0f b6 in r0, 0x3f ; 63 31fe6: f8 94 cli 31fe8: de bf out 0x3e, r29 ; 62 31fea: 0f be out 0x3f, r0 ; 63 31fec: cd bf out 0x3d, r28 ; 61 31fee: 89 81 ldd r24, Y+1 ; 0x01 31ff0: 9a 81 ldd r25, Y+2 ; 0x02 31ff2: 80 3d cpi r24, 0xD0 ; 208 31ff4: 92 40 sbci r25, 0x02 ; 2 31ff6: 08 f4 brcc .+2 ; 0x31ffa 31ff8: e9 c2 rjmp .+1490 ; 0x325cc if ((ret = xyzcal_spiral2(cx, cy, z0 - 0*dz, dz, radius, 0, delay_us, check_pinda, &ad)) != 0) ad += 0; if (!ret && (ad < 1440)) 31ffa: 89 81 ldd r24, Y+1 ; 0x01 31ffc: 9a 81 ldd r25, Y+2 ; 0x02 31ffe: 80 3a cpi r24, 0xA0 ; 160 32000: 95 40 sbci r25, 0x05 ; 5 32002: 10 f0 brcs .+4 ; 0x32008 32004: 0d 94 f0 9e jmp 0x33de0 ; 0x33de0 if ((ret = xyzcal_spiral2(cx, cy, z0 - 1*dz, dz, -radius, 0, delay_us, check_pinda, &ad)) != 0) 32008: 9e 01 movw r18, r28 3200a: 2f 5f subi r18, 0xFF ; 255 3200c: 3f 4f sbci r19, 0xFF ; 255 3200e: 79 01 movw r14, r18 32010: 10 e0 ldi r17, 0x00 ; 0 32012: 00 e0 ldi r16, 0x00 ; 0 32014: 2c e7 ldi r18, 0x7C ; 124 32016: 3c ef ldi r19, 0xFC ; 252 32018: a6 01 movw r20, r12 3201a: 44 56 subi r20, 0x64 ; 100 3201c: 51 09 sbc r21, r1 3201e: 69 2d mov r22, r9 32020: 78 2d mov r23, r8 32022: 8b 2d mov r24, r11 32024: 9a 2d mov r25, r10 32026: 0f 94 7b 6e call 0x2dcf6 ; 0x2dcf6 3202a: 88 23 and r24, r24 3202c: 11 f4 brne .+4 ; 0x32032 3202e: 0d 94 f0 9e jmp 0x33de0 ; 0x33de0 ad += 720; 32032: 89 81 ldd r24, Y+1 ; 0x01 32034: 9a 81 ldd r25, Y+2 ; 0x02 32036: 80 53 subi r24, 0x30 ; 48 32038: 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); 3203a: c0 90 bb 06 lds r12, 0x06BB ; 0x8006bb 3203e: d0 90 bc 06 lds r13, 0x06BC ; 0x8006bc 32042: e0 90 bd 06 lds r14, 0x06BD ; 0x8006bd 32046: f0 90 be 06 lds r15, 0x06BE ; 0x8006be 3204a: 00 91 b7 06 lds r16, 0x06B7 ; 0x8006b7 3204e: 10 91 b8 06 lds r17, 0x06B8 ; 0x8006b8 32052: 20 91 b9 06 lds r18, 0x06B9 ; 0x8006b9 32056: 30 91 ba 06 lds r19, 0x06BA ; 0x8006ba 3205a: 40 91 b3 06 lds r20, 0x06B3 ; 0x8006b3 3205e: 50 91 b4 06 lds r21, 0x06B4 ; 0x8006b4 32062: 60 91 b5 06 lds r22, 0x06B5 ; 0x8006b5 32066: 70 91 b6 06 lds r23, 0x06B6 ; 0x8006b6 3206a: 9f 93 push r25 3206c: 8f 93 push r24 3206e: df 92 push r13 32070: cf 92 push r12 32072: 1f 93 push r17 32074: 0f 93 push r16 32076: 5f 93 push r21 32078: 4f 93 push r20 3207a: 8a ed ldi r24, 0xDA ; 218 3207c: 94 ea ldi r25, 0xA4 ; 164 3207e: 9f 93 push r25 32080: 8f 93 push r24 32082: 0f 94 de da call 0x3b5bc ; 0x3b5bc /// 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); 32086: 40 91 bb 06 lds r20, 0x06BB ; 0x8006bb 3208a: 50 91 bc 06 lds r21, 0x06BC ; 0x8006bc 3208e: 60 91 bd 06 lds r22, 0x06BD ; 0x8006bd 32092: 70 91 be 06 lds r23, 0x06BE ; 0x8006be 32096: 48 54 subi r20, 0x48 ; 72 32098: 51 09 sbc r21, r1 3209a: 00 e0 ldi r16, 0x00 ; 0 3209c: 28 ec ldi r18, 0xC8 ; 200 3209e: 30 e0 ldi r19, 0x00 ; 0 320a0: a3 96 adiw r28, 0x23 ; 35 320a2: 6f ad ldd r22, Y+63 ; 0x3f 320a4: a3 97 sbiw r28, 0x23 ; 35 320a6: a4 96 adiw r28, 0x24 ; 36 320a8: 7f ad ldd r23, Y+63 ; 0x3f 320aa: a4 97 sbiw r28, 0x24 ; 36 320ac: c2 01 movw r24, r4 320ae: 0e 94 75 eb call 0x1d6ea ; 0x1d6ea /// 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; 320b2: 20 91 b3 06 lds r18, 0x06B3 ; 0x8006b3 320b6: 30 91 b4 06 lds r19, 0x06B4 ; 0x8006b4 320ba: 40 91 b5 06 lds r20, 0x06B5 ; 0x8006b5 320be: 50 91 b6 06 lds r21, 0x06B6 ; 0x8006b6 320c2: 6e 96 adiw r28, 0x1e ; 30 320c4: 2c af std Y+60, r18 ; 0x3c 320c6: 3d af std Y+61, r19 ; 0x3d 320c8: 4e af std Y+62, r20 ; 0x3e 320ca: 5f af std Y+63, r21 ; 0x3f 320cc: 6e 97 sbiw r28, 0x1e ; 30 int16_t y = _Y; 320ce: 80 91 b7 06 lds r24, 0x06B7 ; 0x8006b7 320d2: 90 91 b8 06 lds r25, 0x06B8 ; 0x8006b8 320d6: a0 91 b9 06 lds r26, 0x06B9 ; 0x8006b9 320da: b0 91 ba 06 lds r27, 0x06BA ; 0x8006ba 320de: ae 96 adiw r28, 0x2e ; 46 320e0: 8c af std Y+60, r24 ; 0x3c 320e2: 9d af std Y+61, r25 ; 0x3d 320e4: ae af std Y+62, r26 ; 0x3e 320e6: bf af std Y+63, r27 ; 0x3f 320e8: ae 97 sbiw r28, 0x2e ; 46 const int16_t z = _Z; 320ea: 20 91 bb 06 lds r18, 0x06BB ; 0x8006bb 320ee: 30 91 bc 06 lds r19, 0x06BC ; 0x8006bc 320f2: 40 91 bd 06 lds r20, 0x06BD ; 0x8006bd 320f6: 50 91 be 06 lds r21, 0x06BE ; 0x8006be 320fa: e9 96 adiw r28, 0x39 ; 57 320fc: 2c af std Y+60, r18 ; 0x3c 320fe: 3d af std Y+61, r19 ; 0x3d 32100: 4e af std Y+62, r20 ; 0x3e 32102: 5f af std Y+63, r21 ; 0x3f 32104: e9 97 sbiw r28, 0x39 ; 57 32106: a5 ec ldi r26, 0xC5 ; 197 32108: ba e0 ldi r27, 0x0A ; 10 3210a: 0f b6 in r0, 0x3f ; 63 3210c: f8 94 cli 3210e: de bf out 0x3e, r29 ; 62 32110: 0f be out 0x3f, r0 ; 63 32112: cd bf out 0x3d, r28 ; 61 32114: 90 e0 ldi r25, 0x00 ; 0 32116: 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)); 32118: fc 01 movw r30, r24 3211a: eb 58 subi r30, 0x8B ; 139 3211c: fa 45 sbci r31, 0x5A ; 90 3211e: 25 91 lpm r18, Z+ 32120: 34 91 lpm r19, Z 32122: 2d 93 st X+, r18 32124: 3d 93 st X+, r19 pattern10[i] = pgm_read_word((uint16_t*)(xyzcal_point_pattern_10 + i)); 32126: fc 01 movw r30, r24 32128: e3 5a subi r30, 0xA3 ; 163 3212a: fa 45 sbci r31, 0x5A ; 90 3212c: 25 91 lpm r18, Z+ 3212e: 34 91 lpm r19, Z 32130: 57 96 adiw r26, 0x17 ; 23 32132: 3c 93 st X, r19 32134: 2e 93 st -X, r18 32136: 56 97 sbiw r26, 0x16 ; 22 32138: 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++){ 3213a: 88 31 cpi r24, 0x18 ; 24 3213c: 91 05 cpc r25, r1 3213e: 61 f7 brne .-40 ; 0x32118 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); 32140: e7 96 adiw r28, 0x37 ; 55 32142: 4e ad ldd r20, Y+62 ; 0x3e 32144: 5f ad ldd r21, Y+63 ; 0x3f 32146: e7 97 sbiw r28, 0x37 ; 55 32148: ac 96 adiw r28, 0x2c ; 44 3214a: 6e ad ldd r22, Y+62 ; 0x3e 3214c: 7f ad ldd r23, Y+63 ; 0x3f 3214e: ac 97 sbiw r28, 0x2c ; 44 32150: 6c 96 adiw r28, 0x1c ; 28 32152: 8e ad ldd r24, Y+62 ; 0x3e 32154: 9f ad ldd r25, Y+63 ; 0x3f 32156: 6c 97 sbiw r28, 0x1c ; 28 32158: 0f 94 b7 6f call 0x2df6e ; 0x2df6e 3215c: 25 ec ldi r18, 0xC5 ; 197 3215e: 36 e0 ldi r19, 0x06 ; 6 32160: a4 96 adiw r28, 0x24 ; 36 32162: 3f af std Y+63, r19 ; 0x3f 32164: 2e af std Y+62, r18 ; 0x3e 32166: a4 97 sbiw r28, 0x24 ; 36 32168: 79 01 movw r14, r18 3216a: f0 e2 ldi r31, 0x20 ; 32 3216c: 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]); 3216e: a0 e2 ldi r26, 0x20 ; 32 32170: ca 2e mov r12, r26 32172: a5 ea ldi r26, 0xA5 ; 165 32174: da 2e mov r13, r26 } DBG(endl); 32176: 05 e7 ldi r16, 0x75 ; 117 32178: 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); 3217a: 57 01 movw r10, r14 3217c: e0 e2 ldi r30, 0x20 ; 32 3217e: 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]); 32180: d5 01 movw r26, r10 32182: 8d 91 ld r24, X+ 32184: 5d 01 movw r10, r26 32186: 1f 92 push r1 32188: 8f 93 push r24 3218a: df 92 push r13 3218c: cf 92 push r12 3218e: 0f 94 de da call 0x3b5bc ; 0x3b5bc 32192: 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){ 32194: 0f 90 pop r0 32196: 0f 90 pop r0 32198: 0f 90 pop r0 3219a: 0f 90 pop r0 3219c: 81 10 cpse r8, r1 3219e: f0 cf rjmp .-32 ; 0x32180 DBG(_n("%02x"), matrix_32x32[idx_y + x]); } DBG(endl); 321a0: 1f 93 push r17 321a2: 0f 93 push r16 321a4: 0f 94 de da call 0x3b5bc ; 0x3b5bc 321a8: 9a 94 dec r9 321aa: b0 e2 ldi r27, 0x20 ; 32 321ac: eb 0e add r14, r27 321ae: 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){ 321b0: 0f 90 pop r0 321b2: 0f 90 pop r0 321b4: 91 10 cpse r9, r1 321b6: e1 cf rjmp .-62 ; 0x3217a for (uint8_t x = 0; x < 32; ++x){ DBG(_n("%02x"), matrix_32x32[idx_y + x]); } DBG(endl); } DBG(endl); 321b8: 1f 93 push r17 321ba: 0f 93 push r16 321bc: 0f 94 de da call 0x3b5bc ; 0x3b5bc 321c0: 65 ec ldi r22, 0xC5 ; 197 321c2: 7a e0 ldi r23, 0x0A ; 10 321c4: 0f 90 pop r0 321c6: 0f 90 pop r0 321c8: e5 ec ldi r30, 0xC5 ; 197 321ca: 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; 321cc: 90 e0 ldi r25, 0x00 ; 0 321ce: 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; 321d0: 50 e0 ldi r21, 0x00 ; 0 321d2: 40 e0 ldi r20, 0x00 ; 0 int16_t maxs = 0; for (int16_t i = 0; i < 32*32;++i){ if (matrix32[i] == 0) { 321d4: 21 91 ld r18, Z+ 321d6: 21 11 cpse r18, r1 321d8: 6d c4 rjmp .+2266 ; 0x32ab4 ++mins; 321da: 4f 5f subi r20, 0xFF ; 255 321dc: 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){ 321de: 6e 17 cp r22, r30 321e0: 7f 07 cpc r23, r31 321e2: c1 f7 brne .-16 ; 0x321d4 ++maxs; } } const int16_t rest = 1024 - mins - maxs; if (mins + maxs > threshold_total 321e4: 9a 01 movw r18, r20 321e6: 28 0f add r18, r24 321e8: 39 1f adc r19, r25 321ea: 25 38 cpi r18, 0x85 ; 133 321ec: 33 40 sbci r19, 0x03 ; 3 321ee: a4 f0 brlt .+40 ; 0x32218 && mins > threshold_extreme 321f0: 43 33 cpi r20, 0x33 ; 51 321f2: 51 05 cpc r21, r1 321f4: 8c f0 brlt .+34 ; 0x32218 && maxs > threshold_extreme 321f6: 83 33 cpi r24, 0x33 ; 51 321f8: 91 05 cpc r25, r1 321fa: 74 f0 brlt .+28 ; 0x32218 ++mins; } else if (matrix32[i] == 0xFF){ ++maxs; } } const int16_t rest = 1024 - mins - maxs; 321fc: 20 e0 ldi r18, 0x00 ; 0 321fe: 34 e0 ldi r19, 0x04 ; 4 32200: 24 1b sub r18, r20 32202: 35 0b sbc r19, r21 32204: 28 1b sub r18, r24 32206: 39 0b sbc r19, r25 if (mins + maxs > threshold_total && mins > threshold_extreme && maxs > threshold_extreme && mins > rest 32208: 24 17 cp r18, r20 3220a: 35 07 cpc r19, r21 3220c: 2c f4 brge .+10 ; 0x32218 } 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; 3220e: 1d ef ldi r17, 0xFD ; 253 if (mins + maxs > threshold_total && mins > threshold_extreme && maxs > threshold_extreme && mins > rest && maxs > rest) 32210: 28 17 cp r18, r24 32212: 39 07 cpc r19, r25 32214: 0c f4 brge .+2 ; 0x32218 32216: 3f c2 rjmp .+1150 ; 0x32696 } /// 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; 32218: 66 96 adiw r28, 0x16 ; 22 3221a: 1f ae std Y+63, r1 ; 0x3f 3221c: 66 97 sbiw r28, 0x16 ; 22 uint8_t r08 = 0; 3221e: 62 96 adiw r28, 0x12 ; 18 32220: 1f ae std Y+63, r1 ; 0x3f 32222: 62 97 sbiw r28, 0x12 ; 18 uint8_t match08 = 0; uint8_t c10 = 0; 32224: 22 96 adiw r28, 0x02 ; 2 32226: 1f ae std Y+63, r1 ; 0x3f 32228: 22 97 sbiw r28, 0x02 ; 2 uint8_t r10 = 0; 3222a: 19 82 std Y+1, r1 ; 0x01 3222c: ae 01 movw r20, r28 3222e: 4f 5a subi r20, 0xAF ; 175 32230: 5f 4f sbci r21, 0xFF ; 255 32232: be 01 movw r22, r28 32234: 6b 5a subi r22, 0xAB ; 171 32236: 7f 4f sbci r23, 0xFF ; 255 32238: 85 ec ldi r24, 0xC5 ; 197 3223a: 9a e0 ldi r25, 0x0A ; 10 3223c: 0f 94 de 67 call 0x2cfbc ; 0x2cfbc 32240: 08 2f mov r16, r24 32242: ae 01 movw r20, r28 32244: 4f 5f subi r20, 0xFF ; 255 32246: 5f 4f sbci r21, 0xFF ; 255 32248: be 01 movw r22, r28 3224a: 6f 5b subi r22, 0xBF ; 191 3224c: 7f 4f sbci r23, 0xFF ; 255 3224e: 8d ed ldi r24, 0xDD ; 221 32250: 9a e0 ldi r25, 0x0A ; 10 32252: 0f 94 de 67 call 0x2cfbc ; 0x2cfbc 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; 32256: 66 96 adiw r28, 0x16 ; 22 32258: 6f ad ldd r22, Y+63 ; 0x3f 3225a: 66 97 sbiw r28, 0x16 ; 22 row = r08; 3225c: 62 96 adiw r28, 0x12 ; 18 3225e: 1f ad ldd r17, Y+63 ; 0x3f 32260: 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){ 32262: 80 17 cp r24, r16 32264: 28 f0 brcs .+10 ; 0x32270 col = c08; row = r08; return match08; } col = c10; 32266: 22 96 adiw r28, 0x02 ; 2 32268: 6f ad ldd r22, Y+63 ; 0x3f 3226a: 22 97 sbiw r28, 0x02 ; 2 row = r10; 3226c: 19 81 ldd r17, Y+1 ; 0x01 3226e: 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){ 32270: 08 35 cpi r16, 0x58 ; 88 32272: 08 f4 brcc .+2 ; 0x32276 32274: 24 c4 rjmp .+2120 ; 0x32abe /// find precise circle /// move to the center of the pattern (+5.5) float xf = uc + 5.5f; 32276: 70 e0 ldi r23, 0x00 ; 0 32278: 90 e0 ldi r25, 0x00 ; 0 3227a: 80 e0 ldi r24, 0x00 ; 0 3227c: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 32280: 20 e0 ldi r18, 0x00 ; 0 32282: 30 e0 ldi r19, 0x00 ; 0 32284: 40 eb ldi r20, 0xB0 ; 176 32286: 50 e4 ldi r21, 0x40 ; 64 32288: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 3228c: 2b 01 movw r4, r22 3228e: 3c 01 movw r6, r24 32290: 65 96 adiw r28, 0x15 ; 21 32292: 4c ae std Y+60, r4 ; 0x3c 32294: 5d ae std Y+61, r5 ; 0x3d 32296: 6e ae std Y+62, r6 ; 0x3e 32298: 7f ae std Y+63, r7 ; 0x3f 3229a: 65 97 sbiw r28, 0x15 ; 21 float yf = ur + 5.5f; 3229c: 61 2f mov r22, r17 3229e: 70 e0 ldi r23, 0x00 ; 0 322a0: 90 e0 ldi r25, 0x00 ; 0 322a2: 80 e0 ldi r24, 0x00 ; 0 322a4: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 322a8: 20 e0 ldi r18, 0x00 ; 0 322aa: 30 e0 ldi r19, 0x00 ; 0 322ac: 40 eb ldi r20, 0xB0 ; 176 322ae: 50 e4 ldi r21, 0x40 ; 64 322b0: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 322b4: 4b 01 movw r8, r22 322b6: 5c 01 movw r10, r24 322b8: 25 96 adiw r28, 0x05 ; 5 322ba: 8c ae std Y+60, r8 ; 0x3c 322bc: 9d ae std Y+61, r9 ; 0x3d 322be: ae ae std Y+62, r10 ; 0x3e 322c0: bf ae std Y+63, r11 ; 0x3f 322c2: 25 97 sbiw r28, 0x05 ; 5 float radius = 4.5f; ///< default radius 322c4: 20 e0 ldi r18, 0x00 ; 0 322c6: 30 e0 ldi r19, 0x00 ; 0 322c8: 40 e9 ldi r20, 0x90 ; 144 322ca: 50 e4 ldi r21, 0x40 ; 64 322cc: 29 83 std Y+1, r18 ; 0x01 322ce: 3a 83 std Y+2, r19 ; 0x02 322d0: 4b 83 std Y+3, r20 ; 0x03 322d2: 5c 83 std Y+4, r21 ; 0x04 constexpr const uint8_t iterations = 20; dynamic_circle(matrix32, xf, yf, radius, iterations); 322d4: ae 01 movw r20, r28 322d6: 4f 5f subi r20, 0xFF ; 255 322d8: 5f 4f sbci r21, 0xFF ; 255 322da: be 01 movw r22, r28 322dc: 6f 5b subi r22, 0xBF ; 191 322de: 7f 4f sbci r23, 0xFF ; 255 322e0: ce 01 movw r24, r28 322e2: 8f 5a subi r24, 0xAF ; 175 322e4: 9f 4f sbci r25, 0xFF ; 255 322e6: 0f 94 fb 6a call 0x2d5f6 ; 0x2d5f6 if (fabs(xf - (uc + 5.5f)) > 3 || fabs(yf - (ur + 5.5f)) > 3 || fabs(radius - 5) > 3){ 322ea: a3 01 movw r20, r6 322ec: 92 01 movw r18, r4 322ee: 65 96 adiw r28, 0x15 ; 21 322f0: 6c ad ldd r22, Y+60 ; 0x3c 322f2: 7d ad ldd r23, Y+61 ; 0x3d 322f4: 8e ad ldd r24, Y+62 ; 0x3e 322f6: 9f ad ldd r25, Y+63 ; 0x3f 322f8: 65 97 sbiw r28, 0x15 ; 21 322fa: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 322fe: 6b 01 movw r12, r22 32300: 7c 01 movw r14, r24 32302: 9f 77 andi r25, 0x7F ; 127 32304: 20 e0 ldi r18, 0x00 ; 0 32306: 30 e0 ldi r19, 0x00 ; 0 32308: 40 e4 ldi r20, 0x40 ; 64 3230a: 50 e4 ldi r21, 0x40 ; 64 3230c: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 32310: 18 16 cp r1, r24 32312: 34 f1 brlt .+76 ; 0x32360 32314: a5 01 movw r20, r10 32316: 94 01 movw r18, r8 32318: 25 96 adiw r28, 0x05 ; 5 3231a: 6c ad ldd r22, Y+60 ; 0x3c 3231c: 7d ad ldd r23, Y+61 ; 0x3d 3231e: 8e ad ldd r24, Y+62 ; 0x3e 32320: 9f ad ldd r25, Y+63 ; 0x3f 32322: 25 97 sbiw r28, 0x05 ; 5 32324: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 32328: 9f 77 andi r25, 0x7F ; 127 3232a: 20 e0 ldi r18, 0x00 ; 0 3232c: 30 e0 ldi r19, 0x00 ; 0 3232e: 40 e4 ldi r20, 0x40 ; 64 32330: 50 e4 ldi r21, 0x40 ; 64 32332: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 32336: 18 16 cp r1, r24 32338: 9c f0 brlt .+38 ; 0x32360 3233a: 20 e0 ldi r18, 0x00 ; 0 3233c: 30 e0 ldi r19, 0x00 ; 0 3233e: 40 ea ldi r20, 0xA0 ; 160 32340: 50 e4 ldi r21, 0x40 ; 64 32342: 69 81 ldd r22, Y+1 ; 0x01 32344: 7a 81 ldd r23, Y+2 ; 0x02 32346: 8b 81 ldd r24, Y+3 ; 0x03 32348: 9c 81 ldd r25, Y+4 ; 0x04 3234a: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 3234e: 9f 77 andi r25, 0x7F ; 127 32350: 20 e0 ldi r18, 0x00 ; 0 32352: 30 e0 ldi r19, 0x00 ; 0 32354: 40 e4 ldi r20, 0x40 ; 64 32356: 50 e4 ldi r21, 0x40 ; 64 32358: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 3235c: 18 16 cp r1, r24 3235e: bc f5 brge .+110 ; 0x323ce //@size=88 DBG(_n(" [%f %f][%f] mm divergence\n"), xf - (uc + 5.5f), yf - (ur + 5.5f), radius - 5); 32360: 20 e0 ldi r18, 0x00 ; 0 32362: 30 e0 ldi r19, 0x00 ; 0 32364: 40 ea ldi r20, 0xA0 ; 160 32366: 50 e4 ldi r21, 0x40 ; 64 32368: 69 81 ldd r22, Y+1 ; 0x01 3236a: 7a 81 ldd r23, Y+2 ; 0x02 3236c: 8b 81 ldd r24, Y+3 ; 0x03 3236e: 9c 81 ldd r25, Y+4 ; 0x04 32370: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 32374: 9f 93 push r25 32376: 8f 93 push r24 32378: 7f 93 push r23 3237a: 6f 93 push r22 3237c: a5 01 movw r20, r10 3237e: 94 01 movw r18, r8 32380: 25 96 adiw r28, 0x05 ; 5 32382: 6c ad ldd r22, Y+60 ; 0x3c 32384: 7d ad ldd r23, Y+61 ; 0x3d 32386: 8e ad ldd r24, Y+62 ; 0x3e 32388: 9f ad ldd r25, Y+63 ; 0x3f 3238a: 25 97 sbiw r28, 0x05 ; 5 3238c: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 32390: 9f 93 push r25 32392: 8f 93 push r24 32394: 7f 93 push r23 32396: 6f 93 push r22 32398: ff 92 push r15 3239a: ef 92 push r14 3239c: df 92 push r13 3239e: cf 92 push r12 323a0: 81 e4 ldi r24, 0x41 ; 65 323a2: 95 ea ldi r25, 0xA5 ; 165 323a4: 9f 93 push r25 323a6: 8f 93 push r24 323a8: 0f 94 de da call 0x3b5bc ; 0x3b5bc /// dynamic algorithm diverged, use original position instead xf = uc + 5.5f; 323ac: 65 96 adiw r28, 0x15 ; 21 323ae: 4c ae std Y+60, r4 ; 0x3c 323b0: 5d ae std Y+61, r5 ; 0x3d 323b2: 6e ae std Y+62, r6 ; 0x3e 323b4: 7f ae std Y+63, r7 ; 0x3f 323b6: 65 97 sbiw r28, 0x15 ; 21 yf = ur + 5.5f; 323b8: 25 96 adiw r28, 0x05 ; 5 323ba: 8c ae std Y+60, r8 ; 0x3c 323bc: 9d ae std Y+61, r9 ; 0x3d 323be: ae ae std Y+62, r10 ; 0x3e 323c0: bf ae std Y+63, r11 ; 0x3f 323c2: 25 97 sbiw r28, 0x05 ; 5 323c4: 0f b6 in r0, 0x3f ; 63 323c6: f8 94 cli 323c8: de bf out 0x3e, r29 ; 62 323ca: 0f be out 0x3f, r0 ; 63 323cc: cd bf out 0x3d, r28 ; 61 } /// move to the center of area and convert to position xf = (float)x + (xf - 15.5f) * 64; 323ce: 20 e0 ldi r18, 0x00 ; 0 323d0: 30 e0 ldi r19, 0x00 ; 0 323d2: 48 e7 ldi r20, 0x78 ; 120 323d4: 51 e4 ldi r21, 0x41 ; 65 323d6: 65 96 adiw r28, 0x15 ; 21 323d8: 6c ad ldd r22, Y+60 ; 0x3c 323da: 7d ad ldd r23, Y+61 ; 0x3d 323dc: 8e ad ldd r24, Y+62 ; 0x3e 323de: 9f ad ldd r25, Y+63 ; 0x3f 323e0: 65 97 sbiw r28, 0x15 ; 21 323e2: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 323e6: 20 e0 ldi r18, 0x00 ; 0 323e8: 30 e0 ldi r19, 0x00 ; 0 323ea: 40 e8 ldi r20, 0x80 ; 128 323ec: 52 e4 ldi r21, 0x42 ; 66 323ee: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 323f2: 6b 01 movw r12, r22 323f4: 7c 01 movw r14, r24 323f6: 6c 96 adiw r28, 0x1c ; 28 323f8: ae ad ldd r26, Y+62 ; 0x3e 323fa: bf ad ldd r27, Y+63 ; 0x3f 323fc: 6c 97 sbiw r28, 0x1c ; 28 323fe: bd 01 movw r22, r26 32400: bb 0f add r27, r27 32402: 88 0b sbc r24, r24 32404: 99 0b sbc r25, r25 32406: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 3240a: 9b 01 movw r18, r22 3240c: ac 01 movw r20, r24 3240e: c7 01 movw r24, r14 32410: b6 01 movw r22, r12 32412: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 32416: 6b 01 movw r12, r22 32418: 7c 01 movw r14, r24 3241a: 65 96 adiw r28, 0x15 ; 21 3241c: cc ae std Y+60, r12 ; 0x3c 3241e: dd ae std Y+61, r13 ; 0x3d 32420: ee ae std Y+62, r14 ; 0x3e 32422: ff ae std Y+63, r15 ; 0x3f 32424: 65 97 sbiw r28, 0x15 ; 21 yf = (float)y + (yf - 15.5f) * 64; 32426: 20 e0 ldi r18, 0x00 ; 0 32428: 30 e0 ldi r19, 0x00 ; 0 3242a: 48 e7 ldi r20, 0x78 ; 120 3242c: 51 e4 ldi r21, 0x41 ; 65 3242e: 25 96 adiw r28, 0x05 ; 5 32430: 6c ad ldd r22, Y+60 ; 0x3c 32432: 7d ad ldd r23, Y+61 ; 0x3d 32434: 8e ad ldd r24, Y+62 ; 0x3e 32436: 9f ad ldd r25, Y+63 ; 0x3f 32438: 25 97 sbiw r28, 0x05 ; 5 3243a: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 3243e: 20 e0 ldi r18, 0x00 ; 0 32440: 30 e0 ldi r19, 0x00 ; 0 32442: 40 e8 ldi r20, 0x80 ; 128 32444: 52 e4 ldi r21, 0x42 ; 66 32446: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 3244a: 4b 01 movw r8, r22 3244c: 5c 01 movw r10, r24 3244e: ac 96 adiw r28, 0x2c ; 44 32450: ee ad ldd r30, Y+62 ; 0x3e 32452: ff ad ldd r31, Y+63 ; 0x3f 32454: ac 97 sbiw r28, 0x2c ; 44 32456: bf 01 movw r22, r30 32458: ff 0f add r31, r31 3245a: 88 0b sbc r24, r24 3245c: 99 0b sbc r25, r25 3245e: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 32462: 9b 01 movw r18, r22 32464: ac 01 movw r20, r24 32466: c5 01 movw r24, r10 32468: b4 01 movw r22, r8 3246a: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 3246e: 25 96 adiw r28, 0x05 ; 5 32470: 6c af std Y+60, r22 ; 0x3c 32472: 7d af std Y+61, r23 ; 0x3d 32474: 8e af std Y+62, r24 ; 0x3e 32476: 9f af std Y+63, r25 ; 0x3f 32478: 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; 3247a: 2a e0 ldi r18, 0x0A ; 10 3247c: 37 ed ldi r19, 0xD7 ; 215 3247e: 43 e2 ldi r20, 0x23 ; 35 32480: 5c e3 ldi r21, 0x3C ; 60 32482: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__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)); 32486: 9f 93 push r25 32488: 8f 93 push r24 3248a: 7f 93 push r23 3248c: 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; 3248e: 2a e0 ldi r18, 0x0A ; 10 32490: 37 ed ldi r19, 0xD7 ; 215 32492: 43 e2 ldi r20, 0x23 ; 35 32494: 5c e3 ldi r21, 0x3C ; 60 32496: c7 01 movw r24, r14 32498: b6 01 movw r22, r12 3249a: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__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)); 3249e: 9f 93 push r25 324a0: 8f 93 push r24 324a2: 7f 93 push r23 324a4: 6f 93 push r22 324a6: 85 e2 ldi r24, 0x25 ; 37 324a8: 95 ea ldi r25, 0xA5 ; 165 324aa: 9f 93 push r25 324ac: 8f 93 push r24 324ae: 0f 94 de da call 0x3b5bc ; 0x3b5bc uint16_t round_to_u16(float f){ return (uint16_t)(f + .5f); } int16_t round_to_i16(float f){ return (int16_t)(f + .5f); 324b2: 20 e0 ldi r18, 0x00 ; 0 324b4: 30 e0 ldi r19, 0x00 ; 0 324b6: 40 e0 ldi r20, 0x00 ; 0 324b8: 5f e3 ldi r21, 0x3F ; 63 324ba: 25 96 adiw r28, 0x05 ; 5 324bc: 6c ad ldd r22, Y+60 ; 0x3c 324be: 7d ad ldd r23, Y+61 ; 0x3d 324c0: 8e ad ldd r24, Y+62 ; 0x3e 324c2: 9f ad ldd r25, Y+63 ; 0x3f 324c4: 25 97 sbiw r28, 0x05 ; 5 324c6: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 324ca: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> 324ce: 6b 01 movw r12, r22 324d0: 20 e0 ldi r18, 0x00 ; 0 324d2: 30 e0 ldi r19, 0x00 ; 0 324d4: 40 e0 ldi r20, 0x00 ; 0 324d6: 5f e3 ldi r21, 0x3F ; 63 324d8: 65 96 adiw r28, 0x15 ; 21 324da: 6c ad ldd r22, Y+60 ; 0x3c 324dc: 7d ad ldd r23, Y+61 ; 0x3d 324de: 8e ad ldd r24, Y+62 ; 0x3e 324e0: 9f ad ldd r25, Y+63 ; 0x3f 324e2: 65 97 sbiw r28, 0x15 ; 21 324e4: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 324e8: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> 324ec: 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); 324ee: 00 e0 ldi r16, 0x00 ; 0 324f0: 28 ec ldi r18, 0xC8 ; 200 324f2: 30 e0 ldi r19, 0x00 ; 0 324f4: e7 96 adiw r28, 0x37 ; 55 324f6: 4e ad ldd r20, Y+62 ; 0x3e 324f8: 5f ad ldd r21, Y+63 ; 0x3f 324fa: e7 97 sbiw r28, 0x37 ; 55 324fc: b6 01 movw r22, r12 324fe: 0e 94 75 eb call 0x1d6ea ; 0x1d6ea 32502: 0f b6 in r0, 0x3f ; 63 32504: f8 94 cli 32506: de bf out 0x3e, r29 ; 62 32508: 0f be out 0x3f, r0 ; 63 3250a: cd bf out 0x3d, r28 ; 61 ret = BED_SKEW_OFFSET_DETECTION_POINT_FOUND; 3250c: 10 e0 ldi r17, 0x00 ; 0 3250e: 85 ea ldi r24, 0xA5 ; 165 32510: 9d e0 ldi r25, 0x0D ; 13 } /// wipe buffer for (uint16_t i = 0; i < sizeof(block_t)*BLOCK_BUFFER_SIZE; i++) matrix32[i] = 0; 32512: a4 96 adiw r28, 0x24 ; 36 32514: ae ad ldd r26, Y+62 ; 0x3e 32516: bf ad ldd r27, Y+63 ; 0x3f 32518: a4 97 sbiw r28, 0x24 ; 36 3251a: 1d 92 st X+, r1 3251c: a4 96 adiw r28, 0x24 ; 36 3251e: bf af std Y+63, r27 ; 0x3f 32520: ae af std Y+62, r26 ; 0x3e 32522: 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++) 32524: 8a 17 cp r24, r26 32526: 9b 07 cpc r25, r27 32528: a1 f7 brne .-24 ; 0x32512 3252a: b5 c0 rjmp .+362 ; 0x32696 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)); 3252c: 8b e7 ldi r24, 0x7B ; 123 3252e: 9b e5 ldi r25, 0x5B ; 91 32530: 0e 94 ac 72 call 0xe558 ; 0xe558 32534: 0f 94 e4 1f call 0x23fc8 ; 0x23fc8 lcd_puts_at_P(0,3,_n("1/4")); 32538: 4b e6 ldi r20, 0x6B ; 107 3253a: 50 e7 ldi r21, 0x70 ; 112 3253c: bc cb rjmp .-2184 ; 0x31cb6 } } } else { lcd_show_fullscreen_message_and_wait_P(PSTR("Calibration failed! Check the axes and run again.")); 3253e: 8b e0 ldi r24, 0x0B ; 11 32540: 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); 32542: 0f 94 f1 1f call 0x23fe2 ; 0x23fe2 32546: 9f cb rjmp .-2242 ; 0x31c86 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); 32548: c7 55 subi r28, 0x57 ; 87 3254a: df 4f sbci r29, 0xFF ; 255 3254c: 88 81 ld r24, Y 3254e: 99 81 ldd r25, Y+1 ; 0x01 32550: c9 5a subi r28, 0xA9 ; 169 32552: d0 40 sbci r29, 0x00 ; 0 32554: 0e 94 ce 66 call 0xcd9c ; 0xcd9c // Z only calibration. // Load the machine correction matrix world2machine_initialize(); 32558: 0f 94 9b ce call 0x39d36 ; 0x39d36 // and correct the current_position to match the transformed coordinate system. world2machine_update_current(); 3255c: 0f 94 39 cc call 0x39872 ; 0x39872 //FIXME bool result = sample_mesh_and_store_reference(); 32560: 0f 94 48 ca call 0x39490 ; 0x39490 32564: e5 96 adiw r28, 0x35 ; 53 32566: 8f af std Y+63, r24 ; 0x3f 32568: e5 97 sbiw r28, 0x35 ; 53 if (result) 3256a: 88 23 and r24, r24 3256c: 09 f4 brne .+2 ; 0x32570 3256e: 8b cb rjmp .-2282 ; 0x31c86 { calibration_status_set(CALIBRATION_STATUS_Z); 32570: 84 e0 ldi r24, 0x04 ; 4 32572: 0e 94 92 ee call 0x1dd24 ; 0x1dd24 } else { // Timeouted. } lcd_update_enable(true); 32576: 81 e0 ldi r24, 0x01 ; 1 32578: 0e 94 25 6f call 0xde4a ; 0xde4a #ifdef TMC2130 FORCE_HIGH_POWER_END; 3257c: 80 e0 ldi r24, 0x00 ; 0 3257e: 0e 94 b0 66 call 0xcd60 ; 0xcd60 #endif // TMC2130 FORCE_BL_ON_END; 32582: 80 e0 ldi r24, 0x00 ; 0 32584: 0e 94 49 8a call 0x11492 ; 0x11492 return final_result; } 32588: e5 96 adiw r28, 0x35 ; 53 3258a: 8f ad ldd r24, Y+63 ; 0x3f 3258c: e5 97 sbiw r28, 0x35 ; 53 3258e: c2 53 subi r28, 0x32 ; 50 32590: df 4f sbci r29, 0xFF ; 255 32592: 0f b6 in r0, 0x3f ; 63 32594: f8 94 cli 32596: de bf out 0x3e, r29 ; 62 32598: 0f be out 0x3f, r0 ; 63 3259a: cd bf out 0x3d, r28 ; 61 3259c: df 91 pop r29 3259e: cf 91 pop r28 325a0: 1f 91 pop r17 325a2: 0f 91 pop r16 325a4: ff 90 pop r15 325a6: ef 90 pop r14 325a8: df 90 pop r13 325aa: cf 90 pop r12 325ac: bf 90 pop r11 325ae: af 90 pop r10 325b0: 9f 90 pop r9 325b2: 8f 90 pop r8 325b4: 7f 90 pop r7 325b6: 6f 90 pop r6 325b8: 5f 90 pop r5 325ba: 4f 90 pop r4 325bc: 3f 90 pop r3 325be: 2f 90 pop r2 325c0: 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) { 325c2: e1 e0 ldi r30, 0x01 ; 1 325c4: e1 96 adiw r28, 0x31 ; 49 325c6: ef af std Y+63, r30 ; 0x3f 325c8: e1 97 sbiw r28, 0x31 ; 49 325ca: 0f cc rjmp .-2018 ; 0x31dea 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) 325cc: fe 01 movw r30, r28 325ce: 31 96 adiw r30, 0x01 ; 1 325d0: 7f 01 movw r14, r30 325d2: 10 e0 ldi r17, 0x00 ; 0 325d4: 00 e0 ldi r16, 0x00 ; 0 325d6: 24 e8 ldi r18, 0x84 ; 132 325d8: 33 e0 ldi r19, 0x03 ; 3 325da: a6 01 movw r20, r12 325dc: 69 2d mov r22, r9 325de: 78 2d mov r23, r8 325e0: 8b 2d mov r24, r11 325e2: 9a 2d mov r25, r10 325e4: 0f 94 7b 6e call 0x2dcf6 ; 0x2dcf6 ad += 0; if (!ret && (ad < 1440)) 325e8: 88 23 and r24, r24 325ea: 09 f4 brne .+2 ; 0x325ee 325ec: 06 cd rjmp .-1524 ; 0x31ffa 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; 325ee: 89 81 ldd r24, Y+1 ; 0x01 325f0: 9a 81 ldd r25, Y+2 ; 0x02 325f2: 23 cd rjmp .-1466 ; 0x3203a 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)) 325f4: 89 81 ldd r24, Y+1 ; 0x01 325f6: 9a 81 ldd r25, Y+2 ; 0x02 325f8: 80 34 cpi r24, 0x40 ; 64 325fa: 9b 40 sbci r25, 0x0B ; 11 325fc: b8 f4 brcc .+46 ; 0x3262c if ((ret = xyzcal_spiral2(cx, cy, z0 - 3*dz, dz, -radius, 180, delay_us, check_pinda, &ad)) != 0) 325fe: ce 01 movw r24, r28 32600: 01 96 adiw r24, 0x01 ; 1 32602: 7c 01 movw r14, r24 32604: 04 eb ldi r16, 0xB4 ; 180 32606: 10 e0 ldi r17, 0x00 ; 0 32608: 2c e7 ldi r18, 0x7C ; 124 3260a: 3c ef ldi r19, 0xFC ; 252 3260c: a6 01 movw r20, r12 3260e: 4c 52 subi r20, 0x2C ; 44 32610: 51 40 sbci r21, 0x01 ; 1 32612: 69 2d mov r22, r9 32614: 78 2d mov r23, r8 32616: 8b 2d mov r24, r11 32618: 9a 2d mov r25, r10 3261a: 0f 94 7b 6e call 0x2dcf6 ; 0x2dcf6 3261e: 88 23 and r24, r24 32620: 29 f0 breq .+10 ; 0x3262c ad += 2160; 32622: 89 81 ldd r24, Y+1 ; 0x01 32624: 9a 81 ldd r25, Y+2 ; 0x02 32626: 80 59 subi r24, 0x90 ; 144 32628: 97 4f sbci r25, 0xF7 ; 247 3262a: 07 cd rjmp .-1522 ; 0x3203a /// 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; 3262c: 90 e9 ldi r25, 0x90 ; 144 3262e: c9 1a sub r12, r25 32630: 91 e0 ldi r25, 0x01 ; 1 32632: d9 0a sbc r13, r25 32634: ba cc rjmp .-1676 ; 0x31faa } //@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]); 32636: 00 91 bb 06 lds r16, 0x06BB ; 0x8006bb 3263a: 10 91 bc 06 lds r17, 0x06BC ; 0x8006bc 3263e: 20 91 bd 06 lds r18, 0x06BD ; 0x8006bd 32642: 30 91 be 06 lds r19, 0x06BE ; 0x8006be 32646: 40 91 b7 06 lds r20, 0x06B7 ; 0x8006b7 3264a: 50 91 b8 06 lds r21, 0x06B8 ; 0x8006b8 3264e: 60 91 b9 06 lds r22, 0x06B9 ; 0x8006b9 32652: 70 91 ba 06 lds r23, 0x06BA ; 0x8006ba 32656: 80 91 b3 06 lds r24, 0x06B3 ; 0x8006b3 3265a: 90 91 b4 06 lds r25, 0x06B4 ; 0x8006b4 3265e: a0 91 b5 06 lds r26, 0x06B5 ; 0x8006b5 32662: b0 91 b6 06 lds r27, 0x06B6 ; 0x8006b6 32666: 3f 93 push r19 32668: 2f 93 push r18 3266a: 1f 93 push r17 3266c: 0f 93 push r16 3266e: 7f 93 push r23 32670: 6f 93 push r22 32672: 5f 93 push r21 32674: 4f 93 push r20 32676: bf 93 push r27 32678: af 93 push r26 3267a: 9f 93 push r25 3267c: 8f 93 push r24 3267e: 8d ea ldi r24, 0xAD ; 173 32680: 94 ea ldi r25, 0xA4 ; 164 32682: 9f 93 push r25 32684: 8f 93 push r24 32686: 0f 94 de da call 0x3b5bc ; 0x3b5bc 3268a: 0f b6 in r0, 0x3f ; 63 3268c: f8 94 cli 3268e: de bf out 0x3e, r29 ; 62 32690: 0f be out 0x3f, r0 ; 63 32692: 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; 32694: 1f ef ldi r17, 0xFF ; 255 sm4_calc_delay_cb = xyzcal_calc_delay; } void xyzcal_measure_leave(void) { DBG(_n("xyzcal_measure_leave\n")); 32696: 8d e8 ldi r24, 0x8D ; 141 32698: 95 ea ldi r25, 0xA5 ; 165 3269a: 9f 93 push r25 3269c: 8f 93 push r24 3269e: 0f 94 de da call 0x3b5bc ; 0x3b5bc lcd_set_cursor(4,3); 326a2: 63 e0 ldi r22, 0x03 ; 3 326a4: 84 e0 ldi r24, 0x04 ; 4 326a6: 0e 94 e0 6e call 0xddc0 ; 0xddc0 lcd_space(16); 326aa: 80 e1 ldi r24, 0x10 ; 16 326ac: 0e 94 d6 6e call 0xddac ; 0xddac // resync planner position from counters (changed by xyzcal_update_pos) planner_reset_position(); 326b0: 0f 94 7c c0 call 0x380f8 ; 0x380f8 : "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" ); 326b4: 88 e1 ldi r24, 0x18 ; 24 326b6: 98 e2 ldi r25, 0x28 ; 40 326b8: 0f b6 in r0, 0x3f ; 63 326ba: f8 94 cli 326bc: a8 95 wdr 326be: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 326c2: 0f be out 0x3f, r0 ; 63 326c4: 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); 326c8: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 326cc: 80 64 ori r24, 0x40 ; 64 326ce: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> #endif //EMERGENCY_HANDLERS #endif //WATCHDOG ENABLE_STEPPER_DRIVER_INTERRUPT(); 326d2: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 326d6: 82 60 ori r24, 0x02 ; 2 326d8: 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){ 326dc: 0f 90 pop r0 326de: 0f 90 pop r0 326e0: 1d 3f cpi r17, 0xFD ; 253 326e2: 09 f4 brne .+2 ; 0x326e6 326e4: ee c1 rjmp .+988 ; 0x32ac2 326e6: 1f 3f cpi r17, 0xFF ; 255 326e8: 11 f4 brne .+4 ; 0x326ee 326ea: 0d 94 ac 9e jmp 0x33d58 ; 0x33d58 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); 326ee: 20 e0 ldi r18, 0x00 ; 0 326f0: 30 e0 ldi r19, 0x00 ; 0 326f2: a9 01 movw r20, r18 326f4: a0 96 adiw r28, 0x20 ; 32 326f6: ee ad ldd r30, Y+62 ; 0x3e 326f8: ff ad ldd r31, Y+63 ; 0x3f 326fa: a0 97 sbiw r28, 0x20 ; 32 326fc: 61 81 ldd r22, Z+1 ; 0x01 326fe: 72 81 ldd r23, Z+2 ; 0x02 32700: 83 81 ldd r24, Z+3 ; 0x03 32702: 94 81 ldd r25, Z+4 ; 0x04 32704: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> pt[0] += (current_position[X_AXIS]/(iteration + 1)); //count average 32708: 20 91 92 06 lds r18, 0x0692 ; 0x800692 3270c: 30 91 93 06 lds r19, 0x0693 ; 0x800693 32710: 40 91 94 06 lds r20, 0x0694 ; 0x800694 32714: 50 91 95 06 lds r21, 0x0695 ; 0x800695 32718: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 3271c: a0 96 adiw r28, 0x20 ; 32 3271e: ae ad ldd r26, Y+62 ; 0x3e 32720: bf ad ldd r27, Y+63 ; 0x3f 32722: a0 97 sbiw r28, 0x20 ; 32 32724: 11 96 adiw r26, 0x01 ; 1 32726: 6d 93 st X+, r22 32728: 7d 93 st X+, r23 3272a: 8d 93 st X+, r24 3272c: 9c 93 st X, r25 3272e: 14 97 sbiw r26, 0x04 ; 4 pt[1] = (pt[1] * iteration) / (iteration + 1); pt[1] += (current_position[Y_AXIS] / (iteration + 1)); 32730: c0 90 96 06 lds r12, 0x0696 ; 0x800696 32734: d0 90 97 06 lds r13, 0x0697 ; 0x800697 32738: e0 90 98 06 lds r14, 0x0698 ; 0x800698 3273c: f0 90 99 06 lds r15, 0x0699 ; 0x800699 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); 32740: 20 e0 ldi r18, 0x00 ; 0 32742: 30 e0 ldi r19, 0x00 ; 0 32744: a9 01 movw r20, r18 32746: 15 96 adiw r26, 0x05 ; 5 32748: 6d 91 ld r22, X+ 3274a: 7d 91 ld r23, X+ 3274c: 8d 91 ld r24, X+ 3274e: 9c 91 ld r25, X 32750: 18 97 sbiw r26, 0x08 ; 8 32752: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> pt[1] += (current_position[Y_AXIS] / (iteration + 1)); 32756: a7 01 movw r20, r14 32758: 96 01 movw r18, r12 3275a: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 3275e: a0 96 adiw r28, 0x20 ; 32 32760: ee ad ldd r30, Y+62 ; 0x3e 32762: ff ad ldd r31, Y+63 ; 0x3f 32764: a0 97 sbiw r28, 0x20 ; 32 32766: 65 83 std Z+5, r22 ; 0x05 32768: 76 83 std Z+6, r23 ; 0x06 3276a: 87 83 std Z+7, r24 ; 0x07 3276c: 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) 3276e: 20 e0 ldi r18, 0x00 ; 0 32770: 30 e0 ldi r19, 0x00 ; 0 32772: 40 e8 ldi r20, 0x80 ; 128 32774: 50 ec ldi r21, 0xC0 ; 192 32776: c7 01 movw r24, r14 32778: b6 01 movw r22, r12 3277a: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 3277e: 87 ff sbrs r24, 7 32780: 0c c0 rjmp .+24 ; 0x3279a current_position[Y_AXIS] = Y_MIN_POS; 32782: 80 e0 ldi r24, 0x00 ; 0 32784: 90 e0 ldi r25, 0x00 ; 0 32786: a0 e8 ldi r26, 0x80 ; 128 32788: b0 ec ldi r27, 0xC0 ; 192 3278a: 80 93 96 06 sts 0x0696, r24 ; 0x800696 3278e: 90 93 97 06 sts 0x0697, r25 ; 0x800697 32792: a0 93 98 06 sts 0x0698, r26 ; 0x800698 32796: b0 93 99 06 sts 0x0699, r27 ; 0x800699 // 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; 3279a: 20 e0 ldi r18, 0x00 ; 0 3279c: 30 e0 ldi r19, 0x00 ; 0 3279e: 40 e4 ldi r20, 0x40 ; 64 327a0: 50 e4 ldi r21, 0x40 ; 64 327a2: 60 91 9a 06 lds r22, 0x069A ; 0x80069a 327a6: 70 91 9b 06 lds r23, 0x069B ; 0x80069b 327aa: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 327ae: 90 91 9d 06 lds r25, 0x069D ; 0x80069d 327b2: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 327b6: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a 327ba: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b 327be: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c 327c2: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d 327c6: e0 96 adiw r28, 0x30 ; 48 327c8: 2e ad ldd r18, Y+62 ; 0x3e 327ca: 3f ad ldd r19, Y+63 ; 0x3f 327cc: e0 97 sbiw r28, 0x30 ; 48 327ce: 28 5f subi r18, 0xF8 ; 248 327d0: 3f 4f sbci r19, 0xFF ; 255 327d2: e0 96 adiw r28, 0x30 ; 48 327d4: 3f af std Y+63, r19 ; 0x3f 327d6: 2e af std Y+62, r18 ; 0x3e 327d8: e0 97 sbiw r28, 0x30 ; 48 327da: a0 96 adiw r28, 0x20 ; 32 327dc: 4e ad ldd r20, Y+62 ; 0x3e 327de: 5f ad ldd r21, Y+63 ; 0x3f 327e0: a0 97 sbiw r28, 0x20 ; 32 327e2: 48 5f subi r20, 0xF8 ; 248 327e4: 5f 4f sbci r21, 0xFF ; 255 327e6: a0 96 adiw r28, 0x20 ; 32 327e8: 5f af std Y+63, r21 ; 0x3f 327ea: 4e af std Y+62, r20 ; 0x3e 327ec: 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) { 327ee: 54 e0 ldi r21, 0x04 ; 4 327f0: 25 16 cp r2, r21 327f2: 31 04 cpc r3, r1 327f4: 09 f0 breq .+2 ; 0x327f8 327f6: 16 cb rjmp .-2516 ; 0x31e24 go_to_current(homing_feedrate[X_AXIS] / 60.f); delay_keep_alive(3000); } #endif // SUPPORT_VERBOSITY } if (!retry) 327f8: a7 96 adiw r28, 0x27 ; 39 327fa: 6f ad ldd r22, Y+63 ; 0x3f 327fc: a7 97 sbiw r28, 0x27 ; 39 327fe: 66 23 and r22, r22 32800: 31 f0 breq .+12 ; 0x3280e 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) { 32802: e1 96 adiw r28, 0x31 ; 49 32804: 8f ad ldd r24, Y+63 ; 0x3f 32806: e1 97 sbiw r28, 0x31 ; 49 32808: 81 30 cpi r24, 0x01 ; 1 3280a: 09 f0 breq .+2 ; 0x3280e 3280c: da ce rjmp .-588 ; 0x325c2 #endif // SUPPORT_VERBOSITY } if (!retry) break; } DBG(_n("All 4 calibration points found.\n")); 3280e: 86 e4 ldi r24, 0x46 ; 70 32810: 90 e7 ldi r25, 0x70 ; 112 32812: 9f 93 push r25 32814: 8f 93 push r24 32816: 0f 94 de da call 0x3b5bc ; 0x3b5bc delay_keep_alive(0); //manage_heater, reset watchdog, manage inactivity 3281a: 90 e0 ldi r25, 0x00 ; 0 3281c: 80 e0 ldi r24, 0x00 ; 0 3281e: 0e 94 e4 8c call 0x119c8 ; 0x119c8 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) { 32822: 0f 90 pop r0 32824: 0f 90 pop r0 32826: 20 e0 ldi r18, 0x00 ; 0 32828: 30 e0 ldi r19, 0x00 ; 0 3282a: 40 e9 ldi r20, 0x90 ; 144 3282c: 50 ec ldi r21, 0xC0 ; 192 3282e: 60 91 c7 13 lds r22, 0x13C7 ; 0x8013c7 32832: 70 91 c8 13 lds r23, 0x13C8 ; 0x8013c8 32836: 80 91 c9 13 lds r24, 0x13C9 ; 0x8013c9 3283a: 90 91 ca 13 lds r25, 0x13CA ; 0x8013ca 3283e: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 32842: 87 ff sbrs r24, 7 32844: 45 c1 rjmp .+650 ; 0x32ad0 too_far_mask |= 1 << 1; //front center point is out of reach SERIAL_ECHOLNPGM(""); 32846: 89 ed ldi r24, 0xD9 ; 217 32848: 95 ea ldi r25, 0xA5 ; 165 3284a: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 SERIAL_ECHOPGM("WARNING: Front point not reachable. Y coordinate:"); 3284e: 87 ea ldi r24, 0xA7 ; 167 32850: 95 ea ldi r25, 0xA5 ; 165 32852: 0e 94 50 77 call 0xeea0 ; 0xeea0 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 32856: 60 91 c7 13 lds r22, 0x13C7 ; 0x8013c7 3285a: 70 91 c8 13 lds r23, 0x13C8 ; 0x8013c8 3285e: 80 91 c9 13 lds r24, 0x13C9 ; 0x8013c9 32862: 90 91 ca 13 lds r25, 0x13CA ; 0x8013ca 32866: 42 e0 ldi r20, 0x02 ; 2 32868: 0f 94 87 d5 call 0x3ab0e ; 0x3ab0e MYSERIAL.print(pts[1]); SERIAL_ECHOPGM(" < "); 3286c: 83 ea ldi r24, 0xA3 ; 163 3286e: 95 ea ldi r25, 0xA5 ; 165 32870: 0e 94 50 77 call 0xeea0 ; 0xeea0 MYSERIAL.println(Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 32874: 60 e0 ldi r22, 0x00 ; 0 32876: 70 e0 ldi r23, 0x00 ; 0 32878: 80 e9 ldi r24, 0x90 ; 144 3287a: 90 ec ldi r25, 0xC0 ; 192 3287c: 0f 94 b4 74 call 0x2e968 ; 0x2e968 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 32880: 92 e0 ldi r25, 0x02 ; 2 32882: af 96 adiw r28, 0x2f ; 47 32884: 9f af std Y+63, r25 ; 0x3f 32886: 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; 32888: 10 92 f3 13 sts 0x13F3, r1 ; 0x8013f3 3288c: 10 92 f4 13 sts 0x13F4, r1 ; 0x8013f4 32890: 10 92 f5 13 sts 0x13F5, r1 ; 0x8013f5 32894: 10 92 f6 13 sts 0x13F6, r1 ; 0x8013f6 cntr[1] = 0.f; 32898: 10 92 f7 13 sts 0x13F7, r1 ; 0x8013f7 3289c: 10 92 f8 13 sts 0x13F8, r1 ; 0x8013f8 328a0: 10 92 f9 13 sts 0x13F9, r1 ; 0x8013f9 328a4: 10 92 fa 13 sts 0x13FA, r1 ; 0x8013fa 328a8: a4 e6 ldi r26, 0x64 ; 100 328aa: e6 96 adiw r28, 0x36 ; 54 328ac: af af std Y+63, r26 ; 0x3f 328ae: 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; 328b0: a2 96 adiw r28, 0x22 ; 34 328b2: 1c ae std Y+60, r1 ; 0x3c 328b4: 1d ae std Y+61, r1 ; 0x3d 328b6: 1e ae std Y+62, r1 ; 0x3e 328b8: 1f ae std Y+63, r1 ; 0x3f 328ba: 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; 328bc: a6 96 adiw r28, 0x26 ; 38 328be: 1c ae std Y+60, r1 ; 0x3c 328c0: 1d ae std Y+61, r1 ; 0x3d 328c2: 1e ae std Y+62, r1 ; 0x3e 328c4: 1f ae std Y+63, r1 ; 0x3f 328c6: 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 }; 328c8: fe 01 movw r30, r28 328ca: 31 96 adiw r30, 0x01 ; 1 328cc: 68 96 adiw r28, 0x18 ; 24 328ce: ff af std Y+63, r31 ; 0x3f 328d0: ee af std Y+62, r30 ; 0x3e 328d2: 68 97 sbiw r28, 0x18 ; 24 float b[4] = { 0.f }; 328d4: 9e 01 movw r18, r28 328d6: 2f 5b subi r18, 0xBF ; 191 328d8: 3f 4f sbci r19, 0xFF ; 255 328da: 6a 96 adiw r28, 0x1a ; 26 328dc: 3f af std Y+63, r19 ; 0x3f 328de: 2e af std Y+62, r18 ; 0x3e 328e0: 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; 328e2: a6 96 adiw r28, 0x26 ; 38 328e4: 6c ad ldd r22, Y+60 ; 0x3c 328e6: 7d ad ldd r23, Y+61 ; 0x3d 328e8: 8e ad ldd r24, Y+62 ; 0x3e 328ea: 9f ad ldd r25, Y+63 ; 0x3f 328ec: a6 97 sbiw r28, 0x26 ; 38 328ee: 0f 94 3e de call 0x3bc7c ; 0x3bc7c 328f2: 6e 96 adiw r28, 0x1e ; 30 328f4: 6c af std Y+60, r22 ; 0x3c 328f6: 7d af std Y+61, r23 ; 0x3d 328f8: 8e af std Y+62, r24 ; 0x3e 328fa: 9f af std Y+63, r25 ; 0x3f 328fc: 6e 97 sbiw r28, 0x1e ; 30 float s1 = sin(a1) * MACHINE_AXIS_SCALE_X; 328fe: a6 96 adiw r28, 0x26 ; 38 32900: 6c ad ldd r22, Y+60 ; 0x3c 32902: 7d ad ldd r23, Y+61 ; 0x3d 32904: 8e ad ldd r24, Y+62 ; 0x3e 32906: 9f ad ldd r25, Y+63 ; 0x3f 32908: a6 97 sbiw r28, 0x26 ; 38 3290a: 0f 94 04 e1 call 0x3c208 ; 0x3c208 3290e: cb 57 subi r28, 0x7B ; 123 32910: df 4f sbci r29, 0xFF ; 255 32912: 68 83 st Y, r22 32914: 79 83 std Y+1, r23 ; 0x01 32916: 8a 83 std Y+2, r24 ; 0x02 32918: 9b 83 std Y+3, r25 ; 0x03 3291a: c5 58 subi r28, 0x85 ; 133 3291c: d0 40 sbci r29, 0x00 ; 0 float c2 = cos(a2) * MACHINE_AXIS_SCALE_Y; 3291e: a2 96 adiw r28, 0x22 ; 34 32920: 6c ad ldd r22, Y+60 ; 0x3c 32922: 7d ad ldd r23, Y+61 ; 0x3d 32924: 8e ad ldd r24, Y+62 ; 0x3e 32926: 9f ad ldd r25, Y+63 ; 0x3f 32928: a2 97 sbiw r28, 0x22 ; 34 3292a: 0f 94 3e de call 0x3bc7c ; 0x3bc7c 3292e: c7 57 subi r28, 0x77 ; 119 32930: df 4f sbci r29, 0xFF ; 255 32932: 68 83 st Y, r22 32934: 79 83 std Y+1, r23 ; 0x01 32936: 8a 83 std Y+2, r24 ; 0x02 32938: 9b 83 std Y+3, r25 ; 0x03 3293a: c9 58 subi r28, 0x89 ; 137 3293c: d0 40 sbci r29, 0x00 ; 0 float s2 = sin(a2) * MACHINE_AXIS_SCALE_Y; 3293e: a2 96 adiw r28, 0x22 ; 34 32940: 6c ad ldd r22, Y+60 ; 0x3c 32942: 7d ad ldd r23, Y+61 ; 0x3d 32944: 8e ad ldd r24, Y+62 ; 0x3e 32946: 9f ad ldd r25, Y+63 ; 0x3f 32948: a2 97 sbiw r28, 0x22 ; 34 3294a: 0f 94 04 e1 call 0x3c208 ; 0x3c208 3294e: cb 56 subi r28, 0x6B ; 107 32950: df 4f sbci r29, 0xFF ; 255 32952: 68 83 st Y, r22 32954: 79 83 std Y+1, r23 ; 0x01 32956: 8a 83 std Y+2, r24 ; 0x02 32958: 9b 83 std Y+3, r25 ; 0x03 3295a: c5 59 subi r28, 0x95 ; 149 3295c: d0 40 sbci r29, 0x00 ; 0 // Prepare the Normal equation for the Gauss-Newton method. float A[4][4] = { 0.f }; 3295e: 68 96 adiw r28, 0x18 ; 24 32960: ae ad ldd r26, Y+62 ; 0x3e 32962: bf ad ldd r27, Y+63 ; 0x3f 32964: 68 97 sbiw r28, 0x18 ; 24 32966: e0 e4 ldi r30, 0x40 ; 64 32968: 1d 92 st X+, r1 3296a: ea 95 dec r30 3296c: e9 f7 brne .-6 ; 0x32968 float b[4] = { 0.f }; 3296e: 80 e1 ldi r24, 0x10 ; 16 32970: 6a 96 adiw r28, 0x1a ; 26 32972: ae ad ldd r26, Y+62 ; 0x3e 32974: bf ad ldd r27, Y+63 ; 0x3f 32976: 6a 97 sbiw r28, 0x1a ; 26 32978: 1d 92 st X+, r1 3297a: 8a 95 dec r24 3297c: e9 f7 brne .-6 ; 0x32978 float acc; delay_keep_alive(0); //manage heater, reset watchdog, manage inactivity 3297e: 90 e0 ldi r25, 0x00 ; 0 32980: 80 e0 ldi r24, 0x00 ; 0 32982: 0e 94 e4 8c call 0x119c8 ; 0x119c8 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); 32986: 20 91 f3 13 lds r18, 0x13F3 ; 0x8013f3 3298a: 30 91 f4 13 lds r19, 0x13F4 ; 0x8013f4 3298e: 40 91 f5 13 lds r20, 0x13F5 ; 0x8013f5 32992: 50 91 f6 13 lds r21, 0x13F6 ; 0x8013f6 32996: c5 55 subi r28, 0x55 ; 85 32998: df 4f sbci r29, 0xFF ; 255 3299a: 28 83 st Y, r18 3299c: 39 83 std Y+1, r19 ; 0x01 3299e: 4a 83 std Y+2, r20 ; 0x02 329a0: 5b 83 std Y+3, r21 ; 0x03 329a2: cb 5a subi r28, 0xAB ; 171 329a4: 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); 329a6: 80 91 f7 13 lds r24, 0x13F7 ; 0x8013f7 329aa: 90 91 f8 13 lds r25, 0x13F8 ; 0x8013f8 329ae: a0 91 f9 13 lds r26, 0x13F9 ; 0x8013f9 329b2: b0 91 fa 13 lds r27, 0x13FA ; 0x8013fa 329b6: c1 55 subi r28, 0x51 ; 81 329b8: df 4f sbci r29, 0xFF ; 255 329ba: 88 83 st Y, r24 329bc: 99 83 std Y+1, r25 ; 0x01 329be: aa 83 std Y+2, r26 ; 0x02 329c0: bb 83 std Y+3, r27 ; 0x03 329c2: cf 5a subi r28, 0xAF ; 175 329c4: d0 40 sbci r29, 0x00 ; 0 329c6: de 01 movw r26, r28 329c8: af 5b subi r26, 0xBF ; 191 329ca: bf 4f sbci r27, 0xFF ; 255 329cc: c7 56 subi r28, 0x67 ; 103 329ce: df 4f sbci r29, 0xFF ; 255 329d0: b9 83 std Y+1, r27 ; 0x01 329d2: a8 83 st Y, r26 329d4: c9 59 subi r28, 0x99 ; 153 329d6: d0 40 sbci r29, 0x00 ; 0 329d8: fe 01 movw r30, r28 329da: 31 96 adiw r30, 0x01 ; 1 329dc: ac 96 adiw r28, 0x2c ; 44 329de: ff af std Y+63, r31 ; 0x3f 329e0: ee af std Y+62, r30 ; 0x3e 329e2: 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) { 329e4: 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])); 329e6: cb 56 subi r28, 0x6B ; 107 329e8: df 4f sbci r29, 0xFF ; 255 329ea: 28 81 ld r18, Y 329ec: 39 81 ldd r19, Y+1 ; 0x01 329ee: 4a 81 ldd r20, Y+2 ; 0x02 329f0: 5b 81 ldd r21, Y+3 ; 0x03 329f2: c5 59 subi r28, 0x95 ; 149 329f4: d0 40 sbci r29, 0x00 ; 0 329f6: 50 58 subi r21, 0x80 ; 128 329f8: ed 96 adiw r28, 0x3d ; 61 329fa: 2c af std Y+60, r18 ; 0x3c 329fc: 3d af std Y+61, r19 ; 0x3d 329fe: 4e af std Y+62, r20 ; 0x3e 32a00: 5f af std Y+63, r21 ; 0x3f 32a02: 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])); 32a04: c7 57 subi r28, 0x77 ; 119 32a06: df 4f sbci r29, 0xFF ; 255 32a08: 88 81 ld r24, Y 32a0a: 99 81 ldd r25, Y+1 ; 0x01 32a0c: aa 81 ldd r26, Y+2 ; 0x02 32a0e: bb 81 ldd r27, Y+3 ; 0x03 32a10: c9 58 subi r28, 0x89 ; 137 32a12: d0 40 sbci r29, 0x00 ; 0 32a14: b0 58 subi r27, 0x80 ; 128 32a16: c3 58 subi r28, 0x83 ; 131 32a18: df 4f sbci r29, 0xFF ; 255 32a1a: 88 83 st Y, r24 32a1c: 99 83 std Y+1, r25 ; 0x01 32a1e: aa 83 std Y+2, r26 ; 0x02 32a20: bb 83 std Y+3, r27 ; 0x03 32a22: cd 57 subi r28, 0x7D ; 125 32a24: 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]) : 32a26: cb 57 subi r28, 0x7B ; 123 32a28: df 4f sbci r29, 0xFF ; 255 32a2a: 28 81 ld r18, Y 32a2c: 39 81 ldd r19, Y+1 ; 0x01 32a2e: 4a 81 ldd r20, Y+2 ; 0x02 32a30: 5b 81 ldd r21, Y+3 ; 0x03 32a32: c5 58 subi r28, 0x85 ; 133 32a34: d0 40 sbci r29, 0x00 ; 0 32a36: 50 58 subi r21, 0x80 ; 128 32a38: cf 57 subi r28, 0x7F ; 127 32a3a: df 4f sbci r29, 0xFF ; 255 32a3c: 28 83 st Y, r18 32a3e: 39 83 std Y+1, r19 ; 0x01 32a40: 4a 83 std Y+2, r20 ; 0x02 32a42: 5b 83 std Y+3, r21 ; 0x03 32a44: c1 58 subi r28, 0x81 ; 129 32a46: 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) { 32a48: ac 96 adiw r28, 0x2c ; 44 32a4a: 2e ac ldd r2, Y+62 ; 0x3e 32a4c: 3f ac ldd r3, Y+63 ; 0x3f 32a4e: ac 97 sbiw r28, 0x2c ; 44 for (uint8_t c = 0; c < 4; ++c) { 32a50: 10 e0 ldi r17, 0x00 ; 0 32a52: 62 ec ldi r22, 0xC2 ; 194 32a54: 46 2e mov r4, r22 32a56: 63 e1 ldi r22, 0x13 ; 19 32a58: 56 2e mov r5, r22 32a5a: 74 e0 ldi r23, 0x04 ; 4 32a5c: 77 2e mov r7, r23 acc = 0; 32a5e: c1 2c mov r12, r1 32a60: d1 2c mov r13, r1 32a62: 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) { 32a64: 01 30 cpi r16, 0x01 ; 1 32a66: 11 f4 brne .+4 ; 0x32a6c 32a68: 0d 94 60 9f jmp 0x33ec0 ; 0x33ec0 32a6c: 11 30 cpi r17, 0x01 ; 1 32a6e: 11 f4 brne .+4 ; 0x32a74 32a70: 0d 94 12 9f jmp 0x33e24 ; 0x33e24 float a = (r == 0) ? 1.f : 32a74: 00 23 and r16, r16 32a76: 11 f4 brne .+4 ; 0x32a7c 32a78: 0d 94 52 9f jmp 0x33ea4 ; 0x33ea4 ((r == 2) ? (-s1 * measured_pts[2 * i]) : 32a7c: 02 30 cpi r16, 0x02 ; 2 32a7e: 61 f5 brne .+88 ; 0x32ad8 32a80: d2 01 movw r26, r4 32a82: 11 96 adiw r26, 0x01 ; 1 32a84: 2d 91 ld r18, X+ 32a86: 3d 91 ld r19, X+ 32a88: 4d 91 ld r20, X+ 32a8a: 5c 91 ld r21, X 32a8c: 14 97 sbiw r26, 0x04 ; 4 32a8e: cf 57 subi r28, 0x7F ; 127 32a90: df 4f sbci r29, 0xFF ; 255 32a92: 68 81 ld r22, Y 32a94: 79 81 ldd r23, Y+1 ; 0x01 32a96: 8a 81 ldd r24, Y+2 ; 0x02 32a98: 9b 81 ldd r25, Y+3 ; 0x03 32a9a: c1 58 subi r28, 0x81 ; 129 32a9c: d0 40 sbci r29, 0x00 ; 0 32a9e: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 32aa2: 4b 01 movw r8, r22 32aa4: 5c 01 movw r10, r24 (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : 32aa6: 11 11 cpse r17, r1 32aa8: 25 c0 rjmp .+74 ; 0x32af4 32aaa: 60 e0 ldi r22, 0x00 ; 0 32aac: 70 e0 ldi r23, 0x00 ; 0 32aae: 80 e8 ldi r24, 0x80 ; 128 32ab0: 9f e3 ldi r25, 0x3F ; 63 32ab2: 35 c0 rjmp .+106 ; 0x32b1e int16_t maxs = 0; for (int16_t i = 0; i < 32*32;++i){ if (matrix32[i] == 0) { ++mins; } else if (matrix32[i] == 0xFF){ 32ab4: 2f 3f cpi r18, 0xFF ; 255 32ab6: 09 f0 breq .+2 ; 0x32aba 32ab8: 92 cb rjmp .-2268 ; 0x321de ++maxs; 32aba: 01 96 adiw r24, 0x01 ; 1 32abc: 90 cb rjmp .-2272 ; 0x321de /// 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; 32abe: 1f ef ldi r17, 0xFF ; 255 32ac0: 26 cd rjmp .-1460 ; 0x3250e 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; 32ac2: e5 96 adiw r28, 0x35 ; 53 32ac4: bf ad ldd r27, Y+63 ; 0x3f 32ac6: e5 97 sbiw r28, 0x35 ; 53 32ac8: a7 96 adiw r28, 0x27 ; 39 32aca: bf af std Y+63, r27 ; 0x3f 32acc: a7 97 sbiw r28, 0x27 ; 39 32ace: 0f ce rjmp .-994 ; 0x326ee // 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; 32ad0: af 96 adiw r28, 0x2f ; 47 32ad2: 1f ae std Y+63, r1 ; 0x3f 32ad4: af 97 sbiw r28, 0x2f ; 47 32ad6: d8 ce rjmp .-592 ; 0x32888 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]) : 32ad8: f2 01 movw r30, r4 32ada: 25 81 ldd r18, Z+5 ; 0x05 32adc: 36 81 ldd r19, Z+6 ; 0x06 32ade: 47 81 ldd r20, Z+7 ; 0x07 32ae0: 50 85 ldd r21, Z+8 ; 0x08 32ae2: c3 58 subi r28, 0x83 ; 131 32ae4: df 4f sbci r29, 0xFF ; 255 32ae6: 68 81 ld r22, Y 32ae8: 79 81 ldd r23, Y+1 ; 0x01 32aea: 8a 81 ldd r24, Y+2 ; 0x02 32aec: 9b 81 ldd r25, Y+3 ; 0x03 32aee: cd 57 subi r28, 0x7D ; 125 32af0: d0 40 sbci r29, 0x00 ; 0 32af2: d5 cf rjmp .-86 ; 0x32a9e (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : ((c == 2) ? (-s1 * measured_pts[2 * i]) : 32af4: 12 30 cpi r17, 0x02 ; 2 32af6: 11 f0 breq .+4 ; 0x32afc 32af8: 0d 94 53 9e jmp 0x33ca6 ; 0x33ca6 32afc: d2 01 movw r26, r4 32afe: 11 96 adiw r26, 0x01 ; 1 32b00: 2d 91 ld r18, X+ 32b02: 3d 91 ld r19, X+ 32b04: 4d 91 ld r20, X+ 32b06: 5c 91 ld r21, X 32b08: 14 97 sbiw r26, 0x04 ; 4 32b0a: cf 57 subi r28, 0x7F ; 127 32b0c: df 4f sbci r29, 0xFF ; 255 32b0e: 68 81 ld r22, Y 32b10: 79 81 ldd r23, Y+1 ; 0x01 32b12: 8a 81 ldd r24, Y+2 ; 0x02 32b14: 9b 81 ldd r25, Y+3 ; 0x03 32b16: c1 58 subi r28, 0x81 ; 129 32b18: d0 40 sbci r29, 0x00 ; 0 32b1a: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> (-c2 * measured_pts[2 * i + 1])); float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += a * b * w; 32b1e: 9b 01 movw r18, r22 32b20: ac 01 movw r20, r24 32b22: c5 01 movw r24, r10 32b24: b4 01 movw r22, r8 32b26: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 32b2a: 9b 01 movw r18, r22 32b2c: ac 01 movw r20, r24 32b2e: c7 01 movw r24, r14 32b30: b6 01 movw r22, r12 32b32: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 32b36: 6b 01 movw r12, r22 32b38: 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) { 32b3a: 01 11 cpse r16, r1 32b3c: 0d 94 6a 9f jmp 0x33ed4 ; 0x33ed4 32b40: 7a 94 dec r7 32b42: f8 e0 ldi r31, 0x08 ; 8 32b44: 4f 0e add r4, r31 32b46: 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) { 32b48: 71 10 cpse r7, r1 32b4a: 8c cf rjmp .-232 ; 0x32a64 (-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; 32b4c: d1 01 movw r26, r2 32b4e: cd 92 st X+, r12 32b50: dd 92 st X+, r13 32b52: ed 92 st X+, r14 32b54: fd 92 st X+, r15 32b56: 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) { 32b58: 1f 5f subi r17, 0xFF ; 255 32b5a: 14 30 cpi r17, 0x04 ; 4 32b5c: 09 f0 breq .+2 ; 0x32b60 32b5e: 79 cf rjmp .-270 ; 0x32a52 32b60: 3a ed ldi r19, 0xDA ; 218 32b62: 23 2e mov r2, r19 32b64: 35 ea ldi r19, 0xA5 ; 165 32b66: 33 2e mov r3, r19 32b68: e2 ec ldi r30, 0xC2 ; 194 32b6a: f3 e1 ldi r31, 0x13 ; 19 32b6c: a8 96 adiw r28, 0x28 ; 40 32b6e: ff af std Y+63, r31 ; 0x3f 32b70: ee af std Y+62, r30 ; 0x3e 32b72: a8 97 sbiw r28, 0x28 ; 40 } } A[r][c] = acc; } // J^T times f(x) acc = 0.f; 32b74: c3 57 subi r28, 0x73 ; 115 32b76: df 4f sbci r29, 0xFF ; 255 32b78: 18 82 st Y, r1 32b7a: cd 58 subi r28, 0x8D ; 141 32b7c: d0 40 sbci r29, 0x00 ; 0 32b7e: c3 56 subi r28, 0x63 ; 99 32b80: df 4f sbci r29, 0xFF ; 255 32b82: 18 82 st Y, r1 32b84: cd 59 subi r28, 0x9D ; 157 32b86: d0 40 sbci r29, 0x00 ; 0 32b88: cf 55 subi r28, 0x5F ; 95 32b8a: df 4f sbci r29, 0xFF ; 255 32b8c: 18 82 st Y, r1 32b8e: c1 5a subi r28, 0xA1 ; 161 32b90: d0 40 sbci r29, 0x00 ; 0 32b92: 10 e0 ldi r17, 0x00 ; 0 32b94: a8 96 adiw r28, 0x28 ; 40 32b96: ae ad ldd r26, Y+62 ; 0x3e 32b98: bf ad ldd r27, Y+63 ; 0x3f 32b9a: a8 97 sbiw r28, 0x28 ; 40 32b9c: 11 96 adiw r26, 0x01 ; 1 32b9e: 2d 91 ld r18, X+ 32ba0: 3d 91 ld r19, X+ 32ba2: 4d 91 ld r20, X+ 32ba4: 5c 91 ld r21, X 32ba6: 14 97 sbiw r26, 0x04 ; 4 32ba8: e4 96 adiw r28, 0x34 ; 52 32baa: 2c af std Y+60, r18 ; 0x3c 32bac: 3d af std Y+61, r19 ; 0x3d 32bae: 4e af std Y+62, r20 ; 0x3e 32bb0: 5f af std Y+63, r21 ; 0x3f 32bb2: e4 97 sbiw r28, 0x34 ; 52 32bb4: 15 96 adiw r26, 0x05 ; 5 32bb6: 4d 90 ld r4, X+ 32bb8: 5d 90 ld r5, X+ 32bba: 6d 90 ld r6, X+ 32bbc: 7c 90 ld r7, X 32bbe: 18 97 sbiw r26, 0x08 ; 8 for (uint8_t i = 0; i < npts; ++i) { { float j = (r == 0) ? 1.f : 32bc0: 00 23 and r16, r16 32bc2: 11 f4 brne .+4 ; 0x32bc8 32bc4: 0d 94 86 9e jmp 0x33d0c ; 0x33d0c ((r == 1) ? 0.f : 32bc8: 81 2c mov r8, r1 32bca: 91 2c mov r9, r1 32bcc: 54 01 movw r10, r8 32bce: 01 30 cpi r16, 0x01 ; 1 32bd0: 81 f0 breq .+32 ; 0x32bf2 ((r == 2) ? (-s1 * measured_pts[2 * i]) : 32bd2: 02 30 cpi r16, 0x02 ; 2 32bd4: 11 f0 breq .+4 ; 0x32bda 32bd6: 0d 94 7a 9e jmp 0x33cf4 ; 0x33cf4 32bda: cf 57 subi r28, 0x7F ; 127 32bdc: df 4f sbci r29, 0xFF ; 255 32bde: 68 81 ld r22, Y 32be0: 79 81 ldd r23, Y+1 ; 0x01 32be2: 8a 81 ldd r24, Y+2 ; 0x02 32be4: 9b 81 ldd r25, Y+3 ; 0x03 32be6: c1 58 subi r28, 0x81 ; 129 32be8: d0 40 sbci r29, 0x00 ; 0 32bea: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 32bee: 4b 01 movw r8, r22 32bf0: 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); 32bf2: e4 96 adiw r28, 0x34 ; 52 32bf4: 2c ad ldd r18, Y+60 ; 0x3c 32bf6: 3d ad ldd r19, Y+61 ; 0x3d 32bf8: 4e ad ldd r20, Y+62 ; 0x3e 32bfa: 5f ad ldd r21, Y+63 ; 0x3f 32bfc: e4 97 sbiw r28, 0x34 ; 52 32bfe: 6e 96 adiw r28, 0x1e ; 30 32c00: 6c ad ldd r22, Y+60 ; 0x3c 32c02: 7d ad ldd r23, Y+61 ; 0x3d 32c04: 8e ad ldd r24, Y+62 ; 0x3e 32c06: 9f ad ldd r25, Y+63 ; 0x3f 32c08: 6e 97 sbiw r28, 0x1e ; 30 32c0a: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 32c0e: 6b 01 movw r12, r22 32c10: 7c 01 movw r14, r24 32c12: f1 01 movw r30, r2 32c14: 25 91 lpm r18, Z+ 32c16: 35 91 lpm r19, Z+ 32c18: 45 91 lpm r20, Z+ 32c1a: 54 91 lpm r21, Z 32c1c: cb 55 subi r28, 0x5B ; 91 32c1e: df 4f sbci r29, 0xFF ; 255 32c20: 28 83 st Y, r18 32c22: 39 83 std Y+1, r19 ; 0x01 32c24: 4a 83 std Y+2, r20 ; 0x02 32c26: 5b 83 std Y+3, r21 ; 0x03 32c28: c5 5a subi r28, 0xA5 ; 165 32c2a: d0 40 sbci r29, 0x00 ; 0 32c2c: a3 01 movw r20, r6 32c2e: 92 01 movw r18, r4 32c30: cb 56 subi r28, 0x6B ; 107 32c32: df 4f sbci r29, 0xFF ; 255 32c34: 68 81 ld r22, Y 32c36: 79 81 ldd r23, Y+1 ; 0x01 32c38: 8a 81 ldd r24, Y+2 ; 0x02 32c3a: 9b 81 ldd r25, Y+3 ; 0x03 32c3c: c5 59 subi r28, 0x95 ; 149 32c3e: d0 40 sbci r29, 0x00 ; 0 32c40: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 32c44: 9b 01 movw r18, r22 32c46: ac 01 movw r20, r24 32c48: c7 01 movw r24, r14 32c4a: b6 01 movw r22, r12 32c4c: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 32c50: c5 55 subi r28, 0x55 ; 85 32c52: df 4f sbci r29, 0xFF ; 255 32c54: 28 81 ld r18, Y 32c56: 39 81 ldd r19, Y+1 ; 0x01 32c58: 4a 81 ldd r20, Y+2 ; 0x02 32c5a: 5b 81 ldd r21, Y+3 ; 0x03 32c5c: cb 5a subi r28, 0xAB ; 171 32c5e: d0 40 sbci r29, 0x00 ; 0 32c60: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 32c64: cb 55 subi r28, 0x5B ; 91 32c66: df 4f sbci r29, 0xFF ; 255 32c68: 28 81 ld r18, Y 32c6a: 39 81 ldd r19, Y+1 ; 0x01 32c6c: 4a 81 ldd r20, Y+2 ; 0x02 32c6e: 5b 81 ldd r21, Y+3 ; 0x03 32c70: c5 5a subi r28, 0xA5 ; 165 32c72: d0 40 sbci r29, 0x00 ; 0 32c74: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += j * fx * w; 32c78: a5 01 movw r20, r10 32c7a: 94 01 movw r18, r8 32c7c: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 32c80: c3 57 subi r28, 0x73 ; 115 32c82: df 4f sbci r29, 0xFF ; 255 32c84: 28 81 ld r18, Y 32c86: cd 58 subi r28, 0x8D ; 141 32c88: d0 40 sbci r29, 0x00 ; 0 32c8a: c3 56 subi r28, 0x63 ; 99 32c8c: df 4f sbci r29, 0xFF ; 255 32c8e: 38 81 ld r19, Y 32c90: cd 59 subi r28, 0x9D ; 157 32c92: d0 40 sbci r29, 0x00 ; 0 32c94: cf 55 subi r28, 0x5F ; 95 32c96: df 4f sbci r29, 0xFF ; 255 32c98: 48 81 ld r20, Y 32c9a: c1 5a subi r28, 0xA1 ; 161 32c9c: d0 40 sbci r29, 0x00 ; 0 32c9e: 51 2f mov r21, r17 32ca0: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 32ca4: c3 57 subi r28, 0x73 ; 115 32ca6: df 4f sbci r29, 0xFF ; 255 32ca8: 68 83 st Y, r22 32caa: 79 83 std Y+1, r23 ; 0x01 32cac: 8a 83 std Y+2, r24 ; 0x02 32cae: 9b 83 std Y+3, r25 ; 0x03 32cb0: cd 58 subi r28, 0x8D ; 141 32cb2: d0 40 sbci r29, 0x00 ; 0 } { float j = (r == 0) ? 0.f : 32cb4: 00 23 and r16, r16 32cb6: 11 f4 brne .+4 ; 0x32cbc 32cb8: 0d 94 8e 9e jmp 0x33d1c ; 0x33d1c ((r == 1) ? 1.f : 32cbc: 01 30 cpi r16, 0x01 ; 1 32cbe: 11 f4 brne .+4 ; 0x32cc4 32cc0: 0d 94 93 9e jmp 0x33d26 ; 0x33d26 ((r == 2) ? ( c1 * measured_pts[2 * i]) : 32cc4: 02 30 cpi r16, 0x02 ; 2 32cc6: 61 f0 breq .+24 ; 0x32ce0 32cc8: a3 01 movw r20, r6 32cca: 92 01 movw r18, r4 32ccc: ed 96 adiw r28, 0x3d ; 61 32cce: 6c ad ldd r22, Y+60 ; 0x3c 32cd0: 7d ad ldd r23, Y+61 ; 0x3d 32cd2: 8e ad ldd r24, Y+62 ; 0x3e 32cd4: 9f ad ldd r25, Y+63 ; 0x3f 32cd6: ed 97 sbiw r28, 0x3d ; 61 32cd8: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 32cdc: 6b 01 movw r12, r22 32cde: 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); 32ce0: f1 01 movw r30, r2 32ce2: 34 96 adiw r30, 0x04 ; 4 32ce4: 85 90 lpm r8, Z+ 32ce6: 95 90 lpm r9, Z+ 32ce8: a5 90 lpm r10, Z+ 32cea: b4 90 lpm r11, Z 32cec: e4 96 adiw r28, 0x34 ; 52 32cee: 2c ad ldd r18, Y+60 ; 0x3c 32cf0: 3d ad ldd r19, Y+61 ; 0x3d 32cf2: 4e ad ldd r20, Y+62 ; 0x3e 32cf4: 5f ad ldd r21, Y+63 ; 0x3f 32cf6: e4 97 sbiw r28, 0x34 ; 52 32cf8: cb 57 subi r28, 0x7B ; 123 32cfa: df 4f sbci r29, 0xFF ; 255 32cfc: 68 81 ld r22, Y 32cfe: 79 81 ldd r23, Y+1 ; 0x01 32d00: 8a 81 ldd r24, Y+2 ; 0x02 32d02: 9b 81 ldd r25, Y+3 ; 0x03 32d04: c5 58 subi r28, 0x85 ; 133 32d06: d0 40 sbci r29, 0x00 ; 0 32d08: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 32d0c: e4 96 adiw r28, 0x34 ; 52 32d0e: 6c af std Y+60, r22 ; 0x3c 32d10: 7d af std Y+61, r23 ; 0x3d 32d12: 8e af std Y+62, r24 ; 0x3e 32d14: 9f af std Y+63, r25 ; 0x3f 32d16: e4 97 sbiw r28, 0x34 ; 52 32d18: a3 01 movw r20, r6 32d1a: 92 01 movw r18, r4 32d1c: c7 57 subi r28, 0x77 ; 119 32d1e: df 4f sbci r29, 0xFF ; 255 32d20: 68 81 ld r22, Y 32d22: 79 81 ldd r23, Y+1 ; 0x01 32d24: 8a 81 ldd r24, Y+2 ; 0x02 32d26: 9b 81 ldd r25, Y+3 ; 0x03 32d28: c9 58 subi r28, 0x89 ; 137 32d2a: d0 40 sbci r29, 0x00 ; 0 32d2c: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 32d30: 9b 01 movw r18, r22 32d32: ac 01 movw r20, r24 32d34: e4 96 adiw r28, 0x34 ; 52 32d36: 6c ad ldd r22, Y+60 ; 0x3c 32d38: 7d ad ldd r23, Y+61 ; 0x3d 32d3a: 8e ad ldd r24, Y+62 ; 0x3e 32d3c: 9f ad ldd r25, Y+63 ; 0x3f 32d3e: e4 97 sbiw r28, 0x34 ; 52 32d40: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 32d44: c1 55 subi r28, 0x51 ; 81 32d46: df 4f sbci r29, 0xFF ; 255 32d48: 28 81 ld r18, Y 32d4a: 39 81 ldd r19, Y+1 ; 0x01 32d4c: 4a 81 ldd r20, Y+2 ; 0x02 32d4e: 5b 81 ldd r21, Y+3 ; 0x03 32d50: cf 5a subi r28, 0xAF ; 175 32d52: d0 40 sbci r29, 0x00 ; 0 32d54: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 32d58: a5 01 movw r20, r10 32d5a: 94 01 movw r18, r8 32d5c: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> float w = point_weight_y(i, measured_pts[2 * i + 1]); acc += j * fy * w; 32d60: a7 01 movw r20, r14 32d62: 96 01 movw r18, r12 32d64: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 32d68: c3 57 subi r28, 0x73 ; 115 32d6a: df 4f sbci r29, 0xFF ; 255 32d6c: 28 81 ld r18, Y 32d6e: 39 81 ldd r19, Y+1 ; 0x01 32d70: 4a 81 ldd r20, Y+2 ; 0x02 32d72: 5b 81 ldd r21, Y+3 ; 0x03 32d74: cd 58 subi r28, 0x8D ; 141 32d76: d0 40 sbci r29, 0x00 ; 0 32d78: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 32d7c: c3 57 subi r28, 0x73 ; 115 32d7e: df 4f sbci r29, 0xFF ; 255 32d80: 68 83 st Y, r22 32d82: cd 58 subi r28, 0x8D ; 141 32d84: d0 40 sbci r29, 0x00 ; 0 32d86: c3 56 subi r28, 0x63 ; 99 32d88: df 4f sbci r29, 0xFF ; 255 32d8a: 78 83 st Y, r23 32d8c: cd 59 subi r28, 0x9D ; 157 32d8e: d0 40 sbci r29, 0x00 ; 0 32d90: cf 55 subi r28, 0x5F ; 95 32d92: df 4f sbci r29, 0xFF ; 255 32d94: 88 83 st Y, r24 32d96: c1 5a subi r28, 0xA1 ; 161 32d98: d0 40 sbci r29, 0x00 ; 0 32d9a: 19 2f mov r17, r25 32d9c: a8 96 adiw r28, 0x28 ; 40 32d9e: 4e ad ldd r20, Y+62 ; 0x3e 32da0: 5f ad ldd r21, Y+63 ; 0x3f 32da2: a8 97 sbiw r28, 0x28 ; 40 32da4: 48 5f subi r20, 0xF8 ; 248 32da6: 5f 4f sbci r21, 0xFF ; 255 32da8: a8 96 adiw r28, 0x28 ; 40 32daa: 5f af std Y+63, r21 ; 0x3f 32dac: 4e af std Y+62, r20 ; 0x3e 32dae: a8 97 sbiw r28, 0x28 ; 40 32db0: 58 e0 ldi r21, 0x08 ; 8 32db2: 25 0e add r2, r21 32db4: 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) { 32db6: a2 ee ldi r26, 0xE2 ; 226 32db8: b3 e1 ldi r27, 0x13 ; 19 32dba: a8 96 adiw r28, 0x28 ; 40 32dbc: ee ad ldd r30, Y+62 ; 0x3e 32dbe: ff ad ldd r31, Y+63 ; 0x3f 32dc0: a8 97 sbiw r28, 0x28 ; 40 32dc2: ae 17 cp r26, r30 32dc4: bf 07 cpc r27, r31 32dc6: 09 f0 breq .+2 ; 0x32dca 32dc8: e5 ce rjmp .-566 ; 0x32b94 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; 32dca: 90 58 subi r25, 0x80 ; 128 32dcc: c7 56 subi r28, 0x67 ; 103 32dce: df 4f sbci r29, 0xFF ; 255 32dd0: a8 81 ld r26, Y 32dd2: b9 81 ldd r27, Y+1 ; 0x01 32dd4: c9 59 subi r28, 0x99 ; 153 32dd6: d0 40 sbci r29, 0x00 ; 0 32dd8: 6d 93 st X+, r22 32dda: 7d 93 st X+, r23 32ddc: 8d 93 st X+, r24 32dde: 9d 93 st X+, r25 32de0: c7 56 subi r28, 0x67 ; 103 32de2: df 4f sbci r29, 0xFF ; 255 32de4: b9 83 std Y+1, r27 ; 0x01 32de6: a8 83 st Y, r26 32de8: c9 59 subi r28, 0x99 ; 153 32dea: 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) { 32dec: 0f 5f subi r16, 0xFF ; 255 32dee: ac 96 adiw r28, 0x2c ; 44 32df0: ee ad ldd r30, Y+62 ; 0x3e 32df2: ff ad ldd r31, Y+63 ; 0x3f 32df4: ac 97 sbiw r28, 0x2c ; 44 32df6: 70 96 adiw r30, 0x10 ; 16 32df8: ac 96 adiw r28, 0x2c ; 44 32dfa: ff af std Y+63, r31 ; 0x3f 32dfc: ee af std Y+62, r30 ; 0x3e 32dfe: ac 97 sbiw r28, 0x2c ; 44 32e00: 04 30 cpi r16, 0x04 ; 4 32e02: 09 f0 breq .+2 ; 0x32e06 32e04: 21 ce rjmp .-958 ; 0x32a48 } // 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]; 32e06: 25 96 adiw r28, 0x05 ; 5 32e08: 2c ad ldd r18, Y+60 ; 0x3c 32e0a: 3d ad ldd r19, Y+61 ; 0x3d 32e0c: 4e ad ldd r20, Y+62 ; 0x3e 32e0e: 5f ad ldd r21, Y+63 ; 0x3f 32e10: 25 97 sbiw r28, 0x05 ; 5 32e12: ae 96 adiw r28, 0x2e ; 46 32e14: 2c af std Y+60, r18 ; 0x3c 32e16: 3d af std Y+61, r19 ; 0x3d 32e18: 4e af std Y+62, r20 ; 0x3e 32e1a: 5f af std Y+63, r21 ; 0x3f 32e1c: ae 97 sbiw r28, 0x2e ; 46 32e1e: 8d 81 ldd r24, Y+5 ; 0x05 32e20: 9e 81 ldd r25, Y+6 ; 0x06 32e22: af 81 ldd r26, Y+7 ; 0x07 32e24: b8 85 ldd r27, Y+8 ; 0x08 32e26: e4 96 adiw r28, 0x34 ; 52 32e28: 8c af std Y+60, r24 ; 0x3c 32e2a: 9d af std Y+61, r25 ; 0x3d 32e2c: ae af std Y+62, r26 ; 0x3e 32e2e: bf af std Y+63, r27 ; 0x3f 32e30: e4 97 sbiw r28, 0x34 ; 52 32e32: 29 85 ldd r18, Y+9 ; 0x09 32e34: 3a 85 ldd r19, Y+10 ; 0x0a 32e36: 4b 85 ldd r20, Y+11 ; 0x0b 32e38: 5c 85 ldd r21, Y+12 ; 0x0c 32e3a: ed 96 adiw r28, 0x3d ; 61 32e3c: 2c af std Y+60, r18 ; 0x3c 32e3e: 3d af std Y+61, r19 ; 0x3d 32e40: 4e af std Y+62, r20 ; 0x3e 32e42: 5f af std Y+63, r21 ; 0x3f 32e44: ed 97 sbiw r28, 0x3d ; 61 32e46: 8d 85 ldd r24, Y+13 ; 0x0d 32e48: 9e 85 ldd r25, Y+14 ; 0x0e 32e4a: af 85 ldd r26, Y+15 ; 0x0f 32e4c: b8 89 ldd r27, Y+16 ; 0x10 32e4e: c3 58 subi r28, 0x83 ; 131 32e50: df 4f sbci r29, 0xFF ; 255 32e52: 88 83 st Y, r24 32e54: 99 83 std Y+1, r25 ; 0x01 32e56: aa 83 std Y+2, r26 ; 0x02 32e58: bb 83 std Y+3, r27 ; 0x03 32e5a: cd 57 subi r28, 0x7D ; 125 32e5c: d0 40 sbci r29, 0x00 ; 0 32e5e: 29 81 ldd r18, Y+1 ; 0x01 32e60: 3a 81 ldd r19, Y+2 ; 0x02 32e62: 4b 81 ldd r20, Y+3 ; 0x03 32e64: 5c 81 ldd r21, Y+4 ; 0x04 32e66: cf 57 subi r28, 0x7F ; 127 32e68: df 4f sbci r29, 0xFF ; 255 32e6a: 28 83 st Y, r18 32e6c: 39 83 std Y+1, r19 ; 0x01 32e6e: 4a 83 std Y+2, r20 ; 0x02 32e70: 5b 83 std Y+3, r21 ; 0x03 32e72: c1 58 subi r28, 0x81 ; 129 32e74: 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]; 32e76: 29 96 adiw r28, 0x09 ; 9 32e78: 8c ad ldd r24, Y+60 ; 0x3c 32e7a: 9d ad ldd r25, Y+61 ; 0x3d 32e7c: ae ad ldd r26, Y+62 ; 0x3e 32e7e: bf ad ldd r27, Y+63 ; 0x3f 32e80: 29 97 sbiw r28, 0x09 ; 9 32e82: cb 57 subi r28, 0x7B ; 123 32e84: df 4f sbci r29, 0xFF ; 255 32e86: 88 83 st Y, r24 32e88: 99 83 std Y+1, r25 ; 0x01 32e8a: aa 83 std Y+2, r26 ; 0x02 32e8c: bb 83 std Y+3, r27 ; 0x03 32e8e: c5 58 subi r28, 0x85 ; 133 32e90: d0 40 sbci r29, 0x00 ; 0 32e92: 29 89 ldd r18, Y+17 ; 0x11 32e94: 3a 89 ldd r19, Y+18 ; 0x12 32e96: 4b 89 ldd r20, Y+19 ; 0x13 32e98: 5c 89 ldd r21, Y+20 ; 0x14 32e9a: c7 57 subi r28, 0x77 ; 119 32e9c: df 4f sbci r29, 0xFF ; 255 32e9e: 28 83 st Y, r18 32ea0: 39 83 std Y+1, r19 ; 0x01 32ea2: 4a 83 std Y+2, r20 ; 0x02 32ea4: 5b 83 std Y+3, r21 ; 0x03 32ea6: c9 58 subi r28, 0x89 ; 137 32ea8: d0 40 sbci r29, 0x00 ; 0 32eaa: 89 8d ldd r24, Y+25 ; 0x19 32eac: 9a 8d ldd r25, Y+26 ; 0x1a 32eae: ab 8d ldd r26, Y+27 ; 0x1b 32eb0: bc 8d ldd r27, Y+28 ; 0x1c 32eb2: cb 56 subi r28, 0x6B ; 107 32eb4: df 4f sbci r29, 0xFF ; 255 32eb6: 88 83 st Y, r24 32eb8: 99 83 std Y+1, r25 ; 0x01 32eba: aa 83 std Y+2, r26 ; 0x02 32ebc: bb 83 std Y+3, r27 ; 0x03 32ebe: c5 59 subi r28, 0x95 ; 149 32ec0: d0 40 sbci r29, 0x00 ; 0 32ec2: 2d 8d ldd r18, Y+29 ; 0x1d 32ec4: 3e 8d ldd r19, Y+30 ; 0x1e 32ec6: 4f 8d ldd r20, Y+31 ; 0x1f 32ec8: 58 a1 ldd r21, Y+32 ; 0x20 32eca: c7 56 subi r28, 0x67 ; 103 32ecc: df 4f sbci r29, 0xFF ; 255 32ece: 28 83 st Y, r18 32ed0: 39 83 std Y+1, r19 ; 0x01 32ed2: 4a 83 std Y+2, r20 ; 0x02 32ed4: 5b 83 std Y+3, r21 ; 0x03 32ed6: c9 59 subi r28, 0x99 ; 153 32ed8: d0 40 sbci r29, 0x00 ; 0 32eda: 8d 89 ldd r24, Y+21 ; 0x15 32edc: 9e 89 ldd r25, Y+22 ; 0x16 32ede: af 89 ldd r26, Y+23 ; 0x17 32ee0: b8 8d ldd r27, Y+24 ; 0x18 32ee2: c3 57 subi r28, 0x73 ; 115 32ee4: df 4f sbci r29, 0xFF ; 255 32ee6: 88 83 st Y, r24 32ee8: 99 83 std Y+1, r25 ; 0x01 32eea: aa 83 std Y+2, r26 ; 0x02 32eec: bb 83 std Y+3, r27 ; 0x03 32eee: cd 58 subi r28, 0x8D ; 141 32ef0: 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]; 32ef2: 2d 96 adiw r28, 0x0d ; 13 32ef4: 2c ad ldd r18, Y+60 ; 0x3c 32ef6: 3d ad ldd r19, Y+61 ; 0x3d 32ef8: 4e ad ldd r20, Y+62 ; 0x3e 32efa: 5f ad ldd r21, Y+63 ; 0x3f 32efc: 2d 97 sbiw r28, 0x0d ; 13 32efe: c3 56 subi r28, 0x63 ; 99 32f00: df 4f sbci r29, 0xFF ; 255 32f02: 28 83 st Y, r18 32f04: 39 83 std Y+1, r19 ; 0x01 32f06: 4a 83 std Y+2, r20 ; 0x02 32f08: 5b 83 std Y+3, r21 ; 0x03 32f0a: cd 59 subi r28, 0x9D ; 157 32f0c: d0 40 sbci r29, 0x00 ; 0 32f0e: 89 a1 ldd r24, Y+33 ; 0x21 32f10: 9a a1 ldd r25, Y+34 ; 0x22 32f12: ab a1 ldd r26, Y+35 ; 0x23 32f14: bc a1 ldd r27, Y+36 ; 0x24 32f16: cf 55 subi r28, 0x5F ; 95 32f18: df 4f sbci r29, 0xFF ; 255 32f1a: 88 83 st Y, r24 32f1c: 99 83 std Y+1, r25 ; 0x01 32f1e: aa 83 std Y+2, r26 ; 0x02 32f20: bb 83 std Y+3, r27 ; 0x03 32f22: c1 5a subi r28, 0xA1 ; 161 32f24: d0 40 sbci r29, 0x00 ; 0 32f26: 2d a1 ldd r18, Y+37 ; 0x25 32f28: 3e a1 ldd r19, Y+38 ; 0x26 32f2a: 4f a1 ldd r20, Y+39 ; 0x27 32f2c: 58 a5 ldd r21, Y+40 ; 0x28 32f2e: cb 55 subi r28, 0x5B ; 91 32f30: df 4f sbci r29, 0xFF ; 255 32f32: 28 83 st Y, r18 32f34: 39 83 std Y+1, r19 ; 0x01 32f36: 4a 83 std Y+2, r20 ; 0x02 32f38: 5b 83 std Y+3, r21 ; 0x03 32f3a: c5 5a subi r28, 0xA5 ; 165 32f3c: d0 40 sbci r29, 0x00 ; 0 32f3e: 8d a5 ldd r24, Y+45 ; 0x2d 32f40: 9e a5 ldd r25, Y+46 ; 0x2e 32f42: af a5 ldd r26, Y+47 ; 0x2f 32f44: b8 a9 ldd r27, Y+48 ; 0x30 32f46: cd 54 subi r28, 0x4D ; 77 32f48: df 4f sbci r29, 0xFF ; 255 32f4a: 88 83 st Y, r24 32f4c: 99 83 std Y+1, r25 ; 0x01 32f4e: aa 83 std Y+2, r26 ; 0x02 32f50: bb 83 std Y+3, r27 ; 0x03 32f52: c3 5b subi r28, 0xB3 ; 179 32f54: d0 40 sbci r29, 0x00 ; 0 32f56: 29 a5 ldd r18, Y+41 ; 0x29 32f58: 3a a5 ldd r19, Y+42 ; 0x2a 32f5a: 4b a5 ldd r20, Y+43 ; 0x2b 32f5c: 5c a5 ldd r21, Y+44 ; 0x2c 32f5e: c9 54 subi r28, 0x49 ; 73 32f60: df 4f sbci r29, 0xFF ; 255 32f62: 28 83 st Y, r18 32f64: 39 83 std Y+1, r19 ; 0x01 32f66: 4a 83 std Y+2, r20 ; 0x02 32f68: 5b 83 std Y+3, r21 ; 0x03 32f6a: c7 5b subi r28, 0xB7 ; 183 32f6c: 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]; 32f6e: 61 96 adiw r28, 0x11 ; 17 32f70: 8c ad ldd r24, Y+60 ; 0x3c 32f72: 9d ad ldd r25, Y+61 ; 0x3d 32f74: ae ad ldd r26, Y+62 ; 0x3e 32f76: bf ad ldd r27, Y+63 ; 0x3f 32f78: 61 97 sbiw r28, 0x11 ; 17 32f7a: c5 54 subi r28, 0x45 ; 69 32f7c: df 4f sbci r29, 0xFF ; 255 32f7e: 88 83 st Y, r24 32f80: 99 83 std Y+1, r25 ; 0x01 32f82: aa 83 std Y+2, r26 ; 0x02 32f84: bb 83 std Y+3, r27 ; 0x03 32f86: cb 5b subi r28, 0xBB ; 187 32f88: d0 40 sbci r29, 0x00 ; 0 32f8a: 29 a9 ldd r18, Y+49 ; 0x31 32f8c: 3a a9 ldd r19, Y+50 ; 0x32 32f8e: 4b a9 ldd r20, Y+51 ; 0x33 32f90: 5c a9 ldd r21, Y+52 ; 0x34 32f92: c1 54 subi r28, 0x41 ; 65 32f94: df 4f sbci r29, 0xFF ; 255 32f96: 28 83 st Y, r18 32f98: 39 83 std Y+1, r19 ; 0x01 32f9a: 4a 83 std Y+2, r20 ; 0x02 32f9c: 5b 83 std Y+3, r21 ; 0x03 32f9e: cf 5b subi r28, 0xBF ; 191 32fa0: d0 40 sbci r29, 0x00 ; 0 32fa2: 8d a9 ldd r24, Y+53 ; 0x35 32fa4: 9e a9 ldd r25, Y+54 ; 0x36 32fa6: af a9 ldd r26, Y+55 ; 0x37 32fa8: b8 ad ldd r27, Y+56 ; 0x38 32faa: cd 53 subi r28, 0x3D ; 61 32fac: df 4f sbci r29, 0xFF ; 255 32fae: 88 83 st Y, r24 32fb0: 99 83 std Y+1, r25 ; 0x01 32fb2: aa 83 std Y+2, r26 ; 0x02 32fb4: bb 83 std Y+3, r27 ; 0x03 32fb6: c3 5c subi r28, 0xC3 ; 195 32fb8: d0 40 sbci r29, 0x00 ; 0 32fba: 29 ad ldd r18, Y+57 ; 0x39 32fbc: 3a ad ldd r19, Y+58 ; 0x3a 32fbe: 4b ad ldd r20, Y+59 ; 0x3b 32fc0: 5c ad ldd r21, Y+60 ; 0x3c 32fc2: c9 53 subi r28, 0x39 ; 57 32fc4: df 4f sbci r29, 0xFF ; 255 32fc6: 28 83 st Y, r18 32fc8: 39 83 std Y+1, r19 ; 0x01 32fca: 4a 83 std Y+2, r20 ; 0x02 32fcc: 5b 83 std Y+3, r21 ; 0x03 32fce: c7 5c subi r28, 0xC7 ; 199 32fd0: d0 40 sbci r29, 0x00 ; 0 32fd2: 21 96 adiw r28, 0x01 ; 1 32fd4: 8c ad ldd r24, Y+60 ; 0x3c 32fd6: 9d ad ldd r25, Y+61 ; 0x3d 32fd8: ae ad ldd r26, Y+62 ; 0x3e 32fda: bf ad ldd r27, Y+63 ; 0x3f 32fdc: 21 97 sbiw r28, 0x01 ; 1 32fde: c5 53 subi r28, 0x35 ; 53 32fe0: df 4f sbci r29, 0xFF ; 255 32fe2: 88 83 st Y, r24 32fe4: 99 83 std Y+1, r25 ; 0x01 32fe6: aa 83 std Y+2, r26 ; 0x02 32fe8: bb 83 std Y+3, r27 ; 0x03 32fea: cb 5c subi r28, 0xCB ; 203 32fec: d0 40 sbci r29, 0x00 ; 0 32fee: 14 e6 ldi r17, 0x64 ; 100 } b[r] = -acc; } // Solve for h by a Gauss iteration method. float h[4] = { 0.f }; 32ff0: c1 2c mov r12, r1 32ff2: d1 2c mov r13, r1 32ff4: 76 01 movw r14, r12 32ff6: 46 01 movw r8, r12 32ff8: 57 01 movw r10, r14 32ffa: 26 01 movw r4, r12 32ffc: 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]; 32ffe: a3 01 movw r20, r6 33000: 92 01 movw r18, r4 33002: e4 96 adiw r28, 0x34 ; 52 33004: 6c ad ldd r22, Y+60 ; 0x3c 33006: 7d ad ldd r23, Y+61 ; 0x3d 33008: 8e ad ldd r24, Y+62 ; 0x3e 3300a: 9f ad ldd r25, Y+63 ; 0x3f 3300c: e4 97 sbiw r28, 0x34 ; 52 3300e: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 33012: 9b 01 movw r18, r22 33014: ac 01 movw r20, r24 33016: ae 96 adiw r28, 0x2e ; 46 33018: 6c ad ldd r22, Y+60 ; 0x3c 3301a: 7d ad ldd r23, Y+61 ; 0x3d 3301c: 8e ad ldd r24, Y+62 ; 0x3e 3301e: 9f ad ldd r25, Y+63 ; 0x3f 33020: ae 97 sbiw r28, 0x2e ; 46 33022: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 33026: 2b 01 movw r4, r22 33028: 3c 01 movw r6, r24 3302a: a5 01 movw r20, r10 3302c: 94 01 movw r18, r8 3302e: ed 96 adiw r28, 0x3d ; 61 33030: 6c ad ldd r22, Y+60 ; 0x3c 33032: 7d ad ldd r23, Y+61 ; 0x3d 33034: 8e ad ldd r24, Y+62 ; 0x3e 33036: 9f ad ldd r25, Y+63 ; 0x3f 33038: ed 97 sbiw r28, 0x3d ; 61 3303a: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 3303e: 9b 01 movw r18, r22 33040: ac 01 movw r20, r24 33042: c3 01 movw r24, r6 33044: b2 01 movw r22, r4 33046: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 3304a: 2b 01 movw r4, r22 3304c: 3c 01 movw r6, r24 3304e: a7 01 movw r20, r14 33050: 96 01 movw r18, r12 33052: c3 58 subi r28, 0x83 ; 131 33054: df 4f sbci r29, 0xFF ; 255 33056: 68 81 ld r22, Y 33058: 79 81 ldd r23, Y+1 ; 0x01 3305a: 8a 81 ldd r24, Y+2 ; 0x02 3305c: 9b 81 ldd r25, Y+3 ; 0x03 3305e: cd 57 subi r28, 0x7D ; 125 33060: d0 40 sbci r29, 0x00 ; 0 33062: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 33066: 9b 01 movw r18, r22 33068: ac 01 movw r20, r24 3306a: c3 01 movw r24, r6 3306c: b2 01 movw r22, r4 3306e: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 33072: cf 57 subi r28, 0x7F ; 127 33074: df 4f sbci r29, 0xFF ; 255 33076: 28 81 ld r18, Y 33078: 39 81 ldd r19, Y+1 ; 0x01 3307a: 4a 81 ldd r20, Y+2 ; 0x02 3307c: 5b 81 ldd r21, Y+3 ; 0x03 3307e: c1 58 subi r28, 0x81 ; 129 33080: d0 40 sbci r29, 0x00 ; 0 33082: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 33086: 6e 96 adiw r28, 0x1e ; 30 33088: 6c af std Y+60, r22 ; 0x3c 3308a: 7d af std Y+61, r23 ; 0x3d 3308c: 8e af std Y+62, r24 ; 0x3e 3308e: 9f af std Y+63, r25 ; 0x3f 33090: 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]; 33092: c7 57 subi r28, 0x77 ; 119 33094: df 4f sbci r29, 0xFF ; 255 33096: 28 81 ld r18, Y 33098: 39 81 ldd r19, Y+1 ; 0x01 3309a: 4a 81 ldd r20, Y+2 ; 0x02 3309c: 5b 81 ldd r21, Y+3 ; 0x03 3309e: c9 58 subi r28, 0x89 ; 137 330a0: d0 40 sbci r29, 0x00 ; 0 330a2: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 330a6: 9b 01 movw r18, r22 330a8: ac 01 movw r20, r24 330aa: cb 57 subi r28, 0x7B ; 123 330ac: df 4f sbci r29, 0xFF ; 255 330ae: 68 81 ld r22, Y 330b0: 79 81 ldd r23, Y+1 ; 0x01 330b2: 8a 81 ldd r24, Y+2 ; 0x02 330b4: 9b 81 ldd r25, Y+3 ; 0x03 330b6: c5 58 subi r28, 0x85 ; 133 330b8: d0 40 sbci r29, 0x00 ; 0 330ba: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 330be: 2b 01 movw r4, r22 330c0: 3c 01 movw r6, r24 330c2: a5 01 movw r20, r10 330c4: 94 01 movw r18, r8 330c6: cb 56 subi r28, 0x6B ; 107 330c8: df 4f sbci r29, 0xFF ; 255 330ca: 68 81 ld r22, Y 330cc: 79 81 ldd r23, Y+1 ; 0x01 330ce: 8a 81 ldd r24, Y+2 ; 0x02 330d0: 9b 81 ldd r25, Y+3 ; 0x03 330d2: c5 59 subi r28, 0x95 ; 149 330d4: d0 40 sbci r29, 0x00 ; 0 330d6: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 330da: 9b 01 movw r18, r22 330dc: ac 01 movw r20, r24 330de: c3 01 movw r24, r6 330e0: b2 01 movw r22, r4 330e2: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 330e6: 4b 01 movw r8, r22 330e8: 5c 01 movw r10, r24 330ea: a7 01 movw r20, r14 330ec: 96 01 movw r18, r12 330ee: c7 56 subi r28, 0x67 ; 103 330f0: df 4f sbci r29, 0xFF ; 255 330f2: 68 81 ld r22, Y 330f4: 79 81 ldd r23, Y+1 ; 0x01 330f6: 8a 81 ldd r24, Y+2 ; 0x02 330f8: 9b 81 ldd r25, Y+3 ; 0x03 330fa: c9 59 subi r28, 0x99 ; 153 330fc: d0 40 sbci r29, 0x00 ; 0 330fe: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 33102: 9b 01 movw r18, r22 33104: ac 01 movw r20, r24 33106: c5 01 movw r24, r10 33108: b4 01 movw r22, r8 3310a: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 3310e: c3 57 subi r28, 0x73 ; 115 33110: df 4f sbci r29, 0xFF ; 255 33112: 28 81 ld r18, Y 33114: 39 81 ldd r19, Y+1 ; 0x01 33116: 4a 81 ldd r20, Y+2 ; 0x02 33118: 5b 81 ldd r21, Y+3 ; 0x03 3311a: cd 58 subi r28, 0x8D ; 141 3311c: d0 40 sbci r29, 0x00 ; 0 3311e: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 33122: 2b 01 movw r4, r22 33124: 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]; 33126: cf 55 subi r28, 0x5F ; 95 33128: df 4f sbci r29, 0xFF ; 255 3312a: 28 81 ld r18, Y 3312c: 39 81 ldd r19, Y+1 ; 0x01 3312e: 4a 81 ldd r20, Y+2 ; 0x02 33130: 5b 81 ldd r21, Y+3 ; 0x03 33132: c1 5a subi r28, 0xA1 ; 161 33134: d0 40 sbci r29, 0x00 ; 0 33136: 6e 96 adiw r28, 0x1e ; 30 33138: 6c ad ldd r22, Y+60 ; 0x3c 3313a: 7d ad ldd r23, Y+61 ; 0x3d 3313c: 8e ad ldd r24, Y+62 ; 0x3e 3313e: 9f ad ldd r25, Y+63 ; 0x3f 33140: 6e 97 sbiw r28, 0x1e ; 30 33142: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 33146: 9b 01 movw r18, r22 33148: ac 01 movw r20, r24 3314a: c3 56 subi r28, 0x63 ; 99 3314c: df 4f sbci r29, 0xFF ; 255 3314e: 68 81 ld r22, Y 33150: 79 81 ldd r23, Y+1 ; 0x01 33152: 8a 81 ldd r24, Y+2 ; 0x02 33154: 9b 81 ldd r25, Y+3 ; 0x03 33156: cd 59 subi r28, 0x9D ; 157 33158: d0 40 sbci r29, 0x00 ; 0 3315a: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 3315e: 4b 01 movw r8, r22 33160: 5c 01 movw r10, r24 33162: cb 55 subi r28, 0x5B ; 91 33164: df 4f sbci r29, 0xFF ; 255 33166: 28 81 ld r18, Y 33168: 39 81 ldd r19, Y+1 ; 0x01 3316a: 4a 81 ldd r20, Y+2 ; 0x02 3316c: 5b 81 ldd r21, Y+3 ; 0x03 3316e: c5 5a subi r28, 0xA5 ; 165 33170: d0 40 sbci r29, 0x00 ; 0 33172: c3 01 movw r24, r6 33174: b2 01 movw r22, r4 33176: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 3317a: 9b 01 movw r18, r22 3317c: ac 01 movw r20, r24 3317e: c5 01 movw r24, r10 33180: b4 01 movw r22, r8 33182: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 33186: 4b 01 movw r8, r22 33188: 5c 01 movw r10, r24 3318a: a7 01 movw r20, r14 3318c: 96 01 movw r18, r12 3318e: cd 54 subi r28, 0x4D ; 77 33190: df 4f sbci r29, 0xFF ; 255 33192: 68 81 ld r22, Y 33194: 79 81 ldd r23, Y+1 ; 0x01 33196: 8a 81 ldd r24, Y+2 ; 0x02 33198: 9b 81 ldd r25, Y+3 ; 0x03 3319a: c3 5b subi r28, 0xB3 ; 179 3319c: d0 40 sbci r29, 0x00 ; 0 3319e: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 331a2: 9b 01 movw r18, r22 331a4: ac 01 movw r20, r24 331a6: c5 01 movw r24, r10 331a8: b4 01 movw r22, r8 331aa: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 331ae: c9 54 subi r28, 0x49 ; 73 331b0: df 4f sbci r29, 0xFF ; 255 331b2: 28 81 ld r18, Y 331b4: 39 81 ldd r19, Y+1 ; 0x01 331b6: 4a 81 ldd r20, Y+2 ; 0x02 331b8: 5b 81 ldd r21, Y+3 ; 0x03 331ba: c7 5b subi r28, 0xB7 ; 183 331bc: d0 40 sbci r29, 0x00 ; 0 331be: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 331c2: 4b 01 movw r8, r22 331c4: 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]; 331c6: c1 54 subi r28, 0x41 ; 65 331c8: df 4f sbci r29, 0xFF ; 255 331ca: 28 81 ld r18, Y 331cc: 39 81 ldd r19, Y+1 ; 0x01 331ce: 4a 81 ldd r20, Y+2 ; 0x02 331d0: 5b 81 ldd r21, Y+3 ; 0x03 331d2: cf 5b subi r28, 0xBF ; 191 331d4: d0 40 sbci r29, 0x00 ; 0 331d6: 6e 96 adiw r28, 0x1e ; 30 331d8: 6c ad ldd r22, Y+60 ; 0x3c 331da: 7d ad ldd r23, Y+61 ; 0x3d 331dc: 8e ad ldd r24, Y+62 ; 0x3e 331de: 9f ad ldd r25, Y+63 ; 0x3f 331e0: 6e 97 sbiw r28, 0x1e ; 30 331e2: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 331e6: 9b 01 movw r18, r22 331e8: ac 01 movw r20, r24 331ea: c5 54 subi r28, 0x45 ; 69 331ec: df 4f sbci r29, 0xFF ; 255 331ee: 68 81 ld r22, Y 331f0: 79 81 ldd r23, Y+1 ; 0x01 331f2: 8a 81 ldd r24, Y+2 ; 0x02 331f4: 9b 81 ldd r25, Y+3 ; 0x03 331f6: cb 5b subi r28, 0xBB ; 187 331f8: d0 40 sbci r29, 0x00 ; 0 331fa: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 331fe: 6b 01 movw r12, r22 33200: 7c 01 movw r14, r24 33202: cd 53 subi r28, 0x3D ; 61 33204: df 4f sbci r29, 0xFF ; 255 33206: 28 81 ld r18, Y 33208: 39 81 ldd r19, Y+1 ; 0x01 3320a: 4a 81 ldd r20, Y+2 ; 0x02 3320c: 5b 81 ldd r21, Y+3 ; 0x03 3320e: c3 5c subi r28, 0xC3 ; 195 33210: d0 40 sbci r29, 0x00 ; 0 33212: c3 01 movw r24, r6 33214: b2 01 movw r22, r4 33216: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 3321a: 9b 01 movw r18, r22 3321c: ac 01 movw r20, r24 3321e: c7 01 movw r24, r14 33220: b6 01 movw r22, r12 33222: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 33226: 6b 01 movw r12, r22 33228: 7c 01 movw r14, r24 3322a: c9 53 subi r28, 0x39 ; 57 3322c: df 4f sbci r29, 0xFF ; 255 3322e: 28 81 ld r18, Y 33230: 39 81 ldd r19, Y+1 ; 0x01 33232: 4a 81 ldd r20, Y+2 ; 0x02 33234: 5b 81 ldd r21, Y+3 ; 0x03 33236: c7 5c subi r28, 0xC7 ; 199 33238: d0 40 sbci r29, 0x00 ; 0 3323a: c5 01 movw r24, r10 3323c: b4 01 movw r22, r8 3323e: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 33242: 9b 01 movw r18, r22 33244: ac 01 movw r20, r24 33246: c7 01 movw r24, r14 33248: b6 01 movw r22, r12 3324a: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 3324e: c5 53 subi r28, 0x35 ; 53 33250: df 4f sbci r29, 0xFF ; 255 33252: 28 81 ld r18, Y 33254: 39 81 ldd r19, Y+1 ; 0x01 33256: 4a 81 ldd r20, Y+2 ; 0x02 33258: 5b 81 ldd r21, Y+3 ; 0x03 3325a: cb 5c subi r28, 0xCB ; 203 3325c: d0 40 sbci r29, 0x00 ; 0 3325e: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 33262: 6b 01 movw r12, r22 33264: 7c 01 movw r14, r24 33266: 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) { 33268: 09 f0 breq .+2 ; 0x3326c 3326a: c9 ce rjmp .-622 ; 0x32ffe // 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]; 3326c: 6e 96 adiw r28, 0x1e ; 30 3326e: 2c ad ldd r18, Y+60 ; 0x3c 33270: 3d ad ldd r19, Y+61 ; 0x3d 33272: 4e ad ldd r20, Y+62 ; 0x3e 33274: 5f ad ldd r21, Y+63 ; 0x3f 33276: 6e 97 sbiw r28, 0x1e ; 30 33278: c5 55 subi r28, 0x55 ; 85 3327a: df 4f sbci r29, 0xFF ; 255 3327c: 68 81 ld r22, Y 3327e: 79 81 ldd r23, Y+1 ; 0x01 33280: 8a 81 ldd r24, Y+2 ; 0x02 33282: 9b 81 ldd r25, Y+3 ; 0x03 33284: cb 5a subi r28, 0xAB ; 171 33286: d0 40 sbci r29, 0x00 ; 0 33288: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 3328c: 60 93 f3 13 sts 0x13F3, r22 ; 0x8013f3 33290: 70 93 f4 13 sts 0x13F4, r23 ; 0x8013f4 33294: 80 93 f5 13 sts 0x13F5, r24 ; 0x8013f5 33298: 90 93 f6 13 sts 0x13F6, r25 ; 0x8013f6 cntr[1] += h[1]; 3329c: a3 01 movw r20, r6 3329e: 92 01 movw r18, r4 332a0: c1 55 subi r28, 0x51 ; 81 332a2: df 4f sbci r29, 0xFF ; 255 332a4: 68 81 ld r22, Y 332a6: 79 81 ldd r23, Y+1 ; 0x01 332a8: 8a 81 ldd r24, Y+2 ; 0x02 332aa: 9b 81 ldd r25, Y+3 ; 0x03 332ac: cf 5a subi r28, 0xAF ; 175 332ae: d0 40 sbci r29, 0x00 ; 0 332b0: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 332b4: 60 93 f7 13 sts 0x13F7, r22 ; 0x8013f7 332b8: 70 93 f8 13 sts 0x13F8, r23 ; 0x8013f8 332bc: 80 93 f9 13 sts 0x13F9, r24 ; 0x8013f9 332c0: 90 93 fa 13 sts 0x13FA, r25 ; 0x8013fa a1 += h[2]; 332c4: a5 01 movw r20, r10 332c6: 94 01 movw r18, r8 332c8: a6 96 adiw r28, 0x26 ; 38 332ca: 6c ad ldd r22, Y+60 ; 0x3c 332cc: 7d ad ldd r23, Y+61 ; 0x3d 332ce: 8e ad ldd r24, Y+62 ; 0x3e 332d0: 9f ad ldd r25, Y+63 ; 0x3f 332d2: a6 97 sbiw r28, 0x26 ; 38 332d4: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 332d8: a6 96 adiw r28, 0x26 ; 38 332da: 6c af std Y+60, r22 ; 0x3c 332dc: 7d af std Y+61, r23 ; 0x3d 332de: 8e af std Y+62, r24 ; 0x3e 332e0: 9f af std Y+63, r25 ; 0x3f 332e2: a6 97 sbiw r28, 0x26 ; 38 a2 += h[3]; 332e4: a7 01 movw r20, r14 332e6: 96 01 movw r18, r12 332e8: a2 96 adiw r28, 0x22 ; 34 332ea: 6c ad ldd r22, Y+60 ; 0x3c 332ec: 7d ad ldd r23, Y+61 ; 0x3d 332ee: 8e ad ldd r24, Y+62 ; 0x3e 332f0: 9f ad ldd r25, Y+63 ; 0x3f 332f2: a2 97 sbiw r28, 0x22 ; 34 332f4: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 332f8: a2 96 adiw r28, 0x22 ; 34 332fa: 6c af std Y+60, r22 ; 0x3c 332fc: 7d af std Y+61, r23 ; 0x3d 332fe: 8e af std Y+62, r24 ; 0x3e 33300: 9f af std Y+63, r25 ; 0x3f 33302: a2 97 sbiw r28, 0x22 ; 34 33304: e6 96 adiw r28, 0x36 ; 54 33306: 9f ad ldd r25, Y+63 ; 0x3f 33308: e6 97 sbiw r28, 0x36 ; 54 3330a: 91 50 subi r25, 0x01 ; 1 3330c: e6 96 adiw r28, 0x36 ; 54 3330e: 9f af std Y+63, r25 ; 0x3f 33310: 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) { 33312: 91 11 cpse r25, r1 33314: e6 ca rjmp .-2612 ; 0x328e2 SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY } vec_x[0] = cos(a1) * MACHINE_AXIS_SCALE_X; 33316: a6 96 adiw r28, 0x26 ; 38 33318: 6c ad ldd r22, Y+60 ; 0x3c 3331a: 7d ad ldd r23, Y+61 ; 0x3d 3331c: 8e ad ldd r24, Y+62 ; 0x3e 3331e: 9f ad ldd r25, Y+63 ; 0x3f 33320: a6 97 sbiw r28, 0x26 ; 38 33322: 0f 94 3e de call 0x3bc7c ; 0x3bc7c 33326: 60 93 e3 13 sts 0x13E3, r22 ; 0x8013e3 3332a: 70 93 e4 13 sts 0x13E4, r23 ; 0x8013e4 3332e: 80 93 e5 13 sts 0x13E5, r24 ; 0x8013e5 33332: 90 93 e6 13 sts 0x13E6, r25 ; 0x8013e6 vec_x[1] = sin(a1) * MACHINE_AXIS_SCALE_X; 33336: a6 96 adiw r28, 0x26 ; 38 33338: 6c ad ldd r22, Y+60 ; 0x3c 3333a: 7d ad ldd r23, Y+61 ; 0x3d 3333c: 8e ad ldd r24, Y+62 ; 0x3e 3333e: 9f ad ldd r25, Y+63 ; 0x3f 33340: a6 97 sbiw r28, 0x26 ; 38 33342: 0f 94 04 e1 call 0x3c208 ; 0x3c208 33346: 60 93 e7 13 sts 0x13E7, r22 ; 0x8013e7 3334a: 70 93 e8 13 sts 0x13E8, r23 ; 0x8013e8 3334e: 80 93 e9 13 sts 0x13E9, r24 ; 0x8013e9 33352: 90 93 ea 13 sts 0x13EA, r25 ; 0x8013ea vec_y[0] = -sin(a2) * MACHINE_AXIS_SCALE_Y; 33356: a2 96 adiw r28, 0x22 ; 34 33358: 6c ad ldd r22, Y+60 ; 0x3c 3335a: 7d ad ldd r23, Y+61 ; 0x3d 3335c: 8e ad ldd r24, Y+62 ; 0x3e 3335e: 9f ad ldd r25, Y+63 ; 0x3f 33360: a2 97 sbiw r28, 0x22 ; 34 33362: 0f 94 04 e1 call 0x3c208 ; 0x3c208 33366: 90 58 subi r25, 0x80 ; 128 33368: 60 93 eb 13 sts 0x13EB, r22 ; 0x8013eb 3336c: 70 93 ec 13 sts 0x13EC, r23 ; 0x8013ec 33370: 80 93 ed 13 sts 0x13ED, r24 ; 0x8013ed 33374: 90 93 ee 13 sts 0x13EE, r25 ; 0x8013ee vec_y[1] = cos(a2) * MACHINE_AXIS_SCALE_Y; 33378: a2 96 adiw r28, 0x22 ; 34 3337a: 6c ad ldd r22, Y+60 ; 0x3c 3337c: 7d ad ldd r23, Y+61 ; 0x3d 3337e: 8e ad ldd r24, Y+62 ; 0x3e 33380: 9f ad ldd r25, Y+63 ; 0x3f 33382: a2 97 sbiw r28, 0x22 ; 34 33384: 0f 94 3e de call 0x3bc7c ; 0x3bc7c 33388: 60 93 ef 13 sts 0x13EF, r22 ; 0x8013ef 3338c: 70 93 f0 13 sts 0x13F0, r23 ; 0x8013f0 33390: 80 93 f1 13 sts 0x13F1, r24 ; 0x8013f1 33394: 90 93 f2 13 sts 0x13F2, r25 ; 0x8013f2 BedSkewOffsetDetectionResultType result = BED_SKEW_OFFSET_DETECTION_PERFECT; { angleDiff = fabs(a2 - a1); 33398: a6 96 adiw r28, 0x26 ; 38 3339a: 2c ad ldd r18, Y+60 ; 0x3c 3339c: 3d ad ldd r19, Y+61 ; 0x3d 3339e: 4e ad ldd r20, Y+62 ; 0x3e 333a0: 5f ad ldd r21, Y+63 ; 0x3f 333a2: a6 97 sbiw r28, 0x26 ; 38 333a4: a2 96 adiw r28, 0x22 ; 34 333a6: 6c ad ldd r22, Y+60 ; 0x3c 333a8: 7d ad ldd r23, Y+61 ; 0x3d 333aa: 8e ad ldd r24, Y+62 ; 0x3e 333ac: 9f ad ldd r25, Y+63 ; 0x3f 333ae: a2 97 sbiw r28, 0x22 ; 34 333b0: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 333b4: 4b 01 movw r8, r22 333b6: 5c 01 movw r10, r24 333b8: 7c 01 movw r14, r24 333ba: 6b 01 movw r12, r22 333bc: e8 94 clt 333be: f7 f8 bld r15, 7 /// XY skew and Y-bed skew DBG(_n("Measured skews: %f %f\n"), degrees(a2 - a1), degrees(a2)); 333c0: 21 ee ldi r18, 0xE1 ; 225 333c2: 3e e2 ldi r19, 0x2E ; 46 333c4: 45 e6 ldi r20, 0x65 ; 101 333c6: 52 e4 ldi r21, 0x42 ; 66 333c8: a2 96 adiw r28, 0x22 ; 34 333ca: 6c ad ldd r22, Y+60 ; 0x3c 333cc: 7d ad ldd r23, Y+61 ; 0x3d 333ce: 8e ad ldd r24, Y+62 ; 0x3e 333d0: 9f ad ldd r25, Y+63 ; 0x3f 333d2: a2 97 sbiw r28, 0x22 ; 34 333d4: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 333d8: 9f 93 push r25 333da: 8f 93 push r24 333dc: 7f 93 push r23 333de: 6f 93 push r22 333e0: 21 ee ldi r18, 0xE1 ; 225 333e2: 3e e2 ldi r19, 0x2E ; 46 333e4: 45 e6 ldi r20, 0x65 ; 101 333e6: 52 e4 ldi r21, 0x42 ; 66 333e8: c5 01 movw r24, r10 333ea: b4 01 movw r22, r8 333ec: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 333f0: 9f 93 push r25 333f2: 8f 93 push r24 333f4: 7f 93 push r23 333f6: 6f 93 push r22 333f8: 82 ef ldi r24, 0xF2 ; 242 333fa: 9f e6 ldi r25, 0x6F ; 111 333fc: 9f 93 push r25 333fe: 8f 93 push r24 33400: 0f 94 de da call 0x3b5bc ; 0x3b5bc if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 33404: b7 01 movw r22, r14 33406: a6 01 movw r20, r12 33408: 80 e6 ldi r24, 0x60 ; 96 3340a: 9f e0 ldi r25, 0x0F ; 15 3340c: 0f 94 52 dc call 0x3b8a4 ; 0x3b8a4 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) 33410: 0f b6 in r0, 0x3f ; 63 33412: f8 94 cli 33414: de bf out 0x3e, r29 ; 62 33416: 0f be out 0x3f, r0 ; 63 33418: cd bf out 0x3d, r28 ; 61 3341a: 2f e1 ldi r18, 0x1F ; 31 3341c: 32 e4 ldi r19, 0x42 ; 66 3341e: 49 e0 ldi r20, 0x09 ; 9 33420: 5b e3 ldi r21, 0x3B ; 59 33422: c7 01 movw r24, r14 33424: b6 01 movw r22, r12 33426: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__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; 3342a: 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) 3342c: 18 16 cp r1, r24 3342e: 64 f4 brge .+24 ; 0x33448 result = (angleDiff > bed_skew_angle_extreme) ? 33430: 25 e3 ldi r18, 0x35 ; 53 33432: 3a ef ldi r19, 0xFA ; 250 33434: 4e e8 ldi r20, 0x8E ; 142 33436: 5b e3 ldi r21, 0x3B ; 59 33438: c7 01 movw r24, r14 3343a: b6 01 movw r22, r12 3343c: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 33440: 12 e0 ldi r17, 0x02 ; 2 33442: 18 16 cp r1, r24 33444: 0c f0 brlt .+2 ; 0x33448 33446: 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 || 33448: 25 e3 ldi r18, 0x35 ; 53 3344a: 3a ef ldi r19, 0xFA ; 250 3344c: 4e e8 ldi r20, 0x8E ; 142 3344e: 5b e3 ldi r21, 0x3B ; 59 33450: a6 96 adiw r28, 0x26 ; 38 33452: 6c ad ldd r22, Y+60 ; 0x3c 33454: 7d ad ldd r23, Y+61 ; 0x3d 33456: 8e ad ldd r24, Y+62 ; 0x3e 33458: 9f ad ldd r25, Y+63 ; 0x3f 3345a: a6 97 sbiw r28, 0x26 ; 38 3345c: 9f 77 andi r25, 0x7F ; 127 3345e: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 33462: 18 16 cp r1, r24 33464: 0c f4 brge .+2 ; 0x33468 33466: 67 c4 rjmp .+2254 ; 0x33d36 33468: 25 e3 ldi r18, 0x35 ; 53 3346a: 3a ef ldi r19, 0xFA ; 250 3346c: 4e e8 ldi r20, 0x8E ; 142 3346e: 5b e3 ldi r21, 0x3B ; 59 33470: a2 96 adiw r28, 0x22 ; 34 33472: 6c ad ldd r22, Y+60 ; 0x3c 33474: 7d ad ldd r23, Y+61 ; 0x3d 33476: 8e ad ldd r24, Y+62 ; 0x3e 33478: 9f ad ldd r25, Y+63 ; 0x3f 3347a: a2 97 sbiw r28, 0x22 ; 34 3347c: 9f 77 andi r25, 0x7F ; 127 3347e: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 33482: 18 16 cp r1, r24 33484: 0c f4 brge .+2 ; 0x33488 33486: 57 c4 rjmp .+2222 ; 0x33d36 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]; 33488: 20 91 e3 13 lds r18, 0x13E3 ; 0x8013e3 3348c: 30 91 e4 13 lds r19, 0x13E4 ; 0x8013e4 33490: 40 91 e5 13 lds r20, 0x13E5 ; 0x8013e5 33494: 50 91 e6 13 lds r21, 0x13E6 ; 0x8013e6 33498: ae 96 adiw r28, 0x2e ; 46 3349a: 2c af std Y+60, r18 ; 0x3c 3349c: 3d af std Y+61, r19 ; 0x3d 3349e: 4e af std Y+62, r20 ; 0x3e 334a0: 5f af std Y+63, r21 ; 0x3f 334a2: ae 97 sbiw r28, 0x2e ; 46 334a4: 80 91 eb 13 lds r24, 0x13EB ; 0x8013eb 334a8: 90 91 ec 13 lds r25, 0x13EC ; 0x8013ec 334ac: a0 91 ed 13 lds r26, 0x13ED ; 0x8013ed 334b0: b0 91 ee 13 lds r27, 0x13EE ; 0x8013ee 334b4: e9 96 adiw r28, 0x39 ; 57 334b6: 8c af std Y+60, r24 ; 0x3c 334b8: 9d af std Y+61, r25 ; 0x3d 334ba: ae af std Y+62, r26 ; 0x3e 334bc: bf af std Y+63, r27 ; 0x3f 334be: e9 97 sbiw r28, 0x39 ; 57 334c0: 20 91 f3 13 lds r18, 0x13F3 ; 0x8013f3 334c4: 30 91 f4 13 lds r19, 0x13F4 ; 0x8013f4 334c8: 40 91 f5 13 lds r20, 0x13F5 ; 0x8013f5 334cc: 50 91 f6 13 lds r21, 0x13F6 ; 0x8013f6 334d0: e4 96 adiw r28, 0x34 ; 52 334d2: 2c af std Y+60, r18 ; 0x3c 334d4: 3d af std Y+61, r19 ; 0x3d 334d6: 4e af std Y+62, r20 ; 0x3e 334d8: 5f af std Y+63, r21 ; 0x3f 334da: 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]; 334dc: 80 91 e7 13 lds r24, 0x13E7 ; 0x8013e7 334e0: 90 91 e8 13 lds r25, 0x13E8 ; 0x8013e8 334e4: a0 91 e9 13 lds r26, 0x13E9 ; 0x8013e9 334e8: b0 91 ea 13 lds r27, 0x13EA ; 0x8013ea 334ec: ed 96 adiw r28, 0x3d ; 61 334ee: 8c af std Y+60, r24 ; 0x3c 334f0: 9d af std Y+61, r25 ; 0x3d 334f2: ae af std Y+62, r26 ; 0x3e 334f4: bf af std Y+63, r27 ; 0x3f 334f6: ed 97 sbiw r28, 0x3d ; 61 334f8: 20 91 ef 13 lds r18, 0x13EF ; 0x8013ef 334fc: 30 91 f0 13 lds r19, 0x13F0 ; 0x8013f0 33500: 40 91 f1 13 lds r20, 0x13F1 ; 0x8013f1 33504: 50 91 f2 13 lds r21, 0x13F2 ; 0x8013f2 33508: c3 58 subi r28, 0x83 ; 131 3350a: df 4f sbci r29, 0xFF ; 255 3350c: 28 83 st Y, r18 3350e: 39 83 std Y+1, r19 ; 0x01 33510: 4a 83 std Y+2, r20 ; 0x02 33512: 5b 83 std Y+3, r21 ; 0x03 33514: cd 57 subi r28, 0x7D ; 125 33516: d0 40 sbci r29, 0x00 ; 0 33518: 80 91 f7 13 lds r24, 0x13F7 ; 0x8013f7 3351c: 90 91 f8 13 lds r25, 0x13F8 ; 0x8013f8 33520: a0 91 f9 13 lds r26, 0x13F9 ; 0x8013f9 33524: b0 91 fa 13 lds r27, 0x13FA ; 0x8013fa 33528: cf 57 subi r28, 0x7F ; 127 3352a: df 4f sbci r29, 0xFF ; 255 3352c: 88 83 st Y, r24 3352e: 99 83 std Y+1, r25 ; 0x01 33530: aa 83 std Y+2, r26 ; 0x02 33532: bb 83 std Y+3, r27 ; 0x03 33534: c1 58 subi r28, 0x81 ; 129 33536: d0 40 sbci r29, 0x00 ; 0 33538: aa ed ldi r26, 0xDA ; 218 3353a: b5 ea ldi r27, 0xA5 ; 165 3353c: 6c 96 adiw r28, 0x1c ; 28 3353e: bf af std Y+63, r27 ; 0x3f 33540: ae af std Y+62, r26 ; 0x3e 33542: 6c 97 sbiw r28, 0x1c ; 28 33544: 82 ec ldi r24, 0xC2 ; 194 33546: 28 2e mov r2, r24 33548: 83 e1 ldi r24, 0x13 ; 19 3354a: 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]; 3354c: f1 01 movw r30, r2 3354e: c1 80 ldd r12, Z+1 ; 0x01 33550: d2 80 ldd r13, Z+2 ; 0x02 33552: e3 80 ldd r14, Z+3 ; 0x03 33554: f4 80 ldd r15, Z+4 ; 0x04 33556: 45 80 ldd r4, Z+5 ; 0x05 33558: 56 80 ldd r5, Z+6 ; 0x06 3355a: 67 80 ldd r6, Z+7 ; 0x07 3355c: 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; 3355e: 6c 96 adiw r28, 0x1c ; 28 33560: ee ad ldd r30, Y+62 ; 0x3e 33562: ff ad ldd r31, Y+63 ; 0x3f 33564: 6c 97 sbiw r28, 0x1c ; 28 33566: 25 91 lpm r18, Z+ 33568: 35 91 lpm r19, Z+ 3356a: 45 91 lpm r20, Z+ 3356c: 54 91 lpm r21, Z 3356e: cb 57 subi r28, 0x7B ; 123 33570: df 4f sbci r29, 0xFF ; 255 33572: 28 83 st Y, r18 33574: 39 83 std Y+1, r19 ; 0x01 33576: 4a 83 std Y+2, r20 ; 0x02 33578: 5b 83 std Y+3, r21 ; 0x03 3357a: c5 58 subi r28, 0x85 ; 133 3357c: d0 40 sbci r29, 0x00 ; 0 float errY = pgm_read_float(true_pts + i * 2 + 1) - y; 3357e: 6c 96 adiw r28, 0x1c ; 28 33580: ee ad ldd r30, Y+62 ; 0x3e 33582: ff ad ldd r31, Y+63 ; 0x3f 33584: 6c 97 sbiw r28, 0x1c ; 28 33586: 34 96 adiw r30, 0x04 ; 4 33588: 85 90 lpm r8, Z+ 3358a: 95 90 lpm r9, Z+ 3358c: a5 90 lpm r10, Z+ 3358e: 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]; 33590: ed 96 adiw r28, 0x3d ; 61 33592: 2c ad ldd r18, Y+60 ; 0x3c 33594: 3d ad ldd r19, Y+61 ; 0x3d 33596: 4e ad ldd r20, Y+62 ; 0x3e 33598: 5f ad ldd r21, Y+63 ; 0x3f 3359a: ed 97 sbiw r28, 0x3d ; 61 3359c: c7 01 movw r24, r14 3359e: b6 01 movw r22, r12 335a0: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 335a4: c7 57 subi r28, 0x77 ; 119 335a6: df 4f sbci r29, 0xFF ; 255 335a8: 68 83 st Y, r22 335aa: 79 83 std Y+1, r23 ; 0x01 335ac: 8a 83 std Y+2, r24 ; 0x02 335ae: 9b 83 std Y+3, r25 ; 0x03 335b0: c9 58 subi r28, 0x89 ; 137 335b2: d0 40 sbci r29, 0x00 ; 0 335b4: c3 58 subi r28, 0x83 ; 131 335b6: df 4f sbci r29, 0xFF ; 255 335b8: 28 81 ld r18, Y 335ba: 39 81 ldd r19, Y+1 ; 0x01 335bc: 4a 81 ldd r20, Y+2 ; 0x02 335be: 5b 81 ldd r21, Y+3 ; 0x03 335c0: cd 57 subi r28, 0x7D ; 125 335c2: d0 40 sbci r29, 0x00 ; 0 335c4: c3 01 movw r24, r6 335c6: b2 01 movw r22, r4 335c8: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 335cc: 9b 01 movw r18, r22 335ce: ac 01 movw r20, r24 335d0: c7 57 subi r28, 0x77 ; 119 335d2: df 4f sbci r29, 0xFF ; 255 335d4: 68 81 ld r22, Y 335d6: 79 81 ldd r23, Y+1 ; 0x01 335d8: 8a 81 ldd r24, Y+2 ; 0x02 335da: 9b 81 ldd r25, Y+3 ; 0x03 335dc: c9 58 subi r28, 0x89 ; 137 335de: d0 40 sbci r29, 0x00 ; 0 335e0: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 335e4: cf 57 subi r28, 0x7F ; 127 335e6: df 4f sbci r29, 0xFF ; 255 335e8: 28 81 ld r18, Y 335ea: 39 81 ldd r19, Y+1 ; 0x01 335ec: 4a 81 ldd r20, Y+2 ; 0x02 335ee: 5b 81 ldd r21, Y+3 ; 0x03 335f0: c1 58 subi r28, 0x81 ; 129 335f2: d0 40 sbci r29, 0x00 ; 0 335f4: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 335f8: 9b 01 movw r18, r22 335fa: 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; 335fc: c5 01 movw r24, r10 335fe: b4 01 movw r22, r8 33600: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 33604: 4b 01 movw r8, r22 33606: 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]; 33608: a7 01 movw r20, r14 3360a: 96 01 movw r18, r12 3360c: ae 96 adiw r28, 0x2e ; 46 3360e: 6c ad ldd r22, Y+60 ; 0x3c 33610: 7d ad ldd r23, Y+61 ; 0x3d 33612: 8e ad ldd r24, Y+62 ; 0x3e 33614: 9f ad ldd r25, Y+63 ; 0x3f 33616: ae 97 sbiw r28, 0x2e ; 46 33618: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 3361c: 6b 01 movw r12, r22 3361e: 7c 01 movw r14, r24 33620: a3 01 movw r20, r6 33622: 92 01 movw r18, r4 33624: e9 96 adiw r28, 0x39 ; 57 33626: 6c ad ldd r22, Y+60 ; 0x3c 33628: 7d ad ldd r23, Y+61 ; 0x3d 3362a: 8e ad ldd r24, Y+62 ; 0x3e 3362c: 9f ad ldd r25, Y+63 ; 0x3f 3362e: e9 97 sbiw r28, 0x39 ; 57 33630: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 33634: 9b 01 movw r18, r22 33636: ac 01 movw r20, r24 33638: c7 01 movw r24, r14 3363a: b6 01 movw r22, r12 3363c: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 33640: e4 96 adiw r28, 0x34 ; 52 33642: 2c ad ldd r18, Y+60 ; 0x3c 33644: 3d ad ldd r19, Y+61 ; 0x3d 33646: 4e ad ldd r20, Y+62 ; 0x3e 33648: 5f ad ldd r21, Y+63 ; 0x3f 3364a: e4 97 sbiw r28, 0x34 ; 52 3364c: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 33650: 9b 01 movw r18, r22 33652: 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; 33654: cb 57 subi r28, 0x7B ; 123 33656: df 4f sbci r29, 0xFF ; 255 33658: 68 81 ld r22, Y 3365a: 79 81 ldd r23, Y+1 ; 0x01 3365c: 8a 81 ldd r24, Y+2 ; 0x02 3365e: 9b 81 ldd r25, Y+3 ; 0x03 33660: c5 58 subi r28, 0x85 ; 133 33662: d0 40 sbci r29, 0x00 ; 0 33664: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> float errY = pgm_read_float(true_pts + i * 2 + 1) - y; float err = hypot(errX, errY); 33668: a5 01 movw r20, r10 3366a: 94 01 movw r18, r8 3366c: 0f 94 e0 df call 0x3bfc0 ; 0x3bfc0 } 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) { 33670: 2d ec ldi r18, 0xCD ; 205 33672: 3c ec ldi r19, 0xCC ; 204 33674: 4c e4 ldi r20, 0x4C ; 76 33676: 5f e3 ldi r21, 0x3F ; 63 33678: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 3367c: 18 16 cp r1, r24 3367e: 0c f4 brge .+2 ; 0x33682 result = BED_SKEW_OFFSET_DETECTION_FITTING_FAILED; 33680: 1e ef ldi r17, 0xFE ; 254 33682: 38 e0 ldi r19, 0x08 ; 8 33684: 23 0e add r2, r19 33686: 31 1c adc r3, r1 33688: 6c 96 adiw r28, 0x1c ; 28 3368a: 4e ad ldd r20, Y+62 ; 0x3e 3368c: 5f ad ldd r21, Y+63 ; 0x3f 3368e: 6c 97 sbiw r28, 0x1c ; 28 33690: 48 5f subi r20, 0xF8 ; 248 33692: 5f 4f sbci r21, 0xFF ; 255 33694: 6c 96 adiw r28, 0x1c ; 28 33696: 5f af std Y+63, r21 ; 0x3f 33698: 4e af std Y+62, r20 ; 0x3e 3369a: 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) { 3369c: a8 96 adiw r28, 0x28 ; 40 3369e: 8e ad ldd r24, Y+62 ; 0x3e 336a0: 9f ad ldd r25, Y+63 ; 0x3f 336a2: a8 97 sbiw r28, 0x28 ; 40 336a4: 82 15 cp r24, r2 336a6: 93 05 cpc r25, r3 336a8: 09 f0 breq .+2 ; 0x336ac 336aa: 50 cf rjmp .-352 ; 0x3354c MYSERIAL.println(BED_CALIBRATION_POINT_OFFSET_MAX_EUCLIDIAN); SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY if (result == BED_SKEW_OFFSET_DETECTION_PERFECT) { 336ac: 11 11 cpse r17, r1 336ae: 62 c1 rjmp .+708 ; 0x33974 #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); 336b0: a2 96 adiw r28, 0x22 ; 34 336b2: 2c ad ldd r18, Y+60 ; 0x3c 336b4: 3d ad ldd r19, Y+61 ; 0x3d 336b6: 4e ad ldd r20, Y+62 ; 0x3e 336b8: 5f ad ldd r21, Y+63 ; 0x3f 336ba: a2 97 sbiw r28, 0x22 ; 34 336bc: a6 96 adiw r28, 0x26 ; 38 336be: 6c ad ldd r22, Y+60 ; 0x3c 336c0: 7d ad ldd r23, Y+61 ; 0x3d 336c2: 8e ad ldd r24, Y+62 ; 0x3e 336c4: 9f ad ldd r25, Y+63 ; 0x3f 336c6: a6 97 sbiw r28, 0x26 ; 38 336c8: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 336cc: 20 e0 ldi r18, 0x00 ; 0 336ce: 30 e0 ldi r19, 0x00 ; 0 336d0: 40 e0 ldi r20, 0x00 ; 0 336d2: 5f e3 ldi r21, 0x3F ; 63 336d4: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 336d8: 6b 01 movw r12, r22 336da: 7c 01 movw r14, r24 vec_x[0] = cos(a1) * MACHINE_AXIS_SCALE_X; 336dc: 0f 94 3e de call 0x3bc7c ; 0x3bc7c 336e0: a2 96 adiw r28, 0x22 ; 34 336e2: 6c af std Y+60, r22 ; 0x3c 336e4: 7d af std Y+61, r23 ; 0x3d 336e6: 8e af std Y+62, r24 ; 0x3e 336e8: 9f af std Y+63, r25 ; 0x3f 336ea: a2 97 sbiw r28, 0x22 ; 34 336ec: 60 93 e3 13 sts 0x13E3, r22 ; 0x8013e3 336f0: 70 93 e4 13 sts 0x13E4, r23 ; 0x8013e4 336f4: 80 93 e5 13 sts 0x13E5, r24 ; 0x8013e5 336f8: 90 93 e6 13 sts 0x13E6, r25 ; 0x8013e6 vec_x[1] = sin(a1) * MACHINE_AXIS_SCALE_X; 336fc: c7 01 movw r24, r14 336fe: b6 01 movw r22, r12 33700: 0f 94 04 e1 call 0x3c208 ; 0x3c208 33704: a6 96 adiw r28, 0x26 ; 38 33706: 6c af std Y+60, r22 ; 0x3c 33708: 7d af std Y+61, r23 ; 0x3d 3370a: 8e af std Y+62, r24 ; 0x3e 3370c: 9f af std Y+63, r25 ; 0x3f 3370e: a6 97 sbiw r28, 0x26 ; 38 33710: 60 93 e7 13 sts 0x13E7, r22 ; 0x8013e7 33714: 70 93 e8 13 sts 0x13E8, r23 ; 0x8013e8 33718: 80 93 e9 13 sts 0x13E9, r24 ; 0x8013e9 3371c: 90 93 ea 13 sts 0x13EA, r25 ; 0x8013ea vec_y[0] = -sin(a1) * MACHINE_AXIS_SCALE_Y; 33720: 9b 01 movw r18, r22 33722: ac 01 movw r20, r24 33724: 50 58 subi r21, 0x80 ; 128 33726: aa 96 adiw r28, 0x2a ; 42 33728: 2c af std Y+60, r18 ; 0x3c 3372a: 3d af std Y+61, r19 ; 0x3d 3372c: 4e af std Y+62, r20 ; 0x3e 3372e: 5f af std Y+63, r21 ; 0x3f 33730: aa 97 sbiw r28, 0x2a ; 42 33732: 20 93 eb 13 sts 0x13EB, r18 ; 0x8013eb 33736: 30 93 ec 13 sts 0x13EC, r19 ; 0x8013ec 3373a: 40 93 ed 13 sts 0x13ED, r20 ; 0x8013ed 3373e: 50 93 ee 13 sts 0x13EE, r21 ; 0x8013ee vec_y[1] = cos(a1) * MACHINE_AXIS_SCALE_Y; 33742: a2 96 adiw r28, 0x22 ; 34 33744: 8c ad ldd r24, Y+60 ; 0x3c 33746: 9d ad ldd r25, Y+61 ; 0x3d 33748: ae ad ldd r26, Y+62 ; 0x3e 3374a: bf ad ldd r27, Y+63 ; 0x3f 3374c: a2 97 sbiw r28, 0x22 ; 34 3374e: 80 93 ef 13 sts 0x13EF, r24 ; 0x8013ef 33752: 90 93 f0 13 sts 0x13F0, r25 ; 0x8013f0 33756: a0 93 f1 13 sts 0x13F1, r26 ; 0x8013f1 3375a: b0 93 f2 13 sts 0x13F2, r27 ; 0x8013f2 // Refresh the offset. cntr[0] = 0.f; 3375e: 10 92 f3 13 sts 0x13F3, r1 ; 0x8013f3 33762: 10 92 f4 13 sts 0x13F4, r1 ; 0x8013f4 33766: 10 92 f5 13 sts 0x13F5, r1 ; 0x8013f5 3376a: 10 92 f6 13 sts 0x13F6, r1 ; 0x8013f6 cntr[1] = 0.f; 3376e: 10 92 f7 13 sts 0x13F7, r1 ; 0x8013f7 33772: 10 92 f8 13 sts 0x13F8, r1 ; 0x8013f8 33776: 10 92 f9 13 sts 0x13F9, r1 ; 0x8013f9 3377a: 10 92 fa 13 sts 0x13FA, r1 ; 0x8013fa float wx = 0.f; 3377e: 41 2c mov r4, r1 33780: 51 2c mov r5, r1 33782: 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]; 33784: cf 56 subi r28, 0x6F ; 111 33786: df 4f sbci r29, 0xFF ; 255 33788: a8 81 ld r26, Y 3378a: b9 81 ldd r27, Y+1 ; 0x01 3378c: c1 59 subi r28, 0x91 ; 145 3378e: d0 40 sbci r29, 0x00 ; 0 33790: 11 96 adiw r26, 0x01 ; 1 33792: 8d 90 ld r8, X+ 33794: 9d 90 ld r9, X+ 33796: ad 90 ld r10, X+ 33798: bc 90 ld r11, X 3379a: 14 97 sbiw r26, 0x04 ; 4 3379c: 15 96 adiw r26, 0x05 ; 5 3379e: 2d 91 ld r18, X+ 337a0: 3d 91 ld r19, X+ 337a2: 4d 91 ld r20, X+ 337a4: 5c 91 ld r21, X 337a6: 18 97 sbiw r26, 0x08 ; 8 337a8: 6e 96 adiw r28, 0x1e ; 30 337aa: 2c af std Y+60, r18 ; 0x3c 337ac: 3d af std Y+61, r19 ; 0x3d 337ae: 4e af std Y+62, r20 ; 0x3e 337b0: 5f af std Y+63, r21 ; 0x3f 337b2: 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); 337b4: cd 56 subi r28, 0x6D ; 109 337b6: df 4f sbci r29, 0xFF ; 255 337b8: e8 81 ld r30, Y 337ba: f9 81 ldd r31, Y+1 ; 0x01 337bc: c3 59 subi r28, 0x93 ; 147 337be: d0 40 sbci r29, 0x00 ; 0 337c0: c5 90 lpm r12, Z+ 337c2: d5 90 lpm r13, Z+ 337c4: e5 90 lpm r14, Z+ 337c6: 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]; 337c8: a5 01 movw r20, r10 337ca: 94 01 movw r18, r8 337cc: a2 96 adiw r28, 0x22 ; 34 337ce: 6c ad ldd r22, Y+60 ; 0x3c 337d0: 7d ad ldd r23, Y+61 ; 0x3d 337d2: 8e ad ldd r24, Y+62 ; 0x3e 337d4: 9f ad ldd r25, Y+63 ; 0x3f 337d6: a2 97 sbiw r28, 0x22 ; 34 337d8: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 337dc: ae 96 adiw r28, 0x2e ; 46 337de: 6c af std Y+60, r22 ; 0x3c 337e0: 7d af std Y+61, r23 ; 0x3d 337e2: 8e af std Y+62, r24 ; 0x3e 337e4: 9f af std Y+63, r25 ; 0x3f 337e6: ae 97 sbiw r28, 0x2e ; 46 337e8: 6e 96 adiw r28, 0x1e ; 30 337ea: 2c ad ldd r18, Y+60 ; 0x3c 337ec: 3d ad ldd r19, Y+61 ; 0x3d 337ee: 4e ad ldd r20, Y+62 ; 0x3e 337f0: 5f ad ldd r21, Y+63 ; 0x3f 337f2: 6e 97 sbiw r28, 0x1e ; 30 337f4: aa 96 adiw r28, 0x2a ; 42 337f6: 6c ad ldd r22, Y+60 ; 0x3c 337f8: 7d ad ldd r23, Y+61 ; 0x3d 337fa: 8e ad ldd r24, Y+62 ; 0x3e 337fc: 9f ad ldd r25, Y+63 ; 0x3f 337fe: aa 97 sbiw r28, 0x2a ; 42 33800: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 33804: 9b 01 movw r18, r22 33806: ac 01 movw r20, r24 33808: ae 96 adiw r28, 0x2e ; 46 3380a: 6c ad ldd r22, Y+60 ; 0x3c 3380c: 7d ad ldd r23, Y+61 ; 0x3d 3380e: 8e ad ldd r24, Y+62 ; 0x3e 33810: 9f ad ldd r25, Y+63 ; 0x3f 33812: ae 97 sbiw r28, 0x2e ; 46 33814: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 33818: 9b 01 movw r18, r22 3381a: 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); 3381c: c7 01 movw r24, r14 3381e: b6 01 movw r22, r12 33820: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 33824: 20 91 f3 13 lds r18, 0x13F3 ; 0x8013f3 33828: 30 91 f4 13 lds r19, 0x13F4 ; 0x8013f4 3382c: 40 91 f5 13 lds r20, 0x13F5 ; 0x8013f5 33830: 50 91 f6 13 lds r21, 0x13F6 ; 0x8013f6 33834: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 33838: 6b 01 movw r12, r22 3383a: 7c 01 movw r14, r24 3383c: c0 92 f3 13 sts 0x13F3, r12 ; 0x8013f3 33840: d0 92 f4 13 sts 0x13F4, r13 ; 0x8013f4 33844: e0 92 f5 13 sts 0x13F5, r14 ; 0x8013f5 33848: f0 92 f6 13 sts 0x13F6, r15 ; 0x8013f6 wx += w; 3384c: 20 e0 ldi r18, 0x00 ; 0 3384e: 30 e0 ldi r19, 0x00 ; 0 33850: 40 e8 ldi r20, 0x80 ; 128 33852: 5f e3 ldi r21, 0x3F ; 63 33854: c3 01 movw r24, r6 33856: b2 01 movw r22, r4 33858: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 3385c: 2b 01 movw r4, r22 3385e: 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); 33860: cd 56 subi r28, 0x6D ; 109 33862: df 4f sbci r29, 0xFF ; 255 33864: e8 81 ld r30, Y 33866: f9 81 ldd r31, Y+1 ; 0x01 33868: c3 59 subi r28, 0x93 ; 147 3386a: d0 40 sbci r29, 0x00 ; 0 3386c: 34 96 adiw r30, 0x04 ; 4 3386e: 25 91 lpm r18, Z+ 33870: 35 91 lpm r19, Z+ 33872: 45 91 lpm r20, Z+ 33874: 54 91 lpm r21, Z 33876: ae 96 adiw r28, 0x2e ; 46 33878: 2c af std Y+60, r18 ; 0x3c 3387a: 3d af std Y+61, r19 ; 0x3d 3387c: 4e af std Y+62, r20 ; 0x3e 3387e: 5f af std Y+63, r21 ; 0x3f 33880: 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]; 33882: a5 01 movw r20, r10 33884: 94 01 movw r18, r8 33886: a6 96 adiw r28, 0x26 ; 38 33888: 6c ad ldd r22, Y+60 ; 0x3c 3388a: 7d ad ldd r23, Y+61 ; 0x3d 3388c: 8e ad ldd r24, Y+62 ; 0x3e 3388e: 9f ad ldd r25, Y+63 ; 0x3f 33890: a6 97 sbiw r28, 0x26 ; 38 33892: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 33896: 4b 01 movw r8, r22 33898: 5c 01 movw r10, r24 3389a: 6e 96 adiw r28, 0x1e ; 30 3389c: 2c ad ldd r18, Y+60 ; 0x3c 3389e: 3d ad ldd r19, Y+61 ; 0x3d 338a0: 4e ad ldd r20, Y+62 ; 0x3e 338a2: 5f ad ldd r21, Y+63 ; 0x3f 338a4: 6e 97 sbiw r28, 0x1e ; 30 338a6: a2 96 adiw r28, 0x22 ; 34 338a8: 6c ad ldd r22, Y+60 ; 0x3c 338aa: 7d ad ldd r23, Y+61 ; 0x3d 338ac: 8e ad ldd r24, Y+62 ; 0x3e 338ae: 9f ad ldd r25, Y+63 ; 0x3f 338b0: a2 97 sbiw r28, 0x22 ; 34 338b2: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 338b6: 9b 01 movw r18, r22 338b8: ac 01 movw r20, r24 338ba: c5 01 movw r24, r10 338bc: b4 01 movw r22, r8 338be: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 338c2: 9b 01 movw r18, r22 338c4: 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); 338c6: ae 96 adiw r28, 0x2e ; 46 338c8: 6c ad ldd r22, Y+60 ; 0x3c 338ca: 7d ad ldd r23, Y+61 ; 0x3d 338cc: 8e ad ldd r24, Y+62 ; 0x3e 338ce: 9f ad ldd r25, Y+63 ; 0x3f 338d0: ae 97 sbiw r28, 0x2e ; 46 338d2: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 338d6: 20 91 f7 13 lds r18, 0x13F7 ; 0x8013f7 338da: 30 91 f8 13 lds r19, 0x13F8 ; 0x8013f8 338de: 40 91 f9 13 lds r20, 0x13F9 ; 0x8013f9 338e2: 50 91 fa 13 lds r21, 0x13FA ; 0x8013fa 338e6: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 338ea: 4b 01 movw r8, r22 338ec: 5c 01 movw r10, r24 338ee: 80 92 f7 13 sts 0x13F7, r8 ; 0x8013f7 338f2: 90 92 f8 13 sts 0x13F8, r9 ; 0x8013f8 338f6: a0 92 f9 13 sts 0x13F9, r10 ; 0x8013f9 338fa: b0 92 fa 13 sts 0x13FA, r11 ; 0x8013fa 338fe: cf 56 subi r28, 0x6F ; 111 33900: df 4f sbci r29, 0xFF ; 255 33902: 48 81 ld r20, Y 33904: 59 81 ldd r21, Y+1 ; 0x01 33906: c1 59 subi r28, 0x91 ; 145 33908: d0 40 sbci r29, 0x00 ; 0 3390a: 48 5f subi r20, 0xF8 ; 248 3390c: 5f 4f sbci r21, 0xFF ; 255 3390e: cf 56 subi r28, 0x6F ; 111 33910: df 4f sbci r29, 0xFF ; 255 33912: 59 83 std Y+1, r21 ; 0x01 33914: 48 83 st Y, r20 33916: c1 59 subi r28, 0x91 ; 145 33918: d0 40 sbci r29, 0x00 ; 0 3391a: cd 56 subi r28, 0x6D ; 109 3391c: df 4f sbci r29, 0xFF ; 255 3391e: 88 81 ld r24, Y 33920: 99 81 ldd r25, Y+1 ; 0x01 33922: c3 59 subi r28, 0x93 ; 147 33924: d0 40 sbci r29, 0x00 ; 0 33926: 08 96 adiw r24, 0x08 ; 8 33928: cd 56 subi r28, 0x6D ; 109 3392a: df 4f sbci r29, 0xFF ; 255 3392c: 99 83 std Y+1, r25 ; 0x01 3392e: 88 83 st Y, r24 33930: c3 59 subi r28, 0x93 ; 147 33932: 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) { 33934: 24 16 cp r2, r20 33936: 35 06 cpc r3, r21 33938: 09 f0 breq .+2 ; 0x3393c 3393a: 24 cf rjmp .-440 ; 0x33784 SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY } cntr[0] /= wx; 3393c: a3 01 movw r20, r6 3393e: 92 01 movw r18, r4 33940: c7 01 movw r24, r14 33942: b6 01 movw r22, r12 33944: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 33948: 60 93 f3 13 sts 0x13F3, r22 ; 0x8013f3 3394c: 70 93 f4 13 sts 0x13F4, r23 ; 0x8013f4 33950: 80 93 f5 13 sts 0x13F5, r24 ; 0x8013f5 33954: 90 93 f6 13 sts 0x13F6, r25 ; 0x8013f6 cntr[1] /= wy; 33958: a3 01 movw r20, r6 3395a: 92 01 movw r18, r4 3395c: c5 01 movw r24, r10 3395e: b4 01 movw r22, r8 33960: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 33964: 60 93 f7 13 sts 0x13F7, r22 ; 0x8013f7 33968: 70 93 f8 13 sts 0x13F8, r23 ; 0x8013f8 3396c: 80 93 f9 13 sts 0x13F9, r24 ; 0x8013f9 33970: 90 93 fa 13 sts 0x13FA, r25 ; 0x8013fa #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]; 33974: 40 90 e3 13 lds r4, 0x13E3 ; 0x8013e3 33978: 50 90 e4 13 lds r5, 0x13E4 ; 0x8013e4 3397c: 60 90 e5 13 lds r6, 0x13E5 ; 0x8013e5 33980: 70 90 e6 13 lds r7, 0x13E6 ; 0x8013e6 33984: c0 90 ef 13 lds r12, 0x13EF ; 0x8013ef 33988: d0 90 f0 13 lds r13, 0x13F0 ; 0x8013f0 3398c: e0 90 f1 13 lds r14, 0x13F1 ; 0x8013f1 33990: f0 90 f2 13 lds r15, 0x13F2 ; 0x8013f2 33994: 20 91 e7 13 lds r18, 0x13E7 ; 0x8013e7 33998: 30 91 e8 13 lds r19, 0x13E8 ; 0x8013e8 3399c: 40 91 e9 13 lds r20, 0x13E9 ; 0x8013e9 339a0: 50 91 ea 13 lds r21, 0x13EA ; 0x8013ea 339a4: a2 96 adiw r28, 0x22 ; 34 339a6: 2c af std Y+60, r18 ; 0x3c 339a8: 3d af std Y+61, r19 ; 0x3d 339aa: 4e af std Y+62, r20 ; 0x3e 339ac: 5f af std Y+63, r21 ; 0x3f 339ae: a2 97 sbiw r28, 0x22 ; 34 339b0: 80 91 eb 13 lds r24, 0x13EB ; 0x8013eb 339b4: 90 91 ec 13 lds r25, 0x13EC ; 0x8013ec 339b8: a0 91 ed 13 lds r26, 0x13ED ; 0x8013ed 339bc: b0 91 ee 13 lds r27, 0x13EE ; 0x8013ee 339c0: a6 96 adiw r28, 0x26 ; 38 339c2: 8c af std Y+60, r24 ; 0x3c 339c4: 9d af std Y+61, r25 ; 0x3d 339c6: ae af std Y+62, r26 ; 0x3e 339c8: bf af std Y+63, r27 ; 0x3f 339ca: a6 97 sbiw r28, 0x26 ; 38 339cc: a7 01 movw r20, r14 339ce: 96 01 movw r18, r12 339d0: c3 01 movw r24, r6 339d2: b2 01 movw r22, r4 339d4: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 339d8: 4b 01 movw r8, r22 339da: 5c 01 movw r10, r24 339dc: a6 96 adiw r28, 0x26 ; 38 339de: 2c ad ldd r18, Y+60 ; 0x3c 339e0: 3d ad ldd r19, Y+61 ; 0x3d 339e2: 4e ad ldd r20, Y+62 ; 0x3e 339e4: 5f ad ldd r21, Y+63 ; 0x3f 339e6: a6 97 sbiw r28, 0x26 ; 38 339e8: a2 96 adiw r28, 0x22 ; 34 339ea: 6c ad ldd r22, Y+60 ; 0x3c 339ec: 7d ad ldd r23, Y+61 ; 0x3d 339ee: 8e ad ldd r24, Y+62 ; 0x3e 339f0: 9f ad ldd r25, Y+63 ; 0x3f 339f2: a2 97 sbiw r28, 0x22 ; 34 339f4: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 339f8: 9b 01 movw r18, r22 339fa: ac 01 movw r20, r24 339fc: c5 01 movw r24, r10 339fe: b4 01 movw r22, r8 33a00: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 33a04: 4b 01 movw r8, r22 33a06: 5c 01 movw r10, r24 float Ainv[2][2] = { { vec_y[1] / d, -vec_y[0] / d }, 33a08: ac 01 movw r20, r24 33a0a: 9b 01 movw r18, r22 33a0c: c7 01 movw r24, r14 33a0e: b6 01 movw r22, r12 33a10: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 33a14: 6b 01 movw r12, r22 33a16: 7c 01 movw r14, r24 33a18: a6 96 adiw r28, 0x26 ; 38 33a1a: 6c ad ldd r22, Y+60 ; 0x3c 33a1c: 7d ad ldd r23, Y+61 ; 0x3d 33a1e: 8e ad ldd r24, Y+62 ; 0x3e 33a20: 9f ad ldd r25, Y+63 ; 0x3f 33a22: a6 97 sbiw r28, 0x26 ; 38 33a24: 90 58 subi r25, 0x80 ; 128 33a26: a5 01 movw r20, r10 33a28: 94 01 movw r18, r8 33a2a: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 33a2e: a6 96 adiw r28, 0x26 ; 38 33a30: 6c af std Y+60, r22 ; 0x3c 33a32: 7d af std Y+61, r23 ; 0x3d 33a34: 8e af std Y+62, r24 ; 0x3e 33a36: 9f af std Y+63, r25 ; 0x3f 33a38: a6 97 sbiw r28, 0x26 ; 38 { -vec_x[1] / d, vec_x[0] / d } 33a3a: a2 96 adiw r28, 0x22 ; 34 33a3c: 6c ad ldd r22, Y+60 ; 0x3c 33a3e: 7d ad ldd r23, Y+61 ; 0x3d 33a40: 8e ad ldd r24, Y+62 ; 0x3e 33a42: 9f ad ldd r25, Y+63 ; 0x3f 33a44: a2 97 sbiw r28, 0x22 ; 34 33a46: 90 58 subi r25, 0x80 ; 128 33a48: a5 01 movw r20, r10 33a4a: 94 01 movw r18, r8 33a4c: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 33a50: aa 96 adiw r28, 0x2a ; 42 33a52: 6c af std Y+60, r22 ; 0x3c 33a54: 7d af std Y+61, r23 ; 0x3d 33a56: 8e af std Y+62, r24 ; 0x3e 33a58: 9f af std Y+63, r25 ; 0x3f 33a5a: aa 97 sbiw r28, 0x2a ; 42 33a5c: a5 01 movw r20, r10 33a5e: 94 01 movw r18, r8 33a60: c3 01 movw r24, r6 33a62: b2 01 movw r22, r4 33a64: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 33a68: 4b 01 movw r8, r22 33a6a: 5c 01 movw r10, r24 }; float cntrInv[2] = { -Ainv[0][0] * cntr[0] - Ainv[0][1] * cntr[1], 33a6c: 40 90 f3 13 lds r4, 0x13F3 ; 0x8013f3 33a70: 50 90 f4 13 lds r5, 0x13F4 ; 0x8013f4 33a74: 60 90 f5 13 lds r6, 0x13F5 ; 0x8013f5 33a78: 70 90 f6 13 lds r7, 0x13F6 ; 0x8013f6 33a7c: 20 91 f7 13 lds r18, 0x13F7 ; 0x8013f7 33a80: 30 91 f8 13 lds r19, 0x13F8 ; 0x8013f8 33a84: 40 91 f9 13 lds r20, 0x13F9 ; 0x8013f9 33a88: 50 91 fa 13 lds r21, 0x13FA ; 0x8013fa 33a8c: a2 96 adiw r28, 0x22 ; 34 33a8e: 2c af std Y+60, r18 ; 0x3c 33a90: 3d af std Y+61, r19 ; 0x3d 33a92: 4e af std Y+62, r20 ; 0x3e 33a94: 5f af std Y+63, r21 ; 0x3f 33a96: a2 97 sbiw r28, 0x22 ; 34 -Ainv[1][0] * cntr[0] - Ainv[1][1] * cntr[1] }; vec_x[0] = Ainv[0][0]; 33a98: c0 92 e3 13 sts 0x13E3, r12 ; 0x8013e3 33a9c: d0 92 e4 13 sts 0x13E4, r13 ; 0x8013e4 33aa0: e0 92 e5 13 sts 0x13E5, r14 ; 0x8013e5 33aa4: f0 92 e6 13 sts 0x13E6, r15 ; 0x8013e6 vec_x[1] = Ainv[1][0]; 33aa8: aa 96 adiw r28, 0x2a ; 42 33aaa: 8c ad ldd r24, Y+60 ; 0x3c 33aac: 9d ad ldd r25, Y+61 ; 0x3d 33aae: ae ad ldd r26, Y+62 ; 0x3e 33ab0: bf ad ldd r27, Y+63 ; 0x3f 33ab2: aa 97 sbiw r28, 0x2a ; 42 33ab4: 80 93 e7 13 sts 0x13E7, r24 ; 0x8013e7 33ab8: 90 93 e8 13 sts 0x13E8, r25 ; 0x8013e8 33abc: a0 93 e9 13 sts 0x13E9, r26 ; 0x8013e9 33ac0: b0 93 ea 13 sts 0x13EA, r27 ; 0x8013ea vec_y[0] = Ainv[0][1]; 33ac4: a6 96 adiw r28, 0x26 ; 38 33ac6: 2c ad ldd r18, Y+60 ; 0x3c 33ac8: 3d ad ldd r19, Y+61 ; 0x3d 33aca: 4e ad ldd r20, Y+62 ; 0x3e 33acc: 5f ad ldd r21, Y+63 ; 0x3f 33ace: a6 97 sbiw r28, 0x26 ; 38 33ad0: 20 93 eb 13 sts 0x13EB, r18 ; 0x8013eb 33ad4: 30 93 ec 13 sts 0x13EC, r19 ; 0x8013ec 33ad8: 40 93 ed 13 sts 0x13ED, r20 ; 0x8013ed 33adc: 50 93 ee 13 sts 0x13EE, r21 ; 0x8013ee vec_y[1] = Ainv[1][1]; 33ae0: 80 92 ef 13 sts 0x13EF, r8 ; 0x8013ef 33ae4: 90 92 f0 13 sts 0x13F0, r9 ; 0x8013f0 33ae8: a0 92 f1 13 sts 0x13F1, r10 ; 0x8013f1 33aec: b0 92 f2 13 sts 0x13F2, r11 ; 0x8013f2 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], 33af0: c7 01 movw r24, r14 33af2: b6 01 movw r22, r12 33af4: 90 58 subi r25, 0x80 ; 128 33af6: a3 01 movw r20, r6 33af8: 92 01 movw r18, r4 33afa: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 33afe: 6b 01 movw r12, r22 33b00: 7c 01 movw r14, r24 33b02: a2 96 adiw r28, 0x22 ; 34 33b04: 2c ad ldd r18, Y+60 ; 0x3c 33b06: 3d ad ldd r19, Y+61 ; 0x3d 33b08: 4e ad ldd r20, Y+62 ; 0x3e 33b0a: 5f ad ldd r21, Y+63 ; 0x3f 33b0c: a2 97 sbiw r28, 0x22 ; 34 33b0e: a6 96 adiw r28, 0x26 ; 38 33b10: 6c ad ldd r22, Y+60 ; 0x3c 33b12: 7d ad ldd r23, Y+61 ; 0x3d 33b14: 8e ad ldd r24, Y+62 ; 0x3e 33b16: 9f ad ldd r25, Y+63 ; 0x3f 33b18: a6 97 sbiw r28, 0x26 ; 38 33b1a: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 33b1e: 9b 01 movw r18, r22 33b20: ac 01 movw r20, r24 33b22: c7 01 movw r24, r14 33b24: b6 01 movw r22, r12 33b26: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__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]; 33b2a: 60 93 f3 13 sts 0x13F3, r22 ; 0x8013f3 33b2e: 70 93 f4 13 sts 0x13F4, r23 ; 0x8013f4 33b32: 80 93 f5 13 sts 0x13F5, r24 ; 0x8013f5 33b36: 90 93 f6 13 sts 0x13F6, r25 ; 0x8013f6 { 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] 33b3a: aa 96 adiw r28, 0x2a ; 42 33b3c: 6c ad ldd r22, Y+60 ; 0x3c 33b3e: 7d ad ldd r23, Y+61 ; 0x3d 33b40: 8e ad ldd r24, Y+62 ; 0x3e 33b42: 9f ad ldd r25, Y+63 ; 0x3f 33b44: aa 97 sbiw r28, 0x2a ; 42 33b46: 90 58 subi r25, 0x80 ; 128 33b48: a3 01 movw r20, r6 33b4a: 92 01 movw r18, r4 33b4c: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 33b50: 6b 01 movw r12, r22 33b52: 7c 01 movw r14, r24 33b54: a2 96 adiw r28, 0x22 ; 34 33b56: 2c ad ldd r18, Y+60 ; 0x3c 33b58: 3d ad ldd r19, Y+61 ; 0x3d 33b5a: 4e ad ldd r20, Y+62 ; 0x3e 33b5c: 5f ad ldd r21, Y+63 ; 0x3f 33b5e: a2 97 sbiw r28, 0x22 ; 34 33b60: c5 01 movw r24, r10 33b62: b4 01 movw r22, r8 33b64: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 33b68: 9b 01 movw r18, r22 33b6a: ac 01 movw r20, r24 33b6c: c7 01 movw r24, r14 33b6e: b6 01 movw r22, r12 33b70: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__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]; 33b74: 60 93 f7 13 sts 0x13F7, r22 ; 0x8013f7 33b78: 70 93 f8 13 sts 0x13F8, r23 ; 0x8013f8 33b7c: 80 93 f9 13 sts 0x13F9, r24 ; 0x8013f9 33b80: 90 93 fa 13 sts 0x13FA, r25 ; 0x8013fa 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 33b84: 90 e0 ldi r25, 0x00 ; 0 33b86: 80 e0 ldi r24, 0x00 ; 0 33b88: 0e 94 e4 8c call 0x119c8 ; 0x119c8 if (result >= 0) { 33b8c: 17 fd sbrc r17, 7 33b8e: d5 c0 rjmp .+426 ; 0x33d3a DBG(_n("Calibration success.\n")); 33b90: 80 e3 ldi r24, 0x30 ; 48 33b92: 90 e7 ldi r25, 0x70 ; 112 33b94: 9f 93 push r25 33b96: 8f 93 push r24 33b98: 0f 94 de da call 0x3b5bc ; 0x3b5bc world2machine_update(vec_x, vec_y, cntr); 33b9c: 43 ef ldi r20, 0xF3 ; 243 33b9e: 53 e1 ldi r21, 0x13 ; 19 33ba0: 6b ee ldi r22, 0xEB ; 235 33ba2: 73 e1 ldi r23, 0x13 ; 19 33ba4: 83 ee ldi r24, 0xE3 ; 227 33ba6: 93 e1 ldi r25, 0x13 ; 19 33ba8: 0f 94 b4 cc call 0x39968 ; 0x39968 #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); 33bac: 48 e0 ldi r20, 0x08 ; 8 33bae: 50 e0 ldi r21, 0x00 ; 0 33bb0: 65 ee ldi r22, 0xE5 ; 229 33bb2: 7f e0 ldi r23, 0x0F ; 15 33bb4: 83 ef ldi r24, 0xF3 ; 243 33bb6: 93 e1 ldi r25, 0x13 ; 19 33bb8: 0f 94 30 dc call 0x3b860 ; 0x3b860 33bbc: 48 e0 ldi r20, 0x08 ; 8 33bbe: 50 e0 ldi r21, 0x00 ; 0 33bc0: 6d ed ldi r22, 0xDD ; 221 33bc2: 7f e0 ldi r23, 0x0F ; 15 33bc4: 83 ee ldi r24, 0xE3 ; 227 33bc6: 93 e1 ldi r25, 0x13 ; 19 33bc8: 0f 94 30 dc call 0x3b860 ; 0x3b860 33bcc: 48 e0 ldi r20, 0x08 ; 8 33bce: 50 e0 ldi r21, 0x00 ; 0 33bd0: 65 ed ldi r22, 0xD5 ; 213 33bd2: 7f e0 ldi r23, 0x0F ; 15 33bd4: 8b ee ldi r24, 0xEB ; 235 33bd6: 93 e1 ldi r25, 0x13 ; 19 33bd8: 0f 94 30 dc call 0x3b860 ; 0x3b860 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(); 33bdc: 0f 94 39 cc call 0x39872 ; 0x39872 } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ DBG(_n("Fitting failed => calibration failed.\n")); 33be0: 0f 90 pop r0 33be2: 0f 90 pop r0 BedSkewOffsetDetectionResultType result = find_bed_offset_and_skew(verbosity_level, point_too_far_mask); clean_up_after_endstop_move(l_feedmultiply); 33be4: c7 55 subi r28, 0x57 ; 87 33be6: df 4f sbci r29, 0xFF ; 255 33be8: 88 81 ld r24, Y 33bea: 99 81 ldd r25, Y+1 ; 0x01 33bec: c9 5a subi r28, 0xA9 ; 169 33bee: d0 40 sbci r29, 0x00 ; 0 33bf0: 0e 94 ce 66 call 0xcd9c ; 0xcd9c // Print head up. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 33bf4: 80 e0 ldi r24, 0x00 ; 0 33bf6: 90 e0 ldi r25, 0x00 ; 0 33bf8: a0 ea ldi r26, 0xA0 ; 160 33bfa: b0 e4 ldi r27, 0x40 ; 64 33bfc: 80 93 9a 06 sts 0x069A, r24 ; 0x80069a 33c00: 90 93 9b 06 sts 0x069B, r25 ; 0x80069b 33c04: a0 93 9c 06 sts 0x069C, r26 ; 0x80069c 33c08: b0 93 9d 06 sts 0x069D, r27 ; 0x80069d plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40); 33c0c: 60 e0 ldi r22, 0x00 ; 0 33c0e: 70 e0 ldi r23, 0x00 ; 0 33c10: 80 ea ldi r24, 0xA0 ; 160 33c12: 91 e4 ldi r25, 0x41 ; 65 33c14: 0f 94 49 c0 call 0x38092 ; 0x38092 st_synchronize(); 33c18: 0f 94 e8 42 call 0x285d0 ; 0x285d0 //#ifndef NEW_XYZCAL if (result >= 0) 33c1c: 17 fd sbrc r17, 7 33c1e: 22 c0 rjmp .+68 ; 0x33c64 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; 33c20: 10 92 9a 06 sts 0x069A, r1 ; 0x80069a 33c24: 10 92 9b 06 sts 0x069B, r1 ; 0x80069b 33c28: 10 92 9c 06 sts 0x069C, r1 ; 0x80069c 33c2c: 10 92 9d 06 sts 0x069D, r1 ; 0x80069d destination[Z_AXIS] = 150.F; 33c30: 80 e0 ldi r24, 0x00 ; 0 33c32: 90 e0 ldi r25, 0x00 ; 0 33c34: a6 e1 ldi r26, 0x16 ; 22 33c36: b3 e4 ldi r27, 0x43 ; 67 33c38: 80 93 7c 06 sts 0x067C, r24 ; 0x80067c 33c3c: 90 93 7d 06 sts 0x067D, r25 ; 0x80067d 33c40: a0 93 7e 06 sts 0x067E, r26 ; 0x80067e 33c44: b0 93 7f 06 sts 0x067F, r27 ; 0x80067f plan_buffer_line_destinationXYZE(homing_feedrate[Z_AXIS] / 60); 33c48: 65 e5 ldi r22, 0x55 ; 85 33c4a: 75 e5 ldi r23, 0x55 ; 85 33c4c: 85 e5 ldi r24, 0x55 ; 85 33c4e: 91 e4 ldi r25, 0x41 ; 65 33c50: 0f 94 16 c0 call 0x3802c ; 0x3802c lcd_show_fullscreen_message_and_wait_P(_T(MSG_PLACE_STEEL_SHEET)); 33c54: 8d e1 ldi r24, 0x1D ; 29 33c56: 9a e5 ldi r25, 0x5A ; 90 33c58: 0e 94 ac 72 call 0xe558 ; 0xe558 33c5c: 0f 94 f1 1f call 0x23fe2 ; 0x23fe2 // 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()) 33c60: 0f 94 48 ca call 0x39490 ; 0x39490 st_synchronize(); // if (result >= 0) babystep_apply(); #endif //HEATBED_V2 } //#endif //NEW_XYZCAL lcd_update_enable(true); 33c64: 81 e0 ldi r24, 0x01 ; 1 33c66: 0e 94 25 6f call 0xde4a ; 0xde4a lcd_update(2); 33c6a: 82 e0 ldi r24, 0x02 ; 2 33c6c: 0e 94 a7 6e call 0xdd4e ; 0xdd4e 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)); 33c70: 8e ed ldi r24, 0xDE ; 222 33c72: 99 e5 ldi r25, 0x59 ; 89 } 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) { 33c74: 1f 3f cpi r17, 0xFF ; 255 33c76: 99 f0 breq .+38 ; 0x33c9e 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) { 33c78: 1e 3f cpi r17, 0xFE ; 254 33c7a: 09 f0 breq .+2 ; 0x33c7e 33c7c: 73 c0 rjmp .+230 ; 0x33d64 if (point_too_far_mask == 0) 33c7e: af 96 adiw r28, 0x2f ; 47 33c80: 4f ad ldd r20, Y+63 ; 0x3f 33c82: af 97 sbiw r28, 0x2f ; 47 msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); 33c84: 89 ea ldi r24, 0xA9 ; 169 33c86: 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) 33c88: 44 23 and r20, r20 33c8a: 49 f0 breq .+18 ; 0x33c9e msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); else if (point_too_far_mask == 2 || point_too_far_mask == 7) 33c8c: af 96 adiw r28, 0x2f ; 47 33c8e: 5f ad ldd r21, Y+63 ; 0x3f 33c90: 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); 33c92: 87 e6 ldi r24, 0x67 ; 103 33c94: 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) 33c96: 52 30 cpi r21, 0x02 ; 2 33c98: 11 f0 breq .+4 ; 0x33c9e // 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); 33c9a: 80 e2 ldi r24, 0x20 ; 32 33c9c: 99 e5 ldi r25, 0x59 ; 89 33c9e: 0e 94 ac 72 call 0xe558 ; 0xe558 33ca2: 0d 94 a1 92 jmp 0x32542 ; 0x32542 (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]) : 33ca6: f2 01 movw r30, r4 33ca8: 25 81 ldd r18, Z+5 ; 0x05 33caa: 36 81 ldd r19, Z+6 ; 0x06 33cac: 47 81 ldd r20, Z+7 ; 0x07 33cae: 50 85 ldd r21, Z+8 ; 0x08 33cb0: c3 58 subi r28, 0x83 ; 131 33cb2: df 4f sbci r29, 0xFF ; 255 33cb4: 68 81 ld r22, Y 33cb6: 79 81 ldd r23, Y+1 ; 0x01 33cb8: 8a 81 ldd r24, Y+2 ; 0x02 33cba: 9b 81 ldd r25, Y+3 ; 0x03 33cbc: cd 57 subi r28, 0x7D ; 125 33cbe: d0 40 sbci r29, 0x00 ; 0 33cc0: 0d 94 8d 95 jmp 0x32b1a ; 0x32b1a // 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]) : 33cc4: f2 01 movw r30, r4 33cc6: 25 81 ldd r18, Z+5 ; 0x05 33cc8: 36 81 ldd r19, Z+6 ; 0x06 33cca: 47 81 ldd r20, Z+7 ; 0x07 33ccc: 50 85 ldd r21, Z+8 ; 0x08 33cce: ed 96 adiw r28, 0x3d ; 61 33cd0: 6c ad ldd r22, Y+60 ; 0x3c 33cd2: 7d ad ldd r23, Y+61 ; 0x3d 33cd4: 8e ad ldd r24, Y+62 ; 0x3e 33cd6: 9f ad ldd r25, Y+63 ; 0x3f 33cd8: ed 97 sbiw r28, 0x3d ; 61 33cda: b8 c0 rjmp .+368 ; 0x33e4c (-s2 * measured_pts[2 * i + 1])); float b = (c == 1) ? 1.f : ((c == 2) ? ( c1 * measured_pts[2 * i]) : 33cdc: f2 01 movw r30, r4 33cde: 25 81 ldd r18, Z+5 ; 0x05 33ce0: 36 81 ldd r19, Z+6 ; 0x06 33ce2: 47 81 ldd r20, Z+7 ; 0x07 33ce4: 50 85 ldd r21, Z+8 ; 0x08 33ce6: ed 96 adiw r28, 0x3d ; 61 33ce8: 6c ad ldd r22, Y+60 ; 0x3c 33cea: 7d ad ldd r23, Y+61 ; 0x3d 33cec: 8e ad ldd r24, Y+62 ; 0x3e 33cee: 9f ad ldd r25, Y+63 ; 0x3f 33cf0: ed 97 sbiw r28, 0x3d ; 61 33cf2: c6 c0 rjmp .+396 ; 0x33e80 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]) : 33cf4: a3 01 movw r20, r6 33cf6: 92 01 movw r18, r4 33cf8: c3 58 subi r28, 0x83 ; 131 33cfa: df 4f sbci r29, 0xFF ; 255 33cfc: 68 81 ld r22, Y 33cfe: 79 81 ldd r23, Y+1 ; 0x01 33d00: 8a 81 ldd r24, Y+2 ; 0x02 33d02: 9b 81 ldd r25, Y+3 ; 0x03 33d04: cd 57 subi r28, 0x7D ; 125 33d06: d0 40 sbci r29, 0x00 ; 0 33d08: 0d 94 f5 95 jmp 0x32bea ; 0x32bea // J^T times f(x) acc = 0.f; for (uint8_t i = 0; i < npts; ++i) { { float j = (r == 0) ? 1.f : 33d0c: 81 2c mov r8, r1 33d0e: 91 2c mov r9, r1 33d10: 20 e8 ldi r18, 0x80 ; 128 33d12: a2 2e mov r10, r18 33d14: 2f e3 ldi r18, 0x3F ; 63 33d16: b2 2e mov r11, r18 33d18: 0d 94 f9 95 jmp 0x32bf2 ; 0x32bf2 float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += j * fx * w; } { float j = (r == 0) ? 0.f : 33d1c: c1 2c mov r12, r1 33d1e: d1 2c mov r13, r1 33d20: 76 01 movw r14, r12 33d22: 0d 94 70 96 jmp 0x32ce0 ; 0x32ce0 ((r == 1) ? 1.f : 33d26: c1 2c mov r12, r1 33d28: d1 2c mov r13, r1 33d2a: 90 e8 ldi r25, 0x80 ; 128 33d2c: e9 2e mov r14, r25 33d2e: 9f e3 ldi r25, 0x3F ; 63 33d30: f9 2e mov r15, r25 33d32: 0d 94 70 96 jmp 0x32ce0 ; 0x32ce0 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; 33d36: 12 e0 ldi r17, 0x02 ; 2 33d38: a7 cb rjmp .-2226 ; 0x33488 } } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ 33d3a: 1e 3f cpi r17, 0xFE ; 254 33d3c: 89 f4 brne .+34 ; 0x33d60 33d3e: af 96 adiw r28, 0x2f ; 47 33d40: 3f ad ldd r19, Y+63 ; 0x3f 33d42: af 97 sbiw r28, 0x2f ; 47 33d44: 32 30 cpi r19, 0x02 ; 2 33d46: 09 f0 breq .+2 ; 0x33d4a 33d48: 4d cf rjmp .-358 ; 0x33be4 DBG(_n("Fitting failed => calibration failed.\n")); 33d4a: 89 e0 ldi r24, 0x09 ; 9 33d4c: 90 e7 ldi r25, 0x70 ; 112 33d4e: 9f 93 push r25 33d50: 8f 93 push r24 33d52: 0f 94 de da call 0x3b5bc ; 0x3b5bc 33d56: 44 cf rjmp .-376 ; 0x33be0 // 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; 33d58: af 96 adiw r28, 0x2f ; 47 33d5a: 1f ae std Y+63, r1 ; 0x3f 33d5c: af 97 sbiw r28, 0x2f ; 47 33d5e: 42 cf rjmp .-380 ; 0x33be4 } } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ 33d60: 1f ef ldi r17, 0xFF ; 255 33d62: 40 cf rjmp .-384 ; 0x33be4 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) { 33d64: af 96 adiw r28, 0x2f ; 47 33d66: 6f ad ldd r22, Y+63 ; 0x3f 33d68: af 97 sbiw r28, 0x2f ; 47 33d6a: 61 11 cpse r22, r1 33d6c: 13 c0 rjmp .+38 ; 0x33d94 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); 33d6e: 85 e0 ldi r24, 0x05 ; 5 33d70: 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) { 33d72: 11 30 cpi r17, 0x01 ; 1 33d74: 51 f0 breq .+20 ; 0x33d8a 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); 33d76: 82 ec ldi r24, 0xC2 ; 194 33d78: 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) { 33d7a: 12 30 cpi r17, 0x02 ; 2 33d7c: 31 f0 breq .+12 ; 0x33d8a default: // should not happen msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); 33d7e: 89 ea ldi r24, 0xA9 ; 169 33d80: 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) { 33d82: 11 11 cpse r17, r1 33d84: 02 c0 rjmp .+4 ; 0x33d8a 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); 33d86: 8a e4 ldi r24, 0x4A ; 74 33d88: 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); 33d8a: 0e 94 ac 72 call 0xe558 ; 0xe558 break; } lcd_show_fullscreen_message_and_wait_P(msg); 33d8e: 0f 94 f1 1f call 0x23fe2 ; 0x23fe2 33d92: 0d c0 rjmp .+26 ; 0x33dae // 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) 33d94: af 96 adiw r28, 0x2f ; 47 33d96: 8f ad ldd r24, Y+63 ; 0x3f 33d98: af 97 sbiw r28, 0x2f ; 47 33d9a: 82 30 cpi r24, 0x02 ; 2 33d9c: f1 f4 brne .+60 ; 0x33dda // Only the center point or all the three front points. msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_BOTH_FAR); 33d9e: 89 ed ldi r24, 0xD9 ; 217 33da0: 98 e5 ldi r25, 0x58 ; 88 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); 33da2: 0e 94 ac 72 call 0xe558 ; 0xe558 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); 33da6: 0f 94 f1 1f call 0x23fe2 ; 0x23fe2 } if (point_too_far_mask == 0 || result > 0) { 33daa: 11 16 cp r1, r17 33dac: 04 f3 brlt .-64 ; 0x33d6e //#endif //NEW_XYZCAL lcd_update_enable(true); lcd_update(2); lcd_bed_calibration_show_result(result, point_too_far_mask); if (result >= 0) 33dae: 1f 3f cpi r17, 0xFF ; 255 33db0: 11 f4 brne .+4 ; 0x33db6 33db2: 0d 94 43 8e jmp 0x31c86 ; 0x31c86 { // 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); 33db6: 86 e0 ldi r24, 0x06 ; 6 33db8: 0e 94 92 ee call 0x1dd24 ; 0x1dd24 if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 33dbc: 8f e5 ldi r24, 0x5F ; 95 33dbe: 9f e0 ldi r25, 0x0F ; 15 33dc0: 0f 94 1c dc call 0x3b838 ; 0x3b838 33dc4: 81 11 cpse r24, r1 33dc6: 0d 94 bb 92 jmp 0x32576 ; 0x32576 lcd_show_fullscreen_message_and_wait_P(_T(MSG_BABYSTEP_Z_NOT_SET)); 33dca: 84 e4 ldi r24, 0x44 ; 68 33dcc: 9a e5 ldi r25, 0x5A ; 90 33dce: 0e 94 ac 72 call 0xe558 ; 0xe558 33dd2: 0f 94 f1 1f call 0x23fe2 ; 0x23fe2 33dd6: 0d 94 bb 92 jmp 0x32576 ; 0x32576 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); 33dda: 8d e8 ldi r24, 0x8D ; 141 33ddc: 98 e5 ldi r25, 0x58 ; 88 33dde: e1 cf rjmp .-62 ; 0x33da2 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)) 33de0: 89 81 ldd r24, Y+1 ; 0x01 33de2: 9a 81 ldd r25, Y+2 ; 0x02 33de4: 80 37 cpi r24, 0x70 ; 112 33de6: 98 40 sbci r25, 0x08 ; 8 33de8: 10 f0 brcs .+4 ; 0x33dee 33dea: 0d 94 fa 92 jmp 0x325f4 ; 0x325f4 if ((ret = xyzcal_spiral2(cx, cy, z0 - 2*dz, dz, radius, 180, delay_us, check_pinda, &ad)) != 0) 33dee: ae 01 movw r20, r28 33df0: 4f 5f subi r20, 0xFF ; 255 33df2: 5f 4f sbci r21, 0xFF ; 255 33df4: 7a 01 movw r14, r20 33df6: 04 eb ldi r16, 0xB4 ; 180 33df8: 10 e0 ldi r17, 0x00 ; 0 33dfa: 24 e8 ldi r18, 0x84 ; 132 33dfc: 33 e0 ldi r19, 0x03 ; 3 33dfe: a6 01 movw r20, r12 33e00: 48 5c subi r20, 0xC8 ; 200 33e02: 51 09 sbc r21, r1 33e04: 69 2d mov r22, r9 33e06: 78 2d mov r23, r8 33e08: 8b 2d mov r24, r11 33e0a: 9a 2d mov r25, r10 33e0c: 0f 94 7b 6e call 0x2dcf6 ; 0x2dcf6 33e10: 88 23 and r24, r24 33e12: 11 f4 brne .+4 ; 0x33e18 33e14: 0d 94 fa 92 jmp 0x325f4 ; 0x325f4 ad += 1440; 33e18: 89 81 ldd r24, Y+1 ; 0x01 33e1a: 9a 81 ldd r25, Y+2 ; 0x02 33e1c: 80 56 subi r24, 0x60 ; 96 33e1e: 9a 4f sbci r25, 0xFA ; 250 33e20: 0d 94 1d 90 jmp 0x3203a ; 0x3203a 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) { 33e24: 00 23 and r16, r16 33e26: 11 f4 brne .+4 ; 0x33e2c 33e28: 0d 94 a0 95 jmp 0x32b40 ; 0x32b40 float a = (r == 1) ? 1.f : ((r == 2) ? ( c1 * measured_pts[2 * i]) : 33e2c: 02 30 cpi r16, 0x02 ; 2 33e2e: 09 f0 breq .+2 ; 0x33e32 33e30: 49 cf rjmp .-366 ; 0x33cc4 33e32: d2 01 movw r26, r4 33e34: 11 96 adiw r26, 0x01 ; 1 33e36: 2d 91 ld r18, X+ 33e38: 3d 91 ld r19, X+ 33e3a: 4d 91 ld r20, X+ 33e3c: 5c 91 ld r21, X 33e3e: 14 97 sbiw r26, 0x04 ; 4 33e40: 6e 96 adiw r28, 0x1e ; 30 33e42: 6c ad ldd r22, Y+60 ; 0x3c 33e44: 7d ad ldd r23, Y+61 ; 0x3d 33e46: 8e ad ldd r24, Y+62 ; 0x3e 33e48: 9f ad ldd r25, Y+63 ; 0x3f 33e4a: 6e 97 sbiw r28, 0x1e ; 30 33e4c: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 33e50: 4b 01 movw r8, r22 33e52: 5c 01 movw r10, r24 (-s2 * measured_pts[2 * i + 1])); float b = (c == 1) ? 1.f : 33e54: 60 e0 ldi r22, 0x00 ; 0 33e56: 70 e0 ldi r23, 0x00 ; 0 33e58: 80 e8 ldi r24, 0x80 ; 128 33e5a: 9f e3 ldi r25, 0x3F ; 63 33e5c: 11 30 cpi r17, 0x01 ; 1 33e5e: 91 f0 breq .+36 ; 0x33e84 ((c == 2) ? ( c1 * measured_pts[2 * i]) : 33e60: 12 30 cpi r17, 0x02 ; 2 33e62: 09 f0 breq .+2 ; 0x33e66 33e64: 3b cf rjmp .-394 ; 0x33cdc 33e66: d2 01 movw r26, r4 33e68: 11 96 adiw r26, 0x01 ; 1 33e6a: 2d 91 ld r18, X+ 33e6c: 3d 91 ld r19, X+ 33e6e: 4d 91 ld r20, X+ 33e70: 5c 91 ld r21, X 33e72: 14 97 sbiw r26, 0x04 ; 4 33e74: 6e 96 adiw r28, 0x1e ; 30 33e76: 6c ad ldd r22, Y+60 ; 0x3c 33e78: 7d ad ldd r23, Y+61 ; 0x3d 33e7a: 8e ad ldd r24, Y+62 ; 0x3e 33e7c: 9f ad ldd r25, Y+63 ; 0x3f 33e7e: 6e 97 sbiw r28, 0x1e ; 30 33e80: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> (-s2 * measured_pts[2 * i + 1])); float w = point_weight_y(i, measured_pts[2 * i + 1]); acc += a * b * w; 33e84: 9b 01 movw r18, r22 33e86: ac 01 movw r20, r24 33e88: c5 01 movw r24, r10 33e8a: b4 01 movw r22, r8 33e8c: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 33e90: 9b 01 movw r18, r22 33e92: ac 01 movw r20, r24 33e94: c7 01 movw r24, r14 33e96: b6 01 movw r22, r12 33e98: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 33e9c: 6b 01 movw r12, r22 33e9e: 7c 01 movw r14, r24 33ea0: 0d 94 a0 95 jmp 0x32b40 ; 0x32b40 // 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 : 33ea4: 81 2c mov r8, r1 33ea6: 91 2c mov r9, r1 33ea8: 50 e8 ldi r21, 0x80 ; 128 33eaa: a5 2e mov r10, r21 33eac: 5f e3 ldi r21, 0x3F ; 63 33eae: b5 2e mov r11, r21 ((r == 2) ? (-s1 * measured_pts[2 * i]) : (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : 33eb0: 11 11 cpse r17, r1 33eb2: 0d 94 7a 95 jmp 0x32af4 ; 0x32af4 ((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; 33eb6: 20 e0 ldi r18, 0x00 ; 0 33eb8: 30 e0 ldi r19, 0x00 ; 0 33eba: 40 e8 ldi r20, 0x80 ; 128 33ebc: 5f e3 ldi r21, 0x3F ; 63 33ebe: ea cf rjmp .-44 ; 0x33e94 // 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 : 33ec0: 81 2c mov r8, r1 33ec2: 91 2c mov r9, r1 33ec4: 40 e8 ldi r20, 0x80 ; 128 33ec6: a4 2e mov r10, r20 33ec8: 4f e3 ldi r20, 0x3F ; 63 33eca: 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) { 33ecc: 11 11 cpse r17, r1 33ece: c2 cf rjmp .-124 ; 0x33e54 33ed0: 0d 94 a0 95 jmp 0x32b40 ; 0x32b40 33ed4: 11 11 cpse r17, r1 33ed6: aa cf rjmp .-172 ; 0x33e2c 33ed8: 0d 94 a0 95 jmp 0x32b40 ; 0x32b40 00033edc : manage_heater(); manage_inactivity(true); return _stepresult; } static void lcd_selftest_error(TestError testError, const char *_error_1, const char *_error_2) 33edc: 1f 93 push r17 33ede: cf 93 push r28 33ee0: df 93 push r29 33ee2: 18 2f mov r17, r24 33ee4: eb 01 movw r28, r22 33ee6: 80 e0 ldi r24, 0x00 ; 0 33ee8: 0f 94 07 4e call 0x29c0e ; 0x29c0e { lcd_beeper_quick_feedback(); FORCE_BL_ON_END; 33eec: 80 e0 ldi r24, 0x00 ; 0 33eee: 0e 94 49 8a call 0x11492 ; 0x11492 target_temperature[0] = 0; 33ef2: 10 92 b7 0d sts 0x0DB7, r1 ; 0x800db7 33ef6: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 target_temperature_bed = 0; 33efa: 10 92 73 06 sts 0x0673, r1 ; 0x800673 33efe: 10 92 72 06 sts 0x0672, r1 ; 0x800672 manage_heater(); 33f02: 0f 94 5c 38 call 0x270b8 ; 0x270b8 manage_inactivity(); 33f06: 80 e0 ldi r24, 0x00 ; 0 33f08: 0e 94 af 8a call 0x1155e ; 0x1155e lcd_clear(); 33f0c: 0e 94 13 6f call 0xde26 ; 0xde26 lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_ERROR)); 33f10: 80 eb ldi r24, 0xB0 ; 176 33f12: 97 e5 ldi r25, 0x57 ; 87 33f14: 0e 94 ac 72 call 0xe558 ; 0xe558 33f18: ac 01 movw r20, r24 33f1a: 60 e0 ldi r22, 0x00 ; 0 33f1c: 80 e0 ldi r24, 0x00 ; 0 33f1e: 0e 94 f4 6e call 0xdde8 ; 0xdde8 lcd_puts_at_P(0, 1, _T(MSG_SELFTEST_PLEASECHECK)); 33f22: 80 ea ldi r24, 0xA0 ; 160 33f24: 97 e5 ldi r25, 0x57 ; 87 33f26: 0e 94 ac 72 call 0xe558 ; 0xe558 33f2a: ac 01 movw r20, r24 33f2c: 61 e0 ldi r22, 0x01 ; 1 33f2e: 80 e0 ldi r24, 0x00 ; 0 33f30: 0e 94 f4 6e call 0xdde8 ; 0xdde8 switch (testError) 33f34: 11 50 subi r17, 0x01 ; 1 33f36: 1a 30 cpi r17, 0x0A ; 10 33f38: 90 f4 brcc .+36 ; 0x33f5e 33f3a: e1 2f mov r30, r17 33f3c: f0 e0 ldi r31, 0x00 ; 0 33f3e: 88 27 eor r24, r24 33f40: eb 55 subi r30, 0x5B ; 91 33f42: f0 46 sbci r31, 0x60 ; 96 33f44: 8e 4f sbci r24, 0xFE ; 254 33f46: 0d 94 2c dd jmp 0x3ba58 ; 0x3ba58 <__tablejump2__> 33f4a: 74 3a cpi r23, 0xA4 ; 164 33f4c: 44 3a cpi r20, 0xA4 ; 164 33f4e: 58 3a cpi r21, 0xA8 ; 168 33f50: d8 3a cpi r29, 0xA8 ; 168 33f52: 3c 3a cpi r19, 0xAC ; 172 33f54: 6c 39 cpi r22, 0x9C ; 156 33f56: 34 39 cpi r19, 0x94 ; 148 33f58: 84 3a cpi r24, 0xA4 ; 164 33f5a: ba 39 cpi r27, 0x9A ; 154 33f5c: b8 39 cpi r27, 0x98 ; 152 { case TestError::Heater: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_HEATERTHERMISTOR)); 33f5e: 8c e8 ldi r24, 0x8C ; 140 33f60: 97 e5 ldi r25, 0x57 ; 87 33f62: 0e 94 ac 72 call 0xe558 ; 0xe558 33f66: ac 01 movw r20, r24 33f68: 62 e0 ldi r22, 0x02 ; 2 33f6a: 80 e0 ldi r24, 0x00 ; 0 33f6c: 0e 94 f4 6e call 0xdde8 ; 0xdde8 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_NOTCONNECTED)); 33f70: 8c e7 ldi r24, 0x7C ; 124 33f72: 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)); 33f74: 0e 94 ac 72 call 0xe558 ; 0xe558 33f78: ac 01 movw r20, r24 33f7a: 63 e0 ldi r22, 0x03 ; 3 33f7c: 80 e0 ldi r24, 0x00 ; 0 33f7e: 0e 94 f4 6e call 0xdde8 ; 0xdde8 33f82: 45 c0 rjmp .+138 ; 0x3400e 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)); 33f84: 8f e6 ldi r24, 0x6F ; 111 33f86: 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)); 33f88: 0e 94 ac 72 call 0xe558 ; 0xe558 33f8c: ac 01 movw r20, r24 33f8e: 62 e0 ldi r22, 0x02 ; 2 33f90: 80 e0 ldi r24, 0x00 ; 0 33f92: 0e 94 f4 6e call 0xdde8 ; 0xdde8 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR)); 33f96: 80 e6 ldi r24, 0x60 ; 96 33f98: 97 e5 ldi r25, 0x57 ; 87 33f9a: ec cf rjmp .-40 ; 0x33f74 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)); 33f9c: 85 e5 ldi r24, 0x55 ; 85 33f9e: 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)); 33fa0: 0e 94 ac 72 call 0xe558 ; 0xe558 33fa4: ac 01 movw r20, r24 33fa6: 62 e0 ldi r22, 0x02 ; 2 33fa8: 80 e0 ldi r24, 0x00 ; 0 33faa: 0e 94 f4 6e call 0xdde8 ; 0xdde8 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR)); 33fae: 80 e6 ldi r24, 0x60 ; 96 33fb0: 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)); 33fb2: 0e 94 ac 72 call 0xe558 ; 0xe558 33fb6: ac 01 movw r20, r24 33fb8: 63 e0 ldi r22, 0x03 ; 3 33fba: 80 e0 ldi r24, 0x00 ; 0 33fbc: 0e 94 f4 6e call 0xdde8 ; 0xdde8 lcd_set_cursor(18, 3); 33fc0: 63 e0 ldi r22, 0x03 ; 3 33fc2: 82 e1 ldi r24, 0x12 ; 18 33fc4: 0e 94 e0 6e call 0xddc0 ; 0xddc0 lcd_print(_error_1); 33fc8: ce 01 movw r24, r28 33fca: 1f c0 rjmp .+62 ; 0x3400a 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)); 33fcc: 8d e4 ldi r24, 0x4D ; 77 33fce: 97 e5 ldi r25, 0x57 ; 87 33fd0: 0e 94 ac 72 call 0xe558 ; 0xe558 33fd4: ac 01 movw r20, r24 33fd6: 62 e0 ldi r22, 0x02 ; 2 33fd8: 80 e0 ldi r24, 0x00 ; 0 33fda: 0e 94 f4 6e call 0xdde8 ; 0xdde8 lcd_set_cursor(18, 2); 33fde: 62 e0 ldi r22, 0x02 ; 2 33fe0: 82 e1 ldi r24, 0x12 ; 18 33fe2: 0e 94 e0 6e call 0xddc0 ; 0xddc0 lcd_print(_error_1); 33fe6: ce 01 movw r24, r28 33fe8: 0e 94 e7 70 call 0xe1ce ; 0xe1ce lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_ENDSTOP)); 33fec: 83 e4 ldi r24, 0x43 ; 67 33fee: 97 e5 ldi r25, 0x57 ; 87 33ff0: 0e 94 ac 72 call 0xe558 ; 0xe558 33ff4: ac 01 movw r20, r24 33ff6: 63 e0 ldi r22, 0x03 ; 3 33ff8: 80 e0 ldi r24, 0x00 ; 0 33ffa: 0e 94 f4 6e call 0xdde8 ; 0xdde8 lcd_set_cursor(18, 3); 33ffe: 63 e0 ldi r22, 0x03 ; 3 34000: 82 e1 ldi r24, 0x12 ; 18 34002: 0e 94 e0 6e call 0xddc0 ; 0xddc0 lcd_print(_error_2); 34006: 88 ef ldi r24, 0xF8 ; 248 34008: 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); 3400a: 0e 94 e7 70 call 0xe1ce ; 0xe1ce lcd_set_cursor(0, 3); lcd_printf_P(_T(MSG_SELFTEST_FS_LEVEL),_error_1); break; } _delay(1000); 3400e: 68 ee ldi r22, 0xE8 ; 232 34010: 73 e0 ldi r23, 0x03 ; 3 34012: 80 e0 ldi r24, 0x00 ; 0 34014: 90 e0 ldi r25, 0x00 ; 0 34016: 0f 94 53 27 call 0x24ea6 ; 0x24ea6 3401a: 80 e0 ldi r24, 0x00 ; 0 3401c: 0f 94 07 4e call 0x29c0e ; 0x29c0e lcd_beeper_quick_feedback(); do { _delay(100); 34020: 64 e6 ldi r22, 0x64 ; 100 34022: 70 e0 ldi r23, 0x00 ; 0 34024: 80 e0 ldi r24, 0x00 ; 0 34026: 90 e0 ldi r25, 0x00 ; 0 34028: 0f 94 53 27 call 0x24ea6 ; 0x24ea6 manage_heater(); 3402c: 0f 94 5c 38 call 0x270b8 ; 0x270b8 manage_inactivity(); 34030: 80 e0 ldi r24, 0x00 ; 0 34032: 0e 94 af 8a call 0x1155e ; 0x1155e } while (!lcd_clicked()); 34036: 0e 94 fd 70 call 0xe1fa ; 0xe1fa 3403a: 88 23 and r24, r24 3403c: 89 f3 breq .-30 ; 0x34020 LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); 3403e: 87 ea ldi r24, 0xA7 ; 167 34040: 96 e5 ldi r25, 0x56 ; 86 34042: 0e 94 ac 72 call 0xe558 ; 0xe558 34046: 62 e0 ldi r22, 0x02 ; 2 34048: 0e 94 1d f1 call 0x1e23a ; 0x1e23a lcd_return_to_status(); } 3404c: df 91 pop r29 3404e: cf 91 pop r28 34050: 1f 91 pop r17 manage_heater(); manage_inactivity(); } while (!lcd_clicked()); LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); lcd_return_to_status(); 34052: 0d 94 a6 1e jmp 0x23d4c ; 0x23d4c 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)); 34056: 81 e3 ldi r24, 0x31 ; 49 34058: 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)); 3405a: 0e 94 ac 72 call 0xe558 ; 0xe558 3405e: ac 01 movw r20, r24 34060: 62 e0 ldi r22, 0x02 ; 2 34062: 80 e0 ldi r24, 0x00 ; 0 34064: 0e 94 f4 6e call 0xdde8 ; 0xdde8 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_MOTOR)); 34068: 8d e4 ldi r24, 0x4D ; 77 3406a: 97 e5 ldi r25, 0x57 ; 87 3406c: a2 cf rjmp .-188 ; 0x33fb2 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)); 3406e: 8e e1 ldi r24, 0x1E ; 30 34070: 97 e5 ldi r25, 0x57 ; 87 34072: 96 cf rjmp .-212 ; 0x33fa0 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)); 34074: 8b e0 ldi r24, 0x0B ; 11 34076: 97 e5 ldi r25, 0x57 ; 87 34078: 93 cf rjmp .-218 ; 0x33fa0 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)); 3407a: 8c ef ldi r24, 0xFC ; 252 3407c: 96 e5 ldi r25, 0x56 ; 86 3407e: ed cf rjmp .-38 ; 0x3405a 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)); 34080: 8e ee ldi r24, 0xEE ; 238 34082: 96 e5 ldi r25, 0x56 ; 86 34084: 0e 94 ac 72 call 0xe558 ; 0xe558 34088: ac 01 movw r20, r24 3408a: 62 e0 ldi r22, 0x02 ; 2 3408c: 80 e0 ldi r24, 0x00 ; 0 3408e: 0e 94 f4 6e call 0xdde8 ; 0xdde8 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_AXIS)); 34092: 87 ee ldi r24, 0xE7 ; 231 34094: 96 e5 ldi r25, 0x56 ; 86 34096: 8d cf rjmp .-230 ; 0x33fb2 lcd_set_cursor(18, 3); lcd_print(_error_1); break; case TestError::SwappedFan: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FANS)); 34098: 85 ed ldi r24, 0xD5 ; 213 3409a: 96 e5 ldi r25, 0x56 ; 86 3409c: 0e 94 ac 72 call 0xe558 ; 0xe558 340a0: ac 01 movw r20, r24 340a2: 62 e0 ldi r22, 0x02 ; 2 340a4: 80 e0 ldi r24, 0x00 ; 0 340a6: 0e 94 f4 6e call 0xdde8 ; 0xdde8 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_SWAPPED)); 340aa: 8b ec ldi r24, 0xCB ; 203 340ac: 96 e5 ldi r25, 0x56 ; 86 340ae: 81 cf rjmp .-254 ; 0x33fb2 lcd_set_cursor(18, 3); lcd_print(_error_1); break; case TestError::WiringFsensor: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR)); 340b0: 89 eb ldi r24, 0xB9 ; 185 340b2: 96 e5 ldi r25, 0x56 ; 86 340b4: 69 cf rjmp .-302 ; 0x33f88 000340b6 : 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, 340b6: 1f 93 push r17 340b8: cf 93 push r28 340ba: df 93 push r29 340bc: c8 2f mov r28, r24 340be: d6 2f mov r29, r22 const bool _default) { bool _result = check_opposite; lcd_clear(); 340c0: 0e 94 13 6f call 0xde26 ; 0xde26 lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_FAN)); 340c4: 8c e9 ldi r24, 0x9C ; 156 340c6: 96 e5 ldi r25, 0x56 ; 86 340c8: 0e 94 ac 72 call 0xe558 ; 0xe558 340cc: ac 01 movw r20, r24 340ce: 60 e0 ldi r22, 0x00 ; 0 340d0: 80 e0 ldi r24, 0x00 ; 0 340d2: 0e 94 f4 6e call 0xdde8 ; 0xdde8 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)); 340d6: 8b e0 ldi r24, 0x0B ; 11 340d8: 97 e5 ldi r25, 0x57 ; 87 340da: c1 11 cpse r28, r1 340dc: 02 c0 rjmp .+4 ; 0x340e2 340de: 8e e1 ldi r24, 0x1E ; 30 340e0: 97 e5 ldi r25, 0x57 ; 87 340e2: 0e 94 ac 72 call 0xe558 ; 0xe558 340e6: ac 01 movw r20, r24 340e8: 61 e0 ldi r22, 0x01 ; 1 340ea: 80 e0 ldi r24, 0x00 ; 0 340ec: 0e 94 f4 6e call 0xdde8 ; 0xdde8 lcd_selftest_setfan(255); 340f0: 8f ef ldi r24, 0xFF ; 255 340f2: 0e 94 5a f5 call 0x1eab4 ; 0x1eab4 break; } _delay(500); 340f6: 64 ef ldi r22, 0xF4 ; 244 340f8: 71 e0 ldi r23, 0x01 ; 1 340fa: 80 e0 ldi r24, 0x00 ; 0 340fc: 90 e0 ldi r25, 0x00 ; 0 340fe: 0f 94 53 27 call 0x24ea6 ; 0x24ea6 lcd_puts_at_P(1, 2, _T(MSG_SELFTEST_FAN_YES)); 34102: 81 e9 ldi r24, 0x91 ; 145 34104: 96 e5 ldi r25, 0x56 ; 86 34106: 0e 94 ac 72 call 0xe558 ; 0xe558 3410a: ac 01 movw r20, r24 3410c: 62 e0 ldi r22, 0x02 ; 2 3410e: 81 e0 ldi r24, 0x01 ; 1 34110: 0e 94 f4 6e call 0xdde8 ; 0xdde8 lcd_putc_at(0, 3, '>'); 34114: 4e e3 ldi r20, 0x3E ; 62 34116: 63 e0 ldi r22, 0x03 ; 3 34118: 80 e0 ldi r24, 0x00 ; 0 3411a: 0e 94 00 6f call 0xde00 ; 0xde00 lcd_puts_P(_T(MSG_SELFTEST_FAN_NO)); 3411e: 82 e8 ldi r24, 0x82 ; 130 34120: 96 e5 ldi r25, 0x56 ; 86 34122: 0e 94 ac 72 call 0xe558 ; 0xe558 34126: 0e 94 cb 6e call 0xdd96 ; 0xdd96 lcd_encoder = _default; 3412a: 6d 2f mov r22, r29 3412c: 70 e0 ldi r23, 0x00 ; 0 3412e: 70 93 71 06 sts 0x0671, r23 ; 0x800671 34132: 60 93 70 06 sts 0x0670, r22 ; 0x800670 KEEPALIVE_STATE(PAUSED_FOR_USER); 34136: 84 e0 ldi r24, 0x04 ; 4 34138: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be lcd_consume_click(); 3413c: 0e 94 f8 70 call 0xe1f0 ; 0xe1f0 34140: dc 2f mov r29, r28 do { if (lcd_encoder) { if (lcd_encoder < 0) { _result = !check_opposite; 34142: 11 e0 ldi r17, 0x01 ; 1 34144: 1c 27 eor r17, r28 KEEPALIVE_STATE(PAUSED_FOR_USER); lcd_consume_click(); do { if (lcd_encoder) { 34146: 80 91 70 06 lds r24, 0x0670 ; 0x800670 3414a: 90 91 71 06 lds r25, 0x0671 ; 0x800671 3414e: 00 97 sbiw r24, 0x00 ; 0 34150: 19 f1 breq .+70 ; 0x34198 if (lcd_encoder < 0) { 34152: 97 ff sbrs r25, 7 34154: 0b c0 rjmp .+22 ; 0x3416c _result = !check_opposite; 34156: d1 2f mov r29, r17 lcd_putc_at(0, 2, '>'); 34158: 4e e3 ldi r20, 0x3E ; 62 3415a: 62 e0 ldi r22, 0x02 ; 2 3415c: 80 e0 ldi r24, 0x00 ; 0 3415e: 0e 94 00 6f call 0xde00 ; 0xde00 lcd_putc_at(0, 3, ' '); 34162: 40 e2 ldi r20, 0x20 ; 32 34164: 63 e0 ldi r22, 0x03 ; 3 34166: 80 e0 ldi r24, 0x00 ; 0 34168: 0e 94 00 6f call 0xde00 ; 0xde00 } if (lcd_encoder > 0) { 3416c: 80 91 70 06 lds r24, 0x0670 ; 0x800670 34170: 90 91 71 06 lds r25, 0x0671 ; 0x800671 34174: 18 16 cp r1, r24 34176: 19 06 cpc r1, r25 34178: 5c f4 brge .+22 ; 0x34190 _result = check_opposite; lcd_putc_at(0, 2, ' '); 3417a: 40 e2 ldi r20, 0x20 ; 32 3417c: 62 e0 ldi r22, 0x02 ; 2 3417e: 80 e0 ldi r24, 0x00 ; 0 34180: 0e 94 00 6f call 0xde00 ; 0xde00 lcd_putc_at(0, 3, '>'); 34184: 4e e3 ldi r20, 0x3E ; 62 34186: 63 e0 ldi r22, 0x03 ; 3 34188: 80 e0 ldi r24, 0x00 ; 0 3418a: 0e 94 00 6f call 0xde00 ; 0xde00 3418e: dc 2f mov r29, r28 } lcd_encoder = 0; 34190: 10 92 71 06 sts 0x0671, r1 ; 0x800671 34194: 10 92 70 06 sts 0x0670, r1 ; 0x800670 } manage_heater(); 34198: 0f 94 5c 38 call 0x270b8 ; 0x270b8 manage_inactivity(true); 3419c: 81 e0 ldi r24, 0x01 ; 1 3419e: 0e 94 af 8a call 0x1155e ; 0x1155e _delay(100); 341a2: 64 e6 ldi r22, 0x64 ; 100 341a4: 70 e0 ldi r23, 0x00 ; 0 341a6: 80 e0 ldi r24, 0x00 ; 0 341a8: 90 e0 ldi r25, 0x00 ; 0 341aa: 0f 94 53 27 call 0x24ea6 ; 0x24ea6 } while (!lcd_clicked()); 341ae: 0e 94 fd 70 call 0xe1fa ; 0xe1fa 341b2: 88 23 and r24, r24 341b4: 41 f2 breq .-112 ; 0x34146 KEEPALIVE_STATE(IN_HANDLER); 341b6: 82 e0 ldi r24, 0x02 ; 2 341b8: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be setExtruderAutoFanState(0); // Turn off hotend fan 341bc: 80 e0 ldi r24, 0x00 ; 0 341be: 0e 94 5b 75 call 0xeab6 ; 0xeab6 lcd_selftest_setfan(0); // Turn off print fan 341c2: 80 e0 ldi r24, 0x00 ; 0 341c4: 0e 94 5a f5 call 0x1eab4 ; 0x1eab4 return _result; } 341c8: 8d 2f mov r24, r29 341ca: df 91 pop r29 341cc: cf 91 pop r28 341ce: 1f 91 pop r17 341d0: 08 95 ret 000341d2 : #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) { 341d2: cf 93 push r28 341d4: df 93 push r29 341d6: c8 2f mov r28, r24 341d8: d6 2f mov r29, r22 // spin-up delay static char symbols[] = {'-', '|'}; static_assert(1000 / sizeof(symbols) * sizeof(symbols) == 1000); while(delay--) { 341da: c1 50 subi r28, 0x01 ; 1 341dc: 98 f0 brcs .+38 ; 0x34204 for(uint8_t i = 0; i != sizeof(symbols); ++i) { lcd_putc_at(col, row, symbols[i]); 341de: 4d e2 ldi r20, 0x2D ; 45 341e0: 6d 2f mov r22, r29 341e2: 82 e1 ldi r24, 0x12 ; 18 341e4: 0e 94 00 6f call 0xde00 ; 0xde00 delay_keep_alive(1000 / sizeof(symbols)); 341e8: 84 ef ldi r24, 0xF4 ; 244 341ea: 91 e0 ldi r25, 0x01 ; 1 341ec: 0e 94 e4 8c call 0x119c8 ; 0x119c8 // 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]); 341f0: 4c e7 ldi r20, 0x7C ; 124 341f2: 6d 2f mov r22, r29 341f4: 82 e1 ldi r24, 0x12 ; 18 341f6: 0e 94 00 6f call 0xde00 ; 0xde00 delay_keep_alive(1000 / sizeof(symbols)); 341fa: 84 ef ldi r24, 0xF4 ; 244 341fc: 91 e0 ldi r25, 0x01 ; 1 341fe: 0e 94 e4 8c call 0x119c8 ; 0x119c8 34202: eb cf rjmp .-42 ; 0x341da } } #ifdef FANCHECK extruder_autofan_last_check = _millis(); 34204: 0f 94 4c 29 call 0x25298 ; 0x25298 34208: 60 93 c0 17 sts 0x17C0, r22 ; 0x8017c0 3420c: 70 93 c1 17 sts 0x17C1, r23 ; 0x8017c1 34210: 80 93 c2 17 sts 0x17C2, r24 ; 0x8017c2 34214: 90 93 c3 17 sts 0x17C3, r25 ; 0x8017c3 #endif fan_measuring = true; 34218: 81 e0 ldi r24, 0x01 ; 1 3421a: 80 93 6f 06 sts 0x066F, r24 ; 0x80066f while(fan_measuring) { 3421e: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 34222: 88 23 and r24, r24 34224: 29 f0 breq .+10 ; 0x34230 delay_keep_alive(100); 34226: 84 e6 ldi r24, 0x64 ; 100 34228: 90 e0 ldi r25, 0x00 ; 0 3422a: 0e 94 e4 8c call 0x119c8 ; 0x119c8 3422e: f7 cf rjmp .-18 ; 0x3421e } gcode_M123(); } 34230: df 91 pop r29 34232: cf 91 pop r28 fan_measuring = true; while(fan_measuring) { delay_keep_alive(100); } gcode_M123(); 34234: 0c 94 84 66 jmp 0xcd08 ; 0xcd08 00034238 : } #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) { 34238: 4f 92 push r4 3423a: 5f 92 push r5 3423c: 6f 92 push r6 3423e: 7f 92 push r7 34240: af 92 push r10 34242: bf 92 push r11 34244: cf 92 push r12 34246: df 92 push r13 34248: ef 92 push r14 3424a: ff 92 push r15 3424c: 0f 93 push r16 3424e: 1f 93 push r17 34250: cf 93 push r28 34252: df 93 push r29 34254: 24 e0 ldi r18, 0x04 ; 4 34256: 30 e0 ldi r19, 0x00 ; 0 34258: 41 e0 ldi r20, 0x01 ; 1 3425a: 50 e0 ldi r21, 0x00 ; 0 3425c: d9 01 movw r26, r18 3425e: a2 53 subi r26, 0x32 ; 50 34260: bc 45 sbci r27, 0x5C ; 92 uint8_t i; short (*tt)[][2] = (short (*)[][2])(heater_ttbl_map[e]); for (i=1; i raw) 34262: fd 01 movw r30, r26 34264: 65 91 lpm r22, Z+ 34266: 74 91 lpm r23, Z 34268: 86 17 cp r24, r22 3426a: 97 07 cpc r25, r23 3426c: 0c f0 brlt .+2 ; 0x34270 3426e: 66 c0 rjmp .+204 ; 0x3433c { celsius = PGM_RD_W((*tt)[i-1][1]) + 34270: 41 50 subi r20, 0x01 ; 1 34272: 51 09 sbc r21, r1 34274: 44 0f add r20, r20 34276: 55 1f adc r21, r21 34278: 44 0f add r20, r20 3427a: 55 1f adc r21, r21 3427c: ea 01 movw r28, r20 3427e: c0 53 subi r28, 0x30 ; 48 34280: dc 45 sbci r29, 0x5C ; 92 34282: fe 01 movw r30, r28 34284: 05 91 lpm r16, Z+ 34286: 14 91 lpm r17, Z (raw - PGM_RD_W((*tt)[i-1][0])) * 34288: 42 53 subi r20, 0x32 ; 50 3428a: 5c 45 sbci r21, 0x5C ; 92 3428c: fa 01 movw r30, r20 3428e: 65 91 lpm r22, Z+ 34290: 74 91 lpm r23, Z (float)(PGM_RD_W((*tt)[i][1]) - PGM_RD_W((*tt)[i-1][1])) / 34292: f9 01 movw r30, r18 34294: e0 53 subi r30, 0x30 ; 48 34296: fc 45 sbci r31, 0x5C ; 92 34298: e5 90 lpm r14, Z+ 3429a: f4 90 lpm r15, Z 3429c: fe 01 movw r30, r28 3429e: c5 90 lpm r12, Z+ 342a0: d4 90 lpm r13, Z (float)(PGM_RD_W((*tt)[i][0]) - PGM_RD_W((*tt)[i-1][0])); 342a2: fd 01 movw r30, r26 342a4: c5 91 lpm r28, Z+ 342a6: d4 91 lpm r29, Z 342a8: fa 01 movw r30, r20 342aa: a5 90 lpm r10, Z+ 342ac: 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])) * 342ae: 86 1b sub r24, r22 342b0: 97 0b sbc r25, r23 342b2: bc 01 movw r22, r24 342b4: 99 0f add r25, r25 342b6: 88 0b sbc r24, r24 342b8: 99 0b sbc r25, r25 342ba: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 342be: 2b 01 movw r4, r22 342c0: 3c 01 movw r6, r24 (float)(PGM_RD_W((*tt)[i][1]) - PGM_RD_W((*tt)[i-1][1])) / 342c2: b7 01 movw r22, r14 342c4: 6c 19 sub r22, r12 342c6: 7d 09 sbc r23, r13 342c8: 07 2e mov r0, r23 342ca: 00 0c add r0, r0 342cc: 88 0b sbc r24, r24 342ce: 99 0b sbc r25, r25 342d0: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 342d4: 9b 01 movw r18, r22 342d6: 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])) * 342d8: c3 01 movw r24, r6 342da: b2 01 movw r22, r4 342dc: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 342e0: 6b 01 movw r12, r22 342e2: 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])); 342e4: be 01 movw r22, r28 342e6: 6a 19 sub r22, r10 342e8: 7b 09 sbc r23, r11 342ea: 07 2e mov r0, r23 342ec: 00 0c add r0, r0 342ee: 88 0b sbc r24, r24 342f0: 99 0b sbc r25, r25 342f2: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 342f6: 9b 01 movw r18, r22 342f8: 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])) / 342fa: c7 01 movw r24, r14 342fc: b6 01 movw r22, r12 342fe: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 34302: 6b 01 movw r12, r22 34304: 7c 01 movw r14, r24 for (i=1; i raw) { celsius = PGM_RD_W((*tt)[i-1][1]) + 34306: b8 01 movw r22, r16 34308: 11 0f add r17, r17 3430a: 88 0b sbc r24, r24 3430c: 99 0b sbc r25, r25 3430e: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 34312: 9b 01 movw r18, r22 34314: ac 01 movw r20, r24 34316: c7 01 movw r24, r14 34318: b6 01 movw r22, r12 3431a: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__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; } 3431e: df 91 pop r29 34320: cf 91 pop r28 34322: 1f 91 pop r17 34324: 0f 91 pop r16 34326: ff 90 pop r15 34328: ef 90 pop r14 3432a: df 90 pop r13 3432c: cf 90 pop r12 3432e: bf 90 pop r11 34330: af 90 pop r10 34332: 7f 90 pop r7 34334: 6f 90 pop r6 34336: 5f 90 pop r5 34338: 4f 90 pop r4 3433a: 08 95 ret 3433c: 4f 5f subi r20, 0xFF ; 255 3433e: 5f 4f sbci r21, 0xFF ; 255 34340: 2c 5f subi r18, 0xFC ; 252 34342: 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 3434a: 88 cf rjmp .-240 ; 0x3425c break; } } // Overflow: Set to last value in the table if (i == heater_ttbllen_map[e]) celsius = PGM_RD_W((*tt)[i-1][1]); 3434c: ec e4 ldi r30, 0x4C ; 76 3434e: f4 ea ldi r31, 0xA4 ; 164 34350: 65 91 lpm r22, Z+ 34352: 74 91 lpm r23, Z 34354: 07 2e mov r0, r23 34356: 00 0c add r0, r0 34358: 88 0b sbc r24, r24 3435a: 99 0b sbc r25, r25 3435c: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 34360: de cf rjmp .-68 ; 0x3431e 00034362 : float mesh_bed_leveling::get_z(float x, float y) { 34362: 2f 92 push r2 34364: 3f 92 push r3 34366: 4f 92 push r4 34368: 5f 92 push r5 3436a: 6f 92 push r6 3436c: 7f 92 push r7 3436e: 8f 92 push r8 34370: 9f 92 push r9 34372: af 92 push r10 34374: bf 92 push r11 34376: cf 92 push r12 34378: df 92 push r13 3437a: ef 92 push r14 3437c: ff 92 push r15 3437e: 0f 93 push r16 34380: 1f 93 push r17 34382: cf 93 push r28 34384: df 93 push r29 34386: 00 d0 rcall .+0 ; 0x34388 34388: 00 d0 rcall .+0 ; 0x3438a 3438a: 00 d0 rcall .+0 ; 0x3438c 3438c: 1f 92 push r1 3438e: cd b7 in r28, 0x3d ; 61 34390: de b7 in r29, 0x3e ; 62 34392: 2b 01 movw r4, r22 34394: 3c 01 movw r6, r24 34396: 49 01 movw r8, r18 34398: 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)); 3439a: 20 e0 ldi r18, 0x00 ; 0 3439c: 30 e0 ldi r19, 0x00 ; 0 3439e: 40 ec ldi r20, 0xC0 ; 192 343a0: 51 e4 ldi r21, 0x41 ; 65 343a2: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 343a6: 20 e0 ldi r18, 0x00 ; 0 343a8: 30 e0 ldi r19, 0x00 ; 0 343aa: 48 e0 ldi r20, 0x08 ; 8 343ac: 52 e4 ldi r21, 0x42 ; 66 343ae: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 343b2: 6b 01 movw r12, r22 343b4: 7c 01 movw r14, r24 343b6: 0f 94 eb de call 0x3bdd6 ; 0x3bdd6 343ba: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> if (i < 0) { i = 0; 343be: 31 2c mov r3, r1 343c0: 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) { 343c2: 77 fd sbrc r23, 7 343c4: 1e c0 rjmp .+60 ; 0x34402 343c6: 1b 01 movw r2, r22 343c8: 66 30 cpi r22, 0x06 ; 6 343ca: 71 05 cpc r23, r1 343cc: 1c f0 brlt .+6 ; 0x343d4 343ce: 45 e0 ldi r20, 0x05 ; 5 343d0: 24 2e mov r2, r20 343d2: 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; } 343d4: 82 2d mov r24, r2 343d6: 0f 94 35 ca call 0x3946a ; 0x3946a 343da: 20 e0 ldi r18, 0x00 ; 0 343dc: 30 e0 ldi r19, 0x00 ; 0 343de: 48 eb ldi r20, 0xB8 ; 184 343e0: 51 e4 ldi r21, 0x41 ; 65 343e2: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 343e6: 9b 01 movw r18, r22 343e8: 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; 343ea: c3 01 movw r24, r6 343ec: b2 01 movw r22, r4 343ee: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 343f2: 20 e0 ldi r18, 0x00 ; 0 343f4: 30 e0 ldi r19, 0x00 ; 0 343f6: 48 e0 ldi r20, 0x08 ; 8 343f8: 52 e4 ldi r21, 0x42 ; 66 343fa: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 343fe: 6b 01 movw r12, r22 34400: 7c 01 movw r14, r24 } j = int(floor((y - (BED_Y0 + Y_PROBE_OFFSET_FROM_EXTRUDER)) / y_mesh_density)); 34402: 20 e0 ldi r18, 0x00 ; 0 34404: 30 e0 ldi r19, 0x00 ; 0 34406: 40 ec ldi r20, 0xC0 ; 192 34408: 50 e4 ldi r21, 0x40 ; 64 3440a: c5 01 movw r24, r10 3440c: b4 01 movw r22, r8 3440e: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 34412: 20 e0 ldi r18, 0x00 ; 0 34414: 30 e0 ldi r19, 0x00 ; 0 34416: 48 e0 ldi r20, 0x08 ; 8 34418: 52 e4 ldi r21, 0x42 ; 66 3441a: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 3441e: 69 83 std Y+1, r22 ; 0x01 34420: 7a 83 std Y+2, r23 ; 0x02 34422: 8b 83 std Y+3, r24 ; 0x03 34424: 9c 83 std Y+4, r25 ; 0x04 34426: 0f 94 eb de call 0x3bdd6 ; 0x3bdd6 3442a: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> if (j < 0) { 3442e: 77 fd sbrc r23, 7 34430: da c0 rjmp .+436 ; 0x345e6 34432: 7a 87 std Y+10, r23 ; 0x0a 34434: 69 87 std Y+9, r22 ; 0x09 34436: 66 30 cpi r22, 0x06 ; 6 34438: 71 05 cpc r23, r1 3443a: 24 f0 brlt .+8 ; 0x34444 3443c: e5 e0 ldi r30, 0x05 ; 5 3443e: f0 e0 ldi r31, 0x00 ; 0 34440: fa 87 std Y+10, r31 ; 0x0a 34442: e9 87 std Y+9, r30 ; 0x09 static float get_y(int i) { return BED_Y(i) + Y_PROBE_OFFSET_FROM_EXTRUDER; } 34444: 89 85 ldd r24, Y+9 ; 0x09 34446: 0f 94 35 ca call 0x3946a ; 0x3946a 3444a: 20 e0 ldi r18, 0x00 ; 0 3444c: 30 e0 ldi r19, 0x00 ; 0 3444e: 40 ea ldi r20, 0xA0 ; 160 34450: 50 e4 ldi r21, 0x40 ; 64 34452: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 34456: 9b 01 movw r18, r22 34458: 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; 3445a: c5 01 movw r24, r10 3445c: b4 01 movw r22, r8 3445e: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 34462: 20 e0 ldi r18, 0x00 ; 0 34464: 30 e0 ldi r19, 0x00 ; 0 34466: 48 e0 ldi r20, 0x08 ; 8 34468: 52 e4 ldi r21, 0x42 ; 66 3446a: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 3446e: 69 83 std Y+1, r22 ; 0x01 34470: 7a 83 std Y+2, r23 ; 0x02 34472: 8b 83 std Y+3, r24 ; 0x03 34474: 9c 83 std Y+4, r25 ; 0x04 } float si = 1.f-s; 34476: a7 01 movw r20, r14 34478: 96 01 movw r18, r12 3447a: 60 e0 ldi r22, 0x00 ; 0 3447c: 70 e0 ldi r23, 0x00 ; 0 3447e: 80 e8 ldi r24, 0x80 ; 128 34480: 9f e3 ldi r25, 0x3F ; 63 34482: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 34486: 2b 01 movw r4, r22 34488: 3c 01 movw r6, r24 float z0 = si * z_values[j ][i] + s * z_values[j ][i+1]; 3448a: 91 01 movw r18, r2 3448c: 2f 5f subi r18, 0xFF ; 255 3448e: 3f 4f sbci r19, 0xFF ; 255 34490: 3e 83 std Y+6, r19 ; 0x06 34492: 2d 83 std Y+5, r18 ; 0x05 float z1 = si * z_values[j+1][i] + s * z_values[j+1][i+1]; 34494: 89 85 ldd r24, Y+9 ; 0x09 34496: 9a 85 ldd r25, Y+10 ; 0x0a 34498: 01 96 adiw r24, 0x01 ; 1 3449a: 98 87 std Y+8, r25 ; 0x08 3449c: 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]; 3449e: 27 e0 ldi r18, 0x07 ; 7 344a0: e9 85 ldd r30, Y+9 ; 0x09 344a2: fa 85 ldd r31, Y+10 ; 0x0a 344a4: 2e 9f mul r18, r30 344a6: 80 01 movw r16, r0 344a8: 2f 9f mul r18, r31 344aa: 10 0d add r17, r0 344ac: 11 24 eor r1, r1 344ae: f8 01 movw r30, r16 344b0: e2 0d add r30, r2 344b2: f3 1d adc r31, r3 344b4: ee 0f add r30, r30 344b6: ff 1f adc r31, r31 344b8: ee 0f add r30, r30 344ba: ff 1f adc r31, r31 344bc: ee 53 subi r30, 0x3E ; 62 344be: fc 4e sbci r31, 0xEC ; 236 344c0: 21 81 ldd r18, Z+1 ; 0x01 344c2: 32 81 ldd r19, Z+2 ; 0x02 344c4: 43 81 ldd r20, Z+3 ; 0x03 344c6: 54 81 ldd r21, Z+4 ; 0x04 344c8: c3 01 movw r24, r6 344ca: b2 01 movw r22, r4 344cc: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 344d0: 4b 01 movw r8, r22 344d2: 5c 01 movw r10, r24 344d4: ed 81 ldd r30, Y+5 ; 0x05 344d6: fe 81 ldd r31, Y+6 ; 0x06 344d8: e0 0f add r30, r16 344da: f1 1f adc r31, r17 344dc: ee 0f add r30, r30 344de: ff 1f adc r31, r31 344e0: ee 0f add r30, r30 344e2: ff 1f adc r31, r31 344e4: ee 53 subi r30, 0x3E ; 62 344e6: fc 4e sbci r31, 0xEC ; 236 344e8: 21 81 ldd r18, Z+1 ; 0x01 344ea: 32 81 ldd r19, Z+2 ; 0x02 344ec: 43 81 ldd r20, Z+3 ; 0x03 344ee: 54 81 ldd r21, Z+4 ; 0x04 344f0: c7 01 movw r24, r14 344f2: b6 01 movw r22, r12 344f4: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 344f8: 9b 01 movw r18, r22 344fa: ac 01 movw r20, r24 344fc: c5 01 movw r24, r10 344fe: b4 01 movw r22, r8 34500: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 34504: 4b 01 movw r8, r22 34506: 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; 34508: 29 81 ldd r18, Y+1 ; 0x01 3450a: 3a 81 ldd r19, Y+2 ; 0x02 3450c: 4b 81 ldd r20, Y+3 ; 0x03 3450e: 5c 81 ldd r21, Y+4 ; 0x04 34510: 60 e0 ldi r22, 0x00 ; 0 34512: 70 e0 ldi r23, 0x00 ; 0 34514: 80 e8 ldi r24, 0x80 ; 128 34516: 9f e3 ldi r25, 0x3F ; 63 34518: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 3451c: 9b 01 movw r18, r22 3451e: ac 01 movw r20, r24 34520: c5 01 movw r24, r10 34522: b4 01 movw r22, r8 34524: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 34528: 4b 01 movw r8, r22 3452a: 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]; 3452c: 27 e0 ldi r18, 0x07 ; 7 3452e: ef 81 ldd r30, Y+7 ; 0x07 34530: f8 85 ldd r31, Y+8 ; 0x08 34532: 2e 9f mul r18, r30 34534: c0 01 movw r24, r0 34536: 2f 9f mul r18, r31 34538: 90 0d add r25, r0 3453a: 11 24 eor r1, r1 3453c: 9a 87 std Y+10, r25 ; 0x0a 3453e: 89 87 std Y+9, r24 ; 0x09 34540: fc 01 movw r30, r24 34542: e2 0d add r30, r2 34544: f3 1d adc r31, r3 34546: ee 0f add r30, r30 34548: ff 1f adc r31, r31 3454a: ee 0f add r30, r30 3454c: ff 1f adc r31, r31 3454e: ee 53 subi r30, 0x3E ; 62 34550: fc 4e sbci r31, 0xEC ; 236 34552: 21 81 ldd r18, Z+1 ; 0x01 34554: 32 81 ldd r19, Z+2 ; 0x02 34556: 43 81 ldd r20, Z+3 ; 0x03 34558: 54 81 ldd r21, Z+4 ; 0x04 3455a: c3 01 movw r24, r6 3455c: b2 01 movw r22, r4 3455e: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 34562: 2b 01 movw r4, r22 34564: 3c 01 movw r6, r24 34566: 89 85 ldd r24, Y+9 ; 0x09 34568: 9a 85 ldd r25, Y+10 ; 0x0a 3456a: ed 81 ldd r30, Y+5 ; 0x05 3456c: fe 81 ldd r31, Y+6 ; 0x06 3456e: 8e 0f add r24, r30 34570: 9f 1f adc r25, r31 34572: 88 0f add r24, r24 34574: 99 1f adc r25, r25 34576: 88 0f add r24, r24 34578: 99 1f adc r25, r25 3457a: 8e 53 subi r24, 0x3E ; 62 3457c: 9c 4e sbci r25, 0xEC ; 236 3457e: fc 01 movw r30, r24 34580: 21 81 ldd r18, Z+1 ; 0x01 34582: 32 81 ldd r19, Z+2 ; 0x02 34584: 43 81 ldd r20, Z+3 ; 0x03 34586: 54 81 ldd r21, Z+4 ; 0x04 34588: c7 01 movw r24, r14 3458a: b6 01 movw r22, r12 3458c: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 34590: 9b 01 movw r18, r22 34592: ac 01 movw r20, r24 34594: c3 01 movw r24, r6 34596: b2 01 movw r22, r4 34598: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> return (1.f-t) * z0 + t * z1; 3459c: 29 81 ldd r18, Y+1 ; 0x01 3459e: 3a 81 ldd r19, Y+2 ; 0x02 345a0: 4b 81 ldd r20, Y+3 ; 0x03 345a2: 5c 81 ldd r21, Y+4 ; 0x04 345a4: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 345a8: 9b 01 movw r18, r22 345aa: ac 01 movw r20, r24 345ac: c5 01 movw r24, r10 345ae: b4 01 movw r22, r8 345b0: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> } 345b4: 2a 96 adiw r28, 0x0a ; 10 345b6: 0f b6 in r0, 0x3f ; 63 345b8: f8 94 cli 345ba: de bf out 0x3e, r29 ; 62 345bc: 0f be out 0x3f, r0 ; 63 345be: cd bf out 0x3d, r28 ; 61 345c0: df 91 pop r29 345c2: cf 91 pop r28 345c4: 1f 91 pop r17 345c6: 0f 91 pop r16 345c8: ff 90 pop r15 345ca: ef 90 pop r14 345cc: df 90 pop r13 345ce: cf 90 pop r12 345d0: bf 90 pop r11 345d2: af 90 pop r10 345d4: 9f 90 pop r9 345d6: 8f 90 pop r8 345d8: 7f 90 pop r7 345da: 6f 90 pop r6 345dc: 5f 90 pop r5 345de: 4f 90 pop r4 345e0: 3f 90 pop r3 345e2: 2f 90 pop r2 345e4: 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; 345e6: 1a 86 std Y+10, r1 ; 0x0a 345e8: 19 86 std Y+9, r1 ; 0x09 345ea: 45 cf rjmp .-374 ; 0x34476 000345ec : 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() 345ec: 2f 92 push r2 345ee: 3f 92 push r3 345f0: 4f 92 push r4 345f2: 5f 92 push r5 345f4: 6f 92 push r6 345f6: 7f 92 push r7 345f8: 8f 92 push r8 345fa: 9f 92 push r9 345fc: af 92 push r10 345fe: bf 92 push r11 34600: cf 92 push r12 34602: df 92 push r13 34604: ef 92 push r14 34606: ff 92 push r15 34608: 0f 93 push r16 3460a: 1f 93 push r17 3460c: cf 93 push r28 3460e: df 93 push r29 34610: 00 d0 rcall .+0 ; 0x34612 34612: 00 d0 rcall .+0 ; 0x34614 34614: 00 d0 rcall .+0 ; 0x34616 34616: cd b7 in r28, 0x3d ; 61 34618: de b7 in r29, 0x3e ; 62 3461a: 02 ec ldi r16, 0xC2 ; 194 3461c: 13 e1 ldi r17, 0x13 ; 19 3461e: 1f 83 std Y+7, r17 ; 0x07 34620: 0e 83 std Y+6, r16 ; 0x06 34622: 2e 80 ldd r2, Y+6 ; 0x06 34624: 3f 80 ldd r3, Y+7 ; 0x07 34626: 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])) 34628: f1 01 movw r30, r2 3462a: 61 81 ldd r22, Z+1 ; 0x01 3462c: 72 81 ldd r23, Z+2 ; 0x02 3462e: 83 81 ldd r24, Z+3 ; 0x03 34630: 94 81 ldd r25, Z+4 ; 0x04 34632: 9b 01 movw r18, r22 34634: ac 01 movw r20, r24 34636: 0f 94 52 e1 call 0x3c2a4 ; 0x3c2a4 <__unordsf2> 3463a: 88 23 and r24, r24 3463c: 09 f4 brne .+2 ; 0x34640 3463e: 7c c0 rjmp .+248 ; 0x34738 mesh_bed_leveling() { reset(); } void reset(); static float get_x(int i) { return BED_X(i) + X_PROBE_OFFSET_FROM_EXTRUDER; } 34640: 89 81 ldd r24, Y+1 ; 0x01 34642: 0f 94 35 ca call 0x3946a ; 0x3946a 34646: 20 e0 ldi r18, 0x00 ; 0 34648: 30 e0 ldi r19, 0x00 ; 0 3464a: 48 eb ldi r20, 0xB8 ; 184 3464c: 51 e4 ldi r21, 0x41 ; 65 3464e: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 34652: 6b 01 movw r12, r22 34654: 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)) + 34656: 20 e0 ldi r18, 0x00 ; 0 34658: 30 e0 ldi r19, 0x00 ; 0 3465a: 4c ef ldi r20, 0xFC ; 252 3465c: 52 e4 ldi r21, 0x42 ; 66 3465e: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 34662: 2b 01 movw r4, r22 34664: 3c 01 movw r6, r24 34666: 20 e0 ldi r18, 0x00 ; 0 34668: 30 e0 ldi r19, 0x00 ; 0 3466a: 44 e6 ldi r20, 0x64 ; 100 3466c: 53 e4 ldi r21, 0x43 ; 67 3466e: c7 01 movw r24, r14 34670: b6 01 movw r22, r12 34672: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 34676: 4b 01 movw r8, r22 34678: 5c 01 movw r10, r24 z_values[j][idx1] * (x - x0) * (x - x2) / ((x1 - x0) * (x1 - x2)) + 3467a: 20 e0 ldi r18, 0x00 ; 0 3467c: 30 e0 ldi r19, 0x00 ; 0 3467e: 40 ec ldi r20, 0xC0 ; 192 34680: 51 e4 ldi r21, 0x41 ; 65 34682: c7 01 movw r24, r14 34684: b6 01 movw r22, r12 34686: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 3468a: 6b 01 movw r12, r22 3468c: 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)) + 3468e: ee 81 ldd r30, Y+6 ; 0x06 34690: ff 81 ldd r31, Y+7 ; 0x07 34692: 21 81 ldd r18, Z+1 ; 0x01 34694: 32 81 ldd r19, Z+2 ; 0x02 34696: 43 81 ldd r20, Z+3 ; 0x03 34698: 54 81 ldd r21, Z+4 ; 0x04 3469a: c3 01 movw r24, r6 3469c: b2 01 movw r22, r4 3469e: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 346a2: a5 01 movw r20, r10 346a4: 94 01 movw r18, r8 346a6: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 346aa: 20 e0 ldi r18, 0x00 ; 0 346ac: 30 e9 ldi r19, 0x90 ; 144 346ae: 42 ea ldi r20, 0xA2 ; 162 346b0: 56 e4 ldi r21, 0x46 ; 70 346b2: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 346b6: 6a 83 std Y+2, r22 ; 0x02 346b8: 7b 83 std Y+3, r23 ; 0x03 346ba: 8c 83 std Y+4, r24 ; 0x04 346bc: 9d 83 std Y+5, r25 ; 0x05 z_values[j][idx1] * (x - x0) * (x - x2) / ((x1 - x0) * (x1 - x2)) + 346be: ee 81 ldd r30, Y+6 ; 0x06 346c0: ff 81 ldd r31, Y+7 ; 0x07 346c2: 25 85 ldd r18, Z+13 ; 0x0d 346c4: 36 85 ldd r19, Z+14 ; 0x0e 346c6: 47 85 ldd r20, Z+15 ; 0x0f 346c8: 50 89 ldd r21, Z+16 ; 0x10 346ca: c7 01 movw r24, r14 346cc: b6 01 movw r22, r12 346ce: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 346d2: a5 01 movw r20, r10 346d4: 94 01 movw r18, r8 346d6: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 346da: 20 e0 ldi r18, 0x00 ; 0 346dc: 30 e9 ldi r19, 0x90 ; 144 346de: 42 e2 ldi r20, 0x22 ; 34 346e0: 56 ec ldi r21, 0xC6 ; 198 346e2: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 346e6: 9b 01 movw r18, r22 346e8: 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)) + 346ea: 6a 81 ldd r22, Y+2 ; 0x02 346ec: 7b 81 ldd r23, Y+3 ; 0x03 346ee: 8c 81 ldd r24, Y+4 ; 0x04 346f0: 9d 81 ldd r25, Y+5 ; 0x05 346f2: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 346f6: 4b 01 movw r8, r22 346f8: 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)); 346fa: ee 81 ldd r30, Y+6 ; 0x06 346fc: ff 81 ldd r31, Y+7 ; 0x07 346fe: 21 8d ldd r18, Z+25 ; 0x19 34700: 32 8d ldd r19, Z+26 ; 0x1a 34702: 43 8d ldd r20, Z+27 ; 0x1b 34704: 54 8d ldd r21, Z+28 ; 0x1c 34706: c7 01 movw r24, r14 34708: b6 01 movw r22, r12 3470a: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 3470e: a3 01 movw r20, r6 34710: 92 01 movw r18, r4 34712: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 34716: 20 e0 ldi r18, 0x00 ; 0 34718: 30 e9 ldi r19, 0x90 ; 144 3471a: 42 ea ldi r20, 0xA2 ; 162 3471c: 56 e4 ldi r21, 0x46 ; 70 3471e: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 34722: 9b 01 movw r18, r22 34724: 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)) + 34726: c5 01 movw r24, r10 34728: b4 01 movw r22, r8 3472a: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__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] = 3472e: f1 01 movw r30, r2 34730: 61 83 std Z+1, r22 ; 0x01 34732: 72 83 std Z+2, r23 ; 0x02 34734: 83 83 std Z+3, r24 ; 0x03 34736: 94 83 std Z+4, r25 ; 0x04 34738: f4 e0 ldi r31, 0x04 ; 4 3473a: 2f 0e add r2, r31 3473c: 31 1c adc r3, r1 3473e: 29 81 ldd r18, Y+1 ; 0x01 34740: 2f 5f subi r18, 0xFF ; 255 34742: 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) { 34744: 27 30 cpi r18, 0x07 ; 7 34746: 09 f0 breq .+2 ; 0x3474a 34748: 6f cf rjmp .-290 ; 0x34628 3474a: 8e 81 ldd r24, Y+6 ; 0x06 3474c: 9f 81 ldd r25, Y+7 ; 0x07 3474e: 4c 96 adiw r24, 0x1c ; 28 34750: 9f 83 std Y+7, r25 ; 0x07 34752: 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) { 34754: 86 58 subi r24, 0x86 ; 134 34756: 94 41 sbci r25, 0x14 ; 20 34758: 09 f0 breq .+2 ; 0x3475c 3475a: 63 cf rjmp .-314 ; 0x34622 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() 3475c: 19 87 std Y+9, r17 ; 0x09 3475e: 08 87 std Y+8, r16 ; 0x08 34760: f1 e0 ldi r31, 0x01 ; 1 34762: 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)) + 34764: c8 01 movw r24, r16 34766: 8b 5a subi r24, 0xAB ; 171 34768: 9f 4f sbci r25, 0xFF ; 255 3476a: 9f 83 std Y+7, r25 ; 0x07 3476c: 8e 83 std Y+6, r24 ; 0x06 z_values[idx2][i] * (y - y0) * (y - y1) / ((y2 - y0) * (y2 - y1)); 3476e: 18 01 movw r2, r16 34770: 99 ea ldi r25, 0xA9 ; 169 34772: 29 0e add r2, r25 34774: 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])) 34776: e8 85 ldd r30, Y+8 ; 0x08 34778: f9 85 ldd r31, Y+9 ; 0x09 3477a: 65 8d ldd r22, Z+29 ; 0x1d 3477c: 76 8d ldd r23, Z+30 ; 0x1e 3477e: 87 8d ldd r24, Z+31 ; 0x1f 34780: 90 a1 ldd r25, Z+32 ; 0x20 34782: 9b 01 movw r18, r22 34784: ac 01 movw r20, r24 34786: 0f 94 52 e1 call 0x3c2a4 ; 0x3c2a4 <__unordsf2> 3478a: 88 23 and r24, r24 3478c: 09 f4 brne .+2 ; 0x34790 3478e: 79 c0 rjmp .+242 ; 0x34882 static float get_y(int i) { return BED_Y(i) + Y_PROBE_OFFSET_FROM_EXTRUDER; } 34790: 89 81 ldd r24, Y+1 ; 0x01 34792: 0f 94 35 ca call 0x3946a ; 0x3946a 34796: 20 e0 ldi r18, 0x00 ; 0 34798: 30 e0 ldi r19, 0x00 ; 0 3479a: 40 ea ldi r20, 0xA0 ; 160 3479c: 50 e4 ldi r21, 0x40 ; 64 3479e: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 347a2: 6b 01 movw r12, r22 347a4: 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)) + 347a6: 20 e0 ldi r18, 0x00 ; 0 347a8: 30 e0 ldi r19, 0x00 ; 0 347aa: 48 ed ldi r20, 0xD8 ; 216 347ac: 52 e4 ldi r21, 0x42 ; 66 347ae: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 347b2: 2b 01 movw r4, r22 347b4: 3c 01 movw r6, r24 347b6: 20 e0 ldi r18, 0x00 ; 0 347b8: 30 e0 ldi r19, 0x00 ; 0 347ba: 42 e5 ldi r20, 0x52 ; 82 347bc: 53 e4 ldi r21, 0x43 ; 67 347be: c7 01 movw r24, r14 347c0: b6 01 movw r22, r12 347c2: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 347c6: 4b 01 movw r8, r22 347c8: 5c 01 movw r10, r24 z_values[idx1][i] * (y - y0) * (y - y2) / ((y1 - y0) * (y1 - y2)) + 347ca: 20 e0 ldi r18, 0x00 ; 0 347cc: 30 e0 ldi r19, 0x00 ; 0 347ce: 40 ec ldi r20, 0xC0 ; 192 347d0: 50 e4 ldi r21, 0x40 ; 64 347d2: c7 01 movw r24, r14 347d4: b6 01 movw r22, r12 347d6: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 347da: 6b 01 movw r12, r22 347dc: 7c 01 movw r14, r24 347de: ee 81 ldd r30, Y+6 ; 0x06 347e0: ff 81 ldd r31, Y+7 ; 0x07 347e2: 20 81 ld r18, Z 347e4: 31 81 ldd r19, Z+1 ; 0x01 347e6: 42 81 ldd r20, Z+2 ; 0x02 347e8: 53 81 ldd r21, Z+3 ; 0x03 347ea: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 347ee: a5 01 movw r20, r10 347f0: 94 01 movw r18, r8 347f2: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 347f6: 20 e0 ldi r18, 0x00 ; 0 347f8: 30 e9 ldi r19, 0x90 ; 144 347fa: 42 e2 ldi r20, 0x22 ; 34 347fc: 56 ec ldi r21, 0xC6 ; 198 347fe: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 34802: 6a 83 std Y+2, r22 ; 0x02 34804: 7b 83 std Y+3, r23 ; 0x03 34806: 8c 83 std Y+4, r24 ; 0x04 34808: 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)) + 3480a: f8 01 movw r30, r16 3480c: 21 81 ldd r18, Z+1 ; 0x01 3480e: 32 81 ldd r19, Z+2 ; 0x02 34810: 43 81 ldd r20, Z+3 ; 0x03 34812: 54 81 ldd r21, Z+4 ; 0x04 34814: c3 01 movw r24, r6 34816: b2 01 movw r22, r4 34818: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 3481c: a5 01 movw r20, r10 3481e: 94 01 movw r18, r8 34820: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 34824: 20 e0 ldi r18, 0x00 ; 0 34826: 30 e9 ldi r19, 0x90 ; 144 34828: 42 ea ldi r20, 0xA2 ; 162 3482a: 56 e4 ldi r21, 0x46 ; 70 3482c: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 34830: 9b 01 movw r18, r22 34832: ac 01 movw r20, r24 34834: 6a 81 ldd r22, Y+2 ; 0x02 34836: 7b 81 ldd r23, Y+3 ; 0x03 34838: 8c 81 ldd r24, Y+4 ; 0x04 3483a: 9d 81 ldd r25, Y+5 ; 0x05 3483c: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 34840: 4b 01 movw r8, r22 34842: 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)); 34844: f1 01 movw r30, r2 34846: 20 81 ld r18, Z 34848: 31 81 ldd r19, Z+1 ; 0x01 3484a: 42 81 ldd r20, Z+2 ; 0x02 3484c: 53 81 ldd r21, Z+3 ; 0x03 3484e: c7 01 movw r24, r14 34850: b6 01 movw r22, r12 34852: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 34856: a3 01 movw r20, r6 34858: 92 01 movw r18, r4 3485a: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 3485e: 20 e0 ldi r18, 0x00 ; 0 34860: 30 e9 ldi r19, 0x90 ; 144 34862: 42 ea ldi r20, 0xA2 ; 162 34864: 56 e4 ldi r21, 0x46 ; 70 34866: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 3486a: 9b 01 movw r18, r22 3486c: 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)) + 3486e: c5 01 movw r24, r10 34870: b4 01 movw r22, r8 34872: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__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] = 34876: e8 85 ldd r30, Y+8 ; 0x08 34878: f9 85 ldd r31, Y+9 ; 0x09 3487a: 65 8f std Z+29, r22 ; 0x1d 3487c: 76 8f std Z+30, r23 ; 0x1e 3487e: 87 8f std Z+31, r24 ; 0x1f 34880: 90 a3 std Z+32, r25 ; 0x20 34882: 88 85 ldd r24, Y+8 ; 0x08 34884: 99 85 ldd r25, Y+9 ; 0x09 34886: 4c 96 adiw r24, 0x1c ; 28 34888: 99 87 std Y+9, r25 ; 0x09 3488a: 88 87 std Y+8, r24 ; 0x08 3488c: 99 81 ldd r25, Y+1 ; 0x01 3488e: 9f 5f subi r25, 0xFF ; 255 34890: 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) { 34892: 96 30 cpi r25, 0x06 ; 6 34894: 09 f0 breq .+2 ; 0x34898 34896: 6f cf rjmp .-290 ; 0x34776 34898: 0c 5f subi r16, 0xFC ; 252 3489a: 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) { 3489c: e3 e1 ldi r30, 0x13 ; 19 3489e: 0e 3d cpi r16, 0xDE ; 222 348a0: 1e 07 cpc r17, r30 348a2: 09 f0 breq .+2 ; 0x348a6 348a4: 5b cf rjmp .-330 ; 0x3475c z_values[idx1][i] * (y - y0) * (y - y2) / ((y1 - y0) * (y1 - y2)) + z_values[idx2][i] * (y - y0) * (y - y1) / ((y2 - y0) * (y2 - y1)); } } } } 348a6: 29 96 adiw r28, 0x09 ; 9 348a8: 0f b6 in r0, 0x3f ; 63 348aa: f8 94 cli 348ac: de bf out 0x3e, r29 ; 62 348ae: 0f be out 0x3f, r0 ; 63 348b0: cd bf out 0x3d, r28 ; 61 348b2: df 91 pop r29 348b4: cf 91 pop r28 348b6: 1f 91 pop r17 348b8: 0f 91 pop r16 348ba: ff 90 pop r15 348bc: ef 90 pop r14 348be: df 90 pop r13 348c0: cf 90 pop r12 348c2: bf 90 pop r11 348c4: af 90 pop r10 348c6: 9f 90 pop r9 348c8: 8f 90 pop r8 348ca: 7f 90 pop r7 348cc: 6f 90 pop r6 348ce: 5f 90 pop r5 348d0: 4f 90 pop r4 348d2: 3f 90 pop r3 348d4: 2f 90 pop r2 348d6: 08 95 ret 000348d8 : 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) { 348d8: 1f 93 push r17 348da: cf 93 push r28 348dc: df 93 push r29 348de: 00 d0 rcall .+0 ; 0x348e0 348e0: 1f 92 push r1 348e2: 1f 92 push r1 348e4: cd b7 in r28, 0x3d ; 61 348e6: de b7 in r29, 0x3e ; 62 348e8: 16 2f mov r17, r22 SendMsg(RequestMsg(RequestMsgCodes::Read, index)); 348ea: 48 2f mov r20, r24 348ec: 62 e5 ldi r22, 0x52 ; 82 348ee: ce 01 movw r24, r28 348f0: 01 96 adiw r24, 0x01 ; 1 348f2: 0f 94 8d c5 call 0x38b1a ; 0x38b1a 348f6: 49 81 ldd r20, Y+1 ; 0x01 348f8: 5a 81 ldd r21, Y+2 ; 0x02 348fa: 6b 81 ldd r22, Y+3 ; 0x03 348fc: 7c 81 ldd r23, Y+4 ; 0x04 348fe: 8d 81 ldd r24, Y+5 ; 0x05 34900: 0f 94 9c 66 call 0x2cd38 ; 0x2cd38 scopeState = nextState; 34904: 10 93 4e 13 sts 0x134E, r17 ; 0x80134e } 34908: 0f 90 pop r0 3490a: 0f 90 pop r0 3490c: 0f 90 pop r0 3490e: 0f 90 pop r0 34910: 0f 90 pop r0 34912: df 91 pop r29 34914: cf 91 pop r28 34916: 1f 91 pop r17 34918: 08 95 ret 0003491a : SendMsg(RequestMsg(RequestMsgCodes::Query, 0)); scopeState = ScopeState::QuerySent; } void ProtocolLogic::StartReading8bitRegisters() { regIndex = 0; 3491a: 10 92 99 13 sts 0x1399, r1 ; 0x801399 SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); 3491e: e0 e6 ldi r30, 0x60 ; 96 34920: fb ea ldi r31, 0xAB ; 171 34922: 84 91 lpm r24, Z 34924: 67 e0 ldi r22, 0x07 ; 7 34926: 0d 94 6c a4 jmp 0x348d8 ; 0x348d8 0003492a : regIndex = 0; SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); } ProtocolLogic::ScopeState __attribute__((noinline)) ProtocolLogic::ProcessRead16bitRegister(ProtocolLogic::ScopeState stateAtEnd) { regs16[regIndex] = rsp.paramValue; 3492a: e0 91 99 13 lds r30, 0x1399 ; 0x801399 3492e: ae 2f mov r26, r30 34930: b0 e0 ldi r27, 0x00 ; 0 34932: aa 0f add r26, r26 34934: bb 1f adc r27, r27 34936: ad 56 subi r26, 0x6D ; 109 34938: bc 4e sbci r27, 0xEC ; 236 3493a: 20 91 66 13 lds r18, 0x1366 ; 0x801366 3493e: 30 91 67 13 lds r19, 0x1367 ; 0x801367 34942: 2d 93 st X+, r18 34944: 3c 93 st X, r19 ++regIndex; 34946: ef 5f subi r30, 0xFF ; 255 34948: e0 93 99 13 sts 0x1399, r30 ; 0x801399 if (regIndex >= regs16Count) { 3494c: e2 30 cpi r30, 0x02 ; 2 3494e: 40 f4 brcc .+16 ; 0x34960 return stateAtEnd; } else { SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); 34950: f0 e0 ldi r31, 0x00 ; 0 34952: e9 5b subi r30, 0xB9 ; 185 34954: f4 45 sbci r31, 0x54 ; 84 34956: 84 91 lpm r24, Z 34958: 68 e0 ldi r22, 0x08 ; 8 3495a: 0f 94 6c a4 call 0x348d8 ; 0x348d8 } return ScopeState::Reading16bitRegisters; 3495e: 88 e0 ldi r24, 0x08 ; 8 } 34960: 08 95 ret 00034962 : regIndex = 0; SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); } void ProtocolLogic::ProcessRead8bitRegister() { regs8[regIndex] = rsp.paramValue; 34962: e0 91 99 13 lds r30, 0x1399 ; 0x801399 34966: ae 2f mov r26, r30 34968: b0 e0 ldi r27, 0x00 ; 0 3496a: a0 57 subi r26, 0x70 ; 112 3496c: bc 4e sbci r27, 0xEC ; 236 3496e: 80 91 66 13 lds r24, 0x1366 ; 0x801366 34972: 8c 93 st X, r24 ++regIndex; 34974: ef 5f subi r30, 0xFF ; 255 34976: e0 93 99 13 sts 0x1399, r30 ; 0x801399 if (regIndex >= regs8Count) { 3497a: e3 30 cpi r30, 0x03 ; 3 3497c: 40 f0 brcs .+16 ; 0x3498e SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); } } void ProtocolLogic::StartReading16bitRegisters() { regIndex = 0; 3497e: 10 92 99 13 sts 0x1399, r1 ; 0x801399 SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); 34982: e7 e4 ldi r30, 0x47 ; 71 34984: fb ea ldi r31, 0xAB ; 171 34986: 84 91 lpm r24, Z 34988: 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); 3498a: 0d 94 6c a4 jmp 0x348d8 ; 0x348d8 3498e: f0 e0 ldi r31, 0x00 ; 0 34990: e0 5a subi r30, 0xA0 ; 160 34992: f4 45 sbci r31, 0x54 ; 84 34994: 84 91 lpm r24, Z 34996: 67 e0 ldi r22, 0x07 ; 7 34998: f8 cf rjmp .-16 ; 0x3498a 0003499a : if (!ExpectsResponse()) { ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } bool ProtocolLogic::ActivatePlannedRequest() { 3499a: cf 93 push r28 3499c: df 93 push r29 3499e: 00 d0 rcall .+0 ; 0x349a0 349a0: 00 d0 rcall .+0 ; 0x349a2 349a2: 00 d0 rcall .+0 ; 0x349a4 349a4: 1f 92 push r1 349a6: cd b7 in r28, 0x3d ; 61 349a8: de b7 in r29, 0x3e ; 62 switch (plannedRq.code) { 349aa: 80 91 55 13 lds r24, 0x1355 ; 0x801355 349ae: 82 34 cpi r24, 0x42 ; 66 349b0: 09 f4 brne .+2 ; 0x349b4 349b2: 46 c0 rjmp .+140 ; 0x34a40 349b4: b8 f5 brcc .+110 ; 0x34a24 349b6: 88 23 and r24, r24 349b8: 09 f4 brne .+2 ; 0x349bc 349ba: 72 c0 rjmp .+228 ; 0x34aa0 plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); return true; case RequestMsgCodes::unknown: return false; default: // commands currentScope = Scope::Command; 349bc: 84 e0 ldi r24, 0x04 ; 4 349be: 80 93 4d 13 sts 0x134D, r24 ; 0x80134d 349c2: 85 e0 ldi r24, 0x05 ; 5 349c4: e5 e5 ldi r30, 0x55 ; 85 349c6: f3 e1 ldi r31, 0x13 ; 19 349c8: de 01 movw r26, r28 349ca: 16 96 adiw r26, 0x06 ; 6 349cc: 01 90 ld r0, Z+ 349ce: 0d 92 st X+, r0 349d0: 8a 95 dec r24 349d2: e1 f7 brne .-8 ; 0x349cc StepStatus StoppedStep() { return Processing; } StepStatus ProcessCommandQueryResponse(); inline void SetRequestMsg(RequestMsg msg) { rq = msg; 349d4: 85 e0 ldi r24, 0x05 ; 5 349d6: fe 01 movw r30, r28 349d8: 36 96 adiw r30, 0x06 ; 6 349da: a0 e5 ldi r26, 0x50 ; 80 349dc: b3 e1 ldi r27, 0x13 ; 19 349de: 01 90 ld r0, Z+ 349e0: 0d 92 st X+, r0 349e2: 8a 95 dec r24 349e4: e1 f7 brne .-8 ; 0x349de SetRequestMsg(plannedRq); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); 349e6: 40 e0 ldi r20, 0x00 ; 0 349e8: 60 e0 ldi r22, 0x00 ; 0 349ea: ce 01 movw r24, r28 349ec: 01 96 adiw r24, 0x01 ; 1 349ee: 0f 94 8d c5 call 0x38b1a ; 0x38b1a 349f2: 85 e0 ldi r24, 0x05 ; 5 349f4: fe 01 movw r30, r28 349f6: 31 96 adiw r30, 0x01 ; 1 349f8: a5 e5 ldi r26, 0x55 ; 85 349fa: b3 e1 ldi r27, 0x13 ; 19 349fc: 01 90 ld r0, Z+ 349fe: 0d 92 st X+, r0 34a00: 8a 95 dec r24 34a02: e1 f7 brne .-8 ; 0x349fc void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; } void ProtocolLogic::CommandRestart() { scopeState = ScopeState::CommandSent; 34a04: 85 e0 ldi r24, 0x05 ; 5 34a06: 80 93 4e 13 sts 0x134E, r24 ; 0x80134e SendMsg(rq); 34a0a: 40 91 50 13 lds r20, 0x1350 ; 0x801350 34a0e: 50 91 51 13 lds r21, 0x1351 ; 0x801351 34a12: 60 91 52 13 lds r22, 0x1352 ; 0x801352 34a16: 70 91 53 13 lds r23, 0x1353 ; 0x801353 34a1a: 80 91 54 13 lds r24, 0x1354 ; 0x801354 34a1e: 0f 94 9c 66 call 0x2cd38 ; 0x2cd38 34a22: 2e c0 rjmp .+92 ; 0x34a80 ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } bool ProtocolLogic::ActivatePlannedRequest() { switch (plannedRq.code) { 34a24: 82 35 cpi r24, 0x52 ; 82 34a26: b1 f1 breq .+108 ; 0x34a94 34a28: 87 35 cpi r24, 0x57 ; 87 34a2a: 41 f6 brne .-112 ; 0x349bc 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); 34a2c: 60 91 57 13 lds r22, 0x1357 ; 0x801357 34a30: 70 91 58 13 lds r23, 0x1358 ; 0x801358 34a34: 4c e0 ldi r20, 0x0C ; 12 34a36: 80 91 56 13 lds r24, 0x1356 ; 0x801356 34a3a: 0f 94 07 67 call 0x2ce0e ; 0x2ce0e 34a3e: 11 c0 rjmp .+34 ; 0x34a62 SendMsg(RequestMsg(RequestMsgCodes::FilamentSensor, lastFSensor = (uint8_t)WhereIsFilament())); scopeState = ScopeState::FilamentSensorStateSent; } void ProtocolLogic::SendButton(uint8_t btn) { SendMsg(RequestMsg(RequestMsgCodes::Button, btn)); 34a40: 40 91 56 13 lds r20, 0x1356 ; 0x801356 34a44: 62 e4 ldi r22, 0x42 ; 66 34a46: ce 01 movw r24, r28 34a48: 01 96 adiw r24, 0x01 ; 1 34a4a: 0f 94 8d c5 call 0x38b1a ; 0x38b1a 34a4e: 49 81 ldd r20, Y+1 ; 0x01 34a50: 5a 81 ldd r21, Y+2 ; 0x02 34a52: 6b 81 ldd r22, Y+3 ; 0x03 34a54: 7c 81 ldd r23, Y+4 ; 0x04 34a56: 8d 81 ldd r24, Y+5 ; 0x05 34a58: 0f 94 9c 66 call 0x2cd38 ; 0x2cd38 scopeState = ScopeState::ButtonSent; 34a5c: 8a e0 ldi r24, 0x0A ; 10 34a5e: 80 93 4e 13 sts 0x134E, r24 ; 0x80134e 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); 34a62: 40 e0 ldi r20, 0x00 ; 0 34a64: 60 e0 ldi r22, 0x00 ; 0 34a66: ce 01 movw r24, r28 34a68: 01 96 adiw r24, 0x01 ; 1 34a6a: 0f 94 8d c5 call 0x38b1a ; 0x38b1a 34a6e: 85 e0 ldi r24, 0x05 ; 5 34a70: fe 01 movw r30, r28 34a72: 31 96 adiw r30, 0x01 ; 1 34a74: a5 e5 ldi r26, 0x55 ; 85 34a76: b3 e1 ldi r27, 0x13 ; 19 34a78: 01 90 ld r0, Z+ 34a7a: 0d 92 st X+, r0 34a7c: 8a 95 dec r24 34a7e: e1 f7 brne .-8 ; 0x34a78 default: // commands currentScope = Scope::Command; SetRequestMsg(plannedRq); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); CommandRestart(); return true; 34a80: 81 e0 ldi r24, 0x01 ; 1 } } 34a82: 2a 96 adiw r28, 0x0a ; 10 34a84: 0f b6 in r0, 0x3f ; 63 34a86: f8 94 cli 34a88: de bf out 0x3e, r29 ; 62 34a8a: 0f be out 0x3f, r0 ; 63 34a8c: cd bf out 0x3d, r28 ; 61 34a8e: df 91 pop r29 34a90: cf 91 pop r28 34a92: 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); 34a94: 6b e0 ldi r22, 0x0B ; 11 34a96: 80 91 56 13 lds r24, 0x1356 ; 0x801356 34a9a: 0f 94 6c a4 call 0x348d8 ; 0x348d8 34a9e: e1 cf rjmp .-62 ; 0x34a62 case RequestMsgCodes::Write: SendWriteRegister(plannedRq.value, plannedRq.value2, ScopeState::WriteRegisterSent); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); return true; case RequestMsgCodes::unknown: return false; 34aa0: 80 e0 ldi r24, 0x00 ; 0 34aa2: ef cf rjmp .-34 ; 0x34a82 00034aa4 : void ProtocolLogic::WriteRegister(uint8_t address, uint16_t data) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Write, address, data)); } void ProtocolLogic::PlanGenericRequest(RequestMsg rq) { 34aa4: cf 93 push r28 34aa6: df 93 push r29 34aa8: 00 d0 rcall .+0 ; 0x34aaa 34aaa: 1f 92 push r1 34aac: 1f 92 push r1 34aae: cd b7 in r28, 0x3d ; 61 34ab0: de b7 in r29, 0x3e ; 62 34ab2: 49 83 std Y+1, r20 ; 0x01 34ab4: 5a 83 std Y+2, r21 ; 0x02 34ab6: 6b 83 std Y+3, r22 ; 0x03 34ab8: 7c 83 std Y+4, r23 ; 0x04 34aba: 8d 83 std Y+5, r24 ; 0x05 plannedRq = rq; 34abc: 85 e0 ldi r24, 0x05 ; 5 34abe: fe 01 movw r30, r28 34ac0: 31 96 adiw r30, 0x01 ; 1 34ac2: a5 e5 ldi r26, 0x55 ; 85 34ac4: b3 e1 ldi r27, 0x13 ; 19 34ac6: 01 90 ld r0, Z+ 34ac8: 0d 92 st X+, r0 34aca: 8a 95 dec r24 34acc: e1 f7 brne .-8 ; 0x34ac6 if (!ExpectsResponse()) { 34ace: 80 91 4e 13 lds r24, 0x134E ; 0x80134e 34ad2: 87 ff sbrs r24, 7 34ad4: 09 c0 rjmp .+18 ; 0x34ae8 ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } 34ad6: 0f 90 pop r0 34ad8: 0f 90 pop r0 34ada: 0f 90 pop r0 34adc: 0f 90 pop r0 34ade: 0f 90 pop r0 34ae0: df 91 pop r29 34ae2: cf 91 pop r28 } void ProtocolLogic::PlanGenericRequest(RequestMsg rq) { plannedRq = rq; if (!ExpectsResponse()) { ActivatePlannedRequest(); 34ae4: 0d 94 cd a4 jmp 0x3499a ; 0x3499a } // otherwise wait for an empty window to activate the request } 34ae8: 0f 90 pop r0 34aea: 0f 90 pop r0 34aec: 0f 90 pop r0 34aee: 0f 90 pop r0 34af0: 0f 90 pop r0 34af2: df 91 pop r29 34af4: cf 91 pop r28 34af6: 08 95 ret 00034af8 : void ProtocolLogic::SendButton(uint8_t btn) { SendMsg(RequestMsg(RequestMsgCodes::Button, btn)); scopeState = ScopeState::ButtonSent; } void ProtocolLogic::SendVersion(uint8_t stage) { 34af8: 1f 93 push r17 34afa: cf 93 push r28 34afc: df 93 push r29 34afe: 00 d0 rcall .+0 ; 0x34b00 34b00: 1f 92 push r1 34b02: 1f 92 push r1 34b04: cd b7 in r28, 0x3d ; 61 34b06: de b7 in r29, 0x3e ; 62 34b08: 18 2f mov r17, r24 SendMsg(RequestMsg(RequestMsgCodes::Version, stage)); 34b0a: 48 2f mov r20, r24 34b0c: 63 e5 ldi r22, 0x53 ; 83 34b0e: ce 01 movw r24, r28 34b10: 01 96 adiw r24, 0x01 ; 1 34b12: 0f 94 8d c5 call 0x38b1a ; 0x38b1a 34b16: 49 81 ldd r20, Y+1 ; 0x01 34b18: 5a 81 ldd r21, Y+2 ; 0x02 34b1a: 6b 81 ldd r22, Y+3 ; 0x03 34b1c: 7c 81 ldd r23, Y+4 ; 0x04 34b1e: 8d 81 ldd r24, Y+5 ; 0x05 34b20: 0f 94 9c 66 call 0x2cd38 ; 0x2cd38 scopeState = (ScopeState)((uint_fast8_t)ScopeState::S0Sent + stage); 34b24: 10 93 4e 13 sts 0x134E, r17 ; 0x80134e } 34b28: 0f 90 pop r0 34b2a: 0f 90 pop r0 34b2c: 0f 90 pop r0 34b2e: 0f 90 pop r0 34b30: 0f 90 pop r0 34b32: df 91 pop r29 34b34: cf 91 pop r28 34b36: 1f 91 pop r17 34b38: 08 95 ret 00034b3a : if (fs != lastFSensor) { SendAndUpdateFilamentSensor(); } } void ProtocolLogic::SendQuery() { 34b3a: cf 93 push r28 34b3c: df 93 push r29 34b3e: 00 d0 rcall .+0 ; 0x34b40 34b40: 1f 92 push r1 34b42: 1f 92 push r1 34b44: cd b7 in r28, 0x3d ; 61 34b46: de b7 in r29, 0x3e ; 62 SendMsg(RequestMsg(RequestMsgCodes::Query, 0)); 34b48: 40 e0 ldi r20, 0x00 ; 0 34b4a: 61 e5 ldi r22, 0x51 ; 81 34b4c: ce 01 movw r24, r28 34b4e: 01 96 adiw r24, 0x01 ; 1 34b50: 0f 94 8d c5 call 0x38b1a ; 0x38b1a 34b54: 49 81 ldd r20, Y+1 ; 0x01 34b56: 5a 81 ldd r21, Y+2 ; 0x02 34b58: 6b 81 ldd r22, Y+3 ; 0x03 34b5a: 7c 81 ldd r23, Y+4 ; 0x04 34b5c: 8d 81 ldd r24, Y+5 ; 0x05 34b5e: 0f 94 9c 66 call 0x2cd38 ; 0x2cd38 scopeState = ScopeState::QuerySent; 34b62: 84 e0 ldi r24, 0x04 ; 4 34b64: 80 93 4e 13 sts 0x134E, r24 ; 0x80134e } 34b68: 0f 90 pop r0 34b6a: 0f 90 pop r0 34b6c: 0f 90 pop r0 34b6e: 0f 90 pop r0 34b70: 0f 90 pop r0 34b72: df 91 pop r29 34b74: cf 91 pop r28 34b76: 08 95 ret 00034b78 : SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } return false; } void ProtocolLogic::SendAndUpdateFilamentSensor() { 34b78: cf 93 push r28 34b7a: df 93 push r29 34b7c: 00 d0 rcall .+0 ; 0x34b7e 34b7e: 1f 92 push r1 34b80: 1f 92 push r1 34b82: cd b7 in r28, 0x3d ; 61 34b84: de b7 in r29, 0x3e ; 62 SendMsg(RequestMsg(RequestMsgCodes::FilamentSensor, lastFSensor = (uint8_t)WhereIsFilament())); 34b86: 0f 94 e5 c5 call 0x38bca ; 0x38bca 34b8a: 80 93 8f 13 sts 0x138F, r24 ; 0x80138f 34b8e: 48 2f mov r20, r24 34b90: 66 e6 ldi r22, 0x66 ; 102 34b92: ce 01 movw r24, r28 34b94: 01 96 adiw r24, 0x01 ; 1 34b96: 0f 94 8d c5 call 0x38b1a ; 0x38b1a 34b9a: 49 81 ldd r20, Y+1 ; 0x01 34b9c: 5a 81 ldd r21, Y+2 ; 0x02 34b9e: 6b 81 ldd r22, Y+3 ; 0x03 34ba0: 7c 81 ldd r23, Y+4 ; 0x04 34ba2: 8d 81 ldd r24, Y+5 ; 0x05 34ba4: 0f 94 9c 66 call 0x2cd38 ; 0x2cd38 scopeState = ScopeState::FilamentSensorStateSent; 34ba8: 86 e0 ldi r24, 0x06 ; 6 34baa: 80 93 4e 13 sts 0x134E, r24 ; 0x80134e } 34bae: 0f 90 pop r0 34bb0: 0f 90 pop r0 34bb2: 0f 90 pop r0 34bb4: 0f 90 pop r0 34bb6: 0f 90 pop r0 34bb8: df 91 pop r29 34bba: cf 91 pop r28 34bbc: 08 95 ret 00034bbe : CheckAndReportAsyncEvents(); } return Processing; } StepStatus ProtocolLogic::ProcessCommandQueryResponse() { 34bbe: cf 93 push r28 34bc0: df 93 push r29 34bc2: 00 d0 rcall .+0 ; 0x34bc4 34bc4: 1f 92 push r1 34bc6: 1f 92 push r1 34bc8: cd b7 in r28, 0x3d ; 61 34bca: de b7 in r29, 0x3e ; 62 switch (rsp.paramCode) { 34bcc: 80 91 65 13 lds r24, 0x1365 ; 0x801365 34bd0: 85 34 cpi r24, 0x45 ; 69 34bd2: f1 f0 breq .+60 ; 0x34c10 34bd4: 20 f4 brcc .+8 ; 0x34bde 34bd6: 82 34 cpi r24, 0x42 ; 66 34bd8: 51 f1 breq .+84 ; 0x34c2e } else { // got response to some other command - the originally issued command was interrupted! return Interrupted; } default: return ProtocolError; 34bda: 85 e0 ldi r24, 0x05 ; 5 34bdc: 11 c0 rjmp .+34 ; 0x34c00 } return Processing; } StepStatus ProtocolLogic::ProcessCommandQueryResponse() { switch (rsp.paramCode) { 34bde: 86 34 cpi r24, 0x46 ; 70 34be0: 71 f1 breq .+92 ; 0x34c3e 34be2: 80 35 cpi r24, 0x50 ; 80 34be4: d1 f7 brne .-12 ; 0x34bda case ResponseMsgParamCodes::Processing: progressCode = static_cast(rsp.paramValue); 34be6: 80 91 66 13 lds r24, 0x1366 ; 0x801366 34bea: 80 93 8d 13 sts 0x138D, r24 ; 0x80138d errorCode = ErrorCode::OK; 34bee: 81 e0 ldi r24, 0x01 ; 1 34bf0: 90 e0 ldi r25, 0x00 ; 0 34bf2: 90 93 8c 13 sts 0x138C, r25 ; 0x80138c 34bf6: 80 93 8b 13 sts 0x138B, r24 ; 0x80138b SendAndUpdateFilamentSensor(); // keep on reporting the state of fsensor regularly 34bfa: 0f 94 bc a5 call 0x34b78 ; 0x34b78 return Processing; 34bfe: 80 e0 ldi r24, 0x00 ; 0 return Interrupted; } default: return ProtocolError; } } 34c00: 0f 90 pop r0 34c02: 0f 90 pop r0 34c04: 0f 90 pop r0 34c06: 0f 90 pop r0 34c08: 0f 90 pop r0 34c0a: df 91 pop r29 34c0c: cf 91 pop r28 34c0e: 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; 34c10: 8c e0 ldi r24, 0x0C ; 12 34c12: 80 93 8d 13 sts 0x138D, r24 ; 0x80138d errorCode = static_cast(rsp.paramValue); 34c16: 80 91 66 13 lds r24, 0x1366 ; 0x801366 34c1a: 90 91 67 13 lds r25, 0x1367 ; 0x801367 34c1e: 90 93 8c 13 sts 0x138C, r25 ; 0x80138c 34c22: 80 93 8b 13 sts 0x138B, r24 ; 0x80138b // 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(); 34c26: 0f 94 bc a5 call 0x34b78 ; 0x34b78 return CommandError; 34c2a: 87 e0 ldi r24, 0x07 ; 7 34c2c: e9 cf rjmp .-46 ; 0x34c00 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); 34c2e: 80 91 66 13 lds r24, 0x1366 ; 0x801366 34c32: 80 93 8e 13 sts 0x138E, r24 ; 0x80138e SendAndUpdateFilamentSensor(); 34c36: 0f 94 bc a5 call 0x34b78 ; 0x34b78 return ButtonPushed; 34c3a: 8b e0 ldi r24, 0x0B ; 11 34c3c: e1 cf rjmp .-62 ; 0x34c00 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) { 34c3e: 90 91 50 13 lds r25, 0x1350 ; 0x801350 34c42: 80 91 60 13 lds r24, 0x1360 ; 0x801360 34c46: 98 13 cpse r25, r24 34c48: 22 c0 rjmp .+68 ; 0x34c8e 34c4a: 90 91 51 13 lds r25, 0x1351 ; 0x801351 34c4e: 80 91 61 13 lds r24, 0x1361 ; 0x801361 34c52: 98 13 cpse r25, r24 34c54: 1c c0 rjmp .+56 ; 0x34c8e progressCode = ProgressCode::OK; 34c56: 10 92 8d 13 sts 0x138D, r1 ; 0x80138d errorCode = ErrorCode::OK; 34c5a: 81 e0 ldi r24, 0x01 ; 1 34c5c: 90 e0 ldi r25, 0x00 ; 0 34c5e: 90 93 8c 13 sts 0x138C, r25 ; 0x80138c 34c62: 80 93 8b 13 sts 0x138B, r24 ; 0x80138b scopeState = ScopeState::Ready; 34c66: 82 e8 ldi r24, 0x82 ; 130 34c68: 80 93 4e 13 sts 0x134E, r24 ; 0x80134e rq = RequestMsg(RequestMsgCodes::unknown, 0); // clear the successfully finished request 34c6c: 40 e0 ldi r20, 0x00 ; 0 34c6e: 60 e0 ldi r22, 0x00 ; 0 34c70: ce 01 movw r24, r28 34c72: 01 96 adiw r24, 0x01 ; 1 34c74: 0f 94 8d c5 call 0x38b1a ; 0x38b1a 34c78: 85 e0 ldi r24, 0x05 ; 5 34c7a: fe 01 movw r30, r28 34c7c: 31 96 adiw r30, 0x01 ; 1 34c7e: a0 e5 ldi r26, 0x50 ; 80 34c80: b3 e1 ldi r27, 0x13 ; 19 34c82: 01 90 ld r0, Z+ 34c84: 0d 92 st X+, r0 34c86: 8a 95 dec r24 34c88: e1 f7 brne .-8 ; 0x34c82 34c8a: 82 e0 ldi r24, 0x02 ; 2 34c8c: b9 cf rjmp .-142 ; 0x34c00 return Finished; } else { // got response to some other command - the originally issued command was interrupted! return Interrupted; 34c8e: 83 e0 ldi r24, 0x03 ; 3 34c90: b7 cf rjmp .-146 ; 0x34c00 00034c92 : mmu_print_saved &= ~(SavedState::ParkExtruder); } } void MMU2::CheckUserInput() { 34c92: 1f 93 push r17 34c94: cf 93 push r28 34c96: df 93 push r29 34c98: 00 d0 rcall .+0 ; 0x34c9a 34c9a: 1f 92 push r1 34c9c: 1f 92 push r1 34c9e: cd b7 in r28, 0x3d ; 61 34ca0: de b7 in r29, 0x3e ; 62 const char *PrusaErrorButtonMore() { return MSG_BTN_MORE; } Buttons ButtonPressed(ErrorCode ec) { if (buttonSelectedOperation == ButtonOperations::NoOperation) { 34ca2: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.493> 34ca6: 81 11 cpse r24, r1 34ca8: 2a c0 rjmp .+84 ; 0x34cfe auto btn = ButtonPressed(lastErrorCode); // Was a button pressed on the MMU itself instead of the LCD? if (btn == Buttons::NoButton && lastButton != Buttons::NoButton) { 34caa: 10 91 b5 13 lds r17, 0x13B5 ; 0x8013b5 34cae: 1f 3f cpi r17, 0xFF ; 255 34cb0: 91 f5 brne .+100 ; 0x34d16 btn = lastButton; lastButton = Buttons::NoButton; // Clear it. } if (mmu2.MMULastErrorSource() == ErrorSourcePrinter && btn != Buttons::NoButton) { 34cb2: 80 91 b4 13 lds r24, 0x13B4 ; 0x8013b4 34cb6: 81 11 cpse r24, r1 34cb8: 60 c0 rjmp .+192 ; 0x34d7a 34cba: 1f 3f cpi r17, 0xFF ; 255 34cbc: b9 f0 breq .+46 ; 0x34cec inline void SetPrinterError(ErrorCode ec) { explicitPrinterError = ec; } inline void ClearPrinterError() { explicitPrinterError = ErrorCode::OK; 34cbe: 81 e0 ldi r24, 0x01 ; 1 34cc0: 90 e0 ldi r25, 0x00 ; 0 34cc2: 90 93 4c 13 sts 0x134C, r25 ; 0x80134c 34cc6: 80 93 4b 13 sts 0x134B, r24 ; 0x80134b } } void ClearPrinterError() { logic.ClearPrinterError(); lastErrorCode = ErrorCode::OK; 34cca: 90 93 b3 13 sts 0x13B3, r25 ; 0x8013b3 34cce: 80 93 b2 13 sts 0x13B2, r24 ; 0x8013b2 lastErrorSource = ErrorSource::ErrorSourceNone; 34cd2: 8f ef ldi r24, 0xFF ; 255 34cd4: 80 93 b4 13 sts 0x13B4, r24 ; 0x8013b4 // 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) { 34cd8: 13 30 cpi r17, 0x03 ; 3 34cda: 09 f4 brne .+2 ; 0x34cde 34cdc: 82 c0 rjmp .+260 ; 0x34de2 34cde: f8 f0 brcs .+62 ; 0x34d1e 34ce0: 16 30 cpi r17, 0x06 ; 6 34ce2: 08 f4 brcc .+2 ; 0x34ce6 34ce4: 7b c0 rjmp .+246 ; 0x34ddc 34ce6: 17 30 cpi r17, 0x07 ; 7 34ce8: 09 f4 brne .+2 ; 0x34cec 34cea: 7e c0 rjmp .+252 ; 0x34de8 // @@TODO not sure if we shall handle this high level operation at this spot break; default: break; } } 34cec: 0f 90 pop r0 34cee: 0f 90 pop r0 34cf0: 0f 90 pop r0 34cf2: 0f 90 pop r0 34cf4: 0f 90 pop r0 34cf6: df 91 pop r29 34cf8: cf 91 pop r28 34cfa: 1f 91 pop r17 34cfc: 08 95 ret return Buttons::NoButton; // no button } const auto result = ButtonAvailable(ec); 34cfe: 80 91 b2 13 lds r24, 0x13B2 ; 0x8013b2 34d02: 90 91 b3 13 lds r25, 0x13B3 ; 0x8013b3 34d06: 0f 94 77 c8 call 0x390ee ; 0x390ee 34d0a: 18 2f mov r17, r24 buttonSelectedOperation = ButtonOperations::NoOperation; // Reset operation 34d0c: 10 92 ae 0d sts 0x0DAE, r1 ; 0x800dae <_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) { 34d10: 8f 3f cpi r24, 0xFF ; 255 34d12: 79 f6 brne .-98 ; 0x34cb2 34d14: ca cf rjmp .-108 ; 0x34caa btn = lastButton; lastButton = Buttons::NoButton; // Clear it. 34d16: 8f ef ldi r24, 0xFF ; 255 34d18: 80 93 b5 13 sts 0x13B5, r24 ; 0x8013b5 34d1c: ca cf rjmp .-108 ; 0x34cb2 switch (btn) { case Buttons::Left: case Buttons::Middle: case Buttons::Right: SERIAL_ECHOPGM("CheckUserInput-btnLMR "); 34d1e: 88 e9 ldi r24, 0x98 ; 152 34d20: 99 ea ldi r25, 0xA9 ; 169 34d22: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHOLN((int)buttons_to_uint8t(btn)); 34d26: 81 2f mov r24, r17 34d28: 90 e0 ldi r25, 0x00 ; 0 34d2a: 0f 94 f5 74 call 0x2e9ea ; 0x2e9ea ResumeHotendTemp(); // Recover the hotend temp before we attempt to do anything else... 34d2e: 0f 94 14 ac call 0x35828 ; 0x35828 if (mmu2.MMULastErrorSource() == ErrorSourceMMU) { 34d32: 80 91 b4 13 lds r24, 0x13B4 ; 0x8013b4 34d36: 81 30 cpi r24, 0x01 ; 1 34d38: 89 f4 brne .+34 ; 0x34d5c ScreenUpdateEnable(); return true; } void MMU2::Button(uint8_t index) { LogEchoEvent_P(PSTR("Button")); 34d3a: 81 e9 ldi r24, 0x91 ; 145 34d3c: 99 ea ldi r25, 0xA9 ; 169 34d3e: 0f 94 d5 c5 call 0x38baa ; 0x38baa void ProtocolLogic::ResetMMU(uint8_t mode /* = 0 */) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Reset, mode)); } void ProtocolLogic::Button(uint8_t index) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Button, index)); 34d42: 41 2f mov r20, r17 34d44: 62 e4 ldi r22, 0x42 ; 66 34d46: ce 01 movw r24, r28 34d48: 01 96 adiw r24, 0x01 ; 1 34d4a: 0f 94 8d c5 call 0x38b1a ; 0x38b1a 34d4e: 49 81 ldd r20, Y+1 ; 0x01 34d50: 5a 81 ldd r21, Y+2 ; 0x02 34d52: 6b 81 ldd r22, Y+3 ; 0x03 34d54: 7c 81 ldd r23, Y+4 ; 0x04 34d56: 8d 81 ldd r24, Y+5 ; 0x05 34d58: 0f 94 52 a5 call 0x34aa4 ; 0x34aa4 } // 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) { 34d5c: 80 91 b2 13 lds r24, 0x13B2 ; 0x8013b2 34d60: 90 91 b3 13 lds r25, 0x13B3 ; 0x8013b3 34d64: 84 30 cpi r24, 0x04 ; 4 34d66: 20 e8 ldi r18, 0x80 ; 128 34d68: 92 07 cpc r25, r18 34d6a: 21 f0 breq .+8 ; 0x34d74 34d6c: 89 30 cpi r24, 0x09 ; 9 34d6e: 90 48 sbci r25, 0x80 ; 128 34d70: 09 f0 breq .+2 ; 0x34d74 34d72: bc cf rjmp .-136 ; 0x34cec case ErrorCode::FSENSOR_DIDNT_SWITCH_OFF: case ErrorCode::FSENSOR_TOO_EARLY: HelpUnloadToFinda(); 34d74: 0f 94 0c 6a call 0x2d418 ; 0x2d418 34d78: b9 cf rjmp .-142 ; 0x34cec // 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) { 34d7a: 19 30 cpi r17, 0x09 ; 9 34d7c: 08 f0 brcs .+2 ; 0x34d80 34d7e: b6 cf rjmp .-148 ; 0x34cec 34d80: e1 2f mov r30, r17 34d82: f0 e0 ldi r31, 0x00 ; 0 34d84: 88 27 eor r24, r24 34d86: e8 53 subi r30, 0x38 ; 56 34d88: f9 45 sbci r31, 0x59 ; 89 34d8a: 8e 4f sbci r24, 0xFE ; 254 34d8c: 0d 94 2c dd jmp 0x3ba58 ; 0x3ba58 <__tablejump2__> 34d90: c8 3a cpi r28, 0xA8 ; 168 34d92: c8 3a cpi r28, 0xA8 ; 168 34d94: c8 3a cpi r28, 0xA8 ; 168 34d96: 9a 3a cpi r25, 0xAA ; 170 34d98: 7e 39 cpi r23, 0x9E ; 158 34d9a: 7e 39 cpi r23, 0x9E ; 158 34d9c: da 3a cpi r29, 0xAA ; 170 34d9e: 68 39 cpi r22, 0x98 ; 152 34da0: b4 3a cpi r27, 0xA4 ; 164 logic.Stop(); mmu2Serial.close(); } void MMU2::Tune() { switch (lastErrorCode) { 34da2: 80 91 b2 13 lds r24, 0x13B2 ; 0x8013b2 34da6: 90 91 b3 13 lds r25, 0x13B3 ; 0x8013b3 34daa: 87 38 cpi r24, 0x87 ; 135 34dac: 20 e8 ldi r18, 0x80 ; 128 34dae: 92 07 cpc r25, r18 34db0: 21 f0 breq .+8 ; 0x34dba 34db2: 87 30 cpi r24, 0x07 ; 7 34db4: 91 48 sbci r25, 0x81 ; 129 34db6: 09 f0 breq .+2 ; 0x34dba 34db8: 99 cf rjmp .-206 ; 0x34cec // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { 34dba: 80 91 4d 13 lds r24, 0x134D ; 0x80134d 34dbe: 84 30 cpi r24, 0x04 ; 4 34dc0: 21 f4 brne .+8 ; 0x34dca ); MENU_END(); } void tuneIdlerStallguardThreshold() { if ((CommandInProgress)mmu2.GetCommandInProgress() != NoCommand) 34dc2: 80 91 50 13 lds r24, 0x1350 ; 0x801350 34dc6: 81 11 cpse r24, r1 34dc8: 91 cf rjmp .-222 ; 0x34cec // homing fails during toolchange. // To save the print, make the Tune button unresponsive for now. return; } putErrorScreenToSleep = true; 34dca: 81 e0 ldi r24, 0x01 ; 1 34dcc: 80 93 ad 0d sts 0x0DAD, r24 ; 0x800dad <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.496> menu_submenu(tuneIdlerStallguardThresholdMenu); 34dd0: 60 e0 ldi r22, 0x00 ; 0 34dd2: 86 e1 ldi r24, 0x16 ; 22 34dd4: 9a e3 ldi r25, 0x3A ; 58 34dd6: 0f 94 03 d3 call 0x3a606 ; 0x3a606 34dda: 88 cf rjmp .-240 ; 0x34cec } /// @brief Queue a button operation which the printer can act upon /// @param btn Button operation inline void SetPrinterButtonOperation(Buttons btn) { printerButtonOperation = btn; 34ddc: 10 93 b8 13 sts 0x13B8, r17 ; 0x8013b8 34de0: 85 cf rjmp .-246 ; 0x34cec void MMU2::ResetX42() { logic.ResetMMU(42); } void MMU2::TriggerResetPin() { reset(); 34de2: 0f 94 9a c5 call 0x38b34 ; 0x38b34 34de6: 82 cf rjmp .-252 ; 0x34cec StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 34de8: 10 92 ba 13 sts 0x13BA, r1 ; 0x8013ba protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 34dec: 10 92 68 13 sts 0x1368, r1 ; 0x801368 currentScope = Scope::Stopped; 34df0: 10 92 4d 13 sts 0x134D, r1 ; 0x80134d if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 34df4: 60 e0 ldi r22, 0x00 ; 0 34df6: 8c ea ldi r24, 0xAC ; 172 34df8: 9c e0 ldi r25, 0x0C ; 12 34dfa: 0f 94 40 dc call 0x3b880 ; 0x3b880 } /// Disables MMU in EEPROM void DisableMMUInSettings() { eeprom_update_byte_notify((uint8_t *)EEPROM_MMU_ENABLED, false); mmu2.Status(); 34dfe: 0f 94 e3 74 call 0x2e9c6 ; 0x2e9c6 34e02: 74 cf rjmp .-280 ; 0x34cec 00034e04 : avoidRecursion = true; mmu_loop_inner(true); avoidRecursion = false; } void __attribute__((noinline)) MMU2::mmu_loop_inner(bool reportErrors) { 34e04: 4f 92 push r4 34e06: 5f 92 push r5 34e08: 6f 92 push r6 34e0a: 7f 92 push r7 34e0c: 8f 92 push r8 34e0e: 9f 92 push r9 34e10: af 92 push r10 34e12: bf 92 push r11 34e14: cf 92 push r12 34e16: df 92 push r13 34e18: ef 92 push r14 34e1a: ff 92 push r15 34e1c: 0f 93 push r16 34e1e: 1f 93 push r17 34e20: cf 93 push r28 34e22: df 93 push r29 34e24: cd b7 in r28, 0x3d ; 61 34e26: de b7 in r29, 0x3e ; 62 34e28: a0 97 sbiw r28, 0x20 ; 32 34e2a: 0f b6 in r0, 0x3f ; 63 34e2c: f8 94 cli 34e2e: de bf out 0x3e, r29 ; 62 34e30: 0f be out 0x3f, r0 ; 63 34e32: cd bf out 0x3d, r28 ; 61 34e34: 08 2f mov r16, r24 } } StepStatus MMU2::LogicStep(bool reportErrors) { // Process any buttons before proceeding with another MMU Query CheckUserInput(); 34e36: 0f 94 49 a6 call 0x34c92 ; 0x34c92 DelayedRestartRestart(); return SuppressShortDropOuts(PSTR("Protocol Error"), ProtocolError); } StepStatus ProtocolLogic::Step() { if (!ExpectsResponse()) { // if not waiting for a response, activate a planned request immediately 34e3a: 80 91 4e 13 lds r24, 0x134E ; 0x80134e 34e3e: 87 fd sbrc r24, 7 ActivatePlannedRequest(); 34e40: 0f 94 cd a4 call 0x3499a ; 0x3499a 34e44: 90 91 4e 13 lds r25, 0x134E ; 0x80134e } return Processing; } StepStatus ProtocolLogic::ScopeStep() { if (!ExpectsResponse()) { 34e48: 97 ff sbrs r25, 7 34e4a: 7d c0 rjmp .+250 ; 0x34f46 // we are waiting for something switch (currentScope) { 34e4c: 80 91 4d 13 lds r24, 0x134D ; 0x80134d 34e50: 82 30 cpi r24, 0x02 ; 2 34e52: b1 f0 breq .+44 ; 0x34e80 34e54: 08 f4 brcc .+2 ; 0x34e58 34e56: 75 c0 rjmp .+234 ; 0x34f42 34e58: 83 30 cpi r24, 0x03 ; 3 34e5a: e1 f1 breq .+120 ; 0x34ed4 34e5c: 84 30 cpi r24, 0x04 ; 4 34e5e: 09 f4 brne .+2 ; 0x34e62 34e60: 54 c0 rjmp .+168 ; 0x34f0a 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 34e62: 0f 94 cd a4 call 0x3499a ; 0x3499a 34e66: 81 11 cpse r24, r1 34e68: 6b c3 rjmp .+1750 ; 0x35540 // and we have just received a response to a Q0 message about a command progress return ProcessCommandQueryResponse(); } void ProtocolLogic::SwitchToIdle() { state = State::Running; 34e6a: 82 e0 ldi r24, 0x02 ; 2 34e6c: 80 93 68 13 sts 0x1368, r24 ; 0x801368 currentScope = Scope::Idle; 34e70: 83 e0 ldi r24, 0x03 ; 3 34e72: 80 93 4d 13 sts 0x134D, r24 ; 0x80134d scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 34e76: 82 e8 ldi r24, 0x82 ; 130 34e78: 80 93 4e 13 sts 0x134E, r24 ; 0x80134e // 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()) { 34e7c: 12 e0 ldi r17, 0x02 ; 2 34e7e: db c2 rjmp .+1462 ; 0x35436 IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 34e80: 0f 94 4c 29 call 0x25298 ; 0x25298 34e84: ab 01 movw r20, r22 34e86: bc 01 movw r22, r24 34e88: 80 91 5a 13 lds r24, 0x135A ; 0x80135a 34e8c: 90 91 5b 13 lds r25, 0x135B ; 0x80135b 34e90: a0 91 5c 13 lds r26, 0x135C ; 0x80135c 34e94: b0 91 5d 13 lds r27, 0x135D ; 0x80135d 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 VersionMismatch; } } StepStatus ProtocolLogic::DelayedRestartWait() { if (Elapsed(heartBeatPeriod)) { // this basically means, that we are waiting until there is some traffic on 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: 08 f4 brcc .+2 ; 0x34eac 34eaa: 4b c0 rjmp .+150 ; 0x34f42 void MMU2Serial::close() { // @@TODO - probably turn off the UART } int MMU2Serial::read() { return fgetc(uart2io); 34eac: 84 e9 ldi r24, 0x94 ; 148 34eae: 92 e1 ldi r25, 0x12 ; 18 34eb0: 0f 94 48 da call 0x3b490 ; 0x3b490 while (uart->read() != -1) 34eb4: 01 96 adiw r24, 0x01 ; 1 34eb6: d1 f7 brne .-12 ; 0x34eac initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 34eb8: 81 e0 ldi r24, 0x01 ; 1 34eba: 80 93 68 13 sts 0x1368, r24 ; 0x801368 currentScope = Scope::StartSeq; 34ebe: 80 93 4d 13 sts 0x134D, r24 ; 0x80134d rqState = RequestStates::Code; } /// resets the internal response decoding state (typically after an error) void ResetResponseDecoder() { rspState = ResponseStates::RequestCode; 34ec2: 10 92 6f 13 sts 0x136F, r1 ; 0x80136f LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 34ec6: 86 e0 ldi r24, 0x06 ; 6 34ec8: 80 93 4f 13 sts 0x134F, r24 ; 0x80134f SendVersion(0); 34ecc: 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); 34ece: 0f 94 7c a5 call 0x34af8 ; 0x34af8 34ed2: 37 c0 rjmp .+110 ; 0x34f42 } return Processing; } StepStatus ProtocolLogic::IdleWait() { if (scopeState == ScopeState::Ready) { // check timeout 34ed4: 92 38 cpi r25, 0x82 ; 130 34ed6: 29 f6 brne .-118 ; 0x34e62 IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 34ed8: 0f 94 4c 29 call 0x25298 ; 0x25298 34edc: ab 01 movw r20, r22 34ede: bc 01 movw r22, r24 34ee0: 80 91 5a 13 lds r24, 0x135A ; 0x80135a 34ee4: 90 91 5b 13 lds r25, 0x135B ; 0x80135b 34ee8: a0 91 5c 13 lds r26, 0x135C ; 0x80135c 34eec: b0 91 5d 13 lds r27, 0x135D ; 0x80135d 34ef0: 88 51 subi r24, 0x18 ; 24 34ef2: 9c 4f sbci r25, 0xFC ; 252 34ef4: af 4f sbci r26, 0xFF ; 255 34ef6: bf 4f sbci r27, 0xFF ; 255 return Processing; } StepStatus ProtocolLogic::IdleWait() { if (scopeState == ScopeState::Ready) { // check timeout if (Elapsed(heartBeatPeriod)) { 34ef8: 48 17 cp r20, r24 34efa: 59 07 cpc r21, r25 34efc: 6a 07 cpc r22, r26 34efe: 7b 07 cpc r23, r27 34f00: 08 f4 brcc .+2 ; 0x34f04 34f02: af cf rjmp .-162 ; 0x34e62 void ProtocolLogic::SwitchFromStartToIdle() { state = State::Running; currentScope = Scope::Idle; IdleRestart(); SendQuery(); // force sending Q0 immediately 34f04: 0f 94 9d a5 call 0x34b3a ; 0x34b3a 34f08: 1c c0 rjmp .+56 ; 0x34f42 } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 34f0a: 0f 94 4c 29 call 0x25298 ; 0x25298 34f0e: ab 01 movw r20, r22 34f10: bc 01 movw r22, r24 34f12: 80 91 5a 13 lds r24, 0x135A ; 0x80135a 34f16: 90 91 5b 13 lds r25, 0x135B ; 0x80135b 34f1a: a0 91 5c 13 lds r26, 0x135C ; 0x80135c 34f1e: b0 91 5d 13 lds r27, 0x135D ; 0x80135d 34f22: 88 51 subi r24, 0x18 ; 24 34f24: 9c 4f sbci r25, 0xFC ; 252 34f26: af 4f sbci r26, 0xFF ; 255 34f28: bf 4f sbci r27, 0xFF ; 255 } return Processing; } StepStatus ProtocolLogic::CommandWait() { if (Elapsed(heartBeatPeriod)) { 34f2a: 48 17 cp r20, r24 34f2c: 59 07 cpc r21, r25 34f2e: 6a 07 cpc r22, r26 34f30: 7b 07 cpc r23, r27 34f32: 40 f7 brcc .-48 ; 0x34f04 }; 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(); 34f34: 0f 94 e5 c5 call 0x38bca ; 0x38bca if (fs != lastFSensor) { 34f38: 90 91 8f 13 lds r25, 0x138F ; 0x80138f 34f3c: 89 13 cpse r24, r25 SendAndUpdateFilamentSensor(); 34f3e: 0f 94 bc a5 call 0x34b78 ; 0x34b78 // 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; 34f42: 10 e0 ldi r17, 0x00 ; 0 34f44: 78 c2 rjmp .+1264 ; 0x35436 StepStatus ProtocolLogic::ExpectingMessage() { int bytesConsumed = 0; int c = -1; OldMMUFWDetector oldMMUh4x0r; // old MMU FW hacker ;) 34f46: a1 2c mov r10, r1 return State::SomethingElse; } }; StepStatus ProtocolLogic::ExpectingMessage() { int bytesConsumed = 0; 34f48: d1 2c mov r13, r1 34f4a: 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; 34f4c: 99 24 eor r9, r9 34f4e: 93 94 inc r9 responseMsg.paramCode = (ResponseMsgParamCodes)c; responseMsg.paramValue = 0; return DecodeStatus::NeedMoreData; default: responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; 34f50: 55 e0 ldi r21, 0x05 ; 5 34f52: b5 2e mov r11, r21 case 'E': case 'F': case 'A': case 'R': case 'B': rspState = ResponseStates::ParamValue; 34f54: 63 e0 ldi r22, 0x03 ; 3 34f56: 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; 34f58: 74 e0 ldi r23, 0x04 ; 4 34f5a: 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; 34f5c: e2 e0 ldi r30, 0x02 ; 2 34f5e: 6e 2e mov r6, r30 34f60: 66 c0 rjmp .+204 ; 0x3502e ++i; return i; } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { 34f62: 23 30 cpi r18, 0x03 ; 3 34f64: 09 f4 brne .+2 ; 0x34f68 34f66: e0 c0 rjmp .+448 ; 0x35128 34f68: 24 30 cpi r18, 0x04 ; 4 34f6a: 09 f0 breq .+2 ; 0x34f6e 34f6c: 83 c0 rjmp .+262 ; 0x35074 } 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'); 34f6e: 20 ed ldi r18, 0xD0 ; 208 34f70: 28 0f add r18, r24 34f72: 2a 30 cpi r18, 0x0A ; 10 34f74: 08 f4 brcc .+2 ; 0x34f78 34f76: f8 c0 rjmp .+496 ; 0x35168 34f78: 2f e9 ldi r18, 0x9F ; 159 34f7a: 28 0f add r18, r24 34f7c: 26 30 cpi r18, 0x06 ; 6 34f7e: 08 f4 brcc .+2 ; 0x34f82 34f80: f3 c0 rjmp .+486 ; 0x35168 ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 34f82: 8a 30 cpi r24, 0x0A ; 10 34f84: 09 f0 breq .+2 ; 0x34f88 34f86: fa c0 rjmp .+500 ; 0x3517c 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()) { 34f88: 40 90 74 13 lds r4, 0x1374 ; 0x801374 34f8c: 80 e7 ldi r24, 0x70 ; 112 34f8e: 93 e1 ldi r25, 0x13 ; 19 34f90: 0f 94 7c c5 call 0x38af8 ; 0x38af8 34f94: 48 12 cpse r4, r24 34f96: b8 c0 rjmp .+368 ; 0x35108 // CRC mismatch responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; return DecodeStatus::Error; } else { rspState = ResponseStates::RequestCode; 34f98: 10 92 6f 13 sts 0x136F, r1 ; 0x80136f /// @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; } 34f9c: 88 e0 ldi r24, 0x08 ; 8 34f9e: e0 e7 ldi r30, 0x70 ; 112 34fa0: f3 e1 ldi r31, 0x13 ; 19 34fa2: de 01 movw r26, r28 34fa4: 51 96 adiw r26, 0x11 ; 17 34fa6: 01 90 ld r0, Z+ 34fa8: 0d 92 st X+, r0 34faa: 8a 95 dec r24 34fac: e1 f7 brne .-8 ; 0x34fa6 34fae: 88 e0 ldi r24, 0x08 ; 8 34fb0: fe 01 movw r30, r28 34fb2: 71 96 adiw r30, 0x11 ; 17 34fb4: de 01 movw r26, r28 34fb6: 59 96 adiw r26, 0x19 ; 25 34fb8: 01 90 ld r0, Z+ 34fba: 0d 92 st X+, r0 34fbc: 8a 95 dec r24 34fbe: e1 f7 brne .-8 ; 0x34fb8 while ((c = uart->read()) >= 0) { ++bytesConsumed; RecordReceivedByte(c); switch (protocol.DecodeResponse(c)) { case DecodeStatus::MessageCompleted: rsp = protocol.GetResponseMsg(); 34fc0: 88 e0 ldi r24, 0x08 ; 8 34fc2: fe 01 movw r30, r28 34fc4: 79 96 adiw r30, 0x19 ; 25 34fc6: a0 e6 ldi r26, 0x60 ; 96 34fc8: b3 e1 ldi r27, 0x13 ; 19 34fca: 01 90 ld r0, Z+ 34fcc: 0d 92 st X+, r0 34fce: 8a 95 dec r24 34fd0: e1 f7 brne .-8 ; 0x34fca } dst[(lastReceivedBytes.size() - 1) * 3 + 2] = 0; // terminate properly } void ProtocolLogic::FormatLastResponseMsgAndClearLRB(char *dst) { *dst++ = '<'; 34fd2: 8c e3 ldi r24, 0x3C ; 60 34fd4: 89 83 std Y+1, r24 ; 0x01 34fd6: fe 01 movw r30, r28 34fd8: 32 96 adiw r30, 0x02 ; 2 34fda: a8 e7 ldi r26, 0x78 ; 120 34fdc: b3 e1 ldi r27, 0x13 ; 19 for (uint8_t i = 0; i < lrb; ++i) { 34fde: 20 e0 ldi r18, 0x00 ; 0 34fe0: cf 01 movw r24, r30 34fe2: 52 16 cp r5, r18 34fe4: 09 f4 brne .+2 ; 0x34fe8 34fe6: cd c0 rjmp .+410 ; 0x35182 uint8_t b = lastReceivedBytes[i]; 34fe8: 3d 91 ld r19, X+ // Check for printable character, including space if (b < 32 || b > 127) { 34fea: 40 ee ldi r20, 0xE0 ; 224 34fec: 43 0f add r20, r19 34fee: 40 36 cpi r20, 0x60 ; 96 34ff0: 08 f0 brcs .+2 ; 0x34ff4 b = '.'; 34ff2: 3e e2 ldi r19, 0x2E ; 46 } *dst++ = b; 34ff4: 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) { 34ff6: 2f 5f subi r18, 0xFF ; 255 34ff8: f4 cf rjmp .-24 ; 0x34fe2 } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 34ffa: 8e 34 cpi r24, 0x4E ; 78 34ffc: 08 f0 brcs .+2 ; 0x35000 34ffe: 56 c0 rjmp .+172 ; 0x350ac 35000: 8b 34 cpi r24, 0x4B ; 75 35002: 08 f0 brcs .+2 ; 0x35006 35004: 46 c0 rjmp .+140 ; 0x35092 35006: 82 34 cpi r24, 0x42 ; 66 35008: 09 f4 brne .+2 ; 0x3500c 3500a: 43 c0 rjmp .+134 ; 0x35092 3500c: e0 f5 brcc .+120 ; 0x35086 3500e: 8a 30 cpi r24, 0x0A ; 10 35010: 59 f0 breq .+22 ; 0x35028 35012: 8d 30 cpi r24, 0x0D ; 13 35014: 49 f0 breq .+18 ; 0x35028 } else if (IsCRCSeparator(c)) { rspState = ResponseStates::CRC; return DecodeStatus::NeedMoreData; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; 35016: b0 92 6f 13 sts 0x136F, r11 ; 0x80136f 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') { 3501a: a1 10 cpse r10, r1 3501c: 05 c1 rjmp .+522 ; 0x35228 3501e: 1f 36 cpi r17, 0x6F ; 111 35020: 09 f0 breq .+2 ; 0x35024 35022: fc c3 rjmp .+2040 ; 0x3581c ++ok; 35024: aa 24 eor r10, r10 35026: 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; 35028: 4f ef ldi r20, 0xFF ; 255 3502a: c4 1a sub r12, r20 3502c: d4 0a sbc r13, r20 3502e: 84 e9 ldi r24, 0x94 ; 148 35030: 92 e1 ldi r25, 0x12 ; 18 35032: 0f 94 48 da call 0x3b490 ; 0x3b490 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) { 35036: 97 fd sbrc r25, 7 35038: 00 c1 rjmp .+512 ; 0x3523a ++bytesConsumed; RecordReceivedByte(c); 3503a: 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]; 3503c: 20 91 88 13 lds r18, 0x1388 ; 0x801388 35040: 30 e0 ldi r19, 0x00 ; 0 void ProtocolLogic::RecordUARTActivity() { lastUARTActivityMs = _millis(); } void ProtocolLogic::RecordReceivedByte(uint8_t c) { lastReceivedBytes[lrb] = c; 35042: f9 01 movw r30, r18 35044: e5 5b subi r30, 0xB5 ; 181 35046: fc 4e sbci r31, 0xEC ; 236 35048: 85 a7 std Z+45, r24 ; 0x2d lrb = (lrb + 1) % lastReceivedBytes.size(); 3504a: 79 01 movw r14, r18 3504c: ef ef ldi r30, 0xFF ; 255 3504e: ee 1a sub r14, r30 35050: fe 0a sbc r15, r30 35052: ff e0 ldi r31, 0x0F ; 15 35054: ef 22 and r14, r31 35056: ff 24 eor r15, r15 35058: 5e 2c mov r5, r14 3505a: e0 92 88 13 sts 0x1388, r14 ; 0x801388 ++i; return i; } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { 3505e: 20 91 6f 13 lds r18, 0x136F ; 0x80136f 35062: 22 30 cpi r18, 0x02 ; 2 35064: 09 f4 brne .+2 ; 0x35068 35066: 48 c0 rjmp .+144 ; 0x350f8 35068: 08 f0 brcs .+2 ; 0x3506c 3506a: 7b cf rjmp .-266 ; 0x34f62 3506c: 22 23 and r18, r18 3506e: 29 f2 breq .-118 ; 0x34ffa 35070: 21 30 cpi r18, 0x01 ; 1 35072: 51 f1 breq .+84 ; 0x350c8 ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 35074: 1a 30 cpi r17, 0x0A ; 10 35076: 09 f4 brne .+2 ; 0x3507a 35078: 8f cf rjmp .-226 ; 0x34f98 3507a: 1d 30 cpi r17, 0x0D ; 13 3507c: 09 f4 brne .+2 ; 0x35080 3507e: 8c cf rjmp .-232 ; 0x34f98 default: //case error: if (IsNewLine(c)) { rspState = ResponseStates::RequestCode; return DecodeStatus::MessageCompleted; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; 35080: 10 92 75 13 sts 0x1375, r1 ; 0x801375 35084: ca cf rjmp .-108 ; 0x3501a } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 35086: 85 34 cpi r24, 0x45 ; 69 35088: 30 f2 brcs .-116 ; 0x35016 3508a: 87 34 cpi r24, 0x47 ; 71 3508c: 10 f0 brcs .+4 ; 0x35092 3508e: 88 34 cpi r24, 0x48 ; 72 35090: 11 f6 brne .-124 ; 0x35016 case 'K': case 'F': case 'f': case 'H': case 'R': responseMsg.request.code = (RequestMsgCodes)c; 35092: 80 93 70 13 sts 0x1370, r24 ; 0x801370 responseMsg.request.value = 0; 35096: 10 92 71 13 sts 0x1371, r1 ; 0x801371 responseMsg.request.value2 = 0; 3509a: 10 92 73 13 sts 0x1373, r1 ; 0x801373 3509e: 10 92 72 13 sts 0x1372, r1 ; 0x801372 responseMsg.request.crc8 = 0; 350a2: 10 92 74 13 sts 0x1374, r1 ; 0x801374 rspState = ResponseStates::RequestValue; 350a6: 90 92 6f 13 sts 0x136F, r9 ; 0x80136f 350aa: be cf rjmp .-132 ; 0x35028 } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 350ac: 89 35 cpi r24, 0x59 ; 89 350ae: 40 f4 brcc .+16 ; 0x350c0 350b0: 87 35 cpi r24, 0x57 ; 87 350b2: 78 f7 brcc .-34 ; 0x35092 350b4: 20 eb ldi r18, 0xB0 ; 176 350b6: 28 0f add r18, r24 350b8: 26 30 cpi r18, 0x06 ; 6 350ba: 08 f0 brcs .+2 ; 0x350be 350bc: ac cf rjmp .-168 ; 0x35016 350be: e9 cf rjmp .-46 ; 0x35092 350c0: 86 36 cpi r24, 0x66 ; 102 350c2: 09 f0 breq .+2 ; 0x350c6 350c4: a8 cf rjmp .-176 ; 0x35016 350c6: e5 cf rjmp .-54 ; 0x35092 } 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'); 350c8: 20 ed ldi r18, 0xD0 ; 208 350ca: 28 0f add r18, r24 350cc: 2a 30 cpi r18, 0x0A ; 10 350ce: 50 f0 brcs .+20 ; 0x350e4 350d0: 2f e9 ldi r18, 0x9F ; 159 350d2: 28 0f add r18, r24 350d4: 26 30 cpi r18, 0x06 ; 6 350d6: 30 f0 brcs .+12 ; 0x350e4 case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; responseMsg.request.value += Char2Nibble(c); return DecodeStatus::NeedMoreData; } else if (c == ' ') { 350d8: 80 32 cpi r24, 0x20 ; 32 350da: 09 f0 breq .+2 ; 0x350de 350dc: 9c cf rjmp .-200 ; 0x35016 rspState = ResponseStates::ParamCode; 350de: 60 92 6f 13 sts 0x136F, r6 ; 0x80136f 350e2: a2 cf rjmp .-188 ; 0x35028 return DecodeStatus::Error; } case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; responseMsg.request.value += Char2Nibble(c); 350e4: 0f 94 5b c5 call 0x38ab6 ; 0x38ab6 rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; 350e8: 90 91 71 13 lds r25, 0x1371 ; 0x801371 350ec: 92 95 swap r25 350ee: 90 7f andi r25, 0xF0 ; 240 responseMsg.request.value += Char2Nibble(c); 350f0: 89 0f add r24, r25 350f2: 80 93 71 13 sts 0x1371, r24 ; 0x801371 350f6: 98 cf rjmp .-208 ; 0x35028 } else { rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamCode: switch (c) { 350f8: 87 34 cpi r24, 0x47 ; 71 350fa: 48 f4 brcc .+18 ; 0x3510e 350fc: 85 34 cpi r24, 0x45 ; 69 350fe: 58 f4 brcc .+22 ; 0x35116 35100: 2f eb ldi r18, 0xBF ; 191 35102: 28 0f add r18, r24 35104: 22 30 cpi r18, 0x02 ; 2 35106: 38 f0 brcs .+14 ; 0x35116 return DecodeStatus::NeedMoreData; } else if (IsCRCSeparator(c)) { rspState = ResponseStates::CRC; return DecodeStatus::NeedMoreData; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; 35108: 10 92 75 13 sts 0x1375, r1 ; 0x801375 3510c: 84 cf rjmp .-248 ; 0x35016 } else { rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamCode: switch (c) { 3510e: 80 35 cpi r24, 0x50 ; 80 35110: 11 f0 breq .+4 ; 0x35116 35112: 82 35 cpi r24, 0x52 ; 82 35114: c9 f7 brne .-14 ; 0x35108 case 'E': case 'F': case 'A': case 'R': case 'B': rspState = ResponseStates::ParamValue; 35116: 80 92 6f 13 sts 0x136F, r8 ; 0x80136f responseMsg.paramCode = (ResponseMsgParamCodes)c; 3511a: 80 93 75 13 sts 0x1375, r24 ; 0x801375 responseMsg.paramValue = 0; 3511e: 10 92 77 13 sts 0x1377, r1 ; 0x801377 35122: 10 92 76 13 sts 0x1376, r1 ; 0x801376 35126: 80 cf rjmp .-256 ; 0x35028 35128: 20 ed ldi r18, 0xD0 ; 208 3512a: 28 0f add r18, r24 3512c: 2a 30 cpi r18, 0x0A ; 10 3512e: 48 f0 brcs .+18 ; 0x35142 35130: 2f e9 ldi r18, 0x9F ; 159 35132: 28 0f add r18, r24 35134: 26 30 cpi r18, 0x06 ; 6 35136: 28 f0 brcs .+10 ; 0x35142 case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; responseMsg.paramValue += Char2Nibble(c); return DecodeStatus::NeedMoreData; } else if (IsCRCSeparator(c)) { 35138: 8a 32 cpi r24, 0x2A ; 42 3513a: 31 f7 brne .-52 ; 0x35108 rspState = ResponseStates::CRC; 3513c: 70 92 6f 13 sts 0x136F, r7 ; 0x80136f 35140: 73 cf rjmp .-282 ; 0x35028 return DecodeStatus::Error; } case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; responseMsg.paramValue += Char2Nibble(c); 35142: 0f 94 5b c5 call 0x38ab6 ; 0x38ab6 rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; 35146: 20 91 76 13 lds r18, 0x1376 ; 0x801376 3514a: 30 91 77 13 lds r19, 0x1377 ; 0x801377 3514e: 44 e0 ldi r20, 0x04 ; 4 35150: 22 0f add r18, r18 35152: 33 1f adc r19, r19 35154: 4a 95 dec r20 35156: e1 f7 brne .-8 ; 0x35150 responseMsg.paramValue += Char2Nibble(c); 35158: 82 0f add r24, r18 3515a: 93 2f mov r25, r19 3515c: 91 1d adc r25, r1 3515e: 90 93 77 13 sts 0x1377, r25 ; 0x801377 35162: 80 93 76 13 sts 0x1376, r24 ; 0x801376 35166: 60 cf rjmp .-320 ; 0x35028 return DecodeStatus::Error; } case ResponseStates::CRC: if (IsHexDigit(c)) { responseMsg.request.crc8 <<= 4U; responseMsg.request.crc8 += Char2Nibble(c); 35168: 0f 94 5b c5 call 0x38ab6 ; 0x38ab6 rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::CRC: if (IsHexDigit(c)) { responseMsg.request.crc8 <<= 4U; 3516c: 90 91 74 13 lds r25, 0x1374 ; 0x801374 35170: 92 95 swap r25 35172: 90 7f andi r25, 0xF0 ; 240 responseMsg.request.crc8 += Char2Nibble(c); 35174: 89 0f add r24, r25 35176: 80 93 74 13 sts 0x1374, r24 ; 0x801374 3517a: 56 cf rjmp .-340 ; 0x35028 ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 3517c: 8d 30 cpi r24, 0x0D ; 13 3517e: 21 f6 brne .-120 ; 0x35108 35180: 03 cf rjmp .-506 ; 0x34f88 if (b < 32 || b > 127) { b = '.'; } *dst++ = b; } *dst = 0; // terminate properly 35182: e8 0e add r14, r24 35184: f9 1e adc r15, r25 35186: f7 01 movw r30, r14 35188: 10 82 st Z, r1 lrb = 0; // reset the input buffer index in case of a clean message 3518a: 10 92 88 13 sts 0x1388, r1 ; 0x801388 } void ProtocolLogic::LogResponse() { char lrb[lastReceivedBytes.size()]; FormatLastResponseMsgAndClearLRB(lrb); MMU2_ECHO_MSGLN(lrb); 3518e: 82 ec ldi r24, 0xC2 ; 194 35190: 9b ea ldi r25, 0xAB ; 171 35192: 0e 94 50 77 call 0xeea0 ; 0xeea0 35196: 8c eb ldi r24, 0xBC ; 188 35198: 9b ea ldi r25, 0xAB ; 171 3519a: 0e 94 50 77 call 0xeea0 ; 0xeea0 3519e: ce 01 movw r24, r28 351a0: 01 96 adiw r24, 0x01 ; 1 351a2: 0f 94 00 d6 call 0x3ac00 ; 0x3ac00 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 351a6: 0f 94 96 65 call 0x2cb2c ; 0x2cb2c if (auto expmsg = ExpectingMessage(); expmsg != MessageReady) { // this whole statement takes 12B return expmsg; } // process message switch (currentScope) { 351aa: 80 91 4d 13 lds r24, 0x134D ; 0x80134d 351ae: 81 30 cpi r24, 0x01 ; 1 351b0: 09 f4 brne .+2 ; 0x351b4 351b2: 74 c0 rjmp .+232 ; 0x3529c 351b4: 08 f4 brcc .+2 ; 0x351b8 351b6: c5 ce rjmp .-630 ; 0x34f42 351b8: 83 30 cpi r24, 0x03 ; 3 351ba: 09 f4 brne .+2 ; 0x351be 351bc: d1 c0 rjmp .+418 ; 0x35360 351be: 84 30 cpi r24, 0x04 ; 4 351c0: 09 f0 breq .+2 ; 0x351c4 351c2: 4f ce rjmp .-866 ; 0x34e62 return ProtocolError; } } StepStatus ProtocolLogic::CommandStep() { switch (scopeState) { 351c4: 80 91 4e 13 lds r24, 0x134E ; 0x80134e 351c8: 86 30 cpi r24, 0x06 ; 6 351ca: 09 f4 brne .+2 ; 0x351ce 351cc: 6c c1 rjmp .+728 ; 0x354a6 351ce: 08 f0 brcs .+2 ; 0x351d2 351d0: 93 c1 rjmp .+806 ; 0x354f8 351d2: 84 30 cpi r24, 0x04 ; 4 351d4: 09 f4 brne .+2 ; 0x351d8 351d6: 09 c1 rjmp .+530 ; 0x353ea 351d8: 85 30 cpi r24, 0x05 ; 5 351da: 09 f0 breq .+2 ; 0x351de 351dc: cc c0 rjmp .+408 ; 0x35376 case ScopeState::CommandSent: { switch (rsp.paramCode) { // the response should be either accepted or rejected 351de: 80 91 65 13 lds r24, 0x1365 ; 0x801365 351e2: 81 34 cpi r24, 0x41 ; 65 351e4: 09 f4 brne .+2 ; 0x351e8 351e6: 96 c1 rjmp .+812 ; 0x35514 351e8: 82 35 cpi r24, 0x52 ; 82 351ea: 09 f0 breq .+2 ; 0x351ee 351ec: c4 c0 rjmp .+392 ; 0x35376 errorCode = ErrorCode::RUNNING; scopeState = ScopeState::Wait; break; case ResponseMsgParamCodes::Rejected: // rejected - should normally not happen, but report the error up progressCode = ProgressCode::OK; 351ee: 10 92 8d 13 sts 0x138D, r1 ; 0x80138d errorCode = ErrorCode::PROTOCOL_ERROR; 351f2: 8d e2 ldi r24, 0x2D ; 45 351f4: 90 e8 ldi r25, 0x80 ; 128 351f6: 90 93 8c 13 sts 0x138C, r25 ; 0x80138c 351fa: 80 93 8b 13 sts 0x138B, r24 ; 0x80138b } 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")); 351fe: 81 e0 ldi r24, 0x01 ; 1 35200: 99 ea ldi r25, 0xA9 ; 169 35202: 0f 94 b3 65 call 0x2cb66 ; 0x2cb66 void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; } void ProtocolLogic::CommandRestart() { scopeState = ScopeState::CommandSent; 35206: 85 e0 ldi r24, 0x05 ; 5 35208: 80 93 4e 13 sts 0x134E, r24 ; 0x80134e SendMsg(rq); 3520c: 40 91 50 13 lds r20, 0x1350 ; 0x801350 35210: 50 91 51 13 lds r21, 0x1351 ; 0x801351 35214: 60 91 52 13 lds r22, 0x1352 ; 0x801352 35218: 70 91 53 13 lds r23, 0x1353 ; 0x801353 3521c: 80 91 54 13 lds r24, 0x1354 ; 0x801354 35220: 0f 94 9c 66 call 0x2cd38 ; 0x2cd38 35224: 16 e0 ldi r17, 0x06 ; 6 35226: 07 c1 rjmp .+526 ; 0x35436 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') { 35228: 1b 36 cpi r17, 0x6B ; 107 3522a: 09 f0 breq .+2 ; 0x3522e 3522c: f7 c2 rjmp .+1518 ; 0x3581c 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")); 3522e: 82 ee ldi r24, 0xE2 ; 226 35230: 98 ea ldi r25, 0xA8 ; 168 35232: 0f 94 b3 65 call 0x2cb66 ; 0x2cb66 35236: 18 e0 ldi r17, 0x08 ; 8 35238: fe c0 rjmp .+508 ; 0x35436 default: RecordUARTActivity(); // something has happened on the UART, update the timeout record return ProtocolError; } } if (bytesConsumed != 0) { 3523a: cd 28 or r12, r13 3523c: 19 f0 breq .+6 ; 0x35244 RecordUARTActivity(); // something has happened on the UART, update the timeout record 3523e: 0f 94 96 65 call 0x2cb2c ; 0x2cb2c 35242: 7f ce rjmp .-770 ; 0x34f42 IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 35244: 0f 94 4c 29 call 0x25298 ; 0x25298 35248: ab 01 movw r20, r22 3524a: bc 01 movw r22, r24 3524c: 80 91 5a 13 lds r24, 0x135A ; 0x80135a 35250: 90 91 5b 13 lds r25, 0x135B ; 0x80135b 35254: a0 91 5c 13 lds r26, 0x135C ; 0x80135c 35258: b0 91 5d 13 lds r27, 0x135D ; 0x80135d 3525c: 80 53 subi r24, 0x30 ; 48 3525e: 98 4f sbci r25, 0xF8 ; 248 35260: af 4f sbci r26, 0xFF ; 255 35262: 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) { 35264: 48 17 cp r20, r24 35266: 59 07 cpc r21, r25 35268: 6a 07 cpc r22, r26 3526a: 7b 07 cpc r23, r27 3526c: 08 f4 brcc .+2 ; 0x35270 3526e: 69 ce rjmp .-814 ; 0x34f42 35270: 80 91 4d 13 lds r24, 0x134D ; 0x80134d 35274: 88 23 and r24, r24 35276: 09 f4 brne .+2 ; 0x3527a 35278: 64 ce rjmp .-824 ; 0x34f42 rqState = RequestStates::Code; } /// resets the internal response decoding state (typically after an error) void ResetResponseDecoder() { rspState = ResponseStates::RequestCode; 3527a: 10 92 6f 13 sts 0x136F, r1 ; 0x80136f initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 3527e: 81 e0 ldi r24, 0x01 ; 1 35280: 80 93 68 13 sts 0x1368, r24 ; 0x801368 currentScope = Scope::StartSeq; 35284: 80 93 4d 13 sts 0x134D, r24 ; 0x80134d LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 35288: 86 e0 ldi r24, 0x06 ; 6 3528a: 80 93 4f 13 sts 0x134F, r24 ; 0x80134f SendVersion(0); 3528e: 80 e0 ldi r24, 0x00 ; 0 35290: 0f 94 7c a5 call 0x34af8 ; 0x34af8 StepStatus ProtocolLogic::HandleCommunicationTimeout() { uart->flush(); // clear the output buffer protocol.ResetResponseDecoder(); Start(); return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); 35294: 64 e0 ldi r22, 0x04 ; 4 35296: 8a eb ldi r24, 0xBA ; 186 35298: 98 ea ldi r25, 0xA8 ; 168 3529a: 79 c0 rjmp .+242 ; 0x3538e return Finished; } StepStatus ProtocolLogic::StartSeqStep() { // solve initial handshake switch (scopeState) { 3529c: 10 91 4e 13 lds r17, 0x134E ; 0x80134e 352a0: 13 30 cpi r17, 0x03 ; 3 352a2: b1 f1 breq .+108 ; 0x35310 352a4: 60 f0 brcs .+24 ; 0x352be 352a6: 16 30 cpi r17, 0x06 ; 6 352a8: 09 f4 brne .+2 ; 0x352ac 352aa: 50 c0 rjmp .+160 ; 0x3534c 352ac: 19 30 cpi r17, 0x09 ; 9 352ae: 09 f0 breq .+2 ; 0x352b2 352b0: be cf rjmp .-132 ; 0x3522e // Start General Interrogation after line up - initial parametrization is started StartWritingInitRegisters(); } return Processing; case ScopeState::WritingInitRegisters: if (ProcessWritingInitRegister()) { 352b2: 0f 94 c6 67 call 0x2cf8c ; 0x2cf8c 352b6: 88 23 and r24, r24 352b8: 09 f4 brne .+2 ; 0x352bc 352ba: 43 ce rjmp .-890 ; 0x34f42 352bc: 40 ce rjmp .-896 ; 0x34f3e void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; } StepStatus ProtocolLogic::ProcessVersionResponse(uint8_t stage) { if (rsp.request.code != RequestMsgCodes::Version || rsp.request.value != stage) { 352be: 80 91 60 13 lds r24, 0x1360 ; 0x801360 352c2: 83 35 cpi r24, 0x53 ; 83 352c4: 21 f4 brne .+8 ; 0x352ce 352c6: 80 91 61 13 lds r24, 0x1361 ; 0x801361 352ca: 18 17 cp r17, r24 352cc: 11 f0 breq .+4 ; 0x352d2 mmuFwVersion[stage] = rsp.paramValue; if (mmuFwVersion[stage] != pgm_read_byte(supportedMmuFWVersion + stage)) { if (--retries == 0) { return VersionMismatch; } else { SendVersion(stage); 352ce: 81 2f mov r24, r17 352d0: fe cd rjmp .-1028 ; 0x34ece 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; 352d2: 80 91 66 13 lds r24, 0x1366 ; 0x801366 352d6: e1 2f mov r30, r17 352d8: f0 e0 ldi r31, 0x00 ; 0 352da: df 01 movw r26, r30 352dc: a6 56 subi r26, 0x66 ; 102 352de: bc 4e sbci r27, 0xEC ; 236 352e0: 8c 93 st X, r24 if (mmuFwVersion[stage] != pgm_read_byte(supportedMmuFWVersion + stage)) { 352e2: e1 52 subi r30, 0x21 ; 33 352e4: f7 45 sbci r31, 0x57 ; 87 352e6: e4 91 lpm r30, Z 352e8: 8e 17 cp r24, r30 352ea: 41 f0 breq .+16 ; 0x352fc if (--retries == 0) { 352ec: 80 91 4f 13 lds r24, 0x134F ; 0x80134f 352f0: 81 50 subi r24, 0x01 ; 1 352f2: 80 93 4f 13 sts 0x134F, r24 ; 0x80134f 352f6: 81 11 cpse r24, r1 352f8: ea cf rjmp .-44 ; 0x352ce 352fa: 99 cf rjmp .-206 ; 0x3522e SERIAL_ECHOLNPGM("ResetRetryAttempts"); retryAttempts = MAX_RETRIES; } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 352fc: 85 e6 ldi r24, 0x65 ; 101 352fe: 9b ea ldi r25, 0xAB ; 171 35300: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 /// @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; } 35304: 8a e0 ldi r24, 0x0A ; 10 35306: 80 93 5f 13 sts 0x135F, r24 ; 0x80135f } else { SendVersion(stage); } } else { ResetCommunicationTimeoutAttempts(); // got a meaningful response from the MMU, stop data layer timeout tracking SendVersion(stage + 1); 3530a: 81 e0 ldi r24, 0x01 ; 1 3530c: 81 0f add r24, r17 3530e: df cd rjmp .-1090 ; 0x34ece 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) { 35310: 80 91 60 13 lds r24, 0x1360 ; 0x801360 35314: 83 35 cpi r24, 0x53 ; 83 35316: 21 f4 brne .+8 ; 0x35320 35318: 80 91 61 13 lds r24, 0x1361 ; 0x801361 3531c: 83 30 cpi r24, 0x03 ; 3 3531e: 11 f0 breq .+4 ; 0x35324 // got a response to something else - protocol corruption probably, repeat the query OR restart the comm by issuing S0? SendVersion(3); 35320: 83 e0 ldi r24, 0x03 ; 3 35322: d5 cd rjmp .-1110 ; 0x34ece } else { mmuFwVersionBuild = rsp.paramValue; // just register the build number 35324: 80 91 66 13 lds r24, 0x1366 ; 0x801366 35328: 90 91 67 13 lds r25, 0x1367 ; 0x801367 3532c: 90 93 9e 13 sts 0x139E, r25 ; 0x80139e 35330: 80 93 9d 13 sts 0x139D, r24 ; 0x80139d } return ScopeState::Reading16bitRegisters; } void ProtocolLogic::StartWritingInitRegisters() { regIndex = 0; 35334: 10 92 99 13 sts 0x1399, r1 ; 0x801399 SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); 35338: e3 e6 ldi r30, 0x63 ; 99 3533a: fb ea ldi r31, 0xAB ; 171 3533c: 84 91 lpm r24, Z 3533e: 60 91 97 13 lds r22, 0x1397 ; 0x801397 35342: 70 e0 ldi r23, 0x00 ; 0 35344: 49 e0 ldi r20, 0x09 ; 9 35346: 0f 94 07 67 call 0x2ce0e ; 0x2ce0e 3534a: fb cd rjmp .-1034 ; 0x34f42 currentScope = Scope::Idle; IdleRestart(); } void ProtocolLogic::SwitchFromStartToIdle() { state = State::Running; 3534c: 82 e0 ldi r24, 0x02 ; 2 3534e: 80 93 68 13 sts 0x1368, r24 ; 0x801368 currentScope = Scope::Idle; 35352: 83 e0 ldi r24, 0x03 ; 3 35354: 80 93 4d 13 sts 0x134D, r24 ; 0x80134d scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 35358: 82 e8 ldi r24, 0x82 ; 130 3535a: 80 93 4e 13 sts 0x134E, r24 ; 0x80134e 3535e: d2 cd rjmp .-1116 ; 0x34f04 } return Finished; } StepStatus ProtocolLogic::IdleStep() { switch (scopeState) { 35360: 80 91 4e 13 lds r24, 0x134E ; 0x80134e 35364: 88 30 cpi r24, 0x08 ; 8 35366: 09 f4 brne .+2 ; 0x3536a 35368: b7 c0 rjmp .+366 ; 0x354d8 3536a: a8 f4 brcc .+42 ; 0x35396 3536c: 84 30 cpi r24, 0x04 ; 4 3536e: d9 f0 breq .+54 ; 0x353a6 35370: 87 30 cpi r24, 0x07 ; 7 35372: 09 f4 brne .+2 ; 0x35376 35374: ae c0 rjmp .+348 ; 0x354d2 return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); } StepStatus ProtocolLogic::HandleProtocolError() { uart->flush(); // clear the output buffer state = State::InitSequence; 35376: 81 e0 ldi r24, 0x01 ; 1 35378: 80 93 68 13 sts 0x1368, r24 ; 0x801368 currentScope = Scope::DelayedRestart; 3537c: 82 e0 ldi r24, 0x02 ; 2 3537e: 80 93 4d 13 sts 0x134D, r24 ; 0x80134d retries = maxRetries; SendVersion(0); } void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; 35382: 83 e8 ldi r24, 0x83 ; 131 35384: 80 93 4e 13 sts 0x134E, r24 ; 0x80134e StepStatus ProtocolLogic::HandleProtocolError() { uart->flush(); // clear the output buffer state = State::InitSequence; currentScope = Scope::DelayedRestart; DelayedRestartRestart(); return SuppressShortDropOuts(PSTR("Protocol Error"), ProtocolError); 35388: 65 e0 ldi r22, 0x05 ; 5 3538a: 80 ed ldi r24, 0xD0 ; 208 3538c: 98 ea ldi r25, 0xA8 ; 168 StepStatus ProtocolLogic::HandleCommunicationTimeout() { uart->flush(); // clear the output buffer protocol.ResetResponseDecoder(); Start(); return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); 3538e: 0f 94 24 66 call 0x2cc48 ; 0x2cc48 35392: 18 2f mov r17, r24 35394: 50 c0 rjmp .+160 ; 0x35436 } return Finished; } StepStatus ProtocolLogic::IdleStep() { switch (scopeState) { 35396: 8a 30 cpi r24, 0x0A ; 10 35398: 09 f4 brne .+2 ; 0x3539c 3539a: a7 c0 rjmp .+334 ; 0x354ea 3539c: 60 f3 brcs .-40 ; 0x35376 3539e: 8d 30 cpi r24, 0x0D ; 13 353a0: 08 f4 brcc .+2 ; 0x353a4 353a2: 5f cd rjmp .-1346 ; 0x34e62 353a4: e8 cf rjmp .-48 ; 0x35376 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) { 353a6: 80 91 60 13 lds r24, 0x1360 ; 0x801360 353aa: 8e 34 cpi r24, 0x4E ; 78 353ac: 60 f5 brcc .+88 ; 0x35406 353ae: 8b 34 cpi r24, 0x4B ; 75 353b0: 10 f4 brcc .+4 ; 0x353b6 353b2: 85 34 cpi r24, 0x45 ; 69 353b4: 01 f7 brne .-64 ; 0x35376 case RequestMsgCodes::Eject: case RequestMsgCodes::Load: case RequestMsgCodes::Mode: case RequestMsgCodes::Tool: case RequestMsgCodes::Unload: if (rsp.paramCode != ResponseMsgParamCodes::Finished) { 353b6: 80 91 65 13 lds r24, 0x1365 ; 0x801365 353ba: 86 34 cpi r24, 0x46 ; 70 353bc: 09 f4 brne .+2 ; 0x353c0 353be: 73 c0 rjmp .+230 ; 0x354a6 return true; } } StepStatus ProtocolLogic::SwitchFromIdleToCommand() { currentScope = Scope::Command; 353c0: 84 e0 ldi r24, 0x04 ; 4 353c2: 80 93 4d 13 sts 0x134D, r24 ; 0x80134d 353c6: 85 e0 ldi r24, 0x05 ; 5 353c8: e0 e6 ldi r30, 0x60 ; 96 353ca: f3 e1 ldi r31, 0x13 ; 19 353cc: de 01 movw r26, r28 353ce: 11 96 adiw r26, 0x01 ; 1 353d0: 01 90 ld r0, Z+ 353d2: 0d 92 st X+, r0 353d4: 8a 95 dec r24 353d6: e1 f7 brne .-8 ; 0x353d0 StepStatus StoppedStep() { return Processing; } StepStatus ProcessCommandQueryResponse(); inline void SetRequestMsg(RequestMsg msg) { rq = msg; 353d8: 85 e0 ldi r24, 0x05 ; 5 353da: fe 01 movw r30, r28 353dc: 31 96 adiw r30, 0x01 ; 1 353de: a0 e5 ldi r26, 0x50 ; 80 353e0: b3 e1 ldi r27, 0x13 ; 19 353e2: 01 90 ld r0, Z+ 353e4: 0d 92 st X+, r0 353e6: 8a 95 dec r24 353e8: e1 f7 brne .-8 ; 0x353e2 default: return ProtocolError; } } break; case ScopeState::QuerySent: return ProcessCommandQueryResponse(); 353ea: 0f 94 df a5 call 0x34bbe ; 0x34bbe 353ee: 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) { 353f0: 85 30 cpi r24, 0x05 ; 5 353f2: 09 f2 breq .-126 ; 0x35376 353f4: 08 f0 brcs .+2 ; 0x353f8 353f6: 9c c0 rjmp .+312 ; 0x35530 353f8: 82 30 cpi r24, 0x02 ; 2 353fa: 09 f4 brne .+2 ; 0x353fe 353fc: 32 cd rjmp .-1436 ; 0x34e62 353fe: 84 30 cpi r24, 0x04 ; 4 35400: 09 f4 brne .+2 ; 0x35404 35402: 3b cf rjmp .-394 ; 0x3527a 35404: 18 c0 rjmp .+48 ; 0x35436 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) { 35406: 84 35 cpi r24, 0x54 ; 84 35408: 08 f4 brcc .+2 ; 0x3540c 3540a: b5 cf rjmp .-150 ; 0x35376 3540c: 86 35 cpi r24, 0x56 ; 86 3540e: 98 f2 brcs .-90 ; 0x353b6 35410: 88 35 cpi r24, 0x58 ; 88 35412: 09 f0 breq .+2 ; 0x35416 35414: b0 cf rjmp .-160 ; 0x35376 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) { 35416: 80 91 65 13 lds r24, 0x1365 ; 0x801365 3541a: 86 34 cpi r24, 0x46 ; 70 3541c: 89 f1 breq .+98 ; 0x35480 3541e: 80 35 cpi r24, 0x50 ; 80 35420: c1 f1 breq .+112 ; 0x35492 35422: 82 34 cpi r24, 0x42 ; 66 35424: 09 f0 breq .+2 ; 0x35428 35426: 42 c0 rjmp .+132 ; 0x354ac 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); 35428: 80 91 66 13 lds r24, 0x1366 ; 0x801366 3542c: 80 93 8e 13 sts 0x138E, r24 ; 0x80138e StartReading8bitRegisters(); 35430: 0f 94 8d a4 call 0x3491a ; 0x3491a return ButtonPushed; 35434: 1b e0 ldi r17, 0x0B ; 11 35436: 80 91 4b 13 lds r24, 0x134B ; 0x80134b 3543a: 90 91 4c 13 lds r25, 0x134C ; 0x80134c break; default: break; } // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; 3543e: 81 30 cpi r24, 0x01 ; 1 35440: 91 05 cpc r25, r1 35442: 09 f0 breq .+2 ; 0x35446 35444: ee c1 rjmp .+988 ; 0x35822 const StepStatus ss = logic.Step(); switch (ss) { 35446: 12 30 cpi r17, 0x02 ; 2 35448: 09 f4 brne .+2 ; 0x3544c 3544a: 90 c0 rjmp .+288 ; 0x3556c 3544c: 08 f0 brcs .+2 ; 0x35450 3544e: 7d c0 rjmp .+250 ; 0x3554a 35450: 11 23 and r17, r17 35452: 09 f4 brne .+2 ; 0x35456 35454: 18 c1 rjmp .+560 ; 0x35686 case Interrupted: // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { 35456: 00 23 and r16, r16 35458: 09 f4 brne .+2 ; 0x3545c 3545a: e4 c0 rjmp .+456 ; 0x35624 switch (ss) { 3545c: 17 30 cpi r17, 0x07 ; 7 3545e: 09 f4 brne .+2 ; 0x35462 35460: c4 c1 rjmp .+904 ; 0x357ea 35462: 08 f0 brcs .+2 ; 0x35466 35464: b8 c1 rjmp .+880 ; 0x357d6 35466: 14 30 cpi r17, 0x04 ; 4 35468: 09 f4 brne .+2 ; 0x3546c 3546a: c7 c1 rjmp .+910 ; 0x357fa 3546c: 15 30 cpi r17, 0x05 ; 5 3546e: 09 f0 breq .+2 ; 0x35472 35470: d9 c0 rjmp .+434 ; 0x35624 state = xState::Connecting; ReportError(ErrorCode::MMU_NOT_RESPONDING, ErrorSourcePrinter); break; case ProtocolError: state = xState::Connecting; 35472: 82 e0 ldi r24, 0x02 ; 2 35474: 80 93 ba 13 sts 0x13BA, r24 ; 0x8013ba ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); 35478: 60 e0 ldi r22, 0x00 ; 0 3547a: 8d e2 ldi r24, 0x2D ; 45 3547c: 90 e8 ldi r25, 0x80 ; 128 3547e: ba c1 rjmp .+884 ; 0x357f4 // 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) { 35480: 80 91 50 13 lds r24, 0x1350 ; 0x801350 35484: 88 23 and r24, r24 35486: 29 f0 breq .+10 ; 0x35492 scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 35488: 82 e8 ldi r24, 0x82 ; 130 3548a: 80 93 4e 13 sts 0x134E, r24 ; 0x80134e 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; 3548e: 13 e0 ldi r17, 0x03 ; 3 35490: d2 cf rjmp .-92 ; 0x35436 } [[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); 35492: 80 91 66 13 lds r24, 0x1366 ; 0x801366 35496: 80 93 8d 13 sts 0x138D, r24 ; 0x80138d errorCode = ErrorCode::OK; 3549a: 81 e0 ldi r24, 0x01 ; 1 3549c: 90 e0 ldi r25, 0x00 ; 0 3549e: 90 93 8c 13 sts 0x138C, r25 ; 0x80138c 354a2: 80 93 8b 13 sts 0x138B, r24 ; 0x80138b } } break; case ScopeState::QuerySent: return ProcessCommandQueryResponse(); case ScopeState::FilamentSensorStateSent: StartReading8bitRegisters(); 354a6: 0f 94 8d a4 call 0x3491a ; 0x3491a 354aa: 4b cd rjmp .-1386 ; 0x34f42 // 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; 354ac: 8c e0 ldi r24, 0x0C ; 12 354ae: 80 93 8d 13 sts 0x138D, r24 ; 0x80138d errorCode = static_cast(rsp.paramValue); 354b2: 80 91 66 13 lds r24, 0x1366 ; 0x801366 354b6: 90 91 67 13 lds r25, 0x1367 ; 0x801367 354ba: 90 93 8c 13 sts 0x138C, r25 ; 0x80138c 354be: 80 93 8b 13 sts 0x138B, r24 ; 0x80138b StartReading8bitRegisters(); // continue Idle state without restarting the communication 354c2: 0f 94 8d a4 call 0x3491a ; 0x3491a // @@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")); 354c6: 83 ef ldi r24, 0xF3 ; 243 354c8: 98 ea ldi r25, 0xA8 ; 168 354ca: 0f 94 b3 65 call 0x2cb66 ; 0x2cb66 354ce: 17 e0 ldi r17, 0x07 ; 7 354d0: b2 cf rjmp .-156 ; 0x35436 return ProtocolError; } StartReading8bitRegisters(); return Processing; case ScopeState::Reading8bitRegisters: ProcessRead8bitRegister(); 354d2: 0f 94 b1 a4 call 0x34962 ; 0x34962 354d6: 35 cd rjmp .-1430 ; 0x34f42 return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Ready); 354d8: 82 e8 ldi r24, 0x82 ; 130 354da: 0f 94 95 a4 call 0x3492a ; 0x3492a 354de: 80 93 4e 13 sts 0x134E, r24 ; 0x80134e return scopeState == ScopeState::Ready ? Finished : Processing; 354e2: 82 38 cpi r24, 0x82 ; 130 354e4: 09 f0 breq .+2 ; 0x354e8 354e6: 2d cd rjmp .-1446 ; 0x34f42 354e8: bc cc rjmp .-1672 ; 0x34e62 case ScopeState::ButtonSent: if (rsp.paramCode == ResponseMsgParamCodes::Accepted) { 354ea: 80 91 65 13 lds r24, 0x1365 ; 0x801365 354ee: 81 34 cpi r24, 0x41 ; 65 354f0: d1 f6 brne .-76 ; 0x354a6 // Button was accepted, decrement the retry. DecrementRetryAttempts(); 354f2: 0f 94 a1 65 call 0x2cb42 ; 0x2cb42 354f6: d7 cf rjmp .-82 ; 0x354a6 return ProtocolError; } } StepStatus ProtocolLogic::CommandStep() { switch (scopeState) { 354f8: 88 30 cpi r24, 0x08 ; 8 354fa: b1 f0 breq .+44 ; 0x35528 354fc: 50 f3 brcs .-44 ; 0x354d2 354fe: 8a 30 cpi r24, 0x0A ; 10 35500: 09 f0 breq .+2 ; 0x35504 35502: 39 cf rjmp .-398 ; 0x35376 return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Wait); return Processing; case ScopeState::ButtonSent: if (rsp.paramCode == ResponseMsgParamCodes::Accepted) { 35504: 80 91 65 13 lds r24, 0x1365 ; 0x801365 35508: 81 34 cpi r24, 0x41 ; 65 3550a: 09 f0 breq .+2 ; 0x3550e 3550c: 18 cd rjmp .-1488 ; 0x34f3e // Button was accepted, decrement the retry. DecrementRetryAttempts(); 3550e: 0f 94 a1 65 call 0x2cb42 ; 0x2cb42 35512: 15 cd rjmp .-1494 ; 0x34f3e 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; 35514: 10 92 8d 13 sts 0x138D, r1 ; 0x80138d errorCode = ErrorCode::RUNNING; 35518: 10 92 8c 13 sts 0x138C, r1 ; 0x80138c 3551c: 10 92 8b 13 sts 0x138B, r1 ; 0x80138b scopeState = ScopeState::Wait; 35520: 81 e8 ldi r24, 0x81 ; 129 return Processing; case ScopeState::Reading8bitRegisters: ProcessRead8bitRegister(); return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Wait); 35522: 80 93 4e 13 sts 0x134E, r24 ; 0x80134e 35526: 0d cd rjmp .-1510 ; 0x34f42 35528: 81 e8 ldi r24, 0x81 ; 129 3552a: 0f 94 95 a4 call 0x3492a ; 0x3492a 3552e: f9 cf rjmp .-14 ; 0x35522 StepStatus ProtocolLogic::Step() { if (!ExpectsResponse()) { // if not waiting for a response, activate a planned request immediately ActivatePlannedRequest(); } auto currentStatus = ScopeStep(); switch (currentStatus) { 35530: 87 30 cpi r24, 0x07 ; 7 35532: 49 f2 breq .-110 ; 0x354c6 35534: 08 f4 brcc .+2 ; 0x35538 35536: 63 ce rjmp .-826 ; 0x351fe 35538: 88 30 cpi r24, 0x08 ; 8 3553a: 09 f4 brne .+2 ; 0x3553e 3553c: 78 ce rjmp .-784 ; 0x3522e 3553e: 7b cf rjmp .-266 ; 0x35436 // 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()) { 35540: 80 91 4e 13 lds r24, 0x134E ; 0x80134e 35544: 87 fd sbrc r24, 7 35546: 9a cc rjmp .-1740 ; 0x34e7c 35548: fc cc rjmp .-1544 ; 0x34f42 StepStatus MMU2::LogicStep(bool reportErrors) { // Process any buttons before proceeding with another MMU Query CheckUserInput(); const StepStatus ss = logic.Step(); switch (ss) { 3554a: 13 30 cpi r17, 0x03 ; 3 3554c: 09 f4 brne .+2 ; 0x35550 3554e: 6a c0 rjmp .+212 ; 0x35624 35550: 1b 30 cpi r17, 0x0B ; 11 35552: 09 f0 breq .+2 ; 0x35556 35554: 80 cf rjmp .-256 ; 0x35456 case Processing: OnMMUProgressMsg(logic.Progress()); break; case ButtonPushed: lastButton = logic.Button(); 35556: 80 91 8e 13 lds r24, 0x138E ; 0x80138e 3555a: 80 93 b5 13 sts 0x13B5, r24 ; 0x8013b5 LogEchoEvent_P(PSTR("MMU Button pushed")); 3555e: 82 e1 ldi r24, 0x12 ; 18 35560: 99 ea ldi r25, 0xA9 ; 169 35562: 0f 94 d5 c5 call 0x38baa ; 0x38baa CheckUserInput(); // Process the button immediately 35566: 0f 94 49 a6 call 0x34c92 ; 0x34c92 3556a: 5c c0 rjmp .+184 ; 0x35624 CheckErrorScreenUserInput(); } void MMU2::CheckFINDARunout() { // Check for FINDA filament runout if (!FindaDetectsFilament() && check_fsensor()) { // Check if we have filament runout detected from sensors 3556c: 80 91 90 13 lds r24, 0x1390 ; 0x801390 35570: 81 11 cpse r24, r1 35572: 58 c0 rjmp .+176 ; 0x35624 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() 35574: 0e 94 90 67 call 0xcf20 ; 0xcf20 && mcode_in_progress != 600 && !saved_printing && !mesh_bed_leveling_flag && !homing_flag && e_active(); 35578: 88 23 and r24, r24 3557a: 09 f4 brne .+2 ; 0x3557e 3557c: 53 c0 rjmp .+166 ; 0x35624 } // Currently only used in one place, allowed to be inlined bool check_fsensor() { return printJobOngoing() && mcode_in_progress != 600 3557e: 80 91 aa 0d lds r24, 0x0DAA ; 0x800daa <_ZL17mcode_in_progress.lto_priv.530> 35582: 90 91 ab 0d lds r25, 0x0DAB ; 0x800dab <_ZL17mcode_in_progress.lto_priv.530+0x1> 35586: 88 35 cpi r24, 0x58 ; 88 35588: 92 40 sbci r25, 0x02 ; 2 3558a: 09 f4 brne .+2 ; 0x3558e 3558c: 4b c0 rjmp .+150 ; 0x35624 && !saved_printing 3558e: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 35592: 81 11 cpse r24, r1 35594: 47 c0 rjmp .+142 ; 0x35624 && !mesh_bed_leveling_flag 35596: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 3559a: 81 11 cpse r24, r1 3559c: 43 c0 rjmp .+134 ; 0x35624 && !homing_flag 3559e: 80 91 a7 0d lds r24, 0x0DA7 ; 0x800da7 355a2: 81 11 cpse r24, r1 355a4: 3f c0 rjmp .+126 ; 0x35624 bool e_active() { unsigned char e_active = 0; block_t *block; if(block_buffer_tail != block_buffer_head) 355a6: 90 91 a6 0d lds r25, 0x0DA6 ; 0x800da6 355aa: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 355ae: 98 17 cp r25, r24 355b0: c9 f1 breq .+114 ; 0x35624 { uint8_t block_index = block_buffer_tail; 355b2: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 } #endif bool e_active() { unsigned char e_active = 0; 355b6: 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++; 355b8: 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) 355ba: 30 91 a5 0d lds r19, 0x0DA5 ; 0x800da5 355be: 38 17 cp r19, r24 355c0: 89 f0 breq .+34 ; 0x355e4 { block = &block_buffer[block_index]; if(block->steps[E_AXIS].wide != 0) e_active++; 355c2: 28 9f mul r18, r24 355c4: f0 01 movw r30, r0 355c6: 11 24 eor r1, r1 355c8: eb 53 subi r30, 0x3B ; 59 355ca: f9 4f sbci r31, 0xF9 ; 249 355cc: 44 85 ldd r20, Z+12 ; 0x0c 355ce: 55 85 ldd r21, Z+13 ; 0x0d 355d0: 66 85 ldd r22, Z+14 ; 0x0e 355d2: 77 85 ldd r23, Z+15 ; 0x0f 355d4: 45 2b or r20, r21 355d6: 46 2b or r20, r22 355d8: 47 2b or r20, r23 355da: 09 f0 breq .+2 ; 0x355de 355dc: 9f 5f subi r25, 0xFF ; 255 block_index = (block_index+1) & (BLOCK_BUFFER_SIZE - 1); 355de: 8f 5f subi r24, 0xFF ; 255 355e0: 8f 70 andi r24, 0x0F ; 15 355e2: eb cf rjmp .-42 ; 0x355ba && e_active(); 355e4: 99 23 and r25, r25 355e6: f1 f0 breq .+60 ; 0x35624 SERIAL_ECHOLNPGM("FINDA filament runout!"); 355e8: 83 ea ldi r24, 0xA3 ; 163 355ea: 98 ea ldi r25, 0xA8 ; 168 355ec: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 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); 355f0: 20 e0 ldi r18, 0x00 ; 0 355f2: 30 e0 ldi r19, 0x00 ; 0 355f4: a9 01 movw r20, r18 355f6: ca 01 movw r24, r20 355f8: b9 01 movw r22, r18 355fa: 0e 94 37 89 call 0x1126e ; 0x1126e marlin_stop_and_save_print_to_ram(); restore_print_from_ram_and_continue(0); 355fe: 60 e0 ldi r22, 0x00 ; 0 35600: 70 e0 ldi r23, 0x00 ; 0 35602: cb 01 movw r24, r22 35604: 0e 94 44 68 call 0xd088 ; 0xd088 } } bool SpoolJoin::isSpoolJoinEnabled() { if(eeprom_read_byte((uint8_t*)EEPROM_SPOOL_JOIN) == (uint8_t)EEPROM::Enabled) { 35608: 86 ed ldi r24, 0xD6 ; 214 3560a: 9e e0 ldi r25, 0x0E ; 14 3560c: 0f 94 1c dc call 0x3b838 ; 0x3b838 35610: 81 30 cpi r24, 0x01 ; 1 35612: 21 f4 brne .+8 ; 0x3561c if (SpoolJoin::spooljoin.isSpoolJoinEnabled() && get_current_tool() != (uint8_t)FILAMENT_UNKNOWN){ // Can't auto if F=? 35614: 0f 94 b9 74 call 0x2e972 ; 0x2e972 35618: 8f 3f cpi r24, 0xFF ; 255 3561a: 91 f5 brne .+100 ; 0x35680 enquecommand_front_P(PSTR("M600 AUTO")); // save print and run M600 command } else { enquecommand_front_P(MSG_M600); // save print and run M600 command 3561c: 8b ee ldi r24, 0xEB ; 235 3561e: 90 e7 ldi r25, 0x70 ; 112 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 35620: 0f 94 fd 74 call 0x2e9fa ; 0x2e9fa break; } } } if (logic.Running()) { 35624: 80 91 68 13 lds r24, 0x1368 ; 0x801368 35628: 82 30 cpi r24, 0x02 ; 2 3562a: 19 f4 brne .+6 ; 0x35632 state = xState::Active; 3562c: 81 e0 ldi r24, 0x01 ; 1 3562e: 80 93 ba 13 sts 0x13BA, r24 ; 0x8013ba 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 35632: 10 93 b9 13 sts 0x13B9, r17 ; 0x8013b9 // 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) { 35636: 80 91 c3 06 lds r24, 0x06C3 ; 0x8006c3 <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.490> 3563a: 88 23 and r24, r24 3563c: 51 f0 breq .+20 ; 0x35652 bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { if (putErrorScreenToSleep) return; 3563e: 80 91 ad 0d lds r24, 0x0DAD ; 0x800dad <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.496> 35642: 81 11 cpse r24, r1 35644: 06 c0 rjmp .+12 ; 0x35652 35646: 80 91 b2 13 lds r24, 0x13B2 ; 0x8013b2 3564a: 90 91 b3 13 lds r25, 0x13B3 ; 0x8013b3 3564e: 0f 94 3d c7 call 0x38e7a ; 0x38e7a CheckErrorScreenUserInput(); } 35652: a0 96 adiw r28, 0x20 ; 32 35654: 0f b6 in r0, 0x3f ; 63 35656: f8 94 cli 35658: de bf out 0x3e, r29 ; 62 3565a: 0f be out 0x3f, r0 ; 63 3565c: cd bf out 0x3d, r28 ; 61 3565e: df 91 pop r29 35660: cf 91 pop r28 35662: 1f 91 pop r17 35664: 0f 91 pop r16 35666: ff 90 pop r15 35668: ef 90 pop r14 3566a: df 90 pop r13 3566c: cf 90 pop r12 3566e: bf 90 pop r11 35670: af 90 pop r10 35672: 9f 90 pop r9 35674: 8f 90 pop r8 35676: 7f 90 pop r7 35678: 6f 90 pop r6 3567a: 5f 90 pop r5 3567c: 4f 90 pop r4 3567e: 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 35680: 89 e9 ldi r24, 0x99 ; 153 35682: 98 ea ldi r25, 0xA8 ; 168 35684: cd cf rjmp .-102 ; 0x35620 35686: 00 91 8d 13 lds r16, 0x138D ; 0x80138d ReportProgressHook((CommandInProgress)logic.CommandInProgress(), pc); LogEchoEvent_P(_O(ProgressCodeToText(pc))); } void MMU2::OnMMUProgressMsg(ProgressCode pc) { if (pc != lastProgressCode) { 3568a: 80 91 b1 13 lds r24, 0x13B1 ; 0x8013b1 3568e: 08 17 cp r16, r24 35690: 09 f4 brne .+2 ; 0x35694 35692: 49 c0 rjmp .+146 ; 0x35726 // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { 35694: 80 91 4d 13 lds r24, 0x134D ; 0x80134d 35698: 84 30 cpi r24, 0x04 ; 4 3569a: b9 f4 brne .+46 ; 0x356ca break; } } void ReportProgressHook(CommandInProgress cip, ProgressCode ec) { if (cip != CommandInProgress::NoCommand) { 3569c: 80 91 50 13 lds r24, 0x1350 ; 0x801350 356a0: 88 23 and r24, r24 356a2: 99 f0 breq .+38 ; 0x356ca custom_message_type = CustomMsg::MMUProgress; 356a4: 89 e0 ldi r24, 0x09 ; 9 356a6: 80 93 c4 06 sts 0x06C4, r24 ; 0x8006c4 : static_cast(pgm_read_ptr(&progressTexts[0])); 356aa: ef e5 ldi r30, 0x5F ; 95 356ac: 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])) 356ae: 0e 31 cpi r16, 0x1E ; 30 356b0: 30 f4 brcc .+12 ; 0x356be 356b2: e0 2f mov r30, r16 356b4: f0 e0 ldi r31, 0x00 ; 0 356b6: ee 0f add r30, r30 356b8: ff 1f adc r31, r31 356ba: e1 5a subi r30, 0xA1 ; 161 356bc: f7 45 sbci r31, 0x57 ; 87 : static_cast(pgm_read_ptr(&progressTexts[0])); 356be: 85 91 lpm r24, Z+ 356c0: 94 91 lpm r25, Z lcd_setstatuspgm( _T(ProgressCodeToText(ec)) ); 356c2: 0e 94 ac 72 call 0xe558 ; 0xe558 356c6: 0e 94 5d f1 call 0x1e2ba ; 0x1e2ba 356ca: ef e5 ldi r30, 0x5F ; 95 356cc: 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])) 356ce: 0e 31 cpi r16, 0x1E ; 30 356d0: 30 f4 brcc .+12 ; 0x356de 356d2: e0 2f mov r30, r16 356d4: f0 e0 ldi r31, 0x00 ; 0 356d6: ee 0f add r30, r30 356d8: ff 1f adc r31, r31 356da: e1 5a subi r30, 0xA1 ; 161 356dc: f7 45 sbci r31, 0x57 ; 87 : static_cast(pgm_read_ptr(&progressTexts[0])); 356de: 85 91 lpm r24, Z+ 356e0: 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))); 356e2: 02 96 adiw r24, 0x02 ; 2 356e4: 0f 94 d5 c5 call 0x38baa ; 0x38baa } } void MMU2::OnMMUProgressMsgChanged(ProgressCode pc) { ReportProgress(pc); lastProgressCode = pc; 356e8: 00 93 b1 13 sts 0x13B1, r16 ; 0x8013b1 switch (pc) { 356ec: 03 30 cpi r16, 0x03 ; 3 356ee: 49 f0 breq .+18 ; 0x35702 356f0: 0c 31 cpi r16, 0x1C ; 28 356f2: 09 f0 breq .+2 ; 0x356f6 356f4: 97 cf rjmp .-210 ; 0x35624 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 356f6: 0f 94 e8 42 call 0x285d0 ; 0x285d0 } break; case ProgressCode::FeedingToFSensor: // prepare for the movement of the E-motor planner_synchronize(); loadFilamentStarted = true; 356fa: 81 e0 ldi r24, 0x01 ; 1 356fc: 80 93 bc 13 sts 0x13BC, r24 ; 0x8013bc 35700: 91 cf rjmp .-222 ; 0x35624 35702: 80 91 4d 13 lds r24, 0x134D ; 0x80134d 35706: 84 30 cpi r24, 0x04 ; 4 35708: 31 f4 brne .+12 ; 0x35716 ReportProgress(pc); lastProgressCode = pc; switch (pc) { case ProgressCode::UnloadingToFinda: if ((CommandInProgress)logic.CommandInProgress() == CommandInProgress::UnloadFilament || ((CommandInProgress)logic.CommandInProgress() == CommandInProgress::ToolChange)) { 3570a: 80 91 50 13 lds r24, 0x1350 ; 0x801350 3570e: 84 55 subi r24, 0x54 ; 84 35710: 82 30 cpi r24, 0x02 ; 2 35712: 08 f4 brcc .+2 ; 0x35716 35714: 87 cf rjmp .-242 ; 0x35624 35716: 0f 94 e8 42 call 0x285d0 ; 0x285d0 // 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; 3571a: 81 e0 ldi r24, 0x01 ; 1 3571c: 80 93 bd 13 sts 0x13BD, r24 ; 0x8013bd 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(); 35720: 0f 94 0c 6a call 0x2d418 ; 0x2d418 35724: 7f cf rjmp .-258 ; 0x35624 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) { 35726: 03 30 cpi r16, 0x03 ; 3 35728: 71 f1 breq .+92 ; 0x35786 3572a: 0c 31 cpi r16, 0x1C ; 28 3572c: 09 f0 breq .+2 ; 0x35730 3572e: 7a cf rjmp .-268 ; 0x35624 unloadFilamentStarted = false; } } break; case ProgressCode::FeedingToFSensor: if (loadFilamentStarted) { 35730: 80 91 bc 13 lds r24, 0x13BC ; 0x8013bc 35734: 88 23 and r24, r24 35736: 09 f4 brne .+2 ; 0x3573a 35738: 75 cf rjmp .-278 ; 0x35624 switch (WhereIsFilament()) { 3573a: 0f 94 e5 c5 call 0x38bca ; 0x38bca 3573e: 88 23 and r24, r24 35740: b1 f1 breq .+108 ; 0x357ae 35742: 81 30 cpi r24, 0x01 ; 1 35744: 09 f0 breq .+2 ; 0x35748 35746: 6e cf rjmp .-292 ; 0x35624 case FilamentState::AT_FSENSOR: // fsensor triggered, finish FeedingToExtruder state loadFilamentStarted = false; 35748: 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(); 3574c: 0f 94 c3 c1 call 0x38386 ; 0x38386 // 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; 35750: 10 92 ac 0d sts 0x0DAC, r1 ; 0x800dac planner_abort_queued_moves(); { extruder_move(logic.ExtraLoadDistance() + 2, logic.PulleySlowFeedRate()); 35754: 60 91 98 13 lds r22, 0x1398 ; 0x801398 35758: 70 e0 ldi r23, 0x00 ; 0 3575a: 90 e0 ldi r25, 0x00 ; 0 3575c: 80 e0 ldi r24, 0x00 ; 0 3575e: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 35762: 6b 01 movw r12, r22 35764: 7c 01 movw r14, r24 35766: 60 91 97 13 lds r22, 0x1397 ; 0x801397 3576a: 70 e0 ldi r23, 0x00 ; 0 3576c: 6e 5f subi r22, 0xFE ; 254 3576e: 7f 4f sbci r23, 0xFF ; 255 35770: 07 2e mov r0, r23 35772: 00 0c add r0, r0 35774: 88 0b sbc r24, r24 35776: 99 0b sbc r25, r25 35778: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 3577c: a7 01 movw r20, r14 3577e: 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()); 35780: 0f 94 b1 c5 call 0x38b62 ; 0x38b62 35784: 4f cf rjmp .-354 ; 0x35624 } 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 35786: 80 91 bd 13 lds r24, 0x13BD ; 0x8013bd 3578a: 88 23 and r24, r24 3578c: 09 f4 brne .+2 ; 0x35790 3578e: 4a cf rjmp .-364 ; 0x35624 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); 35790: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 35794: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 35798: 98 13 cpse r25, r24 3579a: 44 cf rjmp .-376 ; 0x35624 switch (WhereIsFilament()) { 3579c: 0f 94 e5 c5 call 0x38bca ; 0x38bca 357a0: 81 50 subi r24, 0x01 ; 1 357a2: 83 30 cpi r24, 0x03 ; 3 357a4: 08 f4 brcc .+2 ; 0x357a8 357a6: bc cf rjmp .-136 ; 0x35720 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; 357a8: 10 92 bd 13 sts 0x13BD, r1 ; 0x8013bd 357ac: 3b cf rjmp .-394 ; 0x35624 357ae: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 357b2: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 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 357b6: 98 13 cpse r25, r24 357b8: 35 cf rjmp .-406 ; 0x35624 // 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()); 357ba: 60 91 98 13 lds r22, 0x1398 ; 0x801398 357be: 70 e0 ldi r23, 0x00 ; 0 357c0: 90 e0 ldi r25, 0x00 ; 0 357c2: 80 e0 ldi r24, 0x00 ; 0 357c4: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 357c8: 9b 01 movw r18, r22 357ca: ac 01 movw r20, r24 357cc: 60 e0 ldi r22, 0x00 ; 0 357ce: 70 e0 ldi r23, 0x00 ; 0 357d0: 8f ea ldi r24, 0xAF ; 175 357d2: 93 e4 ldi r25, 0x43 ; 67 357d4: d5 cf rjmp .-86 ; 0x35780 // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { switch (ss) { 357d6: 18 30 cpi r17, 0x08 ; 8 357d8: b9 f0 breq .+46 ; 0x35808 357da: 19 30 cpi r17, 0x09 ; 9 357dc: 09 f0 breq .+2 ; 0x357e0 357de: 22 cf rjmp .-444 ; 0x35624 StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); break; case PrinterError: ReportError(logic.PrinterError(), ErrorSourcePrinter); 357e0: 60 e0 ldi r22, 0x00 ; 0 357e2: 0f 94 ee 82 call 0x305dc ; 0x305dc 357e6: 19 e0 ldi r17, 0x09 ; 9 357e8: 1d cf rjmp .-454 ; 0x35624 default: if (reportErrors) { switch (ss) { case CommandError: ReportError(logic.Error(), ErrorSourceMMU); 357ea: 61 e0 ldi r22, 0x01 ; 1 357ec: 80 91 8b 13 lds r24, 0x138B ; 0x80138b 357f0: 90 91 8c 13 lds r25, 0x138C ; 0x80138c ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); break; case VersionMismatch: StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); 357f4: 0f 94 ee 82 call 0x305dc ; 0x305dc 357f8: 15 cf rjmp .-470 ; 0x35624 case CommandError: ReportError(logic.Error(), ErrorSourceMMU); break; case CommunicationTimeout: state = xState::Connecting; 357fa: 82 e0 ldi r24, 0x02 ; 2 357fc: 80 93 ba 13 sts 0x13BA, r24 ; 0x8013ba ReportError(ErrorCode::MMU_NOT_RESPONDING, ErrorSourcePrinter); 35800: 60 e0 ldi r22, 0x00 ; 0 35802: 8e e2 ldi r24, 0x2E ; 46 35804: 90 e8 ldi r25, 0x80 ; 128 35806: f6 cf rjmp .-20 ; 0x357f4 StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 35808: 10 92 ba 13 sts 0x13BA, r1 ; 0x8013ba protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 3580c: 10 92 68 13 sts 0x1368, r1 ; 0x801368 currentScope = Scope::Stopped; 35810: 10 92 4d 13 sts 0x134D, r1 ; 0x80134d ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); break; case VersionMismatch: StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); 35814: 60 e0 ldi r22, 0x00 ; 0 35816: 8c e2 ldi r24, 0x2C ; 44 35818: 90 e8 ldi r25, 0x80 ; 128 3581a: ec cf rjmp .-40 ; 0x357f4 break; } } [[fallthrough]]; // otherwise default: RecordUARTActivity(); // something has happened on the UART, update the timeout record 3581c: 0f 94 96 65 call 0x2cb2c ; 0x2cb2c 35820: aa cd rjmp .-1196 ; 0x35376 case Interrupted: // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { 35822: 00 23 and r16, r16 35824: 01 f3 breq .-64 ; 0x357e6 35826: dc cf rjmp .-72 ; 0x357e0 00035828 : } } } void MMU2::ResumeHotendTemp() { if ((mmu_print_saved & SavedState::CooldownPending)) { 35828: 80 91 bb 13 lds r24, 0x13BB ; 0x8013bb 3582c: 82 ff sbrs r24, 2 3582e: 07 c0 rjmp .+14 ; 0x3583e // Clear the "pending" flag if we haven't cooled yet. mmu_print_saved &= ~(SavedState::CooldownPending); 35830: 8b 7f andi r24, 0xFB ; 251 35832: 80 93 bb 13 sts 0x13BB, r24 ; 0x8013bb LogEchoEvent_P(PSTR("Cooldown flag cleared")); 35836: 8d ee ldi r24, 0xED ; 237 35838: 99 ea ldi r25, 0xA9 ; 169 3583a: 0f 94 d5 c5 call 0x38baa ; 0x38baa } if ((mmu_print_saved & SavedState::Cooldown) && resume_hotend_temp) { 3583e: 80 91 bb 13 lds r24, 0x13BB ; 0x8013bb 35842: 81 ff sbrs r24, 1 35844: 52 c0 rjmp .+164 ; 0x358ea 35846: 80 91 af 13 lds r24, 0x13AF ; 0x8013af 3584a: 90 91 b0 13 lds r25, 0x13B0 ; 0x8013b0 3584e: 89 2b or r24, r25 35850: 09 f4 brne .+2 ; 0x35854 35852: 4b c0 rjmp .+150 ; 0x358ea LogEchoEvent_P(PSTR("Resuming Temp")); 35854: 8f ed ldi r24, 0xDF ; 223 35856: 99 ea ldi r25, 0xA9 ; 169 35858: 0f 94 d5 c5 call 0x38baa ; 0x38baa // @@TODO MMU2_ECHO_MSGRPGM(PSTR("Restoring hotend temperature ")); SERIAL_ECHOLN(resume_hotend_temp); 3585c: 80 91 af 13 lds r24, 0x13AF ; 0x8013af 35860: 90 91 b0 13 lds r25, 0x13B0 ; 0x8013b0 35864: 0f 94 f5 74 call 0x2e9ea ; 0x2e9ea mmu_print_saved &= ~(SavedState::Cooldown); 35868: 80 91 bb 13 lds r24, 0x13BB ; 0x8013bb 3586c: 8d 7f andi r24, 0xFD ; 253 3586e: 80 93 bb 13 sts 0x13BB, r24 ; 0x8013bb return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 35872: 80 91 af 13 lds r24, 0x13AF ; 0x8013af 35876: 90 91 b0 13 lds r25, 0x13B0 ; 0x8013b0 3587a: 90 93 b7 0d sts 0x0DB7, r25 ; 0x800db7 3587e: 80 93 b6 0d sts 0x0DB6, r24 ; 0x800db6 void FullScreenMsgLoad(uint8_t slot){ FullScreenMsg(_T(MSG_LOADING_FILAMENT), slot); } void FullScreenMsgRestoringTemperature(){ lcd_display_message_fullscreen_P(_T(MSG_MMU_RESTORE_TEMP)); 35882: 8a e4 ldi r24, 0x4A ; 74 35884: 9c e5 ldi r25, 0x5C ; 92 35886: 0e 94 ac 72 call 0xe558 ; 0xe558 3588a: 0f 94 e4 1f call 0x23fc8 ; 0x23fc8 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)); 3588e: 4f ea ldi r20, 0xAF ; 175 35890: 59 ea ldi r21, 0xA9 ; 169 35892: 62 e0 ldi r22, 0x02 ; 2 35894: 80 e0 ldi r24, 0x00 ; 0 35896: 0e 94 f4 6e call 0xdde8 ; 0xdde8 int16_t thermal_degTargetHotend() { return degTargetHotend(0); } int16_t thermal_degHotend() { return degHotend(0); 3589a: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 3589e: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 358a2: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 358a6: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 358aa: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> namespace MMU2 { template void waitForHotendTargetTemp(uint16_t delay, F f) { while (((thermal_degTargetHotend() - thermal_degHotend()) > 5)) { 358ae: 20 91 b6 0d lds r18, 0x0DB6 ; 0x800db6 358b2: 30 91 b7 0d lds r19, 0x0DB7 ; 0x800db7 358b6: c9 01 movw r24, r18 358b8: 86 1b sub r24, r22 358ba: 97 0b sbc r25, r23 358bc: 06 97 sbiw r24, 0x06 ; 6 358be: 6c f0 brlt .+26 ; 0x358da void marlin_manage_heater() { manage_heater(); } void marlin_manage_inactivity(bool ignore_stepper_queue) { manage_inactivity(ignore_stepper_queue); 358c0: 81 e0 ldi r24, 0x01 ; 1 358c2: 0e 94 af 8a call 0x1155e ; 0x1155e 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); 358c6: 80 e0 ldi r24, 0x00 ; 0 358c8: 0f 94 02 a7 call 0x34e04 ; 0x34e04 ReportErrorHookDynamicRender(); 358cc: 0f 94 f6 c4 call 0x389ec ; 0x389ec void thermal_setTargetHotend(int16_t t) { setTargetHotend(t); } void safe_delay_keep_alive(uint16_t t) { delay_keep_alive(t); 358d0: 84 e6 ldi r24, 0x64 ; 100 358d2: 90 e0 ldi r25, 0x00 ; 0 358d4: 0e 94 e4 8c call 0x119c8 ; 0x119c8 358d8: e0 cf rjmp .-64 ; 0x3589a }); ScreenUpdateEnable(); // temporary hack to stop this locking the printer... 358da: 0f 94 cc c4 call 0x38998 ; 0x38998 LogEchoEvent_P(PSTR("Hotend temperature reached")); 358de: 84 ec ldi r24, 0xC4 ; 196 358e0: 99 ea ldi r25, 0xA9 ; 169 358e2: 0f 94 d5 c5 call 0x38baa ; 0x38baa void ScreenUpdateEnable(){ lcd_update_enable(true); } void ScreenClear(){ lcd_clear(); 358e6: 0c 94 13 6f jmp 0xde26 ; 0xde26 ScreenClear(); } } 358ea: 08 95 ret 000358ec : /// 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) { 358ec: 0f 93 push r16 358ee: 1f 93 push r17 358f0: cf 93 push r28 358f2: df 93 push r29 358f4: 00 d0 rcall .+0 ; 0x358f6 358f6: 1f 92 push r1 358f8: 1f 92 push r1 358fa: cd b7 in r28, 0x3d ; 61 358fc: de b7 in r29, 0x3e ; 62 358fe: 18 2f mov r17, r24 35900: 06 2f mov r16, r22 mmu_print_saved = SavedState::None; 35902: 10 92 bb 13 sts 0x13BB, r1 ; 0x8013bb MARLIN_KEEPALIVE_STATE_IN_PROCESS; 35906: 83 e0 ldi r24, 0x03 ; 3 35908: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be LongTimer nozzleTimeout; 3590c: 19 82 std Y+1, r1 ; 0x01 3590e: 1a 82 std Y+2, r1 ; 0x02 35910: 1b 82 std Y+3, r1 ; 0x03 35912: 1c 82 std Y+4, r1 ; 0x04 35914: 1d 82 std Y+5, r1 ; 0x05 35916: 90 e0 ldi r25, 0x00 ; 0 35918: 80 e0 ldi r24, 0x00 ; 0 3591a: 0e 94 e4 8c call 0x119c8 ; 0x119c8 // - 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) { 3591e: 90 91 bb 13 lds r25, 0x13BB ; 0x8013bb 35922: 89 81 ldd r24, Y+1 ; 0x01 35924: 92 ff sbrs r25, 2 35926: 37 c0 rjmp .+110 ; 0x35996 if (!nozzleTimeout.running()) { 35928: 81 11 cpse r24, r1 3592a: 1e c0 rjmp .+60 ; 0x35968 nozzleTimeout.start(); 3592c: ce 01 movw r24, r28 3592e: 01 96 adiw r24, 0x01 ; 1 35930: 0f 94 ef 2b call 0x257de ; 0x257de ::start()> LogEchoEvent_P(PSTR("Cooling Timeout started")); 35934: 84 ec ldi r24, 0xC4 ; 196 35936: 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")); 35938: 0f 94 d5 c5 call 0x38baa ; 0x38baa } switch (logicStepLastStatus) { 3593c: e0 91 b9 13 lds r30, 0x13B9 ; 0x8013b9 35940: e2 50 subi r30, 0x02 ; 2 35942: ea 30 cpi r30, 0x0A ; 10 35944: 40 f7 brcc .-48 ; 0x35916 35946: f0 e0 ldi r31, 0x00 ; 0 35948: 88 27 eor r24, r24 3594a: e6 55 subi r30, 0x56 ; 86 3594c: f3 45 sbci r31, 0x53 ; 83 3594e: 8e 4f sbci r24, 0xFE ; 254 35950: 0d 94 2c dd jmp 0x3ba58 ; 0x3ba58 <__tablejump2__> 35954: 42 3a cpi r20, 0xA2 ; 162 35956: 66 39 cpi r22, 0x96 ; 150 35958: 88 39 cpi r24, 0x98 ; 152 3595a: 88 39 cpi r24, 0x98 ; 152 3595c: a2 3a cpi r26, 0xA2 ; 162 3595e: 88 39 cpi r24, 0x98 ; 152 35960: 00 3a cpi r16, 0xA0 ; 160 35962: 52 3a cpi r21, 0xA2 ; 162 35964: 80 39 cpi r24, 0x90 ; 144 35966: 88 39 cpi r24, 0x98 ; 152 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. 35968: 40 e4 ldi r20, 0x40 ; 64 3596a: 57 e7 ldi r21, 0x77 ; 119 3596c: 6b e1 ldi r22, 0x1B ; 27 3596e: 70 e0 ldi r23, 0x00 ; 0 35970: ce 01 movw r24, r28 35972: 01 96 adiw r24, 0x01 ; 1 35974: 0f 94 30 2a call 0x25460 ; 0x25460 ::expired(unsigned long)> 35978: 88 23 and r24, r24 3597a: 01 f3 breq .-64 ; 0x3593c mmu_print_saved &= ~(SavedState::CooldownPending); 3597c: 80 91 bb 13 lds r24, 0x13BB ; 0x8013bb 35980: 8b 7f andi r24, 0xFB ; 251 mmu_print_saved |= SavedState::Cooldown; 35982: 82 60 ori r24, 0x02 ; 2 35984: 80 93 bb 13 sts 0x13BB, r24 ; 0x8013bb 35988: 10 92 b7 0d sts 0x0DB7, r1 ; 0x800db7 3598c: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 thermal_setTargetHotend(0); LogEchoEvent_P(PSTR("Heater cooldown")); 35990: 84 eb ldi r24, 0xB4 ; 180 35992: 97 ea ldi r25, 0xA7 ; 167 35994: d1 cf rjmp .-94 ; 0x35938 } } else if (nozzleTimeout.running()) { 35996: 88 23 and r24, r24 35998: 89 f2 breq .-94 ; 0x3593c 3599a: 19 82 std Y+1, r1 ; 0x01 nozzleTimeout.stop(); LogEchoEvent_P(PSTR("Cooling timer stopped")); 3599c: 8e e9 ldi r24, 0x9E ; 158 3599e: 97 ea ldi r25, 0xA7 ; 167 359a0: cb cf rjmp .-106 ; 0x35938 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(); 359a2: 0f 94 14 ac call 0x35828 ; 0x35828 ResumeUnpark(); // We can now travel back to the tower or wherever we were when we saved. 359a6: 0f 94 32 6a call 0x2d464 ; 0x2d464 if (!TuneMenuEntered()) { 359aa: 80 91 ad 0d lds r24, 0x0DAD ; 0x800dad <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.496> 359ae: 81 11 cpse r24, r1 359b0: 07 c0 rjmp .+14 ; 0x359c0 retryAttempts--; } } void ProtocolLogic::ResetRetryAttempts() { SERIAL_ECHOLNPGM("ResetRetryAttempts"); 359b2: 8b e8 ldi r24, 0x8B ; 139 359b4: 97 ea ldi r25, 0xA7 ; 167 359b6: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 retryAttempts = MAX_RETRIES; 359ba: 83 e0 ldi r24, 0x03 ; 3 359bc: 80 93 9f 13 sts 0x139F, r24 ; 0x80139f bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 359c0: 0f 94 e8 42 call 0x285d0 ; 0x285d0 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; 359c4: 81 e0 ldi r24, 0x01 ; 1 case Processing: // wait for the MMU to respond default: break; } } } 359c6: 0f 90 pop r0 359c8: 0f 90 pop r0 359ca: 0f 90 pop r0 359cc: 0f 90 pop r0 359ce: 0f 90 pop r0 359d0: df 91 pop r29 359d2: cf 91 pop r28 359d4: 1f 91 pop r17 359d6: 0f 91 pop r16 359d8: 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(); 359da: 0f 94 49 a6 call 0x34c92 ; 0x34c92 359de: f2 cf rjmp .-28 ; 0x359c4 break; case CommandError: case CommunicationTimeout: case ProtocolError: case ButtonPushed: if (!logic.InAutoRetry()) { 359e0: 80 91 a0 13 lds r24, 0x13A0 ; 0x8013a0 359e4: 81 11 cpse r24, r1 359e6: 97 cf rjmp .-210 ; 0x35916 // Don't proceed to the park/save if we are doing an autoretry. SaveAndPark(move_axes); 359e8: 81 2f mov r24, r17 359ea: 0f 94 7e 6a call 0x2d4fc ; 0x2d4fc SaveHotendTemp(turn_off_nozzle); 359ee: 80 2f mov r24, r16 359f0: 0f 94 16 6a call 0x2d42c ; 0x2d42c CheckUserInput(); 359f4: 0f 94 49 a6 call 0x34c92 ; 0x34c92 359f8: 8e cf rjmp .-228 ; 0x35916 } 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(); 359fa: 0f 94 14 ac call 0x35828 ; 0x35828 ResumeUnpark(); 359fe: 0f 94 32 6a call 0x2d464 ; 0x2d464 35a02: 89 cf rjmp .-238 ; 0x35916 } planner_synchronize(); return true; case Interrupted: // now what :D ... big bad ... ramming, unload, retry the whole command originally issued return false; 35a04: 80 e0 ldi r24, 0x00 ; 0 35a06: df cf rjmp .-66 ; 0x359c6 00035a08 : } // true, true); -- Comment: how is it possible for a filament type set to fail? return true; } void MMU2::UnloadInner() { 35a08: cf 93 push r28 35a0a: df 93 push r29 35a0c: 00 d0 rcall .+0 ; 0x35a0e 35a0e: 1f 92 push r1 35a10: 1f 92 push r1 35a12: cd b7 in r28, 0x3d ; 61 35a14: de b7 in r29, 0x3e ; 62 FSensorBlockRunout blockRunout; 35a16: 0f 94 ae 86 call 0x30d5c ; 0x30d5c return ss; } void MMU2::filament_ramming() { execute_extruder_sequence(ramming_sequence, sizeof(ramming_sequence) / sizeof(E_Step)); 35a1a: 62 e1 ldi r22, 0x12 ; 18 35a1c: 8b ef ldi r24, 0xFB ; 251 35a1e: 96 ea ldi r25, 0xA6 ; 166 35a20: 0f 94 5b 88 call 0x310b6 ; 0x310b6 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(); 35a24: 0f 94 af c5 call 0x38b5e ; 0x38b5e void ProtocolLogic::Statistics() { PlanGenericRequest(RequestMsg(RequestMsgCodes::Version, 3)); } void ProtocolLogic::UnloadFilament() { PlanGenericRequest(RequestMsg(RequestMsgCodes::Unload, 0)); 35a28: 40 e0 ldi r20, 0x00 ; 0 35a2a: 65 e5 ldi r22, 0x55 ; 85 35a2c: ce 01 movw r24, r28 35a2e: 01 96 adiw r24, 0x01 ; 1 35a30: 0f 94 8d c5 call 0x38b1a ; 0x38b1a 35a34: 49 81 ldd r20, Y+1 ; 0x01 35a36: 5a 81 ldd r21, Y+2 ; 0x02 35a38: 6b 81 ldd r22, Y+3 ; 0x03 35a3a: 7c 81 ldd r23, Y+4 ; 0x04 35a3c: 8d 81 ldd r24, Y+5 ; 0x05 35a3e: 0f 94 52 a5 call 0x34aa4 ; 0x34aa4 logic.UnloadFilament(); if (manage_response(false, true)) { 35a42: 61 e0 ldi r22, 0x01 ; 1 35a44: 80 e0 ldi r24, 0x00 ; 0 35a46: 0f 94 76 ac call 0x358ec ; 0x358ec 35a4a: 81 11 cpse r24, r1 35a4c: 03 c0 rjmp .+6 ; 0x35a54 break; } IncrementMMUFails(); 35a4e: 0f 94 ee c4 call 0x389dc ; 0x389dc 35a52: e8 cf rjmp .-48 ; 0x35a24 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); 35a54: 83 e0 ldi r24, 0x03 ; 3 35a56: 0f 94 07 4e call 0x29c0e ; 0x29c0e } MakeSound(Confirm); // no active tool SetCurrentTool(MMU2_NO_TOOL); 35a5a: 83 e6 ldi r24, 0x63 ; 99 35a5c: 0f 94 03 88 call 0x31006 ; 0x31006 tool_change_extruder = MMU2_NO_TOOL; 35a60: 83 e6 ldi r24, 0x63 ; 99 35a62: 80 93 a2 13 sts 0x13A2, r24 ; 0x8013a2 FSensorBlockRunout::~FSensorBlockRunout() { fsensor.settings_init(); // restore filament runout state. 35a66: 0f 94 f2 7a call 0x2f5e4 ; 0x2f5e4 } 35a6a: 0f 90 pop r0 35a6c: 0f 90 pop r0 35a6e: 0f 90 pop r0 35a70: 0f 90 pop r0 35a72: 0f 90 pop r0 35a74: df 91 pop r29 35a76: cf 91 pop r28 35a78: 08 95 ret 00035a7a : bool MMU2::unload() { 35a7a: cf 93 push r28 if (!WaitForMMUReady()) { 35a7c: 0f 94 84 88 call 0x31108 ; 0x31108 35a80: c8 2f mov r28, r24 35a82: 88 23 and r24, r24 35a84: 79 f0 breq .+30 ; 0x35aa4 safe_delay_keep_alive(delay); } } void WaitForHotendTargetTempBeep() { waitForHotendTargetTemp(200, [] {}); 35a86: 88 ec ldi r24, 0xC8 ; 200 35a88: 90 e0 ldi r25, 0x00 ; 0 35a8a: 0f 94 33 c9 call 0x39266 ; 0x39266 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.385]> 35a8e: 82 e0 ldi r24, 0x02 ; 2 35a90: 0f 94 07 4e call 0x29c0e ; 0x29c0e struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 35a94: 0f 94 f8 87 call 0x30ff0 ; 0x30ff0 WaitForHotendTargetTempBeep(); { ReportingRAII rep(CommandInProgress::UnloadFilament); UnloadInner(); 35a98: 0f 94 04 ad call 0x35a08 ; 0x35a08 explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 35a9c: 0f 94 79 88 call 0x310f2 ; 0x310f2 { ReportingRAII rep(CommandInProgress::UnloadFilament); UnloadInner(); } ScreenUpdateEnable(); 35aa0: 0f 94 cc c4 call 0x38998 ; 0x38998 return true; } 35aa4: 8c 2f mov r24, r28 35aa6: cf 91 pop r28 35aa8: 08 95 ret 00035aaa : unload(); ScreenUpdateEnable(); return true; } bool MMU2::load_filament(uint8_t slot) { 35aaa: 0f 93 push r16 35aac: 1f 93 push r17 35aae: cf 93 push r28 35ab0: df 93 push r29 35ab2: 00 d0 rcall .+0 ; 0x35ab4 35ab4: 1f 92 push r1 35ab6: 1f 92 push r1 35ab8: cd b7 in r28, 0x3d ; 61 35aba: de b7 in r29, 0x3e ; 62 35abc: 08 2f mov r16, r24 if (!WaitForMMUReady()) { 35abe: 0f 94 84 88 call 0x31108 ; 0x31108 35ac2: 18 2f mov r17, r24 35ac4: 88 23 and r24, r24 35ac6: 49 f1 breq .+82 ; 0x35b1a void FullScreenMsgTest(uint8_t slot){ FullScreenMsg(_T(MSG_TESTING_FILAMENT), slot); } void FullScreenMsgLoad(uint8_t slot){ FullScreenMsg(_T(MSG_LOADING_FILAMENT), slot); 35ac8: 87 e3 ldi r24, 0x37 ; 55 35aca: 9c e5 ldi r25, 0x5C ; 92 35acc: 0e 94 ac 72 call 0xe558 ; 0xe558 35ad0: 60 2f mov r22, r16 35ad2: 0f 94 cf c4 call 0x3899e ; 0x3899e struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 35ad6: 0f 94 f8 87 call 0x30ff0 ; 0x30ff0 FullScreenMsgLoad(slot); { ReportingRAII rep(CommandInProgress::LoadFilament); for (;;) { Disable_E0(); 35ada: 0f 94 af c5 call 0x38b5e ; 0x38b5e } void ProtocolLogic::LoadFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Load, slot)); 35ade: 40 2f mov r20, r16 35ae0: 6c e4 ldi r22, 0x4C ; 76 35ae2: ce 01 movw r24, r28 35ae4: 01 96 adiw r24, 0x01 ; 1 35ae6: 0f 94 8d c5 call 0x38b1a ; 0x38b1a 35aea: 49 81 ldd r20, Y+1 ; 0x01 35aec: 5a 81 ldd r21, Y+2 ; 0x02 35aee: 6b 81 ldd r22, Y+3 ; 0x03 35af0: 7c 81 ldd r23, Y+4 ; 0x04 35af2: 8d 81 ldd r24, Y+5 ; 0x05 35af4: 0f 94 52 a5 call 0x34aa4 ; 0x34aa4 logic.LoadFilament(slot); if (manage_response(false, false)) { 35af8: 60 e0 ldi r22, 0x00 ; 0 35afa: 80 e0 ldi r24, 0x00 ; 0 35afc: 0f 94 76 ac call 0x358ec ; 0x358ec 35b00: 18 2f mov r17, r24 35b02: 81 11 cpse r24, r1 35b04: 03 c0 rjmp .+6 ; 0x35b0c break; } IncrementMMUFails(); 35b06: 0f 94 ee c4 call 0x389dc ; 0x389dc 35b0a: e7 cf rjmp .-50 ; 0x35ada 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); 35b0c: 83 e0 ldi r24, 0x03 ; 3 35b0e: 0f 94 07 4e call 0x29c0e ; 0x29c0e explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 35b12: 0f 94 79 88 call 0x310f2 ; 0x310f2 } IncrementMMUFails(); } MakeSound(SoundType::Confirm); } ScreenUpdateEnable(); 35b16: 0f 94 cc c4 call 0x38998 ; 0x38998 return true; } 35b1a: 81 2f mov r24, r17 35b1c: 0f 90 pop r0 35b1e: 0f 90 pop r0 35b20: 0f 90 pop r0 35b22: 0f 90 pop r0 35b24: 0f 90 pop r0 35b26: df 91 pop r29 35b28: cf 91 pop r28 35b2a: 1f 91 pop r17 35b2c: 0f 91 pop r16 35b2e: 08 95 ret 00035b30 : } ScreenUpdateEnable(); return true; } bool MMU2::eject_filament(uint8_t slot, bool enableFullScreenMsg /* = true */) { 35b30: ff 92 push r15 35b32: 0f 93 push r16 35b34: 1f 93 push r17 35b36: cf 93 push r28 35b38: df 93 push r29 35b3a: 00 d0 rcall .+0 ; 0x35b3c 35b3c: 1f 92 push r1 35b3e: 1f 92 push r1 35b40: cd b7 in r28, 0x3d ; 61 35b42: de b7 in r29, 0x3e ; 62 35b44: 08 2f mov r16, r24 35b46: f6 2e mov r15, r22 if (!WaitForMMUReady()) { 35b48: 0f 94 84 88 call 0x31108 ; 0x31108 35b4c: 18 2f mov r17, r24 35b4e: 88 23 and r24, r24 35b50: b1 f1 breq .+108 ; 0x35bbe return false; } if (enableFullScreenMsg) { 35b52: ff 20 and r15, r15 35b54: 39 f0 breq .+14 ; 0x35b64 void FullScreenMsgCut(uint8_t slot){ FullScreenMsg(_T(MSG_CUT_FILAMENT), slot); } void FullScreenMsgEject(uint8_t slot){ FullScreenMsg(_T(MSG_EJECT_FROM_MMU), slot); 35b56: 86 e2 ldi r24, 0x26 ; 38 35b58: 9c e5 ldi r25, 0x5C ; 92 35b5a: 0e 94 ac 72 call 0xe558 ; 0xe558 35b5e: 60 2f mov r22, r16 35b60: 0f 94 cf c4 call 0x3899e ; 0x3899e FullScreenMsgEject(slot); } { if (FindaDetectsFilament()) { 35b64: 80 91 90 13 lds r24, 0x1390 ; 0x801390 35b68: 81 11 cpse r24, r1 unload(); 35b6a: 0f 94 3d ad call 0x35a7a ; 0x35a7a struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 35b6e: 0f 94 f8 87 call 0x30ff0 ; 0x30ff0 unload(); } ReportingRAII rep(CommandInProgress::EjectFilament); for (;;) { Disable_E0(); 35b72: 0f 94 af c5 call 0x38b5e ; 0x38b5e } void ProtocolLogic::EjectFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Eject, slot)); 35b76: 40 2f mov r20, r16 35b78: 65 e4 ldi r22, 0x45 ; 69 35b7a: ce 01 movw r24, r28 35b7c: 01 96 adiw r24, 0x01 ; 1 35b7e: 0f 94 8d c5 call 0x38b1a ; 0x38b1a 35b82: 49 81 ldd r20, Y+1 ; 0x01 35b84: 5a 81 ldd r21, Y+2 ; 0x02 35b86: 6b 81 ldd r22, Y+3 ; 0x03 35b88: 7c 81 ldd r23, Y+4 ; 0x04 35b8a: 8d 81 ldd r24, Y+5 ; 0x05 35b8c: 0f 94 52 a5 call 0x34aa4 ; 0x34aa4 logic.EjectFilament(slot); if (manage_response(false, true)) { 35b90: 61 e0 ldi r22, 0x01 ; 1 35b92: 80 e0 ldi r24, 0x00 ; 0 35b94: 0f 94 76 ac call 0x358ec ; 0x358ec 35b98: 18 2f mov r17, r24 35b9a: 81 11 cpse r24, r1 35b9c: 03 c0 rjmp .+6 ; 0x35ba4 break; } IncrementMMUFails(); 35b9e: 0f 94 ee c4 call 0x389dc ; 0x389dc 35ba2: e7 cf rjmp .-50 ; 0x35b72 } SetCurrentTool(MMU2_NO_TOOL); 35ba4: 83 e6 ldi r24, 0x63 ; 99 35ba6: 0f 94 03 88 call 0x31006 ; 0x31006 tool_change_extruder = MMU2_NO_TOOL; 35baa: 83 e6 ldi r24, 0x63 ; 99 35bac: 80 93 a2 13 sts 0x13A2, r24 ; 0x8013a2 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); 35bb0: 83 e0 ldi r24, 0x03 ; 3 35bb2: 0f 94 07 4e call 0x29c0e ; 0x29c0e explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 35bb6: 0f 94 79 88 call 0x310f2 ; 0x310f2 } SetCurrentTool(MMU2_NO_TOOL); tool_change_extruder = MMU2_NO_TOOL; MakeSound(Confirm); } ScreenUpdateEnable(); 35bba: 0f 94 cc c4 call 0x38998 ; 0x38998 return true; } 35bbe: 81 2f mov r24, r17 35bc0: 0f 90 pop r0 35bc2: 0f 90 pop r0 35bc4: 0f 90 pop r0 35bc6: 0f 90 pop r0 35bc8: 0f 90 pop r0 35bca: df 91 pop r29 35bcc: cf 91 pop r28 35bce: 1f 91 pop r17 35bd0: 0f 91 pop r16 35bd2: ff 90 pop r15 35bd4: 08 95 ret 00035bd6 : ScreenUpdateEnable(); return true; } void MMU2::CutFilamentInner(uint8_t slot) { 35bd6: 1f 93 push r17 35bd8: cf 93 push r28 35bda: df 93 push r29 35bdc: 00 d0 rcall .+0 ; 0x35bde 35bde: 1f 92 push r1 35be0: 1f 92 push r1 35be2: cd b7 in r28, 0x3d ; 61 35be4: de b7 in r29, 0x3e ; 62 35be6: 18 2f mov r17, r24 for (;;) { Disable_E0(); 35be8: 0f 94 af c5 call 0x38b5e ; 0x38b5e } void ProtocolLogic::CutFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Cut, slot)); 35bec: 41 2f mov r20, r17 35bee: 6b e4 ldi r22, 0x4B ; 75 35bf0: ce 01 movw r24, r28 35bf2: 01 96 adiw r24, 0x01 ; 1 35bf4: 0f 94 8d c5 call 0x38b1a ; 0x38b1a 35bf8: 49 81 ldd r20, Y+1 ; 0x01 35bfa: 5a 81 ldd r21, Y+2 ; 0x02 35bfc: 6b 81 ldd r22, Y+3 ; 0x03 35bfe: 7c 81 ldd r23, Y+4 ; 0x04 35c00: 8d 81 ldd r24, Y+5 ; 0x05 35c02: 0f 94 52 a5 call 0x34aa4 ; 0x34aa4 logic.CutFilament(slot); if (manage_response(false, true)) { 35c06: 61 e0 ldi r22, 0x01 ; 1 35c08: 80 e0 ldi r24, 0x00 ; 0 35c0a: 0f 94 76 ac call 0x358ec ; 0x358ec 35c0e: 81 11 cpse r24, r1 35c10: 03 c0 rjmp .+6 ; 0x35c18 break; } IncrementMMUFails(); 35c12: 0f 94 ee c4 call 0x389dc ; 0x389dc 35c16: e8 cf rjmp .-48 ; 0x35be8 } } 35c18: 0f 90 pop r0 35c1a: 0f 90 pop r0 35c1c: 0f 90 pop r0 35c1e: 0f 90 pop r0 35c20: 0f 90 pop r0 35c22: df 91 pop r29 35c24: cf 91 pop r28 35c26: 1f 91 pop r17 35c28: 08 95 ret 00035c2a : bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) { 35c2a: cf 93 push r28 35c2c: c8 2f mov r28, r24 lcd_print(' '); lcd_print(slot + 1); } void FullScreenMsgCut(uint8_t slot){ FullScreenMsg(_T(MSG_CUT_FILAMENT), slot); 35c2e: 87 e1 ldi r24, 0x17 ; 23 35c30: 9c e5 ldi r25, 0x5C ; 92 35c32: 0e 94 ac 72 call 0xe558 ; 0xe558 35c36: 6c 2f mov r22, r28 35c38: 0f 94 cf c4 call 0x3899e ; 0x3899e if (enableFullScreenMsg) { FullScreenMsgCut(slot); } { if (FindaDetectsFilament()) { 35c3c: 80 91 90 13 lds r24, 0x1390 ; 0x801390 35c40: 81 11 cpse r24, r1 unload(); 35c42: 0f 94 3d ad call 0x35a7a ; 0x35a7a struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 35c46: 0f 94 f8 87 call 0x30ff0 ; 0x30ff0 if (FindaDetectsFilament()) { unload(); } ReportingRAII rep(CommandInProgress::CutFilament); CutFilamentInner(slot); 35c4a: 8c 2f mov r24, r28 35c4c: 0f 94 eb ad call 0x35bd6 ; 0x35bd6 SetCurrentTool(MMU2_NO_TOOL); 35c50: 83 e6 ldi r24, 0x63 ; 99 35c52: 0f 94 03 88 call 0x31006 ; 0x31006 tool_change_extruder = MMU2_NO_TOOL; 35c56: 83 e6 ldi r24, 0x63 ; 99 35c58: 80 93 a2 13 sts 0x13A2, r24 ; 0x8013a2 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); 35c5c: 83 e0 ldi r24, 0x03 ; 3 35c5e: 0f 94 07 4e call 0x29c0e ; 0x29c0e explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 35c62: 0f 94 79 88 call 0x310f2 ; 0x310f2 CutFilamentInner(slot); SetCurrentTool(MMU2_NO_TOOL); tool_change_extruder = MMU2_NO_TOOL; MakeSound(SoundType::Confirm); } ScreenUpdateEnable(); 35c66: 0f 94 cc c4 call 0x38998 ; 0x38998 return true; } 35c6a: 81 e0 ldi r24, 0x01 ; 1 35c6c: cf 91 pop r28 35c6e: 08 95 ret 00035c70 : ch = UDR0; return ch; } static void putch(char ch) { while (!(UCSR0A & _BV(UDRE0))); 35c70: 90 91 c0 00 lds r25, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> 35c74: 95 ff sbrs r25, 5 35c76: fc cf rjmp .-8 ; 0x35c70 UDR0 = ch; 35c78: 80 93 c6 00 sts 0x00C6, r24 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> } 35c7c: 08 95 ret 00035c7e : #define RECV_READY ((UCSR0A & _BV(RXC0)) != 0) static uint8_t getch(void) { uint8_t ch; while(! RECV_READY) ; 35c7e: 80 91 c0 00 lds r24, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> 35c82: 87 ff sbrs r24, 7 35c84: fc cf rjmp .-8 ; 0x35c7e if (!(UCSR0A & _BV(FE0))) { 35c86: 80 91 c0 00 lds r24, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> 35c8a: 84 fd sbrc r24, 4 35c8c: 01 c0 rjmp .+2 ; 0x35c90 * 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(); 35c8e: a8 95 wdr } ch = UDR0; 35c90: 80 91 c6 00 lds r24, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> return ch; } 35c94: 08 95 ret 00035c96 : /// 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; 35c96: 86 27 eor r24, r22 35c98: 98 e0 ldi r25, 0x08 ; 8 for (uint8_t i = 0; i < 8; i++) { if ((data & 0x80U) != 0) { data <<= 1U; data ^= 0x07U; 35c9a: 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) { 35c9c: 38 2f mov r19, r24 35c9e: 88 0f add r24, r24 35ca0: 37 fd sbrc r19, 7 data <<= 1U; data ^= 0x07U; 35ca2: 82 27 eor r24, r18 35ca4: 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++) { 35ca6: d1 f7 brne .-12 ; 0x35c9c } else { data <<= 1U; } } return data; } 35ca8: 08 95 ret 00035caa : // 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) { 35caa: 2f 92 push r2 35cac: 3f 92 push r3 35cae: 4f 92 push r4 35cb0: 5f 92 push r5 35cb2: 6f 92 push r6 35cb4: 7f 92 push r7 35cb6: 8f 92 push r8 35cb8: 9f 92 push r9 35cba: af 92 push r10 35cbc: bf 92 push r11 35cbe: cf 92 push r12 35cc0: df 92 push r13 35cc2: ef 92 push r14 35cc4: ff 92 push r15 35cc6: 0f 93 push r16 35cc8: 1f 93 push r17 35cca: cf 93 push r28 35ccc: df 93 push r29 35cce: cd b7 in r28, 0x3d ; 61 35cd0: de b7 in r29, 0x3e ; 62 35cd2: a1 97 sbiw r28, 0x21 ; 33 35cd4: 0f b6 in r0, 0x3f ; 63 35cd6: f8 94 cli 35cd8: de bf out 0x3e, r29 ; 62 35cda: 0f be out 0x3f, r0 ; 63 35cdc: cd bf out 0x3d, r28 ; 61 35cde: 1c 01 movw r2, r24 35ce0: 48 01 movw r8, r16 35ce2: 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) 35ce4: fc 01 movw r30, r24 35ce6: e8 5b subi r30, 0xB8 ; 184 35ce8: ff 4f sbci r31, 0xFF ; 255 35cea: c0 80 ld r12, Z 35cec: d1 80 ldd r13, Z+1 ; 0x01 35cee: e2 80 ldd r14, Z+2 ; 0x02 35cf0: f3 80 ldd r15, Z+3 ; 0x03 35cf2: 9a 01 movw r18, r20 35cf4: ab 01 movw r20, r22 35cf6: c7 01 movw r24, r14 35cf8: b6 01 movw r22, r12 35cfa: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 35cfe: 0f 94 22 de call 0x3bc44 ; 0x3bc44 35d02: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 35d06: 8b 01 movw r16, r22 35d08: 8d 83 std Y+5, r24 ; 0x05 35d0a: 99 83 std Y+1, r25 ; 0x01 uint32_t final_rate = ceil(exit_speed * block->speed_factor); // (step/min) 35d0c: a5 01 movw r20, r10 35d0e: 94 01 movw r18, r8 35d10: c7 01 movw r24, r14 35d12: b6 01 movw r22, r12 35d14: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 35d18: 0f 94 22 de call 0x3bc44 ; 0x3bc44 35d1c: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 35d20: 36 2f mov r19, r22 35d22: 27 2f mov r18, r23 35d24: a8 01 movw r20, r16 35d26: 6d 81 ldd r22, Y+5 ; 0x05 35d28: 79 81 ldd r23, Y+1 ; 0x01 35d2a: 48 37 cpi r20, 0x78 ; 120 35d2c: 51 05 cpc r21, r1 35d2e: 61 05 cpc r22, r1 35d30: 71 05 cpc r23, r1 35d32: 20 f4 brcc .+8 ; 0x35d3c 35d34: 48 e7 ldi r20, 0x78 ; 120 35d36: 50 e0 ldi r21, 0x00 ; 0 35d38: 60 e0 ldi r22, 0x00 ; 0 35d3a: 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) 35d3c: d1 01 movw r26, r2 35d3e: d6 96 adiw r26, 0x36 ; 54 35d40: 8d 90 ld r8, X+ 35d42: 9d 90 ld r9, X+ 35d44: ad 90 ld r10, X+ 35d46: bc 90 ld r11, X 35d48: d9 97 sbiw r26, 0x39 ; 57 35d4a: 8f 8a std Y+23, r8 ; 0x17 35d4c: 98 8e std Y+24, r9 ; 0x18 35d4e: a9 8e std Y+25, r10 ; 0x19 35d50: ba 8e std Y+26, r11 ; 0x1a 35d52: 48 15 cp r20, r8 35d54: 59 05 cpc r21, r9 35d56: 6a 05 cpc r22, r10 35d58: 7b 05 cpc r23, r11 35d5a: 20 f4 brcc .+8 ; 0x35d64 35d5c: 4f 8b std Y+23, r20 ; 0x17 35d5e: 58 8f std Y+24, r21 ; 0x18 35d60: 69 8f std Y+25, r22 ; 0x19 35d62: 7a 8f std Y+26, r23 ; 0x1a 35d64: 43 2f mov r20, r19 35d66: 52 2f mov r21, r18 35d68: bc 01 movw r22, r24 35d6a: 48 37 cpi r20, 0x78 ; 120 35d6c: 51 05 cpc r21, r1 35d6e: 61 05 cpc r22, r1 35d70: 71 05 cpc r23, r1 35d72: 20 f4 brcc .+8 ; 0x35d7c 35d74: 48 e7 ldi r20, 0x78 ; 120 35d76: 50 e0 ldi r21, 0x00 ; 0 35d78: 60 e0 ldi r22, 0x00 ; 0 35d7a: 70 e0 ldi r23, 0x00 ; 0 35d7c: 18 2d mov r17, r8 35d7e: 09 2d mov r16, r9 35d80: a9 a2 std Y+33, r10 ; 0x21 35d82: b8 a2 std Y+32, r11 ; 0x20 35d84: 48 15 cp r20, r8 35d86: 59 05 cpc r21, r9 35d88: 6a 05 cpc r22, r10 35d8a: 7b 05 cpc r23, r11 35d8c: 20 f4 brcc .+8 ; 0x35d96 35d8e: 14 2f mov r17, r20 35d90: 05 2f mov r16, r21 35d92: 69 a3 std Y+33, r22 ; 0x21 35d94: 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; 35d96: f1 01 movw r30, r2 35d98: ee 5b subi r30, 0xBE ; 190 35d9a: ff 4f sbci r31, 0xFF ; 255 35d9c: c0 80 ld r12, Z 35d9e: d1 80 ldd r13, Z+1 ; 0x01 35da0: e2 80 ldd r14, Z+2 ; 0x02 35da2: f3 80 ldd r15, Z+3 ; 0x03 35da4: cd 82 std Y+5, r12 ; 0x05 35da6: de 82 std Y+6, r13 ; 0x06 35da8: ef 82 std Y+7, r14 ; 0x07 35daa: f8 86 std Y+8, r15 ; 0x08 if (acceleration == 0) 35dac: cd 28 or r12, r13 35dae: ce 28 or r12, r14 35db0: cf 28 or r12, r15 35db2: 41 f4 brne .+16 ; 0x35dc4 // Don't allow zero acceleration. acceleration = 1; 35db4: c1 2c mov r12, r1 35db6: d1 2c mov r13, r1 35db8: 76 01 movw r14, r12 35dba: c3 94 inc r12 35dbc: cd 82 std Y+5, r12 ; 0x05 35dbe: de 82 std Y+6, r13 ; 0x06 35dc0: ef 82 std Y+7, r14 ; 0x07 35dc2: 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; 35dc4: 2f 89 ldd r18, Y+23 ; 0x17 35dc6: 38 8d ldd r19, Y+24 ; 0x18 35dc8: 49 8d ldd r20, Y+25 ; 0x19 35dca: 5a 8d ldd r21, Y+26 ; 0x1a 35dcc: b9 01 movw r22, r18 35dce: ca 01 movw r24, r20 35dd0: 0f 94 7f dc call 0x3b8fe ; 0x3b8fe <__mulsi3> 35dd4: 6d 87 std Y+13, r22 ; 0x0d 35dd6: 7e 87 std Y+14, r23 ; 0x0e 35dd8: 8f 87 std Y+15, r24 ; 0x0f 35dda: 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; 35ddc: a5 01 movw r20, r10 35dde: 94 01 movw r18, r8 35de0: c5 01 movw r24, r10 35de2: b4 01 movw r22, r8 35de4: 0f 94 7f dc call 0x3b8fe ; 0x3b8fe <__mulsi3> 35de8: 2b 01 movw r4, r22 35dea: 3c 01 movw r6, r24 uint32_t final_rate_sqr = final_rate*final_rate; 35dec: 21 2f mov r18, r17 35dee: 30 2f mov r19, r16 35df0: 49 a1 ldd r20, Y+33 ; 0x21 35df2: 58 a1 ldd r21, Y+32 ; 0x20 35df4: 61 2f mov r22, r17 35df6: 70 2f mov r23, r16 35df8: ca 01 movw r24, r20 35dfa: 0f 94 7f dc call 0x3b8fe ; 0x3b8fe <__mulsi3> 35dfe: 69 8b std Y+17, r22 ; 0x11 35e00: 7a 8b std Y+18, r23 ; 0x12 35e02: 8b 8b std Y+19, r24 ; 0x13 35e04: 9c 8b std Y+20, r25 ; 0x14 uint32_t acceleration_x2 = acceleration << 1; 35e06: cd 80 ldd r12, Y+5 ; 0x05 35e08: de 80 ldd r13, Y+6 ; 0x06 35e0a: ef 80 ldd r14, Y+7 ; 0x07 35e0c: f8 84 ldd r15, Y+8 ; 0x08 35e0e: cc 0c add r12, r12 35e10: dd 1c adc r13, r13 35e12: ee 1c adc r14, r14 35e14: ff 1c adc r15, r15 35e16: c9 86 std Y+9, r12 ; 0x09 35e18: da 86 std Y+10, r13 ; 0x0a 35e1a: eb 86 std Y+11, r14 ; 0x0b 35e1c: 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; 35e1e: c3 01 movw r24, r6 35e20: b2 01 movw r22, r4 35e22: 61 50 subi r22, 0x01 ; 1 35e24: 71 09 sbc r23, r1 35e26: 81 09 sbc r24, r1 35e28: 91 09 sbc r25, r1 35e2a: cd 84 ldd r12, Y+13 ; 0x0d 35e2c: de 84 ldd r13, Y+14 ; 0x0e 35e2e: ef 84 ldd r14, Y+15 ; 0x0f 35e30: f8 88 ldd r15, Y+16 ; 0x10 35e32: 6c 19 sub r22, r12 35e34: 7d 09 sbc r23, r13 35e36: 8e 09 sbc r24, r14 35e38: 9f 09 sbc r25, r15 35e3a: c9 84 ldd r12, Y+9 ; 0x09 35e3c: da 84 ldd r13, Y+10 ; 0x0a 35e3e: eb 84 ldd r14, Y+11 ; 0x0b 35e40: fc 84 ldd r15, Y+12 ; 0x0c 35e42: 6c 0d add r22, r12 35e44: 7d 1d adc r23, r13 35e46: 8e 1d adc r24, r14 35e48: 9f 1d adc r25, r15 35e4a: a7 01 movw r20, r14 35e4c: 96 01 movw r18, r12 35e4e: 0f 94 8f dc call 0x3b91e ; 0x3b91e <__udivmodsi4> 35e52: 69 01 movw r12, r18 35e54: 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; 35e56: c3 01 movw r24, r6 35e58: b2 01 movw r22, r4 35e5a: 29 89 ldd r18, Y+17 ; 0x11 35e5c: 3a 89 ldd r19, Y+18 ; 0x12 35e5e: 4b 89 ldd r20, Y+19 ; 0x13 35e60: 5c 89 ldd r21, Y+20 ; 0x14 35e62: 62 1b sub r22, r18 35e64: 73 0b sbc r23, r19 35e66: 84 0b sbc r24, r20 35e68: 95 0b sbc r25, r21 35e6a: 29 85 ldd r18, Y+9 ; 0x09 35e6c: 3a 85 ldd r19, Y+10 ; 0x0a 35e6e: 4b 85 ldd r20, Y+11 ; 0x0b 35e70: 5c 85 ldd r21, Y+12 ; 0x0c 35e72: 0f 94 8f dc call 0x3b91e ; 0x3b91e <__udivmodsi4> 35e76: 29 01 movw r4, r18 35e78: 3a 01 movw r6, r20 uint32_t accel_decel_steps = accelerate_steps + decelerate_steps; 35e7a: d7 01 movw r26, r14 35e7c: c6 01 movw r24, r12 35e7e: 84 0d add r24, r4 35e80: 95 1d adc r25, r5 35e82: a6 1d adc r26, r6 35e84: b7 1d adc r27, r7 35e86: 8c 8f std Y+28, r24 ; 0x1c 35e88: 9d 8f std Y+29, r25 ; 0x1d 35e8a: ae 8f std Y+30, r26 ; 0x1e 35e8c: 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) { 35e8e: f1 01 movw r30, r2 35e90: e4 5b subi r30, 0xB4 ; 180 35e92: ff 4f sbci r31, 0xFF ; 255 35e94: 90 81 ld r25, Z 35e96: 9b 8f std Y+27, r25 ; 0x1b 35e98: 99 23 and r25, r25 35e9a: 09 f4 brne .+2 ; 0x35e9e 35e9c: 8d c0 rjmp .+282 ; 0x35fb8 final_adv_steps = final_rate * block->adv_comp; 35e9e: 61 2f mov r22, r17 35ea0: 70 2f mov r23, r16 35ea2: 89 a1 ldd r24, Y+33 ; 0x21 35ea4: 98 a1 ldd r25, Y+32 ; 0x20 35ea6: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 35eaa: f1 01 movw r30, r2 35eac: ec 5a subi r30, 0xAC ; 172 35eae: ff 4f sbci r31, 0xFF ; 255 35eb0: 20 81 ld r18, Z 35eb2: 31 81 ldd r19, Z+1 ; 0x01 35eb4: 42 81 ldd r20, Z+2 ; 0x02 35eb6: 53 81 ldd r21, Z+3 ; 0x03 35eb8: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 35ebc: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 35ec0: 6d 8b std Y+21, r22 ; 0x15 35ec2: 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) { 35ec4: d1 01 movw r26, r2 35ec6: 50 96 adiw r26, 0x10 ; 16 35ec8: 2d 91 ld r18, X+ 35eca: 3d 91 ld r19, X+ 35ecc: 4d 91 ld r20, X+ 35ece: 5c 91 ld r21, X 35ed0: 53 97 sbiw r26, 0x13 ; 19 35ed2: 29 83 std Y+1, r18 ; 0x01 35ed4: 3a 83 std Y+2, r19 ; 0x02 35ed6: 4b 83 std Y+3, r20 ; 0x03 35ed8: 5c 83 std Y+4, r21 ; 0x04 35eda: 8c 8d ldd r24, Y+28 ; 0x1c 35edc: 9d 8d ldd r25, Y+29 ; 0x1d 35ede: ae 8d ldd r26, Y+30 ; 0x1e 35ee0: bf 8d ldd r27, Y+31 ; 0x1f 35ee2: 82 17 cp r24, r18 35ee4: 93 07 cpc r25, r19 35ee6: a4 07 cpc r26, r20 35ee8: b5 07 cpc r27, r21 35eea: 08 f0 brcs .+2 ; 0x35eee 35eec: 68 c0 rjmp .+208 ; 0x35fbe plateau_steps = block->step_event_count.wide - accel_decel_steps; 35eee: 29 01 movw r4, r18 35ef0: 3a 01 movw r6, r20 35ef2: 48 1a sub r4, r24 35ef4: 59 0a sbc r5, r25 35ef6: 6a 0a sbc r6, r26 35ef8: 7b 0a sbc r7, r27 #ifdef LIN_ADVANCE if (block->use_advance_lead) 35efa: 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; 35efc: 40 e0 ldi r20, 0x00 ; 0 35efe: 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) 35f00: 99 23 and r25, r25 35f02: 89 f0 breq .+34 ; 0x35f26 max_adv_steps = block->nominal_rate * block->adv_comp; 35f04: c5 01 movw r24, r10 35f06: b4 01 movw r22, r8 35f08: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 35f0c: f1 01 movw r30, r2 35f0e: ec 5a subi r30, 0xAC ; 172 35f10: ff 4f sbci r31, 0xFF ; 255 35f12: 20 81 ld r18, Z 35f14: 31 81 ldd r19, Z+1 ; 0x01 35f16: 42 81 ldd r20, Z+2 ; 0x02 35f18: 53 81 ldd r21, Z+3 ; 0x03 35f1a: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 35f1e: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 35f22: 46 2f mov r20, r22 35f24: 87 2f mov r24, r23 } } #endif } CRITICAL_SECTION_START; // Fill variables used by the stepper in a critical section 35f26: 3f b7 in r19, 0x3f ; 63 35f28: 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. 35f2a: f1 01 movw r30, r2 35f2c: e9 5b subi r30, 0xB9 ; 185 35f2e: ff 4f sbci r31, 0xFF ; 255 35f30: 20 81 ld r18, Z 35f32: 21 11 cpse r18, r1 35f34: 27 c0 rjmp .+78 ; 0x35f84 block->accelerate_until = accelerate_steps; 35f36: d1 01 movw r26, r2 35f38: 59 96 adiw r26, 0x19 ; 25 35f3a: cd 92 st X+, r12 35f3c: dd 92 st X+, r13 35f3e: ed 92 st X+, r14 35f40: fc 92 st X, r15 35f42: 5c 97 sbiw r26, 0x1c ; 28 block->decelerate_after = accelerate_steps+plateau_steps; 35f44: c4 0c add r12, r4 35f46: d5 1c adc r13, r5 35f48: e6 1c adc r14, r6 35f4a: f7 1c adc r15, r7 35f4c: f1 01 movw r30, r2 35f4e: c5 8e std Z+29, r12 ; 0x1d 35f50: d6 8e std Z+30, r13 ; 0x1e 35f52: e7 8e std Z+31, r14 ; 0x1f 35f54: f0 a2 std Z+32, r15 ; 0x20 block->initial_rate = initial_rate; 35f56: cf 88 ldd r12, Y+23 ; 0x17 35f58: c2 ae std Z+58, r12 ; 0x3a 35f5a: d8 8c ldd r13, Y+24 ; 0x18 35f5c: d3 ae std Z+59, r13 ; 0x3b 35f5e: e9 8c ldd r14, Y+25 ; 0x19 35f60: e4 ae std Z+60, r14 ; 0x3c 35f62: fa 8c ldd r15, Y+26 ; 0x1a 35f64: f5 ae std Z+61, r15 ; 0x3d block->final_rate = final_rate; 35f66: fe 96 adiw r30, 0x3e ; 62 35f68: 10 83 st Z, r17 35f6a: 01 83 std Z+1, r16 ; 0x01 35f6c: c9 a0 ldd r12, Y+33 ; 0x21 35f6e: c2 82 std Z+2, r12 ; 0x02 35f70: d8 a0 ldd r13, Y+32 ; 0x20 35f72: d3 82 std Z+3, r13 ; 0x03 #ifdef LIN_ADVANCE block->final_adv_steps = final_adv_steps; 35f74: 73 96 adiw r30, 0x13 ; 19 35f76: ed 88 ldd r14, Y+21 ; 0x15 35f78: e0 82 st Z, r14 35f7a: fe 88 ldd r15, Y+22 ; 0x16 35f7c: f1 82 std Z+1, r15 ; 0x01 block->max_adv_steps = max_adv_steps; 35f7e: 32 97 sbiw r30, 0x02 ; 2 35f80: 40 83 st Z, r20 35f82: 81 83 std Z+1, r24 ; 0x01 #endif } CRITICAL_SECTION_END; 35f84: 3f bf out 0x3f, r19 ; 63 } 35f86: a1 96 adiw r28, 0x21 ; 33 35f88: 0f b6 in r0, 0x3f ; 63 35f8a: f8 94 cli 35f8c: de bf out 0x3e, r29 ; 62 35f8e: 0f be out 0x3f, r0 ; 63 35f90: cd bf out 0x3d, r28 ; 61 35f92: df 91 pop r29 35f94: cf 91 pop r28 35f96: 1f 91 pop r17 35f98: 0f 91 pop r16 35f9a: ff 90 pop r15 35f9c: ef 90 pop r14 35f9e: df 90 pop r13 35fa0: cf 90 pop r12 35fa2: bf 90 pop r11 35fa4: af 90 pop r10 35fa6: 9f 90 pop r9 35fa8: 8f 90 pop r8 35faa: 7f 90 pop r7 35fac: 6f 90 pop r6 35fae: 5f 90 pop r5 35fb0: 4f 90 pop r4 35fb2: 3f 90 pop r3 35fb4: 2f 90 pop r2 35fb6: 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; 35fb8: 1d 8a std Y+21, r1 ; 0x15 35fba: 1e 8a std Y+22, r1 ; 0x16 35fbc: 83 cf rjmp .-250 ; 0x35ec4 #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; 35fbe: 2d 81 ldd r18, Y+5 ; 0x05 35fc0: 3e 81 ldd r19, Y+6 ; 0x06 35fc2: 4f 81 ldd r20, Y+7 ; 0x07 35fc4: 58 85 ldd r21, Y+8 ; 0x08 35fc6: 82 e0 ldi r24, 0x02 ; 2 35fc8: 22 0f add r18, r18 35fca: 33 1f adc r19, r19 35fcc: 44 1f adc r20, r20 35fce: 55 1f adc r21, r21 35fd0: 8a 95 dec r24 35fd2: d1 f7 brne .-12 ; 0x35fc8 35fd4: 89 81 ldd r24, Y+1 ; 0x01 35fd6: 9a 81 ldd r25, Y+2 ; 0x02 35fd8: ab 81 ldd r26, Y+3 ; 0x03 35fda: bc 81 ldd r27, Y+4 ; 0x04 35fdc: 81 70 andi r24, 0x01 ; 1 35fde: 99 27 eor r25, r25 35fe0: aa 27 eor r26, r26 35fe2: bb 27 eor r27, r27 35fe4: 8d 83 std Y+5, r24 ; 0x05 35fe6: 9e 83 std Y+6, r25 ; 0x06 35fe8: af 83 std Y+7, r26 ; 0x07 35fea: b8 87 std Y+8, r27 ; 0x08 35fec: 89 80 ldd r8, Y+1 ; 0x01 35fee: 9a 80 ldd r9, Y+2 ; 0x02 35ff0: ab 80 ldd r10, Y+3 ; 0x03 35ff2: bc 80 ldd r11, Y+4 ; 0x04 35ff4: b6 94 lsr r11 35ff6: a7 94 ror r10 35ff8: 97 94 ror r9 35ffa: 87 94 ror r8 // Avoid negative numbers if (final_rate_sqr >= initial_rate_sqr) { 35ffc: cd 84 ldd r12, Y+13 ; 0x0d 35ffe: de 84 ldd r13, Y+14 ; 0x0e 36000: ef 84 ldd r14, Y+15 ; 0x0f 36002: f8 88 ldd r15, Y+16 ; 0x10 36004: 89 89 ldd r24, Y+17 ; 0x11 36006: 9a 89 ldd r25, Y+18 ; 0x12 36008: ab 89 ldd r26, Y+19 ; 0x13 3600a: bc 89 ldd r27, Y+20 ; 0x14 3600c: 8c 15 cp r24, r12 3600e: 9d 05 cpc r25, r13 36010: ae 05 cpc r26, r14 36012: bf 05 cpc r27, r15 36014: 08 f4 brcc .+2 ; 0x36018 36016: 6f c0 rjmp .+222 ; 0x360f6 // 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; 36018: 6c 01 movw r12, r24 3601a: 7d 01 movw r14, r26 3601c: 91 e0 ldi r25, 0x01 ; 1 3601e: c9 1a sub r12, r25 36020: d1 08 sbc r13, r1 36022: e1 08 sbc r14, r1 36024: f1 08 sbc r15, r1 36026: 8d 85 ldd r24, Y+13 ; 0x0d 36028: 9e 85 ldd r25, Y+14 ; 0x0e 3602a: af 85 ldd r26, Y+15 ; 0x0f 3602c: b8 89 ldd r27, Y+16 ; 0x10 3602e: c8 1a sub r12, r24 36030: d9 0a sbc r13, r25 36032: ea 0a sbc r14, r26 36034: fb 0a sbc r15, r27 36036: c7 01 movw r24, r14 36038: b6 01 movw r22, r12 3603a: 62 0f add r22, r18 3603c: 73 1f adc r23, r19 3603e: 84 1f adc r24, r20 36040: 95 1f adc r25, r21 if (block->step_event_count.wide & 1) 36042: cd 80 ldd r12, Y+5 ; 0x05 36044: de 80 ldd r13, Y+6 ; 0x06 36046: ef 80 ldd r14, Y+7 ; 0x07 36048: f8 84 ldd r15, Y+8 ; 0x08 3604a: cd 28 or r12, r13 3604c: ce 28 or r12, r14 3604e: cf 28 or r12, r15 36050: 41 f0 breq .+16 ; 0x36062 accelerate_steps += acceleration_x2; 36052: c9 84 ldd r12, Y+9 ; 0x09 36054: da 84 ldd r13, Y+10 ; 0x0a 36056: eb 84 ldd r14, Y+11 ; 0x0b 36058: fc 84 ldd r15, Y+12 ; 0x0c 3605a: 6c 0d add r22, r12 3605c: 7d 1d adc r23, r13 3605e: 8e 1d adc r24, r14 36060: 9f 1d adc r25, r15 accelerate_steps /= acceleration_x4; 36062: 0f 94 8f dc call 0x3b91e ; 0x3b91e <__udivmodsi4> 36066: 75 01 movw r14, r10 36068: 64 01 movw r12, r8 3606a: c2 0e add r12, r18 3606c: d3 1e adc r13, r19 3606e: e4 1e adc r14, r20 36070: f5 1e adc r15, r21 36072: 29 81 ldd r18, Y+1 ; 0x01 36074: 3a 81 ldd r19, Y+2 ; 0x02 36076: 4b 81 ldd r20, Y+3 ; 0x03 36078: 5c 81 ldd r21, Y+4 ; 0x04 3607a: 2c 15 cp r18, r12 3607c: 3d 05 cpc r19, r13 3607e: 4e 05 cpc r20, r14 36080: 5f 05 cpc r21, r15 36082: 10 f4 brcc .+4 ; 0x36088 36084: 69 01 movw r12, r18 36086: 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) { 36088: 2b 8d ldd r18, Y+27 ; 0x1b 3608a: 22 23 and r18, r18 3608c: 09 f4 brne .+2 ; 0x36090 3608e: 69 c0 rjmp .+210 ; 0x36162 if(!accelerate_steps || !decelerate_steps) { 36090: c1 14 cp r12, r1 36092: d1 04 cpc r13, r1 36094: e1 04 cpc r14, r1 36096: f1 04 cpc r15, r1 36098: 09 f4 brne .+2 ; 0x3609c 3609a: 66 c0 rjmp .+204 ; 0x36168 // 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; 3609c: 4d 89 ldd r20, Y+21 ; 0x15 3609e: 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) { 360a0: 41 14 cp r4, r1 360a2: 51 04 cpc r5, r1 360a4: 61 04 cpc r6, r1 360a6: 71 04 cpc r7, r1 360a8: 09 f4 brne .+2 ; 0x360ac 360aa: 3d cf rjmp .-390 ; 0x35f26 // 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); 360ac: a7 01 movw r20, r14 360ae: 96 01 movw r18, r12 360b0: 69 85 ldd r22, Y+9 ; 0x09 360b2: 7a 85 ldd r23, Y+10 ; 0x0a 360b4: 8b 85 ldd r24, Y+11 ; 0x0b 360b6: 9c 85 ldd r25, Y+12 ; 0x0c 360b8: 0f 94 7f dc call 0x3b8fe ; 0x3b8fe <__mulsi3> 360bc: 2d 85 ldd r18, Y+13 ; 0x0d 360be: 3e 85 ldd r19, Y+14 ; 0x0e 360c0: 4f 85 ldd r20, Y+15 ; 0x0f 360c2: 58 89 ldd r21, Y+16 ; 0x10 360c4: 62 0f add r22, r18 360c6: 73 1f adc r23, r19 360c8: 84 1f adc r24, r20 360ca: 95 1f adc r25, r21 360cc: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 360d0: 0f 94 12 e1 call 0x3c224 ; 0x3c224 max_adv_steps = max_rate * block->adv_comp; 360d4: f1 01 movw r30, r2 360d6: ec 5a subi r30, 0xAC ; 172 360d8: ff 4f sbci r31, 0xFF ; 255 360da: 20 81 ld r18, Z 360dc: 31 81 ldd r19, Z+1 ; 0x01 360de: 42 81 ldd r20, Z+2 ; 0x02 360e0: 53 81 ldd r21, Z+3 ; 0x03 360e2: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 360e6: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 360ea: 46 2f mov r20, r22 360ec: 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; 360ee: 41 2c mov r4, r1 360f0: 51 2c mov r5, r1 360f2: 32 01 movw r6, r4 360f4: 18 cf rjmp .-464 ; 0x35f26 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; 360f6: 6d 85 ldd r22, Y+13 ; 0x0d 360f8: 7e 85 ldd r23, Y+14 ; 0x0e 360fa: 8f 85 ldd r24, Y+15 ; 0x0f 360fc: 98 89 ldd r25, Y+16 ; 0x10 360fe: c9 88 ldd r12, Y+17 ; 0x11 36100: da 88 ldd r13, Y+18 ; 0x12 36102: eb 88 ldd r14, Y+19 ; 0x13 36104: fc 88 ldd r15, Y+20 ; 0x14 36106: 6c 19 sub r22, r12 36108: 7d 09 sbc r23, r13 3610a: 8e 09 sbc r24, r14 3610c: 9f 09 sbc r25, r15 if (block->step_event_count.wide & 1) 3610e: cd 80 ldd r12, Y+5 ; 0x05 36110: de 80 ldd r13, Y+6 ; 0x06 36112: ef 80 ldd r14, Y+7 ; 0x07 36114: f8 84 ldd r15, Y+8 ; 0x08 36116: cd 28 or r12, r13 36118: ce 28 or r12, r14 3611a: cf 28 or r12, r15 3611c: 41 f0 breq .+16 ; 0x3612e decelerate_steps += acceleration_x2; 3611e: c9 84 ldd r12, Y+9 ; 0x09 36120: da 84 ldd r13, Y+10 ; 0x0a 36122: eb 84 ldd r14, Y+11 ; 0x0b 36124: fc 84 ldd r15, Y+12 ; 0x0c 36126: 6c 0d add r22, r12 36128: 7d 1d adc r23, r13 3612a: 8e 1d adc r24, r14 3612c: 9f 1d adc r25, r15 decelerate_steps /= acceleration_x4; 3612e: 0f 94 8f dc call 0x3b91e ; 0x3b91e <__udivmodsi4> decelerate_steps += (block->step_event_count.wide >> 1); 36132: 82 0e add r8, r18 36134: 93 1e adc r9, r19 36136: a4 1e adc r10, r20 36138: b5 1e adc r11, r21 3613a: 49 80 ldd r4, Y+1 ; 0x01 3613c: 5a 80 ldd r5, Y+2 ; 0x02 3613e: 6b 80 ldd r6, Y+3 ; 0x03 36140: 7c 80 ldd r7, Y+4 ; 0x04 36142: 84 14 cp r8, r4 36144: 95 04 cpc r9, r5 36146: a6 04 cpc r10, r6 36148: b7 04 cpc r11, r7 3614a: 10 f4 brcc .+4 ; 0x36150 3614c: 24 01 movw r4, r8 3614e: 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; 36150: c9 80 ldd r12, Y+1 ; 0x01 36152: da 80 ldd r13, Y+2 ; 0x02 36154: eb 80 ldd r14, Y+3 ; 0x03 36156: fc 80 ldd r15, Y+4 ; 0x04 36158: c4 18 sub r12, r4 3615a: d5 08 sbc r13, r5 3615c: e6 08 sbc r14, r6 3615e: f7 08 sbc r15, r7 36160: 93 cf rjmp .-218 ; 0x36088 // 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; 36162: 40 e0 ldi r20, 0x00 ; 0 36164: 80 e0 ldi r24, 0x00 ; 0 36166: c3 cf rjmp .-122 ; 0x360ee #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; 36168: 4d 89 ldd r20, Y+21 ; 0x15 3616a: 8e 89 ldd r24, Y+22 ; 0x16 3616c: c0 cf rjmp .-128 ; 0x360ee 0003616e : while (!(UCSR0A & _BV(UDRE0))); UDR0 = ch; } static void verifySpace() { if (getch() != CRC_EOP) { 3616e: 0f 94 3f ae call 0x35c7e ; 0x35c7e 36172: 80 32 cpi r24, 0x20 ; 32 36174: 29 f0 breq .+10 ; 0x36180 putch(STK_FAILED); 36176: 81 e1 ldi r24, 0x11 ; 17 36178: 0f 94 38 ae call 0x35c70 ; 0x35c70 softReset(); 3617c: 0e 94 4c 67 call 0xce98 ; 0xce98 } putch(STK_INSYNC); 36180: 84 e1 ldi r24, 0x14 ; 20 36182: 0d 94 38 ae jmp 0x35c70 ; 0x35c70 00036186 : } static void getNch(uint8_t count) { 36186: cf 93 push r28 36188: c8 2f mov r28, r24 do getch(); while (--count); 3618a: 0f 94 3f ae call 0x35c7e ; 0x35c7e 3618e: c1 50 subi r28, 0x01 ; 1 36190: e1 f7 brne .-8 ; 0x3618a verifySpace(); } 36192: cf 91 pop r28 putch(STK_INSYNC); } static void getNch(uint8_t count) { do getch(); while (--count); verifySpace(); 36194: 0d 94 b7 b0 jmp 0x3616e ; 0x3616e 00036198 : /// @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) { 36198: 0f 93 push r16 3619a: 1f 93 push r17 3619c: cf 93 push r28 3619e: df 93 push r29 361a0: eb 01 movw r28, r22 361a2: 14 2f mov r17, r20 361a4: 05 2f mov r16, r21 lcd_putc(chr); 361a6: 0e 94 cf 6e call 0xdd9e ; 0xdd9e lcd_puts_P(str); 361aa: ce 01 movw r24, r28 361ac: 0e 94 cb 6e call 0xdd96 ; 0xdd96 lcd_putc(':'); 361b0: 8a e3 ldi r24, 0x3A ; 58 361b2: 0e 94 cf 6e call 0xdd9e ; 0xdd9e 361b6: ce 01 movw r24, r28 361b8: 0f 94 da d9 call 0x3b3b4 ; 0x3b3b4 <__strlen_P> // Padding to compensate variable string length const uint8_t len = strlen_P(str); lcd_space((LCD_WIDTH - 4) - (2 + len)); 361bc: 9e e0 ldi r25, 0x0E ; 14 361be: 98 1b sub r25, r24 361c0: 89 2f mov r24, r25 361c2: 0e 94 d6 6e call 0xddac ; 0xddac // Right adjusted value lcd_printf_P(PSTR("%4d"), val); 361c6: 0f 93 push r16 361c8: 1f 93 push r17 361ca: 8f ed ldi r24, 0xDF ; 223 361cc: 9b ea ldi r25, 0xAB ; 171 361ce: 9f 93 push r25 361d0: 8f 93 push r24 361d2: 0e 94 b9 6e call 0xdd72 ; 0xdd72 361d6: 0f 90 pop r0 361d8: 0f 90 pop r0 361da: 0f 90 pop r0 361dc: 0f 90 pop r0 } 361de: df 91 pop r29 361e0: cf 91 pop r28 361e2: 1f 91 pop r17 361e4: 0f 91 pop r16 361e6: 08 95 ret 000361e8 : // 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) { 361e8: 2f 92 push r2 361ea: 3f 92 push r3 361ec: 4f 92 push r4 361ee: 5f 92 push r5 361f0: 6f 92 push r6 361f2: 7f 92 push r7 361f4: 8f 92 push r8 361f6: 9f 92 push r9 361f8: af 92 push r10 361fa: bf 92 push r11 361fc: cf 92 push r12 361fe: df 92 push r13 36200: ef 92 push r14 36202: ff 92 push r15 36204: 0f 93 push r16 36206: 1f 93 push r17 36208: cf 93 push r28 3620a: df 93 push r29 3620c: cd b7 in r28, 0x3d ; 61 3620e: de b7 in r29, 0x3e ; 62 36210: c5 58 subi r28, 0x85 ; 133 36212: d1 09 sbc r29, r1 36214: 0f b6 in r0, 0x3f ; 63 36216: f8 94 cli 36218: de bf out 0x3e, r29 ; 62 3621a: 0f be out 0x3f, r0 ; 63 3621c: cd bf out 0x3d, r28 ; 61 3621e: 69 a3 std Y+33, r22 ; 0x21 36220: 7a a3 std Y+34, r23 ; 0x22 36222: 8b a3 std Y+35, r24 ; 0x23 36224: 9c a3 std Y+36, r25 ; 0x24 36226: 2d a3 std Y+37, r18 ; 0x25 36228: 3e a3 std Y+38, r19 ; 0x26 3622a: 4f a3 std Y+39, r20 ; 0x27 3622c: 58 a7 std Y+40, r21 ; 0x28 3622e: a8 96 adiw r28, 0x28 ; 40 36230: ec ae std Y+60, r14 ; 0x3c 36232: fd ae std Y+61, r15 ; 0x3d 36234: 0e af std Y+62, r16 ; 0x3e 36236: 1f af std Y+63, r17 ; 0x3f 36238: a8 97 sbiw r28, 0x28 ; 40 3623a: aa 96 adiw r28, 0x2a ; 42 3623c: df ae std Y+63, r13 ; 0x3f 3623e: ce ae std Y+62, r12 ; 0x3e 36240: aa 97 sbiw r28, 0x2a ; 42 36242: 89 aa std Y+49, r8 ; 0x31 36244: 99 ae std Y+57, r9 ; 0x39 36246: ad ae std Y+61, r10 ; 0x3d 36248: bd aa std Y+53, r11 ; 0x35 3624a: c5 56 subi r28, 0x65 ; 101 3624c: df 4f sbci r29, 0xFF ; 255 3624e: 08 81 ld r16, Y 36250: 19 81 ldd r17, Y+1 ; 0x01 36252: cb 59 subi r28, 0x9B ; 155 36254: 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); 36256: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 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) 3625a: 8f 5f subi r24, 0xFF ; 255 3625c: a1 96 adiw r28, 0x21 ; 33 3625e: 8f af std Y+63, r24 ; 0x3f 36260: a1 97 sbiw r28, 0x21 ; 33 36262: 80 31 cpi r24, 0x10 ; 16 36264: 19 f4 brne .+6 ; 0x3626c block_index = 0; 36266: a1 96 adiw r28, 0x21 ; 33 36268: 1f ae std Y+63, r1 ; 0x3f 3626a: 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) { 3626c: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 36270: a1 96 adiw r28, 0x21 ; 33 36272: 2f ad ldd r18, Y+63 ; 0x3f 36274: a1 97 sbiw r28, 0x21 ; 33 36276: 82 13 cpse r24, r18 36278: 0f c0 rjmp .+30 ; 0x36298 do { manage_heater(); 3627a: 0f 94 5c 38 call 0x270b8 ; 0x270b8 // Vojtech: Don't disable motors inside the planner! manage_inactivity(false); 3627e: 80 e0 ldi r24, 0x00 ; 0 36280: 0e 94 af 8a call 0x1155e ; 0x1155e lcd_update(0); 36284: 80 e0 ldi r24, 0x00 ; 0 36286: 0e 94 a7 6e call 0xdd4e ; 0xdd4e } while (block_buffer_tail == next_buffer_head); 3628a: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 3628e: a1 96 adiw r28, 0x21 ; 33 36290: 3f ad ldd r19, Y+63 ; 0x3f 36292: a1 97 sbiw r28, 0x21 ; 33 36294: 83 17 cp r24, r19 36296: 89 f3 breq .-30 ; 0x3627a } #ifdef PLANNER_DIAGNOSTICS planner_update_queue_min_counter(); #endif /* PLANNER_DIAGNOSTICS */ if(planner_aborted) { 36298: 40 91 ac 0d lds r20, 0x0DAC ; 0x800dac 3629c: a2 96 adiw r28, 0x22 ; 34 3629e: 4f af std Y+63, r20 ; 0x3f 362a0: a2 97 sbiw r28, 0x22 ; 34 362a2: 44 23 and r20, r20 362a4: 11 f1 breq .+68 ; 0x362ea // avoid planning the block early if aborted SERIAL_ECHO_START; 362a6: 82 ec ldi r24, 0xC2 ; 194 362a8: 9b ea ldi r25, 0xAB ; 171 362aa: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHOLNRPGM(_n("Move aborted")); 362ae: 89 e3 ldi r24, 0x39 ; 57 362b0: 91 e7 ldi r25, 0x71 ; 113 362b2: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 // 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(); } 362b6: cb 57 subi r28, 0x7B ; 123 362b8: df 4f sbci r29, 0xFF ; 255 362ba: 0f b6 in r0, 0x3f ; 63 362bc: f8 94 cli 362be: de bf out 0x3e, r29 ; 62 362c0: 0f be out 0x3f, r0 ; 63 362c2: cd bf out 0x3d, r28 ; 61 362c4: df 91 pop r29 362c6: cf 91 pop r28 362c8: 1f 91 pop r17 362ca: 0f 91 pop r16 362cc: ff 90 pop r15 362ce: ef 90 pop r14 362d0: df 90 pop r13 362d2: cf 90 pop r12 362d4: bf 90 pop r11 362d6: af 90 pop r10 362d8: 9f 90 pop r9 362da: 8f 90 pop r8 362dc: 7f 90 pop r7 362de: 6f 90 pop r6 362e0: 5f 90 pop r5 362e2: 4f 90 pop r4 362e4: 3f 90 pop r3 362e6: 2f 90 pop r2 362e8: 08 95 ret SERIAL_ECHOLNRPGM(_n("Move aborted")); return; } // Prepare to set up new block block_t *block = &block_buffer[block_buffer_head]; 362ea: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 362ee: 29 2e mov r2, r25 362f0: 31 2c mov r3, r1 362f2: 8e e6 ldi r24, 0x6E ; 110 362f4: 98 9f mul r25, r24 362f6: d0 01 movw r26, r0 362f8: 11 24 eor r1, r1 362fa: a4 96 adiw r28, 0x24 ; 36 362fc: bf af std Y+63, r27 ; 0x3f 362fe: ae af std Y+62, r26 ; 0x3e 36300: 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; 36302: cd 01 movw r24, r26 36304: 8b 53 subi r24, 0x3B ; 59 36306: 99 4f sbci r25, 0xF9 ; 249 36308: fc 01 movw r30, r24 3630a: e9 5b subi r30, 0xB9 ; 185 3630c: ff 4f sbci r31, 0xFF ; 255 3630e: 10 82 st Z, r1 // Set sdlen for calculating sd position block->sdlen = 0; 36310: 84 59 subi r24, 0x94 ; 148 36312: 9f 4f sbci r25, 0xFF ; 255 36314: fc 01 movw r30, r24 36316: 11 82 std Z+1, r1 ; 0x01 36318: 10 82 st Z, r1 // Save original start position of the move if (gcode_start_position) 3631a: 01 15 cp r16, r1 3631c: 11 05 cpc r17, r1 3631e: 11 f4 brne .+4 ; 0x36324 36320: 0d 94 e8 bb jmp 0x377d0 ; 0x377d0 memcpy(block->gcode_start_position, gcode_start_position, sizeof(block_t::gcode_start_position)); 36324: 80 e1 ldi r24, 0x10 ; 16 36326: f8 01 movw r30, r16 36328: a3 5e subi r26, 0xE3 ; 227 3632a: b8 4f sbci r27, 0xF8 ; 248 else memcpy(block->gcode_start_position, current_position, sizeof(block_t::gcode_start_position)); 3632c: 01 90 ld r0, Z+ 3632e: 0d 92 st X+, r0 36330: 8a 95 dec r24 36332: e1 f7 brne .-8 ; 0x3632c // Save the index of this segment (when a single G0/1/2/3 command plans multiple segments) block->segment_idx = segment_idx; 36334: 8e e6 ldi r24, 0x6E ; 110 36336: 82 9d mul r24, r2 36338: 80 01 movw r16, r0 3633a: 83 9d mul r24, r3 3633c: 10 0d add r17, r0 3633e: 11 24 eor r1, r1 36340: 0b 53 subi r16, 0x3B ; 59 36342: 19 4f sbci r17, 0xF9 ; 249 36344: f8 01 movw r30, r16 36346: e8 59 subi r30, 0x98 ; 152 36348: ff 4f sbci r31, 0xFF ; 255 3634a: c3 56 subi r28, 0x63 ; 99 3634c: df 4f sbci r29, 0xFF ; 255 3634e: 88 81 ld r24, Y 36350: 99 81 ldd r25, Y+1 ; 0x01 36352: cd 59 subi r28, 0x9D ; 157 36354: d0 40 sbci r29, 0x00 ; 0 36356: 91 83 std Z+1, r25 ; 0x01 36358: 80 83 st Z, r24 // Save the global feedrate at scheduling time block->gcode_feedrate = feedrate; 3635a: 06 59 subi r16, 0x96 ; 150 3635c: 1f 4f sbci r17, 0xFF ; 255 3635e: 60 91 b8 02 lds r22, 0x02B8 ; 0x8002b8 36362: 70 91 b9 02 lds r23, 0x02B9 ; 0x8002b9 36366: 80 91 ba 02 lds r24, 0x02BA ; 0x8002ba 3636a: 90 91 bb 02 lds r25, 0x02BB ; 0x8002bb 3636e: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 36372: d8 01 movw r26, r16 36374: 6d 93 st X+, r22 36376: 7c 93 st X, r23 // Reset the starting E position when requested if (plan_reset_next_e_queue) 36378: 80 91 b8 04 lds r24, 0x04B8 ; 0x8004b8 <_ZL23plan_reset_next_e_queue.lto_priv.486> 3637c: 88 23 and r24, r24 3637e: a9 f0 breq .+42 ; 0x363aa { position[E_AXIS] = 0; 36380: 10 92 af 06 sts 0x06AF, r1 ; 0x8006af 36384: 10 92 b0 06 sts 0x06B0, r1 ; 0x8006b0 36388: 10 92 b1 06 sts 0x06B1, r1 ; 0x8006b1 3638c: 10 92 b2 06 sts 0x06B2, r1 ; 0x8006b2 #ifdef LIN_ADVANCE position_float[E_AXIS] = 0; 36390: 10 92 d9 04 sts 0x04D9, r1 ; 0x8004d9 36394: 10 92 da 04 sts 0x04DA, r1 ; 0x8004da 36398: 10 92 db 04 sts 0x04DB, r1 ; 0x8004db 3639c: 10 92 dc 04 sts 0x04DC, r1 ; 0x8004dc #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; 363a0: 10 92 b8 04 sts 0x04B8, r1 ; 0x8004b8 <_ZL23plan_reset_next_e_queue.lto_priv.486> plan_reset_next_e_sched = true; 363a4: 81 e0 ldi r24, 0x01 ; 1 363a6: 80 93 b7 04 sts 0x04B7, r24 ; 0x8004b7 <_ZL23plan_reset_next_e_sched.lto_priv.487> } // Apply the machine correction matrix. world2machine(x, y); 363aa: be 01 movw r22, r28 363ac: 6b 5d subi r22, 0xDB ; 219 363ae: 7f 4f sbci r23, 0xFF ; 255 363b0: ce 01 movw r24, r28 363b2: 81 96 adiw r24, 0x21 ; 33 363b4: 0e 94 02 6a call 0xd404 ; 0xd404 // 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]); 363b8: c9 a0 ldd r12, Y+33 ; 0x21 363ba: da a0 ldd r13, Y+34 ; 0x22 363bc: eb a0 ldd r14, Y+35 ; 0x23 363be: fc a0 ldd r15, Y+36 ; 0x24 363c0: 20 91 c2 0d lds r18, 0x0DC2 ; 0x800dc2 363c4: 30 91 c3 0d lds r19, 0x0DC3 ; 0x800dc3 363c8: 40 91 c4 0d lds r20, 0x0DC4 ; 0x800dc4 363cc: 50 91 c5 0d lds r21, 0x0DC5 ; 0x800dc5 363d0: c7 01 movw r24, r14 363d2: b6 01 movw r22, r12 363d4: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 363d8: 0f 94 81 e0 call 0x3c102 ; 0x3c102 363dc: c2 58 subi r28, 0x82 ; 130 363de: df 4f sbci r29, 0xFF ; 255 363e0: 68 83 st Y, r22 363e2: 79 83 std Y+1, r23 ; 0x01 363e4: 8a 83 std Y+2, r24 ; 0x02 363e6: 9b 83 std Y+3, r25 ; 0x03 363e8: ce 57 subi r28, 0x7E ; 126 363ea: d0 40 sbci r29, 0x00 ; 0 target[Y_AXIS] = lround(y*cs.axis_steps_per_mm[Y_AXIS]); 363ec: 8d a0 ldd r8, Y+37 ; 0x25 363ee: 9e a0 ldd r9, Y+38 ; 0x26 363f0: af a0 ldd r10, Y+39 ; 0x27 363f2: b8 a4 ldd r11, Y+40 ; 0x28 363f4: 20 91 c6 0d lds r18, 0x0DC6 ; 0x800dc6 363f8: 30 91 c7 0d lds r19, 0x0DC7 ; 0x800dc7 363fc: 40 91 c8 0d lds r20, 0x0DC8 ; 0x800dc8 36400: 50 91 c9 0d lds r21, 0x0DC9 ; 0x800dc9 36404: c5 01 movw r24, r10 36406: b4 01 movw r22, r8 36408: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 3640c: 0f 94 81 e0 call 0x3c102 ; 0x3c102 36410: ce 57 subi r28, 0x7E ; 126 36412: df 4f sbci r29, 0xFF ; 255 36414: 68 83 st Y, r22 36416: 79 83 std Y+1, r23 ; 0x01 36418: 8a 83 std Y+2, r24 ; 0x02 3641a: 9b 83 std Y+3, r25 ; 0x03 3641c: c2 58 subi r28, 0x82 ; 130 3641e: d0 40 sbci r29, 0x00 ; 0 #ifdef MESH_BED_LEVELING if (mbl.active){ 36420: 80 91 c2 13 lds r24, 0x13C2 ; 0x8013c2 36424: 88 23 and r24, r24 36426: 11 f4 brne .+4 ; 0x3642c 36428: 0d 94 ef bb jmp 0x377de ; 0x377de target[Z_AXIS] = lround((z+mbl.get_z(x, y))*cs.axis_steps_per_mm[Z_AXIS]); 3642c: a5 01 movw r20, r10 3642e: 94 01 movw r18, r8 36430: c7 01 movw r24, r14 36432: b6 01 movw r22, r12 36434: 0f 94 b1 a1 call 0x34362 ; 0x34362 36438: a8 96 adiw r28, 0x28 ; 40 3643a: 2c ad ldd r18, Y+60 ; 0x3c 3643c: 3d ad ldd r19, Y+61 ; 0x3d 3643e: 4e ad ldd r20, Y+62 ; 0x3e 36440: 5f ad ldd r21, Y+63 ; 0x3f 36442: a8 97 sbiw r28, 0x28 ; 40 36444: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 36448: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 3644c: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 36450: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 36454: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd }else{ target[Z_AXIS] = lround(z*cs.axis_steps_per_mm[Z_AXIS]); 36458: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 3645c: 0f 94 81 e0 call 0x3c102 ; 0x3c102 36460: e6 96 adiw r28, 0x36 ; 54 36462: 6c af std Y+60, r22 ; 0x3c 36464: 7d af std Y+61, r23 ; 0x3d 36466: 8e af std Y+62, r24 ; 0x3e 36468: 9f af std Y+63, r25 ; 0x3f 3646a: 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]); 3646c: aa 96 adiw r28, 0x2a ; 42 3646e: ee ad ldd r30, Y+62 ; 0x3e 36470: ff ad ldd r31, Y+63 ; 0x3f 36472: aa 97 sbiw r28, 0x2a ; 42 36474: 80 80 ld r8, Z 36476: 91 80 ldd r9, Z+1 ; 0x01 36478: a2 80 ldd r10, Z+2 ; 0x02 3647a: b3 80 ldd r11, Z+3 ; 0x03 3647c: 20 91 ce 0d lds r18, 0x0DCE ; 0x800dce 36480: 30 91 cf 0d lds r19, 0x0DCF ; 0x800dcf 36484: 40 91 d0 0d lds r20, 0x0DD0 ; 0x800dd0 36488: 50 91 d1 0d lds r21, 0x0DD1 ; 0x800dd1 3648c: c5 01 movw r24, r10 3648e: b4 01 movw r22, r8 36490: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 36494: 0f 94 81 e0 call 0x3c102 ; 0x3c102 36498: ae 96 adiw r28, 0x2e ; 46 3649a: 6c af std Y+60, r22 ; 0x3c 3649c: 7d af std Y+61, r23 ; 0x3d 3649e: 8e af std Y+62, r24 ; 0x3e 364a0: 9f af std Y+63, r25 ; 0x3f 364a2: 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]; 364a4: 80 91 af 06 lds r24, 0x06AF ; 0x8006af 364a8: 90 91 b0 06 lds r25, 0x06B0 ; 0x8006b0 364ac: a0 91 b1 06 lds r26, 0x06B1 ; 0x8006b1 364b0: b0 91 b2 06 lds r27, 0x06B2 ; 0x8006b2 364b4: ae 96 adiw r28, 0x2e ; 46 364b6: 4c ac ldd r4, Y+60 ; 0x3c 364b8: 5d ac ldd r5, Y+61 ; 0x3d 364ba: 6e ac ldd r6, Y+62 ; 0x3e 364bc: 7f ac ldd r7, Y+63 ; 0x3f 364be: ae 97 sbiw r28, 0x2e ; 46 364c0: 48 1a sub r4, r24 364c2: 59 0a sbc r5, r25 364c4: 6a 0a sbc r6, r26 364c6: 7b 0a sbc r7, r27 int32_t dx = target[X_AXIS] - position[X_AXIS]; 364c8: 80 91 a3 06 lds r24, 0x06A3 ; 0x8006a3 364cc: 90 91 a4 06 lds r25, 0x06A4 ; 0x8006a4 364d0: a0 91 a5 06 lds r26, 0x06A5 ; 0x8006a5 364d4: b0 91 a6 06 lds r27, 0x06A6 ; 0x8006a6 364d8: c2 58 subi r28, 0x82 ; 130 364da: df 4f sbci r29, 0xFF ; 255 364dc: c8 80 ld r12, Y 364de: d9 80 ldd r13, Y+1 ; 0x01 364e0: ea 80 ldd r14, Y+2 ; 0x02 364e2: fb 80 ldd r15, Y+3 ; 0x03 364e4: ce 57 subi r28, 0x7E ; 126 364e6: d0 40 sbci r29, 0x00 ; 0 364e8: c8 1a sub r12, r24 364ea: d9 0a sbc r13, r25 364ec: ea 0a sbc r14, r26 364ee: fb 0a sbc r15, r27 int32_t dy = target[Y_AXIS] - position[Y_AXIS]; 364f0: 80 91 a7 06 lds r24, 0x06A7 ; 0x8006a7 364f4: 90 91 a8 06 lds r25, 0x06A8 ; 0x8006a8 364f8: a0 91 a9 06 lds r26, 0x06A9 ; 0x8006a9 364fc: b0 91 aa 06 lds r27, 0x06AA ; 0x8006aa 36500: ce 57 subi r28, 0x7E ; 126 36502: df 4f sbci r29, 0xFF ; 255 36504: 28 81 ld r18, Y 36506: 39 81 ldd r19, Y+1 ; 0x01 36508: 4a 81 ldd r20, Y+2 ; 0x02 3650a: 5b 81 ldd r21, Y+3 ; 0x03 3650c: c2 58 subi r28, 0x82 ; 130 3650e: d0 40 sbci r29, 0x00 ; 0 36510: 28 1b sub r18, r24 36512: 39 0b sbc r19, r25 36514: 4a 0b sbc r20, r26 36516: 5b 0b sbc r21, r27 36518: 29 a7 std Y+41, r18 ; 0x29 3651a: 3a a7 std Y+42, r19 ; 0x2a 3651c: 4b a7 std Y+43, r20 ; 0x2b 3651e: 5c a7 std Y+44, r21 ; 0x2c int32_t dz = target[Z_AXIS] - position[Z_AXIS]; 36520: 80 91 ab 06 lds r24, 0x06AB ; 0x8006ab 36524: 90 91 ac 06 lds r25, 0x06AC ; 0x8006ac 36528: a0 91 ad 06 lds r26, 0x06AD ; 0x8006ad 3652c: b0 91 ae 06 lds r27, 0x06AE ; 0x8006ae 36530: e6 96 adiw r28, 0x36 ; 54 36532: 2c ad ldd r18, Y+60 ; 0x3c 36534: 3d ad ldd r19, Y+61 ; 0x3d 36536: 4e ad ldd r20, Y+62 ; 0x3e 36538: 5f ad ldd r21, Y+63 ; 0x3f 3653a: e6 97 sbiw r28, 0x36 ; 54 3653c: 28 1b sub r18, r24 3653e: 39 0b sbc r19, r25 36540: 4a 0b sbc r20, r26 36542: 5b 0b sbc r21, r27 36544: 2d a7 std Y+45, r18 ; 0x2d 36546: 3e a7 std Y+46, r19 ; 0x2e 36548: 4f a7 std Y+47, r20 ; 0x2f 3654a: 58 ab std Y+48, r21 ; 0x30 #ifdef PREVENT_DANGEROUS_EXTRUDE if(de) 3654c: 41 14 cp r4, r1 3654e: 51 04 cpc r5, r1 36550: 61 04 cpc r6, r1 36552: 71 04 cpc r7, r1 36554: 09 f4 brne .+2 ; 0x36558 36556: 80 c0 rjmp .+256 ; 0x36658 { if((int)degHotend(active_extruder) 3655c: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 36560: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 36564: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 36568: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> 3656c: 20 91 6b 02 lds r18, 0x026B ; 0x80026b 36570: 30 91 6c 02 lds r19, 0x026C ; 0x80026c 36574: 62 17 cp r22, r18 36576: 73 07 cpc r23, r19 36578: 0c f5 brge .+66 ; 0x365bc { position[E_AXIS]=target[E_AXIS]; //behave as if the move really took place, but ignore E part 3657a: ae 96 adiw r28, 0x2e ; 46 3657c: 8c ad ldd r24, Y+60 ; 0x3c 3657e: 9d ad ldd r25, Y+61 ; 0x3d 36580: ae ad ldd r26, Y+62 ; 0x3e 36582: bf ad ldd r27, Y+63 ; 0x3f 36584: ae 97 sbiw r28, 0x2e ; 46 36586: 80 93 af 06 sts 0x06AF, r24 ; 0x8006af 3658a: 90 93 b0 06 sts 0x06B0, r25 ; 0x8006b0 3658e: a0 93 b1 06 sts 0x06B1, r26 ; 0x8006b1 36592: b0 93 b2 06 sts 0x06B2, r27 ; 0x8006b2 #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 36596: 80 92 d9 04 sts 0x04D9, r8 ; 0x8004d9 3659a: 90 92 da 04 sts 0x04DA, r9 ; 0x8004da 3659e: a0 92 db 04 sts 0x04DB, r10 ; 0x8004db 365a2: b0 92 dc 04 sts 0x04DC, r11 ; 0x8004dc #endif de = 0; // no difference SERIAL_ECHO_START; 365a6: 82 ec ldi r24, 0xC2 ; 194 365a8: 9b ea ldi r25, 0xAB ; 171 365aa: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHOLNRPGM(_n(" cold extrusion prevented"));////MSG_ERR_COLD_EXTRUDE_STOP 365ae: 8f e1 ldi r24, 0x1F ; 31 365b0: 91 e7 ldi r25, 0x71 ; 113 365b2: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 { 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 365b6: 41 2c mov r4, r1 365b8: 51 2c mov r5, r1 365ba: 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) 365bc: c3 01 movw r24, r6 365be: b2 01 movw r22, r4 365c0: 77 fe sbrs r7, 7 365c2: 07 c0 rjmp .+14 ; 0x365d2 365c4: 66 27 eor r22, r22 365c6: 77 27 eor r23, r23 365c8: cb 01 movw r24, r22 365ca: 64 19 sub r22, r4 365cc: 75 09 sbc r23, r5 365ce: 86 09 sbc r24, r6 365d0: 97 09 sbc r25, r7 365d2: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 365d6: 4b 01 movw r8, r22 365d8: 5c 01 movw r10, r24 365da: 20 e0 ldi r18, 0x00 ; 0 365dc: 30 ec ldi r19, 0xC0 ; 192 365de: 4b ee ldi r20, 0xEB ; 235 365e0: 53 e4 ldi r21, 0x43 ; 67 365e2: 60 91 ce 0d lds r22, 0x0DCE ; 0x800dce 365e6: 70 91 cf 0d lds r23, 0x0DCF ; 0x800dcf 365ea: 80 91 d0 0d lds r24, 0x0DD0 ; 0x800dd0 365ee: 90 91 d1 0d lds r25, 0x0DD1 ; 0x800dd1 365f2: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 365f6: 9b 01 movw r18, r22 365f8: ac 01 movw r20, r24 365fa: c5 01 movw r24, r10 365fc: b4 01 movw r22, r8 365fe: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 36602: 18 16 cp r1, r24 36604: 4c f5 brge .+82 ; 0x36658 { position[E_AXIS]=target[E_AXIS]; //behave as if the move really took place, but ignore E part 36606: ae 96 adiw r28, 0x2e ; 46 36608: 2c ad ldd r18, Y+60 ; 0x3c 3660a: 3d ad ldd r19, Y+61 ; 0x3d 3660c: 4e ad ldd r20, Y+62 ; 0x3e 3660e: 5f ad ldd r21, Y+63 ; 0x3f 36610: ae 97 sbiw r28, 0x2e ; 46 36612: 20 93 af 06 sts 0x06AF, r18 ; 0x8006af 36616: 30 93 b0 06 sts 0x06B0, r19 ; 0x8006b0 3661a: 40 93 b1 06 sts 0x06B1, r20 ; 0x8006b1 3661e: 50 93 b2 06 sts 0x06B2, r21 ; 0x8006b2 #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 36622: aa 96 adiw r28, 0x2a ; 42 36624: ee ad ldd r30, Y+62 ; 0x3e 36626: ff ad ldd r31, Y+63 ; 0x3f 36628: aa 97 sbiw r28, 0x2a ; 42 3662a: 80 81 ld r24, Z 3662c: 91 81 ldd r25, Z+1 ; 0x01 3662e: a2 81 ldd r26, Z+2 ; 0x02 36630: b3 81 ldd r27, Z+3 ; 0x03 36632: 80 93 d9 04 sts 0x04D9, r24 ; 0x8004d9 36636: 90 93 da 04 sts 0x04DA, r25 ; 0x8004da 3663a: a0 93 db 04 sts 0x04DB, r26 ; 0x8004db 3663e: b0 93 dc 04 sts 0x04DC, r27 ; 0x8004dc #endif de = 0; // no difference SERIAL_ECHO_START; 36642: 82 ec ldi r24, 0xC2 ; 194 36644: 9b ea ldi r25, 0xAB ; 171 36646: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHOLNRPGM(_n(" too long extrusion prevented"));////MSG_ERR_LONG_EXTRUDE_STOP 3664a: 81 e0 ldi r24, 0x01 ; 1 3664c: 91 e7 ldi r25, 0x71 ; 113 3664e: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 { 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 36652: 41 2c mov r4, r1 36654: 51 2c mov r5, r1 36656: 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); 36658: 8e e6 ldi r24, 0x6E ; 110 3665a: 82 9d mul r24, r2 3665c: f0 01 movw r30, r0 3665e: 83 9d mul r24, r3 36660: f0 0d add r31, r0 36662: 11 24 eor r1, r1 36664: eb 53 subi r30, 0x3B ; 59 36666: f9 4f sbci r31, 0xF9 ; 249 36668: d7 01 movw r26, r14 3666a: c6 01 movw r24, r12 3666c: f7 fe sbrs r15, 7 3666e: 07 c0 rjmp .+14 ; 0x3667e 36670: 88 27 eor r24, r24 36672: 99 27 eor r25, r25 36674: dc 01 movw r26, r24 36676: 8c 19 sub r24, r12 36678: 9d 09 sbc r25, r13 3667a: ae 09 sbc r26, r14 3667c: bf 09 sbc r27, r15 3667e: 80 83 st Z, r24 36680: 91 83 std Z+1, r25 ; 0x01 36682: a2 83 std Z+2, r26 ; 0x02 36684: b3 83 std Z+3, r27 ; 0x03 block->steps[Y_AXIS].wide = labs(dy); 36686: 8e e6 ldi r24, 0x6E ; 110 36688: 82 9d mul r24, r2 3668a: f0 01 movw r30, r0 3668c: 83 9d mul r24, r3 3668e: f0 0d add r31, r0 36690: 11 24 eor r1, r1 36692: eb 53 subi r30, 0x3B ; 59 36694: f9 4f sbci r31, 0xF9 ; 249 36696: 89 a5 ldd r24, Y+41 ; 0x29 36698: 9a a5 ldd r25, Y+42 ; 0x2a 3669a: ab a5 ldd r26, Y+43 ; 0x2b 3669c: bc a5 ldd r27, Y+44 ; 0x2c 3669e: b7 ff sbrs r27, 7 366a0: 07 c0 rjmp .+14 ; 0x366b0 366a2: b0 95 com r27 366a4: a0 95 com r26 366a6: 90 95 com r25 366a8: 81 95 neg r24 366aa: 9f 4f sbci r25, 0xFF ; 255 366ac: af 4f sbci r26, 0xFF ; 255 366ae: bf 4f sbci r27, 0xFF ; 255 366b0: 84 83 std Z+4, r24 ; 0x04 366b2: 95 83 std Z+5, r25 ; 0x05 366b4: a6 83 std Z+6, r26 ; 0x06 366b6: 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); 366b8: 8e e6 ldi r24, 0x6E ; 110 366ba: 82 9d mul r24, r2 366bc: f0 01 movw r30, r0 366be: 83 9d mul r24, r3 366c0: f0 0d add r31, r0 366c2: 11 24 eor r1, r1 366c4: eb 53 subi r30, 0x3B ; 59 366c6: f9 4f sbci r31, 0xF9 ; 249 366c8: 8d a5 ldd r24, Y+45 ; 0x2d 366ca: 9e a5 ldd r25, Y+46 ; 0x2e 366cc: af a5 ldd r26, Y+47 ; 0x2f 366ce: b8 a9 ldd r27, Y+48 ; 0x30 366d0: b7 ff sbrs r27, 7 366d2: 07 c0 rjmp .+14 ; 0x366e2 366d4: b0 95 com r27 366d6: a0 95 com r26 366d8: 90 95 com r25 366da: 81 95 neg r24 366dc: 9f 4f sbci r25, 0xFF ; 255 366de: af 4f sbci r26, 0xFF ; 255 366e0: bf 4f sbci r27, 0xFF ; 255 366e2: 80 87 std Z+8, r24 ; 0x08 366e4: 91 87 std Z+9, r25 ; 0x09 366e6: a2 87 std Z+10, r26 ; 0x0a 366e8: b3 87 std Z+11, r27 ; 0x0b block->steps[E_AXIS].wide = labs(de); 366ea: b3 01 movw r22, r6 366ec: a2 01 movw r20, r4 366ee: 77 fe sbrs r7, 7 366f0: 07 c0 rjmp .+14 ; 0x36700 366f2: 44 27 eor r20, r20 366f4: 55 27 eor r21, r21 366f6: ba 01 movw r22, r20 366f8: 44 19 sub r20, r4 366fa: 55 09 sbc r21, r5 366fc: 66 09 sbc r22, r6 366fe: 77 09 sbc r23, r7 36700: 8e e6 ldi r24, 0x6E ; 110 36702: 82 9d mul r24, r2 36704: f0 01 movw r30, r0 36706: 83 9d mul r24, r3 36708: f0 0d add r31, r0 3670a: 11 24 eor r1, r1 3670c: eb 53 subi r30, 0x3B ; 59 3670e: f9 4f sbci r31, 0xF9 ; 249 36710: 44 87 std Z+12, r20 ; 0x0c 36712: 55 87 std Z+13, r21 ; 0x0d 36714: 66 87 std Z+14, r22 ; 0x0e 36716: 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))); 36718: 00 81 ld r16, Z 3671a: 11 81 ldd r17, Z+1 ; 0x01 3671c: 22 81 ldd r18, Z+2 ; 0x02 3671e: 33 81 ldd r19, Z+3 ; 0x03 36720: 84 81 ldd r24, Z+4 ; 0x04 36722: 95 81 ldd r25, Z+5 ; 0x05 36724: a6 81 ldd r26, Z+6 ; 0x06 36726: b7 81 ldd r27, Z+7 ; 0x07 36728: 80 17 cp r24, r16 3672a: 91 07 cpc r25, r17 3672c: a2 07 cpc r26, r18 3672e: b3 07 cpc r27, r19 36730: 14 f4 brge .+4 ; 0x36736 36732: d9 01 movw r26, r18 36734: c8 01 movw r24, r16 36736: ee e6 ldi r30, 0x6E ; 110 36738: be 2e mov r11, r30 3673a: b2 9c mul r11, r2 3673c: f0 01 movw r30, r0 3673e: b3 9c mul r11, r3 36740: f0 0d add r31, r0 36742: 11 24 eor r1, r1 36744: eb 53 subi r30, 0x3B ; 59 36746: f9 4f sbci r31, 0xF9 ; 249 36748: 80 84 ldd r8, Z+8 ; 0x08 3674a: 91 84 ldd r9, Z+9 ; 0x09 3674c: a2 84 ldd r10, Z+10 ; 0x0a 3674e: b3 84 ldd r11, Z+11 ; 0x0b 36750: 88 15 cp r24, r8 36752: 99 05 cpc r25, r9 36754: aa 05 cpc r26, r10 36756: bb 05 cpc r27, r11 36758: 14 f4 brge .+4 ; 0x3675e 3675a: d5 01 movw r26, r10 3675c: c4 01 movw r24, r8 3675e: 84 17 cp r24, r20 36760: 95 07 cpc r25, r21 36762: a6 07 cpc r26, r22 36764: b7 07 cpc r27, r23 36766: 14 f4 brge .+4 ; 0x3676c 36768: db 01 movw r26, r22 3676a: ca 01 movw r24, r20 3676c: 4e e6 ldi r20, 0x6E ; 110 3676e: 42 9d mul r20, r2 36770: f0 01 movw r30, r0 36772: 43 9d mul r20, r3 36774: f0 0d add r31, r0 36776: 11 24 eor r1, r1 36778: eb 53 subi r30, 0x3B ; 59 3677a: f9 4f sbci r31, 0xF9 ; 249 3677c: 80 8b std Z+16, r24 ; 0x10 3677e: 91 8b std Z+17, r25 ; 0x11 36780: a2 8b std Z+18, r26 ; 0x12 36782: b3 8b std Z+19, r27 ; 0x13 // Bail if this is a zero-length block if (block->step_event_count.wide <= dropsegments) 36784: 06 97 sbiw r24, 0x06 ; 6 36786: a1 05 cpc r26, r1 36788: b1 05 cpc r27, r1 3678a: 0c f4 brge .+2 ; 0x3678e 3678c: 94 cd rjmp .-1240 ; 0x362b6 planner_update_queue_min_counter(); #endif /* PLANNER_DIAGNOSTICS */ return; } block->fan_speed = fanSpeed; 3678e: 80 91 e7 03 lds r24, 0x03E7 ; 0x8003e7 36792: df 01 movw r26, r30 36794: aa 5b subi r26, 0xBA ; 186 36796: bf 4f sbci r27, 0xFF ; 255 36798: 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); 3679a: f7 fe sbrs r15, 7 3679c: 02 c0 rjmp .+4 ; 0x367a2 3679e: 0d 94 ff bb jmp 0x377fe ; 0x377fe } block->fan_speed = fanSpeed; // Compute direction bits for this block block->direction_bits = 0; 367a2: 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); 367a4: 89 a5 ldd r24, Y+41 ; 0x29 367a6: 9a a5 ldd r25, Y+42 ; 0x2a 367a8: ab a5 ldd r26, Y+43 ; 0x2b 367aa: bc a5 ldd r27, Y+44 ; 0x2c 367ac: b7 ff sbrs r27, 7 367ae: 0b c0 rjmp .+22 ; 0x367c6 367b0: 8e e6 ldi r24, 0x6E ; 110 367b2: 82 9d mul r24, r2 367b4: f0 01 movw r30, r0 367b6: 83 9d mul r24, r3 367b8: f0 0d add r31, r0 367ba: 11 24 eor r1, r1 367bc: eb 53 subi r30, 0x3B ; 59 367be: f9 4f sbci r31, 0xF9 ; 249 367c0: 80 8d ldd r24, Z+24 ; 0x18 367c2: 82 60 ori r24, 0x02 ; 2 367c4: 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); 367c6: 8d a5 ldd r24, Y+45 ; 0x2d 367c8: 9e a5 ldd r25, Y+46 ; 0x2e 367ca: af a5 ldd r26, Y+47 ; 0x2f 367cc: b8 a9 ldd r27, Y+48 ; 0x30 367ce: b7 ff sbrs r27, 7 367d0: 0b c0 rjmp .+22 ; 0x367e8 367d2: 8e e6 ldi r24, 0x6E ; 110 367d4: 82 9d mul r24, r2 367d6: f0 01 movw r30, r0 367d8: 83 9d mul r24, r3 367da: f0 0d add r31, r0 367dc: 11 24 eor r1, r1 367de: eb 53 subi r30, 0x3B ; 59 367e0: f9 4f sbci r31, 0xF9 ; 249 367e2: 80 8d ldd r24, Z+24 ; 0x18 367e4: 84 60 ori r24, 0x04 ; 4 367e6: 80 8f std Z+24, r24 ; 0x18 if (de < 0) block->direction_bits |= _BV(E_AXIS); 367e8: 77 fe sbrs r7, 7 367ea: 0b c0 rjmp .+22 ; 0x36802 367ec: 8e e6 ldi r24, 0x6E ; 110 367ee: 82 9d mul r24, r2 367f0: f0 01 movw r30, r0 367f2: 83 9d mul r24, r3 367f4: f0 0d add r31, r0 367f6: 11 24 eor r1, r1 367f8: eb 53 subi r30, 0x3B ; 59 367fa: f9 4f sbci r31, 0xF9 ; 249 367fc: 80 8d ldd r24, Z+24 ; 0x18 367fe: 88 60 ori r24, 0x08 ; 8 36800: 80 8f std Z+24, r24 ; 0x18 { enable_x(); enable_y(); } #else if(block->steps[X_AXIS].wide != 0) enable_x(); 36802: 01 2b or r16, r17 36804: 02 2b or r16, r18 36806: 03 2b or r16, r19 36808: 09 f0 breq .+2 ; 0x3680c 3680a: 17 98 cbi 0x02, 7 ; 2 if(block->steps[Y_AXIS].wide != 0) enable_y(); 3680c: 8e e6 ldi r24, 0x6E ; 110 3680e: 82 9d mul r24, r2 36810: f0 01 movw r30, r0 36812: 83 9d mul r24, r3 36814: f0 0d add r31, r0 36816: 11 24 eor r1, r1 36818: eb 53 subi r30, 0x3B ; 59 3681a: f9 4f sbci r31, 0xF9 ; 249 3681c: 84 81 ldd r24, Z+4 ; 0x04 3681e: 95 81 ldd r25, Z+5 ; 0x05 36820: a6 81 ldd r26, Z+6 ; 0x06 36822: b7 81 ldd r27, Z+7 ; 0x07 36824: 89 2b or r24, r25 36826: 8a 2b or r24, r26 36828: 8b 2b or r24, r27 3682a: 09 f0 breq .+2 ; 0x3682e 3682c: 16 98 cbi 0x02, 6 ; 2 #endif if(block->steps[Z_AXIS].wide != 0) enable_z(); 3682e: 8e e6 ldi r24, 0x6E ; 110 36830: 82 9d mul r24, r2 36832: f0 01 movw r30, r0 36834: 83 9d mul r24, r3 36836: f0 0d add r31, r0 36838: 11 24 eor r1, r1 3683a: eb 53 subi r30, 0x3B ; 59 3683c: f9 4f sbci r31, 0xF9 ; 249 3683e: 80 85 ldd r24, Z+8 ; 0x08 36840: 91 85 ldd r25, Z+9 ; 0x09 36842: a2 85 ldd r26, Z+10 ; 0x0a 36844: b3 85 ldd r27, Z+11 ; 0x0b 36846: 89 2b or r24, r25 36848: 8a 2b or r24, r26 3684a: 8b 2b or r24, r27 3684c: 09 f0 breq .+2 ; 0x36850 3684e: 15 98 cbi 0x02, 5 ; 2 if(block->steps[E_AXIS].wide != 0) enable_e0(); 36850: 8e e6 ldi r24, 0x6E ; 110 36852: 82 9d mul r24, r2 36854: f0 01 movw r30, r0 36856: 83 9d mul r24, r3 36858: f0 0d add r31, r0 3685a: 11 24 eor r1, r1 3685c: eb 53 subi r30, 0x3B ; 59 3685e: f9 4f sbci r31, 0xF9 ; 249 36860: 84 85 ldd r24, Z+12 ; 0x0c 36862: 95 85 ldd r25, Z+13 ; 0x0d 36864: a6 85 ldd r26, Z+14 ; 0x0e 36866: b7 85 ldd r27, Z+15 ; 0x0f 36868: 89 2b or r24, r25 3686a: 8a 2b or r24, r26 3686c: 8b 2b or r24, r27 3686e: 09 f0 breq .+2 ; 0x36872 36870: 14 98 cbi 0x02, 4 ; 2 if (block->steps[E_AXIS].wide == 0) 36872: 8e e6 ldi r24, 0x6E ; 110 36874: 82 9d mul r24, r2 36876: f0 01 movw r30, r0 36878: 83 9d mul r24, r3 3687a: f0 0d add r31, r0 3687c: 11 24 eor r1, r1 3687e: eb 53 subi r30, 0x3B ; 59 36880: f9 4f sbci r31, 0xF9 ; 249 36882: 24 85 ldd r18, Z+12 ; 0x0c 36884: 35 85 ldd r19, Z+13 ; 0x0d 36886: 46 85 ldd r20, Z+14 ; 0x0e 36888: 57 85 ldd r21, Z+15 ; 0x0f 3688a: 2a 96 adiw r28, 0x0a ; 10 3688c: 2c af std Y+60, r18 ; 0x3c 3688e: 3d af std Y+61, r19 ; 0x3d 36890: 4e af std Y+62, r20 ; 0x3e 36892: 5f af std Y+63, r21 ; 0x3f 36894: 2a 97 sbiw r28, 0x0a ; 10 36896: 23 2b or r18, r19 36898: 24 2b or r18, r20 3689a: 25 2b or r18, r21 3689c: 09 f0 breq .+2 ; 0x368a0 3689e: b3 c7 rjmp .+3942 ; 0x37806 { if(feed_rate 368a4: b0 90 ff 0d lds r11, 0x0DFF ; 0x800dff 368a8: 00 91 00 0e lds r16, 0x0E00 ; 0x800e00 368ac: 10 91 01 0e lds r17, 0x0E01 ; 0x800e01 } else { if(feed_rate 368c0: 18 16 cp r1, r24 368c2: 24 f4 brge .+8 ; 0x368cc 368c4: a9 aa std Y+49, r10 ; 0x31 368c6: b9 ae std Y+57, r11 ; 0x39 368c8: 0d af std Y+61, r16 ; 0x3d 368ca: 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]; 368cc: c7 01 movw r24, r14 368ce: b6 01 movw r22, r12 368d0: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 368d4: 20 91 c2 0d lds r18, 0x0DC2 ; 0x800dc2 368d8: 30 91 c3 0d lds r19, 0x0DC3 ; 0x800dc3 368dc: 40 91 c4 0d lds r20, 0x0DC4 ; 0x800dc4 368e0: 50 91 c5 0d lds r21, 0x0DC5 ; 0x800dc5 368e4: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 368e8: 4b 01 movw r8, r22 368ea: 5c 01 movw r10, r24 368ec: 89 82 std Y+1, r8 ; 0x01 368ee: 9a 82 std Y+2, r9 ; 0x02 368f0: ab 82 std Y+3, r10 ; 0x03 368f2: bc 82 std Y+4, r11 ; 0x04 delta_mm[Y_AXIS] = dy / cs.axis_steps_per_mm[Y_AXIS]; 368f4: 69 a5 ldd r22, Y+41 ; 0x29 368f6: 7a a5 ldd r23, Y+42 ; 0x2a 368f8: 8b a5 ldd r24, Y+43 ; 0x2b 368fa: 9c a5 ldd r25, Y+44 ; 0x2c 368fc: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 36900: 20 91 c6 0d lds r18, 0x0DC6 ; 0x800dc6 36904: 30 91 c7 0d lds r19, 0x0DC7 ; 0x800dc7 36908: 40 91 c8 0d lds r20, 0x0DC8 ; 0x800dc8 3690c: 50 91 c9 0d lds r21, 0x0DC9 ; 0x800dc9 36910: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 36914: 6b 01 movw r12, r22 36916: 7c 01 movw r14, r24 36918: cd 82 std Y+5, r12 ; 0x05 3691a: de 82 std Y+6, r13 ; 0x06 3691c: ef 82 std Y+7, r14 ; 0x07 3691e: 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]; 36920: 6d a5 ldd r22, Y+45 ; 0x2d 36922: 7e a5 ldd r23, Y+46 ; 0x2e 36924: 8f a5 ldd r24, Y+47 ; 0x2f 36926: 98 a9 ldd r25, Y+48 ; 0x30 36928: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 3692c: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 36930: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 36934: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 36938: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 3693c: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 36940: 22 96 adiw r28, 0x02 ; 2 36942: 6c af std Y+60, r22 ; 0x3c 36944: 7d af std Y+61, r23 ; 0x3d 36946: 8e af std Y+62, r24 ; 0x3e 36948: 9f af std Y+63, r25 ; 0x3f 3694a: 22 97 sbiw r28, 0x02 ; 2 3694c: 69 87 std Y+9, r22 ; 0x09 3694e: 7a 87 std Y+10, r23 ; 0x0a 36950: 8b 87 std Y+11, r24 ; 0x0b 36952: 9c 87 std Y+12, r25 ; 0x0c delta_mm[E_AXIS] = de / cs.axis_steps_per_mm[E_AXIS]; 36954: c3 01 movw r24, r6 36956: b2 01 movw r22, r4 36958: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 3695c: 20 91 ce 0d lds r18, 0x0DCE ; 0x800dce 36960: 30 91 cf 0d lds r19, 0x0DCF ; 0x800dcf 36964: 40 91 d0 0d lds r20, 0x0DD0 ; 0x800dd0 36968: 50 91 d1 0d lds r21, 0x0DD1 ; 0x800dd1 3696c: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 36970: 26 96 adiw r28, 0x06 ; 6 36972: 6c af std Y+60, r22 ; 0x3c 36974: 7d af std Y+61, r23 ; 0x3d 36976: 8e af std Y+62, r24 ; 0x3e 36978: 9f af std Y+63, r25 ; 0x3f 3697a: 26 97 sbiw r28, 0x06 ; 6 3697c: 6d 87 std Y+13, r22 ; 0x0d 3697e: 7e 87 std Y+14, r23 ; 0x0e 36980: 8f 87 std Y+15, r24 ; 0x0f 36982: 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 ) 36984: 8e e6 ldi r24, 0x6E ; 110 36986: 82 9d mul r24, r2 36988: f0 01 movw r30, r0 3698a: 83 9d mul r24, r3 3698c: f0 0d add r31, r0 3698e: 11 24 eor r1, r1 36990: eb 53 subi r30, 0x3B ; 59 36992: f9 4f sbci r31, 0xF9 ; 249 36994: 80 81 ld r24, Z 36996: 91 81 ldd r25, Z+1 ; 0x01 36998: a2 81 ldd r26, Z+2 ; 0x02 3699a: b3 81 ldd r27, Z+3 ; 0x03 3699c: 2e 96 adiw r28, 0x0e ; 14 3699e: 8c af std Y+60, r24 ; 0x3c 369a0: 9d af std Y+61, r25 ; 0x3d 369a2: ae af std Y+62, r26 ; 0x3e 369a4: bf af std Y+63, r27 ; 0x3f 369a6: 2e 97 sbiw r28, 0x0e ; 14 369a8: 06 97 sbiw r24, 0x06 ; 6 369aa: a1 05 cpc r26, r1 369ac: b1 05 cpc r27, r1 369ae: 0c f0 brlt .+2 ; 0x369b2 369b0: 33 c7 rjmp .+3686 ; 0x37818 369b2: 84 81 ldd r24, Z+4 ; 0x04 369b4: 95 81 ldd r25, Z+5 ; 0x05 369b6: a6 81 ldd r26, Z+6 ; 0x06 369b8: b7 81 ldd r27, Z+7 ; 0x07 369ba: 06 97 sbiw r24, 0x06 ; 6 369bc: a1 05 cpc r26, r1 369be: b1 05 cpc r27, r1 369c0: 0c f0 brlt .+2 ; 0x369c4 369c2: 2a c7 rjmp .+3668 ; 0x37818 369c4: 80 85 ldd r24, Z+8 ; 0x08 369c6: 91 85 ldd r25, Z+9 ; 0x09 369c8: a2 85 ldd r26, Z+10 ; 0x0a 369ca: b3 85 ldd r27, Z+11 ; 0x0b 369cc: 06 97 sbiw r24, 0x06 ; 6 369ce: a1 05 cpc r26, r1 369d0: b1 05 cpc r27, r1 369d2: 0c f0 brlt .+2 ; 0x369d6 369d4: 21 c7 rjmp .+3650 ; 0x37818 { block->millimeters = fabs(delta_mm[E_AXIS]); 369d6: 26 96 adiw r28, 0x06 ; 6 369d8: 8c ad ldd r24, Y+60 ; 0x3c 369da: 9d ad ldd r25, Y+61 ; 0x3d 369dc: ae ad ldd r26, Y+62 ; 0x3e 369de: bf ad ldd r27, Y+63 ; 0x3f 369e0: 26 97 sbiw r28, 0x06 ; 6 369e2: bf 77 andi r27, 0x7F ; 127 369e4: 85 a7 std Z+45, r24 ; 0x2d 369e6: 96 a7 std Z+46, r25 ; 0x2e 369e8: a7 a7 std Z+47, r26 ; 0x2f 369ea: 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 369ec: 8e e6 ldi r24, 0x6E ; 110 369ee: 82 9d mul r24, r2 369f0: f0 01 movw r30, r0 369f2: 83 9d mul r24, r3 369f4: f0 0d add r31, r0 369f6: 11 24 eor r1, r1 369f8: eb 53 subi r30, 0x3B ; 59 369fa: f9 4f sbci r31, 0xF9 ; 249 369fc: 45 a4 ldd r4, Z+45 ; 0x2d 369fe: 56 a4 ldd r5, Z+46 ; 0x2e 36a00: 67 a4 ldd r6, Z+47 ; 0x2f 36a02: 70 a8 ldd r7, Z+48 ; 0x30 36a04: a3 01 movw r20, r6 36a06: 92 01 movw r18, r4 36a08: 60 e0 ldi r22, 0x00 ; 0 36a0a: 70 e0 ldi r23, 0x00 ; 0 36a0c: 80 e8 ldi r24, 0x80 ; 128 36a0e: 9f e3 ldi r25, 0x3F ; 63 36a10: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> // Calculate speed in mm/second for each axis. No divide by zero due to previous checks. float inverse_second = feed_rate * inverse_millimeters; 36a14: 29 a9 ldd r18, Y+49 ; 0x31 36a16: 39 ad ldd r19, Y+57 ; 0x39 36a18: 4d ad ldd r20, Y+61 ; 0x3d 36a1a: 5d a9 ldd r21, Y+53 ; 0x35 36a1c: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 36a20: 6b 01 movw r12, r22 36a22: 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); 36a24: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 36a28: 90 91 a6 0d lds r25, 0x0DA6 ; 0x800da6 36a2c: 89 1b sub r24, r25 36a2e: 8f 70 andi r24, 0x0F ; 15 36a30: 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)) { 36a32: 82 50 subi r24, 0x02 ; 2 36a34: 86 30 cpi r24, 0x06 ; 6 36a36: 08 f0 brcs .+2 ; 0x36a3a 36a38: 40 c0 rjmp .+128 ; 0x36aba // segment time in micro seconds unsigned long segment_time = lround(1000000.0/inverse_second); 36a3a: a7 01 movw r20, r14 36a3c: 96 01 movw r18, r12 36a3e: 60 e0 ldi r22, 0x00 ; 0 36a40: 74 e2 ldi r23, 0x24 ; 36 36a42: 84 e7 ldi r24, 0x74 ; 116 36a44: 99 e4 ldi r25, 0x49 ; 73 36a46: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 36a4a: 0f 94 81 e0 call 0x3c102 ; 0x3c102 36a4e: 4b 01 movw r8, r22 36a50: 5c 01 movw r10, r24 if (segment_time < cs.min_segment_time_us) 36a52: 80 91 02 0e lds r24, 0x0E02 ; 0x800e02 36a56: 90 91 03 0e lds r25, 0x0E03 ; 0x800e03 36a5a: a0 91 04 0e lds r26, 0x0E04 ; 0x800e04 36a5e: b0 91 05 0e lds r27, 0x0E05 ; 0x800e05 36a62: 88 16 cp r8, r24 36a64: 99 06 cpc r9, r25 36a66: aa 06 cpc r10, r26 36a68: bb 06 cpc r11, r27 36a6a: 38 f5 brcc .+78 ; 0x36aba // 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)); 36a6c: bc 01 movw r22, r24 36a6e: cd 01 movw r24, r26 36a70: 68 19 sub r22, r8 36a72: 79 09 sbc r23, r9 36a74: 8a 09 sbc r24, r10 36a76: 9b 09 sbc r25, r11 36a78: 66 0f add r22, r22 36a7a: 77 1f adc r23, r23 36a7c: 88 1f adc r24, r24 36a7e: 99 1f adc r25, r25 36a80: ad ad ldd r26, Y+61 ; 0x3d 36a82: 2a 2f mov r18, r26 36a84: 30 e0 ldi r19, 0x00 ; 0 36a86: 50 e0 ldi r21, 0x00 ; 0 36a88: 40 e0 ldi r20, 0x00 ; 0 36a8a: 0f 94 8f dc call 0x3b91e ; 0x3b91e <__udivmodsi4> 36a8e: ca 01 movw r24, r20 36a90: b9 01 movw r22, r18 36a92: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 36a96: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> 36a9a: 68 0d add r22, r8 36a9c: 79 1d adc r23, r9 36a9e: 8a 1d adc r24, r10 36aa0: 9b 1d adc r25, r11 36aa2: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 36aa6: 9b 01 movw r18, r22 36aa8: ac 01 movw r20, r24 36aaa: 60 e0 ldi r22, 0x00 ; 0 36aac: 74 e2 ldi r23, 0x24 ; 36 36aae: 84 e7 ldi r24, 0x74 ; 116 36ab0: 99 e4 ldi r25, 0x49 ; 73 36ab2: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 36ab6: 6b 01 movw r12, r22 36ab8: 7c 01 movw r14, r24 } #endif // SLOWDOWN block->nominal_speed = block->millimeters * inverse_second; // (mm/sec) Always > 0 36aba: a3 01 movw r20, r6 36abc: 92 01 movw r18, r4 36abe: c7 01 movw r24, r14 36ac0: b6 01 movw r22, r12 36ac2: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 36ac6: 6d ab std Y+53, r22 ; 0x35 36ac8: 7e ab std Y+54, r23 ; 0x36 36aca: 8f ab std Y+55, r24 ; 0x37 36acc: 98 af std Y+56, r25 ; 0x38 36ace: 8e e6 ldi r24, 0x6E ; 110 36ad0: 82 9d mul r24, r2 36ad2: 80 01 movw r16, r0 36ad4: 83 9d mul r24, r3 36ad6: 10 0d add r17, r0 36ad8: 11 24 eor r1, r1 36ada: 0b 53 subi r16, 0x3B ; 59 36adc: 19 4f sbci r17, 0xF9 ; 249 36ade: 2d a9 ldd r18, Y+53 ; 0x35 36ae0: 3e a9 ldd r19, Y+54 ; 0x36 36ae2: 4f a9 ldd r20, Y+55 ; 0x37 36ae4: 58 ad ldd r21, Y+56 ; 0x38 36ae6: d8 01 movw r26, r16 36ae8: 91 96 adiw r26, 0x21 ; 33 36aea: 2d 93 st X+, r18 36aec: 3d 93 st X+, r19 36aee: 4d 93 st X+, r20 36af0: 5c 93 st X, r21 36af2: 94 97 sbiw r26, 0x24 ; 36 block->nominal_rate = ceil(block->step_event_count.wide * inverse_second); // (step/sec) Always > 0 36af4: 50 96 adiw r26, 0x10 ; 16 36af6: 6d 91 ld r22, X+ 36af8: 7d 91 ld r23, X+ 36afa: 8d 91 ld r24, X+ 36afc: 9c 91 ld r25, X 36afe: 53 97 sbiw r26, 0x13 ; 19 36b00: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 36b04: 69 af std Y+57, r22 ; 0x39 36b06: 7a af std Y+58, r23 ; 0x3a 36b08: 8b af std Y+59, r24 ; 0x3b 36b0a: 9c af std Y+60, r25 ; 0x3c 36b0c: 9b 01 movw r18, r22 36b0e: ac 01 movw r20, r24 36b10: c7 01 movw r24, r14 36b12: b6 01 movw r22, r12 36b14: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 36b18: 0f 94 22 de call 0x3bc44 ; 0x3bc44 36b1c: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 36b20: 62 96 adiw r28, 0x12 ; 18 36b22: 6c af std Y+60, r22 ; 0x3c 36b24: 7d af std Y+61, r23 ; 0x3d 36b26: 8e af std Y+62, r24 ; 0x3e 36b28: 9f af std Y+63, r25 ; 0x3f 36b2a: 62 97 sbiw r28, 0x12 ; 18 36b2c: f8 01 movw r30, r16 36b2e: 66 ab std Z+54, r22 ; 0x36 36b30: 77 ab std Z+55, r23 ; 0x37 36b32: 80 af std Z+56, r24 ; 0x38 36b34: 91 af std Z+57, r25 ; 0x39 36b36: 9e 01 movw r18, r28 36b38: 2f 5f subi r18, 0xFF ; 255 36b3a: 3f 4f sbci r19, 0xFF ; 255 36b3c: 6c 96 adiw r28, 0x1c ; 28 36b3e: 3f af std Y+63, r19 ; 0x3f 36b40: 2e af std Y+62, r18 ; 0x3e 36b42: 6c 97 sbiw r28, 0x1c ; 28 36b44: ae 01 movw r20, r28 36b46: 4f 5e subi r20, 0xEF ; 239 36b48: 5f 4f sbci r21, 0xFF ; 255 36b4a: a0 96 adiw r28, 0x20 ; 32 36b4c: 5f af std Y+63, r21 ; 0x3f 36b4e: 4e af std Y+62, r20 ; 0x3e 36b50: a0 97 sbiw r28, 0x20 ; 32 36b52: 80 91 71 02 lds r24, 0x0271 ; 0x800271 36b56: 90 91 72 02 lds r25, 0x0272 ; 0x800272 36b5a: 9a ab std Y+50, r25 ; 0x32 36b5c: 89 ab std Y+49, r24 ; 0x31 36b5e: 40 96 adiw r24, 0x10 ; 16 36b60: 6e 96 adiw r28, 0x1e ; 30 36b62: 9f af std Y+63, r25 ; 0x3f 36b64: 8e af std Y+62, r24 ; 0x3e 36b66: 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]) 36b68: 68 96 adiw r28, 0x18 ; 24 36b6a: 5f af std Y+63, r21 ; 0x3f 36b6c: 4e af std Y+62, r20 ; 0x3e 36b6e: 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 36b70: 19 a6 std Y+41, r1 ; 0x29 36b72: 1d a6 std Y+45, r1 ; 0x2d 36b74: 00 e8 ldi r16, 0x80 ; 128 36b76: 1f e3 ldi r17, 0x3F ; 63 for(int i=0; i < 4; i++) { current_speed[i] = delta_mm[i] * inverse_second; 36b78: 6c 96 adiw r28, 0x1c ; 28 36b7a: ae ad ldd r26, Y+62 ; 0x3e 36b7c: bf ad ldd r27, Y+63 ; 0x3f 36b7e: 6c 97 sbiw r28, 0x1c ; 28 36b80: 2d 91 ld r18, X+ 36b82: 3d 91 ld r19, X+ 36b84: 4d 91 ld r20, X+ 36b86: 5d 91 ld r21, X+ 36b88: 6c 96 adiw r28, 0x1c ; 28 36b8a: bf af std Y+63, r27 ; 0x3f 36b8c: ae af std Y+62, r26 ; 0x3e 36b8e: 6c 97 sbiw r28, 0x1c ; 28 36b90: c7 01 movw r24, r14 36b92: b6 01 movw r22, r12 36b94: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 36b98: 68 96 adiw r28, 0x18 ; 24 36b9a: ee ad ldd r30, Y+62 ; 0x3e 36b9c: ff ad ldd r31, Y+63 ; 0x3f 36b9e: 68 97 sbiw r28, 0x18 ; 24 36ba0: 61 93 st Z+, r22 36ba2: 71 93 st Z+, r23 36ba4: 81 93 st Z+, r24 36ba6: 91 93 st Z+, r25 36ba8: 68 96 adiw r28, 0x18 ; 24 36baa: ff af std Y+63, r31 ; 0x3f 36bac: ee af std Y+62, r30 ; 0x3e 36bae: 68 97 sbiw r28, 0x18 ; 24 if(fabs(current_speed[i]) > max_feedrate[i]) 36bb0: 4b 01 movw r8, r22 36bb2: 5c 01 movw r10, r24 36bb4: e8 94 clt 36bb6: b7 f8 bld r11, 7 36bb8: a9 a9 ldd r26, Y+49 ; 0x31 36bba: ba a9 ldd r27, Y+50 ; 0x32 36bbc: 2d 91 ld r18, X+ 36bbe: 3d 91 ld r19, X+ 36bc0: 4d 91 ld r20, X+ 36bc2: 5d 91 ld r21, X+ 36bc4: ba ab std Y+50, r27 ; 0x32 36bc6: a9 ab std Y+49, r26 ; 0x31 36bc8: 66 96 adiw r28, 0x16 ; 22 36bca: 2c af std Y+60, r18 ; 0x3c 36bcc: 3d af std Y+61, r19 ; 0x3d 36bce: 4e af std Y+62, r20 ; 0x3e 36bd0: 5f af std Y+63, r21 ; 0x3f 36bd2: 66 97 sbiw r28, 0x16 ; 22 36bd4: c5 01 movw r24, r10 36bd6: b4 01 movw r22, r8 36bd8: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 36bdc: 18 16 cp r1, r24 36bde: b4 f4 brge .+44 ; 0x36c0c { speed_factor = min(speed_factor, max_feedrate[i] / fabs(current_speed[i])); 36be0: a5 01 movw r20, r10 36be2: 94 01 movw r18, r8 36be4: 66 96 adiw r28, 0x16 ; 22 36be6: 6c ad ldd r22, Y+60 ; 0x3c 36be8: 7d ad ldd r23, Y+61 ; 0x3d 36bea: 8e ad ldd r24, Y+62 ; 0x3e 36bec: 9f ad ldd r25, Y+63 ; 0x3f 36bee: 66 97 sbiw r28, 0x16 ; 22 36bf0: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 36bf4: 4b 01 movw r8, r22 36bf6: 5c 01 movw r10, r24 36bf8: 29 a5 ldd r18, Y+41 ; 0x29 36bfa: 3d a5 ldd r19, Y+45 ; 0x2d 36bfc: a8 01 movw r20, r16 36bfe: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 36c02: 18 16 cp r1, r24 36c04: 1c f0 brlt .+6 ; 0x36c0c 36c06: 89 a6 std Y+41, r8 ; 0x29 36c08: 9d a6 std Y+45, r9 ; 0x2d 36c0a: 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++) 36c0c: 6e 96 adiw r28, 0x1e ; 30 36c0e: ee ad ldd r30, Y+62 ; 0x3e 36c10: ff ad ldd r31, Y+63 ; 0x3f 36c12: 6e 97 sbiw r28, 0x1e ; 30 36c14: 29 a9 ldd r18, Y+49 ; 0x31 36c16: 3a a9 ldd r19, Y+50 ; 0x32 36c18: e2 17 cp r30, r18 36c1a: f3 07 cpc r31, r19 36c1c: 09 f0 breq .+2 ; 0x36c20 36c1e: ac cf rjmp .-168 ; 0x36b78 speed_factor = min(speed_factor, max_feedrate[i] / fabs(current_speed[i])); } } // Correct the speed if( speed_factor < 1.0) 36c20: 20 e0 ldi r18, 0x00 ; 0 36c22: 30 e0 ldi r19, 0x00 ; 0 36c24: 40 e8 ldi r20, 0x80 ; 128 36c26: 5f e3 ldi r21, 0x3F ; 63 36c28: 69 a5 ldd r22, Y+41 ; 0x29 36c2a: 7d a5 ldd r23, Y+45 ; 0x2d 36c2c: c8 01 movw r24, r16 36c2e: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 36c32: 87 ff sbrs r24, 7 36c34: 50 c0 rjmp .+160 ; 0x36cd6 36c36: a0 96 adiw r28, 0x20 ; 32 36c38: ae ac ldd r10, Y+62 ; 0x3e 36c3a: bf ac ldd r11, Y+63 ; 0x3f 36c3c: a0 97 sbiw r28, 0x20 ; 32 36c3e: 30 e1 ldi r19, 0x10 ; 16 36c40: a3 0e add r10, r19 36c42: b1 1c adc r11, r1 36c44: a0 96 adiw r28, 0x20 ; 32 36c46: ce ac ldd r12, Y+62 ; 0x3e 36c48: df ac ldd r13, Y+63 ; 0x3f 36c4a: a0 97 sbiw r28, 0x20 ; 32 { for(unsigned char i=0; i < 4; i++) { current_speed[i] *= speed_factor; 36c4c: d6 01 movw r26, r12 36c4e: 6d 91 ld r22, X+ 36c50: 7d 91 ld r23, X+ 36c52: 8d 91 ld r24, X+ 36c54: 9d 91 ld r25, X+ 36c56: 6d 01 movw r12, r26 36c58: 7d 01 movw r14, r26 36c5a: b4 e0 ldi r27, 0x04 ; 4 36c5c: eb 1a sub r14, r27 36c5e: f1 08 sbc r15, r1 36c60: 29 a5 ldd r18, Y+41 ; 0x29 36c62: 3d a5 ldd r19, Y+45 ; 0x2d 36c64: a8 01 movw r20, r16 36c66: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 36c6a: f7 01 movw r30, r14 36c6c: 60 83 st Z, r22 36c6e: 71 83 std Z+1, r23 ; 0x01 36c70: 82 83 std Z+2, r24 ; 0x02 36c72: 93 83 std Z+3, r25 ; 0x03 } // Correct the speed if( speed_factor < 1.0) { for(unsigned char i=0; i < 4; i++) 36c74: ac 14 cp r10, r12 36c76: bd 04 cpc r11, r13 36c78: 49 f7 brne .-46 ; 0x36c4c { current_speed[i] *= speed_factor; } block->nominal_speed *= speed_factor; 36c7a: 2e e6 ldi r18, 0x6E ; 110 36c7c: 22 9d mul r18, r2 36c7e: c0 01 movw r24, r0 36c80: 23 9d mul r18, r3 36c82: 90 0d add r25, r0 36c84: 11 24 eor r1, r1 36c86: 9c 01 movw r18, r24 36c88: 2b 53 subi r18, 0x3B ; 59 36c8a: 39 4f sbci r19, 0xF9 ; 249 36c8c: 79 01 movw r14, r18 36c8e: 29 a5 ldd r18, Y+41 ; 0x29 36c90: 3d a5 ldd r19, Y+45 ; 0x2d 36c92: a8 01 movw r20, r16 36c94: 6d a9 ldd r22, Y+53 ; 0x35 36c96: 7e a9 ldd r23, Y+54 ; 0x36 36c98: 8f a9 ldd r24, Y+55 ; 0x37 36c9a: 98 ad ldd r25, Y+56 ; 0x38 36c9c: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 36ca0: d7 01 movw r26, r14 36ca2: 91 96 adiw r26, 0x21 ; 33 36ca4: 6d 93 st X+, r22 36ca6: 7d 93 st X+, r23 36ca8: 8d 93 st X+, r24 36caa: 9c 93 st X, r25 36cac: 94 97 sbiw r26, 0x24 ; 36 block->nominal_rate *= speed_factor; 36cae: 62 96 adiw r28, 0x12 ; 18 36cb0: 6c ad ldd r22, Y+60 ; 0x3c 36cb2: 7d ad ldd r23, Y+61 ; 0x3d 36cb4: 8e ad ldd r24, Y+62 ; 0x3e 36cb6: 9f ad ldd r25, Y+63 ; 0x3f 36cb8: 62 97 sbiw r28, 0x12 ; 18 36cba: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 36cbe: 29 a5 ldd r18, Y+41 ; 0x29 36cc0: 3d a5 ldd r19, Y+45 ; 0x2d 36cc2: a8 01 movw r20, r16 36cc4: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 36cc8: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 36ccc: f7 01 movw r30, r14 36cce: 66 ab std Z+54, r22 ; 0x36 36cd0: 77 ab std Z+55, r23 ; 0x37 36cd2: 80 af std Z+56, r24 ; 0x38 36cd4: 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; 36cd6: a3 01 movw r20, r6 36cd8: 92 01 movw r18, r4 36cda: 69 ad ldd r22, Y+57 ; 0x39 36cdc: 7a ad ldd r23, Y+58 ; 0x3a 36cde: 8b ad ldd r24, Y+59 ; 0x3b 36ce0: 9c ad ldd r25, Y+60 ; 0x3c 36ce2: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 36ce6: 69 a7 std Y+41, r22 ; 0x29 36ce8: 7a a7 std Y+42, r23 ; 0x2a 36cea: 8b a7 std Y+43, r24 ; 0x2b 36cec: 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) 36cee: 2e 96 adiw r28, 0x0e ; 14 36cf0: 2c ad ldd r18, Y+60 ; 0x3c 36cf2: 3d ad ldd r19, Y+61 ; 0x3d 36cf4: 4e ad ldd r20, Y+62 ; 0x3e 36cf6: 5f ad ldd r21, Y+63 ; 0x3f 36cf8: 2e 97 sbiw r28, 0x0e ; 14 36cfa: 23 2b or r18, r19 36cfc: 24 2b or r18, r20 36cfe: 25 2b or r18, r21 36d00: 09 f0 breq .+2 ; 0x36d04 36d02: b9 c5 rjmp .+2930 ; 0x37876 36d04: 8e e6 ldi r24, 0x6E ; 110 36d06: 82 9d mul r24, r2 36d08: 80 01 movw r16, r0 36d0a: 83 9d mul r24, r3 36d0c: 10 0d add r17, r0 36d0e: 11 24 eor r1, r1 36d10: 0b 53 subi r16, 0x3B ; 59 36d12: 19 4f sbci r17, 0xF9 ; 249 36d14: f8 01 movw r30, r16 36d16: 84 81 ldd r24, Z+4 ; 0x04 36d18: 95 81 ldd r25, Z+5 ; 0x05 36d1a: a6 81 ldd r26, Z+6 ; 0x06 36d1c: b7 81 ldd r27, Z+7 ; 0x07 36d1e: 89 2b or r24, r25 36d20: 8a 2b or r24, r26 36d22: 8b 2b or r24, r27 36d24: 09 f0 breq .+2 ; 0x36d28 36d26: a7 c5 rjmp .+2894 ; 0x37876 36d28: 80 85 ldd r24, Z+8 ; 0x08 36d2a: 91 85 ldd r25, Z+9 ; 0x09 36d2c: a2 85 ldd r26, Z+10 ; 0x0a 36d2e: b3 85 ldd r27, Z+11 ; 0x0b 36d30: 89 2b or r24, r25 36d32: 8a 2b or r24, r26 36d34: 8b 2b or r24, r27 36d36: 09 f0 breq .+2 ; 0x36d3a 36d38: 9e c5 rjmp .+2876 ; 0x37876 { accel = ceil(cs.retract_acceleration * steps_per_mm); // convert to: acceleration steps/sec^2 36d3a: 20 91 f6 0d lds r18, 0x0DF6 ; 0x800df6 36d3e: 30 91 f7 0d lds r19, 0x0DF7 ; 0x800df7 36d42: 40 91 f8 0d lds r20, 0x0DF8 ; 0x800df8 36d46: 50 91 f9 0d lds r21, 0x0DF9 ; 0x800df9 36d4a: 69 a5 ldd r22, Y+41 ; 0x29 36d4c: 7a a5 ldd r23, Y+42 ; 0x2a 36d4e: 8b a5 ldd r24, Y+43 ; 0x2b 36d50: 9c a5 ldd r25, Y+44 ; 0x2c 36d52: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 36d56: 0f 94 22 de call 0x3bc44 ; 0x3bc44 36d5a: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 36d5e: 2b 01 movw r4, r22 36d60: 3c 01 movw r6, r24 #ifdef LIN_ADVANCE block->use_advance_lead = false; 36d62: f8 01 movw r30, r16 36d64: e4 5b subi r30, 0xB4 ; 180 36d66: ff 4f sbci r31, 0xFF ; 255 36d68: 10 82 st Z, r1 block->nominal_speed *= speed_factor; block->nominal_rate *= speed_factor; } #ifdef LIN_ADVANCE float e_D_ratio = 0; 36d6a: 6a 96 adiw r28, 0x1a ; 26 36d6c: 1c ae std Y+60, r1 ; 0x3c 36d6e: 1d ae std Y+61, r1 ; 0x3d 36d70: 1e ae std Y+62, r1 ; 0x3e 36d72: 1f ae std Y+63, r1 ; 0x3f 36d74: 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; 36d76: 8e e6 ldi r24, 0x6E ; 110 36d78: 82 9d mul r24, r2 36d7a: 80 01 movw r16, r0 36d7c: 83 9d mul r24, r3 36d7e: 10 0d add r17, r0 36d80: 11 24 eor r1, r1 36d82: 0b 53 subi r16, 0x3B ; 59 36d84: 19 4f sbci r17, 0xF9 ; 249 36d86: f8 01 movw r30, r16 36d88: ee 5b subi r30, 0xBE ; 190 36d8a: ff 4f sbci r31, 0xFF ; 255 36d8c: 40 82 st Z, r4 36d8e: 51 82 std Z+1, r5 ; 0x01 36d90: 62 82 std Z+2, r6 ; 0x02 36d92: 73 82 std Z+3, r7 ; 0x03 block->acceleration = accel / steps_per_mm; 36d94: c3 01 movw r24, r6 36d96: b2 01 movw r22, r4 36d98: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 36d9c: 6b 01 movw r12, r22 36d9e: 7c 01 movw r14, r24 36da0: 29 a5 ldd r18, Y+41 ; 0x29 36da2: 3a a5 ldd r19, Y+42 ; 0x2a 36da4: 4b a5 ldd r20, Y+43 ; 0x2b 36da6: 5c a5 ldd r21, Y+44 ; 0x2c 36da8: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 36dac: e2 96 adiw r28, 0x32 ; 50 36dae: 6c af std Y+60, r22 ; 0x3c 36db0: 7d af std Y+61, r23 ; 0x3d 36db2: 8e af std Y+62, r24 ; 0x3e 36db4: 9f af std Y+63, r25 ; 0x3f 36db6: e2 97 sbiw r28, 0x32 ; 50 36db8: f8 01 movw r30, r16 36dba: 61 ab std Z+49, r22 ; 0x31 36dbc: 72 ab std Z+50, r23 ; 0x32 36dbe: 83 ab std Z+51, r24 ; 0x33 36dc0: 94 ab std Z+52, r25 ; 0x34 block->acceleration_rate = (uint32_t)(accel * (float(1UL << 24) / ((F_CPU) / 8.0f))); 36dc2: 2d eb ldi r18, 0xBD ; 189 36dc4: 37 e3 ldi r19, 0x37 ; 55 36dc6: 46 e0 ldi r20, 0x06 ; 6 36dc8: 51 e4 ldi r21, 0x41 ; 65 36dca: c7 01 movw r24, r14 36dcc: b6 01 movw r22, r12 36dce: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 36dd2: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 36dd6: d8 01 movw r26, r16 36dd8: 54 96 adiw r26, 0x14 ; 20 36dda: 6d 93 st X+, r22 36ddc: 7d 93 st X+, r23 36dde: 8d 93 st X+, r24 36de0: 9c 93 st X, r25 36de2: 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; 36de4: 91 96 adiw r26, 0x21 ; 33 36de6: bc 91 ld r27, X 36de8: 27 96 adiw r28, 0x07 ; 7 36dea: bf af std Y+63, r27 ; 0x3f 36dec: 27 97 sbiw r28, 0x07 ; 7 36dee: f8 01 movw r30, r16 36df0: f2 a1 ldd r31, Z+34 ; 0x22 36df2: 2b 96 adiw r28, 0x0b ; 11 36df4: ff af std Y+63, r31 ; 0x3f 36df6: 2b 97 sbiw r28, 0x0b ; 11 36df8: d8 01 movw r26, r16 36dfa: 93 96 adiw r26, 0x23 ; 35 36dfc: bc 91 ld r27, X 36dfe: 2f 96 adiw r28, 0x0f ; 15 36e00: bf af std Y+63, r27 ; 0x3f 36e02: 2f 97 sbiw r28, 0x0f ; 15 36e04: f8 01 movw r30, r16 36e06: f4 a1 ldd r31, Z+36 ; 0x24 36e08: 63 96 adiw r28, 0x13 ; 19 36e0a: ff af std Y+63, r31 ; 0x3f 36e0c: 63 97 sbiw r28, 0x13 ; 19 36e0e: 26 e0 ldi r18, 0x06 ; 6 36e10: 3e e0 ldi r19, 0x0E ; 14 36e12: ee 96 adiw r28, 0x3e ; 62 36e14: 3f af std Y+63, r19 ; 0x3f 36e16: 2e af std Y+62, r18 ; 0x3e 36e18: ee 97 sbiw r28, 0x3e ; 62 36e1a: a0 96 adiw r28, 0x20 ; 32 36e1c: 4e ac ldd r4, Y+62 ; 0x3e 36e1e: 5f ac ldd r5, Y+63 ; 0x3f 36e20: a0 97 sbiw r28, 0x20 ; 32 36e22: 30 e1 ldi r19, 0x10 ; 16 36e24: 43 0e add r4, r19 36e26: 51 1c adc r5, r1 36e28: 06 e0 ldi r16, 0x06 ; 6 36e2a: 1e e0 ldi r17, 0x0E ; 14 36e2c: a0 96 adiw r28, 0x20 ; 32 36e2e: 6e ac ldd r6, Y+62 ; 0x3e 36e30: 7f ac ldd r7, Y+63 ; 0x3f 36e32: a0 97 sbiw r28, 0x20 ; 32 36e34: 27 96 adiw r28, 0x07 ; 7 36e36: 4f ad ldd r20, Y+63 ; 0x3f 36e38: 27 97 sbiw r28, 0x07 ; 7 36e3a: 49 a7 std Y+41, r20 ; 0x29 36e3c: 2b 96 adiw r28, 0x0b ; 11 36e3e: 5f ad ldd r21, Y+63 ; 0x3f 36e40: 2b 97 sbiw r28, 0x0b ; 11 36e42: 5d a7 std Y+45, r21 ; 0x2d 36e44: b9 ab std Y+49, r27 ; 0x31 36e46: f9 af std Y+57, r31 ; 0x39 bool limited = false; 36e48: 1d aa std Y+53, r1 ; 0x35 for (uint8_t axis = 0; axis < 4; ++ axis) { float jerk = fabs(current_speed[axis]); 36e4a: d3 01 movw r26, r6 36e4c: 8d 90 ld r8, X+ 36e4e: 9d 90 ld r9, X+ 36e50: ad 90 ld r10, X+ 36e52: bd 90 ld r11, X+ 36e54: 3d 01 movw r6, r26 36e56: e8 94 clt 36e58: b7 f8 bld r11, 7 if (jerk > cs.max_jerk[axis]) { 36e5a: f8 01 movw r30, r16 36e5c: c1 90 ld r12, Z+ 36e5e: d1 90 ld r13, Z+ 36e60: e1 90 ld r14, Z+ 36e62: f1 90 ld r15, Z+ 36e64: 8f 01 movw r16, r30 36e66: a5 01 movw r20, r10 36e68: 94 01 movw r18, r8 36e6a: c7 01 movw r24, r14 36e6c: b6 01 movw r22, r12 36e6e: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 36e72: 87 ff sbrs r24, 7 36e74: 3a c0 rjmp .+116 ; 0x36eea // The actual jerk is lower, if it has been limited by the XY jerk. if (limited) { 36e76: fd a9 ldd r31, Y+53 ; 0x35 36e78: ff 23 and r31, r31 36e7a: 09 f4 brne .+2 ; 0x36e7e 36e7c: 7e c6 rjmp .+3324 ; 0x37b7a // 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; 36e7e: 29 a5 ldd r18, Y+41 ; 0x29 36e80: 3d a5 ldd r19, Y+45 ; 0x2d 36e82: 49 a9 ldd r20, Y+49 ; 0x31 36e84: 59 ad ldd r21, Y+57 ; 0x39 36e86: c5 01 movw r24, r10 36e88: b4 01 movw r22, r8 36e8a: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 36e8e: 4b 01 movw r8, r22 36e90: 5c 01 movw r10, r24 float mjerk = cs.max_jerk[axis] * block->nominal_speed; 36e92: a7 01 movw r20, r14 36e94: 96 01 movw r18, r12 36e96: 27 96 adiw r28, 0x07 ; 7 36e98: 6f ad ldd r22, Y+63 ; 0x3f 36e9a: 27 97 sbiw r28, 0x07 ; 7 36e9c: 2b 96 adiw r28, 0x0b ; 11 36e9e: 7f ad ldd r23, Y+63 ; 0x3f 36ea0: 2b 97 sbiw r28, 0x0b ; 11 36ea2: 2f 96 adiw r28, 0x0f ; 15 36ea4: 8f ad ldd r24, Y+63 ; 0x3f 36ea6: 2f 97 sbiw r28, 0x0f ; 15 36ea8: 63 96 adiw r28, 0x13 ; 19 36eaa: 9f ad ldd r25, Y+63 ; 0x3f 36eac: 63 97 sbiw r28, 0x13 ; 19 36eae: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 36eb2: 6b 01 movw r12, r22 36eb4: 7c 01 movw r14, r24 if (jerk > mjerk) { 36eb6: ac 01 movw r20, r24 36eb8: 9b 01 movw r18, r22 36eba: c5 01 movw r24, r10 36ebc: b4 01 movw r22, r8 36ebe: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 36ec2: 18 16 cp r1, r24 36ec4: 94 f4 brge .+36 ; 0x36eea safe_speed *= mjerk / jerk; 36ec6: a5 01 movw r20, r10 36ec8: 94 01 movw r18, r8 36eca: c7 01 movw r24, r14 36ecc: b6 01 movw r22, r12 36ece: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 36ed2: 9b 01 movw r18, r22 36ed4: ac 01 movw r20, r24 36ed6: 69 a5 ldd r22, Y+41 ; 0x29 36ed8: 7d a5 ldd r23, Y+45 ; 0x2d 36eda: 89 a9 ldd r24, Y+49 ; 0x31 36edc: 99 ad ldd r25, Y+57 ; 0x39 36ede: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 36ee2: 69 a7 std Y+41, r22 ; 0x29 36ee4: 7d a7 std Y+45, r23 ; 0x2d 36ee6: 89 ab std Y+49, r24 ; 0x31 36ee8: 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) { 36eea: 46 14 cp r4, r6 36eec: 57 04 cpc r5, r7 36eee: 09 f0 breq .+2 ; 0x36ef2 36ef0: ac cf rjmp .-168 ; 0x36e4a } } } // Reset the block flag. block->flag = 0; 36ef2: 8e e6 ldi r24, 0x6E ; 110 36ef4: 82 9d mul r24, r2 36ef6: f0 01 movw r30, r0 36ef8: 83 9d mul r24, r3 36efa: f0 0d add r31, r0 36efc: 11 24 eor r1, r1 36efe: eb 53 subi r30, 0x3B ; 59 36f00: f9 4f sbci r31, 0xF9 ; 249 36f02: 15 aa std Z+53, r1 ; 0x35 if (plan_reset_next_e_sched) 36f04: 80 91 b7 04 lds r24, 0x04B7 ; 0x8004b7 <_ZL23plan_reset_next_e_sched.lto_priv.487> 36f08: 88 23 and r24, r24 36f0a: 21 f0 breq .+8 ; 0x36f14 { // finally propagate a pending reset block->flag |= BLOCK_FLAG_E_RESET; 36f0c: 80 e1 ldi r24, 0x10 ; 16 36f0e: 85 ab std Z+53, r24 ; 0x35 plan_reset_next_e_sched = false; 36f10: 10 92 b7 04 sts 0x04B7, r1 ; 0x8004b7 <_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) { 36f14: 3d ad ldd r19, Y+61 ; 0x3d 36f16: 32 30 cpi r19, 0x02 ; 2 36f18: 08 f4 brcc .+2 ; 0x36f1c 36f1a: 8f c6 rjmp .+3358 ; 0x37c3a 36f1c: 40 91 b9 04 lds r20, 0x04B9 ; 0x8004b9 <_ZL22previous_nominal_speed.lto_priv.488> 36f20: 6b 96 adiw r28, 0x1b ; 27 36f22: 4f af std Y+63, r20 ; 0x3f 36f24: 6b 97 sbiw r28, 0x1b ; 27 36f26: 50 91 ba 04 lds r21, 0x04BA ; 0x8004ba <_ZL22previous_nominal_speed.lto_priv.488+0x1> 36f2a: 6d 96 adiw r28, 0x1d ; 29 36f2c: 5f af std Y+63, r21 ; 0x3f 36f2e: 6d 97 sbiw r28, 0x1d ; 29 36f30: 00 91 bb 04 lds r16, 0x04BB ; 0x8004bb <_ZL22previous_nominal_speed.lto_priv.488+0x2> 36f34: 10 91 bc 04 lds r17, 0x04BC ; 0x8004bc <_ZL22previous_nominal_speed.lto_priv.488+0x3> 36f38: 27 e1 ldi r18, 0x17 ; 23 36f3a: 37 eb ldi r19, 0xB7 ; 183 36f3c: 41 ed ldi r20, 0xD1 ; 209 36f3e: 58 e3 ldi r21, 0x38 ; 56 36f40: 6b 96 adiw r28, 0x1b ; 27 36f42: 6f ad ldd r22, Y+63 ; 0x3f 36f44: 6b 97 sbiw r28, 0x1b ; 27 36f46: 6d 96 adiw r28, 0x1d ; 29 36f48: 7f ad ldd r23, Y+63 ; 0x3f 36f4a: 6d 97 sbiw r28, 0x1d ; 29 36f4c: c8 01 movw r24, r16 36f4e: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 36f52: 18 16 cp r1, r24 36f54: 0c f0 brlt .+2 ; 0x36f58 36f56: 71 c6 rjmp .+3298 ; 0x37c3a // 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); 36f58: 6b 96 adiw r28, 0x1b ; 27 36f5a: 2f ad ldd r18, Y+63 ; 0x3f 36f5c: 6b 97 sbiw r28, 0x1b ; 27 36f5e: 6d 96 adiw r28, 0x1d ; 29 36f60: 3f ad ldd r19, Y+63 ; 0x3f 36f62: 6d 97 sbiw r28, 0x1d ; 29 36f64: a8 01 movw r20, r16 36f66: 27 96 adiw r28, 0x07 ; 7 36f68: 6f ad ldd r22, Y+63 ; 0x3f 36f6a: 27 97 sbiw r28, 0x07 ; 7 36f6c: 2b 96 adiw r28, 0x0b ; 11 36f6e: 7f ad ldd r23, Y+63 ; 0x3f 36f70: 2b 97 sbiw r28, 0x0b ; 11 36f72: 2f 96 adiw r28, 0x0f ; 15 36f74: 8f ad ldd r24, Y+63 ; 0x3f 36f76: 2f 97 sbiw r28, 0x0f ; 15 36f78: 63 96 adiw r28, 0x13 ; 19 36f7a: 9f ad ldd r25, Y+63 ; 0x3f 36f7c: 63 97 sbiw r28, 0x13 ; 19 36f7e: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 36f82: 87 ff sbrs r24, 7 36f84: 01 c6 rjmp .+3074 ; 0x37b88 36f86: 6b 96 adiw r28, 0x1b ; 27 36f88: 2f ad ldd r18, Y+63 ; 0x3f 36f8a: 6b 97 sbiw r28, 0x1b ; 27 36f8c: 6d 96 adiw r28, 0x1d ; 29 36f8e: 3f ad ldd r19, Y+63 ; 0x3f 36f90: 6d 97 sbiw r28, 0x1d ; 29 36f92: a8 01 movw r20, r16 36f94: 27 96 adiw r28, 0x07 ; 7 36f96: 6f ad ldd r22, Y+63 ; 0x3f 36f98: 27 97 sbiw r28, 0x07 ; 7 36f9a: 2b 96 adiw r28, 0x0b ; 11 36f9c: 7f ad ldd r23, Y+63 ; 0x3f 36f9e: 2b 97 sbiw r28, 0x0b ; 11 36fa0: 2f 96 adiw r28, 0x0f ; 15 36fa2: 8f ad ldd r24, Y+63 ; 0x3f 36fa4: 2f 97 sbiw r28, 0x0f ; 15 36fa6: 63 96 adiw r28, 0x13 ; 19 36fa8: 9f ad ldd r25, Y+63 ; 0x3f 36faa: 63 97 sbiw r28, 0x13 ; 19 36fac: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 36fb0: ec 96 adiw r28, 0x3c ; 60 36fb2: 6c af std Y+60, r22 ; 0x3c 36fb4: 7d af std Y+61, r23 ; 0x3d 36fb6: 8e af std Y+62, r24 ; 0x3e 36fb8: 9f af std Y+63, r25 ; 0x3f 36fba: 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; 36fbc: 27 96 adiw r28, 0x07 ; 7 36fbe: 8f ad ldd r24, Y+63 ; 0x3f 36fc0: 27 97 sbiw r28, 0x07 ; 7 36fc2: 8d af std Y+61, r24 ; 0x3d 36fc4: 2b 96 adiw r28, 0x0b ; 11 36fc6: 9f ad ldd r25, Y+63 ; 0x3f 36fc8: 2b 97 sbiw r28, 0x0b ; 11 36fca: 9d ab std Y+53, r25 ; 0x35 36fcc: 2f 96 adiw r28, 0x0f ; 15 36fce: af ad ldd r26, Y+63 ; 0x3f 36fd0: 2f 97 sbiw r28, 0x0f ; 15 36fd2: ae af std Y+62, r26 ; 0x3e 36fd4: 63 96 adiw r28, 0x13 ; 19 36fd6: bf ad ldd r27, Y+63 ; 0x3f 36fd8: 63 97 sbiw r28, 0x13 ; 19 36fda: 23 96 adiw r28, 0x03 ; 3 36fdc: bf af std Y+63, r27 ; 0x3f 36fde: 23 97 sbiw r28, 0x03 ; 3 36fe0: 2d eb ldi r18, 0xBD ; 189 36fe2: 34 e0 ldi r19, 0x04 ; 4 36fe4: e8 96 adiw r28, 0x38 ; 56 36fe6: 3f af std Y+63, r19 ; 0x3f 36fe8: 2e af std Y+62, r18 ; 0x3e 36fea: e8 97 sbiw r28, 0x38 ; 56 // Factor to multiply the previous / current nominal velocities to get componentwise limited velocities. float v_factor = 1.f; 36fec: 41 2c mov r4, r1 36fee: 51 2c mov r5, r1 36ff0: 30 e8 ldi r19, 0x80 ; 128 36ff2: 63 2e mov r6, r19 36ff4: 3f e3 ldi r19, 0x3F ; 63 36ff6: 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]; 36ff8: e8 96 adiw r28, 0x38 ; 56 36ffa: ae ad ldd r26, Y+62 ; 0x3e 36ffc: bf ad ldd r27, Y+63 ; 0x3f 36ffe: e8 97 sbiw r28, 0x38 ; 56 37000: 8d 90 ld r8, X+ 37002: 9d 90 ld r9, X+ 37004: ad 90 ld r10, X+ 37006: bd 90 ld r11, X+ 37008: e8 96 adiw r28, 0x38 ; 56 3700a: bf af std Y+63, r27 ; 0x3f 3700c: ae af std Y+62, r26 ; 0x3e 3700e: e8 97 sbiw r28, 0x38 ; 56 float v_entry = current_speed [axis]; 37010: a0 96 adiw r28, 0x20 ; 32 37012: ee ad ldd r30, Y+62 ; 0x3e 37014: ff ad ldd r31, Y+63 ; 0x3f 37016: a0 97 sbiw r28, 0x20 ; 32 37018: c1 90 ld r12, Z+ 3701a: d1 90 ld r13, Z+ 3701c: e1 90 ld r14, Z+ 3701e: f1 90 ld r15, Z+ 37020: a0 96 adiw r28, 0x20 ; 32 37022: ff af std Y+63, r31 ; 0x3f 37024: ee af std Y+62, r30 ; 0x3e 37026: a0 97 sbiw r28, 0x20 ; 32 if (prev_speed_larger) 37028: 6b 96 adiw r28, 0x1b ; 27 3702a: 2f ad ldd r18, Y+63 ; 0x3f 3702c: 6b 97 sbiw r28, 0x1b ; 27 3702e: 6d 96 adiw r28, 0x1d ; 29 37030: 3f ad ldd r19, Y+63 ; 0x3f 37032: 6d 97 sbiw r28, 0x1d ; 29 37034: a8 01 movw r20, r16 37036: 27 96 adiw r28, 0x07 ; 7 37038: 6f ad ldd r22, Y+63 ; 0x3f 3703a: 27 97 sbiw r28, 0x07 ; 7 3703c: 2b 96 adiw r28, 0x0b ; 11 3703e: 7f ad ldd r23, Y+63 ; 0x3f 37040: 2b 97 sbiw r28, 0x0b ; 11 37042: 2f 96 adiw r28, 0x0f ; 15 37044: 8f ad ldd r24, Y+63 ; 0x3f 37046: 2f 97 sbiw r28, 0x0f ; 15 37048: 63 96 adiw r28, 0x13 ; 19 3704a: 9f ad ldd r25, Y+63 ; 0x3f 3704c: 63 97 sbiw r28, 0x13 ; 19 3704e: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 37052: 87 ff sbrs r24, 7 37054: 0c c0 rjmp .+24 ; 0x3706e v_exit *= smaller_speed_factor; 37056: ec 96 adiw r28, 0x3c ; 60 37058: 2c ad ldd r18, Y+60 ; 0x3c 3705a: 3d ad ldd r19, Y+61 ; 0x3d 3705c: 4e ad ldd r20, Y+62 ; 0x3e 3705e: 5f ad ldd r21, Y+63 ; 0x3f 37060: ec 97 sbiw r28, 0x3c ; 60 37062: c5 01 movw r24, r10 37064: b4 01 movw r22, r8 37066: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 3706a: 4b 01 movw r8, r22 3706c: 5c 01 movw r10, r24 if (limited) { 3706e: a2 96 adiw r28, 0x22 ; 34 37070: ff ad ldd r31, Y+63 ; 0x3f 37072: a2 97 sbiw r28, 0x22 ; 34 37074: ff 23 and r31, r31 37076: 81 f0 breq .+32 ; 0x37098 v_exit *= v_factor; 37078: a3 01 movw r20, r6 3707a: 92 01 movw r18, r4 3707c: c5 01 movw r24, r10 3707e: b4 01 movw r22, r8 37080: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 37084: 4b 01 movw r8, r22 37086: 5c 01 movw r10, r24 v_entry *= v_factor; 37088: a3 01 movw r20, r6 3708a: 92 01 movw r18, r4 3708c: c7 01 movw r24, r14 3708e: b6 01 movw r22, r12 37090: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 37094: 6b 01 movw r12, r22 37096: 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) ? 37098: a7 01 movw r20, r14 3709a: 96 01 movw r18, r12 3709c: c5 01 movw r24, r10 3709e: b4 01 movw r22, r8 370a0: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> ((v_entry > 0.f || v_exit < 0.f) ? 370a4: 20 e0 ldi r18, 0x00 ; 0 370a6: 30 e0 ldi r19, 0x00 ; 0 370a8: 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) ? 370aa: 18 16 cp r1, r24 370ac: 0c f0 brlt .+2 ; 0x370b0 370ae: a3 c5 rjmp .+2886 ; 0x37bf6 ((v_entry > 0.f || v_exit < 0.f) ? 370b0: c7 01 movw r24, r14 370b2: b6 01 movw r22, r12 370b4: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 370b8: 18 16 cp r1, r24 370ba: 4c f0 brlt .+18 ; 0x370ce 370bc: 20 e0 ldi r18, 0x00 ; 0 370be: 30 e0 ldi r19, 0x00 ; 0 370c0: a9 01 movw r20, r18 370c2: c5 01 movw r24, r10 370c4: b4 01 movw r22, r8 370c6: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 370ca: 87 ff sbrs r24, 7 370cc: 85 c5 rjmp .+2826 ; 0x37bd8 370ce: a7 01 movw r20, r14 370d0: 96 01 movw r18, r12 370d2: c5 01 movw r24, r10 370d4: 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) ? 370d6: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 370da: 6b 01 movw r12, r22 370dc: 7c 01 movw r14, r24 // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); if (jerk > cs.max_jerk[axis]) { 370de: ee 96 adiw r28, 0x3e ; 62 370e0: ae ad ldd r26, Y+62 ; 0x3e 370e2: bf ad ldd r27, Y+63 ; 0x3f 370e4: ee 97 sbiw r28, 0x3e ; 62 370e6: 8d 90 ld r8, X+ 370e8: 9d 90 ld r9, X+ 370ea: ad 90 ld r10, X+ 370ec: bd 90 ld r11, X+ 370ee: ee 96 adiw r28, 0x3e ; 62 370f0: bf af std Y+63, r27 ; 0x3f 370f2: ae af std Y+62, r26 ; 0x3e 370f4: ee 97 sbiw r28, 0x3e ; 62 370f6: a5 01 movw r20, r10 370f8: 94 01 movw r18, r8 370fa: c7 01 movw r24, r14 370fc: b6 01 movw r22, r12 370fe: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 37102: 18 16 cp r1, r24 37104: 94 f4 brge .+36 ; 0x3712a v_factor *= cs.max_jerk[axis] / jerk; 37106: a7 01 movw r20, r14 37108: 96 01 movw r18, r12 3710a: c5 01 movw r24, r10 3710c: b4 01 movw r22, r8 3710e: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 37112: 9b 01 movw r18, r22 37114: ac 01 movw r20, r24 37116: c3 01 movw r24, r6 37118: b2 01 movw r22, r4 3711a: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 3711e: 2b 01 movw r4, r22 37120: 3c 01 movw r6, r24 limited = true; 37122: b1 e0 ldi r27, 0x01 ; 1 37124: a2 96 adiw r28, 0x22 ; 34 37126: bf af std Y+63, r27 ; 0x3f 37128: 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) { 3712a: ed ec ldi r30, 0xCD ; 205 3712c: f4 e0 ldi r31, 0x04 ; 4 3712e: e8 96 adiw r28, 0x38 ; 56 37130: 2e ad ldd r18, Y+62 ; 0x3e 37132: 3f ad ldd r19, Y+63 ; 0x3f 37134: e8 97 sbiw r28, 0x38 ; 56 37136: e2 17 cp r30, r18 37138: f3 07 cpc r31, r19 3713a: 09 f0 breq .+2 ; 0x3713e 3713c: 5d cf rjmp .-326 ; 0x36ff8 if (jerk > cs.max_jerk[axis]) { v_factor *= cs.max_jerk[axis] / jerk; limited = true; } } if (limited) 3713e: a2 96 adiw r28, 0x22 ; 34 37140: 3f ad ldd r19, Y+63 ; 0x3f 37142: a2 97 sbiw r28, 0x22 ; 34 37144: 33 23 and r19, r19 37146: 81 f0 breq .+32 ; 0x37168 vmax_junction *= v_factor; 37148: a3 01 movw r20, r6 3714a: 92 01 movw r18, r4 3714c: 6d ad ldd r22, Y+61 ; 0x3d 3714e: 7d a9 ldd r23, Y+53 ; 0x35 37150: 8e ad ldd r24, Y+62 ; 0x3e 37152: 23 96 adiw r28, 0x03 ; 3 37154: 9f ad ldd r25, Y+63 ; 0x3f 37156: 23 97 sbiw r28, 0x03 ; 3 37158: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 3715c: 6d af std Y+61, r22 ; 0x3d 3715e: 7d ab std Y+53, r23 ; 0x35 37160: 8e af std Y+62, r24 ; 0x3e 37162: 23 96 adiw r28, 0x03 ; 3 37164: 9f af std Y+63, r25 ; 0x3f 37166: 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; 37168: 24 ea ldi r18, 0xA4 ; 164 3716a: 30 e7 ldi r19, 0x70 ; 112 3716c: 4d e7 ldi r20, 0x7D ; 125 3716e: 5f e3 ldi r21, 0x3F ; 63 37170: 6d ad ldd r22, Y+61 ; 0x3d 37172: 7d a9 ldd r23, Y+53 ; 0x35 37174: 8e ad ldd r24, Y+62 ; 0x3e 37176: 23 96 adiw r28, 0x03 ; 3 37178: 9f ad ldd r25, Y+63 ; 0x3f 3717a: 23 97 sbiw r28, 0x03 ; 3 3717c: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 37180: 6b 01 movw r12, r22 37182: 7c 01 movw r14, r24 if (previous_safe_speed > vmax_junction_threshold && safe_speed > vmax_junction_threshold) { 37184: ac 01 movw r20, r24 37186: 9b 01 movw r18, r22 37188: 60 91 10 18 lds r22, 0x1810 ; 0x801810 3718c: 70 91 11 18 lds r23, 0x1811 ; 0x801811 37190: 80 91 12 18 lds r24, 0x1812 ; 0x801812 37194: 90 91 13 18 lds r25, 0x1813 ; 0x801813 37198: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 3719c: 18 16 cp r1, r24 3719e: fc f4 brge .+62 ; 0x371de 371a0: 29 a5 ldd r18, Y+41 ; 0x29 371a2: 3d a5 ldd r19, Y+45 ; 0x2d 371a4: 49 a9 ldd r20, Y+49 ; 0x31 371a6: 59 ad ldd r21, Y+57 ; 0x39 371a8: c7 01 movw r24, r14 371aa: b6 01 movw r22, r12 371ac: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 371b0: 87 ff sbrs r24, 7 371b2: 15 c0 rjmp .+42 ; 0x371de // 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; 371b4: 8e e6 ldi r24, 0x6E ; 110 371b6: 82 9d mul r24, r2 371b8: f0 01 movw r30, r0 371ba: 83 9d mul r24, r3 371bc: f0 0d add r31, r0 371be: 11 24 eor r1, r1 371c0: eb 53 subi r30, 0x3B ; 59 371c2: f9 4f sbci r31, 0xF9 ; 249 371c4: 85 a9 ldd r24, Z+53 ; 0x35 371c6: 84 60 ori r24, 0x04 ; 4 371c8: 85 ab std Z+53, r24 ; 0x35 371ca: 49 a5 ldd r20, Y+41 ; 0x29 371cc: 4d af std Y+61, r20 ; 0x3d 371ce: 5d a5 ldd r21, Y+45 ; 0x2d 371d0: 5d ab std Y+53, r21 ; 0x35 371d2: 89 a9 ldd r24, Y+49 ; 0x31 371d4: 8e af std Y+62, r24 ; 0x3e 371d6: 99 ad ldd r25, Y+57 ; 0x39 371d8: 23 96 adiw r28, 0x03 ; 3 371da: 9f af std Y+63, r25 ; 0x3f 371dc: 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; 371de: 8e e6 ldi r24, 0x6E ; 110 371e0: 82 9d mul r24, r2 371e2: 80 01 movw r16, r0 371e4: 83 9d mul r24, r3 371e6: 10 0d add r17, r0 371e8: 11 24 eor r1, r1 371ea: 0b 53 subi r16, 0x3B ; 59 371ec: 19 4f sbci r17, 0xF9 ; 249 371ee: 8d ad ldd r24, Y+61 ; 0x3d 371f0: 9d a9 ldd r25, Y+53 ; 0x35 371f2: ae ad ldd r26, Y+62 ; 0x3e 371f4: 23 96 adiw r28, 0x03 ; 3 371f6: bf ad ldd r27, Y+63 ; 0x3f 371f8: 23 97 sbiw r28, 0x03 ; 3 371fa: f8 01 movw r30, r16 371fc: 81 a7 std Z+41, r24 ; 0x29 371fe: 92 a7 std Z+42, r25 ; 0x2a 37200: a3 a7 std Z+43, r26 ; 0x2b 37202: 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); 37204: 29 a5 ldd r18, Y+41 ; 0x29 37206: 3d a5 ldd r19, Y+45 ; 0x2d 37208: 49 a9 ldd r20, Y+49 ; 0x31 3720a: 59 ad ldd r21, Y+57 ; 0x39 3720c: 69 a5 ldd r22, Y+41 ; 0x29 3720e: 7d a5 ldd r23, Y+45 ; 0x2d 37210: 89 a9 ldd r24, Y+49 ; 0x31 37212: 99 ad ldd r25, Y+57 ; 0x39 37214: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 37218: 6b 01 movw r12, r22 3721a: 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); 3721c: e2 96 adiw r28, 0x32 ; 50 3721e: 6c ad ldd r22, Y+60 ; 0x3c 37220: 7d ad ldd r23, Y+61 ; 0x3d 37222: 8e ad ldd r24, Y+62 ; 0x3e 37224: 9f ad ldd r25, Y+63 ; 0x3f 37226: e2 97 sbiw r28, 0x32 ; 50 37228: 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); 3722a: 9b 01 movw r18, r22 3722c: ac 01 movw r20, r24 3722e: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 37232: d8 01 movw r26, r16 37234: 9d 96 adiw r26, 0x2d ; 45 37236: 2d 91 ld r18, X+ 37238: 3d 91 ld r19, X+ 3723a: 4d 91 ld r20, X+ 3723c: 5c 91 ld r21, X 3723e: d0 97 sbiw r26, 0x30 ; 48 37240: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 37244: 9b 01 movw r18, r22 37246: ac 01 movw r20, r24 37248: c7 01 movw r24, r14 3724a: b6 01 movw r22, r12 3724c: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 37250: 0f 94 12 e1 call 0x3c224 ; 0x3c224 37254: d6 2e mov r13, r22 37256: e7 2e mov r14, r23 37258: 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); 3725a: 2d ad ldd r18, Y+61 ; 0x3d 3725c: 3d a9 ldd r19, Y+53 ; 0x35 3725e: 4e ad ldd r20, Y+62 ; 0x3e 37260: 23 96 adiw r28, 0x03 ; 3 37262: 5f ad ldd r21, Y+63 ; 0x3f 37264: 23 97 sbiw r28, 0x03 ; 3 37266: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 3726a: 18 16 cp r1, r24 3726c: 34 f0 brlt .+12 ; 0x3727a 3726e: dd ae std Y+61, r13 ; 0x3d 37270: ed aa std Y+53, r14 ; 0x35 37272: 0e af std Y+62, r16 ; 0x3e 37274: 23 96 adiw r28, 0x03 ; 3 37276: 1f af std Y+63, r17 ; 0x3f 37278: 23 97 sbiw r28, 0x03 ; 3 3727a: 8e e6 ldi r24, 0x6E ; 110 3727c: 82 9d mul r24, r2 3727e: f0 01 movw r30, r0 37280: 83 9d mul r24, r3 37282: f0 0d add r31, r0 37284: 11 24 eor r1, r1 37286: eb 53 subi r30, 0x3B ; 59 37288: f9 4f sbci r31, 0xF9 ; 249 3728a: 8d ad ldd r24, Y+61 ; 0x3d 3728c: 9d a9 ldd r25, Y+53 ; 0x35 3728e: ae ad ldd r26, Y+62 ; 0x3e 37290: 23 96 adiw r28, 0x03 ; 3 37292: bf ad ldd r27, Y+63 ; 0x3f 37294: 23 97 sbiw r28, 0x03 ; 3 37296: 85 a3 std Z+37, r24 ; 0x25 37298: 96 a3 std Z+38, r25 ; 0x26 3729a: a7 a3 std Z+39, r26 ; 0x27 3729c: 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; 3729e: f5 a8 ldd r15, Z+53 ; 0x35 372a0: 2d 2d mov r18, r13 372a2: 3e 2d mov r19, r14 372a4: a8 01 movw r20, r16 372a6: 27 96 adiw r28, 0x07 ; 7 372a8: 6f ad ldd r22, Y+63 ; 0x3f 372aa: 27 97 sbiw r28, 0x07 ; 7 372ac: 2b 96 adiw r28, 0x0b ; 11 372ae: 7f ad ldd r23, Y+63 ; 0x3f 372b0: 2b 97 sbiw r28, 0x0b ; 11 372b2: 2f 96 adiw r28, 0x0f ; 15 372b4: 8f ad ldd r24, Y+63 ; 0x3f 372b6: 2f 97 sbiw r28, 0x0f ; 15 372b8: 63 96 adiw r28, 0x13 ; 19 372ba: 9f ad ldd r25, Y+63 ; 0x3f 372bc: 63 97 sbiw r28, 0x13 ; 19 372be: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 372c2: 18 16 cp r1, r24 372c4: 0c f4 brge .+2 ; 0x372c8 372c6: cf c4 rjmp .+2462 ; 0x37c66 372c8: 83 e0 ldi r24, 0x03 ; 3 372ca: 9e e6 ldi r25, 0x6E ; 110 372cc: 92 9d mul r25, r2 372ce: 80 01 movw r16, r0 372d0: 93 9d mul r25, r3 372d2: 10 0d add r17, r0 372d4: 11 24 eor r1, r1 372d6: 0b 53 subi r16, 0x3B ; 59 372d8: 19 4f sbci r17, 0xF9 ; 249 372da: f8 2a or r15, r24 372dc: f8 01 movw r30, r16 372de: 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[] 372e0: 80 e1 ldi r24, 0x10 ; 16 372e2: fe 01 movw r30, r28 372e4: 71 96 adiw r30, 0x11 ; 17 372e6: ad eb ldi r26, 0xBD ; 189 372e8: b4 e0 ldi r27, 0x04 ; 4 372ea: 01 90 ld r0, Z+ 372ec: 0d 92 st X+, r0 372ee: 8a 95 dec r24 372f0: e1 f7 brne .-8 ; 0x372ea previous_nominal_speed = block->nominal_speed; 372f2: 27 96 adiw r28, 0x07 ; 7 372f4: 8f ad ldd r24, Y+63 ; 0x3f 372f6: 27 97 sbiw r28, 0x07 ; 7 372f8: 2b 96 adiw r28, 0x0b ; 11 372fa: 9f ad ldd r25, Y+63 ; 0x3f 372fc: 2b 97 sbiw r28, 0x0b ; 11 372fe: 2f 96 adiw r28, 0x0f ; 15 37300: af ad ldd r26, Y+63 ; 0x3f 37302: 2f 97 sbiw r28, 0x0f ; 15 37304: 63 96 adiw r28, 0x13 ; 19 37306: bf ad ldd r27, Y+63 ; 0x3f 37308: 63 97 sbiw r28, 0x13 ; 19 3730a: 80 93 b9 04 sts 0x04B9, r24 ; 0x8004b9 <_ZL22previous_nominal_speed.lto_priv.488> 3730e: 90 93 ba 04 sts 0x04BA, r25 ; 0x8004ba <_ZL22previous_nominal_speed.lto_priv.488+0x1> 37312: a0 93 bb 04 sts 0x04BB, r26 ; 0x8004bb <_ZL22previous_nominal_speed.lto_priv.488+0x2> 37316: b0 93 bc 04 sts 0x04BC, r27 ; 0x8004bc <_ZL22previous_nominal_speed.lto_priv.488+0x3> previous_safe_speed = safe_speed; 3731a: 89 a5 ldd r24, Y+41 ; 0x29 3731c: 9d a5 ldd r25, Y+45 ; 0x2d 3731e: a9 a9 ldd r26, Y+49 ; 0x31 37320: b9 ad ldd r27, Y+57 ; 0x39 37322: 80 93 10 18 sts 0x1810, r24 ; 0x801810 37326: 90 93 11 18 sts 0x1811, r25 ; 0x801811 3732a: a0 93 12 18 sts 0x1812, r26 ; 0x801812 3732e: b0 93 13 18 sts 0x1813, r27 ; 0x801813 // 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; 37332: d8 01 movw r26, r16 37334: d6 96 adiw r26, 0x36 ; 54 37336: 6d 91 ld r22, X+ 37338: 7d 91 ld r23, X+ 3733a: 8d 91 ld r24, X+ 3733c: 9c 91 ld r25, X 3733e: d9 97 sbiw r26, 0x39 ; 57 37340: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 37344: 27 96 adiw r28, 0x07 ; 7 37346: 2f ad ldd r18, Y+63 ; 0x3f 37348: 27 97 sbiw r28, 0x07 ; 7 3734a: 2b 96 adiw r28, 0x0b ; 11 3734c: 3f ad ldd r19, Y+63 ; 0x3f 3734e: 2b 97 sbiw r28, 0x0b ; 11 37350: 2f 96 adiw r28, 0x0f ; 15 37352: 4f ad ldd r20, Y+63 ; 0x3f 37354: 2f 97 sbiw r28, 0x0f ; 15 37356: 63 96 adiw r28, 0x13 ; 19 37358: 5f ad ldd r21, Y+63 ; 0x3f 3735a: 63 97 sbiw r28, 0x13 ; 19 3735c: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 37360: 2b 01 movw r4, r22 37362: 3c 01 movw r6, r24 37364: f8 01 movw r30, r16 37366: e8 5b subi r30, 0xB8 ; 184 37368: ff 4f sbci r31, 0xFF ; 255 3736a: 40 82 st Z, r4 3736c: 51 82 std Z+1, r5 ; 0x01 3736e: 62 82 std Z+2, r6 ; 0x02 37370: 73 82 std Z+3, r7 ; 0x03 #ifdef LIN_ADVANCE if (block->use_advance_lead) { 37372: 34 96 adiw r30, 0x04 ; 4 37374: 80 81 ld r24, Z 37376: 88 23 and r24, r24 37378: 09 f4 brne .+2 ; 0x3737c 3737a: 89 c0 rjmp .+274 ; 0x3748e // 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)) 3737c: 20 91 65 05 lds r18, 0x0565 ; 0x800565 37380: 30 91 66 05 lds r19, 0x0566 ; 0x800566 37384: 40 91 67 05 lds r20, 0x0567 ; 0x800567 37388: 50 91 68 05 lds r21, 0x0568 ; 0x800568 3738c: 6a 96 adiw r28, 0x1a ; 26 3738e: 6c ad ldd r22, Y+60 ; 0x3c 37390: 7d ad ldd r23, Y+61 ; 0x3d 37392: 8e ad ldd r24, Y+62 ; 0x3e 37394: 9f ad ldd r25, Y+63 ; 0x3f 37396: 6a 97 sbiw r28, 0x1a ; 26 37398: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 3739c: 4b 01 movw r8, r22 3739e: 5c 01 movw r10, r24 373a0: c0 90 ce 0d lds r12, 0x0DCE ; 0x800dce 373a4: d0 90 cf 0d lds r13, 0x0DCF ; 0x800dcf 373a8: e0 90 d0 0d lds r14, 0x0DD0 ; 0x800dd0 373ac: f0 90 d1 0d lds r15, 0x0DD1 ; 0x800dd1 block->adv_comp = adv_comp / block->speed_factor; // step/(step/min) 373b0: 0c 5a subi r16, 0xAC ; 172 373b2: 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)) 373b4: a7 01 movw r20, r14 373b6: 96 01 movw r18, r12 373b8: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> block->adv_comp = adv_comp / block->speed_factor; // step/(step/min) 373bc: a3 01 movw r20, r6 373be: 92 01 movw r18, r4 373c0: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 373c4: f8 01 movw r30, r16 373c6: 60 83 st Z, r22 373c8: 71 83 std Z+1, r23 ; 0x01 373ca: 82 83 std Z+2, r24 ; 0x02 373cc: 93 83 std Z+3, r25 ; 0x03 float advance_speed; if (e_D_ratio > 0) 373ce: 20 e0 ldi r18, 0x00 ; 0 373d0: 30 e0 ldi r19, 0x00 ; 0 373d2: a9 01 movw r20, r18 373d4: 6a 96 adiw r28, 0x1a ; 26 373d6: 6c ad ldd r22, Y+60 ; 0x3c 373d8: 7d ad ldd r23, Y+61 ; 0x3d 373da: 8e ad ldd r24, Y+62 ; 0x3e 373dc: 9f ad ldd r25, Y+63 ; 0x3f 373de: 6a 97 sbiw r28, 0x1a ; 26 373e0: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 373e4: 18 16 cp r1, r24 373e6: 0c f0 brlt .+2 ; 0x373ea 373e8: 40 c4 rjmp .+2176 ; 0x37c6a advance_speed = (extruder_advance_K * e_D_ratio * block->acceleration * cs.axis_steps_per_mm[E_AXIS]); 373ea: a5 01 movw r20, r10 373ec: 94 01 movw r18, r8 373ee: e2 96 adiw r28, 0x32 ; 50 373f0: 6c ad ldd r22, Y+60 ; 0x3c 373f2: 7d ad ldd r23, Y+61 ; 0x3d 373f4: 8e ad ldd r24, Y+62 ; 0x3e 373f6: 9f ad ldd r25, Y+63 ; 0x3f 373f8: e2 97 sbiw r28, 0x32 ; 50 373fa: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 373fe: a7 01 movw r20, r14 37400: 96 01 movw r18, r12 else advance_speed = cs.max_jerk[E_AXIS] * cs.axis_steps_per_mm[E_AXIS]; 37402: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 37406: 6b 01 movw r12, r22 37408: 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; 3740a: 20 e0 ldi r18, 0x00 ; 0 3740c: 30 e4 ldi r19, 0x40 ; 64 3740e: 4c e1 ldi r20, 0x1C ; 28 37410: 57 e4 ldi r21, 0x47 ; 71 37412: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 37416: 18 16 cp r1, r24 37418: 3c f4 brge .+14 ; 0x37428 3741a: c1 2c mov r12, r1 3741c: 20 e4 ldi r18, 0x40 ; 64 3741e: d2 2e mov r13, r18 37420: 2c e1 ldi r18, 0x1C ; 28 37422: e2 2e mov r14, r18 37424: 27 e4 ldi r18, 0x47 ; 71 37426: f2 2e mov r15, r18 float advance_rate = (F_CPU / 8.0) / advance_speed; 37428: a7 01 movw r20, r14 3742a: 96 01 movw r18, r12 3742c: 60 e0 ldi r22, 0x00 ; 0 3742e: 74 e2 ldi r23, 0x24 ; 36 37430: 84 ef ldi r24, 0xF4 ; 244 37432: 99 e4 ldi r25, 0x49 ; 73 37434: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 37438: 4b 01 movw r8, r22 3743a: 5c 01 movw r10, r24 if (advance_speed > 20000) { 3743c: 20 e0 ldi r18, 0x00 ; 0 3743e: 30 e4 ldi r19, 0x40 ; 64 37440: 4c e9 ldi r20, 0x9C ; 156 37442: 56 e4 ldi r21, 0x46 ; 70 37444: c7 01 movw r24, r14 37446: b6 01 movw r22, r12 37448: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 3744c: 18 16 cp r1, r24 3744e: 0c f0 brlt .+2 ; 0x37452 37450: 17 c4 rjmp .+2094 ; 0x37c80 block->advance_rate = advance_rate * 4; 37452: 8e e6 ldi r24, 0x6E ; 110 37454: 82 9d mul r24, r2 37456: 80 01 movw r16, r0 37458: 83 9d mul r24, r3 3745a: 10 0d add r17, r0 3745c: 11 24 eor r1, r1 3745e: 0b 53 subi r16, 0x3B ; 59 37460: 19 4f sbci r17, 0xF9 ; 249 37462: 78 01 movw r14, r16 37464: fd e4 ldi r31, 0x4D ; 77 37466: ef 0e add r14, r31 37468: f1 1c adc r15, r1 3746a: 20 e0 ldi r18, 0x00 ; 0 3746c: 30 e0 ldi r19, 0x00 ; 0 3746e: 40 e8 ldi r20, 0x80 ; 128 37470: 50 e4 ldi r21, 0x40 ; 64 37472: c5 01 movw r24, r10 37474: b4 01 movw r22, r8 37476: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 3747a: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 3747e: d7 01 movw r26, r14 37480: 6d 93 st X+, r22 37482: 7c 93 st X, r23 block->advance_step_loops = 4; 37484: f8 01 movw r30, r16 37486: ed 5a subi r30, 0xAD ; 173 37488: ff 4f sbci r31, 0xFF ; 255 3748a: 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; 3748c: 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); 3748e: 09 a5 ldd r16, Y+41 ; 0x29 37490: 1d a5 ldd r17, Y+45 ; 0x2d 37492: 29 a9 ldd r18, Y+49 ; 0x31 37494: 39 ad ldd r19, Y+57 ; 0x39 37496: 4d ad ldd r20, Y+61 ; 0x3d 37498: 5d a9 ldd r21, Y+53 ; 0x35 3749a: 6e ad ldd r22, Y+62 ; 0x3e 3749c: 23 96 adiw r28, 0x03 ; 3 3749e: 7f ad ldd r23, Y+63 ; 0x3f 374a0: 23 97 sbiw r28, 0x03 ; 3 374a2: a4 96 adiw r28, 0x24 ; 36 374a4: 8e ad ldd r24, Y+62 ; 0x3e 374a6: 9f ad ldd r25, Y+63 ; 0x3f 374a8: a4 97 sbiw r28, 0x24 ; 36 374aa: 8b 53 subi r24, 0x3B ; 59 374ac: 99 4f sbci r25, 0xF9 ; 249 374ae: 0f 94 55 ae call 0x35caa ; 0x35caa if (block->step_event_count.wide <= 32767) 374b2: 8e e6 ldi r24, 0x6E ; 110 374b4: 82 9d mul r24, r2 374b6: f0 01 movw r30, r0 374b8: 83 9d mul r24, r3 374ba: f0 0d add r31, r0 374bc: 11 24 eor r1, r1 374be: eb 53 subi r30, 0x3B ; 59 374c0: f9 4f sbci r31, 0xF9 ; 249 374c2: 80 89 ldd r24, Z+16 ; 0x10 374c4: 91 89 ldd r25, Z+17 ; 0x11 374c6: a2 89 ldd r26, Z+18 ; 0x12 374c8: b3 89 ldd r27, Z+19 ; 0x13 374ca: 81 15 cp r24, r1 374cc: 90 48 sbci r25, 0x80 ; 128 374ce: a1 05 cpc r26, r1 374d0: b1 05 cpc r27, r1 374d2: 18 f4 brcc .+6 ; 0x374da block->flag |= BLOCK_FLAG_DDA_LOWRES; 374d4: 85 a9 ldd r24, Z+53 ; 0x35 374d6: 88 60 ori r24, 0x08 ; 8 374d8: 85 ab std Z+53, r24 ; 0x35 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 374da: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 374dc: 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; 374de: 90 91 ac 0d lds r25, 0x0DAC ; 0x800dac 374e2: 91 11 cpse r25, r1 374e4: 93 c4 rjmp .+2342 ; 0x37e0c block_buffer_head = next_buffer_head; 374e6: a1 96 adiw r28, 0x21 ; 33 374e8: 3f ad ldd r19, Y+63 ; 0x3f 374ea: a1 97 sbiw r28, 0x21 ; 33 374ec: 30 93 a5 0d sts 0x0DA5, r19 ; 0x800da5 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 374f0: 8f bf out 0x3f, r24 ; 63 } // Update position memcpy(position, target, sizeof(target)); // position[] = target[] 374f2: c2 58 subi r28, 0x82 ; 130 374f4: df 4f sbci r29, 0xFF ; 255 374f6: 88 81 ld r24, Y 374f8: 99 81 ldd r25, Y+1 ; 0x01 374fa: aa 81 ldd r26, Y+2 ; 0x02 374fc: bb 81 ldd r27, Y+3 ; 0x03 374fe: ce 57 subi r28, 0x7E ; 126 37500: d0 40 sbci r29, 0x00 ; 0 37502: 80 93 a3 06 sts 0x06A3, r24 ; 0x8006a3 37506: 90 93 a4 06 sts 0x06A4, r25 ; 0x8006a4 3750a: a0 93 a5 06 sts 0x06A5, r26 ; 0x8006a5 3750e: b0 93 a6 06 sts 0x06A6, r27 ; 0x8006a6 37512: ce 57 subi r28, 0x7E ; 126 37514: df 4f sbci r29, 0xFF ; 255 37516: 28 81 ld r18, Y 37518: 39 81 ldd r19, Y+1 ; 0x01 3751a: 4a 81 ldd r20, Y+2 ; 0x02 3751c: 5b 81 ldd r21, Y+3 ; 0x03 3751e: c2 58 subi r28, 0x82 ; 130 37520: d0 40 sbci r29, 0x00 ; 0 37522: 20 93 a7 06 sts 0x06A7, r18 ; 0x8006a7 37526: 30 93 a8 06 sts 0x06A8, r19 ; 0x8006a8 3752a: 40 93 a9 06 sts 0x06A9, r20 ; 0x8006a9 3752e: 50 93 aa 06 sts 0x06AA, r21 ; 0x8006aa 37532: e6 96 adiw r28, 0x36 ; 54 37534: 8c ad ldd r24, Y+60 ; 0x3c 37536: 9d ad ldd r25, Y+61 ; 0x3d 37538: ae ad ldd r26, Y+62 ; 0x3e 3753a: bf ad ldd r27, Y+63 ; 0x3f 3753c: e6 97 sbiw r28, 0x36 ; 54 3753e: 80 93 ab 06 sts 0x06AB, r24 ; 0x8006ab 37542: 90 93 ac 06 sts 0x06AC, r25 ; 0x8006ac 37546: a0 93 ad 06 sts 0x06AD, r26 ; 0x8006ad 3754a: b0 93 ae 06 sts 0x06AE, r27 ; 0x8006ae 3754e: ae 96 adiw r28, 0x2e ; 46 37550: 2c ad ldd r18, Y+60 ; 0x3c 37552: 3d ad ldd r19, Y+61 ; 0x3d 37554: 4e ad ldd r20, Y+62 ; 0x3e 37556: 5f ad ldd r21, Y+63 ; 0x3f 37558: ae 97 sbiw r28, 0x2e ; 46 3755a: 20 93 af 06 sts 0x06AF, r18 ; 0x8006af 3755e: 30 93 b0 06 sts 0x06B0, r19 ; 0x8006b0 37562: 40 93 b1 06 sts 0x06B1, r20 ; 0x8006b1 37566: 50 93 b2 06 sts 0x06B2, r21 ; 0x8006b2 #ifdef LIN_ADVANCE position_float[X_AXIS] = x; 3756a: 89 a1 ldd r24, Y+33 ; 0x21 3756c: 9a a1 ldd r25, Y+34 ; 0x22 3756e: ab a1 ldd r26, Y+35 ; 0x23 37570: bc a1 ldd r27, Y+36 ; 0x24 37572: 80 93 cd 04 sts 0x04CD, r24 ; 0x8004cd 37576: 90 93 ce 04 sts 0x04CE, r25 ; 0x8004ce 3757a: a0 93 cf 04 sts 0x04CF, r26 ; 0x8004cf 3757e: b0 93 d0 04 sts 0x04D0, r27 ; 0x8004d0 position_float[Y_AXIS] = y; 37582: 8d a1 ldd r24, Y+37 ; 0x25 37584: 9e a1 ldd r25, Y+38 ; 0x26 37586: af a1 ldd r26, Y+39 ; 0x27 37588: b8 a5 ldd r27, Y+40 ; 0x28 3758a: 80 93 d1 04 sts 0x04D1, r24 ; 0x8004d1 3758e: 90 93 d2 04 sts 0x04D2, r25 ; 0x8004d2 37592: a0 93 d3 04 sts 0x04D3, r26 ; 0x8004d3 37596: b0 93 d4 04 sts 0x04D4, r27 ; 0x8004d4 position_float[Z_AXIS] = z; 3759a: a8 96 adiw r28, 0x28 ; 40 3759c: 8c ad ldd r24, Y+60 ; 0x3c 3759e: 9d ad ldd r25, Y+61 ; 0x3d 375a0: ae ad ldd r26, Y+62 ; 0x3e 375a2: bf ad ldd r27, Y+63 ; 0x3f 375a4: a8 97 sbiw r28, 0x28 ; 40 375a6: 80 93 d5 04 sts 0x04D5, r24 ; 0x8004d5 375aa: 90 93 d6 04 sts 0x04D6, r25 ; 0x8004d6 375ae: a0 93 d7 04 sts 0x04D7, r26 ; 0x8004d7 375b2: b0 93 d8 04 sts 0x04D8, r27 ; 0x8004d8 position_float[E_AXIS] = e; 375b6: aa 96 adiw r28, 0x2a ; 42 375b8: ee ad ldd r30, Y+62 ; 0x3e 375ba: ff ad ldd r31, Y+63 ; 0x3f 375bc: aa 97 sbiw r28, 0x2a ; 42 375be: 80 81 ld r24, Z 375c0: 91 81 ldd r25, Z+1 ; 0x01 375c2: a2 81 ldd r26, Z+2 ; 0x02 375c4: b3 81 ldd r27, Z+3 ; 0x03 375c6: 80 93 d9 04 sts 0x04D9, r24 ; 0x8004d9 375ca: 90 93 da 04 sts 0x04DA, r25 ; 0x8004da 375ce: a0 93 db 04 sts 0x04DB, r26 ; 0x8004db 375d2: b0 93 dc 04 sts 0x04DC, r27 ; 0x8004dc 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; 375d6: f0 90 a6 0d lds r15, 0x0DA6 ; 0x800da6 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); 375da: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 375de: 8f 19 sub r24, r15 375e0: 8f 70 andi r24, 0x0F ; 15 if (n_blocks >= 3) { 375e2: 83 30 cpi r24, 0x03 ; 3 375e4: 40 f1 brcs .+80 ; 0x37636 // Initialize the last tripple of blocks. block_index = prev_block_index(block_buffer_head); 375e6: 10 91 a5 0d lds r17, 0x0DA5 ; 0x800da5 } // 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) 375ea: 11 11 cpse r17, r1 375ec: 01 c0 rjmp .+2 ; 0x375f0 block_index = BLOCK_BUFFER_SIZE; 375ee: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 375f0: 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; 375f2: fe e6 ldi r31, 0x6E ; 110 375f4: 1f 9f mul r17, r31 375f6: c0 01 movw r24, r0 375f8: 11 24 eor r1, r1 375fa: 9c 01 movw r18, r24 375fc: 2b 53 subi r18, 0x3B ; 59 375fe: 39 4f sbci r19, 0xF9 ; 249 37600: 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) 37602: 11 11 cpse r17, r1 37604: 01 c0 rjmp .+2 ; 0x37608 block_index = BLOCK_BUFFER_SIZE; 37606: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 37608: 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)); 3760a: 3e e6 ldi r19, 0x6E ; 110 3760c: 13 9f mul r17, r19 3760e: c0 01 movw r24, r0 37610: 11 24 eor r1, r1 37612: ac 01 movw r20, r24 37614: 4b 53 subi r20, 0x3B ; 59 37616: 59 4f sbci r21, 0xF9 ; 249 37618: 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)); 3761a: 9e e6 ldi r25, 0x6E ; 110 3761c: 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) { 3761e: f1 16 cp r15, r17 37620: 69 f0 breq .+26 ; 0x3763c if (current->flag & BLOCK_FLAG_START_FROM_FULL_HALT) { 37622: d6 01 movw r26, r12 37624: d5 96 adiw r26, 0x35 ; 53 37626: 0c 91 ld r16, X 37628: 02 ff sbrs r16, 2 3762a: 7e c3 rjmp .+1788 ; 0x37d28 // 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); 3762c: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 37630: 81 1b sub r24, r17 37632: 8f 70 andi r24, 0x0F ; 15 37634: f1 2e mov r15, r17 } // SERIAL_ECHOLNPGM("planner_recalculate - 2"); // Forward pass and recalculate the trapezoids. if (n_blocks >= 2) { 37636: 82 30 cpi r24, 0x02 ; 2 37638: 08 f4 brcc .+2 ; 0x3763c 3763a: a3 c0 rjmp .+326 ; 0x37782 // 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; 3763c: 3e e6 ldi r19, 0x6E ; 110 3763e: f3 9e mul r15, r19 37640: c0 01 movw r24, r0 37642: 11 24 eor r1, r1 37644: ac 01 movw r20, r24 37646: 4b 53 subi r20, 0x3B ; 59 37648: 59 4f sbci r21, 0xF9 ; 249 3764a: 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) 3764c: f3 94 inc r15 3764e: 50 e1 ldi r21, 0x10 ; 16 37650: f5 12 cpse r15, r21 37652: 01 c0 rjmp .+2 ; 0x37656 block_index = 0; 37654: 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)); 37656: ae e6 ldi r26, 0x6E ; 110 37658: fa 9e mul r15, r26 3765a: c0 01 movw r24, r0 3765c: 11 24 eor r1, r1 3765e: fc 01 movw r30, r24 37660: eb 53 subi r30, 0x3B ; 59 37662: f9 4f sbci r31, 0xF9 ; 249 37664: 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)); 37666: 8e e6 ldi r24, 0x6E ; 110 37668: 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) { 3766a: d5 01 movw r26, r10 3766c: d5 96 adiw r26, 0x35 ; 53 3766e: 8c 91 ld r24, X 37670: d5 97 sbiw r26, 0x35 ; 53 37672: 81 fd sbrc r24, 1 37674: 5a c0 rjmp .+180 ; 0x3772a 37676: 95 96 adiw r26, 0x25 ; 37 37678: 4d 90 ld r4, X+ 3767a: 5d 90 ld r5, X+ 3767c: 6d 90 ld r6, X+ 3767e: 7c 90 ld r7, X 37680: 98 97 sbiw r26, 0x28 ; 40 37682: f6 01 movw r30, r12 37684: 95 a0 ldd r9, Z+37 ; 0x25 37686: e6 a0 ldd r14, Z+38 ; 0x26 37688: 07 a1 ldd r16, Z+39 ; 0x27 3768a: 10 a5 ldd r17, Z+40 ; 0x28 3768c: 29 2d mov r18, r9 3768e: 3e 2d mov r19, r14 37690: a8 01 movw r20, r16 37692: c3 01 movw r24, r6 37694: b2 01 movw r22, r4 37696: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 3769a: 87 ff sbrs r24, 7 3769c: 46 c0 rjmp .+140 ; 0x3772a // 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); 3769e: a3 01 movw r20, r6 376a0: 92 01 movw r18, r4 376a2: c3 01 movw r24, r6 376a4: b2 01 movw r22, r4 376a6: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 376aa: 2b 01 movw r4, r22 376ac: 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)); 376ae: d5 01 movw r26, r10 376b0: d1 96 adiw r26, 0x31 ; 49 376b2: 6d 91 ld r22, X+ 376b4: 7d 91 ld r23, X+ 376b6: 8d 91 ld r24, X+ 376b8: 9c 91 ld r25, X 376ba: d4 97 sbiw r26, 0x34 ; 52 376bc: 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); 376be: 9b 01 movw r18, r22 376c0: ac 01 movw r20, r24 376c2: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 376c6: f5 01 movw r30, r10 376c8: 25 a5 ldd r18, Z+45 ; 0x2d 376ca: 36 a5 ldd r19, Z+46 ; 0x2e 376cc: 47 a5 ldd r20, Z+47 ; 0x2f 376ce: 50 a9 ldd r21, Z+48 ; 0x30 376d0: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 376d4: 9b 01 movw r18, r22 376d6: ac 01 movw r20, r24 376d8: c3 01 movw r24, r6 376da: b2 01 movw r22, r4 376dc: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 376e0: 0f 94 12 e1 call 0x3c224 ; 0x3c224 376e4: 2b 01 movw r4, r22 376e6: 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)); 376e8: 9b 01 movw r18, r22 376ea: ac 01 movw r20, r24 376ec: 69 2d mov r22, r9 376ee: 7e 2d mov r23, r14 376f0: c8 01 movw r24, r16 376f2: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 376f6: 87 ff sbrs r24, 7 376f8: 03 c0 rjmp .+6 ; 0x37700 376fa: 49 2c mov r4, r9 376fc: 5e 2c mov r5, r14 376fe: 38 01 movw r6, r16 // Check for junction speed change if (current->entry_speed != entry_speed) { 37700: 92 01 movw r18, r4 37702: a3 01 movw r20, r6 37704: 69 2d mov r22, r9 37706: 7e 2d mov r23, r14 37708: c8 01 movw r24, r16 3770a: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 3770e: 88 23 and r24, r24 37710: 61 f0 breq .+24 ; 0x3772a 37712: d6 01 movw r26, r12 37714: d5 96 adiw r26, 0x35 ; 53 37716: 2c 91 ld r18, X current->entry_speed = entry_speed; 37718: c2 01 movw r24, r4 3771a: d3 01 movw r26, r6 3771c: f6 01 movw r30, r12 3771e: 85 a3 std Z+37, r24 ; 0x25 37720: 96 a3 std Z+38, r25 ; 0x26 37722: a7 a3 std Z+39, r26 ; 0x27 37724: b0 a7 std Z+40, r27 ; 0x28 current->flag |= BLOCK_FLAG_RECALCULATE; 37726: 21 60 ori r18, 0x01 ; 1 37728: 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) { 3772a: d5 01 movw r26, r10 3772c: d5 96 adiw r26, 0x35 ; 53 3772e: 8c 91 ld r24, X 37730: d5 97 sbiw r26, 0x35 ; 53 37732: f6 01 movw r30, r12 37734: 95 a9 ldd r25, Z+53 ; 0x35 37736: 89 2b or r24, r25 37738: 80 ff sbrs r24, 0 3773a: 14 c0 rjmp .+40 ; 0x37764 // NOTE: Entry and exit factors always > 0 by all previous logic operations. calculate_trapezoid_for_block(prev, prev->entry_speed, current->entry_speed); 3773c: 05 a1 ldd r16, Z+37 ; 0x25 3773e: 16 a1 ldd r17, Z+38 ; 0x26 37740: 27 a1 ldd r18, Z+39 ; 0x27 37742: 30 a5 ldd r19, Z+40 ; 0x28 37744: 95 96 adiw r26, 0x25 ; 37 37746: 4d 91 ld r20, X+ 37748: 5d 91 ld r21, X+ 3774a: 6d 91 ld r22, X+ 3774c: 7c 91 ld r23, X 3774e: 98 97 sbiw r26, 0x28 ; 40 37750: c5 01 movw r24, r10 37752: 0f 94 55 ae call 0x35caa ; 0x35caa // Reset current only to ensure next trapezoid is computed. prev->flag &= ~BLOCK_FLAG_RECALCULATE; 37756: d5 01 movw r26, r10 37758: d5 96 adiw r26, 0x35 ; 53 3775a: 8c 91 ld r24, X 3775c: d5 97 sbiw r26, 0x35 ; 53 3775e: 8e 7f andi r24, 0xFE ; 254 37760: d5 96 adiw r26, 0x35 ; 53 37762: 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) 37764: f3 94 inc r15 37766: b0 e1 ldi r27, 0x10 ; 16 37768: fb 12 cpse r15, r27 3776a: 01 c0 rjmp .+2 ; 0x3776e block_index = 0; 3776c: 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)); 3776e: f8 9c mul r15, r8 37770: c0 01 movw r24, r0 37772: 11 24 eor r1, r1 37774: 8b 53 subi r24, 0x3B ; 59 37776: 99 4f sbci r25, 0xF9 ; 249 } while (block_index != block_buffer_head); 37778: 20 91 a5 0d lds r18, 0x0DA5 ; 0x800da5 // 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; 3777c: 56 01 movw r10, r12 current = block_buffer + (block_index = next_block_index(block_index)); } while (block_index != block_buffer_head); 3777e: f2 12 cpse r15, r18 37780: 43 c3 rjmp .+1670 ; 0x37e08 } // 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); 37782: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 } // 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) 37786: 81 11 cpse r24, r1 37788: 01 c0 rjmp .+2 ; 0x3778c block_index = BLOCK_BUFFER_SIZE; 3778a: 80 e1 ldi r24, 0x10 ; 16 -- block_index; 3778c: 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); 3778e: ee e6 ldi r30, 0x6E ; 110 37790: 8e 9f mul r24, r30 37792: c0 01 movw r24, r0 37794: 11 24 eor r1, r1 37796: 9c 01 movw r18, r24 37798: 2b 53 subi r18, 0x3B ; 59 3779a: 39 4f sbci r19, 0xF9 ; 249 3779c: 79 01 movw r14, r18 calculate_trapezoid_for_block(current, current->entry_speed, safe_final_speed); 3779e: d9 01 movw r26, r18 377a0: 95 96 adiw r26, 0x25 ; 37 377a2: 4d 91 ld r20, X+ 377a4: 5d 91 ld r21, X+ 377a6: 6d 91 ld r22, X+ 377a8: 7c 91 ld r23, X 377aa: 98 97 sbiw r26, 0x28 ; 40 377ac: 09 a5 ldd r16, Y+41 ; 0x29 377ae: 1d a5 ldd r17, Y+45 ; 0x2d 377b0: 29 a9 ldd r18, Y+49 ; 0x31 377b2: 39 ad ldd r19, Y+57 ; 0x39 377b4: c7 01 movw r24, r14 377b6: 0f 94 55 ae call 0x35caa ; 0x35caa current->flag &= ~BLOCK_FLAG_RECALCULATE; 377ba: f7 01 movw r30, r14 377bc: 85 a9 ldd r24, Z+53 ; 0x35 377be: 8e 7f andi r24, 0xFE ; 254 377c0: 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(); 377c2: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 377c6: 82 60 ori r24, 0x02 ; 2 377c8: 80 93 6f 00 sts 0x006F, r24 ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 377cc: 0d 94 5b b1 jmp 0x362b6 ; 0x362b6 // 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)); 377d0: a3 5e subi r26, 0xE3 ; 227 377d2: b8 4f sbci r27, 0xF8 ; 248 377d4: 80 e1 ldi r24, 0x10 ; 16 377d6: e2 e9 ldi r30, 0x92 ; 146 377d8: f6 e0 ldi r31, 0x06 ; 6 377da: 0d 94 96 b1 jmp 0x3632c ; 0x3632c 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]); 377de: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 377e2: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 377e6: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 377ea: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 377ee: a8 96 adiw r28, 0x28 ; 40 377f0: 6c ad ldd r22, Y+60 ; 0x3c 377f2: 7d ad ldd r23, Y+61 ; 0x3d 377f4: 8e ad ldd r24, Y+62 ; 0x3e 377f6: 9f ad ldd r25, Y+63 ; 0x3f 377f8: a8 97 sbiw r28, 0x28 ; 40 377fa: 0d 94 2c b2 jmp 0x36458 ; 0x36458 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); 377fe: 81 e0 ldi r24, 0x01 ; 1 37800: 80 8f std Z+24, r24 ; 0x18 37802: 0d 94 d2 b3 jmp 0x367a4 ; 0x367a4 { if(feed_rate 3780a: b0 90 fb 0d lds r11, 0x0DFB ; 0x800dfb 3780e: 00 91 fc 0d lds r16, 0x0DFC ; 0x800dfc 37812: 10 91 fd 0d lds r17, 0x0DFD ; 0x800dfd 37816: 4c c8 rjmp .-3944 ; 0x368b0 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])); 37818: c5 01 movw r24, r10 3781a: b4 01 movw r22, r8 3781c: 0f 94 e5 d6 call 0x3adca ; 0x3adca 37820: 4b 01 movw r8, r22 37822: 5c 01 movw r10, r24 37824: c7 01 movw r24, r14 37826: b6 01 movw r22, r12 37828: 0f 94 e5 d6 call 0x3adca ; 0x3adca 3782c: 9b 01 movw r18, r22 3782e: ac 01 movw r20, r24 37830: c5 01 movw r24, r10 37832: b4 01 movw r22, r8 37834: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 37838: 6b 01 movw r12, r22 3783a: 7c 01 movw r14, r24 3783c: 22 96 adiw r28, 0x02 ; 2 3783e: 6c ad ldd r22, Y+60 ; 0x3c 37840: 7d ad ldd r23, Y+61 ; 0x3d 37842: 8e ad ldd r24, Y+62 ; 0x3e 37844: 9f ad ldd r25, Y+63 ; 0x3f 37846: 22 97 sbiw r28, 0x02 ; 2 37848: 0f 94 e5 d6 call 0x3adca ; 0x3adca 3784c: 9b 01 movw r18, r22 3784e: ac 01 movw r20, r24 37850: c7 01 movw r24, r14 37852: b6 01 movw r22, r12 37854: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 37858: 0f 94 12 e1 call 0x3c224 ; 0x3c224 3785c: 2e e6 ldi r18, 0x6E ; 110 3785e: 22 9d mul r18, r2 37860: f0 01 movw r30, r0 37862: 23 9d mul r18, r3 37864: f0 0d add r31, r0 37866: 11 24 eor r1, r1 37868: eb 53 subi r30, 0x3B ; 59 3786a: f9 4f sbci r31, 0xF9 ; 249 3786c: 65 a7 std Z+45, r22 ; 0x2d 3786e: 76 a7 std Z+46, r23 ; 0x2e 37870: 87 a7 std Z+47, r24 ; 0x2f 37872: 90 ab std Z+48, r25 ; 0x30 37874: bb c8 rjmp .-3722 ; 0x369ec 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 37876: 2a 96 adiw r28, 0x0a ; 10 37878: 2c ad ldd r18, Y+60 ; 0x3c 3787a: 3d ad ldd r19, Y+61 ; 0x3d 3787c: 4e ad ldd r20, Y+62 ; 0x3e 3787e: 5f ad ldd r21, Y+63 ; 0x3f 37880: 2a 97 sbiw r28, 0x0a ; 10 37882: 23 2b or r18, r19 37884: 24 2b or r18, r20 37886: 25 2b or r18, r21 37888: 09 f4 brne .+2 ; 0x3788c 3788a: 0e c1 rjmp .+540 ; 0x37aa8 3788c: 60 91 f2 0d lds r22, 0x0DF2 ; 0x800df2 37890: 70 91 f3 0d lds r23, 0x0DF3 ; 0x800df3 37894: 80 91 f4 0d lds r24, 0x0DF4 ; 0x800df4 37898: 90 91 f5 0d lds r25, 0x0DF5 ; 0x800df5 3789c: 29 a5 ldd r18, Y+41 ; 0x29 3789e: 3a a5 ldd r19, Y+42 ; 0x2a 378a0: 4b a5 ldd r20, Y+43 ; 0x2b 378a2: 5c a5 ldd r21, Y+44 ; 0x2c 378a4: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 378a8: 0f 94 22 de call 0x3bc44 ; 0x3bc44 378ac: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 378b0: 2b 01 movw r4, r22 378b2: 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 378b4: 80 91 65 05 lds r24, 0x0565 ; 0x800565 378b8: 90 91 66 05 lds r25, 0x0566 ; 0x800566 378bc: a0 91 67 05 lds r26, 0x0567 ; 0x800567 378c0: b0 91 68 05 lds r27, 0x0568 ; 0x800568 378c4: 8d a7 std Y+45, r24 ; 0x2d 378c6: 9e a7 std Y+46, r25 ; 0x2e 378c8: af a7 std Y+47, r26 ; 0x2f 378ca: b8 ab std Y+48, r27 ; 0x30 && delta_mm[E_AXIS] >= 0 && fabs(delta_mm[Z_AXIS]) < 0.5; 378cc: 20 e0 ldi r18, 0x00 ; 0 378ce: 30 e0 ldi r19, 0x00 ; 0 378d0: a9 01 movw r20, r18 378d2: bc 01 movw r22, r24 378d4: cd 01 movw r24, r26 378d6: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 378da: 18 16 cp r1, r24 378dc: 0c f0 brlt .+2 ; 0x378e0 378de: ed c0 rjmp .+474 ; 0x37aba * 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 378e0: 20 e0 ldi r18, 0x00 ; 0 378e2: 30 e0 ldi r19, 0x00 ; 0 378e4: a9 01 movw r20, r18 378e6: 26 96 adiw r28, 0x06 ; 6 378e8: 6c ad ldd r22, Y+60 ; 0x3c 378ea: 7d ad ldd r23, Y+61 ; 0x3d 378ec: 8e ad ldd r24, Y+62 ; 0x3e 378ee: 9f ad ldd r25, Y+63 ; 0x3f 378f0: 26 97 sbiw r28, 0x06 ; 6 378f2: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 378f6: 87 fd sbrc r24, 7 378f8: e0 c0 rjmp .+448 ; 0x37aba && fabs(delta_mm[Z_AXIS]) < 0.5; 378fa: 22 96 adiw r28, 0x02 ; 2 378fc: 6c ad ldd r22, Y+60 ; 0x3c 378fe: 7d ad ldd r23, Y+61 ; 0x3d 37900: 8e ad ldd r24, Y+62 ; 0x3e 37902: 9f ad ldd r25, Y+63 ; 0x3f 37904: 22 97 sbiw r28, 0x02 ; 2 37906: 9f 77 andi r25, 0x7F ; 127 37908: 20 e0 ldi r18, 0x00 ; 0 3790a: 30 e0 ldi r19, 0x00 ; 0 3790c: 40 e0 ldi r20, 0x00 ; 0 3790e: 5f e3 ldi r21, 0x3F ; 63 37910: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 37914: 87 ff sbrs r24, 7 37916: d1 c0 rjmp .+418 ; 0x37aba * * 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 37918: 8e e6 ldi r24, 0x6E ; 110 3791a: 82 9d mul r24, r2 3791c: 80 01 movw r16, r0 3791e: 83 9d mul r24, r3 37920: 10 0d add r17, r0 37922: 11 24 eor r1, r1 37924: 0f 5e subi r16, 0xEF ; 239 37926: 18 4f sbci r17, 0xF8 ; 248 37928: 81 e0 ldi r24, 0x01 ; 1 3792a: d8 01 movw r26, r16 3792c: 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]) 3792e: 20 91 cd 04 lds r18, 0x04CD ; 0x8004cd 37932: 30 91 ce 04 lds r19, 0x04CE ; 0x8004ce 37936: 40 91 cf 04 lds r20, 0x04CF ; 0x8004cf 3793a: 50 91 d0 04 lds r21, 0x04D0 ; 0x8004d0 3793e: 69 a1 ldd r22, Y+33 ; 0x21 37940: 7a a1 ldd r23, Y+34 ; 0x22 37942: 8b a1 ldd r24, Y+35 ; 0x23 37944: 9c a1 ldd r25, Y+36 ; 0x24 37946: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 3794a: 69 ab std Y+49, r22 ; 0x31 3794c: 7a ab std Y+50, r23 ; 0x32 3794e: 8b ab std Y+51, r24 ; 0x33 37950: 9c ab std Y+52, r25 ; 0x34 + sq(y - position_float[Y_AXIS]) 37952: 20 91 d1 04 lds r18, 0x04D1 ; 0x8004d1 37956: 30 91 d2 04 lds r19, 0x04D2 ; 0x8004d2 3795a: 40 91 d3 04 lds r20, 0x04D3 ; 0x8004d3 3795e: 50 91 d4 04 lds r21, 0x04D4 ; 0x8004d4 37962: 6d a1 ldd r22, Y+37 ; 0x25 37964: 7e a1 ldd r23, Y+38 ; 0x26 37966: 8f a1 ldd r24, Y+39 ; 0x27 37968: 98 a5 ldd r25, Y+40 ; 0x28 3796a: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 3796e: 4b 01 movw r8, r22 37970: 5c 01 movw r10, r24 + sq(z - position_float[Z_AXIS])); 37972: 20 91 d5 04 lds r18, 0x04D5 ; 0x8004d5 37976: 30 91 d6 04 lds r19, 0x04D6 ; 0x8004d6 3797a: 40 91 d7 04 lds r20, 0x04D7 ; 0x8004d7 3797e: 50 91 d8 04 lds r21, 0x04D8 ; 0x8004d8 37982: a8 96 adiw r28, 0x28 ; 40 37984: 6c ad ldd r22, Y+60 ; 0x3c 37986: 7d ad ldd r23, Y+61 ; 0x3d 37988: 8e ad ldd r24, Y+62 ; 0x3e 3798a: 9f ad ldd r25, Y+63 ; 0x3f 3798c: a8 97 sbiw r28, 0x28 ; 40 3798e: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 37992: 6b 01 movw r12, r22 37994: 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]) 37996: 29 a9 ldd r18, Y+49 ; 0x31 37998: 3a a9 ldd r19, Y+50 ; 0x32 3799a: 4b a9 ldd r20, Y+51 ; 0x33 3799c: 5c a9 ldd r21, Y+52 ; 0x34 3799e: ca 01 movw r24, r20 379a0: b9 01 movw r22, r18 379a2: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 379a6: 69 ab std Y+49, r22 ; 0x31 379a8: 7a ab std Y+50, r23 ; 0x32 379aa: 8b ab std Y+51, r24 ; 0x33 379ac: 9c ab std Y+52, r25 ; 0x34 + sq(y - position_float[Y_AXIS]) 379ae: a5 01 movw r20, r10 379b0: 94 01 movw r18, r8 379b2: c5 01 movw r24, r10 379b4: b4 01 movw r22, r8 379b6: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 379ba: 9b 01 movw r18, r22 379bc: ac 01 movw r20, r24 379be: 69 a9 ldd r22, Y+49 ; 0x31 379c0: 7a a9 ldd r23, Y+50 ; 0x32 379c2: 8b a9 ldd r24, Y+51 ; 0x33 379c4: 9c a9 ldd r25, Y+52 ; 0x34 379c6: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 379ca: 4b 01 movw r8, r22 379cc: 5c 01 movw r10, r24 + sq(z - position_float[Z_AXIS])); 379ce: a7 01 movw r20, r14 379d0: 96 01 movw r18, r12 379d2: c7 01 movw r24, r14 379d4: b6 01 movw r22, r12 379d6: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 379da: 9b 01 movw r18, r22 379dc: ac 01 movw r20, r24 379de: c5 01 movw r24, r10 379e0: b4 01 movw r22, r8 379e2: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__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]) 379e6: 0f 94 12 e1 call 0x3c224 ; 0x3c224 379ea: 6b 01 movw r12, r22 379ec: 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]); 379ee: 20 91 d9 04 lds r18, 0x04D9 ; 0x8004d9 379f2: 30 91 da 04 lds r19, 0x04DA ; 0x8004da 379f6: 40 91 db 04 lds r20, 0x04DB ; 0x8004db 379fa: 50 91 dc 04 lds r21, 0x04DC ; 0x8004dc 379fe: aa 96 adiw r28, 0x2a ; 42 37a00: ee ad ldd r30, Y+62 ; 0x3e 37a02: ff ad ldd r31, Y+63 ; 0x3f 37a04: aa 97 sbiw r28, 0x2a ; 42 37a06: 60 81 ld r22, Z 37a08: 71 81 ldd r23, Z+1 ; 0x01 37a0a: 82 81 ldd r24, Z+2 ; 0x02 37a0c: 93 81 ldd r25, Z+3 ; 0x03 37a0e: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__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; 37a12: a7 01 movw r20, r14 37a14: 96 01 movw r18, r12 37a16: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 37a1a: 6a 96 adiw r28, 0x1a ; 26 37a1c: 6c af std Y+60, r22 ; 0x3c 37a1e: 7d af std Y+61, r23 ; 0x3d 37a20: 8e af std Y+62, r24 ; 0x3e 37a22: 9f af std Y+63, r25 ; 0x3f 37a24: 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) 37a26: 20 e0 ldi r18, 0x00 ; 0 37a28: 30 e0 ldi r19, 0x00 ; 0 37a2a: 40 e4 ldi r20, 0x40 ; 64 37a2c: 50 e4 ldi r21, 0x40 ; 64 37a2e: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 37a32: 18 16 cp r1, r24 37a34: 0c f4 brge .+2 ; 0x37a38 37a36: 9e c0 rjmp .+316 ; 0x37b74 block->use_advance_lead = false; else if (e_D_ratio > 0) { 37a38: 20 e0 ldi r18, 0x00 ; 0 37a3a: 30 e0 ldi r19, 0x00 ; 0 37a3c: a9 01 movw r20, r18 37a3e: 6a 96 adiw r28, 0x1a ; 26 37a40: 6c ad ldd r22, Y+60 ; 0x3c 37a42: 7d ad ldd r23, Y+61 ; 0x3d 37a44: 8e ad ldd r24, Y+62 ; 0x3e 37a46: 9f ad ldd r25, Y+63 ; 0x3f 37a48: 6a 97 sbiw r28, 0x1a ; 26 37a4a: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 37a4e: 18 16 cp r1, r24 37a50: 0c f0 brlt .+2 ; 0x37a54 37a52: 42 c0 rjmp .+132 ; 0x37ad8 const uint32_t max_accel_steps_per_s2 = ceil(cs.max_jerk[E_AXIS] / (extruder_advance_K * e_D_ratio) * steps_per_mm); 37a54: 6a 96 adiw r28, 0x1a ; 26 37a56: 2c ad ldd r18, Y+60 ; 0x3c 37a58: 3d ad ldd r19, Y+61 ; 0x3d 37a5a: 4e ad ldd r20, Y+62 ; 0x3e 37a5c: 5f ad ldd r21, Y+63 ; 0x3f 37a5e: 6a 97 sbiw r28, 0x1a ; 26 37a60: 6d a5 ldd r22, Y+45 ; 0x2d 37a62: 7e a5 ldd r23, Y+46 ; 0x2e 37a64: 8f a5 ldd r24, Y+47 ; 0x2f 37a66: 98 a9 ldd r25, Y+48 ; 0x30 37a68: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 37a6c: 9b 01 movw r18, r22 37a6e: ac 01 movw r20, r24 37a70: 60 91 12 0e lds r22, 0x0E12 ; 0x800e12 37a74: 70 91 13 0e lds r23, 0x0E13 ; 0x800e13 37a78: 80 91 14 0e lds r24, 0x0E14 ; 0x800e14 37a7c: 90 91 15 0e lds r25, 0x0E15 ; 0x800e15 37a80: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 37a84: 29 a5 ldd r18, Y+41 ; 0x29 37a86: 3a a5 ldd r19, Y+42 ; 0x2a 37a88: 4b a5 ldd r20, Y+43 ; 0x2b 37a8a: 5c a5 ldd r21, Y+44 ; 0x2c 37a8c: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 37a90: 0f 94 22 de call 0x3bc44 ; 0x3bc44 37a94: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 37a98: 64 15 cp r22, r4 37a9a: 75 05 cpc r23, r5 37a9c: 86 05 cpc r24, r6 37a9e: 97 05 cpc r25, r7 37aa0: d8 f4 brcc .+54 ; 0x37ad8 37aa2: 2b 01 movw r4, r22 37aa4: 3c 01 movw r6, r24 37aa6: 18 c0 rjmp .+48 ; 0x37ad8 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 37aa8: 60 91 7e 0e lds r22, 0x0E7E ; 0x800e7e 37aac: 70 91 7f 0e lds r23, 0x0E7F ; 0x800e7f 37ab0: 80 91 80 0e lds r24, 0x0E80 ; 0x800e80 37ab4: 90 91 81 0e lds r25, 0x0E81 ; 0x800e81 37ab8: f1 ce rjmp .-542 ; 0x3789c * * 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 37aba: 8e e6 ldi r24, 0x6E ; 110 37abc: 82 9d mul r24, r2 37abe: f0 01 movw r30, r0 37ac0: 83 9d mul r24, r3 37ac2: f0 0d add r31, r0 37ac4: 11 24 eor r1, r1 37ac6: ef 5e subi r30, 0xEF ; 239 37ac8: f8 4f sbci r31, 0xF8 ; 248 37aca: 10 82 st Z, r1 block->nominal_speed *= speed_factor; block->nominal_rate *= speed_factor; } #ifdef LIN_ADVANCE float e_D_ratio = 0; 37acc: 6a 96 adiw r28, 0x1a ; 26 37ace: 1c ae std Y+60, r1 ; 0x3c 37ad0: 1d ae std Y+61, r1 ; 0x3d 37ad2: 1e ae std Y+62, r1 ; 0x3e 37ad4: 1f ae std Y+63, r1 ; 0x3f 37ad6: 6a 97 sbiw r28, 0x1a ; 26 37ad8: 10 e0 ldi r17, 0x00 ; 0 37ada: 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) 37adc: a4 96 adiw r28, 0x24 ; 36 37ade: ee ad ldd r30, Y+62 ; 0x3e 37ae0: ff ad ldd r31, Y+63 ; 0x3f 37ae2: a4 97 sbiw r28, 0x24 ; 36 37ae4: e0 0f add r30, r16 37ae6: f1 1f adc r31, r17 37ae8: eb 53 subi r30, 0x3B ; 59 37aea: f9 4f sbci r31, 0xF9 ; 249 37aec: c0 80 ld r12, Z 37aee: d1 80 ldd r13, Z+1 ; 0x01 37af0: e2 80 ldd r14, Z+2 ; 0x02 37af2: f3 80 ldd r15, Z+3 ; 0x03 37af4: c1 14 cp r12, r1 37af6: d1 04 cpc r13, r1 37af8: e1 04 cpc r14, r1 37afa: f1 04 cpc r15, r1 37afc: a1 f1 breq .+104 ; 0x37b66 37afe: f8 01 movw r30, r16 37b00: e2 5b subi r30, 0xB2 ; 178 37b02: fa 4f sbci r31, 0xFA ; 250 37b04: 60 81 ld r22, Z 37b06: 71 81 ldd r23, Z+1 ; 0x01 37b08: 82 81 ldd r24, Z+2 ; 0x02 37b0a: 93 81 ldd r25, Z+3 ; 0x03 37b0c: 64 15 cp r22, r4 37b0e: 75 05 cpc r23, r5 37b10: 86 05 cpc r24, r6 37b12: 97 05 cpc r25, r7 37b14: 40 f5 brcc .+80 ; 0x37b66 { const float max_possible = float(max_acceleration_steps_per_s2[axis]) * float(block->step_event_count.wide) / float(block->steps[axis].wide); 37b16: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 37b1a: 29 ad ldd r18, Y+57 ; 0x39 37b1c: 3a ad ldd r19, Y+58 ; 0x3a 37b1e: 4b ad ldd r20, Y+59 ; 0x3b 37b20: 5c ad ldd r21, Y+60 ; 0x3c 37b22: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 37b26: 4b 01 movw r8, r22 37b28: 5c 01 movw r10, r24 37b2a: c7 01 movw r24, r14 37b2c: b6 01 movw r22, r12 37b2e: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 37b32: 9b 01 movw r18, r22 37b34: ac 01 movw r20, r24 37b36: c5 01 movw r24, r10 37b38: b4 01 movw r22, r8 37b3a: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 37b3e: 6b 01 movw r12, r22 37b40: 7c 01 movw r14, r24 if (max_possible < accel) accel = max_possible; 37b42: c3 01 movw r24, r6 37b44: b2 01 movw r22, r4 37b46: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 37b4a: 9b 01 movw r18, r22 37b4c: ac 01 movw r20, r24 37b4e: c7 01 movw r24, r14 37b50: b6 01 movw r22, r12 37b52: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 37b56: 87 ff sbrs r24, 7 37b58: 06 c0 rjmp .+12 ; 0x37b66 37b5a: c7 01 movw r24, r14 37b5c: b6 01 movw r22, r12 37b5e: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 37b62: 2b 01 movw r4, r22 37b64: 3c 01 movw r6, r24 37b66: 0c 5f subi r16, 0xFC ; 252 37b68: 1f 4f sbci r17, 0xFF ; 255 } } #endif // Limit acceleration per axis for (uint8_t axis = 0; axis < NUM_AXIS; axis++) 37b6a: 00 31 cpi r16, 0x10 ; 16 37b6c: 11 05 cpc r17, r1 37b6e: 09 f0 breq .+2 ; 0x37b72 37b70: b5 cf rjmp .-150 ; 0x37adc 37b72: 01 c9 rjmp .-3582 ; 0x36d76 // 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; 37b74: d8 01 movw r26, r16 37b76: 1c 92 st X, r1 37b78: af cf rjmp .-162 ; 0x37ad8 if (jerk > mjerk) { safe_speed *= mjerk / jerk; limited = true; } } else { safe_speed = cs.max_jerk[axis]; 37b7a: c9 a6 std Y+41, r12 ; 0x29 37b7c: dd a6 std Y+45, r13 ; 0x2d 37b7e: e9 aa std Y+49, r14 ; 0x31 37b80: f9 ae std Y+57, r15 ; 0x39 limited = true; 37b82: 21 e0 ldi r18, 0x01 ; 1 37b84: 2d ab std Y+53, r18 ; 0x35 37b86: b1 c9 rjmp .-3230 ; 0x36eea // 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); 37b88: 27 96 adiw r28, 0x07 ; 7 37b8a: 2f ad ldd r18, Y+63 ; 0x3f 37b8c: 27 97 sbiw r28, 0x07 ; 7 37b8e: 2b 96 adiw r28, 0x0b ; 11 37b90: 3f ad ldd r19, Y+63 ; 0x3f 37b92: 2b 97 sbiw r28, 0x0b ; 11 37b94: 2f 96 adiw r28, 0x0f ; 15 37b96: 4f ad ldd r20, Y+63 ; 0x3f 37b98: 2f 97 sbiw r28, 0x0f ; 15 37b9a: 63 96 adiw r28, 0x13 ; 19 37b9c: 5f ad ldd r21, Y+63 ; 0x3f 37b9e: 63 97 sbiw r28, 0x13 ; 19 37ba0: 6b 96 adiw r28, 0x1b ; 27 37ba2: 6f ad ldd r22, Y+63 ; 0x3f 37ba4: 6b 97 sbiw r28, 0x1b ; 27 37ba6: 6d 96 adiw r28, 0x1d ; 29 37ba8: 7f ad ldd r23, Y+63 ; 0x3f 37baa: 6d 97 sbiw r28, 0x1d ; 29 37bac: c8 01 movw r24, r16 37bae: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 37bb2: ec 96 adiw r28, 0x3c ; 60 37bb4: 6c af std Y+60, r22 ; 0x3c 37bb6: 7d af std Y+61, r23 ; 0x3d 37bb8: 8e af std Y+62, r24 ; 0x3e 37bba: 9f af std Y+63, r25 ; 0x3f 37bbc: 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; 37bbe: 6b 96 adiw r28, 0x1b ; 27 37bc0: ef ad ldd r30, Y+63 ; 0x3f 37bc2: 6b 97 sbiw r28, 0x1b ; 27 37bc4: ed af std Y+61, r30 ; 0x3d 37bc6: 6d 96 adiw r28, 0x1d ; 29 37bc8: ff ad ldd r31, Y+63 ; 0x3f 37bca: 6d 97 sbiw r28, 0x1d ; 29 37bcc: fd ab std Y+53, r31 ; 0x35 37bce: 0e af std Y+62, r16 ; 0x3e 37bd0: 23 96 adiw r28, 0x03 ; 3 37bd2: 1f af std Y+63, r17 ; 0x3f 37bd4: 23 97 sbiw r28, 0x03 ; 3 37bd6: 04 ca rjmp .-3064 ; 0x36fe0 (v_exit > v_entry) ? ((v_entry > 0.f || v_exit < 0.f) ? // coasting (v_exit - v_entry) : // axis reversal max(v_exit, - v_entry)) : 37bd8: f7 fa bst r15, 7 37bda: f0 94 com r15 37bdc: f7 f8 bld r15, 7 37bde: f0 94 com r15 37be0: a5 01 movw r20, r10 37be2: 94 01 movw r18, r8 37be4: c7 01 movw r24, r14 37be6: b6 01 movw r22, r12 37be8: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 37bec: 87 ff sbrs r24, 7 37bee: 77 ca rjmp .-2834 ; 0x370de // v_exit <= v_entry ((v_entry < 0.f || v_exit > 0.f) ? // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); 37bf0: 75 01 movw r14, r10 37bf2: 64 01 movw r12, r8 37bf4: 74 ca rjmp .-2840 ; 0x370de // coasting (v_exit - v_entry) : // axis reversal max(v_exit, - v_entry)) : // v_exit <= v_entry ((v_entry < 0.f || v_exit > 0.f) ? 37bf6: c7 01 movw r24, r14 37bf8: b6 01 movw r22, r12 37bfa: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 37bfe: 87 fd sbrc r24, 7 37c00: 09 c0 rjmp .+18 ; 0x37c14 37c02: 20 e0 ldi r18, 0x00 ; 0 37c04: 30 e0 ldi r19, 0x00 ; 0 37c06: a9 01 movw r20, r18 37c08: c5 01 movw r24, r10 37c0a: b4 01 movw r22, r8 37c0c: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 37c10: 18 16 cp r1, r24 37c12: 2c f4 brge .+10 ; 0x37c1e 37c14: a5 01 movw r20, r10 37c16: 94 01 movw r18, r8 37c18: c7 01 movw r24, r14 37c1a: b6 01 movw r22, r12 37c1c: 5c ca rjmp .-2888 ; 0x370d6 // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); 37c1e: b7 fa bst r11, 7 37c20: b0 94 com r11 37c22: b7 f8 bld r11, 7 37c24: b0 94 com r11 37c26: a7 01 movw r20, r14 37c28: 96 01 movw r18, r12 37c2a: c5 01 movw r24, r10 37c2c: b4 01 movw r22, r8 37c2e: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 37c32: 18 16 cp r1, r24 37c34: 0c f0 brlt .+2 ; 0x37c38 37c36: 53 ca rjmp .-2906 ; 0x370de 37c38: db cf rjmp .-74 ; 0x37bf0 // 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; 37c3a: 8e e6 ldi r24, 0x6E ; 110 37c3c: 82 9d mul r24, r2 37c3e: f0 01 movw r30, r0 37c40: 83 9d mul r24, r3 37c42: f0 0d add r31, r0 37c44: 11 24 eor r1, r1 37c46: eb 53 subi r30, 0x3B ; 59 37c48: f9 4f sbci r31, 0xF9 ; 249 37c4a: 85 a9 ldd r24, Z+53 ; 0x35 37c4c: 84 60 ori r24, 0x04 ; 4 37c4e: 85 ab std Z+53, r24 ; 0x35 37c50: a9 a5 ldd r26, Y+41 ; 0x29 37c52: ad af std Y+61, r26 ; 0x3d 37c54: bd a5 ldd r27, Y+45 ; 0x2d 37c56: bd ab std Y+53, r27 ; 0x35 37c58: e9 a9 ldd r30, Y+49 ; 0x31 37c5a: ee af std Y+62, r30 ; 0x3e 37c5c: f9 ad ldd r31, Y+57 ; 0x39 37c5e: 23 96 adiw r28, 0x03 ; 3 37c60: ff af std Y+63, r31 ; 0x3f 37c62: 23 97 sbiw r28, 0x03 ; 3 37c64: bc ca rjmp .-2696 ; 0x371de // 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; 37c66: 81 e0 ldi r24, 0x01 ; 1 37c68: 30 cb rjmp .-2464 ; 0x372ca 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]; 37c6a: 20 91 12 0e lds r18, 0x0E12 ; 0x800e12 37c6e: 30 91 13 0e lds r19, 0x0E13 ; 0x800e13 37c72: 40 91 14 0e lds r20, 0x0E14 ; 0x800e14 37c76: 50 91 15 0e lds r21, 0x0E15 ; 0x800e15 37c7a: c7 01 movw r24, r14 37c7c: b6 01 movw r22, r12 37c7e: c1 cb rjmp .-2174 ; 0x37402 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) { 37c80: 20 e0 ldi r18, 0x00 ; 0 37c82: 30 e4 ldi r19, 0x40 ; 64 37c84: 4c e1 ldi r20, 0x1C ; 28 37c86: 56 e4 ldi r21, 0x46 ; 70 37c88: c7 01 movw r24, r14 37c8a: b6 01 movw r22, r12 37c8c: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 37c90: 18 16 cp r1, r24 37c92: d4 f4 brge .+52 ; 0x37cc8 block->advance_rate = advance_rate * 2; 37c94: 8e e6 ldi r24, 0x6E ; 110 37c96: 82 9d mul r24, r2 37c98: 80 01 movw r16, r0 37c9a: 83 9d mul r24, r3 37c9c: 10 0d add r17, r0 37c9e: 11 24 eor r1, r1 37ca0: 0b 53 subi r16, 0x3B ; 59 37ca2: 19 4f sbci r17, 0xF9 ; 249 37ca4: 78 01 movw r14, r16 37ca6: bd e4 ldi r27, 0x4D ; 77 37ca8: eb 0e add r14, r27 37caa: f1 1c adc r15, r1 37cac: a5 01 movw r20, r10 37cae: 94 01 movw r18, r8 37cb0: c5 01 movw r24, r10 37cb2: b4 01 movw r22, r8 37cb4: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 37cb8: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 37cbc: f7 01 movw r30, r14 37cbe: 71 83 std Z+1, r23 ; 0x01 37cc0: 60 83 st Z, r22 block->advance_step_loops = 2; 37cc2: 36 96 adiw r30, 0x06 ; 6 37cc4: 82 e0 ldi r24, 0x02 ; 2 37cc6: e2 cb rjmp .-2108 ; 0x3748c } else { // never overflow the internal accumulator with very low rates if (advance_rate < UINT16_MAX) 37cc8: 20 e0 ldi r18, 0x00 ; 0 37cca: 3f ef ldi r19, 0xFF ; 255 37ccc: 4f e7 ldi r20, 0x7F ; 127 37cce: 57 e4 ldi r21, 0x47 ; 71 37cd0: c5 01 movw r24, r10 37cd2: b4 01 movw r22, r8 37cd4: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 37cd8: 87 ff sbrs r24, 7 37cda: 19 c0 rjmp .+50 ; 0x37d0e block->advance_rate = advance_rate; 37cdc: 8e e6 ldi r24, 0x6E ; 110 37cde: 82 9d mul r24, r2 37ce0: 80 01 movw r16, r0 37ce2: 83 9d mul r24, r3 37ce4: 10 0d add r17, r0 37ce6: 11 24 eor r1, r1 37ce8: 0e 5e subi r16, 0xEE ; 238 37cea: 18 4f sbci r17, 0xF8 ; 248 37cec: c5 01 movw r24, r10 37cee: b4 01 movw r22, r8 37cf0: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 37cf4: d8 01 movw r26, r16 37cf6: 6d 93 st X+, r22 37cf8: 7c 93 st X, r23 else block->advance_rate = UINT16_MAX; block->advance_step_loops = 1; 37cfa: 8e e6 ldi r24, 0x6E ; 110 37cfc: 82 9d mul r24, r2 37cfe: f0 01 movw r30, r0 37d00: 83 9d mul r24, r3 37d02: f0 0d add r31, r0 37d04: 11 24 eor r1, r1 37d06: e8 5e subi r30, 0xE8 ; 232 37d08: f8 4f sbci r31, 0xF8 ; 248 37d0a: 81 e0 ldi r24, 0x01 ; 1 37d0c: bf cb rjmp .-2178 ; 0x3748c { // 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; 37d0e: 8e e6 ldi r24, 0x6E ; 110 37d10: 82 9d mul r24, r2 37d12: f0 01 movw r30, r0 37d14: 83 9d mul r24, r3 37d16: f0 0d add r31, r0 37d18: 11 24 eor r1, r1 37d1a: ee 5e subi r30, 0xEE ; 238 37d1c: f8 4f sbci r31, 0xF8 ; 248 37d1e: 8f ef ldi r24, 0xFF ; 255 37d20: 9f ef ldi r25, 0xFF ; 255 37d22: 91 83 std Z+1, r25 ; 0x01 37d24: 80 83 st Z, r24 37d26: e9 cf rjmp .-46 ; 0x37cfa 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) { 37d28: f6 01 movw r30, r12 37d2a: 71 a4 ldd r7, Z+41 ; 0x29 37d2c: 82 a4 ldd r8, Z+42 ; 0x2a 37d2e: 93 a4 ldd r9, Z+43 ; 0x2b 37d30: e4 a4 ldd r14, Z+44 ; 0x2c 37d32: 27 2d mov r18, r7 37d34: 38 2d mov r19, r8 37d36: 49 2d mov r20, r9 37d38: 5e 2d mov r21, r14 37d3a: 65 a1 ldd r22, Z+37 ; 0x25 37d3c: 76 a1 ldd r23, Z+38 ; 0x26 37d3e: 87 a1 ldd r24, Z+39 ; 0x27 37d40: 90 a5 ldd r25, Z+40 ; 0x28 37d42: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 37d46: 88 23 and r24, r24 37d48: 09 f4 brne .+2 ; 0x37d4c 37d4a: 51 c0 rjmp .+162 ; 0x37dee // 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) ? 37d4c: 01 fd sbrc r16, 1 37d4e: 44 c0 rjmp .+136 ; 0x37dd8 37d50: d5 01 movw r26, r10 37d52: 95 96 adiw r26, 0x25 ; 37 37d54: 2d 90 ld r2, X+ 37d56: 3d 90 ld r3, X+ 37d58: 4d 90 ld r4, X+ 37d5a: 5c 90 ld r5, X 37d5c: 98 97 sbiw r26, 0x28 ; 40 37d5e: a2 01 movw r20, r4 37d60: 91 01 movw r18, r2 37d62: 67 2d mov r22, r7 37d64: 78 2d mov r23, r8 37d66: 89 2d mov r24, r9 37d68: 9e 2d mov r25, r14 37d6a: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 37d6e: 18 16 cp r1, r24 37d70: 9c f5 brge .+102 ; 0x37dd8 // 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); 37d72: a2 01 movw r20, r4 37d74: 91 01 movw r18, r2 37d76: c2 01 movw r24, r4 37d78: b1 01 movw r22, r2 37d7a: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 37d7e: 1b 01 movw r2, r22 37d80: 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)); 37d82: f6 01 movw r30, r12 37d84: 61 a9 ldd r22, Z+49 ; 0x31 37d86: 72 a9 ldd r23, Z+50 ; 0x32 37d88: 83 a9 ldd r24, Z+51 ; 0x33 37d8a: 94 a9 ldd r25, Z+52 ; 0x34 37d8c: 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); 37d8e: 9b 01 movw r18, r22 37d90: ac 01 movw r20, r24 37d92: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 37d96: d6 01 movw r26, r12 37d98: 9d 96 adiw r26, 0x2d ; 45 37d9a: 2d 91 ld r18, X+ 37d9c: 3d 91 ld r19, X+ 37d9e: 4d 91 ld r20, X+ 37da0: 5c 91 ld r21, X 37da2: d0 97 sbiw r26, 0x30 ; 48 37da4: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 37da8: 9b 01 movw r18, r22 37daa: ac 01 movw r20, r24 37dac: c2 01 movw r24, r4 37dae: b1 01 movw r22, r2 37db0: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 37db4: 0f 94 12 e1 call 0x3c224 ; 0x3c224 37db8: 2b 01 movw r4, r22 37dba: 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)); 37dbc: 9b 01 movw r18, r22 37dbe: ac 01 movw r20, r24 37dc0: 67 2d mov r22, r7 37dc2: 78 2d mov r23, r8 37dc4: 89 2d mov r24, r9 37dc6: 9e 2d mov r25, r14 37dc8: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 37dcc: 87 fd sbrc r24, 7 37dce: 04 c0 rjmp .+8 ; 0x37dd8 37dd0: 74 2c mov r7, r4 37dd2: 85 2c mov r8, r5 37dd4: 9a 2c mov r9, r10 37dd6: 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) ? 37dd8: 87 2d mov r24, r7 37dda: 98 2d mov r25, r8 37ddc: a9 2d mov r26, r9 37dde: be 2d mov r27, r14 37de0: f6 01 movw r30, r12 37de2: 85 a3 std Z+37, r24 ; 0x25 37de4: 96 a3 std Z+38, r25 ; 0x26 37de6: a7 a3 std Z+39, r26 ; 0x27 37de8: 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; 37dea: 01 60 ori r16, 0x01 ; 1 37dec: 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) 37dee: 11 11 cpse r17, r1 37df0: 01 c0 rjmp .+2 ; 0x37df4 block_index = BLOCK_BUFFER_SIZE; 37df2: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 37df4: 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)); 37df6: 16 9d mul r17, r6 37df8: c0 01 movw r24, r0 37dfa: 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; 37dfc: 56 01 movw r10, r12 current = block_buffer + (block_index = prev_block_index(block_index)); 37dfe: 9c 01 movw r18, r24 37e00: 2b 53 subi r18, 0x3B ; 59 37e02: 39 4f sbci r19, 0xF9 ; 249 37e04: 69 01 movw r12, r18 37e06: 0b cc rjmp .-2026 ; 0x3761e 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)); 37e08: 6c 01 movw r12, r24 37e0a: 2f cc rjmp .-1954 ; 0x3766a 37e0c: 8f bf out 0x3f, r24 ; 63 __asm__ volatile ("" ::: "memory"); 37e0e: 0d 94 5b b1 jmp 0x362b6 ; 0x362b6 00037e12 : 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(){ 37e12: 4f 92 push r4 37e14: 5f 92 push r5 37e16: 6f 92 push r6 37e18: 7f 92 push r7 37e1a: 8f 92 push r8 37e1c: 9f 92 push r9 37e1e: af 92 push r10 37e20: bf 92 push r11 37e22: cf 92 push r12 37e24: df 92 push r13 37e26: ef 92 push r14 37e28: ff 92 push r15 37e2a: cf 93 push r28 37e2c: df 93 push r29 37e2e: cd b7 in r28, 0x3d ; 61 37e30: de b7 in r29, 0x3e ; 62 37e32: 2c 97 sbiw r28, 0x0c ; 12 37e34: 0f b6 in r0, 0x3f ; 63 37e36: f8 94 cli 37e38: de bf out 0x3e, r29 ; 62 37e3a: 0f be out 0x3f, r0 ; 63 37e3c: 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]); 37e3e: c0 90 9a 06 lds r12, 0x069A ; 0x80069a 37e42: d0 90 9b 06 lds r13, 0x069B ; 0x80069b 37e46: e0 90 9c 06 lds r14, 0x069C ; 0x80069c 37e4a: f0 90 9d 06 lds r15, 0x069D ; 0x80069d 37e4e: 80 91 96 06 lds r24, 0x0696 ; 0x800696 37e52: 90 91 97 06 lds r25, 0x0697 ; 0x800697 37e56: a0 91 98 06 lds r26, 0x0698 ; 0x800698 37e5a: b0 91 99 06 lds r27, 0x0699 ; 0x800699 37e5e: 40 91 92 06 lds r20, 0x0692 ; 0x800692 37e62: 50 91 93 06 lds r21, 0x0693 ; 0x800693 37e66: 60 91 94 06 lds r22, 0x0694 ; 0x800694 37e6a: 70 91 95 06 lds r23, 0x0695 ; 0x800695 37e6e: 4d 83 std Y+5, r20 ; 0x05 37e70: 5e 83 std Y+6, r21 ; 0x06 37e72: 6f 83 std Y+7, r22 ; 0x07 37e74: 78 87 std Y+8, r23 ; 0x08 37e76: 89 83 std Y+1, r24 ; 0x01 37e78: 9a 83 std Y+2, r25 ; 0x02 37e7a: ab 83 std Y+3, r26 ; 0x03 37e7c: 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); 37e7e: be 01 movw r22, r28 37e80: 6f 5f subi r22, 0xFF ; 255 37e82: 7f 4f sbci r23, 0xFF ; 255 37e84: ce 01 movw r24, r28 37e86: 05 96 adiw r24, 0x05 ; 5 37e88: 0e 94 02 6a call 0xd404 ; 0xd404 position[X_AXIS] = lround(x*cs.axis_steps_per_mm[X_AXIS]); 37e8c: 4d 80 ldd r4, Y+5 ; 0x05 37e8e: 5e 80 ldd r5, Y+6 ; 0x06 37e90: 6f 80 ldd r6, Y+7 ; 0x07 37e92: 78 84 ldd r7, Y+8 ; 0x08 37e94: 20 91 c2 0d lds r18, 0x0DC2 ; 0x800dc2 37e98: 30 91 c3 0d lds r19, 0x0DC3 ; 0x800dc3 37e9c: 40 91 c4 0d lds r20, 0x0DC4 ; 0x800dc4 37ea0: 50 91 c5 0d lds r21, 0x0DC5 ; 0x800dc5 37ea4: c3 01 movw r24, r6 37ea6: b2 01 movw r22, r4 37ea8: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 37eac: 0f 94 81 e0 call 0x3c102 ; 0x3c102 37eb0: 60 93 a3 06 sts 0x06A3, r22 ; 0x8006a3 37eb4: 70 93 a4 06 sts 0x06A4, r23 ; 0x8006a4 37eb8: 80 93 a5 06 sts 0x06A5, r24 ; 0x8006a5 37ebc: 90 93 a6 06 sts 0x06A6, r25 ; 0x8006a6 position[Y_AXIS] = lround(y*cs.axis_steps_per_mm[Y_AXIS]); 37ec0: 89 80 ldd r8, Y+1 ; 0x01 37ec2: 9a 80 ldd r9, Y+2 ; 0x02 37ec4: ab 80 ldd r10, Y+3 ; 0x03 37ec6: bc 80 ldd r11, Y+4 ; 0x04 37ec8: 20 91 c6 0d lds r18, 0x0DC6 ; 0x800dc6 37ecc: 30 91 c7 0d lds r19, 0x0DC7 ; 0x800dc7 37ed0: 40 91 c8 0d lds r20, 0x0DC8 ; 0x800dc8 37ed4: 50 91 c9 0d lds r21, 0x0DC9 ; 0x800dc9 37ed8: c5 01 movw r24, r10 37eda: b4 01 movw r22, r8 37edc: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 37ee0: 0f 94 81 e0 call 0x3c102 ; 0x3c102 37ee4: 60 93 a7 06 sts 0x06A7, r22 ; 0x8006a7 37ee8: 70 93 a8 06 sts 0x06A8, r23 ; 0x8006a8 37eec: 80 93 a9 06 sts 0x06A9, r24 ; 0x8006a9 37ef0: 90 93 aa 06 sts 0x06AA, r25 ; 0x8006aa #ifdef MESH_BED_LEVELING position[Z_AXIS] = mbl.active ? 37ef4: 80 91 c2 13 lds r24, 0x13C2 ; 0x8013c2 37ef8: 88 23 and r24, r24 37efa: 09 f4 brne .+2 ; 0x37efe 37efc: 8c c0 rjmp .+280 ; 0x38016 lround((z+mbl.get_z(x, y))*cs.axis_steps_per_mm[Z_AXIS]) : 37efe: a5 01 movw r20, r10 37f00: 94 01 movw r18, r8 37f02: c3 01 movw r24, r6 37f04: b2 01 movw r22, r4 37f06: 0f 94 b1 a1 call 0x34362 ; 0x34362 37f0a: 9b 01 movw r18, r22 37f0c: ac 01 movw r20, r24 37f0e: c7 01 movw r24, r14 37f10: b6 01 movw r22, r12 37f12: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 37f16: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 37f1a: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 37f1e: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 37f22: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd lround(z*cs.axis_steps_per_mm[Z_AXIS]); 37f26: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__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 ? 37f2a: 0f 94 81 e0 call 0x3c102 ; 0x3c102 37f2e: 60 93 ab 06 sts 0x06AB, r22 ; 0x8006ab 37f32: 70 93 ac 06 sts 0x06AC, r23 ; 0x8006ac 37f36: 80 93 ad 06 sts 0x06AD, r24 ; 0x8006ad 37f3a: 90 93 ae 06 sts 0x06AE, r25 ; 0x8006ae 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]); 37f3e: 80 91 9e 06 lds r24, 0x069E ; 0x80069e 37f42: 90 91 9f 06 lds r25, 0x069F ; 0x80069f 37f46: a0 91 a0 06 lds r26, 0x06A0 ; 0x8006a0 37f4a: b0 91 a1 06 lds r27, 0x06A1 ; 0x8006a1 37f4e: 89 87 std Y+9, r24 ; 0x09 37f50: 9a 87 std Y+10, r25 ; 0x0a 37f52: ab 87 std Y+11, r26 ; 0x0b 37f54: bc 87 std Y+12, r27 ; 0x0c 37f56: 20 91 ce 0d lds r18, 0x0DCE ; 0x800dce 37f5a: 30 91 cf 0d lds r19, 0x0DCF ; 0x800dcf 37f5e: 40 91 d0 0d lds r20, 0x0DD0 ; 0x800dd0 37f62: 50 91 d1 0d lds r21, 0x0DD1 ; 0x800dd1 37f66: bc 01 movw r22, r24 37f68: cd 01 movw r24, r26 37f6a: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 37f6e: 0f 94 81 e0 call 0x3c102 ; 0x3c102 37f72: 60 93 af 06 sts 0x06AF, r22 ; 0x8006af 37f76: 70 93 b0 06 sts 0x06B0, r23 ; 0x8006b0 37f7a: 80 93 b1 06 sts 0x06B1, r24 ; 0x8006b1 37f7e: 90 93 b2 06 sts 0x06B2, r25 ; 0x8006b2 #ifdef LIN_ADVANCE position_float[X_AXIS] = x; 37f82: 40 92 cd 04 sts 0x04CD, r4 ; 0x8004cd 37f86: 50 92 ce 04 sts 0x04CE, r5 ; 0x8004ce 37f8a: 60 92 cf 04 sts 0x04CF, r6 ; 0x8004cf 37f8e: 70 92 d0 04 sts 0x04D0, r7 ; 0x8004d0 position_float[Y_AXIS] = y; 37f92: 80 92 d1 04 sts 0x04D1, r8 ; 0x8004d1 37f96: 90 92 d2 04 sts 0x04D2, r9 ; 0x8004d2 37f9a: a0 92 d3 04 sts 0x04D3, r10 ; 0x8004d3 37f9e: b0 92 d4 04 sts 0x04D4, r11 ; 0x8004d4 position_float[Z_AXIS] = z; 37fa2: c0 92 d5 04 sts 0x04D5, r12 ; 0x8004d5 37fa6: d0 92 d6 04 sts 0x04D6, r13 ; 0x8004d6 37faa: e0 92 d7 04 sts 0x04D7, r14 ; 0x8004d7 37fae: f0 92 d8 04 sts 0x04D8, r15 ; 0x8004d8 position_float[E_AXIS] = e; 37fb2: 89 85 ldd r24, Y+9 ; 0x09 37fb4: 9a 85 ldd r25, Y+10 ; 0x0a 37fb6: ab 85 ldd r26, Y+11 ; 0x0b 37fb8: bc 85 ldd r27, Y+12 ; 0x0c 37fba: 80 93 d9 04 sts 0x04D9, r24 ; 0x8004d9 37fbe: 90 93 da 04 sts 0x04DA, r25 ; 0x8004da 37fc2: a0 93 db 04 sts 0x04DB, r26 ; 0x8004db 37fc6: b0 93 dc 04 sts 0x04DC, r27 ; 0x8004dc #endif st_set_position(position); 37fca: 0f 94 eb 87 call 0x30fd6 ; 0x30fd6 previous_nominal_speed = 0.0; // Resets planner junction speeds. Assumes start from rest. 37fce: 10 92 b9 04 sts 0x04B9, r1 ; 0x8004b9 <_ZL22previous_nominal_speed.lto_priv.488> 37fd2: 10 92 ba 04 sts 0x04BA, r1 ; 0x8004ba <_ZL22previous_nominal_speed.lto_priv.488+0x1> 37fd6: 10 92 bb 04 sts 0x04BB, r1 ; 0x8004bb <_ZL22previous_nominal_speed.lto_priv.488+0x2> 37fda: 10 92 bc 04 sts 0x04BC, r1 ; 0x8004bc <_ZL22previous_nominal_speed.lto_priv.488+0x3> memset(previous_speed, 0, sizeof(previous_speed)); 37fde: ed eb ldi r30, 0xBD ; 189 37fe0: f4 e0 ldi r31, 0x04 ; 4 37fe2: 80 e1 ldi r24, 0x10 ; 16 37fe4: df 01 movw r26, r30 37fe6: 1d 92 st X+, r1 37fe8: 8a 95 dec r24 37fea: e9 f7 brne .-6 ; 0x37fe6 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]); } 37fec: 2c 96 adiw r28, 0x0c ; 12 37fee: 0f b6 in r0, 0x3f ; 63 37ff0: f8 94 cli 37ff2: de bf out 0x3e, r29 ; 62 37ff4: 0f be out 0x3f, r0 ; 63 37ff6: cd bf out 0x3d, r28 ; 61 37ff8: df 91 pop r29 37ffa: cf 91 pop r28 37ffc: ff 90 pop r15 37ffe: ef 90 pop r14 38000: df 90 pop r13 38002: cf 90 pop r12 38004: bf 90 pop r11 38006: af 90 pop r10 38008: 9f 90 pop r9 3800a: 8f 90 pop r8 3800c: 7f 90 pop r7 3800e: 6f 90 pop r6 38010: 5f 90 pop r5 38012: 4f 90 pop r4 38014: 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]); 38016: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 3801a: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 3801e: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 38022: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 38026: c7 01 movw r24, r14 38028: b6 01 movw r22, r12 3802a: 7d cf rjmp .-262 ; 0x37f26 0003802c : 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) { 3802c: 8f 92 push r8 3802e: 9f 92 push r9 38030: af 92 push r10 38032: bf 92 push r11 38034: cf 92 push r12 38036: df 92 push r13 38038: ef 92 push r14 3803a: ff 92 push r15 3803c: 0f 93 push r16 3803e: 1f 93 push r17 38040: 4b 01 movw r8, r22 38042: 5c 01 movw r10, r24 plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feed_rate); 38044: e4 e7 ldi r30, 0x74 ; 116 38046: f6 e0 ldi r31, 0x06 ; 6 38048: e0 84 ldd r14, Z+8 ; 0x08 3804a: f1 84 ldd r15, Z+9 ; 0x09 3804c: 02 85 ldd r16, Z+10 ; 0x0a 3804e: 13 85 ldd r17, Z+11 ; 0x0b 38050: 24 81 ldd r18, Z+4 ; 0x04 38052: 35 81 ldd r19, Z+5 ; 0x05 38054: 46 81 ldd r20, Z+6 ; 0x06 38056: 57 81 ldd r21, Z+7 ; 0x07 38058: 60 81 ld r22, Z 3805a: 71 81 ldd r23, Z+1 ; 0x01 3805c: 82 81 ldd r24, Z+2 ; 0x02 3805e: 93 81 ldd r25, Z+3 ; 0x03 38060: 1f 92 push r1 38062: 1f 92 push r1 38064: 1f 92 push r1 38066: 1f 92 push r1 38068: e0 e8 ldi r30, 0x80 ; 128 3806a: ce 2e mov r12, r30 3806c: e6 e0 ldi r30, 0x06 ; 6 3806e: de 2e mov r13, r30 38070: 0f 94 f4 b0 call 0x361e8 ; 0x361e8 38074: 0f 90 pop r0 38076: 0f 90 pop r0 38078: 0f 90 pop r0 3807a: 0f 90 pop r0 } 3807c: 1f 91 pop r17 3807e: 0f 91 pop r16 38080: ff 90 pop r15 38082: ef 90 pop r14 38084: df 90 pop r13 38086: cf 90 pop r12 38088: bf 90 pop r11 3808a: af 90 pop r10 3808c: 9f 90 pop r9 3808e: 8f 90 pop r8 38090: 08 95 ret 00038092 : // Reset position sync requests plan_reset_next_e_queue = false; plan_reset_next_e_sched = false; } void plan_buffer_line_curposXYZE(float feed_rate) { 38092: 8f 92 push r8 38094: 9f 92 push r9 38096: af 92 push r10 38098: bf 92 push r11 3809a: cf 92 push r12 3809c: df 92 push r13 3809e: ef 92 push r14 380a0: ff 92 push r15 380a2: 0f 93 push r16 380a4: 1f 93 push r17 380a6: 4b 01 movw r8, r22 380a8: 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); 380aa: e2 e9 ldi r30, 0x92 ; 146 380ac: f6 e0 ldi r31, 0x06 ; 6 380ae: e0 84 ldd r14, Z+8 ; 0x08 380b0: f1 84 ldd r15, Z+9 ; 0x09 380b2: 02 85 ldd r16, Z+10 ; 0x0a 380b4: 13 85 ldd r17, Z+11 ; 0x0b 380b6: 24 81 ldd r18, Z+4 ; 0x04 380b8: 35 81 ldd r19, Z+5 ; 0x05 380ba: 46 81 ldd r20, Z+6 ; 0x06 380bc: 57 81 ldd r21, Z+7 ; 0x07 380be: 60 81 ld r22, Z 380c0: 71 81 ldd r23, Z+1 ; 0x01 380c2: 82 81 ldd r24, Z+2 ; 0x02 380c4: 93 81 ldd r25, Z+3 ; 0x03 380c6: 1f 92 push r1 380c8: 1f 92 push r1 380ca: 1f 92 push r1 380cc: 1f 92 push r1 380ce: ee e9 ldi r30, 0x9E ; 158 380d0: ce 2e mov r12, r30 380d2: e6 e0 ldi r30, 0x06 ; 6 380d4: de 2e mov r13, r30 380d6: 0f 94 f4 b0 call 0x361e8 ; 0x361e8 380da: 0f 90 pop r0 380dc: 0f 90 pop r0 380de: 0f 90 pop r0 380e0: 0f 90 pop r0 } 380e2: 1f 91 pop r17 380e4: 0f 91 pop r16 380e6: ff 90 pop r15 380e8: ef 90 pop r14 380ea: df 90 pop r13 380ec: cf 90 pop r12 380ee: bf 90 pop r11 380f0: af 90 pop r10 380f2: 9f 90 pop r9 380f4: 8f 90 pop r8 380f6: 08 95 ret 000380f8 : #endif /* PLANNER_DIAGNOSTICS */ extern volatile uint32_t step_events_completed; // The number of step events executed in the current block void planner_reset_position() { 380f8: 4f 92 push r4 380fa: 5f 92 push r5 380fc: 6f 92 push r6 380fe: 7f 92 push r7 38100: 8f 92 push r8 38102: 9f 92 push r9 38104: af 92 push r10 38106: bf 92 push r11 38108: cf 92 push r12 3810a: df 92 push r13 3810c: ef 92 push r14 3810e: ff 92 push r15 38110: cf 93 push r28 // First update the planner's current position in the physical motor steps. position[X_AXIS] = st_get_position(X_AXIS); 38112: 80 e0 ldi r24, 0x00 ; 0 38114: 0f 94 c6 42 call 0x2858c ; 0x2858c 38118: 60 93 a3 06 sts 0x06A3, r22 ; 0x8006a3 3811c: 70 93 a4 06 sts 0x06A4, r23 ; 0x8006a4 38120: 80 93 a5 06 sts 0x06A5, r24 ; 0x8006a5 38124: 90 93 a6 06 sts 0x06A6, r25 ; 0x8006a6 position[Y_AXIS] = st_get_position(Y_AXIS); 38128: 81 e0 ldi r24, 0x01 ; 1 3812a: 0f 94 c6 42 call 0x2858c ; 0x2858c 3812e: 60 93 a7 06 sts 0x06A7, r22 ; 0x8006a7 38132: 70 93 a8 06 sts 0x06A8, r23 ; 0x8006a8 38136: 80 93 a9 06 sts 0x06A9, r24 ; 0x8006a9 3813a: 90 93 aa 06 sts 0x06AA, r25 ; 0x8006aa position[Z_AXIS] = st_get_position(Z_AXIS); 3813e: 82 e0 ldi r24, 0x02 ; 2 38140: 0f 94 c6 42 call 0x2858c ; 0x2858c 38144: 60 93 ab 06 sts 0x06AB, r22 ; 0x8006ab 38148: 70 93 ac 06 sts 0x06AC, r23 ; 0x8006ac 3814c: 80 93 ad 06 sts 0x06AD, r24 ; 0x8006ad 38150: 90 93 ae 06 sts 0x06AE, r25 ; 0x8006ae position[E_AXIS] = st_get_position(E_AXIS); 38154: 83 e0 ldi r24, 0x03 ; 3 38156: 0f 94 c6 42 call 0x2858c ; 0x2858c 3815a: 60 93 af 06 sts 0x06AF, r22 ; 0x8006af 3815e: 70 93 b0 06 sts 0x06B0, r23 ; 0x8006b0 38162: 80 93 b1 06 sts 0x06B1, r24 ; 0x8006b1 38166: 90 93 b2 06 sts 0x06B2, r25 ; 0x8006b2 // Second update the current position of the front end. current_position[X_AXIS] = st_get_position_mm(X_AXIS); 3816a: 80 e0 ldi r24, 0x00 ; 0 3816c: 0f 94 d4 42 call 0x285a8 ; 0x285a8 38170: 60 93 92 06 sts 0x0692, r22 ; 0x800692 38174: 70 93 93 06 sts 0x0693, r23 ; 0x800693 38178: 80 93 94 06 sts 0x0694, r24 ; 0x800694 3817c: 90 93 95 06 sts 0x0695, r25 ; 0x800695 current_position[Y_AXIS] = st_get_position_mm(Y_AXIS); 38180: 81 e0 ldi r24, 0x01 ; 1 38182: 0f 94 d4 42 call 0x285a8 ; 0x285a8 38186: 60 93 96 06 sts 0x0696, r22 ; 0x800696 3818a: 70 93 97 06 sts 0x0697, r23 ; 0x800697 3818e: 80 93 98 06 sts 0x0698, r24 ; 0x800698 38192: 90 93 99 06 sts 0x0699, r25 ; 0x800699 current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); 38196: 82 e0 ldi r24, 0x02 ; 2 38198: 0f 94 d4 42 call 0x285a8 ; 0x285a8 3819c: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a 381a0: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b 381a4: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c 381a8: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d current_position[E_AXIS] = st_get_position_mm(E_AXIS); 381ac: 83 e0 ldi r24, 0x03 ; 3 381ae: 0f 94 d4 42 call 0x285a8 ; 0x285a8 381b2: 60 93 9e 06 sts 0x069E, r22 ; 0x80069e 381b6: 70 93 9f 06 sts 0x069F, r23 ; 0x80069f 381ba: 80 93 a0 06 sts 0x06A0, r24 ; 0x8006a0 381be: 90 93 a1 06 sts 0x06A1, r25 ; 0x8006a1 // Apply the mesh bed leveling correction to the Z axis. #ifdef MESH_BED_LEVELING if (mbl.active) { 381c2: 80 91 c2 13 lds r24, 0x13C2 ; 0x8013c2 381c6: 88 23 and r24, r24 381c8: 31 f1 breq .+76 ; 0x38216 #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]); 381ca: 20 91 96 06 lds r18, 0x0696 ; 0x800696 381ce: 30 91 97 06 lds r19, 0x0697 ; 0x800697 381d2: 40 91 98 06 lds r20, 0x0698 ; 0x800698 381d6: 50 91 99 06 lds r21, 0x0699 ; 0x800699 381da: 60 91 92 06 lds r22, 0x0692 ; 0x800692 381de: 70 91 93 06 lds r23, 0x0693 ; 0x800693 381e2: 80 91 94 06 lds r24, 0x0694 ; 0x800694 381e6: 90 91 95 06 lds r25, 0x0695 ; 0x800695 381ea: 0f 94 b1 a1 call 0x34362 ; 0x34362 381ee: 9b 01 movw r18, r22 381f0: ac 01 movw r20, r24 381f2: 60 91 9a 06 lds r22, 0x069A ; 0x80069a 381f6: 70 91 9b 06 lds r23, 0x069B ; 0x80069b 381fa: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 381fe: 90 91 9d 06 lds r25, 0x069D ; 0x80069d 38202: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 38206: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a 3820a: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b 3820e: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c 38212: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d } } inline void machine2world(float &x, float &y) { if (world2machine_correction_mode == WORLD2MACHINE_CORRECTION_NONE) { 38216: c0 91 0f 18 lds r28, 0x180F ; 0x80180f 3821a: cc 23 and r28, r28 3821c: 09 f4 brne .+2 ; 0x38220 3821e: 9a c0 rjmp .+308 ; 0x38354 // No correction. } else { if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SHIFT) { 38220: c0 ff sbrs r28, 0 38222: 34 c0 rjmp .+104 ; 0x3828c // Then add the offset. x -= world2machine_shift[0]; 38224: 20 91 07 18 lds r18, 0x1807 ; 0x801807 38228: 30 91 08 18 lds r19, 0x1808 ; 0x801808 3822c: 40 91 09 18 lds r20, 0x1809 ; 0x801809 38230: 50 91 0a 18 lds r21, 0x180A ; 0x80180a 38234: 60 91 92 06 lds r22, 0x0692 ; 0x800692 38238: 70 91 93 06 lds r23, 0x0693 ; 0x800693 3823c: 80 91 94 06 lds r24, 0x0694 ; 0x800694 38240: 90 91 95 06 lds r25, 0x0695 ; 0x800695 38244: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 38248: 60 93 92 06 sts 0x0692, r22 ; 0x800692 3824c: 70 93 93 06 sts 0x0693, r23 ; 0x800693 38250: 80 93 94 06 sts 0x0694, r24 ; 0x800694 38254: 90 93 95 06 sts 0x0695, r25 ; 0x800695 y -= world2machine_shift[1]; 38258: 20 91 0b 18 lds r18, 0x180B ; 0x80180b 3825c: 30 91 0c 18 lds r19, 0x180C ; 0x80180c 38260: 40 91 0d 18 lds r20, 0x180D ; 0x80180d 38264: 50 91 0e 18 lds r21, 0x180E ; 0x80180e 38268: 60 91 96 06 lds r22, 0x0696 ; 0x800696 3826c: 70 91 97 06 lds r23, 0x0697 ; 0x800697 38270: 80 91 98 06 lds r24, 0x0698 ; 0x800698 38274: 90 91 99 06 lds r25, 0x0699 ; 0x800699 38278: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 3827c: 60 93 96 06 sts 0x0696, r22 ; 0x800696 38280: 70 93 97 06 sts 0x0697, r23 ; 0x800697 38284: 80 93 98 06 sts 0x0698, r24 ; 0x800698 38288: 90 93 99 06 sts 0x0699, r25 ; 0x800699 } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { 3828c: c1 ff sbrs r28, 1 3828e: 62 c0 rjmp .+196 ; 0x38354 // Firs the skew & rotation correction. float out_x = world2machine_rotation_and_skew_inv[0][0] * x + world2machine_rotation_and_skew_inv[0][1] * y; 38290: 80 90 92 06 lds r8, 0x0692 ; 0x800692 38294: 90 90 93 06 lds r9, 0x0693 ; 0x800693 38298: a0 90 94 06 lds r10, 0x0694 ; 0x800694 3829c: b0 90 95 06 lds r11, 0x0695 ; 0x800695 382a0: c0 90 96 06 lds r12, 0x0696 ; 0x800696 382a4: d0 90 97 06 lds r13, 0x0697 ; 0x800697 382a8: e0 90 98 06 lds r14, 0x0698 ; 0x800698 382ac: f0 90 99 06 lds r15, 0x0699 ; 0x800699 float out_y = world2machine_rotation_and_skew_inv[1][0] * x + world2machine_rotation_and_skew_inv[1][1] * y; 382b0: 20 91 ff 17 lds r18, 0x17FF ; 0x8017ff 382b4: 30 91 00 18 lds r19, 0x1800 ; 0x801800 382b8: 40 91 01 18 lds r20, 0x1801 ; 0x801801 382bc: 50 91 02 18 lds r21, 0x1802 ; 0x801802 382c0: c5 01 movw r24, r10 382c2: b4 01 movw r22, r8 382c4: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 382c8: 2b 01 movw r4, r22 382ca: 3c 01 movw r6, r24 382cc: 20 91 03 18 lds r18, 0x1803 ; 0x801803 382d0: 30 91 04 18 lds r19, 0x1804 ; 0x801804 382d4: 40 91 05 18 lds r20, 0x1805 ; 0x801805 382d8: 50 91 06 18 lds r21, 0x1806 ; 0x801806 382dc: c7 01 movw r24, r14 382de: b6 01 movw r22, r12 382e0: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 382e4: 9b 01 movw r18, r22 382e6: ac 01 movw r20, r24 382e8: c3 01 movw r24, r6 382ea: b2 01 movw r22, r4 382ec: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 382f0: 2b 01 movw r4, r22 382f2: 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; 382f4: 20 91 f7 17 lds r18, 0x17F7 ; 0x8017f7 382f8: 30 91 f8 17 lds r19, 0x17F8 ; 0x8017f8 382fc: 40 91 f9 17 lds r20, 0x17F9 ; 0x8017f9 38300: 50 91 fa 17 lds r21, 0x17FA ; 0x8017fa 38304: c5 01 movw r24, r10 38306: b4 01 movw r22, r8 38308: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 3830c: 4b 01 movw r8, r22 3830e: 5c 01 movw r10, r24 38310: 20 91 fb 17 lds r18, 0x17FB ; 0x8017fb 38314: 30 91 fc 17 lds r19, 0x17FC ; 0x8017fc 38318: 40 91 fd 17 lds r20, 0x17FD ; 0x8017fd 3831c: 50 91 fe 17 lds r21, 0x17FE ; 0x8017fe 38320: c7 01 movw r24, r14 38322: b6 01 movw r22, r12 38324: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 38328: 9b 01 movw r18, r22 3832a: ac 01 movw r20, r24 3832c: c5 01 movw r24, r10 3832e: b4 01 movw r22, r8 38330: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> float out_y = world2machine_rotation_and_skew_inv[1][0] * x + world2machine_rotation_and_skew_inv[1][1] * y; x = out_x; 38334: 60 93 92 06 sts 0x0692, r22 ; 0x800692 38338: 70 93 93 06 sts 0x0693, r23 ; 0x800693 3833c: 80 93 94 06 sts 0x0694, r24 ; 0x800694 38340: 90 93 95 06 sts 0x0695, r25 ; 0x800695 y = out_y; 38344: 40 92 96 06 sts 0x0696, r4 ; 0x800696 38348: 50 92 97 06 sts 0x0697, r5 ; 0x800697 3834c: 60 92 98 06 sts 0x0698, r6 ; 0x800698 38350: 70 92 99 06 sts 0x0699, r7 ; 0x800699 } #endif // Apply inverse world correction matrix. machine2world(current_position[X_AXIS], current_position[Y_AXIS]); set_destination_to_current(); 38354: 0e 94 3a 68 call 0xd074 ; 0xd074 #ifdef LIN_ADVANCE memcpy(position_float, current_position, sizeof(position_float)); 38358: 80 e1 ldi r24, 0x10 ; 16 3835a: e2 e9 ldi r30, 0x92 ; 146 3835c: f6 e0 ldi r31, 0x06 ; 6 3835e: ad ec ldi r26, 0xCD ; 205 38360: b4 e0 ldi r27, 0x04 ; 4 38362: 01 90 ld r0, Z+ 38364: 0d 92 st X+, r0 38366: 8a 95 dec r24 38368: e1 f7 brne .-8 ; 0x38362 #endif } 3836a: cf 91 pop r28 3836c: ff 90 pop r15 3836e: ef 90 pop r14 38370: df 90 pop r13 38372: cf 90 pop r12 38374: bf 90 pop r11 38376: af 90 pop r10 38378: 9f 90 pop r9 3837a: 8f 90 pop r8 3837c: 7f 90 pop r7 3837e: 6f 90 pop r6 38380: 5f 90 pop r5 38382: 4f 90 pop r4 38384: 08 95 ret 00038386 : void planner_abort_hard() { // Abort the stepper routine and flush the planner queue. DISABLE_STEPPER_DRIVER_INTERRUPT(); 38386: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 3838a: 8d 7f andi r24, 0xFD ; 253 3838c: 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(); 38390: 0f 94 7c c0 call 0x380f8 ; 0x380f8 // Relay to planner wait routine that the current line shall be canceled. planner_aborted = true; 38394: 81 e0 ldi r24, 0x01 ; 1 38396: 80 93 ac 0d sts 0x0DAC, r24 ; 0x800dac } void quickStop() { DISABLE_STEPPER_DRIVER_INTERRUPT(); 3839a: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 3839e: 8d 7f andi r24, 0xFD ; 253 383a0: 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); 383a4: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 383a8: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 while (blocks_queued()) plan_discard_current_block(); 383ac: 98 17 cp r25, r24 383ae: 69 f0 breq .+26 ; 0x383ca 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) { 383b0: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 383b4: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 383b8: 98 17 cp r25, r24 383ba: a1 f3 breq .-24 ; 0x383a4 block_buffer_tail = (block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 383bc: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 383c0: 8f 5f subi r24, 0xFF ; 255 383c2: 8f 70 andi r24, 0x0F ; 15 383c4: 80 93 a6 0d sts 0x0DA6, r24 ; 0x800da6 383c8: ed cf rjmp .-38 ; 0x383a4 current_block = NULL; 383ca: 10 92 a2 05 sts 0x05A2, r1 ; 0x8005a2 383ce: 10 92 a1 05 sts 0x05A1, r1 ; 0x8005a1 #ifdef LIN_ADVANCE nextAdvanceISR = ADV_NEVER; 383d2: 8f ef ldi r24, 0xFF ; 255 383d4: 9f ef ldi r25, 0xFF ; 255 383d6: 90 93 e4 04 sts 0x04E4, r25 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.477+0x1> 383da: 80 93 e3 04 sts 0x04E3, r24 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.477> current_adv_steps = 0; 383de: 10 92 e0 04 sts 0x04E0, r1 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.479+0x1> 383e2: 10 92 df 04 sts 0x04DF, r1 ; 0x8004df <_ZL17current_adv_steps.lto_priv.479> #endif st_reset_timer(); 383e6: 0f 94 42 43 call 0x28684 ; 0x28684 ENABLE_STEPPER_DRIVER_INTERRUPT(); 383ea: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 383ee: 82 60 ori r24, 0x02 ; 2 383f0: 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; 383f4: 10 92 b9 04 sts 0x04B9, r1 ; 0x8004b9 <_ZL22previous_nominal_speed.lto_priv.488> 383f8: 10 92 ba 04 sts 0x04BA, r1 ; 0x8004ba <_ZL22previous_nominal_speed.lto_priv.488+0x1> 383fc: 10 92 bb 04 sts 0x04BB, r1 ; 0x8004bb <_ZL22previous_nominal_speed.lto_priv.488+0x2> 38400: 10 92 bc 04 sts 0x04BC, r1 ; 0x8004bc <_ZL22previous_nominal_speed.lto_priv.488+0x3> memset(previous_speed, 0, sizeof(previous_speed)); 38404: ed eb ldi r30, 0xBD ; 189 38406: f4 e0 ldi r31, 0x04 ; 4 38408: 80 e1 ldi r24, 0x10 ; 16 3840a: df 01 movw r26, r30 3840c: 1d 92 st X+, r1 3840e: 8a 95 dec r24 38410: e9 f7 brne .-6 ; 0x3840c // Reset position sync requests plan_reset_next_e_queue = false; 38412: 10 92 b8 04 sts 0x04B8, r1 ; 0x8004b8 <_ZL23plan_reset_next_e_queue.lto_priv.486> plan_reset_next_e_sched = false; 38416: 10 92 b7 04 sts 0x04B7, r1 ; 0x8004b7 <_ZL23plan_reset_next_e_sched.lto_priv.487> } 3841a: 08 95 ret 0003841c : pat9125_PID2 = 0xff; return 0; } static void pat9125_wr_reg(uint8_t addr, uint8_t data) { 3841c: cf 93 push r28 3841e: c6 2f mov r28, r22 } uint8_t twi_w8(uint8_t address, uint8_t reg, uint8_t data) { if(twi_start(address, reg)) 38420: 0f 94 c3 7a call 0x2f586 ; 0x2f586 38424: 81 11 cpse r24, r1 38426: 0f c0 rjmp .+30 ; 0x38446 return 1; // send data TWDR = data; 38428: c0 93 bb 00 sts 0x00BB, r28 ; 0x8000bb <__TEXT_REGION_LENGTH__+0x7c20bb> TWCR = _BV(TWEN) | _BV(TWINT); 3842c: 84 e8 ldi r24, 0x84 ; 132 3842e: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_MT_DATA_ACK)) 38432: 88 e2 ldi r24, 0x28 ; 40 38434: 0f 94 b9 29 call 0x25372 ; 0x25372 38438: 81 11 cpse r24, r1 3843a: 05 c0 rjmp .+10 ; 0x38446 } static void twi_stop() { TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTO); 3843c: 84 e9 ldi r24, 0x94 ; 148 3843e: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> error: pat9125_PID1 = 0xff; pat9125_PID2 = 0xff; return; } 38442: cf 91 pop r28 38444: 08 95 ret goto error; #endif return; error: pat9125_PID1 = 0xff; 38446: 8f ef ldi r24, 0xFF ; 255 38448: 80 93 bd 0d sts 0x0DBD, r24 ; 0x800dbd pat9125_PID2 = 0xff; 3844c: 80 93 bc 0d sts 0x0DBC, r24 ; 0x800dbc 38450: f8 cf rjmp .-16 ; 0x38442 00038452 : } return 0; } static uint8_t pat9125_rd_reg(uint8_t addr) { 38452: cf 93 push r28 } uint8_t twi_r8(uint8_t address, uint8_t reg, uint8_t* data) { if(twi_start(address, reg)) 38454: 0f 94 c3 7a call 0x2f586 ; 0x2f586 38458: 81 11 cpse r24, r1 3845a: 21 c0 rjmp .+66 ; 0x3849e return 1; // repeat start TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTA); 3845c: 84 ea ldi r24, 0xA4 ; 164 3845e: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_REP_START)) 38462: 80 e1 ldi r24, 0x10 ; 16 38464: 0f 94 b9 29 call 0x25372 ; 0x25372 38468: 81 11 cpse r24, r1 3846a: 19 c0 rjmp .+50 ; 0x3849e return 2; // start receiving TWDR = TW_READ | (address << 1); 3846c: 8b ee ldi r24, 0xEB ; 235 3846e: 80 93 bb 00 sts 0x00BB, r24 ; 0x8000bb <__TEXT_REGION_LENGTH__+0x7c20bb> TWCR = _BV(TWEN) | _BV(TWINT); 38472: c4 e8 ldi r28, 0x84 ; 132 38474: c0 93 bc 00 sts 0x00BC, r28 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_MR_SLA_ACK)) 38478: 80 e4 ldi r24, 0x40 ; 64 3847a: 0f 94 b9 29 call 0x25372 ; 0x25372 3847e: 81 11 cpse r24, r1 38480: 0e c0 rjmp .+28 ; 0x3849e return 3; // receive data TWCR = _BV(TWEN) | _BV(TWINT); 38482: c0 93 bc 00 sts 0x00BC, r28 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_MR_DATA_NACK)) 38486: 88 e5 ldi r24, 0x58 ; 88 38488: 0f 94 b9 29 call 0x25372 ; 0x25372 3848c: 81 11 cpse r24, r1 3848e: 07 c0 rjmp .+14 ; 0x3849e return 4; *data = TWDR; 38490: 80 91 bb 00 lds r24, 0x00BB ; 0x8000bb <__TEXT_REGION_LENGTH__+0x7c20bb> } static void twi_stop() { TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTO); 38494: 94 e9 ldi r25, 0x94 ; 148 38496: 90 93 bc 00 sts 0x00BC, r25 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> error: pat9125_PID1 = 0xff; pat9125_PID2 = 0xff; return 0; } 3849a: cf 91 pop r28 3849c: 08 95 ret goto error; #endif return data; error: pat9125_PID1 = 0xff; 3849e: 8f ef ldi r24, 0xFF ; 255 384a0: 80 93 bd 0d sts 0x0DBD, r24 ; 0x800dbd pat9125_PID2 = 0xff; 384a4: 80 93 bc 0d sts 0x0DBC, r24 ; 0x800dbc return 0; 384a8: 80 e0 ldi r24, 0x00 ; 0 384aa: f7 cf rjmp .-18 ; 0x3849a 000384ac : pat9125_wr_reg(addr, data); return pat9125_rd_reg(addr) == data; } static uint8_t pat9125_wr_seq(const uint8_t* seq) { 384ac: 0f 93 push r16 384ae: 1f 93 push r17 384b0: cf 93 push r28 384b2: df 93 push r29 384b4: 8c 01 movw r16, r24 for (;;) { const uint8_t addr = pgm_read_byte(seq++); 384b6: f8 01 movw r30, r16 384b8: d4 91 lpm r29, Z if (addr == 0xff) 384ba: df 3f cpi r29, 0xFF ; 255 384bc: 99 f0 breq .+38 ; 0x384e4 break; if (!pat9125_wr_reg_verify(addr, pgm_read_byte(seq++))) 384be: 31 96 adiw r30, 0x01 ; 1 384c0: c4 91 lpm r28, Z return; } static uint8_t pat9125_wr_reg_verify(uint8_t addr, uint8_t data) { pat9125_wr_reg(addr, data); 384c2: 6c 2f mov r22, r28 384c4: 8d 2f mov r24, r29 384c6: 0f 94 0e c2 call 0x3841c ; 0x3841c return pat9125_rd_reg(addr) == data; 384ca: 8d 2f mov r24, r29 384cc: 0f 94 29 c2 call 0x38452 ; 0x38452 { for (;;) { const uint8_t addr = pgm_read_byte(seq++); if (addr == 0xff) break; if (!pat9125_wr_reg_verify(addr, pgm_read_byte(seq++))) 384d0: 0e 5f subi r16, 0xFE ; 254 384d2: 1f 4f sbci r17, 0xFF ; 255 384d4: c8 17 cp r28, r24 384d6: 79 f3 breq .-34 ; 0x384b6 // Verification of the register write failed. return 0; 384d8: 80 e0 ldi r24, 0x00 ; 0 } return 1; } 384da: df 91 pop r29 384dc: cf 91 pop r28 384de: 1f 91 pop r17 384e0: 0f 91 pop r16 384e2: 08 95 ret break; if (!pat9125_wr_reg_verify(addr, pgm_read_byte(seq++))) // Verification of the register write failed. return 0; } return 1; 384e4: 81 e0 ldi r24, 0x01 ; 1 384e6: f9 cf rjmp .-14 ; 0x384da 000384e8 : return 1; } uint8_t pat9125_update(void) { 384e8: cf 93 push r28 384ea: df 93 push r29 if ((pat9125_PID1 == 0x31) && (pat9125_PID2 == 0x91)) 384ec: 80 91 bd 0d lds r24, 0x0DBD ; 0x800dbd 384f0: 81 33 cpi r24, 0x31 ; 49 384f2: 21 f0 breq .+8 ; 0x384fc pat9125_x += iDX; pat9125_y += iDY; } return 1; } return 0; 384f4: 80 e0 ldi r24, 0x00 ; 0 } 384f6: df 91 pop r29 384f8: cf 91 pop r28 384fa: 08 95 ret return 1; } uint8_t pat9125_update(void) { if ((pat9125_PID1 == 0x31) && (pat9125_PID2 == 0x91)) 384fc: 80 91 bc 0d lds r24, 0x0DBC ; 0x800dbc 38500: 81 39 cpi r24, 0x91 ; 145 38502: c1 f7 brne .-16 ; 0x384f4 { uint8_t ucMotion = pat9125_rd_reg(PAT9125_MOTION); 38504: 82 e0 ldi r24, 0x02 ; 2 38506: 0f 94 29 c2 call 0x38452 ; 0x38452 3850a: c8 2f mov r28, r24 pat9125_b = pat9125_rd_reg(PAT9125_FRAME); 3850c: 87 e1 ldi r24, 0x17 ; 23 3850e: 0f 94 29 c2 call 0x38452 ; 0x38452 38512: 80 93 ba 0d sts 0x0DBA, r24 ; 0x800dba pat9125_s = pat9125_rd_reg(PAT9125_SHUTTER); 38516: 84 e1 ldi r24, 0x14 ; 20 38518: 0f 94 29 c2 call 0x38452 ; 0x38452 3851c: 80 93 bb 0d sts 0x0DBB, r24 ; 0x800dbb if (pat9125_PID1 == 0xff) return 0; 38520: 80 91 bd 0d lds r24, 0x0DBD ; 0x800dbd 38524: 8f 3f cpi r24, 0xFF ; 255 38526: 31 f3 breq .-52 ; 0x384f4 if (ucMotion & 0x80) 38528: c7 ff sbrs r28, 7 3852a: 36 c0 rjmp .+108 ; 0x38598 { uint16_t ucXL = pat9125_rd_reg(PAT9125_DELTA_XL); 3852c: 83 e0 ldi r24, 0x03 ; 3 3852e: 0f 94 29 c2 call 0x38452 ; 0x38452 38532: d8 2f mov r29, r24 uint16_t ucYL = pat9125_rd_reg(PAT9125_DELTA_YL); 38534: 84 e0 ldi r24, 0x04 ; 4 38536: 0f 94 29 c2 call 0x38452 ; 0x38452 3853a: c8 2f mov r28, r24 uint16_t ucXYH = pat9125_rd_reg(PAT9125_DELTA_XYH); 3853c: 82 e1 ldi r24, 0x12 ; 18 3853e: 0f 94 29 c2 call 0x38452 ; 0x38452 if (pat9125_PID1 == 0xff) return 0; 38542: 90 91 bd 0d lds r25, 0x0DBD ; 0x800dbd 38546: 9f 3f cpi r25, 0xFF ; 255 38548: a9 f2 breq .-86 ; 0x384f4 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); 3854a: 90 e0 ldi r25, 0x00 ; 0 if (pat9125_PID1 == 0xff) return 0; int16_t iDX = ucXL | ((ucXYH << 4) & 0xf00); 3854c: 9c 01 movw r18, r24 3854e: 44 e0 ldi r20, 0x04 ; 4 38550: 22 0f add r18, r18 38552: 33 1f adc r19, r19 38554: 4a 95 dec r20 38556: e1 f7 brne .-8 ; 0x38550 38558: 22 27 eor r18, r18 3855a: 3f 70 andi r19, 0x0F ; 15 3855c: 2d 2b or r18, r29 int16_t iDY = ucYL | ((ucXYH << 8) & 0xf00); 3855e: 98 2f mov r25, r24 38560: 88 27 eor r24, r24 38562: 88 27 eor r24, r24 38564: 9f 70 andi r25, 0x0F ; 15 38566: 8c 2b or r24, r28 if (iDX & 0x800) iDX -= 4096; 38568: 33 fd sbrc r19, 3 3856a: 30 51 subi r19, 0x10 ; 16 if (iDY & 0x800) iDY -= 4096; 3856c: 93 fd sbrc r25, 3 3856e: 90 51 subi r25, 0x10 ; 16 pat9125_x += iDX; 38570: 40 91 97 03 lds r20, 0x0397 ; 0x800397 38574: 50 91 98 03 lds r21, 0x0398 ; 0x800398 38578: 24 0f add r18, r20 3857a: 35 1f adc r19, r21 3857c: 30 93 98 03 sts 0x0398, r19 ; 0x800398 38580: 20 93 97 03 sts 0x0397, r18 ; 0x800397 pat9125_y += iDY; 38584: 20 91 8f 0e lds r18, 0x0E8F ; 0x800e8f 38588: 30 91 90 0e lds r19, 0x0E90 ; 0x800e90 3858c: 82 0f add r24, r18 3858e: 93 1f adc r25, r19 38590: 90 93 90 0e sts 0x0E90, r25 ; 0x800e90 38594: 80 93 8f 0e sts 0x0E8F, r24 ; 0x800e8f } return 1; 38598: 81 e0 ldi r24, 0x01 ; 1 3859a: ad cf rjmp .-166 ; 0x384f6 0003859c : extern "C" { #endif //defined(__cplusplus) static inline void spi_init() { DDRB &= ~((1 << DD_SCK) | (1 << DD_MOSI) | (1 << DD_MISO)); 3859c: 84 b1 in r24, 0x04 ; 4 3859e: 81 7f andi r24, 0xF1 ; 241 385a0: 84 b9 out 0x04, r24 ; 4 DDRB |= (1 << DD_SS) | (1 << DD_SCK) | (1 << DD_MOSI); 385a2: 84 b1 in r24, 0x04 ; 4 385a4: 87 60 ori r24, 0x07 ; 7 385a6: 84 b9 out 0x04, r24 ; 4 PORTB &= ~((1 << DD_SCK) | (1 << DD_MOSI) | (1 << DD_MISO)); 385a8: 85 b1 in r24, 0x05 ; 5 385aa: 81 7f andi r24, 0xF1 ; 241 385ac: 85 b9 out 0x05, r24 ; 5 PORTB |= (1 << DD_SS); 385ae: 28 9a sbi 0x05, 0 ; 5 SPCR = SPI_SPCR(0, 0, 0, 1, 0); //SPE=1, MSTR=1 (0x50) 385b0: 80 e5 ldi r24, 0x50 ; 80 385b2: 8c bd out 0x2c, r24 ; 44 SPSR = 0x00; 385b4: 1d bc out 0x2d, r1 ; 45 } 385b6: 08 95 ret 000385b8 : //! @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() { 385b8: 2f 92 push r2 385ba: 3f 92 push r3 385bc: 4f 92 push r4 385be: 5f 92 push r5 385c0: 6f 92 push r6 385c2: 7f 92 push r7 385c4: 8f 92 push r8 385c6: 9f 92 push r9 385c8: af 92 push r10 385ca: bf 92 push r11 385cc: cf 92 push r12 385ce: df 92 push r13 385d0: ef 92 push r14 385d2: ff 92 push r15 385d4: 0f 93 push r16 385d6: 1f 93 push r17 385d8: cf 93 push r28 385da: df 93 push r29 385dc: cd b7 in r28, 0x3d ; 61 385de: de b7 in r29, 0x3e ; 62 385e0: c6 50 subi r28, 0x06 ; 6 385e2: d1 40 sbci r29, 0x01 ; 1 385e4: 0f b6 in r0, 0x3f ; 63 385e6: f8 94 cli 385e8: de bf out 0x3e, r29 ; 62 385ea: 0f be out 0x3f, r0 ; 63 385ec: 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; 385ee: 80 91 fc 1f lds r24, 0x1FFC ; 0x801ffc <__bss_end+0x7dc> 385f2: 90 91 fd 1f lds r25, 0x1FFD ; 0x801ffd <__bss_end+0x7dd> 385f6: a0 91 fe 1f lds r26, 0x1FFE ; 0x801ffe <__bss_end+0x7de> 385fa: b0 91 ff 1f lds r27, 0x1FFF ; 0x801fff <__bss_end+0x7df> 385fe: 8a 3a cpi r24, 0xAA ; 170 38600: 95 45 sbci r25, 0x55 ; 85 38602: aa 4a sbci r26, 0xAA ; 170 38604: b5 45 sbci r27, 0x55 ; 85 38606: 21 f4 brne .+8 ; 0x38610 38608: 80 91 fb 1f lds r24, 0x1FFB ; 0x801ffb <__bss_end+0x7db> 3860c: 87 fd sbrc r24, 7 3860e: c2 c1 rjmp .+900 ; 0x38994 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(); 38610: a8 95 wdr const char *ptr = entry_magic_send; const char *end = strlen_P(entry_magic_send) + ptr; const uint8_t selectedSerialPort_bak = selectedSerialPort; 38612: d0 90 39 05 lds r13, 0x0539 ; 0x800539 // Flush the serial line. while (RECV_READY) { 38616: 80 91 c0 00 lds r24, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> 3861a: 87 ff sbrs r24, 7 3861c: 04 c0 rjmp .+8 ; 0x38626 wdt_reset(); 3861e: a8 95 wdr // Dummy register read (discard) (void)(*(char *)UDR0); 38620: 80 91 c6 00 lds r24, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> 38624: f8 cf rjmp .-16 ; 0x38616 } selectedSerialPort = 0; //switch to Serial0 38626: 10 92 39 05 sts 0x0539, r1 ; 0x800539 // 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; 3862a: 00 91 9b 04 lds r16, 0x049B ; 0x80049b 3862e: 10 91 9c 04 lds r17, 0x049C ; 0x80049c 38632: 10 93 9a 04 sts 0x049A, r17 ; 0x80049a 38636: 00 93 99 04 sts 0x0499, r16 ; 0x800499 3863a: 51 e6 ldi r21, 0x61 ; 97 3863c: e5 2e mov r14, r21 3863e: 5d ea ldi r21, 0xAD ; 173 38640: f5 2e mov r15, r21 38642: 67 e6 ldi r22, 0x67 ; 103 38644: a6 2e mov r10, r22 38646: 6d ea ldi r22, 0xAD ; 173 38648: 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 ++)); 3864a: f7 01 movw r30, r14 3864c: 84 91 lpm r24, Z 3864e: 0f 94 38 ae call 0x35c70 ; 0x35c70 38652: ff ef ldi r31, 0xFF ; 255 38654: ef 1a sub r14, r31 38656: 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) 38658: ae 14 cp r10, r14 3865a: bf 04 cpc r11, r15 3865c: b1 f7 brne .-20 ; 0x3864a putch(pgm_read_byte(ptr ++)); wdt_reset(); 3865e: a8 95 wdr 38660: 8f e0 ldi r24, 0x0F ; 15 38662: 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) 38664: 20 e6 ldi r18, 0x60 ; 96 38666: 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(); 38668: 40 e8 ldi r20, 0x80 ; 128 3866a: 54 e8 ldi r21, 0x84 ; 132 3866c: 6e e1 ldi r22, 0x1E ; 30 3866e: 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) { 38670: e0 91 99 04 lds r30, 0x0499 ; 0x800499 38674: f0 91 9a 04 lds r31, 0x049A ; 0x80049a 38678: e0 17 cp r30, r16 3867a: f1 07 cpc r31, r17 3867c: 19 f5 brne .+70 ; 0x386c4 wdt_reset(); 3867e: a8 95 wdr 38680: 41 50 subi r20, 0x01 ; 1 38682: 51 09 sbc r21, r1 38684: 61 09 sbc r22, r1 38686: 71 09 sbc r23, r1 if ( --boot_timer == 0) { 38688: 99 f7 brne .-26 ; 0x38670 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 3868a: d0 92 39 05 sts 0x0539, r13 ; 0x800539 return 0; 3868e: 80 e0 ldi r24, 0x00 ; 0 // This covers the response to commands like STK_ENTER_PROGMODE verifySpace(); } putch(STK_OK); } } 38690: ca 5f subi r28, 0xFA ; 250 38692: de 4f sbci r29, 0xFE ; 254 38694: 0f b6 in r0, 0x3f ; 63 38696: f8 94 cli 38698: de bf out 0x3e, r29 ; 62 3869a: 0f be out 0x3f, r0 ; 63 3869c: cd bf out 0x3d, r28 ; 61 3869e: df 91 pop r29 386a0: cf 91 pop r28 386a2: 1f 91 pop r17 386a4: 0f 91 pop r16 386a6: ff 90 pop r15 386a8: ef 90 pop r14 386aa: df 90 pop r13 386ac: cf 90 pop r12 386ae: bf 90 pop r11 386b0: af 90 pop r10 386b2: 9f 90 pop r9 386b4: 8f 90 pop r8 386b6: 7f 90 pop r7 386b8: 6f 90 pop r6 386ba: 5f 90 pop r5 386bc: 4f 90 pop r4 386be: 3f 90 pop r3 386c0: 2f 90 pop r2 386c2: 08 95 ret // Timeout expired, continue with the application. selectedSerialPort = selectedSerialPort_bak; //revert Serial setting return 0; } } ch = rx_buffer.buffer[SerialHead]; 386c4: f8 01 movw r30, r16 386c6: e7 5e subi r30, 0xE7 ; 231 386c8: fb 4f sbci r31, 0xFB ; 251 386ca: 40 81 ld r20, Z SerialHead = (unsigned int)(SerialHead + 1) % RX_BUFFER_SIZE; 386cc: 0f 5f subi r16, 0xFF ; 255 386ce: 1f 4f sbci r17, 0xFF ; 255 386d0: 0f 77 andi r16, 0x7F ; 127 386d2: 11 27 eor r17, r17 if (pgm_read_byte(ptr ++) != ch) 386d4: f9 01 movw r30, r18 386d6: e8 1b sub r30, r24 386d8: f9 0b sbc r31, r25 386da: e4 91 lpm r30, Z 386dc: 4e 13 cpse r20, r30 386de: d5 cf rjmp .-86 ; 0x3868a { // Magic was not received correctly, continue with the application selectedSerialPort = selectedSerialPort_bak; //revert Serial setting return 0; } wdt_reset(); 386e0: a8 95 wdr 386e2: 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) { 386e4: 09 f0 breq .+2 ; 0x386e8 386e6: c0 cf rjmp .-128 ; 0x38668 selectedSerialPort = selectedSerialPort_bak; //revert Serial setting return 0; } wdt_reset(); } cbi(UCSR0B, RXCIE0); //disable the MarlinSerial0 interrupt 386e8: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 386ec: 8f 77 andi r24, 0x7F ; 127 386ee: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 386f2: 03 e4 ldi r16, 0x43 ; 67 386f4: 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 ++)); 386f6: f8 01 movw r30, r16 386f8: 84 91 lpm r24, Z 386fa: 0f 94 38 ae call 0x35c70 ; 0x35c70 386fe: 0f 5f subi r16, 0xFF ; 255 38700: 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) 38702: fd ea ldi r31, 0xAD ; 173 38704: 00 35 cpi r16, 0x50 ; 80 38706: 1f 07 cpc r17, r31 38708: b1 f7 brne .-20 ; 0x386f6 putch(pgm_read_byte(ptr ++)); } spi_init(); 3870a: 0f 94 ce c2 call 0x3859c ; 0x3859c xflash_init(); 3870e: 0e 94 17 ee call 0x1dc2e ; 0x1dc2e "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" ); 38712: 0f b6 in r0, 0x3f ; 63 38714: f8 94 cli 38716: a8 95 wdr 38718: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 3871c: 88 61 ori r24, 0x18 ; 24 3871e: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 38722: 10 92 60 00 sts 0x0060, r1 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 38726: 0f be out 0x3f, r0 ; 63 wdt_disable(); lcd_clear(); 38728: 0e 94 13 6f call 0xde26 ; 0xde26 lcd_puts_at_P(0, 1, PSTR(" Upgrading xflash\n Do not disconnect!")); 3872c: 4d e1 ldi r20, 0x1D ; 29 3872e: 5d ea ldi r21, 0xAD ; 173 38730: 61 e0 ldi r22, 0x01 ; 1 38732: 80 e0 ldi r24, 0x00 ; 0 38734: 0e 94 f4 6e call 0xdde8 ; 0xdde8 boot_app_magic = 0; //disable the bootapp if a watchdog reset is going to be used 38738: 10 92 fc 1f sts 0x1FFC, r1 ; 0x801ffc <__bss_end+0x7dc> 3873c: 10 92 fd 1f sts 0x1FFD, r1 ; 0x801ffd <__bss_end+0x7dd> 38740: 10 92 fe 1f sts 0x1FFE, r1 ; 0x801ffe <__bss_end+0x7de> 38744: 10 92 ff 1f sts 0x1FFF, r1 ; 0x801fff <__bss_end+0x7df> 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; 38748: cb 5f subi r28, 0xFB ; 251 3874a: de 4f sbci r29, 0xFE ; 254 3874c: 18 82 st Y, r1 3874e: c5 50 subi r28, 0x05 ; 5 38750: 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; 38752: 10 e0 ldi r17, 0x00 ; 0 38754: 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; 38756: 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); 38758: ae 01 movw r20, r28 3875a: 4f 5f subi r20, 0xFF ; 255 3875c: 5f 4f sbci r21, 0xFF ; 255 3875e: 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(); 38760: 0f 94 3f ae call 0x35c7e ; 0x35c7e if(ch == STK_GET_PARAMETER) { 38764: 81 34 cpi r24, 0x41 ; 65 38766: a9 f4 brne .+42 ; 0x38792 unsigned char which = getch(); 38768: 0f 94 3f ae call 0x35c7e ; 0x35c7e 3876c: e8 2e mov r14, r24 verifySpace(); 3876e: 0f 94 b7 b0 call 0x3616e ; 0x3616e /* * Send optiboot version as "SW version" * Note that the references to memory are optimized away. */ if (which == STK_SW_MINOR) { 38772: 52 e8 ldi r21, 0x82 ; 130 putch(optiboot_version & 0xFF); 38774: 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) { 38776: e5 16 cp r14, r21 38778: 21 f0 breq .+8 ; 0x38782 putch(optiboot_version & 0xFF); } else if (which == STK_SW_MAJOR) { 3877a: 81 e8 ldi r24, 0x81 ; 129 3877c: e8 12 cpse r14, r24 3877e: 07 c0 rjmp .+14 ; 0x3878e putch(optiboot_version >> 8); 38780: 86 e0 ldi r24, 0x06 ; 6 38782: 0f 94 38 ae call 0x35c70 ; 0x35c70 } else { // This covers the response to commands like STK_ENTER_PROGMODE verifySpace(); } putch(STK_OK); 38786: 80 e1 ldi r24, 0x10 ; 16 38788: 0f 94 38 ae call 0x35c70 ; 0x35c70 3878c: e9 cf rjmp .-46 ; 0x38760 } else { /* * GET PARAMETER returns a generic 0x03 reply for * other parameters - enough to keep Avrdude happy */ putch(0x03); 3878e: 83 e0 ldi r24, 0x03 ; 3 38790: f8 cf rjmp .-16 ; 0x38782 } } else if(ch == STK_SET_DEVICE) { 38792: 82 34 cpi r24, 0x42 ; 66 38794: 21 f4 brne .+8 ; 0x3879e // SET DEVICE is ignored getNch(20); 38796: 84 e1 ldi r24, 0x14 ; 20 } else if(ch == STK_SET_DEVICE_EXT) { // SET DEVICE EXT is ignored getNch(5); 38798: 0f 94 c3 b0 call 0x36186 ; 0x36186 3879c: f4 cf rjmp .-24 ; 0x38786 } else if(ch == STK_SET_DEVICE) { // SET DEVICE is ignored getNch(20); } else if(ch == STK_SET_DEVICE_EXT) { 3879e: 85 34 cpi r24, 0x45 ; 69 387a0: 11 f4 brne .+4 ; 0x387a6 // SET DEVICE EXT is ignored getNch(5); 387a2: 85 e0 ldi r24, 0x05 ; 5 387a4: f9 cf rjmp .-14 ; 0x38798 } else if(ch == STK_LOAD_ADDRESS) { 387a6: 85 35 cpi r24, 0x55 ; 85 387a8: c9 f4 brne .+50 ; 0x387dc // 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(); 387aa: 0f 94 3f ae call 0x35c7e ; 0x35c7e 387ae: 08 2f mov r16, r24 newAddress |= getch(); 387b0: 0f 94 3f ae call 0x35c7e ; 0x35c7e 387b4: 08 2b or r16, r24 387b6: 10 e0 ldi r17, 0x00 ; 0 newAddress |= (((uint16_t)getch()) << 8); 387b8: 0f 94 3f ae call 0x35c7e ; 0x35c7e 387bc: 18 2b or r17, r24 newAddress |= (((uint16_t)getch()) << 8); 387be: 0f 94 3f ae call 0x35c7e ; 0x35c7e 387c2: 18 2b or r17, r24 // Transfer top bit to LSB in rampz if (newAddress & 0x8000) 387c4: 17 ff sbrs r17, 7 387c6: 07 c0 rjmp .+14 ; 0x387d6 rampz |= 0x01; 387c8: 68 94 set 387ca: f0 f8 bld r15, 0 else rampz &= 0xFE; newAddress += newAddress; // Convert from word address to byte address 387cc: 00 0f add r16, r16 387ce: 11 1f adc r17, r17 wdt_enable(WATCHDOG_SOFT_RESET_VALUE); verifySpace(); } else { // This covers the response to commands like STK_ENTER_PROGMODE verifySpace(); 387d0: 0f 94 b7 b0 call 0x3616e ; 0x3616e 387d4: d8 cf rjmp .-80 ; 0x38786 newAddress |= (((uint16_t)getch()) << 8); // Transfer top bit to LSB in rampz if (newAddress & 0x8000) rampz |= 0x01; else rampz &= 0xFE; 387d6: e8 94 clt 387d8: f0 f8 bld r15, 0 387da: f8 cf rjmp .-16 ; 0x387cc newAddress += newAddress; // Convert from word address to byte address address = newAddress; verifySpace(); } else if(ch == STK_UNIVERSAL) { 387dc: 86 35 cpi r24, 0x56 ; 86 387de: a1 f4 brne .+40 ; 0x38808 // LOAD_EXTENDED_ADDRESS is needed in STK_UNIVERSAL for addressing more than 128kB if ( AVR_OP_LOAD_EXT_ADDR == getch() ) { 387e0: 0f 94 3f ae call 0x35c7e ; 0x35c7e 387e4: 8d 34 cpi r24, 0x4D ; 77 387e6: 71 f4 brne .+28 ; 0x38804 // get address getch(); // get '0' 387e8: 0f 94 3f ae call 0x35c7e ; 0x35c7e rampz = (rampz & 0x01) | ((getch() << 1) & 0xff); // get address and put it in rampz 387ec: 0f 94 3f ae call 0x35c7e ; 0x35c7e 387f0: 9f 2d mov r25, r15 387f2: 91 70 andi r25, 0x01 ; 1 387f4: f9 2e mov r15, r25 387f6: 88 0f add r24, r24 387f8: f8 2a or r15, r24 getNch(1); // get last '0' 387fa: 81 e0 ldi r24, 0x01 ; 1 // response putch(0x00); } else { // everything else is ignored getNch(3); 387fc: 0f 94 c3 b0 call 0x36186 ; 0x36186 putch(0x00); 38800: 80 e0 ldi r24, 0x00 ; 0 38802: bf cf rjmp .-130 ; 0x38782 // response putch(0x00); } else { // everything else is ignored getNch(3); 38804: 83 e0 ldi r24, 0x03 ; 3 38806: fa cf rjmp .-12 ; 0x387fc putch(0x00); } } /* Write memory, length is big endian and is in bytes */ else if(ch == STK_PROG_PAGE) { 38808: 84 36 cpi r24, 0x64 ; 100 3880a: 09 f0 breq .+2 ; 0x3880e 3880c: 77 c0 rjmp .+238 ; 0x388fc 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; 3880e: 0f 94 3f ae call 0x35c7e ; 0x35c7e 38812: b8 2e mov r11, r24 length |= ((pagelen_t)getch()) << 8; 38814: 0f 94 3f ae call 0x35c7e ; 0x35c7e 38818: c8 2e mov r12, r24 length |= getch(); 3881a: 0f 94 3f ae call 0x35c7e ; 0x35c7e 3881e: e8 2e mov r14, r24 length |= getch(); 38820: 0f 94 3f ae call 0x35c7e ; 0x35c7e 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; 38824: d1 2c mov r13, r1 38826: dc 2c mov r13, r12 38828: cc 24 eor r12, r12 3882a: db 28 or r13, r11 length |= getch(); length |= getch(); 3882c: 8e 29 or r24, r14 3882e: c8 2a or r12, r24 savelength = length; // Read the destination type. It should always be 'F' as flash. desttype = getch(); 38830: 0f 94 3f ae call 0x35c7e ; 0x35c7e 38834: 58 2e mov r5, r24 38836: fe 01 movw r30, r28 38838: 31 96 adiw r30, 0x01 ; 1 3883a: 5f 01 movw r10, r30 3883c: 46 01 movw r8, r12 3883e: 8e 0e add r8, r30 38840: 9f 1e adc r9, r31 38842: ee 2e mov r14, r30 38844: ca 5f subi r28, 0xFA ; 250 38846: de 4f sbci r29, 0xFE ; 254 38848: b8 82 st Y, r11 3884a: c6 50 subi r28, 0x06 ; 6 3884c: d1 40 sbci r29, 0x01 ; 1 // read a page worth of contents bufPtr = buff; do *bufPtr++ = getch(); 3884e: 0f 94 3f ae call 0x35c7e ; 0x35c7e 38852: f5 01 movw r30, r10 38854: 81 93 st Z+, r24 38856: 5f 01 movw r10, r30 while (--length); 38858: 8e 16 cp r8, r30 3885a: 9f 06 cpc r9, r31 3885c: c1 f7 brne .-16 ; 0x3884e // Read command terminator, start reply verifySpace(); 3885e: 0f 94 b7 b0 call 0x3616e ; 0x3616e if (desttype == 'E') { 38862: f5 e4 ldi r31, 0x45 ; 69 38864: 5f 12 cpse r5, r31 38866: 01 c0 rjmp .+2 ; 0x3886a 38868: ff cf rjmp .-2 ; 0x38868 while (1) ; // Error: wait for WDT } else { uint32_t addr = (((uint32_t)rampz) << 16) | address; 3886a: 18 01 movw r2, r16 3886c: 51 2c mov r5, r1 3886e: 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) { 38870: 01 15 cp r16, r1 38872: 11 05 cpc r17, r1 38874: 61 f5 brne .+88 ; 0x388ce 38876: 42 01 movw r8, r4 38878: aa 24 eor r10, r10 3887a: bb 24 eor r11, r11 3887c: cb 5f subi r28, 0xFB ; 251 3887e: de 4f sbci r29, 0xFE ; 254 38880: 28 81 ld r18, Y 38882: c5 50 subi r28, 0x05 ; 5 38884: d1 40 sbci r29, 0x01 ; 1 38886: 82 2f mov r24, r18 38888: 90 e0 ldi r25, 0x00 ; 0 3888a: 08 2c mov r0, r8 3888c: 02 c0 rjmp .+4 ; 0x38892 3888e: 95 95 asr r25 38890: 87 95 ror r24 38892: 0a 94 dec r0 38894: e2 f7 brpl .-8 ; 0x3888e 38896: 80 fd sbrc r24, 0 38898: 1a c0 rjmp .+52 ; 0x388ce xflash_wait_busy(); 3889a: 0e 94 a4 ec call 0x1d948 ; 0x1d948 xflash_enable_wr(); 3889e: 0e 94 40 ed call 0x1da80 ; 0x1da80 return xflash_erase(_CMD_BLOCK32_ERASE, addr); } void xflash_block64_erase(uint32_t addr) { return xflash_erase(_CMD_BLOCK64_ERASE, addr); 388a2: b2 01 movw r22, r4 388a4: a8 01 movw r20, r16 388a6: 88 ed ldi r24, 0xD8 ; 216 388a8: 0e 94 c2 ec call 0x1d984 ; 0x1d984 xflash_block64_erase(addr); pages_erased |= (1 << (addr >> 16)); 388ac: 81 e0 ldi r24, 0x01 ; 1 388ae: 90 e0 ldi r25, 0x00 ; 0 388b0: 01 c0 rjmp .+2 ; 0x388b4 388b2: 88 0f add r24, r24 388b4: 8a 94 dec r8 388b6: ea f7 brpl .-6 ; 0x388b2 388b8: cb 5f subi r28, 0xFB ; 251 388ba: de 4f sbci r29, 0xFE ; 254 388bc: 48 81 ld r20, Y 388be: c5 50 subi r28, 0x05 ; 5 388c0: d1 40 sbci r29, 0x01 ; 1 388c2: 48 2b or r20, r24 388c4: cb 5f subi r28, 0xFB ; 251 388c6: de 4f sbci r29, 0xFE ; 254 388c8: 48 83 st Y, r20 388ca: c5 50 subi r28, 0x05 ; 5 388cc: d1 40 sbci r29, 0x01 ; 1 } xflash_wait_busy(); 388ce: 0e 94 a4 ec call 0x1d948 ; 0x1d948 xflash_enable_wr(); 388d2: 0e 94 40 ed call 0x1da80 ; 0x1da80 xflash_page_program(addr, buff, savelength); 388d6: 96 01 movw r18, r12 388d8: 4e 2d mov r20, r14 388da: ca 5f subi r28, 0xFA ; 250 388dc: de 4f sbci r29, 0xFE ; 254 388de: 58 81 ld r21, Y 388e0: c6 50 subi r28, 0x06 ; 6 388e2: d1 40 sbci r29, 0x01 ; 1 388e4: c2 01 movw r24, r4 388e6: b1 01 movw r22, r2 388e8: 0e 94 c7 ec call 0x1d98e ; 0x1d98e xflash_wait_busy(); 388ec: 0e 94 a4 ec call 0x1d948 ; 0x1d948 _CS_HIGH(); } void xflash_disable_wr(void) { _CS_LOW(); 388f0: 45 98 cbi 0x08, 5 ; 8 _SPI_TX(_CMD_DISABLE_WR); // send command 0x04 388f2: 84 e0 ldi r24, 0x04 ; 4 388f4: 0e 94 9e ec call 0x1d93c ; 0x1d93c _CS_HIGH(); 388f8: 45 9a sbi 0x08, 5 ; 8 388fa: 45 cf rjmp .-374 ; 0x38786 xflash_disable_wr(); } } /* Read memory block mode, length is big endian. */ else if(ch == STK_READ_PAGE) { 388fc: 84 37 cpi r24, 0x74 ; 116 388fe: 81 f5 brne .+96 ; 0x38960 uint32_t addr = (((uint32_t)rampz) << 16) | address; 38900: b1 2c mov r11, r1 38902: 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; 38904: 0f 94 3f ae call 0x35c7e ; 0x35c7e 38908: d8 2e mov r13, r24 length |= ((pagelen_t)getch()) << 8; 3890a: 0f 94 3f ae call 0x35c7e ; 0x35c7e 3890e: c8 2e mov r12, r24 length |= getch(); 38910: 0f 94 3f ae call 0x35c7e ; 0x35c7e 38914: e8 2e mov r14, r24 length |= getch(); 38916: 0f 94 3f ae call 0x35c7e ; 0x35c7e 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; 3891a: 2c 2d mov r18, r12 3891c: 30 e0 ldi r19, 0x00 ; 0 3891e: 32 2f mov r19, r18 38920: 22 27 eor r18, r18 38922: f9 01 movw r30, r18 38924: fd 29 or r31, r13 38926: 6f 01 movw r12, r30 length |= getch(); length |= getch(); 38928: 8e 29 or r24, r14 3892a: c8 2a or r12, r24 // Read the destination type. It should always be 'F' as flash. It is not checked. (void)getch(); 3892c: 0f 94 3f ae call 0x35c7e ; 0x35c7e verifySpace(); 38930: 0f 94 b7 b0 call 0x3616e ; 0x3616e xflash_wait_busy(); 38934: 0e 94 a4 ec call 0x1d948 ; 0x1d948 xflash_rd_data(addr, buff, length); 38938: 96 01 movw r18, r12 3893a: a3 01 movw r20, r6 3893c: c5 01 movw r24, r10 3893e: b8 01 movw r22, r16 38940: 0e 94 e7 ec call 0x1d9ce ; 0x1d9ce 38944: 53 01 movw r10, r6 for (i = 0; i < length; ++ i) 38946: c5 01 movw r24, r10 38948: 86 19 sub r24, r6 3894a: 97 09 sbc r25, r7 3894c: 8c 15 cp r24, r12 3894e: 9d 05 cpc r25, r13 38950: 08 f0 brcs .+2 ; 0x38954 38952: 19 cf rjmp .-462 ; 0x38786 putch(buff[i]); 38954: f5 01 movw r30, r10 38956: 81 91 ld r24, Z+ 38958: 5f 01 movw r10, r30 3895a: 0f 94 38 ae call 0x35c70 ; 0x35c70 3895e: f3 cf rjmp .-26 ; 0x38946 } /* Get device signature bytes */ else if(ch == STK_READ_SIGN) { 38960: 85 37 cpi r24, 0x75 ; 117 38962: 51 f4 brne .+20 ; 0x38978 // READ SIGN - return what Avrdude wants to hear verifySpace(); 38964: 0f 94 b7 b0 call 0x3616e ; 0x3616e putch(XFLASH_SIGNATURE_0); 38968: 8e e1 ldi r24, 0x1E ; 30 3896a: 0f 94 38 ae call 0x35c70 ; 0x35c70 putch(XFLASH_SIGNATURE_1); 3896e: 88 e9 ldi r24, 0x98 ; 152 38970: 0f 94 38 ae call 0x35c70 ; 0x35c70 putch(XFLASH_SIGNATURE_2); 38974: 81 e0 ldi r24, 0x01 ; 1 38976: 05 cf rjmp .-502 ; 0x38782 } else if (ch == STK_LEAVE_PROGMODE) { /* 'Q' */ 38978: 81 35 cpi r24, 0x51 ; 81 3897a: 09 f0 breq .+2 ; 0x3897e 3897c: 29 cf rjmp .-430 ; 0x387d0 : "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" ); 3897e: f8 e1 ldi r31, 0x18 ; 24 38980: 28 e0 ldi r18, 0x08 ; 8 38982: 0f b6 in r0, 0x3f ; 63 38984: f8 94 cli 38986: a8 95 wdr 38988: f0 93 60 00 sts 0x0060, r31 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 3898c: 0f be out 0x3f, r0 ; 63 3898e: 20 93 60 00 sts 0x0060, r18 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 38992: 1e cf rjmp .-452 ; 0x387d0 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; 38994: 81 e0 ldi r24, 0x01 ; 1 38996: 7c ce rjmp .-776 ; 0x38690 00038998 : void FullScreenMsgRestoringTemperature(){ lcd_display_message_fullscreen_P(_T(MSG_MMU_RESTORE_TEMP)); } void ScreenUpdateEnable(){ lcd_update_enable(true); 38998: 81 e0 ldi r24, 0x01 ; 1 3899a: 0c 94 25 6f jmp 0xde4a ; 0xde4a 0003899e : void MakeSound(SoundType s){ Sound_MakeSound( (eSOUND_TYPE)s); } static void FullScreenMsg(const char *pgmS, uint8_t slot){ 3899e: 0f 93 push r16 389a0: 1f 93 push r17 389a2: cf 93 push r28 389a4: 8c 01 movw r16, r24 389a6: c6 2f mov r28, r22 lcd_update_enable(false); 389a8: 80 e0 ldi r24, 0x00 ; 0 389aa: 0e 94 25 6f call 0xde4a ; 0xde4a lcd_clear(); 389ae: 0e 94 13 6f call 0xde26 ; 0xde26 lcd_puts_at_P(0, 1, pgmS); 389b2: a8 01 movw r20, r16 389b4: 61 e0 ldi r22, 0x01 ; 1 389b6: 80 e0 ldi r24, 0x00 ; 0 389b8: 0e 94 f4 6e call 0xdde8 ; 0xdde8 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 389bc: 80 e2 ldi r24, 0x20 ; 32 389be: 0e 94 8f 6f call 0xdf1e ; 0xdf1e lcd_print(' '); lcd_print(slot + 1); 389c2: 6c 2f mov r22, r28 389c4: 70 e0 ldi r23, 0x00 ; 0 389c6: 6f 5f subi r22, 0xFF ; 255 389c8: 7f 4f sbci r23, 0xFF ; 255 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); 389ca: 07 2e mov r0, r23 389cc: 00 0c add r0, r0 389ce: 88 0b sbc r24, r24 389d0: 99 0b sbc r25, r25 } 389d2: cf 91 pop r28 389d4: 1f 91 pop r17 389d6: 0f 91 pop r16 389d8: 0c 94 99 70 jmp 0xe132 ; 0xe132 000389dc : 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); 389dc: 82 ed ldi r24, 0xD2 ; 210 389de: 9e e0 ldi r25, 0x0E ; 14 389e0: 0e 94 28 76 call 0xec50 ; 0xec50 eeprom_increment_word((uint16_t *)EEPROM_MMU_FAIL_TOT); 389e4: 83 ed ldi r24, 0xD3 ; 211 389e6: 9e e0 ldi r25, 0x0E ; 14 389e8: 0c 94 1b 76 jmp 0xec36 ; 0xec36 000389ec : inline bool Running() const { return state == State::Running; } inline bool FindaPressed() const { return regs8[0]; 389ec: 41 e0 ldi r20, 0x01 ; 1 389ee: 80 91 90 13 lds r24, 0x1390 ; 0x801390 389f2: 81 11 cpse r24, r1 389f4: 01 c0 rjmp .+2 ; 0x389f8 389f6: 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'); 389f8: 40 5d subi r20, 0xD0 ; 208 389fa: 62 e0 ldi r22, 0x02 ; 2 389fc: 83 e0 ldi r24, 0x03 ; 3 389fe: 0e 94 00 6f call 0xde00 ; 0xde00 class PAT9125_sensor: public Filament_sensor { public: void init(); void deinit(); bool update(); bool getFilamentPresent() const { return filterFilPresent; } 38a02: 41 e0 ldi r20, 0x01 ; 1 38a04: 80 91 b7 17 lds r24, 0x17B7 ; 0x8017b7 38a08: 81 11 cpse r24, r1 38a0a: 01 c0 rjmp .+2 ; 0x38a0e 38a0c: 40 e0 ldi r20, 0x00 ; 0 lcd_putc_at(8, 2, fsensor.getFilamentPresent() + '0'); 38a0e: 40 5d subi r20, 0xD0 ; 208 38a10: 62 e0 ldi r22, 0x02 ; 2 38a12: 88 e0 ldi r24, 0x08 ; 8 38a14: 0e 94 00 6f call 0xde00 ; 0xde00 // print active/changing filament slot lcd_set_cursor(10, 2); 38a18: 62 e0 ldi r22, 0x02 ; 2 38a1a: 8a e0 ldi r24, 0x0A ; 10 38a1c: 0e 94 e0 6e call 0xddc0 ; 0xddc0 lcdui_print_extruder(); 38a20: 0f 94 48 21 call 0x24290 ; 0x24290 // Print active extruder temperature lcd_set_cursor(16, 2); 38a24: 62 e0 ldi r22, 0x02 ; 2 38a26: 80 e1 ldi r24, 0x10 ; 16 38a28: 0e 94 e0 6e call 0xddc0 ; 0xddc0 lcd_printf_P(PSTR("%3d"), (int)(degHotend(0) + 0.5)); 38a2c: 20 e0 ldi r18, 0x00 ; 0 38a2e: 30 e0 ldi r19, 0x00 ; 0 38a30: 40 e0 ldi r20, 0x00 ; 0 38a32: 5f e3 ldi r21, 0x3F ; 63 38a34: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 38a38: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 38a3c: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 38a40: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 38a44: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 38a48: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> 38a4c: 7f 93 push r23 38a4e: 6f 93 push r22 38a50: 8b e0 ldi r24, 0x0B ; 11 38a52: 9c ea ldi r25, 0xAC ; 172 38a54: 9f 93 push r25 38a56: 8f 93 push r24 38a58: 0e 94 b9 6e call 0xdd72 ; 0xdd72 38a5c: 0f 90 pop r0 38a5e: 0f 90 pop r0 38a60: 0f 90 pop r0 38a62: 0f 90 pop r0 } 38a64: 08 95 ret 00038a66 : return 0; } } static constexpr uint8_t Nibble2Char(uint8_t n) { switch (n) { 38a66: 8a 30 cpi r24, 0x0A ; 10 38a68: 20 f0 brcs .+8 ; 0x38a72 38a6a: 80 31 cpi r24, 0x10 ; 16 38a6c: 20 f4 brcc .+8 ; 0x38a76 case 0xb: case 0xc: case 0xd: case 0xe: case 0xf: return n - 10 + 'a'; 38a6e: 89 5a subi r24, 0xA9 ; 169 38a70: 08 95 ret case 5: case 6: case 7: case 8: case 9: return n + '0'; 38a72: 80 5d subi r24, 0xD0 ; 208 38a74: 08 95 ret case 0xd: case 0xe: case 0xf: return n - 10 + 'a'; default: return 0; 38a76: 80 e0 ldi r24, 0x00 ; 0 } } 38a78: 08 95 ret 00038a7a : i += AppendCRC(rsp.CRC(), txbuff + i); txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { 38a7a: 0f 93 push r16 38a7c: 1f 93 push r17 38a7e: cf 93 push r28 38a80: df 93 push r29 38a82: 08 2f mov r16, r24 38a84: eb 01 movw r28, r22 if (value == 0) { *dst = '0'; return 1; } uint8_t v = value >> 4U; 38a86: 90 e0 ldi r25, 0x00 ; 0 38a88: 24 e0 ldi r18, 0x04 ; 4 38a8a: 95 95 asr r25 38a8c: 87 95 ror r24 38a8e: 2a 95 dec r18 38a90: e1 f7 brne .-8 ; 0x38a8a uint8_t charsOut = 1; 38a92: 11 e0 ldi r17, 0x01 ; 1 if (v != 0) { // skip the first '0' if any 38a94: 00 97 sbiw r24, 0x00 ; 0 38a96: 21 f0 breq .+8 ; 0x38aa0 *dst = Nibble2Char(v); 38a98: 0f 94 33 c5 call 0x38a66 ; 0x38a66 38a9c: 89 93 st Y+, r24 ++dst; charsOut = 2; 38a9e: 12 e0 ldi r17, 0x02 ; 2 } v = value & 0xfU; *dst = Nibble2Char(v); 38aa0: 80 2f mov r24, r16 38aa2: 8f 70 andi r24, 0x0F ; 15 38aa4: 0f 94 33 c5 call 0x38a66 ; 0x38a66 38aa8: 88 83 st Y, r24 return charsOut; } 38aaa: 81 2f mov r24, r17 38aac: df 91 pop r29 38aae: cf 91 pop r28 38ab0: 1f 91 pop r17 38ab2: 0f 91 pop r16 38ab4: 08 95 ret 00038ab6 : } 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) { 38ab6: 80 33 cpi r24, 0x30 ; 48 38ab8: 30 f0 brcs .+12 ; 0x38ac6 38aba: 8a 33 cpi r24, 0x3A ; 58 38abc: 30 f0 brcs .+12 ; 0x38aca 38abe: 9f e9 ldi r25, 0x9F ; 159 38ac0: 98 0f add r25, r24 38ac2: 96 30 cpi r25, 0x06 ; 6 38ac4: 20 f0 brcs .+8 ; 0x38ace case 'd': case 'e': case 'f': return c - 'a' + 10; default: return 0; 38ac6: 80 e0 ldi r24, 0x00 ; 0 } } 38ac8: 08 95 ret case '5': case '6': case '7': case '8': case '9': return c - '0'; 38aca: 80 53 subi r24, 0x30 ; 48 38acc: 08 95 ret case 'b': case 'c': case 'd': case 'e': case 'f': return c - 'a' + 10; 38ace: 87 55 subi r24, 0x57 ; 87 38ad0: 08 95 ret 00038ad2 : /// 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 { 38ad2: cf 93 push r28 38ad4: df 93 push r29 38ad6: ec 01 movw r28, r24 uint8_t crc = 0; crc = modules::crc::CRC8::CCITT_updateCX(0, (uint8_t)code); 38ad8: 68 81 ld r22, Y 38ada: 80 e0 ldi r24, 0x00 ; 0 38adc: 0f 94 4b ae call 0x35c96 ; 0x35c96 crc = modules::crc::CRC8::CCITT_updateCX(crc, value); 38ae0: 69 81 ldd r22, Y+1 ; 0x01 38ae2: 0f 94 4b ae call 0x35c96 ; 0x35c96 crc = modules::crc::CRC8::CCITT_updateW(crc, value2); 38ae6: 6a 81 ldd r22, Y+2 ; 0x02 38ae8: 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]); 38aea: 0f 94 4b ae call 0x35c96 ; 0x35c96 38aee: 6c 2f mov r22, r28 return crc; } 38af0: df 91 pop r29 38af2: cf 91 pop r28 38af4: 0d 94 4b ae jmp 0x35c96 ; 0x35c96 00038af8 : 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 { 38af8: cf 93 push r28 38afa: df 93 push r29 38afc: ec 01 movw r28, r24 uint8_t crc = request.ComputeCRC8(); 38afe: 0f 94 69 c5 call 0x38ad2 ; 0x38ad2 crc = modules::crc::CRC8::CCITT_updateCX(crc, (uint8_t)paramCode); 38b02: 6d 81 ldd r22, Y+5 ; 0x05 38b04: 0f 94 4b ae call 0x35c96 ; 0x35c96 crc = modules::crc::CRC8::CCITT_updateW(crc, paramValue); 38b08: 6e 81 ldd r22, Y+6 ; 0x06 38b0a: cf 81 ldd r28, Y+7 ; 0x07 38b0c: 0f 94 4b ae call 0x35c96 ; 0x35c96 38b10: 6c 2f mov r22, r28 return crc; } 38b12: df 91 pop r29 38b14: cf 91 pop r28 38b16: 0d 94 4b ae jmp 0x35c96 ; 0x35c96 00038b1a : return crc; } /// @param code of the request message /// @param value of the request message inline constexpr RequestMsg(RequestMsgCodes code, uint8_t value) 38b1a: cf 93 push r28 38b1c: df 93 push r29 38b1e: ec 01 movw r28, r24 : code(code) , value(value) , value2(0) , crc8(ComputeCRC8()) { 38b20: 68 83 st Y, r22 38b22: 49 83 std Y+1, r20 ; 0x01 38b24: 1b 82 std Y+3, r1 ; 0x03 38b26: 1a 82 std Y+2, r1 ; 0x02 38b28: 0f 94 69 c5 call 0x38ad2 ; 0x38ad2 38b2c: 8c 83 std Y+4, r24 ; 0x04 } 38b2e: df 91 pop r29 38b30: cf 91 pop r28 38b32: 08 95 ret 00038b34 : void power_off() { } void reset() { #ifdef MMU_HWRESET // HW - pulse reset pin WRITE(MMU_RST_PIN, 0); 38b34: 9f b7 in r25, 0x3f ; 63 38b36: f8 94 cli 38b38: e5 e0 ldi r30, 0x05 ; 5 38b3a: f1 e0 ldi r31, 0x01 ; 1 38b3c: 80 81 ld r24, Z 38b3e: 8f 7d andi r24, 0xDF ; 223 38b40: 80 83 st Z, r24 38b42: 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); 38b44: 8f e8 ldi r24, 0x8F ; 143 38b46: 91 e0 ldi r25, 0x01 ; 1 38b48: 01 97 sbiw r24, 0x01 ; 1 38b4a: f1 f7 brne .-4 ; 0x38b48 38b4c: 00 c0 rjmp .+0 ; 0x38b4e 38b4e: 00 00 nop _delay_us(100); WRITE(MMU_RST_PIN, 1); 38b50: 9f b7 in r25, 0x3f ; 63 38b52: f8 94 cli 38b54: 80 81 ld r24, Z 38b56: 80 62 ori r24, 0x20 ; 32 38b58: 80 83 st Z, r24 38b5a: 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 } 38b5c: 08 95 ret 00038b5e : void Enable_E0() { enable_e0(); } void Disable_E0() { disable_e0(); 38b5e: 14 9a sbi 0x02, 4 ; 2 } 38b60: 08 95 ret 00038b62 : 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) { 38b62: cf 92 push r12 38b64: df 92 push r13 38b66: ef 92 push r14 38b68: ff 92 push r15 38b6a: cf 93 push r28 38b6c: df 93 push r29 38b6e: 69 01 movw r12, r18 38b70: 7a 01 movw r14, r20 current_position[E_AXIS] += delta; 38b72: c2 e9 ldi r28, 0x92 ; 146 38b74: d6 e0 ldi r29, 0x06 ; 6 38b76: 9b 01 movw r18, r22 38b78: ac 01 movw r20, r24 38b7a: 6c 85 ldd r22, Y+12 ; 0x0c 38b7c: 7d 85 ldd r23, Y+13 ; 0x0d 38b7e: 8e 85 ldd r24, Y+14 ; 0x0e 38b80: 9f 85 ldd r25, Y+15 ; 0x0f 38b82: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 38b86: 6c 87 std Y+12, r22 ; 0x0c 38b88: 7d 87 std Y+13, r23 ; 0x0d 38b8a: 8e 87 std Y+14, r24 ; 0x0e 38b8c: 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); 38b8e: c7 01 movw r24, r14 38b90: b6 01 movw r22, r12 } void extruder_move(float delta, float feedRate) { current_position[E_AXIS] += delta; planner_line_to_current_position(feedRate); } 38b92: df 91 pop r29 38b94: cf 91 pop r28 38b96: ff 90 pop r15 38b98: ef 90 pop r14 38b9a: df 90 pop r13 38b9c: 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); 38b9e: 0d 94 49 c0 jmp 0x38092 ; 0x38092 00038ba2 : st_synchronize(); } static inline void go_to_current(float fr) { plan_buffer_line_curposXYZE(fr); 38ba2: 0f 94 49 c0 call 0x38092 ; 0x38092 st_synchronize(); 38ba6: 0d 94 e8 42 jmp 0x285d0 ; 0x285d0 00038baa : #include "mmu2_log.h" namespace MMU2 { void LogErrorEvent_P(const char *msg){ 38baa: cf 93 push r28 38bac: df 93 push r29 38bae: ec 01 movw r28, r24 SERIAL_ECHO_START; //!@todo Decide MMU errors on serial line 38bb0: 82 ec ldi r24, 0xC2 ; 194 38bb2: 9b ea ldi r25, 0xAB ; 171 38bb4: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_MMU2(); 38bb8: 85 e0 ldi r24, 0x05 ; 5 38bba: 9c ea ldi r25, 0xAC ; 172 38bbc: 0e 94 50 77 call 0xeea0 ; 0xeea0 SERIAL_ECHOLNRPGM(msg); 38bc0: ce 01 movw r24, r28 } 38bc2: df 91 pop r29 38bc4: 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); 38bc6: 0c 94 7b 79 jmp 0xf2f6 ; 0xf2f6 00038bca : #include "Filament_sensor.h" namespace MMU2 { FilamentState WhereIsFilament(){ return fsensor.getFilamentPresent() ? FilamentState::AT_FSENSOR : FilamentState::NOT_PRESENT; 38bca: 81 e0 ldi r24, 0x01 ; 1 38bcc: 90 91 b7 17 lds r25, 0x17B7 ; 0x8017b7 38bd0: 91 11 cpse r25, r1 38bd2: 01 c0 rjmp .+2 ; 0x38bd6 38bd4: 80 e0 ldi r24, 0x00 ; 0 } 38bd6: 08 95 ret 00038bd8 : constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38bd8: 89 32 cpi r24, 0x29 ; 41 38bda: 20 e8 ldi r18, 0x80 ; 128 38bdc: 92 07 cpc r25, r18 38bde: 09 f4 brne .+2 ; 0x38be2 38be0: 97 c0 rjmp .+302 ; 0x38d10 38be2: 08 f0 brcs .+2 ; 0x38be6 38be4: 48 c0 rjmp .+144 ; 0x38c76 38be6: 86 30 cpi r24, 0x06 ; 6 38be8: 60 e8 ldi r22, 0x80 ; 128 38bea: 96 07 cpc r25, r22 38bec: 09 f4 brne .+2 ; 0x38bf0 38bee: 9a c0 rjmp .+308 ; 0x38d24 38bf0: 30 f5 brcc .+76 ; 0x38c3e 38bf2: 83 30 cpi r24, 0x03 ; 3 38bf4: 40 e8 ldi r20, 0x80 ; 128 38bf6: 94 07 cpc r25, r20 38bf8: 09 f4 brne .+2 ; 0x38bfc 38bfa: 80 c0 rjmp .+256 ; 0x38cfc 38bfc: a8 f4 brcc .+42 ; 0x38c28 38bfe: 81 30 cpi r24, 0x01 ; 1 38c00: 20 e8 ldi r18, 0x80 ; 128 38c02: 92 07 cpc r25, r18 38c04: 09 f4 brne .+2 ; 0x38c08 38c06: 17 c1 rjmp .+558 ; 0x38e36 38c08: 82 30 cpi r24, 0x02 ; 2 38c0a: 40 e8 ldi r20, 0x80 ; 128 38c0c: 94 07 cpc r25, r20 38c0e: 09 f4 brne .+2 ; 0x38c12 38c10: 73 c0 rjmp .+230 ; 0x38cf8 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); 38c12: 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)) { 38c14: 86 ff sbrs r24, 6 38c16: 8e c0 rjmp .+284 ; 0x38d34 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); 38c18: 22 27 eor r18, r18 38c1a: 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) { 38c1c: 21 15 cp r18, r1 38c1e: 32 4c sbci r19, 0xC2 ; 194 38c20: 09 f0 breq .+2 ; 0x38c24 38c22: 9e c0 rjmp .+316 ; 0x38d60 return FindErrorIndex(ERR_ELECTRICAL_MMU_PULLEY_SELFTEST_FAILED); 38c24: 8e e1 ldi r24, 0x1E ; 30 38c26: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38c28: 84 30 cpi r24, 0x04 ; 4 38c2a: 60 e8 ldi r22, 0x80 ; 128 38c2c: 96 07 cpc r25, r22 38c2e: 09 f4 brne .+2 ; 0x38c32 38c30: 67 c0 rjmp .+206 ; 0x38d00 38c32: 85 30 cpi r24, 0x05 ; 5 38c34: 20 e8 ldi r18, 0x80 ; 128 38c36: 92 07 cpc r25, r18 38c38: 61 f7 brne .-40 ; 0x38c12 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); 38c3a: 84 e2 ldi r24, 0x24 ; 36 38c3c: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38c3e: 8a 30 cpi r24, 0x0A ; 10 38c40: 40 e8 ldi r20, 0x80 ; 128 38c42: 94 07 cpc r25, r20 38c44: 09 f4 brne .+2 ; 0x38c48 38c46: 5e c0 rjmp .+188 ; 0x38d04 38c48: 58 f4 brcc .+22 ; 0x38c60 38c4a: 88 30 cpi r24, 0x08 ; 8 38c4c: 20 e8 ldi r18, 0x80 ; 128 38c4e: 92 07 cpc r25, r18 38c50: 09 f4 brne .+2 ; 0x38c54 38c52: 6e c0 rjmp .+220 ; 0x38d30 38c54: 89 30 cpi r24, 0x09 ; 9 38c56: 40 e8 ldi r20, 0x80 ; 128 38c58: 94 07 cpc r25, r20 38c5a: d9 f6 brne .-74 ; 0x38c12 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); 38c5c: 85 e0 ldi r24, 0x05 ; 5 38c5e: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38c60: 8c 30 cpi r24, 0x0C ; 12 38c62: 60 e8 ldi r22, 0x80 ; 128 38c64: 96 07 cpc r25, r22 38c66: 09 f4 brne .+2 ; 0x38c6a 38c68: 51 c0 rjmp .+162 ; 0x38d0c 38c6a: 8d 30 cpi r24, 0x0D ; 13 38c6c: 20 e8 ldi r18, 0x80 ; 128 38c6e: 92 07 cpc r25, r18 38c70: 81 f6 brne .-96 ; 0x38c12 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); 38c72: 81 e2 ldi r24, 0x21 ; 33 38c74: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38c76: 8f 32 cpi r24, 0x2F ; 47 38c78: 40 e8 ldi r20, 0x80 ; 128 38c7a: 94 07 cpc r25, r20 38c7c: 09 f4 brne .+2 ; 0x38c80 38c7e: 56 c0 rjmp .+172 ; 0x38d2c 38c80: e0 f4 brcc .+56 ; 0x38cba 38c82: 8c 32 cpi r24, 0x2C ; 44 38c84: 20 e8 ldi r18, 0x80 ; 128 38c86: 92 07 cpc r25, r18 38c88: 09 f4 brne .+2 ; 0x38c8c 38c8a: 4e c0 rjmp .+156 ; 0x38d28 38c8c: 58 f4 brcc .+22 ; 0x38ca4 38c8e: 8a 32 cpi r24, 0x2A ; 42 38c90: 60 e8 ldi r22, 0x80 ; 128 38c92: 96 07 cpc r25, r22 38c94: c9 f1 breq .+114 ; 0x38d08 38c96: 8b 32 cpi r24, 0x2B ; 43 38c98: 20 e8 ldi r18, 0x80 ; 128 38c9a: 92 07 cpc r25, r18 38c9c: 09 f0 breq .+2 ; 0x38ca0 38c9e: b9 cf rjmp .-142 ; 0x38c12 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); 38ca0: 86 e2 ldi r24, 0x26 ; 38 38ca2: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38ca4: 8d 32 cpi r24, 0x2D ; 45 38ca6: 40 e8 ldi r20, 0x80 ; 128 38ca8: 94 07 cpc r25, r20 38caa: d1 f1 breq .+116 ; 0x38d20 38cac: 8e 32 cpi r24, 0x2E ; 46 38cae: 60 e8 ldi r22, 0x80 ; 128 38cb0: 96 07 cpc r25, r22 38cb2: 09 f0 breq .+2 ; 0x38cb6 38cb4: ae cf rjmp .-164 ; 0x38c12 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); 38cb6: 82 e2 ldi r24, 0x22 ; 34 38cb8: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38cba: 87 38 cpi r24, 0x87 ; 135 38cbc: 20 e8 ldi r18, 0x80 ; 128 38cbe: 92 07 cpc r25, r18 38cc0: 49 f1 breq .+82 ; 0x38d14 38cc2: 58 f4 brcc .+22 ; 0x38cda 38cc4: 87 34 cpi r24, 0x47 ; 71 38cc6: 60 e8 ldi r22, 0x80 ; 128 38cc8: 96 07 cpc r25, r22 38cca: 29 f0 breq .+10 ; 0x38cd6 38ccc: 8b 34 cpi r24, 0x4B ; 75 38cce: 20 e8 ldi r18, 0x80 ; 128 38cd0: 92 07 cpc r25, r18 38cd2: 09 f0 breq .+2 ; 0x38cd6 38cd4: 9e cf rjmp .-196 ; 0x38c12 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); 38cd6: 84 e0 ldi r24, 0x04 ; 4 38cd8: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38cda: 87 30 cpi r24, 0x07 ; 7 38cdc: 41 e8 ldi r20, 0x81 ; 129 38cde: 94 07 cpc r25, r20 38ce0: d9 f0 breq .+54 ; 0x38d18 38ce2: 8b 30 cpi r24, 0x0B ; 11 38ce4: 61 e8 ldi r22, 0x81 ; 129 38ce6: 96 07 cpc r25, r22 38ce8: c9 f0 breq .+50 ; 0x38d1c 38cea: 8b 38 cpi r24, 0x8B ; 139 38cec: 20 e8 ldi r18, 0x80 ; 128 38cee: 92 07 cpc r25, r18 38cf0: 09 f0 breq .+2 ; 0x38cf4 38cf2: 8f cf rjmp .-226 ; 0x38c12 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); 38cf4: 89 e0 ldi r24, 0x09 ; 9 38cf6: 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); 38cf8: 81 e0 ldi r24, 0x01 ; 1 38cfa: 08 95 ret case ErrorCode::FSENSOR_DIDNT_SWITCH_ON: return FindErrorIndex(ERR_MECHANICAL_FSENSOR_DIDNT_TRIGGER); 38cfc: 82 e0 ldi r24, 0x02 ; 2 38cfe: 08 95 ret case ErrorCode::FSENSOR_DIDNT_SWITCH_OFF: return FindErrorIndex(ERR_MECHANICAL_FSENSOR_FILAMENT_STUCK); 38d00: 83 e0 ldi r24, 0x03 ; 3 38d02: 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); 38d04: 86 e0 ldi r24, 0x06 ; 6 38d06: 08 95 ret case ErrorCode::LOAD_TO_EXTRUDER_FAILED: return FindErrorIndex(ERR_MECHANICAL_LOAD_TO_EXTRUDER_FAILED); 38d08: 87 e0 ldi r24, 0x07 ; 7 38d0a: 08 95 ret case ErrorCode::FILAMENT_EJECTED: return FindErrorIndex(ERR_SYSTEM_FILAMENT_EJECTED); 38d0c: 8a e2 ldi r24, 0x2A ; 42 38d0e: 08 95 ret case ErrorCode::FILAMENT_CHANGE: return FindErrorIndex(ERR_SYSTEM_FILAMENT_CHANGE); 38d10: 8b e2 ldi r24, 0x2B ; 43 38d12: 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); 38d14: 88 e0 ldi r24, 0x08 ; 8 38d16: 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); 38d18: 8a e0 ldi r24, 0x0A ; 10 38d1a: 08 95 ret case ErrorCode::MOVE_IDLER_FAILED: return FindErrorIndex(ERR_MECHANICAL_IDLER_CANNOT_MOVE); 38d1c: 8b e0 ldi r24, 0x0B ; 11 38d1e: 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); 38d20: 83 e2 ldi r24, 0x23 ; 35 38d22: 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); 38d24: 85 e2 ldi r24, 0x25 ; 37 38d26: 08 95 ret case ErrorCode::QUEUE_FULL: return FindErrorIndex(ERR_SYSTEM_QUEUE_FULL); case ErrorCode::VERSION_MISMATCH: return FindErrorIndex(ERR_SYSTEM_FW_UPDATE_NEEDED); 38d28: 87 e2 ldi r24, 0x27 ; 39 38d2a: 08 95 ret case ErrorCode::INTERNAL: return FindErrorIndex(ERR_SYSTEM_FW_RUNTIME_ERROR); 38d2c: 88 e2 ldi r24, 0x28 ; 40 38d2e: 08 95 ret case ErrorCode::FINDA_VS_EEPROM_DISREPANCY: return FindErrorIndex(ERR_SYSTEM_UNLOAD_MANUALLY); 38d30: 89 e2 ldi r24, 0x29 ; 41 38d32: 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)) { 38d34: 87 ff sbrs r24, 7 38d36: 07 c0 rjmp .+14 ; 0x38d46 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); 38d38: 22 27 eor r18, r18 38d3a: 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) { 38d3c: 21 15 cp r18, r1 38d3e: 32 4c sbci r19, 0xC2 ; 194 38d40: a1 f5 brne .+104 ; 0x38daa return FindErrorIndex(ERR_ELECTRICAL_MMU_SELECTOR_SELFTEST_FAILED); 38d42: 8f e1 ldi r24, 0x1F ; 31 38d44: 08 95 ret } } else if (ContainsBit(ec, ErrorCode::TMC_IDLER_BIT)) { 38d46: 22 27 eor r18, r18 38d48: 31 70 andi r19, 0x01 ; 1 38d4a: 90 ff sbrs r25, 0 38d4c: 52 c0 rjmp .+164 ; 0x38df2 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); 38d4e: ac 01 movw r20, r24 38d50: 44 27 eor r20, r20 38d52: 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) { 38d54: 41 15 cp r20, r1 38d56: 52 4c sbci r21, 0xC2 ; 194 38d58: 09 f0 breq .+2 ; 0x38d5c 38d5a: 4b c0 rjmp .+150 ; 0x38df2 return FindErrorIndex(ERR_ELECTRICAL_MMU_IDLER_SELFTEST_FAILED); 38d5c: 80 e2 ldi r24, 0x20 ; 32 38d5e: 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; 38d60: 9c 01 movw r18, r24 38d62: 22 27 eor r18, r18 38d64: 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)) { 38d66: 23 2b or r18, r19 38d68: 09 f0 breq .+2 ; 0x38d6c 38d6a: 67 c0 rjmp .+206 ; 0x38e3a 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; 38d6c: 9c 01 movw r18, r24 38d6e: 22 27 eor r18, r18 38d70: 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)) { 38d72: 23 2b or r18, r19 38d74: 09 f0 breq .+2 ; 0x38d78 38d76: 63 c0 rjmp .+198 ; 0x38e3e 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: 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)) { 38d7e: 23 2b or r18, r19 38d80: 09 f0 breq .+2 ; 0x38d84 38d82: 5f c0 rjmp .+190 ; 0x38e42 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; 38d84: 9c 01 movw r18, r24 38d86: 22 27 eor r18, r18 38d88: 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)) { 38d8a: 23 2b or r18, r19 38d8c: 09 f0 breq .+2 ; 0x38d90 38d8e: 5b c0 rjmp .+182 ; 0x38e46 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; 38d90: 9c 01 movw r18, r24 38d92: 22 27 eor r18, r18 38d94: 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)) { 38d96: 23 2b or r18, r19 38d98: 09 f0 breq .+2 ; 0x38d9c 38d9a: 57 c0 rjmp .+174 ; 0x38e4a 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; 38d9c: 88 27 eor r24, r24 38d9e: 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)) { 38da0: 89 2b or r24, r25 38da2: 09 f4 brne .+2 ; 0x38da6 38da4: 68 c0 rjmp .+208 ; 0x38e76 return FindErrorIndex(ERR_TEMPERATURE_TMC_PULLEY_OVERHEAT_ERROR); 38da6: 8f e0 ldi r24, 0x0F ; 15 38da8: 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; 38daa: 9c 01 movw r18, r24 38dac: 22 27 eor r18, r18 38dae: 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)) { 38db0: 23 2b or r18, r19 38db2: 09 f0 breq .+2 ; 0x38db6 38db4: 4c c0 rjmp .+152 ; 0x38e4e 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; 38db6: 9c 01 movw r18, r24 38db8: 22 27 eor r18, r18 38dba: 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)) { 38dbc: 23 2b or r18, r19 38dbe: 09 f0 breq .+2 ; 0x38dc2 38dc0: 48 c0 rjmp .+144 ; 0x38e52 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; 38dc2: 9c 01 movw r18, r24 38dc4: 22 27 eor r18, r18 38dc6: 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)) { 38dc8: 23 2b or r18, r19 38dca: 09 f0 breq .+2 ; 0x38dce 38dcc: 44 c0 rjmp .+136 ; 0x38e56 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; 38dce: 9c 01 movw r18, r24 38dd0: 22 27 eor r18, r18 38dd2: 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)) { 38dd4: 23 2b or r18, r19 38dd6: 09 f0 breq .+2 ; 0x38dda 38dd8: 40 c0 rjmp .+128 ; 0x38e5a 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; 38dda: 9c 01 movw r18, r24 38ddc: 22 27 eor r18, r18 38dde: 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)) { 38de0: 23 2b or r18, r19 38de2: e9 f5 brne .+122 ; 0x38e5e 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; 38de4: 88 27 eor r24, r24 38de6: 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)) { 38de8: 89 2b or r24, r25 38dea: 09 f4 brne .+2 ; 0x38dee 38dec: 44 c0 rjmp .+136 ; 0x38e76 return FindErrorIndex(ERR_TEMPERATURE_TMC_SELECTOR_OVERHEAT_ERROR); 38dee: 80 e1 ldi r24, 0x10 ; 16 38df0: 08 95 ret } } else if (ContainsBit(ec, ErrorCode::TMC_IDLER_BIT)) { 38df2: 23 2b or r18, r19 38df4: 09 f4 brne .+2 ; 0x38df8 38df6: 3f c0 rjmp .+126 ; 0x38e76 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; 38df8: 9c 01 movw r18, r24 38dfa: 22 27 eor r18, r18 38dfc: 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)) { 38dfe: 23 2b or r18, r19 38e00: 81 f5 brne .+96 ; 0x38e62 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; 38e02: 9c 01 movw r18, r24 38e04: 22 27 eor r18, r18 38e06: 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)) { 38e08: 23 2b or r18, r19 38e0a: 69 f5 brne .+90 ; 0x38e66 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; 38e0c: 9c 01 movw r18, r24 38e0e: 22 27 eor r18, r18 38e10: 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)) { 38e12: 23 2b or r18, r19 38e14: 51 f5 brne .+84 ; 0x38e6a 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; 38e16: 9c 01 movw r18, r24 38e18: 22 27 eor r18, r18 38e1a: 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)) { 38e1c: 23 2b or r18, r19 38e1e: 39 f5 brne .+78 ; 0x38e6e 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; 38e20: 9c 01 movw r18, r24 38e22: 22 27 eor r18, r18 38e24: 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)) { 38e26: 23 2b or r18, r19 38e28: 21 f5 brne .+72 ; 0x38e72 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; 38e2a: 88 27 eor r24, r24 38e2c: 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)) { 38e2e: 89 2b or r24, r25 38e30: 11 f1 breq .+68 ; 0x38e76 return FindErrorIndex(ERR_TEMPERATURE_TMC_IDLER_OVERHEAT_ERROR); 38e32: 81 e1 ldi r24, 0x11 ; 17 38e34: 08 95 ret } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { case ErrorCode::FINDA_DIDNT_SWITCH_ON: return FindErrorIndex(ERR_MECHANICAL_FINDA_DIDNT_TRIGGER); 38e36: 80 e0 ldi r24, 0x00 ; 0 38e38: 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); 38e3a: 82 e1 ldi r24, 0x12 ; 18 38e3c: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_DRIVER_RESET); 38e3e: 85 e1 ldi r24, 0x15 ; 21 38e40: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_UNDERVOLTAGE_ERROR); 38e42: 88 e1 ldi r24, 0x18 ; 24 38e44: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_DRIVER_SHORTED); 38e46: 8b e1 ldi r24, 0x1B ; 27 38e48: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_PULLEY_TOO_HOT); 38e4a: 8c e0 ldi r24, 0x0C ; 12 38e4c: 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); 38e4e: 83 e1 ldi r24, 0x13 ; 19 38e50: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_DRIVER_RESET); 38e52: 86 e1 ldi r24, 0x16 ; 22 38e54: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_UNDERVOLTAGE_ERROR); 38e56: 89 e1 ldi r24, 0x19 ; 25 38e58: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_DRIVER_SHORTED); 38e5a: 8c e1 ldi r24, 0x1C ; 28 38e5c: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_SELECTOR_TOO_HOT); 38e5e: 8d e0 ldi r24, 0x0D ; 13 38e60: 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); 38e62: 84 e1 ldi r24, 0x14 ; 20 38e64: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_DRIVER_RESET); 38e66: 87 e1 ldi r24, 0x17 ; 23 38e68: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_UNDERVOLTAGE_ERROR); 38e6a: 8a e1 ldi r24, 0x1A ; 26 38e6c: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_DRIVER_SHORTED); 38e6e: 8d e1 ldi r24, 0x1D ; 29 38e70: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_IDLER_TOO_HOT); 38e72: 8e e0 ldi r24, 0x0E ; 14 38e74: 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); 38e76: 8c e2 ldi r24, 0x2C ; 44 } 38e78: 08 95 ret 00038e7a : bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { 38e7a: cf 92 push r12 38e7c: df 92 push r13 38e7e: ef 92 push r14 38e80: ff 92 push r15 38e82: 0f 93 push r16 38e84: 1f 93 push r17 38e86: cf 93 push r28 38e88: df 93 push r29 if (putErrorScreenToSleep) return; if (mmu2.MMUCurrentErrorCode() == ErrorCode::OK && mmu2.MMULastErrorSource() == MMU2::ErrorSourceMMU) { 38e8a: 20 91 8b 13 lds r18, 0x138B ; 0x80138b 38e8e: 30 91 8c 13 lds r19, 0x138C ; 0x80138c 38e92: 21 30 cpi r18, 0x01 ; 1 38e94: 31 05 cpc r19, r1 38e96: 39 f4 brne .+14 ; 0x38ea6 38e98: 20 91 b4 13 lds r18, 0x13B4 ; 0x8013b4 38e9c: 21 30 cpi r18, 0x01 ; 1 38e9e: 19 f4 brne .+6 ; 0x38ea6 // 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; 38ea0: 22 e0 ldi r18, 0x02 ; 2 38ea2: 20 93 f6 17 sts 0x17F6, r18 ; 0x8017f6 } const uint8_t ei = PrusaErrorCodeIndex((ErrorCode)ec); 38ea6: 0f 94 ec c5 call 0x38bd8 ; 0x38bd8 38eaa: d8 2f mov r29, r24 switch ((uint8_t)ReportErrorHookState) { 38eac: 80 91 f6 17 lds r24, 0x17F6 ; 0x8017f6 38eb0: 81 30 cpi r24, 0x01 ; 1 38eb2: 09 f4 brne .+2 ; 0x38eb6 38eb4: 64 c0 rjmp .+200 ; 0x38f7e 38eb6: 60 f0 brcs .+24 ; 0x38ed0 38eb8: 82 30 cpi r24, 0x02 ; 2 38eba: 09 f4 brne .+2 ; 0x38ebe 38ebc: f4 c0 rjmp .+488 ; 0x390a6 ReportErrorHookState = ReportErrorHookStates::RENDER_ERROR_SCREEN; break; default: break; } } 38ebe: df 91 pop r29 38ec0: cf 91 pop r28 38ec2: 1f 91 pop r17 38ec4: 0f 91 pop r16 38ec6: ff 90 pop r15 38ec8: ef 90 pop r14 38eca: df 90 pop r13 38ecc: cf 90 pop r12 38ece: 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); 38ed0: 84 e0 ldi r24, 0x04 ; 4 38ed2: 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); 38ed6: 0d 2f mov r16, r29 38ed8: 10 e0 ldi r17, 0x00 ; 0 38eda: f8 01 movw r30, r16 38edc: e1 59 subi r30, 0x91 ; 145 38ede: f3 45 sbci r31, 0x53 ; 83 38ee0: 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); 38ee2: fc 2e mov r15, r28 38ee4: f2 94 swap r15 38ee6: 6f e0 ldi r22, 0x0F ; 15 38ee8: f6 22 and r15, r22 const uint8_t button_op_middle = BUTTON_OP_MIDDLE(button_operation); 38eea: 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); 38eec: 80 e0 ldi r24, 0x00 ; 0 38eee: 0e 94 25 6f call 0xde4a ; 0xde4a lcd_clear(); 38ef2: 0e 94 13 6f call 0xde26 ; 0xde26 // 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); 38ef6: 00 0f add r16, r16 38ef8: 11 1f adc r17, r17 38efa: f8 01 movw r30, r16 38efc: e4 56 subi r30, 0x64 ; 100 38efe: f3 45 sbci r31, 0x53 ; 83 38f00: c5 90 lpm r12, Z+ 38f02: d4 90 lpm r13, Z } const char *PrusaErrorTitle(uint8_t i) { return (const char *)pgm_read_ptr(errorTitles + i); 38f04: 09 5c subi r16, 0xC9 ; 201 38f06: 16 45 sbci r17, 0x56 ; 86 38f08: f8 01 movw r30, r16 38f0a: 85 91 lpm r24, Z+ 38f0c: 94 91 lpm r25, Z // Print title and header lcd_printf_P(PSTR("%.20S\nprusa.io/04%hu"), _T(PrusaErrorTitle(ei)), PrusaErrorCode(ei) ); 38f0e: 0e 94 ac 72 call 0xe558 ; 0xe558 38f12: df 92 push r13 38f14: cf 92 push r12 38f16: 9f 93 push r25 38f18: 8f 93 push r24 38f1a: 88 e0 ldi r24, 0x08 ; 8 38f1c: 9d ea ldi r25, 0xAD ; 173 38f1e: 9f 93 push r25 38f20: 8f 93 push r24 38f22: 0e 94 b9 6e call 0xdd72 ; 0xdd72 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)); 38f26: 4f ea ldi r20, 0xAF ; 175 38f28: 59 ea ldi r21, 0xA9 ; 169 38f2a: 62 e0 ldi r22, 0x02 ; 2 38f2c: 80 e0 ldi r24, 0x00 ; 0 38f2e: 0e 94 f4 6e call 0xdde8 ; 0xdde8 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()); 38f32: 0f 90 pop r0 38f34: 0f 90 pop r0 38f36: 0f 90 pop r0 38f38: 0f 90 pop r0 38f3a: 0f 90 pop r0 38f3c: 0f 90 pop r0 38f3e: f1 10 cpse r15, r1 38f40: c6 c0 rjmp .+396 ; 0x390ce 38f42: 10 e0 ldi r17, 0x00 ; 0 38f44: 00 e0 ldi r16, 0x00 ; 0 38f46: 42 e1 ldi r20, 0x12 ; 18 38f48: e4 2e mov r14, r20 38f4a: 5f ef ldi r21, 0xFF ; 255 38f4c: c5 2e mov r12, r21 38f4e: 50 e7 ldi r21, 0x70 ; 112 38f50: 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); 38f52: ec 2f mov r30, r28 38f54: f0 e0 ldi r31, 0x00 ; 0 38f56: ee 0f add r30, r30 38f58: ff 1f adc r31, r31 38f5a: ec 50 subi r30, 0x0C ; 12 38f5c: f3 45 sbci r31, 0x53 ; 83 38f5e: 85 91 lpm r24, Z+ 38f60: 94 91 lpm r25, Z 38f62: 0e 94 ac 72 call 0xe558 ; 0xe558 38f66: bc 01 movw r22, r24 38f68: 81 e0 ldi r24, 0x01 ; 1 38f6a: f1 10 cpse r15, r1 38f6c: 01 c0 rjmp .+2 ; 0x38f70 38f6e: 80 e0 ldi r24, 0x00 ; 0 38f70: 2e 2d mov r18, r14 38f72: a6 01 movw r20, r12 38f74: 0f 94 93 1f call 0x23f26 ; 0x23f26 switch ((uint8_t)ReportErrorHookState) { case (uint8_t)ReportErrorHookStates::RENDER_ERROR_SCREEN: KEEPALIVE_STATE(PAUSED_FOR_USER); ReportErrorHookStaticRender(ei); ReportErrorHookState = ReportErrorHookStates::MONITOR_SELECTION; 38f78: 81 e0 ldi r24, 0x01 ; 1 38f7a: 80 93 f6 17 sts 0x17F6, r24 ; 0x8017f6 [[fallthrough]]; case (uint8_t)ReportErrorHookStates::MONITOR_SELECTION: is_mmu_error_monitor_active = true; 38f7e: 81 e0 ldi r24, 0x01 ; 1 38f80: 80 93 c3 06 sts 0x06C3, r24 ; 0x8006c3 <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.490> ReportErrorHookDynamicRender(); // Render dynamic characters 38f84: 0f 94 f6 c4 call 0x389ec ; 0x389ec sound_wait_for_user(); 38f88: 0f 94 ea 51 call 0x2a3d4 ; 0x2a3d4 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); 38f8c: 0d 2f mov r16, r29 38f8e: 10 e0 ldi r17, 0x00 ; 0 38f90: f8 01 movw r30, r16 38f92: e1 59 subi r30, 0x91 ; 145 38f94: f3 45 sbci r31, 0x53 ; 83 38f96: 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); 38f98: dc 2f mov r29, r28 38f9a: d2 95 swap r29 38f9c: 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; 38f9e: 80 91 ee 17 lds r24, 0x17EE ; 0x8017ee 38fa2: 81 11 cpse r24, r1 38fa4: 09 c0 rjmp .+18 ; 0x38fb8 38fa6: 81 e0 ldi r24, 0x01 ; 1 38fa8: d1 11 cpse r29, r1 38faa: 01 c0 rjmp .+2 ; 0x38fae 38fac: 80 e0 ldi r24, 0x00 ; 0 38fae: 80 93 ed 17 sts 0x17ED, r24 ; 0x8017ed 38fb2: 81 e0 ldi r24, 0x01 ; 1 38fb4: 80 93 ee 17 sts 0x17EE, r24 ; 0x8017ee static int8_t choice_selected = -1; if (reset_button_selection) { 38fb8: 80 91 ec 17 lds r24, 0x17EC ; 0x8017ec 38fbc: 88 23 and r24, r24 38fbe: 41 f0 breq .+16 ; 0x38fd0 // 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; 38fc0: 81 e0 ldi r24, 0x01 ; 1 38fc2: d1 11 cpse r29, r1 38fc4: 01 c0 rjmp .+2 ; 0x38fc8 38fc6: 80 e0 ldi r24, 0x00 ; 0 38fc8: 80 93 ed 17 sts 0x17ED, r24 ; 0x8017ed choice_selected = -1; reset_button_selection = 0; 38fcc: 10 92 ec 17 sts 0x17EC, r1 ; 0x8017ec } // Check if knob was rotated if (lcd_encoder) { 38fd0: 20 91 70 06 lds r18, 0x0670 ; 0x800670 38fd4: 30 91 71 06 lds r19, 0x0671 ; 0x800671 38fd8: 21 15 cp r18, r1 38fda: 31 05 cpc r19, r1 38fdc: b9 f1 breq .+110 ; 0x3904c 38fde: 80 91 ed 17 lds r24, 0x17ED ; 0x8017ed if (two_choices == false) { // third_choice is not nullptr, safe to dereference 38fe2: dd 23 and r29, r29 38fe4: 61 f0 breq .+24 ; 0x38ffe if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 38fe6: 37 ff sbrs r19, 7 38fe8: 06 c0 rjmp .+12 ; 0x38ff6 38fea: 88 23 and r24, r24 38fec: 69 f0 breq .+26 ; 0x39008 // Rotating knob counter clockwise current_selection--; 38fee: 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; 38ff0: 80 93 ed 17 sts 0x17ED, r24 ; 0x8017ed 38ff4: 09 c0 rjmp .+18 ; 0x39008 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) { 38ff6: 82 30 cpi r24, 0x02 ; 2 38ff8: 39 f0 breq .+14 ; 0x39008 // Rotating knob clockwise current_selection++; 38ffa: 8f 5f subi r24, 0xFF ; 255 38ffc: f9 cf rjmp .-14 ; 0x38ff0 } } else { if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 38ffe: 37 ff sbrs r19, 7 39000: 41 c0 rjmp .+130 ; 0x39084 39002: 81 11 cpse r24, r1 // Rotating knob counter clockwise current_selection = LCD_LEFT_BUTTON_CHOICE; 39004: 10 92 ed 17 sts 0x17ED, r1 ; 0x8017ed //! ---------------------- //! |>(left) >(mid) | //! ---------------------- //! @endcode // lcd_putc_at(0, 3, current_selection == LCD_LEFT_BUTTON_CHOICE ? '>': ' '); 39008: 80 91 ed 17 lds r24, 0x17ED ; 0x8017ed 3900c: 4e e3 ldi r20, 0x3E ; 62 3900e: 81 11 cpse r24, r1 39010: 40 e2 ldi r20, 0x20 ; 32 39012: 63 e0 ldi r22, 0x03 ; 3 39014: 80 e0 ldi r24, 0x00 ; 0 39016: 0e 94 00 6f call 0xde00 ; 0xde00 3901a: 80 91 ed 17 lds r24, 0x17ED ; 0x8017ed if (two_choices == false) 3901e: dd 23 and r29, r29 39020: b1 f1 breq .+108 ; 0x3908e { lcd_putc_at(9, 3, current_selection == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 39022: 4e e3 ldi r20, 0x3E ; 62 39024: 81 30 cpi r24, 0x01 ; 1 39026: 09 f0 breq .+2 ; 0x3902a 39028: 40 e2 ldi r20, 0x20 ; 32 3902a: 63 e0 ldi r22, 0x03 ; 3 3902c: 89 e0 ldi r24, 0x09 ; 9 3902e: 0e 94 00 6f call 0xde00 ; 0xde00 lcd_putc_at(18, 3, current_selection == LCD_RIGHT_BUTTON_CHOICE ? '>': ' '); 39032: 80 91 ed 17 lds r24, 0x17ED ; 0x8017ed 39036: 82 30 cpi r24, 0x02 ; 2 39038: 61 f5 brne .+88 ; 0x39092 } else { // More button for two button screen lcd_putc_at(18, 3, current_selection == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 3903a: 4e e3 ldi r20, 0x3E ; 62 3903c: 63 e0 ldi r22, 0x03 ; 3 3903e: 82 e1 ldi r24, 0x12 ; 18 39040: 0e 94 00 6f call 0xde00 ; 0xde00 } // Consume rotation event lcd_encoder = 0; 39044: 10 92 71 06 sts 0x0671, r1 ; 0x800671 39048: 10 92 70 06 sts 0x0670, r1 ; 0x800670 } // Check if knob was clicked and consume the event if (lcd_clicked()) { 3904c: 0e 94 fd 70 call 0xe1fa ; 0xe1fa 39050: 88 23 and r24, r24 39052: 09 f4 brne .+2 ; 0x39056 39054: 34 cf rjmp .-408 ; 0x38ebe choice_selected = current_selection; 39056: 80 91 ed 17 lds r24, 0x17ED ; 0x8017ed } else { // continue monitoring return ret; } if ((two_choices && choice_selected == LCD_MIDDLE_BUTTON_CHOICE) // Two choices and middle button selected 3905a: d1 11 cpse r29, r1 3905c: 1c c0 rjmp .+56 ; 0x39096 3905e: 81 30 cpi r24, 0x01 ; 1 39060: 89 f5 brne .+98 ; 0x390c4 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); 39062: f8 01 movw r30, r16 39064: ee 0f add r30, r30 39066: ff 1f adc r31, r31 39068: eb 5e subi r30, 0xEB ; 235 3906a: f3 45 sbci r31, 0x53 ; 83 3906c: 85 91 lpm r24, Z+ 3906e: 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))); 39070: 0e 94 ac 72 call 0xe558 ; 0xe558 39074: 0f 94 f1 1f call 0x23fe2 ; 0x23fe2 SetButtonResponse((ButtonOperations)button_op_middle); ret = 2; } // Next MMU error screen should reset the choice selection reset_button_selection = 1; 39078: 81 e0 ldi r24, 0x01 ; 1 3907a: 80 93 ec 17 sts 0x17EC, r24 ; 0x8017ec 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; 3907e: 10 92 f6 17 sts 0x17F6, r1 ; 0x8017f6 39082: 1d cf rjmp .-454 ; 0x38ebe } } 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) { 39084: 81 30 cpi r24, 0x01 ; 1 39086: 09 f4 brne .+2 ; 0x3908a 39088: bf cf rjmp .-130 ; 0x39008 // Rotating knob clockwise current_selection = LCD_MIDDLE_BUTTON_CHOICE; 3908a: 81 e0 ldi r24, 0x01 ; 1 3908c: b1 cf rjmp .-158 ; 0x38ff0 { 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 ? '>': ' '); 3908e: 81 30 cpi r24, 0x01 ; 1 39090: a1 f2 breq .-88 ; 0x3903a 39092: 40 e2 ldi r20, 0x20 ; 32 39094: d3 cf rjmp .-90 ; 0x3903c // 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 39096: 82 30 cpi r24, 0x02 ; 2 39098: 21 f3 breq .-56 ; 0x39062 { // 'More' show error description lcd_show_fullscreen_message_and_wait_P(_T(PrusaErrorDesc(ei))); ret = 1; } else if(choice_selected == LCD_MIDDLE_BUTTON_CHOICE) { 3909a: 81 30 cpi r24, 0x01 ; 1 3909c: 99 f4 brne .+38 ; 0x390c4 return Buttons::NoButton; } void SetButtonResponse(ButtonOperations rsp) { buttonSelectedOperation = rsp; 3909e: d0 93 ae 0d sts 0x0DAE, r29 ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.493> SetButtonResponse((ButtonOperations)button_op_middle); ret = 2; } // Next MMU error screen should reset the choice selection reset_button_selection = 1; 390a2: 80 93 ec 17 sts 0x17EC, r24 ; 0x8017ec // More button selected, change state ReportErrorHookState = ReportErrorHookStates::RENDER_ERROR_SCREEN; break; case 2: // Exit error screen and enable lcd updates lcd_update_enable(true); 390a6: 81 e0 ldi r24, 0x01 ; 1 390a8: 0e 94 25 6f call 0xde4a ; 0xde4a lcd_return_to_status(); 390ac: 0f 94 a6 1e call 0x23d4c ; 0x23d4c 390b0: 10 92 6b 05 sts 0x056B, r1 ; 0x80056b <_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; 390b4: 10 92 6e 05 sts 0x056E, r1 ; 0x80056e <_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; 390b8: 10 92 c3 06 sts 0x06C3, r1 ; 0x8006c3 <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.490> KEEPALIVE_STATE(IN_HANDLER); 390bc: 82 e0 ldi r24, 0x02 ; 2 390be: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be 390c2: dd cf rjmp .-70 ; 0x3907e 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); 390c4: cf 70 andi r28, 0x0F ; 15 390c6: c0 93 ae 0d sts 0x0DAE, r28 ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.493> SetButtonResponse((ButtonOperations)button_op_middle); ret = 2; } // Next MMU error screen should reset the choice selection reset_button_selection = 1; 390ca: 81 e0 ldi r24, 0x01 ; 1 390cc: ea cf rjmp .-44 ; 0x390a2 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); 390ce: ef 2d mov r30, r15 390d0: f0 e0 ldi r31, 0x00 ; 0 390d2: ee 0f add r30, r30 390d4: ff 1f adc r31, r31 390d6: ec 50 subi r30, 0x0C ; 12 390d8: f3 45 sbci r31, 0x53 ; 83 390da: 85 91 lpm r24, Z+ 390dc: 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()); 390de: 0e 94 ac 72 call 0xe558 ; 0xe558 390e2: 6c 01 movw r12, r24 390e4: 0f ef ldi r16, 0xFF ; 255 390e6: 10 e7 ldi r17, 0x70 ; 112 390e8: 99 e0 ldi r25, 0x09 ; 9 390ea: e9 2e mov r14, r25 390ec: 32 cf rjmp .-412 ; 0x38f52 000390ee : buttonSelectedOperation = ButtonOperations::NoOperation; // Reset operation return result; } Buttons ButtonAvailable(ErrorCode ec) { uint8_t ei = PrusaErrorCodeIndex(ec); 390ee: 0f 94 ec c5 call 0x38bd8 ; 0x38bd8 // 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); 390f2: e8 2f mov r30, r24 390f4: f0 e0 ldi r31, 0x00 ; 0 390f6: ee 0f add r30, r30 390f8: ff 1f adc r31, r31 390fa: e4 56 subi r30, 0x64 ; 100 390fc: f3 45 sbci r31, 0x53 ; 83 390fe: 25 91 lpm r18, Z+ 39100: 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) ) { 39102: 23 33 cpi r18, 0x33 ; 51 39104: 81 e0 ldi r24, 0x01 ; 1 39106: 38 07 cpc r19, r24 39108: 08 f0 brcs .+2 ; 0x3910c 3910a: 41 c0 rjmp .+130 ; 0x3918e 3910c: 2d 32 cpi r18, 0x2D ; 45 3910e: 81 e0 ldi r24, 0x01 ; 1 39110: 38 07 cpc r19, r24 39112: 78 f5 brcc .+94 ; 0x39172 39114: 2e 37 cpi r18, 0x7E ; 126 39116: 31 05 cpc r19, r1 39118: 09 f4 brne .+2 ; 0x3911c 3911a: 83 c0 rjmp .+262 ; 0x39222 3911c: f0 f4 brcc .+60 ; 0x3915a 3911e: 2c 36 cpi r18, 0x6C ; 108 39120: 31 05 cpc r19, r1 39122: 09 f4 brne .+2 ; 0x39126 39124: 85 c0 rjmp .+266 ; 0x39230 39126: 30 f4 brcc .+12 ; 0x39134 39128: 25 36 cpi r18, 0x65 ; 101 3912a: 31 05 cpc r19, r1 3912c: 08 f0 brcs .+2 ; 0x39130 3912e: 79 c0 rjmp .+242 ; 0x39222 default: break; } return Buttons::NoButton; 39130: 8f ef ldi r24, 0xFF ; 255 39132: 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) ) { 39134: 24 37 cpi r18, 0x74 ; 116 39136: 31 05 cpc r19, r1 39138: 09 f4 brne .+2 ; 0x3913c 3913a: 73 c0 rjmp .+230 ; 0x39222 3913c: 2d 37 cpi r18, 0x7D ; 125 3913e: 31 05 cpc r19, r1 39140: 19 f0 breq .+6 ; 0x39148 39142: 23 37 cpi r18, 0x73 ; 115 39144: 31 05 cpc r19, r1 39146: a1 f7 brne .-24 ; 0x39130 break; } break; case ERR_MECHANICAL_SELECTOR_CANNOT_HOME: case ERR_MECHANICAL_IDLER_CANNOT_HOME: switch (buttonSelectedOperation) { 39148: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.493> 3914c: 81 30 cpi r24, 0x01 ; 1 3914e: 09 f4 brne .+2 ; 0x39152 39150: 6d c0 rjmp .+218 ; 0x3922c 39152: 87 30 cpi r24, 0x07 ; 7 39154: 69 f7 brne .-38 ; 0x39130 // may be allow move selector right and left in the future case ButtonOperations::Tune: // Tune Stallguard threshold return Buttons::TuneMMU; 39156: 88 e0 ldi r24, 0x08 ; 8 39158: 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) ) { 3915a: 23 3d cpi r18, 0xD3 ; 211 3915c: 31 05 cpc r19, r1 3915e: 09 f4 brne .+2 ; 0x39162 39160: 6e c0 rjmp .+220 ; 0x3923e 39162: 50 f4 brcc .+20 ; 0x39178 39164: 29 3c cpi r18, 0xC9 ; 201 39166: 31 05 cpc r19, r1 39168: 09 f4 brne .+2 ; 0x3916c 3916a: 69 c0 rjmp .+210 ; 0x3923e 3916c: 2a 3c cpi r18, 0xCA ; 202 3916e: 31 05 cpc r19, r1 39170: f9 f6 brne .-66 ; 0x39130 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) { 39172: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.493> 39176: 67 c0 rjmp .+206 ; 0x39246 // 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) ) { 39178: 2d 3d cpi r18, 0xDD ; 221 3917a: 31 05 cpc r19, r1 3917c: 09 f4 brne .+2 ; 0x39180 3917e: 5f c0 rjmp .+190 ; 0x3923e 39180: 2e 3d cpi r18, 0xDE ; 222 39182: 31 05 cpc r19, r1 39184: b1 f3 breq .-20 ; 0x39172 39186: 24 3d cpi r18, 0xD4 ; 212 39188: 31 05 cpc r19, r1 3918a: 91 f6 brne .-92 ; 0x39130 3918c: f2 cf rjmp .-28 ; 0x39172 3918e: 25 3f cpi r18, 0xF5 ; 245 39190: 81 e0 ldi r24, 0x01 ; 1 39192: 38 07 cpc r19, r24 39194: 09 f4 brne .+2 ; 0x39198 39196: 5c c0 rjmp .+184 ; 0x39250 39198: f8 f4 brcc .+62 ; 0x391d8 3919a: 26 34 cpi r18, 0x46 ; 70 3919c: 81 e0 ldi r24, 0x01 ; 1 3919e: 38 07 cpc r19, r24 391a0: 58 f4 brcc .+22 ; 0x391b8 391a2: 21 34 cpi r18, 0x41 ; 65 391a4: 81 e0 ldi r24, 0x01 ; 1 391a6: 38 07 cpc r19, r24 391a8: 20 f7 brcc .-56 ; 0x39172 391aa: 27 53 subi r18, 0x37 ; 55 391ac: 31 40 sbci r19, 0x01 ; 1 391ae: 25 30 cpi r18, 0x05 ; 5 391b0: 31 05 cpc r19, r1 391b2: 08 f0 brcs .+2 ; 0x391b6 391b4: bd cf rjmp .-134 ; 0x39130 391b6: dd cf rjmp .-70 ; 0x39172 391b8: 21 59 subi r18, 0x91 ; 145 391ba: 31 40 sbci r19, 0x01 ; 1 391bc: 22 30 cpi r18, 0x02 ; 2 391be: 31 05 cpc r19, r1 391c0: 08 f0 brcs .+2 ; 0x391c4 391c2: b6 cf rjmp .-148 ; 0x39130 } break; case ERR_CONNECT_MMU_NOT_RESPONDING: case ERR_CONNECT_COMMUNICATION_ERROR: case ERR_SYSTEM_FW_UPDATE_NEEDED: switch (buttonSelectedOperation) { 391c4: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.493> 391c8: 83 30 cpi r24, 0x03 ; 3 391ca: 09 f4 brne .+2 ; 0x391ce 391cc: 3f c0 rjmp .+126 ; 0x3924c 391ce: 89 30 cpi r24, 0x09 ; 9 391d0: 09 f0 breq .+2 ; 0x391d4 391d2: ae cf rjmp .-164 ; 0x39130 case ButtonOperations::DisableMMU: // "Disable" return Buttons::DisableMMU; 391d4: 87 e0 ldi r24, 0x07 ; 7 391d6: 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) ) { 391d8: 29 3f cpi r18, 0xF9 ; 249 391da: 81 e0 ldi r24, 0x01 ; 1 391dc: 38 07 cpc r19, r24 391de: 49 f2 breq .-110 ; 0x39172 391e0: 70 f4 brcc .+28 ; 0x391fe 391e2: 27 3f cpi r18, 0xF7 ; 247 391e4: 81 e0 ldi r24, 0x01 ; 1 391e6: 38 07 cpc r19, r24 391e8: 21 f2 breq .-120 ; 0x39172 391ea: 60 f7 brcc .-40 ; 0x391c4 break; } break; case ERR_SYSTEM_INVALID_TOOL: switch (buttonSelectedOperation) { 391ec: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.493> 391f0: 83 30 cpi r24, 0x03 ; 3 391f2: 61 f1 breq .+88 ; 0x3924c 391f4: 88 30 cpi r24, 0x08 ; 8 391f6: 09 f0 breq .+2 ; 0x391fa 391f8: 9b cf rjmp .-202 ; 0x39130 case ButtonOperations::StopPrint: // "Stop print" return Buttons::StopPrint; 391fa: 86 e0 ldi r24, 0x06 ; 6 391fc: 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) ) { 391fe: 2b 3f cpi r18, 0xFB ; 251 39200: 81 e0 ldi r24, 0x01 ; 1 39202: 38 07 cpc r19, r24 39204: a9 f0 breq .+42 ; 0x39230 39206: 68 f0 brcs .+26 ; 0x39222 39208: 2c 3f cpi r18, 0xFC ; 252 3920a: 31 40 sbci r19, 0x01 ; 1 3920c: 09 f0 breq .+2 ; 0x39210 3920e: 90 cf rjmp .-224 ; 0x39130 default: break; } break; case ERR_SYSTEM_FILAMENT_CHANGE: switch (buttonSelectedOperation) { 39210: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.493> 39214: 85 30 cpi r24, 0x05 ; 5 39216: 89 f0 breq .+34 ; 0x3923a 39218: 86 30 cpi r24, 0x06 ; 6 3921a: 09 f0 breq .+2 ; 0x3921e 3921c: 89 cf rjmp .-238 ; 0x39130 case ButtonOperations::Load: return Buttons::Load; case ButtonOperations::Eject: return Buttons::Eject; 3921e: 85 e0 ldi r24, 0x05 ; 5 39220: 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) { 39222: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.493> 39226: 81 30 cpi r24, 0x01 ; 1 39228: 09 f0 breq .+2 ; 0x3922c 3922a: 82 cf rjmp .-252 ; 0x39130 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; 3922c: 81 e0 ldi r24, 0x01 ; 1 3922e: 08 95 ret break; } break; case ERR_MECHANICAL_LOAD_TO_EXTRUDER_FAILED: case ERR_SYSTEM_FILAMENT_EJECTED: switch (buttonSelectedOperation) { 39230: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.493> 39234: 82 30 cpi r24, 0x02 ; 2 39236: d1 f3 breq .-12 ; 0x3922c 39238: 7b cf rjmp .-266 ; 0x39130 } break; case ERR_SYSTEM_FILAMENT_CHANGE: switch (buttonSelectedOperation) { case ButtonOperations::Load: return Buttons::Load; 3923a: 84 e0 ldi r24, 0x04 ; 4 3923c: 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) { 3923e: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.493> 39242: 82 30 cpi r24, 0x02 ; 2 39244: 61 f0 breq .+24 ; 0x3925e 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) { 39246: 83 30 cpi r24, 0x03 ; 3 39248: 09 f0 breq .+2 ; 0x3924c 3924a: 72 cf rjmp .-284 ; 0x39130 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; 3924c: 83 e0 ldi r24, 0x03 ; 3 default: break; } return Buttons::NoButton; } 3924e: 08 95 ret default: break; } break; case ERR_SYSTEM_FILAMENT_ALREADY_LOADED: switch (buttonSelectedOperation) { 39250: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.493> 39254: 82 30 cpi r24, 0x02 ; 2 39256: 29 f0 breq .+10 ; 0x39262 39258: 84 30 cpi r24, 0x04 ; 4 3925a: 09 f0 breq .+2 ; 0x3925e 3925c: 69 cf rjmp .-302 ; 0x39130 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; 3925e: 82 e0 ldi r24, 0x02 ; 2 39260: 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; 39262: 80 e0 ldi r24, 0x00 ; 0 39264: 08 95 ret 00039266 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.385]>: #endif namespace MMU2 { template void waitForHotendTargetTemp(uint16_t delay, F f) { 39266: cf 93 push r28 39268: df 93 push r29 3926a: ec 01 movw r28, r24 int16_t thermal_degTargetHotend() { return degTargetHotend(0); } int16_t thermal_degHotend() { return degHotend(0); 3926c: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 39270: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 39274: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 39278: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 3927c: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> while (((thermal_degTargetHotend() - thermal_degHotend()) > 5)) { 39280: 20 91 b6 0d lds r18, 0x0DB6 ; 0x800db6 39284: 30 91 b7 0d lds r19, 0x0DB7 ; 0x800db7 39288: c9 01 movw r24, r18 3928a: 86 1b sub r24, r22 3928c: 97 0b sbc r25, r23 3928e: 06 97 sbiw r24, 0x06 ; 6 39290: 24 f0 brlt .+8 ; 0x3929a (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); 39292: ce 01 movw r24, r28 39294: 0e 94 e4 8c call 0x119c8 ; 0x119c8 39298: e9 cf rjmp .-46 ; 0x3926c (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.385]+0x6> f(); safe_delay_keep_alive(delay); } } 3929a: df 91 pop r29 3929c: cf 91 pop r28 3929e: 08 95 ret 000392a0 : } //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) { 392a0: cf 93 push r28 392a2: df 93 push r29 392a4: 00 d0 rcall .+0 ; 0x392a6 392a6: 00 d0 rcall .+0 ; 0x392a8 392a8: 1f 92 push r1 392aa: cd b7 in r28, 0x3d ; 61 392ac: 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)) 392ae: 87 30 cpi r24, 0x07 ; 7 392b0: 50 f5 brcc .+84 ; 0x39306 392b2: 67 30 cpi r22, 0x07 ; 7 392b4: 40 f5 brcc .+80 ; 0x39306 return false; uint8_t valid_points_mask[7] = { 392b6: 97 e0 ldi r25, 0x07 ; 7 392b8: e6 ec ldi r30, 0xC6 ; 198 392ba: f2 e0 ldi r31, 0x02 ; 2 392bc: de 01 movw r26, r28 392be: 11 96 adiw r26, 0x01 ; 1 392c0: 01 90 ld r0, Z+ 392c2: 0d 92 st X+, r0 392c4: 9a 95 dec r25 392c6: e1 f7 brne .-8 ; 0x392c0 0b1110111,//2 0b1111111,//1 0b1111111,//0 //[0,0] }; return (valid_points_mask[6 - iy] & (1 << (6 - ix))); 392c8: 46 e0 ldi r20, 0x06 ; 6 392ca: 50 e0 ldi r21, 0x00 ; 0 392cc: fa 01 movw r30, r20 392ce: e6 1b sub r30, r22 392d0: f1 09 sbc r31, r1 392d2: 21 e0 ldi r18, 0x01 ; 1 392d4: 30 e0 ldi r19, 0x00 ; 0 392d6: 2c 0f add r18, r28 392d8: 3d 1f adc r19, r29 392da: e2 0f add r30, r18 392dc: f3 1f adc r31, r19 392de: 20 81 ld r18, Z 392e0: 30 e0 ldi r19, 0x00 ; 0 392e2: 48 1b sub r20, r24 392e4: 51 09 sbc r21, r1 392e6: c9 01 movw r24, r18 392e8: 02 c0 rjmp .+4 ; 0x392ee 392ea: 95 95 asr r25 392ec: 87 95 ror r24 392ee: 4a 95 dec r20 392f0: e2 f7 brpl .-8 ; 0x392ea 392f2: 81 70 andi r24, 0x01 ; 1 } 392f4: 27 96 adiw r28, 0x07 ; 7 392f6: 0f b6 in r0, 0x3f ; 63 392f8: f8 94 cli 392fa: de bf out 0x3e, r29 ; 62 392fc: 0f be out 0x3f, r0 ; 63 392fe: cd bf out 0x3d, r28 ; 61 39300: df 91 pop r29 39302: cf 91 pop r28 39304: 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; 39306: 80 e0 ldi r24, 0x00 ; 0 39308: f5 cf rjmp .-22 ; 0x392f4 0003930a : // Number of baby steps applied static int babystepLoadZ = 0; void babystep_load() { babystepLoadZ = 0; 3930a: 10 92 8b 06 sts 0x068B, r1 ; 0x80068b <_ZL13babystepLoadZ.lto_priv.497+0x1> 3930e: 10 92 8a 06 sts 0x068A, r1 ; 0x80068a <_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)) 39312: 80 e1 ldi r24, 0x10 ; 16 39314: 0e 94 9f ee call 0x1dd3e ; 0x1dd3e 39318: 88 23 and r24, r24 3931a: 91 f0 breq .+36 ; 0x39340 { check_babystep(); //checking if babystep is in allowed range, otherwise setting babystep to 0 3931c: 0e 94 7f 79 call 0xf2fe ; 0xf2fe // 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))); 39320: 81 ea ldi r24, 0xA1 ; 161 39322: 9d e0 ldi r25, 0x0D ; 13 39324: 0f 94 1c dc call 0x3b838 ; 0x3b838 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-> 39328: 2b e0 ldi r18, 0x0B ; 11 3932a: 82 9f mul r24, r18 3932c: c0 01 movw r24, r0 3932e: 11 24 eor r1, r1 39330: 80 5b subi r24, 0xB0 ; 176 39332: 92 4f sbci r25, 0xF2 ; 242 39334: 0f 94 2a dc call 0x3b854 ; 0x3b854 39338: 90 93 8b 06 sts 0x068B, r25 ; 0x80068b <_ZL13babystepLoadZ.lto_priv.497+0x1> 3933c: 80 93 8a 06 sts 0x068A, r24 ; 0x80068a <_ZL13babystepLoadZ.lto_priv.497> SERIAL_ECHO("correction: "); SERIAL_ECHO(float(babystepLoadZ) / float(axis_steps_per_mm[Z_AXIS])); SERIAL_ECHOLN(""); #endif } } 39340: 08 95 ret 00039342 : #endif //NEW_XYZCAL // Shift a Z axis by a given delta. // To replace loading of the babystep correction. static void shift_z(float delta) { 39342: 0f 93 push r16 39344: 1f 93 push r17 39346: cf 93 push r28 39348: df 93 push r29 3934a: 00 d0 rcall .+0 ; 0x3934c 3934c: 1f 92 push r1 3934e: cd b7 in r28, 0x3d ; 61 39350: de b7 in r29, 0x3e ; 62 39352: 9b 01 movw r18, r22 39354: ac 01 movw r20, r24 const float curpos_z = current_position[Z_AXIS]; 39356: 02 e9 ldi r16, 0x92 ; 146 39358: 16 e0 ldi r17, 0x06 ; 6 3935a: f8 01 movw r30, r16 3935c: 60 85 ldd r22, Z+8 ; 0x08 3935e: 71 85 ldd r23, Z+9 ; 0x09 39360: 82 85 ldd r24, Z+10 ; 0x0a 39362: 93 85 ldd r25, Z+11 ; 0x0b 39364: 69 83 std Y+1, r22 ; 0x01 39366: 7a 83 std Y+2, r23 ; 0x02 39368: 8b 83 std Y+3, r24 ; 0x03 3936a: 9c 83 std Y+4, r25 ; 0x04 current_position[Z_AXIS] -= delta; 3936c: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 39370: f8 01 movw r30, r16 39372: 60 87 std Z+8, r22 ; 0x08 39374: 71 87 std Z+9, r23 ; 0x09 39376: 82 87 std Z+10, r24 ; 0x0a 39378: 93 87 std Z+11, r25 ; 0x0b plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); 3937a: 65 e5 ldi r22, 0x55 ; 85 3937c: 75 e5 ldi r23, 0x55 ; 85 3937e: 85 e5 ldi r24, 0x55 ; 85 39380: 91 e4 ldi r25, 0x41 ; 65 39382: 0f 94 49 c0 call 0x38092 ; 0x38092 st_synchronize(); 39386: 0f 94 e8 42 call 0x285d0 ; 0x285d0 current_position[Z_AXIS] = curpos_z; 3938a: 89 81 ldd r24, Y+1 ; 0x01 3938c: 9a 81 ldd r25, Y+2 ; 0x02 3938e: ab 81 ldd r26, Y+3 ; 0x03 39390: bc 81 ldd r27, Y+4 ; 0x04 39392: f8 01 movw r30, r16 39394: 80 87 std Z+8, r24 ; 0x08 39396: 91 87 std Z+9, r25 ; 0x09 39398: a2 87 std Z+10, r26 ; 0x0a 3939a: b3 87 std Z+11, r27 ; 0x0b plan_set_z_position(curpos_z); 3939c: ce 01 movw r24, r28 3939e: 01 96 adiw r24, 0x01 ; 1 393a0: 0f 94 f1 63 call 0x2c7e2 ; 0x2c7e2 } 393a4: 0f 90 pop r0 393a6: 0f 90 pop r0 393a8: 0f 90 pop r0 393aa: 0f 90 pop r0 393ac: df 91 pop r29 393ae: cf 91 pop r28 393b0: 1f 91 pop r17 393b2: 0f 91 pop r16 393b4: 08 95 ret 000393b6 : 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])); 393b6: 60 91 8a 06 lds r22, 0x068A ; 0x80068a <_ZL13babystepLoadZ.lto_priv.497> 393ba: 70 91 8b 06 lds r23, 0x068B ; 0x80068b <_ZL13babystepLoadZ.lto_priv.497+0x1> 393be: 07 2e mov r0, r23 393c0: 00 0c add r0, r0 393c2: 88 0b sbc r24, r24 393c4: 99 0b sbc r25, r25 393c6: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 393ca: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 393ce: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 393d2: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 393d6: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 393da: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 393de: 0f 94 a1 c9 call 0x39342 ; 0x39342 babystepLoadZ = 0; 393e2: 10 92 8b 06 sts 0x068B, r1 ; 0x80068b <_ZL13babystepLoadZ.lto_priv.497+0x1> 393e6: 10 92 8a 06 sts 0x068A, r1 ; 0x80068a <_ZL13babystepLoadZ.lto_priv.497> } 393ea: 08 95 ret 000393ec : return sampled; } void go_home_with_z_lift() { 393ec: cf 93 push r28 393ee: df 93 push r29 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 393f0: 0e 94 c3 66 call 0xcd86 ; 0xcd86 // Go home. // First move up to a safe height. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 393f4: c2 e9 ldi r28, 0x92 ; 146 393f6: d6 e0 ldi r29, 0x06 ; 6 393f8: 80 e0 ldi r24, 0x00 ; 0 393fa: 90 e0 ldi r25, 0x00 ; 0 393fc: a0 ea ldi r26, 0xA0 ; 160 393fe: b0 e4 ldi r27, 0x40 ; 64 39400: 88 87 std Y+8, r24 ; 0x08 39402: 99 87 std Y+9, r25 ; 0x09 39404: aa 87 std Y+10, r26 ; 0x0a 39406: bb 87 std Y+11, r27 ; 0x0b go_to_current(homing_feedrate[Z_AXIS] / 60); 39408: 65 e5 ldi r22, 0x55 ; 85 3940a: 75 e5 ldi r23, 0x55 ; 85 3940c: 85 e5 ldi r24, 0x55 ; 85 3940e: 91 e4 ldi r25, 0x41 ; 65 39410: 0f 94 d1 c5 call 0x38ba2 ; 0x38ba2 // Second move to XY [0, 0]. current_position[X_AXIS] = X_MIN_POS + 0.2; 39414: 8d ec ldi r24, 0xCD ; 205 39416: 9c ec ldi r25, 0xCC ; 204 39418: ac e4 ldi r26, 0x4C ; 76 3941a: be e3 ldi r27, 0x3E ; 62 3941c: 88 83 st Y, r24 3941e: 99 83 std Y+1, r25 ; 0x01 39420: aa 83 std Y+2, r26 ; 0x02 39422: bb 83 std Y+3, r27 ; 0x03 current_position[Y_AXIS] = Y_MIN_POS + 0.2; 39424: 83 e3 ldi r24, 0x33 ; 51 39426: 93 e3 ldi r25, 0x33 ; 51 39428: a3 e7 ldi r26, 0x73 ; 115 3942a: b0 ec ldi r27, 0xC0 ; 192 3942c: 8c 83 std Y+4, r24 ; 0x04 3942e: 9d 83 std Y+5, r25 ; 0x05 39430: ae 83 std Y+6, r26 ; 0x06 39432: bf 83 std Y+7, r27 ; 0x07 // Clamp to the physical coordinates. world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 39434: 66 e9 ldi r22, 0x96 ; 150 39436: 76 e0 ldi r23, 0x06 ; 6 39438: ce 01 movw r24, r28 3943a: 0e 94 aa 6a call 0xd554 ; 0xd554 go_to_current((3 * homing_feedrate[X_AXIS]) / 60); 3943e: 60 e0 ldi r22, 0x00 ; 0 39440: 70 e0 ldi r23, 0x00 ; 0 39442: 86 e1 ldi r24, 0x16 ; 22 39444: 93 e4 ldi r25, 0x43 ; 67 39446: 0f 94 d1 c5 call 0x38ba2 ; 0x38ba2 // Third move up to a safe height. current_position[Z_AXIS] = Z_MIN_POS; 3944a: 8a e9 ldi r24, 0x9A ; 154 3944c: 99 e9 ldi r25, 0x99 ; 153 3944e: a9 e1 ldi r26, 0x19 ; 25 39450: be e3 ldi r27, 0x3E ; 62 39452: 88 87 std Y+8, r24 ; 0x08 39454: 99 87 std Y+9, r25 ; 0x09 39456: aa 87 std Y+10, r26 ; 0x0a 39458: bb 87 std Y+11, r27 ; 0x0b go_to_current(homing_feedrate[Z_AXIS] / 60); 3945a: 65 e5 ldi r22, 0x55 ; 85 3945c: 75 e5 ldi r23, 0x55 ; 85 3945e: 85 e5 ldi r24, 0x55 ; 85 39460: 91 e4 ldi r25, 0x41 ; 65 } 39462: df 91 pop r29 39464: 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); 39466: 0d 94 d1 c5 jmp 0x38ba2 ; 0x38ba2 0003946a : #define MESH_BED_CALIBRATION_SHOW_LCD float __attribute__((noinline)) BED_X(const uint8_t col) { return ((float)col * x_mesh_density + BED_X0); 3946a: 68 2f mov r22, r24 3946c: 70 e0 ldi r23, 0x00 ; 0 3946e: 90 e0 ldi r25, 0x00 ; 0 39470: 80 e0 ldi r24, 0x00 ; 0 39472: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 39476: 20 e0 ldi r18, 0x00 ; 0 39478: 30 e0 ldi r19, 0x00 ; 0 3947a: 48 e0 ldi r20, 0x08 ; 8 3947c: 52 e4 ldi r21, 0x42 ; 66 3947e: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 39482: 20 e0 ldi r18, 0x00 ; 0 39484: 30 e0 ldi r19, 0x00 ; 0 39486: 40 e8 ldi r20, 0x80 ; 128 39488: 5f e3 ldi r21, 0x3F ; 63 3948a: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> } 3948e: 08 95 ret 00039490 : // 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() { 39490: 2f 92 push r2 39492: 3f 92 push r3 39494: 4f 92 push r4 39496: 5f 92 push r5 39498: 6f 92 push r6 3949a: 7f 92 push r7 3949c: 8f 92 push r8 3949e: 9f 92 push r9 394a0: af 92 push r10 394a2: bf 92 push r11 394a4: cf 92 push r12 394a6: df 92 push r13 394a8: ef 92 push r14 394aa: ff 92 push r15 394ac: 0f 93 push r16 394ae: 1f 93 push r17 394b0: cf 93 push r28 394b2: df 93 push r29 394b4: 00 d0 rcall .+0 ; 0x394b6 394b6: 00 d0 rcall .+0 ; 0x394b8 394b8: cd b7 in r28, 0x3d ; 61 394ba: de b7 in r29, 0x3e ; 62 bool result = false; #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); 394bc: 84 e0 ldi r24, 0x04 ; 4 394be: 0f 94 d8 25 call 0x24bb0 ; 0x24bb0 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 394c2: 80 91 b7 02 lds r24, 0x02B7 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> 394c6: 8c 83 std Y+4, r24 ; 0x04 check_endstops = check; 394c8: 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); 394cc: 80 e0 ldi r24, 0x00 ; 0 394ce: 0f 94 e2 4d call 0x29bc4 ; 0x29bc4 394d2: 8b 83 std Y+3, r24 ; 0x03 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 394d4: 0e 94 c3 66 call 0xcd86 ; 0xcd86 #ifdef MESH_BED_CALIBRATION_SHOW_LCD lcd_display_message_fullscreen_P(_T(MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1)); 394d8: 8d e9 ldi r24, 0x9D ; 157 394da: 9b e5 ldi r25, 0x5B ; 91 394dc: 0e 94 ac 72 call 0xe558 ; 0xe558 394e0: 0f 94 e4 1f call 0x23fc8 ; 0x23fc8 // display "point xx of yy" lcd_puts_at_P(0,3,_n("1/9")); 394e4: 4b ef ldi r20, 0xFB ; 251 394e6: 50 e7 ldi r21, 0x70 ; 112 394e8: 63 e0 ldi r22, 0x03 ; 3 394ea: 80 e0 ldi r24, 0x00 ; 0 394ec: 0e 94 f4 6e call 0xdde8 ; 0xdde8 394f0: 81 e0 ldi r24, 0x01 ; 1 394f2: 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; 394f6: 80 e0 ldi r24, 0x00 ; 0 394f8: 90 e0 ldi r25, 0x00 ; 0 394fa: a0 ea ldi r26, 0xA0 ; 160 394fc: b0 e4 ldi r27, 0x40 ; 64 394fe: 80 93 9a 06 sts 0x069A, r24 ; 0x80069a 39502: 90 93 9b 06 sts 0x069B, r25 ; 0x80069b 39506: a0 93 9c 06 sts 0x069C, r26 ; 0x80069c 3950a: b0 93 9d 06 sts 0x069D, r27 ; 0x80069d go_to_current(homing_feedrate[Z_AXIS]/60); 3950e: 65 e5 ldi r22, 0x55 ; 85 39510: 75 e5 ldi r23, 0x55 ; 85 39512: 85 e5 ldi r24, 0x55 ; 85 39514: 91 e4 ldi r25, 0x41 ; 65 39516: 0f 94 d1 c5 call 0x38ba2 ; 0x38ba2 #ifdef TMC2130 check_Z_crash(); 3951a: 0e 94 31 7a call 0xf462 ; 0xf462 3951e: 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; 39522: 80 e0 ldi r24, 0x00 ; 0 39524: 90 e0 ldi r25, 0x00 ; 0 39526: a0 e8 ldi r26, 0x80 ; 128 39528: bf e3 ldi r27, 0x3F ; 63 3952a: 80 93 92 06 sts 0x0692, r24 ; 0x800692 3952e: 90 93 93 06 sts 0x0693, r25 ; 0x800693 39532: a0 93 94 06 sts 0x0694, r26 ; 0x800694 39536: b0 93 95 06 sts 0x0695, r27 ; 0x800695 current_position[Y_AXIS] = BED_Y0; 3953a: 80 93 96 06 sts 0x0696, r24 ; 0x800696 3953e: 90 93 97 06 sts 0x0697, r25 ; 0x800697 39542: a0 93 98 06 sts 0x0698, r26 ; 0x800698 39546: b0 93 99 06 sts 0x0699, r27 ; 0x800699 world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 3954a: 66 e9 ldi r22, 0x96 ; 150 3954c: 76 e0 ldi r23, 0x06 ; 6 3954e: 82 e9 ldi r24, 0x92 ; 146 39550: 96 e0 ldi r25, 0x06 ; 6 39552: 0e 94 aa 6a call 0xd554 ; 0xd554 go_to_current(homing_feedrate[X_AXIS]/60); 39556: 60 e0 ldi r22, 0x00 ; 0 39558: 70 e0 ldi r23, 0x00 ; 0 3955a: 88 e4 ldi r24, 0x48 ; 72 3955c: 92 e4 ldi r25, 0x42 ; 66 3955e: 0f 94 d1 c5 call 0x38ba2 ; 0x38ba2 set_destination_to_current(); 39562: 0e 94 3a 68 call 0xd074 ; 0xd074 homeaxis(Z_AXIS); 39566: 50 e0 ldi r21, 0x00 ; 0 39568: 40 e0 ldi r20, 0x00 ; 0 3956a: 61 e0 ldi r22, 0x01 ; 1 3956c: 82 e0 ldi r24, 0x02 ; 2 3956e: 0e 94 6b 7a call 0xf4d6 ; 0xf4d6 if (!find_bed_induction_sensor_point_z()) //Z crash or deviation > 50um 39572: 43 e0 ldi r20, 0x03 ; 3 39574: 60 e0 ldi r22, 0x00 ; 0 39576: 70 e0 ldi r23, 0x00 ; 0 39578: 80 e2 ldi r24, 0x20 ; 32 3957a: 91 ec ldi r25, 0xC1 ; 193 3957c: 0f 94 57 8c call 0x318ae ; 0x318ae 39580: 81 11 cpse r24, r1 39582: 06 c0 rjmp .+12 ; 0x39590 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)); 39584: 81 e5 ldi r24, 0x51 ; 81 39586: 94 e6 ldi r25, 0x64 ; 100 39588: 0e 94 ac 72 call 0xe558 ; 0xe558 3958c: 0e 94 0a 7a call 0xf414 ; 0xf414 float get_z(float x, float y); void set_z(uint8_t ix, uint8_t iy, float z) { z_values[iy][ix] = z; } 39590: 80 91 9a 06 lds r24, 0x069A ; 0x80069a 39594: 90 91 9b 06 lds r25, 0x069B ; 0x80069b 39598: a0 91 9c 06 lds r26, 0x069C ; 0x80069c 3959c: b0 91 9d 06 lds r27, 0x069D ; 0x80069d 395a0: 80 93 c3 13 sts 0x13C3, r24 ; 0x8013c3 395a4: 90 93 c4 13 sts 0x13C4, r25 ; 0x8013c4 395a8: a0 93 c5 13 sts 0x13C5, r26 ; 0x8013c5 395ac: b0 93 c6 13 sts 0x13C6, r27 ; 0x8013c6 395b0: e2 e0 ldi r30, 0x02 ; 2 395b2: f0 e0 ldi r31, 0x00 ; 0 395b4: fa 83 std Y+2, r31 ; 0x02 395b6: 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; 395b8: c1 2c mov r12, r1 395ba: d1 2c mov r13, r1 395bc: 30 ea ldi r19, 0xA0 ; 160 395be: e3 2e mov r14, r19 395c0: 30 e4 ldi r19, 0x40 ; 64 395c2: f3 2e mov r15, r19 go_to_current(homing_feedrate[Z_AXIS]/60); uint8_t ix = mesh_point % MESH_MEAS_NUM_X_POINTS; 395c4: 43 e0 ldi r20, 0x03 ; 3 395c6: 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 395c8: 52 e0 ldi r21, 0x02 ; 2 395ca: 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); 395cc: 00 e0 ldi r16, 0x00 ; 0 395ce: 1c ea ldi r17, 0xAC ; 172 395d0: 67 e0 ldi r22, 0x07 ; 7 395d2: 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(); 395d4: 0e 94 c3 66 call 0xcd86 ; 0xcd86 // Print the decrasing ID of the measurement point. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 395d8: c0 92 9a 06 sts 0x069A, r12 ; 0x80069a 395dc: d0 92 9b 06 sts 0x069B, r13 ; 0x80069b 395e0: e0 92 9c 06 sts 0x069C, r14 ; 0x80069c 395e4: f0 92 9d 06 sts 0x069D, r15 ; 0x80069d go_to_current(homing_feedrate[Z_AXIS]/60); 395e8: 65 e5 ldi r22, 0x55 ; 85 395ea: 75 e5 ldi r23, 0x55 ; 85 395ec: 85 e5 ldi r24, 0x55 ; 85 395ee: 91 e4 ldi r25, 0x41 ; 65 395f0: 0f 94 d1 c5 call 0x38ba2 ; 0x38ba2 uint8_t ix = mesh_point % MESH_MEAS_NUM_X_POINTS; 395f4: 29 81 ldd r18, Y+1 ; 0x01 395f6: 21 50 subi r18, 0x01 ; 1 395f8: 82 2f mov r24, r18 395fa: 6b 2d mov r22, r11 395fc: 0f 94 cb dc call 0x3b996 ; 0x3b996 <__udivmodqi4> 39600: 89 2e mov r8, r25 uint8_t iy = mesh_point / MESH_MEAS_NUM_X_POINTS; 39602: 82 2f mov r24, r18 39604: 0f 94 d7 dc call 0x3b9ae ; 0x3b9ae <__divmodqi4> 39608: 78 2e mov r7, r24 if (iy & 1) ix = (MESH_MEAS_NUM_X_POINTS - 1) - ix; // Zig zag 3960a: 80 ff sbrs r24, 0 3960c: 03 c0 rjmp .+6 ; 0x39614 3960e: f9 2d mov r31, r9 39610: f8 19 sub r31, r8 39612: 8f 2e mov r8, r31 current_position[X_AXIS] = BED_X(ix * 3); 39614: 88 2d mov r24, r8 39616: 88 0f add r24, r24 39618: 88 0d add r24, r8 3961a: 0f 94 35 ca call 0x3946a ; 0x3946a 3961e: 60 93 92 06 sts 0x0692, r22 ; 0x800692 39622: 70 93 93 06 sts 0x0693, r23 ; 0x800693 39626: 80 93 94 06 sts 0x0694, r24 ; 0x800694 3962a: 90 93 95 06 sts 0x0695, r25 ; 0x800695 current_position[Y_AXIS] = BED_Y(iy * 3); 3962e: 87 2d mov r24, r7 39630: 88 0f add r24, r24 39632: 87 0d add r24, r7 39634: 0f 94 35 ca call 0x3946a ; 0x3946a 39638: 60 93 96 06 sts 0x0696, r22 ; 0x800696 3963c: 70 93 97 06 sts 0x0697, r23 ; 0x800697 39640: 80 93 98 06 sts 0x0698, r24 ; 0x800698 39644: 90 93 99 06 sts 0x0699, r25 ; 0x800699 world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 39648: 66 e9 ldi r22, 0x96 ; 150 3964a: 76 e0 ldi r23, 0x06 ; 6 3964c: 82 e9 ldi r24, 0x92 ; 146 3964e: 96 e0 ldi r25, 0x06 ; 6 39650: 0e 94 aa 6a call 0xd554 ; 0xd554 go_to_current(homing_feedrate[X_AXIS]/60); 39654: 60 e0 ldi r22, 0x00 ; 0 39656: 70 e0 ldi r23, 0x00 ; 0 39658: 88 e4 ldi r24, 0x48 ; 72 3965a: 92 e4 ldi r25, 0x42 ; 66 3965c: 0f 94 d1 c5 call 0x38ba2 ; 0x38ba2 #ifdef MESH_BED_CALIBRATION_SHOW_LCD // display "point xx of yy" lcd_set_cursor(0, 3); 39660: 63 e0 ldi r22, 0x03 ; 3 39662: 80 e0 ldi r24, 0x00 ; 0 39664: 0e 94 e0 6e call 0xddc0 ; 0xddc0 lcd_printf_P(PSTR("%d/9"),mesh_point+1); 39668: 8a 81 ldd r24, Y+2 ; 0x02 3966a: 8f 93 push r24 3966c: 99 81 ldd r25, Y+1 ; 0x01 3966e: 9f 93 push r25 39670: 1f 93 push r17 39672: 0f 93 push r16 39674: 0e 94 b9 6e call 0xdd72 ; 0xdd72 #endif /* MESH_BED_CALIBRATION_SHOW_LCD */ if (!find_bed_induction_sensor_point_z()) //Z crash or deviation > 50um 39678: 43 e0 ldi r20, 0x03 ; 3 3967a: 60 e0 ldi r22, 0x00 ; 0 3967c: 70 e0 ldi r23, 0x00 ; 0 3967e: 80 e2 ldi r24, 0x20 ; 32 39680: 91 ec ldi r25, 0xC1 ; 193 39682: 0f 94 57 8c call 0x318ae ; 0x318ae 39686: 58 2e mov r5, r24 39688: 0f 90 pop r0 3968a: 0f 90 pop r0 3968c: 0f 90 pop r0 3968e: 0f 90 pop r0 39690: 88 23 and r24, r24 39692: 09 f4 brne .+2 ; 0x39696 39694: 77 cf rjmp .-274 ; 0x39584 39696: a7 9c mul r10, r7 39698: f0 01 movw r30, r0 3969a: 11 24 eor r1, r1 3969c: e8 0d add r30, r8 3969e: f1 1d adc r31, r1 396a0: ee 0f add r30, r30 396a2: ff 1f adc r31, r31 396a4: ee 0f add r30, r30 396a6: ff 1f adc r31, r31 396a8: ee 53 subi r30, 0x3E ; 62 396aa: fc 4e sbci r31, 0xEC ; 236 396ac: 80 91 9a 06 lds r24, 0x069A ; 0x80069a 396b0: 90 91 9b 06 lds r25, 0x069B ; 0x80069b 396b4: a0 91 9c 06 lds r26, 0x069C ; 0x80069c 396b8: b0 91 9d 06 lds r27, 0x069D ; 0x80069d 396bc: 81 83 std Z+1, r24 ; 0x01 396be: 92 83 std Z+2, r25 ; 0x02 396c0: a3 83 std Z+3, r26 ; 0x03 396c2: b4 83 std Z+4, r27 ; 0x04 396c4: e9 81 ldd r30, Y+1 ; 0x01 396c6: fa 81 ldd r31, Y+2 ; 0x02 396c8: 31 96 adiw r30, 0x01 ; 1 396ca: fa 83 std Y+2, r31 ; 0x02 396cc: 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) { 396ce: 3a 97 sbiw r30, 0x0a ; 10 396d0: 09 f0 breq .+2 ; 0x396d4 396d2: 80 cf rjmp .-256 ; 0x395d4 mbl.set_z(ix, iy, current_position[Z_AXIS]); } { // Verify the span of the Z values. float zmin = mbl.z_values[0][0]; 396d4: 60 90 c3 13 lds r6, 0x13C3 ; 0x8013c3 396d8: 70 90 c4 13 lds r7, 0x13C4 ; 0x8013c4 396dc: 80 90 c5 13 lds r8, 0x13C5 ; 0x8013c5 396e0: 90 90 c6 13 lds r9, 0x13C6 ; 0x8013c6 float zmax = zmin; 396e4: 46 2c mov r4, r6 396e6: a7 2c mov r10, r7 396e8: b8 2c mov r11, r8 396ea: 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]; 396ec: 1e 82 std Y+6, r1 ; 0x06 396ee: 1d 82 std Y+5, r1 ; 0x05 396f0: 02 ec ldi r16, 0xC2 ; 194 396f2: 13 e1 ldi r17, 0x13 ; 19 396f4: 8d 81 ldd r24, Y+5 ; 0x05 396f6: 9e 81 ldd r25, Y+6 ; 0x06 396f8: 8d 53 subi r24, 0x3D ; 61 396fa: 9c 4e sbci r25, 0xEC ; 236 396fc: 9a 83 std Y+2, r25 ; 0x02 396fe: 89 83 std Y+1, r24 ; 0x01 39700: 93 e0 ldi r25, 0x03 ; 3 39702: 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]); 39704: e9 81 ldd r30, Y+1 ; 0x01 39706: fa 81 ldd r31, Y+2 ; 0x02 39708: c1 90 ld r12, Z+ 3970a: d1 90 ld r13, Z+ 3970c: e1 90 ld r14, Z+ 3970e: f1 90 ld r15, Z+ 39710: fa 83 std Y+2, r31 ; 0x02 39712: e9 83 std Y+1, r30 ; 0x01 39714: 93 01 movw r18, r6 39716: a4 01 movw r20, r8 39718: c7 01 movw r24, r14 3971a: b6 01 movw r22, r12 3971c: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 39720: 18 16 cp r1, r24 39722: 14 f0 brlt .+4 ; 0x39728 39724: 36 01 movw r6, r12 39726: 47 01 movw r8, r14 zmax = max(zmax, mbl.z_values[j][i]); 39728: 24 2d mov r18, r4 3972a: 3a 2d mov r19, r10 3972c: 4b 2d mov r20, r11 3972e: 52 2d mov r21, r2 39730: c7 01 movw r24, r14 39732: b6 01 movw r22, r12 39734: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 39738: 87 fd sbrc r24, 7 3973a: 04 c0 rjmp .+8 ; 0x39744 3973c: 4c 2c mov r4, r12 3973e: ad 2c mov r10, r13 39740: be 2c mov r11, r14 39742: 2f 2c mov r2, r15 39744: 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) { 39746: 31 10 cpse r3, r1 39748: dd cf rjmp .-70 ; 0x39704 3974a: 8d 81 ldd r24, Y+5 ; 0x05 3974c: 9e 81 ldd r25, Y+6 ; 0x06 3974e: 4c 96 adiw r24, 0x1c ; 28 39750: 9e 83 std Y+6, r25 ; 0x06 39752: 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) 39754: 84 35 cpi r24, 0x54 ; 84 39756: 91 05 cpc r25, r1 39758: 59 f6 brne .-106 ; 0x396f0 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) { 3975a: 93 01 movw r18, r6 3975c: a4 01 movw r20, r8 3975e: 64 2d mov r22, r4 39760: 7a 2d mov r23, r10 39762: 8b 2d mov r24, r11 39764: 92 2d mov r25, r2 39766: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 3976a: 20 e0 ldi r18, 0x00 ; 0 3976c: 30 e0 ldi r19, 0x00 ; 0 3976e: 40 e4 ldi r20, 0x40 ; 64 39770: 50 e4 ldi r21, 0x40 ; 64 39772: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 39776: 18 16 cp r1, r24 39778: 3c f5 brge .+78 ; 0x397c8 // 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!"); 3977a: 83 ee ldi r24, 0xE3 ; 227 3977c: 9b ea ldi r25, 0xAB ; 171 3977e: 0e 94 7b 79 call 0xf2f6 ; 0xf2f6 // 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; 39782: 51 2c mov r5, r1 39784: fc 81 ldd r31, Y+4 ; 0x04 39786: 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); 3978a: 8b 81 ldd r24, Y+3 ; 0x03 3978c: 0f 94 e2 4d call 0x29bc4 ; 0x29bc4 #ifdef TMC2130 tmc2130_home_exit(); 39790: 0f 94 a9 25 call 0x24b52 ; 0x24b52 #endif return result; } 39794: 85 2d mov r24, r5 39796: 26 96 adiw r28, 0x06 ; 6 39798: 0f b6 in r0, 0x3f ; 63 3979a: f8 94 cli 3979c: de bf out 0x3e, r29 ; 62 3979e: 0f be out 0x3f, r0 ; 63 397a0: cd bf out 0x3d, r28 ; 61 397a2: df 91 pop r29 397a4: cf 91 pop r28 397a6: 1f 91 pop r17 397a8: 0f 91 pop r16 397aa: ff 90 pop r15 397ac: ef 90 pop r14 397ae: df 90 pop r13 397b0: cf 90 pop r12 397b2: bf 90 pop r11 397b4: af 90 pop r10 397b6: 9f 90 pop r9 397b8: 8f 90 pop r8 397ba: 7f 90 pop r7 397bc: 6f 90 pop r6 397be: 5f 90 pop r5 397c0: 4f 90 pop r4 397c2: 3f 90 pop r3 397c4: 2f 90 pop r2 397c6: 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) 397c8: 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; 397ca: 85 ec ldi r24, 0xC5 ; 197 397cc: e8 2e mov r14, r24 397ce: 8f e0 ldi r24, 0x0F ; 15 397d0: f8 2e mov r15, r24 397d2: 68 01 movw r12, r16 for (int8_t j = 0; j < 3; ++ j) for (int8_t i = 0; i < 3; ++ i) { 397d4: 1d 82 std Y+5, r1 ; 0x05 if (i == 0 && j == 0) 397d6: 9d 81 ldd r25, Y+5 ; 0x05 397d8: 91 11 cpse r25, r1 397da: 03 c0 rjmp .+6 ; 0x397e2 397dc: e9 81 ldd r30, Y+1 ; 0x01 397de: ee 23 and r30, r30 397e0: 29 f1 breq .+74 ; 0x3982c continue; float dif = mbl.z_values[j][i] - mbl.z_values[0][0]; 397e2: 20 91 c3 13 lds r18, 0x13C3 ; 0x8013c3 397e6: 30 91 c4 13 lds r19, 0x13C4 ; 0x8013c4 397ea: 40 91 c5 13 lds r20, 0x13C5 ; 0x8013c5 397ee: 50 91 c6 13 lds r21, 0x13C6 ; 0x8013c6 397f2: f6 01 movw r30, r12 397f4: 61 81 ldd r22, Z+1 ; 0x01 397f6: 72 81 ldd r23, Z+2 ; 0x02 397f8: 83 81 ldd r24, Z+3 ; 0x03 397fa: 94 81 ldd r25, Z+4 ; 0x04 397fc: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> int16_t dif_quantized = int16_t(floor(dif * 100.f + 0.5f)); 39800: 20 e0 ldi r18, 0x00 ; 0 39802: 30 e0 ldi r19, 0x00 ; 0 39804: 48 ec ldi r20, 0xC8 ; 200 39806: 52 e4 ldi r21, 0x42 ; 66 39808: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 3980c: 20 e0 ldi r18, 0x00 ; 0 3980e: 30 e0 ldi r19, 0x00 ; 0 39810: 40 e0 ldi r20, 0x00 ; 0 39812: 5f e3 ldi r21, 0x3F ; 63 39814: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 39818: 0f 94 eb de call 0x3bdd6 ; 0x3bdd6 3981c: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 39820: c7 01 movw r24, r14 39822: 0f 94 5e dc call 0x3b8bc ; 0x3b8bc SERIAL_ECHOPGM(", read: "); MYSERIAL.print(dif2, 5); SERIAL_ECHOLNPGM(""); } #endif addr += 2; 39826: f2 e0 ldi r31, 0x02 ; 2 39828: ef 0e add r14, r31 3982a: f1 1c adc r15, r1 3982c: 84 e0 ldi r24, 0x04 ; 4 3982e: c8 0e add r12, r24 39830: d1 1c adc r13, r1 39832: 9d 81 ldd r25, Y+5 ; 0x05 39834: 9f 5f subi r25, 0xFF ; 255 39836: 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) { 39838: 93 30 cpi r25, 0x03 ; 3 3983a: 69 f6 brne .-102 ; 0x397d6 3983c: 04 5e subi r16, 0xE4 ; 228 3983e: 1f 4f sbci r17, 0xFF ; 255 39840: e9 81 ldd r30, Y+1 ; 0x01 39842: ef 5f subi r30, 0xFF ; 255 39844: 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) 39846: e3 30 cpi r30, 0x03 ; 3 39848: 21 f6 brne .-120 ; 0x397d2 #endif addr += 2; } } mbl.reset(); 3984a: 0f 94 4d 8c call 0x3189a ; 0x3189a go_home_with_z_lift(); 3984e: 0f 94 f6 c9 call 0x393ec ; 0x393ec 39852: 98 cf rjmp .-208 ; 0x39784 00039854 : plan_set_position_curposXYZE(); } static inline void update_current_position_z() { current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); 39854: 82 e0 ldi r24, 0x02 ; 2 39856: 0f 94 d4 42 call 0x285a8 ; 0x285a8 3985a: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a 3985e: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b 39862: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c 39866: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d plan_set_z_position(current_position[Z_AXIS]); 3986a: 8a e9 ldi r24, 0x9A ; 154 3986c: 96 e0 ldi r25, 0x06 ; 6 3986e: 0d 94 f1 63 jmp 0x2c7e2 ; 0x2c7e2 00039872 : * 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() { 39872: 4f 92 push r4 39874: 5f 92 push r5 39876: 6f 92 push r6 39878: 7f 92 push r7 3987a: 8f 92 push r8 3987c: 9f 92 push r9 3987e: af 92 push r10 39880: bf 92 push r11 39882: cf 92 push r12 39884: df 92 push r13 39886: ef 92 push r14 39888: ff 92 push r15 3988a: 0f 93 push r16 3988c: 1f 93 push r17 3988e: cf 93 push r28 39890: df 93 push r29 float x = current_position[X_AXIS] - world2machine_shift[0]; 39892: 02 e9 ldi r16, 0x92 ; 146 39894: 16 e0 ldi r17, 0x06 ; 6 39896: c7 e0 ldi r28, 0x07 ; 7 39898: d8 e1 ldi r29, 0x18 ; 24 3989a: 28 81 ld r18, Y 3989c: 39 81 ldd r19, Y+1 ; 0x01 3989e: 4a 81 ldd r20, Y+2 ; 0x02 398a0: 5b 81 ldd r21, Y+3 ; 0x03 398a2: f8 01 movw r30, r16 398a4: 60 81 ld r22, Z 398a6: 71 81 ldd r23, Z+1 ; 0x01 398a8: 82 81 ldd r24, Z+2 ; 0x02 398aa: 93 81 ldd r25, Z+3 ; 0x03 398ac: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 398b0: 4b 01 movw r8, r22 398b2: 5c 01 movw r10, r24 float y = current_position[Y_AXIS] - world2machine_shift[1]; 398b4: 2c 81 ldd r18, Y+4 ; 0x04 398b6: 3d 81 ldd r19, Y+5 ; 0x05 398b8: 4e 81 ldd r20, Y+6 ; 0x06 398ba: 5f 81 ldd r21, Y+7 ; 0x07 398bc: f8 01 movw r30, r16 398be: 64 81 ldd r22, Z+4 ; 0x04 398c0: 75 81 ldd r23, Z+5 ; 0x05 398c2: 86 81 ldd r24, Z+6 ; 0x06 398c4: 97 81 ldd r25, Z+7 ; 0x07 398c6: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 398ca: 6b 01 movw r12, r22 398cc: 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; 398ce: c7 ef ldi r28, 0xF7 ; 247 398d0: d7 e1 ldi r29, 0x17 ; 23 398d2: 28 81 ld r18, Y 398d4: 39 81 ldd r19, Y+1 ; 0x01 398d6: 4a 81 ldd r20, Y+2 ; 0x02 398d8: 5b 81 ldd r21, Y+3 ; 0x03 398da: c5 01 movw r24, r10 398dc: b4 01 movw r22, r8 398de: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 398e2: 2b 01 movw r4, r22 398e4: 3c 01 movw r6, r24 398e6: 2c 81 ldd r18, Y+4 ; 0x04 398e8: 3d 81 ldd r19, Y+5 ; 0x05 398ea: 4e 81 ldd r20, Y+6 ; 0x06 398ec: 5f 81 ldd r21, Y+7 ; 0x07 398ee: c7 01 movw r24, r14 398f0: b6 01 movw r22, r12 398f2: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 398f6: 9b 01 movw r18, r22 398f8: ac 01 movw r20, r24 398fa: c3 01 movw r24, r6 398fc: b2 01 movw r22, r4 398fe: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 39902: f8 01 movw r30, r16 39904: 60 83 st Z, r22 39906: 71 83 std Z+1, r23 ; 0x01 39908: 82 83 std Z+2, r24 ; 0x02 3990a: 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; 3990c: 28 85 ldd r18, Y+8 ; 0x08 3990e: 39 85 ldd r19, Y+9 ; 0x09 39910: 4a 85 ldd r20, Y+10 ; 0x0a 39912: 5b 85 ldd r21, Y+11 ; 0x0b 39914: c5 01 movw r24, r10 39916: b4 01 movw r22, r8 39918: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 3991c: 4b 01 movw r8, r22 3991e: 5c 01 movw r10, r24 39920: 2c 85 ldd r18, Y+12 ; 0x0c 39922: 3d 85 ldd r19, Y+13 ; 0x0d 39924: 4e 85 ldd r20, Y+14 ; 0x0e 39926: 5f 85 ldd r21, Y+15 ; 0x0f 39928: c7 01 movw r24, r14 3992a: b6 01 movw r22, r12 3992c: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 39930: 9b 01 movw r18, r22 39932: ac 01 movw r20, r24 39934: c5 01 movw r24, r10 39936: b4 01 movw r22, r8 39938: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 3993c: f8 01 movw r30, r16 3993e: 64 83 std Z+4, r22 ; 0x04 39940: 75 83 std Z+5, r23 ; 0x05 39942: 86 83 std Z+6, r24 ; 0x06 39944: 97 83 std Z+7, r25 ; 0x07 } 39946: df 91 pop r29 39948: cf 91 pop r28 3994a: 1f 91 pop r17 3994c: 0f 91 pop r16 3994e: ff 90 pop r15 39950: ef 90 pop r14 39952: df 90 pop r13 39954: cf 90 pop r12 39956: bf 90 pop r11 39958: af 90 pop r10 3995a: 9f 90 pop r9 3995c: 8f 90 pop r8 3995e: 7f 90 pop r7 39960: 6f 90 pop r6 39962: 5f 90 pop r5 39964: 4f 90 pop r4 39966: 08 95 ret 00039968 : } return false; } static void world2machine_update(const float vec_x[2], const float vec_y[2], const float cntr[2]) { 39968: 4f 92 push r4 3996a: 5f 92 push r5 3996c: 6f 92 push r6 3996e: 7f 92 push r7 39970: 8f 92 push r8 39972: 9f 92 push r9 39974: af 92 push r10 39976: bf 92 push r11 39978: cf 92 push r12 3997a: df 92 push r13 3997c: ef 92 push r14 3997e: ff 92 push r15 39980: 0f 93 push r16 39982: 1f 93 push r17 39984: cf 93 push r28 39986: df 93 push r29 39988: 00 d0 rcall .+0 ; 0x3998a 3998a: 00 d0 rcall .+0 ; 0x3998c 3998c: 1f 92 push r1 3998e: 1f 92 push r1 39990: cd b7 in r28, 0x3d ; 61 39992: de b7 in r29, 0x3e ; 62 world2machine_rotation_and_skew[0][0] = vec_x[0]; 39994: dc 01 movw r26, r24 39996: cd 90 ld r12, X+ 39998: dd 90 ld r13, X+ 3999a: ed 90 ld r14, X+ 3999c: fc 90 ld r15, X 3999e: 13 97 sbiw r26, 0x03 ; 3 399a0: c0 92 dc 17 sts 0x17DC, r12 ; 0x8017dc 399a4: d0 92 dd 17 sts 0x17DD, r13 ; 0x8017dd 399a8: e0 92 de 17 sts 0x17DE, r14 ; 0x8017de 399ac: f0 92 df 17 sts 0x17DF, r15 ; 0x8017df world2machine_rotation_and_skew[1][0] = vec_x[1]; 399b0: 14 96 adiw r26, 0x04 ; 4 399b2: 0d 91 ld r16, X+ 399b4: 1d 91 ld r17, X+ 399b6: 2d 91 ld r18, X+ 399b8: 3c 91 ld r19, X 399ba: 17 97 sbiw r26, 0x07 ; 7 399bc: 09 83 std Y+1, r16 ; 0x01 399be: 1a 83 std Y+2, r17 ; 0x02 399c0: 2b 83 std Y+3, r18 ; 0x03 399c2: 3c 83 std Y+4, r19 ; 0x04 399c4: 00 93 e4 17 sts 0x17E4, r16 ; 0x8017e4 399c8: 10 93 e5 17 sts 0x17E5, r17 ; 0x8017e5 399cc: 20 93 e6 17 sts 0x17E6, r18 ; 0x8017e6 399d0: 30 93 e7 17 sts 0x17E7, r19 ; 0x8017e7 world2machine_rotation_and_skew[0][1] = vec_y[0]; 399d4: db 01 movw r26, r22 399d6: 0d 91 ld r16, X+ 399d8: 1d 91 ld r17, X+ 399da: 2d 91 ld r18, X+ 399dc: 3c 91 ld r19, X 399de: 13 97 sbiw r26, 0x03 ; 3 399e0: 0d 83 std Y+5, r16 ; 0x05 399e2: 1e 83 std Y+6, r17 ; 0x06 399e4: 2f 83 std Y+7, r18 ; 0x07 399e6: 38 87 std Y+8, r19 ; 0x08 399e8: 00 93 e0 17 sts 0x17E0, r16 ; 0x8017e0 399ec: 10 93 e1 17 sts 0x17E1, r17 ; 0x8017e1 399f0: 20 93 e2 17 sts 0x17E2, r18 ; 0x8017e2 399f4: 30 93 e3 17 sts 0x17E3, r19 ; 0x8017e3 world2machine_rotation_and_skew[1][1] = vec_y[1]; 399f8: 14 96 adiw r26, 0x04 ; 4 399fa: 4d 90 ld r4, X+ 399fc: 5d 90 ld r5, X+ 399fe: 6d 90 ld r6, X+ 39a00: 7c 90 ld r7, X 39a02: 17 97 sbiw r26, 0x07 ; 7 39a04: 40 92 e8 17 sts 0x17E8, r4 ; 0x8017e8 39a08: 50 92 e9 17 sts 0x17E9, r5 ; 0x8017e9 39a0c: 60 92 ea 17 sts 0x17EA, r6 ; 0x8017ea 39a10: 70 92 eb 17 sts 0x17EB, r7 ; 0x8017eb world2machine_shift[0] = cntr[0]; 39a14: fa 01 movw r30, r20 39a16: 60 81 ld r22, Z 39a18: 71 81 ldd r23, Z+1 ; 0x01 39a1a: 82 81 ldd r24, Z+2 ; 0x02 39a1c: 93 81 ldd r25, Z+3 ; 0x03 39a1e: 60 93 07 18 sts 0x1807, r22 ; 0x801807 39a22: 70 93 08 18 sts 0x1808, r23 ; 0x801808 39a26: 80 93 09 18 sts 0x1809, r24 ; 0x801809 39a2a: 90 93 0a 18 sts 0x180A, r25 ; 0x80180a world2machine_shift[1] = cntr[1]; 39a2e: 84 80 ldd r8, Z+4 ; 0x04 39a30: 95 80 ldd r9, Z+5 ; 0x05 39a32: a6 80 ldd r10, Z+6 ; 0x06 39a34: b7 80 ldd r11, Z+7 ; 0x07 39a36: 80 92 0b 18 sts 0x180B, r8 ; 0x80180b 39a3a: 90 92 0c 18 sts 0x180C, r9 ; 0x80180c 39a3e: a0 92 0d 18 sts 0x180D, r10 ; 0x80180d 39a42: b0 92 0e 18 sts 0x180E, r11 ; 0x80180e // No correction. world2machine_correction_mode = WORLD2MACHINE_CORRECTION_NONE; if (world2machine_shift[0] != 0.f || world2machine_shift[1] != 0.f) 39a46: 20 e0 ldi r18, 0x00 ; 0 39a48: 30 e0 ldi r19, 0x00 ; 0 39a4a: a9 01 movw r20, r18 39a4c: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 39a50: 81 11 cpse r24, r1 39a52: aa c0 rjmp .+340 ; 0x39ba8 39a54: 20 e0 ldi r18, 0x00 ; 0 39a56: 30 e0 ldi r19, 0x00 ; 0 39a58: a9 01 movw r20, r18 39a5a: c5 01 movw r24, r10 39a5c: b4 01 movw r22, r8 39a5e: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 39a62: 81 11 cpse r24, r1 39a64: a1 c0 rjmp .+322 ; 0x39ba8 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; 39a66: 10 92 0f 18 sts 0x180F, r1 ; 0x80180f 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 || 39a6a: 20 e0 ldi r18, 0x00 ; 0 39a6c: 30 e0 ldi r19, 0x00 ; 0 39a6e: 40 e8 ldi r20, 0x80 ; 128 39a70: 5f e3 ldi r21, 0x3F ; 63 39a72: c7 01 movw r24, r14 39a74: b6 01 movw r22, r12 39a76: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 39a7a: 81 11 cpse r24, r1 39a7c: 21 c0 rjmp .+66 ; 0x39ac0 39a7e: 20 e0 ldi r18, 0x00 ; 0 39a80: 30 e0 ldi r19, 0x00 ; 0 39a82: a9 01 movw r20, r18 39a84: 6d 81 ldd r22, Y+5 ; 0x05 39a86: 7e 81 ldd r23, Y+6 ; 0x06 39a88: 8f 81 ldd r24, Y+7 ; 0x07 39a8a: 98 85 ldd r25, Y+8 ; 0x08 39a8c: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 39a90: 81 11 cpse r24, r1 39a92: 16 c0 rjmp .+44 ; 0x39ac0 39a94: 20 e0 ldi r18, 0x00 ; 0 39a96: 30 e0 ldi r19, 0x00 ; 0 39a98: a9 01 movw r20, r18 39a9a: 69 81 ldd r22, Y+1 ; 0x01 39a9c: 7a 81 ldd r23, Y+2 ; 0x02 39a9e: 8b 81 ldd r24, Y+3 ; 0x03 39aa0: 9c 81 ldd r25, Y+4 ; 0x04 39aa2: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 39aa6: 81 11 cpse r24, r1 39aa8: 0b c0 rjmp .+22 ; 0x39ac0 world2machine_rotation_and_skew[1][0] != 0.f || world2machine_rotation_and_skew[1][1] != 1.f) { 39aaa: 20 e0 ldi r18, 0x00 ; 0 39aac: 30 e0 ldi r19, 0x00 ; 0 39aae: 40 e8 ldi r20, 0x80 ; 128 39ab0: 5f e3 ldi r21, 0x3F ; 63 39ab2: c3 01 movw r24, r6 39ab4: b2 01 movw r22, r4 39ab6: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 39aba: 88 23 and r24, r24 39abc: 09 f4 brne .+2 ; 0x39ac0 39abe: 78 c0 rjmp .+240 ; 0x39bb0 // Rotation & skew correction. world2machine_correction_mode |= WORLD2MACHINE_CORRECTION_SKEW; 39ac0: 80 91 0f 18 lds r24, 0x180F ; 0x80180f 39ac4: 82 60 ori r24, 0x02 ; 2 39ac6: 80 93 0f 18 sts 0x180F, r24 ; 0x80180f // 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]; 39aca: a3 01 movw r20, r6 39acc: 92 01 movw r18, r4 39ace: c7 01 movw r24, r14 39ad0: b6 01 movw r22, r12 39ad2: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 39ad6: 4b 01 movw r8, r22 39ad8: 5c 01 movw r10, r24 39ada: 2d 81 ldd r18, Y+5 ; 0x05 39adc: 3e 81 ldd r19, Y+6 ; 0x06 39ade: 4f 81 ldd r20, Y+7 ; 0x07 39ae0: 58 85 ldd r21, Y+8 ; 0x08 39ae2: 69 81 ldd r22, Y+1 ; 0x01 39ae4: 7a 81 ldd r23, Y+2 ; 0x02 39ae6: 8b 81 ldd r24, Y+3 ; 0x03 39ae8: 9c 81 ldd r25, Y+4 ; 0x04 39aea: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 39aee: 9b 01 movw r18, r22 39af0: ac 01 movw r20, r24 39af2: c5 01 movw r24, r10 39af4: b4 01 movw r22, r8 39af6: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 39afa: 4b 01 movw r8, r22 39afc: 5c 01 movw r10, r24 world2machine_rotation_and_skew_inv[0][0] = world2machine_rotation_and_skew[1][1] / d; 39afe: ac 01 movw r20, r24 39b00: 9b 01 movw r18, r22 39b02: c3 01 movw r24, r6 39b04: b2 01 movw r22, r4 39b06: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 39b0a: 60 93 f7 17 sts 0x17F7, r22 ; 0x8017f7 39b0e: 70 93 f8 17 sts 0x17F8, r23 ; 0x8017f8 39b12: 80 93 f9 17 sts 0x17F9, r24 ; 0x8017f9 39b16: 90 93 fa 17 sts 0x17FA, r25 ; 0x8017fa world2machine_rotation_and_skew_inv[0][1] = -world2machine_rotation_and_skew[0][1] / d; 39b1a: 6d 81 ldd r22, Y+5 ; 0x05 39b1c: 7e 81 ldd r23, Y+6 ; 0x06 39b1e: 8f 81 ldd r24, Y+7 ; 0x07 39b20: 98 85 ldd r25, Y+8 ; 0x08 39b22: 90 58 subi r25, 0x80 ; 128 39b24: a5 01 movw r20, r10 39b26: 94 01 movw r18, r8 39b28: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 39b2c: 60 93 fb 17 sts 0x17FB, r22 ; 0x8017fb 39b30: 70 93 fc 17 sts 0x17FC, r23 ; 0x8017fc 39b34: 80 93 fd 17 sts 0x17FD, r24 ; 0x8017fd 39b38: 90 93 fe 17 sts 0x17FE, r25 ; 0x8017fe world2machine_rotation_and_skew_inv[1][0] = -world2machine_rotation_and_skew[1][0] / d; 39b3c: 69 81 ldd r22, Y+1 ; 0x01 39b3e: 7a 81 ldd r23, Y+2 ; 0x02 39b40: 8b 81 ldd r24, Y+3 ; 0x03 39b42: 9c 81 ldd r25, Y+4 ; 0x04 39b44: 90 58 subi r25, 0x80 ; 128 39b46: a5 01 movw r20, r10 39b48: 94 01 movw r18, r8 39b4a: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 39b4e: 60 93 ff 17 sts 0x17FF, r22 ; 0x8017ff 39b52: 70 93 00 18 sts 0x1800, r23 ; 0x801800 39b56: 80 93 01 18 sts 0x1801, r24 ; 0x801801 39b5a: 90 93 02 18 sts 0x1802, r25 ; 0x801802 world2machine_rotation_and_skew_inv[1][1] = world2machine_rotation_and_skew[0][0] / d; 39b5e: a5 01 movw r20, r10 39b60: 94 01 movw r18, r8 39b62: c7 01 movw r24, r14 39b64: b6 01 movw r22, r12 39b66: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__divsf3> 39b6a: 60 93 03 18 sts 0x1803, r22 ; 0x801803 39b6e: 70 93 04 18 sts 0x1804, r23 ; 0x801804 39b72: 80 93 05 18 sts 0x1805, r24 ; 0x801805 39b76: 90 93 06 18 sts 0x1806, r25 ; 0x801806 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; } } 39b7a: 28 96 adiw r28, 0x08 ; 8 39b7c: 0f b6 in r0, 0x3f ; 63 39b7e: f8 94 cli 39b80: de bf out 0x3e, r29 ; 62 39b82: 0f be out 0x3f, r0 ; 63 39b84: cd bf out 0x3d, r28 ; 61 39b86: df 91 pop r29 39b88: cf 91 pop r28 39b8a: 1f 91 pop r17 39b8c: 0f 91 pop r16 39b8e: ff 90 pop r15 39b90: ef 90 pop r14 39b92: df 90 pop r13 39b94: cf 90 pop r12 39b96: bf 90 pop r11 39b98: af 90 pop r10 39b9a: 9f 90 pop r9 39b9c: 8f 90 pop r8 39b9e: 7f 90 pop r7 39ba0: 6f 90 pop r6 39ba2: 5f 90 pop r5 39ba4: 4f 90 pop r4 39ba6: 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; 39ba8: 81 e0 ldi r24, 0x01 ; 1 39baa: 80 93 0f 18 sts 0x180F, r24 ; 0x80180f 39bae: 5d cf rjmp .-326 ; 0x39a6a 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; 39bb0: 80 e0 ldi r24, 0x00 ; 0 39bb2: 90 e0 ldi r25, 0x00 ; 0 39bb4: a0 e8 ldi r26, 0x80 ; 128 39bb6: bf e3 ldi r27, 0x3F ; 63 39bb8: 80 93 f7 17 sts 0x17F7, r24 ; 0x8017f7 39bbc: 90 93 f8 17 sts 0x17F8, r25 ; 0x8017f8 39bc0: a0 93 f9 17 sts 0x17F9, r26 ; 0x8017f9 39bc4: b0 93 fa 17 sts 0x17FA, r27 ; 0x8017fa world2machine_rotation_and_skew_inv[0][1] = 0.f; 39bc8: 10 92 fb 17 sts 0x17FB, r1 ; 0x8017fb 39bcc: 10 92 fc 17 sts 0x17FC, r1 ; 0x8017fc 39bd0: 10 92 fd 17 sts 0x17FD, r1 ; 0x8017fd 39bd4: 10 92 fe 17 sts 0x17FE, r1 ; 0x8017fe world2machine_rotation_and_skew_inv[1][0] = 0.f; 39bd8: 10 92 ff 17 sts 0x17FF, r1 ; 0x8017ff 39bdc: 10 92 00 18 sts 0x1800, r1 ; 0x801800 39be0: 10 92 01 18 sts 0x1801, r1 ; 0x801801 39be4: 10 92 02 18 sts 0x1802, r1 ; 0x801802 world2machine_rotation_and_skew_inv[1][1] = 1.f; 39be8: 80 93 03 18 sts 0x1803, r24 ; 0x801803 39bec: 90 93 04 18 sts 0x1804, r25 ; 0x801804 39bf0: a0 93 05 18 sts 0x1805, r26 ; 0x801805 39bf4: b0 93 06 18 sts 0x1806, r27 ; 0x801806 39bf8: c0 cf rjmp .-128 ; 0x39b7a 00039bfa : * * 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() { 39bfa: cf 93 push r28 39bfc: df 93 push r29 39bfe: cd b7 in r28, 0x3d ; 61 39c00: de b7 in r29, 0x3e ; 62 39c02: 68 97 sbiw r28, 0x18 ; 24 39c04: 0f b6 in r0, 0x3f ; 63 39c06: f8 94 cli 39c08: de bf out 0x3e, r29 ; 62 39c0a: 0f be out 0x3f, r0 ; 63 39c0c: cd bf out 0x3d, r28 ; 61 const float vx[] = { 1.f, 0.f }; 39c0e: 80 e0 ldi r24, 0x00 ; 0 39c10: 90 e0 ldi r25, 0x00 ; 0 39c12: a0 e8 ldi r26, 0x80 ; 128 39c14: bf e3 ldi r27, 0x3F ; 63 39c16: 89 83 std Y+1, r24 ; 0x01 39c18: 9a 83 std Y+2, r25 ; 0x02 39c1a: ab 83 std Y+3, r26 ; 0x03 39c1c: bc 83 std Y+4, r27 ; 0x04 39c1e: 1d 82 std Y+5, r1 ; 0x05 39c20: 1e 82 std Y+6, r1 ; 0x06 39c22: 1f 82 std Y+7, r1 ; 0x07 39c24: 18 86 std Y+8, r1 ; 0x08 const float vy[] = { 0.f, 1.f }; 39c26: 19 86 std Y+9, r1 ; 0x09 39c28: 1a 86 std Y+10, r1 ; 0x0a 39c2a: 1b 86 std Y+11, r1 ; 0x0b 39c2c: 1c 86 std Y+12, r1 ; 0x0c 39c2e: 8d 87 std Y+13, r24 ; 0x0d 39c30: 9e 87 std Y+14, r25 ; 0x0e 39c32: af 87 std Y+15, r26 ; 0x0f 39c34: b8 8b std Y+16, r27 ; 0x10 const float cntr[] = { 0.f, 0.f }; 39c36: 19 8a std Y+17, r1 ; 0x11 39c38: 1a 8a std Y+18, r1 ; 0x12 39c3a: 1b 8a std Y+19, r1 ; 0x13 39c3c: 1c 8a std Y+20, r1 ; 0x14 39c3e: 1d 8a std Y+21, r1 ; 0x15 39c40: 1e 8a std Y+22, r1 ; 0x16 39c42: 1f 8a std Y+23, r1 ; 0x17 39c44: 18 8e std Y+24, r1 ; 0x18 world2machine_update(vx, vy, cntr); 39c46: ae 01 movw r20, r28 39c48: 4f 5e subi r20, 0xEF ; 239 39c4a: 5f 4f sbci r21, 0xFF ; 255 39c4c: be 01 movw r22, r28 39c4e: 67 5f subi r22, 0xF7 ; 247 39c50: 7f 4f sbci r23, 0xFF ; 255 39c52: ce 01 movw r24, r28 39c54: 01 96 adiw r24, 0x01 ; 1 39c56: 0f 94 b4 cc call 0x39968 ; 0x39968 } 39c5a: 68 96 adiw r28, 0x18 ; 24 39c5c: 0f b6 in r0, 0x3f ; 63 39c5e: f8 94 cli 39c60: de bf out 0x3e, r29 ; 62 39c62: 0f be out 0x3f, r0 ; 63 39c64: cd bf out 0x3d, r28 ; 61 39c66: df 91 pop r29 39c68: cf 91 pop r28 39c6a: 08 95 ret 00039c6c : * * 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) { 39c6c: 80 91 0f 18 lds r24, 0x180F ; 0x80180f 39c70: 88 23 and r24, r24 39c72: d1 f0 breq .+52 ; 0x39ca8 world2machine_reset(); 39c74: 0f 94 fd cd call 0x39bfa ; 0x39bfa st_synchronize(); 39c78: 0f 94 e8 42 call 0x285d0 ; 0x285d0 current_position[X_AXIS] = st_get_position_mm(X_AXIS); 39c7c: 80 e0 ldi r24, 0x00 ; 0 39c7e: 0f 94 d4 42 call 0x285a8 ; 0x285a8 39c82: 60 93 92 06 sts 0x0692, r22 ; 0x800692 39c86: 70 93 93 06 sts 0x0693, r23 ; 0x800693 39c8a: 80 93 94 06 sts 0x0694, r24 ; 0x800694 39c8e: 90 93 95 06 sts 0x0695, r25 ; 0x800695 current_position[Y_AXIS] = st_get_position_mm(Y_AXIS); 39c92: 81 e0 ldi r24, 0x01 ; 1 39c94: 0f 94 d4 42 call 0x285a8 ; 0x285a8 39c98: 60 93 96 06 sts 0x0696, r22 ; 0x800696 39c9c: 70 93 97 06 sts 0x0697, r23 ; 0x800697 39ca0: 80 93 98 06 sts 0x0698, r24 ; 0x800698 39ca4: 90 93 99 06 sts 0x0699, r25 ; 0x800699 } } 39ca8: 08 95 ret 00039caa : if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); 39caa: 4f ef ldi r20, 0xFF ; 255 39cac: 5f ef ldi r21, 0xFF ; 255 39cae: ba 01 movw r22, r20 39cb0: 85 ee ldi r24, 0xE5 ; 229 39cb2: 9f e0 ldi r25, 0x0F ; 15 39cb4: 0f 94 52 dc call 0x3b8a4 ; 0x3b8a4 39cb8: 4f ef ldi r20, 0xFF ; 255 39cba: 5f ef ldi r21, 0xFF ; 255 39cbc: ba 01 movw r22, r20 39cbe: 89 ee ldi r24, 0xE9 ; 233 39cc0: 9f e0 ldi r25, 0x0F ; 15 39cc2: 0f 94 52 dc call 0x3b8a4 ; 0x3b8a4 39cc6: 4f ef ldi r20, 0xFF ; 255 39cc8: 5f ef ldi r21, 0xFF ; 255 39cca: ba 01 movw r22, r20 39ccc: 8d ed ldi r24, 0xDD ; 221 39cce: 9f e0 ldi r25, 0x0F ; 15 39cd0: 0f 94 52 dc call 0x3b8a4 ; 0x3b8a4 39cd4: 4f ef ldi r20, 0xFF ; 255 39cd6: 5f ef ldi r21, 0xFF ; 255 39cd8: ba 01 movw r22, r20 39cda: 81 ee ldi r24, 0xE1 ; 225 39cdc: 9f e0 ldi r25, 0x0F ; 15 39cde: 0f 94 52 dc call 0x3b8a4 ; 0x3b8a4 39ce2: 4f ef ldi r20, 0xFF ; 255 39ce4: 5f ef ldi r21, 0xFF ; 255 39ce6: ba 01 movw r22, r20 39ce8: 85 ed ldi r24, 0xD5 ; 213 39cea: 9f e0 ldi r25, 0x0F ; 15 39cec: 0f 94 52 dc call 0x3b8a4 ; 0x3b8a4 39cf0: 4f ef ldi r20, 0xFF ; 255 39cf2: 5f ef ldi r21, 0xFF ; 255 39cf4: ba 01 movw r22, r20 39cf6: 89 ed ldi r24, 0xD9 ; 217 39cf8: 9f e0 ldi r25, 0x0F ; 15 39cfa: 0f 94 52 dc call 0x3b8a4 ; 0x3b8a4 39cfe: 4f ef ldi r20, 0xFF ; 255 39d00: 5f ef ldi r21, 0xFF ; 255 39d02: ba 01 movw r22, r20 39d04: 85 ec ldi r24, 0xC5 ; 197 39d06: 9f e0 ldi r25, 0x0F ; 15 39d08: 0f 94 52 dc call 0x3b8a4 ; 0x3b8a4 39d0c: 4f ef ldi r20, 0xFF ; 255 39d0e: 5f ef ldi r21, 0xFF ; 255 39d10: ba 01 movw r22, r20 39d12: 89 ec ldi r24, 0xC9 ; 201 39d14: 9f e0 ldi r25, 0x0F ; 15 39d16: 0f 94 52 dc call 0x3b8a4 ; 0x3b8a4 39d1a: 4f ef ldi r20, 0xFF ; 255 39d1c: 5f ef ldi r21, 0xFF ; 255 39d1e: ba 01 movw r22, r20 39d20: 8d ec ldi r24, 0xCD ; 205 39d22: 9f e0 ldi r25, 0x0F ; 15 39d24: 0f 94 52 dc call 0x3b8a4 ; 0x3b8a4 39d28: 4f ef ldi r20, 0xFF ; 255 39d2a: 5f ef ldi r21, 0xFF ; 255 39d2c: ba 01 movw r22, r20 39d2e: 81 ed ldi r24, 0xD1 ; 209 39d30: 9f e0 ldi r25, 0x0F ; 15 39d32: 0d 94 52 dc jmp 0x3b8a4 ; 0x3b8a4 00039d36 : /** * @brief Read and apply validated calibration data from EEPROM */ void world2machine_initialize() { 39d36: 4f 92 push r4 39d38: 5f 92 push r5 39d3a: 6f 92 push r6 39d3c: 7f 92 push r7 39d3e: 8f 92 push r8 39d40: 9f 92 push r9 39d42: af 92 push r10 39d44: bf 92 push r11 39d46: cf 92 push r12 39d48: df 92 push r13 39d4a: ef 92 push r14 39d4c: ff 92 push r15 39d4e: 1f 93 push r17 39d50: cf 93 push r28 39d52: df 93 push r29 39d54: cd b7 in r28, 0x3d ; 61 39d56: de b7 in r29, 0x3e ; 62 39d58: a8 97 sbiw r28, 0x28 ; 40 39d5a: 0f b6 in r0, 0x3f ; 63 39d5c: f8 94 cli 39d5e: de bf out 0x3e, r29 ; 62 39d60: 0f be out 0x3f, r0 ; 63 39d62: 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); 39d64: 48 e0 ldi r20, 0x08 ; 8 39d66: 50 e0 ldi r21, 0x00 ; 0 39d68: 6d ed ldi r22, 0xDD ; 221 39d6a: 7f e0 ldi r23, 0x0F ; 15 39d6c: ce 01 movw r24, r28 39d6e: 01 96 adiw r24, 0x01 ; 1 39d70: 0f 94 0c dc call 0x3b818 ; 0x3b818 eeprom_read_block(&vec_y[0], (float*)(EEPROM_BED_CALIBRATION_VEC_Y), 8); 39d74: 48 e0 ldi r20, 0x08 ; 8 39d76: 50 e0 ldi r21, 0x00 ; 0 39d78: 65 ed ldi r22, 0xD5 ; 213 39d7a: 7f e0 ldi r23, 0x0F ; 15 39d7c: ce 01 movw r24, r28 39d7e: 09 96 adiw r24, 0x09 ; 9 39d80: 0f 94 0c dc call 0x3b818 ; 0x3b818 eeprom_read_block(&cntr[0], (float*)(EEPROM_BED_CALIBRATION_CENTER), 8); 39d84: 48 e0 ldi r20, 0x08 ; 8 39d86: 50 e0 ldi r21, 0x00 ; 0 39d88: 65 ee ldi r22, 0xE5 ; 229 39d8a: 7f e0 ldi r23, 0x0F ; 15 39d8c: ce 01 movw r24, r28 39d8e: 41 96 adiw r24, 0x11 ; 17 39d90: 0f 94 0c dc call 0x3b818 ; 0x3b818 } static inline bool vec_undef(const float v[2]) { const uint32_t *vx = (const uint32_t*)v; return vx[0] == 0xFFFFFFFF || vx[1] == 0xFFFFFFFF; 39d94: 89 89 ldd r24, Y+17 ; 0x11 39d96: 9a 89 ldd r25, Y+18 ; 0x12 39d98: ab 89 ldd r26, Y+19 ; 0x13 39d9a: bc 89 ldd r27, Y+20 ; 0x14 39d9c: 89 a3 std Y+33, r24 ; 0x21 39d9e: 9a a3 std Y+34, r25 ; 0x22 39da0: ab a3 std Y+35, r26 ; 0x23 39da2: bc a3 std Y+36, r27 ; 0x24 39da4: 8f 3f cpi r24, 0xFF ; 255 39da6: 9f 4f sbci r25, 0xFF ; 255 39da8: af 4f sbci r26, 0xFF ; 255 39daa: bf 4f sbci r27, 0xFF ; 255 39dac: 09 f4 brne .+2 ; 0x39db0 39dae: b1 c0 rjmp .+354 ; 0x39f12 39db0: 8d 89 ldd r24, Y+21 ; 0x15 39db2: 9e 89 ldd r25, Y+22 ; 0x16 39db4: af 89 ldd r26, Y+23 ; 0x17 39db6: b8 8d ldd r27, Y+24 ; 0x18 39db8: 8d a3 std Y+37, r24 ; 0x25 39dba: 9e a3 std Y+38, r25 ; 0x26 39dbc: af a3 std Y+39, r26 ; 0x27 39dbe: b8 a7 std Y+40, r27 ; 0x28 39dc0: 8f 3f cpi r24, 0xFF ; 255 39dc2: 9f 4f sbci r25, 0xFF ; 255 39dc4: af 4f sbci r26, 0xFF ; 255 39dc6: bf 4f sbci r27, 0xFF ; 255 39dc8: 09 f4 brne .+2 ; 0x39dcc 39dca: a3 c0 rjmp .+326 ; 0x39f12 39dcc: 89 80 ldd r8, Y+1 ; 0x01 39dce: 9a 80 ldd r9, Y+2 ; 0x02 39dd0: ab 80 ldd r10, Y+3 ; 0x03 39dd2: bc 80 ldd r11, Y+4 ; 0x04 39dd4: 8f ef ldi r24, 0xFF ; 255 39dd6: 88 16 cp r8, r24 39dd8: 98 06 cpc r9, r24 39dda: a8 06 cpc r10, r24 39ddc: b8 06 cpc r11, r24 39dde: 09 f4 brne .+2 ; 0x39de2 39de0: 98 c0 rjmp .+304 ; 0x39f12 39de2: 8d 81 ldd r24, Y+5 ; 0x05 39de4: 9e 81 ldd r25, Y+6 ; 0x06 39de6: af 81 ldd r26, Y+7 ; 0x07 39de8: b8 85 ldd r27, Y+8 ; 0x08 39dea: 89 8f std Y+25, r24 ; 0x19 39dec: 9a 8f std Y+26, r25 ; 0x1a 39dee: ab 8f std Y+27, r26 ; 0x1b 39df0: bc 8f std Y+28, r27 ; 0x1c 39df2: 8f 3f cpi r24, 0xFF ; 255 39df4: 9f 4f sbci r25, 0xFF ; 255 39df6: af 4f sbci r26, 0xFF ; 255 39df8: bf 4f sbci r27, 0xFF ; 255 39dfa: 09 f4 brne .+2 ; 0x39dfe 39dfc: 8a c0 rjmp .+276 ; 0x39f12 39dfe: c9 84 ldd r12, Y+9 ; 0x09 39e00: da 84 ldd r13, Y+10 ; 0x0a 39e02: eb 84 ldd r14, Y+11 ; 0x0b 39e04: fc 84 ldd r15, Y+12 ; 0x0c 39e06: 8f ef ldi r24, 0xFF ; 255 39e08: c8 16 cp r12, r24 39e0a: d8 06 cpc r13, r24 39e0c: e8 06 cpc r14, r24 39e0e: f8 06 cpc r15, r24 39e10: 09 f4 brne .+2 ; 0x39e14 39e12: 7f c0 rjmp .+254 ; 0x39f12 39e14: 8d 85 ldd r24, Y+13 ; 0x0d 39e16: 9e 85 ldd r25, Y+14 ; 0x0e 39e18: af 85 ldd r26, Y+15 ; 0x0f 39e1a: b8 89 ldd r27, Y+16 ; 0x10 39e1c: 8d 8f std Y+29, r24 ; 0x1d 39e1e: 9e 8f std Y+30, r25 ; 0x1e 39e20: af 8f std Y+31, r26 ; 0x1f 39e22: b8 a3 std Y+32, r27 ; 0x20 39e24: 8f 3f cpi r24, 0xFF ; 255 39e26: 9f 4f sbci r25, 0xFF ; 255 39e28: af 4f sbci r26, 0xFF ; 255 39e2a: bf 4f sbci r27, 0xFF ; 255 39e2c: 09 f4 brne .+2 ; 0x39e30 39e2e: 71 c0 rjmp .+226 ; 0x39f12 reset = true; } else { // Length of the vec_x shall be close to unity. float l = hypot(vec_x[0], vec_x[1]); 39e30: 29 8d ldd r18, Y+25 ; 0x19 39e32: 3a 8d ldd r19, Y+26 ; 0x1a 39e34: 4b 8d ldd r20, Y+27 ; 0x1b 39e36: 5c 8d ldd r21, Y+28 ; 0x1c 39e38: c5 01 movw r24, r10 39e3a: b4 01 movw r22, r8 39e3c: 0f 94 e0 df call 0x3bfc0 ; 0x3bfc0 39e40: 2b 01 movw r4, r22 39e42: 3c 01 movw r6, r24 if (l < 0.9 || l > 1.1) 39e44: 26 e6 ldi r18, 0x66 ; 102 39e46: 36 e6 ldi r19, 0x66 ; 102 39e48: 46 e6 ldi r20, 0x66 ; 102 39e4a: 5f e3 ldi r21, 0x3F ; 63 39e4c: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__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; 39e50: 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) 39e52: 87 fd sbrc r24, 7 39e54: 0b c0 rjmp .+22 ; 0x39e6c 39e56: 2d ec ldi r18, 0xCD ; 205 39e58: 3c ec ldi r19, 0xCC ; 204 39e5a: 4c e8 ldi r20, 0x8C ; 140 39e5c: 5f e3 ldi r21, 0x3F ; 63 39e5e: c3 01 movw r24, r6 39e60: b2 01 movw r22, r4 39e62: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 39e66: 18 16 cp r1, r24 39e68: 0c f0 brlt .+2 ; 0x39e6c 39e6a: 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]); 39e6c: 2d 8d ldd r18, Y+29 ; 0x1d 39e6e: 3e 8d ldd r19, Y+30 ; 0x1e 39e70: 4f 8d ldd r20, Y+31 ; 0x1f 39e72: 58 a1 ldd r21, Y+32 ; 0x20 39e74: c7 01 movw r24, r14 39e76: b6 01 movw r22, r12 39e78: 0f 94 e0 df call 0x3bfc0 ; 0x3bfc0 39e7c: 2b 01 movw r4, r22 39e7e: 3c 01 movw r6, r24 if (l < 0.9 || l > 1.1) 39e80: 26 e6 ldi r18, 0x66 ; 102 39e82: 36 e6 ldi r19, 0x66 ; 102 39e84: 46 e6 ldi r20, 0x66 ; 102 39e86: 5f e3 ldi r21, 0x3F ; 63 39e88: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 39e8c: 87 fd sbrc r24, 7 39e8e: 7f c0 rjmp .+254 ; 0x39f8e 39e90: 2d ec ldi r18, 0xCD ; 205 39e92: 3c ec ldi r19, 0xCC ; 204 39e94: 4c e8 ldi r20, 0x8C ; 140 39e96: 5f e3 ldi r21, 0x3F ; 63 39e98: c3 01 movw r24, r6 39e9a: b2 01 movw r22, r4 39e9c: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 39ea0: 18 16 cp r1, r24 39ea2: 0c f4 brge .+2 ; 0x39ea6 39ea4: 74 c0 rjmp .+232 ; 0x39f8e 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]); 39ea6: 2d a1 ldd r18, Y+37 ; 0x25 39ea8: 3e a1 ldd r19, Y+38 ; 0x26 39eaa: 4f a1 ldd r20, Y+39 ; 0x27 39eac: 58 a5 ldd r21, Y+40 ; 0x28 39eae: 69 a1 ldd r22, Y+33 ; 0x21 39eb0: 7a a1 ldd r23, Y+34 ; 0x22 39eb2: 8b a1 ldd r24, Y+35 ; 0x23 39eb4: 9c a1 ldd r25, Y+36 ; 0x24 39eb6: 0f 94 e0 df call 0x3bfc0 ; 0x3bfc0 if (l > 15.f) 39eba: 20 e0 ldi r18, 0x00 ; 0 39ebc: 30 e0 ldi r19, 0x00 ; 0 39ebe: 40 e7 ldi r20, 0x70 ; 112 39ec0: 51 e4 ldi r21, 0x41 ; 65 39ec2: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 39ec6: 18 16 cp r1, r24 39ec8: 0c f4 brge .+2 ; 0x39ecc #if 0 SERIAL_ECHOLNPGM("Zero point correction:"); MYSERIAL.println(l); SERIAL_ECHOLNPGM("Invalid bed correction matrix. Shift out of range."); #endif reset = true; 39eca: 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]; 39ecc: a5 01 movw r20, r10 39ece: 94 01 movw r18, r8 39ed0: c7 01 movw r24, r14 39ed2: b6 01 movw r22, r12 39ed4: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 39ed8: 6b 01 movw r12, r22 39eda: 7c 01 movw r14, r24 39edc: 2d 8d ldd r18, Y+29 ; 0x1d 39ede: 3e 8d ldd r19, Y+30 ; 0x1e 39ee0: 4f 8d ldd r20, Y+31 ; 0x1f 39ee2: 58 a1 ldd r21, Y+32 ; 0x20 39ee4: 69 8d ldd r22, Y+25 ; 0x19 39ee6: 7a 8d ldd r23, Y+26 ; 0x1a 39ee8: 8b 8d ldd r24, Y+27 ; 0x1b 39eea: 9c 8d ldd r25, Y+28 ; 0x1c 39eec: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 39ef0: 9b 01 movw r18, r22 39ef2: ac 01 movw r20, r24 39ef4: c7 01 movw r24, r14 39ef6: b6 01 movw r22, r12 39ef8: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> if (fabs(l) > 0.1f) 39efc: 9f 77 andi r25, 0x7F ; 127 39efe: 2d ec ldi r18, 0xCD ; 205 39f00: 3c ec ldi r19, 0xCC ; 204 39f02: 4c ec ldi r20, 0xCC ; 204 39f04: 5d e3 ldi r21, 0x3D ; 61 39f06: 0f 94 cd df call 0x3bf9a ; 0x3bf9a <__gesf2> 39f0a: 18 16 cp r1, r24 39f0c: 14 f0 brlt .+4 ; 0x39f12 #endif reset = true; } } if (reset) 39f0e: 11 23 and r17, r17 39f10: f1 f0 breq .+60 ; 0x39f4e { #if 0 SERIAL_ECHOLNPGM("Invalid bed correction matrix. Resetting to identity."); #endif reset_bed_offset_and_skew(); 39f12: 0f 94 55 ce call 0x39caa ; 0x39caa * @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; 39f16: 80 e0 ldi r24, 0x00 ; 0 39f18: 90 e0 ldi r25, 0x00 ; 0 39f1a: a0 e8 ldi r26, 0x80 ; 128 39f1c: bf e3 ldi r27, 0x3F ; 63 39f1e: 89 83 std Y+1, r24 ; 0x01 39f20: 9a 83 std Y+2, r25 ; 0x02 39f22: ab 83 std Y+3, r26 ; 0x03 39f24: bc 83 std Y+4, r27 ; 0x04 vec_x[1] = 0.f; 39f26: 1d 82 std Y+5, r1 ; 0x05 39f28: 1e 82 std Y+6, r1 ; 0x06 39f2a: 1f 82 std Y+7, r1 ; 0x07 39f2c: 18 86 std Y+8, r1 ; 0x08 vec_y[0] = 0.f; 39f2e: 19 86 std Y+9, r1 ; 0x09 39f30: 1a 86 std Y+10, r1 ; 0x0a 39f32: 1b 86 std Y+11, r1 ; 0x0b 39f34: 1c 86 std Y+12, r1 ; 0x0c vec_y[1] = 1.f; 39f36: 8d 87 std Y+13, r24 ; 0x0d 39f38: 9e 87 std Y+14, r25 ; 0x0e 39f3a: af 87 std Y+15, r26 ; 0x0f 39f3c: b8 8b std Y+16, r27 ; 0x10 cntr[0] = 0.f; 39f3e: 19 8a std Y+17, r1 ; 0x11 39f40: 1a 8a std Y+18, r1 ; 0x12 39f42: 1b 8a std Y+19, r1 ; 0x13 39f44: 1c 8a std Y+20, r1 ; 0x14 #ifdef DEFAULT_Y_OFFSET cntr[1] = DEFAULT_Y_OFFSET; #else cntr[1] = 0.f; 39f46: 1d 8a std Y+21, r1 ; 0x15 39f48: 1e 8a std Y+22, r1 ; 0x16 39f4a: 1f 8a std Y+23, r1 ; 0x17 39f4c: 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); 39f4e: ae 01 movw r20, r28 39f50: 4f 5e subi r20, 0xEF ; 239 39f52: 5f 4f sbci r21, 0xFF ; 255 39f54: be 01 movw r22, r28 39f56: 67 5f subi r22, 0xF7 ; 247 39f58: 7f 4f sbci r23, 0xFF ; 255 39f5a: ce 01 movw r24, r28 39f5c: 01 96 adiw r24, 0x01 ; 1 39f5e: 0f 94 b4 cc call 0x39968 ; 0x39968 MYSERIAL.print(world2machine_shift[0], 5); SERIAL_ECHOPGM(", "); MYSERIAL.print(world2machine_shift[1], 5); SERIAL_ECHOLNPGM(""); #endif } 39f62: a8 96 adiw r28, 0x28 ; 40 39f64: 0f b6 in r0, 0x3f ; 63 39f66: f8 94 cli 39f68: de bf out 0x3e, r29 ; 62 39f6a: 0f be out 0x3f, r0 ; 63 39f6c: cd bf out 0x3d, r28 ; 61 39f6e: df 91 pop r29 39f70: cf 91 pop r28 39f72: 1f 91 pop r17 39f74: ff 90 pop r15 39f76: ef 90 pop r14 39f78: df 90 pop r13 39f7a: cf 90 pop r12 39f7c: bf 90 pop r11 39f7e: af 90 pop r10 39f80: 9f 90 pop r9 39f82: 8f 90 pop r8 39f84: 7f 90 pop r7 39f86: 6f 90 pop r6 39f88: 5f 90 pop r5 39f8a: 4f 90 pop r4 39f8c: 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; 39f8e: 11 e0 ldi r17, 0x01 ; 1 39f90: 8a cf rjmp .-236 ; 0x39ea6 00039f92 : lcd_print_pad_P(title, LCD_WIDTH); lcd_set_cursor(0, 2); } void menu_progressbar_update(uint16_t newVal) { 39f92: cf 93 push r28 uint8_t newCnt = (newVal * LCD_WIDTH) / progressbar_total; 39f94: 24 e1 ldi r18, 0x14 ; 20 39f96: ac 01 movw r20, r24 39f98: 24 9f mul r18, r20 39f9a: c0 01 movw r24, r0 39f9c: 25 9f mul r18, r21 39f9e: 90 0d add r25, r0 39fa0: 11 24 eor r1, r1 39fa2: 60 91 da 17 lds r22, 0x17DA ; 0x8017da 39fa6: 70 91 db 17 lds r23, 0x17DB ; 0x8017db 39faa: 0f 94 e5 dc call 0x3b9ca ; 0x3b9ca <__udivmodhi4> 39fae: c6 2f mov r28, r22 39fb0: 65 31 cpi r22, 0x15 ; 21 39fb2: 08 f0 brcs .+2 ; 0x39fb6 39fb4: c4 e1 ldi r28, 0x14 ; 20 if (newCnt > LCD_WIDTH) newCnt = LCD_WIDTH; while (newCnt > progressbar_block_count) 39fb6: 80 91 d9 17 lds r24, 0x17D9 ; 0x8017d9 39fba: 8c 17 cp r24, r28 39fbc: 48 f4 brcc .+18 ; 0x39fd0 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 39fbe: 8f ef ldi r24, 0xFF ; 255 39fc0: 0e 94 8f 6f call 0xdf1e ; 0xdf1e { lcd_print(LCD_STR_SOLID_BLOCK[0]); progressbar_block_count++; 39fc4: 80 91 d9 17 lds r24, 0x17D9 ; 0x8017d9 39fc8: 8f 5f subi r24, 0xFF ; 255 39fca: 80 93 d9 17 sts 0x17D9, r24 ; 0x8017d9 39fce: f3 cf rjmp .-26 ; 0x39fb6 } } 39fd0: cf 91 pop r28 39fd2: 08 95 ret 00039fd4 : void menu_progressbar_finish(void) { progressbar_total = 1; 39fd4: 81 e0 ldi r24, 0x01 ; 1 39fd6: 90 e0 ldi r25, 0x00 ; 0 39fd8: 90 93 db 17 sts 0x17DB, r25 ; 0x8017db 39fdc: 80 93 da 17 sts 0x17DA, r24 ; 0x8017da menu_progressbar_update(1); 39fe0: 0f 94 c9 cf call 0x39f92 ; 0x39f92 _delay(300); 39fe4: 6c e2 ldi r22, 0x2C ; 44 39fe6: 71 e0 ldi r23, 0x01 ; 1 39fe8: 80 e0 ldi r24, 0x00 ; 0 39fea: 90 e0 ldi r25, 0x00 ; 0 39fec: 0d 94 53 27 jmp 0x24ea6 ; 0x24ea6 00039ff0 : } static uint8_t progressbar_block_count = 0; static uint16_t progressbar_total = 0; void menu_progressbar_init(uint16_t total, const char* title) { 39ff0: 0f 93 push r16 39ff2: 1f 93 push r17 39ff4: cf 93 push r28 39ff6: df 93 push r29 39ff8: 8c 01 movw r16, r24 39ffa: eb 01 movw r28, r22 lcd_clear(); 39ffc: 0e 94 13 6f call 0xde26 ; 0xde26 progressbar_block_count = 0; 3a000: 10 92 d9 17 sts 0x17D9, r1 ; 0x8017d9 progressbar_total = total; 3a004: 10 93 db 17 sts 0x17DB, r17 ; 0x8017db 3a008: 00 93 da 17 sts 0x17DA, r16 ; 0x8017da lcd_set_cursor(0, 1); 3a00c: 61 e0 ldi r22, 0x01 ; 1 3a00e: 80 e0 ldi r24, 0x00 ; 0 3a010: 0e 94 e0 6e call 0xddc0 ; 0xddc0 lcd_print_pad_P(title, LCD_WIDTH); 3a014: 64 e1 ldi r22, 0x14 ; 20 3a016: ce 01 movw r24, r28 3a018: 0e 94 b5 70 call 0xe16a ; 0xe16a lcd_set_cursor(0, 2); 3a01c: 62 e0 ldi r22, 0x02 ; 2 3a01e: 80 e0 ldi r24, 0x00 ; 0 } 3a020: df 91 pop r29 3a022: cf 91 pop r28 3a024: 1f 91 pop r17 3a026: 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); 3a028: 0c 94 e0 6e jmp 0xddc0 ; 0xddc0 0003a02c : } menu_item++; } bool __attribute__((noinline)) menu_item_leave(){ return ((menu_item == menu_line) && menu_clicked && (lcd_encoder == menu_item)) || menu_leaving; 3a02c: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a030: 90 91 14 05 lds r25, 0x0514 ; 0x800514 3a034: 89 13 cpse r24, r25 3a036: 0b c0 rjmp .+22 ; 0x3a04e 3a038: 90 91 13 05 lds r25, 0x0513 ; 0x800513 3a03c: 99 23 and r25, r25 3a03e: 39 f0 breq .+14 ; 0x3a04e 3a040: 20 91 70 06 lds r18, 0x0670 ; 0x800670 3a044: 30 91 71 06 lds r19, 0x0671 ; 0x800671 3a048: 82 17 cp r24, r18 3a04a: 13 06 cpc r1, r19 3a04c: 39 f0 breq .+14 ; 0x3a05c 3a04e: 81 e0 ldi r24, 0x01 ; 1 3a050: 90 91 d7 03 lds r25, 0x03D7 ; 0x8003d7 3a054: 91 11 cpse r25, r1 3a056: 03 c0 rjmp .+6 ; 0x3a05e 3a058: 80 e0 ldi r24, 0x00 ; 0 3a05a: 08 95 ret 3a05c: 81 e0 ldi r24, 0x01 ; 1 } 3a05e: 08 95 ret 0003a060 : //! @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) { 3a060: 0f 93 push r16 3a062: 1f 93 push r17 3a064: cf 93 push r28 3a066: df 93 push r29 3a068: 8c 01 movw r16, r24 3a06a: eb 01 movw r28, r22 uint_least8_t index = sprintf_P(buffer.c, PSTR("%.10S "), _T(MSG_SHEET)); 3a06c: 83 e9 ldi r24, 0x93 ; 147 3a06e: 9d e4 ldi r25, 0x4D ; 77 3a070: 0e 94 ac 72 call 0xe558 ; 0xe558 3a074: 9f 93 push r25 3a076: 8f 93 push r24 3a078: 88 ed ldi r24, 0xD8 ; 216 3a07a: 9b ea ldi r25, 0xAB ; 171 3a07c: 9f 93 push r25 3a07e: 8f 93 push r24 3a080: df 93 push r29 3a082: cf 93 push r28 3a084: 0f 94 33 db call 0x3b666 ; 0x3b666 eeprom_read_block(&(buffer.c[index]), sheet_E.name, 7); 3a088: c8 0f add r28, r24 3a08a: d1 1d adc r29, r1 3a08c: 47 e0 ldi r20, 0x07 ; 7 3a08e: 50 e0 ldi r21, 0x00 ; 0 3a090: b8 01 movw r22, r16 3a092: ce 01 movw r24, r28 3a094: 0f 94 0c dc call 0x3b818 ; 0x3b818 //index += 7; buffer.c[index + 7] = '\0'; 3a098: 1f 82 std Y+7, r1 ; 0x07 3a09a: 0f 90 pop r0 3a09c: 0f 90 pop r0 3a09e: 0f 90 pop r0 3a0a0: 0f 90 pop r0 3a0a2: 0f 90 pop r0 3a0a4: 0f 90 pop r0 } 3a0a6: df 91 pop r29 3a0a8: cf 91 pop r28 3a0aa: 1f 91 pop r17 3a0ac: 0f 91 pop r16 3a0ae: 08 95 ret 0003a0b0 : 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)?'>':' '; 3a0b0: 20 91 15 05 lds r18, 0x0515 ; 0x800515 3a0b4: 80 91 70 06 lds r24, 0x0670 ; 0x800670 3a0b8: 90 91 71 06 lds r25, 0x0671 ; 0x800671 3a0bc: 28 17 cp r18, r24 3a0be: 19 06 cpc r1, r25 3a0c0: 11 f0 breq .+4 ; 0x3a0c6 3a0c2: 80 e2 ldi r24, 0x20 ; 32 3a0c4: 08 95 ret 3a0c6: 8e e3 ldi r24, 0x3E ; 62 } 3a0c8: 08 95 ret 0003a0ca : static void menu_draw_item_puts_P(char type_char, const char* str) { 3a0ca: 0f 93 push r16 3a0cc: 1f 93 push r17 3a0ce: cf 93 push r28 3a0d0: c8 2f mov r28, r24 3a0d2: 8b 01 movw r16, r22 lcd_putc_at(0, menu_row, menu_selection_mark()); 3a0d4: 0f 94 58 d0 call 0x3a0b0 ; 0x3a0b0 3a0d8: 48 2f mov r20, r24 3a0da: 60 91 12 05 lds r22, 0x0512 ; 0x800512 3a0de: 80 e0 ldi r24, 0x00 ; 0 3a0e0: 0e 94 00 6f call 0xde00 ; 0xde00 lcd_print_pad_P(str, LCD_WIDTH - 2); 3a0e4: 62 e1 ldi r22, 0x12 ; 18 3a0e6: c8 01 movw r24, r16 3a0e8: 0e 94 b5 70 call 0xe16a ; 0xe16a lcd_putc(type_char); 3a0ec: 8c 2f mov r24, r28 } 3a0ee: cf 91 pop r28 3a0f0: 1f 91 pop r17 3a0f2: 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); 3a0f4: 0c 94 cf 6e jmp 0xdd9e ; 0xdd9e 0003a0f8 : } } void menu_item_ret(void) { lcd_draw_update = 2; 3a0f8: 82 e0 ldi r24, 0x02 ; 2 3a0fa: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d menu_item++; 3a0fe: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a102: 8f 5f subi r24, 0xFF ; 255 3a104: 80 93 15 05 sts 0x0515, r24 ; 0x800515 //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 3a108: 84 e0 ldi r24, 0x04 ; 4 3a10a: 80 93 12 05 sts 0x0512, r24 ; 0x800512 menu_line = 0; // prevent subsequent menu items from rendering at all in the current MENU_BEGIN() for loop cycle 3a10e: 10 92 14 05 sts 0x0514, r1 ; 0x800514 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 3a112: 10 92 13 05 sts 0x0513, r1 ; 0x800513 } 3a116: 08 95 ret 0003a118 : } menu_item++; } void menu_item_gcode_P(const char* str, const char* str_gcode) { 3a118: cf 93 push r28 3a11a: df 93 push r29 if (menu_item == menu_line) 3a11c: 30 91 15 05 lds r19, 0x0515 ; 0x800515 3a120: 20 91 14 05 lds r18, 0x0514 ; 0x800514 3a124: 32 13 cpse r19, r18 3a126: 20 c0 rjmp .+64 ; 0x3a168 3a128: eb 01 movw r28, r22 3a12a: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); 3a12c: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a130: 88 23 and r24, r24 3a132: 19 f0 breq .+6 ; 0x3a13a 3a134: 80 e2 ldi r24, 0x20 ; 32 3a136: 0f 94 65 d0 call 0x3a0ca ; 0x3a0ca if (menu_clicked && (lcd_encoder == menu_item)) 3a13a: 80 91 13 05 lds r24, 0x0513 ; 0x800513 3a13e: 88 23 and r24, r24 3a140: 99 f0 breq .+38 ; 0x3a168 3a142: 20 91 15 05 lds r18, 0x0515 ; 0x800515 3a146: 80 91 70 06 lds r24, 0x0670 ; 0x800670 3a14a: 90 91 71 06 lds r25, 0x0671 ; 0x800671 3a14e: 28 17 cp r18, r24 3a150: 19 06 cpc r1, r25 3a152: 51 f4 brne .+20 ; 0x3a168 { if (str_gcode) enquecommand_P(str_gcode); 3a154: 20 97 sbiw r28, 0x00 ; 0 3a156: 21 f0 breq .+8 ; 0x3a160 3a158: 61 e0 ldi r22, 0x01 ; 1 3a15a: ce 01 movw r24, r28 3a15c: 0e 94 20 88 call 0x11040 ; 0x11040 menu_item_ret(); return; } } menu_item++; } 3a160: df 91 pop r29 3a162: 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(); 3a164: 0d 94 7c d0 jmp 0x3a0f8 ; 0x3a0f8 return; } } menu_item++; 3a168: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a16c: 8f 5f subi r24, 0xFF ; 255 3a16e: 80 93 15 05 sts 0x0515, r24 ; 0x800515 } 3a172: df 91 pop r29 3a174: cf 91 pop r28 3a176: 08 95 ret 0003a178 : //! @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) { 3a178: ef 92 push r14 3a17a: ff 92 push r15 3a17c: 0f 93 push r16 3a17e: 1f 93 push r17 3a180: cf 93 push r28 3a182: df 93 push r29 if (menu_item == menu_line) 3a184: 70 91 15 05 lds r23, 0x0515 ; 0x800515 3a188: 30 91 14 05 lds r19, 0x0514 ; 0x800514 3a18c: 73 13 cpse r23, r19 3a18e: 3f c0 rjmp .+126 ; 0x3a20e 3a190: 12 2f mov r17, r18 3a192: ea 01 movw r28, r20 3a194: 06 2f mov r16, r22 3a196: 7c 01 movw r14, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str, number); 3a198: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a19c: 88 23 and r24, r24 3a19e: d1 f0 breq .+52 ; 0x3a1d4 } 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()); 3a1a0: 0f 94 58 d0 call 0x3a0b0 ; 0x3a0b0 3a1a4: 48 2f mov r20, r24 3a1a6: 60 91 12 05 lds r22, 0x0512 ; 0x800512 3a1aa: 80 e0 ldi r24, 0x00 ; 0 3a1ac: 0e 94 00 6f call 0xde00 ; 0xde00 uint8_t len = lcd_print_pad_P(str, max_strlen); 3a1b0: 61 e1 ldi r22, 0x11 ; 17 3a1b2: c7 01 movw r24, r14 3a1b4: 0e 94 b5 70 call 0xe16a ; 0xe16a lcd_putc_at((max_strlen - len) + 2, menu_row, num); 3a1b8: 40 2f mov r20, r16 3a1ba: 60 91 12 05 lds r22, 0x0512 ; 0x800512 3a1be: 93 e1 ldi r25, 0x13 ; 19 3a1c0: 98 1b sub r25, r24 3a1c2: 89 2f mov r24, r25 3a1c4: 0e 94 00 6f call 0xde00 ; 0xde00 lcd_putc_at(LCD_WIDTH - 1, menu_row, type_char); 3a1c8: 40 e2 ldi r20, 0x20 ; 32 3a1ca: 60 91 12 05 lds r22, 0x0512 ; 0x800512 3a1ce: 83 e1 ldi r24, 0x13 ; 19 3a1d0: 0e 94 00 6f call 0xde00 ; 0xde00 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)) 3a1d4: 80 91 13 05 lds r24, 0x0513 ; 0x800513 3a1d8: 88 23 and r24, r24 3a1da: c9 f0 breq .+50 ; 0x3a20e 3a1dc: 20 91 15 05 lds r18, 0x0515 ; 0x800515 3a1e0: 80 91 70 06 lds r24, 0x0670 ; 0x800670 3a1e4: 90 91 71 06 lds r25, 0x0671 ; 0x800671 3a1e8: 28 17 cp r18, r24 3a1ea: 19 06 cpc r1, r25 3a1ec: 81 f4 brne .+32 ; 0x3a20e { lcd_update_enabled = 0; 3a1ee: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e if (func) func(fn_par); 3a1f2: 81 2f mov r24, r17 3a1f4: fe 01 movw r30, r28 3a1f6: 19 95 eicall lcd_update_enabled = 1; 3a1f8: 81 e0 ldi r24, 0x01 ; 1 3a1fa: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e menu_item_ret(); return; } } menu_item++; } 3a1fe: df 91 pop r29 3a200: cf 91 pop r28 3a202: 1f 91 pop r17 3a204: 0f 91 pop r16 3a206: ff 90 pop r15 3a208: 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(); 3a20a: 0d 94 7c d0 jmp 0x3a0f8 ; 0x3a0f8 return; } } menu_item++; 3a20e: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a212: 8f 5f subi r24, 0xFF ; 255 3a214: 80 93 15 05 sts 0x0515, r24 ; 0x800515 } 3a218: df 91 pop r29 3a21a: cf 91 pop r28 3a21c: 1f 91 pop r17 3a21e: 0f 91 pop r16 3a220: ff 90 pop r15 3a222: ef 90 pop r14 3a224: 08 95 ret 0003a226 : 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) { 3a226: cf 93 push r28 3a228: df 93 push r29 if (menu_item == menu_line) 3a22a: 30 91 15 05 lds r19, 0x0515 ; 0x800515 3a22e: 20 91 14 05 lds r18, 0x0514 ; 0x800514 3a232: 32 13 cpse r19, r18 3a234: 21 c0 rjmp .+66 ; 0x3a278 3a236: eb 01 movw r28, r22 3a238: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); 3a23a: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a23e: 88 23 and r24, r24 3a240: 19 f0 breq .+6 ; 0x3a248 3a242: 80 e2 ldi r24, 0x20 ; 32 3a244: 0f 94 65 d0 call 0x3a0ca ; 0x3a0ca if (menu_clicked && (lcd_encoder == menu_item)) 3a248: 80 91 13 05 lds r24, 0x0513 ; 0x800513 3a24c: 88 23 and r24, r24 3a24e: a1 f0 breq .+40 ; 0x3a278 3a250: 20 91 15 05 lds r18, 0x0515 ; 0x800515 3a254: 80 91 70 06 lds r24, 0x0670 ; 0x800670 3a258: 90 91 71 06 lds r25, 0x0671 ; 0x800671 3a25c: 28 17 cp r18, r24 3a25e: 19 06 cpc r1, r25 3a260: 59 f4 brne .+22 ; 0x3a278 { lcd_update_enabled = 0; 3a262: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e if (func) func(); 3a266: fe 01 movw r30, r28 3a268: 19 95 eicall lcd_update_enabled = 1; 3a26a: 81 e0 ldi r24, 0x01 ; 1 3a26c: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e menu_item_ret(); return; } } menu_item++; } 3a270: df 91 pop r29 3a272: 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(); 3a274: 0d 94 7c d0 jmp 0x3a0f8 ; 0x3a0f8 return; } } menu_item++; 3a278: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a27c: 8f 5f subi r24, 0xFF ; 255 3a27e: 80 93 15 05 sts 0x0515, r24 ; 0x800515 } 3a282: df 91 pop r29 3a284: cf 91 pop r28 3a286: 08 95 ret 0003a288 : menu_item++; } uint8_t menu_item_text_P(const char* str) { if (menu_item == menu_line) 3a288: 30 91 15 05 lds r19, 0x0515 ; 0x800515 3a28c: 20 91 14 05 lds r18, 0x0514 ; 0x800514 3a290: 32 13 cpse r19, r18 3a292: 19 c0 rjmp .+50 ; 0x3a2c6 3a294: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); 3a296: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a29a: 88 23 and r24, r24 3a29c: 19 f0 breq .+6 ; 0x3a2a4 3a29e: 80 e2 ldi r24, 0x20 ; 32 3a2a0: 0f 94 65 d0 call 0x3a0ca ; 0x3a0ca if (menu_clicked && (lcd_encoder == menu_item)) 3a2a4: 80 91 13 05 lds r24, 0x0513 ; 0x800513 3a2a8: 88 23 and r24, r24 3a2aa: 69 f0 breq .+26 ; 0x3a2c6 3a2ac: 20 91 15 05 lds r18, 0x0515 ; 0x800515 3a2b0: 80 91 70 06 lds r24, 0x0670 ; 0x800670 3a2b4: 90 91 71 06 lds r25, 0x0671 ; 0x800671 3a2b8: 28 17 cp r18, r24 3a2ba: 19 06 cpc r1, r25 3a2bc: 21 f4 brne .+8 ; 0x3a2c6 { menu_item_ret(); 3a2be: 0f 94 7c d0 call 0x3a0f8 ; 0x3a0f8 return 1; 3a2c2: 81 e0 ldi r24, 0x01 ; 1 3a2c4: 08 95 ret } } menu_item++; 3a2c6: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a2ca: 8f 5f subi r24, 0xFF ; 255 3a2cc: 80 93 15 05 sts 0x0515, r24 ; 0x800515 return 0; 3a2d0: 80 e0 ldi r24, 0x00 ; 0 } 3a2d2: 08 95 ret 0003a2d4 : menu_clicked = lcd_clicked(); // Consume click event } void menu_end(void) { if (menu_row >= LCD_HEIGHT) 3a2d4: 80 91 12 05 lds r24, 0x0512 ; 0x800512 3a2d8: 84 30 cpi r24, 0x04 ; 4 3a2da: 38 f5 brcc .+78 ; 0x3a32a { // Early abort if the menu was clicked. The current menu might have changed because of the click event return; } if (lcd_encoder >= menu_item) 3a2dc: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a2e0: 90 e0 ldi r25, 0x00 ; 0 3a2e2: 20 91 70 06 lds r18, 0x0670 ; 0x800670 3a2e6: 30 91 71 06 lds r19, 0x0671 ; 0x800671 3a2ea: 28 17 cp r18, r24 3a2ec: 39 07 cpc r19, r25 3a2ee: 44 f0 brlt .+16 ; 0x3a300 { lcd_encoder = menu_item - 1; 3a2f0: 01 97 sbiw r24, 0x01 ; 1 3a2f2: 90 93 71 06 sts 0x0671, r25 ; 0x800671 3a2f6: 80 93 70 06 sts 0x0670, r24 ; 0x800670 Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 3a2fa: 87 e0 ldi r24, 0x07 ; 7 3a2fc: 0f 94 07 4e call 0x29c0e ; 0x29c0e } if (((uint8_t)lcd_encoder) >= menu_top + LCD_HEIGHT) 3a300: 80 91 70 06 lds r24, 0x0670 ; 0x800670 3a304: 20 91 a5 03 lds r18, 0x03A5 ; 0x8003a5 3a308: 30 e0 ldi r19, 0x00 ; 0 3a30a: 2d 5f subi r18, 0xFD ; 253 3a30c: 3f 4f sbci r19, 0xFF ; 255 3a30e: 82 17 cp r24, r18 3a310: 13 06 cpc r1, r19 3a312: 59 f0 breq .+22 ; 0x3a32a 3a314: 54 f0 brlt .+20 ; 0x3a32a { menu_top = lcd_encoder - LCD_HEIGHT + 1; 3a316: 9d ef ldi r25, 0xFD ; 253 3a318: 98 0f add r25, r24 3a31a: 90 93 a5 03 sts 0x03A5, r25 ; 0x8003a5 menu_line = menu_top - 1; 3a31e: 84 50 subi r24, 0x04 ; 4 3a320: 80 93 14 05 sts 0x0514, r24 ; 0x800514 menu_row = -1; 3a324: 8f ef ldi r24, 0xFF ; 255 3a326: 80 93 12 05 sts 0x0512, r24 ; 0x800512 } } 3a32a: 08 95 ret 0003a32c : CRITICAL_SECTION_END; } void menu_start(void) { if (lcd_encoder < 0) 3a32c: 80 91 70 06 lds r24, 0x0670 ; 0x800670 3a330: 90 91 71 06 lds r25, 0x0671 ; 0x800671 3a334: 97 ff sbrs r25, 7 3a336: 07 c0 rjmp .+14 ; 0x3a346 { lcd_encoder = 0; 3a338: 10 92 71 06 sts 0x0671, r1 ; 0x800671 3a33c: 10 92 70 06 sts 0x0670, r1 ; 0x800670 Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 3a340: 87 e0 ldi r24, 0x07 ; 7 3a342: 0f 94 07 4e call 0x29c0e ; 0x29c0e } if (lcd_encoder < menu_top) 3a346: 80 91 70 06 lds r24, 0x0670 ; 0x800670 3a34a: 90 91 71 06 lds r25, 0x0671 ; 0x800671 3a34e: 20 91 a5 03 lds r18, 0x03A5 ; 0x8003a5 3a352: 28 17 cp r18, r24 3a354: 19 06 cpc r1, r25 3a356: 19 f0 breq .+6 ; 0x3a35e 3a358: 14 f0 brlt .+4 ; 0x3a35e menu_top = lcd_encoder; 3a35a: 80 93 a5 03 sts 0x03A5, r24 ; 0x8003a5 menu_line = menu_top; 3a35e: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 3a362: 80 93 14 05 sts 0x0514, r24 ; 0x800514 menu_clicked = lcd_clicked(); // Consume click event 3a366: 0e 94 fd 70 call 0xe1fa ; 0xe1fa 3a36a: 80 93 13 05 sts 0x0513, r24 ; 0x800513 } 3a36e: 08 95 ret 0003a370 : 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)); 3a370: e9 ea ldi r30, 0xA9 ; 169 3a372: f3 e0 ldi r31, 0x03 ; 3 3a374: 80 e2 ldi r24, 0x20 ; 32 3a376: df 01 movw r26, r30 3a378: 1d 92 st X+, r1 3a37a: 8a 95 dec r24 3a37c: e9 f7 brne .-6 ; 0x3a378 } 3a37e: 08 95 ret 0003a380 : void menu_goto(menu_func_t menu, const int16_t encoder, bool reset_menu_state, const bool feedback) { 3a380: cf 93 push r28 CRITICAL_SECTION_START; 3a382: 3f b7 in r19, 0x3f ; 63 3a384: f8 94 cli if (menu_menu != menu) 3a386: e0 91 13 04 lds r30, 0x0413 ; 0x800413 3a38a: f0 91 14 04 lds r31, 0x0414 ; 0x800414 3a38e: e8 17 cp r30, r24 3a390: f9 07 cpc r31, r25 3a392: c9 f0 breq .+50 ; 0x3a3c6 3a394: c4 2f mov r28, r20 { menu_menu = menu; 3a396: 90 93 14 04 sts 0x0414, r25 ; 0x800414 3a39a: 80 93 13 04 sts 0x0413, r24 ; 0x800413 lcd_encoder = encoder; 3a39e: 70 93 71 06 sts 0x0671, r23 ; 0x800671 3a3a2: 60 93 70 06 sts 0x0670, r22 ; 0x800670 menu_top = 0; //reset menu view. Needed if menu_back() is called from deep inside a menu, such as Support 3a3a6: 10 92 a5 03 sts 0x03A5, r1 ; 0x8003a5 lcd_draw_update = 2; // Full LCD re-draw 3a3aa: 82 e0 ldi r24, 0x02 ; 2 3a3ac: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d CRITICAL_SECTION_END; 3a3b0: 3f bf out 0x3f, r19 ; 63 if (feedback) lcd_beeper_quick_feedback(); 3a3b2: 22 23 and r18, r18 3a3b4: 19 f0 breq .+6 ; 0x3a3bc } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 3a3b6: 80 e0 ldi r24, 0x00 ; 0 3a3b8: 0f 94 07 4e call 0x29c0e ; 0x29c0e if (reset_menu_state) menu_data_reset(); 3a3bc: cc 23 and r28, r28 3a3be: 21 f0 breq .+8 ; 0x3a3c8 } else CRITICAL_SECTION_END; } 3a3c0: 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(); 3a3c2: 0d 94 b8 d1 jmp 0x3a370 ; 0x3a370 } else CRITICAL_SECTION_END; 3a3c6: 3f bf out 0x3f, r19 ; 63 } 3a3c8: cf 91 pop r28 3a3ca: 08 95 ret 0003a3cc : 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) { 3a3cc: 7f 92 push r7 3a3ce: 8f 92 push r8 3a3d0: 9f 92 push r9 3a3d2: af 92 push r10 3a3d4: bf 92 push r11 3a3d6: cf 92 push r12 3a3d8: df 92 push r13 3a3da: ef 92 push r14 3a3dc: ff 92 push r15 3a3de: 0f 93 push r16 3a3e0: 1f 93 push r17 3a3e2: cf 93 push r28 3a3e4: df 93 push r29 menu_data_edit_t* _md = (menu_data_edit_t*)&(menu_data[0]); if (menu_item == menu_line) 3a3e6: e0 91 15 05 lds r30, 0x0515 ; 0x800515 3a3ea: 50 91 14 05 lds r21, 0x0514 ; 0x800514 3a3ee: e5 13 cpse r30, r21 3a3f0: 73 c0 rjmp .+230 ; 0x3a4d8 { int16_t cur_val = (pbits == 8 ? *((uint8_t*)pval) : *((int16_t*)pval)); 3a3f2: fb 01 movw r30, r22 3a3f4: 48 30 cpi r20, 0x08 ; 8 3a3f6: 09 f0 breq .+2 ; 0x3a3fa 3a3f8: 6c c0 rjmp .+216 ; 0x3a4d2 3a3fa: c0 81 ld r28, Z 3a3fc: d0 e0 ldi r29, 0x00 ; 0 3a3fe: 49 01 movw r8, r18 3a400: 74 2e mov r7, r20 3a402: 6b 01 movw r12, r22 3a404: 5c 01 movw r10, r24 if (lcd_draw_update) 3a406: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a40a: 88 23 and r24, r24 3a40c: 59 f0 breq .+22 ; 0x3a424 { lcd_set_cursor(0, menu_row); 3a40e: 60 91 12 05 lds r22, 0x0512 ; 0x800512 3a412: 80 e0 ldi r24, 0x00 ; 0 3a414: 0e 94 e0 6e call 0xddc0 ; 0xddc0 menu_draw_P(menu_selection_mark(), str, cur_val); 3a418: 0f 94 58 d0 call 0x3a0b0 ; 0x3a0b0 3a41c: ae 01 movw r20, r28 3a41e: b5 01 movw r22, r10 3a420: 0f 94 cc b0 call 0x36198 ; 0x36198 } if (menu_clicked && (lcd_encoder == menu_item)) 3a424: 80 91 13 05 lds r24, 0x0513 ; 0x800513 3a428: 88 23 and r24, r24 3a42a: 09 f4 brne .+2 ; 0x3a42e 3a42c: 55 c0 rjmp .+170 ; 0x3a4d8 3a42e: 90 91 15 05 lds r25, 0x0515 ; 0x800515 3a432: 20 91 70 06 lds r18, 0x0670 ; 0x800670 3a436: 30 91 71 06 lds r19, 0x0671 ; 0x800671 3a43a: 92 17 cp r25, r18 3a43c: 13 06 cpc r1, r19 3a43e: 09 f0 breq .+2 ; 0x3a442 3a440: 4b c0 rjmp .+150 ; 0x3a4d8 } } void menu_submenu_no_reset(menu_func_t submenu, const bool feedback) { if (menu_depth < MENU_DEPTH_MAX) 3a442: 80 91 f8 03 lds r24, 0x03F8 ; 0x8003f8 3a446: 87 30 cpi r24, 0x07 ; 7 3a448: d8 f4 brcc .+54 ; 0x3a480 { menu_stack[menu_depth].menu = menu_menu; 3a44a: 28 2f mov r18, r24 3a44c: 30 e0 ldi r19, 0x00 ; 0 3a44e: f9 01 movw r30, r18 3a450: ee 0f add r30, r30 3a452: ff 1f adc r31, r31 3a454: e2 0f add r30, r18 3a456: f3 1f adc r31, r19 3a458: ec 53 subi r30, 0x3C ; 60 3a45a: f8 4e sbci r31, 0xE8 ; 232 3a45c: 20 91 13 04 lds r18, 0x0413 ; 0x800413 3a460: 30 91 14 04 lds r19, 0x0414 ; 0x800414 3a464: 31 83 std Z+1, r19 ; 0x01 3a466: 20 83 st Z, r18 menu_stack[menu_depth++].position = lcd_encoder; 3a468: 8f 5f subi r24, 0xFF ; 255 3a46a: 80 93 f8 03 sts 0x03F8, r24 ; 0x8003f8 3a46e: 92 83 std Z+2, r25 ; 0x02 menu_goto(submenu, 0, false, feedback); 3a470: 20 e0 ldi r18, 0x00 ; 0 3a472: 40 e0 ldi r20, 0x00 ; 0 3a474: 70 e0 ldi r23, 0x00 ; 0 3a476: 60 e0 ldi r22, 0x00 ; 0 3a478: 80 e3 ldi r24, 0x30 ; 48 3a47a: 9a e3 ldi r25, 0x3A ; 58 3a47c: 0f 94 c0 d1 call 0x3a380 ; 0x3a380 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; 3a480: b0 92 aa 03 sts 0x03AA, r11 ; 0x8003aa 3a484: a0 92 a9 03 sts 0x03A9, r10 ; 0x8003a9 _md->editValuePtr = pval; 3a488: d0 92 ad 03 sts 0x03AD, r13 ; 0x8003ad 3a48c: c0 92 ac 03 sts 0x03AC, r12 ; 0x8003ac _md->editValueBits = pbits; 3a490: 70 92 ab 03 sts 0x03AB, r7 ; 0x8003ab _md->currentValue = cur_val; 3a494: d0 93 af 03 sts 0x03AF, r29 ; 0x8003af 3a498: c0 93 ae 03 sts 0x03AE, r28 ; 0x8003ae _md->minEditValue = min_val; 3a49c: 90 92 b1 03 sts 0x03B1, r9 ; 0x8003b1 3a4a0: 80 92 b0 03 sts 0x03B0, r8 ; 0x8003b0 _md->maxEditValue = max_val; 3a4a4: 10 93 b3 03 sts 0x03B3, r17 ; 0x8003b3 3a4a8: 00 93 b2 03 sts 0x03B2, r16 ; 0x8003b2 _md->minJumpValue = jmp_val; 3a4ac: f0 92 b5 03 sts 0x03B5, r15 ; 0x8003b5 3a4b0: e0 92 b4 03 sts 0x03B4, r14 ; 0x8003b4 menu_item_ret(); return; } } menu_item++; } 3a4b4: df 91 pop r29 3a4b6: cf 91 pop r28 3a4b8: 1f 91 pop r17 3a4ba: 0f 91 pop r16 3a4bc: ff 90 pop r15 3a4be: ef 90 pop r14 3a4c0: df 90 pop r13 3a4c2: cf 90 pop r12 3a4c4: bf 90 pop r11 3a4c6: af 90 pop r10 3a4c8: 9f 90 pop r9 3a4ca: 8f 90 pop r8 3a4cc: 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(); 3a4ce: 0d 94 7c d0 jmp 0x3a0f8 ; 0x3a0f8 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)); 3a4d2: c0 81 ld r28, Z 3a4d4: d1 81 ldd r29, Z+1 ; 0x01 3a4d6: 93 cf rjmp .-218 ; 0x3a3fe _md->minJumpValue = jmp_val; menu_item_ret(); return; } } menu_item++; 3a4d8: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a4dc: 8f 5f subi r24, 0xFF ; 255 3a4de: 80 93 15 05 sts 0x0515, r24 ; 0x800515 } 3a4e2: df 91 pop r29 3a4e4: cf 91 pop r28 3a4e6: 1f 91 pop r17 3a4e8: 0f 91 pop r16 3a4ea: ff 90 pop r15 3a4ec: ef 90 pop r14 3a4ee: df 90 pop r13 3a4f0: cf 90 pop r12 3a4f2: bf 90 pop r11 3a4f4: af 90 pop r10 3a4f6: 9f 90 pop r9 3a4f8: 8f 90 pop r8 3a4fa: 7f 90 pop r7 3a4fc: 08 95 ret 0003a4fe <_menu_edit_P()>: } static void _menu_edit_P() { menu_data_edit_t* _md = (menu_data_edit_t*)&(menu_data[0]); if (lcd_draw_update) 3a4fe: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a502: 88 23 and r24, r24 3a504: 09 f4 brne .+2 ; 0x3a508 <_menu_edit_P()+0xa> 3a506: 52 c0 rjmp .+164 ; 0x3a5ac <_menu_edit_P()+0xae> { // handle initial value jumping if (_md->minJumpValue && lcd_encoder) { 3a508: 20 91 b4 03 lds r18, 0x03B4 ; 0x8003b4 3a50c: 30 91 b5 03 lds r19, 0x03B5 ; 0x8003b5 3a510: 80 91 b0 03 lds r24, 0x03B0 ; 0x8003b0 3a514: 90 91 b1 03 lds r25, 0x03B1 ; 0x8003b1 3a518: 21 15 cp r18, r1 3a51a: 31 05 cpc r19, r1 3a51c: d9 f0 breq .+54 ; 0x3a554 <_menu_edit_P()+0x56> 3a51e: 40 91 70 06 lds r20, 0x0670 ; 0x800670 3a522: 50 91 71 06 lds r21, 0x0671 ; 0x800671 3a526: 41 15 cp r20, r1 3a528: 51 05 cpc r21, r1 3a52a: a1 f0 breq .+40 ; 0x3a554 <_menu_edit_P()+0x56> if (lcd_encoder > 0 && _md->currentValue == _md->minEditValue) { 3a52c: 7c f0 brlt .+30 ; 0x3a54c <_menu_edit_P()+0x4e> 3a52e: 40 91 ae 03 lds r20, 0x03AE ; 0x8003ae 3a532: 50 91 af 03 lds r21, 0x03AF ; 0x8003af 3a536: 48 17 cp r20, r24 3a538: 59 07 cpc r21, r25 3a53a: 41 f4 brne .+16 ; 0x3a54c <_menu_edit_P()+0x4e> _md->currentValue = _md->minJumpValue; 3a53c: 30 93 af 03 sts 0x03AF, r19 ; 0x8003af 3a540: 20 93 ae 03 sts 0x03AE, r18 ; 0x8003ae lcd_encoder = 0; 3a544: 10 92 71 06 sts 0x0671, r1 ; 0x800671 3a548: 10 92 70 06 sts 0x0670, r1 ; 0x800670 } // disable after first use and/or if the initial value is not minEditValue _md->minJumpValue = 0; 3a54c: 10 92 b5 03 sts 0x03B5, r1 ; 0x8003b5 3a550: 10 92 b4 03 sts 0x03B4, r1 ; 0x8003b4 } _md->currentValue += lcd_encoder; 3a554: 20 91 ae 03 lds r18, 0x03AE ; 0x8003ae 3a558: 30 91 af 03 lds r19, 0x03AF ; 0x8003af 3a55c: 40 91 70 06 lds r20, 0x0670 ; 0x800670 3a560: 50 91 71 06 lds r21, 0x0671 ; 0x800671 3a564: 24 0f add r18, r20 3a566: 35 1f adc r19, r21 lcd_encoder = 0; // Consume knob rotation event 3a568: 10 92 71 06 sts 0x0671, r1 ; 0x800671 3a56c: 10 92 70 06 sts 0x0670, r1 ; 0x800670 // Constrain the value in case it's outside the allowed limits _md->currentValue = constrain(_md->currentValue, _md->minEditValue, _md->maxEditValue); 3a570: 28 17 cp r18, r24 3a572: 39 07 cpc r19, r25 3a574: 44 f0 brlt .+16 ; 0x3a586 <_menu_edit_P()+0x88> 3a576: 80 91 b2 03 lds r24, 0x03B2 ; 0x8003b2 3a57a: 90 91 b3 03 lds r25, 0x03B3 ; 0x8003b3 3a57e: 28 17 cp r18, r24 3a580: 39 07 cpc r19, r25 3a582: 0c f4 brge .+2 ; 0x3a586 <_menu_edit_P()+0x88> 3a584: c9 01 movw r24, r18 3a586: 90 93 af 03 sts 0x03AF, r25 ; 0x8003af 3a58a: 80 93 ae 03 sts 0x03AE, r24 ; 0x8003ae lcd_set_cursor(0, 1); 3a58e: 61 e0 ldi r22, 0x01 ; 1 3a590: 80 e0 ldi r24, 0x00 ; 0 3a592: 0e 94 e0 6e call 0xddc0 ; 0xddc0 menu_draw_P(' ', _md->editLabel, _md->currentValue); 3a596: 40 91 ae 03 lds r20, 0x03AE ; 0x8003ae 3a59a: 50 91 af 03 lds r21, 0x03AF ; 0x8003af 3a59e: 60 91 a9 03 lds r22, 0x03A9 ; 0x8003a9 3a5a2: 70 91 aa 03 lds r23, 0x03AA ; 0x8003aa 3a5a6: 80 e2 ldi r24, 0x20 ; 32 3a5a8: 0f 94 cc b0 call 0x36198 ; 0x36198 } if (lcd_clicked()) 3a5ac: 0e 94 fd 70 call 0xe1fa ; 0xe1fa 3a5b0: 88 23 and r24, r24 3a5b2: 41 f1 breq .+80 ; 0x3a604 <_menu_edit_P()+0x106> 3a5b4: e0 91 ac 03 lds r30, 0x03AC ; 0x8003ac 3a5b8: f0 91 ad 03 lds r31, 0x03AD ; 0x8003ad 3a5bc: 80 91 ae 03 lds r24, 0x03AE ; 0x8003ae 3a5c0: 90 91 af 03 lds r25, 0x03AF ; 0x8003af { if (_md->editValueBits == 8) 3a5c4: 20 91 ab 03 lds r18, 0x03AB ; 0x8003ab *((uint8_t*)(_md->editValuePtr)) = _md->currentValue; 3a5c8: 80 83 st Z, r24 lcd_set_cursor(0, 1); menu_draw_P(' ', _md->editLabel, _md->currentValue); } if (lcd_clicked()) { if (_md->editValueBits == 8) 3a5ca: 28 30 cpi r18, 0x08 ; 8 3a5cc: c9 f4 brne .+50 ; 0x3a600 <_menu_edit_P()+0x102> menu_back(1); } void menu_back_no_reset(void) { if (menu_depth > 0) 3a5ce: 80 91 f8 03 lds r24, 0x03F8 ; 0x8003f8 3a5d2: 88 23 and r24, r24 3a5d4: b9 f0 breq .+46 ; 0x3a604 <_menu_edit_P()+0x106> { menu_depth--; 3a5d6: 81 50 subi r24, 0x01 ; 1 3a5d8: 80 93 f8 03 sts 0x03F8, r24 ; 0x8003f8 menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, false); 3a5dc: 90 e0 ldi r25, 0x00 ; 0 3a5de: fc 01 movw r30, r24 3a5e0: ee 0f add r30, r30 3a5e2: ff 1f adc r31, r31 3a5e4: e8 0f add r30, r24 3a5e6: f9 1f adc r31, r25 3a5e8: ec 53 subi r30, 0x3C ; 60 3a5ea: f8 4e sbci r31, 0xE8 ; 232 3a5ec: 62 81 ldd r22, Z+2 ; 0x02 3a5ee: 06 2e mov r0, r22 3a5f0: 00 0c add r0, r0 3a5f2: 77 0b sbc r23, r23 3a5f4: 20 e0 ldi r18, 0x00 ; 0 3a5f6: 40 e0 ldi r20, 0x00 ; 0 3a5f8: 80 81 ld r24, Z 3a5fa: 91 81 ldd r25, Z+1 ; 0x01 3a5fc: 0d 94 c0 d1 jmp 0x3a380 ; 0x3a380 if (lcd_clicked()) { if (_md->editValueBits == 8) *((uint8_t*)(_md->editValuePtr)) = _md->currentValue; else *((int16_t*)(_md->editValuePtr)) = _md->currentValue; 3a600: 91 83 std Z+1, r25 ; 0x01 3a602: e5 cf rjmp .-54 ; 0x3a5ce <_menu_edit_P()+0xd0> menu_back_no_reset(); } } 3a604: 08 95 ret 0003a606 : if (lcd_clicked()) menu_back(); } void menu_submenu(menu_func_t submenu, const bool feedback) { 3a606: dc 01 movw r26, r24 3a608: 26 2f mov r18, r22 if (menu_depth < MENU_DEPTH_MAX) 3a60a: 90 91 f8 03 lds r25, 0x03F8 ; 0x8003f8 3a60e: 97 30 cpi r25, 0x07 ; 7 3a610: d8 f4 brcc .+54 ; 0x3a648 { menu_stack[menu_depth].menu = menu_menu; 3a612: 49 2f mov r20, r25 3a614: 50 e0 ldi r21, 0x00 ; 0 3a616: fa 01 movw r30, r20 3a618: ee 0f add r30, r30 3a61a: ff 1f adc r31, r31 3a61c: e4 0f add r30, r20 3a61e: f5 1f adc r31, r21 3a620: ec 53 subi r30, 0x3C ; 60 3a622: f8 4e sbci r31, 0xE8 ; 232 3a624: 40 91 13 04 lds r20, 0x0413 ; 0x800413 3a628: 50 91 14 04 lds r21, 0x0414 ; 0x800414 3a62c: 51 83 std Z+1, r21 ; 0x01 3a62e: 40 83 st Z, r20 menu_stack[menu_depth++].position = lcd_encoder; 3a630: 80 91 70 06 lds r24, 0x0670 ; 0x800670 3a634: 9f 5f subi r25, 0xFF ; 255 3a636: 90 93 f8 03 sts 0x03F8, r25 ; 0x8003f8 3a63a: 82 83 std Z+2, r24 ; 0x02 menu_goto(submenu, 0, true, feedback); 3a63c: 41 e0 ldi r20, 0x01 ; 1 3a63e: 70 e0 ldi r23, 0x00 ; 0 3a640: 60 e0 ldi r22, 0x00 ; 0 3a642: cd 01 movw r24, r26 3a644: 0d 94 c0 d1 jmp 0x3a380 ; 0x3a380 } } 3a648: 08 95 ret 0003a64a : } menu_item++; } void menu_item_toggle_P(const char* str, const char* toggle, menu_func_t func, const uint8_t settings) { 3a64a: 8f 92 push r8 3a64c: 9f 92 push r9 3a64e: af 92 push r10 3a650: bf 92 push r11 3a652: cf 92 push r12 3a654: df 92 push r13 3a656: ef 92 push r14 3a658: ff 92 push r15 3a65a: 0f 93 push r16 3a65c: 1f 93 push r17 3a65e: cf 93 push r28 3a660: df 93 push r29 if (menu_item == menu_line) 3a662: e0 91 15 05 lds r30, 0x0515 ; 0x800515 3a666: 30 91 14 05 lds r19, 0x0514 ; 0x800514 3a66a: e3 13 cpse r30, r19 3a66c: 73 c0 rjmp .+230 ; 0x3a754 3a66e: c2 2f mov r28, r18 3a670: 6a 01 movw r12, r20 3a672: 7b 01 movw r14, r22 3a674: 5c 01 movw r10, r24 { if (lcd_draw_update) menu_draw_toggle_puts_P(str, toggle, settings | (menu_selection_mark()=='>')); 3a676: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a67a: 88 23 and r24, r24 3a67c: a1 f1 breq .+104 ; 0x3a6e6 3a67e: 0f 94 58 d0 call 0x3a0b0 ; 0x3a0b0 3a682: 01 e0 ldi r16, 0x01 ; 1 3a684: 8e 33 cpi r24, 0x3E ; 62 3a686: 09 f0 breq .+2 ; 0x3a68a 3a688: 00 e0 ldi r16, 0x00 ; 0 3a68a: 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; 3a68c: 80 2f mov r24, r16 3a68e: 82 70 andi r24, 0x02 ; 2 3a690: 88 2e mov r8, r24 const char eol = (toggle == NULL) ? LCD_STR_ARROW_RIGHT[0] : ' '; 3a692: e1 14 cp r14, r1 3a694: f1 04 cpc r15, r1 3a696: 09 f4 brne .+2 ; 0x3a69a 3a698: 6f c0 rjmp .+222 ; 0x3a778 3a69a: e7 01 movw r28, r14 3a69c: 90 e2 ldi r25, 0x20 ; 32 3a69e: 99 2e mov r9, r25 if (toggle == NULL) toggle = _T(MSG_NA); uint8_t len = 4 + (is_progmem ? strlen_P(toggle) : strlen(toggle)); 3a6a0: 88 20 and r8, r8 3a6a2: 09 f4 brne .+2 ; 0x3a6a6 3a6a4: 41 c0 rjmp .+130 ; 0x3a728 3a6a6: ce 01 movw r24, r28 3a6a8: 0f 94 da d9 call 0x3b3b4 ; 0x3b3b4 <__strlen_P> 3a6ac: 14 e0 ldi r17, 0x04 ; 4 3a6ae: 18 0f add r17, r24 lcd_putc_at(0, menu_row, (settings & 0x01) ? '>' : ' '); 3a6b0: 4e e3 ldi r20, 0x3E ; 62 3a6b2: 00 ff sbrs r16, 0 3a6b4: 40 e2 ldi r20, 0x20 ; 32 3a6b6: 60 91 12 05 lds r22, 0x0512 ; 0x800512 3a6ba: 80 e0 ldi r24, 0x00 ; 0 3a6bc: 0e 94 00 6f call 0xde00 ; 0xde00 lcd_print_pad_P(str, LCD_WIDTH - len); 3a6c0: 64 e1 ldi r22, 0x14 ; 20 3a6c2: 61 1b sub r22, r17 3a6c4: c5 01 movw r24, r10 3a6c6: 0e 94 b5 70 call 0xe16a ; 0xe16a lcd_putc('['); 3a6ca: 8b e5 ldi r24, 0x5B ; 91 3a6cc: 0e 94 cf 6e call 0xdd9e ; 0xdd9e if (is_progmem) { lcd_puts_P(toggle); 3a6d0: 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) 3a6d2: 88 20 and r8, r8 3a6d4: 89 f1 breq .+98 ; 0x3a738 { lcd_puts_P(toggle); 3a6d6: 0e 94 cb 6e call 0xdd96 ; 0xdd96 } else { lcd_print(toggle); } lcd_putc(']'); 3a6da: 8d e5 ldi r24, 0x5D ; 93 3a6dc: 0e 94 cf 6e call 0xdd9e ; 0xdd9e lcd_putc(eol); 3a6e0: 89 2d mov r24, r9 3a6e2: 0e 94 cf 6e call 0xdd9e ; 0xdd9e 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)) 3a6e6: 80 91 13 05 lds r24, 0x0513 ; 0x800513 3a6ea: 88 23 and r24, r24 3a6ec: 99 f1 breq .+102 ; 0x3a754 3a6ee: 20 91 15 05 lds r18, 0x0515 ; 0x800515 3a6f2: 80 91 70 06 lds r24, 0x0670 ; 0x800670 3a6f6: 90 91 71 06 lds r25, 0x0671 ; 0x800671 3a6fa: 28 17 cp r18, r24 3a6fc: 19 06 cpc r1, r25 3a6fe: 51 f5 brne .+84 ; 0x3a754 { if (toggle == NULL) // print N/A warning message 3a700: ef 28 or r14, r15 3a702: e9 f4 brne .+58 ; 0x3a73e { menu_submenu(func); 3a704: 60 e0 ldi r22, 0x00 ; 0 3a706: c6 01 movw r24, r12 3a708: 0f 94 03 d3 call 0x3a606 ; 0x3a606 menu_item_ret(); return; } } menu_item++; } 3a70c: df 91 pop r29 3a70e: cf 91 pop r28 3a710: 1f 91 pop r17 3a712: 0f 91 pop r16 3a714: ff 90 pop r15 3a716: ef 90 pop r14 3a718: df 90 pop r13 3a71a: cf 90 pop r12 3a71c: bf 90 pop r11 3a71e: af 90 pop r10 3a720: 9f 90 pop r9 3a722: 8f 90 pop r8 { lcd_update_enabled = 0; if (func) func(); lcd_update_enabled = 1; } menu_item_ret(); 3a724: 0d 94 7c d0 jmp 0x3a0f8 ; 0x3a0f8 //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)); 3a728: fe 01 movw r30, r28 3a72a: 01 90 ld r0, Z+ 3a72c: 00 20 and r0, r0 3a72e: e9 f7 brne .-6 ; 0x3a72a 3a730: ec 1b sub r30, r28 3a732: 13 e0 ldi r17, 0x03 ; 3 3a734: 1e 0f add r17, r30 3a736: bc cf rjmp .-136 ; 0x3a6b0 lcd_putc('['); if (is_progmem) { lcd_puts_P(toggle); } else { lcd_print(toggle); 3a738: 0e 94 e7 70 call 0xe1ce ; 0xe1ce 3a73c: ce cf rjmp .-100 ; 0x3a6da { menu_submenu(func); } else // do the actual toggling { lcd_update_enabled = 0; 3a73e: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e if (func) func(); 3a742: c1 14 cp r12, r1 3a744: d1 04 cpc r13, r1 3a746: 11 f0 breq .+4 ; 0x3a74c 3a748: f6 01 movw r30, r12 3a74a: 19 95 eicall lcd_update_enabled = 1; 3a74c: 81 e0 ldi r24, 0x01 ; 1 3a74e: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e 3a752: dc cf rjmp .-72 ; 0x3a70c } menu_item_ret(); return; } } menu_item++; 3a754: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a758: 8f 5f subi r24, 0xFF ; 255 3a75a: 80 93 15 05 sts 0x0515, r24 ; 0x800515 } 3a75e: df 91 pop r29 3a760: cf 91 pop r28 3a762: 1f 91 pop r17 3a764: 0f 91 pop r16 3a766: ff 90 pop r15 3a768: ef 90 pop r14 3a76a: df 90 pop r13 3a76c: cf 90 pop r12 3a76e: bf 90 pop r11 3a770: af 90 pop r10 3a772: 9f 90 pop r9 3a774: 8f 90 pop r8 3a776: 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); 3a778: 86 ee ldi r24, 0xE6 ; 230 3a77a: 97 e4 ldi r25, 0x47 ; 71 3a77c: 0e 94 ac 72 call 0xe558 ; 0xe558 3a780: 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] : ' '; 3a782: 8e e7 ldi r24, 0x7E ; 126 3a784: 98 2e mov r9, r24 3a786: 8c cf rjmp .-232 ; 0x3a6a0 0003a788 : } menu_item++; } void menu_item_submenu_E(const Sheet &sheet, menu_func_t submenu) { 3a788: 0f 93 push r16 3a78a: 1f 93 push r17 3a78c: cf 93 push r28 3a78e: df 93 push r29 3a790: cd b7 in r28, 0x3d ; 61 3a792: de b7 in r29, 0x3e ; 62 3a794: 63 97 sbiw r28, 0x13 ; 19 3a796: 0f b6 in r0, 0x3f ; 63 3a798: f8 94 cli 3a79a: de bf out 0x3e, r29 ; 62 3a79c: 0f be out 0x3f, r0 ; 63 3a79e: cd bf out 0x3d, r28 ; 61 if (menu_item == menu_line) 3a7a0: 30 91 15 05 lds r19, 0x0515 ; 0x800515 3a7a4: 20 91 14 05 lds r18, 0x0514 ; 0x800514 3a7a8: 32 13 cpse r19, r18 3a7aa: 38 c0 rjmp .+112 ; 0x3a81c 3a7ac: 8b 01 movw r16, r22 { if (lcd_draw_update) menu_draw_item_puts_E(LCD_STR_ARROW_RIGHT[0], sheet); 3a7ae: 20 91 6d 02 lds r18, 0x026D ; 0x80026d 3a7b2: 22 23 and r18, r18 3a7b4: a9 f0 breq .+42 ; 0x3a7e0 static void menu_draw_item_puts_E(char type_char, const Sheet &sheet) { SheetFormatBuffer buffer; menu_format_sheet_E(sheet, buffer); 3a7b6: be 01 movw r22, r28 3a7b8: 6f 5f subi r22, 0xFF ; 255 3a7ba: 7f 4f sbci r23, 0xFF ; 255 3a7bc: 0f 94 30 d0 call 0x3a060 ; 0x3a060 lcd_putc_at(0, menu_row, menu_selection_mark()); 3a7c0: 0f 94 58 d0 call 0x3a0b0 ; 0x3a0b0 3a7c4: 48 2f mov r20, r24 3a7c6: 60 91 12 05 lds r22, 0x0512 ; 0x800512 3a7ca: 80 e0 ldi r24, 0x00 ; 0 3a7cc: 0e 94 00 6f call 0xde00 ; 0xde00 lcd_print_pad(buffer.c, LCD_WIDTH - 2); 3a7d0: 62 e1 ldi r22, 0x12 ; 18 3a7d2: ce 01 movw r24, r28 3a7d4: 01 96 adiw r24, 0x01 ; 1 3a7d6: 0e 94 cf 70 call 0xe19e ; 0xe19e lcd_putc(type_char); 3a7da: 8e e7 ldi r24, 0x7E ; 126 3a7dc: 0e 94 cf 6e call 0xdd9e ; 0xdd9e 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)) 3a7e0: 80 91 13 05 lds r24, 0x0513 ; 0x800513 3a7e4: 88 23 and r24, r24 3a7e6: d1 f0 breq .+52 ; 0x3a81c 3a7e8: 20 91 15 05 lds r18, 0x0515 ; 0x800515 3a7ec: 80 91 70 06 lds r24, 0x0670 ; 0x800670 3a7f0: 90 91 71 06 lds r25, 0x0671 ; 0x800671 3a7f4: 28 17 cp r18, r24 3a7f6: 19 06 cpc r1, r25 3a7f8: 89 f4 brne .+34 ; 0x3a81c 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); 3a7fa: 60 e0 ldi r22, 0x00 ; 0 3a7fc: c8 01 movw r24, r16 3a7fe: 0f 94 03 d3 call 0x3a606 ; 0x3a606 menu_item_ret(); 3a802: 0f 94 7c d0 call 0x3a0f8 ; 0x3a0f8 menu_item_ret(); return; } } menu_item++; } 3a806: 63 96 adiw r28, 0x13 ; 19 3a808: 0f b6 in r0, 0x3f ; 63 3a80a: f8 94 cli 3a80c: de bf out 0x3e, r29 ; 62 3a80e: 0f be out 0x3f, r0 ; 63 3a810: cd bf out 0x3d, r28 ; 61 3a812: df 91 pop r29 3a814: cf 91 pop r28 3a816: 1f 91 pop r17 3a818: 0f 91 pop r16 3a81a: 08 95 ret menu_submenu(submenu); menu_item_ret(); return; } } menu_item++; 3a81c: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a820: 8f 5f subi r24, 0xFF ; 255 3a822: 80 93 15 05 sts 0x0515, r24 ; 0x800515 3a826: ef cf rjmp .-34 ; 0x3a806 0003a828 : menu_item++; return 0; } void menu_item_submenu_P(const char* str, menu_func_t submenu) { 3a828: cf 93 push r28 3a82a: df 93 push r29 if (menu_item == menu_line) 3a82c: 30 91 15 05 lds r19, 0x0515 ; 0x800515 3a830: 20 91 14 05 lds r18, 0x0514 ; 0x800514 3a834: 32 13 cpse r19, r18 3a836: 1e c0 rjmp .+60 ; 0x3a874 3a838: eb 01 movw r28, r22 3a83a: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(LCD_STR_ARROW_RIGHT[0], str); 3a83c: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a840: 88 23 and r24, r24 3a842: 19 f0 breq .+6 ; 0x3a84a 3a844: 8e e7 ldi r24, 0x7E ; 126 3a846: 0f 94 65 d0 call 0x3a0ca ; 0x3a0ca if (menu_clicked && (lcd_encoder == menu_item)) 3a84a: 80 91 13 05 lds r24, 0x0513 ; 0x800513 3a84e: 88 23 and r24, r24 3a850: 89 f0 breq .+34 ; 0x3a874 3a852: 20 91 15 05 lds r18, 0x0515 ; 0x800515 3a856: 80 91 70 06 lds r24, 0x0670 ; 0x800670 3a85a: 90 91 71 06 lds r25, 0x0671 ; 0x800671 3a85e: 28 17 cp r18, r24 3a860: 19 06 cpc r1, r25 3a862: 41 f4 brne .+16 ; 0x3a874 { menu_submenu(submenu); 3a864: 60 e0 ldi r22, 0x00 ; 0 3a866: ce 01 movw r24, r28 3a868: 0f 94 03 d3 call 0x3a606 ; 0x3a606 menu_item_ret(); return; } } menu_item++; } 3a86c: df 91 pop r29 3a86e: 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(); 3a870: 0d 94 7c d0 jmp 0x3a0f8 ; 0x3a0f8 return; } } menu_item++; 3a874: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a878: 8f 5f subi r24, 0xFF ; 255 3a87a: 80 93 15 05 sts 0x0515, r24 ; 0x800515 } 3a87e: df 91 pop r29 3a880: cf 91 pop r28 3a882: 08 95 ret 0003a884 : menu_row = -1; } } void menu_back(uint8_t nLevel) { 3a884: 98 2f mov r25, r24 menu_depth = ((menu_depth > nLevel) ? (menu_depth - nLevel) : 0); 3a886: 80 91 f8 03 lds r24, 0x03F8 ; 0x8003f8 3a88a: 98 17 cp r25, r24 3a88c: a8 f4 brcc .+42 ; 0x3a8b8 3a88e: 89 1b sub r24, r25 3a890: 80 93 f8 03 sts 0x03F8, r24 ; 0x8003f8 menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, true); 3a894: 90 e0 ldi r25, 0x00 ; 0 3a896: fc 01 movw r30, r24 3a898: ee 0f add r30, r30 3a89a: ff 1f adc r31, r31 3a89c: e8 0f add r30, r24 3a89e: f9 1f adc r31, r25 3a8a0: ec 53 subi r30, 0x3C ; 60 3a8a2: f8 4e sbci r31, 0xE8 ; 232 3a8a4: 62 81 ldd r22, Z+2 ; 0x02 3a8a6: 06 2e mov r0, r22 3a8a8: 00 0c add r0, r0 3a8aa: 77 0b sbc r23, r23 3a8ac: 20 e0 ldi r18, 0x00 ; 0 3a8ae: 41 e0 ldi r20, 0x01 ; 1 3a8b0: 80 81 ld r24, Z 3a8b2: 91 81 ldd r25, Z+1 ; 0x01 3a8b4: 0d 94 c0 d1 jmp 0x3a380 ; 0x3a380 } } void menu_back(uint8_t nLevel) { menu_depth = ((menu_depth > nLevel) ? (menu_depth - nLevel) : 0); 3a8b8: 80 e0 ldi r24, 0x00 ; 0 3a8ba: ea cf rjmp .-44 ; 0x3a890 0003a8bc : menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, true); } void menu_back(void) { menu_back(1); 3a8bc: 81 e0 ldi r24, 0x01 ; 1 3a8be: 0d 94 42 d4 jmp 0x3a884 ; 0x3a884 0003a8c2 : menu_item++; } void menu_item_back_P(const char* str) { if (menu_item == menu_line) 3a8c2: 30 91 15 05 lds r19, 0x0515 ; 0x800515 3a8c6: 20 91 14 05 lds r18, 0x0514 ; 0x800514 3a8ca: 32 13 cpse r19, r18 3a8cc: 19 c0 rjmp .+50 ; 0x3a900 3a8ce: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(LCD_STR_UPLEVEL[0], str); 3a8d0: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a8d4: 88 23 and r24, r24 3a8d6: 19 f0 breq .+6 ; 0x3a8de 3a8d8: 83 e8 ldi r24, 0x83 ; 131 3a8da: 0f 94 65 d0 call 0x3a0ca ; 0x3a0ca if (menu_clicked && (lcd_encoder == menu_item)) 3a8de: 80 91 13 05 lds r24, 0x0513 ; 0x800513 3a8e2: 88 23 and r24, r24 3a8e4: 69 f0 breq .+26 ; 0x3a900 3a8e6: 20 91 15 05 lds r18, 0x0515 ; 0x800515 3a8ea: 80 91 70 06 lds r24, 0x0670 ; 0x800670 3a8ee: 90 91 71 06 lds r25, 0x0671 ; 0x800671 3a8f2: 28 17 cp r18, r24 3a8f4: 19 06 cpc r1, r25 3a8f6: 21 f4 brne .+8 ; 0x3a900 { menu_back(); 3a8f8: 0f 94 5e d4 call 0x3a8bc ; 0x3a8bc menu_item_ret(); 3a8fc: 0d 94 7c d0 jmp 0x3a0f8 ; 0x3a0f8 return; } } menu_item++; 3a900: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a904: 8f 5f subi r24, 0xFF ; 255 3a906: 80 93 15 05 sts 0x0515, r24 ; 0x800515 } 3a90a: 08 95 ret 0003a90c : }; 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() { 3a90c: ef 92 push r14 3a90e: ff 92 push r15 3a910: 0f 93 push r16 3a912: 1f 93 push r17 3a914: cf 93 push r28 3a916: df 93 push r29 3a918: 10 92 dc 03 sts 0x03DC, r1 ; 0x8003dc 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) 3a91c: 80 91 b6 03 lds r24, 0x03B6 ; 0x8003b6 3a920: 81 11 cpse r24, r1 3a922: 23 c0 rjmp .+70 ; 0x3a96a { _md->status = 1; // Menu entered for the first time 3a924: 81 e0 ldi r24, 0x01 ; 1 3a926: 80 93 b6 03 sts 0x03B6, r24 ; 0x8003b6 // Fetch the TuneItem from PROGMEM const uint8_t offset = (mmu2.MMUCurrentErrorCode() == ErrorCode::HOMING_IDLER_FAILED) ? 1 : 0; 3a92a: 81 e0 ldi r24, 0x01 ; 1 3a92c: 90 e0 ldi r25, 0x00 ; 0 3a92e: 20 91 8b 13 lds r18, 0x138B ; 0x80138b 3a932: 30 91 8c 13 lds r19, 0x138C ; 0x80138c 3a936: 27 30 cpi r18, 0x07 ; 7 3a938: 31 48 sbci r19, 0x81 ; 129 3a93a: 11 f0 breq .+4 ; 0x3a940 3a93c: 90 e0 ldi r25, 0x00 ; 0 3a93e: 80 e0 ldi r24, 0x00 ; 0 memcpy_P(&(_md->item), &TuneItems[offset], sizeof(TuneItem)); 3a940: bc 01 movw r22, r24 3a942: 66 0f add r22, r22 3a944: 77 1f adc r23, r23 3a946: 68 0f add r22, r24 3a948: 79 1f adc r23, r25 3a94a: 61 5f subi r22, 0xF1 ; 241 3a94c: 73 45 sbci r23, 0x53 ; 83 3a94e: 43 e0 ldi r20, 0x03 ; 3 3a950: 50 e0 ldi r21, 0x00 ; 0 3a952: 88 eb ldi r24, 0xB8 ; 184 3a954: 93 e0 ldi r25, 0x03 ; 3 3a956: 0f 94 b6 d9 call 0x3b36c ; 0x3b36c // Fetch the value which is currently in MMU EEPROM mmu2.ReadRegister(_md->item.address); 3a95a: 80 91 b8 03 lds r24, 0x03B8 ; 0x8003b8 3a95e: 0f 94 9b 0f call 0x21f36 ; 0x21f36 _md->currentValue = mmu2.GetLastReadRegisterValue(); 3a962: 80 91 b6 13 lds r24, 0x13B6 ; 0x8013b6 3a966: 80 93 b7 03 sts 0x03B7, r24 ; 0x8003b7 } MENU_BEGIN(); 3a96a: 0f 94 96 d1 call 0x3a32c ; 0x3a32c 3a96e: 10 92 12 05 sts 0x0512, r1 ; 0x800512 3a972: 80 91 12 05 lds r24, 0x0512 ; 0x800512 3a976: 84 30 cpi r24, 0x04 ; 4 3a978: e0 f5 brcc .+120 ; 0x3a9f2 3a97a: 10 92 15 05 sts 0x0515, r1 ; 0x800515 ON_MENU_LEAVE( 3a97e: 0f 94 16 d0 call 0x3a02c ; 0x3a02c 3a982: 88 23 and r24, r24 3a984: 89 f0 breq .+34 ; 0x3a9a8 3a986: 60 91 b7 03 lds r22, 0x03B7 ; 0x8003b7 3a98a: 70 e0 ldi r23, 0x00 ; 0 3a98c: 80 91 b8 03 lds r24, 0x03B8 ; 0x8003b8 3a990: 0e 94 44 e8 call 0x1d088 ; 0x1d088 3a994: 10 92 ad 0d sts 0x0DAD, r1 ; 0x800dad <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.496> &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); } 3a998: df 91 pop r29 3a99a: cf 91 pop r28 3a99c: 1f 91 pop r17 3a99e: 0f 91 pop r16 3a9a0: ff 90 pop r15 3a9a2: ef 90 pop r14 mmu2.ReadRegister(_md->item.address); _md->currentValue = mmu2.GetLastReadRegisterValue(); } MENU_BEGIN(); ON_MENU_LEAVE( 3a9a4: 0d 94 a6 1e jmp 0x23d4c ; 0x23d4c mmu2.WriteRegister(_md->item.address, (uint16_t)_md->currentValue); putErrorScreenToSleep = false; lcd_return_to_status(); return; ); MENU_ITEM_BACK_P(_T(MSG_DONE)); 3a9a8: 82 eb ldi r24, 0xB2 ; 178 3a9aa: 94 e6 ldi r25, 0x64 ; 100 3a9ac: 0e 94 ac 72 call 0xe558 ; 0xe558 3a9b0: 0f 94 61 d4 call 0x3a8c2 ; 0x3a8c2 MENU_ITEM_EDIT_int3_P( 3a9b4: 00 91 ba 03 lds r16, 0x03BA ; 0x8003ba 3a9b8: 10 e0 ldi r17, 0x00 ; 0 3a9ba: c0 91 b9 03 lds r28, 0x03B9 ; 0x8003b9 3a9be: d0 e0 ldi r29, 0x00 ; 0 3a9c0: 84 ea ldi r24, 0xA4 ; 164 3a9c2: 94 e6 ldi r25, 0x64 ; 100 3a9c4: 0e 94 ac 72 call 0xe558 ; 0xe558 3a9c8: f1 2c mov r15, r1 3a9ca: e1 2c mov r14, r1 3a9cc: 9e 01 movw r18, r28 3a9ce: 48 e0 ldi r20, 0x08 ; 8 3a9d0: 67 eb ldi r22, 0xB7 ; 183 3a9d2: 73 e0 ldi r23, 0x03 ; 3 3a9d4: 0f 94 e6 d1 call 0x3a3cc ; 0x3a3cc _T(MSG_MMU_SENSITIVITY), &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); 3a9d8: 0f 94 6a d1 call 0x3a2d4 ; 0x3a2d4 // Fetch the value which is currently in MMU EEPROM mmu2.ReadRegister(_md->item.address); _md->currentValue = mmu2.GetLastReadRegisterValue(); } MENU_BEGIN(); 3a9dc: 80 91 12 05 lds r24, 0x0512 ; 0x800512 3a9e0: 8f 5f subi r24, 0xFF ; 255 3a9e2: 80 93 12 05 sts 0x0512, r24 ; 0x800512 3a9e6: 80 91 14 05 lds r24, 0x0514 ; 0x800514 3a9ea: 8f 5f subi r24, 0xFF ; 255 3a9ec: 80 93 14 05 sts 0x0514, r24 ; 0x800514 3a9f0: c0 cf rjmp .-128 ; 0x3a972 &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); } 3a9f2: df 91 pop r29 3a9f4: cf 91 pop r28 3a9f6: 1f 91 pop r17 3a9f8: 0f 91 pop r16 3a9fa: ff 90 pop r15 3a9fc: ef 90 pop r14 3a9fe: 08 95 ret 0003aa00 : } } void menu_back_if_clicked(void) { if (lcd_clicked()) 3aa00: 0e 94 fd 70 call 0xe1fa ; 0xe1fa 3aa04: 81 11 cpse r24, r1 menu_back(); 3aa06: 0d 94 5e d4 jmp 0x3a8bc ; 0x3a8bc } 3aa0a: 08 95 ret 0003aa0c : } // Private Methods ///////////////////////////////////////////////////////////// void MarlinSerial::printNumber(unsigned long n, uint8_t base) { 3aa0c: 8f 92 push r8 3aa0e: 9f 92 push r9 3aa10: af 92 push r10 3aa12: bf 92 push r11 3aa14: ef 92 push r14 3aa16: ff 92 push r15 3aa18: 0f 93 push r16 3aa1a: 1f 93 push r17 3aa1c: cf 93 push r28 3aa1e: df 93 push r29 3aa20: cd b7 in r28, 0x3d ; 61 3aa22: de b7 in r29, 0x3e ; 62 3aa24: a0 97 sbiw r28, 0x20 ; 32 3aa26: 0f b6 in r0, 0x3f ; 63 3aa28: f8 94 cli 3aa2a: de bf out 0x3e, r29 ; 62 3aa2c: 0f be out 0x3f, r0 ; 63 3aa2e: cd bf out 0x3d, r28 ; 61 unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; if (n == 0) { 3aa30: 61 15 cp r22, r1 3aa32: 71 05 cpc r23, r1 3aa34: 81 05 cpc r24, r1 3aa36: 91 05 cpc r25, r1 3aa38: 99 f4 brne .+38 ; 0x3aa60 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3aa3a: 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)); } 3aa3c: a0 96 adiw r28, 0x20 ; 32 3aa3e: 0f b6 in r0, 0x3f ; 63 3aa40: f8 94 cli 3aa42: de bf out 0x3e, r29 ; 62 3aa44: 0f be out 0x3f, r0 ; 63 3aa46: cd bf out 0x3d, r28 ; 61 3aa48: df 91 pop r29 3aa4a: cf 91 pop r28 3aa4c: 1f 91 pop r17 3aa4e: 0f 91 pop r16 3aa50: ff 90 pop r15 3aa52: ef 90 pop r14 3aa54: bf 90 pop r11 3aa56: af 90 pop r10 3aa58: 9f 90 pop r9 3aa5a: 8f 90 pop r8 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3aa5c: 0c 94 37 77 jmp 0xee6e ; 0xee6e // 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; 3aa60: 00 e0 ldi r16, 0x00 ; 0 print('0'); return; } while (n > 0) { buf[i++] = n % base; 3aa62: 84 2e mov r8, r20 3aa64: 91 2c mov r9, r1 3aa66: b1 2c mov r11, r1 3aa68: a1 2c mov r10, r1 3aa6a: 9e 01 movw r18, r28 3aa6c: 2f 5f subi r18, 0xFF ; 255 3aa6e: 3f 4f sbci r19, 0xFF ; 255 3aa70: 79 01 movw r14, r18 3aa72: a5 01 movw r20, r10 3aa74: 94 01 movw r18, r8 3aa76: 0f 94 8f dc call 0x3b91e ; 0x3b91e <__udivmodsi4> 3aa7a: f7 01 movw r30, r14 3aa7c: e0 0f add r30, r16 3aa7e: f1 1d adc r31, r1 3aa80: 60 83 st Z, r22 n /= base; 3aa82: b9 01 movw r22, r18 3aa84: ca 01 movw r24, r20 print('0'); return; } while (n > 0) { buf[i++] = n % base; 3aa86: 0f 5f subi r16, 0xFF ; 255 if (n == 0) { print('0'); return; } while (n > 0) { 3aa88: 61 15 cp r22, r1 3aa8a: 71 05 cpc r23, r1 3aa8c: 81 05 cpc r24, r1 3aa8e: 91 05 cpc r25, r1 3aa90: 81 f7 brne .-32 ; 0x3aa72 3aa92: 0e 0d add r16, r14 3aa94: 1f 2d mov r17, r15 3aa96: 11 1d adc r17, r1 buf[i++] = n % base; n /= base; } for (; i > 0; i--) 3aa98: e0 16 cp r14, r16 3aa9a: f1 06 cpc r15, r17 3aa9c: 59 f0 breq .+22 ; 0x3aab4 print((char) (buf[i - 1] < 10 ? 3aa9e: f8 01 movw r30, r16 3aaa0: 82 91 ld r24, -Z 3aaa2: 8f 01 movw r16, r30 3aaa4: 8a 30 cpi r24, 0x0A ; 10 3aaa6: 20 f4 brcc .+8 ; 0x3aab0 '0' + buf[i - 1] : 3aaa8: 80 5d subi r24, 0xD0 ; 208 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3aaaa: 0e 94 37 77 call 0xee6e ; 0xee6e 3aaae: f4 cf rjmp .-24 ; 0x3aa98 } for (; i > 0; i--) print((char) (buf[i - 1] < 10 ? '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); 3aab0: 89 5c subi r24, 0xC9 ; 201 3aab2: fb cf rjmp .-10 ; 0x3aaaa } 3aab4: a0 96 adiw r28, 0x20 ; 32 3aab6: 0f b6 in r0, 0x3f ; 63 3aab8: f8 94 cli 3aaba: de bf out 0x3e, r29 ; 62 3aabc: 0f be out 0x3f, r0 ; 63 3aabe: cd bf out 0x3d, r28 ; 61 3aac0: df 91 pop r29 3aac2: cf 91 pop r28 3aac4: 1f 91 pop r17 3aac6: 0f 91 pop r16 3aac8: ff 90 pop r15 3aaca: ef 90 pop r14 3aacc: bf 90 pop r11 3aace: af 90 pop r10 3aad0: 9f 90 pop r9 3aad2: 8f 90 pop r8 3aad4: 08 95 ret 0003aad6 : void MarlinSerial::print(unsigned int n, int base) { print((unsigned long) n, base); } void MarlinSerial::print(long n, int base) 3aad6: cf 92 push r12 3aad8: df 92 push r13 3aada: ef 92 push r14 3aadc: ff 92 push r15 3aade: 6b 01 movw r12, r22 3aae0: 7c 01 movw r14, r24 { if (base == 0) { write(n); } else if (base == 10) { if (n < 0) { 3aae2: f7 fe sbrs r15, 7 3aae4: 0b c0 rjmp .+22 ; 0x3aafc } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3aae6: 8d e2 ldi r24, 0x2D ; 45 3aae8: 0e 94 37 77 call 0xee6e ; 0xee6e } else if (base == 10) { if (n < 0) { print('-'); n = -n; 3aaec: f0 94 com r15 3aaee: e0 94 com r14 3aaf0: d0 94 com r13 3aaf2: c0 94 com r12 3aaf4: c1 1c adc r12, r1 3aaf6: d1 1c adc r13, r1 3aaf8: e1 1c adc r14, r1 3aafa: f1 1c adc r15, r1 } printNumber(n, 10); 3aafc: 4a e0 ldi r20, 0x0A ; 10 3aafe: c7 01 movw r24, r14 3ab00: b6 01 movw r22, r12 } else { printNumber(n, base); } } 3ab02: ff 90 pop r15 3ab04: ef 90 pop r14 3ab06: df 90 pop r13 3ab08: cf 90 pop r12 } else if (base == 10) { if (n < 0) { print('-'); n = -n; } printNumber(n, 10); 3ab0a: 0d 94 06 d5 jmp 0x3aa0c ; 0x3aa0c 0003ab0e : '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); } void MarlinSerial::printFloat(double number, uint8_t digits) { 3ab0e: 8f 92 push r8 3ab10: 9f 92 push r9 3ab12: af 92 push r10 3ab14: bf 92 push r11 3ab16: cf 92 push r12 3ab18: df 92 push r13 3ab1a: ef 92 push r14 3ab1c: ff 92 push r15 3ab1e: cf 93 push r28 3ab20: 6b 01 movw r12, r22 3ab22: 7c 01 movw r14, r24 3ab24: b4 2e mov r11, r20 // Handle negative numbers if (number < 0.0) 3ab26: 20 e0 ldi r18, 0x00 ; 0 3ab28: 30 e0 ldi r19, 0x00 ; 0 3ab2a: a9 01 movw r20, r18 3ab2c: 0f 94 39 de call 0x3bc72 ; 0x3bc72 <__cmpsf2> 3ab30: 87 ff sbrs r24, 7 3ab32: 07 c0 rjmp .+14 ; 0x3ab42 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3ab34: 8d e2 ldi r24, 0x2D ; 45 3ab36: 0e 94 37 77 call 0xee6e ; 0xee6e { // Handle negative numbers if (number < 0.0) { print('-'); number = -number; 3ab3a: f7 fa bst r15, 7 3ab3c: f0 94 com r15 3ab3e: f7 f8 bld r15, 7 3ab40: 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; 3ab50: 20 e0 ldi r18, 0x00 ; 0 3ab52: 30 e0 ldi r19, 0x00 ; 0 3ab54: 40 e2 ldi r20, 0x20 ; 32 3ab56: 51 e4 ldi r21, 0x41 ; 65 3ab58: 0f 94 43 de call 0x3bc86 ; 0x3bc86 <__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; 3ab60: 9b 01 movw r18, r22 3ab62: ac 01 movw r20, r24 3ab64: c7 01 movw r24, r14 3ab66: b6 01 movw r22, r12 3ab68: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 3ab6c: 6b 01 movw r12, r22 3ab6e: 7c 01 movw r14, r24 // Extract the integer part of the number and print it unsigned long int_part = (unsigned long)number; 3ab70: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 3ab74: 4b 01 movw r8, r22 3ab76: 5c 01 movw r10, r24 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 3ab78: 4a e0 ldi r20, 0x0A ; 10 3ab7a: 0f 94 06 d5 call 0x3aa0c ; 0x3aa0c 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) 3ab7e: cc 23 and r28, r28 3ab80: 91 f1 breq .+100 ; 0x3abe6 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; 3ab82: c5 01 movw r24, r10 3ab84: b4 01 movw r22, r8 3ab86: 0f 94 a8 d6 call 0x3ad50 ; 0x3ad50 <__floatunsisf> 3ab8a: 9b 01 movw r18, r22 3ab8c: ac 01 movw r20, r24 3ab8e: c7 01 movw r24, r14 3ab90: b6 01 movw r22, r12 3ab92: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 3ab96: 6b 01 movw r12, r22 3ab98: 7c 01 movw r14, r24 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3ab9a: 8e e2 ldi r24, 0x2E ; 46 3ab9c: 0e 94 37 77 call 0xee6e ; 0xee6e // 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) 3aba0: c1 50 subi r28, 0x01 ; 1 3aba2: 08 f1 brcs .+66 ; 0x3abe6 { remainder *= 10.0; 3aba4: 20 e0 ldi r18, 0x00 ; 0 3aba6: 30 e0 ldi r19, 0x00 ; 0 3aba8: 40 e2 ldi r20, 0x20 ; 32 3abaa: 51 e4 ldi r21, 0x41 ; 65 3abac: c7 01 movw r24, r14 3abae: b6 01 movw r22, r12 3abb0: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 3abb4: 4b 01 movw r8, r22 3abb6: 5c 01 movw r10, r24 int toPrint = int(remainder); 3abb8: 0f 94 b5 de call 0x3bd6a ; 0x3bd6a <__fixsfsi> print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 3abbc: 6b 01 movw r12, r22 3abbe: 77 0f add r23, r23 3abc0: ee 08 sbc r14, r14 3abc2: ff 08 sbc r15, r15 3abc4: c7 01 movw r24, r14 3abc6: b6 01 movw r22, r12 3abc8: 0f 94 6b d5 call 0x3aad6 ; 0x3aad6 while (digits-- > 0) { remainder *= 10.0; int toPrint = int(remainder); print(toPrint); remainder -= toPrint; 3abcc: c7 01 movw r24, r14 3abce: b6 01 movw r22, r12 3abd0: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 3abd4: 9b 01 movw r18, r22 3abd6: ac 01 movw r20, r24 3abd8: c5 01 movw r24, r10 3abda: b4 01 movw r22, r8 3abdc: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__subsf3> 3abe0: 6b 01 movw r12, r22 3abe2: 7c 01 movw r14, r24 3abe4: dd cf rjmp .-70 ; 0x3aba0 } } 3abe6: cf 91 pop r28 3abe8: ff 90 pop r15 3abea: ef 90 pop r14 3abec: df 90 pop r13 3abee: cf 90 pop r12 3abf0: bf 90 pop r11 3abf2: af 90 pop r10 3abf4: 9f 90 pop r9 3abf6: 8f 90 pop r8 3abf8: 08 95 ret 0003abfa : } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3abfa: 8a e0 ldi r24, 0x0A ; 10 3abfc: 0c 94 37 77 jmp 0xee6e ; 0xee6e 0003ac00 : 3ac00: 0e 94 14 88 call 0x11028 ; 0x11028 }*/ void MarlinSerial::println(const char c[]) { print(c); println(); 3ac04: 0d 94 fd d5 jmp 0x3abfa ; 0x3abfa 0003ac08 : } 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) { 3ac08: 20 91 9b 04 lds r18, 0x049B ; 0x80049b 3ac0c: 30 91 9c 04 lds r19, 0x049C ; 0x80049c 3ac10: 80 91 99 04 lds r24, 0x0499 ; 0x800499 3ac14: 90 91 9a 04 lds r25, 0x049A ; 0x80049a 3ac18: 82 17 cp r24, r18 3ac1a: 93 07 cpc r25, r19 3ac1c: 71 f0 breq .+28 ; 0x3ac3a return -1; } else { unsigned char c = rx_buffer.buffer[rx_buffer.tail]; 3ac1e: f9 01 movw r30, r18 3ac20: e7 5e subi r30, 0xE7 ; 231 3ac22: fb 4f sbci r31, 0xFB ; 251 3ac24: 80 81 ld r24, Z rx_buffer.tail = (unsigned int)(rx_buffer.tail + 1) % RX_BUFFER_SIZE; 3ac26: 2f 5f subi r18, 0xFF ; 255 3ac28: 3f 4f sbci r19, 0xFF ; 255 3ac2a: 2f 77 andi r18, 0x7F ; 127 3ac2c: 33 27 eor r19, r19 3ac2e: 30 93 9c 04 sts 0x049C, r19 ; 0x80049c 3ac32: 20 93 9b 04 sts 0x049B, r18 ; 0x80049b return c; 3ac36: 90 e0 ldi r25, 0x00 ; 0 3ac38: 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; 3ac3a: 8f ef ldi r24, 0xFF ; 255 3ac3c: 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; } } 3ac3e: 08 95 ret 0003ac40 <__vector_36>: #endif //DEBUG_DUMP_TO_2ND_SERIAL } } ISR(USART1_RX_vect) { 3ac40: 1f 92 push r1 3ac42: 0f 92 push r0 3ac44: 0f b6 in r0, 0x3f ; 63 3ac46: 0f 92 push r0 3ac48: 11 24 eor r1, r1 3ac4a: 0b b6 in r0, 0x3b ; 59 3ac4c: 0f 92 push r0 3ac4e: 2f 93 push r18 3ac50: 3f 93 push r19 3ac52: 4f 93 push r20 3ac54: 6f 93 push r22 3ac56: 7f 93 push r23 3ac58: 8f 93 push r24 3ac5a: 9f 93 push r25 3ac5c: ef 93 push r30 3ac5e: ff 93 push r31 // Test for a framing error. if (UCSR1A & (1< 3ac64: 84 ff sbrs r24, 4 3ac66: 12 c0 rjmp .+36 ; 0x3ac8c <__vector_36+0x4c> { // Characters received with the framing errors will be ignored. // Dummy register read (discard) (void)(*(char *)UDR1); 3ac68: 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 } } 3ac6c: ff 91 pop r31 3ac6e: ef 91 pop r30 3ac70: 9f 91 pop r25 3ac72: 8f 91 pop r24 3ac74: 7f 91 pop r23 3ac76: 6f 91 pop r22 3ac78: 4f 91 pop r20 3ac7a: 3f 91 pop r19 3ac7c: 2f 91 pop r18 3ac7e: 0f 90 pop r0 3ac80: 0b be out 0x3b, r0 ; 59 3ac82: 0f 90 pop r0 3ac84: 0f be out 0x3f, r0 ; 63 3ac86: 0f 90 pop r0 3ac88: 1f 90 pop r1 3ac8a: 18 95 reti (void)(*(char *)UDR1); } else { // Read the input register. unsigned char c = UDR1; 3ac8c: 40 91 ce 00 lds r20, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> if (selectedSerialPort == 1) 3ac90: 80 91 39 05 lds r24, 0x0539 ; 0x800539 3ac94: 81 30 cpi r24, 0x01 ; 1 3ac96: 51 f7 brne .-44 ; 0x3ac6c <__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; 3ac98: 20 91 99 04 lds r18, 0x0499 ; 0x800499 3ac9c: 30 91 9a 04 lds r19, 0x049A ; 0x80049a 3aca0: c9 01 movw r24, r18 3aca2: 01 96 adiw r24, 0x01 ; 1 3aca4: 8f 77 andi r24, 0x7F ; 127 3aca6: 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) { 3aca8: 60 91 9b 04 lds r22, 0x049B ; 0x80049b 3acac: 70 91 9c 04 lds r23, 0x049C ; 0x80049c 3acb0: 86 17 cp r24, r22 3acb2: 97 07 cpc r25, r23 3acb4: d9 f2 breq .-74 ; 0x3ac6c <__vector_36+0x2c> rx_buffer.buffer[rx_buffer.head] = c; 3acb6: 27 5e subi r18, 0xE7 ; 231 3acb8: 3b 4f sbci r19, 0xFB ; 251 3acba: f9 01 movw r30, r18 3acbc: 40 83 st Z, r20 rx_buffer.head = i; 3acbe: 90 93 9a 04 sts 0x049A, r25 ; 0x80049a 3acc2: 80 93 99 04 sts 0x0499, r24 ; 0x800499 3acc6: d2 cf rjmp .-92 ; 0x3ac6c <__vector_36+0x2c> 0003acc8 <__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) { 3acc8: 1f 92 push r1 3acca: 0f 92 push r0 3accc: 0f b6 in r0, 0x3f ; 63 3acce: 0f 92 push r0 3acd0: 11 24 eor r1, r1 3acd2: 0b b6 in r0, 0x3b ; 59 3acd4: 0f 92 push r0 3acd6: 2f 93 push r18 3acd8: 3f 93 push r19 3acda: 4f 93 push r20 3acdc: 6f 93 push r22 3acde: 7f 93 push r23 3ace0: 8f 93 push r24 3ace2: 9f 93 push r25 3ace4: ef 93 push r30 3ace6: ff 93 push r31 // Test for a framing error. if (M_UCSRxA & (1< 3acec: 84 ff sbrs r24, 4 3acee: 12 c0 rjmp .+36 ; 0x3ad14 <__vector_25+0x4c> { // Characters received with the framing errors will be ignored. // Dummy register read (discard) (void)(*(char *)M_UDRx); 3acf0: 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 } } 3acf4: ff 91 pop r31 3acf6: ef 91 pop r30 3acf8: 9f 91 pop r25 3acfa: 8f 91 pop r24 3acfc: 7f 91 pop r23 3acfe: 6f 91 pop r22 3ad00: 4f 91 pop r20 3ad02: 3f 91 pop r19 3ad04: 2f 91 pop r18 3ad06: 0f 90 pop r0 3ad08: 0b be out 0x3b, r0 ; 59 3ad0a: 0f 90 pop r0 3ad0c: 0f be out 0x3f, r0 ; 63 3ad0e: 0f 90 pop r0 3ad10: 1f 90 pop r1 3ad12: 18 95 reti (void)(*(char *)M_UDRx); } else { // Read the input register. unsigned char c = M_UDRx; 3ad14: 40 91 c6 00 lds r20, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> if (selectedSerialPort == 0) 3ad18: 80 91 39 05 lds r24, 0x0539 ; 0x800539 3ad1c: 81 11 cpse r24, r1 3ad1e: ea cf rjmp .-44 ; 0x3acf4 <__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; 3ad20: 20 91 99 04 lds r18, 0x0499 ; 0x800499 3ad24: 30 91 9a 04 lds r19, 0x049A ; 0x80049a 3ad28: c9 01 movw r24, r18 3ad2a: 01 96 adiw r24, 0x01 ; 1 3ad2c: 8f 77 andi r24, 0x7F ; 127 3ad2e: 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) { 3ad30: 60 91 9b 04 lds r22, 0x049B ; 0x80049b 3ad34: 70 91 9c 04 lds r23, 0x049C ; 0x80049c 3ad38: 86 17 cp r24, r22 3ad3a: 97 07 cpc r25, r23 3ad3c: d9 f2 breq .-74 ; 0x3acf4 <__vector_25+0x2c> rx_buffer.buffer[rx_buffer.head] = c; 3ad3e: 27 5e subi r18, 0xE7 ; 231 3ad40: 3b 4f sbci r19, 0xFB ; 251 3ad42: f9 01 movw r30, r18 3ad44: 40 83 st Z, r20 rx_buffer.head = i; 3ad46: 90 93 9a 04 sts 0x049A, r25 ; 0x80049a 3ad4a: 80 93 99 04 sts 0x0499, r24 ; 0x800499 3ad4e: d2 cf rjmp .-92 ; 0x3acf4 <__vector_25+0x2c> 0003ad50 <__floatunsisf>: 3ad50: e8 94 clt 3ad52: 09 c0 rjmp .+18 ; 0x3ad66 <__floatsisf+0x12> 0003ad54 <__floatsisf>: 3ad54: 97 fb bst r25, 7 3ad56: 3e f4 brtc .+14 ; 0x3ad66 <__floatsisf+0x12> 3ad58: 90 95 com r25 3ad5a: 80 95 com r24 3ad5c: 70 95 com r23 3ad5e: 61 95 neg r22 3ad60: 7f 4f sbci r23, 0xFF ; 255 3ad62: 8f 4f sbci r24, 0xFF ; 255 3ad64: 9f 4f sbci r25, 0xFF ; 255 3ad66: 99 23 and r25, r25 3ad68: a9 f0 breq .+42 ; 0x3ad94 <__floatsisf+0x40> 3ad6a: f9 2f mov r31, r25 3ad6c: 96 e9 ldi r25, 0x96 ; 150 3ad6e: bb 27 eor r27, r27 3ad70: 93 95 inc r25 3ad72: f6 95 lsr r31 3ad74: 87 95 ror r24 3ad76: 77 95 ror r23 3ad78: 67 95 ror r22 3ad7a: b7 95 ror r27 3ad7c: f1 11 cpse r31, r1 3ad7e: f8 cf rjmp .-16 ; 0x3ad70 <__floatsisf+0x1c> 3ad80: fa f4 brpl .+62 ; 0x3adc0 <__floatsisf+0x6c> 3ad82: bb 0f add r27, r27 3ad84: 11 f4 brne .+4 ; 0x3ad8a <__floatsisf+0x36> 3ad86: 60 ff sbrs r22, 0 3ad88: 1b c0 rjmp .+54 ; 0x3adc0 <__floatsisf+0x6c> 3ad8a: 6f 5f subi r22, 0xFF ; 255 3ad8c: 7f 4f sbci r23, 0xFF ; 255 3ad8e: 8f 4f sbci r24, 0xFF ; 255 3ad90: 9f 4f sbci r25, 0xFF ; 255 3ad92: 16 c0 rjmp .+44 ; 0x3adc0 <__floatsisf+0x6c> 3ad94: 88 23 and r24, r24 3ad96: 11 f0 breq .+4 ; 0x3ad9c <__floatsisf+0x48> 3ad98: 96 e9 ldi r25, 0x96 ; 150 3ad9a: 11 c0 rjmp .+34 ; 0x3adbe <__floatsisf+0x6a> 3ad9c: 77 23 and r23, r23 3ad9e: 21 f0 breq .+8 ; 0x3ada8 <__floatsisf+0x54> 3ada0: 9e e8 ldi r25, 0x8E ; 142 3ada2: 87 2f mov r24, r23 3ada4: 76 2f mov r23, r22 3ada6: 05 c0 rjmp .+10 ; 0x3adb2 <__floatsisf+0x5e> 3ada8: 66 23 and r22, r22 3adaa: 71 f0 breq .+28 ; 0x3adc8 <__floatsisf+0x74> 3adac: 96 e8 ldi r25, 0x86 ; 134 3adae: 86 2f mov r24, r22 3adb0: 70 e0 ldi r23, 0x00 ; 0 3adb2: 60 e0 ldi r22, 0x00 ; 0 3adb4: 2a f0 brmi .+10 ; 0x3adc0 <__floatsisf+0x6c> 3adb6: 9a 95 dec r25 3adb8: 66 0f add r22, r22 3adba: 77 1f adc r23, r23 3adbc: 88 1f adc r24, r24 3adbe: da f7 brpl .-10 ; 0x3adb6 <__floatsisf+0x62> 3adc0: 88 0f add r24, r24 3adc2: 96 95 lsr r25 3adc4: 87 95 ror r24 3adc6: 97 f9 bld r25, 7 3adc8: 08 95 ret 0003adca : 3adca: 9b 01 movw r18, r22 3adcc: ac 01 movw r20, r24 3adce: 0d 94 e9 d6 jmp 0x3add2 ; 0x3add2 <__mulsf3> 0003add2 <__mulsf3>: 3add2: 0f 94 fc d6 call 0x3adf8 ; 0x3adf8 <__mulsf3x> 3add6: 0d 94 6d d7 jmp 0x3aeda ; 0x3aeda <__fp_round> 3adda: 0f 94 5f d7 call 0x3aebe ; 0x3aebe <__fp_pscA> 3adde: 38 f0 brcs .+14 ; 0x3adee <__mulsf3+0x1c> 3ade0: 0f 94 66 d7 call 0x3aecc ; 0x3aecc <__fp_pscB> 3ade4: 20 f0 brcs .+8 ; 0x3adee <__mulsf3+0x1c> 3ade6: 95 23 and r25, r21 3ade8: 11 f0 breq .+4 ; 0x3adee <__mulsf3+0x1c> 3adea: 0d 94 56 d7 jmp 0x3aeac ; 0x3aeac <__fp_inf> 3adee: 0d 94 5c d7 jmp 0x3aeb8 ; 0x3aeb8 <__fp_nan> 3adf2: 11 24 eor r1, r1 3adf4: 0d 94 a1 d7 jmp 0x3af42 ; 0x3af42 <__fp_szero> 0003adf8 <__mulsf3x>: 3adf8: 0f 94 7e d7 call 0x3aefc ; 0x3aefc <__fp_split3> 3adfc: 70 f3 brcs .-36 ; 0x3adda <__mulsf3+0x8> 0003adfe <__mulsf3_pse>: 3adfe: 95 9f mul r25, r21 3ae00: c1 f3 breq .-16 ; 0x3adf2 <__mulsf3+0x20> 3ae02: 95 0f add r25, r21 3ae04: 50 e0 ldi r21, 0x00 ; 0 3ae06: 55 1f adc r21, r21 3ae08: 62 9f mul r22, r18 3ae0a: f0 01 movw r30, r0 3ae0c: 72 9f mul r23, r18 3ae0e: bb 27 eor r27, r27 3ae10: f0 0d add r31, r0 3ae12: b1 1d adc r27, r1 3ae14: 63 9f mul r22, r19 3ae16: aa 27 eor r26, r26 3ae18: f0 0d add r31, r0 3ae1a: b1 1d adc r27, r1 3ae1c: aa 1f adc r26, r26 3ae1e: 64 9f mul r22, r20 3ae20: 66 27 eor r22, r22 3ae22: b0 0d add r27, r0 3ae24: a1 1d adc r26, r1 3ae26: 66 1f adc r22, r22 3ae28: 82 9f mul r24, r18 3ae2a: 22 27 eor r18, r18 3ae2c: b0 0d add r27, r0 3ae2e: a1 1d adc r26, r1 3ae30: 62 1f adc r22, r18 3ae32: 73 9f mul r23, r19 3ae34: b0 0d add r27, r0 3ae36: a1 1d adc r26, r1 3ae38: 62 1f adc r22, r18 3ae3a: 83 9f mul r24, r19 3ae3c: a0 0d add r26, r0 3ae3e: 61 1d adc r22, r1 3ae40: 22 1f adc r18, r18 3ae42: 74 9f mul r23, r20 3ae44: 33 27 eor r19, r19 3ae46: a0 0d add r26, r0 3ae48: 61 1d adc r22, r1 3ae4a: 23 1f adc r18, r19 3ae4c: 84 9f mul r24, r20 3ae4e: 60 0d add r22, r0 3ae50: 21 1d adc r18, r1 3ae52: 82 2f mov r24, r18 3ae54: 76 2f mov r23, r22 3ae56: 6a 2f mov r22, r26 3ae58: 11 24 eor r1, r1 3ae5a: 9f 57 subi r25, 0x7F ; 127 3ae5c: 50 40 sbci r21, 0x00 ; 0 3ae5e: 9a f0 brmi .+38 ; 0x3ae86 <__mulsf3_pse+0x88> 3ae60: f1 f0 breq .+60 ; 0x3ae9e <__mulsf3_pse+0xa0> 3ae62: 88 23 and r24, r24 3ae64: 4a f0 brmi .+18 ; 0x3ae78 <__mulsf3_pse+0x7a> 3ae66: ee 0f add r30, r30 3ae68: ff 1f adc r31, r31 3ae6a: bb 1f adc r27, r27 3ae6c: 66 1f adc r22, r22 3ae6e: 77 1f adc r23, r23 3ae70: 88 1f adc r24, r24 3ae72: 91 50 subi r25, 0x01 ; 1 3ae74: 50 40 sbci r21, 0x00 ; 0 3ae76: a9 f7 brne .-22 ; 0x3ae62 <__mulsf3_pse+0x64> 3ae78: 9e 3f cpi r25, 0xFE ; 254 3ae7a: 51 05 cpc r21, r1 3ae7c: 80 f0 brcs .+32 ; 0x3ae9e <__mulsf3_pse+0xa0> 3ae7e: 0d 94 56 d7 jmp 0x3aeac ; 0x3aeac <__fp_inf> 3ae82: 0d 94 a1 d7 jmp 0x3af42 ; 0x3af42 <__fp_szero> 3ae86: 5f 3f cpi r21, 0xFF ; 255 3ae88: e4 f3 brlt .-8 ; 0x3ae82 <__mulsf3_pse+0x84> 3ae8a: 98 3e cpi r25, 0xE8 ; 232 3ae8c: d4 f3 brlt .-12 ; 0x3ae82 <__mulsf3_pse+0x84> 3ae8e: 86 95 lsr r24 3ae90: 77 95 ror r23 3ae92: 67 95 ror r22 3ae94: b7 95 ror r27 3ae96: f7 95 ror r31 3ae98: e7 95 ror r30 3ae9a: 9f 5f subi r25, 0xFF ; 255 3ae9c: c1 f7 brne .-16 ; 0x3ae8e <__mulsf3_pse+0x90> 3ae9e: fe 2b or r31, r30 3aea0: 88 0f add r24, r24 3aea2: 91 1d adc r25, r1 3aea4: 96 95 lsr r25 3aea6: 87 95 ror r24 3aea8: 97 f9 bld r25, 7 3aeaa: 08 95 ret 0003aeac <__fp_inf>: 3aeac: 97 f9 bld r25, 7 3aeae: 9f 67 ori r25, 0x7F ; 127 3aeb0: 80 e8 ldi r24, 0x80 ; 128 3aeb2: 70 e0 ldi r23, 0x00 ; 0 3aeb4: 60 e0 ldi r22, 0x00 ; 0 3aeb6: 08 95 ret 0003aeb8 <__fp_nan>: 3aeb8: 9f ef ldi r25, 0xFF ; 255 3aeba: 80 ec ldi r24, 0xC0 ; 192 3aebc: 08 95 ret 0003aebe <__fp_pscA>: 3aebe: 00 24 eor r0, r0 3aec0: 0a 94 dec r0 3aec2: 16 16 cp r1, r22 3aec4: 17 06 cpc r1, r23 3aec6: 18 06 cpc r1, r24 3aec8: 09 06 cpc r0, r25 3aeca: 08 95 ret 0003aecc <__fp_pscB>: 3aecc: 00 24 eor r0, r0 3aece: 0a 94 dec r0 3aed0: 12 16 cp r1, r18 3aed2: 13 06 cpc r1, r19 3aed4: 14 06 cpc r1, r20 3aed6: 05 06 cpc r0, r21 3aed8: 08 95 ret 0003aeda <__fp_round>: 3aeda: 09 2e mov r0, r25 3aedc: 03 94 inc r0 3aede: 00 0c add r0, r0 3aee0: 11 f4 brne .+4 ; 0x3aee6 <__fp_round+0xc> 3aee2: 88 23 and r24, r24 3aee4: 52 f0 brmi .+20 ; 0x3aefa <__fp_round+0x20> 3aee6: bb 0f add r27, r27 3aee8: 40 f4 brcc .+16 ; 0x3aefa <__fp_round+0x20> 3aeea: bf 2b or r27, r31 3aeec: 11 f4 brne .+4 ; 0x3aef2 <__fp_round+0x18> 3aeee: 60 ff sbrs r22, 0 3aef0: 04 c0 rjmp .+8 ; 0x3aefa <__fp_round+0x20> 3aef2: 6f 5f subi r22, 0xFF ; 255 3aef4: 7f 4f sbci r23, 0xFF ; 255 3aef6: 8f 4f sbci r24, 0xFF ; 255 3aef8: 9f 4f sbci r25, 0xFF ; 255 3aefa: 08 95 ret 0003aefc <__fp_split3>: 3aefc: 57 fd sbrc r21, 7 3aefe: 90 58 subi r25, 0x80 ; 128 3af00: 44 0f add r20, r20 3af02: 55 1f adc r21, r21 3af04: 59 f0 breq .+22 ; 0x3af1c <__fp_splitA+0x10> 3af06: 5f 3f cpi r21, 0xFF ; 255 3af08: 71 f0 breq .+28 ; 0x3af26 <__fp_splitA+0x1a> 3af0a: 47 95 ror r20 0003af0c <__fp_splitA>: 3af0c: 88 0f add r24, r24 3af0e: 97 fb bst r25, 7 3af10: 99 1f adc r25, r25 3af12: 61 f0 breq .+24 ; 0x3af2c <__fp_splitA+0x20> 3af14: 9f 3f cpi r25, 0xFF ; 255 3af16: 79 f0 breq .+30 ; 0x3af36 <__fp_splitA+0x2a> 3af18: 87 95 ror r24 3af1a: 08 95 ret 3af1c: 12 16 cp r1, r18 3af1e: 13 06 cpc r1, r19 3af20: 14 06 cpc r1, r20 3af22: 55 1f adc r21, r21 3af24: f2 cf rjmp .-28 ; 0x3af0a <__fp_split3+0xe> 3af26: 46 95 lsr r20 3af28: f1 df rcall .-30 ; 0x3af0c <__fp_splitA> 3af2a: 08 c0 rjmp .+16 ; 0x3af3c <__fp_splitA+0x30> 3af2c: 16 16 cp r1, r22 3af2e: 17 06 cpc r1, r23 3af30: 18 06 cpc r1, r24 3af32: 99 1f adc r25, r25 3af34: f1 cf rjmp .-30 ; 0x3af18 <__fp_splitA+0xc> 3af36: 86 95 lsr r24 3af38: 71 05 cpc r23, r1 3af3a: 61 05 cpc r22, r1 3af3c: 08 94 sec 3af3e: 08 95 ret 0003af40 <__fp_zero>: 3af40: e8 94 clt 0003af42 <__fp_szero>: 3af42: bb 27 eor r27, r27 3af44: 66 27 eor r22, r22 3af46: 77 27 eor r23, r23 3af48: cb 01 movw r24, r22 3af4a: 97 f9 bld r25, 7 3af4c: 08 95 ret 0003af4e : 3af4e: 3f 92 push r3 3af50: 4f 92 push r4 3af52: 5f 92 push r5 3af54: 6f 92 push r6 3af56: 7f 92 push r7 3af58: 8f 92 push r8 3af5a: 9f 92 push r9 3af5c: af 92 push r10 3af5e: bf 92 push r11 3af60: cf 92 push r12 3af62: df 92 push r13 3af64: ef 92 push r14 3af66: ff 92 push r15 3af68: 0f 93 push r16 3af6a: 1f 93 push r17 3af6c: cf 93 push r28 3af6e: df 93 push r29 3af70: 5c 01 movw r10, r24 3af72: 6b 01 movw r12, r22 3af74: 7a 01 movw r14, r20 3af76: 61 15 cp r22, r1 3af78: 71 05 cpc r23, r1 3af7a: 19 f0 breq .+6 ; 0x3af82 3af7c: fb 01 movw r30, r22 3af7e: 91 83 std Z+1, r25 ; 0x01 3af80: 80 83 st Z, r24 3af82: e1 14 cp r14, r1 3af84: f1 04 cpc r15, r1 3af86: 51 f0 breq .+20 ; 0x3af9c 3af88: c7 01 movw r24, r14 3af8a: 02 97 sbiw r24, 0x02 ; 2 3af8c: 83 97 sbiw r24, 0x23 ; 35 3af8e: 30 f0 brcs .+12 ; 0x3af9c 3af90: 40 e0 ldi r20, 0x00 ; 0 3af92: 30 e0 ldi r19, 0x00 ; 0 3af94: 20 e0 ldi r18, 0x00 ; 0 3af96: 90 e0 ldi r25, 0x00 ; 0 3af98: 6b c0 rjmp .+214 ; 0x3b070 3af9a: 5e 01 movw r10, r28 3af9c: e5 01 movw r28, r10 3af9e: 21 96 adiw r28, 0x01 ; 1 3afa0: f5 01 movw r30, r10 3afa2: 10 81 ld r17, Z 3afa4: 81 2f mov r24, r17 3afa6: 90 e0 ldi r25, 0x00 ; 0 3afa8: 0f 94 ad d9 call 0x3b35a ; 0x3b35a 3afac: 89 2b or r24, r25 3afae: a9 f7 brne .-22 ; 0x3af9a 3afb0: 1d 32 cpi r17, 0x2D ; 45 3afb2: 01 f5 brne .+64 ; 0x3aff4 3afb4: 21 96 adiw r28, 0x01 ; 1 3afb6: f5 01 movw r30, r10 3afb8: 11 81 ldd r17, Z+1 ; 0x01 3afba: 01 e0 ldi r16, 0x01 ; 1 3afbc: e1 14 cp r14, r1 3afbe: f1 04 cpc r15, r1 3afc0: 09 f4 brne .+2 ; 0x3afc4 3afc2: e6 c0 rjmp .+460 ; 0x3b190 3afc4: f0 e1 ldi r31, 0x10 ; 16 3afc6: ef 16 cp r14, r31 3afc8: f1 04 cpc r15, r1 3afca: 09 f0 breq .+2 ; 0x3afce 3afcc: 88 c0 rjmp .+272 ; 0x3b0de 3afce: 10 33 cpi r17, 0x30 ; 48 3afd0: 59 f4 brne .+22 ; 0x3afe8 3afd2: 88 81 ld r24, Y 3afd4: 8f 7d andi r24, 0xDF ; 223 3afd6: 88 35 cpi r24, 0x58 ; 88 3afd8: 09 f0 breq .+2 ; 0x3afdc 3afda: 7c c0 rjmp .+248 ; 0x3b0d4 3afdc: 19 81 ldd r17, Y+1 ; 0x01 3afde: 22 96 adiw r28, 0x02 ; 2 3afe0: 02 60 ori r16, 0x02 ; 2 3afe2: f0 e1 ldi r31, 0x10 ; 16 3afe4: ef 2e mov r14, r31 3afe6: f1 2c mov r15, r1 3afe8: 81 2c mov r8, r1 3afea: 91 2c mov r9, r1 3afec: a1 2c mov r10, r1 3afee: 88 e0 ldi r24, 0x08 ; 8 3aff0: b8 2e mov r11, r24 3aff2: 92 c0 rjmp .+292 ; 0x3b118 3aff4: 1b 32 cpi r17, 0x2B ; 43 3aff6: 21 f4 brne .+8 ; 0x3b000 3aff8: e5 01 movw r28, r10 3affa: 22 96 adiw r28, 0x02 ; 2 3affc: f5 01 movw r30, r10 3affe: 11 81 ldd r17, Z+1 ; 0x01 3b000: 00 e0 ldi r16, 0x00 ; 0 3b002: dc cf rjmp .-72 ; 0x3afbc 3b004: ea e0 ldi r30, 0x0A ; 10 3b006: ee 16 cp r14, r30 3b008: f1 04 cpc r15, r1 3b00a: 09 f4 brne .+2 ; 0x3b00e 3b00c: c7 c0 rjmp .+398 ; 0x3b19c 3b00e: f0 e1 ldi r31, 0x10 ; 16 3b010: ef 16 cp r14, r31 3b012: f1 04 cpc r15, r1 3b014: 09 f0 breq .+2 ; 0x3b018 3b016: 73 c0 rjmp .+230 ; 0x3b0fe 3b018: e7 cf rjmp .-50 ; 0x3afe8 3b01a: 78 e0 ldi r23, 0x08 ; 8 3b01c: e7 2e mov r14, r23 3b01e: f1 2c mov r15, r1 3b020: 81 2c mov r8, r1 3b022: 91 2c mov r9, r1 3b024: a1 2c mov r10, r1 3b026: 60 e1 ldi r22, 0x10 ; 16 3b028: b6 2e mov r11, r22 3b02a: 76 c0 rjmp .+236 ; 0x3b118 3b02c: 21 e0 ldi r18, 0x01 ; 1 3b02e: ad c0 rjmp .+346 ; 0x3b18a 3b030: 30 2f mov r19, r16 3b032: 31 70 andi r19, 0x01 ; 1 3b034: c1 14 cp r12, r1 3b036: d1 04 cpc r13, r1 3b038: 31 f0 breq .+12 ; 0x3b046 3b03a: 22 23 and r18, r18 3b03c: 71 f1 breq .+92 ; 0x3b09a 3b03e: 21 97 sbiw r28, 0x01 ; 1 3b040: f6 01 movw r30, r12 3b042: d1 83 std Z+1, r29 ; 0x01 3b044: c0 83 st Z, r28 3b046: 27 ff sbrs r18, 7 3b048: 2e c0 rjmp .+92 ; 0x3b0a6 3b04a: 60 e0 ldi r22, 0x00 ; 0 3b04c: 70 e0 ldi r23, 0x00 ; 0 3b04e: 80 e0 ldi r24, 0x00 ; 0 3b050: 90 e8 ldi r25, 0x80 ; 128 3b052: 31 11 cpse r19, r1 3b054: 04 c0 rjmp .+8 ; 0x3b05e 3b056: 6f ef ldi r22, 0xFF ; 255 3b058: 7f ef ldi r23, 0xFF ; 255 3b05a: 8f ef ldi r24, 0xFF ; 255 3b05c: 9f e7 ldi r25, 0x7F ; 127 3b05e: 22 e2 ldi r18, 0x22 ; 34 3b060: 30 e0 ldi r19, 0x00 ; 0 3b062: 30 93 15 18 sts 0x1815, r19 ; 0x801815 3b066: 20 93 14 18 sts 0x1814, r18 ; 0x801814 3b06a: 46 2f mov r20, r22 3b06c: 37 2f mov r19, r23 3b06e: 28 2f mov r18, r24 3b070: 64 2f mov r22, r20 3b072: 73 2f mov r23, r19 3b074: 82 2f mov r24, r18 3b076: df 91 pop r29 3b078: cf 91 pop r28 3b07a: 1f 91 pop r17 3b07c: 0f 91 pop r16 3b07e: ff 90 pop r15 3b080: ef 90 pop r14 3b082: df 90 pop r13 3b084: cf 90 pop r12 3b086: bf 90 pop r11 3b088: af 90 pop r10 3b08a: 9f 90 pop r9 3b08c: 8f 90 pop r8 3b08e: 7f 90 pop r7 3b090: 6f 90 pop r6 3b092: 5f 90 pop r5 3b094: 4f 90 pop r4 3b096: 3f 90 pop r3 3b098: 08 95 ret 3b09a: 01 ff sbrs r16, 1 3b09c: 04 c0 rjmp .+8 ; 0x3b0a6 3b09e: 22 97 sbiw r28, 0x02 ; 2 3b0a0: f6 01 movw r30, r12 3b0a2: d1 83 std Z+1, r29 ; 0x01 3b0a4: c0 83 st Z, r28 3b0a6: 33 23 and r19, r19 3b0a8: 41 f0 breq .+16 ; 0x3b0ba 3b0aa: 90 95 com r25 3b0ac: 80 95 com r24 3b0ae: 70 95 com r23 3b0b0: 61 95 neg r22 3b0b2: 7f 4f sbci r23, 0xFF ; 255 3b0b4: 8f 4f sbci r24, 0xFF ; 255 3b0b6: 9f 4f sbci r25, 0xFF ; 255 3b0b8: d8 cf rjmp .-80 ; 0x3b06a 3b0ba: 97 ff sbrs r25, 7 3b0bc: d6 cf rjmp .-84 ; 0x3b06a 3b0be: 82 e2 ldi r24, 0x22 ; 34 3b0c0: 90 e0 ldi r25, 0x00 ; 0 3b0c2: 90 93 15 18 sts 0x1815, r25 ; 0x801815 3b0c6: 80 93 14 18 sts 0x1814, r24 ; 0x801814 3b0ca: 6f ef ldi r22, 0xFF ; 255 3b0cc: 7f ef ldi r23, 0xFF ; 255 3b0ce: 8f ef ldi r24, 0xFF ; 255 3b0d0: 9f e7 ldi r25, 0x7F ; 127 3b0d2: cb cf rjmp .-106 ; 0x3b06a 3b0d4: 10 e3 ldi r17, 0x30 ; 48 3b0d6: e1 14 cp r14, r1 3b0d8: f1 04 cpc r15, r1 3b0da: 09 f4 brne .+2 ; 0x3b0de 3b0dc: 9e cf rjmp .-196 ; 0x3b01a 3b0de: 28 e0 ldi r18, 0x08 ; 8 3b0e0: e2 16 cp r14, r18 3b0e2: f1 04 cpc r15, r1 3b0e4: 09 f4 brne .+2 ; 0x3b0e8 3b0e6: 9c cf rjmp .-200 ; 0x3b020 3b0e8: 0c f0 brlt .+2 ; 0x3b0ec 3b0ea: 8c cf rjmp .-232 ; 0x3b004 3b0ec: 81 2c mov r8, r1 3b0ee: 91 2c mov r9, r1 3b0f0: a1 2c mov r10, r1 3b0f2: e0 e4 ldi r30, 0x40 ; 64 3b0f4: be 2e mov r11, r30 3b0f6: 82 e0 ldi r24, 0x02 ; 2 3b0f8: e8 16 cp r14, r24 3b0fa: f1 04 cpc r15, r1 3b0fc: 69 f0 breq .+26 ; 0x3b118 3b0fe: 60 e0 ldi r22, 0x00 ; 0 3b100: 70 e0 ldi r23, 0x00 ; 0 3b102: 80 e0 ldi r24, 0x00 ; 0 3b104: 90 e8 ldi r25, 0x80 ; 128 3b106: 97 01 movw r18, r14 3b108: 0f 2c mov r0, r15 3b10a: 00 0c add r0, r0 3b10c: 44 0b sbc r20, r20 3b10e: 55 0b sbc r21, r21 3b110: 0f 94 8f dc call 0x3b91e ; 0x3b91e <__udivmodsi4> 3b114: 49 01 movw r8, r18 3b116: 5a 01 movw r10, r20 3b118: 20 e0 ldi r18, 0x00 ; 0 3b11a: 60 e0 ldi r22, 0x00 ; 0 3b11c: 70 e0 ldi r23, 0x00 ; 0 3b11e: cb 01 movw r24, r22 3b120: 27 01 movw r4, r14 3b122: 0f 2c mov r0, r15 3b124: 00 0c add r0, r0 3b126: 66 08 sbc r6, r6 3b128: 77 08 sbc r7, r7 3b12a: fe 01 movw r30, r28 3b12c: 50 ed ldi r21, 0xD0 ; 208 3b12e: 35 2e mov r3, r21 3b130: 31 0e add r3, r17 3b132: 39 e0 ldi r19, 0x09 ; 9 3b134: 33 15 cp r19, r3 3b136: 70 f4 brcc .+28 ; 0x3b154 3b138: 3f eb ldi r19, 0xBF ; 191 3b13a: 31 0f add r19, r17 3b13c: 49 ec ldi r20, 0xC9 ; 201 3b13e: 34 2e mov r3, r20 3b140: 3a 31 cpi r19, 0x1A ; 26 3b142: 38 f0 brcs .+14 ; 0x3b152 3b144: 3f e9 ldi r19, 0x9F ; 159 3b146: 31 0f add r19, r17 3b148: 3a 31 cpi r19, 0x1A ; 26 3b14a: 08 f0 brcs .+2 ; 0x3b14e 3b14c: 71 cf rjmp .-286 ; 0x3b030 3b14e: 39 ea ldi r19, 0xA9 ; 169 3b150: 33 2e mov r3, r19 3b152: 31 0e add r3, r17 3b154: 3e 14 cp r3, r14 3b156: 1f 04 cpc r1, r15 3b158: 0c f0 brlt .+2 ; 0x3b15c 3b15a: 6a cf rjmp .-300 ; 0x3b030 3b15c: 27 fd sbrc r18, 7 3b15e: 15 c0 rjmp .+42 ; 0x3b18a 3b160: 86 16 cp r8, r22 3b162: 97 06 cpc r9, r23 3b164: a8 06 cpc r10, r24 3b166: b9 06 cpc r11, r25 3b168: 78 f0 brcs .+30 ; 0x3b188 3b16a: a3 01 movw r20, r6 3b16c: 92 01 movw r18, r4 3b16e: 0f 94 7f dc call 0x3b8fe ; 0x3b8fe <__mulsi3> 3b172: 63 0d add r22, r3 3b174: 71 1d adc r23, r1 3b176: 81 1d adc r24, r1 3b178: 91 1d adc r25, r1 3b17a: 61 30 cpi r22, 0x01 ; 1 3b17c: 71 05 cpc r23, r1 3b17e: 81 05 cpc r24, r1 3b180: 20 e8 ldi r18, 0x80 ; 128 3b182: 92 07 cpc r25, r18 3b184: 08 f4 brcc .+2 ; 0x3b188 3b186: 52 cf rjmp .-348 ; 0x3b02c 3b188: 2f ef ldi r18, 0xFF ; 255 3b18a: 21 96 adiw r28, 0x01 ; 1 3b18c: 10 81 ld r17, Z 3b18e: cd cf rjmp .-102 ; 0x3b12a 3b190: 10 33 cpi r17, 0x30 ; 48 3b192: 09 f4 brne .+2 ; 0x3b196 3b194: 1e cf rjmp .-452 ; 0x3afd2 3b196: 2a e0 ldi r18, 0x0A ; 10 3b198: e2 2e mov r14, r18 3b19a: f1 2c mov r15, r1 3b19c: 9c ec ldi r25, 0xCC ; 204 3b19e: 89 2e mov r8, r25 3b1a0: 98 2c mov r9, r8 3b1a2: a8 2c mov r10, r8 3b1a4: 9c e0 ldi r25, 0x0C ; 12 3b1a6: b9 2e mov r11, r25 3b1a8: b7 cf rjmp .-146 ; 0x3b118 0003b1aa <__ftoa_engine>: 3b1aa: 28 30 cpi r18, 0x08 ; 8 3b1ac: 08 f0 brcs .+2 ; 0x3b1b0 <__ftoa_engine+0x6> 3b1ae: 27 e0 ldi r18, 0x07 ; 7 3b1b0: 33 27 eor r19, r19 3b1b2: da 01 movw r26, r20 3b1b4: 99 0f add r25, r25 3b1b6: 31 1d adc r19, r1 3b1b8: 87 fd sbrc r24, 7 3b1ba: 91 60 ori r25, 0x01 ; 1 3b1bc: 00 96 adiw r24, 0x00 ; 0 3b1be: 61 05 cpc r22, r1 3b1c0: 71 05 cpc r23, r1 3b1c2: 39 f4 brne .+14 ; 0x3b1d2 <__ftoa_engine+0x28> 3b1c4: 32 60 ori r19, 0x02 ; 2 3b1c6: 2e 5f subi r18, 0xFE ; 254 3b1c8: 3d 93 st X+, r19 3b1ca: 30 e3 ldi r19, 0x30 ; 48 3b1cc: 2a 95 dec r18 3b1ce: e1 f7 brne .-8 ; 0x3b1c8 <__ftoa_engine+0x1e> 3b1d0: 08 95 ret 3b1d2: 9f 3f cpi r25, 0xFF ; 255 3b1d4: 30 f0 brcs .+12 ; 0x3b1e2 <__ftoa_engine+0x38> 3b1d6: 80 38 cpi r24, 0x80 ; 128 3b1d8: 71 05 cpc r23, r1 3b1da: 61 05 cpc r22, r1 3b1dc: 09 f0 breq .+2 ; 0x3b1e0 <__ftoa_engine+0x36> 3b1de: 3c 5f subi r19, 0xFC ; 252 3b1e0: 3c 5f subi r19, 0xFC ; 252 3b1e2: 3d 93 st X+, r19 3b1e4: 91 30 cpi r25, 0x01 ; 1 3b1e6: 08 f0 brcs .+2 ; 0x3b1ea <__ftoa_engine+0x40> 3b1e8: 80 68 ori r24, 0x80 ; 128 3b1ea: 91 1d adc r25, r1 3b1ec: df 93 push r29 3b1ee: cf 93 push r28 3b1f0: 1f 93 push r17 3b1f2: 0f 93 push r16 3b1f4: ff 92 push r15 3b1f6: ef 92 push r14 3b1f8: 19 2f mov r17, r25 3b1fa: 98 7f andi r25, 0xF8 ; 248 3b1fc: 96 95 lsr r25 3b1fe: e9 2f mov r30, r25 3b200: 96 95 lsr r25 3b202: 96 95 lsr r25 3b204: e9 0f add r30, r25 3b206: ff 27 eor r31, r31 3b208: e2 55 subi r30, 0x52 ; 82 3b20a: f9 48 sbci r31, 0x89 ; 137 3b20c: 99 27 eor r25, r25 3b20e: 33 27 eor r19, r19 3b210: ee 24 eor r14, r14 3b212: ff 24 eor r15, r15 3b214: a7 01 movw r20, r14 3b216: e7 01 movw r28, r14 3b218: 05 90 lpm r0, Z+ 3b21a: 08 94 sec 3b21c: 07 94 ror r0 3b21e: 28 f4 brcc .+10 ; 0x3b22a <__ftoa_engine+0x80> 3b220: 36 0f add r19, r22 3b222: e7 1e adc r14, r23 3b224: f8 1e adc r15, r24 3b226: 49 1f adc r20, r25 3b228: 51 1d adc r21, r1 3b22a: 66 0f add r22, r22 3b22c: 77 1f adc r23, r23 3b22e: 88 1f adc r24, r24 3b230: 99 1f adc r25, r25 3b232: 06 94 lsr r0 3b234: a1 f7 brne .-24 ; 0x3b21e <__ftoa_engine+0x74> 3b236: 05 90 lpm r0, Z+ 3b238: 07 94 ror r0 3b23a: 28 f4 brcc .+10 ; 0x3b246 <__ftoa_engine+0x9c> 3b23c: e7 0e add r14, r23 3b23e: f8 1e adc r15, r24 3b240: 49 1f adc r20, r25 3b242: 56 1f adc r21, r22 3b244: c1 1d adc r28, r1 3b246: 77 0f add r23, r23 3b248: 88 1f adc r24, r24 3b24a: 99 1f adc r25, r25 3b24c: 66 1f adc r22, r22 3b24e: 06 94 lsr r0 3b250: a1 f7 brne .-24 ; 0x3b23a <__ftoa_engine+0x90> 3b252: 05 90 lpm r0, Z+ 3b254: 07 94 ror r0 3b256: 28 f4 brcc .+10 ; 0x3b262 <__ftoa_engine+0xb8> 3b258: f8 0e add r15, r24 3b25a: 49 1f adc r20, r25 3b25c: 56 1f adc r21, r22 3b25e: c7 1f adc r28, r23 3b260: d1 1d adc r29, r1 3b262: 88 0f add r24, r24 3b264: 99 1f adc r25, r25 3b266: 66 1f adc r22, r22 3b268: 77 1f adc r23, r23 3b26a: 06 94 lsr r0 3b26c: a1 f7 brne .-24 ; 0x3b256 <__ftoa_engine+0xac> 3b26e: 05 90 lpm r0, Z+ 3b270: 07 94 ror r0 3b272: 20 f4 brcc .+8 ; 0x3b27c <__ftoa_engine+0xd2> 3b274: 49 0f add r20, r25 3b276: 56 1f adc r21, r22 3b278: c7 1f adc r28, r23 3b27a: d8 1f adc r29, r24 3b27c: 99 0f add r25, r25 3b27e: 66 1f adc r22, r22 3b280: 77 1f adc r23, r23 3b282: 88 1f adc r24, r24 3b284: 06 94 lsr r0 3b286: a9 f7 brne .-22 ; 0x3b272 <__ftoa_engine+0xc8> 3b288: 84 91 lpm r24, Z 3b28a: 10 95 com r17 3b28c: 17 70 andi r17, 0x07 ; 7 3b28e: 41 f0 breq .+16 ; 0x3b2a0 <__ftoa_engine+0xf6> 3b290: d6 95 lsr r29 3b292: c7 95 ror r28 3b294: 57 95 ror r21 3b296: 47 95 ror r20 3b298: f7 94 ror r15 3b29a: e7 94 ror r14 3b29c: 1a 95 dec r17 3b29e: c1 f7 brne .-16 ; 0x3b290 <__ftoa_engine+0xe6> 3b2a0: e4 e5 ldi r30, 0x54 ; 84 3b2a2: f6 e7 ldi r31, 0x76 ; 118 3b2a4: 68 94 set 3b2a6: 15 90 lpm r1, Z+ 3b2a8: 15 91 lpm r17, Z+ 3b2aa: 35 91 lpm r19, Z+ 3b2ac: 65 91 lpm r22, Z+ 3b2ae: 95 91 lpm r25, Z+ 3b2b0: 05 90 lpm r0, Z+ 3b2b2: 7f e2 ldi r23, 0x2F ; 47 3b2b4: 73 95 inc r23 3b2b6: e1 18 sub r14, r1 3b2b8: f1 0a sbc r15, r17 3b2ba: 43 0b sbc r20, r19 3b2bc: 56 0b sbc r21, r22 3b2be: c9 0b sbc r28, r25 3b2c0: d0 09 sbc r29, r0 3b2c2: c0 f7 brcc .-16 ; 0x3b2b4 <__ftoa_engine+0x10a> 3b2c4: e1 0c add r14, r1 3b2c6: f1 1e adc r15, r17 3b2c8: 43 1f adc r20, r19 3b2ca: 56 1f adc r21, r22 3b2cc: c9 1f adc r28, r25 3b2ce: d0 1d adc r29, r0 3b2d0: 7e f4 brtc .+30 ; 0x3b2f0 <__ftoa_engine+0x146> 3b2d2: 70 33 cpi r23, 0x30 ; 48 3b2d4: 11 f4 brne .+4 ; 0x3b2da <__ftoa_engine+0x130> 3b2d6: 8a 95 dec r24 3b2d8: e6 cf rjmp .-52 ; 0x3b2a6 <__ftoa_engine+0xfc> 3b2da: e8 94 clt 3b2dc: 01 50 subi r16, 0x01 ; 1 3b2de: 30 f0 brcs .+12 ; 0x3b2ec <__ftoa_engine+0x142> 3b2e0: 08 0f add r16, r24 3b2e2: 0a f4 brpl .+2 ; 0x3b2e6 <__ftoa_engine+0x13c> 3b2e4: 00 27 eor r16, r16 3b2e6: 02 17 cp r16, r18 3b2e8: 08 f4 brcc .+2 ; 0x3b2ec <__ftoa_engine+0x142> 3b2ea: 20 2f mov r18, r16 3b2ec: 23 95 inc r18 3b2ee: 02 2f mov r16, r18 3b2f0: 7a 33 cpi r23, 0x3A ; 58 3b2f2: 28 f0 brcs .+10 ; 0x3b2fe <__ftoa_engine+0x154> 3b2f4: 79 e3 ldi r23, 0x39 ; 57 3b2f6: 7d 93 st X+, r23 3b2f8: 2a 95 dec r18 3b2fa: e9 f7 brne .-6 ; 0x3b2f6 <__ftoa_engine+0x14c> 3b2fc: 10 c0 rjmp .+32 ; 0x3b31e <__ftoa_engine+0x174> 3b2fe: 7d 93 st X+, r23 3b300: 2a 95 dec r18 3b302: 89 f6 brne .-94 ; 0x3b2a6 <__ftoa_engine+0xfc> 3b304: 06 94 lsr r0 3b306: 97 95 ror r25 3b308: 67 95 ror r22 3b30a: 37 95 ror r19 3b30c: 17 95 ror r17 3b30e: 17 94 ror r1 3b310: e1 18 sub r14, r1 3b312: f1 0a sbc r15, r17 3b314: 43 0b sbc r20, r19 3b316: 56 0b sbc r21, r22 3b318: c9 0b sbc r28, r25 3b31a: d0 09 sbc r29, r0 3b31c: 98 f0 brcs .+38 ; 0x3b344 <__ftoa_engine+0x19a> 3b31e: 23 95 inc r18 3b320: 7e 91 ld r23, -X 3b322: 73 95 inc r23 3b324: 7a 33 cpi r23, 0x3A ; 58 3b326: 08 f0 brcs .+2 ; 0x3b32a <__ftoa_engine+0x180> 3b328: 70 e3 ldi r23, 0x30 ; 48 3b32a: 7c 93 st X, r23 3b32c: 20 13 cpse r18, r16 3b32e: b8 f7 brcc .-18 ; 0x3b31e <__ftoa_engine+0x174> 3b330: 7e 91 ld r23, -X 3b332: 70 61 ori r23, 0x10 ; 16 3b334: 7d 93 st X+, r23 3b336: 30 f0 brcs .+12 ; 0x3b344 <__ftoa_engine+0x19a> 3b338: 83 95 inc r24 3b33a: 71 e3 ldi r23, 0x31 ; 49 3b33c: 7d 93 st X+, r23 3b33e: 70 e3 ldi r23, 0x30 ; 48 3b340: 2a 95 dec r18 3b342: e1 f7 brne .-8 ; 0x3b33c <__ftoa_engine+0x192> 3b344: 11 24 eor r1, r1 3b346: ef 90 pop r14 3b348: ff 90 pop r15 3b34a: 0f 91 pop r16 3b34c: 1f 91 pop r17 3b34e: cf 91 pop r28 3b350: df 91 pop r29 3b352: 99 27 eor r25, r25 3b354: 87 fd sbrc r24, 7 3b356: 90 95 com r25 3b358: 08 95 ret 0003b35a : 3b35a: 91 11 cpse r25, r1 3b35c: 0d 94 09 dc jmp 0x3b812 ; 0x3b812 <__ctype_isfalse> 3b360: 80 32 cpi r24, 0x20 ; 32 3b362: 19 f0 breq .+6 ; 0x3b36a 3b364: 89 50 subi r24, 0x09 ; 9 3b366: 85 50 subi r24, 0x05 ; 5 3b368: c8 f7 brcc .-14 ; 0x3b35c 3b36a: 08 95 ret 0003b36c : 3b36c: fb 01 movw r30, r22 3b36e: dc 01 movw r26, r24 3b370: 02 c0 rjmp .+4 ; 0x3b376 3b372: 05 90 lpm r0, Z+ 3b374: 0d 92 st X+, r0 3b376: 41 50 subi r20, 0x01 ; 1 3b378: 50 40 sbci r21, 0x00 ; 0 3b37a: d8 f7 brcc .-10 ; 0x3b372 3b37c: 08 95 ret 0003b37e : 3b37e: fb 01 movw r30, r22 3b380: dc 01 movw r26, r24 3b382: 0d 90 ld r0, X+ 3b384: 00 20 and r0, r0 3b386: e9 f7 brne .-6 ; 0x3b382 3b388: 11 97 sbiw r26, 0x01 ; 1 3b38a: 05 90 lpm r0, Z+ 3b38c: 0d 92 st X+, r0 3b38e: 00 20 and r0, r0 3b390: e1 f7 brne .-8 ; 0x3b38a 3b392: 08 95 ret 0003b394 : 3b394: fb 01 movw r30, r22 3b396: dc 01 movw r26, r24 3b398: 8d 91 ld r24, X+ 3b39a: 05 90 lpm r0, Z+ 3b39c: 80 19 sub r24, r0 3b39e: 01 10 cpse r0, r1 3b3a0: d9 f3 breq .-10 ; 0x3b398 3b3a2: 99 0b sbc r25, r25 3b3a4: 08 95 ret 0003b3a6 : 3b3a6: fb 01 movw r30, r22 3b3a8: dc 01 movw r26, r24 3b3aa: 05 90 lpm r0, Z+ 3b3ac: 0d 92 st X+, r0 3b3ae: 00 20 and r0, r0 3b3b0: e1 f7 brne .-8 ; 0x3b3aa 3b3b2: 08 95 ret 0003b3b4 <__strlen_P>: 3b3b4: fc 01 movw r30, r24 3b3b6: 05 90 lpm r0, Z+ 3b3b8: 00 20 and r0, r0 3b3ba: e9 f7 brne .-6 ; 0x3b3b6 <__strlen_P+0x2> 3b3bc: 80 95 com r24 3b3be: 90 95 com r25 3b3c0: 8e 0f add r24, r30 3b3c2: 9f 1f adc r25, r31 3b3c4: 08 95 ret 0003b3c6 : 3b3c6: fb 01 movw r30, r22 3b3c8: dc 01 movw r26, r24 3b3ca: 41 50 subi r20, 0x01 ; 1 3b3cc: 50 40 sbci r21, 0x00 ; 0 3b3ce: 88 f0 brcs .+34 ; 0x3b3f2 3b3d0: 8d 91 ld r24, X+ 3b3d2: 81 34 cpi r24, 0x41 ; 65 3b3d4: 1c f0 brlt .+6 ; 0x3b3dc 3b3d6: 8b 35 cpi r24, 0x5B ; 91 3b3d8: 0c f4 brge .+2 ; 0x3b3dc 3b3da: 80 5e subi r24, 0xE0 ; 224 3b3dc: 65 91 lpm r22, Z+ 3b3de: 61 34 cpi r22, 0x41 ; 65 3b3e0: 1c f0 brlt .+6 ; 0x3b3e8 3b3e2: 6b 35 cpi r22, 0x5B ; 91 3b3e4: 0c f4 brge .+2 ; 0x3b3e8 3b3e6: 60 5e subi r22, 0xE0 ; 224 3b3e8: 86 1b sub r24, r22 3b3ea: 61 11 cpse r22, r1 3b3ec: 71 f3 breq .-36 ; 0x3b3ca 3b3ee: 99 0b sbc r25, r25 3b3f0: 08 95 ret 3b3f2: 88 1b sub r24, r24 3b3f4: fc cf rjmp .-8 ; 0x3b3ee 0003b3f6 : 3b3f6: fb 01 movw r30, r22 3b3f8: dc 01 movw r26, r24 3b3fa: 41 50 subi r20, 0x01 ; 1 3b3fc: 50 40 sbci r21, 0x00 ; 0 3b3fe: 30 f0 brcs .+12 ; 0x3b40c 3b400: 8d 91 ld r24, X+ 3b402: 05 90 lpm r0, Z+ 3b404: 80 19 sub r24, r0 3b406: 19 f4 brne .+6 ; 0x3b40e 3b408: 00 20 and r0, r0 3b40a: b9 f7 brne .-18 ; 0x3b3fa 3b40c: 88 1b sub r24, r24 3b40e: 99 0b sbc r25, r25 3b410: 08 95 ret 0003b412 : 3b412: fb 01 movw r30, r22 3b414: dc 01 movw r26, r24 3b416: 41 50 subi r20, 0x01 ; 1 3b418: 50 40 sbci r21, 0x00 ; 0 3b41a: 48 f0 brcs .+18 ; 0x3b42e 3b41c: 05 90 lpm r0, Z+ 3b41e: 0d 92 st X+, r0 3b420: 00 20 and r0, r0 3b422: c9 f7 brne .-14 ; 0x3b416 3b424: 01 c0 rjmp .+2 ; 0x3b428 3b426: 1d 92 st X+, r1 3b428: 41 50 subi r20, 0x01 ; 1 3b42a: 50 40 sbci r21, 0x00 ; 0 3b42c: e0 f7 brcc .-8 ; 0x3b426 3b42e: 08 95 ret 0003b430 : 3b430: fc 01 movw r30, r24 3b432: 05 90 lpm r0, Z+ 3b434: 61 50 subi r22, 0x01 ; 1 3b436: 70 40 sbci r23, 0x00 ; 0 3b438: 01 10 cpse r0, r1 3b43a: d8 f7 brcc .-10 ; 0x3b432 3b43c: 80 95 com r24 3b43e: 90 95 com r25 3b440: 8e 0f add r24, r30 3b442: 9f 1f adc r25, r31 3b444: 08 95 ret 0003b446 : 3b446: fb 01 movw r30, r22 3b448: 55 91 lpm r21, Z+ 3b44a: 55 23 and r21, r21 3b44c: a9 f0 breq .+42 ; 0x3b478 3b44e: bf 01 movw r22, r30 3b450: dc 01 movw r26, r24 3b452: 4d 91 ld r20, X+ 3b454: 45 17 cp r20, r21 3b456: 41 11 cpse r20, r1 3b458: e1 f7 brne .-8 ; 0x3b452 3b45a: 59 f4 brne .+22 ; 0x3b472 3b45c: cd 01 movw r24, r26 3b45e: 05 90 lpm r0, Z+ 3b460: 00 20 and r0, r0 3b462: 49 f0 breq .+18 ; 0x3b476 3b464: 4d 91 ld r20, X+ 3b466: 40 15 cp r20, r0 3b468: 41 11 cpse r20, r1 3b46a: c9 f3 breq .-14 ; 0x3b45e 3b46c: fb 01 movw r30, r22 3b46e: 41 11 cpse r20, r1 3b470: ef cf rjmp .-34 ; 0x3b450 3b472: 81 e0 ldi r24, 0x01 ; 1 3b474: 90 e0 ldi r25, 0x00 ; 0 3b476: 01 97 sbiw r24, 0x01 ; 1 3b478: 08 95 ret 0003b47a : 3b47a: fc 01 movw r30, r24 3b47c: 61 50 subi r22, 0x01 ; 1 3b47e: 70 40 sbci r23, 0x00 ; 0 3b480: 01 90 ld r0, Z+ 3b482: 01 10 cpse r0, r1 3b484: d8 f7 brcc .-10 ; 0x3b47c 3b486: 80 95 com r24 3b488: 90 95 com r25 3b48a: 8e 0f add r24, r30 3b48c: 9f 1f adc r25, r31 3b48e: 08 95 ret 0003b490 : 3b490: cf 93 push r28 3b492: df 93 push r29 3b494: ec 01 movw r28, r24 3b496: 2b 81 ldd r18, Y+3 ; 0x03 3b498: 20 ff sbrs r18, 0 3b49a: 1a c0 rjmp .+52 ; 0x3b4d0 3b49c: 26 ff sbrs r18, 6 3b49e: 0c c0 rjmp .+24 ; 0x3b4b8 3b4a0: 2f 7b andi r18, 0xBF ; 191 3b4a2: 2b 83 std Y+3, r18 ; 0x03 3b4a4: 8e 81 ldd r24, Y+6 ; 0x06 3b4a6: 9f 81 ldd r25, Y+7 ; 0x07 3b4a8: 01 96 adiw r24, 0x01 ; 1 3b4aa: 9f 83 std Y+7, r25 ; 0x07 3b4ac: 8e 83 std Y+6, r24 ; 0x06 3b4ae: 8a 81 ldd r24, Y+2 ; 0x02 3b4b0: 90 e0 ldi r25, 0x00 ; 0 3b4b2: df 91 pop r29 3b4b4: cf 91 pop r28 3b4b6: 08 95 ret 3b4b8: 22 ff sbrs r18, 2 3b4ba: 18 c0 rjmp .+48 ; 0x3b4ec 3b4bc: e8 81 ld r30, Y 3b4be: f9 81 ldd r31, Y+1 ; 0x01 3b4c0: 80 81 ld r24, Z 3b4c2: 08 2e mov r0, r24 3b4c4: 00 0c add r0, r0 3b4c6: 99 0b sbc r25, r25 3b4c8: 00 97 sbiw r24, 0x00 ; 0 3b4ca: 29 f4 brne .+10 ; 0x3b4d6 3b4cc: 20 62 ori r18, 0x20 ; 32 3b4ce: 2b 83 std Y+3, r18 ; 0x03 3b4d0: 8f ef ldi r24, 0xFF ; 255 3b4d2: 9f ef ldi r25, 0xFF ; 255 3b4d4: ee cf rjmp .-36 ; 0x3b4b2 3b4d6: 31 96 adiw r30, 0x01 ; 1 3b4d8: f9 83 std Y+1, r31 ; 0x01 3b4da: e8 83 st Y, r30 3b4dc: 2e 81 ldd r18, Y+6 ; 0x06 3b4de: 3f 81 ldd r19, Y+7 ; 0x07 3b4e0: 2f 5f subi r18, 0xFF ; 255 3b4e2: 3f 4f sbci r19, 0xFF ; 255 3b4e4: 3f 83 std Y+7, r19 ; 0x07 3b4e6: 2e 83 std Y+6, r18 ; 0x06 3b4e8: 99 27 eor r25, r25 3b4ea: e3 cf rjmp .-58 ; 0x3b4b2 3b4ec: ea 85 ldd r30, Y+10 ; 0x0a 3b4ee: fb 85 ldd r31, Y+11 ; 0x0b 3b4f0: 19 95 eicall 3b4f2: 97 ff sbrs r25, 7 3b4f4: f3 cf rjmp .-26 ; 0x3b4dc 3b4f6: 2b 81 ldd r18, Y+3 ; 0x03 3b4f8: 01 96 adiw r24, 0x01 ; 1 3b4fa: 21 f0 breq .+8 ; 0x3b504 3b4fc: 80 e2 ldi r24, 0x20 ; 32 3b4fe: 82 2b or r24, r18 3b500: 8b 83 std Y+3, r24 ; 0x03 3b502: e6 cf rjmp .-52 ; 0x3b4d0 3b504: 80 e1 ldi r24, 0x10 ; 16 3b506: fb cf rjmp .-10 ; 0x3b4fe 0003b508 : 3b508: 0f 93 push r16 3b50a: 1f 93 push r17 3b50c: cf 93 push r28 3b50e: df 93 push r29 3b510: 18 2f mov r17, r24 3b512: 09 2f mov r16, r25 3b514: eb 01 movw r28, r22 3b516: 8b 81 ldd r24, Y+3 ; 0x03 3b518: 81 fd sbrc r24, 1 3b51a: 09 c0 rjmp .+18 ; 0x3b52e 3b51c: 1f ef ldi r17, 0xFF ; 255 3b51e: 0f ef ldi r16, 0xFF ; 255 3b520: 81 2f mov r24, r17 3b522: 90 2f mov r25, r16 3b524: df 91 pop r29 3b526: cf 91 pop r28 3b528: 1f 91 pop r17 3b52a: 0f 91 pop r16 3b52c: 08 95 ret 3b52e: 82 ff sbrs r24, 2 3b530: 14 c0 rjmp .+40 ; 0x3b55a 3b532: 2e 81 ldd r18, Y+6 ; 0x06 3b534: 3f 81 ldd r19, Y+7 ; 0x07 3b536: 8c 81 ldd r24, Y+4 ; 0x04 3b538: 9d 81 ldd r25, Y+5 ; 0x05 3b53a: 28 17 cp r18, r24 3b53c: 39 07 cpc r19, r25 3b53e: 3c f4 brge .+14 ; 0x3b54e 3b540: e8 81 ld r30, Y 3b542: f9 81 ldd r31, Y+1 ; 0x01 3b544: cf 01 movw r24, r30 3b546: 01 96 adiw r24, 0x01 ; 1 3b548: 99 83 std Y+1, r25 ; 0x01 3b54a: 88 83 st Y, r24 3b54c: 10 83 st Z, r17 3b54e: 8e 81 ldd r24, Y+6 ; 0x06 3b550: 9f 81 ldd r25, Y+7 ; 0x07 3b552: 01 96 adiw r24, 0x01 ; 1 3b554: 9f 83 std Y+7, r25 ; 0x07 3b556: 8e 83 std Y+6, r24 ; 0x06 3b558: e3 cf rjmp .-58 ; 0x3b520 3b55a: e8 85 ldd r30, Y+8 ; 0x08 3b55c: f9 85 ldd r31, Y+9 ; 0x09 3b55e: 81 2f mov r24, r17 3b560: 19 95 eicall 3b562: 89 2b or r24, r25 3b564: a1 f3 breq .-24 ; 0x3b54e 3b566: da cf rjmp .-76 ; 0x3b51c 0003b568 : 3b568: ef 92 push r14 3b56a: ff 92 push r15 3b56c: 0f 93 push r16 3b56e: 1f 93 push r17 3b570: cf 93 push r28 3b572: df 93 push r29 3b574: 8c 01 movw r16, r24 3b576: 7b 01 movw r14, r22 3b578: db 01 movw r26, r22 3b57a: 13 96 adiw r26, 0x03 ; 3 3b57c: 8c 91 ld r24, X 3b57e: d0 e0 ldi r29, 0x00 ; 0 3b580: c0 e0 ldi r28, 0x00 ; 0 3b582: 81 fd sbrc r24, 1 3b584: 0f c0 rjmp .+30 ; 0x3b5a4 3b586: cf ef ldi r28, 0xFF ; 255 3b588: df ef ldi r29, 0xFF ; 255 3b58a: 10 c0 rjmp .+32 ; 0x3b5ac 3b58c: d7 01 movw r26, r14 3b58e: 18 96 adiw r26, 0x08 ; 8 3b590: ed 91 ld r30, X+ 3b592: fc 91 ld r31, X 3b594: b7 01 movw r22, r14 3b596: 19 95 eicall 3b598: 89 2b or r24, r25 3b59a: 11 f0 breq .+4 ; 0x3b5a0 3b59c: cf ef ldi r28, 0xFF ; 255 3b59e: df ef ldi r29, 0xFF ; 255 3b5a0: 0f 5f subi r16, 0xFF ; 255 3b5a2: 1f 4f sbci r17, 0xFF ; 255 3b5a4: f8 01 movw r30, r16 3b5a6: 84 91 lpm r24, Z 3b5a8: 81 11 cpse r24, r1 3b5aa: f0 cf rjmp .-32 ; 0x3b58c 3b5ac: ce 01 movw r24, r28 3b5ae: df 91 pop r29 3b5b0: cf 91 pop r28 3b5b2: 1f 91 pop r17 3b5b4: 0f 91 pop r16 3b5b6: ff 90 pop r15 3b5b8: ef 90 pop r14 3b5ba: 08 95 ret 0003b5bc : 3b5bc: 0f 93 push r16 3b5be: 1f 93 push r17 3b5c0: cf 93 push r28 3b5c2: df 93 push r29 3b5c4: cd b7 in r28, 0x3d ; 61 3b5c6: de b7 in r29, 0x3e ; 62 3b5c8: ae 01 movw r20, r28 3b5ca: 48 5f subi r20, 0xF8 ; 248 3b5cc: 5f 4f sbci r21, 0xFF ; 255 3b5ce: da 01 movw r26, r20 3b5d0: 6d 91 ld r22, X+ 3b5d2: 7d 91 ld r23, X+ 3b5d4: ad 01 movw r20, r26 3b5d6: 0a e1 ldi r16, 0x1A ; 26 3b5d8: 18 e1 ldi r17, 0x18 ; 24 3b5da: f8 01 movw r30, r16 3b5dc: 82 81 ldd r24, Z+2 ; 0x02 3b5de: 93 81 ldd r25, Z+3 ; 0x03 3b5e0: dc 01 movw r26, r24 3b5e2: 13 96 adiw r26, 0x03 ; 3 3b5e4: 2c 91 ld r18, X 3b5e6: 13 97 sbiw r26, 0x03 ; 3 3b5e8: 28 60 ori r18, 0x08 ; 8 3b5ea: 13 96 adiw r26, 0x03 ; 3 3b5ec: 2c 93 st X, r18 3b5ee: 0e 94 e9 56 call 0xadd2 ; 0xadd2 3b5f2: d8 01 movw r26, r16 3b5f4: 12 96 adiw r26, 0x02 ; 2 3b5f6: ed 91 ld r30, X+ 3b5f8: fc 91 ld r31, X 3b5fa: 23 81 ldd r18, Z+3 ; 0x03 3b5fc: 27 7f andi r18, 0xF7 ; 247 3b5fe: 23 83 std Z+3, r18 ; 0x03 3b600: df 91 pop r29 3b602: cf 91 pop r28 3b604: 1f 91 pop r17 3b606: 0f 91 pop r16 3b608: 08 95 ret 0003b60a : 3b60a: 0f 93 push r16 3b60c: 1f 93 push r17 3b60e: cf 93 push r28 3b610: df 93 push r29 3b612: 8c 01 movw r16, r24 3b614: e0 91 1c 18 lds r30, 0x181C ; 0x80181c <__iob+0x2> 3b618: f0 91 1d 18 lds r31, 0x181D ; 0x80181d <__iob+0x3> 3b61c: 83 81 ldd r24, Z+3 ; 0x03 3b61e: d0 e0 ldi r29, 0x00 ; 0 3b620: c0 e0 ldi r28, 0x00 ; 0 3b622: 81 fd sbrc r24, 1 3b624: 0a c0 rjmp .+20 ; 0x3b63a 3b626: cf ef ldi r28, 0xFF ; 255 3b628: df ef ldi r29, 0xFF ; 255 3b62a: 17 c0 rjmp .+46 ; 0x3b65a 3b62c: 19 95 eicall 3b62e: 89 2b or r24, r25 3b630: 11 f0 breq .+4 ; 0x3b636 3b632: cf ef ldi r28, 0xFF ; 255 3b634: df ef ldi r29, 0xFF ; 255 3b636: 0f 5f subi r16, 0xFF ; 255 3b638: 1f 4f sbci r17, 0xFF ; 255 3b63a: f8 01 movw r30, r16 3b63c: 84 91 lpm r24, Z 3b63e: 60 91 1c 18 lds r22, 0x181C ; 0x80181c <__iob+0x2> 3b642: 70 91 1d 18 lds r23, 0x181D ; 0x80181d <__iob+0x3> 3b646: db 01 movw r26, r22 3b648: 18 96 adiw r26, 0x08 ; 8 3b64a: ed 91 ld r30, X+ 3b64c: fc 91 ld r31, X 3b64e: 81 11 cpse r24, r1 3b650: ed cf rjmp .-38 ; 0x3b62c 3b652: 8a e0 ldi r24, 0x0A ; 10 3b654: 19 95 eicall 3b656: 89 2b or r24, r25 3b658: 31 f7 brne .-52 ; 0x3b626 3b65a: ce 01 movw r24, r28 3b65c: df 91 pop r29 3b65e: cf 91 pop r28 3b660: 1f 91 pop r17 3b662: 0f 91 pop r16 3b664: 08 95 ret 0003b666 : 3b666: 0f 93 push r16 3b668: 1f 93 push r17 3b66a: cf 93 push r28 3b66c: df 93 push r29 3b66e: cd b7 in r28, 0x3d ; 61 3b670: de b7 in r29, 0x3e ; 62 3b672: 2e 97 sbiw r28, 0x0e ; 14 3b674: 0f b6 in r0, 0x3f ; 63 3b676: f8 94 cli 3b678: de bf out 0x3e, r29 ; 62 3b67a: 0f be out 0x3f, r0 ; 63 3b67c: cd bf out 0x3d, r28 ; 61 3b67e: 0e 89 ldd r16, Y+22 ; 0x16 3b680: 1f 89 ldd r17, Y+23 ; 0x17 3b682: 8e e0 ldi r24, 0x0E ; 14 3b684: 8c 83 std Y+4, r24 ; 0x04 3b686: 1a 83 std Y+2, r17 ; 0x02 3b688: 09 83 std Y+1, r16 ; 0x01 3b68a: 8f ef ldi r24, 0xFF ; 255 3b68c: 9f e7 ldi r25, 0x7F ; 127 3b68e: 9e 83 std Y+6, r25 ; 0x06 3b690: 8d 83 std Y+5, r24 ; 0x05 3b692: ae 01 movw r20, r28 3b694: 46 5e subi r20, 0xE6 ; 230 3b696: 5f 4f sbci r21, 0xFF ; 255 3b698: 68 8d ldd r22, Y+24 ; 0x18 3b69a: 79 8d ldd r23, Y+25 ; 0x19 3b69c: ce 01 movw r24, r28 3b69e: 01 96 adiw r24, 0x01 ; 1 3b6a0: 0e 94 e9 56 call 0xadd2 ; 0xadd2 3b6a4: 2f 81 ldd r18, Y+7 ; 0x07 3b6a6: 38 85 ldd r19, Y+8 ; 0x08 3b6a8: 02 0f add r16, r18 3b6aa: 13 1f adc r17, r19 3b6ac: f8 01 movw r30, r16 3b6ae: 10 82 st Z, r1 3b6b0: 2e 96 adiw r28, 0x0e ; 14 3b6b2: 0f b6 in r0, 0x3f ; 63 3b6b4: f8 94 cli 3b6b6: de bf out 0x3e, r29 ; 62 3b6b8: 0f be out 0x3f, r0 ; 63 3b6ba: cd bf out 0x3d, r28 ; 61 3b6bc: df 91 pop r29 3b6be: cf 91 pop r28 3b6c0: 1f 91 pop r17 3b6c2: 0f 91 pop r16 3b6c4: 08 95 ret 0003b6c6 : 3b6c6: cf 93 push r28 3b6c8: df 93 push r29 3b6ca: ec 01 movw r28, r24 3b6cc: 8b 81 ldd r24, Y+3 ; 0x03 3b6ce: 88 60 ori r24, 0x08 ; 8 3b6d0: 8b 83 std Y+3, r24 ; 0x03 3b6d2: ce 01 movw r24, r28 3b6d4: 0e 94 e9 56 call 0xadd2 ; 0xadd2 3b6d8: 2b 81 ldd r18, Y+3 ; 0x03 3b6da: 27 7f andi r18, 0xF7 ; 247 3b6dc: 2b 83 std Y+3, r18 ; 0x03 3b6de: df 91 pop r29 3b6e0: cf 91 pop r28 3b6e2: 08 95 ret 0003b6e4 : 3b6e4: 0f 93 push r16 3b6e6: 1f 93 push r17 3b6e8: cf 93 push r28 3b6ea: df 93 push r29 3b6ec: cd b7 in r28, 0x3d ; 61 3b6ee: de b7 in r29, 0x3e ; 62 3b6f0: 2e 97 sbiw r28, 0x0e ; 14 3b6f2: 0f b6 in r0, 0x3f ; 63 3b6f4: f8 94 cli 3b6f6: de bf out 0x3e, r29 ; 62 3b6f8: 0f be out 0x3f, r0 ; 63 3b6fa: cd bf out 0x3d, r28 ; 61 3b6fc: 8c 01 movw r16, r24 3b6fe: fa 01 movw r30, r20 3b700: 8e e0 ldi r24, 0x0E ; 14 3b702: 8c 83 std Y+4, r24 ; 0x04 3b704: 1a 83 std Y+2, r17 ; 0x02 3b706: 09 83 std Y+1, r16 ; 0x01 3b708: 77 ff sbrs r23, 7 3b70a: 02 c0 rjmp .+4 ; 0x3b710 3b70c: 60 e0 ldi r22, 0x00 ; 0 3b70e: 70 e8 ldi r23, 0x80 ; 128 3b710: 61 50 subi r22, 0x01 ; 1 3b712: 71 09 sbc r23, r1 3b714: 7e 83 std Y+6, r23 ; 0x06 3b716: 6d 83 std Y+5, r22 ; 0x05 3b718: a9 01 movw r20, r18 3b71a: bf 01 movw r22, r30 3b71c: ce 01 movw r24, r28 3b71e: 01 96 adiw r24, 0x01 ; 1 3b720: 0e 94 e9 56 call 0xadd2 ; 0xadd2 3b724: 4d 81 ldd r20, Y+5 ; 0x05 3b726: 5e 81 ldd r21, Y+6 ; 0x06 3b728: 57 fd sbrc r21, 7 3b72a: 0a c0 rjmp .+20 ; 0x3b740 3b72c: 2f 81 ldd r18, Y+7 ; 0x07 3b72e: 38 85 ldd r19, Y+8 ; 0x08 3b730: 42 17 cp r20, r18 3b732: 53 07 cpc r21, r19 3b734: 0c f4 brge .+2 ; 0x3b738 3b736: 9a 01 movw r18, r20 3b738: 02 0f add r16, r18 3b73a: 13 1f adc r17, r19 3b73c: f8 01 movw r30, r16 3b73e: 10 82 st Z, r1 3b740: 2e 96 adiw r28, 0x0e ; 14 3b742: 0f b6 in r0, 0x3f ; 63 3b744: f8 94 cli 3b746: de bf out 0x3e, r29 ; 62 3b748: 0f be out 0x3f, r0 ; 63 3b74a: cd bf out 0x3d, r28 ; 61 3b74c: df 91 pop r29 3b74e: cf 91 pop r28 3b750: 1f 91 pop r17 3b752: 0f 91 pop r16 3b754: 08 95 ret 0003b756 <__ultoa_invert>: 3b756: fa 01 movw r30, r20 3b758: aa 27 eor r26, r26 3b75a: 28 30 cpi r18, 0x08 ; 8 3b75c: 51 f1 breq .+84 ; 0x3b7b2 <__ultoa_invert+0x5c> 3b75e: 20 31 cpi r18, 0x10 ; 16 3b760: 81 f1 breq .+96 ; 0x3b7c2 <__ultoa_invert+0x6c> 3b762: e8 94 clt 3b764: 6f 93 push r22 3b766: 6e 7f andi r22, 0xFE ; 254 3b768: 6e 5f subi r22, 0xFE ; 254 3b76a: 7f 4f sbci r23, 0xFF ; 255 3b76c: 8f 4f sbci r24, 0xFF ; 255 3b76e: 9f 4f sbci r25, 0xFF ; 255 3b770: af 4f sbci r26, 0xFF ; 255 3b772: b1 e0 ldi r27, 0x01 ; 1 3b774: 3e d0 rcall .+124 ; 0x3b7f2 <__ultoa_invert+0x9c> 3b776: b4 e0 ldi r27, 0x04 ; 4 3b778: 3c d0 rcall .+120 ; 0x3b7f2 <__ultoa_invert+0x9c> 3b77a: 67 0f add r22, r23 3b77c: 78 1f adc r23, r24 3b77e: 89 1f adc r24, r25 3b780: 9a 1f adc r25, r26 3b782: a1 1d adc r26, r1 3b784: 68 0f add r22, r24 3b786: 79 1f adc r23, r25 3b788: 8a 1f adc r24, r26 3b78a: 91 1d adc r25, r1 3b78c: a1 1d adc r26, r1 3b78e: 6a 0f add r22, r26 3b790: 71 1d adc r23, r1 3b792: 81 1d adc r24, r1 3b794: 91 1d adc r25, r1 3b796: a1 1d adc r26, r1 3b798: 20 d0 rcall .+64 ; 0x3b7da <__ultoa_invert+0x84> 3b79a: 09 f4 brne .+2 ; 0x3b79e <__ultoa_invert+0x48> 3b79c: 68 94 set 3b79e: 3f 91 pop r19 3b7a0: 2a e0 ldi r18, 0x0A ; 10 3b7a2: 26 9f mul r18, r22 3b7a4: 11 24 eor r1, r1 3b7a6: 30 19 sub r19, r0 3b7a8: 30 5d subi r19, 0xD0 ; 208 3b7aa: 31 93 st Z+, r19 3b7ac: de f6 brtc .-74 ; 0x3b764 <__ultoa_invert+0xe> 3b7ae: cf 01 movw r24, r30 3b7b0: 08 95 ret 3b7b2: 46 2f mov r20, r22 3b7b4: 47 70 andi r20, 0x07 ; 7 3b7b6: 40 5d subi r20, 0xD0 ; 208 3b7b8: 41 93 st Z+, r20 3b7ba: b3 e0 ldi r27, 0x03 ; 3 3b7bc: 0f d0 rcall .+30 ; 0x3b7dc <__ultoa_invert+0x86> 3b7be: c9 f7 brne .-14 ; 0x3b7b2 <__ultoa_invert+0x5c> 3b7c0: f6 cf rjmp .-20 ; 0x3b7ae <__ultoa_invert+0x58> 3b7c2: 46 2f mov r20, r22 3b7c4: 4f 70 andi r20, 0x0F ; 15 3b7c6: 40 5d subi r20, 0xD0 ; 208 3b7c8: 4a 33 cpi r20, 0x3A ; 58 3b7ca: 18 f0 brcs .+6 ; 0x3b7d2 <__ultoa_invert+0x7c> 3b7cc: 49 5d subi r20, 0xD9 ; 217 3b7ce: 31 fd sbrc r19, 1 3b7d0: 40 52 subi r20, 0x20 ; 32 3b7d2: 41 93 st Z+, r20 3b7d4: 02 d0 rcall .+4 ; 0x3b7da <__ultoa_invert+0x84> 3b7d6: a9 f7 brne .-22 ; 0x3b7c2 <__ultoa_invert+0x6c> 3b7d8: ea cf rjmp .-44 ; 0x3b7ae <__ultoa_invert+0x58> 3b7da: b4 e0 ldi r27, 0x04 ; 4 3b7dc: a6 95 lsr r26 3b7de: 97 95 ror r25 3b7e0: 87 95 ror r24 3b7e2: 77 95 ror r23 3b7e4: 67 95 ror r22 3b7e6: ba 95 dec r27 3b7e8: c9 f7 brne .-14 ; 0x3b7dc <__ultoa_invert+0x86> 3b7ea: 00 97 sbiw r24, 0x00 ; 0 3b7ec: 61 05 cpc r22, r1 3b7ee: 71 05 cpc r23, r1 3b7f0: 08 95 ret 3b7f2: 9b 01 movw r18, r22 3b7f4: ac 01 movw r20, r24 3b7f6: 0a 2e mov r0, r26 3b7f8: 06 94 lsr r0 3b7fa: 57 95 ror r21 3b7fc: 47 95 ror r20 3b7fe: 37 95 ror r19 3b800: 27 95 ror r18 3b802: ba 95 dec r27 3b804: c9 f7 brne .-14 ; 0x3b7f8 <__ultoa_invert+0xa2> 3b806: 62 0f add r22, r18 3b808: 73 1f adc r23, r19 3b80a: 84 1f adc r24, r20 3b80c: 95 1f adc r25, r21 3b80e: a0 1d adc r26, r0 3b810: 08 95 ret 0003b812 <__ctype_isfalse>: 3b812: 99 27 eor r25, r25 3b814: 88 27 eor r24, r24 0003b816 <__ctype_istrue>: 3b816: 08 95 ret 0003b818 : 3b818: dc 01 movw r26, r24 3b81a: cb 01 movw r24, r22 0003b81c : 3b81c: fc 01 movw r30, r24 3b81e: f9 99 sbic 0x1f, 1 ; 31 3b820: fe cf rjmp .-4 ; 0x3b81e 3b822: 06 c0 rjmp .+12 ; 0x3b830 3b824: f2 bd out 0x22, r31 ; 34 3b826: e1 bd out 0x21, r30 ; 33 3b828: f8 9a sbi 0x1f, 0 ; 31 3b82a: 31 96 adiw r30, 0x01 ; 1 3b82c: 00 b4 in r0, 0x20 ; 32 3b82e: 0d 92 st X+, r0 3b830: 41 50 subi r20, 0x01 ; 1 3b832: 50 40 sbci r21, 0x00 ; 0 3b834: b8 f7 brcc .-18 ; 0x3b824 3b836: 08 95 ret 0003b838 : 3b838: f9 99 sbic 0x1f, 1 ; 31 3b83a: fe cf rjmp .-4 ; 0x3b838 3b83c: 92 bd out 0x22, r25 ; 34 3b83e: 81 bd out 0x21, r24 ; 33 3b840: f8 9a sbi 0x1f, 0 ; 31 3b842: 99 27 eor r25, r25 3b844: 80 b5 in r24, 0x20 ; 32 3b846: 08 95 ret 0003b848 : 3b848: a6 e1 ldi r26, 0x16 ; 22 3b84a: b0 e0 ldi r27, 0x00 ; 0 3b84c: 44 e0 ldi r20, 0x04 ; 4 3b84e: 50 e0 ldi r21, 0x00 ; 0 3b850: 0d 94 0e dc jmp 0x3b81c ; 0x3b81c 0003b854 : 3b854: a8 e1 ldi r26, 0x18 ; 24 3b856: b0 e0 ldi r27, 0x00 ; 0 3b858: 42 e0 ldi r20, 0x02 ; 2 3b85a: 50 e0 ldi r21, 0x00 ; 0 3b85c: 0d 94 0e dc jmp 0x3b81c ; 0x3b81c 0003b860 : 3b860: dc 01 movw r26, r24 3b862: a4 0f add r26, r20 3b864: b5 1f adc r27, r21 3b866: 41 50 subi r20, 0x01 ; 1 3b868: 50 40 sbci r21, 0x00 ; 0 3b86a: 48 f0 brcs .+18 ; 0x3b87e 3b86c: cb 01 movw r24, r22 3b86e: 84 0f add r24, r20 3b870: 95 1f adc r25, r21 3b872: 2e 91 ld r18, -X 3b874: 0f 94 41 dc call 0x3b882 ; 0x3b882 3b878: 41 50 subi r20, 0x01 ; 1 3b87a: 50 40 sbci r21, 0x00 ; 0 3b87c: d0 f7 brcc .-12 ; 0x3b872 3b87e: 08 95 ret 0003b880 : 3b880: 26 2f mov r18, r22 0003b882 : 3b882: f9 99 sbic 0x1f, 1 ; 31 3b884: fe cf rjmp .-4 ; 0x3b882 3b886: 92 bd out 0x22, r25 ; 34 3b888: 81 bd out 0x21, r24 ; 33 3b88a: f8 9a sbi 0x1f, 0 ; 31 3b88c: 01 97 sbiw r24, 0x01 ; 1 3b88e: 00 b4 in r0, 0x20 ; 32 3b890: 02 16 cp r0, r18 3b892: 39 f0 breq .+14 ; 0x3b8a2 3b894: 1f ba out 0x1f, r1 ; 31 3b896: 20 bd out 0x20, r18 ; 32 3b898: 0f b6 in r0, 0x3f ; 63 3b89a: f8 94 cli 3b89c: fa 9a sbi 0x1f, 2 ; 31 3b89e: f9 9a sbi 0x1f, 1 ; 31 3b8a0: 0f be out 0x3f, r0 ; 63 3b8a2: 08 95 ret 0003b8a4 : 3b8a4: 03 96 adiw r24, 0x03 ; 3 3b8a6: 27 2f mov r18, r23 3b8a8: 0f 94 41 dc call 0x3b882 ; 0x3b882 3b8ac: 0f 94 40 dc call 0x3b880 ; 0x3b880 3b8b0: 25 2f mov r18, r21 3b8b2: 0f 94 41 dc call 0x3b882 ; 0x3b882 3b8b6: 24 2f mov r18, r20 3b8b8: 0d 94 41 dc jmp 0x3b882 ; 0x3b882 0003b8bc : 3b8bc: 01 96 adiw r24, 0x01 ; 1 3b8be: 27 2f mov r18, r23 3b8c0: 0f 94 41 dc call 0x3b882 ; 0x3b882 3b8c4: 0d 94 40 dc jmp 0x3b880 ; 0x3b880 0003b8c8 : 3b8c8: 26 2f mov r18, r22 0003b8ca : 3b8ca: f9 99 sbic 0x1f, 1 ; 31 3b8cc: fe cf rjmp .-4 ; 0x3b8ca 3b8ce: 1f ba out 0x1f, r1 ; 31 3b8d0: 92 bd out 0x22, r25 ; 34 3b8d2: 81 bd out 0x21, r24 ; 33 3b8d4: 20 bd out 0x20, r18 ; 32 3b8d6: 0f b6 in r0, 0x3f ; 63 3b8d8: f8 94 cli 3b8da: fa 9a sbi 0x1f, 2 ; 31 3b8dc: f9 9a sbi 0x1f, 1 ; 31 3b8de: 0f be out 0x3f, r0 ; 63 3b8e0: 01 96 adiw r24, 0x01 ; 1 3b8e2: 08 95 ret 0003b8e4 : 3b8e4: 24 2f mov r18, r20 3b8e6: 0f 94 65 dc call 0x3b8ca ; 0x3b8ca 3b8ea: 25 2f mov r18, r21 3b8ec: 0f 94 65 dc call 0x3b8ca ; 0x3b8ca 3b8f0: 0d 94 7a dc jmp 0x3b8f4 ; 0x3b8f4 0003b8f4 : 3b8f4: 0f 94 64 dc call 0x3b8c8 ; 0x3b8c8 3b8f8: 27 2f mov r18, r23 3b8fa: 0d 94 65 dc jmp 0x3b8ca ; 0x3b8ca 0003b8fe <__mulsi3>: 3b8fe: db 01 movw r26, r22 3b900: 8f 93 push r24 3b902: 9f 93 push r25 3b904: 0f 94 b1 dc call 0x3b962 ; 0x3b962 <__muluhisi3> 3b908: bf 91 pop r27 3b90a: af 91 pop r26 3b90c: a2 9f mul r26, r18 3b90e: 80 0d add r24, r0 3b910: 91 1d adc r25, r1 3b912: a3 9f mul r26, r19 3b914: 90 0d add r25, r0 3b916: b2 9f mul r27, r18 3b918: 90 0d add r25, r0 3b91a: 11 24 eor r1, r1 3b91c: 08 95 ret 0003b91e <__udivmodsi4>: 3b91e: a1 e2 ldi r26, 0x21 ; 33 3b920: 1a 2e mov r1, r26 3b922: aa 1b sub r26, r26 3b924: bb 1b sub r27, r27 3b926: fd 01 movw r30, r26 3b928: 0d c0 rjmp .+26 ; 0x3b944 <__udivmodsi4_ep> 0003b92a <__udivmodsi4_loop>: 3b92a: aa 1f adc r26, r26 3b92c: bb 1f adc r27, r27 3b92e: ee 1f adc r30, r30 3b930: ff 1f adc r31, r31 3b932: a2 17 cp r26, r18 3b934: b3 07 cpc r27, r19 3b936: e4 07 cpc r30, r20 3b938: f5 07 cpc r31, r21 3b93a: 20 f0 brcs .+8 ; 0x3b944 <__udivmodsi4_ep> 3b93c: a2 1b sub r26, r18 3b93e: b3 0b sbc r27, r19 3b940: e4 0b sbc r30, r20 3b942: f5 0b sbc r31, r21 0003b944 <__udivmodsi4_ep>: 3b944: 66 1f adc r22, r22 3b946: 77 1f adc r23, r23 3b948: 88 1f adc r24, r24 3b94a: 99 1f adc r25, r25 3b94c: 1a 94 dec r1 3b94e: 69 f7 brne .-38 ; 0x3b92a <__udivmodsi4_loop> 3b950: 60 95 com r22 3b952: 70 95 com r23 3b954: 80 95 com r24 3b956: 90 95 com r25 3b958: 9b 01 movw r18, r22 3b95a: ac 01 movw r20, r24 3b95c: bd 01 movw r22, r26 3b95e: cf 01 movw r24, r30 3b960: 08 95 ret 0003b962 <__muluhisi3>: 3b962: 0f 94 bc dc call 0x3b978 ; 0x3b978 <__umulhisi3> 3b966: a5 9f mul r26, r21 3b968: 90 0d add r25, r0 3b96a: b4 9f mul r27, r20 3b96c: 90 0d add r25, r0 3b96e: a4 9f mul r26, r20 3b970: 80 0d add r24, r0 3b972: 91 1d adc r25, r1 3b974: 11 24 eor r1, r1 3b976: 08 95 ret 0003b978 <__umulhisi3>: 3b978: a2 9f mul r26, r18 3b97a: b0 01 movw r22, r0 3b97c: b3 9f mul r27, r19 3b97e: c0 01 movw r24, r0 3b980: a3 9f mul r26, r19 3b982: 70 0d add r23, r0 3b984: 81 1d adc r24, r1 3b986: 11 24 eor r1, r1 3b988: 91 1d adc r25, r1 3b98a: b2 9f mul r27, r18 3b98c: 70 0d add r23, r0 3b98e: 81 1d adc r24, r1 3b990: 11 24 eor r1, r1 3b992: 91 1d adc r25, r1 3b994: 08 95 ret 0003b996 <__udivmodqi4>: 3b996: 99 1b sub r25, r25 3b998: 79 e0 ldi r23, 0x09 ; 9 3b99a: 04 c0 rjmp .+8 ; 0x3b9a4 <__udivmodqi4_ep> 0003b99c <__udivmodqi4_loop>: 3b99c: 99 1f adc r25, r25 3b99e: 96 17 cp r25, r22 3b9a0: 08 f0 brcs .+2 ; 0x3b9a4 <__udivmodqi4_ep> 3b9a2: 96 1b sub r25, r22 0003b9a4 <__udivmodqi4_ep>: 3b9a4: 88 1f adc r24, r24 3b9a6: 7a 95 dec r23 3b9a8: c9 f7 brne .-14 ; 0x3b99c <__udivmodqi4_loop> 3b9aa: 80 95 com r24 3b9ac: 08 95 ret 0003b9ae <__divmodqi4>: 3b9ae: 87 fb bst r24, 7 3b9b0: 08 2e mov r0, r24 3b9b2: 06 26 eor r0, r22 3b9b4: 87 fd sbrc r24, 7 3b9b6: 81 95 neg r24 3b9b8: 67 fd sbrc r22, 7 3b9ba: 61 95 neg r22 3b9bc: 0f 94 cb dc call 0x3b996 ; 0x3b996 <__udivmodqi4> 3b9c0: 0e f4 brtc .+2 ; 0x3b9c4 <__divmodqi4_1> 3b9c2: 91 95 neg r25 0003b9c4 <__divmodqi4_1>: 3b9c4: 07 fc sbrc r0, 7 3b9c6: 81 95 neg r24 0003b9c8 <__divmodqi4_exit>: 3b9c8: 08 95 ret 0003b9ca <__udivmodhi4>: 3b9ca: aa 1b sub r26, r26 3b9cc: bb 1b sub r27, r27 3b9ce: 51 e1 ldi r21, 0x11 ; 17 3b9d0: 07 c0 rjmp .+14 ; 0x3b9e0 <__udivmodhi4_ep> 0003b9d2 <__udivmodhi4_loop>: 3b9d2: aa 1f adc r26, r26 3b9d4: bb 1f adc r27, r27 3b9d6: a6 17 cp r26, r22 3b9d8: b7 07 cpc r27, r23 3b9da: 10 f0 brcs .+4 ; 0x3b9e0 <__udivmodhi4_ep> 3b9dc: a6 1b sub r26, r22 3b9de: b7 0b sbc r27, r23 0003b9e0 <__udivmodhi4_ep>: 3b9e0: 88 1f adc r24, r24 3b9e2: 99 1f adc r25, r25 3b9e4: 5a 95 dec r21 3b9e6: a9 f7 brne .-22 ; 0x3b9d2 <__udivmodhi4_loop> 3b9e8: 80 95 com r24 3b9ea: 90 95 com r25 3b9ec: bc 01 movw r22, r24 3b9ee: cd 01 movw r24, r26 3b9f0: 08 95 ret 0003b9f2 <__divmodhi4>: 3b9f2: 97 fb bst r25, 7 3b9f4: 07 2e mov r0, r23 3b9f6: 16 f4 brtc .+4 ; 0x3b9fc <__divmodhi4+0xa> 3b9f8: 00 94 com r0 3b9fa: 07 d0 rcall .+14 ; 0x3ba0a <__divmodhi4_neg1> 3b9fc: 77 fd sbrc r23, 7 3b9fe: 09 d0 rcall .+18 ; 0x3ba12 <__divmodhi4_neg2> 3ba00: 0f 94 e5 dc call 0x3b9ca ; 0x3b9ca <__udivmodhi4> 3ba04: 07 fc sbrc r0, 7 3ba06: 05 d0 rcall .+10 ; 0x3ba12 <__divmodhi4_neg2> 3ba08: 3e f4 brtc .+14 ; 0x3ba18 <__divmodhi4_exit> 0003ba0a <__divmodhi4_neg1>: 3ba0a: 90 95 com r25 3ba0c: 81 95 neg r24 3ba0e: 9f 4f sbci r25, 0xFF ; 255 3ba10: 08 95 ret 0003ba12 <__divmodhi4_neg2>: 3ba12: 70 95 com r23 3ba14: 61 95 neg r22 3ba16: 7f 4f sbci r23, 0xFF ; 255 0003ba18 <__divmodhi4_exit>: 3ba18: 08 95 ret 0003ba1a <__divmodsi4>: 3ba1a: 05 2e mov r0, r21 3ba1c: 97 fb bst r25, 7 3ba1e: 1e f4 brtc .+6 ; 0x3ba26 <__divmodsi4+0xc> 3ba20: 00 94 com r0 3ba22: 0f 94 24 dd call 0x3ba48 ; 0x3ba48 <__negsi2> 3ba26: 57 fd sbrc r21, 7 3ba28: 07 d0 rcall .+14 ; 0x3ba38 <__divmodsi4_neg2> 3ba2a: 0f 94 8f dc call 0x3b91e ; 0x3b91e <__udivmodsi4> 3ba2e: 07 fc sbrc r0, 7 3ba30: 03 d0 rcall .+6 ; 0x3ba38 <__divmodsi4_neg2> 3ba32: 4e f4 brtc .+18 ; 0x3ba46 <__divmodsi4_exit> 3ba34: 0d 94 24 dd jmp 0x3ba48 ; 0x3ba48 <__negsi2> 0003ba38 <__divmodsi4_neg2>: 3ba38: 50 95 com r21 3ba3a: 40 95 com r20 3ba3c: 30 95 com r19 3ba3e: 21 95 neg r18 3ba40: 3f 4f sbci r19, 0xFF ; 255 3ba42: 4f 4f sbci r20, 0xFF ; 255 3ba44: 5f 4f sbci r21, 0xFF ; 255 0003ba46 <__divmodsi4_exit>: 3ba46: 08 95 ret 0003ba48 <__negsi2>: 3ba48: 90 95 com r25 3ba4a: 80 95 com r24 3ba4c: 70 95 com r23 3ba4e: 61 95 neg r22 3ba50: 7f 4f sbci r23, 0xFF ; 255 3ba52: 8f 4f sbci r24, 0xFF ; 255 3ba54: 9f 4f sbci r25, 0xFF ; 255 3ba56: 08 95 ret 0003ba58 <__tablejump2__>: 3ba58: ee 0f add r30, r30 3ba5a: ff 1f adc r31, r31 3ba5c: 88 1f adc r24, r24 3ba5e: 8b bf out 0x3b, r24 ; 59 3ba60: 07 90 elpm r0, Z+ 3ba62: f6 91 elpm r31, Z 3ba64: e0 2d mov r30, r0 3ba66: 19 94 eijmp 0003ba68 <__mulhisi3>: 3ba68: 0f 94 bc dc call 0x3b978 ; 0x3b978 <__umulhisi3> 3ba6c: 33 23 and r19, r19 3ba6e: 12 f4 brpl .+4 ; 0x3ba74 <__mulhisi3+0xc> 3ba70: 8a 1b sub r24, r26 3ba72: 9b 0b sbc r25, r27 3ba74: 0d 94 3e dd jmp 0x3ba7c ; 0x3ba7c <__usmulhisi3_tail> 0003ba78 <__usmulhisi3>: 3ba78: 0f 94 bc dc call 0x3b978 ; 0x3b978 <__umulhisi3> 0003ba7c <__usmulhisi3_tail>: 3ba7c: b7 ff sbrs r27, 7 3ba7e: 08 95 ret 3ba80: 82 1b sub r24, r18 3ba82: 93 0b sbc r25, r19 3ba84: 08 95 ret 0003ba86 <__subsf3>: 3ba86: 50 58 subi r21, 0x80 ; 128 0003ba88 <__addsf3>: 3ba88: bb 27 eor r27, r27 3ba8a: aa 27 eor r26, r26 3ba8c: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 <__addsf3x> 3ba90: 0d 94 6d d7 jmp 0x3aeda ; 0x3aeda <__fp_round> 3ba94: 0f 94 5f d7 call 0x3aebe ; 0x3aebe <__fp_pscA> 3ba98: 38 f0 brcs .+14 ; 0x3baa8 <__addsf3+0x20> 3ba9a: 0f 94 66 d7 call 0x3aecc ; 0x3aecc <__fp_pscB> 3ba9e: 20 f0 brcs .+8 ; 0x3baa8 <__addsf3+0x20> 3baa0: 39 f4 brne .+14 ; 0x3bab0 <__addsf3+0x28> 3baa2: 9f 3f cpi r25, 0xFF ; 255 3baa4: 19 f4 brne .+6 ; 0x3baac <__addsf3+0x24> 3baa6: 26 f4 brtc .+8 ; 0x3bab0 <__addsf3+0x28> 3baa8: 0d 94 5c d7 jmp 0x3aeb8 ; 0x3aeb8 <__fp_nan> 3baac: 0e f4 brtc .+2 ; 0x3bab0 <__addsf3+0x28> 3baae: e0 95 com r30 3bab0: e7 fb bst r30, 7 3bab2: 0d 94 56 d7 jmp 0x3aeac ; 0x3aeac <__fp_inf> 0003bab6 <__addsf3x>: 3bab6: e9 2f mov r30, r25 3bab8: 0f 94 7e d7 call 0x3aefc ; 0x3aefc <__fp_split3> 3babc: 58 f3 brcs .-42 ; 0x3ba94 <__addsf3+0xc> 3babe: ba 17 cp r27, r26 3bac0: 62 07 cpc r22, r18 3bac2: 73 07 cpc r23, r19 3bac4: 84 07 cpc r24, r20 3bac6: 95 07 cpc r25, r21 3bac8: 20 f0 brcs .+8 ; 0x3bad2 <__addsf3x+0x1c> 3baca: 79 f4 brne .+30 ; 0x3baea <__addsf3x+0x34> 3bacc: a6 f5 brtc .+104 ; 0x3bb36 <__addsf3x+0x80> 3bace: 0d 94 a0 d7 jmp 0x3af40 ; 0x3af40 <__fp_zero> 3bad2: 0e f4 brtc .+2 ; 0x3bad6 <__addsf3x+0x20> 3bad4: e0 95 com r30 3bad6: 0b 2e mov r0, r27 3bad8: ba 2f mov r27, r26 3bada: a0 2d mov r26, r0 3badc: 0b 01 movw r0, r22 3bade: b9 01 movw r22, r18 3bae0: 90 01 movw r18, r0 3bae2: 0c 01 movw r0, r24 3bae4: ca 01 movw r24, r20 3bae6: a0 01 movw r20, r0 3bae8: 11 24 eor r1, r1 3baea: ff 27 eor r31, r31 3baec: 59 1b sub r21, r25 3baee: 99 f0 breq .+38 ; 0x3bb16 <__addsf3x+0x60> 3baf0: 59 3f cpi r21, 0xF9 ; 249 3baf2: 50 f4 brcc .+20 ; 0x3bb08 <__addsf3x+0x52> 3baf4: 50 3e cpi r21, 0xE0 ; 224 3baf6: 68 f1 brcs .+90 ; 0x3bb52 <__addsf3x+0x9c> 3baf8: 1a 16 cp r1, r26 3bafa: f0 40 sbci r31, 0x00 ; 0 3bafc: a2 2f mov r26, r18 3bafe: 23 2f mov r18, r19 3bb00: 34 2f mov r19, r20 3bb02: 44 27 eor r20, r20 3bb04: 58 5f subi r21, 0xF8 ; 248 3bb06: f3 cf rjmp .-26 ; 0x3baee <__addsf3x+0x38> 3bb08: 46 95 lsr r20 3bb0a: 37 95 ror r19 3bb0c: 27 95 ror r18 3bb0e: a7 95 ror r26 3bb10: f0 40 sbci r31, 0x00 ; 0 3bb12: 53 95 inc r21 3bb14: c9 f7 brne .-14 ; 0x3bb08 <__addsf3x+0x52> 3bb16: 7e f4 brtc .+30 ; 0x3bb36 <__addsf3x+0x80> 3bb18: 1f 16 cp r1, r31 3bb1a: ba 0b sbc r27, r26 3bb1c: 62 0b sbc r22, r18 3bb1e: 73 0b sbc r23, r19 3bb20: 84 0b sbc r24, r20 3bb22: ba f0 brmi .+46 ; 0x3bb52 <__addsf3x+0x9c> 3bb24: 91 50 subi r25, 0x01 ; 1 3bb26: a1 f0 breq .+40 ; 0x3bb50 <__addsf3x+0x9a> 3bb28: ff 0f add r31, r31 3bb2a: bb 1f adc r27, r27 3bb2c: 66 1f adc r22, r22 3bb2e: 77 1f adc r23, r23 3bb30: 88 1f adc r24, r24 3bb32: c2 f7 brpl .-16 ; 0x3bb24 <__addsf3x+0x6e> 3bb34: 0e c0 rjmp .+28 ; 0x3bb52 <__addsf3x+0x9c> 3bb36: ba 0f add r27, r26 3bb38: 62 1f adc r22, r18 3bb3a: 73 1f adc r23, r19 3bb3c: 84 1f adc r24, r20 3bb3e: 48 f4 brcc .+18 ; 0x3bb52 <__addsf3x+0x9c> 3bb40: 87 95 ror r24 3bb42: 77 95 ror r23 3bb44: 67 95 ror r22 3bb46: b7 95 ror r27 3bb48: f7 95 ror r31 3bb4a: 9e 3f cpi r25, 0xFE ; 254 3bb4c: 08 f0 brcs .+2 ; 0x3bb50 <__addsf3x+0x9a> 3bb4e: b0 cf rjmp .-160 ; 0x3bab0 <__addsf3+0x28> 3bb50: 93 95 inc r25 3bb52: 88 0f add r24, r24 3bb54: 08 f0 brcs .+2 ; 0x3bb58 <__addsf3x+0xa2> 3bb56: 99 27 eor r25, r25 3bb58: ee 0f add r30, r30 3bb5a: 97 95 ror r25 3bb5c: 87 95 ror r24 3bb5e: 08 95 ret 3bb60: 0f 94 5f d7 call 0x3aebe ; 0x3aebe <__fp_pscA> 3bb64: 60 f0 brcs .+24 ; 0x3bb7e <__addsf3x+0xc8> 3bb66: 80 e8 ldi r24, 0x80 ; 128 3bb68: 91 e0 ldi r25, 0x01 ; 1 3bb6a: 09 f4 brne .+2 ; 0x3bb6e <__addsf3x+0xb8> 3bb6c: 9e ef ldi r25, 0xFE ; 254 3bb6e: 0f 94 66 d7 call 0x3aecc ; 0x3aecc <__fp_pscB> 3bb72: 28 f0 brcs .+10 ; 0x3bb7e <__addsf3x+0xc8> 3bb74: 40 e8 ldi r20, 0x80 ; 128 3bb76: 51 e0 ldi r21, 0x01 ; 1 3bb78: 71 f4 brne .+28 ; 0x3bb96 3bb7a: 5e ef ldi r21, 0xFE ; 254 3bb7c: 0c c0 rjmp .+24 ; 0x3bb96 3bb7e: 0d 94 5c d7 jmp 0x3aeb8 ; 0x3aeb8 <__fp_nan> 3bb82: 0d 94 a0 d7 jmp 0x3af40 ; 0x3af40 <__fp_zero> 0003bb86 : 3bb86: e9 2f mov r30, r25 3bb88: e0 78 andi r30, 0x80 ; 128 3bb8a: 0f 94 7e d7 call 0x3aefc ; 0x3aefc <__fp_split3> 3bb8e: 40 f3 brcs .-48 ; 0x3bb60 <__addsf3x+0xaa> 3bb90: 09 2e mov r0, r25 3bb92: 05 2a or r0, r21 3bb94: b1 f3 breq .-20 ; 0x3bb82 <__addsf3x+0xcc> 3bb96: 26 17 cp r18, r22 3bb98: 37 07 cpc r19, r23 3bb9a: 48 07 cpc r20, r24 3bb9c: 59 07 cpc r21, r25 3bb9e: 38 f0 brcs .+14 ; 0x3bbae 3bba0: 0e 2e mov r0, r30 3bba2: 07 f8 bld r0, 7 3bba4: e0 25 eor r30, r0 3bba6: 69 f0 breq .+26 ; 0x3bbc2 3bba8: e0 25 eor r30, r0 3bbaa: e0 64 ori r30, 0x40 ; 64 3bbac: 0a c0 rjmp .+20 ; 0x3bbc2 3bbae: ef 63 ori r30, 0x3F ; 63 3bbb0: 07 f8 bld r0, 7 3bbb2: 00 94 com r0 3bbb4: 07 fa bst r0, 7 3bbb6: db 01 movw r26, r22 3bbb8: b9 01 movw r22, r18 3bbba: 9d 01 movw r18, r26 3bbbc: dc 01 movw r26, r24 3bbbe: ca 01 movw r24, r20 3bbc0: ad 01 movw r20, r26 3bbc2: ef 93 push r30 3bbc4: 0f 94 5a de call 0x3bcb4 ; 0x3bcb4 <__divsf3_pse> 3bbc8: 0f 94 6d d7 call 0x3aeda ; 0x3aeda <__fp_round> 3bbcc: 0f 94 f3 dd call 0x3bbe6 ; 0x3bbe6 3bbd0: 5f 91 pop r21 3bbd2: 55 23 and r21, r21 3bbd4: 39 f0 breq .+14 ; 0x3bbe4 3bbd6: 2b ed ldi r18, 0xDB ; 219 3bbd8: 3f e0 ldi r19, 0x0F ; 15 3bbda: 49 e4 ldi r20, 0x49 ; 73 3bbdc: 50 fd sbrc r21, 0 3bbde: 49 ec ldi r20, 0xC9 ; 201 3bbe0: 0d 94 44 dd jmp 0x3ba88 ; 0x3ba88 <__addsf3> 3bbe4: 08 95 ret 0003bbe6 : 3bbe6: df 93 push r29 3bbe8: dd 27 eor r29, r29 3bbea: b9 2f mov r27, r25 3bbec: bf 77 andi r27, 0x7F ; 127 3bbee: 40 e8 ldi r20, 0x80 ; 128 3bbf0: 5f e3 ldi r21, 0x3F ; 63 3bbf2: 16 16 cp r1, r22 3bbf4: 17 06 cpc r1, r23 3bbf6: 48 07 cpc r20, r24 3bbf8: 5b 07 cpc r21, r27 3bbfa: 18 f4 brcc .+6 ; 0x3bc02 3bbfc: d9 2f mov r29, r25 3bbfe: 0f 94 3f e0 call 0x3c07e ; 0x3c07e 3bc02: 9f 93 push r25 3bc04: 8f 93 push r24 3bc06: 7f 93 push r23 3bc08: 6f 93 push r22 3bc0a: 0f 94 e5 d6 call 0x3adca ; 0x3adca 3bc0e: e6 e4 ldi r30, 0x46 ; 70 3bc10: f1 e7 ldi r31, 0x71 ; 113 3bc12: 0f 94 4f df call 0x3be9e ; 0x3be9e <__fp_powser> 3bc16: 0f 94 6d d7 call 0x3aeda ; 0x3aeda <__fp_round> 3bc1a: 2f 91 pop r18 3bc1c: 3f 91 pop r19 3bc1e: 4f 91 pop r20 3bc20: 5f 91 pop r21 3bc22: 0f 94 fc d6 call 0x3adf8 ; 0x3adf8 <__mulsf3x> 3bc26: dd 23 and r29, r29 3bc28: 51 f0 breq .+20 ; 0x3bc3e 3bc2a: 90 58 subi r25, 0x80 ; 128 3bc2c: a2 ea ldi r26, 0xA2 ; 162 3bc2e: 2a ed ldi r18, 0xDA ; 218 3bc30: 3f e0 ldi r19, 0x0F ; 15 3bc32: 49 ec ldi r20, 0xC9 ; 201 3bc34: 5f e3 ldi r21, 0x3F ; 63 3bc36: d0 78 andi r29, 0x80 ; 128 3bc38: 5d 27 eor r21, r29 3bc3a: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 <__addsf3x> 3bc3e: df 91 pop r29 3bc40: 0d 94 6d d7 jmp 0x3aeda ; 0x3aeda <__fp_round> 0003bc44 : 3bc44: 0f 94 b5 df call 0x3bf6a ; 0x3bf6a <__fp_trunc> 3bc48: 90 f0 brcs .+36 ; 0x3bc6e 3bc4a: 9f 37 cpi r25, 0x7F ; 127 3bc4c: 48 f4 brcc .+18 ; 0x3bc60 3bc4e: 91 11 cpse r25, r1 3bc50: 16 f4 brtc .+4 ; 0x3bc56 3bc52: 0d 94 a1 d7 jmp 0x3af42 ; 0x3af42 <__fp_szero> 3bc56: 60 e0 ldi r22, 0x00 ; 0 3bc58: 70 e0 ldi r23, 0x00 ; 0 3bc5a: 80 e8 ldi r24, 0x80 ; 128 3bc5c: 9f e3 ldi r25, 0x3F ; 63 3bc5e: 08 95 ret 3bc60: 26 f0 brts .+8 ; 0x3bc6a 3bc62: 1b 16 cp r1, r27 3bc64: 61 1d adc r22, r1 3bc66: 71 1d adc r23, r1 3bc68: 81 1d adc r24, r1 3bc6a: 0d 94 26 df jmp 0x3be4c ; 0x3be4c <__fp_mintl> 3bc6e: 0d 94 41 df jmp 0x3be82 ; 0x3be82 <__fp_mpack> 0003bc72 <__cmpsf2>: 3bc72: 0f 94 02 df call 0x3be04 ; 0x3be04 <__fp_cmp> 3bc76: 08 f4 brcc .+2 ; 0x3bc7a <__cmpsf2+0x8> 3bc78: 81 e0 ldi r24, 0x01 ; 1 3bc7a: 08 95 ret 0003bc7c : 3bc7c: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__fp_rempio2> 3bc80: e3 95 inc r30 3bc82: 0d 94 a1 df jmp 0x3bf42 ; 0x3bf42 <__fp_sinus> 0003bc86 <__divsf3>: 3bc86: 0f 94 57 de call 0x3bcae ; 0x3bcae <__divsf3x> 3bc8a: 0d 94 6d d7 jmp 0x3aeda ; 0x3aeda <__fp_round> 3bc8e: 0f 94 66 d7 call 0x3aecc ; 0x3aecc <__fp_pscB> 3bc92: 58 f0 brcs .+22 ; 0x3bcaa <__divsf3+0x24> 3bc94: 0f 94 5f d7 call 0x3aebe ; 0x3aebe <__fp_pscA> 3bc98: 40 f0 brcs .+16 ; 0x3bcaa <__divsf3+0x24> 3bc9a: 29 f4 brne .+10 ; 0x3bca6 <__divsf3+0x20> 3bc9c: 5f 3f cpi r21, 0xFF ; 255 3bc9e: 29 f0 breq .+10 ; 0x3bcaa <__divsf3+0x24> 3bca0: 0d 94 56 d7 jmp 0x3aeac ; 0x3aeac <__fp_inf> 3bca4: 51 11 cpse r21, r1 3bca6: 0d 94 a1 d7 jmp 0x3af42 ; 0x3af42 <__fp_szero> 3bcaa: 0d 94 5c d7 jmp 0x3aeb8 ; 0x3aeb8 <__fp_nan> 0003bcae <__divsf3x>: 3bcae: 0f 94 7e d7 call 0x3aefc ; 0x3aefc <__fp_split3> 3bcb2: 68 f3 brcs .-38 ; 0x3bc8e <__divsf3+0x8> 0003bcb4 <__divsf3_pse>: 3bcb4: 99 23 and r25, r25 3bcb6: b1 f3 breq .-20 ; 0x3bca4 <__divsf3+0x1e> 3bcb8: 55 23 and r21, r21 3bcba: 91 f3 breq .-28 ; 0x3bca0 <__divsf3+0x1a> 3bcbc: 95 1b sub r25, r21 3bcbe: 55 0b sbc r21, r21 3bcc0: bb 27 eor r27, r27 3bcc2: aa 27 eor r26, r26 3bcc4: 62 17 cp r22, r18 3bcc6: 73 07 cpc r23, r19 3bcc8: 84 07 cpc r24, r20 3bcca: 38 f0 brcs .+14 ; 0x3bcda <__divsf3_pse+0x26> 3bccc: 9f 5f subi r25, 0xFF ; 255 3bcce: 5f 4f sbci r21, 0xFF ; 255 3bcd0: 22 0f add r18, r18 3bcd2: 33 1f adc r19, r19 3bcd4: 44 1f adc r20, r20 3bcd6: aa 1f adc r26, r26 3bcd8: a9 f3 breq .-22 ; 0x3bcc4 <__divsf3_pse+0x10> 3bcda: 35 d0 rcall .+106 ; 0x3bd46 <__divsf3_pse+0x92> 3bcdc: 0e 2e mov r0, r30 3bcde: 3a f0 brmi .+14 ; 0x3bcee <__divsf3_pse+0x3a> 3bce0: e0 e8 ldi r30, 0x80 ; 128 3bce2: 32 d0 rcall .+100 ; 0x3bd48 <__divsf3_pse+0x94> 3bce4: 91 50 subi r25, 0x01 ; 1 3bce6: 50 40 sbci r21, 0x00 ; 0 3bce8: e6 95 lsr r30 3bcea: 00 1c adc r0, r0 3bcec: ca f7 brpl .-14 ; 0x3bce0 <__divsf3_pse+0x2c> 3bcee: 2b d0 rcall .+86 ; 0x3bd46 <__divsf3_pse+0x92> 3bcf0: fe 2f mov r31, r30 3bcf2: 29 d0 rcall .+82 ; 0x3bd46 <__divsf3_pse+0x92> 3bcf4: 66 0f add r22, r22 3bcf6: 77 1f adc r23, r23 3bcf8: 88 1f adc r24, r24 3bcfa: bb 1f adc r27, r27 3bcfc: 26 17 cp r18, r22 3bcfe: 37 07 cpc r19, r23 3bd00: 48 07 cpc r20, r24 3bd02: ab 07 cpc r26, r27 3bd04: b0 e8 ldi r27, 0x80 ; 128 3bd06: 09 f0 breq .+2 ; 0x3bd0a <__divsf3_pse+0x56> 3bd08: bb 0b sbc r27, r27 3bd0a: 80 2d mov r24, r0 3bd0c: bf 01 movw r22, r30 3bd0e: ff 27 eor r31, r31 3bd10: 93 58 subi r25, 0x83 ; 131 3bd12: 5f 4f sbci r21, 0xFF ; 255 3bd14: 3a f0 brmi .+14 ; 0x3bd24 <__divsf3_pse+0x70> 3bd16: 9e 3f cpi r25, 0xFE ; 254 3bd18: 51 05 cpc r21, r1 3bd1a: 78 f0 brcs .+30 ; 0x3bd3a <__divsf3_pse+0x86> 3bd1c: 0d 94 56 d7 jmp 0x3aeac ; 0x3aeac <__fp_inf> 3bd20: 0d 94 a1 d7 jmp 0x3af42 ; 0x3af42 <__fp_szero> 3bd24: 5f 3f cpi r21, 0xFF ; 255 3bd26: e4 f3 brlt .-8 ; 0x3bd20 <__divsf3_pse+0x6c> 3bd28: 98 3e cpi r25, 0xE8 ; 232 3bd2a: d4 f3 brlt .-12 ; 0x3bd20 <__divsf3_pse+0x6c> 3bd2c: 86 95 lsr r24 3bd2e: 77 95 ror r23 3bd30: 67 95 ror r22 3bd32: b7 95 ror r27 3bd34: f7 95 ror r31 3bd36: 9f 5f subi r25, 0xFF ; 255 3bd38: c9 f7 brne .-14 ; 0x3bd2c <__divsf3_pse+0x78> 3bd3a: 88 0f add r24, r24 3bd3c: 91 1d adc r25, r1 3bd3e: 96 95 lsr r25 3bd40: 87 95 ror r24 3bd42: 97 f9 bld r25, 7 3bd44: 08 95 ret 3bd46: e1 e0 ldi r30, 0x01 ; 1 3bd48: 66 0f add r22, r22 3bd4a: 77 1f adc r23, r23 3bd4c: 88 1f adc r24, r24 3bd4e: bb 1f adc r27, r27 3bd50: 62 17 cp r22, r18 3bd52: 73 07 cpc r23, r19 3bd54: 84 07 cpc r24, r20 3bd56: ba 07 cpc r27, r26 3bd58: 20 f0 brcs .+8 ; 0x3bd62 <__divsf3_pse+0xae> 3bd5a: 62 1b sub r22, r18 3bd5c: 73 0b sbc r23, r19 3bd5e: 84 0b sbc r24, r20 3bd60: ba 0b sbc r27, r26 3bd62: ee 1f adc r30, r30 3bd64: 88 f7 brcc .-30 ; 0x3bd48 <__divsf3_pse+0x94> 3bd66: e0 95 com r30 3bd68: 08 95 ret 0003bd6a <__fixsfsi>: 3bd6a: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixunssfsi> 3bd6e: 68 94 set 3bd70: b1 11 cpse r27, r1 3bd72: 0d 94 a1 d7 jmp 0x3af42 ; 0x3af42 <__fp_szero> 3bd76: 08 95 ret 0003bd78 <__fixunssfsi>: 3bd78: 0f 94 86 d7 call 0x3af0c ; 0x3af0c <__fp_splitA> 3bd7c: 88 f0 brcs .+34 ; 0x3bda0 <__fixunssfsi+0x28> 3bd7e: 9f 57 subi r25, 0x7F ; 127 3bd80: 98 f0 brcs .+38 ; 0x3bda8 <__fixunssfsi+0x30> 3bd82: b9 2f mov r27, r25 3bd84: 99 27 eor r25, r25 3bd86: b7 51 subi r27, 0x17 ; 23 3bd88: b0 f0 brcs .+44 ; 0x3bdb6 <__fixunssfsi+0x3e> 3bd8a: e1 f0 breq .+56 ; 0x3bdc4 <__fixunssfsi+0x4c> 3bd8c: 66 0f add r22, r22 3bd8e: 77 1f adc r23, r23 3bd90: 88 1f adc r24, r24 3bd92: 99 1f adc r25, r25 3bd94: 1a f0 brmi .+6 ; 0x3bd9c <__fixunssfsi+0x24> 3bd96: ba 95 dec r27 3bd98: c9 f7 brne .-14 ; 0x3bd8c <__fixunssfsi+0x14> 3bd9a: 14 c0 rjmp .+40 ; 0x3bdc4 <__fixunssfsi+0x4c> 3bd9c: b1 30 cpi r27, 0x01 ; 1 3bd9e: 91 f0 breq .+36 ; 0x3bdc4 <__fixunssfsi+0x4c> 3bda0: 0f 94 a0 d7 call 0x3af40 ; 0x3af40 <__fp_zero> 3bda4: b1 e0 ldi r27, 0x01 ; 1 3bda6: 08 95 ret 3bda8: 0d 94 a0 d7 jmp 0x3af40 ; 0x3af40 <__fp_zero> 3bdac: 67 2f mov r22, r23 3bdae: 78 2f mov r23, r24 3bdb0: 88 27 eor r24, r24 3bdb2: b8 5f subi r27, 0xF8 ; 248 3bdb4: 39 f0 breq .+14 ; 0x3bdc4 <__fixunssfsi+0x4c> 3bdb6: b9 3f cpi r27, 0xF9 ; 249 3bdb8: cc f3 brlt .-14 ; 0x3bdac <__fixunssfsi+0x34> 3bdba: 86 95 lsr r24 3bdbc: 77 95 ror r23 3bdbe: 67 95 ror r22 3bdc0: b3 95 inc r27 3bdc2: d9 f7 brne .-10 ; 0x3bdba <__fixunssfsi+0x42> 3bdc4: 3e f4 brtc .+14 ; 0x3bdd4 <__fixunssfsi+0x5c> 3bdc6: 90 95 com r25 3bdc8: 80 95 com r24 3bdca: 70 95 com r23 3bdcc: 61 95 neg r22 3bdce: 7f 4f sbci r23, 0xFF ; 255 3bdd0: 8f 4f sbci r24, 0xFF ; 255 3bdd2: 9f 4f sbci r25, 0xFF ; 255 3bdd4: 08 95 ret 0003bdd6 : 3bdd6: 0f 94 b5 df call 0x3bf6a ; 0x3bf6a <__fp_trunc> 3bdda: 90 f0 brcs .+36 ; 0x3be00 3bddc: 9f 37 cpi r25, 0x7F ; 127 3bdde: 48 f4 brcc .+18 ; 0x3bdf2 3bde0: 91 11 cpse r25, r1 3bde2: 16 f0 brts .+4 ; 0x3bde8 3bde4: 0d 94 a1 d7 jmp 0x3af42 ; 0x3af42 <__fp_szero> 3bde8: 60 e0 ldi r22, 0x00 ; 0 3bdea: 70 e0 ldi r23, 0x00 ; 0 3bdec: 80 e8 ldi r24, 0x80 ; 128 3bdee: 9f eb ldi r25, 0xBF ; 191 3bdf0: 08 95 ret 3bdf2: 26 f4 brtc .+8 ; 0x3bdfc 3bdf4: 1b 16 cp r1, r27 3bdf6: 61 1d adc r22, r1 3bdf8: 71 1d adc r23, r1 3bdfa: 81 1d adc r24, r1 3bdfc: 0d 94 26 df jmp 0x3be4c ; 0x3be4c <__fp_mintl> 3be00: 0d 94 41 df jmp 0x3be82 ; 0x3be82 <__fp_mpack> 0003be04 <__fp_cmp>: 3be04: 99 0f add r25, r25 3be06: 00 08 sbc r0, r0 3be08: 55 0f add r21, r21 3be0a: aa 0b sbc r26, r26 3be0c: e0 e8 ldi r30, 0x80 ; 128 3be0e: fe ef ldi r31, 0xFE ; 254 3be10: 16 16 cp r1, r22 3be12: 17 06 cpc r1, r23 3be14: e8 07 cpc r30, r24 3be16: f9 07 cpc r31, r25 3be18: c0 f0 brcs .+48 ; 0x3be4a <__fp_cmp+0x46> 3be1a: 12 16 cp r1, r18 3be1c: 13 06 cpc r1, r19 3be1e: e4 07 cpc r30, r20 3be20: f5 07 cpc r31, r21 3be22: 98 f0 brcs .+38 ; 0x3be4a <__fp_cmp+0x46> 3be24: 62 1b sub r22, r18 3be26: 73 0b sbc r23, r19 3be28: 84 0b sbc r24, r20 3be2a: 95 0b sbc r25, r21 3be2c: 39 f4 brne .+14 ; 0x3be3c <__fp_cmp+0x38> 3be2e: 0a 26 eor r0, r26 3be30: 61 f0 breq .+24 ; 0x3be4a <__fp_cmp+0x46> 3be32: 23 2b or r18, r19 3be34: 24 2b or r18, r20 3be36: 25 2b or r18, r21 3be38: 21 f4 brne .+8 ; 0x3be42 <__fp_cmp+0x3e> 3be3a: 08 95 ret 3be3c: 0a 26 eor r0, r26 3be3e: 09 f4 brne .+2 ; 0x3be42 <__fp_cmp+0x3e> 3be40: a1 40 sbci r26, 0x01 ; 1 3be42: a6 95 lsr r26 3be44: 8f ef ldi r24, 0xFF ; 255 3be46: 81 1d adc r24, r1 3be48: 81 1d adc r24, r1 3be4a: 08 95 ret 0003be4c <__fp_mintl>: 3be4c: 88 23 and r24, r24 3be4e: 71 f4 brne .+28 ; 0x3be6c <__fp_mintl+0x20> 3be50: 77 23 and r23, r23 3be52: 21 f0 breq .+8 ; 0x3be5c <__fp_mintl+0x10> 3be54: 98 50 subi r25, 0x08 ; 8 3be56: 87 2b or r24, r23 3be58: 76 2f mov r23, r22 3be5a: 07 c0 rjmp .+14 ; 0x3be6a <__fp_mintl+0x1e> 3be5c: 66 23 and r22, r22 3be5e: 11 f4 brne .+4 ; 0x3be64 <__fp_mintl+0x18> 3be60: 99 27 eor r25, r25 3be62: 0d c0 rjmp .+26 ; 0x3be7e <__fp_mintl+0x32> 3be64: 90 51 subi r25, 0x10 ; 16 3be66: 86 2b or r24, r22 3be68: 70 e0 ldi r23, 0x00 ; 0 3be6a: 60 e0 ldi r22, 0x00 ; 0 3be6c: 2a f0 brmi .+10 ; 0x3be78 <__fp_mintl+0x2c> 3be6e: 9a 95 dec r25 3be70: 66 0f add r22, r22 3be72: 77 1f adc r23, r23 3be74: 88 1f adc r24, r24 3be76: da f7 brpl .-10 ; 0x3be6e <__fp_mintl+0x22> 3be78: 88 0f add r24, r24 3be7a: 96 95 lsr r25 3be7c: 87 95 ror r24 3be7e: 97 f9 bld r25, 7 3be80: 08 95 ret 0003be82 <__fp_mpack>: 3be82: 9f 3f cpi r25, 0xFF ; 255 3be84: 31 f0 breq .+12 ; 0x3be92 <__fp_mpack_finite+0xc> 0003be86 <__fp_mpack_finite>: 3be86: 91 50 subi r25, 0x01 ; 1 3be88: 20 f4 brcc .+8 ; 0x3be92 <__fp_mpack_finite+0xc> 3be8a: 87 95 ror r24 3be8c: 77 95 ror r23 3be8e: 67 95 ror r22 3be90: b7 95 ror r27 3be92: 88 0f add r24, r24 3be94: 91 1d adc r25, r1 3be96: 96 95 lsr r25 3be98: 87 95 ror r24 3be9a: 97 f9 bld r25, 7 3be9c: 08 95 ret 0003be9e <__fp_powser>: 3be9e: df 93 push r29 3bea0: cf 93 push r28 3bea2: 1f 93 push r17 3bea4: 0f 93 push r16 3bea6: ff 92 push r15 3bea8: ef 92 push r14 3beaa: df 92 push r13 3beac: 7b 01 movw r14, r22 3beae: 8c 01 movw r16, r24 3beb0: 68 94 set 3beb2: 06 c0 rjmp .+12 ; 0x3bec0 <__fp_powser+0x22> 3beb4: da 2e mov r13, r26 3beb6: ef 01 movw r28, r30 3beb8: 0f 94 fc d6 call 0x3adf8 ; 0x3adf8 <__mulsf3x> 3bebc: fe 01 movw r30, r28 3bebe: e8 94 clt 3bec0: a5 91 lpm r26, Z+ 3bec2: 25 91 lpm r18, Z+ 3bec4: 35 91 lpm r19, Z+ 3bec6: 45 91 lpm r20, Z+ 3bec8: 55 91 lpm r21, Z+ 3beca: a6 f3 brts .-24 ; 0x3beb4 <__fp_powser+0x16> 3becc: ef 01 movw r28, r30 3bece: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 <__addsf3x> 3bed2: fe 01 movw r30, r28 3bed4: 97 01 movw r18, r14 3bed6: a8 01 movw r20, r16 3bed8: da 94 dec r13 3beda: 69 f7 brne .-38 ; 0x3beb6 <__fp_powser+0x18> 3bedc: df 90 pop r13 3bede: ef 90 pop r14 3bee0: ff 90 pop r15 3bee2: 0f 91 pop r16 3bee4: 1f 91 pop r17 3bee6: cf 91 pop r28 3bee8: df 91 pop r29 3beea: 08 95 ret 3beec: 0d 94 5c d7 jmp 0x3aeb8 ; 0x3aeb8 <__fp_nan> 0003bef0 <__fp_rempio2>: 3bef0: 0f 94 86 d7 call 0x3af0c ; 0x3af0c <__fp_splitA> 3bef4: d8 f3 brcs .-10 ; 0x3beec <__fp_powser+0x4e> 3bef6: e8 94 clt 3bef8: e0 e0 ldi r30, 0x00 ; 0 3befa: bb 27 eor r27, r27 3befc: 9f 57 subi r25, 0x7F ; 127 3befe: f0 f0 brcs .+60 ; 0x3bf3c <__fp_rempio2+0x4c> 3bf00: 2a ed ldi r18, 0xDA ; 218 3bf02: 3f e0 ldi r19, 0x0F ; 15 3bf04: 49 ec ldi r20, 0xC9 ; 201 3bf06: 06 c0 rjmp .+12 ; 0x3bf14 <__fp_rempio2+0x24> 3bf08: ee 0f add r30, r30 3bf0a: bb 0f add r27, r27 3bf0c: 66 1f adc r22, r22 3bf0e: 77 1f adc r23, r23 3bf10: 88 1f adc r24, r24 3bf12: 28 f0 brcs .+10 ; 0x3bf1e <__fp_rempio2+0x2e> 3bf14: b2 3a cpi r27, 0xA2 ; 162 3bf16: 62 07 cpc r22, r18 3bf18: 73 07 cpc r23, r19 3bf1a: 84 07 cpc r24, r20 3bf1c: 28 f0 brcs .+10 ; 0x3bf28 <__fp_rempio2+0x38> 3bf1e: b2 5a subi r27, 0xA2 ; 162 3bf20: 62 0b sbc r22, r18 3bf22: 73 0b sbc r23, r19 3bf24: 84 0b sbc r24, r20 3bf26: e3 95 inc r30 3bf28: 9a 95 dec r25 3bf2a: 72 f7 brpl .-36 ; 0x3bf08 <__fp_rempio2+0x18> 3bf2c: 80 38 cpi r24, 0x80 ; 128 3bf2e: 30 f4 brcc .+12 ; 0x3bf3c <__fp_rempio2+0x4c> 3bf30: 9a 95 dec r25 3bf32: bb 0f add r27, r27 3bf34: 66 1f adc r22, r22 3bf36: 77 1f adc r23, r23 3bf38: 88 1f adc r24, r24 3bf3a: d2 f7 brpl .-12 ; 0x3bf30 <__fp_rempio2+0x40> 3bf3c: 90 48 sbci r25, 0x80 ; 128 3bf3e: 0d 94 43 df jmp 0x3be86 ; 0x3be86 <__fp_mpack_finite> 0003bf42 <__fp_sinus>: 3bf42: ef 93 push r30 3bf44: e0 ff sbrs r30, 0 3bf46: 07 c0 rjmp .+14 ; 0x3bf56 <__fp_sinus+0x14> 3bf48: a2 ea ldi r26, 0xA2 ; 162 3bf4a: 2a ed ldi r18, 0xDA ; 218 3bf4c: 3f e0 ldi r19, 0x0F ; 15 3bf4e: 49 ec ldi r20, 0xC9 ; 201 3bf50: 5f eb ldi r21, 0xBF ; 191 3bf52: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 <__addsf3x> 3bf56: 0f 94 6d d7 call 0x3aeda ; 0x3aeda <__fp_round> 3bf5a: 0f 90 pop r0 3bf5c: 03 94 inc r0 3bf5e: 01 fc sbrc r0, 1 3bf60: 90 58 subi r25, 0x80 ; 128 3bf62: e3 e7 ldi r30, 0x73 ; 115 3bf64: f1 e7 ldi r31, 0x71 ; 113 3bf66: 0d 94 98 e1 jmp 0x3c330 ; 0x3c330 <__fp_powsodd> 0003bf6a <__fp_trunc>: 3bf6a: 0f 94 86 d7 call 0x3af0c ; 0x3af0c <__fp_splitA> 3bf6e: a0 f0 brcs .+40 ; 0x3bf98 <__fp_trunc+0x2e> 3bf70: be e7 ldi r27, 0x7E ; 126 3bf72: b9 17 cp r27, r25 3bf74: 88 f4 brcc .+34 ; 0x3bf98 <__fp_trunc+0x2e> 3bf76: bb 27 eor r27, r27 3bf78: 9f 38 cpi r25, 0x8F ; 143 3bf7a: 60 f4 brcc .+24 ; 0x3bf94 <__fp_trunc+0x2a> 3bf7c: 16 16 cp r1, r22 3bf7e: b1 1d adc r27, r1 3bf80: 67 2f mov r22, r23 3bf82: 78 2f mov r23, r24 3bf84: 88 27 eor r24, r24 3bf86: 98 5f subi r25, 0xF8 ; 248 3bf88: f7 cf rjmp .-18 ; 0x3bf78 <__fp_trunc+0xe> 3bf8a: 86 95 lsr r24 3bf8c: 77 95 ror r23 3bf8e: 67 95 ror r22 3bf90: b1 1d adc r27, r1 3bf92: 93 95 inc r25 3bf94: 96 39 cpi r25, 0x96 ; 150 3bf96: c8 f3 brcs .-14 ; 0x3bf8a <__fp_trunc+0x20> 3bf98: 08 95 ret 0003bf9a <__gesf2>: 3bf9a: 0f 94 02 df call 0x3be04 ; 0x3be04 <__fp_cmp> 3bf9e: 08 f4 brcc .+2 ; 0x3bfa2 <__gesf2+0x8> 3bfa0: 8f ef ldi r24, 0xFF ; 255 3bfa2: 08 95 ret 3bfa4: 0f 94 5f d7 call 0x3aebe ; 0x3aebe <__fp_pscA> 3bfa8: 29 f0 breq .+10 ; 0x3bfb4 <__gesf2+0x1a> 3bfaa: 0f 94 66 d7 call 0x3aecc ; 0x3aecc <__fp_pscB> 3bfae: 11 f0 breq .+4 ; 0x3bfb4 <__gesf2+0x1a> 3bfb0: 0d 94 5c d7 jmp 0x3aeb8 ; 0x3aeb8 <__fp_nan> 3bfb4: 0d 94 56 d7 jmp 0x3aeac ; 0x3aeac <__fp_inf> 3bfb8: b9 01 movw r22, r18 3bfba: ca 01 movw r24, r20 3bfbc: 0d 94 41 df jmp 0x3be82 ; 0x3be82 <__fp_mpack> 0003bfc0 : 3bfc0: 9f 77 andi r25, 0x7F ; 127 3bfc2: 5f 77 andi r21, 0x7F ; 127 3bfc4: 0f 94 7e d7 call 0x3aefc ; 0x3aefc <__fp_split3> 3bfc8: 68 f3 brcs .-38 ; 0x3bfa4 <__gesf2+0xa> 3bfca: 99 23 and r25, r25 3bfcc: a9 f3 breq .-22 ; 0x3bfb8 <__gesf2+0x1e> 3bfce: 55 23 and r21, r21 3bfd0: a9 f3 breq .-22 ; 0x3bfbc <__gesf2+0x22> 3bfd2: ff 27 eor r31, r31 3bfd4: 95 17 cp r25, r21 3bfd6: 58 f4 brcc .+22 ; 0x3bfee 3bfd8: e5 2f mov r30, r21 3bfda: e9 1b sub r30, r25 3bfdc: ed 30 cpi r30, 0x0D ; 13 3bfde: 60 f7 brcc .-40 ; 0x3bfb8 <__gesf2+0x1e> 3bfe0: 5e 3b cpi r21, 0xBE ; 190 3bfe2: 10 f0 brcs .+4 ; 0x3bfe8 3bfe4: f1 e4 ldi r31, 0x41 ; 65 3bfe6: 1c c0 rjmp .+56 ; 0x3c020 3bfe8: 90 34 cpi r25, 0x40 ; 64 3bfea: e0 f4 brcc .+56 ; 0x3c024 3bfec: 0a c0 rjmp .+20 ; 0x3c002 3bfee: e9 2f mov r30, r25 3bff0: e5 1b sub r30, r21 3bff2: ed 30 cpi r30, 0x0D ; 13 3bff4: 18 f7 brcc .-58 ; 0x3bfbc <__gesf2+0x22> 3bff6: 9e 3b cpi r25, 0xBE ; 190 3bff8: 10 f0 brcs .+4 ; 0x3bffe 3bffa: f1 e4 ldi r31, 0x41 ; 65 3bffc: 11 c0 rjmp .+34 ; 0x3c020 3bffe: 50 34 cpi r21, 0x40 ; 64 3c000: 88 f4 brcc .+34 ; 0x3c024 3c002: f9 ea ldi r31, 0xA9 ; 169 3c004: 88 23 and r24, r24 3c006: 2a f0 brmi .+10 ; 0x3c012 3c008: 9a 95 dec r25 3c00a: 66 0f add r22, r22 3c00c: 77 1f adc r23, r23 3c00e: 88 1f adc r24, r24 3c010: da f7 brpl .-10 ; 0x3c008 3c012: 44 23 and r20, r20 3c014: 2a f0 brmi .+10 ; 0x3c020 3c016: 5a 95 dec r21 3c018: 22 0f add r18, r18 3c01a: 33 1f adc r19, r19 3c01c: 44 1f adc r20, r20 3c01e: da f7 brpl .-10 ; 0x3c016 3c020: 9f 1b sub r25, r31 3c022: 5f 1b sub r21, r31 3c024: ff 93 push r31 3c026: 1f 93 push r17 3c028: 0f 93 push r16 3c02a: ff 92 push r15 3c02c: ef 92 push r14 3c02e: 79 01 movw r14, r18 3c030: 8a 01 movw r16, r20 3c032: bb 27 eor r27, r27 3c034: ab 2f mov r26, r27 3c036: 9b 01 movw r18, r22 3c038: ac 01 movw r20, r24 3c03a: 0f 94 ff d6 call 0x3adfe ; 0x3adfe <__mulsf3_pse> 3c03e: 97 01 movw r18, r14 3c040: a8 01 movw r20, r16 3c042: bf 93 push r27 3c044: 7b 01 movw r14, r22 3c046: 8c 01 movw r16, r24 3c048: aa 27 eor r26, r26 3c04a: ba 2f mov r27, r26 3c04c: b9 01 movw r22, r18 3c04e: ca 01 movw r24, r20 3c050: 0f 94 ff d6 call 0x3adfe ; 0x3adfe <__mulsf3_pse> 3c054: af 91 pop r26 3c056: 97 01 movw r18, r14 3c058: a8 01 movw r20, r16 3c05a: ef 90 pop r14 3c05c: ff 90 pop r15 3c05e: 0f 91 pop r16 3c060: 1f 91 pop r17 3c062: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 <__addsf3x> 3c066: 0f 94 6d d7 call 0x3aeda ; 0x3aeda <__fp_round> 3c06a: 0f 94 12 e1 call 0x3c224 ; 0x3c224 3c06e: 4f 91 pop r20 3c070: 40 ff sbrs r20, 0 3c072: 08 95 ret 3c074: 55 27 eor r21, r21 3c076: 47 fd sbrc r20, 7 3c078: 50 95 com r21 3c07a: 0d 94 4b e0 jmp 0x3c096 ; 0x3c096 0003c07e : 3c07e: 9b 01 movw r18, r22 3c080: ac 01 movw r20, r24 3c082: 60 e0 ldi r22, 0x00 ; 0 3c084: 70 e0 ldi r23, 0x00 ; 0 3c086: 80 e8 ldi r24, 0x80 ; 128 3c088: 9f e3 ldi r25, 0x3F ; 63 3c08a: 0d 94 43 de jmp 0x3bc86 ; 0x3bc86 <__divsf3> 3c08e: 0d 94 56 d7 jmp 0x3aeac ; 0x3aeac <__fp_inf> 3c092: 0d 94 41 df jmp 0x3be82 ; 0x3be82 <__fp_mpack> 0003c096 : 3c096: 0f 94 86 d7 call 0x3af0c ; 0x3af0c <__fp_splitA> 3c09a: d8 f3 brcs .-10 ; 0x3c092 3c09c: 99 23 and r25, r25 3c09e: c9 f3 breq .-14 ; 0x3c092 3c0a0: 94 0f add r25, r20 3c0a2: 51 1d adc r21, r1 3c0a4: a3 f3 brvs .-24 ; 0x3c08e 3c0a6: 91 50 subi r25, 0x01 ; 1 3c0a8: 50 40 sbci r21, 0x00 ; 0 3c0aa: 94 f0 brlt .+36 ; 0x3c0d0 3c0ac: 59 f0 breq .+22 ; 0x3c0c4 3c0ae: 88 23 and r24, r24 3c0b0: 32 f0 brmi .+12 ; 0x3c0be 3c0b2: 66 0f add r22, r22 3c0b4: 77 1f adc r23, r23 3c0b6: 88 1f adc r24, r24 3c0b8: 91 50 subi r25, 0x01 ; 1 3c0ba: 50 40 sbci r21, 0x00 ; 0 3c0bc: c1 f7 brne .-16 ; 0x3c0ae 3c0be: 9e 3f cpi r25, 0xFE ; 254 3c0c0: 51 05 cpc r21, r1 3c0c2: 2c f7 brge .-54 ; 0x3c08e 3c0c4: 88 0f add r24, r24 3c0c6: 91 1d adc r25, r1 3c0c8: 96 95 lsr r25 3c0ca: 87 95 ror r24 3c0cc: 97 f9 bld r25, 7 3c0ce: 08 95 ret 3c0d0: 5f 3f cpi r21, 0xFF ; 255 3c0d2: ac f0 brlt .+42 ; 0x3c0fe 3c0d4: 98 3e cpi r25, 0xE8 ; 232 3c0d6: 9c f0 brlt .+38 ; 0x3c0fe 3c0d8: bb 27 eor r27, r27 3c0da: 86 95 lsr r24 3c0dc: 77 95 ror r23 3c0de: 67 95 ror r22 3c0e0: b7 95 ror r27 3c0e2: 08 f4 brcc .+2 ; 0x3c0e6 3c0e4: b1 60 ori r27, 0x01 ; 1 3c0e6: 93 95 inc r25 3c0e8: c1 f7 brne .-16 ; 0x3c0da 3c0ea: bb 0f add r27, r27 3c0ec: 58 f7 brcc .-42 ; 0x3c0c4 3c0ee: 11 f4 brne .+4 ; 0x3c0f4 3c0f0: 60 ff sbrs r22, 0 3c0f2: e8 cf rjmp .-48 ; 0x3c0c4 3c0f4: 6f 5f subi r22, 0xFF ; 255 3c0f6: 7f 4f sbci r23, 0xFF ; 255 3c0f8: 8f 4f sbci r24, 0xFF ; 255 3c0fa: 9f 4f sbci r25, 0xFF ; 255 3c0fc: e3 cf rjmp .-58 ; 0x3c0c4 3c0fe: 0d 94 a1 d7 jmp 0x3af42 ; 0x3af42 <__fp_szero> 0003c102 : 3c102: 0f 94 86 d7 call 0x3af0c ; 0x3af0c <__fp_splitA> 3c106: 58 f1 brcs .+86 ; 0x3c15e 3c108: 9e 57 subi r25, 0x7E ; 126 3c10a: 60 f1 brcs .+88 ; 0x3c164 3c10c: 98 51 subi r25, 0x18 ; 24 3c10e: a0 f0 brcs .+40 ; 0x3c138 3c110: e9 f0 breq .+58 ; 0x3c14c 3c112: 98 30 cpi r25, 0x08 ; 8 3c114: 20 f5 brcc .+72 ; 0x3c15e 3c116: 09 2e mov r0, r25 3c118: 99 27 eor r25, r25 3c11a: 66 0f add r22, r22 3c11c: 77 1f adc r23, r23 3c11e: 88 1f adc r24, r24 3c120: 99 1f adc r25, r25 3c122: 0a 94 dec r0 3c124: d1 f7 brne .-12 ; 0x3c11a 3c126: 12 c0 rjmp .+36 ; 0x3c14c 3c128: 06 2e mov r0, r22 3c12a: 67 2f mov r22, r23 3c12c: 78 2f mov r23, r24 3c12e: 88 27 eor r24, r24 3c130: 98 5f subi r25, 0xF8 ; 248 3c132: 11 f4 brne .+4 ; 0x3c138 3c134: 00 0c add r0, r0 3c136: 07 c0 rjmp .+14 ; 0x3c146 3c138: 99 3f cpi r25, 0xF9 ; 249 3c13a: b4 f3 brlt .-20 ; 0x3c128 3c13c: 86 95 lsr r24 3c13e: 77 95 ror r23 3c140: 67 95 ror r22 3c142: 93 95 inc r25 3c144: d9 f7 brne .-10 ; 0x3c13c 3c146: 61 1d adc r22, r1 3c148: 71 1d adc r23, r1 3c14a: 81 1d adc r24, r1 3c14c: 3e f4 brtc .+14 ; 0x3c15c 3c14e: 90 95 com r25 3c150: 80 95 com r24 3c152: 70 95 com r23 3c154: 61 95 neg r22 3c156: 7f 4f sbci r23, 0xFF ; 255 3c158: 8f 4f sbci r24, 0xFF ; 255 3c15a: 9f 4f sbci r25, 0xFF ; 255 3c15c: 08 95 ret 3c15e: 68 94 set 3c160: 0d 94 a1 d7 jmp 0x3af42 ; 0x3af42 <__fp_szero> 3c164: 0d 94 a0 d7 jmp 0x3af40 ; 0x3af40 <__fp_zero> 0003c168 : 3c168: fa 01 movw r30, r20 3c16a: ee 0f add r30, r30 3c16c: ff 1f adc r31, r31 3c16e: 30 96 adiw r30, 0x00 ; 0 3c170: 21 05 cpc r18, r1 3c172: 31 05 cpc r19, r1 3c174: a1 f1 breq .+104 ; 0x3c1de 3c176: 61 15 cp r22, r1 3c178: 71 05 cpc r23, r1 3c17a: 61 f4 brne .+24 ; 0x3c194 3c17c: 80 38 cpi r24, 0x80 ; 128 3c17e: bf e3 ldi r27, 0x3F ; 63 3c180: 9b 07 cpc r25, r27 3c182: 49 f1 breq .+82 ; 0x3c1d6 3c184: 68 94 set 3c186: 90 38 cpi r25, 0x80 ; 128 3c188: 81 05 cpc r24, r1 3c18a: 61 f0 breq .+24 ; 0x3c1a4 3c18c: 80 38 cpi r24, 0x80 ; 128 3c18e: bf ef ldi r27, 0xFF ; 255 3c190: 9b 07 cpc r25, r27 3c192: 41 f0 breq .+16 ; 0x3c1a4 3c194: 99 23 and r25, r25 3c196: 4a f5 brpl .+82 ; 0x3c1ea 3c198: ff 3f cpi r31, 0xFF ; 255 3c19a: e1 05 cpc r30, r1 3c19c: 31 05 cpc r19, r1 3c19e: 21 05 cpc r18, r1 3c1a0: 19 f1 breq .+70 ; 0x3c1e8 3c1a2: e8 94 clt 3c1a4: 08 94 sec 3c1a6: e7 95 ror r30 3c1a8: d9 01 movw r26, r18 3c1aa: aa 23 and r26, r26 3c1ac: 29 f4 brne .+10 ; 0x3c1b8 3c1ae: ab 2f mov r26, r27 3c1b0: be 2f mov r27, r30 3c1b2: f8 5f subi r31, 0xF8 ; 248 3c1b4: d0 f3 brcs .-12 ; 0x3c1aa 3c1b6: 10 c0 rjmp .+32 ; 0x3c1d8 3c1b8: ff 5f subi r31, 0xFF ; 255 3c1ba: 70 f4 brcc .+28 ; 0x3c1d8 3c1bc: a6 95 lsr r26 3c1be: e0 f7 brcc .-8 ; 0x3c1b8 3c1c0: f7 39 cpi r31, 0x97 ; 151 3c1c2: 50 f0 brcs .+20 ; 0x3c1d8 3c1c4: 19 f0 breq .+6 ; 0x3c1cc 3c1c6: ff 3a cpi r31, 0xAF ; 175 3c1c8: 38 f4 brcc .+14 ; 0x3c1d8 3c1ca: 9f 77 andi r25, 0x7F ; 127 3c1cc: 9f 93 push r25 3c1ce: 0d d0 rcall .+26 ; 0x3c1ea 3c1d0: 0f 90 pop r0 3c1d2: 07 fc sbrc r0, 7 3c1d4: 90 58 subi r25, 0x80 ; 128 3c1d6: 08 95 ret 3c1d8: 46 f0 brts .+16 ; 0x3c1ea 3c1da: 0d 94 5c d7 jmp 0x3aeb8 ; 0x3aeb8 <__fp_nan> 3c1de: 60 e0 ldi r22, 0x00 ; 0 3c1e0: 70 e0 ldi r23, 0x00 ; 0 3c1e2: 80 e8 ldi r24, 0x80 ; 128 3c1e4: 9f e3 ldi r25, 0x3F ; 63 3c1e6: 08 95 ret 3c1e8: 4f e7 ldi r20, 0x7F ; 127 3c1ea: 9f 77 andi r25, 0x7F ; 127 3c1ec: 5f 93 push r21 3c1ee: 4f 93 push r20 3c1f0: 3f 93 push r19 3c1f2: 2f 93 push r18 3c1f4: 0f 94 b4 e1 call 0x3c368 ; 0x3c368 3c1f8: 2f 91 pop r18 3c1fa: 3f 91 pop r19 3c1fc: 4f 91 pop r20 3c1fe: 5f 91 pop r21 3c200: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 3c204: 0d 94 5f e1 jmp 0x3c2be ; 0x3c2be 0003c208 : 3c208: 9f 93 push r25 3c20a: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__fp_rempio2> 3c20e: 0f 90 pop r0 3c210: 07 fc sbrc r0, 7 3c212: ee 5f subi r30, 0xFE ; 254 3c214: 0d 94 a1 df jmp 0x3bf42 ; 0x3bf42 <__fp_sinus> 3c218: 19 f4 brne .+6 ; 0x3c220 3c21a: 16 f4 brtc .+4 ; 0x3c220 3c21c: 0d 94 5c d7 jmp 0x3aeb8 ; 0x3aeb8 <__fp_nan> 3c220: 0d 94 41 df jmp 0x3be82 ; 0x3be82 <__fp_mpack> 0003c224 : 3c224: 0f 94 86 d7 call 0x3af0c ; 0x3af0c <__fp_splitA> 3c228: b8 f3 brcs .-18 ; 0x3c218 3c22a: 99 23 and r25, r25 3c22c: c9 f3 breq .-14 ; 0x3c220 3c22e: b6 f3 brts .-20 ; 0x3c21c 3c230: 9f 57 subi r25, 0x7F ; 127 3c232: 55 0b sbc r21, r21 3c234: 87 ff sbrs r24, 7 3c236: 0f 94 91 e1 call 0x3c322 ; 0x3c322 <__fp_norm2> 3c23a: 00 24 eor r0, r0 3c23c: a0 e6 ldi r26, 0x60 ; 96 3c23e: 40 ea ldi r20, 0xA0 ; 160 3c240: 90 01 movw r18, r0 3c242: 80 58 subi r24, 0x80 ; 128 3c244: 56 95 lsr r21 3c246: 97 95 ror r25 3c248: 28 f4 brcc .+10 ; 0x3c254 3c24a: 80 5c subi r24, 0xC0 ; 192 3c24c: 66 0f add r22, r22 3c24e: 77 1f adc r23, r23 3c250: 88 1f adc r24, r24 3c252: 20 f0 brcs .+8 ; 0x3c25c 3c254: 26 17 cp r18, r22 3c256: 37 07 cpc r19, r23 3c258: 48 07 cpc r20, r24 3c25a: 30 f4 brcc .+12 ; 0x3c268 3c25c: 62 1b sub r22, r18 3c25e: 73 0b sbc r23, r19 3c260: 84 0b sbc r24, r20 3c262: 20 29 or r18, r0 3c264: 31 29 or r19, r1 3c266: 4a 2b or r20, r26 3c268: a6 95 lsr r26 3c26a: 17 94 ror r1 3c26c: 07 94 ror r0 3c26e: 20 25 eor r18, r0 3c270: 31 25 eor r19, r1 3c272: 4a 27 eor r20, r26 3c274: 58 f7 brcc .-42 ; 0x3c24c 3c276: 66 0f add r22, r22 3c278: 77 1f adc r23, r23 3c27a: 88 1f adc r24, r24 3c27c: 20 f0 brcs .+8 ; 0x3c286 3c27e: 26 17 cp r18, r22 3c280: 37 07 cpc r19, r23 3c282: 48 07 cpc r20, r24 3c284: 30 f4 brcc .+12 ; 0x3c292 3c286: 62 0b sbc r22, r18 3c288: 73 0b sbc r23, r19 3c28a: 84 0b sbc r24, r20 3c28c: 20 0d add r18, r0 3c28e: 31 1d adc r19, r1 3c290: 41 1d adc r20, r1 3c292: a0 95 com r26 3c294: 81 f7 brne .-32 ; 0x3c276 3c296: b9 01 movw r22, r18 3c298: 84 2f mov r24, r20 3c29a: 91 58 subi r25, 0x81 ; 129 3c29c: 88 0f add r24, r24 3c29e: 96 95 lsr r25 3c2a0: 87 95 ror r24 3c2a2: 08 95 ret 0003c2a4 <__unordsf2>: 3c2a4: 0f 94 02 df call 0x3be04 ; 0x3be04 <__fp_cmp> 3c2a8: 88 0b sbc r24, r24 3c2aa: 99 0b sbc r25, r25 3c2ac: 08 95 ret 3c2ae: 29 f4 brne .+10 ; 0x3c2ba <__unordsf2+0x16> 3c2b0: 16 f0 brts .+4 ; 0x3c2b6 <__unordsf2+0x12> 3c2b2: 0d 94 56 d7 jmp 0x3aeac ; 0x3aeac <__fp_inf> 3c2b6: 0d 94 a0 d7 jmp 0x3af40 ; 0x3af40 <__fp_zero> 3c2ba: 0d 94 5c d7 jmp 0x3aeb8 ; 0x3aeb8 <__fp_nan> 0003c2be : 3c2be: 0f 94 86 d7 call 0x3af0c ; 0x3af0c <__fp_splitA> 3c2c2: a8 f3 brcs .-22 ; 0x3c2ae <__unordsf2+0xa> 3c2c4: 96 38 cpi r25, 0x86 ; 134 3c2c6: a0 f7 brcc .-24 ; 0x3c2b0 <__unordsf2+0xc> 3c2c8: 07 f8 bld r0, 7 3c2ca: 0f 92 push r0 3c2cc: e8 94 clt 3c2ce: 2b e3 ldi r18, 0x3B ; 59 3c2d0: 3a ea ldi r19, 0xAA ; 170 3c2d2: 48 eb ldi r20, 0xB8 ; 184 3c2d4: 5f e7 ldi r21, 0x7F ; 127 3c2d6: 0f 94 ff d6 call 0x3adfe ; 0x3adfe <__mulsf3_pse> 3c2da: 0f 92 push r0 3c2dc: 0f 92 push r0 3c2de: 0f 92 push r0 3c2e0: 4d b7 in r20, 0x3d ; 61 3c2e2: 5e b7 in r21, 0x3e ; 62 3c2e4: 0f 92 push r0 3c2e6: 0f 94 fc e1 call 0x3c3f8 ; 0x3c3f8 3c2ea: e1 e9 ldi r30, 0x91 ; 145 3c2ec: f1 e7 ldi r31, 0x71 ; 113 3c2ee: 0f 94 4f df call 0x3be9e ; 0x3be9e <__fp_powser> 3c2f2: 4f 91 pop r20 3c2f4: 5f 91 pop r21 3c2f6: ef 91 pop r30 3c2f8: ff 91 pop r31 3c2fa: e5 95 asr r30 3c2fc: ee 1f adc r30, r30 3c2fe: ff 1f adc r31, r31 3c300: 49 f0 breq .+18 ; 0x3c314 3c302: fe 57 subi r31, 0x7E ; 126 3c304: e0 68 ori r30, 0x80 ; 128 3c306: 44 27 eor r20, r20 3c308: ee 0f add r30, r30 3c30a: 44 1f adc r20, r20 3c30c: fa 95 dec r31 3c30e: e1 f7 brne .-8 ; 0x3c308 3c310: 41 95 neg r20 3c312: 55 0b sbc r21, r21 3c314: 0f 94 4b e0 call 0x3c096 ; 0x3c096 3c318: 0f 90 pop r0 3c31a: 07 fe sbrs r0, 7 3c31c: 0d 94 3f e0 jmp 0x3c07e ; 0x3c07e 3c320: 08 95 ret 0003c322 <__fp_norm2>: 3c322: 91 50 subi r25, 0x01 ; 1 3c324: 50 40 sbci r21, 0x00 ; 0 3c326: 66 0f add r22, r22 3c328: 77 1f adc r23, r23 3c32a: 88 1f adc r24, r24 3c32c: d2 f7 brpl .-12 ; 0x3c322 <__fp_norm2> 3c32e: 08 95 ret 0003c330 <__fp_powsodd>: 3c330: 9f 93 push r25 3c332: 8f 93 push r24 3c334: 7f 93 push r23 3c336: 6f 93 push r22 3c338: ff 93 push r31 3c33a: ef 93 push r30 3c33c: 9b 01 movw r18, r22 3c33e: ac 01 movw r20, r24 3c340: 0f 94 e9 d6 call 0x3add2 ; 0x3add2 <__mulsf3> 3c344: ef 91 pop r30 3c346: ff 91 pop r31 3c348: 0f 94 4f df call 0x3be9e ; 0x3be9e <__fp_powser> 3c34c: 2f 91 pop r18 3c34e: 3f 91 pop r19 3c350: 4f 91 pop r20 3c352: 5f 91 pop r21 3c354: 0d 94 e9 d6 jmp 0x3add2 ; 0x3add2 <__mulsf3> 3c358: 16 f0 brts .+4 ; 0x3c35e <__fp_powsodd+0x2e> 3c35a: 0d 94 41 df jmp 0x3be82 ; 0x3be82 <__fp_mpack> 3c35e: 0d 94 5c d7 jmp 0x3aeb8 ; 0x3aeb8 <__fp_nan> 3c362: 68 94 set 3c364: 0d 94 56 d7 jmp 0x3aeac ; 0x3aeac <__fp_inf> 0003c368 : 3c368: 0f 94 86 d7 call 0x3af0c ; 0x3af0c <__fp_splitA> 3c36c: a8 f3 brcs .-22 ; 0x3c358 <__fp_powsodd+0x28> 3c36e: 99 23 and r25, r25 3c370: c1 f3 breq .-16 ; 0x3c362 <__fp_powsodd+0x32> 3c372: ae f3 brts .-22 ; 0x3c35e <__fp_powsodd+0x2e> 3c374: df 93 push r29 3c376: cf 93 push r28 3c378: 1f 93 push r17 3c37a: 0f 93 push r16 3c37c: ff 92 push r15 3c37e: c9 2f mov r28, r25 3c380: dd 27 eor r29, r29 3c382: 88 23 and r24, r24 3c384: 2a f0 brmi .+10 ; 0x3c390 3c386: 21 97 sbiw r28, 0x01 ; 1 3c388: 66 0f add r22, r22 3c38a: 77 1f adc r23, r23 3c38c: 88 1f adc r24, r24 3c38e: da f7 brpl .-10 ; 0x3c386 3c390: 20 e0 ldi r18, 0x00 ; 0 3c392: 30 e0 ldi r19, 0x00 ; 0 3c394: 40 e8 ldi r20, 0x80 ; 128 3c396: 5f eb ldi r21, 0xBF ; 191 3c398: 9f e3 ldi r25, 0x3F ; 63 3c39a: 88 39 cpi r24, 0x98 ; 152 3c39c: 20 f0 brcs .+8 ; 0x3c3a6 3c39e: 80 3e cpi r24, 0xE0 ; 224 3c3a0: 38 f0 brcs .+14 ; 0x3c3b0 3c3a2: 21 96 adiw r28, 0x01 ; 1 3c3a4: 8f 77 andi r24, 0x7F ; 127 3c3a6: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 3c3aa: e9 eb ldi r30, 0xB9 ; 185 3c3ac: f1 e7 ldi r31, 0x71 ; 113 3c3ae: 04 c0 rjmp .+8 ; 0x3c3b8 3c3b0: 0f 94 44 dd call 0x3ba88 ; 0x3ba88 <__addsf3> 3c3b4: e6 ee ldi r30, 0xE6 ; 230 3c3b6: f1 e7 ldi r31, 0x71 ; 113 3c3b8: 0f 94 4f df call 0x3be9e ; 0x3be9e <__fp_powser> 3c3bc: 8b 01 movw r16, r22 3c3be: be 01 movw r22, r28 3c3c0: ec 01 movw r28, r24 3c3c2: fb 2e mov r15, r27 3c3c4: 6f 57 subi r22, 0x7F ; 127 3c3c6: 71 09 sbc r23, r1 3c3c8: 75 95 asr r23 3c3ca: 77 1f adc r23, r23 3c3cc: 88 0b sbc r24, r24 3c3ce: 99 0b sbc r25, r25 3c3d0: 0f 94 aa d6 call 0x3ad54 ; 0x3ad54 <__floatsisf> 3c3d4: 28 e1 ldi r18, 0x18 ; 24 3c3d6: 32 e7 ldi r19, 0x72 ; 114 3c3d8: 41 e3 ldi r20, 0x31 ; 49 3c3da: 5f e3 ldi r21, 0x3F ; 63 3c3dc: 0f 94 fc d6 call 0x3adf8 ; 0x3adf8 <__mulsf3x> 3c3e0: af 2d mov r26, r15 3c3e2: 98 01 movw r18, r16 3c3e4: ae 01 movw r20, r28 3c3e6: ff 90 pop r15 3c3e8: 0f 91 pop r16 3c3ea: 1f 91 pop r17 3c3ec: cf 91 pop r28 3c3ee: df 91 pop r29 3c3f0: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 <__addsf3x> 3c3f4: 0d 94 6d d7 jmp 0x3aeda ; 0x3aeda <__fp_round> 0003c3f8 : 3c3f8: fa 01 movw r30, r20 3c3fa: dc 01 movw r26, r24 3c3fc: aa 0f add r26, r26 3c3fe: bb 1f adc r27, r27 3c400: 9b 01 movw r18, r22 3c402: ac 01 movw r20, r24 3c404: bf 57 subi r27, 0x7F ; 127 3c406: 28 f4 brcc .+10 ; 0x3c412 3c408: 22 27 eor r18, r18 3c40a: 33 27 eor r19, r19 3c40c: 44 27 eor r20, r20 3c40e: 50 78 andi r21, 0x80 ; 128 3c410: 20 c0 rjmp .+64 ; 0x3c452 3c412: b7 51 subi r27, 0x17 ; 23 3c414: 90 f4 brcc .+36 ; 0x3c43a 3c416: ab 2f mov r26, r27 3c418: 00 24 eor r0, r0 3c41a: 46 95 lsr r20 3c41c: 37 95 ror r19 3c41e: 27 95 ror r18 3c420: 01 1c adc r0, r1 3c422: a3 95 inc r26 3c424: d2 f3 brmi .-12 ; 0x3c41a 3c426: 00 20 and r0, r0 3c428: 71 f0 breq .+28 ; 0x3c446 3c42a: 22 0f add r18, r18 3c42c: 33 1f adc r19, r19 3c42e: 44 1f adc r20, r20 3c430: b3 95 inc r27 3c432: da f3 brmi .-10 ; 0x3c42a 3c434: 0e d0 rcall .+28 ; 0x3c452 3c436: 0d 94 43 dd jmp 0x3ba86 ; 0x3ba86 <__subsf3> 3c43a: 61 30 cpi r22, 0x01 ; 1 3c43c: 71 05 cpc r23, r1 3c43e: a0 e8 ldi r26, 0x80 ; 128 3c440: 8a 07 cpc r24, r26 3c442: b9 46 sbci r27, 0x69 ; 105 3c444: 30 f4 brcc .+12 ; 0x3c452 3c446: 9b 01 movw r18, r22 3c448: ac 01 movw r20, r24 3c44a: 66 27 eor r22, r22 3c44c: 77 27 eor r23, r23 3c44e: 88 27 eor r24, r24 3c450: 90 78 andi r25, 0x80 ; 128 3c452: 30 96 adiw r30, 0x00 ; 0 3c454: 21 f0 breq .+8 ; 0x3c45e 3c456: 20 83 st Z, r18 3c458: 31 83 std Z+1, r19 ; 0x01 3c45a: 42 83 std Z+2, r20 ; 0x02 3c45c: 53 83 std Z+3, r21 ; 0x03 3c45e: 08 95 ret 0003c460 : 3c460: 91 11 cpse r25, r1 3c462: 08 95 ret 3c464: 81 54 subi r24, 0x41 ; 65 3c466: 8a 51 subi r24, 0x1A ; 26 3c468: 08 f4 brcc .+2 ; 0x3c46c 3c46a: 80 5e subi r24, 0xE0 ; 224 3c46c: 85 5a subi r24, 0xA5 ; 165 3c46e: 08 95 ret 0003c470 : 3c470: fb 01 movw r30, r22 3c472: dc 01 movw r26, r24 3c474: 04 c0 rjmp .+8 ; 0x3c47e 3c476: 8d 91 ld r24, X+ 3c478: 01 90 ld r0, Z+ 3c47a: 80 19 sub r24, r0 3c47c: 21 f4 brne .+8 ; 0x3c486 3c47e: 41 50 subi r20, 0x01 ; 1 3c480: 50 40 sbci r21, 0x00 ; 0 3c482: c8 f7 brcc .-14 ; 0x3c476 3c484: 88 1b sub r24, r24 3c486: 99 0b sbc r25, r25 3c488: 08 95 ret 0003c48a : 3c48a: fb 01 movw r30, r22 3c48c: dc 01 movw r26, r24 3c48e: 02 c0 rjmp .+4 ; 0x3c494 3c490: 01 90 ld r0, Z+ 3c492: 0d 92 st X+, r0 3c494: 41 50 subi r20, 0x01 ; 1 3c496: 50 40 sbci r21, 0x00 ; 0 3c498: d8 f7 brcc .-10 ; 0x3c490 3c49a: 08 95 ret 0003c49c : 3c49c: dc 01 movw r26, r24 3c49e: 01 c0 rjmp .+2 ; 0x3c4a2 3c4a0: 6d 93 st X+, r22 3c4a2: 41 50 subi r20, 0x01 ; 1 3c4a4: 50 40 sbci r21, 0x00 ; 0 3c4a6: e0 f7 brcc .-8 ; 0x3c4a0 3c4a8: 08 95 ret 0003c4aa : 3c4aa: fb 01 movw r30, r22 3c4ac: dc 01 movw r26, r24 3c4ae: 8d 91 ld r24, X+ 3c4b0: 81 34 cpi r24, 0x41 ; 65 3c4b2: 1c f0 brlt .+6 ; 0x3c4ba 3c4b4: 8b 35 cpi r24, 0x5B ; 91 3c4b6: 0c f4 brge .+2 ; 0x3c4ba 3c4b8: 80 5e subi r24, 0xE0 ; 224 3c4ba: 61 91 ld r22, Z+ 3c4bc: 61 34 cpi r22, 0x41 ; 65 3c4be: 1c f0 brlt .+6 ; 0x3c4c6 3c4c0: 6b 35 cpi r22, 0x5B ; 91 3c4c2: 0c f4 brge .+2 ; 0x3c4c6 3c4c4: 60 5e subi r22, 0xE0 ; 224 3c4c6: 86 1b sub r24, r22 3c4c8: 61 11 cpse r22, r1 3c4ca: 89 f3 breq .-30 ; 0x3c4ae 3c4cc: 99 0b sbc r25, r25 3c4ce: 08 95 ret 0003c4d0 : 3c4d0: fb 01 movw r30, r22 3c4d2: dc 01 movw r26, r24 3c4d4: 0d 90 ld r0, X+ 3c4d6: 00 20 and r0, r0 3c4d8: e9 f7 brne .-6 ; 0x3c4d4 3c4da: 11 97 sbiw r26, 0x01 ; 1 3c4dc: 01 90 ld r0, Z+ 3c4de: 0d 92 st X+, r0 3c4e0: 00 20 and r0, r0 3c4e2: e1 f7 brne .-8 ; 0x3c4dc 3c4e4: 08 95 ret 0003c4e6 : 3c4e6: fc 01 movw r30, r24 3c4e8: 81 91 ld r24, Z+ 3c4ea: 86 17 cp r24, r22 3c4ec: 21 f0 breq .+8 ; 0x3c4f6 3c4ee: 88 23 and r24, r24 3c4f0: d9 f7 brne .-10 ; 0x3c4e8 3c4f2: 99 27 eor r25, r25 3c4f4: 08 95 ret 3c4f6: 31 97 sbiw r30, 0x01 ; 1 3c4f8: cf 01 movw r24, r30 3c4fa: 08 95 ret 0003c4fc : 3c4fc: fb 01 movw r30, r22 3c4fe: dc 01 movw r26, r24 3c500: 8d 91 ld r24, X+ 3c502: 01 90 ld r0, Z+ 3c504: 80 19 sub r24, r0 3c506: 01 10 cpse r0, r1 3c508: d9 f3 breq .-10 ; 0x3c500 3c50a: 99 0b sbc r25, r25 3c50c: 08 95 ret 0003c50e : 3c50e: fb 01 movw r30, r22 3c510: dc 01 movw r26, r24 3c512: 01 90 ld r0, Z+ 3c514: 0d 92 st X+, r0 3c516: 00 20 and r0, r0 3c518: e1 f7 brne .-8 ; 0x3c512 3c51a: 08 95 ret 0003c51c : 3c51c: fb 01 movw r30, r22 3c51e: dc 01 movw r26, r24 3c520: 41 50 subi r20, 0x01 ; 1 3c522: 50 40 sbci r21, 0x00 ; 0 3c524: 30 f0 brcs .+12 ; 0x3c532 3c526: 8d 91 ld r24, X+ 3c528: 01 90 ld r0, Z+ 3c52a: 80 19 sub r24, r0 3c52c: 19 f4 brne .+6 ; 0x3c534 3c52e: 00 20 and r0, r0 3c530: b9 f7 brne .-18 ; 0x3c520 3c532: 88 1b sub r24, r24 3c534: 99 0b sbc r25, r25 3c536: 08 95 ret 0003c538 : 3c538: fb 01 movw r30, r22 3c53a: dc 01 movw r26, r24 3c53c: 41 50 subi r20, 0x01 ; 1 3c53e: 50 40 sbci r21, 0x00 ; 0 3c540: 48 f0 brcs .+18 ; 0x3c554 3c542: 01 90 ld r0, Z+ 3c544: 0d 92 st X+, r0 3c546: 00 20 and r0, r0 3c548: c9 f7 brne .-14 ; 0x3c53c 3c54a: 01 c0 rjmp .+2 ; 0x3c54e 3c54c: 1d 92 st X+, r1 3c54e: 41 50 subi r20, 0x01 ; 1 3c550: 50 40 sbci r21, 0x00 ; 0 3c552: e0 f7 brcc .-8 ; 0x3c54c 3c554: 08 95 ret 0003c556 : 3c556: 0f 93 push r16 3c558: 1f 93 push r17 3c55a: cf 93 push r28 3c55c: df 93 push r29 3c55e: e0 91 1c 18 lds r30, 0x181C ; 0x80181c <__iob+0x2> 3c562: f0 91 1d 18 lds r31, 0x181D ; 0x80181d <__iob+0x3> 3c566: 23 81 ldd r18, Z+3 ; 0x03 3c568: ec 01 movw r28, r24 3c56a: 10 e0 ldi r17, 0x00 ; 0 3c56c: 00 e0 ldi r16, 0x00 ; 0 3c56e: 21 fd sbrc r18, 1 3c570: 08 c0 rjmp .+16 ; 0x3c582 3c572: 0f ef ldi r16, 0xFF ; 255 3c574: 1f ef ldi r17, 0xFF ; 255 3c576: 14 c0 rjmp .+40 ; 0x3c5a0 3c578: 19 95 eicall 3c57a: 89 2b or r24, r25 3c57c: 11 f0 breq .+4 ; 0x3c582 3c57e: 0f ef ldi r16, 0xFF ; 255 3c580: 1f ef ldi r17, 0xFF ; 255 3c582: 89 91 ld r24, Y+ 3c584: 60 91 1c 18 lds r22, 0x181C ; 0x80181c <__iob+0x2> 3c588: 70 91 1d 18 lds r23, 0x181D ; 0x80181d <__iob+0x3> 3c58c: db 01 movw r26, r22 3c58e: 18 96 adiw r26, 0x08 ; 8 3c590: ed 91 ld r30, X+ 3c592: fc 91 ld r31, X 3c594: 81 11 cpse r24, r1 3c596: f0 cf rjmp .-32 ; 0x3c578 3c598: 8a e0 ldi r24, 0x0A ; 10 3c59a: 19 95 eicall 3c59c: 89 2b or r24, r25 3c59e: 49 f7 brne .-46 ; 0x3c572 3c5a0: c8 01 movw r24, r16 3c5a2: df 91 pop r29 3c5a4: cf 91 pop r28 3c5a6: 1f 91 pop r17 3c5a8: 0f 91 pop r16 3c5aa: 08 95 ret 0003c5ac <__do_global_dtors>: 3c5ac: 16 e5 ldi r17, 0x56 ; 86 3c5ae: c5 eb ldi r28, 0xB5 ; 181 3c5b0: d6 e5 ldi r29, 0x56 ; 86 3c5b2: 00 e0 ldi r16, 0x00 ; 0 3c5b4: 06 c0 rjmp .+12 ; 0x3c5c2 <__do_global_dtors+0x16> 3c5b6: 80 2f mov r24, r16 3c5b8: fe 01 movw r30, r28 3c5ba: 0f 94 2c dd call 0x3ba58 ; 0x3ba58 <__tablejump2__> 3c5be: 21 96 adiw r28, 0x01 ; 1 3c5c0: 01 1d adc r16, r1 3c5c2: c6 3b cpi r28, 0xB6 ; 182 3c5c4: d1 07 cpc r29, r17 3c5c6: 80 e0 ldi r24, 0x00 ; 0 3c5c8: 08 07 cpc r16, r24 3c5ca: a9 f7 brne .-22 ; 0x3c5b6 <__do_global_dtors+0xa> 3c5cc: f8 94 cli 0003c5ce <__stop_program>: 3c5ce: ff cf rjmp .-2 ; 0x3c5ce <__stop_program>